Built motion from commit ff233442.|2.6.10
authorsupport <support@xcally.com>
Wed, 11 May 2022 11:17:17 +0000 (11:17 +0000)
committersupport <support@xcally.com>
Wed, 11 May 2022 11:17:17 +0000 (11:17 +0000)
1203 files changed:
apidoc/api_project.js
apidoc/api_project.json
public/app/main/apps/analytics/i18n/pt-BR.json
public/app/main/apps/callysquare/i18n/pt-BR.json
public/app/main/apps/contactmanager/i18n/pt-BR.json
public/app/main/apps/dashboards/i18n/sv.json
public/app/main/apps/motiondialer/i18n/pt-BR.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/components/realtime/queues.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/google/index.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/voiceQueueSummary.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/realtime/utils.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 1cd9de3..c2fa397 100644 (file)
@@ -17,7 +17,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2022-05-10T16:25:28.557Z",
+    "time": "2022-05-11T11:09:04.852Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 3a20596..04fc534 100644 (file)
@@ -17,7 +17,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2022-05-10T16:25:28.557Z",
+    "time": "2022-05-11T11:09:04.852Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 4a4f088..90c2dff 100644 (file)
@@ -1,7 +1,7 @@
 {
   "ANALYTICS": {
     "SEND_IF_EMPTY": "Enviar se vazio",
-    "REPORTNAME": "Nome do relatório",
+    "REPORTNAME": "Nome do Relatório",
     "DELETE": "Excluir",
     "NAME": "Nome",
     "ANALYTICS": "Relatórios",
       "CUSTOM_METRIC_REQUIRED": "Campo obrigatório",
       "ALIAS_REQUIRED": "Campo obrigatório"
     },
-    "NEW_METRIC": "Nova métrica",
-    "ADD_METRIC": "Adicionar métrica",
-    "EDIT_METRIC": "Editar métrica",
-    "DELETE_METRIC": "Excluir métrica",
+    "NEW_METRIC": "Nova Métrica",
+    "ADD_METRIC": "Adicionar Métrica",
+    "EDIT_METRIC": "Editar Métrica",
+    "DELETE_METRIC": "Excluir Métrica",
     "SAVE": "Salvar",
     "BACK": "Voltar",
     "SELECTED": "Selecionado",
-    "SELECT_ALL": "Selecionar todos",
-    "SELECT_NONE": "Selecione nenhum",
+    "SELECT_ALL": "Selecionar Todos",
+    "SELECT_NONE": "Selecione Nenhum",
     "TYPE": "Tipo",
-    "EXTRACTEDREPORTS": "Relatórios extraídos",
-    "DATE_RANGE_FROM": "Intervalo de datas de",
-    "DATE_RANGE_TO": "Intervalo de datas para",
+    "EXTRACTEDREPORTS": "Relatórios Extraídos",
+    "DATE_RANGE_FROM": "Intervalo de Datas de",
+    "DATE_RANGE_TO": "Intervalo de Datas para",
     "GENERATED_AT": "Gerado em",
     "STATUS": "Status",
     "OUTPUT": "Saída",
     "REPORTS": "Relatórios",
-    "SEARCH_FOR_FOLDER": "Procurar por pasta",
+    "SEARCH_FOR_FOLDER": "Procurar por Pasta",
     "CREATED_AT": "Criado em",
-    "NEW_REPORT": "Novo relatório",
-    "ADD_REPORT": "Adicionar relatório",
-    "COPY_REPORT": "Copiar relatório",
-    "PREVIEW_REPORT": "Relatório de pré-visualização",
-    "RUN_REPORT": "Executar relatório",
-    "DOWNLOAD_JSON_REPORT": "Exportar relatório JSON",
-    "EDIT_REPORT": "Editar relatório",
-    "DELETE_REPORT": "Excluir relatório",
-    "CREATE": "Criar pasta",
-    "RENAME": "Renomear pasta",
-    "REMOVE": "Remover pasta",
-    "SELECT_NODE": "Selecione a pasta",
+    "NEW_REPORT": "Novo Relatório",
+    "ADD_REPORT": "Adicionar Relatório",
+    "COPY_REPORT": "Copiar Relatório",
+    "PREVIEW_REPORT": "Pré-visualizar Relatório",
+    "RUN_REPORT": "Executar Relatório",
+    "DOWNLOAD_JSON_REPORT": "Exportar Relatório JSON",
+    "EDIT_REPORT": "Editar Relatório",
+    "DELETE_REPORT": "Excluir Relatório",
+    "CREATE": "Criar Pasta",
+    "RENAME": "Renomear Pasta",
+    "REMOVE": "Remover Pasta",
+    "SELECT_NODE": "Selecione a Pasta",
     "ERROR": "Erro",
-    "QUERY_ERROR": "Erro de consulta",
+    "QUERY_ERROR": "Erro de Consulta",
     "MESSAGE": "Mensagem",
     "CLOSE": "Fechar",
     "FORMAT": "Formato",
     "GROUP": "Grupo",
     "COLUMN": "Coluna",
     "VALUE": "Valor",
-    "PREVIEW": "Visualizar",
-    "LIMITED_RESULT": "* Resultados limitados",
+    "PREVIEW": "Pré-visualizar",
+    "LIMITED_RESULT": "*Resultados limitados",
     "NO_DATA": "Nenhum resultado de dados",
     "CONDITIONS": "Condições",
     "ALIAS": "Alias",
     "FUNCTION": "Função",
     "GROUP_BY": "Agrupar por",
     "ORDER_BY": "Ordenar por",
-    "ADD_REPORTFIELD": "Adicionar campo",
-    "EDIT_REPORTFIELD": "Editar campo",
-    "DELETE_REPORTFIELD": "Excluir campo",
-    "METRIC_NAME": "Nome métrica",
-    "NO_METRIC_FOUND": "Nenhuma métrica encontrada",
-    "NO_AVAILABLE_INFO": "Nenhuma informação disponível",
-    "CUSTOM_METRIC": "Métrica personalizada",
-    "DELETE_EXTRACTEDREPORT": "Excluir relatório extraído",
-    "EDIT_EXTRACTEDREPORT": "Editar relatório extraído",
-    "DOWNLOAD_EXTRACTEDREPORT": "Download do relatório extraído",
+    "ADD_REPORTFIELD": "Adicionar Campo",
+    "EDIT_REPORTFIELD": "Editar Campo",
+    "DELETE_REPORTFIELD": "Excluir Campo",
+    "METRIC_NAME": "Nome Métrica",
+    "NO_METRIC_FOUND": "Nenhuma Métrica Encontrada",
+    "NO_AVAILABLE_INFO": "Nenhuma Informação Disponível",
+    "CUSTOM_METRIC": "Métrica Personalizada",
+    "DELETE_EXTRACTEDREPORT": "Excluir Relatório Extraído",
+    "EDIT_EXTRACTEDREPORT": "Editar Relatório Extraído",
+    "DOWNLOAD_EXTRACTEDREPORT": "Download do Relatório Extraído",
     "PAGE": "Página",
-    "ROWSPERPAGE": "Linhas por página",
+    "ROWSPERPAGE": "Linhas por Página",
     "OF": "do",
-    "WEB_REPORT": "Relatório da web"
+    "WEB_REPORT": "Relatório Web"
   }
 }
index 65af7ca..43ccb77 100644 (file)
@@ -1,73 +1,73 @@
 {
   "CALLYSQUARE": {
     "ACCOUNT_ID": "Conta",
-    "ADDUSER_PROJECTS": "Adicionar usuários ao projeto",
+    "ADDUSER_PROJECTS": "Adicionar Usuários ao Projeto",
     "ADD_ODBC": "Adicionar ODBC",
     "ADD_PROJECT": "Adicionar Projeto",
     "ADD_VARIABLE": "Adicionar Variável",
     "AGENTS": "Agentes",
     "AGI": "AGI",
-    "ALL_USERS": "Todos os usuários",
+    "ALL_USERS": "Todos Usuários",
     "ANSWER": "Responda",
     "APIKEY": "Chave API",
-    "APPID": "ID do aplicativo",
+    "APPID": "ID do Aplicativo",
     "APPLICATION": "Aplicação",
-    "APPSECRET": "App Secret",
+    "APPSECRET": "Senha do Aplicativo",
     "ARGS": "Argumentos",
     "ATTACHMENT_NAME": "Nome do Anexo",
-    "ATTACHMENT_PATH": "Caminho de Anexos",
+    "ATTACHMENT_PATH": "Caminho do Anexo",
     "ATTACHMENT_TYPE": "Tipo de Anexo",
-    "AUDIO": "Audio",
-    "AUDIOENCODING": "Codificação de áudio",
+    "AUDIO": "Áudio",
+    "AUDIOENCODING": "Codificação de Áudio",
     "AWSLEX": "Amazon Lex",
     "AWSPOLLY": "AWS Polly",
-    "AWS_ACCESS_KEY_ID": "Access Key ID",
-    "AWS_BOT_NAME": "Nome BOT",
+    "AWS_ACCESS_KEY_ID": "ID Chave de Acesso",
+    "AWS_BOT_NAME": "Nome Bot",
     "AWS_LEX_REGION": "Região",
     "AWS_POLLY_REGION": "Região",
     "AWS_POLLY_VOICE": "Voz",
-    "AWS_SECRET_ACCESS_KEY": "Secret Access Key",
+    "AWS_SECRET_ACCESS_KEY": "Senha da Chave de Acesso",
     "AWS_TEXT_TYPE": "Tipo de texto",
     "BACK": "Voltar",
     "BCC": "BCC",
     "BEEP": "Beep",
-    "BODY": "Corpo",
+    "BODY": "Body",
     "CALLBACK": "Callback",
     "CALLBACK_PRIORITY": "Prioridade",
     "CALLYSQUARE": "Cally Square",
     "CC": "CC",
-    "CHOOSE_ATTACHMENT": "Escolha o anexo",
+    "CHOOSE_ATTACHMENT": "Escolha o Anexo",
     "CLOSE": "Fechar",
     "COMMAND": "Comando",
     "COMPUTEDVARIABLES": "Caminho do script de variáveis computadas",
     "CONDITION": "Condição",
     "CONTEXT": "Contexto",
     "COPY": "Copiar",
-    "COPY_PROJECT": "Copiar projeto",
+    "COPY_PROJECT": "Copiar Projeto",
     "CREATED_AT": "Criado em",
     "CUSTOM_ACTION": "Ação Personalizada",
-    "CUSTOM_ACTION_DATA": "Dados de ação personalizada",
+    "CUSTOM_ACTION_DATA": "Dados de Ação Personalizada",
     "CUSTOM_APP": "Aplicativo Personalizado",
-    "DATABASE": "Base de dados",
+    "DATABASE": "Database",
     "DELAY": "delay [min]",
     "DELETE": "Excluir",
     "DELETE_ODBC": "Deletar ODBC",
     "DELETE_PROJECT": "Deletar Projeto",
-    "DELETE_SQUARERECORDING": "Excluir gravação",
+    "DELETE_SQUARERECORDING": "Excluir Gravação Cally Square",
     "DESCRIPTION": "Descrição",
     "DIAL": "Discar",
     "DIALOGFLOW": "Dialogflow",
     "DIALOGFLOW_LANGUAGE": "Idioma",
     "DIGIT": "Max Dígitos",
     "DIGITS": "Dígitos",
-    "DOWNLOAD_SQUARERECORDING": "Download Gravação",
-    "DROP_TO_UPLOAD": "DROP TO UPLOAD",
+    "DOWNLOAD_SQUARERECORDING": "Download Gravação Cally Square",
+    "DROP_TO_UPLOAD": "SOLTAR AQUI PARA CARREGAR",
     "DROP_TO_UPLOAD_MESSAGE": "Você também pode soltar arquivos aqui para fazer o upload. Apenas XML - Máx. 5MB",
     "DSN": "DSN",
     "EDIT": "Editar",
     "EDIT_ODBC": "Editar ODBC",
     "EDIT_PROJECT": "Editar Projeto",
-    "EDIT_SQUARERECORDING": "Editar gravação",
+    "EDIT_SQUARERECORDING": "Editar Gravação Cally Square",
     "EDIT_XML": "Editar XML",
     "END": "Fim",
     "ERRORS": {
       "PROJECT_REQUIRED": "Campo obrigatório",
       "URL_REQUIRED": "Campo obrigatório"
     },
-    "ESCAPE_DIGITS": "Dígitos de Escape",
+    "ESCAPE_DIGITS": "Escape Digits",
     "EXTEN": "Exten",
     "EXTENSION": "Extensão",
     "EXT_DIAL": "Discagem Externa",
     "FILE": "Nome do arquivo",
-    "FILENAME": "Nome do arquivo",
-    "FILE_ID": "Audio",
+    "FILENAME": "Nome do Arquivo",
+    "FILE_ID": "Áudio",
     "FINALLY": "Finalmente",
     "FINDBY": "Encontrar por",
     "GETDIGITS": "Obter dígitos",
-    "GETSECRETDIGITS": "Obter dígitos secretos",
+    "GETSECRETDIGITS": "Obter Dígitos Secretos",
     "GOAL": "Objetivo",
-    "GOALNAME": "Nome do objetivo",
+    "GOALNAME": "Nome do Objetivo",
     "GOOGLEASR": "GoogleASR",
     "GOOGLE_ASR_LANGUAGE": "Idioma",
     "GOOGLE_CLOUD_TTS": "Google Cloud TTS",
-    "GOOGLE_CLOUD_TTS_TEXT_TYPE": "Tipo de texto",
+    "GOOGLE_CLOUD_TTS_TEXT_TYPE": "Tipo de Texto",
     "GOOGLE_TTS_LANGUAGE": "Idioma",
     "GOSUB": "GoSub",
     "GOTOC": "GoTo",
     "HANGUP": "Desligar",
     "HEADERS": "Cabeçalhos",
     "HELP": {
-      "BCC": "Você pode adicionar vários endereços separados por vírgulas (por exemplo, john.doe@xcally.com, jane.miller@xcally.com)",
-      "CC": "Você pode adicionar vários endereços separados por vírgulas (por exemplo, john.doe@xcally.com, jane.miller@xcally.com)",
-      "DSN": "Example: DRIVER=MySQL;SERVER=127.0.0.1;UID=xcall;PWD=password;DATABASE=motion",
+      "BCC": "Você pode adicionar vários endereços separados por vírgulas (exemplo: john.doe@xcally.com, jane.miller@xcally.com)",
+      "CC": "Você pode adicionar vários endereços separados por vírgulas (exemplo: john.doe@xcally.com, jane.miller@xcally.com)",
+      "DSN": "Exemplo: DRIVER=MySQL;SERVER=127.0.0.1;UID=xcall;PWD=password;DATABASE=motion",
       "MAILBOX": "mailbox@context",
       "MAX_TEXT_TTS": "O número máximo de caracteres suportados é 200",
-      "TO": "Você pode adicionar vários endereços separados por vírgulas (por exemplo, john.doe@xcally.com, jane.miller@xcally.com)"
+      "TO": "Você pode adicionar vários endereços separados por vírgulas (exemplo: john.doe@xcally.com, jane.miller@xcally.com)"
     },
-    "HIDDENDIGITSNUM": "Número de dígitos ocultos",
-    "HIDDENDIGITSPOS": "Posição dos Dígitos ocultos",
+    "HIDDENDIGITSNUM": "Número de Dígitos Ocultos",
+    "HIDDENDIGITSPOS": "Posição dos Dígitos Ocultos",
     "ID": "Id",
     "IMPORT": "Importar",
     "IMPORT_XML": "Importar XML",
     "ISPEECH_TTS_LANGUAGE": "Idioma",
     "KEY": "Key",
     "LABEL": "Label",
-    "LANGUAGECODE": "Código do idioma",
-    "LASTNAME": "Último nome",
+    "LANGUAGECODE": "Código do Idioma",
+    "LASTNAME": "Sobrenome",
     "LIST_ID": "Lista",
     "LOGIN": "Login",
     "LOGOUT": "Logout",
     "LUMENVOXASR": "Lumenvox ASR",
     "LUMENVOXTTS": "Lumenvox Text-To-Speech",
     "MACRO": "Macro",
-    "MAILBOX": "Caixa de correio",
+    "MAILBOX": "Caixa de Correio",
     "MATH": "Math",
     "MAXDIGIT": "Dígitos Máximos",
     "MENU": "Menu",
     "MRCPRECOG": "MRCPRecog",
     "MRCPSYNTH": "MRCPSynth",
     "NAME": "Nome",
-    "NDAACTIVITY_TYPE": "Tipo de atividade",
-    "NDAGENERATE_AUDIO": "Gerar arquivo de áudio",
-    "NDASSISTANT_URL": "URL NDASSISTANT",
-    "NDAUTH_URL": "URL do NDAUTH",
+    "NDAACTIVITY_TYPE": "Tipo de Atividade",
+    "NDAGENERATE_AUDIO": "Gerar Arquivo de Áudio",
+    "NDASSISTANT_URL": "NDASSISTANT Url",
+    "NDAUTH_URL": "NNDAUTH Url",
     "NEW": "Novo",
     "NEW_ODBC": "Nova conexão ODBC",
-    "NEW_PROJECT": "Novo projeto",
+    "NEW_PROJECT": "Novo Projeto",
     "NEW_VARIABLE": "Nova Variável",
     "NOOP": "NoOp",
-    "NOTES": "Notas",
+    "NOTES": "Anotações",
     "NO_AVAILABLE_INFO": "Nenhuma informação disponível",
     "NUMBER": "Número",
     "ODBC": "ODBC",
     "OF": "do",
     "OPEN": "Abrir",
     "OPEN_NEW_WINDOW": "Abra em uma nova janela",
-    "OPEN_PROJECT": "Projeto aberto",
+    "OPEN_PROJECT": "Projeto Aberto",
     "OPERATION": "Operação",
     "OPTIONS": "Opções",
     "OPTS": "Opções",
     "PASSWORD": "Senha",
     "PAUSE": "Pausa",
     "PAUSE_ID": "Tipo de pausa",
-    "PERMISSIONADD_PROJECTS": "Adicionar usuários ao projeto",
+    "PERMISSIONADD_PROJECTS": "Adicionar Usuários ao Projeto",
     "PHONE": "Telefone",
     "PLAYBACK": "Reprodução",
     "POSITION": "Posição",
     "RAWBODY": "Corpo",
     "RAWHEADERS": "Cabeçalhos",
     "RECORD": "Gravação",
-    "RECORDINGFORMAT": "Formato de gravação",
-    "RESPONSE": "Tempo limite de resposta",
+    "RECORDINGFORMAT": "Formato de Gravação",
+    "RESPONSE": "Tempo Limite de Resposta",
     "RESTAPI": "API Rest",
     "RETRY": "Repetições",
     "ROWSPERPAGE": "Linhas por página",
     "SAVE": "Salvar",
-    "SAYDIGITS": "Say Digits",
-    "SAYNUMBER": "Say number",
+    "SAYDIGITS": "Falar Dígitos",
+    "SAYNUMBER": "Falar Numero",
     "SAYPHONETIC": "Say Phonetics",
     "SEARCH_FOR_ANYONE": "Procurar",
     "SELECTED": "Selecionado",
     "SELECTED_USERS": "Usuários Selecionados",
-    "SELECT_ALL": "Selecionar tudo",
-    "SELECT_NONE": "Selecione nenhum",
+    "SELECT_ALL": "Selecionar Tudo",
+    "SELECT_NONE": "Selecione Nenhum",
     "SENDFAX": "Enviar Fax",
     "SENDMAIL": "Enviar Email",
     "SENDSMS": "Enviar SMS",
     "TTS": "Google Text-To-Speech",
     "UNIQUEID": "Unique ID",
     "UNPAUSE": "Fim da Pausa",
-    "UPDATE_DESCRIPTION": "Atualizar descrição",
-    "UPDATE_INFO": "Informação de atualização",
+    "UPDATE_DESCRIPTION": "Atualizar Descrição",
+    "UPDATE_INFO": "Update Info",
     "URI": "URI",
     "URL": "URL",
-    "USERNAME": "Nome de usuário",
+    "USERNAME": "Nome de Usuário",
     "USERS": "Usuários",
     "VARIABLE_ID": "Variável",
     "VARIABLE_VALUE": "Valor",
-    "VOICEMAIL": "Correio de voz",
+    "VOICEMAIL": "Correio de Voz",
     "VSWITCH": "Variable Switch",
-    "CLIENT_EMAIL": "Email do cliente",
+    "CLIENT_EMAIL": "Email do Cliente",
     "DIALOGFLOWV2": "DialogflowV2",
-    "DIALOGFLOWV2_LANGUAGE": "Língua",
-    "DIALOGFLOWV2_PROJECT_ID": "ID do projeto",
-    "PRIVATE_KEY": "Chave privada",
+    "DIALOGFLOWV2_LANGUAGE": "Idioma",
+    "DIALOGFLOWV2_PROJECT_ID": "ID do Projeto",
+    "PRIVATE_KEY": "Chave Privada",
     "DIALTIMEZONE": "Fuso horário de discagem"
   }
 }
index b84d6b8..df501db 100644 (file)
@@ -1,25 +1,25 @@
 {
   "CONTACTMANAGER": {
-    "SELECT_TAG": "Selecione tags",
+    "SELECT_TAG": "Selecione Tags",
     "CUSTOMER_JOURNEY": "Jornada do Cliente",
-    "USERID": "Lembrar ID do agente",
+    "USERID": "Lembrar ID do Agente",
     "PRIORITY": "Prioridade",
     "MOTIONDIALER": "Motion Bull",
     "IMPORT_CONTACTS": "Importar Contatos",
-    "PREFIX": "Prefixo de discagem",
-    "VOICEQUEUEID": "ID da Fila de Voz",
-    "CAMPAIGNID": "ID da campanha",
+    "PREFIX": "Prefixo de Discagem",
+    "VOICEQUEUEID": "ID Fila de Voz",
+    "CAMPAIGNID": "ID Campanha",
     "STATE": "Estado",
     "NAME": "Nome",
     "LISTS": "Listas",
-    "UNIQUEID": "ID unico",
+    "UNIQUEID": "ID Único",
     "STATUS": "Status",
     "STARTTIME": "Início",
     "ENDTIME": "Fim",
     "MOTION_BULL": "Motion Bull",
     "HOPPER": "Funil",
-    "FINAL": "Final do funil",
-    "HISTORY": "História do funil",
+    "FINAL": "Final do Funil",
+    "HISTORY": "Histórico do Funil",
     "SCHEDULEDAT": "Agendado em",
     "SEARCH_FOR_ANYONE": "Procurar",
     "EDIT_LIST": "Editar Lista",
@@ -27,8 +27,8 @@
     "DELETE_LIST": "Excluir Lista",
     "DELETE_HOPPER": "Excluir Funil",
     "RELOAD": "Recarregar",
-    "NO_COMPANIES": "Nenhuma empresa",
-    "NO_AVAILABLE_ITEMS": "Nenhum item disponível",
+    "NO_COMPANIES": "Nenhuma Empresa",
+    "NO_AVAILABLE_ITEMS": "Nenhum Item Disponível",
     "ADD": "Adicionar",
     "ERRORS": {
       "NAME_REQUIRED": "Campo obrigatório",
       "CLICKTOACTION_REQUIRED": "Campo obrigatório"
     },
     "DESCRIPTION": "Descrição",
-    "DISPOSITION": "Descrição",
-    "DISPOSITIONS": "Descrição",
-    "VOICEDISPOSITIONS": "Disposições de voz",
-    "NEW_VOICEDISPOSITION": "Nova disposição de voz",
-    "CUSTOM_FIELDS": "Os campos personalizados",
+    "DISPOSITION": "Qualificação",
+    "DISPOSITIONS": "Qualificações",
+    "VOICEDISPOSITIONS": "Qualificações de Voz",
+    "NEW_VOICEDISPOSITION": "Nova Qualificação de Voz",
+    "CUSTOM_FIELDS": "Os Campos Personalizados",
     "ADD_LIST": "Adicionar Lista",
     "BACK": "Voltar",
     "SELECTED": "Selecionado",
-    "SELECT_ALL": "Selecionar todos",
+    "SELECT_ALL": "Selecionar Todos",
     "SELECT_NONE": "Selecionar Nenhum",
     "COMPANIES": "Empresas",
     "EDIT_COMPANY": "Editar Empresa",
     "MOBILE": "Celular",
     "FAX": "Fax",
     "TAGS": "Tags",
-    "SHOW_ALL_FIELDS": "Mostrar todos os campos",
-    "FEWER_FIELDS": "Mostrar menos campos",
+    "SHOW_ALL_FIELDS": "Mostrar Todos Campos",
+    "FEWER_FIELDS": "Reduzir Campos",
     "COUNTRY": "País",
     "CITY": "Cidade",
     "STREET": "Rua",
     "POSTALCODE": "CEP",
     "DELETE": "Excluir",
-    "DELETE_ALL": "Excluir tudo",
-    "CONTACTMANAGER": "Gerente de contatos",
+    "DELETE_ALL": "Excluir Tudo",
+    "CONTACTMANAGER": "Mailing",
     "ID": "Id",
     "SETTINGS": "Configurações",
     "GENERAL": "Geral",
-    "CUSTOMFIELDS": "Os campos personalizados",
-    "NO_CUSTOMFIELD_AVAILABLE": "Nenhum campo personalizado disponível",
+    "CUSTOMFIELDS": "Campos Personalizados",
+    "NO_CUSTOMFIELD_AVAILABLE": "Nenhum Campo Personalizado Disponível",
     "ADD_TAG": "Adicionar Tag",
     "NO_TAG": "Sem Tags",
-    "ALIAS": "Apelido",
+    "ALIAS": "Alias",
     "TYPE": "Tipo",
     "VALUE": "Valor",
-    "ADD_CUSTOMFIELD": "Adicionar campo personalizado",
-    "EDIT_CUSTOMFIELD": "Editar campo personalizado",
-    "DELETE_CUSTOMFIELD": "Excluir campo personalizado",
+    "ADD_CUSTOMFIELD": "Adicionar Campo Personalizado",
+    "EDIT_CUSTOMFIELD": "Editar Campo Personalizado",
+    "DELETE_CUSTOMFIELD": "Excluir Campo Personalizado",
     "NEW_COMPANY": "Nova Empresa",
     "NEW_CONTACT": "Novo Contato",
     "NEW_TAG": "Nova Tag",
     "SUCCESS": "Sucesso",
     "FAILURE": "Falha",
     "ALL_CONTACTS": "Todos os Contatos",
-    "NEW_CUSTOMFIELD": "Novo campo personalizado",
-    "NO_VOICEDISPOSITION_AVAILABLE": "Nenhuma disposição de voz disponível",
-    "ADD_VOICEDISPOSITION": "Adicionar disposição de voz",
-    "EDIT_VOICEDISPOSITION": "Editar disposição de voz",
-    "DELETE_VOICEDISPOSITION": "Excluir disposição de voz",
+    "NEW_CUSTOMFIELD": "Novo campo Personalizado",
+    "NO_VOICEDISPOSITION_AVAILABLE": "Nenhuma Disposição de Voz Disponível",
+    "ADD_VOICEDISPOSITION": "Adicionar Disposição de Voz",
+    "EDIT_VOICEDISPOSITION": "Editar Disposição de Voz",
+    "DELETE_VOICEDISPOSITION": "Excluir Disposição de Voz",
     "VAT": "VAT",
     "COMPANYID": "ID Empresa",
     "WEBSITE": "Website",
-    "EMAIL_DOMAIN": "Domínio de email",
+    "EMAIL_DOMAIN": "Domínio de Email",
     "ADDRESS": "Endereço",
     "POSTAL_CODE": "CEP",
     "SHIPMENTADDRESS": "Endereço de Envio",
-    "COPY_CONTACT": "Copiar contato",
-    "GOTOCONTACTS_LIST": "Mostrar contatos",
-    "GOTOCONTACTS_COMPANY": "Mostrar contatos",
-    "ADD_AGENT_TO_LIST": "Adicionar agente à lista",
-    "AGENTADD_LIST": "Adicionar agentes à lista",
-    "NO_AVAILABLE_INFO": "Nenhuma informação disponível",
+    "COPY_CONTACT": "Copiar Contato",
+    "GOTOCONTACTS_LIST": "Ir para Lista de Contatos",
+    "GOTOCONTACTS_COMPANY": "Ir para Empresas",
+    "ADD_AGENT_TO_LIST": "Adicionar Agente à Lista",
+    "AGENTADD_LIST": "Adicionar Agentes à Lista",
+    "NO_AVAILABLE_INFO": "Nenhuma Informação Disponível",
     "NONE": "Nenhum",
-    "FULLNAME": "Nome COmpleto",
-    "CHECK_DUPLICATES": "Verificar duplicados",
-    "DUPLICATES": "Duplicatas",
+    "FULLNAME": "Nome Completo",
+    "CHECK_DUPLICATES": "Verificar Duplicados",
+    "DUPLICATES": "Duplicados",
     "UPLOAD_CSV": "Envio CSV",
     "TAG": "Tag",
     "UPLOAD": "Envio",
-    "ALL_AGENTS": "Todos os agentes",
+    "ALL_AGENTS": "Todos os Agentes",
     "SELECTED_AGENTS": "Agentes Selecionados",
-    "DATE_OF_BIRTH": "Data de nascimento",
-    "DATEOFBIRTH": "Data de nascimento",
+    "DATE_OF_BIRTH": "Data de Nascimento",
+    "DATEOFBIRTH": "Data de Nascimento",
     "NOTES": "Notas",
     "EXPORTCSVCONTACTS_LIST": "Exportar para CSV",
-    "GOTO_LIST": "Mostrar contatos",
-    "GOTO_COMPANY": "Mostrar contatos",
-    "REQUIRED": "Requeridos",
-    "GLOBALCUSTOMFIELDS": "Campos personalizados globais",
-    "NEW_GLOBALCUSTOMFIELD": "Novos campos personalizados",
-    "ADD_GLOBALCUSTOMFIELD": "Adicionar campo personalizado",
-    "EDIT_GLOBALCUSTOMFIELD": "Editar campo personalizado",
-    "DELETE_GLOBALCUSTOMFIELD": "Excluir campo personalizado",
+    "GOTO_LIST": "Ir para Listas",
+    "GOTO_COMPANY": "Ir para Empresas",
+    "REQUIRED": "Obrigatório",
+    "GLOBALCUSTOMFIELDS": "Campos Personalizados Globais",
+    "NEW_GLOBALCUSTOMFIELD": "Novo Campo Personalizado Global",
+    "ADD_GLOBALCUSTOMFIELD": "Adicionar Campo Personalizado Global",
+    "EDIT_GLOBALCUSTOMFIELD": "Editar Campo Personalizado Global",
+    "DELETE_GLOBALCUSTOMFIELD": "Excluir Campo Personalizado Global",
     "JSCRIPTY": "Jscripty",
     "SESSIONS": "Sessões",
     "AGENT": "Agente",
     "PROJECT": "Projeto",
-    "SELECT_LIST": "Selecione uma lista",
-    "SELECT_COMPANY": "Selecione uma empresa",
-    "SELECT_TAGS": "Selecione uma ou mais tags",
+    "SELECT_LIST": "Selecione Lista",
+    "SELECT_COMPANY": "Selecione Empresa",
+    "SELECT_TAGS": "Selecione uma ou mais Tags",
     "HELP": {
       "PHONEBAR_API_MESSAGE": "Para ativar o recurso clique para ligar, insira um número de telefone e verifique se a chave de controle remoto do agente está ativada",
       "PHONEBAR_API": "Para ativar o recurso clique para ligar, insira um número de telefone e verifique se a chave de controle remoto do agente está ativada"
     },
     "PAGE": "Página",
-    "ROWSPERPAGE": "Linhas por página",
+    "ROWSPERPAGE": "Linhas por Página",
     "OF": "do",
     "SOCIAL": "Social",
     "ROW": "Linha",
-    "EXPORT_ERRORS": "Exportar erros",
-    "UPLOAD_COMPLETED": "Upload concluído",
+    "EXPORT_ERRORS": "Exportar Erros",
+    "UPLOAD_COMPLETED": "Upload Concluído",
     "STOP": "Pare",
-    "SELECT_FILE": "Selecione o arquivo",
+    "SELECT_FILE": "Selecione o Arquivo",
     "ALL": "Tudo",
     "BILLINGINFORMATION": "Informações de pagamento",
-    "COMPANY_FISCAL_TYPE": "Tipo fiscal da empresa",
+    "COMPANY_FISCAL_TYPE": "Tipo Fiscal da Empresa",
     "CREATE": "Crio",
     "EUROPE": "Europa",
     "EXPIREDAY": "Dias de Vencimento",
index a7727f7..cdc4504 100644 (file)
     "TODAY": "I dag",
     "SELECT_DATE": "Välj Startdatum",
     "SELECT_DATE_RANGE": "Välj datumintervall",
-    "CLEAR": "Rensa",
+    "CLEAR": "Klar",
     "CALL_NUMBER": "Ring upp",
     "TRANSFER_NUMBER": "Överföra",
     "CALL_SAVED": "Ring korrekt sparad",
index 6f70beb..ee8630a 100644 (file)
@@ -1,21 +1,21 @@
 {
   "MOTIONDIALER": {
-    "LOGIN_TIME": "Tempo de login",
-    "PAUSE_TIME": "Tempo de pausa",
-    "CUTDIGIT": "Cut Digits",
+    "LOGIN_TIME": "Tempo de Login",
+    "PAUSE_TIME": "Tempo de Pausa",
+    "CUTDIGIT": "Cortar Dígitos",
     "RANDOMLASTDIGITCALLERIDNUMBER": "Número de Chamada de Saída Aleatória",
     "CLONE_IVRCAMPAIGN": "Clonar Campanha",
     "CLONE_QUEUECAMPAIGN": "Clonar Fila de Campanha",
     "ABANDONEDCALLS": "Chamadas Abandonadas em Filas",
-    "HOPPERWIDGET": "Resumo",
-    "RESETLIST_IVRCAMPAIGN": "Redefinir listas",
-    "RESETLIST_QUEUECAMPAIGN": "Redefinir listas",
-    "RESET": "Reset",
-    "RESETLIST": "Reset Listas",
-    "SELECTALL": "Selecionar tudo",
-    "UNSELECTALL": "Desmarque todos",
-    "NO_AVAILABLE_INFO": "Nenhuma informação disponível",
-    "TIMEOUT": "Tempo esgotado",
+    "HOPPERWIDGET": "Sumário",
+    "RESETLIST_IVRCAMPAIGN": "Redefinir Listas",
+    "RESETLIST_QUEUECAMPAIGN": "Redefinir Listas",
+    "RESET": "Redefinir",
+    "RESETLIST": "Redefinir Listas",
+    "SELECTALL": "Selecionar Tudo",
+    "UNSELECTALL": "Desmarcar Todos",
+    "NO_AVAILABLE_INFO": "Nenhuma Informação Disponível",
+    "TIMEOUT": "Tempo Esgotado",
     "CALLYSQUAREPROJECTPREVIEW": "Visualização do Projeto Cally Square",
     "CALLYSQUAREPROJECTPREVIEW2": "Pós Visualização do Projeto Cally Square",
     "RUNIFHANGUPAGENT": "Executar o Projeto Cally Square Depois mesmo que o agente desligue a chamada",
index bca62d1..e900abd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x843b=['jscripty','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]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','action','STRING','integration','motionbar'];(function(_0xa8691c,_0x5d7a58){var _0x2d2817=function(_0x4725bd){while(--_0x4725bd){_0xa8691c['push'](_0xa8691c['shift']());}};_0x2d2817(++_0x5d7a58);}(_0x843b,0x91));var _0xb843=function(_0x4570b1,_0x3d6165){_0x4570b1=_0x4570b1-0x0;var _0x47f29a=_0x843b[_0x4570b1];return _0x47f29a;};'use strict';var Sequelize=require(_0xb843('0x0'));module[_0xb843('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4d2352){return this[_0xb843('0x2')](_0xb843('0x3'));}},'action':{'type':Sequelize[_0xb843('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xb843('0x5'),_0xb843('0x6'),_0xb843('0x7'),_0xb843('0x8'),'browser',_0xb843('0x9'),_0xb843('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xb843('0xb')},'data1':{'type':Sequelize[_0xb843('0x4')](0x1000),'comment':_0xb843('0xc')},'data2':{'type':Sequelize[_0xb843('0x4')](0x1000),'comment':_0xb843('0xd')},'data3':{'type':Sequelize[_0xb843('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['STRING'](0x1000),'comments':_0xb843('0xe')},'data5':{'type':Sequelize[_0xb843('0x4')](0x1000),'comments':_0xb843('0xf')},'data6':{'type':Sequelize[_0xb843('0x4')],'comments':_0xb843('0x10')},'data7':{'type':Sequelize[_0xb843('0x11')],'comments':_0xb843('0x12')}};
\ No newline at end of file
+var _0xeb2e=['urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','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)]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','exports','VIRTUAL','getDataValue','action','STRING','contactManager'];(function(_0x1f3dcc,_0x39e9f9){var _0xf990ba=function(_0x4ba656){while(--_0x4ba656){_0x1f3dcc['push'](_0x1f3dcc['shift']());}};_0xf990ba(++_0x39e9f9);}(_0xeb2e,0xba));var _0xeeb2=function(_0x285970,_0x59adb9){_0x285970=_0x285970-0x0;var _0x1dda06=_0xeb2e[_0x285970];return _0x1dda06;};'use strict';var Sequelize=require('sequelize');module[_0xeeb2('0x0')]={'name':{'type':Sequelize[_0xeeb2('0x1')],'get':function(_0x4c2e11){return this[_0xeeb2('0x2')](_0xeeb2('0x3'));}},'action':{'type':Sequelize[_0xeeb2('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xeeb2('0x5'),'integration','motionbar','jscripty',_0xeeb2('0x6'),_0xeeb2('0x7'),_0xeeb2('0x8'),_0xeeb2('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xeeb2('0xa')},'data1':{'type':Sequelize[_0xeeb2('0x4')](0x1000),'comment':_0xeeb2('0xb')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xeeb2('0xc')},'data3':{'type':Sequelize[_0xeeb2('0x4')](0x1000),'comment':_0xeeb2('0xd')},'data4':{'type':Sequelize[_0xeeb2('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xeeb2('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xeeb2('0x4')],'comments':_0xeeb2('0xe')},'data7':{'type':Sequelize['TEXT'],'comments':_0xeeb2('0xf')}};
\ No newline at end of file
index 415bb09..ef3623f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x214e=['update','then','stack','body','Action','find','params','catch','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save'];(function(_0x2b2b33,_0x56606f){var _0x229157=function(_0x52b63e){while(--_0x52b63e){_0x2b2b33['push'](_0x2b2b33['shift']());}};_0x229157(++_0x56606f);}(_0x214e,0x86));var _0xe214=function(_0x29891a,_0x25cfbe){_0x29891a=_0x29891a-0x0;var _0x2f55e2=_0x214e[_0x29891a];return _0x2f55e2;};'use strict';var emlformat=require(_0xe214('0x0'));var rimraf=require(_0xe214('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe214('0x2'));var rp=require(_0xe214('0x3'));var moment=require('moment');var BPromise=require(_0xe214('0x4'));var Mustache=require(_0xe214('0x5'));var util=require(_0xe214('0x6'));var path=require(_0xe214('0x7'));var sox=require(_0xe214('0x8'));var csv=require(_0xe214('0x9'));var ejs=require(_0xe214('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe214('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe214('0xc'));var deskjs=require(_0xe214('0xd'));var toCsv=require(_0xe214('0x9'));var querystring=require(_0xe214('0xe'));var Papa=require(_0xe214('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe214('0x10'));var hardwareService=require(_0xe214('0x11'));var logger=require(_0xe214('0x12'))(_0xe214('0x13'));var utils=require(_0xe214('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe214('0x15'));var db=require(_0xe214('0x16'))['db'];function respondWithStatusCode(_0x53fc6e,_0x41c823){_0x41c823=_0x41c823||0xcc;return function(_0xef08f0){if(_0xef08f0){return _0x53fc6e[_0xe214('0x17')](_0x41c823);}return _0x53fc6e[_0xe214('0x18')](_0x41c823)[_0xe214('0x19')]();};}function respondWithResult(_0x4e840e,_0x28948e){_0x28948e=_0x28948e||0xc8;return function(_0x42223f){if(_0x42223f){return _0x4e840e[_0xe214('0x18')](_0x28948e)[_0xe214('0x1a')](_0x42223f);}};}function respondWithFilteredResult(_0x3949bb,_0x42c301){return function(_0x14c05d){if(_0x14c05d){var _0x379126=typeof _0x42c301[_0xe214('0x1b')]===_0xe214('0x1c')&&typeof _0x42c301[_0xe214('0x1d')]===_0xe214('0x1c');var _0x302639=_0x14c05d['count'];var _0x3c36df=_0x379126?0x0:_0x42c301[_0xe214('0x1b')];var _0x41e946=_0x379126?_0x14c05d[_0xe214('0x1e')]:_0x42c301[_0xe214('0x1b')]+_0x42c301[_0xe214('0x1d')];var _0x30a16c;if(_0x41e946>=_0x302639){_0x41e946=_0x302639;_0x30a16c=0xc8;}else{_0x30a16c=0xce;}_0x3949bb['status'](_0x30a16c);return _0x3949bb[_0xe214('0x1f')]('Content-Range',_0x3c36df+'-'+_0x41e946+'/'+_0x302639)['json'](_0x14c05d);}return null;};}function patchUpdates(_0x44ae2a){return function(_0x51a18c){try{jsonpatch['apply'](_0x51a18c,_0x44ae2a,!![]);}catch(_0x32e675){return BPromise[_0xe214('0x20')](_0x32e675);}return _0x51a18c[_0xe214('0x21')]();};}function saveUpdates(_0x4d3362,_0x357f72){return function(_0x13eb62){if(_0x13eb62){return _0x13eb62[_0xe214('0x22')](_0x4d3362)[_0xe214('0x23')](function(_0x375ab4){return _0x375ab4;});}return null;};}function removeEntity(_0xa55f98,_0x30db4b){return function(_0x4b13c0){if(_0x4b13c0){return _0x4b13c0['destroy']()['then'](function(){_0xa55f98[_0xe214('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x333f9d,_0x13aaea){return function(_0x589058){if(!_0x589058){_0x333f9d['sendStatus'](0x194);}return _0x589058;};}function handleError(_0x18b9f3,_0xf213ca){_0xf213ca=_0xf213ca||0x1f4;return function(_0x43a19f){logger['error'](_0x43a19f[_0xe214('0x24')]);if(_0x43a19f['name']){delete _0x43a19f['name'];}_0x18b9f3[_0xe214('0x18')](_0xf213ca)['send'](_0x43a19f);};}exports[_0xe214('0x22')]=function(_0x25ab69,_0x1ebed9){if(_0x25ab69[_0xe214('0x25')]['id']){delete _0x25ab69[_0xe214('0x25')]['id'];}return db[_0xe214('0x26')][_0xe214('0x27')]({'where':{'id':_0x25ab69[_0xe214('0x28')]['id']}})[_0xe214('0x23')](handleEntityNotFound(_0x1ebed9,null))[_0xe214('0x23')](saveUpdates(_0x25ab69[_0xe214('0x25')],null))['then'](respondWithResult(_0x1ebed9,null))[_0xe214('0x29')](handleError(_0x1ebed9,null));};exports['destroy']=function(_0x41c62e,_0xef313d){return db[_0xe214('0x26')]['find']({'where':{'id':_0x41c62e[_0xe214('0x28')]['id']}})[_0xe214('0x23')](handleEntityNotFound(_0xef313d,null))['then'](removeEntity(_0xef313d,null))['catch'](handleError(_0xef313d,null));};
\ No newline at end of file
+var _0x8545=['moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','body','Action','find','catch','params','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x5f531a,_0x41ac7c){var _0x1da06f=function(_0x33eb39){while(--_0x33eb39){_0x5f531a['push'](_0x5f531a['shift']());}};_0x1da06f(++_0x41ac7c);}(_0x8545,0x86));var _0x5854=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x8545[_0x5a776b];return _0xbbef59;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5854('0x0'));var zipdir=require(_0x5854('0x1'));var jsonpatch=require(_0x5854('0x2'));var rp=require(_0x5854('0x3'));var moment=require(_0x5854('0x4'));var BPromise=require(_0x5854('0x5'));var Mustache=require(_0x5854('0x6'));var util=require(_0x5854('0x7'));var path=require(_0x5854('0x8'));var sox=require(_0x5854('0x9'));var csv=require('to-csv');var ejs=require(_0x5854('0xa'));var fs=require('fs');var fs_extra=require(_0x5854('0xb'));var _=require(_0x5854('0xc'));var squel=require(_0x5854('0xd'));var crypto=require(_0x5854('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5854('0xf'));var toCsv=require(_0x5854('0x10'));var querystring=require(_0x5854('0x11'));var Papa=require(_0x5854('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5854('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x5854('0x14'));var config=require(_0x5854('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5854('0x16'))['db'];function respondWithStatusCode(_0x374b54,_0x1b3aa7){_0x1b3aa7=_0x1b3aa7||0xcc;return function(_0x1f7ecd){if(_0x1f7ecd){return _0x374b54[_0x5854('0x17')](_0x1b3aa7);}return _0x374b54[_0x5854('0x18')](_0x1b3aa7)['end']();};}function respondWithResult(_0x3a15de,_0x32efe6){_0x32efe6=_0x32efe6||0xc8;return function(_0x31d5ea){if(_0x31d5ea){return _0x3a15de[_0x5854('0x18')](_0x32efe6)[_0x5854('0x19')](_0x31d5ea);}};}function respondWithFilteredResult(_0x52d215,_0x454031){return function(_0x266040){if(_0x266040){var _0x4afea0=typeof _0x454031[_0x5854('0x1a')]===_0x5854('0x1b')&&typeof _0x454031[_0x5854('0x1c')]===_0x5854('0x1b');var _0x8530b=_0x266040[_0x5854('0x1d')];var _0x30d928=_0x4afea0?0x0:_0x454031[_0x5854('0x1a')];var _0xc207bd=_0x4afea0?_0x266040[_0x5854('0x1d')]:_0x454031[_0x5854('0x1a')]+_0x454031[_0x5854('0x1c')];var _0x5bc253;if(_0xc207bd>=_0x8530b){_0xc207bd=_0x8530b;_0x5bc253=0xc8;}else{_0x5bc253=0xce;}_0x52d215[_0x5854('0x18')](_0x5bc253);return _0x52d215[_0x5854('0x1e')](_0x5854('0x1f'),_0x30d928+'-'+_0xc207bd+'/'+_0x8530b)['json'](_0x266040);}return null;};}function patchUpdates(_0x22f621){return function(_0x2a4435){try{jsonpatch[_0x5854('0x20')](_0x2a4435,_0x22f621,!![]);}catch(_0x44bbb5){return BPromise['reject'](_0x44bbb5);}return _0x2a4435[_0x5854('0x21')]();};}function saveUpdates(_0x5e07a0,_0x21e8d9){return function(_0x330d40){if(_0x330d40){return _0x330d40[_0x5854('0x22')](_0x5e07a0)['then'](function(_0x2b5920){return _0x2b5920;});}return null;};}function removeEntity(_0x51f379,_0x2e2bfc){return function(_0x5659b0){if(_0x5659b0){return _0x5659b0[_0x5854('0x23')]()[_0x5854('0x24')](function(){_0x51f379[_0x5854('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x386405,_0x51134a){return function(_0xe02fec){if(!_0xe02fec){_0x386405[_0x5854('0x17')](0x194);}return _0xe02fec;};}function handleError(_0x804f32,_0xb08536){_0xb08536=_0xb08536||0x1f4;return function(_0x4683df){logger[_0x5854('0x25')](_0x4683df[_0x5854('0x26')]);if(_0x4683df[_0x5854('0x27')]){delete _0x4683df[_0x5854('0x27')];}_0x804f32['status'](_0xb08536)[_0x5854('0x28')](_0x4683df);};}exports[_0x5854('0x22')]=function(_0x31c85a,_0x442a95){if(_0x31c85a['body']['id']){delete _0x31c85a[_0x5854('0x29')]['id'];}return db[_0x5854('0x2a')][_0x5854('0x2b')]({'where':{'id':_0x31c85a['params']['id']}})[_0x5854('0x24')](handleEntityNotFound(_0x442a95,null))[_0x5854('0x24')](saveUpdates(_0x31c85a[_0x5854('0x29')],null))[_0x5854('0x24')](respondWithResult(_0x442a95,null))[_0x5854('0x2c')](handleError(_0x442a95,null));};exports[_0x5854('0x23')]=function(_0x1f38eb,_0x37deb2){return db[_0x5854('0x2a')]['find']({'where':{'id':_0x1f38eb[_0x5854('0x2d')]['id']}})[_0x5854('0x24')](handleEntityNotFound(_0x37deb2,null))[_0x5854('0x24')](removeEntity(_0x37deb2,null))[_0x5854('0x2c')](handleError(_0x37deb2,null));};
\ No newline at end of file
index 82d0269..908c5d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xecda=['tools_actions','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./action.attributes','exports','define'];(function(_0x5f1e8e,_0x2774f2){var _0x517bc4=function(_0x4c92eb){while(--_0x4c92eb){_0x5f1e8e['push'](_0x5f1e8e['shift']());}};_0x517bc4(++_0x2774f2);}(_0xecda,0x175));var _0xaecd=function(_0x47ec13,_0x9b1429){_0x47ec13=_0x47ec13-0x0;var _0x3aed32=_0xecda[_0x47ec13];return _0x3aed32;};'use strict';var _=require(_0xaecd('0x0'));var util=require(_0xaecd('0x1'));var logger=require(_0xaecd('0x2'))(_0xaecd('0x3'));var moment=require('moment');var BPromise=require(_0xaecd('0x4'));var rp=require(_0xaecd('0x5'));var fs=require('fs');var path=require(_0xaecd('0x6'));var rimraf=require(_0xaecd('0x7'));var config=require('../../config/environment');var attributes=require(_0xaecd('0x8'));module[_0xaecd('0x9')]=function(_0x284d8c,_0xe61c53){return _0x284d8c[_0xaecd('0xa')]('Action',attributes,{'tableName':_0xaecd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc25d=['request-promise','rimraf','./action.attributes','define','Action','tools_actions','api','moment'];(function(_0x121434,_0x5b85ca){var _0x15acb2=function(_0x4854f8){while(--_0x4854f8){_0x121434['push'](_0x121434['shift']());}};_0x15acb2(++_0x5b85ca);}(_0xc25d,0x1ee));var _0xdc25=function(_0x7275e9,_0x321fa5){_0x7275e9=_0x7275e9-0x0;var _0x17b99d=_0xc25d[_0x7275e9];return _0x17b99d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xdc25('0x0'));var moment=require(_0xdc25('0x1'));var BPromise=require('bluebird');var rp=require(_0xdc25('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdc25('0x3'));var config=require('../../config/environment');var attributes=require(_0xdc25('0x4'));module['exports']=function(_0x3a2376,_0xb06b60){return _0x3a2376[_0xdc25('0x5')](_0xdc25('0x6'),attributes,{'tableName':_0xdc25('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bfe31d5..33717f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\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(_0x59d581,_0x4a6a97){var _0x47c61b=function(_0x12b3d8){while(--_0x12b3d8){_0x59d581['push'](_0x59d581['shift']());}};_0x47c61b(++_0x4a6a97);}(_0x1261,0x144));var _0x1126=function(_0x26a810,_0x247776){_0x26a810=_0x26a810-0x0;var _0x4758a3=_0x1261[_0x26a810];return _0x4758a3;};'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')]('Action,\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 _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4c1a85,_0x5c761d){var _0x51650a=function(_0x12c941){while(--_0x12c941){_0x4c1a85['push'](_0x4c1a85['shift']());}};_0x51650a(++_0x5c761d);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x190d7b,_0x548785){_0x190d7b=_0x190d7b-0x0;var _0x33370b=_0x7fbe[_0x190d7b];return _0x33370b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}
\ No newline at end of file
index d822659..f819738 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9135=['isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id'];(function(_0x355f82,_0xf41ed){var _0x4c18a1=function(_0x405b12){while(--_0x405b12){_0x355f82['push'](_0x355f82['shift']());}};_0x4c18a1(++_0xf41ed);}(_0x9135,0xd5));var _0x5913=function(_0x345ad9,_0x28da02){_0x345ad9=_0x345ad9-0x0;var _0x5cb6a4=_0x9135[_0x345ad9];return _0x5cb6a4;};'use strict';var multer=require(_0x5913('0x0'));var util=require(_0x5913('0x1'));var path=require(_0x5913('0x2'));var timeout=require(_0x5913('0x3'));var express=require(_0x5913('0x4'));var router=express['Router']();var fs_extra=require(_0x5913('0x5'));var auth=require(_0x5913('0x6'));var interaction=require(_0x5913('0x7'));var config=require(_0x5913('0x8'));var controller=require(_0x5913('0x9'));router['put'](_0x5913('0xa'),auth[_0x5913('0xb')](),controller[_0x5913('0xc')]);router[_0x5913('0xd')](_0x5913('0xa'),auth[_0x5913('0xb')](),controller[_0x5913('0xe')]);module[_0x5913('0xf')]=router;
\ No newline at end of file
+var _0x3005=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','delete','destroy','exports'];(function(_0x487177,_0x1ddcd6){var _0x147202=function(_0xa5105){while(--_0xa5105){_0x487177['push'](_0x487177['shift']());}};_0x147202(++_0x1ddcd6);}(_0x3005,0x170));var _0x5300=function(_0x29571e,_0x5a548e){_0x29571e=_0x29571e-0x0;var _0x395ab0=_0x3005[_0x29571e];return _0x395ab0;};'use strict';var multer=require(_0x5300('0x0'));var util=require(_0x5300('0x1'));var path=require(_0x5300('0x2'));var timeout=require(_0x5300('0x3'));var express=require(_0x5300('0x4'));var router=express[_0x5300('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5300('0x6'));var interaction=require(_0x5300('0x7'));var config=require(_0x5300('0x8'));var controller=require(_0x5300('0x9'));router[_0x5300('0xa')](_0x5300('0xb'),auth[_0x5300('0xc')](),controller['update']);router[_0x5300('0xd')](_0x5300('0xb'),auth[_0x5300('0xc')](),controller[_0x5300('0xe')]);module[_0x5300('0xf')]=router;
\ No newline at end of file
index 1f3e982..bb39278 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2675=['sequelize','STRING','TEXT'];(function(_0x101a17,_0x5d047a){var _0x3b76ee=function(_0x89be1b){while(--_0x89be1b){_0x101a17['push'](_0x101a17['shift']());}};_0x3b76ee(++_0x5d047a);}(_0x2675,0x75));var _0x5267=function(_0x2379d9,_0x146e8e){_0x2379d9=_0x2379d9-0x0;var _0x4413f8=_0x2675[_0x2379d9];return _0x4413f8;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}};
\ No newline at end of file
+var _0x6f47=['TEXT','exports','STRING'];(function(_0x31dcd5,_0x27ff54){var _0x5db7ea=function(_0xaa0541){while(--_0xaa0541){_0x31dcd5['push'](_0x31dcd5['shift']());}};_0x5db7ea(++_0x27ff54);}(_0x6f47,0xc7));var _0x76f4=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0x6f47[_0x55abd9];return _0x3e5669;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'name':{'type':Sequelize[_0x76f4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x76f4('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x76f4('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 2b25302..f6528f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb53e=['IS\x20NOT\x20EMPTY','rules','group','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','field','function','replace','format','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','COUNT(%s)','IS\x20NOT\x20NULL','getFields','ValidationErrorItem','from','groupBy','order','alias','clone','web','fullPath','%s-%s.%s','randomstring','output','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','cross_join','HOUR(%s)','IS\x20EMPTY','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','dbH','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','end','sendStatus','error','name','send','index','AnalyticCustomReport','rawAttributes','fieldName','type','map','query','keys','intersection','attributes','fields','model','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','findAll','catch','show','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL'];(function(_0x28ba95,_0x4381eb){var _0x10194b=function(_0x18f0e5){while(--_0x18f0e5){_0x28ba95['push'](_0x28ba95['shift']());}};_0x10194b(++_0x4381eb);}(_0xb53e,0xde));var _0xeb53=function(_0x38c35b,_0x277e1c){_0x38c35b=_0x38c35b-0x0;var _0x1a1907=_0xb53e[_0x38c35b];return _0x1a1907;};'use strict';var emlformat=require(_0xeb53('0x0'));var rimraf=require(_0xeb53('0x1'));var zipdir=require(_0xeb53('0x2'));var jsonpatch=require(_0xeb53('0x3'));var rp=require(_0xeb53('0x4'));var moment=require(_0xeb53('0x5'));var BPromise=require(_0xeb53('0x6'));var Mustache=require(_0xeb53('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xeb53('0x8'));var ejs=require(_0xeb53('0x9'));var fs=require('fs');var fs_extra=require(_0xeb53('0xa'));var _=require('lodash');var squel=require(_0xeb53('0xb'));var crypto=require(_0xeb53('0xc'));var jsforce=require(_0xeb53('0xd'));var deskjs=require(_0xeb53('0xe'));var toCsv=require('to-csv');var querystring=require(_0xeb53('0xf'));var Papa=require('papaparse');var Redis=require(_0xeb53('0x10'));var authService=require(_0xeb53('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xeb53('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb53('0x13'))('api');var utils=require(_0xeb53('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xeb53('0x15')];function respondWithStatusCode(_0x54296b,_0x5945ba){_0x5945ba=_0x5945ba||0xcc;return function(_0x1ba745){if(_0x1ba745){return _0x54296b['sendStatus'](_0x5945ba);}return _0x54296b[_0xeb53('0x16')](_0x5945ba)['end']();};}function respondWithResult(_0x4a47a2,_0x1f232c){_0x1f232c=_0x1f232c||0xc8;return function(_0x17a73e){if(_0x17a73e){return _0x4a47a2[_0xeb53('0x16')](_0x1f232c)[_0xeb53('0x17')](_0x17a73e);}};}function respondWithFilteredResult(_0x5d3223,_0x36475a){return function(_0x5e1925){if(_0x5e1925){var _0x4eaf80=typeof _0x36475a[_0xeb53('0x18')]===_0xeb53('0x19')&&typeof _0x36475a['limit']===_0xeb53('0x19');var _0x4039b7=_0x5e1925[_0xeb53('0x1a')];var _0x1e57f7=_0x4eaf80?0x0:_0x36475a[_0xeb53('0x18')];var _0x2a8303=_0x4eaf80?_0x5e1925[_0xeb53('0x1a')]:_0x36475a['offset']+_0x36475a[_0xeb53('0x1b')];var _0x254c54;if(_0x2a8303>=_0x4039b7){_0x2a8303=_0x4039b7;_0x254c54=0xc8;}else{_0x254c54=0xce;}_0x5d3223[_0xeb53('0x16')](_0x254c54);return _0x5d3223['set'](_0xeb53('0x1c'),_0x1e57f7+'-'+_0x2a8303+'/'+_0x4039b7)[_0xeb53('0x17')](_0x5e1925);}return null;};}function patchUpdates(_0x1215e9){return function(_0x3bab5e){try{jsonpatch[_0xeb53('0x1d')](_0x3bab5e,_0x1215e9,!![]);}catch(_0x1dd8be){return BPromise['reject'](_0x1dd8be);}return _0x3bab5e[_0xeb53('0x1e')]();};}function saveUpdates(_0x3d106a,_0x15c287){return function(_0x8bd169){if(_0x8bd169){return _0x8bd169[_0xeb53('0x1f')](_0x3d106a)[_0xeb53('0x20')](function(_0x140ef0){return _0x140ef0;});}return null;};}function removeEntity(_0x58ef26,_0xfc10b1){return function(_0xcb6700){if(_0xcb6700){return _0xcb6700[_0xeb53('0x21')]()[_0xeb53('0x20')](function(){var _0x5b8ecd=_0xcb6700[_0xeb53('0x22')]({'plain':!![]});var _0x3cc015='CustomReports';return db[_0xeb53('0x23')][_0xeb53('0x21')]({'where':{'type':_0x3cc015,'resourceId':_0x5b8ecd['id']}})[_0xeb53('0x20')](function(){return _0xcb6700;});})[_0xeb53('0x20')](function(){_0x58ef26[_0xeb53('0x16')](0xcc)[_0xeb53('0x24')]();});}};}function handleEntityNotFound(_0x348049,_0x500e4a){return function(_0x241d3c){if(!_0x241d3c){_0x348049[_0xeb53('0x25')](0x194);}return _0x241d3c;};}function handleError(_0x4f9081,_0x5ce4f3){_0x5ce4f3=_0x5ce4f3||0x1f4;return function(_0x919a21){logger[_0xeb53('0x26')](_0x919a21['stack']);if(_0x919a21[_0xeb53('0x27')]){delete _0x919a21[_0xeb53('0x27')];}_0x4f9081['status'](_0x5ce4f3)[_0xeb53('0x28')](_0x919a21);};}exports[_0xeb53('0x29')]=function(_0x58cdc0,_0x11f25b){var _0x251593={},_0x1d8b66={},_0x4447ed={'count':0x0,'rows':[]};var _0x2fb53e=_['map'](db[_0xeb53('0x2a')][_0xeb53('0x2b')],function(_0x214281){return{'name':_0x214281[_0xeb53('0x2c')],'type':_0x214281[_0xeb53('0x2d')]['key']};});_0x1d8b66['model']=_[_0xeb53('0x2e')](_0x2fb53e,_0xeb53('0x27'));_0x1d8b66[_0xeb53('0x2f')]=_[_0xeb53('0x30')](_0x58cdc0[_0xeb53('0x2f')]);_0x1d8b66['filters']=_[_0xeb53('0x31')](_0x1d8b66['model'],_0x1d8b66['query']);_0x251593[_0xeb53('0x32')]=_[_0xeb53('0x31')](_0x1d8b66['model'],qs[_0xeb53('0x33')](_0x58cdc0[_0xeb53('0x2f')][_0xeb53('0x33')]));_0x251593[_0xeb53('0x32')]=_0x251593[_0xeb53('0x32')]['length']?_0x251593[_0xeb53('0x32')]:_0x1d8b66[_0xeb53('0x34')];if(!_0x58cdc0[_0xeb53('0x2f')]['hasOwnProperty'](_0xeb53('0x35'))){_0x251593['limit']=qs['limit'](_0x58cdc0[_0xeb53('0x2f')][_0xeb53('0x1b')]);_0x251593[_0xeb53('0x18')]=qs[_0xeb53('0x18')](_0x58cdc0[_0xeb53('0x2f')][_0xeb53('0x18')]);}_0x251593['order']=qs[_0xeb53('0x36')](_0x58cdc0[_0xeb53('0x2f')][_0xeb53('0x36')]);_0x251593[_0xeb53('0x37')]=qs[_0xeb53('0x38')](_[_0xeb53('0x39')](_0x58cdc0[_0xeb53('0x2f')],_0x1d8b66[_0xeb53('0x38')]),_0x2fb53e);if(_0x58cdc0[_0xeb53('0x2f')][_0xeb53('0x3a')]){_0x251593[_0xeb53('0x37')]=_[_0xeb53('0x3b')](_0x251593[_0xeb53('0x37')],{'$or':_['map'](_0x2fb53e,function(_0xdad72e){if(_0xdad72e['type']!=='VIRTUAL'){var _0x5457d={};_0x5457d[_0xdad72e[_0xeb53('0x27')]]={'$like':'%'+_0x58cdc0['query']['filter']+'%'};return _0x5457d;}})});}_0x251593=_['merge']({},_0x251593,_0x58cdc0[_0xeb53('0x3c')]);var _0x43359f={'where':_0x251593[_0xeb53('0x37')]};return db[_0xeb53('0x2a')][_0xeb53('0x1a')](_0x43359f)[_0xeb53('0x20')](function(_0xe2be6e){_0x4447ed[_0xeb53('0x1a')]=_0xe2be6e;if(_0x58cdc0[_0xeb53('0x2f')][_0xeb53('0x3d')]){_0x251593['include']=[{'all':!![]}];}return db[_0xeb53('0x2a')][_0xeb53('0x3e')](_0x251593);})[_0xeb53('0x20')](function(_0x21e936){_0x4447ed['rows']=_0x21e936;return _0x4447ed;})[_0xeb53('0x20')](respondWithFilteredResult(_0x11f25b,_0x251593))[_0xeb53('0x3f')](handleError(_0x11f25b,null));};exports[_0xeb53('0x40')]=function(_0x1221e1,_0x1158ab){var _0x305769={'raw':![],'where':{'id':_0x1221e1['params']['id']}},_0x552dc6={};_0x552dc6[_0xeb53('0x34')]=_[_0xeb53('0x30')](db[_0xeb53('0x2a')][_0xeb53('0x2b')]);_0x552dc6[_0xeb53('0x2f')]=_['keys'](_0x1221e1[_0xeb53('0x2f')]);_0x552dc6[_0xeb53('0x38')]=_[_0xeb53('0x31')](_0x552dc6[_0xeb53('0x34')],_0x552dc6[_0xeb53('0x2f')]);_0x305769['attributes']=_['intersection'](_0x552dc6[_0xeb53('0x34')],qs['fields'](_0x1221e1[_0xeb53('0x2f')][_0xeb53('0x33')]));_0x305769[_0xeb53('0x32')]=_0x305769[_0xeb53('0x32')][_0xeb53('0x41')]?_0x305769[_0xeb53('0x32')]:_0x552dc6[_0xeb53('0x34')];if(_0x1221e1[_0xeb53('0x2f')][_0xeb53('0x3d')]){_0x305769['include']=[{'all':!![]}];}_0x305769=_[_0xeb53('0x3b')]({},_0x305769,_0x1221e1['options']);return db[_0xeb53('0x2a')][_0xeb53('0x42')](_0x305769)[_0xeb53('0x20')](handleEntityNotFound(_0x1158ab,null))['then'](respondWithResult(_0x1158ab,null))[_0xeb53('0x3f')](handleError(_0x1158ab,null));};exports[_0xeb53('0x43')]=function(_0x1554e4,_0x43a968){return db[_0xeb53('0x2a')][_0xeb53('0x43')](_0x1554e4[_0xeb53('0x44')],{})['then'](function(_0x563825){var _0x556588=_0x1554e4[_0xeb53('0x45')][_0xeb53('0x22')]({'plain':!![]});if(!_0x556588)throw new Error(_0xeb53('0x46'));if(_0x556588[_0xeb53('0x47')]===_0xeb53('0x45')){var _0x40609e=_0x563825['get']({'plain':!![]});var _0x27a97d='Reports';return db['UserProfileSection'][_0xeb53('0x42')]({'where':{'name':_0x27a97d,'userProfileId':_0x556588[_0xeb53('0x48')]},'raw':!![]})[_0xeb53('0x20')](function(_0xc4fbfa){if(_0xc4fbfa&&_0xc4fbfa[_0xeb53('0x49')]===0x0){return db[_0xeb53('0x23')][_0xeb53('0x43')]({'name':_0x40609e[_0xeb53('0x27')],'resourceId':_0x40609e['id'],'type':_0xeb53('0x4a'),'sectionId':_0xc4fbfa['id']},{})[_0xeb53('0x20')](function(){return _0x563825;});}else{return _0x563825;}})[_0xeb53('0x3f')](function(_0x44dbe1){logger[_0xeb53('0x26')](_0xeb53('0x4b'),_0x44dbe1);throw _0x44dbe1;});}return _0x563825;})[_0xeb53('0x20')](respondWithResult(_0x43a968,0xc9))[_0xeb53('0x3f')](handleError(_0x43a968,null));};exports[_0xeb53('0x1f')]=function(_0x5c8e62,_0x3a38c4){if(_0x5c8e62[_0xeb53('0x44')]['id']){delete _0x5c8e62[_0xeb53('0x44')]['id'];}return db['AnalyticCustomReport'][_0xeb53('0x42')]({'where':{'id':_0x5c8e62['params']['id']}})['then'](handleEntityNotFound(_0x3a38c4,null))['then'](saveUpdates(_0x5c8e62[_0xeb53('0x44')],null))[_0xeb53('0x20')](respondWithResult(_0x3a38c4,null))[_0xeb53('0x3f')](handleError(_0x3a38c4,null));};exports['destroy']=function(_0x14210f,_0x29649d){return db[_0xeb53('0x2a')][_0xeb53('0x42')]({'where':{'id':_0x14210f[_0xeb53('0x4c')]['id']}})[_0xeb53('0x20')](handleEntityNotFound(_0x29649d,null))[_0xeb53('0x20')](removeEntity(_0x29649d,null))[_0xeb53('0x3f')](handleError(_0x29649d,null));};exports[_0xeb53('0x4d')]=function(_0x3cfa06,_0x7d8821){var _0x15680b=0xa;var _0x2e212e=[_0xeb53('0x4e'),_0xeb53('0x4f'),_0xeb53('0x50'),'cross_join'];var _0x1032c1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xeb53('0x51'),'MAX':_0xeb53('0x52'),'MIN':_0xeb53('0x53'),'AVG':_0xeb53('0x54'),'GROUP_CONCAT':_0xeb53('0x55'),'GROUP_CONCAT ASC':_0xeb53('0x56'),'GROUP_CONCAT DESC':_0xeb53('0x57')};var _0x10e542={'SEC_TO_TIME':_0xeb53('0x58'),'DATE':_0xeb53('0x59'),'HOUR':'HOUR(%s)','ROUND':_0xeb53('0x5a'),'UNIX_TIMESTAMP':_0xeb53('0x5b')};var _0x381693=function(_0x549dfc){return!_[_0xeb53('0x5c')]([_0xeb53('0x5d'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeb53('0x5e')],_0x549dfc);};var _0x35b2da=function(_0x29ee37){if(!_0x29ee37||!_0x29ee37[_0xeb53('0x5f')]['length']){return'';}for(var _0x470d70='(',_0x239129=0x0;_0x239129<_0x29ee37['rules']['length'];_0x239129+=0x1){_0x239129>0x0&&(_0x470d70+='\x20'+_0x29ee37['operator']+'\x20');_0x470d70+=_0x29ee37[_0xeb53('0x5f')][_0x239129][_0xeb53('0x60')]?_0x35b2da(_0x29ee37[_0xeb53('0x5f')][_0x239129][_0xeb53('0x60')]):_0x29ee37[_0xeb53('0x5f')][_0x239129]['field']+'\x20'+_0x29ee37[_0xeb53('0x5f')][_0x239129]['condition']+(_0x381693(_0x29ee37['rules'][_0x239129][_0xeb53('0x61')])?'\x20'+_0x29ee37[_0xeb53('0x5f')][_0x239129][_0xeb53('0x62')]:'');}return _0x470d70+')';};var _0x7595ff={'where':{'id':_0x3cfa06[_0xeb53('0x4c')]['id']}},_0x266a6a,_0x55c565,_0x157158,_0x20009f,_0x31223a;_0x7595ff=_[_0xeb53('0x3b')]({},_0x7595ff,_0x3cfa06[_0xeb53('0x3c')]);return db[_0xeb53('0x2a')][_0xeb53('0x42')](_0x7595ff)[_0xeb53('0x20')](function(_0x163121){if(_0x163121){_0x266a6a=_0x163121;return _0x163121['getFields']();}return null;})[_0xeb53('0x20')](function(_0x3270db){if(_0x3270db){if(!_0x3270db[_0xeb53('0x41')]){throw new db[(_0xeb53('0x63'))]['ValidationErrorItem'](_0xeb53('0x64'),0x193);}_0x55c565=_0x3270db;return db[_0xeb53('0x65')][_0xeb53('0x3e')]({'raw':!![]});}return null;})[_0xeb53('0x20')](function(_0x557631){if(_0x557631){_0x157158=_[_0xeb53('0x66')](_0x557631,'id');var _0x533be5;var _0x25b6dd=squel[_0xeb53('0x67')]();_0x25b6dd['from'](_0x266a6a[_0xeb53('0x68')]);for(var _0x11ed68=0x0;_0x11ed68<_0x55c565['length'];_0x11ed68+=0x1){_0x533be5=_0x55c565[_0x11ed68]['MetricId']?_0x157158[_0x55c565[_0x11ed68][_0xeb53('0x69')]][_0xeb53('0x6a')]:_0x55c565[_0x11ed68][_0xeb53('0x6b')];_0x533be5=_0x55c565[_0x11ed68][_0xeb53('0x6c')]?_['replace'](_0x1032c1[_0x55c565[_0x11ed68]['function']],'%s',_0x533be5):_0x533be5;_0x533be5=_0x55c565[_0x11ed68]['format']?_[_0xeb53('0x6d')](_0x10e542[_0x55c565[_0x11ed68][_0xeb53('0x6e')]],'%s',_0x533be5):_0x533be5;if(_0x55c565[_0x11ed68]['groupBy']){_0x25b6dd[_0xeb53('0x60')](_0x533be5);}_0x55c565[_0x11ed68][_0xeb53('0x6f')]&&_0x25b6dd['order'](_0x533be5,_0x55c565[_0x11ed68]['orderBy']===_0xeb53('0x70')?![]:!![]);_0x25b6dd[_0xeb53('0x6b')](_0x533be5,_0x55c565[_0x11ed68]['alias']||_0x533be5);}if(_0x266a6a[_0xeb53('0x71')]){_0x266a6a[_0xeb53('0x71')]=JSON[_0xeb53('0x72')](_0x266a6a[_0xeb53('0x71')]);for(var _0x39e335=0x0;_0x39e335<_0x266a6a[_0xeb53('0x71')]['length'];_0x39e335+=0x1){if(_0x266a6a[_0xeb53('0x71')][_0x39e335][_0xeb53('0x2d')]&&_[_0xeb53('0x5c')](_0x2e212e,_0x266a6a[_0xeb53('0x71')][_0x39e335][_0xeb53('0x2d')])&&_0x266a6a[_0xeb53('0x71')][_0x39e335][_0xeb53('0x73')]&&_0x266a6a['joins'][_0x39e335][_0xeb53('0x74')]&&_0x266a6a[_0xeb53('0x71')][_0x39e335][_0xeb53('0x75')]){_0x25b6dd[_0x266a6a['joins'][_0x39e335][_0xeb53('0x2d')]](_0x266a6a[_0xeb53('0x71')][_0x39e335][_0xeb53('0x74')],null,util[_0xeb53('0x6e')](_0xeb53('0x76'),_0x266a6a[_0xeb53('0x68')],_0x266a6a[_0xeb53('0x71')][_0x39e335]['parentKey'],_0x266a6a[_0xeb53('0x71')][_0x39e335]['foreignTable'],_0x266a6a['joins'][_0x39e335]['foreignKey']));}}}if(_0x266a6a['conditions']){_0x266a6a[_0xeb53('0x77')]=JSON[_0xeb53('0x72')](_0x266a6a[_0xeb53('0x77')]);_0x25b6dd[_0xeb53('0x37')](_0x35b2da(_0x266a6a[_0xeb53('0x77')]['group']));}_0x31223a=_0x25b6dd['clone']();_0x25b6dd['limit'](_0x15680b);_0x25b6dd[_0xeb53('0x18')](0x0);logger[_0xeb53('0x78')](_0xeb53('0x79'),_0x25b6dd[_0xeb53('0x7a')]());return dbH[_0xeb53('0x7b')][_0xeb53('0x2f')](_0x25b6dd[_0xeb53('0x7a')](),{'type':dbH[_0xeb53('0x7b')][_0xeb53('0x7c')]['SELECT']});}})[_0xeb53('0x20')](respondWithResult(_0x7d8821,null))[_0xeb53('0x3f')](handleError(_0x7d8821,null));};function runReport(_0x1be1c3,_0x15b480,_0x5706f7){var _0x3f0da3=_0x15b480[_0xeb53('0x27')];var _0x4e9355=0xa;var _0x14e9d3=[_0xeb53('0x4e'),'left_join',_0xeb53('0x50'),'cross_join'];var _0x3a4c5f={'SUM':_0xeb53('0x7d'),'COUNT':_0xeb53('0x7e'),'COUNT DISTINCT':_0xeb53('0x51'),'MAX':'MAX(%s)','MIN':_0xeb53('0x53'),'AVG':_0xeb53('0x54'),'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 _0x48ebce={'SEC_TO_TIME':_0xeb53('0x58'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xeb53('0x5a'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x28cfc3=function(_0x46c4d5){return!_[_0xeb53('0x5c')]([_0xeb53('0x5d'),_0xeb53('0x7f'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x46c4d5);};var _0x2b0c4c=function(_0x157c47){if(!_0x157c47||!_0x157c47[_0xeb53('0x5f')][_0xeb53('0x41')]){return'';}for(var _0x2617fb='(',_0x54fc76=0x0;_0x54fc76<_0x157c47[_0xeb53('0x5f')][_0xeb53('0x41')];_0x54fc76+=0x1){_0x54fc76>0x0&&(_0x2617fb+='\x20'+_0x157c47['operator']+'\x20');_0x2617fb+=_0x157c47['rules'][_0x54fc76][_0xeb53('0x60')]?_0x2b0c4c(_0x157c47[_0xeb53('0x5f')][_0x54fc76]['group']):_0x157c47[_0xeb53('0x5f')][_0x54fc76][_0xeb53('0x6b')]+'\x20'+_0x157c47[_0xeb53('0x5f')][_0x54fc76][_0xeb53('0x61')]+(_0x28cfc3(_0x157c47[_0xeb53('0x5f')][_0x54fc76][_0xeb53('0x61')])?'\x20'+_0x157c47[_0xeb53('0x5f')][_0x54fc76][_0xeb53('0x62')]:'');}return _0x2617fb+')';};var _0x6fc12f={'where':{'id':_0x1be1c3['id']}},_0x3ec279,_0x504ba6,_0xdfd11a,_0x29027f,_0x5bed3e;_0x6fc12f=_[_0xeb53('0x3b')]({},_0x6fc12f,_0x5706f7);return db['AnalyticCustomReport']['find'](_0x6fc12f)[_0xeb53('0x20')](function(_0x132542){if(_0x132542){_0x3ec279=_0x132542;return _0x132542[_0xeb53('0x80')]();}return null;})['then'](function(_0x4acc91){if(_0x4acc91){if(!_0x4acc91[_0xeb53('0x41')]){throw new db['Sequelize'][(_0xeb53('0x81'))](_0xeb53('0x64'),0x193);}_0x504ba6=_0x4acc91;return db[_0xeb53('0x65')][_0xeb53('0x3e')]({'raw':!![]});}return null;})[_0xeb53('0x20')](function(_0x515809){if(_0x515809){_0xdfd11a=_[_0xeb53('0x66')](_0x515809,'id');var _0x49a78c;var _0x52dbe9=squel['select']();_0x52dbe9[_0xeb53('0x82')](_0x3ec279[_0xeb53('0x68')]);for(var _0x113ff0=0x0;_0x113ff0<_0x504ba6['length'];_0x113ff0+=0x1){_0x49a78c=_0x504ba6[_0x113ff0]['MetricId']?_0xdfd11a[_0x504ba6[_0x113ff0]['MetricId']][_0xeb53('0x6a')]:_0x504ba6[_0x113ff0][_0xeb53('0x6b')];_0x49a78c=_0x504ba6[_0x113ff0]['function']?_[_0xeb53('0x6d')](_0x3a4c5f[_0x504ba6[_0x113ff0][_0xeb53('0x6c')]],'%s',_0x49a78c):_0x49a78c;_0x49a78c=_0x504ba6[_0x113ff0][_0xeb53('0x6e')]?_[_0xeb53('0x6d')](_0x48ebce[_0x504ba6[_0x113ff0][_0xeb53('0x6e')]],'%s',_0x49a78c):_0x49a78c;if(_0x504ba6[_0x113ff0][_0xeb53('0x83')]){_0x52dbe9[_0xeb53('0x60')](_0x49a78c);}_0x504ba6[_0x113ff0][_0xeb53('0x6f')]&&_0x52dbe9[_0xeb53('0x84')](_0x49a78c,_0x504ba6[_0x113ff0][_0xeb53('0x6f')]===_0xeb53('0x70')?![]:!![]);_0x52dbe9[_0xeb53('0x6b')](_0x49a78c,_0x504ba6[_0x113ff0][_0xeb53('0x85')]||_0x49a78c);}if(_0x3ec279['joins']){_0x3ec279[_0xeb53('0x71')]=JSON[_0xeb53('0x72')](_0x3ec279[_0xeb53('0x71')]);for(var _0x1cedfd=0x0;_0x1cedfd<_0x3ec279['joins']['length'];_0x1cedfd+=0x1){if(_0x3ec279[_0xeb53('0x71')][_0x1cedfd][_0xeb53('0x2d')]&&_[_0xeb53('0x5c')](_0x14e9d3,_0x3ec279[_0xeb53('0x71')][_0x1cedfd][_0xeb53('0x2d')])&&_0x3ec279[_0xeb53('0x71')][_0x1cedfd][_0xeb53('0x73')]&&_0x3ec279[_0xeb53('0x71')][_0x1cedfd][_0xeb53('0x74')]&&_0x3ec279[_0xeb53('0x71')][_0x1cedfd]['foreignKey']){_0x52dbe9[_0x3ec279['joins'][_0x1cedfd]['type']](_0x3ec279['joins'][_0x1cedfd][_0xeb53('0x74')],null,util[_0xeb53('0x6e')](_0xeb53('0x76'),_0x3ec279[_0xeb53('0x68')],_0x3ec279[_0xeb53('0x71')][_0x1cedfd][_0xeb53('0x73')],_0x3ec279[_0xeb53('0x71')][_0x1cedfd][_0xeb53('0x74')],_0x3ec279['joins'][_0x1cedfd]['foreignKey']));}}}if(_0x3ec279['conditions']){_0x3ec279[_0xeb53('0x77')]=JSON['parse'](_0x3ec279[_0xeb53('0x77')]);_0x52dbe9[_0xeb53('0x37')](_0x2b0c4c(_0x3ec279[_0xeb53('0x77')]['group']));}_0x5bed3e=_0x52dbe9[_0xeb53('0x86')]();_0x52dbe9[_0xeb53('0x1b')](_0x4e9355);_0x52dbe9[_0xeb53('0x18')](0x0);return;}})['then'](function(){if(_0x15b480['output']===_0xeb53('0x87')){return null;}var _0x5e4257=_['merge'](_0x15b480,{'name':_0x15b480[_0xeb53('0x88')]||_0x15b480[_0xeb53('0x27')]||_0x3ec279[_0xeb53('0x27')],'basename':_0x3f0da3,'savename':util[_0xeb53('0x6e')](_0xeb53('0x89'),_0x15b480[_0xeb53('0x27')]||_0x3ec279['name'],require(_0xeb53('0x8a'))['generate'](0x4),_0x15b480[_0xeb53('0x8b')]||'csv'),'reportId':_0x3ec279['id'],'reportType':_0xeb53('0x8c')});return db[_0xeb53('0x8d')][_0xeb53('0x43')](_0x5e4257,{'raw':!![]});})[_0xeb53('0x20')](function(_0x5bb617){if(_0x3ec279[_0xeb53('0x68')]==='cdr'){_0x5bed3e['where'](_0x3ec279[_0xeb53('0x68')]+_0xeb53('0x8e'),_0x15b480['startDate'],_0x15b480[_0xeb53('0x8f')]);}else{_0x5bed3e['where'](_0x3ec279[_0xeb53('0x68')]+_0xeb53('0x90'),_0x15b480[_0xeb53('0x91')],_0x15b480[_0xeb53('0x8f')]);}if(_0x5bb617){logger['info']('Run\x20Query:',_0x5bed3e[_0xeb53('0x7a')]());require(_0xeb53('0x92'))[_0xeb53('0x93')](path[_0xeb53('0x4e')](__dirname,_0xeb53('0x94'),_0x5bb617[_0xeb53('0x8b')]),[_0x5bb617['id'],_0x5bed3e[_0xeb53('0x7a')](),path['join'](__dirname,_0xeb53('0x95'),_0x5bb617[_0xeb53('0x96')]),_0x3f0da3]);return _0x5bb617;}else{var _0x26ce09=squel[_0xeb53('0x67')]();_0x26ce09[_0xeb53('0x82')]('('+_0x5bed3e[_0xeb53('0x7a')]()+')',_0xeb53('0x97'));_0x26ce09[_0xeb53('0x6b')](_0xeb53('0x98'),_0xeb53('0x1a'));_0x5bed3e[_0xeb53('0x1b')](_0x15b480[_0xeb53('0x1b')]||_0x4e9355);_0x5bed3e[_0xeb53('0x18')](_0x15b480[_0xeb53('0x18')]||0x0);return dbH[_0xeb53('0x7b')][_0xeb53('0x2f')](_0x26ce09['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeb53('0x99')]})['then'](function(_0x12e50){if(!_0x12e50['length']){_0x29027f=0x0;}else{_0x29027f=_0x12e50[0x0][_0xeb53('0x1a')]||0x0;}return dbH[_0xeb53('0x7b')]['query'](_0x5bed3e[_0xeb53('0x7a')](),{'type':dbH[_0xeb53('0x7b')][_0xeb53('0x7c')][_0xeb53('0x99')]});})[_0xeb53('0x20')](function(_0x1e5db1){return{'rows':_0x1e5db1||[],'count':_0x29027f};});}});}exports[_0xeb53('0x9a')]=function(_0x361a06,_0x2a9cb3){return runReport(_0x361a06['params'],_0x361a06[_0xeb53('0x2f')],_0x361a06[_0xeb53('0x3c')])[_0xeb53('0x20')](respondWithResult(_0x2a9cb3,null))[_0xeb53('0x3f')](handleError(_0x2a9cb3,null));};exports['runReport']=runReport;exports['query']=function(_0xc66d30,_0x923fa5){var _0x137952=0xa;var _0x1931eb=[_0xeb53('0x4e'),_0xeb53('0x4f'),'right_join',_0xeb53('0x9b')];var _0x30810d={'SUM':_0xeb53('0x7d'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xeb53('0x52'),'MIN':_0xeb53('0x53'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xeb53('0x55'),'GROUP_CONCAT ASC':_0xeb53('0x56'),'GROUP_CONCAT DESC':_0xeb53('0x57')};var _0x34b3e8={'SEC_TO_TIME':_0xeb53('0x58'),'DATE':_0xeb53('0x59'),'HOUR':_0xeb53('0x9c'),'ROUND':_0xeb53('0x5a'),'UNIX_TIMESTAMP':_0xeb53('0x5b')};var _0x2d3c8c=function(_0x65ffdc){return!_[_0xeb53('0x5c')]([_0xeb53('0x5d'),_0xeb53('0x7f'),_0xeb53('0x9d'),_0xeb53('0x5e')],_0x65ffdc);};var _0x3705ff=function(_0x4372f3){if(!_0x4372f3||!_0x4372f3[_0xeb53('0x5f')][_0xeb53('0x41')]){return'';}for(var _0x407926='(',_0x5f965f=0x0;_0x5f965f<_0x4372f3[_0xeb53('0x5f')][_0xeb53('0x41')];_0x5f965f+=0x1){_0x5f965f>0x0&&(_0x407926+='\x20'+_0x4372f3['operator']+'\x20');_0x407926+=_0x4372f3[_0xeb53('0x5f')][_0x5f965f][_0xeb53('0x60')]?_0x3705ff(_0x4372f3['rules'][_0x5f965f]['group']):_0x4372f3[_0xeb53('0x5f')][_0x5f965f][_0xeb53('0x6b')]+'\x20'+_0x4372f3[_0xeb53('0x5f')][_0x5f965f]['condition']+(_0x2d3c8c(_0x4372f3[_0xeb53('0x5f')][_0x5f965f][_0xeb53('0x61')])?'\x20'+_0x4372f3[_0xeb53('0x5f')][_0x5f965f][_0xeb53('0x62')]:'');}return _0x407926+')';};var _0x5bb542={'where':{'id':_0xc66d30['params']['id']}},_0x4edc46,_0x346d68,_0x524223,_0x10afe8,_0x5c6281;_0x5bb542=_[_0xeb53('0x3b')]({},_0x5bb542,_0xc66d30[_0xeb53('0x3c')]);return db[_0xeb53('0x2a')][_0xeb53('0x42')](_0x5bb542)[_0xeb53('0x20')](function(_0x54732c){if(_0x54732c){_0x4edc46=_0x54732c;return _0x54732c['getFields']();}return null;})[_0xeb53('0x20')](function(_0x2e437d){if(_0x2e437d){if(!_0x2e437d[_0xeb53('0x41')]){throw new db[(_0xeb53('0x63'))]['ValidationErrorItem'](_0xeb53('0x64'),0x193);}_0x346d68=_0x2e437d;return db[_0xeb53('0x65')]['findAll']({'raw':!![]});}return null;})['then'](function(_0xaf0a4f){if(_0xaf0a4f){_0x524223=_[_0xeb53('0x66')](_0xaf0a4f,'id');var _0x1a6f6f;var _0x8b7eed=squel['select']();_0x8b7eed[_0xeb53('0x82')](_0x4edc46['table']);for(var _0x2b3cb8=0x0;_0x2b3cb8<_0x346d68[_0xeb53('0x41')];_0x2b3cb8+=0x1){_0x1a6f6f=_0x346d68[_0x2b3cb8][_0xeb53('0x69')]?_0x524223[_0x346d68[_0x2b3cb8][_0xeb53('0x69')]][_0xeb53('0x6a')]:_0x346d68[_0x2b3cb8]['field'];_0x1a6f6f=_0x346d68[_0x2b3cb8][_0xeb53('0x6c')]?_['replace'](_0x30810d[_0x346d68[_0x2b3cb8][_0xeb53('0x6c')]],'%s',_0x1a6f6f):_0x1a6f6f;_0x1a6f6f=_0x346d68[_0x2b3cb8]['format']?_[_0xeb53('0x6d')](_0x34b3e8[_0x346d68[_0x2b3cb8]['format']],'%s',_0x1a6f6f):_0x1a6f6f;if(_0x346d68[_0x2b3cb8]['groupBy']){_0x8b7eed[_0xeb53('0x60')](_0x1a6f6f);}_0x346d68[_0x2b3cb8][_0xeb53('0x6f')]&&_0x8b7eed[_0xeb53('0x84')](_0x1a6f6f,_0x346d68[_0x2b3cb8][_0xeb53('0x6f')]===_0xeb53('0x70')?![]:!![]);_0x8b7eed['field'](_0x1a6f6f,_0x346d68[_0x2b3cb8][_0xeb53('0x85')]||_0x1a6f6f);}if(_0x4edc46[_0xeb53('0x71')]){_0x4edc46['joins']=JSON['parse'](_0x4edc46[_0xeb53('0x71')]);for(var _0xb83f1=0x0;_0xb83f1<_0x4edc46[_0xeb53('0x71')][_0xeb53('0x41')];_0xb83f1+=0x1){if(_0x4edc46['joins'][_0xb83f1][_0xeb53('0x2d')]&&_['includes'](_0x1931eb,_0x4edc46[_0xeb53('0x71')][_0xb83f1][_0xeb53('0x2d')])&&_0x4edc46['joins'][_0xb83f1][_0xeb53('0x73')]&&_0x4edc46[_0xeb53('0x71')][_0xb83f1][_0xeb53('0x74')]&&_0x4edc46['joins'][_0xb83f1][_0xeb53('0x75')]){_0x8b7eed[_0x4edc46[_0xeb53('0x71')][_0xb83f1][_0xeb53('0x2d')]](_0x4edc46[_0xeb53('0x71')][_0xb83f1][_0xeb53('0x74')],null,util[_0xeb53('0x6e')](_0xeb53('0x76'),_0x4edc46[_0xeb53('0x68')],_0x4edc46[_0xeb53('0x71')][_0xb83f1][_0xeb53('0x73')],_0x4edc46[_0xeb53('0x71')][_0xb83f1][_0xeb53('0x74')],_0x4edc46[_0xeb53('0x71')][_0xb83f1]['foreignKey']));}}}if(_0x4edc46['conditions']){_0x4edc46[_0xeb53('0x77')]=JSON[_0xeb53('0x72')](_0x4edc46[_0xeb53('0x77')]);_0x8b7eed[_0xeb53('0x37')](_0x3705ff(_0x4edc46['conditions'][_0xeb53('0x60')]));}_0x5c6281=_0x8b7eed[_0xeb53('0x86')]();_0x8b7eed[_0xeb53('0x1b')](_0x137952);_0x8b7eed['offset'](0x0);logger['debug'](_0xeb53('0x79'),_0x8b7eed['toString']());return dbH[_0xeb53('0x7b')][_0xeb53('0x2f')](_0x8b7eed['toString'](),{'type':dbH['sequelize'][_0xeb53('0x7c')][_0xeb53('0x99')]});}})[_0xeb53('0x20')](function(){return{'sql':_0x5c6281['toString']()};})[_0xeb53('0x20')](respondWithResult(_0x923fa5,null))[_0xeb53('0x3f')](handleError(_0x923fa5,null));};
\ No newline at end of file
+var _0x6e84=['%s-%s.%s','generate','output','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','savename','COUNT(*)','sequelize','runReport','metric','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','apply','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','intersection','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','catch','params','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','toString','QueryTypes','SELECT','join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','ROUND(%s)','IS\x20NULL','value','DESC','web','fullPath'];(function(_0x4a4aef,_0x57a949){var _0x3a7b5f=function(_0x345ca1){while(--_0x345ca1){_0x4a4aef['push'](_0x4a4aef['shift']());}};_0x3a7b5f(++_0x57a949);}(_0x6e84,0x159));var _0x46e8=function(_0x5d7c98,_0x2a7d74){_0x5d7c98=_0x5d7c98-0x0;var _0x35b62e=_0x6e84[_0x5d7c98];return _0x35b62e;};'use strict';var emlformat=require(_0x46e8('0x0'));var rimraf=require(_0x46e8('0x1'));var zipdir=require(_0x46e8('0x2'));var jsonpatch=require(_0x46e8('0x3'));var rp=require(_0x46e8('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x46e8('0x5'));var path=require(_0x46e8('0x6'));var sox=require('sox');var csv=require(_0x46e8('0x7'));var ejs=require(_0x46e8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x46e8('0x9'));var squel=require(_0x46e8('0xa'));var crypto=require(_0x46e8('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x46e8('0x7'));var querystring=require(_0x46e8('0xc'));var Papa=require(_0x46e8('0xd'));var Redis=require(_0x46e8('0xe'));var authService=require(_0x46e8('0xf'));var qs=require(_0x46e8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x46e8('0x11'));var logger=require('../../config/logger')(_0x46e8('0x12'));var utils=require('../../config/utils');var config=require(_0x46e8('0x13'));var licenseUtil=require(_0x46e8('0x14'));var db=require(_0x46e8('0x15'))['db'];var dbH=require(_0x46e8('0x15'))[_0x46e8('0x16')];function respondWithStatusCode(_0x20bbd8,_0x335d1b){_0x335d1b=_0x335d1b||0xcc;return function(_0x4d8b5a){if(_0x4d8b5a){return _0x20bbd8[_0x46e8('0x17')](_0x335d1b);}return _0x20bbd8[_0x46e8('0x18')](_0x335d1b)[_0x46e8('0x19')]();};}function respondWithResult(_0xf22b16,_0x236ab9){_0x236ab9=_0x236ab9||0xc8;return function(_0x2c85c9){if(_0x2c85c9){return _0xf22b16['status'](_0x236ab9)[_0x46e8('0x1a')](_0x2c85c9);}};}function respondWithFilteredResult(_0x293d7a,_0x3a05e9){return function(_0x8d146b){if(_0x8d146b){var _0xa3b93e=typeof _0x3a05e9[_0x46e8('0x1b')]===_0x46e8('0x1c')&&typeof _0x3a05e9['limit']==='undefined';var _0xe25d8a=_0x8d146b[_0x46e8('0x1d')];var _0x45ff4b=_0xa3b93e?0x0:_0x3a05e9['offset'];var _0x1bc322=_0xa3b93e?_0x8d146b[_0x46e8('0x1d')]:_0x3a05e9[_0x46e8('0x1b')]+_0x3a05e9['limit'];var _0x451369;if(_0x1bc322>=_0xe25d8a){_0x1bc322=_0xe25d8a;_0x451369=0xc8;}else{_0x451369=0xce;}_0x293d7a[_0x46e8('0x18')](_0x451369);return _0x293d7a[_0x46e8('0x1e')]('Content-Range',_0x45ff4b+'-'+_0x1bc322+'/'+_0xe25d8a)[_0x46e8('0x1a')](_0x8d146b);}return null;};}function patchUpdates(_0x5198c1){return function(_0x5353f5){try{jsonpatch[_0x46e8('0x1f')](_0x5353f5,_0x5198c1,!![]);}catch(_0x4d016b){return BPromise['reject'](_0x4d016b);}return _0x5353f5[_0x46e8('0x20')]();};}function saveUpdates(_0x5cf4ca,_0x311182){return function(_0x196440){if(_0x196440){return _0x196440[_0x46e8('0x21')](_0x5cf4ca)[_0x46e8('0x22')](function(_0x1de868){return _0x1de868;});}return null;};}function removeEntity(_0x201b43,_0x287456){return function(_0x1ba1e2){if(_0x1ba1e2){return _0x1ba1e2[_0x46e8('0x23')]()[_0x46e8('0x22')](function(){var _0x3870c8=_0x1ba1e2[_0x46e8('0x24')]({'plain':!![]});var _0x2d6ec9=_0x46e8('0x25');return db[_0x46e8('0x26')][_0x46e8('0x23')]({'where':{'type':_0x2d6ec9,'resourceId':_0x3870c8['id']}})[_0x46e8('0x22')](function(){return _0x1ba1e2;});})[_0x46e8('0x22')](function(){_0x201b43[_0x46e8('0x18')](0xcc)[_0x46e8('0x19')]();});}};}function handleEntityNotFound(_0x3218b1,_0x40971a){return function(_0x8430b4){if(!_0x8430b4){_0x3218b1[_0x46e8('0x17')](0x194);}return _0x8430b4;};}function handleError(_0x4786db,_0x564ad2){_0x564ad2=_0x564ad2||0x1f4;return function(_0x390f2b){logger[_0x46e8('0x27')](_0x390f2b[_0x46e8('0x28')]);if(_0x390f2b['name']){delete _0x390f2b[_0x46e8('0x29')];}_0x4786db['status'](_0x564ad2)[_0x46e8('0x2a')](_0x390f2b);};}exports[_0x46e8('0x2b')]=function(_0x383ba2,_0x586a43){var _0x367c21={},_0x2629d5={},_0x180800={'count':0x0,'rows':[]};var _0x48a1be=_[_0x46e8('0x2c')](db[_0x46e8('0x2d')][_0x46e8('0x2e')],function(_0x6e71d9){return{'name':_0x6e71d9[_0x46e8('0x2f')],'type':_0x6e71d9[_0x46e8('0x30')][_0x46e8('0x31')]};});_0x2629d5[_0x46e8('0x32')]=_[_0x46e8('0x2c')](_0x48a1be,'name');_0x2629d5[_0x46e8('0x33')]=_[_0x46e8('0x34')](_0x383ba2['query']);_0x2629d5[_0x46e8('0x35')]=_['intersection'](_0x2629d5[_0x46e8('0x32')],_0x2629d5[_0x46e8('0x33')]);_0x367c21[_0x46e8('0x36')]=_['intersection'](_0x2629d5['model'],qs[_0x46e8('0x37')](_0x383ba2[_0x46e8('0x33')][_0x46e8('0x37')]));_0x367c21['attributes']=_0x367c21[_0x46e8('0x36')][_0x46e8('0x38')]?_0x367c21[_0x46e8('0x36')]:_0x2629d5[_0x46e8('0x32')];if(!_0x383ba2[_0x46e8('0x33')]['hasOwnProperty'](_0x46e8('0x39'))){_0x367c21['limit']=qs[_0x46e8('0x3a')](_0x383ba2[_0x46e8('0x33')][_0x46e8('0x3a')]);_0x367c21[_0x46e8('0x1b')]=qs[_0x46e8('0x1b')](_0x383ba2[_0x46e8('0x33')][_0x46e8('0x1b')]);}_0x367c21[_0x46e8('0x3b')]=qs[_0x46e8('0x3c')](_0x383ba2[_0x46e8('0x33')][_0x46e8('0x3c')]);_0x367c21[_0x46e8('0x3d')]=qs['filters'](_[_0x46e8('0x3e')](_0x383ba2[_0x46e8('0x33')],_0x2629d5[_0x46e8('0x35')]),_0x48a1be);if(_0x383ba2[_0x46e8('0x33')][_0x46e8('0x3f')]){_0x367c21['where']=_[_0x46e8('0x40')](_0x367c21[_0x46e8('0x3d')],{'$or':_[_0x46e8('0x2c')](_0x48a1be,function(_0x4785ea){if(_0x4785ea['type']!=='VIRTUAL'){var _0x2845d7={};_0x2845d7[_0x4785ea[_0x46e8('0x29')]]={'$like':'%'+_0x383ba2[_0x46e8('0x33')][_0x46e8('0x3f')]+'%'};return _0x2845d7;}})});}_0x367c21=_[_0x46e8('0x40')]({},_0x367c21,_0x383ba2[_0x46e8('0x41')]);var _0x2dafe8={'where':_0x367c21[_0x46e8('0x3d')]};return db[_0x46e8('0x2d')][_0x46e8('0x1d')](_0x2dafe8)[_0x46e8('0x22')](function(_0x2f77d6){_0x180800[_0x46e8('0x1d')]=_0x2f77d6;if(_0x383ba2[_0x46e8('0x33')][_0x46e8('0x42')]){_0x367c21[_0x46e8('0x43')]=[{'all':!![]}];}return db[_0x46e8('0x2d')][_0x46e8('0x44')](_0x367c21);})[_0x46e8('0x22')](function(_0x5ef47f){_0x180800['rows']=_0x5ef47f;return _0x180800;})[_0x46e8('0x22')](respondWithFilteredResult(_0x586a43,_0x367c21))['catch'](handleError(_0x586a43,null));};exports[_0x46e8('0x45')]=function(_0xfaa9a5,_0x415d45){var _0x1ee532={'raw':![],'where':{'id':_0xfaa9a5['params']['id']}},_0x9c8ed9={};_0x9c8ed9[_0x46e8('0x32')]=_[_0x46e8('0x34')](db[_0x46e8('0x2d')][_0x46e8('0x2e')]);_0x9c8ed9['query']=_[_0x46e8('0x34')](_0xfaa9a5['query']);_0x9c8ed9[_0x46e8('0x35')]=_['intersection'](_0x9c8ed9['model'],_0x9c8ed9[_0x46e8('0x33')]);_0x1ee532[_0x46e8('0x36')]=_[_0x46e8('0x46')](_0x9c8ed9[_0x46e8('0x32')],qs[_0x46e8('0x37')](_0xfaa9a5[_0x46e8('0x33')][_0x46e8('0x37')]));_0x1ee532[_0x46e8('0x36')]=_0x1ee532['attributes'][_0x46e8('0x38')]?_0x1ee532['attributes']:_0x9c8ed9[_0x46e8('0x32')];if(_0xfaa9a5['query'][_0x46e8('0x42')]){_0x1ee532[_0x46e8('0x43')]=[{'all':!![]}];}_0x1ee532=_[_0x46e8('0x40')]({},_0x1ee532,_0xfaa9a5[_0x46e8('0x41')]);return db['AnalyticCustomReport']['find'](_0x1ee532)[_0x46e8('0x22')](handleEntityNotFound(_0x415d45,null))[_0x46e8('0x22')](respondWithResult(_0x415d45,null))['catch'](handleError(_0x415d45,null));};exports[_0x46e8('0x47')]=function(_0x5ed6d9,_0x477fc8){return db[_0x46e8('0x2d')][_0x46e8('0x47')](_0x5ed6d9[_0x46e8('0x48')],{})[_0x46e8('0x22')](function(_0x17f4fb){var _0x20af85=_0x5ed6d9['user'][_0x46e8('0x24')]({'plain':!![]});if(!_0x20af85)throw new Error(_0x46e8('0x49'));if(_0x20af85[_0x46e8('0x4a')]===_0x46e8('0x4b')){var _0x2b8719=_0x17f4fb[_0x46e8('0x24')]({'plain':!![]});var _0x2305e4='Reports';return db[_0x46e8('0x4c')][_0x46e8('0x4d')]({'where':{'name':_0x2305e4,'userProfileId':_0x20af85[_0x46e8('0x4e')]},'raw':!![]})['then'](function(_0x41102d){if(_0x41102d&&_0x41102d[_0x46e8('0x4f')]===0x0){return db[_0x46e8('0x26')][_0x46e8('0x47')]({'name':_0x2b8719[_0x46e8('0x29')],'resourceId':_0x2b8719['id'],'type':_0x46e8('0x25'),'sectionId':_0x41102d['id']},{})[_0x46e8('0x22')](function(){return _0x17f4fb;});}else{return _0x17f4fb;}})['catch'](function(_0x26fbaf){logger[_0x46e8('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x26fbaf);throw _0x26fbaf;});}return _0x17f4fb;})[_0x46e8('0x22')](respondWithResult(_0x477fc8,0xc9))[_0x46e8('0x50')](handleError(_0x477fc8,null));};exports['update']=function(_0x55b675,_0x154150){if(_0x55b675[_0x46e8('0x48')]['id']){delete _0x55b675['body']['id'];}return db[_0x46e8('0x2d')][_0x46e8('0x4d')]({'where':{'id':_0x55b675[_0x46e8('0x51')]['id']}})['then'](handleEntityNotFound(_0x154150,null))['then'](saveUpdates(_0x55b675['body'],null))[_0x46e8('0x22')](respondWithResult(_0x154150,null))[_0x46e8('0x50')](handleError(_0x154150,null));};exports['destroy']=function(_0x888360,_0x18fc0d){return db[_0x46e8('0x2d')]['find']({'where':{'id':_0x888360[_0x46e8('0x51')]['id']}})[_0x46e8('0x22')](handleEntityNotFound(_0x18fc0d,null))['then'](removeEntity(_0x18fc0d,null))[_0x46e8('0x50')](handleError(_0x18fc0d,null));};exports[_0x46e8('0x52')]=function(_0x1669c8,_0x5cddac){var _0x288d6e=0xa;var _0x5495ee=['join',_0x46e8('0x53'),_0x46e8('0x54'),_0x46e8('0x55')];var _0x292973={'SUM':_0x46e8('0x56'),'COUNT':_0x46e8('0x57'),'COUNT DISTINCT':_0x46e8('0x58'),'MAX':_0x46e8('0x59'),'MIN':_0x46e8('0x5a'),'AVG':_0x46e8('0x5b'),'GROUP_CONCAT':_0x46e8('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x46e8('0x5d')};var _0x2c7721={'SEC_TO_TIME':_0x46e8('0x5e'),'DATE':'DATE(%s)','HOUR':_0x46e8('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x46e8('0x60')};var _0x6bdd00=function(_0x15430a){return!_[_0x46e8('0x61')](['IS\x20NULL',_0x46e8('0x62'),_0x46e8('0x63'),_0x46e8('0x64')],_0x15430a);};var _0x504bc4=function(_0x1ca0d7){if(!_0x1ca0d7||!_0x1ca0d7[_0x46e8('0x65')][_0x46e8('0x38')]){return'';}for(var _0x57fc9b='(',_0x2ce9ef=0x0;_0x2ce9ef<_0x1ca0d7[_0x46e8('0x65')][_0x46e8('0x38')];_0x2ce9ef+=0x1){_0x2ce9ef>0x0&&(_0x57fc9b+='\x20'+_0x1ca0d7[_0x46e8('0x66')]+'\x20');_0x57fc9b+=_0x1ca0d7[_0x46e8('0x65')][_0x2ce9ef][_0x46e8('0x67')]?_0x504bc4(_0x1ca0d7[_0x46e8('0x65')][_0x2ce9ef][_0x46e8('0x67')]):_0x1ca0d7[_0x46e8('0x65')][_0x2ce9ef][_0x46e8('0x68')]+'\x20'+_0x1ca0d7[_0x46e8('0x65')][_0x2ce9ef]['condition']+(_0x6bdd00(_0x1ca0d7[_0x46e8('0x65')][_0x2ce9ef][_0x46e8('0x69')])?'\x20'+_0x1ca0d7['rules'][_0x2ce9ef]['value']:'');}return _0x57fc9b+')';};var _0x1fddeb={'where':{'id':_0x1669c8[_0x46e8('0x51')]['id']}},_0x3901aa,_0x26d87c,_0x4864c3,_0x2f7040,_0x24d9f3;_0x1fddeb=_[_0x46e8('0x40')]({},_0x1fddeb,_0x1669c8[_0x46e8('0x41')]);return db[_0x46e8('0x2d')][_0x46e8('0x4d')](_0x1fddeb)[_0x46e8('0x22')](function(_0x304b32){if(_0x304b32){_0x3901aa=_0x304b32;return _0x304b32[_0x46e8('0x6a')]();}return null;})[_0x46e8('0x22')](function(_0x8d4361){if(_0x8d4361){if(!_0x8d4361['length']){throw new db[(_0x46e8('0x6b'))][(_0x46e8('0x6c'))](_0x46e8('0x6d'),0x193);}_0x26d87c=_0x8d4361;return db[_0x46e8('0x6e')][_0x46e8('0x44')]({'raw':!![]});}return null;})['then'](function(_0x470ff6){if(_0x470ff6){_0x4864c3=_[_0x46e8('0x6f')](_0x470ff6,'id');var _0x56f2d8;var _0x396f09=squel[_0x46e8('0x70')]();_0x396f09[_0x46e8('0x71')](_0x3901aa[_0x46e8('0x72')]);for(var _0x1b1674=0x0;_0x1b1674<_0x26d87c['length'];_0x1b1674+=0x1){_0x56f2d8=_0x26d87c[_0x1b1674][_0x46e8('0x73')]?_0x4864c3[_0x26d87c[_0x1b1674][_0x46e8('0x73')]]['metric']:_0x26d87c[_0x1b1674][_0x46e8('0x68')];_0x56f2d8=_0x26d87c[_0x1b1674][_0x46e8('0x74')]?_[_0x46e8('0x75')](_0x292973[_0x26d87c[_0x1b1674]['function']],'%s',_0x56f2d8):_0x56f2d8;_0x56f2d8=_0x26d87c[_0x1b1674][_0x46e8('0x76')]?_['replace'](_0x2c7721[_0x26d87c[_0x1b1674]['format']],'%s',_0x56f2d8):_0x56f2d8;if(_0x26d87c[_0x1b1674][_0x46e8('0x77')]){_0x396f09['group'](_0x56f2d8);}_0x26d87c[_0x1b1674][_0x46e8('0x78')]&&_0x396f09['order'](_0x56f2d8,_0x26d87c[_0x1b1674][_0x46e8('0x78')]==='DESC'?![]:!![]);_0x396f09['field'](_0x56f2d8,_0x26d87c[_0x1b1674][_0x46e8('0x79')]||_0x56f2d8);}if(_0x3901aa[_0x46e8('0x7a')]){_0x3901aa['joins']=JSON['parse'](_0x3901aa[_0x46e8('0x7a')]);for(var _0x19da93=0x0;_0x19da93<_0x3901aa[_0x46e8('0x7a')][_0x46e8('0x38')];_0x19da93+=0x1){if(_0x3901aa[_0x46e8('0x7a')][_0x19da93][_0x46e8('0x30')]&&_[_0x46e8('0x61')](_0x5495ee,_0x3901aa['joins'][_0x19da93][_0x46e8('0x30')])&&_0x3901aa[_0x46e8('0x7a')][_0x19da93][_0x46e8('0x7b')]&&_0x3901aa[_0x46e8('0x7a')][_0x19da93][_0x46e8('0x7c')]&&_0x3901aa[_0x46e8('0x7a')][_0x19da93][_0x46e8('0x7d')]){_0x396f09[_0x3901aa[_0x46e8('0x7a')][_0x19da93][_0x46e8('0x30')]](_0x3901aa[_0x46e8('0x7a')][_0x19da93]['foreignTable'],null,util['format'](_0x46e8('0x7e'),_0x3901aa[_0x46e8('0x72')],_0x3901aa['joins'][_0x19da93][_0x46e8('0x7b')],_0x3901aa[_0x46e8('0x7a')][_0x19da93]['foreignTable'],_0x3901aa[_0x46e8('0x7a')][_0x19da93][_0x46e8('0x7d')]));}}}if(_0x3901aa[_0x46e8('0x7f')]){_0x3901aa[_0x46e8('0x7f')]=JSON[_0x46e8('0x80')](_0x3901aa[_0x46e8('0x7f')]);_0x396f09[_0x46e8('0x3d')](_0x504bc4(_0x3901aa[_0x46e8('0x7f')][_0x46e8('0x67')]));}_0x24d9f3=_0x396f09[_0x46e8('0x81')]();_0x396f09['limit'](_0x288d6e);_0x396f09['offset'](0x0);logger[_0x46e8('0x82')](_0x46e8('0x83'),_0x396f09['toString']());return dbH['sequelize'][_0x46e8('0x33')](_0x396f09[_0x46e8('0x84')](),{'type':dbH['sequelize'][_0x46e8('0x85')][_0x46e8('0x86')]});}})[_0x46e8('0x22')](respondWithResult(_0x5cddac,null))[_0x46e8('0x50')](handleError(_0x5cddac,null));};function runReport(_0x417ab2,_0x15a89e,_0x492a3a){var _0x222969=_0x15a89e['name'];var _0x27e648=0xa;var _0x3f3065=[_0x46e8('0x87'),_0x46e8('0x53'),_0x46e8('0x54'),_0x46e8('0x55')];var _0x428285={'SUM':_0x46e8('0x56'),'COUNT':_0x46e8('0x57'),'COUNT DISTINCT':_0x46e8('0x58'),'MAX':_0x46e8('0x59'),'MIN':_0x46e8('0x5a'),'AVG':_0x46e8('0x5b'),'GROUP_CONCAT':_0x46e8('0x5c'),'GROUP_CONCAT ASC':_0x46e8('0x88'),'GROUP_CONCAT DESC':_0x46e8('0x5d')};var _0x49c072={'SEC_TO_TIME':_0x46e8('0x5e'),'DATE':_0x46e8('0x89'),'HOUR':_0x46e8('0x5f'),'ROUND':_0x46e8('0x8a'),'UNIX_TIMESTAMP':_0x46e8('0x60')};var _0x5d7ad0=function(_0x84161){return!_['includes']([_0x46e8('0x8b'),_0x46e8('0x62'),_0x46e8('0x63'),_0x46e8('0x64')],_0x84161);};var _0x13c509=function(_0xf9ccc1){if(!_0xf9ccc1||!_0xf9ccc1[_0x46e8('0x65')][_0x46e8('0x38')]){return'';}for(var _0x3adae4='(',_0x4129c0=0x0;_0x4129c0<_0xf9ccc1[_0x46e8('0x65')][_0x46e8('0x38')];_0x4129c0+=0x1){_0x4129c0>0x0&&(_0x3adae4+='\x20'+_0xf9ccc1['operator']+'\x20');_0x3adae4+=_0xf9ccc1[_0x46e8('0x65')][_0x4129c0]['group']?_0x13c509(_0xf9ccc1[_0x46e8('0x65')][_0x4129c0]['group']):_0xf9ccc1[_0x46e8('0x65')][_0x4129c0]['field']+'\x20'+_0xf9ccc1[_0x46e8('0x65')][_0x4129c0][_0x46e8('0x69')]+(_0x5d7ad0(_0xf9ccc1['rules'][_0x4129c0][_0x46e8('0x69')])?'\x20'+_0xf9ccc1['rules'][_0x4129c0][_0x46e8('0x8c')]:'');}return _0x3adae4+')';};var _0x2e27fa={'where':{'id':_0x417ab2['id']}},_0x5b42e6,_0x4128f7,_0xee1492,_0x3c3051,_0x30060a;_0x2e27fa=_[_0x46e8('0x40')]({},_0x2e27fa,_0x492a3a);return db[_0x46e8('0x2d')][_0x46e8('0x4d')](_0x2e27fa)['then'](function(_0x378534){if(_0x378534){_0x5b42e6=_0x378534;return _0x378534[_0x46e8('0x6a')]();}return null;})['then'](function(_0x168e30){if(_0x168e30){if(!_0x168e30[_0x46e8('0x38')]){throw new db['Sequelize'][(_0x46e8('0x6c'))](_0x46e8('0x6d'),0x193);}_0x4128f7=_0x168e30;return db[_0x46e8('0x6e')][_0x46e8('0x44')]({'raw':!![]});}return null;})[_0x46e8('0x22')](function(_0x5cccf8){if(_0x5cccf8){_0xee1492=_[_0x46e8('0x6f')](_0x5cccf8,'id');var _0x412061;var _0x2cfa04=squel[_0x46e8('0x70')]();_0x2cfa04[_0x46e8('0x71')](_0x5b42e6[_0x46e8('0x72')]);for(var _0x12bb7f=0x0;_0x12bb7f<_0x4128f7[_0x46e8('0x38')];_0x12bb7f+=0x1){_0x412061=_0x4128f7[_0x12bb7f]['MetricId']?_0xee1492[_0x4128f7[_0x12bb7f][_0x46e8('0x73')]]['metric']:_0x4128f7[_0x12bb7f]['field'];_0x412061=_0x4128f7[_0x12bb7f]['function']?_[_0x46e8('0x75')](_0x428285[_0x4128f7[_0x12bb7f]['function']],'%s',_0x412061):_0x412061;_0x412061=_0x4128f7[_0x12bb7f][_0x46e8('0x76')]?_[_0x46e8('0x75')](_0x49c072[_0x4128f7[_0x12bb7f]['format']],'%s',_0x412061):_0x412061;if(_0x4128f7[_0x12bb7f]['groupBy']){_0x2cfa04[_0x46e8('0x67')](_0x412061);}_0x4128f7[_0x12bb7f]['orderBy']&&_0x2cfa04[_0x46e8('0x3b')](_0x412061,_0x4128f7[_0x12bb7f][_0x46e8('0x78')]===_0x46e8('0x8d')?![]:!![]);_0x2cfa04[_0x46e8('0x68')](_0x412061,_0x4128f7[_0x12bb7f][_0x46e8('0x79')]||_0x412061);}if(_0x5b42e6['joins']){_0x5b42e6[_0x46e8('0x7a')]=JSON[_0x46e8('0x80')](_0x5b42e6[_0x46e8('0x7a')]);for(var _0x135baf=0x0;_0x135baf<_0x5b42e6[_0x46e8('0x7a')][_0x46e8('0x38')];_0x135baf+=0x1){if(_0x5b42e6[_0x46e8('0x7a')][_0x135baf][_0x46e8('0x30')]&&_['includes'](_0x3f3065,_0x5b42e6['joins'][_0x135baf]['type'])&&_0x5b42e6[_0x46e8('0x7a')][_0x135baf][_0x46e8('0x7b')]&&_0x5b42e6[_0x46e8('0x7a')][_0x135baf]['foreignTable']&&_0x5b42e6[_0x46e8('0x7a')][_0x135baf][_0x46e8('0x7d')]){_0x2cfa04[_0x5b42e6['joins'][_0x135baf][_0x46e8('0x30')]](_0x5b42e6[_0x46e8('0x7a')][_0x135baf]['foreignTable'],null,util[_0x46e8('0x76')](_0x46e8('0x7e'),_0x5b42e6[_0x46e8('0x72')],_0x5b42e6[_0x46e8('0x7a')][_0x135baf]['parentKey'],_0x5b42e6[_0x46e8('0x7a')][_0x135baf][_0x46e8('0x7c')],_0x5b42e6[_0x46e8('0x7a')][_0x135baf][_0x46e8('0x7d')]));}}}if(_0x5b42e6[_0x46e8('0x7f')]){_0x5b42e6[_0x46e8('0x7f')]=JSON[_0x46e8('0x80')](_0x5b42e6[_0x46e8('0x7f')]);_0x2cfa04['where'](_0x13c509(_0x5b42e6[_0x46e8('0x7f')][_0x46e8('0x67')]));}_0x30060a=_0x2cfa04['clone']();_0x2cfa04[_0x46e8('0x3a')](_0x27e648);_0x2cfa04[_0x46e8('0x1b')](0x0);return;}})['then'](function(){if(_0x15a89e['output']===_0x46e8('0x8e')){return null;}var _0x13c82d=_[_0x46e8('0x40')](_0x15a89e,{'name':_0x15a89e[_0x46e8('0x8f')]||_0x15a89e[_0x46e8('0x29')]||_0x5b42e6[_0x46e8('0x29')],'basename':_0x222969,'savename':util[_0x46e8('0x76')](_0x46e8('0x90'),_0x15a89e[_0x46e8('0x29')]||_0x5b42e6[_0x46e8('0x29')],require('randomstring')[_0x46e8('0x91')](0x4),_0x15a89e[_0x46e8('0x92')]||'csv'),'reportId':_0x5b42e6['id'],'reportType':_0x46e8('0x93')});return db[_0x46e8('0x94')][_0x46e8('0x47')](_0x13c82d,{'raw':!![]});})['then'](function(_0x39536e){if(_0x5b42e6[_0x46e8('0x72')]===_0x46e8('0x95')){_0x30060a[_0x46e8('0x3d')](_0x5b42e6[_0x46e8('0x72')]+_0x46e8('0x96'),_0x15a89e[_0x46e8('0x97')],_0x15a89e[_0x46e8('0x98')]);}else{_0x30060a['where'](_0x5b42e6[_0x46e8('0x72')]+_0x46e8('0x99'),_0x15a89e[_0x46e8('0x97')],_0x15a89e[_0x46e8('0x98')]);}if(_0x39536e){logger[_0x46e8('0x9a')](_0x46e8('0x9b'),_0x30060a[_0x46e8('0x84')]());require(_0x46e8('0x9c'))[_0x46e8('0x9d')](path['join'](__dirname,'../../components/export/',_0x39536e[_0x46e8('0x92')]),[_0x39536e['id'],_0x30060a[_0x46e8('0x84')](),path[_0x46e8('0x87')](__dirname,'../../files/reports',_0x39536e[_0x46e8('0x9e')]),_0x222969]);return _0x39536e;}else{var _0x223d4b=squel['select']();_0x223d4b[_0x46e8('0x71')]('('+_0x30060a[_0x46e8('0x84')]()+')','countTable');_0x223d4b[_0x46e8('0x68')](_0x46e8('0x9f'),'count');_0x30060a[_0x46e8('0x3a')](_0x15a89e[_0x46e8('0x3a')]||_0x27e648);_0x30060a[_0x46e8('0x1b')](_0x15a89e[_0x46e8('0x1b')]||0x0);return dbH[_0x46e8('0xa0')][_0x46e8('0x33')](_0x223d4b['toString'](),{'type':dbH[_0x46e8('0xa0')][_0x46e8('0x85')][_0x46e8('0x86')]})['then'](function(_0x3d5fe5){if(!_0x3d5fe5[_0x46e8('0x38')]){_0x3c3051=0x0;}else{_0x3c3051=_0x3d5fe5[0x0][_0x46e8('0x1d')]||0x0;}return dbH['sequelize'][_0x46e8('0x33')](_0x30060a[_0x46e8('0x84')](),{'type':dbH[_0x46e8('0xa0')][_0x46e8('0x85')][_0x46e8('0x86')]});})[_0x46e8('0x22')](function(_0x308176){return{'rows':_0x308176||[],'count':_0x3c3051};});}});}exports['run']=function(_0xc72529,_0x14aef0){return runReport(_0xc72529[_0x46e8('0x51')],_0xc72529[_0x46e8('0x33')],_0xc72529[_0x46e8('0x41')])[_0x46e8('0x22')](respondWithResult(_0x14aef0,null))[_0x46e8('0x50')](handleError(_0x14aef0,null));};exports[_0x46e8('0xa1')]=runReport;exports[_0x46e8('0x33')]=function(_0x522dd4,_0xa7b963){var _0x26d2dc=0xa;var _0x3b85a2=[_0x46e8('0x87'),_0x46e8('0x53'),_0x46e8('0x54'),'cross_join'];var _0x5e2373={'SUM':_0x46e8('0x56'),'COUNT':_0x46e8('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x46e8('0x59'),'MIN':_0x46e8('0x5a'),'AVG':_0x46e8('0x5b'),'GROUP_CONCAT':_0x46e8('0x5c'),'GROUP_CONCAT ASC':_0x46e8('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x28cd3f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x46e8('0x89'),'HOUR':_0x46e8('0x5f'),'ROUND':_0x46e8('0x8a'),'UNIX_TIMESTAMP':_0x46e8('0x60')};var _0x41f666=function(_0x3d9cc5){return!_[_0x46e8('0x61')](['IS\x20NULL',_0x46e8('0x62'),_0x46e8('0x63'),_0x46e8('0x64')],_0x3d9cc5);};var _0x52d5c0=function(_0x12556f){if(!_0x12556f||!_0x12556f['rules']['length']){return'';}for(var _0x505ea1='(',_0x11a5fc=0x0;_0x11a5fc<_0x12556f[_0x46e8('0x65')][_0x46e8('0x38')];_0x11a5fc+=0x1){_0x11a5fc>0x0&&(_0x505ea1+='\x20'+_0x12556f['operator']+'\x20');_0x505ea1+=_0x12556f[_0x46e8('0x65')][_0x11a5fc][_0x46e8('0x67')]?_0x52d5c0(_0x12556f[_0x46e8('0x65')][_0x11a5fc][_0x46e8('0x67')]):_0x12556f['rules'][_0x11a5fc]['field']+'\x20'+_0x12556f['rules'][_0x11a5fc][_0x46e8('0x69')]+(_0x41f666(_0x12556f[_0x46e8('0x65')][_0x11a5fc][_0x46e8('0x69')])?'\x20'+_0x12556f[_0x46e8('0x65')][_0x11a5fc][_0x46e8('0x8c')]:'');}return _0x505ea1+')';};var _0x34be26={'where':{'id':_0x522dd4[_0x46e8('0x51')]['id']}},_0x43a361,_0x32c9da,_0x419c45,_0x1ca266,_0x62606;_0x34be26=_[_0x46e8('0x40')]({},_0x34be26,_0x522dd4['options']);return db[_0x46e8('0x2d')][_0x46e8('0x4d')](_0x34be26)['then'](function(_0xdebd54){if(_0xdebd54){_0x43a361=_0xdebd54;return _0xdebd54['getFields']();}return null;})[_0x46e8('0x22')](function(_0x4b0cbb){if(_0x4b0cbb){if(!_0x4b0cbb[_0x46e8('0x38')]){throw new db[(_0x46e8('0x6b'))][(_0x46e8('0x6c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x32c9da=_0x4b0cbb;return db[_0x46e8('0x6e')][_0x46e8('0x44')]({'raw':!![]});}return null;})['then'](function(_0x38b032){if(_0x38b032){_0x419c45=_[_0x46e8('0x6f')](_0x38b032,'id');var _0x1a0780;var _0x5ba44f=squel[_0x46e8('0x70')]();_0x5ba44f[_0x46e8('0x71')](_0x43a361['table']);for(var _0x445ace=0x0;_0x445ace<_0x32c9da['length'];_0x445ace+=0x1){_0x1a0780=_0x32c9da[_0x445ace][_0x46e8('0x73')]?_0x419c45[_0x32c9da[_0x445ace][_0x46e8('0x73')]][_0x46e8('0xa2')]:_0x32c9da[_0x445ace]['field'];_0x1a0780=_0x32c9da[_0x445ace][_0x46e8('0x74')]?_[_0x46e8('0x75')](_0x5e2373[_0x32c9da[_0x445ace][_0x46e8('0x74')]],'%s',_0x1a0780):_0x1a0780;_0x1a0780=_0x32c9da[_0x445ace][_0x46e8('0x76')]?_[_0x46e8('0x75')](_0x28cd3f[_0x32c9da[_0x445ace][_0x46e8('0x76')]],'%s',_0x1a0780):_0x1a0780;if(_0x32c9da[_0x445ace][_0x46e8('0x77')]){_0x5ba44f[_0x46e8('0x67')](_0x1a0780);}_0x32c9da[_0x445ace]['orderBy']&&_0x5ba44f[_0x46e8('0x3b')](_0x1a0780,_0x32c9da[_0x445ace][_0x46e8('0x78')]===_0x46e8('0x8d')?![]:!![]);_0x5ba44f[_0x46e8('0x68')](_0x1a0780,_0x32c9da[_0x445ace][_0x46e8('0x79')]||_0x1a0780);}if(_0x43a361[_0x46e8('0x7a')]){_0x43a361[_0x46e8('0x7a')]=JSON[_0x46e8('0x80')](_0x43a361[_0x46e8('0x7a')]);for(var _0x559b05=0x0;_0x559b05<_0x43a361[_0x46e8('0x7a')][_0x46e8('0x38')];_0x559b05+=0x1){if(_0x43a361[_0x46e8('0x7a')][_0x559b05][_0x46e8('0x30')]&&_[_0x46e8('0x61')](_0x3b85a2,_0x43a361['joins'][_0x559b05][_0x46e8('0x30')])&&_0x43a361[_0x46e8('0x7a')][_0x559b05][_0x46e8('0x7b')]&&_0x43a361[_0x46e8('0x7a')][_0x559b05][_0x46e8('0x7c')]&&_0x43a361['joins'][_0x559b05]['foreignKey']){_0x5ba44f[_0x43a361['joins'][_0x559b05][_0x46e8('0x30')]](_0x43a361[_0x46e8('0x7a')][_0x559b05]['foreignTable'],null,util[_0x46e8('0x76')](_0x46e8('0x7e'),_0x43a361['table'],_0x43a361['joins'][_0x559b05][_0x46e8('0x7b')],_0x43a361[_0x46e8('0x7a')][_0x559b05][_0x46e8('0x7c')],_0x43a361['joins'][_0x559b05][_0x46e8('0x7d')]));}}}if(_0x43a361[_0x46e8('0x7f')]){_0x43a361['conditions']=JSON[_0x46e8('0x80')](_0x43a361[_0x46e8('0x7f')]);_0x5ba44f['where'](_0x52d5c0(_0x43a361[_0x46e8('0x7f')][_0x46e8('0x67')]));}_0x62606=_0x5ba44f['clone']();_0x5ba44f[_0x46e8('0x3a')](_0x26d2dc);_0x5ba44f[_0x46e8('0x1b')](0x0);logger['debug'](_0x46e8('0x83'),_0x5ba44f['toString']());return dbH['sequelize'][_0x46e8('0x33')](_0x5ba44f[_0x46e8('0x84')](),{'type':dbH['sequelize']['QueryTypes'][_0x46e8('0x86')]});}})['then'](function(){return{'sql':_0x62606['toString']()};})['then'](respondWithResult(_0xa7b963,null))[_0x46e8('0x50')](handleError(_0xa7b963,null));};
\ No newline at end of file
index 590819c..f43cbf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf73=['bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes','define','analytics_custom_reports','util','../../config/logger','api','moment'];(function(_0x4d7116,_0xdb8175){var _0x4593dc=function(_0x51d44e){while(--_0x51d44e){_0x4d7116['push'](_0x4d7116['shift']());}};_0x4593dc(++_0xdb8175);}(_0xcf73,0x193));var _0x3cf7=function(_0x1f13d5,_0x210639){_0x1f13d5=_0x1f13d5-0x0;var _0x4fda7a=_0xcf73[_0x1f13d5];return _0x4fda7a;};'use strict';var _=require('lodash');var util=require(_0x3cf7('0x0'));var logger=require(_0x3cf7('0x1'))(_0x3cf7('0x2'));var moment=require(_0x3cf7('0x3'));var BPromise=require(_0x3cf7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3cf7('0x5'));var rimraf=require(_0x3cf7('0x6'));var config=require(_0x3cf7('0x7'));var attributes=require(_0x3cf7('0x8'));module['exports']=function(_0x46ec83,_0x17a20a){return _0x46ec83[_0x3cf7('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0x3cf7('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x56d4=['bluebird','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','api','moment'];(function(_0x242ce6,_0x297d12){var _0x13f70a=function(_0x370ccf){while(--_0x370ccf){_0x242ce6['push'](_0x242ce6['shift']());}};_0x13f70a(++_0x297d12);}(_0x56d4,0x164));var _0x456d=function(_0xce854e,_0x579729){_0xce854e=_0xce854e-0x0;var _0x2246a9=_0x56d4[_0xce854e];return _0x2246a9;};'use strict';var _=require('lodash');var util=require(_0x456d('0x0'));var logger=require(_0x456d('0x1'))(_0x456d('0x2'));var moment=require(_0x456d('0x3'));var BPromise=require(_0x456d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x456d('0x5'));var rimraf=require('rimraf');var config=require(_0x456d('0x6'));var attributes=require(_0x456d('0x7'));module[_0x456d('0x8')]=function(_0x325ef3,_0x4bcb7b){return _0x325ef3[_0x456d('0x9')](_0x456d('0xa'),attributes,{'tableName':_0x456d('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 98d2f29..a642321 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2c7=['info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x9dd37c,_0x3e255e){var _0x2a522c=function(_0x2ce2ca){while(--_0x2ce2ca){_0x9dd37c['push'](_0x9dd37c['shift']());}};_0x2a522c(++_0x3e255e);}(_0xc2c7,0x179));var _0x7c2c=function(_0x203991,_0x5e2e25){_0x203991=_0x203991-0x0;var _0x216414=_0xc2c7[_0x203991];return _0x216414;};'use strict';var _=require(_0x7c2c('0x0'));var util=require(_0x7c2c('0x1'));var moment=require(_0x7c2c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7c2c('0x3'));var db=require(_0x7c2c('0x4'))['db'];var utils=require(_0x7c2c('0x5'));var logger=require(_0x7c2c('0x6'))(_0x7c2c('0x7'));var config=require(_0x7c2c('0x8'));var jayson=require(_0x7c2c('0x9'));var client=jayson[_0x7c2c('0xa')][_0x7c2c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b873b,_0x459812,_0x2ad0ac){return new BPromise(function(_0x1c33b3,_0x4e222e){return client[_0x7c2c('0xc')](_0x1b873b,_0x2ad0ac)[_0x7c2c('0xd')](function(_0x3e38fe){logger[_0x7c2c('0xe')](_0x7c2c('0xf'),_0x459812,_0x7c2c('0x10'));logger['debug'](_0x7c2c('0x11'),_0x459812,_0x7c2c('0x10'),JSON[_0x7c2c('0x12')](_0x3e38fe));if(_0x3e38fe[_0x7c2c('0x13')]){if(_0x3e38fe[_0x7c2c('0x13')]['code']===0x1f4){logger['error'](_0x7c2c('0xf'),_0x459812,_0x3e38fe['error']['message']);return _0x4e222e(_0x3e38fe[_0x7c2c('0x13')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x13')](_0x7c2c('0xf'),_0x459812,_0x3e38fe[_0x7c2c('0x13')][_0x7c2c('0x14')]);return _0x1c33b3(_0x3e38fe[_0x7c2c('0x13')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xf'),_0x459812,_0x7c2c('0x10'));_0x1c33b3(_0x3e38fe[_0x7c2c('0x15')][_0x7c2c('0x14')]);}})[_0x7c2c('0x16')](function(_0x414b47){logger[_0x7c2c('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x459812,_0x414b47);_0x4e222e(_0x414b47);});});}
\ No newline at end of file
+var _0x724b=['error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x724b,0x66));var _0xb724=function(_0x408338,_0x4cd8e7){_0x408338=_0x408338-0x0;var _0x313eca=_0x724b[_0x408338];return _0x313eca;};'use strict';var _=require(_0xb724('0x0'));var util=require(_0xb724('0x1'));var moment=require(_0xb724('0x2'));var BPromise=require(_0xb724('0x3'));var rs=require(_0xb724('0x4'));var fs=require('fs');var Redis=require(_0xb724('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb724('0x6'))(_0xb724('0x7'));var config=require(_0xb724('0x8'));var jayson=require(_0xb724('0x9'));var client=jayson[_0xb724('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12ef4f,_0xdc06b3,_0x3e73a6){return new BPromise(function(_0x146a9f,_0x305998){return client[_0xb724('0xb')](_0x12ef4f,_0x3e73a6)[_0xb724('0xc')](function(_0x238143){logger[_0xb724('0xd')](_0xb724('0xe'),_0xdc06b3,'request\x20sent');logger[_0xb724('0xf')](_0xb724('0x10'),_0xdc06b3,_0xb724('0x11'),JSON['stringify'](_0x238143));if(_0x238143[_0xb724('0x12')]){if(_0x238143[_0xb724('0x12')]['code']===0x1f4){logger[_0xb724('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0xdc06b3,_0x238143[_0xb724('0x12')]['message']);return _0x305998(_0x238143['error'][_0xb724('0x13')]);}logger[_0xb724('0x12')](_0xb724('0xe'),_0xdc06b3,_0x238143[_0xb724('0x12')][_0xb724('0x13')]);return _0x146a9f(_0x238143[_0xb724('0x12')]['message']);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0xdc06b3,'request\x20sent');_0x146a9f(_0x238143['result'][_0xb724('0x13')]);}})['catch'](function(_0x5535f8){logger['error'](_0xb724('0xe'),_0xdc06b3,_0x5535f8);_0x305998(_0x5535f8);});});}
\ No newline at end of file
index 30d2dd3..8d0bc20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ea7=['express','Router','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id','/:id/preview','preview','/:id/run','run','query','post','create','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x5eebc9,_0x104871){var _0x17c047=function(_0x1b4b6f){while(--_0x1b4b6f){_0x5eebc9['push'](_0x5eebc9['shift']());}};_0x17c047(++_0x104871);}(_0x2ea7,0x16d));var _0x72ea=function(_0x3a340f,_0x18653e){_0x3a340f=_0x3a340f-0x0;var _0x14ca55=_0x2ea7[_0x3a340f];return _0x14ca55;};'use strict';var multer=require('multer');var util=require(_0x72ea('0x0'));var path=require(_0x72ea('0x1'));var timeout=require(_0x72ea('0x2'));var express=require(_0x72ea('0x3'));var router=express[_0x72ea('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x72ea('0x5'));var config=require(_0x72ea('0x6'));var controller=require(_0x72ea('0x7'));router[_0x72ea('0x8')]('/',auth[_0x72ea('0x9')](),controller['index']);router[_0x72ea('0x8')](_0x72ea('0xa'),auth[_0x72ea('0x9')](),controller['show']);router[_0x72ea('0x8')](_0x72ea('0xb'),auth[_0x72ea('0x9')](),controller[_0x72ea('0xc')]);router[_0x72ea('0x8')](_0x72ea('0xd'),auth[_0x72ea('0x9')](),controller[_0x72ea('0xe')]);router[_0x72ea('0x8')]('/:id/query',auth['isAuthenticated'](),controller[_0x72ea('0xf')]);router[_0x72ea('0x10')]('/',auth[_0x72ea('0x9')](),controller[_0x72ea('0x11')]);router[_0x72ea('0x12')](_0x72ea('0xa'),auth[_0x72ea('0x9')](),controller[_0x72ea('0x13')]);router[_0x72ea('0x14')](_0x72ea('0xa'),auth[_0x72ea('0x9')](),controller[_0x72ea('0x15')]);module[_0x72ea('0x16')]=router;
\ No newline at end of file
+var _0xa918=['isAuthenticated','index','get','/:id','show','preview','/:id/query','query','post','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticCustomReport.controller'];(function(_0x3a288d,_0x1891cb){var _0x126b2c=function(_0x518959){while(--_0x518959){_0x3a288d['push'](_0x3a288d['shift']());}};_0x126b2c(++_0x1891cb);}(_0xa918,0x172));var _0x8a91=function(_0x12a754,_0x5ae799){_0x12a754=_0x12a754-0x0;var _0x1cb480=_0xa918[_0x12a754];return _0x1cb480;};'use strict';var multer=require(_0x8a91('0x0'));var util=require('util');var path=require(_0x8a91('0x1'));var timeout=require(_0x8a91('0x2'));var express=require(_0x8a91('0x3'));var router=express[_0x8a91('0x4')]();var fs_extra=require(_0x8a91('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8a91('0x6'));var controller=require(_0x8a91('0x7'));router['get']('/',auth[_0x8a91('0x8')](),controller[_0x8a91('0x9')]);router[_0x8a91('0xa')](_0x8a91('0xb'),auth[_0x8a91('0x8')](),controller[_0x8a91('0xc')]);router[_0x8a91('0xa')]('/:id/preview',auth[_0x8a91('0x8')](),controller[_0x8a91('0xd')]);router['get']('/:id/run',auth[_0x8a91('0x8')](),controller['run']);router[_0x8a91('0xa')](_0x8a91('0xe'),auth[_0x8a91('0x8')](),controller[_0x8a91('0xf')]);router[_0x8a91('0x10')]('/',auth[_0x8a91('0x8')](),controller['create']);router[_0x8a91('0x11')](_0x8a91('0xb'),auth[_0x8a91('0x8')](),controller[_0x8a91('0x12')]);router[_0x8a91('0x13')](_0x8a91('0xb'),auth[_0x8a91('0x8')](),controller['destroy']);module[_0x8a91('0x14')]=router;
\ No newline at end of file
index 64860a2..2cdbac8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x038b=['exports','STRING','TEXT'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x038b,0x114));var _0xb038=function(_0x163b94,_0x3cc020){_0x163b94=_0x163b94-0x0;var _0x2d1f28=_0x038b[_0x163b94];return _0x2d1f28;};'use strict';var Sequelize=require('sequelize');module[_0xb038('0x0')]={'name':{'type':Sequelize[_0xb038('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xb038('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb038('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb038('0x2')]}};
\ No newline at end of file
+var _0xeda8=['sequelize','exports','STRING','TEXT'];(function(_0x5e2219,_0x1384ba){var _0x419dfa=function(_0x2d6533){while(--_0x2d6533){_0x5e2219['push'](_0x5e2219['shift']());}};_0x419dfa(++_0x1384ba);}(_0xeda8,0x104));var _0x8eda=function(_0xb83270,_0x59549f){_0xb83270=_0xb83270-0x0;var _0xa31dec=_0xeda8[_0xb83270];return _0xa31dec;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eda('0x2')]},'parent':{'type':Sequelize[_0x8eda('0x2')]},'table':{'type':Sequelize[_0x8eda('0x2')]},'conditions':{'type':Sequelize[_0x8eda('0x3')]},'joins':{'type':Sequelize[_0x8eda('0x3')]}};
\ No newline at end of file
index e1d8d50..0ca7d81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb9=['runReport','left_join','SEC_TO_TIME(%s)','IS\x20NULL','clone','debug','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','apply','reject','then','destroy','get','UserProfileResource','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','user','role','autoAssociation','create','DefaultReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%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)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','HOUR(%s)','value','groupBy','alias','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)'];(function(_0x230f43,_0x57edaf){var _0x1063a0=function(_0x38d08f){while(--_0x38d08f){_0x230f43['push'](_0x230f43['shift']());}};_0x1063a0(++_0x57edaf);}(_0x1cb9,0x14e));var _0x91cb=function(_0x448e5e,_0x57a63b){_0x448e5e=_0x448e5e-0x0;var _0x594eec=_0x1cb9[_0x448e5e];return _0x594eec;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];var dbH=require(_0x91cb('0x18'))['dbH'];function respondWithStatusCode(_0x20e6e0,_0x3ea707){_0x3ea707=_0x3ea707||0xcc;return function(_0x44f2e9){if(_0x44f2e9){return _0x20e6e0[_0x91cb('0x19')](_0x3ea707);}return _0x20e6e0['status'](_0x3ea707)['end']();};}function respondWithResult(_0x4aae25,_0x3d22b7){_0x3d22b7=_0x3d22b7||0xc8;return function(_0x585470){if(_0x585470){return _0x4aae25['status'](_0x3d22b7)[_0x91cb('0x1a')](_0x585470);}};}function respondWithFilteredResult(_0xc3629e,_0x347980){return function(_0x5ea796){if(_0x5ea796){var _0x238f11=typeof _0x347980[_0x91cb('0x1b')]==='undefined'&&typeof _0x347980[_0x91cb('0x1c')]===_0x91cb('0x1d');var _0x1cd34b=_0x5ea796[_0x91cb('0x1e')];var _0x5cc1c3=_0x238f11?0x0:_0x347980[_0x91cb('0x1b')];var _0x7dcf60=_0x238f11?_0x5ea796['count']:_0x347980[_0x91cb('0x1b')]+_0x347980['limit'];var _0x55042a;if(_0x7dcf60>=_0x1cd34b){_0x7dcf60=_0x1cd34b;_0x55042a=0xc8;}else{_0x55042a=0xce;}_0xc3629e[_0x91cb('0x1f')](_0x55042a);return _0xc3629e[_0x91cb('0x20')]('Content-Range',_0x5cc1c3+'-'+_0x7dcf60+'/'+_0x1cd34b)['json'](_0x5ea796);}return null;};}function patchUpdates(_0x5b385a){return function(_0x438162){try{jsonpatch[_0x91cb('0x21')](_0x438162,_0x5b385a,!![]);}catch(_0x20aff5){return BPromise[_0x91cb('0x22')](_0x20aff5);}return _0x438162['save']();};}function saveUpdates(_0x45c4b3,_0x43881c){return function(_0x1fa837){if(_0x1fa837){return _0x1fa837['update'](_0x45c4b3)[_0x91cb('0x23')](function(_0x1a7a54){return _0x1a7a54;});}return null;};}function removeEntity(_0x2447e7,_0x422d14){return function(_0x3ca500){if(_0x3ca500){return _0x3ca500[_0x91cb('0x24')]()[_0x91cb('0x23')](function(){var _0x423c4f=_0x3ca500[_0x91cb('0x25')]({'plain':!![]});var _0x4c8438='DefaultReports';return db[_0x91cb('0x26')]['destroy']({'where':{'type':_0x4c8438,'resourceId':_0x423c4f['id']}})[_0x91cb('0x23')](function(){return _0x3ca500;});})[_0x91cb('0x23')](function(){_0x2447e7[_0x91cb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b26a6,_0x4f5a7b){return function(_0x4572f6){if(!_0x4572f6){_0x9b26a6[_0x91cb('0x19')](0x194);}return _0x4572f6;};}function handleError(_0x3b3ee6,_0x2fb473){_0x2fb473=_0x2fb473||0x1f4;return function(_0x468908){logger['error'](_0x468908[_0x91cb('0x27')]);if(_0x468908['name']){delete _0x468908[_0x91cb('0x28')];}_0x3b3ee6[_0x91cb('0x1f')](_0x2fb473)[_0x91cb('0x29')](_0x468908);};}exports['index']=function(_0x775c25,_0x146e1f){var _0x25bbf9={},_0x361e4c={},_0xf296bc={'count':0x0,'rows':[]};var _0x3dab18=_[_0x91cb('0x2a')](db[_0x91cb('0x2b')][_0x91cb('0x2c')],function(_0x5e6ed3){return{'name':_0x5e6ed3[_0x91cb('0x2d')],'type':_0x5e6ed3[_0x91cb('0x2e')][_0x91cb('0x2f')]};});_0x361e4c[_0x91cb('0x30')]=_[_0x91cb('0x2a')](_0x3dab18,'name');_0x361e4c[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x775c25[_0x91cb('0x31')]);_0x361e4c[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x361e4c['model'],_0x361e4c[_0x91cb('0x31')]);_0x25bbf9['attributes']=_['intersection'](_0x361e4c['model'],qs[_0x91cb('0x35')](_0x775c25['query'][_0x91cb('0x35')]));_0x25bbf9['attributes']=_0x25bbf9['attributes'][_0x91cb('0x36')]?_0x25bbf9[_0x91cb('0x37')]:_0x361e4c[_0x91cb('0x30')];if(!_0x775c25[_0x91cb('0x31')][_0x91cb('0x38')]('nolimit')){_0x25bbf9[_0x91cb('0x1c')]=qs[_0x91cb('0x1c')](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1c')]);_0x25bbf9['offset']=qs['offset'](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1b')]);}_0x25bbf9['order']=qs[_0x91cb('0x39')](_0x775c25[_0x91cb('0x31')]['sort']);_0x25bbf9[_0x91cb('0x3a')]=qs[_0x91cb('0x33')](_['pick'](_0x775c25[_0x91cb('0x31')],_0x361e4c['filters']),_0x3dab18);if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3b')]){_0x25bbf9[_0x91cb('0x3a')]=_[_0x91cb('0x3c')](_0x25bbf9[_0x91cb('0x3a')],{'$or':_[_0x91cb('0x2a')](_0x3dab18,function(_0x5d0e37){if(_0x5d0e37[_0x91cb('0x2e')]!==_0x91cb('0x3d')){var _0x4e5b4b={};_0x4e5b4b[_0x5d0e37[_0x91cb('0x28')]]={'$like':'%'+_0x775c25['query'][_0x91cb('0x3b')]+'%'};return _0x4e5b4b;}})});}_0x25bbf9=_[_0x91cb('0x3c')]({},_0x25bbf9,_0x775c25[_0x91cb('0x3e')]);var _0x174794={'where':_0x25bbf9['where']};return db[_0x91cb('0x2b')][_0x91cb('0x1e')](_0x174794)[_0x91cb('0x23')](function(_0x37e777){_0xf296bc[_0x91cb('0x1e')]=_0x37e777;if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3f')]){_0x25bbf9[_0x91cb('0x40')]=[{'all':!![]}];}return db[_0x91cb('0x2b')][_0x91cb('0x41')](_0x25bbf9);})['then'](function(_0x16993f){_0xf296bc['rows']=_0x16993f;return _0xf296bc;})[_0x91cb('0x23')](respondWithFilteredResult(_0x146e1f,_0x25bbf9))['catch'](handleError(_0x146e1f,null));};exports[_0x91cb('0x42')]=function(_0x52e82c,_0x138f48){var _0x477131={'raw':!![],'where':{'id':_0x52e82c[_0x91cb('0x43')]['id']}},_0xba99ce={};_0xba99ce['model']=_[_0x91cb('0x32')](db[_0x91cb('0x2b')]['rawAttributes']);_0xba99ce[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x52e82c[_0x91cb('0x31')]);_0xba99ce[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0xba99ce[_0x91cb('0x30')],_0xba99ce[_0x91cb('0x31')]);_0x477131[_0x91cb('0x37')]=_[_0x91cb('0x34')](_0xba99ce['model'],qs[_0x91cb('0x35')](_0x52e82c[_0x91cb('0x31')][_0x91cb('0x35')]));_0x477131[_0x91cb('0x37')]=_0x477131[_0x91cb('0x37')][_0x91cb('0x36')]?_0x477131[_0x91cb('0x37')]:_0xba99ce[_0x91cb('0x30')];if(_0x52e82c['query'][_0x91cb('0x3f')]){_0x477131[_0x91cb('0x40')]=[{'all':!![]}];}_0x477131=_[_0x91cb('0x3c')]({},_0x477131,_0x52e82c[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x477131)[_0x91cb('0x23')](handleEntityNotFound(_0x138f48,null))['then'](respondWithResult(_0x138f48,null))[_0x91cb('0x45')](handleError(_0x138f48,null));};exports['create']=function(_0x2c419b,_0x4c0acd){return db['AnalyticDefaultReport']['create'](_0x2c419b[_0x91cb('0x46')],{})[_0x91cb('0x23')](function(_0x3d62c4){var _0x2f8384=_0x2c419b[_0x91cb('0x47')]['get']({'plain':!![]});if(!_0x2f8384)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8384[_0x91cb('0x48')]===_0x91cb('0x47')){var _0x140994=_0x3d62c4[_0x91cb('0x25')]({'plain':!![]});var _0x57adff='Reports';return db['UserProfileSection'][_0x91cb('0x44')]({'where':{'name':_0x57adff,'userProfileId':_0x2f8384['userProfileId']},'raw':!![]})[_0x91cb('0x23')](function(_0x4aa670){if(_0x4aa670&&_0x4aa670[_0x91cb('0x49')]===0x0){return db[_0x91cb('0x26')][_0x91cb('0x4a')]({'name':_0x140994[_0x91cb('0x28')],'resourceId':_0x140994['id'],'type':_0x91cb('0x4b'),'sectionId':_0x4aa670['id']},{})[_0x91cb('0x23')](function(){return _0x3d62c4;});}else{return _0x3d62c4;}})[_0x91cb('0x45')](function(_0x30fd4e){logger[_0x91cb('0x4c')](_0x91cb('0x4d'),_0x30fd4e);throw _0x30fd4e;});}return _0x3d62c4;})[_0x91cb('0x23')](respondWithResult(_0x4c0acd,0xc9))['catch'](handleError(_0x4c0acd,null));};exports[_0x91cb('0x4e')]=function(_0x1fa45a,_0x4d7a34){if(_0x1fa45a[_0x91cb('0x46')]['id']){delete _0x1fa45a[_0x91cb('0x46')]['id'];}return db['AnalyticDefaultReport'][_0x91cb('0x44')]({'where':{'id':_0x1fa45a[_0x91cb('0x43')]['id']}})[_0x91cb('0x23')](handleEntityNotFound(_0x4d7a34,null))[_0x91cb('0x23')](saveUpdates(_0x1fa45a[_0x91cb('0x46')],null))[_0x91cb('0x23')](respondWithResult(_0x4d7a34,null))[_0x91cb('0x45')](handleError(_0x4d7a34,null));};exports[_0x91cb('0x24')]=function(_0x3320bd,_0x93ef52){return db[_0x91cb('0x2b')]['find']({'where':{'id':_0x3320bd[_0x91cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x93ef52,null))[_0x91cb('0x23')](removeEntity(_0x93ef52,null))['catch'](handleError(_0x93ef52,null));};exports[_0x91cb('0x4f')]=function(_0x1b2fec,_0x1986d7){var _0x47a6cd=0xa;var _0xe49d42=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),_0x91cb('0x52')];var _0x365afd={'SUM':_0x91cb('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x5c2c01={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x91cb('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':_0x91cb('0x5c')};var _0x5ae0d2=function(_0x4f19c8){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4f19c8);};var _0x551836=function(_0x22fea8){if(!_0x22fea8||!_0x22fea8['rules'][_0x91cb('0x36')]){return'';}for(var _0xe08233='(',_0xd7be15=0x0;_0xd7be15<_0x22fea8[_0x91cb('0x61')]['length'];_0xd7be15+=0x1){_0xd7be15>0x0&&(_0xe08233+='\x20'+_0x22fea8[_0x91cb('0x62')]+'\x20');_0xe08233+=_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]?_0x551836(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]):_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x64')]+'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')]+(_0x5ae0d2(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')])?'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15]['value']:'');}return _0xe08233+')';};var _0x2cf4d0={'where':{'id':_0x1b2fec[_0x91cb('0x43')]['id']}},_0x2e301a,_0x474682,_0x51ab8a,_0x21c890,_0xca33a2;_0x2cf4d0=_['merge']({},_0x2cf4d0,_0x1b2fec[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x2cf4d0)[_0x91cb('0x23')](function(_0x80fcc6){if(_0x80fcc6){_0x2e301a=_0x80fcc6;return _0x80fcc6[_0x91cb('0x66')]();}return null;})['then'](function(_0x1c0b66){if(_0x1c0b66){if(!_0x1c0b66[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x474682=_0x1c0b66;return db[_0x91cb('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x28bfe5){if(_0x28bfe5){_0x51ab8a=_[_0x91cb('0x6b')](_0x28bfe5,'id');var _0x1f0ba2;var _0x891569=squel[_0x91cb('0x6c')]();_0x891569[_0x91cb('0x6d')](_0x2e301a[_0x91cb('0x6e')]);for(var _0x43629b=0x0;_0x43629b<_0x474682[_0x91cb('0x36')];_0x43629b+=0x1){_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x6f')]?_0x51ab8a[_0x474682[_0x43629b][_0x91cb('0x6f')]][_0x91cb('0x70')]:_0x474682[_0x43629b][_0x91cb('0x64')];_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x365afd[_0x474682[_0x43629b][_0x91cb('0x71')]],'%s',_0x1f0ba2):_0x1f0ba2;_0x1f0ba2=_0x474682[_0x43629b]['format']?_[_0x91cb('0x72')](_0x5c2c01[_0x474682[_0x43629b][_0x91cb('0x73')]],'%s',_0x1f0ba2):_0x1f0ba2;if(_0x474682[_0x43629b]['groupBy']){_0x891569[_0x91cb('0x63')](_0x1f0ba2);}_0x474682[_0x43629b][_0x91cb('0x74')]&&_0x891569[_0x91cb('0x75')](_0x1f0ba2,_0x474682[_0x43629b]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x891569[_0x91cb('0x64')](_0x1f0ba2,_0x474682[_0x43629b]['alias']||_0x1f0ba2);}if(_0x2e301a['joins']){_0x2e301a[_0x91cb('0x77')]=JSON['parse'](_0x2e301a[_0x91cb('0x77')]);for(var _0x376f56=0x0;_0x376f56<_0x2e301a['joins'][_0x91cb('0x36')];_0x376f56+=0x1){if(_0x2e301a['joins'][_0x376f56][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0xe49d42,_0x2e301a['joins'][_0x376f56]['type'])&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')]&&_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignTable']&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x79')]){_0x891569[_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x2e')]](_0x2e301a['joins'][_0x376f56][_0x91cb('0x7a')],null,util['format'](_0x91cb('0x7b'),_0x2e301a[_0x91cb('0x6e')],_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')],_0x2e301a['joins'][_0x376f56]['foreignTable'],_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignKey']));}}}if(_0x2e301a[_0x91cb('0x7c')]){_0x2e301a[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2e301a[_0x91cb('0x7c')]);_0x891569[_0x91cb('0x3a')](_0x551836(_0x2e301a[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0xca33a2=_0x891569['clone']();_0x891569[_0x91cb('0x1c')](_0x47a6cd);_0x891569[_0x91cb('0x1b')](0x0);logger['debug'](_0x91cb('0x7e'),_0x891569['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x891569[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});}})[_0x91cb('0x23')](respondWithResult(_0x1986d7,null))[_0x91cb('0x45')](handleError(_0x1986d7,null));};function runReport(_0x23380a,_0x14cad8,_0x20a64f){var _0x11411d=_0x14cad8[_0x91cb('0x28')];var _0x14882d=0xa;var _0x22ba54=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),'cross_join'];var _0x1235c0={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':_0x91cb('0x84'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x91cb('0x59')};var _0xdee7f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x91cb('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x95f2de=function(_0x4d777a){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d777a);};var _0x443c01=function(_0x4e899c){if(!_0x4e899c||!_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x42d07b='(',_0x427afd=0x0;_0x427afd<_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')];_0x427afd+=0x1){_0x427afd>0x0&&(_0x42d07b+='\x20'+_0x4e899c[_0x91cb('0x62')]+'\x20');_0x42d07b+=_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]?_0x443c01(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]):_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x64')]+'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')]+(_0x95f2de(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')])?'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x86')]:'');}return _0x42d07b+')';};var _0x39b5bd={'where':{'id':_0x23380a['id']}},_0x315518,_0x3d944d,_0x43b96c,_0xe4d946,_0x32d426;_0x39b5bd=_['merge']({},_0x39b5bd,_0x20a64f);return db[_0x91cb('0x2b')][_0x91cb('0x44')](_0x39b5bd)[_0x91cb('0x23')](function(_0x1a654b){if(_0x1a654b){_0x315518=_0x1a654b;return _0x1a654b[_0x91cb('0x66')]();}return null;})[_0x91cb('0x23')](function(_0x404457){if(_0x404457){if(!_0x404457[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x3d944d=_0x404457;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})['then'](function(_0x5689ea){if(_0x5689ea){_0x43b96c=_[_0x91cb('0x6b')](_0x5689ea,'id');var _0x265ffb;var _0x4f66f=squel[_0x91cb('0x6c')]();_0x4f66f[_0x91cb('0x6d')](_0x315518[_0x91cb('0x6e')]);for(var _0x210b46=0x0;_0x210b46<_0x3d944d[_0x91cb('0x36')];_0x210b46+=0x1){_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x6f')]?_0x43b96c[_0x3d944d[_0x210b46][_0x91cb('0x6f')]]['metric']:_0x3d944d[_0x210b46][_0x91cb('0x64')];_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x71')]?_['replace'](_0x1235c0[_0x3d944d[_0x210b46][_0x91cb('0x71')]],'%s',_0x265ffb):_0x265ffb;_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x73')]?_['replace'](_0xdee7f[_0x3d944d[_0x210b46][_0x91cb('0x73')]],'%s',_0x265ffb):_0x265ffb;if(_0x3d944d[_0x210b46][_0x91cb('0x87')]){_0x4f66f[_0x91cb('0x63')](_0x265ffb);}_0x3d944d[_0x210b46][_0x91cb('0x74')]&&_0x4f66f[_0x91cb('0x75')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x74')]===_0x91cb('0x76')?![]:!![]);_0x4f66f[_0x91cb('0x64')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x88')]||_0x265ffb);}if(_0x315518[_0x91cb('0x77')]){_0x315518[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x315518['joins']);for(var _0x5c0725=0x0;_0x5c0725<_0x315518[_0x91cb('0x77')][_0x91cb('0x36')];_0x5c0725+=0x1){if(_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0x22ba54,_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')])&&_0x315518['joins'][_0x5c0725][_0x91cb('0x78')]&&_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')]&&_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]){_0x4f66f[_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]](_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')],null,util[_0x91cb('0x73')](_0x91cb('0x7b'),_0x315518[_0x91cb('0x6e')],_0x315518[_0x91cb('0x77')][_0x5c0725]['parentKey'],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x7a')],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]));}}}if(_0x315518['conditions']){_0x315518['conditions']=JSON['parse'](_0x315518[_0x91cb('0x7c')]);_0x4f66f[_0x91cb('0x3a')](_0x443c01(_0x315518[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0x32d426=_0x4f66f['clone']();_0x4f66f[_0x91cb('0x1c')](_0x14882d);_0x4f66f[_0x91cb('0x1b')](0x0);return;}})[_0x91cb('0x23')](function(){if(_0x14cad8[_0x91cb('0x89')]==='web'){return null;}var _0x4bf7c7=_[_0x91cb('0x3c')](_0x14cad8,{'name':_0x14cad8[_0x91cb('0x8a')]||_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],'basename':_0x11411d,'savename':util[_0x91cb('0x73')](_0x91cb('0x8b'),_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],require(_0x91cb('0x8c'))[_0x91cb('0x8d')](0x4),_0x14cad8[_0x91cb('0x89')]||_0x91cb('0x8e')),'reportId':_0x315518['id'],'reportType':_0x91cb('0x8f')});return db['AnalyticExtractedReport']['create'](_0x4bf7c7,{'raw':!![]});})[_0x91cb('0x23')](function(_0x48a910){if(_0x315518[_0x91cb('0x6e')]===_0x91cb('0x90')){_0x32d426[_0x91cb('0x3a')](_0x315518[_0x91cb('0x6e')]+_0x91cb('0x91'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}else{_0x32d426[_0x91cb('0x3a')](_0x315518['table']+_0x91cb('0x94'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}if(_0x48a910){logger[_0x91cb('0x95')](_0x91cb('0x96'),_0x32d426['toString']());require(_0x91cb('0x97'))[_0x91cb('0x98')](path[_0x91cb('0x50')](__dirname,_0x91cb('0x99'),_0x48a910[_0x91cb('0x89')]),[_0x48a910['id'],_0x32d426['toString'](),path[_0x91cb('0x50')](__dirname,_0x91cb('0x9a'),_0x48a910[_0x91cb('0x9b')]),_0x11411d]);return _0x48a910;}else{var _0x22b6d3=squel[_0x91cb('0x6c')]();_0x22b6d3[_0x91cb('0x6d')]('('+_0x32d426[_0x91cb('0x80')]()+')',_0x91cb('0x9c'));_0x22b6d3[_0x91cb('0x64')](_0x91cb('0x9d'),_0x91cb('0x1e'));_0x32d426[_0x91cb('0x1c')](_0x14cad8[_0x91cb('0x1c')]||_0x14882d);_0x32d426[_0x91cb('0x1b')](_0x14cad8[_0x91cb('0x1b')]||0x0);return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x22b6d3[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]})[_0x91cb('0x23')](function(_0x275c80){if(!_0x275c80[_0x91cb('0x36')]){_0xe4d946=0x0;}else{_0xe4d946=_0x275c80[0x0][_0x91cb('0x1e')]||0x0;}return dbH[_0x91cb('0x7f')]['query'](_0x32d426[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});})[_0x91cb('0x23')](function(_0x5ca377){return{'rows':_0x5ca377||[],'count':_0xe4d946};});}});}exports['run']=function(_0x552490,_0x5174ac){return runReport(_0x552490['params'],_0x552490[_0x91cb('0x31')],_0x552490[_0x91cb('0x3e')])[_0x91cb('0x23')](respondWithResult(_0x5174ac,null))[_0x91cb('0x45')](handleError(_0x5174ac,null));};exports[_0x91cb('0x9e')]=runReport;exports[_0x91cb('0x31')]=function(_0x3462c5,_0x146346){var _0xe3d97f=0xa;var _0x3b93c3=['join',_0x91cb('0x9f'),_0x91cb('0x51'),'cross_join'];var _0x154e6a={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x2a05af={'SEC_TO_TIME':_0x91cb('0xa0'),'DATE':_0x91cb('0x5a'),'HOUR':_0x91cb('0x85'),'ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34c1f2=function(_0x4d82b4){return!_[_0x91cb('0x5d')]([_0x91cb('0xa1'),_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d82b4);};var _0x432099=function(_0x344c95){if(!_0x344c95||!_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x570cf0='(',_0xb3a6c4=0x0;_0xb3a6c4<_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')];_0xb3a6c4+=0x1){_0xb3a6c4>0x0&&(_0x570cf0+='\x20'+_0x344c95[_0x91cb('0x62')]+'\x20');_0x570cf0+=_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]?_0x432099(_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]):_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x64')]+'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x65')]+(_0x34c1f2(_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['condition'])?'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['value']:'');}return _0x570cf0+')';};var _0x39ba62={'where':{'id':_0x3462c5[_0x91cb('0x43')]['id']}},_0x2ab5a3,_0x10a9f6,_0x43ad75,_0x1382ba,_0x12da14;_0x39ba62=_[_0x91cb('0x3c')]({},_0x39ba62,_0x3462c5['options']);return db[_0x91cb('0x2b')]['find'](_0x39ba62)[_0x91cb('0x23')](function(_0x2f7387){if(_0x2f7387){_0x2ab5a3=_0x2f7387;return _0x2f7387[_0x91cb('0x66')]();}return null;})['then'](function(_0x1f2ef8){if(_0x1f2ef8){if(!_0x1f2ef8[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10a9f6=_0x1f2ef8;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x3ac830){if(_0x3ac830){_0x43ad75=_['keyBy'](_0x3ac830,'id');var _0x469e62;var _0x1e9441=squel[_0x91cb('0x6c')]();_0x1e9441[_0x91cb('0x6d')](_0x2ab5a3[_0x91cb('0x6e')]);for(var _0x416390=0x0;_0x416390<_0x10a9f6[_0x91cb('0x36')];_0x416390+=0x1){_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x6f')]?_0x43ad75[_0x10a9f6[_0x416390]['MetricId']][_0x91cb('0x70')]:_0x10a9f6[_0x416390][_0x91cb('0x64')];_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x154e6a[_0x10a9f6[_0x416390]['function']],'%s',_0x469e62):_0x469e62;_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x73')]?_['replace'](_0x2a05af[_0x10a9f6[_0x416390][_0x91cb('0x73')]],'%s',_0x469e62):_0x469e62;if(_0x10a9f6[_0x416390][_0x91cb('0x87')]){_0x1e9441[_0x91cb('0x63')](_0x469e62);}_0x10a9f6[_0x416390][_0x91cb('0x74')]&&_0x1e9441[_0x91cb('0x75')](_0x469e62,_0x10a9f6[_0x416390]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x1e9441['field'](_0x469e62,_0x10a9f6[_0x416390]['alias']||_0x469e62);}if(_0x2ab5a3[_0x91cb('0x77')]){_0x2ab5a3[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x77')]);for(var _0x286ed7=0x0;_0x286ed7<_0x2ab5a3[_0x91cb('0x77')][_0x91cb('0x36')];_0x286ed7+=0x1){if(_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['type']&&_[_0x91cb('0x5d')](_0x3b93c3,_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x2e')])&&_0x2ab5a3['joins'][_0x286ed7]['parentKey']&&_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x7a')]&&_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x79')]){_0x1e9441[_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x2e')]](_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],null,util[_0x91cb('0x73')]('%s.%s\x20=\x20%s.%s',_0x2ab5a3[_0x91cb('0x6e')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x78')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['foreignKey']));}}}if(_0x2ab5a3[_0x91cb('0x7c')]){_0x2ab5a3[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x7c')]);_0x1e9441[_0x91cb('0x3a')](_0x432099(_0x2ab5a3['conditions'][_0x91cb('0x63')]));}_0x12da14=_0x1e9441[_0x91cb('0xa2')]();_0x1e9441[_0x91cb('0x1c')](_0xe3d97f);_0x1e9441[_0x91cb('0x1b')](0x0);logger[_0x91cb('0xa3')](_0x91cb('0x7e'),_0x1e9441['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x1e9441[_0x91cb('0x80')](),{'type':dbH['sequelize'][_0x91cb('0x81')]['SELECT']});}})[_0x91cb('0x23')](function(){return{'sql':_0x12da14[_0x91cb('0x80')]()};})[_0x91cb('0x23')](respondWithResult(_0x146346,null))[_0x91cb('0x45')](handleError(_0x146346,null));};
\ No newline at end of file
+var _0x4975=['set','Content-Range','save','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','index','AnalyticDefaultReport','rawAttributes','type','key','map','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','body','role','user','Reports','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','SUM(%s)','COUNT(%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','joins','includes','parentKey','foreignKey','foreignTable','conditions','parse','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','HOUR(%s)','operator','Please\x20insert\x20at\x20least\x20one\x20field','alias','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','toString','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','cross_join','getFields','replace','clone','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x5aca66,_0x46b000){var _0x54a64d=function(_0x54045c){while(--_0x54045c){_0x5aca66['push'](_0x5aca66['shift']());}};_0x54a64d(++_0x46b000);}(_0x4975,0x86));var _0x5497=function(_0x43e17c,_0x14fac8){_0x43e17c=_0x43e17c-0x0;var _0xdc9229=_0x4975[_0x43e17c];return _0xdc9229;};'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
index e31de23..c22799a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2bb=['AnalyticDefaultReport','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define'];(function(_0xfefdb1,_0xc4308e){var _0x928ad0=function(_0x2f3a29){while(--_0x2f3a29){_0xfefdb1['push'](_0xfefdb1['shift']());}};_0x928ad0(++_0xc4308e);}(_0xd2bb,0x146));var _0xbd2b=function(_0x3fa0c4,_0xcfcd1e){_0x3fa0c4=_0x3fa0c4-0x0;var _0x3e0df2=_0xd2bb[_0x3fa0c4];return _0x3e0df2;};'use strict';var _=require(_0xbd2b('0x0'));var util=require(_0xbd2b('0x1'));var logger=require(_0xbd2b('0x2'))('api');var moment=require(_0xbd2b('0x3'));var BPromise=require(_0xbd2b('0x4'));var rp=require(_0xbd2b('0x5'));var fs=require('fs');var path=require(_0xbd2b('0x6'));var rimraf=require(_0xbd2b('0x7'));var config=require(_0xbd2b('0x8'));var attributes=require(_0xbd2b('0x9'));module[_0xbd2b('0xa')]=function(_0x3ff2f1,_0x6b2209){return _0x3ff2f1[_0xbd2b('0xb')](_0xbd2b('0xc'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcecf=['analytics_default_reports','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport'];(function(_0x192a5b,_0x3640a8){var _0x15fdd5=function(_0x5ecc30){while(--_0x5ecc30){_0x192a5b['push'](_0x192a5b['shift']());}};_0x15fdd5(++_0x3640a8);}(_0xcecf,0xeb));var _0xfcec=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xcecf[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xfcec('0x0'));var util=require(_0xfcec('0x1'));var logger=require('../../config/logger')(_0xfcec('0x2'));var moment=require(_0xfcec('0x3'));var BPromise=require(_0xfcec('0x4'));var rp=require(_0xfcec('0x5'));var fs=require('fs');var path=require(_0xfcec('0x6'));var rimraf=require(_0xfcec('0x7'));var config=require(_0xfcec('0x8'));var attributes=require(_0xfcec('0x9'));module['exports']=function(_0xa426ed,_0x7cd8db){return _0xa426ed[_0xfcec('0xa')](_0xfcec('0xb'),attributes,{'tableName':_0xfcec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7bbb760..8d29975 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7db=['AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xe7db,0x156));var _0xbe7d=function(_0x1ac6ec,_0x1f81fc){_0x1ac6ec=_0x1ac6ec-0x0;var _0x48a489=_0xe7db[_0x1ac6ec];return _0x48a489;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbe7d('0x0'));var BPromise=require(_0xbe7d('0x1'));var rs=require(_0xbe7d('0x2'));var fs=require('fs');var Redis=require(_0xbe7d('0x3'));var db=require(_0xbe7d('0x4'))['db'];var utils=require(_0xbe7d('0x5'));var logger=require(_0xbe7d('0x6'))(_0xbe7d('0x7'));var config=require(_0xbe7d('0x8'));var jayson=require(_0xbe7d('0x9'));var client=jayson[_0xbe7d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x130751,_0xa7f2fe,_0x226b0f){return new BPromise(function(_0x557d0f,_0x21a5c0){return client[_0xbe7d('0xb')](_0x130751,_0x226b0f)['then'](function(_0x43e4cb){logger['info'](_0xbe7d('0xc'),_0xa7f2fe,_0xbe7d('0xd'));logger[_0xbe7d('0xe')](_0xbe7d('0xf'),_0xa7f2fe,_0xbe7d('0xd'),JSON[_0xbe7d('0x10')](_0x43e4cb));if(_0x43e4cb[_0xbe7d('0x11')]){if(_0x43e4cb['error']['code']===0x1f4){logger[_0xbe7d('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xa7f2fe,_0x43e4cb['error'][_0xbe7d('0x12')]);return _0x21a5c0(_0x43e4cb[_0xbe7d('0x11')]['message']);}logger['error'](_0xbe7d('0xc'),_0xa7f2fe,_0x43e4cb[_0xbe7d('0x11')][_0xbe7d('0x12')]);return _0x557d0f(_0x43e4cb[_0xbe7d('0x11')]['message']);}else{logger[_0xbe7d('0x13')](_0xbe7d('0xc'),_0xa7f2fe,_0xbe7d('0xd'));_0x557d0f(_0x43e4cb[_0xbe7d('0x14')][_0xbe7d('0x12')]);}})['catch'](function(_0x354376){logger[_0xbe7d('0x11')](_0xbe7d('0xc'),_0xa7f2fe,_0x354376);_0x21a5c0(_0x354376);});});}
\ No newline at end of file
+var _0x79e8=['rpc','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0xfa1e02,_0x3dad97){var _0x2f71af=function(_0x359a28){while(--_0x359a28){_0xfa1e02['push'](_0xfa1e02['shift']());}};_0x2f71af(++_0x3dad97);}(_0x79e8,0x1dd));var _0x879e=function(_0x43d702,_0x26b620){_0x43d702=_0x43d702-0x0;var _0x2e5709=_0x79e8[_0x43d702];return _0x2e5709;};'use strict';var _=require(_0x879e('0x0'));var util=require(_0x879e('0x1'));var moment=require(_0x879e('0x2'));var BPromise=require(_0x879e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x879e('0x4'))['db'];var utils=require(_0x879e('0x5'));var logger=require('../../config/logger')(_0x879e('0x6'));var config=require('../../config/environment');var jayson=require(_0x879e('0x7'));var client=jayson[_0x879e('0x8')][_0x879e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e651d,_0x265627,_0x580e89){return new BPromise(function(_0x258dd1,_0x5c81ef){return client[_0x879e('0xa')](_0x4e651d,_0x580e89)[_0x879e('0xb')](function(_0x7ca991){logger[_0x879e('0xc')](_0x879e('0xd'),_0x265627,_0x879e('0xe'));logger[_0x879e('0xf')](_0x879e('0x10'),_0x265627,'request\x20sent',JSON[_0x879e('0x11')](_0x7ca991));if(_0x7ca991[_0x879e('0x12')]){if(_0x7ca991['error'][_0x879e('0x13')]===0x1f4){logger[_0x879e('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x265627,_0x7ca991[_0x879e('0x12')][_0x879e('0x14')]);return _0x5c81ef(_0x7ca991['error'][_0x879e('0x14')]);}logger[_0x879e('0x12')](_0x879e('0xd'),_0x265627,_0x7ca991[_0x879e('0x12')][_0x879e('0x14')]);return _0x258dd1(_0x7ca991['error'][_0x879e('0x14')]);}else{logger[_0x879e('0xc')](_0x879e('0xd'),_0x265627,'request\x20sent');_0x258dd1(_0x7ca991[_0x879e('0x15')]['message']);}})[_0x879e('0x16')](function(_0x2a941d){logger[_0x879e('0x12')](_0x879e('0xd'),_0x265627,_0x2a941d);_0x5c81ef(_0x2a941d);});});}
\ No newline at end of file
index 298eb1a..1823b7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e82=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/preview','preview','/:id/query','post','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3428b3,_0x4396cc){var _0x4474ad=function(_0x5df2bc){while(--_0x5df2bc){_0x3428b3['push'](_0x3428b3['shift']());}};_0x4474ad(++_0x4396cc);}(_0x6e82,0x1c6));var _0x26e8=function(_0x27221f,_0x3f0125){_0x27221f=_0x27221f-0x0;var _0x1946d4=_0x6e82[_0x27221f];return _0x1946d4;};'use strict';var multer=require(_0x26e8('0x0'));var util=require(_0x26e8('0x1'));var path=require(_0x26e8('0x2'));var timeout=require(_0x26e8('0x3'));var express=require(_0x26e8('0x4'));var router=express[_0x26e8('0x5')]();var fs_extra=require(_0x26e8('0x6'));var auth=require(_0x26e8('0x7'));var interaction=require(_0x26e8('0x8'));var config=require(_0x26e8('0x9'));var controller=require('./analyticDefaultReport.controller');router[_0x26e8('0xa')]('/',auth[_0x26e8('0xb')](),controller[_0x26e8('0xc')]);router[_0x26e8('0xa')]('/:id',auth[_0x26e8('0xb')](),controller[_0x26e8('0xd')]);router[_0x26e8('0xa')](_0x26e8('0xe'),auth['isAuthenticated'](),controller[_0x26e8('0xf')]);router[_0x26e8('0xa')]('/:id/run',auth['isAuthenticated'](),controller['run']);router[_0x26e8('0xa')](_0x26e8('0x10'),auth[_0x26e8('0xb')](),controller['query']);router[_0x26e8('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x26e8('0x12')](_0x26e8('0x13'),auth['isAuthenticated'](),controller[_0x26e8('0x14')]);router['delete'](_0x26e8('0x13'),auth[_0x26e8('0xb')](),controller[_0x26e8('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x2b07=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','update','delete','destroy','multer'];(function(_0x6c3725,_0x2cfa35){var _0x37f89d=function(_0x3a661e){while(--_0x3a661e){_0x6c3725['push'](_0x6c3725['shift']());}};_0x37f89d(++_0x2cfa35);}(_0x2b07,0x7c));var _0x72b0=function(_0x2e914,_0x1c7566){_0x2e914=_0x2e914-0x0;var _0x936e45=_0x2b07[_0x2e914];return _0x936e45;};'use strict';var multer=require(_0x72b0('0x0'));var util=require(_0x72b0('0x1'));var path=require('path');var timeout=require(_0x72b0('0x2'));var express=require('express');var router=express[_0x72b0('0x3')]();var fs_extra=require(_0x72b0('0x4'));var auth=require(_0x72b0('0x5'));var interaction=require(_0x72b0('0x6'));var config=require(_0x72b0('0x7'));var controller=require(_0x72b0('0x8'));router[_0x72b0('0x9')]('/',auth[_0x72b0('0xa')](),controller[_0x72b0('0xb')]);router[_0x72b0('0x9')](_0x72b0('0xc'),auth[_0x72b0('0xa')](),controller[_0x72b0('0xd')]);router[_0x72b0('0x9')](_0x72b0('0xe'),auth['isAuthenticated'](),controller[_0x72b0('0xf')]);router[_0x72b0('0x9')](_0x72b0('0x10'),auth[_0x72b0('0xa')](),controller[_0x72b0('0x11')]);router[_0x72b0('0x9')](_0x72b0('0x12'),auth['isAuthenticated'](),controller[_0x72b0('0x13')]);router[_0x72b0('0x14')]('/',auth[_0x72b0('0xa')](),controller['create']);router[_0x72b0('0x15')](_0x72b0('0xc'),auth['isAuthenticated'](),controller[_0x72b0('0x16')]);router[_0x72b0('0x17')](_0x72b0('0xc'),auth[_0x72b0('0xa')](),controller[_0x72b0('0x18')]);module['exports']=router;
\ No newline at end of file
index 1e6da4f..5f9228c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bd0=['csv','pdf','xlsx','DATE','Loading','manual','scheduled','INTEGER','sequelize','moment','exports','STRING','ENUM'];(function(_0x341145,_0x43b1a0){var _0x4ae522=function(_0x7dd16b){while(--_0x7dd16b){_0x341145['push'](_0x341145['shift']());}};_0x4ae522(++_0x43b1a0);}(_0x1bd0,0x14d));var _0x01bd=function(_0x2353b8,_0x5704fa){_0x2353b8=_0x2353b8-0x0;var _0x2147cd=_0x1bd0[_0x2353b8];return _0x2147cd;};'use strict';var Sequelize=require(_0x01bd('0x0'));var moment=require(_0x01bd('0x1'));module[_0x01bd('0x2')]={'name':{'type':Sequelize[_0x01bd('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x01bd('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x01bd('0x4')](_0x01bd('0x5'),_0x01bd('0x6'),_0x01bd('0x7')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x01bd('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x01bd('0x8')]},'endDate':{'type':Sequelize[_0x01bd('0x8')]},'status':{'type':Sequelize[_0x01bd('0x3')],'defaultValue':_0x01bd('0x9')},'type':{'type':Sequelize[_0x01bd('0x4')](_0x01bd('0xa'),_0x01bd('0xb')),'allowNull':![],'defaultValue':_0x01bd('0xa')},'reportId':{'type':Sequelize[_0x01bd('0xc')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x01bd('0x3')]}};
\ No newline at end of file
+var _0xbe1f=['exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','scheduled','manual','INTEGER','moment'];(function(_0x5ca5f0,_0x271351){var _0x124306=function(_0x282526){while(--_0x282526){_0x5ca5f0['push'](_0x5ca5f0['shift']());}};_0x124306(++_0x271351);}(_0xbe1f,0x17f));var _0xfbe1=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xbe1f[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xfbe1('0x0'));module[_0xfbe1('0x1')]={'name':{'type':Sequelize[_0xfbe1('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xfbe1('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xfbe1('0x3')](_0xfbe1('0x4'),_0xfbe1('0x5'),_0xfbe1('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xfbe1('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xfbe1('0x7')]},'endDate':{'type':Sequelize[_0xfbe1('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0xfbe1('0x8')},'type':{'type':Sequelize[_0xfbe1('0x3')]('manual',_0xfbe1('0x9')),'allowNull':![],'defaultValue':_0xfbe1('0xa')},'reportId':{'type':Sequelize[_0xfbe1('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xfbe1('0x2')]}};
\ No newline at end of file
index 9fd4b1b..dfb1841 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56f7=['includeAll','include','findAll','rows','catch','show','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','existsSync','join','root','server/files/reports','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','json','offset','limit','undefined','count','status','set','apply','reject','update','then','get','ExtractedReports','UserProfileResource','destroy','error','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','AnalyticExtractedReport'];(function(_0x118f83,_0x31f530){var _0x2d5e54=function(_0x43b8be){while(--_0x43b8be){_0x118f83['push'](_0x118f83['shift']());}};_0x2d5e54(++_0x31f530);}(_0x56f7,0x1e1));var _0x756f=function(_0x41e5d7,_0x373699){_0x41e5d7=_0x41e5d7-0x0;var _0x3a3d01=_0x56f7[_0x41e5d7];return _0x3a3d01;};'use strict';var emlformat=require(_0x756f('0x0'));var rimraf=require(_0x756f('0x1'));var zipdir=require(_0x756f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x756f('0x3'));var moment=require('moment');var BPromise=require(_0x756f('0x4'));var Mustache=require(_0x756f('0x5'));var util=require(_0x756f('0x6'));var path=require(_0x756f('0x7'));var sox=require(_0x756f('0x8'));var csv=require(_0x756f('0x9'));var ejs=require(_0x756f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x756f('0xb'));var squel=require('squel');var crypto=require(_0x756f('0xc'));var jsforce=require(_0x756f('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x756f('0xe'));var Papa=require(_0x756f('0xf'));var Redis=require(_0x756f('0x10'));var authService=require(_0x756f('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x756f('0x12'))(_0x756f('0x13'));var utils=require('../../config/utils');var config=require(_0x756f('0x14'));var licenseUtil=require(_0x756f('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58805f,_0x3f0c20){_0x3f0c20=_0x3f0c20||0xcc;return function(_0xd3457d){if(_0xd3457d){return _0x58805f[_0x756f('0x16')](_0x3f0c20);}return _0x58805f['status'](_0x3f0c20)[_0x756f('0x17')]();};}function respondWithResult(_0x4bc0b2,_0x4abc38){_0x4abc38=_0x4abc38||0xc8;return function(_0x1e1c46){if(_0x1e1c46){return _0x4bc0b2['status'](_0x4abc38)[_0x756f('0x18')](_0x1e1c46);}};}function respondWithFilteredResult(_0x9cc6bd,_0x311431){return function(_0x46fdd2){if(_0x46fdd2){var _0x2e47e8=typeof _0x311431[_0x756f('0x19')]==='undefined'&&typeof _0x311431[_0x756f('0x1a')]===_0x756f('0x1b');var _0x12cfc5=_0x46fdd2[_0x756f('0x1c')];var _0x3103cd=_0x2e47e8?0x0:_0x311431['offset'];var _0x28325c=_0x2e47e8?_0x46fdd2[_0x756f('0x1c')]:_0x311431[_0x756f('0x19')]+_0x311431[_0x756f('0x1a')];var _0x5eb028;if(_0x28325c>=_0x12cfc5){_0x28325c=_0x12cfc5;_0x5eb028=0xc8;}else{_0x5eb028=0xce;}_0x9cc6bd[_0x756f('0x1d')](_0x5eb028);return _0x9cc6bd[_0x756f('0x1e')]('Content-Range',_0x3103cd+'-'+_0x28325c+'/'+_0x12cfc5)[_0x756f('0x18')](_0x46fdd2);}return null;};}function patchUpdates(_0x92b203){return function(_0x4d4ae8){try{jsonpatch[_0x756f('0x1f')](_0x4d4ae8,_0x92b203,!![]);}catch(_0x8faff6){return BPromise[_0x756f('0x20')](_0x8faff6);}return _0x4d4ae8['save']();};}function saveUpdates(_0x3e88b6,_0x49d715){return function(_0x6fe1b8){if(_0x6fe1b8){return _0x6fe1b8[_0x756f('0x21')](_0x3e88b6)['then'](function(_0x4773e6){return _0x4773e6;});}return null;};}function removeEntity(_0x3f3934,_0xd97cee){return function(_0x3147c2){if(_0x3147c2){return _0x3147c2['destroy']()[_0x756f('0x22')](function(){var _0x49aa9b=_0x3147c2[_0x756f('0x23')]({'plain':!![]});var _0x837d5=_0x756f('0x24');return db[_0x756f('0x25')][_0x756f('0x26')]({'where':{'type':_0x837d5,'resourceId':_0x49aa9b['id']}})[_0x756f('0x22')](function(){return _0x3147c2;});})[_0x756f('0x22')](function(){_0x3f3934[_0x756f('0x1d')](0xcc)[_0x756f('0x17')]();});}};}function handleEntityNotFound(_0x3f011c,_0x302fc8){return function(_0x1ea7c1){if(!_0x1ea7c1){_0x3f011c[_0x756f('0x16')](0x194);}return _0x1ea7c1;};}function handleError(_0x35828a,_0x11b65b){_0x11b65b=_0x11b65b||0x1f4;return function(_0x16a2cf){logger[_0x756f('0x27')](_0x16a2cf['stack']);if(_0x16a2cf[_0x756f('0x28')]){delete _0x16a2cf['name'];}_0x35828a[_0x756f('0x1d')](_0x11b65b)[_0x756f('0x29')](_0x16a2cf);};}exports[_0x756f('0x2a')]=function(_0x533d0a,_0x318bd8){var _0x531eb7={},_0x146b2c={},_0xf5ad37={'count':0x0,'rows':[]};var _0x29834=_[_0x756f('0x2b')](db['AnalyticExtractedReport'][_0x756f('0x2c')],function(_0x3e78f3){return{'name':_0x3e78f3['fieldName'],'type':_0x3e78f3['type'][_0x756f('0x2d')]};});_0x146b2c[_0x756f('0x2e')]=_[_0x756f('0x2b')](_0x29834,_0x756f('0x28'));_0x146b2c[_0x756f('0x2f')]=_[_0x756f('0x30')](_0x533d0a['query']);_0x146b2c[_0x756f('0x31')]=_[_0x756f('0x32')](_0x146b2c[_0x756f('0x2e')],_0x146b2c[_0x756f('0x2f')]);_0x531eb7['attributes']=_[_0x756f('0x32')](_0x146b2c[_0x756f('0x2e')],qs[_0x756f('0x33')](_0x533d0a[_0x756f('0x2f')]['fields']));_0x531eb7[_0x756f('0x34')]=_0x531eb7[_0x756f('0x34')][_0x756f('0x35')]?_0x531eb7[_0x756f('0x34')]:_0x146b2c[_0x756f('0x2e')];if(!_0x533d0a[_0x756f('0x2f')][_0x756f('0x36')](_0x756f('0x37'))){_0x531eb7['limit']=qs[_0x756f('0x1a')](_0x533d0a['query'][_0x756f('0x1a')]);_0x531eb7['offset']=qs[_0x756f('0x19')](_0x533d0a[_0x756f('0x2f')][_0x756f('0x19')]);}_0x531eb7[_0x756f('0x38')]=qs['sort'](_0x533d0a[_0x756f('0x2f')][_0x756f('0x39')]);_0x531eb7[_0x756f('0x3a')]=qs['filters'](_[_0x756f('0x3b')](_0x533d0a['query'],_0x146b2c[_0x756f('0x31')]),_0x29834);if(_0x533d0a[_0x756f('0x2f')][_0x756f('0x3c')]){_0x531eb7['where']=_[_0x756f('0x3d')](_0x531eb7['where'],{'$or':_[_0x756f('0x2b')](_0x29834,function(_0x1da649){if(_0x1da649[_0x756f('0x3e')]!=='VIRTUAL'){var _0x4d1d55={};_0x4d1d55[_0x1da649[_0x756f('0x28')]]={'$like':'%'+_0x533d0a[_0x756f('0x2f')]['filter']+'%'};return _0x4d1d55;}})});}_0x531eb7=_[_0x756f('0x3d')]({},_0x531eb7,_0x533d0a[_0x756f('0x3f')]);var _0x11a387={'where':_0x531eb7[_0x756f('0x3a')]};return db[_0x756f('0x40')][_0x756f('0x1c')](_0x11a387)['then'](function(_0x37cbe3){_0xf5ad37[_0x756f('0x1c')]=_0x37cbe3;if(_0x533d0a[_0x756f('0x2f')][_0x756f('0x41')]){_0x531eb7[_0x756f('0x42')]=[{'all':!![]}];}return db[_0x756f('0x40')][_0x756f('0x43')](_0x531eb7);})[_0x756f('0x22')](function(_0x47253b){_0xf5ad37[_0x756f('0x44')]=_0x47253b;return _0xf5ad37;})['then'](respondWithFilteredResult(_0x318bd8,_0x531eb7))[_0x756f('0x45')](handleError(_0x318bd8,null));};exports[_0x756f('0x46')]=function(_0x1c8eb6,_0x5ca733){var _0x20fdd9={'raw':!![],'where':{'id':_0x1c8eb6['params']['id']}},_0x2c2438={};_0x2c2438[_0x756f('0x2e')]=_['keys'](db['AnalyticExtractedReport'][_0x756f('0x2c')]);_0x2c2438[_0x756f('0x2f')]=_[_0x756f('0x30')](_0x1c8eb6[_0x756f('0x2f')]);_0x2c2438[_0x756f('0x31')]=_[_0x756f('0x32')](_0x2c2438['model'],_0x2c2438['query']);_0x20fdd9['attributes']=_[_0x756f('0x32')](_0x2c2438[_0x756f('0x2e')],qs[_0x756f('0x33')](_0x1c8eb6[_0x756f('0x2f')][_0x756f('0x33')]));_0x20fdd9[_0x756f('0x34')]=_0x20fdd9[_0x756f('0x34')][_0x756f('0x35')]?_0x20fdd9['attributes']:_0x2c2438[_0x756f('0x2e')];if(_0x1c8eb6['query'][_0x756f('0x41')]){_0x20fdd9[_0x756f('0x42')]=[{'all':!![]}];}_0x20fdd9=_[_0x756f('0x3d')]({},_0x20fdd9,_0x1c8eb6[_0x756f('0x3f')]);return db[_0x756f('0x40')]['find'](_0x20fdd9)['then'](handleEntityNotFound(_0x5ca733,null))[_0x756f('0x22')](respondWithResult(_0x5ca733,null))[_0x756f('0x45')](handleError(_0x5ca733,null));};exports['create']=function(_0x27cfca,_0x55d779){return db['AnalyticExtractedReport']['create'](_0x27cfca[_0x756f('0x47')],{})['then'](function(_0x2bafe7){var _0x5a0951=_0x27cfca[_0x756f('0x48')][_0x756f('0x23')]({'plain':!![]});if(!_0x5a0951)throw new Error(_0x756f('0x49'));if(_0x5a0951[_0x756f('0x4a')]===_0x756f('0x48')){var _0x1bc475=_0x2bafe7[_0x756f('0x23')]({'plain':!![]});var _0x7cd9fe=_0x756f('0x24');return db['UserProfileSection'][_0x756f('0x4b')]({'where':{'name':_0x7cd9fe,'userProfileId':_0x5a0951['userProfileId']},'raw':!![]})[_0x756f('0x22')](function(_0x2ef36b){if(_0x2ef36b&&_0x2ef36b[_0x756f('0x4c')]===0x0){return db[_0x756f('0x25')]['create']({'name':_0x1bc475[_0x756f('0x28')],'resourceId':_0x1bc475['id'],'type':_0x2ef36b[_0x756f('0x28')],'sectionId':_0x2ef36b['id']},{})[_0x756f('0x22')](function(){return _0x2bafe7;});}else{return _0x2bafe7;}})[_0x756f('0x45')](function(_0x27ac30){logger[_0x756f('0x27')](_0x756f('0x4d'),_0x27ac30);throw _0x27ac30;});}return _0x2bafe7;})[_0x756f('0x22')](respondWithResult(_0x55d779,0xc9))['catch'](handleError(_0x55d779,null));};exports['update']=function(_0x4ec44b,_0x121f60){if(_0x4ec44b[_0x756f('0x47')]['id']){delete _0x4ec44b[_0x756f('0x47')]['id'];}return db['AnalyticExtractedReport'][_0x756f('0x4b')]({'where':{'id':_0x4ec44b['params']['id']}})[_0x756f('0x22')](handleEntityNotFound(_0x121f60,null))[_0x756f('0x22')](saveUpdates(_0x4ec44b['body'],null))[_0x756f('0x22')](respondWithResult(_0x121f60,null))['catch'](handleError(_0x121f60,null));};exports[_0x756f('0x26')]=function(_0x5a7441,_0x4b5900){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x5a7441['params']['id']}})[_0x756f('0x22')](handleEntityNotFound(_0x4b5900,null))[_0x756f('0x22')](removeEntity(_0x4b5900,null))[_0x756f('0x45')](handleError(_0x4b5900,null));};exports[_0x756f('0x4e')]=function(_0x52276b,_0x5d35a4,_0x41ac0e){return db[_0x756f('0x40')][_0x756f('0x4b')]({'where':{'id':_0x52276b['params']['id']},'attributes':[_0x756f('0x28'),_0x756f('0x4f'),'savename',_0x756f('0x50')],'raw':!![]})[_0x756f('0x22')](handleEntityNotFound(_0x5d35a4,null))[_0x756f('0x22')](function(_0x34cb26){if(_0x34cb26){if(!fs[_0x756f('0x51')](path[_0x756f('0x52')](config[_0x756f('0x53')],_0x756f('0x54'),_0x34cb26[_0x756f('0x55')]))){throw new db['Sequelize'][(_0x756f('0x56'))](_0x756f('0x57'));}if(_0x52276b['query'][_0x756f('0x58')]){return _0x5d35a4['sendStatus'](0xc8);}return _0x5d35a4[_0x756f('0x4e')](path[_0x756f('0x52')](config[_0x756f('0x53')],'server/files/reports',_0x34cb26['savename']),util[_0x756f('0x59')](_0x756f('0x5a'),_0x34cb26[_0x756f('0x4f')]||_0x34cb26[_0x756f('0x28')],_0x34cb26['output']['toLowerCase']()));}})[_0x756f('0x45')](handleError(_0x5d35a4,null));};
\ No newline at end of file
+var _0x890e=['apply','save','destroy','then','get','ExtractedReports','UserProfileResource','error','stack','name','index','map','AnalyticExtractedReport','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','find','download','basename','savename','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','output','toLowerCase','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x890e,0xfe));var _0xe890=function(_0x1fb452,_0x1dfc93){_0x1fb452=_0x1fb452-0x0;var _0x201fb9=_0x890e[_0x1fb452];return _0x201fb9;};'use strict';var emlformat=require(_0xe890('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe890('0x1'));var jsonpatch=require(_0xe890('0x2'));var rp=require('request-promise');var moment=require(_0xe890('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe890('0x4'));var util=require('util');var path=require(_0xe890('0x5'));var sox=require(_0xe890('0x6'));var csv=require('to-csv');var ejs=require(_0xe890('0x7'));var fs=require('fs');var fs_extra=require(_0xe890('0x8'));var _=require(_0xe890('0x9'));var squel=require('squel');var crypto=require(_0xe890('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe890('0xb'));var toCsv=require(_0xe890('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe890('0xd'));var authService=require(_0xe890('0xe'));var qs=require(_0xe890('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe890('0x10'));var logger=require('../../config/logger')(_0xe890('0x11'));var utils=require(_0xe890('0x12'));var config=require(_0xe890('0x13'));var licenseUtil=require(_0xe890('0x14'));var db=require(_0xe890('0x15'))['db'];function respondWithStatusCode(_0x33dfa8,_0x5b70fc){_0x5b70fc=_0x5b70fc||0xcc;return function(_0x25a401){if(_0x25a401){return _0x33dfa8[_0xe890('0x16')](_0x5b70fc);}return _0x33dfa8[_0xe890('0x17')](_0x5b70fc)[_0xe890('0x18')]();};}function respondWithResult(_0x2b00e3,_0x2187e6){_0x2187e6=_0x2187e6||0xc8;return function(_0xa08cd2){if(_0xa08cd2){return _0x2b00e3[_0xe890('0x17')](_0x2187e6)['json'](_0xa08cd2);}};}function respondWithFilteredResult(_0x26ca8b,_0xf33949){return function(_0x4e2054){if(_0x4e2054){var _0x46d654=typeof _0xf33949[_0xe890('0x19')]===_0xe890('0x1a')&&typeof _0xf33949[_0xe890('0x1b')]===_0xe890('0x1a');var _0x101728=_0x4e2054['count'];var _0x2d9d9e=_0x46d654?0x0:_0xf33949[_0xe890('0x19')];var _0x3bd629=_0x46d654?_0x4e2054[_0xe890('0x1c')]:_0xf33949['offset']+_0xf33949[_0xe890('0x1b')];var _0x46d4a6;if(_0x3bd629>=_0x101728){_0x3bd629=_0x101728;_0x46d4a6=0xc8;}else{_0x46d4a6=0xce;}_0x26ca8b[_0xe890('0x17')](_0x46d4a6);return _0x26ca8b[_0xe890('0x1d')](_0xe890('0x1e'),_0x2d9d9e+'-'+_0x3bd629+'/'+_0x101728)['json'](_0x4e2054);}return null;};}function patchUpdates(_0x23781f){return function(_0x599636){try{jsonpatch[_0xe890('0x1f')](_0x599636,_0x23781f,!![]);}catch(_0x35dc2a){return BPromise['reject'](_0x35dc2a);}return _0x599636[_0xe890('0x20')]();};}function saveUpdates(_0x15ff51,_0x435de2){return function(_0x52a46c){if(_0x52a46c){return _0x52a46c['update'](_0x15ff51)['then'](function(_0x581a3d){return _0x581a3d;});}return null;};}function removeEntity(_0x431a97,_0xc3a0bd){return function(_0x5f47a1){if(_0x5f47a1){return _0x5f47a1[_0xe890('0x21')]()[_0xe890('0x22')](function(){var _0x53d419=_0x5f47a1[_0xe890('0x23')]({'plain':!![]});var _0x41eb61=_0xe890('0x24');return db[_0xe890('0x25')][_0xe890('0x21')]({'where':{'type':_0x41eb61,'resourceId':_0x53d419['id']}})[_0xe890('0x22')](function(){return _0x5f47a1;});})[_0xe890('0x22')](function(){_0x431a97[_0xe890('0x17')](0xcc)[_0xe890('0x18')]();});}};}function handleEntityNotFound(_0x557b71,_0x437f5e){return function(_0x4de19b){if(!_0x4de19b){_0x557b71['sendStatus'](0x194);}return _0x4de19b;};}function handleError(_0x37a613,_0x2de0e3){_0x2de0e3=_0x2de0e3||0x1f4;return function(_0x3c3302){logger[_0xe890('0x26')](_0x3c3302[_0xe890('0x27')]);if(_0x3c3302[_0xe890('0x28')]){delete _0x3c3302[_0xe890('0x28')];}_0x37a613[_0xe890('0x17')](_0x2de0e3)['send'](_0x3c3302);};}exports[_0xe890('0x29')]=function(_0x11d222,_0x2a24b9){var _0x48fd91={},_0x365278={},_0x5f0c0c={'count':0x0,'rows':[]};var _0xdf4611=_[_0xe890('0x2a')](db[_0xe890('0x2b')]['rawAttributes'],function(_0x414783){return{'name':_0x414783[_0xe890('0x2c')],'type':_0x414783[_0xe890('0x2d')]['key']};});_0x365278[_0xe890('0x2e')]=_[_0xe890('0x2a')](_0xdf4611,_0xe890('0x28'));_0x365278['query']=_[_0xe890('0x2f')](_0x11d222[_0xe890('0x30')]);_0x365278['filters']=_[_0xe890('0x31')](_0x365278[_0xe890('0x2e')],_0x365278[_0xe890('0x30')]);_0x48fd91[_0xe890('0x32')]=_[_0xe890('0x31')](_0x365278['model'],qs[_0xe890('0x33')](_0x11d222['query'][_0xe890('0x33')]));_0x48fd91['attributes']=_0x48fd91[_0xe890('0x32')][_0xe890('0x34')]?_0x48fd91[_0xe890('0x32')]:_0x365278[_0xe890('0x2e')];if(!_0x11d222[_0xe890('0x30')][_0xe890('0x35')](_0xe890('0x36'))){_0x48fd91[_0xe890('0x1b')]=qs['limit'](_0x11d222[_0xe890('0x30')][_0xe890('0x1b')]);_0x48fd91['offset']=qs['offset'](_0x11d222[_0xe890('0x30')][_0xe890('0x19')]);}_0x48fd91[_0xe890('0x37')]=qs['sort'](_0x11d222[_0xe890('0x30')][_0xe890('0x38')]);_0x48fd91[_0xe890('0x39')]=qs[_0xe890('0x3a')](_['pick'](_0x11d222['query'],_0x365278['filters']),_0xdf4611);if(_0x11d222[_0xe890('0x30')][_0xe890('0x3b')]){_0x48fd91[_0xe890('0x39')]=_[_0xe890('0x3c')](_0x48fd91['where'],{'$or':_[_0xe890('0x2a')](_0xdf4611,function(_0x4d51cc){if(_0x4d51cc[_0xe890('0x2d')]!==_0xe890('0x3d')){var _0x2316e9={};_0x2316e9[_0x4d51cc[_0xe890('0x28')]]={'$like':'%'+_0x11d222['query'][_0xe890('0x3b')]+'%'};return _0x2316e9;}})});}_0x48fd91=_[_0xe890('0x3c')]({},_0x48fd91,_0x11d222[_0xe890('0x3e')]);var _0x2093dc={'where':_0x48fd91[_0xe890('0x39')]};return db[_0xe890('0x2b')][_0xe890('0x1c')](_0x2093dc)[_0xe890('0x22')](function(_0x1cea1c){_0x5f0c0c['count']=_0x1cea1c;if(_0x11d222[_0xe890('0x30')][_0xe890('0x3f')]){_0x48fd91[_0xe890('0x40')]=[{'all':!![]}];}return db[_0xe890('0x2b')][_0xe890('0x41')](_0x48fd91);})[_0xe890('0x22')](function(_0x5171d1){_0x5f0c0c[_0xe890('0x42')]=_0x5171d1;return _0x5f0c0c;})[_0xe890('0x22')](respondWithFilteredResult(_0x2a24b9,_0x48fd91))[_0xe890('0x43')](handleError(_0x2a24b9,null));};exports[_0xe890('0x44')]=function(_0x19ede4,_0x77b46e){var _0x13d8ff={'raw':!![],'where':{'id':_0x19ede4[_0xe890('0x45')]['id']}},_0x37be7e={};_0x37be7e[_0xe890('0x2e')]=_[_0xe890('0x2f')](db[_0xe890('0x2b')]['rawAttributes']);_0x37be7e[_0xe890('0x30')]=_[_0xe890('0x2f')](_0x19ede4[_0xe890('0x30')]);_0x37be7e[_0xe890('0x3a')]=_[_0xe890('0x31')](_0x37be7e[_0xe890('0x2e')],_0x37be7e[_0xe890('0x30')]);_0x13d8ff[_0xe890('0x32')]=_['intersection'](_0x37be7e[_0xe890('0x2e')],qs[_0xe890('0x33')](_0x19ede4[_0xe890('0x30')][_0xe890('0x33')]));_0x13d8ff[_0xe890('0x32')]=_0x13d8ff['attributes'][_0xe890('0x34')]?_0x13d8ff[_0xe890('0x32')]:_0x37be7e[_0xe890('0x2e')];if(_0x19ede4[_0xe890('0x30')]['includeAll']){_0x13d8ff['include']=[{'all':!![]}];}_0x13d8ff=_['merge']({},_0x13d8ff,_0x19ede4[_0xe890('0x3e')]);return db[_0xe890('0x2b')]['find'](_0x13d8ff)[_0xe890('0x22')](handleEntityNotFound(_0x77b46e,null))[_0xe890('0x22')](respondWithResult(_0x77b46e,null))['catch'](handleError(_0x77b46e,null));};exports[_0xe890('0x46')]=function(_0x51d638,_0x10b855){return db[_0xe890('0x2b')][_0xe890('0x46')](_0x51d638['body'],{})[_0xe890('0x22')](function(_0x689366){var _0x329b77=_0x51d638[_0xe890('0x47')]['get']({'plain':!![]});if(!_0x329b77)throw new Error(_0xe890('0x48'));if(_0x329b77[_0xe890('0x49')]===_0xe890('0x47')){var _0x5dfa6c=_0x689366[_0xe890('0x23')]({'plain':!![]});var _0x4a43c6=_0xe890('0x24');return db[_0xe890('0x4a')]['find']({'where':{'name':_0x4a43c6,'userProfileId':_0x329b77['userProfileId']},'raw':!![]})[_0xe890('0x22')](function(_0x1bb682){if(_0x1bb682&&_0x1bb682[_0xe890('0x4b')]===0x0){return db[_0xe890('0x25')][_0xe890('0x46')]({'name':_0x5dfa6c['name'],'resourceId':_0x5dfa6c['id'],'type':_0x1bb682[_0xe890('0x28')],'sectionId':_0x1bb682['id']},{})[_0xe890('0x22')](function(){return _0x689366;});}else{return _0x689366;}})['catch'](function(_0x2faaf7){logger[_0xe890('0x26')](_0xe890('0x4c'),_0x2faaf7);throw _0x2faaf7;});}return _0x689366;})[_0xe890('0x22')](respondWithResult(_0x10b855,0xc9))[_0xe890('0x43')](handleError(_0x10b855,null));};exports[_0xe890('0x4d')]=function(_0x1aade2,_0xb86731){if(_0x1aade2[_0xe890('0x4e')]['id']){delete _0x1aade2[_0xe890('0x4e')]['id'];}return db[_0xe890('0x2b')][_0xe890('0x4f')]({'where':{'id':_0x1aade2[_0xe890('0x45')]['id']}})[_0xe890('0x22')](handleEntityNotFound(_0xb86731,null))['then'](saveUpdates(_0x1aade2[_0xe890('0x4e')],null))[_0xe890('0x22')](respondWithResult(_0xb86731,null))[_0xe890('0x43')](handleError(_0xb86731,null));};exports[_0xe890('0x21')]=function(_0x2a9e4b,_0x4e9e52){return db[_0xe890('0x2b')][_0xe890('0x4f')]({'where':{'id':_0x2a9e4b[_0xe890('0x45')]['id']}})[_0xe890('0x22')](handleEntityNotFound(_0x4e9e52,null))[_0xe890('0x22')](removeEntity(_0x4e9e52,null))[_0xe890('0x43')](handleError(_0x4e9e52,null));};exports[_0xe890('0x50')]=function(_0x43e708,_0x2571ed,_0x17ffcc){return db[_0xe890('0x2b')][_0xe890('0x4f')]({'where':{'id':_0x43e708['params']['id']},'attributes':[_0xe890('0x28'),_0xe890('0x51'),_0xe890('0x52'),'output'],'raw':!![]})[_0xe890('0x22')](handleEntityNotFound(_0x2571ed,null))[_0xe890('0x22')](function(_0xd04d8c){if(_0xd04d8c){if(!fs[_0xe890('0x53')](path[_0xe890('0x54')](config[_0xe890('0x55')],_0xe890('0x56'),_0xd04d8c[_0xe890('0x52')]))){throw new db[(_0xe890('0x57'))][(_0xe890('0x58'))](_0xe890('0x59'));}if(_0x43e708[_0xe890('0x30')][_0xe890('0x5a')]){return _0x2571ed[_0xe890('0x16')](0xc8);}return _0x2571ed['download'](path[_0xe890('0x54')](config[_0xe890('0x55')],_0xe890('0x56'),_0xd04d8c[_0xe890('0x52')]),util[_0xe890('0x5b')](_0xe890('0x5c'),_0xd04d8c['basename']||_0xd04d8c[_0xe890('0x28')],_0xd04d8c[_0xe890('0x5d')][_0xe890('0x5e')]()));}})['catch'](handleError(_0x2571ed,null));};
\ No newline at end of file
index e1882b3..fce57fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2920=['define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0x5e0f1d,_0x5e7e6a){var _0xb801aa=function(_0x2f8cfc){while(--_0x2f8cfc){_0x5e0f1d['push'](_0x5e0f1d['shift']());}};_0xb801aa(++_0x5e7e6a);}(_0x2920,0x12e));var _0x0292=function(_0x34fda6,_0xb63d1e){_0x34fda6=_0x34fda6-0x0;var _0x119320=_0x2920[_0x34fda6];return _0x119320;};'use strict';var _=require(_0x0292('0x0'));var util=require(_0x0292('0x1'));var logger=require(_0x0292('0x2'))(_0x0292('0x3'));var moment=require(_0x0292('0x4'));var BPromise=require('bluebird');var rp=require(_0x0292('0x5'));var fs=require('fs');var path=require(_0x0292('0x6'));var rimraf=require('rimraf');var config=require(_0x0292('0x7'));var attributes=require(_0x0292('0x8'));module[_0x0292('0x9')]=function(_0x18295b,_0x39c3d9){return _0x18295b[_0x0292('0xa')](_0x0292('0xb'),attributes,{'tableName':_0x0292('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3dec=['path','../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x358017,_0x2d7184){var _0x4ca484=function(_0x5a853e){while(--_0x5a853e){_0x358017['push'](_0x358017['shift']());}};_0x4ca484(++_0x2d7184);}(_0x3dec,0xaf));var _0xc3de=function(_0x199b1f,_0x4ed849){_0x199b1f=_0x199b1f-0x0;var _0x267ac9=_0x3dec[_0x199b1f];return _0x267ac9;};'use strict';var _=require(_0xc3de('0x0'));var util=require(_0xc3de('0x1'));var logger=require(_0xc3de('0x2'))(_0xc3de('0x3'));var moment=require(_0xc3de('0x4'));var BPromise=require(_0xc3de('0x5'));var rp=require(_0xc3de('0x6'));var fs=require('fs');var path=require(_0xc3de('0x7'));var rimraf=require('rimraf');var config=require(_0xc3de('0x8'));var attributes=require('./analyticExtractedReport.attributes');module[_0xc3de('0x9')]=function(_0x58ef1e,_0x3f14ef){return _0x58ef1e[_0xc3de('0xa')](_0xc3de('0xb'),attributes,{'tableName':_0xc3de('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4d87b48..1f5c9d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bfa=['util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash'];(function(_0x14d513,_0x9f84a6){var _0x160f64=function(_0x27a899){while(--_0x27a899){_0x14d513['push'](_0x14d513['shift']());}};_0x160f64(++_0x9f84a6);}(_0x6bfa,0x175));var _0xa6bf=function(_0x4b0342,_0x5b071c){_0x4b0342=_0x4b0342-0x0;var _0xc62aa3=_0x6bfa[_0x4b0342];return _0xc62aa3;};'use strict';var _=require(_0xa6bf('0x0'));var util=require(_0xa6bf('0x1'));var moment=require(_0xa6bf('0x2'));var BPromise=require(_0xa6bf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6bf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa6bf('0x5'));var logger=require(_0xa6bf('0x6'))(_0xa6bf('0x7'));var config=require(_0xa6bf('0x8'));var jayson=require(_0xa6bf('0x9'));var client=jayson['client'][_0xa6bf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x226fc1,_0x4eca6b,_0x41cc80){return new BPromise(function(_0x13ce3d,_0x5eb307){return client['request'](_0x226fc1,_0x41cc80)[_0xa6bf('0xb')](function(_0x5c08d0){logger['info'](_0xa6bf('0xc'),_0x4eca6b,_0xa6bf('0xd'));logger[_0xa6bf('0xe')](_0xa6bf('0xf'),_0x4eca6b,_0xa6bf('0xd'),JSON[_0xa6bf('0x10')](_0x5c08d0));if(_0x5c08d0[_0xa6bf('0x11')]){if(_0x5c08d0[_0xa6bf('0x11')]['code']===0x1f4){logger[_0xa6bf('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4eca6b,_0x5c08d0[_0xa6bf('0x11')][_0xa6bf('0x12')]);return _0x5eb307(_0x5c08d0[_0xa6bf('0x11')]['message']);}logger[_0xa6bf('0x11')](_0xa6bf('0xc'),_0x4eca6b,_0x5c08d0['error']['message']);return _0x13ce3d(_0x5c08d0[_0xa6bf('0x11')][_0xa6bf('0x12')]);}else{logger[_0xa6bf('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4eca6b,'request\x20sent');_0x13ce3d(_0x5c08d0[_0xa6bf('0x14')][_0xa6bf('0x12')]);}})[_0xa6bf('0x15')](function(_0x33f45d){logger[_0xa6bf('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4eca6b,_0x33f45d);_0x5eb307(_0x33f45d);});});}
\ No newline at end of file
+var _0x98d2=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticExtractedReport,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2cbc82,_0x30d15a){var _0x222f31=function(_0x51bc14){while(--_0x51bc14){_0x2cbc82['push'](_0x2cbc82['shift']());}};_0x222f31(++_0x30d15a);}(_0x98d2,0xb3));var _0x298d=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x98d2[_0x26b80e];return _0x84a8a8;};'use strict';var _=require(_0x298d('0x0'));var util=require(_0x298d('0x1'));var moment=require(_0x298d('0x2'));var BPromise=require(_0x298d('0x3'));var rs=require(_0x298d('0x4'));var fs=require('fs');var Redis=require(_0x298d('0x5'));var db=require(_0x298d('0x6'))['db'];var utils=require(_0x298d('0x7'));var logger=require(_0x298d('0x8'))('rpc');var config=require(_0x298d('0x9'));var jayson=require(_0x298d('0xa'));var client=jayson['client'][_0x298d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27720a,_0x94eb90,_0x49cff2){return new BPromise(function(_0x2e00cd,_0x4bc06c){return client['request'](_0x27720a,_0x49cff2)[_0x298d('0xc')](function(_0x47f0c9){logger[_0x298d('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x94eb90,_0x298d('0xe'));logger[_0x298d('0xf')](_0x298d('0x10'),_0x94eb90,_0x298d('0xe'),JSON[_0x298d('0x11')](_0x47f0c9));if(_0x47f0c9[_0x298d('0x12')]){if(_0x47f0c9[_0x298d('0x12')][_0x298d('0x13')]===0x1f4){logger[_0x298d('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x94eb90,_0x47f0c9[_0x298d('0x12')]['message']);return _0x4bc06c(_0x47f0c9['error'][_0x298d('0x14')]);}logger[_0x298d('0x12')](_0x298d('0x15'),_0x94eb90,_0x47f0c9[_0x298d('0x12')][_0x298d('0x14')]);return _0x2e00cd(_0x47f0c9[_0x298d('0x12')]['message']);}else{logger['info'](_0x298d('0x15'),_0x94eb90,'request\x20sent');_0x2e00cd(_0x47f0c9['result'][_0x298d('0x14')]);}})[_0x298d('0x16')](function(_0x52fb00){logger[_0x298d('0x12')](_0x298d('0x15'),_0x94eb90,_0x52fb00);_0x4bc06c(_0x52fb00);});});}
\ No newline at end of file
index 68c3389..2ba2d5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec07=['isAuthenticated','show','/:id/download','post','create','put','update','delete','destroy','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','index','get','/:id'];(function(_0x18bf17,_0x32626e){var _0x7c4e02=function(_0x4afbbe){while(--_0x4afbbe){_0x18bf17['push'](_0x18bf17['shift']());}};_0x7c4e02(++_0x32626e);}(_0xec07,0xfa));var _0x7ec0=function(_0x5431f0,_0x35b145){_0x5431f0=_0x5431f0-0x0;var _0x16b8b2=_0xec07[_0x5431f0];return _0x16b8b2;};'use strict';var multer=require(_0x7ec0('0x0'));var util=require('util');var path=require(_0x7ec0('0x1'));var timeout=require('connect-timeout');var express=require(_0x7ec0('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7ec0('0x3'));var interaction=require(_0x7ec0('0x4'));var config=require(_0x7ec0('0x5'));var controller=require(_0x7ec0('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7ec0('0x7')]);router[_0x7ec0('0x8')](_0x7ec0('0x9'),auth[_0x7ec0('0xa')](),controller[_0x7ec0('0xb')]);router['get'](_0x7ec0('0xc'),auth['isAuthenticated'](),controller['download']);router[_0x7ec0('0xd')]('/',auth[_0x7ec0('0xa')](),controller[_0x7ec0('0xe')]);router[_0x7ec0('0xf')](_0x7ec0('0x9'),auth[_0x7ec0('0xa')](),controller[_0x7ec0('0x10')]);router[_0x7ec0('0x11')]('/:id',auth[_0x7ec0('0xa')](),controller[_0x7ec0('0x12')]);module[_0x7ec0('0x13')]=router;
\ No newline at end of file
+var _0xdd06=['path','express','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','get','/:id','show','download','post','create','put','update','delete'];(function(_0x5749eb,_0x2e8fa7){var _0x429528=function(_0x59e5e5){while(--_0x59e5e5){_0x5749eb['push'](_0x5749eb['shift']());}};_0x429528(++_0x2e8fa7);}(_0xdd06,0x80));var _0x6dd0=function(_0x338b4c,_0x48f49e){_0x338b4c=_0x338b4c-0x0;var _0x3442f8=_0xdd06[_0x338b4c];return _0x3442f8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6dd0('0x0'));var timeout=require('connect-timeout');var express=require(_0x6dd0('0x1'));var router=express['Router']();var fs_extra=require(_0x6dd0('0x2'));var auth=require(_0x6dd0('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x6dd0('0x4'));var controller=require(_0x6dd0('0x5'));router['get']('/',auth[_0x6dd0('0x6')](),controller['index']);router[_0x6dd0('0x7')](_0x6dd0('0x8'),auth['isAuthenticated'](),controller[_0x6dd0('0x9')]);router[_0x6dd0('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0x6dd0('0xa')]);router[_0x6dd0('0xb')]('/',auth[_0x6dd0('0x6')](),controller[_0x6dd0('0xc')]);router[_0x6dd0('0xd')]('/:id',auth[_0x6dd0('0x6')](),controller[_0x6dd0('0xe')]);router[_0x6dd0('0xf')](_0x6dd0('0x8'),auth[_0x6dd0('0x6')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 4b2ccf3..2c35a42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45bd=['BOOLEAN','TEXT','STRING'];(function(_0x17479b,_0x4483f6){var _0x162432=function(_0x4f890e){while(--_0x4f890e){_0x17479b['push'](_0x17479b['shift']());}};_0x162432(++_0x4483f6);}(_0x45bd,0x199));var _0xd45b=function(_0x404475,_0x25aa04){_0x404475=_0x404475-0x0;var _0x728609=_0x45bd[_0x404475];return _0x728609;};'use strict';var Sequelize=require('sequelize');module['exports']={'field':{'type':Sequelize[_0xd45b('0x0')]},'alias':{'type':Sequelize[_0xd45b('0x1')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xd45b('0x1')]},'groupBy':{'type':Sequelize[_0xd45b('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xb093=['BOOLEAN','exports','TEXT','STRING'];(function(_0xa74a76,_0x526cd0){var _0x4da7b6=function(_0x1e103d){while(--_0x1e103d){_0xa74a76['push'](_0xa74a76['shift']());}};_0x4da7b6(++_0x526cd0);}(_0xb093,0xe9));var _0x3b09=function(_0x12a833,_0x587a49){_0x12a833=_0x12a833-0x0;var _0x55ba34=_0xb093[_0x12a833];return _0x55ba34;};'use strict';var Sequelize=require('sequelize');module[_0x3b09('0x0')]={'field':{'type':Sequelize[_0x3b09('0x1')]},'alias':{'type':Sequelize[_0x3b09('0x2')]},'function':{'type':Sequelize[_0x3b09('0x2')]},'format':{'type':Sequelize[_0x3b09('0x2')]},'groupBy':{'type':Sequelize[_0x3b09('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x3b09('0x2')]},'custom':{'type':Sequelize[_0x3b09('0x3')],'defaultValue':![]}};
\ No newline at end of file
index c602806..a782be8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa30b=['params','rawAttributes','intersection','includeAll','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','send','index','map','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','name','AnalyticFieldReport','include','findAll','catch','show'];(function(_0x30b34a,_0x50fcfe){var _0x1277e0=function(_0x134f73){while(--_0x134f73){_0x30b34a['push'](_0x30b34a['shift']());}};_0x1277e0(++_0x50fcfe);}(_0xa30b,0x1a3));var _0xba30=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa30b[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0xba30('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xba30('0x1'));var jsonpatch=require(_0xba30('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xba30('0x3'));var Mustache=require(_0xba30('0x4'));var util=require(_0xba30('0x5'));var path=require(_0xba30('0x6'));var sox=require(_0xba30('0x7'));var csv=require(_0xba30('0x8'));var ejs=require(_0xba30('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xba30('0xa'));var squel=require(_0xba30('0xb'));var crypto=require(_0xba30('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xba30('0x8'));var querystring=require('querystring');var Papa=require(_0xba30('0xd'));var Redis=require('ioredis');var authService=require(_0xba30('0xe'));var qs=require(_0xba30('0xf'));var as=require(_0xba30('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xba30('0x11'))(_0xba30('0x12'));var utils=require(_0xba30('0x13'));var config=require(_0xba30('0x14'));var licenseUtil=require(_0xba30('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x138ffe,_0x41a734){_0x41a734=_0x41a734||0xcc;return function(_0x44ee0e){if(_0x44ee0e){return _0x138ffe[_0xba30('0x16')](_0x41a734);}return _0x138ffe[_0xba30('0x17')](_0x41a734)['end']();};}function respondWithResult(_0x5994be,_0x502ea2){_0x502ea2=_0x502ea2||0xc8;return function(_0x5bfbc1){if(_0x5bfbc1){return _0x5994be[_0xba30('0x17')](_0x502ea2)[_0xba30('0x18')](_0x5bfbc1);}};}function respondWithFilteredResult(_0xda524e,_0x369ef2){return function(_0x29aa2c){if(_0x29aa2c){var _0x1cddd1=typeof _0x369ef2[_0xba30('0x19')]===_0xba30('0x1a')&&typeof _0x369ef2['limit']===_0xba30('0x1a');var _0x3e06fe=_0x29aa2c['count'];var _0x412036=_0x1cddd1?0x0:_0x369ef2[_0xba30('0x19')];var _0x57ce1f=_0x1cddd1?_0x29aa2c[_0xba30('0x1b')]:_0x369ef2['offset']+_0x369ef2[_0xba30('0x1c')];var _0x457c42;if(_0x57ce1f>=_0x3e06fe){_0x57ce1f=_0x3e06fe;_0x457c42=0xc8;}else{_0x457c42=0xce;}_0xda524e[_0xba30('0x17')](_0x457c42);return _0xda524e[_0xba30('0x1d')](_0xba30('0x1e'),_0x412036+'-'+_0x57ce1f+'/'+_0x3e06fe)[_0xba30('0x18')](_0x29aa2c);}return null;};}function patchUpdates(_0x3dde44){return function(_0x1563ab){try{jsonpatch[_0xba30('0x1f')](_0x1563ab,_0x3dde44,!![]);}catch(_0x421dc8){return BPromise[_0xba30('0x20')](_0x421dc8);}return _0x1563ab[_0xba30('0x21')]();};}function saveUpdates(_0x43c563,_0x68b6de){return function(_0x4cb6f9){if(_0x4cb6f9){return _0x4cb6f9[_0xba30('0x22')](_0x43c563)[_0xba30('0x23')](function(_0x514b5e){return _0x514b5e;});}return null;};}function removeEntity(_0x16dd47,_0x318513){return function(_0x3ecfe2){if(_0x3ecfe2){return _0x3ecfe2[_0xba30('0x24')]()['then'](function(){_0x16dd47['status'](0xcc)[_0xba30('0x25')]();});}};}function handleEntityNotFound(_0x5adeca,_0x269e18){return function(_0xc140ff){if(!_0xc140ff){_0x5adeca[_0xba30('0x16')](0x194);}return _0xc140ff;};}function handleError(_0x55304f,_0x1d84d9){_0x1d84d9=_0x1d84d9||0x1f4;return function(_0x319305){logger[_0xba30('0x26')](_0x319305[_0xba30('0x27')]);if(_0x319305['name']){delete _0x319305['name'];}_0x55304f[_0xba30('0x17')](_0x1d84d9)[_0xba30('0x28')](_0x319305);};}exports[_0xba30('0x29')]=function(_0x53235a,_0x23f2e6){var _0x31e181={},_0x5d31e9={},_0x46c668={'count':0x0,'rows':[]};var _0x357306=_[_0xba30('0x2a')](db['AnalyticFieldReport']['rawAttributes'],function(_0x2a150b){return{'name':_0x2a150b[_0xba30('0x2b')],'type':_0x2a150b[_0xba30('0x2c')][_0xba30('0x2d')]};});_0x5d31e9[_0xba30('0x2e')]=_[_0xba30('0x2a')](_0x357306,'name');_0x5d31e9['query']=_[_0xba30('0x2f')](_0x53235a[_0xba30('0x30')]);_0x5d31e9[_0xba30('0x31')]=_['intersection'](_0x5d31e9[_0xba30('0x2e')],_0x5d31e9['query']);_0x31e181[_0xba30('0x32')]=_['intersection'](_0x5d31e9['model'],qs[_0xba30('0x33')](_0x53235a[_0xba30('0x30')][_0xba30('0x33')]));_0x31e181[_0xba30('0x32')]=_0x31e181[_0xba30('0x32')][_0xba30('0x34')]?_0x31e181[_0xba30('0x32')]:_0x5d31e9[_0xba30('0x2e')];if(!_0x53235a['query'][_0xba30('0x35')]('nolimit')){_0x31e181[_0xba30('0x1c')]=qs[_0xba30('0x1c')](_0x53235a[_0xba30('0x30')][_0xba30('0x1c')]);_0x31e181[_0xba30('0x19')]=qs['offset'](_0x53235a[_0xba30('0x30')][_0xba30('0x19')]);}_0x31e181[_0xba30('0x36')]=qs[_0xba30('0x37')](_0x53235a[_0xba30('0x30')][_0xba30('0x37')]);_0x31e181[_0xba30('0x38')]=qs['filters'](_[_0xba30('0x39')](_0x53235a[_0xba30('0x30')],_0x5d31e9[_0xba30('0x31')]),_0x357306);if(_0x53235a[_0xba30('0x30')][_0xba30('0x3a')]){_0x31e181[_0xba30('0x38')]=_[_0xba30('0x3b')](_0x31e181[_0xba30('0x38')],{'$or':_['map'](_0x357306,function(_0x1d36a8){if(_0x1d36a8[_0xba30('0x2c')]!==_0xba30('0x3c')){var _0x3a03f2={};_0x3a03f2[_0x1d36a8[_0xba30('0x3d')]]={'$like':'%'+_0x53235a['query'][_0xba30('0x3a')]+'%'};return _0x3a03f2;}})});}_0x31e181=_[_0xba30('0x3b')]({},_0x31e181,_0x53235a['options']);var _0x24fc5d={'where':_0x31e181[_0xba30('0x38')]};return db[_0xba30('0x3e')][_0xba30('0x1b')](_0x24fc5d)[_0xba30('0x23')](function(_0x387777){_0x46c668[_0xba30('0x1b')]=_0x387777;if(_0x53235a[_0xba30('0x30')]['includeAll']){_0x31e181[_0xba30('0x3f')]=[{'all':!![]}];}return db[_0xba30('0x3e')][_0xba30('0x40')](_0x31e181);})[_0xba30('0x23')](function(_0x19f5bb){_0x46c668['rows']=_0x19f5bb;return _0x46c668;})['then'](respondWithFilteredResult(_0x23f2e6,_0x31e181))[_0xba30('0x41')](handleError(_0x23f2e6,null));};exports[_0xba30('0x42')]=function(_0x32f61e,_0x183fa2){var _0xc633f5={'raw':![],'where':{'id':_0x32f61e[_0xba30('0x43')]['id']}},_0x5dcf83={};_0x5dcf83[_0xba30('0x2e')]=_['keys'](db[_0xba30('0x3e')][_0xba30('0x44')]);_0x5dcf83[_0xba30('0x30')]=_[_0xba30('0x2f')](_0x32f61e[_0xba30('0x30')]);_0x5dcf83[_0xba30('0x31')]=_[_0xba30('0x45')](_0x5dcf83[_0xba30('0x2e')],_0x5dcf83[_0xba30('0x30')]);_0xc633f5[_0xba30('0x32')]=_[_0xba30('0x45')](_0x5dcf83[_0xba30('0x2e')],qs['fields'](_0x32f61e[_0xba30('0x30')][_0xba30('0x33')]));_0xc633f5[_0xba30('0x32')]=_0xc633f5['attributes'][_0xba30('0x34')]?_0xc633f5['attributes']:_0x5dcf83[_0xba30('0x2e')];if(_0x32f61e['query'][_0xba30('0x46')]){_0xc633f5[_0xba30('0x3f')]=[{'all':!![]}];}_0xc633f5=_[_0xba30('0x3b')]({},_0xc633f5,_0x32f61e['options']);return db[_0xba30('0x3e')][_0xba30('0x47')](_0xc633f5)['then'](handleEntityNotFound(_0x183fa2,null))[_0xba30('0x23')](respondWithResult(_0x183fa2,null))['catch'](handleError(_0x183fa2,null));};exports[_0xba30('0x48')]=function(_0x22de4,_0x521bf4){return db[_0xba30('0x3e')][_0xba30('0x48')](_0x22de4[_0xba30('0x49')],{})[_0xba30('0x23')](respondWithResult(_0x521bf4,0xc9))['catch'](handleError(_0x521bf4,null));};exports[_0xba30('0x4a')]=function(_0x535787,_0x2393e5){return db['AnalyticFieldReport'][_0xba30('0x4a')](_0x535787['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2393e5,0xc9))[_0xba30('0x41')](handleError(_0x2393e5,null));};exports[_0xba30('0x22')]=function(_0x3e7cf1,_0x582f57){if(_0x3e7cf1[_0xba30('0x49')]['id']){delete _0x3e7cf1['body']['id'];}return db['AnalyticFieldReport'][_0xba30('0x47')]({'where':{'id':_0x3e7cf1[_0xba30('0x43')]['id']}})[_0xba30('0x23')](handleEntityNotFound(_0x582f57,null))[_0xba30('0x23')](saveUpdates(_0x3e7cf1[_0xba30('0x49')],null))['then'](respondWithResult(_0x582f57,null))[_0xba30('0x41')](handleError(_0x582f57,null));};exports[_0xba30('0x24')]=function(_0x3d6539,_0x5d38a3){return db[_0xba30('0x3e')][_0xba30('0x47')]({'where':{'id':_0x3d6539[_0xba30('0x43')]['id']}})['then'](handleEntityNotFound(_0x5d38a3,null))[_0xba30('0x23')](removeEntity(_0x5d38a3,null))[_0xba30('0x41')](handleError(_0x5d38a3,null));};exports[_0xba30('0x4b')]=function(_0x3d6d5b,_0x5d64ae){return db[_0xba30('0x3e')]['destroy']({'where':{'id':_0x3d6d5b[_0xba30('0x30')][_0xba30('0x4c')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5d64ae,0xcc))['catch'](handleError(_0x5d64ae,null));};exports[_0xba30('0x4d')]=function(_0x1298d4,_0xba744b,_0x2d2bdc){return db[_0xba30('0x4e')]['findOne']({'where':{'id':_0x1298d4[_0xba30('0x43')]['id']}})[_0xba30('0x23')](handleEntityNotFound(_0xba744b,null))[_0xba30('0x23')](function(_0x2f853c){if(_0x2f853c){return db[_0xba30('0x4f')][_0xba30('0x50')](function(_0x5a3a08){return db[_0xba30('0x3e')][_0xba30('0x24')]({'where':{'CustomReportId':_0x1298d4['params']['id']},'transaction':_0x5a3a08})[_0xba30('0x23')](function(_0x3df829){var _0x4ac278=_[_0xba30('0x2a')](_0x1298d4[_0xba30('0x49')],function(_0x3b491d){delete _0x3b491d['id'];_0x3b491d['CustomReportId']=_0x1298d4[_0xba30('0x43')]['id'];return _0x3b491d;});return db[_0xba30('0x3e')][_0xba30('0x4a')](_0x4ac278,{'transaction':_0x5a3a08});});})['then'](function(){return db[_0xba30('0x3e')]['findAll']({'where':{'CustomReportId':_0x1298d4[_0xba30('0x43')]['id']}});});}})['then'](respondWithResult(_0xba744b,null))['catch'](handleError(_0xba744b,null));};
\ No newline at end of file
+var _0x831c=['AnalyticFieldReport','rawAttributes','fieldName','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','bulkCreate','destroy','ids','AnalyticCustomReport','findOne','sequelize','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','name','send','index','map'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x831c,0x1b8));var _0xc831=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x831c[_0x68c979];return _0x4f0001;};'use strict';var emlformat=require(_0xc831('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc831('0x1'));var jsonpatch=require(_0xc831('0x2'));var rp=require(_0xc831('0x3'));var moment=require(_0xc831('0x4'));var BPromise=require(_0xc831('0x5'));var Mustache=require(_0xc831('0x6'));var util=require(_0xc831('0x7'));var path=require(_0xc831('0x8'));var sox=require('sox');var csv=require(_0xc831('0x9'));var ejs=require(_0xc831('0xa'));var fs=require('fs');var fs_extra=require(_0xc831('0xb'));var _=require(_0xc831('0xc'));var squel=require(_0xc831('0xd'));var crypto=require(_0xc831('0xe'));var jsforce=require(_0xc831('0xf'));var deskjs=require(_0xc831('0x10'));var toCsv=require(_0xc831('0x9'));var querystring=require('querystring');var Papa=require(_0xc831('0x11'));var Redis=require(_0xc831('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc831('0x13'));var as=require(_0xc831('0x14'));var hardwareService=require(_0xc831('0x15'));var logger=require(_0xc831('0x16'))(_0xc831('0x17'));var utils=require(_0xc831('0x18'));var config=require(_0xc831('0x19'));var licenseUtil=require(_0xc831('0x1a'));var db=require(_0xc831('0x1b'))['db'];function respondWithStatusCode(_0x15fa2f,_0x400374){_0x400374=_0x400374||0xcc;return function(_0x38e772){if(_0x38e772){return _0x15fa2f[_0xc831('0x1c')](_0x400374);}return _0x15fa2f[_0xc831('0x1d')](_0x400374)[_0xc831('0x1e')]();};}function respondWithResult(_0x3abe4a,_0x2c1665){_0x2c1665=_0x2c1665||0xc8;return function(_0x2b0eda){if(_0x2b0eda){return _0x3abe4a[_0xc831('0x1d')](_0x2c1665)['json'](_0x2b0eda);}};}function respondWithFilteredResult(_0x2d096a,_0x16c574){return function(_0x297883){if(_0x297883){var _0x45f1c0=typeof _0x16c574[_0xc831('0x1f')]===_0xc831('0x20')&&typeof _0x16c574[_0xc831('0x21')]===_0xc831('0x20');var _0x1aaf6e=_0x297883[_0xc831('0x22')];var _0x2e6add=_0x45f1c0?0x0:_0x16c574[_0xc831('0x1f')];var _0x3ef63e=_0x45f1c0?_0x297883[_0xc831('0x22')]:_0x16c574['offset']+_0x16c574['limit'];var _0x7172c8;if(_0x3ef63e>=_0x1aaf6e){_0x3ef63e=_0x1aaf6e;_0x7172c8=0xc8;}else{_0x7172c8=0xce;}_0x2d096a[_0xc831('0x1d')](_0x7172c8);return _0x2d096a['set'](_0xc831('0x23'),_0x2e6add+'-'+_0x3ef63e+'/'+_0x1aaf6e)['json'](_0x297883);}return null;};}function patchUpdates(_0x156ba9){return function(_0x30fd9c){try{jsonpatch[_0xc831('0x24')](_0x30fd9c,_0x156ba9,!![]);}catch(_0x5b08a9){return BPromise[_0xc831('0x25')](_0x5b08a9);}return _0x30fd9c[_0xc831('0x26')]();};}function saveUpdates(_0x437621,_0x48be44){return function(_0x5afc8b){if(_0x5afc8b){return _0x5afc8b[_0xc831('0x27')](_0x437621)[_0xc831('0x28')](function(_0x5e16d3){return _0x5e16d3;});}return null;};}function removeEntity(_0xbf7cd2,_0x138023){return function(_0x3d83e1){if(_0x3d83e1){return _0x3d83e1['destroy']()[_0xc831('0x28')](function(){_0xbf7cd2[_0xc831('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x292e46,_0x169286){return function(_0x57076c){if(!_0x57076c){_0x292e46[_0xc831('0x1c')](0x194);}return _0x57076c;};}function handleError(_0x166e04,_0x5a624d){_0x5a624d=_0x5a624d||0x1f4;return function(_0x48b97b){logger[_0xc831('0x29')](_0x48b97b['stack']);if(_0x48b97b[_0xc831('0x2a')]){delete _0x48b97b[_0xc831('0x2a')];}_0x166e04[_0xc831('0x1d')](_0x5a624d)[_0xc831('0x2b')](_0x48b97b);};}exports[_0xc831('0x2c')]=function(_0x275bb9,_0x4930f5){var _0x2f4768={},_0x5c9566={},_0x4793e3={'count':0x0,'rows':[]};var _0x431e5f=_[_0xc831('0x2d')](db[_0xc831('0x2e')][_0xc831('0x2f')],function(_0x465f47){return{'name':_0x465f47[_0xc831('0x30')],'type':_0x465f47['type']['key']};});_0x5c9566[_0xc831('0x31')]=_[_0xc831('0x2d')](_0x431e5f,'name');_0x5c9566[_0xc831('0x32')]=_[_0xc831('0x33')](_0x275bb9[_0xc831('0x32')]);_0x5c9566['filters']=_[_0xc831('0x34')](_0x5c9566[_0xc831('0x31')],_0x5c9566[_0xc831('0x32')]);_0x2f4768['attributes']=_['intersection'](_0x5c9566[_0xc831('0x31')],qs[_0xc831('0x35')](_0x275bb9['query'][_0xc831('0x35')]));_0x2f4768[_0xc831('0x36')]=_0x2f4768[_0xc831('0x36')][_0xc831('0x37')]?_0x2f4768[_0xc831('0x36')]:_0x5c9566[_0xc831('0x31')];if(!_0x275bb9[_0xc831('0x32')]['hasOwnProperty'](_0xc831('0x38'))){_0x2f4768[_0xc831('0x21')]=qs[_0xc831('0x21')](_0x275bb9[_0xc831('0x32')][_0xc831('0x21')]);_0x2f4768[_0xc831('0x1f')]=qs[_0xc831('0x1f')](_0x275bb9['query'][_0xc831('0x1f')]);}_0x2f4768[_0xc831('0x39')]=qs[_0xc831('0x3a')](_0x275bb9[_0xc831('0x32')][_0xc831('0x3a')]);_0x2f4768[_0xc831('0x3b')]=qs[_0xc831('0x3c')](_['pick'](_0x275bb9[_0xc831('0x32')],_0x5c9566[_0xc831('0x3c')]),_0x431e5f);if(_0x275bb9[_0xc831('0x32')][_0xc831('0x3d')]){_0x2f4768['where']=_[_0xc831('0x3e')](_0x2f4768[_0xc831('0x3b')],{'$or':_[_0xc831('0x2d')](_0x431e5f,function(_0x44d85d){if(_0x44d85d[_0xc831('0x3f')]!==_0xc831('0x40')){var _0x4bb927={};_0x4bb927[_0x44d85d['name']]={'$like':'%'+_0x275bb9[_0xc831('0x32')][_0xc831('0x3d')]+'%'};return _0x4bb927;}})});}_0x2f4768=_[_0xc831('0x3e')]({},_0x2f4768,_0x275bb9[_0xc831('0x41')]);var _0x1be16b={'where':_0x2f4768['where']};return db[_0xc831('0x2e')][_0xc831('0x22')](_0x1be16b)['then'](function(_0x57f5f9){_0x4793e3[_0xc831('0x22')]=_0x57f5f9;if(_0x275bb9[_0xc831('0x32')][_0xc831('0x42')]){_0x2f4768[_0xc831('0x43')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xc831('0x44')](_0x2f4768);})[_0xc831('0x28')](function(_0x43d0a9){_0x4793e3['rows']=_0x43d0a9;return _0x4793e3;})[_0xc831('0x28')](respondWithFilteredResult(_0x4930f5,_0x2f4768))[_0xc831('0x45')](handleError(_0x4930f5,null));};exports['show']=function(_0xb689ff,_0x3e34fd){var _0x2c8d8d={'raw':![],'where':{'id':_0xb689ff[_0xc831('0x46')]['id']}},_0x270918={};_0x270918[_0xc831('0x31')]=_[_0xc831('0x33')](db[_0xc831('0x2e')][_0xc831('0x2f')]);_0x270918[_0xc831('0x32')]=_[_0xc831('0x33')](_0xb689ff['query']);_0x270918['filters']=_['intersection'](_0x270918[_0xc831('0x31')],_0x270918[_0xc831('0x32')]);_0x2c8d8d['attributes']=_[_0xc831('0x34')](_0x270918[_0xc831('0x31')],qs[_0xc831('0x35')](_0xb689ff[_0xc831('0x32')][_0xc831('0x35')]));_0x2c8d8d[_0xc831('0x36')]=_0x2c8d8d[_0xc831('0x36')][_0xc831('0x37')]?_0x2c8d8d[_0xc831('0x36')]:_0x270918[_0xc831('0x31')];if(_0xb689ff[_0xc831('0x32')]['includeAll']){_0x2c8d8d[_0xc831('0x43')]=[{'all':!![]}];}_0x2c8d8d=_[_0xc831('0x3e')]({},_0x2c8d8d,_0xb689ff[_0xc831('0x41')]);return db[_0xc831('0x2e')][_0xc831('0x47')](_0x2c8d8d)[_0xc831('0x28')](handleEntityNotFound(_0x3e34fd,null))[_0xc831('0x28')](respondWithResult(_0x3e34fd,null))['catch'](handleError(_0x3e34fd,null));};exports[_0xc831('0x48')]=function(_0x10c6fc,_0x2f0045){return db[_0xc831('0x2e')][_0xc831('0x48')](_0x10c6fc[_0xc831('0x49')],{})[_0xc831('0x28')](respondWithResult(_0x2f0045,0xc9))['catch'](handleError(_0x2f0045,null));};exports[_0xc831('0x4a')]=function(_0x2bb208,_0x22ba33){return db[_0xc831('0x2e')]['bulkCreate'](_0x2bb208['body'],{'raw':![],'individualHooks':!![]})[_0xc831('0x28')](respondWithResult(_0x22ba33,0xc9))['catch'](handleError(_0x22ba33,null));};exports[_0xc831('0x27')]=function(_0x5f649d,_0x31c1db){if(_0x5f649d[_0xc831('0x49')]['id']){delete _0x5f649d[_0xc831('0x49')]['id'];}return db[_0xc831('0x2e')]['find']({'where':{'id':_0x5f649d[_0xc831('0x46')]['id']}})[_0xc831('0x28')](handleEntityNotFound(_0x31c1db,null))[_0xc831('0x28')](saveUpdates(_0x5f649d[_0xc831('0x49')],null))[_0xc831('0x28')](respondWithResult(_0x31c1db,null))[_0xc831('0x45')](handleError(_0x31c1db,null));};exports['destroy']=function(_0x1793ed,_0x4a0277){return db[_0xc831('0x2e')][_0xc831('0x47')]({'where':{'id':_0x1793ed[_0xc831('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a0277,null))['then'](removeEntity(_0x4a0277,null))[_0xc831('0x45')](handleError(_0x4a0277,null));};exports['bulkDestroy']=function(_0x247345,_0x1dff73){return db['AnalyticFieldReport'][_0xc831('0x4b')]({'where':{'id':_0x247345[_0xc831('0x32')][_0xc831('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0xc831('0x28')](respondWithResult(_0x1dff73,0xcc))[_0xc831('0x45')](handleError(_0x1dff73,null));};exports['addFields']=function(_0x2e0b89,_0x31f43c,_0x5613a4){return db[_0xc831('0x4d')][_0xc831('0x4e')]({'where':{'id':_0x2e0b89[_0xc831('0x46')]['id']}})['then'](handleEntityNotFound(_0x31f43c,null))[_0xc831('0x28')](function(_0x51411b){if(_0x51411b){return db[_0xc831('0x4f')]['transaction'](function(_0x451977){return db['AnalyticFieldReport'][_0xc831('0x4b')]({'where':{'CustomReportId':_0x2e0b89[_0xc831('0x46')]['id']},'transaction':_0x451977})[_0xc831('0x28')](function(_0xc40288){var _0x4edd61=_['map'](_0x2e0b89[_0xc831('0x49')],function(_0xca00f1){delete _0xca00f1['id'];_0xca00f1[_0xc831('0x50')]=_0x2e0b89[_0xc831('0x46')]['id'];return _0xca00f1;});return db[_0xc831('0x2e')]['bulkCreate'](_0x4edd61,{'transaction':_0x451977});});})['then'](function(){return db[_0xc831('0x2e')][_0xc831('0x44')]({'where':{'CustomReportId':_0x2e0b89[_0xc831('0x46')]['id']}});});}})['then'](respondWithResult(_0x31f43c,null))[_0xc831('0x45')](handleError(_0x31f43c,null));};
\ No newline at end of file
index ce5b605..924db98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x809c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','analytics_report_fields','lodash','util','../../config/logger'];(function(_0x4a47b6,_0x3a7779){var _0xe2aa47=function(_0x12d80b){while(--_0x12d80b){_0x4a47b6['push'](_0x4a47b6['shift']());}};_0xe2aa47(++_0x3a7779);}(_0x809c,0x11b));var _0xc809=function(_0x8d0c43,_0x18620c){_0x8d0c43=_0x8d0c43-0x0;var _0x52cda7=_0x809c[_0x8d0c43];return _0x52cda7;};'use strict';var _=require(_0xc809('0x0'));var util=require(_0xc809('0x1'));var logger=require(_0xc809('0x2'))('api');var moment=require(_0xc809('0x3'));var BPromise=require(_0xc809('0x4'));var rp=require(_0xc809('0x5'));var fs=require('fs');var path=require(_0xc809('0x6'));var rimraf=require(_0xc809('0x7'));var config=require(_0xc809('0x8'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x2534a2,_0x2f9b0b){return _0x2534a2[_0xc809('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0xc809('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x07f7=['../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x165840,_0x58df6d){var _0x5a4f8b=function(_0x2d501e){while(--_0x2d501e){_0x165840['push'](_0x165840['shift']());}};_0x5a4f8b(++_0x58df6d);}(_0x07f7,0x1b5));var _0x707f=function(_0x1ffff7,_0x2f9ff6){_0x1ffff7=_0x1ffff7-0x0;var _0x49d017=_0x07f7[_0x1ffff7];return _0x49d017;};'use strict';var _=require(_0x707f('0x0'));var util=require('util');var logger=require(_0x707f('0x1'))(_0x707f('0x2'));var moment=require('moment');var BPromise=require(_0x707f('0x3'));var rp=require(_0x707f('0x4'));var fs=require('fs');var path=require(_0x707f('0x5'));var rimraf=require(_0x707f('0x6'));var config=require(_0x707f('0x7'));var attributes=require(_0x707f('0x8'));module[_0x707f('0x9')]=function(_0x2bf3d3,_0x5461af){return _0x2bf3d3['define'](_0x707f('0xa'),attributes,{'tableName':_0x707f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a69db75..3b40437 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20f8=['request','then','info','debug','request\x20sent','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3f12c9,_0x50be38){var _0x5a8e3e=function(_0x18a14a){while(--_0x18a14a){_0x3f12c9['push'](_0x3f12c9['shift']());}};_0x5a8e3e(++_0x50be38);}(_0x20f8,0x1ea));var _0x820f=function(_0x331a9f,_0x2c23fe){_0x331a9f=_0x331a9f-0x0;var _0x4e51d7=_0x20f8[_0x331a9f];return _0x4e51d7;};'use strict';var _=require(_0x820f('0x0'));var util=require(_0x820f('0x1'));var moment=require(_0x820f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x820f('0x3'))['db'];var utils=require(_0x820f('0x4'));var logger=require(_0x820f('0x5'))(_0x820f('0x6'));var config=require(_0x820f('0x7'));var jayson=require(_0x820f('0x8'));var client=jayson[_0x820f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5734a0,_0x62a04,_0xa562eb){return new BPromise(function(_0x11e6ae,_0x22b1dd){return client[_0x820f('0xa')](_0x5734a0,_0xa562eb)[_0x820f('0xb')](function(_0x23bd44){logger[_0x820f('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x62a04,'request\x20sent');logger[_0x820f('0xd')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x62a04,_0x820f('0xe'),JSON[_0x820f('0xf')](_0x23bd44));if(_0x23bd44[_0x820f('0x10')]){if(_0x23bd44['error'][_0x820f('0x11')]===0x1f4){logger[_0x820f('0x10')](_0x820f('0x12'),_0x62a04,_0x23bd44[_0x820f('0x10')]['message']);return _0x22b1dd(_0x23bd44[_0x820f('0x10')][_0x820f('0x13')]);}logger[_0x820f('0x10')](_0x820f('0x12'),_0x62a04,_0x23bd44[_0x820f('0x10')][_0x820f('0x13')]);return _0x11e6ae(_0x23bd44[_0x820f('0x10')][_0x820f('0x13')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x62a04,_0x820f('0xe'));_0x11e6ae(_0x23bd44['result'][_0x820f('0x13')]);}})['catch'](function(_0x3ad7b6){logger[_0x820f('0x10')](_0x820f('0x12'),_0x62a04,_0x3ad7b6);_0x22b1dd(_0x3ad7b6);});});}
\ No newline at end of file
+var _0xe725=['jayson/promise','http','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x26dcd4,_0x58f255){var _0x292987=function(_0x1da8b1){while(--_0x1da8b1){_0x26dcd4['push'](_0x26dcd4['shift']());}};_0x292987(++_0x58f255);}(_0xe725,0x189));var _0x5e72=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xe725[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x5e72('0x0'));var moment=require('moment');var BPromise=require(_0x5e72('0x1'));var rs=require(_0x5e72('0x2'));var fs=require('fs');var Redis=require(_0x5e72('0x3'));var db=require(_0x5e72('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5e72('0x5'));var config=require(_0x5e72('0x6'));var jayson=require(_0x5e72('0x7'));var client=jayson['client'][_0x5e72('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x25dd6f,_0x53dada,_0xd54de2){return new BPromise(function(_0x149897,_0x3541ff){return client['request'](_0x25dd6f,_0xd54de2)[_0x5e72('0x9')](function(_0x49f6e5){logger['info'](_0x5e72('0xa'),_0x53dada,_0x5e72('0xb'));logger[_0x5e72('0xc')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x53dada,_0x5e72('0xb'),JSON[_0x5e72('0xd')](_0x49f6e5));if(_0x49f6e5[_0x5e72('0xe')]){if(_0x49f6e5[_0x5e72('0xe')][_0x5e72('0xf')]===0x1f4){logger['error'](_0x5e72('0xa'),_0x53dada,_0x49f6e5[_0x5e72('0xe')][_0x5e72('0x10')]);return _0x3541ff(_0x49f6e5[_0x5e72('0xe')][_0x5e72('0x10')]);}logger[_0x5e72('0xe')](_0x5e72('0xa'),_0x53dada,_0x49f6e5[_0x5e72('0xe')][_0x5e72('0x10')]);return _0x149897(_0x49f6e5[_0x5e72('0xe')]['message']);}else{logger[_0x5e72('0x11')](_0x5e72('0xa'),_0x53dada,_0x5e72('0xb'));_0x149897(_0x49f6e5[_0x5e72('0x12')][_0x5e72('0x10')]);}})[_0x5e72('0x13')](function(_0x1fac90){logger[_0x5e72('0xe')](_0x5e72('0xa'),_0x53dada,_0x1fac90);_0x3541ff(_0x1fac90);});});}
\ No newline at end of file
index aef2484..30c0142 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(_0x1b33e2,_0x54b613){var _0x5c100a=function(_0x196ca9){while(--_0x196ca9){_0x1b33e2['push'](_0x1b33e2['shift']());}};_0x5c100a(++_0x54b613);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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(_0x3dba5d,_0x49807d){var _0x458442=function(_0x1bb8db){while(--_0x1bb8db){_0x3dba5d['push'](_0x3dba5d['shift']());}};_0x458442(++_0x49807d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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 f88cac6..249b629 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75e3=['STRING','TEXT','exports'];(function(_0x5da01e,_0x1efb11){var _0x3c0bb3=function(_0x345d38){while(--_0x345d38){_0x5da01e['push'](_0x5da01e['shift']());}};_0x3c0bb3(++_0x1efb11);}(_0x75e3,0x104));var _0x375e=function(_0x643205,_0x9ce956){_0x643205=_0x643205-0x0;var _0x585ccc=_0x75e3[_0x643205];return _0x585ccc;};'use strict';var Sequelize=require('sequelize');module[_0x375e('0x0')]={'name':{'type':Sequelize[_0x375e('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x375e('0x1')]},'metric':{'type':Sequelize[_0x375e('0x2')]},'description':{'type':Sequelize[_0x375e('0x1')]}};
\ No newline at end of file
+var _0xa45c=['STRING','sequelize','exports'];(function(_0x1980e7,_0x24ef67){var _0xb8b59a=function(_0x4d88d3){while(--_0x4d88d3){_0x1980e7['push'](_0x1980e7['shift']());}};_0xb8b59a(++_0x24ef67);}(_0xa45c,0x6d));var _0xca45=function(_0x57eb84,_0x12c92e){_0x57eb84=_0x57eb84-0x0;var _0x201247=_0xa45c[_0x57eb84];return _0x201247;};'use strict';var Sequelize=require(_0xca45('0x0'));module[_0xca45('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xca45('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xca45('0x2')]}};
\ No newline at end of file
index df3b845..1fc2865 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','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','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x57326c,_0x701840){var _0x442323=function(_0x529315){while(--_0x529315){_0x57326c['push'](_0x57326c['shift']());}};_0x442323(++_0x701840);}(_0x9a19,0x114));var _0x99a1=function(_0x3b3cc6,_0x1a6e24){_0x3b3cc6=_0x3b3cc6-0x0;var _0x1161e4=_0x9a19[_0x3b3cc6];return _0x1161e4;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));};
\ No newline at end of file
+var _0x4b84=['status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','stack','name','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x4d9c3b,_0x3c4663){var _0x35c391=function(_0x22ac2e){while(--_0x22ac2e){_0x4d9c3b['push'](_0x4d9c3b['shift']());}};_0x35c391(++_0x3c4663);}(_0x4b84,0x1cc));var _0x44b8=function(_0xa98302,_0x844f27){_0xa98302=_0xa98302-0x0;var _0x1ad8e3=_0x4b84[_0xa98302];return _0x1ad8e3;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];function respondWithStatusCode(_0x4301a6,_0x4bcc43){_0x4bcc43=_0x4bcc43||0xcc;return function(_0x194230){if(_0x194230){return _0x4301a6['sendStatus'](_0x4bcc43);}return _0x4301a6[_0x44b8('0x14')](_0x4bcc43)[_0x44b8('0x15')]();};}function respondWithResult(_0x4df670,_0x63e8f6){_0x63e8f6=_0x63e8f6||0xc8;return function(_0x4be54c){if(_0x4be54c){return _0x4df670['status'](_0x63e8f6)[_0x44b8('0x16')](_0x4be54c);}};}function respondWithFilteredResult(_0x2af0ad,_0x1722da){return function(_0x41ab46){if(_0x41ab46){var _0x5e52f2=typeof _0x1722da['offset']==='undefined'&&typeof _0x1722da[_0x44b8('0x17')]==='undefined';var _0x28ef36=_0x41ab46[_0x44b8('0x18')];var _0x55e258=_0x5e52f2?0x0:_0x1722da[_0x44b8('0x19')];var _0xe3de8f=_0x5e52f2?_0x41ab46['count']:_0x1722da[_0x44b8('0x19')]+_0x1722da[_0x44b8('0x17')];var _0x4b600f;if(_0xe3de8f>=_0x28ef36){_0xe3de8f=_0x28ef36;_0x4b600f=0xc8;}else{_0x4b600f=0xce;}_0x2af0ad[_0x44b8('0x14')](_0x4b600f);return _0x2af0ad[_0x44b8('0x1a')](_0x44b8('0x1b'),_0x55e258+'-'+_0xe3de8f+'/'+_0x28ef36)[_0x44b8('0x16')](_0x41ab46);}return null;};}function patchUpdates(_0x102ef9){return function(_0x369c09){try{jsonpatch[_0x44b8('0x1c')](_0x369c09,_0x102ef9,!![]);}catch(_0x9b0536){return BPromise[_0x44b8('0x1d')](_0x9b0536);}return _0x369c09[_0x44b8('0x1e')]();};}function saveUpdates(_0x1d642b,_0x14996c){return function(_0x48327e){if(_0x48327e){return _0x48327e[_0x44b8('0x1f')](_0x1d642b)[_0x44b8('0x20')](function(_0x416b34){return _0x416b34;});}return null;};}function removeEntity(_0x1418db,_0x305a5c){return function(_0x51a34a){if(_0x51a34a){return _0x51a34a[_0x44b8('0x21')]()['then'](function(){var _0x41a922=_0x51a34a[_0x44b8('0x22')]({'plain':!![]});var _0x25a0c1=_0x44b8('0x23');return db[_0x44b8('0x24')]['destroy']({'where':{'type':_0x25a0c1,'resourceId':_0x41a922['id']}})[_0x44b8('0x20')](function(){return _0x51a34a;});})['then'](function(){_0x1418db[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();});}};}function handleEntityNotFound(_0x549a26,_0x17ac44){return function(_0x470f49){if(!_0x470f49){_0x549a26[_0x44b8('0x25')](0x194);}return _0x470f49;};}function handleError(_0x59c1bf,_0xb22107){_0xb22107=_0xb22107||0x1f4;return function(_0x242342){logger['error'](_0x242342[_0x44b8('0x26')]);if(_0x242342['name']){delete _0x242342[_0x44b8('0x27')];}_0x59c1bf['status'](_0xb22107)['send'](_0x242342);};}exports['index']=function(_0x387293,_0x29b18d){var _0x44ce5a={},_0x1bd1be={},_0x38cd17={'count':0x0,'rows':[]};var _0xc3f667=_[_0x44b8('0x28')](db[_0x44b8('0x29')][_0x44b8('0x2a')],function(_0x28f918){return{'name':_0x28f918[_0x44b8('0x2b')],'type':_0x28f918[_0x44b8('0x2c')][_0x44b8('0x2d')]};});_0x1bd1be['model']=_[_0x44b8('0x28')](_0xc3f667,'name');_0x1bd1be[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x387293[_0x44b8('0x2e')]);_0x1bd1be[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x1bd1be['model'],_0x1bd1be[_0x44b8('0x2e')]);_0x44ce5a[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x1bd1be[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x387293['query'][_0x44b8('0x34')]));_0x44ce5a[_0x44b8('0x32')]=_0x44ce5a[_0x44b8('0x32')][_0x44b8('0x35')]?_0x44ce5a[_0x44b8('0x32')]:_0x1bd1be[_0x44b8('0x33')];if(!_0x387293[_0x44b8('0x2e')][_0x44b8('0x36')](_0x44b8('0x37'))){_0x44ce5a[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x17')]);_0x44ce5a[_0x44b8('0x19')]=qs[_0x44b8('0x19')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x19')]);}_0x44ce5a[_0x44b8('0x38')]=qs[_0x44b8('0x39')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x39')]);_0x44ce5a[_0x44b8('0x3a')]=qs['filters'](_[_0x44b8('0x3b')](_0x387293[_0x44b8('0x2e')],_0x1bd1be['filters']),_0xc3f667);if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]){_0x44ce5a[_0x44b8('0x3a')]=_[_0x44b8('0x3d')](_0x44ce5a['where'],{'$or':_[_0x44b8('0x28')](_0xc3f667,function(_0x11e4e3){if(_0x11e4e3[_0x44b8('0x2c')]!==_0x44b8('0x3e')){var _0x9cb2a={};_0x9cb2a[_0x11e4e3[_0x44b8('0x27')]]={'$like':'%'+_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]+'%'};return _0x9cb2a;}})});}_0x44ce5a=_[_0x44b8('0x3d')]({},_0x44ce5a,_0x387293[_0x44b8('0x3f')]);var _0x1c9983={'where':_0x44ce5a[_0x44b8('0x3a')]};return db[_0x44b8('0x29')][_0x44b8('0x18')](_0x1c9983)[_0x44b8('0x20')](function(_0x29b43f){_0x38cd17['count']=_0x29b43f;if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x44ce5a[_0x44b8('0x41')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x44b8('0x42')](_0x44ce5a);})[_0x44b8('0x20')](function(_0x229cc9){_0x38cd17['rows']=_0x229cc9;return _0x38cd17;})[_0x44b8('0x20')](respondWithFilteredResult(_0x29b18d,_0x44ce5a))[_0x44b8('0x43')](handleError(_0x29b18d,null));};exports[_0x44b8('0x44')]=function(_0x334f86,_0xfd590a){var _0x499a3e={'raw':!![],'where':{'id':_0x334f86[_0x44b8('0x45')]['id']}},_0x5ae5f9={};_0x5ae5f9[_0x44b8('0x33')]=_[_0x44b8('0x2f')](db[_0x44b8('0x29')][_0x44b8('0x2a')]);_0x5ae5f9[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x334f86[_0x44b8('0x2e')]);_0x5ae5f9[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],_0x5ae5f9[_0x44b8('0x2e')]);_0x499a3e[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x334f86[_0x44b8('0x2e')][_0x44b8('0x34')]));_0x499a3e[_0x44b8('0x32')]=_0x499a3e['attributes']['length']?_0x499a3e[_0x44b8('0x32')]:_0x5ae5f9[_0x44b8('0x33')];if(_0x334f86[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x499a3e[_0x44b8('0x41')]=[{'all':!![]}];}_0x499a3e=_[_0x44b8('0x3d')]({},_0x499a3e,_0x334f86[_0x44b8('0x3f')]);return db['AnalyticMetric'][_0x44b8('0x46')](_0x499a3e)['then'](handleEntityNotFound(_0xfd590a,null))[_0x44b8('0x20')](respondWithResult(_0xfd590a,null))[_0x44b8('0x43')](handleError(_0xfd590a,null));};exports[_0x44b8('0x47')]=function(_0x9207bf,_0x103d57){return db[_0x44b8('0x29')]['create'](_0x9207bf[_0x44b8('0x48')],{})[_0x44b8('0x20')](function(_0x10602c){var _0x25d266=_0x9207bf['user'][_0x44b8('0x22')]({'plain':!![]});if(!_0x25d266)throw new Error(_0x44b8('0x49'));if(_0x25d266[_0x44b8('0x4a')]===_0x44b8('0x4b')){var _0x44ec23=_0x10602c[_0x44b8('0x22')]({'plain':!![]});var _0x500bad=_0x44b8('0x23');return db[_0x44b8('0x4c')][_0x44b8('0x46')]({'where':{'name':_0x500bad,'userProfileId':_0x25d266[_0x44b8('0x4d')]},'raw':!![]})[_0x44b8('0x20')](function(_0x57d0e2){if(_0x57d0e2&&_0x57d0e2['autoAssociation']===0x0){return db[_0x44b8('0x24')]['create']({'name':_0x44ec23[_0x44b8('0x27')],'resourceId':_0x44ec23['id'],'type':_0x57d0e2['name'],'sectionId':_0x57d0e2['id']},{})[_0x44b8('0x20')](function(){return _0x10602c;});}else{return _0x10602c;}})[_0x44b8('0x43')](function(_0x1a29f6){logger[_0x44b8('0x4e')](_0x44b8('0x4f'),_0x1a29f6);throw _0x1a29f6;});}return _0x10602c;})[_0x44b8('0x20')](respondWithResult(_0x103d57,0xc9))[_0x44b8('0x43')](handleError(_0x103d57,null));};exports['update']=function(_0x3ad278,_0x37b2c2){if(_0x3ad278[_0x44b8('0x48')]['id']){delete _0x3ad278['body']['id'];}return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x3ad278[_0x44b8('0x45')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0x37b2c2,null))['then'](saveUpdates(_0x3ad278[_0x44b8('0x48')],null))[_0x44b8('0x20')](respondWithResult(_0x37b2c2,null))['catch'](handleError(_0x37b2c2,null));};exports[_0x44b8('0x21')]=function(_0x19f22b,_0x35136e){return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x19f22b['params']['id']}})['then'](handleEntityNotFound(_0x35136e,null))[_0x44b8('0x20')](removeEntity(_0x35136e,null))[_0x44b8('0x43')](handleError(_0x35136e,null));};
\ No newline at end of file
index 3f16812..6ee95df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f1c=['AnalyticMetric','analytics_metrics','lodash','api','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','define'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3f1c,0xd4));var _0xc3f1=function(_0x5e52f3,_0x28bbd1){_0x5e52f3=_0x5e52f3-0x0;var _0xe3edf6=_0x3f1c[_0x5e52f3];return _0xe3edf6;};'use strict';var _=require(_0xc3f1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc3f1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc3f1('0x2'));var fs=require('fs');var path=require(_0xc3f1('0x3'));var rimraf=require(_0xc3f1('0x4'));var config=require(_0xc3f1('0x5'));var attributes=require(_0xc3f1('0x6'));module['exports']=function(_0x12e78a,_0x4ebd4c){return _0x12e78a[_0xc3f1('0x7')](_0xc3f1('0x8'),attributes,{'tableName':_0xc3f1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc61d=['exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./analyticMetric.attributes'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xc61d,0xfb));var _0xdc61=function(_0x1e0561,_0x370016){_0x1e0561=_0x1e0561-0x0;var _0x20313d=_0xc61d[_0x1e0561];return _0x20313d;};'use strict';var _=require(_0xdc61('0x0'));var util=require(_0xdc61('0x1'));var logger=require(_0xdc61('0x2'))(_0xdc61('0x3'));var moment=require(_0xdc61('0x4'));var BPromise=require(_0xdc61('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc61('0x6'));var rimraf=require(_0xdc61('0x7'));var config=require('../../config/environment');var attributes=require(_0xdc61('0x8'));module[_0xdc61('0x9')]=function(_0xf7834c,_0x20eef5){return _0xf7834c[_0xdc61('0xa')](_0xdc61('0xb'),attributes,{'tableName':_0xdc61('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b435377..75bb177 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97ef=['../../config/environment','jayson/promise','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xb0de07,_0x3ca2a0){var _0x4633d8=function(_0x2368e0){while(--_0x2368e0){_0xb0de07['push'](_0xb0de07['shift']());}};_0x4633d8(++_0x3ca2a0);}(_0x97ef,0x141));var _0xf97e=function(_0x3777b8,_0x26abd2){_0x3777b8=_0x3777b8-0x0;var _0x14817b=_0x97ef[_0x3777b8];return _0x14817b;};'use strict';var _=require(_0xf97e('0x0'));var util=require(_0xf97e('0x1'));var moment=require(_0xf97e('0x2'));var BPromise=require(_0xf97e('0x3'));var rs=require(_0xf97e('0x4'));var fs=require('fs');var Redis=require(_0xf97e('0x5'));var db=require(_0xf97e('0x6'))['db'];var utils=require(_0xf97e('0x7'));var logger=require(_0xf97e('0x8'))('rpc');var config=require(_0xf97e('0x9'));var jayson=require(_0xf97e('0xa'));var client=jayson[_0xf97e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fb869,_0x3a692a,_0x2411f3){return new BPromise(function(_0x24f7d7,_0x47ce08){return client[_0xf97e('0xc')](_0x2fb869,_0x2411f3)[_0xf97e('0xd')](function(_0x1c3f78){logger[_0xf97e('0xe')](_0xf97e('0xf'),_0x3a692a,_0xf97e('0x10'));logger[_0xf97e('0x11')](_0xf97e('0x12'),_0x3a692a,_0xf97e('0x10'),JSON['stringify'](_0x1c3f78));if(_0x1c3f78[_0xf97e('0x13')]){if(_0x1c3f78['error']['code']===0x1f4){logger[_0xf97e('0x13')](_0xf97e('0xf'),_0x3a692a,_0x1c3f78[_0xf97e('0x13')][_0xf97e('0x14')]);return _0x47ce08(_0x1c3f78[_0xf97e('0x13')][_0xf97e('0x14')]);}logger[_0xf97e('0x13')](_0xf97e('0xf'),_0x3a692a,_0x1c3f78[_0xf97e('0x13')][_0xf97e('0x14')]);return _0x24f7d7(_0x1c3f78[_0xf97e('0x13')][_0xf97e('0x14')]);}else{logger['info'](_0xf97e('0xf'),_0x3a692a,_0xf97e('0x10'));_0x24f7d7(_0x1c3f78[_0xf97e('0x15')]['message']);}})['catch'](function(_0x11a212){logger[_0xf97e('0x13')](_0xf97e('0xf'),_0x3a692a,_0x11a212);_0x47ce08(_0x11a212);});});}
\ No newline at end of file
+var _0x6e99=['AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x453d84,_0x4ab33e){var _0x3bf201=function(_0x1486d3){while(--_0x1486d3){_0x453d84['push'](_0x453d84['shift']());}};_0x3bf201(++_0x4ab33e);}(_0x6e99,0x106));var _0x96e9=function(_0x23dc59,_0x519e23){_0x23dc59=_0x23dc59-0x0;var _0x4f8034=_0x6e99[_0x23dc59];return _0x4f8034;};'use strict';var _=require(_0x96e9('0x0'));var util=require(_0x96e9('0x1'));var moment=require(_0x96e9('0x2'));var BPromise=require('bluebird');var rs=require(_0x96e9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96e9('0x4'))['db'];var utils=require(_0x96e9('0x5'));var logger=require(_0x96e9('0x6'))(_0x96e9('0x7'));var config=require('../../config/environment');var jayson=require(_0x96e9('0x8'));var client=jayson[_0x96e9('0x9')][_0x96e9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37fc80,_0x3e7a5c,_0x5bb81d){return new BPromise(function(_0x3424a6,_0x5aede3){return client[_0x96e9('0xb')](_0x37fc80,_0x5bb81d)[_0x96e9('0xc')](function(_0x563843){logger[_0x96e9('0xd')](_0x96e9('0xe'),_0x3e7a5c,_0x96e9('0xf'));logger['debug'](_0x96e9('0x10'),_0x3e7a5c,_0x96e9('0xf'),JSON[_0x96e9('0x11')](_0x563843));if(_0x563843[_0x96e9('0x12')]){if(_0x563843[_0x96e9('0x12')][_0x96e9('0x13')]===0x1f4){logger['error'](_0x96e9('0xe'),_0x3e7a5c,_0x563843[_0x96e9('0x12')][_0x96e9('0x14')]);return _0x5aede3(_0x563843[_0x96e9('0x12')][_0x96e9('0x14')]);}logger[_0x96e9('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x3e7a5c,_0x563843[_0x96e9('0x12')][_0x96e9('0x14')]);return _0x3424a6(_0x563843[_0x96e9('0x12')][_0x96e9('0x14')]);}else{logger[_0x96e9('0xd')](_0x96e9('0xe'),_0x3e7a5c,_0x96e9('0xf'));_0x3424a6(_0x563843[_0x96e9('0x15')]['message']);}})[_0x96e9('0x16')](function(_0x2f324f){logger[_0x96e9('0x12')](_0x96e9('0xe'),_0x3e7a5c,_0x2f324f);_0x5aede3(_0x2f324f);});});}
\ No newline at end of file
index e2af5c0..200d52c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2e0=['../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','/:id','show','post','put','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x5752ca,_0x10247e){var _0x3826de=function(_0x5027f8){while(--_0x5027f8){_0x5752ca['push'](_0x5752ca['shift']());}};_0x3826de(++_0x10247e);}(_0xf2e0,0xc7));var _0x0f2e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xf2e0[_0x9df060];return _0x338dfe;};'use strict';var multer=require(_0x0f2e('0x0'));var util=require(_0x0f2e('0x1'));var path=require('path');var timeout=require(_0x0f2e('0x2'));var express=require(_0x0f2e('0x3'));var router=express['Router']();var fs_extra=require(_0x0f2e('0x4'));var auth=require(_0x0f2e('0x5'));var interaction=require(_0x0f2e('0x6'));var config=require('../../config/environment');var controller=require(_0x0f2e('0x7'));router[_0x0f2e('0x8')]('/',auth[_0x0f2e('0x9')](),controller['index']);router['get'](_0x0f2e('0xa'),auth['isAuthenticated'](),controller[_0x0f2e('0xb')]);router[_0x0f2e('0xc')]('/',auth[_0x0f2e('0x9')](),controller['create']);router[_0x0f2e('0xd')](_0x0f2e('0xa'),auth[_0x0f2e('0x9')](),controller['update']);router[_0x0f2e('0xe')](_0x0f2e('0xa'),auth['isAuthenticated'](),controller[_0x0f2e('0xf')]);module[_0x0f2e('0x10')]=router;
\ No newline at end of file
+var _0xb6f1=['multer','path','express','Router','fs-extra','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','/:id','show','create','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb6f1,0x118));var _0x1b6f=function(_0x4ba380,_0x259bee){_0x4ba380=_0x4ba380-0x0;var _0x4b111b=_0xb6f1[_0x4ba380];return _0x4b111b;};'use strict';var multer=require(_0x1b6f('0x0'));var util=require('util');var path=require(_0x1b6f('0x1'));var timeout=require('connect-timeout');var express=require(_0x1b6f('0x2'));var router=express[_0x1b6f('0x3')]();var fs_extra=require(_0x1b6f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1b6f('0x5'));var config=require('../../config/environment');var controller=require(_0x1b6f('0x6'));router[_0x1b6f('0x7')]('/',auth[_0x1b6f('0x8')](),controller['index']);router['get'](_0x1b6f('0x9'),auth[_0x1b6f('0x8')](),controller[_0x1b6f('0xa')]);router['post']('/',auth[_0x1b6f('0x8')](),controller[_0x1b6f('0xb')]);router['put'](_0x1b6f('0x9'),auth[_0x1b6f('0x8')](),controller[_0x1b6f('0xc')]);router[_0x1b6f('0xd')](_0x1b6f('0x9'),auth[_0x1b6f('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index a8e52fc..16aaaf7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb894=['sequelize','TEXT'];(function(_0x1b4002,_0x5b4094){var _0x1716f3=function(_0x47cfd1){while(--_0x47cfd1){_0x1b4002['push'](_0x1b4002['shift']());}};_0x1716f3(++_0x5b4094);}(_0xb894,0xf0));var _0x4b89=function(_0x562653,_0x54a310){_0x562653=_0x562653-0x0;var _0x119cef=_0xb894[_0x562653];return _0x119cef;};'use strict';var Sequelize=require(_0x4b89('0x0'));module['exports']={'tree':{'type':Sequelize[_0x4b89('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xfb92=['TEXT','sequelize'];(function(_0x19e094,_0x5a6b1d){var _0x114744=function(_0x115632){while(--_0x115632){_0x19e094['push'](_0x19e094['shift']());}};_0x114744(++_0x5a6b1d);}(_0xfb92,0x1e3));var _0x2fb9=function(_0x2ad3c8,_0xeb9896){_0x2ad3c8=_0x2ad3c8-0x0;var _0x316a84=_0xfb92[_0x2ad3c8];return _0x316a84;};'use strict';var Sequelize=require(_0x2fb9('0x0'));module['exports']={'tree':{'type':Sequelize[_0x2fb9('0x1')],'allowNull':![]}};
\ No newline at end of file
index bc8b4b0..ba6279f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ecf=['save','update','destroy','sendStatus','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','AnalyticTreeReport','then','includeAll','findAll','rows','params','include','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','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','status','end','offset','undefined','limit','count','set','json','apply','reject'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x7ecf,0x6e));var _0xf7ec=function(_0x55d17e,_0x5a2b81){_0x55d17e=_0x55d17e-0x0;var _0x32f505=_0x7ecf[_0x55d17e];return _0x32f505;};'use strict';var emlformat=require(_0xf7ec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf7ec('0x1'));var jsonpatch=require(_0xf7ec('0x2'));var rp=require(_0xf7ec('0x3'));var moment=require('moment');var BPromise=require(_0xf7ec('0x4'));var Mustache=require('mustache');var util=require(_0xf7ec('0x5'));var path=require(_0xf7ec('0x6'));var sox=require(_0xf7ec('0x7'));var csv=require(_0xf7ec('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf7ec('0x9'));var _=require(_0xf7ec('0xa'));var squel=require(_0xf7ec('0xb'));var crypto=require(_0xf7ec('0xc'));var jsforce=require(_0xf7ec('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf7ec('0x8'));var querystring=require(_0xf7ec('0xe'));var Papa=require(_0xf7ec('0xf'));var Redis=require('ioredis');var authService=require(_0xf7ec('0x10'));var qs=require(_0xf7ec('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf7ec('0x12'));var logger=require(_0xf7ec('0x13'))(_0xf7ec('0x14'));var utils=require(_0xf7ec('0x15'));var config=require(_0xf7ec('0x16'));var licenseUtil=require(_0xf7ec('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcc8179,_0x1573fa){_0x1573fa=_0x1573fa||0xcc;return function(_0x41e5d7){if(_0x41e5d7){return _0xcc8179['sendStatus'](_0x1573fa);}return _0xcc8179[_0xf7ec('0x18')](_0x1573fa)[_0xf7ec('0x19')]();};}function respondWithResult(_0x5ac48b,_0x5df32f){_0x5df32f=_0x5df32f||0xc8;return function(_0x3ee664){if(_0x3ee664){return _0x5ac48b[_0xf7ec('0x18')](_0x5df32f)['json'](_0x3ee664);}};}function respondWithFilteredResult(_0x2f8f5c,_0x537017){return function(_0x4b5ae2){if(_0x4b5ae2){var _0x4fdf01=typeof _0x537017[_0xf7ec('0x1a')]===_0xf7ec('0x1b')&&typeof _0x537017[_0xf7ec('0x1c')]==='undefined';var _0x2cfd07=_0x4b5ae2['count'];var _0x29a494=_0x4fdf01?0x0:_0x537017[_0xf7ec('0x1a')];var _0x50f2ea=_0x4fdf01?_0x4b5ae2[_0xf7ec('0x1d')]:_0x537017[_0xf7ec('0x1a')]+_0x537017[_0xf7ec('0x1c')];var _0x1ea77e;if(_0x50f2ea>=_0x2cfd07){_0x50f2ea=_0x2cfd07;_0x1ea77e=0xc8;}else{_0x1ea77e=0xce;}_0x2f8f5c['status'](_0x1ea77e);return _0x2f8f5c[_0xf7ec('0x1e')]('Content-Range',_0x29a494+'-'+_0x50f2ea+'/'+_0x2cfd07)[_0xf7ec('0x1f')](_0x4b5ae2);}return null;};}function patchUpdates(_0x16bfdc){return function(_0x54552e){try{jsonpatch[_0xf7ec('0x20')](_0x54552e,_0x16bfdc,!![]);}catch(_0x4c98f1){return BPromise[_0xf7ec('0x21')](_0x4c98f1);}return _0x54552e[_0xf7ec('0x22')]();};}function saveUpdates(_0x320e3c,_0x30fc17){return function(_0x43aa1b){if(_0x43aa1b){return _0x43aa1b[_0xf7ec('0x23')](_0x320e3c)['then'](function(_0x2795a9){return _0x2795a9;});}return null;};}function removeEntity(_0xfc3723,_0x23ad02){return function(_0x1d79c8){if(_0x1d79c8){return _0x1d79c8[_0xf7ec('0x24')]()['then'](function(){_0xfc3723[_0xf7ec('0x18')](0xcc)[_0xf7ec('0x19')]();});}};}function handleEntityNotFound(_0x3afb02,_0x54a082){return function(_0x5b590e){if(!_0x5b590e){_0x3afb02[_0xf7ec('0x25')](0x194);}return _0x5b590e;};}function handleError(_0x5ec615,_0x35efe1){_0x35efe1=_0x35efe1||0x1f4;return function(_0x182224){logger['error'](_0x182224['stack']);if(_0x182224[_0xf7ec('0x26')]){delete _0x182224[_0xf7ec('0x26')];}_0x5ec615[_0xf7ec('0x18')](_0x35efe1)[_0xf7ec('0x27')](_0x182224);};}exports[_0xf7ec('0x28')]=function(_0x5aa8e6,_0x38cd4e){var _0x3a0684={},_0x1e4517={},_0x4930c0={'count':0x0,'rows':[]};var _0x1cd47c=_[_0xf7ec('0x29')](db['AnalyticTreeReport'][_0xf7ec('0x2a')],function(_0x257344){return{'name':_0x257344['fieldName'],'type':_0x257344[_0xf7ec('0x2b')][_0xf7ec('0x2c')]};});_0x1e4517[_0xf7ec('0x2d')]=_[_0xf7ec('0x29')](_0x1cd47c,'name');_0x1e4517[_0xf7ec('0x2e')]=_[_0xf7ec('0x2f')](_0x5aa8e6[_0xf7ec('0x2e')]);_0x1e4517[_0xf7ec('0x30')]=_[_0xf7ec('0x31')](_0x1e4517[_0xf7ec('0x2d')],_0x1e4517[_0xf7ec('0x2e')]);_0x3a0684[_0xf7ec('0x32')]=_[_0xf7ec('0x31')](_0x1e4517['model'],qs[_0xf7ec('0x33')](_0x5aa8e6[_0xf7ec('0x2e')][_0xf7ec('0x33')]));_0x3a0684['attributes']=_0x3a0684[_0xf7ec('0x32')][_0xf7ec('0x34')]?_0x3a0684[_0xf7ec('0x32')]:_0x1e4517[_0xf7ec('0x2d')];if(!_0x5aa8e6[_0xf7ec('0x2e')][_0xf7ec('0x35')](_0xf7ec('0x36'))){_0x3a0684[_0xf7ec('0x1c')]=qs[_0xf7ec('0x1c')](_0x5aa8e6[_0xf7ec('0x2e')][_0xf7ec('0x1c')]);_0x3a0684[_0xf7ec('0x1a')]=qs[_0xf7ec('0x1a')](_0x5aa8e6['query']['offset']);}_0x3a0684[_0xf7ec('0x37')]=qs[_0xf7ec('0x38')](_0x5aa8e6[_0xf7ec('0x2e')]['sort']);_0x3a0684[_0xf7ec('0x39')]=qs[_0xf7ec('0x30')](_[_0xf7ec('0x3a')](_0x5aa8e6[_0xf7ec('0x2e')],_0x1e4517[_0xf7ec('0x30')]),_0x1cd47c);if(_0x5aa8e6['query'][_0xf7ec('0x3b')]){_0x3a0684[_0xf7ec('0x39')]=_[_0xf7ec('0x3c')](_0x3a0684['where'],{'$or':_['map'](_0x1cd47c,function(_0x4373da){if(_0x4373da[_0xf7ec('0x2b')]!=='VIRTUAL'){var _0x2534a3={};_0x2534a3[_0x4373da[_0xf7ec('0x26')]]={'$like':'%'+_0x5aa8e6[_0xf7ec('0x2e')][_0xf7ec('0x3b')]+'%'};return _0x2534a3;}})});}_0x3a0684=_[_0xf7ec('0x3c')]({},_0x3a0684,_0x5aa8e6['options']);var _0x280bf9={'where':_0x3a0684[_0xf7ec('0x39')]};return db[_0xf7ec('0x3d')][_0xf7ec('0x1d')](_0x280bf9)[_0xf7ec('0x3e')](function(_0x42dd88){_0x4930c0[_0xf7ec('0x1d')]=_0x42dd88;if(_0x5aa8e6['query'][_0xf7ec('0x3f')]){_0x3a0684['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xf7ec('0x40')](_0x3a0684);})[_0xf7ec('0x3e')](function(_0xc96f26){_0x4930c0[_0xf7ec('0x41')]=_0xc96f26;return _0x4930c0;})['then'](respondWithFilteredResult(_0x38cd4e,_0x3a0684))['catch'](handleError(_0x38cd4e,null));};exports['show']=function(_0x5ecdb6,_0x11ea74){var _0x149570={'raw':!![],'where':{'id':_0x5ecdb6[_0xf7ec('0x42')]['id']}},_0x45f86a={};_0x45f86a[_0xf7ec('0x2d')]=_[_0xf7ec('0x2f')](db[_0xf7ec('0x3d')][_0xf7ec('0x2a')]);_0x45f86a[_0xf7ec('0x2e')]=_[_0xf7ec('0x2f')](_0x5ecdb6['query']);_0x45f86a[_0xf7ec('0x30')]=_[_0xf7ec('0x31')](_0x45f86a[_0xf7ec('0x2d')],_0x45f86a[_0xf7ec('0x2e')]);_0x149570['attributes']=_[_0xf7ec('0x31')](_0x45f86a['model'],qs['fields'](_0x5ecdb6['query'][_0xf7ec('0x33')]));_0x149570['attributes']=_0x149570[_0xf7ec('0x32')][_0xf7ec('0x34')]?_0x149570[_0xf7ec('0x32')]:_0x45f86a['model'];if(_0x5ecdb6[_0xf7ec('0x2e')][_0xf7ec('0x3f')]){_0x149570[_0xf7ec('0x43')]=[{'all':!![]}];}_0x149570=_[_0xf7ec('0x3c')]({},_0x149570,_0x5ecdb6['options']);return db[_0xf7ec('0x3d')][_0xf7ec('0x44')](_0x149570)[_0xf7ec('0x3e')](handleEntityNotFound(_0x11ea74,null))[_0xf7ec('0x3e')](respondWithResult(_0x11ea74,null))[_0xf7ec('0x45')](handleError(_0x11ea74,null));};exports[_0xf7ec('0x46')]=function(_0x4bf0fa,_0x5d6104){return db[_0xf7ec('0x3d')]['create'](_0x4bf0fa[_0xf7ec('0x47')],{})[_0xf7ec('0x3e')](respondWithResult(_0x5d6104,0xc9))['catch'](handleError(_0x5d6104,null));};exports['update']=function(_0x61a290,_0x358076){if(_0x61a290[_0xf7ec('0x47')]['id']){delete _0x61a290[_0xf7ec('0x47')]['id'];}return db[_0xf7ec('0x3d')][_0xf7ec('0x44')]({'where':{'id':_0x61a290['params']['id']}})[_0xf7ec('0x3e')](handleEntityNotFound(_0x358076,null))['then'](saveUpdates(_0x61a290[_0xf7ec('0x47')],null))[_0xf7ec('0x3e')](respondWithResult(_0x358076,null))[_0xf7ec('0x45')](handleError(_0x358076,null));};exports[_0xf7ec('0x24')]=function(_0x2fb930,_0x5ba60f){return db[_0xf7ec('0x3d')][_0xf7ec('0x44')]({'where':{'id':_0x2fb930[_0xf7ec('0x42')]['id']}})[_0xf7ec('0x3e')](handleEntityNotFound(_0x5ba60f,null))[_0xf7ec('0x3e')](removeEntity(_0x5ba60f,null))['catch'](handleError(_0x5ba60f,null));};
\ No newline at end of file
+var _0x6aff=['Content-Range','update','destroy','then','stack','name','send','map','AnalyticTreeReport','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','params','length','includeAll','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x10df5c,_0x14c714){var _0x9fcba6=function(_0x4d4554){while(--_0x4d4554){_0x10df5c['push'](_0x10df5c['shift']());}};_0x9fcba6(++_0x14c714);}(_0x6aff,0x6a));var _0xf6af=function(_0x2c3238,_0x57f237){_0x2c3238=_0x2c3238-0x0;var _0x4380a3=_0x6aff[_0x2c3238];return _0x4380a3;};'use strict';var emlformat=require(_0xf6af('0x0'));var rimraf=require(_0xf6af('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf6af('0x2'));var rp=require(_0xf6af('0x3'));var moment=require(_0xf6af('0x4'));var BPromise=require(_0xf6af('0x5'));var Mustache=require('mustache');var util=require(_0xf6af('0x6'));var path=require('path');var sox=require(_0xf6af('0x7'));var csv=require(_0xf6af('0x8'));var ejs=require(_0xf6af('0x9'));var fs=require('fs');var fs_extra=require(_0xf6af('0xa'));var _=require('lodash');var squel=require(_0xf6af('0xb'));var crypto=require(_0xf6af('0xc'));var jsforce=require(_0xf6af('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf6af('0x8'));var querystring=require(_0xf6af('0xe'));var Papa=require('papaparse');var Redis=require(_0xf6af('0xf'));var authService=require(_0xf6af('0x10'));var qs=require(_0xf6af('0x11'));var as=require(_0xf6af('0x12'));var hardwareService=require(_0xf6af('0x13'));var logger=require('../../config/logger')(_0xf6af('0x14'));var utils=require(_0xf6af('0x15'));var config=require(_0xf6af('0x16'));var licenseUtil=require(_0xf6af('0x17'));var db=require(_0xf6af('0x18'))['db'];function respondWithStatusCode(_0x254a70,_0x47e184){_0x47e184=_0x47e184||0xcc;return function(_0x4fc4ed){if(_0x4fc4ed){return _0x254a70[_0xf6af('0x19')](_0x47e184);}return _0x254a70[_0xf6af('0x1a')](_0x47e184)[_0xf6af('0x1b')]();};}function respondWithResult(_0x340ea9,_0x3bc722){_0x3bc722=_0x3bc722||0xc8;return function(_0x1287e6){if(_0x1287e6){return _0x340ea9[_0xf6af('0x1a')](_0x3bc722)[_0xf6af('0x1c')](_0x1287e6);}};}function respondWithFilteredResult(_0x25d86e,_0x429b6e){return function(_0x2e164d){if(_0x2e164d){var _0x552ddb=typeof _0x429b6e[_0xf6af('0x1d')]===_0xf6af('0x1e')&&typeof _0x429b6e[_0xf6af('0x1f')]==='undefined';var _0x1bf765=_0x2e164d[_0xf6af('0x20')];var _0x30bfd8=_0x552ddb?0x0:_0x429b6e[_0xf6af('0x1d')];var _0x4b2eb1=_0x552ddb?_0x2e164d[_0xf6af('0x20')]:_0x429b6e[_0xf6af('0x1d')]+_0x429b6e['limit'];var _0x4b2825;if(_0x4b2eb1>=_0x1bf765){_0x4b2eb1=_0x1bf765;_0x4b2825=0xc8;}else{_0x4b2825=0xce;}_0x25d86e[_0xf6af('0x1a')](_0x4b2825);return _0x25d86e[_0xf6af('0x21')](_0xf6af('0x22'),_0x30bfd8+'-'+_0x4b2eb1+'/'+_0x1bf765)[_0xf6af('0x1c')](_0x2e164d);}return null;};}function patchUpdates(_0x5e2cb){return function(_0x362a2c){try{jsonpatch['apply'](_0x362a2c,_0x5e2cb,!![]);}catch(_0x380e8d){return BPromise['reject'](_0x380e8d);}return _0x362a2c['save']();};}function saveUpdates(_0x551ad9,_0x5b5eed){return function(_0x8f6ca4){if(_0x8f6ca4){return _0x8f6ca4[_0xf6af('0x23')](_0x551ad9)['then'](function(_0x209aa8){return _0x209aa8;});}return null;};}function removeEntity(_0x53718b,_0x1c139a){return function(_0x470e4a){if(_0x470e4a){return _0x470e4a[_0xf6af('0x24')]()[_0xf6af('0x25')](function(){_0x53718b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x571f32,_0xaa4846){return function(_0x27c9cc){if(!_0x27c9cc){_0x571f32['sendStatus'](0x194);}return _0x27c9cc;};}function handleError(_0x54da90,_0x4db5a7){_0x4db5a7=_0x4db5a7||0x1f4;return function(_0x3fe9de){logger['error'](_0x3fe9de[_0xf6af('0x26')]);if(_0x3fe9de[_0xf6af('0x27')]){delete _0x3fe9de['name'];}_0x54da90[_0xf6af('0x1a')](_0x4db5a7)[_0xf6af('0x28')](_0x3fe9de);};}exports['index']=function(_0xf103d0,_0x401167){var _0x14b163={},_0x315c8f={},_0x509261={'count':0x0,'rows':[]};var _0x544e09=_[_0xf6af('0x29')](db[_0xf6af('0x2a')]['rawAttributes'],function(_0x47eaa1){return{'name':_0x47eaa1['fieldName'],'type':_0x47eaa1[_0xf6af('0x2b')]['key']};});_0x315c8f[_0xf6af('0x2c')]=_['map'](_0x544e09,_0xf6af('0x27'));_0x315c8f[_0xf6af('0x2d')]=_[_0xf6af('0x2e')](_0xf103d0[_0xf6af('0x2d')]);_0x315c8f[_0xf6af('0x2f')]=_[_0xf6af('0x30')](_0x315c8f[_0xf6af('0x2c')],_0x315c8f[_0xf6af('0x2d')]);_0x14b163[_0xf6af('0x31')]=_[_0xf6af('0x30')](_0x315c8f[_0xf6af('0x2c')],qs[_0xf6af('0x32')](_0xf103d0['query'][_0xf6af('0x32')]));_0x14b163[_0xf6af('0x31')]=_0x14b163['attributes']['length']?_0x14b163[_0xf6af('0x31')]:_0x315c8f[_0xf6af('0x2c')];if(!_0xf103d0[_0xf6af('0x2d')][_0xf6af('0x33')](_0xf6af('0x34'))){_0x14b163[_0xf6af('0x1f')]=qs[_0xf6af('0x1f')](_0xf103d0[_0xf6af('0x2d')][_0xf6af('0x1f')]);_0x14b163[_0xf6af('0x1d')]=qs[_0xf6af('0x1d')](_0xf103d0[_0xf6af('0x2d')][_0xf6af('0x1d')]);}_0x14b163['order']=qs[_0xf6af('0x35')](_0xf103d0[_0xf6af('0x2d')][_0xf6af('0x35')]);_0x14b163['where']=qs[_0xf6af('0x2f')](_[_0xf6af('0x36')](_0xf103d0[_0xf6af('0x2d')],_0x315c8f[_0xf6af('0x2f')]),_0x544e09);if(_0xf103d0[_0xf6af('0x2d')][_0xf6af('0x37')]){_0x14b163[_0xf6af('0x38')]=_['merge'](_0x14b163['where'],{'$or':_[_0xf6af('0x29')](_0x544e09,function(_0x92eddf){if(_0x92eddf[_0xf6af('0x2b')]!==_0xf6af('0x39')){var _0x51e13b={};_0x51e13b[_0x92eddf[_0xf6af('0x27')]]={'$like':'%'+_0xf103d0['query'][_0xf6af('0x37')]+'%'};return _0x51e13b;}})});}_0x14b163=_[_0xf6af('0x3a')]({},_0x14b163,_0xf103d0[_0xf6af('0x3b')]);var _0x4188b1={'where':_0x14b163[_0xf6af('0x38')]};return db[_0xf6af('0x2a')][_0xf6af('0x20')](_0x4188b1)['then'](function(_0x1b66a7){_0x509261['count']=_0x1b66a7;if(_0xf103d0[_0xf6af('0x2d')]['includeAll']){_0x14b163[_0xf6af('0x3c')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xf6af('0x3d')](_0x14b163);})[_0xf6af('0x25')](function(_0x11a7cc){_0x509261[_0xf6af('0x3e')]=_0x11a7cc;return _0x509261;})[_0xf6af('0x25')](respondWithFilteredResult(_0x401167,_0x14b163))[_0xf6af('0x3f')](handleError(_0x401167,null));};exports['show']=function(_0x1f900f,_0x454e7d){var _0x219732={'raw':!![],'where':{'id':_0x1f900f[_0xf6af('0x40')]['id']}},_0x2d9dbb={};_0x2d9dbb[_0xf6af('0x2c')]=_[_0xf6af('0x2e')](db[_0xf6af('0x2a')]['rawAttributes']);_0x2d9dbb['query']=_[_0xf6af('0x2e')](_0x1f900f['query']);_0x2d9dbb[_0xf6af('0x2f')]=_[_0xf6af('0x30')](_0x2d9dbb[_0xf6af('0x2c')],_0x2d9dbb[_0xf6af('0x2d')]);_0x219732[_0xf6af('0x31')]=_['intersection'](_0x2d9dbb[_0xf6af('0x2c')],qs['fields'](_0x1f900f[_0xf6af('0x2d')]['fields']));_0x219732[_0xf6af('0x31')]=_0x219732[_0xf6af('0x31')][_0xf6af('0x41')]?_0x219732[_0xf6af('0x31')]:_0x2d9dbb[_0xf6af('0x2c')];if(_0x1f900f[_0xf6af('0x2d')][_0xf6af('0x42')]){_0x219732[_0xf6af('0x3c')]=[{'all':!![]}];}_0x219732=_[_0xf6af('0x3a')]({},_0x219732,_0x1f900f[_0xf6af('0x3b')]);return db[_0xf6af('0x2a')]['find'](_0x219732)[_0xf6af('0x25')](handleEntityNotFound(_0x454e7d,null))[_0xf6af('0x25')](respondWithResult(_0x454e7d,null))[_0xf6af('0x3f')](handleError(_0x454e7d,null));};exports[_0xf6af('0x43')]=function(_0x5bb1e6,_0x2b0607){return db['AnalyticTreeReport'][_0xf6af('0x43')](_0x5bb1e6[_0xf6af('0x44')],{})[_0xf6af('0x25')](respondWithResult(_0x2b0607,0xc9))[_0xf6af('0x3f')](handleError(_0x2b0607,null));};exports[_0xf6af('0x23')]=function(_0x3887ec,_0x1a2d9b){if(_0x3887ec[_0xf6af('0x44')]['id']){delete _0x3887ec[_0xf6af('0x44')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x3887ec[_0xf6af('0x40')]['id']}})['then'](handleEntityNotFound(_0x1a2d9b,null))['then'](saveUpdates(_0x3887ec[_0xf6af('0x44')],null))[_0xf6af('0x25')](respondWithResult(_0x1a2d9b,null))['catch'](handleError(_0x1a2d9b,null));};exports[_0xf6af('0x24')]=function(_0x155f5d,_0x4b51c4){return db['AnalyticTreeReport'][_0xf6af('0x45')]({'where':{'id':_0x155f5d[_0xf6af('0x40')]['id']}})['then'](handleEntityNotFound(_0x4b51c4,null))[_0xf6af('0x25')](removeEntity(_0x4b51c4,null))[_0xf6af('0x3f')](handleError(_0x4b51c4,null));};
\ No newline at end of file
index d496018..37c6ddc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x000c=['request-promise','rimraf','./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x000c,0x72));var _0xc000=function(_0x4d46c1,_0x1eccf0){_0x4d46c1=_0x4d46c1-0x0;var _0x34a33b=_0x000c[_0x4d46c1];return _0x34a33b;};'use strict';var _=require(_0xc000('0x0'));var util=require(_0xc000('0x1'));var logger=require(_0xc000('0x2'))(_0xc000('0x3'));var moment=require(_0xc000('0x4'));var BPromise=require(_0xc000('0x5'));var rp=require(_0xc000('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc000('0x7'));var config=require('../../config/environment');var attributes=require(_0xc000('0x8'));module[_0xc000('0x9')]=function(_0x17cf87,_0x9880f4){return _0x17cf87[_0xc000('0xa')]('AnalyticTreeReport',attributes,{'tableName':_0xc000('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7633=['../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees','lodash','util','bluebird','path','rimraf'];(function(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0x7633,0x195));var _0x3763=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x7633[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x3763('0x0'));var util=require(_0x3763('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x3763('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3763('0x3'));var rimraf=require(_0x3763('0x4'));var config=require(_0x3763('0x5'));var attributes=require(_0x3763('0x6'));module[_0x3763('0x7')]=function(_0x4a70e3,_0x113467){return _0x4a70e3['define'](_0x3763('0x8'),attributes,{'tableName':_0x3763('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e7a989e..5d4ea15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\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(_0x3317d5,_0x5068b7){var _0x4471ed=function(_0x28a066){while(--_0x28a066){_0x3317d5['push'](_0x3317d5['shift']());}};_0x4471ed(++_0x5068b7);}(_0x1261,0x144));var _0x1126=function(_0x138d06,_0x33edf2){_0x138d06=_0x138d06-0x0;var _0x1a01eb=_0x1261[_0x138d06];return _0x1a01eb;};'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')]('AnalyticTreeReport,\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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x58800b,_0x2f6bba){var _0x53d0d8=function(_0x35f999){while(--_0x35f999){_0x58800b['push'](_0x58800b['shift']());}};_0x53d0d8(++_0x2f6bba);}(_0x5f2f,0x73));var _0xf5f2=function(_0x37ca3b,_0x116dad){_0x37ca3b=_0x37ca3b-0x0;var _0x5c2cf1=_0x5f2f[_0x37ca3b];return _0x5c2cf1;};'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')]('AnalyticTreeReport,\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);});});}
\ No newline at end of file
index d401b3c..94a20fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4864=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show','post','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4090cd,_0x55a2f0){var _0x522fbe=function(_0x2e1c6c){while(--_0x2e1c6c){_0x4090cd['push'](_0x4090cd['shift']());}};_0x522fbe(++_0x55a2f0);}(_0x4864,0x188));var _0x4486=function(_0x27c248,_0x384dff){_0x27c248=_0x27c248-0x0;var _0x1b2fc2=_0x4864[_0x27c248];return _0x1b2fc2;};'use strict';var multer=require(_0x4486('0x0'));var util=require(_0x4486('0x1'));var path=require(_0x4486('0x2'));var timeout=require(_0x4486('0x3'));var express=require(_0x4486('0x4'));var router=express[_0x4486('0x5')]();var fs_extra=require(_0x4486('0x6'));var auth=require(_0x4486('0x7'));var interaction=require(_0x4486('0x8'));var config=require(_0x4486('0x9'));var controller=require(_0x4486('0xa'));router[_0x4486('0xb')]('/',auth[_0x4486('0xc')](),controller['index']);router[_0x4486('0xb')](_0x4486('0xd'),auth[_0x4486('0xc')](),controller[_0x4486('0xe')]);router[_0x4486('0xf')]('/',auth[_0x4486('0xc')](),controller['create']);router['put'](_0x4486('0xd'),auth[_0x4486('0xc')](),controller[_0x4486('0x10')]);router['delete'](_0x4486('0xd'),auth[_0x4486('0xc')](),controller[_0x4486('0x11')]);module[_0x4486('0x12')]=router;
\ No newline at end of file
+var _0xcc40=['show','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get'];(function(_0x2e3107,_0x25f970){var _0x833d69=function(_0x420e78){while(--_0x420e78){_0x2e3107['push'](_0x2e3107['shift']());}};_0x833d69(++_0x25f970);}(_0xcc40,0x15d));var _0x0cc4=function(_0x3ce6f5,_0x29c4ae){_0x3ce6f5=_0x3ce6f5-0x0;var _0x2844a6=_0xcc40[_0x3ce6f5];return _0x2844a6;};'use strict';var multer=require(_0x0cc4('0x0'));var util=require('util');var path=require(_0x0cc4('0x1'));var timeout=require(_0x0cc4('0x2'));var express=require(_0x0cc4('0x3'));var router=express[_0x0cc4('0x4')]();var fs_extra=require(_0x0cc4('0x5'));var auth=require(_0x0cc4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0cc4('0x7'));var controller=require(_0x0cc4('0x8'));router['get']('/',auth[_0x0cc4('0x9')](),controller[_0x0cc4('0xa')]);router[_0x0cc4('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x0cc4('0xc')]);router['post']('/',auth[_0x0cc4('0x9')](),controller['create']);router[_0x0cc4('0xd')]('/:id',auth[_0x0cc4('0x9')](),controller[_0x0cc4('0xe')]);router[_0x0cc4('0xf')](_0x0cc4('0x10'),auth['isAuthenticated'](),controller[_0x0cc4('0x11')]);module[_0x0cc4('0x12')]=router;
\ No newline at end of file
index d16f0b2..6091e0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb32d=['sequelize','exports','STRING'];(function(_0x4667ec,_0x593a64){var _0x2126c8=function(_0x414d0a){while(--_0x414d0a){_0x4667ec['push'](_0x4667ec['shift']());}};_0x2126c8(++_0x593a64);}(_0xb32d,0x1da));var _0xdb32=function(_0x48845d,_0x4338c2){_0x48845d=_0x48845d-0x0;var _0x5bad7d=_0xb32d[_0x48845d];return _0x5bad7d;};'use strict';var Sequelize=require(_0xdb32('0x0'));module[_0xdb32('0x1')]={'name':{'type':Sequelize[_0xdb32('0x2')]},'basename':{'type':Sequelize[_0xdb32('0x2')]},'type':{'type':Sequelize[_0xdb32('0x2')]}};
\ No newline at end of file
+var _0xff96=['exports','STRING','sequelize'];(function(_0x1d7037,_0x57dd95){var _0x4d6568=function(_0x5c64c5){while(--_0x5c64c5){_0x1d7037['push'](_0x1d7037['shift']());}};_0x4d6568(++_0x57dd95);}(_0xff96,0x179));var _0x6ff9=function(_0x41f882,_0x360760){_0x41f882=_0x41f882-0x0;var _0x402761=_0xff96[_0x41f882];return _0x402761;};'use strict';var Sequelize=require(_0x6ff9('0x0'));module[_0x6ff9('0x1')]={'name':{'type':Sequelize[_0x6ff9('0x2')]},'basename':{'type':Sequelize[_0x6ff9('0x2')]},'type':{'type':Sequelize[_0x6ff9('0x2')]}};
\ No newline at end of file
index 09f32e3..a1ddd54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa95d=['error','stack','name','send','map','Attachment','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','length','options','find','catch','get','omit','body','createdAt','updatedAt','create','file','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','update','then'];(function(_0x4b9000,_0x4b9d03){var _0x1c8f5d=function(_0xba2b0c){while(--_0xba2b0c){_0x4b9000['push'](_0x4b9000['shift']());}};_0x1c8f5d(++_0x4b9d03);}(_0xa95d,0x88));var _0xda95=function(_0x27af80,_0x396b70){_0x27af80=_0x27af80-0x0;var _0x855bc7=_0xa95d[_0x27af80];return _0x855bc7;};'use strict';var emlformat=require(_0xda95('0x0'));var rimraf=require(_0xda95('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xda95('0x2'));var moment=require(_0xda95('0x3'));var BPromise=require(_0xda95('0x4'));var Mustache=require('mustache');var util=require(_0xda95('0x5'));var path=require(_0xda95('0x6'));var sox=require(_0xda95('0x7'));var csv=require('to-csv');var ejs=require(_0xda95('0x8'));var fs=require('fs');var fs_extra=require(_0xda95('0x9'));var _=require('lodash');var squel=require(_0xda95('0xa'));var crypto=require('crypto');var jsforce=require(_0xda95('0xb'));var deskjs=require(_0xda95('0xc'));var toCsv=require('to-csv');var querystring=require(_0xda95('0xd'));var Papa=require(_0xda95('0xe'));var Redis=require(_0xda95('0xf'));var authService=require(_0xda95('0x10'));var qs=require(_0xda95('0x11'));var as=require(_0xda95('0x12'));var hardwareService=require(_0xda95('0x13'));var logger=require(_0xda95('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xda95('0x15'))['db'];function respondWithStatusCode(_0x22d2dd,_0x362c10){_0x362c10=_0x362c10||0xcc;return function(_0x3dba47){if(_0x3dba47){return _0x22d2dd[_0xda95('0x16')](_0x362c10);}return _0x22d2dd[_0xda95('0x17')](_0x362c10)[_0xda95('0x18')]();};}function respondWithResult(_0xb1b803,_0x462de7){_0x462de7=_0x462de7||0xc8;return function(_0x40aba4){if(_0x40aba4){return _0xb1b803[_0xda95('0x17')](_0x462de7)[_0xda95('0x19')](_0x40aba4);}};}function respondWithFilteredResult(_0x826162,_0x32d45d){return function(_0x7da6e0){if(_0x7da6e0){var _0x415e9c=typeof _0x32d45d[_0xda95('0x1a')]==='undefined'&&typeof _0x32d45d[_0xda95('0x1b')]==='undefined';var _0x1fdd05=_0x7da6e0[_0xda95('0x1c')];var _0x43a32a=_0x415e9c?0x0:_0x32d45d[_0xda95('0x1a')];var _0x1f918c=_0x415e9c?_0x7da6e0['count']:_0x32d45d[_0xda95('0x1a')]+_0x32d45d[_0xda95('0x1b')];var _0x27cf7c;if(_0x1f918c>=_0x1fdd05){_0x1f918c=_0x1fdd05;_0x27cf7c=0xc8;}else{_0x27cf7c=0xce;}_0x826162[_0xda95('0x17')](_0x27cf7c);return _0x826162[_0xda95('0x1d')]('Content-Range',_0x43a32a+'-'+_0x1f918c+'/'+_0x1fdd05)[_0xda95('0x19')](_0x7da6e0);}return null;};}function patchUpdates(_0x1c0d3e){return function(_0x22fd9d){try{jsonpatch[_0xda95('0x1e')](_0x22fd9d,_0x1c0d3e,!![]);}catch(_0x426103){return BPromise[_0xda95('0x1f')](_0x426103);}return _0x22fd9d['save']();};}function saveUpdates(_0x226a49,_0x305f97){return function(_0x1ff26b){if(_0x1ff26b){return _0x1ff26b[_0xda95('0x20')](_0x226a49)['then'](function(_0x2497af){return _0x2497af;});}return null;};}function removeEntity(_0x1b58b8,_0x479a6a){return function(_0x41a649){if(_0x41a649){return _0x41a649['destroy']()[_0xda95('0x21')](function(){_0x1b58b8[_0xda95('0x17')](0xcc)[_0xda95('0x18')]();});}};}function handleEntityNotFound(_0xae20a6,_0x182ee7){return function(_0x4f78c5){if(!_0x4f78c5){_0xae20a6[_0xda95('0x16')](0x194);}return _0x4f78c5;};}function handleError(_0x3522db,_0x10b39d){_0x10b39d=_0x10b39d||0x1f4;return function(_0x1e662f){logger[_0xda95('0x22')](_0x1e662f[_0xda95('0x23')]);if(_0x1e662f[_0xda95('0x24')]){delete _0x1e662f[_0xda95('0x24')];}_0x3522db[_0xda95('0x17')](_0x10b39d)[_0xda95('0x25')](_0x1e662f);};}exports['index']=function(_0x2b9acb,_0x3d26e7){var _0x589afd={},_0x5195a7={},_0x9099e5={'count':0x0,'rows':[]};var _0x2d87d0=_[_0xda95('0x26')](db[_0xda95('0x27')][_0xda95('0x28')],function(_0x2b9a86){return{'name':_0x2b9a86[_0xda95('0x29')],'type':_0x2b9a86['type']['key']};});_0x5195a7[_0xda95('0x2a')]=_[_0xda95('0x26')](_0x2d87d0,_0xda95('0x24'));_0x5195a7[_0xda95('0x2b')]=_[_0xda95('0x2c')](_0x2b9acb['query']);_0x5195a7[_0xda95('0x2d')]=_[_0xda95('0x2e')](_0x5195a7[_0xda95('0x2a')],_0x5195a7[_0xda95('0x2b')]);_0x589afd[_0xda95('0x2f')]=_['intersection'](_0x5195a7[_0xda95('0x2a')],qs[_0xda95('0x30')](_0x2b9acb[_0xda95('0x2b')][_0xda95('0x30')]));_0x589afd['attributes']=_0x589afd['attributes']['length']?_0x589afd[_0xda95('0x2f')]:_0x5195a7['model'];if(!_0x2b9acb['query'][_0xda95('0x31')](_0xda95('0x32'))){_0x589afd[_0xda95('0x1b')]=qs[_0xda95('0x1b')](_0x2b9acb['query'][_0xda95('0x1b')]);_0x589afd[_0xda95('0x1a')]=qs[_0xda95('0x1a')](_0x2b9acb['query']['offset']);}_0x589afd[_0xda95('0x33')]=qs[_0xda95('0x34')](_0x2b9acb[_0xda95('0x2b')]['sort']);_0x589afd['where']=qs[_0xda95('0x2d')](_[_0xda95('0x35')](_0x2b9acb[_0xda95('0x2b')],_0x5195a7[_0xda95('0x2d')]),_0x2d87d0);if(_0x2b9acb[_0xda95('0x2b')][_0xda95('0x36')]){_0x589afd[_0xda95('0x37')]=_['merge'](_0x589afd[_0xda95('0x37')],{'$or':_['map'](_0x2d87d0,function(_0x1b0cfc){if(_0x1b0cfc[_0xda95('0x38')]!==_0xda95('0x39')){var _0x4bef8c={};_0x4bef8c[_0x1b0cfc[_0xda95('0x24')]]={'$like':'%'+_0x2b9acb['query'][_0xda95('0x36')]+'%'};return _0x4bef8c;}})});}_0x589afd=_[_0xda95('0x3a')]({},_0x589afd,_0x2b9acb['options']);var _0x1810bd={'where':_0x589afd[_0xda95('0x37')]};return db[_0xda95('0x27')]['count'](_0x1810bd)[_0xda95('0x21')](function(_0x28931e){_0x9099e5[_0xda95('0x1c')]=_0x28931e;if(_0x2b9acb[_0xda95('0x2b')][_0xda95('0x3b')]){_0x589afd[_0xda95('0x3c')]=[{'all':!![]}];}return db[_0xda95('0x27')][_0xda95('0x3d')](_0x589afd);})[_0xda95('0x21')](function(_0x51ba70){_0x9099e5[_0xda95('0x3e')]=_0x51ba70;return _0x9099e5;})[_0xda95('0x21')](respondWithFilteredResult(_0x3d26e7,_0x589afd))['catch'](handleError(_0x3d26e7,null));};exports[_0xda95('0x3f')]=function(_0x2ef8da,_0x498216){var _0x581841={'raw':!![],'where':{'id':_0x2ef8da[_0xda95('0x40')]['id']}},_0x7e096c={};_0x7e096c[_0xda95('0x2a')]=_[_0xda95('0x2c')](db[_0xda95('0x27')]['rawAttributes']);_0x7e096c[_0xda95('0x2b')]=_[_0xda95('0x2c')](_0x2ef8da[_0xda95('0x2b')]);_0x7e096c[_0xda95('0x2d')]=_[_0xda95('0x2e')](_0x7e096c[_0xda95('0x2a')],_0x7e096c[_0xda95('0x2b')]);_0x581841[_0xda95('0x2f')]=_['intersection'](_0x7e096c[_0xda95('0x2a')],qs['fields'](_0x2ef8da[_0xda95('0x2b')][_0xda95('0x30')]));_0x581841[_0xda95('0x2f')]=_0x581841[_0xda95('0x2f')][_0xda95('0x41')]?_0x581841['attributes']:_0x7e096c[_0xda95('0x2a')];if(_0x2ef8da[_0xda95('0x2b')][_0xda95('0x3b')]){_0x581841['include']=[{'all':!![]}];}_0x581841=_[_0xda95('0x3a')]({},_0x581841,_0x2ef8da[_0xda95('0x42')]);return db['Attachment'][_0xda95('0x43')](_0x581841)[_0xda95('0x21')](handleEntityNotFound(_0x498216,null))[_0xda95('0x21')](respondWithResult(_0x498216,null))[_0xda95('0x44')](handleError(_0x498216,null));};exports['clone']=function(_0x740c15,_0x38fd1d){var _0x250750={'where':{'id':_0x740c15[_0xda95('0x40')]['id']}},_0x5bca2={};_0x5bca2[_0xda95('0x2a')]=_[_0xda95('0x2c')](db['Attachment'][_0xda95('0x28')]);_0x250750[_0xda95('0x2f')]=_['intersection'](_0x5bca2['model'],qs[_0xda95('0x30')](_0x740c15[_0xda95('0x2b')][_0xda95('0x30')]));_0x250750[_0xda95('0x2f')]=_0x250750[_0xda95('0x2f')][_0xda95('0x41')]?_0x250750[_0xda95('0x2f')]:_0x5bca2[_0xda95('0x2a')];if(_0x740c15['query'][_0xda95('0x3b')]){_0x250750[_0xda95('0x3c')]=[{'all':!![]}];}_0x250750=_[_0xda95('0x3a')]({},_0x250750,_0x740c15['options']);return db[_0xda95('0x27')]['find'](_0x250750)[_0xda95('0x21')](handleEntityNotFound(_0x38fd1d,null))[_0xda95('0x21')](function(_0x32dfe0){if(_0x32dfe0){var _0x1477f1=_0x32dfe0[_0xda95('0x45')]({'plain':!![]});_0x1477f1=qs[_0xda95('0x46')](_0x1477f1,['id','createdAt','updatedAt']);_0x740c15['body']=_[_0xda95('0x46')](_0x740c15[_0xda95('0x47')],['id',_0xda95('0x48'),_0xda95('0x49')]);return db[_0xda95('0x27')][_0xda95('0x4a')](_[_0xda95('0x3a')](_0x1477f1,_0x740c15['body']),{'include':_0x740c15['query'][_0xda95('0x3b')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x38fd1d,0xc9))[_0xda95('0x44')](handleError(_0x38fd1d,null));};exports[_0xda95('0x20')]=function(_0x4aa1fd,_0x281a1b){if(_0x4aa1fd[_0xda95('0x47')]['id']){delete _0x4aa1fd[_0xda95('0x47')]['id'];}return db[_0xda95('0x27')][_0xda95('0x43')]({'where':{'id':_0x4aa1fd['params']['id']}})['then'](handleEntityNotFound(_0x281a1b,null))[_0xda95('0x21')](saveUpdates(_0x4aa1fd[_0xda95('0x47')],null))[_0xda95('0x21')](respondWithResult(_0x281a1b,null))[_0xda95('0x44')](handleError(_0x281a1b,null));};exports['destroy']=function(_0x48df00,_0x3e7e8a){return db[_0xda95('0x27')]['find']({'where':{'id':_0x48df00[_0xda95('0x40')]['id']}})[_0xda95('0x21')](handleEntityNotFound(_0x3e7e8a,null))[_0xda95('0x21')](removeEntity(_0x3e7e8a,null))['catch'](handleError(_0x3e7e8a,null));};exports[_0xda95('0x4a')]=function(_0x229378,_0x531cd5,_0x20bba7){_0x229378['body'][_0xda95('0x24')]=_0x229378[_0xda95('0x4b')]['originalname'];_0x229378[_0xda95('0x47')][_0xda95('0x4c')]=_0x229378[_0xda95('0x4b')][_0xda95('0x4d')];_0x229378[_0xda95('0x47')][_0xda95('0x38')]=_0x229378[_0xda95('0x4b')][_0xda95('0x4e')];return db[_0xda95('0x27')][_0xda95('0x4a')](_0x229378['body'])[_0xda95('0x21')](respondWithResult(_0x531cd5,0xc9))[_0xda95('0x44')](handleError(_0x531cd5,null));};exports[_0xda95('0x4f')]=function(_0x5d8fc6,_0x3135b0,_0x303dca){return db[_0xda95('0x27')][_0xda95('0x50')]({'where':{'id':_0x5d8fc6[_0xda95('0x40')]['id']},'raw':!![]})[_0xda95('0x21')](handleEntityNotFound(_0x3135b0,null))[_0xda95('0x21')](function(_0x368f8c){if(_0x368f8c){var _0x221e62=_0x368f8c[_0xda95('0x51')]!==null;var _0x745391=path[_0xda95('0x52')](config['root'],_0xda95('0x53'));if(_0x221e62){_0x745391=path[_0xda95('0x52')](_0x745391,_0xda95('0x54'));}var _0xb3319e=path[_0xda95('0x52')](_0x745391,_0x368f8c[_0xda95('0x4c')]);return _0x3135b0[_0xda95('0x4f')](_0xb3319e);}})['catch'](handleError(_0x3135b0,null));};
\ No newline at end of file
+var _0x10a9=['includeAll','get','omit','createdAt','updatedAt','body','create','params','file','originalname','basename','mimetype','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','error','stack','name','index','map','Attachment','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','include','findAll','rows','catch','show','length','options','find','clone'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x10a9,0xc3));var _0x910a=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x10a9[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x910a('0x0'));var rimraf=require(_0x910a('0x1'));var zipdir=require(_0x910a('0x2'));var jsonpatch=require(_0x910a('0x3'));var rp=require(_0x910a('0x4'));var moment=require('moment');var BPromise=require(_0x910a('0x5'));var Mustache=require(_0x910a('0x6'));var util=require(_0x910a('0x7'));var path=require(_0x910a('0x8'));var sox=require(_0x910a('0x9'));var csv=require(_0x910a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x910a('0xb'));var squel=require(_0x910a('0xc'));var crypto=require(_0x910a('0xd'));var jsforce=require(_0x910a('0xe'));var deskjs=require(_0x910a('0xf'));var toCsv=require(_0x910a('0xa'));var querystring=require(_0x910a('0x10'));var Papa=require('papaparse');var Redis=require(_0x910a('0x11'));var authService=require(_0x910a('0x12'));var qs=require(_0x910a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x910a('0x14'));var logger=require(_0x910a('0x15'))(_0x910a('0x16'));var utils=require(_0x910a('0x17'));var config=require(_0x910a('0x18'));var licenseUtil=require(_0x910a('0x19'));var db=require(_0x910a('0x1a'))['db'];function respondWithStatusCode(_0x2279de,_0x22f6e8){_0x22f6e8=_0x22f6e8||0xcc;return function(_0x1381ad){if(_0x1381ad){return _0x2279de[_0x910a('0x1b')](_0x22f6e8);}return _0x2279de[_0x910a('0x1c')](_0x22f6e8)[_0x910a('0x1d')]();};}function respondWithResult(_0xc8003a,_0xe1610a){_0xe1610a=_0xe1610a||0xc8;return function(_0x5b0ff3){if(_0x5b0ff3){return _0xc8003a[_0x910a('0x1c')](_0xe1610a)[_0x910a('0x1e')](_0x5b0ff3);}};}function respondWithFilteredResult(_0x4483a2,_0x10693e){return function(_0x3a3cd8){if(_0x3a3cd8){var _0x8816a9=typeof _0x10693e[_0x910a('0x1f')]===_0x910a('0x20')&&typeof _0x10693e['limit']===_0x910a('0x20');var _0x5720c2=_0x3a3cd8[_0x910a('0x21')];var _0x5f251e=_0x8816a9?0x0:_0x10693e['offset'];var _0x31bb81=_0x8816a9?_0x3a3cd8[_0x910a('0x21')]:_0x10693e[_0x910a('0x1f')]+_0x10693e[_0x910a('0x22')];var _0x5b9a7d;if(_0x31bb81>=_0x5720c2){_0x31bb81=_0x5720c2;_0x5b9a7d=0xc8;}else{_0x5b9a7d=0xce;}_0x4483a2['status'](_0x5b9a7d);return _0x4483a2[_0x910a('0x23')](_0x910a('0x24'),_0x5f251e+'-'+_0x31bb81+'/'+_0x5720c2)[_0x910a('0x1e')](_0x3a3cd8);}return null;};}function patchUpdates(_0x5bb212){return function(_0x38e97b){try{jsonpatch[_0x910a('0x25')](_0x38e97b,_0x5bb212,!![]);}catch(_0x155365){return BPromise['reject'](_0x155365);}return _0x38e97b['save']();};}function saveUpdates(_0x5456d4,_0xa981c6){return function(_0x20174c){if(_0x20174c){return _0x20174c[_0x910a('0x26')](_0x5456d4)['then'](function(_0x6ac274){return _0x6ac274;});}return null;};}function removeEntity(_0x5cffef,_0x5da5ab){return function(_0x297e85){if(_0x297e85){return _0x297e85['destroy']()[_0x910a('0x27')](function(){_0x5cffef['status'](0xcc)[_0x910a('0x1d')]();});}};}function handleEntityNotFound(_0x5b6c9f,_0x45d71b){return function(_0x158a60){if(!_0x158a60){_0x5b6c9f[_0x910a('0x1b')](0x194);}return _0x158a60;};}function handleError(_0x18d74f,_0x50180f){_0x50180f=_0x50180f||0x1f4;return function(_0x4b61cd){logger[_0x910a('0x28')](_0x4b61cd[_0x910a('0x29')]);if(_0x4b61cd[_0x910a('0x2a')]){delete _0x4b61cd['name'];}_0x18d74f[_0x910a('0x1c')](_0x50180f)['send'](_0x4b61cd);};}exports[_0x910a('0x2b')]=function(_0x35eb86,_0xde77b0){var _0x20d1d1={},_0x1f7642={},_0x44623f={'count':0x0,'rows':[]};var _0x33762d=_[_0x910a('0x2c')](db[_0x910a('0x2d')][_0x910a('0x2e')],function(_0x248298){return{'name':_0x248298[_0x910a('0x2f')],'type':_0x248298[_0x910a('0x30')]['key']};});_0x1f7642[_0x910a('0x31')]=_[_0x910a('0x2c')](_0x33762d,'name');_0x1f7642['query']=_[_0x910a('0x32')](_0x35eb86[_0x910a('0x33')]);_0x1f7642[_0x910a('0x34')]=_[_0x910a('0x35')](_0x1f7642[_0x910a('0x31')],_0x1f7642[_0x910a('0x33')]);_0x20d1d1[_0x910a('0x36')]=_[_0x910a('0x35')](_0x1f7642[_0x910a('0x31')],qs[_0x910a('0x37')](_0x35eb86[_0x910a('0x33')][_0x910a('0x37')]));_0x20d1d1[_0x910a('0x36')]=_0x20d1d1[_0x910a('0x36')]['length']?_0x20d1d1[_0x910a('0x36')]:_0x1f7642[_0x910a('0x31')];if(!_0x35eb86['query']['hasOwnProperty'](_0x910a('0x38'))){_0x20d1d1['limit']=qs[_0x910a('0x22')](_0x35eb86[_0x910a('0x33')][_0x910a('0x22')]);_0x20d1d1['offset']=qs[_0x910a('0x1f')](_0x35eb86[_0x910a('0x33')]['offset']);}_0x20d1d1[_0x910a('0x39')]=qs[_0x910a('0x3a')](_0x35eb86[_0x910a('0x33')][_0x910a('0x3a')]);_0x20d1d1[_0x910a('0x3b')]=qs[_0x910a('0x34')](_[_0x910a('0x3c')](_0x35eb86[_0x910a('0x33')],_0x1f7642[_0x910a('0x34')]),_0x33762d);if(_0x35eb86[_0x910a('0x33')]['filter']){_0x20d1d1[_0x910a('0x3b')]=_[_0x910a('0x3d')](_0x20d1d1['where'],{'$or':_[_0x910a('0x2c')](_0x33762d,function(_0x2c76e5){if(_0x2c76e5[_0x910a('0x30')]!==_0x910a('0x3e')){var _0x10e476={};_0x10e476[_0x2c76e5[_0x910a('0x2a')]]={'$like':'%'+_0x35eb86[_0x910a('0x33')]['filter']+'%'};return _0x10e476;}})});}_0x20d1d1=_['merge']({},_0x20d1d1,_0x35eb86['options']);var _0x39e691={'where':_0x20d1d1[_0x910a('0x3b')]};return db[_0x910a('0x2d')][_0x910a('0x21')](_0x39e691)[_0x910a('0x27')](function(_0x562ae1){_0x44623f['count']=_0x562ae1;if(_0x35eb86[_0x910a('0x33')]['includeAll']){_0x20d1d1[_0x910a('0x3f')]=[{'all':!![]}];}return db['Attachment'][_0x910a('0x40')](_0x20d1d1);})['then'](function(_0x24126e){_0x44623f[_0x910a('0x41')]=_0x24126e;return _0x44623f;})['then'](respondWithFilteredResult(_0xde77b0,_0x20d1d1))[_0x910a('0x42')](handleError(_0xde77b0,null));};exports[_0x910a('0x43')]=function(_0x324d33,_0x14013d){var _0x45e865={'raw':!![],'where':{'id':_0x324d33['params']['id']}},_0x47f9d9={};_0x47f9d9[_0x910a('0x31')]=_[_0x910a('0x32')](db[_0x910a('0x2d')][_0x910a('0x2e')]);_0x47f9d9[_0x910a('0x33')]=_[_0x910a('0x32')](_0x324d33[_0x910a('0x33')]);_0x47f9d9['filters']=_[_0x910a('0x35')](_0x47f9d9['model'],_0x47f9d9[_0x910a('0x33')]);_0x45e865[_0x910a('0x36')]=_[_0x910a('0x35')](_0x47f9d9[_0x910a('0x31')],qs[_0x910a('0x37')](_0x324d33[_0x910a('0x33')]['fields']));_0x45e865[_0x910a('0x36')]=_0x45e865[_0x910a('0x36')][_0x910a('0x44')]?_0x45e865[_0x910a('0x36')]:_0x47f9d9[_0x910a('0x31')];if(_0x324d33[_0x910a('0x33')]['includeAll']){_0x45e865['include']=[{'all':!![]}];}_0x45e865=_[_0x910a('0x3d')]({},_0x45e865,_0x324d33[_0x910a('0x45')]);return db[_0x910a('0x2d')][_0x910a('0x46')](_0x45e865)[_0x910a('0x27')](handleEntityNotFound(_0x14013d,null))[_0x910a('0x27')](respondWithResult(_0x14013d,null))[_0x910a('0x42')](handleError(_0x14013d,null));};exports[_0x910a('0x47')]=function(_0x1495bf,_0x187f1d){var _0x162f35={'where':{'id':_0x1495bf['params']['id']}},_0x5d80aa={};_0x5d80aa[_0x910a('0x31')]=_[_0x910a('0x32')](db[_0x910a('0x2d')][_0x910a('0x2e')]);_0x162f35[_0x910a('0x36')]=_[_0x910a('0x35')](_0x5d80aa[_0x910a('0x31')],qs[_0x910a('0x37')](_0x1495bf[_0x910a('0x33')][_0x910a('0x37')]));_0x162f35[_0x910a('0x36')]=_0x162f35[_0x910a('0x36')][_0x910a('0x44')]?_0x162f35[_0x910a('0x36')]:_0x5d80aa['model'];if(_0x1495bf[_0x910a('0x33')][_0x910a('0x48')]){_0x162f35[_0x910a('0x3f')]=[{'all':!![]}];}_0x162f35=_['merge']({},_0x162f35,_0x1495bf[_0x910a('0x45')]);return db[_0x910a('0x2d')]['find'](_0x162f35)[_0x910a('0x27')](handleEntityNotFound(_0x187f1d,null))[_0x910a('0x27')](function(_0x45b570){if(_0x45b570){var _0x13c887=_0x45b570[_0x910a('0x49')]({'plain':!![]});_0x13c887=qs[_0x910a('0x4a')](_0x13c887,['id',_0x910a('0x4b'),_0x910a('0x4c')]);_0x1495bf[_0x910a('0x4d')]=_[_0x910a('0x4a')](_0x1495bf[_0x910a('0x4d')],['id',_0x910a('0x4b'),'updatedAt']);return db[_0x910a('0x2d')][_0x910a('0x4e')](_['merge'](_0x13c887,_0x1495bf[_0x910a('0x4d')]),{'include':_0x1495bf[_0x910a('0x33')][_0x910a('0x48')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x187f1d,0xc9))[_0x910a('0x42')](handleError(_0x187f1d,null));};exports[_0x910a('0x26')]=function(_0x49e820,_0x2221f5){if(_0x49e820[_0x910a('0x4d')]['id']){delete _0x49e820[_0x910a('0x4d')]['id'];}return db[_0x910a('0x2d')][_0x910a('0x46')]({'where':{'id':_0x49e820['params']['id']}})['then'](handleEntityNotFound(_0x2221f5,null))['then'](saveUpdates(_0x49e820[_0x910a('0x4d')],null))[_0x910a('0x27')](respondWithResult(_0x2221f5,null))[_0x910a('0x42')](handleError(_0x2221f5,null));};exports['destroy']=function(_0x4a349d,_0x217393){return db[_0x910a('0x2d')]['find']({'where':{'id':_0x4a349d[_0x910a('0x4f')]['id']}})[_0x910a('0x27')](handleEntityNotFound(_0x217393,null))[_0x910a('0x27')](removeEntity(_0x217393,null))[_0x910a('0x42')](handleError(_0x217393,null));};exports[_0x910a('0x4e')]=function(_0x27343c,_0x2af8f9,_0x38f002){_0x27343c[_0x910a('0x4d')][_0x910a('0x2a')]=_0x27343c[_0x910a('0x50')][_0x910a('0x51')];_0x27343c['body'][_0x910a('0x52')]=_0x27343c['file']['filename'];_0x27343c[_0x910a('0x4d')][_0x910a('0x30')]=_0x27343c[_0x910a('0x50')][_0x910a('0x53')];return db[_0x910a('0x2d')][_0x910a('0x4e')](_0x27343c[_0x910a('0x4d')])[_0x910a('0x27')](respondWithResult(_0x2af8f9,0xc9))[_0x910a('0x42')](handleError(_0x2af8f9,null));};exports[_0x910a('0x54')]=function(_0x5cccca,_0x4241d2,_0x205f17){return db['Attachment'][_0x910a('0x55')]({'where':{'id':_0x5cccca[_0x910a('0x4f')]['id']},'raw':!![]})[_0x910a('0x27')](handleEntityNotFound(_0x4241d2,null))['then'](function(_0x3f9efb){if(_0x3f9efb){var _0x2abced=_0x3f9efb[_0x910a('0x56')]!==null;var _0x4219a7=path[_0x910a('0x57')](config['root'],_0x910a('0x58'));if(_0x2abced){_0x4219a7=path['join'](_0x4219a7,'offline-chat/');}var _0x4b2ad6=path[_0x910a('0x57')](_0x4219a7,_0x3f9efb[_0x910a('0x52')]);return _0x4241d2['download'](_0x4b2ad6);}})['catch'](handleError(_0x4241d2,null));};
\ No newline at end of file
index eca2f4f..98fc776 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdecb=['Attachment','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','define'];(function(_0x4e74d5,_0x26d7c3){var _0x4893d0=function(_0x213d8c){while(--_0x213d8c){_0x4e74d5['push'](_0x4e74d5['shift']());}};_0x4893d0(++_0x26d7c3);}(_0xdecb,0x1da));var _0xbdec=function(_0x5f5659,_0x374c36){_0x5f5659=_0x5f5659-0x0;var _0x3a53a5=_0xdecb[_0x5f5659];return _0x3a53a5;};'use strict';var _=require('lodash');var util=require(_0xbdec('0x0'));var logger=require(_0xbdec('0x1'))(_0xbdec('0x2'));var moment=require('moment');var BPromise=require(_0xbdec('0x3'));var rp=require(_0xbdec('0x4'));var fs=require('fs');var path=require(_0xbdec('0x5'));var rimraf=require(_0xbdec('0x6'));var config=require(_0xbdec('0x7'));var attributes=require(_0xbdec('0x8'));module['exports']=function(_0x2afe87,_0x2f5bb6){return _0x2afe87[_0xbdec('0x9')](_0xbdec('0xa'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdced=['rimraf','../../config/environment','./attachment.attributes','define','Attachment','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x56ef59,_0x2d1bc9){var _0x2432a6=function(_0x44430f){while(--_0x44430f){_0x56ef59['push'](_0x56ef59['shift']());}};_0x2432a6(++_0x2d1bc9);}(_0xdced,0x131));var _0xddce=function(_0x2383ef,_0x48dbad){_0x2383ef=_0x2383ef-0x0;var _0x3d6395=_0xdced[_0x2383ef];return _0x3d6395;};'use strict';var _=require(_0xddce('0x0'));var util=require('util');var logger=require(_0xddce('0x1'))(_0xddce('0x2'));var moment=require(_0xddce('0x3'));var BPromise=require(_0xddce('0x4'));var rp=require(_0xddce('0x5'));var fs=require('fs');var path=require(_0xddce('0x6'));var rimraf=require(_0xddce('0x7'));var config=require(_0xddce('0x8'));var attributes=require(_0xddce('0x9'));module['exports']=function(_0x3acc22,_0x396b1f){return _0x3acc22[_0xddce('0xa')](_0xddce('0xb'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4509133..39f73c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4522=['code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','body','options','raw','info','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','stringify','error'];(function(_0x15ee0c,_0x300496){var _0x23d328=function(_0x124ce5){while(--_0x124ce5){_0x15ee0c['push'](_0x15ee0c['shift']());}};_0x23d328(++_0x300496);}(_0x4522,0x1a0));var _0x2452=function(_0x116e47,_0x2ee4d4){_0x116e47=_0x116e47-0x0;var _0xfcfb2a=_0x4522[_0x116e47];return _0xfcfb2a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2452('0x0'));var BPromise=require(_0x2452('0x1'));var rs=require(_0x2452('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2452('0x3'))['db'];var utils=require(_0x2452('0x4'));var logger=require(_0x2452('0x5'))(_0x2452('0x6'));var config=require(_0x2452('0x7'));var jayson=require(_0x2452('0x8'));var client=jayson[_0x2452('0x9')][_0x2452('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0139,_0x149807,_0x3bc193){return new BPromise(function(_0x33b935,_0x24073f){return client[_0x2452('0xb')](_0x2f0139,_0x3bc193)[_0x2452('0xc')](function(_0x2995b5){logger['info']('Attachment,\x20%s,\x20%s',_0x149807,_0x2452('0xd'));logger['debug']('Attachment,\x20%s,\x20%s,\x20%s',_0x149807,_0x2452('0xd'),JSON[_0x2452('0xe')](_0x2995b5));if(_0x2995b5[_0x2452('0xf')]){if(_0x2995b5[_0x2452('0xf')][_0x2452('0x10')]===0x1f4){logger[_0x2452('0xf')](_0x2452('0x11'),_0x149807,_0x2995b5[_0x2452('0xf')]['message']);return _0x24073f(_0x2995b5['error']['message']);}logger[_0x2452('0xf')]('Attachment,\x20%s,\x20%s',_0x149807,_0x2995b5[_0x2452('0xf')]['message']);return _0x33b935(_0x2995b5[_0x2452('0xf')][_0x2452('0x12')]);}else{logger['info'](_0x2452('0x11'),_0x149807,'request\x20sent');_0x33b935(_0x2995b5[_0x2452('0x13')][_0x2452('0x12')]);}})[_0x2452('0x14')](function(_0xdede20){logger['error'](_0x2452('0x11'),_0x149807,_0xdede20);_0x24073f(_0xdede20);});});}exports[_0x2452('0x15')]=function(_0x59d89a){var _0x4802ad=this;return new Promise(function(_0x1bfb44,_0x37c6a6){return db[_0x2452('0x16')]['create'](_0x59d89a[_0x2452('0x17')],{'raw':_0x59d89a[_0x2452('0x18')]?_0x59d89a[_0x2452('0x18')][_0x2452('0x19')]===undefined?!![]:![]:!![]})[_0x2452('0xc')](function(_0x1c70cb){logger[_0x2452('0x1a')](_0x2452('0x15'),_0x59d89a);logger['debug']('CreateAttachment',_0x59d89a,JSON[_0x2452('0xe')](_0x1c70cb));_0x1bfb44(_0x1c70cb);})[_0x2452('0x14')](function(_0x4bb3ff){logger[_0x2452('0xf')](_0x2452('0x15'),_0x4bb3ff[_0x2452('0x12')],_0x59d89a);_0x37c6a6(_0x4802ad[_0x2452('0xf')](0x1f4,_0x4bb3ff[_0x2452('0x12')]));});});};
\ No newline at end of file
+var _0x4746=['request','request\x20sent','debug','error','code','message','Attachment,\x20%s,\x20%s','info','catch','Attachment','create','body','options','raw','CreateAttachment','stringify','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x27a0bd,_0x41e831){var _0xa68da6=function(_0x5abb69){while(--_0x5abb69){_0x27a0bd['push'](_0x27a0bd['shift']());}};_0xa68da6(++_0x41e831);}(_0x4746,0xc6));var _0x6474=function(_0x7dee2e,_0x3ce93b){_0x7dee2e=_0x7dee2e-0x0;var _0x344a84=_0x4746[_0x7dee2e];return _0x344a84;};'use strict';var _=require(_0x6474('0x0'));var util=require(_0x6474('0x1'));var moment=require('moment');var BPromise=require(_0x6474('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6474('0x3'));var db=require(_0x6474('0x4'))['db'];var utils=require(_0x6474('0x5'));var logger=require(_0x6474('0x6'))(_0x6474('0x7'));var config=require('../../config/environment');var jayson=require(_0x6474('0x8'));var client=jayson[_0x6474('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x433af9,_0x427f79,_0xcd065e){return new BPromise(function(_0xec3cda,_0x15d4c2){return client[_0x6474('0xa')](_0x433af9,_0xcd065e)['then'](function(_0x1bc38b){logger['info']('Attachment,\x20%s,\x20%s',_0x427f79,_0x6474('0xb'));logger[_0x6474('0xc')]('Attachment,\x20%s,\x20%s,\x20%s',_0x427f79,_0x6474('0xb'),JSON['stringify'](_0x1bc38b));if(_0x1bc38b[_0x6474('0xd')]){if(_0x1bc38b['error'][_0x6474('0xe')]===0x1f4){logger[_0x6474('0xd')]('Attachment,\x20%s,\x20%s',_0x427f79,_0x1bc38b['error']['message']);return _0x15d4c2(_0x1bc38b[_0x6474('0xd')][_0x6474('0xf')]);}logger[_0x6474('0xd')](_0x6474('0x10'),_0x427f79,_0x1bc38b[_0x6474('0xd')][_0x6474('0xf')]);return _0xec3cda(_0x1bc38b[_0x6474('0xd')][_0x6474('0xf')]);}else{logger[_0x6474('0x11')]('Attachment,\x20%s,\x20%s',_0x427f79,'request\x20sent');_0xec3cda(_0x1bc38b['result'][_0x6474('0xf')]);}})[_0x6474('0x12')](function(_0x29c19b){logger[_0x6474('0xd')](_0x6474('0x10'),_0x427f79,_0x29c19b);_0x15d4c2(_0x29c19b);});});}exports['CreateAttachment']=function(_0x1505fc){var _0x7585ed=this;return new Promise(function(_0xb6ecb6,_0xc3448d){return db[_0x6474('0x13')][_0x6474('0x14')](_0x1505fc[_0x6474('0x15')],{'raw':_0x1505fc[_0x6474('0x16')]?_0x1505fc['options'][_0x6474('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0xd23b18){logger[_0x6474('0x11')](_0x6474('0x18'),_0x1505fc);logger[_0x6474('0xc')](_0x6474('0x18'),_0x1505fc,JSON[_0x6474('0x19')](_0xd23b18));_0xb6ecb6(_0xd23b18);})[_0x6474('0x12')](function(_0x5d0e5c){logger[_0x6474('0xd')]('CreateAttachment',_0x5d0e5c[_0x6474('0xf')],_0x1505fc);_0xc3448d(_0x7585ed['error'](0x1f4,_0x5d0e5c['message']));});});};
\ No newline at end of file
index ae0ec0c..7f0fa4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x4d6ca0,_0x1755d1){var _0x5f4034=function(_0x1a2e9a){while(--_0x1a2e9a){_0x4d6ca0['push'](_0x4d6ca0['shift']());}};_0x5f4034(++_0x1755d1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x26f36f,_0xf90e9b){_0x26f36f=_0x26f36f-0x0;var _0x23104d=_0x5f2f[_0x26f36f];return _0x23104d;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
+var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0xcbbc2b,_0x1f2311){var _0x526d21=function(_0x576678){while(--_0x576678){_0xcbbc2b['push'](_0xcbbc2b['shift']());}};_0x526d21(++_0x1f2311);}(_0xb10b,0x12a));var _0xbb10=function(_0x54cfa4,_0x2d41ac){_0x54cfa4=_0x54cfa4-0x0;var _0x26ecf5=_0xb10b[_0x54cfa4];return _0x26ecf5;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
index 7840ee5..1329a23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f4f=['disabled','blockedAt','minutes','clearBlockUser','getLicense','catch','status','send','login','ad-login','signToken','json','online','password','User','passport','passport-local','Strategy','moment','activedirectory2','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','undefined','url','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','role','blocked','user','agent'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x1f4f,0x6b));var _0xf1f4=function(_0x3781c7,_0x5ea182){_0x3781c7=_0x3781c7-0x0;var _0x2f7189=_0x1f4f[_0x3781c7];return _0x2f7189;};'use strict';var passport=require(_0xf1f4('0x0'));var LocalStrategy=require(_0xf1f4('0x1'))[_0xf1f4('0x2')];var moment=require(_0xf1f4('0x3'));var ActiveDirectory=require(_0xf1f4('0x4'));var BPromise=require('bluebird');var util=require(_0xf1f4('0x5'));var db=require(_0xf1f4('0x6'))['db'];var authService=require(_0xf1f4('0x7'));var utils=require('../../config/utils');var config=require(_0xf1f4('0x8'));var logger=require(_0xf1f4('0x9'))(_0xf1f4('0xa'));function isActiveDirectoryConfigured(_0x1b8fd8){var _0x308ec0=![];if(typeof _0x1b8fd8[_0xf1f4('0xb')]!==_0xf1f4('0xc')){_0x308ec0=_0x1b8fd8[_0xf1f4('0xb')]['baseDN']&&_0x1b8fd8[_0xf1f4('0xb')][_0xf1f4('0xd')]&&_0x1b8fd8['activedirectory'][_0xf1f4('0xe')];}return _0x308ec0;}function adAuthenticate(_0x3efdea,_0x3baac8,_0x49ba8b){return new BPromise(function(_0x2ae02d,_0x29c63b){try{var _0x4d4e0d=new ActiveDirectory(_0x3efdea);_0x4d4e0d[_0xf1f4('0xf')](_0x3baac8,_0x49ba8b,function(_0xd753da,_0x4b7ddc){if(_0xd753da){logger['error'](_0xf1f4('0x10'),_0x3baac8,util['inspect'](_0xd753da,{'showHidden':![],'depth':null}));_0x29c63b(_0xf1f4('0x11'));}else if(!_0x4b7ddc){logger[_0xf1f4('0x12')](_0xf1f4('0x13'),_0x3baac8);_0x29c63b('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2ae02d(_0x4b7ddc);}});}catch(_0xe0507f){_0x29c63b(_0xe0507f);}});}function ActiveDirectoryAuthenticate(_0x16f9cf,_0x47f124,_0xb4bcda,_0x34de48){var _0x577407,_0x267a8f;if(!isActiveDirectoryConfigured(config)){logger[_0xf1f4('0x12')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x47f124);return _0x34de48(null,![],{'message':_0xf1f4('0x11')});}return db[_0xf1f4('0x14')][_0xf1f4('0x15')]({'where':{'id':0x1},'attributes':[_0xf1f4('0x16'),_0xf1f4('0x17')],'raw':!![]})[_0xf1f4('0x18')](function(_0x40afec){_0x577407=_0x40afec;if(!_0x577407[_0xf1f4('0x16')]){logger[_0xf1f4('0x12')](_0xf1f4('0x19'),_0x47f124);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x16f9cf[_0xf1f4('0x15')]({'attributes':['id',_0xf1f4('0x1a'),'password','salt',_0xf1f4('0x1b'),'disabled',_0xf1f4('0x1c'),'blockedAt','online'],'where':{'name':_0x47f124,'role':{'$or':['admin',_0xf1f4('0x1d'),_0xf1f4('0x1e')]},'adSsoEnabled':!![]}});})[_0xf1f4('0x18')](function(_0x2db3d3){if(!_0x2db3d3||_0x2db3d3&&_0x2db3d3[_0xf1f4('0x1a')]!==_0x47f124){throw new Error(_0xf1f4('0x11'));}_0x267a8f=_0x2db3d3;var _0x23d266=_0x267a8f[_0xf1f4('0x1a')]+'@'+config[_0xf1f4('0xb')][_0xf1f4('0xe')];return adAuthenticate(config[_0xf1f4('0xb')],_0x23d266,_0xb4bcda);})[_0xf1f4('0x18')](function(_0x6f7e75){if(_0x267a8f[_0xf1f4('0x1f')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x577407[_0xf1f4('0x17')]>0x0){if(_0x267a8f['blocked']){if(moment(_0x267a8f[_0xf1f4('0x20')])['add'](_0x577407[_0xf1f4('0x17')],_0xf1f4('0x21'))>moment()){throw new Error(_0xf1f4('0x11'));}return utils[_0xf1f4('0x22')](_0x267a8f,0x0,![],null)[_0xf1f4('0x18')](function(){return utils['getLicense'](_0x267a8f);})[_0xf1f4('0x18')](function(){return _0x34de48(null,_0x267a8f);});}else{return utils[_0xf1f4('0x23')](_0x267a8f)[_0xf1f4('0x18')](function(){return _0x34de48(null,_0x267a8f);});}}else{return utils[_0xf1f4('0x23')](_0x267a8f)[_0xf1f4('0x18')](function(){return _0x34de48(null,_0x267a8f);});}})[_0xf1f4('0x24')](function(_0x12aa4f){return _0x34de48(null,![],_0x12aa4f);});}function handleError(_0x561a2a,_0x16d2f0,_0x4f3160){return _0x561a2a[_0xf1f4('0x25')](_0x16d2f0||0x1f4)[_0xf1f4('0x26')]({'message':_0x4f3160?_0x4f3160['message']||_0x4f3160:''});}exports[_0xf1f4('0x27')]=function(_0x3706ba,_0x164971,_0x16c668){passport[_0xf1f4('0xf')](_0xf1f4('0x28'),function(_0x5ea3e5,_0x5ae3a5,_0x45227d){var _0x3f2260=_0x5ea3e5||_0x45227d;if(_0x3f2260){return handleError(_0x164971,0x191,_0x3f2260);}if(!_0x5ae3a5){return handleError(_0x164971,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x4034bd={'payload':{'id':_0x5ae3a5['id'],'role':_0x5ae3a5[_0xf1f4('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0xf1f4('0x29')](_0x4034bd)['then'](function(_0x10aeb7){_0x164971[_0xf1f4('0x2a')]({'id':_0x5ae3a5['id'],'token':_0x10aeb7,'statusCall':'','isAlreadyLogged':_0x5ae3a5[_0xf1f4('0x2b')]});});}})(_0x3706ba,_0x164971,_0x16c668);};passport['use'](_0xf1f4('0x28'),new LocalStrategy({'usernameField':_0xf1f4('0x1a'),'passwordField':_0xf1f4('0x2c')},function(_0x2020b5,_0x385555,_0x3ebb40){return ActiveDirectoryAuthenticate(db[_0xf1f4('0x2d')],_0x2020b5,_0x385555,_0x3ebb40);}));
\ No newline at end of file
+var _0x3cc7=['Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','use','User','passport','passport-local','Strategy','moment','activedirectory2','util','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','undefined','url','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blockedAt','admin','user','agent','domain','blocked','add','getLicense','catch','status','login','authenticate','ad-login'];(function(_0x8b746f,_0x30b7a1){var _0x50094c=function(_0x2ab809){while(--_0x2ab809){_0x8b746f['push'](_0x8b746f['shift']());}};_0x50094c(++_0x30b7a1);}(_0x3cc7,0x11f));var _0x73cc=function(_0x3e8cae,_0x4cb96a){_0x3e8cae=_0x3e8cae-0x0;var _0x45c4d6=_0x3cc7[_0x3e8cae];return _0x45c4d6;};'use strict';var passport=require(_0x73cc('0x0'));var LocalStrategy=require(_0x73cc('0x1'))[_0x73cc('0x2')];var moment=require(_0x73cc('0x3'));var ActiveDirectory=require(_0x73cc('0x4'));var BPromise=require('bluebird');var util=require(_0x73cc('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x73cc('0x6'));var utils=require('../../config/utils');var config=require(_0x73cc('0x7'));var logger=require(_0x73cc('0x8'))(_0x73cc('0x9'));function isActiveDirectoryConfigured(_0x5daec4){var _0x1b2eab=![];if(typeof _0x5daec4[_0x73cc('0xa')]!==_0x73cc('0xb')){_0x1b2eab=_0x5daec4['activedirectory']['baseDN']&&_0x5daec4['activedirectory'][_0x73cc('0xc')]&&_0x5daec4[_0x73cc('0xa')]['domain'];}return _0x1b2eab;}function adAuthenticate(_0x594eae,_0x338da6,_0x459e0f){return new BPromise(function(_0x4e9141,_0x1d3eff){try{var _0x4d99bf=new ActiveDirectory(_0x594eae);_0x4d99bf['authenticate'](_0x338da6,_0x459e0f,function(_0x5d8526,_0x1f675b){if(_0x5d8526){logger[_0x73cc('0xd')](_0x73cc('0xe'),_0x338da6,util[_0x73cc('0xf')](_0x5d8526,{'showHidden':![],'depth':null}));_0x1d3eff('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x1f675b){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x338da6);_0x1d3eff(_0x73cc('0x10'));}else{_0x4e9141(_0x1f675b);}});}catch(_0x372863){_0x1d3eff(_0x372863);}});}function ActiveDirectoryAuthenticate(_0x532111,_0x153ad7,_0x515d8e,_0xa3ba4b){var _0x1f8b47,_0x35e596;if(!isActiveDirectoryConfigured(config)){logger[_0x73cc('0xd')](_0x73cc('0x11'),_0x153ad7);return _0xa3ba4b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x73cc('0x12')][_0x73cc('0x13')]({'where':{'id':0x1},'attributes':[_0x73cc('0x14'),_0x73cc('0x15')],'raw':!![]})[_0x73cc('0x16')](function(_0x10b0e8){_0x1f8b47=_0x10b0e8;if(!_0x1f8b47[_0x73cc('0x14')]){logger[_0x73cc('0xd')](_0x73cc('0x17'),_0x153ad7);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x532111[_0x73cc('0x13')]({'attributes':['id',_0x73cc('0x18'),_0x73cc('0x19'),_0x73cc('0x1a'),_0x73cc('0x1b'),_0x73cc('0x1c'),'blocked',_0x73cc('0x1d'),'online'],'where':{'name':_0x153ad7,'role':{'$or':[_0x73cc('0x1e'),_0x73cc('0x1f'),_0x73cc('0x20')]},'adSsoEnabled':!![]}});})[_0x73cc('0x16')](function(_0x12c604){if(!_0x12c604||_0x12c604&&_0x12c604[_0x73cc('0x18')]!==_0x153ad7){throw new Error(_0x73cc('0x10'));}_0x35e596=_0x12c604;var _0x13f64f=_0x35e596['name']+'@'+config[_0x73cc('0xa')][_0x73cc('0x21')];return adAuthenticate(config['activedirectory'],_0x13f64f,_0x515d8e);})[_0x73cc('0x16')](function(_0x43b118){if(_0x35e596[_0x73cc('0x1c')]){throw new Error(_0x73cc('0x10'));}if(_0x1f8b47[_0x73cc('0x15')]>0x0){if(_0x35e596[_0x73cc('0x22')]){if(moment(_0x35e596[_0x73cc('0x1d')])[_0x73cc('0x23')](_0x1f8b47['blockDuration'],'minutes')>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0x35e596,0x0,![],null)[_0x73cc('0x16')](function(){return utils[_0x73cc('0x24')](_0x35e596);})[_0x73cc('0x16')](function(){return _0xa3ba4b(null,_0x35e596);});}else{return utils[_0x73cc('0x24')](_0x35e596)['then'](function(){return _0xa3ba4b(null,_0x35e596);});}}else{return utils[_0x73cc('0x24')](_0x35e596)[_0x73cc('0x16')](function(){return _0xa3ba4b(null,_0x35e596);});}})[_0x73cc('0x25')](function(_0x52ddc3){return _0xa3ba4b(null,![],_0x52ddc3);});}function handleError(_0x5eff50,_0x202e8e,_0x144c83){return _0x5eff50[_0x73cc('0x26')](_0x202e8e||0x1f4)['send']({'message':_0x144c83?_0x144c83['message']||_0x144c83:''});}exports[_0x73cc('0x27')]=function(_0x1cc649,_0x171e5e,_0x130993){passport[_0x73cc('0x28')](_0x73cc('0x29'),function(_0x2e0158,_0x41381a,_0x22f28a){var _0xb1adfe=_0x2e0158||_0x22f28a;if(_0xb1adfe){return handleError(_0x171e5e,0x191,_0xb1adfe);}if(!_0x41381a){return handleError(_0x171e5e,0x194,{'message':_0x73cc('0x2a')});}else{var _0xc61f27={'payload':{'id':_0x41381a['id'],'role':_0x41381a[_0x73cc('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0x73cc('0x2b')](_0xc61f27)[_0x73cc('0x16')](function(_0x31ae30){_0x171e5e['json']({'id':_0x41381a['id'],'token':_0x31ae30,'statusCall':'','isAlreadyLogged':_0x41381a[_0x73cc('0x2c')]});});}})(_0x1cc649,_0x171e5e,_0x130993);};passport[_0x73cc('0x2d')](_0x73cc('0x29'),new LocalStrategy({'usernameField':_0x73cc('0x18'),'passwordField':_0x73cc('0x19')},function(_0x2184af,_0x32c97d,_0x284537){return ActiveDirectoryAuthenticate(db[_0x73cc('0x2e')],_0x2184af,_0x32c97d,_0x284537);}));
\ No newline at end of file
index 5e8e5bf..be5b1aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c4b=['./authActiveDirectory.controller','post','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5c4b,0x1d0));var _0xb5c4=function(_0x26f634,_0x3fe684){_0x26f634=_0x26f634-0x0;var _0x3d4324=_0x5c4b[_0x26f634];return _0x3d4324;};'use strict';var express=require('express');var router=express[_0xb5c4('0x0')]();var controller=require(_0xb5c4('0x1'));router[_0xb5c4('0x2')]('/',controller['login']);module['exports']=router;
\ No newline at end of file
+var _0x55eb=['post','login','exports','express','Router','./authActiveDirectory.controller'];(function(_0xcabec1,_0x437067){var _0x46aa04=function(_0x595ff3){while(--_0x595ff3){_0xcabec1['push'](_0xcabec1['shift']());}};_0x46aa04(++_0x437067);}(_0x55eb,0x1c5));var _0xb55e=function(_0x2712b6,_0x58a79e){_0x2712b6=_0x2712b6-0x0;var _0x3f1036=_0x55eb[_0x2712b6];return _0x3f1036;};'use strict';var express=require(_0xb55e('0x0'));var router=express[_0xb55e('0x1')]();var controller=require(_0xb55e('0x2'));router[_0xb55e('0x3')]('/',controller[_0xb55e('0x4')]);module[_0xb55e('0x5')]=router;
\ No newline at end of file
index 899d00c..b619065 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(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x7a54,0x106));var _0x47a5=function(_0x5a2ba1,_0x8341e1){_0x5a2ba1=_0x5a2ba1-0x0;var _0xeaca75=_0x7a54[_0x5a2ba1];return _0xeaca75;};'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(_0x625fa0,_0x1b8d3f){var _0x2e9377=function(_0x7bf110){while(--_0x7bf110){_0x625fa0['push'](_0x625fa0['shift']());}};_0x2e9377(++_0x1b8d3f);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
index 1d4dba9..65f3d4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x169c=['../../components/auth/service','get','/callback','callback','isMiddleware','login','setTokenCookie','exports','express','passport','./authGoogle.controller','../user/user.controller.js'];(function(_0x25ccb6,_0x429ba4){var _0x3c8292=function(_0x15a7cf){while(--_0x15a7cf){_0x25ccb6['push'](_0x25ccb6['shift']());}};_0x3c8292(++_0x429ba4);}(_0x169c,0x1dc));var _0xc169=function(_0x5f150e,_0x5e3a1e){_0x5f150e=_0x5f150e-0x0;var _0x2f6957=_0x169c[_0x5f150e];return _0x2f6957;};'use strict';var express=require(_0xc169('0x0'));var passport=require(_0xc169('0x1'));var router=express['Router']();var controller=require(_0xc169('0x2'));var userController=require(_0xc169('0x3'));var authService=require(_0xc169('0x4'));router[_0xc169('0x5')]('/',controller['login']);router[_0xc169('0x5')](_0xc169('0x6'),controller[_0xc169('0x7')],authService[_0xc169('0x8')],userController[_0xc169('0x9')],authService[_0xc169('0xa')]);module[_0xc169('0xb')]=router;
\ No newline at end of file
+var _0x9d86=['login','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9d86,0x1f1));var _0x69d8=function(_0x55de4f,_0x399b5e){_0x55de4f=_0x55de4f-0x0;var _0x785e3c=_0x9d86[_0x55de4f];return _0x785e3c;};'use strict';var express=require(_0x69d8('0x0'));var passport=require(_0x69d8('0x1'));var router=express[_0x69d8('0x2')]();var controller=require(_0x69d8('0x3'));var userController=require(_0x69d8('0x4'));var authService=require(_0x69d8('0x5'));router[_0x69d8('0x6')]('/',controller[_0x69d8('0x7')]);router[_0x69d8('0x6')]('/callback',controller[_0x69d8('0x8')],authService[_0x69d8('0x9')],userController[_0x69d8('0x7')],authService[_0x69d8('0xa')]);module[_0x69d8('0xb')]=router;
\ No newline at end of file
index 328d01e..f2f8ad8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8091=['getLicense','catch','MailAccount','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','email','user','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','login','local-login','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','host','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','password','previousPasswords','validatePasswordHistory','Password\x20reset!','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','name','role','blocked','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','disabled','add','minutes','clearBlockUser','then'];(function(_0x3c0731,_0x5181dc){var _0x2e7420=function(_0x22d72e){while(--_0x22d72e){_0x3c0731['push'](_0x3c0731['shift']());}};_0x2e7420(++_0x5181dc);}(_0x8091,0xcd));var _0x1809=function(_0x573931,_0x472f97){_0x573931=_0x573931-0x0;var _0x2fdbe7=_0x8091[_0x573931];return _0x2fdbe7;};'use strict';var util=require('util');var passport=require(_0x1809('0x0'));var LocalStrategy=require(_0x1809('0x1'))[_0x1809('0x2')];var jayson=require(_0x1809('0x3'));var _=require(_0x1809('0x4'));var rs=require(_0x1809('0x5'));var moment=require('moment');var db=require(_0x1809('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x1809('0x7'));var client=jayson[_0x1809('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x3f8fdf,_0x1ba7e8,_0x2ad50f,_0x415f0b){var _0x3844ee,_0x5c8db4;return db[_0x1809('0x9')][_0x1809('0xa')]({'where':{'id':0x1},'attributes':[_0x1809('0xb'),_0x1809('0xc')],'raw':!![]})['then'](function(_0x4d9873){_0x3844ee=_0x4d9873;return _0x3f8fdf[_0x1809('0xa')]({'attributes':['id',_0x1809('0xd'),'password','salt',_0x1809('0xe'),'disabled',_0x1809('0xf'),_0x1809('0x10'),_0x1809('0x11')],'where':{'name':_0x1ba7e8,'role':{'$or':[_0x1809('0x12'),'user',_0x1809('0x13')]}}});})['then'](function(_0x37b5e0){if(!_0x37b5e0||_0x37b5e0&&_0x37b5e0[_0x1809('0xd')]!==_0x1ba7e8){throw new Error(_0x1809('0x14'));}else{_0x5c8db4=_0x37b5e0;return _0x5c8db4;}})['then'](function(){_0x5c8db4['authenticate'](_0x2ad50f,function(_0x1333fa,_0x1c1748){var _0x555d77=_0x5c8db4[_0x1809('0x11')]+0x1;if(_0x1333fa){return _0x415f0b(_0x1333fa);}else if(!_0x1c1748){if(_0x5c8db4[_0x1809('0x15')]){return _0x415f0b(null,![],{'message':_0x1809('0x14')});}else if(_0x3844ee[_0x1809('0xb')]>0x0){if(_0x5c8db4[_0x1809('0xf')]){if(_0x3844ee[_0x1809('0xc')]>0x0){if(moment(_0x5c8db4[_0x1809('0x10')])[_0x1809('0x16')](_0x3844ee[_0x1809('0xc')],_0x1809('0x17'))>moment()){return _0x415f0b(null,![],{'message':_0x1809('0x14')});}else{return utils[_0x1809('0x18')](_0x5c8db4,_0x555d77,![],null)['then'](function(){return _0x415f0b(null,![],{'message':_0x1809('0x14')});});}}else{return _0x415f0b(null,![],{'message':_0x1809('0x14')});}}else{if(_0x555d77>=_0x3844ee[_0x1809('0xb')]){return utils[_0x1809('0x18')](_0x5c8db4,0x0,!![],moment())[_0x1809('0x19')](function(){return _0x415f0b(null,![],{'message':_0x1809('0x14')});});}else{return utils[_0x1809('0x18')](_0x5c8db4,_0x555d77,![],null)[_0x1809('0x19')](function(){return _0x415f0b(null,![],{'message':_0x1809('0x14')});});}}}else{return _0x415f0b(null,![],{'message':_0x1809('0x14')});}}else{if(_0x5c8db4[_0x1809('0x15')]){return _0x415f0b(null,![],{'message':_0x1809('0x14')});}else if(_0x3844ee[_0x1809('0xb')]>0x0){if(_0x5c8db4[_0x1809('0xf')]){if(_0x3844ee[_0x1809('0xc')]>0x0){if(moment(_0x5c8db4[_0x1809('0x10')])[_0x1809('0x16')](_0x3844ee[_0x1809('0xc')],'minutes')>moment()){return _0x415f0b(null,![],{'message':_0x1809('0x14')});}else{return utils['clearBlockUser'](_0x5c8db4,0x0,![],null)[_0x1809('0x19')](function(){return utils[_0x1809('0x1a')](_0x5c8db4);})[_0x1809('0x19')](function(){return _0x415f0b(null,_0x5c8db4);});}}else{return _0x415f0b(null,![],{'message':_0x1809('0x14')});}}else{return utils[_0x1809('0x18')](_0x5c8db4,0x0,![],null)['then'](function(){return utils[_0x1809('0x1a')](_0x5c8db4);})['then'](function(){return _0x415f0b(null,_0x5c8db4);})[_0x1809('0x1b')](function(_0x315028){return _0x415f0b(null,![],_0x315028);});}}else{if(_0x5c8db4[_0x1809('0xf')]){return _0x415f0b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x1809('0x1a')](_0x5c8db4)[_0x1809('0x19')](function(){return _0x415f0b(null,_0x5c8db4);});}}}});})['catch'](function(_0x557469){return _0x415f0b(null,![],_0x557469);});}function sendServiceMail(_0x58fb8d){return db[_0x1809('0x1c')][_0x1809('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x1809('0xd'),'email'],'include':[{'model':db[_0x1809('0x1e')],'as':_0x1809('0x1f'),'include':[{'model':db[_0x1809('0x20')],'as':_0x1809('0x20')}]}]})[_0x1809('0x19')](function(_0x59e2d1){if(!_0x59e2d1){throw new Error(_0x1809('0x21'));}var _0xdd9b59=_0x59e2d1[_0x1809('0x22')]();var _0x1a67a6={'account':_0xdd9b59,'message':_[_0x1809('0x23')]({'from':util[_0x1809('0x24')]('\x22%s\x22\x20<%s>',_0x59e2d1[_0x1809('0xd')],_0x59e2d1[_0x1809('0x25')]||_0x59e2d1[_0x1809('0x1f')][_0x1809('0x26')])},_0x58fb8d)};return client[_0x1809('0x27')]('SendMail',_0x1a67a6);})[_0x1809('0x19')](function(_0x4db7a5){if(_0x4db7a5[_0x1809('0x28')]){throw new Error(util[_0x1809('0x24')](_0x1809('0x29'),_0x4db7a5['error'][_0x1809('0x2a')]||JSON['stringify'](_0x4db7a5['error'])));}return!![];});}function handleError(_0x24b043,_0x4cd2ee,_0x5a5aa0){return _0x24b043[_0x1809('0x2b')](_0x4cd2ee||0x1f4)[_0x1809('0x2c')]({'message':_0x5a5aa0?_0x5a5aa0[_0x1809('0x2a')]||_0x5a5aa0:''});}exports[_0x1809('0x2d')]=function(_0x31a3bd,_0x42b30f,_0x123c38){passport['authenticate'](_0x1809('0x2e'),function(_0xcf6e51,_0x35441b,_0x522d2c){var _0x1ce223=_0xcf6e51||_0x522d2c;if(_0x1ce223){return handleError(_0x42b30f,0x191,_0x1ce223);}if(!_0x35441b){return handleError(_0x42b30f,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x95d79c={'payload':{'id':_0x35441b['id'],'role':_0x35441b[_0x1809('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x1809('0x2f')](_0x95d79c)[_0x1809('0x19')](function(_0x2ea1ce){_0x42b30f[_0x1809('0x30')]({'id':_0x35441b['id'],'token':_0x2ea1ce,'statusCall':'','isAlreadyLogged':_0x35441b[_0x1809('0x31')]});});}})(_0x31a3bd,_0x42b30f,_0x123c38);};exports['forgot']=function(_0x32027c,_0x1075c3){if(!_0x32027c[_0x1809('0x32')][_0x1809('0x25')]){return handleError(_0x1075c3,0x1f4,{'message':_0x1809('0x33')});}var _0x42dc52=rs[_0x1809('0x34')]();_0x32027c[_0x1809('0x32')]['email']=_0x32027c[_0x1809('0x32')][_0x1809('0x25')][_0x1809('0x35')]()[_0x1809('0x36')]();var _0x44c344;return db[_0x1809('0x9')][_0x1809('0xa')]({'where':{'id':0x1},'attributes':[_0x1809('0xb'),_0x1809('0xc')],'raw':!![]})[_0x1809('0x19')](function(_0x329ed3){_0x44c344=_0x329ed3;return db[_0x1809('0x37')][_0x1809('0x1d')]({'where':{'email':_0x32027c[_0x1809('0x32')][_0x1809('0x25')]}});})[_0x1809('0x19')](function(_0x2f8e69){if(!_0x2f8e69){throw new Error(_0x1809('0x38'));}if(_0x2f8e69['disabled']){throw new Error(_0x1809('0x39'));}if(_0x2f8e69[_0x1809('0xf')]){if(moment(_0x2f8e69[_0x1809('0x10')])[_0x1809('0x16')](_0x44c344['blockDuration'],_0x1809('0x17'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x2f8e69[_0x1809('0xf')]=![];_0x2f8e69[_0x1809('0x10')]=null;}}_0x2f8e69[_0x1809('0x3a')]=_0x42dc52;_0x2f8e69[_0x1809('0x3b')]=Date[_0x1809('0x3c')]()+0x36ee80;return _0x2f8e69[_0x1809('0x3d')]();})[_0x1809('0x19')](function(){return sendServiceMail({'to':_0x32027c['body'][_0x1809('0x25')],'subject':_0x1809('0x3e'),'text':_0x1809('0x3f')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x1809('0x40')+_0x32027c[_0x1809('0x41')][_0x1809('0x42')]+'/reset/'+_0x42dc52+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x1809('0x19')](function(){_0x1075c3[_0x1809('0x2b')](0xc8)[_0x1809('0x2c')]({'message':_0x1809('0x43')});})[_0x1809('0x1b')](function(_0x210a9a){return handleError(_0x1075c3,0x1f4,_0x210a9a);});};exports[_0x1809('0x44')]=function(_0x6a6918,_0x1d535b){return db[_0x1809('0x37')]['find']({'where':{'resetPasswordToken':_0x6a6918['params'][_0x1809('0x45')],'resetPasswordExpires':{'$gt':Date[_0x1809('0x3c')]()}}})[_0x1809('0x19')](function(_0x4a68f4){if(!_0x4a68f4){throw new Error(_0x1809('0x46'));}return db[_0x1809('0x9')][_0x1809('0xa')]({'attributes':['id',_0x1809('0x47'),'enforcePasswordHistory',_0x1809('0x48')]})[_0x1809('0x19')](function(_0x4a058a){if(_0x4a058a[_0x1809('0x47')])authService['validatePasswordPattern'](_0x6a6918[_0x1809('0x32')][_0x1809('0x49')]);if(!_0x4a058a['enforcePasswordHistory']||!_0x4a68f4[_0x1809('0x4a')])return _0x4a68f4;authService[_0x1809('0x4b')](_0x6a6918['body'][_0x1809('0x49')],_0x4a68f4[_0x1809('0x4a')],_0x4a058a['passwordHistoryLimit']);return _0x4a68f4;})[_0x1809('0x19')](function(){_0x4a68f4[_0x1809('0x49')]=_0x6a6918[_0x1809('0x32')][_0x1809('0x49')];_0x4a68f4[_0x1809('0x3a')]=null;_0x4a68f4['resetPasswordExpires']=null;return _0x4a68f4[_0x1809('0x3d')]();});})[_0x1809('0x19')](function(){_0x1d535b['status'](0xc8)['send']({'message':_0x1809('0x4c')});})[_0x1809('0x1b')](function(_0x4971fe){return handleError(_0x1d535b,0x1f4,_0x4971fe);});};passport['use']('local-login',new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x3a1156,_0x37539a,_0x5430b2){return localAuthenticate(db[_0x1809('0x37')],_0x3a1156,_0x37539a,_0x5430b2);}));
\ No newline at end of file
+var _0xc278=['You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordToken','resetPasswordExpires','Password\x20reset!','use','util','passport','lodash','moment','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','catch','getLicense','MailAccount','find','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','Smtp','request','SendMail','error','message','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','save','xCally\x20Motion\x20Password\x20Reset'];(function(_0x4b72b8,_0x15d0f7){var _0x27fcbf=function(_0x8d8af1){while(--_0x8d8af1){_0x4b72b8['push'](_0x4b72b8['shift']());}};_0x27fcbf(++_0x15d0f7);}(_0xc278,0x1f4));var _0x8c27=function(_0x3ccd4f,_0x434f7b){_0x3ccd4f=_0x3ccd4f-0x0;var _0x3761cc=_0xc278[_0x3ccd4f];return _0x3761cc;};'use strict';var util=require(_0x8c27('0x0'));var passport=require(_0x8c27('0x1'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require('jayson/promise');var _=require(_0x8c27('0x2'));var rs=require('randomstring');var moment=require(_0x8c27('0x3'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x8c27('0x4'));var client=jayson[_0x8c27('0x5')][_0x8c27('0x6')]({'port':0x232b});function localAuthenticate(_0x35b5a4,_0x436e12,_0x4c677e,_0x4cebe4){var _0x14e232,_0x32f687;return db[_0x8c27('0x7')][_0x8c27('0x8')]({'where':{'id':0x1},'attributes':[_0x8c27('0x9'),_0x8c27('0xa')],'raw':!![]})[_0x8c27('0xb')](function(_0x4e2b47){_0x14e232=_0x4e2b47;return _0x35b5a4[_0x8c27('0x8')]({'attributes':['id',_0x8c27('0xc'),_0x8c27('0xd'),_0x8c27('0xe'),_0x8c27('0xf'),_0x8c27('0x10'),_0x8c27('0x11'),_0x8c27('0x12'),'loginAttempts'],'where':{'name':_0x436e12,'role':{'$or':[_0x8c27('0x13'),_0x8c27('0x14'),'agent']}}});})[_0x8c27('0xb')](function(_0x50cb8e){if(!_0x50cb8e||_0x50cb8e&&_0x50cb8e[_0x8c27('0xc')]!==_0x436e12){throw new Error(_0x8c27('0x15'));}else{_0x32f687=_0x50cb8e;return _0x32f687;}})[_0x8c27('0xb')](function(){_0x32f687[_0x8c27('0x16')](_0x4c677e,function(_0x336deb,_0x59e502){var _0x1230e0=_0x32f687['loginAttempts']+0x1;if(_0x336deb){return _0x4cebe4(_0x336deb);}else if(!_0x59e502){if(_0x32f687['disabled']){return _0x4cebe4(null,![],{'message':_0x8c27('0x15')});}else if(_0x14e232['allowedLoginAttempts']>0x0){if(_0x32f687[_0x8c27('0x11')]){if(_0x14e232[_0x8c27('0xa')]>0x0){if(moment(_0x32f687[_0x8c27('0x12')])[_0x8c27('0x17')](_0x14e232[_0x8c27('0xa')],_0x8c27('0x18'))>moment()){return _0x4cebe4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x8c27('0x19')](_0x32f687,_0x1230e0,![],null)['then'](function(){return _0x4cebe4(null,![],{'message':_0x8c27('0x15')});});}}else{return _0x4cebe4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x1230e0>=_0x14e232[_0x8c27('0x9')]){return utils[_0x8c27('0x19')](_0x32f687,0x0,!![],moment())['then'](function(){return _0x4cebe4(null,![],{'message':_0x8c27('0x15')});});}else{return utils['clearBlockUser'](_0x32f687,_0x1230e0,![],null)[_0x8c27('0xb')](function(){return _0x4cebe4(null,![],{'message':_0x8c27('0x15')});});}}}else{return _0x4cebe4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x32f687[_0x8c27('0x10')]){return _0x4cebe4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x14e232['allowedLoginAttempts']>0x0){if(_0x32f687[_0x8c27('0x11')]){if(_0x14e232[_0x8c27('0xa')]>0x0){if(moment(_0x32f687[_0x8c27('0x12')])[_0x8c27('0x17')](_0x14e232[_0x8c27('0xa')],'minutes')>moment()){return _0x4cebe4(null,![],{'message':_0x8c27('0x15')});}else{return utils[_0x8c27('0x19')](_0x32f687,0x0,![],null)[_0x8c27('0xb')](function(){return utils['getLicense'](_0x32f687);})[_0x8c27('0xb')](function(){return _0x4cebe4(null,_0x32f687);});}}else{return _0x4cebe4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x8c27('0x19')](_0x32f687,0x0,![],null)['then'](function(){return utils['getLicense'](_0x32f687);})[_0x8c27('0xb')](function(){return _0x4cebe4(null,_0x32f687);})[_0x8c27('0x1a')](function(_0x48bc40){return _0x4cebe4(null,![],_0x48bc40);});}}else{if(_0x32f687[_0x8c27('0x11')]){return _0x4cebe4(null,![],{'message':_0x8c27('0x15')});}else{return utils[_0x8c27('0x1b')](_0x32f687)[_0x8c27('0xb')](function(){return _0x4cebe4(null,_0x32f687);});}}}});})[_0x8c27('0x1a')](function(_0x48d951){return _0x4cebe4(null,![],_0x48d951);});}function sendServiceMail(_0x2d9875){return db[_0x8c27('0x1c')][_0x8c27('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x8c27('0xc'),_0x8c27('0x1e')],'include':[{'model':db[_0x8c27('0x1f')],'as':'Smtp','include':[{'model':db[_0x8c27('0x20')],'as':_0x8c27('0x20')}]}]})[_0x8c27('0xb')](function(_0x1becd5){if(!_0x1becd5){throw new Error(_0x8c27('0x21'));}var _0x4bd2db=_0x1becd5[_0x8c27('0x22')]();var _0x168575={'account':_0x4bd2db,'message':_[_0x8c27('0x23')]({'from':util[_0x8c27('0x24')](_0x8c27('0x25'),_0x1becd5[_0x8c27('0xc')],_0x1becd5[_0x8c27('0x1e')]||_0x1becd5[_0x8c27('0x26')]['user'])},_0x2d9875)};return client[_0x8c27('0x27')](_0x8c27('0x28'),_0x168575);})['then'](function(_0x3f63b6){if(_0x3f63b6[_0x8c27('0x29')]){throw new Error(util[_0x8c27('0x24')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x3f63b6[_0x8c27('0x29')][_0x8c27('0x2a')]||JSON['stringify'](_0x3f63b6[_0x8c27('0x29')])));}return!![];});}function handleError(_0x4b6f25,_0x117309,_0x4ba1ba){return _0x4b6f25[_0x8c27('0x2b')](_0x117309||0x1f4)[_0x8c27('0x2c')]({'message':_0x4ba1ba?_0x4ba1ba[_0x8c27('0x2a')]||_0x4ba1ba:''});}exports[_0x8c27('0x2d')]=function(_0x38fa1a,_0xcdaf3f,_0x55387f){passport[_0x8c27('0x16')](_0x8c27('0x2e'),function(_0x500335,_0xbcba2c,_0x93636d){var _0x1411e0=_0x500335||_0x93636d;if(_0x1411e0){return handleError(_0xcdaf3f,0x191,_0x1411e0);}if(!_0xbcba2c){return handleError(_0xcdaf3f,0x194,{'message':_0x8c27('0x2f')});}else{var _0x2fc018={'payload':{'id':_0xbcba2c['id'],'role':_0xbcba2c[_0x8c27('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x8c27('0x30')](_0x2fc018)[_0x8c27('0xb')](function(_0x3d33ce){_0xcdaf3f[_0x8c27('0x31')]({'id':_0xbcba2c['id'],'token':_0x3d33ce,'statusCall':'','isAlreadyLogged':_0xbcba2c[_0x8c27('0x32')]});});}})(_0x38fa1a,_0xcdaf3f,_0x55387f);};exports[_0x8c27('0x33')]=function(_0x395578,_0x284b58){if(!_0x395578[_0x8c27('0x34')][_0x8c27('0x1e')]){return handleError(_0x284b58,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0xa2e2f9=rs[_0x8c27('0x35')]();_0x395578['body'][_0x8c27('0x1e')]=_0x395578['body'][_0x8c27('0x1e')][_0x8c27('0x36')]()['toLowerCase']();var _0x1650b1;return db[_0x8c27('0x7')][_0x8c27('0x8')]({'where':{'id':0x1},'attributes':[_0x8c27('0x9'),_0x8c27('0xa')],'raw':!![]})[_0x8c27('0xb')](function(_0x44ef46){_0x1650b1=_0x44ef46;return db[_0x8c27('0x37')][_0x8c27('0x1d')]({'where':{'email':_0x395578[_0x8c27('0x34')]['email']}});})['then'](function(_0xe41564){if(!_0xe41564){throw new Error(_0x8c27('0x38'));}if(_0xe41564[_0x8c27('0x10')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0xe41564['blocked']){if(moment(_0xe41564[_0x8c27('0x12')])['add'](_0x1650b1['blockDuration'],_0x8c27('0x18'))>moment()){throw new Error(_0x8c27('0x39'));}else{_0xe41564[_0x8c27('0x11')]=![];_0xe41564[_0x8c27('0x12')]=null;}}_0xe41564['resetPasswordToken']=_0xa2e2f9;_0xe41564['resetPasswordExpires']=Date['now']()+0x36ee80;return _0xe41564[_0x8c27('0x3a')]();})[_0x8c27('0xb')](function(){return sendServiceMail({'to':_0x395578[_0x8c27('0x34')][_0x8c27('0x1e')],'subject':_0x8c27('0x3b'),'text':_0x8c27('0x3c')+_0x8c27('0x3d')+_0x8c27('0x3e')+_0x395578[_0x8c27('0x3f')][_0x8c27('0x40')]+_0x8c27('0x41')+_0xa2e2f9+'\x0a\x0a'+_0x8c27('0x42')});})[_0x8c27('0xb')](function(){_0x284b58[_0x8c27('0x2b')](0xc8)[_0x8c27('0x2c')]({'message':'Reset\x20Email\x20sent!'});})[_0x8c27('0x1a')](function(_0x4a762a){return handleError(_0x284b58,0x1f4,_0x4a762a);});};exports['reset']=function(_0x59fe35,_0x301c4f){return db[_0x8c27('0x37')][_0x8c27('0x1d')]({'where':{'resetPasswordToken':_0x59fe35[_0x8c27('0x43')][_0x8c27('0x44')],'resetPasswordExpires':{'$gt':Date[_0x8c27('0x45')]()}}})[_0x8c27('0xb')](function(_0x5e11d3){if(!_0x5e11d3){throw new Error(_0x8c27('0x46'));}return db[_0x8c27('0x7')][_0x8c27('0x8')]({'attributes':['id',_0x8c27('0x47'),_0x8c27('0x48'),'passwordHistoryLimit']})[_0x8c27('0xb')](function(_0x571dc1){if(_0x571dc1[_0x8c27('0x47')])authService['validatePasswordPattern'](_0x59fe35['body'][_0x8c27('0xd')]);if(!_0x571dc1[_0x8c27('0x48')]||!_0x5e11d3[_0x8c27('0x49')])return _0x5e11d3;authService[_0x8c27('0x4a')](_0x59fe35[_0x8c27('0x34')][_0x8c27('0xd')],_0x5e11d3[_0x8c27('0x49')],_0x571dc1[_0x8c27('0x4b')]);return _0x5e11d3;})['then'](function(){_0x5e11d3['password']=_0x59fe35[_0x8c27('0x34')][_0x8c27('0xd')];_0x5e11d3[_0x8c27('0x4c')]=null;_0x5e11d3[_0x8c27('0x4d')]=null;return _0x5e11d3[_0x8c27('0x3a')]();});})[_0x8c27('0xb')](function(){_0x301c4f[_0x8c27('0x2b')](0xc8)[_0x8c27('0x2c')]({'message':_0x8c27('0x4e')});})[_0x8c27('0x1a')](function(_0x5ba874){return handleError(_0x301c4f,0x1f4,_0x5ba874);});};passport[_0x8c27('0x4f')](_0x8c27('0x2e'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x5eaa8c,_0x45c5e6,_0x41ae9a){return localAuthenticate(db[_0x8c27('0x37')],_0x5eaa8c,_0x45c5e6,_0x41ae9a);}));
\ No newline at end of file
index ba1be3f..61b1786 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ac1=['reset','exports','post','/forgot','forgot','/reset/:token'];(function(_0x154cb5,_0x1a8d5a){var _0x3f574f=function(_0x597a52){while(--_0x597a52){_0x154cb5['push'](_0x154cb5['shift']());}};_0x3f574f(++_0x1a8d5a);}(_0x9ac1,0x146));var _0x19ac=function(_0x915aab,_0x47ca95){_0x915aab=_0x915aab-0x0;var _0x300a7d=_0x9ac1[_0x915aab];return _0x300a7d;};'use strict';var express=require('express');var router=express['Router']();var controller=require('./authLocal.controller');router[_0x19ac('0x0')]('/',controller['login']);router[_0x19ac('0x0')](_0x19ac('0x1'),controller[_0x19ac('0x2')]);router[_0x19ac('0x0')](_0x19ac('0x3'),controller[_0x19ac('0x4')]);module[_0x19ac('0x5')]=router;
\ No newline at end of file
+var _0x59fd=['forgot','/reset/:token','reset','exports','Router','post','login','/forgot'];(function(_0x2fbaa4,_0x1f5e49){var _0x1a50d6=function(_0x5290a0){while(--_0x5290a0){_0x2fbaa4['push'](_0x2fbaa4['shift']());}};_0x1a50d6(++_0x1f5e49);}(_0x59fd,0x1dc));var _0xd59f=function(_0x26ab88,_0x4ef1bf){_0x26ab88=_0x26ab88-0x0;var _0x276b1c=_0x59fd[_0x26ab88];return _0x276b1c;};'use strict';var express=require('express');var router=express[_0xd59f('0x0')]();var controller=require('./authLocal.controller');router[_0xd59f('0x1')]('/',controller[_0xd59f('0x2')]);router[_0xd59f('0x1')](_0xd59f('0x3'),controller[_0xd59f('0x4')]);router[_0xd59f('0x1')](_0xd59f('0x5'),controller[_0xd59f('0x6')]);module[_0xd59f('0x7')]=router;
\ No newline at end of file
index a6ad497..0888a93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5867=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x5867,0x150));var _0x7586=function(_0x1a0e25,_0x4d3c1f){_0x1a0e25=_0x1a0e25-0x0;var _0x33d1e4=_0x5867[_0x1a0e25];return _0x33d1e4;};'use strict';var Sequelize=require(_0x7586('0x0'));module[_0x7586('0x1')]={'name':{'type':Sequelize[_0x7586('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x7586('0x2')]},'description':{'type':Sequelize[_0x7586('0x2')]},'status':{'type':Sequelize[_0x7586('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x7586('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x382c=['STRING','BOOLEAN','INTEGER','exports'];(function(_0x596f6e,_0x3f8857){var _0x1e0803=function(_0x31f91f){while(--_0x31f91f){_0x596f6e['push'](_0x596f6e['shift']());}};_0x1e0803(++_0x3f8857);}(_0x382c,0xcb));var _0xc382=function(_0x117643,_0x2b3351){_0x117643=_0x117643-0x0;var _0x4f9ce1=_0x382c[_0x117643];return _0x4f9ce1;};'use strict';var Sequelize=require('sequelize');module[_0xc382('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc382('0x1')]},'status':{'type':Sequelize[_0xc382('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xc382('0x3')],'defaultValue':0xa}};
\ No newline at end of file
index b062cb2..bb634c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf676=['end','json','undefined','count','offset','limit','status','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','Automation','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','catch','show','params','includeAll','include','find','create','body','update','destroy','addConditions','ids','omit','getConditions','findOne','Condition','addActions','Action','getActions','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x2e2cae,_0x20132a){var _0x43fa43=function(_0xc32b80){while(--_0xc32b80){_0x2e2cae['push'](_0x2e2cae['shift']());}};_0x43fa43(++_0x20132a);}(_0xf676,0xe9));var _0x6f67=function(_0x56984b,_0x4bd909){_0x56984b=_0x56984b-0x0;var _0x42024b=_0xf676[_0x56984b];return _0x42024b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6f67('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f67('0x1'));var rp=require(_0x6f67('0x2'));var moment=require(_0x6f67('0x3'));var BPromise=require(_0x6f67('0x4'));var Mustache=require(_0x6f67('0x5'));var util=require(_0x6f67('0x6'));var path=require(_0x6f67('0x7'));var sox=require(_0x6f67('0x8'));var csv=require(_0x6f67('0x9'));var ejs=require(_0x6f67('0xa'));var fs=require('fs');var fs_extra=require(_0x6f67('0xb'));var _=require(_0x6f67('0xc'));var squel=require(_0x6f67('0xd'));var crypto=require('crypto');var jsforce=require(_0x6f67('0xe'));var deskjs=require(_0x6f67('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6f67('0x10'));var Papa=require(_0x6f67('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6f67('0x12'));var as=require(_0x6f67('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6f67('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x6f67('0x15'));var licenseUtil=require(_0x6f67('0x16'));var db=require(_0x6f67('0x17'))['db'];function respondWithStatusCode(_0x407b9c,_0x342d2f){_0x342d2f=_0x342d2f||0xcc;return function(_0x774cb7){if(_0x774cb7){return _0x407b9c[_0x6f67('0x18')](_0x342d2f);}return _0x407b9c['status'](_0x342d2f)[_0x6f67('0x19')]();};}function respondWithResult(_0xd02d46,_0x49abe1){_0x49abe1=_0x49abe1||0xc8;return function(_0x4edfec){if(_0x4edfec){return _0xd02d46['status'](_0x49abe1)[_0x6f67('0x1a')](_0x4edfec);}};}function respondWithFilteredResult(_0x471e5a,_0x37b084){return function(_0x279b9e){if(_0x279b9e){var _0x583ff9=typeof _0x37b084['offset']===_0x6f67('0x1b')&&typeof _0x37b084['limit']===_0x6f67('0x1b');var _0xb8b58=_0x279b9e[_0x6f67('0x1c')];var _0x104565=_0x583ff9?0x0:_0x37b084['offset'];var _0x253f61=_0x583ff9?_0x279b9e['count']:_0x37b084[_0x6f67('0x1d')]+_0x37b084[_0x6f67('0x1e')];var _0x5380f6;if(_0x253f61>=_0xb8b58){_0x253f61=_0xb8b58;_0x5380f6=0xc8;}else{_0x5380f6=0xce;}_0x471e5a[_0x6f67('0x1f')](_0x5380f6);return _0x471e5a[_0x6f67('0x20')](_0x6f67('0x21'),_0x104565+'-'+_0x253f61+'/'+_0xb8b58)[_0x6f67('0x1a')](_0x279b9e);}return null;};}function patchUpdates(_0x51b0e4){return function(_0x27cf4d){try{jsonpatch[_0x6f67('0x22')](_0x27cf4d,_0x51b0e4,!![]);}catch(_0x46e32b){return BPromise[_0x6f67('0x23')](_0x46e32b);}return _0x27cf4d[_0x6f67('0x24')]();};}function saveUpdates(_0x1ccf68,_0x24b5ef){return function(_0x222f62){if(_0x222f62){return _0x222f62['update'](_0x1ccf68)['then'](function(_0x516f62){return _0x516f62;});}return null;};}function removeEntity(_0x729104,_0x481584){return function(_0x588db5){if(_0x588db5){return _0x588db5['destroy']()[_0x6f67('0x25')](function(){_0x729104[_0x6f67('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x429eac,_0x35f84b){return function(_0x5c3615){if(!_0x5c3615){_0x429eac['sendStatus'](0x194);}return _0x5c3615;};}function handleError(_0xa1da90,_0x17aaa6){_0x17aaa6=_0x17aaa6||0x1f4;return function(_0x134fcc){logger[_0x6f67('0x26')](_0x134fcc[_0x6f67('0x27')]);if(_0x134fcc[_0x6f67('0x28')]){delete _0x134fcc[_0x6f67('0x28')];}_0xa1da90[_0x6f67('0x1f')](_0x17aaa6)[_0x6f67('0x29')](_0x134fcc);};}exports[_0x6f67('0x2a')]=function(_0x28e545,_0x8aeef8){var _0x41f871={},_0x2fc627={},_0x6041f4={'count':0x0,'rows':[]};var _0x3f976d=_['map'](db[_0x6f67('0x2b')][_0x6f67('0x2c')],function(_0x19c3d2){return{'name':_0x19c3d2[_0x6f67('0x2d')],'type':_0x19c3d2[_0x6f67('0x2e')]['key']};});_0x2fc627[_0x6f67('0x2f')]=_[_0x6f67('0x30')](_0x3f976d,'name');_0x2fc627[_0x6f67('0x31')]=_[_0x6f67('0x32')](_0x28e545['query']);_0x2fc627[_0x6f67('0x33')]=_[_0x6f67('0x34')](_0x2fc627[_0x6f67('0x2f')],_0x2fc627[_0x6f67('0x31')]);_0x41f871[_0x6f67('0x35')]=_[_0x6f67('0x34')](_0x2fc627[_0x6f67('0x2f')],qs[_0x6f67('0x36')](_0x28e545['query'][_0x6f67('0x36')]));_0x41f871[_0x6f67('0x35')]=_0x41f871[_0x6f67('0x35')][_0x6f67('0x37')]?_0x41f871['attributes']:_0x2fc627['model'];if(!_0x28e545[_0x6f67('0x31')][_0x6f67('0x38')](_0x6f67('0x39'))){_0x41f871[_0x6f67('0x1e')]=qs[_0x6f67('0x1e')](_0x28e545[_0x6f67('0x31')][_0x6f67('0x1e')]);_0x41f871['offset']=qs[_0x6f67('0x1d')](_0x28e545[_0x6f67('0x31')]['offset']);}_0x41f871[_0x6f67('0x3a')]=qs[_0x6f67('0x3b')](_0x28e545['query']['sort']);_0x41f871[_0x6f67('0x3c')]=qs[_0x6f67('0x33')](_[_0x6f67('0x3d')](_0x28e545['query'],_0x2fc627[_0x6f67('0x33')]),_0x3f976d);if(_0x28e545['query'][_0x6f67('0x3e')]){_0x41f871[_0x6f67('0x3c')]=_[_0x6f67('0x3f')](_0x41f871[_0x6f67('0x3c')],{'$or':_['map'](_0x3f976d,function(_0x5b07e0){if(_0x5b07e0[_0x6f67('0x2e')]!==_0x6f67('0x40')){var _0x331c5c={};_0x331c5c[_0x5b07e0[_0x6f67('0x28')]]={'$like':'%'+_0x28e545['query'][_0x6f67('0x3e')]+'%'};return _0x331c5c;}})});}_0x41f871=_[_0x6f67('0x3f')]({},_0x41f871,_0x28e545[_0x6f67('0x41')]);var _0x5374d2={'where':_0x41f871['where']};return db[_0x6f67('0x2b')]['count'](_0x5374d2)[_0x6f67('0x25')](function(_0x18d9ad){_0x6041f4[_0x6f67('0x1c')]=_0x18d9ad;if(_0x28e545[_0x6f67('0x31')]['includeAll']){_0x41f871['include']=[{'all':!![]}];}return db[_0x6f67('0x2b')][_0x6f67('0x42')](_0x41f871);})[_0x6f67('0x25')](function(_0x8a0b6e){_0x6041f4['rows']=_0x8a0b6e;return _0x6041f4;})['then'](respondWithFilteredResult(_0x8aeef8,_0x41f871))[_0x6f67('0x43')](handleError(_0x8aeef8,null));};exports[_0x6f67('0x44')]=function(_0x5b1d1e,_0x119bc6){var _0x3a2653={'raw':![],'where':{'id':_0x5b1d1e[_0x6f67('0x45')]['id']}},_0x296bad={};_0x296bad[_0x6f67('0x2f')]=_[_0x6f67('0x32')](db[_0x6f67('0x2b')][_0x6f67('0x2c')]);_0x296bad[_0x6f67('0x31')]=_['keys'](_0x5b1d1e[_0x6f67('0x31')]);_0x296bad['filters']=_[_0x6f67('0x34')](_0x296bad[_0x6f67('0x2f')],_0x296bad[_0x6f67('0x31')]);_0x3a2653['attributes']=_['intersection'](_0x296bad['model'],qs[_0x6f67('0x36')](_0x5b1d1e[_0x6f67('0x31')][_0x6f67('0x36')]));_0x3a2653[_0x6f67('0x35')]=_0x3a2653['attributes']['length']?_0x3a2653[_0x6f67('0x35')]:_0x296bad['model'];if(_0x5b1d1e['query'][_0x6f67('0x46')]){_0x3a2653[_0x6f67('0x47')]=[{'all':!![]}];}_0x3a2653=_[_0x6f67('0x3f')]({},_0x3a2653,_0x5b1d1e[_0x6f67('0x41')]);return db[_0x6f67('0x2b')][_0x6f67('0x48')](_0x3a2653)[_0x6f67('0x25')](handleEntityNotFound(_0x119bc6,null))[_0x6f67('0x25')](respondWithResult(_0x119bc6,null))[_0x6f67('0x43')](handleError(_0x119bc6,null));};exports[_0x6f67('0x49')]=function(_0x4be24a,_0x472fab){return db['Automation']['create'](_0x4be24a[_0x6f67('0x4a')],{})[_0x6f67('0x25')](respondWithResult(_0x472fab,0xc9))[_0x6f67('0x43')](handleError(_0x472fab,null));};exports[_0x6f67('0x4b')]=function(_0x5aec68,_0x596306){if(_0x5aec68['body']['id']){delete _0x5aec68[_0x6f67('0x4a')]['id'];}return db[_0x6f67('0x2b')][_0x6f67('0x48')]({'where':{'id':_0x5aec68[_0x6f67('0x45')]['id']}})[_0x6f67('0x25')](handleEntityNotFound(_0x596306,null))['then'](saveUpdates(_0x5aec68[_0x6f67('0x4a')],null))[_0x6f67('0x25')](respondWithResult(_0x596306,null))['catch'](handleError(_0x596306,null));};exports[_0x6f67('0x4c')]=function(_0x2880c7,_0x381096){return db[_0x6f67('0x2b')]['find']({'where':{'id':_0x2880c7[_0x6f67('0x45')]['id']}})[_0x6f67('0x25')](handleEntityNotFound(_0x381096,null))['then'](removeEntity(_0x381096,null))[_0x6f67('0x43')](handleError(_0x381096,null));};exports[_0x6f67('0x4d')]=function(_0x56ddfd,_0x867604,_0x33cf57){return db['Condition'][_0x6f67('0x48')]({'where':{'id':_0x56ddfd['params']['id']}})[_0x6f67('0x25')](handleEntityNotFound(_0x867604,null))[_0x6f67('0x25')](function(_0x2cff79){if(_0x2cff79){return _0x2cff79[_0x6f67('0x4d')](_0x56ddfd['body'][_0x6f67('0x4e')],_[_0x6f67('0x4f')](_0x56ddfd[_0x6f67('0x4a')],[_0x6f67('0x4e'),'id'])||{});}})[_0x6f67('0x25')](respondWithResult(_0x867604,null))[_0x6f67('0x43')](handleError(_0x867604,null));};exports[_0x6f67('0x50')]=function(_0x2c5f37,_0x4117cc,_0x64fc3a){var _0x12c918={};var _0x231fe6={};var _0x42adf3;var _0x2057eb;return db[_0x6f67('0x2b')][_0x6f67('0x51')]({'where':{'id':_0x2c5f37['params']['id']}})['then'](handleEntityNotFound(_0x4117cc,null))['then'](function(_0xe9e5d4){if(_0xe9e5d4){_0x42adf3=_0xe9e5d4;_0x231fe6[_0x6f67('0x2f')]=_[_0x6f67('0x32')](db[_0x6f67('0x52')][_0x6f67('0x2c')]);_0x231fe6[_0x6f67('0x31')]=_[_0x6f67('0x32')](_0x2c5f37[_0x6f67('0x31')]);_0x231fe6[_0x6f67('0x33')]=_[_0x6f67('0x34')](_0x231fe6[_0x6f67('0x2f')],_0x231fe6['query']);_0x12c918['attributes']=_[_0x6f67('0x34')](_0x231fe6[_0x6f67('0x2f')],qs[_0x6f67('0x36')](_0x2c5f37[_0x6f67('0x31')][_0x6f67('0x36')]));_0x12c918['attributes']=_0x12c918['attributes']['length']?_0x12c918['attributes']:_0x231fe6[_0x6f67('0x2f')];_0x12c918[_0x6f67('0x3a')]=qs[_0x6f67('0x3b')](_0x2c5f37[_0x6f67('0x31')][_0x6f67('0x3b')]);_0x12c918[_0x6f67('0x3c')]=qs[_0x6f67('0x33')](_[_0x6f67('0x3d')](_0x2c5f37[_0x6f67('0x31')],_0x231fe6['filters']));if(_0x2c5f37['query'][_0x6f67('0x3e')]){_0x12c918['where']=_[_0x6f67('0x3f')](_0x12c918[_0x6f67('0x3c')],{'$or':_[_0x6f67('0x30')](_0x12c918[_0x6f67('0x35')],function(_0x5c26b0){var _0x5c42b4={};_0x5c42b4[_0x5c26b0]={'$like':'%'+_0x2c5f37[_0x6f67('0x31')][_0x6f67('0x3e')]+'%'};return _0x5c42b4;})});}_0x12c918=_[_0x6f67('0x3f')]({},_0x12c918,_0x2c5f37[_0x6f67('0x41')]);return _0x42adf3['getConditions'](_0x12c918);}})[_0x6f67('0x25')](function(_0x546dff){if(_0x546dff){_0x2057eb=_0x546dff[_0x6f67('0x37')];if(!_0x2c5f37[_0x6f67('0x31')][_0x6f67('0x38')](_0x6f67('0x39'))){_0x12c918[_0x6f67('0x1e')]=qs[_0x6f67('0x1e')](_0x2c5f37['query'][_0x6f67('0x1e')]);_0x12c918[_0x6f67('0x1d')]=qs[_0x6f67('0x1d')](_0x2c5f37['query'][_0x6f67('0x1d')]);}return _0x42adf3[_0x6f67('0x50')](_0x12c918);}})['then'](function(_0x40d6da){if(_0x40d6da){return _0x40d6da?{'count':_0x2057eb,'rows':_0x40d6da}:null;}})['then'](respondWithResult(_0x4117cc,null))[_0x6f67('0x43')](handleError(_0x4117cc,null));};exports[_0x6f67('0x53')]=function(_0x4816dd,_0x505b75,_0x509f57){return db[_0x6f67('0x54')]['find']({'where':{'id':_0x4816dd[_0x6f67('0x45')]['id']}})[_0x6f67('0x25')](handleEntityNotFound(_0x505b75,null))[_0x6f67('0x25')](function(_0x5430cf){if(_0x5430cf){return _0x5430cf[_0x6f67('0x53')](_0x4816dd[_0x6f67('0x4a')][_0x6f67('0x4e')],_['omit'](_0x4816dd[_0x6f67('0x4a')],[_0x6f67('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x505b75,null))[_0x6f67('0x43')](handleError(_0x505b75,null));};exports[_0x6f67('0x55')]=function(_0x556744,_0x447f4e,_0x2d3e05){var _0x1165ac={};var _0x3e4dcf={};var _0x2457fe;var _0x185e74;return db[_0x6f67('0x2b')]['findOne']({'where':{'id':_0x556744['params']['id']}})[_0x6f67('0x25')](handleEntityNotFound(_0x447f4e,null))[_0x6f67('0x25')](function(_0x441eae){if(_0x441eae){_0x2457fe=_0x441eae;_0x3e4dcf[_0x6f67('0x2f')]=_[_0x6f67('0x32')](db[_0x6f67('0x54')][_0x6f67('0x2c')]);_0x3e4dcf[_0x6f67('0x31')]=_[_0x6f67('0x32')](_0x556744['query']);_0x3e4dcf[_0x6f67('0x33')]=_['intersection'](_0x3e4dcf[_0x6f67('0x2f')],_0x3e4dcf['query']);_0x1165ac['attributes']=_[_0x6f67('0x34')](_0x3e4dcf[_0x6f67('0x2f')],qs['fields'](_0x556744[_0x6f67('0x31')][_0x6f67('0x36')]));_0x1165ac[_0x6f67('0x35')]=_0x1165ac['attributes']['length']?_0x1165ac['attributes']:_0x3e4dcf[_0x6f67('0x2f')];_0x1165ac[_0x6f67('0x3a')]=qs[_0x6f67('0x3b')](_0x556744[_0x6f67('0x31')][_0x6f67('0x3b')]);_0x1165ac[_0x6f67('0x3c')]=qs[_0x6f67('0x33')](_[_0x6f67('0x3d')](_0x556744['query'],_0x3e4dcf[_0x6f67('0x33')]));if(_0x556744[_0x6f67('0x31')][_0x6f67('0x3e')]){_0x1165ac[_0x6f67('0x3c')]=_[_0x6f67('0x3f')](_0x1165ac[_0x6f67('0x3c')],{'$or':_[_0x6f67('0x30')](_0x1165ac['attributes'],function(_0x244c4d){var _0x5d14af={};_0x5d14af[_0x244c4d]={'$like':'%'+_0x556744[_0x6f67('0x31')][_0x6f67('0x3e')]+'%'};return _0x5d14af;})});}_0x1165ac=_[_0x6f67('0x3f')]({},_0x1165ac,_0x556744['options']);return _0x2457fe['getActions'](_0x1165ac);}})[_0x6f67('0x25')](function(_0x4618f){if(_0x4618f){_0x185e74=_0x4618f[_0x6f67('0x37')];if(!_0x556744[_0x6f67('0x31')][_0x6f67('0x38')]('nolimit')){_0x1165ac[_0x6f67('0x1e')]=qs[_0x6f67('0x1e')](_0x556744['query'][_0x6f67('0x1e')]);_0x1165ac[_0x6f67('0x1d')]=qs[_0x6f67('0x1d')](_0x556744[_0x6f67('0x31')]['offset']);}return _0x2457fe[_0x6f67('0x55')](_0x1165ac);}})[_0x6f67('0x25')](function(_0x431024){if(_0x431024){return _0x431024?{'count':_0x185e74,'rows':_0x431024}:null;}})[_0x6f67('0x25')](respondWithResult(_0x447f4e,null))[_0x6f67('0x43')](handleError(_0x447f4e,null));};
\ No newline at end of file
+var _0xf88b=['keys','find','create','body','params','Condition','omit','ids','findOne','sort','pick','options','getConditions','addActions','Action','getActions','hasOwnProperty','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','type','key','query','filters','model','attributes','intersection','fields','length','nolimit','order','where','filter','merge','includeAll','include','findAll','catch','show'];(function(_0x2335e6,_0x1bade8){var _0x370a50=function(_0x12d7cf){while(--_0x12d7cf){_0x2335e6['push'](_0x2335e6['shift']());}};_0x370a50(++_0x1bade8);}(_0xf88b,0x1b0));var _0xbf88=function(_0x3f7d36,_0x1b1474){_0x3f7d36=_0x3f7d36-0x0;var _0x1d5259=_0xf88b[_0x3f7d36];return _0x1d5259;};'use strict';var emlformat=require(_0xbf88('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbf88('0x1'));var jsonpatch=require(_0xbf88('0x2'));var rp=require(_0xbf88('0x3'));var moment=require(_0xbf88('0x4'));var BPromise=require(_0xbf88('0x5'));var Mustache=require(_0xbf88('0x6'));var util=require(_0xbf88('0x7'));var path=require(_0xbf88('0x8'));var sox=require('sox');var csv=require(_0xbf88('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbf88('0xa'));var squel=require(_0xbf88('0xb'));var crypto=require('crypto');var jsforce=require(_0xbf88('0xc'));var deskjs=require(_0xbf88('0xd'));var toCsv=require(_0xbf88('0x9'));var querystring=require(_0xbf88('0xe'));var Papa=require(_0xbf88('0xf'));var Redis=require(_0xbf88('0x10'));var authService=require(_0xbf88('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf88('0x12'));var logger=require(_0xbf88('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xbf88('0x14'));var licenseUtil=require(_0xbf88('0x15'));var db=require(_0xbf88('0x16'))['db'];function respondWithStatusCode(_0x42bf91,_0x30787e){_0x30787e=_0x30787e||0xcc;return function(_0x3c928c){if(_0x3c928c){return _0x42bf91[_0xbf88('0x17')](_0x30787e);}return _0x42bf91[_0xbf88('0x18')](_0x30787e)[_0xbf88('0x19')]();};}function respondWithResult(_0xacf284,_0x5e2b5f){_0x5e2b5f=_0x5e2b5f||0xc8;return function(_0x383ddc){if(_0x383ddc){return _0xacf284[_0xbf88('0x18')](_0x5e2b5f)[_0xbf88('0x1a')](_0x383ddc);}};}function respondWithFilteredResult(_0x1e215d,_0x492aa5){return function(_0xb245aa){if(_0xb245aa){var _0x5459d2=typeof _0x492aa5[_0xbf88('0x1b')]===_0xbf88('0x1c')&&typeof _0x492aa5[_0xbf88('0x1d')]===_0xbf88('0x1c');var _0x16e0f6=_0xb245aa['count'];var _0xba4277=_0x5459d2?0x0:_0x492aa5[_0xbf88('0x1b')];var _0x2e64af=_0x5459d2?_0xb245aa[_0xbf88('0x1e')]:_0x492aa5[_0xbf88('0x1b')]+_0x492aa5[_0xbf88('0x1d')];var _0x43bad7;if(_0x2e64af>=_0x16e0f6){_0x2e64af=_0x16e0f6;_0x43bad7=0xc8;}else{_0x43bad7=0xce;}_0x1e215d[_0xbf88('0x18')](_0x43bad7);return _0x1e215d[_0xbf88('0x1f')](_0xbf88('0x20'),_0xba4277+'-'+_0x2e64af+'/'+_0x16e0f6)[_0xbf88('0x1a')](_0xb245aa);}return null;};}function patchUpdates(_0x5a4dd3){return function(_0x3b803a){try{jsonpatch[_0xbf88('0x21')](_0x3b803a,_0x5a4dd3,!![]);}catch(_0x2af36c){return BPromise[_0xbf88('0x22')](_0x2af36c);}return _0x3b803a[_0xbf88('0x23')]();};}function saveUpdates(_0x282553,_0x26ef00){return function(_0x4bdb1d){if(_0x4bdb1d){return _0x4bdb1d[_0xbf88('0x24')](_0x282553)[_0xbf88('0x25')](function(_0x2e1b5a){return _0x2e1b5a;});}return null;};}function removeEntity(_0x4b89ca,_0xc15bc6){return function(_0x24bd77){if(_0x24bd77){return _0x24bd77[_0xbf88('0x26')]()[_0xbf88('0x25')](function(){_0x4b89ca[_0xbf88('0x18')](0xcc)[_0xbf88('0x19')]();});}};}function handleEntityNotFound(_0x183e03,_0x186c4c){return function(_0x4773f7){if(!_0x4773f7){_0x183e03[_0xbf88('0x17')](0x194);}return _0x4773f7;};}function handleError(_0x14529f,_0x171e39){_0x171e39=_0x171e39||0x1f4;return function(_0x580f0d){logger[_0xbf88('0x27')](_0x580f0d[_0xbf88('0x28')]);if(_0x580f0d[_0xbf88('0x29')]){delete _0x580f0d[_0xbf88('0x29')];}_0x14529f['status'](_0x171e39)[_0xbf88('0x2a')](_0x580f0d);};}exports[_0xbf88('0x2b')]=function(_0x1404c6,_0xb307dd){var _0x4fa1dd={},_0xd0adfb={},_0x115c9a={'count':0x0,'rows':[]};var _0x3a9aca=_[_0xbf88('0x2c')](db[_0xbf88('0x2d')][_0xbf88('0x2e')],function(_0x454006){return{'name':_0x454006['fieldName'],'type':_0x454006[_0xbf88('0x2f')][_0xbf88('0x30')]};});_0xd0adfb['model']=_[_0xbf88('0x2c')](_0x3a9aca,_0xbf88('0x29'));_0xd0adfb['query']=_['keys'](_0x1404c6[_0xbf88('0x31')]);_0xd0adfb[_0xbf88('0x32')]=_['intersection'](_0xd0adfb[_0xbf88('0x33')],_0xd0adfb[_0xbf88('0x31')]);_0x4fa1dd[_0xbf88('0x34')]=_[_0xbf88('0x35')](_0xd0adfb[_0xbf88('0x33')],qs[_0xbf88('0x36')](_0x1404c6[_0xbf88('0x31')][_0xbf88('0x36')]));_0x4fa1dd[_0xbf88('0x34')]=_0x4fa1dd[_0xbf88('0x34')][_0xbf88('0x37')]?_0x4fa1dd[_0xbf88('0x34')]:_0xd0adfb[_0xbf88('0x33')];if(!_0x1404c6[_0xbf88('0x31')]['hasOwnProperty'](_0xbf88('0x38'))){_0x4fa1dd[_0xbf88('0x1d')]=qs['limit'](_0x1404c6[_0xbf88('0x31')][_0xbf88('0x1d')]);_0x4fa1dd[_0xbf88('0x1b')]=qs[_0xbf88('0x1b')](_0x1404c6[_0xbf88('0x31')][_0xbf88('0x1b')]);}_0x4fa1dd[_0xbf88('0x39')]=qs['sort'](_0x1404c6[_0xbf88('0x31')]['sort']);_0x4fa1dd[_0xbf88('0x3a')]=qs[_0xbf88('0x32')](_['pick'](_0x1404c6[_0xbf88('0x31')],_0xd0adfb[_0xbf88('0x32')]),_0x3a9aca);if(_0x1404c6[_0xbf88('0x31')][_0xbf88('0x3b')]){_0x4fa1dd[_0xbf88('0x3a')]=_[_0xbf88('0x3c')](_0x4fa1dd['where'],{'$or':_[_0xbf88('0x2c')](_0x3a9aca,function(_0x36e820){if(_0x36e820[_0xbf88('0x2f')]!=='VIRTUAL'){var _0x3c9223={};_0x3c9223[_0x36e820[_0xbf88('0x29')]]={'$like':'%'+_0x1404c6['query'][_0xbf88('0x3b')]+'%'};return _0x3c9223;}})});}_0x4fa1dd=_[_0xbf88('0x3c')]({},_0x4fa1dd,_0x1404c6['options']);var _0x3e6b8b={'where':_0x4fa1dd[_0xbf88('0x3a')]};return db[_0xbf88('0x2d')][_0xbf88('0x1e')](_0x3e6b8b)[_0xbf88('0x25')](function(_0x579071){_0x115c9a[_0xbf88('0x1e')]=_0x579071;if(_0x1404c6['query'][_0xbf88('0x3d')]){_0x4fa1dd[_0xbf88('0x3e')]=[{'all':!![]}];}return db[_0xbf88('0x2d')][_0xbf88('0x3f')](_0x4fa1dd);})[_0xbf88('0x25')](function(_0x12098f){_0x115c9a['rows']=_0x12098f;return _0x115c9a;})[_0xbf88('0x25')](respondWithFilteredResult(_0xb307dd,_0x4fa1dd))[_0xbf88('0x40')](handleError(_0xb307dd,null));};exports[_0xbf88('0x41')]=function(_0x5de0e4,_0x6f5193){var _0x4fa182={'raw':![],'where':{'id':_0x5de0e4['params']['id']}},_0x493671={};_0x493671[_0xbf88('0x33')]=_['keys'](db[_0xbf88('0x2d')][_0xbf88('0x2e')]);_0x493671[_0xbf88('0x31')]=_[_0xbf88('0x42')](_0x5de0e4[_0xbf88('0x31')]);_0x493671[_0xbf88('0x32')]=_[_0xbf88('0x35')](_0x493671[_0xbf88('0x33')],_0x493671[_0xbf88('0x31')]);_0x4fa182[_0xbf88('0x34')]=_['intersection'](_0x493671[_0xbf88('0x33')],qs[_0xbf88('0x36')](_0x5de0e4[_0xbf88('0x31')][_0xbf88('0x36')]));_0x4fa182[_0xbf88('0x34')]=_0x4fa182[_0xbf88('0x34')]['length']?_0x4fa182[_0xbf88('0x34')]:_0x493671[_0xbf88('0x33')];if(_0x5de0e4[_0xbf88('0x31')][_0xbf88('0x3d')]){_0x4fa182[_0xbf88('0x3e')]=[{'all':!![]}];}_0x4fa182=_[_0xbf88('0x3c')]({},_0x4fa182,_0x5de0e4['options']);return db[_0xbf88('0x2d')][_0xbf88('0x43')](_0x4fa182)[_0xbf88('0x25')](handleEntityNotFound(_0x6f5193,null))[_0xbf88('0x25')](respondWithResult(_0x6f5193,null))[_0xbf88('0x40')](handleError(_0x6f5193,null));};exports[_0xbf88('0x44')]=function(_0x2872bc,_0x47d1fe){return db[_0xbf88('0x2d')]['create'](_0x2872bc[_0xbf88('0x45')],{})[_0xbf88('0x25')](respondWithResult(_0x47d1fe,0xc9))['catch'](handleError(_0x47d1fe,null));};exports['update']=function(_0x4c5fce,_0x429894){if(_0x4c5fce[_0xbf88('0x45')]['id']){delete _0x4c5fce[_0xbf88('0x45')]['id'];}return db[_0xbf88('0x2d')][_0xbf88('0x43')]({'where':{'id':_0x4c5fce[_0xbf88('0x46')]['id']}})[_0xbf88('0x25')](handleEntityNotFound(_0x429894,null))[_0xbf88('0x25')](saveUpdates(_0x4c5fce[_0xbf88('0x45')],null))[_0xbf88('0x25')](respondWithResult(_0x429894,null))[_0xbf88('0x40')](handleError(_0x429894,null));};exports[_0xbf88('0x26')]=function(_0x251ede,_0x5a7594){return db['Automation'][_0xbf88('0x43')]({'where':{'id':_0x251ede[_0xbf88('0x46')]['id']}})[_0xbf88('0x25')](handleEntityNotFound(_0x5a7594,null))[_0xbf88('0x25')](removeEntity(_0x5a7594,null))['catch'](handleError(_0x5a7594,null));};exports['addConditions']=function(_0x495138,_0x52d2e6,_0x5b6b66){return db[_0xbf88('0x47')]['find']({'where':{'id':_0x495138[_0xbf88('0x46')]['id']}})[_0xbf88('0x25')](handleEntityNotFound(_0x52d2e6,null))[_0xbf88('0x25')](function(_0x568db1){if(_0x568db1){return _0x568db1['addConditions'](_0x495138[_0xbf88('0x45')]['ids'],_[_0xbf88('0x48')](_0x495138[_0xbf88('0x45')],[_0xbf88('0x49'),'id'])||{});}})[_0xbf88('0x25')](respondWithResult(_0x52d2e6,null))['catch'](handleError(_0x52d2e6,null));};exports['getConditions']=function(_0x4e6ad2,_0x4f8082,_0x592906){var _0x5920f9={};var _0x5c414c={};var _0x55a429;var _0x199f2b;return db[_0xbf88('0x2d')][_0xbf88('0x4a')]({'where':{'id':_0x4e6ad2['params']['id']}})['then'](handleEntityNotFound(_0x4f8082,null))[_0xbf88('0x25')](function(_0x521b9a){if(_0x521b9a){_0x55a429=_0x521b9a;_0x5c414c[_0xbf88('0x33')]=_['keys'](db['Condition'][_0xbf88('0x2e')]);_0x5c414c[_0xbf88('0x31')]=_[_0xbf88('0x42')](_0x4e6ad2[_0xbf88('0x31')]);_0x5c414c[_0xbf88('0x32')]=_['intersection'](_0x5c414c['model'],_0x5c414c[_0xbf88('0x31')]);_0x5920f9[_0xbf88('0x34')]=_[_0xbf88('0x35')](_0x5c414c[_0xbf88('0x33')],qs[_0xbf88('0x36')](_0x4e6ad2['query']['fields']));_0x5920f9[_0xbf88('0x34')]=_0x5920f9[_0xbf88('0x34')]['length']?_0x5920f9[_0xbf88('0x34')]:_0x5c414c[_0xbf88('0x33')];_0x5920f9['order']=qs[_0xbf88('0x4b')](_0x4e6ad2['query']['sort']);_0x5920f9[_0xbf88('0x3a')]=qs[_0xbf88('0x32')](_[_0xbf88('0x4c')](_0x4e6ad2[_0xbf88('0x31')],_0x5c414c['filters']));if(_0x4e6ad2[_0xbf88('0x31')][_0xbf88('0x3b')]){_0x5920f9[_0xbf88('0x3a')]=_[_0xbf88('0x3c')](_0x5920f9[_0xbf88('0x3a')],{'$or':_[_0xbf88('0x2c')](_0x5920f9[_0xbf88('0x34')],function(_0x33b987){var _0x1e10bd={};_0x1e10bd[_0x33b987]={'$like':'%'+_0x4e6ad2[_0xbf88('0x31')]['filter']+'%'};return _0x1e10bd;})});}_0x5920f9=_['merge']({},_0x5920f9,_0x4e6ad2[_0xbf88('0x4d')]);return _0x55a429[_0xbf88('0x4e')](_0x5920f9);}})[_0xbf88('0x25')](function(_0x9477c){if(_0x9477c){_0x199f2b=_0x9477c[_0xbf88('0x37')];if(!_0x4e6ad2['query']['hasOwnProperty'](_0xbf88('0x38'))){_0x5920f9['limit']=qs[_0xbf88('0x1d')](_0x4e6ad2[_0xbf88('0x31')][_0xbf88('0x1d')]);_0x5920f9[_0xbf88('0x1b')]=qs[_0xbf88('0x1b')](_0x4e6ad2['query'][_0xbf88('0x1b')]);}return _0x55a429[_0xbf88('0x4e')](_0x5920f9);}})[_0xbf88('0x25')](function(_0x1b2ca1){if(_0x1b2ca1){return _0x1b2ca1?{'count':_0x199f2b,'rows':_0x1b2ca1}:null;}})[_0xbf88('0x25')](respondWithResult(_0x4f8082,null))[_0xbf88('0x40')](handleError(_0x4f8082,null));};exports[_0xbf88('0x4f')]=function(_0x2d62ff,_0x13038c,_0x2aa64a){return db[_0xbf88('0x50')][_0xbf88('0x43')]({'where':{'id':_0x2d62ff['params']['id']}})['then'](handleEntityNotFound(_0x13038c,null))[_0xbf88('0x25')](function(_0x1db398){if(_0x1db398){return _0x1db398[_0xbf88('0x4f')](_0x2d62ff[_0xbf88('0x45')][_0xbf88('0x49')],_[_0xbf88('0x48')](_0x2d62ff[_0xbf88('0x45')],[_0xbf88('0x49'),'id'])||{});}})[_0xbf88('0x25')](respondWithResult(_0x13038c,null))[_0xbf88('0x40')](handleError(_0x13038c,null));};exports[_0xbf88('0x51')]=function(_0x5f1abd,_0xa43462,_0x190b47){var _0x4ad4fa={};var _0x2461b3={};var _0x313b57;var _0x4c155e;return db[_0xbf88('0x2d')][_0xbf88('0x4a')]({'where':{'id':_0x5f1abd[_0xbf88('0x46')]['id']}})['then'](handleEntityNotFound(_0xa43462,null))[_0xbf88('0x25')](function(_0x3a0c3f){if(_0x3a0c3f){_0x313b57=_0x3a0c3f;_0x2461b3[_0xbf88('0x33')]=_['keys'](db[_0xbf88('0x50')]['rawAttributes']);_0x2461b3['query']=_[_0xbf88('0x42')](_0x5f1abd[_0xbf88('0x31')]);_0x2461b3[_0xbf88('0x32')]=_[_0xbf88('0x35')](_0x2461b3[_0xbf88('0x33')],_0x2461b3[_0xbf88('0x31')]);_0x4ad4fa[_0xbf88('0x34')]=_[_0xbf88('0x35')](_0x2461b3['model'],qs[_0xbf88('0x36')](_0x5f1abd[_0xbf88('0x31')][_0xbf88('0x36')]));_0x4ad4fa[_0xbf88('0x34')]=_0x4ad4fa['attributes'][_0xbf88('0x37')]?_0x4ad4fa[_0xbf88('0x34')]:_0x2461b3[_0xbf88('0x33')];_0x4ad4fa['order']=qs['sort'](_0x5f1abd['query'][_0xbf88('0x4b')]);_0x4ad4fa[_0xbf88('0x3a')]=qs[_0xbf88('0x32')](_[_0xbf88('0x4c')](_0x5f1abd[_0xbf88('0x31')],_0x2461b3['filters']));if(_0x5f1abd[_0xbf88('0x31')][_0xbf88('0x3b')]){_0x4ad4fa[_0xbf88('0x3a')]=_[_0xbf88('0x3c')](_0x4ad4fa[_0xbf88('0x3a')],{'$or':_['map'](_0x4ad4fa[_0xbf88('0x34')],function(_0x2934bc){var _0x35f9af={};_0x35f9af[_0x2934bc]={'$like':'%'+_0x5f1abd[_0xbf88('0x31')]['filter']+'%'};return _0x35f9af;})});}_0x4ad4fa=_[_0xbf88('0x3c')]({},_0x4ad4fa,_0x5f1abd[_0xbf88('0x4d')]);return _0x313b57[_0xbf88('0x51')](_0x4ad4fa);}})[_0xbf88('0x25')](function(_0x31ac8c){if(_0x31ac8c){_0x4c155e=_0x31ac8c[_0xbf88('0x37')];if(!_0x5f1abd[_0xbf88('0x31')][_0xbf88('0x52')]('nolimit')){_0x4ad4fa[_0xbf88('0x1d')]=qs['limit'](_0x5f1abd[_0xbf88('0x31')][_0xbf88('0x1d')]);_0x4ad4fa[_0xbf88('0x1b')]=qs['offset'](_0x5f1abd[_0xbf88('0x31')]['offset']);}return _0x313b57[_0xbf88('0x51')](_0x4ad4fa);}})[_0xbf88('0x25')](function(_0x2f89e0){if(_0x2f89e0){return _0x2f89e0?{'count':_0x4c155e,'rows':_0x2f89e0}:null;}})[_0xbf88('0x25')](respondWithResult(_0xa43462,null))[_0xbf88('0x40')](handleError(_0xa43462,null));};
\ No newline at end of file
index e5a50b6..3804be2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x197e=['../../config/environment','exports','Automation','tools_automations','util','request-promise'];(function(_0x16d23f,_0x471ced){var _0x17b9d3=function(_0x3853a8){while(--_0x3853a8){_0x16d23f['push'](_0x16d23f['shift']());}};_0x17b9d3(++_0x471ced);}(_0x197e,0xd0));var _0xe197=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x197e[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xe197('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe197('0x1'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe197('0x2'));var attributes=require('./automation.attributes');module[_0xe197('0x3')]=function(_0x59102e,_0x1cb115){return _0x59102e['define'](_0xe197('0x4'),attributes,{'tableName':_0xe197('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x80e7=['moment','path','rimraf','../../config/environment','./automation.attributes','tools_automations','util','../../config/logger','api'];(function(_0xca8113,_0x251b63){var _0x202f8d=function(_0x527a56){while(--_0x527a56){_0xca8113['push'](_0xca8113['shift']());}};_0x202f8d(++_0x251b63);}(_0x80e7,0x84));var _0x780e=function(_0x4b8c60,_0x8b2ebe){_0x4b8c60=_0x4b8c60-0x0;var _0x26a15d=_0x80e7[_0x4b8c60];return _0x26a15d;};'use strict';var _=require('lodash');var util=require(_0x780e('0x0'));var logger=require(_0x780e('0x1'))(_0x780e('0x2'));var moment=require(_0x780e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x780e('0x4'));var rimraf=require(_0x780e('0x5'));var config=require(_0x780e('0x6'));var attributes=require(_0x780e('0x7'));module['exports']=function(_0x423157,_0x449ba6){return _0x423157['define']('Automation',attributes,{'tableName':_0x780e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c646016..5017af7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d0a=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x29be28,_0x1d71e5){var _0x5bcc73=function(_0x4bfef0){while(--_0x4bfef0){_0x29be28['push'](_0x29be28['shift']());}};_0x5bcc73(++_0x1d71e5);}(_0x5d0a,0x175));var _0xa5d0=function(_0x29ae49,_0x2c9636){_0x29ae49=_0x29ae49-0x0;var _0x359826=_0x5d0a[_0x29ae49];return _0x359826;};'use strict';var _=require(_0xa5d0('0x0'));var util=require('util');var moment=require(_0xa5d0('0x1'));var BPromise=require('bluebird');var rs=require(_0xa5d0('0x2'));var fs=require('fs');var Redis=require(_0xa5d0('0x3'));var db=require(_0xa5d0('0x4'))['db'];var utils=require(_0xa5d0('0x5'));var logger=require('../../config/logger')(_0xa5d0('0x6'));var config=require(_0xa5d0('0x7'));var jayson=require(_0xa5d0('0x8'));var client=jayson[_0xa5d0('0x9')][_0xa5d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16af3f,_0x19d26f,_0x1841a1){return new BPromise(function(_0x295165,_0x27fe5a){return client[_0xa5d0('0xb')](_0x16af3f,_0x1841a1)['then'](function(_0x43698e){logger[_0xa5d0('0xc')](_0xa5d0('0xd'),_0x19d26f,_0xa5d0('0xe'));logger[_0xa5d0('0xf')](_0xa5d0('0x10'),_0x19d26f,_0xa5d0('0xe'),JSON[_0xa5d0('0x11')](_0x43698e));if(_0x43698e[_0xa5d0('0x12')]){if(_0x43698e[_0xa5d0('0x12')]['code']===0x1f4){logger[_0xa5d0('0x12')]('Automation,\x20%s,\x20%s',_0x19d26f,_0x43698e['error'][_0xa5d0('0x13')]);return _0x27fe5a(_0x43698e[_0xa5d0('0x12')][_0xa5d0('0x13')]);}logger[_0xa5d0('0x12')]('Automation,\x20%s,\x20%s',_0x19d26f,_0x43698e['error'][_0xa5d0('0x13')]);return _0x295165(_0x43698e[_0xa5d0('0x12')][_0xa5d0('0x13')]);}else{logger[_0xa5d0('0xc')](_0xa5d0('0xd'),_0x19d26f,_0xa5d0('0xe'));_0x295165(_0x43698e[_0xa5d0('0x14')]['message']);}})[_0xa5d0('0x15')](function(_0x5bfe18){logger[_0xa5d0('0x12')](_0xa5d0('0xd'),_0x19d26f,_0x5bfe18);_0x27fe5a(_0x5bfe18);});});}
\ No newline at end of file
+var _0xcdc2=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x22f164,_0xaa4f80){var _0x51ab95=function(_0x190b68){while(--_0x190b68){_0x22f164['push'](_0x22f164['shift']());}};_0x51ab95(++_0xaa4f80);}(_0xcdc2,0x19d));var _0x2cdc=function(_0x19e0e1,_0x35bd91){_0x19e0e1=_0x19e0e1-0x0;var _0x3b9e6e=_0xcdc2[_0x19e0e1];return _0x3b9e6e;};'use strict';var _=require(_0x2cdc('0x0'));var util=require(_0x2cdc('0x1'));var moment=require(_0x2cdc('0x2'));var BPromise=require(_0x2cdc('0x3'));var rs=require(_0x2cdc('0x4'));var fs=require('fs');var Redis=require(_0x2cdc('0x5'));var db=require(_0x2cdc('0x6'))['db'];var utils=require(_0x2cdc('0x7'));var logger=require(_0x2cdc('0x8'))(_0x2cdc('0x9'));var config=require(_0x2cdc('0xa'));var jayson=require(_0x2cdc('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x10b817,_0x54e717,_0x17f9f4){return new BPromise(function(_0x35a1d0,_0x393327){return client['request'](_0x10b817,_0x17f9f4)[_0x2cdc('0xc')](function(_0x51e6e7){logger['info'](_0x2cdc('0xd'),_0x54e717,'request\x20sent');logger['debug'](_0x2cdc('0xe'),_0x54e717,'request\x20sent',JSON[_0x2cdc('0xf')](_0x51e6e7));if(_0x51e6e7[_0x2cdc('0x10')]){if(_0x51e6e7[_0x2cdc('0x10')]['code']===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x54e717,_0x51e6e7['error']['message']);return _0x393327(_0x51e6e7[_0x2cdc('0x10')][_0x2cdc('0x11')]);}logger[_0x2cdc('0x10')](_0x2cdc('0xd'),_0x54e717,_0x51e6e7['error']['message']);return _0x35a1d0(_0x51e6e7[_0x2cdc('0x10')][_0x2cdc('0x11')]);}else{logger[_0x2cdc('0x12')](_0x2cdc('0xd'),_0x54e717,'request\x20sent');_0x35a1d0(_0x51e6e7['result'][_0x2cdc('0x11')]);}})[_0x2cdc('0x13')](function(_0x2a60d2){logger[_0x2cdc('0x10')](_0x2cdc('0xd'),_0x54e717,_0x2a60d2);_0x393327(_0x2a60d2);});});}
\ No newline at end of file
index 2f4340c..f4100eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23fe=['../../components/interaction/service','../../config/environment','./automation.controller','get','/:id','show','/:id/conditions','isAuthenticated','/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2ce40e,_0x40a409){var _0x4d614d=function(_0x5c09d9){while(--_0x5c09d9){_0x2ce40e['push'](_0x2ce40e['shift']());}};_0x4d614d(++_0x40a409);}(_0x23fe,0x102));var _0xe23f=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x23fe[_0x16d10f];return _0x50c823;};'use strict';var multer=require(_0xe23f('0x0'));var util=require(_0xe23f('0x1'));var path=require('path');var timeout=require(_0xe23f('0x2'));var express=require(_0xe23f('0x3'));var router=express[_0xe23f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe23f('0x5'));var interaction=require(_0xe23f('0x6'));var config=require(_0xe23f('0x7'));var controller=require(_0xe23f('0x8'));router[_0xe23f('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xe23f('0xa'),auth['isAuthenticated'](),controller[_0xe23f('0xb')]);router[_0xe23f('0x9')](_0xe23f('0xc'),auth[_0xe23f('0xd')](),controller['getConditions']);router[_0xe23f('0x9')](_0xe23f('0xe'),auth[_0xe23f('0xd')](),controller[_0xe23f('0xf')]);router[_0xe23f('0x10')]('/',auth[_0xe23f('0xd')](),controller[_0xe23f('0x11')]);router['post']('/:id/conditions',auth[_0xe23f('0xd')](),controller[_0xe23f('0x12')]);router[_0xe23f('0x10')]('/:id/actions',auth[_0xe23f('0xd')](),controller[_0xe23f('0x13')]);router[_0xe23f('0x14')](_0xe23f('0xa'),auth['isAuthenticated'](),controller[_0xe23f('0x15')]);router[_0xe23f('0x16')](_0xe23f('0xa'),auth['isAuthenticated'](),controller[_0xe23f('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x8e0f=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./automation.controller','get','index','/:id','isAuthenticated','/:id/conditions','/:id/actions','getActions','post','create','addConditions'];(function(_0x9cd6d7,_0x453050){var _0x48e5d2=function(_0x532699){while(--_0x532699){_0x9cd6d7['push'](_0x9cd6d7['shift']());}};_0x48e5d2(++_0x453050);}(_0x8e0f,0x12f));var _0xf8e0=function(_0x59a981,_0x629eb6){_0x59a981=_0x59a981-0x0;var _0x464f06=_0x8e0f[_0x59a981];return _0x464f06;};'use strict';var multer=require(_0xf8e0('0x0'));var util=require(_0xf8e0('0x1'));var path=require(_0xf8e0('0x2'));var timeout=require(_0xf8e0('0x3'));var express=require(_0xf8e0('0x4'));var router=express[_0xf8e0('0x5')]();var fs_extra=require(_0xf8e0('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf8e0('0x7'));var config=require('../../config/environment');var controller=require(_0xf8e0('0x8'));router[_0xf8e0('0x9')]('/',auth['isAuthenticated'](),controller[_0xf8e0('0xa')]);router[_0xf8e0('0x9')](_0xf8e0('0xb'),auth[_0xf8e0('0xc')](),controller['show']);router[_0xf8e0('0x9')](_0xf8e0('0xd'),auth['isAuthenticated'](),controller['getConditions']);router[_0xf8e0('0x9')](_0xf8e0('0xe'),auth[_0xf8e0('0xc')](),controller[_0xf8e0('0xf')]);router[_0xf8e0('0x10')]('/',auth[_0xf8e0('0xc')](),controller[_0xf8e0('0x11')]);router[_0xf8e0('0x10')](_0xf8e0('0xd'),auth['isAuthenticated'](),controller[_0xf8e0('0x12')]);router[_0xf8e0('0x10')](_0xf8e0('0xe'),auth[_0xf8e0('0xc')](),controller['addActions']);router[_0xf8e0('0x13')]('/:id',auth[_0xf8e0('0xc')](),controller[_0xf8e0('0x14')]);router[_0xf8e0('0x15')]('/:id',auth[_0xf8e0('0xc')](),controller['destroy']);module[_0xf8e0('0x16')]=router;
\ No newline at end of file
index 7593a56..814fd5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb640=['never','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','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)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*'];(function(_0x23aa34,_0x2ec822){var _0xfa8ee6=function(_0x3c0706){while(--_0x3c0706){_0x23aa34['push'](_0x23aa34['shift']());}};_0xfa8ee6(++_0x2ec822);}(_0xb640,0xc7));var _0x0b64=function(_0x55f34a,_0x4c8897){_0x55f34a=_0x55f34a-0x0;var _0x56efe4=_0xb640[_0x55f34a];return _0x56efe4;};'use strict';var Sequelize=require(_0x0b64('0x0'));module[_0x0b64('0x1')]={'name':{'type':Sequelize[_0x0b64('0x2')],'unique':_0x0b64('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0b64('0x4')](_0x0b64('0x5')),'allowNull':![],'defaultValue':_0x0b64('0x5')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x0b64('0x6')],'defaultValue':0x0,'comment':_0x0b64('0x7')},'limitCalls':{'type':Sequelize[_0x0b64('0x8')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0b64('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0b64('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0b64('0x8')](0x3)[_0x0b64('0xa')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b64('0xb')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b64('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0b64('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x0b64('0x8')](0x3)[_0x0b64('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x0b64('0x8')](0x5)[_0x0b64('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b64('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0b64('0x8')](0x3)[_0x0b64('0xa')],'defaultValue':0x3,'comment':_0x0b64('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0b64('0x8')](0x5)[_0x0b64('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b64('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0b64('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0b64('0xf')},'dialTimezone':{'type':Sequelize[_0x0b64('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0b64('0x2')],'defaultValue':_0x0b64('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0x0b64('0x11'),'onlyIfOpen'),'defaultValue':_0x0b64('0x12')},'dialAMDActive':{'type':Sequelize[_0x0b64('0x6')],'defaultValue':0x0,'comment':_0x0b64('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x0b64('0x8')](0x9)[_0x0b64('0xa')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0b64('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x0b64('0x8')](0x9)[_0x0b64('0xa')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0b64('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0b64('0x8')](0x9)[_0x0b64('0xa')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0b64('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0b64('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0b64('0x17')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0b64('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0b64('0x8')](0x9)[_0x0b64('0xa')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x0b64('0xa')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0b64('0x8')](0x5)[_0x0b64('0xa')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x0b64('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x0b64('0x19')),'defaultValue':_0x0b64('0x1a')},'dialPrefix':{'type':Sequelize[_0x0b64('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0b64('0x8')](0x3)[_0x0b64('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0b64('0x1b')},'dialCutDigit':{'type':Sequelize[_0x0b64('0x8')](0x3)[_0x0b64('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0b64('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0b64('0x8')](0x3)[_0x0b64('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b64('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0b64('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b64('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0x0b64('0x8')](0x3)[_0x0b64('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b64('0x1f')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0b64('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0b64('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0b64('0x8')](0x5)[_0x0b64('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b64('0x20')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0b64('0x8')](0x5)[_0x0b64('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b64('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b64('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b64('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0b64('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b64('0x23')}};
\ No newline at end of file
+var _0x2724=['#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','exports','name','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x50b250,_0x50cc42){var _0x36ce05=function(_0xd9a043){while(--_0xd9a043){_0x50b250['push'](_0x50b250['shift']());}};_0x36ce05(++_0x50cc42);}(_0x2724,0xa8));var _0x4272=function(_0x444f8e,_0x503ade){_0x444f8e=_0x444f8e-0x0;var _0x46af5f=_0x2724[_0x444f8e];return _0x46af5f;};'use strict';var Sequelize=require('sequelize');module[_0x4272('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x4272('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x4272('0x2')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x4272('0x3')]},'active':{'type':Sequelize[_0x4272('0x4')],'defaultValue':0x0,'comment':_0x4272('0x5')},'limitCalls':{'type':Sequelize[_0x4272('0x6')](0x4)[_0x4272('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x4272('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x4272('0x3')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4272('0x3')]},'dialOriginateTimeout':{'type':Sequelize[_0x4272('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x4272('0x6')](0x3)[_0x4272('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x4272('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x4272('0x6')](0x3)[_0x4272('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4272('0x9')},'dialBusyRetryFrequency':{'type':Sequelize[_0x4272('0x6')](0x5)[_0x4272('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4272('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4272('0x6')](0x3)[_0x4272('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x4272('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4272('0xb')},'dialGlobalMaxRetry':{'type':Sequelize[_0x4272('0x6')](0x3)[_0x4272('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x4272('0xc')},'dialTimezone':{'type':Sequelize[_0x4272('0x3')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x4272('0x3')],'defaultValue':_0x4272('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0x4272('0xe')](_0x4272('0xf'),'never',_0x4272('0x10')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x4272('0x4')],'defaultValue':0x0,'comment':_0x4272('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x4272('0x6')](0x9)[_0x4272('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4272('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x4272('0x6')](0x9)[_0x4272('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x4272('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4272('0x13')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4272('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4272('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x4272('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4272('0x6')](0x9)[_0x4272('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4272('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4272('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4272('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4272('0x6')](0x9)[_0x4272('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4272('0x18')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x4272('0x19'),_0x4272('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x4272('0x3')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4272('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4272('0x1b')},'dialCutDigit':{'type':Sequelize[_0x4272('0x6')](0x3)[_0x4272('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4272('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4272('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x4272('0x6')](0x5)[_0x4272('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4272('0x1d')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4272('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4272('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4272('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4272('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4272('0x6')](0x5)[_0x4272('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4272('0x20')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4272('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4272('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x4272('0x6')](0x5)[_0x4272('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4272('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x4272('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4272('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x4272('0x6')](0x5)[_0x4272('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
index 2919692..6a9a7f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7582=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','updatedAt','getHoppers','findOne','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','omit','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','select','field','ContactId','toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','scheduledAt','NOW()','CampaignId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','keys','filters','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Campaign','findAll','rows','catch','show','includeAll','include','find','create'];(function(_0x127b3d,_0x141ce0){var _0x553381=function(_0x417820){while(--_0x417820){_0x127b3d['push'](_0x127b3d['shift']());}};_0x553381(++_0x141ce0);}(_0x7582,0x167));var _0x2758=function(_0x1e2321,_0x3ae1c5){_0x1e2321=_0x1e2321-0x0;var _0x1d346d=_0x7582[_0x1e2321];return _0x1d346d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2758('0x0'));var zipdir=require(_0x2758('0x1'));var jsonpatch=require(_0x2758('0x2'));var rp=require('request-promise');var moment=require(_0x2758('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2758('0x4'));var util=require(_0x2758('0x5'));var path=require(_0x2758('0x6'));var sox=require(_0x2758('0x7'));var csv=require('to-csv');var ejs=require(_0x2758('0x8'));var fs=require('fs');var fs_extra=require(_0x2758('0x9'));var _=require('lodash');var squel=require(_0x2758('0xa'));var crypto=require(_0x2758('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2758('0xc'));var toCsv=require(_0x2758('0xd'));var querystring=require(_0x2758('0xe'));var Papa=require('papaparse');var Redis=require(_0x2758('0xf'));var authService=require(_0x2758('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2758('0x11'));var logger=require(_0x2758('0x12'))(_0x2758('0x13'));var utils=require(_0x2758('0x14'));var config=require(_0x2758('0x15'));var licenseUtil=require(_0x2758('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x493357,_0x4caa8b){_0x4caa8b=_0x4caa8b||0xcc;return function(_0x1846cd){if(_0x1846cd){return _0x493357[_0x2758('0x17')](_0x4caa8b);}return _0x493357[_0x2758('0x18')](_0x4caa8b)[_0x2758('0x19')]();};}function respondWithResult(_0x3233af,_0x9db637){_0x9db637=_0x9db637||0xc8;return function(_0x3e1a7e){if(_0x3e1a7e){return _0x3233af[_0x2758('0x18')](_0x9db637)[_0x2758('0x1a')](_0x3e1a7e);}};}function respondWithFilteredResult(_0xad4346,_0x414a0b){return function(_0x361f14){if(_0x361f14){var _0x280ccc=typeof _0x414a0b[_0x2758('0x1b')]==='undefined'&&typeof _0x414a0b['limit']==='undefined';var _0x2b0ce0=_0x361f14[_0x2758('0x1c')];var _0x358358=_0x280ccc?0x0:_0x414a0b[_0x2758('0x1b')];var _0x1bccd9=_0x280ccc?_0x361f14[_0x2758('0x1c')]:_0x414a0b['offset']+_0x414a0b[_0x2758('0x1d')];var _0x4202e5;if(_0x1bccd9>=_0x2b0ce0){_0x1bccd9=_0x2b0ce0;_0x4202e5=0xc8;}else{_0x4202e5=0xce;}_0xad4346['status'](_0x4202e5);return _0xad4346[_0x2758('0x1e')](_0x2758('0x1f'),_0x358358+'-'+_0x1bccd9+'/'+_0x2b0ce0)[_0x2758('0x1a')](_0x361f14);}return null;};}function patchUpdates(_0x4100a0){return function(_0x50526b){try{jsonpatch[_0x2758('0x20')](_0x50526b,_0x4100a0,!![]);}catch(_0x4fa215){return BPromise[_0x2758('0x21')](_0x4fa215);}return _0x50526b[_0x2758('0x22')]();};}function saveUpdates(_0x27a887,_0x2797fe){return function(_0x4699c4){if(_0x4699c4){return _0x4699c4[_0x2758('0x23')](_0x27a887)[_0x2758('0x24')](function(_0x222601){return _0x222601;});}return null;};}function removeEntity(_0x38c483,_0x2ef395){return function(_0x1f645d){if(_0x1f645d){return _0x1f645d[_0x2758('0x25')]()['then'](function(){var _0x4f92f2=_0x1f645d[_0x2758('0x26')]({'plain':!![]});var _0x277f69=_0x2758('0x27');return db[_0x2758('0x28')][_0x2758('0x25')]({'where':{'type':_0x277f69,'resourceId':_0x4f92f2['id']}})[_0x2758('0x24')](function(){return _0x1f645d;});})['then'](function(){_0x38c483['status'](0xcc)[_0x2758('0x19')]();});}};}function handleEntityNotFound(_0x28c1f2,_0xee59e6){return function(_0x1d56cd){if(!_0x1d56cd){_0x28c1f2['sendStatus'](0x194);}return _0x1d56cd;};}function handleError(_0x47c969,_0x3e4cd7){_0x3e4cd7=_0x3e4cd7||0x1f4;return function(_0x230f28){logger[_0x2758('0x29')](_0x230f28['stack']);if(_0x230f28[_0x2758('0x2a')]){delete _0x230f28['name'];}_0x47c969[_0x2758('0x18')](_0x3e4cd7)[_0x2758('0x2b')](_0x230f28);};}exports[_0x2758('0x2c')]=function(_0x348d0d,_0x2e0613){var _0x2000de={},_0x2d44e4={},_0x11efa6={'count':0x0,'rows':[]};var _0x225f6f=_[_0x2758('0x2d')](db['Campaign'][_0x2758('0x2e')],function(_0x89c340){return{'name':_0x89c340[_0x2758('0x2f')],'type':_0x89c340[_0x2758('0x30')]['key']};});_0x2d44e4['model']=_[_0x2758('0x2d')](_0x225f6f,_0x2758('0x2a'));_0x2d44e4['query']=_[_0x2758('0x31')](_0x348d0d['query']);_0x2d44e4[_0x2758('0x32')]=_['intersection'](_0x2d44e4[_0x2758('0x33')],_0x2d44e4[_0x2758('0x34')]);_0x2000de['attributes']=_[_0x2758('0x35')](_0x2d44e4[_0x2758('0x33')],qs[_0x2758('0x36')](_0x348d0d[_0x2758('0x34')][_0x2758('0x36')]));_0x2000de[_0x2758('0x37')]=_0x2000de[_0x2758('0x37')][_0x2758('0x38')]?_0x2000de['attributes']:_0x2d44e4[_0x2758('0x33')];if(!_0x348d0d[_0x2758('0x34')][_0x2758('0x39')](_0x2758('0x3a'))){_0x2000de[_0x2758('0x1d')]=qs[_0x2758('0x1d')](_0x348d0d[_0x2758('0x34')][_0x2758('0x1d')]);_0x2000de[_0x2758('0x1b')]=qs['offset'](_0x348d0d['query'][_0x2758('0x1b')]);}_0x2000de[_0x2758('0x3b')]=qs[_0x2758('0x3c')](_0x348d0d[_0x2758('0x34')][_0x2758('0x3c')]);_0x2000de[_0x2758('0x3d')]=qs['filters'](_[_0x2758('0x3e')](_0x348d0d[_0x2758('0x34')],_0x2d44e4['filters']),_0x225f6f);if(_0x348d0d['query']['filter']){_0x2000de[_0x2758('0x3d')]=_[_0x2758('0x3f')](_0x2000de[_0x2758('0x3d')],{'$or':_[_0x2758('0x2d')](_0x225f6f,function(_0x564462){if(_0x564462[_0x2758('0x30')]!==_0x2758('0x40')){var _0x276ca0={};_0x276ca0[_0x564462[_0x2758('0x2a')]]={'$like':'%'+_0x348d0d[_0x2758('0x34')][_0x2758('0x41')]+'%'};return _0x276ca0;}})});}_0x2000de=_['merge']({},_0x2000de,_0x348d0d[_0x2758('0x42')]);var _0x3ceab5={'where':_0x2000de[_0x2758('0x3d')]};return db[_0x2758('0x43')][_0x2758('0x1c')](_0x3ceab5)[_0x2758('0x24')](function(_0xf0df8e){_0x11efa6[_0x2758('0x1c')]=_0xf0df8e;if(_0x348d0d[_0x2758('0x34')]['includeAll']){_0x2000de['include']=[{'all':!![]}];}return db[_0x2758('0x43')][_0x2758('0x44')](_0x2000de);})['then'](function(_0x2d19d8){_0x11efa6[_0x2758('0x45')]=_0x2d19d8;return _0x11efa6;})['then'](respondWithFilteredResult(_0x2e0613,_0x2000de))[_0x2758('0x46')](handleError(_0x2e0613,null));};exports[_0x2758('0x47')]=function(_0x1a5d64,_0x372862){var _0x291344={'raw':![],'where':{'id':_0x1a5d64['params']['id']}},_0x5a98d5={};_0x5a98d5['model']=_[_0x2758('0x31')](db[_0x2758('0x43')][_0x2758('0x2e')]);_0x5a98d5[_0x2758('0x34')]=_[_0x2758('0x31')](_0x1a5d64[_0x2758('0x34')]);_0x5a98d5[_0x2758('0x32')]=_[_0x2758('0x35')](_0x5a98d5['model'],_0x5a98d5['query']);_0x291344[_0x2758('0x37')]=_[_0x2758('0x35')](_0x5a98d5[_0x2758('0x33')],qs['fields'](_0x1a5d64['query'][_0x2758('0x36')]));_0x291344[_0x2758('0x37')]=_0x291344['attributes'][_0x2758('0x38')]?_0x291344[_0x2758('0x37')]:_0x5a98d5[_0x2758('0x33')];if(_0x1a5d64[_0x2758('0x34')][_0x2758('0x48')]){_0x291344[_0x2758('0x49')]=[{'all':!![]}];}_0x291344=_[_0x2758('0x3f')]({},_0x291344,_0x1a5d64[_0x2758('0x42')]);return db[_0x2758('0x43')][_0x2758('0x4a')](_0x291344)['then'](handleEntityNotFound(_0x372862,null))['then'](respondWithResult(_0x372862,null))[_0x2758('0x46')](handleError(_0x372862,null));};exports[_0x2758('0x4b')]=function(_0x43af2b,_0x2121df){return db[_0x2758('0x43')]['create'](_0x43af2b[_0x2758('0x4c')],{})['then'](function(_0x451458){var _0x264a11=_0x43af2b[_0x2758('0x4d')][_0x2758('0x26')]({'plain':!![]});if(!_0x264a11)throw new Error(_0x2758('0x4e'));if(_0x264a11['role']===_0x2758('0x4d')){var _0x5704c6=_0x451458[_0x2758('0x26')]({'plain':!![]});var _0x2e5c51='IvrCampaigns';return db[_0x2758('0x4f')][_0x2758('0x4a')]({'where':{'name':_0x2e5c51,'userProfileId':_0x264a11[_0x2758('0x50')]},'raw':!![]})[_0x2758('0x24')](function(_0x20649c){if(_0x20649c&&_0x20649c[_0x2758('0x51')]===0x0){return db[_0x2758('0x28')]['create']({'name':_0x5704c6[_0x2758('0x2a')],'resourceId':_0x5704c6['id'],'type':_0x20649c[_0x2758('0x2a')],'sectionId':_0x20649c['id']},{})[_0x2758('0x24')](function(){return _0x451458;});}else{return _0x451458;}})['catch'](function(_0x5b1b01){logger[_0x2758('0x29')](_0x2758('0x52'),_0x5b1b01);throw _0x5b1b01;});}return _0x451458;})[_0x2758('0x24')](respondWithResult(_0x2121df,0xc9))['catch'](handleError(_0x2121df,null));};exports[_0x2758('0x53')]=function(_0x191b3f,_0x52a01d){var _0x850f9b={'where':{'id':_0x191b3f[_0x2758('0x54')]['id']}},_0x3ee3ad={};_0x3ee3ad['model']=_[_0x2758('0x31')](db[_0x2758('0x43')][_0x2758('0x2e')]);_0x850f9b[_0x2758('0x37')]=_['intersection'](_0x3ee3ad['model'],qs[_0x2758('0x36')](_0x191b3f[_0x2758('0x34')][_0x2758('0x36')]));_0x850f9b[_0x2758('0x37')]=_0x850f9b[_0x2758('0x37')][_0x2758('0x38')]?_0x850f9b[_0x2758('0x37')]:_0x3ee3ad['model'];if(_0x191b3f[_0x2758('0x34')][_0x2758('0x48')]){_0x850f9b[_0x2758('0x49')]=[{'all':!![]}];}_0x850f9b=_[_0x2758('0x3f')]({},_0x850f9b,_0x191b3f[_0x2758('0x42')]);return db['Campaign']['find'](_0x850f9b)['then'](handleEntityNotFound(_0x52a01d,null))['then'](function(_0x5396c3){if(_0x5396c3){var _0x43d0cb=_0x5396c3[_0x2758('0x26')]({'plain':!![]});_0x43d0cb=qs['omit'](_0x43d0cb,['id',_0x2758('0x55'),_0x2758('0x56')]);_0x191b3f[_0x2758('0x4c')]=_['omit'](_0x191b3f[_0x2758('0x4c')],['id',_0x2758('0x55'),_0x2758('0x56')]);return db[_0x2758('0x43')]['create'](_['merge'](_0x43d0cb,_0x191b3f['body']),{'include':_0x191b3f[_0x2758('0x34')][_0x2758('0x48')]?[{'all':!![]}]:undefined})[_0x2758('0x24')](function(_0x3a7b43){var _0x49eb53=_0x191b3f[_0x2758('0x4d')][_0x2758('0x26')]({'plain':!![]});if(!_0x49eb53)throw new Error(_0x2758('0x4e'));if(_0x49eb53['role']===_0x2758('0x4d')){var _0x22e389=_0x3a7b43[_0x2758('0x26')]({'plain':!![]});var _0x2f7591='IvrCampaigns';return db[_0x2758('0x4f')][_0x2758('0x4a')]({'where':{'name':_0x2f7591,'userProfileId':_0x49eb53[_0x2758('0x50')]},'raw':!![]})[_0x2758('0x24')](function(_0x45302b){if(_0x45302b&&_0x45302b[_0x2758('0x51')]===0x0){return db[_0x2758('0x28')][_0x2758('0x4b')]({'name':_0x22e389[_0x2758('0x2a')],'resourceId':_0x22e389['id'],'type':_0x45302b[_0x2758('0x2a')],'sectionId':_0x45302b['id']},{})[_0x2758('0x24')](function(){return _0x3a7b43;});}else{return _0x3a7b43;}})[_0x2758('0x46')](function(_0x37ef08){logger[_0x2758('0x29')](_0x2758('0x52'),_0x37ef08);throw _0x37ef08;});}return _0x3a7b43;});}})['then'](respondWithResult(_0x52a01d,0xc9))[_0x2758('0x46')](handleError(_0x52a01d,null));};exports[_0x2758('0x23')]=function(_0x1e7853,_0x1e3ce5){if(_0x1e7853[_0x2758('0x4c')]['id']){delete _0x1e7853['body']['id'];}return db[_0x2758('0x43')][_0x2758('0x4a')]({'where':{'id':_0x1e7853[_0x2758('0x54')]['id']}})[_0x2758('0x24')](handleEntityNotFound(_0x1e3ce5,null))[_0x2758('0x24')](saveUpdates(_0x1e7853[_0x2758('0x4c')],null))[_0x2758('0x24')](respondWithResult(_0x1e3ce5,null))['catch'](handleError(_0x1e3ce5,null));};exports[_0x2758('0x25')]=function(_0x2e4db4,_0x2e1128){return db[_0x2758('0x43')][_0x2758('0x4a')]({'where':{'id':_0x2e4db4[_0x2758('0x54')]['id']}})[_0x2758('0x24')](handleEntityNotFound(_0x2e1128,null))[_0x2758('0x24')](removeEntity(_0x2e1128,null))['catch'](handleError(_0x2e1128,null));};exports[_0x2758('0x57')]=function(_0x228829,_0x475748,_0x41d3ff){var _0x47ddb5={'raw':!![],'where':{}};var _0x3ae88e={};var _0x3aebb0={'count':0x0,'rows':[]};return db['Campaign'][_0x2758('0x58')]({'where':{'id':_0x228829[_0x2758('0x54')]['id']}})['then'](handleEntityNotFound(_0x475748,null))[_0x2758('0x24')](function(_0x111e49){if(_0x111e49){_0x3ae88e[_0x2758('0x33')]=_[_0x2758('0x31')](db['CmHopper'][_0x2758('0x2e')]);_0x3ae88e['query']=_['keys'](_0x228829[_0x2758('0x34')]);_0x3ae88e[_0x2758('0x32')]=_[_0x2758('0x35')](_0x3ae88e[_0x2758('0x33')],_0x3ae88e[_0x2758('0x34')]);_0x47ddb5['attributes']=_[_0x2758('0x35')](_0x3ae88e['model'],qs[_0x2758('0x36')](_0x228829[_0x2758('0x34')][_0x2758('0x36')]));_0x47ddb5[_0x2758('0x37')]=_0x47ddb5[_0x2758('0x37')][_0x2758('0x38')]?_0x47ddb5[_0x2758('0x37')]:_0x3ae88e[_0x2758('0x33')];if(!_0x228829['query']['hasOwnProperty']('nolimit')){_0x47ddb5['limit']=qs['limit'](_0x228829[_0x2758('0x34')][_0x2758('0x1d')]);_0x47ddb5[_0x2758('0x1b')]=qs[_0x2758('0x1b')](_0x228829[_0x2758('0x34')][_0x2758('0x1b')]);}_0x47ddb5[_0x2758('0x3b')]=qs[_0x2758('0x3c')](_0x228829['query'][_0x2758('0x3c')]);_0x47ddb5[_0x2758('0x3d')]=qs[_0x2758('0x32')](_[_0x2758('0x3e')](_0x228829[_0x2758('0x34')],_0x3ae88e[_0x2758('0x32')]));_0x47ddb5[_0x2758('0x3d')][_0x2758('0x59')]=_0x111e49['id'];if(_0x228829[_0x2758('0x34')][_0x2758('0x41')]){_0x47ddb5[_0x2758('0x3d')]=_[_0x2758('0x3f')](_0x47ddb5[_0x2758('0x3d')],{'$or':_['map'](_0x47ddb5[_0x2758('0x37')],function(_0x1b5aff){var _0x2e8cec={};_0x2e8cec[_0x1b5aff]={'$like':'%'+_0x228829['query'][_0x2758('0x41')]+'%'};return _0x2e8cec;})});}_0x47ddb5=_[_0x2758('0x3f')]({},_0x47ddb5,_0x228829[_0x2758('0x42')]);return db[_0x2758('0x5a')][_0x2758('0x1c')]({'where':_0x47ddb5[_0x2758('0x3d')]})[_0x2758('0x24')](function(_0x3932c3){_0x3aebb0[_0x2758('0x1c')]=_0x3932c3;if(_0x228829[_0x2758('0x34')][_0x2758('0x48')]){_0x47ddb5[_0x2758('0x49')]=[{'all':!![]}];}return db['CmHopper'][_0x2758('0x44')](_0x47ddb5);})[_0x2758('0x24')](function(_0x31292c){_0x3aebb0[_0x2758('0x45')]=_0x31292c;return _0x3aebb0;});}})['then'](respondWithFilteredResult(_0x475748,_0x47ddb5))[_0x2758('0x46')](handleError(_0x475748,null));};exports[_0x2758('0x5b')]=function(_0x515eae,_0xcda34b,_0x26fb03){var _0x398cab={'raw':!![],'where':{}};var _0x301fe5={};var _0x3a92d4={'count':0x0,'rows':[]};return db[_0x2758('0x43')][_0x2758('0x58')]({'where':{'id':_0x515eae[_0x2758('0x54')]['id']}})[_0x2758('0x24')](handleEntityNotFound(_0xcda34b,null))[_0x2758('0x24')](function(_0x4c816d){if(_0x4c816d){_0x301fe5[_0x2758('0x33')]=_[_0x2758('0x31')](db['CmHopperHistory'][_0x2758('0x2e')]);_0x301fe5[_0x2758('0x34')]=_['keys'](_0x515eae[_0x2758('0x34')]);_0x301fe5[_0x2758('0x32')]=_[_0x2758('0x35')](_0x301fe5[_0x2758('0x33')],_0x301fe5[_0x2758('0x34')]);_0x398cab[_0x2758('0x37')]=_[_0x2758('0x35')](_0x301fe5[_0x2758('0x33')],qs[_0x2758('0x36')](_0x515eae[_0x2758('0x34')][_0x2758('0x36')]));_0x398cab[_0x2758('0x37')]=_0x398cab[_0x2758('0x37')][_0x2758('0x38')]?_0x398cab[_0x2758('0x37')]:_0x301fe5['model'];if(!_0x515eae[_0x2758('0x34')][_0x2758('0x39')](_0x2758('0x3a'))){_0x398cab[_0x2758('0x1d')]=qs[_0x2758('0x1d')](_0x515eae[_0x2758('0x34')][_0x2758('0x1d')]);_0x398cab['offset']=qs['offset'](_0x515eae[_0x2758('0x34')][_0x2758('0x1b')]);}_0x398cab[_0x2758('0x3b')]=qs[_0x2758('0x3c')](_0x515eae[_0x2758('0x34')]['sort']);_0x398cab[_0x2758('0x3d')]=qs[_0x2758('0x32')](_[_0x2758('0x3e')](_0x515eae['query'],_0x301fe5[_0x2758('0x32')]));_0x398cab['where'][_0x2758('0x59')]=_0x4c816d['id'];if(_0x515eae[_0x2758('0x34')][_0x2758('0x41')]){_0x398cab[_0x2758('0x3d')]=_[_0x2758('0x3f')](_0x398cab[_0x2758('0x3d')],{'$or':_[_0x2758('0x2d')](_0x398cab['attributes'],function(_0xa63291){var _0x247fa0={};_0x247fa0[_0xa63291]={'$like':'%'+_0x515eae[_0x2758('0x34')][_0x2758('0x41')]+'%'};return _0x247fa0;})});}_0x398cab=_['merge']({},_0x398cab,_0x515eae[_0x2758('0x42')]);return db[_0x2758('0x5c')][_0x2758('0x1c')]({'where':_0x398cab[_0x2758('0x3d')]})[_0x2758('0x24')](function(_0x222c8e){_0x3a92d4['count']=_0x222c8e;if(_0x515eae[_0x2758('0x34')][_0x2758('0x48')]){_0x398cab['include']=[{'all':!![]}];}return db[_0x2758('0x5c')][_0x2758('0x44')](_0x398cab);})[_0x2758('0x24')](function(_0x36c849){_0x3a92d4['rows']=_0x36c849;return _0x3a92d4;});}})[_0x2758('0x24')](respondWithFilteredResult(_0xcda34b,_0x398cab))[_0x2758('0x46')](handleError(_0xcda34b,null));};exports['getHopperFinals']=function(_0x1301a2,_0x5f08cb,_0x3edb50){var _0x530303={'raw':!![],'where':{}};var _0x253473={};var _0x5c88e3={'count':0x0,'rows':[]};return db[_0x2758('0x43')][_0x2758('0x58')]({'where':{'id':_0x1301a2[_0x2758('0x54')]['id']}})[_0x2758('0x24')](handleEntityNotFound(_0x5f08cb,null))[_0x2758('0x24')](function(_0x43e530){if(_0x43e530){_0x253473[_0x2758('0x33')]=_[_0x2758('0x31')](db[_0x2758('0x5d')][_0x2758('0x2e')]);_0x253473[_0x2758('0x34')]=_[_0x2758('0x31')](_0x1301a2[_0x2758('0x34')]);_0x253473['filters']=_[_0x2758('0x35')](_0x253473[_0x2758('0x33')],_0x253473[_0x2758('0x34')]);_0x530303[_0x2758('0x37')]=_['intersection'](_0x253473[_0x2758('0x33')],qs[_0x2758('0x36')](_0x1301a2['query']['fields']));_0x530303[_0x2758('0x37')]=_0x530303[_0x2758('0x37')][_0x2758('0x38')]?_0x530303[_0x2758('0x37')]:_0x253473[_0x2758('0x33')];if(!_0x1301a2[_0x2758('0x34')][_0x2758('0x39')](_0x2758('0x3a'))){_0x530303[_0x2758('0x1d')]=qs[_0x2758('0x1d')](_0x1301a2['query'][_0x2758('0x1d')]);_0x530303[_0x2758('0x1b')]=qs[_0x2758('0x1b')](_0x1301a2[_0x2758('0x34')][_0x2758('0x1b')]);}_0x530303[_0x2758('0x3b')]=qs['sort'](_0x1301a2['query'][_0x2758('0x3c')]);_0x530303[_0x2758('0x3d')]=qs[_0x2758('0x32')](_[_0x2758('0x3e')](_0x1301a2[_0x2758('0x34')],_0x253473['filters']));_0x530303[_0x2758('0x3d')][_0x2758('0x59')]=_0x43e530['id'];if(_0x1301a2[_0x2758('0x34')][_0x2758('0x41')]){_0x530303[_0x2758('0x3d')]=_['merge'](_0x530303[_0x2758('0x3d')],{'$or':_[_0x2758('0x2d')](_0x530303[_0x2758('0x37')],function(_0x19f67f){var _0x57e40c={};_0x57e40c[_0x19f67f]={'$like':'%'+_0x1301a2[_0x2758('0x34')]['filter']+'%'};return _0x57e40c;})});}_0x530303=_[_0x2758('0x3f')]({},_0x530303,_0x1301a2[_0x2758('0x42')]);return db[_0x2758('0x5d')][_0x2758('0x1c')]({'where':_0x530303[_0x2758('0x3d')]})[_0x2758('0x24')](function(_0x2d9282){_0x5c88e3[_0x2758('0x1c')]=_0x2d9282;if(_0x1301a2[_0x2758('0x34')]['includeAll']){_0x530303[_0x2758('0x49')]=[{'all':!![]}];}return db[_0x2758('0x5d')]['findAll'](_0x530303);})[_0x2758('0x24')](function(_0xcc8980){_0x5c88e3[_0x2758('0x45')]=_0xcc8980;return _0x5c88e3;});}})[_0x2758('0x24')](respondWithFilteredResult(_0x5f08cb,_0x530303))['catch'](handleError(_0x5f08cb,null));};exports[_0x2758('0x5e')]=function(_0x1eb580,_0x2ac44d,_0x5d0357){var _0x30f170={'raw':!![],'where':{}};var _0x7d8fae={};var _0x365192={'count':0x0,'rows':[]};return db['Campaign'][_0x2758('0x58')]({'where':{'id':_0x1eb580[_0x2758('0x54')]['id']}})[_0x2758('0x24')](handleEntityNotFound(_0x2ac44d,null))[_0x2758('0x24')](function(_0xca22e8){if(_0xca22e8){_0x7d8fae[_0x2758('0x33')]=_[_0x2758('0x31')](db[_0x2758('0x5f')][_0x2758('0x2e')]);_0x7d8fae[_0x2758('0x34')]=_[_0x2758('0x31')](_0x1eb580[_0x2758('0x34')]);_0x7d8fae[_0x2758('0x32')]=_[_0x2758('0x35')](_0x7d8fae[_0x2758('0x33')],_0x7d8fae[_0x2758('0x34')]);_0x30f170[_0x2758('0x37')]=_['intersection'](_0x7d8fae[_0x2758('0x33')],qs[_0x2758('0x36')](_0x1eb580[_0x2758('0x34')]['fields']));_0x30f170[_0x2758('0x37')]=_0x30f170[_0x2758('0x37')][_0x2758('0x38')]?_0x30f170[_0x2758('0x37')]:_0x7d8fae['model'];if(!_0x1eb580[_0x2758('0x34')][_0x2758('0x39')]('nolimit')){_0x30f170[_0x2758('0x1d')]=qs[_0x2758('0x1d')](_0x1eb580[_0x2758('0x34')][_0x2758('0x1d')]);_0x30f170[_0x2758('0x1b')]=qs[_0x2758('0x1b')](_0x1eb580[_0x2758('0x34')]['offset']);}_0x30f170[_0x2758('0x3b')]=qs[_0x2758('0x3c')](_0x1eb580['query'][_0x2758('0x3c')]);_0x30f170[_0x2758('0x3d')]=qs[_0x2758('0x32')](_[_0x2758('0x3e')](_0x1eb580[_0x2758('0x34')],_0x7d8fae[_0x2758('0x32')]));_0x30f170[_0x2758('0x3d')][_0x2758('0x59')]=_0xca22e8['id'];if(_0x1eb580[_0x2758('0x34')][_0x2758('0x41')]){_0x30f170[_0x2758('0x3d')]=_[_0x2758('0x3f')](_0x30f170[_0x2758('0x3d')],{'$or':_[_0x2758('0x2d')](_0x30f170[_0x2758('0x37')],function(_0x1467d2){var _0x575a59={};_0x575a59[_0x1467d2]={'$like':'%'+_0x1eb580[_0x2758('0x34')][_0x2758('0x41')]+'%'};return _0x575a59;})});}_0x30f170=_[_0x2758('0x3f')]({},_0x30f170,_0x1eb580[_0x2758('0x42')]);return db[_0x2758('0x5f')]['count']({'where':_0x30f170[_0x2758('0x3d')]})['then'](function(_0x483d11){_0x365192[_0x2758('0x1c')]=_0x483d11;if(_0x1eb580[_0x2758('0x34')][_0x2758('0x48')]){_0x30f170['include']=[{'all':!![]}];}return db[_0x2758('0x5f')]['findAll'](_0x30f170);})[_0x2758('0x24')](function(_0x5eda32){_0x365192[_0x2758('0x45')]=_0x5eda32;return _0x365192;});}})['then'](respondWithFilteredResult(_0x2ac44d,_0x30f170))[_0x2758('0x46')](handleError(_0x2ac44d,null));};exports[_0x2758('0x60')]=function(_0x307b9a,_0x3896c6,_0x1d3ed2){var _0xe6425e={};var _0x1fcef1={};var _0x3ab0e6;var _0x490999;return db[_0x2758('0x43')][_0x2758('0x58')]({'where':{'id':_0x307b9a[_0x2758('0x54')]['id']}})[_0x2758('0x24')](handleEntityNotFound(_0x3896c6,null))['then'](function(_0x5b0fe0){if(_0x5b0fe0){_0x3ab0e6=_0x5b0fe0;_0x1fcef1[_0x2758('0x33')]=_['keys'](db['CmList'][_0x2758('0x2e')]);_0x1fcef1[_0x2758('0x34')]=_[_0x2758('0x31')](_0x307b9a[_0x2758('0x34')]);_0x1fcef1[_0x2758('0x32')]=_[_0x2758('0x35')](_0x1fcef1['model'],_0x1fcef1[_0x2758('0x34')]);_0xe6425e[_0x2758('0x37')]=_['intersection'](_0x1fcef1[_0x2758('0x33')],qs['fields'](_0x307b9a[_0x2758('0x34')]['fields']));_0xe6425e['attributes']=_0xe6425e['attributes'][_0x2758('0x38')]?_0xe6425e['attributes']:_0x1fcef1[_0x2758('0x33')];_0xe6425e[_0x2758('0x3b')]=qs['sort'](_0x307b9a[_0x2758('0x34')]['sort']);_0xe6425e['where']=qs[_0x2758('0x32')](_['pick'](_0x307b9a[_0x2758('0x34')],_0x1fcef1['filters']));if(_0x307b9a[_0x2758('0x34')]['filter']){_0xe6425e[_0x2758('0x3d')]=_[_0x2758('0x3f')](_0xe6425e[_0x2758('0x3d')],{'$or':_['map'](_0xe6425e['attributes'],function(_0x1de6f7){var _0x23a64a={};_0x23a64a[_0x1de6f7]={'$like':'%'+_0x307b9a[_0x2758('0x34')][_0x2758('0x41')]+'%'};return _0x23a64a;})});}_0xe6425e=_[_0x2758('0x3f')]({},_0xe6425e,_0x307b9a[_0x2758('0x42')]);return _0x3ab0e6[_0x2758('0x60')](_0xe6425e);}})[_0x2758('0x24')](function(_0x561a69){if(_0x561a69){_0x490999=_0x561a69[_0x2758('0x38')];if(!_0x307b9a[_0x2758('0x34')]['hasOwnProperty'](_0x2758('0x3a'))){_0xe6425e[_0x2758('0x1d')]=qs[_0x2758('0x1d')](_0x307b9a[_0x2758('0x34')][_0x2758('0x1d')]);_0xe6425e[_0x2758('0x1b')]=qs[_0x2758('0x1b')](_0x307b9a[_0x2758('0x34')][_0x2758('0x1b')]);}return _0x3ab0e6[_0x2758('0x60')](_0xe6425e);}})['then'](function(_0x2467fd){if(_0x2467fd){return _0x2467fd?{'count':_0x490999,'rows':_0x2467fd}:null;}})[_0x2758('0x24')](respondWithResult(_0x3896c6,null))[_0x2758('0x46')](handleError(_0x3896c6,null));};exports[_0x2758('0x61')]=function(_0x5c14a8,_0x3172e4,_0x358f98){var _0x433d2f,_0x4894fa;var _0x279293=[];var _0x5353fe=moment()[_0x2758('0x62')](_0x2758('0x63'));return db['Campaign'][_0x2758('0x4a')]({'where':{'id':_0x5c14a8[_0x2758('0x54')]['id']}})[_0x2758('0x24')](handleEntityNotFound(_0x3172e4,null))[_0x2758('0x24')](function(_0x5649e0){if(_0x5649e0){_0x4894fa=_0x5649e0;return _0x5649e0[_0x2758('0x61')](_0x5c14a8[_0x2758('0x4c')][_0x2758('0x64')],_[_0x2758('0x65')](_0x5c14a8['body'],[_0x2758('0x64'),'id'])||{});}return null;})[_0x2758('0x66')](function(_0x51d1b5){var _0x5a4060;var _0x440f4f;_0x433d2f=_0x51d1b5||[];var _0xa685b2=[];if(_0x51d1b5){for(var _0x220444=0x0;_0x220444<_0x51d1b5[_0x2758('0x38')];_0x220444+=0x1){var _0x2db99f=_0x51d1b5[_0x220444][_0x2758('0x26')]({'plain':!![]});_0x4894fa[_0x2758('0x67')]=_0x5c14a8[_0x2758('0x4c')][_0x2758('0x67')]?_0x5c14a8['body'][_0x2758('0x67')]:_0x4894fa['dialCheckDuplicateType'];switch(_0x4894fa['dialCheckDuplicateType']){case'always':_0x5a4060=squel[_0x2758('0x68')]()[_0x2758('0x69')](_0x2758('0x6a'))[_0x2758('0x6b')]([_0x2758('0x6c'),'scheduledAt','ContactId','ListId',_0x2758('0x59'),_0x2758('0x55'),_0x2758('0x56')],squel[_0x2758('0x6d')]()[_0x2758('0x6e')](_0x2758('0x6c'),'phone')[_0x2758('0x6e')]('NOW()','scheduledAt')['field']('id',_0x2758('0x6f'))['field'](_0x2db99f['CmListId'][_0x2758('0x70')](),_0x2758('0x71'))['field'](_0x5c14a8[_0x2758('0x54')]['id']['toString'](),_0x2758('0x59'))[_0x2758('0x6e')]('\x27'+_0x5353fe+'\x27',_0x2758('0x55'))[_0x2758('0x6e')]('\x27'+_0x5353fe+'\x27','updatedAt')[_0x2758('0x72')](_0x2758('0x73'))['where'](_0x2758('0x74'))[_0x2758('0x3d')](_0x2758('0x75'),_0x2db99f[_0x2758('0x76')]['toString']())['where'](_0x2758('0x77'))[_0x2758('0x3d')](_0x2758('0x78'),squel[_0x2758('0x6d')]()['field'](_0x2758('0x79'))[_0x2758('0x72')]('cm_hopper_final')[_0x2758('0x3d')]('CampaignId\x20=\x20?',_0x5c14a8['params']['id'][_0x2758('0x70')]()))[_0x2758('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x2758('0x6e')](_0x2758('0x7a'))[_0x2758('0x72')]('cm_hopper')[_0x2758('0x3d')]('CampaignId\x20=\x20?',_0x5c14a8[_0x2758('0x54')]['id'][_0x2758('0x70')]())))[_0x2758('0x70')]();break;case'onlyIfOpen':_0x5a4060=squel[_0x2758('0x68')]()['into'](_0x2758('0x6a'))[_0x2758('0x6b')]([_0x2758('0x6c'),_0x2758('0x7b'),'ContactId',_0x2758('0x71'),_0x2758('0x59'),_0x2758('0x55'),_0x2758('0x56')],squel[_0x2758('0x6d')]()[_0x2758('0x6e')](_0x2758('0x6c'),_0x2758('0x6c'))[_0x2758('0x6e')](_0x2758('0x7c'),_0x2758('0x7b'))[_0x2758('0x6e')]('id',_0x2758('0x6f'))[_0x2758('0x6e')](_0x2db99f[_0x2758('0x76')][_0x2758('0x70')](),'ListId')['field'](_0x5c14a8[_0x2758('0x54')]['id']['toString'](),_0x2758('0x59'))[_0x2758('0x6e')]('\x27'+_0x5353fe+'\x27',_0x2758('0x55'))[_0x2758('0x6e')]('\x27'+_0x5353fe+'\x27',_0x2758('0x56'))[_0x2758('0x72')]('cm_contacts')['where'](_0x2758('0x74'))['where'](_0x2758('0x75'),_0x2db99f[_0x2758('0x76')][_0x2758('0x70')]())[_0x2758('0x3d')](_0x2758('0x77'))[_0x2758('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x2758('0x6e')]('COALESCE(phone,\x27\x27)')[_0x2758('0x72')]('cm_hopper')[_0x2758('0x3d')](_0x2758('0x7d'),_0x5c14a8[_0x2758('0x54')]['id'][_0x2758('0x70')]())))[_0x2758('0x70')]();break;default:_0x5a4060=squel[_0x2758('0x68')]()[_0x2758('0x69')](_0x2758('0x6a'))[_0x2758('0x6b')]([_0x2758('0x6c'),_0x2758('0x7b'),_0x2758('0x6f'),'ListId',_0x2758('0x59'),_0x2758('0x55'),_0x2758('0x56')],squel[_0x2758('0x6d')]()[_0x2758('0x6e')]('phone','phone')[_0x2758('0x6e')](_0x2758('0x7c'),_0x2758('0x7b'))['field']('id','ContactId')[_0x2758('0x6e')](_0x2db99f['CmListId'][_0x2758('0x70')](),_0x2758('0x71'))[_0x2758('0x6e')](_0x5c14a8[_0x2758('0x54')]['id'][_0x2758('0x70')](),_0x2758('0x59'))[_0x2758('0x6e')]('\x27'+_0x5353fe+'\x27',_0x2758('0x55'))['field']('\x27'+_0x5353fe+'\x27',_0x2758('0x56'))[_0x2758('0x72')](_0x2758('0x73'))[_0x2758('0x3d')](_0x2758('0x74'))[_0x2758('0x3d')](_0x2758('0x75'),_0x2db99f[_0x2758('0x76')][_0x2758('0x70')]())[_0x2758('0x3d')](_0x2758('0x77')))[_0x2758('0x70')]();}_0x440f4f=squel[_0x2758('0x68')]()[_0x2758('0x69')](_0x2758('0x7e'))[_0x2758('0x6b')]([_0x2758('0x7f'),_0x2758('0x7b'),_0x2758('0x6c'),_0x2758('0x80'),_0x2758('0x55'),_0x2758('0x56')],squel[_0x2758('0x6d')]()['field'](_0x2758('0x81'),'id')[_0x2758('0x6e')]('NOW()','scheduledAt')['field'](_0x2758('0x82'),_0x2758('0x6c'))[_0x2758('0x6e')](_0x2758('0x83'),_0x2758('0x80'))[_0x2758('0x6e')]('\x27'+_0x5353fe+'\x27',_0x2758('0x55'))['field']('\x27'+_0x5353fe+'\x27',_0x2758('0x56'))[_0x2758('0x72')](_0x2758('0x84'),'ci')[_0x2758('0x85')]('cm_hopper','h',_0x2758('0x86'))[_0x2758('0x3d')]('h.ListId\x20=\x20?',_0x2db99f[_0x2758('0x76')][_0x2758('0x70')]())[_0x2758('0x3d')]('h.CampaignId=?',_0x5c14a8[_0x2758('0x54')]['id']['toString']())[_0x2758('0x3d')](_0x2758('0x87'),_0x5353fe))['toString']();_0xa685b2[_0x2758('0x88')](db['sequelize']['query'](_0x5a4060));_0x279293[_0x2758('0x88')](db[_0x2758('0x89')][_0x2758('0x34')](_0x440f4f));}return BPromise[_0x2758('0x8a')](_0xa685b2);}})['then'](function(){return BPromise[_0x2758('0x8a')](_0x279293);})['then'](function(){return _0x433d2f;})[_0x2758('0x24')](respondWithResult(_0x3172e4,null))[_0x2758('0x46')](handleError(_0x3172e4,null));};exports[_0x2758('0x8b')]=function(_0x5f21c0,_0x295964,_0x5da95e){return db[_0x2758('0x43')][_0x2758('0x4a')]({'where':{'id':_0x5f21c0[_0x2758('0x54')]['id']}})[_0x2758('0x24')](handleEntityNotFound(_0x295964,null))[_0x2758('0x24')](function(_0x212a4f){if(_0x212a4f){return _0x212a4f[_0x2758('0x8b')](_0x5f21c0[_0x2758('0x34')][_0x2758('0x64')]);}})[_0x2758('0x24')](function(_0x435370){if(_0x435370){return db[_0x2758('0x5a')][_0x2758('0x25')]({'where':{'ListId':_0x5f21c0[_0x2758('0x34')][_0x2758('0x64')],'CampaignId':_0x5f21c0[_0x2758('0x54')]['id']}})[_0x2758('0x24')](function(){return _0x435370;});}})['then'](respondWithStatusCode(_0x295964,null))[_0x2758('0x46')](handleError(_0x295964,null));};exports[_0x2758('0x8c')]=function(_0x2c0208,_0x58a98c,_0x4caf5e){var _0x156e50={};var _0x47c32f={};var _0x14a65c;var _0x11c84d;return db[_0x2758('0x43')][_0x2758('0x58')]({'where':{'id':_0x2c0208[_0x2758('0x54')]['id']}})[_0x2758('0x24')](handleEntityNotFound(_0x58a98c,null))[_0x2758('0x24')](function(_0x5ba958){if(_0x5ba958){_0x14a65c=_0x5ba958;_0x47c32f[_0x2758('0x33')]=_[_0x2758('0x31')](db[_0x2758('0x8d')][_0x2758('0x2e')]);_0x47c32f[_0x2758('0x34')]=_[_0x2758('0x31')](_0x2c0208['query']);_0x47c32f[_0x2758('0x32')]=_[_0x2758('0x35')](_0x47c32f[_0x2758('0x33')],_0x47c32f[_0x2758('0x34')]);_0x156e50[_0x2758('0x37')]=_[_0x2758('0x35')](_0x47c32f['model'],qs[_0x2758('0x36')](_0x2c0208['query']['fields']));_0x156e50[_0x2758('0x37')]=_0x156e50[_0x2758('0x37')][_0x2758('0x38')]?_0x156e50['attributes']:_0x47c32f[_0x2758('0x33')];_0x156e50[_0x2758('0x3b')]=qs[_0x2758('0x3c')](_0x2c0208[_0x2758('0x34')][_0x2758('0x3c')]);_0x156e50[_0x2758('0x3d')]=qs[_0x2758('0x32')](_['pick'](_0x2c0208[_0x2758('0x34')],_0x47c32f[_0x2758('0x32')]));if(_0x2c0208['query'][_0x2758('0x41')]){_0x156e50[_0x2758('0x3d')]=_['merge'](_0x156e50[_0x2758('0x3d')],{'$or':_[_0x2758('0x2d')](_0x156e50[_0x2758('0x37')],function(_0x3f0358){var _0x2ece96={};_0x2ece96[_0x3f0358]={'$like':'%'+_0x2c0208[_0x2758('0x34')][_0x2758('0x41')]+'%'};return _0x2ece96;})});}_0x156e50=_[_0x2758('0x3f')]({},_0x156e50,_0x2c0208[_0x2758('0x42')]);return _0x14a65c[_0x2758('0x8c')](_0x156e50);}})['then'](function(_0x19c2db){if(_0x19c2db){_0x11c84d=_0x19c2db[_0x2758('0x38')];if(!_0x2c0208[_0x2758('0x34')]['hasOwnProperty'](_0x2758('0x3a'))){_0x156e50['limit']=qs[_0x2758('0x1d')](_0x2c0208['query'][_0x2758('0x1d')]);_0x156e50[_0x2758('0x1b')]=qs[_0x2758('0x1b')](_0x2c0208['query'][_0x2758('0x1b')]);}return _0x14a65c[_0x2758('0x8c')](_0x156e50);}})['then'](function(_0x493508){if(_0x493508){return _0x493508?{'count':_0x11c84d,'rows':_0x493508}:null;}})['then'](respondWithResult(_0x58a98c,null))['catch'](handleError(_0x58a98c,null));};exports[_0x2758('0x8e')]=function(_0xb52bbb,_0x1b1fa7,_0x19c18f){var _0x21ee55,_0x502d79;var _0x562edd=[];var _0x1d9bfe=moment()[_0x2758('0x62')](_0x2758('0x63'));return db[_0x2758('0x43')]['find']({'where':{'id':_0xb52bbb[_0x2758('0x54')]['id']}})[_0x2758('0x24')](handleEntityNotFound(_0x1b1fa7,null))[_0x2758('0x24')](function(_0x5a8e41){if(_0x5a8e41){_0x502d79=_0x5a8e41;return _0x5a8e41[_0x2758('0x8e')](_0xb52bbb[_0x2758('0x4c')][_0x2758('0x64')],_[_0x2758('0x65')](_0xb52bbb[_0x2758('0x4c')],[_0x2758('0x64'),'id'])||{});}return null;})[_0x2758('0x66')](function(_0x1428e2){var _0x45a800;var _0x5b8764;_0x21ee55=_0x1428e2||[];var _0x57ca48=[];if(_0x1428e2){for(var _0x207551=0x0;_0x207551<_0x1428e2[_0x2758('0x38')];_0x207551+=0x1){var _0x538989=_0x1428e2[_0x207551]['get']({'plain':!![]});_0x45a800=squel[_0x2758('0x68')]()['into'](_0x2758('0x8f'))[_0x2758('0x6b')](['phone',_0x2758('0x6f'),_0x2758('0x71'),_0x2758('0x59'),_0x2758('0x55'),'updatedAt'],squel[_0x2758('0x6d')]()[_0x2758('0x6e')]('phone',_0x2758('0x6c'))[_0x2758('0x6e')]('id',_0x2758('0x6f'))[_0x2758('0x6e')](_0x538989['CmListId'][_0x2758('0x70')](),'ListId')[_0x2758('0x6e')](_0xb52bbb[_0x2758('0x54')]['id']['toString'](),_0x2758('0x59'))['field'](_0x2758('0x7c'),_0x2758('0x55'))['field'](_0x2758('0x7c'),_0x2758('0x56'))[_0x2758('0x72')](_0x2758('0x73'))[_0x2758('0x3d')](_0x2758('0x74'))[_0x2758('0x3d')](_0x2758('0x75'),_0x538989[_0x2758('0x76')]['toString']())[_0x2758('0x3d')]('phone\x20IS\x20NOT\x20NULL'))[_0x2758('0x70')]();_0x57ca48[_0x2758('0x88')](db[_0x2758('0x89')][_0x2758('0x34')](_0x45a800));}return BPromise[_0x2758('0x8a')](_0x57ca48);}})[_0x2758('0x24')](function(){return _0x21ee55;})[_0x2758('0x24')](respondWithResult(_0x1b1fa7,null))[_0x2758('0x46')](handleError(_0x1b1fa7,null));};exports['removeBlackLists']=function(_0x2ed741,_0x2be3b0,_0x3a5572){return db['Campaign'][_0x2758('0x4a')]({'where':{'id':_0x2ed741[_0x2758('0x54')]['id']}})[_0x2758('0x24')](handleEntityNotFound(_0x2be3b0,null))['then'](function(_0x47507f){if(_0x47507f){return _0x47507f[_0x2758('0x90')](_0x2ed741[_0x2758('0x34')][_0x2758('0x64')]);}})[_0x2758('0x24')](function(_0x2b6796){if(_0x2b6796){return db[_0x2758('0x5f')][_0x2758('0x25')]({'where':{'ListId':_0x2ed741[_0x2758('0x34')]['ids'],'CampaignId':_0x2ed741['params']['id']}})['then'](function(){return _0x2b6796;});}})[_0x2758('0x24')](respondWithStatusCode(_0x2be3b0,null))[_0x2758('0x46')](handleError(_0x2be3b0,null));};
\ No newline at end of file
+var _0x53aa=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','params','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','fromQuery','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','phone','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','cm_hopper','insert','cm_hopper_additional_phones','cmHopperId','ci.OrderBY','OrderBy','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','cm_hopper_black','phone\x20IS\x20NOT\x20NULL','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','get','IvrCampaigns','UserProfileResource','destroy','stack','name','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','Campaign','findAll','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error'];(function(_0x3b1c9a,_0x5b2988){var _0x4bfe0e=function(_0x6050c2){while(--_0x6050c2){_0x3b1c9a['push'](_0x3b1c9a['shift']());}};_0x4bfe0e(++_0x5b2988);}(_0x53aa,0x167));var _0xa53a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x53aa[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0xa53a('0x0'));var rimraf=require(_0xa53a('0x1'));var zipdir=require(_0xa53a('0x2'));var jsonpatch=require(_0xa53a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa53a('0x4'));var Mustache=require('mustache');var util=require(_0xa53a('0x5'));var path=require(_0xa53a('0x6'));var sox=require(_0xa53a('0x7'));var csv=require(_0xa53a('0x8'));var ejs=require(_0xa53a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa53a('0xa'));var squel=require(_0xa53a('0xb'));var crypto=require('crypto');var jsforce=require(_0xa53a('0xc'));var deskjs=require(_0xa53a('0xd'));var toCsv=require(_0xa53a('0x8'));var querystring=require('querystring');var Papa=require(_0xa53a('0xe'));var Redis=require('ioredis');var authService=require(_0xa53a('0xf'));var qs=require(_0xa53a('0x10'));var as=require(_0xa53a('0x11'));var hardwareService=require(_0xa53a('0x12'));var logger=require(_0xa53a('0x13'))(_0xa53a('0x14'));var utils=require(_0xa53a('0x15'));var config=require(_0xa53a('0x16'));var licenseUtil=require(_0xa53a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x448fcb,_0x52cb14){_0x52cb14=_0x52cb14||0xcc;return function(_0x3d5a63){if(_0x3d5a63){return _0x448fcb[_0xa53a('0x18')](_0x52cb14);}return _0x448fcb[_0xa53a('0x19')](_0x52cb14)[_0xa53a('0x1a')]();};}function respondWithResult(_0x252c59,_0x333cdc){_0x333cdc=_0x333cdc||0xc8;return function(_0xebb4b7){if(_0xebb4b7){return _0x252c59[_0xa53a('0x19')](_0x333cdc)[_0xa53a('0x1b')](_0xebb4b7);}};}function respondWithFilteredResult(_0x1ce266,_0x2d1f21){return function(_0x427d66){if(_0x427d66){var _0x5c5a14=typeof _0x2d1f21[_0xa53a('0x1c')]===_0xa53a('0x1d')&&typeof _0x2d1f21['limit']===_0xa53a('0x1d');var _0x3f3869=_0x427d66[_0xa53a('0x1e')];var _0xf61650=_0x5c5a14?0x0:_0x2d1f21[_0xa53a('0x1c')];var _0x379a0b=_0x5c5a14?_0x427d66[_0xa53a('0x1e')]:_0x2d1f21[_0xa53a('0x1c')]+_0x2d1f21[_0xa53a('0x1f')];var _0x1e1401;if(_0x379a0b>=_0x3f3869){_0x379a0b=_0x3f3869;_0x1e1401=0xc8;}else{_0x1e1401=0xce;}_0x1ce266[_0xa53a('0x19')](_0x1e1401);return _0x1ce266[_0xa53a('0x20')](_0xa53a('0x21'),_0xf61650+'-'+_0x379a0b+'/'+_0x3f3869)[_0xa53a('0x1b')](_0x427d66);}return null;};}function patchUpdates(_0x584c4e){return function(_0x4527c8){try{jsonpatch[_0xa53a('0x22')](_0x4527c8,_0x584c4e,!![]);}catch(_0x478ff2){return BPromise[_0xa53a('0x23')](_0x478ff2);}return _0x4527c8['save']();};}function saveUpdates(_0x1a2a2a,_0x352f91){return function(_0xc5fe37){if(_0xc5fe37){return _0xc5fe37[_0xa53a('0x24')](_0x1a2a2a)[_0xa53a('0x25')](function(_0x324a24){return _0x324a24;});}return null;};}function removeEntity(_0x5cdb5c,_0x138a10){return function(_0x2cc210){if(_0x2cc210){return _0x2cc210['destroy']()[_0xa53a('0x25')](function(){var _0x3878e0=_0x2cc210[_0xa53a('0x26')]({'plain':!![]});var _0x1d9466=_0xa53a('0x27');return db[_0xa53a('0x28')][_0xa53a('0x29')]({'where':{'type':_0x1d9466,'resourceId':_0x3878e0['id']}})['then'](function(){return _0x2cc210;});})['then'](function(){_0x5cdb5c[_0xa53a('0x19')](0xcc)[_0xa53a('0x1a')]();});}};}function handleEntityNotFound(_0x512d96,_0x3d11a2){return function(_0xe10903){if(!_0xe10903){_0x512d96[_0xa53a('0x18')](0x194);}return _0xe10903;};}function handleError(_0x33565a,_0x2ffcb6){_0x2ffcb6=_0x2ffcb6||0x1f4;return function(_0x1e796b){logger['error'](_0x1e796b[_0xa53a('0x2a')]);if(_0x1e796b[_0xa53a('0x2b')]){delete _0x1e796b[_0xa53a('0x2b')];}_0x33565a['status'](_0x2ffcb6)['send'](_0x1e796b);};}exports[_0xa53a('0x2c')]=function(_0x37ef40,_0x1bb99d){var _0x4bd9b9={},_0x2d78eb={},_0xd60689={'count':0x0,'rows':[]};var _0x7e6177=_[_0xa53a('0x2d')](db['Campaign']['rawAttributes'],function(_0x2b7024){return{'name':_0x2b7024[_0xa53a('0x2e')],'type':_0x2b7024[_0xa53a('0x2f')][_0xa53a('0x30')]};});_0x2d78eb[_0xa53a('0x31')]=_[_0xa53a('0x2d')](_0x7e6177,_0xa53a('0x2b'));_0x2d78eb[_0xa53a('0x32')]=_[_0xa53a('0x33')](_0x37ef40['query']);_0x2d78eb[_0xa53a('0x34')]=_['intersection'](_0x2d78eb[_0xa53a('0x31')],_0x2d78eb[_0xa53a('0x32')]);_0x4bd9b9[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x2d78eb[_0xa53a('0x31')],qs[_0xa53a('0x37')](_0x37ef40[_0xa53a('0x32')][_0xa53a('0x37')]));_0x4bd9b9[_0xa53a('0x35')]=_0x4bd9b9['attributes'][_0xa53a('0x38')]?_0x4bd9b9['attributes']:_0x2d78eb['model'];if(!_0x37ef40[_0xa53a('0x32')][_0xa53a('0x39')](_0xa53a('0x3a'))){_0x4bd9b9['limit']=qs[_0xa53a('0x1f')](_0x37ef40['query'][_0xa53a('0x1f')]);_0x4bd9b9[_0xa53a('0x1c')]=qs['offset'](_0x37ef40[_0xa53a('0x32')][_0xa53a('0x1c')]);}_0x4bd9b9[_0xa53a('0x3b')]=qs['sort'](_0x37ef40[_0xa53a('0x32')][_0xa53a('0x3c')]);_0x4bd9b9['where']=qs[_0xa53a('0x34')](_[_0xa53a('0x3d')](_0x37ef40[_0xa53a('0x32')],_0x2d78eb[_0xa53a('0x34')]),_0x7e6177);if(_0x37ef40[_0xa53a('0x32')]['filter']){_0x4bd9b9[_0xa53a('0x3e')]=_[_0xa53a('0x3f')](_0x4bd9b9['where'],{'$or':_[_0xa53a('0x2d')](_0x7e6177,function(_0x11e623){if(_0x11e623[_0xa53a('0x2f')]!==_0xa53a('0x40')){var _0x4602b5={};_0x4602b5[_0x11e623[_0xa53a('0x2b')]]={'$like':'%'+_0x37ef40[_0xa53a('0x32')][_0xa53a('0x41')]+'%'};return _0x4602b5;}})});}_0x4bd9b9=_[_0xa53a('0x3f')]({},_0x4bd9b9,_0x37ef40[_0xa53a('0x42')]);var _0x50fd89={'where':_0x4bd9b9[_0xa53a('0x3e')]};return db['Campaign'][_0xa53a('0x1e')](_0x50fd89)[_0xa53a('0x25')](function(_0x4a9d5d){_0xd60689[_0xa53a('0x1e')]=_0x4a9d5d;if(_0x37ef40[_0xa53a('0x32')][_0xa53a('0x43')]){_0x4bd9b9[_0xa53a('0x44')]=[{'all':!![]}];}return db[_0xa53a('0x45')][_0xa53a('0x46')](_0x4bd9b9);})[_0xa53a('0x25')](function(_0x3fc9ea){_0xd60689[_0xa53a('0x47')]=_0x3fc9ea;return _0xd60689;})[_0xa53a('0x25')](respondWithFilteredResult(_0x1bb99d,_0x4bd9b9))[_0xa53a('0x48')](handleError(_0x1bb99d,null));};exports[_0xa53a('0x49')]=function(_0x4f5178,_0x1e4536){var _0x55ded6={'raw':![],'where':{'id':_0x4f5178['params']['id']}},_0x1dd82b={};_0x1dd82b[_0xa53a('0x31')]=_[_0xa53a('0x33')](db[_0xa53a('0x45')][_0xa53a('0x4a')]);_0x1dd82b[_0xa53a('0x32')]=_[_0xa53a('0x33')](_0x4f5178[_0xa53a('0x32')]);_0x1dd82b[_0xa53a('0x34')]=_[_0xa53a('0x36')](_0x1dd82b[_0xa53a('0x31')],_0x1dd82b[_0xa53a('0x32')]);_0x55ded6[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x1dd82b[_0xa53a('0x31')],qs[_0xa53a('0x37')](_0x4f5178['query']['fields']));_0x55ded6[_0xa53a('0x35')]=_0x55ded6[_0xa53a('0x35')][_0xa53a('0x38')]?_0x55ded6[_0xa53a('0x35')]:_0x1dd82b[_0xa53a('0x31')];if(_0x4f5178[_0xa53a('0x32')][_0xa53a('0x43')]){_0x55ded6[_0xa53a('0x44')]=[{'all':!![]}];}_0x55ded6=_[_0xa53a('0x3f')]({},_0x55ded6,_0x4f5178['options']);return db[_0xa53a('0x45')][_0xa53a('0x4b')](_0x55ded6)[_0xa53a('0x25')](handleEntityNotFound(_0x1e4536,null))[_0xa53a('0x25')](respondWithResult(_0x1e4536,null))[_0xa53a('0x48')](handleError(_0x1e4536,null));};exports['create']=function(_0xd16651,_0xec389b){return db[_0xa53a('0x45')][_0xa53a('0x4c')](_0xd16651[_0xa53a('0x4d')],{})[_0xa53a('0x25')](function(_0x30e30f){var _0x10b86b=_0xd16651[_0xa53a('0x4e')][_0xa53a('0x26')]({'plain':!![]});if(!_0x10b86b)throw new Error(_0xa53a('0x4f'));if(_0x10b86b[_0xa53a('0x50')]===_0xa53a('0x4e')){var _0x515f62=_0x30e30f[_0xa53a('0x26')]({'plain':!![]});var _0x5380bb=_0xa53a('0x27');return db[_0xa53a('0x51')]['find']({'where':{'name':_0x5380bb,'userProfileId':_0x10b86b[_0xa53a('0x52')]},'raw':!![]})[_0xa53a('0x25')](function(_0x13acaf){if(_0x13acaf&&_0x13acaf[_0xa53a('0x53')]===0x0){return db[_0xa53a('0x28')][_0xa53a('0x4c')]({'name':_0x515f62[_0xa53a('0x2b')],'resourceId':_0x515f62['id'],'type':_0x13acaf[_0xa53a('0x2b')],'sectionId':_0x13acaf['id']},{})[_0xa53a('0x25')](function(){return _0x30e30f;});}else{return _0x30e30f;}})['catch'](function(_0x56a4ef){logger[_0xa53a('0x54')](_0xa53a('0x55'),_0x56a4ef);throw _0x56a4ef;});}return _0x30e30f;})[_0xa53a('0x25')](respondWithResult(_0xec389b,0xc9))['catch'](handleError(_0xec389b,null));};exports[_0xa53a('0x56')]=function(_0x1a9449,_0x36b9c){var _0x2416f3={'where':{'id':_0x1a9449['params']['id']}},_0x5709e9={};_0x5709e9[_0xa53a('0x31')]=_[_0xa53a('0x33')](db[_0xa53a('0x45')][_0xa53a('0x4a')]);_0x2416f3[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x5709e9[_0xa53a('0x31')],qs[_0xa53a('0x37')](_0x1a9449[_0xa53a('0x32')][_0xa53a('0x37')]));_0x2416f3['attributes']=_0x2416f3[_0xa53a('0x35')]['length']?_0x2416f3['attributes']:_0x5709e9[_0xa53a('0x31')];if(_0x1a9449[_0xa53a('0x32')][_0xa53a('0x43')]){_0x2416f3['include']=[{'all':!![]}];}_0x2416f3=_[_0xa53a('0x3f')]({},_0x2416f3,_0x1a9449[_0xa53a('0x42')]);return db['Campaign'][_0xa53a('0x4b')](_0x2416f3)[_0xa53a('0x25')](handleEntityNotFound(_0x36b9c,null))[_0xa53a('0x25')](function(_0x4fbe3b){if(_0x4fbe3b){var _0x75f0e0=_0x4fbe3b[_0xa53a('0x26')]({'plain':!![]});_0x75f0e0=qs[_0xa53a('0x57')](_0x75f0e0,['id',_0xa53a('0x58'),_0xa53a('0x59')]);_0x1a9449['body']=_['omit'](_0x1a9449['body'],['id','createdAt','updatedAt']);return db[_0xa53a('0x45')][_0xa53a('0x4c')](_[_0xa53a('0x3f')](_0x75f0e0,_0x1a9449['body']),{'include':_0x1a9449[_0xa53a('0x32')][_0xa53a('0x43')]?[{'all':!![]}]:undefined})[_0xa53a('0x25')](function(_0x5556da){var _0x306891=_0x1a9449['user']['get']({'plain':!![]});if(!_0x306891)throw new Error(_0xa53a('0x4f'));if(_0x306891['role']===_0xa53a('0x4e')){var _0xfa9984=_0x5556da[_0xa53a('0x26')]({'plain':!![]});var _0x35c243=_0xa53a('0x27');return db[_0xa53a('0x51')]['find']({'where':{'name':_0x35c243,'userProfileId':_0x306891[_0xa53a('0x52')]},'raw':!![]})[_0xa53a('0x25')](function(_0x1439a4){if(_0x1439a4&&_0x1439a4['autoAssociation']===0x0){return db[_0xa53a('0x28')][_0xa53a('0x4c')]({'name':_0xfa9984[_0xa53a('0x2b')],'resourceId':_0xfa9984['id'],'type':_0x1439a4[_0xa53a('0x2b')],'sectionId':_0x1439a4['id']},{})[_0xa53a('0x25')](function(){return _0x5556da;});}else{return _0x5556da;}})[_0xa53a('0x48')](function(_0x5bd848){logger[_0xa53a('0x54')](_0xa53a('0x55'),_0x5bd848);throw _0x5bd848;});}return _0x5556da;});}})['then'](respondWithResult(_0x36b9c,0xc9))[_0xa53a('0x48')](handleError(_0x36b9c,null));};exports[_0xa53a('0x24')]=function(_0x530ca8,_0x4c7f47){if(_0x530ca8['body']['id']){delete _0x530ca8[_0xa53a('0x4d')]['id'];}return db[_0xa53a('0x45')][_0xa53a('0x4b')]({'where':{'id':_0x530ca8[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0x4c7f47,null))['then'](saveUpdates(_0x530ca8[_0xa53a('0x4d')],null))[_0xa53a('0x25')](respondWithResult(_0x4c7f47,null))[_0xa53a('0x48')](handleError(_0x4c7f47,null));};exports[_0xa53a('0x29')]=function(_0x16ac88,_0x240a25){return db[_0xa53a('0x45')][_0xa53a('0x4b')]({'where':{'id':_0x16ac88[_0xa53a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x240a25,null))['then'](removeEntity(_0x240a25,null))['catch'](handleError(_0x240a25,null));};exports[_0xa53a('0x5b')]=function(_0x25044f,_0x11f1c3,_0x3f16df){var _0x17f983={'raw':!![],'where':{}};var _0x229f8c={};var _0x4143f2={'count':0x0,'rows':[]};return db[_0xa53a('0x45')][_0xa53a('0x5c')]({'where':{'id':_0x25044f[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0x11f1c3,null))[_0xa53a('0x25')](function(_0x363ae1){if(_0x363ae1){_0x229f8c['model']=_[_0xa53a('0x33')](db[_0xa53a('0x5d')][_0xa53a('0x4a')]);_0x229f8c[_0xa53a('0x32')]=_[_0xa53a('0x33')](_0x25044f[_0xa53a('0x32')]);_0x229f8c[_0xa53a('0x34')]=_[_0xa53a('0x36')](_0x229f8c['model'],_0x229f8c['query']);_0x17f983[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x229f8c['model'],qs['fields'](_0x25044f[_0xa53a('0x32')][_0xa53a('0x37')]));_0x17f983[_0xa53a('0x35')]=_0x17f983[_0xa53a('0x35')]['length']?_0x17f983[_0xa53a('0x35')]:_0x229f8c[_0xa53a('0x31')];if(!_0x25044f[_0xa53a('0x32')][_0xa53a('0x39')](_0xa53a('0x3a'))){_0x17f983[_0xa53a('0x1f')]=qs[_0xa53a('0x1f')](_0x25044f[_0xa53a('0x32')][_0xa53a('0x1f')]);_0x17f983[_0xa53a('0x1c')]=qs[_0xa53a('0x1c')](_0x25044f[_0xa53a('0x32')][_0xa53a('0x1c')]);}_0x17f983[_0xa53a('0x3b')]=qs[_0xa53a('0x3c')](_0x25044f[_0xa53a('0x32')][_0xa53a('0x3c')]);_0x17f983[_0xa53a('0x3e')]=qs[_0xa53a('0x34')](_['pick'](_0x25044f[_0xa53a('0x32')],_0x229f8c[_0xa53a('0x34')]));_0x17f983[_0xa53a('0x3e')][_0xa53a('0x5e')]=_0x363ae1['id'];if(_0x25044f[_0xa53a('0x32')]['filter']){_0x17f983[_0xa53a('0x3e')]=_[_0xa53a('0x3f')](_0x17f983['where'],{'$or':_[_0xa53a('0x2d')](_0x17f983[_0xa53a('0x35')],function(_0x3a7675){var _0x15976a={};_0x15976a[_0x3a7675]={'$like':'%'+_0x25044f['query'][_0xa53a('0x41')]+'%'};return _0x15976a;})});}_0x17f983=_[_0xa53a('0x3f')]({},_0x17f983,_0x25044f[_0xa53a('0x42')]);return db['CmHopper']['count']({'where':_0x17f983[_0xa53a('0x3e')]})[_0xa53a('0x25')](function(_0x343235){_0x4143f2['count']=_0x343235;if(_0x25044f[_0xa53a('0x32')][_0xa53a('0x43')]){_0x17f983[_0xa53a('0x44')]=[{'all':!![]}];}return db['CmHopper'][_0xa53a('0x46')](_0x17f983);})[_0xa53a('0x25')](function(_0x5da9ce){_0x4143f2[_0xa53a('0x47')]=_0x5da9ce;return _0x4143f2;});}})[_0xa53a('0x25')](respondWithFilteredResult(_0x11f1c3,_0x17f983))['catch'](handleError(_0x11f1c3,null));};exports[_0xa53a('0x5f')]=function(_0x27decf,_0xdec0eb,_0x77779){var _0x208d92={'raw':!![],'where':{}};var _0x324446={};var _0x916b0a={'count':0x0,'rows':[]};return db[_0xa53a('0x45')][_0xa53a('0x5c')]({'where':{'id':_0x27decf[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0xdec0eb,null))[_0xa53a('0x25')](function(_0x2a3227){if(_0x2a3227){_0x324446[_0xa53a('0x31')]=_[_0xa53a('0x33')](db[_0xa53a('0x60')][_0xa53a('0x4a')]);_0x324446[_0xa53a('0x32')]=_[_0xa53a('0x33')](_0x27decf['query']);_0x324446['filters']=_[_0xa53a('0x36')](_0x324446['model'],_0x324446[_0xa53a('0x32')]);_0x208d92[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x324446[_0xa53a('0x31')],qs[_0xa53a('0x37')](_0x27decf[_0xa53a('0x32')]['fields']));_0x208d92[_0xa53a('0x35')]=_0x208d92['attributes'][_0xa53a('0x38')]?_0x208d92[_0xa53a('0x35')]:_0x324446[_0xa53a('0x31')];if(!_0x27decf[_0xa53a('0x32')][_0xa53a('0x39')]('nolimit')){_0x208d92[_0xa53a('0x1f')]=qs[_0xa53a('0x1f')](_0x27decf[_0xa53a('0x32')]['limit']);_0x208d92[_0xa53a('0x1c')]=qs[_0xa53a('0x1c')](_0x27decf[_0xa53a('0x32')][_0xa53a('0x1c')]);}_0x208d92[_0xa53a('0x3b')]=qs[_0xa53a('0x3c')](_0x27decf[_0xa53a('0x32')]['sort']);_0x208d92[_0xa53a('0x3e')]=qs['filters'](_[_0xa53a('0x3d')](_0x27decf[_0xa53a('0x32')],_0x324446[_0xa53a('0x34')]));_0x208d92[_0xa53a('0x3e')]['CampaignId']=_0x2a3227['id'];if(_0x27decf[_0xa53a('0x32')][_0xa53a('0x41')]){_0x208d92[_0xa53a('0x3e')]=_['merge'](_0x208d92['where'],{'$or':_['map'](_0x208d92[_0xa53a('0x35')],function(_0x5004e8){var _0x31ec53={};_0x31ec53[_0x5004e8]={'$like':'%'+_0x27decf[_0xa53a('0x32')][_0xa53a('0x41')]+'%'};return _0x31ec53;})});}_0x208d92=_[_0xa53a('0x3f')]({},_0x208d92,_0x27decf[_0xa53a('0x42')]);return db[_0xa53a('0x60')][_0xa53a('0x1e')]({'where':_0x208d92[_0xa53a('0x3e')]})[_0xa53a('0x25')](function(_0x2335ea){_0x916b0a['count']=_0x2335ea;if(_0x27decf['query']['includeAll']){_0x208d92[_0xa53a('0x44')]=[{'all':!![]}];}return db[_0xa53a('0x60')][_0xa53a('0x46')](_0x208d92);})['then'](function(_0x439134){_0x916b0a[_0xa53a('0x47')]=_0x439134;return _0x916b0a;});}})[_0xa53a('0x25')](respondWithFilteredResult(_0xdec0eb,_0x208d92))[_0xa53a('0x48')](handleError(_0xdec0eb,null));};exports[_0xa53a('0x61')]=function(_0x2b1cb2,_0x131375,_0x17eddb){var _0xf317e7={'raw':!![],'where':{}};var _0x1c9cd3={};var _0x454358={'count':0x0,'rows':[]};return db['Campaign'][_0xa53a('0x5c')]({'where':{'id':_0x2b1cb2[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0x131375,null))['then'](function(_0x34c13b){if(_0x34c13b){_0x1c9cd3[_0xa53a('0x31')]=_['keys'](db[_0xa53a('0x62')][_0xa53a('0x4a')]);_0x1c9cd3[_0xa53a('0x32')]=_[_0xa53a('0x33')](_0x2b1cb2[_0xa53a('0x32')]);_0x1c9cd3[_0xa53a('0x34')]=_[_0xa53a('0x36')](_0x1c9cd3['model'],_0x1c9cd3[_0xa53a('0x32')]);_0xf317e7[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x1c9cd3['model'],qs[_0xa53a('0x37')](_0x2b1cb2['query'][_0xa53a('0x37')]));_0xf317e7['attributes']=_0xf317e7[_0xa53a('0x35')][_0xa53a('0x38')]?_0xf317e7[_0xa53a('0x35')]:_0x1c9cd3[_0xa53a('0x31')];if(!_0x2b1cb2['query'][_0xa53a('0x39')]('nolimit')){_0xf317e7[_0xa53a('0x1f')]=qs['limit'](_0x2b1cb2[_0xa53a('0x32')]['limit']);_0xf317e7[_0xa53a('0x1c')]=qs[_0xa53a('0x1c')](_0x2b1cb2[_0xa53a('0x32')][_0xa53a('0x1c')]);}_0xf317e7[_0xa53a('0x3b')]=qs['sort'](_0x2b1cb2['query'][_0xa53a('0x3c')]);_0xf317e7['where']=qs[_0xa53a('0x34')](_[_0xa53a('0x3d')](_0x2b1cb2[_0xa53a('0x32')],_0x1c9cd3[_0xa53a('0x34')]));_0xf317e7[_0xa53a('0x3e')][_0xa53a('0x5e')]=_0x34c13b['id'];if(_0x2b1cb2['query'][_0xa53a('0x41')]){_0xf317e7[_0xa53a('0x3e')]=_[_0xa53a('0x3f')](_0xf317e7[_0xa53a('0x3e')],{'$or':_[_0xa53a('0x2d')](_0xf317e7['attributes'],function(_0x25e9c9){var _0x4e3b51={};_0x4e3b51[_0x25e9c9]={'$like':'%'+_0x2b1cb2[_0xa53a('0x32')][_0xa53a('0x41')]+'%'};return _0x4e3b51;})});}_0xf317e7=_['merge']({},_0xf317e7,_0x2b1cb2[_0xa53a('0x42')]);return db[_0xa53a('0x62')][_0xa53a('0x1e')]({'where':_0xf317e7[_0xa53a('0x3e')]})[_0xa53a('0x25')](function(_0x447fbb){_0x454358['count']=_0x447fbb;if(_0x2b1cb2[_0xa53a('0x32')][_0xa53a('0x43')]){_0xf317e7[_0xa53a('0x44')]=[{'all':!![]}];}return db[_0xa53a('0x62')]['findAll'](_0xf317e7);})[_0xa53a('0x25')](function(_0x17d295){_0x454358[_0xa53a('0x47')]=_0x17d295;return _0x454358;});}})[_0xa53a('0x25')](respondWithFilteredResult(_0x131375,_0xf317e7))['catch'](handleError(_0x131375,null));};exports[_0xa53a('0x63')]=function(_0x10fa08,_0x2de2e8,_0x16c3f4){var _0x3e0ce2={'raw':!![],'where':{}};var _0x941bad={};var _0x20871b={'count':0x0,'rows':[]};return db[_0xa53a('0x45')][_0xa53a('0x5c')]({'where':{'id':_0x10fa08[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0x2de2e8,null))[_0xa53a('0x25')](function(_0x3151bb){if(_0x3151bb){_0x941bad[_0xa53a('0x31')]=_[_0xa53a('0x33')](db[_0xa53a('0x64')][_0xa53a('0x4a')]);_0x941bad[_0xa53a('0x32')]=_[_0xa53a('0x33')](_0x10fa08[_0xa53a('0x32')]);_0x941bad[_0xa53a('0x34')]=_[_0xa53a('0x36')](_0x941bad[_0xa53a('0x31')],_0x941bad[_0xa53a('0x32')]);_0x3e0ce2[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x941bad[_0xa53a('0x31')],qs[_0xa53a('0x37')](_0x10fa08['query']['fields']));_0x3e0ce2[_0xa53a('0x35')]=_0x3e0ce2['attributes'][_0xa53a('0x38')]?_0x3e0ce2['attributes']:_0x941bad[_0xa53a('0x31')];if(!_0x10fa08[_0xa53a('0x32')]['hasOwnProperty']('nolimit')){_0x3e0ce2[_0xa53a('0x1f')]=qs[_0xa53a('0x1f')](_0x10fa08['query'][_0xa53a('0x1f')]);_0x3e0ce2[_0xa53a('0x1c')]=qs['offset'](_0x10fa08[_0xa53a('0x32')][_0xa53a('0x1c')]);}_0x3e0ce2['order']=qs[_0xa53a('0x3c')](_0x10fa08[_0xa53a('0x32')]['sort']);_0x3e0ce2[_0xa53a('0x3e')]=qs[_0xa53a('0x34')](_['pick'](_0x10fa08[_0xa53a('0x32')],_0x941bad[_0xa53a('0x34')]));_0x3e0ce2['where'][_0xa53a('0x5e')]=_0x3151bb['id'];if(_0x10fa08[_0xa53a('0x32')]['filter']){_0x3e0ce2[_0xa53a('0x3e')]=_[_0xa53a('0x3f')](_0x3e0ce2[_0xa53a('0x3e')],{'$or':_[_0xa53a('0x2d')](_0x3e0ce2[_0xa53a('0x35')],function(_0x32eebf){var _0x4911eb={};_0x4911eb[_0x32eebf]={'$like':'%'+_0x10fa08[_0xa53a('0x32')][_0xa53a('0x41')]+'%'};return _0x4911eb;})});}_0x3e0ce2=_[_0xa53a('0x3f')]({},_0x3e0ce2,_0x10fa08[_0xa53a('0x42')]);return db[_0xa53a('0x64')]['count']({'where':_0x3e0ce2[_0xa53a('0x3e')]})['then'](function(_0x34e770){_0x20871b['count']=_0x34e770;if(_0x10fa08[_0xa53a('0x32')][_0xa53a('0x43')]){_0x3e0ce2[_0xa53a('0x44')]=[{'all':!![]}];}return db[_0xa53a('0x64')][_0xa53a('0x46')](_0x3e0ce2);})[_0xa53a('0x25')](function(_0x443530){_0x20871b[_0xa53a('0x47')]=_0x443530;return _0x20871b;});}})[_0xa53a('0x25')](respondWithFilteredResult(_0x2de2e8,_0x3e0ce2))[_0xa53a('0x48')](handleError(_0x2de2e8,null));};exports[_0xa53a('0x65')]=function(_0x588aaa,_0x211888,_0x1a41f2){var _0x17ba41={};var _0x192edf={};var _0x5727ed;var _0x21ca42;return db[_0xa53a('0x45')]['findOne']({'where':{'id':_0x588aaa[_0xa53a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x211888,null))[_0xa53a('0x25')](function(_0x279a2a){if(_0x279a2a){_0x5727ed=_0x279a2a;_0x192edf[_0xa53a('0x31')]=_[_0xa53a('0x33')](db[_0xa53a('0x66')]['rawAttributes']);_0x192edf[_0xa53a('0x32')]=_[_0xa53a('0x33')](_0x588aaa[_0xa53a('0x32')]);_0x192edf[_0xa53a('0x34')]=_[_0xa53a('0x36')](_0x192edf[_0xa53a('0x31')],_0x192edf['query']);_0x17ba41[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x192edf[_0xa53a('0x31')],qs['fields'](_0x588aaa[_0xa53a('0x32')][_0xa53a('0x37')]));_0x17ba41[_0xa53a('0x35')]=_0x17ba41[_0xa53a('0x35')][_0xa53a('0x38')]?_0x17ba41[_0xa53a('0x35')]:_0x192edf[_0xa53a('0x31')];_0x17ba41[_0xa53a('0x3b')]=qs[_0xa53a('0x3c')](_0x588aaa[_0xa53a('0x32')][_0xa53a('0x3c')]);_0x17ba41[_0xa53a('0x3e')]=qs[_0xa53a('0x34')](_[_0xa53a('0x3d')](_0x588aaa['query'],_0x192edf[_0xa53a('0x34')]));if(_0x588aaa[_0xa53a('0x32')][_0xa53a('0x41')]){_0x17ba41[_0xa53a('0x3e')]=_[_0xa53a('0x3f')](_0x17ba41[_0xa53a('0x3e')],{'$or':_['map'](_0x17ba41[_0xa53a('0x35')],function(_0x20a11d){var _0x1a02a0={};_0x1a02a0[_0x20a11d]={'$like':'%'+_0x588aaa[_0xa53a('0x32')][_0xa53a('0x41')]+'%'};return _0x1a02a0;})});}_0x17ba41=_[_0xa53a('0x3f')]({},_0x17ba41,_0x588aaa[_0xa53a('0x42')]);return _0x5727ed[_0xa53a('0x65')](_0x17ba41);}})[_0xa53a('0x25')](function(_0x35d9dc){if(_0x35d9dc){_0x21ca42=_0x35d9dc[_0xa53a('0x38')];if(!_0x588aaa[_0xa53a('0x32')][_0xa53a('0x39')](_0xa53a('0x3a'))){_0x17ba41[_0xa53a('0x1f')]=qs[_0xa53a('0x1f')](_0x588aaa['query'][_0xa53a('0x1f')]);_0x17ba41['offset']=qs['offset'](_0x588aaa[_0xa53a('0x32')]['offset']);}return _0x5727ed['getLists'](_0x17ba41);}})[_0xa53a('0x25')](function(_0x2e02ca){if(_0x2e02ca){return _0x2e02ca?{'count':_0x21ca42,'rows':_0x2e02ca}:null;}})[_0xa53a('0x25')](respondWithResult(_0x211888,null))['catch'](handleError(_0x211888,null));};exports[_0xa53a('0x67')]=function(_0x51754e,_0x9f05cb,_0x15e837){var _0x132533,_0xadb0af;var _0x3bcca7=[];var _0x1218e7=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0xa53a('0x45')]['find']({'where':{'id':_0x51754e[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0x9f05cb,null))['then'](function(_0x3c238e){if(_0x3c238e){_0xadb0af=_0x3c238e;return _0x3c238e[_0xa53a('0x67')](_0x51754e[_0xa53a('0x4d')]['ids'],_['omit'](_0x51754e[_0xa53a('0x4d')],[_0xa53a('0x68'),'id'])||{});}return null;})[_0xa53a('0x69')](function(_0x24d470){var _0x406f0c;var _0x10685e;_0x132533=_0x24d470||[];var _0x2254d3=[];if(_0x24d470){for(var _0x582064=0x0;_0x582064<_0x24d470[_0xa53a('0x38')];_0x582064+=0x1){var _0x131d06=_0x24d470[_0x582064][_0xa53a('0x26')]({'plain':!![]});_0xadb0af[_0xa53a('0x6a')]=_0x51754e[_0xa53a('0x4d')][_0xa53a('0x6a')]?_0x51754e[_0xa53a('0x4d')][_0xa53a('0x6a')]:_0xadb0af[_0xa53a('0x6a')];switch(_0xadb0af[_0xa53a('0x6a')]){case _0xa53a('0x6b'):_0x406f0c=squel['insert']()[_0xa53a('0x6c')]('cm_hopper')[_0xa53a('0x6d')](['phone',_0xa53a('0x6e'),_0xa53a('0x6f'),_0xa53a('0x70'),_0xa53a('0x5e'),_0xa53a('0x58'),_0xa53a('0x59')],squel[_0xa53a('0x71')]()[_0xa53a('0x72')]('phone','phone')[_0xa53a('0x72')](_0xa53a('0x73'),_0xa53a('0x6e'))['field']('id','ContactId')['field'](_0x131d06[_0xa53a('0x74')][_0xa53a('0x75')](),_0xa53a('0x70'))[_0xa53a('0x72')](_0x51754e[_0xa53a('0x5a')]['id'][_0xa53a('0x75')](),_0xa53a('0x5e'))['field']('\x27'+_0x1218e7+'\x27','createdAt')[_0xa53a('0x72')]('\x27'+_0x1218e7+'\x27','updatedAt')[_0xa53a('0x76')](_0xa53a('0x77'))['where']('deletedAt\x20IS\x20NULL')[_0xa53a('0x3e')]('ListId\x20=\x20?',_0x131d06['CmListId'][_0xa53a('0x75')]())[_0xa53a('0x3e')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xa53a('0x71')]()[_0xa53a('0x72')]('COALESCE(calleridnum,\x27\x27)')[_0xa53a('0x76')](_0xa53a('0x78'))[_0xa53a('0x3e')](_0xa53a('0x79'),_0x51754e[_0xa53a('0x5a')]['id'][_0xa53a('0x75')]()))['where'](_0xa53a('0x7a'),squel[_0xa53a('0x71')]()[_0xa53a('0x72')](_0xa53a('0x7b'))[_0xa53a('0x76')]('cm_hopper')[_0xa53a('0x3e')](_0xa53a('0x79'),_0x51754e[_0xa53a('0x5a')]['id'][_0xa53a('0x75')]())))[_0xa53a('0x75')]();break;case _0xa53a('0x7c'):_0x406f0c=squel['insert']()[_0xa53a('0x6c')]('cm_hopper')[_0xa53a('0x6d')]([_0xa53a('0x7d'),_0xa53a('0x6e'),_0xa53a('0x6f'),_0xa53a('0x70'),_0xa53a('0x5e'),_0xa53a('0x58'),_0xa53a('0x59')],squel[_0xa53a('0x71')]()['field'](_0xa53a('0x7d'),'phone')[_0xa53a('0x72')](_0xa53a('0x73'),'scheduledAt')['field']('id',_0xa53a('0x6f'))['field'](_0x131d06[_0xa53a('0x74')][_0xa53a('0x75')](),'ListId')['field'](_0x51754e[_0xa53a('0x5a')]['id'][_0xa53a('0x75')](),_0xa53a('0x5e'))[_0xa53a('0x72')]('\x27'+_0x1218e7+'\x27','createdAt')[_0xa53a('0x72')]('\x27'+_0x1218e7+'\x27',_0xa53a('0x59'))[_0xa53a('0x76')]('cm_contacts')[_0xa53a('0x3e')](_0xa53a('0x7e'))[_0xa53a('0x3e')](_0xa53a('0x7f'),_0x131d06[_0xa53a('0x74')][_0xa53a('0x75')]())[_0xa53a('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0xa53a('0x3e')](_0xa53a('0x7a'),squel[_0xa53a('0x71')]()['field'](_0xa53a('0x7b'))[_0xa53a('0x76')](_0xa53a('0x80'))['where'](_0xa53a('0x79'),_0x51754e['params']['id']['toString']())))[_0xa53a('0x75')]();break;default:_0x406f0c=squel[_0xa53a('0x81')]()[_0xa53a('0x6c')](_0xa53a('0x80'))[_0xa53a('0x6d')]([_0xa53a('0x7d'),_0xa53a('0x6e'),'ContactId','ListId',_0xa53a('0x5e'),'createdAt',_0xa53a('0x59')],squel['select']()[_0xa53a('0x72')]('phone',_0xa53a('0x7d'))[_0xa53a('0x72')](_0xa53a('0x73'),'scheduledAt')['field']('id',_0xa53a('0x6f'))[_0xa53a('0x72')](_0x131d06[_0xa53a('0x74')][_0xa53a('0x75')](),_0xa53a('0x70'))['field'](_0x51754e[_0xa53a('0x5a')]['id'][_0xa53a('0x75')](),_0xa53a('0x5e'))['field']('\x27'+_0x1218e7+'\x27',_0xa53a('0x58'))['field']('\x27'+_0x1218e7+'\x27',_0xa53a('0x59'))[_0xa53a('0x76')](_0xa53a('0x77'))[_0xa53a('0x3e')](_0xa53a('0x7e'))[_0xa53a('0x3e')](_0xa53a('0x7f'),_0x131d06[_0xa53a('0x74')]['toString']())[_0xa53a('0x3e')]('phone\x20IS\x20NOT\x20NULL'))[_0xa53a('0x75')]();}_0x10685e=squel[_0xa53a('0x81')]()['into'](_0xa53a('0x82'))[_0xa53a('0x6d')]([_0xa53a('0x83'),_0xa53a('0x6e'),'phone','OrderBy',_0xa53a('0x58'),'updatedAt'],squel[_0xa53a('0x71')]()[_0xa53a('0x72')]('h.id','id')[_0xa53a('0x72')](_0xa53a('0x73'),_0xa53a('0x6e'))[_0xa53a('0x72')]('ci.item',_0xa53a('0x7d'))[_0xa53a('0x72')](_0xa53a('0x84'),_0xa53a('0x85'))[_0xa53a('0x72')]('\x27'+_0x1218e7+'\x27',_0xa53a('0x58'))['field']('\x27'+_0x1218e7+'\x27',_0xa53a('0x59'))[_0xa53a('0x76')]('cm_contact_has_items','ci')['join'](_0xa53a('0x80'),'h',_0xa53a('0x86'))['where'](_0xa53a('0x87'),_0x131d06[_0xa53a('0x74')]['toString']())['where'](_0xa53a('0x88'),_0x51754e[_0xa53a('0x5a')]['id'][_0xa53a('0x75')]())[_0xa53a('0x3e')](_0xa53a('0x89'),_0x1218e7))[_0xa53a('0x75')]();_0x2254d3[_0xa53a('0x8a')](db[_0xa53a('0x8b')][_0xa53a('0x32')](_0x406f0c));_0x3bcca7[_0xa53a('0x8a')](db['sequelize'][_0xa53a('0x32')](_0x10685e));}return BPromise[_0xa53a('0x8c')](_0x2254d3);}})[_0xa53a('0x25')](function(){return BPromise[_0xa53a('0x8c')](_0x3bcca7);})['then'](function(){return _0x132533;})[_0xa53a('0x25')](respondWithResult(_0x9f05cb,null))[_0xa53a('0x48')](handleError(_0x9f05cb,null));};exports['removeLists']=function(_0x19f146,_0x48569e,_0x1f1790){return db['Campaign'][_0xa53a('0x4b')]({'where':{'id':_0x19f146[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0x48569e,null))['then'](function(_0x3d0a22){if(_0x3d0a22){return _0x3d0a22[_0xa53a('0x8d')](_0x19f146[_0xa53a('0x32')]['ids']);}})[_0xa53a('0x25')](function(_0x456fdc){if(_0x456fdc){return db['CmHopper'][_0xa53a('0x29')]({'where':{'ListId':_0x19f146[_0xa53a('0x32')]['ids'],'CampaignId':_0x19f146[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](function(){return _0x456fdc;});}})[_0xa53a('0x25')](respondWithStatusCode(_0x48569e,null))[_0xa53a('0x48')](handleError(_0x48569e,null));};exports[_0xa53a('0x8e')]=function(_0x3cb79d,_0x226e59,_0x24dc87){var _0x15a860={};var _0x208e72={};var _0x2b5c2d;var _0x1aa738;return db[_0xa53a('0x45')][_0xa53a('0x5c')]({'where':{'id':_0x3cb79d[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0x226e59,null))[_0xa53a('0x25')](function(_0x250e29){if(_0x250e29){_0x2b5c2d=_0x250e29;_0x208e72['model']=_[_0xa53a('0x33')](db[_0xa53a('0x66')]['rawAttributes']);_0x208e72['query']=_[_0xa53a('0x33')](_0x3cb79d[_0xa53a('0x32')]);_0x208e72[_0xa53a('0x34')]=_[_0xa53a('0x36')](_0x208e72['model'],_0x208e72[_0xa53a('0x32')]);_0x15a860[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x208e72[_0xa53a('0x31')],qs[_0xa53a('0x37')](_0x3cb79d[_0xa53a('0x32')]['fields']));_0x15a860[_0xa53a('0x35')]=_0x15a860[_0xa53a('0x35')][_0xa53a('0x38')]?_0x15a860[_0xa53a('0x35')]:_0x208e72[_0xa53a('0x31')];_0x15a860[_0xa53a('0x3b')]=qs['sort'](_0x3cb79d['query']['sort']);_0x15a860[_0xa53a('0x3e')]=qs[_0xa53a('0x34')](_['pick'](_0x3cb79d['query'],_0x208e72[_0xa53a('0x34')]));if(_0x3cb79d[_0xa53a('0x32')][_0xa53a('0x41')]){_0x15a860[_0xa53a('0x3e')]=_[_0xa53a('0x3f')](_0x15a860[_0xa53a('0x3e')],{'$or':_[_0xa53a('0x2d')](_0x15a860[_0xa53a('0x35')],function(_0x1d007d){var _0x25b669={};_0x25b669[_0x1d007d]={'$like':'%'+_0x3cb79d['query'][_0xa53a('0x41')]+'%'};return _0x25b669;})});}_0x15a860=_[_0xa53a('0x3f')]({},_0x15a860,_0x3cb79d[_0xa53a('0x42')]);return _0x2b5c2d['getBlackLists'](_0x15a860);}})['then'](function(_0x16bf8b){if(_0x16bf8b){_0x1aa738=_0x16bf8b[_0xa53a('0x38')];if(!_0x3cb79d['query']['hasOwnProperty'](_0xa53a('0x3a'))){_0x15a860['limit']=qs[_0xa53a('0x1f')](_0x3cb79d['query'][_0xa53a('0x1f')]);_0x15a860[_0xa53a('0x1c')]=qs[_0xa53a('0x1c')](_0x3cb79d[_0xa53a('0x32')]['offset']);}return _0x2b5c2d['getBlackLists'](_0x15a860);}})[_0xa53a('0x25')](function(_0x5d7e51){if(_0x5d7e51){return _0x5d7e51?{'count':_0x1aa738,'rows':_0x5d7e51}:null;}})[_0xa53a('0x25')](respondWithResult(_0x226e59,null))[_0xa53a('0x48')](handleError(_0x226e59,null));};exports[_0xa53a('0x8f')]=function(_0x367414,_0x2d7f1c,_0x50ee18){var _0x1bef52,_0x2d6cdd;var _0x457ebb=[];var _0x5c61c5=moment()[_0xa53a('0x90')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xa53a('0x45')]['find']({'where':{'id':_0x367414[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0x2d7f1c,null))[_0xa53a('0x25')](function(_0x5ee541){if(_0x5ee541){_0x2d6cdd=_0x5ee541;return _0x5ee541[_0xa53a('0x8f')](_0x367414[_0xa53a('0x4d')][_0xa53a('0x68')],_[_0xa53a('0x57')](_0x367414[_0xa53a('0x4d')],['ids','id'])||{});}return null;})[_0xa53a('0x69')](function(_0x340371){var _0x4d63de;var _0x599b17;_0x1bef52=_0x340371||[];var _0x4142f5=[];if(_0x340371){for(var _0x28dbf4=0x0;_0x28dbf4<_0x340371['length'];_0x28dbf4+=0x1){var _0x29a129=_0x340371[_0x28dbf4][_0xa53a('0x26')]({'plain':!![]});_0x4d63de=squel['insert']()[_0xa53a('0x6c')](_0xa53a('0x91'))[_0xa53a('0x6d')]([_0xa53a('0x7d'),_0xa53a('0x6f'),_0xa53a('0x70'),_0xa53a('0x5e'),_0xa53a('0x58'),_0xa53a('0x59')],squel['select']()[_0xa53a('0x72')]('phone',_0xa53a('0x7d'))[_0xa53a('0x72')]('id','ContactId')[_0xa53a('0x72')](_0x29a129[_0xa53a('0x74')][_0xa53a('0x75')](),_0xa53a('0x70'))[_0xa53a('0x72')](_0x367414[_0xa53a('0x5a')]['id']['toString'](),_0xa53a('0x5e'))[_0xa53a('0x72')](_0xa53a('0x73'),'createdAt')['field']('NOW()','updatedAt')[_0xa53a('0x76')](_0xa53a('0x77'))['where'](_0xa53a('0x7e'))[_0xa53a('0x3e')](_0xa53a('0x7f'),_0x29a129[_0xa53a('0x74')][_0xa53a('0x75')]())[_0xa53a('0x3e')](_0xa53a('0x92')))[_0xa53a('0x75')]();_0x4142f5['push'](db[_0xa53a('0x8b')][_0xa53a('0x32')](_0x4d63de));}return BPromise[_0xa53a('0x8c')](_0x4142f5);}})['then'](function(){return _0x1bef52;})[_0xa53a('0x25')](respondWithResult(_0x2d7f1c,null))[_0xa53a('0x48')](handleError(_0x2d7f1c,null));};exports['removeBlackLists']=function(_0x1732fd,_0xb0a044,_0x4d3e55){return db[_0xa53a('0x45')][_0xa53a('0x4b')]({'where':{'id':_0x1732fd[_0xa53a('0x5a')]['id']}})['then'](handleEntityNotFound(_0xb0a044,null))[_0xa53a('0x25')](function(_0x48f3c8){if(_0x48f3c8){return _0x48f3c8[_0xa53a('0x93')](_0x1732fd[_0xa53a('0x32')][_0xa53a('0x68')]);}})[_0xa53a('0x25')](function(_0x536871){if(_0x536871){return db[_0xa53a('0x64')]['destroy']({'where':{'ListId':_0x1732fd[_0xa53a('0x32')]['ids'],'CampaignId':_0x1732fd[_0xa53a('0x5a')]['id']}})['then'](function(){return _0x536871;});}})[_0xa53a('0x25')](respondWithStatusCode(_0xb0a044,null))[_0xa53a('0x48')](handleError(_0xb0a044,null));};
\ No newline at end of file
index 13c5119..21df338 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x1bc2d6,_0x1257d3){var _0x559744=function(_0x537bad){while(--_0x537bad){_0x1bc2d6['push'](_0x1bc2d6['shift']());}};_0x559744(++_0x1257d3);}(_0x7a54,0x106));var _0x47a5=function(_0x3fda4c,_0x58f389){_0x3fda4c=_0x3fda4c-0x0;var _0x362dc5=_0x7a54[_0x3fda4c];return _0x362dc5;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 d6ea42f..9f25fcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x295f=['where','attributes','limit','include','map','model','GetCampaign','catch','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','findAll','options'];(function(_0x2b93a5,_0x31934c){var _0x4111dc=function(_0x3d4f71){while(--_0x3d4f71){_0x2b93a5['push'](_0x2b93a5['shift']());}};_0x4111dc(++_0x31934c);}(_0x295f,0x168));var _0xf295=function(_0x459f65,_0x23bf86){_0x459f65=_0x459f65-0x0;var _0x1286c6=_0x295f[_0x459f65];return _0x1286c6;};'use strict';var _=require('lodash');var util=require(_0xf295('0x0'));var moment=require(_0xf295('0x1'));var BPromise=require(_0xf295('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf295('0x3'));var db=require(_0xf295('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf295('0x5'));var config=require(_0xf295('0x6'));var jayson=require(_0xf295('0x7'));var client=jayson[_0xf295('0x8')][_0xf295('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50a890,_0x2b302f,_0x44e292){return new BPromise(function(_0x1f3320,_0x4041d5){return client[_0xf295('0xa')](_0x50a890,_0x44e292)[_0xf295('0xb')](function(_0xaf1853){logger[_0xf295('0xc')](_0xf295('0xd'),_0x2b302f,_0xf295('0xe'));logger[_0xf295('0xf')](_0xf295('0x10'),_0x2b302f,'request\x20sent',JSON[_0xf295('0x11')](_0xaf1853));if(_0xaf1853[_0xf295('0x12')]){if(_0xaf1853['error'][_0xf295('0x13')]===0x1f4){logger[_0xf295('0x12')](_0xf295('0xd'),_0x2b302f,_0xaf1853[_0xf295('0x12')][_0xf295('0x14')]);return _0x4041d5(_0xaf1853[_0xf295('0x12')][_0xf295('0x14')]);}logger[_0xf295('0x12')](_0xf295('0xd'),_0x2b302f,_0xaf1853[_0xf295('0x12')][_0xf295('0x14')]);return _0x1f3320(_0xaf1853[_0xf295('0x12')][_0xf295('0x14')]);}else{logger[_0xf295('0xc')](_0xf295('0xd'),_0x2b302f,_0xf295('0xe'));_0x1f3320(_0xaf1853[_0xf295('0x15')][_0xf295('0x14')]);}})['catch'](function(_0x57e1bc){logger[_0xf295('0x12')](_0xf295('0xd'),_0x2b302f,_0x57e1bc);_0x4041d5(_0x57e1bc);});});}exports['GetCampaign']=function(_0x3e0a44){var _0x5d18e1=this;return new Promise(function(_0x30ad22,_0x4deacb){return db['Campaign'][_0xf295('0x16')]({'raw':_0x3e0a44[_0xf295('0x17')]?_0x3e0a44['options']['raw']===undefined?!![]:![]:!![],'where':_0x3e0a44[_0xf295('0x17')]?_0x3e0a44[_0xf295('0x17')][_0xf295('0x18')]||null:null,'attributes':_0x3e0a44[_0xf295('0x17')]?_0x3e0a44[_0xf295('0x17')][_0xf295('0x19')]||null:null,'limit':_0x3e0a44['options']?_0x3e0a44['options'][_0xf295('0x1a')]||null:null,'include':_0x3e0a44['options']?_0x3e0a44[_0xf295('0x17')][_0xf295('0x1b')]?_[_0xf295('0x1c')](_0x3e0a44['options'][_0xf295('0x1b')],function(_0x2e079e){return{'model':db[_0x2e079e['model']],'as':_0x2e079e['as'],'attributes':_0x2e079e[_0xf295('0x19')],'include':_0x2e079e[_0xf295('0x1b')]?_[_0xf295('0x1c')](_0x2e079e[_0xf295('0x1b')],function(_0x111449){return{'model':db[_0x111449['model']],'as':_0x111449['as'],'attributes':_0x111449[_0xf295('0x19')],'include':_0x111449[_0xf295('0x1b')]?_['map'](_0x111449['include'],function(_0x1ba1dd){return{'model':db[_0x1ba1dd[_0xf295('0x1d')]],'as':_0x1ba1dd['as'],'attributes':_0x1ba1dd[_0xf295('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf295('0xb')](function(_0x2f3f73){logger[_0xf295('0xc')](_0xf295('0x1e'),_0x3e0a44);logger[_0xf295('0xf')](_0xf295('0x1e'),_0x3e0a44,JSON['stringify'](_0x2f3f73));_0x30ad22(_0x2f3f73);})[_0xf295('0x1f')](function(_0x19ec3a){logger[_0xf295('0x12')](_0xf295('0x1e'),_0x19ec3a[_0xf295('0x14')],_0x3e0a44);_0x4deacb(_0x5d18e1[_0xf295('0x12')](0x1f4,_0x19ec3a['message']));});});};
\ No newline at end of file
+var _0x2821=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit','map','include','model','then','lodash','util','moment','bluebird','randomstring'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x2821,0x87));var _0x1282=function(_0x553638,_0x3ffb99){_0x553638=_0x553638-0x0;var _0x2d3710=_0x2821[_0x553638];return _0x2d3710;};'use strict';var _=require(_0x1282('0x0'));var util=require(_0x1282('0x1'));var moment=require(_0x1282('0x2'));var BPromise=require(_0x1282('0x3'));var rs=require(_0x1282('0x4'));var fs=require('fs');var Redis=require(_0x1282('0x5'));var db=require(_0x1282('0x6'))['db'];var utils=require(_0x1282('0x7'));var logger=require(_0x1282('0x8'))(_0x1282('0x9'));var config=require(_0x1282('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x1282('0xb')][_0x1282('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x293947,_0x13beb5,_0xa4eee9){return new BPromise(function(_0x1a8666,_0x18d69a){return client[_0x1282('0xd')](_0x293947,_0xa4eee9)['then'](function(_0x41c458){logger[_0x1282('0xe')](_0x1282('0xf'),_0x13beb5,_0x1282('0x10'));logger[_0x1282('0x11')]('Campaign,\x20%s,\x20%s,\x20%s',_0x13beb5,_0x1282('0x10'),JSON[_0x1282('0x12')](_0x41c458));if(_0x41c458['error']){if(_0x41c458[_0x1282('0x13')][_0x1282('0x14')]===0x1f4){logger['error'](_0x1282('0xf'),_0x13beb5,_0x41c458['error']['message']);return _0x18d69a(_0x41c458[_0x1282('0x13')][_0x1282('0x15')]);}logger[_0x1282('0x13')](_0x1282('0xf'),_0x13beb5,_0x41c458['error']['message']);return _0x1a8666(_0x41c458['error'][_0x1282('0x15')]);}else{logger[_0x1282('0xe')](_0x1282('0xf'),_0x13beb5,_0x1282('0x10'));_0x1a8666(_0x41c458[_0x1282('0x16')][_0x1282('0x15')]);}})[_0x1282('0x17')](function(_0x116ef1){logger['error'](_0x1282('0xf'),_0x13beb5,_0x116ef1);_0x18d69a(_0x116ef1);});});}exports[_0x1282('0x18')]=function(_0x518733){var _0x48c857=this;return new Promise(function(_0xebc97e,_0x4e3ec7){return db[_0x1282('0x19')][_0x1282('0x1a')]({'raw':_0x518733['options']?_0x518733['options']['raw']===undefined?!![]:![]:!![],'where':_0x518733['options']?_0x518733[_0x1282('0x1b')][_0x1282('0x1c')]||null:null,'attributes':_0x518733[_0x1282('0x1b')]?_0x518733[_0x1282('0x1b')][_0x1282('0x1d')]||null:null,'limit':_0x518733[_0x1282('0x1b')]?_0x518733[_0x1282('0x1b')][_0x1282('0x1e')]||null:null,'include':_0x518733[_0x1282('0x1b')]?_0x518733[_0x1282('0x1b')]['include']?_[_0x1282('0x1f')](_0x518733['options'][_0x1282('0x20')],function(_0x25dbb5){return{'model':db[_0x25dbb5[_0x1282('0x21')]],'as':_0x25dbb5['as'],'attributes':_0x25dbb5[_0x1282('0x1d')],'include':_0x25dbb5[_0x1282('0x20')]?_['map'](_0x25dbb5[_0x1282('0x20')],function(_0x117e5c){return{'model':db[_0x117e5c[_0x1282('0x21')]],'as':_0x117e5c['as'],'attributes':_0x117e5c[_0x1282('0x1d')],'include':_0x117e5c[_0x1282('0x20')]?_[_0x1282('0x1f')](_0x117e5c[_0x1282('0x20')],function(_0x28e686){return{'model':db[_0x28e686['model']],'as':_0x28e686['as'],'attributes':_0x28e686['attributes']};}):[]};}):[]};}):[]:[]})[_0x1282('0x22')](function(_0x5d97b4){logger[_0x1282('0xe')]('GetCampaign',_0x518733);logger[_0x1282('0x11')]('GetCampaign',_0x518733,JSON[_0x1282('0x12')](_0x5d97b4));_0xebc97e(_0x5d97b4);})['catch'](function(_0x519a7f){logger['error']('GetCampaign',_0x519a7f['message'],_0x518733);_0x4e3ec7(_0x48c857['error'](0x1f4,_0x519a7f[_0x1282('0x15')]));});});};
\ No newline at end of file
index c40635a..1301778 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3f3=['addLists','addBlackLists','put','destroy','removeLists','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','show','get','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone'];(function(_0xf0c8bd,_0x226453){var _0x38aac2=function(_0x2d5f2d){while(--_0x2d5f2d){_0xf0c8bd['push'](_0xf0c8bd['shift']());}};_0x38aac2(++_0x226453);}(_0xe3f3,0xed));var _0x3e3f=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xe3f3[_0x4792c8];return _0x35edb1;};'use strict';var multer=require(_0x3e3f('0x0'));var util=require(_0x3e3f('0x1'));var path=require(_0x3e3f('0x2'));var timeout=require(_0x3e3f('0x3'));var express=require(_0x3e3f('0x4'));var router=express['Router']();var fs_extra=require(_0x3e3f('0x5'));var auth=require(_0x3e3f('0x6'));var interaction=require(_0x3e3f('0x7'));var config=require(_0x3e3f('0x8'));var controller=require('./campaign.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x3e3f('0x9')]);router['get'](_0x3e3f('0xa'),auth[_0x3e3f('0xb')](),controller[_0x3e3f('0xc')]);router[_0x3e3f('0xd')](_0x3e3f('0xe'),auth['isAuthenticated'](),controller[_0x3e3f('0xf')]);router[_0x3e3f('0xd')](_0x3e3f('0x10'),auth[_0x3e3f('0xb')](),controller[_0x3e3f('0x11')]);router[_0x3e3f('0xd')]('/:id/hopper_finals',auth[_0x3e3f('0xb')](),controller[_0x3e3f('0x12')]);router['get']('/:id/hopper_black',auth[_0x3e3f('0xb')](),controller[_0x3e3f('0x13')]);router[_0x3e3f('0xd')](_0x3e3f('0x14'),auth['isAuthenticated'](),controller['getLists']);router['get'](_0x3e3f('0x15'),auth[_0x3e3f('0xb')](),controller[_0x3e3f('0x16')]);router[_0x3e3f('0x17')]('/',auth[_0x3e3f('0xb')](),controller[_0x3e3f('0x18')]);router[_0x3e3f('0x17')](_0x3e3f('0x19'),auth[_0x3e3f('0xb')](),controller[_0x3e3f('0x1a')]);router[_0x3e3f('0x17')]('/:id/lists',auth[_0x3e3f('0xb')](),controller[_0x3e3f('0x1b')]);router['post'](_0x3e3f('0x15'),auth['isAuthenticated'](),controller[_0x3e3f('0x1c')]);router[_0x3e3f('0x1d')]('/:id',auth[_0x3e3f('0xb')](),controller['update']);router['delete'](_0x3e3f('0xa'),auth['isAuthenticated'](),controller[_0x3e3f('0x1e')]);router['delete']('/:id/lists',auth['isAuthenticated'](),controller[_0x3e3f('0x1f')]);router[_0x3e3f('0x20')](_0x3e3f('0x15'),auth['isAuthenticated'](),controller['removeBlackLists']);module['exports']=router;
\ No newline at end of file
+var _0x9946=['addLists','addBlackLists','destroy','delete','removeBlackLists','exports','multer','util','path','express','Router','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone'];(function(_0x42ddb9,_0x2b7ecd){var _0x25f162=function(_0x385534){while(--_0x385534){_0x42ddb9['push'](_0x42ddb9['shift']());}};_0x25f162(++_0x2b7ecd);}(_0x9946,0x82));var _0x6994=function(_0x157eb6,_0x39d9c0){_0x157eb6=_0x157eb6-0x0;var _0x5da78c=_0x9946[_0x157eb6];return _0x5da78c;};'use strict';var multer=require(_0x6994('0x0'));var util=require(_0x6994('0x1'));var path=require(_0x6994('0x2'));var timeout=require('connect-timeout');var express=require(_0x6994('0x3'));var router=express[_0x6994('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6994('0x5'));var controller=require(_0x6994('0x6'));router['get']('/',auth[_0x6994('0x7')](),controller[_0x6994('0x8')]);router[_0x6994('0x9')](_0x6994('0xa'),auth[_0x6994('0x7')](),controller[_0x6994('0xb')]);router[_0x6994('0x9')](_0x6994('0xc'),auth[_0x6994('0x7')](),controller['getHoppers']);router[_0x6994('0x9')](_0x6994('0xd'),auth[_0x6994('0x7')](),controller[_0x6994('0xe')]);router[_0x6994('0x9')]('/:id/hopper_finals',auth[_0x6994('0x7')](),controller[_0x6994('0xf')]);router[_0x6994('0x9')](_0x6994('0x10'),auth[_0x6994('0x7')](),controller[_0x6994('0x11')]);router[_0x6994('0x9')](_0x6994('0x12'),auth[_0x6994('0x7')](),controller[_0x6994('0x13')]);router[_0x6994('0x9')](_0x6994('0x14'),auth[_0x6994('0x7')](),controller[_0x6994('0x15')]);router[_0x6994('0x16')]('/',auth[_0x6994('0x7')](),controller[_0x6994('0x17')]);router[_0x6994('0x16')](_0x6994('0x18'),auth[_0x6994('0x7')](),controller['clone']);router[_0x6994('0x16')](_0x6994('0x12'),auth['isAuthenticated'](),controller[_0x6994('0x19')]);router['post'](_0x6994('0x14'),auth[_0x6994('0x7')](),controller[_0x6994('0x1a')]);router['put']('/:id',auth[_0x6994('0x7')](),controller['update']);router['delete'](_0x6994('0xa'),auth[_0x6994('0x7')](),controller[_0x6994('0x1b')]);router[_0x6994('0x1c')](_0x6994('0x12'),auth[_0x6994('0x7')](),controller['removeLists']);router[_0x6994('0x1c')]('/:id/blacklists',auth[_0x6994('0x7')](),controller[_0x6994('0x1d')]);module[_0x6994('0x1e')]=router;
\ No newline at end of file
index eaea5c9..92c2a36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05b2=['sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue','key'];(function(_0x45f575,_0x3ae51c){var _0xd8e1a1=function(_0x34867b){while(--_0x34867b){_0x45f575['push'](_0x45f575['shift']());}};_0xd8e1a1(++_0x3ae51c);}(_0x05b2,0x1f1));var _0x205b=function(_0x392b57,_0x3aba0d){_0x392b57=_0x392b57-0x0;var _0x19032e=_0x05b2[_0x392b57];return _0x19032e;};'use strict';var Sequelize=require(_0x205b('0x0'));module[_0x205b('0x1')]={'key':{'type':Sequelize[_0x205b('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x205b('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x205b('0x2')]},'name':{'type':Sequelize[_0x205b('0x4')],'get':function(){return this[_0x205b('0x5')](_0x205b('0x6'));}}};
\ No newline at end of file
+var _0xae32=['exports','STRING','TEXT'];(function(_0x42ddec,_0x3cac95){var _0x4939d0=function(_0x236d13){while(--_0x236d13){_0x42ddec['push'](_0x42ddec['shift']());}};_0x4939d0(++_0x3cac95);}(_0xae32,0x114));var _0x2ae3=function(_0x1f63d2,_0x417963){_0x1f63d2=_0x1f63d2-0x0;var _0xe7496c=_0xae32[_0x1f63d2];return _0xe7496c;};'use strict';var Sequelize=require('sequelize');module[_0x2ae3('0x0')]={'key':{'type':Sequelize[_0x2ae3('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x2ae3('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('key');}}};
\ No newline at end of file
index 1023281..67904d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbf7=['where','pick','filter','merge','options','CannedAnswer','includeAll','include','findAll','rows','show','params','body','find','catch','create','MailAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','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','bluebird','mustache','path','sox','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','sendStatus','status','json','offset','limit','undefined','set','Content-Range','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','stack','send','index','map','fieldName','type','key','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort'];(function(_0x3b2148,_0x3eed71){var _0x4dcd51=function(_0x51e79f){while(--_0x51e79f){_0x3b2148['push'](_0x3b2148['shift']());}};_0x4dcd51(++_0x3eed71);}(_0xdbf7,0x12d));var _0x7dbf=function(_0x1c6a3e,_0x5c3938){_0x1c6a3e=_0x1c6a3e-0x0;var _0x3637da=_0xdbf7[_0x1c6a3e];return _0x3637da;};'use strict';var emlformat=require(_0x7dbf('0x0'));var rimraf=require(_0x7dbf('0x1'));var zipdir=require(_0x7dbf('0x2'));var jsonpatch=require(_0x7dbf('0x3'));var rp=require(_0x7dbf('0x4'));var moment=require(_0x7dbf('0x5'));var BPromise=require(_0x7dbf('0x6'));var Mustache=require(_0x7dbf('0x7'));var util=require('util');var path=require(_0x7dbf('0x8'));var sox=require(_0x7dbf('0x9'));var csv=require('to-csv');var ejs=require(_0x7dbf('0xa'));var fs=require('fs');var fs_extra=require(_0x7dbf('0xb'));var _=require(_0x7dbf('0xc'));var squel=require(_0x7dbf('0xd'));var crypto=require(_0x7dbf('0xe'));var jsforce=require(_0x7dbf('0xf'));var deskjs=require(_0x7dbf('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7dbf('0x11'));var Papa=require(_0x7dbf('0x12'));var Redis=require('ioredis');var authService=require(_0x7dbf('0x13'));var qs=require(_0x7dbf('0x14'));var as=require(_0x7dbf('0x15'));var hardwareService=require(_0x7dbf('0x16'));var logger=require(_0x7dbf('0x17'))(_0x7dbf('0x18'));var utils=require(_0x7dbf('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x383565,_0x1cbf0b){_0x1cbf0b=_0x1cbf0b||0xcc;return function(_0x39a0b4){if(_0x39a0b4){return _0x383565[_0x7dbf('0x1a')](_0x1cbf0b);}return _0x383565[_0x7dbf('0x1b')](_0x1cbf0b)['end']();};}function respondWithResult(_0x1a6018,_0x245447){_0x245447=_0x245447||0xc8;return function(_0x42704c){if(_0x42704c){return _0x1a6018['status'](_0x245447)[_0x7dbf('0x1c')](_0x42704c);}};}function respondWithFilteredResult(_0x1085cd,_0xd2bda2){return function(_0xa531b8){if(_0xa531b8){var _0x4002a7=typeof _0xd2bda2[_0x7dbf('0x1d')]==='undefined'&&typeof _0xd2bda2[_0x7dbf('0x1e')]===_0x7dbf('0x1f');var _0x14d4e9=_0xa531b8['count'];var _0x1a822f=_0x4002a7?0x0:_0xd2bda2[_0x7dbf('0x1d')];var _0x1fc42a=_0x4002a7?_0xa531b8['count']:_0xd2bda2[_0x7dbf('0x1d')]+_0xd2bda2[_0x7dbf('0x1e')];var _0x108f6e;if(_0x1fc42a>=_0x14d4e9){_0x1fc42a=_0x14d4e9;_0x108f6e=0xc8;}else{_0x108f6e=0xce;}_0x1085cd[_0x7dbf('0x1b')](_0x108f6e);return _0x1085cd[_0x7dbf('0x20')](_0x7dbf('0x21'),_0x1a822f+'-'+_0x1fc42a+'/'+_0x14d4e9)[_0x7dbf('0x1c')](_0xa531b8);}return null;};}function patchUpdates(_0x58c951){return function(_0x5db709){try{jsonpatch['apply'](_0x5db709,_0x58c951,!![]);}catch(_0x4a5b1c){return BPromise[_0x7dbf('0x22')](_0x4a5b1c);}return _0x5db709[_0x7dbf('0x23')]();};}function saveUpdates(_0x1bf5c4,_0x7b6026){return function(_0x255ea8){if(_0x255ea8){return _0x255ea8[_0x7dbf('0x24')](_0x1bf5c4)[_0x7dbf('0x25')](function(_0x4c3d53){return _0x4c3d53;});}return null;};}function removeEntity(_0x2dcd00,_0x3a00ab){return function(_0x3292c9){if(_0x3292c9){return _0x3292c9[_0x7dbf('0x26')]()[_0x7dbf('0x25')](function(){var _0x23cc32=_0x3292c9[_0x7dbf('0x27')]({'plain':!![]});var _0x3488f9=_0x7dbf('0x28');return db[_0x7dbf('0x29')][_0x7dbf('0x26')]({'where':{'type':_0x3488f9,'resourceId':_0x23cc32['id']}})['then'](function(){return _0x3292c9;});})['then'](function(){_0x2dcd00[_0x7dbf('0x1b')](0xcc)[_0x7dbf('0x2a')]();});}};}function handleEntityNotFound(_0x5476e8,_0x2f87fa){return function(_0x11a602){if(!_0x11a602){_0x5476e8[_0x7dbf('0x1a')](0x194);}return _0x11a602;};}function handleError(_0x579ea3,_0x17db00){_0x17db00=_0x17db00||0x1f4;return function(_0x394cc8){logger[_0x7dbf('0x2b')](_0x394cc8[_0x7dbf('0x2c')]);if(_0x394cc8['name']){delete _0x394cc8['name'];}_0x579ea3[_0x7dbf('0x1b')](_0x17db00)[_0x7dbf('0x2d')](_0x394cc8);};}exports[_0x7dbf('0x2e')]=function(_0x685fe4,_0x1ca9ff){var _0xf9b2d4={},_0x413e9={},_0x4d76f1={'count':0x0,'rows':[]};var _0x4499af=_[_0x7dbf('0x2f')](db['CannedAnswer']['rawAttributes'],function(_0x398295){return{'name':_0x398295[_0x7dbf('0x30')],'type':_0x398295[_0x7dbf('0x31')][_0x7dbf('0x32')]};});_0x413e9[_0x7dbf('0x33')]=_[_0x7dbf('0x2f')](_0x4499af,_0x7dbf('0x34'));_0x413e9[_0x7dbf('0x35')]=_[_0x7dbf('0x36')](_0x685fe4['query']);_0x413e9[_0x7dbf('0x37')]=_['intersection'](_0x413e9[_0x7dbf('0x33')],_0x413e9[_0x7dbf('0x35')]);_0xf9b2d4[_0x7dbf('0x38')]=_[_0x7dbf('0x39')](_0x413e9[_0x7dbf('0x33')],qs['fields'](_0x685fe4[_0x7dbf('0x35')][_0x7dbf('0x3a')]));_0xf9b2d4[_0x7dbf('0x38')]=_0xf9b2d4[_0x7dbf('0x38')][_0x7dbf('0x3b')]?_0xf9b2d4[_0x7dbf('0x38')]:_0x413e9[_0x7dbf('0x33')];if(!_0x685fe4[_0x7dbf('0x35')][_0x7dbf('0x3c')]('nolimit')){_0xf9b2d4['limit']=qs[_0x7dbf('0x1e')](_0x685fe4[_0x7dbf('0x35')][_0x7dbf('0x1e')]);_0xf9b2d4[_0x7dbf('0x1d')]=qs[_0x7dbf('0x1d')](_0x685fe4[_0x7dbf('0x35')]['offset']);}_0xf9b2d4[_0x7dbf('0x3d')]=qs[_0x7dbf('0x3e')](_0x685fe4[_0x7dbf('0x35')][_0x7dbf('0x3e')]);_0xf9b2d4[_0x7dbf('0x3f')]=qs['filters'](_[_0x7dbf('0x40')](_0x685fe4[_0x7dbf('0x35')],_0x413e9[_0x7dbf('0x37')]),_0x4499af);if(_0x685fe4[_0x7dbf('0x35')][_0x7dbf('0x41')]){_0xf9b2d4['where']=_[_0x7dbf('0x42')](_0xf9b2d4[_0x7dbf('0x3f')],{'$or':[{'key':{'$like':'%'+_0x685fe4[_0x7dbf('0x35')][_0x7dbf('0x41')]+'%'}},{'value':{'$like':'%'+_0x685fe4['query']['filter']+'%'}}]});}_0xf9b2d4=_[_0x7dbf('0x42')]({},_0xf9b2d4,_0x685fe4[_0x7dbf('0x43')]);var _0x16f495={'where':_0xf9b2d4['where']};return db[_0x7dbf('0x44')]['count'](_0x16f495)[_0x7dbf('0x25')](function(_0x8a36d2){_0x4d76f1['count']=_0x8a36d2;if(_0x685fe4['query'][_0x7dbf('0x45')]){_0xf9b2d4[_0x7dbf('0x46')]=[{'all':!![]}];}return db[_0x7dbf('0x44')][_0x7dbf('0x47')](_0xf9b2d4);})[_0x7dbf('0x25')](function(_0x12d986){_0x4d76f1[_0x7dbf('0x48')]=_0x12d986;return _0x4d76f1;})[_0x7dbf('0x25')](respondWithFilteredResult(_0x1ca9ff,_0xf9b2d4))['catch'](handleError(_0x1ca9ff,null));};exports[_0x7dbf('0x49')]=function(_0x23f5cf,_0x2f7825){var _0x35920d={'raw':!![],'where':{'id':_0x23f5cf[_0x7dbf('0x4a')]['id']}},_0x42bc79={};_0x42bc79['model']=_[_0x7dbf('0x36')](db[_0x7dbf('0x44')]['rawAttributes']);_0x42bc79[_0x7dbf('0x35')]=_[_0x7dbf('0x36')](_0x23f5cf[_0x7dbf('0x35')]);_0x42bc79[_0x7dbf('0x37')]=_[_0x7dbf('0x39')](_0x42bc79[_0x7dbf('0x33')],_0x42bc79[_0x7dbf('0x35')]);_0x35920d[_0x7dbf('0x38')]=_['intersection'](_0x42bc79[_0x7dbf('0x33')],qs['fields'](_0x23f5cf[_0x7dbf('0x35')][_0x7dbf('0x3a')]));_0x35920d[_0x7dbf('0x38')]=_0x35920d[_0x7dbf('0x38')][_0x7dbf('0x3b')]?_0x35920d[_0x7dbf('0x38')]:_0x42bc79[_0x7dbf('0x33')];if(_0x23f5cf[_0x7dbf('0x35')][_0x7dbf('0x45')]){_0x35920d[_0x7dbf('0x46')]=[{'all':!![]}];}_0x35920d=_[_0x7dbf('0x42')]({},_0x35920d,_0x23f5cf[_0x7dbf('0x43')]);return db[_0x7dbf('0x44')]['find'](_0x35920d)[_0x7dbf('0x25')](handleEntityNotFound(_0x2f7825,null))[_0x7dbf('0x25')](respondWithResult(_0x2f7825,null))['catch'](handleError(_0x2f7825,null));};exports[_0x7dbf('0x24')]=function(_0x54bbe1,_0x26eba1){if(_0x54bbe1[_0x7dbf('0x4b')]['id']){delete _0x54bbe1[_0x7dbf('0x4b')]['id'];}return db['CannedAnswer'][_0x7dbf('0x4c')]({'where':{'id':_0x54bbe1['params']['id']}})[_0x7dbf('0x25')](handleEntityNotFound(_0x26eba1,null))[_0x7dbf('0x25')](saveUpdates(_0x54bbe1[_0x7dbf('0x4b')],null))[_0x7dbf('0x25')](respondWithResult(_0x26eba1,null))[_0x7dbf('0x4d')](handleError(_0x26eba1,null));};exports[_0x7dbf('0x26')]=function(_0xd0abfc,_0x1f8705){return db[_0x7dbf('0x44')][_0x7dbf('0x4c')]({'where':{'id':_0xd0abfc[_0x7dbf('0x4a')]['id']}})[_0x7dbf('0x25')](handleEntityNotFound(_0x1f8705,null))['then'](removeEntity(_0x1f8705,null))[_0x7dbf('0x4d')](handleError(_0x1f8705,null));};exports[_0x7dbf('0x4e')]=function(_0x2d84f3,_0x2dcb40){var _0x38a057={'key':_0x2d84f3[_0x7dbf('0x4b')][_0x7dbf('0x32')]};if(_0x2d84f3[_0x7dbf('0x4b')][_0x7dbf('0x4f')]){_0x38a057[_0x7dbf('0x4f')]=_0x2d84f3[_0x7dbf('0x4b')][_0x7dbf('0x4f')];}else if(_0x2d84f3[_0x7dbf('0x4b')]['SmsAccountId']){_0x38a057['SmsAccountId']=_0x2d84f3['body']['SmsAccountId'];}else if(_0x2d84f3['body'][_0x7dbf('0x50')]){_0x38a057['OpenchannelAccountId']=_0x2d84f3['body'][_0x7dbf('0x50')];}else if(_0x2d84f3[_0x7dbf('0x4b')][_0x7dbf('0x51')]){_0x38a057[_0x7dbf('0x51')]=_0x2d84f3[_0x7dbf('0x4b')][_0x7dbf('0x51')];}return db[_0x7dbf('0x44')][_0x7dbf('0x4c')]({'where':_0x38a057})['then'](function(_0x18a765){if(_0x18a765){throw new db[(_0x7dbf('0x52'))][(_0x7dbf('0x53'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x7dbf('0x44')]['create'](_0x2d84f3[_0x7dbf('0x4b')]);})[_0x7dbf('0x25')](function(_0x566f4d){var _0x2461c1=_0x2d84f3['user'][_0x7dbf('0x27')]({'plain':!![]});if(!_0x2461c1)throw new Error(_0x7dbf('0x54'));if(_0x2461c1[_0x7dbf('0x55')]===_0x7dbf('0x56')){var _0x3336c3=_0x566f4d[_0x7dbf('0x27')]({'plain':!![]});return db[_0x7dbf('0x57')][_0x7dbf('0x4c')]({'where':{'name':_0x7dbf('0x28'),'userProfileId':_0x2461c1[_0x7dbf('0x58')]},'raw':!![]})['then'](function(_0x414e6f){if(_0x414e6f&&_0x414e6f[_0x7dbf('0x59')]===0x0){return db[_0x7dbf('0x29')]['create']({'name':_0x3336c3[_0x7dbf('0x34')],'resourceId':_0x3336c3['id'],'type':_0x414e6f[_0x7dbf('0x34')],'sectionId':_0x414e6f['id']},{})['then'](function(){return _0x566f4d;});}else{return _0x566f4d;}})[_0x7dbf('0x4d')](function(_0xc9c40){logger[_0x7dbf('0x2b')](_0x7dbf('0x5a'),_0xc9c40);throw _0xc9c40;});}return _0x566f4d;})[_0x7dbf('0x25')](respondWithResult(_0x2dcb40,0xc9))[_0x7dbf('0x4d')](handleError(_0x2dcb40,null));};
\ No newline at end of file
+var _0xad32=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/license/util','../../mysqldb','status','limit','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','stack','name','index','map','CannedAnswer','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','includeAll','include','findAll','catch','show','params','length','options','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xad32,0x1a8));var _0x2ad3=function(_0x1b046f,_0x8e5fa6){_0x1b046f=_0x1b046f-0x0;var _0x1f6c8f=_0xad32[_0x1b046f];return _0x1f6c8f;};'use strict';var emlformat=require(_0x2ad3('0x0'));var rimraf=require(_0x2ad3('0x1'));var zipdir=require(_0x2ad3('0x2'));var jsonpatch=require(_0x2ad3('0x3'));var rp=require(_0x2ad3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2ad3('0x5'));var util=require(_0x2ad3('0x6'));var path=require(_0x2ad3('0x7'));var sox=require(_0x2ad3('0x8'));var csv=require(_0x2ad3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ad3('0xa'));var _=require(_0x2ad3('0xb'));var squel=require(_0x2ad3('0xc'));var crypto=require(_0x2ad3('0xd'));var jsforce=require(_0x2ad3('0xe'));var deskjs=require(_0x2ad3('0xf'));var toCsv=require(_0x2ad3('0x9'));var querystring=require(_0x2ad3('0x10'));var Papa=require(_0x2ad3('0x11'));var Redis=require('ioredis');var authService=require(_0x2ad3('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2ad3('0x13'))(_0x2ad3('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2ad3('0x15'));var db=require(_0x2ad3('0x16'))['db'];function respondWithStatusCode(_0x5d65a6,_0x360fc4){_0x360fc4=_0x360fc4||0xcc;return function(_0x25afcb){if(_0x25afcb){return _0x5d65a6['sendStatus'](_0x360fc4);}return _0x5d65a6[_0x2ad3('0x17')](_0x360fc4)['end']();};}function respondWithResult(_0xdbeaad,_0x4f911c){_0x4f911c=_0x4f911c||0xc8;return function(_0x3d268c){if(_0x3d268c){return _0xdbeaad[_0x2ad3('0x17')](_0x4f911c)['json'](_0x3d268c);}};}function respondWithFilteredResult(_0x3ce26d,_0x1a7288){return function(_0x8fe689){if(_0x8fe689){var _0x320d0e=typeof _0x1a7288['offset']==='undefined'&&typeof _0x1a7288[_0x2ad3('0x18')]==='undefined';var _0x3c615b=_0x8fe689[_0x2ad3('0x19')];var _0x3c9943=_0x320d0e?0x0:_0x1a7288['offset'];var _0x195e26=_0x320d0e?_0x8fe689[_0x2ad3('0x19')]:_0x1a7288[_0x2ad3('0x1a')]+_0x1a7288['limit'];var _0x5e2e8e;if(_0x195e26>=_0x3c615b){_0x195e26=_0x3c615b;_0x5e2e8e=0xc8;}else{_0x5e2e8e=0xce;}_0x3ce26d['status'](_0x5e2e8e);return _0x3ce26d[_0x2ad3('0x1b')](_0x2ad3('0x1c'),_0x3c9943+'-'+_0x195e26+'/'+_0x3c615b)[_0x2ad3('0x1d')](_0x8fe689);}return null;};}function patchUpdates(_0x401308){return function(_0xec511d){try{jsonpatch[_0x2ad3('0x1e')](_0xec511d,_0x401308,!![]);}catch(_0x17c009){return BPromise[_0x2ad3('0x1f')](_0x17c009);}return _0xec511d['save']();};}function saveUpdates(_0x243453,_0x9398e9){return function(_0x1905e){if(_0x1905e){return _0x1905e[_0x2ad3('0x20')](_0x243453)[_0x2ad3('0x21')](function(_0x337bae){return _0x337bae;});}return null;};}function removeEntity(_0x4cf566,_0x27dda6){return function(_0x840ee2){if(_0x840ee2){return _0x840ee2[_0x2ad3('0x22')]()[_0x2ad3('0x21')](function(){var _0x104511=_0x840ee2[_0x2ad3('0x23')]({'plain':!![]});var _0x1562f3=_0x2ad3('0x24');return db[_0x2ad3('0x25')]['destroy']({'where':{'type':_0x1562f3,'resourceId':_0x104511['id']}})[_0x2ad3('0x21')](function(){return _0x840ee2;});})[_0x2ad3('0x21')](function(){_0x4cf566[_0x2ad3('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49819a,_0x3c63ac){return function(_0x479279){if(!_0x479279){_0x49819a[_0x2ad3('0x26')](0x194);}return _0x479279;};}function handleError(_0x13bae3,_0x143f0c){_0x143f0c=_0x143f0c||0x1f4;return function(_0x34599e){logger['error'](_0x34599e[_0x2ad3('0x27')]);if(_0x34599e[_0x2ad3('0x28')]){delete _0x34599e[_0x2ad3('0x28')];}_0x13bae3[_0x2ad3('0x17')](_0x143f0c)['send'](_0x34599e);};}exports[_0x2ad3('0x29')]=function(_0x1060ca,_0x122042){var _0x196cfe={},_0x54c338={},_0x53611d={'count':0x0,'rows':[]};var _0x5b6fa2=_[_0x2ad3('0x2a')](db[_0x2ad3('0x2b')][_0x2ad3('0x2c')],function(_0xb77b6e){return{'name':_0xb77b6e[_0x2ad3('0x2d')],'type':_0xb77b6e[_0x2ad3('0x2e')][_0x2ad3('0x2f')]};});_0x54c338['model']=_[_0x2ad3('0x2a')](_0x5b6fa2,'name');_0x54c338['query']=_[_0x2ad3('0x30')](_0x1060ca[_0x2ad3('0x31')]);_0x54c338[_0x2ad3('0x32')]=_[_0x2ad3('0x33')](_0x54c338[_0x2ad3('0x34')],_0x54c338[_0x2ad3('0x31')]);_0x196cfe['attributes']=_['intersection'](_0x54c338[_0x2ad3('0x34')],qs[_0x2ad3('0x35')](_0x1060ca[_0x2ad3('0x31')]['fields']));_0x196cfe[_0x2ad3('0x36')]=_0x196cfe['attributes']['length']?_0x196cfe[_0x2ad3('0x36')]:_0x54c338[_0x2ad3('0x34')];if(!_0x1060ca['query'][_0x2ad3('0x37')]('nolimit')){_0x196cfe[_0x2ad3('0x18')]=qs['limit'](_0x1060ca[_0x2ad3('0x31')][_0x2ad3('0x18')]);_0x196cfe['offset']=qs[_0x2ad3('0x1a')](_0x1060ca[_0x2ad3('0x31')][_0x2ad3('0x1a')]);}_0x196cfe[_0x2ad3('0x38')]=qs[_0x2ad3('0x39')](_0x1060ca[_0x2ad3('0x31')][_0x2ad3('0x39')]);_0x196cfe[_0x2ad3('0x3a')]=qs['filters'](_[_0x2ad3('0x3b')](_0x1060ca['query'],_0x54c338[_0x2ad3('0x32')]),_0x5b6fa2);if(_0x1060ca[_0x2ad3('0x31')]['filter']){_0x196cfe['where']=_[_0x2ad3('0x3c')](_0x196cfe[_0x2ad3('0x3a')],{'$or':[{'key':{'$like':'%'+_0x1060ca[_0x2ad3('0x31')]['filter']+'%'}},{'value':{'$like':'%'+_0x1060ca['query']['filter']+'%'}}]});}_0x196cfe=_[_0x2ad3('0x3c')]({},_0x196cfe,_0x1060ca['options']);var _0x26a843={'where':_0x196cfe[_0x2ad3('0x3a')]};return db['CannedAnswer'][_0x2ad3('0x19')](_0x26a843)[_0x2ad3('0x21')](function(_0x5148bf){_0x53611d[_0x2ad3('0x19')]=_0x5148bf;if(_0x1060ca[_0x2ad3('0x31')][_0x2ad3('0x3d')]){_0x196cfe[_0x2ad3('0x3e')]=[{'all':!![]}];}return db[_0x2ad3('0x2b')][_0x2ad3('0x3f')](_0x196cfe);})[_0x2ad3('0x21')](function(_0x35d2de){_0x53611d['rows']=_0x35d2de;return _0x53611d;})[_0x2ad3('0x21')](respondWithFilteredResult(_0x122042,_0x196cfe))[_0x2ad3('0x40')](handleError(_0x122042,null));};exports[_0x2ad3('0x41')]=function(_0x447705,_0x4fd971){var _0x2cf87e={'raw':!![],'where':{'id':_0x447705[_0x2ad3('0x42')]['id']}},_0x198ad3={};_0x198ad3[_0x2ad3('0x34')]=_[_0x2ad3('0x30')](db[_0x2ad3('0x2b')]['rawAttributes']);_0x198ad3[_0x2ad3('0x31')]=_[_0x2ad3('0x30')](_0x447705[_0x2ad3('0x31')]);_0x198ad3['filters']=_['intersection'](_0x198ad3[_0x2ad3('0x34')],_0x198ad3[_0x2ad3('0x31')]);_0x2cf87e[_0x2ad3('0x36')]=_['intersection'](_0x198ad3[_0x2ad3('0x34')],qs[_0x2ad3('0x35')](_0x447705['query'][_0x2ad3('0x35')]));_0x2cf87e[_0x2ad3('0x36')]=_0x2cf87e[_0x2ad3('0x36')][_0x2ad3('0x43')]?_0x2cf87e[_0x2ad3('0x36')]:_0x198ad3[_0x2ad3('0x34')];if(_0x447705['query'][_0x2ad3('0x3d')]){_0x2cf87e[_0x2ad3('0x3e')]=[{'all':!![]}];}_0x2cf87e=_[_0x2ad3('0x3c')]({},_0x2cf87e,_0x447705[_0x2ad3('0x44')]);return db['CannedAnswer'][_0x2ad3('0x45')](_0x2cf87e)[_0x2ad3('0x21')](handleEntityNotFound(_0x4fd971,null))[_0x2ad3('0x21')](respondWithResult(_0x4fd971,null))['catch'](handleError(_0x4fd971,null));};exports[_0x2ad3('0x20')]=function(_0x56e3a8,_0x354522){if(_0x56e3a8[_0x2ad3('0x46')]['id']){delete _0x56e3a8[_0x2ad3('0x46')]['id'];}return db['CannedAnswer'][_0x2ad3('0x45')]({'where':{'id':_0x56e3a8[_0x2ad3('0x42')]['id']}})['then'](handleEntityNotFound(_0x354522,null))[_0x2ad3('0x21')](saveUpdates(_0x56e3a8[_0x2ad3('0x46')],null))[_0x2ad3('0x21')](respondWithResult(_0x354522,null))[_0x2ad3('0x40')](handleError(_0x354522,null));};exports[_0x2ad3('0x22')]=function(_0x1cb5af,_0x4e9f59){return db[_0x2ad3('0x2b')][_0x2ad3('0x45')]({'where':{'id':_0x1cb5af[_0x2ad3('0x42')]['id']}})[_0x2ad3('0x21')](handleEntityNotFound(_0x4e9f59,null))[_0x2ad3('0x21')](removeEntity(_0x4e9f59,null))[_0x2ad3('0x40')](handleError(_0x4e9f59,null));};exports[_0x2ad3('0x47')]=function(_0x186fd6,_0x35c459){var _0x15bca7={'key':_0x186fd6[_0x2ad3('0x46')][_0x2ad3('0x2f')]};if(_0x186fd6[_0x2ad3('0x46')]['MailAccountId']){_0x15bca7[_0x2ad3('0x48')]=_0x186fd6[_0x2ad3('0x46')]['MailAccountId'];}else if(_0x186fd6['body']['SmsAccountId']){_0x15bca7['SmsAccountId']=_0x186fd6['body'][_0x2ad3('0x49')];}else if(_0x186fd6['body'][_0x2ad3('0x4a')]){_0x15bca7[_0x2ad3('0x4a')]=_0x186fd6['body'][_0x2ad3('0x4a')];}else if(_0x186fd6[_0x2ad3('0x46')][_0x2ad3('0x4b')]){_0x15bca7[_0x2ad3('0x4b')]=_0x186fd6['body']['ChatWebsiteId'];}return db[_0x2ad3('0x2b')]['find']({'where':_0x15bca7})[_0x2ad3('0x21')](function(_0x24f560){if(_0x24f560){throw new db[(_0x2ad3('0x4c'))][(_0x2ad3('0x4d'))](_0x2ad3('0x4e'));}return db[_0x2ad3('0x2b')][_0x2ad3('0x47')](_0x186fd6['body']);})['then'](function(_0x4a8080){var _0x325261=_0x186fd6[_0x2ad3('0x4f')][_0x2ad3('0x23')]({'plain':!![]});if(!_0x325261)throw new Error(_0x2ad3('0x50'));if(_0x325261[_0x2ad3('0x51')]===_0x2ad3('0x4f')){var _0x20a95a=_0x4a8080[_0x2ad3('0x23')]({'plain':!![]});return db[_0x2ad3('0x52')][_0x2ad3('0x45')]({'where':{'name':_0x2ad3('0x24'),'userProfileId':_0x325261[_0x2ad3('0x53')]},'raw':!![]})['then'](function(_0x53b004){if(_0x53b004&&_0x53b004[_0x2ad3('0x54')]===0x0){return db[_0x2ad3('0x25')]['create']({'name':_0x20a95a[_0x2ad3('0x28')],'resourceId':_0x20a95a['id'],'type':_0x53b004[_0x2ad3('0x28')],'sectionId':_0x53b004['id']},{})[_0x2ad3('0x21')](function(){return _0x4a8080;});}else{return _0x4a8080;}})[_0x2ad3('0x40')](function(_0x1e3615){logger[_0x2ad3('0x55')](_0x2ad3('0x56'),_0x1e3615);throw _0x1e3615;});}return _0x4a8080;})[_0x2ad3('0x21')](respondWithResult(_0x35c459,0xc9))[_0x2ad3('0x40')](handleError(_0x35c459,null));};
\ No newline at end of file
index 770bb0a..9643699 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b2d=['api','moment','bluebird','request-promise','path','./cannedAnswer.attributes','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x2b2d,0x142));var _0xd2b2=function(_0x1dbfa3,_0x5717dd){_0x1dbfa3=_0x1dbfa3-0x0;var _0x4f8e54=_0x2b2d[_0x1dbfa3];return _0x4f8e54;};'use strict';var _=require('lodash');var util=require(_0xd2b2('0x0'));var logger=require(_0xd2b2('0x1'))(_0xd2b2('0x2'));var moment=require(_0xd2b2('0x3'));var BPromise=require(_0xd2b2('0x4'));var rp=require(_0xd2b2('0x5'));var fs=require('fs');var path=require(_0xd2b2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd2b2('0x7'));module['exports']=function(_0x3b8505,_0x16599c){return _0x3b8505[_0xd2b2('0x8')]('CannedAnswer',attributes,{'tableName':_0xd2b2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd2b2('0xa'),'collate':_0xd2b2('0xb')});};
\ No newline at end of file
+var _0x6f59=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','utf8mb4','lodash','util'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x6f59,0x1be));var _0x96f5=function(_0x473da3,_0x469bfa){_0x473da3=_0x473da3-0x0;var _0x5449ef=_0x6f59[_0x473da3];return _0x5449ef;};'use strict';var _=require(_0x96f5('0x0'));var util=require(_0x96f5('0x1'));var logger=require(_0x96f5('0x2'))(_0x96f5('0x3'));var moment=require(_0x96f5('0x4'));var BPromise=require(_0x96f5('0x5'));var rp=require(_0x96f5('0x6'));var fs=require('fs');var path=require(_0x96f5('0x7'));var rimraf=require(_0x96f5('0x8'));var config=require(_0x96f5('0x9'));var attributes=require(_0x96f5('0xa'));module[_0x96f5('0xb')]=function(_0x598154,_0xf6cd7d){return _0x598154['define'](_0x96f5('0xc'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x96f5('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index e522cb5..fa1ad06 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(_0x308d39,_0x309f94){var _0xad36e4=function(_0x1adc08){while(--_0x1adc08){_0x308d39['push'](_0x308d39['shift']());}};_0xad36e4(++_0x309f94);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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(_0x1428ab,_0x44fcd3){var _0x2af07b=function(_0x30e609){while(--_0x30e609){_0x1428ab['push'](_0x1428ab['shift']());}};_0x2af07b(++_0x44fcd3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var 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 ebb7151..c7a695a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1556=['Router','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','/:id','show','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3819fc,_0x5a2a2d){var _0x46d262=function(_0x1e9896){while(--_0x1e9896){_0x3819fc['push'](_0x3819fc['shift']());}};_0x46d262(++_0x5a2a2d);}(_0x1556,0x105));var _0x6155=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x1556[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0x6155('0x0'));var util=require(_0x6155('0x1'));var path=require(_0x6155('0x2'));var timeout=require(_0x6155('0x3'));var express=require(_0x6155('0x4'));var router=express[_0x6155('0x5')]();var fs_extra=require(_0x6155('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6155('0x7'));var config=require(_0x6155('0x8'));var controller=require(_0x6155('0x9'));router['get']('/',auth[_0x6155('0xa')](),controller[_0x6155('0xb')]);router[_0x6155('0xc')](_0x6155('0xd'),auth[_0x6155('0xa')](),controller[_0x6155('0xe')]);router['post']('/',auth[_0x6155('0xa')](),controller['create']);router[_0x6155('0xf')]('/:id',auth[_0x6155('0xa')](),controller[_0x6155('0x10')]);router['delete']('/:id',auth[_0x6155('0xa')](),controller[_0x6155('0x11')]);module[_0x6155('0x12')]=router;
\ No newline at end of file
+var _0xb88f=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','put','update','delete'];(function(_0x4fccb0,_0x30de60){var _0x12f48b=function(_0x1958f5){while(--_0x1958f5){_0x4fccb0['push'](_0x4fccb0['shift']());}};_0x12f48b(++_0x30de60);}(_0xb88f,0x92));var _0xfb88=function(_0x18b344,_0x271f68){_0x18b344=_0x18b344-0x0;var _0x5ef6bb=_0xb88f[_0x18b344];return _0x5ef6bb;};'use strict';var multer=require(_0xfb88('0x0'));var util=require(_0xfb88('0x1'));var path=require(_0xfb88('0x2'));var timeout=require('connect-timeout');var express=require(_0xfb88('0x3'));var router=express[_0xfb88('0x4')]();var fs_extra=require(_0xfb88('0x5'));var auth=require(_0xfb88('0x6'));var interaction=require(_0xfb88('0x7'));var config=require(_0xfb88('0x8'));var controller=require('./cannedAnswer.controller');router[_0xfb88('0x9')]('/',auth[_0xfb88('0xa')](),controller[_0xfb88('0xb')]);router[_0xfb88('0x9')](_0xfb88('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xfb88('0xd')]('/:id',auth[_0xfb88('0xa')](),controller[_0xfb88('0xe')]);router[_0xfb88('0xf')](_0xfb88('0xc'),auth[_0xfb88('0xa')](),controller[_0xfb88('0x10')]);module[_0xfb88('0x11')]=router;
\ No newline at end of file
index 88308fc..d38fe23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66f4=['INTEGER','exports','STRING'];(function(_0xeab745,_0x3c7728){var _0x118296=function(_0x3a3403){while(--_0x3a3403){_0xeab745['push'](_0xeab745['shift']());}};_0x118296(++_0x3c7728);}(_0x66f4,0x7f));var _0x466f=function(_0x7fa17b,_0x375ec5){_0x7fa17b=_0x7fa17b-0x0;var _0x21950f=_0x66f4[_0x7fa17b];return _0x21950f;};'use strict';var Sequelize=require('sequelize');module[_0x466f('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x466f('0x1')]},'src':{'type':Sequelize[_0x466f('0x1')]},'dst':{'type':Sequelize[_0x466f('0x1')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x466f('0x1')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x466f('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x466f('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x466f('0x1')]},'amaflags':{'type':Sequelize[_0x466f('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x466f('0x1')]},'uniqueid':{'type':Sequelize[_0x466f('0x1')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x466f('0x1')]},'tag':{'type':Sequelize[_0x466f('0x1')]}};
\ No newline at end of file
+var _0x81a5=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x1ab59f,_0x49b3e4){var _0xc57b9a=function(_0xabb164){while(--_0xabb164){_0x1ab59f['push'](_0x1ab59f['shift']());}};_0xc57b9a(++_0x49b3e4);}(_0x81a5,0x1c8));var _0x581a=function(_0x1c8417,_0x367fb9){_0x1c8417=_0x1c8417-0x0;var _0x4f7dcc=_0x81a5[_0x1c8417];return _0x4f7dcc;};'use strict';var Sequelize=require(_0x581a('0x0'));module[_0x581a('0x1')]={'calldate':{'type':Sequelize[_0x581a('0x2')],'allowNull':![],'defaultValue':_0x581a('0x3')},'clid':{'type':Sequelize[_0x581a('0x4')]},'src':{'type':Sequelize[_0x581a('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x581a('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x581a('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x581a('0x4')]},'amaflags':{'type':Sequelize[_0x581a('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x581a('0x4')]},'userfield':{'type':Sequelize[_0x581a('0x4')]},'uniqueid':{'type':Sequelize[_0x581a('0x4')]},'linkedid':{'type':Sequelize[_0x581a('0x4')]},'sequence':{'type':Sequelize[_0x581a('0x4')]},'peeraccount':{'type':Sequelize[_0x581a('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x581a('0x4')]}};
\ No newline at end of file
index 1de2bce..e7c5805 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8085=['name','send','index','map','Cdr','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','catch','body','find','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','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/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack'];(function(_0x171d3a,_0x161588){var _0xbd17cf=function(_0x331e4e){while(--_0x331e4e){_0x171d3a['push'](_0x171d3a['shift']());}};_0xbd17cf(++_0x161588);}(_0x8085,0x71));var _0x5808=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x8085[_0x2064e5];return _0x21a233;};'use strict';var emlformat=require(_0x5808('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5808('0x1'));var rp=require(_0x5808('0x2'));var moment=require(_0x5808('0x3'));var BPromise=require(_0x5808('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5808('0x5'));var sox=require(_0x5808('0x6'));var csv=require('to-csv');var ejs=require(_0x5808('0x7'));var fs=require('fs');var fs_extra=require(_0x5808('0x8'));var _=require(_0x5808('0x9'));var squel=require(_0x5808('0xa'));var crypto=require(_0x5808('0xb'));var jsforce=require(_0x5808('0xc'));var deskjs=require(_0x5808('0xd'));var toCsv=require(_0x5808('0xe'));var querystring=require(_0x5808('0xf'));var Papa=require(_0x5808('0x10'));var Redis=require(_0x5808('0x11'));var authService=require(_0x5808('0x12'));var qs=require(_0x5808('0x13'));var as=require(_0x5808('0x14'));var hardwareService=require(_0x5808('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x5808('0x16'));var config=require(_0x5808('0x17'));var licenseUtil=require(_0x5808('0x18'));var db=require(_0x5808('0x19'))['db'];function respondWithStatusCode(_0xab4f46,_0x19be03){_0x19be03=_0x19be03||0xcc;return function(_0x10572d){if(_0x10572d){return _0xab4f46['sendStatus'](_0x19be03);}return _0xab4f46['status'](_0x19be03)[_0x5808('0x1a')]();};}function respondWithResult(_0x19252b,_0x3582d6){_0x3582d6=_0x3582d6||0xc8;return function(_0x3e7c09){if(_0x3e7c09){return _0x19252b[_0x5808('0x1b')](_0x3582d6)[_0x5808('0x1c')](_0x3e7c09);}};}function respondWithFilteredResult(_0x299b22,_0x2af9da){return function(_0x1dda8d){if(_0x1dda8d){var _0x46dd8a=typeof _0x2af9da[_0x5808('0x1d')]==='undefined'&&typeof _0x2af9da[_0x5808('0x1e')]==='undefined';var _0x406e65=_0x1dda8d[_0x5808('0x1f')];var _0x3bf0ee=_0x46dd8a?0x0:_0x2af9da['offset'];var _0x9e58d4=_0x46dd8a?_0x1dda8d[_0x5808('0x1f')]:_0x2af9da['offset']+_0x2af9da['limit'];var _0x3c7c02;if(_0x9e58d4>=_0x406e65){_0x9e58d4=_0x406e65;_0x3c7c02=0xc8;}else{_0x3c7c02=0xce;}_0x299b22['status'](_0x3c7c02);return _0x299b22[_0x5808('0x20')](_0x5808('0x21'),_0x3bf0ee+'-'+_0x9e58d4+'/'+_0x406e65)[_0x5808('0x1c')](_0x1dda8d);}return null;};}function patchUpdates(_0xaac16a){return function(_0x578d70){try{jsonpatch['apply'](_0x578d70,_0xaac16a,!![]);}catch(_0xe82ad0){return BPromise[_0x5808('0x22')](_0xe82ad0);}return _0x578d70[_0x5808('0x23')]();};}function saveUpdates(_0x39bca3,_0x409337){return function(_0x33b583){if(_0x33b583){return _0x33b583[_0x5808('0x24')](_0x39bca3)[_0x5808('0x25')](function(_0x3a575e){return _0x3a575e;});}return null;};}function removeEntity(_0x4e1dfc,_0x5b5175){return function(_0x130590){if(_0x130590){return _0x130590[_0x5808('0x26')]()['then'](function(){_0x4e1dfc['status'](0xcc)[_0x5808('0x1a')]();});}};}function handleEntityNotFound(_0x467500,_0x1dddbd){return function(_0x4a4d05){if(!_0x4a4d05){_0x467500['sendStatus'](0x194);}return _0x4a4d05;};}function handleError(_0x24ee0f,_0x2c2cb5){_0x2c2cb5=_0x2c2cb5||0x1f4;return function(_0x27c991){logger[_0x5808('0x27')](_0x27c991[_0x5808('0x28')]);if(_0x27c991['name']){delete _0x27c991[_0x5808('0x29')];}_0x24ee0f[_0x5808('0x1b')](_0x2c2cb5)[_0x5808('0x2a')](_0x27c991);};}exports[_0x5808('0x2b')]=function(_0x28c1eb,_0x19ac63){var _0x1117ac={},_0x4ad6d8={},_0x560e83={'count':0x0,'rows':[]};var _0x4f6342=_[_0x5808('0x2c')](db[_0x5808('0x2d')]['rawAttributes'],function(_0x3faa07){return{'name':_0x3faa07[_0x5808('0x2e')],'type':_0x3faa07[_0x5808('0x2f')][_0x5808('0x30')]};});_0x4ad6d8[_0x5808('0x31')]=_[_0x5808('0x2c')](_0x4f6342,'name');_0x4ad6d8[_0x5808('0x32')]=_[_0x5808('0x33')](_0x28c1eb[_0x5808('0x32')]);_0x4ad6d8['filters']=_['intersection'](_0x4ad6d8[_0x5808('0x31')],_0x4ad6d8['query']);_0x1117ac[_0x5808('0x34')]=_[_0x5808('0x35')](_0x4ad6d8['model'],qs[_0x5808('0x36')](_0x28c1eb[_0x5808('0x32')]['fields']));_0x1117ac['attributes']=_0x1117ac[_0x5808('0x34')]['length']?_0x1117ac[_0x5808('0x34')]:_0x4ad6d8['model'];if(!_0x28c1eb[_0x5808('0x32')][_0x5808('0x37')](_0x5808('0x38'))){_0x1117ac['limit']=qs[_0x5808('0x1e')](_0x28c1eb['query'][_0x5808('0x1e')]);_0x1117ac['offset']=qs['offset'](_0x28c1eb[_0x5808('0x32')][_0x5808('0x1d')]);}_0x1117ac[_0x5808('0x39')]=qs['sort'](_0x28c1eb['query'][_0x5808('0x3a')]);_0x1117ac[_0x5808('0x3b')]=qs['filters'](_[_0x5808('0x3c')](_0x28c1eb[_0x5808('0x32')],_0x4ad6d8[_0x5808('0x3d')]),_0x4f6342);if(_0x28c1eb['query'][_0x5808('0x3e')]){_0x1117ac[_0x5808('0x3b')]=_[_0x5808('0x3f')](_0x1117ac['where'],{'$or':_[_0x5808('0x2c')](_0x4f6342,function(_0x12a045){if(_0x12a045['type']!=='VIRTUAL'){var _0x477278={};_0x477278[_0x12a045['name']]={'$like':'%'+_0x28c1eb[_0x5808('0x32')][_0x5808('0x3e')]+'%'};return _0x477278;}})});}_0x1117ac=_[_0x5808('0x3f')]({},_0x1117ac,_0x28c1eb[_0x5808('0x40')]);var _0x21fc36={'where':_0x1117ac['where']};return db['Cdr'][_0x5808('0x1f')](_0x21fc36)[_0x5808('0x25')](function(_0x402b4e){_0x560e83['count']=_0x402b4e;if(_0x28c1eb[_0x5808('0x32')][_0x5808('0x41')]){_0x1117ac[_0x5808('0x42')]=[{'all':!![]}];}return db[_0x5808('0x2d')][_0x5808('0x43')](_0x1117ac);})['then'](function(_0x1130c8){_0x560e83[_0x5808('0x44')]=_0x1130c8;return _0x560e83;})[_0x5808('0x25')](respondWithFilteredResult(_0x19ac63,_0x1117ac))['catch'](handleError(_0x19ac63,null));};exports[_0x5808('0x45')]=function(_0x287e07,_0xc62608){var _0x5e1230={'raw':!![],'where':{'id':_0x287e07[_0x5808('0x46')]['id']}},_0x5dcb50={};_0x5dcb50[_0x5808('0x31')]=_[_0x5808('0x33')](db[_0x5808('0x2d')][_0x5808('0x47')]);_0x5dcb50[_0x5808('0x32')]=_[_0x5808('0x33')](_0x287e07[_0x5808('0x32')]);_0x5dcb50[_0x5808('0x3d')]=_[_0x5808('0x35')](_0x5dcb50[_0x5808('0x31')],_0x5dcb50[_0x5808('0x32')]);_0x5e1230[_0x5808('0x34')]=_['intersection'](_0x5dcb50['model'],qs[_0x5808('0x36')](_0x287e07[_0x5808('0x32')][_0x5808('0x36')]));_0x5e1230[_0x5808('0x34')]=_0x5e1230[_0x5808('0x34')][_0x5808('0x48')]?_0x5e1230[_0x5808('0x34')]:_0x5dcb50['model'];if(_0x287e07[_0x5808('0x32')]['includeAll']){_0x5e1230[_0x5808('0x42')]=[{'all':!![]}];}_0x5e1230=_['merge']({},_0x5e1230,_0x287e07[_0x5808('0x40')]);return db['Cdr']['find'](_0x5e1230)['then'](handleEntityNotFound(_0xc62608,null))[_0x5808('0x25')](respondWithResult(_0xc62608,null))[_0x5808('0x49')](handleError(_0xc62608,null));};exports['create']=function(_0x46c8ed,_0x4568d0){return db[_0x5808('0x2d')]['create'](_0x46c8ed[_0x5808('0x4a')],{})['then'](respondWithResult(_0x4568d0,0xc9))[_0x5808('0x49')](handleError(_0x4568d0,null));};exports[_0x5808('0x24')]=function(_0x13fe11,_0x5cc977){if(_0x13fe11[_0x5808('0x4a')]['id']){delete _0x13fe11[_0x5808('0x4a')]['id'];}return db[_0x5808('0x2d')][_0x5808('0x4b')]({'where':{'id':_0x13fe11['params']['id']}})[_0x5808('0x25')](handleEntityNotFound(_0x5cc977,null))[_0x5808('0x25')](saveUpdates(_0x13fe11[_0x5808('0x4a')],null))[_0x5808('0x25')](respondWithResult(_0x5cc977,null))[_0x5808('0x49')](handleError(_0x5cc977,null));};exports[_0x5808('0x26')]=function(_0x5572f3,_0x23d2fe){return db[_0x5808('0x2d')][_0x5808('0x4b')]({'where':{'id':_0x5572f3[_0x5808('0x46')]['id']}})[_0x5808('0x25')](handleEntityNotFound(_0x23d2fe,null))['then'](removeEntity(_0x23d2fe,null))[_0x5808('0x49')](handleError(_0x23d2fe,null));};exports[_0x5808('0x4c')]=function(_0xc2c5d7,_0x44ff0a){return db[_0x5808('0x2d')][_0x5808('0x4c')]()['then'](respondWithResult(_0x44ff0a,null))[_0x5808('0x49')](handleError(_0x44ff0a,null));};
\ No newline at end of file
+var _0x9335=['hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','include','findAll','then','rows','show','params','rawAttributes','includeAll','options','find','create','catch','update','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','save','error','name','send','map','Cdr','type','key','query','keys','filters','model','attributes','intersection','fields'];(function(_0x5104a7,_0x2ef02a){var _0xae2c96=function(_0x50d1b0){while(--_0x50d1b0){_0x5104a7['push'](_0x5104a7['shift']());}};_0xae2c96(++_0x2ef02a);}(_0x9335,0xab));var _0x5933=function(_0xd5e128,_0x24d42a){_0xd5e128=_0xd5e128-0x0;var _0x4a8840=_0x9335[_0xd5e128];return _0x4a8840;};'use strict';var emlformat=require(_0x5933('0x0'));var rimraf=require(_0x5933('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5933('0x2'));var rp=require(_0x5933('0x3'));var moment=require(_0x5933('0x4'));var BPromise=require(_0x5933('0x5'));var Mustache=require(_0x5933('0x6'));var util=require(_0x5933('0x7'));var path=require(_0x5933('0x8'));var sox=require('sox');var csv=require(_0x5933('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5933('0xa'));var squel=require(_0x5933('0xb'));var crypto=require(_0x5933('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5933('0xd'));var toCsv=require(_0x5933('0x9'));var querystring=require(_0x5933('0xe'));var Papa=require(_0x5933('0xf'));var Redis=require(_0x5933('0x10'));var authService=require(_0x5933('0x11'));var qs=require(_0x5933('0x12'));var as=require(_0x5933('0x13'));var hardwareService=require(_0x5933('0x14'));var logger=require(_0x5933('0x15'))(_0x5933('0x16'));var utils=require(_0x5933('0x17'));var config=require(_0x5933('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5933('0x19'))['db'];function respondWithStatusCode(_0x5af679,_0x8b6bad){_0x8b6bad=_0x8b6bad||0xcc;return function(_0x1b4428){if(_0x1b4428){return _0x5af679[_0x5933('0x1a')](_0x8b6bad);}return _0x5af679['status'](_0x8b6bad)[_0x5933('0x1b')]();};}function respondWithResult(_0x542448,_0x1ab3d0){_0x1ab3d0=_0x1ab3d0||0xc8;return function(_0x4fc51d){if(_0x4fc51d){return _0x542448[_0x5933('0x1c')](_0x1ab3d0)['json'](_0x4fc51d);}};}function respondWithFilteredResult(_0xf6321f,_0x5e91da){return function(_0x404555){if(_0x404555){var _0x34c035=typeof _0x5e91da[_0x5933('0x1d')]==='undefined'&&typeof _0x5e91da['limit']===_0x5933('0x1e');var _0x2a2532=_0x404555[_0x5933('0x1f')];var _0x51a525=_0x34c035?0x0:_0x5e91da['offset'];var _0x15263f=_0x34c035?_0x404555['count']:_0x5e91da[_0x5933('0x1d')]+_0x5e91da[_0x5933('0x20')];var _0x21b1d7;if(_0x15263f>=_0x2a2532){_0x15263f=_0x2a2532;_0x21b1d7=0xc8;}else{_0x21b1d7=0xce;}_0xf6321f['status'](_0x21b1d7);return _0xf6321f[_0x5933('0x21')](_0x5933('0x22'),_0x51a525+'-'+_0x15263f+'/'+_0x2a2532)[_0x5933('0x23')](_0x404555);}return null;};}function patchUpdates(_0x4d661c){return function(_0x59a2cd){try{jsonpatch['apply'](_0x59a2cd,_0x4d661c,!![]);}catch(_0x36d602){return BPromise['reject'](_0x36d602);}return _0x59a2cd[_0x5933('0x24')]();};}function saveUpdates(_0x4a5252,_0x2d0fb7){return function(_0x50026f){if(_0x50026f){return _0x50026f['update'](_0x4a5252)['then'](function(_0x4a1901){return _0x4a1901;});}return null;};}function removeEntity(_0x3d70ef,_0x5639c7){return function(_0x1a2f5d){if(_0x1a2f5d){return _0x1a2f5d['destroy']()['then'](function(){_0x3d70ef[_0x5933('0x1c')](0xcc)[_0x5933('0x1b')]();});}};}function handleEntityNotFound(_0x297b15,_0x56e8a9){return function(_0xd2320){if(!_0xd2320){_0x297b15[_0x5933('0x1a')](0x194);}return _0xd2320;};}function handleError(_0x2348bc,_0x5a0de4){_0x5a0de4=_0x5a0de4||0x1f4;return function(_0x1e24f6){logger[_0x5933('0x25')](_0x1e24f6['stack']);if(_0x1e24f6[_0x5933('0x26')]){delete _0x1e24f6[_0x5933('0x26')];}_0x2348bc['status'](_0x5a0de4)[_0x5933('0x27')](_0x1e24f6);};}exports['index']=function(_0x51dbae,_0x45039b){var _0x1af598={},_0x4adb80={},_0x255ed5={'count':0x0,'rows':[]};var _0x51e2d6=_[_0x5933('0x28')](db[_0x5933('0x29')]['rawAttributes'],function(_0x4fc086){return{'name':_0x4fc086['fieldName'],'type':_0x4fc086[_0x5933('0x2a')][_0x5933('0x2b')]};});_0x4adb80['model']=_[_0x5933('0x28')](_0x51e2d6,_0x5933('0x26'));_0x4adb80[_0x5933('0x2c')]=_[_0x5933('0x2d')](_0x51dbae['query']);_0x4adb80[_0x5933('0x2e')]=_['intersection'](_0x4adb80[_0x5933('0x2f')],_0x4adb80['query']);_0x1af598[_0x5933('0x30')]=_[_0x5933('0x31')](_0x4adb80[_0x5933('0x2f')],qs[_0x5933('0x32')](_0x51dbae['query'][_0x5933('0x32')]));_0x1af598[_0x5933('0x30')]=_0x1af598['attributes']['length']?_0x1af598[_0x5933('0x30')]:_0x4adb80['model'];if(!_0x51dbae['query'][_0x5933('0x33')](_0x5933('0x34'))){_0x1af598[_0x5933('0x20')]=qs[_0x5933('0x20')](_0x51dbae['query']['limit']);_0x1af598['offset']=qs['offset'](_0x51dbae[_0x5933('0x2c')]['offset']);}_0x1af598['order']=qs['sort'](_0x51dbae[_0x5933('0x2c')][_0x5933('0x35')]);_0x1af598[_0x5933('0x36')]=qs[_0x5933('0x2e')](_[_0x5933('0x37')](_0x51dbae[_0x5933('0x2c')],_0x4adb80[_0x5933('0x2e')]),_0x51e2d6);if(_0x51dbae[_0x5933('0x2c')][_0x5933('0x38')]){_0x1af598[_0x5933('0x36')]=_['merge'](_0x1af598[_0x5933('0x36')],{'$or':_[_0x5933('0x28')](_0x51e2d6,function(_0x6e2a66){if(_0x6e2a66[_0x5933('0x2a')]!==_0x5933('0x39')){var _0x2c1484={};_0x2c1484[_0x6e2a66[_0x5933('0x26')]]={'$like':'%'+_0x51dbae[_0x5933('0x2c')][_0x5933('0x38')]+'%'};return _0x2c1484;}})});}_0x1af598=_[_0x5933('0x3a')]({},_0x1af598,_0x51dbae['options']);var _0x5c2bd0={'where':_0x1af598[_0x5933('0x36')]};return db[_0x5933('0x29')][_0x5933('0x1f')](_0x5c2bd0)['then'](function(_0x5d07da){_0x255ed5[_0x5933('0x1f')]=_0x5d07da;if(_0x51dbae[_0x5933('0x2c')]['includeAll']){_0x1af598[_0x5933('0x3b')]=[{'all':!![]}];}return db[_0x5933('0x29')][_0x5933('0x3c')](_0x1af598);})[_0x5933('0x3d')](function(_0x192576){_0x255ed5[_0x5933('0x3e')]=_0x192576;return _0x255ed5;})['then'](respondWithFilteredResult(_0x45039b,_0x1af598))['catch'](handleError(_0x45039b,null));};exports[_0x5933('0x3f')]=function(_0x1aef52,_0x36d072){var _0x293845={'raw':!![],'where':{'id':_0x1aef52[_0x5933('0x40')]['id']}},_0x247c65={};_0x247c65['model']=_[_0x5933('0x2d')](db[_0x5933('0x29')][_0x5933('0x41')]);_0x247c65['query']=_[_0x5933('0x2d')](_0x1aef52[_0x5933('0x2c')]);_0x247c65[_0x5933('0x2e')]=_[_0x5933('0x31')](_0x247c65[_0x5933('0x2f')],_0x247c65[_0x5933('0x2c')]);_0x293845[_0x5933('0x30')]=_[_0x5933('0x31')](_0x247c65[_0x5933('0x2f')],qs[_0x5933('0x32')](_0x1aef52['query'][_0x5933('0x32')]));_0x293845['attributes']=_0x293845['attributes']['length']?_0x293845[_0x5933('0x30')]:_0x247c65['model'];if(_0x1aef52['query'][_0x5933('0x42')]){_0x293845[_0x5933('0x3b')]=[{'all':!![]}];}_0x293845=_['merge']({},_0x293845,_0x1aef52[_0x5933('0x43')]);return db['Cdr'][_0x5933('0x44')](_0x293845)[_0x5933('0x3d')](handleEntityNotFound(_0x36d072,null))['then'](respondWithResult(_0x36d072,null))['catch'](handleError(_0x36d072,null));};exports[_0x5933('0x45')]=function(_0x4622bd,_0x38e713){return db[_0x5933('0x29')][_0x5933('0x45')](_0x4622bd['body'],{})[_0x5933('0x3d')](respondWithResult(_0x38e713,0xc9))[_0x5933('0x46')](handleError(_0x38e713,null));};exports[_0x5933('0x47')]=function(_0x4c2e69,_0x2d5fd4){if(_0x4c2e69[_0x5933('0x48')]['id']){delete _0x4c2e69[_0x5933('0x48')]['id'];}return db[_0x5933('0x29')]['find']({'where':{'id':_0x4c2e69[_0x5933('0x40')]['id']}})[_0x5933('0x3d')](handleEntityNotFound(_0x2d5fd4,null))[_0x5933('0x3d')](saveUpdates(_0x4c2e69[_0x5933('0x48')],null))['then'](respondWithResult(_0x2d5fd4,null))[_0x5933('0x46')](handleError(_0x2d5fd4,null));};exports[_0x5933('0x49')]=function(_0x41be67,_0x38f681){return db[_0x5933('0x29')][_0x5933('0x44')]({'where':{'id':_0x41be67[_0x5933('0x40')]['id']}})[_0x5933('0x3d')](handleEntityNotFound(_0x38f681,null))[_0x5933('0x3d')](removeEntity(_0x38f681,null))[_0x5933('0x46')](handleError(_0x38f681,null));};exports['describe']=function(_0x3fdd78,_0x4d0bb8){return db[_0x5933('0x29')]['describe']()[_0x5933('0x3d')](respondWithResult(_0x4d0bb8,null))['catch'](handleError(_0x4d0bb8,null));};
\ No newline at end of file
index 68bebe9..ddeb379 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x292263,_0x389471){var _0xe8a919=function(_0x14ffeb){while(--_0x14ffeb){_0x292263['push'](_0x292263['shift']());}};_0xe8a919(++_0x389471);}(_0x7a54,0x106));var _0x47a5=function(_0x395e5b,_0x21b27a){_0x395e5b=_0x395e5b-0x0;var _0x528496=_0x7a54[_0x395e5b];return _0x528496;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x514bbf,_0x3c1c08){var _0x107ff5=function(_0x1a8376){while(--_0x1a8376){_0x514bbf['push'](_0x514bbf['shift']());}};_0x107ff5(++_0x3c1c08);}(_0x7a54,0x106));var _0x47a5=function(_0x35ed5b,_0x369c77){_0x35ed5b=_0x35ed5b-0x0;var _0x1a82a8=_0x7a54[_0x35ed5b];return _0x1a82a8;};'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 91634ff..1c3fa65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5061=['request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Cdr,\x20%s,\x20%s'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5061,0x151));var _0x1506=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x5061[_0x2555d0];return _0x3bb486;};'use strict';var _=require(_0x1506('0x0'));var util=require(_0x1506('0x1'));var moment=require(_0x1506('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1506('0x3'));var db=require(_0x1506('0x4'))['db'];var utils=require(_0x1506('0x5'));var logger=require(_0x1506('0x6'))(_0x1506('0x7'));var config=require(_0x1506('0x8'));var jayson=require(_0x1506('0x9'));var client=jayson[_0x1506('0xa')][_0x1506('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5636e2,_0x37a103,_0x4b570c){return new BPromise(function(_0x51fafa,_0x3c9ed1){return client[_0x1506('0xc')](_0x5636e2,_0x4b570c)[_0x1506('0xd')](function(_0x2acf89){logger['info'](_0x1506('0xe'),_0x37a103,_0x1506('0xf'));logger[_0x1506('0x10')](_0x1506('0x11'),_0x37a103,'request\x20sent',JSON['stringify'](_0x2acf89));if(_0x2acf89[_0x1506('0x12')]){if(_0x2acf89[_0x1506('0x12')][_0x1506('0x13')]===0x1f4){logger[_0x1506('0x12')]('Cdr,\x20%s,\x20%s',_0x37a103,_0x2acf89[_0x1506('0x12')][_0x1506('0x14')]);return _0x3c9ed1(_0x2acf89[_0x1506('0x12')][_0x1506('0x14')]);}logger[_0x1506('0x12')](_0x1506('0xe'),_0x37a103,_0x2acf89[_0x1506('0x12')][_0x1506('0x14')]);return _0x51fafa(_0x2acf89['error'][_0x1506('0x14')]);}else{logger[_0x1506('0x15')](_0x1506('0xe'),_0x37a103,_0x1506('0xf'));_0x51fafa(_0x2acf89['result'][_0x1506('0x14')]);}})['catch'](function(_0x233ff5){logger[_0x1506('0x12')](_0x1506('0xe'),_0x37a103,_0x233ff5);_0x3c9ed1(_0x233ff5);});});}
\ No newline at end of file
+var _0x6a42=['debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','request','Cdr,\x20%s,\x20%s'];(function(_0x5ad0d7,_0x2645f8){var _0xd83bd=function(_0x33d3bd){while(--_0x33d3bd){_0x5ad0d7['push'](_0x5ad0d7['shift']());}};_0xd83bd(++_0x2645f8);}(_0x6a42,0xcd));var _0x26a4=function(_0x2e0c8f,_0x45668a){_0x2e0c8f=_0x2e0c8f-0x0;var _0x4f4d4b=_0x6a42[_0x2e0c8f];return _0x4f4d4b;};'use strict';var _=require(_0x26a4('0x0'));var util=require(_0x26a4('0x1'));var moment=require('moment');var BPromise=require(_0x26a4('0x2'));var rs=require(_0x26a4('0x3'));var fs=require('fs');var Redis=require(_0x26a4('0x4'));var db=require(_0x26a4('0x5'))['db'];var utils=require(_0x26a4('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x26a4('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x26a4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26cd3f,_0x15a3fa,_0x4ed9d7){return new BPromise(function(_0x1ca4df,_0x3364ed){return client[_0x26a4('0x9')](_0x26cd3f,_0x4ed9d7)['then'](function(_0x52da13){logger['info'](_0x26a4('0xa'),_0x15a3fa,'request\x20sent');logger[_0x26a4('0xb')](_0x26a4('0xc'),_0x15a3fa,_0x26a4('0xd'),JSON[_0x26a4('0xe')](_0x52da13));if(_0x52da13['error']){if(_0x52da13[_0x26a4('0xf')][_0x26a4('0x10')]===0x1f4){logger[_0x26a4('0xf')](_0x26a4('0xa'),_0x15a3fa,_0x52da13[_0x26a4('0xf')][_0x26a4('0x11')]);return _0x3364ed(_0x52da13[_0x26a4('0xf')]['message']);}logger[_0x26a4('0xf')]('Cdr,\x20%s,\x20%s',_0x15a3fa,_0x52da13[_0x26a4('0xf')][_0x26a4('0x11')]);return _0x1ca4df(_0x52da13[_0x26a4('0xf')]['message']);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x15a3fa,_0x26a4('0xd'));_0x1ca4df(_0x52da13['result'][_0x26a4('0x11')]);}})['catch'](function(_0x547574){logger[_0x26a4('0xf')](_0x26a4('0xa'),_0x15a3fa,_0x547574);_0x3364ed(_0x547574);});});}
\ No newline at end of file
index f8c10bc..6f7f62a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x25257a,_0x48b74e){var _0x2ecfd7=function(_0x5a4452){while(--_0x5a4452){_0x25257a['push'](_0x25257a['shift']());}};_0x2ecfd7(++_0x48b74e);}(_0xb10b,0x12a));var _0xbb10=function(_0x150cc4,_0x15e9f1){_0x150cc4=_0x150cc4-0x0;var _0x22a995=_0xb10b[_0x150cc4];return _0x22a995;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
index b753ab5..1cee110 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbaa=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x87239,_0x38c793){var _0x53af1e=function(_0x11eb5f){while(--_0x11eb5f){_0x87239['push'](_0x87239['shift']());}};_0x53af1e(++_0x38c793);}(_0xdbaa,0xab));var _0xadba=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xdbaa[_0x87b0ff];return _0x3bc0b2;};'use strict';var Sequelize=require(_0xadba('0x0'));module[_0xadba('0x1')]={'priority':{'type':Sequelize[_0xadba('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xadba('0x3')],'allowNull':![],'defaultValue':_0xadba('0x4')},'appdata':{'type':Sequelize[_0xadba('0x5')]()},'description':{'type':Sequelize[_0xadba('0x3')]},'interval':{'type':Sequelize[_0xadba('0x3')],'defaultValue':_0xadba('0x6')}};
\ No newline at end of file
+var _0x521b=['noop','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x1158d5,_0x4e7ee8){var _0x3e9d61=function(_0x182cc7){while(--_0x182cc7){_0x1158d5['push'](_0x1158d5['shift']());}};_0x3e9d61(++_0x4e7ee8);}(_0x521b,0x117));var _0xb521=function(_0x488982,_0x3e260c){_0x488982=_0x488982-0x0;var _0xfe389c=_0x521b[_0x488982];return _0xfe389c;};'use strict';var Sequelize=require(_0xb521('0x0'));module[_0xb521('0x1')]={'priority':{'type':Sequelize[_0xb521('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb521('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xb521('0x4')]},'interval':{'type':Sequelize[_0xb521('0x4')],'defaultValue':_0xb521('0x5')}};
\ No newline at end of file
index ec638db..12ba339 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78f0=['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','offset','undefined','count','limit','set','apply','reject','save','update','then','error','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring'];(function(_0x90f4e5,_0x446d1e){var _0x4378d1=function(_0x24d1ed){while(--_0x24d1ed){_0x90f4e5['push'](_0x90f4e5['shift']());}};_0x4378d1(++_0x446d1e);}(_0x78f0,0x15d));var _0x078f=function(_0x13e922,_0x1fecb9){_0x13e922=_0x13e922-0x0;var _0x2c4846=_0x78f0[_0x13e922];return _0x2c4846;};'use strict';var emlformat=require(_0x078f('0x0'));var rimraf=require(_0x078f('0x1'));var zipdir=require(_0x078f('0x2'));var jsonpatch=require(_0x078f('0x3'));var rp=require(_0x078f('0x4'));var moment=require(_0x078f('0x5'));var BPromise=require(_0x078f('0x6'));var Mustache=require(_0x078f('0x7'));var util=require('util');var path=require(_0x078f('0x8'));var sox=require(_0x078f('0x9'));var csv=require(_0x078f('0xa'));var ejs=require(_0x078f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x078f('0xc'));var squel=require(_0x078f('0xd'));var crypto=require('crypto');var jsforce=require(_0x078f('0xe'));var deskjs=require(_0x078f('0xf'));var toCsv=require(_0x078f('0xa'));var querystring=require(_0x078f('0x10'));var Papa=require(_0x078f('0x11'));var Redis=require(_0x078f('0x12'));var authService=require(_0x078f('0x13'));var qs=require(_0x078f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x078f('0x15'));var logger=require(_0x078f('0x16'))('api');var utils=require(_0x078f('0x17'));var config=require(_0x078f('0x18'));var licenseUtil=require(_0x078f('0x19'));var db=require(_0x078f('0x1a'))['db'];function respondWithStatusCode(_0x5b6b5a,_0x5de876){_0x5de876=_0x5de876||0xcc;return function(_0xe740c0){if(_0xe740c0){return _0x5b6b5a[_0x078f('0x1b')](_0x5de876);}return _0x5b6b5a[_0x078f('0x1c')](_0x5de876)[_0x078f('0x1d')]();};}function respondWithResult(_0x5df646,_0x36670d){_0x36670d=_0x36670d||0xc8;return function(_0x2d29f8){if(_0x2d29f8){return _0x5df646['status'](_0x36670d)[_0x078f('0x1e')](_0x2d29f8);}};}function respondWithFilteredResult(_0x1a44f1,_0x21fc72){return function(_0x363dfd){if(_0x363dfd){var _0x247de9=typeof _0x21fc72[_0x078f('0x1f')]==='undefined'&&typeof _0x21fc72['limit']===_0x078f('0x20');var _0x1e32c0=_0x363dfd[_0x078f('0x21')];var _0x19a182=_0x247de9?0x0:_0x21fc72[_0x078f('0x1f')];var _0x25bb2d=_0x247de9?_0x363dfd[_0x078f('0x21')]:_0x21fc72[_0x078f('0x1f')]+_0x21fc72[_0x078f('0x22')];var _0x276442;if(_0x25bb2d>=_0x1e32c0){_0x25bb2d=_0x1e32c0;_0x276442=0xc8;}else{_0x276442=0xce;}_0x1a44f1[_0x078f('0x1c')](_0x276442);return _0x1a44f1[_0x078f('0x23')]('Content-Range',_0x19a182+'-'+_0x25bb2d+'/'+_0x1e32c0)[_0x078f('0x1e')](_0x363dfd);}return null;};}function patchUpdates(_0x52c74f){return function(_0x567d26){try{jsonpatch[_0x078f('0x24')](_0x567d26,_0x52c74f,!![]);}catch(_0x3c70c2){return BPromise[_0x078f('0x25')](_0x3c70c2);}return _0x567d26[_0x078f('0x26')]();};}function saveUpdates(_0x712d52,_0x2c6db4){return function(_0x104eeb){if(_0x104eeb){return _0x104eeb[_0x078f('0x27')](_0x712d52)[_0x078f('0x28')](function(_0x4b8d12){return _0x4b8d12;});}return null;};}function removeEntity(_0x1f6b98,_0x14ad5c){return function(_0x363cce){if(_0x363cce){return _0x363cce['destroy']()['then'](function(){_0x1f6b98[_0x078f('0x1c')](0xcc)[_0x078f('0x1d')]();});}};}function handleEntityNotFound(_0x3d9d08,_0x240fb4){return function(_0x25fe4f){if(!_0x25fe4f){_0x3d9d08[_0x078f('0x1b')](0x194);}return _0x25fe4f;};}function handleError(_0x186fe3,_0x4e738b){_0x4e738b=_0x4e738b||0x1f4;return function(_0x1f6596){logger[_0x078f('0x29')](_0x1f6596['stack']);if(_0x1f6596[_0x078f('0x2a')]){delete _0x1f6596[_0x078f('0x2a')];}_0x186fe3[_0x078f('0x1c')](_0x4e738b)[_0x078f('0x2b')](_0x1f6596);};}exports[_0x078f('0x2c')]=function(_0xd57307,_0x1a8530){var _0xe41e2e={'raw':!![],'where':{'id':_0xd57307[_0x078f('0x2d')]['id']}},_0x1f0ad6={};_0x1f0ad6[_0x078f('0x2e')]=_[_0x078f('0x2f')](db[_0x078f('0x30')][_0x078f('0x31')]);_0x1f0ad6[_0x078f('0x32')]=_[_0x078f('0x2f')](_0xd57307[_0x078f('0x32')]);_0x1f0ad6[_0x078f('0x33')]=_['intersection'](_0x1f0ad6[_0x078f('0x2e')],_0x1f0ad6['query']);_0xe41e2e['attributes']=_[_0x078f('0x34')](_0x1f0ad6[_0x078f('0x2e')],qs[_0x078f('0x35')](_0xd57307[_0x078f('0x32')]['fields']));_0xe41e2e[_0x078f('0x36')]=_0xe41e2e[_0x078f('0x36')][_0x078f('0x37')]?_0xe41e2e[_0x078f('0x36')]:_0x1f0ad6[_0x078f('0x2e')];if(_0xd57307['query'][_0x078f('0x38')]){_0xe41e2e[_0x078f('0x39')]=[{'all':!![]}];}_0xe41e2e=_['merge']({},_0xe41e2e,_0xd57307['options']);return db[_0x078f('0x30')][_0x078f('0x3a')](_0xe41e2e)['then'](handleEntityNotFound(_0x1a8530,null))[_0x078f('0x28')](respondWithResult(_0x1a8530,null))[_0x078f('0x3b')](handleError(_0x1a8530,null));};exports[_0x078f('0x27')]=function(_0x5165e4,_0x2dfad1){if(_0x5165e4[_0x078f('0x3c')]['id']){delete _0x5165e4[_0x078f('0x3c')]['id'];}return db[_0x078f('0x30')][_0x078f('0x3a')]({'where':{'id':_0x5165e4[_0x078f('0x2d')]['id']}})['then'](handleEntityNotFound(_0x2dfad1,null))[_0x078f('0x28')](saveUpdates(_0x5165e4[_0x078f('0x3c')],null))[_0x078f('0x28')](respondWithResult(_0x2dfad1,null))[_0x078f('0x3b')](handleError(_0x2dfad1,null));};exports['destroy']=function(_0x474a46,_0x2b1e0f){return db[_0x078f('0x30')][_0x078f('0x3a')]({'where':{'id':_0x474a46[_0x078f('0x2d')]['id']}})[_0x078f('0x28')](handleEntityNotFound(_0x2b1e0f,null))[_0x078f('0x28')](removeEntity(_0x2b1e0f,null))[_0x078f('0x3b')](handleError(_0x2b1e0f,null));};
\ No newline at end of file
+var _0x44f8=['attributes','length','includeAll','include','merge','options','find','body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','count','set','Content-Range','update','then','end','sendStatus','error','stack','name','send','show','params','model','ChatApplication','query','keys','intersection','fields'];(function(_0x2883f9,_0x1c48a3){var _0x756f64=function(_0x32bcee){while(--_0x32bcee){_0x2883f9['push'](_0x2883f9['shift']());}};_0x756f64(++_0x1c48a3);}(_0x44f8,0x1de));var _0x844f=function(_0x184f4f,_0x57977f){_0x184f4f=_0x184f4f-0x0;var _0x2d7a36=_0x44f8[_0x184f4f];return _0x2d7a36;};'use strict';var emlformat=require(_0x844f('0x0'));var rimraf=require(_0x844f('0x1'));var zipdir=require(_0x844f('0x2'));var jsonpatch=require(_0x844f('0x3'));var rp=require(_0x844f('0x4'));var moment=require(_0x844f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x844f('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x844f('0x7'));var fs=require('fs');var fs_extra=require(_0x844f('0x8'));var _=require(_0x844f('0x9'));var squel=require(_0x844f('0xa'));var crypto=require(_0x844f('0xb'));var jsforce=require(_0x844f('0xc'));var deskjs=require(_0x844f('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x844f('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x844f('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x844f('0x10'));var config=require(_0x844f('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x844f('0x12'))['db'];function respondWithStatusCode(_0x110dc2,_0x2320fc){_0x2320fc=_0x2320fc||0xcc;return function(_0x5ea542){if(_0x5ea542){return _0x110dc2['sendStatus'](_0x2320fc);}return _0x110dc2[_0x844f('0x13')](_0x2320fc)['end']();};}function respondWithResult(_0x3137c1,_0x31a0d9){_0x31a0d9=_0x31a0d9||0xc8;return function(_0x449887){if(_0x449887){return _0x3137c1[_0x844f('0x13')](_0x31a0d9)[_0x844f('0x14')](_0x449887);}};}function respondWithFilteredResult(_0x486fa0,_0x5da4ab){return function(_0x1b04a9){if(_0x1b04a9){var _0x149f21=typeof _0x5da4ab[_0x844f('0x15')]===_0x844f('0x16')&&typeof _0x5da4ab['limit']===_0x844f('0x16');var _0x547881=_0x1b04a9['count'];var _0x1f96d0=_0x149f21?0x0:_0x5da4ab[_0x844f('0x15')];var _0x5cc55c=_0x149f21?_0x1b04a9[_0x844f('0x17')]:_0x5da4ab['offset']+_0x5da4ab['limit'];var _0x31431e;if(_0x5cc55c>=_0x547881){_0x5cc55c=_0x547881;_0x31431e=0xc8;}else{_0x31431e=0xce;}_0x486fa0['status'](_0x31431e);return _0x486fa0[_0x844f('0x18')](_0x844f('0x19'),_0x1f96d0+'-'+_0x5cc55c+'/'+_0x547881)[_0x844f('0x14')](_0x1b04a9);}return null;};}function patchUpdates(_0x38e732){return function(_0x3f5060){try{jsonpatch['apply'](_0x3f5060,_0x38e732,!![]);}catch(_0x270be6){return BPromise['reject'](_0x270be6);}return _0x3f5060['save']();};}function saveUpdates(_0x3f83cd,_0x4261b6){return function(_0x1b2037){if(_0x1b2037){return _0x1b2037[_0x844f('0x1a')](_0x3f83cd)[_0x844f('0x1b')](function(_0x523f49){return _0x523f49;});}return null;};}function removeEntity(_0x189523,_0x4bd66d){return function(_0x22c055){if(_0x22c055){return _0x22c055['destroy']()[_0x844f('0x1b')](function(){_0x189523[_0x844f('0x13')](0xcc)[_0x844f('0x1c')]();});}};}function handleEntityNotFound(_0x7dc0c9,_0x46bf96){return function(_0x1e66c0){if(!_0x1e66c0){_0x7dc0c9[_0x844f('0x1d')](0x194);}return _0x1e66c0;};}function handleError(_0x5c9892,_0xba1365){_0xba1365=_0xba1365||0x1f4;return function(_0x16d7ad){logger[_0x844f('0x1e')](_0x16d7ad[_0x844f('0x1f')]);if(_0x16d7ad[_0x844f('0x20')]){delete _0x16d7ad[_0x844f('0x20')];}_0x5c9892['status'](_0xba1365)[_0x844f('0x21')](_0x16d7ad);};}exports[_0x844f('0x22')]=function(_0x3f62f1,_0x4d3abd){var _0x520102={'raw':!![],'where':{'id':_0x3f62f1[_0x844f('0x23')]['id']}},_0x1e243c={};_0x1e243c[_0x844f('0x24')]=_['keys'](db[_0x844f('0x25')]['rawAttributes']);_0x1e243c[_0x844f('0x26')]=_[_0x844f('0x27')](_0x3f62f1['query']);_0x1e243c['filters']=_[_0x844f('0x28')](_0x1e243c[_0x844f('0x24')],_0x1e243c['query']);_0x520102['attributes']=_[_0x844f('0x28')](_0x1e243c[_0x844f('0x24')],qs[_0x844f('0x29')](_0x3f62f1['query'][_0x844f('0x29')]));_0x520102[_0x844f('0x2a')]=_0x520102[_0x844f('0x2a')][_0x844f('0x2b')]?_0x520102['attributes']:_0x1e243c[_0x844f('0x24')];if(_0x3f62f1[_0x844f('0x26')][_0x844f('0x2c')]){_0x520102[_0x844f('0x2d')]=[{'all':!![]}];}_0x520102=_[_0x844f('0x2e')]({},_0x520102,_0x3f62f1[_0x844f('0x2f')]);return db[_0x844f('0x25')][_0x844f('0x30')](_0x520102)['then'](handleEntityNotFound(_0x4d3abd,null))[_0x844f('0x1b')](respondWithResult(_0x4d3abd,null))['catch'](handleError(_0x4d3abd,null));};exports[_0x844f('0x1a')]=function(_0x1e1213,_0x175071){if(_0x1e1213[_0x844f('0x31')]['id']){delete _0x1e1213['body']['id'];}return db[_0x844f('0x25')][_0x844f('0x30')]({'where':{'id':_0x1e1213['params']['id']}})[_0x844f('0x1b')](handleEntityNotFound(_0x175071,null))[_0x844f('0x1b')](saveUpdates(_0x1e1213[_0x844f('0x31')],null))[_0x844f('0x1b')](respondWithResult(_0x175071,null))[_0x844f('0x32')](handleError(_0x175071,null));};exports[_0x844f('0x33')]=function(_0x5900ab,_0x3592d9){return db['ChatApplication']['find']({'where':{'id':_0x5900ab[_0x844f('0x23')]['id']}})['then'](handleEntityNotFound(_0x3592d9,null))[_0x844f('0x1b')](removeEntity(_0x3592d9,null))[_0x844f('0x32')](handleError(_0x3592d9,null));};
\ No newline at end of file
index 58994a0..a7096f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x095f=['./chatApplication.attributes','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xb5114d,_0x4f6b9e){var _0x50895b=function(_0x48055a){while(--_0x48055a){_0xb5114d['push'](_0xb5114d['shift']());}};_0x50895b(++_0x4f6b9e);}(_0x095f,0x8c));var _0xf095=function(_0x23b29c,_0x8358ae){_0x23b29c=_0x23b29c-0x0;var _0x4b22e1=_0x095f[_0x23b29c];return _0x4b22e1;};'use strict';var _=require(_0xf095('0x0'));var util=require(_0xf095('0x1'));var logger=require(_0xf095('0x2'))(_0xf095('0x3'));var moment=require(_0xf095('0x4'));var BPromise=require(_0xf095('0x5'));var rp=require(_0xf095('0x6'));var fs=require('fs');var path=require(_0xf095('0x7'));var rimraf=require(_0xf095('0x8'));var config=require(_0xf095('0x9'));var attributes=require(_0xf095('0xa'));module['exports']=function(_0x52aa40,_0x28c17e){return _0x52aa40['define'](_0xf095('0xb'),attributes,{'tableName':_0xf095('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf095('0xd'),'collate':_0xf095('0xe')});};
\ No newline at end of file
+var _0x8aac=['ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatApplication.attributes','exports'];(function(_0x16b334,_0x58bd7f){var _0x54aff2=function(_0x366b0e){while(--_0x366b0e){_0x16b334['push'](_0x16b334['shift']());}};_0x54aff2(++_0x58bd7f);}(_0x8aac,0x11c));var _0xc8aa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8aac[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc8aa('0x0'));var util=require('util');var logger=require(_0xc8aa('0x1'))(_0xc8aa('0x2'));var moment=require(_0xc8aa('0x3'));var BPromise=require(_0xc8aa('0x4'));var rp=require(_0xc8aa('0x5'));var fs=require('fs');var path=require(_0xc8aa('0x6'));var rimraf=require(_0xc8aa('0x7'));var config=require('../../config/environment');var attributes=require(_0xc8aa('0x8'));module[_0xc8aa('0x9')]=function(_0x2f28e0,_0x57bd5e){return _0x2f28e0['define'](_0xc8aa('0xa'),attributes,{'tableName':_0xc8aa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc8aa('0xc'),'collate':_0xc8aa('0xd')});};
\ No newline at end of file
index 086b794..2536b94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58d8=['result','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','ChatApplication,\x20%s,\x20%s','message'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x58d8,0xec));var _0x858d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x58d8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x858d('0x0'));var util=require(_0x858d('0x1'));var moment=require('moment');var BPromise=require(_0x858d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x858d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x858d('0x4'))(_0x858d('0x5'));var config=require('../../config/environment');var jayson=require(_0x858d('0x6'));var client=jayson[_0x858d('0x7')][_0x858d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2bad36,_0x4d2989,_0x19e043){return new BPromise(function(_0x94851d,_0x3545bc){return client['request'](_0x2bad36,_0x19e043)['then'](function(_0x3552ce){logger[_0x858d('0x9')]('ChatApplication,\x20%s,\x20%s',_0x4d2989,_0x858d('0xa'));logger['debug'](_0x858d('0xb'),_0x4d2989,_0x858d('0xa'),JSON[_0x858d('0xc')](_0x3552ce));if(_0x3552ce[_0x858d('0xd')]){if(_0x3552ce['error']['code']===0x1f4){logger['error'](_0x858d('0xe'),_0x4d2989,_0x3552ce['error'][_0x858d('0xf')]);return _0x3545bc(_0x3552ce[_0x858d('0xd')][_0x858d('0xf')]);}logger[_0x858d('0xd')](_0x858d('0xe'),_0x4d2989,_0x3552ce[_0x858d('0xd')]['message']);return _0x94851d(_0x3552ce[_0x858d('0xd')][_0x858d('0xf')]);}else{logger['info'](_0x858d('0xe'),_0x4d2989,_0x858d('0xa'));_0x94851d(_0x3552ce[_0x858d('0x10')]['message']);}})[_0x858d('0x11')](function(_0x2b9e1d){logger[_0x858d('0xd')](_0x858d('0xe'),_0x4d2989,_0x2b9e1d);_0x3545bc(_0x2b9e1d);});});}
\ No newline at end of file
+var _0xa9fa=['../../config/utils','../../config/logger','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring'];(function(_0x6841b,_0xf789e4){var _0x407e81=function(_0x76278f){while(--_0x76278f){_0x6841b['push'](_0x6841b['shift']());}};_0x407e81(++_0xf789e4);}(_0xa9fa,0x1dc));var _0xaa9f=function(_0x189794,_0x3ed84c){_0x189794=_0x189794-0x0;var _0x4bacad=_0xa9fa[_0x189794];return _0x4bacad;};'use strict';var _=require(_0xaa9f('0x0'));var util=require(_0xaa9f('0x1'));var moment=require(_0xaa9f('0x2'));var BPromise=require('bluebird');var rs=require(_0xaa9f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaa9f('0x4'));var logger=require(_0xaa9f('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xaa9f('0x6'));var client=jayson[_0xaa9f('0x7')][_0xaa9f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x98797c,_0x173087,_0x1aed44){return new BPromise(function(_0x549c3a,_0x7191e3){return client[_0xaa9f('0x9')](_0x98797c,_0x1aed44)[_0xaa9f('0xa')](function(_0x1ea6ce){logger['info'](_0xaa9f('0xb'),_0x173087,_0xaa9f('0xc'));logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x173087,_0xaa9f('0xc'),JSON[_0xaa9f('0xd')](_0x1ea6ce));if(_0x1ea6ce[_0xaa9f('0xe')]){if(_0x1ea6ce[_0xaa9f('0xe')][_0xaa9f('0xf')]===0x1f4){logger[_0xaa9f('0xe')](_0xaa9f('0xb'),_0x173087,_0x1ea6ce[_0xaa9f('0xe')][_0xaa9f('0x10')]);return _0x7191e3(_0x1ea6ce[_0xaa9f('0xe')][_0xaa9f('0x10')]);}logger[_0xaa9f('0xe')](_0xaa9f('0xb'),_0x173087,_0x1ea6ce[_0xaa9f('0xe')]['message']);return _0x549c3a(_0x1ea6ce['error']['message']);}else{logger[_0xaa9f('0x11')](_0xaa9f('0xb'),_0x173087,_0xaa9f('0xc'));_0x549c3a(_0x1ea6ce[_0xaa9f('0x12')]['message']);}})[_0xaa9f('0x13')](function(_0x5924fa){logger['error'](_0xaa9f('0xb'),_0x173087,_0x5924fa);_0x7191e3(_0x5924fa);});});}
\ No newline at end of file
index 5d51113..2e047ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc96a=['delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated'];(function(_0x52419c,_0x2a9043){var _0x560902=function(_0x4df864){while(--_0x4df864){_0x52419c['push'](_0x52419c['shift']());}};_0x560902(++_0x2a9043);}(_0xc96a,0xd3));var _0xac96=function(_0x725a4c,_0x102507){_0x725a4c=_0x725a4c-0x0;var _0x37b2cc=_0xc96a[_0x725a4c];return _0x37b2cc;};'use strict';var multer=require('multer');var util=require(_0xac96('0x0'));var path=require(_0xac96('0x1'));var timeout=require(_0xac96('0x2'));var express=require(_0xac96('0x3'));var router=express['Router']();var fs_extra=require(_0xac96('0x4'));var auth=require(_0xac96('0x5'));var interaction=require(_0xac96('0x6'));var config=require(_0xac96('0x7'));var controller=require('./chatApplication.controller');router['get'](_0xac96('0x8'),auth['isAuthenticated'](),controller['show']);router['put'](_0xac96('0x8'),auth[_0xac96('0x9')](),controller['update']);router[_0xac96('0xa')](_0xac96('0x8'),auth[_0xac96('0x9')](),controller[_0xac96('0xb')]);module[_0xac96('0xc')]=router;
\ No newline at end of file
+var _0xa7b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','destroy','exports','multer','util','connect-timeout','express'];(function(_0x40f1e7,_0x5d3cb0){var _0x8ad80f=function(_0x44d776){while(--_0x44d776){_0x40f1e7['push'](_0x40f1e7['shift']());}};_0x8ad80f(++_0x5d3cb0);}(_0xa7b0,0x8c));var _0x0a7b=function(_0x4fdc46,_0x2a3759){_0x4fdc46=_0x4fdc46-0x0;var _0x2c178a=_0xa7b0[_0x4fdc46];return _0x2c178a;};'use strict';var multer=require(_0x0a7b('0x0'));var util=require(_0x0a7b('0x1'));var path=require('path');var timeout=require(_0x0a7b('0x2'));var express=require(_0x0a7b('0x3'));var router=express[_0x0a7b('0x4')]();var fs_extra=require(_0x0a7b('0x5'));var auth=require(_0x0a7b('0x6'));var interaction=require(_0x0a7b('0x7'));var config=require(_0x0a7b('0x8'));var controller=require(_0x0a7b('0x9'));router[_0x0a7b('0xa')](_0x0a7b('0xb'),auth[_0x0a7b('0xc')](),controller[_0x0a7b('0xd')]);router[_0x0a7b('0xe')](_0x0a7b('0xb'),auth[_0x0a7b('0xc')](),controller[_0x0a7b('0xf')]);router['delete'](_0x0a7b('0xb'),auth[_0x0a7b('0xc')](),controller[_0x0a7b('0x10')]);module[_0x0a7b('0x11')]=router;
\ No newline at end of file
index 9d4e258..748c4d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf771=['STRING','BOOLEAN','sequelize','exports'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xf771,0x8e));var _0x1f77=function(_0x7739fc,_0x5e7aad){_0x7739fc=_0x7739fc-0x0;var _0x3d51e8=_0xf771[_0x7739fc];return _0x3d51e8;};'use strict';var Sequelize=require(_0x1f77('0x0'));module[_0x1f77('0x1')]={'name':{'type':Sequelize[_0x1f77('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1f77('0x2')]},'write':{'type':Sequelize[_0x1f77('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x1fa9=['BOOLEAN','sequelize','STRING'];(function(_0x2e986d,_0x4b6b63){var _0x351c79=function(_0xf178c7){while(--_0xf178c7){_0x2e986d['push'](_0x2e986d['shift']());}};_0x351c79(++_0x4b6b63);}(_0x1fa9,0x136));var _0x91fa=function(_0x5b9fe9,_0x1877b2){_0x5b9fe9=_0x5b9fe9-0x0;var _0x2e6e69=_0x1fa9[_0x5b9fe9];return _0x2e6e69;};'use strict';var Sequelize=require(_0x91fa('0x0'));module['exports']={'name':{'type':Sequelize[_0x91fa('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x91fa('0x2')],'defaultValue':!![]}};
\ No newline at end of file
index 5b18e37..51044e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x472c=['addMembers','omit','ids','getMembers','findOne','hasOwnProperty','removeMembers','addMessage','ChatGroupId','$gte','split','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','error','name','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','ChatGroup','findAll','rows','catch','show','params','include','options','find','create','body','destroy','describe','getUnread','ChatInternalMessage','toInteger'];(function(_0x270fb7,_0x4b26a7){var _0x586847=function(_0x3d852c){while(--_0x3d852c){_0x270fb7['push'](_0x270fb7['shift']());}};_0x586847(++_0x4b26a7);}(_0x472c,0x11c));var _0xc472=function(_0x4b9a61,_0x1e0f82){_0x4b9a61=_0x4b9a61-0x0;var _0x591643=_0x472c[_0x4b9a61];return _0x591643;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc472('0x0'));var zipdir=require(_0xc472('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc472('0x2'));var moment=require('moment');var BPromise=require(_0xc472('0x3'));var Mustache=require(_0xc472('0x4'));var util=require(_0xc472('0x5'));var path=require(_0xc472('0x6'));var sox=require(_0xc472('0x7'));var csv=require(_0xc472('0x8'));var ejs=require(_0xc472('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc472('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc472('0xb'));var deskjs=require(_0xc472('0xc'));var toCsv=require(_0xc472('0x8'));var querystring=require(_0xc472('0xd'));var Papa=require(_0xc472('0xe'));var Redis=require(_0xc472('0xf'));var authService=require(_0xc472('0x10'));var qs=require(_0xc472('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc472('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xc472('0x13'));var config=require(_0xc472('0x14'));var licenseUtil=require(_0xc472('0x15'));var db=require(_0xc472('0x16'))['db'];config[_0xc472('0x17')]=_[_0xc472('0x18')](config[_0xc472('0x17')],{'host':_0xc472('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc472('0x1a'))[_0xc472('0x1b')](socket);function respondWithStatusCode(_0x474da0,_0x22adfe){_0x22adfe=_0x22adfe||0xcc;return function(_0x1fc9bf){if(_0x1fc9bf){return _0x474da0[_0xc472('0x1c')](_0x22adfe);}return _0x474da0[_0xc472('0x1d')](_0x22adfe)[_0xc472('0x1e')]();};}function respondWithResult(_0x32e96d,_0x195513){_0x195513=_0x195513||0xc8;return function(_0x1bb615){if(_0x1bb615){return _0x32e96d[_0xc472('0x1d')](_0x195513)[_0xc472('0x1f')](_0x1bb615);}};}function respondWithFilteredResult(_0x5c09a7,_0x8fe7ee){return function(_0x22207e){if(_0x22207e){var _0x5ee51b=typeof _0x8fe7ee[_0xc472('0x20')]===_0xc472('0x21')&&typeof _0x8fe7ee[_0xc472('0x22')]===_0xc472('0x21');var _0x5d8ce9=_0x22207e[_0xc472('0x23')];var _0x3e45b9=_0x5ee51b?0x0:_0x8fe7ee[_0xc472('0x20')];var _0x104ddf=_0x5ee51b?_0x22207e[_0xc472('0x23')]:_0x8fe7ee[_0xc472('0x20')]+_0x8fe7ee['limit'];var _0x39c76b;if(_0x104ddf>=_0x5d8ce9){_0x104ddf=_0x5d8ce9;_0x39c76b=0xc8;}else{_0x39c76b=0xce;}_0x5c09a7['status'](_0x39c76b);return _0x5c09a7['set']('Content-Range',_0x3e45b9+'-'+_0x104ddf+'/'+_0x5d8ce9)[_0xc472('0x1f')](_0x22207e);}return null;};}function patchUpdates(_0x3a19b5){return function(_0xfe15b1){try{jsonpatch[_0xc472('0x24')](_0xfe15b1,_0x3a19b5,!![]);}catch(_0x150280){return BPromise[_0xc472('0x25')](_0x150280);}return _0xfe15b1[_0xc472('0x26')]();};}function saveUpdates(_0x3aeb30,_0x10f2c0){return function(_0x598313){if(_0x598313){return _0x598313[_0xc472('0x27')](_0x3aeb30)[_0xc472('0x28')](function(_0x18530b){return _0x18530b;});}return null;};}function removeEntity(_0x369f23,_0x2f8961){return function(_0x5c3573){if(_0x5c3573){return _0x5c3573['destroy']()[_0xc472('0x28')](function(){_0x369f23[_0xc472('0x1d')](0xcc)[_0xc472('0x1e')]();});}};}function handleEntityNotFound(_0x52869c,_0x200aab){return function(_0xf227cf){if(!_0xf227cf){_0x52869c[_0xc472('0x1c')](0x194);}return _0xf227cf;};}function handleError(_0x377e5c,_0x289a43){_0x289a43=_0x289a43||0x1f4;return function(_0x22521b){logger[_0xc472('0x29')](_0x22521b['stack']);if(_0x22521b[_0xc472('0x2a')]){delete _0x22521b[_0xc472('0x2a')];}_0x377e5c['status'](_0x289a43)['send'](_0x22521b);};}exports[_0xc472('0x2b')]=function(_0x4bc370,_0x2c2a54){var _0x3740af={},_0x5f532e={},_0x373e8a={'count':0x0,'rows':[]};var _0x531617=_[_0xc472('0x2c')](db['ChatGroup'][_0xc472('0x2d')],function(_0x4dd5ab){return{'name':_0x4dd5ab[_0xc472('0x2e')],'type':_0x4dd5ab['type'][_0xc472('0x2f')]};});_0x5f532e[_0xc472('0x30')]=_[_0xc472('0x2c')](_0x531617,'name');_0x5f532e['query']=_[_0xc472('0x31')](_0x4bc370[_0xc472('0x32')]);_0x5f532e['filters']=_[_0xc472('0x33')](_0x5f532e[_0xc472('0x30')],_0x5f532e['query']);_0x3740af['attributes']=_[_0xc472('0x33')](_0x5f532e['model'],qs[_0xc472('0x34')](_0x4bc370['query']['fields']));_0x3740af[_0xc472('0x35')]=_0x3740af[_0xc472('0x35')][_0xc472('0x36')]?_0x3740af[_0xc472('0x35')]:_0x5f532e[_0xc472('0x30')];if(!_0x4bc370['query']['hasOwnProperty'](_0xc472('0x37'))){_0x3740af[_0xc472('0x22')]=qs[_0xc472('0x22')](_0x4bc370[_0xc472('0x32')][_0xc472('0x22')]);_0x3740af['offset']=qs[_0xc472('0x20')](_0x4bc370[_0xc472('0x32')][_0xc472('0x20')]);}_0x3740af[_0xc472('0x38')]=qs[_0xc472('0x39')](_0x4bc370[_0xc472('0x32')][_0xc472('0x39')]);_0x3740af[_0xc472('0x3a')]=qs['filters'](_[_0xc472('0x3b')](_0x4bc370[_0xc472('0x32')],_0x5f532e[_0xc472('0x3c')]),_0x531617);if(_0x4bc370['query'][_0xc472('0x3d')]){_0x3740af[_0xc472('0x3a')]=_[_0xc472('0x3e')](_0x3740af['where'],{'$or':_[_0xc472('0x2c')](_0x531617,function(_0x5bd786){if(_0x5bd786['type']!==_0xc472('0x3f')){var _0x8c5d44={};_0x8c5d44[_0x5bd786[_0xc472('0x2a')]]={'$like':'%'+_0x4bc370[_0xc472('0x32')]['filter']+'%'};return _0x8c5d44;}})});}_0x3740af=_[_0xc472('0x3e')]({},_0x3740af,_0x4bc370['options']);var _0x37e42e={'where':_0x3740af['where']};return db[_0xc472('0x40')][_0xc472('0x23')](_0x37e42e)['then'](function(_0x2fca49){_0x373e8a[_0xc472('0x23')]=_0x2fca49;if(_0x4bc370['query']['includeAll']){_0x3740af['include']=[{'all':!![]}];}return db['ChatGroup'][_0xc472('0x41')](_0x3740af);})['then'](function(_0x246f4d){_0x373e8a[_0xc472('0x42')]=_0x246f4d;return _0x373e8a;})[_0xc472('0x28')](respondWithFilteredResult(_0x2c2a54,_0x3740af))[_0xc472('0x43')](handleError(_0x2c2a54,null));};exports[_0xc472('0x44')]=function(_0xb4bfb1,_0x25715e){var _0x400977={'raw':!![],'where':{'id':_0xb4bfb1[_0xc472('0x45')]['id']}},_0x79df3f={};_0x79df3f[_0xc472('0x30')]=_[_0xc472('0x31')](db['ChatGroup'][_0xc472('0x2d')]);_0x79df3f[_0xc472('0x32')]=_['keys'](_0xb4bfb1[_0xc472('0x32')]);_0x79df3f[_0xc472('0x3c')]=_['intersection'](_0x79df3f[_0xc472('0x30')],_0x79df3f['query']);_0x400977[_0xc472('0x35')]=_[_0xc472('0x33')](_0x79df3f[_0xc472('0x30')],qs[_0xc472('0x34')](_0xb4bfb1[_0xc472('0x32')]['fields']));_0x400977['attributes']=_0x400977[_0xc472('0x35')][_0xc472('0x36')]?_0x400977['attributes']:_0x79df3f[_0xc472('0x30')];if(_0xb4bfb1[_0xc472('0x32')]['includeAll']){_0x400977[_0xc472('0x46')]=[{'all':!![]}];}_0x400977=_[_0xc472('0x3e')]({},_0x400977,_0xb4bfb1[_0xc472('0x47')]);return db['ChatGroup'][_0xc472('0x48')](_0x400977)['then'](handleEntityNotFound(_0x25715e,null))[_0xc472('0x28')](respondWithResult(_0x25715e,null))[_0xc472('0x43')](handleError(_0x25715e,null));};exports[_0xc472('0x49')]=function(_0x66c79,_0x206c7d){return db[_0xc472('0x40')]['create'](_0x66c79[_0xc472('0x4a')],{})[_0xc472('0x28')](respondWithResult(_0x206c7d,0xc9))[_0xc472('0x43')](handleError(_0x206c7d,null));};exports['update']=function(_0x4ee2d0,_0x120428){if(_0x4ee2d0[_0xc472('0x4a')]['id']){delete _0x4ee2d0['body']['id'];}return db[_0xc472('0x40')][_0xc472('0x48')]({'where':{'id':_0x4ee2d0[_0xc472('0x45')]['id']}})[_0xc472('0x28')](handleEntityNotFound(_0x120428,null))[_0xc472('0x28')](saveUpdates(_0x4ee2d0[_0xc472('0x4a')],null))['then'](respondWithResult(_0x120428,null))[_0xc472('0x43')](handleError(_0x120428,null));};exports[_0xc472('0x4b')]=function(_0x22b542,_0x335a7e){return db[_0xc472('0x40')][_0xc472('0x48')]({'where':{'id':_0x22b542[_0xc472('0x45')]['id']}})[_0xc472('0x28')](handleEntityNotFound(_0x335a7e,null))[_0xc472('0x28')](removeEntity(_0x335a7e,null))[_0xc472('0x43')](handleError(_0x335a7e,null));};exports['describe']=function(_0x5c23c3,_0x3d088f){return db[_0xc472('0x40')][_0xc472('0x4c')]()[_0xc472('0x28')](respondWithResult(_0x3d088f,null))[_0xc472('0x43')](handleError(_0x3d088f,null));};exports[_0xc472('0x4d')]=function(_0x40f1a5,_0x2e3f09,_0x5108de){return db[_0xc472('0x4e')][_0xc472('0x23')]({'where':{'ChatGroupId':_0x40f1a5['params']['id'],'ToId':_0x40f1a5['user']['id'],'read':![]}})[_0xc472('0x28')](function(_0x10855b){return{'id':_[_0xc472('0x4f')](_0x40f1a5[_0xc472('0x45')]['id']),'count':_0x10855b};})[_0xc472('0x28')](respondWithResult(_0x2e3f09,null))[_0xc472('0x43')](handleError(_0x2e3f09,null));};exports[_0xc472('0x50')]=function(_0x33d3d6,_0x514410,_0x4c1cae){return db[_0xc472('0x40')]['find']({'where':{'id':_0x33d3d6[_0xc472('0x45')]['id']}})[_0xc472('0x28')](handleEntityNotFound(_0x514410,null))['then'](function(_0x507484){if(_0x507484){return _0x507484[_0xc472('0x50')](_0x33d3d6[_0xc472('0x4a')]['ids'],_[_0xc472('0x51')](_0x33d3d6[_0xc472('0x4a')],[_0xc472('0x52'),'id'])||{});}})[_0xc472('0x28')](respondWithResult(_0x514410,null))['catch'](handleError(_0x514410,null));};exports[_0xc472('0x53')]=function(_0x56d091,_0xf8b7b1,_0x328c22){var _0x5b2c47={};var _0x40bfaf={};var _0x566d97;var _0x3ffcc7;return db[_0xc472('0x40')][_0xc472('0x54')]({'where':{'id':_0x56d091['params']['id']}})[_0xc472('0x28')](handleEntityNotFound(_0xf8b7b1,null))['then'](function(_0x7f8879){if(_0x7f8879){_0x566d97=_0x7f8879;_0x40bfaf[_0xc472('0x30')]=_['keys'](db['User'][_0xc472('0x2d')]);_0x40bfaf[_0xc472('0x32')]=_[_0xc472('0x31')](_0x56d091['query']);_0x40bfaf[_0xc472('0x3c')]=_[_0xc472('0x33')](_0x40bfaf[_0xc472('0x30')],_0x40bfaf[_0xc472('0x32')]);_0x5b2c47[_0xc472('0x35')]=_['intersection'](_0x40bfaf[_0xc472('0x30')],qs['fields'](_0x56d091[_0xc472('0x32')]['fields']));_0x5b2c47[_0xc472('0x35')]=_0x5b2c47[_0xc472('0x35')][_0xc472('0x36')]?_0x5b2c47[_0xc472('0x35')]:_0x40bfaf[_0xc472('0x30')];_0x5b2c47[_0xc472('0x38')]=qs[_0xc472('0x39')](_0x56d091[_0xc472('0x32')]['sort']);_0x5b2c47[_0xc472('0x3a')]=qs[_0xc472('0x3c')](_['pick'](_0x56d091[_0xc472('0x32')],_0x40bfaf[_0xc472('0x3c')]));if(_0x56d091[_0xc472('0x32')]['filter']){_0x5b2c47[_0xc472('0x3a')]=_['merge'](_0x5b2c47[_0xc472('0x3a')],{'$or':_[_0xc472('0x2c')](_0x5b2c47['attributes'],function(_0xc1a5cc){var _0x173007={};_0x173007[_0xc1a5cc]={'$like':'%'+_0x56d091[_0xc472('0x32')][_0xc472('0x3d')]+'%'};return _0x173007;})});}_0x5b2c47=_['merge']({},_0x5b2c47,_0x56d091[_0xc472('0x47')]);return _0x566d97[_0xc472('0x53')](_0x5b2c47);}})[_0xc472('0x28')](function(_0x497614){if(_0x497614){_0x3ffcc7=_0x497614['length'];if(!_0x56d091['query'][_0xc472('0x55')](_0xc472('0x37'))){_0x5b2c47[_0xc472('0x22')]=qs['limit'](_0x56d091['query'][_0xc472('0x22')]);_0x5b2c47[_0xc472('0x20')]=qs['offset'](_0x56d091[_0xc472('0x32')][_0xc472('0x20')]);}return _0x566d97[_0xc472('0x53')](_0x5b2c47);}})[_0xc472('0x28')](function(_0x2aea0e){if(_0x2aea0e){return _0x2aea0e?{'count':_0x3ffcc7,'rows':_0x2aea0e}:null;}})[_0xc472('0x28')](respondWithResult(_0xf8b7b1,null))[_0xc472('0x43')](handleError(_0xf8b7b1,null));};exports[_0xc472('0x56')]=function(_0x196eac,_0x56d57d,_0x59fa48){return db[_0xc472('0x40')]['find']({'where':{'id':_0x196eac[_0xc472('0x45')]['id']}})[_0xc472('0x28')](handleEntityNotFound(_0x56d57d,null))[_0xc472('0x28')](function(_0x3f7804){if(_0x3f7804){return _0x3f7804[_0xc472('0x56')](_0x196eac[_0xc472('0x32')][_0xc472('0x52')]);}})[_0xc472('0x28')](respondWithStatusCode(_0x56d57d,null))['catch'](handleError(_0x56d57d,null));};exports[_0xc472('0x57')]=function(_0xd7f3fb,_0x457e4e,_0x3839f5){if(_0xd7f3fb[_0xc472('0x4a')]['id']){delete _0xd7f3fb[_0xc472('0x4a')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0xd7f3fb['params']['id']}})[_0xc472('0x28')](handleEntityNotFound(_0x457e4e,null))[_0xc472('0x28')](function(_0x10b452){if(_0x10b452){_0xd7f3fb['body'][_0xc472('0x58')]=_0x10b452['id'];return db['ChatInternalMessage']['create'](_0xd7f3fb[_0xc472('0x4a')]);}})[_0xc472('0x28')](respondWithResult(_0x457e4e,null))['catch'](handleError(_0x457e4e,null));};exports['getMessages']=function(_0x57198b,_0x31e961,_0x16bc6a){var _0x1cd5f5={};var _0x3d412f={};var _0x4ab432;var _0x4985bb;return db[_0xc472('0x40')][_0xc472('0x54')]({'where':{'id':_0x57198b[_0xc472('0x45')]['id']}})[_0xc472('0x28')](handleEntityNotFound(_0x31e961,null))[_0xc472('0x28')](function(_0x163c38){if(_0x163c38){_0x4ab432=_0x163c38;_0x3d412f['model']=_[_0xc472('0x31')](db[_0xc472('0x4e')][_0xc472('0x2d')]);_0x3d412f[_0xc472('0x32')]=_[_0xc472('0x31')](_0x57198b[_0xc472('0x32')]);_0x3d412f['filters']=_[_0xc472('0x33')](_0x3d412f[_0xc472('0x30')],_0x3d412f['query']);_0x1cd5f5['attributes']=_[_0xc472('0x33')](_0x3d412f[_0xc472('0x30')],qs['fields'](_0x57198b['query']['fields']));_0x1cd5f5['attributes']=_0x1cd5f5[_0xc472('0x35')][_0xc472('0x36')]?_0x1cd5f5['attributes']:_0x3d412f[_0xc472('0x30')];_0x1cd5f5[_0xc472('0x38')]=qs[_0xc472('0x39')](_0x57198b[_0xc472('0x32')][_0xc472('0x39')]);_0x1cd5f5['where']=qs[_0xc472('0x3c')](_[_0xc472('0x3b')](_0x57198b[_0xc472('0x32')],_0x3d412f[_0xc472('0x3c')]));if(_0x57198b['query'][_0xc472('0x3d')]){_0x1cd5f5['where']=_[_0xc472('0x3e')](_0x1cd5f5[_0xc472('0x3a')],{'$or':_['map'](_0x1cd5f5[_0xc472('0x35')],function(_0x3bb340){var _0x4cca0d={};_0x4cca0d[_0x3bb340]={'$like':'%'+_0x57198b[_0xc472('0x32')][_0xc472('0x3d')]+'%'};return _0x4cca0d;})});}if(_0x57198b[_0xc472('0x32')][_0xc472('0x59')]){var _0x9b74f4=_0x57198b[_0xc472('0x32')][_0xc472('0x59')][_0xc472('0x5a')](',');var _0x373006={};_0x373006[_0x9b74f4[0x0]]={'$gte':moment(_0x9b74f4[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1cd5f5['where']=_[_0xc472('0x3e')](_0x1cd5f5[_0xc472('0x3a')],_0x373006);}_0x1cd5f5=_['merge']({},_0x1cd5f5,_0x57198b[_0xc472('0x47')]);return _0x4ab432['getMessages'](_0x1cd5f5);}})[_0xc472('0x28')](function(_0x687f02){if(_0x687f02){_0x4985bb=_0x687f02[_0xc472('0x36')];if(!_0x57198b['query'][_0xc472('0x55')](_0xc472('0x37'))){_0x1cd5f5[_0xc472('0x22')]=qs[_0xc472('0x22')](_0x57198b[_0xc472('0x32')][_0xc472('0x22')]);_0x1cd5f5['offset']=qs[_0xc472('0x20')](_0x57198b[_0xc472('0x32')][_0xc472('0x20')]);}return _0x4ab432['getMessages'](_0x1cd5f5);}})[_0xc472('0x28')](function(_0x2f297a){if(_0x2f297a){return _0x2f297a?{'count':_0x4985bb,'rows':_0x2f297a}:null;}})[_0xc472('0x28')](respondWithResult(_0x31e961,null))[_0xc472('0x43')](handleError(_0x31e961,null));};
\ No newline at end of file
+var _0x087c=['update','destroy','then','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','create','catch','body','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','getMembers','findOne','User','length','order','removeMembers','addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save'];(function(_0x108883,_0x58fa26){var _0x3eee97=function(_0x3b7dab){while(--_0x3b7dab){_0x108883['push'](_0x108883['shift']());}};_0x3eee97(++_0x58fa26);}(_0x087c,0x154));var _0xc087=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x087c[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xc087('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc087('0x1'));var moment=require(_0xc087('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc087('0x3'));var path=require(_0xc087('0x4'));var sox=require(_0xc087('0x5'));var csv=require('to-csv');var ejs=require(_0xc087('0x6'));var fs=require('fs');var fs_extra=require(_0xc087('0x7'));var _=require(_0xc087('0x8'));var squel=require(_0xc087('0x9'));var crypto=require(_0xc087('0xa'));var jsforce=require(_0xc087('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc087('0xc'));var querystring=require('querystring');var Papa=require(_0xc087('0xd'));var Redis=require('ioredis');var authService=require(_0xc087('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc087('0xf'));var hardwareService=require(_0xc087('0x10'));var logger=require(_0xc087('0x11'))(_0xc087('0x12'));var utils=require('../../config/utils');var config=require(_0xc087('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xc087('0x14')]=_[_0xc087('0x15')](config['redis'],{'host':_0xc087('0x16'),'port':0x18eb});var socket=require(_0xc087('0x17'))(new Redis(config['redis']));require(_0xc087('0x18'))[_0xc087('0x19')](socket);function respondWithStatusCode(_0x1c0be3,_0x1177ce){_0x1177ce=_0x1177ce||0xcc;return function(_0x8deadd){if(_0x8deadd){return _0x1c0be3[_0xc087('0x1a')](_0x1177ce);}return _0x1c0be3[_0xc087('0x1b')](_0x1177ce)['end']();};}function respondWithResult(_0x171f59,_0x2c5b04){_0x2c5b04=_0x2c5b04||0xc8;return function(_0x1c2ae6){if(_0x1c2ae6){return _0x171f59[_0xc087('0x1b')](_0x2c5b04)[_0xc087('0x1c')](_0x1c2ae6);}};}function respondWithFilteredResult(_0x55274f,_0x33a68c){return function(_0x4d8c95){if(_0x4d8c95){var _0x57b9bd=typeof _0x33a68c[_0xc087('0x1d')]===_0xc087('0x1e')&&typeof _0x33a68c[_0xc087('0x1f')]==='undefined';var _0x5e4683=_0x4d8c95[_0xc087('0x20')];var _0x550be4=_0x57b9bd?0x0:_0x33a68c[_0xc087('0x1d')];var _0x48c875=_0x57b9bd?_0x4d8c95[_0xc087('0x20')]:_0x33a68c[_0xc087('0x1d')]+_0x33a68c[_0xc087('0x1f')];var _0x35e58d;if(_0x48c875>=_0x5e4683){_0x48c875=_0x5e4683;_0x35e58d=0xc8;}else{_0x35e58d=0xce;}_0x55274f[_0xc087('0x1b')](_0x35e58d);return _0x55274f['set'](_0xc087('0x21'),_0x550be4+'-'+_0x48c875+'/'+_0x5e4683)[_0xc087('0x1c')](_0x4d8c95);}return null;};}function patchUpdates(_0xf9a300){return function(_0x227071){try{jsonpatch[_0xc087('0x22')](_0x227071,_0xf9a300,!![]);}catch(_0x2fdf34){return BPromise['reject'](_0x2fdf34);}return _0x227071[_0xc087('0x23')]();};}function saveUpdates(_0x5bb715,_0x51420f){return function(_0x3e964b){if(_0x3e964b){return _0x3e964b[_0xc087('0x24')](_0x5bb715)['then'](function(_0x5a94f4){return _0x5a94f4;});}return null;};}function removeEntity(_0x325664,_0x4d567d){return function(_0x2915c1){if(_0x2915c1){return _0x2915c1[_0xc087('0x25')]()[_0xc087('0x26')](function(){_0x325664[_0xc087('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28106f,_0x21daf0){return function(_0x54be44){if(!_0x54be44){_0x28106f[_0xc087('0x1a')](0x194);}return _0x54be44;};}function handleError(_0x3ef5de,_0x54de79){_0x54de79=_0x54de79||0x1f4;return function(_0x11eb40){logger[_0xc087('0x27')](_0x11eb40[_0xc087('0x28')]);if(_0x11eb40[_0xc087('0x29')]){delete _0x11eb40[_0xc087('0x29')];}_0x3ef5de[_0xc087('0x1b')](_0x54de79)[_0xc087('0x2a')](_0x11eb40);};}exports[_0xc087('0x2b')]=function(_0x263203,_0x308f04){var _0x439ccd={},_0x271c88={},_0x145fed={'count':0x0,'rows':[]};var _0x1b14a2=_[_0xc087('0x2c')](db[_0xc087('0x2d')][_0xc087('0x2e')],function(_0xc71e31){return{'name':_0xc71e31[_0xc087('0x2f')],'type':_0xc71e31[_0xc087('0x30')]['key']};});_0x271c88['model']=_[_0xc087('0x2c')](_0x1b14a2,_0xc087('0x29'));_0x271c88[_0xc087('0x31')]=_[_0xc087('0x32')](_0x263203[_0xc087('0x31')]);_0x271c88[_0xc087('0x33')]=_['intersection'](_0x271c88[_0xc087('0x34')],_0x271c88[_0xc087('0x31')]);_0x439ccd['attributes']=_[_0xc087('0x35')](_0x271c88[_0xc087('0x34')],qs[_0xc087('0x36')](_0x263203[_0xc087('0x31')]['fields']));_0x439ccd[_0xc087('0x37')]=_0x439ccd[_0xc087('0x37')]['length']?_0x439ccd[_0xc087('0x37')]:_0x271c88['model'];if(!_0x263203[_0xc087('0x31')][_0xc087('0x38')](_0xc087('0x39'))){_0x439ccd[_0xc087('0x1f')]=qs['limit'](_0x263203[_0xc087('0x31')][_0xc087('0x1f')]);_0x439ccd['offset']=qs[_0xc087('0x1d')](_0x263203[_0xc087('0x31')]['offset']);}_0x439ccd['order']=qs['sort'](_0x263203[_0xc087('0x31')][_0xc087('0x3a')]);_0x439ccd[_0xc087('0x3b')]=qs[_0xc087('0x33')](_[_0xc087('0x3c')](_0x263203[_0xc087('0x31')],_0x271c88[_0xc087('0x33')]),_0x1b14a2);if(_0x263203[_0xc087('0x31')][_0xc087('0x3d')]){_0x439ccd['where']=_[_0xc087('0x3e')](_0x439ccd['where'],{'$or':_[_0xc087('0x2c')](_0x1b14a2,function(_0x478866){if(_0x478866['type']!==_0xc087('0x3f')){var _0x2d3c29={};_0x2d3c29[_0x478866[_0xc087('0x29')]]={'$like':'%'+_0x263203[_0xc087('0x31')][_0xc087('0x3d')]+'%'};return _0x2d3c29;}})});}_0x439ccd=_[_0xc087('0x3e')]({},_0x439ccd,_0x263203[_0xc087('0x40')]);var _0x47aa2b={'where':_0x439ccd[_0xc087('0x3b')]};return db[_0xc087('0x2d')][_0xc087('0x20')](_0x47aa2b)['then'](function(_0x37fe19){_0x145fed['count']=_0x37fe19;if(_0x263203[_0xc087('0x31')]['includeAll']){_0x439ccd[_0xc087('0x41')]=[{'all':!![]}];}return db[_0xc087('0x2d')][_0xc087('0x42')](_0x439ccd);})['then'](function(_0x1419fd){_0x145fed[_0xc087('0x43')]=_0x1419fd;return _0x145fed;})[_0xc087('0x26')](respondWithFilteredResult(_0x308f04,_0x439ccd))['catch'](handleError(_0x308f04,null));};exports[_0xc087('0x44')]=function(_0x226a2a,_0x5aca61){var _0x5384af={'raw':!![],'where':{'id':_0x226a2a[_0xc087('0x45')]['id']}},_0x95e9fe={};_0x95e9fe[_0xc087('0x34')]=_[_0xc087('0x32')](db['ChatGroup'][_0xc087('0x2e')]);_0x95e9fe[_0xc087('0x31')]=_[_0xc087('0x32')](_0x226a2a[_0xc087('0x31')]);_0x95e9fe[_0xc087('0x33')]=_[_0xc087('0x35')](_0x95e9fe[_0xc087('0x34')],_0x95e9fe[_0xc087('0x31')]);_0x5384af['attributes']=_['intersection'](_0x95e9fe[_0xc087('0x34')],qs[_0xc087('0x36')](_0x226a2a[_0xc087('0x31')][_0xc087('0x36')]));_0x5384af['attributes']=_0x5384af[_0xc087('0x37')]['length']?_0x5384af[_0xc087('0x37')]:_0x95e9fe['model'];if(_0x226a2a[_0xc087('0x31')][_0xc087('0x46')]){_0x5384af[_0xc087('0x41')]=[{'all':!![]}];}_0x5384af=_[_0xc087('0x3e')]({},_0x5384af,_0x226a2a[_0xc087('0x40')]);return db['ChatGroup'][_0xc087('0x47')](_0x5384af)[_0xc087('0x26')](handleEntityNotFound(_0x5aca61,null))['then'](respondWithResult(_0x5aca61,null))['catch'](handleError(_0x5aca61,null));};exports[_0xc087('0x48')]=function(_0x1fee02,_0x3b8870){return db[_0xc087('0x2d')]['create'](_0x1fee02['body'],{})[_0xc087('0x26')](respondWithResult(_0x3b8870,0xc9))[_0xc087('0x49')](handleError(_0x3b8870,null));};exports[_0xc087('0x24')]=function(_0x5c2aab,_0x5e441b){if(_0x5c2aab[_0xc087('0x4a')]['id']){delete _0x5c2aab[_0xc087('0x4a')]['id'];}return db[_0xc087('0x2d')][_0xc087('0x47')]({'where':{'id':_0x5c2aab[_0xc087('0x45')]['id']}})[_0xc087('0x26')](handleEntityNotFound(_0x5e441b,null))['then'](saveUpdates(_0x5c2aab[_0xc087('0x4a')],null))[_0xc087('0x26')](respondWithResult(_0x5e441b,null))[_0xc087('0x49')](handleError(_0x5e441b,null));};exports[_0xc087('0x25')]=function(_0x3c212c,_0x468056){return db['ChatGroup'][_0xc087('0x47')]({'where':{'id':_0x3c212c['params']['id']}})['then'](handleEntityNotFound(_0x468056,null))[_0xc087('0x26')](removeEntity(_0x468056,null))[_0xc087('0x49')](handleError(_0x468056,null));};exports[_0xc087('0x4b')]=function(_0x4a1f1c,_0x1b995c){return db['ChatGroup'][_0xc087('0x4b')]()[_0xc087('0x26')](respondWithResult(_0x1b995c,null))[_0xc087('0x49')](handleError(_0x1b995c,null));};exports[_0xc087('0x4c')]=function(_0x56fb65,_0x32efda,_0x36c719){return db[_0xc087('0x4d')][_0xc087('0x20')]({'where':{'ChatGroupId':_0x56fb65['params']['id'],'ToId':_0x56fb65['user']['id'],'read':![]}})[_0xc087('0x26')](function(_0x562f29){return{'id':_[_0xc087('0x4e')](_0x56fb65[_0xc087('0x45')]['id']),'count':_0x562f29};})[_0xc087('0x26')](respondWithResult(_0x32efda,null))['catch'](handleError(_0x32efda,null));};exports[_0xc087('0x4f')]=function(_0x2bdbeb,_0x4235e6,_0x2c9382){return db[_0xc087('0x2d')][_0xc087('0x47')]({'where':{'id':_0x2bdbeb[_0xc087('0x45')]['id']}})['then'](handleEntityNotFound(_0x4235e6,null))[_0xc087('0x26')](function(_0x532adb){if(_0x532adb){return _0x532adb[_0xc087('0x4f')](_0x2bdbeb['body']['ids'],_['omit'](_0x2bdbeb[_0xc087('0x4a')],[_0xc087('0x50'),'id'])||{});}})['then'](respondWithResult(_0x4235e6,null))['catch'](handleError(_0x4235e6,null));};exports[_0xc087('0x51')]=function(_0x260fb9,_0xbabc5c,_0x44eb30){var _0x56adf6={};var _0x226aee={};var _0x56a711;var _0x4cabdf;return db[_0xc087('0x2d')][_0xc087('0x52')]({'where':{'id':_0x260fb9['params']['id']}})[_0xc087('0x26')](handleEntityNotFound(_0xbabc5c,null))[_0xc087('0x26')](function(_0x293155){if(_0x293155){_0x56a711=_0x293155;_0x226aee[_0xc087('0x34')]=_[_0xc087('0x32')](db[_0xc087('0x53')][_0xc087('0x2e')]);_0x226aee[_0xc087('0x31')]=_['keys'](_0x260fb9['query']);_0x226aee[_0xc087('0x33')]=_[_0xc087('0x35')](_0x226aee[_0xc087('0x34')],_0x226aee['query']);_0x56adf6['attributes']=_[_0xc087('0x35')](_0x226aee['model'],qs['fields'](_0x260fb9[_0xc087('0x31')][_0xc087('0x36')]));_0x56adf6[_0xc087('0x37')]=_0x56adf6[_0xc087('0x37')][_0xc087('0x54')]?_0x56adf6['attributes']:_0x226aee[_0xc087('0x34')];_0x56adf6[_0xc087('0x55')]=qs[_0xc087('0x3a')](_0x260fb9['query'][_0xc087('0x3a')]);_0x56adf6[_0xc087('0x3b')]=qs['filters'](_[_0xc087('0x3c')](_0x260fb9[_0xc087('0x31')],_0x226aee[_0xc087('0x33')]));if(_0x260fb9[_0xc087('0x31')][_0xc087('0x3d')]){_0x56adf6[_0xc087('0x3b')]=_['merge'](_0x56adf6[_0xc087('0x3b')],{'$or':_[_0xc087('0x2c')](_0x56adf6[_0xc087('0x37')],function(_0x58d153){var _0x3ea7e2={};_0x3ea7e2[_0x58d153]={'$like':'%'+_0x260fb9[_0xc087('0x31')][_0xc087('0x3d')]+'%'};return _0x3ea7e2;})});}_0x56adf6=_['merge']({},_0x56adf6,_0x260fb9[_0xc087('0x40')]);return _0x56a711[_0xc087('0x51')](_0x56adf6);}})[_0xc087('0x26')](function(_0x526d20){if(_0x526d20){_0x4cabdf=_0x526d20[_0xc087('0x54')];if(!_0x260fb9['query']['hasOwnProperty']('nolimit')){_0x56adf6[_0xc087('0x1f')]=qs['limit'](_0x260fb9[_0xc087('0x31')][_0xc087('0x1f')]);_0x56adf6[_0xc087('0x1d')]=qs[_0xc087('0x1d')](_0x260fb9[_0xc087('0x31')][_0xc087('0x1d')]);}return _0x56a711[_0xc087('0x51')](_0x56adf6);}})[_0xc087('0x26')](function(_0x519121){if(_0x519121){return _0x519121?{'count':_0x4cabdf,'rows':_0x519121}:null;}})[_0xc087('0x26')](respondWithResult(_0xbabc5c,null))[_0xc087('0x49')](handleError(_0xbabc5c,null));};exports[_0xc087('0x56')]=function(_0x468eef,_0x1fe4fd,_0x3bedef){return db[_0xc087('0x2d')][_0xc087('0x47')]({'where':{'id':_0x468eef[_0xc087('0x45')]['id']}})['then'](handleEntityNotFound(_0x1fe4fd,null))[_0xc087('0x26')](function(_0x18ee35){if(_0x18ee35){return _0x18ee35[_0xc087('0x56')](_0x468eef[_0xc087('0x31')][_0xc087('0x50')]);}})[_0xc087('0x26')](respondWithStatusCode(_0x1fe4fd,null))['catch'](handleError(_0x1fe4fd,null));};exports[_0xc087('0x57')]=function(_0xfd6a63,_0x39d6ed,_0x4cc0e4){if(_0xfd6a63['body']['id']){delete _0xfd6a63['body']['id'];}return db[_0xc087('0x2d')][_0xc087('0x47')]({'where':{'id':_0xfd6a63['params']['id']}})['then'](handleEntityNotFound(_0x39d6ed,null))['then'](function(_0x2a1e0f){if(_0x2a1e0f){_0xfd6a63[_0xc087('0x4a')][_0xc087('0x58')]=_0x2a1e0f['id'];return db[_0xc087('0x4d')]['create'](_0xfd6a63[_0xc087('0x4a')]);}})[_0xc087('0x26')](respondWithResult(_0x39d6ed,null))['catch'](handleError(_0x39d6ed,null));};exports['getMessages']=function(_0x4da7c5,_0x102e91,_0x3cd597){var _0x1a101f={};var _0x1ed0fa={};var _0x445b84;var _0x54e604;return db[_0xc087('0x2d')][_0xc087('0x52')]({'where':{'id':_0x4da7c5['params']['id']}})[_0xc087('0x26')](handleEntityNotFound(_0x102e91,null))[_0xc087('0x26')](function(_0x2aa4fa){if(_0x2aa4fa){_0x445b84=_0x2aa4fa;_0x1ed0fa['model']=_[_0xc087('0x32')](db[_0xc087('0x4d')][_0xc087('0x2e')]);_0x1ed0fa['query']=_[_0xc087('0x32')](_0x4da7c5[_0xc087('0x31')]);_0x1ed0fa['filters']=_[_0xc087('0x35')](_0x1ed0fa[_0xc087('0x34')],_0x1ed0fa[_0xc087('0x31')]);_0x1a101f[_0xc087('0x37')]=_['intersection'](_0x1ed0fa[_0xc087('0x34')],qs['fields'](_0x4da7c5[_0xc087('0x31')][_0xc087('0x36')]));_0x1a101f['attributes']=_0x1a101f['attributes'][_0xc087('0x54')]?_0x1a101f[_0xc087('0x37')]:_0x1ed0fa['model'];_0x1a101f[_0xc087('0x55')]=qs['sort'](_0x4da7c5[_0xc087('0x31')][_0xc087('0x3a')]);_0x1a101f['where']=qs[_0xc087('0x33')](_[_0xc087('0x3c')](_0x4da7c5['query'],_0x1ed0fa[_0xc087('0x33')]));if(_0x4da7c5[_0xc087('0x31')]['filter']){_0x1a101f[_0xc087('0x3b')]=_[_0xc087('0x3e')](_0x1a101f['where'],{'$or':_['map'](_0x1a101f[_0xc087('0x37')],function(_0x101bb5){var _0x3353de={};_0x3353de[_0x101bb5]={'$like':'%'+_0x4da7c5['query'][_0xc087('0x3d')]+'%'};return _0x3353de;})});}if(_0x4da7c5['query'][_0xc087('0x59')]){var _0x44544c=_0x4da7c5[_0xc087('0x31')]['$gte'][_0xc087('0x5a')](',');var _0x3ae2f9={};_0x3ae2f9[_0x44544c[0x0]]={'$gte':moment(_0x44544c[0x1])[_0xc087('0x5b')](_0xc087('0x5c'))};_0x1a101f[_0xc087('0x3b')]=_['merge'](_0x1a101f[_0xc087('0x3b')],_0x3ae2f9);}_0x1a101f=_['merge']({},_0x1a101f,_0x4da7c5[_0xc087('0x40')]);return _0x445b84[_0xc087('0x5d')](_0x1a101f);}})[_0xc087('0x26')](function(_0x43ed53){if(_0x43ed53){_0x54e604=_0x43ed53['length'];if(!_0x4da7c5[_0xc087('0x31')][_0xc087('0x38')](_0xc087('0x39'))){_0x1a101f[_0xc087('0x1f')]=qs['limit'](_0x4da7c5[_0xc087('0x31')]['limit']);_0x1a101f[_0xc087('0x1d')]=qs[_0xc087('0x1d')](_0x4da7c5['query'][_0xc087('0x1d')]);}return _0x445b84[_0xc087('0x5d')](_0x1a101f);}})['then'](function(_0x296f59){if(_0x296f59){return _0x296f59?{'count':_0x54e604,'rows':_0x296f59}:null;}})[_0xc087('0x26')](respondWithResult(_0x102e91,null))[_0xc087('0x49')](handleError(_0x102e91,null));};
\ No newline at end of file
index 14ae127..ab679d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2837=['emit','hook','exports','events','../../mysqldb','ChatGroup','save','update'];(function(_0x5c9c0f,_0x36c608){var _0x180fe6=function(_0x414b28){while(--_0x414b28){_0x5c9c0f['push'](_0x5c9c0f['shift']());}};_0x180fe6(++_0x36c608);}(_0x2837,0x12b));var _0x7283=function(_0x19fb24,_0x4f4d0e){_0x19fb24=_0x19fb24-0x0;var _0x4021cd=_0x2837[_0x19fb24];return _0x4021cd;};'use strict';var EventEmitter=require(_0x7283('0x0'));var ChatGroup=require(_0x7283('0x1'))['db'][_0x7283('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7283('0x3'),'afterUpdate':_0x7283('0x4'),'afterDestroy':'remove'};function emitEvent(_0x53f90e){return function(_0x40df2e,_0x3341f2,_0xdc68e3){ChatGroupEvents['emit'](_0x53f90e+':'+_0x40df2e['id'],_0x40df2e);ChatGroupEvents[_0x7283('0x5')](_0x53f90e,_0x40df2e);_0xdc68e3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x7283('0x6')](e,emitEvent(event));}}module[_0x7283('0x7')]=ChatGroupEvents;
\ No newline at end of file
+var _0xe24e=['../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2f6858,_0x158b5e){var _0x233438=function(_0x4182df){while(--_0x4182df){_0x2f6858['push'](_0x2f6858['shift']());}};_0x233438(++_0x158b5e);}(_0xe24e,0x15f));var _0xee24=function(_0xcfeda9,_0xd418ae){_0xcfeda9=_0xcfeda9-0x0;var _0x4826c7=_0xe24e[_0xcfeda9];return _0x4826c7;};'use strict';var EventEmitter=require(_0xee24('0x0'));var ChatGroup=require(_0xee24('0x1'))['db'][_0xee24('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xee24('0x3')](0x0);var events={'afterCreate':_0xee24('0x4'),'afterUpdate':_0xee24('0x5'),'afterDestroy':_0xee24('0x6')};function emitEvent(_0x4aaefd){return function(_0x451b0a,_0x5ce5fc,_0x57aace){ChatGroupEvents['emit'](_0x4aaefd+':'+_0x451b0a['id'],_0x451b0a);ChatGroupEvents[_0xee24('0x7')](_0x4aaefd,_0x451b0a);_0x57aace(null);};}for(var e in events){if(events[_0xee24('0x8')](e)){var event=events[e];ChatGroup[_0xee24('0x9')](e,emitEvent(event));}}module[_0xee24('0xa')]=ChatGroupEvents;
\ No newline at end of file
index 4f00ead..454b2b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa952=['chat_groups','lodash','util','moment','request-promise','path','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xa952,0x9b));var _0x2a95=function(_0x16d36c,_0x2cb0f6){_0x16d36c=_0x16d36c-0x0;var _0x33a4f1=_0xa952[_0x16d36c];return _0x33a4f1;};'use strict';var _=require(_0x2a95('0x0'));var util=require(_0x2a95('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2a95('0x2'));var BPromise=require('bluebird');var rp=require(_0x2a95('0x3'));var fs=require('fs');var path=require(_0x2a95('0x4'));var rimraf=require('rimraf');var config=require(_0x2a95('0x5'));var attributes=require(_0x2a95('0x6'));module[_0x2a95('0x7')]=function(_0x302732,_0x41e0b2){return _0x302732[_0x2a95('0x8')](_0x2a95('0x9'),attributes,{'tableName':_0x2a95('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xacef=['chat_groups','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x5105e8,_0x44a2e0){var _0x53bbf5=function(_0x29dfb8){while(--_0x29dfb8){_0x5105e8['push'](_0x5105e8['shift']());}};_0x53bbf5(++_0x44a2e0);}(_0xacef,0x199));var _0xface=function(_0x16257d,_0x4310f5){_0x16257d=_0x16257d-0x0;var _0x3350e8=_0xacef[_0x16257d];return _0x3350e8;};'use strict';var _=require(_0xface('0x0'));var util=require(_0xface('0x1'));var logger=require(_0xface('0x2'))('api');var moment=require(_0xface('0x3'));var BPromise=require('bluebird');var rp=require(_0xface('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xface('0x5'));var config=require(_0xface('0x6'));var attributes=require(_0xface('0x7'));module[_0xface('0x8')]=function(_0x4ad67c,_0x347d80){return _0x4ad67c[_0xface('0x9')](_0xface('0xa'),attributes,{'tableName':_0xface('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3f7c107..7eb75ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccc9=['then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request'];(function(_0x1a1d5a,_0x3d1246){var _0x2e578b=function(_0x18f06b){while(--_0x18f06b){_0x1a1d5a['push'](_0x1a1d5a['shift']());}};_0x2e578b(++_0x3d1246);}(_0xccc9,0xf4));var _0x9ccc=function(_0x13948e,_0x3bfc5b){_0x13948e=_0x13948e-0x0;var _0x325561=_0xccc9[_0x13948e];return _0x325561;};'use strict';var _=require(_0x9ccc('0x0'));var util=require(_0x9ccc('0x1'));var moment=require(_0x9ccc('0x2'));var BPromise=require(_0x9ccc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9ccc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9ccc('0x5'));var logger=require('../../config/logger')(_0x9ccc('0x6'));var config=require('../../config/environment');var jayson=require(_0x9ccc('0x7'));var client=jayson[_0x9ccc('0x8')][_0x9ccc('0x9')]({'port':0x232a});config[_0x9ccc('0xa')]=_[_0x9ccc('0xb')](config[_0x9ccc('0xa')],{'host':_0x9ccc('0xc'),'port':0x18eb});var socket=require(_0x9ccc('0xd'))(new Redis(config[_0x9ccc('0xa')]));require(_0x9ccc('0xe'))[_0x9ccc('0xf')](socket);function respondWithRpcPromise(_0x256882,_0x5e1fad,_0x14f681){return new BPromise(function(_0x31b622,_0x264673){return client[_0x9ccc('0x10')](_0x256882,_0x14f681)[_0x9ccc('0x11')](function(_0x3ce6d6){logger[_0x9ccc('0x12')]('ChatGroup,\x20%s,\x20%s',_0x5e1fad,'request\x20sent');logger[_0x9ccc('0x13')](_0x9ccc('0x14'),_0x5e1fad,_0x9ccc('0x15'),JSON[_0x9ccc('0x16')](_0x3ce6d6));if(_0x3ce6d6[_0x9ccc('0x17')]){if(_0x3ce6d6[_0x9ccc('0x17')][_0x9ccc('0x18')]===0x1f4){logger[_0x9ccc('0x17')](_0x9ccc('0x19'),_0x5e1fad,_0x3ce6d6[_0x9ccc('0x17')][_0x9ccc('0x1a')]);return _0x264673(_0x3ce6d6[_0x9ccc('0x17')]['message']);}logger[_0x9ccc('0x17')](_0x9ccc('0x19'),_0x5e1fad,_0x3ce6d6[_0x9ccc('0x17')][_0x9ccc('0x1a')]);return _0x31b622(_0x3ce6d6[_0x9ccc('0x17')]['message']);}else{logger[_0x9ccc('0x12')](_0x9ccc('0x19'),_0x5e1fad,_0x9ccc('0x15'));_0x31b622(_0x3ce6d6[_0x9ccc('0x1b')][_0x9ccc('0x1a')]);}})[_0x9ccc('0x1c')](function(_0x500b50){logger[_0x9ccc('0x17')](_0x9ccc('0x19'),_0x5e1fad,_0x500b50);_0x264673(_0x500b50);});});}
\ No newline at end of file
+var _0xdf71=['redis','defaults','localhost','./chatGroup.socket','register','request','then','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x26afa8,_0x14be89){var _0x7a1195=function(_0x21a65b){while(--_0x21a65b){_0x26afa8['push'](_0x26afa8['shift']());}};_0x7a1195(++_0x14be89);}(_0xdf71,0x1d2));var _0x1df7=function(_0x205ce0,_0x3d16e7){_0x205ce0=_0x205ce0-0x0;var _0x138ae7=_0xdf71[_0x205ce0];return _0x138ae7;};'use strict';var _=require(_0x1df7('0x0'));var util=require('util');var moment=require(_0x1df7('0x1'));var BPromise=require(_0x1df7('0x2'));var rs=require(_0x1df7('0x3'));var fs=require('fs');var Redis=require(_0x1df7('0x4'));var db=require(_0x1df7('0x5'))['db'];var utils=require(_0x1df7('0x6'));var logger=require(_0x1df7('0x7'))('rpc');var config=require(_0x1df7('0x8'));var jayson=require(_0x1df7('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x1df7('0xa')]=_[_0x1df7('0xb')](config['redis'],{'host':_0x1df7('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1df7('0xa')]));require(_0x1df7('0xd'))[_0x1df7('0xe')](socket);function respondWithRpcPromise(_0x319511,_0x589400,_0x3bc01a){return new BPromise(function(_0x3e44fd,_0x28585a){return client[_0x1df7('0xf')](_0x319511,_0x3bc01a)[_0x1df7('0x10')](function(_0x1a9882){logger['info'](_0x1df7('0x11'),_0x589400,'request\x20sent');logger[_0x1df7('0x12')](_0x1df7('0x13'),_0x589400,_0x1df7('0x14'),JSON[_0x1df7('0x15')](_0x1a9882));if(_0x1a9882[_0x1df7('0x16')]){if(_0x1a9882['error'][_0x1df7('0x17')]===0x1f4){logger[_0x1df7('0x16')](_0x1df7('0x11'),_0x589400,_0x1a9882['error']['message']);return _0x28585a(_0x1a9882[_0x1df7('0x16')]['message']);}logger[_0x1df7('0x16')]('ChatGroup,\x20%s,\x20%s',_0x589400,_0x1a9882[_0x1df7('0x16')][_0x1df7('0x18')]);return _0x3e44fd(_0x1a9882[_0x1df7('0x16')][_0x1df7('0x18')]);}else{logger[_0x1df7('0x19')]('ChatGroup,\x20%s,\x20%s',_0x589400,_0x1df7('0x14'));_0x3e44fd(_0x1a9882[_0x1df7('0x1a')][_0x1df7('0x18')]);}})[_0x1df7('0x1b')](function(_0x5af91){logger[_0x1df7('0x16')]('ChatGroup,\x20%s,\x20%s',_0x589400,_0x5af91);_0x28585a(_0x5af91);});});}
\ No newline at end of file
index 3f2c71e..e986f94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd418=['chatGroup:','./chatGroup.events','save','update','removeListener','register','length'];(function(_0x1cfc39,_0x1d3913){var _0x957a28=function(_0x2be930){while(--_0x2be930){_0x1cfc39['push'](_0x1cfc39['shift']());}};_0x957a28(++_0x1d3913);}(_0xd418,0x14a));var _0x8d41=function(_0x29bf8d,_0x43aeee){_0x29bf8d=_0x29bf8d-0x0;var _0x497583=_0xd418[_0x29bf8d];return _0x497583;};'use strict';var ChatGroupEvents=require(_0x8d41('0x0'));var events=[_0x8d41('0x1'),'remove',_0x8d41('0x2')];function createListener(_0x5e5fbb,_0x38dbd8){return function(_0x2327b6){_0x38dbd8['emit'](_0x5e5fbb,_0x2327b6);};}function removeListener(_0x381142,_0x460cfb){return function(){ChatGroupEvents[_0x8d41('0x3')](_0x381142,_0x460cfb);};}exports[_0x8d41('0x4')]=function(_0x366a4a){for(var _0x4aa2b6=0x0,_0x5bc9d2=events[_0x8d41('0x5')];_0x4aa2b6<_0x5bc9d2;_0x4aa2b6++){var _0x3ef06c=events[_0x4aa2b6];var _0x1af172=createListener(_0x8d41('0x6')+_0x3ef06c,_0x366a4a);ChatGroupEvents['on'](_0x3ef06c,_0x1af172);}};
\ No newline at end of file
+var _0x6c0b=['./chatGroup.events','save','remove','update','removeListener','length','chatGroup:'];(function(_0x3e2f4a,_0x4aa7d9){var _0x15ca76=function(_0x5e2dea){while(--_0x5e2dea){_0x3e2f4a['push'](_0x3e2f4a['shift']());}};_0x15ca76(++_0x4aa7d9);}(_0x6c0b,0x142));var _0xb6c0=function(_0x1e3671,_0x9ae4fc){_0x1e3671=_0x1e3671-0x0;var _0x48d5f5=_0x6c0b[_0x1e3671];return _0x48d5f5;};'use strict';var ChatGroupEvents=require(_0xb6c0('0x0'));var events=[_0xb6c0('0x1'),_0xb6c0('0x2'),_0xb6c0('0x3')];function createListener(_0x4c889c,_0x161758){return function(_0x35e5b7){_0x161758['emit'](_0x4c889c,_0x35e5b7);};}function removeListener(_0xc3574,_0x139475){return function(){ChatGroupEvents[_0xb6c0('0x4')](_0xc3574,_0x139475);};}exports['register']=function(_0x50870f){for(var _0x1544f0=0x0,_0x444434=events[_0xb6c0('0x5')];_0x1544f0<_0x444434;_0x1544f0++){var _0x46898f=events[_0x1544f0];var _0x5a7c70=createListener(_0xb6c0('0x6')+_0x46898f,_0x50870f);ChatGroupEvents['on'](_0x46898f,_0x5a7c70);}};
\ No newline at end of file
index ca22250..38f0260 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe77d=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','put','update','delete','destroy','removeMembers','exports','multer','util'];(function(_0x33ee4b,_0x559654){var _0x1f9511=function(_0x914b5c){while(--_0x914b5c){_0x33ee4b['push'](_0x33ee4b['shift']());}};_0x1f9511(++_0x559654);}(_0xe77d,0x1b1));var _0xde77=function(_0x43c05b,_0x5bd7c6){_0x43c05b=_0x43c05b-0x0;var _0x235a74=_0xe77d[_0x43c05b];return _0x235a74;};'use strict';var multer=require(_0xde77('0x0'));var util=require(_0xde77('0x1'));var path=require(_0xde77('0x2'));var timeout=require(_0xde77('0x3'));var express=require(_0xde77('0x4'));var router=express[_0xde77('0x5')]();var fs_extra=require(_0xde77('0x6'));var auth=require(_0xde77('0x7'));var interaction=require(_0xde77('0x8'));var config=require('../../config/environment');var controller=require(_0xde77('0x9'));router[_0xde77('0xa')]('/',auth[_0xde77('0xb')](),controller['index']);router['get'](_0xde77('0xc'),auth[_0xde77('0xb')](),controller[_0xde77('0xd')]);router[_0xde77('0xa')](_0xde77('0xe'),auth[_0xde77('0xb')](),controller[_0xde77('0xf')]);router[_0xde77('0xa')](_0xde77('0x10'),auth['isAuthenticated'](),controller[_0xde77('0x11')]);router[_0xde77('0xa')](_0xde77('0x12'),auth[_0xde77('0xb')](),controller[_0xde77('0x13')]);router['get'](_0xde77('0x14'),auth[_0xde77('0xb')](),controller[_0xde77('0x15')]);router[_0xde77('0x16')]('/',auth[_0xde77('0xb')](),controller['create']);router[_0xde77('0x16')]('/:id/members',auth[_0xde77('0xb')](),controller['addMembers']);router[_0xde77('0x16')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0xde77('0x17')](_0xde77('0xe'),auth[_0xde77('0xb')](),controller[_0xde77('0x18')]);router[_0xde77('0x19')](_0xde77('0xe'),auth[_0xde77('0xb')](),controller[_0xde77('0x1a')]);router[_0xde77('0x19')](_0xde77('0x12'),auth[_0xde77('0xb')](),controller[_0xde77('0x1b')]);module[_0xde77('0x1c')]=router;
\ No newline at end of file
+var _0x127e=['put','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMessages','create','addMembers','addMessage'];(function(_0x483716,_0x69ee28){var _0x259fc6=function(_0x1ea0db){while(--_0x1ea0db){_0x483716['push'](_0x483716['shift']());}};_0x259fc6(++_0x69ee28);}(_0x127e,0x12f));var _0xe127=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x127e[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xe127('0x0'));var util=require(_0xe127('0x1'));var path=require(_0xe127('0x2'));var timeout=require(_0xe127('0x3'));var express=require('express');var router=express[_0xe127('0x4')]();var fs_extra=require(_0xe127('0x5'));var auth=require(_0xe127('0x6'));var interaction=require(_0xe127('0x7'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router[_0xe127('0x8')]('/',auth['isAuthenticated'](),controller[_0xe127('0x9')]);router[_0xe127('0x8')]('/describe',auth[_0xe127('0xa')](),controller[_0xe127('0xb')]);router[_0xe127('0x8')](_0xe127('0xc'),auth[_0xe127('0xa')](),controller[_0xe127('0xd')]);router[_0xe127('0x8')](_0xe127('0xe'),auth[_0xe127('0xa')](),controller[_0xe127('0xf')]);router[_0xe127('0x8')](_0xe127('0x10'),auth['isAuthenticated'](),controller['getMembers']);router['get']('/:id/messages',auth[_0xe127('0xa')](),controller[_0xe127('0x11')]);router['post']('/',auth[_0xe127('0xa')](),controller[_0xe127('0x12')]);router['post']('/:id/members',auth[_0xe127('0xa')](),controller[_0xe127('0x13')]);router['post']('/:id/messages',auth[_0xe127('0xa')](),controller[_0xe127('0x14')]);router[_0xe127('0x15')]('/:id',auth[_0xe127('0xa')](),controller[_0xe127('0x16')]);router[_0xe127('0x17')](_0xe127('0xc'),auth[_0xe127('0xa')](),controller[_0xe127('0x18')]);router[_0xe127('0x17')](_0xe127('0x10'),auth[_0xe127('0xa')](),controller[_0xe127('0x19')]);module[_0xe127('0x1a')]=router;
\ No newline at end of file
index c8624fa..b32e459 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3750=['thumb','star','TEXT','STRING','DATE','long','out','sequelize','exports','BOOLEAN','INTEGER','ENUM'];(function(_0x2a3e9e,_0xbe6590){var _0x53ca15=function(_0x2a5e2f){while(--_0x2a5e2f){_0x2a3e9e['push'](_0x2a3e9e['shift']());}};_0x53ca15(++_0xbe6590);}(_0x3750,0xbb));var _0x0375=function(_0x3a0c4f,_0x5dd1a3){_0x3a0c4f=_0x3a0c4f-0x0;var _0x247049=_0x3750[_0x3a0c4f];return _0x247049;};'use strict';var Sequelize=require(_0x0375('0x0'));module[_0x0375('0x1')]={'closed':{'type':Sequelize[_0x0375('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x0375('0x3')]},'ratingType':{'type':Sequelize[_0x0375('0x4')]('star',_0x0375('0x5')),'defaultValue':_0x0375('0x6')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x0375('0x7')]},'mailTranscript':{'type':Sequelize[_0x0375('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x0375('0x9')]},'disposition':{'type':Sequelize[_0x0375('0x8')]},'secondDisposition':{'type':Sequelize[_0x0375('0x8')]},'thirdDisposition':{'type':Sequelize[_0x0375('0x8')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x0375('0x8')]},'browserVersion':{'type':Sequelize[_0x0375('0x8')]},'osName':{'type':Sequelize[_0x0375('0x8')]},'osVersion':{'type':Sequelize[_0x0375('0x8')]},'deviceModel':{'type':Sequelize[_0x0375('0x8')]},'deviceVendor':{'type':Sequelize[_0x0375('0x8')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x0375('0x7')]},'customerIp':{'type':Sequelize[_0x0375('0x8')]},'formData':{'type':Sequelize[_0x0375('0x7')](_0x0375('0xa'))},'read1stAt':{'type':Sequelize[_0x0375('0x9')]},'lastMsgAt':{'type':Sequelize[_0x0375('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x0375('0x4')]('in',_0x0375('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x0375('0x8')]},'customerPort':{'type':Sequelize[_0x0375('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x0375('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x0375('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xb9be=['INTEGER','ENUM','star','thumb','TEXT','DATE','STRING','sequelize','exports','BOOLEAN'];(function(_0x728644,_0x237ab7){var _0x5f11e3=function(_0x3fed1f){while(--_0x3fed1f){_0x728644['push'](_0x728644['shift']());}};_0x5f11e3(++_0x237ab7);}(_0xb9be,0xc5));var _0xeb9b=function(_0x340380,_0x4bd2a8){_0x340380=_0x340380-0x0;var _0x49ce1c=_0xb9be[_0x340380];return _0x49ce1c;};'use strict';var Sequelize=require(_0xeb9b('0x0'));module[_0xeb9b('0x1')]={'closed':{'type':Sequelize[_0xeb9b('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xeb9b('0x3')]},'ratingType':{'type':Sequelize[_0xeb9b('0x4')](_0xeb9b('0x5'),_0xeb9b('0x6')),'defaultValue':_0xeb9b('0x5')},'ratingMessage':{'type':Sequelize[_0xeb9b('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xeb9b('0x8')]},'disposition':{'type':Sequelize[_0xeb9b('0x9')]},'secondDisposition':{'type':Sequelize[_0xeb9b('0x9')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xeb9b('0x9')]},'browserName':{'type':Sequelize[_0xeb9b('0x9')]},'browserVersion':{'type':Sequelize[_0xeb9b('0x9')]},'osName':{'type':Sequelize[_0xeb9b('0x9')]},'osVersion':{'type':Sequelize[_0xeb9b('0x9')]},'deviceModel':{'type':Sequelize[_0xeb9b('0x9')]},'deviceVendor':{'type':Sequelize[_0xeb9b('0x9')]},'deviceType':{'type':Sequelize[_0xeb9b('0x9')]},'referer':{'type':Sequelize[_0xeb9b('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xeb9b('0x7')]('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xeb9b('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xeb9b('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xeb9b('0x9')]},'customerPort':{'type':Sequelize[_0xeb9b('0x9')]},'vidaooSessionId':{'type':Sequelize[_0xeb9b('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0xeb9b('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 7aba505..22f52c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4509=['account','map','ChatInteraction','fieldName','type','getOptions','chat','query','user','show','params','rawAttributes','keys','filters','intersection','model','fields','attributes','length','include','merge','find','create','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','email','POST','isNull','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','root','server/files/attachments/','join','download','close','mailTranscript','format','transcript-%s.txt','now','ChatMessage','Messages','User','ChatWebsite','%s%d','agentAlias','System','customer','Visitor','ContactId','agentIdentifier','website_alias','alias','agent_fullname','fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','getMessages','nolimit','sort','where','pick','ChatInteractionId','filter','$gte','options','includeAll','findAll','rows','getMyMessages','hasOwnProperty','order','includeAgent','push','addTags','setTags','ids','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','tmp','attachments','transcript-%d-%s.zip','lastName','read','Account','Owner','get','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','referer','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','firstName','value','views','downloadInteraction.ejs','transcript-','.pdf','Chat','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','destroy','end','stack','name','send','render','body','contact','agent'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x4509,0x173));var _0x9450=function(_0xedb4ff,_0x54430b){_0xedb4ff=_0xedb4ff-0x0;var _0x1956b4=_0x4509[_0xedb4ff];return _0x1956b4;};'use strict';var rimraf=require(_0x9450('0x0'));var zipdir=require(_0x9450('0x1'));var rp=require(_0x9450('0x2'));var moment=require(_0x9450('0x3'));var BPromise=require(_0x9450('0x4'));var Mustache=require(_0x9450('0x5'));var util=require(_0x9450('0x6'));var path=require(_0x9450('0x7'));var ejs=require(_0x9450('0x8'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x9450('0x9'));var interaction=require(_0x9450('0xa'));var qs=require(_0x9450('0xb'));var pdf=require('../../components/export/pdf');var logger=require(_0x9450('0xc'))(_0x9450('0xd'));var config=require(_0x9450('0xe'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x9450('0xf')](config[_0x9450('0x10')],{'host':_0x9450('0x11'),'port':0x18eb});var socket=require(_0x9450('0x12'))(new Redis(config[_0x9450('0x10')]));require('./chatInteraction.socket')[_0x9450('0x13')](socket);var jayson=require(_0x9450('0x14'));var client=jayson['client']['http']({'port':0x232b});var client9004=jayson[_0x9450('0x15')][_0x9450('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x1d2af4,_0x576b8d,_0xdf58ce,_0x5cf091){return new BPromise(function(_0x5a221f,_0x3ca086){var _0x468ce0=_0x5cf091||client;return _0x468ce0[_0x9450('0x17')](_0x1d2af4,_0xdf58ce)[_0x9450('0x18')](function(_0x943a81){logger[_0x9450('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x576b8d,_0x9450('0x1a'));logger[_0x9450('0x1b')](_0x9450('0x1c'),_0x576b8d,_0x9450('0x1a'),JSON[_0x9450('0x1d')](_0x943a81));if(_0x943a81[_0x9450('0x1e')]){if(_0x943a81[_0x9450('0x1e')]['code']===0x1f4){logger[_0x9450('0x1e')](_0x9450('0x1f'),_0x576b8d,_0x943a81[_0x9450('0x1e')]['message']);return _0x3ca086(_0x943a81[_0x9450('0x1e')]['message']);}logger[_0x9450('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0x576b8d,_0x943a81[_0x9450('0x1e')][_0x9450('0x20')]);return _0x5a221f(_0x943a81[_0x9450('0x1e')][_0x9450('0x20')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x576b8d,'request\x20sent');_0x5a221f(_0x943a81[_0x9450('0x21')][_0x9450('0x20')]);}})[_0x9450('0x22')](function(_0x1f4992){logger['error'](_0x9450('0x1f'),_0x576b8d,_0x1f4992);_0x3ca086(_0x1f4992);});});}function respondWithStatusCode(_0x5c8e17,_0x54612b){_0x54612b=_0x54612b||0xcc;return function(_0x4a7313){if(_0x4a7313){return _0x5c8e17[_0x9450('0x23')](_0x54612b);}return _0x5c8e17[_0x9450('0x24')](_0x54612b)['end']();};}function respondWithResult(_0x567564,_0x4b8eec){_0x4b8eec=_0x4b8eec||0xc8;return function(_0x3906d6){if(_0x3906d6){return _0x567564['status'](_0x4b8eec)[_0x9450('0x25')](_0x3906d6);}};}function respondWithFilteredResult(_0x24082d,_0x5d3b33){return function(_0x153c21){if(_0x153c21){var _0x7613c1=typeof _0x5d3b33['offset']===_0x9450('0x26')&&typeof _0x5d3b33['limit']==='undefined';var _0x36dcd2=_0x153c21['count'];var _0xf7f019=_0x7613c1?0x0:_0x5d3b33[_0x9450('0x27')];var _0x45b261=_0x7613c1?_0x153c21[_0x9450('0x28')]:_0x5d3b33['offset']+_0x5d3b33[_0x9450('0x29')];var _0xf7ff84;if(_0x45b261>=_0x36dcd2){_0x45b261=_0x36dcd2;_0xf7ff84=0xc8;}else{_0xf7ff84=0xce;}_0x24082d['status'](_0xf7ff84);return _0x24082d[_0x9450('0x2a')](_0x9450('0x2b'),_0xf7f019+'-'+_0x45b261+'/'+_0x36dcd2)[_0x9450('0x25')](_0x153c21);}return null;};}function saveUpdates(_0x51ecf9){return function(_0x3c4e07){if(_0x3c4e07){return _0x3c4e07['update'](_0x51ecf9)[_0x9450('0x18')](function(_0x212ed4){return _0x212ed4;});}return null;};}function removeEntity(_0x546482){return function(_0x4a90e3){if(_0x4a90e3){return _0x4a90e3[_0x9450('0x2c')]()[_0x9450('0x18')](function(){_0x546482[_0x9450('0x24')](0xcc)[_0x9450('0x2d')]();});}};}function handleEntityNotFound(_0x253067){return function(_0x5ba6b6){if(!_0x5ba6b6){_0x253067['sendStatus'](0x194);}return _0x5ba6b6;};}function handleError(_0x34b535,_0xd00a1c){_0xd00a1c=_0xd00a1c||0x1f4;return function(_0x39469d){logger[_0x9450('0x1e')](_0x39469d[_0x9450('0x2e')]);if(_0x39469d['name']){delete _0x39469d[_0x9450('0x2f')];}_0x34b535['status'](_0xd00a1c)[_0x9450('0x30')](_0x39469d);};}function getMustacheRender(_0x4a3cdc,_0x16d66e){return Mustache[_0x9450('0x31')](_0x4a3cdc,_['merge'](_0x16d66e[_0x9450('0x32')],{'contact':_0x16d66e[_0x9450('0x33')],'message':_0x16d66e['message'],'agent':_0x16d66e[_0x9450('0x34')],'interaction':_0x16d66e['interaction'],'account':_0x16d66e[_0x9450('0x35')]}))||'';}exports['index']=function(_0x2065b9,_0x1a3ece){var _0x8cacfd={};var _0x296c4b=_[_0x9450('0x36')](db[_0x9450('0x37')]['rawAttributes'],function(_0x476014){return{'name':_0x476014[_0x9450('0x38')],'type':_0x476014[_0x9450('0x39')]['key']};});_0x8cacfd=qs[_0x9450('0x3a')](_0x296c4b,_0x2065b9);return interaction['findAll'](_0x9450('0x3b'),_0x2065b9[_0x9450('0x3c')],_0x2065b9[_0x9450('0x3d')],_0x8cacfd,_0x296c4b)[_0x9450('0x18')](respondWithFilteredResult(_0x1a3ece,_0x8cacfd))[_0x9450('0x22')](handleError(_0x1a3ece,null));};exports[_0x9450('0x3e')]=function(_0x1286a0,_0x2b636b){var _0x35a496={'raw':![],'where':{'id':_0x1286a0[_0x9450('0x3f')]['id']}},_0x8a494a={};_0x8a494a['model']=_['keys'](db[_0x9450('0x37')][_0x9450('0x40')]);_0x8a494a[_0x9450('0x3c')]=_[_0x9450('0x41')](_0x1286a0[_0x9450('0x3c')]);_0x8a494a[_0x9450('0x42')]=_[_0x9450('0x43')](_0x8a494a[_0x9450('0x44')],_0x8a494a[_0x9450('0x3c')]);_0x35a496['attributes']=_['intersection'](_0x8a494a[_0x9450('0x44')],qs[_0x9450('0x45')](_0x1286a0[_0x9450('0x3c')][_0x9450('0x45')]));_0x35a496[_0x9450('0x46')]=_0x35a496[_0x9450('0x46')][_0x9450('0x47')]?_0x35a496[_0x9450('0x46')]:_0x8a494a[_0x9450('0x44')];if(_0x1286a0[_0x9450('0x3c')]['includeAll']){_0x35a496[_0x9450('0x48')]=[{'all':!![]}];}_0x35a496=_[_0x9450('0x49')]({},_0x35a496,_0x1286a0['options']);return db[_0x9450('0x37')][_0x9450('0x4a')](_0x35a496)['then'](handleEntityNotFound(_0x2b636b,null))[_0x9450('0x18')](respondWithResult(_0x2b636b,null))['catch'](handleError(_0x2b636b,null));};exports[_0x9450('0x4b')]=function(_0x3d6085,_0x5a35d0){return db[_0x9450('0x37')][_0x9450('0x4b')](_0x3d6085[_0x9450('0x32')],{})[_0x9450('0x18')](respondWithResult(_0x5a35d0,0xc9))['catch'](handleError(_0x5a35d0,null));};exports['update']=function(_0x5ab9ff,_0x302f25){if(_0x5ab9ff[_0x9450('0x32')]['id']){delete _0x5ab9ff[_0x9450('0x32')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x5ab9ff[_0x9450('0x3f')]['id']}})[_0x9450('0x18')](handleEntityNotFound(_0x302f25,null))['then'](saveUpdates(_0x5ab9ff[_0x9450('0x32')],null))['then'](respondWithResult(_0x302f25,null))[_0x9450('0x22')](handleError(_0x302f25,null));};exports[_0x9450('0x2c')]=function(_0x327475,_0x2a1359){return db[_0x9450('0x37')]['find']({'where':{'id':_0x327475['params']['id']}})[_0x9450('0x18')](handleEntityNotFound(_0x2a1359,null))[_0x9450('0x18')](removeEntity(_0x2a1359,null))[_0x9450('0x22')](handleError(_0x2a1359,null));};exports['describe']=function(_0x410841,_0x5d9832){return db[_0x9450('0x37')][_0x9450('0x4c')]()[_0x9450('0x18')](respondWithResult(_0x5d9832,null))[_0x9450('0x22')](handleError(_0x5d9832,null));};exports[_0x9450('0x4d')]=function(_0x338a95,_0x129408){var _0x1bd76d=_0x338a95[_0x9450('0x3f')]['id'];var _0x49a9d0;var _0x13dfa9;var _0x54af33;return db[_0x9450('0x37')][_0x9450('0x4e')]({'where':{'id':_0x1bd76d}})[_0x9450('0x18')](function(_0x4d623e){_0x49a9d0=_0x4d623e;return db['ChatWebsite'][_0x9450('0x4e')]({'where':{'id':_0x4d623e[_0x9450('0x4f')]},'attributes':['id','vidaooApiKey',_0x9450('0x50'),_0x9450('0x51'),_0x9450('0x52'),_0x9450('0x53')],'raw':!![]});})[_0x9450('0x18')](function(_0x40665a){if(_0x40665a&&_0x40665a[_0x9450('0x54')]&&_0x40665a['vidaooEscalation']){_0x13dfa9=_0x40665a;var _0x42b95c={'interaction':{'id':_0x1bd76d},'agent':{'id':_0x338a95[_0x9450('0x3d')]['id'],'name':_0x338a95[_0x9450('0x3d')][_0x9450('0x2f')],'fullname':_0x338a95[_0x9450('0x3d')]['fullname'],'email':_0x338a95[_0x9450('0x3d')][_0x9450('0x55')]},'contact':_0x338a95[_0x9450('0x32')]['contact'],'account':_0x338a95[_0x9450('0x32')][_0x9450('0x35')]};var _0x438ba4={'rejectUnauthorized':![],'method':_0x9450('0x56'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x40665a[_0x9450('0x54')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x338a95[_0x9450('0x3d')][_0x9450('0x55')]],'buttons':null,'topic':_0x13dfa9[_0x9450('0x51')],'note':_[_0x9450('0x57')](_0x13dfa9[_0x9450('0x52')])?null:getMustacheRender(_0x13dfa9[_0x9450('0x52')],_0x42b95c),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x9450('0x57')](_0x13dfa9['vidaooMetadata'])){var _0xe1ec57=getMustacheRender(_0x13dfa9[_0x9450('0x53')],_0x42b95c);var _0x20e893=JSON[_0x9450('0x58')](_0xe1ec57);_0x438ba4[_0x9450('0x32')][_0x9450('0x59')]=_0x20e893;}}catch(_0x21e98f){throw new db[(_0x9450('0x5a'))][(_0x9450('0x5b'))](_0x9450('0x5c'));}return rp(_0x438ba4);}else{throw new db[(_0x9450('0x5a'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x9450('0x18')](function(_0x1550f6){_0x54af33=_0x1550f6;if(_0x54af33['id']){var _0x5ed908={'body':_0x54af33[_0x9450('0x5d')],'ChatWebsiteId':_0x13dfa9['id'],'ChatInteractionId':_0x49a9d0['id'],'direction':_0x9450('0x5e'),'UserId':_0x338a95[_0x9450('0x3d')]['id']};return db['ChatMessage'][_0x9450('0x4b')](_0x5ed908,{});}else{throw new db[(_0x9450('0x5a'))]['ValidationError'](_0x9450('0x5f'));}})[_0x9450('0x18')](function(){return _0x49a9d0[_0x9450('0x60')]({'vidaooSessionId':_0x54af33['id']});})[_0x9450('0x18')](respondWithResult(_0x129408,null))['catch'](handleError(_0x129408,null));};exports[_0x9450('0x61')]=function(_0xe3d43e,_0x241d81){if(_0xe3d43e[_0x9450('0x32')]['id']){delete _0xe3d43e[_0x9450('0x32')]['id'];}return db['ChatInteraction'][_0x9450('0x4a')]({'where':{'id':_0xe3d43e[_0x9450('0x3f')]['id']},'include':[{'model':db[_0x9450('0x62')],'as':_0x9450('0x63')}]})[_0x9450('0x18')](handleEntityNotFound(_0x241d81,null))[_0x9450('0x18')](saveUpdates(_0xe3d43e[_0x9450('0x32')],null))[_0x9450('0x18')](respondWithResult(_0x241d81,null))[_0x9450('0x22')](handleError(_0x241d81,null));};exports[_0x9450('0x64')]=function(_0x56fcd1,_0x448c24){if(_0x56fcd1[_0x9450('0x32')]['id']){delete _0x56fcd1[_0x9450('0x32')]['id'];}return db[_0x9450('0x37')][_0x9450('0x4a')]({'where':{'id':_0x56fcd1[_0x9450('0x3f')]['id']}})[_0x9450('0x18')](function(_0x492d71){if(!_0x492d71){logger[_0x9450('0x1e')](_0x9450('0x65'),_0x9450('0x64'),0x194,_0x9450('0x66'));_0x448c24[_0x9450('0x23')](0x194);}else{if(_0x492d71[_0x9450('0x67')]){throw new db[(_0x9450('0x5a'))][(_0x9450('0x5b'))](_0x9450('0x68'));}}return _0x492d71;})[_0x9450('0x18')](function(_0x4c6685){if(_0x4c6685){return _0x4c6685['update']({'closed':_0x56fcd1[_0x9450('0x32')][_0x9450('0x69')],'disposition':_0x56fcd1[_0x9450('0x32')][_0x9450('0x6a')]})['then'](function(_0xb6112f){return _0xb6112f;});}})[_0x9450('0x18')](function(){return respondWithRpcPromise(_0x9450('0x6b'),_0x9450('0x64'),_0x56fcd1[_0x9450('0x32')],client9004);})[_0x9450('0x18')](respondWithResult(_0x448c24,null))['catch'](handleError(_0x448c24,null));};exports[_0x9450('0x6c')]=function(_0x379a1d,_0x2409ec){_0x379a1d[_0x9450('0x32')]['name']=_0x379a1d[_0x9450('0x6d')]['originalname'];_0x379a1d[_0x9450('0x32')][_0x9450('0x6e')]=_0x379a1d[_0x9450('0x6d')][_0x9450('0x6f')];_0x379a1d[_0x9450('0x32')]['type']=_0x379a1d[_0x9450('0x6d')][_0x9450('0x70')];return db[_0x9450('0x71')][_0x9450('0x4b')](_0x379a1d[_0x9450('0x32')])[_0x9450('0x18')](respondWithResult(_0x2409ec,0xc9))['catch'](handleError(_0x2409ec,null));};exports[_0x9450('0x72')]=function(_0x52d4b8,_0x2a2784){return db[_0x9450('0x37')][_0x9450('0x4e')]({'where':{'id':_0x52d4b8[_0x9450('0x3f')]['id']},'raw':!![]})[_0x9450('0x18')](handleEntityNotFound(_0x2a2784,null))['then'](function(_0x3471c8){if(_0x3471c8){if(_0x3471c8[_0x9450('0x69')]){return _0x2a2784[_0x9450('0x24')](0x193)[_0x9450('0x25')]({'status':0x193,'message':_0x9450('0x73')});}return db[_0x9450('0x71')][_0x9450('0x4e')]({'where':{'id':_0x52d4b8[_0x9450('0x3c')]['attachId']},'raw':!![]})[_0x9450('0x18')](handleEntityNotFound(_0x2a2784,null));}})['then'](function(_0x5c7996){if(_0x5c7996){var _0xcd1201=_0x5c7996[_0x9450('0x74')]!==null;var _0x485968=path['join'](config[_0x9450('0x75')],_0x9450('0x76'));if(_0xcd1201){_0x485968=path[_0x9450('0x77')](_0x485968,'offline-chat/');}var _0x11ac39=path['join'](_0x485968,_0x5c7996[_0x9450('0x6e')]);return _0x2a2784[_0x9450('0x78')](_0x11ac39);}})[_0x9450('0x22')](handleError(_0x2a2784,null));};exports[_0x9450('0x79')]=function(_0x2590f4,_0x3dcf9e){var _0x3d0eaa=null;var _0x3d0c46=null;var _0x409819=null;if(_0x2590f4[_0x9450('0x32')]['id']){delete _0x2590f4[_0x9450('0x32')]['id'];}if(_0x2590f4['body'][_0x9450('0x7a')]){_0x409819=path[_0x9450('0x77')](config[_0x9450('0x75')],'server/files/chat/upload/',util[_0x9450('0x7b')](_0x9450('0x7c'),Date[_0x9450('0x7d')]()));_0x2590f4[_0x9450('0x32')]['pathTranscript']=_0x409819;}return db['ChatInteraction'][_0x9450('0x4a')]({'where':{'id':_0x2590f4[_0x9450('0x3f')]['id']},'include':[{'model':db[_0x9450('0x7e')],'as':_0x9450('0x7f'),'include':[{'model':db[_0x9450('0x80')],'as':_0x9450('0x80')}]}]})[_0x9450('0x18')](handleEntityNotFound(_0x3dcf9e,null))['then'](saveUpdates(_0x2590f4[_0x9450('0x32')],null))[_0x9450('0x18')](function(_0x1a05b1){if(_0x1a05b1){_0x3d0eaa=_0x1a05b1;return db[_0x9450('0x81')][_0x9450('0x4a')]({'where':{'id':_0x3d0eaa[_0x9450('0x4f')]}});}})[_0x9450('0x18')](function(_0x18808b){if(_0x18808b){_0x3d0c46=_0x18808b;return db[_0x9450('0x62')][_0x9450('0x4a')]({'where':{'id':_0x3d0eaa['ContactId']}});}})[_0x9450('0x18')](function(_0x3c4628){if(_0x3c4628){if(_0x409819){var _0x3bd07c=null;for(var _0x5d2bff=0x1;_0x5d2bff<_0x3d0eaa['Messages']['length'];++_0x5d2bff){_0x3bd07c=_0x3d0eaa[_0x9450('0x7f')][_0x5d2bff];var _0x173552=_0x3bd07c[_0x9450('0x67')]?util[_0x9450('0x7b')](_0x9450('0x82'),_0x3d0c46[_0x9450('0x83')],_0x3bd07c[_0x9450('0x67')]):_0x9450('0x84');var _0x2c9b21=_0x2590f4[_0x9450('0x32')][_0x9450('0x85')]||util[_0x9450('0x7b')](_0x9450('0x82'),_0x9450('0x86'),_0x3bd07c[_0x9450('0x87')]);switch(_0x3d0c46[_0x9450('0x88')]){case _0x9450('0x89'):_0x173552=_0x3bd07c[_0x9450('0x67')]?util[_0x9450('0x7b')]('%s%d',_0x3d0c46[_0x9450('0x83')],_0x3bd07c[_0x9450('0x67')]):_0x9450('0x84');break;case'agent_alias':_0x173552=_0x3bd07c['UserId']?_0x3bd07c[_0x9450('0x80')][_0x9450('0x8a')]||_0x3bd07c[_0x9450('0x80')]['fullname']:_0x9450('0x84');break;case _0x9450('0x8b'):_0x173552=_0x3bd07c[_0x9450('0x67')]?_0x3bd07c['User'][_0x9450('0x8c')]:_0x9450('0x84');break;default:_0x173552=_0x3bd07c['UserId']?util[_0x9450('0x7b')](_0x9450('0x82'),_0x3d0c46[_0x9450('0x83')],_0x3bd07c[_0x9450('0x67')]):_0x9450('0x84');}var _0x5c02c8=util[_0x9450('0x7b')]('[%s]\x20%s:\x20%s\x0a',moment(_0x3bd07c[_0x9450('0x8d')])[_0x9450('0x7b')](_0x9450('0x8e')),_0x3bd07c[_0x9450('0x8f')]==='in'?_0x2c9b21:_0x173552,_0x3bd07c[_0x9450('0x32')]);if(!_0x3bd07c[_0x9450('0x90')]){fs[_0x9450('0x91')](_0x409819,_0x5c02c8);}}return db[_0x9450('0x92')][_0x9450('0x4e')]({'where':{'service':!![]},'include':[{'model':db[_0x9450('0x93')],'as':_0x9450('0x94'),'raw':!![],'include':[{'model':db[_0x9450('0x95')],'as':_0x9450('0x95'),'raw':!![]}]}]});}}})[_0x9450('0x18')](function(_0x2e69fc){if(!_0x2e69fc||!_0x2e69fc[_0x9450('0x94')]||!_0x2590f4[_0x9450('0x32')])return _0x3d0eaa;var _0x8714ff=_0x2e69fc[_0x9450('0x96')]();return respondWithRpcPromise('SendMail',_0x9450('0x97'),{'account':_0x8714ff,'message':{'from':util[_0x9450('0x7b')](_0x9450('0x98'),_0x2e69fc[_0x9450('0x2f')],_0x2e69fc[_0x9450('0x55')]||_0x2e69fc[_0x9450('0x94')][_0x9450('0x3d')]),'to':_0x2590f4[_0x9450('0x32')][_0x9450('0x7a')],'subject':'Mail\x20Transcript','text':util[_0x9450('0x7b')](_0x9450('0x99'),_0x2590f4[_0x9450('0x32')]['mailTranscript']),'attachments':[{'path':_0x409819}]}})[_0x9450('0x18')](function(){return _0x3d0eaa;})['catch'](function(_0x1a2b5e){logger['error'](_0x1a2b5e);});})['then'](respondWithStatusCode(_0x3dcf9e,0xc8))['catch'](handleError(_0x3dcf9e,null));};exports[_0x9450('0x9a')]=function(_0x587016,_0x5daa6a){return db[_0x9450('0x7e')][_0x9450('0x4a')]({'where':{'id':_0x587016[_0x9450('0x3f')]['id']}})[_0x9450('0x18')](handleEntityNotFound(_0x5daa6a,null))[_0x9450('0x18')](function(_0x128095){if(_0x128095){return _0x128095[_0x9450('0x9a')](_0x587016[_0x9450('0x32')]['ids'],_[_0x9450('0x9b')](_0x587016[_0x9450('0x32')],['ids','id'])||{});}})['then'](respondWithResult(_0x5daa6a,null))[_0x9450('0x22')](handleError(_0x5daa6a,null));};exports[_0x9450('0x9c')]=function(_0x595eb2,_0x536758){var _0x3ed545={'raw':![],'where':{}};var _0x45c796={};var _0x1bb6a1={'count':0x0,'rows':[]};return db[_0x9450('0x37')][_0x9450('0x4e')]({'where':{'id':_0x595eb2['params']['id']}})[_0x9450('0x18')](handleEntityNotFound(_0x536758,null))[_0x9450('0x18')](function(_0x3fc722){if(_0x3fc722){_0x45c796[_0x9450('0x44')]=_[_0x9450('0x41')](db['ChatMessage'][_0x9450('0x40')]);_0x45c796[_0x9450('0x3c')]=_[_0x9450('0x41')](_0x595eb2['query']);_0x45c796[_0x9450('0x42')]=_[_0x9450('0x43')](_0x45c796[_0x9450('0x44')],_0x45c796[_0x9450('0x3c')]);_0x3ed545[_0x9450('0x46')]=_[_0x9450('0x43')](_0x45c796[_0x9450('0x44')],qs[_0x9450('0x45')](_0x595eb2[_0x9450('0x3c')][_0x9450('0x45')]));_0x3ed545[_0x9450('0x46')]=_0x3ed545[_0x9450('0x46')][_0x9450('0x47')]?_0x3ed545[_0x9450('0x46')]:_0x45c796[_0x9450('0x44')];if(!_0x595eb2[_0x9450('0x3c')]['hasOwnProperty'](_0x9450('0x9d'))){_0x3ed545[_0x9450('0x29')]=qs[_0x9450('0x29')](_0x595eb2['query'][_0x9450('0x29')]);_0x3ed545[_0x9450('0x27')]=qs['offset'](_0x595eb2[_0x9450('0x3c')][_0x9450('0x27')]);}_0x3ed545['order']=qs['sort'](_0x595eb2[_0x9450('0x3c')][_0x9450('0x9e')]);_0x3ed545[_0x9450('0x9f')]=qs[_0x9450('0x42')](_[_0x9450('0xa0')](_0x595eb2['query'],_0x45c796[_0x9450('0x42')]));_0x3ed545[_0x9450('0x9f')][_0x9450('0xa1')]=_0x3fc722['id'];if(_0x595eb2[_0x9450('0x3c')][_0x9450('0xa2')]){_0x3ed545[_0x9450('0x9f')]=_['merge'](_0x3ed545[_0x9450('0x9f')],{'$or':_[_0x9450('0x36')](_0x3ed545['attributes'],function(_0xe9b6c1){var _0x2e4038={};_0x2e4038[_0xe9b6c1]={'$like':'%'+_0x595eb2[_0x9450('0x3c')][_0x9450('0xa2')]+'%'};return _0x2e4038;})});}if(_0x595eb2[_0x9450('0x3c')][_0x9450('0xa3')]){var _0x546aaa=_0x595eb2[_0x9450('0x3c')][_0x9450('0xa3')]['split'](',');var _0x11c88b={};_0x11c88b[_0x546aaa[0x0]]={'$gte':moment(_0x546aaa[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3ed545['where']=_['merge'](_0x3ed545['where'],_0x11c88b);}_0x3ed545=_[_0x9450('0x49')]({},_0x3ed545,_0x595eb2[_0x9450('0xa4')]);return db[_0x9450('0x7e')][_0x9450('0x28')]({'where':_0x3ed545[_0x9450('0x9f')]})[_0x9450('0x18')](function(_0x4c172a){_0x1bb6a1[_0x9450('0x28')]=_0x4c172a;if(_0x595eb2[_0x9450('0x3c')][_0x9450('0xa5')]){_0x3ed545['include']=[{'all':!![]}];}return db[_0x9450('0x7e')][_0x9450('0xa6')](_0x3ed545);})[_0x9450('0x18')](function(_0x393d3d){_0x1bb6a1[_0x9450('0xa7')]=_0x393d3d;return _0x1bb6a1;});}})[_0x9450('0x18')](respondWithFilteredResult(_0x536758,_0x3ed545))[_0x9450('0x22')](handleError(_0x536758,null));};exports[_0x9450('0xa8')]=function(_0x6b290e,_0x38cfcf){var _0x1cc52c={'where':{}},_0x298d9a={},_0x349231={'count':0x0,'rows':[]};return db[_0x9450('0x37')][_0x9450('0x4e')]({'where':{'id':_0x6b290e['params']['id']}})[_0x9450('0x18')](handleEntityNotFound(_0x38cfcf,null))[_0x9450('0x18')](function(_0x458421){if(_0x458421){_0x298d9a['model']=_['keys'](db[_0x9450('0x7e')][_0x9450('0x40')]);_0x298d9a[_0x9450('0x3c')]=_[_0x9450('0x41')](_0x6b290e[_0x9450('0x3c')]);_0x298d9a['filters']=_[_0x9450('0x43')](_0x298d9a[_0x9450('0x44')],_0x298d9a[_0x9450('0x3c')]);_0x1cc52c['attributes']=_[_0x9450('0x43')](_0x298d9a[_0x9450('0x44')],qs['fields'](_0x6b290e[_0x9450('0x3c')][_0x9450('0x45')]));_0x1cc52c['attributes']=_0x1cc52c['attributes'][_0x9450('0x47')]?_0x1cc52c['attributes']:_0x298d9a[_0x9450('0x44')];if(!_0x6b290e['query'][_0x9450('0xa9')](_0x9450('0x9d'))){_0x1cc52c[_0x9450('0x29')]=qs['limit'](_0x6b290e[_0x9450('0x3c')][_0x9450('0x29')]);_0x1cc52c[_0x9450('0x27')]=qs[_0x9450('0x27')](_0x6b290e[_0x9450('0x3c')][_0x9450('0x27')]);}_0x1cc52c[_0x9450('0xaa')]=qs['sort'](_0x6b290e['query'][_0x9450('0x9e')]);_0x1cc52c['where']=qs[_0x9450('0x42')](_['pick'](_0x6b290e['query'],_0x298d9a[_0x9450('0x42')]));_0x1cc52c[_0x9450('0x9f')][_0x9450('0xa1')]=_0x458421['id'];if(_0x6b290e['query'][_0x9450('0xa2')]){_0x1cc52c[_0x9450('0x9f')]=_[_0x9450('0x49')](_0x1cc52c[_0x9450('0x9f')],{'$or':_[_0x9450('0x36')](_0x1cc52c[_0x9450('0x46')],function(_0x23c6f5){var _0x44831a={};_0x44831a[_0x23c6f5]={'$like':'%'+_0x6b290e[_0x9450('0x3c')][_0x9450('0xa2')]+'%'};return _0x44831a;})});}_0x1cc52c[_0x9450('0x9f')][_0x9450('0x90')]=![];if(_0x6b290e[_0x9450('0x3c')]['id']){_0x1cc52c['where']['id']={'$gt':_0x6b290e['query']['id']};}_0x1cc52c=_[_0x9450('0x49')]({},_0x1cc52c,_0x6b290e['options']);return db[_0x9450('0x7e')]['count']({'where':_0x1cc52c['where']})[_0x9450('0x18')](function(_0x286e4a){_0x349231['count']=_0x286e4a;_0x1cc52c[_0x9450('0x48')]=[];if(_0x6b290e[_0x9450('0x3c')][_0x9450('0xab')]){_0x1cc52c[_0x9450('0x48')][_0x9450('0xac')]({'model':db[_0x9450('0x80')],'as':_0x9450('0x80'),'attributes':['id',_0x9450('0x8c'),_0x9450('0x8a')]});}if(_0x6b290e['query']['includeAll']){_0x1cc52c[_0x9450('0x48')]=[{'all':!![]}];}return db['ChatMessage'][_0x9450('0xa6')](_0x1cc52c);})[_0x9450('0x18')](function(_0x29f14c){_0x349231['rows']=_0x29f14c;return _0x349231;});}})[_0x9450('0x18')](respondWithFilteredResult(_0x38cfcf,_0x1cc52c))[_0x9450('0x22')](handleError(_0x38cfcf,null));};exports[_0x9450('0xad')]=function(_0x4cfd3d,_0x2f7dd8){return db[_0x9450('0x37')][_0x9450('0x4a')]({'where':{'id':_0x4cfd3d['params']['id']}})[_0x9450('0x18')](handleEntityNotFound(_0x2f7dd8,null))[_0x9450('0x18')](function(_0xa810f0){if(_0xa810f0){return _0xa810f0[_0x9450('0xae')](_0x4cfd3d[_0x9450('0x32')][_0x9450('0xaf')],_[_0x9450('0x9b')](_0x4cfd3d[_0x9450('0x32')],[_0x9450('0xaf'),'id'])||{})['spread'](function(){return db[_0x9450('0xb0')]['findAll']({'attributes':['id','name',_0x9450('0xb1')],'where':{'id':_0x4cfd3d[_0x9450('0x32')]['ids']}});})[_0x9450('0x18')](function(_0x124f96){socket[_0x9450('0xb2')](_0x9450('0xb3'),{'id':Number(_0x4cfd3d[_0x9450('0x3f')]['id']),'tags':_0x124f96||[]});return{'id':Number(_0x4cfd3d[_0x9450('0x3f')]['id']),'tags':_0x124f96||[]};});}})[_0x9450('0x18')](respondWithResult(_0x2f7dd8,null))[_0x9450('0x22')](handleError(_0x2f7dd8,null));};exports['removeTags']=function(_0x1dc027,_0x5d91e3){return db[_0x9450('0x37')][_0x9450('0x4a')]({'where':{'id':_0x1dc027[_0x9450('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5d91e3,null))[_0x9450('0x18')](function(_0x5ebb6b){if(_0x5ebb6b){return _0x5ebb6b[_0x9450('0xb4')](_0x1dc027[_0x9450('0x3c')]['ids']);}})[_0x9450('0x18')](respondWithStatusCode(_0x5d91e3,null))[_0x9450('0x22')](handleError(_0x5d91e3,null));};exports[_0x9450('0x78')]=function(_0x5d7112,_0x13077d){var _0x2625e7=moment()[_0x9450('0xb5')]()[_0x9450('0xb6')]();var _0x3d949f=path[_0x9450('0x77')](config[_0x9450('0x75')],_0x9450('0xb7'),'files',_0x9450('0xb8'));var _0x14b111=path[_0x9450('0x77')](config[_0x9450('0x75')],_0x9450('0xb7'),'files',_0x9450('0xb9'));var _0x1d26bb=path[_0x9450('0x77')](_0x3d949f,_0x2625e7);var _0x163926=util[_0x9450('0x7b')](_0x9450('0xba'),_0x5d7112[_0x9450('0x3f')]['id'],_0x2625e7);var _0x115e66=path[_0x9450('0x77')](_0x3d949f,_0x163926);var _0x1f1b4a=[];_0x1f1b4a[_0x9450('0xac')]({'model':db[_0x9450('0x80')],'as':_0x9450('0x80'),'attributes':['id','fullname'],'raw':!![]});_0x1f1b4a[_0x9450('0xac')]({'model':db[_0x9450('0x62')],'as':_0x9450('0x63'),'attributes':['id','firstName',_0x9450('0xbb')],'raw':!![]});if(_0x5d7112[_0x9450('0x3c')][_0x9450('0xb9')]){_0x1f1b4a['push']({'model':db[_0x9450('0x71')],'as':_0x9450('0x71'),'raw':!![]});}var _0x229fea=[{'model':db[_0x9450('0x7e')],'as':_0x9450('0x7f'),'attributes':['id',_0x9450('0x32'),_0x9450('0x8d'),_0x9450('0x8f'),'secret',_0x9450('0xbc')],'include':_0x1f1b4a}];_0x229fea[_0x9450('0xac')]({'model':db[_0x9450('0x81')],'as':_0x9450('0xbd'),'attributes':['id',_0x9450('0x2f')]});_0x229fea[_0x9450('0xac')]({'model':db[_0x9450('0x80')],'as':_0x9450('0xbe'),'attributes':['id','fullname']});return db[_0x9450('0x37')][_0x9450('0x4a')]({'where':{'id':_0x5d7112[_0x9450('0x3f')]['id']},'include':_0x229fea})['then'](handleEntityNotFound(_0x13077d,null))[_0x9450('0x18')](function(_0x31c170){if(_0x31c170){var _0x4e800e=_0x31c170[_0x9450('0xbf')]({'plain':!![]});fs['mkdirSync'](_0x1d26bb);var _0x1edd65={'channel':'Chat','account':_0x4e800e[_0x9450('0xbd')]['name'],'agent':_0x4e800e[_0x9450('0xbe')]?_0x4e800e['Owner'][_0x9450('0x8c')]:_0x9450('0xc0'),'createdAt':moment(_0x4e800e[_0x9450('0x8d')])[_0x9450('0x7b')](_0x9450('0xc1'))[_0x9450('0xb6')](),'closedAt':_0x4e800e['closed']?moment(_0x4e800e[_0x9450('0xc2')])[_0x9450('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9450('0xb6')]():'','disposition':_0x4e800e[_0x9450('0x6a')],'chatInfo':{'browser':_0x4e800e['browserName'],'os':_0x4e800e['osName'],'referer':_0x4e800e[_0x9450('0xc3')],'customerIp':_0x4e800e[_0x9450('0xc4')],'customerPort':_0x4e800e[_0x9450('0xc5')]?_0x4e800e[_0x9450('0xc5')]:_0x9450('0xc0')},'messages':_(_0x4e800e[_0x9450('0x7f')])[_0x9450('0xc6')]()[_0x9450('0xa2')]({'secret':![]})[_0x9450('0x36')](function(_0x472712){if(_0x472712['Attachment']){var _0x6560ca=path[_0x9450('0x77')](_0x14b111,_0x472712[_0x9450('0x71')]['basename']);if(fs[_0x9450('0xc7')](_0x6560ca)){fs[_0x9450('0xc8')](_0x6560ca)['pipe'](fs[_0x9450('0xc9')](path[_0x9450('0x77')](_0x1d26bb,_0x472712[_0x9450('0x71')][_0x9450('0x6e')])));}}return{'date':moment(_0x472712[_0x9450('0x8d')])['format'](_0x9450('0xc1'))['toString'](),'sender':_0x472712[_0x9450('0x8f')]===_0x9450('0x5e')?_0x472712['User']?_0x472712[_0x9450('0x80')][_0x9450('0x8c')]:'System':_0x472712[_0x9450('0x63')][_0x9450('0xca')]+(_0x472712[_0x9450('0x63')][_0x9450('0xbb')]?'\x20'+_0x472712[_0x9450('0x63')][_0x9450('0xbb')]:''),'body':_0x472712[_0x9450('0x71')]?_0x472712[_0x9450('0x71')][_0x9450('0x6e')]:_0x472712['body'],'direction':_0x472712[_0x9450('0x8f')]===_0x9450('0x5e')?'A':'C','secret':_0x472712[_0x9450('0x90')],'read':_0x472712[_0x9450('0xbc')],'attachment':_0x472712[_0x9450('0x71')]};})[_0x9450('0xcb')]()};return ejs['renderFile'](path[_0x9450('0x77')](config[_0x9450('0x75')],_0x9450('0xb7'),_0x9450('0xcc'),_0x9450('0xcd')),{'interaction':_0x1edd65})[_0x9450('0x18')](function(_0x22cf20){var _0x1aff24=path[_0x9450('0x77')](_0x1d26bb,_0x9450('0xce')+_0x4e800e['id']+'-'+_0x2625e7+_0x9450('0xcf'));var _0x4702b0={'path':_0x1aff24,'channel':_0x9450('0xd0'),'interactionId':_0x4e800e['id']};return pdf[_0x9450('0xd1')](_0x22cf20,_0x4702b0);})[_0x9450('0x18')](function(){return new Promise(function(_0xa1bceb,_0x57ca46){zipdir(_0x1d26bb,{'saveTo':_0x115e66},function(_0x5d3689,_0x17a093){if(_0x5d3689)return _0x57ca46(_0x5d3689);return _0xa1bceb(_0x17a093);});})[_0x9450('0x18')](function(){return new BPromise(function(_0x437758,_0x27cf0e){rimraf(_0x1d26bb,function(_0x4b2396){if(_0x4b2396)_0x27cf0e(_0x4b2396);return _0x437758();});});})['then'](function(){return _0x13077d[_0x9450('0x78')](_0x115e66,_0x163926,function(_0xe6ab8d){if(_0xe6ab8d){logger[_0x9450('0x1e')](_0x9450('0xd2'),_0xe6ab8d);}else{fs[_0x9450('0xd3')](_0x115e66);}});});});}else{return _0x13077d['sendStatus'](0xc8);}})['catch'](handleError(_0x13077d,null));};
\ No newline at end of file
+var _0x0e5c=['ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','then','destroy','sendStatus','stack','name','send','render','body','contact','agent','account','index','map','ChatInteraction','rawAttributes','type','getOptions','findAll','query','user','params','model','keys','filters','attributes','intersection','fields','length','include','merge','options','find','create','update','describe','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','originalname','file','filename','mimetype','Attachment','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','download','format','pathTranscript','ChatMessage','Messages','User','CmContact','%s%d','agentAlias','customer','Visitor','ContactId','agentIdentifier','website_alias','agent_alias','alias','System','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','order','sort','where','pick','ChatInteractionId','filter','$gte','split','rows','getMyMessages','nolimit','includeAgent','includeAll','addTags','spread','color','removeTags','unix','toString','files','server','attachments','transcript-%d-%s.zip','push','Contact','firstName','lastName','Account','Owner','get','mkdirSync','Chat','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','read','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','rimraf','request-promise','moment','bluebird','mustache','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','socket.io-emitter','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xa2cd53,_0x56a30a){var _0x4b92b1=function(_0x1c9d7c){while(--_0x1c9d7c){_0xa2cd53['push'](_0xa2cd53['shift']());}};_0x4b92b1(++_0x56a30a);}(_0x0e5c,0x17e));var _0xc0e5=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x0e5c[_0x13ea00];return _0x1f7347;};'use strict';var rimraf=require(_0xc0e5('0x0'));var zipdir=require('zip-dir');var rp=require(_0xc0e5('0x1'));var moment=require(_0xc0e5('0x2'));var BPromise=require(_0xc0e5('0x3'));var Mustache=require(_0xc0e5('0x4'));var util=require('util');var path=require('path');var ejs=require(_0xc0e5('0x5'));var fs=require('fs');var _=require(_0xc0e5('0x6'));var Redis=require(_0xc0e5('0x7'));var interaction=require(_0xc0e5('0x8'));var qs=require(_0xc0e5('0x9'));var pdf=require('../../components/export/pdf');var logger=require(_0xc0e5('0xa'))('api');var config=require(_0xc0e5('0xb'));var db=require(_0xc0e5('0xc'))['db'];config[_0xc0e5('0xd')]=_['defaults'](config[_0xc0e5('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xc0e5('0xe'))(new Redis(config[_0xc0e5('0xd')]));require('./chatInteraction.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xc0e5('0xf')][_0xc0e5('0x10')]({'port':0x232b});var client9004=jayson[_0xc0e5('0xf')][_0xc0e5('0x10')]({'port':0x232c});function respondWithRpcPromise(_0x383461,_0x140b42,_0x16216c,_0x17c217){return new BPromise(function(_0x28a1d5,_0x12855f){var _0x409305=_0x17c217||client;return _0x409305[_0xc0e5('0x11')](_0x383461,_0x16216c)['then'](function(_0x2311e9){logger[_0xc0e5('0x12')](_0xc0e5('0x13'),_0x140b42,_0xc0e5('0x14'));logger[_0xc0e5('0x15')](_0xc0e5('0x16'),_0x140b42,_0xc0e5('0x14'),JSON[_0xc0e5('0x17')](_0x2311e9));if(_0x2311e9[_0xc0e5('0x18')]){if(_0x2311e9['error'][_0xc0e5('0x19')]===0x1f4){logger[_0xc0e5('0x18')](_0xc0e5('0x13'),_0x140b42,_0x2311e9['error']['message']);return _0x12855f(_0x2311e9[_0xc0e5('0x18')][_0xc0e5('0x1a')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x140b42,_0x2311e9[_0xc0e5('0x18')]['message']);return _0x28a1d5(_0x2311e9['error'][_0xc0e5('0x1a')]);}else{logger['info'](_0xc0e5('0x13'),_0x140b42,_0xc0e5('0x14'));_0x28a1d5(_0x2311e9[_0xc0e5('0x1b')]['message']);}})[_0xc0e5('0x1c')](function(_0x431ef1){logger[_0xc0e5('0x18')](_0xc0e5('0x13'),_0x140b42,_0x431ef1);_0x12855f(_0x431ef1);});});}function respondWithStatusCode(_0x32df09,_0x53ae3e){_0x53ae3e=_0x53ae3e||0xcc;return function(_0x208c75){if(_0x208c75){return _0x32df09['sendStatus'](_0x53ae3e);}return _0x32df09[_0xc0e5('0x1d')](_0x53ae3e)[_0xc0e5('0x1e')]();};}function respondWithResult(_0x212d18,_0x10e258){_0x10e258=_0x10e258||0xc8;return function(_0x2542c3){if(_0x2542c3){return _0x212d18[_0xc0e5('0x1d')](_0x10e258)[_0xc0e5('0x1f')](_0x2542c3);}};}function respondWithFilteredResult(_0x13271b,_0x17ca16){return function(_0x40411a){if(_0x40411a){var _0x108690=typeof _0x17ca16['offset']===_0xc0e5('0x20')&&typeof _0x17ca16[_0xc0e5('0x21')]===_0xc0e5('0x20');var _0x1b9b30=_0x40411a[_0xc0e5('0x22')];var _0x2e5fa1=_0x108690?0x0:_0x17ca16[_0xc0e5('0x23')];var _0x92b44f=_0x108690?_0x40411a['count']:_0x17ca16[_0xc0e5('0x23')]+_0x17ca16['limit'];var _0x57745b;if(_0x92b44f>=_0x1b9b30){_0x92b44f=_0x1b9b30;_0x57745b=0xc8;}else{_0x57745b=0xce;}_0x13271b[_0xc0e5('0x1d')](_0x57745b);return _0x13271b[_0xc0e5('0x24')](_0xc0e5('0x25'),_0x2e5fa1+'-'+_0x92b44f+'/'+_0x1b9b30)['json'](_0x40411a);}return null;};}function saveUpdates(_0x2b9c29){return function(_0x5743cc){if(_0x5743cc){return _0x5743cc['update'](_0x2b9c29)[_0xc0e5('0x26')](function(_0xac1938){return _0xac1938;});}return null;};}function removeEntity(_0xd6f7d6){return function(_0x7d30db){if(_0x7d30db){return _0x7d30db[_0xc0e5('0x27')]()[_0xc0e5('0x26')](function(){_0xd6f7d6[_0xc0e5('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4def8f){return function(_0x1f6952){if(!_0x1f6952){_0x4def8f[_0xc0e5('0x28')](0x194);}return _0x1f6952;};}function handleError(_0x446a2c,_0x98ce70){_0x98ce70=_0x98ce70||0x1f4;return function(_0x271fa3){logger[_0xc0e5('0x18')](_0x271fa3[_0xc0e5('0x29')]);if(_0x271fa3[_0xc0e5('0x2a')]){delete _0x271fa3[_0xc0e5('0x2a')];}_0x446a2c[_0xc0e5('0x1d')](_0x98ce70)[_0xc0e5('0x2b')](_0x271fa3);};}function getMustacheRender(_0x8065d3,_0x299ec9){return Mustache[_0xc0e5('0x2c')](_0x8065d3,_['merge'](_0x299ec9[_0xc0e5('0x2d')],{'contact':_0x299ec9[_0xc0e5('0x2e')],'message':_0x299ec9[_0xc0e5('0x1a')],'agent':_0x299ec9[_0xc0e5('0x2f')],'interaction':_0x299ec9['interaction'],'account':_0x299ec9[_0xc0e5('0x30')]}))||'';}exports[_0xc0e5('0x31')]=function(_0x32a5ea,_0x566867){var _0x511ae0={};var _0x46372a=_[_0xc0e5('0x32')](db[_0xc0e5('0x33')][_0xc0e5('0x34')],function(_0x2e2cc7){return{'name':_0x2e2cc7['fieldName'],'type':_0x2e2cc7[_0xc0e5('0x35')]['key']};});_0x511ae0=qs[_0xc0e5('0x36')](_0x46372a,_0x32a5ea);return interaction[_0xc0e5('0x37')]('chat',_0x32a5ea[_0xc0e5('0x38')],_0x32a5ea[_0xc0e5('0x39')],_0x511ae0,_0x46372a)[_0xc0e5('0x26')](respondWithFilteredResult(_0x566867,_0x511ae0))[_0xc0e5('0x1c')](handleError(_0x566867,null));};exports['show']=function(_0x201776,_0x28b8a6){var _0x352ed2={'raw':![],'where':{'id':_0x201776[_0xc0e5('0x3a')]['id']}},_0x5ba1b5={};_0x5ba1b5[_0xc0e5('0x3b')]=_['keys'](db['ChatInteraction']['rawAttributes']);_0x5ba1b5[_0xc0e5('0x38')]=_[_0xc0e5('0x3c')](_0x201776[_0xc0e5('0x38')]);_0x5ba1b5[_0xc0e5('0x3d')]=_['intersection'](_0x5ba1b5['model'],_0x5ba1b5[_0xc0e5('0x38')]);_0x352ed2[_0xc0e5('0x3e')]=_[_0xc0e5('0x3f')](_0x5ba1b5[_0xc0e5('0x3b')],qs[_0xc0e5('0x40')](_0x201776['query'][_0xc0e5('0x40')]));_0x352ed2[_0xc0e5('0x3e')]=_0x352ed2['attributes'][_0xc0e5('0x41')]?_0x352ed2[_0xc0e5('0x3e')]:_0x5ba1b5[_0xc0e5('0x3b')];if(_0x201776[_0xc0e5('0x38')]['includeAll']){_0x352ed2[_0xc0e5('0x42')]=[{'all':!![]}];}_0x352ed2=_[_0xc0e5('0x43')]({},_0x352ed2,_0x201776[_0xc0e5('0x44')]);return db[_0xc0e5('0x33')][_0xc0e5('0x45')](_0x352ed2)[_0xc0e5('0x26')](handleEntityNotFound(_0x28b8a6,null))['then'](respondWithResult(_0x28b8a6,null))['catch'](handleError(_0x28b8a6,null));};exports[_0xc0e5('0x46')]=function(_0x4b4bf3,_0x9db29d){return db[_0xc0e5('0x33')][_0xc0e5('0x46')](_0x4b4bf3[_0xc0e5('0x2d')],{})[_0xc0e5('0x26')](respondWithResult(_0x9db29d,0xc9))[_0xc0e5('0x1c')](handleError(_0x9db29d,null));};exports[_0xc0e5('0x47')]=function(_0x26f96b,_0x46d945){if(_0x26f96b[_0xc0e5('0x2d')]['id']){delete _0x26f96b[_0xc0e5('0x2d')]['id'];}return db[_0xc0e5('0x33')][_0xc0e5('0x45')]({'where':{'id':_0x26f96b[_0xc0e5('0x3a')]['id']}})['then'](handleEntityNotFound(_0x46d945,null))[_0xc0e5('0x26')](saveUpdates(_0x26f96b[_0xc0e5('0x2d')],null))[_0xc0e5('0x26')](respondWithResult(_0x46d945,null))['catch'](handleError(_0x46d945,null));};exports['destroy']=function(_0x555e22,_0x18d4fb){return db[_0xc0e5('0x33')][_0xc0e5('0x45')]({'where':{'id':_0x555e22[_0xc0e5('0x3a')]['id']}})[_0xc0e5('0x26')](handleEntityNotFound(_0x18d4fb,null))[_0xc0e5('0x26')](removeEntity(_0x18d4fb,null))[_0xc0e5('0x1c')](handleError(_0x18d4fb,null));};exports[_0xc0e5('0x48')]=function(_0x289ea2,_0x2a5a15){return db[_0xc0e5('0x33')]['describe']()[_0xc0e5('0x26')](respondWithResult(_0x2a5a15,null))[_0xc0e5('0x1c')](handleError(_0x2a5a15,null));};exports['createVidaooSession']=function(_0x39d512,_0x235062){var _0x421f33=_0x39d512[_0xc0e5('0x3a')]['id'];var _0x3e9087;var _0x2f16f0;var _0x3ccf9a;return db[_0xc0e5('0x33')][_0xc0e5('0x49')]({'where':{'id':_0x421f33}})[_0xc0e5('0x26')](function(_0xf8768f){_0x3e9087=_0xf8768f;return db[_0xc0e5('0x4a')][_0xc0e5('0x49')]({'where':{'id':_0xf8768f['ChatWebsiteId']},'attributes':['id',_0xc0e5('0x4b'),_0xc0e5('0x4c'),_0xc0e5('0x4d'),_0xc0e5('0x4e'),_0xc0e5('0x4f')],'raw':!![]});})[_0xc0e5('0x26')](function(_0x2d1a98){if(_0x2d1a98&&_0x2d1a98[_0xc0e5('0x4b')]&&_0x2d1a98['vidaooEscalation']){_0x2f16f0=_0x2d1a98;var _0x20b935={'interaction':{'id':_0x421f33},'agent':{'id':_0x39d512['user']['id'],'name':_0x39d512[_0xc0e5('0x39')]['name'],'fullname':_0x39d512[_0xc0e5('0x39')][_0xc0e5('0x50')],'email':_0x39d512[_0xc0e5('0x39')][_0xc0e5('0x51')]},'contact':_0x39d512[_0xc0e5('0x2d')][_0xc0e5('0x2e')],'account':_0x39d512[_0xc0e5('0x2d')][_0xc0e5('0x30')]};var _0x15a73f={'rejectUnauthorized':![],'method':_0xc0e5('0x52'),'url':_0xc0e5('0x53'),'headers':{'X-APIKEY':_0x2d1a98['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x39d512[_0xc0e5('0x39')]['email']],'buttons':null,'topic':_0x2f16f0[_0xc0e5('0x4d')],'note':_[_0xc0e5('0x54')](_0x2f16f0[_0xc0e5('0x4e')])?null:getMustacheRender(_0x2f16f0[_0xc0e5('0x4e')],_0x20b935),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xc0e5('0x54')](_0x2f16f0[_0xc0e5('0x4f')])){var _0x26a9ee=getMustacheRender(_0x2f16f0[_0xc0e5('0x4f')],_0x20b935);var _0x4f9b2d=JSON[_0xc0e5('0x55')](_0x26a9ee);_0x15a73f[_0xc0e5('0x2d')][_0xc0e5('0x56')]=_0x4f9b2d;}}catch(_0x591b9c){throw new db[(_0xc0e5('0x57'))][(_0xc0e5('0x58'))](_0xc0e5('0x59'));}return rp(_0x15a73f);}else{throw new db[(_0xc0e5('0x57'))][(_0xc0e5('0x58'))](_0xc0e5('0x5a'));}})[_0xc0e5('0x26')](function(_0x365d53){_0x3ccf9a=_0x365d53;if(_0x3ccf9a['id']){var _0x1b4b95={'body':_0x3ccf9a['join_url'],'ChatWebsiteId':_0x2f16f0['id'],'ChatInteractionId':_0x3e9087['id'],'direction':_0xc0e5('0x5b'),'UserId':_0x39d512['user']['id']};return db['ChatMessage'][_0xc0e5('0x46')](_0x1b4b95,{});}else{throw new db[(_0xc0e5('0x57'))][(_0xc0e5('0x58'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xc0e5('0x26')](function(){return _0x3e9087[_0xc0e5('0x5c')]({'vidaooSessionId':_0x3ccf9a['id']});})[_0xc0e5('0x26')](respondWithResult(_0x235062,null))[_0xc0e5('0x1c')](handleError(_0x235062,null));};exports[_0xc0e5('0x5d')]=function(_0x9b16b7,_0x59c228){if(_0x9b16b7[_0xc0e5('0x2d')]['id']){delete _0x9b16b7['body']['id'];}return db['ChatInteraction'][_0xc0e5('0x45')]({'where':{'id':_0x9b16b7['params']['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0xc0e5('0x26')](handleEntityNotFound(_0x59c228,null))[_0xc0e5('0x26')](saveUpdates(_0x9b16b7[_0xc0e5('0x2d')],null))['then'](respondWithResult(_0x59c228,null))[_0xc0e5('0x1c')](handleError(_0x59c228,null));};exports[_0xc0e5('0x5e')]=function(_0x58a824,_0x264897){if(_0x58a824[_0xc0e5('0x2d')]['id']){delete _0x58a824[_0xc0e5('0x2d')]['id'];}return db['ChatInteraction'][_0xc0e5('0x45')]({'where':{'id':_0x58a824[_0xc0e5('0x3a')]['id']}})[_0xc0e5('0x26')](function(_0xd95f66){if(!_0xd95f66){logger[_0xc0e5('0x18')](_0xc0e5('0x5f'),_0xc0e5('0x5e'),0x194,_0xc0e5('0x60'));_0x264897[_0xc0e5('0x28')](0x194);}else{if(_0xd95f66[_0xc0e5('0x61')]){throw new db['Sequelize'][(_0xc0e5('0x58'))](_0xc0e5('0x62'));}}return _0xd95f66;})[_0xc0e5('0x26')](function(_0x40a761){if(_0x40a761){return _0x40a761[_0xc0e5('0x47')]({'closed':_0x58a824[_0xc0e5('0x2d')][_0xc0e5('0x63')],'disposition':_0x58a824['body'][_0xc0e5('0x64')]})[_0xc0e5('0x26')](function(_0x1e5adc){return _0x1e5adc;});}})[_0xc0e5('0x26')](function(){return respondWithRpcPromise(_0xc0e5('0x65'),_0xc0e5('0x5e'),_0x58a824[_0xc0e5('0x2d')],client9004);})[_0xc0e5('0x26')](respondWithResult(_0x264897,null))[_0xc0e5('0x1c')](handleError(_0x264897,null));};exports[_0xc0e5('0x66')]=function(_0x1601d7,_0x2be434){_0x1601d7['body'][_0xc0e5('0x2a')]=_0x1601d7['file'][_0xc0e5('0x67')];_0x1601d7[_0xc0e5('0x2d')]['basename']=_0x1601d7[_0xc0e5('0x68')][_0xc0e5('0x69')];_0x1601d7[_0xc0e5('0x2d')]['type']=_0x1601d7[_0xc0e5('0x68')][_0xc0e5('0x6a')];return db[_0xc0e5('0x6b')]['create'](_0x1601d7['body'])[_0xc0e5('0x26')](respondWithResult(_0x2be434,0xc9))[_0xc0e5('0x1c')](handleError(_0x2be434,null));};exports['attachmentDownload']=function(_0x1268ee,_0x50d127){return db['ChatInteraction'][_0xc0e5('0x49')]({'where':{'id':_0x1268ee['params']['id']},'raw':!![]})[_0xc0e5('0x26')](handleEntityNotFound(_0x50d127,null))[_0xc0e5('0x26')](function(_0xc7bed4){if(_0xc7bed4){if(_0xc7bed4['closed']){return _0x50d127[_0xc0e5('0x1d')](0x193)[_0xc0e5('0x1f')]({'status':0x193,'message':_0xc0e5('0x6c')});}return db[_0xc0e5('0x6b')][_0xc0e5('0x49')]({'where':{'id':_0x1268ee[_0xc0e5('0x38')][_0xc0e5('0x6d')]},'raw':!![]})[_0xc0e5('0x26')](handleEntityNotFound(_0x50d127,null));}})[_0xc0e5('0x26')](function(_0x38d6ec){if(_0x38d6ec){var _0x31c029=_0x38d6ec[_0xc0e5('0x6e')]!==null;var _0x3df6f4=path[_0xc0e5('0x6f')](config[_0xc0e5('0x70')],_0xc0e5('0x71'));if(_0x31c029){_0x3df6f4=path['join'](_0x3df6f4,_0xc0e5('0x72'));}var _0x2d6d9d=path[_0xc0e5('0x6f')](_0x3df6f4,_0x38d6ec[_0xc0e5('0x73')]);return _0x50d127[_0xc0e5('0x74')](_0x2d6d9d);}})['catch'](handleError(_0x50d127,null));};exports['close']=function(_0x5dc377,_0x56bd38){var _0x42c9c8=null;var _0x5168c1=null;var _0xfe7bf0=null;if(_0x5dc377['body']['id']){delete _0x5dc377[_0xc0e5('0x2d')]['id'];}if(_0x5dc377['body']['mailTranscript']){_0xfe7bf0=path[_0xc0e5('0x6f')](config[_0xc0e5('0x70')],'server/files/chat/upload/',util[_0xc0e5('0x75')]('transcript-%s.txt',Date['now']()));_0x5dc377[_0xc0e5('0x2d')][_0xc0e5('0x76')]=_0xfe7bf0;}return db[_0xc0e5('0x33')][_0xc0e5('0x45')]({'where':{'id':_0x5dc377['params']['id']},'include':[{'model':db[_0xc0e5('0x77')],'as':_0xc0e5('0x78'),'include':[{'model':db[_0xc0e5('0x79')],'as':'User'}]}]})[_0xc0e5('0x26')](handleEntityNotFound(_0x56bd38,null))[_0xc0e5('0x26')](saveUpdates(_0x5dc377[_0xc0e5('0x2d')],null))['then'](function(_0x43e0c8){if(_0x43e0c8){_0x42c9c8=_0x43e0c8;return db[_0xc0e5('0x4a')]['find']({'where':{'id':_0x42c9c8['ChatWebsiteId']}});}})[_0xc0e5('0x26')](function(_0x5e79ec){if(_0x5e79ec){_0x5168c1=_0x5e79ec;return db[_0xc0e5('0x7a')][_0xc0e5('0x45')]({'where':{'id':_0x42c9c8['ContactId']}});}})[_0xc0e5('0x26')](function(_0x41056d){if(_0x41056d){if(_0xfe7bf0){var _0x5ec81e=null;for(var _0x24112a=0x1;_0x24112a<_0x42c9c8[_0xc0e5('0x78')][_0xc0e5('0x41')];++_0x24112a){_0x5ec81e=_0x42c9c8[_0xc0e5('0x78')][_0x24112a];var _0x2710e7=_0x5ec81e[_0xc0e5('0x61')]?util[_0xc0e5('0x75')](_0xc0e5('0x7b'),_0x5168c1[_0xc0e5('0x7c')],_0x5ec81e[_0xc0e5('0x61')]):'System';var _0x3fbc1a=_0x5dc377[_0xc0e5('0x2d')][_0xc0e5('0x7d')]||util['format'](_0xc0e5('0x7b'),_0xc0e5('0x7e'),_0x5ec81e[_0xc0e5('0x7f')]);switch(_0x5168c1[_0xc0e5('0x80')]){case _0xc0e5('0x81'):_0x2710e7=_0x5ec81e[_0xc0e5('0x61')]?util[_0xc0e5('0x75')]('%s%d',_0x5168c1['agentAlias'],_0x5ec81e[_0xc0e5('0x61')]):'System';break;case _0xc0e5('0x82'):_0x2710e7=_0x5ec81e[_0xc0e5('0x61')]?_0x5ec81e[_0xc0e5('0x79')][_0xc0e5('0x83')]||_0x5ec81e[_0xc0e5('0x79')]['fullname']:_0xc0e5('0x84');break;case _0xc0e5('0x85'):_0x2710e7=_0x5ec81e[_0xc0e5('0x61')]?_0x5ec81e[_0xc0e5('0x79')]['fullname']:'System';break;default:_0x2710e7=_0x5ec81e['UserId']?util['format'](_0xc0e5('0x7b'),_0x5168c1['agentAlias'],_0x5ec81e[_0xc0e5('0x61')]):_0xc0e5('0x84');}var _0x807783=util[_0xc0e5('0x75')](_0xc0e5('0x86'),moment(_0x5ec81e[_0xc0e5('0x87')])[_0xc0e5('0x75')](_0xc0e5('0x88')),_0x5ec81e[_0xc0e5('0x89')]==='in'?_0x3fbc1a:_0x2710e7,_0x5ec81e[_0xc0e5('0x2d')]);if(!_0x5ec81e[_0xc0e5('0x8a')]){fs[_0xc0e5('0x8b')](_0xfe7bf0,_0x807783);}}return db['MailAccount'][_0xc0e5('0x49')]({'where':{'service':!![]},'include':[{'model':db[_0xc0e5('0x8c')],'as':_0xc0e5('0x8d'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xc0e5('0x8e'),'raw':!![]}]}]});}}})[_0xc0e5('0x26')](function(_0x2f515d){if(!_0x2f515d||!_0x2f515d[_0xc0e5('0x8d')]||!_0x5dc377['body'])return _0x42c9c8;var _0x228ebd=_0x2f515d[_0xc0e5('0x8f')]();return respondWithRpcPromise('SendMail',_0xc0e5('0x90'),{'account':_0x228ebd,'message':{'from':util[_0xc0e5('0x75')](_0xc0e5('0x91'),_0x2f515d[_0xc0e5('0x2a')],_0x2f515d[_0xc0e5('0x51')]||_0x2f515d[_0xc0e5('0x8d')][_0xc0e5('0x39')]),'to':_0x5dc377['body']['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0xc0e5('0x75')](_0xc0e5('0x92'),_0x5dc377[_0xc0e5('0x2d')]['mailTranscript']),'attachments':[{'path':_0xfe7bf0}]}})[_0xc0e5('0x26')](function(){return _0x42c9c8;})['catch'](function(_0x1c93e4){logger[_0xc0e5('0x18')](_0x1c93e4);});})[_0xc0e5('0x26')](respondWithStatusCode(_0x56bd38,0xc8))[_0xc0e5('0x1c')](handleError(_0x56bd38,null));};exports[_0xc0e5('0x93')]=function(_0x4133b2,_0x48bce7){return db[_0xc0e5('0x77')][_0xc0e5('0x45')]({'where':{'id':_0x4133b2[_0xc0e5('0x3a')]['id']}})[_0xc0e5('0x26')](handleEntityNotFound(_0x48bce7,null))[_0xc0e5('0x26')](function(_0x153c21){if(_0x153c21){return _0x153c21['addMessage'](_0x4133b2['body'][_0xc0e5('0x94')],_[_0xc0e5('0x95')](_0x4133b2[_0xc0e5('0x2d')],[_0xc0e5('0x94'),'id'])||{});}})[_0xc0e5('0x26')](respondWithResult(_0x48bce7,null))['catch'](handleError(_0x48bce7,null));};exports[_0xc0e5('0x96')]=function(_0x255955,_0x5b26a5){var _0x2a7c47={'raw':![],'where':{}};var _0x35ca14={};var _0x50e3b6={'count':0x0,'rows':[]};return db[_0xc0e5('0x33')][_0xc0e5('0x49')]({'where':{'id':_0x255955[_0xc0e5('0x3a')]['id']}})[_0xc0e5('0x26')](handleEntityNotFound(_0x5b26a5,null))['then'](function(_0x12383a){if(_0x12383a){_0x35ca14[_0xc0e5('0x3b')]=_[_0xc0e5('0x3c')](db[_0xc0e5('0x77')][_0xc0e5('0x34')]);_0x35ca14[_0xc0e5('0x38')]=_[_0xc0e5('0x3c')](_0x255955[_0xc0e5('0x38')]);_0x35ca14[_0xc0e5('0x3d')]=_[_0xc0e5('0x3f')](_0x35ca14[_0xc0e5('0x3b')],_0x35ca14[_0xc0e5('0x38')]);_0x2a7c47[_0xc0e5('0x3e')]=_[_0xc0e5('0x3f')](_0x35ca14[_0xc0e5('0x3b')],qs[_0xc0e5('0x40')](_0x255955['query'][_0xc0e5('0x40')]));_0x2a7c47['attributes']=_0x2a7c47['attributes'][_0xc0e5('0x41')]?_0x2a7c47['attributes']:_0x35ca14[_0xc0e5('0x3b')];if(!_0x255955['query'][_0xc0e5('0x97')]('nolimit')){_0x2a7c47[_0xc0e5('0x21')]=qs[_0xc0e5('0x21')](_0x255955[_0xc0e5('0x38')]['limit']);_0x2a7c47['offset']=qs[_0xc0e5('0x23')](_0x255955[_0xc0e5('0x38')][_0xc0e5('0x23')]);}_0x2a7c47[_0xc0e5('0x98')]=qs['sort'](_0x255955['query'][_0xc0e5('0x99')]);_0x2a7c47[_0xc0e5('0x9a')]=qs[_0xc0e5('0x3d')](_[_0xc0e5('0x9b')](_0x255955['query'],_0x35ca14[_0xc0e5('0x3d')]));_0x2a7c47[_0xc0e5('0x9a')][_0xc0e5('0x9c')]=_0x12383a['id'];if(_0x255955[_0xc0e5('0x38')]['filter']){_0x2a7c47[_0xc0e5('0x9a')]=_[_0xc0e5('0x43')](_0x2a7c47[_0xc0e5('0x9a')],{'$or':_[_0xc0e5('0x32')](_0x2a7c47[_0xc0e5('0x3e')],function(_0xcc76be){var _0x38c685={};_0x38c685[_0xcc76be]={'$like':'%'+_0x255955[_0xc0e5('0x38')][_0xc0e5('0x9d')]+'%'};return _0x38c685;})});}if(_0x255955[_0xc0e5('0x38')][_0xc0e5('0x9e')]){var _0x55ecc1=_0x255955[_0xc0e5('0x38')][_0xc0e5('0x9e')][_0xc0e5('0x9f')](',');var _0x3cd7a5={};_0x3cd7a5[_0x55ecc1[0x0]]={'$gte':moment(_0x55ecc1[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x2a7c47[_0xc0e5('0x9a')]=_[_0xc0e5('0x43')](_0x2a7c47[_0xc0e5('0x9a')],_0x3cd7a5);}_0x2a7c47=_[_0xc0e5('0x43')]({},_0x2a7c47,_0x255955[_0xc0e5('0x44')]);return db[_0xc0e5('0x77')][_0xc0e5('0x22')]({'where':_0x2a7c47[_0xc0e5('0x9a')]})[_0xc0e5('0x26')](function(_0x54f494){_0x50e3b6['count']=_0x54f494;if(_0x255955[_0xc0e5('0x38')]['includeAll']){_0x2a7c47[_0xc0e5('0x42')]=[{'all':!![]}];}return db[_0xc0e5('0x77')]['findAll'](_0x2a7c47);})['then'](function(_0x5bda6d){_0x50e3b6[_0xc0e5('0xa0')]=_0x5bda6d;return _0x50e3b6;});}})['then'](respondWithFilteredResult(_0x5b26a5,_0x2a7c47))[_0xc0e5('0x1c')](handleError(_0x5b26a5,null));};exports[_0xc0e5('0xa1')]=function(_0x564cf7,_0x3e43b4){var _0x496378={'where':{}},_0x7f8eed={},_0x3186f3={'count':0x0,'rows':[]};return db[_0xc0e5('0x33')][_0xc0e5('0x49')]({'where':{'id':_0x564cf7[_0xc0e5('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3e43b4,null))[_0xc0e5('0x26')](function(_0x4d4fd2){if(_0x4d4fd2){_0x7f8eed[_0xc0e5('0x3b')]=_[_0xc0e5('0x3c')](db[_0xc0e5('0x77')][_0xc0e5('0x34')]);_0x7f8eed[_0xc0e5('0x38')]=_[_0xc0e5('0x3c')](_0x564cf7[_0xc0e5('0x38')]);_0x7f8eed[_0xc0e5('0x3d')]=_[_0xc0e5('0x3f')](_0x7f8eed['model'],_0x7f8eed['query']);_0x496378['attributes']=_[_0xc0e5('0x3f')](_0x7f8eed['model'],qs[_0xc0e5('0x40')](_0x564cf7[_0xc0e5('0x38')]['fields']));_0x496378['attributes']=_0x496378['attributes'][_0xc0e5('0x41')]?_0x496378[_0xc0e5('0x3e')]:_0x7f8eed[_0xc0e5('0x3b')];if(!_0x564cf7[_0xc0e5('0x38')][_0xc0e5('0x97')](_0xc0e5('0xa2'))){_0x496378[_0xc0e5('0x21')]=qs[_0xc0e5('0x21')](_0x564cf7[_0xc0e5('0x38')][_0xc0e5('0x21')]);_0x496378['offset']=qs[_0xc0e5('0x23')](_0x564cf7[_0xc0e5('0x38')][_0xc0e5('0x23')]);}_0x496378['order']=qs[_0xc0e5('0x99')](_0x564cf7[_0xc0e5('0x38')]['sort']);_0x496378[_0xc0e5('0x9a')]=qs[_0xc0e5('0x3d')](_[_0xc0e5('0x9b')](_0x564cf7[_0xc0e5('0x38')],_0x7f8eed[_0xc0e5('0x3d')]));_0x496378[_0xc0e5('0x9a')][_0xc0e5('0x9c')]=_0x4d4fd2['id'];if(_0x564cf7[_0xc0e5('0x38')][_0xc0e5('0x9d')]){_0x496378['where']=_[_0xc0e5('0x43')](_0x496378['where'],{'$or':_[_0xc0e5('0x32')](_0x496378[_0xc0e5('0x3e')],function(_0x3c7527){var _0x4c8984={};_0x4c8984[_0x3c7527]={'$like':'%'+_0x564cf7[_0xc0e5('0x38')][_0xc0e5('0x9d')]+'%'};return _0x4c8984;})});}_0x496378[_0xc0e5('0x9a')][_0xc0e5('0x8a')]=![];if(_0x564cf7[_0xc0e5('0x38')]['id']){_0x496378[_0xc0e5('0x9a')]['id']={'$gt':_0x564cf7[_0xc0e5('0x38')]['id']};}_0x496378=_['merge']({},_0x496378,_0x564cf7[_0xc0e5('0x44')]);return db[_0xc0e5('0x77')]['count']({'where':_0x496378['where']})['then'](function(_0x4bf5fa){_0x3186f3[_0xc0e5('0x22')]=_0x4bf5fa;_0x496378[_0xc0e5('0x42')]=[];if(_0x564cf7[_0xc0e5('0x38')][_0xc0e5('0xa3')]){_0x496378[_0xc0e5('0x42')]['push']({'model':db[_0xc0e5('0x79')],'as':'User','attributes':['id',_0xc0e5('0x50'),_0xc0e5('0x83')]});}if(_0x564cf7[_0xc0e5('0x38')][_0xc0e5('0xa4')]){_0x496378[_0xc0e5('0x42')]=[{'all':!![]}];}return db[_0xc0e5('0x77')]['findAll'](_0x496378);})['then'](function(_0x50cb1e){_0x3186f3['rows']=_0x50cb1e;return _0x3186f3;});}})['then'](respondWithFilteredResult(_0x3e43b4,_0x496378))[_0xc0e5('0x1c')](handleError(_0x3e43b4,null));};exports[_0xc0e5('0xa5')]=function(_0x16d03f,_0x5e4c6e){return db[_0xc0e5('0x33')][_0xc0e5('0x45')]({'where':{'id':_0x16d03f[_0xc0e5('0x3a')]['id']}})[_0xc0e5('0x26')](handleEntityNotFound(_0x5e4c6e,null))[_0xc0e5('0x26')](function(_0x5cd79d){if(_0x5cd79d){return _0x5cd79d['setTags'](_0x16d03f[_0xc0e5('0x2d')][_0xc0e5('0x94')],_[_0xc0e5('0x95')](_0x16d03f[_0xc0e5('0x2d')],[_0xc0e5('0x94'),'id'])||{})[_0xc0e5('0xa6')](function(){return db['Tag'][_0xc0e5('0x37')]({'attributes':['id',_0xc0e5('0x2a'),_0xc0e5('0xa7')],'where':{'id':_0x16d03f['body'][_0xc0e5('0x94')]}});})[_0xc0e5('0x26')](function(_0x1a23a6){socket['emit']('chatInteractionTags:save',{'id':Number(_0x16d03f[_0xc0e5('0x3a')]['id']),'tags':_0x1a23a6||[]});return{'id':Number(_0x16d03f['params']['id']),'tags':_0x1a23a6||[]};});}})['then'](respondWithResult(_0x5e4c6e,null))[_0xc0e5('0x1c')](handleError(_0x5e4c6e,null));};exports[_0xc0e5('0xa8')]=function(_0x5be3d,_0x5958f4){return db['ChatInteraction']['find']({'where':{'id':_0x5be3d[_0xc0e5('0x3a')]['id']}})['then'](handleEntityNotFound(_0x5958f4,null))[_0xc0e5('0x26')](function(_0x3b86ab){if(_0x3b86ab){return _0x3b86ab[_0xc0e5('0xa8')](_0x5be3d[_0xc0e5('0x38')][_0xc0e5('0x94')]);}})[_0xc0e5('0x26')](respondWithStatusCode(_0x5958f4,null))[_0xc0e5('0x1c')](handleError(_0x5958f4,null));};exports[_0xc0e5('0x74')]=function(_0x2ecb79,_0x42282e){var _0xef5e5a=moment()[_0xc0e5('0xa9')]()[_0xc0e5('0xaa')]();var _0x5307db=path[_0xc0e5('0x6f')](config[_0xc0e5('0x70')],'server',_0xc0e5('0xab'),'tmp');var _0x5449e1=path[_0xc0e5('0x6f')](config['root'],_0xc0e5('0xac'),_0xc0e5('0xab'),_0xc0e5('0xad'));var _0x460d94=path[_0xc0e5('0x6f')](_0x5307db,_0xef5e5a);var _0x266480=util['format'](_0xc0e5('0xae'),_0x2ecb79[_0xc0e5('0x3a')]['id'],_0xef5e5a);var _0x4e7c7c=path[_0xc0e5('0x6f')](_0x5307db,_0x266480);var _0x409d74=[];_0x409d74[_0xc0e5('0xaf')]({'model':db['User'],'as':_0xc0e5('0x79'),'attributes':['id','fullname'],'raw':!![]});_0x409d74['push']({'model':db[_0xc0e5('0x7a')],'as':_0xc0e5('0xb0'),'attributes':['id',_0xc0e5('0xb1'),_0xc0e5('0xb2')],'raw':!![]});if(_0x2ecb79[_0xc0e5('0x38')]['attachments']){_0x409d74[_0xc0e5('0xaf')]({'model':db[_0xc0e5('0x6b')],'as':_0xc0e5('0x6b'),'raw':!![]});}var _0x20bf5e=[{'model':db[_0xc0e5('0x77')],'as':'Messages','attributes':['id',_0xc0e5('0x2d'),_0xc0e5('0x87'),_0xc0e5('0x89'),_0xc0e5('0x8a'),'read'],'include':_0x409d74}];_0x20bf5e[_0xc0e5('0xaf')]({'model':db[_0xc0e5('0x4a')],'as':_0xc0e5('0xb3'),'attributes':['id',_0xc0e5('0x2a')]});_0x20bf5e[_0xc0e5('0xaf')]({'model':db[_0xc0e5('0x79')],'as':_0xc0e5('0xb4'),'attributes':['id',_0xc0e5('0x50')]});return db[_0xc0e5('0x33')]['find']({'where':{'id':_0x2ecb79[_0xc0e5('0x3a')]['id']},'include':_0x20bf5e})[_0xc0e5('0x26')](handleEntityNotFound(_0x42282e,null))[_0xc0e5('0x26')](function(_0x11ecbe){if(_0x11ecbe){var _0x52678c=_0x11ecbe[_0xc0e5('0xb5')]({'plain':!![]});fs[_0xc0e5('0xb6')](_0x460d94);var _0x410d5a={'channel':_0xc0e5('0xb7'),'account':_0x52678c['Account'][_0xc0e5('0x2a')],'agent':_0x52678c['Owner']?_0x52678c[_0xc0e5('0xb4')][_0xc0e5('0x50')]:'N.A.','createdAt':moment(_0x52678c[_0xc0e5('0x87')])[_0xc0e5('0x75')](_0xc0e5('0xb8'))[_0xc0e5('0xaa')](),'closedAt':_0x52678c[_0xc0e5('0x63')]?moment(_0x52678c[_0xc0e5('0xb9')])[_0xc0e5('0x75')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x52678c[_0xc0e5('0x64')],'chatInfo':{'browser':_0x52678c[_0xc0e5('0xba')],'os':_0x52678c[_0xc0e5('0xbb')],'referer':_0x52678c[_0xc0e5('0xbc')],'customerIp':_0x52678c[_0xc0e5('0xbd')],'customerPort':_0x52678c['customerPort']?_0x52678c[_0xc0e5('0xbe')]:'N.A.'},'messages':_(_0x52678c[_0xc0e5('0x78')])[_0xc0e5('0xbf')]()[_0xc0e5('0x9d')]({'secret':![]})[_0xc0e5('0x32')](function(_0x3fedd3){if(_0x3fedd3[_0xc0e5('0x6b')]){var _0x436bb6=path[_0xc0e5('0x6f')](_0x5449e1,_0x3fedd3[_0xc0e5('0x6b')][_0xc0e5('0x73')]);if(fs[_0xc0e5('0xc0')](_0x436bb6)){fs[_0xc0e5('0xc1')](_0x436bb6)[_0xc0e5('0xc2')](fs[_0xc0e5('0xc3')](path[_0xc0e5('0x6f')](_0x460d94,_0x3fedd3[_0xc0e5('0x6b')][_0xc0e5('0x73')])));}}return{'date':moment(_0x3fedd3[_0xc0e5('0x87')])[_0xc0e5('0x75')]('YYYY-MM-DD\x20HH:mm:ss')[_0xc0e5('0xaa')](),'sender':_0x3fedd3[_0xc0e5('0x89')]==='out'?_0x3fedd3[_0xc0e5('0x79')]?_0x3fedd3[_0xc0e5('0x79')][_0xc0e5('0x50')]:_0xc0e5('0x84'):_0x3fedd3[_0xc0e5('0xb0')][_0xc0e5('0xb1')]+(_0x3fedd3[_0xc0e5('0xb0')][_0xc0e5('0xb2')]?'\x20'+_0x3fedd3['Contact'][_0xc0e5('0xb2')]:''),'body':_0x3fedd3[_0xc0e5('0x6b')]?_0x3fedd3[_0xc0e5('0x6b')]['basename']:_0x3fedd3['body'],'direction':_0x3fedd3[_0xc0e5('0x89')]===_0xc0e5('0x5b')?'A':'C','secret':_0x3fedd3[_0xc0e5('0x8a')],'read':_0x3fedd3[_0xc0e5('0xc4')],'attachment':_0x3fedd3[_0xc0e5('0x6b')]};})['value']()};return ejs['renderFile'](path[_0xc0e5('0x6f')](config['root'],'server',_0xc0e5('0xc5'),_0xc0e5('0xc6')),{'interaction':_0x410d5a})[_0xc0e5('0x26')](function(_0x3f5fd6){var _0x30b951=path[_0xc0e5('0x6f')](_0x460d94,'transcript-'+_0x52678c['id']+'-'+_0xef5e5a+_0xc0e5('0xc7'));var _0x42f498={'path':_0x30b951,'channel':_0xc0e5('0xb7'),'interactionId':_0x52678c['id']};return pdf[_0xc0e5('0xc8')](_0x3f5fd6,_0x42f498);})[_0xc0e5('0x26')](function(){return new Promise(function(_0x46436f,_0x5f529a){zipdir(_0x460d94,{'saveTo':_0x4e7c7c},function(_0x31eb21,_0x3532a1){if(_0x31eb21)return _0x5f529a(_0x31eb21);return _0x46436f(_0x3532a1);});})['then'](function(){return new BPromise(function(_0x9257c6,_0x1805e8){rimraf(_0x460d94,function(_0x18a035){if(_0x18a035)_0x1805e8(_0x18a035);return _0x9257c6();});});})[_0xc0e5('0x26')](function(){return _0x42282e[_0xc0e5('0x74')](_0x4e7c7c,_0x266480,function(_0x5b9728){if(_0x5b9728){logger[_0xc0e5('0x18')](_0xc0e5('0xc9'),_0x5b9728);}else{fs['unlinkSync'](_0x4e7c7c);}});});});}else{return _0x42282e['sendStatus'](0xc8);}})[_0xc0e5('0x1c')](handleError(_0x42282e,null));};
\ No newline at end of file
index b85d985..f0fa7c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4a4=['then','setDataValue','unreadMessages','emit','catch','hasOwnProperty','exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x3e35b9,_0x482ef8){var _0x558e83=function(_0x1d7b09){while(--_0x1d7b09){_0x3e35b9['push'](_0x3e35b9['shift']());}};_0x558e83(++_0x482ef8);}(_0xf4a4,0x151));var _0x4f4a=function(_0x20f962,_0x12974d){_0x20f962=_0x20f962-0x0;var _0x4df9d9=_0xf4a4[_0x20f962];return _0x4df9d9;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x4f4a('0x0'))['db'][_0x4f4a('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0x4f4a('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x4f4a('0x3')](0x0);var events={'afterCreate':_0x4f4a('0x4'),'afterUpdate':_0x4f4a('0x5'),'afterDestroy':_0x4f4a('0x6')};function emitEvent(_0x3d2852){return function(_0x3ff01e,_0x35a331,_0x38fe8e){_0x3ff01e[_0x4f4a('0x7')]({'attributes':['id'],'raw':!![]})[_0x4f4a('0x8')](function(_0x46f62b){_0x3ff01e[_0x4f4a('0x9')]('Users',_0x46f62b['map'](function(_0x568b14){return{'id':_0x568b14['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x3ff01e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4f4a('0x8')](function(_0x12e184){_0x3ff01e[_0x4f4a('0x9')](_0x4f4a('0xa'),_0x12e184['length']);ChatInteractionEvents[_0x4f4a('0xb')](_0x3d2852+':'+_0x3ff01e['id'],_0x3ff01e);ChatInteractionEvents[_0x4f4a('0xb')](_0x3d2852,_0x3ff01e);_0x38fe8e(null);})[_0x4f4a('0xc')](_0x38fe8e(null));};}for(var e in events){if(events[_0x4f4a('0xd')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x4f4a('0xe')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xa42e=['getUsers','setDataValue','Users','findAll','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','ChatInteraction','setMaxListeners','update'];(function(_0x581249,_0x483f03){var _0x284bae=function(_0x2faadd){while(--_0x2faadd){_0x581249['push'](_0x581249['shift']());}};_0x284bae(++_0x483f03);}(_0xa42e,0xcd));var _0xea42=function(_0x1b7745,_0x49af5b){_0x1b7745=_0x1b7745-0x0;var _0x40f24f=_0xa42e[_0x1b7745];return _0x40f24f;};'use strict';var EventEmitter=require(_0xea42('0x0'));var ChatInteraction=require(_0xea42('0x1'))['db'][_0xea42('0x2')];var ChatMessage=require(_0xea42('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xea42('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xea42('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4ca2e7){return function(_0x28aee4,_0x515f3a,_0x3a013b){_0x28aee4[_0xea42('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x423b90){_0x28aee4[_0xea42('0x6')](_0xea42('0x7'),_0x423b90['map'](function(_0x2b879c){return{'id':_0x2b879c['id']};}));return ChatMessage[_0xea42('0x8')]({'where':{'ChatInteractionId':_0x28aee4['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x298993){_0x28aee4[_0xea42('0x6')]('unreadMessages',_0x298993[_0xea42('0x9')]);ChatInteractionEvents[_0xea42('0xa')](_0x4ca2e7+':'+_0x28aee4['id'],_0x28aee4);ChatInteractionEvents[_0xea42('0xa')](_0x4ca2e7,_0x28aee4);_0x3a013b(null);})[_0xea42('0xb')](_0x3a013b(null));};}for(var e in events){if(events[_0xea42('0xc')](e)){var event=events[e];ChatInteraction[_0xea42('0xd')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
index ba8ea8b..f3877ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d12=['format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./chatInteraction.attributes','exports','define','chat_interactions','changed','closed'];(function(_0x598504,_0x595134){var _0x23bab6=function(_0x465053){while(--_0x465053){_0x598504['push'](_0x598504['shift']());}};_0x23bab6(++_0x595134);}(_0x9d12,0x173));var _0x29d1=function(_0xecf641,_0xbd2f8f){_0xecf641=_0xecf641-0x0;var _0x1e389b=_0x9d12[_0xecf641];return _0x1e389b;};'use strict';var _=require(_0x29d1('0x0'));var util=require(_0x29d1('0x1'));var logger=require(_0x29d1('0x2'))('api');var moment=require(_0x29d1('0x3'));var BPromise=require(_0x29d1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x29d1('0x5'));var rimraf=require(_0x29d1('0x6'));var config=require('../../config/environment');var attributes=require(_0x29d1('0x7'));module[_0x29d1('0x8')]=function(_0x37d177,_0x5cda5f){return _0x37d177[_0x29d1('0x9')]('ChatInteraction',attributes,{'tableName':_0x29d1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x8c9cf0,_0x279214,_0x5c5d0d){if(_0x8c9cf0[_0x29d1('0xb')](_0x29d1('0xc'))){_0x8c9cf0['closedAt']=moment()[_0x29d1('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5c5d0d(null,_0x8c9cf0);}},'charset':_0x29d1('0xe'),'collate':_0x29d1('0xf')});};
\ No newline at end of file
+var _0x145f=['path','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','closed','format','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2399ad,_0x565649){var _0x1d8f84=function(_0x4d9fb0){while(--_0x4d9fb0){_0x2399ad['push'](_0x2399ad['shift']());}};_0x1d8f84(++_0x565649);}(_0x145f,0xc5));var _0xf145=function(_0x26bd13,_0x46162a){_0x26bd13=_0x26bd13-0x0;var _0x1bb69c=_0x145f[_0x26bd13];return _0x1bb69c;};'use strict';var _=require(_0xf145('0x0'));var util=require(_0xf145('0x1'));var logger=require(_0xf145('0x2'))(_0xf145('0x3'));var moment=require(_0xf145('0x4'));var BPromise=require(_0xf145('0x5'));var rp=require(_0xf145('0x6'));var fs=require('fs');var path=require(_0xf145('0x7'));var rimraf=require('rimraf');var config=require(_0xf145('0x8'));var attributes=require(_0xf145('0x9'));module['exports']=function(_0x2bb2ef,_0x2ae104){return _0x2bb2ef[_0xf145('0xa')](_0xf145('0xb'),attributes,{'tableName':_0xf145('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x15875c,_0x3c39ec,_0x493b87){if(_0x15875c[_0xf145('0xd')](_0xf145('0xe'))){_0x15875c['closedAt']=moment()[_0xf145('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x493b87(null,_0x15875c);}},'charset':_0xf145('0x10'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 4dd659c..58ada0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7105=['ChatInteraction','update','body','options','raw','where','limit','then','UpdateChatInteraction','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','request','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','catch'];(function(_0x1a62f8,_0xbb6aa2){var _0x4a561c=function(_0x129d0d){while(--_0x129d0d){_0x1a62f8['push'](_0x1a62f8['shift']());}};_0x4a561c(++_0xbb6aa2);}(_0x7105,0xa4));var _0x5710=function(_0x5eb0fd,_0x17d8ef){_0x5eb0fd=_0x5eb0fd-0x0;var _0x22cb4a=_0x7105[_0x5eb0fd];return _0x22cb4a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5710('0x0'));var BPromise=require(_0x5710('0x1'));var rs=require(_0x5710('0x2'));var fs=require('fs');var Redis=require(_0x5710('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5710('0x4'));var config=require(_0x5710('0x5'));var jayson=require(_0x5710('0x6'));var client=jayson[_0x5710('0x7')]['http']({'port':0x232a});config['redis']=_[_0x5710('0x8')](config[_0x5710('0x9')],{'host':_0x5710('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x49ec40,_0x3b47bb,_0x710be4){return new BPromise(function(_0x3cca86,_0x3d2d19){return client[_0x5710('0xb')](_0x49ec40,_0x710be4)['then'](function(_0xe6854a){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x3b47bb,'request\x20sent');logger[_0x5710('0xc')](_0x5710('0xd'),_0x3b47bb,'request\x20sent',JSON[_0x5710('0xe')](_0xe6854a));if(_0xe6854a[_0x5710('0xf')]){if(_0xe6854a['error'][_0x5710('0x10')]===0x1f4){logger['error'](_0x5710('0x11'),_0x3b47bb,_0xe6854a['error'][_0x5710('0x12')]);return _0x3d2d19(_0xe6854a['error'][_0x5710('0x12')]);}logger[_0x5710('0xf')](_0x5710('0x11'),_0x3b47bb,_0xe6854a[_0x5710('0xf')][_0x5710('0x12')]);return _0x3cca86(_0xe6854a[_0x5710('0xf')][_0x5710('0x12')]);}else{logger[_0x5710('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x3b47bb,'request\x20sent');_0x3cca86(_0xe6854a['result'][_0x5710('0x12')]);}})[_0x5710('0x14')](function(_0x22482f){logger[_0x5710('0xf')](_0x5710('0x11'),_0x3b47bb,_0x22482f);_0x3d2d19(_0x22482f);});});}exports['UpdateChatInteraction']=function(_0x3b3e95){var _0x39753e=this;return new Promise(function(_0x5dcb75,_0x515ff4){return db[_0x5710('0x15')][_0x5710('0x16')](_0x3b3e95[_0x5710('0x17')],{'raw':_0x3b3e95[_0x5710('0x18')]?_0x3b3e95[_0x5710('0x18')][_0x5710('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b3e95['options']?_0x3b3e95[_0x5710('0x18')][_0x5710('0x1a')]||null:null,'attributes':_0x3b3e95[_0x5710('0x18')]?_0x3b3e95[_0x5710('0x18')]['attributes']||null:null,'limit':_0x3b3e95[_0x5710('0x18')]?_0x3b3e95[_0x5710('0x18')][_0x5710('0x1b')]||null:null})[_0x5710('0x1c')](function(_0x285a73){logger['info'](_0x5710('0x1d'),_0x3b3e95);logger[_0x5710('0xc')](_0x5710('0x1d'),_0x3b3e95,JSON[_0x5710('0xe')](_0x285a73));_0x5dcb75(_0x285a73);})[_0x5710('0x14')](function(_0x4db659){logger[_0x5710('0xf')](_0x5710('0x1d'),_0x4db659[_0x5710('0x12')],_0x3b3e95);_0x515ff4(_0x39753e[_0x5710('0xf')](0x1f4,_0x4db659['message']));});});};exports[_0x5710('0x1e')]=function(_0x1db148){return new Promise(function(_0x2b6475,_0x5d39af){return db[_0x5710('0x15')][_0x5710('0x1f')]({'where':_0x1db148['options']?_0x1db148[_0x5710('0x18')][_0x5710('0x1a')]||null:null})[_0x5710('0x1c')](function(_0x2d0363){if(_0x2d0363){return _0x2d0363[_0x5710('0x20')](_0x1db148[_0x5710('0x17')][_0x5710('0x21')],_[_0x5710('0x22')](_0x1db148[_0x5710('0x17')],[_0x5710('0x21'),'id'])||{});}})[_0x5710('0x23')](function(_0x19525a){logger[_0x5710('0x13')]('AddTags',_0x1db148);logger[_0x5710('0xc')](_0x5710('0x24'),_0x1db148,JSON['stringify'](_0x19525a));_0x2b6475(_0x19525a);})[_0x5710('0x14')](function(_0x1c0446){logger[_0x5710('0xf')](_0x5710('0x24'),_0x1c0446[_0x5710('0x12')],_0x1db148);_0x5d39af(_this[_0x5710('0xf')](0x1f4,_0x1c0446[_0x5710('0x12')]));});});};
\ No newline at end of file
+var _0x5656=['where','attributes','limit','ChatInteraction','ids','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','request\x20sent','debug','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','update','body','options','raw'];(function(_0xe3cdae,_0x152d75){var _0x427679=function(_0x58539b){while(--_0x58539b){_0xe3cdae['push'](_0xe3cdae['shift']());}};_0x427679(++_0x152d75);}(_0x5656,0x1a1));var _0x6565=function(_0x1395d6,_0x5afcb1){_0x1395d6=_0x1395d6-0x0;var _0xe11ccc=_0x5656[_0x1395d6];return _0xe11ccc;};'use strict';var _=require(_0x6565('0x0'));var util=require('util');var moment=require(_0x6565('0x1'));var BPromise=require(_0x6565('0x2'));var rs=require(_0x6565('0x3'));var fs=require('fs');var Redis=require(_0x6565('0x4'));var db=require(_0x6565('0x5'))['db'];var utils=require(_0x6565('0x6'));var logger=require(_0x6565('0x7'))(_0x6565('0x8'));var config=require('../../config/environment');var jayson=require(_0x6565('0x9'));var client=jayson[_0x6565('0xa')][_0x6565('0xb')]({'port':0x232a});config[_0x6565('0xc')]=_[_0x6565('0xd')](config[_0x6565('0xc')],{'host':_0x6565('0xe'),'port':0x18eb});var socket=require(_0x6565('0xf'))(new Redis(config[_0x6565('0xc')]));require(_0x6565('0x10'))[_0x6565('0x11')](socket);function respondWithRpcPromise(_0xa156a,_0x2e6669,_0x1ae9cd){return new BPromise(function(_0x475bbc,_0x19ed59){return client[_0x6565('0x12')](_0xa156a,_0x1ae9cd)[_0x6565('0x13')](function(_0x41b774){logger[_0x6565('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x2e6669,_0x6565('0x15'));logger[_0x6565('0x16')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2e6669,'request\x20sent',JSON[_0x6565('0x17')](_0x41b774));if(_0x41b774['error']){if(_0x41b774[_0x6565('0x18')]['code']===0x1f4){logger[_0x6565('0x18')](_0x6565('0x19'),_0x2e6669,_0x41b774[_0x6565('0x18')][_0x6565('0x1a')]);return _0x19ed59(_0x41b774['error'][_0x6565('0x1a')]);}logger['error'](_0x6565('0x19'),_0x2e6669,_0x41b774[_0x6565('0x18')][_0x6565('0x1a')]);return _0x475bbc(_0x41b774['error'][_0x6565('0x1a')]);}else{logger[_0x6565('0x14')](_0x6565('0x19'),_0x2e6669,_0x6565('0x15'));_0x475bbc(_0x41b774[_0x6565('0x1b')][_0x6565('0x1a')]);}})[_0x6565('0x1c')](function(_0x342901){logger[_0x6565('0x18')](_0x6565('0x19'),_0x2e6669,_0x342901);_0x19ed59(_0x342901);});});}exports[_0x6565('0x1d')]=function(_0x351611){var _0x49402f=this;return new Promise(function(_0x93a014,_0x5d818a){return db['ChatInteraction'][_0x6565('0x1e')](_0x351611[_0x6565('0x1f')],{'raw':_0x351611[_0x6565('0x20')]?_0x351611[_0x6565('0x20')][_0x6565('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x351611[_0x6565('0x20')]?_0x351611[_0x6565('0x20')][_0x6565('0x22')]||null:null,'attributes':_0x351611[_0x6565('0x20')]?_0x351611[_0x6565('0x20')][_0x6565('0x23')]||null:null,'limit':_0x351611[_0x6565('0x20')]?_0x351611['options'][_0x6565('0x24')]||null:null})[_0x6565('0x13')](function(_0x58d6d9){logger[_0x6565('0x14')](_0x6565('0x1d'),_0x351611);logger['debug']('UpdateChatInteraction',_0x351611,JSON[_0x6565('0x17')](_0x58d6d9));_0x93a014(_0x58d6d9);})[_0x6565('0x1c')](function(_0xcfa6e2){logger[_0x6565('0x18')]('UpdateChatInteraction',_0xcfa6e2[_0x6565('0x1a')],_0x351611);_0x5d818a(_0x49402f[_0x6565('0x18')](0x1f4,_0xcfa6e2['message']));});});};exports['AddTagsToChatInteraction']=function(_0x3e2f2a){return new Promise(function(_0x44c98b,_0x429d5b){return db[_0x6565('0x25')]['find']({'where':_0x3e2f2a[_0x6565('0x20')]?_0x3e2f2a[_0x6565('0x20')][_0x6565('0x22')]||null:null})[_0x6565('0x13')](function(_0x53fab1){if(_0x53fab1){return _0x53fab1['addTags'](_0x3e2f2a[_0x6565('0x1f')][_0x6565('0x26')],_['omit'](_0x3e2f2a[_0x6565('0x1f')],[_0x6565('0x26'),'id'])||{});}})[_0x6565('0x27')](function(_0x4c4df0){logger['info'](_0x6565('0x28'),_0x3e2f2a);logger[_0x6565('0x16')](_0x6565('0x28'),_0x3e2f2a,JSON['stringify'](_0x4c4df0));_0x44c98b(_0x4c4df0);})[_0x6565('0x1c')](function(_0x59f2a8){logger['error']('AddTags',_0x59f2a8[_0x6565('0x1a')],_0x3e2f2a);_0x429d5b(_this[_0x6565('0x18')](0x1f4,_0x59f2a8[_0x6565('0x1a')]));});});};
\ No newline at end of file
index d220781..ef6c2b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ab7=['remove','removeListener','register','length','./chatInteraction.events','save'];(function(_0x14dd0a,_0x4b7074){var _0x4ff564=function(_0x23444f){while(--_0x23444f){_0x14dd0a['push'](_0x14dd0a['shift']());}};_0x4ff564(++_0x4b7074);}(_0x6ab7,0x15a));var _0x76ab=function(_0x51168c,_0x2f3ea2){_0x51168c=_0x51168c-0x0;var _0x323bc0=_0x6ab7[_0x51168c];return _0x323bc0;};'use strict';var ChatInteractionEvents=require(_0x76ab('0x0'));var events=[_0x76ab('0x1'),_0x76ab('0x2'),'update'];function createListener(_0x37b7a0,_0x58c961){return function(_0x2c69e9){_0x58c961['emit'](_0x37b7a0,_0x2c69e9);};}function removeListener(_0x3e962b,_0x56e42e){return function(){ChatInteractionEvents[_0x76ab('0x3')](_0x3e962b,_0x56e42e);};}exports[_0x76ab('0x4')]=function(_0x21403c){for(var _0x43fc37=0x0,_0x40dfc1=events[_0x76ab('0x5')];_0x43fc37<_0x40dfc1;_0x43fc37++){var _0x394009=events[_0x43fc37];var _0x28d95d=createListener('chatInteraction:'+_0x394009,_0x21403c);ChatInteractionEvents['on'](_0x394009,_0x28d95d);}};
\ No newline at end of file
+var _0xc1fe=['update','emit','register','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x3f7101,_0x3af08b){var _0x1a30a0=function(_0x750e5b){while(--_0x750e5b){_0x3f7101['push'](_0x3f7101['shift']());}};_0x1a30a0(++_0x3af08b);}(_0xc1fe,0xdd));var _0xec1f=function(_0x1e97be,_0x576484){_0x1e97be=_0x1e97be-0x0;var _0x3def0f=_0xc1fe[_0x1e97be];return _0x3def0f;};'use strict';var ChatInteractionEvents=require(_0xec1f('0x0'));var events=[_0xec1f('0x1'),_0xec1f('0x2'),_0xec1f('0x3')];function createListener(_0x5e1e48,_0x381316){return function(_0x582c11){_0x381316[_0xec1f('0x4')](_0x5e1e48,_0x582c11);};}function removeListener(_0x27ed11,_0x53befb){return function(){ChatInteractionEvents['removeListener'](_0x27ed11,_0x53befb);};}exports[_0xec1f('0x5')]=function(_0x3bdb30){for(var _0x4e267b=0x0,_0x504d96=events['length'];_0x4e267b<_0x504d96;_0x4e267b++){var _0x30206b=events[_0x4e267b];var _0x1e9b65=createListener(_0xec1f('0x6')+_0x30206b,_0x3bdb30);ChatInteractionEvents['on'](_0x30206b,_0x1e9b65);}};
\ No newline at end of file
index 0ce1029..2517169 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x488f=['/describe','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMyMessages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format','%s-%s','now','originalname','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','customUpdate','/:id/abandon','abandon','close','delete','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index'];(function(_0x294095,_0x29e946){var _0xd5f54=function(_0x8e8630){while(--_0x8e8630){_0x294095['push'](_0x294095['shift']());}};_0xd5f54(++_0x29e946);}(_0x488f,0x89));var _0xf488=function(_0x265c9f,_0x435dba){_0x265c9f=_0x265c9f-0x0;var _0x3fbd7d=_0x488f[_0x265c9f];return _0x3fbd7d;};'use strict';var multer=require(_0xf488('0x0'));var util=require(_0xf488('0x1'));var path=require('path');var timeout=require(_0xf488('0x2'));var express=require(_0xf488('0x3'));var router=express[_0xf488('0x4')]();var fs_extra=require(_0xf488('0x5'));var auth=require(_0xf488('0x6'));var interaction=require(_0xf488('0x7'));var config=require(_0xf488('0x8'));var controller=require(_0xf488('0x9'));router[_0xf488('0xa')]('/',auth[_0xf488('0xb')](),controller[_0xf488('0xc')]);router['get'](_0xf488('0xd'),auth[_0xf488('0xb')](),controller[_0xf488('0xe')]);router[_0xf488('0xa')](_0xf488('0xf'),auth['isChatInteractionAuthorized'](),controller[_0xf488('0x10')]);router[_0xf488('0xa')](_0xf488('0x11'),auth[_0xf488('0x12')](),controller[_0xf488('0x13')]);router[_0xf488('0xa')](_0xf488('0x14'),auth[_0xf488('0xb')](),controller['getMessages']);router[_0xf488('0xa')]('/:id/my_messages',auth[_0xf488('0x12')](),controller[_0xf488('0x15')]);router[_0xf488('0xa')](_0xf488('0x16'),auth[_0xf488('0xb')](),controller['download']);router[_0xf488('0x17')]('/',auth['isAuthenticated'](),controller[_0xf488('0x18')]);router[_0xf488('0x17')](_0xf488('0x19'),auth[_0xf488('0xb')](),controller[_0xf488('0x1a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5d8192,_0x32ae85,_0x5146a7){_0x5146a7(null,path[_0xf488('0x1b')](config[_0xf488('0x1c')],_0xf488('0x1d')));},'filename':function(_0x2f878c,_0x2f5f05,_0x44d906){_0x44d906(null,util[_0xf488('0x1e')](_0xf488('0x1f'),Date[_0xf488('0x20')](),_0x2f5f05[_0xf488('0x21')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf488('0x17')]('/:id/attachment_upload',upload['single']('file'),controller[_0xf488('0x22')]);router[_0xf488('0x17')](_0xf488('0x14'),auth[_0xf488('0x12')](),controller[_0xf488('0x23')]);router[_0xf488('0x17')](_0xf488('0x24'),auth[_0xf488('0xb')](),interaction[_0xf488('0x25')](_0xf488('0x26'),_0xf488('0x27')),controller[_0xf488('0x28')]);router[_0xf488('0x29')](_0xf488('0xf'),auth[_0xf488('0xb')](),interaction[_0xf488('0x25')]('chat',_0xf488('0x2a')),controller['update']);router[_0xf488('0x29')]('/:id/custom_update',controller[_0xf488('0x2b')]);router['put'](_0xf488('0x2c'),auth[_0xf488('0x12')](),controller[_0xf488('0x2d')]);router[_0xf488('0x29')]('/:id/close',controller[_0xf488('0x2e')]);router[_0xf488('0x2f')]('/:id',auth[_0xf488('0xb')](),interaction['tracked']('chat','chatinteraction:destroy'),controller['destroy']);router[_0xf488('0x2f')](_0xf488('0x24'),auth['isAuthenticated'](),controller[_0xf488('0x30')]);module[_0xf488('0x31')]=router;
\ No newline at end of file
+var _0xdf49=['%s-%s','now','originalname','replace','single','file','attachmentUpload','addMessage','/:id/tags','tracked','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chat','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','get','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','createVidaooSession','diskStorage','join','root','format'];(function(_0x223c57,_0x25e922){var _0x5ce105=function(_0x37ae6b){while(--_0x37ae6b){_0x223c57['push'](_0x223c57['shift']());}};_0x5ce105(++_0x25e922);}(_0xdf49,0xbe));var _0x9df4=function(_0x32b3c2,_0xe56fd){_0x32b3c2=_0x32b3c2-0x0;var _0x40a313=_0xdf49[_0x32b3c2];return _0x40a313;};'use strict';var multer=require(_0x9df4('0x0'));var util=require(_0x9df4('0x1'));var path=require(_0x9df4('0x2'));var timeout=require(_0x9df4('0x3'));var express=require('express');var router=express[_0x9df4('0x4')]();var fs_extra=require(_0x9df4('0x5'));var auth=require(_0x9df4('0x6'));var interaction=require(_0x9df4('0x7'));var config=require(_0x9df4('0x8'));var controller=require(_0x9df4('0x9'));router['get']('/',auth[_0x9df4('0xa')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x9df4('0xb')](_0x9df4('0xc'),auth[_0x9df4('0xd')](),controller[_0x9df4('0xe')]);router[_0x9df4('0xb')](_0x9df4('0xf'),auth[_0x9df4('0xd')](),controller[_0x9df4('0x10')]);router[_0x9df4('0xb')](_0x9df4('0x11'),auth['isAuthenticated'](),controller[_0x9df4('0x12')]);router[_0x9df4('0xb')](_0x9df4('0x13'),auth[_0x9df4('0xd')](),controller[_0x9df4('0x14')]);router[_0x9df4('0xb')](_0x9df4('0x15'),auth[_0x9df4('0xa')](),controller[_0x9df4('0x16')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9df4('0x17')]);router[_0x9df4('0x18')]('/:id/vidaoo',auth[_0x9df4('0xa')](),controller[_0x9df4('0x19')]);var upload=multer({'storage':multer[_0x9df4('0x1a')]({'destination':function(_0x47244a,_0x34da6b,_0x1e4bed){_0x1e4bed(null,path[_0x9df4('0x1b')](config[_0x9df4('0x1c')],'server/files/attachments/'));},'filename':function(_0x3ed988,_0x3d7856,_0x3425db){_0x3425db(null,util[_0x9df4('0x1d')](_0x9df4('0x1e'),Date[_0x9df4('0x1f')](),_0x3d7856[_0x9df4('0x20')][_0x9df4('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9df4('0x18')]('/:id/attachment_upload',upload[_0x9df4('0x22')](_0x9df4('0x23')),controller[_0x9df4('0x24')]);router[_0x9df4('0x18')](_0x9df4('0x11'),auth[_0x9df4('0xd')](),controller[_0x9df4('0x25')]);router[_0x9df4('0x18')](_0x9df4('0x26'),auth[_0x9df4('0xa')](),interaction[_0x9df4('0x27')]('chat','chatinteraction:addtags'),controller[_0x9df4('0x28')]);router[_0x9df4('0x29')](_0x9df4('0xc'),auth['isAuthenticated'](),interaction[_0x9df4('0x27')]('chat',_0x9df4('0x2a')),controller[_0x9df4('0x2b')]);router[_0x9df4('0x29')](_0x9df4('0x2c'),controller[_0x9df4('0x2d')]);router[_0x9df4('0x29')](_0x9df4('0x2e'),auth['isChatInteractionAuthorized'](),controller[_0x9df4('0x2f')]);router[_0x9df4('0x29')](_0x9df4('0x30'),controller[_0x9df4('0x31')]);router[_0x9df4('0x32')](_0x9df4('0xc'),auth[_0x9df4('0xa')](),interaction[_0x9df4('0x27')](_0x9df4('0x33'),'chatinteraction:destroy'),controller[_0x9df4('0x34')]);router[_0x9df4('0x32')]('/:id/tags',auth[_0x9df4('0xa')](),controller[_0x9df4('0x35')]);module[_0x9df4('0x36')]=router;
\ No newline at end of file
index e940a57..33d59b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b8c=['medium','BOOLEAN','INTEGER','TEXT'];(function(_0x3e53d2,_0x56ac2b){var _0xfb1cd3=function(_0x42f75b){while(--_0x42f75b){_0x3e53d2['push'](_0x3e53d2['shift']());}};_0xfb1cd3(++_0x56ac2b);}(_0x2b8c,0x147));var _0xc2b8=function(_0x4c2b79,_0x4c064d){_0x4c2b79=_0x4c2b79-0x0;var _0x45063f=_0x2b8c[_0x4c2b79];return _0x45063f;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xc2b8('0x0')](_0xc2b8('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xc2b8('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xc2b8('0x3')]}};
\ No newline at end of file
+var _0xd8d0=['exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xd8d0,0x1db));var _0x0d8d=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0xd8d0[_0x1b4b23];return _0x2a325b;};'use strict';var Sequelize=require('sequelize');module[_0x0d8d('0x0')]={'body':{'type':Sequelize[_0x0d8d('0x1')](_0x0d8d('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0d8d('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x0d8d('0x4')]}};
\ No newline at end of file
index a813985..5b2b68a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7fc=['eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','save','update','then','destroy','error','name','send','index','map','ChatInternalMessage','rawAttributes','type','model','query','keys','attributes','intersection','fields','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','filter','includeAll','include','catch','show','length','find','create','body','params','describe','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','findAll','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','VoiceQueues','get','Agents','autoAssociation','UserProfileResource','isEmpty','push','FromId','read','-createdAt','all'];(function(_0x432ca9,_0x5251ce){var _0x6531b9=function(_0x51a9c0){while(--_0x51a9c0){_0x432ca9['push'](_0x432ca9['shift']());}};_0x6531b9(++_0x5251ce);}(_0xf7fc,0x6a));var _0xcf7f=function(_0x1a2d46,_0x19bd98){_0x1a2d46=_0x1a2d46-0x0;var _0x48b660=_0xf7fc[_0x1a2d46];return _0x48b660;};'use strict';var emlformat=require(_0xcf7f('0x0'));var rimraf=require(_0xcf7f('0x1'));var zipdir=require(_0xcf7f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcf7f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcf7f('0x4'));var util=require(_0xcf7f('0x5'));var path=require(_0xcf7f('0x6'));var sox=require(_0xcf7f('0x7'));var csv=require(_0xcf7f('0x8'));var ejs=require(_0xcf7f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcf7f('0xa'));var squel=require(_0xcf7f('0xb'));var crypto=require(_0xcf7f('0xc'));var jsforce=require(_0xcf7f('0xd'));var deskjs=require(_0xcf7f('0xe'));var toCsv=require(_0xcf7f('0x8'));var querystring=require(_0xcf7f('0xf'));var Papa=require(_0xcf7f('0x10'));var Redis=require(_0xcf7f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xcf7f('0x12'));var as=require(_0xcf7f('0x13'));var hardwareService=require(_0xcf7f('0x14'));var logger=require('../../config/logger')(_0xcf7f('0x15'));var utils=require(_0xcf7f('0x16'));var config=require(_0xcf7f('0x17'));var licenseUtil=require(_0xcf7f('0x18'));var db=require(_0xcf7f('0x19'))['db'];config['redis']=_[_0xcf7f('0x1a')](config[_0xcf7f('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xcf7f('0x1c'))(new Redis(config['redis']));require(_0xcf7f('0x1d'))[_0xcf7f('0x1e')](socket);function respondWithStatusCode(_0x3d82ab,_0x3b0e0a){_0x3b0e0a=_0x3b0e0a||0xcc;return function(_0x43e8f2){if(_0x43e8f2){return _0x3d82ab[_0xcf7f('0x1f')](_0x3b0e0a);}return _0x3d82ab[_0xcf7f('0x20')](_0x3b0e0a)[_0xcf7f('0x21')]();};}function respondWithResult(_0x581cd5,_0x548b76){_0x548b76=_0x548b76||0xc8;return function(_0x538b26){if(_0x538b26){return _0x581cd5['status'](_0x548b76)[_0xcf7f('0x22')](_0x538b26);}};}function respondWithFilteredResult(_0x1bbbfb,_0x51a252){return function(_0xf10e01){if(_0xf10e01){var _0xe3e7d8=typeof _0x51a252[_0xcf7f('0x23')]==='undefined'&&typeof _0x51a252[_0xcf7f('0x24')]==='undefined';var _0x291849=_0xf10e01[_0xcf7f('0x25')];var _0xe1da1a=_0xe3e7d8?0x0:_0x51a252[_0xcf7f('0x23')];var _0x2cf936=_0xe3e7d8?_0xf10e01[_0xcf7f('0x25')]:_0x51a252[_0xcf7f('0x23')]+_0x51a252[_0xcf7f('0x24')];var _0x293842;if(_0x2cf936>=_0x291849){_0x2cf936=_0x291849;_0x293842=0xc8;}else{_0x293842=0xce;}_0x1bbbfb[_0xcf7f('0x20')](_0x293842);return _0x1bbbfb[_0xcf7f('0x26')](_0xcf7f('0x27'),_0xe1da1a+'-'+_0x2cf936+'/'+_0x291849)['json'](_0xf10e01);}return null;};}function patchUpdates(_0x4ae600){return function(_0x5039d4){try{jsonpatch['apply'](_0x5039d4,_0x4ae600,!![]);}catch(_0x4c0204){return BPromise['reject'](_0x4c0204);}return _0x5039d4[_0xcf7f('0x28')]();};}function saveUpdates(_0x5b364a,_0xd2630){return function(_0x105123){if(_0x105123){return _0x105123[_0xcf7f('0x29')](_0x5b364a)[_0xcf7f('0x2a')](function(_0x3f4574){return _0x3f4574;});}return null;};}function removeEntity(_0x905d34,_0xbe24b){return function(_0x5ba178){if(_0x5ba178){return _0x5ba178[_0xcf7f('0x2b')]()['then'](function(){_0x905d34[_0xcf7f('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x518e44,_0x3ee97a){return function(_0x411547){if(!_0x411547){_0x518e44[_0xcf7f('0x1f')](0x194);}return _0x411547;};}function handleError(_0x2b5ff7,_0xb7189f){_0xb7189f=_0xb7189f||0x1f4;return function(_0x3d1948){logger[_0xcf7f('0x2c')](_0x3d1948['stack']);if(_0x3d1948['name']){delete _0x3d1948[_0xcf7f('0x2d')];}_0x2b5ff7[_0xcf7f('0x20')](_0xb7189f)[_0xcf7f('0x2e')](_0x3d1948);};}exports[_0xcf7f('0x2f')]=function(_0x33b973,_0x3f5d46){var _0x32e3bc={},_0x9a6b24={},_0x4ae277={'count':0x0,'rows':[]};var _0x3e6dc0=_[_0xcf7f('0x30')](db[_0xcf7f('0x31')][_0xcf7f('0x32')],function(_0x200183){return{'name':_0x200183['fieldName'],'type':_0x200183[_0xcf7f('0x33')]['key']};});_0x9a6b24[_0xcf7f('0x34')]=_[_0xcf7f('0x30')](_0x3e6dc0,'name');_0x9a6b24[_0xcf7f('0x35')]=_[_0xcf7f('0x36')](_0x33b973[_0xcf7f('0x35')]);_0x9a6b24['filters']=_['intersection'](_0x9a6b24[_0xcf7f('0x34')],_0x9a6b24[_0xcf7f('0x35')]);_0x32e3bc[_0xcf7f('0x37')]=_[_0xcf7f('0x38')](_0x9a6b24[_0xcf7f('0x34')],qs[_0xcf7f('0x39')](_0x33b973[_0xcf7f('0x35')]['fields']));_0x32e3bc[_0xcf7f('0x37')]=_0x32e3bc[_0xcf7f('0x37')]['length']?_0x32e3bc[_0xcf7f('0x37')]:_0x9a6b24[_0xcf7f('0x34')];if(!_0x33b973[_0xcf7f('0x35')]['hasOwnProperty'](_0xcf7f('0x3a'))){_0x32e3bc[_0xcf7f('0x24')]=qs['limit'](_0x33b973[_0xcf7f('0x35')][_0xcf7f('0x24')]);_0x32e3bc['offset']=qs[_0xcf7f('0x23')](_0x33b973[_0xcf7f('0x35')]['offset']);}_0x32e3bc[_0xcf7f('0x3b')]=qs[_0xcf7f('0x3c')](_0x33b973[_0xcf7f('0x35')]['sort']);_0x32e3bc['where']=qs[_0xcf7f('0x3d')](_[_0xcf7f('0x3e')](_0x33b973[_0xcf7f('0x35')],_0x9a6b24['filters']),_0x3e6dc0);if(_0x33b973['query']['filter']){_0x32e3bc['where']=_[_0xcf7f('0x3f')](_0x32e3bc[_0xcf7f('0x40')],{'$or':_[_0xcf7f('0x30')](_0x3e6dc0,function(_0x3d39b7){if(_0x3d39b7[_0xcf7f('0x33')]!==_0xcf7f('0x41')){var _0x35c1e4={};_0x35c1e4[_0x3d39b7[_0xcf7f('0x2d')]]={'$like':'%'+_0x33b973[_0xcf7f('0x35')][_0xcf7f('0x42')]+'%'};return _0x35c1e4;}})});}_0x32e3bc=_[_0xcf7f('0x3f')]({},_0x32e3bc,_0x33b973['options']);var _0x5d753c={'where':_0x32e3bc[_0xcf7f('0x40')]};return db[_0xcf7f('0x31')]['count'](_0x5d753c)[_0xcf7f('0x2a')](function(_0x53a197){_0x4ae277['count']=_0x53a197;if(_0x33b973[_0xcf7f('0x35')][_0xcf7f('0x43')]){_0x32e3bc[_0xcf7f('0x44')]=[{'all':!![]}];}return db[_0xcf7f('0x31')]['findAll'](_0x32e3bc);})['then'](function(_0x43b235){_0x4ae277['rows']=_0x43b235;return _0x4ae277;})[_0xcf7f('0x2a')](respondWithFilteredResult(_0x3f5d46,_0x32e3bc))[_0xcf7f('0x45')](handleError(_0x3f5d46,null));};exports[_0xcf7f('0x46')]=function(_0x38fbb7,_0x4b72f8){var _0x46fecd={'raw':!![],'where':{'id':_0x38fbb7['params']['id']}},_0x12551d={};_0x12551d[_0xcf7f('0x34')]=_[_0xcf7f('0x36')](db['ChatInternalMessage'][_0xcf7f('0x32')]);_0x12551d[_0xcf7f('0x35')]=_[_0xcf7f('0x36')](_0x38fbb7[_0xcf7f('0x35')]);_0x12551d[_0xcf7f('0x3d')]=_[_0xcf7f('0x38')](_0x12551d[_0xcf7f('0x34')],_0x12551d[_0xcf7f('0x35')]);_0x46fecd['attributes']=_[_0xcf7f('0x38')](_0x12551d[_0xcf7f('0x34')],qs[_0xcf7f('0x39')](_0x38fbb7[_0xcf7f('0x35')][_0xcf7f('0x39')]));_0x46fecd[_0xcf7f('0x37')]=_0x46fecd[_0xcf7f('0x37')][_0xcf7f('0x47')]?_0x46fecd[_0xcf7f('0x37')]:_0x12551d[_0xcf7f('0x34')];if(_0x38fbb7[_0xcf7f('0x35')]['includeAll']){_0x46fecd[_0xcf7f('0x44')]=[{'all':!![]}];}_0x46fecd=_[_0xcf7f('0x3f')]({},_0x46fecd,_0x38fbb7['options']);return db[_0xcf7f('0x31')][_0xcf7f('0x48')](_0x46fecd)[_0xcf7f('0x2a')](handleEntityNotFound(_0x4b72f8,null))[_0xcf7f('0x2a')](respondWithResult(_0x4b72f8,null))[_0xcf7f('0x45')](handleError(_0x4b72f8,null));};exports['create']=function(_0x25f8d9,_0x4fe318){return db[_0xcf7f('0x31')][_0xcf7f('0x49')](_0x25f8d9['body'],{})[_0xcf7f('0x2a')](respondWithResult(_0x4fe318,0xc9))['catch'](handleError(_0x4fe318,null));};exports['update']=function(_0x3b15f2,_0x181bc1){if(_0x3b15f2[_0xcf7f('0x4a')]['id']){delete _0x3b15f2[_0xcf7f('0x4a')]['id'];}return db[_0xcf7f('0x31')][_0xcf7f('0x48')]({'where':{'id':_0x3b15f2[_0xcf7f('0x4b')]['id']}})[_0xcf7f('0x2a')](handleEntityNotFound(_0x181bc1,null))['then'](saveUpdates(_0x3b15f2[_0xcf7f('0x4a')],null))[_0xcf7f('0x2a')](respondWithResult(_0x181bc1,null))['catch'](handleError(_0x181bc1,null));};exports[_0xcf7f('0x2b')]=function(_0x5942b3,_0x4853ee){return db[_0xcf7f('0x31')][_0xcf7f('0x48')]({'where':{'id':_0x5942b3[_0xcf7f('0x4b')]['id']}})[_0xcf7f('0x2a')](handleEntityNotFound(_0x4853ee,null))[_0xcf7f('0x2a')](removeEntity(_0x4853ee,null))['catch'](handleError(_0x4853ee,null));};exports[_0xcf7f('0x4c')]=function(_0x3f2da8,_0x512937){return db['ChatInternalMessage']['describe']()[_0xcf7f('0x2a')](respondWithResult(_0x512937,null))[_0xcf7f('0x45')](handleError(_0x512937,null));};function wrapUser(_0x467f9f){return function(_0x35d7a2){var _0x118aa4=_0x467f9f['get']({'plain':!![]});_0x118aa4[_0xcf7f('0x4d')]=[];if(_0x35d7a2){_0x118aa4[_0xcf7f('0x4e')]=_0x35d7a2[_0xcf7f('0x4f')];_0x118aa4[_0xcf7f('0x50')]=_0x35d7a2;}else{_0x118aa4[_0xcf7f('0x4e')]=moment(0x0)[_0xcf7f('0x51')](_0xcf7f('0x52'));_0x118aa4[_0xcf7f('0x50')]={};}return _0x118aa4;};}exports['getUsers']=function(_0xaede00,_0x581e1c,_0x5ba1e2){var _0x21cbb7=[];return db[_0xcf7f('0x53')][_0xcf7f('0x54')]({'where':{'role':[_0xcf7f('0x55'),_0xcf7f('0x56'),_0xcf7f('0x57')]},'attributes':['id',_0xcf7f('0x58'),_0xcf7f('0x2d'),_0xcf7f('0x59'),_0xcf7f('0x5a'),_0xcf7f('0x5b'),_0xcf7f('0x5c'),_0xcf7f('0x5d'),_0xcf7f('0x5e'),'showWebBar'],'order':qs[_0xcf7f('0x3c')]('-online'),'include':[{'model':db['VoiceQueue'],'as':_0xcf7f('0x5f'),'attributes':['id',_0xcf7f('0x2d'),_0xcf7f('0x33')],'through':{'attributes':[]}}]})[_0xcf7f('0x2a')](function(_0x18398f){if(_0x18398f){var _0x2ea2e2=_0xaede00[_0xcf7f('0x57')][_0xcf7f('0x60')]({'plain':!![]});if(!_0x2ea2e2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ea2e2[_0xcf7f('0x59')]===_0xcf7f('0x57')){return db['UserProfileSection']['find']({'where':{'name':_0xcf7f('0x61'),'userProfileId':_0x2ea2e2['userProfileId']},'raw':!![]})[_0xcf7f('0x2a')](function(_0x3d4112){if(_0x3d4112){if(_0x3d4112[_0xcf7f('0x62')]===0x0){return db[_0xcf7f('0x63')]['findAll']({'where':{'sectionId':_0x3d4112['id']},'raw':!![]})[_0xcf7f('0x2a')](function(_0x5e318e){var _0x3a3950=[];if(_[_0xcf7f('0x64')](_0x5e318e)){_0x3a3950=_[_0xcf7f('0x42')](_0x18398f,function(_0x88261c){if(_0x88261c[_0xcf7f('0x59')]!==_0xcf7f('0x55')){return _0x88261c;}});return _0x3a3950;}else{for(var _0x42d82f=0x0;_0x42d82f<_0x18398f[_0xcf7f('0x47')];_0x42d82f++){var _0x1cd12e=_0x18398f[_0x42d82f];if(_0x1cd12e[_0xcf7f('0x59')]==='agent'){var _0xbb2263=_['find'](_0x5e318e,function(_0x408800){return _0x408800['resourceId']===_0x1cd12e['id'];});if(_0xbb2263)_0x3a3950[_0xcf7f('0x65')](_0x1cd12e);}else{_0x3a3950[_0xcf7f('0x65')](_0x1cd12e);}}return _0x3a3950;}});}else{return _0x18398f;}}else{var _0x10293a=_[_0xcf7f('0x42')](_0x18398f,function(_0xcaadbc){if(_0xcaadbc[_0xcf7f('0x59')]!=='agent'){return _0xcaadbc;}});return _0x10293a;}});}else{return _0x18398f;}}})[_0xcf7f('0x2a')](function(_0x30badb){var _0x2236fc=[];if(_0x30badb){_0x21cbb7=_0x30badb;for(var _0x4e6f64=0x0;_0x4e6f64<_0x30badb['length'];_0x4e6f64+=0x1){_0x21cbb7[_0x4e6f64]['messages']=[];_0x2236fc[_0xcf7f('0x65')](db[_0xcf7f('0x31')][_0xcf7f('0x48')]({'where':{'FromId':[_0xaede00[_0xcf7f('0x57')]['id'],_0x30badb[_0x4e6f64]['id']],'ToId':[_0xaede00[_0xcf7f('0x57')]['id'],_0x30badb[_0x4e6f64]['id']],'ChatGroupId':null},'attributes':['id',_0xcf7f('0x4f'),_0xcf7f('0x66'),'ToId',_0xcf7f('0x67'),_0xcf7f('0x4a')],'order':qs['sort'](_0xcf7f('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x30badb[_0x4e6f64])));}return BPromise[_0xcf7f('0x69')](_0x2236fc);}return[];})['then'](function(_0x6532b1){return{'rows':_0x6532b1,'count':_0x6532b1[_0xcf7f('0x47')]};})[_0xcf7f('0x2a')](respondWithResult(_0x581e1c,null))['catch'](handleError(_0x581e1c,null));};
\ No newline at end of file
+var _0xc1f4=['catch','params','include','find','create','body','update','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','agent','admin','fullname','role','userpic','online','showWebBar','-online','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','isEmpty','resourceId','push','createdAt','FromId','ToId','read','-createdAt','all','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','rows'];(function(_0x334444,_0x20403c){var _0x303741=function(_0x2c7753){while(--_0x2c7753){_0x334444['push'](_0x334444['shift']());}};_0x303741(++_0x20403c);}(_0xc1f4,0x1d7));var _0x4c1f=function(_0x29abe6,_0x39ef28){_0x29abe6=_0x29abe6-0x0;var _0x4f91aa=_0xc1f4[_0x29abe6];return _0x4f91aa;};'use strict';var emlformat=require(_0x4c1f('0x0'));var rimraf=require(_0x4c1f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4c1f('0x2'));var rp=require('request-promise');var moment=require(_0x4c1f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4c1f('0x4'));var util=require(_0x4c1f('0x5'));var path=require('path');var sox=require(_0x4c1f('0x6'));var csv=require('to-csv');var ejs=require(_0x4c1f('0x7'));var fs=require('fs');var fs_extra=require(_0x4c1f('0x8'));var _=require('lodash');var squel=require(_0x4c1f('0x9'));var crypto=require(_0x4c1f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4c1f('0xb'));var toCsv=require(_0x4c1f('0xc'));var querystring=require(_0x4c1f('0xd'));var Papa=require('papaparse');var Redis=require(_0x4c1f('0xe'));var authService=require(_0x4c1f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4c1f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4c1f('0x11'))(_0x4c1f('0x12'));var utils=require(_0x4c1f('0x13'));var config=require(_0x4c1f('0x14'));var licenseUtil=require(_0x4c1f('0x15'));var db=require(_0x4c1f('0x16'))['db'];config[_0x4c1f('0x17')]=_[_0x4c1f('0x18')](config[_0x4c1f('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x4c1f('0x19'))(new Redis(config[_0x4c1f('0x17')]));require(_0x4c1f('0x1a'))[_0x4c1f('0x1b')](socket);function respondWithStatusCode(_0x18f13d,_0xc811e9){_0xc811e9=_0xc811e9||0xcc;return function(_0x6e3238){if(_0x6e3238){return _0x18f13d[_0x4c1f('0x1c')](_0xc811e9);}return _0x18f13d[_0x4c1f('0x1d')](_0xc811e9)[_0x4c1f('0x1e')]();};}function respondWithResult(_0x1f6bfb,_0x38b0e4){_0x38b0e4=_0x38b0e4||0xc8;return function(_0x334a1f){if(_0x334a1f){return _0x1f6bfb[_0x4c1f('0x1d')](_0x38b0e4)[_0x4c1f('0x1f')](_0x334a1f);}};}function respondWithFilteredResult(_0xd06c51,_0x33fb61){return function(_0x5c0506){if(_0x5c0506){var _0x4eef28=typeof _0x33fb61[_0x4c1f('0x20')]===_0x4c1f('0x21')&&typeof _0x33fb61[_0x4c1f('0x22')]==='undefined';var _0x41607d=_0x5c0506[_0x4c1f('0x23')];var _0x4ca17b=_0x4eef28?0x0:_0x33fb61[_0x4c1f('0x20')];var _0x59c391=_0x4eef28?_0x5c0506[_0x4c1f('0x23')]:_0x33fb61[_0x4c1f('0x20')]+_0x33fb61['limit'];var _0xe48a67;if(_0x59c391>=_0x41607d){_0x59c391=_0x41607d;_0xe48a67=0xc8;}else{_0xe48a67=0xce;}_0xd06c51[_0x4c1f('0x1d')](_0xe48a67);return _0xd06c51[_0x4c1f('0x24')](_0x4c1f('0x25'),_0x4ca17b+'-'+_0x59c391+'/'+_0x41607d)[_0x4c1f('0x1f')](_0x5c0506);}return null;};}function patchUpdates(_0x41ccb6){return function(_0x26ab6a){try{jsonpatch[_0x4c1f('0x26')](_0x26ab6a,_0x41ccb6,!![]);}catch(_0x502ff4){return BPromise['reject'](_0x502ff4);}return _0x26ab6a['save']();};}function saveUpdates(_0x19697b,_0x541a02){return function(_0x3a411b){if(_0x3a411b){return _0x3a411b['update'](_0x19697b)[_0x4c1f('0x27')](function(_0x9d2452){return _0x9d2452;});}return null;};}function removeEntity(_0x3de0b8,_0x123397){return function(_0xaa106a){if(_0xaa106a){return _0xaa106a[_0x4c1f('0x28')]()['then'](function(){_0x3de0b8[_0x4c1f('0x1d')](0xcc)[_0x4c1f('0x1e')]();});}};}function handleEntityNotFound(_0x1b0704,_0x390ce0){return function(_0x5f3649){if(!_0x5f3649){_0x1b0704[_0x4c1f('0x1c')](0x194);}return _0x5f3649;};}function handleError(_0x451977,_0x2153aa){_0x2153aa=_0x2153aa||0x1f4;return function(_0x12a1b7){logger[_0x4c1f('0x29')](_0x12a1b7[_0x4c1f('0x2a')]);if(_0x12a1b7[_0x4c1f('0x2b')]){delete _0x12a1b7[_0x4c1f('0x2b')];}_0x451977['status'](_0x2153aa)[_0x4c1f('0x2c')](_0x12a1b7);};}exports[_0x4c1f('0x2d')]=function(_0x45e542,_0x2a8927){var _0x5d0915={},_0x356090={},_0x357270={'count':0x0,'rows':[]};var _0x128654=_[_0x4c1f('0x2e')](db[_0x4c1f('0x2f')][_0x4c1f('0x30')],function(_0x152283){return{'name':_0x152283[_0x4c1f('0x31')],'type':_0x152283[_0x4c1f('0x32')][_0x4c1f('0x33')]};});_0x356090[_0x4c1f('0x34')]=_[_0x4c1f('0x2e')](_0x128654,_0x4c1f('0x2b'));_0x356090[_0x4c1f('0x35')]=_[_0x4c1f('0x36')](_0x45e542[_0x4c1f('0x35')]);_0x356090[_0x4c1f('0x37')]=_[_0x4c1f('0x38')](_0x356090[_0x4c1f('0x34')],_0x356090['query']);_0x5d0915['attributes']=_[_0x4c1f('0x38')](_0x356090['model'],qs[_0x4c1f('0x39')](_0x45e542[_0x4c1f('0x35')][_0x4c1f('0x39')]));_0x5d0915[_0x4c1f('0x3a')]=_0x5d0915[_0x4c1f('0x3a')][_0x4c1f('0x3b')]?_0x5d0915[_0x4c1f('0x3a')]:_0x356090[_0x4c1f('0x34')];if(!_0x45e542[_0x4c1f('0x35')]['hasOwnProperty']('nolimit')){_0x5d0915[_0x4c1f('0x22')]=qs['limit'](_0x45e542[_0x4c1f('0x35')][_0x4c1f('0x22')]);_0x5d0915[_0x4c1f('0x20')]=qs['offset'](_0x45e542['query'][_0x4c1f('0x20')]);}_0x5d0915['order']=qs[_0x4c1f('0x3c')](_0x45e542[_0x4c1f('0x35')][_0x4c1f('0x3c')]);_0x5d0915[_0x4c1f('0x3d')]=qs['filters'](_[_0x4c1f('0x3e')](_0x45e542[_0x4c1f('0x35')],_0x356090['filters']),_0x128654);if(_0x45e542[_0x4c1f('0x35')]['filter']){_0x5d0915['where']=_[_0x4c1f('0x3f')](_0x5d0915[_0x4c1f('0x3d')],{'$or':_[_0x4c1f('0x2e')](_0x128654,function(_0x345610){if(_0x345610[_0x4c1f('0x32')]!==_0x4c1f('0x40')){var _0xfc4cc4={};_0xfc4cc4[_0x345610[_0x4c1f('0x2b')]]={'$like':'%'+_0x45e542[_0x4c1f('0x35')][_0x4c1f('0x41')]+'%'};return _0xfc4cc4;}})});}_0x5d0915=_[_0x4c1f('0x3f')]({},_0x5d0915,_0x45e542[_0x4c1f('0x42')]);var _0x4d5b1d={'where':_0x5d0915[_0x4c1f('0x3d')]};return db[_0x4c1f('0x2f')][_0x4c1f('0x23')](_0x4d5b1d)[_0x4c1f('0x27')](function(_0x383317){_0x357270[_0x4c1f('0x23')]=_0x383317;if(_0x45e542['query'][_0x4c1f('0x43')]){_0x5d0915['include']=[{'all':!![]}];}return db[_0x4c1f('0x2f')]['findAll'](_0x5d0915);})[_0x4c1f('0x27')](function(_0x282619){_0x357270[_0x4c1f('0x44')]=_0x282619;return _0x357270;})['then'](respondWithFilteredResult(_0x2a8927,_0x5d0915))[_0x4c1f('0x45')](handleError(_0x2a8927,null));};exports['show']=function(_0x1a7897,_0x463723){var _0x52c5ac={'raw':!![],'where':{'id':_0x1a7897[_0x4c1f('0x46')]['id']}},_0x2244a9={};_0x2244a9[_0x4c1f('0x34')]=_[_0x4c1f('0x36')](db[_0x4c1f('0x2f')][_0x4c1f('0x30')]);_0x2244a9[_0x4c1f('0x35')]=_[_0x4c1f('0x36')](_0x1a7897[_0x4c1f('0x35')]);_0x2244a9[_0x4c1f('0x37')]=_[_0x4c1f('0x38')](_0x2244a9[_0x4c1f('0x34')],_0x2244a9[_0x4c1f('0x35')]);_0x52c5ac[_0x4c1f('0x3a')]=_['intersection'](_0x2244a9['model'],qs[_0x4c1f('0x39')](_0x1a7897[_0x4c1f('0x35')][_0x4c1f('0x39')]));_0x52c5ac[_0x4c1f('0x3a')]=_0x52c5ac['attributes'][_0x4c1f('0x3b')]?_0x52c5ac[_0x4c1f('0x3a')]:_0x2244a9[_0x4c1f('0x34')];if(_0x1a7897['query'][_0x4c1f('0x43')]){_0x52c5ac[_0x4c1f('0x47')]=[{'all':!![]}];}_0x52c5ac=_[_0x4c1f('0x3f')]({},_0x52c5ac,_0x1a7897['options']);return db['ChatInternalMessage'][_0x4c1f('0x48')](_0x52c5ac)[_0x4c1f('0x27')](handleEntityNotFound(_0x463723,null))[_0x4c1f('0x27')](respondWithResult(_0x463723,null))[_0x4c1f('0x45')](handleError(_0x463723,null));};exports[_0x4c1f('0x49')]=function(_0x43634b,_0x3bd075){return db['ChatInternalMessage'][_0x4c1f('0x49')](_0x43634b[_0x4c1f('0x4a')],{})[_0x4c1f('0x27')](respondWithResult(_0x3bd075,0xc9))[_0x4c1f('0x45')](handleError(_0x3bd075,null));};exports[_0x4c1f('0x4b')]=function(_0x558ef3,_0x493ee2){if(_0x558ef3['body']['id']){delete _0x558ef3[_0x4c1f('0x4a')]['id'];}return db[_0x4c1f('0x2f')][_0x4c1f('0x48')]({'where':{'id':_0x558ef3['params']['id']}})[_0x4c1f('0x27')](handleEntityNotFound(_0x493ee2,null))[_0x4c1f('0x27')](saveUpdates(_0x558ef3[_0x4c1f('0x4a')],null))['then'](respondWithResult(_0x493ee2,null))[_0x4c1f('0x45')](handleError(_0x493ee2,null));};exports[_0x4c1f('0x28')]=function(_0x50c4c5,_0x1be4fb){return db[_0x4c1f('0x2f')][_0x4c1f('0x48')]({'where':{'id':_0x50c4c5[_0x4c1f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1be4fb,null))[_0x4c1f('0x27')](removeEntity(_0x1be4fb,null))[_0x4c1f('0x45')](handleError(_0x1be4fb,null));};exports[_0x4c1f('0x4c')]=function(_0x4b31b9,_0x390a2c){return db[_0x4c1f('0x2f')][_0x4c1f('0x4c')]()['then'](respondWithResult(_0x390a2c,null))[_0x4c1f('0x45')](handleError(_0x390a2c,null));};function wrapUser(_0x2166d7){return function(_0x53d367){var _0x587ee1=_0x2166d7[_0x4c1f('0x4d')]({'plain':!![]});_0x587ee1[_0x4c1f('0x4e')]=[];if(_0x53d367){_0x587ee1[_0x4c1f('0x4f')]=_0x53d367['createdAt'];_0x587ee1[_0x4c1f('0x50')]=_0x53d367;}else{_0x587ee1[_0x4c1f('0x4f')]=moment(0x0)[_0x4c1f('0x51')](_0x4c1f('0x52'));_0x587ee1[_0x4c1f('0x50')]={};}return _0x587ee1;};}exports[_0x4c1f('0x53')]=function(_0x2c7af2,_0x584b03,_0x3c8cc1){var _0x5e2439=[];return db[_0x4c1f('0x54')][_0x4c1f('0x55')]({'where':{'role':[_0x4c1f('0x56'),_0x4c1f('0x57'),'user']},'attributes':['id',_0x4c1f('0x58'),'name',_0x4c1f('0x59'),_0x4c1f('0x5a'),'internal',_0x4c1f('0x5b'),'lastLoginAt','allowmessenger',_0x4c1f('0x5c')],'order':qs[_0x4c1f('0x3c')](_0x4c1f('0x5d')),'include':[{'model':db['VoiceQueue'],'as':_0x4c1f('0x5e'),'attributes':['id',_0x4c1f('0x2b'),'type'],'through':{'attributes':[]}}]})[_0x4c1f('0x27')](function(_0x3908ad){if(_0x3908ad){var _0x181757=_0x2c7af2[_0x4c1f('0x5f')][_0x4c1f('0x4d')]({'plain':!![]});if(!_0x181757)throw new Error(_0x4c1f('0x60'));if(_0x181757[_0x4c1f('0x59')]===_0x4c1f('0x5f')){return db[_0x4c1f('0x61')][_0x4c1f('0x48')]({'where':{'name':'Agents','userProfileId':_0x181757['userProfileId']},'raw':!![]})['then'](function(_0x3feea5){if(_0x3feea5){if(_0x3feea5[_0x4c1f('0x62')]===0x0){return db['UserProfileResource'][_0x4c1f('0x55')]({'where':{'sectionId':_0x3feea5['id']},'raw':!![]})[_0x4c1f('0x27')](function(_0xd6be2b){var _0x3ab148=[];if(_[_0x4c1f('0x63')](_0xd6be2b)){_0x3ab148=_['filter'](_0x3908ad,function(_0x32ddbb){if(_0x32ddbb[_0x4c1f('0x59')]!==_0x4c1f('0x56')){return _0x32ddbb;}});return _0x3ab148;}else{for(var _0x2f7244=0x0;_0x2f7244<_0x3908ad[_0x4c1f('0x3b')];_0x2f7244++){var _0x1b86d5=_0x3908ad[_0x2f7244];if(_0x1b86d5[_0x4c1f('0x59')]==='agent'){var _0x1e1872=_[_0x4c1f('0x48')](_0xd6be2b,function(_0x17b23e){return _0x17b23e[_0x4c1f('0x64')]===_0x1b86d5['id'];});if(_0x1e1872)_0x3ab148['push'](_0x1b86d5);}else{_0x3ab148[_0x4c1f('0x65')](_0x1b86d5);}}return _0x3ab148;}});}else{return _0x3908ad;}}else{var _0x1cf5b2=_[_0x4c1f('0x41')](_0x3908ad,function(_0x2ced8f){if(_0x2ced8f[_0x4c1f('0x59')]!==_0x4c1f('0x56')){return _0x2ced8f;}});return _0x1cf5b2;}});}else{return _0x3908ad;}}})[_0x4c1f('0x27')](function(_0x15da66){var _0x876ac8=[];if(_0x15da66){_0x5e2439=_0x15da66;for(var _0x2cfd8c=0x0;_0x2cfd8c<_0x15da66[_0x4c1f('0x3b')];_0x2cfd8c+=0x1){_0x5e2439[_0x2cfd8c]['messages']=[];_0x876ac8[_0x4c1f('0x65')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x2c7af2[_0x4c1f('0x5f')]['id'],_0x15da66[_0x2cfd8c]['id']],'ToId':[_0x2c7af2['user']['id'],_0x15da66[_0x2cfd8c]['id']],'ChatGroupId':null},'attributes':['id',_0x4c1f('0x66'),_0x4c1f('0x67'),_0x4c1f('0x68'),_0x4c1f('0x69'),_0x4c1f('0x4a')],'order':qs['sort'](_0x4c1f('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x15da66[_0x2cfd8c])));}return BPromise[_0x4c1f('0x6b')](_0x876ac8);}return[];})[_0x4c1f('0x27')](function(_0x16a377){return{'rows':_0x16a377,'count':_0x16a377['length']};})[_0x4c1f('0x27')](respondWithResult(_0x584b03,null))[_0x4c1f('0x45')](handleError(_0x584b03,null));};
\ No newline at end of file
index 7e6c0cc..260049a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x864e=['emit','hasOwnProperty','hook','events','ChatInternalMessage','setMaxListeners','update','remove'];(function(_0xc2b3ce,_0x533dfd){var _0x30e6bb=function(_0x1f24aa){while(--_0x1f24aa){_0xc2b3ce['push'](_0xc2b3ce['shift']());}};_0x30e6bb(++_0x533dfd);}(_0x864e,0x13b));var _0xe864=function(_0x5329c5,_0x2bcffc){_0x5329c5=_0x5329c5-0x0;var _0x39cf4e=_0x864e[_0x5329c5];return _0x39cf4e;};'use strict';var EventEmitter=require(_0xe864('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xe864('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xe864('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe864('0x3'),'afterDestroy':_0xe864('0x4')};function emitEvent(_0x59712b){return function(_0x26cb42,_0x16483e,_0x3b9b1d){ChatInternalMessageEvents[_0xe864('0x5')](_0x59712b+':'+_0x26cb42['id'],_0x26cb42);ChatInternalMessageEvents[_0xe864('0x5')](_0x59712b,_0x26cb42);_0x3b9b1d(null);};}for(var e in events){if(events[_0xe864('0x6')](e)){var event=events[e];ChatInternalMessage[_0xe864('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xbd65=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update'];(function(_0x3e1555,_0xd901c2){var _0x14824b=function(_0x5c4482){while(--_0x5c4482){_0x3e1555['push'](_0x3e1555['shift']());}};_0x14824b(++_0xd901c2);}(_0xbd65,0x102));var _0x5bd6=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xbd65[_0x209941];return _0x1e8729;};'use strict';var EventEmitter=require(_0x5bd6('0x0'));var ChatInternalMessage=require(_0x5bd6('0x1'))['db'][_0x5bd6('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x5bd6('0x3')](0x0);var events={'afterCreate':_0x5bd6('0x4'),'afterUpdate':_0x5bd6('0x5'),'afterDestroy':_0x5bd6('0x6')};function emitEvent(_0x162a6e){return function(_0x93918f,_0x1c297d,_0x36c2ea){ChatInternalMessageEvents[_0x5bd6('0x7')](_0x162a6e+':'+_0x93918f['id'],_0x93918f);ChatInternalMessageEvents[_0x5bd6('0x7')](_0x162a6e,_0x93918f);_0x36c2ea(null);};}for(var e in events){if(events[_0x5bd6('0x8')](e)){var event=events[e];ChatInternalMessage[_0x5bd6('0x9')](e,emitEvent(event));}}module[_0x5bd6('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
index 0b4b40c..04364a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4379=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4'];(function(_0x33ec2b,_0x153e18){var _0x4ec376=function(_0x2e5742){while(--_0x2e5742){_0x33ec2b['push'](_0x33ec2b['shift']());}};_0x4ec376(++_0x153e18);}(_0x4379,0x138));var _0x9437=function(_0x1aaa28,_0x12f88b){_0x1aaa28=_0x1aaa28-0x0;var _0x1e8371=_0x4379[_0x1aaa28];return _0x1e8371;};'use strict';var _=require(_0x9437('0x0'));var util=require(_0x9437('0x1'));var logger=require(_0x9437('0x2'))(_0x9437('0x3'));var moment=require(_0x9437('0x4'));var BPromise=require(_0x9437('0x5'));var rp=require(_0x9437('0x6'));var fs=require('fs');var path=require(_0x9437('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9437('0x8'));module['exports']=function(_0x1bea4b,_0x1d7ea5){return _0x1bea4b[_0x9437('0x9')](_0x9437('0xa'),attributes,{'tableName':_0x9437('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9437('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x5362=['lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4_unicode_ci'];(function(_0x3d9be7,_0x28364d){var _0x531878=function(_0xb9dfc5){while(--_0xb9dfc5){_0x3d9be7['push'](_0x3d9be7['shift']());}};_0x531878(++_0x28364d);}(_0x5362,0x12c));var _0x2536=function(_0x5e9f0e,_0x3f4402){_0x5e9f0e=_0x5e9f0e-0x0;var _0x2e6250=_0x5362[_0x5e9f0e];return _0x2e6250;};'use strict';var _=require(_0x2536('0x0'));var util=require(_0x2536('0x1'));var logger=require(_0x2536('0x2'))(_0x2536('0x3'));var moment=require(_0x2536('0x4'));var BPromise=require(_0x2536('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2536('0x6'));var attributes=require(_0x2536('0x7'));module[_0x2536('0x8')]=function(_0x1f1d9e,_0x293a04){return _0x1f1d9e[_0x2536('0x9')]('ChatInternalMessage',attributes,{'tableName':_0x2536('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2536('0xb')});};
\ No newline at end of file
index 590e081..718379f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cb5=['debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x19d415,_0x2cbee6){var _0x3d30de=function(_0x54b239){while(--_0x54b239){_0x19d415['push'](_0x19d415['shift']());}};_0x3d30de(++_0x2cbee6);}(_0x8cb5,0x19f));var _0x58cb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8cb5[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x58cb('0x0'));var util=require(_0x58cb('0x1'));var moment=require(_0x58cb('0x2'));var BPromise=require(_0x58cb('0x3'));var rs=require(_0x58cb('0x4'));var fs=require('fs');var Redis=require(_0x58cb('0x5'));var db=require(_0x58cb('0x6'))['db'];var utils=require(_0x58cb('0x7'));var logger=require('../../config/logger')(_0x58cb('0x8'));var config=require(_0x58cb('0x9'));var jayson=require(_0x58cb('0xa'));var client=jayson[_0x58cb('0xb')][_0x58cb('0xc')]({'port':0x232a});config[_0x58cb('0xd')]=_[_0x58cb('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x58cb('0xf'))(new Redis(config[_0x58cb('0xd')]));require('./chatInternalMessage.socket')[_0x58cb('0x10')](socket);function respondWithRpcPromise(_0x28a052,_0x914403,_0xdd4b65){return new BPromise(function(_0x31e886,_0x2eeea9){return client['request'](_0x28a052,_0xdd4b65)[_0x58cb('0x11')](function(_0x250895){logger['info'](_0x58cb('0x12'),_0x914403,_0x58cb('0x13'));logger[_0x58cb('0x14')](_0x58cb('0x15'),_0x914403,_0x58cb('0x13'),JSON[_0x58cb('0x16')](_0x250895));if(_0x250895[_0x58cb('0x17')]){if(_0x250895[_0x58cb('0x17')][_0x58cb('0x18')]===0x1f4){logger[_0x58cb('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x914403,_0x250895[_0x58cb('0x17')]['message']);return _0x2eeea9(_0x250895[_0x58cb('0x17')]['message']);}logger[_0x58cb('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x914403,_0x250895['error']['message']);return _0x31e886(_0x250895[_0x58cb('0x17')][_0x58cb('0x19')]);}else{logger[_0x58cb('0x1a')]('ChatInternalMessage,\x20%s,\x20%s',_0x914403,'request\x20sent');_0x31e886(_0x250895[_0x58cb('0x1b')]['message']);}})[_0x58cb('0x1c')](function(_0x4e11b9){logger[_0x58cb('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x914403,_0x4e11b9);_0x2eeea9(_0x4e11b9);});});}
\ No newline at end of file
+var _0xad6d=['client','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xad6d,0x17d));var _0xdad6=function(_0x28345e,_0x192de0){_0x28345e=_0x28345e-0x0;var _0xf0b4f1=_0xad6d[_0x28345e];return _0xf0b4f1;};'use strict';var _=require('lodash');var util=require(_0xdad6('0x0'));var moment=require(_0xdad6('0x1'));var BPromise=require('bluebird');var rs=require(_0xdad6('0x2'));var fs=require('fs');var Redis=require(_0xdad6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdad6('0x4'));var logger=require(_0xdad6('0x5'))(_0xdad6('0x6'));var config=require(_0xdad6('0x7'));var jayson=require(_0xdad6('0x8'));var client=jayson[_0xdad6('0x9')][_0xdad6('0xa')]({'port':0x232a});config[_0xdad6('0xb')]=_['defaults'](config[_0xdad6('0xb')],{'host':_0xdad6('0xc'),'port':0x18eb});var socket=require(_0xdad6('0xd'))(new Redis(config[_0xdad6('0xb')]));require(_0xdad6('0xe'))['register'](socket);function respondWithRpcPromise(_0x321ce3,_0x1aa40f,_0x1c3e32){return new BPromise(function(_0x278169,_0x466dfb){return client[_0xdad6('0xf')](_0x321ce3,_0x1c3e32)[_0xdad6('0x10')](function(_0x4ab568){logger[_0xdad6('0x11')](_0xdad6('0x12'),_0x1aa40f,'request\x20sent');logger['debug'](_0xdad6('0x13'),_0x1aa40f,'request\x20sent',JSON['stringify'](_0x4ab568));if(_0x4ab568['error']){if(_0x4ab568[_0xdad6('0x14')][_0xdad6('0x15')]===0x1f4){logger[_0xdad6('0x14')](_0xdad6('0x12'),_0x1aa40f,_0x4ab568[_0xdad6('0x14')][_0xdad6('0x16')]);return _0x466dfb(_0x4ab568[_0xdad6('0x14')][_0xdad6('0x16')]);}logger[_0xdad6('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x1aa40f,_0x4ab568[_0xdad6('0x14')][_0xdad6('0x16')]);return _0x278169(_0x4ab568[_0xdad6('0x14')][_0xdad6('0x16')]);}else{logger['info'](_0xdad6('0x12'),_0x1aa40f,_0xdad6('0x17'));_0x278169(_0x4ab568[_0xdad6('0x18')][_0xdad6('0x16')]);}})[_0xdad6('0x19')](function(_0xbb70fc){logger[_0xdad6('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x1aa40f,_0xbb70fc);_0x466dfb(_0xbb70fc);});});}
\ No newline at end of file
index 0ac2482..e5977eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccd8=['update','emit','removeListener','register','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0xc444e3,_0x24b4aa){var _0x18c6f3=function(_0x49307e){while(--_0x49307e){_0xc444e3['push'](_0xc444e3['shift']());}};_0x18c6f3(++_0x24b4aa);}(_0xccd8,0x19d));var _0x8ccd=function(_0x424bc1,_0x22cc1b){_0x424bc1=_0x424bc1-0x0;var _0x502fdc=_0xccd8[_0x424bc1];return _0x502fdc;};'use strict';var ChatInternalMessageEvents=require(_0x8ccd('0x0'));var events=[_0x8ccd('0x1'),_0x8ccd('0x2'),_0x8ccd('0x3')];function createListener(_0x31864f,_0x7be675){return function(_0x11d5fc){_0x7be675[_0x8ccd('0x4')](_0x31864f,_0x11d5fc);};}function removeListener(_0x52d552,_0x5d016b){return function(){ChatInternalMessageEvents[_0x8ccd('0x5')](_0x52d552,_0x5d016b);};}exports[_0x8ccd('0x6')]=function(_0x1d6160){for(var _0x5b352b=0x0,_0x2afb42=events['length'];_0x5b352b<_0x2afb42;_0x5b352b++){var _0x2c3982=events[_0x5b352b];var _0x390ff2=createListener(_0x8ccd('0x7')+_0x2c3982,_0x1d6160);ChatInternalMessageEvents['on'](_0x2c3982,_0x390ff2);}};
\ No newline at end of file
+var _0x4884=['register','length','chatInternalMessage:','./chatInternalMessage.events','remove','update'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x4884,0x10b));var _0x4488=function(_0x3b4114,_0xd3294a){_0x3b4114=_0x3b4114-0x0;var _0x14ad03=_0x4884[_0x3b4114];return _0x14ad03;};'use strict';var ChatInternalMessageEvents=require(_0x4488('0x0'));var events=['save',_0x4488('0x1'),_0x4488('0x2')];function createListener(_0x240025,_0xa1ec40){return function(_0xeb0927){_0xa1ec40['emit'](_0x240025,_0xeb0927);};}function removeListener(_0x5f0273,_0x17acc3){return function(){ChatInternalMessageEvents['removeListener'](_0x5f0273,_0x17acc3);};}exports[_0x4488('0x3')]=function(_0xfd77c1){for(var _0x1b8dea=0x0,_0x20e8be=events[_0x4488('0x4')];_0x1b8dea<_0x20e8be;_0x1b8dea++){var _0x5219f6=events[_0x1b8dea];var _0x3302a5=createListener(_0x4488('0x5')+_0x5219f6,_0xfd77c1);ChatInternalMessageEvents['on'](_0x5219f6,_0x3302a5);}};
\ No newline at end of file
index cb89f1c..d0a7876 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f2d=['delete','multer','util','path','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update'];(function(_0x46040d,_0x144f45){var _0x27fe40=function(_0x149b62){while(--_0x149b62){_0x46040d['push'](_0x46040d['shift']());}};_0x27fe40(++_0x144f45);}(_0x7f2d,0x157));var _0xd7f2=function(_0x11b0fc,_0xef00a){_0x11b0fc=_0x11b0fc-0x0;var _0xd79b47=_0x7f2d[_0x11b0fc];return _0xd79b47;};'use strict';var multer=require(_0xd7f2('0x0'));var util=require(_0xd7f2('0x1'));var path=require(_0xd7f2('0x2'));var timeout=require('connect-timeout');var express=require(_0xd7f2('0x3'));var router=express[_0xd7f2('0x4')]();var fs_extra=require(_0xd7f2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd7f2('0x6'));var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0xd7f2('0x7')]('/',auth[_0xd7f2('0x8')](),controller['index']);router[_0xd7f2('0x7')](_0xd7f2('0x9'),auth[_0xd7f2('0x8')](),controller[_0xd7f2('0xa')]);router[_0xd7f2('0x7')]('/users',auth[_0xd7f2('0x8')](),controller['getUsers']);router[_0xd7f2('0x7')](_0xd7f2('0xb'),auth[_0xd7f2('0x8')](),controller[_0xd7f2('0xc')]);router[_0xd7f2('0xd')]('/',auth[_0xd7f2('0x8')](),controller[_0xd7f2('0xe')]);router[_0xd7f2('0xf')]('/:id',controller[_0xd7f2('0x10')]);router[_0xd7f2('0x11')]('/:id',auth[_0xd7f2('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xeba8=['update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','describe','/users','getUsers','post','create','/:id'];(function(_0xe5d784,_0x15a1c8){var _0x398b3f=function(_0x6d8aec){while(--_0x6d8aec){_0xe5d784['push'](_0xe5d784['shift']());}};_0x398b3f(++_0x15a1c8);}(_0xeba8,0x1f1));var _0x8eba=function(_0x327cbf,_0x114362){_0x327cbf=_0x327cbf-0x0;var _0x409cb8=_0xeba8[_0x327cbf];return _0x409cb8;};'use strict';var multer=require(_0x8eba('0x0'));var util=require('util');var path=require(_0x8eba('0x1'));var timeout=require(_0x8eba('0x2'));var express=require(_0x8eba('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8eba('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8eba('0x5'));var controller=require(_0x8eba('0x6'));router[_0x8eba('0x7')]('/',auth[_0x8eba('0x8')](),controller[_0x8eba('0x9')]);router['get']('/describe',auth[_0x8eba('0x8')](),controller[_0x8eba('0xa')]);router[_0x8eba('0x7')](_0x8eba('0xb'),auth[_0x8eba('0x8')](),controller[_0x8eba('0xc')]);router[_0x8eba('0x7')]('/:id',auth[_0x8eba('0x8')](),controller['show']);router[_0x8eba('0xd')]('/',auth[_0x8eba('0x8')](),controller[_0x8eba('0xe')]);router['put'](_0x8eba('0xf'),controller[_0x8eba('0x10')]);router[_0x8eba('0x11')](_0x8eba('0xf'),auth[_0x8eba('0x8')](),controller['destroy']);module[_0x8eba('0x12')]=router;
\ No newline at end of file
index 952d0d6..5311e28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5eb1=['ENUM','out','DATE','STRING','exports','TEXT','medium','BOOLEAN'];(function(_0x4a599b,_0x1d2125){var _0x2d53d3=function(_0x5e7982){while(--_0x5e7982){_0x4a599b['push'](_0x4a599b['shift']());}};_0x2d53d3(++_0x1d2125);}(_0x5eb1,0x7c));var _0x15eb=function(_0x3457b4,_0x4cd8f9){_0x3457b4=_0x3457b4-0x0;var _0xaa8fa9=_0x5eb1[_0x3457b4];return _0xaa8fa9;};'use strict';var Sequelize=require('sequelize');module[_0x15eb('0x0')]={'body':{'type':Sequelize[_0x15eb('0x1')](_0x15eb('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x15eb('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x15eb('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x15eb('0x4')]('in','out'),'defaultValue':_0x15eb('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x15eb('0x6')]},'providerName':{'type':Sequelize[_0x15eb('0x7')]},'providerResponse':{'type':Sequelize[_0x15eb('0x1')]}};
\ No newline at end of file
+var _0xbbdd=['out','TEXT','exports','medium','BOOLEAN'];(function(_0x92ab15,_0x2a3eea){var _0x2bcc36=function(_0x595270){while(--_0x595270){_0x92ab15['push'](_0x92ab15['shift']());}};_0x2bcc36(++_0x2a3eea);}(_0xbbdd,0x1ba));var _0xdbbd=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0xbbdd[_0x45bf86];return _0x1f02b7;};'use strict';var Sequelize=require('sequelize');module[_0xdbbd('0x0')]={'body':{'type':Sequelize['TEXT'](_0xdbbd('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xdbbd('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xdbbd('0x3'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xdbbd('0x4')]}};
\ No newline at end of file
index fd7d50a..c74757c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1658=['attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','rows','show','params','keys','create','body','find','describe','chat-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','reject','RejectMessage','email','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','apply','save','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','key','filters','intersection','query'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1658,0x14c));var _0x8165=function(_0x382c01,_0x3d04aa){_0x382c01=_0x382c01-0x0;var _0x24cdcd=_0x1658[_0x382c01];return _0x24cdcd;};'use strict';var emlformat=require(_0x8165('0x0'));var rimraf=require(_0x8165('0x1'));var zipdir=require(_0x8165('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8165('0x3'));var moment=require(_0x8165('0x4'));var BPromise=require(_0x8165('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8165('0x6'));var sox=require(_0x8165('0x7'));var csv=require('to-csv');var ejs=require(_0x8165('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8165('0x9'));var squel=require(_0x8165('0xa'));var crypto=require(_0x8165('0xb'));var jsforce=require(_0x8165('0xc'));var deskjs=require(_0x8165('0xd'));var toCsv=require(_0x8165('0xe'));var querystring=require('querystring');var Papa=require(_0x8165('0xf'));var Redis=require(_0x8165('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8165('0x11'));var as=require(_0x8165('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8165('0x13'))(_0x8165('0x14'));var utils=require(_0x8165('0x15'));var config=require(_0x8165('0x16'));var licenseUtil=require(_0x8165('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x8165('0x18')](config['redis'],{'host':_0x8165('0x19'),'port':0x18eb});var socket=require(_0x8165('0x1a'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x8165('0x1b')](socket);var jayson=require(_0x8165('0x1c'));var client=jayson[_0x8165('0x1d')][_0x8165('0x1e')]({'port':0x232c});var client9002=jayson[_0x8165('0x1d')][_0x8165('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x53cee9,_0x170280,_0x5760a7,_0x17849b){return new BPromise(function(_0x440b58,_0x218c6d){var _0x8d48db=_0x17849b||client;return _0x8d48db['request'](_0x53cee9,_0x5760a7)[_0x8165('0x1f')](function(_0x524924){logger[_0x8165('0x20')](_0x8165('0x21'),_0x170280,_0x8165('0x22'));logger[_0x8165('0x23')](_0x8165('0x24'),_0x170280,_0x8165('0x22'),JSON[_0x8165('0x25')](_0x524924));if(_0x524924[_0x8165('0x26')]){if(_0x524924[_0x8165('0x26')][_0x8165('0x27')]===0x1f4){logger[_0x8165('0x26')](_0x8165('0x21'),_0x170280,_0x524924[_0x8165('0x26')][_0x8165('0x28')]);return _0x218c6d(_0x524924[_0x8165('0x26')][_0x8165('0x28')]);}logger[_0x8165('0x26')](_0x8165('0x21'),_0x170280,_0x524924[_0x8165('0x26')][_0x8165('0x28')]);return _0x440b58(_0x524924[_0x8165('0x26')][_0x8165('0x28')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x170280,_0x8165('0x22'));_0x440b58(_0x524924['result']['message']);}})[_0x8165('0x29')](function(_0x1f2a04){logger[_0x8165('0x26')](_0x8165('0x21'),_0x170280,_0x1f2a04);_0x218c6d(_0x1f2a04);});});}function respondWithStatusCode(_0x1cdb2c,_0xc38c3){_0xc38c3=_0xc38c3||0xcc;return function(_0x21aa29){if(_0x21aa29){return _0x1cdb2c[_0x8165('0x2a')](_0xc38c3);}return _0x1cdb2c[_0x8165('0x2b')](_0xc38c3)[_0x8165('0x2c')]();};}function respondWithResult(_0x4e51d0,_0x5a91b5){_0x5a91b5=_0x5a91b5||0xc8;return function(_0x2ddb89){if(_0x2ddb89){return _0x4e51d0[_0x8165('0x2b')](_0x5a91b5)[_0x8165('0x2d')](_0x2ddb89);}};}function respondWithFilteredResult(_0x43e7ae,_0x1a20d0){return function(_0x2eaa36){if(_0x2eaa36){var _0x1ae6f8=typeof _0x1a20d0['offset']===_0x8165('0x2e')&&typeof _0x1a20d0['limit']===_0x8165('0x2e');var _0x29d0a8=_0x2eaa36['count'];var _0x1c2322=_0x1ae6f8?0x0:_0x1a20d0[_0x8165('0x2f')];var _0x3ab18c=_0x1ae6f8?_0x2eaa36['count']:_0x1a20d0[_0x8165('0x2f')]+_0x1a20d0[_0x8165('0x30')];var _0x22248b;if(_0x3ab18c>=_0x29d0a8){_0x3ab18c=_0x29d0a8;_0x22248b=0xc8;}else{_0x22248b=0xce;}_0x43e7ae[_0x8165('0x2b')](_0x22248b);return _0x43e7ae[_0x8165('0x31')](_0x8165('0x32'),_0x1c2322+'-'+_0x3ab18c+'/'+_0x29d0a8)[_0x8165('0x2d')](_0x2eaa36);}return null;};}function patchUpdates(_0x39e4bb){return function(_0x284734){try{jsonpatch[_0x8165('0x33')](_0x284734,_0x39e4bb,!![]);}catch(_0x127bb4){return BPromise['reject'](_0x127bb4);}return _0x284734[_0x8165('0x34')]();};}function saveUpdates(_0x155874,_0x234317){return function(_0x4be661){if(_0x4be661){return _0x4be661[_0x8165('0x35')](_0x155874)[_0x8165('0x1f')](function(_0x1ae0a4){return _0x1ae0a4;});}return null;};}function removeEntity(_0x277db2,_0xde54bd){return function(_0x296fc9){if(_0x296fc9){return _0x296fc9[_0x8165('0x36')]()['then'](function(){_0x277db2[_0x8165('0x2b')](0xcc)[_0x8165('0x2c')]();});}};}function handleEntityNotFound(_0x492521,_0x895ee8){return function(_0x2f3511){if(!_0x2f3511){_0x492521[_0x8165('0x2a')](0x194);}return _0x2f3511;};}function handleError(_0x30a31f,_0x245c2c){_0x245c2c=_0x245c2c||0x1f4;return function(_0x4c5a91){logger['error'](_0x4c5a91[_0x8165('0x37')]);if(_0x4c5a91[_0x8165('0x38')]){delete _0x4c5a91[_0x8165('0x38')];}_0x30a31f['status'](_0x245c2c)[_0x8165('0x39')](_0x4c5a91);};}exports[_0x8165('0x3a')]=function(_0x4aaf2c,_0x1f39cb){var _0x2f36cd={},_0xfbb71b={},_0x1c82f4={'count':0x0,'rows':[]};var _0x4ba21e=_[_0x8165('0x3b')](db[_0x8165('0x3c')][_0x8165('0x3d')],function(_0x393aa0){return{'name':_0x393aa0[_0x8165('0x3e')],'type':_0x393aa0['type'][_0x8165('0x3f')]};});_0xfbb71b['model']=_[_0x8165('0x3b')](_0x4ba21e,_0x8165('0x38'));_0xfbb71b['query']=_['keys'](_0x4aaf2c['query']);_0xfbb71b[_0x8165('0x40')]=_[_0x8165('0x41')](_0xfbb71b['model'],_0xfbb71b[_0x8165('0x42')]);_0x2f36cd[_0x8165('0x43')]=_[_0x8165('0x41')](_0xfbb71b[_0x8165('0x44')],qs['fields'](_0x4aaf2c['query'][_0x8165('0x45')]));_0x2f36cd[_0x8165('0x43')]=_0x2f36cd[_0x8165('0x43')][_0x8165('0x46')]?_0x2f36cd['attributes']:_0xfbb71b[_0x8165('0x44')];if(!_0x4aaf2c['query'][_0x8165('0x47')](_0x8165('0x48'))){_0x2f36cd[_0x8165('0x30')]=qs['limit'](_0x4aaf2c[_0x8165('0x42')][_0x8165('0x30')]);_0x2f36cd[_0x8165('0x2f')]=qs[_0x8165('0x2f')](_0x4aaf2c[_0x8165('0x42')][_0x8165('0x2f')]);}_0x2f36cd[_0x8165('0x49')]=qs[_0x8165('0x4a')](_0x4aaf2c[_0x8165('0x42')]['sort']);_0x2f36cd[_0x8165('0x4b')]=qs[_0x8165('0x40')](_[_0x8165('0x4c')](_0x4aaf2c[_0x8165('0x42')],_0xfbb71b[_0x8165('0x40')]),_0x4ba21e);if(_0x4aaf2c[_0x8165('0x42')][_0x8165('0x4d')]){_0x2f36cd[_0x8165('0x4b')]=_[_0x8165('0x4e')](_0x2f36cd['where'],{'$or':_[_0x8165('0x3b')](_0x4ba21e,function(_0x551a87){if(_0x551a87[_0x8165('0x4f')]!==_0x8165('0x50')){var _0x52f0b4={};_0x52f0b4[_0x551a87['name']]={'$like':'%'+_0x4aaf2c['query'][_0x8165('0x4d')]+'%'};return _0x52f0b4;}})});}_0x2f36cd=_[_0x8165('0x4e')]({},_0x2f36cd,_0x4aaf2c[_0x8165('0x51')]);var _0x45a667={'where':_0x2f36cd[_0x8165('0x4b')]};return db['ChatMessage'][_0x8165('0x52')](_0x45a667)[_0x8165('0x1f')](function(_0x1a326a){_0x1c82f4[_0x8165('0x52')]=_0x1a326a;if(_0x4aaf2c[_0x8165('0x42')][_0x8165('0x53')]){_0x2f36cd[_0x8165('0x54')]=[{'all':!![]}];}return db[_0x8165('0x3c')]['findAll'](_0x2f36cd);})[_0x8165('0x1f')](function(_0x3fc377){_0x1c82f4[_0x8165('0x55')]=_0x3fc377;return _0x1c82f4;})[_0x8165('0x1f')](respondWithFilteredResult(_0x1f39cb,_0x2f36cd))[_0x8165('0x29')](handleError(_0x1f39cb,null));};exports[_0x8165('0x56')]=function(_0x24a8b1,_0x51f597){var _0x23ce7b={'raw':!![],'where':{'id':_0x24a8b1[_0x8165('0x57')]['id']}},_0x27646e={};_0x27646e[_0x8165('0x44')]=_[_0x8165('0x58')](db[_0x8165('0x3c')][_0x8165('0x3d')]);_0x27646e['query']=_[_0x8165('0x58')](_0x24a8b1[_0x8165('0x42')]);_0x27646e[_0x8165('0x40')]=_[_0x8165('0x41')](_0x27646e[_0x8165('0x44')],_0x27646e[_0x8165('0x42')]);_0x23ce7b[_0x8165('0x43')]=_[_0x8165('0x41')](_0x27646e[_0x8165('0x44')],qs[_0x8165('0x45')](_0x24a8b1[_0x8165('0x42')]['fields']));_0x23ce7b[_0x8165('0x43')]=_0x23ce7b[_0x8165('0x43')][_0x8165('0x46')]?_0x23ce7b[_0x8165('0x43')]:_0x27646e[_0x8165('0x44')];if(_0x24a8b1[_0x8165('0x42')][_0x8165('0x53')]){_0x23ce7b[_0x8165('0x54')]=[{'all':!![]}];}_0x23ce7b=_[_0x8165('0x4e')]({},_0x23ce7b,_0x24a8b1[_0x8165('0x51')]);return db[_0x8165('0x3c')]['find'](_0x23ce7b)['then'](handleEntityNotFound(_0x51f597,null))[_0x8165('0x1f')](respondWithResult(_0x51f597,null))[_0x8165('0x29')](handleError(_0x51f597,null));};exports[_0x8165('0x59')]=function(_0x59f5b7,_0x4d88da){return db[_0x8165('0x3c')][_0x8165('0x59')](_0x59f5b7[_0x8165('0x5a')],{})[_0x8165('0x1f')](respondWithResult(_0x4d88da,0xc9))[_0x8165('0x29')](handleError(_0x4d88da,null));};exports[_0x8165('0x35')]=function(_0x2ddb44,_0x547246){if(_0x2ddb44[_0x8165('0x5a')]['id']){delete _0x2ddb44[_0x8165('0x5a')]['id'];}return db[_0x8165('0x3c')][_0x8165('0x5b')]({'where':{'id':_0x2ddb44[_0x8165('0x57')]['id']}})[_0x8165('0x1f')](handleEntityNotFound(_0x547246,null))[_0x8165('0x1f')](saveUpdates(_0x2ddb44[_0x8165('0x5a')],null))[_0x8165('0x1f')](respondWithResult(_0x547246,null))['catch'](handleError(_0x547246,null));};exports['destroy']=function(_0x10e594,_0x180b3f){return db['ChatMessage'][_0x8165('0x5b')]({'where':{'id':_0x10e594['params']['id']}})['then'](handleEntityNotFound(_0x180b3f,null))['then'](removeEntity(_0x180b3f,null))[_0x8165('0x29')](handleError(_0x180b3f,null));};exports['describe']=function(_0x1f9b2f,_0x3a0b12){return db[_0x8165('0x3c')][_0x8165('0x5c')]()[_0x8165('0x1f')](respondWithResult(_0x3a0b12,null))[_0x8165('0x29')](handleError(_0x3a0b12,null));};var interaction_log=require(_0x8165('0x13'))(_0x8165('0x5d'));exports[_0x8165('0x5e')]=function(_0x2fd1a7,_0x1dd940,_0x4ea434){var _0x5e171f={'agent':{},'channel':'chat'};if(_0x2fd1a7[_0x8165('0x5a')]['id']){delete _0x2fd1a7[_0x8165('0x5a')]['id'];}_0x2fd1a7[_0x8165('0x5a')][_0x8165('0x5f')]=!![];_0x2fd1a7['body']['readAt']=moment()[_0x8165('0x60')](_0x8165('0x61'));_0x2fd1a7['body'][_0x8165('0x62')]=_0x2fd1a7[_0x8165('0x5a')][_0x8165('0x62')]||_0x2fd1a7[_0x8165('0x63')]['id'];_0x5e171f[_0x8165('0x64')]['id']=_0x2fd1a7[_0x8165('0x5a')][_0x8165('0x62')];return db['ChatMessage'][_0x8165('0x5b')]({'where':{'id':_0x2fd1a7['params']['id'],'UserId':null}})[_0x8165('0x1f')](handleEntityNotFound(_0x1dd940,null))['then'](saveUpdates(_0x2fd1a7[_0x8165('0x5a')],null))[_0x8165('0x1f')](function(_0x23cbc6){if(_0x23cbc6){_0x5e171f['message']=_0x23cbc6[_0x8165('0x65')]({'plain':!![]});return db[_0x8165('0x66')][_0x8165('0x5b')]({'where':{'id':_0x23cbc6[_0x8165('0x67')]}});}return null;})[_0x8165('0x1f')](handleEntityNotFound(_0x1dd940,null))[_0x8165('0x1f')](function(_0x4c289f){if(_0x4c289f){return _0x4c289f[_0x8165('0x35')]({'UserId':_0x2fd1a7[_0x8165('0x5a')][_0x8165('0x62')],'read1stAt':_[_0x8165('0x68')](_0x4c289f[_0x8165('0x69')])?moment()[_0x8165('0x60')](_0x8165('0x61')):undefined});}return null;})[_0x8165('0x1f')](function(_0x51c446){if(_0x51c446){_0x5e171f[_0x8165('0x6a')]=_0x51c446[_0x8165('0x65')]({'plain':!![]});interaction_log[_0x8165('0x20')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2fd1a7[_0x8165('0x63')]['id'],_0x2fd1a7[_0x8165('0x63')][_0x8165('0x38')],_0x2fd1a7['user'][_0x8165('0x6b')],_0x5e171f['interaction']['id'],_0x2fd1a7[_0x8165('0x5a')]?JSON['stringify'](_0x2fd1a7['body']):_0x8165('0x6c'));return respondWithRpcPromise('AcceptMessage',_0x8165('0x6d'),_0x5e171f);}return null;})[_0x8165('0x1f')](function(_0x4aa66e){var _0x4cd100=_0x8165('0x6e')+_0x4aa66e[_0x8165('0x28')][_0x8165('0x6f')];return db['sequelize'][_0x8165('0x42')](_0x4cd100,{'type':db[_0x8165('0x70')][_0x8165('0x71')][_0x8165('0x72')],'raw':!![]})['then'](function(_0x30a379){return _0x30a379;});})[_0x8165('0x1f')](function(_0x23a80f){if(_0x23a80f){_0x5e171f[_0x8165('0x28')][_0x8165('0x73')]=_0x23a80f[0x0];if(!_0x2fd1a7[_0x8165('0x5a')][_0x8165('0x62')])return;return db[_0x8165('0x74')]['find']({'where':{'id':_0x2fd1a7[_0x8165('0x5a')][_0x8165('0x62')],'role':_0x8165('0x64')},'attributes':['id',_0x8165('0x38'),_0x8165('0x75'),'email',_0x8165('0x76')],'raw':!![]});}return null;})[_0x8165('0x1f')](function(_0x196e19){if(!_0x196e19)return null;_0x5e171f['message'][_0x8165('0x64')]=_0x196e19;return _0x5e171f;})[_0x8165('0x1f')](function(_0x1af162){if(_0x1af162){if(_0x2fd1a7[_0x8165('0x5a')][_0x8165('0x77')]){_0x5e171f[_0x8165('0x28')][_0x8165('0x78')]=util['format'](_0x8165('0x79'),_0x2fd1a7[_0x8165('0x63')][_0x8165('0x38')]);_0x5e171f[_0x8165('0x28')]['channel']=_0x5e171f[_0x8165('0x7a')];_0x5e171f[_0x8165('0x28')][_0x8165('0x7b')]=_0x5e171f[_0x8165('0x7a')];_0x5e171f['message'][_0x8165('0x7c')]=_0x8165('0x5e');return respondWithRpcPromise(_0x8165('0x7d'),_0x8165('0x7d'),{'event':_0x8165('0x7e'),'message':_[_0x8165('0x4e')](_0x5e171f[_0x8165('0x28')],JSON[_0x8165('0x7f')](_0x5e171f[_0x8165('0x6a')][_0x8165('0x80')]))},client9002)[_0x8165('0x1f')](function(){return _0x5e171f;});}return _0x5e171f;}return null;})[_0x8165('0x1f')](respondWithResult(_0x1dd940,null))[_0x8165('0x29')](handleError(_0x1dd940,null));};var interaction_log=require(_0x8165('0x13'))(_0x8165('0x5d'));exports[_0x8165('0x81')]=function(_0x1f4956,_0x4cd3c8,_0x4a367d){var _0x39e5fb={'agent':{},'channel':'chat'};if(_0x1f4956[_0x8165('0x5a')]['id']){delete _0x1f4956[_0x8165('0x5a')]['id'];}_0x1f4956[_0x8165('0x5a')]['UserId']=_0x1f4956[_0x8165('0x5a')][_0x8165('0x62')]||_0x1f4956[_0x8165('0x63')]['id'];_0x39e5fb[_0x8165('0x64')]['id']=_0x1f4956[_0x8165('0x5a')][_0x8165('0x62')];return db[_0x8165('0x3c')]['find']({'where':{'id':_0x1f4956[_0x8165('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4cd3c8,null))[_0x8165('0x1f')](function(_0x218474){if(_0x218474){_0x39e5fb[_0x8165('0x28')]=_0x218474[_0x8165('0x65')]({'plain':!![]});return db[_0x8165('0x66')][_0x8165('0x5b')]({'where':{'id':_0x218474['ChatInteractionId']}});}return null;})[_0x8165('0x1f')](handleEntityNotFound(_0x4cd3c8,null))[_0x8165('0x1f')](function(_0x3d3c67){if(_0x3d3c67){_0x39e5fb[_0x8165('0x6a')]=_0x3d3c67[_0x8165('0x65')]({'plain':!![]});interaction_log[_0x8165('0x20')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1f4956[_0x8165('0x63')]['id'],_0x1f4956[_0x8165('0x63')][_0x8165('0x38')],_0x1f4956['user']['role'],_0x39e5fb[_0x8165('0x6a')]['id'],_0x1f4956[_0x8165('0x5a')]?JSON[_0x8165('0x25')](_0x1f4956[_0x8165('0x5a')]):_0x8165('0x6c'));return respondWithRpcPromise(_0x8165('0x82'),'rejectMessage',_0x39e5fb);}return null;})[_0x8165('0x1f')](function(_0x3691bd){var _0x1094fb='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3691bd[_0x8165('0x28')]['ContactId'];return db['sequelize']['query'](_0x1094fb,{'type':db[_0x8165('0x70')]['QueryTypes']['SELECT'],'raw':!![]})[_0x8165('0x1f')](function(_0x482f6c){return _0x482f6c;});})[_0x8165('0x1f')](function(_0x2723e4){if(_0x2723e4){_0x39e5fb[_0x8165('0x28')][_0x8165('0x73')]=_0x2723e4[0x0];if(!_0x1f4956[_0x8165('0x5a')][_0x8165('0x62')])return;return db[_0x8165('0x74')][_0x8165('0x5b')]({'where':{'id':_0x1f4956[_0x8165('0x5a')][_0x8165('0x62')],'role':_0x8165('0x64')},'attributes':['id','name',_0x8165('0x75'),_0x8165('0x83'),_0x8165('0x76')],'raw':!![]});}return null;})[_0x8165('0x1f')](function(_0x1586e7){if(!_0x1586e7)return null;_0x39e5fb[_0x8165('0x28')][_0x8165('0x64')]=_0x1586e7;return _0x39e5fb;})[_0x8165('0x1f')](function(_0x2c679c){if(_0x2c679c){_0x2c679c[_0x8165('0x28')][_0x8165('0x78')]=util[_0x8165('0x60')]('SIP/%s',_0x1f4956[_0x8165('0x63')][_0x8165('0x38')]);_0x2c679c[_0x8165('0x28')][_0x8165('0x7a')]=_0x39e5fb['channel'];_0x2c679c[_0x8165('0x28')]['motionChannel']=_0x39e5fb['channel'];_0x2c679c[_0x8165('0x28')]['event']=_0x8165('0x81');respondWithRpcPromise(_0x8165('0x7d'),_0x8165('0x7d'),{'event':_0x8165('0x84'),'message':_[_0x8165('0x4e')](_0x39e5fb[_0x8165('0x28')],JSON[_0x8165('0x7f')](_0x39e5fb['interaction']['formData']))},client9002);return _0x39e5fb;}return null;})[_0x8165('0x1f')](respondWithResult(_0x4cd3c8,null))[_0x8165('0x29')](handleError(_0x4cd3c8,null));};
\ No newline at end of file
+var _0x1d63=['includeAll','include','findAll','show','params','find','create','body','update','describe','../../config/logger','accept','chat','read','readAt','UserId','user','ChatInteraction','isNil','read1stAt','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','agent','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','parse','formData','chat-interactions','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','destroy','stack','name','index','map','ChatMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','type','filter','options'];(function(_0x3b19ea,_0x518b6b){var _0x40ece9=function(_0x3a3386){while(--_0x3a3386){_0x3b19ea['push'](_0x3b19ea['shift']());}};_0x40ece9(++_0x518b6b);}(_0x1d63,0x13c));var _0x31d6=function(_0x5d1dfd,_0x1fd572){_0x5d1dfd=_0x5d1dfd-0x0;var _0x4cba70=_0x1d63[_0x5d1dfd];return _0x4cba70;};'use strict';var emlformat=require(_0x31d6('0x0'));var rimraf=require(_0x31d6('0x1'));var zipdir=require(_0x31d6('0x2'));var jsonpatch=require(_0x31d6('0x3'));var rp=require(_0x31d6('0x4'));var moment=require(_0x31d6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x31d6('0x6'));var util=require(_0x31d6('0x7'));var path=require(_0x31d6('0x8'));var sox=require('sox');var csv=require(_0x31d6('0x9'));var ejs=require(_0x31d6('0xa'));var fs=require('fs');var fs_extra=require(_0x31d6('0xb'));var _=require(_0x31d6('0xc'));var squel=require(_0x31d6('0xd'));var crypto=require(_0x31d6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x31d6('0xf'));var toCsv=require(_0x31d6('0x9'));var querystring=require(_0x31d6('0x10'));var Papa=require(_0x31d6('0x11'));var Redis=require(_0x31d6('0x12'));var authService=require(_0x31d6('0x13'));var qs=require(_0x31d6('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x31d6('0x15'));var logger=require('../../config/logger')(_0x31d6('0x16'));var utils=require(_0x31d6('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x31d6('0x18'));var db=require(_0x31d6('0x19'))['db'];config[_0x31d6('0x1a')]=_[_0x31d6('0x1b')](config[_0x31d6('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x31d6('0x1c'))(new Redis(config[_0x31d6('0x1a')]));require('./chatMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x31d6('0x1d')][_0x31d6('0x1e')]({'port':0x232c});var client9002=jayson[_0x31d6('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c97c9,_0x291685,_0xef4b44,_0x189838){return new BPromise(function(_0x53301b,_0x4e3a1b){var _0x394692=_0x189838||client;return _0x394692[_0x31d6('0x1f')](_0x2c97c9,_0xef4b44)[_0x31d6('0x20')](function(_0x3d1aaf){logger[_0x31d6('0x21')](_0x31d6('0x22'),_0x291685,_0x31d6('0x23'));logger[_0x31d6('0x24')](_0x31d6('0x25'),_0x291685,_0x31d6('0x23'),JSON[_0x31d6('0x26')](_0x3d1aaf));if(_0x3d1aaf[_0x31d6('0x27')]){if(_0x3d1aaf['error'][_0x31d6('0x28')]===0x1f4){logger['error'](_0x31d6('0x22'),_0x291685,_0x3d1aaf[_0x31d6('0x27')][_0x31d6('0x29')]);return _0x4e3a1b(_0x3d1aaf[_0x31d6('0x27')][_0x31d6('0x29')]);}logger[_0x31d6('0x27')](_0x31d6('0x22'),_0x291685,_0x3d1aaf[_0x31d6('0x27')]['message']);return _0x53301b(_0x3d1aaf['error'][_0x31d6('0x29')]);}else{logger['info'](_0x31d6('0x22'),_0x291685,_0x31d6('0x23'));_0x53301b(_0x3d1aaf[_0x31d6('0x2a')][_0x31d6('0x29')]);}})[_0x31d6('0x2b')](function(_0xb62601){logger[_0x31d6('0x27')](_0x31d6('0x22'),_0x291685,_0xb62601);_0x4e3a1b(_0xb62601);});});}function respondWithStatusCode(_0x44d248,_0x18a8bb){_0x18a8bb=_0x18a8bb||0xcc;return function(_0x2a04b0){if(_0x2a04b0){return _0x44d248[_0x31d6('0x2c')](_0x18a8bb);}return _0x44d248[_0x31d6('0x2d')](_0x18a8bb)[_0x31d6('0x2e')]();};}function respondWithResult(_0x441f9f,_0x2bfb52){_0x2bfb52=_0x2bfb52||0xc8;return function(_0x3e2520){if(_0x3e2520){return _0x441f9f['status'](_0x2bfb52)['json'](_0x3e2520);}};}function respondWithFilteredResult(_0x481b34,_0x17bc47){return function(_0x162ad8){if(_0x162ad8){var _0x4ed85a=typeof _0x17bc47[_0x31d6('0x2f')]===_0x31d6('0x30')&&typeof _0x17bc47[_0x31d6('0x31')]==='undefined';var _0x4518c9=_0x162ad8[_0x31d6('0x32')];var _0x285a2e=_0x4ed85a?0x0:_0x17bc47[_0x31d6('0x2f')];var _0x5ec272=_0x4ed85a?_0x162ad8['count']:_0x17bc47['offset']+_0x17bc47[_0x31d6('0x31')];var _0x17f492;if(_0x5ec272>=_0x4518c9){_0x5ec272=_0x4518c9;_0x17f492=0xc8;}else{_0x17f492=0xce;}_0x481b34[_0x31d6('0x2d')](_0x17f492);return _0x481b34['set'](_0x31d6('0x33'),_0x285a2e+'-'+_0x5ec272+'/'+_0x4518c9)[_0x31d6('0x34')](_0x162ad8);}return null;};}function patchUpdates(_0x3d7e9c){return function(_0x17d241){try{jsonpatch['apply'](_0x17d241,_0x3d7e9c,!![]);}catch(_0xe64dc0){return BPromise[_0x31d6('0x35')](_0xe64dc0);}return _0x17d241[_0x31d6('0x36')]();};}function saveUpdates(_0x2e106c,_0x25c15d){return function(_0x70ad43){if(_0x70ad43){return _0x70ad43['update'](_0x2e106c)[_0x31d6('0x20')](function(_0x4461ab){return _0x4461ab;});}return null;};}function removeEntity(_0x7c258e,_0x1d5fc3){return function(_0x22750e){if(_0x22750e){return _0x22750e[_0x31d6('0x37')]()[_0x31d6('0x20')](function(){_0x7c258e['status'](0xcc)[_0x31d6('0x2e')]();});}};}function handleEntityNotFound(_0x49037a,_0x6f8b40){return function(_0xac0543){if(!_0xac0543){_0x49037a[_0x31d6('0x2c')](0x194);}return _0xac0543;};}function handleError(_0x5c339c,_0x36a6bb){_0x36a6bb=_0x36a6bb||0x1f4;return function(_0x4596bd){logger['error'](_0x4596bd[_0x31d6('0x38')]);if(_0x4596bd[_0x31d6('0x39')]){delete _0x4596bd[_0x31d6('0x39')];}_0x5c339c['status'](_0x36a6bb)['send'](_0x4596bd);};}exports[_0x31d6('0x3a')]=function(_0x177f66,_0x502618){var _0x467d03={},_0x252048={},_0x2151de={'count':0x0,'rows':[]};var _0x1546b6=_[_0x31d6('0x3b')](db[_0x31d6('0x3c')][_0x31d6('0x3d')],function(_0x20d3e8){return{'name':_0x20d3e8[_0x31d6('0x3e')],'type':_0x20d3e8['type'][_0x31d6('0x3f')]};});_0x252048[_0x31d6('0x40')]=_[_0x31d6('0x3b')](_0x1546b6,_0x31d6('0x39'));_0x252048[_0x31d6('0x41')]=_[_0x31d6('0x42')](_0x177f66['query']);_0x252048[_0x31d6('0x43')]=_[_0x31d6('0x44')](_0x252048['model'],_0x252048['query']);_0x467d03[_0x31d6('0x45')]=_[_0x31d6('0x44')](_0x252048[_0x31d6('0x40')],qs['fields'](_0x177f66[_0x31d6('0x41')][_0x31d6('0x46')]));_0x467d03[_0x31d6('0x45')]=_0x467d03[_0x31d6('0x45')][_0x31d6('0x47')]?_0x467d03[_0x31d6('0x45')]:_0x252048[_0x31d6('0x40')];if(!_0x177f66[_0x31d6('0x41')]['hasOwnProperty'](_0x31d6('0x48'))){_0x467d03[_0x31d6('0x31')]=qs[_0x31d6('0x31')](_0x177f66[_0x31d6('0x41')][_0x31d6('0x31')]);_0x467d03[_0x31d6('0x2f')]=qs[_0x31d6('0x2f')](_0x177f66[_0x31d6('0x41')][_0x31d6('0x2f')]);}_0x467d03['order']=qs[_0x31d6('0x49')](_0x177f66['query'][_0x31d6('0x49')]);_0x467d03[_0x31d6('0x4a')]=qs[_0x31d6('0x43')](_[_0x31d6('0x4b')](_0x177f66[_0x31d6('0x41')],_0x252048['filters']),_0x1546b6);if(_0x177f66[_0x31d6('0x41')]['filter']){_0x467d03[_0x31d6('0x4a')]=_[_0x31d6('0x4c')](_0x467d03[_0x31d6('0x4a')],{'$or':_[_0x31d6('0x3b')](_0x1546b6,function(_0x4afe26){if(_0x4afe26[_0x31d6('0x4d')]!=='VIRTUAL'){var _0x21f553={};_0x21f553[_0x4afe26[_0x31d6('0x39')]]={'$like':'%'+_0x177f66[_0x31d6('0x41')][_0x31d6('0x4e')]+'%'};return _0x21f553;}})});}_0x467d03=_[_0x31d6('0x4c')]({},_0x467d03,_0x177f66[_0x31d6('0x4f')]);var _0x4a7587={'where':_0x467d03['where']};return db['ChatMessage']['count'](_0x4a7587)['then'](function(_0x36e054){_0x2151de[_0x31d6('0x32')]=_0x36e054;if(_0x177f66[_0x31d6('0x41')][_0x31d6('0x50')]){_0x467d03[_0x31d6('0x51')]=[{'all':!![]}];}return db[_0x31d6('0x3c')][_0x31d6('0x52')](_0x467d03);})[_0x31d6('0x20')](function(_0x9cbec2){_0x2151de['rows']=_0x9cbec2;return _0x2151de;})[_0x31d6('0x20')](respondWithFilteredResult(_0x502618,_0x467d03))[_0x31d6('0x2b')](handleError(_0x502618,null));};exports[_0x31d6('0x53')]=function(_0x80e5e3,_0x49e4b1){var _0x5b4d79={'raw':!![],'where':{'id':_0x80e5e3[_0x31d6('0x54')]['id']}},_0x54ce75={};_0x54ce75[_0x31d6('0x40')]=_[_0x31d6('0x42')](db['ChatMessage'][_0x31d6('0x3d')]);_0x54ce75[_0x31d6('0x41')]=_[_0x31d6('0x42')](_0x80e5e3[_0x31d6('0x41')]);_0x54ce75[_0x31d6('0x43')]=_[_0x31d6('0x44')](_0x54ce75['model'],_0x54ce75[_0x31d6('0x41')]);_0x5b4d79['attributes']=_[_0x31d6('0x44')](_0x54ce75[_0x31d6('0x40')],qs[_0x31d6('0x46')](_0x80e5e3[_0x31d6('0x41')][_0x31d6('0x46')]));_0x5b4d79[_0x31d6('0x45')]=_0x5b4d79[_0x31d6('0x45')][_0x31d6('0x47')]?_0x5b4d79[_0x31d6('0x45')]:_0x54ce75[_0x31d6('0x40')];if(_0x80e5e3[_0x31d6('0x41')]['includeAll']){_0x5b4d79[_0x31d6('0x51')]=[{'all':!![]}];}_0x5b4d79=_[_0x31d6('0x4c')]({},_0x5b4d79,_0x80e5e3[_0x31d6('0x4f')]);return db['ChatMessage'][_0x31d6('0x55')](_0x5b4d79)[_0x31d6('0x20')](handleEntityNotFound(_0x49e4b1,null))[_0x31d6('0x20')](respondWithResult(_0x49e4b1,null))[_0x31d6('0x2b')](handleError(_0x49e4b1,null));};exports['create']=function(_0x372367,_0x355e16){return db['ChatMessage'][_0x31d6('0x56')](_0x372367[_0x31d6('0x57')],{})['then'](respondWithResult(_0x355e16,0xc9))[_0x31d6('0x2b')](handleError(_0x355e16,null));};exports[_0x31d6('0x58')]=function(_0x42839c,_0x50feda){if(_0x42839c[_0x31d6('0x57')]['id']){delete _0x42839c['body']['id'];}return db[_0x31d6('0x3c')][_0x31d6('0x55')]({'where':{'id':_0x42839c[_0x31d6('0x54')]['id']}})[_0x31d6('0x20')](handleEntityNotFound(_0x50feda,null))[_0x31d6('0x20')](saveUpdates(_0x42839c[_0x31d6('0x57')],null))[_0x31d6('0x20')](respondWithResult(_0x50feda,null))['catch'](handleError(_0x50feda,null));};exports[_0x31d6('0x37')]=function(_0x4c0670,_0x33975a){return db[_0x31d6('0x3c')][_0x31d6('0x55')]({'where':{'id':_0x4c0670[_0x31d6('0x54')]['id']}})[_0x31d6('0x20')](handleEntityNotFound(_0x33975a,null))[_0x31d6('0x20')](removeEntity(_0x33975a,null))[_0x31d6('0x2b')](handleError(_0x33975a,null));};exports['describe']=function(_0x51836a,_0x4b1691){return db[_0x31d6('0x3c')][_0x31d6('0x59')]()['then'](respondWithResult(_0x4b1691,null))[_0x31d6('0x2b')](handleError(_0x4b1691,null));};var interaction_log=require(_0x31d6('0x5a'))('chat-interactions');exports[_0x31d6('0x5b')]=function(_0x3897bb,_0x11999d,_0x5ec436){var _0x1f0958={'agent':{},'channel':_0x31d6('0x5c')};if(_0x3897bb[_0x31d6('0x57')]['id']){delete _0x3897bb[_0x31d6('0x57')]['id'];}_0x3897bb[_0x31d6('0x57')][_0x31d6('0x5d')]=!![];_0x3897bb[_0x31d6('0x57')][_0x31d6('0x5e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3897bb[_0x31d6('0x57')][_0x31d6('0x5f')]=_0x3897bb['body'][_0x31d6('0x5f')]||_0x3897bb[_0x31d6('0x60')]['id'];_0x1f0958['agent']['id']=_0x3897bb['body'][_0x31d6('0x5f')];return db['ChatMessage'][_0x31d6('0x55')]({'where':{'id':_0x3897bb[_0x31d6('0x54')]['id'],'UserId':null}})[_0x31d6('0x20')](handleEntityNotFound(_0x11999d,null))[_0x31d6('0x20')](saveUpdates(_0x3897bb['body'],null))['then'](function(_0x25d717){if(_0x25d717){_0x1f0958[_0x31d6('0x29')]=_0x25d717['get']({'plain':!![]});return db[_0x31d6('0x61')][_0x31d6('0x55')]({'where':{'id':_0x25d717['ChatInteractionId']}});}return null;})[_0x31d6('0x20')](handleEntityNotFound(_0x11999d,null))['then'](function(_0x540340){if(_0x540340){return _0x540340['update']({'UserId':_0x3897bb[_0x31d6('0x57')][_0x31d6('0x5f')],'read1stAt':_[_0x31d6('0x62')](_0x540340[_0x31d6('0x63')])?moment()[_0x31d6('0x64')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x31d6('0x20')](function(_0x28bc0a){if(_0x28bc0a){_0x1f0958[_0x31d6('0x65')]=_0x28bc0a['get']({'plain':!![]});interaction_log[_0x31d6('0x21')](_0x31d6('0x66'),_0x3897bb[_0x31d6('0x60')]['id'],_0x3897bb['user'][_0x31d6('0x39')],_0x3897bb['user'][_0x31d6('0x67')],_0x1f0958['interaction']['id'],_0x3897bb[_0x31d6('0x57')]?JSON['stringify'](_0x3897bb[_0x31d6('0x57')]):_0x31d6('0x68'));return respondWithRpcPromise('AcceptMessage',_0x31d6('0x69'),_0x1f0958);}return null;})['then'](function(_0x2e8afd){var _0x3a0547=_0x31d6('0x6a')+_0x2e8afd[_0x31d6('0x29')][_0x31d6('0x6b')];return db['sequelize'][_0x31d6('0x41')](_0x3a0547,{'type':db[_0x31d6('0x6c')][_0x31d6('0x6d')][_0x31d6('0x6e')],'raw':!![]})['then'](function(_0xd6239f){return _0xd6239f;});})[_0x31d6('0x20')](function(_0x36ad02){if(_0x36ad02){_0x1f0958[_0x31d6('0x29')][_0x31d6('0x6f')]=_0x36ad02[0x0];if(!_0x3897bb['body']['UserId'])return;return db[_0x31d6('0x70')][_0x31d6('0x55')]({'where':{'id':_0x3897bb[_0x31d6('0x57')][_0x31d6('0x5f')],'role':'agent'},'attributes':['id',_0x31d6('0x39'),_0x31d6('0x71'),_0x31d6('0x72'),_0x31d6('0x73')],'raw':!![]});}return null;})[_0x31d6('0x20')](function(_0x2f579c){if(!_0x2f579c)return null;_0x1f0958['message'][_0x31d6('0x74')]=_0x2f579c;return _0x1f0958;})[_0x31d6('0x20')](function(_0x1a2b7e){if(_0x1a2b7e){if(_0x3897bb[_0x31d6('0x57')][_0x31d6('0x75')]){_0x1f0958['message'][_0x31d6('0x76')]=util[_0x31d6('0x64')](_0x31d6('0x77'),_0x3897bb['user']['name']);_0x1f0958['message'][_0x31d6('0x78')]=_0x1f0958[_0x31d6('0x78')];_0x1f0958[_0x31d6('0x29')][_0x31d6('0x79')]=_0x1f0958[_0x31d6('0x78')];_0x1f0958[_0x31d6('0x29')]['event']=_0x31d6('0x5b');return respondWithRpcPromise(_0x31d6('0x7a'),_0x31d6('0x7a'),{'event':_0x31d6('0x7b'),'message':_[_0x31d6('0x4c')](_0x1f0958['message'],JSON[_0x31d6('0x7c')](_0x1f0958[_0x31d6('0x65')][_0x31d6('0x7d')]))},client9002)[_0x31d6('0x20')](function(){return _0x1f0958;});}return _0x1f0958;}return null;})['then'](respondWithResult(_0x11999d,null))[_0x31d6('0x2b')](handleError(_0x11999d,null));};var interaction_log=require(_0x31d6('0x5a'))(_0x31d6('0x7e'));exports[_0x31d6('0x35')]=function(_0x2b31d6,_0x2f060e,_0xb0067d){var _0x3a7194={'agent':{},'channel':_0x31d6('0x5c')};if(_0x2b31d6['body']['id']){delete _0x2b31d6[_0x31d6('0x57')]['id'];}_0x2b31d6['body'][_0x31d6('0x5f')]=_0x2b31d6['body'][_0x31d6('0x5f')]||_0x2b31d6[_0x31d6('0x60')]['id'];_0x3a7194[_0x31d6('0x74')]['id']=_0x2b31d6[_0x31d6('0x57')][_0x31d6('0x5f')];return db[_0x31d6('0x3c')][_0x31d6('0x55')]({'where':{'id':_0x2b31d6['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2f060e,null))[_0x31d6('0x20')](function(_0x1169e9){if(_0x1169e9){_0x3a7194['message']=_0x1169e9[_0x31d6('0x7f')]({'plain':!![]});return db['ChatInteraction'][_0x31d6('0x55')]({'where':{'id':_0x1169e9['ChatInteractionId']}});}return null;})[_0x31d6('0x20')](handleEntityNotFound(_0x2f060e,null))[_0x31d6('0x20')](function(_0x14dee1){if(_0x14dee1){_0x3a7194['interaction']=_0x14dee1[_0x31d6('0x7f')]({'plain':!![]});interaction_log['info'](_0x31d6('0x80'),_0x2b31d6[_0x31d6('0x60')]['id'],_0x2b31d6['user'][_0x31d6('0x39')],_0x2b31d6['user'][_0x31d6('0x67')],_0x3a7194[_0x31d6('0x65')]['id'],_0x2b31d6[_0x31d6('0x57')]?JSON[_0x31d6('0x26')](_0x2b31d6[_0x31d6('0x57')]):_0x31d6('0x68'));return respondWithRpcPromise(_0x31d6('0x81'),_0x31d6('0x82'),_0x3a7194);}return null;})['then'](function(_0x5479a5){var _0x2a9e0d=_0x31d6('0x6a')+_0x5479a5[_0x31d6('0x29')]['ContactId'];return db['sequelize'][_0x31d6('0x41')](_0x2a9e0d,{'type':db['Sequelize'][_0x31d6('0x6d')][_0x31d6('0x6e')],'raw':!![]})[_0x31d6('0x20')](function(_0x204df9){return _0x204df9;});})['then'](function(_0x410fd7){if(_0x410fd7){_0x3a7194[_0x31d6('0x29')]['contact']=_0x410fd7[0x0];if(!_0x2b31d6[_0x31d6('0x57')][_0x31d6('0x5f')])return;return db[_0x31d6('0x70')][_0x31d6('0x55')]({'where':{'id':_0x2b31d6[_0x31d6('0x57')]['UserId'],'role':_0x31d6('0x74')},'attributes':['id','name',_0x31d6('0x71'),_0x31d6('0x72'),_0x31d6('0x73')],'raw':!![]});}return null;})[_0x31d6('0x20')](function(_0xae64a0){if(!_0xae64a0)return null;_0x3a7194[_0x31d6('0x29')][_0x31d6('0x74')]=_0xae64a0;return _0x3a7194;})[_0x31d6('0x20')](function(_0x47b879){if(_0x47b879){_0x47b879['message'][_0x31d6('0x76')]=util[_0x31d6('0x64')](_0x31d6('0x77'),_0x2b31d6['user']['name']);_0x47b879[_0x31d6('0x29')][_0x31d6('0x78')]=_0x3a7194[_0x31d6('0x78')];_0x47b879[_0x31d6('0x29')][_0x31d6('0x79')]=_0x3a7194['channel'];_0x47b879[_0x31d6('0x29')]['event']=_0x31d6('0x35');respondWithRpcPromise(_0x31d6('0x7a'),_0x31d6('0x7a'),{'event':_0x31d6('0x83'),'message':_['merge'](_0x3a7194[_0x31d6('0x29')],JSON[_0x31d6('0x7c')](_0x3a7194['interaction'][_0x31d6('0x7d')]))},client9002);return _0x3a7194;}return null;})[_0x31d6('0x20')](respondWithResult(_0x2f060e,null))[_0x31d6('0x2b')](handleError(_0x2f060e,null));};
\ No newline at end of file
index 4354499..8526ec2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55bf=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0x5c5d53,_0x4427c3){var _0xb3a9e=function(_0x4f5050){while(--_0x4f5050){_0x5c5d53['push'](_0x5c5d53['shift']());}};_0xb3a9e(++_0x4427c3);}(_0x55bf,0x69));var _0xf55b=function(_0x520da5,_0x30025e){_0x520da5=_0x520da5-0x0;var _0x55425b=_0x55bf[_0x520da5];return _0x55425b;};'use strict';var EventEmitter=require(_0xf55b('0x0'));var ChatMessage=require(_0xf55b('0x1'))['db'][_0xf55b('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xf55b('0x3')](0x0);var events={'afterCreate':_0xf55b('0x4'),'afterUpdate':_0xf55b('0x5'),'afterDestroy':_0xf55b('0x6')};function emitEvent(_0x136681){return function(_0x81c0e9,_0x5c52b4,_0x1640b1){ChatMessageEvents[_0xf55b('0x7')](_0x136681+':'+_0x81c0e9['id'],_0x81c0e9);ChatMessageEvents[_0xf55b('0x7')](_0x136681,_0x81c0e9);_0x1640b1(null);};}for(var e in events){if(events[_0xf55b('0x8')](e)){var event=events[e];ChatMessage[_0xf55b('0x9')](e,emitEvent(event));}}module[_0xf55b('0xa')]=ChatMessageEvents;
\ No newline at end of file
+var _0x8bbc=['save','remove','emit','hook','exports','events','ChatMessage'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x8bbc,0xfa));var _0xc8bb=function(_0x51e79c,_0x51485e){_0x51e79c=_0x51e79c-0x0;var _0x2467be=_0x8bbc[_0x51e79c];return _0x2467be;};'use strict';var EventEmitter=require(_0xc8bb('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xc8bb('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc8bb('0x2'),'afterUpdate':'update','afterDestroy':_0xc8bb('0x3')};function emitEvent(_0x165a58){return function(_0x5f5b73,_0x5ca8e2,_0x2adb0d){ChatMessageEvents[_0xc8bb('0x4')](_0x165a58+':'+_0x5f5b73['id'],_0x5f5b73);ChatMessageEvents[_0xc8bb('0x4')](_0x165a58,_0x5f5b73);_0x2adb0d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xc8bb('0x5')](e,emitEvent(event));}}module[_0xc8bb('0x6')]=ChatMessageEvents;
\ No newline at end of file
index 46d2998..da35628 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f11=['update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','ChatInteraction'];(function(_0x2431dd,_0x5eff9e){var _0x7ac975=function(_0x17329e){while(--_0x17329e){_0x2431dd['push'](_0x2431dd['shift']());}};_0x7ac975(++_0x5eff9e);}(_0x3f11,0x1a5));var _0x13f1=function(_0x127565,_0x4cf4c7){_0x127565=_0x127565-0x0;var _0x35090e=_0x3f11[_0x127565];return _0x35090e;};'use strict';var _=require(_0x13f1('0x0'));var util=require(_0x13f1('0x1'));var logger=require('../../config/logger')(_0x13f1('0x2'));var moment=require(_0x13f1('0x3'));var BPromise=require(_0x13f1('0x4'));var rp=require(_0x13f1('0x5'));var fs=require('fs');var path=require(_0x13f1('0x6'));var rimraf=require(_0x13f1('0x7'));var config=require('../../config/environment');var attributes=require(_0x13f1('0x8'));module[_0x13f1('0x9')]=function(_0x4e71e3,_0x56aa7b){return _0x4e71e3[_0x13f1('0xa')](_0x13f1('0xb'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x13f1('0xc'),'fields':[_0x13f1('0xd')],'type':_0x13f1('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1d30e9,_0x31c409,_0x146882){var _0x47ffeb=_0x4e71e3[_0x13f1('0xf')];var _0x17cf36=_0x1d30e9['get']({'plain':!![]});if(_0x17cf36[_0x13f1('0x10')]['toLowerCase']()==='in'||_0x17cf36[_0x13f1('0x10')][_0x13f1('0x11')]()===_0x13f1('0x12')&&!_0x17cf36[_0x13f1('0x13')]&&!_['isNil'](_0x17cf36['UserId'])){_0x47ffeb[_0x13f1('0x14')]['findOne']({'where':{'id':_0x17cf36['ChatInteractionId']}})['then'](function(_0x457e8c){if(_0x457e8c){_0x457e8c[_0x13f1('0x15')]({'lastMsgAt':_0x17cf36[_0x13f1('0x16')],'lastMsgDirection':_0x17cf36[_0x13f1('0x10')][_0x13f1('0x11')]()});}})['catch'](function(_0x2f8d74){console[_0x13f1('0x17')](_0x2f8d74);});}_0x146882();}},'charset':_0x13f1('0x18'),'collate':_0x13f1('0x19')});};
\ No newline at end of file
+var _0x74fb=['moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','body','models','direction','toLowerCase','out','secret','findOne','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x56d956,_0x541848){var _0x671840=function(_0x3767a8){while(--_0x3767a8){_0x56d956['push'](_0x56d956['shift']());}};_0x671840(++_0x541848);}(_0x74fb,0x111));var _0xb74f=function(_0x204981,_0x3a678e){_0x204981=_0x204981-0x0;var _0x1876c1=_0x74fb[_0x204981];return _0x1876c1;};'use strict';var _=require(_0xb74f('0x0'));var util=require(_0xb74f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb74f('0x2'));var BPromise=require(_0xb74f('0x3'));var rp=require(_0xb74f('0x4'));var fs=require('fs');var path=require(_0xb74f('0x5'));var rimraf=require('rimraf');var config=require(_0xb74f('0x6'));var attributes=require(_0xb74f('0x7'));module[_0xb74f('0x8')]=function(_0x366055,_0x1639bf){return _0x366055[_0xb74f('0x9')](_0xb74f('0xa'),attributes,{'tableName':_0xb74f('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xb74f('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4630b4,_0x52894a,_0x30fbe8){var _0x5c2ade=_0x366055[_0xb74f('0xd')];var _0xdd448f=_0x4630b4['get']({'plain':!![]});if(_0xdd448f[_0xb74f('0xe')][_0xb74f('0xf')]()==='in'||_0xdd448f['direction']['toLowerCase']()===_0xb74f('0x10')&&!_0xdd448f[_0xb74f('0x11')]&&!_['isNil'](_0xdd448f['UserId'])){_0x5c2ade['ChatInteraction'][_0xb74f('0x12')]({'where':{'id':_0xdd448f['ChatInteractionId']}})[_0xb74f('0x13')](function(_0x47e004){if(_0x47e004){_0x47e004['update']({'lastMsgAt':_0xdd448f[_0xb74f('0x14')],'lastMsgDirection':_0xdd448f['direction'][_0xb74f('0xf')]()});}})[_0xb74f('0x15')](function(_0x3ca742){console[_0xb74f('0x16')](_0x3ca742);});}_0x30fbe8();}},'charset':_0xb74f('0x17'),'collate':_0xb74f('0x18')});};
\ No newline at end of file
index 30ec3a0..2bf5ff2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf781=['result','body','then','info','CreateChatMessage','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0xd601cd,_0xa60b07){var _0x5664a3=function(_0x3f5247){while(--_0x3f5247){_0xd601cd['push'](_0xd601cd['shift']());}};_0x5664a3(++_0xa60b07);}(_0xf781,0xd2));var _0x1f78=function(_0x225d29,_0x1d34ff){_0x225d29=_0x225d29-0x0;var _0x6ec715=_0xf781[_0x225d29];return _0x6ec715;};'use strict';var _=require(_0x1f78('0x0'));var util=require('util');var moment=require(_0x1f78('0x1'));var BPromise=require(_0x1f78('0x2'));var rs=require(_0x1f78('0x3'));var fs=require('fs');var Redis=require(_0x1f78('0x4'));var db=require(_0x1f78('0x5'))['db'];var utils=require(_0x1f78('0x6'));var logger=require(_0x1f78('0x7'))(_0x1f78('0x8'));var config=require(_0x1f78('0x9'));var jayson=require(_0x1f78('0xa'));var client=jayson[_0x1f78('0xb')][_0x1f78('0xc')]({'port':0x232a});config[_0x1f78('0xd')]=_[_0x1f78('0xe')](config[_0x1f78('0xd')],{'host':_0x1f78('0xf'),'port':0x18eb});var socket=require(_0x1f78('0x10'))(new Redis(config[_0x1f78('0xd')]));require(_0x1f78('0x11'))[_0x1f78('0x12')](socket);function respondWithRpcPromise(_0x16213b,_0x297a6e,_0x509aa1){return new BPromise(function(_0x30346b,_0xa8213c){return client[_0x1f78('0x13')](_0x16213b,_0x509aa1)['then'](function(_0x1b5781){logger['info'](_0x1f78('0x14'),_0x297a6e,'request\x20sent');logger[_0x1f78('0x15')](_0x1f78('0x16'),_0x297a6e,_0x1f78('0x17'),JSON[_0x1f78('0x18')](_0x1b5781));if(_0x1b5781[_0x1f78('0x19')]){if(_0x1b5781[_0x1f78('0x19')][_0x1f78('0x1a')]===0x1f4){logger[_0x1f78('0x19')](_0x1f78('0x14'),_0x297a6e,_0x1b5781['error']['message']);return _0xa8213c(_0x1b5781[_0x1f78('0x19')][_0x1f78('0x1b')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x297a6e,_0x1b5781[_0x1f78('0x19')]['message']);return _0x30346b(_0x1b5781[_0x1f78('0x19')][_0x1f78('0x1b')]);}else{logger['info'](_0x1f78('0x14'),_0x297a6e,'request\x20sent');_0x30346b(_0x1b5781[_0x1f78('0x1c')][_0x1f78('0x1b')]);}})['catch'](function(_0xc93a53){logger['error'](_0x1f78('0x14'),_0x297a6e,_0xc93a53);_0xa8213c(_0xc93a53);});});}exports['CreateChatMessage']=function(_0x245d03){var _0x5c686d=this;return new Promise(function(_0x3677e5,_0x2af3cd){return db['ChatMessage']['create'](_0x245d03[_0x1f78('0x1d')],{'raw':_0x245d03['options']?_0x245d03['options']['raw']===undefined?!![]:![]:!![]})[_0x1f78('0x1e')](function(_0x5121b5){logger[_0x1f78('0x1f')](_0x1f78('0x20'),_0x245d03);logger[_0x1f78('0x15')]('CreateChatMessage',_0x245d03,JSON['stringify'](_0x5121b5));_0x3677e5(_0x5121b5);})[_0x1f78('0x21')](function(_0x4b6f54){logger[_0x1f78('0x19')]('CreateChatMessage',_0x4b6f54[_0x1f78('0x1b')],_0x245d03);_0x2af3cd(_0x5c686d[_0x1f78('0x19')](0x1f4,_0x4b6f54[_0x1f78('0x1b')]));});});};
\ No newline at end of file
+var _0x98f7=['error','code','message','result','catch','create','body','raw','then','info','CreateChatMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./chatMessage.socket','register','request','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x275f4a,_0x2077d4){var _0x4b4a21=function(_0x391bab){while(--_0x391bab){_0x275f4a['push'](_0x275f4a['shift']());}};_0x4b4a21(++_0x2077d4);}(_0x98f7,0xcb));var _0x798f=function(_0x363e2d,_0x162f16){_0x363e2d=_0x363e2d-0x0;var _0x58f34f=_0x98f7[_0x363e2d];return _0x58f34f;};'use strict';var _=require(_0x798f('0x0'));var util=require('util');var moment=require(_0x798f('0x1'));var BPromise=require('bluebird');var rs=require(_0x798f('0x2'));var fs=require('fs');var Redis=require(_0x798f('0x3'));var db=require(_0x798f('0x4'))['db'];var utils=require(_0x798f('0x5'));var logger=require(_0x798f('0x6'))(_0x798f('0x7'));var config=require(_0x798f('0x8'));var jayson=require(_0x798f('0x9'));var client=jayson['client'][_0x798f('0xa')]({'port':0x232a});config['redis']=_[_0x798f('0xb')](config[_0x798f('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x798f('0xd'))(new Redis(config[_0x798f('0xc')]));require(_0x798f('0xe'))[_0x798f('0xf')](socket);function respondWithRpcPromise(_0x32dfd7,_0x48fbe7,_0x598e49){return new BPromise(function(_0x1e6845,_0x3cedb3){return client[_0x798f('0x10')](_0x32dfd7,_0x598e49)['then'](function(_0x55a1b3){logger['info'](_0x798f('0x11'),_0x48fbe7,_0x798f('0x12'));logger[_0x798f('0x13')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x48fbe7,_0x798f('0x12'),JSON[_0x798f('0x14')](_0x55a1b3));if(_0x55a1b3[_0x798f('0x15')]){if(_0x55a1b3[_0x798f('0x15')][_0x798f('0x16')]===0x1f4){logger[_0x798f('0x15')]('ChatMessage,\x20%s,\x20%s',_0x48fbe7,_0x55a1b3[_0x798f('0x15')]['message']);return _0x3cedb3(_0x55a1b3['error'][_0x798f('0x17')]);}logger[_0x798f('0x15')](_0x798f('0x11'),_0x48fbe7,_0x55a1b3['error']['message']);return _0x1e6845(_0x55a1b3[_0x798f('0x15')]['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x48fbe7,_0x798f('0x12'));_0x1e6845(_0x55a1b3[_0x798f('0x18')][_0x798f('0x17')]);}})[_0x798f('0x19')](function(_0x5169c1){logger[_0x798f('0x15')](_0x798f('0x11'),_0x48fbe7,_0x5169c1);_0x3cedb3(_0x5169c1);});});}exports['CreateChatMessage']=function(_0x223e67){var _0x5ddcac=this;return new Promise(function(_0x4f233f,_0x251483){return db['ChatMessage'][_0x798f('0x1a')](_0x223e67[_0x798f('0x1b')],{'raw':_0x223e67['options']?_0x223e67['options'][_0x798f('0x1c')]===undefined?!![]:![]:!![]})[_0x798f('0x1d')](function(_0x5ec886){logger[_0x798f('0x1e')](_0x798f('0x1f'),_0x223e67);logger[_0x798f('0x13')](_0x798f('0x1f'),_0x223e67,JSON['stringify'](_0x5ec886));_0x4f233f(_0x5ec886);})[_0x798f('0x19')](function(_0x431dc0){logger[_0x798f('0x15')]('CreateChatMessage',_0x431dc0[_0x798f('0x17')],_0x223e67);_0x251483(_0x5ddcac[_0x798f('0x15')](0x1f4,_0x431dc0[_0x798f('0x17')]));});});};
\ No newline at end of file
index 555ea00..8688d2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb647=['register','length','chatMessage:','./chatMessage.events','save','remove','update','emit'];(function(_0x29d439,_0x1ed945){var _0x25b480=function(_0x43423e){while(--_0x43423e){_0x29d439['push'](_0x29d439['shift']());}};_0x25b480(++_0x1ed945);}(_0xb647,0xdb));var _0x7b64=function(_0x2a4b06,_0x41bf9b){_0x2a4b06=_0x2a4b06-0x0;var _0x4b76c3=_0xb647[_0x2a4b06];return _0x4b76c3;};'use strict';var ChatMessageEvents=require(_0x7b64('0x0'));var events=[_0x7b64('0x1'),_0x7b64('0x2'),_0x7b64('0x3')];function createListener(_0x38de52,_0x3b659e){return function(_0x274824){_0x3b659e[_0x7b64('0x4')](_0x38de52,_0x274824);};}function removeListener(_0x54eee8,_0x36ff12){return function(){ChatMessageEvents['removeListener'](_0x54eee8,_0x36ff12);};}exports[_0x7b64('0x5')]=function(_0x38ebf7){for(var _0x31915b=0x0,_0x80721a=events[_0x7b64('0x6')];_0x31915b<_0x80721a;_0x31915b++){var _0x22eca3=events[_0x31915b];var _0x727684=createListener(_0x7b64('0x7')+_0x22eca3,_0x38ebf7);ChatMessageEvents['on'](_0x22eca3,_0x727684);}};
\ No newline at end of file
+var _0xfb65=['emit','removeListener','register','length','save','remove'];(function(_0x9b5bb2,_0x5db315){var _0x2e1e92=function(_0x5621c9){while(--_0x5621c9){_0x9b5bb2['push'](_0x9b5bb2['shift']());}};_0x2e1e92(++_0x5db315);}(_0xfb65,0x82));var _0x5fb6=function(_0x58459e,_0x3f7d79){_0x58459e=_0x58459e-0x0;var _0x4b5be2=_0xfb65[_0x58459e];return _0x4b5be2;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x5fb6('0x0'),_0x5fb6('0x1'),'update'];function createListener(_0x860687,_0x54af6d){return function(_0x194bac){_0x54af6d[_0x5fb6('0x2')](_0x860687,_0x194bac);};}function removeListener(_0xca6345,_0xb5f7c4){return function(){ChatMessageEvents[_0x5fb6('0x3')](_0xca6345,_0xb5f7c4);};}exports[_0x5fb6('0x4')]=function(_0x4dec8f){for(var _0x50782b=0x0,_0x238914=events[_0x5fb6('0x5')];_0x50782b<_0x238914;_0x50782b++){var _0x1f99b8=events[_0x50782b];var _0x840390=createListener('chatMessage:'+_0x1f99b8,_0x4dec8f);ChatMessageEvents['on'](_0x1f99b8,_0x840390);}};
\ No newline at end of file
index b238ef4..3ce9cba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e57=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','describe','/:id','isAuthenticated','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path'];(function(_0x2fde11,_0x3a54a5){var _0x3c023f=function(_0x2efe52){while(--_0x2efe52){_0x2fde11['push'](_0x2fde11['shift']());}};_0x3c023f(++_0x3a54a5);}(_0x4e57,0x1e3));var _0x74e5=function(_0x498481,_0x3fc2cf){_0x498481=_0x498481-0x0;var _0x6cd424=_0x4e57[_0x498481];return _0x6cd424;};'use strict';var multer=require(_0x74e5('0x0'));var util=require(_0x74e5('0x1'));var path=require(_0x74e5('0x2'));var timeout=require('connect-timeout');var express=require(_0x74e5('0x3'));var router=express[_0x74e5('0x4')]();var fs_extra=require(_0x74e5('0x5'));var auth=require(_0x74e5('0x6'));var interaction=require(_0x74e5('0x7'));var config=require(_0x74e5('0x8'));var controller=require(_0x74e5('0x9'));router[_0x74e5('0xa')]('/',auth['isAuthenticated'](),controller[_0x74e5('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x74e5('0xc')]);router[_0x74e5('0xa')](_0x74e5('0xd'),auth[_0x74e5('0xe')](),controller['show']);router['post']('/',auth[_0x74e5('0xe')](),interaction[_0x74e5('0xf')](_0x74e5('0x10'),_0x74e5('0x11')),controller[_0x74e5('0x12')]);router[_0x74e5('0x13')](_0x74e5('0xd'),controller[_0x74e5('0x14')]);router[_0x74e5('0x13')](_0x74e5('0x15'),auth[_0x74e5('0xe')](),controller[_0x74e5('0x16')]);router['put'](_0x74e5('0x17'),auth[_0x74e5('0xe')](),controller[_0x74e5('0x18')]);router[_0x74e5('0x19')](_0x74e5('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x74e5('0x1a')]=router;
\ No newline at end of file
+var _0x2aaf=['/:id/accept','accept','/:id/reject','delete','destroy','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/:id','tracked','chat','chatmessage:create','create','put','update'];(function(_0x11f91c,_0x1b6301){var _0x3cc054=function(_0x4d7e79){while(--_0x4d7e79){_0x11f91c['push'](_0x11f91c['shift']());}};_0x3cc054(++_0x1b6301);}(_0x2aaf,0x130));var _0xf2aa=function(_0x4a1c27,_0x46a040){_0x4a1c27=_0x4a1c27-0x0;var _0x564029=_0x2aaf[_0x4a1c27];return _0x564029;};'use strict';var multer=require(_0xf2aa('0x0'));var util=require(_0xf2aa('0x1'));var path=require('path');var timeout=require(_0xf2aa('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf2aa('0x3'));var auth=require(_0xf2aa('0x4'));var interaction=require(_0xf2aa('0x5'));var config=require(_0xf2aa('0x6'));var controller=require(_0xf2aa('0x7'));router[_0xf2aa('0x8')]('/',auth[_0xf2aa('0x9')](),controller[_0xf2aa('0xa')]);router[_0xf2aa('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xf2aa('0xb'),auth[_0xf2aa('0x9')](),controller['show']);router['post']('/',auth[_0xf2aa('0x9')](),interaction[_0xf2aa('0xc')](_0xf2aa('0xd'),_0xf2aa('0xe')),controller[_0xf2aa('0xf')]);router[_0xf2aa('0x10')]('/:id',controller[_0xf2aa('0x11')]);router['put'](_0xf2aa('0x12'),auth['isAuthenticated'](),controller[_0xf2aa('0x13')]);router[_0xf2aa('0x10')](_0xf2aa('0x14'),auth['isAuthenticated'](),controller['reject']);router[_0xf2aa('0x15')](_0xf2aa('0xb'),auth[_0xf2aa('0x9')](),controller[_0xf2aa('0x16')]);module['exports']=router;
\ No newline at end of file
index 3217d6e..3173df4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x0b0e,0x187));var _0xe0b0=function(_0x133296,_0xe8ff9a){_0x133296=_0x133296-0x0;var _0x193517=_0x0b0e[_0x133296];return _0x193517;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x1a6789,_0x1b0600){var _0xbcfafa=function(_0x31d29d){while(--_0x31d29d){_0x1a6789['push'](_0x1a6789['shift']());}};_0xbcfafa(++_0x1b0600);}(_0x5f2f,0x73));var _0xf5f2=function(_0x28158f,_0x51146d){_0x28158f=_0x28158f-0x0;var _0x274ae4=_0x5f2f[_0x28158f];return _0x274ae4;};'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
index 2a6bbed..3e11c0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0x7a54,0x106));var _0x47a5=function(_0x2961de,_0x25d3d1){_0x2961de=_0x2961de-0x0;var _0x5e05f8=_0x7a54[_0x2961de];return _0x5e05f8;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x7a54,0x106));var _0x47a5=function(_0x2d89dc,_0x7e32fe){_0x2d89dc=_0x2d89dc-0x0;var _0x4e50c3=_0x7a54[_0x2d89dc];return _0x4e50c3;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
index 22dd678..b7e10da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd906=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage'];(function(_0x19bc2b,_0x1fac70){var _0x4a0f75=function(_0x204000){while(--_0x204000){_0x19bc2b['push'](_0x19bc2b['shift']());}};_0x4a0f75(++_0x1fac70);}(_0xd906,0x197));var _0x6d90=function(_0x394d98,_0x40c4dc){_0x394d98=_0x394d98-0x0;var _0x377709=_0xd906[_0x394d98];return _0x377709;};'use strict';var EventEmitter=require(_0x6d90('0x0'));var ChatOfflineMessage=require(_0x6d90('0x1'))['db'][_0x6d90('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x6d90('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6d90('0x4'),'afterDestroy':_0x6d90('0x5')};function emitEvent(_0x4d6081){return function(_0x4f7015,_0x2d1d56,_0x73af2a){ChatOfflineMessageEvents[_0x6d90('0x6')](_0x4d6081+':'+_0x4f7015['id'],_0x4f7015);ChatOfflineMessageEvents[_0x6d90('0x6')](_0x4d6081,_0x4f7015);_0x73af2a(null);};}for(var e in events){if(events[_0x6d90('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x6d90('0x8')](e,emitEvent(event));}}module[_0x6d90('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x1f89=['hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x533879,_0x184a56){var _0x583f88=function(_0x5dfc82){while(--_0x5dfc82){_0x533879['push'](_0x533879['shift']());}};_0x583f88(++_0x184a56);}(_0x1f89,0x14c));var _0x91f8=function(_0x38022a,_0x54b1dc){_0x38022a=_0x38022a-0x0;var _0x1b0d93=_0x1f89[_0x38022a];return _0x1b0d93;};'use strict';var EventEmitter=require(_0x91f8('0x0'));var ChatOfflineMessage=require(_0x91f8('0x1'))['db'][_0x91f8('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x91f8('0x3')](0x0);var events={'afterCreate':_0x91f8('0x4'),'afterUpdate':_0x91f8('0x5'),'afterDestroy':'remove'};function emitEvent(_0x408f1e){return function(_0x52b2d1,_0x2d1ffb,_0x171382){ChatOfflineMessageEvents[_0x91f8('0x6')](_0x408f1e+':'+_0x52b2d1['id'],_0x52b2d1);ChatOfflineMessageEvents['emit'](_0x408f1e,_0x52b2d1);_0x171382(null);};}for(var e in events){if(events[_0x91f8('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x91f8('0x8')](e,emitEvent(event));}}module[_0x91f8('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
index c2b7052..b342359 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9b7=['./chatOfflineMessage.attributes','exports','define'];(function(_0x570408,_0x47dfc0){var _0x1990bf=function(_0x4dc2c2){while(--_0x4dc2c2){_0x570408['push'](_0x570408['shift']());}};_0x1990bf(++_0x47dfc0);}(_0xa9b7,0x13e));var _0x7a9b=function(_0xc908d4,_0xf98162){_0xc908d4=_0xc908d4-0x0;var _0x330143=_0xa9b7[_0xc908d4];return _0x330143;};'use strict';var attributes=require(_0x7a9b('0x0'));module[_0x7a9b('0x1')]=function(_0x2dfa99){return _0x2dfa99[_0x7a9b('0x2')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x6e61=['define','ChatOfflineMessage','chat_offline_messages','./chatOfflineMessage.attributes','exports'];(function(_0x545b71,_0x4f44eb){var _0x26e587=function(_0x293b81){while(--_0x293b81){_0x545b71['push'](_0x545b71['shift']());}};_0x26e587(++_0x4f44eb);}(_0x6e61,0xe4));var _0x16e6=function(_0x43828c,_0x119bd2){_0x43828c=_0x43828c-0x0;var _0x5d0d46=_0x6e61[_0x43828c];return _0x5d0d46;};'use strict';var attributes=require(_0x16e6('0x0'));module[_0x16e6('0x1')]=function(_0x48f388){return _0x48f388[_0x16e6('0x2')](_0x16e6('0x3'),attributes,{'tableName':_0x16e6('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 3efdb15..1c894d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedc2=['info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then'];(function(_0x4f3882,_0x5127a0){var _0x567c35=function(_0x3515d0){while(--_0x3515d0){_0x4f3882['push'](_0x4f3882['shift']());}};_0x567c35(++_0x5127a0);}(_0xedc2,0x183));var _0x2edc=function(_0xe56e0a,_0x51667b){_0xe56e0a=_0xe56e0a-0x0;var _0x2f8b29=_0xedc2[_0xe56e0a];return _0x2f8b29;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2edc('0x0'));var fs=require('fs');var Redis=require(_0x2edc('0x1'));var db=require(_0x2edc('0x2'))['db'];var utils=require(_0x2edc('0x3'));var logger=require(_0x2edc('0x4'))(_0x2edc('0x5'));var config=require(_0x2edc('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2b08af,_0x476e2f,_0x400875){return new BPromise(function(_0x4712ee,_0x2a13cd){return client[_0x2edc('0x7')](_0x2b08af,_0x400875)[_0x2edc('0x8')](function(_0x3305ef){logger[_0x2edc('0x9')](_0x2edc('0xa'),_0x476e2f,_0x2edc('0xb'));logger[_0x2edc('0xc')](_0x2edc('0xd'),_0x476e2f,_0x2edc('0xb'),JSON[_0x2edc('0xe')](_0x3305ef));if(_0x3305ef[_0x2edc('0xf')]){if(_0x3305ef[_0x2edc('0xf')]['code']===0x1f4){logger[_0x2edc('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x476e2f,_0x3305ef[_0x2edc('0xf')]['message']);return _0x2a13cd(_0x3305ef['error'][_0x2edc('0x10')]);}logger[_0x2edc('0xf')](_0x2edc('0xa'),_0x476e2f,_0x3305ef['error'][_0x2edc('0x10')]);return _0x4712ee(_0x3305ef['error'][_0x2edc('0x10')]);}else{logger[_0x2edc('0x9')](_0x2edc('0xa'),_0x476e2f,_0x2edc('0xb'));_0x4712ee(_0x3305ef[_0x2edc('0x11')][_0x2edc('0x10')]);}})['catch'](function(_0x5a6e60){logger[_0x2edc('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x476e2f,_0x5a6e60);_0x2a13cd(_0x5a6e60);});});}
\ No newline at end of file
+var _0xd088=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd088,0x160));var _0x8d08=function(_0x8d1557,_0x5b0561){_0x8d1557=_0x8d1557-0x0;var _0x13dd86=_0xd088[_0x8d1557];return _0x13dd86;};'use strict';var _=require(_0x8d08('0x0'));var util=require(_0x8d08('0x1'));var moment=require(_0x8d08('0x2'));var BPromise=require(_0x8d08('0x3'));var rs=require(_0x8d08('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8d08('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8d08('0x6'))('rpc');var config=require(_0x8d08('0x7'));var jayson=require(_0x8d08('0x8'));var client=jayson[_0x8d08('0x9')][_0x8d08('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48d58b,_0x3accbb,_0x1cf2d2){return new BPromise(function(_0x53a6ae,_0x4ed00c){return client[_0x8d08('0xb')](_0x48d58b,_0x1cf2d2)[_0x8d08('0xc')](function(_0x1ff34f){logger['info'](_0x8d08('0xd'),_0x3accbb,_0x8d08('0xe'));logger['debug'](_0x8d08('0xf'),_0x3accbb,_0x8d08('0xe'),JSON['stringify'](_0x1ff34f));if(_0x1ff34f[_0x8d08('0x10')]){if(_0x1ff34f['error'][_0x8d08('0x11')]===0x1f4){logger[_0x8d08('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3accbb,_0x1ff34f['error']['message']);return _0x4ed00c(_0x1ff34f[_0x8d08('0x10')][_0x8d08('0x12')]);}logger[_0x8d08('0x10')](_0x8d08('0xd'),_0x3accbb,_0x1ff34f[_0x8d08('0x10')][_0x8d08('0x12')]);return _0x53a6ae(_0x1ff34f[_0x8d08('0x10')][_0x8d08('0x12')]);}else{logger[_0x8d08('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3accbb,_0x8d08('0xe'));_0x53a6ae(_0x1ff34f['result'][_0x8d08('0x12')]);}})[_0x8d08('0x14')](function(_0xf4b3be){logger[_0x8d08('0x10')](_0x8d08('0xd'),_0x3accbb,_0xf4b3be);_0x4ed00c(_0xf4b3be);});});}
\ No newline at end of file
index 36cff39..4f9688a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36dd=['../../config/environment','./chatOfflineMessage.controller','isAuthenticated','get','/describe','describe','/:id','show','create','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x590851,_0x496bee){var _0x3b0115=function(_0x5140cc){while(--_0x5140cc){_0x590851['push'](_0x590851['shift']());}};_0x3b0115(++_0x496bee);}(_0x36dd,0xca));var _0xd36d=function(_0x47a40b,_0x443ecf){_0x47a40b=_0x47a40b-0x0;var _0x19610c=_0x36dd[_0x47a40b];return _0x19610c;};'use strict';var multer=require(_0xd36d('0x0'));var util=require(_0xd36d('0x1'));var path=require('path');var timeout=require(_0xd36d('0x2'));var express=require(_0xd36d('0x3'));var router=express[_0xd36d('0x4')]();var fs_extra=require(_0xd36d('0x5'));var auth=require(_0xd36d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd36d('0x7'));var controller=require(_0xd36d('0x8'));router['get']('/',auth[_0xd36d('0x9')](),controller['index']);router[_0xd36d('0xa')](_0xd36d('0xb'),auth[_0xd36d('0x9')](),controller[_0xd36d('0xc')]);router[_0xd36d('0xa')](_0xd36d('0xd'),auth[_0xd36d('0x9')](),controller[_0xd36d('0xe')]);router['post']('/',auth[_0xd36d('0x9')](),controller[_0xd36d('0xf')]);router[_0xd36d('0x10')](_0xd36d('0xd'),auth[_0xd36d('0x9')](),controller[_0xd36d('0x11')]);router[_0xd36d('0x12')](_0xd36d('0xd'),auth[_0xd36d('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x8835=['describe','isAuthenticated','show','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe'];(function(_0x4b99dc,_0x33d412){var _0xe3b7b8=function(_0x55109f){while(--_0x55109f){_0x4b99dc['push'](_0x4b99dc['shift']());}};_0xe3b7b8(++_0x33d412);}(_0x8835,0xdb));var _0x5883=function(_0x45eb26,_0xc0cb2c){_0x45eb26=_0x45eb26-0x0;var _0xf27984=_0x8835[_0x45eb26];return _0xf27984;};'use strict';var multer=require('multer');var util=require(_0x5883('0x0'));var path=require(_0x5883('0x1'));var timeout=require(_0x5883('0x2'));var express=require(_0x5883('0x3'));var router=express[_0x5883('0x4')]();var fs_extra=require(_0x5883('0x5'));var auth=require(_0x5883('0x6'));var interaction=require(_0x5883('0x7'));var config=require(_0x5883('0x8'));var controller=require('./chatOfflineMessage.controller');router[_0x5883('0x9')]('/',auth['isAuthenticated'](),controller[_0x5883('0xa')]);router['get'](_0x5883('0xb'),auth['isAuthenticated'](),controller[_0x5883('0xc')]);router[_0x5883('0x9')]('/:id',auth[_0x5883('0xd')](),controller[_0x5883('0xe')]);router['post']('/',auth[_0x5883('0xd')](),controller['create']);router[_0x5883('0xf')](_0x5883('0x10'),auth['isAuthenticated'](),controller[_0x5883('0x11')]);router[_0x5883('0x12')](_0x5883('0x10'),auth[_0x5883('0xd')](),controller[_0x5883('0x13')]);module[_0x5883('0x14')]=router;
\ No newline at end of file
index bad5141..3e758fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f28=['INTEGER','sequelize','exports','STRING','ENUM','timeout','mouseOver'];(function(_0x36f243,_0x188505){var _0x426436=function(_0x1c8622){while(--_0x1c8622){_0x36f243['push'](_0x36f243['shift']());}};_0x426436(++_0x188505);}(_0x5f28,0x1b3));var _0x85f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f28[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x85f2('0x0'));module[_0x85f2('0x1')]={'name':{'type':Sequelize[_0x85f2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x85f2('0x3')]('mouseOver',_0x85f2('0x4')),'defaultValue':_0x85f2('0x5')},'selector':{'type':Sequelize[_0x85f2('0x2')]},'timeout':{'type':Sequelize[_0x85f2('0x6')]}};
\ No newline at end of file
+var _0x649a=['sequelize','exports','STRING','mouseOver','timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x649a,0x19a));var _0xa649=function(_0x3e8bf8,_0x4e76d6){_0x3e8bf8=_0x3e8bf8-0x0;var _0x3391ce=_0x649a[_0x3e8bf8];return _0x3391ce;};'use strict';var Sequelize=require(_0xa649('0x0'));module[_0xa649('0x1')]={'name':{'type':Sequelize[_0xa649('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xa649('0x3'),_0xa649('0x4')),'defaultValue':_0xa649('0x3')},'selector':{'type':Sequelize[_0xa649('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index bb4b6ea..9c5f9b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e11=['body','find','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','stack','send','params','keys','rawAttributes','query','attributes','model','fields','length','merge','catch','create','ChatProactiveAction'];(function(_0x4613d5,_0x50cdfd){var _0x18a5b8=function(_0x26bb02){while(--_0x26bb02){_0x4613d5['push'](_0x4613d5['shift']());}};_0x18a5b8(++_0x50cdfd);}(_0x5e11,0x1c3));var _0x15e1=function(_0x16a223,_0x31b6e8){_0x16a223=_0x16a223-0x0;var _0x5ded66=_0x5e11[_0x16a223];return _0x5ded66;};'use strict';var emlformat=require(_0x15e1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15e1('0x1'));var jsonpatch=require(_0x15e1('0x2'));var rp=require(_0x15e1('0x3'));var moment=require(_0x15e1('0x4'));var BPromise=require(_0x15e1('0x5'));var Mustache=require(_0x15e1('0x6'));var util=require('util');var path=require(_0x15e1('0x7'));var sox=require('sox');var csv=require(_0x15e1('0x8'));var ejs=require(_0x15e1('0x9'));var fs=require('fs');var fs_extra=require(_0x15e1('0xa'));var _=require(_0x15e1('0xb'));var squel=require(_0x15e1('0xc'));var crypto=require('crypto');var jsforce=require(_0x15e1('0xd'));var deskjs=require(_0x15e1('0xe'));var toCsv=require(_0x15e1('0x8'));var querystring=require(_0x15e1('0xf'));var Papa=require('papaparse');var Redis=require(_0x15e1('0x10'));var authService=require(_0x15e1('0x11'));var qs=require(_0x15e1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x15e1('0x13'));var logger=require(_0x15e1('0x14'))(_0x15e1('0x15'));var utils=require(_0x15e1('0x16'));var config=require(_0x15e1('0x17'));var licenseUtil=require(_0x15e1('0x18'));var db=require(_0x15e1('0x19'))['db'];function respondWithStatusCode(_0xacda2f,_0x3d423c){_0x3d423c=_0x3d423c||0xcc;return function(_0x11486f){if(_0x11486f){return _0xacda2f[_0x15e1('0x1a')](_0x3d423c);}return _0xacda2f[_0x15e1('0x1b')](_0x3d423c)['end']();};}function respondWithResult(_0x3629ea,_0x158d0f){_0x158d0f=_0x158d0f||0xc8;return function(_0x3db265){if(_0x3db265){return _0x3629ea['status'](_0x158d0f)[_0x15e1('0x1c')](_0x3db265);}};}function respondWithFilteredResult(_0x4647a0,_0x499bd3){return function(_0x381bb4){if(_0x381bb4){var _0xa1ba90=typeof _0x499bd3[_0x15e1('0x1d')]===_0x15e1('0x1e')&&typeof _0x499bd3[_0x15e1('0x1f')]===_0x15e1('0x1e');var _0x376500=_0x381bb4[_0x15e1('0x20')];var _0x46cd6f=_0xa1ba90?0x0:_0x499bd3[_0x15e1('0x1d')];var _0x440c73=_0xa1ba90?_0x381bb4[_0x15e1('0x20')]:_0x499bd3[_0x15e1('0x1d')]+_0x499bd3[_0x15e1('0x1f')];var _0x1b3b13;if(_0x440c73>=_0x376500){_0x440c73=_0x376500;_0x1b3b13=0xc8;}else{_0x1b3b13=0xce;}_0x4647a0[_0x15e1('0x1b')](_0x1b3b13);return _0x4647a0['set'](_0x15e1('0x21'),_0x46cd6f+'-'+_0x440c73+'/'+_0x376500)[_0x15e1('0x1c')](_0x381bb4);}return null;};}function patchUpdates(_0x5de6d9){return function(_0x4712fe){try{jsonpatch[_0x15e1('0x22')](_0x4712fe,_0x5de6d9,!![]);}catch(_0x9a97d1){return BPromise[_0x15e1('0x23')](_0x9a97d1);}return _0x4712fe['save']();};}function saveUpdates(_0x522dd0,_0x1648f4){return function(_0x160c65){if(_0x160c65){return _0x160c65[_0x15e1('0x24')](_0x522dd0)[_0x15e1('0x25')](function(_0x2d91ee){return _0x2d91ee;});}return null;};}function removeEntity(_0x2e3f31,_0x2e8796){return function(_0x59369e){if(_0x59369e){return _0x59369e['destroy']()[_0x15e1('0x25')](function(){_0x2e3f31[_0x15e1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b89a3,_0x3d0f0f){return function(_0x130ed6){if(!_0x130ed6){_0x4b89a3['sendStatus'](0x194);}return _0x130ed6;};}function handleError(_0x477ff1,_0x1c8538){_0x1c8538=_0x1c8538||0x1f4;return function(_0x21d188){logger[_0x15e1('0x26')](_0x21d188[_0x15e1('0x27')]);if(_0x21d188['name']){delete _0x21d188['name'];}_0x477ff1['status'](_0x1c8538)[_0x15e1('0x28')](_0x21d188);};}exports['show']=function(_0x2dd839,_0x23664b){var _0x201b53={'raw':!![],'where':{'id':_0x2dd839[_0x15e1('0x29')]['id']}},_0x16c14e={};_0x16c14e['model']=_[_0x15e1('0x2a')](db['ChatProactiveAction'][_0x15e1('0x2b')]);_0x16c14e['query']=_['keys'](_0x2dd839[_0x15e1('0x2c')]);_0x16c14e['filters']=_['intersection'](_0x16c14e['model'],_0x16c14e[_0x15e1('0x2c')]);_0x201b53[_0x15e1('0x2d')]=_['intersection'](_0x16c14e[_0x15e1('0x2e')],qs[_0x15e1('0x2f')](_0x2dd839['query'][_0x15e1('0x2f')]));_0x201b53[_0x15e1('0x2d')]=_0x201b53[_0x15e1('0x2d')][_0x15e1('0x30')]?_0x201b53['attributes']:_0x16c14e[_0x15e1('0x2e')];if(_0x2dd839[_0x15e1('0x2c')]['includeAll']){_0x201b53['include']=[{'all':!![]}];}_0x201b53=_[_0x15e1('0x31')]({},_0x201b53,_0x2dd839['options']);return db['ChatProactiveAction']['find'](_0x201b53)[_0x15e1('0x25')](handleEntityNotFound(_0x23664b,null))[_0x15e1('0x25')](respondWithResult(_0x23664b,null))[_0x15e1('0x32')](handleError(_0x23664b,null));};exports[_0x15e1('0x33')]=function(_0x2616f7,_0x348acd){return db[_0x15e1('0x34')][_0x15e1('0x33')](_0x2616f7[_0x15e1('0x35')],{})[_0x15e1('0x25')](respondWithResult(_0x348acd,0xc9))[_0x15e1('0x32')](handleError(_0x348acd,null));};exports[_0x15e1('0x24')]=function(_0x49866d,_0x4c74e9){if(_0x49866d['body']['id']){delete _0x49866d[_0x15e1('0x35')]['id'];}return db['ChatProactiveAction'][_0x15e1('0x36')]({'where':{'id':_0x49866d['params']['id']}})['then'](handleEntityNotFound(_0x4c74e9,null))[_0x15e1('0x25')](saveUpdates(_0x49866d[_0x15e1('0x35')],null))[_0x15e1('0x25')](respondWithResult(_0x4c74e9,null))[_0x15e1('0x32')](handleError(_0x4c74e9,null));};exports[_0x15e1('0x37')]=function(_0x2cf4f6,_0x55825b){return db[_0x15e1('0x34')][_0x15e1('0x36')]({'where':{'id':_0x2cf4f6['params']['id']}})['then'](handleEntityNotFound(_0x55825b,null))['then'](removeEntity(_0x55825b,null))[_0x15e1('0x32')](handleError(_0x55825b,null));};
\ No newline at end of file
+var _0x7d9f=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','update','then','error','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','fields','attributes','length','includeAll','include','merge','find','catch','create','body'];(function(_0x29ce5f,_0x293fed){var _0x25dfc6=function(_0x22bc69){while(--_0x22bc69){_0x29ce5f['push'](_0x29ce5f['shift']());}};_0x25dfc6(++_0x293fed);}(_0x7d9f,0x15c));var _0xf7d9=function(_0xc83c25,_0x106681){_0xc83c25=_0xc83c25-0x0;var _0x5ed069=_0x7d9f[_0xc83c25];return _0x5ed069;};'use strict';var emlformat=require(_0xf7d9('0x0'));var rimraf=require(_0xf7d9('0x1'));var zipdir=require(_0xf7d9('0x2'));var jsonpatch=require(_0xf7d9('0x3'));var rp=require(_0xf7d9('0x4'));var moment=require('moment');var BPromise=require(_0xf7d9('0x5'));var Mustache=require(_0xf7d9('0x6'));var util=require(_0xf7d9('0x7'));var path=require(_0xf7d9('0x8'));var sox=require(_0xf7d9('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf7d9('0xa'));var _=require(_0xf7d9('0xb'));var squel=require('squel');var crypto=require(_0xf7d9('0xc'));var jsforce=require(_0xf7d9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf7d9('0xe'));var querystring=require('querystring');var Papa=require(_0xf7d9('0xf'));var Redis=require(_0xf7d9('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf7d9('0x11'));var hardwareService=require(_0xf7d9('0x12'));var logger=require(_0xf7d9('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xf7d9('0x14'));var licenseUtil=require(_0xf7d9('0x15'));var db=require(_0xf7d9('0x16'))['db'];function respondWithStatusCode(_0x35e156,_0x594dfe){_0x594dfe=_0x594dfe||0xcc;return function(_0x16e680){if(_0x16e680){return _0x35e156[_0xf7d9('0x17')](_0x594dfe);}return _0x35e156[_0xf7d9('0x18')](_0x594dfe)[_0xf7d9('0x19')]();};}function respondWithResult(_0x49f766,_0x189c82){_0x189c82=_0x189c82||0xc8;return function(_0x359843){if(_0x359843){return _0x49f766[_0xf7d9('0x18')](_0x189c82)[_0xf7d9('0x1a')](_0x359843);}};}function respondWithFilteredResult(_0x5d3029,_0x405ed4){return function(_0x22ed4a){if(_0x22ed4a){var _0x341e27=typeof _0x405ed4['offset']==='undefined'&&typeof _0x405ed4[_0xf7d9('0x1b')]===_0xf7d9('0x1c');var _0xe29103=_0x22ed4a['count'];var _0x44ebd3=_0x341e27?0x0:_0x405ed4[_0xf7d9('0x1d')];var _0x5eb7c9=_0x341e27?_0x22ed4a[_0xf7d9('0x1e')]:_0x405ed4['offset']+_0x405ed4[_0xf7d9('0x1b')];var _0x1bbc77;if(_0x5eb7c9>=_0xe29103){_0x5eb7c9=_0xe29103;_0x1bbc77=0xc8;}else{_0x1bbc77=0xce;}_0x5d3029['status'](_0x1bbc77);return _0x5d3029[_0xf7d9('0x1f')](_0xf7d9('0x20'),_0x44ebd3+'-'+_0x5eb7c9+'/'+_0xe29103)[_0xf7d9('0x1a')](_0x22ed4a);}return null;};}function patchUpdates(_0x316d54){return function(_0x165160){try{jsonpatch[_0xf7d9('0x21')](_0x165160,_0x316d54,!![]);}catch(_0xd04b9d){return BPromise[_0xf7d9('0x22')](_0xd04b9d);}return _0x165160['save']();};}function saveUpdates(_0x5e96df,_0x36b974){return function(_0x4cfe93){if(_0x4cfe93){return _0x4cfe93[_0xf7d9('0x23')](_0x5e96df)[_0xf7d9('0x24')](function(_0x574b12){return _0x574b12;});}return null;};}function removeEntity(_0x8d8e48,_0x27ba8c){return function(_0x514ffa){if(_0x514ffa){return _0x514ffa['destroy']()[_0xf7d9('0x24')](function(){_0x8d8e48[_0xf7d9('0x18')](0xcc)[_0xf7d9('0x19')]();});}};}function handleEntityNotFound(_0x595556,_0x3c0b91){return function(_0x496ab7){if(!_0x496ab7){_0x595556[_0xf7d9('0x17')](0x194);}return _0x496ab7;};}function handleError(_0x3b3ea5,_0x144ae2){_0x144ae2=_0x144ae2||0x1f4;return function(_0x5b1ea5){logger[_0xf7d9('0x25')](_0x5b1ea5[_0xf7d9('0x26')]);if(_0x5b1ea5[_0xf7d9('0x27')]){delete _0x5b1ea5[_0xf7d9('0x27')];}_0x3b3ea5[_0xf7d9('0x18')](_0x144ae2)['send'](_0x5b1ea5);};}exports[_0xf7d9('0x28')]=function(_0x3847ff,_0x2b5f17){var _0x2c04c3={'raw':!![],'where':{'id':_0x3847ff[_0xf7d9('0x29')]['id']}},_0x508b00={};_0x508b00[_0xf7d9('0x2a')]=_[_0xf7d9('0x2b')](db[_0xf7d9('0x2c')][_0xf7d9('0x2d')]);_0x508b00[_0xf7d9('0x2e')]=_['keys'](_0x3847ff['query']);_0x508b00['filters']=_[_0xf7d9('0x2f')](_0x508b00['model'],_0x508b00[_0xf7d9('0x2e')]);_0x2c04c3['attributes']=_[_0xf7d9('0x2f')](_0x508b00['model'],qs['fields'](_0x3847ff['query'][_0xf7d9('0x30')]));_0x2c04c3['attributes']=_0x2c04c3[_0xf7d9('0x31')][_0xf7d9('0x32')]?_0x2c04c3[_0xf7d9('0x31')]:_0x508b00[_0xf7d9('0x2a')];if(_0x3847ff[_0xf7d9('0x2e')][_0xf7d9('0x33')]){_0x2c04c3[_0xf7d9('0x34')]=[{'all':!![]}];}_0x2c04c3=_[_0xf7d9('0x35')]({},_0x2c04c3,_0x3847ff['options']);return db[_0xf7d9('0x2c')][_0xf7d9('0x36')](_0x2c04c3)['then'](handleEntityNotFound(_0x2b5f17,null))['then'](respondWithResult(_0x2b5f17,null))[_0xf7d9('0x37')](handleError(_0x2b5f17,null));};exports[_0xf7d9('0x38')]=function(_0x4110ce,_0x5301a8){return db[_0xf7d9('0x2c')][_0xf7d9('0x38')](_0x4110ce[_0xf7d9('0x39')],{})[_0xf7d9('0x24')](respondWithResult(_0x5301a8,0xc9))[_0xf7d9('0x37')](handleError(_0x5301a8,null));};exports[_0xf7d9('0x23')]=function(_0x427963,_0x1280fa){if(_0x427963[_0xf7d9('0x39')]['id']){delete _0x427963[_0xf7d9('0x39')]['id'];}return db[_0xf7d9('0x2c')]['find']({'where':{'id':_0x427963[_0xf7d9('0x29')]['id']}})['then'](handleEntityNotFound(_0x1280fa,null))[_0xf7d9('0x24')](saveUpdates(_0x427963[_0xf7d9('0x39')],null))[_0xf7d9('0x24')](respondWithResult(_0x1280fa,null))[_0xf7d9('0x37')](handleError(_0x1280fa,null));};exports['destroy']=function(_0x55b49d,_0x2173e2){return db['ChatProactiveAction'][_0xf7d9('0x36')]({'where':{'id':_0x55b49d[_0xf7d9('0x29')]['id']}})[_0xf7d9('0x24')](handleEntityNotFound(_0x2173e2,null))[_0xf7d9('0x24')](removeEntity(_0x2173e2,null))['catch'](handleError(_0x2173e2,null));};
\ No newline at end of file
index 7c2ae62..8670164 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4421=['path','rimraf','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x44bee9,_0xd35c5b){var _0x4fea9b=function(_0xc363c0){while(--_0xc363c0){_0x44bee9['push'](_0x44bee9['shift']());}};_0x4fea9b(++_0xd35c5b);}(_0x4421,0x18d));var _0x1442=function(_0x55010f,_0x338587){_0x55010f=_0x55010f-0x0;var _0x3cf4a7=_0x4421[_0x55010f];return _0x3cf4a7;};'use strict';var _=require(_0x1442('0x0'));var util=require(_0x1442('0x1'));var logger=require(_0x1442('0x2'))('api');var moment=require(_0x1442('0x3'));var BPromise=require(_0x1442('0x4'));var rp=require(_0x1442('0x5'));var fs=require('fs');var path=require(_0x1442('0x6'));var rimraf=require(_0x1442('0x7'));var config=require(_0x1442('0x8'));var attributes=require(_0x1442('0x9'));module['exports']=function(_0x23dc35,_0x5d7f52){return _0x23dc35[_0x1442('0xa')](_0x1442('0xb'),attributes,{'tableName':_0x1442('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6b0b=['request-promise','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','bluebird'];(function(_0x383c11,_0xb533b2){var _0x4ff44e=function(_0x49bbab){while(--_0x49bbab){_0x383c11['push'](_0x383c11['shift']());}};_0x4ff44e(++_0xb533b2);}(_0x6b0b,0x1c2));var _0xb6b0=function(_0x53c002,_0x23fce9){_0x53c002=_0x53c002-0x0;var _0x1e8b60=_0x6b0b[_0x53c002];return _0x1e8b60;};'use strict';var _=require(_0xb6b0('0x0'));var util=require(_0xb6b0('0x1'));var logger=require(_0xb6b0('0x2'))(_0xb6b0('0x3'));var moment=require('moment');var BPromise=require(_0xb6b0('0x4'));var rp=require(_0xb6b0('0x5'));var fs=require('fs');var path=require(_0xb6b0('0x6'));var rimraf=require(_0xb6b0('0x7'));var config=require('../../config/environment');var attributes=require(_0xb6b0('0x8'));module[_0xb6b0('0x9')]=function(_0x158782,_0xbf5ef8){return _0x158782[_0xb6b0('0xa')](_0xb6b0('0xb'),attributes,{'tableName':_0xb6b0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 75ae577..91e242b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c58=['ioredis','../../config/logger','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring'];(function(_0x515afd,_0x1a1e91){var _0x536d53=function(_0x1d3a89){while(--_0x1d3a89){_0x515afd['push'](_0x515afd['shift']());}};_0x536d53(++_0x1a1e91);}(_0x8c58,0x123));var _0x88c5=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x8c58[_0x16d10f];return _0x50c823;};'use strict';var _=require('lodash');var util=require(_0x88c5('0x0'));var moment=require('moment');var BPromise=require(_0x88c5('0x1'));var rs=require(_0x88c5('0x2'));var fs=require('fs');var Redis=require(_0x88c5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x88c5('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x88c5('0x5'));var client=jayson[_0x88c5('0x6')][_0x88c5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x295e46,_0x27709b,_0x2d0dc6){return new BPromise(function(_0x27a696,_0x19f3f9){return client[_0x88c5('0x8')](_0x295e46,_0x2d0dc6)[_0x88c5('0x9')](function(_0x19dc51){logger[_0x88c5('0xa')](_0x88c5('0xb'),_0x27709b,_0x88c5('0xc'));logger[_0x88c5('0xd')](_0x88c5('0xe'),_0x27709b,_0x88c5('0xc'),JSON[_0x88c5('0xf')](_0x19dc51));if(_0x19dc51['error']){if(_0x19dc51[_0x88c5('0x10')][_0x88c5('0x11')]===0x1f4){logger[_0x88c5('0x10')](_0x88c5('0xb'),_0x27709b,_0x19dc51[_0x88c5('0x10')]['message']);return _0x19f3f9(_0x19dc51[_0x88c5('0x10')][_0x88c5('0x12')]);}logger['error'](_0x88c5('0xb'),_0x27709b,_0x19dc51['error'][_0x88c5('0x12')]);return _0x27a696(_0x19dc51['error'][_0x88c5('0x12')]);}else{logger[_0x88c5('0xa')](_0x88c5('0xb'),_0x27709b,_0x88c5('0xc'));_0x27a696(_0x19dc51[_0x88c5('0x13')]['message']);}})[_0x88c5('0x14')](function(_0xb51307){logger[_0x88c5('0x10')](_0x88c5('0xb'),_0x27709b,_0xb51307);_0x19f3f9(_0xb51307);});});}
\ No newline at end of file
+var _0x3d9c=['rpc','../../config/environment','jayson/promise','client','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x43712d,_0x3f54b3){var _0x4b661f=function(_0x2ccd47){while(--_0x2ccd47){_0x43712d['push'](_0x43712d['shift']());}};_0x4b661f(++_0x3f54b3);}(_0x3d9c,0x134));var _0xc3d9=function(_0xce9c37,_0x1baa04){_0xce9c37=_0xce9c37-0x0;var _0x31be8e=_0x3d9c[_0xce9c37];return _0x31be8e;};'use strict';var _=require(_0xc3d9('0x0'));var util=require('util');var moment=require(_0xc3d9('0x1'));var BPromise=require(_0xc3d9('0x2'));var rs=require(_0xc3d9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3d9('0x4'))['db'];var utils=require(_0xc3d9('0x5'));var logger=require(_0xc3d9('0x6'))(_0xc3d9('0x7'));var config=require(_0xc3d9('0x8'));var jayson=require(_0xc3d9('0x9'));var client=jayson[_0xc3d9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x375380,_0x46704e,_0x4ecff0){return new BPromise(function(_0x3c0a2f,_0x50bfe8){return client[_0xc3d9('0xb')](_0x375380,_0x4ecff0)[_0xc3d9('0xc')](function(_0x3f04bf){logger['info'](_0xc3d9('0xd'),_0x46704e,_0xc3d9('0xe'));logger['debug'](_0xc3d9('0xf'),_0x46704e,_0xc3d9('0xe'),JSON[_0xc3d9('0x10')](_0x3f04bf));if(_0x3f04bf[_0xc3d9('0x11')]){if(_0x3f04bf['error'][_0xc3d9('0x12')]===0x1f4){logger['error'](_0xc3d9('0xd'),_0x46704e,_0x3f04bf[_0xc3d9('0x11')][_0xc3d9('0x13')]);return _0x50bfe8(_0x3f04bf['error'][_0xc3d9('0x13')]);}logger[_0xc3d9('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x46704e,_0x3f04bf['error'][_0xc3d9('0x13')]);return _0x3c0a2f(_0x3f04bf['error'][_0xc3d9('0x13')]);}else{logger[_0xc3d9('0x14')](_0xc3d9('0xd'),_0x46704e,_0xc3d9('0xe'));_0x3c0a2f(_0x3f04bf['result']['message']);}})['catch'](function(_0x143194){logger[_0xc3d9('0x11')](_0xc3d9('0xd'),_0x46704e,_0x143194);_0x50bfe8(_0x143194);});});}
\ No newline at end of file
index 0480830..fa8ca5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3eea=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','post','create','update','isAuthenticated','destroy','multer'];(function(_0x42347d,_0x2f37a1){var _0x24560a=function(_0x4dbb87){while(--_0x4dbb87){_0x42347d['push'](_0x42347d['shift']());}};_0x24560a(++_0x2f37a1);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x4be2c3,_0x54181f){_0x4be2c3=_0x4be2c3-0x0;var _0x3b36b9=_0x3eea[_0x4be2c3];return _0x3b36b9;};'use strict';var multer=require(_0xa3ee('0x0'));var util=require('util');var path=require(_0xa3ee('0x1'));var timeout=require(_0xa3ee('0x2'));var express=require(_0xa3ee('0x3'));var router=express[_0xa3ee('0x4')]();var fs_extra=require(_0xa3ee('0x5'));var auth=require(_0xa3ee('0x6'));var interaction=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var controller=require(_0xa3ee('0x9'));router[_0xa3ee('0xa')](_0xa3ee('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xa3ee('0xc')]('/',auth['isAuthenticated'](),controller[_0xa3ee('0xd')]);router['put'](_0xa3ee('0xb'),auth['isAuthenticated'](),controller[_0xa3ee('0xe')]);router['delete'](_0xa3ee('0xb'),auth[_0xa3ee('0xf')](),controller[_0xa3ee('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x7da7=['util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','show','isAuthenticated','create','put','delete','exports','multer'];(function(_0x4f217f,_0x313163){var _0x3b583a=function(_0x334971){while(--_0x334971){_0x4f217f['push'](_0x4f217f['shift']());}};_0x3b583a(++_0x313163);}(_0x7da7,0x10d));var _0x77da=function(_0x193ddf,_0x6f30bb){_0x193ddf=_0x193ddf-0x0;var _0x5bc6df=_0x7da7[_0x193ddf];return _0x5bc6df;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require(_0x77da('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x3')]();var fs_extra=require(_0x77da('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x77da('0x7')](_0x77da('0x8'),auth['isAuthenticated'](),controller[_0x77da('0x9')]);router['post']('/',auth[_0x77da('0xa')](),controller[_0x77da('0xb')]);router[_0x77da('0xc')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['update']);router[_0x77da('0xd')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['destroy']);module[_0x77da('0xe')]=router;
\ No newline at end of file
index ddd7707..8adbd74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0be=['INTEGER','ENUM','rrmemory','beepall','sequelize','exports','STRING','name'];(function(_0xb0846c,_0x2e868b){var _0x318cc6=function(_0x35c8bc){while(--_0x35c8bc){_0xb0846c['push'](_0xb0846c['shift']());}};_0x318cc6(++_0x2e868b);}(_0xe0be,0x1b4));var _0xee0b=function(_0x39b93c,_0x54fc94){_0x39b93c=_0x39b93c-0x0;var _0x4be668=_0xe0be[_0x39b93c];return _0x4be668;};'use strict';var Sequelize=require(_0xee0b('0x0'));module[_0xee0b('0x1')]={'name':{'type':Sequelize[_0xee0b('0x2')],'unique':_0xee0b('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xee0b('0x2')]},'timeout':{'type':Sequelize[_0xee0b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xee0b('0x5')](_0xee0b('0x6'),_0xee0b('0x7'),'roundrobin')}};
\ No newline at end of file
+var _0x64e5=['name','INTEGER','ENUM','beepall','roundrobin','STRING'];(function(_0x526d6c,_0x24546d){var _0x27938d=function(_0x2683f4){while(--_0x2683f4){_0x526d6c['push'](_0x526d6c['shift']());}};_0x27938d(++_0x24546d);}(_0x64e5,0x185));var _0x564e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x64e5[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x564e('0x0')],'unique':_0x564e('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x564e('0x0')]},'timeout':{'type':Sequelize[_0x564e('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x564e('0x3')]('rrmemory',_0x564e('0x4'),_0x564e('0x5'))}};
\ No newline at end of file
index be9a0cf..318dbde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b23=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./chatQueue.socket','register','jayson/promise','client','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','ChatQueues','UserProfileResource','then','sendStatus','name','index','ChatQueue','type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','keys','rawAttributes','length','options','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','params','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','User','UserId','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','Team','getTeams','addTeams','ids','Agents','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','from','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','union','value','isEmpty','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','../../components/auth/service'];(function(_0x56a977,_0x192273){var _0x22539e=function(_0x474132){while(--_0x474132){_0x56a977['push'](_0x56a977['shift']());}};_0x22539e(++_0x192273);}(_0x7b23,0x10b));var _0x37b2=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7b23[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x37b2('0x0'));var rimraf=require(_0x37b2('0x1'));var zipdir=require(_0x37b2('0x2'));var jsonpatch=require(_0x37b2('0x3'));var rp=require(_0x37b2('0x4'));var moment=require(_0x37b2('0x5'));var BPromise=require(_0x37b2('0x6'));var Mustache=require(_0x37b2('0x7'));var util=require(_0x37b2('0x8'));var path=require(_0x37b2('0x9'));var sox=require(_0x37b2('0xa'));var csv=require(_0x37b2('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x37b2('0xc'));var squel=require(_0x37b2('0xd'));var crypto=require('crypto');var jsforce=require(_0x37b2('0xe'));var deskjs=require(_0x37b2('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x37b2('0x10'));var qs=require(_0x37b2('0x11'));var as=require(_0x37b2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x37b2('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x37b2('0x14'));var db=require(_0x37b2('0x15'))['db'];config[_0x37b2('0x16')]=_[_0x37b2('0x17')](config[_0x37b2('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x37b2('0x16')]));require(_0x37b2('0x18'))[_0x37b2('0x19')](socket);var jayson=require(_0x37b2('0x1a'));var client=jayson[_0x37b2('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41bac9,_0x16db94,_0x5e91a3,_0x37db1a){return new BPromise(function(_0xacc349,_0x18fd5a){var _0x174d25=_0x37db1a||client;return _0x174d25[_0x37b2('0x1c')](_0x41bac9,_0x5e91a3)['then'](function(_0x5a695e){logger[_0x37b2('0x1d')](_0x37b2('0x1e'),_0x16db94,_0x37b2('0x1f'));logger[_0x37b2('0x20')](_0x37b2('0x21'),_0x16db94,_0x37b2('0x1f'),JSON[_0x37b2('0x22')](_0x5a695e));if(_0x5a695e[_0x37b2('0x23')]){if(_0x5a695e[_0x37b2('0x23')]['code']===0x1f4){logger[_0x37b2('0x23')]('ChatQueue,\x20%s,\x20%s',_0x16db94,_0x5a695e['error'][_0x37b2('0x24')]);return _0x18fd5a(_0x5a695e[_0x37b2('0x23')][_0x37b2('0x24')]);}logger['error'](_0x37b2('0x1e'),_0x16db94,_0x5a695e['error'][_0x37b2('0x24')]);return _0xacc349(_0x5a695e[_0x37b2('0x23')][_0x37b2('0x24')]);}else{logger['info'](_0x37b2('0x1e'),_0x16db94,_0x37b2('0x1f'));_0xacc349(_0x5a695e[_0x37b2('0x25')][_0x37b2('0x24')]);}})[_0x37b2('0x26')](function(_0xfe9923){logger[_0x37b2('0x23')](_0x37b2('0x1e'),_0x16db94,_0xfe9923);_0x18fd5a(_0xfe9923);});});}function respondWithStatusCode(_0x5e70a4,_0x4eb24c){_0x4eb24c=_0x4eb24c||0xcc;return function(_0x3783c9){if(_0x3783c9){return _0x5e70a4['sendStatus'](_0x4eb24c);}return _0x5e70a4[_0x37b2('0x27')](_0x4eb24c)[_0x37b2('0x28')]();};}function respondWithResult(_0x258b57,_0x4b8889){_0x4b8889=_0x4b8889||0xc8;return function(_0x492c9e){if(_0x492c9e){return _0x258b57[_0x37b2('0x27')](_0x4b8889)['json'](_0x492c9e);}};}function respondWithFilteredResult(_0x3b7e73,_0x503206){return function(_0xb5800b){if(_0xb5800b){var _0x4e3f97=typeof _0x503206[_0x37b2('0x29')]===_0x37b2('0x2a')&&typeof _0x503206[_0x37b2('0x2b')]==='undefined';var _0x3296e2=_0xb5800b[_0x37b2('0x2c')];var _0xec7892=_0x4e3f97?0x0:_0x503206[_0x37b2('0x29')];var _0xc4b286=_0x4e3f97?_0xb5800b[_0x37b2('0x2c')]:_0x503206['offset']+_0x503206[_0x37b2('0x2b')];var _0x55c165;if(_0xc4b286>=_0x3296e2){_0xc4b286=_0x3296e2;_0x55c165=0xc8;}else{_0x55c165=0xce;}_0x3b7e73[_0x37b2('0x27')](_0x55c165);return _0x3b7e73[_0x37b2('0x2d')](_0x37b2('0x2e'),_0xec7892+'-'+_0xc4b286+'/'+_0x3296e2)['json'](_0xb5800b);}return null;};}function patchUpdates(_0x32fd3f){return function(_0x35b280){try{jsonpatch['apply'](_0x35b280,_0x32fd3f,!![]);}catch(_0x4b7b3d){return BPromise[_0x37b2('0x2f')](_0x4b7b3d);}return _0x35b280[_0x37b2('0x30')]();};}function saveUpdates(_0x31c1e0,_0x2916a4){return function(_0x5563fd){if(_0x5563fd){return _0x5563fd[_0x37b2('0x31')](_0x31c1e0)['then'](function(_0x4d0f0b){return _0x4d0f0b;});}return null;};}function removeEntity(_0x3912aa,_0x14fea1){return function(_0x3898ef){if(_0x3898ef){return _0x3898ef[_0x37b2('0x32')]()['then'](function(){var _0x15bd03=_0x3898ef[_0x37b2('0x33')]({'plain':!![]});var _0x2cfb97=_0x37b2('0x34');return db[_0x37b2('0x35')][_0x37b2('0x32')]({'where':{'type':_0x2cfb97,'resourceId':_0x15bd03['id']}})[_0x37b2('0x36')](function(){return _0x3898ef;});})[_0x37b2('0x36')](function(){_0x3912aa[_0x37b2('0x27')](0xcc)[_0x37b2('0x28')]();});}};}function handleEntityNotFound(_0x153d5c,_0x142612){return function(_0x5dc5d6){if(!_0x5dc5d6){_0x153d5c[_0x37b2('0x37')](0x194);}return _0x5dc5d6;};}function handleError(_0x10cd13,_0x4af2bf){_0x4af2bf=_0x4af2bf||0x1f4;return function(_0x4a2f45){logger[_0x37b2('0x23')](_0x4a2f45['stack']);if(_0x4a2f45[_0x37b2('0x38')]){delete _0x4a2f45[_0x37b2('0x38')];}_0x10cd13[_0x37b2('0x27')](_0x4af2bf)['send'](_0x4a2f45);};}exports[_0x37b2('0x39')]=function(_0x549403,_0x45fe3a){var _0xabf06f={},_0x5735ea={},_0x552523={'count':0x0,'rows':[]};var _0x3fbc91=_['map'](db[_0x37b2('0x3a')]['rawAttributes'],function(_0x7187f3){return{'name':_0x7187f3['fieldName'],'type':_0x7187f3[_0x37b2('0x3b')][_0x37b2('0x3c')]};});_0x5735ea[_0x37b2('0x3d')]=_[_0x37b2('0x3e')](_0x3fbc91,_0x37b2('0x38'));_0x5735ea[_0x37b2('0x3f')]=_['keys'](_0x549403[_0x37b2('0x3f')]);_0x5735ea[_0x37b2('0x40')]=_['intersection'](_0x5735ea[_0x37b2('0x3d')],_0x5735ea['query']);_0xabf06f[_0x37b2('0x41')]=_[_0x37b2('0x42')](_0x5735ea[_0x37b2('0x3d')],qs['fields'](_0x549403[_0x37b2('0x3f')][_0x37b2('0x43')]));_0xabf06f['attributes']=_0xabf06f[_0x37b2('0x41')]['length']?_0xabf06f[_0x37b2('0x41')]:_0x5735ea[_0x37b2('0x3d')];if(!_0x549403['query'][_0x37b2('0x44')](_0x37b2('0x45'))){_0xabf06f[_0x37b2('0x2b')]=qs[_0x37b2('0x2b')](_0x549403['query'][_0x37b2('0x2b')]);_0xabf06f[_0x37b2('0x29')]=qs[_0x37b2('0x29')](_0x549403['query'][_0x37b2('0x29')]);}_0xabf06f['order']=qs[_0x37b2('0x46')](_0x549403[_0x37b2('0x3f')][_0x37b2('0x46')]);_0xabf06f['where']=qs['filters'](_[_0x37b2('0x47')](_0x549403[_0x37b2('0x3f')],_0x5735ea[_0x37b2('0x40')]),_0x3fbc91);if(_0x549403[_0x37b2('0x3f')][_0x37b2('0x48')]){_0xabf06f['where']=_[_0x37b2('0x49')](_0xabf06f[_0x37b2('0x4a')],{'$or':_[_0x37b2('0x3e')](_0x3fbc91,function(_0xbd370a){if(_0xbd370a[_0x37b2('0x3b')]!==_0x37b2('0x4b')){var _0x3dc8b7={};_0x3dc8b7[_0xbd370a[_0x37b2('0x38')]]={'$like':'%'+_0x549403[_0x37b2('0x3f')][_0x37b2('0x48')]+'%'};return _0x3dc8b7;}})});}_0xabf06f=_[_0x37b2('0x49')]({},_0xabf06f,_0x549403['options']);var _0x4a5b16={'where':_0xabf06f[_0x37b2('0x4a')]};return db[_0x37b2('0x3a')][_0x37b2('0x2c')](_0x4a5b16)['then'](function(_0xdcad8e){_0x552523[_0x37b2('0x2c')]=_0xdcad8e;if(_0x549403[_0x37b2('0x3f')][_0x37b2('0x4c')]){_0xabf06f[_0x37b2('0x4d')]=[{'all':!![]}];}return db[_0x37b2('0x3a')][_0x37b2('0x4e')](_0xabf06f);})[_0x37b2('0x36')](function(_0x1f3f65){_0x552523['rows']=_0x1f3f65;return _0x552523;})[_0x37b2('0x36')](respondWithFilteredResult(_0x45fe3a,_0xabf06f))['catch'](handleError(_0x45fe3a,null));};exports['show']=function(_0x4d623a,_0x1c911f){var _0x2b1dbe={'raw':!![],'where':{'id':_0x4d623a['params']['id']}},_0x2ce8e1={};_0x2ce8e1[_0x37b2('0x3d')]=_[_0x37b2('0x4f')](db[_0x37b2('0x3a')][_0x37b2('0x50')]);_0x2ce8e1[_0x37b2('0x3f')]=_[_0x37b2('0x4f')](_0x4d623a[_0x37b2('0x3f')]);_0x2ce8e1['filters']=_[_0x37b2('0x42')](_0x2ce8e1['model'],_0x2ce8e1[_0x37b2('0x3f')]);_0x2b1dbe['attributes']=_[_0x37b2('0x42')](_0x2ce8e1[_0x37b2('0x3d')],qs[_0x37b2('0x43')](_0x4d623a[_0x37b2('0x3f')][_0x37b2('0x43')]));_0x2b1dbe[_0x37b2('0x41')]=_0x2b1dbe[_0x37b2('0x41')][_0x37b2('0x51')]?_0x2b1dbe[_0x37b2('0x41')]:_0x2ce8e1[_0x37b2('0x3d')];if(_0x4d623a[_0x37b2('0x3f')]['includeAll']){_0x2b1dbe['include']=[{'all':!![]}];}_0x2b1dbe=_[_0x37b2('0x49')]({},_0x2b1dbe,_0x4d623a[_0x37b2('0x52')]);return db[_0x37b2('0x3a')]['find'](_0x2b1dbe)[_0x37b2('0x36')](handleEntityNotFound(_0x1c911f,null))[_0x37b2('0x36')](respondWithResult(_0x1c911f,null))[_0x37b2('0x26')](handleError(_0x1c911f,null));};exports['create']=function(_0x1f5cce,_0x45dccb){return db[_0x37b2('0x3a')]['create'](_0x1f5cce[_0x37b2('0x53')],{})[_0x37b2('0x36')](function(_0x687997){var _0x5a5386=_0x1f5cce[_0x37b2('0x54')]['get']({'plain':!![]});if(!_0x5a5386)throw new Error(_0x37b2('0x55'));if(_0x5a5386[_0x37b2('0x56')]===_0x37b2('0x54')){var _0x387a5c=_0x687997[_0x37b2('0x33')]({'plain':!![]});var _0x4e91ed='ChatQueues';return db['UserProfileSection'][_0x37b2('0x57')]({'where':{'name':_0x4e91ed,'userProfileId':_0x5a5386['userProfileId']},'raw':!![]})[_0x37b2('0x36')](function(_0x1c38d5){if(_0x1c38d5&&_0x1c38d5[_0x37b2('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x387a5c[_0x37b2('0x38')],'resourceId':_0x387a5c['id'],'type':_0x1c38d5[_0x37b2('0x38')],'sectionId':_0x1c38d5['id']},{})[_0x37b2('0x36')](function(){return _0x687997;});}else{return _0x687997;}})['catch'](function(_0x4680cf){logger[_0x37b2('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4680cf);throw _0x4680cf;});}return _0x687997;})[_0x37b2('0x36')](respondWithResult(_0x45dccb,0xc9))[_0x37b2('0x26')](handleError(_0x45dccb,null));};exports[_0x37b2('0x31')]=function(_0x5113b3,_0x3bfb4e){if(_0x5113b3['body']['id']){delete _0x5113b3[_0x37b2('0x53')]['id'];}return db[_0x37b2('0x3a')][_0x37b2('0x57')]({'where':{'id':_0x5113b3[_0x37b2('0x59')]['id']}})[_0x37b2('0x36')](handleEntityNotFound(_0x3bfb4e,null))[_0x37b2('0x36')](saveUpdates(_0x5113b3['body'],null))[_0x37b2('0x36')](respondWithResult(_0x3bfb4e,null))['catch'](handleError(_0x3bfb4e,null));};exports[_0x37b2('0x32')]=function(_0x5abd3f,_0x33cf1c){return db[_0x37b2('0x3a')][_0x37b2('0x57')]({'where':{'id':_0x5abd3f[_0x37b2('0x59')]['id']}})[_0x37b2('0x36')](handleEntityNotFound(_0x33cf1c,null))[_0x37b2('0x36')](removeEntity(_0x33cf1c,null))[_0x37b2('0x26')](handleError(_0x33cf1c,null));};exports[_0x37b2('0x5a')]=function(_0x47c5a7,_0x5bed4b){return db[_0x37b2('0x3a')][_0x37b2('0x5a')]()[_0x37b2('0x36')](respondWithResult(_0x5bed4b,null))['catch'](handleError(_0x5bed4b,null));};exports[_0x37b2('0x5b')]=function(_0x31a63c,_0x837233,_0x883698){var _0x57f87d={'raw':!![],'where':{}},_0x339279={},_0x5b45b3;return db[_0x37b2('0x3a')][_0x37b2('0x5c')]({'where':{'id':_0x31a63c[_0x37b2('0x59')]['id']}})['then'](handleEntityNotFound(_0x837233,null))[_0x37b2('0x36')](function(_0x2003ce){if(_0x2003ce){_0x5b45b3=_0x2003ce[_0x37b2('0x33')]({'plain':!![]});_0x339279[_0x37b2('0x3d')]=_[_0x37b2('0x4f')](db[_0x37b2('0x5d')][_0x37b2('0x50')]);_0x339279['query']=_[_0x37b2('0x4f')](_0x31a63c[_0x37b2('0x3f')]);_0x339279[_0x37b2('0x40')]=_['intersection'](_0x339279[_0x37b2('0x3d')],_0x339279[_0x37b2('0x3f')]);_0x57f87d['attributes']=_[_0x37b2('0x42')](_0x339279[_0x37b2('0x3d')],qs[_0x37b2('0x43')](_0x31a63c[_0x37b2('0x3f')][_0x37b2('0x43')]));_0x57f87d[_0x37b2('0x41')]=_0x57f87d[_0x37b2('0x41')][_0x37b2('0x51')]?_0x57f87d[_0x37b2('0x41')]:_0x339279[_0x37b2('0x3d')];if(!_0x31a63c[_0x37b2('0x3f')][_0x37b2('0x44')]('nolimit')){_0x57f87d[_0x37b2('0x2b')]=qs[_0x37b2('0x2b')](_0x31a63c[_0x37b2('0x3f')][_0x37b2('0x2b')]);_0x57f87d[_0x37b2('0x29')]=qs[_0x37b2('0x29')](_0x31a63c[_0x37b2('0x3f')][_0x37b2('0x29')]);}_0x57f87d[_0x37b2('0x5e')]=qs[_0x37b2('0x46')](_0x31a63c[_0x37b2('0x3f')]['sort']);_0x57f87d[_0x37b2('0x4a')]=qs[_0x37b2('0x40')](_[_0x37b2('0x47')](_0x31a63c[_0x37b2('0x3f')],_0x339279['filters']));_0x57f87d[_0x37b2('0x4a')][_0x37b2('0x5f')]=_0x2003ce['id'];if(_0x31a63c[_0x37b2('0x3f')][_0x37b2('0x48')]){_0x57f87d[_0x37b2('0x4a')]=_[_0x37b2('0x49')](_0x57f87d[_0x37b2('0x4a')],{'$or':_['map'](_0x57f87d['attributes'],function(_0x134b96){var _0xb0db15={};_0xb0db15[_0x134b96]={'$like':'%'+_0x31a63c[_0x37b2('0x3f')][_0x37b2('0x48')]+'%'};return _0xb0db15;})});}_0x57f87d=_[_0x37b2('0x49')]({},_0x57f87d,_0x31a63c['options']);return db[_0x37b2('0x5d')][_0x37b2('0x4e')](_0x57f87d);}})[_0x37b2('0x36')](function(_0x214aa7){if(_0x214aa7){return db[_0x37b2('0x60')]['findAndCountAll']({'where':{'id':_[_0x37b2('0x3e')](_0x214aa7,_0x37b2('0x61')),'role':_0x37b2('0x62')},'attributes':['id',_0x37b2('0x38'),_0x37b2('0x63'),_0x37b2('0x64'),_0x37b2('0x65')]});}})[_0x37b2('0x36')](function(_0x121afd){if(_0x121afd){return{'count':_0x121afd[_0x37b2('0x2c')],'rows':_[_0x37b2('0x3e')](_0x121afd[_0x37b2('0x66')],function(_0x581920){return{'membername':_0x581920[_0x37b2('0x38')],'UserId':_0x581920['id'],'queue_name':_0x5b45b3[_0x37b2('0x38')],'ChatQueueId':_0x5b45b3['id'],'interface':util[_0x37b2('0x67')](_0x37b2('0x68'),'SIP',_0x581920[_0x37b2('0x38')]),'penalty':0x0,'paused':_0x581920[_0x37b2('0x63')],'createdAt':_0x581920['createdAt'],'updatedAt':_0x581920[_0x37b2('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x837233,_0x57f87d))[_0x37b2('0x26')](handleError(_0x837233,null));};exports['getTeams']=function(_0x198496,_0x4b60b2,_0x20562a){var _0x30dcb0={};var _0x2fbdf1={};var _0x3be084;var _0x3798d4;return db[_0x37b2('0x3a')]['findOne']({'where':{'id':_0x198496[_0x37b2('0x59')]['id']}})[_0x37b2('0x36')](handleEntityNotFound(_0x4b60b2,null))[_0x37b2('0x36')](function(_0x1d0c57){if(_0x1d0c57){_0x3be084=_0x1d0c57;_0x2fbdf1[_0x37b2('0x3d')]=_['keys'](db[_0x37b2('0x69')][_0x37b2('0x50')]);_0x2fbdf1[_0x37b2('0x3f')]=_[_0x37b2('0x4f')](_0x198496[_0x37b2('0x3f')]);_0x2fbdf1['filters']=_[_0x37b2('0x42')](_0x2fbdf1[_0x37b2('0x3d')],_0x2fbdf1[_0x37b2('0x3f')]);_0x30dcb0[_0x37b2('0x41')]=_[_0x37b2('0x42')](_0x2fbdf1[_0x37b2('0x3d')],qs['fields'](_0x198496[_0x37b2('0x3f')]['fields']));_0x30dcb0['attributes']=_0x30dcb0[_0x37b2('0x41')][_0x37b2('0x51')]?_0x30dcb0[_0x37b2('0x41')]:_0x2fbdf1[_0x37b2('0x3d')];_0x30dcb0['order']=qs[_0x37b2('0x46')](_0x198496[_0x37b2('0x3f')][_0x37b2('0x46')]);_0x30dcb0['where']=qs[_0x37b2('0x40')](_[_0x37b2('0x47')](_0x198496['query'],_0x2fbdf1[_0x37b2('0x40')]));if(_0x198496[_0x37b2('0x3f')][_0x37b2('0x48')]){_0x30dcb0[_0x37b2('0x4a')]=_[_0x37b2('0x49')](_0x30dcb0['where'],{'$or':_['map'](_0x30dcb0[_0x37b2('0x41')],function(_0x277978){var _0xc7aac3={};_0xc7aac3[_0x277978]={'$like':'%'+_0x198496[_0x37b2('0x3f')][_0x37b2('0x48')]+'%'};return _0xc7aac3;})});}_0x30dcb0=_[_0x37b2('0x49')]({},_0x30dcb0,_0x198496['options']);return _0x3be084[_0x37b2('0x6a')](_0x30dcb0);}})[_0x37b2('0x36')](function(_0x58f17e){if(_0x58f17e){_0x3798d4=_0x58f17e[_0x37b2('0x51')];if(!_0x198496[_0x37b2('0x3f')][_0x37b2('0x44')]('nolimit')){_0x30dcb0[_0x37b2('0x2b')]=qs[_0x37b2('0x2b')](_0x198496[_0x37b2('0x3f')][_0x37b2('0x2b')]);_0x30dcb0[_0x37b2('0x29')]=qs[_0x37b2('0x29')](_0x198496[_0x37b2('0x3f')]['offset']);}return _0x3be084[_0x37b2('0x6a')](_0x30dcb0);}})['then'](function(_0x4abbbf){if(_0x4abbbf){return _0x4abbbf?{'count':_0x3798d4,'rows':_0x4abbbf}:null;}})[_0x37b2('0x36')](respondWithResult(_0x4b60b2,null))[_0x37b2('0x26')](handleError(_0x4b60b2,null));};exports[_0x37b2('0x6b')]=function(_0x2d6482,_0x1bbb2e,_0x4919a9){var _0x5159e1=_0x2d6482[_0x37b2('0x53')][_0x37b2('0x6c')];return db[_0x37b2('0x69')][_0x37b2('0x4e')]({'where':{'id':_0x5159e1},'attributes':['id'],'include':[{'model':db[_0x37b2('0x60')],'as':_0x37b2('0x6d'),'attributes':['id',_0x37b2('0x38'),'online',_0x37b2('0x6e'),_0x37b2('0x6f')],'raw':!![]}]})[_0x37b2('0x36')](function(_0x37501b){if(_0x37501b){var _0x1e1e49=_['flatMap'](_0x37501b,function(_0x1d923b){var _0xd64a66=_0x1d923b[_0x37b2('0x33')]({'plain':!![]});return _0xd64a66[_0x37b2('0x6d')];});return db['ChatQueue'][_0x37b2('0x57')]({'where':{'id':_0x2d6482[_0x37b2('0x59')]['id']}})[_0x37b2('0x36')](function(_0x266f15){return db[_0x37b2('0x70')][_0x37b2('0x71')](function(_0x35be63){return _0x266f15[_0x37b2('0x6b')](_0x5159e1,{'transaction':_0x35be63})[_0x37b2('0x36')](function(){return BPromise[_0x37b2('0x72')](_0x1e1e49,function(_0x3fdf26){return db[_0x37b2('0x5d')][_0x37b2('0x73')]({'where':{'UserId':_0x3fdf26['id'],'ChatQueueId':_0x2d6482[_0x37b2('0x59')]['id']},'transaction':_0x35be63});});})['then'](function(){_0x1e1e49[_0x37b2('0x74')](function(_0x2cf0b2){socket[_0x37b2('0x75')](_0x37b2('0x76'),{'UserId':_0x2cf0b2['id'],'ChatQueueId':_0x266f15['id']});});});});});}})[_0x37b2('0x36')](respondWithStatusCode(_0x1bbb2e,null))['catch'](handleError(_0x1bbb2e,null));};exports[_0x37b2('0x77')]=function(_0x50329,_0x5dfa92,_0x3a443e){return db[_0x37b2('0x69')]['findAll']({'where':{'id':_0x50329[_0x37b2('0x3f')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x37b2('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x37b2('0x36')](handleEntityNotFound(_0x5dfa92,null))[_0x37b2('0x36')](function(_0x1a28f3){var _0x416707=_['map'](_0x1a28f3,'id');var _0x3fdb8c=[];var _0x4204ad=[];var _0x5d70f5=squel[_0x37b2('0x78')]();_0x5d70f5['field']('tq.TeamId')[_0x37b2('0x79')]('team_has_chat_queues','tq')[_0x37b2('0x7a')]('user_has_teams','ut',_0x37b2('0x7b'))[_0x37b2('0x4a')](_0x37b2('0x7c'),_0x50329['params']['id']);for(var _0x21c145=0x0;_0x21c145<_0x1a28f3[_0x37b2('0x51')];_0x21c145+=0x1){let _0x5c073a=_0x1a28f3[_0x21c145];for(var _0x1be723=0x0;_0x1be723<_0x5c073a[_0x37b2('0x6d')][_0x37b2('0x51')];_0x1be723+=0x1){let _0x2d00d9=_0x5c073a['Agents'][_0x1be723];var _0x2bd589=_0x5d70f5['clone']();_0x2bd589[_0x37b2('0x4a')](_0x37b2('0x7d'),_0x2d00d9['id']);_0x4204ad[_0x37b2('0x7e')](db[_0x37b2('0x70')][_0x37b2('0x3f')](_0x2bd589[_0x37b2('0x7f')](),{'type':db[_0x37b2('0x70')][_0x37b2('0x80')][_0x37b2('0x81')]})[_0x37b2('0x36')](function(_0x578402){if(_0x578402['length']===0x1){return _0x2d00d9['id'];}else{var _0x1ea508=_[_0x37b2('0x82')](_[_0x37b2('0x3e')](_0x578402,_0x37b2('0x83')),function(_0x4068d8){return _['includes'](_0x416707,_0x4068d8);});if(_0x1ea508){return _0x2d00d9['id'];}}}));}}return BPromise['all'](_0x4204ad)[_0x37b2('0x36')](function(_0x1540cd){_0x3fdb8c=_(_0x3fdb8c)[_0x37b2('0x84')](_0x1540cd)['compact']()[_0x37b2('0x85')]();return db[_0x37b2('0x3a')][_0x37b2('0x57')]({'where':{'id':_0x50329[_0x37b2('0x59')]['id']}})[_0x37b2('0x36')](function(_0x514d89){return db[_0x37b2('0x70')]['transaction'](function(_0x3f8664){return _0x514d89[_0x37b2('0x77')](_0x50329[_0x37b2('0x3f')][_0x37b2('0x6c')],{'transaction':_0x3f8664})[_0x37b2('0x36')](function(){if(!_[_0x37b2('0x86')](_0x3fdb8c)){return _0x514d89['removeAgents'](_0x3fdb8c,{'transaction':_0x3f8664});}})[_0x37b2('0x36')](function(){_0x3fdb8c[_0x37b2('0x74')](function(_0x5d7825){socket[_0x37b2('0x75')](_0x37b2('0x87'),{'UserId':_0x5d7825,'ChatQueueId':_0x514d89['id']});});});});});});})[_0x37b2('0x36')](respondWithStatusCode(_0x5dfa92,null))['catch'](handleError(_0x5dfa92,null));};exports[_0x37b2('0x88')]=function(_0x19ea51,_0x404c52,_0x125bb8){return db['ChatQueue'][_0x37b2('0x57')]({'where':{'id':_0x19ea51[_0x37b2('0x59')]['id']}})[_0x37b2('0x36')](handleEntityNotFound(_0x404c52,null))[_0x37b2('0x36')](function(_0x52a891){if(_0x52a891){return _0x52a891['addAgents'](_0x19ea51[_0x37b2('0x53')][_0x37b2('0x6c')],_[_0x37b2('0x89')](_0x19ea51[_0x37b2('0x53')],[_0x37b2('0x6c'),'id'])||{})[_0x37b2('0x8a')](function(_0x21714f){for(var _0x52b9db=0x0;_0x52b9db<_0x19ea51['body']['ids'][_0x37b2('0x51')];_0x52b9db+=0x1){socket[_0x37b2('0x75')](_0x37b2('0x76'),{'UserId':Number(_0x19ea51['body'][_0x37b2('0x6c')][_0x52b9db]),'ChatQueueId':Number(_0x19ea51[_0x37b2('0x59')]['id'])});}return _0x21714f;});}})[_0x37b2('0x36')](respondWithResult(_0x404c52,null))['catch'](handleError(_0x404c52,null));};exports[_0x37b2('0x8b')]=function(_0x2f8393,_0x12d91a,_0x43b187){return db[_0x37b2('0x3a')][_0x37b2('0x57')]({'where':{'id':_0x2f8393['params']['id']}})[_0x37b2('0x36')](handleEntityNotFound(_0x12d91a,null))[_0x37b2('0x36')](function(_0x118c6c){if(_0x118c6c){return _0x118c6c['removeAgents'](_0x2f8393[_0x37b2('0x3f')]['ids'])[_0x37b2('0x36')](function(){if(_[_0x37b2('0x8c')](_0x2f8393[_0x37b2('0x3f')][_0x37b2('0x6c')])){for(var _0x10e08f=0x0;_0x10e08f<_0x2f8393[_0x37b2('0x3f')][_0x37b2('0x6c')][_0x37b2('0x51')];_0x10e08f+=0x1){socket[_0x37b2('0x75')](_0x37b2('0x87'),{'UserId':Number(_0x2f8393[_0x37b2('0x3f')][_0x37b2('0x6c')][_0x10e08f]),'ChatQueueId':Number(_0x2f8393['params']['id'])});}}else{socket[_0x37b2('0x75')](_0x37b2('0x87'),{'UserId':Number(_0x2f8393[_0x37b2('0x3f')][_0x37b2('0x6c')]),'ChatQueueId':Number(_0x2f8393[_0x37b2('0x59')]['id'])});}});}})[_0x37b2('0x36')](respondWithStatusCode(_0x12d91a,null))['catch'](handleError(_0x12d91a,null));};exports['getAgents']=function(_0x353a7e,_0x2b3094,_0x5e8ab4){var _0x159b00={};var _0x3d27ed={};var _0x134890;var _0x3f4ef2;return db[_0x37b2('0x3a')][_0x37b2('0x5c')]({'where':{'id':_0x353a7e[_0x37b2('0x59')]['id']}})[_0x37b2('0x36')](handleEntityNotFound(_0x2b3094,null))[_0x37b2('0x36')](function(_0x22118d){if(_0x22118d){_0x134890=_0x22118d;_0x3d27ed[_0x37b2('0x3d')]=_[_0x37b2('0x4f')](db[_0x37b2('0x60')][_0x37b2('0x50')]);_0x3d27ed[_0x37b2('0x3f')]=_['keys'](_0x353a7e['query']);_0x3d27ed[_0x37b2('0x40')]=_[_0x37b2('0x42')](_0x3d27ed['model'],_0x3d27ed[_0x37b2('0x3f')]);_0x159b00[_0x37b2('0x41')]=_['intersection'](_0x3d27ed[_0x37b2('0x3d')],qs['fields'](_0x353a7e[_0x37b2('0x3f')][_0x37b2('0x43')]));_0x159b00[_0x37b2('0x41')]=_0x159b00[_0x37b2('0x41')][_0x37b2('0x51')]?_0x159b00['attributes']:_0x3d27ed['model'];_0x159b00['order']=qs['sort'](_0x353a7e[_0x37b2('0x3f')][_0x37b2('0x46')]);_0x159b00[_0x37b2('0x4a')]=qs[_0x37b2('0x40')](_['pick'](_0x353a7e['query'],_0x3d27ed[_0x37b2('0x40')]));if(_0x353a7e[_0x37b2('0x3f')][_0x37b2('0x48')]){_0x159b00[_0x37b2('0x4a')]=_[_0x37b2('0x49')](_0x159b00[_0x37b2('0x4a')],{'$or':_[_0x37b2('0x3e')](_0x159b00[_0x37b2('0x41')],function(_0x30f780){var _0x30795d={};_0x30795d[_0x30f780]={'$like':'%'+_0x353a7e[_0x37b2('0x3f')][_0x37b2('0x48')]+'%'};return _0x30795d;})});}_0x159b00=_[_0x37b2('0x49')]({},_0x159b00,_0x353a7e['options']);return _0x134890['getAgents'](_0x159b00);}})['then'](function(_0x14e3a1){if(_0x14e3a1){_0x3f4ef2=_0x14e3a1[_0x37b2('0x51')];if(!_0x353a7e[_0x37b2('0x3f')][_0x37b2('0x44')](_0x37b2('0x45'))){_0x159b00[_0x37b2('0x2b')]=qs[_0x37b2('0x2b')](_0x353a7e[_0x37b2('0x3f')][_0x37b2('0x2b')]);_0x159b00[_0x37b2('0x29')]=qs[_0x37b2('0x29')](_0x353a7e[_0x37b2('0x3f')][_0x37b2('0x29')]);}return _0x134890[_0x37b2('0x8d')](_0x159b00);}})[_0x37b2('0x36')](function(_0x2d9471){if(_0x2d9471){return _0x2d9471?{'count':_0x3f4ef2,'rows':_0x2d9471}:null;}})['then'](respondWithResult(_0x2b3094,null))[_0x37b2('0x26')](handleError(_0x2b3094,null));};
\ No newline at end of file
+var _0xdb4c=['ChatQueueId','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','voicePause','interface','flatMap','each','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','sequelize','toString','every','all','union','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','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/utils','../../config/environment','../../config/license/util','defaults','redis','./chatQueue.socket','register','jayson/promise','request','then','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','filter','merge','VIRTUAL','options','include','ChatQueue','rows','show','params','includeAll','catch','create','body','user','UserProfileSection','userProfileId','autoAssociation','find','describe','getMembers','findOne','UserChatQueue','sort'];(function(_0x3ee361,_0x244c67){var _0x32a3d0=function(_0x238363){while(--_0x238363){_0x3ee361['push'](_0x3ee361['shift']());}};_0x32a3d0(++_0x244c67);}(_0xdb4c,0x15d));var _0xcdb4=function(_0x2d32f2,_0x267096){_0x2d32f2=_0x2d32f2-0x0;var _0xfb7da7=_0xdb4c[_0x2d32f2];return _0xfb7da7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcdb4('0x0'));var zipdir=require(_0xcdb4('0x1'));var jsonpatch=require(_0xcdb4('0x2'));var rp=require('request-promise');var moment=require(_0xcdb4('0x3'));var BPromise=require(_0xcdb4('0x4'));var Mustache=require(_0xcdb4('0x5'));var util=require(_0xcdb4('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xcdb4('0x7'));var ejs=require(_0xcdb4('0x8'));var fs=require('fs');var fs_extra=require(_0xcdb4('0x9'));var _=require(_0xcdb4('0xa'));var squel=require(_0xcdb4('0xb'));var crypto=require(_0xcdb4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xcdb4('0xd'));var toCsv=require(_0xcdb4('0x7'));var querystring=require(_0xcdb4('0xe'));var Papa=require(_0xcdb4('0xf'));var Redis=require(_0xcdb4('0x10'));var authService=require(_0xcdb4('0x11'));var qs=require(_0xcdb4('0x12'));var as=require(_0xcdb4('0x13'));var hardwareService=require(_0xcdb4('0x14'));var logger=require(_0xcdb4('0x15'))(_0xcdb4('0x16'));var utils=require(_0xcdb4('0x17'));var config=require(_0xcdb4('0x18'));var licenseUtil=require(_0xcdb4('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xcdb4('0x1a')](config[_0xcdb4('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcdb4('0x1b')]));require(_0xcdb4('0x1c'))[_0xcdb4('0x1d')](socket);var jayson=require(_0xcdb4('0x1e'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1734ff,_0x73edd3,_0x23cf16,_0x3e2b4d){return new BPromise(function(_0x6e2cf0,_0x4fd574){var _0x42cb56=_0x3e2b4d||client;return _0x42cb56[_0xcdb4('0x1f')](_0x1734ff,_0x23cf16)[_0xcdb4('0x20')](function(_0xca805a){logger[_0xcdb4('0x21')]('ChatQueue,\x20%s,\x20%s',_0x73edd3,'request\x20sent');logger[_0xcdb4('0x22')](_0xcdb4('0x23'),_0x73edd3,_0xcdb4('0x24'),JSON[_0xcdb4('0x25')](_0xca805a));if(_0xca805a[_0xcdb4('0x26')]){if(_0xca805a[_0xcdb4('0x26')][_0xcdb4('0x27')]===0x1f4){logger[_0xcdb4('0x26')]('ChatQueue,\x20%s,\x20%s',_0x73edd3,_0xca805a['error']['message']);return _0x4fd574(_0xca805a[_0xcdb4('0x26')][_0xcdb4('0x28')]);}logger[_0xcdb4('0x26')]('ChatQueue,\x20%s,\x20%s',_0x73edd3,_0xca805a[_0xcdb4('0x26')][_0xcdb4('0x28')]);return _0x6e2cf0(_0xca805a[_0xcdb4('0x26')][_0xcdb4('0x28')]);}else{logger[_0xcdb4('0x21')]('ChatQueue,\x20%s,\x20%s',_0x73edd3,'request\x20sent');_0x6e2cf0(_0xca805a[_0xcdb4('0x29')][_0xcdb4('0x28')]);}})['catch'](function(_0x522576){logger['error']('ChatQueue,\x20%s,\x20%s',_0x73edd3,_0x522576);_0x4fd574(_0x522576);});});}function respondWithStatusCode(_0x2cc561,_0x413bb4){_0x413bb4=_0x413bb4||0xcc;return function(_0x1c1dc6){if(_0x1c1dc6){return _0x2cc561[_0xcdb4('0x2a')](_0x413bb4);}return _0x2cc561[_0xcdb4('0x2b')](_0x413bb4)[_0xcdb4('0x2c')]();};}function respondWithResult(_0x25f11a,_0xa35c60){_0xa35c60=_0xa35c60||0xc8;return function(_0x4a8290){if(_0x4a8290){return _0x25f11a[_0xcdb4('0x2b')](_0xa35c60)[_0xcdb4('0x2d')](_0x4a8290);}};}function respondWithFilteredResult(_0x108bc6,_0x4023dd){return function(_0x433466){if(_0x433466){var _0x4c5e48=typeof _0x4023dd[_0xcdb4('0x2e')]===_0xcdb4('0x2f')&&typeof _0x4023dd['limit']==='undefined';var _0x476019=_0x433466[_0xcdb4('0x30')];var _0x40fd40=_0x4c5e48?0x0:_0x4023dd[_0xcdb4('0x2e')];var _0x1addb1=_0x4c5e48?_0x433466[_0xcdb4('0x30')]:_0x4023dd[_0xcdb4('0x2e')]+_0x4023dd['limit'];var _0x40ff05;if(_0x1addb1>=_0x476019){_0x1addb1=_0x476019;_0x40ff05=0xc8;}else{_0x40ff05=0xce;}_0x108bc6[_0xcdb4('0x2b')](_0x40ff05);return _0x108bc6[_0xcdb4('0x31')](_0xcdb4('0x32'),_0x40fd40+'-'+_0x1addb1+'/'+_0x476019)[_0xcdb4('0x2d')](_0x433466);}return null;};}function patchUpdates(_0x268eea){return function(_0x5e1bc4){try{jsonpatch[_0xcdb4('0x33')](_0x5e1bc4,_0x268eea,!![]);}catch(_0x237772){return BPromise['reject'](_0x237772);}return _0x5e1bc4[_0xcdb4('0x34')]();};}function saveUpdates(_0x34d817,_0x1730d0){return function(_0x417d43){if(_0x417d43){return _0x417d43[_0xcdb4('0x35')](_0x34d817)['then'](function(_0xdc82f8){return _0xdc82f8;});}return null;};}function removeEntity(_0x1b112c,_0x4f51fd){return function(_0xbc2940){if(_0xbc2940){return _0xbc2940[_0xcdb4('0x36')]()['then'](function(){var _0x4e2f27=_0xbc2940[_0xcdb4('0x37')]({'plain':!![]});var _0x3eeb00=_0xcdb4('0x38');return db[_0xcdb4('0x39')][_0xcdb4('0x36')]({'where':{'type':_0x3eeb00,'resourceId':_0x4e2f27['id']}})['then'](function(){return _0xbc2940;});})[_0xcdb4('0x20')](function(){_0x1b112c[_0xcdb4('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a947f,_0x355613){return function(_0x53aa81){if(!_0x53aa81){_0x2a947f[_0xcdb4('0x2a')](0x194);}return _0x53aa81;};}function handleError(_0xa2fa74,_0xc8915a){_0xc8915a=_0xc8915a||0x1f4;return function(_0x46d82f){logger[_0xcdb4('0x26')](_0x46d82f[_0xcdb4('0x3a')]);if(_0x46d82f[_0xcdb4('0x3b')]){delete _0x46d82f[_0xcdb4('0x3b')];}_0xa2fa74[_0xcdb4('0x2b')](_0xc8915a)[_0xcdb4('0x3c')](_0x46d82f);};}exports[_0xcdb4('0x3d')]=function(_0xea3b6a,_0x8f0890){var _0x2a68f4={},_0x3e454d={},_0x50e267={'count':0x0,'rows':[]};var _0xb2fb8b=_[_0xcdb4('0x3e')](db['ChatQueue'][_0xcdb4('0x3f')],function(_0x2a053c){return{'name':_0x2a053c[_0xcdb4('0x40')],'type':_0x2a053c[_0xcdb4('0x41')][_0xcdb4('0x42')]};});_0x3e454d[_0xcdb4('0x43')]=_['map'](_0xb2fb8b,_0xcdb4('0x3b'));_0x3e454d[_0xcdb4('0x44')]=_[_0xcdb4('0x45')](_0xea3b6a[_0xcdb4('0x44')]);_0x3e454d[_0xcdb4('0x46')]=_[_0xcdb4('0x47')](_0x3e454d['model'],_0x3e454d[_0xcdb4('0x44')]);_0x2a68f4[_0xcdb4('0x48')]=_[_0xcdb4('0x47')](_0x3e454d[_0xcdb4('0x43')],qs['fields'](_0xea3b6a['query'][_0xcdb4('0x49')]));_0x2a68f4[_0xcdb4('0x48')]=_0x2a68f4[_0xcdb4('0x48')][_0xcdb4('0x4a')]?_0x2a68f4[_0xcdb4('0x48')]:_0x3e454d[_0xcdb4('0x43')];if(!_0xea3b6a[_0xcdb4('0x44')][_0xcdb4('0x4b')](_0xcdb4('0x4c'))){_0x2a68f4[_0xcdb4('0x4d')]=qs[_0xcdb4('0x4d')](_0xea3b6a[_0xcdb4('0x44')][_0xcdb4('0x4d')]);_0x2a68f4[_0xcdb4('0x2e')]=qs[_0xcdb4('0x2e')](_0xea3b6a[_0xcdb4('0x44')][_0xcdb4('0x2e')]);}_0x2a68f4[_0xcdb4('0x4e')]=qs['sort'](_0xea3b6a[_0xcdb4('0x44')]['sort']);_0x2a68f4[_0xcdb4('0x4f')]=qs[_0xcdb4('0x46')](_[_0xcdb4('0x50')](_0xea3b6a[_0xcdb4('0x44')],_0x3e454d['filters']),_0xb2fb8b);if(_0xea3b6a[_0xcdb4('0x44')][_0xcdb4('0x51')]){_0x2a68f4['where']=_[_0xcdb4('0x52')](_0x2a68f4[_0xcdb4('0x4f')],{'$or':_[_0xcdb4('0x3e')](_0xb2fb8b,function(_0x263ae3){if(_0x263ae3[_0xcdb4('0x41')]!==_0xcdb4('0x53')){var _0x3e3ae6={};_0x3e3ae6[_0x263ae3[_0xcdb4('0x3b')]]={'$like':'%'+_0xea3b6a[_0xcdb4('0x44')][_0xcdb4('0x51')]+'%'};return _0x3e3ae6;}})});}_0x2a68f4=_[_0xcdb4('0x52')]({},_0x2a68f4,_0xea3b6a[_0xcdb4('0x54')]);var _0x38eb51={'where':_0x2a68f4[_0xcdb4('0x4f')]};return db['ChatQueue'][_0xcdb4('0x30')](_0x38eb51)[_0xcdb4('0x20')](function(_0x3af190){_0x50e267[_0xcdb4('0x30')]=_0x3af190;if(_0xea3b6a['query']['includeAll']){_0x2a68f4[_0xcdb4('0x55')]=[{'all':!![]}];}return db[_0xcdb4('0x56')]['findAll'](_0x2a68f4);})['then'](function(_0xa65250){_0x50e267[_0xcdb4('0x57')]=_0xa65250;return _0x50e267;})['then'](respondWithFilteredResult(_0x8f0890,_0x2a68f4))['catch'](handleError(_0x8f0890,null));};exports[_0xcdb4('0x58')]=function(_0x2f1220,_0x14710b){var _0x2c29f={'raw':!![],'where':{'id':_0x2f1220[_0xcdb4('0x59')]['id']}},_0x2f0737={};_0x2f0737[_0xcdb4('0x43')]=_[_0xcdb4('0x45')](db['ChatQueue'][_0xcdb4('0x3f')]);_0x2f0737[_0xcdb4('0x44')]=_[_0xcdb4('0x45')](_0x2f1220[_0xcdb4('0x44')]);_0x2f0737[_0xcdb4('0x46')]=_[_0xcdb4('0x47')](_0x2f0737['model'],_0x2f0737['query']);_0x2c29f[_0xcdb4('0x48')]=_['intersection'](_0x2f0737[_0xcdb4('0x43')],qs[_0xcdb4('0x49')](_0x2f1220[_0xcdb4('0x44')][_0xcdb4('0x49')]));_0x2c29f[_0xcdb4('0x48')]=_0x2c29f[_0xcdb4('0x48')][_0xcdb4('0x4a')]?_0x2c29f[_0xcdb4('0x48')]:_0x2f0737['model'];if(_0x2f1220['query'][_0xcdb4('0x5a')]){_0x2c29f[_0xcdb4('0x55')]=[{'all':!![]}];}_0x2c29f=_[_0xcdb4('0x52')]({},_0x2c29f,_0x2f1220[_0xcdb4('0x54')]);return db[_0xcdb4('0x56')]['find'](_0x2c29f)['then'](handleEntityNotFound(_0x14710b,null))[_0xcdb4('0x20')](respondWithResult(_0x14710b,null))[_0xcdb4('0x5b')](handleError(_0x14710b,null));};exports[_0xcdb4('0x5c')]=function(_0x269d32,_0x4a835){return db[_0xcdb4('0x56')][_0xcdb4('0x5c')](_0x269d32[_0xcdb4('0x5d')],{})[_0xcdb4('0x20')](function(_0xc2dc34){var _0x414f39=_0x269d32[_0xcdb4('0x5e')][_0xcdb4('0x37')]({'plain':!![]});if(!_0x414f39)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x414f39['role']===_0xcdb4('0x5e')){var _0x7addd3=_0xc2dc34[_0xcdb4('0x37')]({'plain':!![]});var _0x1bc0d7=_0xcdb4('0x38');return db[_0xcdb4('0x5f')]['find']({'where':{'name':_0x1bc0d7,'userProfileId':_0x414f39[_0xcdb4('0x60')]},'raw':!![]})['then'](function(_0x41d2e8){if(_0x41d2e8&&_0x41d2e8[_0xcdb4('0x61')]===0x0){return db[_0xcdb4('0x39')]['create']({'name':_0x7addd3['name'],'resourceId':_0x7addd3['id'],'type':_0x41d2e8[_0xcdb4('0x3b')],'sectionId':_0x41d2e8['id']},{})[_0xcdb4('0x20')](function(){return _0xc2dc34;});}else{return _0xc2dc34;}})[_0xcdb4('0x5b')](function(_0x4b6ab2){logger[_0xcdb4('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b6ab2);throw _0x4b6ab2;});}return _0xc2dc34;})[_0xcdb4('0x20')](respondWithResult(_0x4a835,0xc9))[_0xcdb4('0x5b')](handleError(_0x4a835,null));};exports[_0xcdb4('0x35')]=function(_0x4c3ac2,_0x2ec81d){if(_0x4c3ac2[_0xcdb4('0x5d')]['id']){delete _0x4c3ac2['body']['id'];}return db[_0xcdb4('0x56')][_0xcdb4('0x62')]({'where':{'id':_0x4c3ac2[_0xcdb4('0x59')]['id']}})[_0xcdb4('0x20')](handleEntityNotFound(_0x2ec81d,null))[_0xcdb4('0x20')](saveUpdates(_0x4c3ac2[_0xcdb4('0x5d')],null))['then'](respondWithResult(_0x2ec81d,null))[_0xcdb4('0x5b')](handleError(_0x2ec81d,null));};exports[_0xcdb4('0x36')]=function(_0x2c190f,_0x4413bc){return db[_0xcdb4('0x56')][_0xcdb4('0x62')]({'where':{'id':_0x2c190f[_0xcdb4('0x59')]['id']}})[_0xcdb4('0x20')](handleEntityNotFound(_0x4413bc,null))[_0xcdb4('0x20')](removeEntity(_0x4413bc,null))['catch'](handleError(_0x4413bc,null));};exports[_0xcdb4('0x63')]=function(_0x3104f8,_0x40ebfc){return db[_0xcdb4('0x56')][_0xcdb4('0x63')]()[_0xcdb4('0x20')](respondWithResult(_0x40ebfc,null))[_0xcdb4('0x5b')](handleError(_0x40ebfc,null));};exports[_0xcdb4('0x64')]=function(_0x27d772,_0x58f6ac,_0x4262f4){var _0x2d2bb5={'raw':!![],'where':{}},_0x5573f4={},_0x328ec9;return db[_0xcdb4('0x56')][_0xcdb4('0x65')]({'where':{'id':_0x27d772[_0xcdb4('0x59')]['id']}})[_0xcdb4('0x20')](handleEntityNotFound(_0x58f6ac,null))[_0xcdb4('0x20')](function(_0x37b007){if(_0x37b007){_0x328ec9=_0x37b007['get']({'plain':!![]});_0x5573f4[_0xcdb4('0x43')]=_['keys'](db[_0xcdb4('0x66')][_0xcdb4('0x3f')]);_0x5573f4[_0xcdb4('0x44')]=_[_0xcdb4('0x45')](_0x27d772[_0xcdb4('0x44')]);_0x5573f4['filters']=_[_0xcdb4('0x47')](_0x5573f4[_0xcdb4('0x43')],_0x5573f4[_0xcdb4('0x44')]);_0x2d2bb5[_0xcdb4('0x48')]=_[_0xcdb4('0x47')](_0x5573f4[_0xcdb4('0x43')],qs[_0xcdb4('0x49')](_0x27d772[_0xcdb4('0x44')][_0xcdb4('0x49')]));_0x2d2bb5[_0xcdb4('0x48')]=_0x2d2bb5['attributes'][_0xcdb4('0x4a')]?_0x2d2bb5[_0xcdb4('0x48')]:_0x5573f4[_0xcdb4('0x43')];if(!_0x27d772[_0xcdb4('0x44')][_0xcdb4('0x4b')]('nolimit')){_0x2d2bb5[_0xcdb4('0x4d')]=qs[_0xcdb4('0x4d')](_0x27d772['query'][_0xcdb4('0x4d')]);_0x2d2bb5['offset']=qs['offset'](_0x27d772[_0xcdb4('0x44')][_0xcdb4('0x2e')]);}_0x2d2bb5[_0xcdb4('0x4e')]=qs[_0xcdb4('0x67')](_0x27d772[_0xcdb4('0x44')][_0xcdb4('0x67')]);_0x2d2bb5[_0xcdb4('0x4f')]=qs[_0xcdb4('0x46')](_[_0xcdb4('0x50')](_0x27d772['query'],_0x5573f4[_0xcdb4('0x46')]));_0x2d2bb5[_0xcdb4('0x4f')][_0xcdb4('0x68')]=_0x37b007['id'];if(_0x27d772[_0xcdb4('0x44')][_0xcdb4('0x51')]){_0x2d2bb5[_0xcdb4('0x4f')]=_[_0xcdb4('0x52')](_0x2d2bb5[_0xcdb4('0x4f')],{'$or':_[_0xcdb4('0x3e')](_0x2d2bb5[_0xcdb4('0x48')],function(_0x46fbcb){var _0x2b1ce3={};_0x2b1ce3[_0x46fbcb]={'$like':'%'+_0x27d772['query']['filter']+'%'};return _0x2b1ce3;})});}_0x2d2bb5=_['merge']({},_0x2d2bb5,_0x27d772[_0xcdb4('0x54')]);return db[_0xcdb4('0x66')][_0xcdb4('0x69')](_0x2d2bb5);}})[_0xcdb4('0x20')](function(_0x55287e){if(_0x55287e){return db[_0xcdb4('0x6a')][_0xcdb4('0x6b')]({'where':{'id':_[_0xcdb4('0x3e')](_0x55287e,_0xcdb4('0x6c')),'role':_0xcdb4('0x6d')},'attributes':['id','name',_0xcdb4('0x6e'),_0xcdb4('0x6f'),_0xcdb4('0x70')]});}})[_0xcdb4('0x20')](function(_0x22f49b){if(_0x22f49b){return{'count':_0x22f49b[_0xcdb4('0x30')],'rows':_[_0xcdb4('0x3e')](_0x22f49b['rows'],function(_0x2c3e8b){return{'membername':_0x2c3e8b[_0xcdb4('0x3b')],'UserId':_0x2c3e8b['id'],'queue_name':_0x328ec9[_0xcdb4('0x3b')],'ChatQueueId':_0x328ec9['id'],'interface':util[_0xcdb4('0x71')](_0xcdb4('0x72'),_0xcdb4('0x73'),_0x2c3e8b[_0xcdb4('0x3b')]),'penalty':0x0,'paused':_0x2c3e8b[_0xcdb4('0x6e')],'createdAt':_0x2c3e8b[_0xcdb4('0x70')],'updatedAt':_0x2c3e8b[_0xcdb4('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xcdb4('0x20')](respondWithFilteredResult(_0x58f6ac,_0x2d2bb5))[_0xcdb4('0x5b')](handleError(_0x58f6ac,null));};exports[_0xcdb4('0x74')]=function(_0x329a07,_0x202204,_0xb99ccd){var _0x98a008={};var _0x39523b={};var _0x3044ad;var _0xea0fd0;return db[_0xcdb4('0x56')][_0xcdb4('0x65')]({'where':{'id':_0x329a07['params']['id']}})[_0xcdb4('0x20')](handleEntityNotFound(_0x202204,null))['then'](function(_0x35afe7){if(_0x35afe7){_0x3044ad=_0x35afe7;_0x39523b[_0xcdb4('0x43')]=_[_0xcdb4('0x45')](db[_0xcdb4('0x75')][_0xcdb4('0x3f')]);_0x39523b[_0xcdb4('0x44')]=_[_0xcdb4('0x45')](_0x329a07['query']);_0x39523b[_0xcdb4('0x46')]=_[_0xcdb4('0x47')](_0x39523b[_0xcdb4('0x43')],_0x39523b[_0xcdb4('0x44')]);_0x98a008['attributes']=_[_0xcdb4('0x47')](_0x39523b[_0xcdb4('0x43')],qs[_0xcdb4('0x49')](_0x329a07[_0xcdb4('0x44')][_0xcdb4('0x49')]));_0x98a008[_0xcdb4('0x48')]=_0x98a008[_0xcdb4('0x48')]['length']?_0x98a008['attributes']:_0x39523b[_0xcdb4('0x43')];_0x98a008[_0xcdb4('0x4e')]=qs[_0xcdb4('0x67')](_0x329a07[_0xcdb4('0x44')][_0xcdb4('0x67')]);_0x98a008['where']=qs[_0xcdb4('0x46')](_[_0xcdb4('0x50')](_0x329a07[_0xcdb4('0x44')],_0x39523b['filters']));if(_0x329a07[_0xcdb4('0x44')]['filter']){_0x98a008[_0xcdb4('0x4f')]=_[_0xcdb4('0x52')](_0x98a008[_0xcdb4('0x4f')],{'$or':_['map'](_0x98a008[_0xcdb4('0x48')],function(_0x38e5e0){var _0xf1aa83={};_0xf1aa83[_0x38e5e0]={'$like':'%'+_0x329a07[_0xcdb4('0x44')]['filter']+'%'};return _0xf1aa83;})});}_0x98a008=_[_0xcdb4('0x52')]({},_0x98a008,_0x329a07[_0xcdb4('0x54')]);return _0x3044ad[_0xcdb4('0x74')](_0x98a008);}})[_0xcdb4('0x20')](function(_0x12c869){if(_0x12c869){_0xea0fd0=_0x12c869[_0xcdb4('0x4a')];if(!_0x329a07[_0xcdb4('0x44')][_0xcdb4('0x4b')](_0xcdb4('0x4c'))){_0x98a008[_0xcdb4('0x4d')]=qs[_0xcdb4('0x4d')](_0x329a07[_0xcdb4('0x44')]['limit']);_0x98a008[_0xcdb4('0x2e')]=qs[_0xcdb4('0x2e')](_0x329a07[_0xcdb4('0x44')][_0xcdb4('0x2e')]);}return _0x3044ad[_0xcdb4('0x74')](_0x98a008);}})[_0xcdb4('0x20')](function(_0x5e1681){if(_0x5e1681){return _0x5e1681?{'count':_0xea0fd0,'rows':_0x5e1681}:null;}})[_0xcdb4('0x20')](respondWithResult(_0x202204,null))[_0xcdb4('0x5b')](handleError(_0x202204,null));};exports[_0xcdb4('0x76')]=function(_0xf96867,_0x5eee36,_0x460d15){var _0x3a45e6=_0xf96867['body'][_0xcdb4('0x77')];return db['Team'][_0xcdb4('0x69')]({'where':{'id':_0x3a45e6},'attributes':['id'],'include':[{'model':db[_0xcdb4('0x6a')],'as':_0xcdb4('0x78'),'attributes':['id','name','online',_0xcdb4('0x79'),_0xcdb4('0x7a')],'raw':!![]}]})[_0xcdb4('0x20')](function(_0x5e8581){if(_0x5e8581){var _0x3da204=_[_0xcdb4('0x7b')](_0x5e8581,function(_0x181730){var _0x519027=_0x181730[_0xcdb4('0x37')]({'plain':!![]});return _0x519027[_0xcdb4('0x78')];});return db[_0xcdb4('0x56')][_0xcdb4('0x62')]({'where':{'id':_0xf96867['params']['id']}})[_0xcdb4('0x20')](function(_0x13004e){return db['sequelize']['transaction'](function(_0x27b80a){return _0x13004e[_0xcdb4('0x76')](_0x3a45e6,{'transaction':_0x27b80a})[_0xcdb4('0x20')](function(){return BPromise[_0xcdb4('0x7c')](_0x3da204,function(_0x170f6b){return db[_0xcdb4('0x66')]['findOrCreate']({'where':{'UserId':_0x170f6b['id'],'ChatQueueId':_0xf96867['params']['id']},'transaction':_0x27b80a});});})[_0xcdb4('0x20')](function(){_0x3da204[_0xcdb4('0x7d')](function(_0x588f01){socket[_0xcdb4('0x7e')](_0xcdb4('0x7f'),{'UserId':_0x588f01['id'],'ChatQueueId':_0x13004e['id']});});});});});}})['then'](respondWithStatusCode(_0x5eee36,null))[_0xcdb4('0x5b')](handleError(_0x5eee36,null));};exports[_0xcdb4('0x80')]=function(_0x3b21f6,_0x483494,_0x335b65){return db[_0xcdb4('0x75')][_0xcdb4('0x69')]({'where':{'id':_0x3b21f6[_0xcdb4('0x44')][_0xcdb4('0x77')]},'attributes':['id'],'include':[{'model':db[_0xcdb4('0x6a')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xcdb4('0x20')](handleEntityNotFound(_0x483494,null))['then'](function(_0x3359d3){var _0x32526d=_[_0xcdb4('0x3e')](_0x3359d3,'id');var _0x29f109=[];var _0x828c2f=[];var _0xc74918=squel['select']();_0xc74918[_0xcdb4('0x81')](_0xcdb4('0x82'))[_0xcdb4('0x83')](_0xcdb4('0x84'),'tq')[_0xcdb4('0x85')](_0xcdb4('0x86'),'ut',_0xcdb4('0x87'))[_0xcdb4('0x4f')](_0xcdb4('0x88'),_0x3b21f6[_0xcdb4('0x59')]['id']);for(var _0x33bd67=0x0;_0x33bd67<_0x3359d3[_0xcdb4('0x4a')];_0x33bd67+=0x1){let _0x470142=_0x3359d3[_0x33bd67];for(var _0x1b63fe=0x0;_0x1b63fe<_0x470142[_0xcdb4('0x78')]['length'];_0x1b63fe+=0x1){let _0x23ea1b=_0x470142['Agents'][_0x1b63fe];var _0x43fe66=_0xc74918[_0xcdb4('0x89')]();_0x43fe66[_0xcdb4('0x4f')]('ut.UserId\x20=\x20?',_0x23ea1b['id']);_0x828c2f['push'](db[_0xcdb4('0x8a')][_0xcdb4('0x44')](_0x43fe66[_0xcdb4('0x8b')](),{'type':db[_0xcdb4('0x8a')]['QueryTypes']['SELECT']})['then'](function(_0x9eb06c){if(_0x9eb06c['length']===0x1){return _0x23ea1b['id'];}else{var _0x52739e=_[_0xcdb4('0x8c')](_[_0xcdb4('0x3e')](_0x9eb06c,'TeamId'),function(_0x5e6898){return _['includes'](_0x32526d,_0x5e6898);});if(_0x52739e){return _0x23ea1b['id'];}}}));}}return BPromise[_0xcdb4('0x8d')](_0x828c2f)['then'](function(_0x4b4794){_0x29f109=_(_0x29f109)[_0xcdb4('0x8e')](_0x4b4794)['compact']()[_0xcdb4('0x8f')]();return db['ChatQueue'][_0xcdb4('0x62')]({'where':{'id':_0x3b21f6[_0xcdb4('0x59')]['id']}})[_0xcdb4('0x20')](function(_0x146a82){return db[_0xcdb4('0x8a')]['transaction'](function(_0x3a2ce4){return _0x146a82['removeTeams'](_0x3b21f6['query'][_0xcdb4('0x77')],{'transaction':_0x3a2ce4})[_0xcdb4('0x20')](function(){if(!_[_0xcdb4('0x90')](_0x29f109)){return _0x146a82[_0xcdb4('0x91')](_0x29f109,{'transaction':_0x3a2ce4});}})[_0xcdb4('0x20')](function(){_0x29f109[_0xcdb4('0x7d')](function(_0x2887d4){socket['emit'](_0xcdb4('0x92'),{'UserId':_0x2887d4,'ChatQueueId':_0x146a82['id']});});});});});});})[_0xcdb4('0x20')](respondWithStatusCode(_0x483494,null))[_0xcdb4('0x5b')](handleError(_0x483494,null));};exports[_0xcdb4('0x93')]=function(_0x32482c,_0x376044,_0x507d8b){return db[_0xcdb4('0x56')][_0xcdb4('0x62')]({'where':{'id':_0x32482c[_0xcdb4('0x59')]['id']}})[_0xcdb4('0x20')](handleEntityNotFound(_0x376044,null))['then'](function(_0x2670cc){if(_0x2670cc){return _0x2670cc[_0xcdb4('0x93')](_0x32482c[_0xcdb4('0x5d')]['ids'],_['omit'](_0x32482c[_0xcdb4('0x5d')],[_0xcdb4('0x77'),'id'])||{})[_0xcdb4('0x94')](function(_0x2e2ec9){for(var _0x1c4f73=0x0;_0x1c4f73<_0x32482c[_0xcdb4('0x5d')]['ids'][_0xcdb4('0x4a')];_0x1c4f73+=0x1){socket[_0xcdb4('0x7e')]('userChatQueue:save',{'UserId':Number(_0x32482c[_0xcdb4('0x5d')][_0xcdb4('0x77')][_0x1c4f73]),'ChatQueueId':Number(_0x32482c['params']['id'])});}return _0x2e2ec9;});}})[_0xcdb4('0x20')](respondWithResult(_0x376044,null))['catch'](handleError(_0x376044,null));};exports['removeAgents']=function(_0x1c73f9,_0x6961c6,_0x1aa3e1){return db[_0xcdb4('0x56')][_0xcdb4('0x62')]({'where':{'id':_0x1c73f9[_0xcdb4('0x59')]['id']}})[_0xcdb4('0x20')](handleEntityNotFound(_0x6961c6,null))[_0xcdb4('0x20')](function(_0x4b1e22){if(_0x4b1e22){return _0x4b1e22[_0xcdb4('0x91')](_0x1c73f9[_0xcdb4('0x44')][_0xcdb4('0x77')])[_0xcdb4('0x20')](function(){if(_[_0xcdb4('0x95')](_0x1c73f9[_0xcdb4('0x44')][_0xcdb4('0x77')])){for(var _0x44957e=0x0;_0x44957e<_0x1c73f9[_0xcdb4('0x44')][_0xcdb4('0x77')][_0xcdb4('0x4a')];_0x44957e+=0x1){socket[_0xcdb4('0x7e')]('userChatQueue:remove',{'UserId':Number(_0x1c73f9[_0xcdb4('0x44')]['ids'][_0x44957e]),'ChatQueueId':Number(_0x1c73f9[_0xcdb4('0x59')]['id'])});}}else{socket[_0xcdb4('0x7e')]('userChatQueue:remove',{'UserId':Number(_0x1c73f9[_0xcdb4('0x44')][_0xcdb4('0x77')]),'ChatQueueId':Number(_0x1c73f9[_0xcdb4('0x59')]['id'])});}});}})[_0xcdb4('0x20')](respondWithStatusCode(_0x6961c6,null))[_0xcdb4('0x5b')](handleError(_0x6961c6,null));};exports[_0xcdb4('0x96')]=function(_0x1b330a,_0x4a9a98,_0x38641a){var _0x2b3e16={};var _0xbd351b={};var _0x46e271;var _0x3e0132;return db[_0xcdb4('0x56')][_0xcdb4('0x65')]({'where':{'id':_0x1b330a[_0xcdb4('0x59')]['id']}})[_0xcdb4('0x20')](handleEntityNotFound(_0x4a9a98,null))['then'](function(_0x3f2b18){if(_0x3f2b18){_0x46e271=_0x3f2b18;_0xbd351b[_0xcdb4('0x43')]=_[_0xcdb4('0x45')](db[_0xcdb4('0x6a')][_0xcdb4('0x3f')]);_0xbd351b[_0xcdb4('0x44')]=_[_0xcdb4('0x45')](_0x1b330a[_0xcdb4('0x44')]);_0xbd351b['filters']=_[_0xcdb4('0x47')](_0xbd351b[_0xcdb4('0x43')],_0xbd351b[_0xcdb4('0x44')]);_0x2b3e16[_0xcdb4('0x48')]=_[_0xcdb4('0x47')](_0xbd351b[_0xcdb4('0x43')],qs[_0xcdb4('0x49')](_0x1b330a[_0xcdb4('0x44')][_0xcdb4('0x49')]));_0x2b3e16[_0xcdb4('0x48')]=_0x2b3e16['attributes'][_0xcdb4('0x4a')]?_0x2b3e16[_0xcdb4('0x48')]:_0xbd351b[_0xcdb4('0x43')];_0x2b3e16[_0xcdb4('0x4e')]=qs[_0xcdb4('0x67')](_0x1b330a[_0xcdb4('0x44')][_0xcdb4('0x67')]);_0x2b3e16['where']=qs[_0xcdb4('0x46')](_['pick'](_0x1b330a['query'],_0xbd351b[_0xcdb4('0x46')]));if(_0x1b330a[_0xcdb4('0x44')]['filter']){_0x2b3e16['where']=_[_0xcdb4('0x52')](_0x2b3e16['where'],{'$or':_[_0xcdb4('0x3e')](_0x2b3e16[_0xcdb4('0x48')],function(_0x4d446d){var _0x90f4e3={};_0x90f4e3[_0x4d446d]={'$like':'%'+_0x1b330a[_0xcdb4('0x44')][_0xcdb4('0x51')]+'%'};return _0x90f4e3;})});}_0x2b3e16=_['merge']({},_0x2b3e16,_0x1b330a[_0xcdb4('0x54')]);return _0x46e271['getAgents'](_0x2b3e16);}})[_0xcdb4('0x20')](function(_0xa85dde){if(_0xa85dde){_0x3e0132=_0xa85dde[_0xcdb4('0x4a')];if(!_0x1b330a[_0xcdb4('0x44')][_0xcdb4('0x4b')]('nolimit')){_0x2b3e16['limit']=qs[_0xcdb4('0x4d')](_0x1b330a['query']['limit']);_0x2b3e16[_0xcdb4('0x2e')]=qs[_0xcdb4('0x2e')](_0x1b330a['query'][_0xcdb4('0x2e')]);}return _0x46e271['getAgents'](_0x2b3e16);}})[_0xcdb4('0x20')](function(_0x259348){if(_0x259348){return _0x259348?{'count':_0x3e0132,'rows':_0x259348}:null;}})[_0xcdb4('0x20')](respondWithResult(_0x4a9a98,null))['catch'](handleError(_0x4a9a98,null));};
\ No newline at end of file
index 905bc63..ba2b28b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf464=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','emit'];(function(_0x5ec453,_0x30b0ba){var _0x25548f=function(_0x387b62){while(--_0x387b62){_0x5ec453['push'](_0x5ec453['shift']());}};_0x25548f(++_0x30b0ba);}(_0xf464,0x161));var _0x4f46=function(_0x36e41b,_0x320627){_0x36e41b=_0x36e41b-0x0;var _0x40e228=_0xf464[_0x36e41b];return _0x40e228;};'use strict';var EventEmitter=require(_0x4f46('0x0'));var ChatQueue=require(_0x4f46('0x1'))['db'][_0x4f46('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4f46('0x3')](0x0);var events={'afterCreate':_0x4f46('0x4'),'afterUpdate':_0x4f46('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3535e6){return function(_0x44de5a,_0x33853e,_0x4230dc){ChatQueueEvents[_0x4f46('0x6')](_0x3535e6+':'+_0x44de5a['id'],_0x44de5a);ChatQueueEvents[_0x4f46('0x6')](_0x3535e6,_0x44de5a);_0x4230dc(null);};}for(var e in events){if(events[_0x4f46('0x7')](e)){var event=events[e];ChatQueue[_0x4f46('0x8')](e,emitEvent(event));}}module[_0x4f46('0x9')]=ChatQueueEvents;
\ No newline at end of file
+var _0x6d37=['exports','events','../../mysqldb','ChatQueue','save','update','emit','hasOwnProperty','hook'];(function(_0xebc64a,_0x440ee2){var _0x5131e1=function(_0x2d3720){while(--_0x2d3720){_0xebc64a['push'](_0xebc64a['shift']());}};_0x5131e1(++_0x440ee2);}(_0x6d37,0x88));var _0x76d3=function(_0x4b7b82,_0x1320db){_0x4b7b82=_0x4b7b82-0x0;var _0x3e9a63=_0x6d37[_0x4b7b82];return _0x3e9a63;};'use strict';var EventEmitter=require(_0x76d3('0x0'));var ChatQueue=require(_0x76d3('0x1'))['db'][_0x76d3('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x76d3('0x3'),'afterUpdate':_0x76d3('0x4'),'afterDestroy':'remove'};function emitEvent(_0xe78bc7){return function(_0x77d567,_0x1694eb,_0x43d29b){ChatQueueEvents[_0x76d3('0x5')](_0xe78bc7+':'+_0x77d567['id'],_0x77d567);ChatQueueEvents[_0x76d3('0x5')](_0xe78bc7,_0x77d567);_0x43d29b(null);};}for(var e in events){if(events[_0x76d3('0x6')](e)){var event=events[e];ChatQueue[_0x76d3('0x7')](e,emitEvent(event));}}module[_0x76d3('0x8')]=ChatQueueEvents;
\ No newline at end of file
index 23b04f7..8c1d7da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2e1=['./chatQueue.attributes','exports','define','ChatQueue','../../config/logger','api','bluebird','rimraf','../../config/environment'];(function(_0x5c2a64,_0x4d73d1){var _0x97eb2c=function(_0x191d14){while(--_0x191d14){_0x5c2a64['push'](_0x5c2a64['shift']());}};_0x97eb2c(++_0x4d73d1);}(_0xb2e1,0x70));var _0x1b2e=function(_0x25a4a1,_0x516862){_0x25a4a1=_0x25a4a1-0x0;var _0x3cac71=_0xb2e1[_0x25a4a1];return _0x3cac71;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1b2e('0x0'))(_0x1b2e('0x1'));var moment=require('moment');var BPromise=require(_0x1b2e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1b2e('0x3'));var config=require(_0x1b2e('0x4'));var attributes=require(_0x1b2e('0x5'));module[_0x1b2e('0x6')]=function(_0x5cca0c,_0xf5ef12){return _0x5cca0c[_0x1b2e('0x7')](_0x1b2e('0x8'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5d50=['./chatQueue.attributes','exports','define','ChatQueue','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x2df833,_0x5a8075){var _0x504939=function(_0x5030b5){while(--_0x5030b5){_0x2df833['push'](_0x2df833['shift']());}};_0x504939(++_0x5a8075);}(_0x5d50,0x117));var _0x05d5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d50[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x05d5('0x0'));var logger=require(_0x05d5('0x1'))('api');var moment=require(_0x05d5('0x2'));var BPromise=require(_0x05d5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x05d5('0x4'));var rimraf=require(_0x05d5('0x5'));var config=require(_0x05d5('0x6'));var attributes=require(_0x05d5('0x7'));module[_0x05d5('0x8')]=function(_0x3c64ee,_0x39837f){return _0x3c64ee[_0x05d5('0x9')](_0x05d5('0xa'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b3031f1..315c8b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f95=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','register','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','findAll','options','where','limit','map','include','model','attributes','GetChatQueue','ShowChatQueue','raw','lodash'];(function(_0x3b085,_0x250543){var _0x476a57=function(_0x480941){while(--_0x480941){_0x3b085['push'](_0x3b085['shift']());}};_0x476a57(++_0x250543);}(_0x9f95,0x97));var _0x59f9=function(_0x3f2b05,_0x53adad){_0x3f2b05=_0x3f2b05-0x0;var _0x3061a9=_0x9f95[_0x3f2b05];return _0x3061a9;};'use strict';var _=require(_0x59f9('0x0'));var util=require('util');var moment=require(_0x59f9('0x1'));var BPromise=require(_0x59f9('0x2'));var rs=require(_0x59f9('0x3'));var fs=require('fs');var Redis=require(_0x59f9('0x4'));var db=require(_0x59f9('0x5'))['db'];var utils=require(_0x59f9('0x6'));var logger=require(_0x59f9('0x7'))('rpc');var config=require(_0x59f9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x59f9('0x9')]['http']({'port':0x232a});config['redis']=_[_0x59f9('0xa')](config[_0x59f9('0xb')],{'host':_0x59f9('0xc'),'port':0x18eb});var socket=require(_0x59f9('0xd'))(new Redis(config[_0x59f9('0xb')]));require('./chatQueue.socket')[_0x59f9('0xe')](socket);function respondWithRpcPromise(_0x5289dd,_0x3376f5,_0x527bdf){return new BPromise(function(_0x41b875,_0x42dee0){return client['request'](_0x5289dd,_0x527bdf)[_0x59f9('0xf')](function(_0x3ce834){logger[_0x59f9('0x10')]('ChatQueue,\x20%s,\x20%s',_0x3376f5,_0x59f9('0x11'));logger[_0x59f9('0x12')](_0x59f9('0x13'),_0x3376f5,_0x59f9('0x11'),JSON[_0x59f9('0x14')](_0x3ce834));if(_0x3ce834['error']){if(_0x3ce834[_0x59f9('0x15')][_0x59f9('0x16')]===0x1f4){logger['error'](_0x59f9('0x17'),_0x3376f5,_0x3ce834['error'][_0x59f9('0x18')]);return _0x42dee0(_0x3ce834['error'][_0x59f9('0x18')]);}logger[_0x59f9('0x15')]('ChatQueue,\x20%s,\x20%s',_0x3376f5,_0x3ce834[_0x59f9('0x15')][_0x59f9('0x18')]);return _0x41b875(_0x3ce834[_0x59f9('0x15')][_0x59f9('0x18')]);}else{logger[_0x59f9('0x10')](_0x59f9('0x17'),_0x3376f5,_0x59f9('0x11'));_0x41b875(_0x3ce834[_0x59f9('0x19')]['message']);}})[_0x59f9('0x1a')](function(_0x2d9eec){logger[_0x59f9('0x15')](_0x59f9('0x17'),_0x3376f5,_0x2d9eec);_0x42dee0(_0x2d9eec);});});}exports['GetChatQueue']=function(_0x2ba943){var _0x53aecb=this;return new Promise(function(_0x5c2c85,_0x510159){return db['ChatQueue'][_0x59f9('0x1b')]({'raw':_0x2ba943[_0x59f9('0x1c')]?_0x2ba943[_0x59f9('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2ba943['options']?_0x2ba943['options'][_0x59f9('0x1d')]||null:null,'attributes':_0x2ba943['options']?_0x2ba943[_0x59f9('0x1c')]['attributes']||null:null,'limit':_0x2ba943[_0x59f9('0x1c')]?_0x2ba943[_0x59f9('0x1c')][_0x59f9('0x1e')]||null:null,'include':_0x2ba943[_0x59f9('0x1c')]?_0x2ba943[_0x59f9('0x1c')]['include']?_[_0x59f9('0x1f')](_0x2ba943[_0x59f9('0x1c')][_0x59f9('0x20')],function(_0x5bd4f1){return{'model':db[_0x5bd4f1[_0x59f9('0x21')]],'as':_0x5bd4f1['as'],'attributes':_0x5bd4f1[_0x59f9('0x22')],'include':_0x5bd4f1['include']?_[_0x59f9('0x1f')](_0x5bd4f1[_0x59f9('0x20')],function(_0xb099e9){return{'model':db[_0xb099e9[_0x59f9('0x21')]],'as':_0xb099e9['as'],'attributes':_0xb099e9[_0x59f9('0x22')],'include':_0xb099e9[_0x59f9('0x20')]?_[_0x59f9('0x1f')](_0xb099e9[_0x59f9('0x20')],function(_0x459624){return{'model':db[_0x459624['model']],'as':_0x459624['as'],'attributes':_0x459624[_0x59f9('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x545e8e){logger['info'](_0x59f9('0x23'),_0x2ba943);logger[_0x59f9('0x12')](_0x59f9('0x23'),_0x2ba943,JSON[_0x59f9('0x14')](_0x545e8e));_0x5c2c85(_0x545e8e);})[_0x59f9('0x1a')](function(_0x5e7f10){logger[_0x59f9('0x15')](_0x59f9('0x23'),_0x5e7f10['message'],_0x2ba943);_0x510159(_0x53aecb[_0x59f9('0x15')](0x1f4,_0x5e7f10['message']));});});};exports[_0x59f9('0x24')]=function(_0x2bad87){var _0x2f935a=this;return new Promise(function(_0x87577b,_0x133d9a){return db['ChatQueue']['find']({'raw':_0x2bad87['options']?_0x2bad87['options'][_0x59f9('0x25')]===undefined?!![]:![]:!![],'where':_0x2bad87['options']?_0x2bad87[_0x59f9('0x1c')][_0x59f9('0x1d')]||null:null,'attributes':_0x2bad87[_0x59f9('0x1c')]?_0x2bad87['options'][_0x59f9('0x22')]||null:null,'include':_0x2bad87['options']?_0x2bad87[_0x59f9('0x1c')][_0x59f9('0x20')]?_[_0x59f9('0x1f')](_0x2bad87[_0x59f9('0x1c')][_0x59f9('0x20')],function(_0x54e19f){return{'model':db[_0x54e19f[_0x59f9('0x21')]],'as':_0x54e19f['as'],'attributes':_0x54e19f[_0x59f9('0x22')],'include':_0x54e19f[_0x59f9('0x20')]?_[_0x59f9('0x1f')](_0x54e19f[_0x59f9('0x20')],function(_0x1a8376){return{'model':db[_0x1a8376['model']],'as':_0x1a8376['as'],'attributes':_0x1a8376[_0x59f9('0x22')],'include':_0x1a8376[_0x59f9('0x20')]?_[_0x59f9('0x1f')](_0x1a8376[_0x59f9('0x20')],function(_0x1f42ba){return{'model':db[_0x1f42ba[_0x59f9('0x21')]],'as':_0x1f42ba['as'],'attributes':_0x1f42ba['attributes']};}):[]};}):[]};}):[]:[]})[_0x59f9('0xf')](function(_0x232275){logger[_0x59f9('0x10')](_0x59f9('0x24'),_0x2bad87);logger[_0x59f9('0x12')]('ShowChatQueue',_0x2bad87,JSON[_0x59f9('0x14')](_0x232275));_0x87577b(_0x232275);})['catch'](function(_0x4c7e8e){logger[_0x59f9('0x15')]('ShowChatQueue',_0x4c7e8e['message'],_0x2bad87);_0x133d9a(_0x2f935a[_0x59f9('0x15')](0x1f4,_0x4c7e8e[_0x59f9('0x18')]));});});};
\ No newline at end of file
+var _0x4201=['../../config/logger','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','GetChatQueue','findAll','options','raw','where','attributes','include','map','model','stringify','ShowChatQueue','ChatQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x530cb0,_0x337937){var _0x39e18c=function(_0x265b81){while(--_0x265b81){_0x530cb0['push'](_0x530cb0['shift']());}};_0x39e18c(++_0x337937);}(_0x4201,0x71));var _0x1420=function(_0xe09d0,_0x1e55d0){_0xe09d0=_0xe09d0-0x0;var _0x44ad05=_0x4201[_0xe09d0];return _0x44ad05;};'use strict';var _=require(_0x1420('0x0'));var util=require(_0x1420('0x1'));var moment=require('moment');var BPromise=require(_0x1420('0x2'));var rs=require(_0x1420('0x3'));var fs=require('fs');var Redis=require(_0x1420('0x4'));var db=require(_0x1420('0x5'))['db'];var utils=require(_0x1420('0x6'));var logger=require(_0x1420('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1420('0x8'));var client=jayson[_0x1420('0x9')][_0x1420('0xa')]({'port':0x232a});config[_0x1420('0xb')]=_[_0x1420('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1420('0xd'))(new Redis(config[_0x1420('0xb')]));require('./chatQueue.socket')[_0x1420('0xe')](socket);function respondWithRpcPromise(_0x53199d,_0x4d8d95,_0xc73d13){return new BPromise(function(_0x1b360f,_0x5cf903){return client[_0x1420('0xf')](_0x53199d,_0xc73d13)[_0x1420('0x10')](function(_0x1b76fc){logger[_0x1420('0x11')](_0x1420('0x12'),_0x4d8d95,_0x1420('0x13'));logger[_0x1420('0x14')](_0x1420('0x15'),_0x4d8d95,'request\x20sent',JSON['stringify'](_0x1b76fc));if(_0x1b76fc['error']){if(_0x1b76fc['error'][_0x1420('0x16')]===0x1f4){logger[_0x1420('0x17')](_0x1420('0x12'),_0x4d8d95,_0x1b76fc[_0x1420('0x17')][_0x1420('0x18')]);return _0x5cf903(_0x1b76fc[_0x1420('0x17')]['message']);}logger['error'](_0x1420('0x12'),_0x4d8d95,_0x1b76fc['error']['message']);return _0x1b360f(_0x1b76fc[_0x1420('0x17')][_0x1420('0x18')]);}else{logger[_0x1420('0x11')](_0x1420('0x12'),_0x4d8d95,'request\x20sent');_0x1b360f(_0x1b76fc[_0x1420('0x19')][_0x1420('0x18')]);}})[_0x1420('0x1a')](function(_0x4fa1f7){logger[_0x1420('0x17')](_0x1420('0x12'),_0x4d8d95,_0x4fa1f7);_0x5cf903(_0x4fa1f7);});});}exports[_0x1420('0x1b')]=function(_0x310454){var _0x4f3c6b=this;return new Promise(function(_0x5535c0,_0x410abb){return db['ChatQueue'][_0x1420('0x1c')]({'raw':_0x310454[_0x1420('0x1d')]?_0x310454[_0x1420('0x1d')][_0x1420('0x1e')]===undefined?!![]:![]:!![],'where':_0x310454[_0x1420('0x1d')]?_0x310454['options'][_0x1420('0x1f')]||null:null,'attributes':_0x310454[_0x1420('0x1d')]?_0x310454[_0x1420('0x1d')][_0x1420('0x20')]||null:null,'limit':_0x310454[_0x1420('0x1d')]?_0x310454[_0x1420('0x1d')]['limit']||null:null,'include':_0x310454['options']?_0x310454['options'][_0x1420('0x21')]?_[_0x1420('0x22')](_0x310454[_0x1420('0x1d')][_0x1420('0x21')],function(_0x32710e){return{'model':db[_0x32710e['model']],'as':_0x32710e['as'],'attributes':_0x32710e['attributes'],'include':_0x32710e[_0x1420('0x21')]?_[_0x1420('0x22')](_0x32710e[_0x1420('0x21')],function(_0x18666a){return{'model':db[_0x18666a[_0x1420('0x23')]],'as':_0x18666a['as'],'attributes':_0x18666a[_0x1420('0x20')],'include':_0x18666a['include']?_[_0x1420('0x22')](_0x18666a[_0x1420('0x21')],function(_0x36ff7c){return{'model':db[_0x36ff7c[_0x1420('0x23')]],'as':_0x36ff7c['as'],'attributes':_0x36ff7c['attributes']};}):[]};}):[]};}):[]:[]})[_0x1420('0x10')](function(_0x2a25fd){logger[_0x1420('0x11')](_0x1420('0x1b'),_0x310454);logger['debug'](_0x1420('0x1b'),_0x310454,JSON[_0x1420('0x24')](_0x2a25fd));_0x5535c0(_0x2a25fd);})[_0x1420('0x1a')](function(_0x42a317){logger[_0x1420('0x17')](_0x1420('0x1b'),_0x42a317[_0x1420('0x18')],_0x310454);_0x410abb(_0x4f3c6b[_0x1420('0x17')](0x1f4,_0x42a317[_0x1420('0x18')]));});});};exports[_0x1420('0x25')]=function(_0x367f08){var _0x3754ba=this;return new Promise(function(_0x5f0d8f,_0xf3b37a){return db[_0x1420('0x26')][_0x1420('0x27')]({'raw':_0x367f08[_0x1420('0x1d')]?_0x367f08[_0x1420('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x367f08[_0x1420('0x1d')]?_0x367f08[_0x1420('0x1d')]['where']||null:null,'attributes':_0x367f08[_0x1420('0x1d')]?_0x367f08['options']['attributes']||null:null,'include':_0x367f08['options']?_0x367f08[_0x1420('0x1d')][_0x1420('0x21')]?_[_0x1420('0x22')](_0x367f08[_0x1420('0x1d')][_0x1420('0x21')],function(_0x89a6da){return{'model':db[_0x89a6da['model']],'as':_0x89a6da['as'],'attributes':_0x89a6da[_0x1420('0x20')],'include':_0x89a6da[_0x1420('0x21')]?_['map'](_0x89a6da[_0x1420('0x21')],function(_0x93bf5f){return{'model':db[_0x93bf5f[_0x1420('0x23')]],'as':_0x93bf5f['as'],'attributes':_0x93bf5f[_0x1420('0x20')],'include':_0x93bf5f[_0x1420('0x21')]?_[_0x1420('0x22')](_0x93bf5f[_0x1420('0x21')],function(_0x3e64f2){return{'model':db[_0x3e64f2['model']],'as':_0x3e64f2['as'],'attributes':_0x3e64f2[_0x1420('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1420('0x10')](function(_0x3cddad){logger[_0x1420('0x11')](_0x1420('0x25'),_0x367f08);logger['debug'](_0x1420('0x25'),_0x367f08,JSON[_0x1420('0x24')](_0x3cddad));_0x5f0d8f(_0x3cddad);})[_0x1420('0x1a')](function(_0x38eb26){logger['error'](_0x1420('0x25'),_0x38eb26[_0x1420('0x18')],_0x367f08);_0xf3b37a(_0x3754ba[_0x1420('0x17')](0x1f4,_0x38eb26[_0x1420('0x18')]));});});};
\ No newline at end of file
index ca0ee06..b948cb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6aa7=['update','emit','length','chatQueue:','./chatQueue.events','remove'];(function(_0xbb146,_0x1b3260){var _0x5094d0=function(_0x3bd1c0){while(--_0x3bd1c0){_0xbb146['push'](_0xbb146['shift']());}};_0x5094d0(++_0x1b3260);}(_0x6aa7,0x178));var _0x76aa=function(_0x11f568,_0x27e975){_0x11f568=_0x11f568-0x0;var _0x11a019=_0x6aa7[_0x11f568];return _0x11a019;};'use strict';var ChatQueueEvents=require(_0x76aa('0x0'));var events=['save',_0x76aa('0x1'),_0x76aa('0x2')];function createListener(_0x25c818,_0x2db4fe){return function(_0x4f007e){_0x2db4fe[_0x76aa('0x3')](_0x25c818,_0x4f007e);};}function removeListener(_0xef15ef,_0x1d6e04){return function(){ChatQueueEvents['removeListener'](_0xef15ef,_0x1d6e04);};}exports['register']=function(_0x1aceaa){for(var _0x4d53f6=0x0,_0x32dee5=events[_0x76aa('0x4')];_0x4d53f6<_0x32dee5;_0x4d53f6++){var _0xa9b695=events[_0x4d53f6];var _0x56d6bc=createListener(_0x76aa('0x5')+_0xa9b695,_0x1aceaa);ChatQueueEvents['on'](_0xa9b695,_0x56d6bc);}};
\ No newline at end of file
+var _0xedd9=['removeListener','register','length','chatQueue:','save','remove','update','emit'];(function(_0x56ddd0,_0x1c260c){var _0x522d41=function(_0x120ce3){while(--_0x120ce3){_0x56ddd0['push'](_0x56ddd0['shift']());}};_0x522d41(++_0x1c260c);}(_0xedd9,0xfc));var _0x9edd=function(_0x4d4356,_0x27f883){_0x4d4356=_0x4d4356-0x0;var _0x232113=_0xedd9[_0x4d4356];return _0x232113;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x9edd('0x0'),_0x9edd('0x1'),_0x9edd('0x2')];function createListener(_0x2c16b8,_0x3b51bc){return function(_0x127cbe){_0x3b51bc[_0x9edd('0x3')](_0x2c16b8,_0x127cbe);};}function removeListener(_0x36b53f,_0x5943b3){return function(){ChatQueueEvents[_0x9edd('0x4')](_0x36b53f,_0x5943b3);};}exports[_0x9edd('0x5')]=function(_0x268f9e){for(var _0x34c1a7=0x0,_0x5319f7=events[_0x9edd('0x6')];_0x34c1a7<_0x5319f7;_0x34c1a7++){var _0x571af9=events[_0x34c1a7];var _0x172522=createListener(_0x9edd('0x7')+_0x571af9,_0x268f9e);ChatQueueEvents['on'](_0x571af9,_0x172522);}};
\ No newline at end of file
index 2291111..2b74d54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x5489c1,_0x4dc85d){var _0x4ab0ee=function(_0x240ca2){while(--_0x240ca2){_0x5489c1['push'](_0x5489c1['shift']());}};_0x4ab0ee(++_0x4dc85d);}(_0xe14b,0x93));var _0xbe14=function(_0xf823ef,_0x2f7a1b){_0xf823ef=_0xf823ef-0x0;var _0x456a79=_0xe14b[_0xf823ef];return _0x456a79;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
+var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2db667,_0x193cf5){_0x2db667=_0x2db667-0x0;var _0x83ff9=_0x5fc3[_0x2db667];return _0x83ff9;};'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
index d3a2797..15c18b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57fe=['sequelize','STRING','DATE','moment'];(function(_0x1e03ce,_0x4bfdb3){var _0x1284a2=function(_0x1516ef){while(--_0x1516ef){_0x1e03ce['push'](_0x1e03ce['shift']());}};_0x1284a2(++_0x4bfdb3);}(_0x57fe,0x13b));var _0xe57f=function(_0x513951,_0xccc3cc){_0x513951=_0x513951-0x0;var _0x34657c=_0x57fe[_0x513951];return _0x34657c;};'use strict';var moment=require(_0xe57f('0x0'));var Sequelize=require(_0xe57f('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xe57f('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xe57f('0x2')]},'joinAt':{'type':Sequelize[_0xe57f('0x3')]},'leaveAt':{'type':Sequelize[_0xe57f('0x3')]},'acceptAt':{'type':Sequelize[_0xe57f('0x3')]},'exitAt':{'type':Sequelize[_0xe57f('0x3')]},'reason':{'type':Sequelize[_0xe57f('0x2')]}};
\ No newline at end of file
+var _0xd90b=['moment','STRING','DATE'];(function(_0x41ede1,_0x42e44e){var _0x1b2e7c=function(_0x82ae80){while(--_0x82ae80){_0x41ede1['push'](_0x41ede1['shift']());}};_0x1b2e7c(++_0x42e44e);}(_0xd90b,0xbd));var _0xbd90=function(_0x3a28d5,_0x2ccc77){_0x3a28d5=_0x3a28d5-0x0;var _0x166097=_0xd90b[_0x3a28d5];return _0x166097;};'use strict';var moment=require(_0xbd90('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xbd90('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xbd90('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xbd90('0x2')]},'reason':{'type':Sequelize[_0xbd90('0x1')]}};
\ No newline at end of file
index f89a078..66bcc1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8861=['then','error','stack','name','send','index','ChatQueueReport','rawAttributes','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','offset','limit','count','status','Content-Range','apply','save','update','destroy'];(function(_0x5b8118,_0x1ebf18){var _0x2862b3=function(_0x4c0b33){while(--_0x4c0b33){_0x5b8118['push'](_0x5b8118['shift']());}};_0x2862b3(++_0x1ebf18);}(_0x8861,0x6d));var _0x1886=function(_0x4f9544,_0x34fab3){_0x4f9544=_0x4f9544-0x0;var _0x3680b4=_0x8861[_0x4f9544];return _0x3680b4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1886('0x0'));var jsonpatch=require(_0x1886('0x1'));var rp=require(_0x1886('0x2'));var moment=require(_0x1886('0x3'));var BPromise=require(_0x1886('0x4'));var Mustache=require(_0x1886('0x5'));var util=require(_0x1886('0x6'));var path=require(_0x1886('0x7'));var sox=require(_0x1886('0x8'));var csv=require(_0x1886('0x9'));var ejs=require(_0x1886('0xa'));var fs=require('fs');var fs_extra=require(_0x1886('0xb'));var _=require(_0x1886('0xc'));var squel=require(_0x1886('0xd'));var crypto=require(_0x1886('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1886('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1886('0x10'));var Papa=require('papaparse');var Redis=require(_0x1886('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1886('0x12'));var as=require(_0x1886('0x13'));var hardwareService=require(_0x1886('0x14'));var logger=require(_0x1886('0x15'))(_0x1886('0x16'));var utils=require(_0x1886('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1886('0x18'));var db=require(_0x1886('0x19'))['db'];function respondWithStatusCode(_0x13a77f,_0x30c26a){_0x30c26a=_0x30c26a||0xcc;return function(_0x101b21){if(_0x101b21){return _0x13a77f[_0x1886('0x1a')](_0x30c26a);}return _0x13a77f['status'](_0x30c26a)['end']();};}function respondWithResult(_0x26dcf9,_0x23ec3f){_0x23ec3f=_0x23ec3f||0xc8;return function(_0x218d82){if(_0x218d82){return _0x26dcf9['status'](_0x23ec3f)[_0x1886('0x1b')](_0x218d82);}};}function respondWithFilteredResult(_0x43f020,_0x3767ba){return function(_0x4993fe){if(_0x4993fe){var _0x54d2ee=typeof _0x3767ba[_0x1886('0x1c')]==='undefined'&&typeof _0x3767ba[_0x1886('0x1d')]==='undefined';var _0xe3ba5e=_0x4993fe['count'];var _0x59e422=_0x54d2ee?0x0:_0x3767ba[_0x1886('0x1c')];var _0x33765e=_0x54d2ee?_0x4993fe[_0x1886('0x1e')]:_0x3767ba[_0x1886('0x1c')]+_0x3767ba[_0x1886('0x1d')];var _0x1c9a22;if(_0x33765e>=_0xe3ba5e){_0x33765e=_0xe3ba5e;_0x1c9a22=0xc8;}else{_0x1c9a22=0xce;}_0x43f020[_0x1886('0x1f')](_0x1c9a22);return _0x43f020['set'](_0x1886('0x20'),_0x59e422+'-'+_0x33765e+'/'+_0xe3ba5e)[_0x1886('0x1b')](_0x4993fe);}return null;};}function patchUpdates(_0x49dc6c){return function(_0x3df84f){try{jsonpatch[_0x1886('0x21')](_0x3df84f,_0x49dc6c,!![]);}catch(_0x2f39c4){return BPromise['reject'](_0x2f39c4);}return _0x3df84f[_0x1886('0x22')]();};}function saveUpdates(_0x1b4fb0,_0x257831){return function(_0x452f93){if(_0x452f93){return _0x452f93[_0x1886('0x23')](_0x1b4fb0)['then'](function(_0x500e13){return _0x500e13;});}return null;};}function removeEntity(_0x3f7bb1,_0x345bd7){return function(_0x2e508c){if(_0x2e508c){return _0x2e508c[_0x1886('0x24')]()[_0x1886('0x25')](function(){_0x3f7bb1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c8841,_0x3c4d84){return function(_0x195846){if(!_0x195846){_0x1c8841['sendStatus'](0x194);}return _0x195846;};}function handleError(_0x2d2dff,_0x188ab5){_0x188ab5=_0x188ab5||0x1f4;return function(_0x410046){logger[_0x1886('0x26')](_0x410046[_0x1886('0x27')]);if(_0x410046[_0x1886('0x28')]){delete _0x410046[_0x1886('0x28')];}_0x2d2dff[_0x1886('0x1f')](_0x188ab5)[_0x1886('0x29')](_0x410046);};}exports[_0x1886('0x2a')]=function(_0x13fe64,_0x177307){var _0x4edca2={},_0x2e7a79={},_0x11c0d2={'count':0x0,'rows':[]};var _0x1bd068=_['map'](db[_0x1886('0x2b')][_0x1886('0x2c')],function(_0x3d1142){return{'name':_0x3d1142['fieldName'],'type':_0x3d1142['type']['key']};});_0x2e7a79[_0x1886('0x2d')]=_[_0x1886('0x2e')](_0x1bd068,_0x1886('0x28'));_0x2e7a79[_0x1886('0x2f')]=_[_0x1886('0x30')](_0x13fe64[_0x1886('0x2f')]);_0x2e7a79['filters']=_[_0x1886('0x31')](_0x2e7a79[_0x1886('0x2d')],_0x2e7a79['query']);_0x4edca2[_0x1886('0x32')]=_['intersection'](_0x2e7a79['model'],qs[_0x1886('0x33')](_0x13fe64[_0x1886('0x2f')][_0x1886('0x33')]));_0x4edca2[_0x1886('0x32')]=_0x4edca2[_0x1886('0x32')][_0x1886('0x34')]?_0x4edca2[_0x1886('0x32')]:_0x2e7a79[_0x1886('0x2d')];if(!_0x13fe64[_0x1886('0x2f')][_0x1886('0x35')]('nolimit')){_0x4edca2['limit']=qs[_0x1886('0x1d')](_0x13fe64['query'][_0x1886('0x1d')]);_0x4edca2[_0x1886('0x1c')]=qs[_0x1886('0x1c')](_0x13fe64[_0x1886('0x2f')][_0x1886('0x1c')]);}_0x4edca2[_0x1886('0x36')]=qs[_0x1886('0x37')](_0x13fe64['query'][_0x1886('0x37')]);_0x4edca2[_0x1886('0x38')]=qs[_0x1886('0x39')](_[_0x1886('0x3a')](_0x13fe64[_0x1886('0x2f')],_0x2e7a79[_0x1886('0x39')]),_0x1bd068);if(_0x13fe64[_0x1886('0x2f')][_0x1886('0x3b')]){_0x4edca2['where']=_[_0x1886('0x3c')](_0x4edca2[_0x1886('0x38')],{'$or':_[_0x1886('0x2e')](_0x1bd068,function(_0x89bded){if(_0x89bded[_0x1886('0x3d')]!=='VIRTUAL'){var _0x39694d={};_0x39694d[_0x89bded['name']]={'$like':'%'+_0x13fe64['query']['filter']+'%'};return _0x39694d;}})});}_0x4edca2=_[_0x1886('0x3c')]({},_0x4edca2,_0x13fe64[_0x1886('0x3e')]);var _0x5dafa6={'where':_0x4edca2[_0x1886('0x38')]};return db['ChatQueueReport']['count'](_0x5dafa6)[_0x1886('0x25')](function(_0xe85aad){_0x11c0d2[_0x1886('0x1e')]=_0xe85aad;if(_0x13fe64[_0x1886('0x2f')][_0x1886('0x3f')]){_0x4edca2[_0x1886('0x40')]=[{'all':!![]}];}return db[_0x1886('0x2b')][_0x1886('0x41')](_0x4edca2);})[_0x1886('0x25')](function(_0x298be6){_0x11c0d2[_0x1886('0x42')]=_0x298be6;return _0x11c0d2;})[_0x1886('0x25')](respondWithFilteredResult(_0x177307,_0x4edca2))[_0x1886('0x43')](handleError(_0x177307,null));};exports[_0x1886('0x44')]=function(_0x8d162d,_0x2d406e){var _0x28abde={'raw':!![],'where':{'id':_0x8d162d[_0x1886('0x45')]['id']}},_0x412970={};_0x412970[_0x1886('0x2d')]=_[_0x1886('0x30')](db[_0x1886('0x2b')][_0x1886('0x2c')]);_0x412970[_0x1886('0x2f')]=_[_0x1886('0x30')](_0x8d162d['query']);_0x412970[_0x1886('0x39')]=_['intersection'](_0x412970[_0x1886('0x2d')],_0x412970['query']);_0x28abde[_0x1886('0x32')]=_['intersection'](_0x412970[_0x1886('0x2d')],qs['fields'](_0x8d162d[_0x1886('0x2f')]['fields']));_0x28abde[_0x1886('0x32')]=_0x28abde['attributes'][_0x1886('0x34')]?_0x28abde['attributes']:_0x412970[_0x1886('0x2d')];if(_0x8d162d['query'][_0x1886('0x3f')]){_0x28abde['include']=[{'all':!![]}];}_0x28abde=_[_0x1886('0x3c')]({},_0x28abde,_0x8d162d[_0x1886('0x3e')]);return db['ChatQueueReport'][_0x1886('0x46')](_0x28abde)[_0x1886('0x25')](handleEntityNotFound(_0x2d406e,null))[_0x1886('0x25')](respondWithResult(_0x2d406e,null))['catch'](handleError(_0x2d406e,null));};exports[_0x1886('0x47')]=function(_0x22b229,_0x55f03d){return db[_0x1886('0x2b')][_0x1886('0x47')](_0x22b229[_0x1886('0x48')],{})[_0x1886('0x25')](respondWithResult(_0x55f03d,0xc9))[_0x1886('0x43')](handleError(_0x55f03d,null));};exports[_0x1886('0x23')]=function(_0x40e260,_0x5022ae){if(_0x40e260[_0x1886('0x48')]['id']){delete _0x40e260['body']['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x40e260[_0x1886('0x45')]['id']}})[_0x1886('0x25')](handleEntityNotFound(_0x5022ae,null))['then'](saveUpdates(_0x40e260[_0x1886('0x48')],null))[_0x1886('0x25')](respondWithResult(_0x5022ae,null))[_0x1886('0x43')](handleError(_0x5022ae,null));};exports[_0x1886('0x24')]=function(_0x303a43,_0x5b2caf){return db[_0x1886('0x2b')]['find']({'where':{'id':_0x303a43[_0x1886('0x45')]['id']}})[_0x1886('0x25')](handleEntityNotFound(_0x5b2caf,null))[_0x1886('0x25')](removeEntity(_0x5b2caf,null))[_0x1886('0x43')](handleError(_0x5b2caf,null));};exports['describe']=function(_0x416164,_0x6595f){return db['ChatQueueReport']['describe']()['then'](respondWithResult(_0x6595f,null))['catch'](handleError(_0x6595f,null));};
\ No newline at end of file
+var _0x8daf=['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','offset','undefined','limit','set','Content-Range','json','apply','save','update','then','error','name','send','index','ChatQueueReport','rawAttributes','fieldName','type','model','filters','query','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','map','VIRTUAL','merge','count','includeAll','include','findAll','catch','show','params','keys','intersection','find','create','body','destroy','describe','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0xf74ddb,_0x8383bd){var _0x44e4cd=function(_0x20be15){while(--_0x20be15){_0xf74ddb['push'](_0xf74ddb['shift']());}};_0x44e4cd(++_0x8383bd);}(_0x8daf,0x15c));var _0xf8da=function(_0x4014e5,_0x125e6a){_0x4014e5=_0x4014e5-0x0;var _0x4ee8b7=_0x8daf[_0x4014e5];return _0x4ee8b7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf8da('0x0'));var moment=require(_0xf8da('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xf8da('0x2'));var util=require(_0xf8da('0x3'));var path=require(_0xf8da('0x4'));var sox=require(_0xf8da('0x5'));var csv=require(_0xf8da('0x6'));var ejs=require(_0xf8da('0x7'));var fs=require('fs');var fs_extra=require(_0xf8da('0x8'));var _=require(_0xf8da('0x9'));var squel=require(_0xf8da('0xa'));var crypto=require('crypto');var jsforce=require(_0xf8da('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf8da('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf8da('0xc'));var authService=require(_0xf8da('0xd'));var qs=require(_0xf8da('0xe'));var as=require(_0xf8da('0xf'));var hardwareService=require(_0xf8da('0x10'));var logger=require(_0xf8da('0x11'))(_0xf8da('0x12'));var utils=require(_0xf8da('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xf8da('0x14'));var db=require(_0xf8da('0x15'))['db'];function respondWithStatusCode(_0x3a436d,_0x1cfce2){_0x1cfce2=_0x1cfce2||0xcc;return function(_0x5cd714){if(_0x5cd714){return _0x3a436d[_0xf8da('0x16')](_0x1cfce2);}return _0x3a436d['status'](_0x1cfce2)[_0xf8da('0x17')]();};}function respondWithResult(_0x1a93ab,_0x259b96){_0x259b96=_0x259b96||0xc8;return function(_0x3e5413){if(_0x3e5413){return _0x1a93ab[_0xf8da('0x18')](_0x259b96)['json'](_0x3e5413);}};}function respondWithFilteredResult(_0x387c8e,_0x4296ff){return function(_0x36cee8){if(_0x36cee8){var _0x3fa368=typeof _0x4296ff[_0xf8da('0x19')]===_0xf8da('0x1a')&&typeof _0x4296ff[_0xf8da('0x1b')]==='undefined';var _0x1c9486=_0x36cee8['count'];var _0x5dc9db=_0x3fa368?0x0:_0x4296ff[_0xf8da('0x19')];var _0x2611c2=_0x3fa368?_0x36cee8['count']:_0x4296ff[_0xf8da('0x19')]+_0x4296ff[_0xf8da('0x1b')];var _0x30e1;if(_0x2611c2>=_0x1c9486){_0x2611c2=_0x1c9486;_0x30e1=0xc8;}else{_0x30e1=0xce;}_0x387c8e[_0xf8da('0x18')](_0x30e1);return _0x387c8e[_0xf8da('0x1c')](_0xf8da('0x1d'),_0x5dc9db+'-'+_0x2611c2+'/'+_0x1c9486)[_0xf8da('0x1e')](_0x36cee8);}return null;};}function patchUpdates(_0xfe5c73){return function(_0x5acd3f){try{jsonpatch[_0xf8da('0x1f')](_0x5acd3f,_0xfe5c73,!![]);}catch(_0x22adc7){return BPromise['reject'](_0x22adc7);}return _0x5acd3f[_0xf8da('0x20')]();};}function saveUpdates(_0x5361e7,_0x4ca909){return function(_0x5a295f){if(_0x5a295f){return _0x5a295f[_0xf8da('0x21')](_0x5361e7)[_0xf8da('0x22')](function(_0x2255b8){return _0x2255b8;});}return null;};}function removeEntity(_0x389391,_0x493d6c){return function(_0x4f7ceb){if(_0x4f7ceb){return _0x4f7ceb['destroy']()['then'](function(){_0x389391[_0xf8da('0x18')](0xcc)[_0xf8da('0x17')]();});}};}function handleEntityNotFound(_0x43934c,_0x2b403d){return function(_0x4b8d17){if(!_0x4b8d17){_0x43934c[_0xf8da('0x16')](0x194);}return _0x4b8d17;};}function handleError(_0x2ca340,_0x4326b1){_0x4326b1=_0x4326b1||0x1f4;return function(_0x550590){logger[_0xf8da('0x23')](_0x550590['stack']);if(_0x550590[_0xf8da('0x24')]){delete _0x550590[_0xf8da('0x24')];}_0x2ca340[_0xf8da('0x18')](_0x4326b1)[_0xf8da('0x25')](_0x550590);};}exports[_0xf8da('0x26')]=function(_0x3da568,_0x35544b){var _0x424f5d={},_0x51014c={},_0xd5780a={'count':0x0,'rows':[]};var _0x552ed3=_['map'](db[_0xf8da('0x27')][_0xf8da('0x28')],function(_0x16d7e9){return{'name':_0x16d7e9[_0xf8da('0x29')],'type':_0x16d7e9[_0xf8da('0x2a')]['key']};});_0x51014c[_0xf8da('0x2b')]=_['map'](_0x552ed3,'name');_0x51014c['query']=_['keys'](_0x3da568['query']);_0x51014c[_0xf8da('0x2c')]=_['intersection'](_0x51014c[_0xf8da('0x2b')],_0x51014c[_0xf8da('0x2d')]);_0x424f5d[_0xf8da('0x2e')]=_['intersection'](_0x51014c['model'],qs[_0xf8da('0x2f')](_0x3da568[_0xf8da('0x2d')][_0xf8da('0x2f')]));_0x424f5d[_0xf8da('0x2e')]=_0x424f5d[_0xf8da('0x2e')][_0xf8da('0x30')]?_0x424f5d['attributes']:_0x51014c[_0xf8da('0x2b')];if(!_0x3da568[_0xf8da('0x2d')][_0xf8da('0x31')](_0xf8da('0x32'))){_0x424f5d[_0xf8da('0x1b')]=qs[_0xf8da('0x1b')](_0x3da568['query'][_0xf8da('0x1b')]);_0x424f5d[_0xf8da('0x19')]=qs[_0xf8da('0x19')](_0x3da568[_0xf8da('0x2d')]['offset']);}_0x424f5d[_0xf8da('0x33')]=qs['sort'](_0x3da568[_0xf8da('0x2d')]['sort']);_0x424f5d[_0xf8da('0x34')]=qs['filters'](_[_0xf8da('0x35')](_0x3da568[_0xf8da('0x2d')],_0x51014c[_0xf8da('0x2c')]),_0x552ed3);if(_0x3da568[_0xf8da('0x2d')][_0xf8da('0x36')]){_0x424f5d[_0xf8da('0x34')]=_['merge'](_0x424f5d[_0xf8da('0x34')],{'$or':_[_0xf8da('0x37')](_0x552ed3,function(_0x235756){if(_0x235756['type']!==_0xf8da('0x38')){var _0x3eb5b1={};_0x3eb5b1[_0x235756[_0xf8da('0x24')]]={'$like':'%'+_0x3da568['query'][_0xf8da('0x36')]+'%'};return _0x3eb5b1;}})});}_0x424f5d=_[_0xf8da('0x39')]({},_0x424f5d,_0x3da568['options']);var _0x236244={'where':_0x424f5d[_0xf8da('0x34')]};return db[_0xf8da('0x27')]['count'](_0x236244)[_0xf8da('0x22')](function(_0xec8256){_0xd5780a[_0xf8da('0x3a')]=_0xec8256;if(_0x3da568[_0xf8da('0x2d')][_0xf8da('0x3b')]){_0x424f5d[_0xf8da('0x3c')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xf8da('0x3d')](_0x424f5d);})[_0xf8da('0x22')](function(_0x55c307){_0xd5780a['rows']=_0x55c307;return _0xd5780a;})[_0xf8da('0x22')](respondWithFilteredResult(_0x35544b,_0x424f5d))[_0xf8da('0x3e')](handleError(_0x35544b,null));};exports[_0xf8da('0x3f')]=function(_0x72f494,_0x555822){var _0x246192={'raw':!![],'where':{'id':_0x72f494[_0xf8da('0x40')]['id']}},_0x2807f9={};_0x2807f9[_0xf8da('0x2b')]=_['keys'](db['ChatQueueReport'][_0xf8da('0x28')]);_0x2807f9['query']=_[_0xf8da('0x41')](_0x72f494['query']);_0x2807f9[_0xf8da('0x2c')]=_[_0xf8da('0x42')](_0x2807f9[_0xf8da('0x2b')],_0x2807f9[_0xf8da('0x2d')]);_0x246192[_0xf8da('0x2e')]=_[_0xf8da('0x42')](_0x2807f9[_0xf8da('0x2b')],qs['fields'](_0x72f494[_0xf8da('0x2d')][_0xf8da('0x2f')]));_0x246192['attributes']=_0x246192[_0xf8da('0x2e')][_0xf8da('0x30')]?_0x246192['attributes']:_0x2807f9[_0xf8da('0x2b')];if(_0x72f494[_0xf8da('0x2d')][_0xf8da('0x3b')]){_0x246192[_0xf8da('0x3c')]=[{'all':!![]}];}_0x246192=_[_0xf8da('0x39')]({},_0x246192,_0x72f494['options']);return db['ChatQueueReport'][_0xf8da('0x43')](_0x246192)['then'](handleEntityNotFound(_0x555822,null))[_0xf8da('0x22')](respondWithResult(_0x555822,null))['catch'](handleError(_0x555822,null));};exports[_0xf8da('0x44')]=function(_0x3970b8,_0x1703a1){return db[_0xf8da('0x27')][_0xf8da('0x44')](_0x3970b8[_0xf8da('0x45')],{})[_0xf8da('0x22')](respondWithResult(_0x1703a1,0xc9))[_0xf8da('0x3e')](handleError(_0x1703a1,null));};exports['update']=function(_0x26db7f,_0x3decc8){if(_0x26db7f['body']['id']){delete _0x26db7f[_0xf8da('0x45')]['id'];}return db[_0xf8da('0x27')][_0xf8da('0x43')]({'where':{'id':_0x26db7f[_0xf8da('0x40')]['id']}})[_0xf8da('0x22')](handleEntityNotFound(_0x3decc8,null))['then'](saveUpdates(_0x26db7f['body'],null))['then'](respondWithResult(_0x3decc8,null))['catch'](handleError(_0x3decc8,null));};exports[_0xf8da('0x46')]=function(_0x2f8d1a,_0x5c9c5a){return db['ChatQueueReport'][_0xf8da('0x43')]({'where':{'id':_0x2f8d1a[_0xf8da('0x40')]['id']}})[_0xf8da('0x22')](handleEntityNotFound(_0x5c9c5a,null))[_0xf8da('0x22')](removeEntity(_0x5c9c5a,null))[_0xf8da('0x3e')](handleError(_0x5c9c5a,null));};exports[_0xf8da('0x47')]=function(_0x2780fe,_0x1b31bf){return db[_0xf8da('0x27')]['describe']()['then'](respondWithResult(_0x1b31bf,null))['catch'](handleError(_0x1b31bf,null));};
\ No newline at end of file
index c1d1ba9..15aaf16 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(_0x4277ba,_0x39dd98){var _0x2e6f3d=function(_0x4a218c){while(--_0x4a218c){_0x4277ba['push'](_0x4277ba['shift']());}};_0x2e6f3d(++_0x39dd98);}(_0x757a,0xde));var _0xa757=function(_0xae522a,_0x49854d){_0xae522a=_0xae522a-0x0;var _0x62d323=_0x757a[_0xae522a];return _0x62d323;};'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 _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x223b20,_0x3f2c5d){var _0x9fb3c1=function(_0x338cd7){while(--_0x338cd7){_0x223b20['push'](_0x223b20['shift']());}};_0x9fb3c1(++_0x3f2c5d);}(_0x757a,0xde));var _0xa757=function(_0x44b598,_0x2dd4b6){_0x44b598=_0x44b598-0x0;var _0x44d4d0=_0x757a[_0x44b598];return _0x44d4d0;};'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
index 4ec78ef..d9dc919 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fde=['catch','ChatQueueReport','create','body','options','raw','then','CreateChatQueueReport','stringify','UpdateChatQueueReport','update','where','attributes','limit','debug','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x588fde,_0x11084e){var _0x1da4d9=function(_0x4638e5){while(--_0x4638e5){_0x588fde['push'](_0x588fde['shift']());}};_0x1da4d9(++_0x11084e);}(_0x8fde,0x138));var _0xe8fd=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8fde[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0xe8fd('0x0'));var moment=require('moment');var BPromise=require(_0xe8fd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe8fd('0x2'));var logger=require(_0xe8fd('0x3'))(_0xe8fd('0x4'));var config=require(_0xe8fd('0x5'));var jayson=require(_0xe8fd('0x6'));var client=jayson[_0xe8fd('0x7')][_0xe8fd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x9236d6,_0x1f07cb,_0xaee575){return new BPromise(function(_0x2eb4cf,_0x31f334){return client[_0xe8fd('0x9')](_0x9236d6,_0xaee575)['then'](function(_0x537227){logger[_0xe8fd('0xa')](_0xe8fd('0xb'),_0x1f07cb,_0xe8fd('0xc'));logger['debug'](_0xe8fd('0xd'),_0x1f07cb,_0xe8fd('0xc'),JSON['stringify'](_0x537227));if(_0x537227['error']){if(_0x537227['error'][_0xe8fd('0xe')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x1f07cb,_0x537227[_0xe8fd('0xf')][_0xe8fd('0x10')]);return _0x31f334(_0x537227[_0xe8fd('0xf')][_0xe8fd('0x10')]);}logger[_0xe8fd('0xf')](_0xe8fd('0xb'),_0x1f07cb,_0x537227[_0xe8fd('0xf')][_0xe8fd('0x10')]);return _0x2eb4cf(_0x537227[_0xe8fd('0xf')][_0xe8fd('0x10')]);}else{logger[_0xe8fd('0xa')](_0xe8fd('0xb'),_0x1f07cb,_0xe8fd('0xc'));_0x2eb4cf(_0x537227[_0xe8fd('0x11')][_0xe8fd('0x10')]);}})[_0xe8fd('0x12')](function(_0xa6fe4c){logger[_0xe8fd('0xf')](_0xe8fd('0xb'),_0x1f07cb,_0xa6fe4c);_0x31f334(_0xa6fe4c);});});}exports['CreateChatQueueReport']=function(_0x8eafb7){var _0x2549b9=this;return new Promise(function(_0x18adf5,_0x1c9d0c){return db[_0xe8fd('0x13')][_0xe8fd('0x14')](_0x8eafb7[_0xe8fd('0x15')],{'raw':_0x8eafb7[_0xe8fd('0x16')]?_0x8eafb7[_0xe8fd('0x16')][_0xe8fd('0x17')]===undefined?!![]:![]:!![]})[_0xe8fd('0x18')](function(_0x39a3e3){logger[_0xe8fd('0xa')](_0xe8fd('0x19'),_0x8eafb7);logger['debug'](_0xe8fd('0x19'),_0x8eafb7,JSON[_0xe8fd('0x1a')](_0x39a3e3));_0x18adf5(_0x39a3e3);})['catch'](function(_0x2f1a00){logger['error'](_0xe8fd('0x19'),_0x2f1a00['message'],_0x8eafb7);_0x1c9d0c(_0x2549b9[_0xe8fd('0xf')](0x1f4,_0x2f1a00[_0xe8fd('0x10')]));});});};exports[_0xe8fd('0x1b')]=function(_0x45b52c){var _0x4098fb=this;return new Promise(function(_0x3ab225,_0x25c199){return db[_0xe8fd('0x13')][_0xe8fd('0x1c')](_0x45b52c[_0xe8fd('0x15')],{'raw':_0x45b52c['options']?_0x45b52c[_0xe8fd('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45b52c[_0xe8fd('0x16')]?_0x45b52c[_0xe8fd('0x16')][_0xe8fd('0x1d')]||null:null,'attributes':_0x45b52c[_0xe8fd('0x16')]?_0x45b52c['options'][_0xe8fd('0x1e')]||null:null,'limit':_0x45b52c[_0xe8fd('0x16')]?_0x45b52c[_0xe8fd('0x16')][_0xe8fd('0x1f')]||null:null})['then'](function(_0x277883){logger[_0xe8fd('0xa')](_0xe8fd('0x1b'),_0x45b52c);logger[_0xe8fd('0x20')](_0xe8fd('0x1b'),_0x45b52c,JSON['stringify'](_0x277883));_0x3ab225(_0x277883);})[_0xe8fd('0x12')](function(_0x5d111d){logger[_0xe8fd('0xf')]('UpdateChatQueueReport',_0x5d111d[_0xe8fd('0x10')],_0x45b52c);_0x25c199(_0x4098fb[_0xe8fd('0xf')](0x1f4,_0x5d111d[_0xe8fd('0x10')]));});});};
\ No newline at end of file
+var _0x8eea=['ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateChatQueueReport','body','options','raw','then','stringify','UpdateChatQueueReport','update','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4a1426,_0x4ae821){var _0x5ac7dd=function(_0x11eccd){while(--_0x11eccd){_0x4a1426['push'](_0x4a1426['shift']());}};_0x5ac7dd(++_0x4ae821);}(_0x8eea,0xd2));var _0xa8ee=function(_0x5959c9,_0x2ed153){_0x5959c9=_0x5959c9-0x0;var _0x4ffcbc=_0x8eea[_0x5959c9];return _0x4ffcbc;};'use strict';var _=require(_0xa8ee('0x0'));var util=require('util');var moment=require(_0xa8ee('0x1'));var BPromise=require(_0xa8ee('0x2'));var rs=require(_0xa8ee('0x3'));var fs=require('fs');var Redis=require(_0xa8ee('0x4'));var db=require(_0xa8ee('0x5'))['db'];var utils=require(_0xa8ee('0x6'));var logger=require(_0xa8ee('0x7'))(_0xa8ee('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa8ee('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28931f,_0x53c75f,_0x238806){return new BPromise(function(_0x365757,_0x20bd87){return client[_0xa8ee('0xa')](_0x28931f,_0x238806)['then'](function(_0x1f42a7){logger['info'](_0xa8ee('0xb'),_0x53c75f,_0xa8ee('0xc'));logger[_0xa8ee('0xd')](_0xa8ee('0xe'),_0x53c75f,_0xa8ee('0xc'),JSON['stringify'](_0x1f42a7));if(_0x1f42a7[_0xa8ee('0xf')]){if(_0x1f42a7[_0xa8ee('0xf')][_0xa8ee('0x10')]===0x1f4){logger['error'](_0xa8ee('0xb'),_0x53c75f,_0x1f42a7[_0xa8ee('0xf')][_0xa8ee('0x11')]);return _0x20bd87(_0x1f42a7['error']['message']);}logger[_0xa8ee('0xf')](_0xa8ee('0xb'),_0x53c75f,_0x1f42a7['error'][_0xa8ee('0x11')]);return _0x365757(_0x1f42a7[_0xa8ee('0xf')][_0xa8ee('0x11')]);}else{logger[_0xa8ee('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x53c75f,_0xa8ee('0xc'));_0x365757(_0x1f42a7[_0xa8ee('0x13')][_0xa8ee('0x11')]);}})[_0xa8ee('0x14')](function(_0x2a09f6){logger[_0xa8ee('0xf')](_0xa8ee('0xb'),_0x53c75f,_0x2a09f6);_0x20bd87(_0x2a09f6);});});}exports[_0xa8ee('0x15')]=function(_0x2904b7){var _0x5bb89a=this;return new Promise(function(_0x3db1c0,_0x1bf4c8){return db['ChatQueueReport']['create'](_0x2904b7[_0xa8ee('0x16')],{'raw':_0x2904b7[_0xa8ee('0x17')]?_0x2904b7[_0xa8ee('0x17')][_0xa8ee('0x18')]===undefined?!![]:![]:!![]})[_0xa8ee('0x19')](function(_0x2c174f){logger[_0xa8ee('0x12')](_0xa8ee('0x15'),_0x2904b7);logger['debug'](_0xa8ee('0x15'),_0x2904b7,JSON[_0xa8ee('0x1a')](_0x2c174f));_0x3db1c0(_0x2c174f);})['catch'](function(_0x11d86e){logger[_0xa8ee('0xf')](_0xa8ee('0x15'),_0x11d86e[_0xa8ee('0x11')],_0x2904b7);_0x1bf4c8(_0x5bb89a[_0xa8ee('0xf')](0x1f4,_0x11d86e[_0xa8ee('0x11')]));});});};exports[_0xa8ee('0x1b')]=function(_0x5236ed){var _0x35cb87=this;return new Promise(function(_0x3b4f0c,_0x560f0b){return db['ChatQueueReport'][_0xa8ee('0x1c')](_0x5236ed['body'],{'raw':_0x5236ed[_0xa8ee('0x17')]?_0x5236ed[_0xa8ee('0x17')][_0xa8ee('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5236ed['options']?_0x5236ed[_0xa8ee('0x17')][_0xa8ee('0x1d')]||null:null,'attributes':_0x5236ed[_0xa8ee('0x17')]?_0x5236ed[_0xa8ee('0x17')][_0xa8ee('0x1e')]||null:null,'limit':_0x5236ed[_0xa8ee('0x17')]?_0x5236ed[_0xa8ee('0x17')][_0xa8ee('0x1f')]||null:null})[_0xa8ee('0x19')](function(_0xbd735f){logger[_0xa8ee('0x12')]('UpdateChatQueueReport',_0x5236ed);logger[_0xa8ee('0xd')](_0xa8ee('0x1b'),_0x5236ed,JSON['stringify'](_0xbd735f));_0x3b4f0c(_0xbd735f);})['catch'](function(_0x285b17){logger[_0xa8ee('0xf')](_0xa8ee('0x1b'),_0x285b17[_0xa8ee('0x11')],_0x5236ed);_0x560f0b(_0x35cb87['error'](0x1f4,_0x285b17[_0xa8ee('0x11')]));});});};
\ No newline at end of file
index 9703a75..caa9ccc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda6a=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','describe','show','post','create','put','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda6a,0x14e));var _0xada6=function(_0x13dbbf,_0x15523a){_0x13dbbf=_0x13dbbf-0x0;var _0x2b4fe0=_0xda6a[_0x13dbbf];return _0x2b4fe0;};'use strict';var multer=require(_0xada6('0x0'));var util=require('util');var path=require(_0xada6('0x1'));var timeout=require(_0xada6('0x2'));var express=require(_0xada6('0x3'));var router=express[_0xada6('0x4')]();var fs_extra=require(_0xada6('0x5'));var auth=require(_0xada6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xada6('0x7'));var controller=require(_0xada6('0x8'));router[_0xada6('0x9')]('/',auth[_0xada6('0xa')](),controller[_0xada6('0xb')]);router['get']('/describe',auth[_0xada6('0xa')](),controller[_0xada6('0xc')]);router[_0xada6('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xada6('0xd')]);router[_0xada6('0xe')]('/',auth[_0xada6('0xa')](),controller[_0xada6('0xf')]);router[_0xada6('0x10')](_0xada6('0x11'),auth[_0xada6('0xa')](),controller[_0xada6('0x12')]);router[_0xada6('0x13')]('/:id',auth[_0xada6('0xa')](),controller[_0xada6('0x14')]);module[_0xada6('0x15')]=router;
\ No newline at end of file
+var _0x8782=['update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','describe','show','post','create','put','/:id'];(function(_0x2ddc59,_0x4451bc){var _0x3d4045=function(_0x25e6f9){while(--_0x25e6f9){_0x2ddc59['push'](_0x2ddc59['shift']());}};_0x3d4045(++_0x4451bc);}(_0x8782,0x97));var _0x2878=function(_0x72d656,_0x85ae0d){_0x72d656=_0x72d656-0x0;var _0x1f44d4=_0x8782[_0x72d656];return _0x1f44d4;};'use strict';var multer=require(_0x2878('0x0'));var util=require('util');var path=require(_0x2878('0x1'));var timeout=require(_0x2878('0x2'));var express=require(_0x2878('0x3'));var router=express['Router']();var fs_extra=require(_0x2878('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2878('0x5'));var config=require(_0x2878('0x6'));var controller=require(_0x2878('0x7'));router['get']('/',auth[_0x2878('0x8')](),controller[_0x2878('0x9')]);router[_0x2878('0xa')]('/describe',auth[_0x2878('0x8')](),controller[_0x2878('0xb')]);router[_0x2878('0xa')]('/:id',auth[_0x2878('0x8')](),controller[_0x2878('0xc')]);router[_0x2878('0xd')]('/',auth[_0x2878('0x8')](),controller[_0x2878('0xe')]);router[_0x2878('0xf')](_0x2878('0x10'),auth[_0x2878('0x8')](),controller[_0x2878('0x11')]);router[_0x2878('0x12')](_0x2878('0x10'),auth[_0x2878('0x8')](),controller[_0x2878('0x13')]);module[_0x2878('0x14')]=router;
\ No newline at end of file
index e2379b8..9e566d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x23e728,_0x21d571){var _0x548642=function(_0x2b7eaf){while(--_0x2b7eaf){_0x23e728['push'](_0x23e728['shift']());}};_0x548642(++_0x21d571);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2c0608,_0x173e4a){_0x2c0608=_0x2c0608-0x0;var _0x3123d9=_0xf4eb[_0x2c0608];return _0x3123d9;};'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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x2d3690,_0x1dcd3f){var _0x433792=function(_0x15b208){while(--_0x15b208){_0x2d3690['push'](_0x2d3690['shift']());}};_0x433792(++_0x1dcd3f);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3a7ee4,_0x165841){_0x3a7ee4=_0x3a7ee4-0x0;var _0x5c15b4=_0xf4eb[_0x3a7ee4];return _0x5c15b4;};'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 4bf7d62..e3e69cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38ec=['order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','length','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x3cd128,_0x4c36f5){var _0x1c3e99=function(_0x2b009f){while(--_0x2b009f){_0x3cd128['push'](_0x3cd128['shift']());}};_0x1c3e99(++_0x4c36f5);}(_0x38ec,0xa6));var _0xc38e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x38ec[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xc38e('0x0'));var rimraf=require(_0xc38e('0x1'));var zipdir=require(_0xc38e('0x2'));var jsonpatch=require(_0xc38e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc38e('0x4'));var Mustache=require('mustache');var util=require(_0xc38e('0x5'));var path=require(_0xc38e('0x6'));var sox=require(_0xc38e('0x7'));var csv=require(_0xc38e('0x8'));var ejs=require(_0xc38e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc38e('0xa'));var squel=require(_0xc38e('0xb'));var crypto=require(_0xc38e('0xc'));var jsforce=require(_0xc38e('0xd'));var deskjs=require(_0xc38e('0xe'));var toCsv=require(_0xc38e('0x8'));var querystring=require(_0xc38e('0xf'));var Papa=require(_0xc38e('0x10'));var Redis=require(_0xc38e('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc38e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc38e('0x13'))(_0xc38e('0x14'));var utils=require(_0xc38e('0x15'));var config=require(_0xc38e('0x16'));var licenseUtil=require(_0xc38e('0x17'));var db=require(_0xc38e('0x18'))['db'];function respondWithStatusCode(_0x22bf41,_0x309b81){_0x309b81=_0x309b81||0xcc;return function(_0x33c1d1){if(_0x33c1d1){return _0x22bf41[_0xc38e('0x19')](_0x309b81);}return _0x22bf41[_0xc38e('0x1a')](_0x309b81)['end']();};}function respondWithResult(_0x45c028,_0x7c105d){_0x7c105d=_0x7c105d||0xc8;return function(_0x337151){if(_0x337151){return _0x45c028[_0xc38e('0x1a')](_0x7c105d)[_0xc38e('0x1b')](_0x337151);}};}function respondWithFilteredResult(_0xd6b2ea,_0x26a6fb){return function(_0xca1988){if(_0xca1988){var _0x3bb910=typeof _0x26a6fb[_0xc38e('0x1c')]===_0xc38e('0x1d')&&typeof _0x26a6fb[_0xc38e('0x1e')]===_0xc38e('0x1d');var _0x3102d7=_0xca1988[_0xc38e('0x1f')];var _0x5cf87c=_0x3bb910?0x0:_0x26a6fb[_0xc38e('0x1c')];var _0x2f8eb3=_0x3bb910?_0xca1988[_0xc38e('0x1f')]:_0x26a6fb[_0xc38e('0x1c')]+_0x26a6fb['limit'];var _0x106704;if(_0x2f8eb3>=_0x3102d7){_0x2f8eb3=_0x3102d7;_0x106704=0xc8;}else{_0x106704=0xce;}_0xd6b2ea[_0xc38e('0x1a')](_0x106704);return _0xd6b2ea['set'](_0xc38e('0x20'),_0x5cf87c+'-'+_0x2f8eb3+'/'+_0x3102d7)[_0xc38e('0x1b')](_0xca1988);}return null;};}function patchUpdates(_0x16cada){return function(_0x149dcb){try{jsonpatch[_0xc38e('0x21')](_0x149dcb,_0x16cada,!![]);}catch(_0x53287f){return BPromise['reject'](_0x53287f);}return _0x149dcb[_0xc38e('0x22')]();};}function saveUpdates(_0x58e648,_0x5a92d9){return function(_0x24813c){if(_0x24813c){return _0x24813c[_0xc38e('0x23')](_0x58e648)[_0xc38e('0x24')](function(_0x4441c0){return _0x4441c0;});}return null;};}function removeEntity(_0x170b97,_0x438abd){return function(_0x3045fd){if(_0x3045fd){return _0x3045fd['destroy']()[_0xc38e('0x24')](function(){_0x170b97[_0xc38e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7960df,_0x45a389){return function(_0x26b91e){if(!_0x26b91e){_0x7960df[_0xc38e('0x19')](0x194);}return _0x26b91e;};}function handleError(_0x51d464,_0xe3864){_0xe3864=_0xe3864||0x1f4;return function(_0x27f69d){logger[_0xc38e('0x25')](_0x27f69d[_0xc38e('0x26')]);if(_0x27f69d[_0xc38e('0x27')]){delete _0x27f69d['name'];}_0x51d464[_0xc38e('0x1a')](_0xe3864)[_0xc38e('0x28')](_0x27f69d);};}exports[_0xc38e('0x29')]=function(_0x3bc1aa,_0x4dd41f){var _0xa05bc5={},_0x4540bc={},_0xbd09c5={'count':0x0,'rows':[]};var _0x44da3d=_[_0xc38e('0x2a')](db[_0xc38e('0x2b')][_0xc38e('0x2c')],function(_0x166368){return{'name':_0x166368[_0xc38e('0x2d')],'type':_0x166368[_0xc38e('0x2e')][_0xc38e('0x2f')]};});_0x4540bc[_0xc38e('0x30')]=_[_0xc38e('0x2a')](_0x44da3d,_0xc38e('0x27'));_0x4540bc[_0xc38e('0x31')]=_[_0xc38e('0x32')](_0x3bc1aa[_0xc38e('0x31')]);_0x4540bc[_0xc38e('0x33')]=_[_0xc38e('0x34')](_0x4540bc[_0xc38e('0x30')],_0x4540bc[_0xc38e('0x31')]);_0xa05bc5[_0xc38e('0x35')]=_['intersection'](_0x4540bc[_0xc38e('0x30')],qs[_0xc38e('0x36')](_0x3bc1aa['query'][_0xc38e('0x36')]));_0xa05bc5[_0xc38e('0x35')]=_0xa05bc5[_0xc38e('0x35')]['length']?_0xa05bc5['attributes']:_0x4540bc[_0xc38e('0x30')];if(!_0x3bc1aa[_0xc38e('0x31')][_0xc38e('0x37')]('nolimit')){_0xa05bc5['limit']=qs['limit'](_0x3bc1aa['query'][_0xc38e('0x1e')]);_0xa05bc5['offset']=qs['offset'](_0x3bc1aa['query'][_0xc38e('0x1c')]);}_0xa05bc5[_0xc38e('0x38')]=qs[_0xc38e('0x39')](_0x3bc1aa[_0xc38e('0x31')][_0xc38e('0x39')]);_0xa05bc5[_0xc38e('0x3a')]=qs[_0xc38e('0x33')](_['pick'](_0x3bc1aa[_0xc38e('0x31')],_0x4540bc['filters']),_0x44da3d);if(_0x3bc1aa[_0xc38e('0x31')][_0xc38e('0x3b')]){_0xa05bc5[_0xc38e('0x3a')]=_[_0xc38e('0x3c')](_0xa05bc5[_0xc38e('0x3a')],{'$or':_[_0xc38e('0x2a')](_0x44da3d,function(_0x49eff4){if(_0x49eff4[_0xc38e('0x2e')]!==_0xc38e('0x3d')){var _0x37c64a={};_0x37c64a[_0x49eff4[_0xc38e('0x27')]]={'$like':'%'+_0x3bc1aa[_0xc38e('0x31')]['filter']+'%'};return _0x37c64a;}})});}_0xa05bc5=_[_0xc38e('0x3c')]({},_0xa05bc5,_0x3bc1aa[_0xc38e('0x3e')]);var _0x4814c2={'where':_0xa05bc5[_0xc38e('0x3a')]};return db[_0xc38e('0x2b')][_0xc38e('0x1f')](_0x4814c2)[_0xc38e('0x24')](function(_0x53ee91){_0xbd09c5[_0xc38e('0x1f')]=_0x53ee91;if(_0x3bc1aa[_0xc38e('0x31')][_0xc38e('0x3f')]){_0xa05bc5[_0xc38e('0x40')]=[{'all':!![]}];}return db[_0xc38e('0x2b')][_0xc38e('0x41')](_0xa05bc5);})[_0xc38e('0x24')](function(_0x4363e6){_0xbd09c5[_0xc38e('0x42')]=_0x4363e6;return _0xbd09c5;})[_0xc38e('0x24')](respondWithFilteredResult(_0x4dd41f,_0xa05bc5))[_0xc38e('0x43')](handleError(_0x4dd41f,null));};exports['show']=function(_0x35c55b,_0x100632){var _0x25fe74={'raw':!![],'where':{'id':_0x35c55b['params']['id']}},_0x530e47={};_0x530e47['model']=_[_0xc38e('0x32')](db[_0xc38e('0x2b')][_0xc38e('0x2c')]);_0x530e47[_0xc38e('0x31')]=_['keys'](_0x35c55b[_0xc38e('0x31')]);_0x530e47[_0xc38e('0x33')]=_[_0xc38e('0x34')](_0x530e47[_0xc38e('0x30')],_0x530e47[_0xc38e('0x31')]);_0x25fe74[_0xc38e('0x35')]=_[_0xc38e('0x34')](_0x530e47[_0xc38e('0x30')],qs[_0xc38e('0x36')](_0x35c55b['query'][_0xc38e('0x36')]));_0x25fe74[_0xc38e('0x35')]=_0x25fe74['attributes'][_0xc38e('0x44')]?_0x25fe74[_0xc38e('0x35')]:_0x530e47[_0xc38e('0x30')];if(_0x35c55b[_0xc38e('0x31')][_0xc38e('0x3f')]){_0x25fe74[_0xc38e('0x40')]=[{'all':!![]}];}_0x25fe74=_[_0xc38e('0x3c')]({},_0x25fe74,_0x35c55b[_0xc38e('0x3e')]);return db[_0xc38e('0x2b')]['find'](_0x25fe74)[_0xc38e('0x24')](handleEntityNotFound(_0x100632,null))['then'](respondWithResult(_0x100632,null))[_0xc38e('0x43')](handleError(_0x100632,null));};exports[_0xc38e('0x45')]=function(_0x4f4f91,_0x258671){return db[_0xc38e('0x2b')][_0xc38e('0x45')](_0x4f4f91[_0xc38e('0x46')],{})[_0xc38e('0x24')](respondWithResult(_0x258671,0xc9))[_0xc38e('0x43')](handleError(_0x258671,null));};exports['update']=function(_0x446791,_0x1ca673){if(_0x446791['body']['id']){delete _0x446791['body']['id'];}return db[_0xc38e('0x2b')][_0xc38e('0x47')]({'where':{'id':_0x446791[_0xc38e('0x48')]['id']}})[_0xc38e('0x24')](handleEntityNotFound(_0x1ca673,null))[_0xc38e('0x24')](saveUpdates(_0x446791[_0xc38e('0x46')],null))[_0xc38e('0x24')](respondWithResult(_0x1ca673,null))[_0xc38e('0x43')](handleError(_0x1ca673,null));};exports['destroy']=function(_0x376f9d,_0x1c13f2){return db['ChatTransferReport']['find']({'where':{'id':_0x376f9d[_0xc38e('0x48')]['id']}})[_0xc38e('0x24')](handleEntityNotFound(_0x1c13f2,null))[_0xc38e('0x24')](removeEntity(_0x1c13f2,null))[_0xc38e('0x43')](handleError(_0x1c13f2,null));};exports[_0xc38e('0x49')]=function(_0x102ecf,_0x465b56){return db[_0xc38e('0x2b')]['describe']()[_0xc38e('0x24')](respondWithResult(_0x465b56,null))['catch'](handleError(_0x465b56,null));};
\ No newline at end of file
+var _0xd67d=['error','name','send','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','keys','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x1ea1d7,_0x244b88){var _0x1a431c=function(_0x5bcd21){while(--_0x5bcd21){_0x1ea1d7['push'](_0x1ea1d7['shift']());}};_0x1a431c(++_0x244b88);}(_0xd67d,0xbd));var _0xdd67=function(_0x2c1dcd,_0x350452){_0x2c1dcd=_0x2c1dcd-0x0;var _0x158ce5=_0xd67d[_0x2c1dcd];return _0x158ce5;};'use strict';var emlformat=require(_0xdd67('0x0'));var rimraf=require(_0xdd67('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdd67('0x2'));var rp=require(_0xdd67('0x3'));var moment=require(_0xdd67('0x4'));var BPromise=require(_0xdd67('0x5'));var Mustache=require(_0xdd67('0x6'));var util=require(_0xdd67('0x7'));var path=require(_0xdd67('0x8'));var sox=require(_0xdd67('0x9'));var csv=require(_0xdd67('0xa'));var ejs=require(_0xdd67('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdd67('0xc'));var squel=require(_0xdd67('0xd'));var crypto=require(_0xdd67('0xe'));var jsforce=require(_0xdd67('0xf'));var deskjs=require(_0xdd67('0x10'));var toCsv=require(_0xdd67('0xa'));var querystring=require(_0xdd67('0x11'));var Papa=require(_0xdd67('0x12'));var Redis=require(_0xdd67('0x13'));var authService=require(_0xdd67('0x14'));var qs=require(_0xdd67('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdd67('0x16'));var logger=require('../../config/logger')(_0xdd67('0x17'));var utils=require(_0xdd67('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xdd67('0x19'));var db=require(_0xdd67('0x1a'))['db'];function respondWithStatusCode(_0x21cf73,_0x367214){_0x367214=_0x367214||0xcc;return function(_0x2d11ba){if(_0x2d11ba){return _0x21cf73[_0xdd67('0x1b')](_0x367214);}return _0x21cf73[_0xdd67('0x1c')](_0x367214)[_0xdd67('0x1d')]();};}function respondWithResult(_0x593124,_0xe1bccc){_0xe1bccc=_0xe1bccc||0xc8;return function(_0x2b31c0){if(_0x2b31c0){return _0x593124['status'](_0xe1bccc)[_0xdd67('0x1e')](_0x2b31c0);}};}function respondWithFilteredResult(_0x589ff9,_0x4b7004){return function(_0x445b35){if(_0x445b35){var _0x1d3f7f=typeof _0x4b7004['offset']==='undefined'&&typeof _0x4b7004[_0xdd67('0x1f')]==='undefined';var _0xa5e290=_0x445b35[_0xdd67('0x20')];var _0x2fa37e=_0x1d3f7f?0x0:_0x4b7004[_0xdd67('0x21')];var _0x2da65a=_0x1d3f7f?_0x445b35[_0xdd67('0x20')]:_0x4b7004[_0xdd67('0x21')]+_0x4b7004[_0xdd67('0x1f')];var _0x2a4496;if(_0x2da65a>=_0xa5e290){_0x2da65a=_0xa5e290;_0x2a4496=0xc8;}else{_0x2a4496=0xce;}_0x589ff9[_0xdd67('0x1c')](_0x2a4496);return _0x589ff9[_0xdd67('0x22')](_0xdd67('0x23'),_0x2fa37e+'-'+_0x2da65a+'/'+_0xa5e290)[_0xdd67('0x1e')](_0x445b35);}return null;};}function patchUpdates(_0x1ac5dd){return function(_0x3ba201){try{jsonpatch[_0xdd67('0x24')](_0x3ba201,_0x1ac5dd,!![]);}catch(_0x385280){return BPromise[_0xdd67('0x25')](_0x385280);}return _0x3ba201[_0xdd67('0x26')]();};}function saveUpdates(_0x2c79bb,_0x5cd7d1){return function(_0x21f2c7){if(_0x21f2c7){return _0x21f2c7[_0xdd67('0x27')](_0x2c79bb)[_0xdd67('0x28')](function(_0x2f5da8){return _0x2f5da8;});}return null;};}function removeEntity(_0x49e802,_0x5e597d){return function(_0x5a671b){if(_0x5a671b){return _0x5a671b[_0xdd67('0x29')]()[_0xdd67('0x28')](function(){_0x49e802['status'](0xcc)[_0xdd67('0x1d')]();});}};}function handleEntityNotFound(_0x22277f,_0x228d61){return function(_0x201b82){if(!_0x201b82){_0x22277f[_0xdd67('0x1b')](0x194);}return _0x201b82;};}function handleError(_0x517d35,_0x69a726){_0x69a726=_0x69a726||0x1f4;return function(_0x4205e4){logger[_0xdd67('0x2a')](_0x4205e4['stack']);if(_0x4205e4[_0xdd67('0x2b')]){delete _0x4205e4[_0xdd67('0x2b')];}_0x517d35[_0xdd67('0x1c')](_0x69a726)[_0xdd67('0x2c')](_0x4205e4);};}exports['index']=function(_0x410941,_0x3bf23b){var _0x2071f6={},_0x4532f1={},_0x38820d={'count':0x0,'rows':[]};var _0x3fe580=_[_0xdd67('0x2d')](db[_0xdd67('0x2e')][_0xdd67('0x2f')],function(_0x4b45a4){return{'name':_0x4b45a4[_0xdd67('0x30')],'type':_0x4b45a4[_0xdd67('0x31')][_0xdd67('0x32')]};});_0x4532f1[_0xdd67('0x33')]=_['map'](_0x3fe580,_0xdd67('0x2b'));_0x4532f1[_0xdd67('0x34')]=_['keys'](_0x410941[_0xdd67('0x34')]);_0x4532f1[_0xdd67('0x35')]=_[_0xdd67('0x36')](_0x4532f1['model'],_0x4532f1['query']);_0x2071f6['attributes']=_[_0xdd67('0x36')](_0x4532f1['model'],qs['fields'](_0x410941[_0xdd67('0x34')][_0xdd67('0x37')]));_0x2071f6['attributes']=_0x2071f6[_0xdd67('0x38')][_0xdd67('0x39')]?_0x2071f6[_0xdd67('0x38')]:_0x4532f1[_0xdd67('0x33')];if(!_0x410941[_0xdd67('0x34')][_0xdd67('0x3a')](_0xdd67('0x3b'))){_0x2071f6[_0xdd67('0x1f')]=qs[_0xdd67('0x1f')](_0x410941[_0xdd67('0x34')][_0xdd67('0x1f')]);_0x2071f6[_0xdd67('0x21')]=qs[_0xdd67('0x21')](_0x410941[_0xdd67('0x34')]['offset']);}_0x2071f6[_0xdd67('0x3c')]=qs[_0xdd67('0x3d')](_0x410941[_0xdd67('0x34')]['sort']);_0x2071f6['where']=qs[_0xdd67('0x35')](_[_0xdd67('0x3e')](_0x410941[_0xdd67('0x34')],_0x4532f1[_0xdd67('0x35')]),_0x3fe580);if(_0x410941[_0xdd67('0x34')][_0xdd67('0x3f')]){_0x2071f6[_0xdd67('0x40')]=_[_0xdd67('0x41')](_0x2071f6[_0xdd67('0x40')],{'$or':_['map'](_0x3fe580,function(_0x2722fc){if(_0x2722fc['type']!==_0xdd67('0x42')){var _0x449c84={};_0x449c84[_0x2722fc[_0xdd67('0x2b')]]={'$like':'%'+_0x410941[_0xdd67('0x34')][_0xdd67('0x3f')]+'%'};return _0x449c84;}})});}_0x2071f6=_[_0xdd67('0x41')]({},_0x2071f6,_0x410941[_0xdd67('0x43')]);var _0x5b76e5={'where':_0x2071f6['where']};return db[_0xdd67('0x2e')][_0xdd67('0x20')](_0x5b76e5)[_0xdd67('0x28')](function(_0x2e18af){_0x38820d[_0xdd67('0x20')]=_0x2e18af;if(_0x410941[_0xdd67('0x34')][_0xdd67('0x44')]){_0x2071f6['include']=[{'all':!![]}];}return db[_0xdd67('0x2e')][_0xdd67('0x45')](_0x2071f6);})[_0xdd67('0x28')](function(_0x585cc8){_0x38820d[_0xdd67('0x46')]=_0x585cc8;return _0x38820d;})[_0xdd67('0x28')](respondWithFilteredResult(_0x3bf23b,_0x2071f6))['catch'](handleError(_0x3bf23b,null));};exports['show']=function(_0x28a9f5,_0xa73484){var _0x525eed={'raw':!![],'where':{'id':_0x28a9f5['params']['id']}},_0x116e05={};_0x116e05['model']=_[_0xdd67('0x47')](db[_0xdd67('0x2e')][_0xdd67('0x2f')]);_0x116e05['query']=_[_0xdd67('0x47')](_0x28a9f5[_0xdd67('0x34')]);_0x116e05[_0xdd67('0x35')]=_[_0xdd67('0x36')](_0x116e05[_0xdd67('0x33')],_0x116e05[_0xdd67('0x34')]);_0x525eed[_0xdd67('0x38')]=_[_0xdd67('0x36')](_0x116e05[_0xdd67('0x33')],qs[_0xdd67('0x37')](_0x28a9f5[_0xdd67('0x34')][_0xdd67('0x37')]));_0x525eed[_0xdd67('0x38')]=_0x525eed[_0xdd67('0x38')]['length']?_0x525eed[_0xdd67('0x38')]:_0x116e05[_0xdd67('0x33')];if(_0x28a9f5[_0xdd67('0x34')][_0xdd67('0x44')]){_0x525eed['include']=[{'all':!![]}];}_0x525eed=_[_0xdd67('0x41')]({},_0x525eed,_0x28a9f5[_0xdd67('0x43')]);return db[_0xdd67('0x2e')][_0xdd67('0x48')](_0x525eed)[_0xdd67('0x28')](handleEntityNotFound(_0xa73484,null))[_0xdd67('0x28')](respondWithResult(_0xa73484,null))[_0xdd67('0x49')](handleError(_0xa73484,null));};exports[_0xdd67('0x4a')]=function(_0x5be4d7,_0x4058ed){return db[_0xdd67('0x2e')][_0xdd67('0x4a')](_0x5be4d7['body'],{})[_0xdd67('0x28')](respondWithResult(_0x4058ed,0xc9))['catch'](handleError(_0x4058ed,null));};exports[_0xdd67('0x27')]=function(_0x214e9d,_0x111be6){if(_0x214e9d[_0xdd67('0x4b')]['id']){delete _0x214e9d[_0xdd67('0x4b')]['id'];}return db[_0xdd67('0x2e')]['find']({'where':{'id':_0x214e9d['params']['id']}})['then'](handleEntityNotFound(_0x111be6,null))['then'](saveUpdates(_0x214e9d[_0xdd67('0x4b')],null))[_0xdd67('0x28')](respondWithResult(_0x111be6,null))[_0xdd67('0x49')](handleError(_0x111be6,null));};exports[_0xdd67('0x29')]=function(_0x1c2c27,_0x35b070){return db[_0xdd67('0x2e')][_0xdd67('0x48')]({'where':{'id':_0x1c2c27['params']['id']}})['then'](handleEntityNotFound(_0x35b070,null))[_0xdd67('0x28')](removeEntity(_0x35b070,null))[_0xdd67('0x49')](handleError(_0x35b070,null));};exports[_0xdd67('0x4c')]=function(_0x51d101,_0x591798){return db[_0xdd67('0x2e')]['describe']()[_0xdd67('0x28')](respondWithResult(_0x591798,null))[_0xdd67('0x49')](handleError(_0x591798,null));};
\ No newline at end of file
index 2a5ea3f..0076a20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdee5=['rimraf','exports','define','ChatTransferReport','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x45715c,_0x17caa5){var _0x2141ef=function(_0x54d51c){while(--_0x54d51c){_0x45715c['push'](_0x45715c['shift']());}};_0x2141ef(++_0x17caa5);}(_0xdee5,0x191));var _0x5dee=function(_0x35027c,_0x4af623){_0x35027c=_0x35027c-0x0;var _0x4bba7d=_0xdee5[_0x35027c];return _0x4bba7d;};'use strict';var _=require('lodash');var util=require(_0x5dee('0x0'));var logger=require(_0x5dee('0x1'))(_0x5dee('0x2'));var moment=require(_0x5dee('0x3'));var BPromise=require(_0x5dee('0x4'));var rp=require(_0x5dee('0x5'));var fs=require('fs');var path=require(_0x5dee('0x6'));var rimraf=require(_0x5dee('0x7'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0x5dee('0x8')]=function(_0x2eeb9e,_0x45fde0){return _0x2eeb9e[_0x5dee('0x9')](_0x5dee('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x5dee('0xb'),'fields':[_0x5dee('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9b7a=['api','bluebird','rimraf','../../config/environment','./chatTransferReport.attributes','define','report_chat_transfer','uniqueid','lodash','../../config/logger'];(function(_0x50b6b8,_0x35d7cb){var _0x3bf466=function(_0x26943d){while(--_0x26943d){_0x50b6b8['push'](_0x50b6b8['shift']());}};_0x3bf466(++_0x35d7cb);}(_0x9b7a,0x17a));var _0xa9b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9b7a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa9b7('0x0'));var util=require('util');var logger=require(_0xa9b7('0x1'))(_0xa9b7('0x2'));var moment=require('moment');var BPromise=require(_0xa9b7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa9b7('0x4'));var config=require(_0xa9b7('0x5'));var attributes=require(_0xa9b7('0x6'));module['exports']=function(_0x95c30f,_0x2eea15){return _0x95c30f[_0xa9b7('0x7')]('ChatTransferReport',attributes,{'tableName':_0xa9b7('0x8'),'paranoid':![],'indexes':[{'name':_0xa9b7('0x9'),'fields':[_0xa9b7('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index 8870f14..43f337c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x790f=['error','code','ChatTransferReport,\x20%s,\x20%s','message','request\x20sent','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x790f,0x1e5));var _0xf790=function(_0x36f47c,_0x38ef4d){_0x36f47c=_0x36f47c-0x0;var _0x296c55=_0x790f[_0x36f47c];return _0x296c55;};'use strict';var _=require(_0xf790('0x0'));var util=require(_0xf790('0x1'));var moment=require(_0xf790('0x2'));var BPromise=require(_0xf790('0x3'));var rs=require(_0xf790('0x4'));var fs=require('fs');var Redis=require(_0xf790('0x5'));var db=require(_0xf790('0x6'))['db'];var utils=require(_0xf790('0x7'));var logger=require(_0xf790('0x8'))('rpc');var config=require(_0xf790('0x9'));var jayson=require(_0xf790('0xa'));var client=jayson[_0xf790('0xb')][_0xf790('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1befe4,_0x4b9ba5,_0x1bdc95){return new BPromise(function(_0x4e5303,_0x33c1a1){return client[_0xf790('0xd')](_0x1befe4,_0x1bdc95)[_0xf790('0xe')](function(_0x56c9ef){logger[_0xf790('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x4b9ba5,'request\x20sent');logger[_0xf790('0x10')](_0xf790('0x11'),_0x4b9ba5,'request\x20sent',JSON[_0xf790('0x12')](_0x56c9ef));if(_0x56c9ef[_0xf790('0x13')]){if(_0x56c9ef[_0xf790('0x13')][_0xf790('0x14')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x4b9ba5,_0x56c9ef[_0xf790('0x13')]['message']);return _0x33c1a1(_0x56c9ef[_0xf790('0x13')]['message']);}logger[_0xf790('0x13')](_0xf790('0x15'),_0x4b9ba5,_0x56c9ef[_0xf790('0x13')]['message']);return _0x4e5303(_0x56c9ef[_0xf790('0x13')][_0xf790('0x16')]);}else{logger[_0xf790('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x4b9ba5,_0xf790('0x17'));_0x4e5303(_0x56c9ef['result'][_0xf790('0x16')]);}})['catch'](function(_0x3db6ea){logger[_0xf790('0x13')](_0xf790('0x15'),_0x4b9ba5,_0x3db6ea);_0x33c1a1(_0x3db6ea);});});}
\ No newline at end of file
+var _0xd365=['result','catch','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x19ae02,_0x32d426){var _0x575138=function(_0x16c94a){while(--_0x16c94a){_0x19ae02['push'](_0x19ae02['shift']());}};_0x575138(++_0x32d426);}(_0xd365,0x1e5));var _0x5d36=function(_0x3dfcf1,_0x99ca71){_0x3dfcf1=_0x3dfcf1-0x0;var _0x37867b=_0xd365[_0x3dfcf1];return _0x37867b;};'use strict';var _=require('lodash');var util=require(_0x5d36('0x0'));var moment=require(_0x5d36('0x1'));var BPromise=require(_0x5d36('0x2'));var rs=require(_0x5d36('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5d36('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5d36('0x5'));var config=require(_0x5d36('0x6'));var jayson=require(_0x5d36('0x7'));var client=jayson[_0x5d36('0x8')][_0x5d36('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35a085,_0x498f68,_0x386b4d){return new BPromise(function(_0x56ce51,_0x4f0095){return client[_0x5d36('0xa')](_0x35a085,_0x386b4d)[_0x5d36('0xb')](function(_0xafdb60){logger[_0x5d36('0xc')](_0x5d36('0xd'),_0x498f68,_0x5d36('0xe'));logger['debug'](_0x5d36('0xf'),_0x498f68,_0x5d36('0xe'),JSON['stringify'](_0xafdb60));if(_0xafdb60[_0x5d36('0x10')]){if(_0xafdb60[_0x5d36('0x10')][_0x5d36('0x11')]===0x1f4){logger[_0x5d36('0x10')](_0x5d36('0xd'),_0x498f68,_0xafdb60[_0x5d36('0x10')][_0x5d36('0x12')]);return _0x4f0095(_0xafdb60[_0x5d36('0x10')][_0x5d36('0x12')]);}logger[_0x5d36('0x10')](_0x5d36('0xd'),_0x498f68,_0xafdb60[_0x5d36('0x10')]['message']);return _0x56ce51(_0xafdb60[_0x5d36('0x10')][_0x5d36('0x12')]);}else{logger['info'](_0x5d36('0xd'),_0x498f68,_0x5d36('0xe'));_0x56ce51(_0xafdb60[_0x5d36('0x13')][_0x5d36('0x12')]);}})[_0x5d36('0x14')](function(_0x3b9292){logger[_0x5d36('0x10')](_0x5d36('0xd'),_0x498f68,_0x3b9292);_0x4f0095(_0x3b9292);});});}
\ No newline at end of file
index 8b83542..99b9e87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46b1=['get','/describe','isAuthenticated','describe','/:id','post','create','put','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x46b1,0x9a));var _0x146b=function(_0x4d672c,_0x15a6e0){_0x4d672c=_0x4d672c-0x0;var _0x22dc61=_0x46b1[_0x4d672c];return _0x22dc61;};'use strict';var multer=require(_0x146b('0x0'));var util=require(_0x146b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x146b('0x2'));var router=express[_0x146b('0x3')]();var fs_extra=require(_0x146b('0x4'));var auth=require(_0x146b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x146b('0x6'));var controller=require(_0x146b('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x146b('0x8')](_0x146b('0x9'),auth[_0x146b('0xa')](),controller[_0x146b('0xb')]);router['get'](_0x146b('0xc'),auth[_0x146b('0xa')](),controller['show']);router[_0x146b('0xd')]('/',auth[_0x146b('0xa')](),controller[_0x146b('0xe')]);router[_0x146b('0xf')]('/:id',auth[_0x146b('0xa')](),controller['update']);router[_0x146b('0x10')](_0x146b('0xc'),auth[_0x146b('0xa')](),controller['destroy']);module[_0x146b('0x11')]=router;
\ No newline at end of file
+var _0x4dc8=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','post','create','put','destroy','exports'];(function(_0x3eda5d,_0x2320c4){var _0x5cdebc=function(_0x1de022){while(--_0x1de022){_0x3eda5d['push'](_0x3eda5d['shift']());}};_0x5cdebc(++_0x2320c4);}(_0x4dc8,0x143));var _0x84dc=function(_0xd498a,_0x1be1b9){_0xd498a=_0xd498a-0x0;var _0x3e802e=_0x4dc8[_0xd498a];return _0x3e802e;};'use strict';var multer=require(_0x84dc('0x0'));var util=require('util');var path=require(_0x84dc('0x1'));var timeout=require('connect-timeout');var express=require(_0x84dc('0x2'));var router=express[_0x84dc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x84dc('0x4'));var interaction=require(_0x84dc('0x5'));var config=require(_0x84dc('0x6'));var controller=require('./chatTransferReport.controller');router[_0x84dc('0x7')]('/',auth[_0x84dc('0x8')](),controller[_0x84dc('0x9')]);router[_0x84dc('0x7')]('/describe',auth[_0x84dc('0x8')](),controller[_0x84dc('0xa')]);router[_0x84dc('0x7')]('/:id',auth[_0x84dc('0x8')](),controller[_0x84dc('0xb')]);router[_0x84dc('0xc')]('/',auth['isAuthenticated'](),controller[_0x84dc('0xd')]);router[_0x84dc('0xe')]('/:id',auth[_0x84dc('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x84dc('0xf')]);module[_0x84dc('0x10')]=router;
\ No newline at end of file
index 9e13544..7c83317 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99e9=['System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}'];(function(_0x366ef2,_0x16e62f){var _0x51a5f3=function(_0x2d32ea){while(--_0x2d32ea){_0x366ef2['push'](_0x366ef2['shift']());}};_0x51a5f3(++_0x16e62f);}(_0x99e9,0xb4));var _0x999e=function(_0x57a50d,_0x2871f8){_0x57a50d=_0x57a50d-0x0;var _0x1b25b3=_0x99e9[_0x57a50d];return _0x1b25b3;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x999e('0x0'));module[_0x999e('0x1')]={'name':{'type':Sequelize[_0x999e('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x999e('0x2')]},'mapKey':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x4')},'customerAlias':{'type':Sequelize[_0x999e('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':_0x999e('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':_0x999e('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':_0x999e('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x999e('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x999e('0x2')]},'animation':{'type':Sequelize[_0x999e('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x999e('0x9')](_0x999e('0xa'),_0x999e('0xb')),'defaultValue':_0x999e('0xa')},'header_online':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0xc')},'start_chat_button':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0xf')},'download_transcript':{'type':Sequelize[_0x999e('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x999e('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x999e('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x13')},'noteTitle':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0x15')},'closingMessageButton':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0xe')},'skipMessageButton':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x16')},'conditionAgreement':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x17')},'ratingType':{'type':Sequelize['ENUM'](_0x999e('0x18'),_0x999e('0x19')),'defaultValue':_0x999e('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x999e('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x999e('0x11')],'defaultValue':function(){return JSON[_0x999e('0x1a')]({'items':[{'type':_0x999e('0x1b'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0x999e('0x1c'),'helpText':''}},{'type':_0x999e('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x999e('0x3'),'type':_0x999e('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x999e('0x1d')](_0x999e('0x1e'))?JSON[_0x999e('0x1f')](this[_0x999e('0x1d')]('onlineForm')):{};},'set':function(_0x2e1cc5){return this[_0x999e('0x20')](_0x999e('0x1e'),JSON[_0x999e('0x1a')](_0x2e1cc5));}},'offlineForm':{'type':Sequelize[_0x999e('0x11')],'defaultValue':function(){return JSON[_0x999e('0x1a')]({'items':[{'type':_0x999e('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x999e('0x3'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':_0x999e('0x21')},'props':{'title':_0x999e('0x21'),'helpText':_0x999e('0x22')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x999e('0x23'))?JSON[_0x999e('0x1f')](this[_0x999e('0x1d')](_0x999e('0x23'))):{};},'set':function(_0x15dca1){return this[_0x999e('0x20')](_0x999e('0x23'),JSON[_0x999e('0x1a')](_0x15dca1));}},'token':{'type':Sequelize[_0x999e('0x2')],'defaultValue':function(){return rs[_0x999e('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x999e('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x999e('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x25')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x999e('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x999e('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x16')},'sendUnmanaged':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x999e('0x11')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x999e('0x2')]},'notificationTemplate':{'type':Sequelize[_0x999e('0x11')],'defaultValue':function(){return _0x999e('0x27');}},'notificationSound':{'type':Sequelize[_0x999e('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x999e('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x999e('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x999e('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x999e('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x999e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x999e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x28')},'systemAvatar':{'type':Sequelize[_0x999e('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x999e('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![],'comment':_0x999e('0x29'),'set':function(_0x1e1229){if(!_0x1e1229)this[_0x999e('0x20')]('mandatoryDispositionPauseId',null);this[_0x999e('0x20')]('mandatoryDisposition',_0x1e1229);}},'vidaooEscalation':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x999e('0x2')]},'vidaooTopic':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':_0x999e('0x2a')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x999e('0x2b');}},'vidaooMetadata':{'type':Sequelize[_0x999e('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x2750=['BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Send','Feedback','thumb','star','stringify','name','input','getDataValue','parse','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','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}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','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'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2750,0x13b));var _0x0275=function(_0x1ed8c3,_0x169ba1){_0x1ed8c3=_0x1ed8c3-0x0;var _0x1b71ab=_0x2750[_0x1ed8c3];return _0x1b71ab;};'use strict';var Sequelize=require(_0x0275('0x0'));var rs=require('randomstring');module[_0x0275('0x1')]={'name':{'type':Sequelize[_0x0275('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'unique':_0x0275('0x3')},'description':{'type':Sequelize[_0x0275('0x2')]},'mapKey':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x4')},'mapKeyOffline':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x4')},'key':{'type':Sequelize[_0x0275('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x5')},'customerAlias':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0275('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x0275('0xa')](_0x0275('0xb'),_0x0275('0xc')),'defaultValue':_0x0275('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0xd')},'start_chat_button':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0xf')},'download_transcript':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0275('0x11')]},'closingQuestion':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x13')},'noteTitle':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x14')},'skipMessageButton':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x15')},'ratingType':{'type':Sequelize['ENUM']('star',_0x0275('0x16')),'defaultValue':_0x0275('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x0275('0x18')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x0275('0x19'),'type':'text','required':!![]},'props':{'title':_0x0275('0x19'),'helpText':''}},{'type':_0x0275('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x0275('0x4'),'type':_0x0275('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0275('0x1b')]('onlineForm')?JSON[_0x0275('0x1c')](this[_0x0275('0x1b')](_0x0275('0x1d'))):{};},'set':function(_0x15813f){return this[_0x0275('0x1e')](_0x0275('0x1d'),JSON['stringify'](_0x15813f));}},'offlineForm':{'type':Sequelize[_0x0275('0x11')],'defaultValue':function(){return JSON[_0x0275('0x18')]({'items':[{'type':_0x0275('0x1a'),'props':{'title':_0x0275('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x0275('0x4'),'type':'email'},'variable':null},{'type':_0x0275('0x1f'),'config':{'placeholder':_0x0275('0x20')},'props':{'title':_0x0275('0x20'),'helpText':_0x0275('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x0275('0x1b')]('offlineForm')?JSON[_0x0275('0x1c')](this[_0x0275('0x1b')](_0x0275('0x22'))):{};},'set':function(_0x489d7f){return this['setDataValue'](_0x0275('0x22'),JSON[_0x0275('0x18')](_0x489d7f));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x0275('0x23')]();}},'autoclose':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0275('0x2')]},'waitingTitle':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x24')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x25')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x28')},'skipUnmanaged':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x29')},'sendUnmanaged':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x0275('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x0275('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x0275('0x2a');}},'notificationSound':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x0275('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2c')},'verticalAlignment':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2d')},'defaultTitle':{'type':Sequelize[_0x0275('0x2')]},'customerAvatar':{'type':Sequelize[_0x0275('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0275('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0275('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0275('0x8')],'comment':_0x0275('0x30')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0275('0x31'),'set':function(_0x76b8fa){if(!_0x76b8fa)this[_0x0275('0x1e')](_0x0275('0x32'),null);this[_0x0275('0x1e')](_0x0275('0x33'),_0x76b8fa);}},'vidaooEscalation':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x34')},'vidaooNote':{'type':Sequelize[_0x0275('0x2')],'defaultValue':function(){return _0x0275('0x35');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x0275('0x11')]}};
\ No newline at end of file
index 4292fe1..cad9f22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa7f=['redis','defaults','localhost','./chatWebsite.socket','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','update','destroy','get','ChatWebsites','stack','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','Pause','keys','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','removeDispositions','ids','CannedAnswer','getAnswers','findOne','hasOwnProperty','findAll','removeAnswers','addLogo','sitepic','file','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','../../config/license/util','getLicense','custom','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','notify','user-agent-parser','setUA','headers','getResult','chat','CmContact','Sequelize','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','CmList','List','Contacts','DESC','Applications','account','list','applications','orderBy','priority','asc','contact','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','push','close','ChatMessage','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','fromString','originalname','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','interval','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','inspect','No\x20timezone','Interval','Intervals','getProactiveActions','increment','chatLicenseExceeded','all','some','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','finally','getApplications','addProactiveActions','omit','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','Contact','addAgents','spread','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','User','bluebird','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment'];(function(_0x2e1e9f,_0x294546){var _0x1d79f5=function(_0x5fdcf5){while(--_0x5fdcf5){_0x2e1e9f['push'](_0x2e1e9f['shift']());}};_0x1d79f5(++_0x294546);}(_0xfa7f,0x11d));var _0xffa7=function(_0x143f75,_0x290630){_0x143f75=_0x143f75-0x0;var _0x56c94f=_0xfa7f[_0x143f75];return _0x56c94f;};'use strict';var BPromise=require(_0xffa7('0x0'));var Mustache=require(_0xffa7('0x1'));var util=require(_0xffa7('0x2'));var path=require(_0xffa7('0x3'));var ejs=require(_0xffa7('0x4'));var fs=require('fs');var fs_extra=require(_0xffa7('0x5'));var _=require(_0xffa7('0x6'));var querystring=require(_0xffa7('0x7'));var Redis=require(_0xffa7('0x8'));var qs=require(_0xffa7('0x9'));var logger=require(_0xffa7('0xa'))(_0xffa7('0xb'));var config=require(_0xffa7('0xc'));var db=require('../../mysqldb')['db'];config[_0xffa7('0xd')]=_[_0xffa7('0xe')](config['redis'],{'host':_0xffa7('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xffa7('0xd')]));require(_0xffa7('0x10'))['register'](socket);var htmlToText=require(_0xffa7('0x11'));var jayson=require(_0xffa7('0x12'));var client=jayson[_0xffa7('0x13')][_0xffa7('0x14')]({'port':0x232c});var client9002=jayson[_0xffa7('0x13')][_0xffa7('0x14')]({'port':0x232a});var client9003=jayson[_0xffa7('0x13')][_0xffa7('0x14')]({'port':0x232b});var client9001=jayson[_0xffa7('0x13')][_0xffa7('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x299911,_0x5c6457,_0x1fa5d2,_0x32ed18){return new BPromise(function(_0x2912fa,_0x426ac3){var _0x1884cd=_0x32ed18||client;return _0x1884cd[_0xffa7('0x15')](_0x299911,_0x1fa5d2)[_0xffa7('0x16')](function(_0x248cb){logger[_0xffa7('0x17')](_0xffa7('0x18'),_0x5c6457,_0xffa7('0x19'));logger[_0xffa7('0x1a')](_0xffa7('0x1b'),_0x5c6457,'request\x20sent',JSON['stringify'](_0x248cb));if(_0x248cb[_0xffa7('0x1c')]){if(_0x248cb[_0xffa7('0x1c')][_0xffa7('0x1d')]===0x1f4){logger[_0xffa7('0x1c')](_0xffa7('0x18'),_0x5c6457,_0x248cb[_0xffa7('0x1c')]['message']);return _0x426ac3(_0x248cb['error'][_0xffa7('0x1e')]);}logger[_0xffa7('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x5c6457,_0x248cb[_0xffa7('0x1c')][_0xffa7('0x1e')]);return _0x2912fa(_0x248cb[_0xffa7('0x1c')][_0xffa7('0x1e')]);}else{logger[_0xffa7('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x5c6457,_0xffa7('0x19'));_0x2912fa(_0x248cb['result'][_0xffa7('0x1e')]);}})[_0xffa7('0x1f')](function(_0x5b4b33){logger[_0xffa7('0x1c')](_0xffa7('0x18'),_0x5c6457,_0x5b4b33);_0x426ac3(_0x5b4b33);});});}function respondWithStatusCode(_0xf9051,_0x205674){_0x205674=_0x205674||0xcc;return function(_0x4520fe){if(_0x4520fe){return _0xf9051[_0xffa7('0x20')](_0x205674);}return _0xf9051['status'](_0x205674)[_0xffa7('0x21')]();};}function respondWithResult(_0x17006e,_0x21171f){_0x21171f=_0x21171f||0xc8;return function(_0x3b3581){if(_0x3b3581){return _0x17006e[_0xffa7('0x22')](_0x21171f)['json'](_0x3b3581);}};}function respondWithFilteredResult(_0x5cd2ee,_0x4996f1){return function(_0x1fce85){if(_0x1fce85){var _0xe2552b=typeof _0x4996f1['offset']===_0xffa7('0x23')&&typeof _0x4996f1[_0xffa7('0x24')]===_0xffa7('0x23');var _0x5225b4=_0x1fce85[_0xffa7('0x25')];var _0x5042b4=_0xe2552b?0x0:_0x4996f1[_0xffa7('0x26')];var _0x52b757=_0xe2552b?_0x1fce85[_0xffa7('0x25')]:_0x4996f1['offset']+_0x4996f1[_0xffa7('0x24')];var _0x30f24d;if(_0x52b757>=_0x5225b4){_0x52b757=_0x5225b4;_0x30f24d=0xc8;}else{_0x30f24d=0xce;}_0x5cd2ee[_0xffa7('0x22')](_0x30f24d);return _0x5cd2ee[_0xffa7('0x27')](_0xffa7('0x28'),_0x5042b4+'-'+_0x52b757+'/'+_0x5225b4)[_0xffa7('0x29')](_0x1fce85);}return null;};}function saveUpdates(_0x374e82){return function(_0x28e4f0){if(_0x28e4f0){return _0x28e4f0[_0xffa7('0x2a')](_0x374e82)['then'](function(_0x2ec522){return _0x2ec522;});}return null;};}function removeEntity(_0x16f27e){return function(_0x167648){if(_0x167648){return _0x167648[_0xffa7('0x2b')]()[_0xffa7('0x16')](function(){var _0x3fa0f6=_0x167648[_0xffa7('0x2c')]({'plain':!![]});var _0x36f5fc=_0xffa7('0x2d');return db['UserProfileResource'][_0xffa7('0x2b')]({'where':{'type':_0x36f5fc,'resourceId':_0x3fa0f6['id']}})['then'](function(){return _0x167648;});})['then'](function(){_0x16f27e[_0xffa7('0x22')](0xcc)[_0xffa7('0x21')]();});}};}function handleEntityNotFound(_0x3b808a){return function(_0x357790){if(!_0x357790){_0x3b808a[_0xffa7('0x20')](0x194);}return _0x357790;};}function handleError(_0x586bcd,_0x43e413){_0x43e413=_0x43e413||0x1f4;return function(_0x2430e0){logger[_0xffa7('0x1c')](_0x2430e0[_0xffa7('0x2e')]);if(_0x2430e0[_0xffa7('0x2f')]){delete _0x2430e0[_0xffa7('0x2f')];}_0x586bcd[_0xffa7('0x22')](_0x43e413)[_0xffa7('0x30')](_0x2430e0);};}exports[_0xffa7('0x31')]=function(_0x5c2bd6,_0x582286){var _0x416dc9={'include':[{'model':db['Pause'],'as':_0xffa7('0x32')}]},_0x5b7dce={},_0x5aa95b={'count':0x0,'rows':[]};var _0x58e32a=_[_0xffa7('0x33')](db[_0xffa7('0x34')][_0xffa7('0x35')],function(_0x1203f1){return{'name':_0x1203f1[_0xffa7('0x36')],'type':_0x1203f1[_0xffa7('0x37')][_0xffa7('0x38')]};});_0x5b7dce[_0xffa7('0x39')]=_[_0xffa7('0x33')](_0x58e32a,_0xffa7('0x2f'));_0x5b7dce['query']=_['keys'](_0x5c2bd6[_0xffa7('0x3a')]);_0x5b7dce[_0xffa7('0x3b')]=_[_0xffa7('0x3c')](_0x5b7dce[_0xffa7('0x39')],_0x5b7dce[_0xffa7('0x3a')]);_0x416dc9[_0xffa7('0x3d')]=_[_0xffa7('0x3c')](_0x5b7dce[_0xffa7('0x39')],qs[_0xffa7('0x3e')](_0x5c2bd6['query'][_0xffa7('0x3e')]));_0x416dc9['attributes']=_0x416dc9[_0xffa7('0x3d')]['length']?_0x416dc9[_0xffa7('0x3d')]:_0x5b7dce[_0xffa7('0x39')];if(!_0x5c2bd6[_0xffa7('0x3a')]['hasOwnProperty'](_0xffa7('0x3f'))){_0x416dc9['limit']=qs[_0xffa7('0x24')](_0x5c2bd6[_0xffa7('0x3a')][_0xffa7('0x24')]);_0x416dc9['offset']=qs[_0xffa7('0x26')](_0x5c2bd6[_0xffa7('0x3a')][_0xffa7('0x26')]);}_0x416dc9[_0xffa7('0x40')]=qs[_0xffa7('0x41')](_0x5c2bd6['query'][_0xffa7('0x41')]);_0x416dc9[_0xffa7('0x42')]=qs[_0xffa7('0x3b')](_[_0xffa7('0x43')](_0x5c2bd6[_0xffa7('0x3a')],_0x5b7dce[_0xffa7('0x3b')]),_0x58e32a);if(_0x5c2bd6[_0xffa7('0x3a')]['filter']){_0x416dc9[_0xffa7('0x42')]=_[_0xffa7('0x44')](_0x416dc9[_0xffa7('0x42')],{'$or':_['map'](_0x58e32a,function(_0x357fe6){if(_0x357fe6[_0xffa7('0x37')]!==_0xffa7('0x45')){var _0x1d1927={};_0x1d1927[_0x357fe6[_0xffa7('0x2f')]]={'$like':'%'+_0x5c2bd6[_0xffa7('0x3a')][_0xffa7('0x46')]+'%'};return _0x1d1927;}})});}_0x416dc9=_[_0xffa7('0x44')]({},_0x416dc9,_0x5c2bd6[_0xffa7('0x47')]);var _0x408a19={'where':_0x416dc9[_0xffa7('0x42')]};return db['ChatWebsite'][_0xffa7('0x25')](_0x408a19)[_0xffa7('0x16')](function(_0x18150f){_0x5aa95b[_0xffa7('0x25')]=_0x18150f;if(_0x5c2bd6['query'][_0xffa7('0x48')]){_0x416dc9[_0xffa7('0x49')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x416dc9);})[_0xffa7('0x16')](function(_0x57e060){_0x5aa95b[_0xffa7('0x4a')]=_0x57e060;return _0x5aa95b;})[_0xffa7('0x16')](respondWithFilteredResult(_0x582286,_0x416dc9))[_0xffa7('0x1f')](handleError(_0x582286,null));};exports[_0xffa7('0x4b')]=function(_0x20baaf,_0x33743e){var _0x4a1a63={'raw':![],'where':{'id':_0x20baaf[_0xffa7('0x4c')]['id']},'include':[{'model':db[_0xffa7('0x4d')],'as':_0xffa7('0x32')}]},_0x5a764d={};_0x5a764d['model']=_[_0xffa7('0x4e')](db[_0xffa7('0x34')][_0xffa7('0x35')]);_0x5a764d['query']=_[_0xffa7('0x4e')](_0x20baaf[_0xffa7('0x3a')]);_0x5a764d[_0xffa7('0x3b')]=_[_0xffa7('0x3c')](_0x5a764d[_0xffa7('0x39')],_0x5a764d['query']);_0x4a1a63['attributes']=_[_0xffa7('0x3c')](_0x5a764d[_0xffa7('0x39')],qs[_0xffa7('0x3e')](_0x20baaf[_0xffa7('0x3a')][_0xffa7('0x3e')]));_0x4a1a63[_0xffa7('0x3d')]=_0x4a1a63[_0xffa7('0x3d')][_0xffa7('0x4f')]?_0x4a1a63['attributes']:_0x5a764d[_0xffa7('0x39')];if(_0x20baaf[_0xffa7('0x3a')][_0xffa7('0x48')]){_0x4a1a63['include']=[{'all':!![]}];}_0x4a1a63=_[_0xffa7('0x44')]({},_0x4a1a63,_0x20baaf[_0xffa7('0x47')]);return db[_0xffa7('0x34')]['find'](_0x4a1a63)['then'](handleEntityNotFound(_0x33743e,null))['then'](respondWithResult(_0x33743e,null))['catch'](handleError(_0x33743e,null));};exports[_0xffa7('0x50')]=function(_0x5c20d6,_0x271b8e){return db[_0xffa7('0x34')][_0xffa7('0x50')](_0x5c20d6[_0xffa7('0x51')],{})[_0xffa7('0x16')](function(_0x597ecd){var _0x535fac=_0x5c20d6[_0xffa7('0x52')][_0xffa7('0x2c')]({'plain':!![]});if(!_0x535fac)throw new Error(_0xffa7('0x53'));if(_0x535fac[_0xffa7('0x54')]===_0xffa7('0x52')){var _0x51cbd8=_0x597ecd[_0xffa7('0x2c')]({'plain':!![]});var _0x1d19d7='ChatWebsites';return db[_0xffa7('0x55')][_0xffa7('0x56')]({'where':{'name':_0x1d19d7,'userProfileId':_0x535fac[_0xffa7('0x57')]},'raw':!![]})[_0xffa7('0x16')](function(_0x174d89){if(_0x174d89&&_0x174d89[_0xffa7('0x58')]===0x0){return db['UserProfileResource'][_0xffa7('0x50')]({'name':_0x51cbd8[_0xffa7('0x2f')],'resourceId':_0x51cbd8['id'],'type':_0x174d89[_0xffa7('0x2f')],'sectionId':_0x174d89['id']},{})['then'](function(){return _0x597ecd;});}else{return _0x597ecd;}})['catch'](function(_0x2c12da){logger[_0xffa7('0x1c')](_0xffa7('0x59'),_0x2c12da);throw _0x2c12da;});}return _0x597ecd;})[_0xffa7('0x16')](respondWithResult(_0x271b8e,0xc9))['catch'](handleError(_0x271b8e,null));};exports[_0xffa7('0x2a')]=function(_0x5c18e5,_0x515c84){if(_0x5c18e5[_0xffa7('0x51')]['id']){delete _0x5c18e5['body']['id'];}return db['ChatWebsite'][_0xffa7('0x56')]({'where':{'id':_0x5c18e5[_0xffa7('0x4c')]['id']},'include':[{'model':db[_0xffa7('0x4d')],'as':_0xffa7('0x32')}]})['then'](handleEntityNotFound(_0x515c84,null))[_0xffa7('0x16')](saveUpdates(_0x5c18e5[_0xffa7('0x51')],null))[_0xffa7('0x16')](respondWithResult(_0x515c84,null))[_0xffa7('0x1f')](handleError(_0x515c84,null));};exports[_0xffa7('0x2b')]=function(_0x20f98f,_0x4ab2f7){return db[_0xffa7('0x34')][_0xffa7('0x56')]({'where':{'id':_0x20f98f[_0xffa7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4ab2f7,null))[_0xffa7('0x16')](removeEntity(_0x4ab2f7,null))['catch'](handleError(_0x4ab2f7,null));};exports[_0xffa7('0x5a')]=function(_0x2f27c4,_0x2df5be){return db[_0xffa7('0x34')][_0xffa7('0x5a')]()[_0xffa7('0x16')](respondWithResult(_0x2df5be,null))['catch'](handleError(_0x2df5be,null));};exports[_0xffa7('0x5b')]=function(_0x3da240,_0xbed77b){if(_0x3da240[_0xffa7('0x51')]['id']){delete _0x3da240[_0xffa7('0x51')]['id'];}return db[_0xffa7('0x34')][_0xffa7('0x56')]({'where':{'id':_0x3da240[_0xffa7('0x4c')]['id']}})['then'](handleEntityNotFound(_0xbed77b,null))[_0xffa7('0x16')](function(_0x3b55d7){if(_0x3b55d7){_0x3da240[_0xffa7('0x51')][_0xffa7('0x5c')]=_0x3b55d7['id'];return db[_0xffa7('0x5d')][_0xffa7('0x50')](_0x3da240[_0xffa7('0x51')]);}})['then'](respondWithResult(_0xbed77b,null))[_0xffa7('0x1f')](handleError(_0xbed77b,null));};exports['getDispositions']=function(_0x1ae3d4,_0x101121){var _0x423aad={'raw':![],'where':{}};var _0x3a930f={};var _0x284fd7={'count':0x0,'rows':[]};return db[_0xffa7('0x34')]['findOne']({'where':{'id':_0x1ae3d4['params']['id']}})[_0xffa7('0x16')](handleEntityNotFound(_0x101121,null))[_0xffa7('0x16')](function(_0x1d474f){if(_0x1d474f){_0x3a930f[_0xffa7('0x39')]=_[_0xffa7('0x4e')](db[_0xffa7('0x5d')]['rawAttributes']);_0x3a930f['query']=_[_0xffa7('0x4e')](_0x1ae3d4[_0xffa7('0x3a')]);_0x3a930f[_0xffa7('0x3b')]=_['intersection'](_0x3a930f[_0xffa7('0x39')],_0x3a930f[_0xffa7('0x3a')]);_0x423aad[_0xffa7('0x3d')]=_['intersection'](_0x3a930f[_0xffa7('0x39')],qs[_0xffa7('0x3e')](_0x1ae3d4['query'][_0xffa7('0x3e')]));_0x423aad[_0xffa7('0x3d')]=_0x423aad['attributes'][_0xffa7('0x4f')]?_0x423aad[_0xffa7('0x3d')]:_0x3a930f['model'];if(!_0x1ae3d4['query']['hasOwnProperty']('nolimit')){_0x423aad['limit']=qs[_0xffa7('0x24')](_0x1ae3d4[_0xffa7('0x3a')][_0xffa7('0x24')]);_0x423aad[_0xffa7('0x26')]=qs[_0xffa7('0x26')](_0x1ae3d4[_0xffa7('0x3a')][_0xffa7('0x26')]);}_0x423aad['order']=qs['sort'](_0x1ae3d4[_0xffa7('0x3a')][_0xffa7('0x41')]);_0x423aad[_0xffa7('0x42')]=qs[_0xffa7('0x3b')](_[_0xffa7('0x43')](_0x1ae3d4[_0xffa7('0x3a')],_0x3a930f['filters']));_0x423aad['where'][_0xffa7('0x5c')]=_0x1d474f['id'];if(_0x1ae3d4[_0xffa7('0x3a')]['filter']){_0x423aad[_0xffa7('0x42')]=_['merge'](_0x423aad[_0xffa7('0x42')],{'$or':_['map'](_0x423aad['attributes'],function(_0x406f34){var _0x187134={};_0x187134[_0x406f34]={'$like':'%'+_0x1ae3d4[_0xffa7('0x3a')][_0xffa7('0x46')]+'%'};return _0x187134;})});}_0x423aad=_[_0xffa7('0x44')]({},_0x423aad,_0x1ae3d4[_0xffa7('0x47')]);return db[_0xffa7('0x5d')]['count']({'where':_0x423aad[_0xffa7('0x42')]})[_0xffa7('0x16')](function(_0x9fcbfc){_0x284fd7['count']=_0x9fcbfc;if(_0x1ae3d4[_0xffa7('0x3a')][_0xffa7('0x48')]){_0x423aad[_0xffa7('0x49')]=[{'all':!![]}];}return db[_0xffa7('0x5d')]['findAll'](_0x423aad);})[_0xffa7('0x16')](function(_0x2734e1){_0x284fd7['rows']=_0x2734e1;return _0x284fd7;});}})[_0xffa7('0x16')](respondWithFilteredResult(_0x101121,_0x423aad))[_0xffa7('0x1f')](handleError(_0x101121,null));};exports[_0xffa7('0x5e')]=function(_0x2d90d5,_0x925c44){return db[_0xffa7('0x34')]['find']({'where':{'id':_0x2d90d5[_0xffa7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x925c44,null))[_0xffa7('0x16')](function(_0x56dacc){if(_0x56dacc){return _0x56dacc[_0xffa7('0x5e')](_0x2d90d5[_0xffa7('0x3a')][_0xffa7('0x5f')]);}})[_0xffa7('0x16')](respondWithStatusCode(_0x925c44,null))[_0xffa7('0x1f')](handleError(_0x925c44,null));};exports['addAnswer']=function(_0x3f340f,_0x16febd){if(_0x3f340f[_0xffa7('0x51')]['id']){delete _0x3f340f['body']['id'];}return db[_0xffa7('0x34')][_0xffa7('0x56')]({'where':{'id':_0x3f340f[_0xffa7('0x4c')]['id']}})[_0xffa7('0x16')](handleEntityNotFound(_0x16febd,null))[_0xffa7('0x16')](function(_0x1095c1){if(_0x1095c1){_0x3f340f[_0xffa7('0x51')][_0xffa7('0x5c')]=_0x1095c1['id'];return db[_0xffa7('0x60')][_0xffa7('0x50')](_0x3f340f[_0xffa7('0x51')]);}})[_0xffa7('0x16')](respondWithResult(_0x16febd,null))[_0xffa7('0x1f')](handleError(_0x16febd,null));};exports[_0xffa7('0x61')]=function(_0x59f872,_0x231c4d){var _0x71406e={'raw':![],'where':{}};var _0x54869f={};var _0x58027a={'count':0x0,'rows':[]};return db[_0xffa7('0x34')][_0xffa7('0x62')]({'where':{'id':_0x59f872['params']['id']}})[_0xffa7('0x16')](handleEntityNotFound(_0x231c4d,null))[_0xffa7('0x16')](function(_0x44f8d4){if(_0x44f8d4){_0x54869f[_0xffa7('0x39')]=_[_0xffa7('0x4e')](db['CannedAnswer'][_0xffa7('0x35')]);_0x54869f[_0xffa7('0x3a')]=_[_0xffa7('0x4e')](_0x59f872[_0xffa7('0x3a')]);_0x54869f[_0xffa7('0x3b')]=_[_0xffa7('0x3c')](_0x54869f[_0xffa7('0x39')],_0x54869f[_0xffa7('0x3a')]);_0x71406e[_0xffa7('0x3d')]=_[_0xffa7('0x3c')](_0x54869f[_0xffa7('0x39')],qs[_0xffa7('0x3e')](_0x59f872[_0xffa7('0x3a')][_0xffa7('0x3e')]));_0x71406e[_0xffa7('0x3d')]=_0x71406e[_0xffa7('0x3d')]['length']?_0x71406e[_0xffa7('0x3d')]:_0x54869f[_0xffa7('0x39')];if(!_0x59f872[_0xffa7('0x3a')][_0xffa7('0x63')](_0xffa7('0x3f'))){_0x71406e[_0xffa7('0x24')]=qs[_0xffa7('0x24')](_0x59f872['query'][_0xffa7('0x24')]);_0x71406e[_0xffa7('0x26')]=qs[_0xffa7('0x26')](_0x59f872['query'][_0xffa7('0x26')]);}_0x71406e[_0xffa7('0x40')]=qs[_0xffa7('0x41')](_0x59f872['query']['sort']);_0x71406e[_0xffa7('0x42')]=qs[_0xffa7('0x3b')](_[_0xffa7('0x43')](_0x59f872[_0xffa7('0x3a')],_0x54869f[_0xffa7('0x3b')]));_0x71406e['where'][_0xffa7('0x5c')]=_0x44f8d4['id'];if(_0x59f872[_0xffa7('0x3a')][_0xffa7('0x46')]){_0x71406e[_0xffa7('0x42')]=_['merge'](_0x71406e[_0xffa7('0x42')],{'$or':_[_0xffa7('0x33')](_0x71406e[_0xffa7('0x3d')],function(_0x193eba){var _0x38b94e={};_0x38b94e[_0x193eba]={'$like':'%'+_0x59f872[_0xffa7('0x3a')][_0xffa7('0x46')]+'%'};return _0x38b94e;})});}_0x71406e=_[_0xffa7('0x44')]({},_0x71406e,_0x59f872['options']);return db[_0xffa7('0x60')][_0xffa7('0x25')]({'where':_0x71406e[_0xffa7('0x42')]})[_0xffa7('0x16')](function(_0x27e76c){_0x58027a['count']=_0x27e76c;if(_0x59f872['query'][_0xffa7('0x48')]){_0x71406e[_0xffa7('0x49')]=[{'all':!![]}];}return db['CannedAnswer'][_0xffa7('0x64')](_0x71406e);})[_0xffa7('0x16')](function(_0x1634f6){_0x58027a[_0xffa7('0x4a')]=_0x1634f6;return _0x58027a;});}})[_0xffa7('0x16')](respondWithFilteredResult(_0x231c4d,_0x71406e))[_0xffa7('0x1f')](handleError(_0x231c4d,null));};exports[_0xffa7('0x65')]=function(_0x49aa0c,_0x3afdfe){return db[_0xffa7('0x34')][_0xffa7('0x56')]({'where':{'id':_0x49aa0c['params']['id']}})[_0xffa7('0x16')](handleEntityNotFound(_0x3afdfe,null))[_0xffa7('0x16')](function(_0x362bfc){if(_0x362bfc){return _0x362bfc['removeAnswers'](_0x49aa0c[_0xffa7('0x3a')][_0xffa7('0x5f')]);}})[_0xffa7('0x16')](respondWithStatusCode(_0x3afdfe,null))['catch'](handleError(_0x3afdfe,null));};exports[_0xffa7('0x66')]=function(_0x5ec0b7,_0x5a60eb){_0x5ec0b7['body'][_0xffa7('0x67')]=_0x5ec0b7[_0xffa7('0x68')][_0xffa7('0x69')];return db[_0xffa7('0x34')][_0xffa7('0x56')]({'where':{'id':_0x5ec0b7[_0xffa7('0x4c')]['id']}})[_0xffa7('0x16')](handleEntityNotFound(_0x5a60eb,null))['then'](saveUpdates(_0x5ec0b7['body'],null))[_0xffa7('0x16')](respondWithResult(_0x5a60eb,null))[_0xffa7('0x1f')](handleError(_0x5a60eb,null));};exports['addAvatar']=function(_0x25419a,_0x3d8a9f){_0x25419a['body']['agentAvatar']=_0x25419a[_0xffa7('0x68')][_0xffa7('0x69')];return db['ChatWebsite'][_0xffa7('0x56')]({'where':{'id':_0x25419a[_0xffa7('0x4c')]['id']}})[_0xffa7('0x16')](handleEntityNotFound(_0x3d8a9f,null))[_0xffa7('0x16')](saveUpdates(_0x25419a[_0xffa7('0x51')],null))[_0xffa7('0x16')](respondWithResult(_0x3d8a9f,null))[_0xffa7('0x1f')](handleError(_0x3d8a9f,null));};exports[_0xffa7('0x6a')]=function(_0x4cb1bf,_0x5805e9){_0x4cb1bf[_0xffa7('0x51')][_0xffa7('0x6b')]=_0x4cb1bf['file'][_0xffa7('0x69')];return db[_0xffa7('0x34')][_0xffa7('0x56')]({'where':{'id':_0x4cb1bf[_0xffa7('0x4c')]['id']}})[_0xffa7('0x16')](handleEntityNotFound(_0x5805e9,null))['then'](saveUpdates(_0x4cb1bf['body'],null))[_0xffa7('0x16')](respondWithResult(_0x5805e9,null))[_0xffa7('0x1f')](handleError(_0x5805e9,null));};exports[_0xffa7('0x6c')]=function(_0x35ff56,_0x329805){_0x35ff56[_0xffa7('0x51')][_0xffa7('0x6d')]=_0x35ff56[_0xffa7('0x68')][_0xffa7('0x69')];return db[_0xffa7('0x34')][_0xffa7('0x56')]({'where':{'id':_0x35ff56[_0xffa7('0x4c')]['id']}})[_0xffa7('0x16')](handleEntityNotFound(_0x329805,null))[_0xffa7('0x16')](saveUpdates(_0x35ff56[_0xffa7('0x51')],null))[_0xffa7('0x16')](respondWithResult(_0x329805,null))[_0xffa7('0x1f')](handleError(_0x329805,null));};exports[_0xffa7('0x6e')]=function(_0x5db9f0,_0x218d4e){var _0x263799=path['join'](config[_0xffa7('0x6f')],'server/files/images/logos/default_logo.svg');var _0x1da094={'where':{'id':_0x5db9f0[_0xffa7('0x4c')]['id']},'attributes':['id',_0xffa7('0x67')],'raw':!![]};var _0x91ef40=![];return require(_0xffa7('0x70'))[_0xffa7('0x71')]()['then'](function(_0x485f90){if(_0x485f90){_0x91ef40=_0x485f90[_0xffa7('0x72')];}})[_0xffa7('0x16')](function(){return db[_0xffa7('0x34')]['find'](_0x1da094);})[_0xffa7('0x16')](handleEntityNotFound(_0x218d4e,null))[_0xffa7('0x16')](function(_0x54bfab){if(_0x54bfab){if(!_['isNil'](_0x54bfab[_0xffa7('0x67')])){if(fs[_0xffa7('0x73')](path[_0xffa7('0x74')](config[_0xffa7('0x6f')],_0xffa7('0x75'),_0x54bfab[_0xffa7('0x67')]))&&_0x91ef40){_0x263799=path[_0xffa7('0x74')](config[_0xffa7('0x6f')],'server/files/images/logos/',_0x54bfab[_0xffa7('0x67')]);}}return _0x218d4e[_0xffa7('0x76')](_0x263799);}})[_0xffa7('0x1f')](handleError(_0x218d4e,null));};exports[_0xffa7('0x77')]=function(_0x5e9767,_0x48f3a4){var _0x861f8a=path[_0xffa7('0x74')](config[_0xffa7('0x6f')],_0xffa7('0x78'));var _0x32c84f={'where':{'id':_0x5e9767[_0xffa7('0x4c')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xffa7('0x34')][_0xffa7('0x56')](_0x32c84f)[_0xffa7('0x16')](handleEntityNotFound(_0x48f3a4,null))[_0xffa7('0x16')](function(_0x58c043){if(_0x58c043){if(!_[_0xffa7('0x79')](_0x58c043[_0xffa7('0x7a')])){if(fs[_0xffa7('0x73')](path['join'](config['root'],_0xffa7('0x7b'),_0x58c043['agentAvatar']))){_0x861f8a=path[_0xffa7('0x74')](config[_0xffa7('0x6f')],'server/files/images/avatars/',_0x58c043[_0xffa7('0x7a')]);}}return _0x48f3a4['download'](_0x861f8a);}})[_0xffa7('0x1f')](handleError(_0x48f3a4,null));};exports[_0xffa7('0x7c')]=function(_0x150d07,_0x47467a){var _0x2c6995=path[_0xffa7('0x74')](config['root'],_0xffa7('0x7d'));var _0x25f0c6={'where':{'id':_0x150d07[_0xffa7('0x4c')]['id']},'attributes':['id',_0xffa7('0x6b'),_0xffa7('0x7e')],'raw':!![]};return db[_0xffa7('0x34')][_0xffa7('0x56')](_0x25f0c6)[_0xffa7('0x16')](handleEntityNotFound(_0x47467a,null))[_0xffa7('0x16')](function(_0x438011){if(_0x438011){if(!_[_0xffa7('0x79')](_0x438011[_0xffa7('0x6b')])){if(fs[_0xffa7('0x73')](path[_0xffa7('0x74')](config[_0xffa7('0x6f')],_0xffa7('0x7b'),_0x438011['customerAvatar']))&&_0x438011['showCustomerAvatar']){_0x2c6995=path[_0xffa7('0x74')](config[_0xffa7('0x6f')],_0xffa7('0x7b'),_0x438011[_0xffa7('0x6b')]);}}return _0x47467a[_0xffa7('0x76')](_0x2c6995);}})[_0xffa7('0x1f')](handleError(_0x47467a,null));};exports['getSystemAvatar']=function(_0x198c9e,_0x1454eb){var _0x5f4e67=path[_0xffa7('0x74')](config[_0xffa7('0x6f')],'server/files/images/avatars/system_avatar.png');var _0x13ae2e={'where':{'id':_0x198c9e['params']['id']},'attributes':['id',_0xffa7('0x6d')],'raw':!![]};return db[_0xffa7('0x34')][_0xffa7('0x56')](_0x13ae2e)[_0xffa7('0x16')](handleEntityNotFound(_0x1454eb,null))['then'](function(_0x23fbd4){if(_0x23fbd4){if(!_[_0xffa7('0x79')](_0x23fbd4[_0xffa7('0x6d')])){if(fs[_0xffa7('0x73')](path[_0xffa7('0x74')](config[_0xffa7('0x6f')],_0xffa7('0x7b'),_0x23fbd4[_0xffa7('0x6d')]))){_0x5f4e67=path[_0xffa7('0x74')](config['root'],'server/files/images/avatars/',_0x23fbd4[_0xffa7('0x6d')]);}}return _0x1454eb[_0xffa7('0x76')](_0x5f4e67);}})[_0xffa7('0x1f')](handleError(_0x1454eb,null));};exports[_0xffa7('0x7f')]=function(_0x5a9740,_0xb57c69){var _0xed1d4b=require(_0xffa7('0x80'));var _0x5bd065=new _0xed1d4b();var _0x3adb7d=_0x5bd065[_0xffa7('0x81')](_0x5a9740[_0xffa7('0x82')]['user-agent'])[_0xffa7('0x83')]();var _0x58f548={'body':_0x5a9740[_0xffa7('0x51')],'channel':_0xffa7('0x84')};var _0x5e01fb=[];var _0x1dd448=[];var _0x1406ae={};var _0x5c456d=![];return db[_0xffa7('0x85')]['describe']()[_0xffa7('0x16')](function(_0x321262){if(!_0x321262){throw new db[(_0xffa7('0x86'))]['ValidationError']('no\x20available\x20attributes');}_0x5e01fb=_['difference'](_[_0xffa7('0x4e')](_0x321262),[_0xffa7('0x87'),_0xffa7('0x88')]);_0x1dd448=_['difference'](_[_0xffa7('0x4e')](_0x321262),['createdAt',_0xffa7('0x88'),_0xffa7('0x89'),_0xffa7('0x8a')]);if(_0x5a9740[_0xffa7('0x51')]['id']){delete _0x5a9740[_0xffa7('0x51')]['id'];}if(_['isNil'](_0x5a9740[_0xffa7('0x51')][_0xffa7('0x8b')])){throw new db[(_0xffa7('0x86'))][(_0xffa7('0x8c'))](_0xffa7('0x8d'));}if(_[_0xffa7('0x79')](_0x5a9740['body'][_0xffa7('0x51')])||_0x5a9740[_0xffa7('0x51')][_0xffa7('0x51')]===''){throw new db[(_0xffa7('0x86'))][(_0xffa7('0x8c'))](_0xffa7('0x8e'));}if(_['isNil'](_0x5a9740[_0xffa7('0x51')]['mapKey'])){throw new db['Sequelize'][(_0xffa7('0x8c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1dd448);}if(!_[_0xffa7('0x8f')](_0x1dd448,_0x5a9740['body'][_0xffa7('0x90')])){throw new db['Sequelize'][(_0xffa7('0x8c'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1dd448);}_0x1406ae[_0x5a9740[_0xffa7('0x51')][_0xffa7('0x90')]]=_0x5a9740[_0xffa7('0x51')][_0xffa7('0x8b')];})[_0xffa7('0x16')](function(){return db[_0xffa7('0x34')][_0xffa7('0x56')]({'where':{'id':_0x5a9740[_0xffa7('0x4c')]['id']},'include':[{'model':db[_0xffa7('0x91')],'as':_0xffa7('0x92'),'include':[{'model':db[_0xffa7('0x85')],'as':_0xffa7('0x93'),'where':_0x1406ae,'limit':0x1,'order':[[_0xffa7('0x88'),_0xffa7('0x94')]]}]},{'model':db['ChatApplication'],'as':_0xffa7('0x95')}]});})['then'](handleEntityNotFound(_0xb57c69,null))['then'](function(_0x3a7b37){if(_0x3a7b37&&_0x3a7b37['List']){_0x58f548[_0xffa7('0x96')]=_0x3a7b37;_0x58f548['applications']=_0x3a7b37[_0xffa7('0x95')];_0x58f548[_0xffa7('0x97')]=_0x3a7b37[_0xffa7('0x92')];_0x58f548[_0xffa7('0x98')]=_[_0xffa7('0x99')](_0x58f548['applications'],[_0xffa7('0x9a')],[_0xffa7('0x9b')]);if(_0x58f548[_0xffa7('0x96')][_0xffa7('0x95')]){delete _0x58f548[_0xffa7('0x96')]['Applications'];}if(_0x58f548[_0xffa7('0x96')][_0xffa7('0x92')]&&_0x58f548[_0xffa7('0x96')][_0xffa7('0x92')][_0xffa7('0x93')]['length']){return _0x58f548[_0xffa7('0x96')][_0xffa7('0x92')][_0xffa7('0x93')][0x0];}var _0xe1d653=_[_0xffa7('0xe')](_0x5a9740[_0xffa7('0x51')],{'firstName':_0x5a9740[_0xffa7('0x51')][_0xffa7('0x8b')],'ListId':_0x3a7b37['ListId']});_0xe1d653[_0x5a9740[_0xffa7('0x51')][_0xffa7('0x90')]]=_0x5a9740['body']['from'];return db['CmContact'][_0xffa7('0x50')](_0xe1d653,{'fields':_0x5e01fb,'raw':!![]});}})[_0xffa7('0x16')](handleEntityNotFound(_0xb57c69,null))['then'](function(_0x23bb43){_0x58f548[_0xffa7('0x9c')]=_0x23bb43;var _0x574df8=_0x5a9740[_0xffa7('0x51')]['customerIp'];if(_0x5a9740[_0xffa7('0x82')]['cf-connecting-ip']){_0x574df8=_0x5a9740[_0xffa7('0x82')][_0xffa7('0x9d')];}else if(_0x5a9740['headers'][_0xffa7('0x9e')]){_0x574df8=_[_0xffa7('0x9f')](_0x5a9740['headers']['x-forwarded-for']['split'](','));}if(_0x23bb43){var _0x55cc81={'ContactId':_0x23bb43['id'],'ChatWebsiteId':_0x5a9740['params']['id'],'from':(_0x23bb43[_0xffa7('0xa0')]||'')+'\x20'+(_0x23bb43[_0xffa7('0xa1')]||''),'customerIp':_0x574df8,'customerPort':_0x5a9740[_0xffa7('0x82')][_0xffa7('0xa2')]?_0x5a9740[_0xffa7('0x82')][_0xffa7('0xa2')]:null,'referer':_0x5a9740[_0xffa7('0x51')]['referer'],'browserName':_0x3adb7d['browser'][_0xffa7('0x2f')]&&_0x3adb7d[_0xffa7('0xa3')][_0xffa7('0xa4')]?util[_0xffa7('0xa5')](_0xffa7('0xa6'),_0x3adb7d[_0xffa7('0xa3')][_0xffa7('0x2f')],_0x3adb7d['browser'][_0xffa7('0xa4')]):_0xffa7('0xa7'),'browserVersion':_0x3adb7d[_0xffa7('0xa3')][_0xffa7('0xa4')]||_0xffa7('0xa7'),'osName':util[_0xffa7('0xa5')](_0xffa7('0xa6'),_0x3adb7d['os'][_0xffa7('0x2f')],_0x3adb7d['os'][_0xffa7('0xa4')]),'osVersion':_0x3adb7d['os'][_0xffa7('0xa4')],'deviceModel':_0x3adb7d[_0xffa7('0xa8')]['model']&&_0x3adb7d[_0xffa7('0xa8')][_0xffa7('0xa9')]?util[_0xffa7('0xa5')](_0xffa7('0xaa'),_0x3adb7d[_0xffa7('0xa8')][_0xffa7('0x39')],_0x3adb7d[_0xffa7('0xa8')][_0xffa7('0xa9')],_0x3adb7d['device'][_0xffa7('0x37')]):null,'deviceVendor':_0x3adb7d[_0xffa7('0xa8')][_0xffa7('0xa9')],'deviceType':_0x3adb7d['device'][_0xffa7('0x37')],'formData':JSON[_0xffa7('0xab')](_0x5a9740['body'])};var _0x574134={'ChatWebsiteId':_0x5a9740[_0xffa7('0x4c')]['id'],'closed':![]};if(_0x5a9740['body'][_0xffa7('0xac')]){_0x574134[_0xffa7('0xac')]=_0x5a9740[_0xffa7('0x51')][_0xffa7('0xac')];return db[_0xffa7('0xad')][_0xffa7('0x56')]({'where':_0x574134})[_0xffa7('0x16')](function(_0x557e33){if(_0x557e33){return[_0x557e33,![]];}_0x55cc81[_0xffa7('0xac')]=_0x5a9740['body']['threadId'];_0x55cc81[_0xffa7('0xae')]=_0x5a9740[_0xffa7('0x51')][_0xffa7('0xae')];return db[_0xffa7('0xad')]['create'](_0x55cc81)[_0xffa7('0x16')](function(_0xb6010c){return[_0xb6010c,!![]];});});}_0x574134[_0xffa7('0xaf')]=_0x23bb43['id'];if(_0x5a9740[_0xffa7('0x51')][_0xffa7('0xb0')]&&_0x5a9740[_0xffa7('0x51')][_0xffa7('0xb0')]['id']){_0x574134['id']=_0x5a9740[_0xffa7('0x51')][_0xffa7('0xb0')]['id'];return db[_0xffa7('0xad')][_0xffa7('0x56')]({'where':_0x574134})[_0xffa7('0x16')](function(_0x4656a0){if(_0x4656a0){return[_0x4656a0,![]];}return db[_0xffa7('0xad')][_0xffa7('0x50')](_0x55cc81)[_0xffa7('0x16')](function(_0x1d80d3){return[_0x1d80d3,!![]];});});}return db[_0xffa7('0xad')][_0xffa7('0x50')](_0x55cc81)[_0xffa7('0x16')](function(_0x5571f1){return[_0x5571f1,!![]];});}})['spread'](function(_0x3cebf1,_0x3b6cca){if(_0x3cebf1){_0x5c456d=_0x3b6cca;if(!_0x3b6cca){var _0x3b30db={'from':(_0x58f548[_0xffa7('0x9c')][_0xffa7('0xa0')]||'')+'\x20'+(_0x58f548[_0xffa7('0x9c')]['lastName']||'')};if(_0x5a9740[_0xffa7('0x51')][_0xffa7('0xac')]&&_0x5a9740[_0xffa7('0x51')][_0xffa7('0xb1')]&&_0x5a9740[_0xffa7('0x51')][_0xffa7('0xac')]!=_0x5a9740[_0xffa7('0x51')][_0xffa7('0xb1')]){_0x3b30db[_0xffa7('0xac')]=_0x5a9740['body'][_0xffa7('0xb1')];}return _0x3cebf1[_0xffa7('0x2a')](_0x3b30db);}else{return _0x3cebf1;}}})[_0xffa7('0x16')](function(_0x14cbc7){_0x58f548['interaction']=_0x14cbc7['get']({'plain':!![]});_0x58f548['interaction'][_0xffa7('0xb2')]=_0x5c456d;if(_0x58f548[_0xffa7('0xb0')][_0xffa7('0xb2')]){if(_0x58f548['account']['autoclose']){_0x58f548[_0xffa7('0x98')][_0xffa7('0xb3')]({'id':0x0,'priority':_0x58f548['applications'][_0xffa7('0x4f')]+0x1,'app':_0xffa7('0xb4'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xffa7('0xb5')][_0xffa7('0x50')]({'body':_0x5a9740[_0xffa7('0x51')][_0xffa7('0x51')],'ChatWebsiteId':_0x5a9740[_0xffa7('0x4c')]['id'],'ChatInteractionId':_0x14cbc7['id'],'direction':'in','ContactId':_0x58f548['contact']['id'],'AttachmentId':_0x5a9740[_0xffa7('0x51')]['AttachmentId']});})[_0xffa7('0x16')](function(_0x41b4d9){_0x58f548[_0xffa7('0x1e')]=_0x41b4d9;if(_0x58f548[_0xffa7('0xb0')][_0xffa7('0xb6')]){return db['User'][_0xffa7('0x56')]({'attributes':['id',_0xffa7('0x2f')],'where':{'id':_0x58f548[_0xffa7('0xb0')][_0xffa7('0xb6')]}})[_0xffa7('0x16')](function(_0x1b4d82){if(_0x1b4d82){_0x58f548['applications'][_0xffa7('0xb7')]({'id':0x0,'priority':0x0,'app':_0xffa7('0xb8'),'appdata':_0x1b4d82['name']+','+(_0x58f548['account'][_0xffa7('0xb9')]||0xa),'interval':'*,*,*,*'});_0x58f548[_0xffa7('0xba')]=!![];}return respondWithRpcPromise(_0xffa7('0xbb'),_0xffa7('0xbc'),_0x58f548);});}return respondWithRpcPromise(_0xffa7('0xbb'),'startRouting',_0x58f548);})[_0xffa7('0x16')](function(_0x2c79d6){respondWithRpcPromise(_0xffa7('0xbd'),_0xffa7('0xbd'),{'event':'notify','message':_0x2c79d6},client9002);return _0x2c79d6;})['then'](respondWithResult(_0xb57c69,null))['catch'](handleError(_0xb57c69,null));};exports[_0xffa7('0xbe')]=function(_0x129680,_0x22cf04){var _0x4cf31f,_0x4b3f4a,_0x11764e;var _0x4973eb=[];var _0x120d06={};var _0x1f4329=_0x129680[_0xffa7('0xbf')]||[];var _0xcd71f8=[];var _0x5517d3;return db['CmContact'][_0xffa7('0x5a')]()[_0xffa7('0x16')](function(_0x46bbc2){if(!_0x46bbc2){throw new db[(_0xffa7('0x86'))][(_0xffa7('0x8c'))]('no\x20available\x20attributes');}_0x4973eb=_['difference'](_[_0xffa7('0x4e')](_0x46bbc2),[_0xffa7('0x87'),_0xffa7('0x88'),_0xffa7('0x89'),'ListId']);if(_0x129680[_0xffa7('0x51')]['id']){delete _0x129680['body']['id'];}if(_[_0xffa7('0x79')](_0x129680['body']['from'])){throw _0x22cf04[_0xffa7('0x22')](0x1f4)[_0xffa7('0x30')](new db[(_0xffa7('0x86'))]['ValidationError'](_0xffa7('0x8d')));}if(_[_0xffa7('0x79')](_0x129680[_0xffa7('0x51')][_0xffa7('0x51')])||_0x129680['body'][_0xffa7('0x51')]===''){throw _0x22cf04['status'](0x1f4)[_0xffa7('0x30')](new db[(_0xffa7('0x86'))][(_0xffa7('0x8c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x129680[_0xffa7('0x51')][_0xffa7('0xc0')])){throw _0x22cf04[_0xffa7('0x22')](0x1f4)[_0xffa7('0x30')](new db[(_0xffa7('0x86'))][(_0xffa7('0x8c'))](_0xffa7('0xc1')+_0x4973eb));}if(!_[_0xffa7('0x8f')](_0x4973eb,_0x129680[_0xffa7('0x51')][_0xffa7('0xc0')])){throw _0x22cf04[_0xffa7('0x22')](0x1f4)[_0xffa7('0x30')](new db[(_0xffa7('0x86'))][(_0xffa7('0x8c'))](_0xffa7('0xc2')+_0x4973eb));}_0x120d06[_0x129680['body']['mapKeyOffline']]=_0x129680[_0xffa7('0x51')]['from'];})[_0xffa7('0x16')](function(){return db[_0xffa7('0x34')][_0xffa7('0x56')]({'where':{'id':_0x129680[_0xffa7('0x4c')]['id']},'include':[{'model':db[_0xffa7('0x91')],'as':'List'},{'model':db[_0xffa7('0xc3')],'as':_0xffa7('0xc3')}]});})[_0xffa7('0x16')](handleEntityNotFound(_0x22cf04,null))['then'](function(_0x5e159b){if(_0x5e159b&&_0x5e159b[_0xffa7('0x92')]){_0x4b3f4a=_0x5e159b;var _0x1131e0=_[_0xffa7('0xe')](_0x129680[_0xffa7('0x51')],{'firstName':_0x129680[_0xffa7('0x51')][_0xffa7('0x8b')],'phone':_0x129680[_0xffa7('0x51')][_0xffa7('0x8b')],'ListId':_0x5e159b[_0xffa7('0x8a')]});_0x1131e0[_0x129680[_0xffa7('0x51')]['mapKeyOffline']]=_0x129680[_0xffa7('0x51')][_0xffa7('0x8b')];return db['CmContact'][_0xffa7('0xc4')]({'where':_0x120d06,'defaults':_0x1131e0});}})['spread'](function(_0x54ae96){if(_0x54ae96){_0x11764e=_0x54ae96;var _0xbaf0c9=fs['readFileSync'](path[_0xffa7('0x74')](config[_0xffa7('0x6f')],_0xffa7('0xc5')),_0xffa7('0xc6'));var _0x1e682d=ejs[_0xffa7('0xc7')](_0xbaf0c9,{'body':_[_0xffa7('0xc8')](_0x129680[_0xffa7('0x51')][_0xffa7('0x51')]),'bodyTitle':_0x4b3f4a['offlineMessageBody']});return db[_0xffa7('0xc9')][_0xffa7('0x50')]({'body':_0x1e682d,'plainBody':htmlToText[_0xffa7('0xca')](_0x1e682d),'ContactId':_0x54ae96['id'],'ChatWebsiteId':_0x4b3f4a['id']});}})[_0xffa7('0x16')](function(_0x409c9a){_0x5517d3=_0x409c9a;if(_0x1f4329[_0xffa7('0x4f')]){var _0x7f5d78=_0x1f4329[_0xffa7('0x33')](function(_0x44629c){return{'name':_0x44629c[_0xffa7('0xcb')],'basename':_0x44629c[_0xffa7('0x69')],'type':_0x44629c['mimetype'],'ChatOfflineMessageId':_0x409c9a['id']};});_0xcd71f8=_0x7f5d78['map'](_0x3a0f59=>{var _0x40ff9b={'filename':_0x3a0f59['name'],'path':path[_0xffa7('0x74')](config[_0xffa7('0x6f')],_0xffa7('0xcc'),_0xffa7('0xbf'),_0xffa7('0xcd'),_0xffa7('0xce'),_0x3a0f59[_0xffa7('0xcf')])};return _0x40ff9b;});if(!_0x4b3f4a[_0xffa7('0xd0')]){return db[_0xffa7('0xd1')][_0xffa7('0xd2')](function(_0x4725d6){return db[_0xffa7('0xd3')][_0xffa7('0xd4')](_0x7f5d78,{'transaction':_0x4725d6});});}}})[_0xffa7('0x16')](function(){if(_0x5517d3){_0x4cf31f=_0x5517d3;return db[_0xffa7('0xc3')][_0xffa7('0x62')]({'where':{'service':!![]},'include':[{'model':db[_0xffa7('0xd5')],'as':_0xffa7('0xd6'),'raw':!![],'include':[{'model':db[_0xffa7('0xd7')],'as':_0xffa7('0xd7'),'raw':!![]}]}]});}})[_0xffa7('0x16')](function(_0x5acc57){if(_0x5acc57&&_0x5acc57[_0xffa7('0xd6')]&&_0x4b3f4a[_0xffa7('0xd8')]&&_0x4b3f4a['forwardOfflineAddress']){var _0x3d2499=_0x5acc57[_0xffa7('0xd9')]();return respondWithRpcPromise(_0xffa7('0xda'),_0xffa7('0xdb'),{'account':_0x3d2499,'message':{'from':util['format'](_0xffa7('0xdc'),_0x5acc57[_0xffa7('0x2f')],_0x5acc57[_0xffa7('0xdd')]||_0x5acc57[_0xffa7('0xd6')][_0xffa7('0x52')]),'to':_0x4b3f4a[_0xffa7('0xde')],'subject':_0x4b3f4a['offlineMessageSubject'],'html':_0x4cf31f[_0xffa7('0x51')],'attachments':_0xcd71f8}},client9003)[_0xffa7('0x16')](function(){return _0x4cf31f;})[_0xffa7('0x1f')](function(_0x5285b5){logger[_0xffa7('0x1c')](_0x5285b5);});}})['then'](function(){if(_0x4b3f4a&&_0x4b3f4a[_0xffa7('0xd0')]&&_0x4b3f4a[_0xffa7('0xdf')]){var _0x378b36=[];if(_0x1f4329[_0xffa7('0x4f')]){_0x378b36=_0x1f4329[_0xffa7('0x33')](function(_0x443207){return{'name':_0x443207[_0xffa7('0xcb')],'basename':_0x443207[_0xffa7('0x69')],'type':_0x443207[_0xffa7('0xe0')],'ChatOfflineMessageId':_0x5517d3['id']};});}var _0x26e1ea;if(!_['isNil'](_0x4b3f4a[_0xffa7('0xe1')])){var _0x33eb6d=_[_0xffa7('0x33')](_0x129680[_0xffa7('0x51')],function(_0x278e16){return _0x278e16;});var _0x274d49=_[_0xffa7('0xe2')](_0x33eb6d)[0x0];var _0x4f1224=_[_0xffa7('0xe3')](_0x274d49,function(_0x461704){return _0x461704;});_0x26e1ea=_0x4f1224[0x1][_0x4b3f4a[_0xffa7('0xe1')]];}var _0x62de4e={'from':_0x11764e[_0xffa7('0xdd')],'firstName':_0x11764e['firstName'],'lastName':_0x11764e[_0xffa7('0xa1')],'mapKey':_0xffa7('0xdd'),'message':{'from':_0x11764e[_0xffa7('0xdd')],'to':_0x4b3f4a[_0xffa7('0xc3')][_0xffa7('0xdd')],'cc':'','subject':_[_0xffa7('0x79')](_0x26e1ea)?_0x4b3f4a['offlineMessageSubject']:_0x26e1ea,'messageId':'','sentAt':new Date(),'attach':_0x378b36[_0xffa7('0x4f')],'attachments':_0x378b36,'originChannel':_0xffa7('0xe4'),'ChatWebsiteId':_0x4b3f4a['id'],'ChatOfflineMessageId':_0x4cf31f['id'],'originTo':_0x4b3f4a['MailAccount'][_0xffa7('0xdd')]},'body':_0x4cf31f[_0xffa7('0x51')]};var _0x32cd21={'account':{'id':_0x4b3f4a[_0xffa7('0xdf')]},'body':_0x62de4e,'log':_0xffa7('0xe5')};return respondWithRpcPromise(_0xffa7('0xe5'),_0xffa7('0xe6'),_0x32cd21,client9001)['then'](function(){return _0x4cf31f;})['catch'](function(_0x17ad24){logger['error'](_0x17ad24);});}return;})[_0xffa7('0x16')](function(){if(_0x4cf31f){return _0x4cf31f;}})[_0xffa7('0x16')](respondWithResult(_0x22cf04,null))[_0xffa7('0x1f')](function(_0x12920e){logger['error'](_0xffa7('0x1f'),_0x12920e);for(var _0x135225 of _0x1f4329){var _0x4d0e5f=path[_0xffa7('0x74')](config['root'],_0xffa7('0xcc'),_0xffa7('0xbf'),_0xffa7('0xcd'),'offline-chat',_0x135225[_0xffa7('0x69')]);fs_extra[_0xffa7('0xe7')](_0x4d0e5f)[_0xffa7('0x1f')](function(_0x55ff5c){logger[_0xffa7('0x1c')](_0xffa7('0xe8'),_0x4d0e5f,_0x55ff5c);});}});};exports[_0xffa7('0xe9')]=function(_0x16894d,_0x5ed92d){return db['ChatInteraction'][_0xffa7('0x56')]({'where':{'id':_0x16894d[_0xffa7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5ed92d,null))[_0xffa7('0x16')](function(_0x14be03){if(_0x14be03){return _0x14be03[_0xffa7('0xe9')](_0x16894d[_0xffa7('0x51')][_0xffa7('0x5f')],_['omit'](_0x16894d[_0xffa7('0x51')],[_0xffa7('0x5f'),'id'])||{});}})[_0xffa7('0x16')](respondWithResult(_0x5ed92d,null))['catch'](handleError(_0x5ed92d,null));};exports[_0xffa7('0xea')]=function(_0x5f423a,_0x4f69af){var _0x5a86ef={'raw':![],'where':{}};var _0x5802cc={};var _0x3f669b={'count':0x0,'rows':[]};return db[_0xffa7('0x34')]['findOne']({'where':{'id':_0x5f423a[_0xffa7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4f69af,null))[_0xffa7('0x16')](function(_0x4234df){if(_0x4234df){_0x5802cc[_0xffa7('0x39')]=_['keys'](db['ChatInteraction'][_0xffa7('0x35')]);_0x5802cc[_0xffa7('0x3a')]=_[_0xffa7('0x4e')](_0x5f423a['query']);_0x5802cc[_0xffa7('0x3b')]=_[_0xffa7('0x3c')](_0x5802cc[_0xffa7('0x39')],_0x5802cc[_0xffa7('0x3a')]);_0x5a86ef['attributes']=_[_0xffa7('0x3c')](_0x5802cc['model'],qs['fields'](_0x5f423a[_0xffa7('0x3a')][_0xffa7('0x3e')]));_0x5a86ef[_0xffa7('0x3d')]=_0x5a86ef[_0xffa7('0x3d')][_0xffa7('0x4f')]?_0x5a86ef['attributes']:_0x5802cc[_0xffa7('0x39')];if(!_0x5f423a[_0xffa7('0x3a')][_0xffa7('0x63')](_0xffa7('0x3f'))){_0x5a86ef[_0xffa7('0x24')]=qs[_0xffa7('0x24')](_0x5f423a[_0xffa7('0x3a')][_0xffa7('0x24')]);_0x5a86ef[_0xffa7('0x26')]=qs[_0xffa7('0x26')](_0x5f423a[_0xffa7('0x3a')][_0xffa7('0x26')]);}_0x5a86ef[_0xffa7('0x40')]=qs[_0xffa7('0x41')](_0x5f423a['query'][_0xffa7('0x41')]);_0x5a86ef[_0xffa7('0x42')]=qs[_0xffa7('0x3b')](_[_0xffa7('0x43')](_0x5f423a[_0xffa7('0x3a')],_0x5802cc['filters']));_0x5a86ef[_0xffa7('0x42')][_0xffa7('0x5c')]=_0x4234df['id'];if(_0x5f423a['query'][_0xffa7('0x46')]){_0x5a86ef[_0xffa7('0x42')]=_[_0xffa7('0x44')](_0x5a86ef[_0xffa7('0x42')],{'$or':_[_0xffa7('0x33')](_0x5a86ef[_0xffa7('0x3d')],function(_0x4132e0){var _0x1239c2={};_0x1239c2[_0x4132e0]={'$like':'%'+_0x5f423a[_0xffa7('0x3a')][_0xffa7('0x46')]+'%'};return _0x1239c2;})});}_0x5a86ef=_[_0xffa7('0x44')]({},_0x5a86ef,_0x5f423a[_0xffa7('0x47')]);return db[_0xffa7('0xad')]['count']({'where':_0x5a86ef['where']})[_0xffa7('0x16')](function(_0x3f83a8){_0x3f669b[_0xffa7('0x25')]=_0x3f83a8;if(_0x5f423a[_0xffa7('0x3a')]['includeAll']){_0x5a86ef['include']=[{'model':db[_0xffa7('0x85')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xffa7('0x2f'),'fullname',_0xffa7('0xeb')],'required':![]},{'model':db[_0xffa7('0xec')],'as':_0xffa7('0xed'),'attributes':['id','name',_0xffa7('0xee')],'where':_0x5f423a['query'][_0xffa7('0xef')]?{'id':_0x5f423a['query'][_0xffa7('0xef')]}:undefined,'required':_0x5f423a[_0xffa7('0x3a')][_0xffa7('0xef')]?!![]:![]}];}return db['ChatInteraction'][_0xffa7('0x64')](_0x5a86ef);})['then'](function(_0x18bdd2){_0x3f669b['rows']=_0x18bdd2;return _0x3f669b;});}})[_0xffa7('0x16')](respondWithFilteredResult(_0x4f69af,_0x5a86ef))[_0xffa7('0x1f')](handleError(_0x4f69af,null));};function iftimePromise(_0x20ffec,_0x63936f){return respondWithRpcPromise(_0xffa7('0xf0'),_0xffa7('0xf1'),{'command':_0x63936f['timezone']?util[_0xffa7('0xa5')]('iftime\x20%s,%s',_0x20ffec['interval'],_0x63936f[_0xffa7('0xf2')]):util['format']('iftime\x20%s',_0x20ffec[_0xffa7('0xf3')])},client9002)[_0xffa7('0x16')](function(_0x4ed411){var _0xb5ac4e=_0x4ed411&&_0x4ed411['indexOf'](_0xffa7('0xf4'))>=0x0?!![]:![];logger[_0xffa7('0x17')](_0xffa7('0xf5'),_0x63936f['id'],_0x20ffec['id'],_0x20ffec[_0xffa7('0xf3')],_0xb5ac4e?'ONLINE':_0xffa7('0xf6'),_0x63936f[_0xffa7('0xf2')]?_0x63936f['timezone']:'No\x20timezone');return _0xb5ac4e;})['catch'](function(_0x4e4b79){logger['error'](_0xffa7('0xf5'),_0x63936f['id'],_0x20ffec['id'],_0x20ffec[_0xffa7('0xf3')],util[_0xffa7('0xf7')](_0x4e4b79,{'showHidden':![],'depth':null}),_0x63936f[_0xffa7('0xf2')]?_0x63936f[_0xffa7('0xf2')]:_0xffa7('0xf8'));return![];});}exports[_0xffa7('0xf1')]=function(_0x2b51a0,_0x5bf638){var _0x15571a=0x0;var _0x3b9694=0x0;var _0x10772e=![];var _0x850074;var _0x29873e;return db[_0xffa7('0x34')]['find']({'where':{'id':_0x2b51a0[_0xffa7('0x4c')]['id']},'include':[{'model':db[_0xffa7('0xf9')],'as':'Interval','include':[{'model':db[_0xffa7('0xf9')],'as':_0xffa7('0xfa'),'attributes':['id',_0xffa7('0xf3')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x5bf638,null))[_0xffa7('0x16')](function(_0x18ee3f){if(_0x18ee3f){_0x850074=_0x18ee3f;return _0x18ee3f[_0xffa7('0xfb')]({'raw':!![]});}})['then'](function(_0x4b5944){if(_0x850074){if(_0x4b5944){_0x29873e=_0x4b5944;}}return require(_0xffa7('0x70'))['getLicense']();})[_0xffa7('0x16')](function(_0x2dd6b2){if(_0x2dd6b2){_0x3b9694=_0x2dd6b2['virtual'];_0x10772e=_0x2dd6b2['custom'];}})[_0xffa7('0x16')](function(){return db['ChatInteraction'][_0xffa7('0x25')]({'where':{'closed':![]}});})['then'](function(_0x4c9323){_0x15571a=_0x4c9323;if(_0x3b9694&&_0x4c9323>_0x3b9694){return db['License'][_0xffa7('0x62')]({'where':{'id':0x1}})[_0xffa7('0x16')](function(_0x2a9404){if(_0x2a9404){_0x2a9404[_0xffa7('0xfc')](_0xffa7('0xfd'));}});}})[_0xffa7('0x16')](function(){if(_0x850074[_0xffa7('0xf9')]&&_0x850074[_0xffa7('0xf9')][_0xffa7('0xfa')]){var _0x4f7a45=[];for(var _0x36422c=0x0;_0x36422c<_0x850074[_0xffa7('0xf9')][_0xffa7('0xfa')][_0xffa7('0x4f')];_0x36422c++){var _0x1a4855=_0x850074[_0xffa7('0xf9')][_0xffa7('0xfa')][_0x36422c][_0xffa7('0x2c')]({'plain':!![]});_0x4f7a45[_0xffa7('0xb3')](iftimePromise(_0x1a4855,_0x850074));}return BPromise[_0xffa7('0xfe')](_0x4f7a45)[_0xffa7('0x16')](function(_0xa32790){return _[_0xffa7('0xff')](_0xa32790);});}else{return!![];}})[_0xffa7('0x16')](function(_0x54517f){var _0x295d87=fs[_0xffa7('0x100')](path[_0xffa7('0x74')](config['root'],_0xffa7('0x101')),_0xffa7('0xc6'));var _0x22fc97={'remote':_0x850074[_0xffa7('0x102')],'query':querystring[_0xffa7('0xab')](_[_0xffa7('0x44')](_0x850074['get']({'plain':!![]}),{'customerIp':_0x2b51a0[_0xffa7('0x82')][_0xffa7('0x9e')]||_0x2b51a0[_0xffa7('0x82')][_0xffa7('0x103')]||_0x2b51a0[_0xffa7('0x104')]['remoteAddress']||_0x2b51a0['ip'],'referer':_0x2b51a0[_0xffa7('0x82')]['referer'],'openedInteractions':_0x15571a,'maxInteractions':_0x3b9694,'virtual':_0x10772e['virtual'],'online':_0x54517f,'custom':_0x10772e}))[_0xffa7('0x105')](/'/g,'\x5c\x27')};_0x5bf638[_0xffa7('0x30')](ejs[_0xffa7('0xc7')](Mustache[_0xffa7('0xc7')](_0x295d87,_0x22fc97),{'proactiveActions':_0x29873e,'alignment':_0x850074[_0xffa7('0x106')],'verticalAlignment':_0x850074[_0xffa7('0x107')],'div_color':_0x850074['color'],'labelText':_0x850074[_0xffa7('0x108')],'text_color':_0x850074[_0xffa7('0x109')],'text_button_color':_0x850074[_0xffa7('0x10a')],'button_color':_0x850074[_0xffa7('0x10b')],'background_color':_0x850074[_0xffa7('0x10c')],'hideWhenOffline':_0x850074[_0xffa7('0x10d')],'interval':_0x850074[_0xffa7('0x10e')]}));})['catch'](handleError(_0x5bf638,null));};exports['addApplications']=function(_0xd30756,_0x4b9dc7){var _0x35548c=_0xd30756[_0xffa7('0x4c')]['id'];var _0x3dcf05=_0xd30756[_0xffa7('0x51')];var _0x112f0d=0xc8;var _0x2f6881=null;return db[_0xffa7('0xd1')][_0xffa7('0xd2')]({'isolationLevel':db['sequelize'][_0xffa7('0x10f')][_0xffa7('0x110')][_0xffa7('0x111')]},function(_0x83eb9f){return db[_0xffa7('0x34')][_0xffa7('0x62')]({'where':{'id':_0x35548c},'transaction':_0x83eb9f})[_0xffa7('0x16')](function(_0x563007){if(_0x563007){return db['ChatApplication'][_0xffa7('0x2b')]({'where':{'ChatWebsiteId':_0x35548c},'transaction':_0x83eb9f})[_0xffa7('0x16')](function(){var _0x8d7df3=_['map'](_0x3dcf05,function(_0x586508){_0x586508['ChatWebsiteId']=_0x35548c;return _0x586508;});return db[_0xffa7('0x112')][_0xffa7('0xd4')](_0x8d7df3,{'transaction':_0x83eb9f});});}else{_0x112f0d=0x194;_0x2f6881=[];}});})[_0xffa7('0x16')](function(){if(_0x112f0d!==0x194){return db[_0xffa7('0x112')][_0xffa7('0x113')]({'where':{'ChatWebsiteId':_0x35548c},'order':'priority'})[_0xffa7('0x16')](function(_0x5109fc){_0x2f6881=_0x5109fc;});}})['catch'](function(_0x3d7475){_0x112f0d=0x1f4;logger[_0xffa7('0x1c')](_0x3d7475[_0xffa7('0x2e')]);if(_0x3d7475[_0xffa7('0x2f')]){delete _0x3d7475[_0xffa7('0x2f')];}_0x2f6881=_0x3d7475;})[_0xffa7('0x114')](function(){if(_0x2f6881===null){_0x4b9dc7[_0xffa7('0x20')](_0x112f0d);}else{if(_0x112f0d===0x1f4){_0x4b9dc7[_0xffa7('0x22')](_0x112f0d)[_0xffa7('0x30')](_0x2f6881);}else{_0x4b9dc7['status'](_0x112f0d)[_0xffa7('0x29')](_0x2f6881);}}});};exports['getApplications']=function(_0x217159,_0x29ccef){var _0x247ede={};var _0x810c39={};var _0x32c880;var _0x16d8d3;return db[_0xffa7('0x34')][_0xffa7('0x62')]({'where':{'id':_0x217159[_0xffa7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x29ccef,null))[_0xffa7('0x16')](function(_0x1e0d86){if(_0x1e0d86){_0x32c880=_0x1e0d86;_0x810c39[_0xffa7('0x39')]=_[_0xffa7('0x4e')](db[_0xffa7('0x112')][_0xffa7('0x35')]);_0x810c39[_0xffa7('0x3a')]=_['keys'](_0x217159[_0xffa7('0x3a')]);_0x810c39[_0xffa7('0x3b')]=_[_0xffa7('0x3c')](_0x810c39[_0xffa7('0x39')],_0x810c39['query']);_0x247ede[_0xffa7('0x3d')]=_['intersection'](_0x810c39[_0xffa7('0x39')],qs[_0xffa7('0x3e')](_0x217159['query'][_0xffa7('0x3e')]));_0x247ede[_0xffa7('0x3d')]=_0x247ede[_0xffa7('0x3d')][_0xffa7('0x4f')]?_0x247ede['attributes']:_0x810c39['model'];_0x247ede[_0xffa7('0x40')]=qs['sort'](_0x217159[_0xffa7('0x3a')][_0xffa7('0x41')]);_0x247ede[_0xffa7('0x42')]=qs['filters'](_[_0xffa7('0x43')](_0x217159[_0xffa7('0x3a')],_0x810c39[_0xffa7('0x3b')]));if(_0x217159['query'][_0xffa7('0x46')]){_0x247ede[_0xffa7('0x42')]=_[_0xffa7('0x44')](_0x247ede[_0xffa7('0x42')],{'$or':_['map'](_0x247ede['attributes'],function(_0xc03afd){var _0x179f07={};_0x179f07[_0xc03afd]={'$like':'%'+_0x217159['query']['filter']+'%'};return _0x179f07;})});}_0x247ede=_[_0xffa7('0x44')]({},_0x247ede,_0x217159[_0xffa7('0x47')]);return _0x32c880[_0xffa7('0x115')](_0x247ede);}})[_0xffa7('0x16')](function(_0x1cf409){if(_0x1cf409){_0x16d8d3=_0x1cf409[_0xffa7('0x4f')];if(!_0x217159[_0xffa7('0x3a')][_0xffa7('0x63')](_0xffa7('0x3f'))){_0x247ede[_0xffa7('0x24')]=qs['limit'](_0x217159[_0xffa7('0x3a')][_0xffa7('0x24')]);_0x247ede[_0xffa7('0x26')]=qs[_0xffa7('0x26')](_0x217159[_0xffa7('0x3a')][_0xffa7('0x26')]);}return _0x32c880['getApplications'](_0x247ede);}})[_0xffa7('0x16')](function(_0x468a0a){if(_0x468a0a){return _0x468a0a?{'count':_0x16d8d3,'rows':_0x468a0a}:null;}})[_0xffa7('0x16')](respondWithResult(_0x29ccef,null))[_0xffa7('0x1f')](handleError(_0x29ccef,null));};exports[_0xffa7('0x116')]=function(_0x1de24d,_0x16bb3c){return db['chatProactiveAction'][_0xffa7('0x56')]({'where':{'id':_0x1de24d[_0xffa7('0x4c')]['id']}})[_0xffa7('0x16')](handleEntityNotFound(_0x16bb3c,null))['then'](function(_0x38c2a2){if(_0x38c2a2){return _0x38c2a2[_0xffa7('0x116')](_0x1de24d[_0xffa7('0x51')][_0xffa7('0x5f')],_[_0xffa7('0x117')](_0x1de24d[_0xffa7('0x51')],[_0xffa7('0x5f'),'id'])||{});}})[_0xffa7('0x16')](respondWithResult(_0x16bb3c,null))[_0xffa7('0x1f')](handleError(_0x16bb3c,null));};exports['getProactiveActions']=function(_0x2680eb,_0x5c55d2){var _0x462cdd={};var _0x38e609={};var _0x4e5ecb;var _0x1d3f30;return db[_0xffa7('0x34')][_0xffa7('0x62')]({'where':{'id':_0x2680eb[_0xffa7('0x4c')]['id']}})[_0xffa7('0x16')](handleEntityNotFound(_0x5c55d2,null))[_0xffa7('0x16')](function(_0x168edb){if(_0x168edb){_0x4e5ecb=_0x168edb;_0x38e609[_0xffa7('0x39')]=_[_0xffa7('0x4e')](db[_0xffa7('0x118')][_0xffa7('0x35')]);_0x38e609[_0xffa7('0x3a')]=_[_0xffa7('0x4e')](_0x2680eb[_0xffa7('0x3a')]);_0x38e609[_0xffa7('0x3b')]=_[_0xffa7('0x3c')](_0x38e609[_0xffa7('0x39')],_0x38e609[_0xffa7('0x3a')]);_0x462cdd['attributes']=_[_0xffa7('0x3c')](_0x38e609[_0xffa7('0x39')],qs[_0xffa7('0x3e')](_0x2680eb[_0xffa7('0x3a')]['fields']));_0x462cdd[_0xffa7('0x3d')]=_0x462cdd[_0xffa7('0x3d')]['length']?_0x462cdd[_0xffa7('0x3d')]:_0x38e609[_0xffa7('0x39')];_0x462cdd['order']=qs['sort'](_0x2680eb['query'][_0xffa7('0x41')]);_0x462cdd[_0xffa7('0x42')]=qs[_0xffa7('0x3b')](_[_0xffa7('0x43')](_0x2680eb[_0xffa7('0x3a')],_0x38e609[_0xffa7('0x3b')]));if(_0x2680eb[_0xffa7('0x3a')][_0xffa7('0x46')]){_0x462cdd[_0xffa7('0x42')]=_[_0xffa7('0x44')](_0x462cdd[_0xffa7('0x42')],{'$or':_['map'](_0x462cdd[_0xffa7('0x3d')],function(_0x401057){var _0x1b71a0={};_0x1b71a0[_0x401057]={'$like':'%'+_0x2680eb[_0xffa7('0x3a')]['filter']+'%'};return _0x1b71a0;})});}_0x462cdd=_[_0xffa7('0x44')]({},_0x462cdd,_0x2680eb[_0xffa7('0x47')]);return _0x4e5ecb[_0xffa7('0xfb')](_0x462cdd);}})[_0xffa7('0x16')](function(_0x12fc95){if(_0x12fc95){_0x1d3f30=_0x12fc95[_0xffa7('0x4f')];if(!_0x2680eb[_0xffa7('0x3a')][_0xffa7('0x63')](_0xffa7('0x3f'))){_0x462cdd[_0xffa7('0x24')]=qs[_0xffa7('0x24')](_0x2680eb['query'][_0xffa7('0x24')]);_0x462cdd[_0xffa7('0x26')]=qs['offset'](_0x2680eb[_0xffa7('0x3a')][_0xffa7('0x26')]);}return _0x4e5ecb[_0xffa7('0xfb')](_0x462cdd);}})['then'](function(_0x35ef67){if(_0x35ef67){return _0x35ef67?{'count':_0x1d3f30,'rows':_0x35ef67}:null;}})[_0xffa7('0x16')](respondWithResult(_0x5c55d2,null))['catch'](handleError(_0x5c55d2,null));};exports[_0xffa7('0x119')]=function(_0x47869b,_0xc2e97b){var _0x1f0867=_0x47869b[_0xffa7('0x3a')][_0xffa7('0x11a')]===_0xffa7('0x11b')?'offlineForm':_0xffa7('0x11c');return db[_0xffa7('0x34')][_0xffa7('0x56')]({'attributes':['id',_0x1f0867],'where':{'id':_0x47869b[_0xffa7('0x4c')]['id']}})['then'](handleEntityNotFound(_0xc2e97b,null))[_0xffa7('0x16')](function(_0x1548e2){if(_0x1548e2){var _0x30f031=_0x1548e2[_0x1f0867];var _0x374b3d=_0x30f031&&_0x30f031['items']?_0x30f031[_0xffa7('0x11d')]:[];_0xc2e97b['send']({'fromKey':_['isNil'](_0x30f031[_0xffa7('0x11e')])?undefined:_0x30f031[_0xffa7('0x11e')],'count':_0x374b3d[_0xffa7('0x4f')],'rows':_0x374b3d});}})[_0xffa7('0x1f')](handleError(_0xc2e97b,null));};exports[_0xffa7('0x11f')]=function(_0x2569b8,_0x4ec254){var _0x250abd={'raw':![],'where':{}};var _0x56405f={};var _0x34821e={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xffa7('0x62')]({'where':{'id':_0x2569b8[_0xffa7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4ec254,null))[_0xffa7('0x16')](function(_0x9d7a5b){if(_0x9d7a5b){_0x56405f[_0xffa7('0x39')]=_['keys'](db[_0xffa7('0xc9')]['rawAttributes']);_0x56405f[_0xffa7('0x3a')]=_[_0xffa7('0x4e')](_0x2569b8[_0xffa7('0x3a')]);_0x56405f[_0xffa7('0x3b')]=_[_0xffa7('0x3c')](_0x56405f[_0xffa7('0x39')],_0x56405f['query']);_0x250abd[_0xffa7('0x3d')]=_['intersection'](_0x56405f['model'],qs[_0xffa7('0x3e')](_0x2569b8[_0xffa7('0x3a')]['fields']));_0x250abd[_0xffa7('0x3d')]=_0x250abd[_0xffa7('0x3d')]['length']?_0x250abd['attributes']:_0x56405f[_0xffa7('0x39')];if(!_0x2569b8['query'][_0xffa7('0x63')](_0xffa7('0x3f'))){_0x250abd['limit']=qs[_0xffa7('0x24')](_0x2569b8['query']['limit']);_0x250abd[_0xffa7('0x26')]=qs[_0xffa7('0x26')](_0x2569b8[_0xffa7('0x3a')][_0xffa7('0x26')]);}_0x250abd['order']=qs[_0xffa7('0x41')](_0x2569b8[_0xffa7('0x3a')][_0xffa7('0x41')]);_0x250abd['where']=qs[_0xffa7('0x3b')](_[_0xffa7('0x43')](_0x2569b8[_0xffa7('0x3a')],_0x56405f['filters']));_0x250abd['where']['ChatWebsiteId']=_0x9d7a5b['id'];if(_0x2569b8[_0xffa7('0x3a')][_0xffa7('0x46')]){_0x250abd[_0xffa7('0x42')]=_[_0xffa7('0x44')](_0x250abd[_0xffa7('0x42')],{'$or':_[_0xffa7('0x33')](_0x250abd[_0xffa7('0x3d')],function(_0x29456a){var _0x1bb485={};_0x1bb485[_0x29456a]={'$like':'%'+_0x2569b8[_0xffa7('0x3a')]['filter']+'%'};return _0x1bb485;})});}_0x250abd=_[_0xffa7('0x44')]({},_0x250abd,_0x2569b8[_0xffa7('0x47')]);return db[_0xffa7('0xc9')][_0xffa7('0x25')]({'where':_0x250abd['where']})[_0xffa7('0x16')](function(_0x58fe78){_0x34821e['count']=_0x58fe78;if(_0x2569b8[_0xffa7('0x3a')][_0xffa7('0x48')]){_0x250abd['include']=[{'all':!![]}];}else{_0x250abd[_0xffa7('0x49')]=[{'model':db[_0xffa7('0x85')],'as':_0xffa7('0x120'),'required':![]},{'model':db[_0xffa7('0xd3')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0xffa7('0x64')](_0x250abd);})['then'](function(_0x2db90d){_0x34821e[_0xffa7('0x4a')]=_0x2db90d;return _0x34821e;});}})[_0xffa7('0x16')](respondWithFilteredResult(_0x4ec254,_0x250abd))[_0xffa7('0x1f')](handleError(_0x4ec254,null));};exports[_0xffa7('0x121')]=function(_0x3ac8a8,_0x4664a2){return db['ChatWebsite'][_0xffa7('0x56')]({'where':{'id':_0x3ac8a8['params']['id']}})[_0xffa7('0x16')](handleEntityNotFound(_0x4664a2,null))['then'](function(_0x4f447e){if(_0x4f447e){return _0x4f447e['addAgents'](_0x3ac8a8[_0xffa7('0x51')][_0xffa7('0x5f')],_['omit'](_0x3ac8a8['body'],['ids','id'])||{})[_0xffa7('0x122')](function(_0x1e65b2){for(var _0x260319=0x0;_0x260319<_0x3ac8a8[_0xffa7('0x51')]['ids']['length'];_0x260319+=0x1){socket['emit'](_0xffa7('0x123'),{'UserId':Number(_0x3ac8a8[_0xffa7('0x51')][_0xffa7('0x5f')][_0x260319]),'ChatWebsiteId':Number(_0x3ac8a8[_0xffa7('0x4c')]['id'])});}return _0x1e65b2;});}})['then'](respondWithResult(_0x4664a2,null))['catch'](handleError(_0x4664a2,null));};exports['removeAgents']=function(_0x3f6a0c,_0x13ccd1){return db[_0xffa7('0x34')][_0xffa7('0x56')]({'where':{'id':_0x3f6a0c[_0xffa7('0x4c')]['id']}})[_0xffa7('0x16')](handleEntityNotFound(_0x13ccd1,null))[_0xffa7('0x16')](function(_0x45d20c){if(_0x45d20c){return _0x45d20c[_0xffa7('0x124')](_0x3f6a0c['query'][_0xffa7('0x5f')])[_0xffa7('0x16')](function(){if(_[_0xffa7('0x125')](_0x3f6a0c['query'][_0xffa7('0x5f')])){for(var _0x2f1b69=0x0;_0x2f1b69<_0x3f6a0c['query'][_0xffa7('0x5f')][_0xffa7('0x4f')];_0x2f1b69+=0x1){socket[_0xffa7('0x126')](_0xffa7('0x127'),{'UserId':Number(_0x3f6a0c['query'][_0xffa7('0x5f')][_0x2f1b69]),'ChatWebsiteId':Number(_0x3f6a0c[_0xffa7('0x4c')]['id'])});}}else{socket[_0xffa7('0x126')](_0xffa7('0x127'),{'UserId':Number(_0x3f6a0c[_0xffa7('0x3a')][_0xffa7('0x5f')]),'ChatWebsiteId':Number(_0x3f6a0c[_0xffa7('0x4c')]['id'])});}});}})[_0xffa7('0x16')](respondWithStatusCode(_0x13ccd1,null))['catch'](handleError(_0x13ccd1,null));};exports[_0xffa7('0x128')]=function(_0x39adc5,_0x1bdd26){var _0x3a4915={};var _0x1b0810={};var _0x52196d;var _0x461ca8;return db[_0xffa7('0x34')][_0xffa7('0x62')]({'where':{'id':_0x39adc5[_0xffa7('0x4c')]['id']}})[_0xffa7('0x16')](handleEntityNotFound(_0x1bdd26,null))[_0xffa7('0x16')](function(_0x439bfb){if(_0x439bfb){_0x52196d=_0x439bfb;_0x1b0810[_0xffa7('0x39')]=_[_0xffa7('0x4e')](db[_0xffa7('0x129')][_0xffa7('0x35')]);_0x1b0810[_0xffa7('0x3a')]=_[_0xffa7('0x4e')](_0x39adc5[_0xffa7('0x3a')]);_0x1b0810[_0xffa7('0x3b')]=_[_0xffa7('0x3c')](_0x1b0810['model'],_0x1b0810[_0xffa7('0x3a')]);_0x3a4915[_0xffa7('0x3d')]=_[_0xffa7('0x3c')](_0x1b0810[_0xffa7('0x39')],qs[_0xffa7('0x3e')](_0x39adc5[_0xffa7('0x3a')][_0xffa7('0x3e')]));_0x3a4915['attributes']=_0x3a4915[_0xffa7('0x3d')][_0xffa7('0x4f')]?_0x3a4915[_0xffa7('0x3d')]:_0x1b0810[_0xffa7('0x39')];_0x3a4915[_0xffa7('0x40')]=qs[_0xffa7('0x41')](_0x39adc5[_0xffa7('0x3a')][_0xffa7('0x41')]);_0x3a4915[_0xffa7('0x42')]=qs['filters'](_['pick'](_0x39adc5[_0xffa7('0x3a')],_0x1b0810[_0xffa7('0x3b')]));if(_0x39adc5[_0xffa7('0x3a')]['filter']){_0x3a4915[_0xffa7('0x42')]=_[_0xffa7('0x44')](_0x3a4915[_0xffa7('0x42')],{'$or':_['map'](_0x3a4915[_0xffa7('0x3d')],function(_0x5ecdd6){var _0x9fc5ce={};_0x9fc5ce[_0x5ecdd6]={'$like':'%'+_0x39adc5[_0xffa7('0x3a')][_0xffa7('0x46')]+'%'};return _0x9fc5ce;})});}_0x3a4915=_[_0xffa7('0x44')]({},_0x3a4915,_0x39adc5[_0xffa7('0x47')]);return _0x52196d[_0xffa7('0x128')](_0x3a4915);}})[_0xffa7('0x16')](function(_0x5a4a37){if(_0x5a4a37){_0x461ca8=_0x5a4a37['length'];if(!_0x39adc5[_0xffa7('0x3a')][_0xffa7('0x63')]('nolimit')){_0x3a4915[_0xffa7('0x24')]=qs[_0xffa7('0x24')](_0x39adc5[_0xffa7('0x3a')][_0xffa7('0x24')]);_0x3a4915['offset']=qs[_0xffa7('0x26')](_0x39adc5[_0xffa7('0x3a')]['offset']);}return _0x52196d['getAgents'](_0x3a4915);}})[_0xffa7('0x16')](function(_0x4ada51){if(_0x4ada51){return _0x4ada51?{'count':_0x461ca8,'rows':_0x4ada51}:null;}})[_0xffa7('0x16')](respondWithResult(_0x1bdd26,null))[_0xffa7('0x1f')](handleError(_0x1bdd26,null));};
\ No newline at end of file
+var _0xbb07=['attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','getProactiveActions','License','increment','Interval','Intervals','some','server/files/chat/iframe.ejs','x-real-ip','connection','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','querystring','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','update','destroy','get','ChatWebsites','end','stack','name','map','ChatWebsite','rawAttributes','type','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','Pause','mandatoryDispositionPause','body','user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','describe','addDisposition','ChatWebsiteId','Disposition','create','getDispositions','ids','addAnswer','CannedAnswer','getAnswers','length','removeAnswers','addLogo','sitepic','file','filename','addCustomerAvatar','addSystemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','agentAvatar','server/files/images/avatars/','getCustomerAvatar','customerAvatar','showCustomerAvatar','systemAvatar','user-agent-parser','setUA','headers','user-agent','chat','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','List','CmContact','Contacts','DESC','ChatApplication','Applications','account','list','applications','orderBy','ListId','contact','cf-connecting-ip','x-forwarded-for','firstName','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','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','notify','files','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','findOne','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','email','offlineMessageSubject','MailAccountId','subjectOffline','mapValues','Chat','NotifyMailAccount','notifyMail','server'];(function(_0x17177d,_0x4a8d9f){var _0x2c90f8=function(_0x1321f0){while(--_0x1321f0){_0x17177d['push'](_0x17177d['shift']());}};_0x2c90f8(++_0x4a8d9f);}(_0xbb07,0x167));var _0x7bb0=function(_0x40306a,_0x1f6a0a){_0x40306a=_0x40306a-0x0;var _0x1842c3=_0xbb07[_0x40306a];return _0x1842c3;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x7bb0('0x0'));var util=require(_0x7bb0('0x1'));var path=require(_0x7bb0('0x2'));var ejs=require(_0x7bb0('0x3'));var fs=require('fs');var fs_extra=require(_0x7bb0('0x4'));var _=require('lodash');var querystring=require(_0x7bb0('0x5'));var Redis=require(_0x7bb0('0x6'));var qs=require(_0x7bb0('0x7'));var logger=require('../../config/logger')(_0x7bb0('0x8'));var config=require(_0x7bb0('0x9'));var db=require(_0x7bb0('0xa'))['db'];config[_0x7bb0('0xb')]=_[_0x7bb0('0xc')](config[_0x7bb0('0xb')],{'host':_0x7bb0('0xd'),'port':0x18eb});var socket=require(_0x7bb0('0xe'))(new Redis(config[_0x7bb0('0xb')]));require(_0x7bb0('0xf'))[_0x7bb0('0x10')](socket);var htmlToText=require('html-to-text');var jayson=require(_0x7bb0('0x11'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x7bb0('0x12')]['http']({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x11aaf1,_0x116d29,_0x5e4d8a,_0x40ee95){return new BPromise(function(_0xabf4,_0x222cea){var _0x3f98a5=_0x40ee95||client;return _0x3f98a5['request'](_0x11aaf1,_0x5e4d8a)[_0x7bb0('0x13')](function(_0x140253){logger[_0x7bb0('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x116d29,'request\x20sent');logger[_0x7bb0('0x15')](_0x7bb0('0x16'),_0x116d29,'request\x20sent',JSON[_0x7bb0('0x17')](_0x140253));if(_0x140253[_0x7bb0('0x18')]){if(_0x140253['error'][_0x7bb0('0x19')]===0x1f4){logger[_0x7bb0('0x18')](_0x7bb0('0x1a'),_0x116d29,_0x140253[_0x7bb0('0x18')][_0x7bb0('0x1b')]);return _0x222cea(_0x140253[_0x7bb0('0x18')][_0x7bb0('0x1b')]);}logger[_0x7bb0('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x116d29,_0x140253[_0x7bb0('0x18')]['message']);return _0xabf4(_0x140253[_0x7bb0('0x18')][_0x7bb0('0x1b')]);}else{logger[_0x7bb0('0x14')](_0x7bb0('0x1a'),_0x116d29,'request\x20sent');_0xabf4(_0x140253[_0x7bb0('0x1c')][_0x7bb0('0x1b')]);}})[_0x7bb0('0x1d')](function(_0x5ef6c5){logger[_0x7bb0('0x18')](_0x7bb0('0x1a'),_0x116d29,_0x5ef6c5);_0x222cea(_0x5ef6c5);});});}function respondWithStatusCode(_0x10b9a9,_0x121f78){_0x121f78=_0x121f78||0xcc;return function(_0x2e5906){if(_0x2e5906){return _0x10b9a9[_0x7bb0('0x1e')](_0x121f78);}return _0x10b9a9[_0x7bb0('0x1f')](_0x121f78)['end']();};}function respondWithResult(_0x246006,_0x1b6bfb){_0x1b6bfb=_0x1b6bfb||0xc8;return function(_0x1e6013){if(_0x1e6013){return _0x246006[_0x7bb0('0x1f')](_0x1b6bfb)[_0x7bb0('0x20')](_0x1e6013);}};}function respondWithFilteredResult(_0x5db5ea,_0x200c60){return function(_0x165a24){if(_0x165a24){var _0x1622fb=typeof _0x200c60[_0x7bb0('0x21')]===_0x7bb0('0x22')&&typeof _0x200c60['limit']===_0x7bb0('0x22');var _0x1c8070=_0x165a24[_0x7bb0('0x23')];var _0x195b66=_0x1622fb?0x0:_0x200c60['offset'];var _0x357601=_0x1622fb?_0x165a24['count']:_0x200c60[_0x7bb0('0x21')]+_0x200c60[_0x7bb0('0x24')];var _0x238118;if(_0x357601>=_0x1c8070){_0x357601=_0x1c8070;_0x238118=0xc8;}else{_0x238118=0xce;}_0x5db5ea[_0x7bb0('0x1f')](_0x238118);return _0x5db5ea[_0x7bb0('0x25')]('Content-Range',_0x195b66+'-'+_0x357601+'/'+_0x1c8070)[_0x7bb0('0x20')](_0x165a24);}return null;};}function saveUpdates(_0x5b8cc1){return function(_0x457e3d){if(_0x457e3d){return _0x457e3d[_0x7bb0('0x26')](_0x5b8cc1)[_0x7bb0('0x13')](function(_0x200135){return _0x200135;});}return null;};}function removeEntity(_0x1a84f7){return function(_0x2f85d4){if(_0x2f85d4){return _0x2f85d4[_0x7bb0('0x27')]()[_0x7bb0('0x13')](function(){var _0x2be9d3=_0x2f85d4[_0x7bb0('0x28')]({'plain':!![]});var _0x344a60=_0x7bb0('0x29');return db['UserProfileResource'][_0x7bb0('0x27')]({'where':{'type':_0x344a60,'resourceId':_0x2be9d3['id']}})['then'](function(){return _0x2f85d4;});})[_0x7bb0('0x13')](function(){_0x1a84f7[_0x7bb0('0x1f')](0xcc)[_0x7bb0('0x2a')]();});}};}function handleEntityNotFound(_0x500de7){return function(_0x27f890){if(!_0x27f890){_0x500de7[_0x7bb0('0x1e')](0x194);}return _0x27f890;};}function handleError(_0x4f719f,_0x295846){_0x295846=_0x295846||0x1f4;return function(_0x2d1d06){logger[_0x7bb0('0x18')](_0x2d1d06[_0x7bb0('0x2b')]);if(_0x2d1d06['name']){delete _0x2d1d06[_0x7bb0('0x2c')];}_0x4f719f['status'](_0x295846)['send'](_0x2d1d06);};}exports['index']=function(_0x3bace3,_0x47ad58){var _0x54d519={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x34c9ad={},_0x39fa13={'count':0x0,'rows':[]};var _0x391ef6=_[_0x7bb0('0x2d')](db[_0x7bb0('0x2e')][_0x7bb0('0x2f')],function(_0x4b3d36){return{'name':_0x4b3d36['fieldName'],'type':_0x4b3d36[_0x7bb0('0x30')]['key']};});_0x34c9ad['model']=_[_0x7bb0('0x2d')](_0x391ef6,_0x7bb0('0x2c'));_0x34c9ad[_0x7bb0('0x31')]=_[_0x7bb0('0x32')](_0x3bace3[_0x7bb0('0x31')]);_0x34c9ad['filters']=_[_0x7bb0('0x33')](_0x34c9ad[_0x7bb0('0x34')],_0x34c9ad[_0x7bb0('0x31')]);_0x54d519[_0x7bb0('0x35')]=_[_0x7bb0('0x33')](_0x34c9ad[_0x7bb0('0x34')],qs[_0x7bb0('0x36')](_0x3bace3[_0x7bb0('0x31')][_0x7bb0('0x36')]));_0x54d519[_0x7bb0('0x35')]=_0x54d519['attributes']['length']?_0x54d519[_0x7bb0('0x35')]:_0x34c9ad[_0x7bb0('0x34')];if(!_0x3bace3[_0x7bb0('0x31')][_0x7bb0('0x37')](_0x7bb0('0x38'))){_0x54d519['limit']=qs[_0x7bb0('0x24')](_0x3bace3[_0x7bb0('0x31')][_0x7bb0('0x24')]);_0x54d519[_0x7bb0('0x21')]=qs['offset'](_0x3bace3['query'][_0x7bb0('0x21')]);}_0x54d519[_0x7bb0('0x39')]=qs['sort'](_0x3bace3[_0x7bb0('0x31')][_0x7bb0('0x3a')]);_0x54d519[_0x7bb0('0x3b')]=qs['filters'](_[_0x7bb0('0x3c')](_0x3bace3[_0x7bb0('0x31')],_0x34c9ad[_0x7bb0('0x3d')]),_0x391ef6);if(_0x3bace3[_0x7bb0('0x31')][_0x7bb0('0x3e')]){_0x54d519[_0x7bb0('0x3b')]=_[_0x7bb0('0x3f')](_0x54d519[_0x7bb0('0x3b')],{'$or':_[_0x7bb0('0x2d')](_0x391ef6,function(_0x378731){if(_0x378731['type']!==_0x7bb0('0x40')){var _0x4704ab={};_0x4704ab[_0x378731[_0x7bb0('0x2c')]]={'$like':'%'+_0x3bace3[_0x7bb0('0x31')][_0x7bb0('0x3e')]+'%'};return _0x4704ab;}})});}_0x54d519=_[_0x7bb0('0x3f')]({},_0x54d519,_0x3bace3[_0x7bb0('0x41')]);var _0x64ac14={'where':_0x54d519[_0x7bb0('0x3b')]};return db[_0x7bb0('0x2e')][_0x7bb0('0x23')](_0x64ac14)[_0x7bb0('0x13')](function(_0x463c15){_0x39fa13[_0x7bb0('0x23')]=_0x463c15;if(_0x3bace3[_0x7bb0('0x31')][_0x7bb0('0x42')]){_0x54d519[_0x7bb0('0x43')]=[{'all':!![]}];}return db[_0x7bb0('0x2e')][_0x7bb0('0x44')](_0x54d519);})['then'](function(_0x4d6f8f){_0x39fa13[_0x7bb0('0x45')]=_0x4d6f8f;return _0x39fa13;})[_0x7bb0('0x13')](respondWithFilteredResult(_0x47ad58,_0x54d519))[_0x7bb0('0x1d')](handleError(_0x47ad58,null));};exports[_0x7bb0('0x46')]=function(_0x4164a7,_0x412839){var _0x4feaaf={'raw':![],'where':{'id':_0x4164a7['params']['id']},'include':[{'model':db[_0x7bb0('0x47')],'as':_0x7bb0('0x48')}]},_0x4fb3a4={};_0x4fb3a4[_0x7bb0('0x34')]=_[_0x7bb0('0x32')](db[_0x7bb0('0x2e')][_0x7bb0('0x2f')]);_0x4fb3a4[_0x7bb0('0x31')]=_[_0x7bb0('0x32')](_0x4164a7[_0x7bb0('0x31')]);_0x4fb3a4[_0x7bb0('0x3d')]=_[_0x7bb0('0x33')](_0x4fb3a4[_0x7bb0('0x34')],_0x4fb3a4['query']);_0x4feaaf['attributes']=_[_0x7bb0('0x33')](_0x4fb3a4[_0x7bb0('0x34')],qs['fields'](_0x4164a7[_0x7bb0('0x31')][_0x7bb0('0x36')]));_0x4feaaf[_0x7bb0('0x35')]=_0x4feaaf[_0x7bb0('0x35')]['length']?_0x4feaaf[_0x7bb0('0x35')]:_0x4fb3a4[_0x7bb0('0x34')];if(_0x4164a7[_0x7bb0('0x31')][_0x7bb0('0x42')]){_0x4feaaf[_0x7bb0('0x43')]=[{'all':!![]}];}_0x4feaaf=_[_0x7bb0('0x3f')]({},_0x4feaaf,_0x4164a7['options']);return db[_0x7bb0('0x2e')]['find'](_0x4feaaf)[_0x7bb0('0x13')](handleEntityNotFound(_0x412839,null))[_0x7bb0('0x13')](respondWithResult(_0x412839,null))[_0x7bb0('0x1d')](handleError(_0x412839,null));};exports['create']=function(_0x2f9735,_0x2dd176){return db[_0x7bb0('0x2e')]['create'](_0x2f9735[_0x7bb0('0x49')],{})['then'](function(_0x271c15){var _0x517d57=_0x2f9735[_0x7bb0('0x4a')][_0x7bb0('0x28')]({'plain':!![]});if(!_0x517d57)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x517d57[_0x7bb0('0x4b')]===_0x7bb0('0x4a')){var _0x344635=_0x271c15['get']({'plain':!![]});var _0x3a855b=_0x7bb0('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x3a855b,'userProfileId':_0x517d57[_0x7bb0('0x4c')]},'raw':!![]})[_0x7bb0('0x13')](function(_0x2f7eba){if(_0x2f7eba&&_0x2f7eba[_0x7bb0('0x4d')]===0x0){return db[_0x7bb0('0x4e')]['create']({'name':_0x344635[_0x7bb0('0x2c')],'resourceId':_0x344635['id'],'type':_0x2f7eba[_0x7bb0('0x2c')],'sectionId':_0x2f7eba['id']},{})[_0x7bb0('0x13')](function(){return _0x271c15;});}else{return _0x271c15;}})[_0x7bb0('0x1d')](function(_0x1a3926){logger[_0x7bb0('0x18')](_0x7bb0('0x4f'),_0x1a3926);throw _0x1a3926;});}return _0x271c15;})[_0x7bb0('0x13')](respondWithResult(_0x2dd176,0xc9))[_0x7bb0('0x1d')](handleError(_0x2dd176,null));};exports[_0x7bb0('0x26')]=function(_0x3f3d8b,_0x13df31){if(_0x3f3d8b[_0x7bb0('0x49')]['id']){delete _0x3f3d8b[_0x7bb0('0x49')]['id'];}return db[_0x7bb0('0x2e')][_0x7bb0('0x50')]({'where':{'id':_0x3f3d8b[_0x7bb0('0x51')]['id']},'include':[{'model':db['Pause'],'as':_0x7bb0('0x48')}]})[_0x7bb0('0x13')](handleEntityNotFound(_0x13df31,null))[_0x7bb0('0x13')](saveUpdates(_0x3f3d8b[_0x7bb0('0x49')],null))[_0x7bb0('0x13')](respondWithResult(_0x13df31,null))[_0x7bb0('0x1d')](handleError(_0x13df31,null));};exports[_0x7bb0('0x27')]=function(_0x49bb3d,_0x293081){return db[_0x7bb0('0x2e')][_0x7bb0('0x50')]({'where':{'id':_0x49bb3d[_0x7bb0('0x51')]['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x293081,null))[_0x7bb0('0x13')](removeEntity(_0x293081,null))['catch'](handleError(_0x293081,null));};exports[_0x7bb0('0x52')]=function(_0x874741,_0x4e4975){return db[_0x7bb0('0x2e')][_0x7bb0('0x52')]()[_0x7bb0('0x13')](respondWithResult(_0x4e4975,null))[_0x7bb0('0x1d')](handleError(_0x4e4975,null));};exports[_0x7bb0('0x53')]=function(_0x210b02,_0x18453a){if(_0x210b02[_0x7bb0('0x49')]['id']){delete _0x210b02['body']['id'];}return db[_0x7bb0('0x2e')][_0x7bb0('0x50')]({'where':{'id':_0x210b02['params']['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x18453a,null))[_0x7bb0('0x13')](function(_0x281605){if(_0x281605){_0x210b02[_0x7bb0('0x49')][_0x7bb0('0x54')]=_0x281605['id'];return db[_0x7bb0('0x55')][_0x7bb0('0x56')](_0x210b02[_0x7bb0('0x49')]);}})['then'](respondWithResult(_0x18453a,null))[_0x7bb0('0x1d')](handleError(_0x18453a,null));};exports[_0x7bb0('0x57')]=function(_0x2331bd,_0x1733c2){var _0x104cc0={'raw':![],'where':{}};var _0xae753={};var _0x4eb6b3={'count':0x0,'rows':[]};return db[_0x7bb0('0x2e')]['findOne']({'where':{'id':_0x2331bd[_0x7bb0('0x51')]['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x1733c2,null))['then'](function(_0x52cc83){if(_0x52cc83){_0xae753[_0x7bb0('0x34')]=_['keys'](db[_0x7bb0('0x55')][_0x7bb0('0x2f')]);_0xae753['query']=_[_0x7bb0('0x32')](_0x2331bd[_0x7bb0('0x31')]);_0xae753['filters']=_[_0x7bb0('0x33')](_0xae753[_0x7bb0('0x34')],_0xae753['query']);_0x104cc0[_0x7bb0('0x35')]=_[_0x7bb0('0x33')](_0xae753[_0x7bb0('0x34')],qs[_0x7bb0('0x36')](_0x2331bd[_0x7bb0('0x31')][_0x7bb0('0x36')]));_0x104cc0['attributes']=_0x104cc0['attributes']['length']?_0x104cc0['attributes']:_0xae753[_0x7bb0('0x34')];if(!_0x2331bd[_0x7bb0('0x31')][_0x7bb0('0x37')](_0x7bb0('0x38'))){_0x104cc0[_0x7bb0('0x24')]=qs[_0x7bb0('0x24')](_0x2331bd[_0x7bb0('0x31')][_0x7bb0('0x24')]);_0x104cc0[_0x7bb0('0x21')]=qs[_0x7bb0('0x21')](_0x2331bd[_0x7bb0('0x31')]['offset']);}_0x104cc0[_0x7bb0('0x39')]=qs[_0x7bb0('0x3a')](_0x2331bd[_0x7bb0('0x31')][_0x7bb0('0x3a')]);_0x104cc0[_0x7bb0('0x3b')]=qs['filters'](_[_0x7bb0('0x3c')](_0x2331bd['query'],_0xae753[_0x7bb0('0x3d')]));_0x104cc0[_0x7bb0('0x3b')][_0x7bb0('0x54')]=_0x52cc83['id'];if(_0x2331bd[_0x7bb0('0x31')][_0x7bb0('0x3e')]){_0x104cc0[_0x7bb0('0x3b')]=_[_0x7bb0('0x3f')](_0x104cc0[_0x7bb0('0x3b')],{'$or':_[_0x7bb0('0x2d')](_0x104cc0['attributes'],function(_0x2d34fa){var _0x14c8d2={};_0x14c8d2[_0x2d34fa]={'$like':'%'+_0x2331bd[_0x7bb0('0x31')][_0x7bb0('0x3e')]+'%'};return _0x14c8d2;})});}_0x104cc0=_[_0x7bb0('0x3f')]({},_0x104cc0,_0x2331bd[_0x7bb0('0x41')]);return db['Disposition'][_0x7bb0('0x23')]({'where':_0x104cc0['where']})['then'](function(_0x23f0c0){_0x4eb6b3[_0x7bb0('0x23')]=_0x23f0c0;if(_0x2331bd[_0x7bb0('0x31')][_0x7bb0('0x42')]){_0x104cc0[_0x7bb0('0x43')]=[{'all':!![]}];}return db['Disposition'][_0x7bb0('0x44')](_0x104cc0);})[_0x7bb0('0x13')](function(_0x266feb){_0x4eb6b3[_0x7bb0('0x45')]=_0x266feb;return _0x4eb6b3;});}})[_0x7bb0('0x13')](respondWithFilteredResult(_0x1733c2,_0x104cc0))['catch'](handleError(_0x1733c2,null));};exports['removeDispositions']=function(_0x2cb799,_0x2124cc){return db[_0x7bb0('0x2e')][_0x7bb0('0x50')]({'where':{'id':_0x2cb799[_0x7bb0('0x51')]['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x2124cc,null))[_0x7bb0('0x13')](function(_0x54bef6){if(_0x54bef6){return _0x54bef6['removeDispositions'](_0x2cb799[_0x7bb0('0x31')][_0x7bb0('0x58')]);}})[_0x7bb0('0x13')](respondWithStatusCode(_0x2124cc,null))['catch'](handleError(_0x2124cc,null));};exports[_0x7bb0('0x59')]=function(_0xbfa18f,_0x527a3f){if(_0xbfa18f[_0x7bb0('0x49')]['id']){delete _0xbfa18f[_0x7bb0('0x49')]['id'];}return db[_0x7bb0('0x2e')][_0x7bb0('0x50')]({'where':{'id':_0xbfa18f[_0x7bb0('0x51')]['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x527a3f,null))[_0x7bb0('0x13')](function(_0x363b88){if(_0x363b88){_0xbfa18f[_0x7bb0('0x49')][_0x7bb0('0x54')]=_0x363b88['id'];return db[_0x7bb0('0x5a')][_0x7bb0('0x56')](_0xbfa18f['body']);}})['then'](respondWithResult(_0x527a3f,null))[_0x7bb0('0x1d')](handleError(_0x527a3f,null));};exports[_0x7bb0('0x5b')]=function(_0x57f84f,_0x2bfb91){var _0x257251={'raw':![],'where':{}};var _0x1151a5={};var _0x5b15f8={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x57f84f['params']['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x2bfb91,null))[_0x7bb0('0x13')](function(_0x355514){if(_0x355514){_0x1151a5[_0x7bb0('0x34')]=_[_0x7bb0('0x32')](db[_0x7bb0('0x5a')][_0x7bb0('0x2f')]);_0x1151a5['query']=_[_0x7bb0('0x32')](_0x57f84f[_0x7bb0('0x31')]);_0x1151a5[_0x7bb0('0x3d')]=_[_0x7bb0('0x33')](_0x1151a5[_0x7bb0('0x34')],_0x1151a5[_0x7bb0('0x31')]);_0x257251[_0x7bb0('0x35')]=_[_0x7bb0('0x33')](_0x1151a5['model'],qs[_0x7bb0('0x36')](_0x57f84f[_0x7bb0('0x31')][_0x7bb0('0x36')]));_0x257251[_0x7bb0('0x35')]=_0x257251['attributes'][_0x7bb0('0x5c')]?_0x257251['attributes']:_0x1151a5[_0x7bb0('0x34')];if(!_0x57f84f[_0x7bb0('0x31')][_0x7bb0('0x37')](_0x7bb0('0x38'))){_0x257251[_0x7bb0('0x24')]=qs[_0x7bb0('0x24')](_0x57f84f['query'][_0x7bb0('0x24')]);_0x257251[_0x7bb0('0x21')]=qs[_0x7bb0('0x21')](_0x57f84f[_0x7bb0('0x31')][_0x7bb0('0x21')]);}_0x257251[_0x7bb0('0x39')]=qs[_0x7bb0('0x3a')](_0x57f84f['query'][_0x7bb0('0x3a')]);_0x257251[_0x7bb0('0x3b')]=qs[_0x7bb0('0x3d')](_[_0x7bb0('0x3c')](_0x57f84f[_0x7bb0('0x31')],_0x1151a5['filters']));_0x257251[_0x7bb0('0x3b')][_0x7bb0('0x54')]=_0x355514['id'];if(_0x57f84f[_0x7bb0('0x31')][_0x7bb0('0x3e')]){_0x257251[_0x7bb0('0x3b')]=_['merge'](_0x257251[_0x7bb0('0x3b')],{'$or':_[_0x7bb0('0x2d')](_0x257251['attributes'],function(_0x280504){var _0xba16cc={};_0xba16cc[_0x280504]={'$like':'%'+_0x57f84f[_0x7bb0('0x31')][_0x7bb0('0x3e')]+'%'};return _0xba16cc;})});}_0x257251=_[_0x7bb0('0x3f')]({},_0x257251,_0x57f84f['options']);return db['CannedAnswer'][_0x7bb0('0x23')]({'where':_0x257251[_0x7bb0('0x3b')]})['then'](function(_0x295aa7){_0x5b15f8[_0x7bb0('0x23')]=_0x295aa7;if(_0x57f84f[_0x7bb0('0x31')][_0x7bb0('0x42')]){_0x257251['include']=[{'all':!![]}];}return db[_0x7bb0('0x5a')][_0x7bb0('0x44')](_0x257251);})[_0x7bb0('0x13')](function(_0x1f25fb){_0x5b15f8[_0x7bb0('0x45')]=_0x1f25fb;return _0x5b15f8;});}})[_0x7bb0('0x13')](respondWithFilteredResult(_0x2bfb91,_0x257251))[_0x7bb0('0x1d')](handleError(_0x2bfb91,null));};exports[_0x7bb0('0x5d')]=function(_0x3185bd,_0x57ba61){return db[_0x7bb0('0x2e')]['find']({'where':{'id':_0x3185bd['params']['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x57ba61,null))[_0x7bb0('0x13')](function(_0x113ef5){if(_0x113ef5){return _0x113ef5[_0x7bb0('0x5d')](_0x3185bd['query'][_0x7bb0('0x58')]);}})[_0x7bb0('0x13')](respondWithStatusCode(_0x57ba61,null))['catch'](handleError(_0x57ba61,null));};exports[_0x7bb0('0x5e')]=function(_0x3e5f3c,_0x346afd){_0x3e5f3c[_0x7bb0('0x49')][_0x7bb0('0x5f')]=_0x3e5f3c[_0x7bb0('0x60')][_0x7bb0('0x61')];return db[_0x7bb0('0x2e')][_0x7bb0('0x50')]({'where':{'id':_0x3e5f3c[_0x7bb0('0x51')]['id']}})['then'](handleEntityNotFound(_0x346afd,null))[_0x7bb0('0x13')](saveUpdates(_0x3e5f3c['body'],null))[_0x7bb0('0x13')](respondWithResult(_0x346afd,null))['catch'](handleError(_0x346afd,null));};exports['addAvatar']=function(_0x374491,_0x5ca5f3){_0x374491[_0x7bb0('0x49')]['agentAvatar']=_0x374491[_0x7bb0('0x60')][_0x7bb0('0x61')];return db[_0x7bb0('0x2e')][_0x7bb0('0x50')]({'where':{'id':_0x374491[_0x7bb0('0x51')]['id']}})['then'](handleEntityNotFound(_0x5ca5f3,null))[_0x7bb0('0x13')](saveUpdates(_0x374491[_0x7bb0('0x49')],null))[_0x7bb0('0x13')](respondWithResult(_0x5ca5f3,null))[_0x7bb0('0x1d')](handleError(_0x5ca5f3,null));};exports[_0x7bb0('0x62')]=function(_0x28fbdd,_0x2b7bc8){_0x28fbdd[_0x7bb0('0x49')]['customerAvatar']=_0x28fbdd[_0x7bb0('0x60')]['filename'];return db[_0x7bb0('0x2e')][_0x7bb0('0x50')]({'where':{'id':_0x28fbdd[_0x7bb0('0x51')]['id']}})['then'](handleEntityNotFound(_0x2b7bc8,null))[_0x7bb0('0x13')](saveUpdates(_0x28fbdd[_0x7bb0('0x49')],null))[_0x7bb0('0x13')](respondWithResult(_0x2b7bc8,null))[_0x7bb0('0x1d')](handleError(_0x2b7bc8,null));};exports[_0x7bb0('0x63')]=function(_0x53c1a0,_0x33bdab){_0x53c1a0[_0x7bb0('0x49')]['systemAvatar']=_0x53c1a0[_0x7bb0('0x60')][_0x7bb0('0x61')];return db[_0x7bb0('0x2e')][_0x7bb0('0x50')]({'where':{'id':_0x53c1a0['params']['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x33bdab,null))[_0x7bb0('0x13')](saveUpdates(_0x53c1a0[_0x7bb0('0x49')],null))[_0x7bb0('0x13')](respondWithResult(_0x33bdab,null))[_0x7bb0('0x1d')](handleError(_0x33bdab,null));};exports['getLogo']=function(_0x178287,_0x16e02b){var _0x5e0fb5=path[_0x7bb0('0x64')](config[_0x7bb0('0x65')],_0x7bb0('0x66'));var _0x1fefa8={'where':{'id':_0x178287[_0x7bb0('0x51')]['id']},'attributes':['id',_0x7bb0('0x5f')],'raw':!![]};var _0x2d1dfd=![];return require(_0x7bb0('0x67'))[_0x7bb0('0x68')]()[_0x7bb0('0x13')](function(_0x10c0fd){if(_0x10c0fd){_0x2d1dfd=_0x10c0fd[_0x7bb0('0x69')];}})['then'](function(){return db[_0x7bb0('0x2e')][_0x7bb0('0x50')](_0x1fefa8);})[_0x7bb0('0x13')](handleEntityNotFound(_0x16e02b,null))[_0x7bb0('0x13')](function(_0x925cb2){if(_0x925cb2){if(!_[_0x7bb0('0x6a')](_0x925cb2[_0x7bb0('0x5f')])){if(fs[_0x7bb0('0x6b')](path[_0x7bb0('0x64')](config[_0x7bb0('0x65')],_0x7bb0('0x6c'),_0x925cb2['sitepic']))&&_0x2d1dfd){_0x5e0fb5=path[_0x7bb0('0x64')](config['root'],_0x7bb0('0x6c'),_0x925cb2[_0x7bb0('0x5f')]);}}return _0x16e02b[_0x7bb0('0x6d')](_0x5e0fb5);}})[_0x7bb0('0x1d')](handleError(_0x16e02b,null));};exports[_0x7bb0('0x6e')]=function(_0x1784da,_0x40a89f){var _0x1ec56a=path['join'](config[_0x7bb0('0x65')],'server/files/images/avatars/default_avatar.png');var _0x24e813={'where':{'id':_0x1784da[_0x7bb0('0x51')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x7bb0('0x2e')][_0x7bb0('0x50')](_0x24e813)['then'](handleEntityNotFound(_0x40a89f,null))[_0x7bb0('0x13')](function(_0x5ba35c){if(_0x5ba35c){if(!_[_0x7bb0('0x6a')](_0x5ba35c[_0x7bb0('0x6f')])){if(fs['existsSync'](path['join'](config[_0x7bb0('0x65')],_0x7bb0('0x70'),_0x5ba35c['agentAvatar']))){_0x1ec56a=path['join'](config[_0x7bb0('0x65')],_0x7bb0('0x70'),_0x5ba35c[_0x7bb0('0x6f')]);}}return _0x40a89f[_0x7bb0('0x6d')](_0x1ec56a);}})[_0x7bb0('0x1d')](handleError(_0x40a89f,null));};exports[_0x7bb0('0x71')]=function(_0x112db7,_0x2fe0ec){var _0x27c092=path['join'](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x17d809={'where':{'id':_0x112db7[_0x7bb0('0x51')]['id']},'attributes':['id',_0x7bb0('0x72'),_0x7bb0('0x73')],'raw':!![]};return db['ChatWebsite'][_0x7bb0('0x50')](_0x17d809)['then'](handleEntityNotFound(_0x2fe0ec,null))[_0x7bb0('0x13')](function(_0x4169dd){if(_0x4169dd){if(!_['isNil'](_0x4169dd['customerAvatar'])){if(fs['existsSync'](path[_0x7bb0('0x64')](config[_0x7bb0('0x65')],_0x7bb0('0x70'),_0x4169dd['customerAvatar']))&&_0x4169dd[_0x7bb0('0x73')]){_0x27c092=path['join'](config[_0x7bb0('0x65')],_0x7bb0('0x70'),_0x4169dd['customerAvatar']);}}return _0x2fe0ec[_0x7bb0('0x6d')](_0x27c092);}})[_0x7bb0('0x1d')](handleError(_0x2fe0ec,null));};exports['getSystemAvatar']=function(_0x293d3b,_0x544b82){var _0x47868f=path[_0x7bb0('0x64')](config['root'],'server/files/images/avatars/system_avatar.png');var _0x28e9e2={'where':{'id':_0x293d3b[_0x7bb0('0x51')]['id']},'attributes':['id',_0x7bb0('0x74')],'raw':!![]};return db[_0x7bb0('0x2e')][_0x7bb0('0x50')](_0x28e9e2)[_0x7bb0('0x13')](handleEntityNotFound(_0x544b82,null))[_0x7bb0('0x13')](function(_0xb7285e){if(_0xb7285e){if(!_[_0x7bb0('0x6a')](_0xb7285e['systemAvatar'])){if(fs[_0x7bb0('0x6b')](path[_0x7bb0('0x64')](config[_0x7bb0('0x65')],_0x7bb0('0x70'),_0xb7285e['systemAvatar']))){_0x47868f=path[_0x7bb0('0x64')](config['root'],_0x7bb0('0x70'),_0xb7285e[_0x7bb0('0x74')]);}}return _0x544b82[_0x7bb0('0x6d')](_0x47868f);}})['catch'](handleError(_0x544b82,null));};exports['notify']=function(_0x17eeea,_0x8229ef){var _0x2a5f21=require(_0x7bb0('0x75'));var _0x474eb3=new _0x2a5f21();var _0x66e01c=_0x474eb3[_0x7bb0('0x76')](_0x17eeea[_0x7bb0('0x77')][_0x7bb0('0x78')])['getResult']();var _0x159567={'body':_0x17eeea[_0x7bb0('0x49')],'channel':_0x7bb0('0x79')};var _0x7afb45=[];var _0x3e37de=[];var _0x3b25fb={};var _0x4b64d2=![];return db['CmContact'][_0x7bb0('0x52')]()[_0x7bb0('0x13')](function(_0x1f5e4c){if(!_0x1f5e4c){throw new db[(_0x7bb0('0x7a'))][(_0x7bb0('0x7b'))](_0x7bb0('0x7c'));}_0x7afb45=_['difference'](_[_0x7bb0('0x32')](_0x1f5e4c),[_0x7bb0('0x7d'),_0x7bb0('0x7e')]);_0x3e37de=_[_0x7bb0('0x7f')](_['keys'](_0x1f5e4c),[_0x7bb0('0x7d'),_0x7bb0('0x7e'),'CompanyId','ListId']);if(_0x17eeea[_0x7bb0('0x49')]['id']){delete _0x17eeea[_0x7bb0('0x49')]['id'];}if(_[_0x7bb0('0x6a')](_0x17eeea[_0x7bb0('0x49')][_0x7bb0('0x80')])){throw new db[(_0x7bb0('0x7a'))]['ValidationError'](_0x7bb0('0x81'));}if(_['isNil'](_0x17eeea['body'][_0x7bb0('0x49')])||_0x17eeea['body'][_0x7bb0('0x49')]===''){throw new db['Sequelize']['ValidationError'](_0x7bb0('0x82'));}if(_[_0x7bb0('0x6a')](_0x17eeea[_0x7bb0('0x49')]['mapKey'])){throw new db[(_0x7bb0('0x7a'))][(_0x7bb0('0x7b'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3e37de);}if(!_[_0x7bb0('0x83')](_0x3e37de,_0x17eeea[_0x7bb0('0x49')]['mapKey'])){throw new db[(_0x7bb0('0x7a'))][(_0x7bb0('0x7b'))](_0x7bb0('0x84')+_0x3e37de);}_0x3b25fb[_0x17eeea['body'][_0x7bb0('0x85')]]=_0x17eeea[_0x7bb0('0x49')]['from'];})[_0x7bb0('0x13')](function(){return db[_0x7bb0('0x2e')][_0x7bb0('0x50')]({'where':{'id':_0x17eeea[_0x7bb0('0x51')]['id']},'include':[{'model':db[_0x7bb0('0x86')],'as':_0x7bb0('0x87'),'include':[{'model':db[_0x7bb0('0x88')],'as':_0x7bb0('0x89'),'where':_0x3b25fb,'limit':0x1,'order':[[_0x7bb0('0x7e'),_0x7bb0('0x8a')]]}]},{'model':db[_0x7bb0('0x8b')],'as':_0x7bb0('0x8c')}]});})['then'](handleEntityNotFound(_0x8229ef,null))[_0x7bb0('0x13')](function(_0x499590){if(_0x499590&&_0x499590[_0x7bb0('0x87')]){_0x159567[_0x7bb0('0x8d')]=_0x499590;_0x159567['applications']=_0x499590[_0x7bb0('0x8c')];_0x159567[_0x7bb0('0x8e')]=_0x499590[_0x7bb0('0x87')];_0x159567[_0x7bb0('0x8f')]=_[_0x7bb0('0x90')](_0x159567[_0x7bb0('0x8f')],['priority'],['asc']);if(_0x159567['account'][_0x7bb0('0x8c')]){delete _0x159567[_0x7bb0('0x8d')][_0x7bb0('0x8c')];}if(_0x159567[_0x7bb0('0x8d')][_0x7bb0('0x87')]&&_0x159567[_0x7bb0('0x8d')]['List']['Contacts'][_0x7bb0('0x5c')]){return _0x159567[_0x7bb0('0x8d')][_0x7bb0('0x87')][_0x7bb0('0x89')][0x0];}var _0x42b9bd=_[_0x7bb0('0xc')](_0x17eeea['body'],{'firstName':_0x17eeea[_0x7bb0('0x49')][_0x7bb0('0x80')],'ListId':_0x499590[_0x7bb0('0x91')]});_0x42b9bd[_0x17eeea[_0x7bb0('0x49')][_0x7bb0('0x85')]]=_0x17eeea[_0x7bb0('0x49')][_0x7bb0('0x80')];return db['CmContact'][_0x7bb0('0x56')](_0x42b9bd,{'fields':_0x7afb45,'raw':!![]});}})['then'](handleEntityNotFound(_0x8229ef,null))[_0x7bb0('0x13')](function(_0x877b33){_0x159567[_0x7bb0('0x92')]=_0x877b33;var _0x2c23c4=_0x17eeea[_0x7bb0('0x49')]['customerIp'];if(_0x17eeea[_0x7bb0('0x77')]['cf-connecting-ip']){_0x2c23c4=_0x17eeea[_0x7bb0('0x77')][_0x7bb0('0x93')];}else if(_0x17eeea[_0x7bb0('0x77')][_0x7bb0('0x94')]){_0x2c23c4=_['first'](_0x17eeea['headers']['x-forwarded-for']['split'](','));}if(_0x877b33){var _0x2a3206={'ContactId':_0x877b33['id'],'ChatWebsiteId':_0x17eeea[_0x7bb0('0x51')]['id'],'from':(_0x877b33[_0x7bb0('0x95')]||'')+'\x20'+(_0x877b33[_0x7bb0('0x96')]||''),'customerIp':_0x2c23c4,'customerPort':_0x17eeea[_0x7bb0('0x77')]['x-real-port']?_0x17eeea[_0x7bb0('0x77')][_0x7bb0('0x97')]:null,'referer':_0x17eeea[_0x7bb0('0x49')][_0x7bb0('0x98')],'browserName':_0x66e01c[_0x7bb0('0x99')][_0x7bb0('0x2c')]&&_0x66e01c[_0x7bb0('0x99')][_0x7bb0('0x9a')]?util[_0x7bb0('0x9b')](_0x7bb0('0x9c'),_0x66e01c[_0x7bb0('0x99')][_0x7bb0('0x2c')],_0x66e01c[_0x7bb0('0x99')][_0x7bb0('0x9a')]):'unknown','browserVersion':_0x66e01c[_0x7bb0('0x99')]['version']||_0x7bb0('0x9d'),'osName':util[_0x7bb0('0x9b')](_0x7bb0('0x9c'),_0x66e01c['os'][_0x7bb0('0x2c')],_0x66e01c['os'][_0x7bb0('0x9a')]),'osVersion':_0x66e01c['os'][_0x7bb0('0x9a')],'deviceModel':_0x66e01c['device']['model']&&_0x66e01c[_0x7bb0('0x9e')][_0x7bb0('0x9f')]?util[_0x7bb0('0x9b')](_0x7bb0('0xa0'),_0x66e01c[_0x7bb0('0x9e')]['model'],_0x66e01c[_0x7bb0('0x9e')][_0x7bb0('0x9f')],_0x66e01c[_0x7bb0('0x9e')]['type']):null,'deviceVendor':_0x66e01c[_0x7bb0('0x9e')][_0x7bb0('0x9f')],'deviceType':_0x66e01c[_0x7bb0('0x9e')][_0x7bb0('0x30')],'formData':JSON[_0x7bb0('0x17')](_0x17eeea[_0x7bb0('0x49')])};var _0x471b08={'ChatWebsiteId':_0x17eeea['params']['id'],'closed':![]};if(_0x17eeea[_0x7bb0('0x49')][_0x7bb0('0xa1')]){_0x471b08['threadId']=_0x17eeea['body'][_0x7bb0('0xa1')];return db[_0x7bb0('0xa2')][_0x7bb0('0x50')]({'where':_0x471b08})[_0x7bb0('0x13')](function(_0x262849){if(_0x262849){return[_0x262849,![]];}_0x2a3206[_0x7bb0('0xa1')]=_0x17eeea[_0x7bb0('0x49')][_0x7bb0('0xa1')];_0x2a3206[_0x7bb0('0xa3')]=_0x17eeea[_0x7bb0('0x49')]['externalUrl'];return db[_0x7bb0('0xa2')][_0x7bb0('0x56')](_0x2a3206)['then'](function(_0x5a0ef7){return[_0x5a0ef7,!![]];});});}_0x471b08[_0x7bb0('0xa4')]=_0x877b33['id'];if(_0x17eeea['body']['interaction']&&_0x17eeea[_0x7bb0('0x49')][_0x7bb0('0xa5')]['id']){_0x471b08['id']=_0x17eeea[_0x7bb0('0x49')][_0x7bb0('0xa5')]['id'];return db[_0x7bb0('0xa2')]['find']({'where':_0x471b08})[_0x7bb0('0x13')](function(_0x45aa5b){if(_0x45aa5b){return[_0x45aa5b,![]];}return db[_0x7bb0('0xa2')][_0x7bb0('0x56')](_0x2a3206)[_0x7bb0('0x13')](function(_0x10f59d){return[_0x10f59d,!![]];});});}return db['ChatInteraction'][_0x7bb0('0x56')](_0x2a3206)[_0x7bb0('0x13')](function(_0x3389a5){return[_0x3389a5,!![]];});}})[_0x7bb0('0xa6')](function(_0x132f4f,_0x3aa2b2){if(_0x132f4f){_0x4b64d2=_0x3aa2b2;if(!_0x3aa2b2){var _0x2a2e5e={'from':(_0x159567[_0x7bb0('0x92')]['firstName']||'')+'\x20'+(_0x159567[_0x7bb0('0x92')][_0x7bb0('0x96')]||'')};if(_0x17eeea['body'][_0x7bb0('0xa1')]&&_0x17eeea[_0x7bb0('0x49')]['messageId']&&_0x17eeea[_0x7bb0('0x49')][_0x7bb0('0xa1')]!=_0x17eeea[_0x7bb0('0x49')][_0x7bb0('0xa7')]){_0x2a2e5e[_0x7bb0('0xa1')]=_0x17eeea[_0x7bb0('0x49')]['messageId'];}return _0x132f4f[_0x7bb0('0x26')](_0x2a2e5e);}else{return _0x132f4f;}}})[_0x7bb0('0x13')](function(_0x1de5be){_0x159567[_0x7bb0('0xa5')]=_0x1de5be[_0x7bb0('0x28')]({'plain':!![]});_0x159567[_0x7bb0('0xa5')][_0x7bb0('0xa8')]=_0x4b64d2;if(_0x159567['interaction'][_0x7bb0('0xa8')]){if(_0x159567[_0x7bb0('0x8d')][_0x7bb0('0xa9')]){_0x159567['applications'][_0x7bb0('0xaa')]({'id':0x0,'priority':_0x159567[_0x7bb0('0x8f')]['length']+0x1,'app':_0x7bb0('0xab'),'appdata':_0x7bb0('0xac'),'interval':_0x7bb0('0xad')});}}return db['ChatMessage'][_0x7bb0('0x56')]({'body':_0x17eeea[_0x7bb0('0x49')][_0x7bb0('0x49')],'ChatWebsiteId':_0x17eeea[_0x7bb0('0x51')]['id'],'ChatInteractionId':_0x1de5be['id'],'direction':'in','ContactId':_0x159567[_0x7bb0('0x92')]['id'],'AttachmentId':_0x17eeea[_0x7bb0('0x49')][_0x7bb0('0xae')]});})[_0x7bb0('0x13')](function(_0x442347){_0x159567['message']=_0x442347;if(_0x159567[_0x7bb0('0xa5')][_0x7bb0('0xaf')]){return db[_0x7bb0('0xb0')][_0x7bb0('0x50')]({'attributes':['id',_0x7bb0('0x2c')],'where':{'id':_0x159567[_0x7bb0('0xa5')][_0x7bb0('0xaf')]}})[_0x7bb0('0x13')](function(_0x3e925c){if(_0x3e925c){_0x159567[_0x7bb0('0x8f')][_0x7bb0('0xb1')]({'id':0x0,'priority':0x0,'app':_0x7bb0('0xb2'),'appdata':_0x3e925c[_0x7bb0('0x2c')]+','+(_0x159567['account'][_0x7bb0('0xb3')]||0xa),'interval':_0x7bb0('0xad')});_0x159567[_0x7bb0('0xb4')]=!![];}return respondWithRpcPromise('Start',_0x7bb0('0xb5'),_0x159567);});}return respondWithRpcPromise('Start',_0x7bb0('0xb5'),_0x159567);})[_0x7bb0('0x13')](function(_0xc33a79){respondWithRpcPromise('EventManager','EventManager',{'event':_0x7bb0('0xb6'),'message':_0xc33a79},client9002);return _0xc33a79;})['then'](respondWithResult(_0x8229ef,null))['catch'](handleError(_0x8229ef,null));};exports['offline']=function(_0x48ae89,_0x5013cb){var _0x2dbd27,_0x2f60ba,_0x2b27fb;var _0x4225b4=[];var _0x2ddd59={};var _0x4bdb96=_0x48ae89[_0x7bb0('0xb7')]||[];var _0x553765=[];var _0x4420b1;return db[_0x7bb0('0x88')]['describe']()[_0x7bb0('0x13')](function(_0x4ca351){if(!_0x4ca351){throw new db[(_0x7bb0('0x7a'))][(_0x7bb0('0x7b'))](_0x7bb0('0x7c'));}_0x4225b4=_[_0x7bb0('0x7f')](_['keys'](_0x4ca351),[_0x7bb0('0x7d'),_0x7bb0('0x7e'),'CompanyId',_0x7bb0('0x91')]);if(_0x48ae89[_0x7bb0('0x49')]['id']){delete _0x48ae89[_0x7bb0('0x49')]['id'];}if(_[_0x7bb0('0x6a')](_0x48ae89['body'][_0x7bb0('0x80')])){throw _0x5013cb[_0x7bb0('0x1f')](0x1f4)[_0x7bb0('0xb8')](new db['Sequelize'][(_0x7bb0('0x7b'))]('from\x20is\x20mandatory'));}if(_[_0x7bb0('0x6a')](_0x48ae89['body'][_0x7bb0('0x49')])||_0x48ae89['body']['body']===''){throw _0x5013cb[_0x7bb0('0x1f')](0x1f4)['send'](new db[(_0x7bb0('0x7a'))][(_0x7bb0('0x7b'))](_0x7bb0('0x82')));}if(_['isNil'](_0x48ae89[_0x7bb0('0x49')][_0x7bb0('0xb9')])){throw _0x5013cb[_0x7bb0('0x1f')](0x1f4)[_0x7bb0('0xb8')](new db[(_0x7bb0('0x7a'))][(_0x7bb0('0x7b'))](_0x7bb0('0xba')+_0x4225b4));}if(!_[_0x7bb0('0x83')](_0x4225b4,_0x48ae89[_0x7bb0('0x49')]['mapKeyOffline'])){throw _0x5013cb[_0x7bb0('0x1f')](0x1f4)[_0x7bb0('0xb8')](new db[(_0x7bb0('0x7a'))][(_0x7bb0('0x7b'))](_0x7bb0('0xbb')+_0x4225b4));}_0x2ddd59[_0x48ae89['body'][_0x7bb0('0xb9')]]=_0x48ae89['body'][_0x7bb0('0x80')];})[_0x7bb0('0x13')](function(){return db['ChatWebsite'][_0x7bb0('0x50')]({'where':{'id':_0x48ae89[_0x7bb0('0x51')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0x7bb0('0xbc')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x5013cb,null))[_0x7bb0('0x13')](function(_0x23c1b6){if(_0x23c1b6&&_0x23c1b6[_0x7bb0('0x87')]){_0x2f60ba=_0x23c1b6;var _0x2dd5ec=_['defaults'](_0x48ae89[_0x7bb0('0x49')],{'firstName':_0x48ae89[_0x7bb0('0x49')][_0x7bb0('0x80')],'phone':_0x48ae89[_0x7bb0('0x49')][_0x7bb0('0x80')],'ListId':_0x23c1b6[_0x7bb0('0x91')]});_0x2dd5ec[_0x48ae89[_0x7bb0('0x49')][_0x7bb0('0xb9')]]=_0x48ae89['body'][_0x7bb0('0x80')];return db['CmContact'][_0x7bb0('0xbd')]({'where':_0x2ddd59,'defaults':_0x2dd5ec});}})[_0x7bb0('0xa6')](function(_0x29afff){if(_0x29afff){_0x2b27fb=_0x29afff;var _0xfa1d9d=fs[_0x7bb0('0xbe')](path[_0x7bb0('0x64')](config[_0x7bb0('0x65')],_0x7bb0('0xbf')),_0x7bb0('0xc0'));var _0x25657e=ejs[_0x7bb0('0xc1')](_0xfa1d9d,{'body':_[_0x7bb0('0xc2')](_0x48ae89['body'][_0x7bb0('0x49')]),'bodyTitle':_0x2f60ba[_0x7bb0('0xc3')]});return db[_0x7bb0('0xc4')][_0x7bb0('0x56')]({'body':_0x25657e,'plainBody':htmlToText['fromString'](_0x25657e),'ContactId':_0x29afff['id'],'ChatWebsiteId':_0x2f60ba['id']});}})[_0x7bb0('0x13')](function(_0x33b1df){_0x4420b1=_0x33b1df;if(_0x4bdb96[_0x7bb0('0x5c')]){var _0x3b8e1e=_0x4bdb96[_0x7bb0('0x2d')](function(_0x127e29){return{'name':_0x127e29[_0x7bb0('0xc5')],'basename':_0x127e29[_0x7bb0('0x61')],'type':_0x127e29[_0x7bb0('0xc6')],'ChatOfflineMessageId':_0x33b1df['id']};});_0x553765=_0x3b8e1e['map'](_0x3febcf=>{var _0x4c6f0c={'filename':_0x3febcf[_0x7bb0('0x2c')],'path':path[_0x7bb0('0x64')](config['root'],'server',_0x7bb0('0xb7'),'attachments',_0x7bb0('0xc7'),_0x3febcf[_0x7bb0('0xc8')])};return _0x4c6f0c;});if(!_0x2f60ba[_0x7bb0('0xc9')]){return db[_0x7bb0('0xca')][_0x7bb0('0xcb')](function(_0x2e1ff7){return db[_0x7bb0('0xcc')][_0x7bb0('0xcd')](_0x3b8e1e,{'transaction':_0x2e1ff7});});}}})[_0x7bb0('0x13')](function(){if(_0x4420b1){_0x2dbd27=_0x4420b1;return db[_0x7bb0('0xbc')][_0x7bb0('0xce')]({'where':{'service':!![]},'include':[{'model':db[_0x7bb0('0xcf')],'as':_0x7bb0('0xd0'),'raw':!![],'include':[{'model':db[_0x7bb0('0xd1')],'as':_0x7bb0('0xd1'),'raw':!![]}]}]});}})['then'](function(_0x3ff717){if(_0x3ff717&&_0x3ff717[_0x7bb0('0xd0')]&&_0x2f60ba['forwardOffline']&&_0x2f60ba[_0x7bb0('0xd2')]){var _0x3b3c71=_0x3ff717[_0x7bb0('0xd3')]();return respondWithRpcPromise(_0x7bb0('0xd4'),_0x7bb0('0xd5'),{'account':_0x3b3c71,'message':{'from':util[_0x7bb0('0x9b')]('\x22%s\x22\x20<%s>',_0x3ff717['name'],_0x3ff717[_0x7bb0('0xd6')]||_0x3ff717[_0x7bb0('0xd0')][_0x7bb0('0x4a')]),'to':_0x2f60ba['forwardOfflineAddress'],'subject':_0x2f60ba[_0x7bb0('0xd7')],'html':_0x2dbd27['body'],'attachments':_0x553765}},client9003)[_0x7bb0('0x13')](function(){return _0x2dbd27;})[_0x7bb0('0x1d')](function(_0x2d6d46){logger['error'](_0x2d6d46);});}})['then'](function(){if(_0x2f60ba&&_0x2f60ba['openNewInteraction']&&_0x2f60ba[_0x7bb0('0xd8')]){var _0x3bdfef=[];if(_0x4bdb96[_0x7bb0('0x5c')]){_0x3bdfef=_0x4bdb96[_0x7bb0('0x2d')](function(_0x551bdc){return{'name':_0x551bdc[_0x7bb0('0xc5')],'basename':_0x551bdc['filename'],'type':_0x551bdc[_0x7bb0('0xc6')],'ChatOfflineMessageId':_0x4420b1['id']};});}var _0x216456;if(!_['isNil'](_0x2f60ba[_0x7bb0('0xd9')])){var _0x59fa34=_[_0x7bb0('0x2d')](_0x48ae89[_0x7bb0('0x49')],function(_0x303b5d){return _0x303b5d;});var _0x212e14=_['toPairsIn'](_0x59fa34)[0x0];var _0x3fbb06=_[_0x7bb0('0xda')](_0x212e14,function(_0x2dd7c0){return _0x2dd7c0;});_0x216456=_0x3fbb06[0x1][_0x2f60ba[_0x7bb0('0xd9')]];}var _0x4f33b5={'from':_0x2b27fb['email'],'firstName':_0x2b27fb[_0x7bb0('0x95')],'lastName':_0x2b27fb[_0x7bb0('0x96')],'mapKey':_0x7bb0('0xd6'),'message':{'from':_0x2b27fb[_0x7bb0('0xd6')],'to':_0x2f60ba[_0x7bb0('0xbc')][_0x7bb0('0xd6')],'cc':'','subject':_[_0x7bb0('0x6a')](_0x216456)?_0x2f60ba[_0x7bb0('0xd7')]:_0x216456,'messageId':'','sentAt':new Date(),'attach':_0x3bdfef[_0x7bb0('0x5c')],'attachments':_0x3bdfef,'originChannel':_0x7bb0('0xdb'),'ChatWebsiteId':_0x2f60ba['id'],'ChatOfflineMessageId':_0x2dbd27['id'],'originTo':_0x2f60ba[_0x7bb0('0xbc')][_0x7bb0('0xd6')]},'body':_0x2dbd27[_0x7bb0('0x49')]};var _0x546f7f={'account':{'id':_0x2f60ba[_0x7bb0('0xd8')]},'body':_0x4f33b5,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x7bb0('0xdc'),_0x7bb0('0xdd'),_0x546f7f,client9001)['then'](function(){return _0x2dbd27;})[_0x7bb0('0x1d')](function(_0x16b47a){logger[_0x7bb0('0x18')](_0x16b47a);});}return;})[_0x7bb0('0x13')](function(){if(_0x2dbd27){return _0x2dbd27;}})[_0x7bb0('0x13')](respondWithResult(_0x5013cb,null))['catch'](function(_0x4fe59a){logger[_0x7bb0('0x18')]('catch',_0x4fe59a);for(var _0x3f3d0b of _0x4bdb96){var _0x4e2cf5=path[_0x7bb0('0x64')](config[_0x7bb0('0x65')],_0x7bb0('0xde'),_0x7bb0('0xb7'),_0x7bb0('0xdf'),_0x7bb0('0xc7'),_0x3f3d0b[_0x7bb0('0x61')]);fs_extra[_0x7bb0('0xe0')](_0x4e2cf5)['catch'](function(_0x5c0c70){logger['error'](_0x7bb0('0xe1'),_0x4e2cf5,_0x5c0c70);});}});};exports['addInteraction']=function(_0x612c04,_0x56c520){return db[_0x7bb0('0xa2')]['find']({'where':{'id':_0x612c04[_0x7bb0('0x51')]['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x56c520,null))['then'](function(_0x526264){if(_0x526264){return _0x526264[_0x7bb0('0xe2')](_0x612c04['body'][_0x7bb0('0x58')],_[_0x7bb0('0xe3')](_0x612c04['body'],[_0x7bb0('0x58'),'id'])||{});}})[_0x7bb0('0x13')](respondWithResult(_0x56c520,null))[_0x7bb0('0x1d')](handleError(_0x56c520,null));};exports['getInteractions']=function(_0x56b0ad,_0x1044c7){var _0x44f909={'raw':![],'where':{}};var _0x2bdfdd={};var _0x56f2c2={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x7bb0('0xce')]({'where':{'id':_0x56b0ad[_0x7bb0('0x51')]['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x1044c7,null))['then'](function(_0x20da56){if(_0x20da56){_0x2bdfdd[_0x7bb0('0x34')]=_[_0x7bb0('0x32')](db[_0x7bb0('0xa2')][_0x7bb0('0x2f')]);_0x2bdfdd[_0x7bb0('0x31')]=_['keys'](_0x56b0ad[_0x7bb0('0x31')]);_0x2bdfdd[_0x7bb0('0x3d')]=_['intersection'](_0x2bdfdd[_0x7bb0('0x34')],_0x2bdfdd[_0x7bb0('0x31')]);_0x44f909[_0x7bb0('0x35')]=_[_0x7bb0('0x33')](_0x2bdfdd['model'],qs[_0x7bb0('0x36')](_0x56b0ad[_0x7bb0('0x31')][_0x7bb0('0x36')]));_0x44f909['attributes']=_0x44f909[_0x7bb0('0x35')]['length']?_0x44f909['attributes']:_0x2bdfdd[_0x7bb0('0x34')];if(!_0x56b0ad['query'][_0x7bb0('0x37')](_0x7bb0('0x38'))){_0x44f909[_0x7bb0('0x24')]=qs[_0x7bb0('0x24')](_0x56b0ad[_0x7bb0('0x31')][_0x7bb0('0x24')]);_0x44f909['offset']=qs[_0x7bb0('0x21')](_0x56b0ad[_0x7bb0('0x31')][_0x7bb0('0x21')]);}_0x44f909[_0x7bb0('0x39')]=qs[_0x7bb0('0x3a')](_0x56b0ad[_0x7bb0('0x31')][_0x7bb0('0x3a')]);_0x44f909['where']=qs['filters'](_[_0x7bb0('0x3c')](_0x56b0ad[_0x7bb0('0x31')],_0x2bdfdd['filters']));_0x44f909[_0x7bb0('0x3b')][_0x7bb0('0x54')]=_0x20da56['id'];if(_0x56b0ad[_0x7bb0('0x31')]['filter']){_0x44f909['where']=_['merge'](_0x44f909[_0x7bb0('0x3b')],{'$or':_['map'](_0x44f909[_0x7bb0('0x35')],function(_0x47338a){var _0x275de0={};_0x275de0[_0x47338a]={'$like':'%'+_0x56b0ad['query'][_0x7bb0('0x3e')]+'%'};return _0x275de0;})});}_0x44f909=_[_0x7bb0('0x3f')]({},_0x44f909,_0x56b0ad[_0x7bb0('0x41')]);return db[_0x7bb0('0xa2')]['count']({'where':_0x44f909[_0x7bb0('0x3b')]})[_0x7bb0('0x13')](function(_0x47ac69){_0x56f2c2[_0x7bb0('0x23')]=_0x47ac69;if(_0x56b0ad[_0x7bb0('0x31')][_0x7bb0('0x42')]){_0x44f909[_0x7bb0('0x43')]=[{'model':db[_0x7bb0('0x88')],'as':_0x7bb0('0xe4'),'required':![]},{'model':db[_0x7bb0('0xb0')],'as':_0x7bb0('0xe5'),'attributes':[_0x7bb0('0x2c'),_0x7bb0('0xe6'),_0x7bb0('0xe7')],'required':![]},{'model':db[_0x7bb0('0xe8')],'as':_0x7bb0('0xe9'),'attributes':['id',_0x7bb0('0x2c'),_0x7bb0('0xea')],'where':_0x56b0ad['query'][_0x7bb0('0xeb')]?{'id':_0x56b0ad[_0x7bb0('0x31')][_0x7bb0('0xeb')]}:undefined,'required':_0x56b0ad[_0x7bb0('0x31')][_0x7bb0('0xeb')]?!![]:![]}];}return db[_0x7bb0('0xa2')][_0x7bb0('0x44')](_0x44f909);})[_0x7bb0('0x13')](function(_0x40ccb3){_0x56f2c2['rows']=_0x40ccb3;return _0x56f2c2;});}})[_0x7bb0('0x13')](respondWithFilteredResult(_0x1044c7,_0x44f909))[_0x7bb0('0x1d')](handleError(_0x1044c7,null));};function iftimePromise(_0x14bc81,_0x36b329){return respondWithRpcPromise(_0x7bb0('0xec'),_0x7bb0('0xed'),{'command':_0x36b329[_0x7bb0('0xee')]?util[_0x7bb0('0x9b')](_0x7bb0('0xef'),_0x14bc81[_0x7bb0('0xf0')],_0x36b329['timezone']):util[_0x7bb0('0x9b')](_0x7bb0('0xf1'),_0x14bc81[_0x7bb0('0xf0')])},client9002)['then'](function(_0x276f41){var _0x324498=_0x276f41&&_0x276f41['indexOf'](_0x7bb0('0xf2'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x36b329['id'],_0x14bc81['id'],_0x14bc81['interval'],_0x324498?_0x7bb0('0xf3'):_0x7bb0('0xf4'),_0x36b329[_0x7bb0('0xee')]?_0x36b329[_0x7bb0('0xee')]:_0x7bb0('0xf5'));return _0x324498;})[_0x7bb0('0x1d')](function(_0x4d5352){logger[_0x7bb0('0x18')](_0x7bb0('0xf6'),_0x36b329['id'],_0x14bc81['id'],_0x14bc81['interval'],util['inspect'](_0x4d5352,{'showHidden':![],'depth':null}),_0x36b329['timezone']?_0x36b329[_0x7bb0('0xee')]:_0x7bb0('0xf5'));return![];});}exports[_0x7bb0('0xed')]=function(_0x4ee46c,_0x21af01){var _0xbe6035=0x0;var _0x2cd9fc=0x0;var _0x3591eb=![];var _0x3ce8da;var _0x512fb2;return db[_0x7bb0('0x2e')]['find']({'where':{'id':_0x4ee46c[_0x7bb0('0x51')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x7bb0('0xf0')],'raw':!![]}]}]})[_0x7bb0('0x13')](handleEntityNotFound(_0x21af01,null))[_0x7bb0('0x13')](function(_0x52596f){if(_0x52596f){_0x3ce8da=_0x52596f;return _0x52596f[_0x7bb0('0xf7')]({'raw':!![]});}})[_0x7bb0('0x13')](function(_0xff378c){if(_0x3ce8da){if(_0xff378c){_0x512fb2=_0xff378c;}}return require('../../config/license/util')[_0x7bb0('0x68')]();})[_0x7bb0('0x13')](function(_0x36fb06){if(_0x36fb06){_0x2cd9fc=_0x36fb06['virtual'];_0x3591eb=_0x36fb06[_0x7bb0('0x69')];}})[_0x7bb0('0x13')](function(){return db[_0x7bb0('0xa2')]['count']({'where':{'closed':![]}});})[_0x7bb0('0x13')](function(_0x1b528b){_0xbe6035=_0x1b528b;if(_0x2cd9fc&&_0x1b528b>_0x2cd9fc){return db[_0x7bb0('0xf8')][_0x7bb0('0xce')]({'where':{'id':0x1}})[_0x7bb0('0x13')](function(_0x3a1a94){if(_0x3a1a94){_0x3a1a94[_0x7bb0('0xf9')]('chatLicenseExceeded');}});}})[_0x7bb0('0x13')](function(){if(_0x3ce8da[_0x7bb0('0xfa')]&&_0x3ce8da['Interval'][_0x7bb0('0xfb')]){var _0x536c5e=[];for(var _0x1ae6b1=0x0;_0x1ae6b1<_0x3ce8da[_0x7bb0('0xfa')][_0x7bb0('0xfb')][_0x7bb0('0x5c')];_0x1ae6b1++){var _0x5ba3e2=_0x3ce8da['Interval'][_0x7bb0('0xfb')][_0x1ae6b1][_0x7bb0('0x28')]({'plain':!![]});_0x536c5e[_0x7bb0('0xaa')](iftimePromise(_0x5ba3e2,_0x3ce8da));}return BPromise['all'](_0x536c5e)[_0x7bb0('0x13')](function(_0xde3817){return _[_0x7bb0('0xfc')](_0xde3817);});}else{return!![];}})[_0x7bb0('0x13')](function(_0x108223){var _0x27e7f0=fs[_0x7bb0('0xbe')](path[_0x7bb0('0x64')](config[_0x7bb0('0x65')],_0x7bb0('0xfd')),_0x7bb0('0xc0'));var _0x1305de={'remote':_0x3ce8da['remote'],'query':querystring['stringify'](_[_0x7bb0('0x3f')](_0x3ce8da[_0x7bb0('0x28')]({'plain':!![]}),{'customerIp':_0x4ee46c[_0x7bb0('0x77')][_0x7bb0('0x94')]||_0x4ee46c[_0x7bb0('0x77')][_0x7bb0('0xfe')]||_0x4ee46c[_0x7bb0('0xff')]['remoteAddress']||_0x4ee46c['ip'],'referer':_0x4ee46c['headers'][_0x7bb0('0x98')],'openedInteractions':_0xbe6035,'maxInteractions':_0x2cd9fc,'virtual':_0x3591eb['virtual'],'online':_0x108223,'custom':_0x3591eb}))['replace'](/'/g,'\x5c\x27')};_0x21af01[_0x7bb0('0xb8')](ejs[_0x7bb0('0xc1')](Mustache['render'](_0x27e7f0,_0x1305de),{'proactiveActions':_0x512fb2,'alignment':_0x3ce8da[_0x7bb0('0x100')],'verticalAlignment':_0x3ce8da[_0x7bb0('0x101')],'div_color':_0x3ce8da['color'],'labelText':_0x3ce8da[_0x7bb0('0x102')],'text_color':_0x3ce8da[_0x7bb0('0x103')],'text_button_color':_0x3ce8da[_0x7bb0('0x104')],'button_color':_0x3ce8da[_0x7bb0('0x105')],'background_color':_0x3ce8da[_0x7bb0('0x106')],'hideWhenOffline':_0x3ce8da[_0x7bb0('0x107')],'interval':_0x3ce8da[_0x7bb0('0x108')]}));})['catch'](handleError(_0x21af01,null));};exports[_0x7bb0('0x109')]=function(_0x583e80,_0x153259){var _0x411d29=_0x583e80['params']['id'];var _0x269664=_0x583e80[_0x7bb0('0x49')];var _0x468569=0xc8;var _0x25dfa8=null;return db[_0x7bb0('0xca')][_0x7bb0('0xcb')]({'isolationLevel':db[_0x7bb0('0xca')][_0x7bb0('0x10a')][_0x7bb0('0x10b')][_0x7bb0('0x10c')]},function(_0x5c95b4){return db[_0x7bb0('0x2e')][_0x7bb0('0xce')]({'where':{'id':_0x411d29},'transaction':_0x5c95b4})[_0x7bb0('0x13')](function(_0x8d3ddd){if(_0x8d3ddd){return db[_0x7bb0('0x8b')]['destroy']({'where':{'ChatWebsiteId':_0x411d29},'transaction':_0x5c95b4})[_0x7bb0('0x13')](function(){var _0x4f3eaa=_['map'](_0x269664,function(_0xccc6a8){_0xccc6a8[_0x7bb0('0x54')]=_0x411d29;return _0xccc6a8;});return db[_0x7bb0('0x8b')][_0x7bb0('0xcd')](_0x4f3eaa,{'transaction':_0x5c95b4});});}else{_0x468569=0x194;_0x25dfa8=[];}});})['then'](function(){if(_0x468569!==0x194){return db[_0x7bb0('0x8b')][_0x7bb0('0x10d')]({'where':{'ChatWebsiteId':_0x411d29},'order':_0x7bb0('0x10e')})['then'](function(_0x10d460){_0x25dfa8=_0x10d460;});}})['catch'](function(_0x777ec4){_0x468569=0x1f4;logger['error'](_0x777ec4[_0x7bb0('0x2b')]);if(_0x777ec4['name']){delete _0x777ec4[_0x7bb0('0x2c')];}_0x25dfa8=_0x777ec4;})[_0x7bb0('0x10f')](function(){if(_0x25dfa8===null){_0x153259[_0x7bb0('0x1e')](_0x468569);}else{if(_0x468569===0x1f4){_0x153259[_0x7bb0('0x1f')](_0x468569)[_0x7bb0('0xb8')](_0x25dfa8);}else{_0x153259[_0x7bb0('0x1f')](_0x468569)[_0x7bb0('0x20')](_0x25dfa8);}}});};exports[_0x7bb0('0x110')]=function(_0x305fc9,_0x1ec35a){var _0x2d9a7f={};var _0x690130={};var _0x1019b8;var _0x246593;return db[_0x7bb0('0x2e')][_0x7bb0('0xce')]({'where':{'id':_0x305fc9[_0x7bb0('0x51')]['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x1ec35a,null))['then'](function(_0x97b7d8){if(_0x97b7d8){_0x1019b8=_0x97b7d8;_0x690130['model']=_[_0x7bb0('0x32')](db[_0x7bb0('0x8b')][_0x7bb0('0x2f')]);_0x690130['query']=_[_0x7bb0('0x32')](_0x305fc9[_0x7bb0('0x31')]);_0x690130[_0x7bb0('0x3d')]=_[_0x7bb0('0x33')](_0x690130[_0x7bb0('0x34')],_0x690130['query']);_0x2d9a7f['attributes']=_['intersection'](_0x690130['model'],qs[_0x7bb0('0x36')](_0x305fc9[_0x7bb0('0x31')][_0x7bb0('0x36')]));_0x2d9a7f[_0x7bb0('0x35')]=_0x2d9a7f[_0x7bb0('0x35')][_0x7bb0('0x5c')]?_0x2d9a7f['attributes']:_0x690130['model'];_0x2d9a7f[_0x7bb0('0x39')]=qs['sort'](_0x305fc9[_0x7bb0('0x31')][_0x7bb0('0x3a')]);_0x2d9a7f[_0x7bb0('0x3b')]=qs['filters'](_[_0x7bb0('0x3c')](_0x305fc9[_0x7bb0('0x31')],_0x690130[_0x7bb0('0x3d')]));if(_0x305fc9['query'][_0x7bb0('0x3e')]){_0x2d9a7f[_0x7bb0('0x3b')]=_[_0x7bb0('0x3f')](_0x2d9a7f[_0x7bb0('0x3b')],{'$or':_[_0x7bb0('0x2d')](_0x2d9a7f[_0x7bb0('0x35')],function(_0xe22a10){var _0x3249b1={};_0x3249b1[_0xe22a10]={'$like':'%'+_0x305fc9[_0x7bb0('0x31')][_0x7bb0('0x3e')]+'%'};return _0x3249b1;})});}_0x2d9a7f=_[_0x7bb0('0x3f')]({},_0x2d9a7f,_0x305fc9[_0x7bb0('0x41')]);return _0x1019b8['getApplications'](_0x2d9a7f);}})['then'](function(_0x185253){if(_0x185253){_0x246593=_0x185253[_0x7bb0('0x5c')];if(!_0x305fc9['query'][_0x7bb0('0x37')](_0x7bb0('0x38'))){_0x2d9a7f[_0x7bb0('0x24')]=qs[_0x7bb0('0x24')](_0x305fc9[_0x7bb0('0x31')][_0x7bb0('0x24')]);_0x2d9a7f['offset']=qs['offset'](_0x305fc9[_0x7bb0('0x31')][_0x7bb0('0x21')]);}return _0x1019b8[_0x7bb0('0x110')](_0x2d9a7f);}})[_0x7bb0('0x13')](function(_0x196ac2){if(_0x196ac2){return _0x196ac2?{'count':_0x246593,'rows':_0x196ac2}:null;}})[_0x7bb0('0x13')](respondWithResult(_0x1ec35a,null))['catch'](handleError(_0x1ec35a,null));};exports[_0x7bb0('0x111')]=function(_0x360d99,_0x24c849){return db[_0x7bb0('0x112')][_0x7bb0('0x50')]({'where':{'id':_0x360d99[_0x7bb0('0x51')]['id']}})['then'](handleEntityNotFound(_0x24c849,null))['then'](function(_0x48a3de){if(_0x48a3de){return _0x48a3de['addProactiveActions'](_0x360d99[_0x7bb0('0x49')][_0x7bb0('0x58')],_['omit'](_0x360d99[_0x7bb0('0x49')],[_0x7bb0('0x58'),'id'])||{});}})['then'](respondWithResult(_0x24c849,null))[_0x7bb0('0x1d')](handleError(_0x24c849,null));};exports[_0x7bb0('0xf7')]=function(_0x56296a,_0x3f1ff6){var _0x569386={};var _0x2b09aa={};var _0x3e87c9;var _0x27f656;return db[_0x7bb0('0x2e')][_0x7bb0('0xce')]({'where':{'id':_0x56296a[_0x7bb0('0x51')]['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x3f1ff6,null))[_0x7bb0('0x13')](function(_0x2b2a5d){if(_0x2b2a5d){_0x3e87c9=_0x2b2a5d;_0x2b09aa[_0x7bb0('0x34')]=_[_0x7bb0('0x32')](db[_0x7bb0('0x113')][_0x7bb0('0x2f')]);_0x2b09aa[_0x7bb0('0x31')]=_[_0x7bb0('0x32')](_0x56296a['query']);_0x2b09aa['filters']=_[_0x7bb0('0x33')](_0x2b09aa['model'],_0x2b09aa[_0x7bb0('0x31')]);_0x569386['attributes']=_[_0x7bb0('0x33')](_0x2b09aa['model'],qs[_0x7bb0('0x36')](_0x56296a['query'][_0x7bb0('0x36')]));_0x569386[_0x7bb0('0x35')]=_0x569386[_0x7bb0('0x35')]['length']?_0x569386[_0x7bb0('0x35')]:_0x2b09aa['model'];_0x569386[_0x7bb0('0x39')]=qs[_0x7bb0('0x3a')](_0x56296a[_0x7bb0('0x31')][_0x7bb0('0x3a')]);_0x569386[_0x7bb0('0x3b')]=qs[_0x7bb0('0x3d')](_[_0x7bb0('0x3c')](_0x56296a['query'],_0x2b09aa[_0x7bb0('0x3d')]));if(_0x56296a[_0x7bb0('0x31')][_0x7bb0('0x3e')]){_0x569386[_0x7bb0('0x3b')]=_['merge'](_0x569386[_0x7bb0('0x3b')],{'$or':_[_0x7bb0('0x2d')](_0x569386[_0x7bb0('0x35')],function(_0x319a83){var _0x2cddbb={};_0x2cddbb[_0x319a83]={'$like':'%'+_0x56296a['query'][_0x7bb0('0x3e')]+'%'};return _0x2cddbb;})});}_0x569386=_['merge']({},_0x569386,_0x56296a[_0x7bb0('0x41')]);return _0x3e87c9['getProactiveActions'](_0x569386);}})[_0x7bb0('0x13')](function(_0x3a6ab2){if(_0x3a6ab2){_0x27f656=_0x3a6ab2[_0x7bb0('0x5c')];if(!_0x56296a[_0x7bb0('0x31')]['hasOwnProperty'](_0x7bb0('0x38'))){_0x569386[_0x7bb0('0x24')]=qs[_0x7bb0('0x24')](_0x56296a[_0x7bb0('0x31')][_0x7bb0('0x24')]);_0x569386['offset']=qs[_0x7bb0('0x21')](_0x56296a[_0x7bb0('0x31')][_0x7bb0('0x21')]);}return _0x3e87c9[_0x7bb0('0xf7')](_0x569386);}})[_0x7bb0('0x13')](function(_0x170c42){if(_0x170c42){return _0x170c42?{'count':_0x27f656,'rows':_0x170c42}:null;}})[_0x7bb0('0x13')](respondWithResult(_0x3f1ff6,null))['catch'](handleError(_0x3f1ff6,null));};exports[_0x7bb0('0x114')]=function(_0x595683,_0x1e517e){var _0x42487f=_0x595683[_0x7bb0('0x31')][_0x7bb0('0x115')]===_0x7bb0('0x116')?_0x7bb0('0x117'):'onlineForm';return db[_0x7bb0('0x2e')][_0x7bb0('0x50')]({'attributes':['id',_0x42487f],'where':{'id':_0x595683['params']['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x1e517e,null))[_0x7bb0('0x13')](function(_0x50af30){if(_0x50af30){var _0x22b72d=_0x50af30[_0x42487f];var _0x5179fc=_0x22b72d&&_0x22b72d[_0x7bb0('0x118')]?_0x22b72d[_0x7bb0('0x118')]:[];_0x1e517e[_0x7bb0('0xb8')]({'fromKey':_[_0x7bb0('0x6a')](_0x22b72d[_0x7bb0('0x119')])?undefined:_0x22b72d[_0x7bb0('0x119')],'count':_0x5179fc['length'],'rows':_0x5179fc});}})[_0x7bb0('0x1d')](handleError(_0x1e517e,null));};exports[_0x7bb0('0x11a')]=function(_0x1b2e49,_0xe2aa0b){var _0x311231={'raw':![],'where':{}};var _0x5bc353={};var _0x42194e={'count':0x0,'rows':[]};return db[_0x7bb0('0x2e')][_0x7bb0('0xce')]({'where':{'id':_0x1b2e49['params']['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0xe2aa0b,null))[_0x7bb0('0x13')](function(_0x5d85de){if(_0x5d85de){_0x5bc353['model']=_[_0x7bb0('0x32')](db[_0x7bb0('0xc4')][_0x7bb0('0x2f')]);_0x5bc353['query']=_[_0x7bb0('0x32')](_0x1b2e49[_0x7bb0('0x31')]);_0x5bc353[_0x7bb0('0x3d')]=_[_0x7bb0('0x33')](_0x5bc353[_0x7bb0('0x34')],_0x5bc353['query']);_0x311231['attributes']=_['intersection'](_0x5bc353['model'],qs['fields'](_0x1b2e49[_0x7bb0('0x31')][_0x7bb0('0x36')]));_0x311231['attributes']=_0x311231[_0x7bb0('0x35')]['length']?_0x311231[_0x7bb0('0x35')]:_0x5bc353[_0x7bb0('0x34')];if(!_0x1b2e49[_0x7bb0('0x31')][_0x7bb0('0x37')]('nolimit')){_0x311231[_0x7bb0('0x24')]=qs[_0x7bb0('0x24')](_0x1b2e49[_0x7bb0('0x31')][_0x7bb0('0x24')]);_0x311231['offset']=qs[_0x7bb0('0x21')](_0x1b2e49['query'][_0x7bb0('0x21')]);}_0x311231[_0x7bb0('0x39')]=qs[_0x7bb0('0x3a')](_0x1b2e49['query'][_0x7bb0('0x3a')]);_0x311231[_0x7bb0('0x3b')]=qs[_0x7bb0('0x3d')](_[_0x7bb0('0x3c')](_0x1b2e49[_0x7bb0('0x31')],_0x5bc353['filters']));_0x311231[_0x7bb0('0x3b')][_0x7bb0('0x54')]=_0x5d85de['id'];if(_0x1b2e49[_0x7bb0('0x31')]['filter']){_0x311231[_0x7bb0('0x3b')]=_['merge'](_0x311231[_0x7bb0('0x3b')],{'$or':_['map'](_0x311231[_0x7bb0('0x35')],function(_0x2fa701){var _0x3896eb={};_0x3896eb[_0x2fa701]={'$like':'%'+_0x1b2e49[_0x7bb0('0x31')][_0x7bb0('0x3e')]+'%'};return _0x3896eb;})});}_0x311231=_[_0x7bb0('0x3f')]({},_0x311231,_0x1b2e49[_0x7bb0('0x41')]);return db[_0x7bb0('0xc4')][_0x7bb0('0x23')]({'where':_0x311231[_0x7bb0('0x3b')]})[_0x7bb0('0x13')](function(_0x4ff4ff){_0x42194e['count']=_0x4ff4ff;if(_0x1b2e49[_0x7bb0('0x31')][_0x7bb0('0x42')]){_0x311231[_0x7bb0('0x43')]=[{'all':!![]}];}else{_0x311231[_0x7bb0('0x43')]=[{'model':db['CmContact'],'as':_0x7bb0('0xe4'),'required':![]},{'model':db[_0x7bb0('0xcc')],'as':_0x7bb0('0x11b'),'required':![]}];}return db[_0x7bb0('0xc4')]['findAll'](_0x311231);})[_0x7bb0('0x13')](function(_0x4b7e6d){_0x42194e[_0x7bb0('0x45')]=_0x4b7e6d;return _0x42194e;});}})[_0x7bb0('0x13')](respondWithFilteredResult(_0xe2aa0b,_0x311231))[_0x7bb0('0x1d')](handleError(_0xe2aa0b,null));};exports['addAgents']=function(_0x2fdc93,_0x182a83){return db[_0x7bb0('0x2e')]['find']({'where':{'id':_0x2fdc93[_0x7bb0('0x51')]['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x182a83,null))['then'](function(_0x36921d){if(_0x36921d){return _0x36921d[_0x7bb0('0x11c')](_0x2fdc93[_0x7bb0('0x49')][_0x7bb0('0x58')],_[_0x7bb0('0xe3')](_0x2fdc93[_0x7bb0('0x49')],[_0x7bb0('0x58'),'id'])||{})[_0x7bb0('0xa6')](function(_0x4f25f6){for(var _0x357729=0x0;_0x357729<_0x2fdc93[_0x7bb0('0x49')]['ids']['length'];_0x357729+=0x1){socket[_0x7bb0('0x11d')](_0x7bb0('0x11e'),{'UserId':Number(_0x2fdc93[_0x7bb0('0x49')]['ids'][_0x357729]),'ChatWebsiteId':Number(_0x2fdc93['params']['id'])});}return _0x4f25f6;});}})[_0x7bb0('0x13')](respondWithResult(_0x182a83,null))['catch'](handleError(_0x182a83,null));};exports[_0x7bb0('0x11f')]=function(_0x3f3e6d,_0x12e909){return db[_0x7bb0('0x2e')][_0x7bb0('0x50')]({'where':{'id':_0x3f3e6d[_0x7bb0('0x51')]['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x12e909,null))[_0x7bb0('0x13')](function(_0x5a64a3){if(_0x5a64a3){return _0x5a64a3[_0x7bb0('0x11f')](_0x3f3e6d[_0x7bb0('0x31')][_0x7bb0('0x58')])[_0x7bb0('0x13')](function(){if(_[_0x7bb0('0x120')](_0x3f3e6d[_0x7bb0('0x31')]['ids'])){for(var _0x44ea77=0x0;_0x44ea77<_0x3f3e6d['query'][_0x7bb0('0x58')][_0x7bb0('0x5c')];_0x44ea77+=0x1){socket[_0x7bb0('0x11d')](_0x7bb0('0x121'),{'UserId':Number(_0x3f3e6d['query'][_0x7bb0('0x58')][_0x44ea77]),'ChatWebsiteId':Number(_0x3f3e6d['params']['id'])});}}else{socket['emit'](_0x7bb0('0x121'),{'UserId':Number(_0x3f3e6d[_0x7bb0('0x31')][_0x7bb0('0x58')]),'ChatWebsiteId':Number(_0x3f3e6d[_0x7bb0('0x51')]['id'])});}});}})[_0x7bb0('0x13')](respondWithStatusCode(_0x12e909,null))['catch'](handleError(_0x12e909,null));};exports[_0x7bb0('0x122')]=function(_0x25addd,_0x30ccdd){var _0x3bd824={};var _0x23cd6c={};var _0x4c2278;var _0x57eaa5;return db['ChatWebsite'][_0x7bb0('0xce')]({'where':{'id':_0x25addd['params']['id']}})['then'](handleEntityNotFound(_0x30ccdd,null))['then'](function(_0x47201d){if(_0x47201d){_0x4c2278=_0x47201d;_0x23cd6c['model']=_[_0x7bb0('0x32')](db[_0x7bb0('0xb0')][_0x7bb0('0x2f')]);_0x23cd6c[_0x7bb0('0x31')]=_[_0x7bb0('0x32')](_0x25addd[_0x7bb0('0x31')]);_0x23cd6c[_0x7bb0('0x3d')]=_[_0x7bb0('0x33')](_0x23cd6c[_0x7bb0('0x34')],_0x23cd6c['query']);_0x3bd824[_0x7bb0('0x35')]=_[_0x7bb0('0x33')](_0x23cd6c['model'],qs[_0x7bb0('0x36')](_0x25addd['query'][_0x7bb0('0x36')]));_0x3bd824[_0x7bb0('0x35')]=_0x3bd824[_0x7bb0('0x35')][_0x7bb0('0x5c')]?_0x3bd824[_0x7bb0('0x35')]:_0x23cd6c[_0x7bb0('0x34')];_0x3bd824[_0x7bb0('0x39')]=qs[_0x7bb0('0x3a')](_0x25addd[_0x7bb0('0x31')][_0x7bb0('0x3a')]);_0x3bd824['where']=qs[_0x7bb0('0x3d')](_[_0x7bb0('0x3c')](_0x25addd['query'],_0x23cd6c[_0x7bb0('0x3d')]));if(_0x25addd[_0x7bb0('0x31')][_0x7bb0('0x3e')]){_0x3bd824[_0x7bb0('0x3b')]=_[_0x7bb0('0x3f')](_0x3bd824['where'],{'$or':_[_0x7bb0('0x2d')](_0x3bd824[_0x7bb0('0x35')],function(_0x58f9b7){var _0x31b4b2={};_0x31b4b2[_0x58f9b7]={'$like':'%'+_0x25addd[_0x7bb0('0x31')][_0x7bb0('0x3e')]+'%'};return _0x31b4b2;})});}_0x3bd824=_['merge']({},_0x3bd824,_0x25addd[_0x7bb0('0x41')]);return _0x4c2278[_0x7bb0('0x122')](_0x3bd824);}})[_0x7bb0('0x13')](function(_0x1a0914){if(_0x1a0914){_0x57eaa5=_0x1a0914[_0x7bb0('0x5c')];if(!_0x25addd[_0x7bb0('0x31')][_0x7bb0('0x37')](_0x7bb0('0x38'))){_0x3bd824[_0x7bb0('0x24')]=qs[_0x7bb0('0x24')](_0x25addd[_0x7bb0('0x31')][_0x7bb0('0x24')]);_0x3bd824[_0x7bb0('0x21')]=qs[_0x7bb0('0x21')](_0x25addd[_0x7bb0('0x31')]['offset']);}return _0x4c2278[_0x7bb0('0x122')](_0x3bd824);}})['then'](function(_0x3cac98){if(_0x3cac98){return _0x3cac98?{'count':_0x57eaa5,'rows':_0x3cac98}:null;}})[_0x7bb0('0x13')](respondWithResult(_0x30ccdd,null))[_0x7bb0('0x1d')](handleError(_0x30ccdd,null));};
\ No newline at end of file
index 60a4d27..a9435c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x689c=['remove','emit','hasOwnProperty','hook','exports','ChatWebsite','setMaxListeners','save','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x689c,0x9e));var _0xc689=function(_0x10e18c,_0x103636){_0x10e18c=_0x10e18c-0x0;var _0x52ca75=_0x689c[_0x10e18c];return _0x52ca75;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0xc689('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xc689('0x1')](0x0);var events={'afterCreate':_0xc689('0x2'),'afterUpdate':_0xc689('0x3'),'afterDestroy':_0xc689('0x4')};function emitEvent(_0x28d0cd){return function(_0x4b863b,_0x3d106f,_0x5ce767){ChatWebsiteEvents['emit'](_0x28d0cd+':'+_0x4b863b['id'],_0x4b863b);ChatWebsiteEvents[_0xc689('0x5')](_0x28d0cd,_0x4b863b);_0x5ce767(null);};}for(var e in events){if(events[_0xc689('0x6')](e)){var event=events[e];ChatWebsite[_0xc689('0x7')](e,emitEvent(event));}}module[_0xc689('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x4f5d=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save'];(function(_0x47943a,_0x39fcbc){var _0x3604c4=function(_0x5ea451){while(--_0x5ea451){_0x47943a['push'](_0x47943a['shift']());}};_0x3604c4(++_0x39fcbc);}(_0x4f5d,0x1d1));var _0xd4f5=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x4f5d[_0x422905];return _0x33dc6c;};'use strict';var EventEmitter=require(_0xd4f5('0x0'));var ChatWebsite=require(_0xd4f5('0x1'))['db'][_0xd4f5('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xd4f5('0x3')](0x0);var events={'afterCreate':_0xd4f5('0x4'),'afterUpdate':_0xd4f5('0x5'),'afterDestroy':'remove'};function emitEvent(_0x45f512){return function(_0x468609,_0xf61335,_0x3956d8){ChatWebsiteEvents[_0xd4f5('0x6')](_0x45f512+':'+_0x468609['id'],_0x468609);ChatWebsiteEvents[_0xd4f5('0x6')](_0x45f512,_0x468609);_0x3956d8(null);};}for(var e in events){if(events[_0xd4f5('0x7')](e)){var event=events[e];ChatWebsite[_0xd4f5('0x8')](e,emitEvent(event));}}module[_0xd4f5('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
index 23b60f6..28ee51c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb598=['./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x293256,_0x52f08b){var _0x5f3d32=function(_0x4bcca4){while(--_0x4bcca4){_0x293256['push'](_0x293256['shift']());}};_0x5f3d32(++_0x52f08b);}(_0xb598,0x7a));var _0x8b59=function(_0x213bc2,_0xfa9447){_0x213bc2=_0x213bc2-0x0;var _0x12a74f=_0xb598[_0x213bc2];return _0x12a74f;};'use strict';var _=require(_0x8b59('0x0'));var util=require('util');var logger=require(_0x8b59('0x1'))(_0x8b59('0x2'));var moment=require(_0x8b59('0x3'));var BPromise=require(_0x8b59('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8b59('0x5'));var rimraf=require(_0x8b59('0x6'));var config=require(_0x8b59('0x7'));var attributes=require(_0x8b59('0x8'));module[_0x8b59('0x9')]=function(_0x496aab,_0xf3b887){return _0x496aab[_0x8b59('0xa')](_0x8b59('0xb'),attributes,{'tableName':_0x8b59('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6cd1=['define','ChatWebsite','chat_websites','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x5b0ee5,_0x437c51){var _0x441fea=function(_0x4c3f9){while(--_0x4c3f9){_0x5b0ee5['push'](_0x5b0ee5['shift']());}};_0x441fea(++_0x437c51);}(_0x6cd1,0x121));var _0x16cd=function(_0x4f57e4,_0x18914d){_0x4f57e4=_0x4f57e4-0x0;var _0x4a584c=_0x6cd1[_0x4f57e4];return _0x4a584c;};'use strict';var _=require(_0x16cd('0x0'));var util=require('util');var logger=require(_0x16cd('0x1'))(_0x16cd('0x2'));var moment=require(_0x16cd('0x3'));var BPromise=require(_0x16cd('0x4'));var rp=require(_0x16cd('0x5'));var fs=require('fs');var path=require(_0x16cd('0x6'));var rimraf=require('rimraf');var config=require(_0x16cd('0x7'));var attributes=require(_0x16cd('0x8'));module[_0x16cd('0x9')]=function(_0x39d84e,_0x32912b){return _0x39d84e[_0x16cd('0xa')](_0x16cd('0xb'),attributes,{'tableName':_0x16cd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 447e1e3..416b94a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd59d=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','result','catch'];(function(_0x3c59fc,_0x10dbd2){var _0x2b78d4=function(_0x5f161a){while(--_0x5f161a){_0x3c59fc['push'](_0x3c59fc['shift']());}};_0x2b78d4(++_0x10dbd2);}(_0xd59d,0x1c2));var _0xdd59=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xd59d[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0xdd59('0x0'));var util=require(_0xdd59('0x1'));var moment=require(_0xdd59('0x2'));var BPromise=require(_0xdd59('0x3'));var rs=require(_0xdd59('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdd59('0x5'))['db'];var utils=require(_0xdd59('0x6'));var logger=require('../../config/logger')(_0xdd59('0x7'));var config=require(_0xdd59('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xdd59('0x9')]=_['defaults'](config['redis'],{'host':_0xdd59('0xa'),'port':0x18eb});var socket=require(_0xdd59('0xb'))(new Redis(config[_0xdd59('0x9')]));require(_0xdd59('0xc'))[_0xdd59('0xd')](socket);function respondWithRpcPromise(_0x28b8f2,_0x1b0cdc,_0x24fd20){return new BPromise(function(_0xd1da78,_0x2f2608){return client[_0xdd59('0xe')](_0x28b8f2,_0x24fd20)[_0xdd59('0xf')](function(_0xae6d83){logger[_0xdd59('0x10')](_0xdd59('0x11'),_0x1b0cdc,_0xdd59('0x12'));logger[_0xdd59('0x13')](_0xdd59('0x14'),_0x1b0cdc,_0xdd59('0x12'),JSON['stringify'](_0xae6d83));if(_0xae6d83[_0xdd59('0x15')]){if(_0xae6d83[_0xdd59('0x15')]['code']===0x1f4){logger[_0xdd59('0x15')](_0xdd59('0x11'),_0x1b0cdc,_0xae6d83['error'][_0xdd59('0x16')]);return _0x2f2608(_0xae6d83['error'][_0xdd59('0x16')]);}logger[_0xdd59('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x1b0cdc,_0xae6d83[_0xdd59('0x15')][_0xdd59('0x16')]);return _0xd1da78(_0xae6d83[_0xdd59('0x15')][_0xdd59('0x16')]);}else{logger[_0xdd59('0x10')](_0xdd59('0x11'),_0x1b0cdc,_0xdd59('0x12'));_0xd1da78(_0xae6d83[_0xdd59('0x17')][_0xdd59('0x16')]);}})[_0xdd59('0x18')](function(_0x4d416b){logger[_0xdd59('0x15')](_0xdd59('0x11'),_0x1b0cdc,_0x4d416b);_0x2f2608(_0x4d416b);});});}
\ No newline at end of file
+var _0x704a=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x2d63f1,_0x418717){var _0x31f145=function(_0x4065de){while(--_0x4065de){_0x2d63f1['push'](_0x2d63f1['shift']());}};_0x31f145(++_0x418717);}(_0x704a,0x179));var _0xa704=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x704a[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0xa704('0x0'));var util=require('util');var moment=require(_0xa704('0x1'));var BPromise=require(_0xa704('0x2'));var rs=require(_0xa704('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa704('0x4'))['db'];var utils=require(_0xa704('0x5'));var logger=require(_0xa704('0x6'))(_0xa704('0x7'));var config=require(_0xa704('0x8'));var jayson=require(_0xa704('0x9'));var client=jayson[_0xa704('0xa')]['http']({'port':0x232a});config[_0xa704('0xb')]=_[_0xa704('0xc')](config[_0xa704('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xa704('0xd'))(new Redis(config[_0xa704('0xb')]));require(_0xa704('0xe'))[_0xa704('0xf')](socket);function respondWithRpcPromise(_0x7c91b8,_0x375470,_0x2d4e52){return new BPromise(function(_0x1dff23,_0x34daf0){return client[_0xa704('0x10')](_0x7c91b8,_0x2d4e52)[_0xa704('0x11')](function(_0x456e11){logger[_0xa704('0x12')](_0xa704('0x13'),_0x375470,_0xa704('0x14'));logger['debug'](_0xa704('0x15'),_0x375470,_0xa704('0x14'),JSON[_0xa704('0x16')](_0x456e11));if(_0x456e11[_0xa704('0x17')]){if(_0x456e11[_0xa704('0x17')]['code']===0x1f4){logger[_0xa704('0x17')](_0xa704('0x13'),_0x375470,_0x456e11['error']['message']);return _0x34daf0(_0x456e11[_0xa704('0x17')][_0xa704('0x18')]);}logger['error'](_0xa704('0x13'),_0x375470,_0x456e11[_0xa704('0x17')][_0xa704('0x18')]);return _0x1dff23(_0x456e11[_0xa704('0x17')]['message']);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x375470,_0xa704('0x14'));_0x1dff23(_0x456e11[_0xa704('0x19')]['message']);}})[_0xa704('0x1a')](function(_0x17596e){logger[_0xa704('0x17')](_0xa704('0x13'),_0x375470,_0x17596e);_0x34daf0(_0x17596e);});});}
\ No newline at end of file
index 552dada..3b4b392 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde17=['chatWebsite:','./chatWebsite.events','save','remove','emit','removeListener'];(function(_0xd37620,_0x5cbc85){var _0xc56870=function(_0x4e5904){while(--_0x4e5904){_0xd37620['push'](_0xd37620['shift']());}};_0xc56870(++_0x5cbc85);}(_0xde17,0x7f));var _0x7de1=function(_0x8237a1,_0x3599d0){_0x8237a1=_0x8237a1-0x0;var _0x3e933a=_0xde17[_0x8237a1];return _0x3e933a;};'use strict';var ChatWebsiteEvents=require(_0x7de1('0x0'));var events=[_0x7de1('0x1'),_0x7de1('0x2'),'update'];function createListener(_0x53401e,_0x1185a1){return function(_0x56bcec){_0x1185a1[_0x7de1('0x3')](_0x53401e,_0x56bcec);};}function removeListener(_0x3ffb68,_0x46656e){return function(){ChatWebsiteEvents[_0x7de1('0x4')](_0x3ffb68,_0x46656e);};}exports['register']=function(_0x224cc5){for(var _0x57e591=0x0,_0x234799=events['length'];_0x57e591<_0x234799;_0x57e591++){var _0x4f8d13=events[_0x57e591];var _0x3bfb3a=createListener(_0x7de1('0x5')+_0x4f8d13,_0x224cc5);ChatWebsiteEvents['on'](_0x4f8d13,_0x3bfb3a);}};
\ No newline at end of file
+var _0x78b2=['register','length','chatWebsite:','./chatWebsite.events','save','remove','update','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x78b2,0x1f2));var _0x278b=function(_0x21c5d9,_0x3ba88c){_0x21c5d9=_0x21c5d9-0x0;var _0xc2c168=_0x78b2[_0x21c5d9];return _0xc2c168;};'use strict';var ChatWebsiteEvents=require(_0x278b('0x0'));var events=[_0x278b('0x1'),_0x278b('0x2'),_0x278b('0x3')];function createListener(_0x1f784f,_0xec0ae8){return function(_0x1ccba7){_0xec0ae8[_0x278b('0x4')](_0x1f784f,_0x1ccba7);};}function removeListener(_0x57d6ac,_0x2a50b1){return function(){ChatWebsiteEvents[_0x278b('0x5')](_0x57d6ac,_0x2a50b1);};}exports[_0x278b('0x6')]=function(_0x5b0a5e){for(var _0x5ea08c=0x0,_0x1ac347=events[_0x278b('0x7')];_0x5ea08c<_0x1ac347;_0x5ea08c++){var _0x4156de=events[_0x5ea08c];var _0x155e68=createListener(_0x278b('0x8')+_0x4156de,_0x5b0a5e);ChatWebsiteEvents['on'](_0x4156de,_0x155e68);}};
\ No newline at end of file
index 1174524..daef47b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5779=['server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','/:id/interactions','addInteraction','addApplications','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','post','create','addDisposition','addAnswer','diskStorage','join','root','format','%s-%s','now','originalname','single','addLogo','server/files/images/avatars/','addAvatar','/:id/system_avatar','file','addSystemAvatar','/:id/notify','notify'];(function(_0x7a6c3f,_0x287200){var _0x4bae05=function(_0x4b35ad){while(--_0x4b35ad){_0x7a6c3f['push'](_0x7a6c3f['shift']());}};_0x4bae05(++_0x287200);}(_0x5779,0x1d6));var _0x9577=function(_0x12c0b3,_0x44ed4d){_0x12c0b3=_0x12c0b3-0x0;var _0x3dae4f=_0x5779[_0x12c0b3];return _0x3dae4f;};'use strict';var multer=require(_0x9577('0x0'));var util=require(_0x9577('0x1'));var path=require(_0x9577('0x2'));var timeout=require(_0x9577('0x3'));var express=require(_0x9577('0x4'));var router=express[_0x9577('0x5')]();var fs_extra=require(_0x9577('0x6'));var auth=require(_0x9577('0x7'));var interaction=require(_0x9577('0x8'));var config=require(_0x9577('0x9'));var controller=require(_0x9577('0xa'));router[_0x9577('0xb')]('/',auth[_0x9577('0xc')](),controller[_0x9577('0xd')]);router[_0x9577('0xb')](_0x9577('0xe'),auth[_0x9577('0xc')](),controller[_0x9577('0xf')]);router[_0x9577('0xb')](_0x9577('0x10'),auth[_0x9577('0xc')](),controller['show']);router['get'](_0x9577('0x11'),auth[_0x9577('0xc')](),controller['getDispositions']);router['get'](_0x9577('0x12'),auth[_0x9577('0xc')](),controller[_0x9577('0x13')]);router['get']('/:id/logo',controller[_0x9577('0x14')]);router[_0x9577('0xb')](_0x9577('0x15'),controller[_0x9577('0x16')]);router[_0x9577('0xb')](_0x9577('0x17'),controller[_0x9577('0x18')]);router[_0x9577('0xb')]('/:id/system_avatar',controller['getSystemAvatar']);router['get']('/:id/interactions',auth[_0x9577('0xc')](),controller[_0x9577('0x19')]);router[_0x9577('0xb')](_0x9577('0x1a'),controller['getSnippet']);router[_0x9577('0xb')](_0x9577('0x1b'),auth['isAuthenticated'](),controller[_0x9577('0x1c')]);router[_0x9577('0xb')](_0x9577('0x1d'),auth['isAuthenticated'](),controller[_0x9577('0x1e')]);router[_0x9577('0xb')](_0x9577('0x1f'),controller[_0x9577('0x20')]);router[_0x9577('0xb')](_0x9577('0x21'),auth[_0x9577('0xc')](),controller['getOfflineMessages']);router[_0x9577('0xb')](_0x9577('0x22'),auth[_0x9577('0xc')](),controller['getAgents']);router[_0x9577('0x23')]('/',auth[_0x9577('0xc')](),controller[_0x9577('0x24')]);router['post'](_0x9577('0x11'),auth['isAuthenticated'](),controller[_0x9577('0x25')]);router[_0x9577('0x23')](_0x9577('0x12'),auth[_0x9577('0xc')](),controller[_0x9577('0x26')]);var upload=multer({'storage':multer[_0x9577('0x27')]({'destination':function(_0x3e2036,_0x327163,_0x5756c6){_0x5756c6(null,path[_0x9577('0x28')](config[_0x9577('0x29')],'server/files/images/logos/'));},'filename':function(_0x2347f5,_0x2aaa04,_0x579977){_0x579977(null,util[_0x9577('0x2a')](_0x9577('0x2b'),Date[_0x9577('0x2c')](),_0x2aaa04[_0x9577('0x2d')]));}})});router[_0x9577('0x23')]('/:id/logo',upload[_0x9577('0x2e')]('file'),controller[_0x9577('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x192dc0,_0x5b156b,_0x551043){_0x551043(null,path['join'](config[_0x9577('0x29')],_0x9577('0x30')));},'filename':function(_0x286a0e,_0x495ac4,_0x5754a3){_0x5754a3(null,util[_0x9577('0x2a')](_0x9577('0x2b'),Date[_0x9577('0x2c')](),_0x495ac4['originalname']));}})});router[_0x9577('0x23')](_0x9577('0x15'),upload[_0x9577('0x2e')]('file'),controller[_0x9577('0x31')]);var upload=multer({'storage':multer[_0x9577('0x27')]({'destination':function(_0x55f12d,_0x409689,_0x1b8b25){_0x1b8b25(null,path['join'](config[_0x9577('0x29')],_0x9577('0x30')));},'filename':function(_0x7097b6,_0x5cfdba,_0x4d32d1){_0x4d32d1(null,util[_0x9577('0x2a')](_0x9577('0x2b'),Date['now'](),_0x5cfdba[_0x9577('0x2d')]));}})});router[_0x9577('0x23')](_0x9577('0x17'),upload[_0x9577('0x2e')]('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x55641d,_0xfee9ec,_0x134afa){_0x134afa(null,path[_0x9577('0x28')](config[_0x9577('0x29')],_0x9577('0x30')));},'filename':function(_0x2ee6e3,_0x5b1cfa,_0x36dabf){_0x36dabf(null,util[_0x9577('0x2a')](_0x9577('0x2b'),Date[_0x9577('0x2c')](),_0x5b1cfa[_0x9577('0x2d')]));}})});router[_0x9577('0x23')](_0x9577('0x32'),upload[_0x9577('0x2e')](_0x9577('0x33')),controller[_0x9577('0x34')]);router[_0x9577('0x23')](_0x9577('0x35'),controller[_0x9577('0x36')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x5ed47a,_0x2e72c9,_0x5e80ed){const _0x4121c3=path['join'](config[_0x9577('0x29')],_0x9577('0x37'),_0x9577('0x38'),_0x9577('0x39'));fs_extra[_0x9577('0x3a')](_0x4121c3,function(){_0x5e80ed(null,_0x4121c3);});},'filename':function(_0x18b83d,_0x5ba5ae,_0x4bb376){const _0x3bee68=_0x5ba5ae[_0x9577('0x2d')][_0x9577('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x308fff=path[_0x9577('0x3c')](_0x3bee68);const _0x5f08c2=Date[_0x9577('0x2c')]()+'-'+_0x3bee68['replace'](_0x308fff,'')+_0x308fff;_0x4bb376(null,_0x5f08c2);}})});router['post'](_0x9577('0x3d'),offlineUploadMulter[_0x9577('0x3e')](),controller[_0x9577('0x3f')]);router[_0x9577('0x23')](_0x9577('0x40'),auth['isAuthenticated'](),controller[_0x9577('0x41')]);router[_0x9577('0x23')](_0x9577('0x1b'),auth['isAuthenticated'](),controller[_0x9577('0x42')]);router[_0x9577('0x23')](_0x9577('0x1d'),auth[_0x9577('0xc')](),controller['addProactiveActions']);router[_0x9577('0x23')](_0x9577('0x22'),auth[_0x9577('0xc')](),controller[_0x9577('0x43')]);router[_0x9577('0x44')](_0x9577('0x10'),auth[_0x9577('0xc')](),controller[_0x9577('0x45')]);router['delete'](_0x9577('0x10'),auth[_0x9577('0xc')](),controller['destroy']);router[_0x9577('0x46')](_0x9577('0x11'),auth['isAuthenticated'](),controller[_0x9577('0x47')]);router[_0x9577('0x46')](_0x9577('0x12'),auth[_0x9577('0xc')](),controller[_0x9577('0x48')]);router[_0x9577('0x46')](_0x9577('0x22'),auth['isAuthenticated'](),controller[_0x9577('0x49')]);module[_0x9577('0x4a')]=router;
\ No newline at end of file
+var _0x33d9=['file','format','addAvatar','join','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','server/files','offline-chat','ensureDir','replace','extname','any','offline','addInteraction','addProactiveActions','addAgents','put','update','delete','destroy','/:id/users','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatWebsite.controller','get','/describe','describe','/:id','isAuthenticated','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','addAnswer','diskStorage','root','%s-%s','now','originalname','single'];(function(_0x594cb4,_0x14151a){var _0x31688a=function(_0x5ccee6){while(--_0x5ccee6){_0x594cb4['push'](_0x594cb4['shift']());}};_0x31688a(++_0x14151a);}(_0x33d9,0x176));var _0x933d=function(_0x335243,_0x3b804c){_0x335243=_0x335243-0x0;var _0x596d14=_0x33d9[_0x335243];return _0x596d14;};'use strict';var multer=require(_0x933d('0x0'));var util=require(_0x933d('0x1'));var path=require(_0x933d('0x2'));var timeout=require(_0x933d('0x3'));var express=require(_0x933d('0x4'));var router=express[_0x933d('0x5')]();var fs_extra=require(_0x933d('0x6'));var auth=require(_0x933d('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x933d('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x933d('0x9')](_0x933d('0xa'),auth['isAuthenticated'](),controller[_0x933d('0xb')]);router[_0x933d('0x9')](_0x933d('0xc'),auth[_0x933d('0xd')](),controller[_0x933d('0xe')]);router[_0x933d('0x9')](_0x933d('0xf'),auth[_0x933d('0xd')](),controller['getDispositions']);router[_0x933d('0x9')](_0x933d('0x10'),auth[_0x933d('0xd')](),controller[_0x933d('0x11')]);router[_0x933d('0x9')](_0x933d('0x12'),controller[_0x933d('0x13')]);router[_0x933d('0x9')](_0x933d('0x14'),controller[_0x933d('0x15')]);router[_0x933d('0x9')](_0x933d('0x16'),controller[_0x933d('0x17')]);router[_0x933d('0x9')](_0x933d('0x18'),controller[_0x933d('0x19')]);router[_0x933d('0x9')](_0x933d('0x1a'),auth[_0x933d('0xd')](),controller[_0x933d('0x1b')]);router[_0x933d('0x9')](_0x933d('0x1c'),controller['getSnippet']);router[_0x933d('0x9')](_0x933d('0x1d'),auth[_0x933d('0xd')](),controller['getApplications']);router[_0x933d('0x9')](_0x933d('0x1e'),auth[_0x933d('0xd')](),controller[_0x933d('0x1f')]);router[_0x933d('0x9')]('/:id/fields',controller[_0x933d('0x20')]);router[_0x933d('0x9')](_0x933d('0x21'),auth['isAuthenticated'](),controller[_0x933d('0x22')]);router[_0x933d('0x9')]('/:id/users',auth[_0x933d('0xd')](),controller[_0x933d('0x23')]);router[_0x933d('0x24')]('/',auth[_0x933d('0xd')](),controller[_0x933d('0x25')]);router['post'](_0x933d('0xf'),auth[_0x933d('0xd')](),controller[_0x933d('0x26')]);router[_0x933d('0x24')]('/:id/canned_answers',auth[_0x933d('0xd')](),controller[_0x933d('0x27')]);var upload=multer({'storage':multer[_0x933d('0x28')]({'destination':function(_0x5b3f8a,_0x1b4d8c,_0x1a195b){_0x1a195b(null,path['join'](config[_0x933d('0x29')],'server/files/images/logos/'));},'filename':function(_0x28f20a,_0x3f7bf7,_0x563d34){_0x563d34(null,util['format'](_0x933d('0x2a'),Date[_0x933d('0x2b')](),_0x3f7bf7[_0x933d('0x2c')]));}})});router[_0x933d('0x24')](_0x933d('0x12'),upload[_0x933d('0x2d')](_0x933d('0x2e')),controller['addLogo']);var upload=multer({'storage':multer[_0x933d('0x28')]({'destination':function(_0x38a61f,_0x542f24,_0x5a2e45){_0x5a2e45(null,path['join'](config[_0x933d('0x29')],'server/files/images/avatars/'));},'filename':function(_0x4d4f27,_0x350a34,_0x4ddc6c){_0x4ddc6c(null,util[_0x933d('0x2f')](_0x933d('0x2a'),Date[_0x933d('0x2b')](),_0x350a34[_0x933d('0x2c')]));}})});router[_0x933d('0x24')](_0x933d('0x14'),upload[_0x933d('0x2d')](_0x933d('0x2e')),controller[_0x933d('0x30')]);var upload=multer({'storage':multer[_0x933d('0x28')]({'destination':function(_0x447865,_0x4ef23a,_0x39d824){_0x39d824(null,path[_0x933d('0x31')](config[_0x933d('0x29')],_0x933d('0x32')));},'filename':function(_0x556770,_0x2e5111,_0x4c5c4b){_0x4c5c4b(null,util['format']('%s-%s',Date['now'](),_0x2e5111[_0x933d('0x2c')]));}})});router[_0x933d('0x24')]('/:id/customer_avatar',upload['single'](_0x933d('0x2e')),controller[_0x933d('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x299b4d,_0x5afd16,_0x18654c){_0x18654c(null,path[_0x933d('0x31')](config[_0x933d('0x29')],_0x933d('0x32')));},'filename':function(_0xdf379f,_0x412c5f,_0x13657d){_0x13657d(null,util['format'](_0x933d('0x2a'),Date['now'](),_0x412c5f[_0x933d('0x2c')]));}})});router['post'](_0x933d('0x18'),upload[_0x933d('0x2d')](_0x933d('0x2e')),controller[_0x933d('0x34')]);router[_0x933d('0x24')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x933d('0x28')]({'destination':function(_0x48f3d5,_0x40201d,_0x35e333){const _0x1ce0ae=path[_0x933d('0x31')](config[_0x933d('0x29')],_0x933d('0x35'),'attachments',_0x933d('0x36'));fs_extra[_0x933d('0x37')](_0x1ce0ae,function(){_0x35e333(null,_0x1ce0ae);});},'filename':function(_0x126eb2,_0x7f903b,_0x265d4c){const _0x481a8a=_0x7f903b['originalname'][_0x933d('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3c056e=path[_0x933d('0x39')](_0x481a8a);const _0x41ed7d=Date[_0x933d('0x2b')]()+'-'+_0x481a8a[_0x933d('0x38')](_0x3c056e,'')+_0x3c056e;_0x265d4c(null,_0x41ed7d);}})});router[_0x933d('0x24')]('/:id/offline',offlineUploadMulter[_0x933d('0x3a')](),controller[_0x933d('0x3b')]);router[_0x933d('0x24')](_0x933d('0x1a'),auth[_0x933d('0xd')](),controller[_0x933d('0x3c')]);router[_0x933d('0x24')](_0x933d('0x1d'),auth[_0x933d('0xd')](),controller['addApplications']);router[_0x933d('0x24')](_0x933d('0x1e'),auth['isAuthenticated'](),controller[_0x933d('0x3d')]);router[_0x933d('0x24')]('/:id/users',auth[_0x933d('0xd')](),controller[_0x933d('0x3e')]);router[_0x933d('0x3f')](_0x933d('0xc'),auth[_0x933d('0xd')](),controller[_0x933d('0x40')]);router[_0x933d('0x41')](_0x933d('0xc'),auth[_0x933d('0xd')](),controller[_0x933d('0x42')]);router[_0x933d('0x41')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth[_0x933d('0xd')](),controller['removeAnswers']);router[_0x933d('0x41')](_0x933d('0x43'),auth['isAuthenticated'](),controller[_0x933d('0x44')]);module[_0x933d('0x45')]=router;
\ No newline at end of file
index f23d14b..eb0b781 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71a1=['app','get','client-side-logger','expressEndpoint','/client-logs','exports','beaver-logger/server','express','../config/environment'];(function(_0x446a6c,_0x2ba430){var _0x3d279e=function(_0x328540){while(--_0x328540){_0x446a6c['push'](_0x446a6c['shift']());}};_0x3d279e(++_0x2ba430);}(_0x71a1,0x1da));var _0x171a=function(_0x58217a,_0x4aa596){_0x58217a=_0x58217a-0x0;var _0x3b12d4=_0x71a1[_0x58217a];return _0x3b12d4;};var beaverLogger=require(_0x171a('0x0'));var express=require(_0x171a('0x1'));var auth=require('../components/auth/service');var config=require(_0x171a('0x2'));var router=express['Router']();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x46c57e,_0x41e548,_0xdf04ba){var _0x215b50=_0x46c57e[_0x171a('0x3')][_0x171a('0x4')](_0x171a('0x5'));if(!_0x215b50){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x171a('0x6')]({'uri':_0x171a('0x7'),'logger':_0x215b50,'enableCors':!isProduction})(_0x46c57e,_0x41e548,_0xdf04ba);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0x171a('0x8')]=router;
\ No newline at end of file
+var _0xc366=['app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','beaver-logger/server','../components/auth/service','../config/environment','Router','production'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc366,0x1a8));var _0x6c36=function(_0x11d337,_0x3ccb4b){_0x11d337=_0x11d337-0x0;var _0x359e28=_0xc366[_0x11d337];return _0x359e28;};var beaverLogger=require(_0x6c36('0x0'));var express=require('express');var auth=require(_0x6c36('0x1'));var config=require(_0x6c36('0x2'));var router=express[_0x6c36('0x3')]();var isProduction=config['env']===_0x6c36('0x4')||![];function clientSideLogs(_0x34eaab,_0x56e18e,_0x309e5f){var _0x2b1cda=_0x34eaab[_0x6c36('0x5')][_0x6c36('0x6')](_0x6c36('0x7'));if(!_0x2b1cda){throw new Error(_0x6c36('0x8'));}return beaverLogger[_0x6c36('0x9')]({'uri':_0x6c36('0xa'),'logger':_0x2b1cda,'enableCors':!isProduction})(_0x34eaab,_0x56e18e,_0x309e5f);}router[_0x6c36('0xb')](auth[_0x6c36('0xc')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
index 2d9dd99..150a62e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c49=['MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','STRING','MicrosoftAzure','ENUM','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x2c49,0x141));var _0x92c4=function(_0x296923,_0x4adaed){_0x296923=_0x296923-0x0;var _0x29af70=_0x2c49[_0x296923];return _0x29af70;};'use strict';var Sequelize=require(_0x92c4('0x0'));module['exports']={'name':{'type':Sequelize[_0x92c4('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS','Google',_0x92c4('0x2')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x92c4('0x3')]('Outlook365',_0x92c4('0x4'))},'data1':{'type':Sequelize[_0x92c4('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x92c4('0x1')],'comment':_0x92c4('0x5')},'data3':{'type':Sequelize[_0x92c4('0x1')],'comment':_0x92c4('0x6')},'data4':{'type':Sequelize[_0x92c4('0x1')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x92c4('0x7')],'comment':_0x92c4('0x8')},'data6':{'type':Sequelize[_0x92c4('0x7')],'comment':_0x92c4('0x9')},'data7':{'type':Sequelize[_0x92c4('0x7')],'comment':_0x92c4('0xa')}};
\ No newline at end of file
+var _0xe6f8=['MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_secret'];(function(_0x38d4ab,_0x40b8a6){var _0x580890=function(_0xc95791){while(--_0xc95791){_0x38d4ab['push'](_0x38d4ab['shift']());}};_0x580890(++_0x40b8a6);}(_0xe6f8,0x75));var _0x8e6f=function(_0xc81e27,_0x283135){_0xc81e27=_0xc81e27-0x0;var _0x32870c=_0xe6f8[_0xc81e27];return _0x32870c;};'use strict';var Sequelize=require(_0x8e6f('0x0'));module[_0x8e6f('0x1')]={'name':{'type':Sequelize[_0x8e6f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x8e6f('0x3')](_0x8e6f('0x4'),_0x8e6f('0x5'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x8e6f('0x6'),_0x8e6f('0x7'))},'data1':{'type':Sequelize[_0x8e6f('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x8e6f('0x2')],'comment':_0x8e6f('0x8')},'data4':{'type':Sequelize[_0x8e6f('0x2')],'comment':_0x8e6f('0x9')},'data5':{'type':Sequelize[_0x8e6f('0xa')],'comment':_0x8e6f('0xb')},'data6':{'type':Sequelize[_0x8e6f('0xa')],'comment':_0x8e6f('0xc')},'data7':{'type':Sequelize['TEXT'],'comment':_0x8e6f('0xd')}};
\ No newline at end of file
index 99b4296..7a8a1f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc096=['error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','findAll','rows','service','MicrosoftAzure','decryptString','data3','includeAll','include','find','create','body','Name\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','catch','params','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','parse','from','base64','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','update','then','destroy'];(function(_0x1eedb8,_0x41a839){var _0x23ce75=function(_0xfdf9c7){while(--_0xfdf9c7){_0x1eedb8['push'](_0x1eedb8['shift']());}};_0x23ce75(++_0x41a839);}(_0xc096,0xac));var _0x6c09=function(_0x4ea444,_0x56dde4){_0x4ea444=_0x4ea444-0x0;var _0x52b1e0=_0xc096[_0x4ea444];return _0x52b1e0;};'use strict';var _=require(_0x6c09('0x0'));var Redis=require(_0x6c09('0x1'));var qs=require(_0x6c09('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0x6c09('0x3'));var logger=require(_0x6c09('0x4'))('api');var db=require(_0x6c09('0x5'))['db'];var oauth=require(_0x6c09('0x6'));config['redis']=_[_0x6c09('0x7')](config[_0x6c09('0x8')],{'host':_0x6c09('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6c09('0x8')]));var redis=new Redis(config[_0x6c09('0x8')]);function respondWithStatusCode(_0x2033d7,_0x10f206){_0x10f206=_0x10f206||0xcc;return function(_0xbc69c0){if(_0xbc69c0){return _0x2033d7[_0x6c09('0xa')](_0x10f206);}return _0x2033d7[_0x6c09('0xb')](_0x10f206)[_0x6c09('0xc')]();};}function respondWithResult(_0x1bb6ed,_0x321a15){_0x321a15=_0x321a15||0xc8;return function(_0x7cc238){if(_0x7cc238){return _0x1bb6ed[_0x6c09('0xb')](_0x321a15)['json'](_0x7cc238);}};}function respondWithFilteredResult(_0x199c2b,_0x344c7b){return function(_0x59388a){if(_0x59388a){var _0x55340c=typeof _0x344c7b[_0x6c09('0xd')]==='undefined'&&typeof _0x344c7b[_0x6c09('0xe')]===_0x6c09('0xf');var _0x3db3ab=_0x59388a[_0x6c09('0x10')];var _0x4d854a=_0x55340c?0x0:_0x344c7b[_0x6c09('0xd')];var _0x37995=_0x55340c?_0x59388a[_0x6c09('0x10')]:_0x344c7b[_0x6c09('0xd')]+_0x344c7b['limit'];var _0x20b34b;if(_0x37995>=_0x3db3ab){_0x37995=_0x3db3ab;_0x20b34b=0xc8;}else{_0x20b34b=0xce;}_0x199c2b[_0x6c09('0xb')](_0x20b34b);return _0x199c2b[_0x6c09('0x11')](_0x6c09('0x12'),_0x4d854a+'-'+_0x37995+'/'+_0x3db3ab)['json'](_0x59388a);}return null;};}function saveUpdates(_0x40f068){return function(_0xc6b885){if(_0xc6b885){return _0xc6b885[_0x6c09('0x13')](_0x40f068)[_0x6c09('0x14')](function(_0x172ac1){return _0x172ac1;});}return null;};}function removeEntity(_0x522ffe){return function(_0xd462ab){if(_0xd462ab){return _0xd462ab[_0x6c09('0x15')]()[_0x6c09('0x14')](function(){_0x522ffe[_0x6c09('0xb')](0xcc)[_0x6c09('0xc')]();});}};}function handleEntityNotFound(_0x30e2f4){return function(_0x115889){if(!_0x115889){_0x30e2f4['sendStatus'](0x194);}return _0x115889;};}function handleError(_0x13acf6,_0x2c03d8){_0x2c03d8=_0x2c03d8||0x1f4;return function(_0x50b6f0){logger[_0x6c09('0x16')](_0x50b6f0[_0x6c09('0x17')]);if(_0x50b6f0[_0x6c09('0x18')]){delete _0x50b6f0[_0x6c09('0x18')];}_0x13acf6['status'](_0x2c03d8)[_0x6c09('0x19')](_0x50b6f0);};}function maskClientSecret(_0x10c230){return _[_0x6c09('0x1a')](_0x10c230[_0x6c09('0x1b')](0x0,0x3),0x14,'*');}exports[_0x6c09('0x1c')]=function(_0x3a00c3,_0x81b90e){var _0x392a67={},_0x462271={},_0x34d7ed={'count':0x0,'rows':[]};var _0x32c8fc=_[_0x6c09('0x1d')](db[_0x6c09('0x1e')][_0x6c09('0x1f')],function(_0x5b7a2a){return{'name':_0x5b7a2a[_0x6c09('0x20')],'type':_0x5b7a2a[_0x6c09('0x21')][_0x6c09('0x22')]};});_0x462271[_0x6c09('0x23')]=_[_0x6c09('0x1d')](_0x32c8fc,_0x6c09('0x18'));_0x462271[_0x6c09('0x24')]=_[_0x6c09('0x25')](_0x3a00c3[_0x6c09('0x24')]);_0x462271['filters']=_[_0x6c09('0x26')](_0x462271[_0x6c09('0x23')],_0x462271[_0x6c09('0x24')]);_0x392a67[_0x6c09('0x27')]=_[_0x6c09('0x26')](_0x462271[_0x6c09('0x23')],qs[_0x6c09('0x28')](_0x3a00c3[_0x6c09('0x24')][_0x6c09('0x28')]));_0x392a67[_0x6c09('0x27')]=_0x392a67['attributes'][_0x6c09('0x29')]?_0x392a67['attributes']:_0x462271[_0x6c09('0x23')];if(!_0x3a00c3['query'][_0x6c09('0x2a')](_0x6c09('0x2b'))){_0x392a67['limit']=qs['limit'](_0x3a00c3[_0x6c09('0x24')][_0x6c09('0xe')]);_0x392a67[_0x6c09('0xd')]=qs[_0x6c09('0xd')](_0x3a00c3['query'][_0x6c09('0xd')]);}_0x392a67['order']=qs[_0x6c09('0x2c')](_0x3a00c3[_0x6c09('0x24')]['sort']);_0x392a67[_0x6c09('0x2d')]=qs[_0x6c09('0x2e')](_['pick'](_0x3a00c3[_0x6c09('0x24')],_0x462271[_0x6c09('0x2e')]),_0x32c8fc);if(_0x3a00c3[_0x6c09('0x24')][_0x6c09('0x2f')]){_0x392a67[_0x6c09('0x2d')]=_[_0x6c09('0x30')](_0x392a67[_0x6c09('0x2d')],{'$or':_['map'](_0x32c8fc,function(_0x49ea5b){if(_0x49ea5b[_0x6c09('0x21')]!==_0x6c09('0x31')){var _0x436428={};_0x436428[_0x49ea5b['name']]={'$like':'%'+_0x3a00c3[_0x6c09('0x24')][_0x6c09('0x2f')]+'%'};return _0x436428;}})});}_0x392a67=_[_0x6c09('0x30')]({},_0x392a67,_0x3a00c3[_0x6c09('0x32')]);var _0x289893={'where':_0x392a67[_0x6c09('0x2d')]};return db[_0x6c09('0x1e')][_0x6c09('0x10')](_0x289893)['then'](function(_0x5979d3){_0x34d7ed[_0x6c09('0x10')]=_0x5979d3;if(_0x3a00c3[_0x6c09('0x24')]['includeAll']){_0x392a67['include']=[{'all':!![]}];}return db['CloudProvider'][_0x6c09('0x33')](_0x392a67);})[_0x6c09('0x14')](function(_0x1be736){_0x34d7ed[_0x6c09('0x34')]=_[_0x6c09('0x1d')](_0x1be736,function(_0x1e01ec){if(_0x1e01ec[_0x6c09('0x35')]===_0x6c09('0x36')){var _0x9cfcce=encryptor[_0x6c09('0x37')](_0x1e01ec[_0x6c09('0x38')]);_0x1e01ec[_0x6c09('0x38')]=maskClientSecret(_0x9cfcce);}return _0x1e01ec;});return _0x34d7ed;})[_0x6c09('0x14')](respondWithFilteredResult(_0x81b90e,_0x392a67))['catch'](handleError(_0x81b90e,null));};exports['show']=function(_0x57a78d,_0x18df4c){var _0x3c24a6={'raw':!![],'where':{'id':_0x57a78d['params']['id']}},_0x677808={};_0x677808[_0x6c09('0x23')]=_[_0x6c09('0x25')](db[_0x6c09('0x1e')][_0x6c09('0x1f')]);_0x677808[_0x6c09('0x24')]=_[_0x6c09('0x25')](_0x57a78d[_0x6c09('0x24')]);_0x677808[_0x6c09('0x2e')]=_[_0x6c09('0x26')](_0x677808[_0x6c09('0x23')],_0x677808[_0x6c09('0x24')]);_0x3c24a6['attributes']=_[_0x6c09('0x26')](_0x677808['model'],qs['fields'](_0x57a78d[_0x6c09('0x24')][_0x6c09('0x28')]));_0x3c24a6[_0x6c09('0x27')]=_0x3c24a6[_0x6c09('0x27')][_0x6c09('0x29')]?_0x3c24a6[_0x6c09('0x27')]:_0x677808[_0x6c09('0x23')];if(_0x57a78d['query'][_0x6c09('0x39')]){_0x3c24a6[_0x6c09('0x3a')]=[{'all':!![]}];}_0x3c24a6=_['merge']({},_0x3c24a6,_0x57a78d[_0x6c09('0x32')]);return db[_0x6c09('0x1e')][_0x6c09('0x3b')](_0x3c24a6)[_0x6c09('0x14')](handleEntityNotFound(_0x18df4c,null))[_0x6c09('0x14')](function(_0xaf4989){if(_0xaf4989['service']===_0x6c09('0x36')){var _0x57edf1=encryptor['decryptString'](_0xaf4989['data3']);_0xaf4989[_0x6c09('0x38')]=maskClientSecret(_0x57edf1);}return _0xaf4989;})[_0x6c09('0x14')](respondWithResult(_0x18df4c,null))['catch'](handleError(_0x18df4c,null));};exports[_0x6c09('0x3c')]=function(_0x1e1a2a,_0x11ac07){if(!_0x1e1a2a[_0x6c09('0x3d')][_0x6c09('0x18')])throw new Error(_0x6c09('0x3e'));if(!_0x1e1a2a['body'][_0x6c09('0x35')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x4c3628=db[_0x6c09('0x1e')][_0x6c09('0x1f')][_0x6c09('0x35')][_0x6c09('0x3f')];if(!_0x4c3628[_0x6c09('0x40')](_0x1e1a2a['body']['service']))throw new Error(_0x6c09('0x41')+_0x4c3628[_0x6c09('0x42')](',\x20'));if(_0x1e1a2a[_0x6c09('0x3d')][_0x6c09('0x35')]==='MicrosoftAzure'&&_0x1e1a2a[_0x6c09('0x3d')][_0x6c09('0x38')]){_0x1e1a2a['body'][_0x6c09('0x38')]=encryptor['encryptString'](_0x1e1a2a['body'][_0x6c09('0x38')]);}return db[_0x6c09('0x1e')]['create'](_0x1e1a2a[_0x6c09('0x3d')],{})[_0x6c09('0x14')](respondWithResult(_0x11ac07,0xc9))[_0x6c09('0x43')](handleError(_0x11ac07,null));};exports[_0x6c09('0x13')]=function(_0x1ccaea,_0x26d1a0){if(_0x1ccaea['body']['id']){delete _0x1ccaea[_0x6c09('0x3d')]['id'];}return db[_0x6c09('0x1e')]['find']({'where':{'id':_0x1ccaea[_0x6c09('0x44')]['id']}})[_0x6c09('0x14')](handleEntityNotFound(_0x26d1a0,null))[_0x6c09('0x14')](function(_0x421d6c){if(_0x421d6c[_0x6c09('0x35')]===_0x6c09('0x36')&&_0x1ccaea[_0x6c09('0x3d')][_0x6c09('0x38')]){_0x1ccaea[_0x6c09('0x3d')][_0x6c09('0x38')]=encryptor[_0x6c09('0x45')](_0x1ccaea[_0x6c09('0x3d')][_0x6c09('0x38')]);}return _0x421d6c;})[_0x6c09('0x14')](saveUpdates(_0x1ccaea[_0x6c09('0x3d')],null))[_0x6c09('0x14')](respondWithResult(_0x26d1a0,null))[_0x6c09('0x43')](handleError(_0x26d1a0,null));};exports[_0x6c09('0x15')]=function(_0x47ad23,_0x512fb5){return db[_0x6c09('0x1e')][_0x6c09('0x3b')]({'where':{'id':_0x47ad23[_0x6c09('0x44')]['id']}})[_0x6c09('0x14')](handleEntityNotFound(_0x512fb5,null))[_0x6c09('0x14')](removeEntity(_0x512fb5,null))[_0x6c09('0x43')](handleError(_0x512fb5,null));};exports[_0x6c09('0x46')]=function(_0x13cc69,_0x460d79){return db[_0x6c09('0x1e')][_0x6c09('0x47')]({'where':{'id':_0x13cc69['params']['id']},'raw':!![]})['then'](function(_0x55a646){if(!_0x55a646)return _0x460d79[_0x6c09('0xa')](0x194);return{'url':oauth[_0x6c09('0x48')](_0x55a646,_0x13cc69[_0x6c09('0x49')]['id'])};})['then'](respondWithResult(_0x460d79,null))[_0x6c09('0x43')](handleError(_0x460d79,null));};exports[_0x6c09('0x4a')]=function(_0x1c4531,_0x1fe189){var _0x5b86f7=_0x1c4531['body'];var _0x1a7707;var _0x3b93c4;if(_0x5b86f7[_0x6c09('0x16')])throw _0x5b86f7;redis['get'](_0x5b86f7[_0x6c09('0x4b')])[_0x6c09('0x14')](function(_0x2b2c57){if(!_0x2b2c57)throw new Error('Invalid\x20state\x20parameter');_0x1a7707=JSON[_0x6c09('0x4c')](_0x2b2c57);var _0x1a1f82=Buffer[_0x6c09('0x4d')](_0x5b86f7[_0x6c09('0x4b')],_0x6c09('0x4e'))[_0x6c09('0x4f')](_0x6c09('0x50'));_0x3b93c4=JSON[_0x6c09('0x4c')](_0x1a1f82);if(!oauth[_0x6c09('0x51')](_0x5b86f7['id_token'],_0x1a7707[_0x6c09('0x52')]))throw new Error(_0x6c09('0x53'));redis[_0x6c09('0x54')](_0x5b86f7[_0x6c09('0x4b')]);return oauth[_0x6c09('0x55')](_0x5b86f7[_0x6c09('0x56')],_0x1a7707);})[_0x6c09('0x14')](function(_0xaadda0){_0x1a7707[_0x6c09('0x57')]=_0xaadda0['access_token'];_0x1a7707[_0x6c09('0x58')]=_0xaadda0[_0x6c09('0x59')];return db[_0x6c09('0x1e')][_0x6c09('0x13')]({'data5':_0x1a7707[_0x6c09('0x57')],'data6':_0x1a7707['data6']},{'where':{'id':_0x1a7707['id']}});})[_0x6c09('0x14')](function(){oauth[_0x6c09('0x5a')](_0x1a7707);socket[_0x6c09('0x5b')](_0x6c09('0x5c'),{'id':_0x3b93c4['id']});return;})[_0x6c09('0x14')](respondWithStatusCode(_0x1fe189,null))[_0x6c09('0x43')](function(_0x1d70cf){if(_0x3b93c4){socket[_0x6c09('0x5b')](_0x6c09('0x5d'),{'id':_0x3b93c4['id']});}if(!_0x1a7707){logger[_0x6c09('0x16')]('Invalid\x20authentication\x20state\x20parameter',_0x1d70cf);return _0x1fe189[_0x6c09('0xb')](0x1f4)[_0x6c09('0x19')](_0x1d70cf[_0x6c09('0x5e')]);}logger[_0x6c09('0x16')](_0x6c09('0x5f'),_0x1a7707['id'],JSON[_0x6c09('0x60')](_0x1d70cf));});};
\ No newline at end of file
+var _0xd1d6=['map','query','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','MicrosoftAzure','decryptString','data3','show','params','keys','find','catch','create','body','service','Service\x20parameter\x20not\x20specified','values','includes','join','encryptString','user','oauth2MicrosoftCallback','error','state','toString','ascii','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','undefined','limit','count','offset','set','update','then','destroy','name','send','index','CloudProvider','rawAttributes','fieldName','type','key','model'];(function(_0x34a507,_0x51f563){var _0xcabaa2=function(_0x3ef2bd){while(--_0x3ef2bd){_0x34a507['push'](_0x34a507['shift']());}};_0xcabaa2(++_0x51f563);}(_0xd1d6,0x14d));var _0x6d1d=function(_0x41bcc9,_0x35f72d){_0x41bcc9=_0x41bcc9-0x0;var _0x54e11b=_0xd1d6[_0x41bcc9];return _0x54e11b;};'use strict';var _=require(_0x6d1d('0x0'));var Redis=require(_0x6d1d('0x1'));var qs=require(_0x6d1d('0x2'));var encryptor=require(_0x6d1d('0x3'));var config=require(_0x6d1d('0x4'));var logger=require(_0x6d1d('0x5'))('api');var db=require(_0x6d1d('0x6'))['db'];var oauth=require(_0x6d1d('0x7'));config[_0x6d1d('0x8')]=_[_0x6d1d('0x9')](config[_0x6d1d('0x8')],{'host':_0x6d1d('0xa'),'port':0x18eb});var socket=require(_0x6d1d('0xb'))(new Redis(config[_0x6d1d('0x8')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x1545a8,_0x417a23){_0x417a23=_0x417a23||0xcc;return function(_0x426d14){if(_0x426d14){return _0x1545a8[_0x6d1d('0xc')](_0x417a23);}return _0x1545a8['status'](_0x417a23)['end']();};}function respondWithResult(_0x3fdc30,_0x1ea3f9){_0x1ea3f9=_0x1ea3f9||0xc8;return function(_0x2de539){if(_0x2de539){return _0x3fdc30[_0x6d1d('0xd')](_0x1ea3f9)['json'](_0x2de539);}};}function respondWithFilteredResult(_0x5eef90,_0x4a8a13){return function(_0x3fa892){if(_0x3fa892){var _0x59b74e=typeof _0x4a8a13['offset']===_0x6d1d('0xe')&&typeof _0x4a8a13[_0x6d1d('0xf')]===_0x6d1d('0xe');var _0x5e18e5=_0x3fa892[_0x6d1d('0x10')];var _0x32a0fb=_0x59b74e?0x0:_0x4a8a13[_0x6d1d('0x11')];var _0x3ffcb5=_0x59b74e?_0x3fa892[_0x6d1d('0x10')]:_0x4a8a13[_0x6d1d('0x11')]+_0x4a8a13['limit'];var _0x38993a;if(_0x3ffcb5>=_0x5e18e5){_0x3ffcb5=_0x5e18e5;_0x38993a=0xc8;}else{_0x38993a=0xce;}_0x5eef90['status'](_0x38993a);return _0x5eef90[_0x6d1d('0x12')]('Content-Range',_0x32a0fb+'-'+_0x3ffcb5+'/'+_0x5e18e5)['json'](_0x3fa892);}return null;};}function saveUpdates(_0x3ce178){return function(_0x4634db){if(_0x4634db){return _0x4634db[_0x6d1d('0x13')](_0x3ce178)[_0x6d1d('0x14')](function(_0x22dc17){return _0x22dc17;});}return null;};}function removeEntity(_0x365384){return function(_0x34fdb4){if(_0x34fdb4){return _0x34fdb4[_0x6d1d('0x15')]()['then'](function(){_0x365384['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4576a1){return function(_0x2f9979){if(!_0x2f9979){_0x4576a1[_0x6d1d('0xc')](0x194);}return _0x2f9979;};}function handleError(_0x11c865,_0x116187){_0x116187=_0x116187||0x1f4;return function(_0x1856bc){logger['error'](_0x1856bc['stack']);if(_0x1856bc[_0x6d1d('0x16')]){delete _0x1856bc[_0x6d1d('0x16')];}_0x11c865[_0x6d1d('0xd')](_0x116187)[_0x6d1d('0x17')](_0x1856bc);};}function maskClientSecret(_0x35dbae){return _['padEnd'](_0x35dbae['slice'](0x0,0x3),0x14,'*');}exports[_0x6d1d('0x18')]=function(_0x14a02e,_0x3393fd){var _0x2efc56={},_0x57d43b={},_0xef91c5={'count':0x0,'rows':[]};var _0x2bb15f=_['map'](db[_0x6d1d('0x19')][_0x6d1d('0x1a')],function(_0x4886c7){return{'name':_0x4886c7[_0x6d1d('0x1b')],'type':_0x4886c7[_0x6d1d('0x1c')][_0x6d1d('0x1d')]};});_0x57d43b[_0x6d1d('0x1e')]=_[_0x6d1d('0x1f')](_0x2bb15f,'name');_0x57d43b[_0x6d1d('0x20')]=_['keys'](_0x14a02e['query']);_0x57d43b['filters']=_['intersection'](_0x57d43b['model'],_0x57d43b['query']);_0x2efc56[_0x6d1d('0x21')]=_[_0x6d1d('0x22')](_0x57d43b[_0x6d1d('0x1e')],qs[_0x6d1d('0x23')](_0x14a02e[_0x6d1d('0x20')][_0x6d1d('0x23')]));_0x2efc56['attributes']=_0x2efc56[_0x6d1d('0x21')][_0x6d1d('0x24')]?_0x2efc56['attributes']:_0x57d43b[_0x6d1d('0x1e')];if(!_0x14a02e[_0x6d1d('0x20')][_0x6d1d('0x25')]('nolimit')){_0x2efc56[_0x6d1d('0xf')]=qs[_0x6d1d('0xf')](_0x14a02e[_0x6d1d('0x20')]['limit']);_0x2efc56[_0x6d1d('0x11')]=qs[_0x6d1d('0x11')](_0x14a02e[_0x6d1d('0x20')]['offset']);}_0x2efc56['order']=qs[_0x6d1d('0x26')](_0x14a02e['query'][_0x6d1d('0x26')]);_0x2efc56[_0x6d1d('0x27')]=qs['filters'](_[_0x6d1d('0x28')](_0x14a02e[_0x6d1d('0x20')],_0x57d43b[_0x6d1d('0x29')]),_0x2bb15f);if(_0x14a02e['query'][_0x6d1d('0x2a')]){_0x2efc56[_0x6d1d('0x27')]=_[_0x6d1d('0x2b')](_0x2efc56[_0x6d1d('0x27')],{'$or':_['map'](_0x2bb15f,function(_0x1b47d4){if(_0x1b47d4['type']!==_0x6d1d('0x2c')){var _0x14c045={};_0x14c045[_0x1b47d4['name']]={'$like':'%'+_0x14a02e[_0x6d1d('0x20')][_0x6d1d('0x2a')]+'%'};return _0x14c045;}})});}_0x2efc56=_[_0x6d1d('0x2b')]({},_0x2efc56,_0x14a02e[_0x6d1d('0x2d')]);var _0x3db887={'where':_0x2efc56[_0x6d1d('0x27')]};return db[_0x6d1d('0x19')]['count'](_0x3db887)[_0x6d1d('0x14')](function(_0x13641c){_0xef91c5[_0x6d1d('0x10')]=_0x13641c;if(_0x14a02e['query'][_0x6d1d('0x2e')]){_0x2efc56[_0x6d1d('0x2f')]=[{'all':!![]}];}return db['CloudProvider'][_0x6d1d('0x30')](_0x2efc56);})[_0x6d1d('0x14')](function(_0x3ed63f){_0xef91c5[_0x6d1d('0x31')]=_[_0x6d1d('0x1f')](_0x3ed63f,function(_0x1b6686){if(_0x1b6686['service']===_0x6d1d('0x32')){var _0x16f1de=encryptor[_0x6d1d('0x33')](_0x1b6686['data3']);_0x1b6686[_0x6d1d('0x34')]=maskClientSecret(_0x16f1de);}return _0x1b6686;});return _0xef91c5;})[_0x6d1d('0x14')](respondWithFilteredResult(_0x3393fd,_0x2efc56))['catch'](handleError(_0x3393fd,null));};exports[_0x6d1d('0x35')]=function(_0x12a78d,_0x435932){var _0xade116={'raw':!![],'where':{'id':_0x12a78d[_0x6d1d('0x36')]['id']}},_0x261768={};_0x261768['model']=_['keys'](db[_0x6d1d('0x19')][_0x6d1d('0x1a')]);_0x261768[_0x6d1d('0x20')]=_[_0x6d1d('0x37')](_0x12a78d[_0x6d1d('0x20')]);_0x261768[_0x6d1d('0x29')]=_[_0x6d1d('0x22')](_0x261768['model'],_0x261768[_0x6d1d('0x20')]);_0xade116[_0x6d1d('0x21')]=_[_0x6d1d('0x22')](_0x261768['model'],qs[_0x6d1d('0x23')](_0x12a78d[_0x6d1d('0x20')][_0x6d1d('0x23')]));_0xade116[_0x6d1d('0x21')]=_0xade116[_0x6d1d('0x21')]['length']?_0xade116[_0x6d1d('0x21')]:_0x261768[_0x6d1d('0x1e')];if(_0x12a78d[_0x6d1d('0x20')]['includeAll']){_0xade116[_0x6d1d('0x2f')]=[{'all':!![]}];}_0xade116=_[_0x6d1d('0x2b')]({},_0xade116,_0x12a78d[_0x6d1d('0x2d')]);return db['CloudProvider'][_0x6d1d('0x38')](_0xade116)[_0x6d1d('0x14')](handleEntityNotFound(_0x435932,null))[_0x6d1d('0x14')](function(_0x328536){if(_0x328536['service']==='MicrosoftAzure'){var _0x1935f8=encryptor[_0x6d1d('0x33')](_0x328536[_0x6d1d('0x34')]);_0x328536['data3']=maskClientSecret(_0x1935f8);}return _0x328536;})[_0x6d1d('0x14')](respondWithResult(_0x435932,null))[_0x6d1d('0x39')](handleError(_0x435932,null));};exports[_0x6d1d('0x3a')]=function(_0x248707,_0x31e077){if(!_0x248707[_0x6d1d('0x3b')][_0x6d1d('0x16')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x248707[_0x6d1d('0x3b')][_0x6d1d('0x3c')])throw new Error(_0x6d1d('0x3d'));var _0x55f890=db['CloudProvider'][_0x6d1d('0x1a')][_0x6d1d('0x3c')][_0x6d1d('0x3e')];if(!_0x55f890[_0x6d1d('0x3f')](_0x248707[_0x6d1d('0x3b')][_0x6d1d('0x3c')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x55f890[_0x6d1d('0x40')](',\x20'));if(_0x248707[_0x6d1d('0x3b')]['service']==='MicrosoftAzure'&&_0x248707[_0x6d1d('0x3b')][_0x6d1d('0x34')]){_0x248707[_0x6d1d('0x3b')][_0x6d1d('0x34')]=encryptor[_0x6d1d('0x41')](_0x248707[_0x6d1d('0x3b')]['data3']);}return db['CloudProvider']['create'](_0x248707[_0x6d1d('0x3b')],{})['then'](respondWithResult(_0x31e077,0xc9))[_0x6d1d('0x39')](handleError(_0x31e077,null));};exports[_0x6d1d('0x13')]=function(_0x48e6b2,_0x3a09cf){if(_0x48e6b2[_0x6d1d('0x3b')]['id']){delete _0x48e6b2[_0x6d1d('0x3b')]['id'];}return db[_0x6d1d('0x19')][_0x6d1d('0x38')]({'where':{'id':_0x48e6b2[_0x6d1d('0x36')]['id']}})['then'](handleEntityNotFound(_0x3a09cf,null))[_0x6d1d('0x14')](function(_0x185db4){if(_0x185db4[_0x6d1d('0x3c')]==='MicrosoftAzure'&&_0x48e6b2['body'][_0x6d1d('0x34')]){_0x48e6b2[_0x6d1d('0x3b')][_0x6d1d('0x34')]=encryptor[_0x6d1d('0x41')](_0x48e6b2['body'][_0x6d1d('0x34')]);}return _0x185db4;})[_0x6d1d('0x14')](saveUpdates(_0x48e6b2[_0x6d1d('0x3b')],null))[_0x6d1d('0x14')](respondWithResult(_0x3a09cf,null))[_0x6d1d('0x39')](handleError(_0x3a09cf,null));};exports['destroy']=function(_0x20eedb,_0x538d95){return db[_0x6d1d('0x19')][_0x6d1d('0x38')]({'where':{'id':_0x20eedb[_0x6d1d('0x36')]['id']}})[_0x6d1d('0x14')](handleEntityNotFound(_0x538d95,null))[_0x6d1d('0x14')](removeEntity(_0x538d95,null))['catch'](handleError(_0x538d95,null));};exports['oauth2MicrosoftAuthorize']=function(_0x42ae36,_0x4dc40e){return db['CloudProvider']['findOne']({'where':{'id':_0x42ae36[_0x6d1d('0x36')]['id']},'raw':!![]})[_0x6d1d('0x14')](function(_0x2030fe){if(!_0x2030fe)return _0x4dc40e[_0x6d1d('0xc')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x2030fe,_0x42ae36[_0x6d1d('0x42')]['id'])};})[_0x6d1d('0x14')](respondWithResult(_0x4dc40e,null))[_0x6d1d('0x39')](handleError(_0x4dc40e,null));};exports[_0x6d1d('0x43')]=function(_0x5b9120,_0x2137d9){var _0x140b63=_0x5b9120[_0x6d1d('0x3b')];var _0x2421bd;var _0x20d44f;if(_0x140b63[_0x6d1d('0x44')])throw _0x140b63;redis['get'](_0x140b63['state'])[_0x6d1d('0x14')](function(_0x44f1f6){if(!_0x44f1f6)throw new Error('Invalid\x20state\x20parameter');_0x2421bd=JSON['parse'](_0x44f1f6);var _0x465b0e=Buffer['from'](_0x140b63[_0x6d1d('0x45')],'base64')[_0x6d1d('0x46')](_0x6d1d('0x47'));_0x20d44f=JSON[_0x6d1d('0x48')](_0x465b0e);if(!oauth[_0x6d1d('0x49')](_0x140b63[_0x6d1d('0x4a')],_0x2421bd[_0x6d1d('0x4b')]))throw new Error(_0x6d1d('0x4c'));redis[_0x6d1d('0x4d')](_0x140b63[_0x6d1d('0x45')]);return oauth[_0x6d1d('0x4e')](_0x140b63[_0x6d1d('0x4f')],_0x2421bd);})[_0x6d1d('0x14')](function(_0x29ac73){_0x2421bd[_0x6d1d('0x50')]=_0x29ac73[_0x6d1d('0x51')];_0x2421bd[_0x6d1d('0x52')]=_0x29ac73[_0x6d1d('0x53')];return db['CloudProvider'][_0x6d1d('0x13')]({'data5':_0x2421bd['data5'],'data6':_0x2421bd[_0x6d1d('0x52')]},{'where':{'id':_0x2421bd['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x2421bd);socket[_0x6d1d('0x54')](_0x6d1d('0x55'),{'id':_0x20d44f['id']});return;})[_0x6d1d('0x14')](respondWithStatusCode(_0x2137d9,null))['catch'](function(_0x5e23e6){if(_0x20d44f){socket[_0x6d1d('0x54')](_0x6d1d('0x56'),{'id':_0x20d44f['id']});}if(!_0x2421bd){logger[_0x6d1d('0x44')](_0x6d1d('0x57'),_0x5e23e6);return _0x2137d9[_0x6d1d('0xd')](0x1f4)[_0x6d1d('0x17')](_0x5e23e6[_0x6d1d('0x58')]);}logger[_0x6d1d('0x44')](_0x6d1d('0x59'),_0x2421bd['id'],JSON[_0x6d1d('0x5a')](_0x5e23e6));});};
\ No newline at end of file
index ec48803..a9992d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b07=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash'];(function(_0x1788d2,_0x577054){var _0x2f5bc3=function(_0x68a6f4){while(--_0x68a6f4){_0x1788d2['push'](_0x1788d2['shift']());}};_0x2f5bc3(++_0x577054);}(_0x8b07,0xc2));var _0x78b0=function(_0x43597e,_0x542b30){_0x43597e=_0x43597e-0x0;var _0x4cdd53=_0x8b07[_0x43597e];return _0x4cdd53;};'use strict';var _=require(_0x78b0('0x0'));var util=require(_0x78b0('0x1'));var logger=require(_0x78b0('0x2'))(_0x78b0('0x3'));var moment=require(_0x78b0('0x4'));var BPromise=require(_0x78b0('0x5'));var rp=require(_0x78b0('0x6'));var fs=require('fs');var path=require(_0x78b0('0x7'));var rimraf=require(_0x78b0('0x8'));var config=require(_0x78b0('0x9'));var attributes=require(_0x78b0('0xa'));module[_0x78b0('0xb')]=function(_0x2ce1a0,_0x390fa8){return _0x2ce1a0[_0x78b0('0xc')](_0x78b0('0xd'),attributes,{'tableName':_0x78b0('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x37d0=['CloudProvider','cloud_providers','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports'];(function(_0xb6c029,_0x289717){var _0x369954=function(_0xf20e69){while(--_0xf20e69){_0xb6c029['push'](_0xb6c029['shift']());}};_0x369954(++_0x289717);}(_0x37d0,0x1af));var _0x037d=function(_0x471450,_0x13f132){_0x471450=_0x471450-0x0;var _0xd594c9=_0x37d0[_0x471450];return _0xd594c9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x037d('0x0'))(_0x037d('0x1'));var moment=require(_0x037d('0x2'));var BPromise=require(_0x037d('0x3'));var rp=require(_0x037d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x037d('0x5'));var config=require(_0x037d('0x6'));var attributes=require(_0x037d('0x7'));module[_0x037d('0x8')]=function(_0x59a01a,_0x58ea17){return _0x59a01a['define'](_0x037d('0x9'),attributes,{'tableName':_0x037d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 46af9fc..021c7b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf98d=['value','oauth2Claims','oauth2/','set','payload','iss','aud','audience','isAfter','unix','data3','findOne','then','refresh_token','decryptString','POST','data5','access_token','data6','update','catch','error','authorization_code','data1','intervals','bind','CloudProvider','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','map','type','Dynamics365','push','data7','/.default','Outlook365','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','randomBytes','hex','client_id','response_type','join','redirect_uri','data4','form_post','scope','state','nonce','prompt','login','key'];(function(_0xf41af4,_0x2dca83){var _0x1290bc=function(_0x1c9c08){while(--_0x1c9c08){_0xf41af4['push'](_0xf41af4['shift']());}};_0x1290bc(++_0x2dca83);}(_0xf98d,0x11e));var _0xdf98=function(_0x12d247,_0x239701){_0x12d247=_0x12d247-0x0;var _0x4c9a7a=_0xf98d[_0x12d247];return _0x4c9a7a;};'use strict';var _=require(_0xdf98('0x0'));var crypto=require(_0xdf98('0x1'));var jwt=require(_0xdf98('0x2'));var moment=require(_0xdf98('0x3'));var Redis=require(_0xdf98('0x4'));var rp=require(_0xdf98('0x5'));var util=require(_0xdf98('0x6'));var encryptor=require(_0xdf98('0x7'));var config=require(_0xdf98('0x8'));var logger=require(_0xdf98('0x9'))(_0xdf98('0xa'));var schedule=require(_0xdf98('0xb'));var db=require(_0xdf98('0xc'))['db'];config[_0xdf98('0xd')]=_[_0xdf98('0xe')](config[_0xdf98('0xd')],{'host':_0xdf98('0xf'),'port':0x18eb});var redis=new Redis(config[_0xdf98('0xd')]);var MICROSOFT_AUTH_URL=_0xdf98('0x10');var AZURE_AUTH_SCOPES={'Outlook365':[_0xdf98('0x11'),'profile',_0xdf98('0x12'),_0xdf98('0x13'),_0xdf98('0x14'),_0xdf98('0x15'),_0xdf98('0x16')],'Dynamics365':[_0xdf98('0x11'),_0xdf98('0x13')]};var MICROSOFT_AUTH_ENDPOINT=_0xdf98('0x17');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x545b96){var _0x51088d=_[_0xdf98('0x18')](AZURE_AUTH_SCOPES[_0x545b96[_0xdf98('0x19')]]);if(_0x545b96[_0xdf98('0x19')]===_0xdf98('0x1a'))_0x51088d[_0xdf98('0x1b')](_0x545b96[_0xdf98('0x1c')]+_0xdf98('0x1d'));return _0x51088d['join']('\x20');}function getAccessTokenScope(_0x16d543){if(_0x16d543[_0xdf98('0x19')]===_0xdf98('0x1e'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x16d543[_0xdf98('0x19')]===_0xdf98('0x1a'))return _0x16d543[_0xdf98('0x1c')]+_0xdf98('0x1d');}function generateMicrosoftAuthorizationUrl(_0x1a1094,_0x5cf414){var _0x47f5dd=MICROSOFT_AUTH_URL[_0xdf98('0x1f')](_0xdf98('0x20'),_0x1a1094[_0xdf98('0x21')]);var _0xdc7c57=[_0xdf98('0x22'),_0xdf98('0x23')];var _0x42eb56=Buffer[_0xdf98('0x24')](JSON[_0xdf98('0x25')]({'id':_0x5cf414}))[_0xdf98('0x26')](_0xdf98('0x27'));var _0x93e2ec=crypto[_0xdf98('0x28')](0x10)['toString'](_0xdf98('0x29'));var _0x5cb049=getAuthorizationScopes(_0x1a1094);var _0x13d827=[{'key':_0xdf98('0x2a'),'value':_0x1a1094['data1']},{'key':_0xdf98('0x2b'),'value':encodeURIComponent(_0xdc7c57[_0xdf98('0x2c')]('\x20'))},{'key':_0xdf98('0x2d'),'value':_0x1a1094[_0xdf98('0x2e')]},{'key':'response_mode','value':_0xdf98('0x2f')},{'key':_0xdf98('0x30'),'value':encodeURIComponent(_0x5cb049)},{'key':_0xdf98('0x31'),'value':_0x42eb56},{'key':_0xdf98('0x32'),'value':_0x93e2ec},{'key':_0xdf98('0x33'),'value':_0xdf98('0x34')}];var _0x2c1872=_0x47f5dd+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xdf98('0x18')](_0x13d827,function(_0x4ee237){return _0x4ee237[_0xdf98('0x35')]+'='+_0x4ee237[_0xdf98('0x36')];})['join']('&');_0x1a1094[_0xdf98('0x37')]={'issuer':_0x47f5dd[_0xdf98('0x1f')](_0xdf98('0x38'),''),'audience':_0x1a1094['data1'],'state':_0x42eb56,'nonce':_0x93e2ec};redis[_0xdf98('0x39')](_0x42eb56,JSON[_0xdf98('0x25')](_0x1a1094));return _0x2c1872;}function isValidIdToken(_0x53678c,_0x5b9200){try{var _0x45d6fb=jwt['decode'](_0x53678c,{'complete':!![]});var _0x5b0174=_0x45d6fb[_0xdf98('0x3a')];if(_0x5b0174[_0xdf98('0x3b')]!==_0x5b9200['issuer'])return![];if(_0x5b0174[_0xdf98('0x3c')]!==_0x5b9200[_0xdf98('0x3d')])return![];if(_0x5b0174[_0xdf98('0x32')]!==_0x5b9200[_0xdf98('0x32')])return![];if(moment()[_0xdf98('0x3e')](moment[_0xdf98('0x3f')](_0x5b0174['exp'])))return![];return!![];}catch(_0x2b2015){throw _0x2b2015;}}function refreshOauth2MicrosoftAccessToken(_0xdcdf03){return Promise['resolve']()['then'](function(){if(_0xdcdf03[_0xdf98('0x40')])return _0xdcdf03;return db['CloudProvider'][_0xdf98('0x41')]({'where':{'id':_0xdcdf03['id']},'raw':!![]});})[_0xdf98('0x42')](function(_0x56ced4){var _0xb9df57={'grant_type':_0xdf98('0x43'),'refresh_token':_0x56ced4['data6'],'scope':getAccessTokenScope(_0x56ced4),'redirect_uri':_0x56ced4['data4'],'client_id':_0x56ced4['data1'],'client_secret':encryptor[_0xdf98('0x44')](_0x56ced4['data3'])};var _0xbf3be3={'method':_0xdf98('0x45'),'uri':MICROSOFT_AUTH_URL[_0xdf98('0x1f')]('{TENANT_ID}',_0x56ced4[_0xdf98('0x21')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xb9df57,'json':!![]};return rp(_0xbf3be3);})[_0xdf98('0x42')](function(_0x588710){_0xdcdf03[_0xdf98('0x46')]=_0x588710[_0xdf98('0x47')];_0xdcdf03[_0xdf98('0x48')]=_0x588710[_0xdf98('0x43')];return db['CloudProvider'][_0xdf98('0x49')]({'data5':_0xdcdf03[_0xdf98('0x46')],'data6':_0xdcdf03[_0xdf98('0x48')]},{'where':{'id':_0xdcdf03['id']}});})['then'](function(){return _0xdcdf03;})[_0xdf98('0x4a')](function(_0xe91d8f){logger[_0xdf98('0x4b')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0xdcdf03['id'],_0xe91d8f);});}function getOauth2MicrosoftAccessToken(_0x1961d6,_0x11dcfd){var _0x473899={'grant_type':_0xdf98('0x4c'),'code':_0x1961d6,'scope':getAccessTokenScope(_0x11dcfd),'redirect_uri':_0x11dcfd[_0xdf98('0x2e')],'client_id':_0x11dcfd[_0xdf98('0x4d')],'client_secret':encryptor[_0xdf98('0x44')](_0x11dcfd['data3'])};var _0x1fd8ac={'method':_0xdf98('0x45'),'uri':MICROSOFT_AUTH_URL[_0xdf98('0x1f')]('{TENANT_ID}',_0x11dcfd[_0xdf98('0x21')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x473899,'json':!![]};return rp(_0x1fd8ac);}function startRefreshInterval(_0x5787d3){var _0x22ebc4=schedule[_0xdf98('0x4e')];if(_0x22ebc4[_0x5787d3['id']])clearInterval(_0x22ebc4[_0x5787d3['id']]);_0x22ebc4[_0x5787d3['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xdf98('0x4f')](this,{'id':_0x5787d3['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xdf98('0x4e')]=_0x22ebc4;}function startAllRefreshIntervals(){return db[_0xdf98('0x50')][_0xdf98('0x51')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x4c6e92){var _0x30346b=_0x4c6e92['map'](function(_0x46f560){return refreshOauth2MicrosoftAccessToken(_0x46f560)['then'](function(_0x5bb6ff){startRefreshInterval(_0x5bb6ff);});});return Promise[_0xdf98('0x52')](_0x30346b);})[_0xdf98('0x4a')](function(_0x5aaf42){var _0x30cc2a=_0x5aaf42?util[_0xdf98('0x53')](_0x5aaf42,{'showHidden':![],'depth':null}):'';logger['error'](_0xdf98('0x54'),_0x30cc2a);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xb33b=['join','Outlook365','replace','{TENANT_ID}','id_token','from','stringify','base64','randomBytes','toString','hex','data1','response_type','response_mode','form_post','nonce','login','map','key','value','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','exp','resolve','then','CloudProvider','refresh_token','data6','data4','decryptString','data3','POST','data2','data5','access_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','Dynamics365','push','data7','/.default'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xb33b,0xd1));var _0xbb33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb33b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbb33('0x0'));var crypto=require(_0xbb33('0x1'));var jwt=require(_0xbb33('0x2'));var moment=require(_0xbb33('0x3'));var Redis=require(_0xbb33('0x4'));var rp=require(_0xbb33('0x5'));var util=require(_0xbb33('0x6'));var encryptor=require(_0xbb33('0x7'));var config=require(_0xbb33('0x8'));var logger=require('../../config/logger')('api');var schedule=require(_0xbb33('0x9'));var db=require(_0xbb33('0xa'))['db'];config['redis']=_[_0xbb33('0xb')](config[_0xbb33('0xc')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xbb33('0xc')]);var MICROSOFT_AUTH_URL=_0xbb33('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0xbb33('0xe'),_0xbb33('0xf'),_0xbb33('0x10'),_0xbb33('0x11'),_0xbb33('0x12'),_0xbb33('0x13'),_0xbb33('0x14')],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xbb33('0x15');var MICROSOFT_TOKEN_ENDPOINT=_0xbb33('0x16');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4b8c0e){var _0x15bedd=_['map'](AZURE_AUTH_SCOPES[_0x4b8c0e[_0xbb33('0x17')]]);if(_0x4b8c0e['type']===_0xbb33('0x18'))_0x15bedd[_0xbb33('0x19')](_0x4b8c0e[_0xbb33('0x1a')]+_0xbb33('0x1b'));return _0x15bedd[_0xbb33('0x1c')]('\x20');}function getAccessTokenScope(_0xb492e2){if(_0xb492e2[_0xbb33('0x17')]===_0xbb33('0x1d'))return _0xbb33('0x12');if(_0xb492e2[_0xbb33('0x17')]===_0xbb33('0x18'))return _0xb492e2[_0xbb33('0x1a')]+_0xbb33('0x1b');}function generateMicrosoftAuthorizationUrl(_0x594733,_0x5d41c4){var _0x1aac40=MICROSOFT_AUTH_URL[_0xbb33('0x1e')](_0xbb33('0x1f'),_0x594733['data2']);var _0x375ad1=['code',_0xbb33('0x20')];var _0x3fa8a1=Buffer[_0xbb33('0x21')](JSON[_0xbb33('0x22')]({'id':_0x5d41c4}))['toString'](_0xbb33('0x23'));var _0x4aa779=crypto[_0xbb33('0x24')](0x10)[_0xbb33('0x25')](_0xbb33('0x26'));var _0x773352=getAuthorizationScopes(_0x594733);var _0x1198f8=[{'key':'client_id','value':_0x594733[_0xbb33('0x27')]},{'key':_0xbb33('0x28'),'value':encodeURIComponent(_0x375ad1[_0xbb33('0x1c')]('\x20'))},{'key':'redirect_uri','value':_0x594733['data4']},{'key':_0xbb33('0x29'),'value':_0xbb33('0x2a')},{'key':'scope','value':encodeURIComponent(_0x773352)},{'key':'state','value':_0x3fa8a1},{'key':_0xbb33('0x2b'),'value':_0x4aa779},{'key':'prompt','value':_0xbb33('0x2c')}];var _0x2a52fa=_0x1aac40+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xbb33('0x2d')](_0x1198f8,function(_0x545fbf){return _0x545fbf[_0xbb33('0x2e')]+'='+_0x545fbf[_0xbb33('0x2f')];})[_0xbb33('0x1c')]('&');_0x594733[_0xbb33('0x30')]={'issuer':_0x1aac40['replace'](_0xbb33('0x31'),''),'audience':_0x594733[_0xbb33('0x27')],'state':_0x3fa8a1,'nonce':_0x4aa779};redis[_0xbb33('0x32')](_0x3fa8a1,JSON[_0xbb33('0x22')](_0x594733));return _0x2a52fa;}function isValidIdToken(_0x1668a9,_0x5568c2){try{var _0xb5d2f9=jwt[_0xbb33('0x33')](_0x1668a9,{'complete':!![]});var _0x346caa=_0xb5d2f9[_0xbb33('0x34')];if(_0x346caa[_0xbb33('0x35')]!==_0x5568c2[_0xbb33('0x36')])return![];if(_0x346caa['aud']!==_0x5568c2['audience'])return![];if(_0x346caa[_0xbb33('0x2b')]!==_0x5568c2[_0xbb33('0x2b')])return![];if(moment()['isAfter'](moment['unix'](_0x346caa[_0xbb33('0x37')])))return![];return!![];}catch(_0x118477){throw _0x118477;}}function refreshOauth2MicrosoftAccessToken(_0x472dcb){return Promise[_0xbb33('0x38')]()[_0xbb33('0x39')](function(){if(_0x472dcb['data3'])return _0x472dcb;return db[_0xbb33('0x3a')]['findOne']({'where':{'id':_0x472dcb['id']},'raw':!![]});})[_0xbb33('0x39')](function(_0x51afaa){var _0x39aebe={'grant_type':_0xbb33('0x3b'),'refresh_token':_0x51afaa[_0xbb33('0x3c')],'scope':getAccessTokenScope(_0x51afaa),'redirect_uri':_0x51afaa[_0xbb33('0x3d')],'client_id':_0x51afaa[_0xbb33('0x27')],'client_secret':encryptor[_0xbb33('0x3e')](_0x51afaa[_0xbb33('0x3f')])};var _0x571e77={'method':_0xbb33('0x40'),'uri':MICROSOFT_AUTH_URL[_0xbb33('0x1e')](_0xbb33('0x1f'),_0x51afaa[_0xbb33('0x41')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x39aebe,'json':!![]};return rp(_0x571e77);})[_0xbb33('0x39')](function(_0x348557){_0x472dcb[_0xbb33('0x42')]=_0x348557[_0xbb33('0x43')];_0x472dcb[_0xbb33('0x3c')]=_0x348557[_0xbb33('0x3b')];return db['CloudProvider'][_0xbb33('0x44')]({'data5':_0x472dcb[_0xbb33('0x42')],'data6':_0x472dcb[_0xbb33('0x3c')]},{'where':{'id':_0x472dcb['id']}});})[_0xbb33('0x39')](function(){return _0x472dcb;})[_0xbb33('0x45')](function(_0x4eb092){logger['error'](_0xbb33('0x46'),_0x472dcb['id'],_0x4eb092);});}function getOauth2MicrosoftAccessToken(_0x5f110e,_0x156864){var _0x411f9b={'grant_type':_0xbb33('0x47'),'code':_0x5f110e,'scope':getAccessTokenScope(_0x156864),'redirect_uri':_0x156864[_0xbb33('0x3d')],'client_id':_0x156864['data1'],'client_secret':encryptor[_0xbb33('0x3e')](_0x156864[_0xbb33('0x3f')])};var _0x15c1da={'method':_0xbb33('0x40'),'uri':MICROSOFT_AUTH_URL[_0xbb33('0x1e')](_0xbb33('0x1f'),_0x156864[_0xbb33('0x41')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x411f9b,'json':!![]};return rp(_0x15c1da);}function startRefreshInterval(_0x22c84e){var _0x1b6306=schedule[_0xbb33('0x48')];if(_0x1b6306[_0x22c84e['id']])clearInterval(_0x1b6306[_0x22c84e['id']]);_0x1b6306[_0x22c84e['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xbb33('0x49')](this,{'id':_0x22c84e['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x1b6306;}function startAllRefreshIntervals(){return db[_0xbb33('0x3a')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xbb33('0x39')](function(_0x268741){var _0x26448c=_0x268741[_0xbb33('0x2d')](function(_0x4d9c58){return refreshOauth2MicrosoftAccessToken(_0x4d9c58)['then'](function(_0x9621eb){startRefreshInterval(_0x9621eb);});});return Promise[_0xbb33('0x4a')](_0x26448c);})[_0xbb33('0x45')](function(_0x2dc470){var _0x3cdfd3=_0x2dc470?util[_0xbb33('0x4b')](_0x2dc470,{'showHidden':![],'depth':null}):'';logger[_0xbb33('0x4c')](_0xbb33('0x4d'),_0x3cdfd3);});}module[_0xbb33('0x4e')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
index 5e4e20a..0ca9c72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f1a=['debug','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','request\x20sent'];(function(_0x2ab365,_0xa3812e){var _0x49fef3=function(_0x29b883){while(--_0x29b883){_0x2ab365['push'](_0x2ab365['shift']());}};_0x49fef3(++_0xa3812e);}(_0x8f1a,0xcd));var _0xa8f1=function(_0x5ac090,_0x4cab85){_0x5ac090=_0x5ac090-0x0;var _0x13ffe2=_0x8f1a[_0x5ac090];return _0x13ffe2;};'use strict';var _=require(_0xa8f1('0x0'));var util=require(_0xa8f1('0x1'));var moment=require(_0xa8f1('0x2'));var BPromise=require(_0xa8f1('0x3'));var rs=require(_0xa8f1('0x4'));var fs=require('fs');var Redis=require(_0xa8f1('0x5'));var db=require(_0xa8f1('0x6'))['db'];var utils=require(_0xa8f1('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xa8f1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa8f1('0x9')][_0xa8f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c2920,_0x43c3ed,_0x13f210){return new BPromise(function(_0xcc8a38,_0x36b58b){return client[_0xa8f1('0xb')](_0x4c2920,_0x13f210)[_0xa8f1('0xc')](function(_0x1a23a0){logger[_0xa8f1('0xd')]('CloudProvider,\x20%s,\x20%s',_0x43c3ed,_0xa8f1('0xe'));logger[_0xa8f1('0xf')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x43c3ed,_0xa8f1('0xe'),JSON['stringify'](_0x1a23a0));if(_0x1a23a0[_0xa8f1('0x10')]){if(_0x1a23a0[_0xa8f1('0x10')][_0xa8f1('0x11')]===0x1f4){logger['error'](_0xa8f1('0x12'),_0x43c3ed,_0x1a23a0[_0xa8f1('0x10')][_0xa8f1('0x13')]);return _0x36b58b(_0x1a23a0[_0xa8f1('0x10')][_0xa8f1('0x13')]);}logger['error'](_0xa8f1('0x12'),_0x43c3ed,_0x1a23a0['error'][_0xa8f1('0x13')]);return _0xcc8a38(_0x1a23a0[_0xa8f1('0x10')]['message']);}else{logger['info'](_0xa8f1('0x12'),_0x43c3ed,_0xa8f1('0xe'));_0xcc8a38(_0x1a23a0[_0xa8f1('0x14')][_0xa8f1('0x13')]);}})[_0xa8f1('0x15')](function(_0x15bfad){logger[_0xa8f1('0x10')](_0xa8f1('0x12'),_0x43c3ed,_0x15bfad);_0x36b58b(_0x15bfad);});});}
\ No newline at end of file
+var _0xf277=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','debug','request\x20sent','stringify','error','code','message','CloudProvider,\x20%s,\x20%s','result','catch','lodash','util','bluebird'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xf277,0x1e1));var _0x7f27=function(_0x51c956,_0x49a0b6){_0x51c956=_0x51c956-0x0;var _0x507143=_0xf277[_0x51c956];return _0x507143;};'use strict';var _=require(_0x7f27('0x0'));var util=require(_0x7f27('0x1'));var moment=require('moment');var BPromise=require(_0x7f27('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f27('0x3'));var db=require(_0x7f27('0x4'))['db'];var utils=require(_0x7f27('0x5'));var logger=require(_0x7f27('0x6'))(_0x7f27('0x7'));var config=require('../../config/environment');var jayson=require(_0x7f27('0x8'));var client=jayson['client'][_0x7f27('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39dcee,_0x480cd6,_0x23dbcc){return new BPromise(function(_0x25c4dc,_0x5c0dbb){return client[_0x7f27('0xa')](_0x39dcee,_0x23dbcc)[_0x7f27('0xb')](function(_0x8ecc84){logger[_0x7f27('0xc')]('CloudProvider,\x20%s,\x20%s',_0x480cd6,'request\x20sent');logger[_0x7f27('0xd')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x480cd6,_0x7f27('0xe'),JSON[_0x7f27('0xf')](_0x8ecc84));if(_0x8ecc84[_0x7f27('0x10')]){if(_0x8ecc84[_0x7f27('0x10')][_0x7f27('0x11')]===0x1f4){logger[_0x7f27('0x10')]('CloudProvider,\x20%s,\x20%s',_0x480cd6,_0x8ecc84[_0x7f27('0x10')][_0x7f27('0x12')]);return _0x5c0dbb(_0x8ecc84['error'][_0x7f27('0x12')]);}logger[_0x7f27('0x10')](_0x7f27('0x13'),_0x480cd6,_0x8ecc84[_0x7f27('0x10')][_0x7f27('0x12')]);return _0x25c4dc(_0x8ecc84[_0x7f27('0x10')][_0x7f27('0x12')]);}else{logger[_0x7f27('0xc')]('CloudProvider,\x20%s,\x20%s',_0x480cd6,_0x7f27('0xe'));_0x25c4dc(_0x8ecc84[_0x7f27('0x14')]['message']);}})[_0x7f27('0x15')](function(_0x402610){logger['error'](_0x7f27('0x13'),_0x480cd6,_0x402610);_0x5c0dbb(_0x402610);});});}
\ No newline at end of file
index 7fd641a..0f4035d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x7a54,0x106));var _0x47a5=function(_0x53564e,_0x126614){_0x53564e=_0x53564e-0x0;var _0x3d35d6=_0x7a54[_0x53564e];return _0x3d35d6;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router;
\ No newline at end of file
+var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x35887e,_0x23922c){var _0x285cb0=function(_0x59ab61){while(--_0x59ab61){_0x35887e['push'](_0x35887e['shift']());}};_0x285cb0(++_0x23922c);}(_0xadb5,0xad));var _0x5adb=function(_0x23cf1f,_0x5241a3){_0x23cf1f=_0x23cf1f-0x0;var _0x2158dd=_0xadb5[_0x23cf1f];return _0x2158dd;};'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['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router;
\ No newline at end of file
index 233d842..b2f26ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f08=['exports','name','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5f08,0x138));var _0x85f0=function(_0x2857d9,_0x93afd9){_0x2857d9=_0x2857d9-0x0;var _0x54a427=_0x5f08[_0x2857d9];return _0x54a427;};'use strict';var Sequelize=require('sequelize');module[_0x85f0('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x85f0('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x85f0('0x2')]},'companyId':{'type':Sequelize[_0x85f0('0x2')]},'website':{'type':Sequelize[_0x85f0('0x2')]},'phone':{'type':Sequelize[_0x85f0('0x2')]},'fax':{'type':Sequelize[_0x85f0('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x85f0('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x85f0('0x2')]},'sPostalCode':{'type':Sequelize[_0x85f0('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xe7de=['sequelize','exports','name','STRING'];(function(_0x59145c,_0x94d69a){var _0x4651d0=function(_0x5705b1){while(--_0x5705b1){_0x59145c['push'](_0x59145c['shift']());}};_0x4651d0(++_0x94d69a);}(_0xe7de,0xdc));var _0xee7d=function(_0x58597c,_0x401aaa){_0x58597c=_0x58597c-0x0;var _0x42c6b2=_0xe7de[_0x58597c];return _0x42c6b2;};'use strict';var Sequelize=require(_0xee7d('0x0'));module[_0xee7d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xee7d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xee7d('0x3')]},'companyId':{'type':Sequelize[_0xee7d('0x3')]},'website':{'type':Sequelize[_0xee7d('0x3')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xee7d('0x3')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xee7d('0x3')]},'city':{'type':Sequelize[_0xee7d('0x3')]},'country':{'type':Sequelize[_0xee7d('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xee7d('0x3')]},'sStreet':{'type':Sequelize[_0xee7d('0x3')]},'sPostalCode':{'type':Sequelize[_0xee7d('0x3')]},'sCity':{'type':Sequelize[_0xee7d('0x3')]},'sCountry':{'type':Sequelize[_0xee7d('0x3')]},'description':{'type':Sequelize[_0xee7d('0x3')]}};
\ No newline at end of file
index d585e50..94a062e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe733=['set','apply','save','update','destroy','get','UserProfileResource','then','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','findAll','catch','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Companies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContact','addContacts','ids','omit','getContacts','findOne','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count'];(function(_0xb15971,_0x839878){var _0x1ec56d=function(_0x3764b0){while(--_0x3764b0){_0xb15971['push'](_0xb15971['shift']());}};_0x1ec56d(++_0x839878);}(_0xe733,0x1e1));var _0x3e73=function(_0xd3a254,_0x3b20d3){_0xd3a254=_0xd3a254-0x0;var _0x2dd3dd=_0xe733[_0xd3a254];return _0x2dd3dd;};'use strict';var emlformat=require(_0x3e73('0x0'));var rimraf=require(_0x3e73('0x1'));var zipdir=require(_0x3e73('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3e73('0x3'));var moment=require(_0x3e73('0x4'));var BPromise=require(_0x3e73('0x5'));var Mustache=require(_0x3e73('0x6'));var util=require('util');var path=require(_0x3e73('0x7'));var sox=require('sox');var csv=require(_0x3e73('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3e73('0x9'));var squel=require('squel');var crypto=require(_0x3e73('0xa'));var jsforce=require(_0x3e73('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3e73('0xc'));var Papa=require('papaparse');var Redis=require(_0x3e73('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x3e73('0xe'));var as=require(_0x3e73('0xf'));var hardwareService=require(_0x3e73('0x10'));var logger=require(_0x3e73('0x11'))(_0x3e73('0x12'));var utils=require(_0x3e73('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3e73('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbddf,_0x379c6c){_0x379c6c=_0x379c6c||0xcc;return function(_0x2f3f58){if(_0x2f3f58){return _0x4cbddf[_0x3e73('0x15')](_0x379c6c);}return _0x4cbddf[_0x3e73('0x16')](_0x379c6c)[_0x3e73('0x17')]();};}function respondWithResult(_0x5ea485,_0x4f8d44){_0x4f8d44=_0x4f8d44||0xc8;return function(_0x419fd8){if(_0x419fd8){return _0x5ea485[_0x3e73('0x16')](_0x4f8d44)[_0x3e73('0x18')](_0x419fd8);}};}function respondWithFilteredResult(_0x35bfc5,_0xc5d0e9){return function(_0x112b8c){if(_0x112b8c){var _0x161fe7=typeof _0xc5d0e9[_0x3e73('0x19')]==='undefined'&&typeof _0xc5d0e9[_0x3e73('0x1a')]===_0x3e73('0x1b');var _0x59d197=_0x112b8c[_0x3e73('0x1c')];var _0x61da7f=_0x161fe7?0x0:_0xc5d0e9[_0x3e73('0x19')];var _0x6a0b9=_0x161fe7?_0x112b8c[_0x3e73('0x1c')]:_0xc5d0e9[_0x3e73('0x19')]+_0xc5d0e9[_0x3e73('0x1a')];var _0x569f92;if(_0x6a0b9>=_0x59d197){_0x6a0b9=_0x59d197;_0x569f92=0xc8;}else{_0x569f92=0xce;}_0x35bfc5[_0x3e73('0x16')](_0x569f92);return _0x35bfc5[_0x3e73('0x1d')]('Content-Range',_0x61da7f+'-'+_0x6a0b9+'/'+_0x59d197)['json'](_0x112b8c);}return null;};}function patchUpdates(_0x11ad4c){return function(_0x4368a6){try{jsonpatch[_0x3e73('0x1e')](_0x4368a6,_0x11ad4c,!![]);}catch(_0x4e56df){return BPromise['reject'](_0x4e56df);}return _0x4368a6[_0x3e73('0x1f')]();};}function saveUpdates(_0x3858fe,_0x268c5e){return function(_0x3ea07c){if(_0x3ea07c){return _0x3ea07c[_0x3e73('0x20')](_0x3858fe)['then'](function(_0x4fb919){return _0x4fb919;});}return null;};}function removeEntity(_0x2b8e71,_0x2c5f3b){return function(_0x4f6c58){if(_0x4f6c58){return _0x4f6c58[_0x3e73('0x21')]()['then'](function(){var _0x198fdb=_0x4f6c58[_0x3e73('0x22')]({'plain':!![]});var _0x3a8327='Companies';return db[_0x3e73('0x23')][_0x3e73('0x21')]({'where':{'type':_0x3a8327,'resourceId':_0x198fdb['id']}})[_0x3e73('0x24')](function(){return _0x4f6c58;});})[_0x3e73('0x24')](function(){_0x2b8e71[_0x3e73('0x16')](0xcc)[_0x3e73('0x17')]();});}};}function handleEntityNotFound(_0x18de42,_0x4f7572){return function(_0x4e83a3){if(!_0x4e83a3){_0x18de42['sendStatus'](0x194);}return _0x4e83a3;};}function handleError(_0x140be0,_0x57f408){_0x57f408=_0x57f408||0x1f4;return function(_0xa24f05){logger[_0x3e73('0x25')](_0xa24f05[_0x3e73('0x26')]);if(_0xa24f05[_0x3e73('0x27')]){delete _0xa24f05[_0x3e73('0x27')];}_0x140be0[_0x3e73('0x16')](_0x57f408)[_0x3e73('0x28')](_0xa24f05);};}exports[_0x3e73('0x29')]=function(_0x4e9914,_0x5dc4a6){var _0x1aea96={},_0x410049={},_0x331b47={'count':0x0,'rows':[]};return db[_0x3e73('0x2a')][_0x3e73('0x2b')]()[_0x3e73('0x24')](function(_0x15ca5f){_0x410049[_0x3e73('0x2c')]=_[_0x3e73('0x2d')](_0x15ca5f);_0x410049['query']=_['keys'](_0x4e9914[_0x3e73('0x2e')]);_0x410049[_0x3e73('0x2f')]=_['intersection'](_0x410049[_0x3e73('0x2c')],_0x410049[_0x3e73('0x2e')]);_0x1aea96[_0x3e73('0x30')]=_[_0x3e73('0x31')](_0x410049[_0x3e73('0x2c')],qs['fields'](_0x4e9914[_0x3e73('0x2e')][_0x3e73('0x32')]));_0x1aea96[_0x3e73('0x30')]=_0x1aea96[_0x3e73('0x30')][_0x3e73('0x33')]?_0x1aea96['attributes']:_0x410049[_0x3e73('0x2c')];if(!_0x4e9914[_0x3e73('0x2e')][_0x3e73('0x34')](_0x3e73('0x35'))){_0x1aea96['limit']=qs[_0x3e73('0x1a')](_0x4e9914['query'][_0x3e73('0x1a')]);_0x1aea96['offset']=qs['offset'](_0x4e9914['query'][_0x3e73('0x19')]);}_0x1aea96[_0x3e73('0x36')]=qs['sort'](_0x4e9914[_0x3e73('0x2e')][_0x3e73('0x37')]);_0x1aea96[_0x3e73('0x38')]=qs[_0x3e73('0x2f')](_[_0x3e73('0x39')](_0x4e9914['query'],_0x410049[_0x3e73('0x2f')]),_0x15ca5f);if(_0x4e9914[_0x3e73('0x2e')][_0x3e73('0x3a')]){_0x1aea96[_0x3e73('0x38')]=_[_0x3e73('0x3b')](_0x1aea96['where'],{'$or':_[_0x3e73('0x3c')](_0x1aea96['attributes'],function(_0x37cff8){var _0x5f2940={};_0x5f2940[_0x37cff8]={'$like':'%'+_0x4e9914[_0x3e73('0x2e')][_0x3e73('0x3a')]+'%'};return _0x5f2940;})});}_0x1aea96=_['merge']({},_0x1aea96,_0x4e9914[_0x3e73('0x3d')]);var _0x31fd2c={'where':_0x1aea96[_0x3e73('0x38')]};return db['CmCompany'][_0x3e73('0x1c')](_0x31fd2c)[_0x3e73('0x24')](function(_0x59b52e){_0x331b47[_0x3e73('0x1c')]=_0x59b52e;if(_0x4e9914[_0x3e73('0x2e')][_0x3e73('0x3e')]){_0x1aea96['include']=[{'all':!![]}];}return db[_0x3e73('0x2a')][_0x3e73('0x3f')](_0x1aea96);})[_0x3e73('0x24')](function(_0x289677){_0x331b47['rows']=_0x289677;return _0x331b47;})[_0x3e73('0x24')](respondWithFilteredResult(_0x5dc4a6,_0x1aea96))[_0x3e73('0x40')](handleError(_0x5dc4a6,null));})[_0x3e73('0x40')](handleError(_0x5dc4a6,null));};exports[_0x3e73('0x41')]=function(_0x1d6527,_0x2e16a7){var _0x3651d1={'raw':![],'where':{'id':_0x1d6527[_0x3e73('0x42')]['id']}},_0xfd9871={};_0xfd9871[_0x3e73('0x2c')]=_[_0x3e73('0x2d')](db['CmCompany'][_0x3e73('0x43')]);_0xfd9871[_0x3e73('0x2e')]=_[_0x3e73('0x2d')](_0x1d6527['query']);_0xfd9871[_0x3e73('0x2f')]=_[_0x3e73('0x31')](_0xfd9871[_0x3e73('0x2c')],_0xfd9871[_0x3e73('0x2e')]);_0x3651d1['attributes']=_['intersection'](_0xfd9871[_0x3e73('0x2c')],qs[_0x3e73('0x32')](_0x1d6527[_0x3e73('0x2e')][_0x3e73('0x32')]));_0x3651d1[_0x3e73('0x30')]=_0x3651d1['attributes'][_0x3e73('0x33')]?_0x3651d1[_0x3e73('0x30')]:_0xfd9871[_0x3e73('0x2c')];if(_0x1d6527[_0x3e73('0x2e')][_0x3e73('0x3e')]){_0x3651d1['include']=[{'all':!![]}];}_0x3651d1=_[_0x3e73('0x3b')]({},_0x3651d1,_0x1d6527['options']);return db[_0x3e73('0x2a')][_0x3e73('0x44')](_0x3651d1)[_0x3e73('0x24')](handleEntityNotFound(_0x2e16a7,null))[_0x3e73('0x24')](respondWithResult(_0x2e16a7,null))[_0x3e73('0x40')](handleError(_0x2e16a7,null));};exports[_0x3e73('0x45')]=function(_0x1c7ace,_0x596aa6){return db['CmCompany'][_0x3e73('0x45')](_0x1c7ace[_0x3e73('0x46')],{})['then'](function(_0x4fd38e){var _0x4bb59f=_0x1c7ace['user'][_0x3e73('0x22')]({'plain':!![]});if(!_0x4bb59f)throw new Error(_0x3e73('0x47'));if(_0x4bb59f[_0x3e73('0x48')]===_0x3e73('0x49')){var _0x5e4d48=_0x4fd38e[_0x3e73('0x22')]({'plain':!![]});var _0x54437e=_0x3e73('0x4a');return db[_0x3e73('0x4b')][_0x3e73('0x44')]({'where':{'name':_0x54437e,'userProfileId':_0x4bb59f[_0x3e73('0x4c')]},'raw':!![]})[_0x3e73('0x24')](function(_0xf270a6){if(_0xf270a6&&_0xf270a6[_0x3e73('0x4d')]===0x0){return db[_0x3e73('0x23')]['create']({'name':_0x5e4d48[_0x3e73('0x27')],'resourceId':_0x5e4d48['id'],'type':_0xf270a6['name'],'sectionId':_0xf270a6['id']},{})['then'](function(){return _0x4fd38e;});}else{return _0x4fd38e;}})['catch'](function(_0x56502d){logger['error'](_0x3e73('0x4e'),_0x56502d);throw _0x56502d;});}return _0x4fd38e;})[_0x3e73('0x24')](respondWithResult(_0x596aa6,0xc9))[_0x3e73('0x40')](handleError(_0x596aa6,null));};exports[_0x3e73('0x20')]=function(_0x3d2849,_0x4e412b){if(_0x3d2849['body']['id']){delete _0x3d2849[_0x3e73('0x46')]['id'];}return db[_0x3e73('0x2a')][_0x3e73('0x44')]({'where':{'id':_0x3d2849[_0x3e73('0x42')]['id']}})[_0x3e73('0x24')](handleEntityNotFound(_0x4e412b,null))[_0x3e73('0x24')](saveUpdates(_0x3d2849[_0x3e73('0x46')],null))[_0x3e73('0x24')](respondWithResult(_0x4e412b,null))[_0x3e73('0x40')](handleError(_0x4e412b,null));};exports['destroy']=function(_0x318262,_0x4e0cf9){return db['CmCompany']['find']({'where':{'id':_0x318262[_0x3e73('0x42')]['id']}})[_0x3e73('0x24')](handleEntityNotFound(_0x4e0cf9,null))[_0x3e73('0x24')](removeEntity(_0x4e0cf9,null))['catch'](handleError(_0x4e0cf9,null));};exports[_0x3e73('0x2b')]=function(_0x4c4472,_0x278332){return db[_0x3e73('0x2a')][_0x3e73('0x2b')]()['then'](respondWithResult(_0x278332,null))['catch'](handleError(_0x278332,null));};exports['addContacts']=function(_0xc21e59,_0x76c39f,_0x3ae5c5){return db[_0x3e73('0x4f')]['find']({'where':{'id':_0xc21e59[_0x3e73('0x42')]['id']}})[_0x3e73('0x24')](handleEntityNotFound(_0x76c39f,null))['then'](function(_0x20aa6f){if(_0x20aa6f){return _0x20aa6f[_0x3e73('0x50')](_0xc21e59['body'][_0x3e73('0x51')],_[_0x3e73('0x52')](_0xc21e59[_0x3e73('0x46')],[_0x3e73('0x51'),'id'])||{});}})[_0x3e73('0x24')](respondWithResult(_0x76c39f,null))[_0x3e73('0x40')](handleError(_0x76c39f,null));};exports[_0x3e73('0x53')]=function(_0x3ac4ff,_0x5cb54b,_0x33a7ca){var _0xb81a1e={};var _0x1cd794={};var _0x134514;var _0x835343;return db[_0x3e73('0x2a')][_0x3e73('0x54')]({'where':{'id':_0x3ac4ff[_0x3e73('0x42')]['id']}})[_0x3e73('0x24')](handleEntityNotFound(_0x5cb54b,null))[_0x3e73('0x24')](function(_0x3fedb9){if(_0x3fedb9){_0x134514=_0x3fedb9;_0x1cd794[_0x3e73('0x2c')]=_['keys'](db['CmContact'][_0x3e73('0x43')]);_0x1cd794[_0x3e73('0x2e')]=_['keys'](_0x3ac4ff[_0x3e73('0x2e')]);_0x1cd794[_0x3e73('0x2f')]=_['intersection'](_0x1cd794[_0x3e73('0x2c')],_0x1cd794['query']);_0xb81a1e[_0x3e73('0x30')]=_[_0x3e73('0x31')](_0x1cd794['model'],qs[_0x3e73('0x32')](_0x3ac4ff[_0x3e73('0x2e')][_0x3e73('0x32')]));_0xb81a1e['attributes']=_0xb81a1e[_0x3e73('0x30')][_0x3e73('0x33')]?_0xb81a1e[_0x3e73('0x30')]:_0x1cd794[_0x3e73('0x2c')];_0xb81a1e['order']=qs['sort'](_0x3ac4ff[_0x3e73('0x2e')][_0x3e73('0x37')]);_0xb81a1e['where']=qs[_0x3e73('0x2f')](_[_0x3e73('0x39')](_0x3ac4ff['query'],_0x1cd794[_0x3e73('0x2f')]));if(_0x3ac4ff[_0x3e73('0x2e')]['filter']){_0xb81a1e[_0x3e73('0x38')]=_['merge'](_0xb81a1e[_0x3e73('0x38')],{'$or':_[_0x3e73('0x3c')](_0xb81a1e[_0x3e73('0x30')],function(_0x1849db){var _0x11eb7f={};_0x11eb7f[_0x1849db]={'$like':'%'+_0x3ac4ff[_0x3e73('0x2e')][_0x3e73('0x3a')]+'%'};return _0x11eb7f;})});}_0xb81a1e=_[_0x3e73('0x3b')]({},_0xb81a1e,_0x3ac4ff['options']);return _0x134514[_0x3e73('0x53')](_0xb81a1e);}})['then'](function(_0x1b0ba6){if(_0x1b0ba6){_0x835343=_0x1b0ba6['length'];if(!_0x3ac4ff[_0x3e73('0x2e')][_0x3e73('0x34')](_0x3e73('0x35'))){_0xb81a1e['limit']=qs['limit'](_0x3ac4ff[_0x3e73('0x2e')]['limit']);_0xb81a1e['offset']=qs[_0x3e73('0x19')](_0x3ac4ff[_0x3e73('0x2e')][_0x3e73('0x19')]);}return _0x134514[_0x3e73('0x53')](_0xb81a1e);}})[_0x3e73('0x24')](function(_0x1235fd){if(_0x1235fd){return _0x1235fd?{'count':_0x835343,'rows':_0x1235fd}:null;}})[_0x3e73('0x24')](respondWithResult(_0x5cb54b,null))[_0x3e73('0x40')](handleError(_0x5cb54b,null));};
\ No newline at end of file
+var _0x0ac6=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','body','addContacts','ids','getContacts','eml-format','fast-json-patch','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','Companies','UserProfileResource','stack','name','send','CmCompany','describe','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','filters','find','create','user','get'];(function(_0x270a62,_0x5610cc){var _0x573606=function(_0x567c2a){while(--_0x567c2a){_0x270a62['push'](_0x270a62['shift']());}};_0x573606(++_0x5610cc);}(_0x0ac6,0xff));var _0x60ac=function(_0x2280ea,_0x295bc7){_0x2280ea=_0x2280ea-0x0;var _0x4e5f8b=_0x0ac6[_0x2280ea];return _0x4e5f8b;};'use strict';var emlformat=require(_0x60ac('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x60ac('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x60ac('0x2'));var Mustache=require(_0x60ac('0x3'));var util=require(_0x60ac('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x60ac('0x5'));var ejs=require(_0x60ac('0x6'));var fs=require('fs');var fs_extra=require(_0x60ac('0x7'));var _=require(_0x60ac('0x8'));var squel=require(_0x60ac('0x9'));var crypto=require('crypto');var jsforce=require(_0x60ac('0xa'));var deskjs=require(_0x60ac('0xb'));var toCsv=require(_0x60ac('0x5'));var querystring=require(_0x60ac('0xc'));var Papa=require(_0x60ac('0xd'));var Redis=require(_0x60ac('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x60ac('0xf'));var as=require(_0x60ac('0x10'));var hardwareService=require(_0x60ac('0x11'));var logger=require(_0x60ac('0x12'))('api');var utils=require(_0x60ac('0x13'));var config=require(_0x60ac('0x14'));var licenseUtil=require(_0x60ac('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x243b80,_0x589e73){_0x589e73=_0x589e73||0xcc;return function(_0x1492df){if(_0x1492df){return _0x243b80[_0x60ac('0x16')](_0x589e73);}return _0x243b80[_0x60ac('0x17')](_0x589e73)[_0x60ac('0x18')]();};}function respondWithResult(_0x571cf7,_0x344987){_0x344987=_0x344987||0xc8;return function(_0x5164bb){if(_0x5164bb){return _0x571cf7[_0x60ac('0x17')](_0x344987)[_0x60ac('0x19')](_0x5164bb);}};}function respondWithFilteredResult(_0x250925,_0x4389f7){return function(_0x23c918){if(_0x23c918){var _0x2e366e=typeof _0x4389f7[_0x60ac('0x1a')]===_0x60ac('0x1b')&&typeof _0x4389f7[_0x60ac('0x1c')]===_0x60ac('0x1b');var _0x3ed5cd=_0x23c918[_0x60ac('0x1d')];var _0x2495b9=_0x2e366e?0x0:_0x4389f7[_0x60ac('0x1a')];var _0x394b5b=_0x2e366e?_0x23c918[_0x60ac('0x1d')]:_0x4389f7[_0x60ac('0x1a')]+_0x4389f7[_0x60ac('0x1c')];var _0x574289;if(_0x394b5b>=_0x3ed5cd){_0x394b5b=_0x3ed5cd;_0x574289=0xc8;}else{_0x574289=0xce;}_0x250925[_0x60ac('0x17')](_0x574289);return _0x250925[_0x60ac('0x1e')]('Content-Range',_0x2495b9+'-'+_0x394b5b+'/'+_0x3ed5cd)['json'](_0x23c918);}return null;};}function patchUpdates(_0x1d2ca1){return function(_0x594d12){try{jsonpatch[_0x60ac('0x1f')](_0x594d12,_0x1d2ca1,!![]);}catch(_0x5be7d0){return BPromise[_0x60ac('0x20')](_0x5be7d0);}return _0x594d12[_0x60ac('0x21')]();};}function saveUpdates(_0x5e321b,_0x501fca){return function(_0x38a1ba){if(_0x38a1ba){return _0x38a1ba[_0x60ac('0x22')](_0x5e321b)['then'](function(_0x433d23){return _0x433d23;});}return null;};}function removeEntity(_0x4db2ff,_0x252523){return function(_0x2cba86){if(_0x2cba86){return _0x2cba86[_0x60ac('0x23')]()[_0x60ac('0x24')](function(){var _0x32e5b9=_0x2cba86['get']({'plain':!![]});var _0x234b0f=_0x60ac('0x25');return db[_0x60ac('0x26')][_0x60ac('0x23')]({'where':{'type':_0x234b0f,'resourceId':_0x32e5b9['id']}})[_0x60ac('0x24')](function(){return _0x2cba86;});})[_0x60ac('0x24')](function(){_0x4db2ff['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x477c5b,_0x6ed4e5){return function(_0x247c07){if(!_0x247c07){_0x477c5b[_0x60ac('0x16')](0x194);}return _0x247c07;};}function handleError(_0x3a1f1e,_0x3a8b0d){_0x3a8b0d=_0x3a8b0d||0x1f4;return function(_0x1f7bc8){logger['error'](_0x1f7bc8[_0x60ac('0x27')]);if(_0x1f7bc8[_0x60ac('0x28')]){delete _0x1f7bc8[_0x60ac('0x28')];}_0x3a1f1e[_0x60ac('0x17')](_0x3a8b0d)[_0x60ac('0x29')](_0x1f7bc8);};}exports['index']=function(_0xa5e1e6,_0x114fcd){var _0x160e9e={},_0x436104={},_0x265a73={'count':0x0,'rows':[]};return db[_0x60ac('0x2a')][_0x60ac('0x2b')]()[_0x60ac('0x24')](function(_0x56eed4){_0x436104['model']=_[_0x60ac('0x2c')](_0x56eed4);_0x436104['query']=_[_0x60ac('0x2c')](_0xa5e1e6[_0x60ac('0x2d')]);_0x436104['filters']=_[_0x60ac('0x2e')](_0x436104[_0x60ac('0x2f')],_0x436104['query']);_0x160e9e[_0x60ac('0x30')]=_['intersection'](_0x436104[_0x60ac('0x2f')],qs['fields'](_0xa5e1e6[_0x60ac('0x2d')][_0x60ac('0x31')]));_0x160e9e['attributes']=_0x160e9e['attributes'][_0x60ac('0x32')]?_0x160e9e[_0x60ac('0x30')]:_0x436104['model'];if(!_0xa5e1e6[_0x60ac('0x2d')][_0x60ac('0x33')](_0x60ac('0x34'))){_0x160e9e[_0x60ac('0x1c')]=qs[_0x60ac('0x1c')](_0xa5e1e6['query'][_0x60ac('0x1c')]);_0x160e9e[_0x60ac('0x1a')]=qs[_0x60ac('0x1a')](_0xa5e1e6[_0x60ac('0x2d')][_0x60ac('0x1a')]);}_0x160e9e['order']=qs[_0x60ac('0x35')](_0xa5e1e6[_0x60ac('0x2d')]['sort']);_0x160e9e[_0x60ac('0x36')]=qs['filters'](_[_0x60ac('0x37')](_0xa5e1e6[_0x60ac('0x2d')],_0x436104['filters']),_0x56eed4);if(_0xa5e1e6[_0x60ac('0x2d')]['filter']){_0x160e9e[_0x60ac('0x36')]=_[_0x60ac('0x38')](_0x160e9e['where'],{'$or':_[_0x60ac('0x39')](_0x160e9e['attributes'],function(_0x5abab4){var _0x448bed={};_0x448bed[_0x5abab4]={'$like':'%'+_0xa5e1e6[_0x60ac('0x2d')][_0x60ac('0x3a')]+'%'};return _0x448bed;})});}_0x160e9e=_[_0x60ac('0x38')]({},_0x160e9e,_0xa5e1e6[_0x60ac('0x3b')]);var _0x2783d2={'where':_0x160e9e[_0x60ac('0x36')]};return db[_0x60ac('0x2a')][_0x60ac('0x1d')](_0x2783d2)[_0x60ac('0x24')](function(_0x2efebf){_0x265a73[_0x60ac('0x1d')]=_0x2efebf;if(_0xa5e1e6[_0x60ac('0x2d')][_0x60ac('0x3c')]){_0x160e9e[_0x60ac('0x3d')]=[{'all':!![]}];}return db[_0x60ac('0x2a')][_0x60ac('0x3e')](_0x160e9e);})['then'](function(_0x46eee2){_0x265a73[_0x60ac('0x3f')]=_0x46eee2;return _0x265a73;})[_0x60ac('0x24')](respondWithFilteredResult(_0x114fcd,_0x160e9e))[_0x60ac('0x40')](handleError(_0x114fcd,null));})['catch'](handleError(_0x114fcd,null));};exports[_0x60ac('0x41')]=function(_0x361420,_0x9c4f80){var _0x9a40bc={'raw':![],'where':{'id':_0x361420[_0x60ac('0x42')]['id']}},_0x3f8a20={};_0x3f8a20[_0x60ac('0x2f')]=_['keys'](db[_0x60ac('0x2a')][_0x60ac('0x43')]);_0x3f8a20[_0x60ac('0x2d')]=_[_0x60ac('0x2c')](_0x361420['query']);_0x3f8a20[_0x60ac('0x44')]=_['intersection'](_0x3f8a20['model'],_0x3f8a20[_0x60ac('0x2d')]);_0x9a40bc[_0x60ac('0x30')]=_[_0x60ac('0x2e')](_0x3f8a20[_0x60ac('0x2f')],qs[_0x60ac('0x31')](_0x361420[_0x60ac('0x2d')][_0x60ac('0x31')]));_0x9a40bc['attributes']=_0x9a40bc['attributes'][_0x60ac('0x32')]?_0x9a40bc[_0x60ac('0x30')]:_0x3f8a20[_0x60ac('0x2f')];if(_0x361420[_0x60ac('0x2d')][_0x60ac('0x3c')]){_0x9a40bc['include']=[{'all':!![]}];}_0x9a40bc=_[_0x60ac('0x38')]({},_0x9a40bc,_0x361420[_0x60ac('0x3b')]);return db[_0x60ac('0x2a')][_0x60ac('0x45')](_0x9a40bc)[_0x60ac('0x24')](handleEntityNotFound(_0x9c4f80,null))['then'](respondWithResult(_0x9c4f80,null))[_0x60ac('0x40')](handleError(_0x9c4f80,null));};exports[_0x60ac('0x46')]=function(_0x44077a,_0x2eb0a0){return db['CmCompany'][_0x60ac('0x46')](_0x44077a['body'],{})[_0x60ac('0x24')](function(_0x25a06b){var _0x141b5b=_0x44077a[_0x60ac('0x47')][_0x60ac('0x48')]({'plain':!![]});if(!_0x141b5b)throw new Error(_0x60ac('0x49'));if(_0x141b5b[_0x60ac('0x4a')]==='user'){var _0x113a94=_0x25a06b[_0x60ac('0x48')]({'plain':!![]});var _0xab07e=_0x60ac('0x25');return db[_0x60ac('0x4b')][_0x60ac('0x45')]({'where':{'name':_0xab07e,'userProfileId':_0x141b5b[_0x60ac('0x4c')]},'raw':!![]})['then'](function(_0x710a38){if(_0x710a38&&_0x710a38['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x113a94[_0x60ac('0x28')],'resourceId':_0x113a94['id'],'type':_0x710a38[_0x60ac('0x28')],'sectionId':_0x710a38['id']},{})[_0x60ac('0x24')](function(){return _0x25a06b;});}else{return _0x25a06b;}})[_0x60ac('0x40')](function(_0x5eb128){logger[_0x60ac('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5eb128);throw _0x5eb128;});}return _0x25a06b;})[_0x60ac('0x24')](respondWithResult(_0x2eb0a0,0xc9))[_0x60ac('0x40')](handleError(_0x2eb0a0,null));};exports[_0x60ac('0x22')]=function(_0x1fa407,_0x4bb6a3){if(_0x1fa407[_0x60ac('0x4e')]['id']){delete _0x1fa407[_0x60ac('0x4e')]['id'];}return db[_0x60ac('0x2a')][_0x60ac('0x45')]({'where':{'id':_0x1fa407['params']['id']}})[_0x60ac('0x24')](handleEntityNotFound(_0x4bb6a3,null))[_0x60ac('0x24')](saveUpdates(_0x1fa407[_0x60ac('0x4e')],null))[_0x60ac('0x24')](respondWithResult(_0x4bb6a3,null))[_0x60ac('0x40')](handleError(_0x4bb6a3,null));};exports['destroy']=function(_0x57a50d,_0x225310){return db[_0x60ac('0x2a')]['find']({'where':{'id':_0x57a50d[_0x60ac('0x42')]['id']}})[_0x60ac('0x24')](handleEntityNotFound(_0x225310,null))['then'](removeEntity(_0x225310,null))[_0x60ac('0x40')](handleError(_0x225310,null));};exports[_0x60ac('0x2b')]=function(_0x163e67,_0x12c4c2){return db['CmCompany']['describe']()[_0x60ac('0x24')](respondWithResult(_0x12c4c2,null))[_0x60ac('0x40')](handleError(_0x12c4c2,null));};exports[_0x60ac('0x4f')]=function(_0x5a0c53,_0x1a629b,_0x2d0da0){return db['CmContact']['find']({'where':{'id':_0x5a0c53['params']['id']}})[_0x60ac('0x24')](handleEntityNotFound(_0x1a629b,null))[_0x60ac('0x24')](function(_0x54e7a9){if(_0x54e7a9){return _0x54e7a9['addContacts'](_0x5a0c53[_0x60ac('0x4e')][_0x60ac('0x50')],_['omit'](_0x5a0c53[_0x60ac('0x4e')],[_0x60ac('0x50'),'id'])||{});}})[_0x60ac('0x24')](respondWithResult(_0x1a629b,null))[_0x60ac('0x40')](handleError(_0x1a629b,null));};exports[_0x60ac('0x51')]=function(_0x5308f1,_0x502fff,_0x29e7f9){var _0x5b47e0={};var _0x568fec={};var _0x15062c;var _0x1e38ba;return db[_0x60ac('0x2a')]['findOne']({'where':{'id':_0x5308f1[_0x60ac('0x42')]['id']}})[_0x60ac('0x24')](handleEntityNotFound(_0x502fff,null))[_0x60ac('0x24')](function(_0x4066c5){if(_0x4066c5){_0x15062c=_0x4066c5;_0x568fec[_0x60ac('0x2f')]=_[_0x60ac('0x2c')](db['CmContact'][_0x60ac('0x43')]);_0x568fec['query']=_[_0x60ac('0x2c')](_0x5308f1['query']);_0x568fec[_0x60ac('0x44')]=_[_0x60ac('0x2e')](_0x568fec[_0x60ac('0x2f')],_0x568fec['query']);_0x5b47e0[_0x60ac('0x30')]=_['intersection'](_0x568fec['model'],qs[_0x60ac('0x31')](_0x5308f1['query'][_0x60ac('0x31')]));_0x5b47e0[_0x60ac('0x30')]=_0x5b47e0['attributes']['length']?_0x5b47e0[_0x60ac('0x30')]:_0x568fec[_0x60ac('0x2f')];_0x5b47e0['order']=qs['sort'](_0x5308f1[_0x60ac('0x2d')][_0x60ac('0x35')]);_0x5b47e0['where']=qs['filters'](_[_0x60ac('0x37')](_0x5308f1['query'],_0x568fec[_0x60ac('0x44')]));if(_0x5308f1[_0x60ac('0x2d')][_0x60ac('0x3a')]){_0x5b47e0['where']=_[_0x60ac('0x38')](_0x5b47e0[_0x60ac('0x36')],{'$or':_[_0x60ac('0x39')](_0x5b47e0[_0x60ac('0x30')],function(_0xbeddbc){var _0x44dd00={};_0x44dd00[_0xbeddbc]={'$like':'%'+_0x5308f1[_0x60ac('0x2d')]['filter']+'%'};return _0x44dd00;})});}_0x5b47e0=_[_0x60ac('0x38')]({},_0x5b47e0,_0x5308f1[_0x60ac('0x3b')]);return _0x15062c[_0x60ac('0x51')](_0x5b47e0);}})[_0x60ac('0x24')](function(_0x37fddf){if(_0x37fddf){_0x1e38ba=_0x37fddf[_0x60ac('0x32')];if(!_0x5308f1[_0x60ac('0x2d')][_0x60ac('0x33')](_0x60ac('0x34'))){_0x5b47e0[_0x60ac('0x1c')]=qs[_0x60ac('0x1c')](_0x5308f1[_0x60ac('0x2d')][_0x60ac('0x1c')]);_0x5b47e0[_0x60ac('0x1a')]=qs[_0x60ac('0x1a')](_0x5308f1[_0x60ac('0x2d')][_0x60ac('0x1a')]);}return _0x15062c[_0x60ac('0x51')](_0x5b47e0);}})[_0x60ac('0x24')](function(_0x4a228c){if(_0x4a228c){return _0x4a228c?{'count':_0x1e38ba,'rows':_0x4a228c}:null;}})['then'](respondWithResult(_0x502fff,null))['catch'](handleError(_0x502fff,null));};
\ No newline at end of file
index 290f032..cc79ee5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c83=['exports','define','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x12781,_0x5e49b5){var _0x5a88db=function(_0x35f86e){while(--_0x35f86e){_0x12781['push'](_0x12781['shift']());}};_0x5a88db(++_0x5e49b5);}(_0x4c83,0x1d1));var _0x34c8=function(_0x11b377,_0x2f7ccd){_0x11b377=_0x11b377-0x0;var _0x3f5e73=_0x4c83[_0x11b377];return _0x3f5e73;};'use strict';var _=require(_0x34c8('0x0'));var util=require(_0x34c8('0x1'));var logger=require(_0x34c8('0x2'))(_0x34c8('0x3'));var moment=require(_0x34c8('0x4'));var BPromise=require(_0x34c8('0x5'));var rp=require(_0x34c8('0x6'));var fs=require('fs');var path=require(_0x34c8('0x7'));var rimraf=require(_0x34c8('0x8'));var config=require(_0x34c8('0x9'));var attributes=require(_0x34c8('0xa'));module[_0x34c8('0xb')]=function(_0x5eaf6b,_0x221fc1){return _0x5eaf6b[_0x34c8('0xc')]('CmCompany',attributes,{'tableName':_0x34c8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8b53=['lodash','util','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','cm_companies'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x8b53,0x64));var _0x38b5=function(_0xc82cdd,_0x4a3b9e){_0xc82cdd=_0xc82cdd-0x0;var _0x2d851b=_0x8b53[_0xc82cdd];return _0x2d851b;};'use strict';var _=require(_0x38b5('0x0'));var util=require(_0x38b5('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x38b5('0x2'));var fs=require('fs');var path=require(_0x38b5('0x3'));var rimraf=require(_0x38b5('0x4'));var config=require(_0x38b5('0x5'));var attributes=require(_0x38b5('0x6'));module[_0x38b5('0x7')]=function(_0x31f9e2,_0x267310){return _0x31f9e2[_0x38b5('0x8')]('CmCompany',attributes,{'tableName':_0x38b5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 98574da..fe4e1b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd03a=['code','message','request\x20sent','result','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xd03a,0x17e));var _0xad03=function(_0x14977e,_0x18fb88){_0x14977e=_0x14977e-0x0;var _0x1892b8=_0xd03a[_0x14977e];return _0x1892b8;};'use strict';var _=require(_0xad03('0x0'));var util=require('util');var moment=require(_0xad03('0x1'));var BPromise=require(_0xad03('0x2'));var rs=require(_0xad03('0x3'));var fs=require('fs');var Redis=require(_0xad03('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xad03('0x5'))('rpc');var config=require(_0xad03('0x6'));var jayson=require(_0xad03('0x7'));var client=jayson['client'][_0xad03('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x50d301,_0x589c21,_0x24d557){return new BPromise(function(_0x4b5aa4,_0x47583b){return client[_0xad03('0x9')](_0x50d301,_0x24d557)[_0xad03('0xa')](function(_0x2452f5){logger[_0xad03('0xb')](_0xad03('0xc'),_0x589c21,'request\x20sent');logger[_0xad03('0xd')](_0xad03('0xe'),_0x589c21,'request\x20sent',JSON[_0xad03('0xf')](_0x2452f5));if(_0x2452f5[_0xad03('0x10')]){if(_0x2452f5[_0xad03('0x10')][_0xad03('0x11')]===0x1f4){logger[_0xad03('0x10')]('CmCompany,\x20%s,\x20%s',_0x589c21,_0x2452f5[_0xad03('0x10')][_0xad03('0x12')]);return _0x47583b(_0x2452f5['error'][_0xad03('0x12')]);}logger['error'](_0xad03('0xc'),_0x589c21,_0x2452f5['error'][_0xad03('0x12')]);return _0x4b5aa4(_0x2452f5['error']['message']);}else{logger[_0xad03('0xb')](_0xad03('0xc'),_0x589c21,_0xad03('0x13'));_0x4b5aa4(_0x2452f5[_0xad03('0x14')][_0xad03('0x12')]);}})['catch'](function(_0x43f79b){logger[_0xad03('0x10')](_0xad03('0xc'),_0x589c21,_0x43f79b);_0x47583b(_0x43f79b);});});}
\ No newline at end of file
+var _0x2c9f=['result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmCompany,\x20%s,\x20%s','request\x20sent'];(function(_0x10b6d9,_0xc31308){var _0x484bd7=function(_0x24eaf4){while(--_0x24eaf4){_0x10b6d9['push'](_0x10b6d9['shift']());}};_0x484bd7(++_0xc31308);}(_0x2c9f,0x95));var _0xf2c9=function(_0x28dc39,_0x31eef9){_0x28dc39=_0x28dc39-0x0;var _0x5d5d44=_0x2c9f[_0x28dc39];return _0x5d5d44;};'use strict';var _=require(_0xf2c9('0x0'));var util=require('util');var moment=require(_0xf2c9('0x1'));var BPromise=require(_0xf2c9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf2c9('0x3'));var db=require(_0xf2c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf2c9('0x5'));var config=require('../../config/environment');var jayson=require(_0xf2c9('0x6'));var client=jayson[_0xf2c9('0x7')][_0xf2c9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2440bd,_0x3e9d8f,_0x17f8f4){return new BPromise(function(_0x388b6d,_0x55555b){return client[_0xf2c9('0x9')](_0x2440bd,_0x17f8f4)[_0xf2c9('0xa')](function(_0x226e9c){logger[_0xf2c9('0xb')]('CmCompany,\x20%s,\x20%s',_0x3e9d8f,'request\x20sent');logger['debug'](_0xf2c9('0xc'),_0x3e9d8f,'request\x20sent',JSON[_0xf2c9('0xd')](_0x226e9c));if(_0x226e9c[_0xf2c9('0xe')]){if(_0x226e9c['error'][_0xf2c9('0xf')]===0x1f4){logger[_0xf2c9('0xe')]('CmCompany,\x20%s,\x20%s',_0x3e9d8f,_0x226e9c['error'][_0xf2c9('0x10')]);return _0x55555b(_0x226e9c[_0xf2c9('0xe')][_0xf2c9('0x10')]);}logger['error'](_0xf2c9('0x11'),_0x3e9d8f,_0x226e9c['error'][_0xf2c9('0x10')]);return _0x388b6d(_0x226e9c[_0xf2c9('0xe')][_0xf2c9('0x10')]);}else{logger[_0xf2c9('0xb')](_0xf2c9('0x11'),_0x3e9d8f,_0xf2c9('0x12'));_0x388b6d(_0x226e9c[_0xf2c9('0x13')][_0xf2c9('0x10')]);}})[_0xf2c9('0x14')](function(_0x5a91f3){logger[_0xf2c9('0xe')](_0xf2c9('0x11'),_0x3e9d8f,_0x5a91f3);_0x55555b(_0x5a91f3);});});}
\ No newline at end of file
index 222f2d5..8392250 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a38=['post','create','addContacts','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','get','show','/:id/contacts'];(function(_0x2b85c8,_0x560c38){var _0x50f2a3=function(_0x34d881){while(--_0x34d881){_0x2b85c8['push'](_0x2b85c8['shift']());}};_0x50f2a3(++_0x560c38);}(_0x2a38,0x1e8));var _0x82a3=function(_0x4226d6,_0x3864ca){_0x4226d6=_0x4226d6-0x0;var _0x19655b=_0x2a38[_0x4226d6];return _0x19655b;};'use strict';var multer=require('multer');var util=require(_0x82a3('0x0'));var path=require(_0x82a3('0x1'));var timeout=require(_0x82a3('0x2'));var express=require(_0x82a3('0x3'));var router=express[_0x82a3('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x82a3('0x5'));var config=require(_0x82a3('0x6'));var controller=require(_0x82a3('0x7'));router['get']('/',auth[_0x82a3('0x8')](),controller['index']);router['get']('/describe',auth[_0x82a3('0x8')](),controller['describe']);router[_0x82a3('0x9')]('/:id',auth[_0x82a3('0x8')](),controller[_0x82a3('0xa')]);router[_0x82a3('0x9')](_0x82a3('0xb'),auth[_0x82a3('0x8')](),controller['getContacts']);router[_0x82a3('0xc')]('/',auth[_0x82a3('0x8')](),controller[_0x82a3('0xd')]);router[_0x82a3('0xc')](_0x82a3('0xb'),auth[_0x82a3('0x8')](),controller[_0x82a3('0xe')]);router[_0x82a3('0xf')](_0x82a3('0x10'),auth[_0x82a3('0x8')](),controller[_0x82a3('0x11')]);router[_0x82a3('0x12')](_0x82a3('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x82a3('0x13')]=router;
\ No newline at end of file
+var _0xde06=['index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated'];(function(_0xb30689,_0x59a222){var _0x2bed52=function(_0x3a8e4a){while(--_0x3a8e4a){_0xb30689['push'](_0xb30689['shift']());}};_0x2bed52(++_0x59a222);}(_0xde06,0x113));var _0x6de0=function(_0x5a1397,_0x1f80ae){_0x5a1397=_0x5a1397-0x0;var _0x56224d=_0xde06[_0x5a1397];return _0x56224d;};'use strict';var multer=require(_0x6de0('0x0'));var util=require(_0x6de0('0x1'));var path=require(_0x6de0('0x2'));var timeout=require(_0x6de0('0x3'));var express=require('express');var router=express[_0x6de0('0x4')]();var fs_extra=require(_0x6de0('0x5'));var auth=require(_0x6de0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6de0('0x7'));var controller=require(_0x6de0('0x8'));router[_0x6de0('0x9')]('/',auth[_0x6de0('0xa')](),controller[_0x6de0('0xb')]);router[_0x6de0('0x9')](_0x6de0('0xc'),auth[_0x6de0('0xa')](),controller[_0x6de0('0xd')]);router[_0x6de0('0x9')](_0x6de0('0xe'),auth[_0x6de0('0xa')](),controller[_0x6de0('0xf')]);router[_0x6de0('0x9')](_0x6de0('0x10'),auth[_0x6de0('0xa')](),controller[_0x6de0('0x11')]);router[_0x6de0('0x12')]('/',auth[_0x6de0('0xa')](),controller[_0x6de0('0x13')]);router[_0x6de0('0x12')]('/:id/contacts',auth[_0x6de0('0xa')](),controller[_0x6de0('0x14')]);router[_0x6de0('0x15')](_0x6de0('0xe'),auth['isAuthenticated'](),controller[_0x6de0('0x16')]);router[_0x6de0('0x17')](_0x6de0('0xe'),auth[_0x6de0('0xa')](),controller[_0x6de0('0x18')]);module[_0x6de0('0x19')]=router;
\ No newline at end of file
index 3eef3da..12fe9b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x038e=['INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING','TEXT'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x038e,0x151));var _0xe038=function(_0x105e63,_0x2c41c2){_0x105e63=_0x105e63-0x0;var _0x4dc9f1=_0x038e[_0x105e63];return _0x4dc9f1;};'use strict';var _=require(_0xe038('0x0'));var Sequelize=require(_0xe038('0x1'));module[_0xe038('0x2')]={'firstName':{'type':Sequelize[_0xe038('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xe038('0x3')]},'postalCode':{'type':Sequelize[_0xe038('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xe038('0x3')]},'description':{'type':Sequelize[_0xe038('0x4')]},'phone':{'type':Sequelize[_0xe038('0x3')]},'mobile':{'type':Sequelize[_0xe038('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xe038('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xe038('0x3')]},'twitter':{'type':Sequelize[_0xe038('0x3')]},'skype':{'type':Sequelize[_0xe038('0x3')]},'teams':{'type':Sequelize[_0xe038('0x3')]},'viber':{'type':Sequelize[_0xe038('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xe038('0x3')]},'telegram':{'type':Sequelize[_0xe038('0x3')]},'UserId':{'type':Sequelize[_0xe038('0x5')]},'AdditionalPhones':{'type':Sequelize[_0xe038('0x3')]},'priority':{'type':Sequelize[_0xe038('0x5')](0x2)[_0xe038('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xe038('0x7')],'defaultValue':Sequelize[_0xe038('0x8')]},'dialTimezone':{'type':Sequelize[_0xe038('0x3')]},'utcOffset':{'type':Sequelize[_0xe038('0x5')]}};
\ No newline at end of file
+var _0x0ae3=['DATE','NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x5b2253,_0x48091f){var _0x277250=function(_0xdf3ff9){while(--_0xdf3ff9){_0x5b2253['push'](_0x5b2253['shift']());}};_0x277250(++_0x48091f);}(_0x0ae3,0x158));var _0x30ae=function(_0x4f354c,_0x39069d){_0x4f354c=_0x4f354c-0x0;var _0x3707e2=_0x0ae3[_0x4f354c];return _0x3707e2;};'use strict';var _=require(_0x30ae('0x0'));var Sequelize=require(_0x30ae('0x1'));module[_0x30ae('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x30ae('0x3')]},'city':{'type':Sequelize[_0x30ae('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x30ae('0x3')]},'description':{'type':Sequelize[_0x30ae('0x4')]},'phone':{'type':Sequelize[_0x30ae('0x3')]},'mobile':{'type':Sequelize[_0x30ae('0x3')]},'fax':{'type':Sequelize[_0x30ae('0x3')]},'email':{'type':Sequelize[_0x30ae('0x3')]},'url':{'type':Sequelize[_0x30ae('0x3')]},'facebook':{'type':Sequelize[_0x30ae('0x3')]},'fb_data':{'type':Sequelize[_0x30ae('0x3')]},'twitter':{'type':Sequelize[_0x30ae('0x3')]},'skype':{'type':Sequelize[_0x30ae('0x3')]},'teams':{'type':Sequelize[_0x30ae('0x3')]},'viber':{'type':Sequelize[_0x30ae('0x3')]},'line':{'type':Sequelize[_0x30ae('0x3')]},'wechat':{'type':Sequelize[_0x30ae('0x3')]},'telegram':{'type':Sequelize[_0x30ae('0x3')]},'UserId':{'type':Sequelize[_0x30ae('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x30ae('0x3')]},'priority':{'type':Sequelize[_0x30ae('0x5')](0x2)[_0x30ae('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x30ae('0x7')],'defaultValue':Sequelize[_0x30ae('0x8')]},'dialTimezone':{'type':Sequelize[_0x30ae('0x3')]},'utcOffset':{'type':Sequelize[_0x30ae('0x5')]}};
\ No newline at end of file
index 8b70403..e59053f 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(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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(_0x35a274,_0x98b399){var _0x40d905=function(_0x5c8455){while(--_0x5c8455){_0x35a274['push'](_0x35a274['shift']());}};_0x40d905(++_0x98b399);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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 f49341e..230f9e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa4e=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','CmContact','setMaxListeners','update'];(function(_0x54e361,_0x144fb7){var _0x172883=function(_0x3bd6d4){while(--_0x3bd6d4){_0x54e361['push'](_0x54e361['shift']());}};_0x172883(++_0x144fb7);}(_0xaa4e,0x176));var _0xeaa4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa4e[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var CmContact=require(_0xeaa4('0x0'))['db'][_0xeaa4('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xeaa4('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xeaa4('0x3'),'afterDestroy':_0xeaa4('0x4')};function emitEvent(_0x3c1c03){return function(_0x3bccce,_0x469ce6,_0x4d9a11){CmContactEvents[_0xeaa4('0x5')](_0x3c1c03+':'+_0x3bccce['id'],_0x3bccce);CmContactEvents['emit'](_0x3c1c03,_0x3bccce);_0x4d9a11(null);};}for(var e in events){if(events[_0xeaa4('0x6')](e)){var event=events[e];CmContact[_0xeaa4('0x7')](e,emitEvent(event));}}module[_0xeaa4('0x8')]=CmContactEvents;
\ No newline at end of file
+var _0xb1b4=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x284ae7,_0x432446){var _0x30967b=function(_0x2909a9){while(--_0x2909a9){_0x284ae7['push'](_0x284ae7['shift']());}};_0x30967b(++_0x432446);}(_0xb1b4,0x18c));var _0x4b1b=function(_0x33ab79,_0x4f7c50){_0x33ab79=_0x33ab79-0x0;var _0x10ac00=_0xb1b4[_0x33ab79];return _0x10ac00;};'use strict';var EventEmitter=require(_0x4b1b('0x0'));var CmContact=require(_0x4b1b('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0x4b1b('0x2')](0x0);var events={'afterCreate':_0x4b1b('0x3'),'afterUpdate':_0x4b1b('0x4'),'afterDestroy':_0x4b1b('0x5')};function emitEvent(_0x12e021){return function(_0x3b35e7,_0x12e641,_0x1292a8){CmContactEvents['emit'](_0x12e021+':'+_0x3b35e7['id'],_0x3b35e7);CmContactEvents[_0x4b1b('0x6')](_0x12e021,_0x3b35e7);_0x1292a8(null);};}for(var e in events){if(events[_0x4b1b('0x7')](e)){var event=events[e];CmContact[_0x4b1b('0x8')](e,emitEvent(event));}}module[_0x4b1b('0x9')]=CmContactEvents;
\ No newline at end of file
index 397e04f..525b7f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1cf=['cmContact','afterCreate','scheduledat','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','ret','\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','error','Campaign','minutes','Lists','length','dialCheckDuplicateType','always','findAll','outbound','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','CmList','onlyIfOpen','List\x20not\x20found','models','isEmpty','destroy','CampaignId','push','info','[CmContact][afterDestroy][Succesfull]','inspect','[CmContact][afterDestroy][Error]','lodash','util','path','../../config/environment','./cmContact.attributes','exports','CmContact','phone','fti_cm_contacts','firstName','lastName','mobile','fax','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','get'];(function(_0x343e70,_0xe5f373){var _0x2742fd=function(_0x27e56e){while(--_0x27e56e){_0x343e70['push'](_0x343e70['shift']());}};_0x2742fd(++_0xe5f373);}(_0xe1cf,0xfb));var _0xfe1c=function(_0x100d27,_0x54b77c){_0x100d27=_0x100d27-0x0;var _0x4cc42f=_0xe1cf[_0x100d27];return _0x4cc42f;};'use strict';var _=require(_0xfe1c('0x0'));var util=require(_0xfe1c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe1c('0x2'));var rimraf=require('rimraf');var config=require(_0xfe1c('0x3'));var shared=require('../../config/environment/shared');var attributes=require(_0xfe1c('0x4'));module[_0xfe1c('0x5')]=function(_0xea049e,_0x3a9d1d){return _0xea049e['define'](_0xfe1c('0x6'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0xfe1c('0x7'),'fields':[_0xfe1c('0x7')]},{'name':_0xfe1c('0x8'),'fields':[_0xfe1c('0x9'),_0xfe1c('0xa'),_0xfe1c('0x7'),_0xfe1c('0xb'),_0xfe1c('0xc'),'email'],'type':_0xfe1c('0xd')}],'timestamps':!![],'charset':_0xfe1c('0xe'),'collate':_0xfe1c('0xf'),'hooks':{'afterCreate':function(_0x33983c,_0x3e38e9,_0xac84be){var _0x4978df=_0xea049e['models'];var _0x4a481f=_0x33983c[_0xfe1c('0x10')]({'plain':!![]});function _0x24e98e(){return function(_0x353b75){logger['error'](_0xfe1c('0x11'),_0xfe1c('0x12'),util['inspect'](_0x353b75,{'showHidden':![],'depth':null}));};}function _0x5df2cb(_0x2f9774,_0x3dfd93){var _0x21b253=_0x3dfd93[_0xfe1c('0x13')]?_0x3dfd93[_0xfe1c('0x13')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x1fe1ed,_0x523e1c){if(_[_0xfe1c('0x14')](_0x3dfd93[_0xfe1c('0x15')])){_0x1fe1ed({'ret':_0x21b253});}else{_0x4978df[_0xfe1c('0x16')][_0xfe1c('0x17')]({'where':{'id':_0x2f9774['id']}})[_0xfe1c('0x18')](function(_0x284a9e){if(!_['isNil'](_0x284a9e)){var _0x4c78bb=_0x284a9e['dialTimezone'];if(!_['isNil'](_0x4c78bb)){var _0x126f17=shared[_0xfe1c('0x19')];var _0x2ff1bc=_0x126f17[_0x4c78bb];var _0x4fbc71=_0x126f17[_0x3dfd93[_0xfe1c('0x15')]];if(!_[_0xfe1c('0x14')](_0x2ff1bc)&&!_[_0xfe1c('0x14')](_0x4fbc71)){var _0x12d86c=_0x2ff1bc[_0xfe1c('0x1a')]-_0x4fbc71['utcOffset'];_0x21b253=_0x3dfd93[_0xfe1c('0x13')]?_0x3dfd93[_0xfe1c('0x13')]:moment();var _0x298a8d=moment(_0x21b253)['add'](_0x12d86c,'minutes');_0x1fe1ed({'ret':_0x298a8d[_0xfe1c('0x1b')](_0xfe1c('0x1c'))});}else _0x1fe1ed({'ret':_0x21b253});}else _0x1fe1ed({'ret':_0x21b253});}else{_0x1fe1ed({'ret':_0x21b253});}});}});return 0xa;}var _0x15d877=function(_0x42785f){return new BPromise(function(_0x58cc12,_0x2d7001){_0x5df2cb(_0x42785f,_0x4a481f)[_0xfe1c('0x18')](function(_0x33447c){_0x4a481f['scheduledat']=_0x33447c['ret'];_0x4978df[_0xfe1c('0x1d')]['findOne']({'where':{'phone':_0x4a481f[_0xfe1c('0x7')],'VoiceQueueId':_0x42785f['id']}})[_0xfe1c('0x18')](function(_0x26b9a5){if(!_[_0xfe1c('0x14')](_0x26b9a5)){throw new Error(_0xfe1c('0x1e')+_0x4a481f[_0xfe1c('0x7')]+_0xfe1c('0x1f')+_0x42785f['id']);}return _0x4978df['CmHopper'][_0xfe1c('0x20')]({'phone':_0x4a481f[_0xfe1c('0x7')],'ContactId':_0x4a481f['id'],'ListId':_0x4a481f[_0xfe1c('0x21')],'priority':_0x4a481f[_0xfe1c('0x22')]?_0x4a481f[_0xfe1c('0x22')]:0x2,'scheduledat':_0x4a481f[_0xfe1c('0x13')]?_0x4a481f[_0xfe1c('0x13')]:moment()[_0xfe1c('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x4a481f[_0xfe1c('0x23')]?!![]:![],'callbackuniqueid':_0x4a481f['callbackUniqueid']?_0x4a481f[_0xfe1c('0x23')]:undefined,'callbackat':_0x4a481f[_0xfe1c('0x23')]?moment()[_0xfe1c('0x1b')](_0xfe1c('0x1c')):undefined,'VoiceQueueId':_0x42785f['id']});})[_0xfe1c('0x24')](function(_0x5add14){_0x2d7001(_0x5add14);});});});};var _0x473711=function(_0x50ec26){return new BPromise(function(_0x4abc65,_0x234466){_0x5df2cb(_0x50ec26,_0x4a481f)[_0xfe1c('0x18')](function(_0x43fc41){_0x4a481f['scheduledat']=_0x43fc41[_0xfe1c('0x25')];_0x4978df[_0xfe1c('0x1d')][_0xfe1c('0x17')]({'where':{'phone':_0x4a481f[_0xfe1c('0x7')],'VoiceQueueId':_0x50ec26['id']}})['then'](function(_0x3a9f29){if(!_[_0xfe1c('0x14')](_0x3a9f29)){throw new Error(_0xfe1c('0x1e')+_0x4a481f[_0xfe1c('0x7')]+_0xfe1c('0x26')+_0x50ec26['id']);}return _0x4978df[_0xfe1c('0x27')]['findOne']({'where':{'calleridnum':_0x4a481f['phone'],'VoiceQueueId':_0x50ec26['id']}});})['then'](function(_0x186165){if(!_[_0xfe1c('0x14')](_0x186165)){throw new Error(_0xfe1c('0x28')+_0x4a481f[_0xfe1c('0x7')]+_0xfe1c('0x29')+_0x50ec26['id']);}return _0x4978df['CmHopper'][_0xfe1c('0x20')]({'phone':_0x4a481f[_0xfe1c('0x7')],'ContactId':_0x4a481f['id'],'ListId':_0x4a481f['ListId'],'priority':_0x4a481f[_0xfe1c('0x22')]?_0x4a481f[_0xfe1c('0x22')]:0x2,'scheduledat':_0x4a481f['scheduledat']?_0x4a481f['scheduledat']:moment()['format'](_0xfe1c('0x1c')),'callback':_0x4a481f[_0xfe1c('0x23')]?!![]:![],'callbackuniqueid':_0x4a481f[_0xfe1c('0x23')]?_0x4a481f[_0xfe1c('0x23')]:undefined,'callbackat':_0x4a481f[_0xfe1c('0x23')]?moment()[_0xfe1c('0x1b')](_0xfe1c('0x1c')):undefined,'VoiceQueueId':_0x50ec26['id']});})[_0xfe1c('0x24')](function(_0x3e5f9d){_0x234466(_0x3e5f9d);});});});};function _0x5b6c82(){return function(_0x18111f){logger[_0xfe1c('0x2a')]('cmContact','afterCreate',util['inspect'](_0x18111f,{'showHidden':![],'depth':null}));};}function _0x19aa0f(_0x5b742c,_0x3bf569){var _0x4290d5=_0x3bf569[_0xfe1c('0x13')]?_0x3bf569[_0xfe1c('0x13')]:moment()[_0xfe1c('0x1b')](_0xfe1c('0x1c'));return new BPromise(function(_0x341d80,_0x3f438f){if(_[_0xfe1c('0x14')](_0x3bf569[_0xfe1c('0x15')])){_0x341d80({'ret':_0x4290d5});}else{_0x4978df[_0xfe1c('0x2b')][_0xfe1c('0x17')]({'where':{'id':_0x5b742c['id']}})[_0xfe1c('0x18')](function(_0x2ef97e){if(!_[_0xfe1c('0x14')](_0x2ef97e)){var _0x562bf1=_0x2ef97e[_0xfe1c('0x15')];if(!_[_0xfe1c('0x14')](_0x562bf1)){var _0x5741af=shared[_0xfe1c('0x19')];var _0xa55420=_0x5741af[_0x562bf1];var _0x3a5fdb=_0x5741af[_0x3bf569[_0xfe1c('0x15')]];if(!_[_0xfe1c('0x14')](_0xa55420)&&!_[_0xfe1c('0x14')](_0x3a5fdb)){var _0x38edac=_0xa55420[_0xfe1c('0x1a')]-_0x3a5fdb[_0xfe1c('0x1a')];_0x4290d5=_0x3bf569[_0xfe1c('0x13')]?_0x3bf569['scheduledat']:moment();var _0x34285a=moment(_0x4290d5)['add'](_0x38edac,_0xfe1c('0x2c'));_0x341d80({'ret':_0x34285a[_0xfe1c('0x1b')](_0xfe1c('0x1c'))});}else _0x341d80({'ret':_0x4290d5});}else _0x341d80({'ret':_0x4290d5});}else{_0x341d80({'ret':_0x4290d5});}});}});return 0xa;}var _0x463d3d=function(_0x221f9b){return new BPromise(function(_0x3ad230,_0x5e4041){_0x19aa0f(_0x221f9b,_0x4a481f)[_0xfe1c('0x18')](function(_0x526097){_0x4a481f[_0xfe1c('0x13')]=_0x526097[_0xfe1c('0x25')];_0x4978df[_0xfe1c('0x1d')][_0xfe1c('0x17')]({'where':{'phone':_0x4a481f[_0xfe1c('0x7')],'CampaignId':_0x221f9b['id']}})[_0xfe1c('0x18')](function(_0x15fe9d){if(!_[_0xfe1c('0x14')](_0x15fe9d)){throw new Error('cmContact,\x20afterCreate\x20'+_0x4a481f[_0xfe1c('0x7')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x221f9b['id']);}return _0x4978df['CmHopper']['create']({'phone':_0x4a481f['phone'],'ContactId':_0x4a481f['id'],'ListId':_0x4a481f[_0xfe1c('0x21')],'priority':_0x4a481f[_0xfe1c('0x22')]?_0x4a481f[_0xfe1c('0x22')]:0x2,'scheduledat':_0x4a481f['scheduledat']?_0x4a481f[_0xfe1c('0x13')]:moment()['format'](_0xfe1c('0x1c')),'callback':_0x4a481f[_0xfe1c('0x23')]?!![]:![],'callbackuniqueid':_0x4a481f[_0xfe1c('0x23')]?_0x4a481f[_0xfe1c('0x23')]:undefined,'callbackat':_0x4a481f[_0xfe1c('0x23')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x221f9b['id']});})[_0xfe1c('0x24')](function(_0x5511c9){_0x5e4041(_0x5511c9);});});});};var _0x35e312=function(_0x238359){return new BPromise(function(_0x4b8091,_0x5b3562){_0x19aa0f(_0x238359,_0x4a481f)['then'](function(_0x101806){_0x4a481f['scheduledat']=_0x101806[_0xfe1c('0x25')];_0x4978df[_0xfe1c('0x1d')][_0xfe1c('0x17')]({'where':{'phone':_0x4a481f['phone'],'CampaignId':_0x238359['id']}})[_0xfe1c('0x18')](function(_0x566a42){if(!_['isNil'](_0x566a42)){throw new Error(_0xfe1c('0x1e')+_0x4a481f[_0xfe1c('0x7')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x238359['id']);}return _0x4978df[_0xfe1c('0x27')][_0xfe1c('0x17')]({'where':{'calleridnum':_0x4a481f[_0xfe1c('0x7')],'CampaignId':_0x238359['id']}});})[_0xfe1c('0x18')](function(_0x49745a){if(!_[_0xfe1c('0x14')](_0x49745a)){throw new Error(_0xfe1c('0x28')+_0x4a481f['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x238359['id']);}return _0x4978df[_0xfe1c('0x1d')][_0xfe1c('0x20')]({'phone':_0x4a481f['phone'],'ContactId':_0x4a481f['id'],'ListId':_0x4a481f[_0xfe1c('0x21')],'priority':_0x4a481f[_0xfe1c('0x22')]?_0x4a481f['priority']:0x2,'scheduledat':_0x4a481f['scheduledat']?_0x4a481f[_0xfe1c('0x13')]:moment()[_0xfe1c('0x1b')](_0xfe1c('0x1c')),'callback':_0x4a481f[_0xfe1c('0x23')]?!![]:![],'callbackuniqueid':_0x4a481f[_0xfe1c('0x23')]?_0x4a481f['callbackUniqueid']:undefined,'callbackat':_0x4a481f['callbackUniqueid']?moment()[_0xfe1c('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x238359['id']});})[_0xfe1c('0x24')](function(_0x81156){_0x5b3562(_0x81156);});});});};if(_0x4a481f[_0xfe1c('0x21')]){_0x4978df['VoiceQueue']['findAll']({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType',_0xfe1c('0x15')],'include':[{'model':_0x4978df['CmList'],'as':_0xfe1c('0x2d'),'where':{'id':_0x4a481f[_0xfe1c('0x21')]}}]})[_0xfe1c('0x18')](function(_0x5ea198){if(_0x5ea198){var _0x35cd9c=[];for(var _0x3b690c=0x0,_0x503ff1;_0x3b690c<_0x5ea198[_0xfe1c('0x2e')];_0x3b690c+=0x1){_0x503ff1=_0x5ea198[_0x3b690c][_0xfe1c('0x10')]({'plain':!![]});switch(_0x503ff1[_0xfe1c('0x2f')]){case _0xfe1c('0x30'):_0x473711(_0x503ff1)[_0xfe1c('0x24')](_0x24e98e());break;case'onlyIfOpen':_0x15d877(_0x503ff1)[_0xfe1c('0x24')](_0x24e98e());break;default:_0x19aa0f(_0x503ff1,_0x4a481f)[_0xfe1c('0x18')](function(_0x3a1ef3){_0x4a481f[_0xfe1c('0x13')]=_0x3a1ef3[_0xfe1c('0x25')];_0x4978df['CmHopper']['create']({'phone':_0x4a481f[_0xfe1c('0x7')],'ContactId':_0x4a481f['id'],'ListId':_0x4a481f['ListId'],'scheduledat':_0x4a481f[_0xfe1c('0x13')]?_0x4a481f[_0xfe1c('0x13')]:moment()[_0xfe1c('0x1b')](_0xfe1c('0x1c')),'priority':_0x4a481f[_0xfe1c('0x22')]?_0x4a481f[_0xfe1c('0x22')]:0x2,'callback':_0x4a481f[_0xfe1c('0x23')]?!![]:![],'callbackuniqueid':_0x4a481f[_0xfe1c('0x23')]?_0x4a481f['callbackUniqueid']:undefined,'callbackat':_0x4a481f[_0xfe1c('0x23')]?moment()[_0xfe1c('0x1b')](_0xfe1c('0x1c')):undefined,'VoiceQueueId':_0x503ff1['id']})[_0xfe1c('0x24')](_0x24e98e());});}}}})[_0xfe1c('0x18')](function(){return _0x4978df['VoiceQueue'][_0xfe1c('0x31')]({'where':{'type':_0xfe1c('0x32')},'attributes':['id'],'include':[{'model':_0x4978df['CmList'],'as':_0xfe1c('0x33'),'where':{'id':_0x4a481f[_0xfe1c('0x21')]}}]})[_0xfe1c('0x18')](function(_0x30bb97){if(_0x30bb97){var _0x415af6=[];for(var _0x12a5b7=0x0,_0x5d9cbc;_0x12a5b7<_0x30bb97[_0xfe1c('0x2e')];_0x12a5b7+=0x1){_0x5d9cbc=_0x30bb97[_0x12a5b7][_0xfe1c('0x10')]({'plain':!![]});_0x4978df[_0xfe1c('0x34')][_0xfe1c('0x20')]({'phone':_0x4a481f['phone'],'ContactId':_0x4a481f['id'],'ListId':_0x4a481f[_0xfe1c('0x21')],'VoiceQueueId':_0x5d9cbc['id']})[_0xfe1c('0x24')](function(_0x5bc820){logger[_0xfe1c('0x2a')](_0xfe1c('0x35'),'afterCreate',_0x5bc820[_0xfe1c('0x36')]);});}}});})[_0xfe1c('0x18')](function(){return _0x4978df[_0xfe1c('0x2b')][_0xfe1c('0x31')]({'attributes':['id',_0xfe1c('0x2f'),'dialTimezone'],'include':[{'model':_0x4978df[_0xfe1c('0x37')],'as':_0xfe1c('0x2d'),'where':{'id':_0x4a481f[_0xfe1c('0x21')]}}]})[_0xfe1c('0x18')](function(_0x369acc){if(_0x369acc){var _0x5e0e1b=[];for(var _0x2301fd=0x0,_0x3ed6bd;_0x2301fd<_0x369acc[_0xfe1c('0x2e')];_0x2301fd+=0x1){_0x3ed6bd=_0x369acc[_0x2301fd]['get']({'plain':!![]});switch(_0x3ed6bd[_0xfe1c('0x2f')]){case _0xfe1c('0x30'):_0x35e312(_0x3ed6bd)[_0xfe1c('0x24')](_0x5b6c82());break;case _0xfe1c('0x38'):_0x463d3d(_0x3ed6bd)['catch'](_0x5b6c82());break;default:_0x4978df[_0xfe1c('0x1d')]['create']({'phone':_0x4a481f[_0xfe1c('0x7')],'ContactId':_0x4a481f['id'],'ListId':_0x4a481f[_0xfe1c('0x21')],'scheduledat':_0x4a481f['scheduledat']?_0x4a481f[_0xfe1c('0x13')]:moment()[_0xfe1c('0x1b')](_0xfe1c('0x1c')),'priority':_0x4a481f[_0xfe1c('0x22')]?_0x4a481f['priority']:0x2,'callback':_0x4a481f[_0xfe1c('0x23')]?!![]:![],'callbackuniqueid':_0x4a481f[_0xfe1c('0x23')]?_0x4a481f[_0xfe1c('0x23')]:undefined,'callbackat':_0x4a481f['callbackUniqueid']?moment()[_0xfe1c('0x1b')](_0xfe1c('0x1c')):undefined,'CampaignId':_0x3ed6bd['id']})[_0xfe1c('0x24')](_0x5b6c82());}}}});})['then'](function(){return _0x4978df[_0xfe1c('0x2b')]['findAll']({'attributes':['id'],'include':[{'model':_0x4978df[_0xfe1c('0x37')],'as':_0xfe1c('0x33'),'where':{'id':_0x4a481f['ListId']}}]})[_0xfe1c('0x18')](function(_0x253ae5){if(_0x253ae5){var _0x370a1b=[];for(var _0x1458ca=0x0,_0x294061;_0x1458ca<_0x253ae5[_0xfe1c('0x2e')];_0x1458ca+=0x1){_0x294061=_0x253ae5[_0x1458ca][_0xfe1c('0x10')]({'plain':!![]});_0x4978df['CmHopperBlack'][_0xfe1c('0x20')]({'phone':_0x4a481f[_0xfe1c('0x7')],'ContactId':_0x4a481f['id'],'ListId':_0x4a481f[_0xfe1c('0x21')],'CampaignId':_0x294061['id']})[_0xfe1c('0x24')](function(_0x27e488){logger[_0xfe1c('0x2a')]('cmContact,\x20%s,\x20%s',_0xfe1c('0x12'),_0x27e488[_0xfe1c('0x36')]);});}}});})[_0xfe1c('0x18')](function(){_0xac84be();})[_0xfe1c('0x24')](function(_0x420cfd){logger[_0xfe1c('0x2a')](_0xfe1c('0x35'),_0xfe1c('0x12'),_0x420cfd[_0xfe1c('0x36')]);_0xac84be(_0x420cfd);});}else{_0xac84be(new Error(_0xfe1c('0x39')));}},'afterDestroy':function(_0x3a4276,_0x37c43,_0x43515f){var _0x3b6891=_0xea049e[_0xfe1c('0x3a')];var _0x5e564c=_0x3a4276[_0xfe1c('0x10')]({'plain':!![]});return _0x3b6891[_0xfe1c('0x1d')][_0xfe1c('0x31')]({'raw':!![],'where':{'ListId':_0x5e564c[_0xfe1c('0x21')],'ContactId':_0x5e564c['id']}})[_0xfe1c('0x18')](function(_0x2aaa31){if(!_[_0xfe1c('0x3b')](_0x2aaa31)){var _0x5088c8=[];for(var _0x324dbf=0x0;_0x324dbf<_0x2aaa31[_0xfe1c('0x2e')];_0x324dbf+=0x1){var _0x5a7067=_0x3b6891[_0xfe1c('0x1d')][_0xfe1c('0x3c')]({'where':{'ListId':_0x2aaa31[_0x324dbf][_0xfe1c('0x21')],'ContactId':_0x2aaa31[_0x324dbf]['ContactId'],'VoiceQueueId':_0x2aaa31[_0x324dbf]['VoiceQueueId'],'CampaignId':_0x2aaa31[_0x324dbf][_0xfe1c('0x3d')]}});_0x5088c8[_0xfe1c('0x3e')](_0x5a7067);}return BPromise['all'](_0x5088c8);}})[_0xfe1c('0x18')](function(_0x1b8c7a){logger[_0xfe1c('0x3f')](_0xfe1c('0x40'),util[_0xfe1c('0x41')](_0x1b8c7a,{'showHidden':![],'depth':null}));_0x43515f();})['catch'](function(_0x451bb2){logger[_0xfe1c('0x2a')](_0xfe1c('0x42'),util[_0xfe1c('0x41')](_0x451bb2,{'showHidden':![],'depth':null}));_0x43515f(_0x451bb2);});}}});};
\ No newline at end of file
+var _0x6bcd=['onlyIfOpen','outbound','BlackLists','cmContact,\x20%s,\x20%s','message','always','CmHopperBlack','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','all','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment/shared','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','inspect','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','VoiceQueue','findOne','then','dialTimezone','timezones','utcOffset','minutes','ret','CmHopper','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','ListId','priority','format','callbackUniqueid','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','create','catch','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','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','dialCheckDuplicateType','CmList','Lists','length'];(function(_0x212eed,_0x144a0c){var _0x39455b=function(_0x19bf45){while(--_0x19bf45){_0x212eed['push'](_0x212eed['shift']());}};_0x39455b(++_0x144a0c);}(_0x6bcd,0xa5));var _0xd6bc=function(_0x15bfa3,_0x376cef){_0x15bfa3=_0x15bfa3-0x0;var _0xb7000c=_0x6bcd[_0x15bfa3];return _0xb7000c;};'use strict';var _=require(_0xd6bc('0x0'));var util=require(_0xd6bc('0x1'));var logger=require(_0xd6bc('0x2'))(_0xd6bc('0x3'));var moment=require(_0xd6bc('0x4'));var BPromise=require(_0xd6bc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6bc('0x6'));var rimraf=require(_0xd6bc('0x7'));var config=require('../../config/environment');var shared=require(_0xd6bc('0x8'));var attributes=require('./cmContact.attributes');module['exports']=function(_0x44aed1,_0x1bb107){return _0x44aed1[_0xd6bc('0x9')](_0xd6bc('0xa'),attributes,{'tableName':_0xd6bc('0xb'),'paranoid':!![],'indexes':[{'name':_0xd6bc('0xc'),'fields':[_0xd6bc('0xc')]},{'name':_0xd6bc('0xd'),'fields':[_0xd6bc('0xe'),'lastName',_0xd6bc('0xc'),'mobile',_0xd6bc('0xf'),_0xd6bc('0x10')],'type':_0xd6bc('0x11')}],'timestamps':!![],'charset':_0xd6bc('0x12'),'collate':_0xd6bc('0x13'),'hooks':{'afterCreate':function(_0x1bea92,_0x23f9c4,_0x265c0a){var _0x1a58ad=_0x44aed1[_0xd6bc('0x14')];var _0x12615b=_0x1bea92[_0xd6bc('0x15')]({'plain':!![]});function _0x3a017a(){return function(_0x23c92d){logger[_0xd6bc('0x16')](_0xd6bc('0x17'),_0xd6bc('0x18'),util[_0xd6bc('0x19')](_0x23c92d,{'showHidden':![],'depth':null}));};}function _0xcba14(_0xcf789b,_0x4f9478){var _0xc67890=_0x4f9478[_0xd6bc('0x1a')]?_0x4f9478['scheduledat']:moment()['format'](_0xd6bc('0x1b'));return new BPromise(function(_0x3354ec,_0x20fa2b){if(_[_0xd6bc('0x1c')](_0x4f9478['dialTimezone'])){_0x3354ec({'ret':_0xc67890});}else{_0x1a58ad[_0xd6bc('0x1d')][_0xd6bc('0x1e')]({'where':{'id':_0xcf789b['id']}})[_0xd6bc('0x1f')](function(_0x4efc36){if(!_[_0xd6bc('0x1c')](_0x4efc36)){var _0x3de163=_0x4efc36[_0xd6bc('0x20')];if(!_[_0xd6bc('0x1c')](_0x3de163)){var _0xcb75da=shared[_0xd6bc('0x21')];var _0x2b5355=_0xcb75da[_0x3de163];var _0x344d10=_0xcb75da[_0x4f9478[_0xd6bc('0x20')]];if(!_[_0xd6bc('0x1c')](_0x2b5355)&&!_[_0xd6bc('0x1c')](_0x344d10)){var _0x4c72d3=_0x2b5355[_0xd6bc('0x22')]-_0x344d10[_0xd6bc('0x22')];_0xc67890=_0x4f9478['scheduledat']?_0x4f9478[_0xd6bc('0x1a')]:moment();var _0x203803=moment(_0xc67890)['add'](_0x4c72d3,_0xd6bc('0x23'));_0x3354ec({'ret':_0x203803['format'](_0xd6bc('0x1b'))});}else _0x3354ec({'ret':_0xc67890});}else _0x3354ec({'ret':_0xc67890});}else{_0x3354ec({'ret':_0xc67890});}});}});return 0xa;}var _0x48d662=function(_0x4f004c){return new BPromise(function(_0x664dd6,_0x4e0972){_0xcba14(_0x4f004c,_0x12615b)[_0xd6bc('0x1f')](function(_0xeb87cb){_0x12615b[_0xd6bc('0x1a')]=_0xeb87cb[_0xd6bc('0x24')];_0x1a58ad[_0xd6bc('0x25')][_0xd6bc('0x1e')]({'where':{'phone':_0x12615b['phone'],'VoiceQueueId':_0x4f004c['id']}})[_0xd6bc('0x1f')](function(_0x5528f2){if(!_[_0xd6bc('0x1c')](_0x5528f2)){throw new Error('cmContact,\x20afterCreate\x20'+_0x12615b[_0xd6bc('0xc')]+_0xd6bc('0x26')+_0x4f004c['id']);}return _0x1a58ad[_0xd6bc('0x25')]['create']({'phone':_0x12615b[_0xd6bc('0xc')],'ContactId':_0x12615b['id'],'ListId':_0x12615b[_0xd6bc('0x27')],'priority':_0x12615b[_0xd6bc('0x28')]?_0x12615b[_0xd6bc('0x28')]:0x2,'scheduledat':_0x12615b['scheduledat']?_0x12615b['scheduledat']:moment()[_0xd6bc('0x29')](_0xd6bc('0x1b')),'callback':_0x12615b['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x12615b['callbackUniqueid']?_0x12615b[_0xd6bc('0x2a')]:undefined,'callbackat':_0x12615b['callbackUniqueid']?moment()[_0xd6bc('0x29')](_0xd6bc('0x1b')):undefined,'VoiceQueueId':_0x4f004c['id']});})['catch'](function(_0x23dab4){_0x4e0972(_0x23dab4);});});});};var _0x5e0bb5=function(_0x299f63){return new BPromise(function(_0x252242,_0x21e437){_0xcba14(_0x299f63,_0x12615b)[_0xd6bc('0x1f')](function(_0x22a765){_0x12615b['scheduledat']=_0x22a765[_0xd6bc('0x24')];_0x1a58ad[_0xd6bc('0x25')][_0xd6bc('0x1e')]({'where':{'phone':_0x12615b[_0xd6bc('0xc')],'VoiceQueueId':_0x299f63['id']}})['then'](function(_0x1a357b){if(!_[_0xd6bc('0x1c')](_0x1a357b)){throw new Error(_0xd6bc('0x2b')+_0x12615b[_0xd6bc('0xc')]+_0xd6bc('0x2c')+_0x299f63['id']);}return _0x1a58ad['CmHopperFinal'][_0xd6bc('0x1e')]({'where':{'calleridnum':_0x12615b[_0xd6bc('0xc')],'VoiceQueueId':_0x299f63['id']}});})[_0xd6bc('0x1f')](function(_0x30efce){if(!_[_0xd6bc('0x1c')](_0x30efce)){throw new Error(_0xd6bc('0x2d')+_0x12615b['phone']+_0xd6bc('0x2e')+_0x299f63['id']);}return _0x1a58ad['CmHopper'][_0xd6bc('0x2f')]({'phone':_0x12615b[_0xd6bc('0xc')],'ContactId':_0x12615b['id'],'ListId':_0x12615b[_0xd6bc('0x27')],'priority':_0x12615b[_0xd6bc('0x28')]?_0x12615b[_0xd6bc('0x28')]:0x2,'scheduledat':_0x12615b[_0xd6bc('0x1a')]?_0x12615b[_0xd6bc('0x1a')]:moment()[_0xd6bc('0x29')](_0xd6bc('0x1b')),'callback':_0x12615b[_0xd6bc('0x2a')]?!![]:![],'callbackuniqueid':_0x12615b[_0xd6bc('0x2a')]?_0x12615b[_0xd6bc('0x2a')]:undefined,'callbackat':_0x12615b['callbackUniqueid']?moment()[_0xd6bc('0x29')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x299f63['id']});})[_0xd6bc('0x30')](function(_0x5791e7){_0x21e437(_0x5791e7);});});});};function _0x5816ce(){return function(_0x1f44ce){logger['error'](_0xd6bc('0x17'),'afterCreate',util[_0xd6bc('0x19')](_0x1f44ce,{'showHidden':![],'depth':null}));};}function _0x2d04bc(_0x1c0c04,_0x1e074b){var _0x5b55b6=_0x1e074b[_0xd6bc('0x1a')]?_0x1e074b[_0xd6bc('0x1a')]:moment()[_0xd6bc('0x29')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x275956,_0x45cbe9){if(_[_0xd6bc('0x1c')](_0x1e074b[_0xd6bc('0x20')])){_0x275956({'ret':_0x5b55b6});}else{_0x1a58ad[_0xd6bc('0x31')][_0xd6bc('0x1e')]({'where':{'id':_0x1c0c04['id']}})[_0xd6bc('0x1f')](function(_0x285a2c){if(!_[_0xd6bc('0x1c')](_0x285a2c)){var _0x15bb24=_0x285a2c[_0xd6bc('0x20')];if(!_[_0xd6bc('0x1c')](_0x15bb24)){var _0x5ad79c=shared['timezones'];var _0x38aa58=_0x5ad79c[_0x15bb24];var _0x567788=_0x5ad79c[_0x1e074b['dialTimezone']];if(!_[_0xd6bc('0x1c')](_0x38aa58)&&!_[_0xd6bc('0x1c')](_0x567788)){var _0x439269=_0x38aa58['utcOffset']-_0x567788[_0xd6bc('0x22')];_0x5b55b6=_0x1e074b[_0xd6bc('0x1a')]?_0x1e074b[_0xd6bc('0x1a')]:moment();var _0x1941ce=moment(_0x5b55b6)[_0xd6bc('0x32')](_0x439269,_0xd6bc('0x23'));_0x275956({'ret':_0x1941ce[_0xd6bc('0x29')](_0xd6bc('0x1b'))});}else _0x275956({'ret':_0x5b55b6});}else _0x275956({'ret':_0x5b55b6});}else{_0x275956({'ret':_0x5b55b6});}});}});return 0xa;}var _0x48bf23=function(_0x187870){return new BPromise(function(_0xb13168,_0x355378){_0x2d04bc(_0x187870,_0x12615b)[_0xd6bc('0x1f')](function(_0x3f78ec){_0x12615b[_0xd6bc('0x1a')]=_0x3f78ec['ret'];_0x1a58ad[_0xd6bc('0x25')][_0xd6bc('0x1e')]({'where':{'phone':_0x12615b[_0xd6bc('0xc')],'CampaignId':_0x187870['id']}})['then'](function(_0x48b266){if(!_[_0xd6bc('0x1c')](_0x48b266)){throw new Error('cmContact,\x20afterCreate\x20'+_0x12615b[_0xd6bc('0xc')]+_0xd6bc('0x33')+_0x187870['id']);}return _0x1a58ad['CmHopper'][_0xd6bc('0x2f')]({'phone':_0x12615b[_0xd6bc('0xc')],'ContactId':_0x12615b['id'],'ListId':_0x12615b['ListId'],'priority':_0x12615b[_0xd6bc('0x28')]?_0x12615b[_0xd6bc('0x28')]:0x2,'scheduledat':_0x12615b['scheduledat']?_0x12615b[_0xd6bc('0x1a')]:moment()[_0xd6bc('0x29')](_0xd6bc('0x1b')),'callback':_0x12615b[_0xd6bc('0x2a')]?!![]:![],'callbackuniqueid':_0x12615b[_0xd6bc('0x2a')]?_0x12615b[_0xd6bc('0x2a')]:undefined,'callbackat':_0x12615b[_0xd6bc('0x2a')]?moment()['format'](_0xd6bc('0x1b')):undefined,'CampaignId':_0x187870['id']});})[_0xd6bc('0x30')](function(_0x2c46b4){_0x355378(_0x2c46b4);});});});};var _0x2514d1=function(_0x32f0ac){return new BPromise(function(_0x2fad1d,_0x54994e){_0x2d04bc(_0x32f0ac,_0x12615b)[_0xd6bc('0x1f')](function(_0x453cad){_0x12615b['scheduledat']=_0x453cad[_0xd6bc('0x24')];_0x1a58ad[_0xd6bc('0x25')][_0xd6bc('0x1e')]({'where':{'phone':_0x12615b[_0xd6bc('0xc')],'CampaignId':_0x32f0ac['id']}})[_0xd6bc('0x1f')](function(_0x1ea448){if(!_[_0xd6bc('0x1c')](_0x1ea448)){throw new Error(_0xd6bc('0x2b')+_0x12615b['phone']+_0xd6bc('0x34')+_0x32f0ac['id']);}return _0x1a58ad[_0xd6bc('0x35')][_0xd6bc('0x1e')]({'where':{'calleridnum':_0x12615b[_0xd6bc('0xc')],'CampaignId':_0x32f0ac['id']}});})['then'](function(_0x3e8680){if(!_[_0xd6bc('0x1c')](_0x3e8680)){throw new Error(_0xd6bc('0x2d')+_0x12615b[_0xd6bc('0xc')]+_0xd6bc('0x36')+_0x32f0ac['id']);}return _0x1a58ad[_0xd6bc('0x25')][_0xd6bc('0x2f')]({'phone':_0x12615b[_0xd6bc('0xc')],'ContactId':_0x12615b['id'],'ListId':_0x12615b[_0xd6bc('0x27')],'priority':_0x12615b[_0xd6bc('0x28')]?_0x12615b[_0xd6bc('0x28')]:0x2,'scheduledat':_0x12615b['scheduledat']?_0x12615b[_0xd6bc('0x1a')]:moment()['format'](_0xd6bc('0x1b')),'callback':_0x12615b[_0xd6bc('0x2a')]?!![]:![],'callbackuniqueid':_0x12615b[_0xd6bc('0x2a')]?_0x12615b[_0xd6bc('0x2a')]:undefined,'callbackat':_0x12615b['callbackUniqueid']?moment()['format'](_0xd6bc('0x1b')):undefined,'CampaignId':_0x32f0ac['id']});})[_0xd6bc('0x30')](function(_0x85c770){_0x54994e(_0x85c770);});});});};if(_0x12615b[_0xd6bc('0x27')]){_0x1a58ad[_0xd6bc('0x1d')][_0xd6bc('0x37')]({'where':{'type':'outbound'},'attributes':['id',_0xd6bc('0x38'),_0xd6bc('0x20')],'include':[{'model':_0x1a58ad[_0xd6bc('0x39')],'as':_0xd6bc('0x3a'),'where':{'id':_0x12615b[_0xd6bc('0x27')]}}]})['then'](function(_0x2e28d7){if(_0x2e28d7){var _0x24641c=[];for(var _0x3656dc=0x0,_0x126624;_0x3656dc<_0x2e28d7[_0xd6bc('0x3b')];_0x3656dc+=0x1){_0x126624=_0x2e28d7[_0x3656dc][_0xd6bc('0x15')]({'plain':!![]});switch(_0x126624[_0xd6bc('0x38')]){case'always':_0x5e0bb5(_0x126624)[_0xd6bc('0x30')](_0x3a017a());break;case _0xd6bc('0x3c'):_0x48d662(_0x126624)[_0xd6bc('0x30')](_0x3a017a());break;default:_0x2d04bc(_0x126624,_0x12615b)['then'](function(_0x3d25b5){_0x12615b[_0xd6bc('0x1a')]=_0x3d25b5[_0xd6bc('0x24')];_0x1a58ad['CmHopper'][_0xd6bc('0x2f')]({'phone':_0x12615b['phone'],'ContactId':_0x12615b['id'],'ListId':_0x12615b['ListId'],'scheduledat':_0x12615b[_0xd6bc('0x1a')]?_0x12615b[_0xd6bc('0x1a')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x12615b[_0xd6bc('0x28')]?_0x12615b[_0xd6bc('0x28')]:0x2,'callback':_0x12615b[_0xd6bc('0x2a')]?!![]:![],'callbackuniqueid':_0x12615b[_0xd6bc('0x2a')]?_0x12615b[_0xd6bc('0x2a')]:undefined,'callbackat':_0x12615b['callbackUniqueid']?moment()[_0xd6bc('0x29')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x126624['id']})['catch'](_0x3a017a());});}}}})[_0xd6bc('0x1f')](function(){return _0x1a58ad[_0xd6bc('0x1d')][_0xd6bc('0x37')]({'where':{'type':_0xd6bc('0x3d')},'attributes':['id'],'include':[{'model':_0x1a58ad[_0xd6bc('0x39')],'as':_0xd6bc('0x3e'),'where':{'id':_0x12615b[_0xd6bc('0x27')]}}]})[_0xd6bc('0x1f')](function(_0x483cb0){if(_0x483cb0){var _0x18b483=[];for(var _0x4bb721=0x0,_0x91b960;_0x4bb721<_0x483cb0[_0xd6bc('0x3b')];_0x4bb721+=0x1){_0x91b960=_0x483cb0[_0x4bb721][_0xd6bc('0x15')]({'plain':!![]});_0x1a58ad['CmHopperBlack'][_0xd6bc('0x2f')]({'phone':_0x12615b[_0xd6bc('0xc')],'ContactId':_0x12615b['id'],'ListId':_0x12615b[_0xd6bc('0x27')],'VoiceQueueId':_0x91b960['id']})[_0xd6bc('0x30')](function(_0x577a7f){logger[_0xd6bc('0x16')](_0xd6bc('0x3f'),_0xd6bc('0x18'),_0x577a7f[_0xd6bc('0x40')]);});}}});})[_0xd6bc('0x1f')](function(){return _0x1a58ad[_0xd6bc('0x31')][_0xd6bc('0x37')]({'attributes':['id',_0xd6bc('0x38'),_0xd6bc('0x20')],'include':[{'model':_0x1a58ad[_0xd6bc('0x39')],'as':_0xd6bc('0x3a'),'where':{'id':_0x12615b[_0xd6bc('0x27')]}}]})[_0xd6bc('0x1f')](function(_0xc5e9bb){if(_0xc5e9bb){var _0x4ea05a=[];for(var _0x2081aa=0x0,_0x543aee;_0x2081aa<_0xc5e9bb['length'];_0x2081aa+=0x1){_0x543aee=_0xc5e9bb[_0x2081aa][_0xd6bc('0x15')]({'plain':!![]});switch(_0x543aee['dialCheckDuplicateType']){case _0xd6bc('0x41'):_0x2514d1(_0x543aee)[_0xd6bc('0x30')](_0x5816ce());break;case _0xd6bc('0x3c'):_0x48bf23(_0x543aee)[_0xd6bc('0x30')](_0x5816ce());break;default:_0x1a58ad[_0xd6bc('0x25')]['create']({'phone':_0x12615b[_0xd6bc('0xc')],'ContactId':_0x12615b['id'],'ListId':_0x12615b[_0xd6bc('0x27')],'scheduledat':_0x12615b[_0xd6bc('0x1a')]?_0x12615b[_0xd6bc('0x1a')]:moment()['format'](_0xd6bc('0x1b')),'priority':_0x12615b[_0xd6bc('0x28')]?_0x12615b[_0xd6bc('0x28')]:0x2,'callback':_0x12615b[_0xd6bc('0x2a')]?!![]:![],'callbackuniqueid':_0x12615b[_0xd6bc('0x2a')]?_0x12615b[_0xd6bc('0x2a')]:undefined,'callbackat':_0x12615b[_0xd6bc('0x2a')]?moment()[_0xd6bc('0x29')](_0xd6bc('0x1b')):undefined,'CampaignId':_0x543aee['id']})[_0xd6bc('0x30')](_0x5816ce());}}}});})[_0xd6bc('0x1f')](function(){return _0x1a58ad['Campaign'][_0xd6bc('0x37')]({'attributes':['id'],'include':[{'model':_0x1a58ad[_0xd6bc('0x39')],'as':'BlackLists','where':{'id':_0x12615b[_0xd6bc('0x27')]}}]})['then'](function(_0xf572b2){if(_0xf572b2){var _0x114143=[];for(var _0x53103a=0x0,_0x4cc9ae;_0x53103a<_0xf572b2[_0xd6bc('0x3b')];_0x53103a+=0x1){_0x4cc9ae=_0xf572b2[_0x53103a]['get']({'plain':!![]});_0x1a58ad[_0xd6bc('0x42')][_0xd6bc('0x2f')]({'phone':_0x12615b['phone'],'ContactId':_0x12615b['id'],'ListId':_0x12615b[_0xd6bc('0x27')],'CampaignId':_0x4cc9ae['id']})['catch'](function(_0x1e653e){logger[_0xd6bc('0x16')](_0xd6bc('0x3f'),_0xd6bc('0x18'),_0x1e653e[_0xd6bc('0x40')]);});}}});})['then'](function(){_0x265c0a();})[_0xd6bc('0x30')](function(_0x384d2d){logger[_0xd6bc('0x16')]('cmContact,\x20%s,\x20%s','afterCreate',_0x384d2d['message']);_0x265c0a(_0x384d2d);});}else{_0x265c0a(new Error(_0xd6bc('0x43')));}},'afterDestroy':function(_0x2df500,_0x467ce1,_0xb7f407){var _0x6c40f5=_0x44aed1[_0xd6bc('0x14')];var _0xf6ffbe=_0x2df500[_0xd6bc('0x15')]({'plain':!![]});return _0x6c40f5['CmHopper']['findAll']({'raw':!![],'where':{'ListId':_0xf6ffbe[_0xd6bc('0x27')],'ContactId':_0xf6ffbe['id']}})[_0xd6bc('0x1f')](function(_0x23971e){if(!_[_0xd6bc('0x44')](_0x23971e)){var _0x327808=[];for(var _0x26636a=0x0;_0x26636a<_0x23971e[_0xd6bc('0x3b')];_0x26636a+=0x1){var _0x3c01d3=_0x6c40f5[_0xd6bc('0x25')][_0xd6bc('0x45')]({'where':{'ListId':_0x23971e[_0x26636a][_0xd6bc('0x27')],'ContactId':_0x23971e[_0x26636a][_0xd6bc('0x46')],'VoiceQueueId':_0x23971e[_0x26636a][_0xd6bc('0x47')],'CampaignId':_0x23971e[_0x26636a][_0xd6bc('0x48')]}});_0x327808['push'](_0x3c01d3);}return BPromise[_0xd6bc('0x49')](_0x327808);}})[_0xd6bc('0x1f')](function(_0x24cf6c){logger['info']('[CmContact][afterDestroy][Succesfull]',util[_0xd6bc('0x19')](_0x24cf6c,{'showHidden':![],'depth':null}));_0xb7f407();})[_0xd6bc('0x30')](function(_0x9d8fa1){logger['error'](_0xd6bc('0x4a'),util[_0xd6bc('0x19')](_0x9d8fa1,{'showHidden':![],'depth':null}));_0xb7f407(_0x9d8fa1);});}}});};
\ No newline at end of file
index df0dfb7..35f5611 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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
+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(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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 13ed081..992f217 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(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 dee1764..dc439ff 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(_0x44958c,_0x5dfba8){var _0x29bc81=function(_0x4af1be){while(--_0x4af1be){_0x44958c['push'](_0x44958c['shift']());}};_0x29bc81(++_0x5dfba8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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(_0xaecc96,_0x48ad32){var _0x13b924=function(_0x1f8c05){while(--_0x1f8c05){_0xaecc96['push'](_0xaecc96['shift']());}};_0x13b924(++_0x48ad32);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('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 f2e5836..3889c06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd73a=['STRING','sequelize','exports','INTEGER'];(function(_0x32ccd7,_0x4d79e8){var _0x283c96=function(_0x27c734){while(--_0x27c734){_0x32ccd7['push'](_0x32ccd7['shift']());}};_0x283c96(++_0x4d79e8);}(_0xd73a,0x171));var _0xad73=function(_0xd0dce5,_0x32178e){_0xd0dce5=_0xd0dce5-0x0;var _0x59d673=_0xd73a[_0xd0dce5];return _0x59d673;};'use strict';var Sequelize=require(_0xad73('0x0'));module[_0xad73('0x1')]={'CmContactId':{'type':Sequelize[_0xad73('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0xad73('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xad73('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0xad73('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0xad73('0x3')],'defaultValue':null}};
\ No newline at end of file
+var _0xfa2f=['PHONE','INTEGER','STRING'];(function(_0xcba28,_0x2e9f36){var _0x17e457=function(_0x5609d0){while(--_0x5609d0){_0xcba28['push'](_0xcba28['shift']());}};_0x17e457(++_0x2e9f36);}(_0xfa2f,0xe8));var _0xffa2=function(_0x3b0357,_0x56bc93){_0x3b0357=_0x3b0357-0x0;var _0x4a56f8=_0xfa2f[_0x3b0357];return _0x4a56f8;};'use strict';var Sequelize=require('sequelize');module['exports']={'CmContactId':{'type':Sequelize[_0xffa2('0x0')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xffa2('0x0')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xffa2('0x1')],'defaultValue':_0xffa2('0x2')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0xffa2('0x1')],'defaultValue':null}};
\ No newline at end of file
index fe3c05c..3fa551e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03c0=['create','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','CmContactHasItems','UserProfileResource','then','error','stack','name','send','index','CmContactHasItem','rawAttributes','fieldName','type','key','model','map','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find'];(function(_0x1e9dd1,_0x2e180a){var _0x1752dc=function(_0x2612f0){while(--_0x2612f0){_0x1e9dd1['push'](_0x1e9dd1['shift']());}};_0x1752dc(++_0x2e180a);}(_0x03c0,0xb7));var _0x003c=function(_0x20763f,_0x95bba){_0x20763f=_0x20763f-0x0;var _0x5462a3=_0x03c0[_0x20763f];return _0x5462a3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x003c('0x0'));var zipdir=require(_0x003c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x003c('0x2'));var moment=require(_0x003c('0x3'));var BPromise=require(_0x003c('0x4'));var Mustache=require(_0x003c('0x5'));var util=require(_0x003c('0x6'));var path=require('path');var sox=require(_0x003c('0x7'));var csv=require('to-csv');var ejs=require(_0x003c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x003c('0x9'));var squel=require(_0x003c('0xa'));var crypto=require(_0x003c('0xb'));var jsforce=require(_0x003c('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x003c('0xd'));var Papa=require(_0x003c('0xe'));var Redis=require('ioredis');var authService=require(_0x003c('0xf'));var qs=require(_0x003c('0x10'));var as=require(_0x003c('0x11'));var hardwareService=require(_0x003c('0x12'));var logger=require(_0x003c('0x13'))(_0x003c('0x14'));var utils=require(_0x003c('0x15'));var config=require(_0x003c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x003c('0x17'))['db'];function respondWithStatusCode(_0x17a25b,_0x106905){_0x106905=_0x106905||0xcc;return function(_0x4984c7){if(_0x4984c7){return _0x17a25b[_0x003c('0x18')](_0x106905);}return _0x17a25b[_0x003c('0x19')](_0x106905)['end']();};}function respondWithResult(_0x3d1578,_0x15ea54){_0x15ea54=_0x15ea54||0xc8;return function(_0x10d684){if(_0x10d684){return _0x3d1578['status'](_0x15ea54)[_0x003c('0x1a')](_0x10d684);}};}function respondWithFilteredResult(_0x506852,_0x308c93){return function(_0x142a07){if(_0x142a07){var _0x2316e6=typeof _0x308c93[_0x003c('0x1b')]===_0x003c('0x1c')&&typeof _0x308c93[_0x003c('0x1d')]===_0x003c('0x1c');var _0x2d68b7=_0x142a07[_0x003c('0x1e')];var _0x2f7e5a=_0x2316e6?0x0:_0x308c93[_0x003c('0x1b')];var _0x3b3807=_0x2316e6?_0x142a07[_0x003c('0x1e')]:_0x308c93[_0x003c('0x1b')]+_0x308c93['limit'];var _0x878513;if(_0x3b3807>=_0x2d68b7){_0x3b3807=_0x2d68b7;_0x878513=0xc8;}else{_0x878513=0xce;}_0x506852[_0x003c('0x19')](_0x878513);return _0x506852[_0x003c('0x1f')](_0x003c('0x20'),_0x2f7e5a+'-'+_0x3b3807+'/'+_0x2d68b7)['json'](_0x142a07);}return null;};}function patchUpdates(_0xfc660e){return function(_0x65b049){try{jsonpatch[_0x003c('0x21')](_0x65b049,_0xfc660e,!![]);}catch(_0x485c5a){return BPromise[_0x003c('0x22')](_0x485c5a);}return _0x65b049[_0x003c('0x23')]();};}function saveUpdates(_0x255a82,_0x3866e2){return function(_0x18830b){if(_0x18830b){return _0x18830b[_0x003c('0x24')](_0x255a82)['then'](function(_0x5b65b4){return _0x5b65b4;});}return null;};}function removeEntity(_0x24ac44,_0x367ff6){return function(_0x183565){if(_0x183565){return _0x183565[_0x003c('0x25')]()['then'](function(){var _0x2ed6d2=_0x183565['get']({'plain':!![]});var _0x2b665b=_0x003c('0x26');return db[_0x003c('0x27')][_0x003c('0x25')]({'where':{'type':_0x2b665b,'resourceId':_0x2ed6d2['id']}})[_0x003c('0x28')](function(){return _0x183565;});})[_0x003c('0x28')](function(){_0x24ac44[_0x003c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e55cc,_0x1c6bbb){return function(_0x706554){if(!_0x706554){_0x2e55cc[_0x003c('0x18')](0x194);}return _0x706554;};}function handleError(_0x30e854,_0x2c41b3){_0x2c41b3=_0x2c41b3||0x1f4;return function(_0x435985){logger[_0x003c('0x29')](_0x435985[_0x003c('0x2a')]);if(_0x435985[_0x003c('0x2b')]){delete _0x435985[_0x003c('0x2b')];}_0x30e854['status'](_0x2c41b3)[_0x003c('0x2c')](_0x435985);};}exports[_0x003c('0x2d')]=function(_0x3d5c7f,_0x489f4e){var _0x1d1245={},_0x6d4a2c={},_0x13dc26={'count':0x0,'rows':[]};var _0x231124=_['map'](db[_0x003c('0x2e')][_0x003c('0x2f')],function(_0x3187ab){return{'name':_0x3187ab[_0x003c('0x30')],'type':_0x3187ab[_0x003c('0x31')][_0x003c('0x32')]};});_0x6d4a2c[_0x003c('0x33')]=_[_0x003c('0x34')](_0x231124,'name');_0x6d4a2c['query']=_[_0x003c('0x35')](_0x3d5c7f[_0x003c('0x36')]);_0x6d4a2c['filters']=_['intersection'](_0x6d4a2c['model'],_0x6d4a2c[_0x003c('0x36')]);_0x1d1245[_0x003c('0x37')]=_[_0x003c('0x38')](_0x6d4a2c[_0x003c('0x33')],qs[_0x003c('0x39')](_0x3d5c7f[_0x003c('0x36')]['fields']));_0x1d1245[_0x003c('0x37')]=_0x1d1245[_0x003c('0x37')][_0x003c('0x3a')]?_0x1d1245[_0x003c('0x37')]:_0x6d4a2c[_0x003c('0x33')];if(!_0x3d5c7f[_0x003c('0x36')][_0x003c('0x3b')](_0x003c('0x3c'))){_0x1d1245[_0x003c('0x1d')]=qs[_0x003c('0x1d')](_0x3d5c7f[_0x003c('0x36')][_0x003c('0x1d')]);_0x1d1245['offset']=qs['offset'](_0x3d5c7f[_0x003c('0x36')][_0x003c('0x1b')]);}_0x1d1245[_0x003c('0x3d')]=qs['sort'](_0x3d5c7f[_0x003c('0x36')][_0x003c('0x3e')]);_0x1d1245['where']=qs[_0x003c('0x3f')](_[_0x003c('0x40')](_0x3d5c7f[_0x003c('0x36')],_0x6d4a2c[_0x003c('0x3f')]),_0x231124);if(_0x3d5c7f[_0x003c('0x36')][_0x003c('0x41')]){_0x1d1245[_0x003c('0x42')]=_[_0x003c('0x43')](_0x1d1245[_0x003c('0x42')],{'$or':_[_0x003c('0x34')](_0x231124,function(_0x3cd7f1){if(_0x3cd7f1[_0x003c('0x31')]!==_0x003c('0x44')){var _0x36005e={};_0x36005e[_0x3cd7f1['name']]={'$like':'%'+_0x3d5c7f['query'][_0x003c('0x41')]+'%'};return _0x36005e;}})});}_0x1d1245=_[_0x003c('0x43')]({},_0x1d1245,_0x3d5c7f['options']);var _0x4be5f8={'where':_0x1d1245[_0x003c('0x42')]};return db[_0x003c('0x2e')][_0x003c('0x1e')](_0x4be5f8)[_0x003c('0x28')](function(_0x203203){_0x13dc26[_0x003c('0x1e')]=_0x203203;if(_0x3d5c7f[_0x003c('0x36')][_0x003c('0x45')]){_0x1d1245[_0x003c('0x46')]=[{'all':!![]}];}return db[_0x003c('0x2e')][_0x003c('0x47')](_0x1d1245);})[_0x003c('0x28')](function(_0x55eb2e){_0x13dc26[_0x003c('0x48')]=_0x55eb2e;return _0x13dc26;})['then'](respondWithFilteredResult(_0x489f4e,_0x1d1245))[_0x003c('0x49')](handleError(_0x489f4e,null));};exports[_0x003c('0x4a')]=function(_0xccc883,_0x16d24a){var _0x3afbea={'raw':!![],'where':{'id':_0xccc883[_0x003c('0x4b')]['id']}},_0x453cf6={};_0x453cf6[_0x003c('0x33')]=_[_0x003c('0x35')](db['CmContactHasItem'][_0x003c('0x2f')]);_0x453cf6[_0x003c('0x36')]=_[_0x003c('0x35')](_0xccc883[_0x003c('0x36')]);_0x453cf6[_0x003c('0x3f')]=_[_0x003c('0x38')](_0x453cf6[_0x003c('0x33')],_0x453cf6[_0x003c('0x36')]);_0x3afbea['attributes']=_[_0x003c('0x38')](_0x453cf6[_0x003c('0x33')],qs[_0x003c('0x39')](_0xccc883[_0x003c('0x36')][_0x003c('0x39')]));_0x3afbea[_0x003c('0x37')]=_0x3afbea[_0x003c('0x37')][_0x003c('0x3a')]?_0x3afbea[_0x003c('0x37')]:_0x453cf6[_0x003c('0x33')];if(_0xccc883[_0x003c('0x36')]['includeAll']){_0x3afbea[_0x003c('0x46')]=[{'all':!![]}];}_0x3afbea=_[_0x003c('0x43')]({},_0x3afbea,_0xccc883[_0x003c('0x4c')]);return db['CmContactHasItem'][_0x003c('0x4d')](_0x3afbea)[_0x003c('0x28')](handleEntityNotFound(_0x16d24a,null))[_0x003c('0x28')](respondWithResult(_0x16d24a,null))['catch'](handleError(_0x16d24a,null));};exports[_0x003c('0x4e')]=function(_0x964ea0,_0x3f76d6){return db[_0x003c('0x2e')][_0x003c('0x4e')](_0x964ea0['body'],{})[_0x003c('0x28')](function(_0x259cb2){var _0x4a72a8=_0x964ea0[_0x003c('0x4f')][_0x003c('0x50')]({'plain':!![]});if(!_0x4a72a8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a72a8[_0x003c('0x51')]===_0x003c('0x4f')){var _0x3466b2=_0x259cb2[_0x003c('0x50')]({'plain':!![]});var _0x197dda=_0x003c('0x26');return db[_0x003c('0x52')][_0x003c('0x4d')]({'where':{'name':_0x197dda,'userProfileId':_0x4a72a8[_0x003c('0x53')]},'raw':!![]})[_0x003c('0x28')](function(_0x3148a0){if(_0x3148a0&&_0x3148a0[_0x003c('0x54')]===0x0){return db[_0x003c('0x27')][_0x003c('0x4e')]({'name':_0x3466b2['name'],'resourceId':_0x3466b2['id'],'type':_0x3148a0[_0x003c('0x2b')],'sectionId':_0x3148a0['id']},{})[_0x003c('0x28')](function(){return _0x259cb2;});}else{return _0x259cb2;}})['catch'](function(_0x1ff1c5){logger[_0x003c('0x29')](_0x003c('0x55'),_0x1ff1c5);throw _0x1ff1c5;});}return _0x259cb2;})['then'](respondWithResult(_0x3f76d6,0xc9))[_0x003c('0x49')](handleError(_0x3f76d6,null));};exports['update']=function(_0x5fd522,_0x46a4a6){if(_0x5fd522['body']['id']){delete _0x5fd522[_0x003c('0x56')]['id'];}return db[_0x003c('0x2e')][_0x003c('0x4d')]({'where':{'id':_0x5fd522[_0x003c('0x4b')]['id']}})[_0x003c('0x28')](handleEntityNotFound(_0x46a4a6,null))[_0x003c('0x28')](saveUpdates(_0x5fd522['body'],null))[_0x003c('0x28')](respondWithResult(_0x46a4a6,null))['catch'](handleError(_0x46a4a6,null));};exports[_0x003c('0x25')]=function(_0x5774ec,_0x1919d){return db[_0x003c('0x2e')][_0x003c('0x4d')]({'where':{'id':_0x5774ec[_0x003c('0x4b')]['id']}})[_0x003c('0x28')](handleEntityNotFound(_0x1919d,null))[_0x003c('0x28')](removeEntity(_0x1919d,null))['catch'](handleError(_0x1919d,null));};
\ No newline at end of file
+var _0x5f5b=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','CmContactHasItem','include','findAll','catch','show','params','length','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','CmContactHasItems','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf'];(function(_0x2d86ec,_0x41f8cd){var _0x2ad1d6=function(_0x684615){while(--_0x684615){_0x2d86ec['push'](_0x2d86ec['shift']());}};_0x2ad1d6(++_0x41f8cd);}(_0x5f5b,0x194));var _0xb5f5=function(_0x5b520e,_0x2bf6d8){_0x5b520e=_0x5b520e-0x0;var _0x4ab18b=_0x5f5b[_0x5b520e];return _0x4ab18b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb5f5('0x0'));var zipdir=require(_0xb5f5('0x1'));var jsonpatch=require(_0xb5f5('0x2'));var rp=require('request-promise');var moment=require(_0xb5f5('0x3'));var BPromise=require(_0xb5f5('0x4'));var Mustache=require(_0xb5f5('0x5'));var util=require(_0xb5f5('0x6'));var path=require(_0xb5f5('0x7'));var sox=require('sox');var csv=require(_0xb5f5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb5f5('0x9'));var _=require(_0xb5f5('0xa'));var squel=require('squel');var crypto=require(_0xb5f5('0xb'));var jsforce=require(_0xb5f5('0xc'));var deskjs=require(_0xb5f5('0xd'));var toCsv=require(_0xb5f5('0x8'));var querystring=require('querystring');var Papa=require(_0xb5f5('0xe'));var Redis=require(_0xb5f5('0xf'));var authService=require(_0xb5f5('0x10'));var qs=require(_0xb5f5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb5f5('0x12'));var logger=require(_0xb5f5('0x13'))(_0xb5f5('0x14'));var utils=require(_0xb5f5('0x15'));var config=require(_0xb5f5('0x16'));var licenseUtil=require(_0xb5f5('0x17'));var db=require(_0xb5f5('0x18'))['db'];function respondWithStatusCode(_0x4a5849,_0x4b830e){_0x4b830e=_0x4b830e||0xcc;return function(_0xa7b701){if(_0xa7b701){return _0x4a5849[_0xb5f5('0x19')](_0x4b830e);}return _0x4a5849[_0xb5f5('0x1a')](_0x4b830e)[_0xb5f5('0x1b')]();};}function respondWithResult(_0x1eab1d,_0x279293){_0x279293=_0x279293||0xc8;return function(_0x149edd){if(_0x149edd){return _0x1eab1d[_0xb5f5('0x1a')](_0x279293)['json'](_0x149edd);}};}function respondWithFilteredResult(_0x4bdc59,_0x5bf249){return function(_0x3bb3e5){if(_0x3bb3e5){var _0x220381=typeof _0x5bf249[_0xb5f5('0x1c')]===_0xb5f5('0x1d')&&typeof _0x5bf249['limit']===_0xb5f5('0x1d');var _0x31ba7c=_0x3bb3e5[_0xb5f5('0x1e')];var _0x418524=_0x220381?0x0:_0x5bf249['offset'];var _0x566ec8=_0x220381?_0x3bb3e5['count']:_0x5bf249[_0xb5f5('0x1c')]+_0x5bf249[_0xb5f5('0x1f')];var _0x18db9b;if(_0x566ec8>=_0x31ba7c){_0x566ec8=_0x31ba7c;_0x18db9b=0xc8;}else{_0x18db9b=0xce;}_0x4bdc59[_0xb5f5('0x1a')](_0x18db9b);return _0x4bdc59[_0xb5f5('0x20')](_0xb5f5('0x21'),_0x418524+'-'+_0x566ec8+'/'+_0x31ba7c)[_0xb5f5('0x22')](_0x3bb3e5);}return null;};}function patchUpdates(_0x400b8c){return function(_0x34277b){try{jsonpatch[_0xb5f5('0x23')](_0x34277b,_0x400b8c,!![]);}catch(_0x195ad6){return BPromise[_0xb5f5('0x24')](_0x195ad6);}return _0x34277b[_0xb5f5('0x25')]();};}function saveUpdates(_0x17346a,_0x50bd16){return function(_0x22a5e8){if(_0x22a5e8){return _0x22a5e8[_0xb5f5('0x26')](_0x17346a)[_0xb5f5('0x27')](function(_0x595813){return _0x595813;});}return null;};}function removeEntity(_0x2d2ba6,_0x59d636){return function(_0x1c6ec8){if(_0x1c6ec8){return _0x1c6ec8['destroy']()['then'](function(){var _0x5ab2e8=_0x1c6ec8[_0xb5f5('0x28')]({'plain':!![]});var _0x58f779='CmContactHasItems';return db[_0xb5f5('0x29')][_0xb5f5('0x2a')]({'where':{'type':_0x58f779,'resourceId':_0x5ab2e8['id']}})[_0xb5f5('0x27')](function(){return _0x1c6ec8;});})[_0xb5f5('0x27')](function(){_0x2d2ba6[_0xb5f5('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23d5c0,_0x4e8782){return function(_0x543bdf){if(!_0x543bdf){_0x23d5c0[_0xb5f5('0x19')](0x194);}return _0x543bdf;};}function handleError(_0x2d7ed9,_0x301cad){_0x301cad=_0x301cad||0x1f4;return function(_0x2bc12c){logger[_0xb5f5('0x2b')](_0x2bc12c[_0xb5f5('0x2c')]);if(_0x2bc12c[_0xb5f5('0x2d')]){delete _0x2bc12c['name'];}_0x2d7ed9[_0xb5f5('0x1a')](_0x301cad)[_0xb5f5('0x2e')](_0x2bc12c);};}exports['index']=function(_0x5e82dc,_0x166efe){var _0x6a58c8={},_0x507973={},_0x43259e={'count':0x0,'rows':[]};var _0x57038e=_[_0xb5f5('0x2f')](db['CmContactHasItem'][_0xb5f5('0x30')],function(_0x13780a){return{'name':_0x13780a[_0xb5f5('0x31')],'type':_0x13780a[_0xb5f5('0x32')]['key']};});_0x507973[_0xb5f5('0x33')]=_[_0xb5f5('0x2f')](_0x57038e,_0xb5f5('0x2d'));_0x507973[_0xb5f5('0x34')]=_[_0xb5f5('0x35')](_0x5e82dc[_0xb5f5('0x34')]);_0x507973[_0xb5f5('0x36')]=_[_0xb5f5('0x37')](_0x507973[_0xb5f5('0x33')],_0x507973[_0xb5f5('0x34')]);_0x6a58c8[_0xb5f5('0x38')]=_['intersection'](_0x507973[_0xb5f5('0x33')],qs[_0xb5f5('0x39')](_0x5e82dc['query']['fields']));_0x6a58c8[_0xb5f5('0x38')]=_0x6a58c8[_0xb5f5('0x38')]['length']?_0x6a58c8[_0xb5f5('0x38')]:_0x507973[_0xb5f5('0x33')];if(!_0x5e82dc['query'][_0xb5f5('0x3a')](_0xb5f5('0x3b'))){_0x6a58c8[_0xb5f5('0x1f')]=qs[_0xb5f5('0x1f')](_0x5e82dc[_0xb5f5('0x34')][_0xb5f5('0x1f')]);_0x6a58c8[_0xb5f5('0x1c')]=qs[_0xb5f5('0x1c')](_0x5e82dc[_0xb5f5('0x34')][_0xb5f5('0x1c')]);}_0x6a58c8['order']=qs[_0xb5f5('0x3c')](_0x5e82dc[_0xb5f5('0x34')][_0xb5f5('0x3c')]);_0x6a58c8[_0xb5f5('0x3d')]=qs['filters'](_[_0xb5f5('0x3e')](_0x5e82dc[_0xb5f5('0x34')],_0x507973[_0xb5f5('0x36')]),_0x57038e);if(_0x5e82dc[_0xb5f5('0x34')][_0xb5f5('0x3f')]){_0x6a58c8[_0xb5f5('0x3d')]=_[_0xb5f5('0x40')](_0x6a58c8[_0xb5f5('0x3d')],{'$or':_['map'](_0x57038e,function(_0x5cfb31){if(_0x5cfb31[_0xb5f5('0x32')]!=='VIRTUAL'){var _0x36b4d9={};_0x36b4d9[_0x5cfb31[_0xb5f5('0x2d')]]={'$like':'%'+_0x5e82dc[_0xb5f5('0x34')][_0xb5f5('0x3f')]+'%'};return _0x36b4d9;}})});}_0x6a58c8=_[_0xb5f5('0x40')]({},_0x6a58c8,_0x5e82dc['options']);var _0x2d3251={'where':_0x6a58c8[_0xb5f5('0x3d')]};return db[_0xb5f5('0x41')][_0xb5f5('0x1e')](_0x2d3251)[_0xb5f5('0x27')](function(_0x53e43d){_0x43259e[_0xb5f5('0x1e')]=_0x53e43d;if(_0x5e82dc[_0xb5f5('0x34')]['includeAll']){_0x6a58c8[_0xb5f5('0x42')]=[{'all':!![]}];}return db[_0xb5f5('0x41')][_0xb5f5('0x43')](_0x6a58c8);})[_0xb5f5('0x27')](function(_0x817682){_0x43259e['rows']=_0x817682;return _0x43259e;})[_0xb5f5('0x27')](respondWithFilteredResult(_0x166efe,_0x6a58c8))[_0xb5f5('0x44')](handleError(_0x166efe,null));};exports[_0xb5f5('0x45')]=function(_0x3720e6,_0x406ea0){var _0x3c4ea4={'raw':!![],'where':{'id':_0x3720e6[_0xb5f5('0x46')]['id']}},_0x69a4e7={};_0x69a4e7['model']=_[_0xb5f5('0x35')](db[_0xb5f5('0x41')][_0xb5f5('0x30')]);_0x69a4e7[_0xb5f5('0x34')]=_[_0xb5f5('0x35')](_0x3720e6[_0xb5f5('0x34')]);_0x69a4e7[_0xb5f5('0x36')]=_['intersection'](_0x69a4e7[_0xb5f5('0x33')],_0x69a4e7[_0xb5f5('0x34')]);_0x3c4ea4['attributes']=_['intersection'](_0x69a4e7[_0xb5f5('0x33')],qs[_0xb5f5('0x39')](_0x3720e6[_0xb5f5('0x34')][_0xb5f5('0x39')]));_0x3c4ea4[_0xb5f5('0x38')]=_0x3c4ea4['attributes'][_0xb5f5('0x47')]?_0x3c4ea4[_0xb5f5('0x38')]:_0x69a4e7[_0xb5f5('0x33')];if(_0x3720e6[_0xb5f5('0x34')]['includeAll']){_0x3c4ea4[_0xb5f5('0x42')]=[{'all':!![]}];}_0x3c4ea4=_[_0xb5f5('0x40')]({},_0x3c4ea4,_0x3720e6[_0xb5f5('0x48')]);return db[_0xb5f5('0x41')][_0xb5f5('0x49')](_0x3c4ea4)[_0xb5f5('0x27')](handleEntityNotFound(_0x406ea0,null))['then'](respondWithResult(_0x406ea0,null))[_0xb5f5('0x44')](handleError(_0x406ea0,null));};exports[_0xb5f5('0x4a')]=function(_0x5b4117,_0x54cb98){return db[_0xb5f5('0x41')][_0xb5f5('0x4a')](_0x5b4117[_0xb5f5('0x4b')],{})['then'](function(_0x32ad2b){var _0x53f07c=_0x5b4117['user'][_0xb5f5('0x28')]({'plain':!![]});if(!_0x53f07c)throw new Error(_0xb5f5('0x4c'));if(_0x53f07c['role']===_0xb5f5('0x4d')){var _0x1cf22c=_0x32ad2b[_0xb5f5('0x28')]({'plain':!![]});var _0x551045=_0xb5f5('0x4e');return db[_0xb5f5('0x4f')][_0xb5f5('0x49')]({'where':{'name':_0x551045,'userProfileId':_0x53f07c['userProfileId']},'raw':!![]})[_0xb5f5('0x27')](function(_0x2c6595){if(_0x2c6595&&_0x2c6595['autoAssociation']===0x0){return db[_0xb5f5('0x29')][_0xb5f5('0x4a')]({'name':_0x1cf22c[_0xb5f5('0x2d')],'resourceId':_0x1cf22c['id'],'type':_0x2c6595['name'],'sectionId':_0x2c6595['id']},{})[_0xb5f5('0x27')](function(){return _0x32ad2b;});}else{return _0x32ad2b;}})[_0xb5f5('0x44')](function(_0x12b8fd){logger[_0xb5f5('0x2b')](_0xb5f5('0x50'),_0x12b8fd);throw _0x12b8fd;});}return _0x32ad2b;})[_0xb5f5('0x27')](respondWithResult(_0x54cb98,0xc9))[_0xb5f5('0x44')](handleError(_0x54cb98,null));};exports['update']=function(_0x2cc4da,_0x54d395){if(_0x2cc4da['body']['id']){delete _0x2cc4da[_0xb5f5('0x4b')]['id'];}return db[_0xb5f5('0x41')][_0xb5f5('0x49')]({'where':{'id':_0x2cc4da[_0xb5f5('0x46')]['id']}})[_0xb5f5('0x27')](handleEntityNotFound(_0x54d395,null))[_0xb5f5('0x27')](saveUpdates(_0x2cc4da[_0xb5f5('0x4b')],null))[_0xb5f5('0x27')](respondWithResult(_0x54d395,null))[_0xb5f5('0x44')](handleError(_0x54d395,null));};exports[_0xb5f5('0x2a')]=function(_0x49fcc0,_0x3eb3b7){return db[_0xb5f5('0x41')]['find']({'where':{'id':_0x49fcc0[_0xb5f5('0x46')]['id']}})[_0xb5f5('0x27')](handleEntityNotFound(_0x3eb3b7,null))[_0xb5f5('0x27')](removeEntity(_0x3eb3b7,null))['catch'](handleError(_0x3eb3b7,null));};
\ No newline at end of file
index 97b3031..f856af8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc64d=['request-promise','../../config/environment','exports','define','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc64d,0x1d2));var _0xdc64=function(_0x416d57,_0x144d3f){_0x416d57=_0x416d57-0x0;var _0x2c2289=_0xc64d[_0x416d57];return _0x2c2289;};'use strict';var _=require(_0xdc64('0x0'));var util=require(_0xdc64('0x1'));var logger=require(_0xdc64('0x2'))(_0xdc64('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdc64('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdc64('0x5'));var attributes=require('./cmContactHasItem.attributes');module[_0xdc64('0x6')]=function(_0x10baab,_0x38273d){return _0x10baab[_0xdc64('0x7')](_0xdc64('0x8'),attributes,{'tableName':_0xdc64('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6731=['../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4dddcc,_0x5dae19){var _0x2e9da1=function(_0x141fc0){while(--_0x141fc0){_0x4dddcc['push'](_0x4dddcc['shift']());}};_0x2e9da1(++_0x5dae19);}(_0x6731,0x180));var _0x1673=function(_0x2da402,_0x14a691){_0x2da402=_0x2da402-0x0;var _0x31a57d=_0x6731[_0x2da402];return _0x31a57d;};'use strict';var _=require(_0x1673('0x0'));var util=require('util');var logger=require(_0x1673('0x1'))(_0x1673('0x2'));var moment=require(_0x1673('0x3'));var BPromise=require(_0x1673('0x4'));var rp=require(_0x1673('0x5'));var fs=require('fs');var path=require(_0x1673('0x6'));var rimraf=require(_0x1673('0x7'));var config=require(_0x1673('0x8'));var attributes=require(_0x1673('0x9'));module[_0x1673('0xa')]=function(_0x19fab3,_0x4677f8){return _0x19fab3[_0x1673('0xb')](_0x1673('0xc'),attributes,{'tableName':_0x1673('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d6d2b5c..216c287 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5af1=['rpc','client','http','then','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3bc10d,_0x21ebb2){var _0x4619be=function(_0x1e1684){while(--_0x1e1684){_0x3bc10d['push'](_0x3bc10d['shift']());}};_0x4619be(++_0x21ebb2);}(_0x5af1,0xc1));var _0x15af=function(_0x43b08,_0x15f967){_0x43b08=_0x43b08-0x0;var _0x5e05f4=_0x5af1[_0x43b08];return _0x5e05f4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x15af('0x0'));var BPromise=require(_0x15af('0x1'));var rs=require(_0x15af('0x2'));var fs=require('fs');var Redis=require(_0x15af('0x3'));var db=require(_0x15af('0x4'))['db'];var utils=require(_0x15af('0x5'));var logger=require(_0x15af('0x6'))(_0x15af('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x15af('0x8')][_0x15af('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c7a11,_0x50bb92,_0x2811b9){return new BPromise(function(_0x8a52e1,_0x1d201b){return client['request'](_0x5c7a11,_0x2811b9)[_0x15af('0xa')](function(_0x5e74b8){logger['info'](_0x15af('0xb'),_0x50bb92,_0x15af('0xc'));logger[_0x15af('0xd')](_0x15af('0xe'),_0x50bb92,_0x15af('0xc'),JSON[_0x15af('0xf')](_0x5e74b8));if(_0x5e74b8[_0x15af('0x10')]){if(_0x5e74b8[_0x15af('0x10')][_0x15af('0x11')]===0x1f4){logger['error'](_0x15af('0xb'),_0x50bb92,_0x5e74b8[_0x15af('0x10')][_0x15af('0x12')]);return _0x1d201b(_0x5e74b8['error'][_0x15af('0x12')]);}logger[_0x15af('0x10')](_0x15af('0xb'),_0x50bb92,_0x5e74b8['error']['message']);return _0x8a52e1(_0x5e74b8[_0x15af('0x10')][_0x15af('0x12')]);}else{logger['info'](_0x15af('0xb'),_0x50bb92,_0x15af('0xc'));_0x8a52e1(_0x5e74b8['result'][_0x15af('0x12')]);}})[_0x15af('0x13')](function(_0x460e78){logger[_0x15af('0x10')](_0x15af('0xb'),_0x50bb92,_0x460e78);_0x1d201b(_0x460e78);});});}
\ No newline at end of file
+var _0xebdb=['result','catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x10b61c,_0x5b58cd){var _0x2fc614=function(_0x299fbf){while(--_0x299fbf){_0x10b61c['push'](_0x10b61c['shift']());}};_0x2fc614(++_0x5b58cd);}(_0xebdb,0xc0));var _0xbebd=function(_0x2ae469,_0xbb37f){_0x2ae469=_0x2ae469-0x0;var _0x30b677=_0xebdb[_0x2ae469];return _0x30b677;};'use strict';var _=require(_0xbebd('0x0'));var util=require(_0xbebd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbebd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbebd('0x3'));var logger=require(_0xbebd('0x4'))(_0xbebd('0x5'));var config=require(_0xbebd('0x6'));var jayson=require(_0xbebd('0x7'));var client=jayson[_0xbebd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f0a43,_0x2792a1,_0x2984fb){return new BPromise(function(_0x103a1d,_0x10b2f3){return client[_0xbebd('0x9')](_0x2f0a43,_0x2984fb)['then'](function(_0x5927bc){logger[_0xbebd('0xa')](_0xbebd('0xb'),_0x2792a1,_0xbebd('0xc'));logger['debug']('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x2792a1,_0xbebd('0xc'),JSON[_0xbebd('0xd')](_0x5927bc));if(_0x5927bc[_0xbebd('0xe')]){if(_0x5927bc[_0xbebd('0xe')][_0xbebd('0xf')]===0x1f4){logger[_0xbebd('0xe')](_0xbebd('0xb'),_0x2792a1,_0x5927bc[_0xbebd('0xe')]['message']);return _0x10b2f3(_0x5927bc[_0xbebd('0xe')][_0xbebd('0x10')]);}logger[_0xbebd('0xe')](_0xbebd('0xb'),_0x2792a1,_0x5927bc[_0xbebd('0xe')][_0xbebd('0x10')]);return _0x103a1d(_0x5927bc[_0xbebd('0xe')][_0xbebd('0x10')]);}else{logger['info'](_0xbebd('0xb'),_0x2792a1,_0xbebd('0xc'));_0x103a1d(_0x5927bc[_0xbebd('0x11')][_0xbebd('0x10')]);}})[_0xbebd('0x12')](function(_0x45b12b){logger[_0xbebd('0xe')]('CmContactHasItem,\x20%s,\x20%s',_0x2792a1,_0x45b12b);_0x10b2f3(_0x45b12b);});});}
\ No newline at end of file
index 3c17cee..37adb07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68d7=['../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x68d7,0xf4));var _0x768d=function(_0x56244d,_0xd0d67c){_0x56244d=_0x56244d-0x0;var _0x130a2b=_0x68d7[_0x56244d];return _0x130a2b;};'use strict';var multer=require(_0x768d('0x0'));var util=require(_0x768d('0x1'));var path=require('path');var timeout=require(_0x768d('0x2'));var express=require(_0x768d('0x3'));var router=express[_0x768d('0x4')]();var fs_extra=require(_0x768d('0x5'));var auth=require(_0x768d('0x6'));var interaction=require(_0x768d('0x7'));var config=require(_0x768d('0x8'));var controller=require(_0x768d('0x9'));router[_0x768d('0xa')]('/',auth[_0x768d('0xb')](),controller[_0x768d('0xc')]);router[_0x768d('0xa')](_0x768d('0xd'),auth['isAuthenticated'](),controller[_0x768d('0xe')]);router['post']('/',auth[_0x768d('0xb')](),controller[_0x768d('0xf')]);router[_0x768d('0x10')]('/:id',auth[_0x768d('0xb')](),controller[_0x768d('0x11')]);router[_0x768d('0x12')](_0x768d('0xd'),auth[_0x768d('0xb')](),controller[_0x768d('0x13')]);module[_0x768d('0x14')]=router;
\ No newline at end of file
+var _0xac42=['./cmContactHasItem.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xac42,0xe3));var _0x2ac4=function(_0x3246a6,_0x2a685a){_0x3246a6=_0x3246a6-0x0;var _0x1df64d=_0xac42[_0x3246a6];return _0x1df64d;};'use strict';var multer=require(_0x2ac4('0x0'));var util=require(_0x2ac4('0x1'));var path=require(_0x2ac4('0x2'));var timeout=require(_0x2ac4('0x3'));var express=require(_0x2ac4('0x4'));var router=express[_0x2ac4('0x5')]();var fs_extra=require(_0x2ac4('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2ac4('0x7'));router[_0x2ac4('0x8')]('/',auth[_0x2ac4('0x9')](),controller['index']);router[_0x2ac4('0x8')](_0x2ac4('0xa'),auth['isAuthenticated'](),controller[_0x2ac4('0xb')]);router[_0x2ac4('0xc')]('/',auth['isAuthenticated'](),controller[_0x2ac4('0xd')]);router[_0x2ac4('0xe')](_0x2ac4('0xa'),auth[_0x2ac4('0x9')](),controller[_0x2ac4('0xf')]);router['delete'](_0x2ac4('0xa'),auth[_0x2ac4('0x9')](),controller[_0x2ac4('0x10')]);module[_0x2ac4('0x11')]=router;
\ No newline at end of file
index ffd20e9..6525305 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc0c=['VIRTUAL','getDataValue','alias','STRING','setDataValue','name','TEXT','long','type','select','parse','values','isArray','stringify','ENUM','voice','sequelize','lodash','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc0c,0x1eb));var _0xcdc0=function(_0x58be6e,_0x2aced4){_0x58be6e=_0x58be6e-0x0;var _0x334457=_0xdc0c[_0x58be6e];return _0x334457;};'use strict';var Sequelize=require(_0xcdc0('0x0'));var _=require(_0xcdc0('0x1'));module[_0xcdc0('0x2')]={'name':{'type':Sequelize[_0xcdc0('0x3')],'get':function(_0x6dc7d){return this[_0xcdc0('0x4')](_0xcdc0('0x5'));}},'alias':{'type':Sequelize[_0xcdc0('0x6')],'allowNull':![],'set':function(_0x2e501f){this[_0xcdc0('0x7')](_0xcdc0('0x5'),_0x2e501f?_0x2e501f:this[_0xcdc0('0x4')](_0xcdc0('0x8')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0xcdc0('0x9')](_0xcdc0('0xa')),'get':function(){if(this['getDataValue'](_0xcdc0('0xb'))===_0xcdc0('0xc')){return JSON[_0xcdc0('0xd')](this['getDataValue'](_0xcdc0('0xe')));}else{return this[_0xcdc0('0x4')]('values');}},'set':function(_0x3c4d55){if(Array[_0xcdc0('0xf')](_0x3c4d55)){this['setDataValue'](_0xcdc0('0xe'),JSON[_0xcdc0('0x10')](_0x3c4d55));}else{this['setDataValue'](_0xcdc0('0xe'),_0x3c4d55);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0xcdc0('0x11')](_0xcdc0('0x12'))}};
\ No newline at end of file
+var _0x53be=['getDataValue','alias','name','TEXT','select','parse','values','isArray','stringify','setDataValue','BOOLEAN','ENUM','voice','sequelize','lodash'];(function(_0x345a28,_0x1291f2){var _0x5bbcd3=function(_0x7a742e){while(--_0x7a742e){_0x345a28['push'](_0x345a28['shift']());}};_0x5bbcd3(++_0x1291f2);}(_0x53be,0x148));var _0xe53b=function(_0x4cb086,_0x44fd53){_0x4cb086=_0x4cb086-0x0;var _0x2deb7d=_0x53be[_0x4cb086];return _0x2deb7d;};'use strict';var Sequelize=require(_0xe53b('0x0'));var _=require(_0xe53b('0x1'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4a760a){return this[_0xe53b('0x2')](_0xe53b('0x3'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x17f74f){this['setDataValue'](_0xe53b('0x3'),_0x17f74f?_0x17f74f:this[_0xe53b('0x2')](_0xe53b('0x4')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0xe53b('0x5')]('long'),'get':function(){if(this[_0xe53b('0x2')]('type')===_0xe53b('0x6')){return JSON[_0xe53b('0x7')](this[_0xe53b('0x2')](_0xe53b('0x8')));}else{return this['getDataValue']('values');}},'set':function(_0x15ee16){if(Array[_0xe53b('0x9')](_0x15ee16)){this['setDataValue'](_0xe53b('0x8'),JSON[_0xe53b('0xa')](_0x15ee16));}else{this[_0xe53b('0xb')]('values',_0x15ee16);}}},'required':{'type':Sequelize[_0xe53b('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xe53b('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xe53b('0xd')](_0xe53b('0xe'))}};
\ No newline at end of file
index cbcd4e2..6160d89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1378=['includeAll','findAll','rows','catch','show','params','rawAttributes','update','body','find','create','sequelize','TEXT','text','Sequelize','number','INTEGER','defaultValue','queryInterface','addColumn','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','json','apply','reject','save','then','destroy','sendStatus','error','name','send','index','map','CmCustomField','type','keys','query','filters','intersection','attributes','fields','length','model','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options'];(function(_0xd58ad1,_0x38fd59){var _0x2495ac=function(_0x22dbcf){while(--_0x22dbcf){_0xd58ad1['push'](_0xd58ad1['shift']());}};_0x2495ac(++_0x38fd59);}(_0x1378,0x160));var _0x8137=function(_0x4675f5,_0x496ad2){_0x4675f5=_0x4675f5-0x0;var _0x481965=_0x1378[_0x4675f5];return _0x481965;};'use strict';var emlformat=require(_0x8137('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8137('0x1'));var jsonpatch=require(_0x8137('0x2'));var rp=require(_0x8137('0x3'));var moment=require(_0x8137('0x4'));var BPromise=require(_0x8137('0x5'));var Mustache=require(_0x8137('0x6'));var util=require(_0x8137('0x7'));var path=require('path');var sox=require(_0x8137('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8137('0x9'));var squel=require('squel');var crypto=require(_0x8137('0xa'));var jsforce=require(_0x8137('0xb'));var deskjs=require(_0x8137('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8137('0xd'));var Papa=require(_0x8137('0xe'));var Redis=require(_0x8137('0xf'));var authService=require(_0x8137('0x10'));var qs=require(_0x8137('0x11'));var as=require(_0x8137('0x12'));var hardwareService=require(_0x8137('0x13'));var logger=require(_0x8137('0x14'))(_0x8137('0x15'));var utils=require(_0x8137('0x16'));var config=require(_0x8137('0x17'));var licenseUtil=require(_0x8137('0x18'));var db=require(_0x8137('0x19'))['db'];function respondWithStatusCode(_0x156273,_0x9bd661){_0x9bd661=_0x9bd661||0xcc;return function(_0x1e2164){if(_0x1e2164){return _0x156273['sendStatus'](_0x9bd661);}return _0x156273[_0x8137('0x1a')](_0x9bd661)[_0x8137('0x1b')]();};}function respondWithResult(_0x2edce3,_0x58b901){_0x58b901=_0x58b901||0xc8;return function(_0x2f27b5){if(_0x2f27b5){return _0x2edce3[_0x8137('0x1a')](_0x58b901)['json'](_0x2f27b5);}};}function respondWithFilteredResult(_0x1b5328,_0x45d769){return function(_0xa897a){if(_0xa897a){var _0x373c1b=typeof _0x45d769[_0x8137('0x1c')]===_0x8137('0x1d')&&typeof _0x45d769[_0x8137('0x1e')]===_0x8137('0x1d');var _0x41ee37=_0xa897a['count'];var _0x52cd56=_0x373c1b?0x0:_0x45d769['offset'];var _0x4b0de8=_0x373c1b?_0xa897a[_0x8137('0x1f')]:_0x45d769['offset']+_0x45d769['limit'];var _0x261852;if(_0x4b0de8>=_0x41ee37){_0x4b0de8=_0x41ee37;_0x261852=0xc8;}else{_0x261852=0xce;}_0x1b5328['status'](_0x261852);return _0x1b5328['set']('Content-Range',_0x52cd56+'-'+_0x4b0de8+'/'+_0x41ee37)[_0x8137('0x20')](_0xa897a);}return null;};}function patchUpdates(_0x979a81){return function(_0xa175fc){try{jsonpatch[_0x8137('0x21')](_0xa175fc,_0x979a81,!![]);}catch(_0x24f3f6){return BPromise[_0x8137('0x22')](_0x24f3f6);}return _0xa175fc[_0x8137('0x23')]();};}function saveUpdates(_0x59dc27,_0x186c99){return function(_0x302320){if(_0x302320){return _0x302320['update'](_0x59dc27)[_0x8137('0x24')](function(_0x5c1326){return _0x5c1326;});}return null;};}function removeEntity(_0x2bebdd,_0x2b0de0){return function(_0x305b9d){if(_0x305b9d){return _0x305b9d[_0x8137('0x25')]()[_0x8137('0x24')](function(){_0x2bebdd[_0x8137('0x1a')](0xcc)[_0x8137('0x1b')]();});}};}function handleEntityNotFound(_0x560c10,_0x3e9eeb){return function(_0x432141){if(!_0x432141){_0x560c10[_0x8137('0x26')](0x194);}return _0x432141;};}function handleError(_0x37100a,_0x3463c5){_0x3463c5=_0x3463c5||0x1f4;return function(_0x389589){logger[_0x8137('0x27')](_0x389589['stack']);if(_0x389589[_0x8137('0x28')]){delete _0x389589[_0x8137('0x28')];}_0x37100a[_0x8137('0x1a')](_0x3463c5)[_0x8137('0x29')](_0x389589);};}exports[_0x8137('0x2a')]=function(_0x2213d3,_0x36cfb4){var _0x4913de={},_0x1e9a9b={},_0x3e0d3f={'count':0x0,'rows':[]};var _0x4007ba=_[_0x8137('0x2b')](db[_0x8137('0x2c')]['rawAttributes'],function(_0x22405c){return{'name':_0x22405c['fieldName'],'type':_0x22405c[_0x8137('0x2d')]['key']};});_0x1e9a9b['model']=_['differenceBy'](_[_0x8137('0x2b')](_0x4007ba,'name'),['name']);_0x1e9a9b['query']=_[_0x8137('0x2e')](_0x2213d3[_0x8137('0x2f')]);_0x1e9a9b[_0x8137('0x30')]=_[_0x8137('0x31')](_0x1e9a9b['model'],_0x1e9a9b[_0x8137('0x2f')]);_0x4913de[_0x8137('0x32')]=_[_0x8137('0x31')](_0x1e9a9b['model'],qs[_0x8137('0x33')](_0x2213d3[_0x8137('0x2f')][_0x8137('0x33')]));_0x4913de[_0x8137('0x32')]=_0x4913de[_0x8137('0x32')][_0x8137('0x34')]?_0x4913de[_0x8137('0x32')]:_0x1e9a9b[_0x8137('0x35')];if(!_0x2213d3['query']['hasOwnProperty'](_0x8137('0x36'))){_0x4913de[_0x8137('0x1e')]=qs[_0x8137('0x1e')](_0x2213d3[_0x8137('0x2f')][_0x8137('0x1e')]);_0x4913de[_0x8137('0x1c')]=qs[_0x8137('0x1c')](_0x2213d3[_0x8137('0x2f')][_0x8137('0x1c')]);}_0x4913de[_0x8137('0x37')]=qs[_0x8137('0x38')](_0x2213d3[_0x8137('0x2f')][_0x8137('0x38')]);_0x4913de['where']=qs[_0x8137('0x30')](_[_0x8137('0x39')](_0x2213d3[_0x8137('0x2f')],_0x1e9a9b[_0x8137('0x30')]),_0x4007ba);if(_0x2213d3[_0x8137('0x2f')][_0x8137('0x3a')]){_0x4913de[_0x8137('0x3b')]=_['merge'](_0x4913de['where'],{'$or':_[_0x8137('0x2b')](_0x4007ba,function(_0x272fff){if(_0x272fff[_0x8137('0x2d')]!==_0x8137('0x3c')){var _0x271b3c={};_0x271b3c[_0x272fff['name']]={'$like':'%'+_0x2213d3[_0x8137('0x2f')][_0x8137('0x3a')]+'%'};return _0x271b3c;}})});}_0x4913de=_[_0x8137('0x3d')]({},_0x4913de,_0x2213d3[_0x8137('0x3e')]);var _0x426e94={'where':_0x4913de[_0x8137('0x3b')]};return db['CmCustomField']['count'](_0x426e94)[_0x8137('0x24')](function(_0x484bc6){_0x3e0d3f[_0x8137('0x1f')]=_0x484bc6;if(_0x2213d3['query'][_0x8137('0x3f')]){_0x4913de['include']=[{'all':!![]}];}return db[_0x8137('0x2c')][_0x8137('0x40')](_0x4913de);})[_0x8137('0x24')](function(_0x2e530d){_0x3e0d3f[_0x8137('0x41')]=_0x2e530d;return _0x3e0d3f;})[_0x8137('0x24')](respondWithFilteredResult(_0x36cfb4,_0x4913de))[_0x8137('0x42')](handleError(_0x36cfb4,null));};exports[_0x8137('0x43')]=function(_0x384356,_0x4b0e11){var _0x177bc6={'raw':!![],'where':{'id':_0x384356[_0x8137('0x44')]['id']}},_0x4886f3={};_0x4886f3[_0x8137('0x35')]=_[_0x8137('0x2e')](db[_0x8137('0x2c')][_0x8137('0x45')]);_0x4886f3[_0x8137('0x2f')]=_[_0x8137('0x2e')](_0x384356[_0x8137('0x2f')]);_0x4886f3['filters']=_[_0x8137('0x31')](_0x4886f3[_0x8137('0x35')],_0x4886f3[_0x8137('0x2f')]);_0x177bc6[_0x8137('0x32')]=_['intersection'](_0x4886f3[_0x8137('0x35')],qs[_0x8137('0x33')](_0x384356['query']['fields']));_0x177bc6['attributes']=_0x177bc6['attributes'][_0x8137('0x34')]?_0x177bc6[_0x8137('0x32')]:_0x4886f3[_0x8137('0x35')];if(_0x384356[_0x8137('0x2f')][_0x8137('0x3f')]){_0x177bc6['include']=[{'all':!![]}];}_0x177bc6=_[_0x8137('0x3d')]({},_0x177bc6,_0x384356[_0x8137('0x3e')]);return db[_0x8137('0x2c')]['find'](_0x177bc6)[_0x8137('0x24')](handleEntityNotFound(_0x4b0e11,null))[_0x8137('0x24')](respondWithResult(_0x4b0e11,null))[_0x8137('0x42')](handleError(_0x4b0e11,null));};exports[_0x8137('0x46')]=function(_0x17b45c,_0x5d47c7){if(_0x17b45c['body']['id']){delete _0x17b45c[_0x8137('0x47')]['id'];}return db[_0x8137('0x2c')]['find']({'where':{'id':_0x17b45c[_0x8137('0x44')]['id']}})[_0x8137('0x24')](handleEntityNotFound(_0x5d47c7,null))[_0x8137('0x24')](saveUpdates(_0x17b45c[_0x8137('0x47')],null))[_0x8137('0x24')](respondWithResult(_0x5d47c7,null))[_0x8137('0x42')](handleError(_0x5d47c7,null));};exports[_0x8137('0x25')]=function(_0x1cb4c3,_0x16beda){return db['CmCustomField'][_0x8137('0x48')]({'where':{'id':_0x1cb4c3['params']['id']}})[_0x8137('0x24')](handleEntityNotFound(_0x16beda,null))[_0x8137('0x24')](removeEntity(_0x16beda,null))[_0x8137('0x42')](handleError(_0x16beda,null));};exports[_0x8137('0x49')]=function(_0x48dade,_0xe088cb){var _0x42b7b7;return db[_0x8137('0x4a')]['transaction'](function(_0x2d7bc3){return db[_0x8137('0x2c')]['create'](_0x48dade[_0x8137('0x47')],{'transaction':_0x2d7bc3})[_0x8137('0x24')](function(_0x5526b4){_0x42b7b7=_0x5526b4;var _0x2690e4={'type':db['Sequelize'][_0x8137('0x4b')],'transaction':_0x2d7bc3};switch(_0x48dade['body'][_0x8137('0x2d')]){case _0x8137('0x4c'):_0x2690e4[_0x8137('0x2d')]=db[_0x8137('0x4d')][_0x8137('0x4b')];break;case _0x8137('0x4e'):_0x2690e4[_0x8137('0x2d')]=db['Sequelize'][_0x8137('0x4f')];break;case'switch':_0x2690e4[_0x8137('0x2d')]=db[_0x8137('0x4d')]['BOOLEAN'];_0x2690e4[_0x8137('0x50')]=![];break;default:}return db['sequelize'][_0x8137('0x51')][_0x8137('0x52')]('cm_contacts',util['format']('cf_%d',_0x42b7b7['id']),_0x2690e4);})[_0x8137('0x24')](function(){return _0x42b7b7;});})[_0x8137('0x24')](respondWithResult(_0xe088cb,0xc9))[_0x8137('0x42')](handleError(_0xe088cb,null));};
\ No newline at end of file
+var _0x1d27=['save','update','then','sendStatus','name','send','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','rows','catch','show','params','keys','find','body','destroy','sequelize','transaction','create','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','set','apply','reject'];(function(_0x182895,_0x13e590){var _0x12337c=function(_0x517965){while(--_0x517965){_0x182895['push'](_0x182895['shift']());}};_0x12337c(++_0x13e590);}(_0x1d27,0x186));var _0x71d2=function(_0x50ebf0,_0x1969b2){_0x50ebf0=_0x50ebf0-0x0;var _0x57cb8d=_0x1d27[_0x50ebf0];return _0x57cb8d;};'use strict';var emlformat=require(_0x71d2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x71d2('0x1'));var util=require(_0x71d2('0x2'));var path=require(_0x71d2('0x3'));var sox=require(_0x71d2('0x4'));var csv=require(_0x71d2('0x5'));var ejs=require(_0x71d2('0x6'));var fs=require('fs');var fs_extra=require(_0x71d2('0x7'));var _=require(_0x71d2('0x8'));var squel=require(_0x71d2('0x9'));var crypto=require('crypto');var jsforce=require(_0x71d2('0xa'));var deskjs=require(_0x71d2('0xb'));var toCsv=require(_0x71d2('0x5'));var querystring=require(_0x71d2('0xc'));var Papa=require('papaparse');var Redis=require(_0x71d2('0xd'));var authService=require(_0x71d2('0xe'));var qs=require(_0x71d2('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x71d2('0x10'));var logger=require('../../config/logger')(_0x71d2('0x11'));var utils=require(_0x71d2('0x12'));var config=require(_0x71d2('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x425a90,_0x557875){_0x557875=_0x557875||0xcc;return function(_0x3b69c0){if(_0x3b69c0){return _0x425a90['sendStatus'](_0x557875);}return _0x425a90[_0x71d2('0x14')](_0x557875)[_0x71d2('0x15')]();};}function respondWithResult(_0x1abee4,_0x394b32){_0x394b32=_0x394b32||0xc8;return function(_0x48603e){if(_0x48603e){return _0x1abee4[_0x71d2('0x14')](_0x394b32)[_0x71d2('0x16')](_0x48603e);}};}function respondWithFilteredResult(_0x32808b,_0x567943){return function(_0x7e633e){if(_0x7e633e){var _0x513670=typeof _0x567943[_0x71d2('0x17')]===_0x71d2('0x18')&&typeof _0x567943[_0x71d2('0x19')]==='undefined';var _0x59332b=_0x7e633e[_0x71d2('0x1a')];var _0x231cc9=_0x513670?0x0:_0x567943[_0x71d2('0x17')];var _0x1f43a2=_0x513670?_0x7e633e['count']:_0x567943[_0x71d2('0x17')]+_0x567943[_0x71d2('0x19')];var _0x371d44;if(_0x1f43a2>=_0x59332b){_0x1f43a2=_0x59332b;_0x371d44=0xc8;}else{_0x371d44=0xce;}_0x32808b[_0x71d2('0x14')](_0x371d44);return _0x32808b[_0x71d2('0x1b')]('Content-Range',_0x231cc9+'-'+_0x1f43a2+'/'+_0x59332b)[_0x71d2('0x16')](_0x7e633e);}return null;};}function patchUpdates(_0x348acd){return function(_0x50c339){try{jsonpatch[_0x71d2('0x1c')](_0x50c339,_0x348acd,!![]);}catch(_0x1c3186){return BPromise[_0x71d2('0x1d')](_0x1c3186);}return _0x50c339[_0x71d2('0x1e')]();};}function saveUpdates(_0x175bf8,_0xa078a8){return function(_0x2cbd75){if(_0x2cbd75){return _0x2cbd75[_0x71d2('0x1f')](_0x175bf8)[_0x71d2('0x20')](function(_0x5b195c){return _0x5b195c;});}return null;};}function removeEntity(_0x3aeb15,_0x5a914c){return function(_0x146a64){if(_0x146a64){return _0x146a64['destroy']()[_0x71d2('0x20')](function(){_0x3aeb15['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3422c7,_0x5bdfd1){return function(_0x2f9459){if(!_0x2f9459){_0x3422c7[_0x71d2('0x21')](0x194);}return _0x2f9459;};}function handleError(_0x1efadc,_0x1ad646){_0x1ad646=_0x1ad646||0x1f4;return function(_0x1a61b7){logger['error'](_0x1a61b7['stack']);if(_0x1a61b7[_0x71d2('0x22')]){delete _0x1a61b7[_0x71d2('0x22')];}_0x1efadc[_0x71d2('0x14')](_0x1ad646)[_0x71d2('0x23')](_0x1a61b7);};}exports['index']=function(_0x138687,_0xda22d0){var _0x324768={},_0x266ee6={},_0x51f23f={'count':0x0,'rows':[]};var _0x1fc1fa=_[_0x71d2('0x24')](db[_0x71d2('0x25')][_0x71d2('0x26')],function(_0xc5472b){return{'name':_0xc5472b[_0x71d2('0x27')],'type':_0xc5472b[_0x71d2('0x28')][_0x71d2('0x29')]};});_0x266ee6[_0x71d2('0x2a')]=_[_0x71d2('0x2b')](_[_0x71d2('0x24')](_0x1fc1fa,_0x71d2('0x22')),['name']);_0x266ee6['query']=_['keys'](_0x138687['query']);_0x266ee6[_0x71d2('0x2c')]=_[_0x71d2('0x2d')](_0x266ee6[_0x71d2('0x2a')],_0x266ee6[_0x71d2('0x2e')]);_0x324768[_0x71d2('0x2f')]=_[_0x71d2('0x2d')](_0x266ee6[_0x71d2('0x2a')],qs['fields'](_0x138687[_0x71d2('0x2e')][_0x71d2('0x30')]));_0x324768[_0x71d2('0x2f')]=_0x324768[_0x71d2('0x2f')][_0x71d2('0x31')]?_0x324768[_0x71d2('0x2f')]:_0x266ee6['model'];if(!_0x138687[_0x71d2('0x2e')][_0x71d2('0x32')](_0x71d2('0x33'))){_0x324768[_0x71d2('0x19')]=qs[_0x71d2('0x19')](_0x138687[_0x71d2('0x2e')][_0x71d2('0x19')]);_0x324768[_0x71d2('0x17')]=qs[_0x71d2('0x17')](_0x138687[_0x71d2('0x2e')][_0x71d2('0x17')]);}_0x324768[_0x71d2('0x34')]=qs[_0x71d2('0x35')](_0x138687[_0x71d2('0x2e')][_0x71d2('0x35')]);_0x324768[_0x71d2('0x36')]=qs[_0x71d2('0x2c')](_[_0x71d2('0x37')](_0x138687['query'],_0x266ee6[_0x71d2('0x2c')]),_0x1fc1fa);if(_0x138687[_0x71d2('0x2e')]['filter']){_0x324768[_0x71d2('0x36')]=_[_0x71d2('0x38')](_0x324768[_0x71d2('0x36')],{'$or':_['map'](_0x1fc1fa,function(_0x257587){if(_0x257587[_0x71d2('0x28')]!==_0x71d2('0x39')){var _0x1108f5={};_0x1108f5[_0x257587[_0x71d2('0x22')]]={'$like':'%'+_0x138687[_0x71d2('0x2e')][_0x71d2('0x3a')]+'%'};return _0x1108f5;}})});}_0x324768=_['merge']({},_0x324768,_0x138687[_0x71d2('0x3b')]);var _0x316cbc={'where':_0x324768[_0x71d2('0x36')]};return db[_0x71d2('0x25')][_0x71d2('0x1a')](_0x316cbc)['then'](function(_0x1c86bb){_0x51f23f[_0x71d2('0x1a')]=_0x1c86bb;if(_0x138687['query']['includeAll']){_0x324768['include']=[{'all':!![]}];}return db[_0x71d2('0x25')]['findAll'](_0x324768);})[_0x71d2('0x20')](function(_0x4d7a0a){_0x51f23f[_0x71d2('0x3c')]=_0x4d7a0a;return _0x51f23f;})[_0x71d2('0x20')](respondWithFilteredResult(_0xda22d0,_0x324768))[_0x71d2('0x3d')](handleError(_0xda22d0,null));};exports[_0x71d2('0x3e')]=function(_0xf4ab17,_0x9705d1){var _0xdfc060={'raw':!![],'where':{'id':_0xf4ab17[_0x71d2('0x3f')]['id']}},_0x2fab3c={};_0x2fab3c[_0x71d2('0x2a')]=_['keys'](db[_0x71d2('0x25')]['rawAttributes']);_0x2fab3c[_0x71d2('0x2e')]=_[_0x71d2('0x40')](_0xf4ab17[_0x71d2('0x2e')]);_0x2fab3c['filters']=_[_0x71d2('0x2d')](_0x2fab3c[_0x71d2('0x2a')],_0x2fab3c['query']);_0xdfc060[_0x71d2('0x2f')]=_[_0x71d2('0x2d')](_0x2fab3c[_0x71d2('0x2a')],qs['fields'](_0xf4ab17[_0x71d2('0x2e')]['fields']));_0xdfc060[_0x71d2('0x2f')]=_0xdfc060['attributes'][_0x71d2('0x31')]?_0xdfc060[_0x71d2('0x2f')]:_0x2fab3c['model'];if(_0xf4ab17[_0x71d2('0x2e')]['includeAll']){_0xdfc060['include']=[{'all':!![]}];}_0xdfc060=_['merge']({},_0xdfc060,_0xf4ab17['options']);return db[_0x71d2('0x25')][_0x71d2('0x41')](_0xdfc060)['then'](handleEntityNotFound(_0x9705d1,null))[_0x71d2('0x20')](respondWithResult(_0x9705d1,null))[_0x71d2('0x3d')](handleError(_0x9705d1,null));};exports[_0x71d2('0x1f')]=function(_0x4da3e7,_0x3b76ad){if(_0x4da3e7[_0x71d2('0x42')]['id']){delete _0x4da3e7[_0x71d2('0x42')]['id'];}return db[_0x71d2('0x25')]['find']({'where':{'id':_0x4da3e7[_0x71d2('0x3f')]['id']}})[_0x71d2('0x20')](handleEntityNotFound(_0x3b76ad,null))['then'](saveUpdates(_0x4da3e7[_0x71d2('0x42')],null))[_0x71d2('0x20')](respondWithResult(_0x3b76ad,null))[_0x71d2('0x3d')](handleError(_0x3b76ad,null));};exports[_0x71d2('0x43')]=function(_0x1395c2,_0x2ade63){return db[_0x71d2('0x25')][_0x71d2('0x41')]({'where':{'id':_0x1395c2['params']['id']}})[_0x71d2('0x20')](handleEntityNotFound(_0x2ade63,null))['then'](removeEntity(_0x2ade63,null))[_0x71d2('0x3d')](handleError(_0x2ade63,null));};exports['create']=function(_0x30b276,_0x35b886){var _0x5b9752;return db[_0x71d2('0x44')][_0x71d2('0x45')](function(_0x49f362){return db['CmCustomField'][_0x71d2('0x46')](_0x30b276[_0x71d2('0x42')],{'transaction':_0x49f362})[_0x71d2('0x20')](function(_0xcae2cd){_0x5b9752=_0xcae2cd;var _0x203b8e={'type':db[_0x71d2('0x47')][_0x71d2('0x48')],'transaction':_0x49f362};switch(_0x30b276[_0x71d2('0x42')][_0x71d2('0x28')]){case _0x71d2('0x49'):_0x203b8e[_0x71d2('0x28')]=db[_0x71d2('0x47')][_0x71d2('0x48')];break;case _0x71d2('0x4a'):_0x203b8e['type']=db[_0x71d2('0x47')][_0x71d2('0x4b')];break;case _0x71d2('0x4c'):_0x203b8e['type']=db['Sequelize'][_0x71d2('0x4d')];_0x203b8e[_0x71d2('0x4e')]=![];break;default:}return db[_0x71d2('0x44')][_0x71d2('0x4f')][_0x71d2('0x50')](_0x71d2('0x51'),util[_0x71d2('0x52')](_0x71d2('0x53'),_0x5b9752['id']),_0x203b8e);})['then'](function(){return _0x5b9752;});})['then'](respondWithResult(_0x35b886,0xc9))[_0x71d2('0x3d')](handleError(_0x35b886,null));};
\ No newline at end of file
index 0ad3074..fcd5bfe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cbb=['moment','request-promise','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api'];(function(_0x16dbfd,_0x2f9431){var _0x382254=function(_0x19dade){while(--_0x19dade){_0x16dbfd['push'](_0x16dbfd['shift']());}};_0x382254(++_0x2f9431);}(_0x1cbb,0x141));var _0xb1cb=function(_0x507ea1,_0x3a1b73){_0x507ea1=_0x507ea1-0x0;var _0x3c2089=_0x1cbb[_0x507ea1];return _0x3c2089;};'use strict';var _=require(_0xb1cb('0x0'));var util=require(_0xb1cb('0x1'));var logger=require(_0xb1cb('0x2'))(_0xb1cb('0x3'));var moment=require(_0xb1cb('0x4'));var BPromise=require('bluebird');var rp=require(_0xb1cb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb1cb('0x6'));var config=require(_0xb1cb('0x7'));var attributes=require(_0xb1cb('0x8'));module[_0xb1cb('0x9')]=function(_0x445b60,_0x580759){return _0x445b60[_0xb1cb('0xa')](_0xb1cb('0xb'),attributes,{'tableName':_0xb1cb('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3e85=['define','cm_custom_fields','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cmCustomField.attributes','exports'];(function(_0x4ac2f6,_0x252101){var _0x95e4f9=function(_0x50d004){while(--_0x50d004){_0x4ac2f6['push'](_0x4ac2f6['shift']());}};_0x95e4f9(++_0x252101);}(_0x3e85,0xce));var _0x53e8=function(_0x41358a,_0x322144){_0x41358a=_0x41358a-0x0;var _0x8c40ce=_0x3e85[_0x41358a];return _0x8c40ce;};'use strict';var _=require(_0x53e8('0x0'));var util=require(_0x53e8('0x1'));var logger=require(_0x53e8('0x2'))('api');var moment=require(_0x53e8('0x3'));var BPromise=require(_0x53e8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x53e8('0x5'));var rimraf=require(_0x53e8('0x6'));var config=require(_0x53e8('0x7'));var attributes=require(_0x53e8('0x8'));module[_0x53e8('0x9')]=function(_0x3b6958,_0x55079c){return _0x3b6958[_0x53e8('0xa')]('CmCustomField',attributes,{'tableName':_0x53e8('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 58c766e..7683dbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4499=['http','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1b7ad0,_0xfa0ea2){var _0x6f00e=function(_0x326ab2){while(--_0x326ab2){_0x1b7ad0['push'](_0x1b7ad0['shift']());}};_0x6f00e(++_0xfa0ea2);}(_0x4499,0x186));var _0x9449=function(_0x3941d4,_0x445e2f){_0x3941d4=_0x3941d4-0x0;var _0x42e507=_0x4499[_0x3941d4];return _0x42e507;};'use strict';var _=require(_0x9449('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9449('0x1'));var fs=require('fs');var Redis=require(_0x9449('0x2'));var db=require(_0x9449('0x3'))['db'];var utils=require(_0x9449('0x4'));var logger=require(_0x9449('0x5'))(_0x9449('0x6'));var config=require(_0x9449('0x7'));var jayson=require(_0x9449('0x8'));var client=jayson['client'][_0x9449('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4faee9,_0x5a4e89,_0x2e4b59){return new BPromise(function(_0x2925f8,_0x5670ef){return client['request'](_0x4faee9,_0x2e4b59)[_0x9449('0xa')](function(_0x3eddcf){logger[_0x9449('0xb')](_0x9449('0xc'),_0x5a4e89,_0x9449('0xd'));logger[_0x9449('0xe')](_0x9449('0xf'),_0x5a4e89,_0x9449('0xd'),JSON[_0x9449('0x10')](_0x3eddcf));if(_0x3eddcf[_0x9449('0x11')]){if(_0x3eddcf[_0x9449('0x11')][_0x9449('0x12')]===0x1f4){logger['error'](_0x9449('0xc'),_0x5a4e89,_0x3eddcf[_0x9449('0x11')][_0x9449('0x13')]);return _0x5670ef(_0x3eddcf[_0x9449('0x11')][_0x9449('0x13')]);}logger[_0x9449('0x11')]('CmCustomField,\x20%s,\x20%s',_0x5a4e89,_0x3eddcf[_0x9449('0x11')][_0x9449('0x13')]);return _0x2925f8(_0x3eddcf['error'][_0x9449('0x13')]);}else{logger[_0x9449('0xb')](_0x9449('0xc'),_0x5a4e89,_0x9449('0xd'));_0x2925f8(_0x3eddcf['result']['message']);}})[_0x9449('0x14')](function(_0x4eb016){logger[_0x9449('0x11')](_0x9449('0xc'),_0x5a4e89,_0x4eb016);_0x5670ef(_0x4eb016);});});}
\ No newline at end of file
+var _0x6e0d=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x5aa2f4,_0x578abf){var _0x24f034=function(_0x2283c7){while(--_0x2283c7){_0x5aa2f4['push'](_0x5aa2f4['shift']());}};_0x24f034(++_0x578abf);}(_0x6e0d,0x73));var _0xd6e0=function(_0x243ab8,_0xf035f4){_0x243ab8=_0x243ab8-0x0;var _0x189d8a=_0x6e0d[_0x243ab8];return _0x189d8a;};'use strict';var _=require(_0xd6e0('0x0'));var util=require(_0xd6e0('0x1'));var moment=require(_0xd6e0('0x2'));var BPromise=require(_0xd6e0('0x3'));var rs=require(_0xd6e0('0x4'));var fs=require('fs');var Redis=require(_0xd6e0('0x5'));var db=require(_0xd6e0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd6e0('0x7'))('rpc');var config=require(_0xd6e0('0x8'));var jayson=require(_0xd6e0('0x9'));var client=jayson[_0xd6e0('0xa')][_0xd6e0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40571b,_0x2199f1,_0x4008f0){return new BPromise(function(_0x1ee81c,_0x4d60e6){return client[_0xd6e0('0xc')](_0x40571b,_0x4008f0)[_0xd6e0('0xd')](function(_0x3b73cc){logger[_0xd6e0('0xe')](_0xd6e0('0xf'),_0x2199f1,_0xd6e0('0x10'));logger['debug'](_0xd6e0('0x11'),_0x2199f1,_0xd6e0('0x10'),JSON['stringify'](_0x3b73cc));if(_0x3b73cc[_0xd6e0('0x12')]){if(_0x3b73cc[_0xd6e0('0x12')][_0xd6e0('0x13')]===0x1f4){logger[_0xd6e0('0x12')](_0xd6e0('0xf'),_0x2199f1,_0x3b73cc[_0xd6e0('0x12')][_0xd6e0('0x14')]);return _0x4d60e6(_0x3b73cc['error'][_0xd6e0('0x14')]);}logger[_0xd6e0('0x12')](_0xd6e0('0xf'),_0x2199f1,_0x3b73cc[_0xd6e0('0x12')][_0xd6e0('0x14')]);return _0x1ee81c(_0x3b73cc[_0xd6e0('0x12')][_0xd6e0('0x14')]);}else{logger[_0xd6e0('0xe')]('CmCustomField,\x20%s,\x20%s',_0x2199f1,'request\x20sent');_0x1ee81c(_0x3b73cc[_0xd6e0('0x15')]['message']);}})[_0xd6e0('0x16')](function(_0x295062){logger[_0xd6e0('0x12')]('CmCustomField,\x20%s,\x20%s',_0x2199f1,_0x295062);_0x4d60e6(_0x295062);});});}
\ No newline at end of file
index 360b45c..12dec86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78e0=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./cmCustomField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x457192,_0x33b1e9){var _0x3ecc6b=function(_0x1603dd){while(--_0x1603dd){_0x457192['push'](_0x457192['shift']());}};_0x3ecc6b(++_0x33b1e9);}(_0x78e0,0x13e));var _0x078e=function(_0x141f74,_0x420286){_0x141f74=_0x141f74-0x0;var _0x3a462f=_0x78e0[_0x141f74];return _0x3a462f;};'use strict';var multer=require(_0x078e('0x0'));var util=require(_0x078e('0x1'));var path=require(_0x078e('0x2'));var timeout=require(_0x078e('0x3'));var express=require(_0x078e('0x4'));var router=express[_0x078e('0x5')]();var fs_extra=require(_0x078e('0x6'));var auth=require(_0x078e('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x078e('0x8'));router[_0x078e('0x9')]('/',auth[_0x078e('0xa')](),controller[_0x078e('0xb')]);router[_0x078e('0x9')]('/:id',auth[_0x078e('0xa')](),controller[_0x078e('0xc')]);router[_0x078e('0xd')]('/',auth[_0x078e('0xa')](),controller[_0x078e('0xe')]);router[_0x078e('0xf')](_0x078e('0x10'),auth['isAuthenticated'](),controller[_0x078e('0x11')]);router[_0x078e('0x12')](_0x078e('0x10'),auth[_0x078e('0xa')](),controller[_0x078e('0x13')]);module[_0x078e('0x14')]=router;
\ No newline at end of file
+var _0xf483=['put','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','/:id','show','post','create'];(function(_0x6abd4e,_0x3152b8){var _0x533cf7=function(_0x315eec){while(--_0x315eec){_0x6abd4e['push'](_0x6abd4e['shift']());}};_0x533cf7(++_0x3152b8);}(_0xf483,0xf2));var _0x3f48=function(_0x327cb5,_0x3fbf2d){_0x327cb5=_0x327cb5-0x0;var _0xc78266=_0xf483[_0x327cb5];return _0xc78266;};'use strict';var multer=require('multer');var util=require(_0x3f48('0x0'));var path=require('path');var timeout=require(_0x3f48('0x1'));var express=require(_0x3f48('0x2'));var router=express[_0x3f48('0x3')]();var fs_extra=require(_0x3f48('0x4'));var auth=require(_0x3f48('0x5'));var interaction=require(_0x3f48('0x6'));var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router['get']('/',auth[_0x3f48('0x7')](),controller[_0x3f48('0x8')]);router['get'](_0x3f48('0x9'),auth[_0x3f48('0x7')](),controller[_0x3f48('0xa')]);router[_0x3f48('0xb')]('/',auth[_0x3f48('0x7')](),controller[_0x3f48('0xc')]);router[_0x3f48('0xd')]('/:id',auth[_0x3f48('0x7')](),controller[_0x3f48('0xe')]);router['delete'](_0x3f48('0x9'),auth['isAuthenticated'](),controller[_0x3f48('0xf')]);module[_0x3f48('0x10')]=router;
\ No newline at end of file
index 0b3c279..2746ab9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfece=['contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED'];(function(_0x42b304,_0x427ea2){var _0x36b11f=function(_0x248610){while(--_0x248610){_0x42b304['push'](_0x42b304['shift']());}};_0x36b11f(++_0x427ea2);}(_0xfece,0x6f));var _0xefec=function(_0x18c2cd,_0x1fb459){_0x18c2cd=_0x18c2cd-0x0;var _0x5648ed=_0xfece[_0x18c2cd];return _0x5648ed;};'use strict';var moment=require(_0xefec('0x0'));var Sequelize=require(_0xefec('0x1'));module[_0xefec('0x2')]={'phone':{'type':Sequelize[_0xefec('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xefec('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xefec('0x5')],'defaultValue':moment()[_0xefec('0x6')](_0xefec('0x7'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xefec('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xefec('0x5')]},'priority':{'type':Sequelize[_0xefec('0x8')](0x2)[_0xefec('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xefec('0x8')],'unique':_0xefec('0xa')},'ListId':{'type':Sequelize[_0xefec('0x8')],'unique':_0xefec('0xa')},'UserId':{'type':Sequelize[_0xefec('0x8')]},'VoiceQueueId':{'type':Sequelize[_0xefec('0x8')],'unique':_0xefec('0xa')},'CampaignId':{'type':Sequelize[_0xefec('0x8')]},'countnosuchnumberretry':{'type':Sequelize[_0xefec('0x8')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xefec('0x8')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xefec('0x8')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xefec('0x8')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xefec('0x8')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xefec('0x8')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xefec('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0xefec('0x5')],'allowNull':!![],'defaultValue':null}};
\ No newline at end of file
+var _0x989e=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','DATE','UNSIGNED','contactListQueue','moment','sequelize','BOOLEAN'];(function(_0x1f61ab,_0x14d780){var _0x430a42=function(_0x2c10fd){while(--_0x2c10fd){_0x1f61ab['push'](_0x1f61ab['shift']());}};_0x430a42(++_0x14d780);}(_0x989e,0xde));var _0xe989=function(_0x1b1f88,_0x3fe1cb){_0x1b1f88=_0x1b1f88-0x0;var _0x5045b9=_0x989e[_0x1b1f88];return _0x5045b9;};'use strict';var moment=require(_0xe989('0x0'));var Sequelize=require(_0xe989('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xe989('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format'](_0xe989('0x3'))},'countbusyretry':{'type':Sequelize[_0xe989('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe989('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe989('0x4')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xe989('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe989('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xe989('0x6')]},'priority':{'type':Sequelize[_0xe989('0x4')](0x2)[_0xe989('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xe989('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xe989('0x4')],'unique':_0xe989('0x8')},'ListId':{'type':Sequelize[_0xe989('0x4')],'unique':_0xe989('0x8')},'UserId':{'type':Sequelize[_0xe989('0x4')]},'VoiceQueueId':{'type':Sequelize[_0xe989('0x4')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xe989('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe989('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xe989('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0xe989('0x6')],'allowNull':!![],'defaultValue':null}};
\ No newline at end of file
index c602144..350fe22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac31=['show','find','create','body','params','describe','destroy','CampaignId','VoiceQueueId','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','UserId','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','lastName','firstName','calleridname','CmHopperAdditionalPhone','end','getPreview','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','List','VoiceQueue','Queue','getPreviewRecall','transaction','recallme','dialActive','getVoiceQueues','isNumber','entity\x20not\x20found','getTimezones','timezones','push','getTimezone','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','offset','limit','count','status','Content-Range','json','update','then','sendStatus','error','name','index','CmHopper','rawAttributes','fieldName','model','map','query','keys','filters','intersection','concat','$and','$or','$gte','$lt','$lte','$ne','$eq','$like','$iLike','$notILike','$overlap','$contained','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch'];(function(_0x5e39d0,_0x15516e){var _0xfd2079=function(_0x4dfc9f){while(--_0x4dfc9f){_0x5e39d0['push'](_0x5e39d0['shift']());}};_0xfd2079(++_0x15516e);}(_0xac31,0xca));var _0x1ac3=function(_0x25acdd,_0x1fa596){_0x25acdd=_0x25acdd-0x0;var _0xeceb86=_0xac31[_0x25acdd];return _0xeceb86;};'use strict';var moment=require(_0x1ac3('0x0'));var _=require(_0x1ac3('0x1'));var qs=require(_0x1ac3('0x2'));var logger=require(_0x1ac3('0x3'))(_0x1ac3('0x4'));var shared=require(_0x1ac3('0x5'));var db=require(_0x1ac3('0x6'))['db'];function respondWithResult(_0x59b42c,_0x33b5ab){_0x33b5ab=_0x33b5ab||0xc8;return function(_0x434b5e){if(_0x434b5e){return _0x59b42c['status'](_0x33b5ab)['json'](_0x434b5e);}};}function respondWithFilteredResult(_0xbe22b7,_0x20027f){return function(_0x2bf9b1){if(_0x2bf9b1){var _0x1be223=typeof _0x20027f[_0x1ac3('0x7')]==='undefined'&&typeof _0x20027f[_0x1ac3('0x8')]==='undefined';var _0x1286d2=_0x2bf9b1[_0x1ac3('0x9')];var _0x344674=_0x1be223?0x0:_0x20027f['offset'];var _0xa26c88=_0x1be223?_0x2bf9b1[_0x1ac3('0x9')]:_0x20027f[_0x1ac3('0x7')]+_0x20027f[_0x1ac3('0x8')];var _0x2a8dc7;if(_0xa26c88>=_0x1286d2){_0xa26c88=_0x1286d2;_0x2a8dc7=0xc8;}else{_0x2a8dc7=0xce;}_0xbe22b7[_0x1ac3('0xa')](_0x2a8dc7);return _0xbe22b7['set'](_0x1ac3('0xb'),_0x344674+'-'+_0xa26c88+'/'+_0x1286d2)[_0x1ac3('0xc')](_0x2bf9b1);}return null;};}function saveUpdates(_0x2eeabf,_0x2338b9){return function(_0x50d3b6){if(_0x50d3b6){return _0x50d3b6[_0x1ac3('0xd')](_0x2eeabf)[_0x1ac3('0xe')](function(_0x46c0e9){return _0x46c0e9;});}return null;};}function handleEntityNotFound(_0x2def9f,_0x53cc35){return function(_0x24bb5e){if(!_0x24bb5e){_0x2def9f[_0x1ac3('0xf')](0x194);}return _0x24bb5e;};}function handleError(_0x551eac,_0x29a7b3){_0x29a7b3=_0x29a7b3||0x1f4;return function(_0x1f9641){logger[_0x1ac3('0x10')](_0x1f9641['stack']);if(_0x1f9641[_0x1ac3('0x11')]){delete _0x1f9641[_0x1ac3('0x11')];}_0x551eac[_0x1ac3('0xa')](_0x29a7b3)['send'](_0x1f9641);};}exports[_0x1ac3('0x12')]=function(_0x58000f,_0x291616){var _0x1e1280={},_0x20091d={},_0x3b7e51={'count':0x0,'rows':[]};var _0x18b985=_['map'](db[_0x1ac3('0x13')][_0x1ac3('0x14')],function(_0x296abf){return{'name':_0x296abf[_0x1ac3('0x15')],'type':_0x296abf['type']['key']};});_0x20091d[_0x1ac3('0x16')]=_[_0x1ac3('0x17')](_0x18b985,_0x1ac3('0x11'));_0x20091d[_0x1ac3('0x18')]=_[_0x1ac3('0x19')](_0x58000f[_0x1ac3('0x18')]);_0x20091d[_0x1ac3('0x1a')]=_[_0x1ac3('0x1b')](_0x20091d[_0x1ac3('0x16')],_0x20091d['query']);_0x20091d[_0x1ac3('0x1a')]=_[_0x1ac3('0x1c')](_0x20091d['filters'],[_0x1ac3('0x1d'),_0x1ac3('0x1e'),'$gt',_0x1ac3('0x1f'),_0x1ac3('0x20'),_0x1ac3('0x21'),_0x1ac3('0x22'),_0x1ac3('0x23'),'$not','$between','$notBetween','$in','$notIn',_0x1ac3('0x24'),'$notLike',_0x1ac3('0x25'),_0x1ac3('0x26'),_0x1ac3('0x24'),_0x1ac3('0x27'),'$contains',_0x1ac3('0x28'),'$any']);_0x1e1280[_0x1ac3('0x29')]=_[_0x1ac3('0x1b')](_0x20091d[_0x1ac3('0x16')],qs[_0x1ac3('0x2a')](_0x58000f[_0x1ac3('0x18')][_0x1ac3('0x2a')]));_0x1e1280[_0x1ac3('0x29')]=_0x1e1280['attributes'][_0x1ac3('0x2b')]?_0x1e1280[_0x1ac3('0x29')]:_0x20091d[_0x1ac3('0x16')];if(!_0x58000f[_0x1ac3('0x18')]['hasOwnProperty'](_0x1ac3('0x2c'))){_0x1e1280[_0x1ac3('0x8')]=qs[_0x1ac3('0x8')](_0x58000f[_0x1ac3('0x18')][_0x1ac3('0x8')]);_0x1e1280['offset']=qs[_0x1ac3('0x7')](_0x58000f[_0x1ac3('0x18')][_0x1ac3('0x7')]);}_0x1e1280[_0x1ac3('0x2d')]=qs[_0x1ac3('0x2e')](_0x58000f[_0x1ac3('0x18')]['sort']);_0x1e1280[_0x1ac3('0x2f')]=qs[_0x1ac3('0x1a')](_[_0x1ac3('0x30')](_0x58000f[_0x1ac3('0x18')],_0x20091d['filters']),_0x18b985);if(_0x58000f[_0x1ac3('0x18')][_0x1ac3('0x31')]){_0x1e1280[_0x1ac3('0x2f')]=_[_0x1ac3('0x32')](_0x1e1280[_0x1ac3('0x2f')],{'$or':_[_0x1ac3('0x17')](_0x18b985,function(_0x2c171b){if(_0x2c171b[_0x1ac3('0x33')]!==_0x1ac3('0x34')){var _0x5c29c1={};_0x5c29c1[_0x2c171b[_0x1ac3('0x11')]]={'$like':'%'+_0x58000f[_0x1ac3('0x18')]['filter']+'%'};return _0x5c29c1;}})});}_0x1e1280=_[_0x1ac3('0x32')]({},_0x1e1280,_0x58000f[_0x1ac3('0x35')]);var _0x17c69e={'where':_0x1e1280[_0x1ac3('0x2f')]};return db[_0x1ac3('0x13')][_0x1ac3('0x9')](_0x17c69e)[_0x1ac3('0xe')](function(_0xa15199){_0x3b7e51['count']=_0xa15199;if(_0x58000f[_0x1ac3('0x18')]['includeAll']){_0x1e1280[_0x1ac3('0x36')]=[{'all':!![]}];}return db[_0x1ac3('0x13')][_0x1ac3('0x37')](_0x1e1280);})[_0x1ac3('0xe')](function(_0x3141ae){_0x3b7e51[_0x1ac3('0x38')]=_0x3141ae;return _0x3b7e51;})['then'](respondWithFilteredResult(_0x291616,_0x1e1280))[_0x1ac3('0x39')](handleError(_0x291616,null));};exports[_0x1ac3('0x3a')]=function(_0x43d15,_0x4e2442){var _0x34380d={'raw':!![],'where':{'id':_0x43d15['params']['id']}},_0xb1d970={};_0xb1d970[_0x1ac3('0x16')]=_[_0x1ac3('0x19')](db[_0x1ac3('0x13')][_0x1ac3('0x14')]);_0xb1d970[_0x1ac3('0x18')]=_[_0x1ac3('0x19')](_0x43d15[_0x1ac3('0x18')]);_0xb1d970[_0x1ac3('0x1a')]=_['intersection'](_0xb1d970[_0x1ac3('0x16')],_0xb1d970[_0x1ac3('0x18')]);_0x34380d[_0x1ac3('0x29')]=_[_0x1ac3('0x1b')](_0xb1d970[_0x1ac3('0x16')],qs[_0x1ac3('0x2a')](_0x43d15[_0x1ac3('0x18')]['fields']));_0x34380d['attributes']=_0x34380d[_0x1ac3('0x29')][_0x1ac3('0x2b')]?_0x34380d['attributes']:_0xb1d970[_0x1ac3('0x16')];if(_0x43d15[_0x1ac3('0x18')]['includeAll']){_0x34380d[_0x1ac3('0x36')]=[{'all':!![]}];}_0x34380d=_['merge']({},_0x34380d,_0x43d15[_0x1ac3('0x35')]);return db[_0x1ac3('0x13')][_0x1ac3('0x3b')](_0x34380d)[_0x1ac3('0xe')](handleEntityNotFound(_0x4e2442,null))['then'](respondWithResult(_0x4e2442,null))[_0x1ac3('0x39')](handleError(_0x4e2442,null));};exports[_0x1ac3('0x3c')]=function(_0x1d650b,_0x351936){return db[_0x1ac3('0x13')]['create'](_0x1d650b[_0x1ac3('0x3d')],{})[_0x1ac3('0xe')](respondWithResult(_0x351936,0xc9))[_0x1ac3('0x39')](handleError(_0x351936,null));};exports[_0x1ac3('0xd')]=function(_0x589434,_0x16d56a){if(_0x589434[_0x1ac3('0x3d')]['id']){delete _0x589434[_0x1ac3('0x3d')]['id'];}return db[_0x1ac3('0x13')]['find']({'where':{'id':_0x589434[_0x1ac3('0x3e')]['id']}})[_0x1ac3('0xe')](handleEntityNotFound(_0x16d56a,null))[_0x1ac3('0xe')](saveUpdates(_0x589434[_0x1ac3('0x3d')],null))['then'](respondWithResult(_0x16d56a,null))[_0x1ac3('0x39')](handleError(_0x16d56a,null));};exports['describe']=function(_0x290ddb,_0x10bcaf){return db[_0x1ac3('0x13')][_0x1ac3('0x3f')]()[_0x1ac3('0xe')](respondWithResult(_0x10bcaf,null))[_0x1ac3('0x39')](handleError(_0x10bcaf,null));};exports[_0x1ac3('0x40')]=function(_0x57138a,_0x517f44){var _0xe8f33c;var _0x249c2d=_0x57138a[_0x1ac3('0x3e')]['id'];return db['CmHopper']['find']({'where':{'id':_0x57138a['params']['id']}})[_0x1ac3('0xe')](handleEntityNotFound(_0x517f44,null))[_0x1ac3('0xe')](function(_0x5976f1){if(_0x5976f1){return _0x5976f1[_0x1ac3('0x40')]()[_0x1ac3('0xe')](function(_0x2fc218){return _0x2fc218;});}})[_0x1ac3('0xe')](function(_0x47bf05){_0xe8f33c=_0x47bf05;if(_0x47bf05){if(_0x47bf05['VoiceQueueId']||_0x47bf05[_0x1ac3('0x41')]){return db[_0x47bf05[_0x1ac3('0x42')]?'VoiceQueue':_0x1ac3('0x43')]['find']({'where':{'id':_0x47bf05['VoiceQueueId']?_0x47bf05[_0x1ac3('0x42')]:_0x47bf05[_0x1ac3('0x41')]},'attributes':['id','name'],'raw':!![]});}}})[_0x1ac3('0xe')](function(_0x5a2a42){var _0x267541={};if(_0x5a2a42){_[_0x1ac3('0x32')](_0x267541,_[_0x1ac3('0x44')](_0xe8f33c[_0x1ac3('0x45')],[_0x1ac3('0x46'),_0x1ac3('0x47'),'id']));_0x267541[_0x1ac3('0x48')]=0x15;_0x267541[_0x1ac3('0x49')]=_0x1ac3('0x4a');_0x267541[_0x1ac3('0x4b')]=_0x5a2a42[_0x1ac3('0x11')];_0x267541['membername']=_0x57138a['user'][_0x1ac3('0x11')];_0x267541[_0x1ac3('0x4c')]=_0x57138a[_0x1ac3('0x4d')]['id'];_0x267541[_0x1ac3('0x4a')]=!![];_0x267541[_0x1ac3('0x4e')]=moment()[_0x1ac3('0x4f')](_0x1ac3('0x50'));_0x267541[_0x1ac3('0x51')]=_0xe8f33c[_0x1ac3('0x52')];_0x267541[_0x1ac3('0x53')]=_0xe8f33c['VoiceQueueId']?_0x1ac3('0x54'):_0x1ac3('0x55');return db[_0x1ac3('0x56')][_0x1ac3('0x3b')]({'where':{'id':_0x267541[_0x1ac3('0x57')]},'attributes':['firstName',_0x1ac3('0x58')]})[_0x1ac3('0xe')](function(_0x51eaf0){if(!_['isNil'](_0x517f44)&&!_['isNil'](_0x51eaf0[_0x1ac3('0x59')])){_0x267541[_0x1ac3('0x5a')]=_0x51eaf0[_0x1ac3('0x59')];if(!_['isNil'](_0x51eaf0[_0x1ac3('0x58')])){_0x267541['calleridname']+='\x20'+_0x51eaf0['lastName'];}}})['finally'](function(){return db['CmHopperFinal'][_0x1ac3('0x3c')](_0x267541);});}})[_0x1ac3('0xe')](function(_0x42218b){return db[_0x1ac3('0x5b')][_0x1ac3('0x40')]({'where':{'CmHopperId':_0x249c2d}});})['then'](function(){return _0x517f44[_0x1ac3('0xa')](0xcc)[_0x1ac3('0x5c')]();})['catch'](handleError(_0x517f44,null));};exports[_0x1ac3('0x5d')]=function(_0x1ffbb1,_0xa3be02){var _0x2e79b2=[];return db[_0x1ac3('0x56')]['describe']()[_0x1ac3('0xe')](function(_0x40907d){_0x2e79b2=_[_0x1ac3('0x19')](_0x40907d);return _0x1ffbb1[_0x1ac3('0x4d')]['getVoiceQueues']({'where':{'type':_0x1ac3('0x5e'),'dialActive':!![],'dialMethod':_0x1ac3('0x5f')},'attributes':['id',_0x1ac3('0x60'),_0x1ac3('0x61')],'raw':!![]});})[_0x1ac3('0xe')](function(_0x1ac283){if(_0x1ac283&&_0x1ac283['length']){return db['sequelize']['transaction'](function(_0x582fe2){var _0x3b930b={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x1ac3('0x50'))},'VoiceQueueId':{'$in':_[_0x1ac3('0x17')](_0x1ac283,'id')},'$or':[{'UserId':null},{'UserId':_0x1ffbb1[_0x1ac3('0x4d')]['id']}]};var _0x20fa43={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x1ac283)[_0x1ac3('0x31')]([_0x1ac3('0x61'),0x0])['map']('id')[_0x1ac3('0x62')]()},'$or':[{'UserId':null},{'UserId':_0x1ffbb1[_0x1ac3('0x4d')]['id']}]};var _0x3597cb={'$or':[_0x3b930b,_0x20fa43]};var _0x422b15=[];if(_0x1ffbb1['body'][_0x1ac3('0x63')]&&_0x1ffbb1[_0x1ac3('0x3d')][_0x1ac3('0x63')]===_0x1ac3('0x64')){if(!_[_0x1ac3('0x65')](_0x1ffbb1['body'][_0x1ac3('0x66')])){_0x3597cb['id']={'$in':_0x1ffbb1['body']['hopperIds']};}_0x422b15=[[_0x1ac3('0x67'),_0x1ac3('0x68')],[_0x1ac3('0x69'),_0x1ac283[0x0][_0x1ac3('0x60')]===_0x1ac3('0x68')?_0x1ac3('0x6a'):_0x1ac3('0x68')],db[_0x1ac3('0x6b')][_0x1ac3('0x6c')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x1ac3('0x6a')]];}else{if(!_[_0x1ac3('0x65')](_0x1ffbb1[_0x1ac3('0x3d')]['hopperIds'])){_0x3597cb['id']={'$notIn':_0x1ffbb1[_0x1ac3('0x3d')][_0x1ac3('0x66')]};}_0x422b15=[[_0x1ac3('0x67'),_0x1ac3('0x6a')],[_0x1ac3('0x69'),_0x1ac283[0x0][_0x1ac3('0x60')]],db[_0x1ac3('0x6b')][_0x1ac3('0x6c')](_0x1ac3('0x6d')),['id',_0x1ac3('0x68')]];}return db['CmHopper'][_0x1ac3('0x6e')]({'attributes':['id',_0x1ac3('0x6f'),_0x1ac3('0x52'),'recallme'],'where':_0x3597cb,'order':_0x422b15,'transaction':_0x582fe2,'lock':_0x582fe2[_0x1ac3('0x70')][_0x1ac3('0x71')],'include':[{'model':db[_0x1ac3('0x56')],'as':_0x1ac3('0x72'),'attributes':_0x2e79b2,'include':[{'model':db[_0x1ac3('0x73')],'as':'Company','attributes':['id','name']}]},{'model':db['CmList'],'as':_0x1ac3('0x74'),'attributes':['id','name']},{'model':db[_0x1ac3('0x75')],'as':_0x1ac3('0x76'),'attributes':['id',_0x1ac3('0x11'),'dialActive']}]})[_0x1ac3('0xe')](function(_0x2d5b5a){if(_0x2d5b5a){return _0x2d5b5a[_0x1ac3('0xd')]({'UserId':_0x1ffbb1[_0x1ac3('0x4d')]['id']},{'transaction':_0x582fe2});}});});}})[_0x1ac3('0xe')](handleEntityNotFound(_0xa3be02,null))['then'](respondWithResult(_0xa3be02,null))['catch'](handleError(_0xa3be02,null));};exports[_0x1ac3('0x77')]=function(_0x27f20c,_0x5b3d42,_0x29b026){var _0x476863=[];var _0x2a4316=_0x27f20c['params']['id'];var _0x175174=_0x27f20c[_0x1ac3('0x4d')]['id'];return db['CmContact'][_0x1ac3('0x3f')]()['then'](function(_0x18af8a){_0x476863=_['keys'](_0x18af8a);return db['sequelize'][_0x1ac3('0x78')](function(_0x444b04){const _0xac1654={'id':_0x2a4316};return db[_0x1ac3('0x13')][_0x1ac3('0x6e')]({'attributes':['id',_0x1ac3('0x6f'),_0x1ac3('0x79')],'where':_0xac1654,'transaction':_0x444b04,'lock':_0x444b04[_0x1ac3('0x70')][_0x1ac3('0x71')],'include':[{'model':db[_0x1ac3('0x56')],'as':_0x1ac3('0x72'),'attributes':_0x476863,'include':[{'model':db[_0x1ac3('0x73')],'as':'Company','attributes':['id','name']}]},{'model':db['CmList'],'as':_0x1ac3('0x74'),'attributes':['id',_0x1ac3('0x11')]},{'model':db['VoiceQueue'],'as':_0x1ac3('0x76'),'attributes':['id',_0x1ac3('0x11'),_0x1ac3('0x7a')]}]})[_0x1ac3('0xe')](function(_0xbadca5){if(_0xbadca5){return _0xbadca5['update']({'UserId':_0x175174},{'transaction':_0x444b04});}});});})[_0x1ac3('0xe')](handleEntityNotFound(_0x5b3d42,null))['then'](respondWithResult(_0x5b3d42,null))[_0x1ac3('0x39')](handleError(_0x5b3d42,null));};exports['getOpenContacts']=function(_0x218712,_0x50278a){return _0x218712[_0x1ac3('0x4d')][_0x1ac3('0x7b')]({'where':{'type':_0x1ac3('0x5e'),'dialActive':!![],'dialMethod':_0x1ac3('0x5f')},'attributes':['id'],'raw':!![]})[_0x1ac3('0xe')](function(_0x5bf7f1){if(_0x5bf7f1&&_0x5bf7f1['length']){return db['CmHopper'][_0x1ac3('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x1ac3('0x4f')](_0x1ac3('0x50'))},'VoiceQueueId':{'$in':_[_0x1ac3('0x17')](_0x5bf7f1,'id')},'$or':[{'UserId':null},{'UserId':_0x218712['user']['id']}]}});}return 0x0;})[_0x1ac3('0xe')](function(_0x441a73){if(!_['isNil'](_0x441a73)&&_[_0x1ac3('0x7c')](_0x441a73)){return _0x50278a['status'](0xc8)[_0x1ac3('0xc')]({'contacts':_0x441a73});}else{logger['error']('CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts',0x194,_0x1ac3('0x7d'));_0x50278a[_0x1ac3('0xf')](0x194);}})[_0x1ac3('0x39')](handleError(_0x50278a,null));};exports[_0x1ac3('0x7e')]=function(_0x12cbb4,_0x5bb6af){var _0x40a2b5=shared[_0x1ac3('0x7f')];var _0x16a834=[];_[_0x1ac3('0x17')](_0x40a2b5,function(_0x4a272e){_0x16a834[_0x1ac3('0x80')]({'id':_0x4a272e[_0x1ac3('0x11')],'name':_0x4a272e['name'],'utcOffset':_0x4a272e['utcOffset']});});return _0x5bb6af['status'](0xc8)[_0x1ac3('0xc')]({'tz':_0x16a834});};exports[_0x1ac3('0x81')]=function(_0x37d3cd,_0x3e1a11){var _0x582468=shared[_0x1ac3('0x7f')];var _0x135898={};if(!_['isNil'](_0x582468[_0x37d3cd[_0x1ac3('0x3d')]['id']]))_0x135898=_0x582468[_0x37d3cd[_0x1ac3('0x3d')]['id']];return _0x3e1a11[_0x1ac3('0xa')](0xc8)[_0x1ac3('0xc')](_0x135898);};
\ No newline at end of file
+var _0x0fda=['scheduledat','recallme','LOCK','UPDATE','CmCompany','Company','CmList','List','Queue','dialActive','getPreviewRecall','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','timezones','push','utcOffset','moment','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','json','offset','undefined','count','status','set','Content-Range','update','sendStatus','error','stack','send','CmHopper','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','concat','$and','$or','$gte','$lt','$ne','$eq','$notBetween','$in','$notILike','$overlap','$contains','$contained','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','then','rows','catch','show','params','include','find','create','body','describe','destroy','CampaignId','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','membername','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','transaction','format','map','dialPreviewAutoRecallMe','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x259878,_0x3b3f8f){_0x259878=_0x259878-0x0;var _0x405e52=_0x0fda[_0x259878];return _0x405e52;};'use strict';var moment=require(_0xa0fd('0x0'));var _=require('lodash');var qs=require(_0xa0fd('0x1'));var logger=require(_0xa0fd('0x2'))(_0xa0fd('0x3'));var shared=require(_0xa0fd('0x4'));var db=require(_0xa0fd('0x5'))['db'];function respondWithResult(_0xd8e73a,_0x13c734){_0x13c734=_0x13c734||0xc8;return function(_0x574fca){if(_0x574fca){return _0xd8e73a['status'](_0x13c734)[_0xa0fd('0x6')](_0x574fca);}};}function respondWithFilteredResult(_0x4aec58,_0x49b3c1){return function(_0x868183){if(_0x868183){var _0x62b109=typeof _0x49b3c1[_0xa0fd('0x7')]===_0xa0fd('0x8')&&typeof _0x49b3c1['limit']===_0xa0fd('0x8');var _0xe93771=_0x868183[_0xa0fd('0x9')];var _0x322a1a=_0x62b109?0x0:_0x49b3c1['offset'];var _0x31088d=_0x62b109?_0x868183[_0xa0fd('0x9')]:_0x49b3c1[_0xa0fd('0x7')]+_0x49b3c1['limit'];var _0x4409e4;if(_0x31088d>=_0xe93771){_0x31088d=_0xe93771;_0x4409e4=0xc8;}else{_0x4409e4=0xce;}_0x4aec58[_0xa0fd('0xa')](_0x4409e4);return _0x4aec58[_0xa0fd('0xb')](_0xa0fd('0xc'),_0x322a1a+'-'+_0x31088d+'/'+_0xe93771)[_0xa0fd('0x6')](_0x868183);}return null;};}function saveUpdates(_0x4d5c32,_0x490112){return function(_0x32dcee){if(_0x32dcee){return _0x32dcee[_0xa0fd('0xd')](_0x4d5c32)['then'](function(_0x21acc2){return _0x21acc2;});}return null;};}function handleEntityNotFound(_0x8a67a5,_0x11e4eb){return function(_0x1e4a48){if(!_0x1e4a48){_0x8a67a5[_0xa0fd('0xe')](0x194);}return _0x1e4a48;};}function handleError(_0x2e3692,_0x2811c0){_0x2811c0=_0x2811c0||0x1f4;return function(_0x4fe62c){logger[_0xa0fd('0xf')](_0x4fe62c[_0xa0fd('0x10')]);if(_0x4fe62c['name']){delete _0x4fe62c['name'];}_0x2e3692[_0xa0fd('0xa')](_0x2811c0)[_0xa0fd('0x11')](_0x4fe62c);};}exports['index']=function(_0x2b8d15,_0x22a876){var _0x1cb027={},_0x5073a8={},_0x50cde2={'count':0x0,'rows':[]};var _0x46e15a=_['map'](db[_0xa0fd('0x12')][_0xa0fd('0x13')],function(_0x10f64b){return{'name':_0x10f64b[_0xa0fd('0x14')],'type':_0x10f64b[_0xa0fd('0x15')][_0xa0fd('0x16')]};});_0x5073a8[_0xa0fd('0x17')]=_['map'](_0x46e15a,_0xa0fd('0x18'));_0x5073a8[_0xa0fd('0x19')]=_[_0xa0fd('0x1a')](_0x2b8d15[_0xa0fd('0x19')]);_0x5073a8[_0xa0fd('0x1b')]=_[_0xa0fd('0x1c')](_0x5073a8[_0xa0fd('0x17')],_0x5073a8[_0xa0fd('0x19')]);_0x5073a8[_0xa0fd('0x1b')]=_[_0xa0fd('0x1d')](_0x5073a8[_0xa0fd('0x1b')],[_0xa0fd('0x1e'),_0xa0fd('0x1f'),'$gt',_0xa0fd('0x20'),_0xa0fd('0x21'),'$lte',_0xa0fd('0x22'),_0xa0fd('0x23'),'$not','$between',_0xa0fd('0x24'),_0xa0fd('0x25'),'$notIn','$like','$notLike','$iLike',_0xa0fd('0x26'),'$like',_0xa0fd('0x27'),_0xa0fd('0x28'),_0xa0fd('0x29'),'$any']);_0x1cb027[_0xa0fd('0x2a')]=_[_0xa0fd('0x1c')](_0x5073a8[_0xa0fd('0x17')],qs[_0xa0fd('0x2b')](_0x2b8d15[_0xa0fd('0x19')]['fields']));_0x1cb027[_0xa0fd('0x2a')]=_0x1cb027[_0xa0fd('0x2a')][_0xa0fd('0x2c')]?_0x1cb027[_0xa0fd('0x2a')]:_0x5073a8['model'];if(!_0x2b8d15[_0xa0fd('0x19')][_0xa0fd('0x2d')]('nolimit')){_0x1cb027['limit']=qs['limit'](_0x2b8d15[_0xa0fd('0x19')]['limit']);_0x1cb027['offset']=qs[_0xa0fd('0x7')](_0x2b8d15['query'][_0xa0fd('0x7')]);}_0x1cb027[_0xa0fd('0x2e')]=qs[_0xa0fd('0x2f')](_0x2b8d15[_0xa0fd('0x19')][_0xa0fd('0x2f')]);_0x1cb027[_0xa0fd('0x30')]=qs[_0xa0fd('0x1b')](_[_0xa0fd('0x31')](_0x2b8d15['query'],_0x5073a8[_0xa0fd('0x1b')]),_0x46e15a);if(_0x2b8d15['query'][_0xa0fd('0x32')]){_0x1cb027['where']=_['merge'](_0x1cb027[_0xa0fd('0x30')],{'$or':_['map'](_0x46e15a,function(_0x40f8f0){if(_0x40f8f0[_0xa0fd('0x15')]!==_0xa0fd('0x33')){var _0x3c7884={};_0x3c7884[_0x40f8f0['name']]={'$like':'%'+_0x2b8d15[_0xa0fd('0x19')][_0xa0fd('0x32')]+'%'};return _0x3c7884;}})});}_0x1cb027=_[_0xa0fd('0x34')]({},_0x1cb027,_0x2b8d15[_0xa0fd('0x35')]);var _0x2e3cfa={'where':_0x1cb027[_0xa0fd('0x30')]};return db[_0xa0fd('0x12')]['count'](_0x2e3cfa)['then'](function(_0x2aa6a8){_0x50cde2[_0xa0fd('0x9')]=_0x2aa6a8;if(_0x2b8d15[_0xa0fd('0x19')][_0xa0fd('0x36')]){_0x1cb027['include']=[{'all':!![]}];}return db[_0xa0fd('0x12')][_0xa0fd('0x37')](_0x1cb027);})[_0xa0fd('0x38')](function(_0x426ae6){_0x50cde2[_0xa0fd('0x39')]=_0x426ae6;return _0x50cde2;})['then'](respondWithFilteredResult(_0x22a876,_0x1cb027))[_0xa0fd('0x3a')](handleError(_0x22a876,null));};exports[_0xa0fd('0x3b')]=function(_0x558f67,_0x48125b){var _0x27082a={'raw':!![],'where':{'id':_0x558f67[_0xa0fd('0x3c')]['id']}},_0x163023={};_0x163023[_0xa0fd('0x17')]=_[_0xa0fd('0x1a')](db[_0xa0fd('0x12')][_0xa0fd('0x13')]);_0x163023[_0xa0fd('0x19')]=_[_0xa0fd('0x1a')](_0x558f67[_0xa0fd('0x19')]);_0x163023[_0xa0fd('0x1b')]=_[_0xa0fd('0x1c')](_0x163023[_0xa0fd('0x17')],_0x163023[_0xa0fd('0x19')]);_0x27082a[_0xa0fd('0x2a')]=_['intersection'](_0x163023['model'],qs['fields'](_0x558f67[_0xa0fd('0x19')][_0xa0fd('0x2b')]));_0x27082a[_0xa0fd('0x2a')]=_0x27082a['attributes'][_0xa0fd('0x2c')]?_0x27082a[_0xa0fd('0x2a')]:_0x163023[_0xa0fd('0x17')];if(_0x558f67['query'][_0xa0fd('0x36')]){_0x27082a[_0xa0fd('0x3d')]=[{'all':!![]}];}_0x27082a=_[_0xa0fd('0x34')]({},_0x27082a,_0x558f67[_0xa0fd('0x35')]);return db[_0xa0fd('0x12')][_0xa0fd('0x3e')](_0x27082a)['then'](handleEntityNotFound(_0x48125b,null))[_0xa0fd('0x38')](respondWithResult(_0x48125b,null))[_0xa0fd('0x3a')](handleError(_0x48125b,null));};exports[_0xa0fd('0x3f')]=function(_0x2498da,_0x324206){return db[_0xa0fd('0x12')]['create'](_0x2498da[_0xa0fd('0x40')],{})[_0xa0fd('0x38')](respondWithResult(_0x324206,0xc9))[_0xa0fd('0x3a')](handleError(_0x324206,null));};exports[_0xa0fd('0xd')]=function(_0x16d0cc,_0x508747){if(_0x16d0cc['body']['id']){delete _0x16d0cc[_0xa0fd('0x40')]['id'];}return db[_0xa0fd('0x12')][_0xa0fd('0x3e')]({'where':{'id':_0x16d0cc[_0xa0fd('0x3c')]['id']}})[_0xa0fd('0x38')](handleEntityNotFound(_0x508747,null))['then'](saveUpdates(_0x16d0cc[_0xa0fd('0x40')],null))[_0xa0fd('0x38')](respondWithResult(_0x508747,null))[_0xa0fd('0x3a')](handleError(_0x508747,null));};exports[_0xa0fd('0x41')]=function(_0x93d528,_0x22504a){return db['CmHopper']['describe']()['then'](respondWithResult(_0x22504a,null))[_0xa0fd('0x3a')](handleError(_0x22504a,null));};exports['destroy']=function(_0x4e4ce4,_0xcf725e){var _0x504a0a;var _0x357324=_0x4e4ce4[_0xa0fd('0x3c')]['id'];return db['CmHopper']['find']({'where':{'id':_0x4e4ce4[_0xa0fd('0x3c')]['id']}})[_0xa0fd('0x38')](handleEntityNotFound(_0xcf725e,null))[_0xa0fd('0x38')](function(_0x167503){if(_0x167503){return _0x167503[_0xa0fd('0x42')]()[_0xa0fd('0x38')](function(_0x5268ba){return _0x5268ba;});}})['then'](function(_0x50382c){_0x504a0a=_0x50382c;if(_0x50382c){if(_0x50382c['VoiceQueueId']||_0x50382c[_0xa0fd('0x43')]){return db[_0x50382c[_0xa0fd('0x44')]?_0xa0fd('0x45'):_0xa0fd('0x46')][_0xa0fd('0x3e')]({'where':{'id':_0x50382c['VoiceQueueId']?_0x50382c['VoiceQueueId']:_0x50382c['CampaignId']},'attributes':['id','name'],'raw':!![]});}}})['then'](function(_0x386dfe){var _0x4238e4={};if(_0x386dfe){_[_0xa0fd('0x34')](_0x4238e4,_[_0xa0fd('0x47')](_0x504a0a[_0xa0fd('0x48')],[_0xa0fd('0x49'),_0xa0fd('0x4a'),'id']));_0x4238e4[_0xa0fd('0x4b')]=0x15;_0x4238e4[_0xa0fd('0x4c')]=_0xa0fd('0x4d');_0x4238e4['campaign']=_0x386dfe['name'];_0x4238e4[_0xa0fd('0x4e')]=_0x4e4ce4[_0xa0fd('0x4f')][_0xa0fd('0x18')];_0x4238e4[_0xa0fd('0x50')]=_0x4e4ce4['user']['id'];_0x4238e4[_0xa0fd('0x4d')]=!![];_0x4238e4[_0xa0fd('0x51')]=moment()['format'](_0xa0fd('0x52'));_0x4238e4['calleridnum']=_0x504a0a[_0xa0fd('0x53')];_0x4238e4[_0xa0fd('0x54')]=_0x504a0a['VoiceQueueId']?_0xa0fd('0x55'):_0xa0fd('0x56');return db[_0xa0fd('0x57')][_0xa0fd('0x3e')]({'where':{'id':_0x4238e4[_0xa0fd('0x58')]},'attributes':[_0xa0fd('0x59'),_0xa0fd('0x5a')]})[_0xa0fd('0x38')](function(_0x5e0440){if(!_[_0xa0fd('0x5b')](_0xcf725e)&&!_['isNil'](_0x5e0440[_0xa0fd('0x59')])){_0x4238e4[_0xa0fd('0x5c')]=_0x5e0440[_0xa0fd('0x59')];if(!_[_0xa0fd('0x5b')](_0x5e0440[_0xa0fd('0x5a')])){_0x4238e4['calleridname']+='\x20'+_0x5e0440[_0xa0fd('0x5a')];}}})[_0xa0fd('0x5d')](function(){return db['CmHopperFinal'][_0xa0fd('0x3f')](_0x4238e4);});}})[_0xa0fd('0x38')](function(_0xfd99a9){return db['CmHopperAdditionalPhone'][_0xa0fd('0x42')]({'where':{'CmHopperId':_0x357324}});})['then'](function(){return _0xcf725e[_0xa0fd('0xa')](0xcc)['end']();})[_0xa0fd('0x3a')](handleError(_0xcf725e,null));};exports['getPreview']=function(_0x1a4da0,_0x62c3e7){var _0x3f9d1e=[];return db[_0xa0fd('0x57')][_0xa0fd('0x41')]()[_0xa0fd('0x38')](function(_0x38076b){_0x3f9d1e=_['keys'](_0x38076b);return _0x1a4da0[_0xa0fd('0x4f')][_0xa0fd('0x5e')]({'where':{'type':_0xa0fd('0x5f'),'dialActive':!![],'dialMethod':_0xa0fd('0x60')},'attributes':['id',_0xa0fd('0x61'),'dialPreviewAutoRecallMe'],'raw':!![]});})['then'](function(_0x4ed729){if(_0x4ed729&&_0x4ed729[_0xa0fd('0x2c')]){return db['sequelize'][_0xa0fd('0x62')](function(_0x589433){var _0x4524a3={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xa0fd('0x63')](_0xa0fd('0x52'))},'VoiceQueueId':{'$in':_[_0xa0fd('0x64')](_0x4ed729,'id')},'$or':[{'UserId':null},{'UserId':_0x1a4da0[_0xa0fd('0x4f')]['id']}]};var _0x5c3efa={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x4ed729)[_0xa0fd('0x32')]([_0xa0fd('0x65'),0x0])[_0xa0fd('0x64')]('id')[_0xa0fd('0x66')]()},'$or':[{'UserId':null},{'UserId':_0x1a4da0[_0xa0fd('0x4f')]['id']}]};var _0x26bd48={'$or':[_0x4524a3,_0x5c3efa]};var _0x527e93=[];if(_0x1a4da0['body'][_0xa0fd('0x67')]&&_0x1a4da0[_0xa0fd('0x40')][_0xa0fd('0x67')]===_0xa0fd('0x68')){if(!_[_0xa0fd('0x69')](_0x1a4da0[_0xa0fd('0x40')][_0xa0fd('0x6a')])){_0x26bd48['id']={'$in':_0x1a4da0[_0xa0fd('0x40')]['hopperIds']};}_0x527e93=[[_0xa0fd('0x6b'),_0xa0fd('0x6c')],[_0xa0fd('0x6d'),_0x4ed729[0x0][_0xa0fd('0x61')]===_0xa0fd('0x6c')?_0xa0fd('0x6e'):_0xa0fd('0x6c')],db[_0xa0fd('0x6f')][_0xa0fd('0x70')](_0xa0fd('0x71')),['id',_0xa0fd('0x6e')]];}else{if(!_[_0xa0fd('0x69')](_0x1a4da0['body'][_0xa0fd('0x6a')])){_0x26bd48['id']={'$notIn':_0x1a4da0[_0xa0fd('0x40')][_0xa0fd('0x6a')]};}_0x527e93=[[_0xa0fd('0x6b'),_0xa0fd('0x6e')],[_0xa0fd('0x6d'),_0x4ed729[0x0][_0xa0fd('0x61')]],db[_0xa0fd('0x6f')][_0xa0fd('0x70')](_0xa0fd('0x72')),['id','ASC']];}return db[_0xa0fd('0x12')][_0xa0fd('0x73')]({'attributes':['id',_0xa0fd('0x74'),_0xa0fd('0x53'),_0xa0fd('0x75')],'where':_0x26bd48,'order':_0x527e93,'transaction':_0x589433,'lock':_0x589433[_0xa0fd('0x76')][_0xa0fd('0x77')],'include':[{'model':db[_0xa0fd('0x57')],'as':'Contact','attributes':_0x3f9d1e,'include':[{'model':db[_0xa0fd('0x78')],'as':_0xa0fd('0x79'),'attributes':['id','name']}]},{'model':db[_0xa0fd('0x7a')],'as':_0xa0fd('0x7b'),'attributes':['id',_0xa0fd('0x18')]},{'model':db[_0xa0fd('0x45')],'as':_0xa0fd('0x7c'),'attributes':['id','name',_0xa0fd('0x7d')]}]})[_0xa0fd('0x38')](function(_0xccdeca){if(_0xccdeca){return _0xccdeca[_0xa0fd('0xd')]({'UserId':_0x1a4da0[_0xa0fd('0x4f')]['id']},{'transaction':_0x589433});}});});}})[_0xa0fd('0x38')](handleEntityNotFound(_0x62c3e7,null))[_0xa0fd('0x38')](respondWithResult(_0x62c3e7,null))[_0xa0fd('0x3a')](handleError(_0x62c3e7,null));};exports[_0xa0fd('0x7e')]=function(_0x4407a3,_0x3661f6,_0x245012){var _0x36452c=[];var _0x7d5b1d=_0x4407a3[_0xa0fd('0x3c')]['id'];var _0x1f3851=_0x4407a3[_0xa0fd('0x4f')]['id'];return db[_0xa0fd('0x57')][_0xa0fd('0x41')]()['then'](function(_0x2075cb){_0x36452c=_[_0xa0fd('0x1a')](_0x2075cb);return db[_0xa0fd('0x6f')][_0xa0fd('0x62')](function(_0x5551ff){const _0xeaddf={'id':_0x7d5b1d};return db[_0xa0fd('0x12')][_0xa0fd('0x73')]({'attributes':['id',_0xa0fd('0x74'),_0xa0fd('0x75')],'where':_0xeaddf,'transaction':_0x5551ff,'lock':_0x5551ff['LOCK'][_0xa0fd('0x77')],'include':[{'model':db[_0xa0fd('0x57')],'as':'Contact','attributes':_0x36452c,'include':[{'model':db['CmCompany'],'as':_0xa0fd('0x79'),'attributes':['id','name']}]},{'model':db['CmList'],'as':_0xa0fd('0x7b'),'attributes':['id',_0xa0fd('0x18')]},{'model':db['VoiceQueue'],'as':_0xa0fd('0x7c'),'attributes':['id',_0xa0fd('0x18'),_0xa0fd('0x7d')]}]})[_0xa0fd('0x38')](function(_0x2aa91d){if(_0x2aa91d){return _0x2aa91d['update']({'UserId':_0x1f3851},{'transaction':_0x5551ff});}});});})[_0xa0fd('0x38')](handleEntityNotFound(_0x3661f6,null))[_0xa0fd('0x38')](respondWithResult(_0x3661f6,null))['catch'](handleError(_0x3661f6,null));};exports[_0xa0fd('0x7f')]=function(_0x37eb12,_0x6431a){return _0x37eb12['user'][_0xa0fd('0x5e')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xa0fd('0x60')},'attributes':['id'],'raw':!![]})[_0xa0fd('0x38')](function(_0xe9600b){if(_0xe9600b&&_0xe9600b[_0xa0fd('0x2c')]){return db['CmHopper'][_0xa0fd('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xa0fd('0x63')](_0xa0fd('0x52'))},'VoiceQueueId':{'$in':_[_0xa0fd('0x64')](_0xe9600b,'id')},'$or':[{'UserId':null},{'UserId':_0x37eb12[_0xa0fd('0x4f')]['id']}]}});}return 0x0;})[_0xa0fd('0x38')](function(_0x59e347){if(!_[_0xa0fd('0x5b')](_0x59e347)&&_[_0xa0fd('0x80')](_0x59e347)){return _0x6431a[_0xa0fd('0xa')](0xc8)[_0xa0fd('0x6')]({'contacts':_0x59e347});}else{logger[_0xa0fd('0xf')](_0xa0fd('0x81'),'getOpenContacts',0x194,'entity\x20not\x20found');_0x6431a[_0xa0fd('0xe')](0x194);}})[_0xa0fd('0x3a')](handleError(_0x6431a,null));};exports['getTimezones']=function(_0x1888d4,_0x42a27d){var _0x1bdcb=shared[_0xa0fd('0x82')];var _0x4ebc93=[];_[_0xa0fd('0x64')](_0x1bdcb,function(_0x1bcad3){_0x4ebc93[_0xa0fd('0x83')]({'id':_0x1bcad3[_0xa0fd('0x18')],'name':_0x1bcad3['name'],'utcOffset':_0x1bcad3[_0xa0fd('0x84')]});});return _0x42a27d[_0xa0fd('0xa')](0xc8)[_0xa0fd('0x6')]({'tz':_0x4ebc93});};exports['getTimezone']=function(_0x1ef642,_0x23e557){var _0x4c3da0=shared['timezones'];var _0xe8e94c={};if(!_[_0xa0fd('0x5b')](_0x4c3da0[_0x1ef642[_0xa0fd('0x40')]['id']]))_0xe8e94c=_0x4c3da0[_0x1ef642[_0xa0fd('0x40')]['id']];return _0x23e557['status'](0xc8)['json'](_0xe8e94c);};
\ No newline at end of file
index f2747d9..0bfbf6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeff8=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopper.attributes','define','CmHopper','scheduledat','phone'];(function(_0x41afe4,_0xa76ce9){var _0x52bdec=function(_0x25019e){while(--_0x25019e){_0x41afe4['push'](_0x41afe4['shift']());}};_0x52bdec(++_0xa76ce9);}(_0xeff8,0x186));var _0x8eff=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0xeff8[_0xac151d];return _0x111dba;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var logger=require('../../config/logger')(_0x8eff('0x2'));var moment=require(_0x8eff('0x3'));var BPromise=require(_0x8eff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eff('0x5'));var rimraf=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var attributes=require(_0x8eff('0x8'));module['exports']=function(_0x469641,_0xb54063){return _0x469641[_0x8eff('0x9')](_0x8eff('0xa'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x8eff('0xb'),'fields':[_0x8eff('0xb')]},{'name':_0x8eff('0xc'),'fields':[_0x8eff('0xc')]},{'name':'priority','fields':['priority']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xeda8=['exports','define','cm_hopper','scheduledat','phone','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes'];(function(_0x3e509e,_0x216da3){var _0x1d1f62=function(_0x3d176f){while(--_0x3d176f){_0x3e509e['push'](_0x3e509e['shift']());}};_0x1d1f62(++_0x216da3);}(_0xeda8,0x104));var _0x8eda=function(_0x565fd0,_0x1e859f){_0x565fd0=_0x565fd0-0x0;var _0x311032=_0xeda8[_0x565fd0];return _0x311032;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var logger=require('../../config/logger')(_0x8eda('0x2'));var moment=require(_0x8eda('0x3'));var BPromise=require(_0x8eda('0x4'));var rp=require(_0x8eda('0x5'));var fs=require('fs');var path=require(_0x8eda('0x6'));var rimraf=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var attributes=require(_0x8eda('0x9'));module[_0x8eda('0xa')]=function(_0x1f3556,_0x349361){return _0x1f3556[_0x8eda('0xb')]('CmHopper',attributes,{'tableName':_0x8eda('0xc'),'paranoid':![],'indexes':[{'name':_0x8eda('0xd'),'fields':[_0x8eda('0xd')]},{'name':_0x8eda('0xe'),'fields':['phone']},{'name':'priority','fields':['priority']}],'timestamps':!![]});};
\ No newline at end of file
index d016160..f0ac5ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7925=['include','model','then','info','debug','stringify','catch','message','ShowCmHopper','find','error','CreateCmHopper','create','body','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','DestroyCmHopper','GetContactDialer','CmContact','describe','transaction','findAll','order','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause','length','UserId','update','includes','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','active','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','CountReScheduled','COUNT','sequelize','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','GetContactRecallMe','GetCmHopperPreview','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','List','CmHopperHandlePreviewRecallNotifications','util','moment','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','options','raw','where','attributes','limit','map'];(function(_0xdbd4f7,_0x4e3bdd){var _0x5c3f9d=function(_0xa7a35a){while(--_0xa7a35a){_0xdbd4f7['push'](_0xdbd4f7['shift']());}};_0x5c3f9d(++_0x4e3bdd);}(_0x7925,0xe6));var _0x5792=function(_0x4924d7,_0x448263){_0x4924d7=_0x4924d7-0x0;var _0x3a02cc=_0x7925[_0x4924d7];return _0x3a02cc;};'use strict';var _=require('lodash');var util=require(_0x5792('0x0'));var moment=require(_0x5792('0x1'));var BPromise=require('bluebird');var db=require(_0x5792('0x2'))['db'];var logger=require(_0x5792('0x3'))(_0x5792('0x4'));exports[_0x5792('0x5')]=function(_0x332c98){var _0x14da25=this;return new Promise(function(_0x2adf82,_0x1ef3ac){return db[_0x5792('0x6')]['findAll']({'raw':_0x332c98['options']?_0x332c98[_0x5792('0x7')][_0x5792('0x8')]===undefined?!![]:![]:!![],'where':_0x332c98[_0x5792('0x7')]?_0x332c98[_0x5792('0x7')][_0x5792('0x9')]||null:null,'attributes':_0x332c98[_0x5792('0x7')]?_0x332c98[_0x5792('0x7')][_0x5792('0xa')]||null:null,'limit':_0x332c98[_0x5792('0x7')]?_0x332c98[_0x5792('0x7')][_0x5792('0xb')]||null:null,'include':_0x332c98['options']?_0x332c98[_0x5792('0x7')]['include']?_[_0x5792('0xc')](_0x332c98[_0x5792('0x7')][_0x5792('0xd')],function(_0x611473){return{'model':db[_0x611473[_0x5792('0xe')]],'as':_0x611473['as'],'attributes':_0x611473['attributes'],'include':_0x611473[_0x5792('0xd')]?_['map'](_0x611473[_0x5792('0xd')],function(_0x37ffcb){return{'model':db[_0x37ffcb[_0x5792('0xe')]],'as':_0x37ffcb['as'],'attributes':_0x37ffcb[_0x5792('0xa')],'include':_0x37ffcb[_0x5792('0xd')]?_['map'](_0x37ffcb['include'],function(_0x3f3530){return{'model':db[_0x3f3530[_0x5792('0xe')]],'as':_0x3f3530['as'],'attributes':_0x3f3530[_0x5792('0xa')]};}):[]};}):[]};}):[]:[]})[_0x5792('0xf')](function(_0x53a299){logger[_0x5792('0x10')](_0x5792('0x5'),_0x332c98);logger[_0x5792('0x11')](_0x5792('0x5'),_0x332c98,JSON[_0x5792('0x12')](_0x53a299));_0x2adf82(_0x53a299);})[_0x5792('0x13')](function(_0x3dbe23){logger['error'](_0x5792('0x5'),_0x3dbe23[_0x5792('0x14')],_0x332c98);_0x1ef3ac(_0x14da25['error'](0x1f4,_0x3dbe23['message']));});});};exports[_0x5792('0x15')]=function(_0x8224de){var _0x40ad2d=this;return new Promise(function(_0x133d98,_0x11732a){return db[_0x5792('0x6')][_0x5792('0x16')]({'raw':_0x8224de[_0x5792('0x7')]?_0x8224de[_0x5792('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x8224de[_0x5792('0x7')]?_0x8224de[_0x5792('0x7')][_0x5792('0x9')]||null:null,'attributes':_0x8224de['options']?_0x8224de[_0x5792('0x7')][_0x5792('0xa')]||null:null,'include':_0x8224de[_0x5792('0x7')]?_0x8224de[_0x5792('0x7')][_0x5792('0xd')]?_[_0x5792('0xc')](_0x8224de[_0x5792('0x7')]['include'],function(_0x21b325){return{'model':db[_0x21b325[_0x5792('0xe')]],'as':_0x21b325['as'],'attributes':_0x21b325[_0x5792('0xa')],'include':_0x21b325['include']?_[_0x5792('0xc')](_0x21b325['include'],function(_0x390789){return{'model':db[_0x390789['model']],'as':_0x390789['as'],'attributes':_0x390789[_0x5792('0xa')],'include':_0x390789[_0x5792('0xd')]?_[_0x5792('0xc')](_0x390789['include'],function(_0x17c68c){return{'model':db[_0x17c68c[_0x5792('0xe')]],'as':_0x17c68c['as'],'attributes':_0x17c68c[_0x5792('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f88c3){logger[_0x5792('0x10')](_0x5792('0x15'),_0x8224de);logger['debug'](_0x5792('0x15'),_0x8224de,JSON[_0x5792('0x12')](_0x1f88c3));_0x133d98(_0x1f88c3);})['catch'](function(_0x191813){logger[_0x5792('0x17')]('ShowCmHopper',_0x191813[_0x5792('0x14')],_0x8224de);_0x11732a(_0x40ad2d[_0x5792('0x17')](0x1f4,_0x191813[_0x5792('0x14')]));});});};exports[_0x5792('0x18')]=function(_0x37f438){var _0x414cd6=this;return new Promise(function(_0xdc8aba,_0x49abbc){return db[_0x5792('0x6')][_0x5792('0x19')](_0x37f438[_0x5792('0x1a')],{'raw':_0x37f438[_0x5792('0x7')]?_0x37f438[_0x5792('0x7')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4f4c44){logger[_0x5792('0x10')](_0x5792('0x18'),_0x37f438);logger[_0x5792('0x11')](_0x5792('0x18'),_0x37f438,JSON[_0x5792('0x12')](_0x4f4c44));_0xdc8aba(_0x4f4c44);})[_0x5792('0x13')](function(_0x4b97c8){logger['error']('CreateCmHopper',_0x4b97c8[_0x5792('0x14')],_0x37f438);_0x49abbc(_0x414cd6[_0x5792('0x17')](0x1f4,_0x4b97c8[_0x5792('0x14')]));});});};exports[_0x5792('0x1b')]=function(_0x4c2d84){var _0x58af08=this;return new Promise(function(_0x3f287a,_0x2ae68c){return db['CmHopper']['update'](_0x4c2d84['body'],{'raw':_0x4c2d84[_0x5792('0x7')]?_0x4c2d84[_0x5792('0x7')][_0x5792('0x8')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c2d84[_0x5792('0x7')]?_0x4c2d84['options'][_0x5792('0x9')]||null:null,'attributes':_0x4c2d84[_0x5792('0x7')]?_0x4c2d84['options'][_0x5792('0xa')]||null:null,'limit':_0x4c2d84[_0x5792('0x7')]?_0x4c2d84['options'][_0x5792('0xb')]||null:null})[_0x5792('0xf')](function(_0x285f2c){logger[_0x5792('0x10')]('UpdateCmHopper',_0x4c2d84);logger['info'](_0x5792('0x1c'),JSON[_0x5792('0x12')](_0x4c2d84[_0x5792('0x7')]['where']),_0x4c2d84[_0x5792('0x1a')]['active']);logger[_0x5792('0x11')](_0x5792('0x1b'),_0x4c2d84,JSON[_0x5792('0x12')](_0x285f2c));_0x3f287a(_0x285f2c);})[_0x5792('0x13')](function(_0x4c0050){logger[_0x5792('0x17')](_0x5792('0x1b'),_0x4c0050[_0x5792('0x14')],_0x4c2d84);_0x2ae68c(_0x58af08[_0x5792('0x17')](0x1f4,_0x4c0050[_0x5792('0x14')]));});});};exports[_0x5792('0x1d')]=function(_0xf716d0){var _0x494f52=this;return new Promise(function(_0x5b9eec,_0x13204d){return db[_0x5792('0x6')]['destroy']({'where':_0xf716d0[_0x5792('0x7')]?_0xf716d0['options'][_0x5792('0x9')]||null:null})[_0x5792('0xf')](function(_0x57fb0e){logger[_0x5792('0x10')]('DestroyCmHopper',_0xf716d0);logger[_0x5792('0x11')](_0x5792('0x1d'),_0xf716d0,JSON[_0x5792('0x12')](_0x57fb0e));_0x5b9eec(_0x57fb0e);})['catch'](function(_0x188b6b){logger[_0x5792('0x17')]('DestroyCmHopper',_0x188b6b[_0x5792('0x14')],_0xf716d0);_0x13204d(_0x494f52[_0x5792('0x17')](0x1f4,_0x188b6b['message']));});});};exports[_0x5792('0x1e')]=function(_0x45ba80){var _0x161a00=this;return new Promise(function(_0x12625c,_0x14f446){return db[_0x5792('0x1f')][_0x5792('0x20')]()[_0x5792('0xf')](function(_0x4e3b35){return db['sequelize'][_0x5792('0x21')](function(_0x12cef6){return db[_0x5792('0x6')][_0x5792('0x22')]({'where':_0x45ba80[_0x5792('0x7')]?_0x45ba80[_0x5792('0x7')]['where']||null:null,'attributes':_0x45ba80['options']?_0x45ba80[_0x5792('0x7')][_0x5792('0xa')]||null:null,'limit':_0x45ba80['options']?_0x45ba80[_0x5792('0x7')][_0x5792('0xb')]||null:null,'order':_0x45ba80[_0x5792('0x7')]?_0x45ba80[_0x5792('0x7')][_0x5792('0x23')]||null:null,'transaction':_0x12cef6,'lock':_0x12cef6[_0x5792('0x24')][_0x5792('0x25')],'include':[{'model':db['CmContact'],'as':_0x5792('0x26'),'attributes':_[_0x5792('0x27')](_0x4e3b35)},{'model':db[_0x5792('0x28')],'as':_0x5792('0x29'),'attributes':['id',_0x5792('0x2a'),_0x5792('0x2b')]}]})[_0x5792('0xf')](function(_0x59d1ef){var _0x4acc7f=[];var _0x2f2f61=[];for(var _0x3cb304=0x0;_0x3cb304<_0x59d1ef[_0x5792('0x2c')];_0x3cb304+=0x1){var _0x4e9939=_0x59d1ef[_0x3cb304][_0x5792('0x2d')];if(_0x4e9939===null){_0x4acc7f['push'](_0x59d1ef[_0x3cb304][_0x5792('0x2e')](_0x45ba80['body'],{'transaction':_0x12cef6}));}else if(!_0x2f2f61[_0x5792('0x2f')](_0x4e9939)){_0x2f2f61[_0x5792('0x30')](_0x4e9939);_0x4acc7f['push'](_0x59d1ef[_0x3cb304][_0x5792('0x2e')](_0x45ba80[_0x5792('0x1a')],{'transaction':_0x12cef6}));}}return BPromise[_0x5792('0x31')](_0x4acc7f);});})[_0x5792('0xf')](function(_0x463040){logger[_0x5792('0x10')](_0x5792('0x1e'),_0x45ba80);if(_0x463040[_0x5792('0x2c')]>0x0){logger[_0x5792('0x10')](_0x5792('0x32'),_0x463040[0x0]['dataValues']['id'],_0x463040[0x0][_0x5792('0x33')][_0x5792('0x34')],_0x463040[0x0][_0x5792('0x33')][_0x5792('0x35')]);}logger[_0x5792('0x11')](_0x5792('0x1e'),_0x45ba80,JSON[_0x5792('0x12')](_0x463040));_0x12625c(_0x463040);})['catch'](function(_0x47efc3){logger[_0x5792('0x17')]('GetContactDialer',_0x47efc3[_0x5792('0x14')],_0x45ba80);_0x14f446(_0x161a00[_0x5792('0x17')](0x1f4,_0x47efc3['message']));});});});};exports[_0x5792('0x36')]=function(_0x10c40c){var _0x2ac609=this;return new Promise(function(_0x274712,_0x13645f){return db['sequelize'][_0x5792('0x21')](function(_0x4a5ad4){return db[_0x5792('0x37')][_0x5792('0x19')](_0x10c40c[_0x5792('0x1a')],{'raw':_0x10c40c[_0x5792('0x7')]?_0x10c40c[_0x5792('0x7')]['raw']===undefined?!![]:![]:!![],'transaction':_0x4a5ad4})[_0x5792('0xf')](function(){logger[_0x5792('0x10')](_0x5792('0x38'),JSON[_0x5792('0x12')](_0x10c40c[_0x5792('0x7')][_0x5792('0x9')]),_0x10c40c[_0x5792('0x7')]['where'][_0x5792('0x35')]);return db[_0x5792('0x6')][_0x5792('0x39')]({'where':_0x10c40c['options']?_0x10c40c[_0x5792('0x7')]['where']||null:null,'transaction':_0x4a5ad4});});})[_0x5792('0xf')](function(_0x58281a){logger[_0x5792('0x10')](_0x5792('0x36'),_0x10c40c);logger[_0x5792('0x11')](_0x5792('0x36'),_0x10c40c,JSON[_0x5792('0x12')](_0x58281a));_0x274712(_0x58281a);})[_0x5792('0x13')](function(_0x63f7b0){logger[_0x5792('0x17')](_0x5792('0x36'),_0x63f7b0[_0x5792('0x14')],_0x10c40c);_0x13645f(_0x2ac609[_0x5792('0x17')](0x1f4,_0x63f7b0[_0x5792('0x14')]));});});};exports[_0x5792('0x3a')]=function(_0x381cb3){var _0x174b33=this;return new Promise(function(_0x25012a,_0x319d6d){return db[_0x5792('0x6')][_0x5792('0x22')]({'raw':_0x381cb3[_0x5792('0x7')]?_0x381cb3[_0x5792('0x7')][_0x5792('0x8')]===undefined?!![]:![]:!![],'where':_0x381cb3[_0x5792('0x7')]?_0x381cb3['options'][_0x5792('0x9')]||null:null,'attributes':[[db['sequelize']['fn'](_0x5792('0x3b'),db['sequelize']['fn']('IF',db[_0x5792('0x3c')][_0x5792('0x3d')](_0x5792('0x3e')+util[_0x5792('0x3f')]('\x22%s\x22',moment()[_0x5792('0x3f')](_0x5792('0x40')))+_0x5792('0x41')))),'contactsRescheduled']]})['then'](function(_0x5114ed){logger[_0x5792('0x10')](_0x5792('0x3a'),_0x381cb3);logger[_0x5792('0x11')](_0x5792('0x3a'),_0x381cb3,JSON[_0x5792('0x12')](_0x5114ed));_0x25012a(_0x5114ed);})[_0x5792('0x13')](function(_0x2286fe){logger[_0x5792('0x17')](_0x5792('0x3a'),_0x2286fe[_0x5792('0x14')],_0x381cb3);_0x319d6d(_0x174b33[_0x5792('0x17')](0x1f4,_0x2286fe[_0x5792('0x14')]));});});};exports[_0x5792('0x42')]=function(_0x258f80){var _0x511d3a=this;return new Promise(function(_0x1f1a35,_0x29691b){return db[_0x5792('0x1f')][_0x5792('0x20')]()[_0x5792('0xf')](function(){return db[_0x5792('0x3c')]['transaction'](function(_0x545313){return db[_0x5792('0x6')][_0x5792('0x22')]({'where':_0x258f80[_0x5792('0x7')]?_0x258f80[_0x5792('0x7')][_0x5792('0x9')]||null:null,'attributes':_0x258f80[_0x5792('0x7')]?_0x258f80['options'][_0x5792('0xa')]||null:null,'limit':0x1,'order':_0x258f80[_0x5792('0x7')]?_0x258f80[_0x5792('0x7')]['order']||null:null,'group':db[_0x5792('0x6')][_0x5792('0x2d')],'transaction':_0x545313,'lock':_0x545313['LOCK'][_0x5792('0x25')],'include':_0x258f80[_0x5792('0x7')]?_0x258f80['options'][_0x5792('0xd')]?_[_0x5792('0xc')](_0x258f80['options'][_0x5792('0xd')],function(_0x59a5bf){return{'model':db[_0x59a5bf['model']],'as':_0x59a5bf['as'],'attributes':_0x59a5bf[_0x5792('0xa')],'include':_0x59a5bf[_0x5792('0xd')]?_['map'](_0x59a5bf[_0x5792('0xd')],function(_0x51ee2){return{'model':db[_0x51ee2[_0x5792('0xe')]],'as':_0x51ee2['as'],'attributes':_0x51ee2[_0x5792('0xa')],'include':_0x51ee2[_0x5792('0xd')]?_[_0x5792('0xc')](_0x51ee2[_0x5792('0xd')],function(_0x17795f){return{'model':db[_0x17795f['model']],'as':_0x17795f['as'],'attributes':_0x17795f[_0x5792('0xa')]};}):[]};}):[]};}):[]:[]})[_0x5792('0xf')](function(_0x13ea61){var _0x157bbf=[];for(var _0x3d3c4b=0x0;_0x3d3c4b<_0x13ea61[_0x5792('0x2c')];_0x3d3c4b+=0x1){_0x157bbf[_0x5792('0x30')](_0x13ea61[_0x3d3c4b]['update'](_0x258f80[_0x5792('0x1a')],{'transaction':_0x545313}));}return BPromise[_0x5792('0x31')](_0x157bbf);});})[_0x5792('0xf')](function(_0x7fa83c){logger['info'](_0x5792('0x42'),_0x258f80);logger['debug']('GetContactRecallMe',_0x258f80,JSON[_0x5792('0x12')](_0x7fa83c));_0x1f1a35(_0x7fa83c);})[_0x5792('0x13')](function(_0x361a3c){logger[_0x5792('0x17')](_0x5792('0x42'),_0x361a3c[_0x5792('0x14')],_0x258f80);_0x29691b(_0x511d3a['error'](0x1f4,_0x361a3c['message']));});});});};exports[_0x5792('0x43')]=function(_0x497959){var _0x1e50cf=this;return new Promise(function(_0x3d2835,_0x3e0289){db[_0x5792('0x1f')][_0x5792('0x20')]()[_0x5792('0xf')](function(_0x31b164){return db['CmHopper'][_0x5792('0x22')]({'raw':_0x497959[_0x5792('0x7')]?_0x497959['options'][_0x5792('0x8')]===undefined?!![]:![]:!![],'where':_0x497959['options']?_0x497959[_0x5792('0x7')][_0x5792('0x9')]||null:null,'attributes':_0x497959['options']?_0x497959['options'][_0x5792('0xa')]||null:null,'limit':_0x497959[_0x5792('0x7')]?_0x497959[_0x5792('0x7')][_0x5792('0xb')]||null:null,'include':_0x497959[_0x5792('0x7')]?_0x497959[_0x5792('0x7')][_0x5792('0xd')]?_[_0x5792('0xc')](_0x497959[_0x5792('0x7')][_0x5792('0xd')],function(_0x16e9d4){return{'model':db[_0x16e9d4[_0x5792('0xe')]],'as':_0x16e9d4['as'],'attributes':_0x16e9d4['as']==='Contact'?_[_0x5792('0x27')](_0x31b164):_0x16e9d4[_0x5792('0xa')],'include':_0x16e9d4[_0x5792('0xd')]?_['map'](_0x16e9d4[_0x5792('0xd')],function(_0x549d92){return{'model':db[_0x549d92[_0x5792('0xe')]],'as':_0x549d92['as'],'attributes':_0x549d92['attributes'],'include':_0x549d92[_0x5792('0xd')]?_[_0x5792('0xc')](_0x549d92[_0x5792('0xd')],function(_0x280a65){return{'model':db[_0x280a65[_0x5792('0xe')]],'as':_0x280a65['as'],'attributes':_0x280a65['attributes']};}):[]};}):[]};}):[]:[]})[_0x5792('0xf')](function(_0x4ad80d){logger[_0x5792('0x10')](_0x5792('0x5'),_0x497959);logger[_0x5792('0x11')](_0x5792('0x5'),_0x497959,JSON['stringify'](_0x4ad80d));_0x3d2835(_0x4ad80d);})['catch'](function(_0x4efb43){logger[_0x5792('0x17')]('GetCmHopper',_0x4efb43[_0x5792('0x14')],_0x497959);_0x3e0289(_0x1e50cf[_0x5792('0x17')](0x1f4,_0x4efb43['message']));});});});};exports['GetContactByPhone']=function(_0x2c12a4){var _0x5d56c7=this;return new Promise(function(_0x3d9c4c,_0x4f3661){return db[_0x5792('0x1f')]['findOne']({'raw':!![],'where':{'phone':_0x2c12a4[_0x5792('0x7')][_0x5792('0x9')][_0x5792('0x44')]},'attributes':['id',_0x5792('0x45')],'order':[['id',_0x5792('0x46')]]})[_0x5792('0xf')](function(_0x520097){logger[_0x5792('0x10')]('getContactByPhone',_0x2c12a4);logger[_0x5792('0x11')](_0x5792('0x47'),_0x2c12a4,JSON[_0x5792('0x12')](_0x520097));_0x3d9c4c(_0x520097);})[_0x5792('0x13')](function(_0x39bc28){logger[_0x5792('0x17')](_0x5792('0x47'),_0x39bc28[_0x5792('0x14')],_0x2c12a4);_0x4f3661(_0x5d56c7[_0x5792('0x17')](0x1f4,_0x39bc28['message']));});});};exports[_0x5792('0x48')]=function(_0x507def){var _0x1c0acd=this;return new Promise(function(_0x170d45,_0x7f2bcf){return db[_0x5792('0x3c')][_0x5792('0x21')](function(_0x2e71a2){var _0x59c06f=_0x507def[_0x5792('0x7')]&&_0x507def[_0x5792('0x7')][_0x5792('0x9')]?_0x507def['options'][_0x5792('0x9')]:{};return db['CmHopper']['update'](_0x507def[_0x5792('0x1a')],{'where':_0x59c06f,'transaction':_0x2e71a2})[_0x5792('0xf')](function(_0x32cd98){logger[_0x5792('0x10')](_0x5792('0x48'),_0x507def);logger['debug']('ResetActiveCalls',_0x507def,JSON[_0x5792('0x12')](_0x32cd98));_0x170d45(_0x32cd98);})[_0x5792('0x13')](function(_0x21bd1c){logger[_0x5792('0x17')](_0x5792('0x48'),_0x21bd1c['message'],_0x507def);_0x7f2bcf(_0x1c0acd['error'](0x1f4,_0x21bd1c[_0x5792('0x14')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x1a62e9){var _0x3747c0=this;var _0x9be2c4=_0x1a62e9[_0x5792('0x1a')][_0x5792('0x9')][_0x5792('0x49')];var _0x205ddf=_0x1a62e9['body'][_0x5792('0x9')][_0x5792('0x4a')];var _0x5d4114=_0x1a62e9['body'][_0x5792('0x9')][_0x5792('0x4b')];return new Promise(function(_0x5ec876,_0x433d98){return db[_0x5792('0x6')]['findAll']({'where':{'voiceQueueId':{'$in':_0x9be2c4},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x5792('0x3c')][_0x5792('0x3d')](_0x5792('0x4c')+_0x205ddf+_0x5792('0x4d')),'$gt':db[_0x5792('0x3c')][_0x5792('0x3d')](_0x5792('0x4e'))}},'UserId':{'$in':_0x5d4114}},'include':[{'model':db['CmContact'],'as':_0x5792('0x26')},{'model':db[_0x5792('0x28')],'as':_0x5792('0x29'),'attributes':['id',_0x5792('0x2a'),_0x5792('0x2b')]},{'model':db['CmList'],'as':_0x5792('0x4f')}]})['then'](function(_0x28e1be){if(_0x28e1be['length']>0x0){return db[_0x5792('0x3c')][_0x5792('0x21')](function(_0x43e2b4){return db[_0x5792('0x6')][_0x5792('0x2e')]({'recallmeNotifiedDate':db[_0x5792('0x3c')]['literal'](_0x5792('0x4e'))},{'where':{'id':{'$in':_['map'](_0x28e1be,'id')}},'transaction':_0x43e2b4})['then'](function(){_0x5ec876(_0x28e1be);})[_0x5792('0x13')](function(_0x3af6da){logger[_0x5792('0x17')]('CmHopperHandlePreviewRecallNotifications',_0x3af6da['message'],_0x1a62e9);_0x433d98(_0x3747c0[_0x5792('0x17')](0x1f4,_0x3af6da[_0x5792('0x14')]));});})['catch'](function(_0x1ce5ef){logger[_0x5792('0x17')](_0x5792('0x50'),_0x1ce5ef[_0x5792('0x14')],_0x1a62e9);_0x433d98(_0x3747c0[_0x5792('0x17')](0x1f4,_0x1ce5ef[_0x5792('0x14')]));});}else{_0x5ec876(_0x28e1be);}});});};
\ No newline at end of file
+var _0x2752=['CreateCmHopper','body','UpdateCmHopper','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','order','LOCK','UPDATE','keys','User','Agent','name','voicePause','length','UserId','push','update','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','ContactId','MoveContactManagedDialer','sequelize','transaction','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','GetContactRecallMe','GetCmHopperPreview','Contact','GetContactByPhone','findOne','phone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','List','moment','../../mysqldb','rpc','findAll','options','raw','include','map','attributes','model','then','info','debug','GetCmHopper','stringify','error','message','ShowCmHopper','CmHopper','where','catch'];(function(_0x22ba21,_0x368ef1){var _0x15704b=function(_0x16bd99){while(--_0x16bd99){_0x22ba21['push'](_0x22ba21['shift']());}};_0x15704b(++_0x368ef1);}(_0x2752,0x1ad));var _0x2275=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2752[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2275('0x0'));var BPromise=require('bluebird');var db=require(_0x2275('0x1'))['db'];var logger=require('../../config/logger')(_0x2275('0x2'));exports['GetCmHopper']=function(_0x55e6e4){var _0x52bf95=this;return new Promise(function(_0x1c7817,_0x513c8c){return db['CmHopper'][_0x2275('0x3')]({'raw':_0x55e6e4['options']?_0x55e6e4[_0x2275('0x4')][_0x2275('0x5')]===undefined?!![]:![]:!![],'where':_0x55e6e4[_0x2275('0x4')]?_0x55e6e4[_0x2275('0x4')]['where']||null:null,'attributes':_0x55e6e4[_0x2275('0x4')]?_0x55e6e4[_0x2275('0x4')]['attributes']||null:null,'limit':_0x55e6e4[_0x2275('0x4')]?_0x55e6e4[_0x2275('0x4')]['limit']||null:null,'include':_0x55e6e4[_0x2275('0x4')]?_0x55e6e4[_0x2275('0x4')][_0x2275('0x6')]?_[_0x2275('0x7')](_0x55e6e4[_0x2275('0x4')]['include'],function(_0x3242a3){return{'model':db[_0x3242a3['model']],'as':_0x3242a3['as'],'attributes':_0x3242a3[_0x2275('0x8')],'include':_0x3242a3['include']?_[_0x2275('0x7')](_0x3242a3[_0x2275('0x6')],function(_0x3b0fa3){return{'model':db[_0x3b0fa3['model']],'as':_0x3b0fa3['as'],'attributes':_0x3b0fa3[_0x2275('0x8')],'include':_0x3b0fa3[_0x2275('0x6')]?_[_0x2275('0x7')](_0x3b0fa3['include'],function(_0x137aa0){return{'model':db[_0x137aa0[_0x2275('0x9')]],'as':_0x137aa0['as'],'attributes':_0x137aa0[_0x2275('0x8')]};}):[]};}):[]};}):[]:[]})[_0x2275('0xa')](function(_0x4d2edc){logger[_0x2275('0xb')]('GetCmHopper',_0x55e6e4);logger[_0x2275('0xc')](_0x2275('0xd'),_0x55e6e4,JSON[_0x2275('0xe')](_0x4d2edc));_0x1c7817(_0x4d2edc);})['catch'](function(_0x3d14ec){logger['error'](_0x2275('0xd'),_0x3d14ec['message'],_0x55e6e4);_0x513c8c(_0x52bf95[_0x2275('0xf')](0x1f4,_0x3d14ec[_0x2275('0x10')]));});});};exports[_0x2275('0x11')]=function(_0x5309a5){var _0x8961aa=this;return new Promise(function(_0x4bd754,_0x5b6a14){return db[_0x2275('0x12')]['find']({'raw':_0x5309a5[_0x2275('0x4')]?_0x5309a5[_0x2275('0x4')][_0x2275('0x5')]===undefined?!![]:![]:!![],'where':_0x5309a5[_0x2275('0x4')]?_0x5309a5[_0x2275('0x4')][_0x2275('0x13')]||null:null,'attributes':_0x5309a5[_0x2275('0x4')]?_0x5309a5['options'][_0x2275('0x8')]||null:null,'include':_0x5309a5['options']?_0x5309a5[_0x2275('0x4')]['include']?_[_0x2275('0x7')](_0x5309a5[_0x2275('0x4')]['include'],function(_0x17a59b){return{'model':db[_0x17a59b[_0x2275('0x9')]],'as':_0x17a59b['as'],'attributes':_0x17a59b[_0x2275('0x8')],'include':_0x17a59b[_0x2275('0x6')]?_[_0x2275('0x7')](_0x17a59b['include'],function(_0x57827e){return{'model':db[_0x57827e[_0x2275('0x9')]],'as':_0x57827e['as'],'attributes':_0x57827e[_0x2275('0x8')],'include':_0x57827e['include']?_['map'](_0x57827e[_0x2275('0x6')],function(_0x37310d){return{'model':db[_0x37310d[_0x2275('0x9')]],'as':_0x37310d['as'],'attributes':_0x37310d[_0x2275('0x8')]};}):[]};}):[]};}):[]:[]})[_0x2275('0xa')](function(_0x26a864){logger['info'](_0x2275('0x11'),_0x5309a5);logger[_0x2275('0xc')]('ShowCmHopper',_0x5309a5,JSON[_0x2275('0xe')](_0x26a864));_0x4bd754(_0x26a864);})[_0x2275('0x14')](function(_0x59c933){logger[_0x2275('0xf')](_0x2275('0x11'),_0x59c933[_0x2275('0x10')],_0x5309a5);_0x5b6a14(_0x8961aa[_0x2275('0xf')](0x1f4,_0x59c933[_0x2275('0x10')]));});});};exports[_0x2275('0x15')]=function(_0x4f205e){var _0x53603d=this;return new Promise(function(_0x49e343,_0x587b15){return db[_0x2275('0x12')]['create'](_0x4f205e[_0x2275('0x16')],{'raw':_0x4f205e[_0x2275('0x4')]?_0x4f205e[_0x2275('0x4')][_0x2275('0x5')]===undefined?!![]:![]:!![]})[_0x2275('0xa')](function(_0x35d15e){logger[_0x2275('0xb')](_0x2275('0x15'),_0x4f205e);logger['debug']('CreateCmHopper',_0x4f205e,JSON[_0x2275('0xe')](_0x35d15e));_0x49e343(_0x35d15e);})[_0x2275('0x14')](function(_0x5b18ee){logger[_0x2275('0xf')](_0x2275('0x15'),_0x5b18ee[_0x2275('0x10')],_0x4f205e);_0x587b15(_0x53603d[_0x2275('0xf')](0x1f4,_0x5b18ee[_0x2275('0x10')]));});});};exports[_0x2275('0x17')]=function(_0x525014){var _0x5393b5=this;return new Promise(function(_0x241cf5,_0x10f7fe){return db[_0x2275('0x12')]['update'](_0x525014[_0x2275('0x16')],{'raw':_0x525014['options']?_0x525014['options'][_0x2275('0x5')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x525014[_0x2275('0x4')]?_0x525014['options'][_0x2275('0x13')]||null:null,'attributes':_0x525014[_0x2275('0x4')]?_0x525014[_0x2275('0x4')][_0x2275('0x8')]||null:null,'limit':_0x525014[_0x2275('0x4')]?_0x525014['options'][_0x2275('0x18')]||null:null})['then'](function(_0x59055f){logger[_0x2275('0xb')](_0x2275('0x17'),_0x525014);logger[_0x2275('0xb')](_0x2275('0x19'),JSON[_0x2275('0xe')](_0x525014['options'][_0x2275('0x13')]),_0x525014[_0x2275('0x16')][_0x2275('0x1a')]);logger[_0x2275('0xc')](_0x2275('0x17'),_0x525014,JSON[_0x2275('0xe')](_0x59055f));_0x241cf5(_0x59055f);})[_0x2275('0x14')](function(_0x1442b2){logger[_0x2275('0xf')](_0x2275('0x17'),_0x1442b2[_0x2275('0x10')],_0x525014);_0x10f7fe(_0x5393b5[_0x2275('0xf')](0x1f4,_0x1442b2[_0x2275('0x10')]));});});};exports[_0x2275('0x1b')]=function(_0x4169c3){var _0x22ae09=this;return new Promise(function(_0x3a14a8,_0x4bd410){return db[_0x2275('0x12')][_0x2275('0x1c')]({'where':_0x4169c3[_0x2275('0x4')]?_0x4169c3[_0x2275('0x4')][_0x2275('0x13')]||null:null})[_0x2275('0xa')](function(_0x121569){logger['info'](_0x2275('0x1b'),_0x4169c3);logger[_0x2275('0xc')](_0x2275('0x1b'),_0x4169c3,JSON[_0x2275('0xe')](_0x121569));_0x3a14a8(_0x121569);})['catch'](function(_0x59f3fa){logger[_0x2275('0xf')]('DestroyCmHopper',_0x59f3fa['message'],_0x4169c3);_0x4bd410(_0x22ae09[_0x2275('0xf')](0x1f4,_0x59f3fa[_0x2275('0x10')]));});});};exports[_0x2275('0x1d')]=function(_0x1bd0c1){var _0x20796f=this;return new Promise(function(_0x4cf236,_0x171c28){return db[_0x2275('0x1e')][_0x2275('0x1f')]()[_0x2275('0xa')](function(_0x2ada64){return db['sequelize']['transaction'](function(_0x20a567){return db['CmHopper'][_0x2275('0x3')]({'where':_0x1bd0c1[_0x2275('0x4')]?_0x1bd0c1['options'][_0x2275('0x13')]||null:null,'attributes':_0x1bd0c1['options']?_0x1bd0c1[_0x2275('0x4')][_0x2275('0x8')]||null:null,'limit':_0x1bd0c1[_0x2275('0x4')]?_0x1bd0c1[_0x2275('0x4')][_0x2275('0x18')]||null:null,'order':_0x1bd0c1[_0x2275('0x4')]?_0x1bd0c1['options'][_0x2275('0x20')]||null:null,'transaction':_0x20a567,'lock':_0x20a567[_0x2275('0x21')][_0x2275('0x22')],'include':[{'model':db[_0x2275('0x1e')],'as':'Contact','attributes':_[_0x2275('0x23')](_0x2ada64)},{'model':db[_0x2275('0x24')],'as':_0x2275('0x25'),'attributes':['id',_0x2275('0x26'),_0x2275('0x27')]}]})[_0x2275('0xa')](function(_0xe7434e){var _0x3644aa=[];var _0x36e274=[];for(var _0x297feb=0x0;_0x297feb<_0xe7434e[_0x2275('0x28')];_0x297feb+=0x1){var _0x5166d5=_0xe7434e[_0x297feb][_0x2275('0x29')];if(_0x5166d5===null){_0x3644aa[_0x2275('0x2a')](_0xe7434e[_0x297feb][_0x2275('0x2b')](_0x1bd0c1[_0x2275('0x16')],{'transaction':_0x20a567}));}else if(!_0x36e274['includes'](_0x5166d5)){_0x36e274['push'](_0x5166d5);_0x3644aa['push'](_0xe7434e[_0x297feb][_0x2275('0x2b')](_0x1bd0c1[_0x2275('0x16')],{'transaction':_0x20a567}));}}return BPromise[_0x2275('0x2c')](_0x3644aa);});})[_0x2275('0xa')](function(_0x8d13fd){logger['info'](_0x2275('0x1d'),_0x1bd0c1);if(_0x8d13fd[_0x2275('0x28')]>0x0){logger[_0x2275('0xb')](_0x2275('0x2d'),_0x8d13fd[0x0]['dataValues']['id'],_0x8d13fd[0x0]['dataValues'][_0x2275('0x2e')],_0x8d13fd[0x0]['dataValues'][_0x2275('0x1a')]);}logger[_0x2275('0xc')]('GetContactDialer',_0x1bd0c1,JSON[_0x2275('0xe')](_0x8d13fd));_0x4cf236(_0x8d13fd);})['catch'](function(_0x33058c){logger[_0x2275('0xf')]('GetContactDialer',_0x33058c[_0x2275('0x10')],_0x1bd0c1);_0x171c28(_0x20796f[_0x2275('0xf')](0x1f4,_0x33058c[_0x2275('0x10')]));});});});};exports[_0x2275('0x2f')]=function(_0x210e42){var _0x5d26be=this;return new Promise(function(_0x4da800,_0x9d1f26){return db[_0x2275('0x30')][_0x2275('0x31')](function(_0x40f031){return db['CmHopperFinal'][_0x2275('0x32')](_0x210e42['body'],{'raw':_0x210e42[_0x2275('0x4')]?_0x210e42[_0x2275('0x4')][_0x2275('0x5')]===undefined?!![]:![]:!![],'transaction':_0x40f031})[_0x2275('0xa')](function(){logger['info'](_0x2275('0x33'),JSON[_0x2275('0xe')](_0x210e42[_0x2275('0x4')][_0x2275('0x13')]),_0x210e42[_0x2275('0x4')][_0x2275('0x13')][_0x2275('0x1a')]);return db[_0x2275('0x12')]['destroy']({'where':_0x210e42[_0x2275('0x4')]?_0x210e42[_0x2275('0x4')]['where']||null:null,'transaction':_0x40f031});});})[_0x2275('0xa')](function(_0x498d0b){logger['info'](_0x2275('0x2f'),_0x210e42);logger['debug'](_0x2275('0x2f'),_0x210e42,JSON['stringify'](_0x498d0b));_0x4da800(_0x498d0b);})[_0x2275('0x14')](function(_0x326e40){logger[_0x2275('0xf')](_0x2275('0x2f'),_0x326e40[_0x2275('0x10')],_0x210e42);_0x9d1f26(_0x5d26be[_0x2275('0xf')](0x1f4,_0x326e40['message']));});});};exports[_0x2275('0x34')]=function(_0x1b0901){var _0x442428=this;return new Promise(function(_0x26eb73,_0x38536f){return db[_0x2275('0x12')][_0x2275('0x3')]({'raw':_0x1b0901['options']?_0x1b0901['options'][_0x2275('0x5')]===undefined?!![]:![]:!![],'where':_0x1b0901[_0x2275('0x4')]?_0x1b0901['options'][_0x2275('0x13')]||null:null,'attributes':[[db[_0x2275('0x30')]['fn'](_0x2275('0x35'),db[_0x2275('0x30')]['fn']('IF',db[_0x2275('0x30')][_0x2275('0x36')](_0x2275('0x37')+util[_0x2275('0x38')](_0x2275('0x39'),moment()['format'](_0x2275('0x3a')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})['then'](function(_0x5b9fce){logger[_0x2275('0xb')]('CountReScheduled',_0x1b0901);logger['debug'](_0x2275('0x34'),_0x1b0901,JSON[_0x2275('0xe')](_0x5b9fce));_0x26eb73(_0x5b9fce);})[_0x2275('0x14')](function(_0x3b3820){logger[_0x2275('0xf')](_0x2275('0x34'),_0x3b3820[_0x2275('0x10')],_0x1b0901);_0x38536f(_0x442428[_0x2275('0xf')](0x1f4,_0x3b3820[_0x2275('0x10')]));});});};exports[_0x2275('0x3b')]=function(_0x535226){var _0x18a9d8=this;return new Promise(function(_0x3caaf8,_0x1b1bfb){return db[_0x2275('0x1e')][_0x2275('0x1f')]()[_0x2275('0xa')](function(){return db['sequelize'][_0x2275('0x31')](function(_0x3e8bc1){return db[_0x2275('0x12')][_0x2275('0x3')]({'where':_0x535226['options']?_0x535226[_0x2275('0x4')][_0x2275('0x13')]||null:null,'attributes':_0x535226['options']?_0x535226[_0x2275('0x4')][_0x2275('0x8')]||null:null,'limit':0x1,'order':_0x535226[_0x2275('0x4')]?_0x535226[_0x2275('0x4')][_0x2275('0x20')]||null:null,'group':db[_0x2275('0x12')][_0x2275('0x29')],'transaction':_0x3e8bc1,'lock':_0x3e8bc1[_0x2275('0x21')][_0x2275('0x22')],'include':_0x535226[_0x2275('0x4')]?_0x535226[_0x2275('0x4')][_0x2275('0x6')]?_[_0x2275('0x7')](_0x535226[_0x2275('0x4')]['include'],function(_0x595fc6){return{'model':db[_0x595fc6[_0x2275('0x9')]],'as':_0x595fc6['as'],'attributes':_0x595fc6[_0x2275('0x8')],'include':_0x595fc6[_0x2275('0x6')]?_[_0x2275('0x7')](_0x595fc6[_0x2275('0x6')],function(_0x23aa8a){return{'model':db[_0x23aa8a[_0x2275('0x9')]],'as':_0x23aa8a['as'],'attributes':_0x23aa8a[_0x2275('0x8')],'include':_0x23aa8a['include']?_[_0x2275('0x7')](_0x23aa8a[_0x2275('0x6')],function(_0x1e466c){return{'model':db[_0x1e466c[_0x2275('0x9')]],'as':_0x1e466c['as'],'attributes':_0x1e466c[_0x2275('0x8')]};}):[]};}):[]};}):[]:[]})[_0x2275('0xa')](function(_0x23f251){var _0x32c55a=[];for(var _0x263142=0x0;_0x263142<_0x23f251['length'];_0x263142+=0x1){_0x32c55a[_0x2275('0x2a')](_0x23f251[_0x263142][_0x2275('0x2b')](_0x535226['body'],{'transaction':_0x3e8bc1}));}return BPromise['all'](_0x32c55a);});})[_0x2275('0xa')](function(_0x3e5604){logger[_0x2275('0xb')](_0x2275('0x3b'),_0x535226);logger[_0x2275('0xc')]('GetContactRecallMe',_0x535226,JSON['stringify'](_0x3e5604));_0x3caaf8(_0x3e5604);})[_0x2275('0x14')](function(_0x3a52e0){logger[_0x2275('0xf')]('GetContactRecallMe',_0x3a52e0[_0x2275('0x10')],_0x535226);_0x1b1bfb(_0x18a9d8['error'](0x1f4,_0x3a52e0[_0x2275('0x10')]));});});});};exports[_0x2275('0x3c')]=function(_0x255b7c){var _0x4a04dd=this;return new Promise(function(_0x4a5be7,_0x583d71){db[_0x2275('0x1e')][_0x2275('0x1f')]()['then'](function(_0x4cd347){return db[_0x2275('0x12')][_0x2275('0x3')]({'raw':_0x255b7c[_0x2275('0x4')]?_0x255b7c['options'][_0x2275('0x5')]===undefined?!![]:![]:!![],'where':_0x255b7c[_0x2275('0x4')]?_0x255b7c[_0x2275('0x4')]['where']||null:null,'attributes':_0x255b7c[_0x2275('0x4')]?_0x255b7c[_0x2275('0x4')]['attributes']||null:null,'limit':_0x255b7c[_0x2275('0x4')]?_0x255b7c[_0x2275('0x4')][_0x2275('0x18')]||null:null,'include':_0x255b7c[_0x2275('0x4')]?_0x255b7c[_0x2275('0x4')][_0x2275('0x6')]?_['map'](_0x255b7c['options'][_0x2275('0x6')],function(_0x459c70){return{'model':db[_0x459c70['model']],'as':_0x459c70['as'],'attributes':_0x459c70['as']===_0x2275('0x3d')?_['keys'](_0x4cd347):_0x459c70[_0x2275('0x8')],'include':_0x459c70['include']?_[_0x2275('0x7')](_0x459c70[_0x2275('0x6')],function(_0x58607e){return{'model':db[_0x58607e[_0x2275('0x9')]],'as':_0x58607e['as'],'attributes':_0x58607e[_0x2275('0x8')],'include':_0x58607e[_0x2275('0x6')]?_['map'](_0x58607e[_0x2275('0x6')],function(_0x4ac7bf){return{'model':db[_0x4ac7bf[_0x2275('0x9')]],'as':_0x4ac7bf['as'],'attributes':_0x4ac7bf[_0x2275('0x8')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x228e32){logger[_0x2275('0xb')](_0x2275('0xd'),_0x255b7c);logger[_0x2275('0xc')](_0x2275('0xd'),_0x255b7c,JSON[_0x2275('0xe')](_0x228e32));_0x4a5be7(_0x228e32);})[_0x2275('0x14')](function(_0x5b5bae){logger['error'](_0x2275('0xd'),_0x5b5bae[_0x2275('0x10')],_0x255b7c);_0x583d71(_0x4a04dd['error'](0x1f4,_0x5b5bae[_0x2275('0x10')]));});});});};exports[_0x2275('0x3e')]=function(_0x495164){var _0x616eb9=this;return new Promise(function(_0x5a7d85,_0x48f609){return db[_0x2275('0x1e')][_0x2275('0x3f')]({'raw':!![],'where':{'phone':_0x495164[_0x2275('0x4')][_0x2275('0x13')][_0x2275('0x40')]},'attributes':['id','dialTimezone'],'order':[['id',_0x2275('0x41')]]})['then'](function(_0x6a32f0){logger[_0x2275('0xb')](_0x2275('0x42'),_0x495164);logger[_0x2275('0xc')](_0x2275('0x42'),_0x495164,JSON[_0x2275('0xe')](_0x6a32f0));_0x5a7d85(_0x6a32f0);})['catch'](function(_0xbd060a){logger[_0x2275('0xf')](_0x2275('0x42'),_0xbd060a[_0x2275('0x10')],_0x495164);_0x48f609(_0x616eb9[_0x2275('0xf')](0x1f4,_0xbd060a['message']));});});};exports['ResetActiveCalls']=function(_0x1d3f06){var _0xbb650c=this;return new Promise(function(_0x265c58,_0xd0b67){return db[_0x2275('0x30')][_0x2275('0x31')](function(_0x5aa880){var _0x1f8deb=_0x1d3f06[_0x2275('0x4')]&&_0x1d3f06[_0x2275('0x4')]['where']?_0x1d3f06[_0x2275('0x4')][_0x2275('0x13')]:{};return db[_0x2275('0x12')][_0x2275('0x2b')](_0x1d3f06['body'],{'where':_0x1f8deb,'transaction':_0x5aa880})['then'](function(_0x323788){logger[_0x2275('0xb')](_0x2275('0x43'),_0x1d3f06);logger[_0x2275('0xc')](_0x2275('0x43'),_0x1d3f06,JSON[_0x2275('0xe')](_0x323788));_0x265c58(_0x323788);})[_0x2275('0x14')](function(_0x3aa69b){logger[_0x2275('0xf')](_0x2275('0x43'),_0x3aa69b[_0x2275('0x10')],_0x1d3f06);_0xd0b67(_0xbb650c['error'](0x1f4,_0x3aa69b[_0x2275('0x10')]));});});});};exports[_0x2275('0x44')]=function(_0x2610f6){var _0x1c3773=this;var _0xe712bc=_0x2610f6['body'][_0x2275('0x13')][_0x2275('0x45')];var _0x8d489a=_0x2610f6[_0x2275('0x16')][_0x2275('0x13')]['interval'];var _0x103201=_0x2610f6[_0x2275('0x16')][_0x2275('0x13')][_0x2275('0x46')];return new Promise(function(_0xdcda49,_0x1434b9){return db[_0x2275('0x12')][_0x2275('0x3')]({'where':{'voiceQueueId':{'$in':_0xe712bc},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x2275('0x30')][_0x2275('0x36')](_0x2275('0x47')+_0x8d489a+_0x2275('0x48')),'$gt':db['sequelize'][_0x2275('0x36')](_0x2275('0x49'))}},'UserId':{'$in':_0x103201}},'include':[{'model':db['CmContact'],'as':_0x2275('0x3d')},{'model':db['User'],'as':_0x2275('0x25'),'attributes':['id',_0x2275('0x26'),'voicePause']},{'model':db['CmList'],'as':_0x2275('0x4a')}]})[_0x2275('0xa')](function(_0x3bffbc){if(_0x3bffbc[_0x2275('0x28')]>0x0){return db[_0x2275('0x30')][_0x2275('0x31')](function(_0x3ed5e8){return db[_0x2275('0x12')]['update']({'recallmeNotifiedDate':db[_0x2275('0x30')][_0x2275('0x36')](_0x2275('0x49'))},{'where':{'id':{'$in':_[_0x2275('0x7')](_0x3bffbc,'id')}},'transaction':_0x3ed5e8})[_0x2275('0xa')](function(){_0xdcda49(_0x3bffbc);})['catch'](function(_0xe212d3){logger[_0x2275('0xf')](_0x2275('0x44'),_0xe212d3[_0x2275('0x10')],_0x2610f6);_0x1434b9(_0x1c3773[_0x2275('0xf')](0x1f4,_0xe212d3[_0x2275('0x10')]));});})['catch'](function(_0x2b978d){logger[_0x2275('0xf')](_0x2275('0x44'),_0x2b978d[_0x2275('0x10')],_0x2610f6);_0x1434b9(_0x1c3773['error'](0x1f4,_0x2b978d['message']));});}else{_0xdcda49(_0x3bffbc);}});});};
\ No newline at end of file
index 659c986..f983baf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64c0=['/describe','isAuthenticated','describe','/opencontacts','getOpenContacts','get','/timezones','getTimezones','getPreviewRecall','post','create','/preview','getPreview','/timezone','put','/:id','update','delete','destroy','exports','../../components/auth/service','./cmHopper.controller','index'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x64c0,0x9e));var _0x064c=function(_0x59aecc,_0x255014){_0x59aecc=_0x59aecc-0x0;var _0x46b112=_0x64c0[_0x59aecc];return _0x46b112;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x064c('0x0'));var controller=require(_0x064c('0x1'));router['get']('/',auth['isAuthenticated'](),controller[_0x064c('0x2')]);router['get'](_0x064c('0x3'),auth[_0x064c('0x4')](),controller[_0x064c('0x5')]);router['get'](_0x064c('0x6'),auth['isAuthenticated'](),controller[_0x064c('0x7')]);router[_0x064c('0x8')](_0x064c('0x9'),auth['isAuthenticated'](),controller[_0x064c('0xa')]);router[_0x064c('0x8')]('/:id',auth[_0x064c('0x4')](),controller['show']);router[_0x064c('0x8')]('/:id/previewrecall',auth[_0x064c('0x4')](),controller[_0x064c('0xb')]);router[_0x064c('0xc')]('/',auth['isAuthenticated'](),controller[_0x064c('0xd')]);router[_0x064c('0xc')](_0x064c('0xe'),auth[_0x064c('0x4')](),controller[_0x064c('0xf')]);router[_0x064c('0xc')](_0x064c('0x10'),auth[_0x064c('0x4')](),controller['getTimezone']);router[_0x064c('0x11')](_0x064c('0x12'),auth['isAuthenticated'](),controller[_0x064c('0x13')]);router[_0x064c('0x14')](_0x064c('0x12'),auth[_0x064c('0x4')](),controller[_0x064c('0x15')]);module[_0x064c('0x16')]=router;
\ No newline at end of file
+var _0x4f8b=['get','isAuthenticated','index','/describe','describe','/opencontacts','/timezones','getTimezones','/:id','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','/timezone','getTimezone','put','update','destroy','express','Router','../../components/auth/service'];(function(_0x400673,_0x57d972){var _0x3d0828=function(_0x4fc9e9){while(--_0x4fc9e9){_0x400673['push'](_0x400673['shift']());}};_0x3d0828(++_0x57d972);}(_0x4f8b,0x13f));var _0xb4f8=function(_0x2d8cea,_0x4a9460){_0x2d8cea=_0x2d8cea-0x0;var _0xcf3c00=_0x4f8b[_0x2d8cea];return _0xcf3c00;};'use strict';var express=require(_0xb4f8('0x0'));var router=express[_0xb4f8('0x1')]();var auth=require(_0xb4f8('0x2'));var controller=require('./cmHopper.controller');router[_0xb4f8('0x3')]('/',auth[_0xb4f8('0x4')](),controller[_0xb4f8('0x5')]);router['get'](_0xb4f8('0x6'),auth['isAuthenticated'](),controller[_0xb4f8('0x7')]);router[_0xb4f8('0x3')](_0xb4f8('0x8'),auth[_0xb4f8('0x4')](),controller['getOpenContacts']);router[_0xb4f8('0x3')](_0xb4f8('0x9'),auth['isAuthenticated'](),controller[_0xb4f8('0xa')]);router['get'](_0xb4f8('0xb'),auth[_0xb4f8('0x4')](),controller['show']);router[_0xb4f8('0x3')](_0xb4f8('0xc'),auth['isAuthenticated'](),controller[_0xb4f8('0xd')]);router[_0xb4f8('0xe')]('/',auth[_0xb4f8('0x4')](),controller[_0xb4f8('0xf')]);router[_0xb4f8('0xe')](_0xb4f8('0x10'),auth[_0xb4f8('0x4')](),controller[_0xb4f8('0x11')]);router[_0xb4f8('0xe')](_0xb4f8('0x12'),auth[_0xb4f8('0x4')](),controller[_0xb4f8('0x13')]);router[_0xb4f8('0x14')](_0xb4f8('0xb'),auth['isAuthenticated'](),controller[_0xb4f8('0x15')]);router['delete'](_0xb4f8('0xb'),auth[_0xb4f8('0x4')](),controller[_0xb4f8('0x16')]);module['exports']=router;
\ No newline at end of file
index 99817a8..f62565d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a20=['sequelize','exports','INTEGER','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment'];(function(_0x402224,_0x5ab8c5){var _0x1d7542=function(_0x29ad20){while(--_0x29ad20){_0x402224['push'](_0x402224['shift']());}};_0x1d7542(++_0x5ab8c5);}(_0x6a20,0xdf));var _0x06a2=function(_0x1c34e7,_0x33f9a8){_0x1c34e7=_0x1c34e7-0x0;var _0x378cb1=_0x6a20[_0x1c34e7];return _0x378cb1;};'use strict';var moment=require(_0x06a2('0x0'));var Sequelize=require(_0x06a2('0x1'));module[_0x06a2('0x2')]={'CmHopperId':{'type':Sequelize[_0x06a2('0x3')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x06a2('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x06a2('0x4')],'defaultValue':moment()[_0x06a2('0x5')](_0x06a2('0x6'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x06a2('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x06a2('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x06a2('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x06a2('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x06a2('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x06a2('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x086c=['YYYY-MM-DD\x20HH:mm:ss','sequelize','STRING','INTEGER','format'];(function(_0x4ce45a,_0x55a777){var _0x3b65d2=function(_0x11309c){while(--_0x11309c){_0x4ce45a['push'](_0x4ce45a['shift']());}};_0x3b65d2(++_0x55a777);}(_0x086c,0x11e));var _0xc086=function(_0xc41594,_0x3ff4a4){_0xc41594=_0xc41594-0x0;var _0x2b803b=_0x086c[_0xc41594];return _0x2b803b;};'use strict';var moment=require('moment');var Sequelize=require(_0xc086('0x0'));module['exports']={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0xc086('0x1')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xc086('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xc086('0x3')](_0xc086('0x4'))},'countbusyretry':{'type':Sequelize[_0xc086('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc086('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc086('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xc086('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc086('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc086('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc086('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc086('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 98b7744..182db5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d18=['rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','include','find','create','body','user','get','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','bluebird','mustache','sox','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','CmHopperAdditionalPhones','UserProfileResource','sendStatus','stack','name','send','index','map','CmHopperAdditionalPhone'];(function(_0x2d4d75,_0x5d4d61){var _0x339312=function(_0x296c03){while(--_0x296c03){_0x2d4d75['push'](_0x2d4d75['shift']());}};_0x339312(++_0x5d4d61);}(_0x4d18,0x1b8));var _0x84d1=function(_0x4c9841,_0x4524df){_0x4c9841=_0x4c9841-0x0;var _0x494fe2=_0x4d18[_0x4c9841];return _0x494fe2;};'use strict';var emlformat=require(_0x84d1('0x0'));var rimraf=require(_0x84d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x84d1('0x2'));var moment=require('moment');var BPromise=require(_0x84d1('0x3'));var Mustache=require(_0x84d1('0x4'));var util=require('util');var path=require('path');var sox=require(_0x84d1('0x5'));var csv=require('to-csv');var ejs=require(_0x84d1('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x84d1('0x7'));var crypto=require(_0x84d1('0x8'));var jsforce=require(_0x84d1('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x84d1('0xa'));var Papa=require(_0x84d1('0xb'));var Redis=require(_0x84d1('0xc'));var authService=require(_0x84d1('0xd'));var qs=require(_0x84d1('0xe'));var as=require(_0x84d1('0xf'));var hardwareService=require(_0x84d1('0x10'));var logger=require(_0x84d1('0x11'))(_0x84d1('0x12'));var utils=require('../../config/utils');var config=require(_0x84d1('0x13'));var licenseUtil=require(_0x84d1('0x14'));var db=require(_0x84d1('0x15'))['db'];function respondWithStatusCode(_0x567e0d,_0x1ef30d){_0x1ef30d=_0x1ef30d||0xcc;return function(_0x48d248){if(_0x48d248){return _0x567e0d['sendStatus'](_0x1ef30d);}return _0x567e0d[_0x84d1('0x16')](_0x1ef30d)[_0x84d1('0x17')]();};}function respondWithResult(_0x188641,_0x42b3d5){_0x42b3d5=_0x42b3d5||0xc8;return function(_0x225e31){if(_0x225e31){return _0x188641[_0x84d1('0x16')](_0x42b3d5)[_0x84d1('0x18')](_0x225e31);}};}function respondWithFilteredResult(_0x470898,_0x4206f9){return function(_0x1c04be){if(_0x1c04be){var _0x1e60b8=typeof _0x4206f9[_0x84d1('0x19')]===_0x84d1('0x1a')&&typeof _0x4206f9[_0x84d1('0x1b')]==='undefined';var _0x1d922d=_0x1c04be[_0x84d1('0x1c')];var _0x5f5623=_0x1e60b8?0x0:_0x4206f9['offset'];var _0x229ddb=_0x1e60b8?_0x1c04be[_0x84d1('0x1c')]:_0x4206f9['offset']+_0x4206f9['limit'];var _0x219831;if(_0x229ddb>=_0x1d922d){_0x229ddb=_0x1d922d;_0x219831=0xc8;}else{_0x219831=0xce;}_0x470898[_0x84d1('0x16')](_0x219831);return _0x470898[_0x84d1('0x1d')](_0x84d1('0x1e'),_0x5f5623+'-'+_0x229ddb+'/'+_0x1d922d)[_0x84d1('0x18')](_0x1c04be);}return null;};}function patchUpdates(_0x3182f2){return function(_0x3d0a00){try{jsonpatch[_0x84d1('0x1f')](_0x3d0a00,_0x3182f2,!![]);}catch(_0x56c24f){return BPromise[_0x84d1('0x20')](_0x56c24f);}return _0x3d0a00[_0x84d1('0x21')]();};}function saveUpdates(_0x39f43b,_0x1d491f){return function(_0xf6d5d9){if(_0xf6d5d9){return _0xf6d5d9[_0x84d1('0x22')](_0x39f43b)[_0x84d1('0x23')](function(_0x2f5ecb){return _0x2f5ecb;});}return null;};}function removeEntity(_0x4051f3,_0x45176f){return function(_0x554383){if(_0x554383){return _0x554383[_0x84d1('0x24')]()[_0x84d1('0x23')](function(){var _0x4bb7f2=_0x554383['get']({'plain':!![]});var _0x266a30=_0x84d1('0x25');return db[_0x84d1('0x26')][_0x84d1('0x24')]({'where':{'type':_0x266a30,'resourceId':_0x4bb7f2['id']}})[_0x84d1('0x23')](function(){return _0x554383;});})[_0x84d1('0x23')](function(){_0x4051f3['status'](0xcc)[_0x84d1('0x17')]();});}};}function handleEntityNotFound(_0x2b601b,_0xd42c13){return function(_0x2c238f){if(!_0x2c238f){_0x2b601b[_0x84d1('0x27')](0x194);}return _0x2c238f;};}function handleError(_0x58bffe,_0x7ef7b2){_0x7ef7b2=_0x7ef7b2||0x1f4;return function(_0x321c4a){logger['error'](_0x321c4a[_0x84d1('0x28')]);if(_0x321c4a[_0x84d1('0x29')]){delete _0x321c4a['name'];}_0x58bffe[_0x84d1('0x16')](_0x7ef7b2)[_0x84d1('0x2a')](_0x321c4a);};}exports[_0x84d1('0x2b')]=function(_0x43d7d3,_0x14a2ba){var _0x4c53a2={},_0x4b9d9f={},_0xbb3b4f={'count':0x0,'rows':[]};var _0x3a451a=_[_0x84d1('0x2c')](db[_0x84d1('0x2d')][_0x84d1('0x2e')],function(_0x2df000){return{'name':_0x2df000[_0x84d1('0x2f')],'type':_0x2df000[_0x84d1('0x30')][_0x84d1('0x31')]};});_0x4b9d9f['model']=_[_0x84d1('0x2c')](_0x3a451a,_0x84d1('0x29'));_0x4b9d9f[_0x84d1('0x32')]=_[_0x84d1('0x33')](_0x43d7d3[_0x84d1('0x32')]);_0x4b9d9f[_0x84d1('0x34')]=_[_0x84d1('0x35')](_0x4b9d9f[_0x84d1('0x36')],_0x4b9d9f[_0x84d1('0x32')]);_0x4c53a2[_0x84d1('0x37')]=_[_0x84d1('0x35')](_0x4b9d9f['model'],qs[_0x84d1('0x38')](_0x43d7d3[_0x84d1('0x32')][_0x84d1('0x38')]));_0x4c53a2['attributes']=_0x4c53a2[_0x84d1('0x37')][_0x84d1('0x39')]?_0x4c53a2[_0x84d1('0x37')]:_0x4b9d9f['model'];if(!_0x43d7d3['query'][_0x84d1('0x3a')](_0x84d1('0x3b'))){_0x4c53a2[_0x84d1('0x1b')]=qs['limit'](_0x43d7d3[_0x84d1('0x32')][_0x84d1('0x1b')]);_0x4c53a2[_0x84d1('0x19')]=qs[_0x84d1('0x19')](_0x43d7d3[_0x84d1('0x32')][_0x84d1('0x19')]);}_0x4c53a2['order']=qs[_0x84d1('0x3c')](_0x43d7d3[_0x84d1('0x32')][_0x84d1('0x3c')]);_0x4c53a2[_0x84d1('0x3d')]=qs[_0x84d1('0x34')](_['pick'](_0x43d7d3[_0x84d1('0x32')],_0x4b9d9f[_0x84d1('0x34')]),_0x3a451a);if(_0x43d7d3[_0x84d1('0x32')][_0x84d1('0x3e')]){_0x4c53a2[_0x84d1('0x3d')]=_[_0x84d1('0x3f')](_0x4c53a2[_0x84d1('0x3d')],{'$or':_[_0x84d1('0x2c')](_0x3a451a,function(_0x3bf7c2){if(_0x3bf7c2['type']!==_0x84d1('0x40')){var _0x3a8be0={};_0x3a8be0[_0x3bf7c2[_0x84d1('0x29')]]={'$like':'%'+_0x43d7d3['query']['filter']+'%'};return _0x3a8be0;}})});}_0x4c53a2=_[_0x84d1('0x3f')]({},_0x4c53a2,_0x43d7d3['options']);var _0x3a9b1e={'where':_0x4c53a2[_0x84d1('0x3d')]};return db[_0x84d1('0x2d')][_0x84d1('0x1c')](_0x3a9b1e)[_0x84d1('0x23')](function(_0x2c56da){_0xbb3b4f['count']=_0x2c56da;if(_0x43d7d3[_0x84d1('0x32')][_0x84d1('0x41')]){_0x4c53a2['include']=[{'all':!![]}];}return db[_0x84d1('0x2d')][_0x84d1('0x42')](_0x4c53a2);})[_0x84d1('0x23')](function(_0x4c4352){_0xbb3b4f[_0x84d1('0x43')]=_0x4c4352;return _0xbb3b4f;})[_0x84d1('0x23')](respondWithFilteredResult(_0x14a2ba,_0x4c53a2))[_0x84d1('0x44')](handleError(_0x14a2ba,null));};exports['show']=function(_0xc180be,_0x34d12e){var _0x335854={'raw':!![],'where':{'id':_0xc180be[_0x84d1('0x45')]['id']}},_0x46a7ed={};_0x46a7ed[_0x84d1('0x36')]=_[_0x84d1('0x33')](db['CmHopperAdditionalPhone']['rawAttributes']);_0x46a7ed[_0x84d1('0x32')]=_[_0x84d1('0x33')](_0xc180be[_0x84d1('0x32')]);_0x46a7ed[_0x84d1('0x34')]=_[_0x84d1('0x35')](_0x46a7ed[_0x84d1('0x36')],_0x46a7ed[_0x84d1('0x32')]);_0x335854['attributes']=_[_0x84d1('0x35')](_0x46a7ed[_0x84d1('0x36')],qs[_0x84d1('0x38')](_0xc180be[_0x84d1('0x32')][_0x84d1('0x38')]));_0x335854[_0x84d1('0x37')]=_0x335854[_0x84d1('0x37')]['length']?_0x335854[_0x84d1('0x37')]:_0x46a7ed[_0x84d1('0x36')];if(_0xc180be[_0x84d1('0x32')][_0x84d1('0x41')]){_0x335854[_0x84d1('0x46')]=[{'all':!![]}];}_0x335854=_['merge']({},_0x335854,_0xc180be['options']);return db[_0x84d1('0x2d')][_0x84d1('0x47')](_0x335854)[_0x84d1('0x23')](handleEntityNotFound(_0x34d12e,null))[_0x84d1('0x23')](respondWithResult(_0x34d12e,null))[_0x84d1('0x44')](handleError(_0x34d12e,null));};exports[_0x84d1('0x48')]=function(_0x585bc4,_0x40e96f){return db[_0x84d1('0x2d')]['create'](_0x585bc4[_0x84d1('0x49')],{})[_0x84d1('0x23')](function(_0x155b41){var _0x2a3de0=_0x585bc4[_0x84d1('0x4a')][_0x84d1('0x4b')]({'plain':!![]});if(!_0x2a3de0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a3de0[_0x84d1('0x4c')]==='user'){var _0x2a8906=_0x155b41[_0x84d1('0x4b')]({'plain':!![]});var _0x663d03=_0x84d1('0x25');return db[_0x84d1('0x4d')]['find']({'where':{'name':_0x663d03,'userProfileId':_0x2a3de0['userProfileId']},'raw':!![]})[_0x84d1('0x23')](function(_0x278d9a){if(_0x278d9a&&_0x278d9a[_0x84d1('0x4e')]===0x0){return db[_0x84d1('0x26')][_0x84d1('0x48')]({'name':_0x2a8906[_0x84d1('0x29')],'resourceId':_0x2a8906['id'],'type':_0x278d9a['name'],'sectionId':_0x278d9a['id']},{})[_0x84d1('0x23')](function(){return _0x155b41;});}else{return _0x155b41;}})['catch'](function(_0xb84147){logger[_0x84d1('0x4f')](_0x84d1('0x50'),_0xb84147);throw _0xb84147;});}return _0x155b41;})[_0x84d1('0x23')](respondWithResult(_0x40e96f,0xc9))[_0x84d1('0x44')](handleError(_0x40e96f,null));};exports[_0x84d1('0x22')]=function(_0x181dbb,_0x4678d8){if(_0x181dbb[_0x84d1('0x49')]['id']){delete _0x181dbb[_0x84d1('0x49')]['id'];}return db[_0x84d1('0x2d')][_0x84d1('0x47')]({'where':{'id':_0x181dbb['params']['id']}})[_0x84d1('0x23')](handleEntityNotFound(_0x4678d8,null))[_0x84d1('0x23')](saveUpdates(_0x181dbb[_0x84d1('0x49')],null))['then'](respondWithResult(_0x4678d8,null))[_0x84d1('0x44')](handleError(_0x4678d8,null));};exports['destroy']=function(_0x14fcd6,_0x31d128){return db[_0x84d1('0x2d')][_0x84d1('0x47')]({'where':{'id':_0x14fcd6[_0x84d1('0x45')]['id']}})[_0x84d1('0x23')](handleEntityNotFound(_0x31d128,null))[_0x84d1('0x23')](removeEntity(_0x31d128,null))[_0x84d1('0x44')](handleError(_0x31d128,null));};
\ No newline at end of file
+var _0x4cb7=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','then','destroy','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','send','index','CmHopperAdditionalPhone','rawAttributes','fieldName','map','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x27c50f,_0x524c55){var _0x355036=function(_0x35db47){while(--_0x35db47){_0x27c50f['push'](_0x27c50f['shift']());}};_0x355036(++_0x524c55);}(_0x4cb7,0xe5));var _0x74cb=function(_0x106272,_0x383b6b){_0x106272=_0x106272-0x0;var _0x3a3fcb=_0x4cb7[_0x106272];return _0x3a3fcb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x74cb('0x0'));var zipdir=require(_0x74cb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x74cb('0x2'));var moment=require(_0x74cb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x74cb('0x4'));var util=require(_0x74cb('0x5'));var path=require(_0x74cb('0x6'));var sox=require(_0x74cb('0x7'));var csv=require(_0x74cb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x74cb('0x9'));var squel=require('squel');var crypto=require(_0x74cb('0xa'));var jsforce=require(_0x74cb('0xb'));var deskjs=require(_0x74cb('0xc'));var toCsv=require(_0x74cb('0x8'));var querystring=require('querystring');var Papa=require(_0x74cb('0xd'));var Redis=require(_0x74cb('0xe'));var authService=require(_0x74cb('0xf'));var qs=require(_0x74cb('0x10'));var as=require(_0x74cb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x74cb('0x12'))(_0x74cb('0x13'));var utils=require(_0x74cb('0x14'));var config=require(_0x74cb('0x15'));var licenseUtil=require(_0x74cb('0x16'));var db=require(_0x74cb('0x17'))['db'];function respondWithStatusCode(_0x3923b7,_0x5e4537){_0x5e4537=_0x5e4537||0xcc;return function(_0x70948){if(_0x70948){return _0x3923b7[_0x74cb('0x18')](_0x5e4537);}return _0x3923b7[_0x74cb('0x19')](_0x5e4537)[_0x74cb('0x1a')]();};}function respondWithResult(_0x45ac35,_0x46c74c){_0x46c74c=_0x46c74c||0xc8;return function(_0x59819d){if(_0x59819d){return _0x45ac35[_0x74cb('0x19')](_0x46c74c)['json'](_0x59819d);}};}function respondWithFilteredResult(_0x28f3cb,_0x1166ef){return function(_0x48dfb5){if(_0x48dfb5){var _0x24a41b=typeof _0x1166ef[_0x74cb('0x1b')]===_0x74cb('0x1c')&&typeof _0x1166ef[_0x74cb('0x1d')]===_0x74cb('0x1c');var _0xfff46a=_0x48dfb5['count'];var _0x49f218=_0x24a41b?0x0:_0x1166ef[_0x74cb('0x1b')];var _0xcda100=_0x24a41b?_0x48dfb5[_0x74cb('0x1e')]:_0x1166ef['offset']+_0x1166ef['limit'];var _0x5d6db3;if(_0xcda100>=_0xfff46a){_0xcda100=_0xfff46a;_0x5d6db3=0xc8;}else{_0x5d6db3=0xce;}_0x28f3cb[_0x74cb('0x19')](_0x5d6db3);return _0x28f3cb[_0x74cb('0x1f')]('Content-Range',_0x49f218+'-'+_0xcda100+'/'+_0xfff46a)['json'](_0x48dfb5);}return null;};}function patchUpdates(_0x2a7ca3){return function(_0x52182c){try{jsonpatch[_0x74cb('0x20')](_0x52182c,_0x2a7ca3,!![]);}catch(_0x2d5919){return BPromise[_0x74cb('0x21')](_0x2d5919);}return _0x52182c['save']();};}function saveUpdates(_0x5cee86,_0x335c4f){return function(_0x20df1c){if(_0x20df1c){return _0x20df1c['update'](_0x5cee86)[_0x74cb('0x22')](function(_0x28bf56){return _0x28bf56;});}return null;};}function removeEntity(_0x5a9ec5,_0x57387c){return function(_0x1a6ea5){if(_0x1a6ea5){return _0x1a6ea5[_0x74cb('0x23')]()[_0x74cb('0x22')](function(){var _0x42ae32=_0x1a6ea5['get']({'plain':!![]});var _0x58701d=_0x74cb('0x24');return db[_0x74cb('0x25')][_0x74cb('0x23')]({'where':{'type':_0x58701d,'resourceId':_0x42ae32['id']}})['then'](function(){return _0x1a6ea5;});})['then'](function(){_0x5a9ec5[_0x74cb('0x19')](0xcc)[_0x74cb('0x1a')]();});}};}function handleEntityNotFound(_0x15239a,_0x5014ec){return function(_0x45a805){if(!_0x45a805){_0x15239a[_0x74cb('0x18')](0x194);}return _0x45a805;};}function handleError(_0x23f57e,_0x328eb9){_0x328eb9=_0x328eb9||0x1f4;return function(_0x23b1c0){logger[_0x74cb('0x26')](_0x23b1c0[_0x74cb('0x27')]);if(_0x23b1c0[_0x74cb('0x28')]){delete _0x23b1c0[_0x74cb('0x28')];}_0x23f57e['status'](_0x328eb9)[_0x74cb('0x29')](_0x23b1c0);};}exports[_0x74cb('0x2a')]=function(_0x316f10,_0x553f5c){var _0x1abf13={},_0x7fb5a3={},_0x48bbd4={'count':0x0,'rows':[]};var _0xacb366=_['map'](db[_0x74cb('0x2b')][_0x74cb('0x2c')],function(_0x5e90e0){return{'name':_0x5e90e0[_0x74cb('0x2d')],'type':_0x5e90e0['type']['key']};});_0x7fb5a3['model']=_[_0x74cb('0x2e')](_0xacb366,'name');_0x7fb5a3['query']=_[_0x74cb('0x2f')](_0x316f10['query']);_0x7fb5a3[_0x74cb('0x30')]=_[_0x74cb('0x31')](_0x7fb5a3[_0x74cb('0x32')],_0x7fb5a3[_0x74cb('0x33')]);_0x1abf13[_0x74cb('0x34')]=_['intersection'](_0x7fb5a3[_0x74cb('0x32')],qs[_0x74cb('0x35')](_0x316f10[_0x74cb('0x33')][_0x74cb('0x35')]));_0x1abf13[_0x74cb('0x34')]=_0x1abf13[_0x74cb('0x34')]['length']?_0x1abf13[_0x74cb('0x34')]:_0x7fb5a3[_0x74cb('0x32')];if(!_0x316f10[_0x74cb('0x33')][_0x74cb('0x36')](_0x74cb('0x37'))){_0x1abf13[_0x74cb('0x1d')]=qs[_0x74cb('0x1d')](_0x316f10[_0x74cb('0x33')]['limit']);_0x1abf13[_0x74cb('0x1b')]=qs[_0x74cb('0x1b')](_0x316f10['query'][_0x74cb('0x1b')]);}_0x1abf13[_0x74cb('0x38')]=qs['sort'](_0x316f10[_0x74cb('0x33')][_0x74cb('0x39')]);_0x1abf13[_0x74cb('0x3a')]=qs[_0x74cb('0x30')](_[_0x74cb('0x3b')](_0x316f10[_0x74cb('0x33')],_0x7fb5a3[_0x74cb('0x30')]),_0xacb366);if(_0x316f10[_0x74cb('0x33')][_0x74cb('0x3c')]){_0x1abf13[_0x74cb('0x3a')]=_[_0x74cb('0x3d')](_0x1abf13['where'],{'$or':_[_0x74cb('0x2e')](_0xacb366,function(_0x30f65b){if(_0x30f65b[_0x74cb('0x3e')]!==_0x74cb('0x3f')){var _0x1276b6={};_0x1276b6[_0x30f65b[_0x74cb('0x28')]]={'$like':'%'+_0x316f10['query'][_0x74cb('0x3c')]+'%'};return _0x1276b6;}})});}_0x1abf13=_[_0x74cb('0x3d')]({},_0x1abf13,_0x316f10[_0x74cb('0x40')]);var _0x5e0d3f={'where':_0x1abf13[_0x74cb('0x3a')]};return db[_0x74cb('0x2b')][_0x74cb('0x1e')](_0x5e0d3f)[_0x74cb('0x22')](function(_0x3c9423){_0x48bbd4[_0x74cb('0x1e')]=_0x3c9423;if(_0x316f10[_0x74cb('0x33')][_0x74cb('0x41')]){_0x1abf13[_0x74cb('0x42')]=[{'all':!![]}];}return db[_0x74cb('0x2b')]['findAll'](_0x1abf13);})[_0x74cb('0x22')](function(_0x1c5b08){_0x48bbd4[_0x74cb('0x43')]=_0x1c5b08;return _0x48bbd4;})['then'](respondWithFilteredResult(_0x553f5c,_0x1abf13))['catch'](handleError(_0x553f5c,null));};exports[_0x74cb('0x44')]=function(_0xac3d60,_0x315275){var _0x4a9cee={'raw':!![],'where':{'id':_0xac3d60[_0x74cb('0x45')]['id']}},_0x14b880={};_0x14b880[_0x74cb('0x32')]=_[_0x74cb('0x2f')](db[_0x74cb('0x2b')][_0x74cb('0x2c')]);_0x14b880['query']=_[_0x74cb('0x2f')](_0xac3d60[_0x74cb('0x33')]);_0x14b880[_0x74cb('0x30')]=_[_0x74cb('0x31')](_0x14b880[_0x74cb('0x32')],_0x14b880[_0x74cb('0x33')]);_0x4a9cee[_0x74cb('0x34')]=_['intersection'](_0x14b880['model'],qs['fields'](_0xac3d60[_0x74cb('0x33')][_0x74cb('0x35')]));_0x4a9cee[_0x74cb('0x34')]=_0x4a9cee['attributes']['length']?_0x4a9cee['attributes']:_0x14b880[_0x74cb('0x32')];if(_0xac3d60[_0x74cb('0x33')][_0x74cb('0x41')]){_0x4a9cee[_0x74cb('0x42')]=[{'all':!![]}];}_0x4a9cee=_[_0x74cb('0x3d')]({},_0x4a9cee,_0xac3d60[_0x74cb('0x40')]);return db[_0x74cb('0x2b')]['find'](_0x4a9cee)[_0x74cb('0x22')](handleEntityNotFound(_0x315275,null))['then'](respondWithResult(_0x315275,null))['catch'](handleError(_0x315275,null));};exports[_0x74cb('0x46')]=function(_0x217f95,_0x3fdcd9){return db[_0x74cb('0x2b')]['create'](_0x217f95[_0x74cb('0x47')],{})['then'](function(_0xcdbdf5){var _0x507088=_0x217f95['user']['get']({'plain':!![]});if(!_0x507088)throw new Error(_0x74cb('0x48'));if(_0x507088[_0x74cb('0x49')]===_0x74cb('0x4a')){var _0x5a0ea0=_0xcdbdf5[_0x74cb('0x4b')]({'plain':!![]});var _0x505c20=_0x74cb('0x24');return db['UserProfileSection'][_0x74cb('0x4c')]({'where':{'name':_0x505c20,'userProfileId':_0x507088[_0x74cb('0x4d')]},'raw':!![]})[_0x74cb('0x22')](function(_0x5c62c1){if(_0x5c62c1&&_0x5c62c1[_0x74cb('0x4e')]===0x0){return db[_0x74cb('0x25')]['create']({'name':_0x5a0ea0[_0x74cb('0x28')],'resourceId':_0x5a0ea0['id'],'type':_0x5c62c1[_0x74cb('0x28')],'sectionId':_0x5c62c1['id']},{})[_0x74cb('0x22')](function(){return _0xcdbdf5;});}else{return _0xcdbdf5;}})['catch'](function(_0x3c17b){logger[_0x74cb('0x26')](_0x74cb('0x4f'),_0x3c17b);throw _0x3c17b;});}return _0xcdbdf5;})[_0x74cb('0x22')](respondWithResult(_0x3fdcd9,0xc9))[_0x74cb('0x50')](handleError(_0x3fdcd9,null));};exports[_0x74cb('0x51')]=function(_0x5051a0,_0x49e69d){if(_0x5051a0[_0x74cb('0x47')]['id']){delete _0x5051a0[_0x74cb('0x47')]['id'];}return db[_0x74cb('0x2b')][_0x74cb('0x4c')]({'where':{'id':_0x5051a0['params']['id']}})[_0x74cb('0x22')](handleEntityNotFound(_0x49e69d,null))[_0x74cb('0x22')](saveUpdates(_0x5051a0[_0x74cb('0x47')],null))[_0x74cb('0x22')](respondWithResult(_0x49e69d,null))[_0x74cb('0x50')](handleError(_0x49e69d,null));};exports['destroy']=function(_0x4f3d86,_0xca0ccc){return db[_0x74cb('0x2b')]['find']({'where':{'id':_0x4f3d86[_0x74cb('0x45')]['id']}})['then'](handleEntityNotFound(_0xca0ccc,null))[_0x74cb('0x22')](removeEntity(_0xca0ccc,null))[_0x74cb('0x50')](handleError(_0xca0ccc,null));};
\ No newline at end of file
index b443898..41765a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30a9=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x30a9,0x82));var _0x930a=function(_0x2ff176,_0xf8c5f6){_0x2ff176=_0x2ff176-0x0;var _0x3d4238=_0x30a9[_0x2ff176];return _0x3d4238;};'use strict';var _=require('lodash');var util=require(_0x930a('0x0'));var logger=require(_0x930a('0x1'))(_0x930a('0x2'));var moment=require(_0x930a('0x3'));var BPromise=require(_0x930a('0x4'));var rp=require(_0x930a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x930a('0x6'));var config=require(_0x930a('0x7'));var attributes=require(_0x930a('0x8'));module[_0x930a('0x9')]=function(_0x3550fd,_0x194971){return _0x3550fd[_0x930a('0xa')](_0x930a('0xb'),attributes,{'tableName':_0x930a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5872=['./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x4e4f0e,_0x1c3892){var _0x1a7219=function(_0x3821ad){while(--_0x3821ad){_0x4e4f0e['push'](_0x4e4f0e['shift']());}};_0x1a7219(++_0x1c3892);}(_0x5872,0x18b));var _0x2587=function(_0x29e3ec,_0x138a18){_0x29e3ec=_0x29e3ec-0x0;var _0x25727e=_0x5872[_0x29e3ec];return _0x25727e;};'use strict';var _=require(_0x2587('0x0'));var util=require(_0x2587('0x1'));var logger=require(_0x2587('0x2'))(_0x2587('0x3'));var moment=require(_0x2587('0x4'));var BPromise=require('bluebird');var rp=require(_0x2587('0x5'));var fs=require('fs');var path=require(_0x2587('0x6'));var rimraf=require(_0x2587('0x7'));var config=require('../../config/environment');var attributes=require(_0x2587('0x8'));module[_0x2587('0x9')]=function(_0x5748c0,_0x1cadc4){return _0x5748c0[_0x2587('0xa')](_0x2587('0xb'),attributes,{'tableName':_0x2587('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 867810a..bb4a7bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x612a=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','entity','dialGlobalMaxRetry','countnoanswerretry','countmachineretry','countagentrejectretry','duration','isNil','scheduledat','add','minutes','createdAt','updatedAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash'];(function(_0x290201,_0x279632){var _0x3d5c08=function(_0x3d0f41){while(--_0x3d0f41){_0x290201['push'](_0x290201['shift']());}};_0x3d5c08(++_0x279632);}(_0x612a,0x1c7));var _0xa612=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0x612a[_0x16771d];return _0x386f11;};'use strict';var _=require(_0xa612('0x0'));var util=require(_0xa612('0x1'));var moment=require(_0xa612('0x2'));var BPromise=require(_0xa612('0x3'));var rs=require(_0xa612('0x4'));var fs=require('fs');var Redis=require(_0xa612('0x5'));var db=require(_0xa612('0x6'))['db'];var utils=require(_0xa612('0x7'));var logger=require('../../config/logger')(_0xa612('0x8'));var config=require(_0xa612('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa612('0xa')][_0xa612('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1dae12,_0xbe07ae,_0x33489a){return new BPromise(function(_0x29e69b,_0x3990f1){return client['request'](_0x1dae12,_0x33489a)[_0xa612('0xc')](function(_0x160cf1){logger['info'](_0xa612('0xd'),_0xbe07ae,_0xa612('0xe'));logger[_0xa612('0xf')](_0xa612('0x10'),_0xbe07ae,_0xa612('0xe'),JSON[_0xa612('0x11')](_0x160cf1));if(_0x160cf1[_0xa612('0x12')]){if(_0x160cf1[_0xa612('0x12')]['code']===0x1f4){logger[_0xa612('0x12')](_0xa612('0xd'),_0xbe07ae,_0x160cf1[_0xa612('0x12')][_0xa612('0x13')]);return _0x3990f1(_0x160cf1['error'][_0xa612('0x13')]);}logger[_0xa612('0x12')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0xbe07ae,_0x160cf1['error'][_0xa612('0x13')]);return _0x29e69b(_0x160cf1[_0xa612('0x12')][_0xa612('0x13')]);}else{logger[_0xa612('0x14')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0xbe07ae,_0xa612('0xe'));_0x29e69b(_0x160cf1[_0xa612('0x15')][_0xa612('0x13')]);}})[_0xa612('0x16')](function(_0x4e9ef5){logger[_0xa612('0x12')](_0xa612('0xd'),_0xbe07ae,_0x4e9ef5);_0x3990f1(_0x4e9ef5);});});}exports[_0xa612('0x17')]=function(_0xbb8763){var _0x297622=this;return new Promise(function(_0x110bdb,_0x46f329){return db[_0xa612('0x18')][_0xa612('0x19')]({'raw':!![],'where':{'ContactId':_0xbb8763[_0xa612('0x1a')][_0xa612('0x1b')],'ListId':_0xbb8763['body'][_0xa612('0x1c')],'VoiceQueueId':_0xbb8763[_0xa612('0x1a')]['VoiceQueueId']===undefined?null:_0xbb8763[_0xa612('0x1a')][_0xa612('0x1d')],'CampaignId':_0xbb8763[_0xa612('0x1a')][_0xa612('0x1e')]===undefined?null:_0xbb8763['body'][_0xa612('0x1e')]}})['then'](function(_0x5ce5c9){if(_0x5ce5c9!=null){return db[_0xa612('0x1f')][_0xa612('0x19')]({'raw':!![],'where':{'CmHopperId':_0x5ce5c9['id'],'OrderBy':{'$gt':_0x5ce5c9[_0xa612('0x20')]}},'order':[[_0xa612('0x20'),_0xa612('0x21')]]})['then'](function(_0x2714f5){var _0x58d66f=0x0;if(_0x2714f5){if(_0x2714f5[_0xa612('0x22')]+_0x2714f5[_0xa612('0x23')]+_0x2714f5['countnoanswerretry']+_0x2714f5[_0xa612('0x24')]+_0x2714f5[_0xa612('0x25')]+_0x2714f5[_0xa612('0x26')]+_0x2714f5['countmachineretry']+_0x2714f5['countagentrejectretry']<_0xbb8763[_0xa612('0x27')][_0xa612('0x28')])_0x58d66f=0x1;_0x110bdb({'additional':_0x58d66f});}else{return db['CmHopperAdditionalPhone'][_0xa612('0x19')]({'raw':!![],'where':{'CmHopperId':_0x5ce5c9['id']},'order':[[_0xa612('0x20'),_0xa612('0x21')]]})[_0xa612('0xc')](function(_0x14e9e9){var _0x34f1af=0x0;if(_0x14e9e9){if(_0x14e9e9['countbusyretry']+_0x14e9e9[_0xa612('0x23')]+_0x14e9e9[_0xa612('0x29')]+_0x14e9e9[_0xa612('0x24')]+_0x14e9e9[_0xa612('0x25')]+_0x14e9e9[_0xa612('0x26')]+_0x14e9e9[_0xa612('0x2a')]+_0x14e9e9[_0xa612('0x2b')]<_0xbb8763[_0xa612('0x27')]['dialGlobalMaxRetry'])_0x34f1af=0x1;_0x110bdb({'additional':_0x34f1af});}else{_0x110bdb({'additional':0x0});}})['catch'](function(_0x6856ad){logger[_0xa612('0x12')](_0xa612('0x17'),_0x6856ad[_0xa612('0x13')]);_0x46f329(_0x297622['error'](0x1f4,_0x6856ad[_0xa612('0x13')]));});}})[_0xa612('0x16')](function(_0x1c9f2d){logger[_0xa612('0x12')](_0xa612('0x17'),_0x1c9f2d[_0xa612('0x13')]);_0x46f329(_0x297622['error'](0x1f4,_0x1c9f2d['message']));});}else _0x110bdb({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x41b0ec){var _0x25a044=this;return new Promise(function(_0x2764aa,_0x3a77e4){return db[_0xa612('0x18')][_0xa612('0x19')]({'raw':!![],'where':{'ContactId':_0x41b0ec[_0xa612('0x1a')][_0xa612('0x1b')],'ListId':_0x41b0ec[_0xa612('0x1a')][_0xa612('0x1c')],'VoiceQueueId':_0x41b0ec['body']['VoiceQueueId']===undefined?null:_0x41b0ec[_0xa612('0x1a')][_0xa612('0x1d')],'CampaignId':_0x41b0ec[_0xa612('0x1a')][_0xa612('0x1e')]===undefined?null:_0x41b0ec[_0xa612('0x1a')][_0xa612('0x1e')]}})[_0xa612('0xc')](function(_0x1c8eac){if(_0x1c8eac!=null){return db[_0xa612('0x1f')][_0xa612('0x19')]({'raw':!![],'where':{'CmHopperId':_0x1c8eac['id'],'OrderBy':{'$gte':_0x1c8eac['OrderBy']}},'order':[[_0xa612('0x20'),_0xa612('0x21')]]})['then'](function(_0x2a25ed){if(_0x2a25ed)return activateAdditionalPhone(_0x1c8eac,_0x41b0ec[_0xa612('0x1a')],_0x2a25ed,_0x41b0ec['duration'],_0x41b0ec['waitTime'])[_0xa612('0xc')](function(_0x261373){_0x2764aa(_0x261373);});else{return db[_0xa612('0x1f')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x1c8eac['id']},'order':[[_0xa612('0x20'),_0xa612('0x21')]]})[_0xa612('0xc')](function(_0x395224){if(_0x395224)return activateAdditionalPhone(_0x1c8eac,_0x41b0ec['body'],_0x395224,_0x41b0ec[_0xa612('0x2c')],_0x41b0ec['waitTime'])['then'](function(_0x3b216d){_0x2764aa(_0x3b216d);});else{_0x2764aa({'id':_0x1c8eac['id'],'phone':''});}})['catch'](function(_0x31f1a8){logger[_0xa612('0x12')](_0xa612('0x17'),_0x31f1a8['message']);_0x3a77e4(_0x25a044['error'](0x1f4,_0x31f1a8[_0xa612('0x13')]));});}})['catch'](function(_0x2b69e5){logger[_0xa612('0x12')](_0xa612('0x17'),_0x2b69e5[_0xa612('0x13')]);_0x3a77e4(_0x25a044[_0xa612('0x12')](0x1f4,_0x2b69e5[_0xa612('0x13')]));});}else _0x2764aa(0x1);});});};function activateAdditionalPhone(_0x10af81,_0x39abcd,_0x9877da,_0x5e9df9,_0x24675d){return new Promise(function(_0x10ea32,_0x1653b1){var _0x237e81;if(_[_0xa612('0x2d')](_0x9877da[_0xa612('0x2e')])){_0x9877da[_0xa612('0x2e')]=moment();}if(moment()>moment(_0x9877da['scheduledat'])){_0x237e81=moment()[_0xa612('0x2f')](_0x24675d||0x3,_0xa612('0x30'));}else{if(_0x9877da[_0xa612('0x20')]==0x0){_0x237e81=moment(_0x9877da['scheduledat']);}else{_0x237e81=moment()[_0xa612('0x2f')](_0x24675d||0x3,_0xa612('0x30'));}}if(_[_0xa612('0x2d')](_0x237e81)){_0x237e81=moment()[_0xa612('0x2f')](_0x24675d||0x3,'minutes');}var _0x530dc6={'phone':_0x10af81['phone'],'active':0x0,'OrderBy':_['isNil'](_0x10af81[_0xa612('0x20')])?0x0:_0x10af81[_0xa612('0x20')],'scheduledat':moment()[_0xa612('0x2f')](_0x5e9df9||0x1,'minutes'),'countbusyretry':_0x39abcd['countbusyretry'],'countcongestionretry':_0x39abcd[_0xa612('0x23')],'countnoanswerretry':_0x39abcd['countnoanswerretry'],'countnosuchnumberretry':_0x39abcd[_0xa612('0x24')],'countdropretry':_0x39abcd[_0xa612('0x25')],'countabandonedretry':_0x39abcd[_0xa612('0x26')],'countmachineretry':_0x39abcd[_0xa612('0x2a')],'countagentrejectretry':_0x39abcd[_0xa612('0x2b')],'createdAt':_0x39abcd[_0xa612('0x31')],'updatedAt':_0x39abcd[_0xa612('0x32')]};var _0x1d6352={'CmHopperId':_0x10af81['id'],'phone':_0x9877da['phone'],'active':0x0,'OrderBy':_[_0xa612('0x2d')](_0x9877da[_0xa612('0x20')])?0x0:_0x9877da[_0xa612('0x20')],'scheduledat':_0x237e81,'countbusyretry':_0x9877da[_0xa612('0x22')],'countcongestionretry':_0x9877da[_0xa612('0x23')],'countnoanswerretry':_0x9877da['countnoanswerretry'],'countnosuchnumberretry':_0x9877da[_0xa612('0x24')],'countdropretry':_0x9877da[_0xa612('0x25')],'countabandonedretry':_0x9877da[_0xa612('0x26')],'countmachineretry':_0x9877da[_0xa612('0x2a')],'countagentrejectretry':_0x9877da[_0xa612('0x2b')],'createdAt':_0x9877da[_0xa612('0x31')],'updatedAt':_0x9877da[_0xa612('0x32')]};return db[_0xa612('0x33')][_0xa612('0x34')](function(_0x34d229){return db[_0xa612('0x1f')][_0xa612('0x35')](_0x530dc6,{'where':{'id':_0x9877da['id']}},{'transaction':_0x34d229})[_0xa612('0xc')](function(){return db[_0xa612('0x18')]['update'](_0x1d6352,{'where':{'id':_0x10af81['id']}},{'transaction':_0x34d229});});})[_0xa612('0xc')](function(_0x4dff7d){_0x10ea32({'id':_0x10af81['id'],'phone':_0x9877da['phone']});})[_0xa612('0x16')](function(_0x231a2a){logger[_0xa612('0x12')](_0xa612('0x36'),_0x231a2a['message']);_0x1653b1({'error':_0x231a2a['message']});});});}exports[_0xa612('0x37')]=function(_0x4766f6){var _0xc8aa91=this;return new Promise(function(_0x1afec6,_0x31ca32){return db[_0xa612('0x18')][_0xa612('0x35')](_0x4766f6[_0xa612('0x1a')][_0xa612('0x38')],{'where':{'id':_0x4766f6[_0xa612('0x1a')]['id']}})[_0xa612('0xc')](function(_0x78f9a){_0x1afec6(_0x78f9a);})[_0xa612('0x16')](function(_0x5bd687){logger[_0xa612('0x12')](_0xa612('0x37'),_0x5bd687[_0xa612('0x13')]);_0x31ca32(_0xc8aa91[_0xa612('0x12')](0x1f4,_0x5bd687[_0xa612('0x13')]));});});};
\ No newline at end of file
+var _0xb0bc=['isNil','createdAt','updatedAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','CmHopper','field','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','VerifyAdditionalPhones','findOne','body','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','dialGlobalMaxRetry','countbusyretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','ContactId','ListId','duration','waitTime','scheduledat','minutes','phone'];(function(_0x369914,_0x2fc49d){var _0x520e45=function(_0x336857){while(--_0x336857){_0x369914['push'](_0x369914['shift']());}};_0x520e45(++_0x2fc49d);}(_0xb0bc,0xf2));var _0xcb0b=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xb0bc[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xcb0b('0x0'));var util=require(_0xcb0b('0x1'));var moment=require(_0xcb0b('0x2'));var BPromise=require(_0xcb0b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb0b('0x4'));var db=require(_0xcb0b('0x5'))['db'];var utils=require(_0xcb0b('0x6'));var logger=require(_0xcb0b('0x7'))(_0xcb0b('0x8'));var config=require(_0xcb0b('0x9'));var jayson=require(_0xcb0b('0xa'));var client=jayson[_0xcb0b('0xb')][_0xcb0b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x259d8b,_0x386d72,_0x271c9f){return new BPromise(function(_0x655787,_0x27fcc6){return client[_0xcb0b('0xd')](_0x259d8b,_0x271c9f)[_0xcb0b('0xe')](function(_0x923f2c){logger[_0xcb0b('0xf')](_0xcb0b('0x10'),_0x386d72,_0xcb0b('0x11'));logger['debug'](_0xcb0b('0x12'),_0x386d72,_0xcb0b('0x11'),JSON['stringify'](_0x923f2c));if(_0x923f2c[_0xcb0b('0x13')]){if(_0x923f2c[_0xcb0b('0x13')][_0xcb0b('0x14')]===0x1f4){logger[_0xcb0b('0x13')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x386d72,_0x923f2c[_0xcb0b('0x13')]['message']);return _0x27fcc6(_0x923f2c['error'][_0xcb0b('0x15')]);}logger[_0xcb0b('0x13')](_0xcb0b('0x10'),_0x386d72,_0x923f2c[_0xcb0b('0x13')][_0xcb0b('0x15')]);return _0x655787(_0x923f2c['error'][_0xcb0b('0x15')]);}else{logger[_0xcb0b('0xf')](_0xcb0b('0x10'),_0x386d72,_0xcb0b('0x11'));_0x655787(_0x923f2c[_0xcb0b('0x16')]['message']);}})[_0xcb0b('0x17')](function(_0x44bab8){logger[_0xcb0b('0x13')](_0xcb0b('0x10'),_0x386d72,_0x44bab8);_0x27fcc6(_0x44bab8);});});}exports[_0xcb0b('0x18')]=function(_0x2936b8){var _0x38e321=this;return new Promise(function(_0x5304b9,_0x122314){return db['CmHopper'][_0xcb0b('0x19')]({'raw':!![],'where':{'ContactId':_0x2936b8['body']['ContactId'],'ListId':_0x2936b8[_0xcb0b('0x1a')]['ListId'],'VoiceQueueId':_0x2936b8[_0xcb0b('0x1a')][_0xcb0b('0x1b')]===undefined?null:_0x2936b8['body']['VoiceQueueId'],'CampaignId':_0x2936b8[_0xcb0b('0x1a')][_0xcb0b('0x1c')]===undefined?null:_0x2936b8['body'][_0xcb0b('0x1c')]}})['then'](function(_0x14b66d){if(_0x14b66d!=null){return db[_0xcb0b('0x1d')][_0xcb0b('0x19')]({'raw':!![],'where':{'CmHopperId':_0x14b66d['id'],'OrderBy':{'$gt':_0x14b66d['OrderBy']}},'order':[[_0xcb0b('0x1e'),_0xcb0b('0x1f')]]})[_0xcb0b('0xe')](function(_0x4bbe14){var _0x44c9fb=0x0;if(_0x4bbe14){if(_0x4bbe14['countbusyretry']+_0x4bbe14[_0xcb0b('0x20')]+_0x4bbe14[_0xcb0b('0x21')]+_0x4bbe14['countnosuchnumberretry']+_0x4bbe14[_0xcb0b('0x22')]+_0x4bbe14[_0xcb0b('0x23')]+_0x4bbe14['countmachineretry']+_0x4bbe14['countagentrejectretry']<_0x2936b8['entity'][_0xcb0b('0x24')])_0x44c9fb=0x1;_0x5304b9({'additional':_0x44c9fb});}else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x14b66d['id']},'order':[[_0xcb0b('0x1e'),'ASC']]})[_0xcb0b('0xe')](function(_0x297886){var _0x5800d0=0x0;if(_0x297886){if(_0x297886[_0xcb0b('0x25')]+_0x297886[_0xcb0b('0x20')]+_0x297886[_0xcb0b('0x21')]+_0x297886[_0xcb0b('0x26')]+_0x297886['countdropretry']+_0x297886[_0xcb0b('0x23')]+_0x297886[_0xcb0b('0x27')]+_0x297886[_0xcb0b('0x28')]<_0x2936b8['entity']['dialGlobalMaxRetry'])_0x5800d0=0x1;_0x5304b9({'additional':_0x5800d0});}else{_0x5304b9({'additional':0x0});}})[_0xcb0b('0x17')](function(_0x1b4d61){logger[_0xcb0b('0x13')]('VerifyAdditionalPhones',_0x1b4d61[_0xcb0b('0x15')]);_0x122314(_0x38e321[_0xcb0b('0x13')](0x1f4,_0x1b4d61[_0xcb0b('0x15')]));});}})[_0xcb0b('0x17')](function(_0x3bdf8b){logger[_0xcb0b('0x13')](_0xcb0b('0x18'),_0x3bdf8b[_0xcb0b('0x15')]);_0x122314(_0x38e321[_0xcb0b('0x13')](0x1f4,_0x3bdf8b['message']));});}else _0x5304b9({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x162b29){var _0x3b49a7=this;return new Promise(function(_0x212a98,_0x4cdcd9){return db['CmHopper'][_0xcb0b('0x19')]({'raw':!![],'where':{'ContactId':_0x162b29[_0xcb0b('0x1a')][_0xcb0b('0x29')],'ListId':_0x162b29[_0xcb0b('0x1a')][_0xcb0b('0x2a')],'VoiceQueueId':_0x162b29[_0xcb0b('0x1a')][_0xcb0b('0x1b')]===undefined?null:_0x162b29[_0xcb0b('0x1a')][_0xcb0b('0x1b')],'CampaignId':_0x162b29[_0xcb0b('0x1a')]['CampaignId']===undefined?null:_0x162b29[_0xcb0b('0x1a')][_0xcb0b('0x1c')]}})['then'](function(_0x12a782){if(_0x12a782!=null){return db[_0xcb0b('0x1d')][_0xcb0b('0x19')]({'raw':!![],'where':{'CmHopperId':_0x12a782['id'],'OrderBy':{'$gte':_0x12a782[_0xcb0b('0x1e')]}},'order':[[_0xcb0b('0x1e'),_0xcb0b('0x1f')]]})[_0xcb0b('0xe')](function(_0x44c937){if(_0x44c937)return activateAdditionalPhone(_0x12a782,_0x162b29[_0xcb0b('0x1a')],_0x44c937,_0x162b29[_0xcb0b('0x2b')],_0x162b29[_0xcb0b('0x2c')])[_0xcb0b('0xe')](function(_0x48c83d){_0x212a98(_0x48c83d);});else{return db[_0xcb0b('0x1d')][_0xcb0b('0x19')]({'raw':!![],'where':{'CmHopperId':_0x12a782['id']},'order':[[_0xcb0b('0x1e'),_0xcb0b('0x1f')]]})[_0xcb0b('0xe')](function(_0x3a61c1){if(_0x3a61c1)return activateAdditionalPhone(_0x12a782,_0x162b29['body'],_0x3a61c1,_0x162b29[_0xcb0b('0x2b')],_0x162b29[_0xcb0b('0x2c')])[_0xcb0b('0xe')](function(_0xebcada){_0x212a98(_0xebcada);});else{_0x212a98({'id':_0x12a782['id'],'phone':''});}})[_0xcb0b('0x17')](function(_0x451bb8){logger[_0xcb0b('0x13')](_0xcb0b('0x18'),_0x451bb8[_0xcb0b('0x15')]);_0x4cdcd9(_0x3b49a7[_0xcb0b('0x13')](0x1f4,_0x451bb8['message']));});}})[_0xcb0b('0x17')](function(_0x54bcb3){logger[_0xcb0b('0x13')](_0xcb0b('0x18'),_0x54bcb3[_0xcb0b('0x15')]);_0x4cdcd9(_0x3b49a7[_0xcb0b('0x13')](0x1f4,_0x54bcb3['message']));});}else _0x212a98(0x1);});});};function activateAdditionalPhone(_0x10f669,_0x457884,_0x5a2cff,_0xcea53d,_0x1aa39e){return new Promise(function(_0x1b95b9,_0x57ad8f){var _0x139f0a;if(_['isNil'](_0x5a2cff[_0xcb0b('0x2d')])){_0x5a2cff['scheduledat']=moment();}if(moment()>moment(_0x5a2cff[_0xcb0b('0x2d')])){_0x139f0a=moment()['add'](_0x1aa39e||0x3,_0xcb0b('0x2e'));}else{if(_0x5a2cff['OrderBy']==0x0){_0x139f0a=moment(_0x5a2cff['scheduledat']);}else{_0x139f0a=moment()['add'](_0x1aa39e||0x3,_0xcb0b('0x2e'));}}if(_['isNil'](_0x139f0a)){_0x139f0a=moment()['add'](_0x1aa39e||0x3,_0xcb0b('0x2e'));}var _0x49cf4a={'phone':_0x10f669[_0xcb0b('0x2f')],'active':0x0,'OrderBy':_[_0xcb0b('0x30')](_0x10f669['OrderBy'])?0x0:_0x10f669[_0xcb0b('0x1e')],'scheduledat':moment()['add'](_0xcea53d||0x1,_0xcb0b('0x2e')),'countbusyretry':_0x457884[_0xcb0b('0x25')],'countcongestionretry':_0x457884[_0xcb0b('0x20')],'countnoanswerretry':_0x457884[_0xcb0b('0x21')],'countnosuchnumberretry':_0x457884[_0xcb0b('0x26')],'countdropretry':_0x457884['countdropretry'],'countabandonedretry':_0x457884[_0xcb0b('0x23')],'countmachineretry':_0x457884['countmachineretry'],'countagentrejectretry':_0x457884[_0xcb0b('0x28')],'createdAt':_0x457884[_0xcb0b('0x31')],'updatedAt':_0x457884[_0xcb0b('0x32')]};var _0x2e4c71={'CmHopperId':_0x10f669['id'],'phone':_0x5a2cff[_0xcb0b('0x2f')],'active':0x0,'OrderBy':_[_0xcb0b('0x30')](_0x5a2cff[_0xcb0b('0x1e')])?0x0:_0x5a2cff[_0xcb0b('0x1e')],'scheduledat':_0x139f0a,'countbusyretry':_0x5a2cff[_0xcb0b('0x25')],'countcongestionretry':_0x5a2cff[_0xcb0b('0x20')],'countnoanswerretry':_0x5a2cff[_0xcb0b('0x21')],'countnosuchnumberretry':_0x5a2cff[_0xcb0b('0x26')],'countdropretry':_0x5a2cff['countdropretry'],'countabandonedretry':_0x5a2cff['countabandonedretry'],'countmachineretry':_0x5a2cff[_0xcb0b('0x27')],'countagentrejectretry':_0x5a2cff[_0xcb0b('0x28')],'createdAt':_0x5a2cff['createdAt'],'updatedAt':_0x5a2cff[_0xcb0b('0x32')]};return db[_0xcb0b('0x33')][_0xcb0b('0x34')](function(_0x1010f9){return db[_0xcb0b('0x1d')][_0xcb0b('0x35')](_0x49cf4a,{'where':{'id':_0x5a2cff['id']}},{'transaction':_0x1010f9})['then'](function(){return db['CmHopper'][_0xcb0b('0x35')](_0x2e4c71,{'where':{'id':_0x10f669['id']}},{'transaction':_0x1010f9});});})['then'](function(_0x515fcf){_0x1b95b9({'id':_0x10f669['id'],'phone':_0x5a2cff[_0xcb0b('0x2f')]});})[_0xcb0b('0x17')](function(_0x45379a){logger[_0xcb0b('0x13')](_0xcb0b('0x36'),_0x45379a[_0xcb0b('0x15')]);_0x57ad8f({'error':_0x45379a[_0xcb0b('0x15')]});});});}exports[_0xcb0b('0x37')]=function(_0x4f782d){var _0x4f58f2=this;return new Promise(function(_0x135cb2,_0x4cf8f7){return db[_0xcb0b('0x38')][_0xcb0b('0x35')](_0x4f782d['body'][_0xcb0b('0x39')],{'where':{'id':_0x4f782d[_0xcb0b('0x1a')]['id']}})[_0xcb0b('0xe')](function(_0x164bbf){_0x135cb2(_0x164bbf);})['catch'](function(_0x3fa65b){logger[_0xcb0b('0x13')](_0xcb0b('0x37'),_0x3fa65b[_0xcb0b('0x15')]);_0x4cf8f7(_0x4f58f2[_0xcb0b('0x13')](0x1f4,_0x3fa65b['message']));});});};
\ No newline at end of file
index 84561e6..4b21cb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a9a=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','/:id','isAuthenticated','create','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x545cf2,_0x1c099e){var _0x1f1462=function(_0x11149d){while(--_0x11149d){_0x545cf2['push'](_0x545cf2['shift']());}};_0x1f1462(++_0x1c099e);}(_0x5a9a,0x1ac));var _0xa5a9=function(_0x42780f,_0x536fc9){_0x42780f=_0x42780f-0x0;var _0x4d7441=_0x5a9a[_0x42780f];return _0x4d7441;};'use strict';var multer=require(_0xa5a9('0x0'));var util=require(_0xa5a9('0x1'));var path=require(_0xa5a9('0x2'));var timeout=require(_0xa5a9('0x3'));var express=require(_0xa5a9('0x4'));var router=express['Router']();var fs_extra=require(_0xa5a9('0x5'));var auth=require(_0xa5a9('0x6'));var interaction=require(_0xa5a9('0x7'));var config=require(_0xa5a9('0x8'));var controller=require(_0xa5a9('0x9'));router[_0xa5a9('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa5a9('0xa')](_0xa5a9('0xb'),auth[_0xa5a9('0xc')](),controller['show']);router['post']('/',auth[_0xa5a9('0xc')](),controller[_0xa5a9('0xd')]);router[_0xa5a9('0xe')](_0xa5a9('0xb'),auth[_0xa5a9('0xc')](),controller['update']);router[_0xa5a9('0xf')](_0xa5a9('0xb'),auth['isAuthenticated'](),controller[_0xa5a9('0x10')]);module[_0xa5a9('0x11')]=router;
\ No newline at end of file
+var _0x0a97=['create','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','isAuthenticated','show','post'];(function(_0x2c704b,_0x201467){var _0x4d62cf=function(_0x20d18f){while(--_0x20d18f){_0x2c704b['push'](_0x2c704b['shift']());}};_0x4d62cf(++_0x201467);}(_0x0a97,0x1a7));var _0x70a9=function(_0x2abc3d,_0x48edca){_0x2abc3d=_0x2abc3d-0x0;var _0x252745=_0x0a97[_0x2abc3d];return _0x252745;};'use strict';var multer=require(_0x70a9('0x0'));var util=require(_0x70a9('0x1'));var path=require(_0x70a9('0x2'));var timeout=require(_0x70a9('0x3'));var express=require(_0x70a9('0x4'));var router=express[_0x70a9('0x5')]();var fs_extra=require(_0x70a9('0x6'));var auth=require(_0x70a9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x70a9('0x8'));var controller=require('./cmHopperAdditionalPhone.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x70a9('0x9')]);router[_0x70a9('0xa')]('/:id',auth[_0x70a9('0xb')](),controller[_0x70a9('0xc')]);router[_0x70a9('0xd')]('/',auth[_0x70a9('0xb')](),controller[_0x70a9('0xe')]);router[_0x70a9('0xf')](_0x70a9('0x10'),auth[_0x70a9('0xb')](),controller['update']);router[_0x70a9('0x11')](_0x70a9('0x10'),auth[_0x70a9('0xb')](),controller[_0x70a9('0x12')]);module['exports']=router;
\ No newline at end of file
index c1c5183..25c805c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757c=['contactListQueue','moment','sequelize','STRING','INTEGER'];(function(_0x3d1996,_0x1f08f0){var _0x550afd=function(_0xb3b511){while(--_0xb3b511){_0x3d1996['push'](_0x3d1996['shift']());}};_0x550afd(++_0x1f08f0);}(_0x757c,0xc9));var _0xc757=function(_0x9b49d8,_0xb6865e){_0x9b49d8=_0x9b49d8-0x0;var _0x160a9a=_0x757c[_0x9b49d8];return _0x160a9a;};'use strict';var moment=require(_0xc757('0x0'));var Sequelize=require(_0xc757('0x1'));module['exports']={'phone':{'type':Sequelize[_0xc757('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xc757('0x3')],'unique':_0xc757('0x4')},'ListId':{'type':Sequelize[_0xc757('0x3')],'unique':_0xc757('0x4')},'VoiceQueueId':{'type':Sequelize[_0xc757('0x3')],'unique':_0xc757('0x4')}};
\ No newline at end of file
+var _0xa751=['INTEGER','moment','sequelize','exports','STRING','contactListQueue'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa751,0x175));var _0x1a75=function(_0x2e10d4,_0x48c242){_0x2e10d4=_0x2e10d4-0x0;var _0x5c6e3b=_0xa751[_0x2e10d4];return _0x5c6e3b;};'use strict';var moment=require(_0x1a75('0x0'));var Sequelize=require(_0x1a75('0x1'));module[_0x1a75('0x2')]={'phone':{'type':Sequelize[_0x1a75('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x1a75('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x1a75('0x4')},'VoiceQueueId':{'type':Sequelize[_0x1a75('0x5')],'unique':_0x1a75('0x4')}};
\ No newline at end of file
index 9d5f0c2..7f7d169 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46ef=['model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','body','describe','eml-format','fast-json-patch','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','CmHopperBlack','rawAttributes','key','query','keys','filters','intersection'];(function(_0x5b56d7,_0x169cb6){var _0x20e2bb=function(_0x387e5c){while(--_0x387e5c){_0x5b56d7['push'](_0x5b56d7['shift']());}};_0x20e2bb(++_0x169cb6);}(_0x46ef,0xaa));var _0xf46e=function(_0x148eac,_0x1ace09){_0x148eac=_0x148eac-0x0;var _0x7eac7c=_0x46ef[_0x148eac];return _0x7eac7c;};'use strict';var emlformat=require(_0xf46e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf46e('0x1'));var rp=require('request-promise');var moment=require(_0xf46e('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf46e('0x3'));var path=require(_0xf46e('0x4'));var sox=require(_0xf46e('0x5'));var csv=require(_0xf46e('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf46e('0x7'));var _=require(_0xf46e('0x8'));var squel=require(_0xf46e('0x9'));var crypto=require(_0xf46e('0xa'));var jsforce=require(_0xf46e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf46e('0x6'));var querystring=require(_0xf46e('0xc'));var Papa=require(_0xf46e('0xd'));var Redis=require(_0xf46e('0xe'));var authService=require(_0xf46e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf46e('0x10'));var hardwareService=require(_0xf46e('0x11'));var logger=require('../../config/logger')(_0xf46e('0x12'));var utils=require(_0xf46e('0x13'));var config=require(_0xf46e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf46e('0x15'))['db'];function respondWithStatusCode(_0x211804,_0x30ee06){_0x30ee06=_0x30ee06||0xcc;return function(_0x3a52a1){if(_0x3a52a1){return _0x211804[_0xf46e('0x16')](_0x30ee06);}return _0x211804[_0xf46e('0x17')](_0x30ee06)[_0xf46e('0x18')]();};}function respondWithResult(_0x29036a,_0x2c6405){_0x2c6405=_0x2c6405||0xc8;return function(_0x3f5cbd){if(_0x3f5cbd){return _0x29036a[_0xf46e('0x17')](_0x2c6405)[_0xf46e('0x19')](_0x3f5cbd);}};}function respondWithFilteredResult(_0x407df3,_0x5149ea){return function(_0x1e7e9f){if(_0x1e7e9f){var _0x18ce96=typeof _0x5149ea[_0xf46e('0x1a')]===_0xf46e('0x1b')&&typeof _0x5149ea[_0xf46e('0x1c')]===_0xf46e('0x1b');var _0x5675d5=_0x1e7e9f[_0xf46e('0x1d')];var _0x2df5f8=_0x18ce96?0x0:_0x5149ea[_0xf46e('0x1a')];var _0x3fd6b0=_0x18ce96?_0x1e7e9f[_0xf46e('0x1d')]:_0x5149ea[_0xf46e('0x1a')]+_0x5149ea[_0xf46e('0x1c')];var _0x4fbc2c;if(_0x3fd6b0>=_0x5675d5){_0x3fd6b0=_0x5675d5;_0x4fbc2c=0xc8;}else{_0x4fbc2c=0xce;}_0x407df3[_0xf46e('0x17')](_0x4fbc2c);return _0x407df3[_0xf46e('0x1e')](_0xf46e('0x1f'),_0x2df5f8+'-'+_0x3fd6b0+'/'+_0x5675d5)[_0xf46e('0x19')](_0x1e7e9f);}return null;};}function patchUpdates(_0x4ca2e4){return function(_0x4660e4){try{jsonpatch['apply'](_0x4660e4,_0x4ca2e4,!![]);}catch(_0x2f3840){return BPromise[_0xf46e('0x20')](_0x2f3840);}return _0x4660e4[_0xf46e('0x21')]();};}function saveUpdates(_0x1544ee,_0x5bee97){return function(_0x589987){if(_0x589987){return _0x589987[_0xf46e('0x22')](_0x1544ee)[_0xf46e('0x23')](function(_0xaee1a3){return _0xaee1a3;});}return null;};}function removeEntity(_0x1f6a61,_0x3cd2e1){return function(_0x415f94){if(_0x415f94){return _0x415f94[_0xf46e('0x24')]()[_0xf46e('0x23')](function(){_0x1f6a61[_0xf46e('0x17')](0xcc)[_0xf46e('0x18')]();});}};}function handleEntityNotFound(_0x165ebf,_0x220ffb){return function(_0x587b0c){if(!_0x587b0c){_0x165ebf['sendStatus'](0x194);}return _0x587b0c;};}function handleError(_0x195ab6,_0x38f146){_0x38f146=_0x38f146||0x1f4;return function(_0x294a62){logger[_0xf46e('0x25')](_0x294a62['stack']);if(_0x294a62[_0xf46e('0x26')]){delete _0x294a62[_0xf46e('0x26')];}_0x195ab6[_0xf46e('0x17')](_0x38f146)[_0xf46e('0x27')](_0x294a62);};}exports[_0xf46e('0x28')]=function(_0x481e82,_0x5e7d0c){var _0xafd070={},_0x1ed6e8={},_0x533323={'count':0x0,'rows':[]};var _0x36a53a=_[_0xf46e('0x29')](db[_0xf46e('0x2a')][_0xf46e('0x2b')],function(_0x56e1cf){return{'name':_0x56e1cf['fieldName'],'type':_0x56e1cf['type'][_0xf46e('0x2c')]};});_0x1ed6e8['model']=_['map'](_0x36a53a,_0xf46e('0x26'));_0x1ed6e8[_0xf46e('0x2d')]=_[_0xf46e('0x2e')](_0x481e82[_0xf46e('0x2d')]);_0x1ed6e8[_0xf46e('0x2f')]=_[_0xf46e('0x30')](_0x1ed6e8[_0xf46e('0x31')],_0x1ed6e8['query']);_0xafd070[_0xf46e('0x32')]=_[_0xf46e('0x30')](_0x1ed6e8['model'],qs[_0xf46e('0x33')](_0x481e82[_0xf46e('0x2d')]['fields']));_0xafd070[_0xf46e('0x32')]=_0xafd070[_0xf46e('0x32')][_0xf46e('0x34')]?_0xafd070[_0xf46e('0x32')]:_0x1ed6e8[_0xf46e('0x31')];if(!_0x481e82['query'][_0xf46e('0x35')](_0xf46e('0x36'))){_0xafd070[_0xf46e('0x1c')]=qs[_0xf46e('0x1c')](_0x481e82['query'][_0xf46e('0x1c')]);_0xafd070[_0xf46e('0x1a')]=qs[_0xf46e('0x1a')](_0x481e82[_0xf46e('0x2d')]['offset']);}_0xafd070[_0xf46e('0x37')]=qs['sort'](_0x481e82[_0xf46e('0x2d')][_0xf46e('0x38')]);_0xafd070['where']=qs[_0xf46e('0x2f')](_[_0xf46e('0x39')](_0x481e82[_0xf46e('0x2d')],_0x1ed6e8[_0xf46e('0x2f')]),_0x36a53a);if(_0x481e82['query'][_0xf46e('0x3a')]){_0xafd070[_0xf46e('0x3b')]=_[_0xf46e('0x3c')](_0xafd070['where'],{'$or':_[_0xf46e('0x29')](_0x36a53a,function(_0x5efcc2){if(_0x5efcc2['type']!==_0xf46e('0x3d')){var _0x544a91={};_0x544a91[_0x5efcc2[_0xf46e('0x26')]]={'$like':'%'+_0x481e82[_0xf46e('0x2d')][_0xf46e('0x3a')]+'%'};return _0x544a91;}})});}_0xafd070=_['merge']({},_0xafd070,_0x481e82[_0xf46e('0x3e')]);var _0x53a0db={'where':_0xafd070[_0xf46e('0x3b')]};return db['CmHopperBlack']['count'](_0x53a0db)[_0xf46e('0x23')](function(_0xb2cc89){_0x533323['count']=_0xb2cc89;if(_0x481e82[_0xf46e('0x2d')][_0xf46e('0x3f')]){_0xafd070[_0xf46e('0x40')]=[{'all':!![]}];}return db[_0xf46e('0x2a')][_0xf46e('0x41')](_0xafd070);})[_0xf46e('0x23')](function(_0x2d837c){_0x533323[_0xf46e('0x42')]=_0x2d837c;return _0x533323;})[_0xf46e('0x23')](respondWithFilteredResult(_0x5e7d0c,_0xafd070))[_0xf46e('0x43')](handleError(_0x5e7d0c,null));};exports[_0xf46e('0x44')]=function(_0x4804ba,_0x4ac1e8){var _0x5d06c0={'raw':!![],'where':{'id':_0x4804ba[_0xf46e('0x45')]['id']}},_0x465445={};_0x465445[_0xf46e('0x31')]=_['keys'](db[_0xf46e('0x2a')]['rawAttributes']);_0x465445[_0xf46e('0x2d')]=_[_0xf46e('0x2e')](_0x4804ba[_0xf46e('0x2d')]);_0x465445['filters']=_[_0xf46e('0x30')](_0x465445[_0xf46e('0x31')],_0x465445['query']);_0x5d06c0[_0xf46e('0x32')]=_[_0xf46e('0x30')](_0x465445[_0xf46e('0x31')],qs[_0xf46e('0x33')](_0x4804ba['query'][_0xf46e('0x33')]));_0x5d06c0['attributes']=_0x5d06c0['attributes']['length']?_0x5d06c0[_0xf46e('0x32')]:_0x465445['model'];if(_0x4804ba[_0xf46e('0x2d')][_0xf46e('0x3f')]){_0x5d06c0['include']=[{'all':!![]}];}_0x5d06c0=_[_0xf46e('0x3c')]({},_0x5d06c0,_0x4804ba[_0xf46e('0x3e')]);return db['CmHopperBlack'][_0xf46e('0x46')](_0x5d06c0)['then'](handleEntityNotFound(_0x4ac1e8,null))[_0xf46e('0x23')](respondWithResult(_0x4ac1e8,null))[_0xf46e('0x43')](handleError(_0x4ac1e8,null));};exports['update']=function(_0x42b651,_0x5480b2){if(_0x42b651['body']['id']){delete _0x42b651['body']['id'];}return db['CmHopperBlack'][_0xf46e('0x46')]({'where':{'id':_0x42b651[_0xf46e('0x45')]['id']}})[_0xf46e('0x23')](handleEntityNotFound(_0x5480b2,null))[_0xf46e('0x23')](saveUpdates(_0x42b651[_0xf46e('0x47')],null))['then'](respondWithResult(_0x5480b2,null))[_0xf46e('0x43')](handleError(_0x5480b2,null));};exports[_0xf46e('0x24')]=function(_0x3e6842,_0x2c53ed){return db[_0xf46e('0x2a')][_0xf46e('0x46')]({'where':{'id':_0x3e6842['params']['id']}})[_0xf46e('0x23')](handleEntityNotFound(_0x2c53ed,null))[_0xf46e('0x23')](removeEntity(_0x2c53ed,null))['catch'](handleError(_0x2c53ed,null));};exports[_0xf46e('0x48')]=function(_0x42f811,_0x503a40){return db[_0xf46e('0x2a')]['describe']()[_0xf46e('0x23')](respondWithResult(_0x503a40,null))[_0xf46e('0x43')](handleError(_0x503a40,null));};
\ No newline at end of file
+var _0x1346=['catch','params','includeAll','include','find','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','apply','save','update','then','destroy','end','error','name','send','CmHopperBlack','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','nolimit','offset','order','sort','where','pick','merge','map','options','findAll','rows'];(function(_0x30e588,_0x149405){var _0x102bc1=function(_0x26519f){while(--_0x26519f){_0x30e588['push'](_0x30e588['shift']());}};_0x102bc1(++_0x149405);}(_0x1346,0x95));var _0x6134=function(_0x638295,_0x3bfec0){_0x638295=_0x638295-0x0;var _0x3805e7=_0x1346[_0x638295];return _0x3805e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6134('0x0'));var zipdir=require(_0x6134('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6134('0x2'));var moment=require(_0x6134('0x3'));var BPromise=require(_0x6134('0x4'));var Mustache=require('mustache');var util=require(_0x6134('0x5'));var path=require(_0x6134('0x6'));var sox=require(_0x6134('0x7'));var csv=require(_0x6134('0x8'));var ejs=require(_0x6134('0x9'));var fs=require('fs');var fs_extra=require(_0x6134('0xa'));var _=require(_0x6134('0xb'));var squel=require(_0x6134('0xc'));var crypto=require('crypto');var jsforce=require(_0x6134('0xd'));var deskjs=require(_0x6134('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6134('0xf'));var Papa=require(_0x6134('0x10'));var Redis=require(_0x6134('0x11'));var authService=require(_0x6134('0x12'));var qs=require(_0x6134('0x13'));var as=require(_0x6134('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6134('0x15'))(_0x6134('0x16'));var utils=require(_0x6134('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6134('0x18'));var db=require(_0x6134('0x19'))['db'];function respondWithStatusCode(_0x336d2e,_0x1411b5){_0x1411b5=_0x1411b5||0xcc;return function(_0x4e7a8d){if(_0x4e7a8d){return _0x336d2e[_0x6134('0x1a')](_0x1411b5);}return _0x336d2e[_0x6134('0x1b')](_0x1411b5)['end']();};}function respondWithResult(_0xe28017,_0x3bde6b){_0x3bde6b=_0x3bde6b||0xc8;return function(_0x14718a){if(_0x14718a){return _0xe28017[_0x6134('0x1b')](_0x3bde6b)[_0x6134('0x1c')](_0x14718a);}};}function respondWithFilteredResult(_0x299b05,_0x263833){return function(_0x5ae611){if(_0x5ae611){var _0x25d7c9=typeof _0x263833['offset']===_0x6134('0x1d')&&typeof _0x263833[_0x6134('0x1e')]===_0x6134('0x1d');var _0x3fea2e=_0x5ae611[_0x6134('0x1f')];var _0x5d187f=_0x25d7c9?0x0:_0x263833['offset'];var _0x705d79=_0x25d7c9?_0x5ae611[_0x6134('0x1f')]:_0x263833['offset']+_0x263833[_0x6134('0x1e')];var _0x294cd8;if(_0x705d79>=_0x3fea2e){_0x705d79=_0x3fea2e;_0x294cd8=0xc8;}else{_0x294cd8=0xce;}_0x299b05[_0x6134('0x1b')](_0x294cd8);return _0x299b05['set']('Content-Range',_0x5d187f+'-'+_0x705d79+'/'+_0x3fea2e)[_0x6134('0x1c')](_0x5ae611);}return null;};}function patchUpdates(_0x1d3395){return function(_0x4a43f0){try{jsonpatch[_0x6134('0x20')](_0x4a43f0,_0x1d3395,!![]);}catch(_0x40c86d){return BPromise['reject'](_0x40c86d);}return _0x4a43f0[_0x6134('0x21')]();};}function saveUpdates(_0x21d29f,_0x269ba3){return function(_0x2e173b){if(_0x2e173b){return _0x2e173b[_0x6134('0x22')](_0x21d29f)[_0x6134('0x23')](function(_0x1517c1){return _0x1517c1;});}return null;};}function removeEntity(_0xbecdb0,_0x391f6){return function(_0x1d0018){if(_0x1d0018){return _0x1d0018[_0x6134('0x24')]()['then'](function(){_0xbecdb0[_0x6134('0x1b')](0xcc)[_0x6134('0x25')]();});}};}function handleEntityNotFound(_0x33ab78,_0x3e1932){return function(_0x4eb10c){if(!_0x4eb10c){_0x33ab78['sendStatus'](0x194);}return _0x4eb10c;};}function handleError(_0x38812b,_0x1dfb70){_0x1dfb70=_0x1dfb70||0x1f4;return function(_0x4b3a1a){logger[_0x6134('0x26')](_0x4b3a1a['stack']);if(_0x4b3a1a['name']){delete _0x4b3a1a[_0x6134('0x27')];}_0x38812b['status'](_0x1dfb70)[_0x6134('0x28')](_0x4b3a1a);};}exports['index']=function(_0x1d4711,_0x1d77ab){var _0x437c34={},_0x4eacb7={},_0x141c0c={'count':0x0,'rows':[]};var _0x48118b=_['map'](db[_0x6134('0x29')][_0x6134('0x2a')],function(_0x2e28c8){return{'name':_0x2e28c8[_0x6134('0x2b')],'type':_0x2e28c8[_0x6134('0x2c')]['key']};});_0x4eacb7['model']=_['map'](_0x48118b,_0x6134('0x27'));_0x4eacb7[_0x6134('0x2d')]=_[_0x6134('0x2e')](_0x1d4711[_0x6134('0x2d')]);_0x4eacb7[_0x6134('0x2f')]=_['intersection'](_0x4eacb7[_0x6134('0x30')],_0x4eacb7[_0x6134('0x2d')]);_0x437c34[_0x6134('0x31')]=_[_0x6134('0x32')](_0x4eacb7[_0x6134('0x30')],qs[_0x6134('0x33')](_0x1d4711[_0x6134('0x2d')][_0x6134('0x33')]));_0x437c34['attributes']=_0x437c34[_0x6134('0x31')][_0x6134('0x34')]?_0x437c34[_0x6134('0x31')]:_0x4eacb7['model'];if(!_0x1d4711['query']['hasOwnProperty'](_0x6134('0x35'))){_0x437c34[_0x6134('0x1e')]=qs[_0x6134('0x1e')](_0x1d4711[_0x6134('0x2d')][_0x6134('0x1e')]);_0x437c34['offset']=qs[_0x6134('0x36')](_0x1d4711['query']['offset']);}_0x437c34[_0x6134('0x37')]=qs[_0x6134('0x38')](_0x1d4711[_0x6134('0x2d')][_0x6134('0x38')]);_0x437c34[_0x6134('0x39')]=qs[_0x6134('0x2f')](_[_0x6134('0x3a')](_0x1d4711[_0x6134('0x2d')],_0x4eacb7[_0x6134('0x2f')]),_0x48118b);if(_0x1d4711['query']['filter']){_0x437c34[_0x6134('0x39')]=_[_0x6134('0x3b')](_0x437c34[_0x6134('0x39')],{'$or':_[_0x6134('0x3c')](_0x48118b,function(_0xcaa827){if(_0xcaa827['type']!=='VIRTUAL'){var _0x563847={};_0x563847[_0xcaa827[_0x6134('0x27')]]={'$like':'%'+_0x1d4711[_0x6134('0x2d')]['filter']+'%'};return _0x563847;}})});}_0x437c34=_['merge']({},_0x437c34,_0x1d4711[_0x6134('0x3d')]);var _0x499348={'where':_0x437c34[_0x6134('0x39')]};return db[_0x6134('0x29')][_0x6134('0x1f')](_0x499348)['then'](function(_0x550387){_0x141c0c[_0x6134('0x1f')]=_0x550387;if(_0x1d4711['query']['includeAll']){_0x437c34['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x6134('0x3e')](_0x437c34);})[_0x6134('0x23')](function(_0xf5ac43){_0x141c0c[_0x6134('0x3f')]=_0xf5ac43;return _0x141c0c;})[_0x6134('0x23')](respondWithFilteredResult(_0x1d77ab,_0x437c34))[_0x6134('0x40')](handleError(_0x1d77ab,null));};exports['show']=function(_0x52ab6e,_0x2dec2c){var _0x1b0c03={'raw':!![],'where':{'id':_0x52ab6e[_0x6134('0x41')]['id']}},_0x32695a={};_0x32695a[_0x6134('0x30')]=_[_0x6134('0x2e')](db[_0x6134('0x29')][_0x6134('0x2a')]);_0x32695a['query']=_[_0x6134('0x2e')](_0x52ab6e[_0x6134('0x2d')]);_0x32695a[_0x6134('0x2f')]=_[_0x6134('0x32')](_0x32695a[_0x6134('0x30')],_0x32695a[_0x6134('0x2d')]);_0x1b0c03['attributes']=_[_0x6134('0x32')](_0x32695a['model'],qs[_0x6134('0x33')](_0x52ab6e[_0x6134('0x2d')][_0x6134('0x33')]));_0x1b0c03['attributes']=_0x1b0c03['attributes'][_0x6134('0x34')]?_0x1b0c03[_0x6134('0x31')]:_0x32695a['model'];if(_0x52ab6e['query'][_0x6134('0x42')]){_0x1b0c03[_0x6134('0x43')]=[{'all':!![]}];}_0x1b0c03=_['merge']({},_0x1b0c03,_0x52ab6e[_0x6134('0x3d')]);return db['CmHopperBlack'][_0x6134('0x44')](_0x1b0c03)[_0x6134('0x23')](handleEntityNotFound(_0x2dec2c,null))['then'](respondWithResult(_0x2dec2c,null))[_0x6134('0x40')](handleError(_0x2dec2c,null));};exports[_0x6134('0x22')]=function(_0x2958d3,_0xfb63e2){if(_0x2958d3[_0x6134('0x45')]['id']){delete _0x2958d3[_0x6134('0x45')]['id'];}return db[_0x6134('0x29')][_0x6134('0x44')]({'where':{'id':_0x2958d3[_0x6134('0x41')]['id']}})[_0x6134('0x23')](handleEntityNotFound(_0xfb63e2,null))[_0x6134('0x23')](saveUpdates(_0x2958d3['body'],null))[_0x6134('0x23')](respondWithResult(_0xfb63e2,null))['catch'](handleError(_0xfb63e2,null));};exports[_0x6134('0x24')]=function(_0xbbf40f,_0x264909){return db[_0x6134('0x29')]['find']({'where':{'id':_0xbbf40f['params']['id']}})[_0x6134('0x23')](handleEntityNotFound(_0x264909,null))[_0x6134('0x23')](removeEntity(_0x264909,null))[_0x6134('0x40')](handleError(_0x264909,null));};exports[_0x6134('0x46')]=function(_0x46cd93,_0x1e97c1){return db[_0x6134('0x29')]['describe']()[_0x6134('0x23')](respondWithResult(_0x1e97c1,null))[_0x6134('0x40')](handleError(_0x1e97c1,null));};
\ No newline at end of file
index ca2745d..045762c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x136a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','api'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x136a,0x7f));var _0xa136=function(_0x443038,_0x3da9ae){_0x443038=_0x443038-0x0;var _0xeba89c=_0x136a[_0x443038];return _0xeba89c;};'use strict';var _=require(_0xa136('0x0'));var util=require(_0xa136('0x1'));var logger=require('../../config/logger')(_0xa136('0x2'));var moment=require(_0xa136('0x3'));var BPromise=require(_0xa136('0x4'));var rp=require(_0xa136('0x5'));var fs=require('fs');var path=require(_0xa136('0x6'));var rimraf=require(_0xa136('0x7'));var config=require(_0xa136('0x8'));var attributes=require('./cmHopperBlack.attributes');module[_0xa136('0x9')]=function(_0xeb1d67,_0x5c8d96){return _0xeb1d67[_0xa136('0xa')](_0xa136('0xb'),attributes,{'tableName':_0xa136('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9d72=['define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x2682c6,_0x6c30a5){var _0x3ecca8=function(_0x1c82c6){while(--_0x1c82c6){_0x2682c6['push'](_0x2682c6['shift']());}};_0x3ecca8(++_0x6c30a5);}(_0x9d72,0x1a7));var _0x29d7=function(_0x49cb2a,_0x2bec9f){_0x49cb2a=_0x49cb2a-0x0;var _0x587793=_0x9d72[_0x49cb2a];return _0x587793;};'use strict';var _=require(_0x29d7('0x0'));var util=require(_0x29d7('0x1'));var logger=require(_0x29d7('0x2'))(_0x29d7('0x3'));var moment=require(_0x29d7('0x4'));var BPromise=require('bluebird');var rp=require(_0x29d7('0x5'));var fs=require('fs');var path=require(_0x29d7('0x6'));var rimraf=require(_0x29d7('0x7'));var config=require(_0x29d7('0x8'));var attributes=require('./cmHopperBlack.attributes');module['exports']=function(_0x2f2079,_0x578247){return _0x2f2079[_0x29d7('0x9')](_0x29d7('0xa'),attributes,{'tableName':_0x29d7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8a231b7..59f95cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeebf=['client','http','request','then','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','raw','options','where','attributes','limit','map','model','include','stringify','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0xfe56fb,_0xa5f6d4){var _0x3da6fa=function(_0x5ec4ef){while(--_0x5ec4ef){_0xfe56fb['push'](_0xfe56fb['shift']());}};_0x3da6fa(++_0xa5f6d4);}(_0xeebf,0x121));var _0xfeeb=function(_0xa0be1c,_0x152d5d){_0xa0be1c=_0xa0be1c-0x0;var _0x546eec=_0xeebf[_0xa0be1c];return _0x546eec;};'use strict';var _=require(_0xfeeb('0x0'));var util=require(_0xfeeb('0x1'));var moment=require('moment');var BPromise=require(_0xfeeb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfeeb('0x3'));var db=require(_0xfeeb('0x4'))['db'];var utils=require(_0xfeeb('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xfeeb('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfeeb('0x7')][_0xfeeb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x435c41,_0x4b871e,_0x1f7469){return new BPromise(function(_0x1c4b54,_0x32dec0){return client[_0xfeeb('0x9')](_0x435c41,_0x1f7469)[_0xfeeb('0xa')](function(_0x332723){logger['info'](_0xfeeb('0xb'),_0x4b871e,'request\x20sent');logger[_0xfeeb('0xc')](_0xfeeb('0xd'),_0x4b871e,_0xfeeb('0xe'),JSON['stringify'](_0x332723));if(_0x332723[_0xfeeb('0xf')]){if(_0x332723['error']['code']===0x1f4){logger[_0xfeeb('0xf')](_0xfeeb('0xb'),_0x4b871e,_0x332723['error'][_0xfeeb('0x10')]);return _0x32dec0(_0x332723[_0xfeeb('0xf')][_0xfeeb('0x10')]);}logger[_0xfeeb('0xf')]('CmHopperBlack,\x20%s,\x20%s',_0x4b871e,_0x332723[_0xfeeb('0xf')][_0xfeeb('0x10')]);return _0x1c4b54(_0x332723['error']['message']);}else{logger[_0xfeeb('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x4b871e,'request\x20sent');_0x1c4b54(_0x332723[_0xfeeb('0x12')][_0xfeeb('0x10')]);}})[_0xfeeb('0x13')](function(_0x39a168){logger['error'](_0xfeeb('0xb'),_0x4b871e,_0x39a168);_0x32dec0(_0x39a168);});});}exports[_0xfeeb('0x14')]=function(_0x1e730d){var _0x3fb18e=this;return new Promise(function(_0x582311,_0x2a16af){return db[_0xfeeb('0x15')][_0xfeeb('0x16')]({'raw':_0x1e730d['options']?_0x1e730d['options'][_0xfeeb('0x17')]===undefined?!![]:![]:!![],'where':_0x1e730d[_0xfeeb('0x18')]?_0x1e730d[_0xfeeb('0x18')][_0xfeeb('0x19')]||null:null,'attributes':_0x1e730d['options']?_0x1e730d['options'][_0xfeeb('0x1a')]||null:null,'limit':_0x1e730d[_0xfeeb('0x18')]?_0x1e730d[_0xfeeb('0x18')][_0xfeeb('0x1b')]||null:null,'include':_0x1e730d[_0xfeeb('0x18')]?_0x1e730d['options']['include']?_[_0xfeeb('0x1c')](_0x1e730d[_0xfeeb('0x18')]['include'],function(_0x49b2fc){return{'model':db[_0x49b2fc[_0xfeeb('0x1d')]],'as':_0x49b2fc['as'],'attributes':_0x49b2fc[_0xfeeb('0x1a')],'include':_0x49b2fc[_0xfeeb('0x1e')]?_[_0xfeeb('0x1c')](_0x49b2fc[_0xfeeb('0x1e')],function(_0x1b1292){return{'model':db[_0x1b1292[_0xfeeb('0x1d')]],'as':_0x1b1292['as'],'attributes':_0x1b1292[_0xfeeb('0x1a')],'include':_0x1b1292['include']?_[_0xfeeb('0x1c')](_0x1b1292[_0xfeeb('0x1e')],function(_0x5f1eeb){return{'model':db[_0x5f1eeb['model']],'as':_0x5f1eeb['as'],'attributes':_0x5f1eeb['attributes']};}):[]};}):[]};}):[]:[]})[_0xfeeb('0xa')](function(_0x4e5361){logger[_0xfeeb('0x11')](_0xfeeb('0x14'),_0x1e730d);logger['debug'](_0xfeeb('0x14'),_0x1e730d,JSON[_0xfeeb('0x1f')](_0x4e5361));_0x582311(_0x4e5361);})[_0xfeeb('0x13')](function(_0x2580ef){logger[_0xfeeb('0xf')](_0xfeeb('0x14'),_0x2580ef[_0xfeeb('0x10')],_0x1e730d);_0x2a16af(_0x3fb18e[_0xfeeb('0xf')](0x1f4,_0x2580ef[_0xfeeb('0x10')]));});});};exports[_0xfeeb('0x20')]=function(_0x4293b3){var _0x22e4b0=this;return new Promise(function(_0x29230b,_0x4d54b1){return db[_0xfeeb('0x15')][_0xfeeb('0x21')](_0x4293b3[_0xfeeb('0x22')],{'raw':_0x4293b3[_0xfeeb('0x18')]?_0x4293b3[_0xfeeb('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4293b3[_0xfeeb('0x18')]?_0x4293b3[_0xfeeb('0x18')]['where']||null:null,'attributes':_0x4293b3[_0xfeeb('0x18')]?_0x4293b3['options']['attributes']||null:null,'limit':_0x4293b3[_0xfeeb('0x18')]?_0x4293b3[_0xfeeb('0x18')][_0xfeeb('0x1b')]||null:null})[_0xfeeb('0xa')](function(_0x17d46e){logger['info'](_0xfeeb('0x20'),_0x4293b3);logger[_0xfeeb('0xc')](_0xfeeb('0x20'),_0x4293b3,JSON[_0xfeeb('0x1f')](_0x17d46e));_0x29230b(_0x17d46e);})[_0xfeeb('0x13')](function(_0xc5f0b9){logger['error']('UpdateCmHopperBlack',_0xc5f0b9['message'],_0x4293b3);_0x4d54b1(_0x22e4b0[_0xfeeb('0xf')](0x1f4,_0xc5f0b9[_0xfeeb('0x10')]));});});};exports[_0xfeeb('0x23')]=function(_0x22c825){var _0x4cd23b=this;return new Promise(function(_0x359812,_0x1b8a5c){return db[_0xfeeb('0x15')][_0xfeeb('0x24')]({'where':_0x22c825[_0xfeeb('0x18')]?_0x22c825[_0xfeeb('0x18')][_0xfeeb('0x19')]||null:null})[_0xfeeb('0xa')](function(_0x142b7c){logger[_0xfeeb('0x11')]('DestroyCmHopperBlack',_0x22c825);logger[_0xfeeb('0xc')](_0xfeeb('0x23'),_0x22c825,JSON['stringify'](_0x142b7c));_0x359812(_0x142b7c);})['catch'](function(_0x47b0bb){logger[_0xfeeb('0xf')](_0xfeeb('0x23'),_0x47b0bb['message'],_0x22c825);_0x1b8a5c(_0x4cd23b['error'](0x1f4,_0x47b0bb[_0xfeeb('0x10')]));});});};
\ No newline at end of file
+var _0x3f14=['limit','include','map','model','debug','UpdateCmHopperBlack','update','body','destroy','DestroyCmHopperBlack','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes'];(function(_0x2aa52b,_0x56c560){var _0x269130=function(_0x48fb4e){while(--_0x48fb4e){_0x2aa52b['push'](_0x2aa52b['shift']());}};_0x269130(++_0x56c560);}(_0x3f14,0x186));var _0x43f1=function(_0x1ae975,_0x70b40e){_0x1ae975=_0x1ae975-0x0;var _0x2576ca=_0x3f14[_0x1ae975];return _0x2576ca;};'use strict';var _=require('lodash');var util=require(_0x43f1('0x0'));var moment=require(_0x43f1('0x1'));var BPromise=require(_0x43f1('0x2'));var rs=require(_0x43f1('0x3'));var fs=require('fs');var Redis=require(_0x43f1('0x4'));var db=require(_0x43f1('0x5'))['db'];var utils=require(_0x43f1('0x6'));var logger=require(_0x43f1('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x43f1('0x8')][_0x43f1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35c7b3,_0x480b9f,_0x2979d6){return new BPromise(function(_0x51a5e4,_0x928437){return client[_0x43f1('0xa')](_0x35c7b3,_0x2979d6)[_0x43f1('0xb')](function(_0x5526a2){logger[_0x43f1('0xc')](_0x43f1('0xd'),_0x480b9f,_0x43f1('0xe'));logger['debug'](_0x43f1('0xf'),_0x480b9f,_0x43f1('0xe'),JSON[_0x43f1('0x10')](_0x5526a2));if(_0x5526a2['error']){if(_0x5526a2[_0x43f1('0x11')][_0x43f1('0x12')]===0x1f4){logger[_0x43f1('0x11')](_0x43f1('0xd'),_0x480b9f,_0x5526a2[_0x43f1('0x11')][_0x43f1('0x13')]);return _0x928437(_0x5526a2[_0x43f1('0x11')][_0x43f1('0x13')]);}logger[_0x43f1('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x480b9f,_0x5526a2['error'][_0x43f1('0x13')]);return _0x51a5e4(_0x5526a2['error']['message']);}else{logger[_0x43f1('0xc')](_0x43f1('0xd'),_0x480b9f,_0x43f1('0xe'));_0x51a5e4(_0x5526a2[_0x43f1('0x14')][_0x43f1('0x13')]);}})[_0x43f1('0x15')](function(_0x1e67ad){logger[_0x43f1('0x11')](_0x43f1('0xd'),_0x480b9f,_0x1e67ad);_0x928437(_0x1e67ad);});});}exports[_0x43f1('0x16')]=function(_0x5c1da9){var _0x5a1e4a=this;return new Promise(function(_0xe23494,_0x461f54){return db[_0x43f1('0x17')]['findAll']({'raw':_0x5c1da9[_0x43f1('0x18')]?_0x5c1da9[_0x43f1('0x18')][_0x43f1('0x19')]===undefined?!![]:![]:!![],'where':_0x5c1da9[_0x43f1('0x18')]?_0x5c1da9[_0x43f1('0x18')][_0x43f1('0x1a')]||null:null,'attributes':_0x5c1da9[_0x43f1('0x18')]?_0x5c1da9[_0x43f1('0x18')][_0x43f1('0x1b')]||null:null,'limit':_0x5c1da9['options']?_0x5c1da9['options'][_0x43f1('0x1c')]||null:null,'include':_0x5c1da9[_0x43f1('0x18')]?_0x5c1da9[_0x43f1('0x18')][_0x43f1('0x1d')]?_[_0x43f1('0x1e')](_0x5c1da9[_0x43f1('0x18')][_0x43f1('0x1d')],function(_0x464d46){return{'model':db[_0x464d46['model']],'as':_0x464d46['as'],'attributes':_0x464d46[_0x43f1('0x1b')],'include':_0x464d46[_0x43f1('0x1d')]?_[_0x43f1('0x1e')](_0x464d46[_0x43f1('0x1d')],function(_0x2091d4){return{'model':db[_0x2091d4[_0x43f1('0x1f')]],'as':_0x2091d4['as'],'attributes':_0x2091d4[_0x43f1('0x1b')],'include':_0x2091d4[_0x43f1('0x1d')]?_[_0x43f1('0x1e')](_0x2091d4[_0x43f1('0x1d')],function(_0x1f3cc2){return{'model':db[_0x1f3cc2[_0x43f1('0x1f')]],'as':_0x1f3cc2['as'],'attributes':_0x1f3cc2[_0x43f1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x43f1('0xb')](function(_0x4b3dc2){logger[_0x43f1('0xc')](_0x43f1('0x16'),_0x5c1da9);logger[_0x43f1('0x20')](_0x43f1('0x16'),_0x5c1da9,JSON[_0x43f1('0x10')](_0x4b3dc2));_0xe23494(_0x4b3dc2);})[_0x43f1('0x15')](function(_0x23e34d){logger['error']('GetCmHopperBlack',_0x23e34d[_0x43f1('0x13')],_0x5c1da9);_0x461f54(_0x5a1e4a[_0x43f1('0x11')](0x1f4,_0x23e34d['message']));});});};exports[_0x43f1('0x21')]=function(_0x28444b){var _0x42d216=this;return new Promise(function(_0x12bd38,_0x522998){return db[_0x43f1('0x17')][_0x43f1('0x22')](_0x28444b[_0x43f1('0x23')],{'raw':_0x28444b['options']?_0x28444b[_0x43f1('0x18')][_0x43f1('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28444b[_0x43f1('0x18')]?_0x28444b[_0x43f1('0x18')][_0x43f1('0x1a')]||null:null,'attributes':_0x28444b[_0x43f1('0x18')]?_0x28444b[_0x43f1('0x18')][_0x43f1('0x1b')]||null:null,'limit':_0x28444b[_0x43f1('0x18')]?_0x28444b[_0x43f1('0x18')][_0x43f1('0x1c')]||null:null})['then'](function(_0x5b30f8){logger[_0x43f1('0xc')](_0x43f1('0x21'),_0x28444b);logger[_0x43f1('0x20')](_0x43f1('0x21'),_0x28444b,JSON[_0x43f1('0x10')](_0x5b30f8));_0x12bd38(_0x5b30f8);})[_0x43f1('0x15')](function(_0x3edea8){logger[_0x43f1('0x11')](_0x43f1('0x21'),_0x3edea8[_0x43f1('0x13')],_0x28444b);_0x522998(_0x42d216[_0x43f1('0x11')](0x1f4,_0x3edea8[_0x43f1('0x13')]));});});};exports['DestroyCmHopperBlack']=function(_0xfa4b79){var _0x55be4e=this;return new Promise(function(_0xc0f27e,_0x3745e0){return db[_0x43f1('0x17')][_0x43f1('0x24')]({'where':_0xfa4b79['options']?_0xfa4b79['options'][_0x43f1('0x1a')]||null:null})['then'](function(_0x1f3ba9){logger[_0x43f1('0xc')](_0x43f1('0x25'),_0xfa4b79);logger[_0x43f1('0x20')](_0x43f1('0x25'),_0xfa4b79,JSON[_0x43f1('0x10')](_0x1f3ba9));_0xc0f27e(_0x1f3ba9);})[_0x43f1('0x15')](function(_0x11409c){logger[_0x43f1('0x11')](_0x43f1('0x25'),_0x11409c[_0x43f1('0x13')],_0xfa4b79);_0x3745e0(_0x55be4e[_0x43f1('0x11')](0x1f4,_0x11409c['message']));});});};
\ No newline at end of file
index d25eb84..1bbc83c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ee1=['Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','index','isAuthenticated','/:id','delete','destroy','multer','express'];(function(_0x2473bb,_0x26da56){var _0x57f41f=function(_0x2afe61){while(--_0x2afe61){_0x2473bb['push'](_0x2473bb['shift']());}};_0x57f41f(++_0x26da56);}(_0x7ee1,0x8d));var _0x17ee=function(_0x24b59d,_0x536ead){_0x24b59d=_0x24b59d-0x0;var _0x814968=_0x7ee1[_0x24b59d];return _0x814968;};'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')]('/describe',auth[_0x17ee('0x9')](),controller['describe']);router[_0x17ee('0x7')](_0x17ee('0xa'),auth[_0x17ee('0x9')](),controller['show']);router['put']('/:id',auth[_0x17ee('0x9')](),controller['update']);router[_0x17ee('0xb')](_0x17ee('0xa'),auth[_0x17ee('0x9')](),controller[_0x17ee('0xc')]);module['exports']=router;
\ No newline at end of file
+var _0x524e=['../../config/environment','./cmHopperBlack.controller','get','index','/describe','describe','/:id','isAuthenticated','show','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1f7007,_0x177f62){var _0x521ec3=function(_0x46b49c){while(--_0x46b49c){_0x1f7007['push'](_0x1f7007['shift']());}};_0x521ec3(++_0x177f62);}(_0x524e,0x15e));var _0xe524=function(_0xdb6590,_0x3eaaf3){_0xdb6590=_0xdb6590-0x0;var _0x5a1dec=_0x524e[_0xdb6590];return _0x5a1dec;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe524('0x0'));var timeout=require(_0xe524('0x1'));var express=require(_0xe524('0x2'));var router=express[_0xe524('0x3')]();var fs_extra=require(_0xe524('0x4'));var auth=require(_0xe524('0x5'));var interaction=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var controller=require(_0xe524('0x8'));router[_0xe524('0x9')]('/',auth['isAuthenticated'](),controller[_0xe524('0xa')]);router[_0xe524('0x9')](_0xe524('0xb'),auth['isAuthenticated'](),controller[_0xe524('0xc')]);router[_0xe524('0x9')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0xf')]);router[_0xe524('0x10')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x11')]);router[_0xe524('0x12')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x13')]);module[_0xe524('0x14')]=router;
\ No newline at end of file
index d0ce746..27a2cea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbfd=['seconds','BOOLEAN','sequelize','moment','INTEGER','STRING','DATE','endtime','setDataValue','followuptime','diff'];(function(_0x895e88,_0x337088){var _0x1193c6=function(_0x576a27){while(--_0x576a27){_0x895e88['push'](_0x895e88['shift']());}};_0x1193c6(++_0x337088);}(_0xdbfd,0x120));var _0xddbf=function(_0x2a406f,_0x5bb1cc){_0x2a406f=_0x2a406f-0x0;var _0xa40d39=_0xdbfd[_0x2a406f];return _0xa40d39;};'use strict';var Sequelize=require(_0xddbf('0x0'));var moment=require(_0xddbf('0x1'));module['exports']={'state':{'type':Sequelize[_0xddbf('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xddbf('0x3')]},'scheduledat':{'type':Sequelize[_0xddbf('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xddbf('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xddbf('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xddbf('0x3')]},'calleridnum':{'type':Sequelize[_0xddbf('0x3')]},'calleridname':{'type':Sequelize[_0xddbf('0x3')]},'starttime':{'type':Sequelize[_0xddbf('0x4')]},'responsetime':{'type':Sequelize[_0xddbf('0x4')]},'answertime':{'type':Sequelize[_0xddbf('0x4')]},'droptime':{'type':Sequelize[_0xddbf('0x4')]},'endtime':{'type':Sequelize[_0xddbf('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xddbf('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xddbf('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xddbf('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xddbf('0x3')]},'campaign':{'type':Sequelize[_0xddbf('0x3')]},'campaigntype':{'type':Sequelize[_0xddbf('0x3')]},'membername':{'type':Sequelize[_0xddbf('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xddbf('0x3')]},'thirdDisposition':{'type':Sequelize[_0xddbf('0x3')]},'dispositionat':{'type':Sequelize[_0xddbf('0x4')],'set':function(_0xef9dfb){var _0x45c9a6=this['getDataValue'](_0xddbf('0x5'));if(_0x45c9a6&&_0xef9dfb){this[_0xddbf('0x6')](_0xddbf('0x7'),moment(_0xef9dfb)[_0xddbf('0x8')](moment(_0x45c9a6),_0xddbf('0x9')));}}},'amd':{'type':Sequelize[_0xddbf('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xddbf('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xddbf('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xddbf('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xddbf('0x4')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xddbf('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xddbf('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xddbf('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xddbf('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xddbf('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xddbf('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xddbf('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xddbf('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xa8a6=['BOOLEAN','sequelize','moment','exports','STRING','DATE','INTEGER','getDataValue','endtime','setDataValue','followuptime','diff'];(function(_0x33a7a2,_0x4b2494){var _0x3aaf95=function(_0x4388a9){while(--_0x4388a9){_0x33a7a2['push'](_0x33a7a2['shift']());}};_0x3aaf95(++_0x4b2494);}(_0xa8a6,0x79));var _0x6a8a=function(_0x14306f,_0x4b4c04){_0x14306f=_0x14306f-0x0;var _0x10962b=_0xa8a6[_0x14306f];return _0x10962b;};'use strict';var Sequelize=require(_0x6a8a('0x0'));var moment=require(_0x6a8a('0x1'));module[_0x6a8a('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x6a8a('0x3')]},'scheduledat':{'type':Sequelize[_0x6a8a('0x4')]},'countbusyretry':{'type':Sequelize[_0x6a8a('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6a8a('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6a8a('0x5')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x6a8a('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x6a8a('0x3')]},'originatecalleridname':{'type':Sequelize[_0x6a8a('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x6a8a('0x3')]},'starttime':{'type':Sequelize[_0x6a8a('0x4')]},'responsetime':{'type':Sequelize[_0x6a8a('0x4')]},'answertime':{'type':Sequelize[_0x6a8a('0x4')]},'droptime':{'type':Sequelize[_0x6a8a('0x4')]},'endtime':{'type':Sequelize[_0x6a8a('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6a8a('0x5')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x6a8a('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x6a8a('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x6a8a('0x3')]},'disposition':{'type':Sequelize[_0x6a8a('0x3')]},'secondDisposition':{'type':Sequelize[_0x6a8a('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x6a8a('0x4')],'set':function(_0xdd4571){var _0x24d5ae=this[_0x6a8a('0x6')](_0x6a8a('0x7'));if(_0x24d5ae&&_0xdd4571){this[_0x6a8a('0x8')](_0x6a8a('0x9'),moment(_0xdd4571)[_0x6a8a('0xa')](moment(_0x24d5ae),'seconds'));}}},'amd':{'type':Sequelize[_0x6a8a('0xb')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x6a8a('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x6a8a('0x4')]},'callback':{'type':Sequelize[_0x6a8a('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6a8a('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6a8a('0x4')]},'deleted':{'type':Sequelize[_0x6a8a('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x6a8a('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x6a8a('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6a8a('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6a8a('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6a8a('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index a5e57e1..7ea210c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda19=['map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','CmHopperFinal','includeAll','findAll','catch','show','uniqueid','body','find','params','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','VoiceQueue','insert','fromQuery','phone','scheduledAt','VoiceQueueId','createdAt','updatedAt','ANY_VALUE(calleridnum)','field','NOW()','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','VoiceQueueId\x20=\x20?','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','cm_hopper','ListId','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','CmHopper','findOne','rimraf','zip-dir','request-promise','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','api','../../config/utils','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','name','send'];(function(_0xcdd1d,_0x392801){var _0x46e10f=function(_0x57aab6){while(--_0x57aab6){_0xcdd1d['push'](_0xcdd1d['shift']());}};_0x46e10f(++_0x392801);}(_0xda19,0xd5));var _0x9da1=function(_0x558931,_0x251569){_0x558931=_0x558931-0x0;var _0x4ecc54=_0xda19[_0x558931];return _0x4ecc54;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];function respondWithStatusCode(_0x596b6b,_0x4735c7){_0x4735c7=_0x4735c7||0xcc;return function(_0x1d93f8){if(_0x1d93f8){return _0x596b6b[_0x9da1('0x17')](_0x4735c7);}return _0x596b6b[_0x9da1('0x18')](_0x4735c7)['end']();};}function respondWithResult(_0x2837e3,_0x535a13){_0x535a13=_0x535a13||0xc8;return function(_0x4d17e1){if(_0x4d17e1){return _0x2837e3[_0x9da1('0x18')](_0x535a13)['json'](_0x4d17e1);}};}function respondWithFilteredResult(_0x433ff4,_0x43c093){return function(_0x37653d){if(_0x37653d){var _0x1a1a6b=typeof _0x43c093[_0x9da1('0x19')]==='undefined'&&typeof _0x43c093[_0x9da1('0x1a')]===_0x9da1('0x1b');var _0xf83bf8=_0x37653d[_0x9da1('0x1c')];var _0xfb278d=_0x1a1a6b?0x0:_0x43c093[_0x9da1('0x19')];var _0x497676=_0x1a1a6b?_0x37653d['count']:_0x43c093[_0x9da1('0x19')]+_0x43c093[_0x9da1('0x1a')];var _0x1b0e7f;if(_0x497676>=_0xf83bf8){_0x497676=_0xf83bf8;_0x1b0e7f=0xc8;}else{_0x1b0e7f=0xce;}_0x433ff4[_0x9da1('0x18')](_0x1b0e7f);return _0x433ff4[_0x9da1('0x1d')](_0x9da1('0x1e'),_0xfb278d+'-'+_0x497676+'/'+_0xf83bf8)[_0x9da1('0x1f')](_0x37653d);}return null;};}function patchUpdates(_0x47e5cf){return function(_0x1a459c){try{jsonpatch[_0x9da1('0x20')](_0x1a459c,_0x47e5cf,!![]);}catch(_0x9c3b37){return BPromise[_0x9da1('0x21')](_0x9c3b37);}return _0x1a459c[_0x9da1('0x22')]();};}function saveUpdates(_0x4e9d7d,_0x5454d3){return function(_0x14793b){if(_0x14793b){return _0x14793b[_0x9da1('0x23')](_0x4e9d7d)[_0x9da1('0x24')](function(_0x330219){return _0x330219;});}return null;};}function removeEntity(_0x32eb55,_0x165b73){return function(_0x4c60aa){if(_0x4c60aa){return _0x4c60aa[_0x9da1('0x25')]()[_0x9da1('0x24')](function(){_0x32eb55['status'](0xcc)[_0x9da1('0x26')]();});}};}function handleEntityNotFound(_0x3f5680,_0x534210){return function(_0x2fd49c){if(!_0x2fd49c){_0x3f5680[_0x9da1('0x17')](0x194);}return _0x2fd49c;};}function handleError(_0x4b1152,_0x36b87a){_0x36b87a=_0x36b87a||0x1f4;return function(_0x1d6af5){logger['error'](_0x1d6af5['stack']);if(_0x1d6af5[_0x9da1('0x27')]){delete _0x1d6af5[_0x9da1('0x27')];}_0x4b1152['status'](_0x36b87a)[_0x9da1('0x28')](_0x1d6af5);};}exports['index']=function(_0x5a6f2d,_0x5a59c2){var _0x31b826={},_0x404b86={},_0x24c6d5={'count':0x0,'rows':[]};var _0x26dd58=_[_0x9da1('0x29')](db['CmHopperFinal'][_0x9da1('0x2a')],function(_0x4e6083){return{'name':_0x4e6083[_0x9da1('0x2b')],'type':_0x4e6083[_0x9da1('0x2c')]['key']};});_0x404b86[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x26dd58,'name');_0x404b86[_0x9da1('0x2e')]=_[_0x9da1('0x2f')](_0x5a6f2d[_0x9da1('0x2e')]);_0x404b86[_0x9da1('0x30')]=_['intersection'](_0x404b86['model'],_0x404b86[_0x9da1('0x2e')]);_0x31b826[_0x9da1('0x31')]=_[_0x9da1('0x32')](_0x404b86[_0x9da1('0x2d')],qs[_0x9da1('0x33')](_0x5a6f2d['query'][_0x9da1('0x33')]));_0x31b826[_0x9da1('0x31')]=_0x31b826[_0x9da1('0x31')][_0x9da1('0x34')]?_0x31b826[_0x9da1('0x31')]:_0x404b86[_0x9da1('0x2d')];if(!_0x5a6f2d['query'][_0x9da1('0x35')]('nolimit')){_0x31b826['limit']=qs[_0x9da1('0x1a')](_0x5a6f2d['query'][_0x9da1('0x1a')]);_0x31b826[_0x9da1('0x19')]=qs[_0x9da1('0x19')](_0x5a6f2d[_0x9da1('0x2e')][_0x9da1('0x19')]);}_0x31b826[_0x9da1('0x36')]=qs[_0x9da1('0x37')](_0x5a6f2d[_0x9da1('0x2e')]['sort']);_0x31b826[_0x9da1('0x38')]=qs['filters'](_[_0x9da1('0x39')](_0x5a6f2d['query'],_0x404b86['filters']),_0x26dd58);if(_0x5a6f2d[_0x9da1('0x2e')]['filter']){_0x31b826[_0x9da1('0x38')]=_[_0x9da1('0x3a')](_0x31b826['where'],{'$or':_[_0x9da1('0x29')](_0x26dd58,function(_0x1b750f){if(_0x1b750f[_0x9da1('0x2c')]!==_0x9da1('0x3b')){var _0x56bd49={};_0x56bd49[_0x1b750f[_0x9da1('0x27')]]={'$like':'%'+_0x5a6f2d['query'][_0x9da1('0x3c')]+'%'};return _0x56bd49;}})});}_0x31b826=_['merge']({},_0x31b826,_0x5a6f2d[_0x9da1('0x3d')]);var _0x46c176={'where':_0x31b826['where']};return db[_0x9da1('0x3e')][_0x9da1('0x1c')](_0x46c176)[_0x9da1('0x24')](function(_0x4e9af3){_0x24c6d5['count']=_0x4e9af3;if(_0x5a6f2d['query'][_0x9da1('0x3f')]){_0x31b826['include']=[{'all':!![]}];}return db[_0x9da1('0x3e')][_0x9da1('0x40')](_0x31b826);})[_0x9da1('0x24')](function(_0x43c064){_0x24c6d5['rows']=_0x43c064;return _0x24c6d5;})[_0x9da1('0x24')](respondWithFilteredResult(_0x5a59c2,_0x31b826))[_0x9da1('0x41')](handleError(_0x5a59c2,null));};exports[_0x9da1('0x42')]=function(_0x173dc6,_0x28fc88){var _0x26c225={'raw':!![],'where':{'id':_0x173dc6['params']['id']}},_0x28e0b2={};_0x28e0b2[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x3e')]['rawAttributes']);_0x28e0b2[_0x9da1('0x2e')]=_[_0x9da1('0x2f')](_0x173dc6['query']);_0x28e0b2[_0x9da1('0x30')]=_[_0x9da1('0x32')](_0x28e0b2['model'],_0x28e0b2[_0x9da1('0x2e')]);_0x26c225['attributes']=_[_0x9da1('0x32')](_0x28e0b2[_0x9da1('0x2d')],qs['fields'](_0x173dc6['query'][_0x9da1('0x33')]));_0x26c225[_0x9da1('0x31')]=_0x26c225[_0x9da1('0x31')][_0x9da1('0x34')]?_0x26c225[_0x9da1('0x31')]:_0x28e0b2[_0x9da1('0x2d')];if(_0x173dc6[_0x9da1('0x2e')][_0x9da1('0x3f')]){_0x26c225['include']=[{'all':!![]}];}_0x26c225=_[_0x9da1('0x3a')]({},_0x26c225,_0x173dc6[_0x9da1('0x3d')]);return db[_0x9da1('0x3e')]['find'](_0x26c225)[_0x9da1('0x24')](handleEntityNotFound(_0x28fc88,null))[_0x9da1('0x24')](respondWithResult(_0x28fc88,null))[_0x9da1('0x41')](handleError(_0x28fc88,null));};exports['describe']=function(_0x336fc3,_0x351d4d){return db[_0x9da1('0x3e')]['describe']()[_0x9da1('0x24')](respondWithResult(_0x351d4d,null))['catch'](handleError(_0x351d4d,null));};exports['update']=function(_0xfbdde9,_0x43c47d){if(_0xfbdde9['body'][_0x9da1('0x43')]){delete _0xfbdde9[_0x9da1('0x44')]['uniqueid'];}return db[_0x9da1('0x3e')][_0x9da1('0x45')]({'where':{'uniqueid':_0xfbdde9[_0x9da1('0x46')]['id']}})[_0x9da1('0x24')](handleEntityNotFound(_0x43c47d,null))[_0x9da1('0x24')](saveUpdates(_0xfbdde9[_0x9da1('0x44')],null))[_0x9da1('0x24')](respondWithResult(_0x43c47d,null))[_0x9da1('0x41')](handleError(_0x43c47d,null));};exports[_0x9da1('0x47')]=function(_0x5c9b46,_0x147c65,_0xe6c667){return db[_0x9da1('0x3e')][_0x9da1('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x5c9b46['params']['id']},'attributes':[[db['sequelize']['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x4b')))),_0x9da1('0x4c')],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x4d')))),_0x9da1('0x4e')],[db[_0x9da1('0x49')]['fn']('COUNT',db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')]['literal'](_0x9da1('0x4f')))),'busyContacts'],[db[_0x9da1('0x49')]['fn']('COUNT',db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x50')))),_0x9da1('0x51')],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x9da1('0x52')],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x53')))),_0x9da1('0x54')],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db['sequelize']['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')]('`state`\x20=\x2022,\x201,\x20null'))),_0x9da1('0x55')],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x56')))),'answeringMachine']]})[_0x9da1('0x24')](handleEntityNotFound(_0x147c65,null))[_0x9da1('0x24')](respondWithResult(_0x147c65,null))[_0x9da1('0x41')](handleError(_0x147c65,null));};exports[_0x9da1('0x57')]=function(_0x562e05,_0x1a9df0,_0x5c236e){return db[_0x9da1('0x3e')][_0x9da1('0x40')]({'raw':![],'where':{'CampaignId':_0x562e05[_0x9da1('0x46')]['id']},'attributes':[[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db['sequelize']['literal'](_0x9da1('0x4b')))),'noSuchContacts'],[db['sequelize']['fn']('COUNT',db[_0x9da1('0x49')]['fn']('IF',db['sequelize'][_0x9da1('0x4a')]('`state`\x20=\x203,\x201,\x20null'))),_0x9da1('0x4e')],[db[_0x9da1('0x49')]['fn']('COUNT',db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')]['literal'](_0x9da1('0x4f')))),_0x9da1('0x58')],[db['sequelize']['fn']('COUNT',db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x50')))),_0x9da1('0x51')],[db[_0x9da1('0x49')]['fn']('COUNT',db[_0x9da1('0x49')]['fn']('IF',db['sequelize']['literal'](_0x9da1('0x59')))),_0x9da1('0x52')],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x53')))),_0x9da1('0x54')],[db['sequelize']['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x5a')))),'reCallContacts'],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x56')))),'answeringMachine']]})[_0x9da1('0x24')](handleEntityNotFound(_0x1a9df0,null))['then'](respondWithResult(_0x1a9df0,null))[_0x9da1('0x41')](handleError(_0x1a9df0,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x7cfa7e,_0xdd3997,_0x44b6c0){return db[_0x9da1('0x5b')]['find']({'where':{'id':_0x7cfa7e['params']['id']}})['then'](handleEntityNotFound(_0xdd3997,null))[_0x9da1('0x24')](function(_0x2b1a71){var _0x266533;if(_0x2b1a71){_0x266533=squel[_0x9da1('0x5c')]()['into']('cm_hopper')[_0x9da1('0x5d')]([_0x9da1('0x5e'),_0x9da1('0x5f'),'ContactId','ListId',_0x9da1('0x60'),_0x9da1('0x61'),_0x9da1('0x62')],squel['select']()['field'](_0x9da1('0x63'),_0x9da1('0x5e'))[_0x9da1('0x64')](_0x9da1('0x65'),_0x9da1('0x5f'))['field'](_0x9da1('0x66'),_0x9da1('0x67'))[_0x9da1('0x64')](_0x9da1('0x68'),'ListId')[_0x9da1('0x64')](_0x9da1('0x69'),_0x9da1('0x60'))['field'](_0x9da1('0x65'),_0x9da1('0x61'))[_0x9da1('0x64')]('NOW()',_0x9da1('0x62'))[_0x9da1('0x6a')]('cm_hopper_final')[_0x9da1('0x38')]('VoiceQueueId\x20=\x20?',_0x7cfa7e[_0x9da1('0x46')]['id']['toString']())[_0x9da1('0x38')](_0x9da1('0x6b'),_0x7cfa7e[_0x9da1('0x44')][_0x9da1('0x6c')][_0x9da1('0x6d')]())[_0x9da1('0x38')](_0x9da1('0x6e'))[_0x9da1('0x38')](_0x9da1('0x6f'),squel[_0x9da1('0x70')]()[_0x9da1('0x64')](_0x9da1('0x5e'))[_0x9da1('0x6a')]('cm_hopper')[_0x9da1('0x38')](_0x9da1('0x71'),_0x7cfa7e[_0x9da1('0x46')]['id'][_0x9da1('0x6d')]()))[_0x9da1('0x38')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x9da1('0x70')]()[_0x9da1('0x64')]('calleridnum')['from'](_0x9da1('0x72'))[_0x9da1('0x38')](_0x9da1('0x71'),_0x7cfa7e[_0x9da1('0x46')]['id'][_0x9da1('0x6d')]())[_0x9da1('0x38')](_0x9da1('0x73')))[_0x9da1('0x74')](_0x9da1('0x67')))[_0x9da1('0x6d')]();return db[_0x9da1('0x49')][_0x9da1('0x2e')](_0x266533);}return[];})[_0x9da1('0x24')](respondWithResult(_0xdd3997,null))['catch'](handleError(_0xdd3997,null));};exports[_0x9da1('0x75')]=function(_0x3a0a84,_0x3f9782,_0x30b6fc){return db[_0x9da1('0x76')]['find']({'where':{'id':_0x3a0a84[_0x9da1('0x46')]['id']}})[_0x9da1('0x24')](handleEntityNotFound(_0x3f9782,null))['then'](function(_0x33b625){var _0x5a0533;if(_0x33b625){_0x5a0533=squel[_0x9da1('0x5c')]()['into'](_0x9da1('0x77'))[_0x9da1('0x5d')]([_0x9da1('0x5e'),_0x9da1('0x5f'),_0x9da1('0x67'),_0x9da1('0x78'),_0x9da1('0x79'),_0x9da1('0x61'),_0x9da1('0x62')],squel[_0x9da1('0x70')]()[_0x9da1('0x64')](_0x9da1('0x63'),'phone')[_0x9da1('0x64')](_0x9da1('0x65'),_0x9da1('0x5f'))[_0x9da1('0x64')](_0x9da1('0x66'),_0x9da1('0x67'))['field']('ANY_VALUE(ListId)',_0x9da1('0x78'))[_0x9da1('0x64')](_0x9da1('0x7a'),'CampaignId')[_0x9da1('0x64')](_0x9da1('0x65'),_0x9da1('0x61'))[_0x9da1('0x64')](_0x9da1('0x65'),_0x9da1('0x62'))[_0x9da1('0x6a')]('cm_hopper_final')[_0x9da1('0x38')](_0x9da1('0x7b'),_0x3a0a84['params']['id']['toString']())[_0x9da1('0x38')]('state\x20=\x20?',_0x3a0a84['body'][_0x9da1('0x6c')][_0x9da1('0x6d')]())[_0x9da1('0x38')](_0x9da1('0x6e'))[_0x9da1('0x38')](_0x9da1('0x6f'),squel[_0x9da1('0x70')]()[_0x9da1('0x64')]('phone')['from'](_0x9da1('0x77'))[_0x9da1('0x38')](_0x9da1('0x7b'),_0x3a0a84[_0x9da1('0x46')]['id'][_0x9da1('0x6d')]()))[_0x9da1('0x38')](_0x9da1('0x6f'),squel[_0x9da1('0x70')]()['field'](_0x9da1('0x7c'))['from'](_0x9da1('0x72'))[_0x9da1('0x38')](_0x9da1('0x7b'),_0x3a0a84[_0x9da1('0x46')]['id'][_0x9da1('0x6d')]())[_0x9da1('0x38')](_0x9da1('0x73')))['group'](_0x9da1('0x67')))['toString']();return db[_0x9da1('0x49')][_0x9da1('0x2e')](_0x5a0533);}return[];})[_0x9da1('0x24')](respondWithResult(_0x3f9782,null))[_0x9da1('0x41')](handleError(_0x3f9782,null));};exports['checkContactHopper']=function(_0x3310af,_0x1f93bf,_0x2afe1e){return db[_0x9da1('0x7d')][_0x9da1('0x7e')]({'where':{'VoiceQueueId':_0x3310af[_0x9da1('0x44')][_0x9da1('0x60')],'CampaignId':_0x3310af[_0x9da1('0x44')][_0x9da1('0x79')],'ContactId':_0x3310af[_0x9da1('0x44')][_0x9da1('0x67')]}})[_0x9da1('0x24')](handleEntityNotFound(_0x1f93bf,null))[_0x9da1('0x24')](function(_0x32ff53){if(_0x32ff53){return _0x32ff53;}return null;})['then'](respondWithResult(_0x1f93bf,null))[_0x9da1('0x41')](handleError(_0x1f93bf,null));};
\ No newline at end of file
+var _0xc1c6=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','CmHopperFinal','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','find','describe','body','uniqueid','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','phone','ANY_VALUE(ContactId)','field','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','NOW()','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','CmHopper','findOne','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','fs-extra','squel','crypto'];(function(_0x21bfab,_0x2fee48){var _0x4db318=function(_0x10396d){while(--_0x10396d){_0x21bfab['push'](_0x21bfab['shift']());}};_0x4db318(++_0x2fee48);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x5f08ac,_0x5fd21c){_0x5f08ac=_0x5f08ac-0x0;var _0x42c42f=_0xc1c6[_0x5f08ac];return _0x42c42f;};'use strict';var emlformat=require(_0x6c1c('0x0'));var rimraf=require(_0x6c1c('0x1'));var zipdir=require(_0x6c1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c1c('0x3'));var moment=require('moment');var BPromise=require(_0x6c1c('0x4'));var Mustache=require(_0x6c1c('0x5'));var util=require(_0x6c1c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6c1c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c1c('0x8'));var _=require('lodash');var squel=require(_0x6c1c('0x9'));var crypto=require(_0x6c1c('0xa'));var jsforce=require(_0x6c1c('0xb'));var deskjs=require(_0x6c1c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6c1c('0xd'));var Papa=require(_0x6c1c('0xe'));var Redis=require('ioredis');var authService=require(_0x6c1c('0xf'));var qs=require(_0x6c1c('0x10'));var as=require(_0x6c1c('0x11'));var hardwareService=require(_0x6c1c('0x12'));var logger=require('../../config/logger')(_0x6c1c('0x13'));var utils=require(_0x6c1c('0x14'));var config=require(_0x6c1c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c1c('0x16'))['db'];function respondWithStatusCode(_0x12a9e6,_0x2067bd){_0x2067bd=_0x2067bd||0xcc;return function(_0x49304f){if(_0x49304f){return _0x12a9e6[_0x6c1c('0x17')](_0x2067bd);}return _0x12a9e6['status'](_0x2067bd)[_0x6c1c('0x18')]();};}function respondWithResult(_0x15a1fc,_0x2d279e){_0x2d279e=_0x2d279e||0xc8;return function(_0x154107){if(_0x154107){return _0x15a1fc[_0x6c1c('0x19')](_0x2d279e)[_0x6c1c('0x1a')](_0x154107);}};}function respondWithFilteredResult(_0x297c33,_0x41aa74){return function(_0x448f35){if(_0x448f35){var _0x5f3758=typeof _0x41aa74[_0x6c1c('0x1b')]===_0x6c1c('0x1c')&&typeof _0x41aa74['limit']===_0x6c1c('0x1c');var _0x237cac=_0x448f35['count'];var _0x137770=_0x5f3758?0x0:_0x41aa74['offset'];var _0x338dc2=_0x5f3758?_0x448f35[_0x6c1c('0x1d')]:_0x41aa74['offset']+_0x41aa74[_0x6c1c('0x1e')];var _0x59ab38;if(_0x338dc2>=_0x237cac){_0x338dc2=_0x237cac;_0x59ab38=0xc8;}else{_0x59ab38=0xce;}_0x297c33[_0x6c1c('0x19')](_0x59ab38);return _0x297c33[_0x6c1c('0x1f')](_0x6c1c('0x20'),_0x137770+'-'+_0x338dc2+'/'+_0x237cac)[_0x6c1c('0x1a')](_0x448f35);}return null;};}function patchUpdates(_0x1acf7f){return function(_0x1efb19){try{jsonpatch[_0x6c1c('0x21')](_0x1efb19,_0x1acf7f,!![]);}catch(_0x2ed830){return BPromise[_0x6c1c('0x22')](_0x2ed830);}return _0x1efb19[_0x6c1c('0x23')]();};}function saveUpdates(_0x3d2bf3,_0x450b1f){return function(_0x2382c0){if(_0x2382c0){return _0x2382c0[_0x6c1c('0x24')](_0x3d2bf3)[_0x6c1c('0x25')](function(_0x19c269){return _0x19c269;});}return null;};}function removeEntity(_0x2319d3,_0x12c638){return function(_0x3a3f13){if(_0x3a3f13){return _0x3a3f13[_0x6c1c('0x26')]()[_0x6c1c('0x25')](function(){_0x2319d3[_0x6c1c('0x19')](0xcc)[_0x6c1c('0x18')]();});}};}function handleEntityNotFound(_0x7ff10d,_0x18452d){return function(_0x80bc05){if(!_0x80bc05){_0x7ff10d[_0x6c1c('0x17')](0x194);}return _0x80bc05;};}function handleError(_0x1b9d7d,_0x2feaf4){_0x2feaf4=_0x2feaf4||0x1f4;return function(_0x5f4568){logger[_0x6c1c('0x27')](_0x5f4568['stack']);if(_0x5f4568[_0x6c1c('0x28')]){delete _0x5f4568['name'];}_0x1b9d7d[_0x6c1c('0x19')](_0x2feaf4)['send'](_0x5f4568);};}exports[_0x6c1c('0x29')]=function(_0xf557ba,_0x504348){var _0x3b1a4f={},_0x24da4c={},_0x4e13e3={'count':0x0,'rows':[]};var _0x3b319a=_[_0x6c1c('0x2a')](db[_0x6c1c('0x2b')][_0x6c1c('0x2c')],function(_0x4fc279){return{'name':_0x4fc279['fieldName'],'type':_0x4fc279[_0x6c1c('0x2d')][_0x6c1c('0x2e')]};});_0x24da4c[_0x6c1c('0x2f')]=_[_0x6c1c('0x2a')](_0x3b319a,_0x6c1c('0x28'));_0x24da4c[_0x6c1c('0x30')]=_['keys'](_0xf557ba[_0x6c1c('0x30')]);_0x24da4c[_0x6c1c('0x31')]=_['intersection'](_0x24da4c[_0x6c1c('0x2f')],_0x24da4c[_0x6c1c('0x30')]);_0x3b1a4f[_0x6c1c('0x32')]=_[_0x6c1c('0x33')](_0x24da4c['model'],qs[_0x6c1c('0x34')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x3b1a4f['attributes']=_0x3b1a4f[_0x6c1c('0x32')]['length']?_0x3b1a4f[_0x6c1c('0x32')]:_0x24da4c['model'];if(!_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x35')](_0x6c1c('0x36'))){_0x3b1a4f['limit']=qs['limit'](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x1e')]);_0x3b1a4f[_0x6c1c('0x1b')]=qs['offset'](_0xf557ba[_0x6c1c('0x30')]['offset']);}_0x3b1a4f['order']=qs[_0x6c1c('0x37')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x37')]);_0x3b1a4f[_0x6c1c('0x38')]=qs['filters'](_[_0x6c1c('0x39')](_0xf557ba[_0x6c1c('0x30')],_0x24da4c[_0x6c1c('0x31')]),_0x3b319a);if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]){_0x3b1a4f[_0x6c1c('0x38')]=_[_0x6c1c('0x3b')](_0x3b1a4f[_0x6c1c('0x38')],{'$or':_[_0x6c1c('0x2a')](_0x3b319a,function(_0x232508){if(_0x232508['type']!==_0x6c1c('0x3c')){var _0x464549={};_0x464549[_0x232508[_0x6c1c('0x28')]]={'$like':'%'+_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]+'%'};return _0x464549;}})});}_0x3b1a4f=_['merge']({},_0x3b1a4f,_0xf557ba['options']);var _0x549db1={'where':_0x3b1a4f[_0x6c1c('0x38')]};return db['CmHopperFinal']['count'](_0x549db1)[_0x6c1c('0x25')](function(_0x37244e){_0x4e13e3['count']=_0x37244e;if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x3b1a4f[_0x6c1c('0x3e')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x6c1c('0x3f')](_0x3b1a4f);})[_0x6c1c('0x25')](function(_0x502e75){_0x4e13e3[_0x6c1c('0x40')]=_0x502e75;return _0x4e13e3;})['then'](respondWithFilteredResult(_0x504348,_0x3b1a4f))[_0x6c1c('0x41')](handleError(_0x504348,null));};exports[_0x6c1c('0x42')]=function(_0x16a389,_0x174f2c){var _0x10764a={'raw':!![],'where':{'id':_0x16a389[_0x6c1c('0x43')]['id']}},_0x595ba2={};_0x595ba2[_0x6c1c('0x2f')]=_[_0x6c1c('0x44')](db['CmHopperFinal'][_0x6c1c('0x2c')]);_0x595ba2[_0x6c1c('0x30')]=_[_0x6c1c('0x44')](_0x16a389[_0x6c1c('0x30')]);_0x595ba2[_0x6c1c('0x31')]=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],_0x595ba2['query']);_0x10764a['attributes']=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],qs[_0x6c1c('0x34')](_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x10764a[_0x6c1c('0x32')]=_0x10764a[_0x6c1c('0x32')][_0x6c1c('0x45')]?_0x10764a[_0x6c1c('0x32')]:_0x595ba2['model'];if(_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x10764a['include']=[{'all':!![]}];}_0x10764a=_[_0x6c1c('0x3b')]({},_0x10764a,_0x16a389['options']);return db[_0x6c1c('0x2b')][_0x6c1c('0x46')](_0x10764a)[_0x6c1c('0x25')](handleEntityNotFound(_0x174f2c,null))[_0x6c1c('0x25')](respondWithResult(_0x174f2c,null))[_0x6c1c('0x41')](handleError(_0x174f2c,null));};exports['describe']=function(_0x1fe6e8,_0x58d075){return db[_0x6c1c('0x2b')][_0x6c1c('0x47')]()[_0x6c1c('0x25')](respondWithResult(_0x58d075,null))[_0x6c1c('0x41')](handleError(_0x58d075,null));};exports[_0x6c1c('0x24')]=function(_0x26cf7f,_0x52c14d){if(_0x26cf7f[_0x6c1c('0x48')][_0x6c1c('0x49')]){delete _0x26cf7f['body'][_0x6c1c('0x49')];}return db[_0x6c1c('0x2b')][_0x6c1c('0x46')]({'where':{'uniqueid':_0x26cf7f[_0x6c1c('0x43')]['id']}})['then'](handleEntityNotFound(_0x52c14d,null))[_0x6c1c('0x25')](saveUpdates(_0x26cf7f[_0x6c1c('0x48')],null))[_0x6c1c('0x25')](respondWithResult(_0x52c14d,null))['catch'](handleError(_0x52c14d,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x56b367,_0x5714a6,_0x5008b7){return db[_0x6c1c('0x2b')][_0x6c1c('0x3f')]({'raw':![],'where':{'VoiceQueueId':_0x56b367['params']['id']},'attributes':[[db[_0x6c1c('0x4a')]['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db['sequelize']['literal'](_0x6c1c('0x4c')))),_0x6c1c('0x4d')],[db['sequelize']['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x4f')))),_0x6c1c('0x50')],[db['sequelize']['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db['sequelize']['literal'](_0x6c1c('0x51')))),_0x6c1c('0x52')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x53')))),'congestionContacts'],[db['sequelize']['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x6c1c('0x54')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x55')))),_0x6c1c('0x56')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db[_0x6c1c('0x4a')]['fn']('IF',db['sequelize'][_0x6c1c('0x4e')](_0x6c1c('0x57')))),_0x6c1c('0x58')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x59')))),'answeringMachine']]})[_0x6c1c('0x25')](handleEntityNotFound(_0x5714a6,null))[_0x6c1c('0x25')](respondWithResult(_0x5714a6,null))[_0x6c1c('0x41')](handleError(_0x5714a6,null));};exports[_0x6c1c('0x5a')]=function(_0x14f3b5,_0x3229e6,_0xed095f){return db['CmHopperFinal'][_0x6c1c('0x3f')]({'raw':![],'where':{'CampaignId':_0x14f3b5['params']['id']},'attributes':[[db[_0x6c1c('0x4a')]['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')]['literal'](_0x6c1c('0x4c')))),_0x6c1c('0x4d')],[db[_0x6c1c('0x4a')]['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x4f')))),_0x6c1c('0x50')],[db[_0x6c1c('0x4a')]['fn'](_0x6c1c('0x4b'),db['sequelize']['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x51')))),_0x6c1c('0x52')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')]['literal'](_0x6c1c('0x53')))),_0x6c1c('0x5b')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x5c')))),_0x6c1c('0x54')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db['sequelize']['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0x6c1c('0x58')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x59')))),_0x6c1c('0x5d')]]})[_0x6c1c('0x25')](handleEntityNotFound(_0x3229e6,null))[_0x6c1c('0x25')](respondWithResult(_0x3229e6,null))['catch'](handleError(_0x3229e6,null));};exports[_0x6c1c('0x5e')]=function(_0x16b741,_0x204e78,_0x5a919a){return db['VoiceQueue']['find']({'where':{'id':_0x16b741[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0x204e78,null))['then'](function(_0x10e499){var _0x579ca3;if(_0x10e499){_0x579ca3=squel[_0x6c1c('0x5f')]()[_0x6c1c('0x60')](_0x6c1c('0x61'))[_0x6c1c('0x62')](['phone',_0x6c1c('0x63'),_0x6c1c('0x64'),'ListId','VoiceQueueId',_0x6c1c('0x65'),_0x6c1c('0x66')],squel[_0x6c1c('0x67')]()['field'](_0x6c1c('0x68'),_0x6c1c('0x69'))['field']('NOW()','scheduledAt')['field'](_0x6c1c('0x6a'),'ContactId')[_0x6c1c('0x6b')](_0x6c1c('0x6c'),_0x6c1c('0x6d'))['field'](_0x6c1c('0x6e'),_0x6c1c('0x6f'))[_0x6c1c('0x6b')](_0x6c1c('0x70'),_0x6c1c('0x65'))['field'](_0x6c1c('0x70'),'updatedAt')[_0x6c1c('0x71')](_0x6c1c('0x72'))[_0x6c1c('0x38')](_0x6c1c('0x73'),_0x16b741[_0x6c1c('0x43')]['id'][_0x6c1c('0x74')]())[_0x6c1c('0x38')](_0x6c1c('0x75'),_0x16b741['body'][_0x6c1c('0x76')]['toString']())['where'](_0x6c1c('0x77'))[_0x6c1c('0x38')](_0x6c1c('0x78'),squel[_0x6c1c('0x67')]()['field'](_0x6c1c('0x69'))['from'](_0x6c1c('0x61'))['where'](_0x6c1c('0x73'),_0x16b741[_0x6c1c('0x43')]['id'][_0x6c1c('0x74')]()))['where'](_0x6c1c('0x78'),squel[_0x6c1c('0x67')]()[_0x6c1c('0x6b')]('calleridnum')[_0x6c1c('0x71')](_0x6c1c('0x72'))[_0x6c1c('0x38')](_0x6c1c('0x73'),_0x16b741['params']['id'][_0x6c1c('0x74')]())[_0x6c1c('0x38')](_0x6c1c('0x79')))[_0x6c1c('0x7a')](_0x6c1c('0x64')))['toString']();return db[_0x6c1c('0x4a')][_0x6c1c('0x30')](_0x579ca3);}return[];})[_0x6c1c('0x25')](respondWithResult(_0x204e78,null))[_0x6c1c('0x41')](handleError(_0x204e78,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x1ad9e2,_0x44d8c4,_0x33a141){return db['Campaign'][_0x6c1c('0x46')]({'where':{'id':_0x1ad9e2[_0x6c1c('0x43')]['id']}})['then'](handleEntityNotFound(_0x44d8c4,null))[_0x6c1c('0x25')](function(_0x50b56b){var _0x1a493a;if(_0x50b56b){_0x1a493a=squel[_0x6c1c('0x5f')]()[_0x6c1c('0x60')](_0x6c1c('0x61'))['fromQuery']([_0x6c1c('0x69'),_0x6c1c('0x63'),_0x6c1c('0x64'),'ListId',_0x6c1c('0x7b'),_0x6c1c('0x65'),_0x6c1c('0x66')],squel[_0x6c1c('0x67')]()['field'](_0x6c1c('0x68'),_0x6c1c('0x69'))[_0x6c1c('0x6b')]('NOW()',_0x6c1c('0x63'))['field'](_0x6c1c('0x6a'),_0x6c1c('0x64'))[_0x6c1c('0x6b')](_0x6c1c('0x6c'),_0x6c1c('0x6d'))[_0x6c1c('0x6b')](_0x6c1c('0x7c'),_0x6c1c('0x7b'))['field'](_0x6c1c('0x70'),'createdAt')[_0x6c1c('0x6b')](_0x6c1c('0x70'),_0x6c1c('0x66'))[_0x6c1c('0x71')]('cm_hopper_final')[_0x6c1c('0x38')](_0x6c1c('0x7d'),_0x1ad9e2[_0x6c1c('0x43')]['id']['toString']())[_0x6c1c('0x38')](_0x6c1c('0x75'),_0x1ad9e2['body']['state'][_0x6c1c('0x74')]())[_0x6c1c('0x38')](_0x6c1c('0x77'))[_0x6c1c('0x38')](_0x6c1c('0x78'),squel[_0x6c1c('0x67')]()[_0x6c1c('0x6b')](_0x6c1c('0x69'))[_0x6c1c('0x71')](_0x6c1c('0x61'))[_0x6c1c('0x38')](_0x6c1c('0x7d'),_0x1ad9e2['params']['id'][_0x6c1c('0x74')]()))[_0x6c1c('0x38')](_0x6c1c('0x78'),squel[_0x6c1c('0x67')]()[_0x6c1c('0x6b')](_0x6c1c('0x7e'))[_0x6c1c('0x71')]('cm_hopper_final')[_0x6c1c('0x38')]('CampaignId\x20=\x20?',_0x1ad9e2['params']['id'][_0x6c1c('0x74')]())[_0x6c1c('0x38')](_0x6c1c('0x79')))[_0x6c1c('0x7a')](_0x6c1c('0x64')))[_0x6c1c('0x74')]();return db[_0x6c1c('0x4a')][_0x6c1c('0x30')](_0x1a493a);}return[];})[_0x6c1c('0x25')](respondWithResult(_0x44d8c4,null))[_0x6c1c('0x41')](handleError(_0x44d8c4,null));};exports['checkContactHopper']=function(_0x3e40b6,_0x654041,_0x1a0da8){return db[_0x6c1c('0x7f')][_0x6c1c('0x80')]({'where':{'VoiceQueueId':_0x3e40b6[_0x6c1c('0x48')][_0x6c1c('0x6f')],'CampaignId':_0x3e40b6[_0x6c1c('0x48')]['CampaignId'],'ContactId':_0x3e40b6[_0x6c1c('0x48')][_0x6c1c('0x64')]}})[_0x6c1c('0x25')](handleEntityNotFound(_0x654041,null))[_0x6c1c('0x25')](function(_0x385629){if(_0x385629){return _0x385629;}return null;})[_0x6c1c('0x25')](respondWithResult(_0x654041,null))[_0x6c1c('0x41')](handleError(_0x654041,null));};
\ No newline at end of file
index 317b67e..6e1743e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc824=['bluebird','request-promise','path','rimraf','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x3f83dc,_0x5c8047){var _0x3876b8=function(_0x1f8423){while(--_0x1f8423){_0x3f83dc['push'](_0x3f83dc['shift']());}};_0x3876b8(++_0x5c8047);}(_0xc824,0x1be));var _0x4c82=function(_0x4df42c,_0x47bd58){_0x4df42c=_0x4df42c-0x0;var _0x49b958=_0xc824[_0x4df42c];return _0x49b958;};'use strict';var _=require(_0x4c82('0x0'));var util=require('util');var logger=require(_0x4c82('0x1'))(_0x4c82('0x2'));var moment=require(_0x4c82('0x3'));var BPromise=require(_0x4c82('0x4'));var rp=require(_0x4c82('0x5'));var fs=require('fs');var path=require(_0x4c82('0x6'));var rimraf=require(_0x4c82('0x7'));var config=require('../../config/environment');var attributes=require(_0x4c82('0x8'));module[_0x4c82('0x9')]=function(_0x32d15a,_0x58d8ac){return _0x32d15a[_0x4c82('0xa')](_0x4c82('0xb'),attributes,{'tableName':_0x4c82('0xc'),'paranoid':![],'indexes':[{'name':_0x4c82('0xd'),'fields':[_0x4c82('0xd')]},{'name':_0x4c82('0xe'),'fields':[_0x4c82('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf1f6=['cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','rimraf','define','CmHopperFinal'];(function(_0x36da7f,_0x5ac4cf){var _0x295f79=function(_0x36c3fd){while(--_0x36c3fd){_0x36da7f['push'](_0x36da7f['shift']());}};_0x295f79(++_0x5ac4cf);}(_0xf1f6,0xab));var _0x6f1f=function(_0x5a12dd,_0x4d14f1){_0x5a12dd=_0x5a12dd-0x0;var _0x29c8c8=_0xf1f6[_0x5a12dd];return _0x29c8c8;};'use strict';var _=require(_0x6f1f('0x0'));var util=require(_0x6f1f('0x1'));var logger=require(_0x6f1f('0x2'))(_0x6f1f('0x3'));var moment=require(_0x6f1f('0x4'));var BPromise=require('bluebird');var rp=require(_0x6f1f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6f1f('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module['exports']=function(_0x3f45cb,_0x400b4d){return _0x3f45cb[_0x6f1f('0x7')](_0x6f1f('0x8'),attributes,{'tableName':_0x6f1f('0x9'),'paranoid':![],'indexes':[{'name':_0x6f1f('0xa'),'fields':[_0x6f1f('0xa')]},{'name':'uniqueid','fields':[_0x6f1f('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index c861d55..541c7f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x52a12e,_0x98bb2){var _0x2b33f4=function(_0x39fff8){while(--_0x39fff8){_0x52a12e['push'](_0x52a12e['shift']());}};_0x2b33f4(++_0x98bb2);}(_0x7a54,0x106));var _0x47a5=function(_0x44ef70,_0x25f042){_0x44ef70=_0x44ef70-0x0;var _0x40b638=_0x7a54[_0x44ef70];return _0x40b638;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};
\ No newline at end of file
+var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x1ead71,_0x35c043){var _0x50258b=function(_0x95710a){while(--_0x95710a){_0x1ead71['push'](_0x1ead71['shift']());}};_0x50258b(++_0x35c043);}(_0xb10b,0x12a));var _0xbb10=function(_0x12aba8,_0x40a036){_0x12aba8=_0x12aba8-0x0;var _0x2aac66=_0xb10b[_0x12aba8];return _0x2aac66;};'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
index f6441e0..2832d97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20d8=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','update','exports','multer','util'];(function(_0x2b7c80,_0x1c7aa8){var _0x3aa76f=function(_0x350ab8){while(--_0x350ab8){_0x2b7c80['push'](_0x2b7c80['shift']());}};_0x3aa76f(++_0x1c7aa8);}(_0x20d8,0xee));var _0x820d=function(_0x11b6b8,_0x276037){_0x11b6b8=_0x11b6b8-0x0;var _0x27a952=_0x20d8[_0x11b6b8];return _0x27a952;};'use strict';var multer=require(_0x820d('0x0'));var util=require(_0x820d('0x1'));var path=require(_0x820d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x820d('0x3')]();var fs_extra=require(_0x820d('0x4'));var auth=require(_0x820d('0x5'));var interaction=require(_0x820d('0x6'));var config=require(_0x820d('0x7'));var controller=require('./cmHopperFinal.controller');router[_0x820d('0x8')]('/',auth[_0x820d('0x9')](),controller[_0x820d('0xa')]);router['get'](_0x820d('0xb'),auth[_0x820d('0x9')](),controller[_0x820d('0xc')]);router['get'](_0x820d('0xd'),auth['isAuthenticated'](),controller[_0x820d('0xe')]);router['get']('/voice/queue/countAttributes/:id',auth[_0x820d('0x9')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x820d('0x8')](_0x820d('0xf'),auth[_0x820d('0x9')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x820d('0x10')](_0x820d('0x11'),auth['isAuthenticated'](),controller[_0x820d('0x12')]);router['post'](_0x820d('0x13'),auth[_0x820d('0x9')](),controller[_0x820d('0x14')]);router[_0x820d('0x10')](_0x820d('0x15'),auth[_0x820d('0x9')](),controller['checkContactHopper']);router['put'](_0x820d('0xd'),auth['isAuthenticated'](),controller[_0x820d('0x16')]);module[_0x820d('0x17')]=router;
\ No newline at end of file
+var _0xdb29=['countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','put','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','describe','/:id','show','/voice/queue/countAttributes/:id','isAuthenticated'];(function(_0x21b74b,_0x543c76){var _0x518cc6=function(_0x5b3010){while(--_0x5b3010){_0x21b74b['push'](_0x21b74b['shift']());}};_0x518cc6(++_0x543c76);}(_0xdb29,0xee));var _0x9db2=function(_0x408949,_0x38b46d){_0x408949=_0x408949-0x0;var _0x1324ea=_0xdb29[_0x408949];return _0x1324ea;};'use strict';var multer=require(_0x9db2('0x0'));var util=require(_0x9db2('0x1'));var path=require('path');var timeout=require(_0x9db2('0x2'));var express=require(_0x9db2('0x3'));var router=express[_0x9db2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9db2('0x5'));var interaction=require(_0x9db2('0x6'));var config=require(_0x9db2('0x7'));var controller=require(_0x9db2('0x8'));router[_0x9db2('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9db2('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x9db2('0xa')]);router[_0x9db2('0x9')](_0x9db2('0xb'),auth['isAuthenticated'](),controller[_0x9db2('0xc')]);router[_0x9db2('0x9')](_0x9db2('0xd'),auth[_0x9db2('0xe')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x9db2('0x9')]('/campaign/countAttributes/:id',auth[_0x9db2('0xe')](),controller[_0x9db2('0xf')]);router[_0x9db2('0x10')](_0x9db2('0x11'),auth['isAuthenticated'](),controller[_0x9db2('0x12')]);router[_0x9db2('0x10')](_0x9db2('0x13'),auth[_0x9db2('0xe')](),controller[_0x9db2('0x14')]);router['post']('/checkContactHopper',auth[_0x9db2('0xe')](),controller['checkContactHopper']);router[_0x9db2('0x15')]('/:id',auth[_0x9db2('0xe')](),controller['update']);module[_0x9db2('0x16')]=router;
\ No newline at end of file
index fe3b572..67b53a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae3d=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x273584,_0x40594e){var _0x434a40=function(_0x48bca4){while(--_0x48bca4){_0x273584['push'](_0x273584['shift']());}};_0x434a40(++_0x40594e);}(_0xae3d,0x1a2));var _0xdae3=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0xae3d[_0x32b542];return _0x554d54;};'use strict';var Sequelize=require(_0xdae3('0x0'));module[_0xdae3('0x1')]={'state':{'type':Sequelize[_0xdae3('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xdae3('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xdae3('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xdae3('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xdae3('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xdae3('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xdae3('0x3')]},'calleridnum':{'type':Sequelize[_0xdae3('0x3')]},'calleridname':{'type':Sequelize[_0xdae3('0x3')]},'starttime':{'type':Sequelize[_0xdae3('0x4')]},'responsetime':{'type':Sequelize[_0xdae3('0x4')]},'answertime':{'type':Sequelize[_0xdae3('0x4')]},'droptime':{'type':Sequelize[_0xdae3('0x4')]},'endtime':{'type':Sequelize[_0xdae3('0x4')]},'ringtime':{'type':Sequelize[_0xdae3('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xdae3('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xdae3('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xdae3('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xdae3('0x3')]},'membername':{'type':Sequelize[_0xdae3('0x3')]},'reason':{'type':Sequelize[_0xdae3('0x3')]},'amd':{'type':Sequelize[_0xdae3('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xdae3('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xdae3('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xdae3('0x4')]},'recallme':{'type':Sequelize[_0xdae3('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xdae3('0x4')]},'edited':{'type':Sequelize[_0xdae3('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xdae3('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xdae3('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xdae3('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xdae3('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xdae3('0x3')]}};
\ No newline at end of file
+var _0xee20=['BOOLEAN','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x66171,_0xfa776b){var _0x49bb58=function(_0x12a81f){while(--_0x12a81f){_0x66171['push'](_0x66171['shift']());}};_0x49bb58(++_0xfa776b);}(_0xee20,0x1c3));var _0x0ee2=function(_0x4b31c5,_0x24a9a9){_0x4b31c5=_0x4b31c5-0x0;var _0x4d844b=_0xee20[_0x4b31c5];return _0x4d844b;};'use strict';var Sequelize=require(_0x0ee2('0x0'));module[_0x0ee2('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x0ee2('0x2')]},'scheduledat':{'type':Sequelize[_0x0ee2('0x3')]},'countbusyretry':{'type':Sequelize[_0x0ee2('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0ee2('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x0ee2('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x0ee2('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x0ee2('0x3')]},'droptime':{'type':Sequelize[_0x0ee2('0x3')]},'endtime':{'type':Sequelize[_0x0ee2('0x3')]},'ringtime':{'type':Sequelize[_0x0ee2('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x0ee2('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x0ee2('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x0ee2('0x2')]},'campaigntype':{'type':Sequelize[_0x0ee2('0x2')]},'membername':{'type':Sequelize[_0x0ee2('0x2')]},'reason':{'type':Sequelize[_0x0ee2('0x2')]},'amd':{'type':Sequelize[_0x0ee2('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x0ee2('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x0ee2('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0ee2('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0ee2('0x3')]},'recallme':{'type':Sequelize[_0x0ee2('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x0ee2('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x0ee2('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0ee2('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0ee2('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0ee2('0x4')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 49e482a..abf1cb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1971=['length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','CmHopperHistory','include','findAll','rows','keys','includeAll','options','catch','create','body','describe','update','uniqueid','find','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','key','model','query','attributes','intersection','fields'];(function(_0x1217cf,_0x1171dc){var _0x280148=function(_0x1de5f3){while(--_0x1de5f3){_0x1217cf['push'](_0x1217cf['shift']());}};_0x280148(++_0x1171dc);}(_0x1971,0x18a));var _0x1197=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x1971[_0x13ea00];return _0x1f7347;};'use strict';var emlformat=require(_0x1197('0x0'));var rimraf=require(_0x1197('0x1'));var zipdir=require(_0x1197('0x2'));var jsonpatch=require(_0x1197('0x3'));var rp=require('request-promise');var moment=require(_0x1197('0x4'));var BPromise=require(_0x1197('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1197('0x6'));var sox=require(_0x1197('0x7'));var csv=require(_0x1197('0x8'));var ejs=require(_0x1197('0x9'));var fs=require('fs');var fs_extra=require(_0x1197('0xa'));var _=require(_0x1197('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1197('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1197('0x8'));var querystring=require(_0x1197('0xd'));var Papa=require(_0x1197('0xe'));var Redis=require(_0x1197('0xf'));var authService=require(_0x1197('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1197('0x11'));var logger=require(_0x1197('0x12'))('api');var utils=require(_0x1197('0x13'));var config=require(_0x1197('0x14'));var licenseUtil=require(_0x1197('0x15'));var db=require(_0x1197('0x16'))['db'];function respondWithStatusCode(_0x523cbf,_0xc37231){_0xc37231=_0xc37231||0xcc;return function(_0x9834f8){if(_0x9834f8){return _0x523cbf[_0x1197('0x17')](_0xc37231);}return _0x523cbf[_0x1197('0x18')](_0xc37231)[_0x1197('0x19')]();};}function respondWithResult(_0x29ed1d,_0x5245c0){_0x5245c0=_0x5245c0||0xc8;return function(_0x36a26d){if(_0x36a26d){return _0x29ed1d[_0x1197('0x18')](_0x5245c0)[_0x1197('0x1a')](_0x36a26d);}};}function respondWithFilteredResult(_0x24283a,_0x57c2c1){return function(_0x4fe7cd){if(_0x4fe7cd){var _0x53db25=typeof _0x57c2c1[_0x1197('0x1b')]===_0x1197('0x1c')&&typeof _0x57c2c1[_0x1197('0x1d')]===_0x1197('0x1c');var _0x2070f4=_0x4fe7cd[_0x1197('0x1e')];var _0x17b1ce=_0x53db25?0x0:_0x57c2c1['offset'];var _0x67c54=_0x53db25?_0x4fe7cd[_0x1197('0x1e')]:_0x57c2c1[_0x1197('0x1b')]+_0x57c2c1[_0x1197('0x1d')];var _0x345e49;if(_0x67c54>=_0x2070f4){_0x67c54=_0x2070f4;_0x345e49=0xc8;}else{_0x345e49=0xce;}_0x24283a[_0x1197('0x18')](_0x345e49);return _0x24283a[_0x1197('0x1f')](_0x1197('0x20'),_0x17b1ce+'-'+_0x67c54+'/'+_0x2070f4)[_0x1197('0x1a')](_0x4fe7cd);}return null;};}function patchUpdates(_0x224f43){return function(_0x96c9f3){try{jsonpatch[_0x1197('0x21')](_0x96c9f3,_0x224f43,!![]);}catch(_0x1f49e1){return BPromise[_0x1197('0x22')](_0x1f49e1);}return _0x96c9f3[_0x1197('0x23')]();};}function saveUpdates(_0x13bdd6,_0x3fb90){return function(_0x27b294){if(_0x27b294){return _0x27b294['update'](_0x13bdd6)[_0x1197('0x24')](function(_0x511505){return _0x511505;});}return null;};}function removeEntity(_0x11ca2c,_0x413093){return function(_0x342549){if(_0x342549){return _0x342549[_0x1197('0x25')]()[_0x1197('0x24')](function(){_0x11ca2c[_0x1197('0x18')](0xcc)[_0x1197('0x19')]();});}};}function handleEntityNotFound(_0xfb133a,_0x303c7a){return function(_0x1837a0){if(!_0x1837a0){_0xfb133a['sendStatus'](0x194);}return _0x1837a0;};}function handleError(_0xdc2799,_0x3bc033){_0x3bc033=_0x3bc033||0x1f4;return function(_0x444492){logger[_0x1197('0x26')](_0x444492[_0x1197('0x27')]);if(_0x444492[_0x1197('0x28')]){delete _0x444492[_0x1197('0x28')];}_0xdc2799[_0x1197('0x18')](_0x3bc033)[_0x1197('0x29')](_0x444492);};}exports[_0x1197('0x2a')]=function(_0x42284b,_0x1a883a){var _0x2a9e62={},_0x11f002={},_0x58b398={'count':0x0,'rows':[]};var _0x14af5a=_[_0x1197('0x2b')](db['CmHopperHistory']['rawAttributes'],function(_0x52f21a){return{'name':_0x52f21a['fieldName'],'type':_0x52f21a['type'][_0x1197('0x2c')]};});_0x11f002[_0x1197('0x2d')]=_[_0x1197('0x2b')](_0x14af5a,_0x1197('0x28'));_0x11f002[_0x1197('0x2e')]=_['keys'](_0x42284b['query']);_0x11f002['filters']=_['intersection'](_0x11f002[_0x1197('0x2d')],_0x11f002[_0x1197('0x2e')]);_0x2a9e62[_0x1197('0x2f')]=_[_0x1197('0x30')](_0x11f002[_0x1197('0x2d')],qs[_0x1197('0x31')](_0x42284b['query']['fields']));_0x2a9e62['attributes']=_0x2a9e62[_0x1197('0x2f')][_0x1197('0x32')]?_0x2a9e62[_0x1197('0x2f')]:_0x11f002['model'];if(!_0x42284b[_0x1197('0x2e')][_0x1197('0x33')]('nolimit')){_0x2a9e62['limit']=qs[_0x1197('0x1d')](_0x42284b[_0x1197('0x2e')][_0x1197('0x1d')]);_0x2a9e62['offset']=qs[_0x1197('0x1b')](_0x42284b[_0x1197('0x2e')]['offset']);}_0x2a9e62[_0x1197('0x34')]=qs['sort'](_0x42284b['query'][_0x1197('0x35')]);_0x2a9e62[_0x1197('0x36')]=qs[_0x1197('0x37')](_[_0x1197('0x38')](_0x42284b['query'],_0x11f002[_0x1197('0x37')]),_0x14af5a);if(_0x42284b['query'][_0x1197('0x39')]){_0x2a9e62[_0x1197('0x36')]=_['merge'](_0x2a9e62['where'],{'$or':_['map'](_0x14af5a,function(_0x523a19){if(_0x523a19['type']!=='VIRTUAL'){var _0x45a99c={};_0x45a99c[_0x523a19[_0x1197('0x28')]]={'$like':'%'+_0x42284b[_0x1197('0x2e')][_0x1197('0x39')]+'%'};return _0x45a99c;}})});}_0x2a9e62=_[_0x1197('0x3a')]({},_0x2a9e62,_0x42284b['options']);var _0x494c00={'where':_0x2a9e62[_0x1197('0x36')]};return db[_0x1197('0x3b')]['count'](_0x494c00)[_0x1197('0x24')](function(_0x9154db){_0x58b398[_0x1197('0x1e')]=_0x9154db;if(_0x42284b[_0x1197('0x2e')]['includeAll']){_0x2a9e62[_0x1197('0x3c')]=[{'all':!![]}];}return db[_0x1197('0x3b')][_0x1197('0x3d')](_0x2a9e62);})[_0x1197('0x24')](function(_0x4897ca){_0x58b398[_0x1197('0x3e')]=_0x4897ca;return _0x58b398;})[_0x1197('0x24')](respondWithFilteredResult(_0x1a883a,_0x2a9e62))['catch'](handleError(_0x1a883a,null));};exports['show']=function(_0x43f5ab,_0x3a14a3){var _0x1cb294={'raw':!![],'where':{'id':_0x43f5ab['params']['id']}},_0xea2d54={};_0xea2d54[_0x1197('0x2d')]=_[_0x1197('0x3f')](db[_0x1197('0x3b')]['rawAttributes']);_0xea2d54[_0x1197('0x2e')]=_[_0x1197('0x3f')](_0x43f5ab[_0x1197('0x2e')]);_0xea2d54[_0x1197('0x37')]=_[_0x1197('0x30')](_0xea2d54[_0x1197('0x2d')],_0xea2d54[_0x1197('0x2e')]);_0x1cb294[_0x1197('0x2f')]=_[_0x1197('0x30')](_0xea2d54[_0x1197('0x2d')],qs['fields'](_0x43f5ab['query'][_0x1197('0x31')]));_0x1cb294[_0x1197('0x2f')]=_0x1cb294[_0x1197('0x2f')][_0x1197('0x32')]?_0x1cb294[_0x1197('0x2f')]:_0xea2d54[_0x1197('0x2d')];if(_0x43f5ab[_0x1197('0x2e')][_0x1197('0x40')]){_0x1cb294[_0x1197('0x3c')]=[{'all':!![]}];}_0x1cb294=_['merge']({},_0x1cb294,_0x43f5ab[_0x1197('0x41')]);return db['CmHopperHistory']['find'](_0x1cb294)[_0x1197('0x24')](handleEntityNotFound(_0x3a14a3,null))[_0x1197('0x24')](respondWithResult(_0x3a14a3,null))[_0x1197('0x42')](handleError(_0x3a14a3,null));};exports[_0x1197('0x43')]=function(_0x4814e4,_0x97adc7){return db[_0x1197('0x3b')][_0x1197('0x43')](_0x4814e4[_0x1197('0x44')],{})['then'](respondWithResult(_0x97adc7,0xc9))[_0x1197('0x42')](handleError(_0x97adc7,null));};exports[_0x1197('0x45')]=function(_0x2f4332,_0x5dd315){return db[_0x1197('0x3b')][_0x1197('0x45')]()[_0x1197('0x24')](respondWithResult(_0x5dd315,null))[_0x1197('0x42')](handleError(_0x5dd315,null));};exports[_0x1197('0x46')]=function(_0xc193e0,_0x2d1f94){if(_0xc193e0['body'][_0x1197('0x47')]){delete _0xc193e0[_0x1197('0x44')][_0x1197('0x47')];}return db[_0x1197('0x3b')][_0x1197('0x48')]({'where':{'uniqueid':_0xc193e0[_0x1197('0x49')]['id']}})[_0x1197('0x24')](handleEntityNotFound(_0x2d1f94,null))[_0x1197('0x24')](saveUpdates(_0xc193e0[_0x1197('0x44')],null))[_0x1197('0x24')](respondWithResult(_0x2d1f94,null))[_0x1197('0x42')](handleError(_0x2d1f94,null));};
\ No newline at end of file
+var _0x1f60=['eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','error','name','send','index','CmHopperHistory','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','keys','include','find','create','body','catch','describe','uniqueid','params'];(function(_0x49cf39,_0x36e285){var _0x3ec108=function(_0xe8f1c0){while(--_0xe8f1c0){_0x49cf39['push'](_0x49cf39['shift']());}};_0x3ec108(++_0x36e285);}(_0x1f60,0x94));var _0x01f6=function(_0x54d183,_0x5cb336){_0x54d183=_0x54d183-0x0;var _0x23c6ab=_0x1f60[_0x54d183];return _0x23c6ab;};'use strict';var emlformat=require(_0x01f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x01f6('0x1'));var jsonpatch=require(_0x01f6('0x2'));var rp=require('request-promise');var moment=require(_0x01f6('0x3'));var BPromise=require(_0x01f6('0x4'));var Mustache=require(_0x01f6('0x5'));var util=require('util');var path=require(_0x01f6('0x6'));var sox=require(_0x01f6('0x7'));var csv=require(_0x01f6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x01f6('0x9'));var _=require(_0x01f6('0xa'));var squel=require('squel');var crypto=require(_0x01f6('0xb'));var jsforce=require(_0x01f6('0xc'));var deskjs=require(_0x01f6('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x01f6('0xe'));var authService=require(_0x01f6('0xf'));var qs=require(_0x01f6('0x10'));var as=require(_0x01f6('0x11'));var hardwareService=require(_0x01f6('0x12'));var logger=require(_0x01f6('0x13'))(_0x01f6('0x14'));var utils=require(_0x01f6('0x15'));var config=require(_0x01f6('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x307b5c,_0x33ac5e){_0x33ac5e=_0x33ac5e||0xcc;return function(_0x10026a){if(_0x10026a){return _0x307b5c[_0x01f6('0x17')](_0x33ac5e);}return _0x307b5c[_0x01f6('0x18')](_0x33ac5e)[_0x01f6('0x19')]();};}function respondWithResult(_0x392600,_0x4d5aa1){_0x4d5aa1=_0x4d5aa1||0xc8;return function(_0x8b1a76){if(_0x8b1a76){return _0x392600[_0x01f6('0x18')](_0x4d5aa1)[_0x01f6('0x1a')](_0x8b1a76);}};}function respondWithFilteredResult(_0x3b8767,_0x581194){return function(_0x27b53b){if(_0x27b53b){var _0x29bd9f=typeof _0x581194[_0x01f6('0x1b')]===_0x01f6('0x1c')&&typeof _0x581194[_0x01f6('0x1d')]===_0x01f6('0x1c');var _0x408ccc=_0x27b53b[_0x01f6('0x1e')];var _0xc030ec=_0x29bd9f?0x0:_0x581194[_0x01f6('0x1b')];var _0x3217e0=_0x29bd9f?_0x27b53b[_0x01f6('0x1e')]:_0x581194['offset']+_0x581194['limit'];var _0x19154d;if(_0x3217e0>=_0x408ccc){_0x3217e0=_0x408ccc;_0x19154d=0xc8;}else{_0x19154d=0xce;}_0x3b8767[_0x01f6('0x18')](_0x19154d);return _0x3b8767['set']('Content-Range',_0xc030ec+'-'+_0x3217e0+'/'+_0x408ccc)['json'](_0x27b53b);}return null;};}function patchUpdates(_0xfb13af){return function(_0x4eb8d4){try{jsonpatch[_0x01f6('0x1f')](_0x4eb8d4,_0xfb13af,!![]);}catch(_0x4a079e){return BPromise[_0x01f6('0x20')](_0x4a079e);}return _0x4eb8d4[_0x01f6('0x21')]();};}function saveUpdates(_0xb52a5a,_0x4d4e70){return function(_0x3d1afe){if(_0x3d1afe){return _0x3d1afe[_0x01f6('0x22')](_0xb52a5a)[_0x01f6('0x23')](function(_0x73c8e4){return _0x73c8e4;});}return null;};}function removeEntity(_0x57970c,_0x42e2ad){return function(_0x352976){if(_0x352976){return _0x352976['destroy']()[_0x01f6('0x23')](function(){_0x57970c[_0x01f6('0x18')](0xcc)[_0x01f6('0x19')]();});}};}function handleEntityNotFound(_0x36f651,_0x3db0fa){return function(_0x3164ae){if(!_0x3164ae){_0x36f651[_0x01f6('0x17')](0x194);}return _0x3164ae;};}function handleError(_0x193994,_0x324f0){_0x324f0=_0x324f0||0x1f4;return function(_0x28f6b3){logger[_0x01f6('0x24')](_0x28f6b3['stack']);if(_0x28f6b3[_0x01f6('0x25')]){delete _0x28f6b3[_0x01f6('0x25')];}_0x193994[_0x01f6('0x18')](_0x324f0)[_0x01f6('0x26')](_0x28f6b3);};}exports[_0x01f6('0x27')]=function(_0x28140c,_0x3d2944){var _0x2f909e={},_0x47166f={},_0x5270ee={'count':0x0,'rows':[]};var _0x3abf26=_['map'](db[_0x01f6('0x28')][_0x01f6('0x29')],function(_0x212bb5){return{'name':_0x212bb5[_0x01f6('0x2a')],'type':_0x212bb5[_0x01f6('0x2b')][_0x01f6('0x2c')]};});_0x47166f[_0x01f6('0x2d')]=_[_0x01f6('0x2e')](_0x3abf26,'name');_0x47166f[_0x01f6('0x2f')]=_['keys'](_0x28140c['query']);_0x47166f[_0x01f6('0x30')]=_[_0x01f6('0x31')](_0x47166f[_0x01f6('0x2d')],_0x47166f['query']);_0x2f909e[_0x01f6('0x32')]=_[_0x01f6('0x31')](_0x47166f[_0x01f6('0x2d')],qs[_0x01f6('0x33')](_0x28140c[_0x01f6('0x2f')][_0x01f6('0x33')]));_0x2f909e[_0x01f6('0x32')]=_0x2f909e[_0x01f6('0x32')][_0x01f6('0x34')]?_0x2f909e[_0x01f6('0x32')]:_0x47166f[_0x01f6('0x2d')];if(!_0x28140c['query'][_0x01f6('0x35')](_0x01f6('0x36'))){_0x2f909e[_0x01f6('0x1d')]=qs[_0x01f6('0x1d')](_0x28140c['query'][_0x01f6('0x1d')]);_0x2f909e[_0x01f6('0x1b')]=qs[_0x01f6('0x1b')](_0x28140c[_0x01f6('0x2f')][_0x01f6('0x1b')]);}_0x2f909e['order']=qs['sort'](_0x28140c['query'][_0x01f6('0x37')]);_0x2f909e[_0x01f6('0x38')]=qs[_0x01f6('0x30')](_[_0x01f6('0x39')](_0x28140c[_0x01f6('0x2f')],_0x47166f['filters']),_0x3abf26);if(_0x28140c[_0x01f6('0x2f')][_0x01f6('0x3a')]){_0x2f909e[_0x01f6('0x38')]=_[_0x01f6('0x3b')](_0x2f909e['where'],{'$or':_[_0x01f6('0x2e')](_0x3abf26,function(_0x253f3b){if(_0x253f3b[_0x01f6('0x2b')]!==_0x01f6('0x3c')){var _0x24b08e={};_0x24b08e[_0x253f3b['name']]={'$like':'%'+_0x28140c[_0x01f6('0x2f')][_0x01f6('0x3a')]+'%'};return _0x24b08e;}})});}_0x2f909e=_[_0x01f6('0x3b')]({},_0x2f909e,_0x28140c[_0x01f6('0x3d')]);var _0x404851={'where':_0x2f909e[_0x01f6('0x38')]};return db['CmHopperHistory'][_0x01f6('0x1e')](_0x404851)[_0x01f6('0x23')](function(_0x44cbee){_0x5270ee[_0x01f6('0x1e')]=_0x44cbee;if(_0x28140c[_0x01f6('0x2f')][_0x01f6('0x3e')]){_0x2f909e['include']=[{'all':!![]}];}return db[_0x01f6('0x28')][_0x01f6('0x3f')](_0x2f909e);})['then'](function(_0x9cfd9a){_0x5270ee[_0x01f6('0x40')]=_0x9cfd9a;return _0x5270ee;})[_0x01f6('0x23')](respondWithFilteredResult(_0x3d2944,_0x2f909e))['catch'](handleError(_0x3d2944,null));};exports['show']=function(_0x37a01b,_0x1fb784){var _0x199eca={'raw':!![],'where':{'id':_0x37a01b['params']['id']}},_0x4689f8={};_0x4689f8['model']=_[_0x01f6('0x41')](db[_0x01f6('0x28')][_0x01f6('0x29')]);_0x4689f8[_0x01f6('0x2f')]=_[_0x01f6('0x41')](_0x37a01b[_0x01f6('0x2f')]);_0x4689f8[_0x01f6('0x30')]=_['intersection'](_0x4689f8[_0x01f6('0x2d')],_0x4689f8['query']);_0x199eca['attributes']=_[_0x01f6('0x31')](_0x4689f8[_0x01f6('0x2d')],qs[_0x01f6('0x33')](_0x37a01b[_0x01f6('0x2f')]['fields']));_0x199eca['attributes']=_0x199eca[_0x01f6('0x32')][_0x01f6('0x34')]?_0x199eca[_0x01f6('0x32')]:_0x4689f8[_0x01f6('0x2d')];if(_0x37a01b['query']['includeAll']){_0x199eca[_0x01f6('0x42')]=[{'all':!![]}];}_0x199eca=_['merge']({},_0x199eca,_0x37a01b[_0x01f6('0x3d')]);return db[_0x01f6('0x28')][_0x01f6('0x43')](_0x199eca)[_0x01f6('0x23')](handleEntityNotFound(_0x1fb784,null))[_0x01f6('0x23')](respondWithResult(_0x1fb784,null))['catch'](handleError(_0x1fb784,null));};exports[_0x01f6('0x44')]=function(_0x287cce,_0x903929){return db[_0x01f6('0x28')][_0x01f6('0x44')](_0x287cce[_0x01f6('0x45')],{})[_0x01f6('0x23')](respondWithResult(_0x903929,0xc9))[_0x01f6('0x46')](handleError(_0x903929,null));};exports[_0x01f6('0x47')]=function(_0x5f1a83,_0x524b64){return db[_0x01f6('0x28')][_0x01f6('0x47')]()[_0x01f6('0x23')](respondWithResult(_0x524b64,null))[_0x01f6('0x46')](handleError(_0x524b64,null));};exports['update']=function(_0x4525a6,_0x5e47da){if(_0x4525a6[_0x01f6('0x45')][_0x01f6('0x48')]){delete _0x4525a6['body'][_0x01f6('0x48')];}return db['CmHopperHistory'][_0x01f6('0x43')]({'where':{'uniqueid':_0x4525a6[_0x01f6('0x49')]['id']}})['then'](handleEntityNotFound(_0x5e47da,null))[_0x01f6('0x23')](saveUpdates(_0x4525a6[_0x01f6('0x45')],null))[_0x01f6('0x23')](respondWithResult(_0x5e47da,null))[_0x01f6('0x46')](handleError(_0x5e47da,null));};
\ No newline at end of file
index c70027c..b3d4206 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50e5=['cm_hopper_history','endtime','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define'];(function(_0x1abc8d,_0x1e9760){var _0xa3c72f=function(_0x14addc){while(--_0x14addc){_0x1abc8d['push'](_0x1abc8d['shift']());}};_0xa3c72f(++_0x1e9760);}(_0x50e5,0xb7));var _0x550e=function(_0x441e59,_0x290d77){_0x441e59=_0x441e59-0x0;var _0x46e468=_0x50e5[_0x441e59];return _0x46e468;};'use strict';var _=require(_0x550e('0x0'));var util=require(_0x550e('0x1'));var logger=require('../../config/logger')(_0x550e('0x2'));var moment=require(_0x550e('0x3'));var BPromise=require(_0x550e('0x4'));var rp=require(_0x550e('0x5'));var fs=require('fs');var path=require(_0x550e('0x6'));var rimraf=require(_0x550e('0x7'));var config=require(_0x550e('0x8'));var attributes=require(_0x550e('0x9'));module[_0x550e('0xa')]=function(_0x3d8c9b,_0x863e3b){return _0x3d8c9b[_0x550e('0xb')]('CmHopperHistory',attributes,{'tableName':_0x550e('0xc'),'paranoid':![],'indexes':[{'name':_0x550e('0xd'),'fields':['endtime']},{'name':_0x550e('0xe'),'fields':[_0x550e('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7e2=['../../config/environment','./cmHopperHistory.attributes','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','../../config/logger','moment','request-promise','rimraf'];(function(_0x21e56e,_0x51ae6d){var _0x5b89ef=function(_0x3ba716){while(--_0x3ba716){_0x21e56e['push'](_0x21e56e['shift']());}};_0x5b89ef(++_0x51ae6d);}(_0xb7e2,0x103));var _0x2b7e=function(_0x117188,_0x1ee511){_0x117188=_0x117188-0x0;var _0xf94710=_0xb7e2[_0x117188];return _0xf94710;};'use strict';var _=require(_0x2b7e('0x0'));var util=require('util');var logger=require(_0x2b7e('0x1'))('api');var moment=require(_0x2b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x2b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2b7e('0x4'));var config=require(_0x2b7e('0x5'));var attributes=require(_0x2b7e('0x6'));module[_0x2b7e('0x7')]=function(_0x3d06ba,_0x93733a){return _0x3d06ba['define'](_0x2b7e('0x8'),attributes,{'tableName':_0x2b7e('0x9'),'paranoid':![],'indexes':[{'name':_0x2b7e('0xa'),'fields':['endtime']},{'name':_0x2b7e('0xb'),'fields':[_0x2b7e('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index d1b9dfe..c525e22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x534d=['findAll','options','sequelize','COUNT','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','where','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateCmHopperHistory','create','body','raw','debug','AvgHandleTime','CmHopperHistory'];(function(_0x4bc53b,_0x39fc31){var _0x5743f5=function(_0x3db0ea){while(--_0x3db0ea){_0x4bc53b['push'](_0x4bc53b['shift']());}};_0x5743f5(++_0x39fc31);}(_0x534d,0x79));var _0xd534=function(_0x15823d,_0x1707a9){_0x15823d=_0x15823d-0x0;var _0x33eb53=_0x534d[_0x15823d];return _0x33eb53;};'use strict';var _=require(_0xd534('0x0'));var util=require(_0xd534('0x1'));var moment=require(_0xd534('0x2'));var BPromise=require(_0xd534('0x3'));var rs=require(_0xd534('0x4'));var fs=require('fs');var Redis=require(_0xd534('0x5'));var db=require(_0xd534('0x6'))['db'];var utils=require(_0xd534('0x7'));var logger=require(_0xd534('0x8'))(_0xd534('0x9'));var config=require(_0xd534('0xa'));var jayson=require(_0xd534('0xb'));var client=jayson[_0xd534('0xc')][_0xd534('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1db778,_0x3c8772,_0x4419ee){return new BPromise(function(_0x1a00af,_0x2be8e1){return client['request'](_0x1db778,_0x4419ee)[_0xd534('0xe')](function(_0x37a2c8){logger[_0xd534('0xf')](_0xd534('0x10'),_0x3c8772,_0xd534('0x11'));logger['debug'](_0xd534('0x12'),_0x3c8772,_0xd534('0x11'),JSON[_0xd534('0x13')](_0x37a2c8));if(_0x37a2c8[_0xd534('0x14')]){if(_0x37a2c8[_0xd534('0x14')][_0xd534('0x15')]===0x1f4){logger[_0xd534('0x14')](_0xd534('0x10'),_0x3c8772,_0x37a2c8['error']['message']);return _0x2be8e1(_0x37a2c8[_0xd534('0x14')][_0xd534('0x16')]);}logger[_0xd534('0x14')](_0xd534('0x10'),_0x3c8772,_0x37a2c8[_0xd534('0x14')][_0xd534('0x16')]);return _0x1a00af(_0x37a2c8[_0xd534('0x14')][_0xd534('0x16')]);}else{logger[_0xd534('0xf')](_0xd534('0x10'),_0x3c8772,'request\x20sent');_0x1a00af(_0x37a2c8['result'][_0xd534('0x16')]);}})[_0xd534('0x17')](function(_0x398435){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x3c8772,_0x398435);_0x2be8e1(_0x398435);});});}exports[_0xd534('0x18')]=function(_0x477b62){var _0x36cc6c=this;return new Promise(function(_0xb097fd,_0x4d02b1){return db['CmHopperHistory'][_0xd534('0x19')](_0x477b62[_0xd534('0x1a')],{'raw':_0x477b62['options']?_0x477b62['options'][_0xd534('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x3c0f39){logger[_0xd534('0xf')](_0xd534('0x18'),_0x477b62);logger[_0xd534('0x1c')](_0xd534('0x18'),_0x477b62,JSON['stringify'](_0x3c0f39));_0xb097fd(_0x3c0f39);})['catch'](function(_0x25a176){logger['error'](_0xd534('0x18'),_0x25a176[_0xd534('0x16')],_0x477b62);_0x4d02b1(_0x36cc6c['error'](0x1f4,_0x25a176[_0xd534('0x16')]));});});};exports[_0xd534('0x1d')]=function(_0x3c030e){var _0x2e93fd=this;return new Promise(function(_0x549659,_0x526134){return db[_0xd534('0x1e')][_0xd534('0x1f')]({'raw':_0x3c030e[_0xd534('0x20')]?_0x3c030e['options'][_0xd534('0x1b')]===undefined?!![]:![]:!![],'where':_0x3c030e[_0xd534('0x20')]?_0x3c030e[_0xd534('0x20')]['where']||null:null,'attributes':[[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db['sequelize'][_0xd534('0x23')]('id')),_0xd534('0x24')],[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db[_0xd534('0x21')]['fn']('IF',db[_0xd534('0x21')]['literal'](_0xd534('0x25')))),_0xd534('0x26')],[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db[_0xd534('0x21')]['fn']('IF',db[_0xd534('0x21')][_0xd534('0x27')](_0xd534('0x28')))),_0xd534('0x29')],[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db[_0xd534('0x21')]['fn']('IF',db['sequelize'][_0xd534('0x27')](_0xd534('0x2a')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0xd534('0x21')]['fn'](_0xd534('0x2b'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xd534('0x2c')))),_0xd534('0x2d')],[db['sequelize']['fn'](_0xd534('0x2b'),db[_0xd534('0x21')]['fn']('IF',db[_0xd534('0x21')]['literal'](_0xd534('0x2e')))),_0xd534('0x2f')]]})[_0xd534('0xe')](function(_0x4d9404){logger[_0xd534('0xf')](_0xd534('0x1d'),_0x3c030e);logger[_0xd534('0x1c')]('AvgHandleTime',_0x3c030e,JSON[_0xd534('0x13')](_0x4d9404));_0x549659(_0x4d9404);})[_0xd534('0x17')](function(_0x4fbd5d){logger[_0xd534('0x14')](_0xd534('0x1d'),_0x4fbd5d[_0xd534('0x16')],_0x3c030e);_0x526134(_0x2e93fd[_0xd534('0x14')](0x1f4,_0x4fbd5d['message']));});});};exports[_0xd534('0x30')]=function(_0x4ac69b){var _0x503fe7=this;return new Promise(function(_0x5bda69,_0x3d7980){return db[_0xd534('0x1e')][_0xd534('0x1f')]({'raw':_0x4ac69b[_0xd534('0x20')]?_0x4ac69b['options']['raw']===undefined?!![]:![]:!![],'where':_0x4ac69b[_0xd534('0x20')]?_0x4ac69b[_0xd534('0x20')][_0xd534('0x31')]||null:null,'attributes':[[_0xd534('0x32'),_0xd534('0x33')],[db[_0xd534('0x21')]['fn']('COUNT',db[_0xd534('0x21')]['fn']('IF',db['sequelize'][_0xd534('0x27')](_0xd534('0x34')))),_0xd534('0x35')],[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db['sequelize']['fn']('IF',db[_0xd534('0x21')]['literal'](_0xd534('0x36')))),_0xd534('0x37')],[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db[_0xd534('0x21')]['fn']('IF',db['sequelize']['literal'](_0xd534('0x25')))),_0xd534('0x38')],[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db[_0xd534('0x21')]['fn']('IF',db[_0xd534('0x21')][_0xd534('0x27')](_0xd534('0x39')))),'outboundBusyCallsDay'],[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db[_0xd534('0x21')]['fn']('IF',db['sequelize']['literal'](_0xd534('0x3a')))),_0xd534('0x3b')],[db['sequelize']['fn'](_0xd534('0x22'),db['sequelize']['fn']('IF',db[_0xd534('0x21')][_0xd534('0x27')](_0xd534('0x3c')))),'outboundDropCallsDayTimeout'],[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db[_0xd534('0x21')]['fn']('IF',db[_0xd534('0x21')][_0xd534('0x27')](_0xd534('0x3d')))),_0xd534('0x3e')],[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db[_0xd534('0x21')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2012,\x201,\x20null'))),_0xd534('0x3f')],[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db[_0xd534('0x21')]['fn']('IF',db[_0xd534('0x21')][_0xd534('0x27')]('`state`\x20=\x2013,\x201,\x20null'))),_0xd534('0x40')],[db['sequelize']['fn'](_0xd534('0x22'),db[_0xd534('0x21')]['fn']('IF',db['sequelize'][_0xd534('0x27')](_0xd534('0x41')))),_0xd534('0x42')],[db[_0xd534('0x21')]['fn']('COUNT',db[_0xd534('0x21')]['fn']('IF',db[_0xd534('0x21')][_0xd534('0x27')](_0xd534('0x43')))),_0xd534('0x44')],[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db['sequelize']['fn']('IF',db['sequelize'][_0xd534('0x27')](_0xd534('0x45')))),'outboundAnswerAgiCallsDay'],[db['sequelize']['fn']('COUNT',db[_0xd534('0x21')]['fn']('IF',db['sequelize'][_0xd534('0x27')](_0xd534('0x46')))),_0xd534('0x44')],[db[_0xd534('0x21')]['fn']('COUNT',db[_0xd534('0x21')]['fn']('IF',db[_0xd534('0x21')][_0xd534('0x27')](_0xd534('0x47')))),_0xd534('0x48')]],'group':[_0xd534('0x32')]})[_0xd534('0xe')](function(_0x597506){logger[_0xd534('0xf')](_0xd534('0x30'),_0x4ac69b);logger['debug']('GetVoiceQueueHopperHistory',_0x4ac69b,JSON[_0xd534('0x13')](_0x597506));_0x5bda69(_0x597506);})[_0xd534('0x17')](function(_0x439d13){logger[_0xd534('0x14')](_0xd534('0x30'),_0x439d13[_0xd534('0x16')],_0x4ac69b);_0x3d7980(_0x503fe7['error'](0x1f4,_0x439d13[_0xd534('0x16')]));});});};exports[_0xd534('0x49')]=function(_0x2b140a){var _0x4c8e59=this;return new Promise(function(_0x3646a4,_0x4d11e0){return db['CmHopperHistory'][_0xd534('0x1f')]({'raw':_0x2b140a[_0xd534('0x20')]?_0x2b140a[_0xd534('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x2b140a[_0xd534('0x20')]?_0x2b140a['options'][_0xd534('0x31')]||null:null,'attributes':[[_0xd534('0x32'),'name'],[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db['sequelize'][_0xd534('0x23')]('id')),_0xd534('0x4a')],[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db[_0xd534('0x21')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x201,\x20null'))),_0xd534('0x4b')]],'group':[_0xd534('0x32')]})['then'](function(_0x5a35d3){logger[_0xd534('0xf')](_0xd534('0x49'),_0x2b140a);logger[_0xd534('0x1c')]('GetCampaignHopperHistory',_0x2b140a,JSON['stringify'](_0x5a35d3));_0x3646a4(_0x5a35d3);})['catch'](function(_0x24112f){logger[_0xd534('0x14')]('GetCampaignHopperHistory',_0x24112f['message'],_0x2b140a);_0x4d11e0(_0x4c8e59['error'](0x1f4,_0x24112f['message']));});});};
\ No newline at end of file
+var _0x804e=['body','raw','stringify','AvgHandleTime','findAll','options','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','then','GetVoiceQueueHopperHistory','where','campaign','name','outboundNoSuchCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','message','catch','CreateCmHopperHistory','CmHopperHistory','create'];(function(_0x3f6591,_0xee2393){var _0x3e03d5=function(_0x3306d1){while(--_0x3306d1){_0x3f6591['push'](_0x3f6591['shift']());}};_0x3e03d5(++_0xee2393);}(_0x804e,0x6e));var _0xe804=function(_0x25f1bb,_0x508560){_0x25f1bb=_0x25f1bb-0x0;var _0x34a5a6=_0x804e[_0x25f1bb];return _0x34a5a6;};'use strict';var _=require(_0xe804('0x0'));var util=require(_0xe804('0x1'));var moment=require('moment');var BPromise=require(_0xe804('0x2'));var rs=require(_0xe804('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe804('0x4'));var logger=require(_0xe804('0x5'))(_0xe804('0x6'));var config=require(_0xe804('0x7'));var jayson=require(_0xe804('0x8'));var client=jayson[_0xe804('0x9')][_0xe804('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18df36,_0x30ffd8,_0x3c19b3){return new BPromise(function(_0x31c192,_0x22c4b8){return client['request'](_0x18df36,_0x3c19b3)['then'](function(_0x2c6084){logger[_0xe804('0xb')](_0xe804('0xc'),_0x30ffd8,_0xe804('0xd'));logger[_0xe804('0xe')](_0xe804('0xf'),_0x30ffd8,'request\x20sent',JSON['stringify'](_0x2c6084));if(_0x2c6084['error']){if(_0x2c6084[_0xe804('0x10')]['code']===0x1f4){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x30ffd8,_0x2c6084['error'][_0xe804('0x11')]);return _0x22c4b8(_0x2c6084[_0xe804('0x10')][_0xe804('0x11')]);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x30ffd8,_0x2c6084[_0xe804('0x10')][_0xe804('0x11')]);return _0x31c192(_0x2c6084[_0xe804('0x10')]['message']);}else{logger['info'](_0xe804('0xc'),_0x30ffd8,_0xe804('0xd'));_0x31c192(_0x2c6084['result'][_0xe804('0x11')]);}})[_0xe804('0x12')](function(_0x33680a){logger[_0xe804('0x10')](_0xe804('0xc'),_0x30ffd8,_0x33680a);_0x22c4b8(_0x33680a);});});}exports[_0xe804('0x13')]=function(_0x49a26a){var _0x543bc9=this;return new Promise(function(_0x1d0ec4,_0x91e4e1){return db[_0xe804('0x14')][_0xe804('0x15')](_0x49a26a[_0xe804('0x16')],{'raw':_0x49a26a['options']?_0x49a26a['options'][_0xe804('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x36b271){logger[_0xe804('0xb')]('CreateCmHopperHistory',_0x49a26a);logger[_0xe804('0xe')](_0xe804('0x13'),_0x49a26a,JSON[_0xe804('0x18')](_0x36b271));_0x1d0ec4(_0x36b271);})[_0xe804('0x12')](function(_0x232a4a){logger[_0xe804('0x10')](_0xe804('0x13'),_0x232a4a[_0xe804('0x11')],_0x49a26a);_0x91e4e1(_0x543bc9['error'](0x1f4,_0x232a4a[_0xe804('0x11')]));});});};exports[_0xe804('0x19')]=function(_0x418335){var _0x4cc580=this;return new Promise(function(_0x5d31bd,_0x25c51b){return db[_0xe804('0x14')][_0xe804('0x1a')]({'raw':_0x418335[_0xe804('0x1b')]?_0x418335[_0xe804('0x1b')][_0xe804('0x17')]===undefined?!![]:![]:!![],'where':_0x418335[_0xe804('0x1b')]?_0x418335[_0xe804('0x1b')]['where']||null:null,'attributes':[[db[_0xe804('0x1c')]['fn'](_0xe804('0x1d'),db[_0xe804('0x1c')][_0xe804('0x1e')]('id')),_0xe804('0x1f')],[db[_0xe804('0x1c')]['fn'](_0xe804('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0xe804('0x20')](_0xe804('0x21')))),_0xe804('0x22')],[db[_0xe804('0x1c')]['fn'](_0xe804('0x1d'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xe804('0x23')))),_0xe804('0x24')],[db[_0xe804('0x1c')]['fn'](_0xe804('0x1d'),db[_0xe804('0x1c')]['fn']('IF',db[_0xe804('0x1c')][_0xe804('0x20')]('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db['sequelize']['fn'](_0xe804('0x25'),db[_0xe804('0x1c')]['fn']('IF',db['sequelize']['literal'](_0xe804('0x26')))),'predictiveIntervalAvgHoldtime'],[db[_0xe804('0x1c')]['fn'](_0xe804('0x25'),db['sequelize']['fn']('IF',db[_0xe804('0x1c')]['literal'](_0xe804('0x27')))),'predictiveIntervalAvgTalktime']]})[_0xe804('0x28')](function(_0x1c064d){logger[_0xe804('0xb')]('AvgHandleTime',_0x418335);logger[_0xe804('0xe')](_0xe804('0x19'),_0x418335,JSON[_0xe804('0x18')](_0x1c064d));_0x5d31bd(_0x1c064d);})[_0xe804('0x12')](function(_0x110e7f){logger['error'](_0xe804('0x19'),_0x110e7f[_0xe804('0x11')],_0x418335);_0x25c51b(_0x4cc580[_0xe804('0x10')](0x1f4,_0x110e7f[_0xe804('0x11')]));});});};exports[_0xe804('0x29')]=function(_0x520c53){var _0x3debed=this;return new Promise(function(_0x166645,_0xd6d617){return db['CmHopperHistory']['findAll']({'raw':_0x520c53['options']?_0x520c53[_0xe804('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x520c53[_0xe804('0x1b')]?_0x520c53[_0xe804('0x1b')][_0xe804('0x2a')]||null:null,'attributes':[[_0xe804('0x2b'),_0xe804('0x2c')],[db[_0xe804('0x1c')]['fn'](_0xe804('0x1d'),db[_0xe804('0x1c')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),_0xe804('0x2d')],[db[_0xe804('0x1c')]['fn'](_0xe804('0x1d'),db[_0xe804('0x1c')]['fn']('IF',db['sequelize'][_0xe804('0x20')]('`state`\x20=\x203,\x201,\x20null'))),'outboundNoAnswerCallsDay'],[db[_0xe804('0x1c')]['fn']('COUNT',db[_0xe804('0x1c')]['fn']('IF',db[_0xe804('0x1c')][_0xe804('0x20')](_0xe804('0x21')))),_0xe804('0x2e')],[db[_0xe804('0x1c')]['fn'](_0xe804('0x1d'),db['sequelize']['fn']('IF',db[_0xe804('0x1c')][_0xe804('0x20')]('`state`\x20=\x205,\x201,\x20null'))),_0xe804('0x2f')],[db[_0xe804('0x1c')]['fn'](_0xe804('0x1d'),db[_0xe804('0x1c')]['fn']('IF',db['sequelize']['literal'](_0xe804('0x30')))),_0xe804('0x31')],[db[_0xe804('0x1c')]['fn'](_0xe804('0x1d'),db[_0xe804('0x1c')]['fn']('IF',db[_0xe804('0x1c')][_0xe804('0x20')](_0xe804('0x32')))),'outboundDropCallsDayTimeout'],[db[_0xe804('0x1c')]['fn']('COUNT',db[_0xe804('0x1c')]['fn']('IF',db['sequelize'][_0xe804('0x20')](_0xe804('0x33')))),_0xe804('0x34')],[db[_0xe804('0x1c')]['fn'](_0xe804('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0xe804('0x20')](_0xe804('0x35')))),_0xe804('0x36')],[db[_0xe804('0x1c')]['fn'](_0xe804('0x1d'),db[_0xe804('0x1c')]['fn']('IF',db[_0xe804('0x1c')][_0xe804('0x20')](_0xe804('0x37')))),_0xe804('0x38')],[db[_0xe804('0x1c')]['fn'](_0xe804('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0xe804('0x20')]('`state`\x20=\x2014,\x201,\x20null'))),_0xe804('0x39')],[db[_0xe804('0x1c')]['fn'](_0xe804('0x1d'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xe804('0x3a')))),_0xe804('0x3b')],[db[_0xe804('0x1c')]['fn'](_0xe804('0x1d'),db[_0xe804('0x1c')]['fn']('IF',db[_0xe804('0x1c')][_0xe804('0x20')]('`state`\x20=\x2016,\x201,\x20null'))),_0xe804('0x3c')],[db[_0xe804('0x1c')]['fn'](_0xe804('0x1d'),db[_0xe804('0x1c')]['fn']('IF',db[_0xe804('0x1c')][_0xe804('0x20')]('`state`\x20=\x2020,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0xe804('0x1c')]['fn'](_0xe804('0x1d'),db['sequelize']['fn']('IF',db[_0xe804('0x1c')][_0xe804('0x20')](_0xe804('0x3d')))),_0xe804('0x3e')]],'group':['campaign']})[_0xe804('0x28')](function(_0xd2fd8a){logger[_0xe804('0xb')]('GetVoiceQueueHopperHistory',_0x520c53);logger[_0xe804('0xe')](_0xe804('0x29'),_0x520c53,JSON['stringify'](_0xd2fd8a));_0x166645(_0xd2fd8a);})[_0xe804('0x12')](function(_0x206227){logger[_0xe804('0x10')](_0xe804('0x29'),_0x206227[_0xe804('0x11')],_0x520c53);_0xd6d617(_0x3debed[_0xe804('0x10')](0x1f4,_0x206227['message']));});});};exports['GetCampaignHopperHistory']=function(_0x31e8d5){var _0x55396c=this;return new Promise(function(_0x3bbb48,_0x5d87bc){return db[_0xe804('0x14')][_0xe804('0x1a')]({'raw':_0x31e8d5[_0xe804('0x1b')]?_0x31e8d5[_0xe804('0x1b')][_0xe804('0x17')]===undefined?!![]:![]:!![],'where':_0x31e8d5[_0xe804('0x1b')]?_0x31e8d5['options'][_0xe804('0x2a')]||null:null,'attributes':[['campaign',_0xe804('0x2c')],[db[_0xe804('0x1c')]['fn'](_0xe804('0x1d'),db[_0xe804('0x1c')][_0xe804('0x1e')]('id')),_0xe804('0x3f')],[db[_0xe804('0x1c')]['fn'](_0xe804('0x1d'),db[_0xe804('0x1c')]['fn']('IF',db['sequelize']['literal'](_0xe804('0x21')))),_0xe804('0x40')]],'group':[_0xe804('0x2b')]})['then'](function(_0x29934f){logger['info'](_0xe804('0x41'),_0x31e8d5);logger[_0xe804('0xe')](_0xe804('0x41'),_0x31e8d5,JSON[_0xe804('0x18')](_0x29934f));_0x3bbb48(_0x29934f);})['catch'](function(_0x339756){logger['error']('GetCampaignHopperHistory',_0x339756[_0xe804('0x11')],_0x31e8d5);_0x5d87bc(_0x55396c[_0xe804('0x10')](0x1f4,_0x339756[_0xe804('0x11')]));});});};
\ No newline at end of file
index 491d192..a40f80a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9746=['show','post','create','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','index','describe','/:id','isAuthenticated'];(function(_0x2823e7,_0x39ef0b){var _0x4f4c25=function(_0x11cf82){while(--_0x11cf82){_0x2823e7['push'](_0x2823e7['shift']());}};_0x4f4c25(++_0x39ef0b);}(_0x9746,0xf4));var _0x6974=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x9746[_0xd0b415];return _0x2bdf2c;};'use strict';var multer=require(_0x6974('0x0'));var util=require(_0x6974('0x1'));var path=require(_0x6974('0x2'));var timeout=require(_0x6974('0x3'));var express=require(_0x6974('0x4'));var router=express[_0x6974('0x5')]();var fs_extra=require(_0x6974('0x6'));var auth=require(_0x6974('0x7'));var interaction=require(_0x6974('0x8'));var config=require(_0x6974('0x9'));var controller=require(_0x6974('0xa'));router[_0x6974('0xb')]('/',auth['isAuthenticated'](),controller[_0x6974('0xc')]);router[_0x6974('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x6974('0xd')]);router[_0x6974('0xb')](_0x6974('0xe'),auth[_0x6974('0xf')](),controller[_0x6974('0x10')]);router[_0x6974('0x11')]('/',auth['isAuthenticated'](),controller[_0x6974('0x12')]);router['put'](_0x6974('0xe'),auth[_0x6974('0xf')](),controller['update']);module[_0x6974('0x13')]=router;
\ No newline at end of file
+var _0xa833=['../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','put','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2a238a,_0x1d5054){var _0xeef802=function(_0x583637){while(--_0x583637){_0x2a238a['push'](_0x2a238a['shift']());}};_0xeef802(++_0x1d5054);}(_0xa833,0x1cd));var _0x3a83=function(_0x32976d,_0xfc0ab4){_0x32976d=_0x32976d-0x0;var _0x346e2a=_0xa833[_0x32976d];return _0x346e2a;};'use strict';var multer=require(_0x3a83('0x0'));var util=require('util');var path=require(_0x3a83('0x1'));var timeout=require(_0x3a83('0x2'));var express=require(_0x3a83('0x3'));var router=express[_0x3a83('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3a83('0x5'));var interaction=require(_0x3a83('0x6'));var config=require(_0x3a83('0x7'));var controller=require('./cmHopperHistory.controller');router[_0x3a83('0x8')]('/',auth[_0x3a83('0x9')](),controller[_0x3a83('0xa')]);router[_0x3a83('0x8')](_0x3a83('0xb'),auth['isAuthenticated'](),controller[_0x3a83('0xc')]);router[_0x3a83('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x3a83('0xd')]);router[_0x3a83('0xe')]('/',auth[_0x3a83('0x9')](),controller[_0x3a83('0xf')]);router[_0x3a83('0x10')]('/:id',auth[_0x3a83('0x9')](),controller['update']);module[_0x3a83('0x11')]=router;
\ No newline at end of file
index f68608f..9f64dba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fda=['STRING','name','sequelize'];(function(_0x544309,_0x3e76c7){var _0x398e1c=function(_0x1c5397){while(--_0x1c5397){_0x544309['push'](_0x544309['shift']());}};_0x398e1c(++_0x3e76c7);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x32154f,_0x4f7371){_0x32154f=_0x32154f-0x0;var _0x2fc7a8=_0x0fda[_0x32154f];return _0x2fc7a8;};'use strict';var Sequelize=require(_0xa0fd('0x0'));module['exports']={'name':{'type':Sequelize[_0xa0fd('0x1')],'unique':_0xa0fd('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa0fd('0x1')]},'dialPrefix':{'type':Sequelize[_0xa0fd('0x1')]}};
\ No newline at end of file
+var _0x6688=['sequelize','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6688,0x10e));var _0x8668=function(_0x1613c6,_0x40d398){_0x1613c6=_0x1613c6-0x0;var _0x3fa9d7=_0x6688[_0x1613c6];return _0x3fa9d7;};'use strict';var Sequelize=require(_0x8668('0x0'));module[_0x8668('0x1')]={'name':{'type':Sequelize[_0x8668('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8668('0x2')]},'dialPrefix':{'type':Sequelize[_0x8668('0x2')]}};
\ No newline at end of file
index 2d6b492..c8fae85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9f4=['CmContactId\x20=\x20c.id','additionalPhone_','description','toString','isEmpty','now','format','Content-disposition','list_%d_%s.csv','setHeader','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','sequelize','addCustomFields','TEXT','text','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','rimraf','zip-dir','fast-json-patch','moment','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','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./cmList.socket','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','get','Lists','name','index','map','CmList','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','sort','pick','removeDispositions','ids','addContacts','CmContact','tags','join','isArray','push','each','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','cf_%d','merge','ContactItemType','OrderBy','alias','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','select','item','cm_contact_has_items','ItemTypeId\x20=\x20?'];(function(_0x2179f1,_0x21c653){var _0x176ec9=function(_0x4c4a4c){while(--_0x4c4a4c){_0x2179f1['push'](_0x2179f1['shift']());}};_0x176ec9(++_0x21c653);}(_0xf9f4,0x16e));var _0x4f9f=function(_0x280613,_0x37e163){_0x280613=_0x280613-0x0;var _0x2a3fa9=_0xf9f4[_0x280613];return _0x2a3fa9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4f9f('0x0'));var zipdir=require(_0x4f9f('0x1'));var jsonpatch=require(_0x4f9f('0x2'));var rp=require('request-promise');var moment=require(_0x4f9f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x4f9f('0x4'));var sox=require(_0x4f9f('0x5'));var csv=require(_0x4f9f('0x6'));var ejs=require(_0x4f9f('0x7'));var fs=require('fs');var fs_extra=require(_0x4f9f('0x8'));var _=require(_0x4f9f('0x9'));var squel=require('squel');var crypto=require(_0x4f9f('0xa'));var jsforce=require(_0x4f9f('0xb'));var deskjs=require(_0x4f9f('0xc'));var toCsv=require(_0x4f9f('0x6'));var querystring=require(_0x4f9f('0xd'));var Papa=require(_0x4f9f('0xe'));var Redis=require(_0x4f9f('0xf'));var authService=require(_0x4f9f('0x10'));var qs=require(_0x4f9f('0x11'));var as=require(_0x4f9f('0x12'));var hardwareService=require(_0x4f9f('0x13'));var logger=require(_0x4f9f('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x4f9f('0x15'));var licenseUtil=require(_0x4f9f('0x16'));var db=require('../../mysqldb')['db'];var csv_results;config[_0x4f9f('0x17')]=_[_0x4f9f('0x18')](config[_0x4f9f('0x17')],{'host':_0x4f9f('0x19'),'port':0x18eb});var socket=require(_0x4f9f('0x1a'))(new Redis(config[_0x4f9f('0x17')]));require(_0x4f9f('0x1b'))['register'](socket);function respondWithStatusCode(_0x32acfa,_0x353502){_0x353502=_0x353502||0xcc;return function(_0x4ff44f){if(_0x4ff44f){return _0x32acfa[_0x4f9f('0x1c')](_0x353502);}return _0x32acfa['status'](_0x353502)[_0x4f9f('0x1d')]();};}function respondWithResult(_0x2df9c2,_0x2e1bd){_0x2e1bd=_0x2e1bd||0xc8;return function(_0x51a754){if(_0x51a754){return _0x2df9c2[_0x4f9f('0x1e')](_0x2e1bd)[_0x4f9f('0x1f')](_0x51a754);}};}function respondWithFilteredResult(_0x494d36,_0x4b966d){return function(_0x519ef4){if(_0x519ef4){var _0x399647=typeof _0x4b966d[_0x4f9f('0x20')]===_0x4f9f('0x21')&&typeof _0x4b966d[_0x4f9f('0x22')]===_0x4f9f('0x21');var _0x557481=_0x519ef4[_0x4f9f('0x23')];var _0x5795ce=_0x399647?0x0:_0x4b966d[_0x4f9f('0x20')];var _0x168db5=_0x399647?_0x519ef4[_0x4f9f('0x23')]:_0x4b966d[_0x4f9f('0x20')]+_0x4b966d['limit'];var _0x417dec;if(_0x168db5>=_0x557481){_0x168db5=_0x557481;_0x417dec=0xc8;}else{_0x417dec=0xce;}_0x494d36[_0x4f9f('0x1e')](_0x417dec);return _0x494d36['set'](_0x4f9f('0x24'),_0x5795ce+'-'+_0x168db5+'/'+_0x557481)['json'](_0x519ef4);}return null;};}function patchUpdates(_0x4baa82){return function(_0x20f669){try{jsonpatch[_0x4f9f('0x25')](_0x20f669,_0x4baa82,!![]);}catch(_0x137f5b){return BPromise['reject'](_0x137f5b);}return _0x20f669[_0x4f9f('0x26')]();};}function saveUpdates(_0x5bd766,_0x1c079a){return function(_0xf87e04){if(_0xf87e04){return _0xf87e04[_0x4f9f('0x27')](_0x5bd766)['then'](function(_0x368e28){return _0x368e28;});}return null;};}function removeEntity(_0x14e18c,_0x99be6e){return function(_0x2e979f){if(_0x2e979f){return _0x2e979f[_0x4f9f('0x28')]()[_0x4f9f('0x29')](function(){var _0x15871f=_0x2e979f[_0x4f9f('0x2a')]({'plain':!![]});var _0x13e973=_0x4f9f('0x2b');return db['UserProfileResource'][_0x4f9f('0x28')]({'where':{'type':_0x13e973,'resourceId':_0x15871f['id']}})[_0x4f9f('0x29')](function(){return _0x2e979f;});})[_0x4f9f('0x29')](function(){_0x14e18c[_0x4f9f('0x1e')](0xcc)[_0x4f9f('0x1d')]();});}};}function handleEntityNotFound(_0x2972e5,_0x4f619d){return function(_0x36c3b3){if(!_0x36c3b3){_0x2972e5[_0x4f9f('0x1c')](0x194);}return _0x36c3b3;};}function handleError(_0x152623,_0x45abc1){_0x45abc1=_0x45abc1||0x1f4;return function(_0x426775){logger['error'](_0x426775['stack']);if(_0x426775[_0x4f9f('0x2c')]){delete _0x426775[_0x4f9f('0x2c')];}_0x152623[_0x4f9f('0x1e')](_0x45abc1)['send'](_0x426775);};}exports[_0x4f9f('0x2d')]=function(_0x35fc98,_0x13b63f){var _0x210b4a={},_0x513516={},_0x24a507={'count':0x0,'rows':[]};var _0x13b279=_[_0x4f9f('0x2e')](db[_0x4f9f('0x2f')][_0x4f9f('0x30')],function(_0x23f626){return{'name':_0x23f626[_0x4f9f('0x31')],'type':_0x23f626[_0x4f9f('0x32')][_0x4f9f('0x33')]};});_0x513516['model']=_[_0x4f9f('0x2e')](_0x13b279,_0x4f9f('0x2c'));_0x513516[_0x4f9f('0x34')]=_[_0x4f9f('0x35')](_0x35fc98[_0x4f9f('0x34')]);_0x513516[_0x4f9f('0x36')]=_[_0x4f9f('0x37')](_0x513516[_0x4f9f('0x38')],_0x513516[_0x4f9f('0x34')]);_0x210b4a[_0x4f9f('0x39')]=_[_0x4f9f('0x37')](_0x513516[_0x4f9f('0x38')],qs[_0x4f9f('0x3a')](_0x35fc98[_0x4f9f('0x34')][_0x4f9f('0x3a')]));_0x210b4a[_0x4f9f('0x39')]=_0x210b4a[_0x4f9f('0x39')]['length']?_0x210b4a[_0x4f9f('0x39')]:_0x513516[_0x4f9f('0x38')];if(!_0x35fc98[_0x4f9f('0x34')][_0x4f9f('0x3b')](_0x4f9f('0x3c'))){_0x210b4a[_0x4f9f('0x22')]=qs[_0x4f9f('0x22')](_0x35fc98[_0x4f9f('0x34')][_0x4f9f('0x22')]);_0x210b4a['offset']=qs[_0x4f9f('0x20')](_0x35fc98[_0x4f9f('0x34')][_0x4f9f('0x20')]);}_0x210b4a[_0x4f9f('0x3d')]=qs['sort'](_0x35fc98[_0x4f9f('0x34')]['sort']);_0x210b4a[_0x4f9f('0x3e')]=qs[_0x4f9f('0x36')](_['pick'](_0x35fc98[_0x4f9f('0x34')],_0x513516['filters']),_0x13b279);if(_0x35fc98['query'][_0x4f9f('0x3f')]){_0x210b4a['where']=_['merge'](_0x210b4a[_0x4f9f('0x3e')],{'$or':_[_0x4f9f('0x2e')](_0x13b279,function(_0x39933b){if(_0x39933b[_0x4f9f('0x32')]!==_0x4f9f('0x40')){var _0x1e5680={};_0x1e5680[_0x39933b['name']]={'$like':'%'+_0x35fc98['query'][_0x4f9f('0x3f')]+'%'};return _0x1e5680;}})});}_0x210b4a=_['merge']({},_0x210b4a,_0x35fc98[_0x4f9f('0x41')]);var _0x44336c={'where':_0x210b4a[_0x4f9f('0x3e')]};return db[_0x4f9f('0x2f')][_0x4f9f('0x23')](_0x44336c)[_0x4f9f('0x29')](function(_0x3f48d8){_0x24a507[_0x4f9f('0x23')]=_0x3f48d8;if(_0x35fc98[_0x4f9f('0x34')][_0x4f9f('0x42')]){_0x210b4a[_0x4f9f('0x43')]=[{'all':!![]}];}return db[_0x4f9f('0x2f')][_0x4f9f('0x44')](_0x210b4a);})[_0x4f9f('0x29')](function(_0x10c7c7){_0x24a507[_0x4f9f('0x45')]=_0x10c7c7;return _0x24a507;})[_0x4f9f('0x29')](respondWithFilteredResult(_0x13b63f,_0x210b4a))['catch'](handleError(_0x13b63f,null));};exports[_0x4f9f('0x46')]=function(_0x247979,_0x1331a5){var _0x4480d0={'raw':![],'where':{'id':_0x247979[_0x4f9f('0x47')]['id']}},_0x2c56fe={};_0x2c56fe[_0x4f9f('0x38')]=_[_0x4f9f('0x35')](db['CmList']['rawAttributes']);_0x2c56fe['query']=_['keys'](_0x247979[_0x4f9f('0x34')]);_0x2c56fe[_0x4f9f('0x36')]=_[_0x4f9f('0x37')](_0x2c56fe['model'],_0x2c56fe[_0x4f9f('0x34')]);_0x4480d0[_0x4f9f('0x39')]=_[_0x4f9f('0x37')](_0x2c56fe['model'],qs['fields'](_0x247979[_0x4f9f('0x34')][_0x4f9f('0x3a')]));_0x4480d0[_0x4f9f('0x39')]=_0x4480d0[_0x4f9f('0x39')][_0x4f9f('0x48')]?_0x4480d0[_0x4f9f('0x39')]:_0x2c56fe[_0x4f9f('0x38')];if(_0x247979[_0x4f9f('0x34')][_0x4f9f('0x42')]){_0x4480d0[_0x4f9f('0x43')]=[{'all':!![]}];}_0x4480d0=_['merge']({},_0x4480d0,_0x247979[_0x4f9f('0x41')]);return db[_0x4f9f('0x2f')][_0x4f9f('0x49')](_0x4480d0)[_0x4f9f('0x29')](handleEntityNotFound(_0x1331a5,null))[_0x4f9f('0x29')](respondWithResult(_0x1331a5,null))[_0x4f9f('0x4a')](handleError(_0x1331a5,null));};exports[_0x4f9f('0x4b')]=function(_0x3cc1c6,_0x35b094){return db[_0x4f9f('0x2f')][_0x4f9f('0x4b')](_0x3cc1c6[_0x4f9f('0x4c')],{})[_0x4f9f('0x29')](function(_0x3c960d){var _0x128d2c=_0x3cc1c6[_0x4f9f('0x4d')][_0x4f9f('0x2a')]({'plain':!![]});if(!_0x128d2c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x128d2c['role']===_0x4f9f('0x4d')){var _0x57beb2=_0x3c960d[_0x4f9f('0x2a')]({'plain':!![]});var _0x39fed1='Lists';return db[_0x4f9f('0x4e')]['find']({'where':{'name':_0x39fed1,'userProfileId':_0x128d2c[_0x4f9f('0x4f')]},'raw':!![]})[_0x4f9f('0x29')](function(_0x4c502c){if(_0x4c502c&&_0x4c502c[_0x4f9f('0x50')]===0x0){return db['UserProfileResource'][_0x4f9f('0x4b')]({'name':_0x57beb2[_0x4f9f('0x2c')],'resourceId':_0x57beb2['id'],'type':_0x4c502c[_0x4f9f('0x2c')],'sectionId':_0x4c502c['id']},{})['then'](function(){return _0x3c960d;});}else{return _0x3c960d;}})[_0x4f9f('0x4a')](function(_0x583a6e){logger[_0x4f9f('0x51')](_0x4f9f('0x52'),_0x583a6e);throw _0x583a6e;});}return _0x3c960d;})[_0x4f9f('0x29')](respondWithResult(_0x35b094,0xc9))['catch'](handleError(_0x35b094,null));};exports[_0x4f9f('0x27')]=function(_0x451104,_0x43b289){if(_0x451104[_0x4f9f('0x4c')]['id']){delete _0x451104[_0x4f9f('0x4c')]['id'];}return db[_0x4f9f('0x2f')][_0x4f9f('0x49')]({'where':{'id':_0x451104['params']['id']}})['then'](handleEntityNotFound(_0x43b289,null))[_0x4f9f('0x29')](saveUpdates(_0x451104[_0x4f9f('0x4c')],null))[_0x4f9f('0x29')](respondWithResult(_0x43b289,null))['catch'](handleError(_0x43b289,null));};exports[_0x4f9f('0x28')]=function(_0x4b06c9,_0x236505){return db[_0x4f9f('0x2f')]['find']({'where':{'id':_0x4b06c9[_0x4f9f('0x47')]['id']}})['then'](handleEntityNotFound(_0x236505,null))[_0x4f9f('0x29')](removeEntity(_0x236505,null))[_0x4f9f('0x4a')](handleError(_0x236505,null));};exports[_0x4f9f('0x53')]=function(_0x22b506,_0x1b9ea9){return db['CmList'][_0x4f9f('0x53')]()[_0x4f9f('0x29')](respondWithResult(_0x1b9ea9,null))['catch'](handleError(_0x1b9ea9,null));};exports[_0x4f9f('0x54')]=function(_0x92c60e,_0x46b31f,_0x437c5e){if(_0x92c60e['body']['id']){delete _0x92c60e[_0x4f9f('0x4c')]['id'];}return db['CmList'][_0x4f9f('0x49')]({'where':{'id':_0x92c60e[_0x4f9f('0x47')]['id']}})[_0x4f9f('0x29')](handleEntityNotFound(_0x46b31f,null))[_0x4f9f('0x29')](function(_0x359d2c){if(_0x359d2c){_0x92c60e[_0x4f9f('0x4c')][_0x4f9f('0x55')]=_0x359d2c['id'];return db[_0x4f9f('0x56')][_0x4f9f('0x4b')](_0x92c60e[_0x4f9f('0x4c')]);}})['then'](respondWithResult(_0x46b31f,null))[_0x4f9f('0x4a')](handleError(_0x46b31f,null));};exports[_0x4f9f('0x57')]=function(_0x240ab1,_0x23de01,_0x5bf823){var _0x24cfc4={'raw':![],'where':{}};var _0x5d6cd4={};var _0x53b5fc={'count':0x0,'rows':[]};return db[_0x4f9f('0x2f')][_0x4f9f('0x58')]({'where':{'id':_0x240ab1[_0x4f9f('0x47')]['id']}})[_0x4f9f('0x29')](handleEntityNotFound(_0x23de01,null))[_0x4f9f('0x29')](function(_0x4bb33e){if(_0x4bb33e){_0x5d6cd4[_0x4f9f('0x38')]=_[_0x4f9f('0x35')](db[_0x4f9f('0x56')]['rawAttributes']);_0x5d6cd4[_0x4f9f('0x34')]=_[_0x4f9f('0x35')](_0x240ab1[_0x4f9f('0x34')]);_0x5d6cd4[_0x4f9f('0x36')]=_[_0x4f9f('0x37')](_0x5d6cd4[_0x4f9f('0x38')],_0x5d6cd4[_0x4f9f('0x34')]);_0x24cfc4['attributes']=_['intersection'](_0x5d6cd4[_0x4f9f('0x38')],qs[_0x4f9f('0x3a')](_0x240ab1[_0x4f9f('0x34')][_0x4f9f('0x3a')]));_0x24cfc4['attributes']=_0x24cfc4['attributes'][_0x4f9f('0x48')]?_0x24cfc4[_0x4f9f('0x39')]:_0x5d6cd4[_0x4f9f('0x38')];if(!_0x240ab1[_0x4f9f('0x34')][_0x4f9f('0x3b')](_0x4f9f('0x3c'))){_0x24cfc4[_0x4f9f('0x22')]=qs[_0x4f9f('0x22')](_0x240ab1[_0x4f9f('0x34')][_0x4f9f('0x22')]);_0x24cfc4['offset']=qs['offset'](_0x240ab1['query'][_0x4f9f('0x20')]);}_0x24cfc4['order']=qs[_0x4f9f('0x59')](_0x240ab1[_0x4f9f('0x34')][_0x4f9f('0x59')]);_0x24cfc4[_0x4f9f('0x3e')]=qs[_0x4f9f('0x36')](_[_0x4f9f('0x5a')](_0x240ab1[_0x4f9f('0x34')],_0x5d6cd4[_0x4f9f('0x36')]));_0x24cfc4[_0x4f9f('0x3e')][_0x4f9f('0x55')]=_0x4bb33e['id'];if(_0x240ab1[_0x4f9f('0x34')]['filter']){_0x24cfc4[_0x4f9f('0x3e')]=_['merge'](_0x24cfc4['where'],{'$or':_[_0x4f9f('0x2e')](_0x24cfc4['attributes'],function(_0x1935ae){var _0x4bf698={};_0x4bf698[_0x1935ae]={'$like':'%'+_0x240ab1[_0x4f9f('0x34')]['filter']+'%'};return _0x4bf698;})});}_0x24cfc4=_['merge']({},_0x24cfc4,_0x240ab1[_0x4f9f('0x41')]);return db[_0x4f9f('0x56')]['count']({'where':_0x24cfc4['where']})[_0x4f9f('0x29')](function(_0x5cfcf4){_0x53b5fc[_0x4f9f('0x23')]=_0x5cfcf4;if(_0x240ab1[_0x4f9f('0x34')][_0x4f9f('0x42')]){_0x24cfc4[_0x4f9f('0x43')]=[{'all':!![]}];}return db[_0x4f9f('0x56')]['findAll'](_0x24cfc4);})[_0x4f9f('0x29')](function(_0x3c796b){_0x53b5fc[_0x4f9f('0x45')]=_0x3c796b;return _0x53b5fc;});}})[_0x4f9f('0x29')](respondWithFilteredResult(_0x23de01,_0x24cfc4))[_0x4f9f('0x4a')](handleError(_0x23de01,null));};exports['removeDispositions']=function(_0x44120d,_0x73848d,_0x836a31){return db[_0x4f9f('0x2f')]['find']({'where':{'id':_0x44120d['params']['id']}})[_0x4f9f('0x29')](handleEntityNotFound(_0x73848d,null))['then'](function(_0x3314b1){if(_0x3314b1){return _0x3314b1[_0x4f9f('0x5b')](_0x44120d['query'][_0x4f9f('0x5c')]);}})[_0x4f9f('0x29')](respondWithStatusCode(_0x73848d,null))[_0x4f9f('0x4a')](handleError(_0x73848d,null));};exports[_0x4f9f('0x5d')]=function(_0x256c50,_0x43689b,_0x4285ac){return db[_0x4f9f('0x2f')][_0x4f9f('0x49')]({'where':{'id':_0x256c50['params']['id']}})[_0x4f9f('0x29')](handleEntityNotFound(_0x43689b,null))['then'](function(_0x29678f){if(_0x29678f){var _0x4fa7ae=[];var _0x1511ca={'success':[],'errors':[]};return db[_0x4f9f('0x5e')][_0x4f9f('0x53')]()[_0x4f9f('0x29')](function(_0x67520f){if(_0x256c50['body'][_0x4f9f('0x5f')]&&_['isArray'](_0x256c50[_0x4f9f('0x4c')]['tags'])){if(_0x256c50[_0x4f9f('0x4c')][_0x4f9f('0x5f')][_0x4f9f('0x48')]){_0x256c50[_0x4f9f('0x4c')][_0x4f9f('0x5f')]=_0x256c50[_0x4f9f('0x4c')][_0x4f9f('0x5f')][_0x4f9f('0x60')](';')+';';}else{_0x256c50['body']['tags']=null;}}else{_0x256c50['body'][_0x4f9f('0x5f')]=null;}if(_0x256c50[_0x4f9f('0x4c')]&&_[_0x4f9f('0x61')](_0x256c50[_0x4f9f('0x4c')])){for(var _0x4e60ca=0x0;_0x4e60ca<_0x256c50[_0x4f9f('0x4c')][_0x4f9f('0x48')];_0x4e60ca+=0x1){_0x256c50[_0x4f9f('0x4c')][_0x4e60ca][_0x4f9f('0x55')]=_0x256c50[_0x4f9f('0x47')]['id'];_0x4fa7ae[_0x4f9f('0x62')](_0x256c50['body'][_0x4e60ca]);}return BPromise[_0x4f9f('0x63')](_0x4fa7ae,function(_0x283e6a){return db[_0x4f9f('0x5e')][_0x4f9f('0x4b')](_[_0x4f9f('0x64')](_0x283e6a,[_0x4f9f('0x5c'),'id'])||{},{'fields':_[_0x4f9f('0x35')](_0x67520f),'raw':!![]})[_0x4f9f('0x29')](function(_0x1ecf1b){_0x1511ca[_0x4f9f('0x65')][_0x4f9f('0x62')](_0x1ecf1b[_0x4f9f('0x66')]);})[_0x4f9f('0x4a')](function(_0x4ea343){_0x1511ca[_0x4f9f('0x67')][_0x4f9f('0x62')]({'data':_0x283e6a,'error':_0x4ea343[_0x4f9f('0x68')]});});})[_0x4f9f('0x29')](function(_0x28302){return _0x1511ca;})[_0x4f9f('0x4a')](function(_0x3f2155){return _0x3f2155;});}else{_0x43689b[_0x4f9f('0x1e')](0x190)[_0x4f9f('0x1f')]({'message':_0x4f9f('0x69')});}});}})[_0x4f9f('0x29')](respondWithResult(_0x43689b,null))['catch'](handleError(_0x43689b,null));};exports[_0x4f9f('0x6a')]=function(_0xca2a7,_0x28127f,_0x57400c){var _0x324c52;return db[_0x4f9f('0x2f')][_0x4f9f('0x49')]({'where':{'id':_0xca2a7['params']['id']},'include':[{'model':db[_0x4f9f('0x6b')],'as':_0x4f9f('0x6c')}]})[_0x4f9f('0x29')](handleEntityNotFound(_0x28127f,null))[_0x4f9f('0x29')](function(_0x1bb5ee){if(_0x1bb5ee){_0x324c52=_0x1bb5ee;return db['CmContact']['rawAttributes'];}})[_0x4f9f('0x29')](function(_0x5b32ba){if(_0x5b32ba){var _0x157c1f={};var _0x2b2c08={};_0x2b2c08[_0x4f9f('0x38')]=_['concat'](_['keys'](_0x5b32ba),_[_0x4f9f('0x2e')](_0x324c52[_0x4f9f('0x6c')],function(_0x5cd694){return util['format'](_0x4f9f('0x6d'),_0x5cd694['id']);}));_0x2b2c08[_0x4f9f('0x34')]=_['keys'](_0xca2a7[_0x4f9f('0x34')]);_0x2b2c08[_0x4f9f('0x36')]=_['intersection'](_0x2b2c08[_0x4f9f('0x38')],_0x2b2c08[_0x4f9f('0x34')]);_0x157c1f['attributes']=_[_0x4f9f('0x37')](_0x2b2c08[_0x4f9f('0x38')],qs[_0x4f9f('0x3a')](_0xca2a7[_0x4f9f('0x34')]['fields']));_0x157c1f[_0x4f9f('0x39')]=_0x157c1f[_0x4f9f('0x39')][_0x4f9f('0x48')]?_0x157c1f['attributes']:_0x2b2c08[_0x4f9f('0x38')];if(!_0xca2a7['query'][_0x4f9f('0x3b')]('nolimit')){_0x157c1f[_0x4f9f('0x22')]=qs[_0x4f9f('0x22')](_0xca2a7[_0x4f9f('0x34')][_0x4f9f('0x22')]);_0x157c1f[_0x4f9f('0x20')]=qs['offset'](_0xca2a7[_0x4f9f('0x34')]['offset']);}_0x157c1f['order']=qs[_0x4f9f('0x59')](_0xca2a7[_0x4f9f('0x34')][_0x4f9f('0x59')]);_0x157c1f[_0x4f9f('0x3e')]=qs['filters'](_[_0x4f9f('0x5a')](_0xca2a7['query'],_0x2b2c08['filters']));_0x157c1f['raw']=!![];if(_0xca2a7['query'][_0x4f9f('0x3f')]){_0x157c1f['where']=_[_0x4f9f('0x6e')](_0x157c1f[_0x4f9f('0x3e')],{'$or':_[_0x4f9f('0x2e')](_0x157c1f['attributes'],function(_0x5a5bb4){var _0x2f7c4b={};_0x2f7c4b[_0x5a5bb4]={'$like':'%'+_0xca2a7[_0x4f9f('0x34')][_0x4f9f('0x3f')]+'%'};return _0x2f7c4b;})});}_0x157c1f=_[_0x4f9f('0x6e')]({},_0x157c1f,_0xca2a7[_0x4f9f('0x41')]);return _0x324c52[_0x4f9f('0x6a')](_0x157c1f);}})[_0x4f9f('0x29')](respondWithResult(_0x28127f,null))[_0x4f9f('0x4a')](handleError(_0x28127f,null));};exports['getContactsCsv']=function(_0x1d1f1e,_0x5738e8,_0x2e05e6){var _0x472fcc;var _0x4c8a5d;var _0x5b5778;var _0x2f25ab=_0x1d1f1e[_0x4f9f('0x47')]['id'];csv_results=[];return db[_0x4f9f('0x6f')]['findAll']({'attributes':['id',_0x4f9f('0x2c')],'raw':!![],'order':[_0x4f9f('0x70')]})[_0x4f9f('0x29')](function(_0x1d038d){_0x472fcc=_0x1d038d;var _0x18122b=_['keys'](db[_0x4f9f('0x5e')][_0x4f9f('0x30')]);return db[_0x4f9f('0x6b')][_0x4f9f('0x44')]({'raw':!![],'attributes':['id',_0x4f9f('0x71')]})[_0x4f9f('0x29')](function(_0x33e753){_0x4c8a5d=_0x33e753;var _0xa64932=squel['select']()[_0x4f9f('0x3a')](_0x18122b)[_0x4f9f('0x72')](_0x4f9f('0x73'),'c')[_0x4f9f('0x3e')](_0x4f9f('0x74'),_0x2f25ab)[_0x4f9f('0x3e')](_0x4f9f('0x75'))[_0x4f9f('0x76')]();for(var _0x541c30=0x0;_0x541c30<_0x4c8a5d[_0x4f9f('0x48')];_0x541c30++){_0xa64932[_0x4f9f('0x77')](_0x4f9f('0x78')+_0x4c8a5d[_0x541c30]['id'],_0x4f9f('0x79')+_0x4c8a5d[_0x541c30][_0x4f9f('0x71')]);}for(var _0x541c30=0x0;_0x541c30<_0x472fcc['length'];_0x541c30++){_0xa64932[_0x4f9f('0x77')](squel[_0x4f9f('0x7a')]()[_0x4f9f('0x77')](_0x4f9f('0x7b'))['from'](_0x4f9f('0x7c'))[_0x4f9f('0x3e')](_0x4f9f('0x7d'),_0x472fcc[_0x541c30]['id'])[_0x4f9f('0x3e')](_0x4f9f('0x7e')),_0x4f9f('0x7f')+_0x472fcc[_0x541c30][_0x4f9f('0x2c')]);_0xa64932['field'](squel[_0x4f9f('0x7a')]()[_0x4f9f('0x77')](_0x4f9f('0x80'))[_0x4f9f('0x72')](_0x4f9f('0x7c'))[_0x4f9f('0x3e')](_0x4f9f('0x7d'),_0x472fcc[_0x541c30]['id'])['where']('CmContactId\x20=\x20c.id'),'description_additionalPhone_'+_0x472fcc[_0x541c30][_0x4f9f('0x2c')]);}var _0x54e6ea=[];_0x54e6ea[_0x4f9f('0x62')](_0xa64932[_0x4f9f('0x81')]());BPromise[_0x4f9f('0x63')](_0x54e6ea,handleQuery)[_0x4f9f('0x29')](function(_0x132773){handleQuery(_0xa64932[_0x4f9f('0x81')]());var _0x3d1c15=csv_results[0x0];if(!_[_0x4f9f('0x82')](_0x3d1c15)){var _0x103628=toCsv(_0x3d1c15);var _0x435771=Date[_0x4f9f('0x83')]();fs['writeFileSync'](util[_0x4f9f('0x84')]('/tmp/list_%d_%s.csv',_0x2f25ab,_0x435771),_0x103628);_0x5738e8['setHeader'](_0x4f9f('0x85'),'attachment;\x20filename='+util[_0x4f9f('0x84')](_0x4f9f('0x86'),_0x2f25ab,_0x435771));_0x5738e8[_0x4f9f('0x87')](_0x4f9f('0x88'),_0x4f9f('0x89'));return _0x5738e8[_0x4f9f('0x8a')](util[_0x4f9f('0x84')](_0x4f9f('0x8b'),_0x2f25ab,_0x435771));}else{return _0x5738e8[_0x4f9f('0x1c')](0xcc);}});});});};exports[_0x4f9f('0x8c')]=function(_0x18c5b0,_0x2a83a4,_0xf82bc1){var _0x2313b3;delete _0x18c5b0['body']['id'];return db[_0x4f9f('0x2f')][_0x4f9f('0x58')]({'where':{'id':_0x18c5b0[_0x4f9f('0x47')]['id']}})[_0x4f9f('0x29')](handleEntityNotFound(_0x2a83a4,null))[_0x4f9f('0x29')](function(_0x107ab1){if(_0x107ab1){return db[_0x4f9f('0x8d')]['transaction'](function(_0x5dcd27){return db[_0x4f9f('0x6b')]['create'](_0x18c5b0[_0x4f9f('0x4c')],{'transaction':_0x5dcd27})[_0x4f9f('0x29')](function(_0x323f99){_0x2313b3=_0x323f99;return _0x107ab1[_0x4f9f('0x8e')](_0x323f99,{'transaction':_0x5dcd27});})[_0x4f9f('0x29')](function(){var _0x4c8850={'type':db['Sequelize'][_0x4f9f('0x8f')],'transaction':_0x5dcd27};switch(_0x18c5b0[_0x4f9f('0x4c')]['type']){case _0x4f9f('0x90'):_0x4c8850[_0x4f9f('0x32')]=db[_0x4f9f('0x91')][_0x4f9f('0x8f')];break;case _0x4f9f('0x92'):_0x4c8850[_0x4f9f('0x32')]=db[_0x4f9f('0x91')][_0x4f9f('0x93')];break;case _0x4f9f('0x94'):_0x4c8850[_0x4f9f('0x32')]=db[_0x4f9f('0x91')][_0x4f9f('0x95')];_0x4c8850[_0x4f9f('0x96')]=![];break;default:}return db[_0x4f9f('0x8d')][_0x4f9f('0x97')][_0x4f9f('0x98')](_0x4f9f('0x73'),util[_0x4f9f('0x84')](_0x4f9f('0x99'),_0x2313b3['id']),_0x4c8850);})[_0x4f9f('0x29')](function(){return _0x2313b3;});});}})[_0x4f9f('0x29')](respondWithResult(_0x2a83a4,null))[_0x4f9f('0x4a')](handleError(_0x2a83a4,null));};exports['getCustomFields']=function(_0x25cb7f,_0x2d56df,_0xda7942){var _0x556c51={};var _0x59bd20={};var _0x51d821;var _0x4dc856;return db[_0x4f9f('0x2f')][_0x4f9f('0x58')]({'where':{'id':_0x25cb7f[_0x4f9f('0x47')]['id']}})[_0x4f9f('0x29')](handleEntityNotFound(_0x2d56df,null))['then'](function(_0x1f58b4){if(_0x1f58b4){_0x51d821=_0x1f58b4;_0x59bd20[_0x4f9f('0x38')]=_[_0x4f9f('0x35')](db[_0x4f9f('0x6b')][_0x4f9f('0x30')]);_0x59bd20[_0x4f9f('0x34')]=_[_0x4f9f('0x35')](_0x25cb7f[_0x4f9f('0x34')]);_0x59bd20[_0x4f9f('0x36')]=_['intersection'](_0x59bd20[_0x4f9f('0x38')],_0x59bd20[_0x4f9f('0x34')]);_0x556c51[_0x4f9f('0x39')]=_[_0x4f9f('0x37')](_0x59bd20[_0x4f9f('0x38')],qs['fields'](_0x25cb7f['query']['fields']));_0x556c51[_0x4f9f('0x39')]=_0x556c51['attributes']['length']?_0x556c51[_0x4f9f('0x39')]:_0x59bd20[_0x4f9f('0x38')];_0x556c51[_0x4f9f('0x3d')]=qs['sort'](_0x25cb7f[_0x4f9f('0x34')][_0x4f9f('0x59')]);_0x556c51[_0x4f9f('0x3e')]=qs[_0x4f9f('0x36')](_[_0x4f9f('0x5a')](_0x25cb7f['query'],_0x59bd20['filters']));_0x556c51[_0x4f9f('0x3e')]=_['merge'](_0x556c51['where'],{'$or':[{'ListId':_0x1f58b4['id']},{'ListId':null}]});if(_0x25cb7f['query'][_0x4f9f('0x3f')]){_0x556c51[_0x4f9f('0x3e')]=_[_0x4f9f('0x6e')](_0x556c51[_0x4f9f('0x3e')],{'$or':_[_0x4f9f('0x2e')](_0x556c51[_0x4f9f('0x39')],function(_0x38b1a4){var _0x2aea16={};_0x2aea16[_0x38b1a4]={'$like':'%'+_0x25cb7f['query'][_0x4f9f('0x3f')]+'%'};return _0x2aea16;})});}_0x556c51=_[_0x4f9f('0x6e')]({},_0x556c51,_0x25cb7f['options']);return db['CmCustomField'][_0x4f9f('0x9a')](_0x556c51);}})[_0x4f9f('0x29')](respondWithResult(_0x2d56df,null))['catch'](handleError(_0x2d56df,null));};exports[_0x4f9f('0x9b')]=function(_0x51da82,_0xa03d7f){return db[_0x4f9f('0x6b')][_0x4f9f('0x9a')]({'where':{'ListId':null}})[_0x4f9f('0x29')](handleEntityNotFound(_0xa03d7f,null))['then'](function(_0x7c2b9b){return _0x7c2b9b;})[_0x4f9f('0x29')](respondWithResult(_0xa03d7f,null))[_0x4f9f('0x4a')](handleError(_0xa03d7f,null));};exports['addAgents']=function(_0x50cfee,_0x2c3f06,_0xdf276b){return db[_0x4f9f('0x2f')][_0x4f9f('0x49')]({'where':{'id':_0x50cfee['params']['id']}})['then'](handleEntityNotFound(_0x2c3f06,null))[_0x4f9f('0x29')](function(_0x2779f5){if(_0x2779f5){return _0x2779f5[_0x4f9f('0x9c')](_0x50cfee[_0x4f9f('0x4c')][_0x4f9f('0x5c')],_[_0x4f9f('0x64')](_0x50cfee[_0x4f9f('0x4c')],[_0x4f9f('0x5c'),'id'])||{})[_0x4f9f('0x9d')](function(_0x1e5cff){for(var _0x24a8a9=0x0;_0x24a8a9<_0x50cfee['body'][_0x4f9f('0x5c')]['length'];_0x24a8a9+=0x1){socket[_0x4f9f('0x9e')](_0x4f9f('0x9f'),{'UserId':Number(_0x50cfee[_0x4f9f('0x4c')][_0x4f9f('0x5c')][_0x24a8a9]),'CmListId':Number(_0x50cfee[_0x4f9f('0x47')]['id'])});}return _0x1e5cff;});}})[_0x4f9f('0x29')](respondWithResult(_0x2c3f06,null))['catch'](handleError(_0x2c3f06,null));};exports[_0x4f9f('0xa0')]=function(_0x1a22e7,_0x4113d0,_0x28a2e5){return db[_0x4f9f('0x2f')][_0x4f9f('0x49')]({'where':{'id':_0x1a22e7[_0x4f9f('0x47')]['id']}})[_0x4f9f('0x29')](handleEntityNotFound(_0x4113d0,null))['then'](function(_0x3101f4){if(_0x3101f4){return _0x3101f4[_0x4f9f('0xa0')](_0x1a22e7[_0x4f9f('0x34')]['ids'])[_0x4f9f('0x29')](function(){if(_[_0x4f9f('0x61')](_0x1a22e7[_0x4f9f('0x34')][_0x4f9f('0x5c')])){for(var _0x17f297=0x0;_0x17f297<_0x1a22e7[_0x4f9f('0x34')][_0x4f9f('0x5c')][_0x4f9f('0x48')];_0x17f297+=0x1){socket['emit'](_0x4f9f('0xa1'),{'UserId':Number(_0x1a22e7[_0x4f9f('0x34')][_0x4f9f('0x5c')][_0x17f297]),'CmListId':Number(_0x1a22e7[_0x4f9f('0x47')]['id'])});}}else{socket[_0x4f9f('0x9e')](_0x4f9f('0xa1'),{'UserId':Number(_0x1a22e7[_0x4f9f('0x34')][_0x4f9f('0x5c')]),'CmListId':Number(_0x1a22e7['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4113d0,null))[_0x4f9f('0x4a')](handleError(_0x4113d0,null));};exports['getAgents']=function(_0x1e229c,_0x34dc9f,_0xc73f67){var _0x338475={};var _0x1aca4b={};var _0xa96587;var _0x3d95af;return db[_0x4f9f('0x2f')][_0x4f9f('0x58')]({'where':{'id':_0x1e229c[_0x4f9f('0x47')]['id']}})['then'](handleEntityNotFound(_0x34dc9f,null))[_0x4f9f('0x29')](function(_0x1c9ce2){if(_0x1c9ce2){_0xa96587=_0x1c9ce2;_0x1aca4b[_0x4f9f('0x38')]=_[_0x4f9f('0x35')](db[_0x4f9f('0xa2')]['rawAttributes']);_0x1aca4b['query']=_[_0x4f9f('0x35')](_0x1e229c['query']);_0x1aca4b[_0x4f9f('0x36')]=_[_0x4f9f('0x37')](_0x1aca4b['model'],_0x1aca4b[_0x4f9f('0x34')]);_0x338475['attributes']=_[_0x4f9f('0x37')](_0x1aca4b[_0x4f9f('0x38')],qs['fields'](_0x1e229c[_0x4f9f('0x34')][_0x4f9f('0x3a')]));_0x338475[_0x4f9f('0x39')]=_0x338475[_0x4f9f('0x39')][_0x4f9f('0x48')]?_0x338475['attributes']:_0x1aca4b['model'];_0x338475[_0x4f9f('0x3d')]=qs['sort'](_0x1e229c[_0x4f9f('0x34')][_0x4f9f('0x59')]);_0x338475[_0x4f9f('0x3e')]=qs[_0x4f9f('0x36')](_['pick'](_0x1e229c[_0x4f9f('0x34')],_0x1aca4b[_0x4f9f('0x36')]));if(_0x1e229c[_0x4f9f('0x34')][_0x4f9f('0x3f')]){_0x338475[_0x4f9f('0x3e')]=_[_0x4f9f('0x6e')](_0x338475[_0x4f9f('0x3e')],{'$or':_[_0x4f9f('0x2e')](_0x338475[_0x4f9f('0x39')],function(_0x4bfb08){var _0x4fb6ec={};_0x4fb6ec[_0x4bfb08]={'$like':'%'+_0x1e229c[_0x4f9f('0x34')][_0x4f9f('0x3f')]+'%'};return _0x4fb6ec;})});}_0x338475=_['merge']({},_0x338475,_0x1e229c[_0x4f9f('0x41')]);return _0xa96587[_0x4f9f('0xa3')](_0x338475);}})[_0x4f9f('0x29')](function(_0x4063d5){if(_0x4063d5){_0x3d95af=_0x4063d5['length'];if(!_0x1e229c[_0x4f9f('0x34')][_0x4f9f('0x3b')](_0x4f9f('0x3c'))){_0x338475[_0x4f9f('0x22')]=qs[_0x4f9f('0x22')](_0x1e229c[_0x4f9f('0x34')][_0x4f9f('0x22')]);_0x338475[_0x4f9f('0x20')]=qs['offset'](_0x1e229c[_0x4f9f('0x34')]['offset']);}return _0xa96587[_0x4f9f('0xa3')](_0x338475);}})[_0x4f9f('0x29')](function(_0x32e914){if(_0x32e914){return _0x32e914?{'count':_0x3d95af,'rows':_0x32e914}:null;}})[_0x4f9f('0x29')](respondWithResult(_0x34dc9f,null))['catch'](handleError(_0x34dc9f,null));};function handleQuery(_0x3e2311){logger['info'](_0x3e2311);return db[_0x4f9f('0x8d')][_0x4f9f('0x34')](_0x3e2311)['spread'](function(_0x33e58b){csv_results[_0x4f9f('0x62')](_0x33e58b);})[_0x4f9f('0x4a')](function(_0x188a79){logger['error'](_0x188a79[_0x4f9f('0x68')]);});}
\ No newline at end of file
+var _0xca9a=['INTEGER','switch','BOOLEAN','queryInterface','addColumn','getCustomFields','getGlobalCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','info','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','Lists','UserProfileResource','error','stack','name','send','index','map','CmList','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','keys','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ListId','Disposition','nolimit','findAll','ids','addContacts','tags','isArray','each','omit','success','push','dataValues','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','cf_%d','raw','getContactsCsv','alias','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','c.cf_','customField_','field','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','addCustomField','findOne','sequelize','transaction','addCustomFields','Sequelize','TEXT','text'];(function(_0x3f06b8,_0x45c58c){var _0x5d2028=function(_0x3b0de6){while(--_0x3b0de6){_0x3f06b8['push'](_0x3f06b8['shift']());}};_0x5d2028(++_0x45c58c);}(_0xca9a,0xae));var _0xaca9=function(_0x28c17d,_0x5cbff4){_0x28c17d=_0x28c17d-0x0;var _0x10ab99=_0xca9a[_0x28c17d];return _0x10ab99;};'use strict';var emlformat=require(_0xaca9('0x0'));var rimraf=require(_0xaca9('0x1'));var zipdir=require(_0xaca9('0x2'));var jsonpatch=require(_0xaca9('0x3'));var rp=require(_0xaca9('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaca9('0x5'));var path=require(_0xaca9('0x6'));var sox=require('sox');var csv=require(_0xaca9('0x7'));var ejs=require(_0xaca9('0x8'));var fs=require('fs');var fs_extra=require(_0xaca9('0x9'));var _=require(_0xaca9('0xa'));var squel=require(_0xaca9('0xb'));var crypto=require(_0xaca9('0xc'));var jsforce=require(_0xaca9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaca9('0x7'));var querystring=require(_0xaca9('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaca9('0xf'));var hardwareService=require(_0xaca9('0x10'));var logger=require(_0xaca9('0x11'))('api');var utils=require(_0xaca9('0x12'));var config=require(_0xaca9('0x13'));var licenseUtil=require(_0xaca9('0x14'));var db=require(_0xaca9('0x15'))['db'];var csv_results;config[_0xaca9('0x16')]=_[_0xaca9('0x17')](config[_0xaca9('0x16')],{'host':_0xaca9('0x18'),'port':0x18eb});var socket=require(_0xaca9('0x19'))(new Redis(config[_0xaca9('0x16')]));require('./cmList.socket')[_0xaca9('0x1a')](socket);function respondWithStatusCode(_0x23d819,_0x38f9f3){_0x38f9f3=_0x38f9f3||0xcc;return function(_0x26097d){if(_0x26097d){return _0x23d819[_0xaca9('0x1b')](_0x38f9f3);}return _0x23d819[_0xaca9('0x1c')](_0x38f9f3)[_0xaca9('0x1d')]();};}function respondWithResult(_0x186a9c,_0xaa34eb){_0xaa34eb=_0xaa34eb||0xc8;return function(_0x49ba27){if(_0x49ba27){return _0x186a9c[_0xaca9('0x1c')](_0xaa34eb)[_0xaca9('0x1e')](_0x49ba27);}};}function respondWithFilteredResult(_0x14016c,_0x470152){return function(_0xb0bfba){if(_0xb0bfba){var _0x4dde9c=typeof _0x470152[_0xaca9('0x1f')]===_0xaca9('0x20')&&typeof _0x470152['limit']===_0xaca9('0x20');var _0x572ec2=_0xb0bfba[_0xaca9('0x21')];var _0x3abd38=_0x4dde9c?0x0:_0x470152[_0xaca9('0x1f')];var _0x3c1102=_0x4dde9c?_0xb0bfba[_0xaca9('0x21')]:_0x470152['offset']+_0x470152[_0xaca9('0x22')];var _0x517c24;if(_0x3c1102>=_0x572ec2){_0x3c1102=_0x572ec2;_0x517c24=0xc8;}else{_0x517c24=0xce;}_0x14016c[_0xaca9('0x1c')](_0x517c24);return _0x14016c[_0xaca9('0x23')](_0xaca9('0x24'),_0x3abd38+'-'+_0x3c1102+'/'+_0x572ec2)['json'](_0xb0bfba);}return null;};}function patchUpdates(_0x3c002b){return function(_0x255ab6){try{jsonpatch['apply'](_0x255ab6,_0x3c002b,!![]);}catch(_0x441d1e){return BPromise[_0xaca9('0x25')](_0x441d1e);}return _0x255ab6[_0xaca9('0x26')]();};}function saveUpdates(_0xaf579d,_0x201210){return function(_0x29d382){if(_0x29d382){return _0x29d382['update'](_0xaf579d)[_0xaca9('0x27')](function(_0x171955){return _0x171955;});}return null;};}function removeEntity(_0x114099,_0x18ed75){return function(_0xe5480c){if(_0xe5480c){return _0xe5480c[_0xaca9('0x28')]()[_0xaca9('0x27')](function(){var _0x4326ab=_0xe5480c['get']({'plain':!![]});var _0x2666ae=_0xaca9('0x29');return db[_0xaca9('0x2a')][_0xaca9('0x28')]({'where':{'type':_0x2666ae,'resourceId':_0x4326ab['id']}})['then'](function(){return _0xe5480c;});})['then'](function(){_0x114099[_0xaca9('0x1c')](0xcc)[_0xaca9('0x1d')]();});}};}function handleEntityNotFound(_0x5bc424,_0xa4ffc1){return function(_0x54823d){if(!_0x54823d){_0x5bc424[_0xaca9('0x1b')](0x194);}return _0x54823d;};}function handleError(_0x3af97c,_0x32dfe0){_0x32dfe0=_0x32dfe0||0x1f4;return function(_0x236fb2){logger[_0xaca9('0x2b')](_0x236fb2[_0xaca9('0x2c')]);if(_0x236fb2[_0xaca9('0x2d')]){delete _0x236fb2['name'];}_0x3af97c['status'](_0x32dfe0)[_0xaca9('0x2e')](_0x236fb2);};}exports[_0xaca9('0x2f')]=function(_0x2281f2,_0x3b8744){var _0x5da67a={},_0x4bf06e={},_0x4eb8c5={'count':0x0,'rows':[]};var _0x4204f1=_[_0xaca9('0x30')](db[_0xaca9('0x31')][_0xaca9('0x32')],function(_0x939594){return{'name':_0x939594['fieldName'],'type':_0x939594[_0xaca9('0x33')]['key']};});_0x4bf06e[_0xaca9('0x34')]=_[_0xaca9('0x30')](_0x4204f1,_0xaca9('0x2d'));_0x4bf06e[_0xaca9('0x35')]=_['keys'](_0x2281f2[_0xaca9('0x35')]);_0x4bf06e[_0xaca9('0x36')]=_[_0xaca9('0x37')](_0x4bf06e[_0xaca9('0x34')],_0x4bf06e[_0xaca9('0x35')]);_0x5da67a[_0xaca9('0x38')]=_[_0xaca9('0x37')](_0x4bf06e['model'],qs[_0xaca9('0x39')](_0x2281f2[_0xaca9('0x35')]['fields']));_0x5da67a[_0xaca9('0x38')]=_0x5da67a[_0xaca9('0x38')][_0xaca9('0x3a')]?_0x5da67a[_0xaca9('0x38')]:_0x4bf06e[_0xaca9('0x34')];if(!_0x2281f2[_0xaca9('0x35')][_0xaca9('0x3b')]('nolimit')){_0x5da67a['limit']=qs['limit'](_0x2281f2[_0xaca9('0x35')][_0xaca9('0x22')]);_0x5da67a['offset']=qs[_0xaca9('0x1f')](_0x2281f2['query']['offset']);}_0x5da67a[_0xaca9('0x3c')]=qs[_0xaca9('0x3d')](_0x2281f2['query'][_0xaca9('0x3d')]);_0x5da67a[_0xaca9('0x3e')]=qs[_0xaca9('0x36')](_[_0xaca9('0x3f')](_0x2281f2[_0xaca9('0x35')],_0x4bf06e[_0xaca9('0x36')]),_0x4204f1);if(_0x2281f2[_0xaca9('0x35')][_0xaca9('0x40')]){_0x5da67a[_0xaca9('0x3e')]=_[_0xaca9('0x41')](_0x5da67a[_0xaca9('0x3e')],{'$or':_[_0xaca9('0x30')](_0x4204f1,function(_0x4594db){if(_0x4594db[_0xaca9('0x33')]!==_0xaca9('0x42')){var _0x205481={};_0x205481[_0x4594db['name']]={'$like':'%'+_0x2281f2[_0xaca9('0x35')][_0xaca9('0x40')]+'%'};return _0x205481;}})});}_0x5da67a=_[_0xaca9('0x41')]({},_0x5da67a,_0x2281f2[_0xaca9('0x43')]);var _0x5d1a5e={'where':_0x5da67a['where']};return db['CmList'][_0xaca9('0x21')](_0x5d1a5e)[_0xaca9('0x27')](function(_0x32ba0d){_0x4eb8c5[_0xaca9('0x21')]=_0x32ba0d;if(_0x2281f2[_0xaca9('0x35')][_0xaca9('0x44')]){_0x5da67a[_0xaca9('0x45')]=[{'all':!![]}];}return db[_0xaca9('0x31')]['findAll'](_0x5da67a);})[_0xaca9('0x27')](function(_0x35a978){_0x4eb8c5['rows']=_0x35a978;return _0x4eb8c5;})[_0xaca9('0x27')](respondWithFilteredResult(_0x3b8744,_0x5da67a))[_0xaca9('0x46')](handleError(_0x3b8744,null));};exports[_0xaca9('0x47')]=function(_0x193d28,_0x20289b){var _0x1e70ed={'raw':![],'where':{'id':_0x193d28[_0xaca9('0x48')]['id']}},_0x241d8f={};_0x241d8f['model']=_[_0xaca9('0x49')](db['CmList'][_0xaca9('0x32')]);_0x241d8f[_0xaca9('0x35')]=_[_0xaca9('0x49')](_0x193d28[_0xaca9('0x35')]);_0x241d8f[_0xaca9('0x36')]=_[_0xaca9('0x37')](_0x241d8f[_0xaca9('0x34')],_0x241d8f[_0xaca9('0x35')]);_0x1e70ed['attributes']=_['intersection'](_0x241d8f[_0xaca9('0x34')],qs['fields'](_0x193d28['query'][_0xaca9('0x39')]));_0x1e70ed[_0xaca9('0x38')]=_0x1e70ed[_0xaca9('0x38')][_0xaca9('0x3a')]?_0x1e70ed[_0xaca9('0x38')]:_0x241d8f[_0xaca9('0x34')];if(_0x193d28[_0xaca9('0x35')][_0xaca9('0x44')]){_0x1e70ed[_0xaca9('0x45')]=[{'all':!![]}];}_0x1e70ed=_[_0xaca9('0x41')]({},_0x1e70ed,_0x193d28[_0xaca9('0x43')]);return db[_0xaca9('0x31')]['find'](_0x1e70ed)[_0xaca9('0x27')](handleEntityNotFound(_0x20289b,null))[_0xaca9('0x27')](respondWithResult(_0x20289b,null))['catch'](handleError(_0x20289b,null));};exports[_0xaca9('0x4a')]=function(_0x4bf861,_0x3365b2){return db['CmList'][_0xaca9('0x4a')](_0x4bf861[_0xaca9('0x4b')],{})[_0xaca9('0x27')](function(_0x302e76){var _0x4c2110=_0x4bf861['user']['get']({'plain':!![]});if(!_0x4c2110)throw new Error(_0xaca9('0x4c'));if(_0x4c2110[_0xaca9('0x4d')]==='user'){var _0x3df624=_0x302e76[_0xaca9('0x4e')]({'plain':!![]});var _0x4711d2=_0xaca9('0x29');return db[_0xaca9('0x4f')][_0xaca9('0x50')]({'where':{'name':_0x4711d2,'userProfileId':_0x4c2110['userProfileId']},'raw':!![]})[_0xaca9('0x27')](function(_0x381d67){if(_0x381d67&&_0x381d67[_0xaca9('0x51')]===0x0){return db['UserProfileResource'][_0xaca9('0x4a')]({'name':_0x3df624[_0xaca9('0x2d')],'resourceId':_0x3df624['id'],'type':_0x381d67['name'],'sectionId':_0x381d67['id']},{})['then'](function(){return _0x302e76;});}else{return _0x302e76;}})[_0xaca9('0x46')](function(_0x400c38){logger[_0xaca9('0x2b')](_0xaca9('0x52'),_0x400c38);throw _0x400c38;});}return _0x302e76;})['then'](respondWithResult(_0x3365b2,0xc9))[_0xaca9('0x46')](handleError(_0x3365b2,null));};exports[_0xaca9('0x53')]=function(_0x38b9f8,_0x3feb47){if(_0x38b9f8[_0xaca9('0x4b')]['id']){delete _0x38b9f8[_0xaca9('0x4b')]['id'];}return db[_0xaca9('0x31')][_0xaca9('0x50')]({'where':{'id':_0x38b9f8['params']['id']}})[_0xaca9('0x27')](handleEntityNotFound(_0x3feb47,null))[_0xaca9('0x27')](saveUpdates(_0x38b9f8[_0xaca9('0x4b')],null))['then'](respondWithResult(_0x3feb47,null))[_0xaca9('0x46')](handleError(_0x3feb47,null));};exports[_0xaca9('0x28')]=function(_0x352d40,_0x4dc3ab){return db[_0xaca9('0x31')]['find']({'where':{'id':_0x352d40[_0xaca9('0x48')]['id']}})[_0xaca9('0x27')](handleEntityNotFound(_0x4dc3ab,null))['then'](removeEntity(_0x4dc3ab,null))[_0xaca9('0x46')](handleError(_0x4dc3ab,null));};exports[_0xaca9('0x54')]=function(_0x167112,_0x4c86e2){return db[_0xaca9('0x31')][_0xaca9('0x54')]()[_0xaca9('0x27')](respondWithResult(_0x4c86e2,null))['catch'](handleError(_0x4c86e2,null));};exports[_0xaca9('0x55')]=function(_0x13d617,_0x35cf6d,_0xcd4e04){if(_0x13d617[_0xaca9('0x4b')]['id']){delete _0x13d617['body']['id'];}return db[_0xaca9('0x31')][_0xaca9('0x50')]({'where':{'id':_0x13d617[_0xaca9('0x48')]['id']}})[_0xaca9('0x27')](handleEntityNotFound(_0x35cf6d,null))[_0xaca9('0x27')](function(_0x30b533){if(_0x30b533){_0x13d617[_0xaca9('0x4b')][_0xaca9('0x56')]=_0x30b533['id'];return db['Disposition']['create'](_0x13d617[_0xaca9('0x4b')]);}})[_0xaca9('0x27')](respondWithResult(_0x35cf6d,null))['catch'](handleError(_0x35cf6d,null));};exports['getDispositions']=function(_0x1b3159,_0x41b3ba,_0x4335e6){var _0x3e9802={'raw':![],'where':{}};var _0x3ebe9f={};var _0x4135de={'count':0x0,'rows':[]};return db[_0xaca9('0x31')]['findOne']({'where':{'id':_0x1b3159[_0xaca9('0x48')]['id']}})['then'](handleEntityNotFound(_0x41b3ba,null))[_0xaca9('0x27')](function(_0x3ea644){if(_0x3ea644){_0x3ebe9f[_0xaca9('0x34')]=_['keys'](db[_0xaca9('0x57')][_0xaca9('0x32')]);_0x3ebe9f['query']=_[_0xaca9('0x49')](_0x1b3159[_0xaca9('0x35')]);_0x3ebe9f[_0xaca9('0x36')]=_[_0xaca9('0x37')](_0x3ebe9f[_0xaca9('0x34')],_0x3ebe9f[_0xaca9('0x35')]);_0x3e9802[_0xaca9('0x38')]=_[_0xaca9('0x37')](_0x3ebe9f['model'],qs[_0xaca9('0x39')](_0x1b3159['query'][_0xaca9('0x39')]));_0x3e9802[_0xaca9('0x38')]=_0x3e9802[_0xaca9('0x38')][_0xaca9('0x3a')]?_0x3e9802[_0xaca9('0x38')]:_0x3ebe9f[_0xaca9('0x34')];if(!_0x1b3159[_0xaca9('0x35')]['hasOwnProperty'](_0xaca9('0x58'))){_0x3e9802[_0xaca9('0x22')]=qs['limit'](_0x1b3159['query'][_0xaca9('0x22')]);_0x3e9802[_0xaca9('0x1f')]=qs['offset'](_0x1b3159['query'][_0xaca9('0x1f')]);}_0x3e9802[_0xaca9('0x3c')]=qs[_0xaca9('0x3d')](_0x1b3159[_0xaca9('0x35')][_0xaca9('0x3d')]);_0x3e9802[_0xaca9('0x3e')]=qs[_0xaca9('0x36')](_[_0xaca9('0x3f')](_0x1b3159['query'],_0x3ebe9f[_0xaca9('0x36')]));_0x3e9802[_0xaca9('0x3e')][_0xaca9('0x56')]=_0x3ea644['id'];if(_0x1b3159[_0xaca9('0x35')]['filter']){_0x3e9802[_0xaca9('0x3e')]=_[_0xaca9('0x41')](_0x3e9802[_0xaca9('0x3e')],{'$or':_[_0xaca9('0x30')](_0x3e9802[_0xaca9('0x38')],function(_0x80c62a){var _0x4e6137={};_0x4e6137[_0x80c62a]={'$like':'%'+_0x1b3159['query'][_0xaca9('0x40')]+'%'};return _0x4e6137;})});}_0x3e9802=_['merge']({},_0x3e9802,_0x1b3159[_0xaca9('0x43')]);return db[_0xaca9('0x57')][_0xaca9('0x21')]({'where':_0x3e9802['where']})['then'](function(_0x3d82c0){_0x4135de[_0xaca9('0x21')]=_0x3d82c0;if(_0x1b3159[_0xaca9('0x35')]['includeAll']){_0x3e9802[_0xaca9('0x45')]=[{'all':!![]}];}return db['Disposition'][_0xaca9('0x59')](_0x3e9802);})[_0xaca9('0x27')](function(_0x4e151b){_0x4135de['rows']=_0x4e151b;return _0x4135de;});}})[_0xaca9('0x27')](respondWithFilteredResult(_0x41b3ba,_0x3e9802))[_0xaca9('0x46')](handleError(_0x41b3ba,null));};exports['removeDispositions']=function(_0x4ddbd8,_0x4f9bfe,_0x482c2b){return db[_0xaca9('0x31')][_0xaca9('0x50')]({'where':{'id':_0x4ddbd8[_0xaca9('0x48')]['id']}})[_0xaca9('0x27')](handleEntityNotFound(_0x4f9bfe,null))[_0xaca9('0x27')](function(_0x27f03e){if(_0x27f03e){return _0x27f03e['removeDispositions'](_0x4ddbd8[_0xaca9('0x35')][_0xaca9('0x5a')]);}})[_0xaca9('0x27')](respondWithStatusCode(_0x4f9bfe,null))[_0xaca9('0x46')](handleError(_0x4f9bfe,null));};exports[_0xaca9('0x5b')]=function(_0x260975,_0x438ac3,_0xdc48fc){return db[_0xaca9('0x31')][_0xaca9('0x50')]({'where':{'id':_0x260975[_0xaca9('0x48')]['id']}})['then'](handleEntityNotFound(_0x438ac3,null))[_0xaca9('0x27')](function(_0x29e5c7){if(_0x29e5c7){var _0x2591b4=[];var _0x434072={'success':[],'errors':[]};return db['CmContact'][_0xaca9('0x54')]()[_0xaca9('0x27')](function(_0x53f1ec){if(_0x260975['body'][_0xaca9('0x5c')]&&_['isArray'](_0x260975[_0xaca9('0x4b')]['tags'])){if(_0x260975[_0xaca9('0x4b')]['tags'][_0xaca9('0x3a')]){_0x260975[_0xaca9('0x4b')][_0xaca9('0x5c')]=_0x260975['body'][_0xaca9('0x5c')]['join'](';')+';';}else{_0x260975[_0xaca9('0x4b')][_0xaca9('0x5c')]=null;}}else{_0x260975[_0xaca9('0x4b')][_0xaca9('0x5c')]=null;}if(_0x260975[_0xaca9('0x4b')]&&_[_0xaca9('0x5d')](_0x260975['body'])){for(var _0x56c8c4=0x0;_0x56c8c4<_0x260975[_0xaca9('0x4b')][_0xaca9('0x3a')];_0x56c8c4+=0x1){_0x260975[_0xaca9('0x4b')][_0x56c8c4]['ListId']=_0x260975[_0xaca9('0x48')]['id'];_0x2591b4['push'](_0x260975[_0xaca9('0x4b')][_0x56c8c4]);}return BPromise[_0xaca9('0x5e')](_0x2591b4,function(_0x1d88c1){return db['CmContact'][_0xaca9('0x4a')](_[_0xaca9('0x5f')](_0x1d88c1,[_0xaca9('0x5a'),'id'])||{},{'fields':_[_0xaca9('0x49')](_0x53f1ec),'raw':!![]})[_0xaca9('0x27')](function(_0x2106e7){_0x434072[_0xaca9('0x60')][_0xaca9('0x61')](_0x2106e7[_0xaca9('0x62')]);})[_0xaca9('0x46')](function(_0x1f5a19){_0x434072['errors']['push']({'data':_0x1d88c1,'error':_0x1f5a19[_0xaca9('0x63')]});});})[_0xaca9('0x27')](function(_0x597609){return _0x434072;})[_0xaca9('0x46')](function(_0x1108d8){return _0x1108d8;});}else{_0x438ac3[_0xaca9('0x1c')](0x190)[_0xaca9('0x1e')]({'message':_0xaca9('0x64')});}});}})[_0xaca9('0x27')](respondWithResult(_0x438ac3,null))[_0xaca9('0x46')](handleError(_0x438ac3,null));};exports[_0xaca9('0x65')]=function(_0x24cd18,_0x287051,_0x3a73bb){var _0x51c3f9;return db[_0xaca9('0x31')][_0xaca9('0x50')]({'where':{'id':_0x24cd18[_0xaca9('0x48')]['id']},'include':[{'model':db[_0xaca9('0x66')],'as':_0xaca9('0x67')}]})[_0xaca9('0x27')](handleEntityNotFound(_0x287051,null))[_0xaca9('0x27')](function(_0x3f84cc){if(_0x3f84cc){_0x51c3f9=_0x3f84cc;return db['CmContact'][_0xaca9('0x32')];}})[_0xaca9('0x27')](function(_0x314d11){if(_0x314d11){var _0x4bb515={};var _0x56c4f9={};_0x56c4f9[_0xaca9('0x34')]=_['concat'](_[_0xaca9('0x49')](_0x314d11),_[_0xaca9('0x30')](_0x51c3f9[_0xaca9('0x67')],function(_0x51d05a){return util[_0xaca9('0x68')](_0xaca9('0x69'),_0x51d05a['id']);}));_0x56c4f9['query']=_[_0xaca9('0x49')](_0x24cd18['query']);_0x56c4f9[_0xaca9('0x36')]=_[_0xaca9('0x37')](_0x56c4f9[_0xaca9('0x34')],_0x56c4f9[_0xaca9('0x35')]);_0x4bb515[_0xaca9('0x38')]=_[_0xaca9('0x37')](_0x56c4f9[_0xaca9('0x34')],qs[_0xaca9('0x39')](_0x24cd18[_0xaca9('0x35')][_0xaca9('0x39')]));_0x4bb515[_0xaca9('0x38')]=_0x4bb515[_0xaca9('0x38')]['length']?_0x4bb515[_0xaca9('0x38')]:_0x56c4f9['model'];if(!_0x24cd18[_0xaca9('0x35')][_0xaca9('0x3b')](_0xaca9('0x58'))){_0x4bb515['limit']=qs[_0xaca9('0x22')](_0x24cd18[_0xaca9('0x35')]['limit']);_0x4bb515[_0xaca9('0x1f')]=qs[_0xaca9('0x1f')](_0x24cd18[_0xaca9('0x35')]['offset']);}_0x4bb515[_0xaca9('0x3c')]=qs[_0xaca9('0x3d')](_0x24cd18[_0xaca9('0x35')][_0xaca9('0x3d')]);_0x4bb515[_0xaca9('0x3e')]=qs['filters'](_[_0xaca9('0x3f')](_0x24cd18[_0xaca9('0x35')],_0x56c4f9['filters']));_0x4bb515[_0xaca9('0x6a')]=!![];if(_0x24cd18[_0xaca9('0x35')][_0xaca9('0x40')]){_0x4bb515[_0xaca9('0x3e')]=_[_0xaca9('0x41')](_0x4bb515[_0xaca9('0x3e')],{'$or':_['map'](_0x4bb515[_0xaca9('0x38')],function(_0x200567){var _0x3c9508={};_0x3c9508[_0x200567]={'$like':'%'+_0x24cd18[_0xaca9('0x35')][_0xaca9('0x40')]+'%'};return _0x3c9508;})});}_0x4bb515=_[_0xaca9('0x41')]({},_0x4bb515,_0x24cd18[_0xaca9('0x43')]);return _0x51c3f9[_0xaca9('0x65')](_0x4bb515);}})['then'](respondWithResult(_0x287051,null))['catch'](handleError(_0x287051,null));};exports[_0xaca9('0x6b')]=function(_0x8b50a0,_0x4fa846,_0x9f4396){var _0x463a52;var _0x1b7543;var _0x31118e;var _0x44db53=_0x8b50a0[_0xaca9('0x48')]['id'];csv_results=[];return db['ContactItemType']['findAll']({'attributes':['id',_0xaca9('0x2d')],'raw':!![],'order':['OrderBy']})[_0xaca9('0x27')](function(_0x250839){_0x463a52=_0x250839;var _0x197c0=_[_0xaca9('0x49')](db['CmContact']['rawAttributes']);return db[_0xaca9('0x66')][_0xaca9('0x59')]({'raw':!![],'attributes':['id',_0xaca9('0x6c')]})[_0xaca9('0x27')](function(_0x2ea6cc){_0x1b7543=_0x2ea6cc;var _0x2ee133=squel[_0xaca9('0x6d')]()[_0xaca9('0x39')](_0x197c0)[_0xaca9('0x6e')](_0xaca9('0x6f'),'c')[_0xaca9('0x3e')](_0xaca9('0x70'),_0x44db53)[_0xaca9('0x3e')](_0xaca9('0x71'))[_0xaca9('0x72')]();for(var _0x4b4f20=0x0;_0x4b4f20<_0x1b7543[_0xaca9('0x3a')];_0x4b4f20++){_0x2ee133['field'](_0xaca9('0x73')+_0x1b7543[_0x4b4f20]['id'],_0xaca9('0x74')+_0x1b7543[_0x4b4f20][_0xaca9('0x6c')]);}for(var _0x4b4f20=0x0;_0x4b4f20<_0x463a52['length'];_0x4b4f20++){_0x2ee133[_0xaca9('0x75')](squel[_0xaca9('0x6d')]()[_0xaca9('0x75')](_0xaca9('0x76'))[_0xaca9('0x6e')](_0xaca9('0x77'))[_0xaca9('0x3e')](_0xaca9('0x78'),_0x463a52[_0x4b4f20]['id'])['where'](_0xaca9('0x79')),_0xaca9('0x7a')+_0x463a52[_0x4b4f20][_0xaca9('0x2d')]);_0x2ee133['field'](squel[_0xaca9('0x6d')]()[_0xaca9('0x75')](_0xaca9('0x7b'))['from'](_0xaca9('0x77'))[_0xaca9('0x3e')](_0xaca9('0x78'),_0x463a52[_0x4b4f20]['id'])[_0xaca9('0x3e')](_0xaca9('0x79')),_0xaca9('0x7c')+_0x463a52[_0x4b4f20]['name']);}var _0x58d5e1=[];_0x58d5e1['push'](_0x2ee133['toString']());BPromise[_0xaca9('0x5e')](_0x58d5e1,handleQuery)[_0xaca9('0x27')](function(_0x2ec19e){handleQuery(_0x2ee133[_0xaca9('0x7d')]());var _0x2e088f=csv_results[0x0];if(!_[_0xaca9('0x7e')](_0x2e088f)){var _0x374646=toCsv(_0x2e088f);var _0x5a5c10=Date['now']();fs[_0xaca9('0x7f')](util[_0xaca9('0x68')](_0xaca9('0x80'),_0x44db53,_0x5a5c10),_0x374646);_0x4fa846[_0xaca9('0x81')]('Content-disposition',_0xaca9('0x82')+util[_0xaca9('0x68')](_0xaca9('0x83'),_0x44db53,_0x5a5c10));_0x4fa846[_0xaca9('0x81')](_0xaca9('0x84'),_0xaca9('0x85'));return _0x4fa846['download'](util['format']('/tmp/list_%d_%s.csv',_0x44db53,_0x5a5c10));}else{return _0x4fa846[_0xaca9('0x1b')](0xcc);}});});});};exports[_0xaca9('0x86')]=function(_0x3ea68f,_0x421e07,_0x375a44){var _0x14950e;delete _0x3ea68f[_0xaca9('0x4b')]['id'];return db[_0xaca9('0x31')][_0xaca9('0x87')]({'where':{'id':_0x3ea68f[_0xaca9('0x48')]['id']}})[_0xaca9('0x27')](handleEntityNotFound(_0x421e07,null))[_0xaca9('0x27')](function(_0x5aff1a){if(_0x5aff1a){return db[_0xaca9('0x88')][_0xaca9('0x89')](function(_0x3e051c){return db[_0xaca9('0x66')][_0xaca9('0x4a')](_0x3ea68f[_0xaca9('0x4b')],{'transaction':_0x3e051c})[_0xaca9('0x27')](function(_0x3ae6e6){_0x14950e=_0x3ae6e6;return _0x5aff1a[_0xaca9('0x8a')](_0x3ae6e6,{'transaction':_0x3e051c});})[_0xaca9('0x27')](function(){var _0x5718df={'type':db[_0xaca9('0x8b')][_0xaca9('0x8c')],'transaction':_0x3e051c};switch(_0x3ea68f[_0xaca9('0x4b')]['type']){case _0xaca9('0x8d'):_0x5718df[_0xaca9('0x33')]=db[_0xaca9('0x8b')]['TEXT'];break;case'number':_0x5718df['type']=db[_0xaca9('0x8b')][_0xaca9('0x8e')];break;case _0xaca9('0x8f'):_0x5718df[_0xaca9('0x33')]=db['Sequelize'][_0xaca9('0x90')];_0x5718df['defaultValue']=![];break;default:}return db['sequelize'][_0xaca9('0x91')][_0xaca9('0x92')](_0xaca9('0x6f'),util[_0xaca9('0x68')]('cf_%s',_0x14950e['id']),_0x5718df);})['then'](function(){return _0x14950e;});});}})['then'](respondWithResult(_0x421e07,null))[_0xaca9('0x46')](handleError(_0x421e07,null));};exports[_0xaca9('0x93')]=function(_0x5efff9,_0x4f3b14,_0x294ab0){var _0x5149fc={};var _0x12b01e={};var _0x1cbbd6;var _0x10fee0;return db['CmList'][_0xaca9('0x87')]({'where':{'id':_0x5efff9[_0xaca9('0x48')]['id']}})[_0xaca9('0x27')](handleEntityNotFound(_0x4f3b14,null))[_0xaca9('0x27')](function(_0xc9940){if(_0xc9940){_0x1cbbd6=_0xc9940;_0x12b01e[_0xaca9('0x34')]=_['keys'](db[_0xaca9('0x66')][_0xaca9('0x32')]);_0x12b01e[_0xaca9('0x35')]=_[_0xaca9('0x49')](_0x5efff9[_0xaca9('0x35')]);_0x12b01e[_0xaca9('0x36')]=_[_0xaca9('0x37')](_0x12b01e[_0xaca9('0x34')],_0x12b01e[_0xaca9('0x35')]);_0x5149fc[_0xaca9('0x38')]=_[_0xaca9('0x37')](_0x12b01e[_0xaca9('0x34')],qs['fields'](_0x5efff9['query']['fields']));_0x5149fc[_0xaca9('0x38')]=_0x5149fc['attributes'][_0xaca9('0x3a')]?_0x5149fc[_0xaca9('0x38')]:_0x12b01e['model'];_0x5149fc[_0xaca9('0x3c')]=qs[_0xaca9('0x3d')](_0x5efff9[_0xaca9('0x35')][_0xaca9('0x3d')]);_0x5149fc[_0xaca9('0x3e')]=qs[_0xaca9('0x36')](_[_0xaca9('0x3f')](_0x5efff9[_0xaca9('0x35')],_0x12b01e[_0xaca9('0x36')]));_0x5149fc[_0xaca9('0x3e')]=_[_0xaca9('0x41')](_0x5149fc[_0xaca9('0x3e')],{'$or':[{'ListId':_0xc9940['id']},{'ListId':null}]});if(_0x5efff9[_0xaca9('0x35')][_0xaca9('0x40')]){_0x5149fc[_0xaca9('0x3e')]=_['merge'](_0x5149fc['where'],{'$or':_[_0xaca9('0x30')](_0x5149fc[_0xaca9('0x38')],function(_0x45c737){var _0x46ec67={};_0x46ec67[_0x45c737]={'$like':'%'+_0x5efff9[_0xaca9('0x35')]['filter']+'%'};return _0x46ec67;})});}_0x5149fc=_[_0xaca9('0x41')]({},_0x5149fc,_0x5efff9[_0xaca9('0x43')]);return db['CmCustomField']['findAndCountAll'](_0x5149fc);}})[_0xaca9('0x27')](respondWithResult(_0x4f3b14,null))['catch'](handleError(_0x4f3b14,null));};exports[_0xaca9('0x94')]=function(_0x376bfc,_0x5f24d0){return db[_0xaca9('0x66')][_0xaca9('0x95')]({'where':{'ListId':null}})[_0xaca9('0x27')](handleEntityNotFound(_0x5f24d0,null))['then'](function(_0x1af495){return _0x1af495;})[_0xaca9('0x27')](respondWithResult(_0x5f24d0,null))[_0xaca9('0x46')](handleError(_0x5f24d0,null));};exports[_0xaca9('0x96')]=function(_0x3fe065,_0x1db55b,_0x578255){return db[_0xaca9('0x31')][_0xaca9('0x50')]({'where':{'id':_0x3fe065[_0xaca9('0x48')]['id']}})[_0xaca9('0x27')](handleEntityNotFound(_0x1db55b,null))['then'](function(_0x44847a){if(_0x44847a){return _0x44847a[_0xaca9('0x96')](_0x3fe065[_0xaca9('0x4b')][_0xaca9('0x5a')],_['omit'](_0x3fe065[_0xaca9('0x4b')],[_0xaca9('0x5a'),'id'])||{})[_0xaca9('0x97')](function(_0x4cf5f3){for(var _0xcf188c=0x0;_0xcf188c<_0x3fe065[_0xaca9('0x4b')][_0xaca9('0x5a')]['length'];_0xcf188c+=0x1){socket[_0xaca9('0x98')](_0xaca9('0x99'),{'UserId':Number(_0x3fe065[_0xaca9('0x4b')][_0xaca9('0x5a')][_0xcf188c]),'CmListId':Number(_0x3fe065[_0xaca9('0x48')]['id'])});}return _0x4cf5f3;});}})['then'](respondWithResult(_0x1db55b,null))[_0xaca9('0x46')](handleError(_0x1db55b,null));};exports[_0xaca9('0x9a')]=function(_0x170d21,_0xf5775c,_0x4484c9){return db[_0xaca9('0x31')]['find']({'where':{'id':_0x170d21[_0xaca9('0x48')]['id']}})['then'](handleEntityNotFound(_0xf5775c,null))[_0xaca9('0x27')](function(_0x4328f5){if(_0x4328f5){return _0x4328f5[_0xaca9('0x9a')](_0x170d21[_0xaca9('0x35')]['ids'])[_0xaca9('0x27')](function(){if(_['isArray'](_0x170d21[_0xaca9('0x35')][_0xaca9('0x5a')])){for(var _0x3a5056=0x0;_0x3a5056<_0x170d21[_0xaca9('0x35')][_0xaca9('0x5a')]['length'];_0x3a5056+=0x1){socket[_0xaca9('0x98')](_0xaca9('0x9b'),{'UserId':Number(_0x170d21[_0xaca9('0x35')][_0xaca9('0x5a')][_0x3a5056]),'CmListId':Number(_0x170d21[_0xaca9('0x48')]['id'])});}}else{socket['emit'](_0xaca9('0x9b'),{'UserId':Number(_0x170d21[_0xaca9('0x35')][_0xaca9('0x5a')]),'CmListId':Number(_0x170d21[_0xaca9('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0xf5775c,null))[_0xaca9('0x46')](handleError(_0xf5775c,null));};exports['getAgents']=function(_0x16725d,_0x2f7571,_0x304a08){var _0xe75dc8={};var _0x2ab512={};var _0x49aeb3;var _0x2d4880;return db[_0xaca9('0x31')][_0xaca9('0x87')]({'where':{'id':_0x16725d['params']['id']}})[_0xaca9('0x27')](handleEntityNotFound(_0x2f7571,null))[_0xaca9('0x27')](function(_0x54873b){if(_0x54873b){_0x49aeb3=_0x54873b;_0x2ab512['model']=_[_0xaca9('0x49')](db['User'][_0xaca9('0x32')]);_0x2ab512[_0xaca9('0x35')]=_[_0xaca9('0x49')](_0x16725d[_0xaca9('0x35')]);_0x2ab512[_0xaca9('0x36')]=_['intersection'](_0x2ab512['model'],_0x2ab512[_0xaca9('0x35')]);_0xe75dc8[_0xaca9('0x38')]=_[_0xaca9('0x37')](_0x2ab512[_0xaca9('0x34')],qs[_0xaca9('0x39')](_0x16725d[_0xaca9('0x35')]['fields']));_0xe75dc8[_0xaca9('0x38')]=_0xe75dc8[_0xaca9('0x38')][_0xaca9('0x3a')]?_0xe75dc8[_0xaca9('0x38')]:_0x2ab512['model'];_0xe75dc8[_0xaca9('0x3c')]=qs[_0xaca9('0x3d')](_0x16725d[_0xaca9('0x35')][_0xaca9('0x3d')]);_0xe75dc8[_0xaca9('0x3e')]=qs[_0xaca9('0x36')](_[_0xaca9('0x3f')](_0x16725d['query'],_0x2ab512[_0xaca9('0x36')]));if(_0x16725d[_0xaca9('0x35')][_0xaca9('0x40')]){_0xe75dc8['where']=_['merge'](_0xe75dc8[_0xaca9('0x3e')],{'$or':_[_0xaca9('0x30')](_0xe75dc8['attributes'],function(_0x333bb7){var _0xadef45={};_0xadef45[_0x333bb7]={'$like':'%'+_0x16725d['query'][_0xaca9('0x40')]+'%'};return _0xadef45;})});}_0xe75dc8=_[_0xaca9('0x41')]({},_0xe75dc8,_0x16725d[_0xaca9('0x43')]);return _0x49aeb3[_0xaca9('0x9c')](_0xe75dc8);}})[_0xaca9('0x27')](function(_0x5f3838){if(_0x5f3838){_0x2d4880=_0x5f3838[_0xaca9('0x3a')];if(!_0x16725d[_0xaca9('0x35')]['hasOwnProperty'](_0xaca9('0x58'))){_0xe75dc8[_0xaca9('0x22')]=qs[_0xaca9('0x22')](_0x16725d[_0xaca9('0x35')][_0xaca9('0x22')]);_0xe75dc8['offset']=qs[_0xaca9('0x1f')](_0x16725d[_0xaca9('0x35')][_0xaca9('0x1f')]);}return _0x49aeb3['getAgents'](_0xe75dc8);}})[_0xaca9('0x27')](function(_0x2595a9){if(_0x2595a9){return _0x2595a9?{'count':_0x2d4880,'rows':_0x2595a9}:null;}})[_0xaca9('0x27')](respondWithResult(_0x2f7571,null))['catch'](handleError(_0x2f7571,null));};function handleQuery(_0x3ec4cc){logger[_0xaca9('0x9d')](_0x3ec4cc);return db[_0xaca9('0x88')][_0xaca9('0x35')](_0x3ec4cc)[_0xaca9('0x97')](function(_0xf258c5){csv_results['push'](_0xf258c5);})['catch'](function(_0x757287){logger[_0xaca9('0x2b')](_0x757287['message']);});}
\ No newline at end of file
index f51074e..7803c9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x39e58f,_0xf91bc5){var _0x541ec7=function(_0x17028a){while(--_0x17028a){_0x39e58f['push'](_0x39e58f['shift']());}};_0x541ec7(++_0xf91bc5);}(_0x814b,0x1a2));var _0xb814=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x814b[_0x2dadb9];return _0x2f0097;};'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
+var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0xa7496a,_0x2b9dba){var _0x51e42c=function(_0x5d4fc6){while(--_0x5d4fc6){_0xa7496a['push'](_0xa7496a['shift']());}};_0x51e42c(++_0x2b9dba);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents;
\ No newline at end of file
index d4df3a8..dcf0aef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1be1=['define','cm_lists','../../config/logger','api','bluebird','request-promise','path','rimraf','./cmList.attributes','exports'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x1be1,0x192));var _0x11be=function(_0x2f4b7a,_0x3fc1dd){_0x2f4b7a=_0x2f4b7a-0x0;var _0x4340d0=_0x1be1[_0x2f4b7a];return _0x4340d0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x11be('0x0'))(_0x11be('0x1'));var moment=require('moment');var BPromise=require(_0x11be('0x2'));var rp=require(_0x11be('0x3'));var fs=require('fs');var path=require(_0x11be('0x4'));var rimraf=require(_0x11be('0x5'));var config=require('../../config/environment');var attributes=require(_0x11be('0x6'));module[_0x11be('0x7')]=function(_0x11f793,_0x479719){return _0x11f793[_0x11be('0x8')]('CmList',attributes,{'tableName':_0x11be('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4483=['define','CmList','cm_lists','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./cmList.attributes','exports'];(function(_0x32ac54,_0x432558){var _0x423a40=function(_0x37a33d){while(--_0x37a33d){_0x32ac54['push'](_0x32ac54['shift']());}};_0x423a40(++_0x432558);}(_0x4483,0x1a3));var _0x3448=function(_0x4177cf,_0x49135c){_0x4177cf=_0x4177cf-0x0;var _0xaec8ac=_0x4483[_0x4177cf];return _0xaec8ac;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var logger=require(_0x3448('0x2'))('api');var moment=require(_0x3448('0x3'));var BPromise=require(_0x3448('0x4'));var rp=require(_0x3448('0x5'));var fs=require('fs');var path=require(_0x3448('0x6'));var rimraf=require(_0x3448('0x7'));var config=require('../../config/environment');var attributes=require(_0x3448('0x8'));module[_0x3448('0x9')]=function(_0x1b05db,_0xd3606d){return _0x1b05db[_0x3448('0xa')](_0x3448('0xb'),attributes,{'tableName':_0x3448('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1a75cda..bf9729f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab9c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0xa9d07e,_0x27163c){var _0x2f0a3c=function(_0x576667){while(--_0x576667){_0xa9d07e['push'](_0xa9d07e['shift']());}};_0x2f0a3c(++_0x27163c);}(_0xab9c,0xe4));var _0xcab9=function(_0x15b78a,_0x128448){_0x15b78a=_0x15b78a-0x0;var _0x2fdfd8=_0xab9c[_0x15b78a];return _0x2fdfd8;};'use strict';var _=require(_0xcab9('0x0'));var util=require('util');var moment=require(_0xcab9('0x1'));var BPromise=require(_0xcab9('0x2'));var rs=require(_0xcab9('0x3'));var fs=require('fs');var Redis=require(_0xcab9('0x4'));var db=require(_0xcab9('0x5'))['db'];var utils=require(_0xcab9('0x6'));var logger=require(_0xcab9('0x7'))(_0xcab9('0x8'));var config=require(_0xcab9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xcab9('0xa')][_0xcab9('0xb')]({'port':0x232a});config['redis']=_[_0xcab9('0xc')](config[_0xcab9('0xd')],{'host':_0xcab9('0xe'),'port':0x18eb});var socket=require(_0xcab9('0xf'))(new Redis(config[_0xcab9('0xd')]));require(_0xcab9('0x10'))[_0xcab9('0x11')](socket);function respondWithRpcPromise(_0x9a7e6f,_0x471376,_0x1174c7){return new BPromise(function(_0x5f53c8,_0x2438ec){return client[_0xcab9('0x12')](_0x9a7e6f,_0x1174c7)[_0xcab9('0x13')](function(_0x5549e7){logger[_0xcab9('0x14')](_0xcab9('0x15'),_0x471376,_0xcab9('0x16'));logger[_0xcab9('0x17')]('CmList,\x20%s,\x20%s,\x20%s',_0x471376,_0xcab9('0x16'),JSON[_0xcab9('0x18')](_0x5549e7));if(_0x5549e7[_0xcab9('0x19')]){if(_0x5549e7[_0xcab9('0x19')]['code']===0x1f4){logger[_0xcab9('0x19')]('CmList,\x20%s,\x20%s',_0x471376,_0x5549e7[_0xcab9('0x19')]['message']);return _0x2438ec(_0x5549e7[_0xcab9('0x19')][_0xcab9('0x1a')]);}logger[_0xcab9('0x19')](_0xcab9('0x15'),_0x471376,_0x5549e7[_0xcab9('0x19')][_0xcab9('0x1a')]);return _0x5f53c8(_0x5549e7[_0xcab9('0x19')][_0xcab9('0x1a')]);}else{logger[_0xcab9('0x14')](_0xcab9('0x15'),_0x471376,_0xcab9('0x16'));_0x5f53c8(_0x5549e7[_0xcab9('0x1b')][_0xcab9('0x1a')]);}})[_0xcab9('0x1c')](function(_0x43cf80){logger[_0xcab9('0x19')](_0xcab9('0x15'),_0x471376,_0x43cf80);_0x2438ec(_0x43cf80);});});}
\ No newline at end of file
+var _0xd780=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./cmList.socket','register','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x42bdd8,_0x3db54d){var _0x5f8af5=function(_0x3cf6e2){while(--_0x3cf6e2){_0x42bdd8['push'](_0x42bdd8['shift']());}};_0x5f8af5(++_0x3db54d);}(_0xd780,0xf4));var _0x0d78=function(_0x119449,_0x28d410){_0x119449=_0x119449-0x0;var _0x30a8da=_0xd780[_0x119449];return _0x30a8da;};'use strict';var _=require(_0x0d78('0x0'));var util=require(_0x0d78('0x1'));var moment=require(_0x0d78('0x2'));var BPromise=require(_0x0d78('0x3'));var rs=require(_0x0d78('0x4'));var fs=require('fs');var Redis=require(_0x0d78('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0d78('0x6'))('rpc');var config=require(_0x0d78('0x7'));var jayson=require(_0x0d78('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x0d78('0x9')]=_[_0x0d78('0xa')](config[_0x0d78('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x0d78('0xb'))(new Redis(config['redis']));require(_0x0d78('0xc'))[_0x0d78('0xd')](socket);function respondWithRpcPromise(_0x1ea585,_0x495f77,_0x44a38f){return new BPromise(function(_0x3d202b,_0x47c288){return client['request'](_0x1ea585,_0x44a38f)['then'](function(_0x4aca91){logger['info'](_0x0d78('0xe'),_0x495f77,'request\x20sent');logger[_0x0d78('0xf')](_0x0d78('0x10'),_0x495f77,_0x0d78('0x11'),JSON['stringify'](_0x4aca91));if(_0x4aca91[_0x0d78('0x12')]){if(_0x4aca91[_0x0d78('0x12')][_0x0d78('0x13')]===0x1f4){logger[_0x0d78('0x12')](_0x0d78('0xe'),_0x495f77,_0x4aca91[_0x0d78('0x12')][_0x0d78('0x14')]);return _0x47c288(_0x4aca91[_0x0d78('0x12')][_0x0d78('0x14')]);}logger[_0x0d78('0x12')](_0x0d78('0xe'),_0x495f77,_0x4aca91['error'][_0x0d78('0x14')]);return _0x3d202b(_0x4aca91[_0x0d78('0x12')]['message']);}else{logger[_0x0d78('0x15')]('CmList,\x20%s,\x20%s',_0x495f77,_0x0d78('0x11'));_0x3d202b(_0x4aca91[_0x0d78('0x16')][_0x0d78('0x14')]);}})[_0x0d78('0x17')](function(_0xd0dc13){logger[_0x0d78('0x12')](_0x0d78('0xe'),_0x495f77,_0xd0dc13);_0x47c288(_0xd0dc13);});});}
\ No newline at end of file
index feb38c5..99ebd61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd978=['save','remove','update','removeListener','register','length','cmList:','./cmList.events'];(function(_0x4db845,_0x53e425){var _0x152684=function(_0x5f4ce4){while(--_0x5f4ce4){_0x4db845['push'](_0x4db845['shift']());}};_0x152684(++_0x53e425);}(_0xd978,0x17f));var _0x8d97=function(_0x3f9882,_0x4063bb){_0x3f9882=_0x3f9882-0x0;var _0x18b725=_0xd978[_0x3f9882];return _0x18b725;};'use strict';var CmListEvents=require(_0x8d97('0x0'));var events=[_0x8d97('0x1'),_0x8d97('0x2'),_0x8d97('0x3')];function createListener(_0x4c203f,_0x35625a){return function(_0x155b33){_0x35625a['emit'](_0x4c203f,_0x155b33);};}function removeListener(_0x1a80d1,_0x54f386){return function(){CmListEvents[_0x8d97('0x4')](_0x1a80d1,_0x54f386);};}exports[_0x8d97('0x5')]=function(_0x298a21){for(var _0x21bf99=0x0,_0x58e0f5=events[_0x8d97('0x6')];_0x21bf99<_0x58e0f5;_0x21bf99++){var _0x3b7191=events[_0x21bf99];var _0x50f9e5=createListener(_0x8d97('0x7')+_0x3b7191,_0x298a21);CmListEvents['on'](_0x3b7191,_0x50f9e5);}};
\ No newline at end of file
+var _0x3f19=['save','update','emit','removeListener','register','length','cmList:'];(function(_0x368581,_0x5a379b){var _0x52a22b=function(_0x2e6073){while(--_0x2e6073){_0x368581['push'](_0x368581['shift']());}};_0x52a22b(++_0x5a379b);}(_0x3f19,0x1f1));var _0x93f1=function(_0x4d32e9,_0x390d44){_0x4d32e9=_0x4d32e9-0x0;var _0x2d9ece=_0x3f19[_0x4d32e9];return _0x2d9ece;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x93f1('0x0'),'remove',_0x93f1('0x1')];function createListener(_0x4857a8,_0x9dfde0){return function(_0xb8d92e){_0x9dfde0[_0x93f1('0x2')](_0x4857a8,_0xb8d92e);};}function removeListener(_0x3610d8,_0x2e707f){return function(){CmListEvents[_0x93f1('0x3')](_0x3610d8,_0x2e707f);};}exports[_0x93f1('0x4')]=function(_0x1de90e){for(var _0x19c02b=0x0,_0x286a42=events[_0x93f1('0x5')];_0x19c02b<_0x286a42;_0x19c02b++){var _0x266266=events[_0x19c02b];var _0x4d7c75=createListener(_0x93f1('0x6')+_0x266266,_0x1de90e);CmListEvents['on'](_0x266266,_0x4d7c75);}};
\ No newline at end of file
index 83b50fe..634a78b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87c6=['/describe','isAuthenticated','describe','/global_fields','getGlobalCustomFields','/:id','show','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','getAgents','post','/:id/dispositions','addDisposition','addContacts','addCustomField','/:id/users','put','update','delete','destroy','removeAgents','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','index'];(function(_0x69975f,_0x48dbb0){var _0x31e0b2=function(_0x1ff63d){while(--_0x1ff63d){_0x69975f['push'](_0x69975f['shift']());}};_0x31e0b2(++_0x48dbb0);}(_0x87c6,0x87));var _0x687c=function(_0xcd93cf,_0x3d5705){_0xcd93cf=_0xcd93cf-0x0;var _0x27e684=_0x87c6[_0xcd93cf];return _0x27e684;};'use strict';var multer=require(_0x687c('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x687c('0x1'));var router=express[_0x687c('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x687c('0x3'));var interaction=require(_0x687c('0x4'));var config=require(_0x687c('0x5'));var controller=require(_0x687c('0x6'));router[_0x687c('0x7')]('/',auth['isAuthenticated'](),controller[_0x687c('0x8')]);router[_0x687c('0x7')](_0x687c('0x9'),auth[_0x687c('0xa')](),controller[_0x687c('0xb')]);router[_0x687c('0x7')](_0x687c('0xc'),auth[_0x687c('0xa')](),controller[_0x687c('0xd')]);router[_0x687c('0x7')](_0x687c('0xe'),auth[_0x687c('0xa')](),controller[_0x687c('0xf')]);router['get']('/:id/dispositions',auth[_0x687c('0xa')](),controller[_0x687c('0x10')]);router[_0x687c('0x7')](_0x687c('0x11'),auth['isAuthenticated'](),controller[_0x687c('0x12')]);router[_0x687c('0x7')](_0x687c('0x13'),auth['isAuthenticated'](),controller[_0x687c('0x14')]);router['get'](_0x687c('0x15'),auth[_0x687c('0xa')](),controller[_0x687c('0x16')]);router[_0x687c('0x7')]('/:id/users',auth[_0x687c('0xa')](),controller[_0x687c('0x17')]);router[_0x687c('0x18')]('/',auth[_0x687c('0xa')](),controller['create']);router[_0x687c('0x18')](_0x687c('0x19'),auth['isAuthenticated'](),controller[_0x687c('0x1a')]);router['post'](_0x687c('0x11'),auth[_0x687c('0xa')](),controller[_0x687c('0x1b')]);router[_0x687c('0x18')](_0x687c('0x15'),auth['isAuthenticated'](),controller[_0x687c('0x1c')]);router[_0x687c('0x18')](_0x687c('0x1d'),auth[_0x687c('0xa')](),controller['addAgents']);router[_0x687c('0x1e')](_0x687c('0xe'),auth['isAuthenticated'](),controller[_0x687c('0x1f')]);router[_0x687c('0x20')](_0x687c('0xe'),auth[_0x687c('0xa')](),controller[_0x687c('0x21')]);router[_0x687c('0x20')](_0x687c('0x19'),auth[_0x687c('0xa')](),controller['removeDispositions']);router[_0x687c('0x20')](_0x687c('0x1d'),auth[_0x687c('0xa')](),controller[_0x687c('0x22')]);module[_0x687c('0x23')]=router;
\ No newline at end of file
+var _0x1ed3=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','/global_fields','isAuthenticated','getGlobalCustomFields','show','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','post','addDisposition','addContacts','addCustomField','put','/:id','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util'];(function(_0x25662e,_0x4cec68){var _0x59b7bc=function(_0xafb159){while(--_0xafb159){_0x25662e['push'](_0x25662e['shift']());}};_0x59b7bc(++_0x4cec68);}(_0x1ed3,0x18a));var _0x31ed=function(_0x4fc702,_0x590060){_0x4fc702=_0x4fc702-0x0;var _0x1357d3=_0x1ed3[_0x4fc702];return _0x1357d3;};'use strict';var multer=require(_0x31ed('0x0'));var util=require(_0x31ed('0x1'));var path=require(_0x31ed('0x2'));var timeout=require(_0x31ed('0x3'));var express=require('express');var router=express[_0x31ed('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x31ed('0x5'));var interaction=require(_0x31ed('0x6'));var config=require('../../config/environment');var controller=require(_0x31ed('0x7'));router[_0x31ed('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x31ed('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x31ed('0x8')](_0x31ed('0x9'),auth[_0x31ed('0xa')](),controller[_0x31ed('0xb')]);router[_0x31ed('0x8')]('/:id',auth[_0x31ed('0xa')](),controller[_0x31ed('0xc')]);router['get'](_0x31ed('0xd'),auth[_0x31ed('0xa')](),controller['getDispositions']);router[_0x31ed('0x8')](_0x31ed('0xe'),auth[_0x31ed('0xa')](),controller[_0x31ed('0xf')]);router[_0x31ed('0x8')](_0x31ed('0x10'),auth[_0x31ed('0xa')](),controller[_0x31ed('0x11')]);router[_0x31ed('0x8')](_0x31ed('0x12'),auth[_0x31ed('0xa')](),controller[_0x31ed('0x13')]);router[_0x31ed('0x8')](_0x31ed('0x14'),auth[_0x31ed('0xa')](),controller['getAgents']);router['post']('/',auth[_0x31ed('0xa')](),controller['create']);router[_0x31ed('0x15')](_0x31ed('0xd'),auth['isAuthenticated'](),controller[_0x31ed('0x16')]);router['post'](_0x31ed('0xe'),auth[_0x31ed('0xa')](),controller[_0x31ed('0x17')]);router[_0x31ed('0x15')](_0x31ed('0x12'),auth[_0x31ed('0xa')](),controller[_0x31ed('0x18')]);router[_0x31ed('0x15')](_0x31ed('0x14'),auth['isAuthenticated'](),controller['addAgents']);router[_0x31ed('0x19')](_0x31ed('0x1a'),auth[_0x31ed('0xa')](),controller[_0x31ed('0x1b')]);router[_0x31ed('0x1c')](_0x31ed('0x1a'),auth[_0x31ed('0xa')](),controller[_0x31ed('0x1d')]);router[_0x31ed('0x1c')](_0x31ed('0xd'),auth[_0x31ed('0xa')](),controller[_0x31ed('0x1e')]);router[_0x31ed('0x1c')](_0x31ed('0x14'),auth[_0x31ed('0xa')](),controller[_0x31ed('0x1f')]);module[_0x31ed('0x20')]=router;
\ No newline at end of file
index f652c04..f0202ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf06d=['STRING','sequelize','getDataValue','field'];(function(_0x58836f,_0x5351e2){var _0x28f9b1=function(_0x30a6cc){while(--_0x30a6cc){_0x58836f['push'](_0x58836f['shift']());}};_0x28f9b1(++_0x5351e2);}(_0xf06d,0x189));var _0xdf06=function(_0x227af0,_0x4af0a4){_0x227af0=_0x227af0-0x0;var _0x14c9ed=_0xf06d[_0x227af0];return _0x14c9ed;};'use strict';var Sequelize=require(_0xdf06('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x311e58){return this[_0xdf06('0x1')](_0xdf06('0x2'));}},'field':{'type':Sequelize[_0xdf06('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0xdf06('0x3')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0xc73a=['sequelize','exports','getDataValue','field','STRING'];(function(_0x1afbc8,_0x457920){var _0x444538=function(_0xa53252){while(--_0xa53252){_0x1afbc8['push'](_0x1afbc8['shift']());}};_0x444538(++_0x457920);}(_0xc73a,0x96));var _0xac73=function(_0x356b86,_0xf924e9){_0x356b86=_0x356b86-0x0;var _0x182e5a=_0xc73a[_0x356b86];return _0x182e5a;};'use strict';var Sequelize=require(_0xac73('0x0'));module[_0xac73('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1af4e4){return this[_0xac73('0x2')](_0xac73('0x3'));}},'field':{'type':Sequelize[_0xac73('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xac73('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xac73('0x4')],'allowNull':![]}};
\ No newline at end of file
index a580e5e..e8eeda6 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(_0x2608f9,_0x25ad99){var _0x33df42=function(_0x31f7fa){while(--_0x31f7fa){_0x2608f9['push'](_0x2608f9['shift']());}};_0x33df42(++_0x25ad99);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){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(_0x1bdf5e,_0x5e78f3){var _0x5ad487=function(_0x1ce102){while(--_0x1ce102){_0x1bdf5e['push'](_0x1bdf5e['shift']());}};_0x5ad487(++_0x5e78f3);}(_0x7a54,0x106));var _0x47a5=function(_0x5386a3,_0xc833c5){_0x5386a3=_0x5386a3-0x0;var _0x1524a4=_0x7a54[_0x5386a3];return _0x1524a4;};'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 7be56d4..5b14091 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c46=['./condition.attributes','exports','define','Condition','tools_conditions','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x11ba83,_0xd5611a){var _0x3f3925=function(_0x3d7cb0){while(--_0x3d7cb0){_0x11ba83['push'](_0x11ba83['shift']());}};_0x3f3925(++_0xd5611a);}(_0x9c46,0x191));var _0x69c4=function(_0x4bc1f9,_0x331c46){_0x4bc1f9=_0x4bc1f9-0x0;var _0x3ad7ef=_0x9c46[_0x4bc1f9];return _0x3ad7ef;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x69c4('0x0'))(_0x69c4('0x1'));var moment=require(_0x69c4('0x2'));var BPromise=require(_0x69c4('0x3'));var rp=require(_0x69c4('0x4'));var fs=require('fs');var path=require(_0x69c4('0x5'));var rimraf=require(_0x69c4('0x6'));var config=require('../../config/environment');var attributes=require(_0x69c4('0x7'));module[_0x69c4('0x8')]=function(_0x30f06d,_0x131733){return _0x30f06d[_0x69c4('0x9')](_0x69c4('0xa'),attributes,{'tableName':_0x69c4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd2df=['./condition.attributes','exports','define','tools_conditions','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x38a319,_0xc30815){var _0x59a1a5=function(_0x1d7e90){while(--_0x1d7e90){_0x38a319['push'](_0x38a319['shift']());}};_0x59a1a5(++_0xc30815);}(_0xd2df,0x1e8));var _0xfd2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2df[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfd2d('0x0'));var util=require(_0xfd2d('0x1'));var logger=require(_0xfd2d('0x2'))(_0xfd2d('0x3'));var moment=require(_0xfd2d('0x4'));var BPromise=require('bluebird');var rp=require(_0xfd2d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfd2d('0x6'));var config=require('../../config/environment');var attributes=require(_0xfd2d('0x7'));module[_0xfd2d('0x8')]=function(_0x533a10,_0xb1a2fa){return _0x533a10[_0xfd2d('0x9')]('Condition',attributes,{'tableName':_0xfd2d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5c8b550..f2af1d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ab4=['catch','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x4ab4,0x109));var _0x44ab=function(_0x1615f3,_0x1dc000){_0x1615f3=_0x1615f3-0x0;var _0x4d7424=_0x4ab4[_0x1615f3];return _0x4d7424;};'use strict';var _=require('lodash');var util=require(_0x44ab('0x0'));var moment=require('moment');var BPromise=require(_0x44ab('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x44ab('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x44ab('0x3'));var logger=require(_0x44ab('0x4'))(_0x44ab('0x5'));var config=require('../../config/environment');var jayson=require(_0x44ab('0x6'));var client=jayson[_0x44ab('0x7')][_0x44ab('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa0dda0,_0x55a708,_0x1c19f2){return new BPromise(function(_0x11d114,_0x25fa6b){return client[_0x44ab('0x9')](_0xa0dda0,_0x1c19f2)[_0x44ab('0xa')](function(_0x108f75){logger[_0x44ab('0xb')](_0x44ab('0xc'),_0x55a708,_0x44ab('0xd'));logger[_0x44ab('0xe')](_0x44ab('0xf'),_0x55a708,_0x44ab('0xd'),JSON[_0x44ab('0x10')](_0x108f75));if(_0x108f75[_0x44ab('0x11')]){if(_0x108f75[_0x44ab('0x11')][_0x44ab('0x12')]===0x1f4){logger[_0x44ab('0x11')](_0x44ab('0xc'),_0x55a708,_0x108f75['error'][_0x44ab('0x13')]);return _0x25fa6b(_0x108f75[_0x44ab('0x11')]['message']);}logger[_0x44ab('0x11')]('Condition,\x20%s,\x20%s',_0x55a708,_0x108f75[_0x44ab('0x11')][_0x44ab('0x13')]);return _0x11d114(_0x108f75[_0x44ab('0x11')][_0x44ab('0x13')]);}else{logger[_0x44ab('0xb')](_0x44ab('0xc'),_0x55a708,_0x44ab('0xd'));_0x11d114(_0x108f75[_0x44ab('0x14')]['message']);}})[_0x44ab('0x15')](function(_0x462553){logger[_0x44ab('0x11')](_0x44ab('0xc'),_0x55a708,_0x462553);_0x25fa6b(_0x462553);});});}
\ No newline at end of file
+var _0x5544=['request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Condition,\x20%s,\x20%s'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x5544,0x98));var _0x4554=function(_0x481cd5,_0x432f78){_0x481cd5=_0x481cd5-0x0;var _0x52ecd5=_0x5544[_0x481cd5];return _0x52ecd5;};'use strict';var _=require(_0x4554('0x0'));var util=require(_0x4554('0x1'));var moment=require(_0x4554('0x2'));var BPromise=require(_0x4554('0x3'));var rs=require(_0x4554('0x4'));var fs=require('fs');var Redis=require(_0x4554('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4554('0x6'));var logger=require(_0x4554('0x7'))(_0x4554('0x8'));var config=require(_0x4554('0x9'));var jayson=require(_0x4554('0xa'));var client=jayson[_0x4554('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12f0b1,_0x3ba392,_0x31af62){return new BPromise(function(_0x4eda65,_0x54e457){return client[_0x4554('0xc')](_0x12f0b1,_0x31af62)[_0x4554('0xd')](function(_0x4f5fb6){logger[_0x4554('0xe')](_0x4554('0xf'),_0x3ba392,_0x4554('0x10'));logger[_0x4554('0x11')](_0x4554('0x12'),_0x3ba392,_0x4554('0x10'),JSON[_0x4554('0x13')](_0x4f5fb6));if(_0x4f5fb6['error']){if(_0x4f5fb6[_0x4554('0x14')][_0x4554('0x15')]===0x1f4){logger[_0x4554('0x14')]('Condition,\x20%s,\x20%s',_0x3ba392,_0x4f5fb6[_0x4554('0x14')][_0x4554('0x16')]);return _0x54e457(_0x4f5fb6[_0x4554('0x14')][_0x4554('0x16')]);}logger[_0x4554('0x14')](_0x4554('0xf'),_0x3ba392,_0x4f5fb6[_0x4554('0x14')][_0x4554('0x16')]);return _0x4eda65(_0x4f5fb6[_0x4554('0x14')][_0x4554('0x16')]);}else{logger[_0x4554('0xe')]('Condition,\x20%s,\x20%s',_0x3ba392,_0x4554('0x10'));_0x4eda65(_0x4f5fb6[_0x4554('0x17')][_0x4554('0x16')]);}})['catch'](function(_0x355b8a){logger[_0x4554('0x14')](_0x4554('0xf'),_0x3ba392,_0x355b8a);_0x54e457(_0x355b8a);});});}
\ No newline at end of file
index ff80fdc..c083f79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8adf=['../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8adf,0x1f2));var _0xf8ad=function(_0x14b569,_0x3f7e44){_0x14b569=_0x14b569-0x0;var _0x2aa8f1=_0x8adf[_0x14b569];return _0x2aa8f1;};'use strict';var multer=require(_0xf8ad('0x0'));var util=require(_0xf8ad('0x1'));var path=require(_0xf8ad('0x2'));var timeout=require(_0xf8ad('0x3'));var express=require('express');var router=express[_0xf8ad('0x4')]();var fs_extra=require(_0xf8ad('0x5'));var auth=require(_0xf8ad('0x6'));var interaction=require(_0xf8ad('0x7'));var config=require(_0xf8ad('0x8'));var controller=require('./condition.controller');router['put'](_0xf8ad('0x9'),auth[_0xf8ad('0xa')](),controller[_0xf8ad('0xb')]);router['delete'](_0xf8ad('0x9'),auth['isAuthenticated'](),controller[_0xf8ad('0xc')]);module[_0xf8ad('0xd')]=router;
\ No newline at end of file
+var _0xef47=['../../components/auth/service','../../config/environment','./condition.controller','/:id','isAuthenticated','update','delete','multer','util','path','Router','fs-extra'];(function(_0x512738,_0x52ef6b){var _0x1bdb2b=function(_0x24d1ff){while(--_0x24d1ff){_0x512738['push'](_0x512738['shift']());}};_0x1bdb2b(++_0x52ef6b);}(_0xef47,0x11b));var _0x7ef4=function(_0x4a6c1e,_0xce7335){_0x4a6c1e=_0x4a6c1e-0x0;var _0x3b32bd=_0xef47[_0x4a6c1e];return _0x3b32bd;};'use strict';var multer=require(_0x7ef4('0x0'));var util=require(_0x7ef4('0x1'));var path=require(_0x7ef4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7ef4('0x3')]();var fs_extra=require(_0x7ef4('0x4'));var auth=require(_0x7ef4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7ef4('0x6'));var controller=require(_0x7ef4('0x7'));router['put'](_0x7ef4('0x8'),auth[_0x7ef4('0x9')](),controller[_0x7ef4('0xa')]);router[_0x7ef4('0xb')](_0x7ef4('0x8'),auth[_0x7ef4('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 153ea45..ad6ba77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ecd=['name','INTEGER','sequelize','STRING'];(function(_0x263d53,_0x2cb38f){var _0x55384c=function(_0x3c36fb){while(--_0x3c36fb){_0x263d53['push'](_0x263d53['shift']());}};_0x55384c(++_0x2cb38f);}(_0x0ecd,0x196));var _0xd0ec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0ecd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd0ec('0x0'));module['exports']={'name':{'type':Sequelize[_0xd0ec('0x1')],'allowNull':![],'unique':_0xd0ec('0x2')},'OrderBy':{'type':Sequelize[_0xd0ec('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xd0ec('0x1')],'allowNull':!![]}};
\ No newline at end of file
+var _0x0f0f=['exports','name','INTEGER','STRING'];(function(_0x440b30,_0x241ee7){var _0x3b16da=function(_0x4ad0e4){while(--_0x4ad0e4){_0x440b30['push'](_0x440b30['shift']());}};_0x3b16da(++_0x241ee7);}(_0x0f0f,0xac));var _0xf0f0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0f0f[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0xf0f0('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf0f0('0x1')},'OrderBy':{'type':Sequelize[_0xf0f0('0x2')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xf0f0('0x3')],'allowNull':!![]}};
\ No newline at end of file
index 82ccf94..237c1d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f0e=['index','map','ContactItemType','rawAttributes','fieldName','type','key','model','query','intersection','attributes','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','catch','show','params','keys','filters','fields','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','get','ContactItemTypes','UserProfileResource','end','error','stack','name','send'];(function(_0x380f35,_0x5a31d8){var _0xcda2e=function(_0x1ab9e3){while(--_0x1ab9e3){_0x380f35['push'](_0x380f35['shift']());}};_0xcda2e(++_0x5a31d8);}(_0x9f0e,0x116));var _0xe9f0=function(_0x3f19f8,_0x52e9b2){_0x3f19f8=_0x3f19f8-0x0;var _0x380367=_0x9f0e[_0x3f19f8];return _0x380367;};'use strict';var emlformat=require(_0xe9f0('0x0'));var rimraf=require(_0xe9f0('0x1'));var zipdir=require(_0xe9f0('0x2'));var jsonpatch=require(_0xe9f0('0x3'));var rp=require(_0xe9f0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe9f0('0x5'));var util=require(_0xe9f0('0x6'));var path=require(_0xe9f0('0x7'));var sox=require(_0xe9f0('0x8'));var csv=require(_0xe9f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9f0('0xa'));var squel=require(_0xe9f0('0xb'));var crypto=require(_0xe9f0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe9f0('0xd'));var toCsv=require(_0xe9f0('0x9'));var querystring=require(_0xe9f0('0xe'));var Papa=require(_0xe9f0('0xf'));var Redis=require(_0xe9f0('0x10'));var authService=require(_0xe9f0('0x11'));var qs=require(_0xe9f0('0x12'));var as=require(_0xe9f0('0x13'));var hardwareService=require(_0xe9f0('0x14'));var logger=require('../../config/logger')(_0xe9f0('0x15'));var utils=require(_0xe9f0('0x16'));var config=require(_0xe9f0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9f0('0x18'))['db'];function respondWithStatusCode(_0x586763,_0x367545){_0x367545=_0x367545||0xcc;return function(_0xd82420){if(_0xd82420){return _0x586763[_0xe9f0('0x19')](_0x367545);}return _0x586763[_0xe9f0('0x1a')](_0x367545)['end']();};}function respondWithResult(_0x2cf75d,_0x5a10c6){_0x5a10c6=_0x5a10c6||0xc8;return function(_0x1e3ba8){if(_0x1e3ba8){return _0x2cf75d[_0xe9f0('0x1a')](_0x5a10c6)[_0xe9f0('0x1b')](_0x1e3ba8);}};}function respondWithFilteredResult(_0x59320d,_0x28bfac){return function(_0x33e9e4){if(_0x33e9e4){var _0x2e68ef=typeof _0x28bfac['offset']===_0xe9f0('0x1c')&&typeof _0x28bfac[_0xe9f0('0x1d')]===_0xe9f0('0x1c');var _0xd71ac8=_0x33e9e4[_0xe9f0('0x1e')];var _0x2ab12b=_0x2e68ef?0x0:_0x28bfac[_0xe9f0('0x1f')];var _0x59bf5a=_0x2e68ef?_0x33e9e4[_0xe9f0('0x1e')]:_0x28bfac[_0xe9f0('0x1f')]+_0x28bfac[_0xe9f0('0x1d')];var _0x5c4182;if(_0x59bf5a>=_0xd71ac8){_0x59bf5a=_0xd71ac8;_0x5c4182=0xc8;}else{_0x5c4182=0xce;}_0x59320d[_0xe9f0('0x1a')](_0x5c4182);return _0x59320d[_0xe9f0('0x20')](_0xe9f0('0x21'),_0x2ab12b+'-'+_0x59bf5a+'/'+_0xd71ac8)[_0xe9f0('0x1b')](_0x33e9e4);}return null;};}function patchUpdates(_0x5ba788){return function(_0x33f143){try{jsonpatch[_0xe9f0('0x22')](_0x33f143,_0x5ba788,!![]);}catch(_0x583687){return BPromise['reject'](_0x583687);}return _0x33f143['save']();};}function saveUpdates(_0x12fe9f,_0xa1ddc){return function(_0x1211ae){if(_0x1211ae){return _0x1211ae[_0xe9f0('0x23')](_0x12fe9f)[_0xe9f0('0x24')](function(_0x4a5c27){return _0x4a5c27;});}return null;};}function removeEntity(_0x229fe0,_0x38b7ee){return function(_0x437d43){if(_0x437d43){return _0x437d43[_0xe9f0('0x25')]()[_0xe9f0('0x24')](function(){var _0x372ffd=_0x437d43[_0xe9f0('0x26')]({'plain':!![]});var _0x1321bb=_0xe9f0('0x27');return db[_0xe9f0('0x28')]['destroy']({'where':{'type':_0x1321bb,'resourceId':_0x372ffd['id']}})[_0xe9f0('0x24')](function(){return _0x437d43;});})[_0xe9f0('0x24')](function(){_0x229fe0[_0xe9f0('0x1a')](0xcc)[_0xe9f0('0x29')]();});}};}function handleEntityNotFound(_0x4cf1b1,_0x212a38){return function(_0x2613fd){if(!_0x2613fd){_0x4cf1b1[_0xe9f0('0x19')](0x194);}return _0x2613fd;};}function handleError(_0x1f98a7,_0x4335c6){_0x4335c6=_0x4335c6||0x1f4;return function(_0x5457f6){logger[_0xe9f0('0x2a')](_0x5457f6[_0xe9f0('0x2b')]);if(_0x5457f6[_0xe9f0('0x2c')]){delete _0x5457f6[_0xe9f0('0x2c')];}_0x1f98a7[_0xe9f0('0x1a')](_0x4335c6)[_0xe9f0('0x2d')](_0x5457f6);};}exports[_0xe9f0('0x2e')]=function(_0x2efd33,_0x2b6503){var _0x3dbe49={},_0x22806c={},_0x617ad3={'count':0x0,'rows':[]};var _0x445ad0=_[_0xe9f0('0x2f')](db[_0xe9f0('0x30')][_0xe9f0('0x31')],function(_0x80e3ac){return{'name':_0x80e3ac[_0xe9f0('0x32')],'type':_0x80e3ac[_0xe9f0('0x33')][_0xe9f0('0x34')]};});_0x22806c[_0xe9f0('0x35')]=_[_0xe9f0('0x2f')](_0x445ad0,_0xe9f0('0x2c'));_0x22806c[_0xe9f0('0x36')]=_['keys'](_0x2efd33['query']);_0x22806c['filters']=_[_0xe9f0('0x37')](_0x22806c['model'],_0x22806c[_0xe9f0('0x36')]);_0x3dbe49[_0xe9f0('0x38')]=_['intersection'](_0x22806c[_0xe9f0('0x35')],qs['fields'](_0x2efd33['query']['fields']));_0x3dbe49[_0xe9f0('0x38')]=_0x3dbe49[_0xe9f0('0x38')]['length']?_0x3dbe49[_0xe9f0('0x38')]:_0x22806c[_0xe9f0('0x35')];if(!_0x2efd33[_0xe9f0('0x36')]['hasOwnProperty']('nolimit')){_0x3dbe49[_0xe9f0('0x1d')]=qs[_0xe9f0('0x1d')](_0x2efd33[_0xe9f0('0x36')]['limit']);_0x3dbe49[_0xe9f0('0x1f')]=qs[_0xe9f0('0x1f')](_0x2efd33[_0xe9f0('0x36')][_0xe9f0('0x1f')]);}_0x3dbe49[_0xe9f0('0x39')]=qs['sort'](_0x2efd33[_0xe9f0('0x36')][_0xe9f0('0x3a')]);_0x3dbe49[_0xe9f0('0x3b')]=qs['filters'](_[_0xe9f0('0x3c')](_0x2efd33[_0xe9f0('0x36')],_0x22806c['filters']),_0x445ad0);if(_0x2efd33[_0xe9f0('0x36')]['filter']){_0x3dbe49[_0xe9f0('0x3b')]=_['merge'](_0x3dbe49['where'],{'$or':_['map'](_0x445ad0,function(_0x5bddcc){if(_0x5bddcc['type']!==_0xe9f0('0x3d')){var _0x2d4115={};_0x2d4115[_0x5bddcc[_0xe9f0('0x2c')]]={'$like':'%'+_0x2efd33[_0xe9f0('0x36')][_0xe9f0('0x3e')]+'%'};return _0x2d4115;}})});}_0x3dbe49=_[_0xe9f0('0x3f')]({},_0x3dbe49,_0x2efd33[_0xe9f0('0x40')]);var _0x3e79c1={'where':_0x3dbe49[_0xe9f0('0x3b')]};return db['ContactItemType'][_0xe9f0('0x1e')](_0x3e79c1)[_0xe9f0('0x24')](function(_0x36b00a){_0x617ad3['count']=_0x36b00a;if(_0x2efd33['query'][_0xe9f0('0x41')]){_0x3dbe49['include']=[{'all':!![]}];}return db[_0xe9f0('0x30')][_0xe9f0('0x42')](_0x3dbe49);})[_0xe9f0('0x24')](function(_0x42d9d2){_0x617ad3['rows']=_0x42d9d2;return _0x617ad3;})[_0xe9f0('0x24')](respondWithFilteredResult(_0x2b6503,_0x3dbe49))[_0xe9f0('0x43')](handleError(_0x2b6503,null));};exports[_0xe9f0('0x44')]=function(_0x18faaf,_0x37a2ac){var _0x59378a={'raw':!![],'where':{'id':_0x18faaf[_0xe9f0('0x45')]['id']}},_0x60a40d={};_0x60a40d[_0xe9f0('0x35')]=_[_0xe9f0('0x46')](db[_0xe9f0('0x30')]['rawAttributes']);_0x60a40d[_0xe9f0('0x36')]=_['keys'](_0x18faaf['query']);_0x60a40d[_0xe9f0('0x47')]=_[_0xe9f0('0x37')](_0x60a40d['model'],_0x60a40d[_0xe9f0('0x36')]);_0x59378a[_0xe9f0('0x38')]=_[_0xe9f0('0x37')](_0x60a40d[_0xe9f0('0x35')],qs[_0xe9f0('0x48')](_0x18faaf[_0xe9f0('0x36')][_0xe9f0('0x48')]));_0x59378a['attributes']=_0x59378a[_0xe9f0('0x38')]['length']?_0x59378a[_0xe9f0('0x38')]:_0x60a40d['model'];if(_0x18faaf[_0xe9f0('0x36')]['includeAll']){_0x59378a[_0xe9f0('0x49')]=[{'all':!![]}];}_0x59378a=_[_0xe9f0('0x3f')]({},_0x59378a,_0x18faaf[_0xe9f0('0x40')]);return db['ContactItemType'][_0xe9f0('0x4a')](_0x59378a)[_0xe9f0('0x24')](handleEntityNotFound(_0x37a2ac,null))[_0xe9f0('0x24')](respondWithResult(_0x37a2ac,null))[_0xe9f0('0x43')](handleError(_0x37a2ac,null));};exports[_0xe9f0('0x4b')]=function(_0x135175,_0x6ece3f){return db[_0xe9f0('0x30')][_0xe9f0('0x4b')](_0x135175[_0xe9f0('0x4c')],{})[_0xe9f0('0x24')](function(_0x1325a2){var _0x57beee=_0x135175['user'][_0xe9f0('0x26')]({'plain':!![]});if(!_0x57beee)throw new Error(_0xe9f0('0x4d'));if(_0x57beee[_0xe9f0('0x4e')]==='user'){var _0x1ac381=_0x1325a2['get']({'plain':!![]});var _0x323e1e=_0xe9f0('0x27');return db[_0xe9f0('0x4f')][_0xe9f0('0x4a')]({'where':{'name':_0x323e1e,'userProfileId':_0x57beee['userProfileId']},'raw':!![]})[_0xe9f0('0x24')](function(_0x3fa271){if(_0x3fa271&&_0x3fa271['autoAssociation']===0x0){return db[_0xe9f0('0x28')][_0xe9f0('0x4b')]({'name':_0x1ac381[_0xe9f0('0x2c')],'resourceId':_0x1ac381['id'],'type':_0x3fa271[_0xe9f0('0x2c')],'sectionId':_0x3fa271['id']},{})['then'](function(){return _0x1325a2;});}else{return _0x1325a2;}})[_0xe9f0('0x43')](function(_0x3a5d19){logger[_0xe9f0('0x2a')](_0xe9f0('0x50'),_0x3a5d19);throw _0x3a5d19;});}return _0x1325a2;})[_0xe9f0('0x24')](respondWithResult(_0x6ece3f,0xc9))[_0xe9f0('0x43')](handleError(_0x6ece3f,null));};exports[_0xe9f0('0x23')]=function(_0x12d9be,_0x4da78f){if(_0x12d9be[_0xe9f0('0x4c')]['id']){delete _0x12d9be[_0xe9f0('0x4c')]['id'];}return db[_0xe9f0('0x30')][_0xe9f0('0x4a')]({'where':{'id':_0x12d9be[_0xe9f0('0x45')]['id']}})[_0xe9f0('0x24')](handleEntityNotFound(_0x4da78f,null))[_0xe9f0('0x24')](saveUpdates(_0x12d9be[_0xe9f0('0x4c')],null))[_0xe9f0('0x24')](respondWithResult(_0x4da78f,null))[_0xe9f0('0x43')](handleError(_0x4da78f,null));};exports[_0xe9f0('0x25')]=function(_0x3c26ac,_0x4f1c25){return db[_0xe9f0('0x30')]['find']({'where':{'id':_0x3c26ac[_0xe9f0('0x45')]['id']}})[_0xe9f0('0x24')](handleEntityNotFound(_0x4f1c25,null))[_0xe9f0('0x24')](db['CmContactHasItem']['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x3c26ac[_0xe9f0('0x45')]['id']}}))['then'](removeEntity(_0x4f1c25,null))[_0xe9f0('0x43')](handleError(_0x4f1c25,null));};
\ No newline at end of file
+var _0xb016=['findAll','rows','show','keys','length','catch','create','role','user','UserProfileSection','find','userProfileId','autoAssociation','error','update','body','params','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','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','apply','reject','save','then','destroy','get','ContactItemTypes','UserProfileResource','end','stack','name','send','index','map','ContactItemType','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x1fdb40,_0x51351c){var _0x281f93=function(_0x35eebe){while(--_0x35eebe){_0x1fdb40['push'](_0x1fdb40['shift']());}};_0x281f93(++_0x51351c);}(_0xb016,0x159));var _0x6b01=function(_0x2c55a8,_0x277752){_0x2c55a8=_0x2c55a8-0x0;var _0x485161=_0xb016[_0x2c55a8];return _0x485161;};'use strict';var emlformat=require(_0x6b01('0x0'));var rimraf=require(_0x6b01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b01('0x2'));var moment=require('moment');var BPromise=require(_0x6b01('0x3'));var Mustache=require(_0x6b01('0x4'));var util=require(_0x6b01('0x5'));var path=require(_0x6b01('0x6'));var sox=require('sox');var csv=require(_0x6b01('0x7'));var ejs=require(_0x6b01('0x8'));var fs=require('fs');var fs_extra=require(_0x6b01('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b01('0xa'));var jsforce=require(_0x6b01('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b01('0xc'));var Papa=require(_0x6b01('0xd'));var Redis=require(_0x6b01('0xe'));var authService=require(_0x6b01('0xf'));var qs=require(_0x6b01('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b01('0x11'))(_0x6b01('0x12'));var utils=require(_0x6b01('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b01('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51f976,_0x26f2a0){_0x26f2a0=_0x26f2a0||0xcc;return function(_0x4fa826){if(_0x4fa826){return _0x51f976[_0x6b01('0x15')](_0x26f2a0);}return _0x51f976[_0x6b01('0x16')](_0x26f2a0)['end']();};}function respondWithResult(_0x2c305e,_0x4ea5fa){_0x4ea5fa=_0x4ea5fa||0xc8;return function(_0x50d778){if(_0x50d778){return _0x2c305e['status'](_0x4ea5fa)[_0x6b01('0x17')](_0x50d778);}};}function respondWithFilteredResult(_0x4cbd38,_0x5b2f60){return function(_0x3a259f){if(_0x3a259f){var _0x327e86=typeof _0x5b2f60[_0x6b01('0x18')]===_0x6b01('0x19')&&typeof _0x5b2f60[_0x6b01('0x1a')]===_0x6b01('0x19');var _0x122769=_0x3a259f[_0x6b01('0x1b')];var _0x9c6571=_0x327e86?0x0:_0x5b2f60[_0x6b01('0x18')];var _0x18f336=_0x327e86?_0x3a259f['count']:_0x5b2f60[_0x6b01('0x18')]+_0x5b2f60[_0x6b01('0x1a')];var _0x3b0bab;if(_0x18f336>=_0x122769){_0x18f336=_0x122769;_0x3b0bab=0xc8;}else{_0x3b0bab=0xce;}_0x4cbd38[_0x6b01('0x16')](_0x3b0bab);return _0x4cbd38[_0x6b01('0x1c')](_0x6b01('0x1d'),_0x9c6571+'-'+_0x18f336+'/'+_0x122769)[_0x6b01('0x17')](_0x3a259f);}return null;};}function patchUpdates(_0x3c0573){return function(_0x54a942){try{jsonpatch[_0x6b01('0x1e')](_0x54a942,_0x3c0573,!![]);}catch(_0xc1f453){return BPromise[_0x6b01('0x1f')](_0xc1f453);}return _0x54a942[_0x6b01('0x20')]();};}function saveUpdates(_0x1fced4,_0x181b09){return function(_0x2cea6e){if(_0x2cea6e){return _0x2cea6e['update'](_0x1fced4)[_0x6b01('0x21')](function(_0xcf9200){return _0xcf9200;});}return null;};}function removeEntity(_0x42c990,_0x51243c){return function(_0x399808){if(_0x399808){return _0x399808[_0x6b01('0x22')]()[_0x6b01('0x21')](function(){var _0x2ae85e=_0x399808[_0x6b01('0x23')]({'plain':!![]});var _0x2456e9=_0x6b01('0x24');return db[_0x6b01('0x25')][_0x6b01('0x22')]({'where':{'type':_0x2456e9,'resourceId':_0x2ae85e['id']}})[_0x6b01('0x21')](function(){return _0x399808;});})[_0x6b01('0x21')](function(){_0x42c990[_0x6b01('0x16')](0xcc)[_0x6b01('0x26')]();});}};}function handleEntityNotFound(_0x55ca4b,_0x33d95d){return function(_0x220efb){if(!_0x220efb){_0x55ca4b[_0x6b01('0x15')](0x194);}return _0x220efb;};}function handleError(_0x21f165,_0x68491){_0x68491=_0x68491||0x1f4;return function(_0x528cbd){logger['error'](_0x528cbd[_0x6b01('0x27')]);if(_0x528cbd[_0x6b01('0x28')]){delete _0x528cbd[_0x6b01('0x28')];}_0x21f165[_0x6b01('0x16')](_0x68491)[_0x6b01('0x29')](_0x528cbd);};}exports[_0x6b01('0x2a')]=function(_0x542ca0,_0x39f193){var _0x5482a8={},_0x3942d7={},_0x4e7e32={'count':0x0,'rows':[]};var _0x6920cf=_[_0x6b01('0x2b')](db[_0x6b01('0x2c')][_0x6b01('0x2d')],function(_0x3c8009){return{'name':_0x3c8009['fieldName'],'type':_0x3c8009[_0x6b01('0x2e')][_0x6b01('0x2f')]};});_0x3942d7[_0x6b01('0x30')]=_['map'](_0x6920cf,'name');_0x3942d7[_0x6b01('0x31')]=_['keys'](_0x542ca0[_0x6b01('0x31')]);_0x3942d7[_0x6b01('0x32')]=_[_0x6b01('0x33')](_0x3942d7['model'],_0x3942d7[_0x6b01('0x31')]);_0x5482a8[_0x6b01('0x34')]=_[_0x6b01('0x33')](_0x3942d7['model'],qs[_0x6b01('0x35')](_0x542ca0[_0x6b01('0x31')][_0x6b01('0x35')]));_0x5482a8[_0x6b01('0x34')]=_0x5482a8[_0x6b01('0x34')]['length']?_0x5482a8[_0x6b01('0x34')]:_0x3942d7[_0x6b01('0x30')];if(!_0x542ca0[_0x6b01('0x31')][_0x6b01('0x36')](_0x6b01('0x37'))){_0x5482a8[_0x6b01('0x1a')]=qs[_0x6b01('0x1a')](_0x542ca0[_0x6b01('0x31')]['limit']);_0x5482a8[_0x6b01('0x18')]=qs['offset'](_0x542ca0[_0x6b01('0x31')][_0x6b01('0x18')]);}_0x5482a8[_0x6b01('0x38')]=qs[_0x6b01('0x39')](_0x542ca0[_0x6b01('0x31')][_0x6b01('0x39')]);_0x5482a8[_0x6b01('0x3a')]=qs['filters'](_[_0x6b01('0x3b')](_0x542ca0[_0x6b01('0x31')],_0x3942d7[_0x6b01('0x32')]),_0x6920cf);if(_0x542ca0[_0x6b01('0x31')][_0x6b01('0x3c')]){_0x5482a8[_0x6b01('0x3a')]=_[_0x6b01('0x3d')](_0x5482a8[_0x6b01('0x3a')],{'$or':_['map'](_0x6920cf,function(_0x2c42c3){if(_0x2c42c3['type']!==_0x6b01('0x3e')){var _0x422c38={};_0x422c38[_0x2c42c3['name']]={'$like':'%'+_0x542ca0[_0x6b01('0x31')][_0x6b01('0x3c')]+'%'};return _0x422c38;}})});}_0x5482a8=_[_0x6b01('0x3d')]({},_0x5482a8,_0x542ca0[_0x6b01('0x3f')]);var _0x2d4125={'where':_0x5482a8[_0x6b01('0x3a')]};return db[_0x6b01('0x2c')][_0x6b01('0x1b')](_0x2d4125)[_0x6b01('0x21')](function(_0x17f335){_0x4e7e32['count']=_0x17f335;if(_0x542ca0[_0x6b01('0x31')][_0x6b01('0x40')]){_0x5482a8['include']=[{'all':!![]}];}return db['ContactItemType'][_0x6b01('0x41')](_0x5482a8);})[_0x6b01('0x21')](function(_0x558ec1){_0x4e7e32[_0x6b01('0x42')]=_0x558ec1;return _0x4e7e32;})[_0x6b01('0x21')](respondWithFilteredResult(_0x39f193,_0x5482a8))['catch'](handleError(_0x39f193,null));};exports[_0x6b01('0x43')]=function(_0x5e6f28,_0x2ab117){var _0x1c6eba={'raw':!![],'where':{'id':_0x5e6f28['params']['id']}},_0xf52992={};_0xf52992[_0x6b01('0x30')]=_[_0x6b01('0x44')](db['ContactItemType']['rawAttributes']);_0xf52992['query']=_[_0x6b01('0x44')](_0x5e6f28[_0x6b01('0x31')]);_0xf52992[_0x6b01('0x32')]=_[_0x6b01('0x33')](_0xf52992[_0x6b01('0x30')],_0xf52992[_0x6b01('0x31')]);_0x1c6eba['attributes']=_[_0x6b01('0x33')](_0xf52992[_0x6b01('0x30')],qs[_0x6b01('0x35')](_0x5e6f28[_0x6b01('0x31')][_0x6b01('0x35')]));_0x1c6eba[_0x6b01('0x34')]=_0x1c6eba['attributes'][_0x6b01('0x45')]?_0x1c6eba['attributes']:_0xf52992['model'];if(_0x5e6f28[_0x6b01('0x31')][_0x6b01('0x40')]){_0x1c6eba['include']=[{'all':!![]}];}_0x1c6eba=_[_0x6b01('0x3d')]({},_0x1c6eba,_0x5e6f28[_0x6b01('0x3f')]);return db[_0x6b01('0x2c')]['find'](_0x1c6eba)['then'](handleEntityNotFound(_0x2ab117,null))['then'](respondWithResult(_0x2ab117,null))[_0x6b01('0x46')](handleError(_0x2ab117,null));};exports[_0x6b01('0x47')]=function(_0x518d94,_0x34cef6){return db['ContactItemType']['create'](_0x518d94['body'],{})[_0x6b01('0x21')](function(_0x45288a){var _0x4baef8=_0x518d94['user'][_0x6b01('0x23')]({'plain':!![]});if(!_0x4baef8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4baef8[_0x6b01('0x48')]===_0x6b01('0x49')){var _0x32d446=_0x45288a[_0x6b01('0x23')]({'plain':!![]});var _0x13f6d7='ContactItemTypes';return db[_0x6b01('0x4a')][_0x6b01('0x4b')]({'where':{'name':_0x13f6d7,'userProfileId':_0x4baef8[_0x6b01('0x4c')]},'raw':!![]})['then'](function(_0x3884e){if(_0x3884e&&_0x3884e[_0x6b01('0x4d')]===0x0){return db['UserProfileResource'][_0x6b01('0x47')]({'name':_0x32d446[_0x6b01('0x28')],'resourceId':_0x32d446['id'],'type':_0x3884e[_0x6b01('0x28')],'sectionId':_0x3884e['id']},{})[_0x6b01('0x21')](function(){return _0x45288a;});}else{return _0x45288a;}})['catch'](function(_0x5d46e7){logger[_0x6b01('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d46e7);throw _0x5d46e7;});}return _0x45288a;})['then'](respondWithResult(_0x34cef6,0xc9))[_0x6b01('0x46')](handleError(_0x34cef6,null));};exports[_0x6b01('0x4f')]=function(_0x5b5c0c,_0x2bf4b5){if(_0x5b5c0c[_0x6b01('0x50')]['id']){delete _0x5b5c0c['body']['id'];}return db[_0x6b01('0x2c')][_0x6b01('0x4b')]({'where':{'id':_0x5b5c0c[_0x6b01('0x51')]['id']}})[_0x6b01('0x21')](handleEntityNotFound(_0x2bf4b5,null))[_0x6b01('0x21')](saveUpdates(_0x5b5c0c['body'],null))[_0x6b01('0x21')](respondWithResult(_0x2bf4b5,null))['catch'](handleError(_0x2bf4b5,null));};exports[_0x6b01('0x22')]=function(_0x331815,_0x415fdd){return db['ContactItemType'][_0x6b01('0x4b')]({'where':{'id':_0x331815[_0x6b01('0x51')]['id']}})[_0x6b01('0x21')](handleEntityNotFound(_0x415fdd,null))[_0x6b01('0x21')](db['CmContactHasItem'][_0x6b01('0x4f')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x331815[_0x6b01('0x51')]['id']}}))[_0x6b01('0x21')](removeEntity(_0x415fdd,null))['catch'](handleError(_0x415fdd,null));};
\ No newline at end of file
index ca1e907..87f5725 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6360=['request-promise','path','rimraf','./contactItemType.attributes','exports','define','ContactItemType','util','../../config/logger','bluebird'];(function(_0x11fe5b,_0xfe074){var _0xa215f2=function(_0x5d0455){while(--_0x5d0455){_0x11fe5b['push'](_0x11fe5b['shift']());}};_0xa215f2(++_0xfe074);}(_0x6360,0x147));var _0x0636=function(_0x1b5a05,_0x27961b){_0x1b5a05=_0x1b5a05-0x0;var _0x14c8bc=_0x6360[_0x1b5a05];return _0x14c8bc;};'use strict';var _=require('lodash');var util=require(_0x0636('0x0'));var logger=require(_0x0636('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0636('0x2'));var rp=require(_0x0636('0x3'));var fs=require('fs');var path=require(_0x0636('0x4'));var rimraf=require(_0x0636('0x5'));var config=require('../../config/environment');var attributes=require(_0x0636('0x6'));module[_0x0636('0x7')]=function(_0x4b2f98,_0x51a1be){return _0x4b2f98[_0x0636('0x8')](_0x0636('0x9'),attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd05c=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','ContactItemType','tools_contact_item_types'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xd05c,0x18c));var _0xcd05=function(_0x24f43c,_0x2cd8b4){_0x24f43c=_0x24f43c-0x0;var _0x51d217=_0xd05c[_0x24f43c];return _0x51d217;};'use strict';var _=require(_0xcd05('0x0'));var util=require(_0xcd05('0x1'));var logger=require(_0xcd05('0x2'))(_0xcd05('0x3'));var moment=require(_0xcd05('0x4'));var BPromise=require(_0xcd05('0x5'));var rp=require(_0xcd05('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcd05('0x7'));var config=require(_0xcd05('0x8'));var attributes=require('./contactItemType.attributes');module['exports']=function(_0x40acad,_0x4bee11){return _0x40acad[_0xcd05('0x9')](_0xcd05('0xa'),attributes,{'tableName':_0xcd05('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d115b69..4318b3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61d0=['ContactItemType,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x152f00,_0x3e96c7){var _0x55db7b=function(_0x513efe){while(--_0x513efe){_0x152f00['push'](_0x152f00['shift']());}};_0x55db7b(++_0x3e96c7);}(_0x61d0,0x123));var _0x061d=function(_0x3df822,_0x299495){_0x3df822=_0x3df822-0x0;var _0x4e457d=_0x61d0[_0x3df822];return _0x4e457d;};'use strict';var _=require(_0x061d('0x0'));var util=require(_0x061d('0x1'));var moment=require(_0x061d('0x2'));var BPromise=require(_0x061d('0x3'));var rs=require(_0x061d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x061d('0x5'))['db'];var utils=require(_0x061d('0x6'));var logger=require(_0x061d('0x7'))(_0x061d('0x8'));var config=require('../../config/environment');var jayson=require(_0x061d('0x9'));var client=jayson[_0x061d('0xa')][_0x061d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf4692c,_0x6aa2f4,_0x4a53fd){return new BPromise(function(_0x5c3b04,_0x48b744){return client['request'](_0xf4692c,_0x4a53fd)[_0x061d('0xc')](function(_0xe8fe32){logger[_0x061d('0xd')](_0x061d('0xe'),_0x6aa2f4,_0x061d('0xf'));logger[_0x061d('0x10')](_0x061d('0x11'),_0x6aa2f4,'request\x20sent',JSON['stringify'](_0xe8fe32));if(_0xe8fe32['error']){if(_0xe8fe32[_0x061d('0x12')][_0x061d('0x13')]===0x1f4){logger['error'](_0x061d('0xe'),_0x6aa2f4,_0xe8fe32[_0x061d('0x12')][_0x061d('0x14')]);return _0x48b744(_0xe8fe32[_0x061d('0x12')][_0x061d('0x14')]);}logger[_0x061d('0x12')](_0x061d('0xe'),_0x6aa2f4,_0xe8fe32[_0x061d('0x12')]['message']);return _0x5c3b04(_0xe8fe32[_0x061d('0x12')][_0x061d('0x14')]);}else{logger[_0x061d('0xd')](_0x061d('0xe'),_0x6aa2f4,_0x061d('0xf'));_0x5c3b04(_0xe8fe32[_0x061d('0x15')][_0x061d('0x14')]);}})['catch'](function(_0x39a45a){logger[_0x061d('0x12')]('ContactItemType,\x20%s,\x20%s',_0x6aa2f4,_0x39a45a);_0x48b744(_0x39a45a);});});}
\ No newline at end of file
+var _0x7e0b=['http','request','info','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','error','code','ContactItemType,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x402731,_0x43c115){var _0x111736=function(_0x5a7044){while(--_0x5a7044){_0x402731['push'](_0x402731['shift']());}};_0x111736(++_0x43c115);}(_0x7e0b,0x8f));var _0xb7e0=function(_0x44905a,_0x43d712){_0x44905a=_0x44905a-0x0;var _0x5d186b=_0x7e0b[_0x44905a];return _0x5d186b;};'use strict';var _=require('lodash');var util=require(_0xb7e0('0x0'));var moment=require(_0xb7e0('0x1'));var BPromise=require(_0xb7e0('0x2'));var rs=require(_0xb7e0('0x3'));var fs=require('fs');var Redis=require(_0xb7e0('0x4'));var db=require(_0xb7e0('0x5'))['db'];var utils=require(_0xb7e0('0x6'));var logger=require(_0xb7e0('0x7'))('rpc');var config=require(_0xb7e0('0x8'));var jayson=require(_0xb7e0('0x9'));var client=jayson[_0xb7e0('0xa')][_0xb7e0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12e167,_0x2e9746,_0x318605){return new BPromise(function(_0x3a1b7a,_0x1848f0){return client[_0xb7e0('0xc')](_0x12e167,_0x318605)['then'](function(_0x1b9f88){logger[_0xb7e0('0xd')]('ContactItemType,\x20%s,\x20%s',_0x2e9746,_0xb7e0('0xe'));logger[_0xb7e0('0xf')](_0xb7e0('0x10'),_0x2e9746,_0xb7e0('0xe'),JSON['stringify'](_0x1b9f88));if(_0x1b9f88[_0xb7e0('0x11')]){if(_0x1b9f88['error'][_0xb7e0('0x12')]===0x1f4){logger[_0xb7e0('0x11')](_0xb7e0('0x13'),_0x2e9746,_0x1b9f88[_0xb7e0('0x11')][_0xb7e0('0x14')]);return _0x1848f0(_0x1b9f88[_0xb7e0('0x11')][_0xb7e0('0x14')]);}logger[_0xb7e0('0x11')](_0xb7e0('0x13'),_0x2e9746,_0x1b9f88[_0xb7e0('0x11')]['message']);return _0x3a1b7a(_0x1b9f88[_0xb7e0('0x11')][_0xb7e0('0x14')]);}else{logger[_0xb7e0('0xd')](_0xb7e0('0x13'),_0x2e9746,_0xb7e0('0xe'));_0x3a1b7a(_0x1b9f88['result'][_0xb7e0('0x14')]);}})[_0xb7e0('0x15')](function(_0x4d5f18){logger['error'](_0xb7e0('0x13'),_0x2e9746,_0x4d5f18);_0x1848f0(_0x4d5f18);});});}
\ No newline at end of file
index 2632c72..7d48d97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25ea=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./contactItemType.controller','index','/:id','show','post','isAuthenticated','create','put','update','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x25ea,0x105));var _0xa25e=function(_0x1b76e6,_0x598520){_0x1b76e6=_0x1b76e6-0x0;var _0x333b53=_0x25ea[_0x1b76e6];return _0x333b53;};'use strict';var multer=require(_0xa25e('0x0'));var util=require(_0xa25e('0x1'));var path=require(_0xa25e('0x2'));var timeout=require(_0xa25e('0x3'));var express=require(_0xa25e('0x4'));var router=express[_0xa25e('0x5')]();var fs_extra=require(_0xa25e('0x6'));var auth=require(_0xa25e('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa25e('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xa25e('0x9')]);router['get'](_0xa25e('0xa'),auth['isAuthenticated'](),controller[_0xa25e('0xb')]);router[_0xa25e('0xc')]('/',auth[_0xa25e('0xd')](),controller[_0xa25e('0xe')]);router[_0xa25e('0xf')](_0xa25e('0xa'),auth[_0xa25e('0xd')](),controller[_0xa25e('0x10')]);router[_0xa25e('0x11')](_0xa25e('0xa'),auth[_0xa25e('0xd')](),controller[_0xa25e('0x12')]);module[_0xa25e('0x13')]=router;
\ No newline at end of file
+var _0x82f8=['/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./contactItemType.controller','get','index'];(function(_0x1f8e33,_0x300371){var _0x37b939=function(_0x4d4fa4){while(--_0x4d4fa4){_0x1f8e33['push'](_0x1f8e33['shift']());}};_0x37b939(++_0x300371);}(_0x82f8,0xdb));var _0x882f=function(_0x2830df,_0x4515e5){_0x2830df=_0x2830df-0x0;var _0x6bf0fb=_0x82f8[_0x2830df];return _0x6bf0fb;};'use strict';var multer=require('multer');var util=require(_0x882f('0x0'));var path=require(_0x882f('0x1'));var timeout=require(_0x882f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x882f('0x3'));var auth=require(_0x882f('0x4'));var interaction=require(_0x882f('0x5'));var config=require('../../config/environment');var controller=require(_0x882f('0x6'));router[_0x882f('0x7')]('/',auth['isAuthenticated'](),controller[_0x882f('0x8')]);router[_0x882f('0x7')](_0x882f('0x9'),auth[_0x882f('0xa')](),controller[_0x882f('0xb')]);router[_0x882f('0xc')]('/',auth['isAuthenticated'](),controller[_0x882f('0xd')]);router[_0x882f('0xe')](_0x882f('0x9'),auth['isAuthenticated'](),controller[_0x882f('0xf')]);router[_0x882f('0x10')](_0x882f('0x9'),auth[_0x882f('0xa')](),controller[_0x882f('0x11')]);module[_0x882f('0x12')]=router;
\ No newline at end of file
index 86c10ac..1a4a996 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['STRING','sequelize'];(function(_0x5c3ae9,_0x450f9a){var _0x3f5950=function(_0x594c1f){while(--_0x594c1f){_0x5c3ae9['push'](_0x5c3ae9['shift']());}};_0x3f5950(++_0x450f9a);}(_0xb7e7,0x121));var _0x7b7e=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xb7e7[_0x513aa5];return _0x1a1a7c;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}};
\ No newline at end of file
+var _0x757a=['exports','STRING'];(function(_0x827e6f,_0x22820b){var _0x136675=function(_0x762371){while(--_0x762371){_0x827e6f['push'](_0x827e6f['shift']());}};_0x136675(++_0x22820b);}(_0x757a,0xde));var _0xa757=function(_0x365a6d,_0x3edbc8){_0x365a6d=_0x365a6d-0x0;var _0x5306a1=_0x757a[_0x365a6d];return _0x5306a1;};'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 12f2d6e..831df9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa91a=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','index','map','Dashboard','fieldName','key','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','findAll','rows','catch','show','params','intersection','length','includeAll','options','find','create','body','user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','include','omit','createdAt','updatedAt','UserProfileSection','update','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrReport','addItem','DashboardId','DashboardItem','findOne','getItems','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','../../config/logger','api','../../config/utils','redis','socket.io-emitter','./dashboard.socket','sendStatus'];(function(_0x26ae4e,_0x1d110f){var _0x3cd3bb=function(_0x1f0f67){while(--_0x1f0f67){_0x26ae4e['push'](_0x26ae4e['shift']());}};_0x3cd3bb(++_0x1d110f);}(_0xa91a,0x168));var _0xaa91=function(_0x65f0d8,_0x1937a4){_0x65f0d8=_0x65f0d8-0x0;var _0x35266a=_0xa91a[_0x65f0d8];return _0x35266a;};'use strict';var emlformat=require(_0xaa91('0x0'));var rimraf=require(_0xaa91('0x1'));var zipdir=require(_0xaa91('0x2'));var jsonpatch=require(_0xaa91('0x3'));var rp=require(_0xaa91('0x4'));var moment=require(_0xaa91('0x5'));var BPromise=require(_0xaa91('0x6'));var Mustache=require(_0xaa91('0x7'));var util=require(_0xaa91('0x8'));var path=require(_0xaa91('0x9'));var sox=require(_0xaa91('0xa'));var csv=require(_0xaa91('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa91('0xc'));var squel=require(_0xaa91('0xd'));var crypto=require(_0xaa91('0xe'));var jsforce=require(_0xaa91('0xf'));var deskjs=require(_0xaa91('0x10'));var toCsv=require(_0xaa91('0xb'));var querystring=require(_0xaa91('0x11'));var Papa=require(_0xaa91('0x12'));var Redis=require(_0xaa91('0x13'));var authService=require(_0xaa91('0x14'));var qs=require(_0xaa91('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa91('0x16'));var logger=require(_0xaa91('0x17'))(_0xaa91('0x18'));var utils=require(_0xaa91('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xaa91('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xaa91('0x1b'))(new Redis(config[_0xaa91('0x1a')]));require(_0xaa91('0x1c'))['register'](socket);function respondWithStatusCode(_0x1a4c9f,_0x3ead90){_0x3ead90=_0x3ead90||0xcc;return function(_0x3b6609){if(_0x3b6609){return _0x1a4c9f[_0xaa91('0x1d')](_0x3ead90);}return _0x1a4c9f[_0xaa91('0x1e')](_0x3ead90)[_0xaa91('0x1f')]();};}function respondWithResult(_0x5b76cc,_0x53b9f0){_0x53b9f0=_0x53b9f0||0xc8;return function(_0x42013b){if(_0x42013b){return _0x5b76cc[_0xaa91('0x1e')](_0x53b9f0)[_0xaa91('0x20')](_0x42013b);}};}function respondWithFilteredResult(_0x59be9c,_0x30c1fd){return function(_0x5773ed){if(_0x5773ed){var _0x17ce32=typeof _0x30c1fd[_0xaa91('0x21')]===_0xaa91('0x22')&&typeof _0x30c1fd[_0xaa91('0x23')]===_0xaa91('0x22');var _0x4a85c4=_0x5773ed[_0xaa91('0x24')];var _0x1e1592=_0x17ce32?0x0:_0x30c1fd[_0xaa91('0x21')];var _0xf2beea=_0x17ce32?_0x5773ed[_0xaa91('0x24')]:_0x30c1fd[_0xaa91('0x21')]+_0x30c1fd[_0xaa91('0x23')];var _0x50b629;if(_0xf2beea>=_0x4a85c4){_0xf2beea=_0x4a85c4;_0x50b629=0xc8;}else{_0x50b629=0xce;}_0x59be9c[_0xaa91('0x1e')](_0x50b629);return _0x59be9c[_0xaa91('0x25')](_0xaa91('0x26'),_0x1e1592+'-'+_0xf2beea+'/'+_0x4a85c4)['json'](_0x5773ed);}return null;};}function patchUpdates(_0x36ff43){return function(_0x199cae){try{jsonpatch[_0xaa91('0x27')](_0x199cae,_0x36ff43,!![]);}catch(_0xd4d0b){return BPromise['reject'](_0xd4d0b);}return _0x199cae[_0xaa91('0x28')]();};}function saveUpdates(_0x246b94,_0x54db76){return function(_0x2ed550){if(_0x2ed550){return _0x2ed550['update'](_0x246b94)[_0xaa91('0x29')](function(_0x442d49){return _0x442d49;});}return null;};}function removeEntity(_0x18cbfb,_0x1b3ed5){return function(_0x106a5f){if(_0x106a5f){return _0x106a5f[_0xaa91('0x2a')]()[_0xaa91('0x29')](function(){var _0x1d4c1d=_0x106a5f[_0xaa91('0x2b')]({'plain':!![]});var _0x1e5277=_0xaa91('0x2c');return db[_0xaa91('0x2d')][_0xaa91('0x2a')]({'where':{'type':_0x1e5277,'resourceId':_0x1d4c1d['id']}})[_0xaa91('0x29')](function(){return _0x106a5f;});})['then'](function(){_0x18cbfb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ba301,_0x3fb8d6){return function(_0x1038b1){if(!_0x1038b1){_0x3ba301[_0xaa91('0x1d')](0x194);}return _0x1038b1;};}function handleError(_0xe4760f,_0x417e49){_0x417e49=_0x417e49||0x1f4;return function(_0x5ee1ff){logger[_0xaa91('0x2e')](_0x5ee1ff[_0xaa91('0x2f')]);if(_0x5ee1ff['name']){delete _0x5ee1ff[_0xaa91('0x30')];}_0xe4760f['status'](_0x417e49)['send'](_0x5ee1ff);};}exports[_0xaa91('0x31')]=function(_0x4256ca,_0x22f515){var _0x5bd635={},_0x5a4cf5={},_0x463afa={'count':0x0,'rows':[]};var _0x48589f=_[_0xaa91('0x32')](db[_0xaa91('0x33')]['rawAttributes'],function(_0x192432){return{'name':_0x192432[_0xaa91('0x34')],'type':_0x192432['type'][_0xaa91('0x35')]};});_0x5a4cf5[_0xaa91('0x36')]=_[_0xaa91('0x32')](_0x48589f,_0xaa91('0x30'));_0x5a4cf5[_0xaa91('0x37')]=_[_0xaa91('0x38')](_0x4256ca['query']);_0x5a4cf5[_0xaa91('0x39')]=_['intersection'](_0x5a4cf5[_0xaa91('0x36')],_0x5a4cf5[_0xaa91('0x37')]);_0x5bd635['attributes']=_['intersection'](_0x5a4cf5[_0xaa91('0x36')],qs[_0xaa91('0x3a')](_0x4256ca['query'][_0xaa91('0x3a')]));_0x5bd635[_0xaa91('0x3b')]=_0x5bd635[_0xaa91('0x3b')]['length']?_0x5bd635[_0xaa91('0x3b')]:_0x5a4cf5[_0xaa91('0x36')];if(!_0x4256ca[_0xaa91('0x37')][_0xaa91('0x3c')](_0xaa91('0x3d'))){_0x5bd635[_0xaa91('0x23')]=qs['limit'](_0x4256ca[_0xaa91('0x37')][_0xaa91('0x23')]);_0x5bd635[_0xaa91('0x21')]=qs[_0xaa91('0x21')](_0x4256ca[_0xaa91('0x37')]['offset']);}_0x5bd635[_0xaa91('0x3e')]=qs['sort'](_0x4256ca[_0xaa91('0x37')][_0xaa91('0x3f')]);_0x5bd635[_0xaa91('0x40')]=qs[_0xaa91('0x39')](_[_0xaa91('0x41')](_0x4256ca['query'],_0x5a4cf5['filters']),_0x48589f);if(_0x4256ca[_0xaa91('0x37')][_0xaa91('0x42')]){_0x5bd635[_0xaa91('0x40')]=_[_0xaa91('0x43')](_0x5bd635[_0xaa91('0x40')],{'$or':_['map'](_0x48589f,function(_0x3473db){if(_0x3473db[_0xaa91('0x44')]!==_0xaa91('0x45')){var _0x42d7ad={};_0x42d7ad[_0x3473db[_0xaa91('0x30')]]={'$like':'%'+_0x4256ca[_0xaa91('0x37')][_0xaa91('0x42')]+'%'};return _0x42d7ad;}})});}_0x5bd635=_[_0xaa91('0x43')]({},_0x5bd635,_0x4256ca['options']);var _0x282161={'where':_0x5bd635[_0xaa91('0x40')]};return db[_0xaa91('0x33')]['count'](_0x282161)[_0xaa91('0x29')](function(_0x17ccdd){_0x463afa['count']=_0x17ccdd;if(_0x4256ca[_0xaa91('0x37')]['includeAll']){_0x5bd635['include']=[{'all':!![]}];}return db[_0xaa91('0x33')][_0xaa91('0x46')](_0x5bd635);})['then'](function(_0x200049){_0x463afa[_0xaa91('0x47')]=_0x200049;return _0x463afa;})[_0xaa91('0x29')](respondWithFilteredResult(_0x22f515,_0x5bd635))[_0xaa91('0x48')](handleError(_0x22f515,null));};exports[_0xaa91('0x49')]=function(_0x2072ac,_0x59d0ac){var _0x54dcd9={'raw':![],'where':{'id':_0x2072ac[_0xaa91('0x4a')]['id']}},_0x495616={};_0x495616[_0xaa91('0x36')]=_[_0xaa91('0x38')](db[_0xaa91('0x33')]['rawAttributes']);_0x495616['query']=_[_0xaa91('0x38')](_0x2072ac[_0xaa91('0x37')]);_0x495616['filters']=_[_0xaa91('0x4b')](_0x495616[_0xaa91('0x36')],_0x495616[_0xaa91('0x37')]);_0x54dcd9[_0xaa91('0x3b')]=_[_0xaa91('0x4b')](_0x495616[_0xaa91('0x36')],qs[_0xaa91('0x3a')](_0x2072ac['query'][_0xaa91('0x3a')]));_0x54dcd9[_0xaa91('0x3b')]=_0x54dcd9[_0xaa91('0x3b')][_0xaa91('0x4c')]?_0x54dcd9[_0xaa91('0x3b')]:_0x495616[_0xaa91('0x36')];if(_0x2072ac[_0xaa91('0x37')][_0xaa91('0x4d')]){_0x54dcd9['include']=[{'all':!![]}];}_0x54dcd9=_['merge']({},_0x54dcd9,_0x2072ac[_0xaa91('0x4e')]);return db[_0xaa91('0x33')][_0xaa91('0x4f')](_0x54dcd9)[_0xaa91('0x29')](handleEntityNotFound(_0x59d0ac,null))[_0xaa91('0x29')](respondWithResult(_0x59d0ac,null))['catch'](handleError(_0x59d0ac,null));};exports[_0xaa91('0x50')]=function(_0x293679,_0x40b37d){return db[_0xaa91('0x33')][_0xaa91('0x50')](_0x293679[_0xaa91('0x51')],{})[_0xaa91('0x29')](function(_0x2639cc){var _0x5c427c=_0x293679[_0xaa91('0x52')]['get']({'plain':!![]});if(!_0x5c427c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c427c[_0xaa91('0x53')]===_0xaa91('0x52')){var _0x325a99=_0x2639cc['get']({'plain':!![]});var _0x4c02c7=_0xaa91('0x2c');return db['UserProfileSection'][_0xaa91('0x4f')]({'where':{'name':_0x4c02c7,'userProfileId':_0x5c427c[_0xaa91('0x54')]},'raw':!![]})[_0xaa91('0x29')](function(_0x27d4da){if(_0x27d4da&&_0x27d4da['autoAssociation']===0x0){return db[_0xaa91('0x2d')][_0xaa91('0x50')]({'name':_0x325a99['name'],'resourceId':_0x325a99['id'],'type':_0x27d4da[_0xaa91('0x30')],'sectionId':_0x27d4da['id']},{})[_0xaa91('0x29')](function(){return _0x2639cc;});}else{return _0x2639cc;}})[_0xaa91('0x48')](function(_0x2b9d7d){logger[_0xaa91('0x2e')](_0xaa91('0x55'),_0x2b9d7d);throw _0x2b9d7d;});}return _0x2639cc;})[_0xaa91('0x29')](respondWithResult(_0x40b37d,0xc9))[_0xaa91('0x48')](handleError(_0x40b37d,null));};exports[_0xaa91('0x56')]=function(_0x440a50,_0x16d18b){var _0x3419e0={'where':{'id':_0x440a50[_0xaa91('0x4a')]['id']}},_0x17e89f={};_0x17e89f[_0xaa91('0x36')]=_[_0xaa91('0x38')](db[_0xaa91('0x33')][_0xaa91('0x57')]);_0x3419e0[_0xaa91('0x3b')]=_[_0xaa91('0x4b')](_0x17e89f[_0xaa91('0x36')],qs[_0xaa91('0x3a')](_0x440a50[_0xaa91('0x37')]['fields']));_0x3419e0['attributes']=_0x3419e0['attributes'][_0xaa91('0x4c')]?_0x3419e0['attributes']:_0x17e89f[_0xaa91('0x36')];if(_0x440a50[_0xaa91('0x37')][_0xaa91('0x4d')]){_0x3419e0[_0xaa91('0x58')]=[{'all':!![]}];}_0x3419e0=_['merge']({},_0x3419e0,_0x440a50['options']);return db[_0xaa91('0x33')][_0xaa91('0x4f')](_0x3419e0)[_0xaa91('0x29')](handleEntityNotFound(_0x16d18b,null))[_0xaa91('0x29')](function(_0x5f385a){if(_0x5f385a){var _0x5e6770=_0x5f385a['get']({'plain':!![]});_0x5e6770=qs[_0xaa91('0x59')](_0x5e6770,['id',_0xaa91('0x5a'),_0xaa91('0x5b')]);_0x440a50[_0xaa91('0x51')]=_[_0xaa91('0x59')](_0x440a50[_0xaa91('0x51')],['id',_0xaa91('0x5a'),_0xaa91('0x5b')]);return db[_0xaa91('0x33')]['create'](_['merge'](_0x5e6770,_0x440a50[_0xaa91('0x51')]),{'include':_0x440a50[_0xaa91('0x37')]['includeAll']?[{'all':!![]}]:undefined})[_0xaa91('0x29')](function(_0x1cc9b9){var _0x16ae6e=_0x440a50[_0xaa91('0x52')][_0xaa91('0x2b')]({'plain':!![]});if(!_0x16ae6e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16ae6e[_0xaa91('0x53')]==='user'){var _0x1129f5=_0x1cc9b9['get']({'plain':!![]});var _0x3184ba=_0xaa91('0x2c');return db[_0xaa91('0x5c')][_0xaa91('0x4f')]({'where':{'name':_0x3184ba,'userProfileId':_0x16ae6e[_0xaa91('0x54')]},'raw':!![]})[_0xaa91('0x29')](function(_0x1ea263){if(_0x1ea263&&_0x1ea263['autoAssociation']===0x0){return db[_0xaa91('0x2d')][_0xaa91('0x50')]({'name':_0x1129f5['name'],'resourceId':_0x1129f5['id'],'type':_0x1ea263[_0xaa91('0x30')],'sectionId':_0x1ea263['id']},{})['then'](function(){return _0x1cc9b9;});}else{return _0x1cc9b9;}})[_0xaa91('0x48')](function(_0x7a3b90){logger[_0xaa91('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7a3b90);throw _0x7a3b90;});}return _0x1cc9b9;});}})['then'](respondWithResult(_0x16d18b,0xc9))[_0xaa91('0x48')](handleError(_0x16d18b,null));};exports[_0xaa91('0x5d')]=function(_0x197cd8,_0xec59fb){if(_0x197cd8[_0xaa91('0x51')]['id']){delete _0x197cd8[_0xaa91('0x51')]['id'];}return db[_0xaa91('0x33')][_0xaa91('0x4f')]({'where':{'id':_0x197cd8[_0xaa91('0x4a')]['id']}})[_0xaa91('0x29')](handleEntityNotFound(_0xec59fb,null))[_0xaa91('0x29')](saveUpdates(_0x197cd8[_0xaa91('0x51')],null))[_0xaa91('0x29')](respondWithResult(_0xec59fb,null))[_0xaa91('0x48')](handleError(_0xec59fb,null));};exports[_0xaa91('0x2a')]=function(_0x2fd89a,_0x23386a){return db[_0xaa91('0x33')]['find']({'where':{'id':_0x2fd89a['params']['id']}})['then'](handleEntityNotFound(_0x23386a,null))[_0xaa91('0x29')](removeEntity(_0x23386a,null))[_0xaa91('0x48')](handleError(_0x23386a,null));};function widgetAttributes(_0x5cb87f){try{switch(_0x5cb87f[_0xaa91('0x44')]){case _0xaa91('0x5e'):return[{'name':_0xaa91('0x5f'),'value':_0x5cb87f[_0xaa91('0x5f')]||(_0x5cb87f[_0xaa91('0x60')]&&_0x5cb87f[_0xaa91('0x60')][0x0]?_0x5cb87f[_0xaa91('0x60')][0x0][_0xaa91('0x61')]:undefined)||'https://'}];case _0xaa91('0x62'):return[{'name':_0xaa91('0x63'),'value':_0x5cb87f[_0xaa91('0x63')]||(_0x5cb87f[_0xaa91('0x60')]&&_0x5cb87f[_0xaa91('0x60')][0x0]?_0x5cb87f[_0xaa91('0x60')][0x0][_0xaa91('0x61')]:undefined)||''}];case _0xaa91('0x64'):return[{'name':_0xaa91('0x65'),'value':_0x5cb87f[_0xaa91('0x65')]||(_0x5cb87f[_0xaa91('0x60')]&&_0x5cb87f['attrs'][0x0]?_0x5cb87f[_0xaa91('0x60')][0x0][_0xaa91('0x61')]:undefined)||_0xaa91('0x66')},{'name':_0xaa91('0x67'),'value':_0x5cb87f[_0xaa91('0x67')]||(_0x5cb87f[_0xaa91('0x60')]&&_0x5cb87f['attrs'][0x1]?_0x5cb87f[_0xaa91('0x60')][0x1][_0xaa91('0x61')]:undefined)||_0xaa91('0x68')},{'name':_0xaa91('0x69'),'value':_0x5cb87f[_0xaa91('0x69')]||(_0x5cb87f['attrs']&&_0x5cb87f[_0xaa91('0x60')][0x2]?_0x5cb87f[_0xaa91('0x60')][0x2][_0xaa91('0x61')]:undefined)||0xc}];case _0xaa91('0x6a'):return[{'name':_0xaa91('0x6b'),'value':_0x5cb87f[_0xaa91('0x6b')]||(_0x5cb87f[_0xaa91('0x60')]&&_0x5cb87f[_0xaa91('0x60')][0x0]?_0x5cb87f[_0xaa91('0x60')][0x0]['value']:undefined)||_0xaa91('0x6c')},{'name':_0xaa91('0x6d'),'value':_0x5cb87f[_0xaa91('0x6d')]||(_0x5cb87f[_0xaa91('0x60')]&&_0x5cb87f['attrs'][0x1]?_0x5cb87f[_0xaa91('0x60')][0x1][_0xaa91('0x61')]:undefined)||[]},{'name':_0xaa91('0x69'),'value':_0x5cb87f['attrFontSize']||(_0x5cb87f[_0xaa91('0x60')]&&_0x5cb87f['attrs'][0x2]?_0x5cb87f['attrs'][0x2]['value']:undefined)||0x14},{'name':_0xaa91('0x6e'),'value':_0x5cb87f[_0xaa91('0x6e')]||(_0x5cb87f[_0xaa91('0x60')]&&_0x5cb87f[_0xaa91('0x60')][0x3]?_0x5cb87f[_0xaa91('0x60')][0x3]['value']:undefined)||_0xaa91('0x6f')},{'name':'attrEmailAccounts','value':_0x5cb87f[_0xaa91('0x70')]||(_0x5cb87f['attrs']&&_0x5cb87f[_0xaa91('0x60')][0x4]?_0x5cb87f[_0xaa91('0x60')][0x4][_0xaa91('0x61')]:undefined)||''},{'name':_0xaa91('0x71'),'value':_0x5cb87f['attrFaxAccounts']||(_0x5cb87f['attrs']&&_0x5cb87f[_0xaa91('0x60')][0x5]?_0x5cb87f[_0xaa91('0x60')][0x5]['value']:undefined)||''},{'name':_0xaa91('0x72'),'value':_0x5cb87f[_0xaa91('0x72')]||(_0x5cb87f[_0xaa91('0x60')]&&_0x5cb87f[_0xaa91('0x60')][0x6]?_0x5cb87f[_0xaa91('0x60')][0x6][_0xaa91('0x61')]:undefined)||''},{'name':_0xaa91('0x73'),'value':_0x5cb87f[_0xaa91('0x73')]||(_0x5cb87f[_0xaa91('0x60')]&&_0x5cb87f['attrs'][0x7]?_0x5cb87f[_0xaa91('0x60')][0x7][_0xaa91('0x61')]:undefined)||''},{'name':_0xaa91('0x74'),'value':_0x5cb87f['attrWhatsappAccounts']||(_0x5cb87f['attrs']&&_0x5cb87f[_0xaa91('0x60')][0x8]?_0x5cb87f[_0xaa91('0x60')][0x8][_0xaa91('0x61')]:undefined)||''},{'name':_0xaa91('0x75'),'value':_0x5cb87f[_0xaa91('0x75')]||(_0x5cb87f[_0xaa91('0x60')]&&_0x5cb87f[_0xaa91('0x60')][0x9]?_0x5cb87f[_0xaa91('0x60')][0x9][_0xaa91('0x61')]:undefined)||''}];case _0xaa91('0x76'):case'pie-chart':return[{'name':_0xaa91('0x77'),'value':_0x5cb87f[_0xaa91('0x77')]||(_0x5cb87f['attrs']&&_0x5cb87f[_0xaa91('0x60')][0x0]?_0x5cb87f[_0xaa91('0x60')][0x0]['value']:undefined)||_0xaa91('0x6c')},{'name':_0xaa91('0x78'),'value':_0x5cb87f[_0xaa91('0x78')]||(_0x5cb87f[_0xaa91('0x60')]&&_0x5cb87f[_0xaa91('0x60')][0x1]?_0x5cb87f['attrs'][0x1][_0xaa91('0x61')]:undefined)||null},{'name':'attrSerie3','value':_0x5cb87f[_0xaa91('0x79')]||(_0x5cb87f[_0xaa91('0x60')]&&_0x5cb87f[_0xaa91('0x60')][0x2]?_0x5cb87f[_0xaa91('0x60')][0x2]['value']:undefined)||null},{'name':_0xaa91('0x6d'),'value':_0x5cb87f[_0xaa91('0x6d')]||(_0x5cb87f[_0xaa91('0x60')]&&_0x5cb87f['attrs'][0x3]?_0x5cb87f['attrs'][0x3][_0xaa91('0x61')]:undefined)||[]},{'name':_0xaa91('0x6e'),'value':_0x5cb87f[_0xaa91('0x6e')]||(_0x5cb87f[_0xaa91('0x60')]&&_0x5cb87f[_0xaa91('0x60')][0x4]?_0x5cb87f[_0xaa91('0x60')][0x4][_0xaa91('0x61')]:undefined)||_0xaa91('0x6f')},{'name':_0xaa91('0x70'),'value':_0x5cb87f['attrEmailAccounts']||(_0x5cb87f[_0xaa91('0x60')]&&_0x5cb87f[_0xaa91('0x60')][0x5]?_0x5cb87f[_0xaa91('0x60')][0x5][_0xaa91('0x61')]:undefined)||''},{'name':_0xaa91('0x71'),'value':_0x5cb87f[_0xaa91('0x71')]||(_0x5cb87f['attrs']&&_0x5cb87f[_0xaa91('0x60')][0x6]?_0x5cb87f[_0xaa91('0x60')][0x6][_0xaa91('0x61')]:undefined)||''},{'name':_0xaa91('0x72'),'value':_0x5cb87f[_0xaa91('0x72')]||(_0x5cb87f[_0xaa91('0x60')]&&_0x5cb87f['attrs'][0x7]?_0x5cb87f['attrs'][0x7]['value']:undefined)||''},{'name':_0xaa91('0x73'),'value':_0x5cb87f[_0xaa91('0x73')]||(_0x5cb87f[_0xaa91('0x60')]&&_0x5cb87f[_0xaa91('0x60')][0x8]?_0x5cb87f['attrs'][0x8][_0xaa91('0x61')]:undefined)||''},{'name':_0xaa91('0x74'),'value':_0x5cb87f[_0xaa91('0x74')]||(_0x5cb87f['attrs']&&_0x5cb87f[_0xaa91('0x60')][0x9]?_0x5cb87f['attrs'][0x9]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x5cb87f[_0xaa91('0x75')]||(_0x5cb87f[_0xaa91('0x60')]&&_0x5cb87f['attrs'][0xa]?_0x5cb87f[_0xaa91('0x60')][0xa][_0xaa91('0x61')]:undefined)||''}];case _0xaa91('0x7a'):return[{'name':'attrReport','type':_0x5cb87f[_0xaa91('0x7b')]||(_0x5cb87f['attrs']&&_0x5cb87f[_0xaa91('0x60')][0x0]?_0x5cb87f[_0xaa91('0x60')][0x0][_0xaa91('0x44')]:undefined)||null,'value':_0x5cb87f[_0xaa91('0x7c')]||(_0x5cb87f[_0xaa91('0x60')]&&_0x5cb87f[_0xaa91('0x60')][0x0]?_0x5cb87f[_0xaa91('0x60')][0x0][_0xaa91('0x61')]:undefined)||null},{'name':'attrRefresh','value':_0x5cb87f['attrRefresh']||(_0x5cb87f[_0xaa91('0x60')]&&_0x5cb87f[_0xaa91('0x60')][0x1]?_0x5cb87f['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x11d0a2){logger[_0xaa91('0x2e')]('widgetAttributes:\x20%s',JSON['stringify'](_0x11d0a2));return[];}}exports[_0xaa91('0x7d')]=function(_0x173473,_0x85870,_0x902ab4){if(_0x173473[_0xaa91('0x51')]['id']){delete _0x173473[_0xaa91('0x51')]['id'];}return db[_0xaa91('0x33')]['find']({'where':{'id':_0x173473[_0xaa91('0x4a')]['id']}})[_0xaa91('0x29')](handleEntityNotFound(_0x85870,null))[_0xaa91('0x29')](function(_0x22853e){if(_0x22853e){_0x173473[_0xaa91('0x51')][_0xaa91('0x7e')]=_0x22853e['id'];_0x173473[_0xaa91('0x51')]['attrs']=widgetAttributes(_0x173473['body']);return db[_0xaa91('0x7f')]['create'](_0x173473[_0xaa91('0x51')]);}})['then'](respondWithResult(_0x85870,null))['catch'](handleError(_0x85870,null));};exports['getItems']=function(_0x4372ee,_0x292f2c,_0xeec75b){var _0x4ebb52={};var _0x2ee9b5={};var _0x5307ab;var _0x55ded7;return db[_0xaa91('0x33')][_0xaa91('0x80')]({'where':{'id':_0x4372ee['params']['id']}})['then'](handleEntityNotFound(_0x292f2c,null))['then'](function(_0x83be41){if(_0x83be41){_0x5307ab=_0x83be41;_0x2ee9b5[_0xaa91('0x36')]=_[_0xaa91('0x38')](db[_0xaa91('0x7f')]['rawAttributes']);_0x2ee9b5[_0xaa91('0x37')]=_[_0xaa91('0x38')](_0x4372ee['query']);_0x2ee9b5[_0xaa91('0x39')]=_[_0xaa91('0x4b')](_0x2ee9b5[_0xaa91('0x36')],_0x2ee9b5[_0xaa91('0x37')]);_0x4ebb52['attributes']=_[_0xaa91('0x4b')](_0x2ee9b5[_0xaa91('0x36')],qs[_0xaa91('0x3a')](_0x4372ee[_0xaa91('0x37')][_0xaa91('0x3a')]));_0x4ebb52[_0xaa91('0x3b')]=_0x4ebb52[_0xaa91('0x3b')][_0xaa91('0x4c')]?_0x4ebb52['attributes']:_0x2ee9b5['model'];_0x4ebb52['order']=qs[_0xaa91('0x3f')](_0x4372ee[_0xaa91('0x37')][_0xaa91('0x3f')]);_0x4ebb52[_0xaa91('0x40')]=qs['filters'](_['pick'](_0x4372ee['query'],_0x2ee9b5[_0xaa91('0x39')]));if(_0x4372ee['query'][_0xaa91('0x42')]){_0x4ebb52['where']=_[_0xaa91('0x43')](_0x4ebb52[_0xaa91('0x40')],{'$or':_[_0xaa91('0x32')](_0x4ebb52['attributes'],function(_0x32072a){var _0x60d31a={};_0x60d31a[_0x32072a]={'$like':'%'+_0x4372ee['query']['filter']+'%'};return _0x60d31a;})});}_0x4ebb52=_[_0xaa91('0x43')]({},_0x4ebb52,_0x4372ee[_0xaa91('0x4e')]);return _0x5307ab[_0xaa91('0x81')](_0x4ebb52);}})[_0xaa91('0x29')](function(_0x27bb8a){if(_0x27bb8a){_0x55ded7=_0x27bb8a[_0xaa91('0x4c')];if(!_0x4372ee['query'][_0xaa91('0x3c')](_0xaa91('0x3d'))){_0x4ebb52[_0xaa91('0x23')]=qs[_0xaa91('0x23')](_0x4372ee['query'][_0xaa91('0x23')]);_0x4ebb52[_0xaa91('0x21')]=qs[_0xaa91('0x21')](_0x4372ee[_0xaa91('0x37')]['offset']);}return _0x5307ab['getItems'](_0x4ebb52);}})[_0xaa91('0x29')](function(_0x392e36){if(_0x392e36){return _0x392e36?{'count':_0x55ded7,'rows':_0x392e36}:null;}})[_0xaa91('0x29')](respondWithResult(_0x292f2c,null))[_0xaa91('0x48')](handleError(_0x292f2c,null));};
\ No newline at end of file
+var _0xc696=['destroy','then','CustomDashboards','UserProfileResource','error','stack','name','send','index','map','Dashboard','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','show','params','options','find','catch','create','body','user','get','role','userProfileId','autoAssociation','clone','length','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','voice','attrWhatsappAccounts','web-report','attrReport','reportType','attrRefresh','stringify','addItem','findOne','DashboardItem','getItems','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./dashboard.socket','sendStatus','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update'];(function(_0x2134b2,_0x5a82aa){var _0x4e4bc8=function(_0x5816b6){while(--_0x5816b6){_0x2134b2['push'](_0x2134b2['shift']());}};_0x4e4bc8(++_0x5a82aa);}(_0xc696,0x159));var _0x6c69=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0xc696[_0x4b73a2];return _0x383c66;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6c69('0x0'));var moment=require(_0x6c69('0x1'));var BPromise=require(_0x6c69('0x2'));var Mustache=require(_0x6c69('0x3'));var util=require(_0x6c69('0x4'));var path=require(_0x6c69('0x5'));var sox=require(_0x6c69('0x6'));var csv=require(_0x6c69('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c69('0x8'));var _=require(_0x6c69('0x9'));var squel=require('squel');var crypto=require(_0x6c69('0xa'));var jsforce=require(_0x6c69('0xb'));var deskjs=require(_0x6c69('0xc'));var toCsv=require(_0x6c69('0x7'));var querystring=require(_0x6c69('0xd'));var Papa=require(_0x6c69('0xe'));var Redis=require(_0x6c69('0xf'));var authService=require(_0x6c69('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6c69('0x11'))(_0x6c69('0x12'));var utils=require(_0x6c69('0x13'));var config=require(_0x6c69('0x14'));var licenseUtil=require(_0x6c69('0x15'));var db=require(_0x6c69('0x16'))['db'];config[_0x6c69('0x17')]=_[_0x6c69('0x18')](config[_0x6c69('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6c69('0x17')]));require(_0x6c69('0x19'))['register'](socket);function respondWithStatusCode(_0x50c1a6,_0x27b1c9){_0x27b1c9=_0x27b1c9||0xcc;return function(_0x625fdc){if(_0x625fdc){return _0x50c1a6[_0x6c69('0x1a')](_0x27b1c9);}return _0x50c1a6['status'](_0x27b1c9)[_0x6c69('0x1b')]();};}function respondWithResult(_0x55df81,_0x388183){_0x388183=_0x388183||0xc8;return function(_0x1ea086){if(_0x1ea086){return _0x55df81['status'](_0x388183)[_0x6c69('0x1c')](_0x1ea086);}};}function respondWithFilteredResult(_0x2f0282,_0x169015){return function(_0x2df9a5){if(_0x2df9a5){var _0x2d1e14=typeof _0x169015[_0x6c69('0x1d')]==='undefined'&&typeof _0x169015[_0x6c69('0x1e')]===_0x6c69('0x1f');var _0x28ddc6=_0x2df9a5['count'];var _0xf21cb1=_0x2d1e14?0x0:_0x169015[_0x6c69('0x1d')];var _0x20c645=_0x2d1e14?_0x2df9a5[_0x6c69('0x20')]:_0x169015[_0x6c69('0x1d')]+_0x169015[_0x6c69('0x1e')];var _0x361ce1;if(_0x20c645>=_0x28ddc6){_0x20c645=_0x28ddc6;_0x361ce1=0xc8;}else{_0x361ce1=0xce;}_0x2f0282['status'](_0x361ce1);return _0x2f0282[_0x6c69('0x21')](_0x6c69('0x22'),_0xf21cb1+'-'+_0x20c645+'/'+_0x28ddc6)[_0x6c69('0x1c')](_0x2df9a5);}return null;};}function patchUpdates(_0x388c9c){return function(_0x36c113){try{jsonpatch[_0x6c69('0x23')](_0x36c113,_0x388c9c,!![]);}catch(_0x3c7317){return BPromise[_0x6c69('0x24')](_0x3c7317);}return _0x36c113[_0x6c69('0x25')]();};}function saveUpdates(_0x2789f3,_0x4c187c){return function(_0x332b2d){if(_0x332b2d){return _0x332b2d[_0x6c69('0x26')](_0x2789f3)['then'](function(_0x461b8d){return _0x461b8d;});}return null;};}function removeEntity(_0x194622,_0x6eec98){return function(_0x20ad33){if(_0x20ad33){return _0x20ad33[_0x6c69('0x27')]()[_0x6c69('0x28')](function(){var _0x5cf8f8=_0x20ad33['get']({'plain':!![]});var _0x425cfc=_0x6c69('0x29');return db[_0x6c69('0x2a')][_0x6c69('0x27')]({'where':{'type':_0x425cfc,'resourceId':_0x5cf8f8['id']}})[_0x6c69('0x28')](function(){return _0x20ad33;});})[_0x6c69('0x28')](function(){_0x194622['status'](0xcc)[_0x6c69('0x1b')]();});}};}function handleEntityNotFound(_0x598efa,_0x4cd00d){return function(_0x38bc55){if(!_0x38bc55){_0x598efa[_0x6c69('0x1a')](0x194);}return _0x38bc55;};}function handleError(_0x19168c,_0x2bec61){_0x2bec61=_0x2bec61||0x1f4;return function(_0x2bf4fd){logger[_0x6c69('0x2b')](_0x2bf4fd[_0x6c69('0x2c')]);if(_0x2bf4fd[_0x6c69('0x2d')]){delete _0x2bf4fd['name'];}_0x19168c['status'](_0x2bec61)[_0x6c69('0x2e')](_0x2bf4fd);};}exports[_0x6c69('0x2f')]=function(_0x4638a2,_0x24028f){var _0x5c2139={},_0x50ffd4={},_0x54ca7c={'count':0x0,'rows':[]};var _0x1f84ff=_[_0x6c69('0x30')](db[_0x6c69('0x31')][_0x6c69('0x32')],function(_0xabaed7){return{'name':_0xabaed7['fieldName'],'type':_0xabaed7[_0x6c69('0x33')]['key']};});_0x50ffd4[_0x6c69('0x34')]=_[_0x6c69('0x30')](_0x1f84ff,_0x6c69('0x2d'));_0x50ffd4[_0x6c69('0x35')]=_[_0x6c69('0x36')](_0x4638a2[_0x6c69('0x35')]);_0x50ffd4[_0x6c69('0x37')]=_[_0x6c69('0x38')](_0x50ffd4[_0x6c69('0x34')],_0x50ffd4[_0x6c69('0x35')]);_0x5c2139['attributes']=_['intersection'](_0x50ffd4[_0x6c69('0x34')],qs[_0x6c69('0x39')](_0x4638a2['query'][_0x6c69('0x39')]));_0x5c2139[_0x6c69('0x3a')]=_0x5c2139['attributes']['length']?_0x5c2139[_0x6c69('0x3a')]:_0x50ffd4[_0x6c69('0x34')];if(!_0x4638a2[_0x6c69('0x35')][_0x6c69('0x3b')](_0x6c69('0x3c'))){_0x5c2139[_0x6c69('0x1e')]=qs['limit'](_0x4638a2[_0x6c69('0x35')][_0x6c69('0x1e')]);_0x5c2139[_0x6c69('0x1d')]=qs[_0x6c69('0x1d')](_0x4638a2['query'][_0x6c69('0x1d')]);}_0x5c2139[_0x6c69('0x3d')]=qs[_0x6c69('0x3e')](_0x4638a2[_0x6c69('0x35')][_0x6c69('0x3e')]);_0x5c2139[_0x6c69('0x3f')]=qs[_0x6c69('0x37')](_[_0x6c69('0x40')](_0x4638a2[_0x6c69('0x35')],_0x50ffd4[_0x6c69('0x37')]),_0x1f84ff);if(_0x4638a2['query']['filter']){_0x5c2139['where']=_[_0x6c69('0x41')](_0x5c2139['where'],{'$or':_[_0x6c69('0x30')](_0x1f84ff,function(_0x564639){if(_0x564639[_0x6c69('0x33')]!=='VIRTUAL'){var _0x594e45={};_0x594e45[_0x564639[_0x6c69('0x2d')]]={'$like':'%'+_0x4638a2['query'][_0x6c69('0x42')]+'%'};return _0x594e45;}})});}_0x5c2139=_['merge']({},_0x5c2139,_0x4638a2['options']);var _0x5bc978={'where':_0x5c2139[_0x6c69('0x3f')]};return db[_0x6c69('0x31')][_0x6c69('0x20')](_0x5bc978)[_0x6c69('0x28')](function(_0x3eb70d){_0x54ca7c[_0x6c69('0x20')]=_0x3eb70d;if(_0x4638a2[_0x6c69('0x35')][_0x6c69('0x43')]){_0x5c2139[_0x6c69('0x44')]=[{'all':!![]}];}return db[_0x6c69('0x31')][_0x6c69('0x45')](_0x5c2139);})[_0x6c69('0x28')](function(_0x37ca8b){_0x54ca7c['rows']=_0x37ca8b;return _0x54ca7c;})[_0x6c69('0x28')](respondWithFilteredResult(_0x24028f,_0x5c2139))['catch'](handleError(_0x24028f,null));};exports[_0x6c69('0x46')]=function(_0x138765,_0x3fb18e){var _0x3e9536={'raw':![],'where':{'id':_0x138765[_0x6c69('0x47')]['id']}},_0x330c03={};_0x330c03[_0x6c69('0x34')]=_[_0x6c69('0x36')](db['Dashboard']['rawAttributes']);_0x330c03['query']=_[_0x6c69('0x36')](_0x138765[_0x6c69('0x35')]);_0x330c03[_0x6c69('0x37')]=_[_0x6c69('0x38')](_0x330c03[_0x6c69('0x34')],_0x330c03['query']);_0x3e9536[_0x6c69('0x3a')]=_['intersection'](_0x330c03[_0x6c69('0x34')],qs['fields'](_0x138765[_0x6c69('0x35')][_0x6c69('0x39')]));_0x3e9536[_0x6c69('0x3a')]=_0x3e9536[_0x6c69('0x3a')]['length']?_0x3e9536[_0x6c69('0x3a')]:_0x330c03[_0x6c69('0x34')];if(_0x138765[_0x6c69('0x35')]['includeAll']){_0x3e9536[_0x6c69('0x44')]=[{'all':!![]}];}_0x3e9536=_[_0x6c69('0x41')]({},_0x3e9536,_0x138765[_0x6c69('0x48')]);return db[_0x6c69('0x31')][_0x6c69('0x49')](_0x3e9536)['then'](handleEntityNotFound(_0x3fb18e,null))[_0x6c69('0x28')](respondWithResult(_0x3fb18e,null))[_0x6c69('0x4a')](handleError(_0x3fb18e,null));};exports[_0x6c69('0x4b')]=function(_0x3f5c90,_0x2d39b3){return db[_0x6c69('0x31')][_0x6c69('0x4b')](_0x3f5c90[_0x6c69('0x4c')],{})[_0x6c69('0x28')](function(_0x56f612){var _0x5e65c9=_0x3f5c90[_0x6c69('0x4d')][_0x6c69('0x4e')]({'plain':!![]});if(!_0x5e65c9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e65c9[_0x6c69('0x4f')]===_0x6c69('0x4d')){var _0x58f592=_0x56f612[_0x6c69('0x4e')]({'plain':!![]});var _0x50812e='CustomDashboards';return db['UserProfileSection'][_0x6c69('0x49')]({'where':{'name':_0x50812e,'userProfileId':_0x5e65c9[_0x6c69('0x50')]},'raw':!![]})[_0x6c69('0x28')](function(_0x408f82){if(_0x408f82&&_0x408f82[_0x6c69('0x51')]===0x0){return db['UserProfileResource'][_0x6c69('0x4b')]({'name':_0x58f592[_0x6c69('0x2d')],'resourceId':_0x58f592['id'],'type':_0x408f82[_0x6c69('0x2d')],'sectionId':_0x408f82['id']},{})[_0x6c69('0x28')](function(){return _0x56f612;});}else{return _0x56f612;}})['catch'](function(_0x1abc13){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1abc13);throw _0x1abc13;});}return _0x56f612;})[_0x6c69('0x28')](respondWithResult(_0x2d39b3,0xc9))[_0x6c69('0x4a')](handleError(_0x2d39b3,null));};exports[_0x6c69('0x52')]=function(_0x325eb4,_0x4e07e6){var _0x4756bd={'where':{'id':_0x325eb4[_0x6c69('0x47')]['id']}},_0x1536a3={};_0x1536a3[_0x6c69('0x34')]=_[_0x6c69('0x36')](db[_0x6c69('0x31')][_0x6c69('0x32')]);_0x4756bd[_0x6c69('0x3a')]=_[_0x6c69('0x38')](_0x1536a3['model'],qs[_0x6c69('0x39')](_0x325eb4['query']['fields']));_0x4756bd[_0x6c69('0x3a')]=_0x4756bd[_0x6c69('0x3a')][_0x6c69('0x53')]?_0x4756bd[_0x6c69('0x3a')]:_0x1536a3[_0x6c69('0x34')];if(_0x325eb4[_0x6c69('0x35')][_0x6c69('0x43')]){_0x4756bd[_0x6c69('0x44')]=[{'all':!![]}];}_0x4756bd=_[_0x6c69('0x41')]({},_0x4756bd,_0x325eb4[_0x6c69('0x48')]);return db['Dashboard'][_0x6c69('0x49')](_0x4756bd)[_0x6c69('0x28')](handleEntityNotFound(_0x4e07e6,null))['then'](function(_0x33bbe2){if(_0x33bbe2){var _0x381a20=_0x33bbe2[_0x6c69('0x4e')]({'plain':!![]});_0x381a20=qs[_0x6c69('0x54')](_0x381a20,['id',_0x6c69('0x55'),_0x6c69('0x56')]);_0x325eb4[_0x6c69('0x4c')]=_[_0x6c69('0x54')](_0x325eb4['body'],['id','createdAt',_0x6c69('0x56')]);return db[_0x6c69('0x31')][_0x6c69('0x4b')](_['merge'](_0x381a20,_0x325eb4[_0x6c69('0x4c')]),{'include':_0x325eb4[_0x6c69('0x35')][_0x6c69('0x43')]?[{'all':!![]}]:undefined})[_0x6c69('0x28')](function(_0x1d00b3){var _0x54ced0=_0x325eb4['user'][_0x6c69('0x4e')]({'plain':!![]});if(!_0x54ced0)throw new Error(_0x6c69('0x57'));if(_0x54ced0[_0x6c69('0x4f')]===_0x6c69('0x4d')){var _0x43ef9d=_0x1d00b3['get']({'plain':!![]});var _0x5cbbc7=_0x6c69('0x29');return db[_0x6c69('0x58')]['find']({'where':{'name':_0x5cbbc7,'userProfileId':_0x54ced0[_0x6c69('0x50')]},'raw':!![]})[_0x6c69('0x28')](function(_0x3f791f){if(_0x3f791f&&_0x3f791f['autoAssociation']===0x0){return db[_0x6c69('0x2a')]['create']({'name':_0x43ef9d['name'],'resourceId':_0x43ef9d['id'],'type':_0x3f791f[_0x6c69('0x2d')],'sectionId':_0x3f791f['id']},{})['then'](function(){return _0x1d00b3;});}else{return _0x1d00b3;}})[_0x6c69('0x4a')](function(_0x351786){logger['error'](_0x6c69('0x59'),_0x351786);throw _0x351786;});}return _0x1d00b3;});}})[_0x6c69('0x28')](respondWithResult(_0x4e07e6,0xc9))[_0x6c69('0x4a')](handleError(_0x4e07e6,null));};exports[_0x6c69('0x26')]=function(_0x52d72d,_0x2d868c){if(_0x52d72d[_0x6c69('0x4c')]['id']){delete _0x52d72d[_0x6c69('0x4c')]['id'];}return db[_0x6c69('0x31')]['find']({'where':{'id':_0x52d72d['params']['id']}})['then'](handleEntityNotFound(_0x2d868c,null))[_0x6c69('0x28')](saveUpdates(_0x52d72d[_0x6c69('0x4c')],null))['then'](respondWithResult(_0x2d868c,null))[_0x6c69('0x4a')](handleError(_0x2d868c,null));};exports[_0x6c69('0x27')]=function(_0x1be878,_0x296bd8){return db[_0x6c69('0x31')]['find']({'where':{'id':_0x1be878[_0x6c69('0x47')]['id']}})[_0x6c69('0x28')](handleEntityNotFound(_0x296bd8,null))['then'](removeEntity(_0x296bd8,null))[_0x6c69('0x4a')](handleError(_0x296bd8,null));};function widgetAttributes(_0x3d79cd){try{switch(_0x3d79cd['type']){case _0x6c69('0x5a'):return[{'name':'attrUrl','value':_0x3d79cd[_0x6c69('0x5b')]||(_0x3d79cd[_0x6c69('0x5c')]&&_0x3d79cd[_0x6c69('0x5c')][0x0]?_0x3d79cd['attrs'][0x0][_0x6c69('0x5d')]:undefined)||_0x6c69('0x5e')}];case _0x6c69('0x5f'):return[{'name':_0x6c69('0x60'),'value':_0x3d79cd['attrPath']||(_0x3d79cd['attrs']&&_0x3d79cd[_0x6c69('0x5c')][0x0]?_0x3d79cd[_0x6c69('0x5c')][0x0][_0x6c69('0x5d')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x3d79cd[_0x6c69('0x61')]||(_0x3d79cd[_0x6c69('0x5c')]&&_0x3d79cd['attrs'][0x0]?_0x3d79cd['attrs'][0x0][_0x6c69('0x5d')]:undefined)||_0x6c69('0x62')},{'name':_0x6c69('0x63'),'value':_0x3d79cd[_0x6c69('0x63')]||(_0x3d79cd['attrs']&&_0x3d79cd[_0x6c69('0x5c')][0x1]?_0x3d79cd[_0x6c69('0x5c')][0x1][_0x6c69('0x5d')]:undefined)||_0x6c69('0x64')},{'name':_0x6c69('0x65'),'value':_0x3d79cd[_0x6c69('0x65')]||(_0x3d79cd[_0x6c69('0x5c')]&&_0x3d79cd[_0x6c69('0x5c')][0x2]?_0x3d79cd[_0x6c69('0x5c')][0x2][_0x6c69('0x5d')]:undefined)||0xc}];case _0x6c69('0x66'):return[{'name':_0x6c69('0x67'),'value':_0x3d79cd[_0x6c69('0x67')]||(_0x3d79cd['attrs']&&_0x3d79cd[_0x6c69('0x5c')][0x0]?_0x3d79cd[_0x6c69('0x5c')][0x0][_0x6c69('0x5d')]:undefined)||_0x6c69('0x68')},{'name':_0x6c69('0x69'),'value':_0x3d79cd['attrVoiceQueues']||(_0x3d79cd[_0x6c69('0x5c')]&&_0x3d79cd[_0x6c69('0x5c')][0x1]?_0x3d79cd[_0x6c69('0x5c')][0x1][_0x6c69('0x5d')]:undefined)||[]},{'name':_0x6c69('0x65'),'value':_0x3d79cd[_0x6c69('0x65')]||(_0x3d79cd[_0x6c69('0x5c')]&&_0x3d79cd[_0x6c69('0x5c')][0x2]?_0x3d79cd[_0x6c69('0x5c')][0x2][_0x6c69('0x5d')]:undefined)||0x14},{'name':_0x6c69('0x6a'),'value':_0x3d79cd[_0x6c69('0x6a')]||(_0x3d79cd['attrs']&&_0x3d79cd[_0x6c69('0x5c')][0x3]?_0x3d79cd[_0x6c69('0x5c')][0x3][_0x6c69('0x5d')]:undefined)||'voice'},{'name':_0x6c69('0x6b'),'value':_0x3d79cd['attrEmailAccounts']||(_0x3d79cd[_0x6c69('0x5c')]&&_0x3d79cd['attrs'][0x4]?_0x3d79cd[_0x6c69('0x5c')][0x4][_0x6c69('0x5d')]:undefined)||''},{'name':_0x6c69('0x6c'),'value':_0x3d79cd[_0x6c69('0x6c')]||(_0x3d79cd[_0x6c69('0x5c')]&&_0x3d79cd[_0x6c69('0x5c')][0x5]?_0x3d79cd[_0x6c69('0x5c')][0x5][_0x6c69('0x5d')]:undefined)||''},{'name':_0x6c69('0x6d'),'value':_0x3d79cd[_0x6c69('0x6d')]||(_0x3d79cd['attrs']&&_0x3d79cd[_0x6c69('0x5c')][0x6]?_0x3d79cd[_0x6c69('0x5c')][0x6]['value']:undefined)||''},{'name':_0x6c69('0x6e'),'value':_0x3d79cd[_0x6c69('0x6e')]||(_0x3d79cd['attrs']&&_0x3d79cd[_0x6c69('0x5c')][0x7]?_0x3d79cd[_0x6c69('0x5c')][0x7][_0x6c69('0x5d')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x3d79cd['attrWhatsappAccounts']||(_0x3d79cd['attrs']&&_0x3d79cd[_0x6c69('0x5c')][0x8]?_0x3d79cd[_0x6c69('0x5c')][0x8][_0x6c69('0x5d')]:undefined)||''},{'name':_0x6c69('0x6f'),'value':_0x3d79cd['attrChatWebsites']||(_0x3d79cd['attrs']&&_0x3d79cd[_0x6c69('0x5c')][0x9]?_0x3d79cd[_0x6c69('0x5c')][0x9][_0x6c69('0x5d')]:undefined)||''}];case _0x6c69('0x70'):case _0x6c69('0x71'):return[{'name':_0x6c69('0x72'),'value':_0x3d79cd['attrSerie1']||(_0x3d79cd[_0x6c69('0x5c')]&&_0x3d79cd['attrs'][0x0]?_0x3d79cd[_0x6c69('0x5c')][0x0][_0x6c69('0x5d')]:undefined)||'total'},{'name':_0x6c69('0x73'),'value':_0x3d79cd[_0x6c69('0x73')]||(_0x3d79cd[_0x6c69('0x5c')]&&_0x3d79cd['attrs'][0x1]?_0x3d79cd['attrs'][0x1][_0x6c69('0x5d')]:undefined)||null},{'name':_0x6c69('0x74'),'value':_0x3d79cd[_0x6c69('0x74')]||(_0x3d79cd[_0x6c69('0x5c')]&&_0x3d79cd['attrs'][0x2]?_0x3d79cd[_0x6c69('0x5c')][0x2][_0x6c69('0x5d')]:undefined)||null},{'name':_0x6c69('0x69'),'value':_0x3d79cd[_0x6c69('0x69')]||(_0x3d79cd['attrs']&&_0x3d79cd['attrs'][0x3]?_0x3d79cd[_0x6c69('0x5c')][0x3]['value']:undefined)||[]},{'name':_0x6c69('0x6a'),'value':_0x3d79cd[_0x6c69('0x6a')]||(_0x3d79cd[_0x6c69('0x5c')]&&_0x3d79cd[_0x6c69('0x5c')][0x4]?_0x3d79cd[_0x6c69('0x5c')][0x4][_0x6c69('0x5d')]:undefined)||_0x6c69('0x75')},{'name':'attrEmailAccounts','value':_0x3d79cd['attrEmailAccounts']||(_0x3d79cd[_0x6c69('0x5c')]&&_0x3d79cd[_0x6c69('0x5c')][0x5]?_0x3d79cd[_0x6c69('0x5c')][0x5][_0x6c69('0x5d')]:undefined)||''},{'name':_0x6c69('0x6c'),'value':_0x3d79cd[_0x6c69('0x6c')]||(_0x3d79cd[_0x6c69('0x5c')]&&_0x3d79cd[_0x6c69('0x5c')][0x6]?_0x3d79cd[_0x6c69('0x5c')][0x6][_0x6c69('0x5d')]:undefined)||''},{'name':_0x6c69('0x6d'),'value':_0x3d79cd[_0x6c69('0x6d')]||(_0x3d79cd[_0x6c69('0x5c')]&&_0x3d79cd[_0x6c69('0x5c')][0x7]?_0x3d79cd[_0x6c69('0x5c')][0x7][_0x6c69('0x5d')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x3d79cd['attrOpenchannelAccounts']||(_0x3d79cd[_0x6c69('0x5c')]&&_0x3d79cd[_0x6c69('0x5c')][0x8]?_0x3d79cd[_0x6c69('0x5c')][0x8][_0x6c69('0x5d')]:undefined)||''},{'name':_0x6c69('0x76'),'value':_0x3d79cd[_0x6c69('0x76')]||(_0x3d79cd['attrs']&&_0x3d79cd[_0x6c69('0x5c')][0x9]?_0x3d79cd['attrs'][0x9][_0x6c69('0x5d')]:undefined)||''},{'name':_0x6c69('0x6f'),'value':_0x3d79cd[_0x6c69('0x6f')]||(_0x3d79cd[_0x6c69('0x5c')]&&_0x3d79cd[_0x6c69('0x5c')][0xa]?_0x3d79cd[_0x6c69('0x5c')][0xa]['value']:undefined)||''}];case _0x6c69('0x77'):return[{'name':_0x6c69('0x78'),'type':_0x3d79cd[_0x6c69('0x79')]||(_0x3d79cd[_0x6c69('0x5c')]&&_0x3d79cd['attrs'][0x0]?_0x3d79cd[_0x6c69('0x5c')][0x0][_0x6c69('0x33')]:undefined)||null,'value':_0x3d79cd[_0x6c69('0x78')]||(_0x3d79cd[_0x6c69('0x5c')]&&_0x3d79cd['attrs'][0x0]?_0x3d79cd[_0x6c69('0x5c')][0x0][_0x6c69('0x5d')]:undefined)||null},{'name':'attrRefresh','value':_0x3d79cd[_0x6c69('0x7a')]||(_0x3d79cd[_0x6c69('0x5c')]&&_0x3d79cd[_0x6c69('0x5c')][0x1]?_0x3d79cd[_0x6c69('0x5c')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x355ad6){logger[_0x6c69('0x2b')]('widgetAttributes:\x20%s',JSON[_0x6c69('0x7b')](_0x355ad6));return[];}}exports[_0x6c69('0x7c')]=function(_0x132b0e,_0x5d327b,_0x5294b8){if(_0x132b0e['body']['id']){delete _0x132b0e[_0x6c69('0x4c')]['id'];}return db[_0x6c69('0x31')][_0x6c69('0x49')]({'where':{'id':_0x132b0e[_0x6c69('0x47')]['id']}})['then'](handleEntityNotFound(_0x5d327b,null))[_0x6c69('0x28')](function(_0x216209){if(_0x216209){_0x132b0e[_0x6c69('0x4c')]['DashboardId']=_0x216209['id'];_0x132b0e[_0x6c69('0x4c')][_0x6c69('0x5c')]=widgetAttributes(_0x132b0e[_0x6c69('0x4c')]);return db['DashboardItem'][_0x6c69('0x4b')](_0x132b0e[_0x6c69('0x4c')]);}})[_0x6c69('0x28')](respondWithResult(_0x5d327b,null))[_0x6c69('0x4a')](handleError(_0x5d327b,null));};exports['getItems']=function(_0x175478,_0x3e485f,_0x368327){var _0x2b92b1={};var _0x29c262={};var _0x391217;var _0x52cea5;return db[_0x6c69('0x31')][_0x6c69('0x7d')]({'where':{'id':_0x175478[_0x6c69('0x47')]['id']}})['then'](handleEntityNotFound(_0x3e485f,null))[_0x6c69('0x28')](function(_0x437649){if(_0x437649){_0x391217=_0x437649;_0x29c262['model']=_['keys'](db[_0x6c69('0x7e')][_0x6c69('0x32')]);_0x29c262['query']=_[_0x6c69('0x36')](_0x175478[_0x6c69('0x35')]);_0x29c262[_0x6c69('0x37')]=_[_0x6c69('0x38')](_0x29c262[_0x6c69('0x34')],_0x29c262[_0x6c69('0x35')]);_0x2b92b1[_0x6c69('0x3a')]=_['intersection'](_0x29c262[_0x6c69('0x34')],qs[_0x6c69('0x39')](_0x175478['query'][_0x6c69('0x39')]));_0x2b92b1[_0x6c69('0x3a')]=_0x2b92b1[_0x6c69('0x3a')][_0x6c69('0x53')]?_0x2b92b1['attributes']:_0x29c262[_0x6c69('0x34')];_0x2b92b1[_0x6c69('0x3d')]=qs[_0x6c69('0x3e')](_0x175478[_0x6c69('0x35')][_0x6c69('0x3e')]);_0x2b92b1['where']=qs['filters'](_['pick'](_0x175478['query'],_0x29c262['filters']));if(_0x175478[_0x6c69('0x35')][_0x6c69('0x42')]){_0x2b92b1[_0x6c69('0x3f')]=_[_0x6c69('0x41')](_0x2b92b1[_0x6c69('0x3f')],{'$or':_[_0x6c69('0x30')](_0x2b92b1[_0x6c69('0x3a')],function(_0x1c6c61){var _0x50a178={};_0x50a178[_0x1c6c61]={'$like':'%'+_0x175478[_0x6c69('0x35')][_0x6c69('0x42')]+'%'};return _0x50a178;})});}_0x2b92b1=_[_0x6c69('0x41')]({},_0x2b92b1,_0x175478[_0x6c69('0x48')]);return _0x391217[_0x6c69('0x7f')](_0x2b92b1);}})[_0x6c69('0x28')](function(_0x2d0fe8){if(_0x2d0fe8){_0x52cea5=_0x2d0fe8[_0x6c69('0x53')];if(!_0x175478[_0x6c69('0x35')][_0x6c69('0x3b')]('nolimit')){_0x2b92b1[_0x6c69('0x1e')]=qs[_0x6c69('0x1e')](_0x175478['query']['limit']);_0x2b92b1[_0x6c69('0x1d')]=qs[_0x6c69('0x1d')](_0x175478[_0x6c69('0x35')][_0x6c69('0x1d')]);}return _0x391217['getItems'](_0x2b92b1);}})[_0x6c69('0x28')](function(_0x4063db){if(_0x4063db){return _0x4063db?{'count':_0x52cea5,'rows':_0x4063db}:null;}})[_0x6c69('0x28')](respondWithResult(_0x3e485f,null))[_0x6c69('0x4a')](handleError(_0x3e485f,null));};
\ No newline at end of file
index 0fd6782..9955bf1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78c6=['hasOwnProperty','hook','exports','setMaxListeners','save','remove','emit'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x78c6,0x168));var _0x678c=function(_0x31b057,_0x86ef95){_0x31b057=_0x31b057-0x0;var _0x823ed5=_0x78c6[_0x31b057];return _0x823ed5;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x678c('0x0')](0x0);var events={'afterCreate':_0x678c('0x1'),'afterUpdate':'update','afterDestroy':_0x678c('0x2')};function emitEvent(_0x5339f7){return function(_0x75a6fd,_0x30a6b2,_0x388cc5){DashboardEvents['emit'](_0x5339f7+':'+_0x75a6fd['id'],_0x75a6fd);DashboardEvents[_0x678c('0x3')](_0x5339f7,_0x75a6fd);_0x388cc5(null);};}for(var e in events){if(events[_0x678c('0x4')](e)){var event=events[e];Dashboard[_0x678c('0x5')](e,emitEvent(event));}}module[_0x678c('0x6')]=DashboardEvents;
\ No newline at end of file
+var _0x9ff9=['hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x532cb6,_0x10327c){var _0x153f07=function(_0x194d7f){while(--_0x194d7f){_0x532cb6['push'](_0x532cb6['shift']());}};_0x153f07(++_0x10327c);}(_0x9ff9,0x1c3));var _0x99ff=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x9ff9[_0xae7c2f];return _0x5d7001;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x99ff('0x0'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x99ff('0x1')](0x0);var events={'afterCreate':_0x99ff('0x2'),'afterUpdate':'update','afterDestroy':_0x99ff('0x3')};function emitEvent(_0x3a1b21){return function(_0x24dd77,_0x3aa823,_0x56f748){DashboardEvents[_0x99ff('0x4')](_0x3a1b21+':'+_0x24dd77['id'],_0x24dd77);DashboardEvents[_0x99ff('0x4')](_0x3a1b21,_0x24dd77);_0x56f748(null);};}for(var e in events){if(events[_0x99ff('0x5')](e)){var event=events[e];Dashboard[_0x99ff('0x6')](e,emitEvent(event));}}module[_0x99ff('0x7')]=DashboardEvents;
\ No newline at end of file
index 01a29f0..a269fc6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2804=['path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util','moment','bluebird'];(function(_0x8a2815,_0x486a45){var _0x1af5a9=function(_0x43c59c){while(--_0x43c59c){_0x8a2815['push'](_0x8a2815['shift']());}};_0x1af5a9(++_0x486a45);}(_0x2804,0xf8));var _0x4280=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x2804[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x4280('0x0'));var util=require(_0x4280('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4280('0x2'));var BPromise=require(_0x4280('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4280('0x4'));var rimraf=require(_0x4280('0x5'));var config=require(_0x4280('0x6'));var attributes=require(_0x4280('0x7'));module[_0x4280('0x8')]=function(_0x1a6037,_0x386b9b){return _0x1a6037[_0x4280('0x9')](_0x4280('0xa'),attributes,{'tableName':_0x4280('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4aec=['util','bluebird','request-promise','rimraf','../../config/environment','./dashboard.attributes','exports','define','dashboards','lodash'];(function(_0x2bfab7,_0x2fe57a){var _0x396b19=function(_0x2f6be9){while(--_0x2f6be9){_0x2bfab7['push'](_0x2bfab7['shift']());}};_0x396b19(++_0x2fe57a);}(_0x4aec,0x1ad));var _0xc4ae=function(_0x7fd27d,_0x529012){_0x7fd27d=_0x7fd27d-0x0;var _0xe4896a=_0x4aec[_0x7fd27d];return _0xe4896a;};'use strict';var _=require(_0xc4ae('0x0'));var util=require(_0xc4ae('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc4ae('0x2'));var rp=require(_0xc4ae('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc4ae('0x4'));var config=require(_0xc4ae('0x5'));var attributes=require(_0xc4ae('0x6'));module[_0xc4ae('0x7')]=function(_0x260325,_0x530bcf){return _0x260325[_0xc4ae('0x8')]('Dashboard',attributes,{'tableName':_0xc4ae('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 660b571..f0ff6f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87d3=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','socket.io-emitter','redis','register','request','then','info','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','error','Dashboard,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird'];(function(_0x2d59b2,_0x20d65f){var _0x25759b=function(_0x3e8337){while(--_0x3e8337){_0x2d59b2['push'](_0x2d59b2['shift']());}};_0x25759b(++_0x20d65f);}(_0x87d3,0x7f));var _0x387d=function(_0x137815,_0x78dd4b){_0x137815=_0x137815-0x0;var _0x29ded1=_0x87d3[_0x137815];return _0x29ded1;};'use strict';var _=require(_0x387d('0x0'));var util=require('util');var moment=require(_0x387d('0x1'));var BPromise=require(_0x387d('0x2'));var rs=require(_0x387d('0x3'));var fs=require('fs');var Redis=require(_0x387d('0x4'));var db=require(_0x387d('0x5'))['db'];var utils=require(_0x387d('0x6'));var logger=require(_0x387d('0x7'))(_0x387d('0x8'));var config=require(_0x387d('0x9'));var jayson=require(_0x387d('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x387d('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x387d('0xc'))(new Redis(config[_0x387d('0xd')]));require('./dashboard.socket')[_0x387d('0xe')](socket);function respondWithRpcPromise(_0x542020,_0x22a0e9,_0x15a659){return new BPromise(function(_0xf14565,_0x310fa7){return client[_0x387d('0xf')](_0x542020,_0x15a659)[_0x387d('0x10')](function(_0x4733d5){logger[_0x387d('0x11')]('Dashboard,\x20%s,\x20%s',_0x22a0e9,'request\x20sent');logger[_0x387d('0x12')](_0x387d('0x13'),_0x22a0e9,_0x387d('0x14'),JSON['stringify'](_0x4733d5));if(_0x4733d5['error']){if(_0x4733d5[_0x387d('0x15')]['code']===0x1f4){logger[_0x387d('0x15')](_0x387d('0x16'),_0x22a0e9,_0x4733d5[_0x387d('0x15')][_0x387d('0x17')]);return _0x310fa7(_0x4733d5[_0x387d('0x15')][_0x387d('0x17')]);}logger[_0x387d('0x15')](_0x387d('0x16'),_0x22a0e9,_0x4733d5[_0x387d('0x15')][_0x387d('0x17')]);return _0xf14565(_0x4733d5['error'][_0x387d('0x17')]);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0x22a0e9,_0x387d('0x14'));_0xf14565(_0x4733d5[_0x387d('0x18')]['message']);}})[_0x387d('0x19')](function(_0x21869f){logger[_0x387d('0x15')](_0x387d('0x16'),_0x22a0e9,_0x21869f);_0x310fa7(_0x21869f);});});}
\ No newline at end of file
+var _0xf9f3=['../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','info','debug','request\x20sent','error','Dashboard,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x14ea62,_0x25fff9){var _0x250e9a=function(_0x5b97f5){while(--_0x5b97f5){_0x14ea62['push'](_0x14ea62['shift']());}};_0x250e9a(++_0x25fff9);}(_0xf9f3,0x107));var _0x3f9f=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xf9f3[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x3f9f('0x0'));var util=require(_0x3f9f('0x1'));var moment=require(_0x3f9f('0x2'));var BPromise=require(_0x3f9f('0x3'));var rs=require(_0x3f9f('0x4'));var fs=require('fs');var Redis=require(_0x3f9f('0x5'));var db=require(_0x3f9f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3f9f('0x7'))(_0x3f9f('0x8'));var config=require(_0x3f9f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3f9f('0xa')][_0x3f9f('0xb')]({'port':0x232a});config[_0x3f9f('0xc')]=_[_0x3f9f('0xd')](config['redis'],{'host':_0x3f9f('0xe'),'port':0x18eb});var socket=require(_0x3f9f('0xf'))(new Redis(config['redis']));require(_0x3f9f('0x10'))[_0x3f9f('0x11')](socket);function respondWithRpcPromise(_0x2283d3,_0x2bfc53,_0x15acaa){return new BPromise(function(_0x4baa92,_0x36b993){return client[_0x3f9f('0x12')](_0x2283d3,_0x15acaa)['then'](function(_0x359fc4){logger[_0x3f9f('0x13')]('Dashboard,\x20%s,\x20%s',_0x2bfc53,'request\x20sent');logger[_0x3f9f('0x14')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x2bfc53,_0x3f9f('0x15'),JSON['stringify'](_0x359fc4));if(_0x359fc4[_0x3f9f('0x16')]){if(_0x359fc4['error']['code']===0x1f4){logger[_0x3f9f('0x16')](_0x3f9f('0x17'),_0x2bfc53,_0x359fc4['error'][_0x3f9f('0x18')]);return _0x36b993(_0x359fc4[_0x3f9f('0x16')]['message']);}logger['error'](_0x3f9f('0x17'),_0x2bfc53,_0x359fc4[_0x3f9f('0x16')][_0x3f9f('0x18')]);return _0x4baa92(_0x359fc4[_0x3f9f('0x16')][_0x3f9f('0x18')]);}else{logger[_0x3f9f('0x13')](_0x3f9f('0x17'),_0x2bfc53,_0x3f9f('0x15'));_0x4baa92(_0x359fc4[_0x3f9f('0x19')][_0x3f9f('0x18')]);}})[_0x3f9f('0x1a')](function(_0x180aec){logger[_0x3f9f('0x16')](_0x3f9f('0x17'),_0x2bfc53,_0x180aec);_0x36b993(_0x180aec);});});}
\ No newline at end of file
index f131c74..1d760a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6aa4=['./dashboard.events','save','update','register','dashboard:'];(function(_0x20d9f3,_0x4b0bc7){var _0x2f36fc=function(_0x1e0db4){while(--_0x1e0db4){_0x20d9f3['push'](_0x20d9f3['shift']());}};_0x2f36fc(++_0x4b0bc7);}(_0x6aa4,0x1db));var _0x46aa=function(_0xd82dc5,_0x4b6c18){_0xd82dc5=_0xd82dc5-0x0;var _0x378a88=_0x6aa4[_0xd82dc5];return _0x378a88;};'use strict';var DashboardEvents=require(_0x46aa('0x0'));var events=[_0x46aa('0x1'),'remove',_0x46aa('0x2')];function createListener(_0x187c51,_0x3d9377){return function(_0x3ceaf2){_0x3d9377['emit'](_0x187c51,_0x3ceaf2);};}function removeListener(_0x1db796,_0x204428){return function(){DashboardEvents['removeListener'](_0x1db796,_0x204428);};}exports[_0x46aa('0x3')]=function(_0x354cff){for(var _0x5767f4=0x0,_0x2652a1=events['length'];_0x5767f4<_0x2652a1;_0x5767f4++){var _0x296cd9=events[_0x5767f4];var _0x120024=createListener(_0x46aa('0x4')+_0x296cd9,_0x354cff);DashboardEvents['on'](_0x296cd9,_0x120024);}};
\ No newline at end of file
+var _0xd5cf=['length','dashboard:','./dashboard.events','remove','update','emit','removeListener','register'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd5cf,0x7a));var _0xfd5c=function(_0x404dbf,_0x2580f9){_0x404dbf=_0x404dbf-0x0;var _0xb94ec9=_0xd5cf[_0x404dbf];return _0xb94ec9;};'use strict';var DashboardEvents=require(_0xfd5c('0x0'));var events=['save',_0xfd5c('0x1'),_0xfd5c('0x2')];function createListener(_0x4cdcd0,_0x24c1a0){return function(_0x33c89f){_0x24c1a0[_0xfd5c('0x3')](_0x4cdcd0,_0x33c89f);};}function removeListener(_0x38ad20,_0x1afbdb){return function(){DashboardEvents[_0xfd5c('0x4')](_0x38ad20,_0x1afbdb);};}exports[_0xfd5c('0x5')]=function(_0x340500){for(var _0x1ae376=0x0,_0x431062=events[_0xfd5c('0x6')];_0x1ae376<_0x431062;_0x1ae376++){var _0x7552ac=events[_0x1ae376];var _0x492cfe=createListener(_0xfd5c('0x7')+_0x7552ac,_0x340500);DashboardEvents['on'](_0x7552ac,_0x492cfe);}};
\ No newline at end of file
index dd3b022..427fcf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43e1=['getItems','post','create','/:id/clone','clone','put','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','isAuthenticated','get','/:id','show','/:id/items'];(function(_0x1f2d19,_0x169b90){var _0x58d273=function(_0x425f90){while(--_0x425f90){_0x1f2d19['push'](_0x1f2d19['shift']());}};_0x58d273(++_0x169b90);}(_0x43e1,0x168));var _0x143e=function(_0x2f4c1c,_0x5a3dd4){_0x2f4c1c=_0x2f4c1c-0x0;var _0x25e0f2=_0x43e1[_0x2f4c1c];return _0x25e0f2;};'use strict';var multer=require(_0x143e('0x0'));var util=require(_0x143e('0x1'));var path=require('path');var timeout=require(_0x143e('0x2'));var express=require('express');var router=express[_0x143e('0x3')]();var fs_extra=require(_0x143e('0x4'));var auth=require(_0x143e('0x5'));var interaction=require(_0x143e('0x6'));var config=require(_0x143e('0x7'));var controller=require(_0x143e('0x8'));router['get']('/',auth[_0x143e('0x9')](),controller['index']);router[_0x143e('0xa')](_0x143e('0xb'),auth[_0x143e('0x9')](),controller[_0x143e('0xc')]);router[_0x143e('0xa')](_0x143e('0xd'),auth[_0x143e('0x9')](),controller[_0x143e('0xe')]);router[_0x143e('0xf')]('/',auth[_0x143e('0x9')](),controller[_0x143e('0x10')]);router[_0x143e('0xf')](_0x143e('0x11'),auth[_0x143e('0x9')](),controller[_0x143e('0x12')]);router['post'](_0x143e('0xd'),auth[_0x143e('0x9')](),controller['addItem']);router[_0x143e('0x13')]('/:id',auth[_0x143e('0x9')](),controller['update']);router[_0x143e('0x14')](_0x143e('0xb'),auth[_0x143e('0x9')](),controller[_0x143e('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xfdc9=['index','/:id','isAuthenticated','/:id/items','getItems','post','/:id/clone','clone','put','update','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get'];(function(_0x245e58,_0xb3ceec){var _0x5a627e=function(_0x23754c){while(--_0x23754c){_0x245e58['push'](_0x245e58['shift']());}};_0x5a627e(++_0xb3ceec);}(_0xfdc9,0xe9));var _0x9fdc=function(_0x220614,_0x2fc588){_0x220614=_0x220614-0x0;var _0x4e718d=_0xfdc9[_0x220614];return _0x4e718d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9fdc('0x0'));var timeout=require(_0x9fdc('0x1'));var express=require('express');var router=express[_0x9fdc('0x2')]();var fs_extra=require(_0x9fdc('0x3'));var auth=require(_0x9fdc('0x4'));var interaction=require(_0x9fdc('0x5'));var config=require(_0x9fdc('0x6'));var controller=require(_0x9fdc('0x7'));router[_0x9fdc('0x8')]('/',auth['isAuthenticated'](),controller[_0x9fdc('0x9')]);router['get'](_0x9fdc('0xa'),auth[_0x9fdc('0xb')](),controller['show']);router[_0x9fdc('0x8')](_0x9fdc('0xc'),auth[_0x9fdc('0xb')](),controller[_0x9fdc('0xd')]);router[_0x9fdc('0xe')]('/',auth[_0x9fdc('0xb')](),controller['create']);router['post'](_0x9fdc('0xf'),auth['isAuthenticated'](),controller[_0x9fdc('0x10')]);router['post'](_0x9fdc('0xc'),auth[_0x9fdc('0xb')](),controller['addItem']);router[_0x9fdc('0x11')](_0x9fdc('0xa'),auth[_0x9fdc('0xb')](),controller[_0x9fdc('0x12')]);router[_0x9fdc('0x13')](_0x9fdc('0xa'),auth[_0x9fdc('0xb')](),controller[_0x9fdc('0x14')]);module[_0x9fdc('0x15')]=router;
\ No newline at end of file
index 6366456..eefe12e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['parse','attrs','stringify','setDataValue','INTEGER','#2196f3','sequelize','squel','lodash','exports','STRING','long'];(function(_0x9f82f3,_0x39b805){var _0x2ee808=function(_0x167be2){while(--_0x167be2){_0x9f82f3['push'](_0x9f82f3['shift']());}};_0x2ee808(++_0x39b805);}(_0x2ef3,0xba));var _0x32ef=function(_0x428852,_0x414d76){_0x428852=_0x428852-0x0;var _0x1e03b0=_0x2ef3[_0x428852];return _0x1e03b0;};'use strict';var Sequelize=require(_0x32ef('0x0'));var squel=require(_0x32ef('0x1'));var _=require(_0x32ef('0x2'));module[_0x32ef('0x3')]={'title':{'type':Sequelize[_0x32ef('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x32ef('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x32ef('0x5')),'get':function(){try{return JSON[_0x32ef('0x6')](this['getDataValue'](_0x32ef('0x7')));}catch(_0x37dd1d){return[];}},'set':function(_0x4c8104){try{this['setDataValue'](_0x32ef('0x7'),JSON[_0x32ef('0x8')](_0x4c8104));}catch(_0x367c39){this[_0x32ef('0x9')](_0x32ef('0x7'),JSON[_0x32ef('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x32ef('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x32ef('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x32ef('0xa')]},'col':{'type':Sequelize[_0x32ef('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x32ef('0x4')],'allowNull':![],'defaultValue':_0x32ef('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x32ef('0x4')]},'titleFontSize':{'type':Sequelize[_0x32ef('0xa')],'defaultValue':0xc}};
\ No newline at end of file
+var _0x1967=['parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#2196f3','squel','lodash','exports','STRING','TEXT','long'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x1967,0x173));var _0x7196=function(_0x41b459,_0x40cd23){_0x41b459=_0x41b459-0x0;var _0x282375=_0x1967[_0x41b459];return _0x282375;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x7196('0x0'));var _=require(_0x7196('0x1'));module[_0x7196('0x2')]={'title':{'type':Sequelize[_0x7196('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x7196('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x7196('0x4')](_0x7196('0x5')),'get':function(){try{return JSON[_0x7196('0x6')](this[_0x7196('0x7')](_0x7196('0x8')));}catch(_0x5c128f){return[];}},'set':function(_0x36b01e){try{this[_0x7196('0x9')](_0x7196('0x8'),JSON[_0x7196('0xa')](_0x36b01e));}catch(_0x266a6e){this[_0x7196('0x9')]('attrs',JSON[_0x7196('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0x7196('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x7196('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x7196('0xb')]},'col':{'type':Sequelize[_0x7196('0xb')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x7196('0x3')],'allowNull':![],'defaultValue':_0x7196('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x7196('0x3')]},'titleFontSize':{'type':Sequelize[_0x7196('0xb')],'defaultValue':0xc}};
\ No newline at end of file
index c253c97..95c0799 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1d3=['HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','type','attrRefresh','error','stringify','body','create','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','show','params','keys','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','destroy','DashboardItem','attrs','value','https://','custom','attrPath','clock','attrHourFormat'];(function(_0x2f3aa7,_0x2d7ce7){var _0x2c334c=function(_0x552741){while(--_0x552741){_0x2f3aa7['push'](_0x2f3aa7['shift']());}};_0x2c334c(++_0x2d7ce7);}(_0xe1d3,0x159));var _0x3e1d=function(_0x43fd57,_0xcc26fe){_0x43fd57=_0x43fd57-0x0;var _0x4c671c=_0xe1d3[_0x43fd57];return _0x4c671c;};'use strict';var emlformat=require(_0x3e1d('0x0'));var rimraf=require(_0x3e1d('0x1'));var zipdir=require(_0x3e1d('0x2'));var jsonpatch=require(_0x3e1d('0x3'));var rp=require(_0x3e1d('0x4'));var moment=require('moment');var BPromise=require(_0x3e1d('0x5'));var Mustache=require('mustache');var util=require(_0x3e1d('0x6'));var path=require(_0x3e1d('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3e1d('0x8'));var fs=require('fs');var fs_extra=require(_0x3e1d('0x9'));var _=require(_0x3e1d('0xa'));var squel=require(_0x3e1d('0xb'));var crypto=require(_0x3e1d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3e1d('0xd'));var toCsv=require(_0x3e1d('0xe'));var querystring=require('querystring');var Papa=require(_0x3e1d('0xf'));var Redis=require(_0x3e1d('0x10'));var authService=require(_0x3e1d('0x11'));var qs=require(_0x3e1d('0x12'));var as=require(_0x3e1d('0x13'));var hardwareService=require(_0x3e1d('0x14'));var logger=require(_0x3e1d('0x15'))(_0x3e1d('0x16'));var utils=require(_0x3e1d('0x17'));var config=require(_0x3e1d('0x18'));var licenseUtil=require(_0x3e1d('0x19'));var db=require(_0x3e1d('0x1a'))['db'];config[_0x3e1d('0x1b')]=_[_0x3e1d('0x1c')](config['redis'],{'host':_0x3e1d('0x1d'),'port':0x18eb});var socket=require(_0x3e1d('0x1e'))(new Redis(config['redis']));require(_0x3e1d('0x1f'))[_0x3e1d('0x20')](socket);function respondWithStatusCode(_0x4e77a6,_0x1b9a1f){_0x1b9a1f=_0x1b9a1f||0xcc;return function(_0xa58738){if(_0xa58738){return _0x4e77a6[_0x3e1d('0x21')](_0x1b9a1f);}return _0x4e77a6[_0x3e1d('0x22')](_0x1b9a1f)[_0x3e1d('0x23')]();};}function respondWithResult(_0x5a6513,_0x26626c){_0x26626c=_0x26626c||0xc8;return function(_0x2721e5){if(_0x2721e5){return _0x5a6513['status'](_0x26626c)[_0x3e1d('0x24')](_0x2721e5);}};}function respondWithFilteredResult(_0x368372,_0x517b8d){return function(_0x38a13f){if(_0x38a13f){var _0x46062f=typeof _0x517b8d[_0x3e1d('0x25')]===_0x3e1d('0x26')&&typeof _0x517b8d[_0x3e1d('0x27')]===_0x3e1d('0x26');var _0x4bc1a4=_0x38a13f[_0x3e1d('0x28')];var _0x37a676=_0x46062f?0x0:_0x517b8d['offset'];var _0x135af0=_0x46062f?_0x38a13f[_0x3e1d('0x28')]:_0x517b8d[_0x3e1d('0x25')]+_0x517b8d['limit'];var _0x22e8f0;if(_0x135af0>=_0x4bc1a4){_0x135af0=_0x4bc1a4;_0x22e8f0=0xc8;}else{_0x22e8f0=0xce;}_0x368372['status'](_0x22e8f0);return _0x368372[_0x3e1d('0x29')](_0x3e1d('0x2a'),_0x37a676+'-'+_0x135af0+'/'+_0x4bc1a4)[_0x3e1d('0x24')](_0x38a13f);}return null;};}function patchUpdates(_0x34b191){return function(_0x31556a){try{jsonpatch[_0x3e1d('0x2b')](_0x31556a,_0x34b191,!![]);}catch(_0x263231){return BPromise[_0x3e1d('0x2c')](_0x263231);}return _0x31556a[_0x3e1d('0x2d')]();};}function saveUpdates(_0x5291c4,_0x3d7e21){return function(_0x3d9985){if(_0x3d9985){return _0x3d9985[_0x3e1d('0x2e')](_0x5291c4)[_0x3e1d('0x2f')](function(_0x212c45){return _0x212c45;});}return null;};}function removeEntity(_0x168af6,_0x51db49){return function(_0x59376d){if(_0x59376d){return _0x59376d['destroy']()[_0x3e1d('0x2f')](function(){_0x168af6[_0x3e1d('0x22')](0xcc)[_0x3e1d('0x23')]();});}};}function handleEntityNotFound(_0x438bd4,_0x49c9b3){return function(_0x13eb37){if(!_0x13eb37){_0x438bd4[_0x3e1d('0x21')](0x194);}return _0x13eb37;};}function handleError(_0x353b5,_0x5b974f){_0x5b974f=_0x5b974f||0x1f4;return function(_0x4dd08d){logger['error'](_0x4dd08d[_0x3e1d('0x30')]);if(_0x4dd08d[_0x3e1d('0x31')]){delete _0x4dd08d[_0x3e1d('0x31')];}_0x353b5[_0x3e1d('0x22')](_0x5b974f)['send'](_0x4dd08d);};}exports[_0x3e1d('0x32')]=function(_0xa4768c,_0x3558f6){var _0x2e20c9={'raw':![],'where':{'id':_0xa4768c[_0x3e1d('0x33')]['id']}},_0x5c425f={};_0x5c425f['model']=_[_0x3e1d('0x34')](db['DashboardItem']['rawAttributes']);_0x5c425f[_0x3e1d('0x35')]=_[_0x3e1d('0x34')](_0xa4768c[_0x3e1d('0x35')]);_0x5c425f[_0x3e1d('0x36')]=_[_0x3e1d('0x37')](_0x5c425f[_0x3e1d('0x38')],_0x5c425f[_0x3e1d('0x35')]);_0x2e20c9[_0x3e1d('0x39')]=_['intersection'](_0x5c425f[_0x3e1d('0x38')],qs['fields'](_0xa4768c[_0x3e1d('0x35')][_0x3e1d('0x3a')]));_0x2e20c9[_0x3e1d('0x39')]=_0x2e20c9[_0x3e1d('0x39')][_0x3e1d('0x3b')]?_0x2e20c9['attributes']:_0x5c425f[_0x3e1d('0x38')];if(_0xa4768c[_0x3e1d('0x35')][_0x3e1d('0x3c')]){_0x2e20c9[_0x3e1d('0x3d')]=[{'all':!![]}];}_0x2e20c9=_[_0x3e1d('0x3e')]({},_0x2e20c9,_0xa4768c[_0x3e1d('0x3f')]);return db['DashboardItem'][_0x3e1d('0x40')](_0x2e20c9)[_0x3e1d('0x2f')](handleEntityNotFound(_0x3558f6,null))[_0x3e1d('0x2f')](respondWithResult(_0x3558f6,null))[_0x3e1d('0x41')](handleError(_0x3558f6,null));};exports[_0x3e1d('0x42')]=function(_0x25d742,_0x558e46){return db[_0x3e1d('0x43')][_0x3e1d('0x40')]({'where':{'id':_0x25d742['params']['id']}})['then'](handleEntityNotFound(_0x558e46,null))['then'](removeEntity(_0x558e46,null))[_0x3e1d('0x41')](handleError(_0x558e46,null));};function widgetAttributes(_0x29d1bd){try{switch(_0x29d1bd['type']){case'iframe':return[{'name':'attrUrl','value':_0x29d1bd['attrUrl']||(_0x29d1bd['attrs']&&_0x29d1bd[_0x3e1d('0x44')][0x0]?_0x29d1bd[_0x3e1d('0x44')][0x0][_0x3e1d('0x45')]:undefined)||_0x3e1d('0x46')}];case _0x3e1d('0x47'):return[{'name':'attrPath','value':_0x29d1bd[_0x3e1d('0x48')]||(_0x29d1bd['attrs']&&_0x29d1bd[_0x3e1d('0x44')][0x0]?_0x29d1bd[_0x3e1d('0x44')][0x0][_0x3e1d('0x45')]:undefined)||''}];case _0x3e1d('0x49'):return[{'name':_0x3e1d('0x4a'),'value':_0x29d1bd[_0x3e1d('0x4a')]||(_0x29d1bd[_0x3e1d('0x44')]&&_0x29d1bd[_0x3e1d('0x44')][0x0]?_0x29d1bd[_0x3e1d('0x44')][0x0][_0x3e1d('0x45')]:undefined)||_0x3e1d('0x4b')},{'name':_0x3e1d('0x4c'),'value':_0x29d1bd[_0x3e1d('0x4c')]||(_0x29d1bd['attrs']&&_0x29d1bd[_0x3e1d('0x44')][0x1]?_0x29d1bd[_0x3e1d('0x44')][0x1][_0x3e1d('0x45')]:undefined)||_0x3e1d('0x4d')},{'name':'attrFontSize','value':_0x29d1bd[_0x3e1d('0x4e')]||(_0x29d1bd[_0x3e1d('0x44')]&&_0x29d1bd['attrs'][0x2]?_0x29d1bd[_0x3e1d('0x44')][0x2][_0x3e1d('0x45')]:undefined)||0xc}];case _0x3e1d('0x4f'):return[{'name':'attrMetric','value':_0x29d1bd[_0x3e1d('0x50')]||(_0x29d1bd['attrs']&&_0x29d1bd[_0x3e1d('0x44')][0x0]?_0x29d1bd[_0x3e1d('0x44')][0x0][_0x3e1d('0x45')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x29d1bd[_0x3e1d('0x51')]||(_0x29d1bd['attrs']&&_0x29d1bd[_0x3e1d('0x44')][0x1]?_0x29d1bd[_0x3e1d('0x44')][0x1][_0x3e1d('0x45')]:undefined)||[]},{'name':_0x3e1d('0x4e'),'value':_0x29d1bd['attrFontSize']||(_0x29d1bd['attrs']&&_0x29d1bd[_0x3e1d('0x44')][0x2]?_0x29d1bd[_0x3e1d('0x44')][0x2][_0x3e1d('0x45')]:undefined)||0x14},{'name':_0x3e1d('0x52'),'value':_0x29d1bd[_0x3e1d('0x52')]||(_0x29d1bd['attrs']&&_0x29d1bd[_0x3e1d('0x44')][0x3]?_0x29d1bd[_0x3e1d('0x44')][0x3][_0x3e1d('0x45')]:undefined)||_0x3e1d('0x53')},{'name':'attrEmailAccounts','value':_0x29d1bd[_0x3e1d('0x54')]||(_0x29d1bd[_0x3e1d('0x44')]&&_0x29d1bd['attrs'][0x4]?_0x29d1bd[_0x3e1d('0x44')][0x4][_0x3e1d('0x45')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x29d1bd[_0x3e1d('0x55')]||(_0x29d1bd[_0x3e1d('0x44')]&&_0x29d1bd[_0x3e1d('0x44')][0x5]?_0x29d1bd[_0x3e1d('0x44')][0x5][_0x3e1d('0x45')]:undefined)||''},{'name':_0x3e1d('0x56'),'value':_0x29d1bd[_0x3e1d('0x56')]||(_0x29d1bd[_0x3e1d('0x44')]&&_0x29d1bd[_0x3e1d('0x44')][0x6]?_0x29d1bd[_0x3e1d('0x44')][0x6][_0x3e1d('0x45')]:undefined)||''},{'name':_0x3e1d('0x57'),'value':_0x29d1bd[_0x3e1d('0x57')]||(_0x29d1bd['attrs']&&_0x29d1bd['attrs'][0x7]?_0x29d1bd[_0x3e1d('0x44')][0x7]['value']:undefined)||''},{'name':_0x3e1d('0x58'),'value':_0x29d1bd[_0x3e1d('0x58')]||(_0x29d1bd[_0x3e1d('0x44')]&&_0x29d1bd[_0x3e1d('0x44')][0x8]?_0x29d1bd[_0x3e1d('0x44')][0x8][_0x3e1d('0x45')]:undefined)||''},{'name':'attrChatWebsites','value':_0x29d1bd[_0x3e1d('0x59')]||(_0x29d1bd[_0x3e1d('0x44')]&&_0x29d1bd[_0x3e1d('0x44')][0x9]?_0x29d1bd['attrs'][0x9][_0x3e1d('0x45')]:undefined)||''}];case _0x3e1d('0x5a'):case _0x3e1d('0x5b'):return[{'name':_0x3e1d('0x5c'),'value':_0x29d1bd[_0x3e1d('0x5c')]||(_0x29d1bd['attrs']&&_0x29d1bd[_0x3e1d('0x44')][0x0]?_0x29d1bd[_0x3e1d('0x44')][0x0][_0x3e1d('0x45')]:undefined)||_0x3e1d('0x5d')},{'name':_0x3e1d('0x5e'),'value':_0x29d1bd[_0x3e1d('0x5e')]||(_0x29d1bd[_0x3e1d('0x44')]&&_0x29d1bd[_0x3e1d('0x44')][0x1]?_0x29d1bd[_0x3e1d('0x44')][0x1][_0x3e1d('0x45')]:undefined)||null},{'name':_0x3e1d('0x5f'),'value':_0x29d1bd[_0x3e1d('0x5f')]||(_0x29d1bd[_0x3e1d('0x44')]&&_0x29d1bd['attrs'][0x2]?_0x29d1bd[_0x3e1d('0x44')][0x2][_0x3e1d('0x45')]:undefined)||null},{'name':_0x3e1d('0x51'),'value':_0x29d1bd[_0x3e1d('0x51')]||(_0x29d1bd[_0x3e1d('0x44')]&&_0x29d1bd[_0x3e1d('0x44')][0x3]?_0x29d1bd[_0x3e1d('0x44')][0x3][_0x3e1d('0x45')]:undefined)||[]},{'name':_0x3e1d('0x52'),'value':_0x29d1bd[_0x3e1d('0x52')]||(_0x29d1bd['attrs']&&_0x29d1bd['attrs'][0x4]?_0x29d1bd[_0x3e1d('0x44')][0x4][_0x3e1d('0x45')]:undefined)||'voice'},{'name':_0x3e1d('0x54'),'value':_0x29d1bd[_0x3e1d('0x54')]||(_0x29d1bd[_0x3e1d('0x44')]&&_0x29d1bd[_0x3e1d('0x44')][0x5]?_0x29d1bd['attrs'][0x5][_0x3e1d('0x45')]:undefined)||''},{'name':_0x3e1d('0x55'),'value':_0x29d1bd[_0x3e1d('0x55')]||(_0x29d1bd[_0x3e1d('0x44')]&&_0x29d1bd[_0x3e1d('0x44')][0x6]?_0x29d1bd[_0x3e1d('0x44')][0x6][_0x3e1d('0x45')]:undefined)||''},{'name':_0x3e1d('0x56'),'value':_0x29d1bd['attrSmsAccounts']||(_0x29d1bd[_0x3e1d('0x44')]&&_0x29d1bd[_0x3e1d('0x44')][0x7]?_0x29d1bd[_0x3e1d('0x44')][0x7][_0x3e1d('0x45')]:undefined)||''},{'name':_0x3e1d('0x57'),'value':_0x29d1bd[_0x3e1d('0x57')]||(_0x29d1bd[_0x3e1d('0x44')]&&_0x29d1bd[_0x3e1d('0x44')][0x8]?_0x29d1bd['attrs'][0x8][_0x3e1d('0x45')]:undefined)||''},{'name':_0x3e1d('0x58'),'value':_0x29d1bd[_0x3e1d('0x58')]||(_0x29d1bd[_0x3e1d('0x44')]&&_0x29d1bd[_0x3e1d('0x44')][0x9]?_0x29d1bd[_0x3e1d('0x44')][0x9]['value']:undefined)||''},{'name':_0x3e1d('0x59'),'value':_0x29d1bd['attrChatWebsites']||(_0x29d1bd['attrs']&&_0x29d1bd['attrs'][0xa]?_0x29d1bd[_0x3e1d('0x44')][0xa]['value']:undefined)||''}];case _0x3e1d('0x60'):return[{'name':_0x3e1d('0x61'),'type':_0x29d1bd[_0x3e1d('0x62')]||(_0x29d1bd[_0x3e1d('0x44')]&&_0x29d1bd[_0x3e1d('0x44')][0x0]?_0x29d1bd['attrs'][0x0][_0x3e1d('0x63')]:undefined)||null,'value':_0x29d1bd['attrReport']||(_0x29d1bd[_0x3e1d('0x44')]&&_0x29d1bd[_0x3e1d('0x44')][0x0]?_0x29d1bd[_0x3e1d('0x44')][0x0][_0x3e1d('0x45')]:undefined)||null},{'name':_0x3e1d('0x64'),'value':_0x29d1bd[_0x3e1d('0x64')]||(_0x29d1bd['attrs']&&_0x29d1bd['attrs'][0x1]?_0x29d1bd[_0x3e1d('0x44')][0x1][_0x3e1d('0x45')]:undefined)||0x0}];default:return[];}}catch(_0xf74b9f){logger[_0x3e1d('0x65')]('widgetAttributes:\x20%s',JSON[_0x3e1d('0x66')](_0xf74b9f));return[];}}exports['create']=function(_0x24b47c,_0x224c6f){if(_0x24b47c['body']){_0x24b47c['body'][_0x3e1d('0x44')]=widgetAttributes(_0x24b47c[_0x3e1d('0x67')]);}return db[_0x3e1d('0x43')][_0x3e1d('0x68')](_0x24b47c['body'],{})[_0x3e1d('0x2f')](respondWithResult(_0x224c6f,0xc9))[_0x3e1d('0x41')](handleError(_0x224c6f,null));};exports[_0x3e1d('0x2e')]=function(_0x1dc1f8,_0xb07d51){if(_0x1dc1f8['body']['id']){delete _0x1dc1f8[_0x3e1d('0x67')]['id'];}_0x1dc1f8['body'][_0x3e1d('0x44')]=widgetAttributes(_0x1dc1f8['body']);return db[_0x3e1d('0x43')][_0x3e1d('0x40')]({'where':{'id':_0x1dc1f8[_0x3e1d('0x33')]['id']}})[_0x3e1d('0x2f')](handleEntityNotFound(_0xb07d51,null))[_0x3e1d('0x2f')](saveUpdates(_0x1dc1f8[_0x3e1d('0x67')],null))[_0x3e1d('0x2f')](respondWithResult(_0xb07d51,null))[_0x3e1d('0x41')](handleError(_0xb07d51,null));};
\ No newline at end of file
+var _0x2975=['apply','reject','save','update','then','error','stack','name','send','show','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','options','find','catch','destroy','params','type','attrUrl','attrs','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','value','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range'];(function(_0x235b8d,_0x56ec99){var _0x310340=function(_0x55d6fe){while(--_0x55d6fe){_0x235b8d['push'](_0x235b8d['shift']());}};_0x310340(++_0x56ec99);}(_0x2975,0x1c5));var _0x5297=function(_0x348015,_0x1a9b69){_0x348015=_0x348015-0x0;var _0x2c9307=_0x2975[_0x348015];return _0x2c9307;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5297('0x0'));var zipdir=require(_0x5297('0x1'));var jsonpatch=require(_0x5297('0x2'));var rp=require(_0x5297('0x3'));var moment=require(_0x5297('0x4'));var BPromise=require(_0x5297('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x5297('0x6'));var csv=require(_0x5297('0x7'));var ejs=require(_0x5297('0x8'));var fs=require('fs');var fs_extra=require(_0x5297('0x9'));var _=require(_0x5297('0xa'));var squel=require(_0x5297('0xb'));var crypto=require(_0x5297('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5297('0xd'));var toCsv=require(_0x5297('0x7'));var querystring=require(_0x5297('0xe'));var Papa=require(_0x5297('0xf'));var Redis=require(_0x5297('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5297('0x11'));var as=require(_0x5297('0x12'));var hardwareService=require(_0x5297('0x13'));var logger=require('../../config/logger')(_0x5297('0x14'));var utils=require(_0x5297('0x15'));var config=require(_0x5297('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5297('0x17'))['db'];config[_0x5297('0x18')]=_['defaults'](config['redis'],{'host':_0x5297('0x19'),'port':0x18eb});var socket=require(_0x5297('0x1a'))(new Redis(config['redis']));require(_0x5297('0x1b'))['register'](socket);function respondWithStatusCode(_0x253b83,_0x2af382){_0x2af382=_0x2af382||0xcc;return function(_0x4fbe4d){if(_0x4fbe4d){return _0x253b83[_0x5297('0x1c')](_0x2af382);}return _0x253b83[_0x5297('0x1d')](_0x2af382)[_0x5297('0x1e')]();};}function respondWithResult(_0x40afca,_0x1343dd){_0x1343dd=_0x1343dd||0xc8;return function(_0x36bc09){if(_0x36bc09){return _0x40afca[_0x5297('0x1d')](_0x1343dd)[_0x5297('0x1f')](_0x36bc09);}};}function respondWithFilteredResult(_0x4ae2fe,_0x23474a){return function(_0x136461){if(_0x136461){var _0x36f890=typeof _0x23474a[_0x5297('0x20')]==='undefined'&&typeof _0x23474a[_0x5297('0x21')]===_0x5297('0x22');var _0x52286c=_0x136461[_0x5297('0x23')];var _0x4d8316=_0x36f890?0x0:_0x23474a[_0x5297('0x20')];var _0x3c0523=_0x36f890?_0x136461[_0x5297('0x23')]:_0x23474a[_0x5297('0x20')]+_0x23474a['limit'];var _0x43e00e;if(_0x3c0523>=_0x52286c){_0x3c0523=_0x52286c;_0x43e00e=0xc8;}else{_0x43e00e=0xce;}_0x4ae2fe[_0x5297('0x1d')](_0x43e00e);return _0x4ae2fe['set'](_0x5297('0x24'),_0x4d8316+'-'+_0x3c0523+'/'+_0x52286c)[_0x5297('0x1f')](_0x136461);}return null;};}function patchUpdates(_0x56fffa){return function(_0x2d8ba1){try{jsonpatch[_0x5297('0x25')](_0x2d8ba1,_0x56fffa,!![]);}catch(_0x574899){return BPromise[_0x5297('0x26')](_0x574899);}return _0x2d8ba1[_0x5297('0x27')]();};}function saveUpdates(_0x2c0f01,_0x5cc9bf){return function(_0x47a1b7){if(_0x47a1b7){return _0x47a1b7[_0x5297('0x28')](_0x2c0f01)[_0x5297('0x29')](function(_0x18fe2a){return _0x18fe2a;});}return null;};}function removeEntity(_0x4e1300,_0x2ca4cc){return function(_0x5ab8ee){if(_0x5ab8ee){return _0x5ab8ee['destroy']()[_0x5297('0x29')](function(){_0x4e1300[_0x5297('0x1d')](0xcc)[_0x5297('0x1e')]();});}};}function handleEntityNotFound(_0xe6241d,_0x4e00cf){return function(_0x77b1dc){if(!_0x77b1dc){_0xe6241d[_0x5297('0x1c')](0x194);}return _0x77b1dc;};}function handleError(_0x2775f4,_0xee5f9c){_0xee5f9c=_0xee5f9c||0x1f4;return function(_0x3826d2){logger[_0x5297('0x2a')](_0x3826d2[_0x5297('0x2b')]);if(_0x3826d2[_0x5297('0x2c')]){delete _0x3826d2[_0x5297('0x2c')];}_0x2775f4['status'](_0xee5f9c)[_0x5297('0x2d')](_0x3826d2);};}exports[_0x5297('0x2e')]=function(_0xa8fd08,_0x505469){var _0x3400d5={'raw':![],'where':{'id':_0xa8fd08['params']['id']}},_0x28009f={};_0x28009f[_0x5297('0x2f')]=_[_0x5297('0x30')](db[_0x5297('0x31')][_0x5297('0x32')]);_0x28009f[_0x5297('0x33')]=_['keys'](_0xa8fd08[_0x5297('0x33')]);_0x28009f[_0x5297('0x34')]=_[_0x5297('0x35')](_0x28009f[_0x5297('0x2f')],_0x28009f['query']);_0x3400d5[_0x5297('0x36')]=_['intersection'](_0x28009f[_0x5297('0x2f')],qs[_0x5297('0x37')](_0xa8fd08['query'][_0x5297('0x37')]));_0x3400d5[_0x5297('0x36')]=_0x3400d5[_0x5297('0x36')][_0x5297('0x38')]?_0x3400d5['attributes']:_0x28009f[_0x5297('0x2f')];if(_0xa8fd08[_0x5297('0x33')][_0x5297('0x39')]){_0x3400d5[_0x5297('0x3a')]=[{'all':!![]}];}_0x3400d5=_['merge']({},_0x3400d5,_0xa8fd08[_0x5297('0x3b')]);return db[_0x5297('0x31')][_0x5297('0x3c')](_0x3400d5)[_0x5297('0x29')](handleEntityNotFound(_0x505469,null))[_0x5297('0x29')](respondWithResult(_0x505469,null))[_0x5297('0x3d')](handleError(_0x505469,null));};exports[_0x5297('0x3e')]=function(_0x171ffb,_0x209c21){return db[_0x5297('0x31')]['find']({'where':{'id':_0x171ffb[_0x5297('0x3f')]['id']}})[_0x5297('0x29')](handleEntityNotFound(_0x209c21,null))[_0x5297('0x29')](removeEntity(_0x209c21,null))[_0x5297('0x3d')](handleError(_0x209c21,null));};function widgetAttributes(_0x2d564c){try{switch(_0x2d564c[_0x5297('0x40')]){case'iframe':return[{'name':_0x5297('0x41'),'value':_0x2d564c['attrUrl']||(_0x2d564c[_0x5297('0x42')]&&_0x2d564c[_0x5297('0x42')][0x0]?_0x2d564c[_0x5297('0x42')][0x0]['value']:undefined)||'https://'}];case _0x5297('0x43'):return[{'name':_0x5297('0x44'),'value':_0x2d564c[_0x5297('0x44')]||(_0x2d564c['attrs']&&_0x2d564c[_0x5297('0x42')][0x0]?_0x2d564c['attrs'][0x0]['value']:undefined)||''}];case _0x5297('0x45'):return[{'name':_0x5297('0x46'),'value':_0x2d564c[_0x5297('0x46')]||(_0x2d564c[_0x5297('0x42')]&&_0x2d564c[_0x5297('0x42')][0x0]?_0x2d564c[_0x5297('0x42')][0x0]['value']:undefined)||_0x5297('0x47')},{'name':_0x5297('0x48'),'value':_0x2d564c[_0x5297('0x48')]||(_0x2d564c[_0x5297('0x42')]&&_0x2d564c[_0x5297('0x42')][0x1]?_0x2d564c[_0x5297('0x42')][0x1]['value']:undefined)||'0.00'},{'name':_0x5297('0x49'),'value':_0x2d564c[_0x5297('0x49')]||(_0x2d564c['attrs']&&_0x2d564c['attrs'][0x2]?_0x2d564c[_0x5297('0x42')][0x2][_0x5297('0x4a')]:undefined)||0xc}];case'counter':return[{'name':_0x5297('0x4b'),'value':_0x2d564c['attrMetric']||(_0x2d564c[_0x5297('0x42')]&&_0x2d564c[_0x5297('0x42')][0x0]?_0x2d564c[_0x5297('0x42')][0x0]['value']:undefined)||_0x5297('0x4c')},{'name':_0x5297('0x4d'),'value':_0x2d564c[_0x5297('0x4d')]||(_0x2d564c[_0x5297('0x42')]&&_0x2d564c['attrs'][0x1]?_0x2d564c[_0x5297('0x42')][0x1][_0x5297('0x4a')]:undefined)||[]},{'name':_0x5297('0x49'),'value':_0x2d564c[_0x5297('0x49')]||(_0x2d564c[_0x5297('0x42')]&&_0x2d564c[_0x5297('0x42')][0x2]?_0x2d564c[_0x5297('0x42')][0x2]['value']:undefined)||0x14},{'name':_0x5297('0x4e'),'value':_0x2d564c['attrChannel']||(_0x2d564c[_0x5297('0x42')]&&_0x2d564c['attrs'][0x3]?_0x2d564c['attrs'][0x3][_0x5297('0x4a')]:undefined)||_0x5297('0x4f')},{'name':'attrEmailAccounts','value':_0x2d564c[_0x5297('0x50')]||(_0x2d564c[_0x5297('0x42')]&&_0x2d564c[_0x5297('0x42')][0x4]?_0x2d564c[_0x5297('0x42')][0x4][_0x5297('0x4a')]:undefined)||''},{'name':_0x5297('0x51'),'value':_0x2d564c['attrFaxAccounts']||(_0x2d564c[_0x5297('0x42')]&&_0x2d564c[_0x5297('0x42')][0x5]?_0x2d564c['attrs'][0x5][_0x5297('0x4a')]:undefined)||''},{'name':_0x5297('0x52'),'value':_0x2d564c[_0x5297('0x52')]||(_0x2d564c[_0x5297('0x42')]&&_0x2d564c['attrs'][0x6]?_0x2d564c[_0x5297('0x42')][0x6][_0x5297('0x4a')]:undefined)||''},{'name':_0x5297('0x53'),'value':_0x2d564c[_0x5297('0x53')]||(_0x2d564c['attrs']&&_0x2d564c[_0x5297('0x42')][0x7]?_0x2d564c[_0x5297('0x42')][0x7][_0x5297('0x4a')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x2d564c[_0x5297('0x54')]||(_0x2d564c[_0x5297('0x42')]&&_0x2d564c[_0x5297('0x42')][0x8]?_0x2d564c[_0x5297('0x42')][0x8][_0x5297('0x4a')]:undefined)||''},{'name':'attrChatWebsites','value':_0x2d564c[_0x5297('0x55')]||(_0x2d564c[_0x5297('0x42')]&&_0x2d564c[_0x5297('0x42')][0x9]?_0x2d564c[_0x5297('0x42')][0x9][_0x5297('0x4a')]:undefined)||''}];case _0x5297('0x56'):case _0x5297('0x57'):return[{'name':_0x5297('0x58'),'value':_0x2d564c['attrSerie1']||(_0x2d564c[_0x5297('0x42')]&&_0x2d564c[_0x5297('0x42')][0x0]?_0x2d564c[_0x5297('0x42')][0x0][_0x5297('0x4a')]:undefined)||_0x5297('0x4c')},{'name':_0x5297('0x59'),'value':_0x2d564c['attrSerie2']||(_0x2d564c['attrs']&&_0x2d564c[_0x5297('0x42')][0x1]?_0x2d564c[_0x5297('0x42')][0x1][_0x5297('0x4a')]:undefined)||null},{'name':_0x5297('0x5a'),'value':_0x2d564c['attrSerie3']||(_0x2d564c[_0x5297('0x42')]&&_0x2d564c[_0x5297('0x42')][0x2]?_0x2d564c[_0x5297('0x42')][0x2][_0x5297('0x4a')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x2d564c[_0x5297('0x4d')]||(_0x2d564c['attrs']&&_0x2d564c[_0x5297('0x42')][0x3]?_0x2d564c[_0x5297('0x42')][0x3][_0x5297('0x4a')]:undefined)||[]},{'name':_0x5297('0x4e'),'value':_0x2d564c[_0x5297('0x4e')]||(_0x2d564c[_0x5297('0x42')]&&_0x2d564c[_0x5297('0x42')][0x4]?_0x2d564c['attrs'][0x4][_0x5297('0x4a')]:undefined)||_0x5297('0x4f')},{'name':'attrEmailAccounts','value':_0x2d564c[_0x5297('0x50')]||(_0x2d564c['attrs']&&_0x2d564c[_0x5297('0x42')][0x5]?_0x2d564c['attrs'][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x2d564c[_0x5297('0x51')]||(_0x2d564c[_0x5297('0x42')]&&_0x2d564c[_0x5297('0x42')][0x6]?_0x2d564c['attrs'][0x6][_0x5297('0x4a')]:undefined)||''},{'name':_0x5297('0x52'),'value':_0x2d564c[_0x5297('0x52')]||(_0x2d564c['attrs']&&_0x2d564c[_0x5297('0x42')][0x7]?_0x2d564c['attrs'][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x2d564c['attrOpenchannelAccounts']||(_0x2d564c[_0x5297('0x42')]&&_0x2d564c[_0x5297('0x42')][0x8]?_0x2d564c[_0x5297('0x42')][0x8][_0x5297('0x4a')]:undefined)||''},{'name':_0x5297('0x54'),'value':_0x2d564c[_0x5297('0x54')]||(_0x2d564c[_0x5297('0x42')]&&_0x2d564c[_0x5297('0x42')][0x9]?_0x2d564c['attrs'][0x9][_0x5297('0x4a')]:undefined)||''},{'name':'attrChatWebsites','value':_0x2d564c[_0x5297('0x55')]||(_0x2d564c[_0x5297('0x42')]&&_0x2d564c[_0x5297('0x42')][0xa]?_0x2d564c['attrs'][0xa][_0x5297('0x4a')]:undefined)||''}];case _0x5297('0x5b'):return[{'name':_0x5297('0x5c'),'type':_0x2d564c['reportType']||(_0x2d564c[_0x5297('0x42')]&&_0x2d564c[_0x5297('0x42')][0x0]?_0x2d564c[_0x5297('0x42')][0x0][_0x5297('0x40')]:undefined)||null,'value':_0x2d564c['attrReport']||(_0x2d564c['attrs']&&_0x2d564c['attrs'][0x0]?_0x2d564c['attrs'][0x0]['value']:undefined)||null},{'name':_0x5297('0x5d'),'value':_0x2d564c[_0x5297('0x5d')]||(_0x2d564c[_0x5297('0x42')]&&_0x2d564c[_0x5297('0x42')][0x1]?_0x2d564c[_0x5297('0x42')][0x1][_0x5297('0x4a')]:undefined)||0x0}];default:return[];}}catch(_0x1066cb){logger['error'](_0x5297('0x5e'),JSON[_0x5297('0x5f')](_0x1066cb));return[];}}exports[_0x5297('0x60')]=function(_0x2396e0,_0x48cfd5){if(_0x2396e0[_0x5297('0x61')]){_0x2396e0[_0x5297('0x61')][_0x5297('0x42')]=widgetAttributes(_0x2396e0[_0x5297('0x61')]);}return db[_0x5297('0x31')][_0x5297('0x60')](_0x2396e0[_0x5297('0x61')],{})[_0x5297('0x29')](respondWithResult(_0x48cfd5,0xc9))['catch'](handleError(_0x48cfd5,null));};exports['update']=function(_0x4b0892,_0x2187bf){if(_0x4b0892[_0x5297('0x61')]['id']){delete _0x4b0892[_0x5297('0x61')]['id'];}_0x4b0892[_0x5297('0x61')][_0x5297('0x42')]=widgetAttributes(_0x4b0892[_0x5297('0x61')]);return db[_0x5297('0x31')][_0x5297('0x3c')]({'where':{'id':_0x4b0892[_0x5297('0x3f')]['id']}})[_0x5297('0x29')](handleEntityNotFound(_0x2187bf,null))['then'](saveUpdates(_0x4b0892[_0x5297('0x61')],null))[_0x5297('0x29')](respondWithResult(_0x2187bf,null))['catch'](handleError(_0x2187bf,null));};
\ No newline at end of file
index fadc3e0..92b03ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8f0=['update','emit','hasOwnProperty','hook','exports','DashboardItem','setMaxListeners','save'];(function(_0x2c1d7f,_0x37a866){var _0x1645ec=function(_0x5c0133){while(--_0x5c0133){_0x2c1d7f['push'](_0x2c1d7f['shift']());}};_0x1645ec(++_0x37a866);}(_0xb8f0,0x6d));var _0x0b8f=function(_0x578226,_0x1e1038){_0x578226=_0x578226-0x0;var _0x8e8833=_0xb8f0[_0x578226];return _0x8e8833;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db'][_0x0b8f('0x0')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x0b8f('0x1')](0x0);var events={'afterCreate':_0x0b8f('0x2'),'afterUpdate':_0x0b8f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4d3c12){return function(_0x537fec,_0x4ef3a9,_0x42d10c){DashboardItemEvents[_0x0b8f('0x4')](_0x4d3c12+':'+_0x537fec['id'],_0x537fec);DashboardItemEvents['emit'](_0x4d3c12,_0x537fec);_0x42d10c(null);};}for(var e in events){if(events[_0x0b8f('0x5')](e)){var event=events[e];DashboardItem[_0x0b8f('0x6')](e,emitEvent(event));}}module[_0x0b8f('0x7')]=DashboardItemEvents;
\ No newline at end of file
+var _0xbb30=['hook','events','../../mysqldb','DashboardItem','update','emit','hasOwnProperty'];(function(_0x52c637,_0x22347a){var _0x1e84eb=function(_0xd6b842){while(--_0xd6b842){_0x52c637['push'](_0x52c637['shift']());}};_0x1e84eb(++_0x22347a);}(_0xbb30,0x1f2));var _0x0bb3=function(_0xf71b61,_0x218f11){_0xf71b61=_0xf71b61-0x0;var _0x1b9b5d=_0xbb30[_0xf71b61];return _0x1b9b5d;};'use strict';var EventEmitter=require(_0x0bb3('0x0'));var DashboardItem=require(_0x0bb3('0x1'))['db'][_0x0bb3('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0bb3('0x3'),'afterDestroy':'remove'};function emitEvent(_0xc5ce01){return function(_0x4fbc8f,_0x4112bd,_0x1d266a){DashboardItemEvents['emit'](_0xc5ce01+':'+_0x4fbc8f['id'],_0x4fbc8f);DashboardItemEvents[_0x0bb3('0x4')](_0xc5ce01,_0x4fbc8f);_0x1d266a(null);};}for(var e in events){if(events[_0x0bb3('0x5')](e)){var event=events[e];DashboardItem[_0x0bb3('0x6')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;
\ No newline at end of file
index 45aa854..510da56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec60=['../../config/logger','api','moment','bluebird','path','rimraf','./dashboardItem.attributes','define','DashboardItem','dashboard_items','lodash','util'];(function(_0x23db35,_0xfa66d5){var _0xfc84ed=function(_0x565ac8){while(--_0x565ac8){_0x23db35['push'](_0x23db35['shift']());}};_0xfc84ed(++_0xfa66d5);}(_0xec60,0x1de));var _0x0ec6=function(_0x354a09,_0x14a179){_0x354a09=_0x354a09-0x0;var _0x1fd034=_0xec60[_0x354a09];return _0x1fd034;};'use strict';var _=require(_0x0ec6('0x0'));var util=require(_0x0ec6('0x1'));var logger=require(_0x0ec6('0x2'))(_0x0ec6('0x3'));var moment=require(_0x0ec6('0x4'));var BPromise=require(_0x0ec6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ec6('0x6'));var rimraf=require(_0x0ec6('0x7'));var config=require('../../config/environment');var attributes=require(_0x0ec6('0x8'));module['exports']=function(_0x57d5d4,_0x539009){return _0x57d5d4[_0x0ec6('0x9')](_0x0ec6('0xa'),attributes,{'tableName':_0x0ec6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5989=['moment','bluebird','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','util','../../config/logger'];(function(_0xba572f,_0x2dc6b7){var _0xb09d51=function(_0x23371e){while(--_0x23371e){_0xba572f['push'](_0xba572f['shift']());}};_0xb09d51(++_0x2dc6b7);}(_0x5989,0x1ae));var _0x9598=function(_0x2fec78,_0x3071c2){_0x2fec78=_0x2fec78-0x0;var _0x18dff4=_0x5989[_0x2fec78];return _0x18dff4;};'use strict';var _=require('lodash');var util=require(_0x9598('0x0'));var logger=require(_0x9598('0x1'))('api');var moment=require(_0x9598('0x2'));var BPromise=require(_0x9598('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9598('0x4'));var rimraf=require(_0x9598('0x5'));var config=require(_0x9598('0x6'));var attributes=require(_0x9598('0x7'));module[_0x9598('0x8')]=function(_0x50087e,_0x2cabbb){return _0x50087e[_0x9598('0x9')](_0x9598('0xa'),attributes,{'tableName':_0x9598('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a35b7ae..58e66f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c56=['socket.io-emitter','./dashboardItem.socket','register','request','then','info','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8c56,0x195));var _0x68c5=function(_0x358fd3,_0x4a9c44){_0x358fd3=_0x358fd3-0x0;var _0x1ad0f3=_0x8c56[_0x358fd3];return _0x1ad0f3;};'use strict';var _=require(_0x68c5('0x0'));var util=require(_0x68c5('0x1'));var moment=require(_0x68c5('0x2'));var BPromise=require(_0x68c5('0x3'));var rs=require(_0x68c5('0x4'));var fs=require('fs');var Redis=require(_0x68c5('0x5'));var db=require(_0x68c5('0x6'))['db'];var utils=require(_0x68c5('0x7'));var logger=require(_0x68c5('0x8'))(_0x68c5('0x9'));var config=require('../../config/environment');var jayson=require(_0x68c5('0xa'));var client=jayson[_0x68c5('0xb')]['http']({'port':0x232a});config[_0x68c5('0xc')]=_[_0x68c5('0xd')](config[_0x68c5('0xc')],{'host':_0x68c5('0xe'),'port':0x18eb});var socket=require(_0x68c5('0xf'))(new Redis(config[_0x68c5('0xc')]));require(_0x68c5('0x10'))[_0x68c5('0x11')](socket);function respondWithRpcPromise(_0x413d26,_0x8858d0,_0x585b79){return new BPromise(function(_0x474e87,_0x50ee63){return client[_0x68c5('0x12')](_0x413d26,_0x585b79)[_0x68c5('0x13')](function(_0x4f473c){logger[_0x68c5('0x14')]('DashboardItem,\x20%s,\x20%s',_0x8858d0,_0x68c5('0x15'));logger[_0x68c5('0x16')](_0x68c5('0x17'),_0x8858d0,_0x68c5('0x15'),JSON[_0x68c5('0x18')](_0x4f473c));if(_0x4f473c[_0x68c5('0x19')]){if(_0x4f473c[_0x68c5('0x19')][_0x68c5('0x1a')]===0x1f4){logger[_0x68c5('0x19')](_0x68c5('0x1b'),_0x8858d0,_0x4f473c[_0x68c5('0x19')][_0x68c5('0x1c')]);return _0x50ee63(_0x4f473c[_0x68c5('0x19')][_0x68c5('0x1c')]);}logger[_0x68c5('0x19')](_0x68c5('0x1b'),_0x8858d0,_0x4f473c[_0x68c5('0x19')][_0x68c5('0x1c')]);return _0x474e87(_0x4f473c[_0x68c5('0x19')][_0x68c5('0x1c')]);}else{logger[_0x68c5('0x14')]('DashboardItem,\x20%s,\x20%s',_0x8858d0,_0x68c5('0x15'));_0x474e87(_0x4f473c['result'][_0x68c5('0x1c')]);}})[_0x68c5('0x1d')](function(_0xfd1e73){logger[_0x68c5('0x19')](_0x68c5('0x1b'),_0x8858d0,_0xfd1e73);_0x50ee63(_0xfd1e73);});});}
\ No newline at end of file
+var _0x54af=['request','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x54af,0x15b));var _0xf54a=function(_0x9e8102,_0x344be9){_0x9e8102=_0x9e8102-0x0;var _0x442f1e=_0x54af[_0x9e8102];return _0x442f1e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf54a('0x0'));var BPromise=require(_0xf54a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf54a('0x2'))['db'];var utils=require(_0xf54a('0x3'));var logger=require(_0xf54a('0x4'))(_0xf54a('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf54a('0x6')]({'port':0x232a});config[_0xf54a('0x7')]=_[_0xf54a('0x8')](config['redis'],{'host':_0xf54a('0x9'),'port':0x18eb});var socket=require(_0xf54a('0xa'))(new Redis(config[_0xf54a('0x7')]));require(_0xf54a('0xb'))[_0xf54a('0xc')](socket);function respondWithRpcPromise(_0x56bc70,_0x2561c4,_0x1f7811){return new BPromise(function(_0x447f36,_0x38c050){return client[_0xf54a('0xd')](_0x56bc70,_0x1f7811)['then'](function(_0x336ed5){logger[_0xf54a('0xe')](_0xf54a('0xf'),_0x2561c4,'request\x20sent');logger[_0xf54a('0x10')](_0xf54a('0x11'),_0x2561c4,_0xf54a('0x12'),JSON['stringify'](_0x336ed5));if(_0x336ed5[_0xf54a('0x13')]){if(_0x336ed5[_0xf54a('0x13')][_0xf54a('0x14')]===0x1f4){logger[_0xf54a('0x13')](_0xf54a('0xf'),_0x2561c4,_0x336ed5[_0xf54a('0x13')][_0xf54a('0x15')]);return _0x38c050(_0x336ed5[_0xf54a('0x13')]['message']);}logger[_0xf54a('0x13')](_0xf54a('0xf'),_0x2561c4,_0x336ed5['error'][_0xf54a('0x15')]);return _0x447f36(_0x336ed5[_0xf54a('0x13')][_0xf54a('0x15')]);}else{logger[_0xf54a('0xe')]('DashboardItem,\x20%s,\x20%s',_0x2561c4,_0xf54a('0x12'));_0x447f36(_0x336ed5[_0xf54a('0x16')]['message']);}})[_0xf54a('0x17')](function(_0x31c9e5){logger[_0xf54a('0x13')](_0xf54a('0xf'),_0x2561c4,_0x31c9e5);_0x38c050(_0x31c9e5);});});}
\ No newline at end of file
index 285ca96..787a29b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2698=['save','remove','emit','removeListener','register','length','./dashboardItem.events'];(function(_0x4e9fed,_0x19f4f3){var _0x5c8cc0=function(_0x36116c){while(--_0x36116c){_0x4e9fed['push'](_0x4e9fed['shift']());}};_0x5c8cc0(++_0x19f4f3);}(_0x2698,0x15d));var _0x8269=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2698[_0x3dd15e];return _0x231fd0;};'use strict';var DashboardItemEvents=require(_0x8269('0x0'));var events=[_0x8269('0x1'),_0x8269('0x2'),'update'];function createListener(_0x1c98cc,_0x1c1182){return function(_0x373dc7){_0x1c1182[_0x8269('0x3')](_0x1c98cc,_0x373dc7);};}function removeListener(_0x2dc7d0,_0x1f0f03){return function(){DashboardItemEvents[_0x8269('0x4')](_0x2dc7d0,_0x1f0f03);};}exports[_0x8269('0x5')]=function(_0x507103){for(var _0x46f3cb=0x0,_0x29586d=events[_0x8269('0x6')];_0x46f3cb<_0x29586d;_0x46f3cb++){var _0xe66f7d=events[_0x46f3cb];var _0x31ce4d=createListener('dashboardItem:'+_0xe66f7d,_0x507103);DashboardItemEvents['on'](_0xe66f7d,_0x31ce4d);}};
\ No newline at end of file
+var _0x0a2f=['save','remove','emit','removeListener','register','length','dashboardItem:'];(function(_0x2c133e,_0x46a636){var _0x2dabf7=function(_0x192b7b){while(--_0x192b7b){_0x2c133e['push'](_0x2c133e['shift']());}};_0x2dabf7(++_0x46a636);}(_0x0a2f,0x16c));var _0xf0a2=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x0a2f[_0x49d41c];return _0xb64c5f;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0xf0a2('0x0'),_0xf0a2('0x1'),'update'];function createListener(_0x2d99b3,_0x4eb8c3){return function(_0x724d8b){_0x4eb8c3[_0xf0a2('0x2')](_0x2d99b3,_0x724d8b);};}function removeListener(_0xb280f,_0x244f6f){return function(){DashboardItemEvents[_0xf0a2('0x3')](_0xb280f,_0x244f6f);};}exports[_0xf0a2('0x4')]=function(_0x195a84){for(var _0x4f6963=0x0,_0x144119=events[_0xf0a2('0x5')];_0x4f6963<_0x144119;_0x4f6963++){var _0x44519e=events[_0x4f6963];var _0x2423a5=createListener(_0xf0a2('0x6')+_0x44519e,_0x195a84);DashboardItemEvents['on'](_0x44519e,_0x2423a5);}};
\ No newline at end of file
index 3d8c06d..075ca5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1c3=['create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','get','/:id','isAuthenticated','show'];(function(_0x434467,_0x2c6a75){var _0x5248ba=function(_0x5a3811){while(--_0x5a3811){_0x434467['push'](_0x434467['shift']());}};_0x5248ba(++_0x2c6a75);}(_0xd1c3,0xc3));var _0x3d1c=function(_0x1a254a,_0x42a97f){_0x1a254a=_0x1a254a-0x0;var _0xe0bd7b=_0xd1c3[_0x1a254a];return _0xe0bd7b;};'use strict';var multer=require(_0x3d1c('0x0'));var util=require(_0x3d1c('0x1'));var path=require(_0x3d1c('0x2'));var timeout=require(_0x3d1c('0x3'));var express=require(_0x3d1c('0x4'));var router=express[_0x3d1c('0x5')]();var fs_extra=require(_0x3d1c('0x6'));var auth=require(_0x3d1c('0x7'));var interaction=require(_0x3d1c('0x8'));var config=require('../../config/environment');var controller=require(_0x3d1c('0x9'));router[_0x3d1c('0xa')](_0x3d1c('0xb'),auth[_0x3d1c('0xc')](),controller[_0x3d1c('0xd')]);router['post']('/',auth[_0x3d1c('0xc')](),controller[_0x3d1c('0xe')]);router[_0x3d1c('0xf')](_0x3d1c('0xb'),auth[_0x3d1c('0xc')](),controller['update']);router[_0x3d1c('0x10')](_0x3d1c('0xb'),auth[_0x3d1c('0xc')](),controller[_0x3d1c('0x11')]);module[_0x3d1c('0x12')]=router;
\ No newline at end of file
+var _0x9674=['destroy','multer','util','connect-timeout','../../components/auth/service','../../config/environment','./dashboardItem.controller','/:id','post','isAuthenticated','create','put','update'];(function(_0x4d0df6,_0x4634f3){var _0x4e2615=function(_0x5285e2){while(--_0x5285e2){_0x4d0df6['push'](_0x4d0df6['shift']());}};_0x4e2615(++_0x4634f3);}(_0x9674,0x194));var _0x4967=function(_0xdaab62,_0x2728ab){_0xdaab62=_0xdaab62-0x0;var _0x13d767=_0x9674[_0xdaab62];return _0x13d767;};'use strict';var multer=require(_0x4967('0x0'));var util=require(_0x4967('0x1'));var path=require('path');var timeout=require(_0x4967('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4967('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x4967('0x4'));var controller=require(_0x4967('0x5'));router['get'](_0x4967('0x6'),auth['isAuthenticated'](),controller['show']);router[_0x4967('0x7')]('/',auth[_0x4967('0x8')](),controller[_0x4967('0x9')]);router[_0x4967('0xa')](_0x4967('0x6'),auth[_0x4967('0x8')](),controller[_0x4967('0xb')]);router['delete']('/:id',auth[_0x4967('0x8')](),controller[_0x4967('0xc')]);module['exports']=router;
\ No newline at end of file
index 29d3a9f..ed26c9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb04=['first','exports','STRING','ENUM','second','third'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xeb04,0x14b));var _0x4eb0=function(_0xde045c,_0x1ff677){_0xde045c=_0xde045c-0x0;var _0xc9a348=_0xeb04[_0xde045c];return _0xc9a348;};'use strict';var Sequelize=require('sequelize');module[_0x4eb0('0x0')]={'name':{'type':Sequelize[_0x4eb0('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x4eb0('0x2')]('first',_0x4eb0('0x3'),_0x4eb0('0x4')),'allowNull':![],'defaultValue':_0x4eb0('0x5')},'description':{'type':Sequelize[_0x4eb0('0x1')]}};
\ No newline at end of file
+var _0xf96c=['first','second','third','sequelize','exports','STRING','ENUM'];(function(_0x590a38,_0x2bc65c){var _0xf36626=function(_0x551cd1){while(--_0x551cd1){_0x590a38['push'](_0x590a38['shift']());}};_0xf36626(++_0x2bc65c);}(_0xf96c,0x16f));var _0xcf96=function(_0x4244b0,_0x484d41){_0x4244b0=_0x4244b0-0x0;var _0x1aa6a9=_0xf96c[_0x4244b0];return _0x1aa6a9;};'use strict';var Sequelize=require(_0xcf96('0x0'));module[_0xcf96('0x1')]={'name':{'type':Sequelize[_0xcf96('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xcf96('0x3')](_0xcf96('0x4'),_0xcf96('0x5'),_0xcf96('0x6')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 04e3ee1..68649e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x270a=['offset','limit','undefined','count','set','json','apply','save','update','destroy','then','get','Dispositions','UserProfileResource','stack','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','length','include','find','catch','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x270a,0xe1));var _0xa270=function(_0x3021b9,_0xdb387c){_0x3021b9=_0x3021b9-0x0;var _0xd6a1c2=_0x270a[_0x3021b9];return _0xd6a1c2;};'use strict';var emlformat=require(_0xa270('0x0'));var rimraf=require(_0xa270('0x1'));var zipdir=require(_0xa270('0x2'));var jsonpatch=require(_0xa270('0x3'));var rp=require('request-promise');var moment=require(_0xa270('0x4'));var BPromise=require(_0xa270('0x5'));var Mustache=require(_0xa270('0x6'));var util=require('util');var path=require(_0xa270('0x7'));var sox=require(_0xa270('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa270('0x9'));var _=require(_0xa270('0xa'));var squel=require(_0xa270('0xb'));var crypto=require(_0xa270('0xc'));var jsforce=require(_0xa270('0xd'));var deskjs=require(_0xa270('0xe'));var toCsv=require(_0xa270('0xf'));var querystring=require(_0xa270('0x10'));var Papa=require('papaparse');var Redis=require(_0xa270('0x11'));var authService=require(_0xa270('0x12'));var qs=require(_0xa270('0x13'));var as=require(_0xa270('0x14'));var hardwareService=require(_0xa270('0x15'));var logger=require('../../config/logger')(_0xa270('0x16'));var utils=require(_0xa270('0x17'));var config=require(_0xa270('0x18'));var licenseUtil=require(_0xa270('0x19'));var db=require(_0xa270('0x1a'))['db'];function respondWithStatusCode(_0x37e79d,_0x481e07){_0x481e07=_0x481e07||0xcc;return function(_0x52a24e){if(_0x52a24e){return _0x37e79d[_0xa270('0x1b')](_0x481e07);}return _0x37e79d[_0xa270('0x1c')](_0x481e07)[_0xa270('0x1d')]();};}function respondWithResult(_0x3e0d7b,_0x4fb6ab){_0x4fb6ab=_0x4fb6ab||0xc8;return function(_0x20720a){if(_0x20720a){return _0x3e0d7b['status'](_0x4fb6ab)['json'](_0x20720a);}};}function respondWithFilteredResult(_0x635060,_0x44a893){return function(_0xfb2131){if(_0xfb2131){var _0x19731b=typeof _0x44a893[_0xa270('0x1e')]==='undefined'&&typeof _0x44a893[_0xa270('0x1f')]===_0xa270('0x20');var _0x35852c=_0xfb2131[_0xa270('0x21')];var _0x5d26e0=_0x19731b?0x0:_0x44a893['offset'];var _0x28e8ca=_0x19731b?_0xfb2131[_0xa270('0x21')]:_0x44a893[_0xa270('0x1e')]+_0x44a893['limit'];var _0x29bd00;if(_0x28e8ca>=_0x35852c){_0x28e8ca=_0x35852c;_0x29bd00=0xc8;}else{_0x29bd00=0xce;}_0x635060[_0xa270('0x1c')](_0x29bd00);return _0x635060[_0xa270('0x22')]('Content-Range',_0x5d26e0+'-'+_0x28e8ca+'/'+_0x35852c)[_0xa270('0x23')](_0xfb2131);}return null;};}function patchUpdates(_0x13572d){return function(_0x26cb4f){try{jsonpatch[_0xa270('0x24')](_0x26cb4f,_0x13572d,!![]);}catch(_0x3fb1a5){return BPromise['reject'](_0x3fb1a5);}return _0x26cb4f[_0xa270('0x25')]();};}function saveUpdates(_0x32d515,_0xeaa63b){return function(_0x5d6e95){if(_0x5d6e95){return _0x5d6e95[_0xa270('0x26')](_0x32d515)['then'](function(_0x5e29aa){return _0x5e29aa;});}return null;};}function removeEntity(_0x593c13,_0x1a1b5c){return function(_0x1401ac){if(_0x1401ac){return _0x1401ac[_0xa270('0x27')]()[_0xa270('0x28')](function(){var _0x39433f=_0x1401ac[_0xa270('0x29')]({'plain':!![]});var _0x4d8b9d=_0xa270('0x2a');return db[_0xa270('0x2b')][_0xa270('0x27')]({'where':{'type':_0x4d8b9d,'resourceId':_0x39433f['id']}})[_0xa270('0x28')](function(){return _0x1401ac;});})[_0xa270('0x28')](function(){_0x593c13[_0xa270('0x1c')](0xcc)[_0xa270('0x1d')]();});}};}function handleEntityNotFound(_0x49d2bb,_0x9d23f1){return function(_0x3234be){if(!_0x3234be){_0x49d2bb[_0xa270('0x1b')](0x194);}return _0x3234be;};}function handleError(_0x80a10,_0x224d01){_0x224d01=_0x224d01||0x1f4;return function(_0x328fb7){logger['error'](_0x328fb7[_0xa270('0x2c')]);if(_0x328fb7[_0xa270('0x2d')]){delete _0x328fb7[_0xa270('0x2d')];}_0x80a10[_0xa270('0x1c')](_0x224d01)[_0xa270('0x2e')](_0x328fb7);};}exports[_0xa270('0x2f')]=function(_0x49c504,_0x117908){var _0x37f406={},_0x4d2dab={},_0x5a2f73={'count':0x0,'rows':[]};var _0x3c7b9b=_[_0xa270('0x30')](db[_0xa270('0x31')][_0xa270('0x32')],function(_0x3a46af){return{'name':_0x3a46af[_0xa270('0x33')],'type':_0x3a46af[_0xa270('0x34')][_0xa270('0x35')]};});_0x4d2dab['model']=_[_0xa270('0x30')](_0x3c7b9b,_0xa270('0x2d'));_0x4d2dab[_0xa270('0x36')]=_[_0xa270('0x37')](_0x49c504['query']);_0x4d2dab[_0xa270('0x38')]=_[_0xa270('0x39')](_0x4d2dab[_0xa270('0x3a')],_0x4d2dab[_0xa270('0x36')]);_0x37f406[_0xa270('0x3b')]=_[_0xa270('0x39')](_0x4d2dab['model'],qs[_0xa270('0x3c')](_0x49c504[_0xa270('0x36')][_0xa270('0x3c')]));_0x37f406[_0xa270('0x3b')]=_0x37f406[_0xa270('0x3b')]['length']?_0x37f406[_0xa270('0x3b')]:_0x4d2dab[_0xa270('0x3a')];if(!_0x49c504['query']['hasOwnProperty'](_0xa270('0x3d'))){_0x37f406[_0xa270('0x1f')]=qs[_0xa270('0x1f')](_0x49c504[_0xa270('0x36')]['limit']);_0x37f406[_0xa270('0x1e')]=qs[_0xa270('0x1e')](_0x49c504['query']['offset']);}_0x37f406[_0xa270('0x3e')]=qs[_0xa270('0x3f')](_0x49c504[_0xa270('0x36')][_0xa270('0x3f')]);_0x37f406[_0xa270('0x40')]=qs[_0xa270('0x38')](_[_0xa270('0x41')](_0x49c504[_0xa270('0x36')],_0x4d2dab[_0xa270('0x38')]),_0x3c7b9b);if(_0x49c504[_0xa270('0x36')][_0xa270('0x42')]){_0x37f406[_0xa270('0x40')]=_[_0xa270('0x43')](_0x37f406[_0xa270('0x40')],{'$or':_[_0xa270('0x30')](_0x3c7b9b,function(_0x1bc6cd){if(_0x1bc6cd[_0xa270('0x34')]!==_0xa270('0x44')){var _0x4e181e={};_0x4e181e[_0x1bc6cd['name']]={'$like':'%'+_0x49c504['query'][_0xa270('0x42')]+'%'};return _0x4e181e;}})});}_0x37f406=_[_0xa270('0x43')]({},_0x37f406,_0x49c504[_0xa270('0x45')]);var _0x1aa46a={'where':_0x37f406[_0xa270('0x40')]};return db[_0xa270('0x31')][_0xa270('0x21')](_0x1aa46a)['then'](function(_0x27ca53){_0x5a2f73[_0xa270('0x21')]=_0x27ca53;if(_0x49c504['query'][_0xa270('0x46')]){_0x37f406['include']=[{'all':!![]}];}return db[_0xa270('0x31')]['findAll'](_0x37f406);})['then'](function(_0x2ec5aa){_0x5a2f73[_0xa270('0x47')]=_0x2ec5aa;return _0x5a2f73;})[_0xa270('0x28')](respondWithFilteredResult(_0x117908,_0x37f406))['catch'](handleError(_0x117908,null));};exports[_0xa270('0x48')]=function(_0x326640,_0x309bdb){var _0x23e62c={'raw':!![],'where':{'id':_0x326640[_0xa270('0x49')]['id']}},_0x8f0401={};_0x8f0401[_0xa270('0x3a')]=_['keys'](db[_0xa270('0x31')][_0xa270('0x32')]);_0x8f0401[_0xa270('0x36')]=_[_0xa270('0x37')](_0x326640[_0xa270('0x36')]);_0x8f0401[_0xa270('0x38')]=_['intersection'](_0x8f0401['model'],_0x8f0401[_0xa270('0x36')]);_0x23e62c[_0xa270('0x3b')]=_[_0xa270('0x39')](_0x8f0401['model'],qs[_0xa270('0x3c')](_0x326640['query'][_0xa270('0x3c')]));_0x23e62c['attributes']=_0x23e62c[_0xa270('0x3b')][_0xa270('0x4a')]?_0x23e62c[_0xa270('0x3b')]:_0x8f0401[_0xa270('0x3a')];if(_0x326640[_0xa270('0x36')]['includeAll']){_0x23e62c[_0xa270('0x4b')]=[{'all':!![]}];}_0x23e62c=_[_0xa270('0x43')]({},_0x23e62c,_0x326640['options']);return db[_0xa270('0x31')][_0xa270('0x4c')](_0x23e62c)[_0xa270('0x28')](handleEntityNotFound(_0x309bdb,null))[_0xa270('0x28')](respondWithResult(_0x309bdb,null))[_0xa270('0x4d')](handleError(_0x309bdb,null));};exports[_0xa270('0x4e')]=function(_0x3c33d1,_0x18f17a){return db[_0xa270('0x31')][_0xa270('0x4e')](_0x3c33d1[_0xa270('0x4f')],{})[_0xa270('0x28')](function(_0x34b22c){var _0x5173b7=_0x3c33d1[_0xa270('0x50')]['get']({'plain':!![]});if(!_0x5173b7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5173b7['role']==='user'){var _0x56afc3=_0x34b22c[_0xa270('0x29')]({'plain':!![]});var _0x1ca948=_0xa270('0x2a');return db[_0xa270('0x51')]['find']({'where':{'name':_0x1ca948,'userProfileId':_0x5173b7[_0xa270('0x52')]},'raw':!![]})[_0xa270('0x28')](function(_0x4fdda0){if(_0x4fdda0&&_0x4fdda0[_0xa270('0x53')]===0x0){return db[_0xa270('0x2b')][_0xa270('0x4e')]({'name':_0x56afc3[_0xa270('0x2d')],'resourceId':_0x56afc3['id'],'type':_0x4fdda0[_0xa270('0x2d')],'sectionId':_0x4fdda0['id']},{})['then'](function(){return _0x34b22c;});}else{return _0x34b22c;}})[_0xa270('0x4d')](function(_0x384501){logger['error'](_0xa270('0x54'),_0x384501);throw _0x384501;});}return _0x34b22c;})[_0xa270('0x28')](respondWithResult(_0x18f17a,0xc9))[_0xa270('0x4d')](handleError(_0x18f17a,null));};exports[_0xa270('0x26')]=function(_0x1baac5,_0x334b91){if(_0x1baac5[_0xa270('0x4f')]['id']){delete _0x1baac5[_0xa270('0x4f')]['id'];}return db['Disposition'][_0xa270('0x4c')]({'where':{'id':_0x1baac5['params']['id']}})[_0xa270('0x28')](handleEntityNotFound(_0x334b91,null))[_0xa270('0x28')](saveUpdates(_0x1baac5[_0xa270('0x4f')],null))[_0xa270('0x28')](respondWithResult(_0x334b91,null))[_0xa270('0x4d')](handleError(_0x334b91,null));};exports[_0xa270('0x27')]=function(_0x4658d8,_0x245928){return db[_0xa270('0x31')][_0xa270('0x4c')]({'where':{'id':_0x4658d8[_0xa270('0x49')]['id']}})['then'](handleEntityNotFound(_0x245928,null))[_0xa270('0x28')](removeEntity(_0x245928,null))['catch'](handleError(_0x245928,null));};
\ No newline at end of file
+var _0xd1e5=['create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','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','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','Dispositions','UserProfileResource','destroy','error','stack','name','send','index','Disposition','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','length','include'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd1e5,0xb4));var _0x5d1e=function(_0x5f4675,_0x5223fb){_0x5f4675=_0x5f4675-0x0;var _0x5cc9d2=_0xd1e5[_0x5f4675];return _0x5cc9d2;};'use strict';var emlformat=require(_0x5d1e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5d1e('0x1'));var jsonpatch=require(_0x5d1e('0x2'));var rp=require(_0x5d1e('0x3'));var moment=require(_0x5d1e('0x4'));var BPromise=require(_0x5d1e('0x5'));var Mustache=require(_0x5d1e('0x6'));var util=require(_0x5d1e('0x7'));var path=require(_0x5d1e('0x8'));var sox=require(_0x5d1e('0x9'));var csv=require(_0x5d1e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5d1e('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5d1e('0xa'));var querystring=require('querystring');var Papa=require(_0x5d1e('0xc'));var Redis=require(_0x5d1e('0xd'));var authService=require(_0x5d1e('0xe'));var qs=require(_0x5d1e('0xf'));var as=require(_0x5d1e('0x10'));var hardwareService=require(_0x5d1e('0x11'));var logger=require('../../config/logger')(_0x5d1e('0x12'));var utils=require(_0x5d1e('0x13'));var config=require(_0x5d1e('0x14'));var licenseUtil=require(_0x5d1e('0x15'));var db=require(_0x5d1e('0x16'))['db'];function respondWithStatusCode(_0x3df104,_0x99687c){_0x99687c=_0x99687c||0xcc;return function(_0x5df848){if(_0x5df848){return _0x3df104[_0x5d1e('0x17')](_0x99687c);}return _0x3df104[_0x5d1e('0x18')](_0x99687c)['end']();};}function respondWithResult(_0x103cf8,_0x74c479){_0x74c479=_0x74c479||0xc8;return function(_0xc14917){if(_0xc14917){return _0x103cf8['status'](_0x74c479)[_0x5d1e('0x19')](_0xc14917);}};}function respondWithFilteredResult(_0x1913de,_0x5755d9){return function(_0x40292d){if(_0x40292d){var _0x28e80d=typeof _0x5755d9['offset']===_0x5d1e('0x1a')&&typeof _0x5755d9['limit']==='undefined';var _0x1e8b54=_0x40292d[_0x5d1e('0x1b')];var _0x21aa09=_0x28e80d?0x0:_0x5755d9[_0x5d1e('0x1c')];var _0x4bb317=_0x28e80d?_0x40292d[_0x5d1e('0x1b')]:_0x5755d9[_0x5d1e('0x1c')]+_0x5755d9[_0x5d1e('0x1d')];var _0x1e438e;if(_0x4bb317>=_0x1e8b54){_0x4bb317=_0x1e8b54;_0x1e438e=0xc8;}else{_0x1e438e=0xce;}_0x1913de[_0x5d1e('0x18')](_0x1e438e);return _0x1913de[_0x5d1e('0x1e')](_0x5d1e('0x1f'),_0x21aa09+'-'+_0x4bb317+'/'+_0x1e8b54)[_0x5d1e('0x19')](_0x40292d);}return null;};}function patchUpdates(_0x1cb4b7){return function(_0xc9c462){try{jsonpatch[_0x5d1e('0x20')](_0xc9c462,_0x1cb4b7,!![]);}catch(_0x1fe004){return BPromise[_0x5d1e('0x21')](_0x1fe004);}return _0xc9c462[_0x5d1e('0x22')]();};}function saveUpdates(_0x1692a6,_0x3556f4){return function(_0x16ad83){if(_0x16ad83){return _0x16ad83[_0x5d1e('0x23')](_0x1692a6)[_0x5d1e('0x24')](function(_0x32a2e7){return _0x32a2e7;});}return null;};}function removeEntity(_0x1c0a92,_0x38398b){return function(_0x37366d){if(_0x37366d){return _0x37366d['destroy']()['then'](function(){var _0x4755c6=_0x37366d['get']({'plain':!![]});var _0x4cccf8=_0x5d1e('0x25');return db[_0x5d1e('0x26')][_0x5d1e('0x27')]({'where':{'type':_0x4cccf8,'resourceId':_0x4755c6['id']}})['then'](function(){return _0x37366d;});})[_0x5d1e('0x24')](function(){_0x1c0a92[_0x5d1e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26f7ec,_0x5221c1){return function(_0x4e3d66){if(!_0x4e3d66){_0x26f7ec[_0x5d1e('0x17')](0x194);}return _0x4e3d66;};}function handleError(_0x186ece,_0x268f2f){_0x268f2f=_0x268f2f||0x1f4;return function(_0x5f2dd2){logger[_0x5d1e('0x28')](_0x5f2dd2[_0x5d1e('0x29')]);if(_0x5f2dd2[_0x5d1e('0x2a')]){delete _0x5f2dd2[_0x5d1e('0x2a')];}_0x186ece[_0x5d1e('0x18')](_0x268f2f)[_0x5d1e('0x2b')](_0x5f2dd2);};}exports[_0x5d1e('0x2c')]=function(_0xf46526,_0x4e1900){var _0x588c6f={},_0x2a1993={},_0x4e0ea0={'count':0x0,'rows':[]};var _0x2c36bf=_['map'](db[_0x5d1e('0x2d')][_0x5d1e('0x2e')],function(_0x52c3b0){return{'name':_0x52c3b0[_0x5d1e('0x2f')],'type':_0x52c3b0[_0x5d1e('0x30')][_0x5d1e('0x31')]};});_0x2a1993[_0x5d1e('0x32')]=_[_0x5d1e('0x33')](_0x2c36bf,_0x5d1e('0x2a'));_0x2a1993['query']=_[_0x5d1e('0x34')](_0xf46526[_0x5d1e('0x35')]);_0x2a1993[_0x5d1e('0x36')]=_[_0x5d1e('0x37')](_0x2a1993[_0x5d1e('0x32')],_0x2a1993[_0x5d1e('0x35')]);_0x588c6f[_0x5d1e('0x38')]=_['intersection'](_0x2a1993[_0x5d1e('0x32')],qs[_0x5d1e('0x39')](_0xf46526[_0x5d1e('0x35')][_0x5d1e('0x39')]));_0x588c6f[_0x5d1e('0x38')]=_0x588c6f[_0x5d1e('0x38')]['length']?_0x588c6f[_0x5d1e('0x38')]:_0x2a1993[_0x5d1e('0x32')];if(!_0xf46526[_0x5d1e('0x35')][_0x5d1e('0x3a')](_0x5d1e('0x3b'))){_0x588c6f['limit']=qs[_0x5d1e('0x1d')](_0xf46526[_0x5d1e('0x35')]['limit']);_0x588c6f[_0x5d1e('0x1c')]=qs[_0x5d1e('0x1c')](_0xf46526[_0x5d1e('0x35')][_0x5d1e('0x1c')]);}_0x588c6f['order']=qs[_0x5d1e('0x3c')](_0xf46526[_0x5d1e('0x35')][_0x5d1e('0x3c')]);_0x588c6f['where']=qs[_0x5d1e('0x36')](_[_0x5d1e('0x3d')](_0xf46526[_0x5d1e('0x35')],_0x2a1993[_0x5d1e('0x36')]),_0x2c36bf);if(_0xf46526[_0x5d1e('0x35')][_0x5d1e('0x3e')]){_0x588c6f[_0x5d1e('0x3f')]=_['merge'](_0x588c6f[_0x5d1e('0x3f')],{'$or':_[_0x5d1e('0x33')](_0x2c36bf,function(_0x4f4ad8){if(_0x4f4ad8[_0x5d1e('0x30')]!==_0x5d1e('0x40')){var _0x47ed89={};_0x47ed89[_0x4f4ad8[_0x5d1e('0x2a')]]={'$like':'%'+_0xf46526[_0x5d1e('0x35')][_0x5d1e('0x3e')]+'%'};return _0x47ed89;}})});}_0x588c6f=_[_0x5d1e('0x41')]({},_0x588c6f,_0xf46526[_0x5d1e('0x42')]);var _0xf6fc75={'where':_0x588c6f[_0x5d1e('0x3f')]};return db[_0x5d1e('0x2d')][_0x5d1e('0x1b')](_0xf6fc75)[_0x5d1e('0x24')](function(_0xd9d416){_0x4e0ea0[_0x5d1e('0x1b')]=_0xd9d416;if(_0xf46526[_0x5d1e('0x35')][_0x5d1e('0x43')]){_0x588c6f['include']=[{'all':!![]}];}return db[_0x5d1e('0x2d')][_0x5d1e('0x44')](_0x588c6f);})['then'](function(_0x8e8d39){_0x4e0ea0[_0x5d1e('0x45')]=_0x8e8d39;return _0x4e0ea0;})['then'](respondWithFilteredResult(_0x4e1900,_0x588c6f))[_0x5d1e('0x46')](handleError(_0x4e1900,null));};exports[_0x5d1e('0x47')]=function(_0x4a64e1,_0x9fd8f6){var _0x2102b2={'raw':!![],'where':{'id':_0x4a64e1[_0x5d1e('0x48')]['id']}},_0x27e928={};_0x27e928[_0x5d1e('0x32')]=_[_0x5d1e('0x34')](db[_0x5d1e('0x2d')][_0x5d1e('0x2e')]);_0x27e928['query']=_['keys'](_0x4a64e1[_0x5d1e('0x35')]);_0x27e928[_0x5d1e('0x36')]=_[_0x5d1e('0x37')](_0x27e928[_0x5d1e('0x32')],_0x27e928[_0x5d1e('0x35')]);_0x2102b2[_0x5d1e('0x38')]=_[_0x5d1e('0x37')](_0x27e928['model'],qs[_0x5d1e('0x39')](_0x4a64e1[_0x5d1e('0x35')][_0x5d1e('0x39')]));_0x2102b2[_0x5d1e('0x38')]=_0x2102b2['attributes'][_0x5d1e('0x49')]?_0x2102b2['attributes']:_0x27e928['model'];if(_0x4a64e1['query'][_0x5d1e('0x43')]){_0x2102b2[_0x5d1e('0x4a')]=[{'all':!![]}];}_0x2102b2=_[_0x5d1e('0x41')]({},_0x2102b2,_0x4a64e1[_0x5d1e('0x42')]);return db[_0x5d1e('0x2d')]['find'](_0x2102b2)[_0x5d1e('0x24')](handleEntityNotFound(_0x9fd8f6,null))[_0x5d1e('0x24')](respondWithResult(_0x9fd8f6,null))['catch'](handleError(_0x9fd8f6,null));};exports[_0x5d1e('0x4b')]=function(_0x333ce2,_0xab1748){return db[_0x5d1e('0x2d')][_0x5d1e('0x4b')](_0x333ce2[_0x5d1e('0x4c')],{})[_0x5d1e('0x24')](function(_0x533fbd){var _0x46c7ae=_0x333ce2[_0x5d1e('0x4d')][_0x5d1e('0x4e')]({'plain':!![]});if(!_0x46c7ae)throw new Error(_0x5d1e('0x4f'));if(_0x46c7ae[_0x5d1e('0x50')]===_0x5d1e('0x4d')){var _0x4eaab2=_0x533fbd['get']({'plain':!![]});var _0x8d29ce=_0x5d1e('0x25');return db[_0x5d1e('0x51')][_0x5d1e('0x52')]({'where':{'name':_0x8d29ce,'userProfileId':_0x46c7ae[_0x5d1e('0x53')]},'raw':!![]})[_0x5d1e('0x24')](function(_0x395f86){if(_0x395f86&&_0x395f86[_0x5d1e('0x54')]===0x0){return db[_0x5d1e('0x26')][_0x5d1e('0x4b')]({'name':_0x4eaab2[_0x5d1e('0x2a')],'resourceId':_0x4eaab2['id'],'type':_0x395f86[_0x5d1e('0x2a')],'sectionId':_0x395f86['id']},{})[_0x5d1e('0x24')](function(){return _0x533fbd;});}else{return _0x533fbd;}})[_0x5d1e('0x46')](function(_0x555d2d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x555d2d);throw _0x555d2d;});}return _0x533fbd;})['then'](respondWithResult(_0xab1748,0xc9))[_0x5d1e('0x46')](handleError(_0xab1748,null));};exports[_0x5d1e('0x23')]=function(_0x32d351,_0x5dbedb){if(_0x32d351[_0x5d1e('0x4c')]['id']){delete _0x32d351[_0x5d1e('0x4c')]['id'];}return db[_0x5d1e('0x2d')][_0x5d1e('0x52')]({'where':{'id':_0x32d351[_0x5d1e('0x48')]['id']}})[_0x5d1e('0x24')](handleEntityNotFound(_0x5dbedb,null))[_0x5d1e('0x24')](saveUpdates(_0x32d351[_0x5d1e('0x4c')],null))[_0x5d1e('0x24')](respondWithResult(_0x5dbedb,null))[_0x5d1e('0x46')](handleError(_0x5dbedb,null));};exports[_0x5d1e('0x27')]=function(_0x18135d,_0x130ac5){return db[_0x5d1e('0x2d')]['find']({'where':{'id':_0x18135d[_0x5d1e('0x48')]['id']}})['then'](handleEntityNotFound(_0x130ac5,null))['then'](removeEntity(_0x130ac5,null))[_0x5d1e('0x46')](handleError(_0x130ac5,null));};
\ No newline at end of file
index 81a1637..86800c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7086=['name_voice','name','ChatWebsiteId','name_mail','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','WhatsappAccountId','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./disposition.attributes','exports','define','tools_dispositions'];(function(_0x586fa2,_0x1a45bc){var _0x515be9=function(_0x4e90d5){while(--_0x4e90d5){_0x586fa2['push'](_0x586fa2['shift']());}};_0x515be9(++_0x1a45bc);}(_0x7086,0x181));var _0x6708=function(_0x1f6734,_0x39a504){_0x1f6734=_0x1f6734-0x0;var _0x513561=_0x7086[_0x1f6734];return _0x513561;};'use strict';var _=require(_0x6708('0x0'));var util=require(_0x6708('0x1'));var logger=require(_0x6708('0x2'))('api');var moment=require(_0x6708('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6708('0x4'));var rimraf=require(_0x6708('0x5'));var config=require(_0x6708('0x6'));var attributes=require(_0x6708('0x7'));module[_0x6708('0x8')]=function(_0x4a663e,_0x1daaa3){return _0x4a663e[_0x6708('0x9')]('Disposition',attributes,{'tableName':_0x6708('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x6708('0xb'),'fields':[_0x6708('0xc'),'ListId']},{'unique':!![],'name':'name_chat','fields':[_0x6708('0xc'),_0x6708('0xd')]},{'unique':!![],'name':_0x6708('0xe'),'fields':[_0x6708('0xc'),'MailAccountId']},{'unique':!![],'name':_0x6708('0xf'),'fields':[_0x6708('0xc'),_0x6708('0x10')]},{'unique':!![],'name':_0x6708('0x11'),'fields':[_0x6708('0xc'),_0x6708('0x12')]},{'unique':!![],'name':_0x6708('0x13'),'fields':[_0x6708('0xc'),_0x6708('0x14')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x6708('0xc'),_0x6708('0x15')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa478=['./disposition.attributes','tools_dispositions','name_voice','name','ListId','name_chat','MailAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','WhatsappAccountId','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x48d3f8,_0x502a1b){var _0x3f6498=function(_0x4d50d7){while(--_0x4d50d7){_0x48d3f8['push'](_0x48d3f8['shift']());}};_0x3f6498(++_0x502a1b);}(_0xa478,0x116));var _0x8a47=function(_0x19a5d8,_0x347207){_0x19a5d8=_0x19a5d8-0x0;var _0x30104a=_0xa478[_0x19a5d8];return _0x30104a;};'use strict';var _=require(_0x8a47('0x0'));var util=require('util');var logger=require(_0x8a47('0x1'))(_0x8a47('0x2'));var moment=require(_0x8a47('0x3'));var BPromise=require(_0x8a47('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8a47('0x5'));var rimraf=require(_0x8a47('0x6'));var config=require('../../config/environment');var attributes=require(_0x8a47('0x7'));module['exports']=function(_0x159041,_0x535af2){return _0x159041['define']('Disposition',attributes,{'tableName':_0x8a47('0x8'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x8a47('0x9'),'fields':[_0x8a47('0xa'),_0x8a47('0xb')]},{'unique':!![],'name':_0x8a47('0xc'),'fields':['name','ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0x8a47('0xa'),_0x8a47('0xd')]},{'unique':!![],'name':'name_sms','fields':[_0x8a47('0xa'),'SmsAccountId']},{'unique':!![],'name':_0x8a47('0xe'),'fields':['name',_0x8a47('0xf')]},{'unique':!![],'name':_0x8a47('0x10'),'fields':['name',_0x8a47('0x11')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x8a47('0xa'),_0x8a47('0x12')]}],'timestamps':!![]});};
\ No newline at end of file
index 3742830..3519f0e 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(_0x4f7b16,_0x1c60ba){var _0xab6171=function(_0x550a6e){while(--_0x550a6e){_0x4f7b16['push'](_0x4f7b16['shift']());}};_0xab6171(++_0x1c60ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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(_0x7ee29b,_0x43bb86){var _0x4076fb=function(_0x1bd3cf){while(--_0x1bd3cf){_0x7ee29b['push'](_0x7ee29b['shift']());}};_0x4076fb(++_0x43bb86);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 a0df1b8..418abda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc37c=['multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x154906,_0x429a62){var _0x63d91a=function(_0x27d5e0){while(--_0x27d5e0){_0x154906['push'](_0x154906['shift']());}};_0x63d91a(++_0x429a62);}(_0xc37c,0x143));var _0xcc37=function(_0x240261,_0x4fe66c){_0x240261=_0x240261-0x0;var _0x45c332=_0xc37c[_0x240261];return _0x45c332;};'use strict';var multer=require(_0xcc37('0x0'));var util=require('util');var path=require(_0xcc37('0x1'));var timeout=require(_0xcc37('0x2'));var express=require(_0xcc37('0x3'));var router=express[_0xcc37('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcc37('0x5'));var config=require(_0xcc37('0x6'));var controller=require('./disposition.controller');router['get']('/',auth[_0xcc37('0x7')](),controller[_0xcc37('0x8')]);router['get'](_0xcc37('0x9'),auth['isAuthenticated'](),controller[_0xcc37('0xa')]);router[_0xcc37('0xb')]('/',auth[_0xcc37('0x7')](),controller[_0xcc37('0xc')]);router['put'](_0xcc37('0x9'),auth['isAuthenticated'](),controller[_0xcc37('0xd')]);router[_0xcc37('0xe')](_0xcc37('0x9'),auth['isAuthenticated'](),controller[_0xcc37('0xf')]);module[_0xcc37('0x10')]=router;
\ No newline at end of file
+var _0xac4c=['exports','multer','util','express','Router','../../components/auth/service','./disposition.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy'];(function(_0x1bf7fe,_0x764a6d){var _0x35448e=function(_0x396e7f){while(--_0x396e7f){_0x1bf7fe['push'](_0x1bf7fe['shift']());}};_0x35448e(++_0x764a6d);}(_0xac4c,0x181));var _0xcac4=function(_0x2f74a9,_0x5d9674){_0x2f74a9=_0x2f74a9-0x0;var _0xf86a6c=_0xac4c[_0x2f74a9];return _0xf86a6c;};'use strict';var multer=require(_0xcac4('0x0'));var util=require(_0xcac4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcac4('0x2'));var router=express[_0xcac4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xcac4('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcac4('0x5'));router[_0xcac4('0x6')]('/',auth[_0xcac4('0x7')](),controller['index']);router[_0xcac4('0x6')](_0xcac4('0x8'),auth[_0xcac4('0x7')](),controller[_0xcac4('0x9')]);router[_0xcac4('0xa')]('/',auth[_0xcac4('0x7')](),controller[_0xcac4('0xb')]);router[_0xcac4('0xc')](_0xcac4('0x8'),auth[_0xcac4('0x7')](),controller['update']);router[_0xcac4('0xd')](_0xcac4('0x8'),auth[_0xcac4('0x7')](),controller[_0xcac4('0xe')]);module[_0xcac4('0xf')]=router;
\ No newline at end of file
index 4505611..59776ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18c9=['mandatoryDisposition','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','7200','9600','12000','4800','2400','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x78d11b,_0x1c2611){var _0x5f2e27=function(_0x58e6ce){while(--_0x58e6ce){_0x78d11b['push'](_0x78d11b['shift']());}};_0x5f2e27(++_0x1c2611);}(_0x18c9,0xd9));var _0x918c=function(_0x5b27da,_0x4a6532){_0x5b27da=_0x5b27da-0x0;var _0x3254f4=_0x18c9[_0x5b27da];return _0x3254f4;};'use strict';var Sequelize=require(_0x918c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x918c('0x1')]},'ecm':{'type':Sequelize[_0x918c('0x2')]('yes','no'),'defaultValue':_0x918c('0x3')},'headerinfo':{'type':Sequelize[_0x918c('0x1')],'defaultValue':_0x918c('0x4')},'localstationid':{'type':Sequelize[_0x918c('0x1')],'unique':'localstationid'},'minrate':{'type':Sequelize['ENUM']('2400','4800',_0x918c('0x5'),_0x918c('0x6'),_0x918c('0x7'),'14400'),'defaultValue':_0x918c('0x8')},'maxrate':{'type':Sequelize[_0x918c('0x2')](_0x918c('0x9'),_0x918c('0x8'),_0x918c('0x5'),_0x918c('0x6'),_0x918c('0x7'),_0x918c('0xa')),'defaultValue':_0x918c('0xa')},'modem':{'type':Sequelize[_0x918c('0x1')],'defaultValue':_0x918c('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x918c('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x918c('0x2')](_0x918c('0xd'),_0x918c('0xe'),_0x918c('0xf'),_0x918c('0x10')),'defaultValue':_0x918c('0xd')},'key':{'type':Sequelize[_0x918c('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x918c('0x11');}},'notificationSound':{'type':Sequelize[_0x918c('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x918c('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x918c('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x918c('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x918c('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x918c('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x918c('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x918c('0x12')],'defaultValue':![],'comment':_0x918c('0x14'),'set':function(_0x30f20d){if(!_0x30f20d)this[_0x918c('0x15')](_0x918c('0x16'),null);this[_0x918c('0x15')](_0x918c('0x17'),_0x30f20d);}}};
\ No newline at end of file
+var _0xbb13=['9600','14400','4800','2400','v17,v27,v29','INTEGER','SIP','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','7200'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0xbb13,0xc9));var _0x3bb1=function(_0x656ab4,_0x2edd3f){_0x656ab4=_0x656ab4-0x0;var _0x37758b=_0xbb13[_0x656ab4];return _0x37758b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3bb1('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3bb1('0x0')]},'ecm':{'type':Sequelize['ENUM'](_0x3bb1('0x1'),'no'),'defaultValue':_0x3bb1('0x1')},'headerinfo':{'type':Sequelize[_0x3bb1('0x0')],'defaultValue':_0x3bb1('0x2')},'localstationid':{'type':Sequelize[_0x3bb1('0x0')],'unique':_0x3bb1('0x3')},'minrate':{'type':Sequelize[_0x3bb1('0x4')]('2400','4800',_0x3bb1('0x5'),_0x3bb1('0x6'),'12000',_0x3bb1('0x7')),'defaultValue':_0x3bb1('0x8')},'maxrate':{'type':Sequelize[_0x3bb1('0x4')](_0x3bb1('0x9'),_0x3bb1('0x8'),'7200',_0x3bb1('0x6'),'12000',_0x3bb1('0x7')),'defaultValue':'14400'},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x3bb1('0xa')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x3bb1('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x3bb1('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x3bb1('0x4')](_0x3bb1('0xc'),'IAX',_0x3bb1('0xd'),_0x3bb1('0xe')),'defaultValue':_0x3bb1('0xc')},'key':{'type':Sequelize[_0x3bb1('0x0')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x3bb1('0xf')],'defaultValue':function(){return _0x3bb1('0x10');}},'notificationSound':{'type':Sequelize[_0x3bb1('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3bb1('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3bb1('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3bb1('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3bb1('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3bb1('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3bb1('0xb')],'allowNull':!![],'defaultValue':null,'comment':_0x3bb1('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x3bb1('0x11')],'defaultValue':![],'comment':_0x3bb1('0x13'),'set':function(_0x441f24){if(!_0x441f24)this[_0x3bb1('0x14')](_0x3bb1('0x15'),null);this['setDataValue'](_0x3bb1('0x16'),_0x441f24);}}};
\ No newline at end of file
index 0efcca4..b51032f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bc3=['length','hasOwnProperty','nolimit','order','sort','pick','filters','merge','VIRTUAL','where','includeAll','rows','catch','params','mandatoryDispositionPause','include','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','FaxAccountId','getDispositions','findOne','Disposition','filter','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','getInteractions','User','Owner','internal','Tag','Tags','tag','FaxInteraction','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','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','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','CmList','List','Contacts','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./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','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','FaxAccounts','UserProfileResource','stack','name','index','Pause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields'];(function(_0x3e0242,_0x4a4116){var _0x5a39f6=function(_0x2083e6){while(--_0x2083e6){_0x3e0242['push'](_0x3e0242['shift']());}};_0x5a39f6(++_0x4a4116);}(_0x6bc3,0x146));var _0x36bc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6bc3[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x36bc('0x0'));var zipdir=require(_0x36bc('0x1'));var jsonpatch=require(_0x36bc('0x2'));var rp=require(_0x36bc('0x3'));var moment=require(_0x36bc('0x4'));var BPromise=require(_0x36bc('0x5'));var Mustache=require(_0x36bc('0x6'));var util=require(_0x36bc('0x7'));var path=require(_0x36bc('0x8'));var sox=require('sox');var csv=require(_0x36bc('0x9'));var ejs=require(_0x36bc('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x36bc('0xb'));var squel=require(_0x36bc('0xc'));var crypto=require(_0x36bc('0xd'));var jsforce=require(_0x36bc('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x36bc('0x9'));var querystring=require(_0x36bc('0xf'));var Papa=require('papaparse');var Redis=require(_0x36bc('0x10'));var authService=require(_0x36bc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x36bc('0x12'));var hardwareService=require(_0x36bc('0x13'));var logger=require(_0x36bc('0x14'))(_0x36bc('0x15'));var utils=require('../../config/utils');var config=require(_0x36bc('0x16'));var licenseUtil=require(_0x36bc('0x17'));var db=require(_0x36bc('0x18'))['db'];config[_0x36bc('0x19')]=_[_0x36bc('0x1a')](config['redis'],{'host':_0x36bc('0x1b'),'port':0x18eb});var socket=require(_0x36bc('0x1c'))(new Redis(config['redis']));require(_0x36bc('0x1d'))[_0x36bc('0x1e')](socket);var jayson=require(_0x36bc('0x1f'));var client=jayson[_0x36bc('0x20')][_0x36bc('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x36bc('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x54a7fb,_0x561266,_0x12f068,_0x1e5784){return new BPromise(function(_0x49f9fb,_0x4563da){var _0x1f7f2b=_0x1e5784||client;return _0x1f7f2b[_0x36bc('0x22')](_0x54a7fb,_0x12f068)['then'](function(_0x1ea004){logger[_0x36bc('0x23')](_0x36bc('0x24'),_0x561266,'request\x20sent');logger[_0x36bc('0x25')](_0x36bc('0x26'),_0x561266,_0x36bc('0x27'),JSON[_0x36bc('0x28')](_0x1ea004));if(_0x1ea004[_0x36bc('0x29')]){if(_0x1ea004['error'][_0x36bc('0x2a')]===0x1f4){logger[_0x36bc('0x29')](_0x36bc('0x24'),_0x561266,_0x1ea004[_0x36bc('0x29')][_0x36bc('0x2b')]);return _0x4563da(_0x1ea004[_0x36bc('0x29')]['message']);}logger['error'](_0x36bc('0x24'),_0x561266,_0x1ea004[_0x36bc('0x29')][_0x36bc('0x2b')]);return _0x49f9fb(_0x1ea004[_0x36bc('0x29')][_0x36bc('0x2b')]);}else{logger[_0x36bc('0x23')](_0x36bc('0x24'),_0x561266,_0x36bc('0x27'));_0x49f9fb(_0x1ea004['result'][_0x36bc('0x2b')]);}})['catch'](function(_0x582222){logger['error'](_0x36bc('0x24'),_0x561266,_0x582222);_0x4563da(_0x582222);});});}function respondWithStatusCode(_0x92a613,_0x20d5c9){_0x20d5c9=_0x20d5c9||0xcc;return function(_0x5636f2){if(_0x5636f2){return _0x92a613[_0x36bc('0x2c')](_0x20d5c9);}return _0x92a613[_0x36bc('0x2d')](_0x20d5c9)[_0x36bc('0x2e')]();};}function respondWithResult(_0x287f7e,_0x4b4466){_0x4b4466=_0x4b4466||0xc8;return function(_0x2ad24a){if(_0x2ad24a){return _0x287f7e[_0x36bc('0x2d')](_0x4b4466)[_0x36bc('0x2f')](_0x2ad24a);}};}function respondWithFilteredResult(_0x26c2a7,_0x204c63){return function(_0xc8a38){if(_0xc8a38){var _0x29dbf3=typeof _0x204c63[_0x36bc('0x30')]==='undefined'&&typeof _0x204c63[_0x36bc('0x31')]===_0x36bc('0x32');var _0x103295=_0xc8a38['count'];var _0x3b8725=_0x29dbf3?0x0:_0x204c63[_0x36bc('0x30')];var _0x31a719=_0x29dbf3?_0xc8a38[_0x36bc('0x33')]:_0x204c63[_0x36bc('0x30')]+_0x204c63[_0x36bc('0x31')];var _0x5d7621;if(_0x31a719>=_0x103295){_0x31a719=_0x103295;_0x5d7621=0xc8;}else{_0x5d7621=0xce;}_0x26c2a7[_0x36bc('0x2d')](_0x5d7621);return _0x26c2a7[_0x36bc('0x34')](_0x36bc('0x35'),_0x3b8725+'-'+_0x31a719+'/'+_0x103295)[_0x36bc('0x2f')](_0xc8a38);}return null;};}function patchUpdates(_0x304ad2){return function(_0x326e98){try{jsonpatch[_0x36bc('0x36')](_0x326e98,_0x304ad2,!![]);}catch(_0x24f14c){return BPromise['reject'](_0x24f14c);}return _0x326e98['save']();};}function saveUpdates(_0x1b7606,_0x171df2){return function(_0x233bed){if(_0x233bed){return _0x233bed[_0x36bc('0x37')](_0x1b7606)[_0x36bc('0x38')](function(_0x10703d){return _0x10703d;});}return null;};}function removeEntity(_0x230cd3,_0x523406){return function(_0x5f393c){if(_0x5f393c){return _0x5f393c[_0x36bc('0x39')]()[_0x36bc('0x38')](function(){var _0x3e7c14=_0x5f393c['get']({'plain':!![]});var _0xfd4338=_0x36bc('0x3a');return db[_0x36bc('0x3b')][_0x36bc('0x39')]({'where':{'type':_0xfd4338,'resourceId':_0x3e7c14['id']}})[_0x36bc('0x38')](function(){return _0x5f393c;});})[_0x36bc('0x38')](function(){_0x230cd3[_0x36bc('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13c3f6,_0xa9a8bd){return function(_0x3c5200){if(!_0x3c5200){_0x13c3f6['sendStatus'](0x194);}return _0x3c5200;};}function handleError(_0x3c842b,_0xd643ba){_0xd643ba=_0xd643ba||0x1f4;return function(_0x5aba39){logger[_0x36bc('0x29')](_0x5aba39[_0x36bc('0x3c')]);if(_0x5aba39[_0x36bc('0x3d')]){delete _0x5aba39['name'];}_0x3c842b['status'](_0xd643ba)['send'](_0x5aba39);};}exports[_0x36bc('0x3e')]=function(_0xdb3fd4,_0x2cd0a4){var _0x36bde7={'include':[{'model':db[_0x36bc('0x3f')],'as':'mandatoryDispositionPause'}]},_0x5d0db3={},_0x3a8811={'count':0x0,'rows':[]};var _0x185be4=_[_0x36bc('0x40')](db[_0x36bc('0x41')][_0x36bc('0x42')],function(_0x23eb00){return{'name':_0x23eb00[_0x36bc('0x43')],'type':_0x23eb00[_0x36bc('0x44')][_0x36bc('0x45')]};});_0x5d0db3[_0x36bc('0x46')]=_[_0x36bc('0x40')](_0x185be4,_0x36bc('0x3d'));_0x5d0db3[_0x36bc('0x47')]=_[_0x36bc('0x48')](_0xdb3fd4['query']);_0x5d0db3['filters']=_[_0x36bc('0x49')](_0x5d0db3[_0x36bc('0x46')],_0x5d0db3[_0x36bc('0x47')]);_0x36bde7[_0x36bc('0x4a')]=_[_0x36bc('0x49')](_0x5d0db3['model'],qs[_0x36bc('0x4b')](_0xdb3fd4[_0x36bc('0x47')][_0x36bc('0x4b')]));_0x36bde7[_0x36bc('0x4a')]=_0x36bde7[_0x36bc('0x4a')][_0x36bc('0x4c')]?_0x36bde7[_0x36bc('0x4a')]:_0x5d0db3['model'];if(!_0xdb3fd4[_0x36bc('0x47')][_0x36bc('0x4d')](_0x36bc('0x4e'))){_0x36bde7[_0x36bc('0x31')]=qs[_0x36bc('0x31')](_0xdb3fd4['query']['limit']);_0x36bde7[_0x36bc('0x30')]=qs[_0x36bc('0x30')](_0xdb3fd4[_0x36bc('0x47')][_0x36bc('0x30')]);}_0x36bde7[_0x36bc('0x4f')]=qs[_0x36bc('0x50')](_0xdb3fd4[_0x36bc('0x47')]['sort']);_0x36bde7['where']=qs['filters'](_[_0x36bc('0x51')](_0xdb3fd4['query'],_0x5d0db3[_0x36bc('0x52')]),_0x185be4);if(_0xdb3fd4[_0x36bc('0x47')]['filter']){_0x36bde7['where']=_[_0x36bc('0x53')](_0x36bde7['where'],{'$or':_['map'](_0x185be4,function(_0x131c03){if(_0x131c03[_0x36bc('0x44')]!==_0x36bc('0x54')){var _0xa3a341={};_0xa3a341[_0x131c03[_0x36bc('0x3d')]]={'$like':'%'+_0xdb3fd4[_0x36bc('0x47')]['filter']+'%'};return _0xa3a341;}})});}_0x36bde7=_['merge']({},_0x36bde7,_0xdb3fd4['options']);var _0x42a2bc={'where':_0x36bde7[_0x36bc('0x55')]};return db['FaxAccount'][_0x36bc('0x33')](_0x42a2bc)['then'](function(_0x35f82a){_0x3a8811[_0x36bc('0x33')]=_0x35f82a;if(_0xdb3fd4[_0x36bc('0x47')][_0x36bc('0x56')]){_0x36bde7['include']=[{'all':!![]}];}return db[_0x36bc('0x41')]['findAll'](_0x36bde7);})[_0x36bc('0x38')](function(_0x46a704){_0x3a8811[_0x36bc('0x57')]=_0x46a704;return _0x3a8811;})[_0x36bc('0x38')](respondWithFilteredResult(_0x2cd0a4,_0x36bde7))[_0x36bc('0x58')](handleError(_0x2cd0a4,null));};exports['show']=function(_0x75997a,_0x536fc0){var _0xdbdf0e={'raw':![],'where':{'id':_0x75997a[_0x36bc('0x59')]['id']},'include':[{'model':db[_0x36bc('0x3f')],'as':_0x36bc('0x5a')}]},_0x3f2ce8={};_0x3f2ce8[_0x36bc('0x46')]=_[_0x36bc('0x48')](db[_0x36bc('0x41')][_0x36bc('0x42')]);_0x3f2ce8['query']=_['keys'](_0x75997a[_0x36bc('0x47')]);_0x3f2ce8[_0x36bc('0x52')]=_['intersection'](_0x3f2ce8['model'],_0x3f2ce8[_0x36bc('0x47')]);_0xdbdf0e[_0x36bc('0x4a')]=_[_0x36bc('0x49')](_0x3f2ce8['model'],qs['fields'](_0x75997a[_0x36bc('0x47')]['fields']));_0xdbdf0e[_0x36bc('0x4a')]=_0xdbdf0e[_0x36bc('0x4a')]['length']?_0xdbdf0e['attributes']:_0x3f2ce8[_0x36bc('0x46')];if(_0x75997a[_0x36bc('0x47')]['includeAll']){_0xdbdf0e[_0x36bc('0x5b')]=[{'all':!![]}];}_0xdbdf0e=_[_0x36bc('0x53')]({},_0xdbdf0e,_0x75997a[_0x36bc('0x5c')]);return db['FaxAccount'][_0x36bc('0x5d')](_0xdbdf0e)['then'](handleEntityNotFound(_0x536fc0,null))['then'](respondWithResult(_0x536fc0,null))['catch'](handleError(_0x536fc0,null));};exports[_0x36bc('0x5e')]=function(_0xe12c89,_0x5b9298){return db['FaxAccount']['create'](_0xe12c89[_0x36bc('0x5f')],{})[_0x36bc('0x38')](function(_0x3f47d4){var _0x77238e=_0xe12c89['user'][_0x36bc('0x60')]({'plain':!![]});if(!_0x77238e)throw new Error(_0x36bc('0x61'));if(_0x77238e['role']===_0x36bc('0x62')){var _0x5ddd85=_0x3f47d4[_0x36bc('0x60')]({'plain':!![]});var _0x489c86='FaxAccounts';return db[_0x36bc('0x63')][_0x36bc('0x5d')]({'where':{'name':_0x489c86,'userProfileId':_0x77238e[_0x36bc('0x64')]},'raw':!![]})[_0x36bc('0x38')](function(_0x507619){if(_0x507619&&_0x507619[_0x36bc('0x65')]===0x0){return db[_0x36bc('0x3b')][_0x36bc('0x5e')]({'name':_0x5ddd85[_0x36bc('0x3d')],'resourceId':_0x5ddd85['id'],'type':_0x507619[_0x36bc('0x3d')],'sectionId':_0x507619['id']},{})[_0x36bc('0x38')](function(){return _0x3f47d4;});}else{return _0x3f47d4;}})[_0x36bc('0x58')](function(_0x3b2210){logger[_0x36bc('0x29')](_0x36bc('0x66'),_0x3b2210);throw _0x3b2210;});}return _0x3f47d4;})[_0x36bc('0x38')](respondWithResult(_0x5b9298,0xc9))['catch'](handleError(_0x5b9298,null));};exports[_0x36bc('0x37')]=function(_0xd0d79f,_0x551404){if(_0xd0d79f['body']['id']){delete _0xd0d79f[_0x36bc('0x5f')]['id'];}return db[_0x36bc('0x41')][_0x36bc('0x5d')]({'where':{'id':_0xd0d79f['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x36bc('0x38')](handleEntityNotFound(_0x551404,null))[_0x36bc('0x38')](saveUpdates(_0xd0d79f[_0x36bc('0x5f')],null))[_0x36bc('0x38')](respondWithResult(_0x551404,null))['catch'](handleError(_0x551404,null));};exports[_0x36bc('0x39')]=function(_0x46367c,_0xc226e3){return db[_0x36bc('0x41')][_0x36bc('0x5d')]({'where':{'id':_0x46367c[_0x36bc('0x59')]['id']}})['then'](handleEntityNotFound(_0xc226e3,null))[_0x36bc('0x38')](removeEntity(_0xc226e3,null))[_0x36bc('0x58')](handleError(_0xc226e3,null));};exports[_0x36bc('0x67')]=function(_0x4a3e79,_0xd6413e){return db[_0x36bc('0x41')][_0x36bc('0x67')]()['then'](respondWithResult(_0xd6413e,null))['catch'](handleError(_0xd6413e,null));};exports['addDisposition']=function(_0x5aa35d,_0x288a8a,_0x2a0cad){if(_0x5aa35d[_0x36bc('0x5f')]['id']){delete _0x5aa35d[_0x36bc('0x5f')]['id'];}return db[_0x36bc('0x41')][_0x36bc('0x5d')]({'where':{'id':_0x5aa35d[_0x36bc('0x59')]['id']}})[_0x36bc('0x38')](handleEntityNotFound(_0x288a8a,null))[_0x36bc('0x38')](function(_0x44ffad){if(_0x44ffad){_0x5aa35d[_0x36bc('0x5f')][_0x36bc('0x68')]=_0x44ffad['id'];return db['Disposition'][_0x36bc('0x5e')](_0x5aa35d[_0x36bc('0x5f')]);}})['then'](respondWithResult(_0x288a8a,null))[_0x36bc('0x58')](handleError(_0x288a8a,null));};exports[_0x36bc('0x69')]=function(_0x4ca36e,_0x13bc90,_0x1eb4c0){var _0x555129={'raw':![],'where':{}};var _0x124654={};var _0x41eea5={'count':0x0,'rows':[]};return db[_0x36bc('0x41')][_0x36bc('0x6a')]({'where':{'id':_0x4ca36e['params']['id']}})['then'](handleEntityNotFound(_0x13bc90,null))[_0x36bc('0x38')](function(_0x391161){if(_0x391161){_0x124654[_0x36bc('0x46')]=_['keys'](db[_0x36bc('0x6b')]['rawAttributes']);_0x124654[_0x36bc('0x47')]=_[_0x36bc('0x48')](_0x4ca36e['query']);_0x124654['filters']=_[_0x36bc('0x49')](_0x124654[_0x36bc('0x46')],_0x124654['query']);_0x555129[_0x36bc('0x4a')]=_[_0x36bc('0x49')](_0x124654['model'],qs['fields'](_0x4ca36e[_0x36bc('0x47')][_0x36bc('0x4b')]));_0x555129[_0x36bc('0x4a')]=_0x555129[_0x36bc('0x4a')]['length']?_0x555129[_0x36bc('0x4a')]:_0x124654['model'];if(!_0x4ca36e[_0x36bc('0x47')][_0x36bc('0x4d')](_0x36bc('0x4e'))){_0x555129['limit']=qs[_0x36bc('0x31')](_0x4ca36e[_0x36bc('0x47')]['limit']);_0x555129[_0x36bc('0x30')]=qs[_0x36bc('0x30')](_0x4ca36e[_0x36bc('0x47')][_0x36bc('0x30')]);}_0x555129['order']=qs['sort'](_0x4ca36e[_0x36bc('0x47')]['sort']);_0x555129[_0x36bc('0x55')]=qs['filters'](_[_0x36bc('0x51')](_0x4ca36e[_0x36bc('0x47')],_0x124654['filters']));_0x555129[_0x36bc('0x55')][_0x36bc('0x68')]=_0x391161['id'];if(_0x4ca36e['query'][_0x36bc('0x6c')]){_0x555129[_0x36bc('0x55')]=_[_0x36bc('0x53')](_0x555129[_0x36bc('0x55')],{'$or':_[_0x36bc('0x40')](_0x555129['attributes'],function(_0x510908){var _0x52db62={};_0x52db62[_0x510908]={'$like':'%'+_0x4ca36e[_0x36bc('0x47')][_0x36bc('0x6c')]+'%'};return _0x52db62;})});}_0x555129=_[_0x36bc('0x53')]({},_0x555129,_0x4ca36e['options']);return db['Disposition'][_0x36bc('0x33')]({'where':_0x555129[_0x36bc('0x55')]})[_0x36bc('0x38')](function(_0x5968a1){_0x41eea5[_0x36bc('0x33')]=_0x5968a1;if(_0x4ca36e[_0x36bc('0x47')]['includeAll']){_0x555129[_0x36bc('0x5b')]=[{'all':!![]}];}return db[_0x36bc('0x6b')][_0x36bc('0x6d')](_0x555129);})[_0x36bc('0x38')](function(_0x589c42){_0x41eea5[_0x36bc('0x57')]=_0x589c42;return _0x41eea5;});}})[_0x36bc('0x38')](respondWithFilteredResult(_0x13bc90,_0x555129))[_0x36bc('0x58')](handleError(_0x13bc90,null));};exports[_0x36bc('0x6e')]=function(_0x3aa758,_0x1e0f6b,_0x5428f1){return db[_0x36bc('0x41')]['find']({'where':{'id':_0x3aa758[_0x36bc('0x59')]['id']}})[_0x36bc('0x38')](handleEntityNotFound(_0x1e0f6b,null))[_0x36bc('0x38')](function(_0x255e49){if(_0x255e49){return _0x255e49[_0x36bc('0x6e')](_0x3aa758[_0x36bc('0x47')][_0x36bc('0x6f')]);}})[_0x36bc('0x38')](respondWithStatusCode(_0x1e0f6b,null))[_0x36bc('0x58')](handleError(_0x1e0f6b,null));};exports[_0x36bc('0x70')]=function(_0x1eb918,_0x39bf4e,_0x5add68){if(_0x1eb918[_0x36bc('0x5f')]['id']){delete _0x1eb918[_0x36bc('0x5f')]['id'];}return db[_0x36bc('0x41')][_0x36bc('0x5d')]({'where':{'id':_0x1eb918[_0x36bc('0x59')]['id']}})[_0x36bc('0x38')](handleEntityNotFound(_0x39bf4e,null))[_0x36bc('0x38')](function(_0x364edf){if(_0x364edf){_0x1eb918[_0x36bc('0x5f')][_0x36bc('0x68')]=_0x364edf['id'];return db[_0x36bc('0x71')][_0x36bc('0x5e')](_0x1eb918[_0x36bc('0x5f')]);}})[_0x36bc('0x38')](respondWithResult(_0x39bf4e,null))[_0x36bc('0x58')](handleError(_0x39bf4e,null));};exports[_0x36bc('0x72')]=function(_0x40f6d7,_0x24b3c5,_0x46e966){var _0x1e9e1e={'raw':![],'where':{}};var _0x4826fa={};var _0x281eb6={'count':0x0,'rows':[]};return db[_0x36bc('0x41')][_0x36bc('0x6a')]({'where':{'id':_0x40f6d7[_0x36bc('0x59')]['id']}})[_0x36bc('0x38')](handleEntityNotFound(_0x24b3c5,null))['then'](function(_0x188a32){if(_0x188a32){_0x4826fa[_0x36bc('0x46')]=_[_0x36bc('0x48')](db[_0x36bc('0x71')]['rawAttributes']);_0x4826fa[_0x36bc('0x47')]=_['keys'](_0x40f6d7[_0x36bc('0x47')]);_0x4826fa[_0x36bc('0x52')]=_['intersection'](_0x4826fa['model'],_0x4826fa[_0x36bc('0x47')]);_0x1e9e1e[_0x36bc('0x4a')]=_[_0x36bc('0x49')](_0x4826fa[_0x36bc('0x46')],qs[_0x36bc('0x4b')](_0x40f6d7[_0x36bc('0x47')][_0x36bc('0x4b')]));_0x1e9e1e['attributes']=_0x1e9e1e['attributes'][_0x36bc('0x4c')]?_0x1e9e1e[_0x36bc('0x4a')]:_0x4826fa['model'];if(!_0x40f6d7[_0x36bc('0x47')]['hasOwnProperty'](_0x36bc('0x4e'))){_0x1e9e1e[_0x36bc('0x31')]=qs[_0x36bc('0x31')](_0x40f6d7[_0x36bc('0x47')][_0x36bc('0x31')]);_0x1e9e1e[_0x36bc('0x30')]=qs[_0x36bc('0x30')](_0x40f6d7[_0x36bc('0x47')][_0x36bc('0x30')]);}_0x1e9e1e[_0x36bc('0x4f')]=qs[_0x36bc('0x50')](_0x40f6d7['query'][_0x36bc('0x50')]);_0x1e9e1e[_0x36bc('0x55')]=qs[_0x36bc('0x52')](_[_0x36bc('0x51')](_0x40f6d7['query'],_0x4826fa[_0x36bc('0x52')]));_0x1e9e1e['where'][_0x36bc('0x68')]=_0x188a32['id'];if(_0x40f6d7[_0x36bc('0x47')]['filter']){_0x1e9e1e[_0x36bc('0x55')]=_['merge'](_0x1e9e1e['where'],{'$or':_[_0x36bc('0x40')](_0x1e9e1e['attributes'],function(_0x5439a0){var _0x11d344={};_0x11d344[_0x5439a0]={'$like':'%'+_0x40f6d7['query'][_0x36bc('0x6c')]+'%'};return _0x11d344;})});}_0x1e9e1e=_['merge']({},_0x1e9e1e,_0x40f6d7['options']);return db[_0x36bc('0x71')]['count']({'where':_0x1e9e1e['where']})['then'](function(_0x18ee41){_0x281eb6[_0x36bc('0x33')]=_0x18ee41;if(_0x40f6d7[_0x36bc('0x47')]['includeAll']){_0x1e9e1e[_0x36bc('0x5b')]=[{'all':!![]}];}return db[_0x36bc('0x71')][_0x36bc('0x6d')](_0x1e9e1e);})['then'](function(_0x14ae47){_0x281eb6[_0x36bc('0x57')]=_0x14ae47;return _0x281eb6;});}})[_0x36bc('0x38')](respondWithFilteredResult(_0x24b3c5,_0x1e9e1e))[_0x36bc('0x58')](handleError(_0x24b3c5,null));};exports[_0x36bc('0x73')]=function(_0x2a0d35,_0x26dfad,_0x4252a5){return db[_0x36bc('0x41')][_0x36bc('0x5d')]({'where':{'id':_0x2a0d35[_0x36bc('0x59')]['id']}})[_0x36bc('0x38')](handleEntityNotFound(_0x26dfad,null))[_0x36bc('0x38')](function(_0x15b241){if(_0x15b241){return _0x15b241[_0x36bc('0x73')](_0x2a0d35[_0x36bc('0x47')][_0x36bc('0x6f')]);}})['then'](respondWithStatusCode(_0x26dfad,null))[_0x36bc('0x58')](handleError(_0x26dfad,null));};exports[_0x36bc('0x74')]=function(_0x3d3148,_0x396964,_0x80270d){return db['FaxInteraction'][_0x36bc('0x5d')]({'where':{'id':_0x3d3148[_0x36bc('0x59')]['id']}})[_0x36bc('0x38')](handleEntityNotFound(_0x396964,null))[_0x36bc('0x38')](function(_0x1bed6d){if(_0x1bed6d){return _0x1bed6d[_0x36bc('0x74')](_0x3d3148[_0x36bc('0x5f')][_0x36bc('0x6f')],_['omit'](_0x3d3148[_0x36bc('0x5f')],[_0x36bc('0x6f'),'id'])||{});}})[_0x36bc('0x38')](respondWithResult(_0x396964,null))['catch'](handleError(_0x396964,null));};exports[_0x36bc('0x75')]=function(_0x318083,_0x286015,_0x4d118c){var _0x3db92a={'raw':![],'where':{}};var _0x2c3c07={};var _0x499349={'count':0x0,'rows':[]};return db[_0x36bc('0x41')]['findOne']({'where':{'id':_0x318083['params']['id']}})['then'](handleEntityNotFound(_0x286015,null))['then'](function(_0x452751){if(_0x452751){_0x2c3c07[_0x36bc('0x46')]=_[_0x36bc('0x48')](db['FaxInteraction']['rawAttributes']);_0x2c3c07[_0x36bc('0x47')]=_['keys'](_0x318083[_0x36bc('0x47')]);_0x2c3c07['filters']=_[_0x36bc('0x49')](_0x2c3c07['model'],_0x2c3c07[_0x36bc('0x47')]);_0x3db92a[_0x36bc('0x4a')]=_[_0x36bc('0x49')](_0x2c3c07[_0x36bc('0x46')],qs[_0x36bc('0x4b')](_0x318083[_0x36bc('0x47')][_0x36bc('0x4b')]));_0x3db92a[_0x36bc('0x4a')]=_0x3db92a['attributes'][_0x36bc('0x4c')]?_0x3db92a[_0x36bc('0x4a')]:_0x2c3c07[_0x36bc('0x46')];if(!_0x318083[_0x36bc('0x47')]['hasOwnProperty'](_0x36bc('0x4e'))){_0x3db92a[_0x36bc('0x31')]=qs[_0x36bc('0x31')](_0x318083['query'][_0x36bc('0x31')]);_0x3db92a['offset']=qs[_0x36bc('0x30')](_0x318083['query'][_0x36bc('0x30')]);}_0x3db92a[_0x36bc('0x4f')]=qs[_0x36bc('0x50')](_0x318083['query'][_0x36bc('0x50')]);_0x3db92a[_0x36bc('0x55')]=qs[_0x36bc('0x52')](_['pick'](_0x318083[_0x36bc('0x47')],_0x2c3c07[_0x36bc('0x52')]));_0x3db92a[_0x36bc('0x55')]['FaxAccountId']=_0x452751['id'];if(_0x318083[_0x36bc('0x47')][_0x36bc('0x6c')]){_0x3db92a[_0x36bc('0x55')]=_[_0x36bc('0x53')](_0x3db92a[_0x36bc('0x55')],{'$or':_[_0x36bc('0x40')](_0x3db92a[_0x36bc('0x4a')],function(_0x4ab6a4){var _0x2f7168={};_0x2f7168[_0x4ab6a4]={'$like':'%'+_0x318083[_0x36bc('0x47')][_0x36bc('0x6c')]+'%'};return _0x2f7168;})});}_0x3db92a=_['merge']({},_0x3db92a,_0x318083['options']);return db['FaxInteraction'][_0x36bc('0x33')]({'where':_0x3db92a[_0x36bc('0x55')]})[_0x36bc('0x38')](function(_0x54761e){_0x499349['count']=_0x54761e;if(_0x318083['query'][_0x36bc('0x56')]){_0x3db92a[_0x36bc('0x5b')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x36bc('0x76')],'as':_0x36bc('0x77'),'attributes':[_0x36bc('0x3d'),'fullname',_0x36bc('0x78')],'required':![]},{'model':db[_0x36bc('0x79')],'as':_0x36bc('0x7a'),'attributes':['id',_0x36bc('0x3d'),'color'],'where':_0x318083[_0x36bc('0x47')][_0x36bc('0x7b')]?{'id':_0x318083[_0x36bc('0x47')][_0x36bc('0x7b')]}:undefined,'required':_0x318083[_0x36bc('0x47')]['tag']?!![]:![]}];}return db[_0x36bc('0x7c')]['findAll'](_0x3db92a);})[_0x36bc('0x38')](function(_0x3d3a73){_0x499349[_0x36bc('0x57')]=_0x3d3a73;return _0x499349;});}})[_0x36bc('0x38')](respondWithFilteredResult(_0x286015,_0x3db92a))[_0x36bc('0x58')](handleError(_0x286015,null));};exports[_0x36bc('0x7d')]=function(_0x306865,_0x57f34c){var _0x22e898=_0x306865[_0x36bc('0x59')]['id'];var _0x5cd986=_0x306865[_0x36bc('0x5f')];var _0x25b88d=0xc8;var _0x5823ce=null;return db[_0x36bc('0x7e')][_0x36bc('0x7f')]({'isolationLevel':db[_0x36bc('0x7e')][_0x36bc('0x80')][_0x36bc('0x81')][_0x36bc('0x82')]},function(_0x1423d6){return db[_0x36bc('0x41')][_0x36bc('0x6a')]({'where':{'id':_0x22e898},'transaction':_0x1423d6})[_0x36bc('0x38')](function(_0x4e2855){if(_0x4e2855){return db[_0x36bc('0x83')]['destroy']({'where':{'FaxAccountId':_0x22e898},'transaction':_0x1423d6})[_0x36bc('0x38')](function(){var _0x500858=_[_0x36bc('0x40')](_0x5cd986,function(_0x4c03b1){_0x4c03b1[_0x36bc('0x68')]=_0x22e898;return _0x4c03b1;});return db[_0x36bc('0x83')][_0x36bc('0x84')](_0x500858,{'transaction':_0x1423d6});});}else{_0x25b88d=0x194;_0x5823ce=[];}});})['then'](function(){if(_0x25b88d!==0x194){return db[_0x36bc('0x83')][_0x36bc('0x85')]({'where':{'FaxAccountId':_0x22e898},'order':_0x36bc('0x86')})[_0x36bc('0x38')](function(_0x116277){_0x5823ce=_0x116277;});}})[_0x36bc('0x58')](function(_0x2c70f4){_0x25b88d=0x1f4;logger['error'](_0x2c70f4['stack']);if(_0x2c70f4[_0x36bc('0x3d')]){delete _0x2c70f4[_0x36bc('0x3d')];}_0x5823ce=_0x2c70f4;})[_0x36bc('0x87')](function(){if(_0x5823ce===null){_0x57f34c['sendStatus'](_0x25b88d);}else{if(_0x25b88d===0x1f4){_0x57f34c[_0x36bc('0x2d')](_0x25b88d)[_0x36bc('0x88')](_0x5823ce);}else{_0x57f34c[_0x36bc('0x2d')](_0x25b88d)[_0x36bc('0x2f')](_0x5823ce);}}});};exports['getApplications']=function(_0x4f760c,_0x1286ce,_0x5953ca){var _0x2d1dc6={};var _0x190779={};var _0x968d09;var _0xb368e6;return db[_0x36bc('0x41')][_0x36bc('0x6a')]({'where':{'id':_0x4f760c['params']['id']}})[_0x36bc('0x38')](handleEntityNotFound(_0x1286ce,null))[_0x36bc('0x38')](function(_0x4b373e){if(_0x4b373e){_0x968d09=_0x4b373e;_0x190779[_0x36bc('0x46')]=_[_0x36bc('0x48')](db[_0x36bc('0x83')][_0x36bc('0x42')]);_0x190779[_0x36bc('0x47')]=_[_0x36bc('0x48')](_0x4f760c['query']);_0x190779[_0x36bc('0x52')]=_[_0x36bc('0x49')](_0x190779['model'],_0x190779[_0x36bc('0x47')]);_0x2d1dc6['attributes']=_[_0x36bc('0x49')](_0x190779['model'],qs['fields'](_0x4f760c[_0x36bc('0x47')][_0x36bc('0x4b')]));_0x2d1dc6['attributes']=_0x2d1dc6[_0x36bc('0x4a')][_0x36bc('0x4c')]?_0x2d1dc6[_0x36bc('0x4a')]:_0x190779[_0x36bc('0x46')];_0x2d1dc6[_0x36bc('0x4f')]=qs[_0x36bc('0x50')](_0x4f760c[_0x36bc('0x47')][_0x36bc('0x50')]);_0x2d1dc6[_0x36bc('0x55')]=qs['filters'](_[_0x36bc('0x51')](_0x4f760c[_0x36bc('0x47')],_0x190779[_0x36bc('0x52')]));if(_0x4f760c[_0x36bc('0x47')]['filter']){_0x2d1dc6[_0x36bc('0x55')]=_[_0x36bc('0x53')](_0x2d1dc6[_0x36bc('0x55')],{'$or':_[_0x36bc('0x40')](_0x2d1dc6['attributes'],function(_0x1afda7){var _0x35cd07={};_0x35cd07[_0x1afda7]={'$like':'%'+_0x4f760c[_0x36bc('0x47')][_0x36bc('0x6c')]+'%'};return _0x35cd07;})});}_0x2d1dc6=_[_0x36bc('0x53')]({},_0x2d1dc6,_0x4f760c[_0x36bc('0x5c')]);return _0x968d09[_0x36bc('0x89')](_0x2d1dc6);}})[_0x36bc('0x38')](function(_0xc094c3){if(_0xc094c3){_0xb368e6=_0xc094c3[_0x36bc('0x4c')];if(!_0x4f760c[_0x36bc('0x47')][_0x36bc('0x4d')](_0x36bc('0x4e'))){_0x2d1dc6[_0x36bc('0x31')]=qs[_0x36bc('0x31')](_0x4f760c['query'][_0x36bc('0x31')]);_0x2d1dc6[_0x36bc('0x30')]=qs[_0x36bc('0x30')](_0x4f760c[_0x36bc('0x47')][_0x36bc('0x30')]);}return _0x968d09['getApplications'](_0x2d1dc6);}})[_0x36bc('0x38')](function(_0x1d6cb0){if(_0x1d6cb0){return _0x1d6cb0?{'count':_0xb368e6,'rows':_0x1d6cb0}:null;}})[_0x36bc('0x38')](respondWithResult(_0x1286ce,null))[_0x36bc('0x58')](handleError(_0x1286ce,null));};function Extension(_0x5e79b4,_0x2707f3,_0x5e5ba7,_0x41e431){this[_0x36bc('0x8a')]=_0x36bc('0x8b');this[_0x36bc('0x8c')]=_0x5e79b4[_0x36bc('0x8d')];this[_0x36bc('0x8e')]=_0x41e431;this[_0x36bc('0x44')]=_0x36bc('0x8f');this[_0x36bc('0x90')]='Fax\x20Extension';this['FaxAccountId']=_0x5e79b4['id'];this[_0x36bc('0x86')]=_0x2707f3;this[_0x36bc('0x91')]=_0x5e5ba7;}function createExtensionsReciveFax(_0x2782c9){var _0x3717f7=0x1;var _0x140ab8=[];_0x140ab8[_0x36bc('0x92')](new Extension(_0x2782c9,_0x3717f7,'',_0x36bc('0x93')));_0x3717f7+=0x1;_0x140ab8['push'](new Extension(_0x2782c9,_0x3717f7,_0x36bc('0x94'),_0x36bc('0x95')));_0x3717f7+=0x1;for(var _0x13c896 in _0x2782c9){if(_0x2782c9[_0x36bc('0x4d')](_0x13c896)&&(_0x13c896===_0x36bc('0x96')||_0x13c896===_0x36bc('0x8d')||_0x13c896===_0x36bc('0x97')||_0x13c896==='faxdetect'||_0x13c896===_0x36bc('0x98')||_0x13c896===_0x36bc('0x99')||_0x13c896===_0x36bc('0x9a')||_0x13c896===_0x36bc('0x9b')||_0x13c896===_0x36bc('0x9c'))){_0x140ab8[_0x36bc('0x92')](new Extension(_0x2782c9,_0x3717f7,'FAXOPT('+_0x13c896+')='+_0x2782c9[_0x13c896],_0x36bc('0x95')));_0x3717f7+=0x1;}}_0x140ab8[_0x36bc('0x92')](new Extension(_0x2782c9,_0x3717f7,'6',_0x36bc('0x9d')));_0x3717f7+=0x1;_0x140ab8['push'](new Extension(_0x2782c9,_0x3717f7,_0x36bc('0x9e'),'ReceiveFax'));_0x3717f7=0x0;return _0x140ab8;}exports[_0x36bc('0x9f')]=function(_0x12a52a,_0x122596,_0x4797d7){var _0x33a660;return db[_0x36bc('0x7e')][_0x36bc('0x7f')](function(_0x5caf57){return db['FaxAccount'][_0x36bc('0x5e')](_0x12a52a['body'],{'transaction':_0x5caf57})[_0x36bc('0x38')](function(_0x2642db){_0x33a660=_0x2642db[_0x36bc('0x60')]({'plain':!![]});return db[_0x36bc('0xa0')][_0x36bc('0x84')](createExtensionsReciveFax(_0x33a660),{'transaction':_0x5caf57});});})['then'](function(){return _0x33a660;})['then'](respondWithResult(_0x122596,null))['catch'](handleError(_0x122596,null));};exports[_0x36bc('0xa1')]=function(_0xda5067,_0x21f537,_0x1decb0){var _0x39ff46;return db[_0x36bc('0x7e')]['transaction'](function(_0x2cda4d){return db[_0x36bc('0x41')][_0x36bc('0x37')](_0xda5067['body'],{'where':{'id':_0xda5067[_0x36bc('0x5f')]['id']},'transaction':_0x2cda4d})['then'](function(_0x27021b){return db[_0x36bc('0xa0')][_0x36bc('0x39')]({'where':{'FaxAccountId':_0xda5067[_0x36bc('0x5f')]['id']},'transaction':_0x2cda4d})[_0x36bc('0x38')](function(_0x436c36){return db[_0x36bc('0xa0')][_0x36bc('0x84')](createExtensionsReciveFax(_['omit'](_0xda5067[_0x36bc('0x5f')],[_0x36bc('0xa2'),_0x36bc('0x45'),_0x36bc('0xa3'),_0x36bc('0xa4'),_0x36bc('0xa5'),_0x36bc('0xa6')])),{'transaction':_0x2cda4d});});});})[_0x36bc('0x38')](function(){return db[_0x36bc('0x41')][_0x36bc('0xa7')](_0xda5067[_0x36bc('0x5f')]['id']);})[_0x36bc('0x38')](respondWithResult(_0x21f537,null))[_0x36bc('0x58')](handleError(_0x21f537,null));};exports[_0x36bc('0xa8')]=function(_0x1f53a0,_0x5e1d29,_0x2057fc){var _0x1c4cd6={'raw':!![],'where':{}};var _0x3c6742={};var _0x4bf59c={'count':0x0,'rows':[]};return db[_0x36bc('0x41')][_0x36bc('0x6a')]({'where':{'id':_0x1f53a0['params']['id']}})[_0x36bc('0x38')](handleEntityNotFound(_0x5e1d29,null))['then'](function(_0x355b47){if(_0x355b47){_0x3c6742['model']=_[_0x36bc('0x48')](db[_0x36bc('0xa9')][_0x36bc('0x42')]);_0x3c6742[_0x36bc('0x47')]=_[_0x36bc('0x48')](_0x1f53a0[_0x36bc('0x47')]);_0x3c6742[_0x36bc('0x52')]=_[_0x36bc('0x49')](_0x3c6742[_0x36bc('0x46')],_0x3c6742['query']);_0x1c4cd6[_0x36bc('0x4a')]=_[_0x36bc('0x49')](_0x3c6742[_0x36bc('0x46')],qs[_0x36bc('0x4b')](_0x1f53a0[_0x36bc('0x47')][_0x36bc('0x4b')]));_0x1c4cd6[_0x36bc('0x4a')]=_0x1c4cd6['attributes'][_0x36bc('0x4c')]?_0x1c4cd6[_0x36bc('0x4a')]:_0x3c6742[_0x36bc('0x46')];if(!_0x1f53a0['query'][_0x36bc('0x4d')](_0x36bc('0x4e'))){_0x1c4cd6['limit']=qs[_0x36bc('0x31')](_0x1f53a0[_0x36bc('0x47')][_0x36bc('0x31')]);_0x1c4cd6[_0x36bc('0x30')]=qs['offset'](_0x1f53a0['query'][_0x36bc('0x30')]);}_0x1c4cd6[_0x36bc('0x4f')]=qs['sort'](_0x1f53a0[_0x36bc('0x47')][_0x36bc('0x50')]);_0x1c4cd6[_0x36bc('0x55')]=qs['filters'](_['pick'](_0x1f53a0[_0x36bc('0x47')],_0x3c6742[_0x36bc('0x52')]));_0x1c4cd6[_0x36bc('0x55')][_0x36bc('0x68')]=_0x355b47['id'];if(_0x1f53a0[_0x36bc('0x47')][_0x36bc('0x6c')]){_0x1c4cd6[_0x36bc('0x55')]=_[_0x36bc('0x53')](_0x1c4cd6['where'],{'$or':_['map'](_0x1c4cd6['attributes'],function(_0x44c88b){var _0x33970a={};_0x33970a[_0x44c88b]={'$like':'%'+_0x1f53a0[_0x36bc('0x47')][_0x36bc('0x6c')]+'%'};return _0x33970a;})});}if(_0x1f53a0[_0x36bc('0x47')][_0x36bc('0xaa')]){var _0x32c6b1=_0x1f53a0[_0x36bc('0x47')][_0x36bc('0xaa')]['split'](',');var _0x412508={};_0x412508[_0x32c6b1[0x0]]={'$gte':moment(_0x32c6b1[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1c4cd6[_0x36bc('0x55')]=_['merge'](_0x1c4cd6['where'],_0x412508);}_0x1c4cd6=_[_0x36bc('0x53')]({},_0x1c4cd6,_0x1f53a0['options']);return db[_0x36bc('0xa9')][_0x36bc('0x33')]({'where':_0x1c4cd6[_0x36bc('0x55')]})['then'](function(_0x5ad3f8){_0x4bf59c[_0x36bc('0x33')]=_0x5ad3f8;if(_0x1f53a0['query'][_0x36bc('0x56')]){_0x1c4cd6[_0x36bc('0x5b')]=[{'all':!![]}];}return db[_0x36bc('0xa9')][_0x36bc('0x6d')](_0x1c4cd6);})[_0x36bc('0x38')](function(_0x2ce326){_0x4bf59c[_0x36bc('0x57')]=_0x2ce326;return _0x4bf59c;});}})[_0x36bc('0x38')](respondWithFilteredResult(_0x5e1d29,_0x1c4cd6))[_0x36bc('0x58')](handleError(_0x5e1d29,null));};exports[_0x36bc('0x88')]=function(_0x538092,_0x3eb46f,_0x57b0d4){var _0x214f64,_0x21ab3b={},_0x2975fd;if(_0x538092[_0x36bc('0x5f')]['to']){_0x2975fd=_0x538092[_0x36bc('0x5f')]['to'][0x0];}return db['FaxAccount'][_0x36bc('0x5d')]({'where':{'id':_0x538092[_0x36bc('0x59')]['id']},'include':[{'model':db[_0x36bc('0xab')],'as':_0x36bc('0xac'),'include':[{'model':db['CmContact'],'as':_0x36bc('0xad'),'where':{'fax':_0x2975fd},'limit':0x1,'order':[[_0x36bc('0xa4'),'DESC']]}]}]})[_0x36bc('0x38')](handleEntityNotFound(_0x3eb46f,null))[_0x36bc('0x38')](function(_0xdfd443){_0x214f64=_0xdfd443;if(_0x538092[_0x36bc('0x5f')]['attachments']&&_0x538092['body']['attachments']['length']){for(var _0x212a9b=0x0;_0x212a9b<_0x538092['body'][_0x36bc('0xae')][_0x36bc('0x4c')];_0x212a9b+=0x1){_0x538092[_0x36bc('0x5f')][_0x36bc('0xae')][_0x212a9b]={'filename':_0x538092[_0x36bc('0x5f')][_0x36bc('0xae')][_0x212a9b][_0x36bc('0x3d')],'id':_0x538092['body'][_0x36bc('0xae')][_0x212a9b]['id'],'path':path[_0x36bc('0xaf')](config[_0x36bc('0xb0')],_0x36bc('0xb1'),_0x538092['body'][_0x36bc('0xae')][_0x212a9b]['basename'])};}}return respondWithRpcPromise(_0x36bc('0xb2'),_0x36bc('0xb2'),{'FaxAccountId':_[_0x36bc('0xb3')](_0x538092[_0x36bc('0x59')]['id'])?undefined:_0x538092[_0x36bc('0x59')]['id'],'path':_[_0x36bc('0xb3')](_0x538092[_0x36bc('0x5f')]['attachments'][0x0][_0x36bc('0x8')])?undefined:_0x538092['body'][_0x36bc('0xae')][0x0][_0x36bc('0x8')],'fax':_[_0x36bc('0xb3')](_0x538092[_0x36bc('0x5f')]['to'][0x0])?undefined:_0x538092['body']['to'][0x0]},client9002);})[_0x36bc('0x38')](function(){if(_0x214f64){if(_['isNil'](_0x538092[_0x36bc('0x5f')][_0x36bc('0xb4')])){_0x538092[_0x36bc('0x5f')][_0x36bc('0xb4')]=util[_0x36bc('0xb5')](_0x36bc('0xb6'),_0x214f64[_0x36bc('0x3d')],_0x214f64[_0x36bc('0xb7')]);}if(_0x214f64[_0x36bc('0xac')]){if(_0x214f64['List'][_0x36bc('0xad')]['length']){return _0x214f64[_0x36bc('0xac')][_0x36bc('0xad')][0x0];}else{return db['CmContact'][_0x36bc('0x5e')](_[_0x36bc('0x1a')](_0x538092['body'],{'firstName':_0x538092[_0x36bc('0x5f')]['to'][0x0],'phone':_0x538092[_0x36bc('0x5f')]['to'][0x0],'fax':_0x538092[_0x36bc('0x5f')]['to'][0x0],'ListId':_0x214f64[_0x36bc('0xa6')]}));}}else{throw new Error(_0x36bc('0xb8'));}}else{throw new Error(_0x36bc('0xb9'));}})[_0x36bc('0x38')](function(_0x4bb25f){if(_0x4bb25f){return db[_0x36bc('0x7c')]['find']({'where':{'ContactId':_0x4bb25f['id'],'closed':![],'FaxAccountId':_0x214f64['id']}})[_0x36bc('0x38')](function(_0xc23d0b){if(_0xc23d0b){return[_0xc23d0b,![]];}return db[_0x36bc('0x7c')]['create']({'UserId':_0x538092[_0x36bc('0x62')]['id'],'ContactId':_0x4bb25f['id'],'FaxAccountId':_0x214f64['id'],'fax':_0x538092[_0x36bc('0x5f')]['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0x538092['body'],{'read':![],'body':_0x538092[_0x36bc('0x5f')][_0x36bc('0xae')][0x0][_0x36bc('0xba')],'FaxAccountId':_0x214f64['id'],'UserId':_0x538092['user']['id'],'ContactId':_0x4bb25f['id'],'AttachmentId':_0x538092[_0x36bc('0x5f')][_0x36bc('0xae')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x36bc('0xbb')}]})[_0x36bc('0x38')](function(_0x2ccb25){return[_0x2ccb25,!![]];});});}else{throw new Error(_0x36bc('0xbc'));}})[_0x36bc('0xbd')](function(_0x45e0b7,_0x539612){if(_0x539612){return _0x45e0b7;}return db[_0x36bc('0xa9')]['create']({'direction':'out','read':![],'body':_0x538092[_0x36bc('0x5f')][_0x36bc('0xae')][0x0]['filename'],'FaxAccountId':_0x214f64['id'],'FaxInteractionId':_0x45e0b7['id'],'UserId':_0x538092[_0x36bc('0x62')]['id'],'ContactId':_0x45e0b7[_0x36bc('0xbe')],'AttachmentId':_0x538092[_0x36bc('0x5f')][_0x36bc('0xae')][0x0]['id']})[_0x36bc('0x38')](function(_0x430163){_0x45e0b7[_0x36bc('0xbf')][_0x36bc('0xbb')]=[];_0x45e0b7[_0x36bc('0xbf')][_0x36bc('0xbb')][_0x36bc('0x92')](_0x430163[_0x36bc('0xbf')]);return _0x45e0b7;});})[_0x36bc('0x38')](function(_0x486454){respondWithRpcPromise(_0x36bc('0xc0'),'SendFax',{'FaxAccountId':_['isNil'](_0x538092[_0x36bc('0x59')]['id'])?undefined:_0x538092[_0x36bc('0x59')]['id'],'path':_['isNil'](_0x538092[_0x36bc('0x5f')][_0x36bc('0xae')][0x0][_0x36bc('0x8')])?undefined:_0x538092[_0x36bc('0x5f')][_0x36bc('0xae')][0x0][_0x36bc('0x8')],'fax':_[_0x36bc('0xb3')](_0x538092[_0x36bc('0x5f')]['to'][0x0])?undefined:_0x538092[_0x36bc('0x5f')]['to'][0x0],'AttachmentId':_0x538092[_0x36bc('0x5f')][_0x36bc('0xae')][0x0]['id']},client9002)['then'](function(_0x21093d){logger[_0x36bc('0x23')](_0x36bc('0xc1'),_0x21093d);})[_0x36bc('0x58')](function(_0x23ebf8){logger['info'](_0x36bc('0xc1'),_0x23ebf8);});return _0x486454;})[_0x36bc('0x38')](respondWithResult(_0x3eb46f,null))[_0x36bc('0x58')](handleError(_0x3eb46f,null));};exports[_0x36bc('0xc2')]=function(_0x3a6b10,_0x30d47c,_0x2a6391){return db[_0x36bc('0x41')][_0x36bc('0x5d')]({'where':{'id':_0x3a6b10[_0x36bc('0x59')]['id']}})['then'](handleEntityNotFound(_0x30d47c,null))[_0x36bc('0x38')](function(_0x301466){if(_0x301466){return _0x301466['addAgents'](_0x3a6b10['body']['ids'],_['omit'](_0x3a6b10[_0x36bc('0x5f')],['ids','id'])||{})[_0x36bc('0xbd')](function(_0x50f975){for(var _0x4cefd1=0x0;_0x4cefd1<_0x3a6b10[_0x36bc('0x5f')][_0x36bc('0x6f')][_0x36bc('0x4c')];_0x4cefd1+=0x1){socket[_0x36bc('0xc3')](_0x36bc('0xc4'),{'UserId':Number(_0x3a6b10[_0x36bc('0x5f')][_0x36bc('0x6f')][_0x4cefd1]),'FaxAccountId':Number(_0x3a6b10[_0x36bc('0x59')]['id'])});}return _0x50f975;});}})['then'](respondWithResult(_0x30d47c,null))[_0x36bc('0x58')](handleError(_0x30d47c,null));};exports[_0x36bc('0xc5')]=function(_0x5b41a8,_0xc60cb6,_0xf897da){return db[_0x36bc('0x41')][_0x36bc('0x5d')]({'where':{'id':_0x5b41a8[_0x36bc('0x59')]['id']}})[_0x36bc('0x38')](handleEntityNotFound(_0xc60cb6,null))[_0x36bc('0x38')](function(_0x42d4d8){if(_0x42d4d8){return _0x42d4d8[_0x36bc('0xc5')](_0x5b41a8[_0x36bc('0x47')][_0x36bc('0x6f')])[_0x36bc('0x38')](function(){if(_[_0x36bc('0xc6')](_0x5b41a8[_0x36bc('0x47')]['ids'])){for(var _0x254885=0x0;_0x254885<_0x5b41a8['query'][_0x36bc('0x6f')][_0x36bc('0x4c')];_0x254885+=0x1){socket['emit'](_0x36bc('0xc7'),{'UserId':Number(_0x5b41a8[_0x36bc('0x47')][_0x36bc('0x6f')][_0x254885]),'FaxAccountId':Number(_0x5b41a8[_0x36bc('0x59')]['id'])});}}else{socket[_0x36bc('0xc3')](_0x36bc('0xc7'),{'UserId':Number(_0x5b41a8[_0x36bc('0x47')][_0x36bc('0x6f')]),'FaxAccountId':Number(_0x5b41a8[_0x36bc('0x59')]['id'])});}});}})[_0x36bc('0x38')](respondWithStatusCode(_0xc60cb6,null))['catch'](handleError(_0xc60cb6,null));};exports[_0x36bc('0xc8')]=function(_0x48a279,_0x5ebd38,_0x167104){var _0x16cde8={};var _0x2233ce={};var _0x5d58ec;var _0x3b0c6c;return db[_0x36bc('0x41')][_0x36bc('0x6a')]({'where':{'id':_0x48a279[_0x36bc('0x59')]['id']}})[_0x36bc('0x38')](handleEntityNotFound(_0x5ebd38,null))['then'](function(_0x1a0158){if(_0x1a0158){_0x5d58ec=_0x1a0158;_0x2233ce[_0x36bc('0x46')]=_['keys'](db[_0x36bc('0x76')][_0x36bc('0x42')]);_0x2233ce[_0x36bc('0x47')]=_[_0x36bc('0x48')](_0x48a279[_0x36bc('0x47')]);_0x2233ce[_0x36bc('0x52')]=_['intersection'](_0x2233ce['model'],_0x2233ce[_0x36bc('0x47')]);_0x16cde8['attributes']=_[_0x36bc('0x49')](_0x2233ce[_0x36bc('0x46')],qs['fields'](_0x48a279[_0x36bc('0x47')][_0x36bc('0x4b')]));_0x16cde8[_0x36bc('0x4a')]=_0x16cde8['attributes']['length']?_0x16cde8['attributes']:_0x2233ce[_0x36bc('0x46')];_0x16cde8['order']=qs[_0x36bc('0x50')](_0x48a279['query'][_0x36bc('0x50')]);_0x16cde8[_0x36bc('0x55')]=qs[_0x36bc('0x52')](_[_0x36bc('0x51')](_0x48a279['query'],_0x2233ce['filters']));if(_0x48a279['query'][_0x36bc('0x6c')]){_0x16cde8[_0x36bc('0x55')]=_['merge'](_0x16cde8[_0x36bc('0x55')],{'$or':_['map'](_0x16cde8[_0x36bc('0x4a')],function(_0x87418b){var _0x5be20e={};_0x5be20e[_0x87418b]={'$like':'%'+_0x48a279[_0x36bc('0x47')][_0x36bc('0x6c')]+'%'};return _0x5be20e;})});}_0x16cde8=_[_0x36bc('0x53')]({},_0x16cde8,_0x48a279['options']);return _0x5d58ec[_0x36bc('0xc8')](_0x16cde8);}})[_0x36bc('0x38')](function(_0x563279){if(_0x563279){_0x3b0c6c=_0x563279[_0x36bc('0x4c')];if(!_0x48a279['query'][_0x36bc('0x4d')]('nolimit')){_0x16cde8[_0x36bc('0x31')]=qs[_0x36bc('0x31')](_0x48a279[_0x36bc('0x47')][_0x36bc('0x31')]);_0x16cde8['offset']=qs[_0x36bc('0x30')](_0x48a279[_0x36bc('0x47')][_0x36bc('0x30')]);}return _0x5d58ec[_0x36bc('0xc8')](_0x16cde8);}})[_0x36bc('0x38')](function(_0x872cef){if(_0x872cef){return _0x872cef?{'count':_0x3b0c6c,'rows':_0x872cef}:null;}})[_0x36bc('0x38')](respondWithResult(_0x5ebd38,null))[_0x36bc('0x58')](handleError(_0x5ebd38,null));};
\ No newline at end of file
+var _0x694e=['update','params','describe','addDisposition','getDispositions','findOne','Disposition','hasOwnProperty','pick','removeDispositions','addAnswer','FaxAccountId','CannedAnswer','getAnswers','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','CmContact','User','Owner','fullname','Tag','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','priority','finally','getApplications','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','appdata','push','Answer','Set','ecm','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','ReceiveFax','addAccountApplications','updateAccountApplications','VoiceExtension','updatedAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','format','List','Contacts','DESC','attachments','root','server/files/attachments','CheckAfterSend','isNil','from','fax','ListId','List\x20not\x20found','Send\x20Fax\x20failed','out','Contact\x20not\x20found','spread','filename','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','removeAgents','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','destroy','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','merge','filter','includeAll','findAll','rows','show','length','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x5627fa,_0x13c478){var _0x4b3543=function(_0x2bf958){while(--_0x2bf958){_0x5627fa['push'](_0x5627fa['shift']());}};_0x4b3543(++_0x13c478);}(_0x694e,0x11e));var _0xe694=function(_0x213444,_0x53ea3b){_0x213444=_0x213444-0x0;var _0x5add8b=_0x694e[_0x213444];return _0x5add8b;};'use strict';var emlformat=require(_0xe694('0x0'));var rimraf=require(_0xe694('0x1'));var zipdir=require(_0xe694('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe694('0x3'));var moment=require(_0xe694('0x4'));var BPromise=require(_0xe694('0x5'));var Mustache=require(_0xe694('0x6'));var util=require(_0xe694('0x7'));var path=require(_0xe694('0x8'));var sox=require(_0xe694('0x9'));var csv=require(_0xe694('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe694('0xb'));var crypto=require('crypto');var jsforce=require(_0xe694('0xc'));var deskjs=require(_0xe694('0xd'));var toCsv=require(_0xe694('0xa'));var querystring=require(_0xe694('0xe'));var Papa=require(_0xe694('0xf'));var Redis=require(_0xe694('0x10'));var authService=require(_0xe694('0x11'));var qs=require(_0xe694('0x12'));var as=require(_0xe694('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe694('0x14'));var utils=require(_0xe694('0x15'));var config=require(_0xe694('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe694('0x17'))['db'];config[_0xe694('0x18')]=_[_0xe694('0x19')](config[_0xe694('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe694('0x18')]));require(_0xe694('0x1a'))[_0xe694('0x1b')](socket);var jayson=require(_0xe694('0x1c'));var client=jayson[_0xe694('0x1d')][_0xe694('0x1e')]({'port':0x232c});var client9002=jayson[_0xe694('0x1d')][_0xe694('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4eba41,_0x3335e0,_0x318949,_0xa8576f){return new BPromise(function(_0xcf250a,_0x49e5f3){var _0x1e6915=_0xa8576f||client;return _0x1e6915[_0xe694('0x1f')](_0x4eba41,_0x318949)[_0xe694('0x20')](function(_0x270be8){logger[_0xe694('0x21')](_0xe694('0x22'),_0x3335e0,_0xe694('0x23'));logger[_0xe694('0x24')](_0xe694('0x25'),_0x3335e0,_0xe694('0x23'),JSON['stringify'](_0x270be8));if(_0x270be8[_0xe694('0x26')]){if(_0x270be8[_0xe694('0x26')][_0xe694('0x27')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x3335e0,_0x270be8[_0xe694('0x26')][_0xe694('0x28')]);return _0x49e5f3(_0x270be8[_0xe694('0x26')][_0xe694('0x28')]);}logger['error'](_0xe694('0x22'),_0x3335e0,_0x270be8['error'][_0xe694('0x28')]);return _0xcf250a(_0x270be8[_0xe694('0x26')]['message']);}else{logger[_0xe694('0x21')](_0xe694('0x22'),_0x3335e0,'request\x20sent');_0xcf250a(_0x270be8[_0xe694('0x29')][_0xe694('0x28')]);}})[_0xe694('0x2a')](function(_0x249b98){logger[_0xe694('0x26')]('FaxAccount,\x20%s,\x20%s',_0x3335e0,_0x249b98);_0x49e5f3(_0x249b98);});});}function respondWithStatusCode(_0x44fbff,_0x4d8ab8){_0x4d8ab8=_0x4d8ab8||0xcc;return function(_0x50eaf1){if(_0x50eaf1){return _0x44fbff[_0xe694('0x2b')](_0x4d8ab8);}return _0x44fbff[_0xe694('0x2c')](_0x4d8ab8)[_0xe694('0x2d')]();};}function respondWithResult(_0x4274ef,_0xc7fcfd){_0xc7fcfd=_0xc7fcfd||0xc8;return function(_0x2351ee){if(_0x2351ee){return _0x4274ef[_0xe694('0x2c')](_0xc7fcfd)[_0xe694('0x2e')](_0x2351ee);}};}function respondWithFilteredResult(_0x18d319,_0x1e29ed){return function(_0x35364a){if(_0x35364a){var _0x40df68=typeof _0x1e29ed[_0xe694('0x2f')]==='undefined'&&typeof _0x1e29ed[_0xe694('0x30')]==='undefined';var _0x57a62f=_0x35364a[_0xe694('0x31')];var _0x39291d=_0x40df68?0x0:_0x1e29ed[_0xe694('0x2f')];var _0x1445e6=_0x40df68?_0x35364a[_0xe694('0x31')]:_0x1e29ed[_0xe694('0x2f')]+_0x1e29ed[_0xe694('0x30')];var _0x24e56b;if(_0x1445e6>=_0x57a62f){_0x1445e6=_0x57a62f;_0x24e56b=0xc8;}else{_0x24e56b=0xce;}_0x18d319['status'](_0x24e56b);return _0x18d319[_0xe694('0x32')](_0xe694('0x33'),_0x39291d+'-'+_0x1445e6+'/'+_0x57a62f)[_0xe694('0x2e')](_0x35364a);}return null;};}function patchUpdates(_0x3b54a5){return function(_0xd0e386){try{jsonpatch['apply'](_0xd0e386,_0x3b54a5,!![]);}catch(_0x43ecfd){return BPromise[_0xe694('0x34')](_0x43ecfd);}return _0xd0e386['save']();};}function saveUpdates(_0x130bce,_0x581a7f){return function(_0x3cf53e){if(_0x3cf53e){return _0x3cf53e['update'](_0x130bce)['then'](function(_0x4bc178){return _0x4bc178;});}return null;};}function removeEntity(_0x239ebc,_0x4ffb00){return function(_0x4b2dce){if(_0x4b2dce){return _0x4b2dce[_0xe694('0x35')]()['then'](function(){var _0x5b6d9a=_0x4b2dce['get']({'plain':!![]});var _0x54a2ab=_0xe694('0x36');return db[_0xe694('0x37')][_0xe694('0x35')]({'where':{'type':_0x54a2ab,'resourceId':_0x5b6d9a['id']}})['then'](function(){return _0x4b2dce;});})[_0xe694('0x20')](function(){_0x239ebc[_0xe694('0x2c')](0xcc)[_0xe694('0x2d')]();});}};}function handleEntityNotFound(_0x3d83e3,_0x41a53b){return function(_0x14a3fe){if(!_0x14a3fe){_0x3d83e3['sendStatus'](0x194);}return _0x14a3fe;};}function handleError(_0x33e01f,_0x43848f){_0x43848f=_0x43848f||0x1f4;return function(_0x1384ee){logger['error'](_0x1384ee[_0xe694('0x38')]);if(_0x1384ee[_0xe694('0x39')]){delete _0x1384ee[_0xe694('0x39')];}_0x33e01f[_0xe694('0x2c')](_0x43848f)[_0xe694('0x3a')](_0x1384ee);};}exports[_0xe694('0x3b')]=function(_0x2103ee,_0x7b37cb){var _0x4fd008={'include':[{'model':db[_0xe694('0x3c')],'as':_0xe694('0x3d')}]},_0x26f4e9={},_0x453e14={'count':0x0,'rows':[]};var _0x54f472=_[_0xe694('0x3e')](db[_0xe694('0x3f')][_0xe694('0x40')],function(_0x436bdb){return{'name':_0x436bdb[_0xe694('0x41')],'type':_0x436bdb[_0xe694('0x42')][_0xe694('0x43')]};});_0x26f4e9[_0xe694('0x44')]=_['map'](_0x54f472,'name');_0x26f4e9[_0xe694('0x45')]=_[_0xe694('0x46')](_0x2103ee['query']);_0x26f4e9[_0xe694('0x47')]=_[_0xe694('0x48')](_0x26f4e9[_0xe694('0x44')],_0x26f4e9[_0xe694('0x45')]);_0x4fd008[_0xe694('0x49')]=_[_0xe694('0x48')](_0x26f4e9['model'],qs['fields'](_0x2103ee['query'][_0xe694('0x4a')]));_0x4fd008[_0xe694('0x49')]=_0x4fd008['attributes']['length']?_0x4fd008[_0xe694('0x49')]:_0x26f4e9[_0xe694('0x44')];if(!_0x2103ee[_0xe694('0x45')]['hasOwnProperty'](_0xe694('0x4b'))){_0x4fd008[_0xe694('0x30')]=qs[_0xe694('0x30')](_0x2103ee[_0xe694('0x45')]['limit']);_0x4fd008[_0xe694('0x2f')]=qs['offset'](_0x2103ee[_0xe694('0x45')][_0xe694('0x2f')]);}_0x4fd008[_0xe694('0x4c')]=qs[_0xe694('0x4d')](_0x2103ee[_0xe694('0x45')][_0xe694('0x4d')]);_0x4fd008[_0xe694('0x4e')]=qs['filters'](_['pick'](_0x2103ee[_0xe694('0x45')],_0x26f4e9[_0xe694('0x47')]),_0x54f472);if(_0x2103ee[_0xe694('0x45')]['filter']){_0x4fd008[_0xe694('0x4e')]=_[_0xe694('0x4f')](_0x4fd008['where'],{'$or':_[_0xe694('0x3e')](_0x54f472,function(_0x408fd9){if(_0x408fd9['type']!=='VIRTUAL'){var _0x368ee8={};_0x368ee8[_0x408fd9[_0xe694('0x39')]]={'$like':'%'+_0x2103ee[_0xe694('0x45')][_0xe694('0x50')]+'%'};return _0x368ee8;}})});}_0x4fd008=_['merge']({},_0x4fd008,_0x2103ee['options']);var _0x15ad7b={'where':_0x4fd008[_0xe694('0x4e')]};return db[_0xe694('0x3f')][_0xe694('0x31')](_0x15ad7b)['then'](function(_0x50fac2){_0x453e14[_0xe694('0x31')]=_0x50fac2;if(_0x2103ee[_0xe694('0x45')][_0xe694('0x51')]){_0x4fd008['include']=[{'all':!![]}];}return db[_0xe694('0x3f')][_0xe694('0x52')](_0x4fd008);})[_0xe694('0x20')](function(_0x5ab9a8){_0x453e14[_0xe694('0x53')]=_0x5ab9a8;return _0x453e14;})[_0xe694('0x20')](respondWithFilteredResult(_0x7b37cb,_0x4fd008))[_0xe694('0x2a')](handleError(_0x7b37cb,null));};exports[_0xe694('0x54')]=function(_0x7f251b,_0x5c1450){var _0x5c6736={'raw':![],'where':{'id':_0x7f251b['params']['id']},'include':[{'model':db[_0xe694('0x3c')],'as':'mandatoryDispositionPause'}]},_0x48fc31={};_0x48fc31[_0xe694('0x44')]=_[_0xe694('0x46')](db[_0xe694('0x3f')][_0xe694('0x40')]);_0x48fc31[_0xe694('0x45')]=_[_0xe694('0x46')](_0x7f251b[_0xe694('0x45')]);_0x48fc31[_0xe694('0x47')]=_[_0xe694('0x48')](_0x48fc31[_0xe694('0x44')],_0x48fc31[_0xe694('0x45')]);_0x5c6736[_0xe694('0x49')]=_[_0xe694('0x48')](_0x48fc31[_0xe694('0x44')],qs['fields'](_0x7f251b['query'][_0xe694('0x4a')]));_0x5c6736[_0xe694('0x49')]=_0x5c6736[_0xe694('0x49')][_0xe694('0x55')]?_0x5c6736[_0xe694('0x49')]:_0x48fc31['model'];if(_0x7f251b[_0xe694('0x45')][_0xe694('0x51')]){_0x5c6736[_0xe694('0x56')]=[{'all':!![]}];}_0x5c6736=_['merge']({},_0x5c6736,_0x7f251b[_0xe694('0x57')]);return db[_0xe694('0x3f')][_0xe694('0x58')](_0x5c6736)[_0xe694('0x20')](handleEntityNotFound(_0x5c1450,null))[_0xe694('0x20')](respondWithResult(_0x5c1450,null))[_0xe694('0x2a')](handleError(_0x5c1450,null));};exports[_0xe694('0x59')]=function(_0xfecafe,_0x403e21){return db[_0xe694('0x3f')][_0xe694('0x59')](_0xfecafe[_0xe694('0x5a')],{})[_0xe694('0x20')](function(_0x2adefe){var _0x9d6c45=_0xfecafe[_0xe694('0x5b')][_0xe694('0x5c')]({'plain':!![]});if(!_0x9d6c45)throw new Error(_0xe694('0x5d'));if(_0x9d6c45[_0xe694('0x5e')]===_0xe694('0x5b')){var _0x370425=_0x2adefe[_0xe694('0x5c')]({'plain':!![]});var _0x365497=_0xe694('0x36');return db[_0xe694('0x5f')][_0xe694('0x58')]({'where':{'name':_0x365497,'userProfileId':_0x9d6c45['userProfileId']},'raw':!![]})['then'](function(_0x1eb7ef){if(_0x1eb7ef&&_0x1eb7ef[_0xe694('0x60')]===0x0){return db['UserProfileResource']['create']({'name':_0x370425[_0xe694('0x39')],'resourceId':_0x370425['id'],'type':_0x1eb7ef[_0xe694('0x39')],'sectionId':_0x1eb7ef['id']},{})[_0xe694('0x20')](function(){return _0x2adefe;});}else{return _0x2adefe;}})[_0xe694('0x2a')](function(_0x5c56b6){logger[_0xe694('0x26')](_0xe694('0x61'),_0x5c56b6);throw _0x5c56b6;});}return _0x2adefe;})[_0xe694('0x20')](respondWithResult(_0x403e21,0xc9))[_0xe694('0x2a')](handleError(_0x403e21,null));};exports[_0xe694('0x62')]=function(_0x1abb37,_0x274948){if(_0x1abb37[_0xe694('0x5a')]['id']){delete _0x1abb37['body']['id'];}return db[_0xe694('0x3f')]['find']({'where':{'id':_0x1abb37['params']['id']},'include':[{'model':db['Pause'],'as':_0xe694('0x3d')}]})[_0xe694('0x20')](handleEntityNotFound(_0x274948,null))[_0xe694('0x20')](saveUpdates(_0x1abb37['body'],null))[_0xe694('0x20')](respondWithResult(_0x274948,null))[_0xe694('0x2a')](handleError(_0x274948,null));};exports[_0xe694('0x35')]=function(_0x3f0853,_0x100ba5){return db[_0xe694('0x3f')][_0xe694('0x58')]({'where':{'id':_0x3f0853[_0xe694('0x63')]['id']}})[_0xe694('0x20')](handleEntityNotFound(_0x100ba5,null))[_0xe694('0x20')](removeEntity(_0x100ba5,null))[_0xe694('0x2a')](handleError(_0x100ba5,null));};exports[_0xe694('0x64')]=function(_0x310d52,_0x1c3842){return db[_0xe694('0x3f')]['describe']()[_0xe694('0x20')](respondWithResult(_0x1c3842,null))['catch'](handleError(_0x1c3842,null));};exports[_0xe694('0x65')]=function(_0x432117,_0xc76b24,_0x3708b6){if(_0x432117[_0xe694('0x5a')]['id']){delete _0x432117[_0xe694('0x5a')]['id'];}return db[_0xe694('0x3f')][_0xe694('0x58')]({'where':{'id':_0x432117[_0xe694('0x63')]['id']}})[_0xe694('0x20')](handleEntityNotFound(_0xc76b24,null))['then'](function(_0xa2135b){if(_0xa2135b){_0x432117['body']['FaxAccountId']=_0xa2135b['id'];return db['Disposition'][_0xe694('0x59')](_0x432117[_0xe694('0x5a')]);}})[_0xe694('0x20')](respondWithResult(_0xc76b24,null))[_0xe694('0x2a')](handleError(_0xc76b24,null));};exports[_0xe694('0x66')]=function(_0x139a5,_0x59c328,_0x53b654){var _0x1ee2c5={'raw':![],'where':{}};var _0x8b58ec={};var _0x2b6d24={'count':0x0,'rows':[]};return db[_0xe694('0x3f')][_0xe694('0x67')]({'where':{'id':_0x139a5[_0xe694('0x63')]['id']}})[_0xe694('0x20')](handleEntityNotFound(_0x59c328,null))[_0xe694('0x20')](function(_0x11b70a){if(_0x11b70a){_0x8b58ec['model']=_[_0xe694('0x46')](db[_0xe694('0x68')][_0xe694('0x40')]);_0x8b58ec['query']=_['keys'](_0x139a5[_0xe694('0x45')]);_0x8b58ec[_0xe694('0x47')]=_['intersection'](_0x8b58ec[_0xe694('0x44')],_0x8b58ec[_0xe694('0x45')]);_0x1ee2c5['attributes']=_[_0xe694('0x48')](_0x8b58ec[_0xe694('0x44')],qs[_0xe694('0x4a')](_0x139a5['query'][_0xe694('0x4a')]));_0x1ee2c5[_0xe694('0x49')]=_0x1ee2c5[_0xe694('0x49')][_0xe694('0x55')]?_0x1ee2c5[_0xe694('0x49')]:_0x8b58ec[_0xe694('0x44')];if(!_0x139a5['query'][_0xe694('0x69')](_0xe694('0x4b'))){_0x1ee2c5[_0xe694('0x30')]=qs['limit'](_0x139a5['query']['limit']);_0x1ee2c5[_0xe694('0x2f')]=qs[_0xe694('0x2f')](_0x139a5['query'][_0xe694('0x2f')]);}_0x1ee2c5[_0xe694('0x4c')]=qs[_0xe694('0x4d')](_0x139a5[_0xe694('0x45')][_0xe694('0x4d')]);_0x1ee2c5[_0xe694('0x4e')]=qs[_0xe694('0x47')](_[_0xe694('0x6a')](_0x139a5[_0xe694('0x45')],_0x8b58ec[_0xe694('0x47')]));_0x1ee2c5['where']['FaxAccountId']=_0x11b70a['id'];if(_0x139a5['query']['filter']){_0x1ee2c5['where']=_['merge'](_0x1ee2c5['where'],{'$or':_[_0xe694('0x3e')](_0x1ee2c5[_0xe694('0x49')],function(_0x20f06c){var _0xb9c531={};_0xb9c531[_0x20f06c]={'$like':'%'+_0x139a5['query'][_0xe694('0x50')]+'%'};return _0xb9c531;})});}_0x1ee2c5=_[_0xe694('0x4f')]({},_0x1ee2c5,_0x139a5[_0xe694('0x57')]);return db['Disposition']['count']({'where':_0x1ee2c5[_0xe694('0x4e')]})['then'](function(_0x1f853a){_0x2b6d24[_0xe694('0x31')]=_0x1f853a;if(_0x139a5[_0xe694('0x45')]['includeAll']){_0x1ee2c5[_0xe694('0x56')]=[{'all':!![]}];}return db[_0xe694('0x68')][_0xe694('0x52')](_0x1ee2c5);})['then'](function(_0x4dbc1a){_0x2b6d24[_0xe694('0x53')]=_0x4dbc1a;return _0x2b6d24;});}})[_0xe694('0x20')](respondWithFilteredResult(_0x59c328,_0x1ee2c5))['catch'](handleError(_0x59c328,null));};exports[_0xe694('0x6b')]=function(_0x4db64b,_0x18abd0,_0x409b8a){return db[_0xe694('0x3f')][_0xe694('0x58')]({'where':{'id':_0x4db64b['params']['id']}})[_0xe694('0x20')](handleEntityNotFound(_0x18abd0,null))[_0xe694('0x20')](function(_0x507954){if(_0x507954){return _0x507954[_0xe694('0x6b')](_0x4db64b[_0xe694('0x45')]['ids']);}})[_0xe694('0x20')](respondWithStatusCode(_0x18abd0,null))[_0xe694('0x2a')](handleError(_0x18abd0,null));};exports[_0xe694('0x6c')]=function(_0x2f760e,_0x4fc75b,_0x12a974){if(_0x2f760e['body']['id']){delete _0x2f760e['body']['id'];}return db[_0xe694('0x3f')][_0xe694('0x58')]({'where':{'id':_0x2f760e[_0xe694('0x63')]['id']}})[_0xe694('0x20')](handleEntityNotFound(_0x4fc75b,null))['then'](function(_0x396317){if(_0x396317){_0x2f760e[_0xe694('0x5a')][_0xe694('0x6d')]=_0x396317['id'];return db[_0xe694('0x6e')][_0xe694('0x59')](_0x2f760e[_0xe694('0x5a')]);}})[_0xe694('0x20')](respondWithResult(_0x4fc75b,null))['catch'](handleError(_0x4fc75b,null));};exports[_0xe694('0x6f')]=function(_0x417918,_0x5868f1,_0x14cf66){var _0x588e42={'raw':![],'where':{}};var _0x206852={};var _0x3d61a3={'count':0x0,'rows':[]};return db[_0xe694('0x3f')]['findOne']({'where':{'id':_0x417918['params']['id']}})['then'](handleEntityNotFound(_0x5868f1,null))['then'](function(_0x49e639){if(_0x49e639){_0x206852[_0xe694('0x44')]=_[_0xe694('0x46')](db['CannedAnswer'][_0xe694('0x40')]);_0x206852[_0xe694('0x45')]=_['keys'](_0x417918['query']);_0x206852[_0xe694('0x47')]=_['intersection'](_0x206852['model'],_0x206852['query']);_0x588e42[_0xe694('0x49')]=_[_0xe694('0x48')](_0x206852[_0xe694('0x44')],qs[_0xe694('0x4a')](_0x417918[_0xe694('0x45')][_0xe694('0x4a')]));_0x588e42[_0xe694('0x49')]=_0x588e42[_0xe694('0x49')][_0xe694('0x55')]?_0x588e42[_0xe694('0x49')]:_0x206852[_0xe694('0x44')];if(!_0x417918[_0xe694('0x45')][_0xe694('0x69')]('nolimit')){_0x588e42[_0xe694('0x30')]=qs[_0xe694('0x30')](_0x417918['query'][_0xe694('0x30')]);_0x588e42['offset']=qs[_0xe694('0x2f')](_0x417918[_0xe694('0x45')][_0xe694('0x2f')]);}_0x588e42[_0xe694('0x4c')]=qs['sort'](_0x417918[_0xe694('0x45')][_0xe694('0x4d')]);_0x588e42[_0xe694('0x4e')]=qs[_0xe694('0x47')](_[_0xe694('0x6a')](_0x417918[_0xe694('0x45')],_0x206852['filters']));_0x588e42[_0xe694('0x4e')]['FaxAccountId']=_0x49e639['id'];if(_0x417918[_0xe694('0x45')][_0xe694('0x50')]){_0x588e42[_0xe694('0x4e')]=_['merge'](_0x588e42[_0xe694('0x4e')],{'$or':_[_0xe694('0x3e')](_0x588e42[_0xe694('0x49')],function(_0x266002){var _0xdf6d01={};_0xdf6d01[_0x266002]={'$like':'%'+_0x417918[_0xe694('0x45')][_0xe694('0x50')]+'%'};return _0xdf6d01;})});}_0x588e42=_['merge']({},_0x588e42,_0x417918[_0xe694('0x57')]);return db[_0xe694('0x6e')]['count']({'where':_0x588e42[_0xe694('0x4e')]})[_0xe694('0x20')](function(_0x41a9c7){_0x3d61a3[_0xe694('0x31')]=_0x41a9c7;if(_0x417918[_0xe694('0x45')][_0xe694('0x51')]){_0x588e42['include']=[{'all':!![]}];}return db[_0xe694('0x6e')][_0xe694('0x52')](_0x588e42);})[_0xe694('0x20')](function(_0x79c510){_0x3d61a3['rows']=_0x79c510;return _0x3d61a3;});}})[_0xe694('0x20')](respondWithFilteredResult(_0x5868f1,_0x588e42))['catch'](handleError(_0x5868f1,null));};exports[_0xe694('0x70')]=function(_0x4705b2,_0xaf0775,_0x2bbcb5){return db[_0xe694('0x3f')][_0xe694('0x58')]({'where':{'id':_0x4705b2[_0xe694('0x63')]['id']}})[_0xe694('0x20')](handleEntityNotFound(_0xaf0775,null))[_0xe694('0x20')](function(_0x37a86d){if(_0x37a86d){return _0x37a86d[_0xe694('0x70')](_0x4705b2['query'][_0xe694('0x71')]);}})[_0xe694('0x20')](respondWithStatusCode(_0xaf0775,null))[_0xe694('0x2a')](handleError(_0xaf0775,null));};exports[_0xe694('0x72')]=function(_0x377d2c,_0x3bd0a6,_0xb6311){return db[_0xe694('0x73')][_0xe694('0x58')]({'where':{'id':_0x377d2c[_0xe694('0x63')]['id']}})[_0xe694('0x20')](handleEntityNotFound(_0x3bd0a6,null))[_0xe694('0x20')](function(_0x53823e){if(_0x53823e){return _0x53823e[_0xe694('0x72')](_0x377d2c['body']['ids'],_[_0xe694('0x74')](_0x377d2c[_0xe694('0x5a')],[_0xe694('0x71'),'id'])||{});}})[_0xe694('0x20')](respondWithResult(_0x3bd0a6,null))[_0xe694('0x2a')](handleError(_0x3bd0a6,null));};exports[_0xe694('0x75')]=function(_0x25fdeb,_0x2cf357,_0x2a5f0a){var _0x1d6d37={'raw':![],'where':{}};var _0x34102e={};var _0x280f0b={'count':0x0,'rows':[]};return db[_0xe694('0x3f')][_0xe694('0x67')]({'where':{'id':_0x25fdeb[_0xe694('0x63')]['id']}})[_0xe694('0x20')](handleEntityNotFound(_0x2cf357,null))[_0xe694('0x20')](function(_0x5863e7){if(_0x5863e7){_0x34102e[_0xe694('0x44')]=_[_0xe694('0x46')](db['FaxInteraction'][_0xe694('0x40')]);_0x34102e[_0xe694('0x45')]=_[_0xe694('0x46')](_0x25fdeb['query']);_0x34102e['filters']=_[_0xe694('0x48')](_0x34102e[_0xe694('0x44')],_0x34102e[_0xe694('0x45')]);_0x1d6d37[_0xe694('0x49')]=_['intersection'](_0x34102e[_0xe694('0x44')],qs[_0xe694('0x4a')](_0x25fdeb[_0xe694('0x45')][_0xe694('0x4a')]));_0x1d6d37['attributes']=_0x1d6d37[_0xe694('0x49')][_0xe694('0x55')]?_0x1d6d37['attributes']:_0x34102e[_0xe694('0x44')];if(!_0x25fdeb[_0xe694('0x45')][_0xe694('0x69')](_0xe694('0x4b'))){_0x1d6d37[_0xe694('0x30')]=qs[_0xe694('0x30')](_0x25fdeb[_0xe694('0x45')][_0xe694('0x30')]);_0x1d6d37['offset']=qs[_0xe694('0x2f')](_0x25fdeb['query']['offset']);}_0x1d6d37[_0xe694('0x4c')]=qs[_0xe694('0x4d')](_0x25fdeb['query']['sort']);_0x1d6d37[_0xe694('0x4e')]=qs[_0xe694('0x47')](_['pick'](_0x25fdeb['query'],_0x34102e[_0xe694('0x47')]));_0x1d6d37[_0xe694('0x4e')][_0xe694('0x6d')]=_0x5863e7['id'];if(_0x25fdeb[_0xe694('0x45')][_0xe694('0x50')]){_0x1d6d37[_0xe694('0x4e')]=_[_0xe694('0x4f')](_0x1d6d37[_0xe694('0x4e')],{'$or':_[_0xe694('0x3e')](_0x1d6d37[_0xe694('0x49')],function(_0x4abdb3){var _0x110e70={};_0x110e70[_0x4abdb3]={'$like':'%'+_0x25fdeb['query'][_0xe694('0x50')]+'%'};return _0x110e70;})});}_0x1d6d37=_[_0xe694('0x4f')]({},_0x1d6d37,_0x25fdeb[_0xe694('0x57')]);return db['FaxInteraction'][_0xe694('0x31')]({'where':_0x1d6d37[_0xe694('0x4e')]})[_0xe694('0x20')](function(_0x362770){_0x280f0b[_0xe694('0x31')]=_0x362770;if(_0x25fdeb[_0xe694('0x45')][_0xe694('0x51')]){_0x1d6d37[_0xe694('0x56')]=[{'model':db[_0xe694('0x76')],'as':'Contact','required':![]},{'model':db[_0xe694('0x77')],'as':_0xe694('0x78'),'attributes':[_0xe694('0x39'),_0xe694('0x79'),'internal'],'required':![]},{'model':db[_0xe694('0x7a')],'as':'Tags','attributes':['id',_0xe694('0x39'),'color'],'where':_0x25fdeb[_0xe694('0x45')][_0xe694('0x7b')]?{'id':_0x25fdeb[_0xe694('0x45')][_0xe694('0x7b')]}:undefined,'required':_0x25fdeb[_0xe694('0x45')][_0xe694('0x7b')]?!![]:![]}];}return db[_0xe694('0x73')][_0xe694('0x52')](_0x1d6d37);})[_0xe694('0x20')](function(_0x752041){_0x280f0b[_0xe694('0x53')]=_0x752041;return _0x280f0b;});}})['then'](respondWithFilteredResult(_0x2cf357,_0x1d6d37))[_0xe694('0x2a')](handleError(_0x2cf357,null));};exports[_0xe694('0x7c')]=function(_0x459cdc,_0x1b77ff){var _0x1deeef=_0x459cdc[_0xe694('0x63')]['id'];var _0x13d1db=_0x459cdc[_0xe694('0x5a')];var _0x251a53=0xc8;var _0x304ee2=null;return db[_0xe694('0x7d')][_0xe694('0x7e')]({'isolationLevel':db['sequelize']['Transaction'][_0xe694('0x7f')][_0xe694('0x80')]},function(_0x27cfef){return db['FaxAccount']['findOne']({'where':{'id':_0x1deeef},'transaction':_0x27cfef})[_0xe694('0x20')](function(_0x44ccef){if(_0x44ccef){return db['FaxApplication'][_0xe694('0x35')]({'where':{'FaxAccountId':_0x1deeef},'transaction':_0x27cfef})[_0xe694('0x20')](function(){var _0x52b8a9=_[_0xe694('0x3e')](_0x13d1db,function(_0x524bca){_0x524bca[_0xe694('0x6d')]=_0x1deeef;return _0x524bca;});return db[_0xe694('0x81')][_0xe694('0x82')](_0x52b8a9,{'transaction':_0x27cfef});});}else{_0x251a53=0x194;_0x304ee2=[];}});})[_0xe694('0x20')](function(){if(_0x251a53!==0x194){return db[_0xe694('0x81')]['findAndCountAll']({'where':{'FaxAccountId':_0x1deeef},'order':_0xe694('0x83')})['then'](function(_0x235bc4){_0x304ee2=_0x235bc4;});}})[_0xe694('0x2a')](function(_0x20a847){_0x251a53=0x1f4;logger[_0xe694('0x26')](_0x20a847[_0xe694('0x38')]);if(_0x20a847['name']){delete _0x20a847[_0xe694('0x39')];}_0x304ee2=_0x20a847;})[_0xe694('0x84')](function(){if(_0x304ee2===null){_0x1b77ff[_0xe694('0x2b')](_0x251a53);}else{if(_0x251a53===0x1f4){_0x1b77ff['status'](_0x251a53)[_0xe694('0x3a')](_0x304ee2);}else{_0x1b77ff[_0xe694('0x2c')](_0x251a53)[_0xe694('0x2e')](_0x304ee2);}}});};exports[_0xe694('0x85')]=function(_0x5115d5,_0x5955fe,_0x212c4a){var _0x2bc25e={};var _0x5e2fb9={};var _0x171491;var _0x34a732;return db[_0xe694('0x3f')][_0xe694('0x67')]({'where':{'id':_0x5115d5[_0xe694('0x63')]['id']}})[_0xe694('0x20')](handleEntityNotFound(_0x5955fe,null))[_0xe694('0x20')](function(_0xccb6a7){if(_0xccb6a7){_0x171491=_0xccb6a7;_0x5e2fb9[_0xe694('0x44')]=_[_0xe694('0x46')](db[_0xe694('0x81')]['rawAttributes']);_0x5e2fb9[_0xe694('0x45')]=_[_0xe694('0x46')](_0x5115d5['query']);_0x5e2fb9[_0xe694('0x47')]=_[_0xe694('0x48')](_0x5e2fb9[_0xe694('0x44')],_0x5e2fb9[_0xe694('0x45')]);_0x2bc25e[_0xe694('0x49')]=_[_0xe694('0x48')](_0x5e2fb9[_0xe694('0x44')],qs[_0xe694('0x4a')](_0x5115d5[_0xe694('0x45')][_0xe694('0x4a')]));_0x2bc25e['attributes']=_0x2bc25e[_0xe694('0x49')]['length']?_0x2bc25e[_0xe694('0x49')]:_0x5e2fb9[_0xe694('0x44')];_0x2bc25e[_0xe694('0x4c')]=qs['sort'](_0x5115d5[_0xe694('0x45')][_0xe694('0x4d')]);_0x2bc25e[_0xe694('0x4e')]=qs[_0xe694('0x47')](_[_0xe694('0x6a')](_0x5115d5[_0xe694('0x45')],_0x5e2fb9[_0xe694('0x47')]));if(_0x5115d5[_0xe694('0x45')]['filter']){_0x2bc25e['where']=_['merge'](_0x2bc25e['where'],{'$or':_[_0xe694('0x3e')](_0x2bc25e[_0xe694('0x49')],function(_0x57f963){var _0x2a6828={};_0x2a6828[_0x57f963]={'$like':'%'+_0x5115d5[_0xe694('0x45')][_0xe694('0x50')]+'%'};return _0x2a6828;})});}_0x2bc25e=_['merge']({},_0x2bc25e,_0x5115d5[_0xe694('0x57')]);return _0x171491[_0xe694('0x85')](_0x2bc25e);}})[_0xe694('0x20')](function(_0x3271f6){if(_0x3271f6){_0x34a732=_0x3271f6[_0xe694('0x55')];if(!_0x5115d5['query'][_0xe694('0x69')](_0xe694('0x4b'))){_0x2bc25e[_0xe694('0x30')]=qs[_0xe694('0x30')](_0x5115d5[_0xe694('0x45')]['limit']);_0x2bc25e[_0xe694('0x2f')]=qs[_0xe694('0x2f')](_0x5115d5['query']['offset']);}return _0x171491[_0xe694('0x85')](_0x2bc25e);}})[_0xe694('0x20')](function(_0x2256eb){if(_0x2256eb){return _0x2256eb?{'count':_0x34a732,'rows':_0x2256eb}:null;}})[_0xe694('0x20')](respondWithResult(_0x5955fe,null))[_0xe694('0x2a')](handleError(_0x5955fe,null));};function Extension(_0x397d84,_0x3e70fd,_0x24cd19,_0x240900){this['context']=_0xe694('0x86');this[_0xe694('0x87')]=_0x397d84[_0xe694('0x88')];this[_0xe694('0x89')]=_0x240900;this[_0xe694('0x42')]=_0xe694('0x8a');this[_0xe694('0x8b')]=_0xe694('0x8c');this[_0xe694('0x6d')]=_0x397d84['id'];this[_0xe694('0x83')]=_0x3e70fd;this[_0xe694('0x8d')]=_0x24cd19;}function createExtensionsReciveFax(_0x247d19){var _0x59d8ed=0x1;var _0x1590cf=[];_0x1590cf[_0xe694('0x8e')](new Extension(_0x247d19,_0x59d8ed,'',_0xe694('0x8f')));_0x59d8ed+=0x1;_0x1590cf['push'](new Extension(_0x247d19,_0x59d8ed,'CDR(type)=inbound-fax',_0xe694('0x90')));_0x59d8ed+=0x1;for(var _0x160d42 in _0x247d19){if(_0x247d19['hasOwnProperty'](_0x160d42)&&(_0x160d42===_0xe694('0x91')||_0x160d42==='localstationid'||_0x160d42==='gateway'||_0x160d42===_0xe694('0x92')||_0x160d42===_0xe694('0x93')||_0x160d42===_0xe694('0x94')||_0x160d42===_0xe694('0x95')||_0x160d42===_0xe694('0x96')||_0x160d42===_0xe694('0x97'))){_0x1590cf['push'](new Extension(_0x247d19,_0x59d8ed,_0xe694('0x98')+_0x160d42+')='+_0x247d19[_0x160d42],'Set'));_0x59d8ed+=0x1;}}_0x1590cf['push'](new Extension(_0x247d19,_0x59d8ed,'6',_0xe694('0x99')));_0x59d8ed+=0x1;_0x1590cf[_0xe694('0x8e')](new Extension(_0x247d19,_0x59d8ed,'/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',_0xe694('0x9a')));_0x59d8ed=0x0;return _0x1590cf;}exports[_0xe694('0x9b')]=function(_0x1bc8ad,_0x58a527,_0x33d330){var _0x53ecf3;return db[_0xe694('0x7d')][_0xe694('0x7e')](function(_0x2cb48d){return db['FaxAccount'][_0xe694('0x59')](_0x1bc8ad['body'],{'transaction':_0x2cb48d})['then'](function(_0x3b62e6){_0x53ecf3=_0x3b62e6['get']({'plain':!![]});return db['VoiceExtension'][_0xe694('0x82')](createExtensionsReciveFax(_0x53ecf3),{'transaction':_0x2cb48d});});})[_0xe694('0x20')](function(){return _0x53ecf3;})[_0xe694('0x20')](respondWithResult(_0x58a527,null))[_0xe694('0x2a')](handleError(_0x58a527,null));};exports[_0xe694('0x9c')]=function(_0x14b86f,_0x4008dc,_0x37732a){var _0x2bba9e;return db[_0xe694('0x7d')][_0xe694('0x7e')](function(_0x3fd7c4){return db[_0xe694('0x3f')][_0xe694('0x62')](_0x14b86f[_0xe694('0x5a')],{'where':{'id':_0x14b86f[_0xe694('0x5a')]['id']},'transaction':_0x3fd7c4})[_0xe694('0x20')](function(_0x53f922){return db[_0xe694('0x9d')]['destroy']({'where':{'FaxAccountId':_0x14b86f[_0xe694('0x5a')]['id']},'transaction':_0x3fd7c4})[_0xe694('0x20')](function(_0x1d2263){return db[_0xe694('0x9d')][_0xe694('0x82')](createExtensionsReciveFax(_[_0xe694('0x74')](_0x14b86f['body'],['tech',_0xe694('0x43'),'createdAt',_0xe694('0x9e'),_0xe694('0x9f'),'ListId'])),{'transaction':_0x3fd7c4});});});})[_0xe694('0x20')](function(){return db[_0xe694('0x3f')][_0xe694('0xa0')](_0x14b86f['body']['id']);})['then'](respondWithResult(_0x4008dc,null))[_0xe694('0x2a')](handleError(_0x4008dc,null));};exports[_0xe694('0xa1')]=function(_0x20db90,_0x42cfd8,_0x34e43e){var _0x2ca310={'raw':!![],'where':{}};var _0x3f8fbb={};var _0x2b85c6={'count':0x0,'rows':[]};return db[_0xe694('0x3f')][_0xe694('0x67')]({'where':{'id':_0x20db90[_0xe694('0x63')]['id']}})[_0xe694('0x20')](handleEntityNotFound(_0x42cfd8,null))[_0xe694('0x20')](function(_0x3e4391){if(_0x3e4391){_0x3f8fbb['model']=_['keys'](db[_0xe694('0xa2')]['rawAttributes']);_0x3f8fbb[_0xe694('0x45')]=_[_0xe694('0x46')](_0x20db90[_0xe694('0x45')]);_0x3f8fbb[_0xe694('0x47')]=_[_0xe694('0x48')](_0x3f8fbb[_0xe694('0x44')],_0x3f8fbb[_0xe694('0x45')]);_0x2ca310[_0xe694('0x49')]=_[_0xe694('0x48')](_0x3f8fbb[_0xe694('0x44')],qs[_0xe694('0x4a')](_0x20db90[_0xe694('0x45')]['fields']));_0x2ca310[_0xe694('0x49')]=_0x2ca310[_0xe694('0x49')][_0xe694('0x55')]?_0x2ca310[_0xe694('0x49')]:_0x3f8fbb[_0xe694('0x44')];if(!_0x20db90['query'][_0xe694('0x69')](_0xe694('0x4b'))){_0x2ca310[_0xe694('0x30')]=qs[_0xe694('0x30')](_0x20db90[_0xe694('0x45')][_0xe694('0x30')]);_0x2ca310[_0xe694('0x2f')]=qs[_0xe694('0x2f')](_0x20db90[_0xe694('0x45')][_0xe694('0x2f')]);}_0x2ca310[_0xe694('0x4c')]=qs[_0xe694('0x4d')](_0x20db90['query']['sort']);_0x2ca310[_0xe694('0x4e')]=qs[_0xe694('0x47')](_[_0xe694('0x6a')](_0x20db90[_0xe694('0x45')],_0x3f8fbb[_0xe694('0x47')]));_0x2ca310[_0xe694('0x4e')][_0xe694('0x6d')]=_0x3e4391['id'];if(_0x20db90[_0xe694('0x45')][_0xe694('0x50')]){_0x2ca310[_0xe694('0x4e')]=_['merge'](_0x2ca310[_0xe694('0x4e')],{'$or':_[_0xe694('0x3e')](_0x2ca310['attributes'],function(_0x4ccdcc){var _0x1683d8={};_0x1683d8[_0x4ccdcc]={'$like':'%'+_0x20db90[_0xe694('0x45')][_0xe694('0x50')]+'%'};return _0x1683d8;})});}if(_0x20db90['query'][_0xe694('0xa3')]){var _0x3ebeb2=_0x20db90['query'][_0xe694('0xa3')][_0xe694('0xa4')](',');var _0xd3624={};_0xd3624[_0x3ebeb2[0x0]]={'$gte':moment(_0x3ebeb2[0x1])[_0xe694('0xa5')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2ca310[_0xe694('0x4e')]=_['merge'](_0x2ca310[_0xe694('0x4e')],_0xd3624);}_0x2ca310=_[_0xe694('0x4f')]({},_0x2ca310,_0x20db90['options']);return db[_0xe694('0xa2')][_0xe694('0x31')]({'where':_0x2ca310[_0xe694('0x4e')]})[_0xe694('0x20')](function(_0x5e30ee){_0x2b85c6['count']=_0x5e30ee;if(_0x20db90[_0xe694('0x45')][_0xe694('0x51')]){_0x2ca310[_0xe694('0x56')]=[{'all':!![]}];}return db[_0xe694('0xa2')][_0xe694('0x52')](_0x2ca310);})['then'](function(_0x213a20){_0x2b85c6['rows']=_0x213a20;return _0x2b85c6;});}})[_0xe694('0x20')](respondWithFilteredResult(_0x42cfd8,_0x2ca310))[_0xe694('0x2a')](handleError(_0x42cfd8,null));};exports[_0xe694('0x3a')]=function(_0x4204ae,_0x5d138b,_0x311b9d){var _0x22dffd,_0x2db891={},_0xb36c65;if(_0x4204ae[_0xe694('0x5a')]['to']){_0xb36c65=_0x4204ae[_0xe694('0x5a')]['to'][0x0];}return db[_0xe694('0x3f')][_0xe694('0x58')]({'where':{'id':_0x4204ae[_0xe694('0x63')]['id']},'include':[{'model':db['CmList'],'as':_0xe694('0xa6'),'include':[{'model':db[_0xe694('0x76')],'as':_0xe694('0xa7'),'where':{'fax':_0xb36c65},'limit':0x1,'order':[[_0xe694('0x9e'),_0xe694('0xa8')]]}]}]})[_0xe694('0x20')](handleEntityNotFound(_0x5d138b,null))[_0xe694('0x20')](function(_0x198620){_0x22dffd=_0x198620;if(_0x4204ae[_0xe694('0x5a')][_0xe694('0xa9')]&&_0x4204ae['body'][_0xe694('0xa9')]['length']){for(var _0x8f6c71=0x0;_0x8f6c71<_0x4204ae['body'][_0xe694('0xa9')][_0xe694('0x55')];_0x8f6c71+=0x1){_0x4204ae['body'][_0xe694('0xa9')][_0x8f6c71]={'filename':_0x4204ae[_0xe694('0x5a')]['attachments'][_0x8f6c71][_0xe694('0x39')],'id':_0x4204ae[_0xe694('0x5a')][_0xe694('0xa9')][_0x8f6c71]['id'],'path':path['join'](config[_0xe694('0xaa')],_0xe694('0xab'),_0x4204ae[_0xe694('0x5a')][_0xe694('0xa9')][_0x8f6c71]['basename'])};}}return respondWithRpcPromise(_0xe694('0xac'),'CheckAfterSend',{'FaxAccountId':_[_0xe694('0xad')](_0x4204ae[_0xe694('0x63')]['id'])?undefined:_0x4204ae[_0xe694('0x63')]['id'],'path':_['isNil'](_0x4204ae[_0xe694('0x5a')][_0xe694('0xa9')][0x0]['path'])?undefined:_0x4204ae[_0xe694('0x5a')][_0xe694('0xa9')][0x0]['path'],'fax':_[_0xe694('0xad')](_0x4204ae['body']['to'][0x0])?undefined:_0x4204ae['body']['to'][0x0]},client9002);})[_0xe694('0x20')](function(){if(_0x22dffd){if(_[_0xe694('0xad')](_0x4204ae[_0xe694('0x5a')][_0xe694('0xae')])){_0x4204ae[_0xe694('0x5a')][_0xe694('0xae')]=util[_0xe694('0xa5')]('\x22%s\x22\x20<%s>',_0x22dffd[_0xe694('0x39')],_0x22dffd[_0xe694('0xaf')]);}if(_0x22dffd[_0xe694('0xa6')]){if(_0x22dffd[_0xe694('0xa6')][_0xe694('0xa7')][_0xe694('0x55')]){return _0x22dffd[_0xe694('0xa6')]['Contacts'][0x0];}else{return db['CmContact']['create'](_[_0xe694('0x19')](_0x4204ae[_0xe694('0x5a')],{'firstName':_0x4204ae['body']['to'][0x0],'phone':_0x4204ae[_0xe694('0x5a')]['to'][0x0],'fax':_0x4204ae[_0xe694('0x5a')]['to'][0x0],'ListId':_0x22dffd[_0xe694('0xb0')]}));}}else{throw new Error(_0xe694('0xb1'));}}else{throw new Error(_0xe694('0xb2'));}})[_0xe694('0x20')](function(_0x1a654d){if(_0x1a654d){return db[_0xe694('0x73')][_0xe694('0x58')]({'where':{'ContactId':_0x1a654d['id'],'closed':![],'FaxAccountId':_0x22dffd['id']}})['then'](function(_0x4ddbfb){if(_0x4ddbfb){return[_0x4ddbfb,![]];}return db['FaxInteraction']['create']({'UserId':_0x4204ae['user']['id'],'ContactId':_0x1a654d['id'],'FaxAccountId':_0x22dffd['id'],'fax':_0x4204ae[_0xe694('0x5a')]['to'][0x0],'firstMsgDirection':_0xe694('0xb3'),'Messages':[_[_0xe694('0x4f')](_0x4204ae[_0xe694('0x5a')],{'read':![],'body':_0x4204ae['body'][_0xe694('0xa9')][0x0]['filename'],'FaxAccountId':_0x22dffd['id'],'UserId':_0x4204ae[_0xe694('0x5b')]['id'],'ContactId':_0x1a654d['id'],'AttachmentId':_0x4204ae[_0xe694('0x5a')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xe694('0xa2')],'as':'Messages'}]})[_0xe694('0x20')](function(_0x1b801f){return[_0x1b801f,!![]];});});}else{throw new Error(_0xe694('0xb4'));}})[_0xe694('0xb5')](function(_0x4b24d2,_0x57d96b){if(_0x57d96b){return _0x4b24d2;}return db['FaxMessage'][_0xe694('0x59')]({'direction':'out','read':![],'body':_0x4204ae[_0xe694('0x5a')]['attachments'][0x0][_0xe694('0xb6')],'FaxAccountId':_0x22dffd['id'],'FaxInteractionId':_0x4b24d2['id'],'UserId':_0x4204ae[_0xe694('0x5b')]['id'],'ContactId':_0x4b24d2['ContactId'],'AttachmentId':_0x4204ae['body'][_0xe694('0xa9')][0x0]['id']})[_0xe694('0x20')](function(_0x2d078b){_0x4b24d2[_0xe694('0xb7')]['Messages']=[];_0x4b24d2['dataValues'][_0xe694('0xb8')][_0xe694('0x8e')](_0x2d078b[_0xe694('0xb7')]);return _0x4b24d2;});})[_0xe694('0x20')](function(_0x262843){respondWithRpcPromise('SendFax',_0xe694('0xb9'),{'FaxAccountId':_[_0xe694('0xad')](_0x4204ae['params']['id'])?undefined:_0x4204ae[_0xe694('0x63')]['id'],'path':_[_0xe694('0xad')](_0x4204ae[_0xe694('0x5a')][_0xe694('0xa9')][0x0][_0xe694('0x8')])?undefined:_0x4204ae[_0xe694('0x5a')][_0xe694('0xa9')][0x0][_0xe694('0x8')],'fax':_[_0xe694('0xad')](_0x4204ae[_0xe694('0x5a')]['to'][0x0])?undefined:_0x4204ae[_0xe694('0x5a')]['to'][0x0],'AttachmentId':_0x4204ae[_0xe694('0x5a')]['attachments'][0x0]['id']},client9002)['then'](function(_0x15972f){logger['info'](_0xe694('0xba'),_0x15972f);})['catch'](function(_0x169595){logger[_0xe694('0x21')](_0xe694('0xba'),_0x169595);});return _0x262843;})[_0xe694('0x20')](respondWithResult(_0x5d138b,null))[_0xe694('0x2a')](handleError(_0x5d138b,null));};exports['addAgents']=function(_0x23c73d,_0x37c26f,_0x531f3f){return db[_0xe694('0x3f')][_0xe694('0x58')]({'where':{'id':_0x23c73d['params']['id']}})['then'](handleEntityNotFound(_0x37c26f,null))[_0xe694('0x20')](function(_0x4c24da){if(_0x4c24da){return _0x4c24da[_0xe694('0xbb')](_0x23c73d[_0xe694('0x5a')][_0xe694('0x71')],_[_0xe694('0x74')](_0x23c73d[_0xe694('0x5a')],[_0xe694('0x71'),'id'])||{})['spread'](function(_0x2573a3){for(var _0x576e54=0x0;_0x576e54<_0x23c73d['body'][_0xe694('0x71')][_0xe694('0x55')];_0x576e54+=0x1){socket['emit']('userFaxAccount:save',{'UserId':Number(_0x23c73d['body'][_0xe694('0x71')][_0x576e54]),'FaxAccountId':Number(_0x23c73d[_0xe694('0x63')]['id'])});}return _0x2573a3;});}})[_0xe694('0x20')](respondWithResult(_0x37c26f,null))['catch'](handleError(_0x37c26f,null));};exports[_0xe694('0xbc')]=function(_0x204a74,_0x47995b,_0x5e1521){return db[_0xe694('0x3f')][_0xe694('0x58')]({'where':{'id':_0x204a74[_0xe694('0x63')]['id']}})[_0xe694('0x20')](handleEntityNotFound(_0x47995b,null))[_0xe694('0x20')](function(_0x41241f){if(_0x41241f){return _0x41241f[_0xe694('0xbc')](_0x204a74[_0xe694('0x45')][_0xe694('0x71')])[_0xe694('0x20')](function(){if(_['isArray'](_0x204a74[_0xe694('0x45')][_0xe694('0x71')])){for(var _0x429e76=0x0;_0x429e76<_0x204a74[_0xe694('0x45')][_0xe694('0x71')][_0xe694('0x55')];_0x429e76+=0x1){socket[_0xe694('0xbd')](_0xe694('0xbe'),{'UserId':Number(_0x204a74[_0xe694('0x45')][_0xe694('0x71')][_0x429e76]),'FaxAccountId':Number(_0x204a74[_0xe694('0x63')]['id'])});}}else{socket[_0xe694('0xbd')]('userFaxAccount:remove',{'UserId':Number(_0x204a74[_0xe694('0x45')][_0xe694('0x71')]),'FaxAccountId':Number(_0x204a74[_0xe694('0x63')]['id'])});}});}})[_0xe694('0x20')](respondWithStatusCode(_0x47995b,null))[_0xe694('0x2a')](handleError(_0x47995b,null));};exports['getAgents']=function(_0x5a48b4,_0x2eefa4,_0x4f2f30){var _0x20493f={};var _0x2ded56={};var _0x36e26c;var _0x1a745b;return db['FaxAccount']['findOne']({'where':{'id':_0x5a48b4[_0xe694('0x63')]['id']}})['then'](handleEntityNotFound(_0x2eefa4,null))[_0xe694('0x20')](function(_0x2b8449){if(_0x2b8449){_0x36e26c=_0x2b8449;_0x2ded56['model']=_[_0xe694('0x46')](db[_0xe694('0x77')][_0xe694('0x40')]);_0x2ded56[_0xe694('0x45')]=_['keys'](_0x5a48b4[_0xe694('0x45')]);_0x2ded56[_0xe694('0x47')]=_['intersection'](_0x2ded56[_0xe694('0x44')],_0x2ded56['query']);_0x20493f[_0xe694('0x49')]=_[_0xe694('0x48')](_0x2ded56[_0xe694('0x44')],qs['fields'](_0x5a48b4[_0xe694('0x45')][_0xe694('0x4a')]));_0x20493f['attributes']=_0x20493f[_0xe694('0x49')][_0xe694('0x55')]?_0x20493f['attributes']:_0x2ded56[_0xe694('0x44')];_0x20493f[_0xe694('0x4c')]=qs[_0xe694('0x4d')](_0x5a48b4[_0xe694('0x45')][_0xe694('0x4d')]);_0x20493f[_0xe694('0x4e')]=qs[_0xe694('0x47')](_[_0xe694('0x6a')](_0x5a48b4[_0xe694('0x45')],_0x2ded56[_0xe694('0x47')]));if(_0x5a48b4['query'][_0xe694('0x50')]){_0x20493f[_0xe694('0x4e')]=_[_0xe694('0x4f')](_0x20493f[_0xe694('0x4e')],{'$or':_[_0xe694('0x3e')](_0x20493f['attributes'],function(_0x3f56e5){var _0x54c16c={};_0x54c16c[_0x3f56e5]={'$like':'%'+_0x5a48b4[_0xe694('0x45')]['filter']+'%'};return _0x54c16c;})});}_0x20493f=_[_0xe694('0x4f')]({},_0x20493f,_0x5a48b4[_0xe694('0x57')]);return _0x36e26c['getAgents'](_0x20493f);}})[_0xe694('0x20')](function(_0x33690f){if(_0x33690f){_0x1a745b=_0x33690f[_0xe694('0x55')];if(!_0x5a48b4[_0xe694('0x45')][_0xe694('0x69')](_0xe694('0x4b'))){_0x20493f[_0xe694('0x30')]=qs[_0xe694('0x30')](_0x5a48b4[_0xe694('0x45')][_0xe694('0x30')]);_0x20493f[_0xe694('0x2f')]=qs[_0xe694('0x2f')](_0x5a48b4[_0xe694('0x45')][_0xe694('0x2f')]);}return _0x36e26c[_0xe694('0xbf')](_0x20493f);}})[_0xe694('0x20')](function(_0x17fbc2){if(_0x17fbc2){return _0x17fbc2?{'count':_0x1a745b,'rows':_0x17fbc2}:null;}})[_0xe694('0x20')](respondWithResult(_0x2eefa4,null))[_0xe694('0x2a')](handleError(_0x2eefa4,null));};
\ No newline at end of file
index 0543859..30fde28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf380=['setMaxListeners','update','remove','emit','hook','exports','../../mysqldb'];(function(_0xab9f3d,_0xb336fa){var _0x5283bf=function(_0x505e6c){while(--_0x505e6c){_0xab9f3d['push'](_0xab9f3d['shift']());}};_0x5283bf(++_0xb336fa);}(_0xf380,0x1bf));var _0x0f38=function(_0x5441ab,_0x1b4d07){_0x5441ab=_0x5441ab-0x0;var _0x3acae8=_0xf380[_0x5441ab];return _0x3acae8;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x0f38('0x0'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x0f38('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0f38('0x2'),'afterDestroy':_0x0f38('0x3')};function emitEvent(_0x3ba9d3){return function(_0x1110c6,_0x4352a6,_0x24e289){FaxAccountEvents[_0x0f38('0x4')](_0x3ba9d3+':'+_0x1110c6['id'],_0x1110c6);FaxAccountEvents[_0x0f38('0x4')](_0x3ba9d3,_0x1110c6);_0x24e289(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x0f38('0x5')](e,emitEvent(event));}}module[_0x0f38('0x6')]=FaxAccountEvents;
\ No newline at end of file
+var _0x4d4a=['emit','hasOwnProperty','hook','exports','../../mysqldb','FaxAccount','setMaxListeners','save','update'];(function(_0x26f38f,_0x4e1859){var _0x856a95=function(_0x9feff9){while(--_0x9feff9){_0x26f38f['push'](_0x26f38f['shift']());}};_0x856a95(++_0x4e1859);}(_0x4d4a,0x124));var _0xa4d4=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4d4a[_0x21a9d9];return _0x46adce;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xa4d4('0x0'))['db'][_0xa4d4('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xa4d4('0x2')](0x0);var events={'afterCreate':_0xa4d4('0x3'),'afterUpdate':_0xa4d4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5a132b){return function(_0x5ddfe6,_0x675735,_0x111963){FaxAccountEvents[_0xa4d4('0x5')](_0x5a132b+':'+_0x5ddfe6['id'],_0x5ddfe6);FaxAccountEvents['emit'](_0x5a132b,_0x5ddfe6);_0x111963(null);};}for(var e in events){if(events[_0xa4d4('0x6')](e)){var event=events[e];FaxAccount[_0xa4d4('0x7')](e,emitEvent(event));}}module[_0xa4d4('0x8')]=FaxAccountEvents;
\ No newline at end of file
index 7118537..bec112b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94f1=['api','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','fax_accounts','lodash','util','../../config/logger'];(function(_0x4d23ee,_0x1f8c29){var _0x324211=function(_0x149f6b){while(--_0x149f6b){_0x4d23ee['push'](_0x4d23ee['shift']());}};_0x324211(++_0x1f8c29);}(_0x94f1,0x105));var _0x194f=function(_0x24371d,_0x4614a6){_0x24371d=_0x24371d-0x0;var _0x31fbdb=_0x94f1[_0x24371d];return _0x31fbdb;};'use strict';var _=require(_0x194f('0x0'));var util=require(_0x194f('0x1'));var logger=require(_0x194f('0x2'))(_0x194f('0x3'));var moment=require('moment');var BPromise=require(_0x194f('0x4'));var rp=require(_0x194f('0x5'));var fs=require('fs');var path=require(_0x194f('0x6'));var rimraf=require(_0x194f('0x7'));var config=require(_0x194f('0x8'));var attributes=require(_0x194f('0x9'));module[_0x194f('0xa')]=function(_0x5e93d5,_0x10483a){return _0x5e93d5['define']('FaxAccount',attributes,{'tableName':_0x194f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe6fd=['api','bluebird','request-promise','path','rimraf','./faxAccount.attributes','exports','fax_accounts','lodash','util','../../config/logger'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xe6fd,0x189));var _0xde6f=function(_0x13eb18,_0x2039c1){_0x13eb18=_0x13eb18-0x0;var _0x5e7639=_0xe6fd[_0x13eb18];return _0x5e7639;};'use strict';var _=require(_0xde6f('0x0'));var util=require(_0xde6f('0x1'));var logger=require(_0xde6f('0x2'))(_0xde6f('0x3'));var moment=require('moment');var BPromise=require(_0xde6f('0x4'));var rp=require(_0xde6f('0x5'));var fs=require('fs');var path=require(_0xde6f('0x6'));var rimraf=require(_0xde6f('0x7'));var config=require('../../config/environment');var attributes=require(_0xde6f('0x8'));module[_0xde6f('0x9')]=function(_0x1e8e0b,_0x3f914b){return _0x1e8e0b['define']('FaxAccount',attributes,{'tableName':_0xde6f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9ddaf19..9fda976 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb347=['mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','Applications','account','list','List','applications','orderBy','priority','create','FaxInteraction','find','Contact\x20not\x20found','spread','get','autoclose','push','length','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','UserId','name','interaction','unshift','agent','waitForTheAssignedAgent','Start','startRouting','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','info','catch','FaxAccount','findAll','options','raw','attributes','include','map','model','GetFaxAccount','NotifyFaxAccount','body','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xb347,0xd9));var _0x7b34=function(_0x5cb7a3,_0x5c9998){_0x5cb7a3=_0x5cb7a3-0x0;var _0x5a2a55=_0xb347[_0x5cb7a3];return _0x5a2a55;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7b34('0x0'));var fs=require('fs');var Redis=require(_0x7b34('0x1'));var db=require(_0x7b34('0x2'))['db'];var utils=require(_0x7b34('0x3'));var logger=require(_0x7b34('0x4'))(_0x7b34('0x5'));var config=require(_0x7b34('0x6'));var jayson=require(_0x7b34('0x7'));var client=jayson[_0x7b34('0x8')]['http']({'port':0x232c});config['redis']=_[_0x7b34('0x9')](config[_0x7b34('0xa')],{'host':_0x7b34('0xb'),'port':0x18eb});var socket=require(_0x7b34('0xc'))(new Redis(config[_0x7b34('0xa')]));require(_0x7b34('0xd'))[_0x7b34('0xe')](socket);function respondWithRpcPromise(_0x398d0c,_0x5226ca,_0x30c99f){return new BPromise(function(_0x4b5cfd,_0x1b3659){return client[_0x7b34('0xf')](_0x398d0c,_0x30c99f)[_0x7b34('0x10')](function(_0x12c78f){logger['info']('FaxAccount,\x20%s,\x20%s',_0x5226ca,_0x7b34('0x11'));logger[_0x7b34('0x12')](_0x7b34('0x13'),_0x5226ca,_0x7b34('0x11'),JSON[_0x7b34('0x14')](_0x12c78f));if(_0x12c78f[_0x7b34('0x15')]){if(_0x12c78f[_0x7b34('0x15')][_0x7b34('0x16')]===0x1f4){logger[_0x7b34('0x15')](_0x7b34('0x17'),_0x5226ca,_0x12c78f['error'][_0x7b34('0x18')]);return _0x1b3659(_0x12c78f[_0x7b34('0x15')][_0x7b34('0x18')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x5226ca,_0x12c78f['error']['message']);return _0x4b5cfd(_0x12c78f[_0x7b34('0x15')][_0x7b34('0x18')]);}else{logger[_0x7b34('0x19')](_0x7b34('0x17'),_0x5226ca,_0x7b34('0x11'));_0x4b5cfd(_0x12c78f['result']['message']);}})[_0x7b34('0x1a')](function(_0x53d24d){logger[_0x7b34('0x15')](_0x7b34('0x17'),_0x5226ca,_0x53d24d);_0x1b3659(_0x53d24d);});});}exports['GetFaxAccount']=function(_0x29a672){var _0x403160=this;return new Promise(function(_0x500e2c,_0x20a380){return db[_0x7b34('0x1b')][_0x7b34('0x1c')]({'raw':_0x29a672[_0x7b34('0x1d')]?_0x29a672['options'][_0x7b34('0x1e')]===undefined?!![]:![]:!![],'where':_0x29a672['options']?_0x29a672['options']['where']||null:null,'attributes':_0x29a672[_0x7b34('0x1d')]?_0x29a672[_0x7b34('0x1d')][_0x7b34('0x1f')]||null:null,'limit':_0x29a672[_0x7b34('0x1d')]?_0x29a672['options']['limit']||null:null,'include':_0x29a672[_0x7b34('0x1d')]?_0x29a672[_0x7b34('0x1d')][_0x7b34('0x20')]?_[_0x7b34('0x21')](_0x29a672[_0x7b34('0x1d')][_0x7b34('0x20')],function(_0x412957){return{'model':db[_0x412957[_0x7b34('0x22')]],'as':_0x412957['as'],'attributes':_0x412957[_0x7b34('0x1f')],'include':_0x412957[_0x7b34('0x20')]?_[_0x7b34('0x21')](_0x412957[_0x7b34('0x20')],function(_0x4ad70e){return{'model':db[_0x4ad70e[_0x7b34('0x22')]],'as':_0x4ad70e['as'],'attributes':_0x4ad70e[_0x7b34('0x1f')],'include':_0x4ad70e['include']?_[_0x7b34('0x21')](_0x4ad70e[_0x7b34('0x20')],function(_0x8575c){return{'model':db[_0x8575c[_0x7b34('0x22')]],'as':_0x8575c['as'],'attributes':_0x8575c[_0x7b34('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7b34('0x10')](function(_0x4e3e89){logger[_0x7b34('0x19')](_0x7b34('0x23'),_0x29a672);logger[_0x7b34('0x12')](_0x7b34('0x23'),_0x29a672,JSON[_0x7b34('0x14')](_0x4e3e89));_0x500e2c(_0x4e3e89);})[_0x7b34('0x1a')](function(_0x175afc){logger['error']('GetFaxAccount',_0x175afc[_0x7b34('0x18')],_0x29a672);_0x20a380(_0x403160[_0x7b34('0x15')](0x1f4,_0x175afc['message']));});});};exports[_0x7b34('0x24')]=function(_0x486480,_0x1c5612,_0x48e1ea){var _0x5c171f=this;return new Promise(function(_0x15bfdb,_0xb6c5d){var _0x5b2939={'body':_0x486480[_0x7b34('0x25')],'channel':_0x7b34('0x26')};var _0x460538=[];var _0x36b92a=[];var _0x2fb39d={};return db['CmContact'][_0x7b34('0x27')]()[_0x7b34('0x10')](function(_0x557c41){if(!_0x557c41){throw new db[(_0x7b34('0x28'))][(_0x7b34('0x29'))](_0x7b34('0x2a'));}_0x460538=_[_0x7b34('0x2b')](_[_0x7b34('0x2c')](_0x557c41),[_0x7b34('0x2d'),_0x7b34('0x2e')]);_0x36b92a=_[_0x7b34('0x2b')](_[_0x7b34('0x2c')](_0x557c41),[_0x7b34('0x2d'),_0x7b34('0x2e'),_0x7b34('0x2f'),_0x7b34('0x30')]);if(_0x486480[_0x7b34('0x25')]['id']){delete _0x486480[_0x7b34('0x25')]['id'];}if(_[_0x7b34('0x31')](_0x486480[_0x7b34('0x25')][_0x7b34('0x32')])){throw new db[(_0x7b34('0x28'))][(_0x7b34('0x29'))](_0x7b34('0x33'));}if(_[_0x7b34('0x31')](_0x486480[_0x7b34('0x25')]['body'])||_0x486480[_0x7b34('0x25')][_0x7b34('0x25')]===''){throw new db['Sequelize'][(_0x7b34('0x29'))](_0x7b34('0x34'));}if(_[_0x7b34('0x31')](_0x486480[_0x7b34('0x25')][_0x7b34('0x35')])){throw new db[(_0x7b34('0x28'))]['ValidationError'](_0x7b34('0x36')+_0x36b92a);}if(!_[_0x7b34('0x37')](_0x36b92a,_0x486480['body']['mapKey'])){throw new db[(_0x7b34('0x28'))][(_0x7b34('0x29'))](_0x7b34('0x38')+_0x36b92a);}_0x2fb39d[_0x486480[_0x7b34('0x25')]['mapKey']]=_0x486480[_0x7b34('0x25')][_0x7b34('0x32')];})[_0x7b34('0x10')](function(){return db[_0x7b34('0x1b')]['find']({'where':{'id':_0x486480['account']['id']},'include':[{'model':db[_0x7b34('0x39')],'as':'List','include':[{'model':db['CmContact'],'as':_0x7b34('0x3a'),'where':_0x2fb39d,'limit':0x1,'order':[[_0x7b34('0x2e'),_0x7b34('0x3b')]]}]},{'model':db['FaxApplication'],'as':_0x7b34('0x3c')}]});})['then'](function(_0xf75f59){if(_0xf75f59&&_0xf75f59['List']){var _0x627d82=_0xf75f59['get']({'plain':!![]});_0x5b2939[_0x7b34('0x3d')]=_0x627d82;_0x5b2939['applications']=_0x627d82[_0x7b34('0x3c')];_0x5b2939[_0x7b34('0x3e')]=_0x627d82[_0x7b34('0x3f')];_0x5b2939[_0x7b34('0x40')]=_[_0x7b34('0x41')](_0x5b2939[_0x7b34('0x40')],[_0x7b34('0x42')],['asc']);if(_0x5b2939[_0x7b34('0x3d')][_0x7b34('0x3c')]){delete _0x5b2939[_0x7b34('0x3d')]['Applications'];}if(_0x5b2939['account']['List']&&_0x5b2939[_0x7b34('0x3d')][_0x7b34('0x3f')][_0x7b34('0x3a')]['length']){return _0x5b2939[_0x7b34('0x3d')]['List'][_0x7b34('0x3a')][0x0];}var _0x17e7eb=_[_0x7b34('0x9')](_0x486480[_0x7b34('0x25')],{'firstName':_0x486480[_0x7b34('0x25')][_0x7b34('0x32')],'ListId':_0x627d82['ListId']});_0x17e7eb[_0x486480['body']['mapKey']]=_0x486480[_0x7b34('0x25')][_0x7b34('0x32')];return db['CmContact'][_0x7b34('0x43')](_0x17e7eb,{'fields':_0x460538,'raw':!![]});}})[_0x7b34('0x10')](function(_0x5d4bb1){_0x5b2939['contact']=_0x5d4bb1;if(_0x5d4bb1){var _0x5031cf={'ContactId':_0x5d4bb1['id'],'FaxAccountId':_0x486480[_0x7b34('0x3d')]['id'],'fax':_0x5d4bb1[_0x7b34('0x26')]};return db[_0x7b34('0x44')][_0x7b34('0x45')]({'where':{'ContactId':_0x5d4bb1['id'],'closed':![],'FaxAccountId':_0x486480[_0x7b34('0x3d')]['id']}})[_0x7b34('0x10')](function(_0x2af37f){if(_0x2af37f){return[_0x2af37f,![]];}return db['FaxInteraction'][_0x7b34('0x43')](_0x5031cf)[_0x7b34('0x10')](function(_0x5d23be){return[_0x5d23be,!![]];});});}else{throw new Error(_0x7b34('0x46'));}})[_0x7b34('0x47')](function(_0x375d96,_0x469728){var _0x130176=_0x375d96[_0x7b34('0x48')]({'plain':!![]});if(_0x469728){if(_0x5b2939[_0x7b34('0x3d')][_0x7b34('0x49')]){_0x5b2939[_0x7b34('0x40')][_0x7b34('0x4a')]({'id':0x0,'priority':_0x5b2939[_0x7b34('0x40')][_0x7b34('0x4b')]+0x1,'app':_0x7b34('0x4c'),'appdata':_0x7b34('0x4d'),'interval':_0x7b34('0x4e')});}_0x130176[_0x7b34('0x4f')]=!![];}else{_0x130176[_0x7b34('0x4f')]=![];}_0x5b2939['interaction']=_0x130176;return db[_0x7b34('0x50')]['create']({'body':_0x486480['body'][_0x7b34('0x25')],'FaxAccountId':_0x486480['account']['id'],'FaxInteractionId':_0x375d96['id'],'direction':'in','ContactId':_0x375d96[_0x7b34('0x51')],'AttachmentId':_0x486480[_0x7b34('0x25')]['AttachmentId']});})['then'](function(_0x438258){_0x5b2939[_0x7b34('0x18')]=_0x438258;if(_0x5b2939['interaction'][_0x7b34('0x52')]){return db['User']['find']({'attributes':['id',_0x7b34('0x53')],'where':{'id':_0x5b2939[_0x7b34('0x54')][_0x7b34('0x52')]}})[_0x7b34('0x10')](function(_0x10f3a5){if(_0x10f3a5){_0x5b2939[_0x7b34('0x40')][_0x7b34('0x55')]({'id':0x0,'priority':0x0,'app':_0x7b34('0x56'),'appdata':_0x10f3a5['name']+','+(_0x5b2939['account'][_0x7b34('0x57')]||0xa),'interval':_0x7b34('0x4e')});}return respondWithRpcPromise(_0x7b34('0x58'),'startRouting',_0x5b2939);});}return respondWithRpcPromise(_0x7b34('0x58'),_0x7b34('0x59'),_0x5b2939);})[_0x7b34('0x10')](function(_0xf37e8c){_0x15bfdb(_0xf37e8c);})['catch'](function(_0x5ebd10){_0xb6c5d(_0x5c171f[_0x7b34('0x15')](0x1f4,_0x5ebd10[_0x7b34('0x18')]));});});};
\ No newline at end of file
+var _0x7cb6=['error','code','message','result','catch','GetFaxAccount','findAll','options','raw','where','limit','include','model','attributes','map','then','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','FaxAccount','find','CmList','List','Contacts','DESC','FaxApplication','Applications','get','applications','list','priority','account','length','contact','create','autoclose','push','close','unmanaged','*,*,*,*','created','ContactId','AttachmentId','interaction','UserId','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxAccount.socket','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x350343,_0x256f69){var _0x9afc1c=function(_0x47ab32){while(--_0x47ab32){_0x350343['push'](_0x350343['shift']());}};_0x9afc1c(++_0x256f69);}(_0x7cb6,0x1a7));var _0x67cb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7cb6[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x67cb('0x0'));var util=require('util');var moment=require(_0x67cb('0x1'));var BPromise=require(_0x67cb('0x2'));var rs=require(_0x67cb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x67cb('0x4'))['db'];var utils=require(_0x67cb('0x5'));var logger=require(_0x67cb('0x6'))(_0x67cb('0x7'));var config=require(_0x67cb('0x8'));var jayson=require(_0x67cb('0x9'));var client=jayson[_0x67cb('0xa')][_0x67cb('0xb')]({'port':0x232c});config[_0x67cb('0xc')]=_[_0x67cb('0xd')](config[_0x67cb('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x67cb('0xe'))(new Redis(config[_0x67cb('0xc')]));require(_0x67cb('0xf'))['register'](socket);function respondWithRpcPromise(_0x4f11b9,_0x32ae92,_0x54f008){return new BPromise(function(_0x32ac96,_0x57ba22){return client['request'](_0x4f11b9,_0x54f008)['then'](function(_0x6027b3){logger[_0x67cb('0x10')](_0x67cb('0x11'),_0x32ae92,_0x67cb('0x12'));logger[_0x67cb('0x13')](_0x67cb('0x14'),_0x32ae92,_0x67cb('0x12'),JSON[_0x67cb('0x15')](_0x6027b3));if(_0x6027b3[_0x67cb('0x16')]){if(_0x6027b3['error'][_0x67cb('0x17')]===0x1f4){logger[_0x67cb('0x16')]('FaxAccount,\x20%s,\x20%s',_0x32ae92,_0x6027b3['error']['message']);return _0x57ba22(_0x6027b3['error'][_0x67cb('0x18')]);}logger[_0x67cb('0x16')](_0x67cb('0x11'),_0x32ae92,_0x6027b3[_0x67cb('0x16')][_0x67cb('0x18')]);return _0x32ac96(_0x6027b3['error']['message']);}else{logger[_0x67cb('0x10')]('FaxAccount,\x20%s,\x20%s',_0x32ae92,_0x67cb('0x12'));_0x32ac96(_0x6027b3[_0x67cb('0x19')]['message']);}})[_0x67cb('0x1a')](function(_0x2d738b){logger['error']('FaxAccount,\x20%s,\x20%s',_0x32ae92,_0x2d738b);_0x57ba22(_0x2d738b);});});}exports[_0x67cb('0x1b')]=function(_0x255248){var _0x3d3e79=this;return new Promise(function(_0x43b21a,_0x16ebde){return db['FaxAccount'][_0x67cb('0x1c')]({'raw':_0x255248[_0x67cb('0x1d')]?_0x255248[_0x67cb('0x1d')][_0x67cb('0x1e')]===undefined?!![]:![]:!![],'where':_0x255248['options']?_0x255248[_0x67cb('0x1d')][_0x67cb('0x1f')]||null:null,'attributes':_0x255248[_0x67cb('0x1d')]?_0x255248['options']['attributes']||null:null,'limit':_0x255248['options']?_0x255248[_0x67cb('0x1d')][_0x67cb('0x20')]||null:null,'include':_0x255248[_0x67cb('0x1d')]?_0x255248[_0x67cb('0x1d')][_0x67cb('0x21')]?_['map'](_0x255248[_0x67cb('0x1d')]['include'],function(_0x4380ea){return{'model':db[_0x4380ea[_0x67cb('0x22')]],'as':_0x4380ea['as'],'attributes':_0x4380ea[_0x67cb('0x23')],'include':_0x4380ea[_0x67cb('0x21')]?_[_0x67cb('0x24')](_0x4380ea['include'],function(_0x3f024c){return{'model':db[_0x3f024c[_0x67cb('0x22')]],'as':_0x3f024c['as'],'attributes':_0x3f024c[_0x67cb('0x23')],'include':_0x3f024c[_0x67cb('0x21')]?_[_0x67cb('0x24')](_0x3f024c[_0x67cb('0x21')],function(_0xa24ac){return{'model':db[_0xa24ac[_0x67cb('0x22')]],'as':_0xa24ac['as'],'attributes':_0xa24ac[_0x67cb('0x23')]};}):[]};}):[]};}):[]:[]})[_0x67cb('0x25')](function(_0x106b40){logger[_0x67cb('0x10')]('GetFaxAccount',_0x255248);logger['debug'](_0x67cb('0x1b'),_0x255248,JSON[_0x67cb('0x15')](_0x106b40));_0x43b21a(_0x106b40);})['catch'](function(_0x434e08){logger[_0x67cb('0x16')](_0x67cb('0x1b'),_0x434e08['message'],_0x255248);_0x16ebde(_0x3d3e79[_0x67cb('0x16')](0x1f4,_0x434e08[_0x67cb('0x18')]));});});};exports[_0x67cb('0x26')]=function(_0x42af49,_0x2114c0,_0xaa3ae1){var _0x3650be=this;return new Promise(function(_0x20cd9f,_0x31975d){var _0x19df41={'body':_0x42af49[_0x67cb('0x27')],'channel':_0x67cb('0x28')};var _0x13fba1=[];var _0x22f4ba=[];var _0x257059={};return db[_0x67cb('0x29')][_0x67cb('0x2a')]()[_0x67cb('0x25')](function(_0x27ad3c){if(!_0x27ad3c){throw new db[(_0x67cb('0x2b'))][(_0x67cb('0x2c'))](_0x67cb('0x2d'));}_0x13fba1=_[_0x67cb('0x2e')](_[_0x67cb('0x2f')](_0x27ad3c),[_0x67cb('0x30'),'updatedAt']);_0x22f4ba=_[_0x67cb('0x2e')](_[_0x67cb('0x2f')](_0x27ad3c),[_0x67cb('0x30'),_0x67cb('0x31'),_0x67cb('0x32'),'ListId']);if(_0x42af49[_0x67cb('0x27')]['id']){delete _0x42af49[_0x67cb('0x27')]['id'];}if(_[_0x67cb('0x33')](_0x42af49[_0x67cb('0x27')][_0x67cb('0x34')])){throw new db[(_0x67cb('0x2b'))][(_0x67cb('0x2c'))]('from\x20is\x20mandatory');}if(_[_0x67cb('0x33')](_0x42af49['body'][_0x67cb('0x27')])||_0x42af49['body']['body']===''){throw new db[(_0x67cb('0x2b'))][(_0x67cb('0x2c'))](_0x67cb('0x35'));}if(_[_0x67cb('0x33')](_0x42af49[_0x67cb('0x27')][_0x67cb('0x36')])){throw new db[(_0x67cb('0x2b'))][(_0x67cb('0x2c'))](_0x67cb('0x37')+_0x22f4ba);}if(!_[_0x67cb('0x38')](_0x22f4ba,_0x42af49[_0x67cb('0x27')]['mapKey'])){throw new db[(_0x67cb('0x2b'))][(_0x67cb('0x2c'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x22f4ba);}_0x257059[_0x42af49['body'][_0x67cb('0x36')]]=_0x42af49[_0x67cb('0x27')][_0x67cb('0x34')];})[_0x67cb('0x25')](function(){return db[_0x67cb('0x39')][_0x67cb('0x3a')]({'where':{'id':_0x42af49['account']['id']},'include':[{'model':db[_0x67cb('0x3b')],'as':_0x67cb('0x3c'),'include':[{'model':db[_0x67cb('0x29')],'as':_0x67cb('0x3d'),'where':_0x257059,'limit':0x1,'order':[[_0x67cb('0x31'),_0x67cb('0x3e')]]}]},{'model':db[_0x67cb('0x3f')],'as':_0x67cb('0x40')}]});})['then'](function(_0x4dc286){if(_0x4dc286&&_0x4dc286[_0x67cb('0x3c')]){var _0x117629=_0x4dc286[_0x67cb('0x41')]({'plain':!![]});_0x19df41['account']=_0x117629;_0x19df41[_0x67cb('0x42')]=_0x117629[_0x67cb('0x40')];_0x19df41[_0x67cb('0x43')]=_0x117629[_0x67cb('0x3c')];_0x19df41[_0x67cb('0x42')]=_['orderBy'](_0x19df41[_0x67cb('0x42')],[_0x67cb('0x44')],['asc']);if(_0x19df41[_0x67cb('0x45')][_0x67cb('0x40')]){delete _0x19df41['account'][_0x67cb('0x40')];}if(_0x19df41[_0x67cb('0x45')]['List']&&_0x19df41['account'][_0x67cb('0x3c')][_0x67cb('0x3d')][_0x67cb('0x46')]){return _0x19df41[_0x67cb('0x45')][_0x67cb('0x3c')][_0x67cb('0x3d')][0x0];}var _0x98efa2=_[_0x67cb('0xd')](_0x42af49[_0x67cb('0x27')],{'firstName':_0x42af49[_0x67cb('0x27')]['from'],'ListId':_0x117629['ListId']});_0x98efa2[_0x42af49['body'][_0x67cb('0x36')]]=_0x42af49[_0x67cb('0x27')][_0x67cb('0x34')];return db[_0x67cb('0x29')]['create'](_0x98efa2,{'fields':_0x13fba1,'raw':!![]});}})['then'](function(_0x11e195){_0x19df41[_0x67cb('0x47')]=_0x11e195;if(_0x11e195){var _0x23b931={'ContactId':_0x11e195['id'],'FaxAccountId':_0x42af49['account']['id'],'fax':_0x11e195[_0x67cb('0x28')]};return db['FaxInteraction'][_0x67cb('0x3a')]({'where':{'ContactId':_0x11e195['id'],'closed':![],'FaxAccountId':_0x42af49['account']['id']}})[_0x67cb('0x25')](function(_0xec655a){if(_0xec655a){return[_0xec655a,![]];}return db['FaxInteraction'][_0x67cb('0x48')](_0x23b931)['then'](function(_0x28af21){return[_0x28af21,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x1f4d1f,_0x33cd4a){var _0x57a202=_0x1f4d1f[_0x67cb('0x41')]({'plain':!![]});if(_0x33cd4a){if(_0x19df41[_0x67cb('0x45')][_0x67cb('0x49')]){_0x19df41[_0x67cb('0x42')][_0x67cb('0x4a')]({'id':0x0,'priority':_0x19df41['applications'][_0x67cb('0x46')]+0x1,'app':_0x67cb('0x4b'),'appdata':_0x67cb('0x4c'),'interval':_0x67cb('0x4d')});}_0x57a202[_0x67cb('0x4e')]=!![];}else{_0x57a202[_0x67cb('0x4e')]=![];}_0x19df41['interaction']=_0x57a202;return db['FaxMessage'][_0x67cb('0x48')]({'body':_0x42af49[_0x67cb('0x27')][_0x67cb('0x27')],'FaxAccountId':_0x42af49['account']['id'],'FaxInteractionId':_0x1f4d1f['id'],'direction':'in','ContactId':_0x1f4d1f[_0x67cb('0x4f')],'AttachmentId':_0x42af49['body'][_0x67cb('0x50')]});})[_0x67cb('0x25')](function(_0x414d1c){_0x19df41[_0x67cb('0x18')]=_0x414d1c;if(_0x19df41[_0x67cb('0x51')][_0x67cb('0x52')]){return db['User'][_0x67cb('0x3a')]({'attributes':['id',_0x67cb('0x53')],'where':{'id':_0x19df41['interaction'][_0x67cb('0x52')]}})[_0x67cb('0x25')](function(_0x24d93d){if(_0x24d93d){_0x19df41['applications'][_0x67cb('0x54')]({'id':0x0,'priority':0x0,'app':_0x67cb('0x55'),'appdata':_0x24d93d['name']+','+(_0x19df41[_0x67cb('0x45')][_0x67cb('0x56')]||0xa),'interval':_0x67cb('0x4d')});}return respondWithRpcPromise(_0x67cb('0x57'),_0x67cb('0x58'),_0x19df41);});}return respondWithRpcPromise(_0x67cb('0x57'),_0x67cb('0x58'),_0x19df41);})[_0x67cb('0x25')](function(_0x1d2961){_0x20cd9f(_0x1d2961);})[_0x67cb('0x1a')](function(_0x2dc821){_0x31975d(_0x3650be['error'](0x1f4,_0x2dc821[_0x67cb('0x18')]));});});};
\ No newline at end of file
index 96a7ced..3062691 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd86c=['faxAccount:','./faxAccount.events','remove','removeListener','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd86c,0xd3));var _0xcd86=function(_0x509273,_0x13fc9f){_0x509273=_0x509273-0x0;var _0x38ef40=_0xd86c[_0x509273];return _0x38ef40;};'use strict';var FaxAccountEvents=require(_0xcd86('0x0'));var events=['save',_0xcd86('0x1'),'update'];function createListener(_0x5b4250,_0x31eb28){return function(_0x2737b8){_0x31eb28['emit'](_0x5b4250,_0x2737b8);};}function removeListener(_0x541687,_0x331580){return function(){FaxAccountEvents[_0xcd86('0x2')](_0x541687,_0x331580);};}exports['register']=function(_0x31f430){for(var _0x559cdf=0x0,_0x4a42d9=events[_0xcd86('0x3')];_0x559cdf<_0x4a42d9;_0x559cdf++){var _0x564ff9=events[_0x559cdf];var _0xc9b441=createListener(_0xcd86('0x4')+_0x564ff9,_0x31f430);FaxAccountEvents['on'](_0x564ff9,_0xc9b441);}};
\ No newline at end of file
+var _0x2f9f=['./faxAccount.events','save','remove','update','removeListener','length'];(function(_0x8dbff0,_0x407c2b){var _0x19fce6=function(_0x24ee4a){while(--_0x24ee4a){_0x8dbff0['push'](_0x8dbff0['shift']());}};_0x19fce6(++_0x407c2b);}(_0x2f9f,0x1d4));var _0xf2f9=function(_0x3621fc,_0x536bb7){_0x3621fc=_0x3621fc-0x0;var _0x25070f=_0x2f9f[_0x3621fc];return _0x25070f;};'use strict';var FaxAccountEvents=require(_0xf2f9('0x0'));var events=[_0xf2f9('0x1'),_0xf2f9('0x2'),_0xf2f9('0x3')];function createListener(_0x493232,_0x27c290){return function(_0x22a6b7){_0x27c290['emit'](_0x493232,_0x22a6b7);};}function removeListener(_0x3dd011,_0x562f83){return function(){FaxAccountEvents[_0xf2f9('0x4')](_0x3dd011,_0x562f83);};}exports['register']=function(_0x51958e){for(var _0x1e2b25=0x0,_0x423f6d=events[_0xf2f9('0x5')];_0x1e2b25<_0x423f6d;_0x1e2b25++){var _0x415b11=events[_0x1e2b25];var _0x1f1fc0=createListener('faxAccount:'+_0x415b11,_0x51958e);FaxAccountEvents['on'](_0x415b11,_0x1f1fc0);}};
\ No newline at end of file
index 46fb705..37669cf 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(_0x294eaa,_0x491ec3){var _0x512149=function(_0x5ef019){while(--_0x5ef019){_0x294eaa['push'](_0x294eaa['shift']());}};_0x512149(++_0x491ec3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0xda1443,_0x2797f0){var _0x1d8191=function(_0x27797f){while(--_0x27797f){_0xda1443['push'](_0xda1443['shift']());}};_0x1d8191(++_0x2797f0);}(_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['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 d9c1896..a11f673 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8c8=['STRING','*,*,*,*','sequelize','INTEGER','noop'];(function(_0x2c8687,_0x4e04af){var _0x5b4873=function(_0xe49b){while(--_0xe49b){_0x2c8687['push'](_0x2c8687['shift']());}};_0x5b4873(++_0x4e04af);}(_0xa8c8,0x138));var _0x8a8c=function(_0xaf592f,_0x48b9c6){_0xaf592f=_0xaf592f-0x0;var _0x632508=_0xa8c8[_0xaf592f];return _0x632508;};'use strict';var Sequelize=require(_0x8a8c('0x0'));module['exports']={'priority':{'type':Sequelize[_0x8a8c('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8a8c('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x8a8c('0x3')]},'interval':{'type':Sequelize[_0x8a8c('0x3')],'defaultValue':_0x8a8c('0x4')}};
\ No newline at end of file
+var _0xbb99=['exports','INTEGER','STRING','TEXT'];(function(_0x46492a,_0x4a6978){var _0x2541e5=function(_0x5060fc){while(--_0x5060fc){_0x46492a['push'](_0x46492a['shift']());}};_0x2541e5(++_0x4a6978);}(_0xbb99,0xcc));var _0x9bb9=function(_0x52f1e6,_0xf70489){_0x52f1e6=_0x52f1e6-0x0;var _0x21f104=_0xbb99[_0x52f1e6];return _0x21f104;};'use strict';var Sequelize=require('sequelize');module[_0x9bb9('0x0')]={'priority':{'type':Sequelize[_0x9bb9('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x9bb9('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x9bb9('0x3')]()},'description':{'type':Sequelize[_0x9bb9('0x2')]},'interval':{'type':Sequelize[_0x9bb9('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index a11f2eb..fe90c1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffb5=['set','Content-Range','apply','update','then','destroy','error','name','index','map','FaxApplication','rawAttributes','type','key','query','filters','model','attributes','intersection','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','count','includeAll','include','rows','catch','show','params','keys','fields','find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x334688,_0xf68c2c){var _0x42dc15=function(_0x17f90a){while(--_0x17f90a){_0x334688['push'](_0x334688['shift']());}};_0x42dc15(++_0xf68c2c);}(_0xffb5,0x199));var _0x5ffb=function(_0x59024a,_0x51065f){_0x59024a=_0x59024a-0x0;var _0x24c34d=_0xffb5[_0x59024a];return _0x24c34d;};'use strict';var emlformat=require(_0x5ffb('0x0'));var rimraf=require(_0x5ffb('0x1'));var zipdir=require(_0x5ffb('0x2'));var jsonpatch=require(_0x5ffb('0x3'));var rp=require(_0x5ffb('0x4'));var moment=require(_0x5ffb('0x5'));var BPromise=require(_0x5ffb('0x6'));var Mustache=require(_0x5ffb('0x7'));var util=require(_0x5ffb('0x8'));var path=require(_0x5ffb('0x9'));var sox=require(_0x5ffb('0xa'));var csv=require(_0x5ffb('0xb'));var ejs=require(_0x5ffb('0xc'));var fs=require('fs');var fs_extra=require(_0x5ffb('0xd'));var _=require(_0x5ffb('0xe'));var squel=require(_0x5ffb('0xf'));var crypto=require(_0x5ffb('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x5ffb('0x11'));var toCsv=require(_0x5ffb('0xb'));var querystring=require('querystring');var Papa=require(_0x5ffb('0x12'));var Redis=require('ioredis');var authService=require(_0x5ffb('0x13'));var qs=require(_0x5ffb('0x14'));var as=require(_0x5ffb('0x15'));var hardwareService=require(_0x5ffb('0x16'));var logger=require(_0x5ffb('0x17'))(_0x5ffb('0x18'));var utils=require(_0x5ffb('0x19'));var config=require(_0x5ffb('0x1a'));var licenseUtil=require(_0x5ffb('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1bc368,_0x36d0e1){_0x36d0e1=_0x36d0e1||0xcc;return function(_0x5ef18e){if(_0x5ef18e){return _0x1bc368[_0x5ffb('0x1c')](_0x36d0e1);}return _0x1bc368[_0x5ffb('0x1d')](_0x36d0e1)[_0x5ffb('0x1e')]();};}function respondWithResult(_0x3780c8,_0x41f506){_0x41f506=_0x41f506||0xc8;return function(_0x56d79e){if(_0x56d79e){return _0x3780c8[_0x5ffb('0x1d')](_0x41f506)[_0x5ffb('0x1f')](_0x56d79e);}};}function respondWithFilteredResult(_0x5cced1,_0xeae4c4){return function(_0x1c4496){if(_0x1c4496){var _0x16b574=typeof _0xeae4c4[_0x5ffb('0x20')]===_0x5ffb('0x21')&&typeof _0xeae4c4[_0x5ffb('0x22')]===_0x5ffb('0x21');var _0x375620=_0x1c4496['count'];var _0x5b5b1f=_0x16b574?0x0:_0xeae4c4[_0x5ffb('0x20')];var _0x33d5d6=_0x16b574?_0x1c4496['count']:_0xeae4c4[_0x5ffb('0x20')]+_0xeae4c4[_0x5ffb('0x22')];var _0x2f9c4f;if(_0x33d5d6>=_0x375620){_0x33d5d6=_0x375620;_0x2f9c4f=0xc8;}else{_0x2f9c4f=0xce;}_0x5cced1[_0x5ffb('0x1d')](_0x2f9c4f);return _0x5cced1[_0x5ffb('0x23')](_0x5ffb('0x24'),_0x5b5b1f+'-'+_0x33d5d6+'/'+_0x375620)[_0x5ffb('0x1f')](_0x1c4496);}return null;};}function patchUpdates(_0x3f4ce3){return function(_0x5b4e74){try{jsonpatch[_0x5ffb('0x25')](_0x5b4e74,_0x3f4ce3,!![]);}catch(_0x48a415){return BPromise['reject'](_0x48a415);}return _0x5b4e74['save']();};}function saveUpdates(_0x55842c,_0x90fb39){return function(_0x173852){if(_0x173852){return _0x173852[_0x5ffb('0x26')](_0x55842c)[_0x5ffb('0x27')](function(_0x2d26ed){return _0x2d26ed;});}return null;};}function removeEntity(_0x17b1c4,_0x4e1169){return function(_0x4f812d){if(_0x4f812d){return _0x4f812d[_0x5ffb('0x28')]()[_0x5ffb('0x27')](function(){_0x17b1c4[_0x5ffb('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14ec2b,_0x41e1a9){return function(_0x549e1c){if(!_0x549e1c){_0x14ec2b[_0x5ffb('0x1c')](0x194);}return _0x549e1c;};}function handleError(_0x1a5f20,_0x1df0b6){_0x1df0b6=_0x1df0b6||0x1f4;return function(_0x522e2d){logger[_0x5ffb('0x29')](_0x522e2d['stack']);if(_0x522e2d[_0x5ffb('0x2a')]){delete _0x522e2d[_0x5ffb('0x2a')];}_0x1a5f20[_0x5ffb('0x1d')](_0x1df0b6)['send'](_0x522e2d);};}exports[_0x5ffb('0x2b')]=function(_0x23cc9f,_0x1b1e63){var _0x420409={},_0xcddc10={},_0x4d7cda={'count':0x0,'rows':[]};var _0x2bb487=_[_0x5ffb('0x2c')](db[_0x5ffb('0x2d')][_0x5ffb('0x2e')],function(_0x8fd977){return{'name':_0x8fd977['fieldName'],'type':_0x8fd977[_0x5ffb('0x2f')][_0x5ffb('0x30')]};});_0xcddc10['model']=_[_0x5ffb('0x2c')](_0x2bb487,_0x5ffb('0x2a'));_0xcddc10[_0x5ffb('0x31')]=_['keys'](_0x23cc9f['query']);_0xcddc10[_0x5ffb('0x32')]=_['intersection'](_0xcddc10[_0x5ffb('0x33')],_0xcddc10[_0x5ffb('0x31')]);_0x420409[_0x5ffb('0x34')]=_[_0x5ffb('0x35')](_0xcddc10[_0x5ffb('0x33')],qs['fields'](_0x23cc9f[_0x5ffb('0x31')]['fields']));_0x420409[_0x5ffb('0x34')]=_0x420409['attributes'][_0x5ffb('0x36')]?_0x420409[_0x5ffb('0x34')]:_0xcddc10[_0x5ffb('0x33')];if(!_0x23cc9f[_0x5ffb('0x31')][_0x5ffb('0x37')]('nolimit')){_0x420409[_0x5ffb('0x22')]=qs[_0x5ffb('0x22')](_0x23cc9f['query']['limit']);_0x420409[_0x5ffb('0x20')]=qs[_0x5ffb('0x20')](_0x23cc9f[_0x5ffb('0x31')]['offset']);}_0x420409[_0x5ffb('0x38')]=qs[_0x5ffb('0x39')](_0x23cc9f['query'][_0x5ffb('0x39')]);_0x420409[_0x5ffb('0x3a')]=qs[_0x5ffb('0x32')](_['pick'](_0x23cc9f[_0x5ffb('0x31')],_0xcddc10['filters']),_0x2bb487);if(_0x23cc9f['query'][_0x5ffb('0x3b')]){_0x420409[_0x5ffb('0x3a')]=_['merge'](_0x420409['where'],{'$or':_[_0x5ffb('0x2c')](_0x2bb487,function(_0x6ce2de){if(_0x6ce2de[_0x5ffb('0x2f')]!==_0x5ffb('0x3c')){var _0x544683={};_0x544683[_0x6ce2de['name']]={'$like':'%'+_0x23cc9f[_0x5ffb('0x31')][_0x5ffb('0x3b')]+'%'};return _0x544683;}})});}_0x420409=_[_0x5ffb('0x3d')]({},_0x420409,_0x23cc9f[_0x5ffb('0x3e')]);var _0x1a230f={'where':_0x420409[_0x5ffb('0x3a')]};return db[_0x5ffb('0x2d')][_0x5ffb('0x3f')](_0x1a230f)[_0x5ffb('0x27')](function(_0x19ee49){_0x4d7cda['count']=_0x19ee49;if(_0x23cc9f[_0x5ffb('0x31')][_0x5ffb('0x40')]){_0x420409[_0x5ffb('0x41')]=[{'all':!![]}];}return db[_0x5ffb('0x2d')]['findAll'](_0x420409);})[_0x5ffb('0x27')](function(_0x5683d2){_0x4d7cda[_0x5ffb('0x42')]=_0x5683d2;return _0x4d7cda;})['then'](respondWithFilteredResult(_0x1b1e63,_0x420409))[_0x5ffb('0x43')](handleError(_0x1b1e63,null));};exports[_0x5ffb('0x44')]=function(_0x538a7d,_0xea7bfc){var _0x332321={'raw':!![],'where':{'id':_0x538a7d[_0x5ffb('0x45')]['id']}},_0xe6e7d1={};_0xe6e7d1[_0x5ffb('0x33')]=_[_0x5ffb('0x46')](db[_0x5ffb('0x2d')]['rawAttributes']);_0xe6e7d1['query']=_[_0x5ffb('0x46')](_0x538a7d['query']);_0xe6e7d1[_0x5ffb('0x32')]=_[_0x5ffb('0x35')](_0xe6e7d1[_0x5ffb('0x33')],_0xe6e7d1[_0x5ffb('0x31')]);_0x332321[_0x5ffb('0x34')]=_[_0x5ffb('0x35')](_0xe6e7d1[_0x5ffb('0x33')],qs[_0x5ffb('0x47')](_0x538a7d[_0x5ffb('0x31')]['fields']));_0x332321['attributes']=_0x332321['attributes'][_0x5ffb('0x36')]?_0x332321['attributes']:_0xe6e7d1[_0x5ffb('0x33')];if(_0x538a7d[_0x5ffb('0x31')]['includeAll']){_0x332321[_0x5ffb('0x41')]=[{'all':!![]}];}_0x332321=_[_0x5ffb('0x3d')]({},_0x332321,_0x538a7d['options']);return db[_0x5ffb('0x2d')][_0x5ffb('0x48')](_0x332321)[_0x5ffb('0x27')](handleEntityNotFound(_0xea7bfc,null))[_0x5ffb('0x27')](respondWithResult(_0xea7bfc,null))[_0x5ffb('0x43')](handleError(_0xea7bfc,null));};exports['create']=function(_0x28250e,_0x43bd42){return db['FaxApplication']['create'](_0x28250e[_0x5ffb('0x49')],{})[_0x5ffb('0x27')](respondWithResult(_0x43bd42,0xc9))[_0x5ffb('0x43')](handleError(_0x43bd42,null));};exports[_0x5ffb('0x26')]=function(_0x1edc64,_0x57f8d1){if(_0x1edc64[_0x5ffb('0x49')]['id']){delete _0x1edc64[_0x5ffb('0x49')]['id'];}return db[_0x5ffb('0x2d')][_0x5ffb('0x48')]({'where':{'id':_0x1edc64[_0x5ffb('0x45')]['id']}})['then'](handleEntityNotFound(_0x57f8d1,null))[_0x5ffb('0x27')](saveUpdates(_0x1edc64['body'],null))[_0x5ffb('0x27')](respondWithResult(_0x57f8d1,null))['catch'](handleError(_0x57f8d1,null));};exports[_0x5ffb('0x28')]=function(_0x5a99d8,_0x1042b0){return db[_0x5ffb('0x2d')][_0x5ffb('0x48')]({'where':{'id':_0x5a99d8[_0x5ffb('0x45')]['id']}})[_0x5ffb('0x27')](handleEntityNotFound(_0x1042b0,null))['then'](removeEntity(_0x1042b0,null))['catch'](handleError(_0x1042b0,null));};
\ No newline at end of file
+var _0xe711=['model','keys','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','FaxApplication','count','includeAll','include','findAll','catch','params','merge','find','create','body','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0xe711,0xb0));var _0x1e71=function(_0x169942,_0x51dcd2){_0x169942=_0x169942-0x0;var _0x5e1ec2=_0xe711[_0x169942];return _0x5e1ec2;};'use strict';var emlformat=require(_0x1e71('0x0'));var rimraf=require(_0x1e71('0x1'));var zipdir=require(_0x1e71('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1e71('0x3'));var Mustache=require(_0x1e71('0x4'));var util=require(_0x1e71('0x5'));var path=require(_0x1e71('0x6'));var sox=require(_0x1e71('0x7'));var csv=require(_0x1e71('0x8'));var ejs=require(_0x1e71('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1e71('0xa'));var crypto=require(_0x1e71('0xb'));var jsforce=require(_0x1e71('0xc'));var deskjs=require(_0x1e71('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1e71('0xe'));var Papa=require(_0x1e71('0xf'));var Redis=require(_0x1e71('0x10'));var authService=require(_0x1e71('0x11'));var qs=require(_0x1e71('0x12'));var as=require(_0x1e71('0x13'));var hardwareService=require(_0x1e71('0x14'));var logger=require('../../config/logger')(_0x1e71('0x15'));var utils=require('../../config/utils');var config=require(_0x1e71('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3dcfe0,_0xac7ae4){_0xac7ae4=_0xac7ae4||0xcc;return function(_0x405e87){if(_0x405e87){return _0x3dcfe0[_0x1e71('0x17')](_0xac7ae4);}return _0x3dcfe0[_0x1e71('0x18')](_0xac7ae4)['end']();};}function respondWithResult(_0x1efffc,_0x5e099c){_0x5e099c=_0x5e099c||0xc8;return function(_0x35a6e9){if(_0x35a6e9){return _0x1efffc['status'](_0x5e099c)[_0x1e71('0x19')](_0x35a6e9);}};}function respondWithFilteredResult(_0x2dd498,_0x597614){return function(_0x14e80f){if(_0x14e80f){var _0x2bcc25=typeof _0x597614[_0x1e71('0x1a')]===_0x1e71('0x1b')&&typeof _0x597614[_0x1e71('0x1c')]===_0x1e71('0x1b');var _0x2370ff=_0x14e80f['count'];var _0x443c79=_0x2bcc25?0x0:_0x597614[_0x1e71('0x1a')];var _0x21f7bf=_0x2bcc25?_0x14e80f['count']:_0x597614[_0x1e71('0x1a')]+_0x597614[_0x1e71('0x1c')];var _0x2ccec3;if(_0x21f7bf>=_0x2370ff){_0x21f7bf=_0x2370ff;_0x2ccec3=0xc8;}else{_0x2ccec3=0xce;}_0x2dd498[_0x1e71('0x18')](_0x2ccec3);return _0x2dd498[_0x1e71('0x1d')](_0x1e71('0x1e'),_0x443c79+'-'+_0x21f7bf+'/'+_0x2370ff)['json'](_0x14e80f);}return null;};}function patchUpdates(_0x3b4bce){return function(_0x63a83d){try{jsonpatch[_0x1e71('0x1f')](_0x63a83d,_0x3b4bce,!![]);}catch(_0x2a1894){return BPromise['reject'](_0x2a1894);}return _0x63a83d['save']();};}function saveUpdates(_0x3ba7fd,_0x56ee8d){return function(_0x56fc66){if(_0x56fc66){return _0x56fc66[_0x1e71('0x20')](_0x3ba7fd)[_0x1e71('0x21')](function(_0x370986){return _0x370986;});}return null;};}function removeEntity(_0x47dc09,_0x4f2ee4){return function(_0x1b462e){if(_0x1b462e){return _0x1b462e[_0x1e71('0x22')]()[_0x1e71('0x21')](function(){_0x47dc09[_0x1e71('0x18')](0xcc)[_0x1e71('0x23')]();});}};}function handleEntityNotFound(_0x9f9619,_0x45793e){return function(_0x5a78a9){if(!_0x5a78a9){_0x9f9619[_0x1e71('0x17')](0x194);}return _0x5a78a9;};}function handleError(_0x419287,_0x48c076){_0x48c076=_0x48c076||0x1f4;return function(_0x59de74){logger[_0x1e71('0x24')](_0x59de74[_0x1e71('0x25')]);if(_0x59de74[_0x1e71('0x26')]){delete _0x59de74[_0x1e71('0x26')];}_0x419287[_0x1e71('0x18')](_0x48c076)[_0x1e71('0x27')](_0x59de74);};}exports[_0x1e71('0x28')]=function(_0x10aa03,_0x13842){var _0x5ab028={},_0x3e3b52={},_0x572b2e={'count':0x0,'rows':[]};var _0x43c047=_[_0x1e71('0x29')](db['FaxApplication'][_0x1e71('0x2a')],function(_0x460e6b){return{'name':_0x460e6b[_0x1e71('0x2b')],'type':_0x460e6b[_0x1e71('0x2c')][_0x1e71('0x2d')]};});_0x3e3b52[_0x1e71('0x2e')]=_[_0x1e71('0x29')](_0x43c047,_0x1e71('0x26'));_0x3e3b52['query']=_[_0x1e71('0x2f')](_0x10aa03['query']);_0x3e3b52[_0x1e71('0x30')]=_[_0x1e71('0x31')](_0x3e3b52['model'],_0x3e3b52['query']);_0x5ab028['attributes']=_[_0x1e71('0x31')](_0x3e3b52[_0x1e71('0x2e')],qs[_0x1e71('0x32')](_0x10aa03[_0x1e71('0x33')][_0x1e71('0x32')]));_0x5ab028['attributes']=_0x5ab028[_0x1e71('0x34')][_0x1e71('0x35')]?_0x5ab028[_0x1e71('0x34')]:_0x3e3b52[_0x1e71('0x2e')];if(!_0x10aa03[_0x1e71('0x33')][_0x1e71('0x36')](_0x1e71('0x37'))){_0x5ab028[_0x1e71('0x1c')]=qs['limit'](_0x10aa03[_0x1e71('0x33')][_0x1e71('0x1c')]);_0x5ab028[_0x1e71('0x1a')]=qs[_0x1e71('0x1a')](_0x10aa03[_0x1e71('0x33')][_0x1e71('0x1a')]);}_0x5ab028[_0x1e71('0x38')]=qs[_0x1e71('0x39')](_0x10aa03['query']['sort']);_0x5ab028[_0x1e71('0x3a')]=qs['filters'](_[_0x1e71('0x3b')](_0x10aa03[_0x1e71('0x33')],_0x3e3b52['filters']),_0x43c047);if(_0x10aa03['query'][_0x1e71('0x3c')]){_0x5ab028[_0x1e71('0x3a')]=_['merge'](_0x5ab028[_0x1e71('0x3a')],{'$or':_['map'](_0x43c047,function(_0x1d9dd0){if(_0x1d9dd0['type']!==_0x1e71('0x3d')){var _0x41b63e={};_0x41b63e[_0x1d9dd0['name']]={'$like':'%'+_0x10aa03[_0x1e71('0x33')][_0x1e71('0x3c')]+'%'};return _0x41b63e;}})});}_0x5ab028=_['merge']({},_0x5ab028,_0x10aa03[_0x1e71('0x3e')]);var _0x5134e7={'where':_0x5ab028[_0x1e71('0x3a')]};return db[_0x1e71('0x3f')][_0x1e71('0x40')](_0x5134e7)[_0x1e71('0x21')](function(_0x55300a){_0x572b2e[_0x1e71('0x40')]=_0x55300a;if(_0x10aa03[_0x1e71('0x33')][_0x1e71('0x41')]){_0x5ab028[_0x1e71('0x42')]=[{'all':!![]}];}return db[_0x1e71('0x3f')][_0x1e71('0x43')](_0x5ab028);})[_0x1e71('0x21')](function(_0x56752c){_0x572b2e['rows']=_0x56752c;return _0x572b2e;})[_0x1e71('0x21')](respondWithFilteredResult(_0x13842,_0x5ab028))[_0x1e71('0x44')](handleError(_0x13842,null));};exports['show']=function(_0x312dd1,_0x33a2c7){var _0x5601e9={'raw':!![],'where':{'id':_0x312dd1[_0x1e71('0x45')]['id']}},_0x5b4eed={};_0x5b4eed[_0x1e71('0x2e')]=_[_0x1e71('0x2f')](db[_0x1e71('0x3f')]['rawAttributes']);_0x5b4eed[_0x1e71('0x33')]=_[_0x1e71('0x2f')](_0x312dd1['query']);_0x5b4eed['filters']=_[_0x1e71('0x31')](_0x5b4eed['model'],_0x5b4eed[_0x1e71('0x33')]);_0x5601e9['attributes']=_['intersection'](_0x5b4eed[_0x1e71('0x2e')],qs[_0x1e71('0x32')](_0x312dd1[_0x1e71('0x33')][_0x1e71('0x32')]));_0x5601e9[_0x1e71('0x34')]=_0x5601e9['attributes'][_0x1e71('0x35')]?_0x5601e9[_0x1e71('0x34')]:_0x5b4eed['model'];if(_0x312dd1[_0x1e71('0x33')]['includeAll']){_0x5601e9[_0x1e71('0x42')]=[{'all':!![]}];}_0x5601e9=_[_0x1e71('0x46')]({},_0x5601e9,_0x312dd1['options']);return db[_0x1e71('0x3f')][_0x1e71('0x47')](_0x5601e9)[_0x1e71('0x21')](handleEntityNotFound(_0x33a2c7,null))[_0x1e71('0x21')](respondWithResult(_0x33a2c7,null))[_0x1e71('0x44')](handleError(_0x33a2c7,null));};exports[_0x1e71('0x48')]=function(_0x481865,_0x335a20){return db[_0x1e71('0x3f')][_0x1e71('0x48')](_0x481865['body'],{})[_0x1e71('0x21')](respondWithResult(_0x335a20,0xc9))[_0x1e71('0x44')](handleError(_0x335a20,null));};exports['update']=function(_0x257d28,_0x2d1f17){if(_0x257d28[_0x1e71('0x49')]['id']){delete _0x257d28[_0x1e71('0x49')]['id'];}return db[_0x1e71('0x3f')][_0x1e71('0x47')]({'where':{'id':_0x257d28[_0x1e71('0x45')]['id']}})['then'](handleEntityNotFound(_0x2d1f17,null))[_0x1e71('0x21')](saveUpdates(_0x257d28[_0x1e71('0x49')],null))[_0x1e71('0x21')](respondWithResult(_0x2d1f17,null))[_0x1e71('0x44')](handleError(_0x2d1f17,null));};exports['destroy']=function(_0x1b2a3a,_0x26c832){return db[_0x1e71('0x3f')][_0x1e71('0x47')]({'where':{'id':_0x1b2a3a[_0x1e71('0x45')]['id']}})[_0x1e71('0x21')](handleEntityNotFound(_0x26c832,null))[_0x1e71('0x21')](removeEntity(_0x26c832,null))[_0x1e71('0x44')](handleError(_0x26c832,null));};
\ No newline at end of file
index cf845b4..416857b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3b9=['FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./faxApplication.attributes','exports','define'];(function(_0x58a3b0,_0x1155a2){var _0x5597ad=function(_0x338944){while(--_0x338944){_0x58a3b0['push'](_0x58a3b0['shift']());}};_0x5597ad(++_0x1155a2);}(_0xa3b9,0x1c6));var _0x9a3b=function(_0x2c9ef4,_0x1f4811){_0x2c9ef4=_0x2c9ef4-0x0;var _0x36d1a8=_0xa3b9[_0x2c9ef4];return _0x36d1a8;};'use strict';var _=require(_0x9a3b('0x0'));var util=require(_0x9a3b('0x1'));var logger=require(_0x9a3b('0x2'))(_0x9a3b('0x3'));var moment=require(_0x9a3b('0x4'));var BPromise=require('bluebird');var rp=require(_0x9a3b('0x5'));var fs=require('fs');var path=require(_0x9a3b('0x6'));var rimraf=require('rimraf');var config=require(_0x9a3b('0x7'));var attributes=require(_0x9a3b('0x8'));module[_0x9a3b('0x9')]=function(_0x3e4198,_0x1dd059){return _0x3e4198[_0x9a3b('0xa')](_0x9a3b('0xb'),attributes,{'tableName':_0x9a3b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9a3b('0xd'),'collate':_0x9a3b('0xe')});};
\ No newline at end of file
+var _0xc9cc=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./faxApplication.attributes','exports','define','fax_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x55ad76,_0x3ac082){var _0x20fe1d=function(_0x460757){while(--_0x460757){_0x55ad76['push'](_0x55ad76['shift']());}};_0x20fe1d(++_0x3ac082);}(_0xc9cc,0xe0));var _0xcc9c=function(_0x50856f,_0x262f2c){_0x50856f=_0x50856f-0x0;var _0x505ca2=_0xc9cc[_0x50856f];return _0x505ca2;};'use strict';var _=require(_0xcc9c('0x0'));var util=require(_0xcc9c('0x1'));var logger=require(_0xcc9c('0x2'))(_0xcc9c('0x3'));var moment=require('moment');var BPromise=require(_0xcc9c('0x4'));var rp=require(_0xcc9c('0x5'));var fs=require('fs');var path=require(_0xcc9c('0x6'));var rimraf=require('rimraf');var config=require(_0xcc9c('0x7'));var attributes=require(_0xcc9c('0x8'));module[_0xcc9c('0x9')]=function(_0x4da8e7,_0x21e6b4){return _0x4da8e7[_0xcc9c('0xa')]('FaxApplication',attributes,{'tableName':_0xcc9c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcc9c('0xc'),'collate':_0xcc9c('0xd')});};
\ No newline at end of file
index 0bd5b09..1c4add8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b11=['options','where','limit','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateFaxApplication','FaxApplication','update'];(function(_0x3bb360,_0x1bc6fc){var _0x1087c9=function(_0x29d1ad){while(--_0x29d1ad){_0x3bb360['push'](_0x3bb360['shift']());}};_0x1087c9(++_0x1bc6fc);}(_0x1b11,0xf7));var _0x11b1=function(_0x2247a3,_0x9258d5){_0x2247a3=_0x2247a3-0x0;var _0x4901b3=_0x1b11[_0x2247a3];return _0x4901b3;};'use strict';var _=require(_0x11b1('0x0'));var util=require(_0x11b1('0x1'));var moment=require('moment');var BPromise=require(_0x11b1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11b1('0x3'));var db=require(_0x11b1('0x4'))['db'];var utils=require(_0x11b1('0x5'));var logger=require('../../config/logger')(_0x11b1('0x6'));var config=require(_0x11b1('0x7'));var jayson=require(_0x11b1('0x8'));var client=jayson['client'][_0x11b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d999e,_0x2df611,_0x25aec2){return new BPromise(function(_0x2f59de,_0x998bc4){return client['request'](_0x3d999e,_0x25aec2)[_0x11b1('0xa')](function(_0x28e5f8){logger[_0x11b1('0xb')](_0x11b1('0xc'),_0x2df611,_0x11b1('0xd'));logger[_0x11b1('0xe')](_0x11b1('0xf'),_0x2df611,_0x11b1('0xd'),JSON[_0x11b1('0x10')](_0x28e5f8));if(_0x28e5f8['error']){if(_0x28e5f8['error']['code']===0x1f4){logger[_0x11b1('0x11')](_0x11b1('0xc'),_0x2df611,_0x28e5f8[_0x11b1('0x11')][_0x11b1('0x12')]);return _0x998bc4(_0x28e5f8['error'][_0x11b1('0x12')]);}logger['error'](_0x11b1('0xc'),_0x2df611,_0x28e5f8['error'][_0x11b1('0x12')]);return _0x2f59de(_0x28e5f8[_0x11b1('0x11')][_0x11b1('0x12')]);}else{logger[_0x11b1('0xb')]('FaxApplication,\x20%s,\x20%s',_0x2df611,_0x11b1('0xd'));_0x2f59de(_0x28e5f8[_0x11b1('0x13')][_0x11b1('0x12')]);}})['catch'](function(_0x4d9ac9){logger[_0x11b1('0x11')](_0x11b1('0xc'),_0x2df611,_0x4d9ac9);_0x998bc4(_0x4d9ac9);});});}exports[_0x11b1('0x14')]=function(_0x31a7e4){var _0x2370c4=this;return new Promise(function(_0x1cb777,_0x3db116){return db[_0x11b1('0x15')][_0x11b1('0x16')](_0x31a7e4['body'],{'raw':_0x31a7e4[_0x11b1('0x17')]?_0x31a7e4[_0x11b1('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31a7e4[_0x11b1('0x17')]?_0x31a7e4[_0x11b1('0x17')][_0x11b1('0x18')]||null:null,'attributes':_0x31a7e4[_0x11b1('0x17')]?_0x31a7e4['options']['attributes']||null:null,'limit':_0x31a7e4[_0x11b1('0x17')]?_0x31a7e4[_0x11b1('0x17')][_0x11b1('0x19')]||null:null})[_0x11b1('0xa')](function(_0xc952d6){logger[_0x11b1('0xb')](_0x11b1('0x14'),_0x31a7e4);logger[_0x11b1('0xe')](_0x11b1('0x14'),_0x31a7e4,JSON[_0x11b1('0x10')](_0xc952d6));_0x1cb777(_0xc952d6);})[_0x11b1('0x1a')](function(_0x19bf50){logger[_0x11b1('0x11')]('UpdateFaxApplication',_0x19bf50[_0x11b1('0x12')],_0x31a7e4);_0x3db116(_0x2370c4[_0x11b1('0x11')](0x1f4,_0x19bf50[_0x11b1('0x12')]));});});};
\ No newline at end of file
+var _0x643d=['error','message','result','catch','UpdateFaxApplication','body','options','raw','where','attributes','then','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x30042f,_0x7c2c5a){var _0x56e8cb=function(_0x2a6a61){while(--_0x2a6a61){_0x30042f['push'](_0x30042f['shift']());}};_0x56e8cb(++_0x7c2c5a);}(_0x643d,0x1df));var _0xd643=function(_0x1b7629,_0x59d745){_0x1b7629=_0x1b7629-0x0;var _0x5d7e41=_0x643d[_0x1b7629];return _0x5d7e41;};'use strict';var _=require('lodash');var util=require(_0xd643('0x0'));var moment=require(_0xd643('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd643('0x2'));var db=require(_0xd643('0x3'))['db'];var utils=require(_0xd643('0x4'));var logger=require(_0xd643('0x5'))('rpc');var config=require(_0xd643('0x6'));var jayson=require(_0xd643('0x7'));var client=jayson[_0xd643('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x384e4f,_0x408fbc,_0x2db5c2){return new BPromise(function(_0x52abdd,_0xe0cbe7){return client[_0xd643('0x9')](_0x384e4f,_0x2db5c2)['then'](function(_0x2a9402){logger[_0xd643('0xa')](_0xd643('0xb'),_0x408fbc,'request\x20sent');logger[_0xd643('0xc')](_0xd643('0xd'),_0x408fbc,'request\x20sent',JSON[_0xd643('0xe')](_0x2a9402));if(_0x2a9402[_0xd643('0xf')]){if(_0x2a9402[_0xd643('0xf')]['code']===0x1f4){logger['error'](_0xd643('0xb'),_0x408fbc,_0x2a9402[_0xd643('0xf')][_0xd643('0x10')]);return _0xe0cbe7(_0x2a9402['error'][_0xd643('0x10')]);}logger[_0xd643('0xf')](_0xd643('0xb'),_0x408fbc,_0x2a9402['error'][_0xd643('0x10')]);return _0x52abdd(_0x2a9402['error'][_0xd643('0x10')]);}else{logger[_0xd643('0xa')](_0xd643('0xb'),_0x408fbc,'request\x20sent');_0x52abdd(_0x2a9402[_0xd643('0x11')][_0xd643('0x10')]);}})[_0xd643('0x12')](function(_0x4d4715){logger['error'](_0xd643('0xb'),_0x408fbc,_0x4d4715);_0xe0cbe7(_0x4d4715);});});}exports[_0xd643('0x13')]=function(_0x57035f){var _0x52cdfa=this;return new Promise(function(_0x18fb0b,_0x3a9b5f){return db['FaxApplication']['update'](_0x57035f[_0xd643('0x14')],{'raw':_0x57035f[_0xd643('0x15')]?_0x57035f[_0xd643('0x15')][_0xd643('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57035f[_0xd643('0x15')]?_0x57035f['options'][_0xd643('0x17')]||null:null,'attributes':_0x57035f['options']?_0x57035f['options'][_0xd643('0x18')]||null:null,'limit':_0x57035f[_0xd643('0x15')]?_0x57035f[_0xd643('0x15')]['limit']||null:null})[_0xd643('0x19')](function(_0x360ed8){logger[_0xd643('0xa')]('UpdateFaxApplication',_0x57035f);logger[_0xd643('0xc')]('UpdateFaxApplication',_0x57035f,JSON[_0xd643('0xe')](_0x360ed8));_0x18fb0b(_0x360ed8);})[_0xd643('0x12')](function(_0x301804){logger['error'](_0xd643('0x13'),_0x301804[_0xd643('0x10')],_0x57035f);_0x3a9b5f(_0x52cdfa[_0xd643('0xf')](0x1f4,_0x301804[_0xd643('0x10')]));});});};
\ No newline at end of file
index 8bb7fbb..aa8928b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefda=['post','create','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xefda,0x96));var _0xaefd=function(_0x70dc98,_0x156631){_0x70dc98=_0x70dc98-0x0;var _0x3bb1fd=_0xefda[_0x70dc98];return _0x3bb1fd;};'use strict';var multer=require(_0xaefd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaefd('0x1'));var express=require(_0xaefd('0x2'));var router=express['Router']();var fs_extra=require(_0xaefd('0x3'));var auth=require(_0xaefd('0x4'));var interaction=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var controller=require(_0xaefd('0x7'));router[_0xaefd('0x8')]('/',auth['isAuthenticated'](),controller[_0xaefd('0x9')]);router[_0xaefd('0x8')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller['show']);router[_0xaefd('0xc')]('/',auth[_0xaefd('0xb')](),controller[_0xaefd('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xaefd('0xe')]);router[_0xaefd('0xf')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller[_0xaefd('0x10')]);module[_0xaefd('0x11')]=router;
\ No newline at end of file
+var _0x9354=['Router','fs-extra','../../components/auth/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','util','path','express'];(function(_0x4cfe78,_0x2c6545){var _0x326b4d=function(_0x279335){while(--_0x279335){_0x4cfe78['push'](_0x4cfe78['shift']());}};_0x326b4d(++_0x2c6545);}(_0x9354,0x96));var _0x4935=function(_0x5806c3,_0x5105d8){_0x5806c3=_0x5806c3-0x0;var _0x48ac77=_0x9354[_0x5806c3];return _0x48ac77;};'use strict';var multer=require('multer');var util=require(_0x4935('0x0'));var path=require(_0x4935('0x1'));var timeout=require('connect-timeout');var express=require(_0x4935('0x2'));var router=express[_0x4935('0x3')]();var fs_extra=require(_0x4935('0x4'));var auth=require(_0x4935('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4935('0x6'));var controller=require(_0x4935('0x7'));router[_0x4935('0x8')]('/',auth[_0x4935('0x9')](),controller[_0x4935('0xa')]);router[_0x4935('0x8')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0xc')]);router['post']('/',auth[_0x4935('0x9')](),controller['create']);router[_0x4935('0xd')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0xe')]);router[_0x4935('0xf')](_0x4935('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x4935('0x10')]=router;
\ No newline at end of file
index c3e6c7a..5f49662 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51e6=['DATE','STRING','ENUM','out','sequelize'];(function(_0x27638d,_0x4094db){var _0x35da35=function(_0x538095){while(--_0x538095){_0x27638d['push'](_0x27638d['shift']());}};_0x35da35(++_0x4094db);}(_0x51e6,0xef));var _0x651e=function(_0x41a93b,_0x2fc19d){_0x41a93b=_0x41a93b-0x0;var _0x220a7e=_0x51e6[_0x41a93b];return _0x220a7e;};'use strict';var Sequelize=require(_0x651e('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x651e('0x1')]},'disposition':{'type':Sequelize[_0x651e('0x2')]},'secondDisposition':{'type':Sequelize[_0x651e('0x2')]},'thirdDisposition':{'type':Sequelize[_0x651e('0x2')]},'note':{'type':Sequelize[_0x651e('0x2')]},'read1stAt':{'type':Sequelize[_0x651e('0x1')]},'fax':{'type':Sequelize[_0x651e('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x651e('0x3')]('in',_0x651e('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x651e('0x1')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x651e('0x4')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0x49ce=['ENUM','out','exports','BOOLEAN','DATE','STRING'];(function(_0x53125e,_0x11c6a5){var _0x3dfd9a=function(_0x23eb91){while(--_0x23eb91){_0x53125e['push'](_0x53125e['shift']());}};_0x3dfd9a(++_0x11c6a5);}(_0x49ce,0x116));var _0xe49c=function(_0x13f38e,_0x10ecce){_0x13f38e=_0x13f38e-0x0;var _0x2a4b96=_0x49ce[_0x13f38e];return _0x2a4b96;};'use strict';var Sequelize=require('sequelize');module[_0xe49c('0x0')]={'closed':{'type':Sequelize[_0xe49c('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe49c('0x2')]},'disposition':{'type':Sequelize[_0xe49c('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xe49c('0x3')]},'note':{'type':Sequelize[_0xe49c('0x3')]},'read1stAt':{'type':Sequelize[_0xe49c('0x2')]},'fax':{'type':Sequelize[_0xe49c('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xe49c('0x4')]('in',_0xe49c('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe49c('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xe49c('0x4')]('in',_0xe49c('0x5')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index 18a1684..f74d49d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc373=['then','stack','name','send','map','FaxInteraction','rawAttributes','fieldName','type','getOptions','findAll','fax','user','catch','show','params','model','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','create','body','destroy','describe','addMessage','FaxMessage','find','ids','getMessages','keys','hasOwnProperty','nolimit','sort','pick','FaxInteractionId','filter','where','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','omit','spread','Tag','color','emit','removeTags','download','unix','toString','join','root','server','files','attachments','transcript-%d-%s.zip','push','Attachment','Messages','get','mkdirSync','basename','createReadStream','pipe','createWriteStream','resolve','err','unlinkSync','rimraf','zip-dir','moment','util','ioredis','../../components/interaction/service','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./faxInteraction.socket','sendStatus','status','end','limit','count','offset','set','Content-Range','json','update'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xc373,0xb3));var _0x3c37=function(_0x2390bd,_0x212fbd){_0x2390bd=_0x2390bd-0x0;var _0x3a969d=_0xc373[_0x2390bd];return _0x3a969d;};'use strict';var rimraf=require(_0x3c37('0x0'));var zipdir=require(_0x3c37('0x1'));var moment=require(_0x3c37('0x2'));var BPromise=require('bluebird');var util=require(_0x3c37('0x3'));var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require(_0x3c37('0x4'));var interaction=require(_0x3c37('0x5'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x3c37('0x6'));var config=require(_0x3c37('0x7'));var db=require(_0x3c37('0x8'))['db'];config['redis']=_[_0x3c37('0x9')](config[_0x3c37('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x3c37('0xb'))(new Redis(config[_0x3c37('0xa')]));require(_0x3c37('0xc'))['register'](socket);function respondWithStatusCode(_0x256603,_0x200938){_0x200938=_0x200938||0xcc;return function(_0x2b464b){if(_0x2b464b){return _0x256603[_0x3c37('0xd')](_0x200938);}return _0x256603[_0x3c37('0xe')](_0x200938)[_0x3c37('0xf')]();};}function respondWithResult(_0x2f3398,_0x25d90f){_0x25d90f=_0x25d90f||0xc8;return function(_0x232614){if(_0x232614){return _0x2f3398[_0x3c37('0xe')](_0x25d90f)['json'](_0x232614);}};}function respondWithFilteredResult(_0x54de0c,_0x4c5bda){return function(_0x488593){if(_0x488593){var _0x12b5ea=typeof _0x4c5bda['offset']==='undefined'&&typeof _0x4c5bda[_0x3c37('0x10')]==='undefined';var _0x4c32fb=_0x488593[_0x3c37('0x11')];var _0x1bff4b=_0x12b5ea?0x0:_0x4c5bda[_0x3c37('0x12')];var _0x48b051=_0x12b5ea?_0x488593[_0x3c37('0x11')]:_0x4c5bda[_0x3c37('0x12')]+_0x4c5bda[_0x3c37('0x10')];var _0x1fef65;if(_0x48b051>=_0x4c32fb){_0x48b051=_0x4c32fb;_0x1fef65=0xc8;}else{_0x1fef65=0xce;}_0x54de0c[_0x3c37('0xe')](_0x1fef65);return _0x54de0c[_0x3c37('0x13')](_0x3c37('0x14'),_0x1bff4b+'-'+_0x48b051+'/'+_0x4c32fb)[_0x3c37('0x15')](_0x488593);}return null;};}function saveUpdates(_0x4e05ef){return function(_0x541abe){if(_0x541abe){return _0x541abe[_0x3c37('0x16')](_0x4e05ef)[_0x3c37('0x17')](function(_0x28600b){return _0x28600b;});}return null;};}function removeEntity(_0x26200d){return function(_0x280924){if(_0x280924){return _0x280924['destroy']()['then'](function(){_0x26200d[_0x3c37('0xe')](0xcc)[_0x3c37('0xf')]();});}};}function handleEntityNotFound(_0x2fb1c4){return function(_0x293810){if(!_0x293810){_0x2fb1c4[_0x3c37('0xd')](0x194);}return _0x293810;};}function handleError(_0x17812e,_0x22ca34){_0x22ca34=_0x22ca34||0x1f4;return function(_0x4c2f31){logger['error'](_0x4c2f31[_0x3c37('0x18')]);if(_0x4c2f31[_0x3c37('0x19')]){delete _0x4c2f31[_0x3c37('0x19')];}_0x17812e[_0x3c37('0xe')](_0x22ca34)[_0x3c37('0x1a')](_0x4c2f31);};}exports['index']=function(_0xaacf67,_0x45c899){var _0x323910={};var _0x50f640=_[_0x3c37('0x1b')](db[_0x3c37('0x1c')][_0x3c37('0x1d')],function(_0xa0e082){return{'name':_0xa0e082[_0x3c37('0x1e')],'type':_0xa0e082[_0x3c37('0x1f')]['key']};});_0x323910=qs[_0x3c37('0x20')](_0x50f640,_0xaacf67);return interaction[_0x3c37('0x21')](_0x3c37('0x22'),_0xaacf67['query'],_0xaacf67[_0x3c37('0x23')],_0x323910,_0x50f640)['then'](respondWithFilteredResult(_0x45c899,_0x323910))[_0x3c37('0x24')](handleError(_0x45c899,null));};exports[_0x3c37('0x25')]=function(_0x4c017d,_0x26aef2){var _0x34cca7={'raw':![],'where':{'id':_0x4c017d[_0x3c37('0x26')]['id']}},_0x51f761={};_0x51f761[_0x3c37('0x27')]=_['keys'](db[_0x3c37('0x1c')]['rawAttributes']);_0x51f761['query']=_['keys'](_0x4c017d[_0x3c37('0x28')]);_0x51f761[_0x3c37('0x29')]=_[_0x3c37('0x2a')](_0x51f761['model'],_0x51f761['query']);_0x34cca7[_0x3c37('0x2b')]=_['intersection'](_0x51f761['model'],qs['fields'](_0x4c017d[_0x3c37('0x28')][_0x3c37('0x2c')]));_0x34cca7[_0x3c37('0x2b')]=_0x34cca7[_0x3c37('0x2b')][_0x3c37('0x2d')]?_0x34cca7[_0x3c37('0x2b')]:_0x51f761['model'];if(_0x4c017d[_0x3c37('0x28')][_0x3c37('0x2e')]){_0x34cca7[_0x3c37('0x2f')]=[{'all':!![]}];}_0x34cca7=_[_0x3c37('0x30')]({},_0x34cca7,_0x4c017d[_0x3c37('0x31')]);return db[_0x3c37('0x1c')]['find'](_0x34cca7)[_0x3c37('0x17')](handleEntityNotFound(_0x26aef2,null))[_0x3c37('0x17')](respondWithResult(_0x26aef2,null))[_0x3c37('0x24')](handleError(_0x26aef2,null));};exports[_0x3c37('0x32')]=function(_0x2258f0,_0x193e86){return db[_0x3c37('0x1c')][_0x3c37('0x32')](_0x2258f0[_0x3c37('0x33')],{})[_0x3c37('0x17')](respondWithResult(_0x193e86,0xc9))[_0x3c37('0x24')](handleError(_0x193e86,null));};exports[_0x3c37('0x16')]=function(_0x2b9f4a,_0x112f29){if(_0x2b9f4a['body']['id']){delete _0x2b9f4a['body']['id'];}return db[_0x3c37('0x1c')]['find']({'where':{'id':_0x2b9f4a[_0x3c37('0x26')]['id']}})['then'](handleEntityNotFound(_0x112f29,null))[_0x3c37('0x17')](saveUpdates(_0x2b9f4a[_0x3c37('0x33')],null))['then'](respondWithResult(_0x112f29,null))[_0x3c37('0x24')](handleError(_0x112f29,null));};exports[_0x3c37('0x34')]=function(_0x26b31,_0x52c7be){return db[_0x3c37('0x1c')]['find']({'where':{'id':_0x26b31[_0x3c37('0x26')]['id']}})[_0x3c37('0x17')](handleEntityNotFound(_0x52c7be,null))[_0x3c37('0x17')](removeEntity(_0x52c7be,null))[_0x3c37('0x24')](handleError(_0x52c7be,null));};exports[_0x3c37('0x35')]=function(_0x2c9c71,_0x82d67){return db[_0x3c37('0x1c')]['describe']()[_0x3c37('0x17')](respondWithResult(_0x82d67,null))[_0x3c37('0x24')](handleError(_0x82d67,null));};exports[_0x3c37('0x36')]=function(_0x283791,_0x56984d){return db[_0x3c37('0x37')][_0x3c37('0x38')]({'where':{'id':_0x283791[_0x3c37('0x26')]['id']}})['then'](handleEntityNotFound(_0x56984d,null))[_0x3c37('0x17')](function(_0x3db277){if(_0x3db277){return _0x3db277['addMessage'](_0x283791[_0x3c37('0x33')][_0x3c37('0x39')],_['omit'](_0x283791[_0x3c37('0x33')],[_0x3c37('0x39'),'id'])||{});}})[_0x3c37('0x17')](respondWithResult(_0x56984d,null))['catch'](handleError(_0x56984d,null));};exports[_0x3c37('0x3a')]=function(_0x35de14,_0x2288e2){var _0x4b748e={'raw':![],'where':{}};var _0x1e5624={};var _0xe9c03f={'count':0x0,'rows':[]};return db['FaxInteraction']['findOne']({'where':{'id':_0x35de14[_0x3c37('0x26')]['id']}})[_0x3c37('0x17')](handleEntityNotFound(_0x2288e2,null))[_0x3c37('0x17')](function(_0x46f5ff){if(_0x46f5ff){_0x1e5624[_0x3c37('0x27')]=_[_0x3c37('0x3b')](db[_0x3c37('0x37')][_0x3c37('0x1d')]);_0x1e5624[_0x3c37('0x28')]=_[_0x3c37('0x3b')](_0x35de14[_0x3c37('0x28')]);_0x1e5624[_0x3c37('0x29')]=_[_0x3c37('0x2a')](_0x1e5624[_0x3c37('0x27')],_0x1e5624[_0x3c37('0x28')]);_0x4b748e[_0x3c37('0x2b')]=_[_0x3c37('0x2a')](_0x1e5624['model'],qs[_0x3c37('0x2c')](_0x35de14[_0x3c37('0x28')][_0x3c37('0x2c')]));_0x4b748e[_0x3c37('0x2b')]=_0x4b748e['attributes']['length']?_0x4b748e[_0x3c37('0x2b')]:_0x1e5624[_0x3c37('0x27')];if(!_0x35de14[_0x3c37('0x28')][_0x3c37('0x3c')](_0x3c37('0x3d'))){_0x4b748e[_0x3c37('0x10')]=qs[_0x3c37('0x10')](_0x35de14[_0x3c37('0x28')]['limit']);_0x4b748e[_0x3c37('0x12')]=qs[_0x3c37('0x12')](_0x35de14[_0x3c37('0x28')]['offset']);}_0x4b748e['order']=qs[_0x3c37('0x3e')](_0x35de14[_0x3c37('0x28')][_0x3c37('0x3e')]);_0x4b748e['where']=qs['filters'](_[_0x3c37('0x3f')](_0x35de14['query'],_0x1e5624[_0x3c37('0x29')]));_0x4b748e['where'][_0x3c37('0x40')]=_0x46f5ff['id'];if(_0x35de14[_0x3c37('0x28')][_0x3c37('0x41')]){_0x4b748e['where']=_[_0x3c37('0x30')](_0x4b748e[_0x3c37('0x42')],{'$or':_[_0x3c37('0x1b')](_0x4b748e['attributes'],function(_0x3586a5){var _0x5a231d={};_0x5a231d[_0x3586a5]={'$like':'%'+_0x35de14[_0x3c37('0x28')][_0x3c37('0x41')]+'%'};return _0x5a231d;})});}if(_0x35de14[_0x3c37('0x28')]['$gte']){var _0x2524f9=_0x35de14[_0x3c37('0x28')][_0x3c37('0x43')][_0x3c37('0x44')](',');var _0x65377={};_0x65377[_0x2524f9[0x0]]={'$gte':moment(_0x2524f9[0x1])[_0x3c37('0x45')](_0x3c37('0x46'))};_0x4b748e[_0x3c37('0x42')]=_[_0x3c37('0x30')](_0x4b748e[_0x3c37('0x42')],_0x65377);}_0x4b748e=_[_0x3c37('0x30')]({},_0x4b748e,_0x35de14[_0x3c37('0x31')]);return db[_0x3c37('0x37')]['count']({'where':_0x4b748e['where']})[_0x3c37('0x17')](function(_0x1f14cb){_0xe9c03f['count']=_0x1f14cb;if(_0x35de14[_0x3c37('0x28')][_0x3c37('0x2e')]){_0x4b748e[_0x3c37('0x2f')]=[{'all':!![]}];}return db['FaxMessage'][_0x3c37('0x21')](_0x4b748e);})[_0x3c37('0x17')](function(_0x429e4c){_0xe9c03f[_0x3c37('0x47')]=_0x429e4c;return _0xe9c03f;});}})[_0x3c37('0x17')](respondWithFilteredResult(_0x2288e2,_0x4b748e))[_0x3c37('0x24')](handleError(_0x2288e2,null));};exports[_0x3c37('0x48')]=function(_0xb05cd2,_0x217ac1){return db[_0x3c37('0x1c')][_0x3c37('0x38')]({'where':{'id':_0xb05cd2['params']['id']}})[_0x3c37('0x17')](handleEntityNotFound(_0x217ac1,null))[_0x3c37('0x17')](function(_0x155167){if(_0x155167){return _0x155167[_0x3c37('0x49')](_0xb05cd2[_0x3c37('0x33')][_0x3c37('0x39')],_[_0x3c37('0x4a')](_0xb05cd2[_0x3c37('0x33')],['ids','id'])||{})[_0x3c37('0x4b')](function(){return db[_0x3c37('0x4c')][_0x3c37('0x21')]({'attributes':['id',_0x3c37('0x19'),_0x3c37('0x4d')],'where':{'id':_0xb05cd2[_0x3c37('0x33')][_0x3c37('0x39')]}});})[_0x3c37('0x17')](function(_0x5de0a4){socket[_0x3c37('0x4e')]('faxInteractionTags:save',{'id':Number(_0xb05cd2[_0x3c37('0x26')]['id']),'tags':_0x5de0a4||[]});return{'id':Number(_0xb05cd2[_0x3c37('0x26')]['id']),'tags':_0x5de0a4||[]};});}})[_0x3c37('0x17')](respondWithResult(_0x217ac1,null))['catch'](handleError(_0x217ac1,null));};exports[_0x3c37('0x4f')]=function(_0x24980f,_0x170948){return db[_0x3c37('0x1c')][_0x3c37('0x38')]({'where':{'id':_0x24980f[_0x3c37('0x26')]['id']}})[_0x3c37('0x17')](handleEntityNotFound(_0x170948,null))[_0x3c37('0x17')](function(_0x26ad30){if(_0x26ad30){return _0x26ad30['removeTags'](_0x24980f[_0x3c37('0x28')][_0x3c37('0x39')]);}})[_0x3c37('0x17')](respondWithStatusCode(_0x170948,null))[_0x3c37('0x24')](handleError(_0x170948,null));};exports[_0x3c37('0x50')]=function(_0x10e480,_0x3aed2f){var _0x22008f=moment()[_0x3c37('0x51')]()[_0x3c37('0x52')]();var _0x453df6=path[_0x3c37('0x53')](config[_0x3c37('0x54')],_0x3c37('0x55'),_0x3c37('0x56'),'tmp');var _0x44efa2=path[_0x3c37('0x53')](config['root'],_0x3c37('0x55'),_0x3c37('0x56'),_0x3c37('0x57'));var _0x216b50=path['join'](_0x453df6,_0x22008f);var _0x3d7e8a=util[_0x3c37('0x45')](_0x3c37('0x58'),_0x10e480[_0x3c37('0x26')]['id'],_0x22008f);var _0x5b7c09=path[_0x3c37('0x53')](_0x453df6,_0x3d7e8a);var _0x50e19f=[];_0x50e19f[_0x3c37('0x59')]({'model':db[_0x3c37('0x5a')],'as':_0x3c37('0x5a'),'raw':!![]});var _0x4e04ec=[{'model':db[_0x3c37('0x37')],'as':_0x3c37('0x5b'),'attributes':['id',_0x3c37('0x33'),'createdAt'],'include':_0x50e19f}];return db[_0x3c37('0x1c')][_0x3c37('0x38')]({'where':{'id':_0x10e480[_0x3c37('0x26')]['id']},'include':_0x4e04ec})[_0x3c37('0x17')](handleEntityNotFound(_0x3aed2f,null))['then'](function(_0x5dba8c){if(_0x5dba8c&&_0x5dba8c[_0x3c37('0x5b')]){var _0x471985=_0x5dba8c[_0x3c37('0x5c')]({'plain':!![]});fs[_0x3c37('0x5d')](_0x216b50);for(var _0x5e07e1=0x0;_0x5e07e1<_0x471985['Messages'][_0x3c37('0x2d')];_0x5e07e1++){var _0x140304=_0x471985[_0x3c37('0x5b')][_0x5e07e1]['Attachment'];if(_0x140304){var _0x41faf6=path[_0x3c37('0x53')](_0x44efa2,_0x140304[_0x3c37('0x5e')]);if(fs['existsSync'](_0x41faf6)){fs[_0x3c37('0x5f')](_0x41faf6)[_0x3c37('0x60')](fs[_0x3c37('0x61')](path[_0x3c37('0x53')](_0x216b50,_0x140304[_0x3c37('0x5e')])));}}}return BPromise[_0x3c37('0x62')]()[_0x3c37('0x17')](function(){return new BPromise(function(_0x4387ad,_0x4f0666){zipdir(_0x216b50,{'saveTo':_0x5b7c09},function(_0x42545c,_0x392b37){if(_0x42545c)return _0x4f0666(_0x42545c);return _0x4387ad(_0x392b37);});})[_0x3c37('0x17')](function(){return new BPromise(function(_0x21b90f,_0x4516f9){rimraf(_0x216b50,function(_0x535fcb){if(_0x535fcb)_0x4516f9(_0x535fcb);return _0x21b90f();});});})[_0x3c37('0x17')](function(){return _0x3aed2f[_0x3c37('0x50')](_0x5b7c09,_0x3d7e8a,function(_0x4827ed){if(_0x4827ed){console['log'](_0x3c37('0x63'),_0x4827ed);}else{fs[_0x3c37('0x64')](_0x5b7c09);}});});});}else{return _0x3aed2f[_0x3c37('0xd')](0xc8);}})[_0x3c37('0x24')](handleError(_0x3aed2f,null));};
\ No newline at end of file
+var _0xa57a=['root','files','tmp','server','attachments','push','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createWriteStream','resolve','download','log','err','unlinkSync','rimraf','moment','bluebird','util','path','ioredis','../../components/parsers/qs','../../config/environment','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','status','end','offset','undefined','count','limit','set','Content-Range','json','update','then','destroy','sendStatus','stack','name','send','index','map','FaxInteraction','rawAttributes','fieldName','key','getOptions','findAll','fax','query','user','show','params','model','keys','filters','intersection','attributes','includeAll','merge','find','create','catch','body','FaxMessage','addMessage','ids','getMessages','findOne','fields','length','hasOwnProperty','nolimit','sort','where','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','spread','Tag','color','emit','faxInteractionTags:save','removeTags','unix','toString','join'];(function(_0x57f5f8,_0x50d13d){var _0x2e282c=function(_0x48ab32){while(--_0x48ab32){_0x57f5f8['push'](_0x57f5f8['shift']());}};_0x2e282c(++_0x50d13d);}(_0xa57a,0x13c));var _0xaa57=function(_0x169153,_0x566e3e){_0x169153=_0x169153-0x0;var _0xf66bd1=_0xa57a[_0x169153];return _0xf66bd1;};'use strict';var rimraf=require(_0xaa57('0x0'));var zipdir=require('zip-dir');var moment=require(_0xaa57('0x1'));var BPromise=require(_0xaa57('0x2'));var util=require(_0xaa57('0x3'));var path=require(_0xaa57('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xaa57('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0xaa57('0x6'));var logger=require('../../config/logger')('api');var config=require(_0xaa57('0x7'));var db=require('../../mysqldb')['db'];config[_0xaa57('0x8')]=_[_0xaa57('0x9')](config[_0xaa57('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xaa57('0xa'))(new Redis(config[_0xaa57('0x8')]));require(_0xaa57('0xb'))[_0xaa57('0xc')](socket);function respondWithStatusCode(_0x327519,_0x5b6f86){_0x5b6f86=_0x5b6f86||0xcc;return function(_0x575636){if(_0x575636){return _0x327519['sendStatus'](_0x5b6f86);}return _0x327519[_0xaa57('0xd')](_0x5b6f86)[_0xaa57('0xe')]();};}function respondWithResult(_0x47f9ee,_0x1e940f){_0x1e940f=_0x1e940f||0xc8;return function(_0x2d59fe){if(_0x2d59fe){return _0x47f9ee[_0xaa57('0xd')](_0x1e940f)['json'](_0x2d59fe);}};}function respondWithFilteredResult(_0x396187,_0x235ac9){return function(_0x3f7404){if(_0x3f7404){var _0x1efc57=typeof _0x235ac9[_0xaa57('0xf')]===_0xaa57('0x10')&&typeof _0x235ac9['limit']==='undefined';var _0xdf2d99=_0x3f7404[_0xaa57('0x11')];var _0x40f72c=_0x1efc57?0x0:_0x235ac9[_0xaa57('0xf')];var _0x451104=_0x1efc57?_0x3f7404[_0xaa57('0x11')]:_0x235ac9[_0xaa57('0xf')]+_0x235ac9[_0xaa57('0x12')];var _0x412508;if(_0x451104>=_0xdf2d99){_0x451104=_0xdf2d99;_0x412508=0xc8;}else{_0x412508=0xce;}_0x396187[_0xaa57('0xd')](_0x412508);return _0x396187[_0xaa57('0x13')](_0xaa57('0x14'),_0x40f72c+'-'+_0x451104+'/'+_0xdf2d99)[_0xaa57('0x15')](_0x3f7404);}return null;};}function saveUpdates(_0x2c7177){return function(_0x5d26a7){if(_0x5d26a7){return _0x5d26a7[_0xaa57('0x16')](_0x2c7177)[_0xaa57('0x17')](function(_0x377411){return _0x377411;});}return null;};}function removeEntity(_0x4b83af){return function(_0x3e549d){if(_0x3e549d){return _0x3e549d[_0xaa57('0x18')]()[_0xaa57('0x17')](function(){_0x4b83af['status'](0xcc)[_0xaa57('0xe')]();});}};}function handleEntityNotFound(_0x5ad51){return function(_0x2aab32){if(!_0x2aab32){_0x5ad51[_0xaa57('0x19')](0x194);}return _0x2aab32;};}function handleError(_0x2bbd92,_0x58ee9b){_0x58ee9b=_0x58ee9b||0x1f4;return function(_0x1bfaf1){logger['error'](_0x1bfaf1[_0xaa57('0x1a')]);if(_0x1bfaf1[_0xaa57('0x1b')]){delete _0x1bfaf1[_0xaa57('0x1b')];}_0x2bbd92['status'](_0x58ee9b)[_0xaa57('0x1c')](_0x1bfaf1);};}exports[_0xaa57('0x1d')]=function(_0x5bf66e,_0x56bfdd){var _0x5d6459={};var _0x4da6f1=_[_0xaa57('0x1e')](db[_0xaa57('0x1f')][_0xaa57('0x20')],function(_0x5d296b){return{'name':_0x5d296b[_0xaa57('0x21')],'type':_0x5d296b['type'][_0xaa57('0x22')]};});_0x5d6459=qs[_0xaa57('0x23')](_0x4da6f1,_0x5bf66e);return interaction[_0xaa57('0x24')](_0xaa57('0x25'),_0x5bf66e[_0xaa57('0x26')],_0x5bf66e[_0xaa57('0x27')],_0x5d6459,_0x4da6f1)['then'](respondWithFilteredResult(_0x56bfdd,_0x5d6459))['catch'](handleError(_0x56bfdd,null));};exports[_0xaa57('0x28')]=function(_0x125fa6,_0x561f08){var _0x100c9e={'raw':![],'where':{'id':_0x125fa6[_0xaa57('0x29')]['id']}},_0x16e88e={};_0x16e88e[_0xaa57('0x2a')]=_[_0xaa57('0x2b')](db[_0xaa57('0x1f')][_0xaa57('0x20')]);_0x16e88e[_0xaa57('0x26')]=_[_0xaa57('0x2b')](_0x125fa6[_0xaa57('0x26')]);_0x16e88e[_0xaa57('0x2c')]=_[_0xaa57('0x2d')](_0x16e88e[_0xaa57('0x2a')],_0x16e88e[_0xaa57('0x26')]);_0x100c9e[_0xaa57('0x2e')]=_[_0xaa57('0x2d')](_0x16e88e['model'],qs['fields'](_0x125fa6[_0xaa57('0x26')]['fields']));_0x100c9e[_0xaa57('0x2e')]=_0x100c9e[_0xaa57('0x2e')]['length']?_0x100c9e[_0xaa57('0x2e')]:_0x16e88e[_0xaa57('0x2a')];if(_0x125fa6['query'][_0xaa57('0x2f')]){_0x100c9e['include']=[{'all':!![]}];}_0x100c9e=_[_0xaa57('0x30')]({},_0x100c9e,_0x125fa6['options']);return db[_0xaa57('0x1f')][_0xaa57('0x31')](_0x100c9e)['then'](handleEntityNotFound(_0x561f08,null))[_0xaa57('0x17')](respondWithResult(_0x561f08,null))['catch'](handleError(_0x561f08,null));};exports[_0xaa57('0x32')]=function(_0x2bf472,_0xce9620){return db[_0xaa57('0x1f')]['create'](_0x2bf472['body'],{})[_0xaa57('0x17')](respondWithResult(_0xce9620,0xc9))[_0xaa57('0x33')](handleError(_0xce9620,null));};exports[_0xaa57('0x16')]=function(_0x2cc62d,_0x253938){if(_0x2cc62d[_0xaa57('0x34')]['id']){delete _0x2cc62d['body']['id'];}return db[_0xaa57('0x1f')][_0xaa57('0x31')]({'where':{'id':_0x2cc62d[_0xaa57('0x29')]['id']}})[_0xaa57('0x17')](handleEntityNotFound(_0x253938,null))[_0xaa57('0x17')](saveUpdates(_0x2cc62d[_0xaa57('0x34')],null))[_0xaa57('0x17')](respondWithResult(_0x253938,null))['catch'](handleError(_0x253938,null));};exports[_0xaa57('0x18')]=function(_0x3d7513,_0x1628b8){return db[_0xaa57('0x1f')]['find']({'where':{'id':_0x3d7513[_0xaa57('0x29')]['id']}})[_0xaa57('0x17')](handleEntityNotFound(_0x1628b8,null))[_0xaa57('0x17')](removeEntity(_0x1628b8,null))[_0xaa57('0x33')](handleError(_0x1628b8,null));};exports['describe']=function(_0x1603a8,_0xfc0525){return db[_0xaa57('0x1f')]['describe']()[_0xaa57('0x17')](respondWithResult(_0xfc0525,null))[_0xaa57('0x33')](handleError(_0xfc0525,null));};exports['addMessage']=function(_0x37bb0a,_0x58d840){return db[_0xaa57('0x35')][_0xaa57('0x31')]({'where':{'id':_0x37bb0a['params']['id']}})['then'](handleEntityNotFound(_0x58d840,null))[_0xaa57('0x17')](function(_0x2725f7){if(_0x2725f7){return _0x2725f7[_0xaa57('0x36')](_0x37bb0a[_0xaa57('0x34')][_0xaa57('0x37')],_['omit'](_0x37bb0a[_0xaa57('0x34')],[_0xaa57('0x37'),'id'])||{});}})[_0xaa57('0x17')](respondWithResult(_0x58d840,null))[_0xaa57('0x33')](handleError(_0x58d840,null));};exports[_0xaa57('0x38')]=function(_0x5a5a94,_0x459efb){var _0x8f1a82={'raw':![],'where':{}};var _0x473290={};var _0x373b03={'count':0x0,'rows':[]};return db[_0xaa57('0x1f')][_0xaa57('0x39')]({'where':{'id':_0x5a5a94['params']['id']}})['then'](handleEntityNotFound(_0x459efb,null))[_0xaa57('0x17')](function(_0xae6a73){if(_0xae6a73){_0x473290['model']=_[_0xaa57('0x2b')](db[_0xaa57('0x35')][_0xaa57('0x20')]);_0x473290['query']=_[_0xaa57('0x2b')](_0x5a5a94[_0xaa57('0x26')]);_0x473290[_0xaa57('0x2c')]=_[_0xaa57('0x2d')](_0x473290['model'],_0x473290[_0xaa57('0x26')]);_0x8f1a82[_0xaa57('0x2e')]=_[_0xaa57('0x2d')](_0x473290[_0xaa57('0x2a')],qs[_0xaa57('0x3a')](_0x5a5a94[_0xaa57('0x26')][_0xaa57('0x3a')]));_0x8f1a82[_0xaa57('0x2e')]=_0x8f1a82[_0xaa57('0x2e')][_0xaa57('0x3b')]?_0x8f1a82[_0xaa57('0x2e')]:_0x473290[_0xaa57('0x2a')];if(!_0x5a5a94[_0xaa57('0x26')][_0xaa57('0x3c')](_0xaa57('0x3d'))){_0x8f1a82[_0xaa57('0x12')]=qs[_0xaa57('0x12')](_0x5a5a94[_0xaa57('0x26')][_0xaa57('0x12')]);_0x8f1a82[_0xaa57('0xf')]=qs[_0xaa57('0xf')](_0x5a5a94['query'][_0xaa57('0xf')]);}_0x8f1a82['order']=qs[_0xaa57('0x3e')](_0x5a5a94[_0xaa57('0x26')][_0xaa57('0x3e')]);_0x8f1a82[_0xaa57('0x3f')]=qs[_0xaa57('0x2c')](_['pick'](_0x5a5a94['query'],_0x473290['filters']));_0x8f1a82[_0xaa57('0x3f')]['FaxInteractionId']=_0xae6a73['id'];if(_0x5a5a94['query']['filter']){_0x8f1a82[_0xaa57('0x3f')]=_['merge'](_0x8f1a82[_0xaa57('0x3f')],{'$or':_[_0xaa57('0x1e')](_0x8f1a82['attributes'],function(_0x3caabc){var _0x154024={};_0x154024[_0x3caabc]={'$like':'%'+_0x5a5a94[_0xaa57('0x26')][_0xaa57('0x40')]+'%'};return _0x154024;})});}if(_0x5a5a94[_0xaa57('0x26')][_0xaa57('0x41')]){var _0x12a2da=_0x5a5a94[_0xaa57('0x26')][_0xaa57('0x41')][_0xaa57('0x42')](',');var _0x469629={};_0x469629[_0x12a2da[0x0]]={'$gte':moment(_0x12a2da[0x1])[_0xaa57('0x43')](_0xaa57('0x44'))};_0x8f1a82[_0xaa57('0x3f')]=_[_0xaa57('0x30')](_0x8f1a82[_0xaa57('0x3f')],_0x469629);}_0x8f1a82=_[_0xaa57('0x30')]({},_0x8f1a82,_0x5a5a94['options']);return db[_0xaa57('0x35')][_0xaa57('0x11')]({'where':_0x8f1a82[_0xaa57('0x3f')]})[_0xaa57('0x17')](function(_0x44d02a){_0x373b03['count']=_0x44d02a;if(_0x5a5a94[_0xaa57('0x26')][_0xaa57('0x2f')]){_0x8f1a82['include']=[{'all':!![]}];}return db[_0xaa57('0x35')][_0xaa57('0x24')](_0x8f1a82);})['then'](function(_0x1baea0){_0x373b03[_0xaa57('0x45')]=_0x1baea0;return _0x373b03;});}})['then'](respondWithFilteredResult(_0x459efb,_0x8f1a82))[_0xaa57('0x33')](handleError(_0x459efb,null));};exports[_0xaa57('0x46')]=function(_0x2e7d07,_0x2b0987){return db[_0xaa57('0x1f')][_0xaa57('0x31')]({'where':{'id':_0x2e7d07[_0xaa57('0x29')]['id']}})[_0xaa57('0x17')](handleEntityNotFound(_0x2b0987,null))['then'](function(_0xa6a729){if(_0xa6a729){return _0xa6a729['setTags'](_0x2e7d07['body'][_0xaa57('0x37')],_['omit'](_0x2e7d07[_0xaa57('0x34')],[_0xaa57('0x37'),'id'])||{})[_0xaa57('0x47')](function(){return db[_0xaa57('0x48')][_0xaa57('0x24')]({'attributes':['id',_0xaa57('0x1b'),_0xaa57('0x49')],'where':{'id':_0x2e7d07[_0xaa57('0x34')]['ids']}});})['then'](function(_0x3d13ae){socket[_0xaa57('0x4a')](_0xaa57('0x4b'),{'id':Number(_0x2e7d07[_0xaa57('0x29')]['id']),'tags':_0x3d13ae||[]});return{'id':Number(_0x2e7d07[_0xaa57('0x29')]['id']),'tags':_0x3d13ae||[]};});}})['then'](respondWithResult(_0x2b0987,null))[_0xaa57('0x33')](handleError(_0x2b0987,null));};exports[_0xaa57('0x4c')]=function(_0x6a8903,_0x34c073){return db['FaxInteraction']['find']({'where':{'id':_0x6a8903[_0xaa57('0x29')]['id']}})[_0xaa57('0x17')](handleEntityNotFound(_0x34c073,null))[_0xaa57('0x17')](function(_0x140a5d){if(_0x140a5d){return _0x140a5d[_0xaa57('0x4c')](_0x6a8903[_0xaa57('0x26')][_0xaa57('0x37')]);}})[_0xaa57('0x17')](respondWithStatusCode(_0x34c073,null))[_0xaa57('0x33')](handleError(_0x34c073,null));};exports['download']=function(_0x4e0108,_0x424000){var _0x4a7f1c=moment()[_0xaa57('0x4d')]()[_0xaa57('0x4e')]();var _0x448560=path[_0xaa57('0x4f')](config[_0xaa57('0x50')],'server',_0xaa57('0x51'),_0xaa57('0x52'));var _0x194c67=path['join'](config[_0xaa57('0x50')],_0xaa57('0x53'),_0xaa57('0x51'),_0xaa57('0x54'));var _0x56c59=path['join'](_0x448560,_0x4a7f1c);var _0x4a4143=util[_0xaa57('0x43')]('transcript-%d-%s.zip',_0x4e0108[_0xaa57('0x29')]['id'],_0x4a7f1c);var _0x2f20d6=path[_0xaa57('0x4f')](_0x448560,_0x4a4143);var _0x887bef=[];_0x887bef[_0xaa57('0x55')]({'model':db['Attachment'],'as':_0xaa57('0x56'),'raw':!![]});var _0x168cdc=[{'model':db[_0xaa57('0x35')],'as':_0xaa57('0x57'),'attributes':['id',_0xaa57('0x34'),_0xaa57('0x58')],'include':_0x887bef}];return db[_0xaa57('0x1f')][_0xaa57('0x31')]({'where':{'id':_0x4e0108[_0xaa57('0x29')]['id']},'include':_0x168cdc})[_0xaa57('0x17')](handleEntityNotFound(_0x424000,null))[_0xaa57('0x17')](function(_0x5d0066){if(_0x5d0066&&_0x5d0066[_0xaa57('0x57')]){var _0x54ca7e=_0x5d0066[_0xaa57('0x59')]({'plain':!![]});fs[_0xaa57('0x5a')](_0x56c59);for(var _0x12b258=0x0;_0x12b258<_0x54ca7e[_0xaa57('0x57')][_0xaa57('0x3b')];_0x12b258++){var _0x430b66=_0x54ca7e[_0xaa57('0x57')][_0x12b258]['Attachment'];if(_0x430b66){var _0x74a836=path['join'](_0x194c67,_0x430b66[_0xaa57('0x5b')]);if(fs[_0xaa57('0x5c')](_0x74a836)){fs['createReadStream'](_0x74a836)['pipe'](fs[_0xaa57('0x5d')](path[_0xaa57('0x4f')](_0x56c59,_0x430b66[_0xaa57('0x5b')])));}}}return BPromise[_0xaa57('0x5e')]()[_0xaa57('0x17')](function(){return new BPromise(function(_0x524078,_0x4e8e16){zipdir(_0x56c59,{'saveTo':_0x2f20d6},function(_0x40f53e,_0x5bef6f){if(_0x40f53e)return _0x4e8e16(_0x40f53e);return _0x524078(_0x5bef6f);});})[_0xaa57('0x17')](function(){return new BPromise(function(_0x4bf92b,_0x22c7d8){rimraf(_0x56c59,function(_0x2520f4){if(_0x2520f4)_0x22c7d8(_0x2520f4);return _0x4bf92b();});});})['then'](function(){return _0x424000[_0xaa57('0x5f')](_0x2f20d6,_0x4a4143,function(_0x1dd03d){if(_0x1dd03d){console[_0xaa57('0x60')](_0xaa57('0x61'),_0x1dd03d);}else{fs[_0xaa57('0x62')](_0x2f20d6);}});});});}else{return _0x424000[_0xaa57('0x19')](0xc8);}})[_0xaa57('0x33')](handleError(_0x424000,null));};
\ No newline at end of file
index ba16c2e..fd42df0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7de1=['remove','getUsers','then','setDataValue','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7de1,0xe9));var _0x17de=function(_0x1d80be,_0x3a60ff){_0x1d80be=_0x1d80be-0x0;var _0xf9a4f3=_0x7de1[_0x1d80be];return _0xf9a4f3;};'use strict';var EventEmitter=require(_0x17de('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0x17de('0x1'))['db'][_0x17de('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x17de('0x3')](0x0);var events={'afterCreate':_0x17de('0x4'),'afterUpdate':'update','afterDestroy':_0x17de('0x5')};function emitEvent(_0x594021){return function(_0x222146,_0xb2ea6d,_0x2450d8){_0x222146[_0x17de('0x6')]({'attributes':['id'],'raw':!![]})[_0x17de('0x7')](function(_0x4b8170){_0x222146[_0x17de('0x8')]('Users',_0x4b8170[_0x17de('0x9')](function(_0x3faa4b){return{'id':_0x3faa4b['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x222146['id'],'direction':'in','read':![]},'raw':!![]});})[_0x17de('0x7')](function(_0x56b02d){_0x222146['setDataValue'](_0x17de('0xa'),_0x56b02d[_0x17de('0xb')]);FaxInteractionEvents[_0x17de('0xc')](_0x594021+':'+_0x222146['id'],_0x222146);FaxInteractionEvents[_0x17de('0xc')](_0x594021,_0x222146);_0x2450d8(null);})[_0x17de('0xd')](_0x2450d8(null));};}for(var e in events){if(events[_0x17de('0xe')](e)){var event=events[e];FaxInteraction[_0x17de('0xf')](e,emitEvent(event));}}module[_0x17de('0x10')]=FaxInteractionEvents;
\ No newline at end of file
+var _0x8bc7=['hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','setDataValue','length','emit','catch'];(function(_0x3a86fd,_0x11e999){var _0x719a16=function(_0x145705){while(--_0x145705){_0x3a86fd['push'](_0x3a86fd['shift']());}};_0x719a16(++_0x11e999);}(_0x8bc7,0x192));var _0x78bc=function(_0xf80fa7,_0x1e6555){_0xf80fa7=_0xf80fa7-0x0;var _0x13a80c=_0x8bc7[_0xf80fa7];return _0x13a80c;};'use strict';var EventEmitter=require(_0x78bc('0x0'));var FaxInteraction=require(_0x78bc('0x1'))['db'][_0x78bc('0x2')];var FaxMessage=require(_0x78bc('0x1'))['db'][_0x78bc('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x78bc('0x4')](0x0);var events={'afterCreate':_0x78bc('0x5'),'afterUpdate':_0x78bc('0x6'),'afterDestroy':_0x78bc('0x7')};function emitEvent(_0x583af7){return function(_0x321b20,_0x22e0c3,_0x174a1f){_0x321b20[_0x78bc('0x8')]({'attributes':['id'],'raw':!![]})[_0x78bc('0x9')](function(_0x2ed33e){_0x321b20['setDataValue'](_0x78bc('0xa'),_0x2ed33e[_0x78bc('0xb')](function(_0x4fb648){return{'id':_0x4fb648['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x321b20['id'],'direction':'in','read':![]},'raw':!![]});})[_0x78bc('0x9')](function(_0xa2cf63){_0x321b20[_0x78bc('0xc')]('unreadMessages',_0xa2cf63[_0x78bc('0xd')]);FaxInteractionEvents[_0x78bc('0xe')](_0x583af7+':'+_0x321b20['id'],_0x321b20);FaxInteractionEvents[_0x78bc('0xe')](_0x583af7,_0x321b20);_0x174a1f(null);})[_0x78bc('0xf')](_0x174a1f(null));};}for(var e in events){if(events[_0x78bc('0x10')](e)){var event=events[e];FaxInteraction[_0x78bc('0x11')](e,emitEvent(event));}}module[_0x78bc('0x12')]=FaxInteractionEvents;
\ No newline at end of file
index 71eca9c..416fe5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7373=['request-promise','path','rimraf','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x7373,0x1db));var _0x3737=function(_0x3e882f,_0x1e2cb4){_0x3e882f=_0x3e882f-0x0;var _0x2a5ca3=_0x7373[_0x3e882f];return _0x2a5ca3;};'use strict';var _=require(_0x3737('0x0'));var util=require('util');var logger=require(_0x3737('0x1'))(_0x3737('0x2'));var moment=require(_0x3737('0x3'));var BPromise=require(_0x3737('0x4'));var rp=require(_0x3737('0x5'));var fs=require('fs');var path=require(_0x3737('0x6'));var rimraf=require(_0x3737('0x7'));var config=require('../../config/environment');var attributes=require(_0x3737('0x8'));module[_0x3737('0x9')]=function(_0x4a09e4,_0x161ea0){return _0x4a09e4[_0x3737('0xa')](_0x3737('0xb'),attributes,{'tableName':_0x3737('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x227c95,_0x4c32cb,_0x3eccf4){if(_0x227c95[_0x3737('0xd')]('closed')){_0x227c95['closedAt']=moment()['format'](_0x3737('0xe'));}_0x3eccf4(null,_0x227c95);}}});};
\ No newline at end of file
+var _0x260e=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x260e,0x1b9));var _0xe260=function(_0x1b8920,_0x8018d8){_0x1b8920=_0x1b8920-0x0;var _0xa1ccc0=_0x260e[_0x1b8920];return _0xa1ccc0;};'use strict';var _=require(_0xe260('0x0'));var util=require(_0xe260('0x1'));var logger=require(_0xe260('0x2'))(_0xe260('0x3'));var moment=require(_0xe260('0x4'));var BPromise=require(_0xe260('0x5'));var rp=require(_0xe260('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe260('0x7'));var config=require(_0xe260('0x8'));var attributes=require(_0xe260('0x9'));module[_0xe260('0xa')]=function(_0x5dfb93,_0x1e44c1){return _0x5dfb93[_0xe260('0xb')](_0xe260('0xc'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x306da6,_0x222bdc,_0x1c3d41){if(_0x306da6[_0xe260('0xd')](_0xe260('0xe'))){_0x306da6[_0xe260('0xf')]=moment()['format'](_0xe260('0x10'));}_0x1c3d41(null,_0x306da6);}}});};
\ No newline at end of file
index 7dd27e5..0103b99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9271=['message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','attributes','limit','AddTagsToFaxInteraction','find','addTags','ids','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','request','then','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x344ea8,_0x2f3904){var _0xad3e9c=function(_0x5ca14){while(--_0x5ca14){_0x344ea8['push'](_0x344ea8['shift']());}};_0xad3e9c(++_0x2f3904);}(_0x9271,0x1e4));var _0x1927=function(_0x1d7519,_0x294bf5){_0x1d7519=_0x1d7519-0x0;var _0x5c3f1a=_0x9271[_0x1d7519];return _0x5c3f1a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1927('0x0'));var BPromise=require(_0x1927('0x1'));var rs=require(_0x1927('0x2'));var fs=require('fs');var Redis=require(_0x1927('0x3'));var db=require(_0x1927('0x4'))['db'];var utils=require(_0x1927('0x5'));var logger=require('../../config/logger')(_0x1927('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x1927('0x7')]({'port':0x232a});config[_0x1927('0x8')]=_[_0x1927('0x9')](config[_0x1927('0x8')],{'host':_0x1927('0xa'),'port':0x18eb});var socket=require(_0x1927('0xb'))(new Redis(config[_0x1927('0x8')]));require(_0x1927('0xc'))['register'](socket);function respondWithRpcPromise(_0x23949c,_0x27dfac,_0x24a7d9){return new BPromise(function(_0xaf5009,_0x25c395){return client[_0x1927('0xd')](_0x23949c,_0x24a7d9)[_0x1927('0xe')](function(_0x32b3a8){logger[_0x1927('0xf')](_0x1927('0x10'),_0x27dfac,'request\x20sent');logger[_0x1927('0x11')](_0x1927('0x12'),_0x27dfac,_0x1927('0x13'),JSON[_0x1927('0x14')](_0x32b3a8));if(_0x32b3a8['error']){if(_0x32b3a8[_0x1927('0x15')][_0x1927('0x16')]===0x1f4){logger[_0x1927('0x15')](_0x1927('0x10'),_0x27dfac,_0x32b3a8[_0x1927('0x15')][_0x1927('0x17')]);return _0x25c395(_0x32b3a8[_0x1927('0x15')][_0x1927('0x17')]);}logger[_0x1927('0x15')](_0x1927('0x10'),_0x27dfac,_0x32b3a8[_0x1927('0x15')]['message']);return _0xaf5009(_0x32b3a8['error'][_0x1927('0x17')]);}else{logger[_0x1927('0xf')]('FaxInteraction,\x20%s,\x20%s',_0x27dfac,_0x1927('0x13'));_0xaf5009(_0x32b3a8[_0x1927('0x18')][_0x1927('0x17')]);}})[_0x1927('0x19')](function(_0x3e318e){logger['error'](_0x1927('0x10'),_0x27dfac,_0x3e318e);_0x25c395(_0x3e318e);});});}exports[_0x1927('0x1a')]=function(_0x57b5d1){var _0x781273=this;return new Promise(function(_0x201150,_0x391131){return db[_0x1927('0x1b')][_0x1927('0x1c')](_0x57b5d1[_0x1927('0x1d')],{'raw':_0x57b5d1[_0x1927('0x1e')]?_0x57b5d1['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57b5d1[_0x1927('0x1e')]?_0x57b5d1[_0x1927('0x1e')]['where']||null:null,'attributes':_0x57b5d1[_0x1927('0x1e')]?_0x57b5d1['options'][_0x1927('0x1f')]||null:null,'limit':_0x57b5d1[_0x1927('0x1e')]?_0x57b5d1[_0x1927('0x1e')][_0x1927('0x20')]||null:null})[_0x1927('0xe')](function(_0x5885cd){logger[_0x1927('0xf')](_0x1927('0x1a'),_0x57b5d1);logger[_0x1927('0x11')](_0x1927('0x1a'),_0x57b5d1,JSON[_0x1927('0x14')](_0x5885cd));_0x201150(_0x5885cd);})[_0x1927('0x19')](function(_0x44de57){logger[_0x1927('0x15')](_0x1927('0x1a'),_0x44de57['message'],_0x57b5d1);_0x391131(_0x781273[_0x1927('0x15')](0x1f4,_0x44de57[_0x1927('0x17')]));});});};exports[_0x1927('0x21')]=function(_0x503cba){return new Promise(function(_0x5c7c8d,_0x3194eb){return db[_0x1927('0x1b')][_0x1927('0x22')]({'where':_0x503cba[_0x1927('0x1e')]?_0x503cba[_0x1927('0x1e')]['where']||null:null})[_0x1927('0xe')](function(_0x151b63){if(_0x151b63){return _0x151b63[_0x1927('0x23')](_0x503cba[_0x1927('0x1d')][_0x1927('0x24')],_['omit'](_0x503cba['body'],[_0x1927('0x24'),'id'])||{});}})[_0x1927('0x25')](function(_0x3af6e8){logger[_0x1927('0xf')](_0x1927('0x26'),_0x503cba);logger[_0x1927('0x11')]('AddTags',_0x503cba,JSON[_0x1927('0x14')](_0x3af6e8));_0x5c7c8d(_0x3af6e8);})[_0x1927('0x19')](function(_0x31957d){logger[_0x1927('0x15')](_0x1927('0x26'),_0x31957d['message'],_0x503cba);_0x3194eb(_this[_0x1927('0x15')](0x1f4,_0x31957d[_0x1927('0x17')]));});});};
\ No newline at end of file
+var _0xf34f=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','request','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','body','options','where','attributes','then','info','UpdateFaxInteraction','FaxInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x36949f,_0xac8926){var _0x225ac9=function(_0x234feb){while(--_0x234feb){_0x36949f['push'](_0x36949f['shift']());}};_0x225ac9(++_0xac8926);}(_0xf34f,0x18a));var _0xff34=function(_0x4ca061,_0x32e1c7){_0x4ca061=_0x4ca061-0x0;var _0x44c3a1=_0xf34f[_0x4ca061];return _0x44c3a1;};'use strict';var _=require(_0xff34('0x0'));var util=require(_0xff34('0x1'));var moment=require(_0xff34('0x2'));var BPromise=require(_0xff34('0x3'));var rs=require(_0xff34('0x4'));var fs=require('fs');var Redis=require(_0xff34('0x5'));var db=require(_0xff34('0x6'))['db'];var utils=require(_0xff34('0x7'));var logger=require(_0xff34('0x8'))(_0xff34('0x9'));var config=require(_0xff34('0xa'));var jayson=require(_0xff34('0xb'));var client=jayson['client'][_0xff34('0xc')]({'port':0x232a});config[_0xff34('0xd')]=_[_0xff34('0xe')](config[_0xff34('0xd')],{'host':_0xff34('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xff34('0xd')]));require('./faxInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x5a9821,_0x2f3c8d,_0xb81940){return new BPromise(function(_0x598760,_0x58a891){return client[_0xff34('0x10')](_0x5a9821,_0xb81940)['then'](function(_0x59fa5f){logger['info'](_0xff34('0x11'),_0x2f3c8d,_0xff34('0x12'));logger[_0xff34('0x13')](_0xff34('0x14'),_0x2f3c8d,'request\x20sent',JSON[_0xff34('0x15')](_0x59fa5f));if(_0x59fa5f[_0xff34('0x16')]){if(_0x59fa5f[_0xff34('0x16')][_0xff34('0x17')]===0x1f4){logger[_0xff34('0x16')](_0xff34('0x11'),_0x2f3c8d,_0x59fa5f[_0xff34('0x16')]['message']);return _0x58a891(_0x59fa5f[_0xff34('0x16')][_0xff34('0x18')]);}logger[_0xff34('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x2f3c8d,_0x59fa5f[_0xff34('0x16')]['message']);return _0x598760(_0x59fa5f[_0xff34('0x16')][_0xff34('0x18')]);}else{logger['info'](_0xff34('0x11'),_0x2f3c8d,_0xff34('0x12'));_0x598760(_0x59fa5f[_0xff34('0x19')][_0xff34('0x18')]);}})[_0xff34('0x1a')](function(_0x4d8fc5){logger[_0xff34('0x16')](_0xff34('0x11'),_0x2f3c8d,_0x4d8fc5);_0x58a891(_0x4d8fc5);});});}exports['UpdateFaxInteraction']=function(_0x27c73a){var _0x25e843=this;return new Promise(function(_0x1050d0,_0x3f7570){return db['FaxInteraction']['update'](_0x27c73a[_0xff34('0x1b')],{'raw':_0x27c73a['options']?_0x27c73a[_0xff34('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27c73a[_0xff34('0x1c')]?_0x27c73a[_0xff34('0x1c')][_0xff34('0x1d')]||null:null,'attributes':_0x27c73a[_0xff34('0x1c')]?_0x27c73a[_0xff34('0x1c')][_0xff34('0x1e')]||null:null,'limit':_0x27c73a['options']?_0x27c73a[_0xff34('0x1c')]['limit']||null:null})[_0xff34('0x1f')](function(_0x2ee256){logger[_0xff34('0x20')]('UpdateFaxInteraction',_0x27c73a);logger[_0xff34('0x13')](_0xff34('0x21'),_0x27c73a,JSON['stringify'](_0x2ee256));_0x1050d0(_0x2ee256);})[_0xff34('0x1a')](function(_0x1a4ea6){logger[_0xff34('0x16')](_0xff34('0x21'),_0x1a4ea6[_0xff34('0x18')],_0x27c73a);_0x3f7570(_0x25e843['error'](0x1f4,_0x1a4ea6[_0xff34('0x18')]));});});};exports['AddTagsToFaxInteraction']=function(_0x245be0){return new Promise(function(_0x420feb,_0x400992){return db[_0xff34('0x22')][_0xff34('0x23')]({'where':_0x245be0[_0xff34('0x1c')]?_0x245be0['options'][_0xff34('0x1d')]||null:null})[_0xff34('0x1f')](function(_0x3e2d3e){if(_0x3e2d3e){return _0x3e2d3e[_0xff34('0x24')](_0x245be0[_0xff34('0x1b')][_0xff34('0x25')],_['omit'](_0x245be0[_0xff34('0x1b')],['ids','id'])||{});}})[_0xff34('0x26')](function(_0x24150f){logger[_0xff34('0x20')](_0xff34('0x27'),_0x245be0);logger['debug']('AddTags',_0x245be0,JSON['stringify'](_0x24150f));_0x420feb(_0x24150f);})[_0xff34('0x1a')](function(_0x3dfd17){logger[_0xff34('0x16')]('AddTags',_0x3dfd17[_0xff34('0x18')],_0x245be0);_0x400992(_this[_0xff34('0x16')](0x1f4,_0x3dfd17[_0xff34('0x18')]));});});};
\ No newline at end of file
index 036aa99..4c905c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc663=['length','faxInteraction:','./faxInteraction.events','save','update','emit','removeListener','register'];(function(_0x3176bf,_0x4e6834){var _0x355328=function(_0x27ae38){while(--_0x27ae38){_0x3176bf['push'](_0x3176bf['shift']());}};_0x355328(++_0x4e6834);}(_0xc663,0x1ca));var _0x3c66=function(_0x3df223,_0x1740fc){_0x3df223=_0x3df223-0x0;var _0x562d11=_0xc663[_0x3df223];return _0x562d11;};'use strict';var FaxInteractionEvents=require(_0x3c66('0x0'));var events=[_0x3c66('0x1'),'remove',_0x3c66('0x2')];function createListener(_0x324530,_0x517a5b){return function(_0xcf2d5d){_0x517a5b[_0x3c66('0x3')](_0x324530,_0xcf2d5d);};}function removeListener(_0x9fbc8c,_0x2a63a6){return function(){FaxInteractionEvents[_0x3c66('0x4')](_0x9fbc8c,_0x2a63a6);};}exports[_0x3c66('0x5')]=function(_0x312fda){for(var _0x171da9=0x0,_0x3d22c2=events[_0x3c66('0x6')];_0x171da9<_0x3d22c2;_0x171da9++){var _0x2e8a86=events[_0x171da9];var _0x22d9a6=createListener(_0x3c66('0x7')+_0x2e8a86,_0x312fda);FaxInteractionEvents['on'](_0x2e8a86,_0x22d9a6);}};
\ No newline at end of file
+var _0xcc34=['remove','update','emit','removeListener','length','save'];(function(_0x135073,_0x227678){var _0x4cf5ef=function(_0x3baeaf){while(--_0x3baeaf){_0x135073['push'](_0x135073['shift']());}};_0x4cf5ef(++_0x227678);}(_0xcc34,0x119));var _0x4cc3=function(_0x30ed61,_0x180ebd){_0x30ed61=_0x30ed61-0x0;var _0x518333=_0xcc34[_0x30ed61];return _0x518333;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x4cc3('0x0'),_0x4cc3('0x1'),_0x4cc3('0x2')];function createListener(_0x41c3d2,_0x2f6f88){return function(_0x4aa022){_0x2f6f88[_0x4cc3('0x3')](_0x41c3d2,_0x4aa022);};}function removeListener(_0x5660f6,_0x17a99e){return function(){FaxInteractionEvents[_0x4cc3('0x4')](_0x5660f6,_0x17a99e);};}exports['register']=function(_0x43c876){for(var _0x812dd8=0x0,_0x1f4571=events[_0x4cc3('0x5')];_0x812dd8<_0x1f4571;_0x812dd8++){var _0x57e16c=events[_0x812dd8];var _0x24b169=createListener('faxInteraction:'+_0x57e16c,_0x43c876);FaxInteractionEvents['on'](_0x57e16c,_0x24b169);}};
\ No newline at end of file
index edbcb6f..be00a10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3cd=['/:id/messages','addMessage','/:id/tags','tracked','faxinteraction:addtags','addTags','put','/:id','fax','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','getMessages','/:id/download','download','post'];(function(_0x3685b0,_0x111044){var _0x548adb=function(_0x26c306){while(--_0x26c306){_0x3685b0['push'](_0x3685b0['shift']());}};_0x548adb(++_0x111044);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xf3cd[_0x102e37];return _0x35a07c;};'use strict';var multer=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var path=require(_0xdf3c('0x2'));var timeout=require(_0xdf3c('0x3'));var express=require(_0xdf3c('0x4'));var router=express[_0xdf3c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdf3c('0x6'));var interaction=require(_0xdf3c('0x7'));var config=require(_0xdf3c('0x8'));var controller=require('./faxInteraction.controller');router[_0xdf3c('0x9')]('/',auth[_0xdf3c('0xa')](),controller[_0xdf3c('0xb')]);router[_0xdf3c('0x9')](_0xdf3c('0xc'),auth[_0xdf3c('0xa')](),controller['describe']);router[_0xdf3c('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xdf3c('0xd')]);router[_0xdf3c('0x9')]('/:id/messages',auth[_0xdf3c('0xa')](),controller[_0xdf3c('0xe')]);router[_0xdf3c('0x9')](_0xdf3c('0xf'),auth[_0xdf3c('0xa')](),controller[_0xdf3c('0x10')]);router[_0xdf3c('0x11')]('/',auth[_0xdf3c('0xa')](),controller['create']);router[_0xdf3c('0x11')](_0xdf3c('0x12'),auth[_0xdf3c('0xa')](),controller[_0xdf3c('0x13')]);router['post'](_0xdf3c('0x14'),auth[_0xdf3c('0xa')](),interaction[_0xdf3c('0x15')]('fax',_0xdf3c('0x16')),controller[_0xdf3c('0x17')]);router[_0xdf3c('0x18')](_0xdf3c('0x19'),auth[_0xdf3c('0xa')](),interaction[_0xdf3c('0x15')](_0xdf3c('0x1a'),_0xdf3c('0x1b')),controller[_0xdf3c('0x1c')]);router[_0xdf3c('0x1d')]('/:id',auth[_0xdf3c('0xa')](),interaction[_0xdf3c('0x15')](_0xdf3c('0x1a'),_0xdf3c('0x1e')),controller[_0xdf3c('0x1f')]);router[_0xdf3c('0x1d')](_0xdf3c('0x14'),auth[_0xdf3c('0xa')](),controller[_0xdf3c('0x20')]);module[_0xdf3c('0x21')]=router;
\ No newline at end of file
+var _0x3077=['express','fs-extra','./faxInteraction.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','faxinteraction:addtags','addTags','put','fax','faxinteraction:update','update','faxinteraction:destroy','delete','removeTags','exports','multer','util'];(function(_0x5b614c,_0xd1581b){var _0x1391ef=function(_0x58a76f){while(--_0x58a76f){_0x5b614c['push'](_0x5b614c['shift']());}};_0x1391ef(++_0xd1581b);}(_0x3077,0xe6));var _0x7307=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x3077[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require(_0x7307('0x0'));var util=require(_0x7307('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7307('0x2'));var router=express['Router']();var fs_extra=require(_0x7307('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7307('0x4'));router[_0x7307('0x5')]('/',auth[_0x7307('0x6')](),controller[_0x7307('0x7')]);router[_0x7307('0x5')]('/describe',auth[_0x7307('0x6')](),controller['describe']);router['get'](_0x7307('0x8'),auth['isAuthenticated'](),controller[_0x7307('0x9')]);router[_0x7307('0x5')](_0x7307('0xa'),auth[_0x7307('0x6')](),controller[_0x7307('0xb')]);router[_0x7307('0x5')](_0x7307('0xc'),auth[_0x7307('0x6')](),controller[_0x7307('0xd')]);router[_0x7307('0xe')]('/',auth[_0x7307('0x6')](),controller[_0x7307('0xf')]);router['post'](_0x7307('0xa'),auth[_0x7307('0x6')](),controller[_0x7307('0x10')]);router[_0x7307('0xe')](_0x7307('0x11'),auth[_0x7307('0x6')](),interaction[_0x7307('0x12')]('fax',_0x7307('0x13')),controller[_0x7307('0x14')]);router[_0x7307('0x15')](_0x7307('0x8'),auth[_0x7307('0x6')](),interaction[_0x7307('0x12')](_0x7307('0x16'),_0x7307('0x17')),controller[_0x7307('0x18')]);router['delete']('/:id',auth[_0x7307('0x6')](),interaction[_0x7307('0x12')](_0x7307('0x16'),_0x7307('0x19')),controller['destroy']);router[_0x7307('0x1a')](_0x7307('0x11'),auth['isAuthenticated'](),controller[_0x7307('0x1b')]);module[_0x7307('0x1c')]=router;
\ No newline at end of file
index af2007e..707d599 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fad=['DATE','sequelize','exports','TEXT','medium','ENUM','out'];(function(_0x42db2e,_0x225653){var _0x391cbc=function(_0x4cc336){while(--_0x4cc336){_0x42db2e['push'](_0x42db2e['shift']());}};_0x391cbc(++_0x225653);}(_0x6fad,0x174));var _0xd6fa=function(_0x3b3a82,_0x53b5e0){_0x3b3a82=_0x3b3a82-0x0;var _0x267063=_0x6fad[_0x3b3a82];return _0x267063;};'use strict';var Sequelize=require(_0xd6fa('0x0'));module[_0xd6fa('0x1')]={'body':{'type':Sequelize[_0xd6fa('0x2')](_0xd6fa('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd6fa('0x4')]('in','out'),'defaultValue':_0xd6fa('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xd6fa('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xd6fa('0x6')]}};
\ No newline at end of file
+var _0x35aa=['medium','BOOLEAN','out','DATE','exports','TEXT'];(function(_0x1e3923,_0x477ce9){var _0x36cd0f=function(_0x48e77d){while(--_0x48e77d){_0x1e3923['push'](_0x1e3923['shift']());}};_0x36cd0f(++_0x477ce9);}(_0x35aa,0xbe));var _0xa35a=function(_0x5e2080,_0x29fafa){_0x5e2080=_0x5e2080-0x0;var _0x17d447=_0x35aa[_0x5e2080];return _0x17d447;};'use strict';var Sequelize=require('sequelize');module[_0xa35a('0x0')]={'body':{'type':Sequelize[_0xa35a('0x1')](_0xa35a('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xa35a('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xa35a('0x4')),'defaultValue':_0xa35a('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xa35a('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xa35a('0x5')]}};
\ No newline at end of file
index 4f3b2eb..64590e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1d8=['then','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','destroy','stack','name','send','map','FaxMessage','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','body','describe','fax-interactions','accept','fax','readAt','format','UserId','user','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','agent','email','internal','interface','SIP/%s','channel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','Sequelize','fullname','motionChannel','rejectmessage','create','CmContact','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','files','attachments','Attachment','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','http','client','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe1d8,0x70));var _0x8e1d=function(_0x21f58b,_0x24aa9a){_0x21f58b=_0x21f58b-0x0;var _0x5afa91=_0xe1d8[_0x21f58b];return _0x5afa91;};'use strict';var emlformat=require(_0x8e1d('0x0'));var rimraf=require(_0x8e1d('0x1'));var zipdir=require(_0x8e1d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8e1d('0x3'));var moment=require(_0x8e1d('0x4'));var BPromise=require(_0x8e1d('0x5'));var Mustache=require(_0x8e1d('0x6'));var util=require(_0x8e1d('0x7'));var path=require(_0x8e1d('0x8'));var sox=require(_0x8e1d('0x9'));var csv=require(_0x8e1d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8e1d('0xb'));var _=require(_0x8e1d('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8e1d('0xd'));var deskjs=require(_0x8e1d('0xe'));var toCsv=require(_0x8e1d('0xa'));var querystring=require('querystring');var Papa=require(_0x8e1d('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8e1d('0x10'));var hardwareService=require(_0x8e1d('0x11'));var logger=require(_0x8e1d('0x12'))('api');var utils=require(_0x8e1d('0x13'));var config=require(_0x8e1d('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8e1d('0x15'))['db'];config[_0x8e1d('0x16')]=_[_0x8e1d('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8e1d('0x18'))(new Redis(config[_0x8e1d('0x16')]));require('./faxMessage.socket')[_0x8e1d('0x19')](socket);var jayson=require(_0x8e1d('0x1a'));var client=jayson['client'][_0x8e1d('0x1b')]({'port':0x232c});var client9002=jayson[_0x8e1d('0x1c')][_0x8e1d('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x340265,_0x288955,_0x2683ea,_0x485beb){return new BPromise(function(_0x3d9d96,_0x51a6bf){var _0x962420=_0x485beb||client;return _0x962420[_0x8e1d('0x1d')](_0x340265,_0x2683ea)[_0x8e1d('0x1e')](function(_0xe03d9b){logger['info']('FaxMessage,\x20%s,\x20%s',_0x288955,_0x8e1d('0x1f'));logger[_0x8e1d('0x20')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x288955,_0x8e1d('0x1f'),JSON[_0x8e1d('0x21')](_0xe03d9b));if(_0xe03d9b['error']){if(_0xe03d9b[_0x8e1d('0x22')][_0x8e1d('0x23')]===0x1f4){logger[_0x8e1d('0x22')](_0x8e1d('0x24'),_0x288955,_0xe03d9b[_0x8e1d('0x22')][_0x8e1d('0x25')]);return _0x51a6bf(_0xe03d9b[_0x8e1d('0x22')][_0x8e1d('0x25')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x288955,_0xe03d9b[_0x8e1d('0x22')]['message']);return _0x3d9d96(_0xe03d9b[_0x8e1d('0x22')][_0x8e1d('0x25')]);}else{logger[_0x8e1d('0x26')](_0x8e1d('0x24'),_0x288955,_0x8e1d('0x1f'));_0x3d9d96(_0xe03d9b[_0x8e1d('0x27')][_0x8e1d('0x25')]);}})[_0x8e1d('0x28')](function(_0x2c7454){logger[_0x8e1d('0x22')]('FaxMessage,\x20%s,\x20%s',_0x288955,_0x2c7454);_0x51a6bf(_0x2c7454);});});}function respondWithStatusCode(_0x350c2d,_0x36e541){_0x36e541=_0x36e541||0xcc;return function(_0x20bce1){if(_0x20bce1){return _0x350c2d[_0x8e1d('0x29')](_0x36e541);}return _0x350c2d[_0x8e1d('0x2a')](_0x36e541)[_0x8e1d('0x2b')]();};}function respondWithResult(_0x2d22fe,_0x5d2304){_0x5d2304=_0x5d2304||0xc8;return function(_0x2ff0ca){if(_0x2ff0ca){return _0x2d22fe['status'](_0x5d2304)[_0x8e1d('0x2c')](_0x2ff0ca);}};}function respondWithFilteredResult(_0x3dd666,_0x35394b){return function(_0x4422ad){if(_0x4422ad){var _0x3ed83d=typeof _0x35394b[_0x8e1d('0x2d')]===_0x8e1d('0x2e')&&typeof _0x35394b[_0x8e1d('0x2f')]==='undefined';var _0x56cdb4=_0x4422ad['count'];var _0x4b4e39=_0x3ed83d?0x0:_0x35394b[_0x8e1d('0x2d')];var _0x29e2ec=_0x3ed83d?_0x4422ad[_0x8e1d('0x30')]:_0x35394b[_0x8e1d('0x2d')]+_0x35394b[_0x8e1d('0x2f')];var _0x3bc159;if(_0x29e2ec>=_0x56cdb4){_0x29e2ec=_0x56cdb4;_0x3bc159=0xc8;}else{_0x3bc159=0xce;}_0x3dd666['status'](_0x3bc159);return _0x3dd666[_0x8e1d('0x31')]('Content-Range',_0x4b4e39+'-'+_0x29e2ec+'/'+_0x56cdb4)[_0x8e1d('0x2c')](_0x4422ad);}return null;};}function patchUpdates(_0x1b5aca){return function(_0x35aa63){try{jsonpatch[_0x8e1d('0x32')](_0x35aa63,_0x1b5aca,!![]);}catch(_0x1702e7){return BPromise['reject'](_0x1702e7);}return _0x35aa63[_0x8e1d('0x33')]();};}function saveUpdates(_0x2fa396,_0x4ee5d1){return function(_0x58f304){if(_0x58f304){return _0x58f304[_0x8e1d('0x34')](_0x2fa396)['then'](function(_0x552538){return _0x552538;});}return null;};}function removeEntity(_0x659c7c,_0x5de444){return function(_0x19ff9f){if(_0x19ff9f){return _0x19ff9f[_0x8e1d('0x35')]()[_0x8e1d('0x1e')](function(){_0x659c7c[_0x8e1d('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20c675,_0x55e3f2){return function(_0x56889f){if(!_0x56889f){_0x20c675['sendStatus'](0x194);}return _0x56889f;};}function handleError(_0x259ef7,_0x34f0f1){_0x34f0f1=_0x34f0f1||0x1f4;return function(_0x2349a7){logger[_0x8e1d('0x22')](_0x2349a7[_0x8e1d('0x36')]);if(_0x2349a7['name']){delete _0x2349a7[_0x8e1d('0x37')];}_0x259ef7[_0x8e1d('0x2a')](_0x34f0f1)[_0x8e1d('0x38')](_0x2349a7);};}exports['index']=function(_0x3d0c67,_0x86850){var _0x3ee268={},_0x145a02={},_0x36a2f7={'count':0x0,'rows':[]};var _0xc74439=_[_0x8e1d('0x39')](db[_0x8e1d('0x3a')][_0x8e1d('0x3b')],function(_0x32850b){return{'name':_0x32850b[_0x8e1d('0x3c')],'type':_0x32850b[_0x8e1d('0x3d')][_0x8e1d('0x3e')]};});_0x145a02[_0x8e1d('0x3f')]=_[_0x8e1d('0x39')](_0xc74439,'name');_0x145a02['query']=_[_0x8e1d('0x40')](_0x3d0c67[_0x8e1d('0x41')]);_0x145a02['filters']=_[_0x8e1d('0x42')](_0x145a02['model'],_0x145a02[_0x8e1d('0x41')]);_0x3ee268['attributes']=_[_0x8e1d('0x42')](_0x145a02[_0x8e1d('0x3f')],qs[_0x8e1d('0x43')](_0x3d0c67[_0x8e1d('0x41')][_0x8e1d('0x43')]));_0x3ee268['attributes']=_0x3ee268[_0x8e1d('0x44')][_0x8e1d('0x45')]?_0x3ee268[_0x8e1d('0x44')]:_0x145a02[_0x8e1d('0x3f')];if(!_0x3d0c67['query'][_0x8e1d('0x46')](_0x8e1d('0x47'))){_0x3ee268['limit']=qs[_0x8e1d('0x2f')](_0x3d0c67['query'][_0x8e1d('0x2f')]);_0x3ee268['offset']=qs[_0x8e1d('0x2d')](_0x3d0c67[_0x8e1d('0x41')][_0x8e1d('0x2d')]);}_0x3ee268['order']=qs[_0x8e1d('0x48')](_0x3d0c67['query']['sort']);_0x3ee268[_0x8e1d('0x49')]=qs[_0x8e1d('0x4a')](_[_0x8e1d('0x4b')](_0x3d0c67[_0x8e1d('0x41')],_0x145a02['filters']),_0xc74439);if(_0x3d0c67[_0x8e1d('0x41')][_0x8e1d('0x4c')]){_0x3ee268[_0x8e1d('0x49')]=_[_0x8e1d('0x4d')](_0x3ee268[_0x8e1d('0x49')],{'$or':_[_0x8e1d('0x39')](_0xc74439,function(_0x10fd8f){if(_0x10fd8f[_0x8e1d('0x3d')]!==_0x8e1d('0x4e')){var _0x234899={};_0x234899[_0x10fd8f[_0x8e1d('0x37')]]={'$like':'%'+_0x3d0c67[_0x8e1d('0x41')][_0x8e1d('0x4c')]+'%'};return _0x234899;}})});}_0x3ee268=_[_0x8e1d('0x4d')]({},_0x3ee268,_0x3d0c67[_0x8e1d('0x4f')]);var _0xd8f7e2={'where':_0x3ee268['where']};return db[_0x8e1d('0x3a')][_0x8e1d('0x30')](_0xd8f7e2)[_0x8e1d('0x1e')](function(_0x469452){_0x36a2f7[_0x8e1d('0x30')]=_0x469452;if(_0x3d0c67['query']['includeAll']){_0x3ee268[_0x8e1d('0x50')]=[{'all':!![]}];}return db[_0x8e1d('0x3a')][_0x8e1d('0x51')](_0x3ee268);})['then'](function(_0x1d475d){_0x36a2f7[_0x8e1d('0x52')]=_0x1d475d;return _0x36a2f7;})['then'](respondWithFilteredResult(_0x86850,_0x3ee268))[_0x8e1d('0x28')](handleError(_0x86850,null));};exports[_0x8e1d('0x53')]=function(_0x4ff47d,_0x2ac56e){var _0x2510a8={'raw':!![],'where':{'id':_0x4ff47d[_0x8e1d('0x54')]['id']}},_0x39b70a={};_0x39b70a['model']=_[_0x8e1d('0x40')](db['FaxMessage']['rawAttributes']);_0x39b70a['query']=_[_0x8e1d('0x40')](_0x4ff47d[_0x8e1d('0x41')]);_0x39b70a[_0x8e1d('0x4a')]=_[_0x8e1d('0x42')](_0x39b70a[_0x8e1d('0x3f')],_0x39b70a[_0x8e1d('0x41')]);_0x2510a8['attributes']=_[_0x8e1d('0x42')](_0x39b70a[_0x8e1d('0x3f')],qs[_0x8e1d('0x43')](_0x4ff47d[_0x8e1d('0x41')][_0x8e1d('0x43')]));_0x2510a8[_0x8e1d('0x44')]=_0x2510a8[_0x8e1d('0x44')][_0x8e1d('0x45')]?_0x2510a8[_0x8e1d('0x44')]:_0x39b70a[_0x8e1d('0x3f')];if(_0x4ff47d[_0x8e1d('0x41')][_0x8e1d('0x55')]){_0x2510a8[_0x8e1d('0x50')]=[{'all':!![]}];}_0x2510a8=_[_0x8e1d('0x4d')]({},_0x2510a8,_0x4ff47d['options']);return db['FaxMessage'][_0x8e1d('0x56')](_0x2510a8)['then'](handleEntityNotFound(_0x2ac56e,null))[_0x8e1d('0x1e')](respondWithResult(_0x2ac56e,null))[_0x8e1d('0x28')](handleError(_0x2ac56e,null));};exports[_0x8e1d('0x34')]=function(_0x12b91d,_0x2f00fa){if(_0x12b91d[_0x8e1d('0x57')]['id']){delete _0x12b91d[_0x8e1d('0x57')]['id'];}return db[_0x8e1d('0x3a')][_0x8e1d('0x56')]({'where':{'id':_0x12b91d[_0x8e1d('0x54')]['id']}})[_0x8e1d('0x1e')](handleEntityNotFound(_0x2f00fa,null))['then'](saveUpdates(_0x12b91d['body'],null))['then'](respondWithResult(_0x2f00fa,null))['catch'](handleError(_0x2f00fa,null));};exports[_0x8e1d('0x35')]=function(_0x51417a,_0x37e208){return db[_0x8e1d('0x3a')][_0x8e1d('0x56')]({'where':{'id':_0x51417a['params']['id']}})[_0x8e1d('0x1e')](handleEntityNotFound(_0x37e208,null))[_0x8e1d('0x1e')](removeEntity(_0x37e208,null))[_0x8e1d('0x28')](handleError(_0x37e208,null));};exports[_0x8e1d('0x58')]=function(_0x480101,_0x2532ce){return db[_0x8e1d('0x3a')][_0x8e1d('0x58')]()[_0x8e1d('0x1e')](respondWithResult(_0x2532ce,null))[_0x8e1d('0x28')](handleError(_0x2532ce,null));};var interaction_log=require(_0x8e1d('0x12'))(_0x8e1d('0x59'));exports[_0x8e1d('0x5a')]=function(_0x575536,_0x493c19,_0x4a530d){var _0x65cca7={'agent':{},'channel':_0x8e1d('0x5b')};if(_0x575536[_0x8e1d('0x57')]['id']){delete _0x575536[_0x8e1d('0x57')]['id'];}_0x575536['body']['read']=!![];_0x575536[_0x8e1d('0x57')][_0x8e1d('0x5c')]=moment()[_0x8e1d('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x575536['body'][_0x8e1d('0x5e')]=_0x575536[_0x8e1d('0x57')][_0x8e1d('0x5e')]||_0x575536[_0x8e1d('0x5f')]['id'];_0x65cca7['agent']['id']=_0x575536[_0x8e1d('0x57')][_0x8e1d('0x5e')];return db['FaxMessage'][_0x8e1d('0x56')]({'where':{'id':_0x575536[_0x8e1d('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x493c19,null))[_0x8e1d('0x1e')](saveUpdates(_0x575536[_0x8e1d('0x57')],null))[_0x8e1d('0x1e')](function(_0x23eed8){if(_0x23eed8){_0x65cca7[_0x8e1d('0x25')]=_0x23eed8[_0x8e1d('0x60')]({'plain':!![]});return db[_0x8e1d('0x61')]['find']({'where':{'id':_0x23eed8[_0x8e1d('0x62')]}});}return null;})[_0x8e1d('0x1e')](handleEntityNotFound(_0x493c19,null))[_0x8e1d('0x1e')](function(_0x683a08){if(_0x683a08){return _0x683a08[_0x8e1d('0x34')]({'UserId':_0x575536[_0x8e1d('0x57')][_0x8e1d('0x5e')],'read1stAt':_[_0x8e1d('0x63')](_0x683a08[_0x8e1d('0x64')])?moment()['format'](_0x8e1d('0x65')):undefined});}return null;})[_0x8e1d('0x1e')](function(_0x14ceb2){if(_0x14ceb2){_0x65cca7['interaction']=_0x14ceb2[_0x8e1d('0x60')]({'plain':!![]});interaction_log[_0x8e1d('0x26')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x575536[_0x8e1d('0x5f')]['id'],_0x575536[_0x8e1d('0x5f')]['name'],_0x575536[_0x8e1d('0x5f')]['role'],_0x65cca7[_0x8e1d('0x66')]['id'],_0x575536[_0x8e1d('0x57')]?JSON['stringify'](_0x575536[_0x8e1d('0x57')]):_0x8e1d('0x67'));return respondWithRpcPromise(_0x8e1d('0x68'),_0x8e1d('0x69'),_0x65cca7);}return null;})[_0x8e1d('0x1e')](function(_0x141aef){var _0x275e51=_0x8e1d('0x6a')+_0x141aef[_0x8e1d('0x25')][_0x8e1d('0x6b')];return db[_0x8e1d('0x6c')][_0x8e1d('0x41')](_0x275e51,{'type':db['Sequelize']['QueryTypes'][_0x8e1d('0x6d')],'raw':!![]})[_0x8e1d('0x1e')](function(_0x3704b3){return _0x3704b3;});})['then'](function(_0x1271dc){if(_0x1271dc){_0x65cca7[_0x8e1d('0x25')][_0x8e1d('0x6e')]=_0x1271dc[0x0];if(!_0x575536[_0x8e1d('0x57')]['UserId'])return;return db[_0x8e1d('0x6f')][_0x8e1d('0x56')]({'where':{'id':_0x575536[_0x8e1d('0x57')][_0x8e1d('0x5e')],'role':_0x8e1d('0x70')},'attributes':['id',_0x8e1d('0x37'),'fullname',_0x8e1d('0x71'),_0x8e1d('0x72')],'raw':!![]});}return null;})['then'](function(_0x1ba2f4){if(!_0x1ba2f4)return null;_0x65cca7[_0x8e1d('0x25')][_0x8e1d('0x70')]=_0x1ba2f4;return _0x65cca7;})[_0x8e1d('0x1e')](function(_0x240cbb){if(_0x240cbb){if(_0x575536['body']['manual']){_0x65cca7[_0x8e1d('0x25')][_0x8e1d('0x73')]=util[_0x8e1d('0x5d')](_0x8e1d('0x74'),_0x575536[_0x8e1d('0x5f')][_0x8e1d('0x37')]);_0x65cca7[_0x8e1d('0x25')][_0x8e1d('0x75')]=_0x65cca7[_0x8e1d('0x75')];_0x65cca7[_0x8e1d('0x25')]['motionChannel']=_0x65cca7[_0x8e1d('0x75')];_0x65cca7['message'][_0x8e1d('0x76')]=_0x8e1d('0x5a');return respondWithRpcPromise(_0x8e1d('0x77'),_0x8e1d('0x77'),{'event':_0x8e1d('0x78'),'message':_0x65cca7[_0x8e1d('0x25')]},client9002)['then'](function(){return _0x65cca7;});}return _0x65cca7;}return null;})[_0x8e1d('0x1e')](respondWithResult(_0x493c19,null))[_0x8e1d('0x28')](handleError(_0x493c19,null));};var interaction_log=require(_0x8e1d('0x12'))(_0x8e1d('0x59'));exports['reject']=function(_0x2d9679,_0x29e4b8,_0x24642a){var _0x380bd2={'agent':{},'channel':_0x8e1d('0x5b')};if(_0x2d9679[_0x8e1d('0x57')]['id']){delete _0x2d9679[_0x8e1d('0x57')]['id'];}_0x2d9679[_0x8e1d('0x57')][_0x8e1d('0x5e')]=_0x2d9679[_0x8e1d('0x57')]['UserId']||_0x2d9679[_0x8e1d('0x5f')]['id'];_0x380bd2[_0x8e1d('0x70')]['id']=_0x2d9679[_0x8e1d('0x57')]['UserId'];return db[_0x8e1d('0x3a')][_0x8e1d('0x56')]({'where':{'id':_0x2d9679[_0x8e1d('0x54')]['id'],'UserId':null}})[_0x8e1d('0x1e')](handleEntityNotFound(_0x29e4b8,null))[_0x8e1d('0x1e')](function(_0x8590e6){if(_0x8590e6){_0x380bd2[_0x8e1d('0x25')]=_0x8590e6[_0x8e1d('0x60')]({'plain':!![]});return db[_0x8e1d('0x61')][_0x8e1d('0x56')]({'where':{'id':_0x8590e6[_0x8e1d('0x62')]}});}return null;})[_0x8e1d('0x1e')](handleEntityNotFound(_0x29e4b8,null))[_0x8e1d('0x1e')](function(_0x2f5030){if(_0x2f5030){_0x380bd2[_0x8e1d('0x66')]=_0x2f5030['get']({'plain':!![]});interaction_log['info'](_0x8e1d('0x79'),_0x2d9679[_0x8e1d('0x5f')]['id'],_0x2d9679['user'][_0x8e1d('0x37')],_0x2d9679[_0x8e1d('0x5f')][_0x8e1d('0x7a')],_0x380bd2[_0x8e1d('0x66')]['id'],_0x2d9679[_0x8e1d('0x57')]?JSON[_0x8e1d('0x21')](_0x2d9679[_0x8e1d('0x57')]):_0x8e1d('0x67'));return respondWithRpcPromise('RejectMessage',_0x8e1d('0x7b'),_0x380bd2);}return null;})[_0x8e1d('0x1e')](function(_0x2d6214){var _0x529924=_0x8e1d('0x6a')+_0x2d6214[_0x8e1d('0x25')]['ContactId'];return db[_0x8e1d('0x6c')][_0x8e1d('0x41')](_0x529924,{'type':db[_0x8e1d('0x7c')]['QueryTypes'][_0x8e1d('0x6d')],'raw':!![]})[_0x8e1d('0x1e')](function(_0x2d46d1){return _0x2d46d1;});})[_0x8e1d('0x1e')](function(_0x12363a){if(_0x12363a){_0x380bd2['message'][_0x8e1d('0x6e')]=_0x12363a[0x0];if(!_0x2d9679[_0x8e1d('0x57')]['UserId'])return;return db[_0x8e1d('0x6f')]['find']({'where':{'id':_0x2d9679[_0x8e1d('0x57')][_0x8e1d('0x5e')],'role':_0x8e1d('0x70')},'attributes':['id','name',_0x8e1d('0x7d'),_0x8e1d('0x71'),_0x8e1d('0x72')],'raw':!![]});}return null;})[_0x8e1d('0x1e')](function(_0x347c02){if(!_0x347c02)return null;_0x380bd2[_0x8e1d('0x25')][_0x8e1d('0x70')]=_0x347c02;return _0x380bd2;})[_0x8e1d('0x1e')](function(_0x2703b6){if(_0x2703b6){_0x2703b6[_0x8e1d('0x25')][_0x8e1d('0x73')]=util[_0x8e1d('0x5d')](_0x8e1d('0x74'),_0x2d9679[_0x8e1d('0x5f')][_0x8e1d('0x37')]);_0x2703b6['message'][_0x8e1d('0x75')]=_0x380bd2[_0x8e1d('0x75')];_0x2703b6['message'][_0x8e1d('0x7e')]=_0x380bd2[_0x8e1d('0x75')];_0x2703b6[_0x8e1d('0x25')][_0x8e1d('0x76')]='reject';respondWithRpcPromise(_0x8e1d('0x77'),_0x8e1d('0x77'),{'event':_0x8e1d('0x7f'),'message':_0x2703b6[_0x8e1d('0x25')]},client9002);return _0x380bd2;}return null;})[_0x8e1d('0x1e')](respondWithResult(_0x29e4b8,null))[_0x8e1d('0x28')](handleError(_0x29e4b8,null));};exports[_0x8e1d('0x80')]=function(_0xf94fe5,_0x5a6a25){var _0x2dcb1a;return db[_0x8e1d('0x3a')]['create'](_0xf94fe5[_0x8e1d('0x57')],{})[_0x8e1d('0x1e')](function(_0x5e58d1){_0x2dcb1a=_0x5e58d1;return db[_0x8e1d('0x81')][_0x8e1d('0x82')]({'where':{'id':_0x2dcb1a[_0x8e1d('0x6b')]}});})[_0x8e1d('0x1e')](function(_0x18bdcb){if(_[_0x8e1d('0x63')](_0x18bdcb)){return;}else{_0x2dcb1a[_0x8e1d('0x5b')]=_0x18bdcb['fax'];return db['Attachment'][_0x8e1d('0x82')]({'where':{'id':_0x2dcb1a[_0x8e1d('0x83')]}});}})[_0x8e1d('0x1e')](function(_0xc7612c){return respondWithRpcPromise(_0x8e1d('0x84'),_0x8e1d('0x84'),{'FaxAccountId':_[_0x8e1d('0x63')](_0xf94fe5[_0x8e1d('0x57')])?undefined:_0xf94fe5[_0x8e1d('0x57')][_0x8e1d('0x85')],'path':_[_0x8e1d('0x63')](_0xc7612c)?undefined:util[_0x8e1d('0x5d')](_0x8e1d('0x86'),_0xc7612c[_0x8e1d('0x87')]),'fax':_['isNil'](_0x2dcb1a[_0x8e1d('0x5b')])?undefined:_0x2dcb1a['fax'],'AttachmentId':_0x2dcb1a[_0x8e1d('0x83')]},client9002);})[_0x8e1d('0x1e')](respondWithResult(_0x5a6a25,0xc9))['catch'](handleError(_0x5a6a25,null));};exports[_0x8e1d('0x88')]=function(_0x301963,_0xbfd856){var _0x5e5fce=path[_0x8e1d('0x89')](config[_0x8e1d('0x8a')],'server',_0x8e1d('0x8b'),_0x8e1d('0x8c'));return db[_0x8e1d('0x3a')]['find']({'where':{'id':_0x301963[_0x8e1d('0x54')]['id']},'include':[{'model':db[_0x8e1d('0x8d')],'as':'Attachment'}]})[_0x8e1d('0x1e')](handleEntityNotFound(_0xbfd856,null))['then'](function(_0x447d15){if(_0x447d15){return _0xbfd856[_0x8e1d('0x88')](path[_0x8e1d('0x89')](_0x5e5fce,_0x447d15[_0x8e1d('0x8d')][_0x8e1d('0x87')]));}})[_0x8e1d('0x28')](handleError(_0xbfd856,null));};
\ No newline at end of file
+var _0x63ad=['jayson/promise','http','client','then','info','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','FaxMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','FaxMessage','include','show','params','includeAll','find','body','describe','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','FaxInteraction','FaxInteractionId','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','fax-interactions','role','RejectMessage','email','internal','rejectmessage','create','findOne','isNil','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','files','join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','localhost','socket.io-emitter','redis','./faxMessage.socket','register'];(function(_0x2388a5,_0x5165fd){var _0x558351=function(_0x22c368){while(--_0x22c368){_0x2388a5['push'](_0x2388a5['shift']());}};_0x558351(++_0x5165fd);}(_0x63ad,0x6e));var _0xd63a=function(_0x3aaae1,_0x524fd9){_0x3aaae1=_0x3aaae1-0x0;var _0x37922e=_0x63ad[_0x3aaae1];return _0x37922e;};'use strict';var emlformat=require(_0xd63a('0x0'));var rimraf=require(_0xd63a('0x1'));var zipdir=require(_0xd63a('0x2'));var jsonpatch=require(_0xd63a('0x3'));var rp=require(_0xd63a('0x4'));var moment=require(_0xd63a('0x5'));var BPromise=require(_0xd63a('0x6'));var Mustache=require(_0xd63a('0x7'));var util=require(_0xd63a('0x8'));var path=require(_0xd63a('0x9'));var sox=require(_0xd63a('0xa'));var csv=require(_0xd63a('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd63a('0xc'));var _=require(_0xd63a('0xd'));var squel=require(_0xd63a('0xe'));var crypto=require('crypto');var jsforce=require(_0xd63a('0xf'));var deskjs=require(_0xd63a('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd63a('0x11'));var Redis=require(_0xd63a('0x12'));var authService=require(_0xd63a('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd63a('0x14'));var logger=require(_0xd63a('0x15'))(_0xd63a('0x16'));var utils=require(_0xd63a('0x17'));var config=require(_0xd63a('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xd63a('0x19')](config['redis'],{'host':_0xd63a('0x1a'),'port':0x18eb});var socket=require(_0xd63a('0x1b'))(new Redis(config[_0xd63a('0x1c')]));require(_0xd63a('0x1d'))[_0xd63a('0x1e')](socket);var jayson=require(_0xd63a('0x1f'));var client=jayson['client'][_0xd63a('0x20')]({'port':0x232c});var client9002=jayson[_0xd63a('0x21')][_0xd63a('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x292c59,_0x15c1a7,_0x696a75,_0x31fd62){return new BPromise(function(_0x15a0f7,_0x2a2b34){var _0x21b143=_0x31fd62||client;return _0x21b143['request'](_0x292c59,_0x696a75)[_0xd63a('0x22')](function(_0x352362){logger[_0xd63a('0x23')]('FaxMessage,\x20%s,\x20%s',_0x15c1a7,'request\x20sent');logger[_0xd63a('0x24')](_0xd63a('0x25'),_0x15c1a7,_0xd63a('0x26'),JSON[_0xd63a('0x27')](_0x352362));if(_0x352362['error']){if(_0x352362[_0xd63a('0x28')]['code']===0x1f4){logger[_0xd63a('0x28')]('FaxMessage,\x20%s,\x20%s',_0x15c1a7,_0x352362[_0xd63a('0x28')][_0xd63a('0x29')]);return _0x2a2b34(_0x352362[_0xd63a('0x28')][_0xd63a('0x29')]);}logger[_0xd63a('0x28')](_0xd63a('0x2a'),_0x15c1a7,_0x352362[_0xd63a('0x28')][_0xd63a('0x29')]);return _0x15a0f7(_0x352362[_0xd63a('0x28')][_0xd63a('0x29')]);}else{logger[_0xd63a('0x23')](_0xd63a('0x2a'),_0x15c1a7,_0xd63a('0x26'));_0x15a0f7(_0x352362[_0xd63a('0x2b')][_0xd63a('0x29')]);}})[_0xd63a('0x2c')](function(_0x3dd9d4){logger[_0xd63a('0x28')](_0xd63a('0x2a'),_0x15c1a7,_0x3dd9d4);_0x2a2b34(_0x3dd9d4);});});}function respondWithStatusCode(_0x1dee7d,_0x4d1ce0){_0x4d1ce0=_0x4d1ce0||0xcc;return function(_0x4148fb){if(_0x4148fb){return _0x1dee7d[_0xd63a('0x2d')](_0x4d1ce0);}return _0x1dee7d[_0xd63a('0x2e')](_0x4d1ce0)[_0xd63a('0x2f')]();};}function respondWithResult(_0x2466d8,_0x15411c){_0x15411c=_0x15411c||0xc8;return function(_0x372363){if(_0x372363){return _0x2466d8[_0xd63a('0x2e')](_0x15411c)[_0xd63a('0x30')](_0x372363);}};}function respondWithFilteredResult(_0xaf77f8,_0x1292e6){return function(_0x54b245){if(_0x54b245){var _0x40e376=typeof _0x1292e6[_0xd63a('0x31')]===_0xd63a('0x32')&&typeof _0x1292e6[_0xd63a('0x33')]===_0xd63a('0x32');var _0x3d8754=_0x54b245[_0xd63a('0x34')];var _0x25aa8c=_0x40e376?0x0:_0x1292e6[_0xd63a('0x31')];var _0x648390=_0x40e376?_0x54b245[_0xd63a('0x34')]:_0x1292e6[_0xd63a('0x31')]+_0x1292e6[_0xd63a('0x33')];var _0x2ebe06;if(_0x648390>=_0x3d8754){_0x648390=_0x3d8754;_0x2ebe06=0xc8;}else{_0x2ebe06=0xce;}_0xaf77f8['status'](_0x2ebe06);return _0xaf77f8[_0xd63a('0x35')](_0xd63a('0x36'),_0x25aa8c+'-'+_0x648390+'/'+_0x3d8754)[_0xd63a('0x30')](_0x54b245);}return null;};}function patchUpdates(_0x195804){return function(_0x3fb5da){try{jsonpatch['apply'](_0x3fb5da,_0x195804,!![]);}catch(_0x32a7a6){return BPromise[_0xd63a('0x37')](_0x32a7a6);}return _0x3fb5da['save']();};}function saveUpdates(_0x392e3d,_0x1f5c5e){return function(_0x33caca){if(_0x33caca){return _0x33caca[_0xd63a('0x38')](_0x392e3d)[_0xd63a('0x22')](function(_0x5470f5){return _0x5470f5;});}return null;};}function removeEntity(_0x3a9505,_0x40346b){return function(_0x30a3c3){if(_0x30a3c3){return _0x30a3c3[_0xd63a('0x39')]()[_0xd63a('0x22')](function(){_0x3a9505[_0xd63a('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28add7,_0x4bbce8){return function(_0x42bf8b){if(!_0x42bf8b){_0x28add7[_0xd63a('0x2d')](0x194);}return _0x42bf8b;};}function handleError(_0x1da287,_0x508995){_0x508995=_0x508995||0x1f4;return function(_0x4c72ef){logger[_0xd63a('0x28')](_0x4c72ef[_0xd63a('0x3a')]);if(_0x4c72ef['name']){delete _0x4c72ef[_0xd63a('0x3b')];}_0x1da287[_0xd63a('0x2e')](_0x508995)[_0xd63a('0x3c')](_0x4c72ef);};}exports[_0xd63a('0x3d')]=function(_0x5c8dc8,_0x9f6a5c){var _0x92ec4b={},_0x33c575={},_0x1c3d74={'count':0x0,'rows':[]};var _0x36dcf2=_[_0xd63a('0x3e')](db['FaxMessage'][_0xd63a('0x3f')],function(_0x10fd42){return{'name':_0x10fd42[_0xd63a('0x40')],'type':_0x10fd42[_0xd63a('0x41')][_0xd63a('0x42')]};});_0x33c575[_0xd63a('0x43')]=_[_0xd63a('0x3e')](_0x36dcf2,_0xd63a('0x3b'));_0x33c575[_0xd63a('0x44')]=_[_0xd63a('0x45')](_0x5c8dc8[_0xd63a('0x44')]);_0x33c575[_0xd63a('0x46')]=_[_0xd63a('0x47')](_0x33c575['model'],_0x33c575[_0xd63a('0x44')]);_0x92ec4b[_0xd63a('0x48')]=_[_0xd63a('0x47')](_0x33c575[_0xd63a('0x43')],qs[_0xd63a('0x49')](_0x5c8dc8[_0xd63a('0x44')][_0xd63a('0x49')]));_0x92ec4b[_0xd63a('0x48')]=_0x92ec4b[_0xd63a('0x48')][_0xd63a('0x4a')]?_0x92ec4b[_0xd63a('0x48')]:_0x33c575['model'];if(!_0x5c8dc8['query'][_0xd63a('0x4b')](_0xd63a('0x4c'))){_0x92ec4b[_0xd63a('0x33')]=qs['limit'](_0x5c8dc8['query'][_0xd63a('0x33')]);_0x92ec4b[_0xd63a('0x31')]=qs[_0xd63a('0x31')](_0x5c8dc8['query']['offset']);}_0x92ec4b[_0xd63a('0x4d')]=qs[_0xd63a('0x4e')](_0x5c8dc8[_0xd63a('0x44')][_0xd63a('0x4e')]);_0x92ec4b[_0xd63a('0x4f')]=qs[_0xd63a('0x46')](_[_0xd63a('0x50')](_0x5c8dc8['query'],_0x33c575['filters']),_0x36dcf2);if(_0x5c8dc8[_0xd63a('0x44')][_0xd63a('0x51')]){_0x92ec4b[_0xd63a('0x4f')]=_[_0xd63a('0x52')](_0x92ec4b['where'],{'$or':_[_0xd63a('0x3e')](_0x36dcf2,function(_0x5b7ce9){if(_0x5b7ce9[_0xd63a('0x41')]!=='VIRTUAL'){var _0x544c61={};_0x544c61[_0x5b7ce9[_0xd63a('0x3b')]]={'$like':'%'+_0x5c8dc8['query']['filter']+'%'};return _0x544c61;}})});}_0x92ec4b=_[_0xd63a('0x52')]({},_0x92ec4b,_0x5c8dc8[_0xd63a('0x53')]);var _0x23f4ef={'where':_0x92ec4b[_0xd63a('0x4f')]};return db[_0xd63a('0x54')][_0xd63a('0x34')](_0x23f4ef)[_0xd63a('0x22')](function(_0x23b99a){_0x1c3d74[_0xd63a('0x34')]=_0x23b99a;if(_0x5c8dc8[_0xd63a('0x44')]['includeAll']){_0x92ec4b[_0xd63a('0x55')]=[{'all':!![]}];}return db[_0xd63a('0x54')]['findAll'](_0x92ec4b);})['then'](function(_0xefd920){_0x1c3d74['rows']=_0xefd920;return _0x1c3d74;})[_0xd63a('0x22')](respondWithFilteredResult(_0x9f6a5c,_0x92ec4b))['catch'](handleError(_0x9f6a5c,null));};exports[_0xd63a('0x56')]=function(_0x254112,_0x5a6305){var _0x5eb1cb={'raw':!![],'where':{'id':_0x254112[_0xd63a('0x57')]['id']}},_0x47285f={};_0x47285f['model']=_[_0xd63a('0x45')](db[_0xd63a('0x54')][_0xd63a('0x3f')]);_0x47285f['query']=_[_0xd63a('0x45')](_0x254112[_0xd63a('0x44')]);_0x47285f[_0xd63a('0x46')]=_['intersection'](_0x47285f[_0xd63a('0x43')],_0x47285f[_0xd63a('0x44')]);_0x5eb1cb[_0xd63a('0x48')]=_['intersection'](_0x47285f[_0xd63a('0x43')],qs[_0xd63a('0x49')](_0x254112['query'][_0xd63a('0x49')]));_0x5eb1cb[_0xd63a('0x48')]=_0x5eb1cb[_0xd63a('0x48')][_0xd63a('0x4a')]?_0x5eb1cb[_0xd63a('0x48')]:_0x47285f[_0xd63a('0x43')];if(_0x254112[_0xd63a('0x44')][_0xd63a('0x58')]){_0x5eb1cb[_0xd63a('0x55')]=[{'all':!![]}];}_0x5eb1cb=_[_0xd63a('0x52')]({},_0x5eb1cb,_0x254112[_0xd63a('0x53')]);return db[_0xd63a('0x54')][_0xd63a('0x59')](_0x5eb1cb)[_0xd63a('0x22')](handleEntityNotFound(_0x5a6305,null))[_0xd63a('0x22')](respondWithResult(_0x5a6305,null))[_0xd63a('0x2c')](handleError(_0x5a6305,null));};exports['update']=function(_0x3db4e8,_0x578b09){if(_0x3db4e8[_0xd63a('0x5a')]['id']){delete _0x3db4e8[_0xd63a('0x5a')]['id'];}return db['FaxMessage'][_0xd63a('0x59')]({'where':{'id':_0x3db4e8[_0xd63a('0x57')]['id']}})[_0xd63a('0x22')](handleEntityNotFound(_0x578b09,null))[_0xd63a('0x22')](saveUpdates(_0x3db4e8[_0xd63a('0x5a')],null))[_0xd63a('0x22')](respondWithResult(_0x578b09,null))[_0xd63a('0x2c')](handleError(_0x578b09,null));};exports[_0xd63a('0x39')]=function(_0x3e65d4,_0x1a2c08){return db[_0xd63a('0x54')][_0xd63a('0x59')]({'where':{'id':_0x3e65d4['params']['id']}})[_0xd63a('0x22')](handleEntityNotFound(_0x1a2c08,null))[_0xd63a('0x22')](removeEntity(_0x1a2c08,null))['catch'](handleError(_0x1a2c08,null));};exports[_0xd63a('0x5b')]=function(_0x25c003,_0x419e91){return db[_0xd63a('0x54')][_0xd63a('0x5b')]()[_0xd63a('0x22')](respondWithResult(_0x419e91,null))[_0xd63a('0x2c')](handleError(_0x419e91,null));};var interaction_log=require(_0xd63a('0x15'))('fax-interactions');exports['accept']=function(_0x364d08,_0x39f023,_0x3e71d9){var _0x2147ff={'agent':{},'channel':_0xd63a('0x5c')};if(_0x364d08[_0xd63a('0x5a')]['id']){delete _0x364d08[_0xd63a('0x5a')]['id'];}_0x364d08[_0xd63a('0x5a')][_0xd63a('0x5d')]=!![];_0x364d08[_0xd63a('0x5a')]['readAt']=moment()[_0xd63a('0x5e')](_0xd63a('0x5f'));_0x364d08[_0xd63a('0x5a')]['UserId']=_0x364d08[_0xd63a('0x5a')][_0xd63a('0x60')]||_0x364d08['user']['id'];_0x2147ff['agent']['id']=_0x364d08[_0xd63a('0x5a')][_0xd63a('0x60')];return db[_0xd63a('0x54')][_0xd63a('0x59')]({'where':{'id':_0x364d08[_0xd63a('0x57')]['id'],'UserId':null}})[_0xd63a('0x22')](handleEntityNotFound(_0x39f023,null))['then'](saveUpdates(_0x364d08[_0xd63a('0x5a')],null))['then'](function(_0x22c57d){if(_0x22c57d){_0x2147ff[_0xd63a('0x29')]=_0x22c57d[_0xd63a('0x61')]({'plain':!![]});return db[_0xd63a('0x62')][_0xd63a('0x59')]({'where':{'id':_0x22c57d[_0xd63a('0x63')]}});}return null;})[_0xd63a('0x22')](handleEntityNotFound(_0x39f023,null))[_0xd63a('0x22')](function(_0x34809d){if(_0x34809d){return _0x34809d[_0xd63a('0x38')]({'UserId':_0x364d08[_0xd63a('0x5a')][_0xd63a('0x60')],'read1stAt':_['isNil'](_0x34809d[_0xd63a('0x64')])?moment()[_0xd63a('0x5e')](_0xd63a('0x5f')):undefined});}return null;})[_0xd63a('0x22')](function(_0x5e5eb1){if(_0x5e5eb1){_0x2147ff['interaction']=_0x5e5eb1[_0xd63a('0x61')]({'plain':!![]});interaction_log[_0xd63a('0x23')](_0xd63a('0x65'),_0x364d08['user']['id'],_0x364d08[_0xd63a('0x66')][_0xd63a('0x3b')],_0x364d08['user']['role'],_0x2147ff[_0xd63a('0x67')]['id'],_0x364d08['body']?JSON[_0xd63a('0x27')](_0x364d08['body']):_0xd63a('0x68'));return respondWithRpcPromise(_0xd63a('0x69'),_0xd63a('0x6a'),_0x2147ff);}return null;})[_0xd63a('0x22')](function(_0x44b484){var _0x197ef9=_0xd63a('0x6b')+_0x44b484['message'][_0xd63a('0x6c')];return db[_0xd63a('0x6d')][_0xd63a('0x44')](_0x197ef9,{'type':db[_0xd63a('0x6e')][_0xd63a('0x6f')][_0xd63a('0x70')],'raw':!![]})[_0xd63a('0x22')](function(_0x4be42b){return _0x4be42b;});})[_0xd63a('0x22')](function(_0x33776a){if(_0x33776a){_0x2147ff[_0xd63a('0x29')][_0xd63a('0x71')]=_0x33776a[0x0];if(!_0x364d08[_0xd63a('0x5a')][_0xd63a('0x60')])return;return db[_0xd63a('0x72')][_0xd63a('0x59')]({'where':{'id':_0x364d08[_0xd63a('0x5a')]['UserId'],'role':_0xd63a('0x73')},'attributes':['id',_0xd63a('0x3b'),_0xd63a('0x74'),'email','internal'],'raw':!![]});}return null;})[_0xd63a('0x22')](function(_0x2b7788){if(!_0x2b7788)return null;_0x2147ff[_0xd63a('0x29')][_0xd63a('0x73')]=_0x2b7788;return _0x2147ff;})[_0xd63a('0x22')](function(_0x40f04c){if(_0x40f04c){if(_0x364d08[_0xd63a('0x5a')]['manual']){_0x2147ff[_0xd63a('0x29')][_0xd63a('0x75')]=util[_0xd63a('0x5e')](_0xd63a('0x76'),_0x364d08['user'][_0xd63a('0x3b')]);_0x2147ff[_0xd63a('0x29')]['channel']=_0x2147ff[_0xd63a('0x77')];_0x2147ff[_0xd63a('0x29')][_0xd63a('0x78')]=_0x2147ff[_0xd63a('0x77')];_0x2147ff['message'][_0xd63a('0x79')]=_0xd63a('0x7a');return respondWithRpcPromise(_0xd63a('0x7b'),'EventManager',{'event':'acceptmessage','message':_0x2147ff[_0xd63a('0x29')]},client9002)['then'](function(){return _0x2147ff;});}return _0x2147ff;}return null;})[_0xd63a('0x22')](respondWithResult(_0x39f023,null))[_0xd63a('0x2c')](handleError(_0x39f023,null));};var interaction_log=require(_0xd63a('0x15'))(_0xd63a('0x7c'));exports[_0xd63a('0x37')]=function(_0x40d7c0,_0x31588e,_0x7a8df3){var _0x19e781={'agent':{},'channel':_0xd63a('0x5c')};if(_0x40d7c0[_0xd63a('0x5a')]['id']){delete _0x40d7c0[_0xd63a('0x5a')]['id'];}_0x40d7c0['body'][_0xd63a('0x60')]=_0x40d7c0['body'][_0xd63a('0x60')]||_0x40d7c0[_0xd63a('0x66')]['id'];_0x19e781[_0xd63a('0x73')]['id']=_0x40d7c0[_0xd63a('0x5a')][_0xd63a('0x60')];return db[_0xd63a('0x54')][_0xd63a('0x59')]({'where':{'id':_0x40d7c0['params']['id'],'UserId':null}})[_0xd63a('0x22')](handleEntityNotFound(_0x31588e,null))['then'](function(_0x2e21f6){if(_0x2e21f6){_0x19e781[_0xd63a('0x29')]=_0x2e21f6[_0xd63a('0x61')]({'plain':!![]});return db[_0xd63a('0x62')]['find']({'where':{'id':_0x2e21f6['FaxInteractionId']}});}return null;})[_0xd63a('0x22')](handleEntityNotFound(_0x31588e,null))['then'](function(_0x25dabd){if(_0x25dabd){_0x19e781[_0xd63a('0x67')]=_0x25dabd[_0xd63a('0x61')]({'plain':!![]});interaction_log[_0xd63a('0x23')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x40d7c0[_0xd63a('0x66')]['id'],_0x40d7c0[_0xd63a('0x66')]['name'],_0x40d7c0[_0xd63a('0x66')][_0xd63a('0x7d')],_0x19e781['interaction']['id'],_0x40d7c0[_0xd63a('0x5a')]?JSON[_0xd63a('0x27')](_0x40d7c0['body']):_0xd63a('0x68'));return respondWithRpcPromise(_0xd63a('0x7e'),'rejectMessage',_0x19e781);}return null;})[_0xd63a('0x22')](function(_0x37f683){var _0x4c10bb=_0xd63a('0x6b')+_0x37f683[_0xd63a('0x29')]['ContactId'];return db['sequelize'][_0xd63a('0x44')](_0x4c10bb,{'type':db[_0xd63a('0x6e')][_0xd63a('0x6f')][_0xd63a('0x70')],'raw':!![]})[_0xd63a('0x22')](function(_0x2ec553){return _0x2ec553;});})['then'](function(_0x49935f){if(_0x49935f){_0x19e781[_0xd63a('0x29')]['contact']=_0x49935f[0x0];if(!_0x40d7c0[_0xd63a('0x5a')][_0xd63a('0x60')])return;return db[_0xd63a('0x72')]['find']({'where':{'id':_0x40d7c0[_0xd63a('0x5a')][_0xd63a('0x60')],'role':_0xd63a('0x73')},'attributes':['id',_0xd63a('0x3b'),_0xd63a('0x74'),_0xd63a('0x7f'),_0xd63a('0x80')],'raw':!![]});}return null;})[_0xd63a('0x22')](function(_0x54ef22){if(!_0x54ef22)return null;_0x19e781[_0xd63a('0x29')][_0xd63a('0x73')]=_0x54ef22;return _0x19e781;})['then'](function(_0x4ec224){if(_0x4ec224){_0x4ec224['message'][_0xd63a('0x75')]=util[_0xd63a('0x5e')](_0xd63a('0x76'),_0x40d7c0[_0xd63a('0x66')][_0xd63a('0x3b')]);_0x4ec224[_0xd63a('0x29')][_0xd63a('0x77')]=_0x19e781['channel'];_0x4ec224['message']['motionChannel']=_0x19e781[_0xd63a('0x77')];_0x4ec224[_0xd63a('0x29')][_0xd63a('0x79')]=_0xd63a('0x37');respondWithRpcPromise('EventManager',_0xd63a('0x7b'),{'event':_0xd63a('0x81'),'message':_0x4ec224[_0xd63a('0x29')]},client9002);return _0x19e781;}return null;})['then'](respondWithResult(_0x31588e,null))[_0xd63a('0x2c')](handleError(_0x31588e,null));};exports[_0xd63a('0x82')]=function(_0x266239,_0x3501e7){var _0x2f4883;return db[_0xd63a('0x54')][_0xd63a('0x82')](_0x266239[_0xd63a('0x5a')],{})[_0xd63a('0x22')](function(_0x4a03b4){_0x2f4883=_0x4a03b4;return db['CmContact'][_0xd63a('0x83')]({'where':{'id':_0x2f4883[_0xd63a('0x6c')]}});})[_0xd63a('0x22')](function(_0x6ae1df){if(_[_0xd63a('0x84')](_0x6ae1df)){return;}else{_0x2f4883[_0xd63a('0x5c')]=_0x6ae1df['fax'];return db[_0xd63a('0x85')][_0xd63a('0x83')]({'where':{'id':_0x2f4883[_0xd63a('0x86')]}});}})[_0xd63a('0x22')](function(_0x3f3eb5){return respondWithRpcPromise(_0xd63a('0x87'),_0xd63a('0x87'),{'FaxAccountId':_[_0xd63a('0x84')](_0x266239[_0xd63a('0x5a')])?undefined:_0x266239['body'][_0xd63a('0x88')],'path':_[_0xd63a('0x84')](_0x3f3eb5)?undefined:util[_0xd63a('0x5e')](_0xd63a('0x89'),_0x3f3eb5[_0xd63a('0x8a')]),'fax':_[_0xd63a('0x84')](_0x2f4883[_0xd63a('0x5c')])?undefined:_0x2f4883['fax'],'AttachmentId':_0x2f4883['AttachmentId']},client9002);})[_0xd63a('0x22')](respondWithResult(_0x3501e7,0xc9))[_0xd63a('0x2c')](handleError(_0x3501e7,null));};exports['download']=function(_0x238e5f,_0x11efeb){var _0x226c69=path['join'](config['root'],'server',_0xd63a('0x8b'),'attachments');return db[_0xd63a('0x54')][_0xd63a('0x59')]({'where':{'id':_0x238e5f[_0xd63a('0x57')]['id']},'include':[{'model':db['Attachment'],'as':_0xd63a('0x85')}]})[_0xd63a('0x22')](handleEntityNotFound(_0x11efeb,null))[_0xd63a('0x22')](function(_0x685ef8){if(_0x685ef8){return _0x11efeb['download'](path[_0xd63a('0x8c')](_0x226c69,_0x685ef8[_0xd63a('0x85')][_0xd63a('0x8a')]));}})[_0xd63a('0x2c')](handleError(_0x11efeb,null));};
\ No newline at end of file
index 8b434a9..2d22633 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2515=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x19afb4,_0x207b46){var _0x294a13=function(_0x2b6078){while(--_0x2b6078){_0x19afb4['push'](_0x19afb4['shift']());}};_0x294a13(++_0x207b46);}(_0x2515,0x1c2));var _0x5251=function(_0x3966cb,_0x1d59c9){_0x3966cb=_0x3966cb-0x0;var _0x123bc4=_0x2515[_0x3966cb];return _0x123bc4;};'use strict';var EventEmitter=require(_0x5251('0x0'));var FaxMessage=require(_0x5251('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x5251('0x2')](0x0);var events={'afterCreate':_0x5251('0x3'),'afterUpdate':_0x5251('0x4'),'afterDestroy':_0x5251('0x5')};function emitEvent(_0x4c95e4){return function(_0x20a3e1,_0x3fe745,_0x570b38){FaxMessageEvents[_0x5251('0x6')](_0x4c95e4+':'+_0x20a3e1['id'],_0x20a3e1);FaxMessageEvents[_0x5251('0x6')](_0x4c95e4,_0x20a3e1);_0x570b38(null);};}for(var e in events){if(events[_0x5251('0x7')](e)){var event=events[e];FaxMessage[_0x5251('0x8')](e,emitEvent(event));}}module[_0x5251('0x9')]=FaxMessageEvents;
\ No newline at end of file
+var _0x4888=['emit','hasOwnProperty','hook','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove'];(function(_0x18b477,_0x555d04){var _0x240b92=function(_0x343b06){while(--_0x343b06){_0x18b477['push'](_0x18b477['shift']());}};_0x240b92(++_0x555d04);}(_0x4888,0x198));var _0x8488=function(_0x14f89e,_0x139fce){_0x14f89e=_0x14f89e-0x0;var _0x26092d=_0x4888[_0x14f89e];return _0x26092d;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x8488('0x0'))['db'][_0x8488('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x8488('0x2')](0x0);var events={'afterCreate':_0x8488('0x3'),'afterUpdate':_0x8488('0x4'),'afterDestroy':_0x8488('0x5')};function emitEvent(_0x19e51d){return function(_0x571e4b,_0x267093,_0xf45c3f){FaxMessageEvents[_0x8488('0x6')](_0x19e51d+':'+_0x571e4b['id'],_0x571e4b);FaxMessageEvents[_0x8488('0x6')](_0x19e51d,_0x571e4b);_0xf45c3f(null);};}for(var e in events){if(events[_0x8488('0x7')](e)){var event=events[e];FaxMessage[_0x8488('0x8')](e,emitEvent(event));}}module['exports']=FaxMessageEvents;
\ No newline at end of file
index 768eb6e..df59952 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3a1=['update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','fax_messages','fti_fax_messages','FULLTEXT','models','get','direction','toLowerCase','out','UserId','FaxInteraction','findOne','FaxInteractionId','then'];(function(_0x26afbc,_0x4535c4){var _0x188c04=function(_0xd94654){while(--_0xd94654){_0x26afbc['push'](_0x26afbc['shift']());}};_0x188c04(++_0x4535c4);}(_0xf3a1,0x1e6));var _0x1f3a=function(_0x589374,_0x38995a){_0x589374=_0x589374-0x0;var _0x583abd=_0xf3a1[_0x589374];return _0x583abd;};'use strict';var _=require(_0x1f3a('0x0'));var util=require(_0x1f3a('0x1'));var logger=require('../../config/logger')(_0x1f3a('0x2'));var moment=require('moment');var BPromise=require(_0x1f3a('0x3'));var rp=require(_0x1f3a('0x4'));var fs=require('fs');var path=require(_0x1f3a('0x5'));var rimraf=require(_0x1f3a('0x6'));var config=require(_0x1f3a('0x7'));var attributes=require(_0x1f3a('0x8'));module[_0x1f3a('0x9')]=function(_0xfd6b8f,_0x2f84ff){return _0xfd6b8f[_0x1f3a('0xa')]('FaxMessage',attributes,{'tableName':_0x1f3a('0xb'),'paranoid':![],'indexes':[{'name':_0x1f3a('0xc'),'fields':['body'],'type':_0x1f3a('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4f3604,_0x312a1e,_0x38c3ec){var _0x1a9f8b=_0xfd6b8f[_0x1f3a('0xe')];var _0x50573f=_0x4f3604[_0x1f3a('0xf')]({'plain':!![]});if(_0x50573f[_0x1f3a('0x10')][_0x1f3a('0x11')]()==='in'||_0x50573f[_0x1f3a('0x10')][_0x1f3a('0x11')]()===_0x1f3a('0x12')&&!_0x50573f['secret']&&!_['isNil'](_0x50573f[_0x1f3a('0x13')])){_0x1a9f8b[_0x1f3a('0x14')][_0x1f3a('0x15')]({'where':{'id':_0x50573f[_0x1f3a('0x16')]}})[_0x1f3a('0x17')](function(_0x4c21a1){if(_0x4c21a1){_0x4c21a1[_0x1f3a('0x18')]({'lastMsgAt':_0x50573f[_0x1f3a('0x19')],'lastMsgDirection':_0x50573f[_0x1f3a('0x10')][_0x1f3a('0x11')]()});}})[_0x1f3a('0x1a')](function(_0x2fdd4c){console[_0x1f3a('0x1b')](_0x2fdd4c);});}_0x38c3ec();}},'charset':_0x1f3a('0x1c'),'collate':_0x1f3a('0x1d')});};
\ No newline at end of file
+var _0x0b74=['toLowerCase','secret','isNil','UserId','FaxInteraction','findOne','then','update','createdAt','catch','error','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction'];(function(_0x539257,_0x526fa){var _0x5b4e1d=function(_0xf347e8){while(--_0xf347e8){_0x539257['push'](_0x539257['shift']());}};_0x5b4e1d(++_0x526fa);}(_0x0b74,0x168));var _0x40b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b74[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x40b7('0x0'));var logger=require(_0x40b7('0x1'))('api');var moment=require(_0x40b7('0x2'));var BPromise=require(_0x40b7('0x3'));var rp=require(_0x40b7('0x4'));var fs=require('fs');var path=require(_0x40b7('0x5'));var rimraf=require(_0x40b7('0x6'));var config=require(_0x40b7('0x7'));var attributes=require('./faxMessage.attributes');module['exports']=function(_0x23d696,_0x1dfe61){return _0x23d696[_0x40b7('0x8')](_0x40b7('0x9'),attributes,{'tableName':_0x40b7('0xa'),'paranoid':![],'indexes':[{'name':_0x40b7('0xb'),'fields':[_0x40b7('0xc')],'type':_0x40b7('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x7edd19,_0x5bd6f9,_0x490f5a){var _0x16c557=_0x23d696[_0x40b7('0xe')];var _0x5cc9fc=_0x7edd19[_0x40b7('0xf')]({'plain':!![]});if(_0x5cc9fc['direction']['toLowerCase']()==='in'||_0x5cc9fc[_0x40b7('0x10')][_0x40b7('0x11')]()==='out'&&!_0x5cc9fc[_0x40b7('0x12')]&&!_[_0x40b7('0x13')](_0x5cc9fc[_0x40b7('0x14')])){_0x16c557[_0x40b7('0x15')][_0x40b7('0x16')]({'where':{'id':_0x5cc9fc['FaxInteractionId']}})[_0x40b7('0x17')](function(_0x476f2d){if(_0x476f2d){_0x476f2d[_0x40b7('0x18')]({'lastMsgAt':_0x5cc9fc[_0x40b7('0x19')],'lastMsgDirection':_0x5cc9fc[_0x40b7('0x10')][_0x40b7('0x11')]()});}})[_0x40b7('0x1a')](function(_0x430aaa){console[_0x40b7('0x1b')](_0x430aaa);});}_0x490f5a();}},'charset':'utf8mb4','collate':_0x40b7('0x1c')});};
\ No newline at end of file
index eeca7c8..46fa585 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5b3=['FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateFaxMessage','FaxMessage','create','body','options','raw','catch','UpdateFaxMessage','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','then','info'];(function(_0x595c15,_0x530e20){var _0x437396=function(_0x19ef71){while(--_0x19ef71){_0x595c15['push'](_0x595c15['shift']());}};_0x437396(++_0x530e20);}(_0xe5b3,0x133));var _0x3e5b=function(_0xf177c3,_0x50d6c5){_0xf177c3=_0xf177c3-0x0;var _0x5a1223=_0xe5b3[_0xf177c3];return _0x5a1223;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var moment=require(_0x3e5b('0x1'));var BPromise=require(_0x3e5b('0x2'));var rs=require(_0x3e5b('0x3'));var fs=require('fs');var Redis=require(_0x3e5b('0x4'));var db=require(_0x3e5b('0x5'))['db'];var utils=require(_0x3e5b('0x6'));var logger=require(_0x3e5b('0x7'))(_0x3e5b('0x8'));var config=require(_0x3e5b('0x9'));var jayson=require(_0x3e5b('0xa'));var client=jayson['client'][_0x3e5b('0xb')]({'port':0x232a});config[_0x3e5b('0xc')]=_['defaults'](config[_0x3e5b('0xc')],{'host':_0x3e5b('0xd'),'port':0x18eb});var socket=require(_0x3e5b('0xe'))(new Redis(config[_0x3e5b('0xc')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x1fef54,_0x3d3b6e,_0x22fc1a){return new BPromise(function(_0x17dee7,_0xeeaabc){return client['request'](_0x1fef54,_0x22fc1a)[_0x3e5b('0xf')](function(_0x52efbd){logger[_0x3e5b('0x10')](_0x3e5b('0x11'),_0x3d3b6e,_0x3e5b('0x12'));logger[_0x3e5b('0x13')](_0x3e5b('0x14'),_0x3d3b6e,_0x3e5b('0x12'),JSON[_0x3e5b('0x15')](_0x52efbd));if(_0x52efbd['error']){if(_0x52efbd[_0x3e5b('0x16')]['code']===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x3d3b6e,_0x52efbd[_0x3e5b('0x16')][_0x3e5b('0x17')]);return _0xeeaabc(_0x52efbd[_0x3e5b('0x16')]['message']);}logger[_0x3e5b('0x16')]('FaxMessage,\x20%s,\x20%s',_0x3d3b6e,_0x52efbd['error'][_0x3e5b('0x17')]);return _0x17dee7(_0x52efbd[_0x3e5b('0x16')]['message']);}else{logger[_0x3e5b('0x10')](_0x3e5b('0x11'),_0x3d3b6e,'request\x20sent');_0x17dee7(_0x52efbd[_0x3e5b('0x18')][_0x3e5b('0x17')]);}})['catch'](function(_0x4b189d){logger[_0x3e5b('0x16')](_0x3e5b('0x11'),_0x3d3b6e,_0x4b189d);_0xeeaabc(_0x4b189d);});});}exports[_0x3e5b('0x19')]=function(_0xff4aba){var _0x24de5b=this;return new Promise(function(_0x1564b5,_0x447d36){return db[_0x3e5b('0x1a')][_0x3e5b('0x1b')](_0xff4aba[_0x3e5b('0x1c')],{'raw':_0xff4aba[_0x3e5b('0x1d')]?_0xff4aba[_0x3e5b('0x1d')][_0x3e5b('0x1e')]===undefined?!![]:![]:!![]})[_0x3e5b('0xf')](function(_0x5b46d4){logger[_0x3e5b('0x10')](_0x3e5b('0x19'),_0xff4aba);logger[_0x3e5b('0x13')](_0x3e5b('0x19'),_0xff4aba,JSON['stringify'](_0x5b46d4));_0x1564b5(_0x5b46d4);})[_0x3e5b('0x1f')](function(_0x5b33bb){logger[_0x3e5b('0x16')](_0x3e5b('0x19'),_0x5b33bb['message'],_0xff4aba);_0x447d36(_0x24de5b[_0x3e5b('0x16')](0x1f4,_0x5b33bb[_0x3e5b('0x17')]));});});};exports[_0x3e5b('0x20')]=function(_0x3c8965){var _0x3bb749=this;return new Promise(function(_0x26c7f2,_0x160e87){return db[_0x3e5b('0x1a')]['update'](_0x3c8965[_0x3e5b('0x1c')],{'raw':_0x3c8965['options']?_0x3c8965[_0x3e5b('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c8965[_0x3e5b('0x1d')]?_0x3c8965[_0x3e5b('0x1d')][_0x3e5b('0x21')]||null:null,'attributes':_0x3c8965[_0x3e5b('0x1d')]?_0x3c8965[_0x3e5b('0x1d')][_0x3e5b('0x22')]||null:null,'limit':_0x3c8965[_0x3e5b('0x1d')]?_0x3c8965[_0x3e5b('0x1d')][_0x3e5b('0x23')]||null:null})[_0x3e5b('0xf')](function(_0x1e1565){logger['info'](_0x3e5b('0x20'),_0x3c8965);logger[_0x3e5b('0x13')](_0x3e5b('0x20'),_0x3c8965,JSON[_0x3e5b('0x15')](_0x1e1565));_0x26c7f2(_0x1e1565);})[_0x3e5b('0x1f')](function(_0x31e9f9){logger[_0x3e5b('0x16')]('UpdateFaxMessage',_0x31e9f9[_0x3e5b('0x17')],_0x3c8965);_0x160e87(_0x3bb749['error'](0x1f4,_0x31e9f9['message']));});});};
\ No newline at end of file
+var _0xdace=['FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','FaxMessage','create','body','options','raw','CreateFaxMessage','UpdateFaxMessage','update','attributes','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','./faxMessage.socket','register','then','FaxMessage,\x20%s,\x20%s','debug'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xdace,0xc5));var _0xedac=function(_0x30faec,_0x18940b){_0x30faec=_0x30faec-0x0;var _0x29484f=_0xdace[_0x30faec];return _0x29484f;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var moment=require(_0xedac('0x1'));var BPromise=require(_0xedac('0x2'));var rs=require(_0xedac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedac('0x4'))['db'];var utils=require(_0xedac('0x5'));var logger=require(_0xedac('0x6'))(_0xedac('0x7'));var config=require('../../config/environment');var jayson=require(_0xedac('0x8'));var client=jayson[_0xedac('0x9')][_0xedac('0xa')]({'port':0x232a});config['redis']=_[_0xedac('0xb')](config[_0xedac('0xc')],{'host':_0xedac('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xedac('0xc')]));require(_0xedac('0xe'))[_0xedac('0xf')](socket);function respondWithRpcPromise(_0x4af030,_0x5e188c,_0x144368){return new BPromise(function(_0x2ea11d,_0x57e1bf){return client['request'](_0x4af030,_0x144368)[_0xedac('0x10')](function(_0x25395d){logger['info'](_0xedac('0x11'),_0x5e188c,'request\x20sent');logger[_0xedac('0x12')](_0xedac('0x13'),_0x5e188c,_0xedac('0x14'),JSON[_0xedac('0x15')](_0x25395d));if(_0x25395d[_0xedac('0x16')]){if(_0x25395d[_0xedac('0x16')][_0xedac('0x17')]===0x1f4){logger[_0xedac('0x16')]('FaxMessage,\x20%s,\x20%s',_0x5e188c,_0x25395d[_0xedac('0x16')][_0xedac('0x18')]);return _0x57e1bf(_0x25395d[_0xedac('0x16')][_0xedac('0x18')]);}logger[_0xedac('0x16')]('FaxMessage,\x20%s,\x20%s',_0x5e188c,_0x25395d[_0xedac('0x16')]['message']);return _0x2ea11d(_0x25395d[_0xedac('0x16')][_0xedac('0x18')]);}else{logger[_0xedac('0x19')](_0xedac('0x11'),_0x5e188c,'request\x20sent');_0x2ea11d(_0x25395d['result'][_0xedac('0x18')]);}})[_0xedac('0x1a')](function(_0x25fe64){logger[_0xedac('0x16')]('FaxMessage,\x20%s,\x20%s',_0x5e188c,_0x25fe64);_0x57e1bf(_0x25fe64);});});}exports['CreateFaxMessage']=function(_0x2b2ae9){var _0x17766c=this;return new Promise(function(_0x23c609,_0xcc1605){return db[_0xedac('0x1b')][_0xedac('0x1c')](_0x2b2ae9[_0xedac('0x1d')],{'raw':_0x2b2ae9[_0xedac('0x1e')]?_0x2b2ae9['options'][_0xedac('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x29cd40){logger[_0xedac('0x19')]('CreateFaxMessage',_0x2b2ae9);logger[_0xedac('0x12')](_0xedac('0x20'),_0x2b2ae9,JSON[_0xedac('0x15')](_0x29cd40));_0x23c609(_0x29cd40);})[_0xedac('0x1a')](function(_0x6b13ca){logger[_0xedac('0x16')]('CreateFaxMessage',_0x6b13ca[_0xedac('0x18')],_0x2b2ae9);_0xcc1605(_0x17766c[_0xedac('0x16')](0x1f4,_0x6b13ca[_0xedac('0x18')]));});});};exports[_0xedac('0x21')]=function(_0x1ff33e){var _0x453a3c=this;return new Promise(function(_0x40ba53,_0x26c6f7){return db[_0xedac('0x1b')][_0xedac('0x22')](_0x1ff33e['body'],{'raw':_0x1ff33e[_0xedac('0x1e')]?_0x1ff33e[_0xedac('0x1e')][_0xedac('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ff33e['options']?_0x1ff33e[_0xedac('0x1e')]['where']||null:null,'attributes':_0x1ff33e['options']?_0x1ff33e[_0xedac('0x1e')][_0xedac('0x23')]||null:null,'limit':_0x1ff33e[_0xedac('0x1e')]?_0x1ff33e[_0xedac('0x1e')]['limit']||null:null})['then'](function(_0xe813e6){logger[_0xedac('0x19')](_0xedac('0x21'),_0x1ff33e);logger[_0xedac('0x12')](_0xedac('0x21'),_0x1ff33e,JSON[_0xedac('0x15')](_0xe813e6));_0x40ba53(_0xe813e6);})[_0xedac('0x1a')](function(_0x483233){logger[_0xedac('0x16')](_0xedac('0x21'),_0x483233[_0xedac('0x18')],_0x1ff33e);_0x26c6f7(_0x453a3c['error'](0x1f4,_0x483233[_0xedac('0x18')]));});});};
\ No newline at end of file
index a857b4e..7c176c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9436=['faxMessage:','./faxMessage.events','save','update','emit','removeListener','register','length'];(function(_0x43d66e,_0x1e9306){var _0x3d8cd2=function(_0x2fa6d2){while(--_0x2fa6d2){_0x43d66e['push'](_0x43d66e['shift']());}};_0x3d8cd2(++_0x1e9306);}(_0x9436,0x191));var _0x6943=function(_0x2ae8f6,_0x49d56b){_0x2ae8f6=_0x2ae8f6-0x0;var _0x2a82ce=_0x9436[_0x2ae8f6];return _0x2a82ce;};'use strict';var FaxMessageEvents=require(_0x6943('0x0'));var events=[_0x6943('0x1'),'remove',_0x6943('0x2')];function createListener(_0x3f3e96,_0x3abe9b){return function(_0x596f0c){_0x3abe9b[_0x6943('0x3')](_0x3f3e96,_0x596f0c);};}function removeListener(_0x5db481,_0xcc85a8){return function(){FaxMessageEvents[_0x6943('0x4')](_0x5db481,_0xcc85a8);};}exports[_0x6943('0x5')]=function(_0x2870df){for(var _0x433531=0x0,_0x24b917=events[_0x6943('0x6')];_0x433531<_0x24b917;_0x433531++){var _0x455fc4=events[_0x433531];var _0x279168=createListener(_0x6943('0x7')+_0x455fc4,_0x2870df);FaxMessageEvents['on'](_0x455fc4,_0x279168);}};
\ No newline at end of file
+var _0x8caf=['removeListener','length','./faxMessage.events','remove','update','emit'];(function(_0x1cfca2,_0x356b47){var _0x2fdbc2=function(_0x57efcc){while(--_0x57efcc){_0x1cfca2['push'](_0x1cfca2['shift']());}};_0x2fdbc2(++_0x356b47);}(_0x8caf,0x188));var _0xf8ca=function(_0x3d7022,_0x59dfd5){_0x3d7022=_0x3d7022-0x0;var _0x40870b=_0x8caf[_0x3d7022];return _0x40870b;};'use strict';var FaxMessageEvents=require(_0xf8ca('0x0'));var events=['save',_0xf8ca('0x1'),_0xf8ca('0x2')];function createListener(_0x576d39,_0x3fe771){return function(_0x2df12b){_0x3fe771[_0xf8ca('0x3')](_0x576d39,_0x2df12b);};}function removeListener(_0xeca322,_0x82bf38){return function(){FaxMessageEvents[_0xf8ca('0x4')](_0xeca322,_0x82bf38);};}exports['register']=function(_0x502b4e){for(var _0x2e10eb=0x0,_0x4df609=events[_0xf8ca('0x5')];_0x2e10eb<_0x4df609;_0x2e10eb++){var _0x280c81=events[_0x2e10eb];var _0x3f7f5f=createListener('faxMessage:'+_0x280c81,_0x502b4e);FaxMessageEvents['on'](_0x280c81,_0x3f7f5f);}};
\ No newline at end of file
index 16a3ef3..a51c952 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41bb=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','describe','/:id','show','/:id/download','download','fax','faxmessage:create','create','put','update','/:id/accept','accept','reject','delete','destroy','multer','util','connect-timeout'];(function(_0x23502b,_0x2ed417){var _0x4fce8e=function(_0x5ec687){while(--_0x5ec687){_0x23502b['push'](_0x23502b['shift']());}};_0x4fce8e(++_0x2ed417);}(_0x41bb,0xc5));var _0xb41b=function(_0x1667f1,_0x4fe2cd){_0x1667f1=_0x1667f1-0x0;var _0x47caa6=_0x41bb[_0x1667f1];return _0x47caa6;};'use strict';var multer=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var path=require('path');var timeout=require(_0xb41b('0x2'));var express=require('express');var router=express[_0xb41b('0x3')]();var fs_extra=require(_0xb41b('0x4'));var auth=require(_0xb41b('0x5'));var interaction=require(_0xb41b('0x6'));var config=require('../../config/environment');var controller=require(_0xb41b('0x7'));router[_0xb41b('0x8')]('/',auth[_0xb41b('0x9')](),controller['index']);router['get']('/describe',auth[_0xb41b('0x9')](),controller[_0xb41b('0xa')]);router['get'](_0xb41b('0xb'),auth[_0xb41b('0x9')](),controller[_0xb41b('0xc')]);router[_0xb41b('0x8')](_0xb41b('0xd'),auth[_0xb41b('0x9')](),controller[_0xb41b('0xe')]);router['post']('/',auth[_0xb41b('0x9')](),interaction['tracked'](_0xb41b('0xf'),_0xb41b('0x10')),controller[_0xb41b('0x11')]);router[_0xb41b('0x12')](_0xb41b('0xb'),auth['isAuthenticated'](),controller[_0xb41b('0x13')]);router[_0xb41b('0x12')](_0xb41b('0x14'),auth[_0xb41b('0x9')](),controller[_0xb41b('0x15')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0xb41b('0x16')]);router[_0xb41b('0x17')](_0xb41b('0xb'),auth[_0xb41b('0x9')](),controller[_0xb41b('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0xe205=['../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','index','/:id','/:id/download','download','tracked','fax','faxmessage:create','create','put','update','reject','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x102470,_0x199a01){var _0x558eaa=function(_0x12c74a){while(--_0x12c74a){_0x102470['push'](_0x102470['shift']());}};_0x558eaa(++_0x199a01);}(_0xe205,0xa7));var _0x5e20=function(_0xd16fda,_0x17b057){_0xd16fda=_0xd16fda-0x0;var _0x16aaf5=_0xe205[_0xd16fda];return _0x16aaf5;};'use strict';var multer=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var path=require(_0x5e20('0x2'));var timeout=require(_0x5e20('0x3'));var express=require(_0x5e20('0x4'));var router=express[_0x5e20('0x5')]();var fs_extra=require(_0x5e20('0x6'));var auth=require(_0x5e20('0x7'));var interaction=require(_0x5e20('0x8'));var config=require('../../config/environment');var controller=require(_0x5e20('0x9'));router[_0x5e20('0xa')]('/',auth[_0x5e20('0xb')](),controller[_0x5e20('0xc')]);router['get']('/describe',auth[_0x5e20('0xb')](),controller['describe']);router['get'](_0x5e20('0xd'),auth[_0x5e20('0xb')](),controller['show']);router[_0x5e20('0xa')](_0x5e20('0xe'),auth[_0x5e20('0xb')](),controller[_0x5e20('0xf')]);router['post']('/',auth[_0x5e20('0xb')](),interaction[_0x5e20('0x10')](_0x5e20('0x11'),_0x5e20('0x12')),controller[_0x5e20('0x13')]);router[_0x5e20('0x14')]('/:id',auth[_0x5e20('0xb')](),controller[_0x5e20('0x15')]);router[_0x5e20('0x14')]('/:id/accept',auth[_0x5e20('0xb')](),controller['accept']);router[_0x5e20('0x14')]('/:id/reject',auth[_0x5e20('0xb')](),controller[_0x5e20('0x16')]);router[_0x5e20('0x17')](_0x5e20('0xd'),auth[_0x5e20('0xb')](),controller['destroy']);module[_0x5e20('0x18')]=router;
\ No newline at end of file
index 440111b..9064e8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x833c=['name','INTEGER','ENUM','beepall','roundrobin','exports','STRING'];(function(_0x526631,_0x36130d){var _0x3c0945=function(_0x4095a3){while(--_0x4095a3){_0x526631['push'](_0x526631['shift']());}};_0x3c0945(++_0x36130d);}(_0x833c,0x1c5));var _0xc833=function(_0x197f77,_0xc200e0){_0x197f77=_0x197f77-0x0;var _0x289766=_0x833c[_0x197f77];return _0x289766;};'use strict';var Sequelize=require('sequelize');module[_0xc833('0x0')]={'name':{'type':Sequelize[_0xc833('0x1')],'unique':_0xc833('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc833('0x1')]},'timeout':{'type':Sequelize[_0xc833('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc833('0x4')]('rrmemory',_0xc833('0x5'),_0xc833('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xc833('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x992b=['roundrobin','sequelize','STRING','name','INTEGER','ENUM','beepall'];(function(_0x45b5a2,_0x6bd877){var _0x2a0827=function(_0x32000d){while(--_0x32000d){_0x45b5a2['push'](_0x45b5a2['shift']());}};_0x2a0827(++_0x6bd877);}(_0x992b,0x127));var _0xb992=function(_0x123917,_0x31afe3){_0x123917=_0x123917-0x0;var _0x3b0008=_0x992b[_0x123917];return _0x3b0008;};'use strict';var Sequelize=require(_0xb992('0x0'));module['exports']={'name':{'type':Sequelize[_0xb992('0x1')],'unique':_0xb992('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb992('0x1')]},'timeout':{'type':Sequelize[_0xb992('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb992('0x4')]('rrmemory',_0xb992('0x5'),_0xb992('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xb992('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index e7f35cf..26b9146 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6e9=['catch','find','create','role','user','FaxQueues','UserProfileSection','userProfileId','autoAssociation','body','params','describe','getMembers','findOne','UserFaxQueue','hasOwnProperty','FaxQueueId','User','findAndCountAll','agent','faxPause','updatedAt','rows','format','SIP','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','addAgents','isArray','userFaxQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','fs-extra','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','end','error','stack','name','send','index','FaxQueue','rawAttributes','type','key','model','map','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x4f3c26,_0x41079a){var _0x55277c=function(_0x49db41){while(--_0x49db41){_0x4f3c26['push'](_0x4f3c26['shift']());}};_0x55277c(++_0x41079a);}(_0xb6e9,0x1e8));var _0x9b6e=function(_0x22fd89,_0x2b0241){_0x22fd89=_0x22fd89-0x0;var _0x32e265=_0xb6e9[_0x22fd89];return _0x32e265;};'use strict';var emlformat=require(_0x9b6e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9b6e('0x1'));var jsonpatch=require(_0x9b6e('0x2'));var rp=require(_0x9b6e('0x3'));var moment=require(_0x9b6e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9b6e('0x5'));var util=require(_0x9b6e('0x6'));var path=require(_0x9b6e('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9b6e('0x8'));var _=require(_0x9b6e('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9b6e('0xa'));var deskjs=require(_0x9b6e('0xb'));var toCsv=require(_0x9b6e('0xc'));var querystring=require('querystring');var Papa=require(_0x9b6e('0xd'));var Redis=require(_0x9b6e('0xe'));var authService=require(_0x9b6e('0xf'));var qs=require(_0x9b6e('0x10'));var as=require(_0x9b6e('0x11'));var hardwareService=require(_0x9b6e('0x12'));var logger=require('../../config/logger')(_0x9b6e('0x13'));var utils=require(_0x9b6e('0x14'));var config=require(_0x9b6e('0x15'));var licenseUtil=require(_0x9b6e('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x9b6e('0x17')](config[_0x9b6e('0x18')],{'host':_0x9b6e('0x19'),'port':0x18eb});var socket=require(_0x9b6e('0x1a'))(new Redis(config[_0x9b6e('0x18')]));require(_0x9b6e('0x1b'))[_0x9b6e('0x1c')](socket);function respondWithStatusCode(_0x402f6b,_0x4f98a1){_0x4f98a1=_0x4f98a1||0xcc;return function(_0x1dc220){if(_0x1dc220){return _0x402f6b[_0x9b6e('0x1d')](_0x4f98a1);}return _0x402f6b['status'](_0x4f98a1)['end']();};}function respondWithResult(_0x56d6af,_0x1b805b){_0x1b805b=_0x1b805b||0xc8;return function(_0x339bec){if(_0x339bec){return _0x56d6af[_0x9b6e('0x1e')](_0x1b805b)['json'](_0x339bec);}};}function respondWithFilteredResult(_0xbd138a,_0xa0efc9){return function(_0x3f8ad9){if(_0x3f8ad9){var _0x4e0f44=typeof _0xa0efc9['offset']==='undefined'&&typeof _0xa0efc9[_0x9b6e('0x1f')]===_0x9b6e('0x20');var _0x3ac8de=_0x3f8ad9[_0x9b6e('0x21')];var _0x1f75b7=_0x4e0f44?0x0:_0xa0efc9['offset'];var _0x4c1a66=_0x4e0f44?_0x3f8ad9['count']:_0xa0efc9[_0x9b6e('0x22')]+_0xa0efc9[_0x9b6e('0x1f')];var _0x528ed9;if(_0x4c1a66>=_0x3ac8de){_0x4c1a66=_0x3ac8de;_0x528ed9=0xc8;}else{_0x528ed9=0xce;}_0xbd138a[_0x9b6e('0x1e')](_0x528ed9);return _0xbd138a[_0x9b6e('0x23')](_0x9b6e('0x24'),_0x1f75b7+'-'+_0x4c1a66+'/'+_0x3ac8de)['json'](_0x3f8ad9);}return null;};}function patchUpdates(_0x314bed){return function(_0x3dde98){try{jsonpatch[_0x9b6e('0x25')](_0x3dde98,_0x314bed,!![]);}catch(_0x1eedb1){return BPromise[_0x9b6e('0x26')](_0x1eedb1);}return _0x3dde98[_0x9b6e('0x27')]();};}function saveUpdates(_0x294f4e,_0x312736){return function(_0x274cf6){if(_0x274cf6){return _0x274cf6[_0x9b6e('0x28')](_0x294f4e)['then'](function(_0x4fd5bf){return _0x4fd5bf;});}return null;};}function removeEntity(_0x103199,_0x3da366){return function(_0x127699){if(_0x127699){return _0x127699[_0x9b6e('0x29')]()[_0x9b6e('0x2a')](function(){var _0x2d9fd7=_0x127699[_0x9b6e('0x2b')]({'plain':!![]});var _0x57732b='FaxQueues';return db[_0x9b6e('0x2c')][_0x9b6e('0x29')]({'where':{'type':_0x57732b,'resourceId':_0x2d9fd7['id']}})['then'](function(){return _0x127699;});})[_0x9b6e('0x2a')](function(){_0x103199[_0x9b6e('0x1e')](0xcc)[_0x9b6e('0x2d')]();});}};}function handleEntityNotFound(_0x1e8ea2,_0x381d20){return function(_0x324bf9){if(!_0x324bf9){_0x1e8ea2['sendStatus'](0x194);}return _0x324bf9;};}function handleError(_0x28c16d,_0x55cb2b){_0x55cb2b=_0x55cb2b||0x1f4;return function(_0x2aa00a){logger[_0x9b6e('0x2e')](_0x2aa00a[_0x9b6e('0x2f')]);if(_0x2aa00a['name']){delete _0x2aa00a[_0x9b6e('0x30')];}_0x28c16d[_0x9b6e('0x1e')](_0x55cb2b)[_0x9b6e('0x31')](_0x2aa00a);};}exports[_0x9b6e('0x32')]=function(_0xe8e6f4,_0x172320){var _0x288cbb={},_0x5120d9={},_0x1becb5={'count':0x0,'rows':[]};var _0x4c2f46=_['map'](db[_0x9b6e('0x33')][_0x9b6e('0x34')],function(_0x1ec098){return{'name':_0x1ec098['fieldName'],'type':_0x1ec098[_0x9b6e('0x35')][_0x9b6e('0x36')]};});_0x5120d9[_0x9b6e('0x37')]=_[_0x9b6e('0x38')](_0x4c2f46,'name');_0x5120d9[_0x9b6e('0x39')]=_[_0x9b6e('0x3a')](_0xe8e6f4['query']);_0x5120d9['filters']=_['intersection'](_0x5120d9[_0x9b6e('0x37')],_0x5120d9[_0x9b6e('0x39')]);_0x288cbb[_0x9b6e('0x3b')]=_[_0x9b6e('0x3c')](_0x5120d9['model'],qs[_0x9b6e('0x3d')](_0xe8e6f4[_0x9b6e('0x39')]['fields']));_0x288cbb[_0x9b6e('0x3b')]=_0x288cbb[_0x9b6e('0x3b')][_0x9b6e('0x3e')]?_0x288cbb['attributes']:_0x5120d9[_0x9b6e('0x37')];if(!_0xe8e6f4['query']['hasOwnProperty'](_0x9b6e('0x3f'))){_0x288cbb[_0x9b6e('0x1f')]=qs['limit'](_0xe8e6f4[_0x9b6e('0x39')][_0x9b6e('0x1f')]);_0x288cbb[_0x9b6e('0x22')]=qs['offset'](_0xe8e6f4['query'][_0x9b6e('0x22')]);}_0x288cbb[_0x9b6e('0x40')]=qs[_0x9b6e('0x41')](_0xe8e6f4[_0x9b6e('0x39')][_0x9b6e('0x41')]);_0x288cbb[_0x9b6e('0x42')]=qs[_0x9b6e('0x43')](_[_0x9b6e('0x44')](_0xe8e6f4['query'],_0x5120d9[_0x9b6e('0x43')]),_0x4c2f46);if(_0xe8e6f4[_0x9b6e('0x39')][_0x9b6e('0x45')]){_0x288cbb[_0x9b6e('0x42')]=_[_0x9b6e('0x46')](_0x288cbb[_0x9b6e('0x42')],{'$or':_['map'](_0x4c2f46,function(_0x4317a1){if(_0x4317a1[_0x9b6e('0x35')]!==_0x9b6e('0x47')){var _0x200e4a={};_0x200e4a[_0x4317a1[_0x9b6e('0x30')]]={'$like':'%'+_0xe8e6f4[_0x9b6e('0x39')][_0x9b6e('0x45')]+'%'};return _0x200e4a;}})});}_0x288cbb=_[_0x9b6e('0x46')]({},_0x288cbb,_0xe8e6f4[_0x9b6e('0x48')]);var _0x3e5054={'where':_0x288cbb['where']};return db[_0x9b6e('0x33')][_0x9b6e('0x21')](_0x3e5054)['then'](function(_0x3b587e){_0x1becb5['count']=_0x3b587e;if(_0xe8e6f4[_0x9b6e('0x39')][_0x9b6e('0x49')]){_0x288cbb[_0x9b6e('0x4a')]=[{'all':!![]}];}return db[_0x9b6e('0x33')][_0x9b6e('0x4b')](_0x288cbb);})['then'](function(_0x486f40){_0x1becb5['rows']=_0x486f40;return _0x1becb5;})[_0x9b6e('0x2a')](respondWithFilteredResult(_0x172320,_0x288cbb))[_0x9b6e('0x4c')](handleError(_0x172320,null));};exports['show']=function(_0x1bf20f,_0x163c12){var _0x1d4b09={'raw':!![],'where':{'id':_0x1bf20f['params']['id']}},_0x42cb25={};_0x42cb25['model']=_[_0x9b6e('0x3a')](db[_0x9b6e('0x33')][_0x9b6e('0x34')]);_0x42cb25[_0x9b6e('0x39')]=_[_0x9b6e('0x3a')](_0x1bf20f[_0x9b6e('0x39')]);_0x42cb25[_0x9b6e('0x43')]=_[_0x9b6e('0x3c')](_0x42cb25[_0x9b6e('0x37')],_0x42cb25['query']);_0x1d4b09[_0x9b6e('0x3b')]=_[_0x9b6e('0x3c')](_0x42cb25[_0x9b6e('0x37')],qs['fields'](_0x1bf20f[_0x9b6e('0x39')][_0x9b6e('0x3d')]));_0x1d4b09['attributes']=_0x1d4b09[_0x9b6e('0x3b')][_0x9b6e('0x3e')]?_0x1d4b09[_0x9b6e('0x3b')]:_0x42cb25[_0x9b6e('0x37')];if(_0x1bf20f[_0x9b6e('0x39')][_0x9b6e('0x49')]){_0x1d4b09[_0x9b6e('0x4a')]=[{'all':!![]}];}_0x1d4b09=_[_0x9b6e('0x46')]({},_0x1d4b09,_0x1bf20f[_0x9b6e('0x48')]);return db['FaxQueue'][_0x9b6e('0x4d')](_0x1d4b09)[_0x9b6e('0x2a')](handleEntityNotFound(_0x163c12,null))[_0x9b6e('0x2a')](respondWithResult(_0x163c12,null))['catch'](handleError(_0x163c12,null));};exports['create']=function(_0x664e53,_0x151af1){return db[_0x9b6e('0x33')][_0x9b6e('0x4e')](_0x664e53['body'],{})['then'](function(_0x5abf88){var _0x43f871=_0x664e53['user'][_0x9b6e('0x2b')]({'plain':!![]});if(!_0x43f871)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x43f871[_0x9b6e('0x4f')]===_0x9b6e('0x50')){var _0x249d59=_0x5abf88[_0x9b6e('0x2b')]({'plain':!![]});var _0x25477d=_0x9b6e('0x51');return db[_0x9b6e('0x52')][_0x9b6e('0x4d')]({'where':{'name':_0x25477d,'userProfileId':_0x43f871[_0x9b6e('0x53')]},'raw':!![]})[_0x9b6e('0x2a')](function(_0x3a0323){if(_0x3a0323&&_0x3a0323[_0x9b6e('0x54')]===0x0){return db[_0x9b6e('0x2c')][_0x9b6e('0x4e')]({'name':_0x249d59['name'],'resourceId':_0x249d59['id'],'type':_0x3a0323[_0x9b6e('0x30')],'sectionId':_0x3a0323['id']},{})['then'](function(){return _0x5abf88;});}else{return _0x5abf88;}})[_0x9b6e('0x4c')](function(_0x28a3c6){logger[_0x9b6e('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28a3c6);throw _0x28a3c6;});}return _0x5abf88;})[_0x9b6e('0x2a')](respondWithResult(_0x151af1,0xc9))[_0x9b6e('0x4c')](handleError(_0x151af1,null));};exports[_0x9b6e('0x28')]=function(_0x4ca214,_0x5d3830){if(_0x4ca214[_0x9b6e('0x55')]['id']){delete _0x4ca214[_0x9b6e('0x55')]['id'];}return db[_0x9b6e('0x33')][_0x9b6e('0x4d')]({'where':{'id':_0x4ca214['params']['id']}})['then'](handleEntityNotFound(_0x5d3830,null))[_0x9b6e('0x2a')](saveUpdates(_0x4ca214['body'],null))[_0x9b6e('0x2a')](respondWithResult(_0x5d3830,null))[_0x9b6e('0x4c')](handleError(_0x5d3830,null));};exports['destroy']=function(_0x5d3efb,_0x475529){return db[_0x9b6e('0x33')][_0x9b6e('0x4d')]({'where':{'id':_0x5d3efb[_0x9b6e('0x56')]['id']}})[_0x9b6e('0x2a')](handleEntityNotFound(_0x475529,null))[_0x9b6e('0x2a')](removeEntity(_0x475529,null))[_0x9b6e('0x4c')](handleError(_0x475529,null));};exports[_0x9b6e('0x57')]=function(_0x14950e,_0x869430){return db['FaxQueue']['describe']()[_0x9b6e('0x2a')](respondWithResult(_0x869430,null))[_0x9b6e('0x4c')](handleError(_0x869430,null));};exports[_0x9b6e('0x58')]=function(_0x181604,_0x243731,_0x112356){var _0x5ae812={'raw':!![],'where':{}},_0x3b5ab8={},_0x1ceec7;return db['FaxQueue'][_0x9b6e('0x59')]({'where':{'id':_0x181604['params']['id']}})[_0x9b6e('0x2a')](handleEntityNotFound(_0x243731,null))[_0x9b6e('0x2a')](function(_0x509186){if(_0x509186){_0x1ceec7=_0x509186[_0x9b6e('0x2b')]({'plain':!![]});_0x3b5ab8[_0x9b6e('0x37')]=_['keys'](db[_0x9b6e('0x5a')][_0x9b6e('0x34')]);_0x3b5ab8[_0x9b6e('0x39')]=_[_0x9b6e('0x3a')](_0x181604[_0x9b6e('0x39')]);_0x3b5ab8[_0x9b6e('0x43')]=_[_0x9b6e('0x3c')](_0x3b5ab8[_0x9b6e('0x37')],_0x3b5ab8[_0x9b6e('0x39')]);_0x5ae812['attributes']=_['intersection'](_0x3b5ab8[_0x9b6e('0x37')],qs['fields'](_0x181604[_0x9b6e('0x39')][_0x9b6e('0x3d')]));_0x5ae812[_0x9b6e('0x3b')]=_0x5ae812[_0x9b6e('0x3b')][_0x9b6e('0x3e')]?_0x5ae812[_0x9b6e('0x3b')]:_0x3b5ab8[_0x9b6e('0x37')];if(!_0x181604[_0x9b6e('0x39')][_0x9b6e('0x5b')](_0x9b6e('0x3f'))){_0x5ae812[_0x9b6e('0x1f')]=qs['limit'](_0x181604[_0x9b6e('0x39')][_0x9b6e('0x1f')]);_0x5ae812[_0x9b6e('0x22')]=qs['offset'](_0x181604['query'][_0x9b6e('0x22')]);}_0x5ae812[_0x9b6e('0x40')]=qs[_0x9b6e('0x41')](_0x181604['query'][_0x9b6e('0x41')]);_0x5ae812[_0x9b6e('0x42')]=qs['filters'](_[_0x9b6e('0x44')](_0x181604[_0x9b6e('0x39')],_0x3b5ab8[_0x9b6e('0x43')]));_0x5ae812[_0x9b6e('0x42')][_0x9b6e('0x5c')]=_0x509186['id'];if(_0x181604[_0x9b6e('0x39')][_0x9b6e('0x45')]){_0x5ae812[_0x9b6e('0x42')]=_[_0x9b6e('0x46')](_0x5ae812[_0x9b6e('0x42')],{'$or':_[_0x9b6e('0x38')](_0x5ae812[_0x9b6e('0x3b')],function(_0x5efbff){var _0x32b5df={};_0x32b5df[_0x5efbff]={'$like':'%'+_0x181604[_0x9b6e('0x39')][_0x9b6e('0x45')]+'%'};return _0x32b5df;})});}_0x5ae812=_['merge']({},_0x5ae812,_0x181604[_0x9b6e('0x48')]);return db[_0x9b6e('0x5a')][_0x9b6e('0x4b')](_0x5ae812);}})['then'](function(_0x5c8473){if(_0x5c8473){return db[_0x9b6e('0x5d')][_0x9b6e('0x5e')]({'where':{'id':_[_0x9b6e('0x38')](_0x5c8473,'UserId'),'role':_0x9b6e('0x5f')},'attributes':['id','name',_0x9b6e('0x60'),_0x9b6e('0x61'),'createdAt']});}})[_0x9b6e('0x2a')](function(_0x59dc1a){if(_0x59dc1a){return{'count':_0x59dc1a[_0x9b6e('0x21')],'rows':_[_0x9b6e('0x38')](_0x59dc1a[_0x9b6e('0x62')],function(_0x415e){return{'membername':_0x415e['name'],'UserId':_0x415e['id'],'queue_name':_0x1ceec7[_0x9b6e('0x30')],'FaxQueueId':_0x1ceec7['id'],'interface':util[_0x9b6e('0x63')]('%s/%s',_0x9b6e('0x64'),_0x415e[_0x9b6e('0x30')]),'penalty':0x0,'paused':_0x415e[_0x9b6e('0x60')],'createdAt':_0x415e['createdAt'],'updatedAt':_0x415e[_0x9b6e('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9b6e('0x2a')](respondWithFilteredResult(_0x243731,_0x5ae812))[_0x9b6e('0x4c')](handleError(_0x243731,null));};exports[_0x9b6e('0x65')]=function(_0x7c75b,_0x46f2c9,_0x1436bb){var _0x440d95={};var _0x3c3b42={};var _0x33d78f;var _0x5753db;return db[_0x9b6e('0x33')][_0x9b6e('0x59')]({'where':{'id':_0x7c75b['params']['id']}})['then'](handleEntityNotFound(_0x46f2c9,null))[_0x9b6e('0x2a')](function(_0x338eb4){if(_0x338eb4){_0x33d78f=_0x338eb4;_0x3c3b42[_0x9b6e('0x37')]=_[_0x9b6e('0x3a')](db[_0x9b6e('0x66')][_0x9b6e('0x34')]);_0x3c3b42[_0x9b6e('0x39')]=_[_0x9b6e('0x3a')](_0x7c75b[_0x9b6e('0x39')]);_0x3c3b42[_0x9b6e('0x43')]=_[_0x9b6e('0x3c')](_0x3c3b42[_0x9b6e('0x37')],_0x3c3b42[_0x9b6e('0x39')]);_0x440d95[_0x9b6e('0x3b')]=_['intersection'](_0x3c3b42[_0x9b6e('0x37')],qs['fields'](_0x7c75b[_0x9b6e('0x39')][_0x9b6e('0x3d')]));_0x440d95[_0x9b6e('0x3b')]=_0x440d95[_0x9b6e('0x3b')][_0x9b6e('0x3e')]?_0x440d95[_0x9b6e('0x3b')]:_0x3c3b42[_0x9b6e('0x37')];_0x440d95[_0x9b6e('0x40')]=qs['sort'](_0x7c75b[_0x9b6e('0x39')]['sort']);_0x440d95[_0x9b6e('0x42')]=qs[_0x9b6e('0x43')](_[_0x9b6e('0x44')](_0x7c75b[_0x9b6e('0x39')],_0x3c3b42[_0x9b6e('0x43')]));if(_0x7c75b['query'][_0x9b6e('0x45')]){_0x440d95[_0x9b6e('0x42')]=_['merge'](_0x440d95['where'],{'$or':_[_0x9b6e('0x38')](_0x440d95[_0x9b6e('0x3b')],function(_0x5372f4){var _0x3c2546={};_0x3c2546[_0x5372f4]={'$like':'%'+_0x7c75b['query'][_0x9b6e('0x45')]+'%'};return _0x3c2546;})});}_0x440d95=_[_0x9b6e('0x46')]({},_0x440d95,_0x7c75b[_0x9b6e('0x48')]);return _0x33d78f[_0x9b6e('0x65')](_0x440d95);}})['then'](function(_0x1a82da){if(_0x1a82da){_0x5753db=_0x1a82da[_0x9b6e('0x3e')];if(!_0x7c75b['query']['hasOwnProperty']('nolimit')){_0x440d95['limit']=qs[_0x9b6e('0x1f')](_0x7c75b[_0x9b6e('0x39')][_0x9b6e('0x1f')]);_0x440d95['offset']=qs[_0x9b6e('0x22')](_0x7c75b['query'][_0x9b6e('0x22')]);}return _0x33d78f['getTeams'](_0x440d95);}})[_0x9b6e('0x2a')](function(_0x2f160f){if(_0x2f160f){return _0x2f160f?{'count':_0x5753db,'rows':_0x2f160f}:null;}})[_0x9b6e('0x2a')](respondWithResult(_0x46f2c9,null))[_0x9b6e('0x4c')](handleError(_0x46f2c9,null));};exports[_0x9b6e('0x67')]=function(_0x5815b6,_0x482bce,_0x1fc23a){var _0x361077=_0x5815b6[_0x9b6e('0x55')][_0x9b6e('0x68')];return db[_0x9b6e('0x66')]['findAll']({'where':{'id':_0x361077},'attributes':['id'],'include':[{'model':db[_0x9b6e('0x5d')],'as':_0x9b6e('0x69'),'attributes':['id',_0x9b6e('0x30'),_0x9b6e('0x6a'),'voicePause',_0x9b6e('0x6b')],'raw':!![]}]})[_0x9b6e('0x2a')](function(_0x3a73cc){if(_0x3a73cc){var _0x213c95=_[_0x9b6e('0x6c')](_0x3a73cc,function(_0x38626d){var _0x414afe=_0x38626d[_0x9b6e('0x2b')]({'plain':!![]});return _0x414afe[_0x9b6e('0x69')];});return db[_0x9b6e('0x33')][_0x9b6e('0x4d')]({'where':{'id':_0x5815b6[_0x9b6e('0x56')]['id']}})[_0x9b6e('0x2a')](function(_0x394a75){return db[_0x9b6e('0x6d')][_0x9b6e('0x6e')](function(_0x8e7568){return _0x394a75[_0x9b6e('0x67')](_0x361077,{'transaction':_0x8e7568})[_0x9b6e('0x2a')](function(){return BPromise[_0x9b6e('0x6f')](_0x213c95,function(_0x153477){return db[_0x9b6e('0x5a')][_0x9b6e('0x70')]({'where':{'UserId':_0x153477['id'],'FaxQueueId':_0x5815b6[_0x9b6e('0x56')]['id']},'transaction':_0x8e7568});});})[_0x9b6e('0x2a')](function(){_0x213c95[_0x9b6e('0x71')](function(_0xb7277d){socket[_0x9b6e('0x72')](_0x9b6e('0x73'),{'UserId':_0xb7277d['id'],'FaxQueueId':_0x394a75['id']});});});});});}})[_0x9b6e('0x2a')](respondWithStatusCode(_0x482bce,null))['catch'](handleError(_0x482bce,null));};exports[_0x9b6e('0x74')]=function(_0x44dac5,_0x2ffff1,_0x6fae31){return db['Team'][_0x9b6e('0x4b')]({'where':{'id':_0x44dac5[_0x9b6e('0x39')][_0x9b6e('0x68')]},'attributes':['id'],'include':[{'model':db[_0x9b6e('0x5d')],'as':_0x9b6e('0x69'),'attributes':['id'],'raw':!![]}]})[_0x9b6e('0x2a')](handleEntityNotFound(_0x2ffff1,null))[_0x9b6e('0x2a')](function(_0x46db4f){var _0x48232=_[_0x9b6e('0x38')](_0x46db4f,'id');var _0x493382=[];var _0x4a5955=[];var _0x46014d=squel[_0x9b6e('0x75')]();_0x46014d[_0x9b6e('0x76')](_0x9b6e('0x77'))['from']('team_has_fax_queues','tq')['join'](_0x9b6e('0x78'),'ut',_0x9b6e('0x79'))[_0x9b6e('0x42')](_0x9b6e('0x7a'),_0x44dac5['params']['id']);for(var _0x148779=0x0;_0x148779<_0x46db4f[_0x9b6e('0x3e')];_0x148779+=0x1){let _0x4455d6=_0x46db4f[_0x148779];for(var _0x15a984=0x0;_0x15a984<_0x4455d6[_0x9b6e('0x69')][_0x9b6e('0x3e')];_0x15a984+=0x1){let _0xf0858a=_0x4455d6[_0x9b6e('0x69')][_0x15a984];var _0x28c071=_0x46014d[_0x9b6e('0x7b')]();_0x28c071[_0x9b6e('0x42')](_0x9b6e('0x7c'),_0xf0858a['id']);_0x4a5955[_0x9b6e('0x7d')](db[_0x9b6e('0x6d')][_0x9b6e('0x39')](_0x28c071[_0x9b6e('0x7e')](),{'type':db[_0x9b6e('0x6d')][_0x9b6e('0x7f')][_0x9b6e('0x80')]})[_0x9b6e('0x2a')](function(_0x2998de){if(_0x2998de[_0x9b6e('0x3e')]===0x1){return _0xf0858a['id'];}else{var _0x49ec1c=_[_0x9b6e('0x81')](_['map'](_0x2998de,_0x9b6e('0x82')),function(_0x222825){return _[_0x9b6e('0x83')](_0x48232,_0x222825);});if(_0x49ec1c){return _0xf0858a['id'];}}}));}}return BPromise[_0x9b6e('0x84')](_0x4a5955)[_0x9b6e('0x2a')](function(_0x115b35){_0x493382=_(_0x493382)['union'](_0x115b35)[_0x9b6e('0x85')]()[_0x9b6e('0x86')]();return db[_0x9b6e('0x33')][_0x9b6e('0x4d')]({'where':{'id':_0x44dac5['params']['id']}})['then'](function(_0x5bd8ba){return db['sequelize']['transaction'](function(_0x1ed021){return _0x5bd8ba['removeTeams'](_0x44dac5[_0x9b6e('0x39')]['ids'],{'transaction':_0x1ed021})['then'](function(){if(!_[_0x9b6e('0x87')](_0x493382)){return _0x5bd8ba[_0x9b6e('0x88')](_0x493382,{'transaction':_0x1ed021});}})[_0x9b6e('0x2a')](function(){_0x493382[_0x9b6e('0x71')](function(_0x5108a7){socket['emit']('userFaxQueue:remove',{'UserId':_0x5108a7,'FaxQueueId':_0x5bd8ba['id']});});});});});});})[_0x9b6e('0x2a')](respondWithStatusCode(_0x2ffff1,null))[_0x9b6e('0x4c')](handleError(_0x2ffff1,null));};exports[_0x9b6e('0x89')]=function(_0x56514f,_0x306c7e,_0x385b17){return db[_0x9b6e('0x33')][_0x9b6e('0x4d')]({'where':{'id':_0x56514f['params']['id']}})[_0x9b6e('0x2a')](handleEntityNotFound(_0x306c7e,null))[_0x9b6e('0x2a')](function(_0x45da01){if(_0x45da01){return _0x45da01[_0x9b6e('0x89')](_0x56514f[_0x9b6e('0x55')][_0x9b6e('0x68')],_['omit'](_0x56514f[_0x9b6e('0x55')],['ids','id'])||{})['spread'](function(_0x3c7bfd){for(var _0x211c5a=0x0;_0x211c5a<_0x56514f[_0x9b6e('0x55')][_0x9b6e('0x68')]['length'];_0x211c5a+=0x1){socket['emit']('userFaxQueue:save',{'UserId':Number(_0x56514f[_0x9b6e('0x55')][_0x9b6e('0x68')][_0x211c5a]),'FaxQueueId':Number(_0x56514f[_0x9b6e('0x56')]['id'])});}return _0x3c7bfd;});}})[_0x9b6e('0x2a')](respondWithResult(_0x306c7e,null))[_0x9b6e('0x4c')](handleError(_0x306c7e,null));};exports[_0x9b6e('0x88')]=function(_0x5e85cb,_0x12ab1b,_0x35fb35){return db['FaxQueue'][_0x9b6e('0x4d')]({'where':{'id':_0x5e85cb[_0x9b6e('0x56')]['id']}})[_0x9b6e('0x2a')](handleEntityNotFound(_0x12ab1b,null))['then'](function(_0x40ee87){if(_0x40ee87){return _0x40ee87[_0x9b6e('0x88')](_0x5e85cb['query']['ids'])['then'](function(){if(_[_0x9b6e('0x8a')](_0x5e85cb[_0x9b6e('0x39')][_0x9b6e('0x68')])){for(var _0x11f3d9=0x0;_0x11f3d9<_0x5e85cb['query']['ids'][_0x9b6e('0x3e')];_0x11f3d9+=0x1){socket[_0x9b6e('0x72')](_0x9b6e('0x8b'),{'UserId':Number(_0x5e85cb[_0x9b6e('0x39')][_0x9b6e('0x68')][_0x11f3d9]),'FaxQueueId':Number(_0x5e85cb[_0x9b6e('0x56')]['id'])});}}else{socket[_0x9b6e('0x72')](_0x9b6e('0x8b'),{'UserId':Number(_0x5e85cb[_0x9b6e('0x39')]['ids']),'FaxQueueId':Number(_0x5e85cb['params']['id'])});}});}})[_0x9b6e('0x2a')](respondWithStatusCode(_0x12ab1b,null))['catch'](handleError(_0x12ab1b,null));};exports[_0x9b6e('0x8c')]=function(_0x304221,_0x3c39f9,_0x20cfba){var _0x434966={};var _0x20f058={};var _0x5b6862;var _0x15a699;return db[_0x9b6e('0x33')][_0x9b6e('0x59')]({'where':{'id':_0x304221[_0x9b6e('0x56')]['id']}})['then'](handleEntityNotFound(_0x3c39f9,null))[_0x9b6e('0x2a')](function(_0x9e65d6){if(_0x9e65d6){_0x5b6862=_0x9e65d6;_0x20f058[_0x9b6e('0x37')]=_[_0x9b6e('0x3a')](db[_0x9b6e('0x5d')][_0x9b6e('0x34')]);_0x20f058[_0x9b6e('0x39')]=_[_0x9b6e('0x3a')](_0x304221['query']);_0x20f058[_0x9b6e('0x43')]=_[_0x9b6e('0x3c')](_0x20f058[_0x9b6e('0x37')],_0x20f058[_0x9b6e('0x39')]);_0x434966[_0x9b6e('0x3b')]=_[_0x9b6e('0x3c')](_0x20f058[_0x9b6e('0x37')],qs[_0x9b6e('0x3d')](_0x304221[_0x9b6e('0x39')][_0x9b6e('0x3d')]));_0x434966[_0x9b6e('0x3b')]=_0x434966[_0x9b6e('0x3b')]['length']?_0x434966[_0x9b6e('0x3b')]:_0x20f058['model'];_0x434966[_0x9b6e('0x40')]=qs[_0x9b6e('0x41')](_0x304221['query'][_0x9b6e('0x41')]);_0x434966[_0x9b6e('0x42')]=qs[_0x9b6e('0x43')](_['pick'](_0x304221[_0x9b6e('0x39')],_0x20f058[_0x9b6e('0x43')]));if(_0x304221['query'][_0x9b6e('0x45')]){_0x434966[_0x9b6e('0x42')]=_['merge'](_0x434966[_0x9b6e('0x42')],{'$or':_[_0x9b6e('0x38')](_0x434966['attributes'],function(_0x23d815){var _0xbbd2d6={};_0xbbd2d6[_0x23d815]={'$like':'%'+_0x304221[_0x9b6e('0x39')][_0x9b6e('0x45')]+'%'};return _0xbbd2d6;})});}_0x434966=_[_0x9b6e('0x46')]({},_0x434966,_0x304221[_0x9b6e('0x48')]);return _0x5b6862[_0x9b6e('0x8c')](_0x434966);}})[_0x9b6e('0x2a')](function(_0x36bd5a){if(_0x36bd5a){_0x15a699=_0x36bd5a['length'];if(!_0x304221[_0x9b6e('0x39')]['hasOwnProperty'](_0x9b6e('0x3f'))){_0x434966[_0x9b6e('0x1f')]=qs[_0x9b6e('0x1f')](_0x304221[_0x9b6e('0x39')][_0x9b6e('0x1f')]);_0x434966[_0x9b6e('0x22')]=qs['offset'](_0x304221[_0x9b6e('0x39')][_0x9b6e('0x22')]);}return _0x5b6862[_0x9b6e('0x8c')](_0x434966);}})['then'](function(_0x10a43d){if(_0x10a43d){return _0x10a43d?{'count':_0x15a699,'rows':_0x10a43d}:null;}})['then'](respondWithResult(_0x3c39f9,null))[_0x9b6e('0x4c')](handleError(_0x3c39f9,null));};
\ No newline at end of file
+var _0x598e=['include','findAll','catch','params','rawAttributes','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','find','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','User','UserId','agent','faxPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','ids','online','flatMap','sequelize','transaction','addTeams','findOrCreate','emit','userFaxQueue:save','removeTeams','Agents','field','tq.TeamId','from','join','FaxQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','forEach','addAgents','omit','spread','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxQueue.socket','register','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','get','FaxQueues','UserProfileResource','error','stack','send','index','map','FaxQueue','fieldName','type','key','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','includeAll'];(function(_0x217e27,_0x56a927){var _0x3950e6=function(_0x5578e4){while(--_0x5578e4){_0x217e27['push'](_0x217e27['shift']());}};_0x3950e6(++_0x56a927);}(_0x598e,0x1ed));var _0xe598=function(_0x4d2028,_0x268f3a){_0x4d2028=_0x4d2028-0x0;var _0x35094a=_0x598e[_0x4d2028];return _0x35094a;};'use strict';var emlformat=require(_0xe598('0x0'));var rimraf=require(_0xe598('0x1'));var zipdir=require(_0xe598('0x2'));var jsonpatch=require(_0xe598('0x3'));var rp=require(_0xe598('0x4'));var moment=require(_0xe598('0x5'));var BPromise=require(_0xe598('0x6'));var Mustache=require(_0xe598('0x7'));var util=require(_0xe598('0x8'));var path=require(_0xe598('0x9'));var sox=require(_0xe598('0xa'));var csv=require(_0xe598('0xb'));var ejs=require(_0xe598('0xc'));var fs=require('fs');var fs_extra=require(_0xe598('0xd'));var _=require('lodash');var squel=require(_0xe598('0xe'));var crypto=require(_0xe598('0xf'));var jsforce=require(_0xe598('0x10'));var deskjs=require(_0xe598('0x11'));var toCsv=require(_0xe598('0xb'));var querystring=require(_0xe598('0x12'));var Papa=require('papaparse');var Redis=require(_0xe598('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xe598('0x14'));var as=require(_0xe598('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe598('0x16'))(_0xe598('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe598('0x18'));var db=require(_0xe598('0x19'))['db'];config[_0xe598('0x1a')]=_[_0xe598('0x1b')](config[_0xe598('0x1a')],{'host':_0xe598('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe598('0x1a')]));require(_0xe598('0x1d'))[_0xe598('0x1e')](socket);function respondWithStatusCode(_0x142510,_0x527a53){_0x527a53=_0x527a53||0xcc;return function(_0x4f459a){if(_0x4f459a){return _0x142510[_0xe598('0x1f')](_0x527a53);}return _0x142510[_0xe598('0x20')](_0x527a53)['end']();};}function respondWithResult(_0x3eb3a3,_0xafb48a){_0xafb48a=_0xafb48a||0xc8;return function(_0x47df80){if(_0x47df80){return _0x3eb3a3[_0xe598('0x20')](_0xafb48a)['json'](_0x47df80);}};}function respondWithFilteredResult(_0x4f6b89,_0x35c8e7){return function(_0x57b68d){if(_0x57b68d){var _0x2ebf56=typeof _0x35c8e7[_0xe598('0x21')]===_0xe598('0x22')&&typeof _0x35c8e7[_0xe598('0x23')]==='undefined';var _0x166528=_0x57b68d['count'];var _0x46160d=_0x2ebf56?0x0:_0x35c8e7[_0xe598('0x21')];var _0x5752e7=_0x2ebf56?_0x57b68d[_0xe598('0x24')]:_0x35c8e7[_0xe598('0x21')]+_0x35c8e7[_0xe598('0x23')];var _0x4494d6;if(_0x5752e7>=_0x166528){_0x5752e7=_0x166528;_0x4494d6=0xc8;}else{_0x4494d6=0xce;}_0x4f6b89[_0xe598('0x20')](_0x4494d6);return _0x4f6b89['set'](_0xe598('0x25'),_0x46160d+'-'+_0x5752e7+'/'+_0x166528)[_0xe598('0x26')](_0x57b68d);}return null;};}function patchUpdates(_0x21b5f7){return function(_0xc0da33){try{jsonpatch[_0xe598('0x27')](_0xc0da33,_0x21b5f7,!![]);}catch(_0x4b6dd7){return BPromise[_0xe598('0x28')](_0x4b6dd7);}return _0xc0da33[_0xe598('0x29')]();};}function saveUpdates(_0x6f9223,_0x2ea9e9){return function(_0x1f51f3){if(_0x1f51f3){return _0x1f51f3[_0xe598('0x2a')](_0x6f9223)['then'](function(_0xbe53d){return _0xbe53d;});}return null;};}function removeEntity(_0x52b844,_0x211b2e){return function(_0x7f08e3){if(_0x7f08e3){return _0x7f08e3['destroy']()[_0xe598('0x2b')](function(){var _0x3f4845=_0x7f08e3[_0xe598('0x2c')]({'plain':!![]});var _0x221801=_0xe598('0x2d');return db[_0xe598('0x2e')]['destroy']({'where':{'type':_0x221801,'resourceId':_0x3f4845['id']}})['then'](function(){return _0x7f08e3;});})[_0xe598('0x2b')](function(){_0x52b844['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x456965,_0x1d0ba2){return function(_0x286afe){if(!_0x286afe){_0x456965[_0xe598('0x1f')](0x194);}return _0x286afe;};}function handleError(_0x3c93a5,_0x4c21c4){_0x4c21c4=_0x4c21c4||0x1f4;return function(_0x5440f3){logger[_0xe598('0x2f')](_0x5440f3[_0xe598('0x30')]);if(_0x5440f3['name']){delete _0x5440f3['name'];}_0x3c93a5[_0xe598('0x20')](_0x4c21c4)[_0xe598('0x31')](_0x5440f3);};}exports[_0xe598('0x32')]=function(_0x355ee1,_0x5ad4b3){var _0x30beed={},_0x50a280={},_0x59d213={'count':0x0,'rows':[]};var _0x32fd07=_[_0xe598('0x33')](db[_0xe598('0x34')]['rawAttributes'],function(_0x1c5941){return{'name':_0x1c5941[_0xe598('0x35')],'type':_0x1c5941[_0xe598('0x36')][_0xe598('0x37')]};});_0x50a280[_0xe598('0x38')]=_[_0xe598('0x33')](_0x32fd07,_0xe598('0x39'));_0x50a280[_0xe598('0x3a')]=_[_0xe598('0x3b')](_0x355ee1['query']);_0x50a280[_0xe598('0x3c')]=_['intersection'](_0x50a280[_0xe598('0x38')],_0x50a280[_0xe598('0x3a')]);_0x30beed[_0xe598('0x3d')]=_[_0xe598('0x3e')](_0x50a280[_0xe598('0x38')],qs['fields'](_0x355ee1['query'][_0xe598('0x3f')]));_0x30beed['attributes']=_0x30beed[_0xe598('0x3d')][_0xe598('0x40')]?_0x30beed[_0xe598('0x3d')]:_0x50a280[_0xe598('0x38')];if(!_0x355ee1[_0xe598('0x3a')][_0xe598('0x41')](_0xe598('0x42'))){_0x30beed[_0xe598('0x23')]=qs[_0xe598('0x23')](_0x355ee1[_0xe598('0x3a')][_0xe598('0x23')]);_0x30beed['offset']=qs[_0xe598('0x21')](_0x355ee1['query']['offset']);}_0x30beed[_0xe598('0x43')]=qs[_0xe598('0x44')](_0x355ee1['query'][_0xe598('0x44')]);_0x30beed['where']=qs[_0xe598('0x3c')](_[_0xe598('0x45')](_0x355ee1[_0xe598('0x3a')],_0x50a280[_0xe598('0x3c')]),_0x32fd07);if(_0x355ee1['query']['filter']){_0x30beed[_0xe598('0x46')]=_[_0xe598('0x47')](_0x30beed[_0xe598('0x46')],{'$or':_[_0xe598('0x33')](_0x32fd07,function(_0x1080c4){if(_0x1080c4[_0xe598('0x36')]!=='VIRTUAL'){var _0x39ea0b={};_0x39ea0b[_0x1080c4[_0xe598('0x39')]]={'$like':'%'+_0x355ee1[_0xe598('0x3a')][_0xe598('0x48')]+'%'};return _0x39ea0b;}})});}_0x30beed=_[_0xe598('0x47')]({},_0x30beed,_0x355ee1[_0xe598('0x49')]);var _0x150502={'where':_0x30beed['where']};return db[_0xe598('0x34')][_0xe598('0x24')](_0x150502)[_0xe598('0x2b')](function(_0x5e2761){_0x59d213[_0xe598('0x24')]=_0x5e2761;if(_0x355ee1['query'][_0xe598('0x4a')]){_0x30beed[_0xe598('0x4b')]=[{'all':!![]}];}return db[_0xe598('0x34')][_0xe598('0x4c')](_0x30beed);})[_0xe598('0x2b')](function(_0x3eecc1){_0x59d213['rows']=_0x3eecc1;return _0x59d213;})['then'](respondWithFilteredResult(_0x5ad4b3,_0x30beed))[_0xe598('0x4d')](handleError(_0x5ad4b3,null));};exports['show']=function(_0xdda28c,_0x2cbb9a){var _0x5cba4f={'raw':!![],'where':{'id':_0xdda28c[_0xe598('0x4e')]['id']}},_0x22a5f8={};_0x22a5f8['model']=_[_0xe598('0x3b')](db[_0xe598('0x34')][_0xe598('0x4f')]);_0x22a5f8[_0xe598('0x3a')]=_[_0xe598('0x3b')](_0xdda28c[_0xe598('0x3a')]);_0x22a5f8['filters']=_[_0xe598('0x3e')](_0x22a5f8[_0xe598('0x38')],_0x22a5f8[_0xe598('0x3a')]);_0x5cba4f[_0xe598('0x3d')]=_[_0xe598('0x3e')](_0x22a5f8[_0xe598('0x38')],qs[_0xe598('0x3f')](_0xdda28c[_0xe598('0x3a')]['fields']));_0x5cba4f[_0xe598('0x3d')]=_0x5cba4f[_0xe598('0x3d')][_0xe598('0x40')]?_0x5cba4f[_0xe598('0x3d')]:_0x22a5f8[_0xe598('0x38')];if(_0xdda28c['query'][_0xe598('0x4a')]){_0x5cba4f[_0xe598('0x4b')]=[{'all':!![]}];}_0x5cba4f=_['merge']({},_0x5cba4f,_0xdda28c[_0xe598('0x49')]);return db[_0xe598('0x34')]['find'](_0x5cba4f)[_0xe598('0x2b')](handleEntityNotFound(_0x2cbb9a,null))[_0xe598('0x2b')](respondWithResult(_0x2cbb9a,null))[_0xe598('0x4d')](handleError(_0x2cbb9a,null));};exports['create']=function(_0x445824,_0x65af7a){return db[_0xe598('0x34')][_0xe598('0x50')](_0x445824[_0xe598('0x51')],{})[_0xe598('0x2b')](function(_0x576665){var _0x603a02=_0x445824[_0xe598('0x52')][_0xe598('0x2c')]({'plain':!![]});if(!_0x603a02)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x603a02[_0xe598('0x53')]===_0xe598('0x52')){var _0x29d2a5=_0x576665[_0xe598('0x2c')]({'plain':!![]});var _0x5d5586=_0xe598('0x2d');return db[_0xe598('0x54')]['find']({'where':{'name':_0x5d5586,'userProfileId':_0x603a02['userProfileId']},'raw':!![]})[_0xe598('0x2b')](function(_0x5f5b5d){if(_0x5f5b5d&&_0x5f5b5d[_0xe598('0x55')]===0x0){return db[_0xe598('0x2e')][_0xe598('0x50')]({'name':_0x29d2a5['name'],'resourceId':_0x29d2a5['id'],'type':_0x5f5b5d[_0xe598('0x39')],'sectionId':_0x5f5b5d['id']},{})['then'](function(){return _0x576665;});}else{return _0x576665;}})['catch'](function(_0x1b2561){logger[_0xe598('0x2f')](_0xe598('0x56'),_0x1b2561);throw _0x1b2561;});}return _0x576665;})[_0xe598('0x2b')](respondWithResult(_0x65af7a,0xc9))[_0xe598('0x4d')](handleError(_0x65af7a,null));};exports[_0xe598('0x2a')]=function(_0x5678f0,_0x57c0a0){if(_0x5678f0[_0xe598('0x51')]['id']){delete _0x5678f0[_0xe598('0x51')]['id'];}return db['FaxQueue']['find']({'where':{'id':_0x5678f0[_0xe598('0x4e')]['id']}})[_0xe598('0x2b')](handleEntityNotFound(_0x57c0a0,null))[_0xe598('0x2b')](saveUpdates(_0x5678f0[_0xe598('0x51')],null))[_0xe598('0x2b')](respondWithResult(_0x57c0a0,null))[_0xe598('0x4d')](handleError(_0x57c0a0,null));};exports[_0xe598('0x57')]=function(_0x4e6a80,_0x3ff8c4){return db[_0xe598('0x34')][_0xe598('0x58')]({'where':{'id':_0x4e6a80[_0xe598('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3ff8c4,null))[_0xe598('0x2b')](removeEntity(_0x3ff8c4,null))['catch'](handleError(_0x3ff8c4,null));};exports[_0xe598('0x59')]=function(_0x399397,_0x2e8092){return db[_0xe598('0x34')][_0xe598('0x59')]()[_0xe598('0x2b')](respondWithResult(_0x2e8092,null))[_0xe598('0x4d')](handleError(_0x2e8092,null));};exports[_0xe598('0x5a')]=function(_0x24483d,_0x4fd70a,_0x74f08f){var _0x1cb007={'raw':!![],'where':{}},_0x5dc3a4={},_0x4ab08a;return db[_0xe598('0x34')][_0xe598('0x5b')]({'where':{'id':_0x24483d[_0xe598('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4fd70a,null))[_0xe598('0x2b')](function(_0xd4dcfd){if(_0xd4dcfd){_0x4ab08a=_0xd4dcfd['get']({'plain':!![]});_0x5dc3a4[_0xe598('0x38')]=_[_0xe598('0x3b')](db[_0xe598('0x5c')][_0xe598('0x4f')]);_0x5dc3a4['query']=_[_0xe598('0x3b')](_0x24483d['query']);_0x5dc3a4[_0xe598('0x3c')]=_[_0xe598('0x3e')](_0x5dc3a4[_0xe598('0x38')],_0x5dc3a4[_0xe598('0x3a')]);_0x1cb007['attributes']=_[_0xe598('0x3e')](_0x5dc3a4[_0xe598('0x38')],qs[_0xe598('0x3f')](_0x24483d[_0xe598('0x3a')][_0xe598('0x3f')]));_0x1cb007[_0xe598('0x3d')]=_0x1cb007[_0xe598('0x3d')][_0xe598('0x40')]?_0x1cb007['attributes']:_0x5dc3a4[_0xe598('0x38')];if(!_0x24483d[_0xe598('0x3a')]['hasOwnProperty'](_0xe598('0x42'))){_0x1cb007['limit']=qs[_0xe598('0x23')](_0x24483d[_0xe598('0x3a')]['limit']);_0x1cb007['offset']=qs[_0xe598('0x21')](_0x24483d[_0xe598('0x3a')][_0xe598('0x21')]);}_0x1cb007[_0xe598('0x43')]=qs[_0xe598('0x44')](_0x24483d[_0xe598('0x3a')][_0xe598('0x44')]);_0x1cb007['where']=qs[_0xe598('0x3c')](_['pick'](_0x24483d[_0xe598('0x3a')],_0x5dc3a4['filters']));_0x1cb007[_0xe598('0x46')][_0xe598('0x5d')]=_0xd4dcfd['id'];if(_0x24483d[_0xe598('0x3a')][_0xe598('0x48')]){_0x1cb007[_0xe598('0x46')]=_[_0xe598('0x47')](_0x1cb007[_0xe598('0x46')],{'$or':_[_0xe598('0x33')](_0x1cb007['attributes'],function(_0x4689e7){var _0x44ef2c={};_0x44ef2c[_0x4689e7]={'$like':'%'+_0x24483d[_0xe598('0x3a')][_0xe598('0x48')]+'%'};return _0x44ef2c;})});}_0x1cb007=_[_0xe598('0x47')]({},_0x1cb007,_0x24483d['options']);return db[_0xe598('0x5c')][_0xe598('0x4c')](_0x1cb007);}})[_0xe598('0x2b')](function(_0x2f72dd){if(_0x2f72dd){return db[_0xe598('0x5e')]['findAndCountAll']({'where':{'id':_[_0xe598('0x33')](_0x2f72dd,_0xe598('0x5f')),'role':_0xe598('0x60')},'attributes':['id',_0xe598('0x39'),_0xe598('0x61'),_0xe598('0x62'),_0xe598('0x63')]});}})[_0xe598('0x2b')](function(_0x4b4e89){if(_0x4b4e89){return{'count':_0x4b4e89[_0xe598('0x24')],'rows':_[_0xe598('0x33')](_0x4b4e89[_0xe598('0x64')],function(_0x323811){return{'membername':_0x323811[_0xe598('0x39')],'UserId':_0x323811['id'],'queue_name':_0x4ab08a[_0xe598('0x39')],'FaxQueueId':_0x4ab08a['id'],'interface':util[_0xe598('0x65')](_0xe598('0x66'),_0xe598('0x67'),_0x323811['name']),'penalty':0x0,'paused':_0x323811[_0xe598('0x61')],'createdAt':_0x323811['createdAt'],'updatedAt':_0x323811[_0xe598('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe598('0x2b')](respondWithFilteredResult(_0x4fd70a,_0x1cb007))[_0xe598('0x4d')](handleError(_0x4fd70a,null));};exports[_0xe598('0x68')]=function(_0x208d76,_0x122d9e,_0x2dce6f){var _0x31da89={};var _0x5c8bd5={};var _0xad83f4;var _0x6c6159;return db[_0xe598('0x34')][_0xe598('0x5b')]({'where':{'id':_0x208d76['params']['id']}})[_0xe598('0x2b')](handleEntityNotFound(_0x122d9e,null))[_0xe598('0x2b')](function(_0x311adc){if(_0x311adc){_0xad83f4=_0x311adc;_0x5c8bd5['model']=_[_0xe598('0x3b')](db[_0xe598('0x69')][_0xe598('0x4f')]);_0x5c8bd5[_0xe598('0x3a')]=_['keys'](_0x208d76[_0xe598('0x3a')]);_0x5c8bd5[_0xe598('0x3c')]=_[_0xe598('0x3e')](_0x5c8bd5[_0xe598('0x38')],_0x5c8bd5[_0xe598('0x3a')]);_0x31da89['attributes']=_['intersection'](_0x5c8bd5[_0xe598('0x38')],qs[_0xe598('0x3f')](_0x208d76[_0xe598('0x3a')][_0xe598('0x3f')]));_0x31da89[_0xe598('0x3d')]=_0x31da89[_0xe598('0x3d')][_0xe598('0x40')]?_0x31da89['attributes']:_0x5c8bd5[_0xe598('0x38')];_0x31da89[_0xe598('0x43')]=qs[_0xe598('0x44')](_0x208d76[_0xe598('0x3a')][_0xe598('0x44')]);_0x31da89[_0xe598('0x46')]=qs[_0xe598('0x3c')](_[_0xe598('0x45')](_0x208d76[_0xe598('0x3a')],_0x5c8bd5[_0xe598('0x3c')]));if(_0x208d76[_0xe598('0x3a')][_0xe598('0x48')]){_0x31da89[_0xe598('0x46')]=_['merge'](_0x31da89[_0xe598('0x46')],{'$or':_['map'](_0x31da89['attributes'],function(_0x3859b4){var _0x106ea7={};_0x106ea7[_0x3859b4]={'$like':'%'+_0x208d76[_0xe598('0x3a')][_0xe598('0x48')]+'%'};return _0x106ea7;})});}_0x31da89=_[_0xe598('0x47')]({},_0x31da89,_0x208d76[_0xe598('0x49')]);return _0xad83f4[_0xe598('0x68')](_0x31da89);}})[_0xe598('0x2b')](function(_0x3d5df5){if(_0x3d5df5){_0x6c6159=_0x3d5df5[_0xe598('0x40')];if(!_0x208d76['query']['hasOwnProperty'](_0xe598('0x42'))){_0x31da89[_0xe598('0x23')]=qs[_0xe598('0x23')](_0x208d76[_0xe598('0x3a')][_0xe598('0x23')]);_0x31da89['offset']=qs[_0xe598('0x21')](_0x208d76[_0xe598('0x3a')][_0xe598('0x21')]);}return _0xad83f4[_0xe598('0x68')](_0x31da89);}})['then'](function(_0x519c6f){if(_0x519c6f){return _0x519c6f?{'count':_0x6c6159,'rows':_0x519c6f}:null;}})[_0xe598('0x2b')](respondWithResult(_0x122d9e,null))['catch'](handleError(_0x122d9e,null));};exports['addTeams']=function(_0x2e1086,_0x33827f,_0x127c7b){var _0x1e01d0=_0x2e1086[_0xe598('0x51')][_0xe598('0x6a')];return db[_0xe598('0x69')][_0xe598('0x4c')]({'where':{'id':_0x1e01d0},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xe598('0x39'),_0xe598('0x6b'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x2331f4){if(_0x2331f4){var _0x53c529=_[_0xe598('0x6c')](_0x2331f4,function(_0x50c611){var _0xd68f28=_0x50c611[_0xe598('0x2c')]({'plain':!![]});return _0xd68f28['Agents'];});return db['FaxQueue']['find']({'where':{'id':_0x2e1086[_0xe598('0x4e')]['id']}})[_0xe598('0x2b')](function(_0x2bb2f9){return db[_0xe598('0x6d')][_0xe598('0x6e')](function(_0x1c8635){return _0x2bb2f9[_0xe598('0x6f')](_0x1e01d0,{'transaction':_0x1c8635})[_0xe598('0x2b')](function(){return BPromise['each'](_0x53c529,function(_0x1cd0ff){return db[_0xe598('0x5c')][_0xe598('0x70')]({'where':{'UserId':_0x1cd0ff['id'],'FaxQueueId':_0x2e1086[_0xe598('0x4e')]['id']},'transaction':_0x1c8635});});})[_0xe598('0x2b')](function(){_0x53c529['forEach'](function(_0x106fd4){socket[_0xe598('0x71')](_0xe598('0x72'),{'UserId':_0x106fd4['id'],'FaxQueueId':_0x2bb2f9['id']});});});});});}})[_0xe598('0x2b')](respondWithStatusCode(_0x33827f,null))['catch'](handleError(_0x33827f,null));};exports[_0xe598('0x73')]=function(_0x4e4a63,_0x3564c6,_0x434ffc){return db[_0xe598('0x69')][_0xe598('0x4c')]({'where':{'id':_0x4e4a63['query'][_0xe598('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xe598('0x5e')],'as':_0xe598('0x74'),'attributes':['id'],'raw':!![]}]})[_0xe598('0x2b')](handleEntityNotFound(_0x3564c6,null))['then'](function(_0x54dfd4){var _0x4bc71a=_[_0xe598('0x33')](_0x54dfd4,'id');var _0x57fc85=[];var _0x57f727=[];var _0xc37e41=squel['select']();_0xc37e41[_0xe598('0x75')](_0xe598('0x76'))[_0xe598('0x77')]('team_has_fax_queues','tq')[_0xe598('0x78')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xe598('0x79'),_0x4e4a63[_0xe598('0x4e')]['id']);for(var _0x112175=0x0;_0x112175<_0x54dfd4[_0xe598('0x40')];_0x112175+=0x1){let _0x6b609f=_0x54dfd4[_0x112175];for(var _0x3e23a5=0x0;_0x3e23a5<_0x6b609f[_0xe598('0x74')][_0xe598('0x40')];_0x3e23a5+=0x1){let _0x6e0ec4=_0x6b609f[_0xe598('0x74')][_0x3e23a5];var _0x2fc4da=_0xc37e41[_0xe598('0x7a')]();_0x2fc4da[_0xe598('0x46')]('ut.UserId\x20=\x20?',_0x6e0ec4['id']);_0x57f727[_0xe598('0x7b')](db[_0xe598('0x6d')][_0xe598('0x3a')](_0x2fc4da[_0xe598('0x7c')](),{'type':db[_0xe598('0x6d')][_0xe598('0x7d')][_0xe598('0x7e')]})[_0xe598('0x2b')](function(_0x53daa8){if(_0x53daa8[_0xe598('0x40')]===0x1){return _0x6e0ec4['id'];}else{var _0x168b56=_[_0xe598('0x7f')](_['map'](_0x53daa8,_0xe598('0x80')),function(_0x4d4a79){return _['includes'](_0x4bc71a,_0x4d4a79);});if(_0x168b56){return _0x6e0ec4['id'];}}}));}}return BPromise[_0xe598('0x81')](_0x57f727)[_0xe598('0x2b')](function(_0x3bbd83){_0x57fc85=_(_0x57fc85)[_0xe598('0x82')](_0x3bbd83)[_0xe598('0x83')]()[_0xe598('0x84')]();return db[_0xe598('0x34')]['find']({'where':{'id':_0x4e4a63['params']['id']}})[_0xe598('0x2b')](function(_0x36bc1c){return db['sequelize'][_0xe598('0x6e')](function(_0x1490cd){return _0x36bc1c['removeTeams'](_0x4e4a63['query'][_0xe598('0x6a')],{'transaction':_0x1490cd})['then'](function(){if(!_[_0xe598('0x85')](_0x57fc85)){return _0x36bc1c[_0xe598('0x86')](_0x57fc85,{'transaction':_0x1490cd});}})[_0xe598('0x2b')](function(){_0x57fc85[_0xe598('0x87')](function(_0x577570){socket[_0xe598('0x71')]('userFaxQueue:remove',{'UserId':_0x577570,'FaxQueueId':_0x36bc1c['id']});});});});});});})['then'](respondWithStatusCode(_0x3564c6,null))[_0xe598('0x4d')](handleError(_0x3564c6,null));};exports[_0xe598('0x88')]=function(_0xf58118,_0x1ee3bd,_0x4b46b4){return db[_0xe598('0x34')]['find']({'where':{'id':_0xf58118[_0xe598('0x4e')]['id']}})[_0xe598('0x2b')](handleEntityNotFound(_0x1ee3bd,null))[_0xe598('0x2b')](function(_0x505565){if(_0x505565){return _0x505565[_0xe598('0x88')](_0xf58118[_0xe598('0x51')][_0xe598('0x6a')],_[_0xe598('0x89')](_0xf58118[_0xe598('0x51')],[_0xe598('0x6a'),'id'])||{})[_0xe598('0x8a')](function(_0x495390){for(var _0x5c1b94=0x0;_0x5c1b94<_0xf58118['body']['ids']['length'];_0x5c1b94+=0x1){socket[_0xe598('0x71')](_0xe598('0x72'),{'UserId':Number(_0xf58118[_0xe598('0x51')]['ids'][_0x5c1b94]),'FaxQueueId':Number(_0xf58118[_0xe598('0x4e')]['id'])});}return _0x495390;});}})[_0xe598('0x2b')](respondWithResult(_0x1ee3bd,null))[_0xe598('0x4d')](handleError(_0x1ee3bd,null));};exports[_0xe598('0x86')]=function(_0x154eb0,_0xb9b529,_0x472ed2){return db['FaxQueue']['find']({'where':{'id':_0x154eb0[_0xe598('0x4e')]['id']}})[_0xe598('0x2b')](handleEntityNotFound(_0xb9b529,null))['then'](function(_0x583b72){if(_0x583b72){return _0x583b72[_0xe598('0x86')](_0x154eb0[_0xe598('0x3a')]['ids'])[_0xe598('0x2b')](function(){if(_[_0xe598('0x8b')](_0x154eb0[_0xe598('0x3a')][_0xe598('0x6a')])){for(var _0x37e432=0x0;_0x37e432<_0x154eb0[_0xe598('0x3a')][_0xe598('0x6a')][_0xe598('0x40')];_0x37e432+=0x1){socket[_0xe598('0x71')]('userFaxQueue:remove',{'UserId':Number(_0x154eb0[_0xe598('0x3a')][_0xe598('0x6a')][_0x37e432]),'FaxQueueId':Number(_0x154eb0[_0xe598('0x4e')]['id'])});}}else{socket['emit'](_0xe598('0x8c'),{'UserId':Number(_0x154eb0[_0xe598('0x3a')][_0xe598('0x6a')]),'FaxQueueId':Number(_0x154eb0[_0xe598('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0xb9b529,null))[_0xe598('0x4d')](handleError(_0xb9b529,null));};exports[_0xe598('0x8d')]=function(_0xb75ce2,_0x4727c6,_0x492a3a){var _0x1e1e61={};var _0x1c3159={};var _0x498a4f;var _0xaebfb6;return db[_0xe598('0x34')][_0xe598('0x5b')]({'where':{'id':_0xb75ce2['params']['id']}})[_0xe598('0x2b')](handleEntityNotFound(_0x4727c6,null))[_0xe598('0x2b')](function(_0x3d93d7){if(_0x3d93d7){_0x498a4f=_0x3d93d7;_0x1c3159['model']=_[_0xe598('0x3b')](db[_0xe598('0x5e')][_0xe598('0x4f')]);_0x1c3159[_0xe598('0x3a')]=_[_0xe598('0x3b')](_0xb75ce2[_0xe598('0x3a')]);_0x1c3159[_0xe598('0x3c')]=_['intersection'](_0x1c3159[_0xe598('0x38')],_0x1c3159['query']);_0x1e1e61[_0xe598('0x3d')]=_[_0xe598('0x3e')](_0x1c3159[_0xe598('0x38')],qs['fields'](_0xb75ce2['query'][_0xe598('0x3f')]));_0x1e1e61[_0xe598('0x3d')]=_0x1e1e61[_0xe598('0x3d')][_0xe598('0x40')]?_0x1e1e61[_0xe598('0x3d')]:_0x1c3159[_0xe598('0x38')];_0x1e1e61[_0xe598('0x43')]=qs[_0xe598('0x44')](_0xb75ce2['query']['sort']);_0x1e1e61[_0xe598('0x46')]=qs[_0xe598('0x3c')](_[_0xe598('0x45')](_0xb75ce2[_0xe598('0x3a')],_0x1c3159[_0xe598('0x3c')]));if(_0xb75ce2[_0xe598('0x3a')][_0xe598('0x48')]){_0x1e1e61['where']=_['merge'](_0x1e1e61[_0xe598('0x46')],{'$or':_[_0xe598('0x33')](_0x1e1e61[_0xe598('0x3d')],function(_0x34fbd){var _0x2fdee0={};_0x2fdee0[_0x34fbd]={'$like':'%'+_0xb75ce2[_0xe598('0x3a')][_0xe598('0x48')]+'%'};return _0x2fdee0;})});}_0x1e1e61=_[_0xe598('0x47')]({},_0x1e1e61,_0xb75ce2[_0xe598('0x49')]);return _0x498a4f[_0xe598('0x8d')](_0x1e1e61);}})[_0xe598('0x2b')](function(_0x11bfaf){if(_0x11bfaf){_0xaebfb6=_0x11bfaf[_0xe598('0x40')];if(!_0xb75ce2[_0xe598('0x3a')][_0xe598('0x41')]('nolimit')){_0x1e1e61[_0xe598('0x23')]=qs[_0xe598('0x23')](_0xb75ce2[_0xe598('0x3a')]['limit']);_0x1e1e61[_0xe598('0x21')]=qs[_0xe598('0x21')](_0xb75ce2['query'][_0xe598('0x21')]);}return _0x498a4f[_0xe598('0x8d')](_0x1e1e61);}})[_0xe598('0x2b')](function(_0x4b2e60){if(_0x4b2e60){return _0x4b2e60?{'count':_0xaebfb6,'rows':_0x4b2e60}:null;}})[_0xe598('0x2b')](respondWithResult(_0x4727c6,null))[_0xe598('0x4d')](handleError(_0x4727c6,null));};
\ No newline at end of file
index 6903461..fd21107 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8431=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x1ae661,_0x3a7e42){var _0x11edfb=function(_0xe8870f){while(--_0xe8870f){_0x1ae661['push'](_0x1ae661['shift']());}};_0x11edfb(++_0x3a7e42);}(_0x8431,0x1dc));var _0x1843=function(_0x4cac0e,_0x4d314c){_0x4cac0e=_0x4cac0e-0x0;var _0xb731e9=_0x8431[_0x4cac0e];return _0xb731e9;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x1843('0x0'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x1843('0x1')](0x0);var events={'afterCreate':_0x1843('0x2'),'afterUpdate':_0x1843('0x3'),'afterDestroy':_0x1843('0x4')};function emitEvent(_0x5947d7){return function(_0x120762,_0x2a2de3,_0x10e334){FaxQueueEvents[_0x1843('0x5')](_0x5947d7+':'+_0x120762['id'],_0x120762);FaxQueueEvents[_0x1843('0x5')](_0x5947d7,_0x120762);_0x10e334(null);};}for(var e in events){if(events[_0x1843('0x6')](e)){var event=events[e];FaxQueue[_0x1843('0x7')](e,emitEvent(event));}}module[_0x1843('0x8')]=FaxQueueEvents;
\ No newline at end of file
+var _0x410d=['hook','../../mysqldb','FaxQueue','setMaxListeners','hasOwnProperty'];(function(_0x1045f5,_0x22efb4){var _0x1ef38b=function(_0x393c59){while(--_0x393c59){_0x1045f5['push'](_0x1045f5['shift']());}};_0x1ef38b(++_0x22efb4);}(_0x410d,0x9c));var _0xd410=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0x410d[_0x3430aa];return _0x2ac5c;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xd410('0x0'))['db'][_0xd410('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xd410('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4557b6){return function(_0x187dd5,_0x397186,_0x996b70){FaxQueueEvents['emit'](_0x4557b6+':'+_0x187dd5['id'],_0x187dd5);FaxQueueEvents['emit'](_0x4557b6,_0x187dd5);_0x996b70(null);};}for(var e in events){if(events[_0xd410('0x3')](e)){var event=events[e];FaxQueue[_0xd410('0x4')](e,emitEvent(event));}}module['exports']=FaxQueueEvents;
\ No newline at end of file
index d638a13..33a252a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4aee=['rimraf','define','FaxQueue','fax_queues','lodash','util','../../config/logger','bluebird','path'];(function(_0x33acdd,_0x253813){var _0x578b80=function(_0x5dfc69){while(--_0x5dfc69){_0x33acdd['push'](_0x33acdd['shift']());}};_0x578b80(++_0x253813);}(_0x4aee,0x16c));var _0xe4ae=function(_0x15c0e7,_0x54ddae){_0x15c0e7=_0x15c0e7-0x0;var _0x50d3f5=_0x4aee[_0x15c0e7];return _0x50d3f5;};'use strict';var _=require(_0xe4ae('0x0'));var util=require(_0xe4ae('0x1'));var logger=require(_0xe4ae('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe4ae('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe4ae('0x4'));var rimraf=require(_0xe4ae('0x5'));var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module['exports']=function(_0x127637,_0x4a774c){return _0x127637[_0xe4ae('0x6')](_0xe4ae('0x7'),attributes,{'tableName':_0xe4ae('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7ea1=['fax_queues','lodash','util','api','moment','bluebird','request-promise','path','exports','define','FaxQueue'];(function(_0x3a78a0,_0x44985f){var _0x48e917=function(_0x1e428c){while(--_0x1e428c){_0x3a78a0['push'](_0x3a78a0['shift']());}};_0x48e917(++_0x44985f);}(_0x7ea1,0xe8));var _0x17ea=function(_0x4f3b2d,_0x3bbf46){_0x4f3b2d=_0x4f3b2d-0x0;var _0x3dddfa=_0x7ea1[_0x4f3b2d];return _0x3dddfa;};'use strict';var _=require(_0x17ea('0x0'));var util=require(_0x17ea('0x1'));var logger=require('../../config/logger')(_0x17ea('0x2'));var moment=require(_0x17ea('0x3'));var BPromise=require(_0x17ea('0x4'));var rp=require(_0x17ea('0x5'));var fs=require('fs');var path=require(_0x17ea('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module[_0x17ea('0x7')]=function(_0x49adb0,_0x489118){return _0x49adb0[_0x17ea('0x8')](_0x17ea('0x9'),attributes,{'tableName':_0x17ea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 69cbda2..d150e0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9902=['stringify','error','code','message','info','result','catch','findAll','options','raw','attributes','limit','include','map','model','GetFaxQueue','ShowFaxQueue','FaxQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s'];(function(_0x5a9a22,_0x40eb94){var _0x4e2ef8=function(_0xa7f70c){while(--_0xa7f70c){_0x5a9a22['push'](_0x5a9a22['shift']());}};_0x4e2ef8(++_0x40eb94);}(_0x9902,0x169));var _0x2990=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9902[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var util=require(_0x2990('0x0'));var moment=require(_0x2990('0x1'));var BPromise=require(_0x2990('0x2'));var rs=require(_0x2990('0x3'));var fs=require('fs');var Redis=require(_0x2990('0x4'));var db=require(_0x2990('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2990('0x6'))(_0x2990('0x7'));var config=require(_0x2990('0x8'));var jayson=require(_0x2990('0x9'));var client=jayson[_0x2990('0xa')]['http']({'port':0x232a});config[_0x2990('0xb')]=_[_0x2990('0xc')](config[_0x2990('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x2990('0xd'))(new Redis(config[_0x2990('0xb')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x1d1b7f,_0x3310ea,_0x1318a2){return new BPromise(function(_0x384bc6,_0x596055){return client['request'](_0x1d1b7f,_0x1318a2)[_0x2990('0xe')](function(_0x3a0757){logger['info'](_0x2990('0xf'),_0x3310ea,_0x2990('0x10'));logger[_0x2990('0x11')](_0x2990('0x12'),_0x3310ea,_0x2990('0x10'),JSON[_0x2990('0x13')](_0x3a0757));if(_0x3a0757[_0x2990('0x14')]){if(_0x3a0757['error'][_0x2990('0x15')]===0x1f4){logger[_0x2990('0x14')](_0x2990('0xf'),_0x3310ea,_0x3a0757[_0x2990('0x14')][_0x2990('0x16')]);return _0x596055(_0x3a0757[_0x2990('0x14')]['message']);}logger[_0x2990('0x14')](_0x2990('0xf'),_0x3310ea,_0x3a0757[_0x2990('0x14')][_0x2990('0x16')]);return _0x384bc6(_0x3a0757['error']['message']);}else{logger[_0x2990('0x17')](_0x2990('0xf'),_0x3310ea,_0x2990('0x10'));_0x384bc6(_0x3a0757[_0x2990('0x18')][_0x2990('0x16')]);}})[_0x2990('0x19')](function(_0x408f0a){logger[_0x2990('0x14')](_0x2990('0xf'),_0x3310ea,_0x408f0a);_0x596055(_0x408f0a);});});}exports['GetFaxQueue']=function(_0xd75164){var _0x49cb69=this;return new Promise(function(_0x23e9ef,_0x36f67c){return db['FaxQueue'][_0x2990('0x1a')]({'raw':_0xd75164['options']?_0xd75164[_0x2990('0x1b')][_0x2990('0x1c')]===undefined?!![]:![]:!![],'where':_0xd75164[_0x2990('0x1b')]?_0xd75164[_0x2990('0x1b')]['where']||null:null,'attributes':_0xd75164['options']?_0xd75164[_0x2990('0x1b')][_0x2990('0x1d')]||null:null,'limit':_0xd75164[_0x2990('0x1b')]?_0xd75164['options'][_0x2990('0x1e')]||null:null,'include':_0xd75164[_0x2990('0x1b')]?_0xd75164[_0x2990('0x1b')][_0x2990('0x1f')]?_[_0x2990('0x20')](_0xd75164[_0x2990('0x1b')]['include'],function(_0x30bc96){return{'model':db[_0x30bc96[_0x2990('0x21')]],'as':_0x30bc96['as'],'attributes':_0x30bc96[_0x2990('0x1d')],'include':_0x30bc96[_0x2990('0x1f')]?_[_0x2990('0x20')](_0x30bc96[_0x2990('0x1f')],function(_0x59725b){return{'model':db[_0x59725b[_0x2990('0x21')]],'as':_0x59725b['as'],'attributes':_0x59725b[_0x2990('0x1d')],'include':_0x59725b['include']?_[_0x2990('0x20')](_0x59725b[_0x2990('0x1f')],function(_0x2dac06){return{'model':db[_0x2dac06[_0x2990('0x21')]],'as':_0x2dac06['as'],'attributes':_0x2dac06[_0x2990('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2990('0xe')](function(_0x3b7cf0){logger[_0x2990('0x17')](_0x2990('0x22'),_0xd75164);logger[_0x2990('0x11')](_0x2990('0x22'),_0xd75164,JSON[_0x2990('0x13')](_0x3b7cf0));_0x23e9ef(_0x3b7cf0);})[_0x2990('0x19')](function(_0x42939e){logger[_0x2990('0x14')]('GetFaxQueue',_0x42939e['message'],_0xd75164);_0x36f67c(_0x49cb69[_0x2990('0x14')](0x1f4,_0x42939e['message']));});});};exports[_0x2990('0x23')]=function(_0x5e983d){var _0x4bab3a=this;return new Promise(function(_0xc18bf4,_0x352f3c){return db[_0x2990('0x24')][_0x2990('0x25')]({'raw':_0x5e983d[_0x2990('0x1b')]?_0x5e983d[_0x2990('0x1b')][_0x2990('0x1c')]===undefined?!![]:![]:!![],'where':_0x5e983d[_0x2990('0x1b')]?_0x5e983d[_0x2990('0x1b')]['where']||null:null,'attributes':_0x5e983d[_0x2990('0x1b')]?_0x5e983d['options'][_0x2990('0x1d')]||null:null,'include':_0x5e983d[_0x2990('0x1b')]?_0x5e983d['options'][_0x2990('0x1f')]?_[_0x2990('0x20')](_0x5e983d[_0x2990('0x1b')][_0x2990('0x1f')],function(_0x37bbac){return{'model':db[_0x37bbac['model']],'as':_0x37bbac['as'],'attributes':_0x37bbac['attributes'],'include':_0x37bbac[_0x2990('0x1f')]?_[_0x2990('0x20')](_0x37bbac[_0x2990('0x1f')],function(_0x5ba317){return{'model':db[_0x5ba317[_0x2990('0x21')]],'as':_0x5ba317['as'],'attributes':_0x5ba317['attributes'],'include':_0x5ba317[_0x2990('0x1f')]?_['map'](_0x5ba317[_0x2990('0x1f')],function(_0x52e05d){return{'model':db[_0x52e05d['model']],'as':_0x52e05d['as'],'attributes':_0x52e05d['attributes']};}):[]};}):[]};}):[]:[]})[_0x2990('0xe')](function(_0x479086){logger[_0x2990('0x17')](_0x2990('0x23'),_0x5e983d);logger['debug']('ShowFaxQueue',_0x5e983d,JSON[_0x2990('0x13')](_0x479086));_0xc18bf4(_0x479086);})[_0x2990('0x19')](function(_0x3a0b3d){logger[_0x2990('0x14')](_0x2990('0x23'),_0x3a0b3d[_0x2990('0x16')],_0x5e983d);_0x352f3c(_0x4bab3a[_0x2990('0x14')](0x1f4,_0x3a0b3d[_0x2990('0x16')]));});});};
\ No newline at end of file
+var _0x9aca=['raw','where','attributes','include','model','map','debug','FaxQueue','find','ShowFaxQueue','lodash','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','findAll','options'];(function(_0x21415a,_0x1c43dc){var _0x11ef76=function(_0xb46d8b){while(--_0xb46d8b){_0x21415a['push'](_0x21415a['shift']());}};_0x11ef76(++_0x1c43dc);}(_0x9aca,0xa6));var _0xa9ac=function(_0x366653,_0x223943){_0x366653=_0x366653-0x0;var _0x5d713c=_0x9aca[_0x366653];return _0x5d713c;};'use strict';var _=require(_0xa9ac('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa9ac('0x1'));var db=require(_0xa9ac('0x2'))['db'];var utils=require(_0xa9ac('0x3'));var logger=require('../../config/logger')(_0xa9ac('0x4'));var config=require('../../config/environment');var jayson=require(_0xa9ac('0x5'));var client=jayson[_0xa9ac('0x6')][_0xa9ac('0x7')]({'port':0x232a});config['redis']=_[_0xa9ac('0x8')](config[_0xa9ac('0x9')],{'host':_0xa9ac('0xa'),'port':0x18eb});var socket=require(_0xa9ac('0xb'))(new Redis(config[_0xa9ac('0x9')]));require(_0xa9ac('0xc'))[_0xa9ac('0xd')](socket);function respondWithRpcPromise(_0x22cdb7,_0x29b83c,_0x55158f){return new BPromise(function(_0x11d69b,_0x512d34){return client[_0xa9ac('0xe')](_0x22cdb7,_0x55158f)[_0xa9ac('0xf')](function(_0x5df237){logger[_0xa9ac('0x10')](_0xa9ac('0x11'),_0x29b83c,_0xa9ac('0x12'));logger['debug'](_0xa9ac('0x13'),_0x29b83c,_0xa9ac('0x12'),JSON[_0xa9ac('0x14')](_0x5df237));if(_0x5df237[_0xa9ac('0x15')]){if(_0x5df237[_0xa9ac('0x15')][_0xa9ac('0x16')]===0x1f4){logger['error'](_0xa9ac('0x11'),_0x29b83c,_0x5df237[_0xa9ac('0x15')][_0xa9ac('0x17')]);return _0x512d34(_0x5df237[_0xa9ac('0x15')][_0xa9ac('0x17')]);}logger[_0xa9ac('0x15')](_0xa9ac('0x11'),_0x29b83c,_0x5df237['error']['message']);return _0x11d69b(_0x5df237['error']['message']);}else{logger['info'](_0xa9ac('0x11'),_0x29b83c,'request\x20sent');_0x11d69b(_0x5df237[_0xa9ac('0x18')][_0xa9ac('0x17')]);}})[_0xa9ac('0x19')](function(_0x3e46ef){logger[_0xa9ac('0x15')](_0xa9ac('0x11'),_0x29b83c,_0x3e46ef);_0x512d34(_0x3e46ef);});});}exports[_0xa9ac('0x1a')]=function(_0x2a4354){var _0x75caac=this;return new Promise(function(_0x406b2f,_0x558a13){return db['FaxQueue'][_0xa9ac('0x1b')]({'raw':_0x2a4354[_0xa9ac('0x1c')]?_0x2a4354['options'][_0xa9ac('0x1d')]===undefined?!![]:![]:!![],'where':_0x2a4354[_0xa9ac('0x1c')]?_0x2a4354['options'][_0xa9ac('0x1e')]||null:null,'attributes':_0x2a4354[_0xa9ac('0x1c')]?_0x2a4354[_0xa9ac('0x1c')][_0xa9ac('0x1f')]||null:null,'limit':_0x2a4354[_0xa9ac('0x1c')]?_0x2a4354[_0xa9ac('0x1c')]['limit']||null:null,'include':_0x2a4354[_0xa9ac('0x1c')]?_0x2a4354[_0xa9ac('0x1c')][_0xa9ac('0x20')]?_['map'](_0x2a4354[_0xa9ac('0x1c')][_0xa9ac('0x20')],function(_0x295e21){return{'model':db[_0x295e21[_0xa9ac('0x21')]],'as':_0x295e21['as'],'attributes':_0x295e21[_0xa9ac('0x1f')],'include':_0x295e21[_0xa9ac('0x20')]?_[_0xa9ac('0x22')](_0x295e21[_0xa9ac('0x20')],function(_0x546f79){return{'model':db[_0x546f79[_0xa9ac('0x21')]],'as':_0x546f79['as'],'attributes':_0x546f79[_0xa9ac('0x1f')],'include':_0x546f79[_0xa9ac('0x20')]?_[_0xa9ac('0x22')](_0x546f79[_0xa9ac('0x20')],function(_0x44a0c1){return{'model':db[_0x44a0c1[_0xa9ac('0x21')]],'as':_0x44a0c1['as'],'attributes':_0x44a0c1[_0xa9ac('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf531c7){logger[_0xa9ac('0x10')](_0xa9ac('0x1a'),_0x2a4354);logger[_0xa9ac('0x23')](_0xa9ac('0x1a'),_0x2a4354,JSON[_0xa9ac('0x14')](_0xf531c7));_0x406b2f(_0xf531c7);})['catch'](function(_0x2aa4be){logger[_0xa9ac('0x15')](_0xa9ac('0x1a'),_0x2aa4be[_0xa9ac('0x17')],_0x2a4354);_0x558a13(_0x75caac[_0xa9ac('0x15')](0x1f4,_0x2aa4be[_0xa9ac('0x17')]));});});};exports['ShowFaxQueue']=function(_0x505c4b){var _0x1ab1a0=this;return new Promise(function(_0x3fc256,_0x1cb14e){return db[_0xa9ac('0x24')][_0xa9ac('0x25')]({'raw':_0x505c4b[_0xa9ac('0x1c')]?_0x505c4b[_0xa9ac('0x1c')][_0xa9ac('0x1d')]===undefined?!![]:![]:!![],'where':_0x505c4b[_0xa9ac('0x1c')]?_0x505c4b[_0xa9ac('0x1c')]['where']||null:null,'attributes':_0x505c4b[_0xa9ac('0x1c')]?_0x505c4b[_0xa9ac('0x1c')]['attributes']||null:null,'include':_0x505c4b[_0xa9ac('0x1c')]?_0x505c4b['options'][_0xa9ac('0x20')]?_[_0xa9ac('0x22')](_0x505c4b[_0xa9ac('0x1c')]['include'],function(_0x472293){return{'model':db[_0x472293['model']],'as':_0x472293['as'],'attributes':_0x472293[_0xa9ac('0x1f')],'include':_0x472293[_0xa9ac('0x20')]?_['map'](_0x472293['include'],function(_0x34b476){return{'model':db[_0x34b476[_0xa9ac('0x21')]],'as':_0x34b476['as'],'attributes':_0x34b476['attributes'],'include':_0x34b476[_0xa9ac('0x20')]?_[_0xa9ac('0x22')](_0x34b476[_0xa9ac('0x20')],function(_0x2c5919){return{'model':db[_0x2c5919['model']],'as':_0x2c5919['as'],'attributes':_0x2c5919[_0xa9ac('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa9ac('0xf')](function(_0x3d414c){logger[_0xa9ac('0x10')](_0xa9ac('0x26'),_0x505c4b);logger[_0xa9ac('0x23')]('ShowFaxQueue',_0x505c4b,JSON['stringify'](_0x3d414c));_0x3fc256(_0x3d414c);})['catch'](function(_0x7ead30){logger[_0xa9ac('0x15')](_0xa9ac('0x26'),_0x7ead30[_0xa9ac('0x17')],_0x505c4b);_0x1cb14e(_0x1ab1a0[_0xa9ac('0x15')](0x1f4,_0x7ead30[_0xa9ac('0x17')]));});});};
\ No newline at end of file
index 8bae703..7c84d50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9829=['remove','update','emit','removeListener','register','length','faxQueue:','./faxQueue.events','save'];(function(_0x14bfbf,_0x552595){var _0x3a29d4=function(_0x1fae62){while(--_0x1fae62){_0x14bfbf['push'](_0x14bfbf['shift']());}};_0x3a29d4(++_0x552595);}(_0x9829,0xc4));var _0x9982=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9829[_0x17b6e3];return _0x3906f3;};'use strict';var FaxQueueEvents=require(_0x9982('0x0'));var events=[_0x9982('0x1'),_0x9982('0x2'),_0x9982('0x3')];function createListener(_0x338564,_0x4c01a9){return function(_0x399b6c){_0x4c01a9[_0x9982('0x4')](_0x338564,_0x399b6c);};}function removeListener(_0x2f782a,_0x4bee19){return function(){FaxQueueEvents[_0x9982('0x5')](_0x2f782a,_0x4bee19);};}exports[_0x9982('0x6')]=function(_0x58f8fe){for(var _0x500dfd=0x0,_0x340d62=events[_0x9982('0x7')];_0x500dfd<_0x340d62;_0x500dfd++){var _0x5d0824=events[_0x500dfd];var _0x25f30a=createListener(_0x9982('0x8')+_0x5d0824,_0x58f8fe);FaxQueueEvents['on'](_0x5d0824,_0x25f30a);}};
\ No newline at end of file
+var _0x5d55=['save','update','emit','removeListener','register','length','faxQueue:'];(function(_0x54bd9f,_0x401521){var _0x14de48=function(_0x456d4c){while(--_0x456d4c){_0x54bd9f['push'](_0x54bd9f['shift']());}};_0x14de48(++_0x401521);}(_0x5d55,0x1a4));var _0x55d5=function(_0x45a3ba,_0x3454ef){_0x45a3ba=_0x45a3ba-0x0;var _0x21ec90=_0x5d55[_0x45a3ba];return _0x21ec90;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x55d5('0x0'),'remove',_0x55d5('0x1')];function createListener(_0x441dc5,_0x47de4d){return function(_0x46c617){_0x47de4d[_0x55d5('0x2')](_0x441dc5,_0x46c617);};}function removeListener(_0x3bca0b,_0x546e6c){return function(){FaxQueueEvents[_0x55d5('0x3')](_0x3bca0b,_0x546e6c);};}exports[_0x55d5('0x4')]=function(_0x33e5c5){for(var _0x35fe43=0x0,_0x16d364=events[_0x55d5('0x5')];_0x35fe43<_0x16d364;_0x35fe43++){var _0x454144=events[_0x35fe43];var _0x3937d3=createListener(_0x55d5('0x6')+_0x454144,_0x33e5c5);FaxQueueEvents['on'](_0x454144,_0x3937d3);}};
\ No newline at end of file
index 0bbb610..f99cc08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc359=['isAuthenticated','describe','/:id','show','/:id/members','/:id/users','post','create','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeTeams','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get'];(function(_0x2d9a60,_0x1b5bc1){var _0x8f442=function(_0x33a072){while(--_0x33a072){_0x2d9a60['push'](_0x2d9a60['shift']());}};_0x8f442(++_0x1b5bc1);}(_0xc359,0x1d9));var _0x9c35=function(_0x1d606d,_0x376e51){_0x1d606d=_0x1d606d-0x0;var _0x3c38bd=_0xc359[_0x1d606d];return _0x3c38bd;};'use strict';var multer=require('multer');var util=require(_0x9c35('0x0'));var path=require('path');var timeout=require(_0x9c35('0x1'));var express=require(_0x9c35('0x2'));var router=express[_0x9c35('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9c35('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9c35('0x5'));var controller=require('./faxQueue.controller');router[_0x9c35('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x9c35('0x7')](),controller[_0x9c35('0x8')]);router[_0x9c35('0x6')](_0x9c35('0x9'),auth[_0x9c35('0x7')](),controller[_0x9c35('0xa')]);router['get'](_0x9c35('0xb'),auth[_0x9c35('0x7')](),controller['getMembers']);router['get']('/:id/teams',auth[_0x9c35('0x7')](),controller['getTeams']);router[_0x9c35('0x6')](_0x9c35('0xc'),auth[_0x9c35('0x7')](),controller['getAgents']);router[_0x9c35('0xd')]('/',auth[_0x9c35('0x7')](),controller[_0x9c35('0xe')]);router[_0x9c35('0xd')](_0x9c35('0xf'),auth['isAuthenticated'](),controller[_0x9c35('0x10')]);router[_0x9c35('0xd')](_0x9c35('0xc'),auth[_0x9c35('0x7')](),controller[_0x9c35('0x11')]);router[_0x9c35('0x12')](_0x9c35('0x9'),auth[_0x9c35('0x7')](),controller[_0x9c35('0x13')]);router[_0x9c35('0x14')](_0x9c35('0x9'),auth[_0x9c35('0x7')](),controller[_0x9c35('0x15')]);router[_0x9c35('0x14')](_0x9c35('0xf'),auth['isAuthenticated'](),controller[_0x9c35('0x16')]);router[_0x9c35('0x14')](_0x9c35('0xc'),auth[_0x9c35('0x7')](),controller['removeAgents']);module[_0x9c35('0x17')]=router;
\ No newline at end of file
+var _0x5d0a=['fs-extra','../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','create','post','/:id/users','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','multer','path','express','Router'];(function(_0x57b02d,_0x521a1f){var _0xf84f45=function(_0x22a123){while(--_0x22a123){_0x57b02d['push'](_0x57b02d['shift']());}};_0xf84f45(++_0x521a1f);}(_0x5d0a,0x175));var _0xa5d0=function(_0xb620fe,_0x2dce9c){_0xb620fe=_0xb620fe-0x0;var _0x38e243=_0x5d0a[_0xb620fe];return _0x38e243;};'use strict';var multer=require(_0xa5d0('0x0'));var util=require('util');var path=require(_0xa5d0('0x1'));var timeout=require('connect-timeout');var express=require(_0xa5d0('0x2'));var router=express[_0xa5d0('0x3')]();var fs_extra=require(_0xa5d0('0x4'));var auth=require(_0xa5d0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa5d0('0x6'));var controller=require(_0xa5d0('0x7'));router[_0xa5d0('0x8')]('/',auth[_0xa5d0('0x9')](),controller[_0xa5d0('0xa')]);router[_0xa5d0('0x8')](_0xa5d0('0xb'),auth[_0xa5d0('0x9')](),controller[_0xa5d0('0xc')]);router[_0xa5d0('0x8')](_0xa5d0('0xd'),auth['isAuthenticated'](),controller[_0xa5d0('0xe')]);router[_0xa5d0('0x8')](_0xa5d0('0xf'),auth[_0xa5d0('0x9')](),controller[_0xa5d0('0x10')]);router[_0xa5d0('0x8')](_0xa5d0('0x11'),auth[_0xa5d0('0x9')](),controller[_0xa5d0('0x12')]);router[_0xa5d0('0x8')]('/:id/users',auth[_0xa5d0('0x9')](),controller['getAgents']);router['post']('/',auth[_0xa5d0('0x9')](),controller[_0xa5d0('0x13')]);router[_0xa5d0('0x14')](_0xa5d0('0x11'),auth['isAuthenticated'](),controller['addTeams']);router[_0xa5d0('0x14')](_0xa5d0('0x15'),auth[_0xa5d0('0x9')](),controller[_0xa5d0('0x16')]);router[_0xa5d0('0x17')](_0xa5d0('0xd'),auth[_0xa5d0('0x9')](),controller['update']);router[_0xa5d0('0x18')]('/:id',auth[_0xa5d0('0x9')](),controller[_0xa5d0('0x19')]);router['delete']('/:id/teams',auth[_0xa5d0('0x9')](),controller[_0xa5d0('0x1a')]);router['delete'](_0xa5d0('0x15'),auth[_0xa5d0('0x9')](),controller[_0xa5d0('0x1b')]);module[_0xa5d0('0x1c')]=router;
\ No newline at end of file
index 9010635..aa37928 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53f6=['STRING','DATE','moment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x53f6,0xb2));var _0x653f=function(_0x2b81be,_0x544bdf){_0x2b81be=_0x2b81be-0x0;var _0x8ed4a7=_0x53f6[_0x2b81be];return _0x8ed4a7;};'use strict';var moment=require(_0x653f('0x0'));var Sequelize=require('sequelize');module[_0x653f('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x653f('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x653f('0x3')]},'acceptAt':{'type':Sequelize[_0x653f('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x653f('0x2')]}};
\ No newline at end of file
+var _0x5734=['exports','STRING','DATE','moment','sequelize'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5734,0xb2));var _0x4573=function(_0x13c1ec,_0x31fe45){_0x13c1ec=_0x13c1ec-0x0;var _0x3df630=_0x5734[_0x13c1ec];return _0x3df630;};'use strict';var moment=require(_0x4573('0x0'));var Sequelize=require(_0x4573('0x1'));module[_0x4573('0x2')]={'uniqueid':{'type':Sequelize[_0x4573('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x4573('0x4')]},'leaveAt':{'type':Sequelize[_0x4573('0x4')]},'acceptAt':{'type':Sequelize[_0x4573('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 067fdc3..8a0dad2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b02=['body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','error','name','map','FaxQueueReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','length','include','find','create'];(function(_0x2b7084,_0x29c2e0){var _0x2dbc3d=function(_0x46e86d){while(--_0x46e86d){_0x2b7084['push'](_0x2b7084['shift']());}};_0x2dbc3d(++_0x29c2e0);}(_0x5b02,0xe9));var _0x25b0=function(_0x5d27b8,_0x59681b){_0x5d27b8=_0x5d27b8-0x0;var _0x4c1944=_0x5b02[_0x5d27b8];return _0x4c1944;};'use strict';var emlformat=require(_0x25b0('0x0'));var rimraf=require(_0x25b0('0x1'));var zipdir=require(_0x25b0('0x2'));var jsonpatch=require(_0x25b0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x25b0('0x4'));var Mustache=require('mustache');var util=require(_0x25b0('0x5'));var path=require(_0x25b0('0x6'));var sox=require(_0x25b0('0x7'));var csv=require(_0x25b0('0x8'));var ejs=require(_0x25b0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x25b0('0xa'));var squel=require(_0x25b0('0xb'));var crypto=require('crypto');var jsforce=require(_0x25b0('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x25b0('0xd'));var Papa=require(_0x25b0('0xe'));var Redis=require(_0x25b0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x25b0('0x10'));var as=require(_0x25b0('0x11'));var hardwareService=require(_0x25b0('0x12'));var logger=require(_0x25b0('0x13'))(_0x25b0('0x14'));var utils=require(_0x25b0('0x15'));var config=require(_0x25b0('0x16'));var licenseUtil=require(_0x25b0('0x17'));var db=require(_0x25b0('0x18'))['db'];function respondWithStatusCode(_0x1d3178,_0x184452){_0x184452=_0x184452||0xcc;return function(_0x26a34f){if(_0x26a34f){return _0x1d3178[_0x25b0('0x19')](_0x184452);}return _0x1d3178[_0x25b0('0x1a')](_0x184452)[_0x25b0('0x1b')]();};}function respondWithResult(_0x42cc07,_0x293203){_0x293203=_0x293203||0xc8;return function(_0x211658){if(_0x211658){return _0x42cc07[_0x25b0('0x1a')](_0x293203)[_0x25b0('0x1c')](_0x211658);}};}function respondWithFilteredResult(_0x40071c,_0x5ac18d){return function(_0x51542b){if(_0x51542b){var _0xfe1ea6=typeof _0x5ac18d['offset']===_0x25b0('0x1d')&&typeof _0x5ac18d[_0x25b0('0x1e')]===_0x25b0('0x1d');var _0x3267b9=_0x51542b['count'];var _0x1d850f=_0xfe1ea6?0x0:_0x5ac18d[_0x25b0('0x1f')];var _0x20762e=_0xfe1ea6?_0x51542b[_0x25b0('0x20')]:_0x5ac18d[_0x25b0('0x1f')]+_0x5ac18d[_0x25b0('0x1e')];var _0x54f458;if(_0x20762e>=_0x3267b9){_0x20762e=_0x3267b9;_0x54f458=0xc8;}else{_0x54f458=0xce;}_0x40071c[_0x25b0('0x1a')](_0x54f458);return _0x40071c[_0x25b0('0x21')](_0x25b0('0x22'),_0x1d850f+'-'+_0x20762e+'/'+_0x3267b9)[_0x25b0('0x1c')](_0x51542b);}return null;};}function patchUpdates(_0x1dc691){return function(_0xea4162){try{jsonpatch[_0x25b0('0x23')](_0xea4162,_0x1dc691,!![]);}catch(_0x19599b){return BPromise[_0x25b0('0x24')](_0x19599b);}return _0xea4162[_0x25b0('0x25')]();};}function saveUpdates(_0x2b2eda,_0x3ce1da){return function(_0x5cb746){if(_0x5cb746){return _0x5cb746[_0x25b0('0x26')](_0x2b2eda)[_0x25b0('0x27')](function(_0x517ec5){return _0x517ec5;});}return null;};}function removeEntity(_0x2d7c17,_0x2023d8){return function(_0x3546f0){if(_0x3546f0){return _0x3546f0['destroy']()['then'](function(){_0x2d7c17['status'](0xcc)[_0x25b0('0x1b')]();});}};}function handleEntityNotFound(_0x433085,_0x99bd3a){return function(_0x24f847){if(!_0x24f847){_0x433085[_0x25b0('0x19')](0x194);}return _0x24f847;};}function handleError(_0x23b396,_0x40268a){_0x40268a=_0x40268a||0x1f4;return function(_0x75ce7a){logger[_0x25b0('0x28')](_0x75ce7a['stack']);if(_0x75ce7a[_0x25b0('0x29')]){delete _0x75ce7a[_0x25b0('0x29')];}_0x23b396['status'](_0x40268a)['send'](_0x75ce7a);};}exports['index']=function(_0x1a6212,_0x3f0a54){var _0x251fad={},_0x105129={},_0x214377={'count':0x0,'rows':[]};var _0x3285ae=_[_0x25b0('0x2a')](db[_0x25b0('0x2b')][_0x25b0('0x2c')],function(_0x285a2b){return{'name':_0x285a2b[_0x25b0('0x2d')],'type':_0x285a2b[_0x25b0('0x2e')][_0x25b0('0x2f')]};});_0x105129['model']=_['map'](_0x3285ae,_0x25b0('0x29'));_0x105129['query']=_['keys'](_0x1a6212[_0x25b0('0x30')]);_0x105129[_0x25b0('0x31')]=_[_0x25b0('0x32')](_0x105129[_0x25b0('0x33')],_0x105129[_0x25b0('0x30')]);_0x251fad['attributes']=_[_0x25b0('0x32')](_0x105129[_0x25b0('0x33')],qs['fields'](_0x1a6212[_0x25b0('0x30')][_0x25b0('0x34')]));_0x251fad['attributes']=_0x251fad[_0x25b0('0x35')]['length']?_0x251fad[_0x25b0('0x35')]:_0x105129[_0x25b0('0x33')];if(!_0x1a6212[_0x25b0('0x30')][_0x25b0('0x36')](_0x25b0('0x37'))){_0x251fad[_0x25b0('0x1e')]=qs[_0x25b0('0x1e')](_0x1a6212[_0x25b0('0x30')][_0x25b0('0x1e')]);_0x251fad['offset']=qs[_0x25b0('0x1f')](_0x1a6212[_0x25b0('0x30')][_0x25b0('0x1f')]);}_0x251fad[_0x25b0('0x38')]=qs[_0x25b0('0x39')](_0x1a6212[_0x25b0('0x30')][_0x25b0('0x39')]);_0x251fad[_0x25b0('0x3a')]=qs[_0x25b0('0x31')](_[_0x25b0('0x3b')](_0x1a6212['query'],_0x105129[_0x25b0('0x31')]),_0x3285ae);if(_0x1a6212[_0x25b0('0x30')][_0x25b0('0x3c')]){_0x251fad['where']=_[_0x25b0('0x3d')](_0x251fad[_0x25b0('0x3a')],{'$or':_[_0x25b0('0x2a')](_0x3285ae,function(_0x43e140){if(_0x43e140[_0x25b0('0x2e')]!==_0x25b0('0x3e')){var _0x28f1cd={};_0x28f1cd[_0x43e140[_0x25b0('0x29')]]={'$like':'%'+_0x1a6212['query']['filter']+'%'};return _0x28f1cd;}})});}_0x251fad=_[_0x25b0('0x3d')]({},_0x251fad,_0x1a6212[_0x25b0('0x3f')]);var _0x3f4ae0={'where':_0x251fad['where']};return db[_0x25b0('0x2b')]['count'](_0x3f4ae0)[_0x25b0('0x27')](function(_0x39617a){_0x214377[_0x25b0('0x20')]=_0x39617a;if(_0x1a6212[_0x25b0('0x30')][_0x25b0('0x40')]){_0x251fad['include']=[{'all':!![]}];}return db[_0x25b0('0x2b')][_0x25b0('0x41')](_0x251fad);})[_0x25b0('0x27')](function(_0x376d8a){_0x214377[_0x25b0('0x42')]=_0x376d8a;return _0x214377;})['then'](respondWithFilteredResult(_0x3f0a54,_0x251fad))[_0x25b0('0x43')](handleError(_0x3f0a54,null));};exports[_0x25b0('0x44')]=function(_0x3d1262,_0x44c400){var _0x35fc00={'raw':!![],'where':{'id':_0x3d1262[_0x25b0('0x45')]['id']}},_0x1adf8d={};_0x1adf8d[_0x25b0('0x33')]=_[_0x25b0('0x46')](db[_0x25b0('0x2b')][_0x25b0('0x2c')]);_0x1adf8d['query']=_[_0x25b0('0x46')](_0x3d1262['query']);_0x1adf8d[_0x25b0('0x31')]=_[_0x25b0('0x32')](_0x1adf8d[_0x25b0('0x33')],_0x1adf8d[_0x25b0('0x30')]);_0x35fc00['attributes']=_[_0x25b0('0x32')](_0x1adf8d[_0x25b0('0x33')],qs[_0x25b0('0x34')](_0x3d1262['query'][_0x25b0('0x34')]));_0x35fc00[_0x25b0('0x35')]=_0x35fc00[_0x25b0('0x35')][_0x25b0('0x47')]?_0x35fc00[_0x25b0('0x35')]:_0x1adf8d[_0x25b0('0x33')];if(_0x3d1262[_0x25b0('0x30')]['includeAll']){_0x35fc00[_0x25b0('0x48')]=[{'all':!![]}];}_0x35fc00=_[_0x25b0('0x3d')]({},_0x35fc00,_0x3d1262[_0x25b0('0x3f')]);return db['FaxQueueReport'][_0x25b0('0x49')](_0x35fc00)[_0x25b0('0x27')](handleEntityNotFound(_0x44c400,null))[_0x25b0('0x27')](respondWithResult(_0x44c400,null))[_0x25b0('0x43')](handleError(_0x44c400,null));};exports[_0x25b0('0x4a')]=function(_0x568d83,_0x1e8a8d){return db[_0x25b0('0x2b')][_0x25b0('0x4a')](_0x568d83['body'],{})[_0x25b0('0x27')](respondWithResult(_0x1e8a8d,0xc9))[_0x25b0('0x43')](handleError(_0x1e8a8d,null));};exports[_0x25b0('0x26')]=function(_0x1d6d55,_0x29165e){if(_0x1d6d55[_0x25b0('0x4b')]['id']){delete _0x1d6d55['body']['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x1d6d55[_0x25b0('0x45')]['id']}})['then'](handleEntityNotFound(_0x29165e,null))['then'](saveUpdates(_0x1d6d55[_0x25b0('0x4b')],null))['then'](respondWithResult(_0x29165e,null))[_0x25b0('0x43')](handleError(_0x29165e,null));};exports['destroy']=function(_0x4fc22d,_0x394e52){return db[_0x25b0('0x2b')][_0x25b0('0x49')]({'where':{'id':_0x4fc22d[_0x25b0('0x45')]['id']}})[_0x25b0('0x27')](handleEntityNotFound(_0x394e52,null))[_0x25b0('0x27')](removeEntity(_0x394e52,null))[_0x25b0('0x43')](handleError(_0x394e52,null));};exports[_0x25b0('0x4c')]=function(_0x2e68ad,_0x20d56f){return db['FaxQueueReport']['describe']()['then'](respondWithResult(_0x20d56f,null))[_0x25b0('0x43')](handleError(_0x20d56f,null));};
\ No newline at end of file
+var _0x6e77=['VIRTUAL','options','FaxQueueReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','rimraf','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','type'];(function(_0x5e8638,_0x577f0d){var _0x412779=function(_0x44d06c){while(--_0x44d06c){_0x5e8638['push'](_0x5e8638['shift']());}};_0x412779(++_0x577f0d);}(_0x6e77,0xef));var _0x76e7=function(_0x336df4,_0x52c1dc){_0x336df4=_0x336df4-0x0;var _0x580d8c=_0x6e77[_0x336df4];return _0x580d8c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x76e7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x76e7('0x1'));var moment=require(_0x76e7('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x76e7('0x3'));var util=require(_0x76e7('0x4'));var path=require(_0x76e7('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76e7('0x6'));var fs=require('fs');var fs_extra=require(_0x76e7('0x7'));var _=require(_0x76e7('0x8'));var squel=require('squel');var crypto=require(_0x76e7('0x9'));var jsforce=require(_0x76e7('0xa'));var deskjs=require(_0x76e7('0xb'));var toCsv=require('to-csv');var querystring=require(_0x76e7('0xc'));var Papa=require(_0x76e7('0xd'));var Redis=require('ioredis');var authService=require(_0x76e7('0xe'));var qs=require(_0x76e7('0xf'));var as=require(_0x76e7('0x10'));var hardwareService=require(_0x76e7('0x11'));var logger=require('../../config/logger')(_0x76e7('0x12'));var utils=require(_0x76e7('0x13'));var config=require(_0x76e7('0x14'));var licenseUtil=require(_0x76e7('0x15'));var db=require(_0x76e7('0x16'))['db'];function respondWithStatusCode(_0x12100e,_0x37df1d){_0x37df1d=_0x37df1d||0xcc;return function(_0x3d9466){if(_0x3d9466){return _0x12100e[_0x76e7('0x17')](_0x37df1d);}return _0x12100e[_0x76e7('0x18')](_0x37df1d)[_0x76e7('0x19')]();};}function respondWithResult(_0x5b4fc5,_0x2661d2){_0x2661d2=_0x2661d2||0xc8;return function(_0x4cc38c){if(_0x4cc38c){return _0x5b4fc5[_0x76e7('0x18')](_0x2661d2)[_0x76e7('0x1a')](_0x4cc38c);}};}function respondWithFilteredResult(_0x52e19a,_0x14cd60){return function(_0x444184){if(_0x444184){var _0x327d83=typeof _0x14cd60[_0x76e7('0x1b')]===_0x76e7('0x1c')&&typeof _0x14cd60[_0x76e7('0x1d')]===_0x76e7('0x1c');var _0x58ba5e=_0x444184[_0x76e7('0x1e')];var _0x5d54fd=_0x327d83?0x0:_0x14cd60[_0x76e7('0x1b')];var _0x29424b=_0x327d83?_0x444184[_0x76e7('0x1e')]:_0x14cd60[_0x76e7('0x1b')]+_0x14cd60[_0x76e7('0x1d')];var _0x490b86;if(_0x29424b>=_0x58ba5e){_0x29424b=_0x58ba5e;_0x490b86=0xc8;}else{_0x490b86=0xce;}_0x52e19a[_0x76e7('0x18')](_0x490b86);return _0x52e19a['set'](_0x76e7('0x1f'),_0x5d54fd+'-'+_0x29424b+'/'+_0x58ba5e)[_0x76e7('0x1a')](_0x444184);}return null;};}function patchUpdates(_0x2d8995){return function(_0x2d9893){try{jsonpatch[_0x76e7('0x20')](_0x2d9893,_0x2d8995,!![]);}catch(_0x10216f){return BPromise[_0x76e7('0x21')](_0x10216f);}return _0x2d9893[_0x76e7('0x22')]();};}function saveUpdates(_0x43554c,_0x172174){return function(_0x86f6f9){if(_0x86f6f9){return _0x86f6f9[_0x76e7('0x23')](_0x43554c)[_0x76e7('0x24')](function(_0x92d883){return _0x92d883;});}return null;};}function removeEntity(_0x58061d,_0x11afe6){return function(_0x4c5183){if(_0x4c5183){return _0x4c5183[_0x76e7('0x25')]()[_0x76e7('0x24')](function(){_0x58061d[_0x76e7('0x18')](0xcc)[_0x76e7('0x19')]();});}};}function handleEntityNotFound(_0x4c1bf7,_0x39be21){return function(_0x2e453e){if(!_0x2e453e){_0x4c1bf7['sendStatus'](0x194);}return _0x2e453e;};}function handleError(_0x8ce9e3,_0x353c24){_0x353c24=_0x353c24||0x1f4;return function(_0x38238c){logger[_0x76e7('0x26')](_0x38238c['stack']);if(_0x38238c[_0x76e7('0x27')]){delete _0x38238c[_0x76e7('0x27')];}_0x8ce9e3[_0x76e7('0x18')](_0x353c24)[_0x76e7('0x28')](_0x38238c);};}exports[_0x76e7('0x29')]=function(_0x980f2b,_0x122a74){var _0x5ef85b={},_0x10d6c6={},_0x38ea19={'count':0x0,'rows':[]};var _0x5f2039=_[_0x76e7('0x2a')](db['FaxQueueReport'][_0x76e7('0x2b')],function(_0x3162e7){return{'name':_0x3162e7[_0x76e7('0x2c')],'type':_0x3162e7['type'][_0x76e7('0x2d')]};});_0x10d6c6[_0x76e7('0x2e')]=_['map'](_0x5f2039,_0x76e7('0x27'));_0x10d6c6[_0x76e7('0x2f')]=_['keys'](_0x980f2b[_0x76e7('0x2f')]);_0x10d6c6[_0x76e7('0x30')]=_['intersection'](_0x10d6c6[_0x76e7('0x2e')],_0x10d6c6[_0x76e7('0x2f')]);_0x5ef85b[_0x76e7('0x31')]=_[_0x76e7('0x32')](_0x10d6c6[_0x76e7('0x2e')],qs[_0x76e7('0x33')](_0x980f2b['query'][_0x76e7('0x33')]));_0x5ef85b['attributes']=_0x5ef85b[_0x76e7('0x31')][_0x76e7('0x34')]?_0x5ef85b['attributes']:_0x10d6c6['model'];if(!_0x980f2b[_0x76e7('0x2f')][_0x76e7('0x35')](_0x76e7('0x36'))){_0x5ef85b[_0x76e7('0x1d')]=qs[_0x76e7('0x1d')](_0x980f2b[_0x76e7('0x2f')][_0x76e7('0x1d')]);_0x5ef85b[_0x76e7('0x1b')]=qs[_0x76e7('0x1b')](_0x980f2b[_0x76e7('0x2f')]['offset']);}_0x5ef85b[_0x76e7('0x37')]=qs[_0x76e7('0x38')](_0x980f2b[_0x76e7('0x2f')][_0x76e7('0x38')]);_0x5ef85b['where']=qs['filters'](_[_0x76e7('0x39')](_0x980f2b[_0x76e7('0x2f')],_0x10d6c6[_0x76e7('0x30')]),_0x5f2039);if(_0x980f2b[_0x76e7('0x2f')][_0x76e7('0x3a')]){_0x5ef85b['where']=_[_0x76e7('0x3b')](_0x5ef85b['where'],{'$or':_[_0x76e7('0x2a')](_0x5f2039,function(_0x2aa215){if(_0x2aa215[_0x76e7('0x3c')]!==_0x76e7('0x3d')){var _0x3f4a19={};_0x3f4a19[_0x2aa215[_0x76e7('0x27')]]={'$like':'%'+_0x980f2b[_0x76e7('0x2f')]['filter']+'%'};return _0x3f4a19;}})});}_0x5ef85b=_[_0x76e7('0x3b')]({},_0x5ef85b,_0x980f2b[_0x76e7('0x3e')]);var _0x317e73={'where':_0x5ef85b['where']};return db[_0x76e7('0x3f')]['count'](_0x317e73)['then'](function(_0x2e0bc2){_0x38ea19[_0x76e7('0x1e')]=_0x2e0bc2;if(_0x980f2b['query'][_0x76e7('0x40')]){_0x5ef85b[_0x76e7('0x41')]=[{'all':!![]}];}return db[_0x76e7('0x3f')][_0x76e7('0x42')](_0x5ef85b);})['then'](function(_0x198d52){_0x38ea19[_0x76e7('0x43')]=_0x198d52;return _0x38ea19;})[_0x76e7('0x24')](respondWithFilteredResult(_0x122a74,_0x5ef85b))[_0x76e7('0x44')](handleError(_0x122a74,null));};exports[_0x76e7('0x45')]=function(_0x5dcf92,_0x539332){var _0x27ace2={'raw':!![],'where':{'id':_0x5dcf92[_0x76e7('0x46')]['id']}},_0x7e7587={};_0x7e7587[_0x76e7('0x2e')]=_[_0x76e7('0x47')](db[_0x76e7('0x3f')][_0x76e7('0x2b')]);_0x7e7587['query']=_[_0x76e7('0x47')](_0x5dcf92[_0x76e7('0x2f')]);_0x7e7587[_0x76e7('0x30')]=_[_0x76e7('0x32')](_0x7e7587[_0x76e7('0x2e')],_0x7e7587[_0x76e7('0x2f')]);_0x27ace2[_0x76e7('0x31')]=_[_0x76e7('0x32')](_0x7e7587['model'],qs[_0x76e7('0x33')](_0x5dcf92['query'][_0x76e7('0x33')]));_0x27ace2['attributes']=_0x27ace2[_0x76e7('0x31')][_0x76e7('0x34')]?_0x27ace2['attributes']:_0x7e7587['model'];if(_0x5dcf92[_0x76e7('0x2f')][_0x76e7('0x40')]){_0x27ace2['include']=[{'all':!![]}];}_0x27ace2=_[_0x76e7('0x3b')]({},_0x27ace2,_0x5dcf92[_0x76e7('0x3e')]);return db[_0x76e7('0x3f')][_0x76e7('0x48')](_0x27ace2)['then'](handleEntityNotFound(_0x539332,null))[_0x76e7('0x24')](respondWithResult(_0x539332,null))[_0x76e7('0x44')](handleError(_0x539332,null));};exports[_0x76e7('0x49')]=function(_0x1a7823,_0x4701cc){return db[_0x76e7('0x3f')][_0x76e7('0x49')](_0x1a7823['body'],{})[_0x76e7('0x24')](respondWithResult(_0x4701cc,0xc9))[_0x76e7('0x44')](handleError(_0x4701cc,null));};exports[_0x76e7('0x23')]=function(_0xd28b35,_0x522104){if(_0xd28b35[_0x76e7('0x4a')]['id']){delete _0xd28b35[_0x76e7('0x4a')]['id'];}return db[_0x76e7('0x3f')][_0x76e7('0x48')]({'where':{'id':_0xd28b35[_0x76e7('0x46')]['id']}})[_0x76e7('0x24')](handleEntityNotFound(_0x522104,null))[_0x76e7('0x24')](saveUpdates(_0xd28b35[_0x76e7('0x4a')],null))[_0x76e7('0x24')](respondWithResult(_0x522104,null))['catch'](handleError(_0x522104,null));};exports[_0x76e7('0x25')]=function(_0x426651,_0xe9a2a2){return db[_0x76e7('0x3f')]['find']({'where':{'id':_0x426651['params']['id']}})[_0x76e7('0x24')](handleEntityNotFound(_0xe9a2a2,null))[_0x76e7('0x24')](removeEntity(_0xe9a2a2,null))[_0x76e7('0x44')](handleError(_0xe9a2a2,null));};exports['describe']=function(_0x23585a,_0x3fd0e6){return db[_0x76e7('0x3f')]['describe']()[_0x76e7('0x24')](respondWithResult(_0x3fd0e6,null))[_0x76e7('0x44')](handleError(_0x3fd0e6,null));};
\ No newline at end of file
index a008beb..1410396 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabce=['path','rimraf','../../config/environment','define','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x2a8355,_0xdb76f8){var _0xe35fda=function(_0x469d8f){while(--_0x469d8f){_0x2a8355['push'](_0x2a8355['shift']());}};_0xe35fda(++_0xdb76f8);}(_0xabce,0x103));var _0xeabc=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xabce[_0x5c3c0b];return _0x52ecd2;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./faxQueueReport.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('FaxQueueReport',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[{'name':_0xeabc('0xa'),'fields':[_0xeabc('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x53ec=['path','../../config/environment','./faxQueueReport.attributes','define','FaxQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xb85e44,_0x116e14){var _0x536ee5=function(_0x5a7290){while(--_0x5a7290){_0xb85e44['push'](_0xb85e44['shift']());}};_0x536ee5(++_0x116e14);}(_0x53ec,0x192));var _0xc53e=function(_0x16c2e0,_0x3dc335){_0x16c2e0=_0x16c2e0-0x0;var _0x49b690=_0x53ec[_0x16c2e0];return _0x49b690;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 4f1e910..1dc6a55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd06=['UpdateFaxQueueReport','update','where','attributes','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','FaxQueueReport,\x20%s,\x20%s','message','result','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw'];(function(_0x472154,_0x414fbb){var _0x58254e=function(_0x1d5782){while(--_0x1d5782){_0x472154['push'](_0x472154['shift']());}};_0x58254e(++_0x414fbb);}(_0xcd06,0x1d9));var _0x6cd0=function(_0x1b6bd9,_0x31c836){_0x1b6bd9=_0x1b6bd9-0x0;var _0x4f6609=_0xcd06[_0x1b6bd9];return _0x4f6609;};'use strict';var _=require(_0x6cd0('0x0'));var util=require(_0x6cd0('0x1'));var moment=require(_0x6cd0('0x2'));var BPromise=require(_0x6cd0('0x3'));var rs=require(_0x6cd0('0x4'));var fs=require('fs');var Redis=require(_0x6cd0('0x5'));var db=require(_0x6cd0('0x6'))['db'];var utils=require(_0x6cd0('0x7'));var logger=require(_0x6cd0('0x8'))(_0x6cd0('0x9'));var config=require(_0x6cd0('0xa'));var jayson=require(_0x6cd0('0xb'));var client=jayson[_0x6cd0('0xc')][_0x6cd0('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3d84ae,_0xb890ff,_0x22446c){return new BPromise(function(_0x46a2f2,_0x2339ec){return client[_0x6cd0('0xe')](_0x3d84ae,_0x22446c)[_0x6cd0('0xf')](function(_0x4b0f7e){logger[_0x6cd0('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0xb890ff,_0x6cd0('0x11'));logger[_0x6cd0('0x12')](_0x6cd0('0x13'),_0xb890ff,_0x6cd0('0x11'),JSON[_0x6cd0('0x14')](_0x4b0f7e));if(_0x4b0f7e[_0x6cd0('0x15')]){if(_0x4b0f7e[_0x6cd0('0x15')]['code']===0x1f4){logger[_0x6cd0('0x15')](_0x6cd0('0x16'),_0xb890ff,_0x4b0f7e[_0x6cd0('0x15')][_0x6cd0('0x17')]);return _0x2339ec(_0x4b0f7e['error'][_0x6cd0('0x17')]);}logger['error']('FaxQueueReport,\x20%s,\x20%s',_0xb890ff,_0x4b0f7e[_0x6cd0('0x15')][_0x6cd0('0x17')]);return _0x46a2f2(_0x4b0f7e[_0x6cd0('0x15')][_0x6cd0('0x17')]);}else{logger[_0x6cd0('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0xb890ff,_0x6cd0('0x11'));_0x46a2f2(_0x4b0f7e[_0x6cd0('0x18')][_0x6cd0('0x17')]);}})['catch'](function(_0x9b804c){logger['error'](_0x6cd0('0x16'),_0xb890ff,_0x9b804c);_0x2339ec(_0x9b804c);});});}exports[_0x6cd0('0x19')]=function(_0x168e16){var _0x40b427=this;return new Promise(function(_0x52ea9d,_0xc7c653){return db[_0x6cd0('0x1a')][_0x6cd0('0x1b')](_0x168e16[_0x6cd0('0x1c')],{'raw':_0x168e16[_0x6cd0('0x1d')]?_0x168e16[_0x6cd0('0x1d')][_0x6cd0('0x1e')]===undefined?!![]:![]:!![]})[_0x6cd0('0xf')](function(_0x23bfbd){logger[_0x6cd0('0x10')](_0x6cd0('0x19'),_0x168e16);logger[_0x6cd0('0x12')](_0x6cd0('0x19'),_0x168e16,JSON[_0x6cd0('0x14')](_0x23bfbd));_0x52ea9d(_0x23bfbd);})['catch'](function(_0x2377f5){logger['error'](_0x6cd0('0x19'),_0x2377f5[_0x6cd0('0x17')],_0x168e16);_0xc7c653(_0x40b427[_0x6cd0('0x15')](0x1f4,_0x2377f5[_0x6cd0('0x17')]));});});};exports[_0x6cd0('0x1f')]=function(_0x2fedbe){var _0x52fe28=this;return new Promise(function(_0x31ffc8,_0x39f103){return db['FaxQueueReport'][_0x6cd0('0x20')](_0x2fedbe[_0x6cd0('0x1c')],{'raw':_0x2fedbe[_0x6cd0('0x1d')]?_0x2fedbe[_0x6cd0('0x1d')][_0x6cd0('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fedbe[_0x6cd0('0x1d')]?_0x2fedbe[_0x6cd0('0x1d')][_0x6cd0('0x21')]||null:null,'attributes':_0x2fedbe[_0x6cd0('0x1d')]?_0x2fedbe['options'][_0x6cd0('0x22')]||null:null,'limit':_0x2fedbe[_0x6cd0('0x1d')]?_0x2fedbe['options']['limit']||null:null})[_0x6cd0('0xf')](function(_0x2c4f20){logger['info']('UpdateFaxQueueReport',_0x2fedbe);logger[_0x6cd0('0x12')](_0x6cd0('0x1f'),_0x2fedbe,JSON[_0x6cd0('0x14')](_0x2c4f20));_0x31ffc8(_0x2c4f20);})[_0x6cd0('0x23')](function(_0x4315e5){logger[_0x6cd0('0x15')](_0x6cd0('0x1f'),_0x4315e5[_0x6cd0('0x17')],_0x2fedbe);_0x39f103(_0x52fe28[_0x6cd0('0x15')](0x1f4,_0x4315e5[_0x6cd0('0x17')]));});});};
\ No newline at end of file
+var _0xae67=['client','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxQueueReport','create','body','options','raw','then','debug','UpdateFaxQueueReport','FaxQueueReport','attributes','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x4659ce,_0xe29f24){var _0x37ba32=function(_0x339204){while(--_0x339204){_0x4659ce['push'](_0x4659ce['shift']());}};_0x37ba32(++_0xe29f24);}(_0xae67,0x73));var _0x7ae6=function(_0x10d33c,_0xab7a14){_0x10d33c=_0x10d33c-0x0;var _0x20fadc=_0xae67[_0x10d33c];return _0x20fadc;};'use strict';var _=require(_0x7ae6('0x0'));var util=require(_0x7ae6('0x1'));var moment=require('moment');var BPromise=require(_0x7ae6('0x2'));var rs=require(_0x7ae6('0x3'));var fs=require('fs');var Redis=require(_0x7ae6('0x4'));var db=require(_0x7ae6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7ae6('0x6'))(_0x7ae6('0x7'));var config=require(_0x7ae6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7ae6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b640f,_0x26c4ab,_0x584ea9){return new BPromise(function(_0x18fc0a,_0x19c068){return client[_0x7ae6('0xa')](_0x4b640f,_0x584ea9)['then'](function(_0x3ff409){logger[_0x7ae6('0xb')](_0x7ae6('0xc'),_0x26c4ab,_0x7ae6('0xd'));logger['debug'](_0x7ae6('0xe'),_0x26c4ab,_0x7ae6('0xd'),JSON[_0x7ae6('0xf')](_0x3ff409));if(_0x3ff409[_0x7ae6('0x10')]){if(_0x3ff409[_0x7ae6('0x10')][_0x7ae6('0x11')]===0x1f4){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x26c4ab,_0x3ff409[_0x7ae6('0x10')][_0x7ae6('0x12')]);return _0x19c068(_0x3ff409['error'][_0x7ae6('0x12')]);}logger[_0x7ae6('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0x26c4ab,_0x3ff409['error'][_0x7ae6('0x12')]);return _0x18fc0a(_0x3ff409[_0x7ae6('0x10')][_0x7ae6('0x12')]);}else{logger['info'](_0x7ae6('0xc'),_0x26c4ab,'request\x20sent');_0x18fc0a(_0x3ff409[_0x7ae6('0x13')][_0x7ae6('0x12')]);}})[_0x7ae6('0x14')](function(_0x4b96d0){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x26c4ab,_0x4b96d0);_0x19c068(_0x4b96d0);});});}exports[_0x7ae6('0x15')]=function(_0x30c13d){var _0x2a0179=this;return new Promise(function(_0x9125c8,_0x1ed9d0){return db['FaxQueueReport'][_0x7ae6('0x16')](_0x30c13d[_0x7ae6('0x17')],{'raw':_0x30c13d['options']?_0x30c13d[_0x7ae6('0x18')][_0x7ae6('0x19')]===undefined?!![]:![]:!![]})[_0x7ae6('0x1a')](function(_0x1e600f){logger['info'](_0x7ae6('0x15'),_0x30c13d);logger[_0x7ae6('0x1b')](_0x7ae6('0x15'),_0x30c13d,JSON[_0x7ae6('0xf')](_0x1e600f));_0x9125c8(_0x1e600f);})[_0x7ae6('0x14')](function(_0x4d2be4){logger[_0x7ae6('0x10')](_0x7ae6('0x15'),_0x4d2be4['message'],_0x30c13d);_0x1ed9d0(_0x2a0179[_0x7ae6('0x10')](0x1f4,_0x4d2be4[_0x7ae6('0x12')]));});});};exports[_0x7ae6('0x1c')]=function(_0x1678b7){var _0x462245=this;return new Promise(function(_0x2e51f4,_0x57414){return db[_0x7ae6('0x1d')]['update'](_0x1678b7[_0x7ae6('0x17')],{'raw':_0x1678b7[_0x7ae6('0x18')]?_0x1678b7[_0x7ae6('0x18')][_0x7ae6('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1678b7[_0x7ae6('0x18')]?_0x1678b7[_0x7ae6('0x18')]['where']||null:null,'attributes':_0x1678b7[_0x7ae6('0x18')]?_0x1678b7['options'][_0x7ae6('0x1e')]||null:null,'limit':_0x1678b7[_0x7ae6('0x18')]?_0x1678b7['options']['limit']||null:null})[_0x7ae6('0x1a')](function(_0x298e89){logger[_0x7ae6('0xb')]('UpdateFaxQueueReport',_0x1678b7);logger[_0x7ae6('0x1b')](_0x7ae6('0x1c'),_0x1678b7,JSON[_0x7ae6('0xf')](_0x298e89));_0x2e51f4(_0x298e89);})['catch'](function(_0x462eb9){logger[_0x7ae6('0x10')](_0x7ae6('0x1c'),_0x462eb9['message'],_0x1678b7);_0x57414(_0x462245[_0x7ae6('0x10')](0x1f4,_0x462eb9['message']));});});};
\ No newline at end of file
index d28a692..af2b89b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91dd=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x3d2aa1,_0x12f3a6){var _0x4907fe=function(_0x2f184b){while(--_0x2f184b){_0x3d2aa1['push'](_0x3d2aa1['shift']());}};_0x4907fe(++_0x12f3a6);}(_0x91dd,0x1f4));var _0xd91d=function(_0x49ad66,_0x280c06){_0x49ad66=_0x49ad66-0x0;var _0x53d812=_0x91dd[_0x49ad66];return _0x53d812;};'use strict';var multer=require(_0xd91d('0x0'));var util=require(_0xd91d('0x1'));var path=require(_0xd91d('0x2'));var timeout=require(_0xd91d('0x3'));var express=require(_0xd91d('0x4'));var router=express['Router']();var fs_extra=require(_0xd91d('0x5'));var auth=require(_0xd91d('0x6'));var interaction=require(_0xd91d('0x7'));var config=require(_0xd91d('0x8'));var controller=require(_0xd91d('0x9'));router['get']('/',auth[_0xd91d('0xa')](),controller[_0xd91d('0xb')]);router[_0xd91d('0xc')](_0xd91d('0xd'),auth[_0xd91d('0xa')](),controller[_0xd91d('0xe')]);router[_0xd91d('0xc')](_0xd91d('0xf'),auth[_0xd91d('0xa')](),controller[_0xd91d('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xd91d('0x11')](_0xd91d('0xf'),auth[_0xd91d('0xa')](),controller[_0xd91d('0x12')]);router[_0xd91d('0x13')](_0xd91d('0xf'),auth['isAuthenticated'](),controller[_0xd91d('0x14')]);module[_0xd91d('0x15')]=router;
\ No newline at end of file
+var _0xab0d=['../../config/environment','./faxQueueReport.controller','isAuthenticated','index','/describe','describe','get','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5c55a8,_0x164715){var _0x136be3=function(_0x276c59){while(--_0x276c59){_0x5c55a8['push'](_0x5c55a8['shift']());}};_0x136be3(++_0x164715);}(_0xab0d,0x116));var _0xdab0=function(_0x337158,_0xb00e1d){_0x337158=_0x337158-0x0;var _0x2413c6=_0xab0d[_0x337158];return _0x2413c6;};'use strict';var multer=require(_0xdab0('0x0'));var util=require(_0xdab0('0x1'));var path=require(_0xdab0('0x2'));var timeout=require(_0xdab0('0x3'));var express=require(_0xdab0('0x4'));var router=express['Router']();var fs_extra=require(_0xdab0('0x5'));var auth=require(_0xdab0('0x6'));var interaction=require(_0xdab0('0x7'));var config=require(_0xdab0('0x8'));var controller=require(_0xdab0('0x9'));router['get']('/',auth[_0xdab0('0xa')](),controller[_0xdab0('0xb')]);router['get'](_0xdab0('0xc'),auth[_0xdab0('0xa')](),controller[_0xdab0('0xd')]);router[_0xdab0('0xe')](_0xdab0('0xf'),auth[_0xdab0('0xa')](),controller[_0xdab0('0x10')]);router['post']('/',auth[_0xdab0('0xa')](),controller[_0xdab0('0x11')]);router[_0xdab0('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xdab0('0x13')]);router['delete']('/:id',auth[_0xdab0('0xa')](),controller[_0xdab0('0x14')]);module[_0xdab0('0x15')]=router;
\ No newline at end of file
index 41b5e8a..37136ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x5cfa4f,_0x4d8fe9){var _0x2e5acd=function(_0x474d1a){while(--_0x474d1a){_0x5cfa4f['push'](_0x5cfa4f['shift']());}};_0x2e5acd(++_0x4d8fe9);}(_0x9c44,0x178));var _0x49c4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9c44[_0xdea41a];return _0x15d0d8;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
+var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x34e8,0x12c));var _0x834e=function(_0x50dad9,_0x562781){_0x50dad9=_0x50dad9-0x0;var _0x1bcce1=_0x34e8[_0x50dad9];return _0x1bcce1;};'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 7c801bf..3a621c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x592d=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x592d,0x187));var _0xd592=function(_0x6d1ea2,_0x11eacb){_0x6d1ea2=_0x6d1ea2-0x0;var _0x414e89=_0x592d[_0x6d1ea2];return _0x414e89;};'use strict';var emlformat=require(_0xd592('0x0'));var rimraf=require(_0xd592('0x1'));var zipdir=require(_0xd592('0x2'));var jsonpatch=require(_0xd592('0x3'));var rp=require(_0xd592('0x4'));var moment=require('moment');var BPromise=require(_0xd592('0x5'));var Mustache=require(_0xd592('0x6'));var util=require(_0xd592('0x7'));var path=require('path');var sox=require(_0xd592('0x8'));var csv=require(_0xd592('0x9'));var ejs=require(_0xd592('0xa'));var fs=require('fs');var fs_extra=require(_0xd592('0xb'));var _=require(_0xd592('0xc'));var squel=require(_0xd592('0xd'));var crypto=require(_0xd592('0xe'));var jsforce=require(_0xd592('0xf'));var deskjs=require(_0xd592('0x10'));var toCsv=require(_0xd592('0x9'));var querystring=require('querystring');var Papa=require(_0xd592('0x11'));var Redis=require(_0xd592('0x12'));var authService=require(_0xd592('0x13'));var qs=require(_0xd592('0x14'));var as=require(_0xd592('0x15'));var hardwareService=require(_0xd592('0x16'));var logger=require(_0xd592('0x17'))('api');var utils=require(_0xd592('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xd592('0x19'));var db=require(_0xd592('0x1a'))['db'];function respondWithStatusCode(_0x2dd300,_0x4245ff){_0x4245ff=_0x4245ff||0xcc;return function(_0x450d13){if(_0x450d13){return _0x2dd300[_0xd592('0x1b')](_0x4245ff);}return _0x2dd300['status'](_0x4245ff)['end']();};}function respondWithResult(_0xbf8d3c,_0x20a3dc){_0x20a3dc=_0x20a3dc||0xc8;return function(_0x3aa3c4){if(_0x3aa3c4){return _0xbf8d3c[_0xd592('0x1c')](_0x20a3dc)[_0xd592('0x1d')](_0x3aa3c4);}};}function respondWithFilteredResult(_0x24e74f,_0x4877ad){return function(_0x12cc23){if(_0x12cc23){var _0x4e0c4a=typeof _0x4877ad[_0xd592('0x1e')]===_0xd592('0x1f')&&typeof _0x4877ad[_0xd592('0x20')]===_0xd592('0x1f');var _0x1f2d10=_0x12cc23[_0xd592('0x21')];var _0x288ed4=_0x4e0c4a?0x0:_0x4877ad[_0xd592('0x1e')];var _0x48c803=_0x4e0c4a?_0x12cc23[_0xd592('0x21')]:_0x4877ad['offset']+_0x4877ad['limit'];var _0x51e92a;if(_0x48c803>=_0x1f2d10){_0x48c803=_0x1f2d10;_0x51e92a=0xc8;}else{_0x51e92a=0xce;}_0x24e74f['status'](_0x51e92a);return _0x24e74f[_0xd592('0x22')](_0xd592('0x23'),_0x288ed4+'-'+_0x48c803+'/'+_0x1f2d10)[_0xd592('0x1d')](_0x12cc23);}return null;};}function patchUpdates(_0x5e5eea){return function(_0x3f5f2c){try{jsonpatch[_0xd592('0x24')](_0x3f5f2c,_0x5e5eea,!![]);}catch(_0x1a17fb){return BPromise[_0xd592('0x25')](_0x1a17fb);}return _0x3f5f2c[_0xd592('0x26')]();};}function saveUpdates(_0x1c8f5f,_0x565aa0){return function(_0x37dfa5){if(_0x37dfa5){return _0x37dfa5[_0xd592('0x27')](_0x1c8f5f)[_0xd592('0x28')](function(_0x4763f1){return _0x4763f1;});}return null;};}function removeEntity(_0x1ca51c,_0x3946da){return function(_0x227be1){if(_0x227be1){return _0x227be1[_0xd592('0x29')]()[_0xd592('0x28')](function(){_0x1ca51c[_0xd592('0x1c')](0xcc)[_0xd592('0x2a')]();});}};}function handleEntityNotFound(_0x4efef8,_0x30b58e){return function(_0x27264c){if(!_0x27264c){_0x4efef8[_0xd592('0x1b')](0x194);}return _0x27264c;};}function handleError(_0x36f18f,_0x554761){_0x554761=_0x554761||0x1f4;return function(_0x311796){logger[_0xd592('0x2b')](_0x311796[_0xd592('0x2c')]);if(_0x311796['name']){delete _0x311796['name'];}_0x36f18f[_0xd592('0x1c')](_0x554761)[_0xd592('0x2d')](_0x311796);};}exports[_0xd592('0x2e')]=function(_0x9f8605,_0x21ef07){var _0x5f1997={},_0x77fb5={},_0x1ee179={'count':0x0,'rows':[]};var _0x2b1474=_[_0xd592('0x2f')](db[_0xd592('0x30')][_0xd592('0x31')],function(_0x48bb9a){return{'name':_0x48bb9a[_0xd592('0x32')],'type':_0x48bb9a[_0xd592('0x33')][_0xd592('0x34')]};});_0x77fb5['model']=_[_0xd592('0x2f')](_0x2b1474,_0xd592('0x35'));_0x77fb5[_0xd592('0x36')]=_[_0xd592('0x37')](_0x9f8605[_0xd592('0x36')]);_0x77fb5[_0xd592('0x38')]=_[_0xd592('0x39')](_0x77fb5['model'],_0x77fb5[_0xd592('0x36')]);_0x5f1997['attributes']=_[_0xd592('0x39')](_0x77fb5[_0xd592('0x3a')],qs[_0xd592('0x3b')](_0x9f8605['query'][_0xd592('0x3b')]));_0x5f1997[_0xd592('0x3c')]=_0x5f1997[_0xd592('0x3c')][_0xd592('0x3d')]?_0x5f1997['attributes']:_0x77fb5['model'];if(!_0x9f8605['query']['hasOwnProperty'](_0xd592('0x3e'))){_0x5f1997['limit']=qs['limit'](_0x9f8605['query'][_0xd592('0x20')]);_0x5f1997[_0xd592('0x1e')]=qs[_0xd592('0x1e')](_0x9f8605[_0xd592('0x36')][_0xd592('0x1e')]);}_0x5f1997[_0xd592('0x3f')]=qs[_0xd592('0x40')](_0x9f8605[_0xd592('0x36')][_0xd592('0x40')]);_0x5f1997['where']=qs[_0xd592('0x38')](_[_0xd592('0x41')](_0x9f8605[_0xd592('0x36')],_0x77fb5[_0xd592('0x38')]),_0x2b1474);if(_0x9f8605[_0xd592('0x36')][_0xd592('0x42')]){_0x5f1997[_0xd592('0x43')]=_[_0xd592('0x44')](_0x5f1997[_0xd592('0x43')],{'$or':_['map'](_0x2b1474,function(_0x4c54e4){if(_0x4c54e4[_0xd592('0x33')]!==_0xd592('0x45')){var _0x570402={};_0x570402[_0x4c54e4['name']]={'$like':'%'+_0x9f8605[_0xd592('0x36')][_0xd592('0x42')]+'%'};return _0x570402;}})});}_0x5f1997=_[_0xd592('0x44')]({},_0x5f1997,_0x9f8605[_0xd592('0x46')]);var _0x50ef99={'where':_0x5f1997[_0xd592('0x43')]};return db[_0xd592('0x30')][_0xd592('0x21')](_0x50ef99)[_0xd592('0x28')](function(_0x4175e2){_0x1ee179[_0xd592('0x21')]=_0x4175e2;if(_0x9f8605['query'][_0xd592('0x47')]){_0x5f1997[_0xd592('0x48')]=[{'all':!![]}];}return db[_0xd592('0x30')]['findAll'](_0x5f1997);})[_0xd592('0x28')](function(_0x1e3d74){_0x1ee179[_0xd592('0x49')]=_0x1e3d74;return _0x1ee179;})['then'](respondWithFilteredResult(_0x21ef07,_0x5f1997))[_0xd592('0x4a')](handleError(_0x21ef07,null));};exports[_0xd592('0x4b')]=function(_0x537351,_0x30fa7d){var _0x129db5={'raw':!![],'where':{'id':_0x537351[_0xd592('0x4c')]['id']}},_0x702ece={};_0x702ece['model']=_['keys'](db[_0xd592('0x30')]['rawAttributes']);_0x702ece[_0xd592('0x36')]=_['keys'](_0x537351[_0xd592('0x36')]);_0x702ece[_0xd592('0x38')]=_['intersection'](_0x702ece[_0xd592('0x3a')],_0x702ece[_0xd592('0x36')]);_0x129db5[_0xd592('0x3c')]=_[_0xd592('0x39')](_0x702ece[_0xd592('0x3a')],qs[_0xd592('0x3b')](_0x537351['query'][_0xd592('0x3b')]));_0x129db5[_0xd592('0x3c')]=_0x129db5[_0xd592('0x3c')][_0xd592('0x3d')]?_0x129db5['attributes']:_0x702ece[_0xd592('0x3a')];if(_0x537351[_0xd592('0x36')][_0xd592('0x47')]){_0x129db5[_0xd592('0x48')]=[{'all':!![]}];}_0x129db5=_['merge']({},_0x129db5,_0x537351['options']);return db[_0xd592('0x30')][_0xd592('0x4d')](_0x129db5)[_0xd592('0x28')](handleEntityNotFound(_0x30fa7d,null))['then'](respondWithResult(_0x30fa7d,null))[_0xd592('0x4a')](handleError(_0x30fa7d,null));};exports[_0xd592('0x4e')]=function(_0x30e771,_0x19a95f){return db['FaxTransferReport']['create'](_0x30e771[_0xd592('0x4f')],{})['then'](respondWithResult(_0x19a95f,0xc9))[_0xd592('0x4a')](handleError(_0x19a95f,null));};exports[_0xd592('0x27')]=function(_0x17b203,_0x3a656e){if(_0x17b203[_0xd592('0x4f')]['id']){delete _0x17b203['body']['id'];}return db[_0xd592('0x30')][_0xd592('0x4d')]({'where':{'id':_0x17b203['params']['id']}})[_0xd592('0x28')](handleEntityNotFound(_0x3a656e,null))['then'](saveUpdates(_0x17b203['body'],null))[_0xd592('0x28')](respondWithResult(_0x3a656e,null))[_0xd592('0x4a')](handleError(_0x3a656e,null));};exports[_0xd592('0x29')]=function(_0x16b4c7,_0x4eefd1){return db[_0xd592('0x30')][_0xd592('0x4d')]({'where':{'id':_0x16b4c7['params']['id']}})['then'](handleEntityNotFound(_0x4eefd1,null))['then'](removeEntity(_0x4eefd1,null))['catch'](handleError(_0x4eefd1,null));};exports[_0xd592('0x50')]=function(_0x486e12,_0x22cc87){return db[_0xd592('0x30')]['describe']()[_0xd592('0x28')](respondWithResult(_0x22cc87,null))[_0xd592('0x4a')](handleError(_0x22cc87,null));};
\ No newline at end of file
+var _0x5e05=['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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','end','error','name','send','index','map','FaxTransferReport','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','find','catch','create','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5e05,0x1d6));var _0x55e0=function(_0x3cf78,_0x385e9b){_0x3cf78=_0x3cf78-0x0;var _0x5aca51=_0x5e05[_0x3cf78];return _0x5aca51;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x55e0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x55e0('0x1'));var rp=require(_0x55e0('0x2'));var moment=require(_0x55e0('0x3'));var BPromise=require(_0x55e0('0x4'));var Mustache=require(_0x55e0('0x5'));var util=require(_0x55e0('0x6'));var path=require(_0x55e0('0x7'));var sox=require(_0x55e0('0x8'));var csv=require(_0x55e0('0x9'));var ejs=require(_0x55e0('0xa'));var fs=require('fs');var fs_extra=require(_0x55e0('0xb'));var _=require('lodash');var squel=require(_0x55e0('0xc'));var crypto=require(_0x55e0('0xd'));var jsforce=require(_0x55e0('0xe'));var deskjs=require(_0x55e0('0xf'));var toCsv=require('to-csv');var querystring=require(_0x55e0('0x10'));var Papa=require(_0x55e0('0x11'));var Redis=require(_0x55e0('0x12'));var authService=require(_0x55e0('0x13'));var qs=require(_0x55e0('0x14'));var as=require(_0x55e0('0x15'));var hardwareService=require(_0x55e0('0x16'));var logger=require(_0x55e0('0x17'))('api');var utils=require(_0x55e0('0x18'));var config=require(_0x55e0('0x19'));var licenseUtil=require(_0x55e0('0x1a'));var db=require(_0x55e0('0x1b'))['db'];function respondWithStatusCode(_0x1da81d,_0x50f45d){_0x50f45d=_0x50f45d||0xcc;return function(_0x61fe32){if(_0x61fe32){return _0x1da81d[_0x55e0('0x1c')](_0x50f45d);}return _0x1da81d[_0x55e0('0x1d')](_0x50f45d)['end']();};}function respondWithResult(_0x32a90e,_0xbdb7bb){_0xbdb7bb=_0xbdb7bb||0xc8;return function(_0x3b2cd7){if(_0x3b2cd7){return _0x32a90e[_0x55e0('0x1d')](_0xbdb7bb)['json'](_0x3b2cd7);}};}function respondWithFilteredResult(_0x5ea416,_0x278ed7){return function(_0x5f5c59){if(_0x5f5c59){var _0x3d4983=typeof _0x278ed7[_0x55e0('0x1e')]==='undefined'&&typeof _0x278ed7[_0x55e0('0x1f')]===_0x55e0('0x20');var _0xa4cde6=_0x5f5c59[_0x55e0('0x21')];var _0x35623e=_0x3d4983?0x0:_0x278ed7[_0x55e0('0x1e')];var _0x48f322=_0x3d4983?_0x5f5c59['count']:_0x278ed7[_0x55e0('0x1e')]+_0x278ed7[_0x55e0('0x1f')];var _0x2aa1ba;if(_0x48f322>=_0xa4cde6){_0x48f322=_0xa4cde6;_0x2aa1ba=0xc8;}else{_0x2aa1ba=0xce;}_0x5ea416[_0x55e0('0x1d')](_0x2aa1ba);return _0x5ea416[_0x55e0('0x22')](_0x55e0('0x23'),_0x35623e+'-'+_0x48f322+'/'+_0xa4cde6)[_0x55e0('0x24')](_0x5f5c59);}return null;};}function patchUpdates(_0x31cba8){return function(_0xb12c79){try{jsonpatch[_0x55e0('0x25')](_0xb12c79,_0x31cba8,!![]);}catch(_0x58dae0){return BPromise[_0x55e0('0x26')](_0x58dae0);}return _0xb12c79['save']();};}function saveUpdates(_0x54dac5,_0xd25de6){return function(_0x3e0f5d){if(_0x3e0f5d){return _0x3e0f5d[_0x55e0('0x27')](_0x54dac5)[_0x55e0('0x28')](function(_0x2ac2ac){return _0x2ac2ac;});}return null;};}function removeEntity(_0x51e524,_0x19f208){return function(_0x392a02){if(_0x392a02){return _0x392a02[_0x55e0('0x29')]()[_0x55e0('0x28')](function(){_0x51e524[_0x55e0('0x1d')](0xcc)[_0x55e0('0x2a')]();});}};}function handleEntityNotFound(_0x3186d6,_0x5e6e42){return function(_0x5500f8){if(!_0x5500f8){_0x3186d6['sendStatus'](0x194);}return _0x5500f8;};}function handleError(_0x40c7bf,_0xe58b49){_0xe58b49=_0xe58b49||0x1f4;return function(_0x396834){logger[_0x55e0('0x2b')](_0x396834['stack']);if(_0x396834[_0x55e0('0x2c')]){delete _0x396834['name'];}_0x40c7bf[_0x55e0('0x1d')](_0xe58b49)[_0x55e0('0x2d')](_0x396834);};}exports[_0x55e0('0x2e')]=function(_0x484d75,_0x5eb2cf){var _0x4e9d90={},_0x1a889e={},_0x2901fc={'count':0x0,'rows':[]};var _0x5604b8=_[_0x55e0('0x2f')](db[_0x55e0('0x30')]['rawAttributes'],function(_0xaaf75f){return{'name':_0xaaf75f[_0x55e0('0x31')],'type':_0xaaf75f[_0x55e0('0x32')][_0x55e0('0x33')]};});_0x1a889e[_0x55e0('0x34')]=_[_0x55e0('0x2f')](_0x5604b8,_0x55e0('0x2c'));_0x1a889e['query']=_[_0x55e0('0x35')](_0x484d75[_0x55e0('0x36')]);_0x1a889e[_0x55e0('0x37')]=_['intersection'](_0x1a889e[_0x55e0('0x34')],_0x1a889e[_0x55e0('0x36')]);_0x4e9d90[_0x55e0('0x38')]=_[_0x55e0('0x39')](_0x1a889e[_0x55e0('0x34')],qs['fields'](_0x484d75['query'][_0x55e0('0x3a')]));_0x4e9d90['attributes']=_0x4e9d90['attributes']['length']?_0x4e9d90[_0x55e0('0x38')]:_0x1a889e[_0x55e0('0x34')];if(!_0x484d75[_0x55e0('0x36')][_0x55e0('0x3b')](_0x55e0('0x3c'))){_0x4e9d90[_0x55e0('0x1f')]=qs[_0x55e0('0x1f')](_0x484d75[_0x55e0('0x36')][_0x55e0('0x1f')]);_0x4e9d90[_0x55e0('0x1e')]=qs['offset'](_0x484d75['query'][_0x55e0('0x1e')]);}_0x4e9d90[_0x55e0('0x3d')]=qs[_0x55e0('0x3e')](_0x484d75[_0x55e0('0x36')][_0x55e0('0x3e')]);_0x4e9d90[_0x55e0('0x3f')]=qs['filters'](_[_0x55e0('0x40')](_0x484d75[_0x55e0('0x36')],_0x1a889e[_0x55e0('0x37')]),_0x5604b8);if(_0x484d75[_0x55e0('0x36')][_0x55e0('0x41')]){_0x4e9d90[_0x55e0('0x3f')]=_[_0x55e0('0x42')](_0x4e9d90[_0x55e0('0x3f')],{'$or':_[_0x55e0('0x2f')](_0x5604b8,function(_0x1524db){if(_0x1524db[_0x55e0('0x32')]!==_0x55e0('0x43')){var _0x49aa5f={};_0x49aa5f[_0x1524db[_0x55e0('0x2c')]]={'$like':'%'+_0x484d75[_0x55e0('0x36')][_0x55e0('0x41')]+'%'};return _0x49aa5f;}})});}_0x4e9d90=_[_0x55e0('0x42')]({},_0x4e9d90,_0x484d75[_0x55e0('0x44')]);var _0xcf17={'where':_0x4e9d90[_0x55e0('0x3f')]};return db['FaxTransferReport'][_0x55e0('0x21')](_0xcf17)[_0x55e0('0x28')](function(_0xedae21){_0x2901fc[_0x55e0('0x21')]=_0xedae21;if(_0x484d75[_0x55e0('0x36')][_0x55e0('0x45')]){_0x4e9d90[_0x55e0('0x46')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x55e0('0x47')](_0x4e9d90);})['then'](function(_0x30045){_0x2901fc[_0x55e0('0x48')]=_0x30045;return _0x2901fc;})[_0x55e0('0x28')](respondWithFilteredResult(_0x5eb2cf,_0x4e9d90))['catch'](handleError(_0x5eb2cf,null));};exports['show']=function(_0x228522,_0x32ab1d){var _0x3f5869={'raw':!![],'where':{'id':_0x228522[_0x55e0('0x49')]['id']}},_0x44a31b={};_0x44a31b[_0x55e0('0x34')]=_['keys'](db[_0x55e0('0x30')][_0x55e0('0x4a')]);_0x44a31b[_0x55e0('0x36')]=_['keys'](_0x228522[_0x55e0('0x36')]);_0x44a31b[_0x55e0('0x37')]=_[_0x55e0('0x39')](_0x44a31b['model'],_0x44a31b[_0x55e0('0x36')]);_0x3f5869['attributes']=_[_0x55e0('0x39')](_0x44a31b[_0x55e0('0x34')],qs['fields'](_0x228522['query']['fields']));_0x3f5869[_0x55e0('0x38')]=_0x3f5869[_0x55e0('0x38')]['length']?_0x3f5869[_0x55e0('0x38')]:_0x44a31b['model'];if(_0x228522[_0x55e0('0x36')][_0x55e0('0x45')]){_0x3f5869[_0x55e0('0x46')]=[{'all':!![]}];}_0x3f5869=_[_0x55e0('0x42')]({},_0x3f5869,_0x228522[_0x55e0('0x44')]);return db[_0x55e0('0x30')][_0x55e0('0x4b')](_0x3f5869)[_0x55e0('0x28')](handleEntityNotFound(_0x32ab1d,null))[_0x55e0('0x28')](respondWithResult(_0x32ab1d,null))[_0x55e0('0x4c')](handleError(_0x32ab1d,null));};exports[_0x55e0('0x4d')]=function(_0x18176d,_0x42b2ea){return db[_0x55e0('0x30')][_0x55e0('0x4d')](_0x18176d[_0x55e0('0x4e')],{})['then'](respondWithResult(_0x42b2ea,0xc9))[_0x55e0('0x4c')](handleError(_0x42b2ea,null));};exports[_0x55e0('0x27')]=function(_0x5b3b1f,_0x25dcad){if(_0x5b3b1f[_0x55e0('0x4e')]['id']){delete _0x5b3b1f[_0x55e0('0x4e')]['id'];}return db[_0x55e0('0x30')][_0x55e0('0x4b')]({'where':{'id':_0x5b3b1f[_0x55e0('0x49')]['id']}})['then'](handleEntityNotFound(_0x25dcad,null))[_0x55e0('0x28')](saveUpdates(_0x5b3b1f[_0x55e0('0x4e')],null))[_0x55e0('0x28')](respondWithResult(_0x25dcad,null))[_0x55e0('0x4c')](handleError(_0x25dcad,null));};exports[_0x55e0('0x29')]=function(_0x3d5822,_0x38ed86){return db[_0x55e0('0x30')][_0x55e0('0x4b')]({'where':{'id':_0x3d5822['params']['id']}})['then'](handleEntityNotFound(_0x38ed86,null))['then'](removeEntity(_0x38ed86,null))[_0x55e0('0x4c')](handleError(_0x38ed86,null));};exports[_0x55e0('0x4f')]=function(_0x49aff9,_0x91aa1c){return db['FaxTransferReport'][_0x55e0('0x4f')]()[_0x55e0('0x28')](respondWithResult(_0x91aa1c,null))[_0x55e0('0x4c')](handleError(_0x91aa1c,null));};
\ No newline at end of file
index fcd3c8b..bf01fe0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac9a=['../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0xc1c067,_0xdbe378){var _0x183002=function(_0x5a1158){while(--_0x5a1158){_0xc1c067['push'](_0xc1c067['shift']());}};_0x183002(++_0xdbe378);}(_0xac9a,0x131));var _0xaac9=function(_0x21647f,_0x3b766f){_0x21647f=_0x21647f-0x0;var _0x16319a=_0xac9a[_0x21647f];return _0x16319a;};'use strict';var _=require(_0xaac9('0x0'));var util=require(_0xaac9('0x1'));var logger=require(_0xaac9('0x2'))(_0xaac9('0x3'));var moment=require('moment');var BPromise=require(_0xaac9('0x4'));var rp=require(_0xaac9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaac9('0x6'));var config=require(_0xaac9('0x7'));var attributes=require(_0xaac9('0x8'));module[_0xaac9('0x9')]=function(_0xe52744,_0x5bce73){return _0xe52744[_0xaac9('0xa')](_0xaac9('0xb'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xaac9('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x13c4=['FaxTransferReport','report_fax_transfer','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./faxTransferReport.attributes','exports','define'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x13c4,0x121));var _0x413c=function(_0x5e1106,_0x205781){_0x5e1106=_0x5e1106-0x0;var _0x1d84b5=_0x13c4[_0x5e1106];return _0x1d84b5;};'use strict';var _=require('lodash');var util=require(_0x413c('0x0'));var logger=require(_0x413c('0x1'))('api');var moment=require(_0x413c('0x2'));var BPromise=require(_0x413c('0x3'));var rp=require(_0x413c('0x4'));var fs=require('fs');var path=require(_0x413c('0x5'));var rimraf=require('rimraf');var config=require(_0x413c('0x6'));var attributes=require(_0x413c('0x7'));module[_0x413c('0x8')]=function(_0x2a3c20,_0x3de37a){return _0x2a3c20[_0x413c('0x9')](_0x413c('0xa'),attributes,{'tableName':_0x413c('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x413c('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 00e4098..94a49d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad83=['result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xad83,0x7a));var _0x3ad8=function(_0x38a52b,_0x4021e6){_0x38a52b=_0x38a52b-0x0;var _0x16f000=_0xad83[_0x38a52b];return _0x16f000;};'use strict';var _=require('lodash');var util=require(_0x3ad8('0x0'));var moment=require(_0x3ad8('0x1'));var BPromise=require(_0x3ad8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ad8('0x3'))['db'];var utils=require(_0x3ad8('0x4'));var logger=require(_0x3ad8('0x5'))(_0x3ad8('0x6'));var config=require(_0x3ad8('0x7'));var jayson=require(_0x3ad8('0x8'));var client=jayson[_0x3ad8('0x9')][_0x3ad8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x261c25,_0x51821d,_0x56d192){return new BPromise(function(_0x3ee12b,_0x2480e5){return client[_0x3ad8('0xb')](_0x261c25,_0x56d192)[_0x3ad8('0xc')](function(_0x493f00){logger[_0x3ad8('0xd')](_0x3ad8('0xe'),_0x51821d,_0x3ad8('0xf'));logger[_0x3ad8('0x10')](_0x3ad8('0x11'),_0x51821d,_0x3ad8('0xf'),JSON[_0x3ad8('0x12')](_0x493f00));if(_0x493f00[_0x3ad8('0x13')]){if(_0x493f00[_0x3ad8('0x13')][_0x3ad8('0x14')]===0x1f4){logger[_0x3ad8('0x13')](_0x3ad8('0xe'),_0x51821d,_0x493f00['error'][_0x3ad8('0x15')]);return _0x2480e5(_0x493f00[_0x3ad8('0x13')][_0x3ad8('0x15')]);}logger['error'](_0x3ad8('0xe'),_0x51821d,_0x493f00[_0x3ad8('0x13')]['message']);return _0x3ee12b(_0x493f00[_0x3ad8('0x13')][_0x3ad8('0x15')]);}else{logger[_0x3ad8('0xd')](_0x3ad8('0xe'),_0x51821d,'request\x20sent');_0x3ee12b(_0x493f00[_0x3ad8('0x16')][_0x3ad8('0x15')]);}})[_0x3ad8('0x17')](function(_0x465540){logger[_0x3ad8('0x13')](_0x3ad8('0xe'),_0x51821d,_0x465540);_0x2480e5(_0x465540);});});}
\ No newline at end of file
+var _0x6a09=['client','http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x3915e4,_0x533bec){var _0x5cfd4a=function(_0x5942d8){while(--_0x5942d8){_0x3915e4['push'](_0x3915e4['shift']());}};_0x5cfd4a(++_0x533bec);}(_0x6a09,0xd4));var _0x96a0=function(_0x15035b,_0x3eba0a){_0x15035b=_0x15035b-0x0;var _0x2cc7b1=_0x6a09[_0x15035b];return _0x2cc7b1;};'use strict';var _=require(_0x96a0('0x0'));var util=require(_0x96a0('0x1'));var moment=require('moment');var BPromise=require(_0x96a0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x96a0('0x3'));var db=require(_0x96a0('0x4'))['db'];var utils=require(_0x96a0('0x5'));var logger=require(_0x96a0('0x6'))('rpc');var config=require(_0x96a0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x96a0('0x8')][_0x96a0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1426d0,_0x5f099e,_0x263aa9){return new BPromise(function(_0x533047,_0x232051){return client[_0x96a0('0xa')](_0x1426d0,_0x263aa9)[_0x96a0('0xb')](function(_0x5b54e8){logger['info'](_0x96a0('0xc'),_0x5f099e,_0x96a0('0xd'));logger['debug']('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x5f099e,'request\x20sent',JSON[_0x96a0('0xe')](_0x5b54e8));if(_0x5b54e8[_0x96a0('0xf')]){if(_0x5b54e8['error'][_0x96a0('0x10')]===0x1f4){logger[_0x96a0('0xf')](_0x96a0('0xc'),_0x5f099e,_0x5b54e8['error'][_0x96a0('0x11')]);return _0x232051(_0x5b54e8[_0x96a0('0xf')][_0x96a0('0x11')]);}logger[_0x96a0('0xf')](_0x96a0('0xc'),_0x5f099e,_0x5b54e8['error'][_0x96a0('0x11')]);return _0x533047(_0x5b54e8[_0x96a0('0xf')]['message']);}else{logger['info'](_0x96a0('0xc'),_0x5f099e,_0x96a0('0xd'));_0x533047(_0x5b54e8[_0x96a0('0x12')][_0x96a0('0x11')]);}})[_0x96a0('0x13')](function(_0x1bbb6a){logger['error'](_0x96a0('0xc'),_0x5f099e,_0x1bbb6a);_0x232051(_0x1bbb6a);});});}
\ No newline at end of file
index 59bfa23..b2ee2b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x65f6=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x10d61a,_0x5890d8){var _0x590c38=function(_0x4048d2){while(--_0x4048d2){_0x10d61a['push'](_0x10d61a['shift']());}};_0x590c38(++_0x5890d8);}(_0x65f6,0xd5));var _0x665f=function(_0x83ba9a,_0x49fc6d){_0x83ba9a=_0x83ba9a-0x0;var _0x3b7e93=_0x65f6[_0x83ba9a];return _0x3b7e93;};'use strict';var multer=require(_0x665f('0x0'));var util=require(_0x665f('0x1'));var path=require(_0x665f('0x2'));var timeout=require(_0x665f('0x3'));var express=require(_0x665f('0x4'));var router=express[_0x665f('0x5')]();var fs_extra=require(_0x665f('0x6'));var auth=require(_0x665f('0x7'));var interaction=require(_0x665f('0x8'));var config=require(_0x665f('0x9'));var controller=require('./faxTransferReport.controller');router[_0x665f('0xa')]('/',auth[_0x665f('0xb')](),controller[_0x665f('0xc')]);router['get'](_0x665f('0xd'),auth[_0x665f('0xb')](),controller[_0x665f('0xe')]);router[_0x665f('0xa')](_0x665f('0xf'),auth[_0x665f('0xb')](),controller[_0x665f('0x10')]);router[_0x665f('0x11')]('/',auth['isAuthenticated'](),controller[_0x665f('0x12')]);router[_0x665f('0x13')](_0x665f('0xf'),auth[_0x665f('0xb')](),controller[_0x665f('0x14')]);router['delete'](_0x665f('0xf'),auth[_0x665f('0xb')](),controller[_0x665f('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x796b=['./faxTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x1eb8c7,_0x25650e){var _0x101b23=function(_0x93eafa){while(--_0x93eafa){_0x1eb8c7['push'](_0x1eb8c7['shift']());}};_0x101b23(++_0x25650e);}(_0x796b,0x98));var _0xb796=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x796b[_0x34bc30];return _0x5706de;};'use strict';var multer=require(_0xb796('0x0'));var util=require(_0xb796('0x1'));var path=require(_0xb796('0x2'));var timeout=require(_0xb796('0x3'));var express=require(_0xb796('0x4'));var router=express[_0xb796('0x5')]();var fs_extra=require(_0xb796('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb796('0x7'));var controller=require(_0xb796('0x8'));router[_0xb796('0x9')]('/',auth[_0xb796('0xa')](),controller[_0xb796('0xb')]);router[_0xb796('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xb796('0xc')]);router[_0xb796('0x9')](_0xb796('0xd'),auth[_0xb796('0xa')](),controller[_0xb796('0xe')]);router[_0xb796('0xf')]('/',auth[_0xb796('0xa')](),controller['create']);router[_0xb796('0x10')]('/:id',auth[_0xb796('0xa')](),controller[_0xb796('0x11')]);router['delete']('/:id',auth[_0xb796('0xa')](),controller[_0xb796('0x12')]);module[_0xb796('0x13')]=router;
\ No newline at end of file
index c4a9cf1..f764b93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46fc=['post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','connect-timeout','express','Router','fs-extra','./intDeskAccount.controller','isAuthenticated','index','get','/:id','getFields'];(function(_0x543795,_0x41c078){var _0x18824d=function(_0x4f8819){while(--_0x4f8819){_0x543795['push'](_0x543795['shift']());}};_0x18824d(++_0x41c078);}(_0x46fc,0x74));var _0xc46f=function(_0x369829,_0x5149ad){_0x369829=_0x369829-0x0;var _0xb9c603=_0x46fc[_0x369829];return _0xb9c603;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xc46f('0x0'));var express=require(_0xc46f('0x1'));var router=express[_0xc46f('0x2')]();var fs_extra=require(_0xc46f('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc46f('0x4'));router['get']('/',auth[_0xc46f('0x5')](),controller[_0xc46f('0x6')]);router[_0xc46f('0x7')](_0xc46f('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xc46f('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0xc46f('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc46f('0x9')]);router[_0xc46f('0xa')]('/',auth[_0xc46f('0x5')](),controller[_0xc46f('0xb')]);router[_0xc46f('0xa')](_0xc46f('0xc'),auth['isAuthenticated'](),controller[_0xc46f('0xd')]);router[_0xc46f('0xe')](_0xc46f('0x8'),auth[_0xc46f('0x5')](),controller[_0xc46f('0xf')]);router[_0xc46f('0x10')](_0xc46f('0x8'),auth[_0xc46f('0x5')](),controller[_0xc46f('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x0a29=['create','put','delete','destroy','exports','multer','util','Router','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','getFields','post'];(function(_0x13a9bf,_0x33c7ee){var _0x345b65=function(_0x6bc353){while(--_0x6bc353){_0x13a9bf['push'](_0x13a9bf['shift']());}};_0x345b65(++_0x33c7ee);}(_0x0a29,0x1f4));var _0x90a2=function(_0x2fa661,_0x5a69e9){_0x2fa661=_0x2fa661-0x0;var _0x113676=_0x0a29[_0x2fa661];return _0x113676;};'use strict';var multer=require(_0x90a2('0x0'));var util=require(_0x90a2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x90a2('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDeskAccount.controller');router[_0x90a2('0x3')]('/',auth[_0x90a2('0x4')](),controller['index']);router[_0x90a2('0x3')](_0x90a2('0x5'),auth[_0x90a2('0x4')](),controller['show']);router[_0x90a2('0x3')](_0x90a2('0x6'),auth['isAuthenticated'](),controller[_0x90a2('0x7')]);router[_0x90a2('0x3')]('/:id/fields',auth['isAuthenticated'](),controller[_0x90a2('0x8')]);router[_0x90a2('0x9')]('/',auth['isAuthenticated'](),controller[_0x90a2('0xa')]);router[_0x90a2('0x9')]('/:id/configurations',auth[_0x90a2('0x4')](),controller['addConfiguration']);router[_0x90a2('0xb')](_0x90a2('0x5'),auth[_0x90a2('0x4')](),controller['update']);router[_0x90a2('0xc')](_0x90a2('0x5'),auth['isAuthenticated'](),controller[_0x90a2('0xd')]);module[_0x90a2('0xe')]=router;
\ No newline at end of file
index 80bfd3a..bc17902 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9165=['basic','integrationTab','newTab','exports','STRING','ENUM'];(function(_0x313c96,_0x3cee6e){var _0x522f53=function(_0x8961e){while(--_0x8961e){_0x313c96['push'](_0x313c96['shift']());}};_0x522f53(++_0x3cee6e);}(_0x9165,0x10b));var _0x5916=function(_0x14cbf0,_0x251be3){_0x14cbf0=_0x14cbf0-0x0;var _0x5405c1=_0x9165[_0x14cbf0];return _0x5405c1;};'use strict';var Sequelize=require('sequelize');module[_0x5916('0x0')]={'name':{'type':Sequelize[_0x5916('0x1')]},'description':{'type':Sequelize[_0x5916('0x1')]},'username':{'type':Sequelize[_0x5916('0x1')]},'remoteUri':{'type':Sequelize[_0x5916('0x1')]},'authType':{'type':Sequelize[_0x5916('0x2')](_0x5916('0x3')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x5916('0x1')]},'consumerKey':{'type':Sequelize[_0x5916('0x1')]},'consumerSecret':{'type':Sequelize[_0x5916('0x1')]},'token':{'type':Sequelize[_0x5916('0x1')]},'tokenSecret':{'type':Sequelize[_0x5916('0x1')]},'serverUrl':{'type':Sequelize[_0x5916('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x5916('0x2')](_0x5916('0x4'),_0x5916('0x5')),'defaultValue':_0x5916('0x4')}};
\ No newline at end of file
+var _0x8e14=['exports','STRING','basic','ENUM','integrationTab'];(function(_0x219281,_0x124d18){var _0xc2f622=function(_0x226ea6){while(--_0x226ea6){_0x219281['push'](_0x219281['shift']());}};_0xc2f622(++_0x124d18);}(_0x8e14,0xd2));var _0x48e1=function(_0x3793b1,_0x4acec2){_0x3793b1=_0x3793b1-0x0;var _0x14b5f2=_0x8e14[_0x3793b1];return _0x14b5f2;};'use strict';var Sequelize=require('sequelize');module[_0x48e1('0x0')]={'name':{'type':Sequelize[_0x48e1('0x1')]},'description':{'type':Sequelize[_0x48e1('0x1')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x48e1('0x1')]},'authType':{'type':Sequelize['ENUM'](_0x48e1('0x2')),'defaultValue':_0x48e1('0x2')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x48e1('0x1')]},'token':{'type':Sequelize[_0x48e1('0x1')]},'tokenSecret':{'type':Sequelize[_0x48e1('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x48e1('0x3')](_0x48e1('0x4'),'newTab'),'defaultValue':_0x48e1('0x4')}};
\ No newline at end of file
index c54e04b..971826e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa89e=['sox','to-csv','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','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','limit','set','Content-Range','apply','reject','save','destroy','then','error','stack','index','map','DeskAccount','rawAttributes','fieldName','type','key','name','query','keys','filters','model','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','create','body','find','params','getConfigurations','findOne','DeskConfiguration','length','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','DeskField','priority','authType','username','password','consumerKey','consumerSecret','remoteUri','slice','substring','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Authorization','%s:%s','toString','concat','_embedded','active','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path'];(function(_0x21691a,_0x3e3351){var _0x744ba6=function(_0x1aa423){while(--_0x1aa423){_0x21691a['push'](_0x21691a['shift']());}};_0x744ba6(++_0x3e3351);}(_0xa89e,0x156));var _0xea89=function(_0x16cff5,_0x291c69){_0x16cff5=_0x16cff5-0x0;var _0x5d377c=_0xa89e[_0x16cff5];return _0x5d377c;};'use strict';var emlformat=require(_0xea89('0x0'));var rimraf=require(_0xea89('0x1'));var zipdir=require(_0xea89('0x2'));var jsonpatch=require(_0xea89('0x3'));var rp=require('request-promise');var moment=require(_0xea89('0x4'));var BPromise=require(_0xea89('0x5'));var Mustache=require(_0xea89('0x6'));var util=require(_0xea89('0x7'));var path=require(_0xea89('0x8'));var sox=require(_0xea89('0x9'));var csv=require(_0xea89('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xea89('0xb'));var squel=require(_0xea89('0xc'));var crypto=require(_0xea89('0xd'));var jsforce=require(_0xea89('0xe'));var deskjs=require(_0xea89('0xf'));var toCsv=require(_0xea89('0xa'));var querystring=require(_0xea89('0x10'));var Papa=require(_0xea89('0x11'));var Redis=require(_0xea89('0x12'));var authService=require(_0xea89('0x13'));var qs=require(_0xea89('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xea89('0x15'));var logger=require(_0xea89('0x16'))(_0xea89('0x17'));var utils=require(_0xea89('0x18'));var config=require(_0xea89('0x19'));var licenseUtil=require(_0xea89('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require(_0xea89('0x1b'));function respondWithStatusCode(_0x2e145c,_0x1210ef){_0x1210ef=_0x1210ef||0xcc;return function(_0x3cde04){if(_0x3cde04){return _0x2e145c[_0xea89('0x1c')](_0x1210ef);}return _0x2e145c['status'](_0x1210ef)[_0xea89('0x1d')]();};}function respondWithResult(_0x2b6bce,_0x1e35e8){_0x1e35e8=_0x1e35e8||0xc8;return function(_0x24e0d8){if(_0x24e0d8){return _0x2b6bce[_0xea89('0x1e')](_0x1e35e8)['json'](_0x24e0d8);}};}function respondWithFilteredResult(_0x432392,_0x2acb78){return function(_0x363269){if(_0x363269){var _0x26dc41=typeof _0x2acb78[_0xea89('0x1f')]===_0xea89('0x20')&&typeof _0x2acb78[_0xea89('0x21')]===_0xea89('0x20');var _0x4b2500=_0x363269['count'];var _0x25f2dc=_0x26dc41?0x0:_0x2acb78[_0xea89('0x1f')];var _0x550005=_0x26dc41?_0x363269['count']:_0x2acb78[_0xea89('0x1f')]+_0x2acb78[_0xea89('0x21')];var _0x205d11;if(_0x550005>=_0x4b2500){_0x550005=_0x4b2500;_0x205d11=0xc8;}else{_0x205d11=0xce;}_0x432392[_0xea89('0x1e')](_0x205d11);return _0x432392[_0xea89('0x22')](_0xea89('0x23'),_0x25f2dc+'-'+_0x550005+'/'+_0x4b2500)['json'](_0x363269);}return null;};}function patchUpdates(_0x393034){return function(_0x38640b){try{jsonpatch[_0xea89('0x24')](_0x38640b,_0x393034,!![]);}catch(_0x3ef5a0){return BPromise[_0xea89('0x25')](_0x3ef5a0);}return _0x38640b[_0xea89('0x26')]();};}function saveUpdates(_0x439cc6,_0x14308d){return function(_0x5203ad){if(_0x5203ad){return _0x5203ad['update'](_0x439cc6)['then'](function(_0x2b88ef){return _0x2b88ef;});}return null;};}function removeEntity(_0x59463b,_0x5e2b23){return function(_0x585460){if(_0x585460){return _0x585460[_0xea89('0x27')]()[_0xea89('0x28')](function(){_0x59463b[_0xea89('0x1e')](0xcc)[_0xea89('0x1d')]();});}};}function handleEntityNotFound(_0x4d0983,_0x5f06c0){return function(_0x489989){if(!_0x489989){_0x4d0983[_0xea89('0x1c')](0x194);}return _0x489989;};}function handleError(_0x5aaa59,_0xa77a90){_0xa77a90=_0xa77a90||0x1f4;return function(_0x5b1ee8){logger[_0xea89('0x29')](_0x5b1ee8[_0xea89('0x2a')]);if(_0x5b1ee8['name']){delete _0x5b1ee8['name'];}_0x5aaa59[_0xea89('0x1e')](_0xa77a90)['send'](_0x5b1ee8);};}exports[_0xea89('0x2b')]=function(_0x4aef27,_0x3b5b09){var _0x21976e={},_0x4e18d8={},_0x35ae97={'count':0x0,'rows':[]};var _0x4e1146=_[_0xea89('0x2c')](db[_0xea89('0x2d')][_0xea89('0x2e')],function(_0x21110c){return{'name':_0x21110c[_0xea89('0x2f')],'type':_0x21110c[_0xea89('0x30')][_0xea89('0x31')]};});_0x4e18d8['model']=_[_0xea89('0x2c')](_0x4e1146,_0xea89('0x32'));_0x4e18d8[_0xea89('0x33')]=_[_0xea89('0x34')](_0x4aef27[_0xea89('0x33')]);_0x4e18d8[_0xea89('0x35')]=_['intersection'](_0x4e18d8[_0xea89('0x36')],_0x4e18d8['query']);_0x21976e[_0xea89('0x37')]=_[_0xea89('0x38')](_0x4e18d8[_0xea89('0x36')],qs[_0xea89('0x39')](_0x4aef27[_0xea89('0x33')][_0xea89('0x39')]));_0x21976e[_0xea89('0x37')]=_0x21976e[_0xea89('0x37')]['length']?_0x21976e[_0xea89('0x37')]:_0x4e18d8[_0xea89('0x36')];if(!_0x4aef27['query']['hasOwnProperty'](_0xea89('0x3a'))){_0x21976e[_0xea89('0x21')]=qs[_0xea89('0x21')](_0x4aef27[_0xea89('0x33')]['limit']);_0x21976e[_0xea89('0x1f')]=qs['offset'](_0x4aef27[_0xea89('0x33')][_0xea89('0x1f')]);}_0x21976e[_0xea89('0x3b')]=qs[_0xea89('0x3c')](_0x4aef27[_0xea89('0x33')][_0xea89('0x3c')]);_0x21976e[_0xea89('0x3d')]=qs[_0xea89('0x35')](_[_0xea89('0x3e')](_0x4aef27[_0xea89('0x33')],_0x4e18d8[_0xea89('0x35')]),_0x4e1146);if(_0x4aef27['query'][_0xea89('0x3f')]){_0x21976e[_0xea89('0x3d')]=_[_0xea89('0x40')](_0x21976e[_0xea89('0x3d')],{'$or':_[_0xea89('0x2c')](_0x4e1146,function(_0x5871f){if(_0x5871f[_0xea89('0x30')]!==_0xea89('0x41')){var _0x5381c7={};_0x5381c7[_0x5871f[_0xea89('0x32')]]={'$like':'%'+_0x4aef27[_0xea89('0x33')][_0xea89('0x3f')]+'%'};return _0x5381c7;}})});}_0x21976e=_[_0xea89('0x40')]({},_0x21976e,_0x4aef27[_0xea89('0x42')]);var _0x29ea1e={'where':_0x21976e[_0xea89('0x3d')]};return db['DeskAccount']['count'](_0x29ea1e)[_0xea89('0x28')](function(_0x17214d){_0x35ae97[_0xea89('0x43')]=_0x17214d;if(_0x4aef27[_0xea89('0x33')][_0xea89('0x44')]){_0x21976e[_0xea89('0x45')]=[{'all':!![]}];}return db[_0xea89('0x2d')][_0xea89('0x46')](_0x21976e);})[_0xea89('0x28')](function(_0xd65164){_0x35ae97[_0xea89('0x47')]=_0xd65164;return _0x35ae97;})[_0xea89('0x28')](respondWithFilteredResult(_0x3b5b09,_0x21976e))[_0xea89('0x48')](handleError(_0x3b5b09,null));};exports[_0xea89('0x49')]=function(_0x47491b,_0x7b9714){var _0x41f637={'raw':![],'where':{'id':_0x47491b['params']['id']}},_0x2c73b5={};_0x2c73b5[_0xea89('0x36')]=_[_0xea89('0x34')](db[_0xea89('0x2d')][_0xea89('0x2e')]);_0x2c73b5[_0xea89('0x33')]=_[_0xea89('0x34')](_0x47491b[_0xea89('0x33')]);_0x2c73b5[_0xea89('0x35')]=_[_0xea89('0x38')](_0x2c73b5[_0xea89('0x36')],_0x2c73b5['query']);_0x41f637[_0xea89('0x37')]=_[_0xea89('0x38')](_0x2c73b5[_0xea89('0x36')],qs[_0xea89('0x39')](_0x47491b[_0xea89('0x33')][_0xea89('0x39')]));_0x41f637[_0xea89('0x37')]=_0x41f637['attributes']['length']?_0x41f637['attributes']:_0x2c73b5['model'];if(_0x47491b[_0xea89('0x33')]['includeAll']){_0x41f637[_0xea89('0x45')]=[{'all':!![]}];}_0x41f637=_[_0xea89('0x40')]({},_0x41f637,_0x47491b[_0xea89('0x42')]);return db['DeskAccount']['find'](_0x41f637)[_0xea89('0x28')](handleEntityNotFound(_0x7b9714,null))[_0xea89('0x28')](respondWithResult(_0x7b9714,null))[_0xea89('0x48')](handleError(_0x7b9714,null));};exports[_0xea89('0x4a')]=function(_0x1bd499,_0x491ebd){return db[_0xea89('0x2d')][_0xea89('0x4a')](_0x1bd499[_0xea89('0x4b')],{})[_0xea89('0x28')](respondWithResult(_0x491ebd,0xc9))['catch'](handleError(_0x491ebd,null));};exports['update']=function(_0x579581,_0x2b1329){if(_0x579581[_0xea89('0x4b')]['id']){delete _0x579581[_0xea89('0x4b')]['id'];}return db[_0xea89('0x2d')]['find']({'where':{'id':_0x579581['params']['id']}})['then'](handleEntityNotFound(_0x2b1329,null))['then'](saveUpdates(_0x579581[_0xea89('0x4b')],null))[_0xea89('0x28')](respondWithResult(_0x2b1329,null))[_0xea89('0x48')](handleError(_0x2b1329,null));};exports['destroy']=function(_0x55368a,_0x1cf98d){return db[_0xea89('0x2d')][_0xea89('0x4c')]({'where':{'id':_0x55368a[_0xea89('0x4d')]['id']}})[_0xea89('0x28')](handleEntityNotFound(_0x1cf98d,null))[_0xea89('0x28')](removeEntity(_0x1cf98d,null))[_0xea89('0x48')](handleError(_0x1cf98d,null));};exports[_0xea89('0x4e')]=function(_0xa31169,_0x193229,_0x48d069){var _0x45726c={};var _0x578f5a={};var _0x1971f8;var _0x531dfb;return db[_0xea89('0x2d')][_0xea89('0x4f')]({'where':{'id':_0xa31169[_0xea89('0x4d')]['id']}})[_0xea89('0x28')](handleEntityNotFound(_0x193229,null))[_0xea89('0x28')](function(_0x1303f1){if(_0x1303f1){_0x1971f8=_0x1303f1;_0x578f5a[_0xea89('0x36')]=_[_0xea89('0x34')](db[_0xea89('0x50')][_0xea89('0x2e')]);_0x578f5a[_0xea89('0x33')]=_[_0xea89('0x34')](_0xa31169['query']);_0x578f5a[_0xea89('0x35')]=_['intersection'](_0x578f5a[_0xea89('0x36')],_0x578f5a[_0xea89('0x33')]);_0x45726c[_0xea89('0x37')]=_[_0xea89('0x38')](_0x578f5a[_0xea89('0x36')],qs[_0xea89('0x39')](_0xa31169[_0xea89('0x33')][_0xea89('0x39')]));_0x45726c['attributes']=_0x45726c[_0xea89('0x37')]['length']?_0x45726c[_0xea89('0x37')]:_0x578f5a[_0xea89('0x36')];_0x45726c['order']=qs['sort'](_0xa31169['query'][_0xea89('0x3c')]);_0x45726c[_0xea89('0x3d')]=qs[_0xea89('0x35')](_[_0xea89('0x3e')](_0xa31169[_0xea89('0x33')],_0x578f5a['filters']));if(_0xa31169['query'][_0xea89('0x3f')]){_0x45726c[_0xea89('0x3d')]=_[_0xea89('0x40')](_0x45726c[_0xea89('0x3d')],{'$or':_[_0xea89('0x2c')](_0x45726c[_0xea89('0x37')],function(_0x70b503){var _0x1d0d6e={};_0x1d0d6e[_0x70b503]={'$like':'%'+_0xa31169[_0xea89('0x33')][_0xea89('0x3f')]+'%'};return _0x1d0d6e;})});}_0x45726c=_['merge']({},_0x45726c,_0xa31169['options']);return _0x1971f8[_0xea89('0x4e')](_0x45726c);}})['then'](function(_0x2fcfb9){if(_0x2fcfb9){_0x531dfb=_0x2fcfb9[_0xea89('0x51')];if(!_0xa31169[_0xea89('0x33')][_0xea89('0x52')](_0xea89('0x3a'))){_0x45726c[_0xea89('0x21')]=qs[_0xea89('0x21')](_0xa31169[_0xea89('0x33')][_0xea89('0x21')]);_0x45726c[_0xea89('0x1f')]=qs[_0xea89('0x1f')](_0xa31169[_0xea89('0x33')]['offset']);}return _0x1971f8[_0xea89('0x4e')](_0x45726c);}})[_0xea89('0x28')](function(_0x3e6243){if(_0x3e6243){return _0x3e6243?{'count':_0x531dfb,'rows':_0x3e6243}:null;}})[_0xea89('0x28')](respondWithResult(_0x193229,null))[_0xea89('0x48')](handleError(_0x193229,null));};exports[_0xea89('0x53')]=function(_0xbce1f5,_0x23fa58,_0xa7ef1a){if(_0xbce1f5['body']['id']){delete _0xbce1f5[_0xea89('0x4b')]['id'];}return db[_0xea89('0x2d')][_0xea89('0x4f')]({'where':{'id':_0xbce1f5[_0xea89('0x4d')]['id']}})[_0xea89('0x28')](handleEntityNotFound(_0x23fa58,null))[_0xea89('0x28')](function(_0x230196){if(_0x230196){_0xbce1f5[_0xea89('0x4b')][_0xea89('0x54')]=_0x230196['id'];_0xbce1f5[_0xea89('0x4b')][_0xea89('0x55')]=integrations[_0xea89('0x56')](_0xbce1f5['body']['channel'],_0xbce1f5[_0xea89('0x4b')][_0xea89('0x30')]);_0xbce1f5[_0xea89('0x4b')][_0xea89('0x57')]=integrations[_0xea89('0x58')](_0xbce1f5[_0xea89('0x4b')]['channel'],_0xbce1f5['body'][_0xea89('0x30')]);return db[_0xea89('0x50')][_0xea89('0x4a')](_0xbce1f5['body'],{'include':[{'model':db[_0xea89('0x59')],'as':_0xea89('0x55')},{'model':db[_0xea89('0x59')],'as':_0xea89('0x57')}]});}return null;})[_0xea89('0x28')](respondWithResult(_0x23fa58,null))[_0xea89('0x48')](handleError(_0x23fa58,null));};exports['getFields']=function(_0x107d4e,_0x402a2d,_0x204213){var _0x284447=[{'name':_0xea89('0x5a'),'label':_0xea89('0x5a'),'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 _0x38f546='';return db[_0xea89('0x2d')][_0xea89('0x4f')]({'where':{'id':_0x107d4e[_0xea89('0x4d')]['id']},'attributes':['id','remoteUri',_0xea89('0x5b'),_0xea89('0x5c'),_0xea89('0x5d'),_0xea89('0x5e'),_0xea89('0x5f'),'token','tokenSecret']})[_0xea89('0x28')](handleEntityNotFound(_0x402a2d,null))[_0xea89('0x28')](function(_0x342a8e){if(_0x342a8e){_0x38f546=_0x342a8e[_0xea89('0x60')];var _0xdbd3e=_0x38f546[_0xea89('0x61')](-0x1);if(_0xdbd3e==='/'){_0x38f546=_0x38f546[_0xea89('0x62')](0x0,_0x38f546[_0xea89('0x63')](_0xdbd3e));}var _0x2d4dde={'method':'GET','uri':util[_0xea89('0x64')](_0xea89('0x65'),_0x38f546),'headers':{'Content-Type':_0xea89('0x66'),'Accept':'application/json'},'json':!![]};if(_0x342a8e['authType']===_0xea89('0x67')){_0x2d4dde[_0xea89('0x68')][_0xea89('0x69')]=util[_0xea89('0x64')]('Basic\x20%s',new Buffer(util['format'](_0xea89('0x6a'),_0x342a8e[_0xea89('0x5c')],_0x342a8e[_0xea89('0x5d')]))[_0xea89('0x6b')]('base64'));}return rp(_0x2d4dde)[_0xea89('0x28')](function(_0x53412d){return _0x284447[_0xea89('0x6c')](_['map'](_0x53412d[_0xea89('0x6d')]['entries'],function(_0x15ca3e){return{'id':_0x15ca3e[_0xea89('0x32')],'name':_0x15ca3e[_0xea89('0x32')],'type':_0x15ca3e['type'],'active':_0x15ca3e[_0xea89('0x6e')],'label':_0x15ca3e['label'],'custom':!![]};}));});}})[_0xea89('0x28')](function(_0x3aa7f4){return{'count':_0x3aa7f4[_0xea89('0x51')],'rows':_0x3aa7f4};})[_0xea89('0x28')](respondWithResult(_0x402a2d,null))[_0xea89('0x48')](function(_0x21ae51){var _0x1ecb2e=_0x107d4e['query']['test']?0x1f4:_0x21ae51[_0xea89('0x6f')]||0x1f4;logger[_0xea89('0x29')](_0xea89('0x70'),_0xea89('0x71'),_0x1ecb2e,JSON[_0xea89('0x72')](_0x21ae51));delete _0x21ae51[_0xea89('0x32')];if(_0x1ecb2e===0x191){_0x1ecb2e=0x190;}_0x402a2d[_0xea89('0x1e')](_0x1ecb2e)[_0xea89('0x73')](_0x107d4e['query']['test']?{'message':_0xea89('0x74'),'statusCode':_0x21ae51['statusCode']}:_0x21ae51);});};
\ No newline at end of file
+var _0x24b8=['rawAttributes','nolimit','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','username','password','consumerKey','consumerSecret','substring','lastIndexOf','GET','application/json','authType','basic','Authorization','format','%s:%s','toString','base64','concat','_embedded','active','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','end','error','stack','name','send','map','DeskAccount','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','then','includeAll','include','findAll','show','params','options','find','create','body','catch','getConfigurations','findOne','DeskConfiguration'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x24b8,0xfd));var _0x824b=function(_0xed0640,_0x57b209){_0xed0640=_0xed0640-0x0;var _0x3cf9db=_0x24b8[_0xed0640];return _0x3cf9db;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x824b('0x0'));var zipdir=require(_0x824b('0x1'));var jsonpatch=require(_0x824b('0x2'));var rp=require('request-promise');var moment=require(_0x824b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x824b('0x4'));var util=require(_0x824b('0x5'));var path=require(_0x824b('0x6'));var sox=require(_0x824b('0x7'));var csv=require(_0x824b('0x8'));var ejs=require(_0x824b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x824b('0xa'));var squel=require(_0x824b('0xb'));var crypto=require(_0x824b('0xc'));var jsforce=require(_0x824b('0xd'));var deskjs=require(_0x824b('0xe'));var toCsv=require(_0x824b('0x8'));var querystring=require(_0x824b('0xf'));var Papa=require(_0x824b('0x10'));var Redis=require('ioredis');var authService=require(_0x824b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x824b('0x12'));var hardwareService=require(_0x824b('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x824b('0x14'));var config=require(_0x824b('0x15'));var licenseUtil=require(_0x824b('0x16'));var db=require(_0x824b('0x17'))['db'];var integrations=require(_0x824b('0x18'));function respondWithStatusCode(_0x4a8d0b,_0x49b14b){_0x49b14b=_0x49b14b||0xcc;return function(_0x4ebcaf){if(_0x4ebcaf){return _0x4a8d0b[_0x824b('0x19')](_0x49b14b);}return _0x4a8d0b[_0x824b('0x1a')](_0x49b14b)['end']();};}function respondWithResult(_0x58e359,_0x432265){_0x432265=_0x432265||0xc8;return function(_0x5a5ad7){if(_0x5a5ad7){return _0x58e359[_0x824b('0x1a')](_0x432265)['json'](_0x5a5ad7);}};}function respondWithFilteredResult(_0x1ad39e,_0x4f6f14){return function(_0x42a6d9){if(_0x42a6d9){var _0x379c6b=typeof _0x4f6f14[_0x824b('0x1b')]===_0x824b('0x1c')&&typeof _0x4f6f14[_0x824b('0x1d')]==='undefined';var _0xd2d92f=_0x42a6d9['count'];var _0x551795=_0x379c6b?0x0:_0x4f6f14[_0x824b('0x1b')];var _0xfed62e=_0x379c6b?_0x42a6d9[_0x824b('0x1e')]:_0x4f6f14[_0x824b('0x1b')]+_0x4f6f14[_0x824b('0x1d')];var _0x4b8046;if(_0xfed62e>=_0xd2d92f){_0xfed62e=_0xd2d92f;_0x4b8046=0xc8;}else{_0x4b8046=0xce;}_0x1ad39e[_0x824b('0x1a')](_0x4b8046);return _0x1ad39e[_0x824b('0x1f')](_0x824b('0x20'),_0x551795+'-'+_0xfed62e+'/'+_0xd2d92f)[_0x824b('0x21')](_0x42a6d9);}return null;};}function patchUpdates(_0xd866ce){return function(_0x1ea82e){try{jsonpatch[_0x824b('0x22')](_0x1ea82e,_0xd866ce,!![]);}catch(_0xe7aba5){return BPromise[_0x824b('0x23')](_0xe7aba5);}return _0x1ea82e[_0x824b('0x24')]();};}function saveUpdates(_0x39dfdd,_0x1cae3e){return function(_0x5413b2){if(_0x5413b2){return _0x5413b2[_0x824b('0x25')](_0x39dfdd)['then'](function(_0x82a88c){return _0x82a88c;});}return null;};}function removeEntity(_0x8915ba,_0x23785b){return function(_0x521f3b){if(_0x521f3b){return _0x521f3b[_0x824b('0x26')]()['then'](function(){_0x8915ba[_0x824b('0x1a')](0xcc)[_0x824b('0x27')]();});}};}function handleEntityNotFound(_0x15969e,_0x129a29){return function(_0xe4d2f0){if(!_0xe4d2f0){_0x15969e[_0x824b('0x19')](0x194);}return _0xe4d2f0;};}function handleError(_0x32a212,_0x395c37){_0x395c37=_0x395c37||0x1f4;return function(_0x18a50f){logger[_0x824b('0x28')](_0x18a50f[_0x824b('0x29')]);if(_0x18a50f[_0x824b('0x2a')]){delete _0x18a50f[_0x824b('0x2a')];}_0x32a212[_0x824b('0x1a')](_0x395c37)[_0x824b('0x2b')](_0x18a50f);};}exports['index']=function(_0x2dbc1d,_0x242529){var _0x9cb5fe={},_0x26e733={},_0x4557f4={'count':0x0,'rows':[]};var _0x37b62e=_[_0x824b('0x2c')](db[_0x824b('0x2d')]['rawAttributes'],function(_0x310560){return{'name':_0x310560['fieldName'],'type':_0x310560[_0x824b('0x2e')][_0x824b('0x2f')]};});_0x26e733[_0x824b('0x30')]=_[_0x824b('0x2c')](_0x37b62e,_0x824b('0x2a'));_0x26e733[_0x824b('0x31')]=_[_0x824b('0x32')](_0x2dbc1d[_0x824b('0x31')]);_0x26e733[_0x824b('0x33')]=_[_0x824b('0x34')](_0x26e733[_0x824b('0x30')],_0x26e733[_0x824b('0x31')]);_0x9cb5fe[_0x824b('0x35')]=_[_0x824b('0x34')](_0x26e733[_0x824b('0x30')],qs[_0x824b('0x36')](_0x2dbc1d['query'][_0x824b('0x36')]));_0x9cb5fe[_0x824b('0x35')]=_0x9cb5fe[_0x824b('0x35')][_0x824b('0x37')]?_0x9cb5fe[_0x824b('0x35')]:_0x26e733['model'];if(!_0x2dbc1d[_0x824b('0x31')][_0x824b('0x38')]('nolimit')){_0x9cb5fe[_0x824b('0x1d')]=qs[_0x824b('0x1d')](_0x2dbc1d[_0x824b('0x31')]['limit']);_0x9cb5fe[_0x824b('0x1b')]=qs[_0x824b('0x1b')](_0x2dbc1d[_0x824b('0x31')][_0x824b('0x1b')]);}_0x9cb5fe[_0x824b('0x39')]=qs['sort'](_0x2dbc1d[_0x824b('0x31')][_0x824b('0x3a')]);_0x9cb5fe[_0x824b('0x3b')]=qs[_0x824b('0x33')](_[_0x824b('0x3c')](_0x2dbc1d[_0x824b('0x31')],_0x26e733['filters']),_0x37b62e);if(_0x2dbc1d[_0x824b('0x31')][_0x824b('0x3d')]){_0x9cb5fe[_0x824b('0x3b')]=_[_0x824b('0x3e')](_0x9cb5fe[_0x824b('0x3b')],{'$or':_[_0x824b('0x2c')](_0x37b62e,function(_0xc9e03c){if(_0xc9e03c[_0x824b('0x2e')]!=='VIRTUAL'){var _0x301acb={};_0x301acb[_0xc9e03c[_0x824b('0x2a')]]={'$like':'%'+_0x2dbc1d[_0x824b('0x31')][_0x824b('0x3d')]+'%'};return _0x301acb;}})});}_0x9cb5fe=_[_0x824b('0x3e')]({},_0x9cb5fe,_0x2dbc1d['options']);var _0x2e757d={'where':_0x9cb5fe[_0x824b('0x3b')]};return db[_0x824b('0x2d')][_0x824b('0x1e')](_0x2e757d)[_0x824b('0x3f')](function(_0x42acb7){_0x4557f4['count']=_0x42acb7;if(_0x2dbc1d[_0x824b('0x31')][_0x824b('0x40')]){_0x9cb5fe[_0x824b('0x41')]=[{'all':!![]}];}return db[_0x824b('0x2d')][_0x824b('0x42')](_0x9cb5fe);})['then'](function(_0x383a96){_0x4557f4['rows']=_0x383a96;return _0x4557f4;})[_0x824b('0x3f')](respondWithFilteredResult(_0x242529,_0x9cb5fe))['catch'](handleError(_0x242529,null));};exports[_0x824b('0x43')]=function(_0x44b229,_0x2b2927){var _0x591dd1={'raw':![],'where':{'id':_0x44b229[_0x824b('0x44')]['id']}},_0x48f1f6={};_0x48f1f6[_0x824b('0x30')]=_[_0x824b('0x32')](db[_0x824b('0x2d')]['rawAttributes']);_0x48f1f6[_0x824b('0x31')]=_['keys'](_0x44b229[_0x824b('0x31')]);_0x48f1f6['filters']=_[_0x824b('0x34')](_0x48f1f6[_0x824b('0x30')],_0x48f1f6[_0x824b('0x31')]);_0x591dd1['attributes']=_['intersection'](_0x48f1f6[_0x824b('0x30')],qs['fields'](_0x44b229[_0x824b('0x31')][_0x824b('0x36')]));_0x591dd1[_0x824b('0x35')]=_0x591dd1[_0x824b('0x35')][_0x824b('0x37')]?_0x591dd1[_0x824b('0x35')]:_0x48f1f6[_0x824b('0x30')];if(_0x44b229[_0x824b('0x31')][_0x824b('0x40')]){_0x591dd1[_0x824b('0x41')]=[{'all':!![]}];}_0x591dd1=_['merge']({},_0x591dd1,_0x44b229[_0x824b('0x45')]);return db['DeskAccount'][_0x824b('0x46')](_0x591dd1)['then'](handleEntityNotFound(_0x2b2927,null))[_0x824b('0x3f')](respondWithResult(_0x2b2927,null))['catch'](handleError(_0x2b2927,null));};exports[_0x824b('0x47')]=function(_0x35b115,_0x21b1a5){return db[_0x824b('0x2d')][_0x824b('0x47')](_0x35b115[_0x824b('0x48')],{})[_0x824b('0x3f')](respondWithResult(_0x21b1a5,0xc9))[_0x824b('0x49')](handleError(_0x21b1a5,null));};exports['update']=function(_0x532e4a,_0x10f9b1){if(_0x532e4a[_0x824b('0x48')]['id']){delete _0x532e4a['body']['id'];}return db['DeskAccount']['find']({'where':{'id':_0x532e4a[_0x824b('0x44')]['id']}})[_0x824b('0x3f')](handleEntityNotFound(_0x10f9b1,null))[_0x824b('0x3f')](saveUpdates(_0x532e4a[_0x824b('0x48')],null))[_0x824b('0x3f')](respondWithResult(_0x10f9b1,null))[_0x824b('0x49')](handleError(_0x10f9b1,null));};exports[_0x824b('0x26')]=function(_0x3ef228,_0x2da017){return db[_0x824b('0x2d')][_0x824b('0x46')]({'where':{'id':_0x3ef228[_0x824b('0x44')]['id']}})[_0x824b('0x3f')](handleEntityNotFound(_0x2da017,null))[_0x824b('0x3f')](removeEntity(_0x2da017,null))[_0x824b('0x49')](handleError(_0x2da017,null));};exports[_0x824b('0x4a')]=function(_0x3c8f2b,_0x1cd6f7,_0x57064b){var _0xa9a292={};var _0x29315d={};var _0x3675a1;var _0x473970;return db[_0x824b('0x2d')][_0x824b('0x4b')]({'where':{'id':_0x3c8f2b[_0x824b('0x44')]['id']}})[_0x824b('0x3f')](handleEntityNotFound(_0x1cd6f7,null))[_0x824b('0x3f')](function(_0x8677f8){if(_0x8677f8){_0x3675a1=_0x8677f8;_0x29315d['model']=_[_0x824b('0x32')](db[_0x824b('0x4c')][_0x824b('0x4d')]);_0x29315d[_0x824b('0x31')]=_[_0x824b('0x32')](_0x3c8f2b['query']);_0x29315d[_0x824b('0x33')]=_[_0x824b('0x34')](_0x29315d[_0x824b('0x30')],_0x29315d['query']);_0xa9a292['attributes']=_[_0x824b('0x34')](_0x29315d['model'],qs[_0x824b('0x36')](_0x3c8f2b[_0x824b('0x31')][_0x824b('0x36')]));_0xa9a292[_0x824b('0x35')]=_0xa9a292[_0x824b('0x35')]['length']?_0xa9a292[_0x824b('0x35')]:_0x29315d[_0x824b('0x30')];_0xa9a292[_0x824b('0x39')]=qs[_0x824b('0x3a')](_0x3c8f2b[_0x824b('0x31')]['sort']);_0xa9a292[_0x824b('0x3b')]=qs[_0x824b('0x33')](_[_0x824b('0x3c')](_0x3c8f2b[_0x824b('0x31')],_0x29315d['filters']));if(_0x3c8f2b[_0x824b('0x31')][_0x824b('0x3d')]){_0xa9a292[_0x824b('0x3b')]=_[_0x824b('0x3e')](_0xa9a292[_0x824b('0x3b')],{'$or':_[_0x824b('0x2c')](_0xa9a292[_0x824b('0x35')],function(_0x432fa7){var _0x542777={};_0x542777[_0x432fa7]={'$like':'%'+_0x3c8f2b[_0x824b('0x31')][_0x824b('0x3d')]+'%'};return _0x542777;})});}_0xa9a292=_[_0x824b('0x3e')]({},_0xa9a292,_0x3c8f2b[_0x824b('0x45')]);return _0x3675a1['getConfigurations'](_0xa9a292);}})[_0x824b('0x3f')](function(_0x57193a){if(_0x57193a){_0x473970=_0x57193a[_0x824b('0x37')];if(!_0x3c8f2b[_0x824b('0x31')][_0x824b('0x38')](_0x824b('0x4e'))){_0xa9a292['limit']=qs[_0x824b('0x1d')](_0x3c8f2b[_0x824b('0x31')]['limit']);_0xa9a292['offset']=qs[_0x824b('0x1b')](_0x3c8f2b['query']['offset']);}return _0x3675a1[_0x824b('0x4a')](_0xa9a292);}})[_0x824b('0x3f')](function(_0x399b98){if(_0x399b98){return _0x399b98?{'count':_0x473970,'rows':_0x399b98}:null;}})[_0x824b('0x3f')](respondWithResult(_0x1cd6f7,null))[_0x824b('0x49')](handleError(_0x1cd6f7,null));};exports[_0x824b('0x4f')]=function(_0x7e558d,_0xd7328f,_0x1e662a){if(_0x7e558d['body']['id']){delete _0x7e558d['body']['id'];}return db[_0x824b('0x2d')]['findOne']({'where':{'id':_0x7e558d[_0x824b('0x44')]['id']}})[_0x824b('0x3f')](handleEntityNotFound(_0xd7328f,null))[_0x824b('0x3f')](function(_0x2f5ef6){if(_0x2f5ef6){_0x7e558d[_0x824b('0x48')]['AccountId']=_0x2f5ef6['id'];_0x7e558d[_0x824b('0x48')][_0x824b('0x50')]=integrations[_0x824b('0x51')](_0x7e558d[_0x824b('0x48')]['channel'],_0x7e558d['body'][_0x824b('0x2e')]);_0x7e558d['body'][_0x824b('0x52')]=integrations[_0x824b('0x53')](_0x7e558d[_0x824b('0x48')]['channel'],_0x7e558d['body']['type']);return db[_0x824b('0x4c')][_0x824b('0x47')](_0x7e558d[_0x824b('0x48')],{'include':[{'model':db[_0x824b('0x54')],'as':_0x824b('0x50')},{'model':db[_0x824b('0x54')],'as':'Descriptions'}]});}return null;})[_0x824b('0x3f')](respondWithResult(_0xd7328f,null))['catch'](handleError(_0xd7328f,null));};exports[_0x824b('0x55')]=function(_0x4d5c27,_0x36ea96,_0x337014){var _0x49f696=[{'name':_0x824b('0x56'),'label':_0x824b('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 _0x2125d4='';return db[_0x824b('0x2d')]['findOne']({'where':{'id':_0x4d5c27['params']['id']},'attributes':['id',_0x824b('0x57'),'authType',_0x824b('0x58'),_0x824b('0x59'),_0x824b('0x5a'),_0x824b('0x5b'),'token','tokenSecret']})[_0x824b('0x3f')](handleEntityNotFound(_0x36ea96,null))[_0x824b('0x3f')](function(_0x29f6a6){if(_0x29f6a6){_0x2125d4=_0x29f6a6[_0x824b('0x57')];var _0x16efd5=_0x2125d4['slice'](-0x1);if(_0x16efd5==='/'){_0x2125d4=_0x2125d4[_0x824b('0x5c')](0x0,_0x2125d4[_0x824b('0x5d')](_0x16efd5));}var _0x5b88b7={'method':_0x824b('0x5e'),'uri':util['format']('%s/custom_fields',_0x2125d4),'headers':{'Content-Type':_0x824b('0x5f'),'Accept':_0x824b('0x5f')},'json':!![]};if(_0x29f6a6[_0x824b('0x60')]===_0x824b('0x61')){_0x5b88b7['headers'][_0x824b('0x62')]=util[_0x824b('0x63')]('Basic\x20%s',new Buffer(util[_0x824b('0x63')](_0x824b('0x64'),_0x29f6a6[_0x824b('0x58')],_0x29f6a6[_0x824b('0x59')]))[_0x824b('0x65')](_0x824b('0x66')));}return rp(_0x5b88b7)['then'](function(_0x8ba2b0){return _0x49f696[_0x824b('0x67')](_[_0x824b('0x2c')](_0x8ba2b0[_0x824b('0x68')]['entries'],function(_0x158e75){return{'id':_0x158e75[_0x824b('0x2a')],'name':_0x158e75[_0x824b('0x2a')],'type':_0x158e75[_0x824b('0x2e')],'active':_0x158e75[_0x824b('0x69')],'label':_0x158e75['label'],'custom':!![]};}));});}})[_0x824b('0x3f')](function(_0x185963){return{'count':_0x185963[_0x824b('0x37')],'rows':_0x185963};})[_0x824b('0x3f')](respondWithResult(_0x36ea96,null))['catch'](function(_0xdce592){var _0x1388ac=_0x4d5c27[_0x824b('0x31')]['test']?0x1f4:_0xdce592[_0x824b('0x6a')]||0x1f4;logger['error'](_0x824b('0x6b'),_0x824b('0x55'),_0x1388ac,JSON[_0x824b('0x6c')](_0xdce592));delete _0xdce592['name'];if(_0x1388ac===0x191){_0x1388ac=0x190;}_0x36ea96[_0x824b('0x1a')](_0x1388ac)[_0x824b('0x2b')](_0x4d5c27['query'][_0x824b('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0xdce592[_0x824b('0x6a')]}:_0xdce592);});};
\ No newline at end of file
index e58681f..e256770 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f90=['path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util','api','moment','bluebird'];(function(_0x50528e,_0x5ae7de){var _0xb53771=function(_0x171db7){while(--_0x171db7){_0x50528e['push'](_0x50528e['shift']());}};_0xb53771(++_0x5ae7de);}(_0x3f90,0xbf));var _0x03f9=function(_0x16eddd,_0x56256d){_0x16eddd=_0x16eddd-0x0;var _0x4739cf=_0x3f90[_0x16eddd];return _0x4739cf;};'use strict';var _=require(_0x03f9('0x0'));var util=require(_0x03f9('0x1'));var logger=require('../../config/logger')(_0x03f9('0x2'));var moment=require(_0x03f9('0x3'));var BPromise=require(_0x03f9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x03f9('0x5'));var rimraf=require(_0x03f9('0x6'));var config=require(_0x03f9('0x7'));var attributes=require(_0x03f9('0x8'));var integrations=require(_0x03f9('0x9'));module[_0x03f9('0xa')]=function(_0x32d848,_0x55ee3d){return _0x32d848[_0x03f9('0xb')](_0x03f9('0xc'),attributes,{'tableName':_0x03f9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbb20=['./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x470061,_0x178ac6){var _0x565b01=function(_0x1e95d4){while(--_0x1e95d4){_0x470061['push'](_0x470061['shift']());}};_0x565b01(++_0x178ac6);}(_0xbb20,0xaf));var _0x0bb2=function(_0x18bd2a,_0x3f93f0){_0x18bd2a=_0x18bd2a-0x0;var _0x546f18=_0xbb20[_0x18bd2a];return _0x546f18;};'use strict';var _=require(_0x0bb2('0x0'));var util=require(_0x0bb2('0x1'));var logger=require('../../config/logger')(_0x0bb2('0x2'));var moment=require(_0x0bb2('0x3'));var BPromise=require('bluebird');var rp=require(_0x0bb2('0x4'));var fs=require('fs');var path=require(_0x0bb2('0x5'));var rimraf=require(_0x0bb2('0x6'));var config=require('../../config/environment');var attributes=require(_0x0bb2('0x7'));var integrations=require(_0x0bb2('0x8'));module[_0x0bb2('0x9')]=function(_0x2d2a2a,_0x146dcf){return _0x2d2a2a[_0x0bb2('0xa')](_0x0bb2('0xb'),attributes,{'tableName':_0x0bb2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cf54c43..3317a79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6809=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetDeskAccount','stringify','ShowDeskAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x12ffa0,_0x50f8b){var _0xafdb35=function(_0x5c6e22){while(--_0x5c6e22){_0x12ffa0['push'](_0x12ffa0['shift']());}};_0xafdb35(++_0x50f8b);}(_0x6809,0x17b));var _0x9680=function(_0x56f7e2,_0x145392){_0x56f7e2=_0x56f7e2-0x0;var _0x36240b=_0x6809[_0x56f7e2];return _0x36240b;};'use strict';var _=require('lodash');var util=require(_0x9680('0x0'));var moment=require(_0x9680('0x1'));var BPromise=require(_0x9680('0x2'));var rs=require(_0x9680('0x3'));var fs=require('fs');var Redis=require(_0x9680('0x4'));var db=require(_0x9680('0x5'))['db'];var utils=require(_0x9680('0x6'));var logger=require(_0x9680('0x7'))(_0x9680('0x8'));var config=require(_0x9680('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9680('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3760ae,_0x313abb,_0x37d856){return new BPromise(function(_0x39415f,_0x4c00cb){return client[_0x9680('0xb')](_0x3760ae,_0x37d856)[_0x9680('0xc')](function(_0x5d5e40){logger[_0x9680('0xd')](_0x9680('0xe'),_0x313abb,_0x9680('0xf'));logger[_0x9680('0x10')](_0x9680('0x11'),_0x313abb,_0x9680('0xf'),JSON['stringify'](_0x5d5e40));if(_0x5d5e40['error']){if(_0x5d5e40[_0x9680('0x12')][_0x9680('0x13')]===0x1f4){logger['error'](_0x9680('0xe'),_0x313abb,_0x5d5e40[_0x9680('0x12')][_0x9680('0x14')]);return _0x4c00cb(_0x5d5e40[_0x9680('0x12')][_0x9680('0x14')]);}logger[_0x9680('0x12')](_0x9680('0xe'),_0x313abb,_0x5d5e40[_0x9680('0x12')][_0x9680('0x14')]);return _0x39415f(_0x5d5e40[_0x9680('0x12')]['message']);}else{logger[_0x9680('0xd')](_0x9680('0xe'),_0x313abb,_0x9680('0xf'));_0x39415f(_0x5d5e40['result'][_0x9680('0x14')]);}})[_0x9680('0x15')](function(_0x2e22ea){logger[_0x9680('0x12')](_0x9680('0xe'),_0x313abb,_0x2e22ea);_0x4c00cb(_0x2e22ea);});});}exports['GetDeskAccount']=function(_0x2a917e){var _0x2f3c67=this;return new Promise(function(_0x1519bf,_0x3a19b9){return db['DeskAccount'][_0x9680('0x16')]({'raw':_0x2a917e[_0x9680('0x17')]?_0x2a917e[_0x9680('0x17')][_0x9680('0x18')]===undefined?!![]:![]:!![],'where':_0x2a917e[_0x9680('0x17')]?_0x2a917e[_0x9680('0x17')][_0x9680('0x19')]||null:null,'attributes':_0x2a917e[_0x9680('0x17')]?_0x2a917e[_0x9680('0x17')][_0x9680('0x1a')]||null:null,'limit':_0x2a917e[_0x9680('0x17')]?_0x2a917e[_0x9680('0x17')][_0x9680('0x1b')]||null:null,'include':_0x2a917e[_0x9680('0x17')]?_0x2a917e[_0x9680('0x17')][_0x9680('0x1c')]?_['map'](_0x2a917e[_0x9680('0x17')][_0x9680('0x1c')],function(_0x15b5a1){return{'model':db[_0x15b5a1['model']],'as':_0x15b5a1['as'],'attributes':_0x15b5a1[_0x9680('0x1a')],'include':_0x15b5a1[_0x9680('0x1c')]?_[_0x9680('0x1d')](_0x15b5a1[_0x9680('0x1c')],function(_0xfdec58){return{'model':db[_0xfdec58[_0x9680('0x1e')]],'as':_0xfdec58['as'],'attributes':_0xfdec58[_0x9680('0x1a')],'include':_0xfdec58[_0x9680('0x1c')]?_['map'](_0xfdec58[_0x9680('0x1c')],function(_0x3e9037){return{'model':db[_0x3e9037[_0x9680('0x1e')]],'as':_0x3e9037['as'],'attributes':_0x3e9037[_0x9680('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x470924){logger['info'](_0x9680('0x1f'),_0x2a917e);logger['debug'](_0x9680('0x1f'),_0x2a917e,JSON[_0x9680('0x20')](_0x470924));_0x1519bf(_0x470924);})[_0x9680('0x15')](function(_0x4107ec){logger['error'](_0x9680('0x1f'),_0x4107ec[_0x9680('0x14')],_0x2a917e);_0x3a19b9(_0x2f3c67[_0x9680('0x12')](0x1f4,_0x4107ec['message']));});});};exports[_0x9680('0x21')]=function(_0x59e69b){var _0x43f04d=this;return new Promise(function(_0x4cc596,_0x984951){return db['DeskAccount'][_0x9680('0x22')]({'raw':_0x59e69b['options']?_0x59e69b[_0x9680('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x59e69b[_0x9680('0x17')]?_0x59e69b[_0x9680('0x17')][_0x9680('0x19')]||null:null,'attributes':_0x59e69b[_0x9680('0x17')]?_0x59e69b['options'][_0x9680('0x1a')]||null:null,'include':_0x59e69b[_0x9680('0x17')]?_0x59e69b['options'][_0x9680('0x1c')]?_[_0x9680('0x1d')](_0x59e69b[_0x9680('0x17')][_0x9680('0x1c')],function(_0x54ea27){return{'model':db[_0x54ea27[_0x9680('0x1e')]],'as':_0x54ea27['as'],'attributes':_0x54ea27['attributes'],'include':_0x54ea27[_0x9680('0x1c')]?_[_0x9680('0x1d')](_0x54ea27['include'],function(_0xd6ac44){return{'model':db[_0xd6ac44[_0x9680('0x1e')]],'as':_0xd6ac44['as'],'attributes':_0xd6ac44[_0x9680('0x1a')],'include':_0xd6ac44[_0x9680('0x1c')]?_['map'](_0xd6ac44[_0x9680('0x1c')],function(_0x1f56b0){return{'model':db[_0x1f56b0['model']],'as':_0x1f56b0['as'],'attributes':_0x1f56b0['attributes']};}):[]};}):[]};}):[]:[]})[_0x9680('0xc')](function(_0x48080f){logger['info'](_0x9680('0x21'),_0x59e69b);logger['debug'](_0x9680('0x21'),_0x59e69b,JSON[_0x9680('0x20')](_0x48080f));_0x4cc596(_0x48080f);})['catch'](function(_0x20f058){logger[_0x9680('0x12')](_0x9680('0x21'),_0x20f058['message'],_0x59e69b);_0x984951(_0x43f04d['error'](0x1f4,_0x20f058[_0x9680('0x14')]));});});};
\ No newline at end of file
+var _0x17d4=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','DeskAccount,\x20%s,\x20%s','info','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','ShowDeskAccount','find','lodash','moment','bluebird'];(function(_0x948344,_0x10ba22){var _0x41d4df=function(_0x14888b){while(--_0x14888b){_0x948344['push'](_0x948344['shift']());}};_0x41d4df(++_0x10ba22);}(_0x17d4,0x1d1));var _0x417d=function(_0x57532c,_0x2c75cf){_0x57532c=_0x57532c-0x0;var _0x5cb9a6=_0x17d4[_0x57532c];return _0x5cb9a6;};'use strict';var _=require(_0x417d('0x0'));var util=require('util');var moment=require(_0x417d('0x1'));var BPromise=require(_0x417d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x417d('0x3'));var db=require(_0x417d('0x4'))['db'];var utils=require(_0x417d('0x5'));var logger=require(_0x417d('0x6'))(_0x417d('0x7'));var config=require(_0x417d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x417d('0x9')][_0x417d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x528666,_0x471d88,_0x37508a){return new BPromise(function(_0x610899,_0x153ebd){return client[_0x417d('0xb')](_0x528666,_0x37508a)['then'](function(_0xf38410){logger['info']('DeskAccount,\x20%s,\x20%s',_0x471d88,_0x417d('0xc'));logger['debug'](_0x417d('0xd'),_0x471d88,_0x417d('0xc'),JSON['stringify'](_0xf38410));if(_0xf38410[_0x417d('0xe')]){if(_0xf38410[_0x417d('0xe')][_0x417d('0xf')]===0x1f4){logger[_0x417d('0xe')]('DeskAccount,\x20%s,\x20%s',_0x471d88,_0xf38410[_0x417d('0xe')][_0x417d('0x10')]);return _0x153ebd(_0xf38410['error']['message']);}logger[_0x417d('0xe')](_0x417d('0x11'),_0x471d88,_0xf38410[_0x417d('0xe')][_0x417d('0x10')]);return _0x610899(_0xf38410[_0x417d('0xe')][_0x417d('0x10')]);}else{logger[_0x417d('0x12')](_0x417d('0x11'),_0x471d88,'request\x20sent');_0x610899(_0xf38410[_0x417d('0x13')]['message']);}})[_0x417d('0x14')](function(_0x326ec6){logger[_0x417d('0xe')]('DeskAccount,\x20%s,\x20%s',_0x471d88,_0x326ec6);_0x153ebd(_0x326ec6);});});}exports[_0x417d('0x15')]=function(_0x462b66){var _0x401c6d=this;return new Promise(function(_0x5305f1,_0x5b722c){return db[_0x417d('0x16')][_0x417d('0x17')]({'raw':_0x462b66[_0x417d('0x18')]?_0x462b66[_0x417d('0x18')][_0x417d('0x19')]===undefined?!![]:![]:!![],'where':_0x462b66[_0x417d('0x18')]?_0x462b66[_0x417d('0x18')][_0x417d('0x1a')]||null:null,'attributes':_0x462b66[_0x417d('0x18')]?_0x462b66[_0x417d('0x18')][_0x417d('0x1b')]||null:null,'limit':_0x462b66[_0x417d('0x18')]?_0x462b66['options'][_0x417d('0x1c')]||null:null,'include':_0x462b66[_0x417d('0x18')]?_0x462b66[_0x417d('0x18')][_0x417d('0x1d')]?_[_0x417d('0x1e')](_0x462b66[_0x417d('0x18')][_0x417d('0x1d')],function(_0x4b499a){return{'model':db[_0x4b499a['model']],'as':_0x4b499a['as'],'attributes':_0x4b499a[_0x417d('0x1b')],'include':_0x4b499a[_0x417d('0x1d')]?_['map'](_0x4b499a[_0x417d('0x1d')],function(_0x120930){return{'model':db[_0x120930['model']],'as':_0x120930['as'],'attributes':_0x120930[_0x417d('0x1b')],'include':_0x120930[_0x417d('0x1d')]?_[_0x417d('0x1e')](_0x120930[_0x417d('0x1d')],function(_0xf75faf){return{'model':db[_0xf75faf[_0x417d('0x1f')]],'as':_0xf75faf['as'],'attributes':_0xf75faf['attributes']};}):[]};}):[]};}):[]:[]})[_0x417d('0x20')](function(_0x41e486){logger[_0x417d('0x12')](_0x417d('0x15'),_0x462b66);logger[_0x417d('0x21')](_0x417d('0x15'),_0x462b66,JSON['stringify'](_0x41e486));_0x5305f1(_0x41e486);})[_0x417d('0x14')](function(_0x100c40){logger[_0x417d('0xe')]('GetDeskAccount',_0x100c40[_0x417d('0x10')],_0x462b66);_0x5b722c(_0x401c6d[_0x417d('0xe')](0x1f4,_0x100c40['message']));});});};exports[_0x417d('0x22')]=function(_0xdcc0e6){var _0x4a231c=this;return new Promise(function(_0x19c2f8,_0x195227){return db[_0x417d('0x16')][_0x417d('0x23')]({'raw':_0xdcc0e6[_0x417d('0x18')]?_0xdcc0e6[_0x417d('0x18')][_0x417d('0x19')]===undefined?!![]:![]:!![],'where':_0xdcc0e6['options']?_0xdcc0e6[_0x417d('0x18')][_0x417d('0x1a')]||null:null,'attributes':_0xdcc0e6[_0x417d('0x18')]?_0xdcc0e6['options'][_0x417d('0x1b')]||null:null,'include':_0xdcc0e6[_0x417d('0x18')]?_0xdcc0e6[_0x417d('0x18')]['include']?_[_0x417d('0x1e')](_0xdcc0e6[_0x417d('0x18')][_0x417d('0x1d')],function(_0x16b3bf){return{'model':db[_0x16b3bf[_0x417d('0x1f')]],'as':_0x16b3bf['as'],'attributes':_0x16b3bf[_0x417d('0x1b')],'include':_0x16b3bf[_0x417d('0x1d')]?_[_0x417d('0x1e')](_0x16b3bf[_0x417d('0x1d')],function(_0x2dfaa1){return{'model':db[_0x2dfaa1[_0x417d('0x1f')]],'as':_0x2dfaa1['as'],'attributes':_0x2dfaa1[_0x417d('0x1b')],'include':_0x2dfaa1['include']?_[_0x417d('0x1e')](_0x2dfaa1[_0x417d('0x1d')],function(_0x687fcb){return{'model':db[_0x687fcb[_0x417d('0x1f')]],'as':_0x687fcb['as'],'attributes':_0x687fcb[_0x417d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x417d('0x20')](function(_0x3be4c9){logger[_0x417d('0x12')](_0x417d('0x22'),_0xdcc0e6);logger[_0x417d('0x21')]('ShowDeskAccount',_0xdcc0e6,JSON['stringify'](_0x3be4c9));_0x19c2f8(_0x3be4c9);})['catch'](function(_0x376275){logger[_0x417d('0xe')]('ShowDeskAccount',_0x376275['message'],_0xdcc0e6);_0x195227(_0x4a231c[_0x417d('0xe')](0x1f4,_0x376275['message']));});});};
\ No newline at end of file
index 0414651..cd39bee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x59df9c,_0xbf3b67){var _0x4834f6=function(_0x41b740){while(--_0x41b740){_0x59df9c['push'](_0x59df9c['shift']());}};_0x4834f6(++_0xbf3b67);}(_0xedd9,0xfc));var _0x9edd=function(_0x23b323,_0x3ed936){_0x23b323=_0x23b323-0x0;var _0x588b38=_0xedd9[_0x23b323];return _0x588b38;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router;
\ No newline at end of file
+var _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x45e635,_0x376349){var _0x32e70e=function(_0x10985e){while(--_0x10985e){_0x45e635['push'](_0x45e635['shift']());}};_0x32e70e(++_0x376349);}(_0x3e74,0x175));var _0x43e7=function(_0xb7bd02,_0x21af95){_0xb7bd02=_0xb7bd02-0x0;var _0x20e7f7=_0x3e74[_0xb7bd02];return _0x20e7f7;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router;
\ No newline at end of file
index f8fb2d3..864c592 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa972=['sequelize','STRING'];(function(_0x214bf9,_0x3623b7){var _0x4f6a0d=function(_0x2282c8){while(--_0x2282c8){_0x214bf9['push'](_0x214bf9['shift']());}};_0x4f6a0d(++_0x3623b7);}(_0xa972,0x9c));var _0x2a97=function(_0x2dd471,_0x51a6af){_0x2dd471=_0x2dd471-0x0;var _0x200f68=_0xa972[_0x2dd471];return _0x200f68;};'use strict';var Sequelize=require(_0x2a97('0x0'));module['exports']={'name':{'type':Sequelize[_0x2a97('0x1')]},'description':{'type':Sequelize[_0x2a97('0x1')]}};
\ No newline at end of file
+var _0x53a8=['sequelize','STRING'];(function(_0x4ddd39,_0x556695){var _0x75c828=function(_0x238ed1){while(--_0x238ed1){_0x4ddd39['push'](_0x4ddd39['shift']());}};_0x75c828(++_0x556695);}(_0x53a8,0x76));var _0x853a=function(_0x3c3ee5,_0x3bf9cf){_0x3c3ee5=_0x3c3ee5-0x0;var _0x53584c=_0x53a8[_0x3c3ee5];return _0x53584c;};'use strict';var Sequelize=require(_0x853a('0x0'));module['exports']={'name':{'type':Sequelize[_0x853a('0x1')]},'description':{'type':Sequelize[_0x853a('0x1')]}};
\ No newline at end of file
index f337b6a..33fb0b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc74=['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/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','sendStatus','error','stack','name','send','index','map','DeskConfiguration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','findOne','order','filter','getFields','getSubjects','DeskField','getDescriptions','getTags','Tag','setTags','ids','eml-format'];(function(_0x503ef1,_0x178af4){var _0x2c61dc=function(_0x3136ad){while(--_0x3136ad){_0x503ef1['push'](_0x503ef1['shift']());}};_0x2c61dc(++_0x178af4);}(_0xcc74,0x157));var _0x4cc7=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xcc74[_0xae7c2f];return _0x5d7001;};'use strict';var emlformat=require(_0x4cc7('0x0'));var rimraf=require(_0x4cc7('0x1'));var zipdir=require(_0x4cc7('0x2'));var jsonpatch=require(_0x4cc7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4cc7('0x4'));var path=require(_0x4cc7('0x5'));var sox=require(_0x4cc7('0x6'));var csv=require(_0x4cc7('0x7'));var ejs=require(_0x4cc7('0x8'));var fs=require('fs');var fs_extra=require(_0x4cc7('0x9'));var _=require(_0x4cc7('0xa'));var squel=require(_0x4cc7('0xb'));var crypto=require(_0x4cc7('0xc'));var jsforce=require(_0x4cc7('0xd'));var deskjs=require(_0x4cc7('0xe'));var toCsv=require(_0x4cc7('0x7'));var querystring=require(_0x4cc7('0xf'));var Papa=require(_0x4cc7('0x10'));var Redis=require('ioredis');var authService=require(_0x4cc7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4cc7('0x12'));var hardwareService=require(_0x4cc7('0x13'));var logger=require(_0x4cc7('0x14'))('api');var utils=require(_0x4cc7('0x15'));var config=require(_0x4cc7('0x16'));var licenseUtil=require(_0x4cc7('0x17'));var db=require(_0x4cc7('0x18'))['db'];function respondWithStatusCode(_0x29029d,_0x30923c){_0x30923c=_0x30923c||0xcc;return function(_0x5c3b95){if(_0x5c3b95){return _0x29029d['sendStatus'](_0x30923c);}return _0x29029d[_0x4cc7('0x19')](_0x30923c)[_0x4cc7('0x1a')]();};}function respondWithResult(_0x365079,_0x5eebf6){_0x5eebf6=_0x5eebf6||0xc8;return function(_0x212c2f){if(_0x212c2f){return _0x365079[_0x4cc7('0x19')](_0x5eebf6)['json'](_0x212c2f);}};}function respondWithFilteredResult(_0x254169,_0x12fa8d){return function(_0xea2a2e){if(_0xea2a2e){var _0x2bd613=typeof _0x12fa8d[_0x4cc7('0x1b')]===_0x4cc7('0x1c')&&typeof _0x12fa8d[_0x4cc7('0x1d')]===_0x4cc7('0x1c');var _0x1133b2=_0xea2a2e[_0x4cc7('0x1e')];var _0x119132=_0x2bd613?0x0:_0x12fa8d[_0x4cc7('0x1b')];var _0x477ee8=_0x2bd613?_0xea2a2e[_0x4cc7('0x1e')]:_0x12fa8d[_0x4cc7('0x1b')]+_0x12fa8d['limit'];var _0x4a1f2a;if(_0x477ee8>=_0x1133b2){_0x477ee8=_0x1133b2;_0x4a1f2a=0xc8;}else{_0x4a1f2a=0xce;}_0x254169[_0x4cc7('0x19')](_0x4a1f2a);return _0x254169[_0x4cc7('0x1f')](_0x4cc7('0x20'),_0x119132+'-'+_0x477ee8+'/'+_0x1133b2)['json'](_0xea2a2e);}return null;};}function patchUpdates(_0x5d8c71){return function(_0x4a2514){try{jsonpatch['apply'](_0x4a2514,_0x5d8c71,!![]);}catch(_0x221ab4){return BPromise[_0x4cc7('0x21')](_0x221ab4);}return _0x4a2514['save']();};}function saveUpdates(_0x5918d8,_0x255333){return function(_0xabcc34){if(_0xabcc34){return _0xabcc34['update'](_0x5918d8)[_0x4cc7('0x22')](function(_0x2e7c3e){return _0x2e7c3e;});}return null;};}function removeEntity(_0x24b565,_0x2218ef){return function(_0x2c42fb){if(_0x2c42fb){return _0x2c42fb[_0x4cc7('0x23')]()[_0x4cc7('0x22')](function(){_0x24b565[_0x4cc7('0x19')](0xcc)[_0x4cc7('0x1a')]();});}};}function handleEntityNotFound(_0x3febde,_0x5b5982){return function(_0x2baddc){if(!_0x2baddc){_0x3febde[_0x4cc7('0x24')](0x194);}return _0x2baddc;};}function handleError(_0x1cc09f,_0x3fccf1){_0x3fccf1=_0x3fccf1||0x1f4;return function(_0x54062e){logger[_0x4cc7('0x25')](_0x54062e[_0x4cc7('0x26')]);if(_0x54062e[_0x4cc7('0x27')]){delete _0x54062e[_0x4cc7('0x27')];}_0x1cc09f[_0x4cc7('0x19')](_0x3fccf1)[_0x4cc7('0x28')](_0x54062e);};}exports[_0x4cc7('0x29')]=function(_0x81171a,_0x4352c7){var _0x47f1bc={},_0x1a966f={},_0x5352b4={'count':0x0,'rows':[]};var _0x4363a8=_[_0x4cc7('0x2a')](db[_0x4cc7('0x2b')]['rawAttributes'],function(_0x889391){return{'name':_0x889391[_0x4cc7('0x2c')],'type':_0x889391[_0x4cc7('0x2d')][_0x4cc7('0x2e')]};});_0x1a966f[_0x4cc7('0x2f')]=_[_0x4cc7('0x2a')](_0x4363a8,_0x4cc7('0x27'));_0x1a966f[_0x4cc7('0x30')]=_[_0x4cc7('0x31')](_0x81171a[_0x4cc7('0x30')]);_0x1a966f[_0x4cc7('0x32')]=_[_0x4cc7('0x33')](_0x1a966f[_0x4cc7('0x2f')],_0x1a966f['query']);_0x47f1bc[_0x4cc7('0x34')]=_[_0x4cc7('0x33')](_0x1a966f[_0x4cc7('0x2f')],qs[_0x4cc7('0x35')](_0x81171a[_0x4cc7('0x30')][_0x4cc7('0x35')]));_0x47f1bc[_0x4cc7('0x34')]=_0x47f1bc['attributes'][_0x4cc7('0x36')]?_0x47f1bc[_0x4cc7('0x34')]:_0x1a966f[_0x4cc7('0x2f')];if(!_0x81171a[_0x4cc7('0x30')][_0x4cc7('0x37')](_0x4cc7('0x38'))){_0x47f1bc['limit']=qs['limit'](_0x81171a[_0x4cc7('0x30')][_0x4cc7('0x1d')]);_0x47f1bc[_0x4cc7('0x1b')]=qs[_0x4cc7('0x1b')](_0x81171a['query']['offset']);}_0x47f1bc['order']=qs[_0x4cc7('0x39')](_0x81171a[_0x4cc7('0x30')][_0x4cc7('0x39')]);_0x47f1bc[_0x4cc7('0x3a')]=qs[_0x4cc7('0x32')](_[_0x4cc7('0x3b')](_0x81171a['query'],_0x1a966f[_0x4cc7('0x32')]),_0x4363a8);if(_0x81171a['query']['filter']){_0x47f1bc[_0x4cc7('0x3a')]=_[_0x4cc7('0x3c')](_0x47f1bc[_0x4cc7('0x3a')],{'$or':_['map'](_0x4363a8,function(_0x2c6598){if(_0x2c6598['type']!==_0x4cc7('0x3d')){var _0x3330ef={};_0x3330ef[_0x2c6598['name']]={'$like':'%'+_0x81171a['query']['filter']+'%'};return _0x3330ef;}})});}_0x47f1bc=_[_0x4cc7('0x3c')]({},_0x47f1bc,_0x81171a[_0x4cc7('0x3e')]);var _0x43f892={'where':_0x47f1bc[_0x4cc7('0x3a')]};return db[_0x4cc7('0x2b')]['count'](_0x43f892)[_0x4cc7('0x22')](function(_0x5094c0){_0x5352b4[_0x4cc7('0x1e')]=_0x5094c0;if(_0x81171a[_0x4cc7('0x30')][_0x4cc7('0x3f')]){_0x47f1bc[_0x4cc7('0x40')]=[{'all':!![]}];}return db[_0x4cc7('0x2b')][_0x4cc7('0x41')](_0x47f1bc);})[_0x4cc7('0x22')](function(_0x213119){_0x5352b4[_0x4cc7('0x42')]=_0x213119;return _0x5352b4;})[_0x4cc7('0x22')](respondWithFilteredResult(_0x4352c7,_0x47f1bc))[_0x4cc7('0x43')](handleError(_0x4352c7,null));};exports[_0x4cc7('0x44')]=function(_0x4d0019,_0x5be00b){var _0x941c20={'raw':![],'where':{'id':_0x4d0019[_0x4cc7('0x45')]['id']}},_0x1be10e={};_0x1be10e[_0x4cc7('0x2f')]=_['keys'](db[_0x4cc7('0x2b')][_0x4cc7('0x46')]);_0x1be10e[_0x4cc7('0x30')]=_[_0x4cc7('0x31')](_0x4d0019[_0x4cc7('0x30')]);_0x1be10e[_0x4cc7('0x32')]=_[_0x4cc7('0x33')](_0x1be10e[_0x4cc7('0x2f')],_0x1be10e[_0x4cc7('0x30')]);_0x941c20[_0x4cc7('0x34')]=_[_0x4cc7('0x33')](_0x1be10e[_0x4cc7('0x2f')],qs[_0x4cc7('0x35')](_0x4d0019[_0x4cc7('0x30')][_0x4cc7('0x35')]));_0x941c20[_0x4cc7('0x34')]=_0x941c20[_0x4cc7('0x34')][_0x4cc7('0x36')]?_0x941c20[_0x4cc7('0x34')]:_0x1be10e[_0x4cc7('0x2f')];if(_0x4d0019['query'][_0x4cc7('0x3f')]){_0x941c20[_0x4cc7('0x40')]=[{'all':!![]}];}_0x941c20=_[_0x4cc7('0x3c')]({},_0x941c20,_0x4d0019[_0x4cc7('0x3e')]);return db[_0x4cc7('0x2b')][_0x4cc7('0x47')](_0x941c20)[_0x4cc7('0x22')](handleEntityNotFound(_0x5be00b,null))[_0x4cc7('0x22')](respondWithResult(_0x5be00b,null))[_0x4cc7('0x43')](handleError(_0x5be00b,null));};exports[_0x4cc7('0x48')]=function(_0x40a524,_0x55a8b8){return db[_0x4cc7('0x2b')][_0x4cc7('0x48')](_0x40a524[_0x4cc7('0x49')],{})['then'](respondWithResult(_0x55a8b8,0xc9))[_0x4cc7('0x43')](handleError(_0x55a8b8,null));};exports[_0x4cc7('0x4a')]=function(_0xa1a552,_0x4aeb4d){if(_0xa1a552[_0x4cc7('0x49')]['id']){delete _0xa1a552[_0x4cc7('0x49')]['id'];}return db[_0x4cc7('0x2b')][_0x4cc7('0x47')]({'where':{'id':_0xa1a552[_0x4cc7('0x45')]['id']}})[_0x4cc7('0x22')](handleEntityNotFound(_0x4aeb4d,null))[_0x4cc7('0x22')](saveUpdates(_0xa1a552['body'],null))[_0x4cc7('0x22')](respondWithResult(_0x4aeb4d,null))[_0x4cc7('0x43')](handleError(_0x4aeb4d,null));};exports[_0x4cc7('0x23')]=function(_0x3b8158,_0x4890f8){return db[_0x4cc7('0x2b')][_0x4cc7('0x47')]({'where':{'id':_0x3b8158[_0x4cc7('0x45')]['id']}})[_0x4cc7('0x22')](handleEntityNotFound(_0x4890f8,null))[_0x4cc7('0x22')](removeEntity(_0x4890f8,null))[_0x4cc7('0x43')](handleError(_0x4890f8,null));};exports['getFields']=function(_0x514ba4,_0x58454b,_0xbe2c4a){var _0xcd3d91={};var _0x41b828={};var _0x16e4d5;var _0x421aff;return db[_0x4cc7('0x2b')][_0x4cc7('0x4b')]({'where':{'id':_0x514ba4[_0x4cc7('0x45')]['id']}})[_0x4cc7('0x22')](handleEntityNotFound(_0x58454b,null))[_0x4cc7('0x22')](function(_0x551965){if(_0x551965){_0x16e4d5=_0x551965;_0x41b828[_0x4cc7('0x2f')]=_[_0x4cc7('0x31')](db['DeskField'][_0x4cc7('0x46')]);_0x41b828[_0x4cc7('0x30')]=_[_0x4cc7('0x31')](_0x514ba4[_0x4cc7('0x30')]);_0x41b828[_0x4cc7('0x32')]=_[_0x4cc7('0x33')](_0x41b828[_0x4cc7('0x2f')],_0x41b828[_0x4cc7('0x30')]);_0xcd3d91['attributes']=_['intersection'](_0x41b828[_0x4cc7('0x2f')],qs[_0x4cc7('0x35')](_0x514ba4[_0x4cc7('0x30')][_0x4cc7('0x35')]));_0xcd3d91[_0x4cc7('0x34')]=_0xcd3d91[_0x4cc7('0x34')][_0x4cc7('0x36')]?_0xcd3d91[_0x4cc7('0x34')]:_0x41b828[_0x4cc7('0x2f')];_0xcd3d91[_0x4cc7('0x4c')]=qs[_0x4cc7('0x39')](_0x514ba4[_0x4cc7('0x30')][_0x4cc7('0x39')]);_0xcd3d91[_0x4cc7('0x3a')]=qs[_0x4cc7('0x32')](_['pick'](_0x514ba4[_0x4cc7('0x30')],_0x41b828[_0x4cc7('0x32')]));if(_0x514ba4[_0x4cc7('0x30')][_0x4cc7('0x4d')]){_0xcd3d91['where']=_['merge'](_0xcd3d91[_0x4cc7('0x3a')],{'$or':_[_0x4cc7('0x2a')](_0xcd3d91['attributes'],function(_0x34c3aa){var _0x15596b={};_0x15596b[_0x34c3aa]={'$like':'%'+_0x514ba4[_0x4cc7('0x30')][_0x4cc7('0x4d')]+'%'};return _0x15596b;})});}_0xcd3d91=_[_0x4cc7('0x3c')]({},_0xcd3d91,_0x514ba4[_0x4cc7('0x3e')]);return _0x16e4d5[_0x4cc7('0x4e')](_0xcd3d91);}})[_0x4cc7('0x22')](function(_0x122058){if(_0x122058){_0x421aff=_0x122058[_0x4cc7('0x36')];if(!_0x514ba4[_0x4cc7('0x30')]['hasOwnProperty'](_0x4cc7('0x38'))){_0xcd3d91[_0x4cc7('0x1d')]=qs[_0x4cc7('0x1d')](_0x514ba4[_0x4cc7('0x30')][_0x4cc7('0x1d')]);_0xcd3d91[_0x4cc7('0x1b')]=qs[_0x4cc7('0x1b')](_0x514ba4[_0x4cc7('0x30')][_0x4cc7('0x1b')]);}return _0x16e4d5[_0x4cc7('0x4e')](_0xcd3d91);}})['then'](function(_0x184161){if(_0x184161){return _0x184161?{'count':_0x421aff,'rows':_0x184161}:null;}})[_0x4cc7('0x22')](respondWithResult(_0x58454b,null))[_0x4cc7('0x43')](handleError(_0x58454b,null));};exports[_0x4cc7('0x4f')]=function(_0x27b59a,_0x3711e4,_0x24c46b){var _0x4159e9={};var _0x392919={};var _0x275dbd;var _0xcb2d5;return db['DeskConfiguration'][_0x4cc7('0x4b')]({'where':{'id':_0x27b59a['params']['id']}})['then'](handleEntityNotFound(_0x3711e4,null))[_0x4cc7('0x22')](function(_0x54a4be){if(_0x54a4be){_0x275dbd=_0x54a4be;_0x392919['model']=_[_0x4cc7('0x31')](db[_0x4cc7('0x50')][_0x4cc7('0x46')]);_0x392919['query']=_['keys'](_0x27b59a['query']);_0x392919[_0x4cc7('0x32')]=_[_0x4cc7('0x33')](_0x392919[_0x4cc7('0x2f')],_0x392919['query']);_0x4159e9['attributes']=_[_0x4cc7('0x33')](_0x392919[_0x4cc7('0x2f')],qs['fields'](_0x27b59a['query'][_0x4cc7('0x35')]));_0x4159e9[_0x4cc7('0x34')]=_0x4159e9[_0x4cc7('0x34')][_0x4cc7('0x36')]?_0x4159e9[_0x4cc7('0x34')]:_0x392919[_0x4cc7('0x2f')];_0x4159e9[_0x4cc7('0x4c')]=qs[_0x4cc7('0x39')](_0x27b59a[_0x4cc7('0x30')]['sort']);_0x4159e9[_0x4cc7('0x3a')]=qs['filters'](_[_0x4cc7('0x3b')](_0x27b59a[_0x4cc7('0x30')],_0x392919[_0x4cc7('0x32')]));if(_0x27b59a[_0x4cc7('0x30')][_0x4cc7('0x4d')]){_0x4159e9[_0x4cc7('0x3a')]=_[_0x4cc7('0x3c')](_0x4159e9[_0x4cc7('0x3a')],{'$or':_['map'](_0x4159e9[_0x4cc7('0x34')],function(_0x6b3d45){var _0x2d5f26={};_0x2d5f26[_0x6b3d45]={'$like':'%'+_0x27b59a[_0x4cc7('0x30')][_0x4cc7('0x4d')]+'%'};return _0x2d5f26;})});}_0x4159e9=_[_0x4cc7('0x3c')]({},_0x4159e9,_0x27b59a[_0x4cc7('0x3e')]);return _0x275dbd[_0x4cc7('0x4f')](_0x4159e9);}})[_0x4cc7('0x22')](function(_0xa7fdbe){if(_0xa7fdbe){_0xcb2d5=_0xa7fdbe[_0x4cc7('0x36')];if(!_0x27b59a[_0x4cc7('0x30')][_0x4cc7('0x37')](_0x4cc7('0x38'))){_0x4159e9[_0x4cc7('0x1d')]=qs[_0x4cc7('0x1d')](_0x27b59a[_0x4cc7('0x30')][_0x4cc7('0x1d')]);_0x4159e9[_0x4cc7('0x1b')]=qs[_0x4cc7('0x1b')](_0x27b59a[_0x4cc7('0x30')]['offset']);}return _0x275dbd['getSubjects'](_0x4159e9);}})[_0x4cc7('0x22')](function(_0x213af5){if(_0x213af5){return _0x213af5?{'count':_0xcb2d5,'rows':_0x213af5}:null;}})[_0x4cc7('0x22')](respondWithResult(_0x3711e4,null))['catch'](handleError(_0x3711e4,null));};exports[_0x4cc7('0x51')]=function(_0x3fa941,_0x229fde,_0x1566ec){var _0xa461b7={};var _0x31a8a3={};var _0x427380;var _0x36b0ff;return db[_0x4cc7('0x2b')]['findOne']({'where':{'id':_0x3fa941[_0x4cc7('0x45')]['id']}})[_0x4cc7('0x22')](handleEntityNotFound(_0x229fde,null))[_0x4cc7('0x22')](function(_0x176723){if(_0x176723){_0x427380=_0x176723;_0x31a8a3[_0x4cc7('0x2f')]=_[_0x4cc7('0x31')](db[_0x4cc7('0x50')][_0x4cc7('0x46')]);_0x31a8a3[_0x4cc7('0x30')]=_[_0x4cc7('0x31')](_0x3fa941[_0x4cc7('0x30')]);_0x31a8a3[_0x4cc7('0x32')]=_[_0x4cc7('0x33')](_0x31a8a3[_0x4cc7('0x2f')],_0x31a8a3[_0x4cc7('0x30')]);_0xa461b7[_0x4cc7('0x34')]=_[_0x4cc7('0x33')](_0x31a8a3['model'],qs[_0x4cc7('0x35')](_0x3fa941[_0x4cc7('0x30')][_0x4cc7('0x35')]));_0xa461b7[_0x4cc7('0x34')]=_0xa461b7['attributes']['length']?_0xa461b7[_0x4cc7('0x34')]:_0x31a8a3[_0x4cc7('0x2f')];_0xa461b7[_0x4cc7('0x4c')]=qs[_0x4cc7('0x39')](_0x3fa941['query']['sort']);_0xa461b7['where']=qs[_0x4cc7('0x32')](_[_0x4cc7('0x3b')](_0x3fa941[_0x4cc7('0x30')],_0x31a8a3[_0x4cc7('0x32')]));if(_0x3fa941[_0x4cc7('0x30')][_0x4cc7('0x4d')]){_0xa461b7[_0x4cc7('0x3a')]=_[_0x4cc7('0x3c')](_0xa461b7[_0x4cc7('0x3a')],{'$or':_['map'](_0xa461b7['attributes'],function(_0x2d34d1){var _0x10dc30={};_0x10dc30[_0x2d34d1]={'$like':'%'+_0x3fa941[_0x4cc7('0x30')][_0x4cc7('0x4d')]+'%'};return _0x10dc30;})});}_0xa461b7=_['merge']({},_0xa461b7,_0x3fa941[_0x4cc7('0x3e')]);return _0x427380['getDescriptions'](_0xa461b7);}})['then'](function(_0x108a62){if(_0x108a62){_0x36b0ff=_0x108a62[_0x4cc7('0x36')];if(!_0x3fa941[_0x4cc7('0x30')][_0x4cc7('0x37')](_0x4cc7('0x38'))){_0xa461b7[_0x4cc7('0x1d')]=qs[_0x4cc7('0x1d')](_0x3fa941[_0x4cc7('0x30')][_0x4cc7('0x1d')]);_0xa461b7['offset']=qs[_0x4cc7('0x1b')](_0x3fa941[_0x4cc7('0x30')][_0x4cc7('0x1b')]);}return _0x427380['getDescriptions'](_0xa461b7);}})[_0x4cc7('0x22')](function(_0x14f1c2){if(_0x14f1c2){return _0x14f1c2?{'count':_0x36b0ff,'rows':_0x14f1c2}:null;}})[_0x4cc7('0x22')](respondWithResult(_0x229fde,null))[_0x4cc7('0x43')](handleError(_0x229fde,null));};exports[_0x4cc7('0x52')]=function(_0x27a59c,_0xd40fa5,_0x3c7a6d){var _0x378e96={};var _0x3f6ffb={};var _0x2ecaae;var _0x11e562;return db['DeskConfiguration'][_0x4cc7('0x4b')]({'where':{'id':_0x27a59c['params']['id']}})[_0x4cc7('0x22')](handleEntityNotFound(_0xd40fa5,null))[_0x4cc7('0x22')](function(_0x21792f){if(_0x21792f){_0x2ecaae=_0x21792f;_0x3f6ffb['model']=_[_0x4cc7('0x31')](db[_0x4cc7('0x53')][_0x4cc7('0x46')]);_0x3f6ffb[_0x4cc7('0x30')]=_['keys'](_0x27a59c['query']);_0x3f6ffb['filters']=_[_0x4cc7('0x33')](_0x3f6ffb[_0x4cc7('0x2f')],_0x3f6ffb[_0x4cc7('0x30')]);_0x378e96[_0x4cc7('0x34')]=_[_0x4cc7('0x33')](_0x3f6ffb['model'],qs['fields'](_0x27a59c[_0x4cc7('0x30')][_0x4cc7('0x35')]));_0x378e96[_0x4cc7('0x34')]=_0x378e96[_0x4cc7('0x34')][_0x4cc7('0x36')]?_0x378e96[_0x4cc7('0x34')]:_0x3f6ffb[_0x4cc7('0x2f')];_0x378e96[_0x4cc7('0x4c')]=qs['sort'](_0x27a59c[_0x4cc7('0x30')]['sort']);_0x378e96[_0x4cc7('0x3a')]=qs[_0x4cc7('0x32')](_['pick'](_0x27a59c['query'],_0x3f6ffb['filters']));if(_0x27a59c[_0x4cc7('0x30')]['filter']){_0x378e96[_0x4cc7('0x3a')]=_[_0x4cc7('0x3c')](_0x378e96[_0x4cc7('0x3a')],{'$or':_[_0x4cc7('0x2a')](_0x378e96['attributes'],function(_0x52b6a3){var _0x58b8af={};_0x58b8af[_0x52b6a3]={'$like':'%'+_0x27a59c['query'][_0x4cc7('0x4d')]+'%'};return _0x58b8af;})});}_0x378e96=_['merge']({},_0x378e96,_0x27a59c[_0x4cc7('0x3e')]);return _0x2ecaae[_0x4cc7('0x52')](_0x378e96);}})[_0x4cc7('0x22')](function(_0x310415){if(_0x310415){_0x11e562=_0x310415[_0x4cc7('0x36')];if(!_0x27a59c[_0x4cc7('0x30')]['hasOwnProperty'](_0x4cc7('0x38'))){_0x378e96['limit']=qs[_0x4cc7('0x1d')](_0x27a59c['query'][_0x4cc7('0x1d')]);_0x378e96[_0x4cc7('0x1b')]=qs[_0x4cc7('0x1b')](_0x27a59c[_0x4cc7('0x30')][_0x4cc7('0x1b')]);}return _0x2ecaae[_0x4cc7('0x52')](_0x378e96);}})[_0x4cc7('0x22')](function(_0x3d2c03){if(_0x3d2c03){return _0x3d2c03?{'count':_0x11e562,'rows':_0x3d2c03}:null;}})[_0x4cc7('0x22')](respondWithResult(_0xd40fa5,null))[_0x4cc7('0x43')](handleError(_0xd40fa5,null));};exports[_0x4cc7('0x54')]=function(_0x4fe1cb,_0x54ae42,_0x32be63){if(_0x4fe1cb[_0x4cc7('0x49')]['id']){delete _0x4fe1cb[_0x4cc7('0x49')]['id'];}return db[_0x4cc7('0x2b')][_0x4cc7('0x4b')]({'where':{'id':_0x4fe1cb['params']['id']}})[_0x4cc7('0x22')](handleEntityNotFound(_0x54ae42,null))['then'](function(_0x5bb340){if(_0x5bb340){return _0x5bb340[_0x4cc7('0x54')](_0x4fe1cb['body'][_0x4cc7('0x55')]||[]);}return null;})[_0x4cc7('0x22')](respondWithResult(_0x54ae42,null))['catch'](handleError(_0x54ae42,null));};
\ No newline at end of file
+var _0x1fe2=['json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','DeskConfiguration','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','fields','options','find','body','getFields','DeskField','sort','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x1fe0dc,_0x3848ca){var _0x2a9361=function(_0x463e30){while(--_0x463e30){_0x1fe0dc['push'](_0x1fe0dc['shift']());}};_0x2a9361(++_0x3848ca);}(_0x1fe2,0x8b));var _0x21fe=function(_0x1372f4,_0xf42e90){_0x1372f4=_0x1372f4-0x0;var _0x59f08d=_0x1fe2[_0x1372f4];return _0x59f08d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x21fe('0x0'));var zipdir=require(_0x21fe('0x1'));var jsonpatch=require(_0x21fe('0x2'));var rp=require(_0x21fe('0x3'));var moment=require(_0x21fe('0x4'));var BPromise=require(_0x21fe('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x21fe('0x6'));var csv=require(_0x21fe('0x7'));var ejs=require(_0x21fe('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x21fe('0x9'));var jsforce=require(_0x21fe('0xa'));var deskjs=require(_0x21fe('0xb'));var toCsv=require(_0x21fe('0x7'));var querystring=require(_0x21fe('0xc'));var Papa=require('papaparse');var Redis=require(_0x21fe('0xd'));var authService=require(_0x21fe('0xe'));var qs=require(_0x21fe('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x21fe('0x10'));var logger=require('../../config/logger')(_0x21fe('0x11'));var utils=require(_0x21fe('0x12'));var config=require(_0x21fe('0x13'));var licenseUtil=require(_0x21fe('0x14'));var db=require(_0x21fe('0x15'))['db'];function respondWithStatusCode(_0x3ed711,_0x2b6b84){_0x2b6b84=_0x2b6b84||0xcc;return function(_0x1d1d9f){if(_0x1d1d9f){return _0x3ed711[_0x21fe('0x16')](_0x2b6b84);}return _0x3ed711[_0x21fe('0x17')](_0x2b6b84)[_0x21fe('0x18')]();};}function respondWithResult(_0x4d1fa0,_0x42d9a8){_0x42d9a8=_0x42d9a8||0xc8;return function(_0x44d685){if(_0x44d685){return _0x4d1fa0[_0x21fe('0x17')](_0x42d9a8)[_0x21fe('0x19')](_0x44d685);}};}function respondWithFilteredResult(_0x2e3744,_0x3d4159){return function(_0x25469c){if(_0x25469c){var _0x43f987=typeof _0x3d4159[_0x21fe('0x1a')]===_0x21fe('0x1b')&&typeof _0x3d4159['limit']===_0x21fe('0x1b');var _0x437441=_0x25469c[_0x21fe('0x1c')];var _0x18b3cc=_0x43f987?0x0:_0x3d4159[_0x21fe('0x1a')];var _0x37c605=_0x43f987?_0x25469c[_0x21fe('0x1c')]:_0x3d4159['offset']+_0x3d4159[_0x21fe('0x1d')];var _0x2fac90;if(_0x37c605>=_0x437441){_0x37c605=_0x437441;_0x2fac90=0xc8;}else{_0x2fac90=0xce;}_0x2e3744['status'](_0x2fac90);return _0x2e3744[_0x21fe('0x1e')](_0x21fe('0x1f'),_0x18b3cc+'-'+_0x37c605+'/'+_0x437441)[_0x21fe('0x19')](_0x25469c);}return null;};}function patchUpdates(_0x431739){return function(_0x20dcdc){try{jsonpatch[_0x21fe('0x20')](_0x20dcdc,_0x431739,!![]);}catch(_0x251a72){return BPromise[_0x21fe('0x21')](_0x251a72);}return _0x20dcdc[_0x21fe('0x22')]();};}function saveUpdates(_0x247b77,_0x3cb25f){return function(_0x5f055a){if(_0x5f055a){return _0x5f055a[_0x21fe('0x23')](_0x247b77)[_0x21fe('0x24')](function(_0x233762){return _0x233762;});}return null;};}function removeEntity(_0x4576d4,_0x519a34){return function(_0x1b9c64){if(_0x1b9c64){return _0x1b9c64[_0x21fe('0x25')]()[_0x21fe('0x24')](function(){_0x4576d4[_0x21fe('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50d421,_0x4bf781){return function(_0x34c53c){if(!_0x34c53c){_0x50d421['sendStatus'](0x194);}return _0x34c53c;};}function handleError(_0x269c10,_0x340c47){_0x340c47=_0x340c47||0x1f4;return function(_0x5d6521){logger[_0x21fe('0x26')](_0x5d6521[_0x21fe('0x27')]);if(_0x5d6521[_0x21fe('0x28')]){delete _0x5d6521[_0x21fe('0x28')];}_0x269c10[_0x21fe('0x17')](_0x340c47)[_0x21fe('0x29')](_0x5d6521);};}exports['index']=function(_0x4369cb,_0x50e9fb){var _0x255d62={},_0xbfd383={},_0x2831f3={'count':0x0,'rows':[]};var _0xcfda24=_['map'](db[_0x21fe('0x2a')][_0x21fe('0x2b')],function(_0x5b1204){return{'name':_0x5b1204[_0x21fe('0x2c')],'type':_0x5b1204[_0x21fe('0x2d')]['key']};});_0xbfd383['model']=_[_0x21fe('0x2e')](_0xcfda24,_0x21fe('0x28'));_0xbfd383[_0x21fe('0x2f')]=_[_0x21fe('0x30')](_0x4369cb[_0x21fe('0x2f')]);_0xbfd383[_0x21fe('0x31')]=_[_0x21fe('0x32')](_0xbfd383[_0x21fe('0x33')],_0xbfd383[_0x21fe('0x2f')]);_0x255d62[_0x21fe('0x34')]=_['intersection'](_0xbfd383[_0x21fe('0x33')],qs['fields'](_0x4369cb[_0x21fe('0x2f')]['fields']));_0x255d62[_0x21fe('0x34')]=_0x255d62[_0x21fe('0x34')][_0x21fe('0x35')]?_0x255d62['attributes']:_0xbfd383[_0x21fe('0x33')];if(!_0x4369cb[_0x21fe('0x2f')][_0x21fe('0x36')](_0x21fe('0x37'))){_0x255d62['limit']=qs[_0x21fe('0x1d')](_0x4369cb[_0x21fe('0x2f')][_0x21fe('0x1d')]);_0x255d62[_0x21fe('0x1a')]=qs[_0x21fe('0x1a')](_0x4369cb[_0x21fe('0x2f')][_0x21fe('0x1a')]);}_0x255d62[_0x21fe('0x38')]=qs['sort'](_0x4369cb['query']['sort']);_0x255d62[_0x21fe('0x39')]=qs['filters'](_[_0x21fe('0x3a')](_0x4369cb[_0x21fe('0x2f')],_0xbfd383[_0x21fe('0x31')]),_0xcfda24);if(_0x4369cb[_0x21fe('0x2f')][_0x21fe('0x3b')]){_0x255d62[_0x21fe('0x39')]=_[_0x21fe('0x3c')](_0x255d62[_0x21fe('0x39')],{'$or':_[_0x21fe('0x2e')](_0xcfda24,function(_0x3f5020){if(_0x3f5020[_0x21fe('0x2d')]!==_0x21fe('0x3d')){var _0x50a916={};_0x50a916[_0x3f5020[_0x21fe('0x28')]]={'$like':'%'+_0x4369cb[_0x21fe('0x2f')][_0x21fe('0x3b')]+'%'};return _0x50a916;}})});}_0x255d62=_[_0x21fe('0x3c')]({},_0x255d62,_0x4369cb['options']);var _0x3c3d54={'where':_0x255d62[_0x21fe('0x39')]};return db[_0x21fe('0x2a')][_0x21fe('0x1c')](_0x3c3d54)[_0x21fe('0x24')](function(_0x3689f3){_0x2831f3[_0x21fe('0x1c')]=_0x3689f3;if(_0x4369cb[_0x21fe('0x2f')][_0x21fe('0x3e')]){_0x255d62[_0x21fe('0x3f')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x21fe('0x40')](_0x255d62);})[_0x21fe('0x24')](function(_0x4b1bda){_0x2831f3[_0x21fe('0x41')]=_0x4b1bda;return _0x2831f3;})[_0x21fe('0x24')](respondWithFilteredResult(_0x50e9fb,_0x255d62))[_0x21fe('0x42')](handleError(_0x50e9fb,null));};exports[_0x21fe('0x43')]=function(_0x4f8505,_0x90d1fb){var _0x464dea={'raw':![],'where':{'id':_0x4f8505[_0x21fe('0x44')]['id']}},_0x2782d9={};_0x2782d9[_0x21fe('0x33')]=_[_0x21fe('0x30')](db[_0x21fe('0x2a')][_0x21fe('0x2b')]);_0x2782d9['query']=_[_0x21fe('0x30')](_0x4f8505[_0x21fe('0x2f')]);_0x2782d9[_0x21fe('0x31')]=_[_0x21fe('0x32')](_0x2782d9[_0x21fe('0x33')],_0x2782d9['query']);_0x464dea[_0x21fe('0x34')]=_[_0x21fe('0x32')](_0x2782d9[_0x21fe('0x33')],qs[_0x21fe('0x45')](_0x4f8505[_0x21fe('0x2f')][_0x21fe('0x45')]));_0x464dea[_0x21fe('0x34')]=_0x464dea[_0x21fe('0x34')]['length']?_0x464dea[_0x21fe('0x34')]:_0x2782d9[_0x21fe('0x33')];if(_0x4f8505[_0x21fe('0x2f')][_0x21fe('0x3e')]){_0x464dea[_0x21fe('0x3f')]=[{'all':!![]}];}_0x464dea=_['merge']({},_0x464dea,_0x4f8505[_0x21fe('0x46')]);return db[_0x21fe('0x2a')][_0x21fe('0x47')](_0x464dea)[_0x21fe('0x24')](handleEntityNotFound(_0x90d1fb,null))['then'](respondWithResult(_0x90d1fb,null))['catch'](handleError(_0x90d1fb,null));};exports['create']=function(_0x26c545,_0x3c3847){return db[_0x21fe('0x2a')]['create'](_0x26c545['body'],{})[_0x21fe('0x24')](respondWithResult(_0x3c3847,0xc9))[_0x21fe('0x42')](handleError(_0x3c3847,null));};exports['update']=function(_0x35401f,_0x11a1fe){if(_0x35401f['body']['id']){delete _0x35401f[_0x21fe('0x48')]['id'];}return db[_0x21fe('0x2a')][_0x21fe('0x47')]({'where':{'id':_0x35401f[_0x21fe('0x44')]['id']}})[_0x21fe('0x24')](handleEntityNotFound(_0x11a1fe,null))[_0x21fe('0x24')](saveUpdates(_0x35401f['body'],null))[_0x21fe('0x24')](respondWithResult(_0x11a1fe,null))[_0x21fe('0x42')](handleError(_0x11a1fe,null));};exports[_0x21fe('0x25')]=function(_0x18f83a,_0x843a5a){return db[_0x21fe('0x2a')][_0x21fe('0x47')]({'where':{'id':_0x18f83a[_0x21fe('0x44')]['id']}})['then'](handleEntityNotFound(_0x843a5a,null))[_0x21fe('0x24')](removeEntity(_0x843a5a,null))[_0x21fe('0x42')](handleError(_0x843a5a,null));};exports[_0x21fe('0x49')]=function(_0x13b501,_0x39a7df,_0x17a185){var _0x3ea672={};var _0x13d353={};var _0xdf38ef;var _0x31cc9f;return db[_0x21fe('0x2a')]['findOne']({'where':{'id':_0x13b501[_0x21fe('0x44')]['id']}})['then'](handleEntityNotFound(_0x39a7df,null))['then'](function(_0x2063bf){if(_0x2063bf){_0xdf38ef=_0x2063bf;_0x13d353[_0x21fe('0x33')]=_[_0x21fe('0x30')](db[_0x21fe('0x4a')][_0x21fe('0x2b')]);_0x13d353[_0x21fe('0x2f')]=_[_0x21fe('0x30')](_0x13b501[_0x21fe('0x2f')]);_0x13d353[_0x21fe('0x31')]=_[_0x21fe('0x32')](_0x13d353['model'],_0x13d353[_0x21fe('0x2f')]);_0x3ea672[_0x21fe('0x34')]=_[_0x21fe('0x32')](_0x13d353['model'],qs[_0x21fe('0x45')](_0x13b501['query'][_0x21fe('0x45')]));_0x3ea672['attributes']=_0x3ea672[_0x21fe('0x34')][_0x21fe('0x35')]?_0x3ea672[_0x21fe('0x34')]:_0x13d353['model'];_0x3ea672['order']=qs['sort'](_0x13b501['query'][_0x21fe('0x4b')]);_0x3ea672[_0x21fe('0x39')]=qs[_0x21fe('0x31')](_[_0x21fe('0x3a')](_0x13b501['query'],_0x13d353[_0x21fe('0x31')]));if(_0x13b501[_0x21fe('0x2f')][_0x21fe('0x3b')]){_0x3ea672[_0x21fe('0x39')]=_['merge'](_0x3ea672[_0x21fe('0x39')],{'$or':_[_0x21fe('0x2e')](_0x3ea672[_0x21fe('0x34')],function(_0x1614a8){var _0x55f083={};_0x55f083[_0x1614a8]={'$like':'%'+_0x13b501[_0x21fe('0x2f')][_0x21fe('0x3b')]+'%'};return _0x55f083;})});}_0x3ea672=_[_0x21fe('0x3c')]({},_0x3ea672,_0x13b501[_0x21fe('0x46')]);return _0xdf38ef[_0x21fe('0x49')](_0x3ea672);}})[_0x21fe('0x24')](function(_0x35f068){if(_0x35f068){_0x31cc9f=_0x35f068[_0x21fe('0x35')];if(!_0x13b501['query'][_0x21fe('0x36')]('nolimit')){_0x3ea672[_0x21fe('0x1d')]=qs[_0x21fe('0x1d')](_0x13b501['query']['limit']);_0x3ea672[_0x21fe('0x1a')]=qs['offset'](_0x13b501['query'][_0x21fe('0x1a')]);}return _0xdf38ef[_0x21fe('0x49')](_0x3ea672);}})[_0x21fe('0x24')](function(_0x262f2b){if(_0x262f2b){return _0x262f2b?{'count':_0x31cc9f,'rows':_0x262f2b}:null;}})['then'](respondWithResult(_0x39a7df,null))['catch'](handleError(_0x39a7df,null));};exports[_0x21fe('0x4c')]=function(_0x63c44f,_0x3f42db,_0x3e24a0){var _0x52cc8f={};var _0x3ce69a={};var _0x31654b;var _0x51b5ef;return db[_0x21fe('0x2a')][_0x21fe('0x4d')]({'where':{'id':_0x63c44f[_0x21fe('0x44')]['id']}})['then'](handleEntityNotFound(_0x3f42db,null))[_0x21fe('0x24')](function(_0x2a0eaa){if(_0x2a0eaa){_0x31654b=_0x2a0eaa;_0x3ce69a[_0x21fe('0x33')]=_[_0x21fe('0x30')](db['DeskField'][_0x21fe('0x2b')]);_0x3ce69a['query']=_[_0x21fe('0x30')](_0x63c44f[_0x21fe('0x2f')]);_0x3ce69a['filters']=_[_0x21fe('0x32')](_0x3ce69a[_0x21fe('0x33')],_0x3ce69a[_0x21fe('0x2f')]);_0x52cc8f[_0x21fe('0x34')]=_['intersection'](_0x3ce69a[_0x21fe('0x33')],qs[_0x21fe('0x45')](_0x63c44f[_0x21fe('0x2f')][_0x21fe('0x45')]));_0x52cc8f['attributes']=_0x52cc8f[_0x21fe('0x34')][_0x21fe('0x35')]?_0x52cc8f[_0x21fe('0x34')]:_0x3ce69a[_0x21fe('0x33')];_0x52cc8f[_0x21fe('0x38')]=qs[_0x21fe('0x4b')](_0x63c44f[_0x21fe('0x2f')]['sort']);_0x52cc8f['where']=qs[_0x21fe('0x31')](_[_0x21fe('0x3a')](_0x63c44f['query'],_0x3ce69a[_0x21fe('0x31')]));if(_0x63c44f[_0x21fe('0x2f')][_0x21fe('0x3b')]){_0x52cc8f[_0x21fe('0x39')]=_[_0x21fe('0x3c')](_0x52cc8f[_0x21fe('0x39')],{'$or':_['map'](_0x52cc8f[_0x21fe('0x34')],function(_0x3815c4){var _0x3227ab={};_0x3227ab[_0x3815c4]={'$like':'%'+_0x63c44f[_0x21fe('0x2f')][_0x21fe('0x3b')]+'%'};return _0x3227ab;})});}_0x52cc8f=_['merge']({},_0x52cc8f,_0x63c44f[_0x21fe('0x46')]);return _0x31654b[_0x21fe('0x4c')](_0x52cc8f);}})['then'](function(_0x5c5363){if(_0x5c5363){_0x51b5ef=_0x5c5363[_0x21fe('0x35')];if(!_0x63c44f[_0x21fe('0x2f')][_0x21fe('0x36')]('nolimit')){_0x52cc8f[_0x21fe('0x1d')]=qs[_0x21fe('0x1d')](_0x63c44f[_0x21fe('0x2f')]['limit']);_0x52cc8f[_0x21fe('0x1a')]=qs[_0x21fe('0x1a')](_0x63c44f[_0x21fe('0x2f')][_0x21fe('0x1a')]);}return _0x31654b[_0x21fe('0x4c')](_0x52cc8f);}})[_0x21fe('0x24')](function(_0x1fbfc6){if(_0x1fbfc6){return _0x1fbfc6?{'count':_0x51b5ef,'rows':_0x1fbfc6}:null;}})['then'](respondWithResult(_0x3f42db,null))[_0x21fe('0x42')](handleError(_0x3f42db,null));};exports[_0x21fe('0x4e')]=function(_0x150efa,_0x2ea270,_0x53cffa){var _0x1a1e92={};var _0x43148b={};var _0x1a6ba4;var _0x388473;return db[_0x21fe('0x2a')]['findOne']({'where':{'id':_0x150efa[_0x21fe('0x44')]['id']}})[_0x21fe('0x24')](handleEntityNotFound(_0x2ea270,null))[_0x21fe('0x24')](function(_0x5b26d2){if(_0x5b26d2){_0x1a6ba4=_0x5b26d2;_0x43148b['model']=_[_0x21fe('0x30')](db[_0x21fe('0x4a')]['rawAttributes']);_0x43148b[_0x21fe('0x2f')]=_[_0x21fe('0x30')](_0x150efa['query']);_0x43148b['filters']=_[_0x21fe('0x32')](_0x43148b['model'],_0x43148b[_0x21fe('0x2f')]);_0x1a1e92[_0x21fe('0x34')]=_[_0x21fe('0x32')](_0x43148b[_0x21fe('0x33')],qs['fields'](_0x150efa[_0x21fe('0x2f')]['fields']));_0x1a1e92[_0x21fe('0x34')]=_0x1a1e92[_0x21fe('0x34')]['length']?_0x1a1e92[_0x21fe('0x34')]:_0x43148b[_0x21fe('0x33')];_0x1a1e92[_0x21fe('0x38')]=qs[_0x21fe('0x4b')](_0x150efa[_0x21fe('0x2f')]['sort']);_0x1a1e92[_0x21fe('0x39')]=qs[_0x21fe('0x31')](_[_0x21fe('0x3a')](_0x150efa[_0x21fe('0x2f')],_0x43148b[_0x21fe('0x31')]));if(_0x150efa[_0x21fe('0x2f')][_0x21fe('0x3b')]){_0x1a1e92[_0x21fe('0x39')]=_[_0x21fe('0x3c')](_0x1a1e92[_0x21fe('0x39')],{'$or':_[_0x21fe('0x2e')](_0x1a1e92[_0x21fe('0x34')],function(_0x377127){var _0x2316c5={};_0x2316c5[_0x377127]={'$like':'%'+_0x150efa[_0x21fe('0x2f')][_0x21fe('0x3b')]+'%'};return _0x2316c5;})});}_0x1a1e92=_[_0x21fe('0x3c')]({},_0x1a1e92,_0x150efa[_0x21fe('0x46')]);return _0x1a6ba4[_0x21fe('0x4e')](_0x1a1e92);}})[_0x21fe('0x24')](function(_0x344024){if(_0x344024){_0x388473=_0x344024[_0x21fe('0x35')];if(!_0x150efa[_0x21fe('0x2f')]['hasOwnProperty'](_0x21fe('0x37'))){_0x1a1e92[_0x21fe('0x1d')]=qs[_0x21fe('0x1d')](_0x150efa[_0x21fe('0x2f')][_0x21fe('0x1d')]);_0x1a1e92[_0x21fe('0x1a')]=qs[_0x21fe('0x1a')](_0x150efa[_0x21fe('0x2f')]['offset']);}return _0x1a6ba4[_0x21fe('0x4e')](_0x1a1e92);}})[_0x21fe('0x24')](function(_0x4c5df0){if(_0x4c5df0){return _0x4c5df0?{'count':_0x388473,'rows':_0x4c5df0}:null;}})[_0x21fe('0x24')](respondWithResult(_0x2ea270,null))[_0x21fe('0x42')](handleError(_0x2ea270,null));};exports[_0x21fe('0x4f')]=function(_0x10ce71,_0x345326,_0x3c5c95){var _0xac2767={};var _0x4e1e7c={};var _0x16d54f;var _0x357e02;return db['DeskConfiguration']['findOne']({'where':{'id':_0x10ce71['params']['id']}})[_0x21fe('0x24')](handleEntityNotFound(_0x345326,null))[_0x21fe('0x24')](function(_0x60a97e){if(_0x60a97e){_0x16d54f=_0x60a97e;_0x4e1e7c[_0x21fe('0x33')]=_[_0x21fe('0x30')](db[_0x21fe('0x50')]['rawAttributes']);_0x4e1e7c[_0x21fe('0x2f')]=_['keys'](_0x10ce71[_0x21fe('0x2f')]);_0x4e1e7c[_0x21fe('0x31')]=_[_0x21fe('0x32')](_0x4e1e7c[_0x21fe('0x33')],_0x4e1e7c[_0x21fe('0x2f')]);_0xac2767[_0x21fe('0x34')]=_[_0x21fe('0x32')](_0x4e1e7c[_0x21fe('0x33')],qs[_0x21fe('0x45')](_0x10ce71[_0x21fe('0x2f')]['fields']));_0xac2767['attributes']=_0xac2767['attributes'][_0x21fe('0x35')]?_0xac2767[_0x21fe('0x34')]:_0x4e1e7c[_0x21fe('0x33')];_0xac2767[_0x21fe('0x38')]=qs[_0x21fe('0x4b')](_0x10ce71[_0x21fe('0x2f')]['sort']);_0xac2767[_0x21fe('0x39')]=qs['filters'](_[_0x21fe('0x3a')](_0x10ce71[_0x21fe('0x2f')],_0x4e1e7c[_0x21fe('0x31')]));if(_0x10ce71['query']['filter']){_0xac2767[_0x21fe('0x39')]=_['merge'](_0xac2767[_0x21fe('0x39')],{'$or':_[_0x21fe('0x2e')](_0xac2767[_0x21fe('0x34')],function(_0x201aa9){var _0x3abc55={};_0x3abc55[_0x201aa9]={'$like':'%'+_0x10ce71['query'][_0x21fe('0x3b')]+'%'};return _0x3abc55;})});}_0xac2767=_['merge']({},_0xac2767,_0x10ce71['options']);return _0x16d54f[_0x21fe('0x4f')](_0xac2767);}})[_0x21fe('0x24')](function(_0x1ea9a1){if(_0x1ea9a1){_0x357e02=_0x1ea9a1[_0x21fe('0x35')];if(!_0x10ce71[_0x21fe('0x2f')][_0x21fe('0x36')](_0x21fe('0x37'))){_0xac2767['limit']=qs[_0x21fe('0x1d')](_0x10ce71['query'][_0x21fe('0x1d')]);_0xac2767[_0x21fe('0x1a')]=qs['offset'](_0x10ce71[_0x21fe('0x2f')][_0x21fe('0x1a')]);}return _0x16d54f['getTags'](_0xac2767);}})[_0x21fe('0x24')](function(_0x5a563f){if(_0x5a563f){return _0x5a563f?{'count':_0x357e02,'rows':_0x5a563f}:null;}})['then'](respondWithResult(_0x345326,null))[_0x21fe('0x42')](handleError(_0x345326,null));};exports[_0x21fe('0x51')]=function(_0x58be08,_0x16099b,_0x5050f7){if(_0x58be08['body']['id']){delete _0x58be08[_0x21fe('0x48')]['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0x58be08[_0x21fe('0x44')]['id']}})['then'](handleEntityNotFound(_0x16099b,null))[_0x21fe('0x24')](function(_0x5be8b6){if(_0x5be8b6){return _0x5be8b6[_0x21fe('0x51')](_0x58be08[_0x21fe('0x48')]['ids']||[]);}return null;})['then'](respondWithResult(_0x16099b,null))['catch'](handleError(_0x16099b,null));};
\ No newline at end of file
index 5f53795..be10485 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7bc=['request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','lodash','util','../../config/logger','moment','bluebird'];(function(_0x1d617b,_0x2214e7){var _0x278fb5=function(_0x4f4a45){while(--_0x4f4a45){_0x1d617b['push'](_0x1d617b['shift']());}};_0x278fb5(++_0x2214e7);}(_0xe7bc,0x19f));var _0xce7b=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0xe7bc[_0x51c819];return _0x15c5d2;};'use strict';var _=require(_0xce7b('0x0'));var util=require(_0xce7b('0x1'));var logger=require(_0xce7b('0x2'))('api');var moment=require(_0xce7b('0x3'));var BPromise=require(_0xce7b('0x4'));var rp=require(_0xce7b('0x5'));var fs=require('fs');var path=require(_0xce7b('0x6'));var rimraf=require(_0xce7b('0x7'));var config=require(_0xce7b('0x8'));var attributes=require(_0xce7b('0x9'));module[_0xce7b('0xa')]=function(_0x4fba55,_0x352aa2){return _0x4fba55[_0xce7b('0xb')]('DeskConfiguration',attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3765=['bluebird','request-promise','path','./intDeskConfiguration.attributes','DeskConfiguration','int_desk_configurations','util','../../config/logger','api'];(function(_0x19cc99,_0x460611){var _0x458dbd=function(_0x299aef){while(--_0x299aef){_0x19cc99['push'](_0x19cc99['shift']());}};_0x458dbd(++_0x460611);}(_0x3765,0x72));var _0x5376=function(_0x4be2eb,_0x344874){_0x4be2eb=_0x4be2eb-0x0;var _0x46ffb5=_0x3765[_0x4be2eb];return _0x46ffb5;};'use strict';var _=require('lodash');var util=require(_0x5376('0x0'));var logger=require(_0x5376('0x1'))(_0x5376('0x2'));var moment=require('moment');var BPromise=require(_0x5376('0x3'));var rp=require(_0x5376('0x4'));var fs=require('fs');var path=require(_0x5376('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5376('0x6'));module['exports']=function(_0x4738ef,_0x1e4965){return _0x4738ef['define'](_0x5376('0x7'),attributes,{'tableName':_0x5376('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f08a39c..7f6f915 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80e6=['code','DeskConfiguration,\x20%s,\x20%s','message','result','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x60ff93,_0x51b87a){var _0x26bf1f=function(_0x5067f2){while(--_0x5067f2){_0x60ff93['push'](_0x60ff93['shift']());}};_0x26bf1f(++_0x51b87a);}(_0x80e6,0x1e7));var _0x680e=function(_0x1e893a,_0x5b4ada){_0x1e893a=_0x1e893a-0x0;var _0x3ee1db=_0x80e6[_0x1e893a];return _0x3ee1db;};'use strict';var _=require('lodash');var util=require(_0x680e('0x0'));var moment=require(_0x680e('0x1'));var BPromise=require('bluebird');var rs=require(_0x680e('0x2'));var fs=require('fs');var Redis=require(_0x680e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x680e('0x4'));var logger=require('../../config/logger')(_0x680e('0x5'));var config=require(_0x680e('0x6'));var jayson=require(_0x680e('0x7'));var client=jayson[_0x680e('0x8')][_0x680e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29ce29,_0xd5da80,_0x2026f7){return new BPromise(function(_0x125aeb,_0x2c0ae6){return client[_0x680e('0xa')](_0x29ce29,_0x2026f7)[_0x680e('0xb')](function(_0x18f7e3){logger[_0x680e('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0xd5da80,'request\x20sent');logger['debug'](_0x680e('0xd'),_0xd5da80,_0x680e('0xe'),JSON[_0x680e('0xf')](_0x18f7e3));if(_0x18f7e3[_0x680e('0x10')]){if(_0x18f7e3['error'][_0x680e('0x11')]===0x1f4){logger[_0x680e('0x10')](_0x680e('0x12'),_0xd5da80,_0x18f7e3[_0x680e('0x10')]['message']);return _0x2c0ae6(_0x18f7e3[_0x680e('0x10')][_0x680e('0x13')]);}logger[_0x680e('0x10')](_0x680e('0x12'),_0xd5da80,_0x18f7e3[_0x680e('0x10')][_0x680e('0x13')]);return _0x125aeb(_0x18f7e3[_0x680e('0x10')][_0x680e('0x13')]);}else{logger[_0x680e('0xc')](_0x680e('0x12'),_0xd5da80,_0x680e('0xe'));_0x125aeb(_0x18f7e3[_0x680e('0x14')][_0x680e('0x13')]);}})['catch'](function(_0x2af1c7){logger[_0x680e('0x10')](_0x680e('0x12'),_0xd5da80,_0x2af1c7);_0x2c0ae6(_0x2af1c7);});});}
\ No newline at end of file
+var _0x6334=['../../config/environment','jayson/promise','client','http','request','info','DeskConfiguration,\x20%s,\x20%s','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x6334,0x168));var _0x4633=function(_0x4e6cbb,_0x3450f0){_0x4e6cbb=_0x4e6cbb-0x0;var _0x15ced4=_0x6334[_0x4e6cbb];return _0x15ced4;};'use strict';var _=require('lodash');var util=require(_0x4633('0x0'));var moment=require(_0x4633('0x1'));var BPromise=require(_0x4633('0x2'));var rs=require(_0x4633('0x3'));var fs=require('fs');var Redis=require(_0x4633('0x4'));var db=require(_0x4633('0x5'))['db'];var utils=require(_0x4633('0x6'));var logger=require(_0x4633('0x7'))('rpc');var config=require(_0x4633('0x8'));var jayson=require(_0x4633('0x9'));var client=jayson[_0x4633('0xa')][_0x4633('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34caaf,_0x38679f,_0x23e09f){return new BPromise(function(_0x5a7f7a,_0xff5160){return client[_0x4633('0xc')](_0x34caaf,_0x23e09f)['then'](function(_0x33516d){logger[_0x4633('0xd')](_0x4633('0xe'),_0x38679f,'request\x20sent');logger['debug'](_0x4633('0xf'),_0x38679f,_0x4633('0x10'),JSON[_0x4633('0x11')](_0x33516d));if(_0x33516d[_0x4633('0x12')]){if(_0x33516d[_0x4633('0x12')][_0x4633('0x13')]===0x1f4){logger[_0x4633('0x12')](_0x4633('0xe'),_0x38679f,_0x33516d[_0x4633('0x12')]['message']);return _0xff5160(_0x33516d[_0x4633('0x12')][_0x4633('0x14')]);}logger[_0x4633('0x12')](_0x4633('0xe'),_0x38679f,_0x33516d[_0x4633('0x12')][_0x4633('0x14')]);return _0x5a7f7a(_0x33516d[_0x4633('0x12')][_0x4633('0x14')]);}else{logger[_0x4633('0xd')](_0x4633('0xe'),_0x38679f,_0x4633('0x10'));_0x5a7f7a(_0x33516d[_0x4633('0x15')]['message']);}})[_0x4633('0x16')](function(_0x11020e){logger[_0x4633('0x12')](_0x4633('0xe'),_0x38679f,_0x11020e);_0xff5160(_0x11020e);});});}
\ No newline at end of file
index 30c5cf1..158c7df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3f3=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x31bfbb,_0x3476ce){var _0x6d6cdd=function(_0x55d12e){while(--_0x55d12e){_0x31bfbb['push'](_0x31bfbb['shift']());}};_0x6d6cdd(++_0x3476ce);}(_0xd3f3,0xf0));var _0x3d3f=function(_0x591963,_0x4b650c){_0x591963=_0x591963-0x0;var _0x1b42bc=_0xd3f3[_0x591963];return _0x1b42bc;};'use strict';var multer=require(_0x3d3f('0x0'));var util=require('util');var path=require(_0x3d3f('0x1'));var timeout=require(_0x3d3f('0x2'));var express=require(_0x3d3f('0x3'));var router=express[_0x3d3f('0x4')]();var fs_extra=require(_0x3d3f('0x5'));var auth=require(_0x3d3f('0x6'));var interaction=require(_0x3d3f('0x7'));var config=require(_0x3d3f('0x8'));var controller=require('./intDeskField.controller');router[_0x3d3f('0x9')]('/',auth[_0x3d3f('0xa')](),controller[_0x3d3f('0xb')]);router[_0x3d3f('0x9')](_0x3d3f('0xc'),auth[_0x3d3f('0xa')](),controller[_0x3d3f('0xd')]);router[_0x3d3f('0xe')]('/',auth[_0x3d3f('0xa')](),controller['create']);router[_0x3d3f('0xf')](_0x3d3f('0xc'),auth[_0x3d3f('0xa')](),controller[_0x3d3f('0x10')]);router['delete'](_0x3d3f('0xc'),auth[_0x3d3f('0xa')](),controller[_0x3d3f('0x11')]);module[_0x3d3f('0x12')]=router;
\ No newline at end of file
+var _0x8e93=['create','put','/:id','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','show','post'];(function(_0x814eab,_0x42c177){var _0x599c04=function(_0x452a16){while(--_0x452a16){_0x814eab['push'](_0x814eab['shift']());}};_0x599c04(++_0x42c177);}(_0x8e93,0xba));var _0x38e9=function(_0x4007e2,_0x12c68d){_0x4007e2=_0x4007e2-0x0;var _0x4c11c3=_0x8e93[_0x4007e2];return _0x4c11c3;};'use strict';var multer=require('multer');var util=require(_0x38e9('0x0'));var path=require(_0x38e9('0x1'));var timeout=require(_0x38e9('0x2'));var express=require(_0x38e9('0x3'));var router=express['Router']();var fs_extra=require(_0x38e9('0x4'));var auth=require(_0x38e9('0x5'));var interaction=require(_0x38e9('0x6'));var config=require('../../config/environment');var controller=require('./intDeskField.controller');router['get']('/',auth[_0x38e9('0x7')](),controller[_0x38e9('0x8')]);router[_0x38e9('0x9')]('/:id',auth[_0x38e9('0x7')](),controller[_0x38e9('0xa')]);router[_0x38e9('0xb')]('/',auth[_0x38e9('0x7')](),controller[_0x38e9('0xc')]);router[_0x38e9('0xd')](_0x38e9('0xe'),auth[_0x38e9('0x7')](),controller[_0x38e9('0xf')]);router['delete']('/:id',auth[_0x38e9('0x7')](),controller[_0x38e9('0x10')]);module[_0x38e9('0x11')]=router;
\ No newline at end of file
index 8519fc8..c8acbe6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d74=['sequelize','exports','variable','keyValue','picklist','string','STRING','ENUM','customVariable'];(function(_0x5eb406,_0x416efe){var _0x40bafd=function(_0x53bee6){while(--_0x53bee6){_0x5eb406['push'](_0x5eb406['shift']());}};_0x40bafd(++_0x416efe);}(_0x4d74,0xcf));var _0x44d7=function(_0xd839e7,_0x4209e9){_0xd839e7=_0xd839e7-0x0;var _0xc3cf23=_0x4d74[_0xd839e7];return _0xc3cf23;};'use strict';var Sequelize=require(_0x44d7('0x0'));module[_0x44d7('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x44d7('0x2'),'customVariable',_0x44d7('0x3'),_0x44d7('0x4')),'defaultValue':_0x44d7('0x5')},'content':{'type':Sequelize[_0x44d7('0x6')]},'key':{'type':Sequelize[_0x44d7('0x6')]},'keyType':{'type':Sequelize[_0x44d7('0x7')](_0x44d7('0x5'),_0x44d7('0x2'),_0x44d7('0x8'))},'keyContent':{'type':Sequelize[_0x44d7('0x6')]},'idField':{'type':Sequelize[_0x44d7('0x6')]},'nameField':{'type':Sequelize[_0x44d7('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x44d7('0x6')]}};
\ No newline at end of file
+var _0xfc57=['customVariable','picklist','string','variable','STRING','BOOLEAN','exports','ENUM'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xfc57,0x196));var _0x7fc5=function(_0x30eaec,_0x123de2){_0x30eaec=_0x30eaec-0x0;var _0x37aca8=_0xfc57[_0x30eaec];return _0x37aca8;};'use strict';var Sequelize=require('sequelize');module[_0x7fc5('0x0')]={'type':{'type':Sequelize[_0x7fc5('0x1')]('string','variable',_0x7fc5('0x2'),'keyValue',_0x7fc5('0x3')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7fc5('0x1')](_0x7fc5('0x4'),_0x7fc5('0x5'),_0x7fc5('0x2'))},'keyContent':{'type':Sequelize[_0x7fc5('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x7fc5('0x6')]},'customField':{'type':Sequelize[_0x7fc5('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7fc5('0x6')]}};
\ No newline at end of file
index 7c413c2..c2dc46d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x017e=['reject','update','then','error','stack','name','index','map','DeskField','rawAttributes','fieldName','key','model','query','keys','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','type','filter','options','includeAll','include','rows','show','params','intersection','fields','merge','catch','create','body','find','destroy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','apply'];(function(_0x87922d,_0x15ac4c){var _0x2bf78c=function(_0x2b2dba){while(--_0x2b2dba){_0x87922d['push'](_0x87922d['shift']());}};_0x2bf78c(++_0x15ac4c);}(_0x017e,0x10c));var _0xe017=function(_0x5aa4cc,_0x49d641){_0x5aa4cc=_0x5aa4cc-0x0;var _0x52b505=_0x017e[_0x5aa4cc];return _0x52b505;};'use strict';var emlformat=require(_0xe017('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe017('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe017('0x2'));var moment=require(_0xe017('0x3'));var BPromise=require(_0xe017('0x4'));var Mustache=require(_0xe017('0x5'));var util=require(_0xe017('0x6'));var path=require('path');var sox=require(_0xe017('0x7'));var csv=require('to-csv');var ejs=require(_0xe017('0x8'));var fs=require('fs');var fs_extra=require(_0xe017('0x9'));var _=require(_0xe017('0xa'));var squel=require(_0xe017('0xb'));var crypto=require('crypto');var jsforce=require(_0xe017('0xc'));var deskjs=require(_0xe017('0xd'));var toCsv=require(_0xe017('0xe'));var querystring=require(_0xe017('0xf'));var Papa=require(_0xe017('0x10'));var Redis=require(_0xe017('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe017('0x12'));var as=require(_0xe017('0x13'));var hardwareService=require(_0xe017('0x14'));var logger=require(_0xe017('0x15'))(_0xe017('0x16'));var utils=require('../../config/utils');var config=require(_0xe017('0x17'));var licenseUtil=require(_0xe017('0x18'));var db=require(_0xe017('0x19'))['db'];function respondWithStatusCode(_0x45de1e,_0x316f71){_0x316f71=_0x316f71||0xcc;return function(_0x5cbaf7){if(_0x5cbaf7){return _0x45de1e[_0xe017('0x1a')](_0x316f71);}return _0x45de1e[_0xe017('0x1b')](_0x316f71)[_0xe017('0x1c')]();};}function respondWithResult(_0x3615ec,_0x163877){_0x163877=_0x163877||0xc8;return function(_0x7e07b1){if(_0x7e07b1){return _0x3615ec[_0xe017('0x1b')](_0x163877)[_0xe017('0x1d')](_0x7e07b1);}};}function respondWithFilteredResult(_0x2d2a0d,_0x204132){return function(_0x1ac793){if(_0x1ac793){var _0x5055a1=typeof _0x204132['offset']===_0xe017('0x1e')&&typeof _0x204132['limit']===_0xe017('0x1e');var _0x5bfc48=_0x1ac793[_0xe017('0x1f')];var _0x3d7859=_0x5055a1?0x0:_0x204132[_0xe017('0x20')];var _0x1a9d48=_0x5055a1?_0x1ac793[_0xe017('0x1f')]:_0x204132['offset']+_0x204132[_0xe017('0x21')];var _0x1b8cf6;if(_0x1a9d48>=_0x5bfc48){_0x1a9d48=_0x5bfc48;_0x1b8cf6=0xc8;}else{_0x1b8cf6=0xce;}_0x2d2a0d[_0xe017('0x1b')](_0x1b8cf6);return _0x2d2a0d[_0xe017('0x22')]('Content-Range',_0x3d7859+'-'+_0x1a9d48+'/'+_0x5bfc48)[_0xe017('0x1d')](_0x1ac793);}return null;};}function patchUpdates(_0x4079bf){return function(_0x202555){try{jsonpatch[_0xe017('0x23')](_0x202555,_0x4079bf,!![]);}catch(_0x114c87){return BPromise[_0xe017('0x24')](_0x114c87);}return _0x202555['save']();};}function saveUpdates(_0x34aa2f,_0x1026eb){return function(_0x3308bf){if(_0x3308bf){return _0x3308bf[_0xe017('0x25')](_0x34aa2f)['then'](function(_0x1a1202){return _0x1a1202;});}return null;};}function removeEntity(_0x4d1919,_0x19599a){return function(_0x1600e0){if(_0x1600e0){return _0x1600e0['destroy']()[_0xe017('0x26')](function(){_0x4d1919[_0xe017('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dcb34,_0x114049){return function(_0xbde895){if(!_0xbde895){_0x4dcb34[_0xe017('0x1a')](0x194);}return _0xbde895;};}function handleError(_0x50414a,_0x3a31af){_0x3a31af=_0x3a31af||0x1f4;return function(_0x1bdba8){logger[_0xe017('0x27')](_0x1bdba8[_0xe017('0x28')]);if(_0x1bdba8[_0xe017('0x29')]){delete _0x1bdba8[_0xe017('0x29')];}_0x50414a[_0xe017('0x1b')](_0x3a31af)['send'](_0x1bdba8);};}exports[_0xe017('0x2a')]=function(_0x3857de,_0x37527e){var _0x13b9e7={},_0x2436cc={},_0x2f4bc0={'count':0x0,'rows':[]};var _0x4b8ff=_[_0xe017('0x2b')](db[_0xe017('0x2c')][_0xe017('0x2d')],function(_0x19dd70){return{'name':_0x19dd70[_0xe017('0x2e')],'type':_0x19dd70['type'][_0xe017('0x2f')]};});_0x2436cc[_0xe017('0x30')]=_[_0xe017('0x2b')](_0x4b8ff,_0xe017('0x29'));_0x2436cc[_0xe017('0x31')]=_[_0xe017('0x32')](_0x3857de['query']);_0x2436cc['filters']=_['intersection'](_0x2436cc[_0xe017('0x30')],_0x2436cc[_0xe017('0x31')]);_0x13b9e7[_0xe017('0x33')]=_['intersection'](_0x2436cc[_0xe017('0x30')],qs['fields'](_0x3857de[_0xe017('0x31')]['fields']));_0x13b9e7['attributes']=_0x13b9e7[_0xe017('0x33')][_0xe017('0x34')]?_0x13b9e7[_0xe017('0x33')]:_0x2436cc[_0xe017('0x30')];if(!_0x3857de['query'][_0xe017('0x35')](_0xe017('0x36'))){_0x13b9e7['limit']=qs['limit'](_0x3857de[_0xe017('0x31')][_0xe017('0x21')]);_0x13b9e7[_0xe017('0x20')]=qs[_0xe017('0x20')](_0x3857de[_0xe017('0x31')][_0xe017('0x20')]);}_0x13b9e7[_0xe017('0x37')]=qs[_0xe017('0x38')](_0x3857de[_0xe017('0x31')]['sort']);_0x13b9e7['where']=qs[_0xe017('0x39')](_[_0xe017('0x3a')](_0x3857de[_0xe017('0x31')],_0x2436cc['filters']),_0x4b8ff);if(_0x3857de['query']['filter']){_0x13b9e7[_0xe017('0x3b')]=_['merge'](_0x13b9e7[_0xe017('0x3b')],{'$or':_[_0xe017('0x2b')](_0x4b8ff,function(_0x368565){if(_0x368565[_0xe017('0x3c')]!=='VIRTUAL'){var _0x296ce9={};_0x296ce9[_0x368565[_0xe017('0x29')]]={'$like':'%'+_0x3857de[_0xe017('0x31')][_0xe017('0x3d')]+'%'};return _0x296ce9;}})});}_0x13b9e7=_['merge']({},_0x13b9e7,_0x3857de[_0xe017('0x3e')]);var _0x24ca35={'where':_0x13b9e7[_0xe017('0x3b')]};return db[_0xe017('0x2c')]['count'](_0x24ca35)['then'](function(_0x13d147){_0x2f4bc0[_0xe017('0x1f')]=_0x13d147;if(_0x3857de[_0xe017('0x31')][_0xe017('0x3f')]){_0x13b9e7[_0xe017('0x40')]=[{'all':!![]}];}return db[_0xe017('0x2c')]['findAll'](_0x13b9e7);})['then'](function(_0xa643d){_0x2f4bc0[_0xe017('0x41')]=_0xa643d;return _0x2f4bc0;})['then'](respondWithFilteredResult(_0x37527e,_0x13b9e7))['catch'](handleError(_0x37527e,null));};exports[_0xe017('0x42')]=function(_0x3921ab,_0x10fb24){var _0x42e90c={'raw':!![],'where':{'id':_0x3921ab[_0xe017('0x43')]['id']}},_0x45ffe7={};_0x45ffe7[_0xe017('0x30')]=_['keys'](db['DeskField'][_0xe017('0x2d')]);_0x45ffe7['query']=_[_0xe017('0x32')](_0x3921ab[_0xe017('0x31')]);_0x45ffe7[_0xe017('0x39')]=_[_0xe017('0x44')](_0x45ffe7[_0xe017('0x30')],_0x45ffe7['query']);_0x42e90c[_0xe017('0x33')]=_[_0xe017('0x44')](_0x45ffe7['model'],qs[_0xe017('0x45')](_0x3921ab[_0xe017('0x31')][_0xe017('0x45')]));_0x42e90c[_0xe017('0x33')]=_0x42e90c['attributes']['length']?_0x42e90c[_0xe017('0x33')]:_0x45ffe7['model'];if(_0x3921ab[_0xe017('0x31')]['includeAll']){_0x42e90c[_0xe017('0x40')]=[{'all':!![]}];}_0x42e90c=_[_0xe017('0x46')]({},_0x42e90c,_0x3921ab[_0xe017('0x3e')]);return db['DeskField']['find'](_0x42e90c)[_0xe017('0x26')](handleEntityNotFound(_0x10fb24,null))[_0xe017('0x26')](respondWithResult(_0x10fb24,null))[_0xe017('0x47')](handleError(_0x10fb24,null));};exports[_0xe017('0x48')]=function(_0x59a938,_0x53d29a){return db['DeskField'][_0xe017('0x48')](_0x59a938[_0xe017('0x49')],{})['then'](respondWithResult(_0x53d29a,0xc9))[_0xe017('0x47')](handleError(_0x53d29a,null));};exports[_0xe017('0x25')]=function(_0x341aef,_0x5ad758){if(_0x341aef[_0xe017('0x49')]['id']){delete _0x341aef[_0xe017('0x49')]['id'];}return db[_0xe017('0x2c')][_0xe017('0x4a')]({'where':{'id':_0x341aef[_0xe017('0x43')]['id']}})[_0xe017('0x26')](handleEntityNotFound(_0x5ad758,null))[_0xe017('0x26')](saveUpdates(_0x341aef[_0xe017('0x49')],null))[_0xe017('0x26')](respondWithResult(_0x5ad758,null))[_0xe017('0x47')](handleError(_0x5ad758,null));};exports[_0xe017('0x4b')]=function(_0x87b386,_0x3248cd){return db[_0xe017('0x2c')][_0xe017('0x4a')]({'where':{'id':_0x87b386[_0xe017('0x43')]['id']}})['then'](handleEntityNotFound(_0x3248cd,null))['then'](removeEntity(_0x3248cd,null))[_0xe017('0x47')](handleError(_0x3248cd,null));};
\ No newline at end of file
+var _0x96aa=['filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','keys','rawAttributes','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','stack','name','send','map','DeskField','fieldName','type','key','model','query'];(function(_0x69acbf,_0x607f56){var _0x2210c5=function(_0x433700){while(--_0x433700){_0x69acbf['push'](_0x69acbf['shift']());}};_0x2210c5(++_0x607f56);}(_0x96aa,0x67));var _0xa96a=function(_0x3d1378,_0x509e8d){_0x3d1378=_0x3d1378-0x0;var _0x4c8ee4=_0x96aa[_0x3d1378];return _0x4c8ee4;};'use strict';var emlformat=require(_0xa96a('0x0'));var rimraf=require(_0xa96a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa96a('0x2'));var rp=require(_0xa96a('0x3'));var moment=require(_0xa96a('0x4'));var BPromise=require(_0xa96a('0x5'));var Mustache=require(_0xa96a('0x6'));var util=require('util');var path=require(_0xa96a('0x7'));var sox=require(_0xa96a('0x8'));var csv=require('to-csv');var ejs=require(_0xa96a('0x9'));var fs=require('fs');var fs_extra=require(_0xa96a('0xa'));var _=require(_0xa96a('0xb'));var squel=require(_0xa96a('0xc'));var crypto=require(_0xa96a('0xd'));var jsforce=require(_0xa96a('0xe'));var deskjs=require(_0xa96a('0xf'));var toCsv=require(_0xa96a('0x10'));var querystring=require(_0xa96a('0x11'));var Papa=require(_0xa96a('0x12'));var Redis=require(_0xa96a('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xa96a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa96a('0x15'));var logger=require(_0xa96a('0x16'))('api');var utils=require(_0xa96a('0x17'));var config=require(_0xa96a('0x18'));var licenseUtil=require(_0xa96a('0x19'));var db=require(_0xa96a('0x1a'))['db'];function respondWithStatusCode(_0x26267e,_0x3f0f9e){_0x3f0f9e=_0x3f0f9e||0xcc;return function(_0x225192){if(_0x225192){return _0x26267e[_0xa96a('0x1b')](_0x3f0f9e);}return _0x26267e[_0xa96a('0x1c')](_0x3f0f9e)[_0xa96a('0x1d')]();};}function respondWithResult(_0x431927,_0x3983ba){_0x3983ba=_0x3983ba||0xc8;return function(_0x4dc5a8){if(_0x4dc5a8){return _0x431927['status'](_0x3983ba)[_0xa96a('0x1e')](_0x4dc5a8);}};}function respondWithFilteredResult(_0x4f44b0,_0x14927b){return function(_0x5cd3f7){if(_0x5cd3f7){var _0x170e3d=typeof _0x14927b[_0xa96a('0x1f')]===_0xa96a('0x20')&&typeof _0x14927b[_0xa96a('0x21')]===_0xa96a('0x20');var _0x16257d=_0x5cd3f7['count'];var _0x8d32c0=_0x170e3d?0x0:_0x14927b[_0xa96a('0x1f')];var _0x48ca06=_0x170e3d?_0x5cd3f7[_0xa96a('0x22')]:_0x14927b[_0xa96a('0x1f')]+_0x14927b[_0xa96a('0x21')];var _0x2e8c75;if(_0x48ca06>=_0x16257d){_0x48ca06=_0x16257d;_0x2e8c75=0xc8;}else{_0x2e8c75=0xce;}_0x4f44b0[_0xa96a('0x1c')](_0x2e8c75);return _0x4f44b0[_0xa96a('0x23')](_0xa96a('0x24'),_0x8d32c0+'-'+_0x48ca06+'/'+_0x16257d)[_0xa96a('0x1e')](_0x5cd3f7);}return null;};}function patchUpdates(_0x3f41ad){return function(_0x5ee7ba){try{jsonpatch[_0xa96a('0x25')](_0x5ee7ba,_0x3f41ad,!![]);}catch(_0x5b7cbc){return BPromise[_0xa96a('0x26')](_0x5b7cbc);}return _0x5ee7ba['save']();};}function saveUpdates(_0x1572bd,_0x96a6b2){return function(_0x484ee7){if(_0x484ee7){return _0x484ee7['update'](_0x1572bd)[_0xa96a('0x27')](function(_0x33feeb){return _0x33feeb;});}return null;};}function removeEntity(_0x2c5db0,_0x2f2173){return function(_0x3eca00){if(_0x3eca00){return _0x3eca00[_0xa96a('0x28')]()['then'](function(){_0x2c5db0['status'](0xcc)[_0xa96a('0x1d')]();});}};}function handleEntityNotFound(_0x5916af,_0x36f3ae){return function(_0x44c4ee){if(!_0x44c4ee){_0x5916af[_0xa96a('0x1b')](0x194);}return _0x44c4ee;};}function handleError(_0x573ea7,_0x171450){_0x171450=_0x171450||0x1f4;return function(_0x485fb1){logger['error'](_0x485fb1[_0xa96a('0x29')]);if(_0x485fb1['name']){delete _0x485fb1[_0xa96a('0x2a')];}_0x573ea7[_0xa96a('0x1c')](_0x171450)[_0xa96a('0x2b')](_0x485fb1);};}exports['index']=function(_0x1bb965,_0x5256cb){var _0x55b8be={},_0x14c246={},_0x5576b9={'count':0x0,'rows':[]};var _0x585af1=_[_0xa96a('0x2c')](db[_0xa96a('0x2d')]['rawAttributes'],function(_0x34ef72){return{'name':_0x34ef72[_0xa96a('0x2e')],'type':_0x34ef72[_0xa96a('0x2f')][_0xa96a('0x30')]};});_0x14c246[_0xa96a('0x31')]=_['map'](_0x585af1,_0xa96a('0x2a'));_0x14c246[_0xa96a('0x32')]=_['keys'](_0x1bb965[_0xa96a('0x32')]);_0x14c246[_0xa96a('0x33')]=_[_0xa96a('0x34')](_0x14c246[_0xa96a('0x31')],_0x14c246[_0xa96a('0x32')]);_0x55b8be[_0xa96a('0x35')]=_[_0xa96a('0x34')](_0x14c246['model'],qs[_0xa96a('0x36')](_0x1bb965[_0xa96a('0x32')][_0xa96a('0x36')]));_0x55b8be[_0xa96a('0x35')]=_0x55b8be[_0xa96a('0x35')][_0xa96a('0x37')]?_0x55b8be['attributes']:_0x14c246['model'];if(!_0x1bb965['query']['hasOwnProperty'](_0xa96a('0x38'))){_0x55b8be[_0xa96a('0x21')]=qs[_0xa96a('0x21')](_0x1bb965[_0xa96a('0x32')][_0xa96a('0x21')]);_0x55b8be[_0xa96a('0x1f')]=qs[_0xa96a('0x1f')](_0x1bb965[_0xa96a('0x32')][_0xa96a('0x1f')]);}_0x55b8be[_0xa96a('0x39')]=qs[_0xa96a('0x3a')](_0x1bb965[_0xa96a('0x32')]['sort']);_0x55b8be['where']=qs[_0xa96a('0x33')](_[_0xa96a('0x3b')](_0x1bb965['query'],_0x14c246[_0xa96a('0x33')]),_0x585af1);if(_0x1bb965['query']['filter']){_0x55b8be[_0xa96a('0x3c')]=_[_0xa96a('0x3d')](_0x55b8be[_0xa96a('0x3c')],{'$or':_[_0xa96a('0x2c')](_0x585af1,function(_0x169acd){if(_0x169acd[_0xa96a('0x2f')]!==_0xa96a('0x3e')){var _0xbb2011={};_0xbb2011[_0x169acd[_0xa96a('0x2a')]]={'$like':'%'+_0x1bb965['query'][_0xa96a('0x3f')]+'%'};return _0xbb2011;}})});}_0x55b8be=_[_0xa96a('0x3d')]({},_0x55b8be,_0x1bb965[_0xa96a('0x40')]);var _0x5e4bf6={'where':_0x55b8be['where']};return db['DeskField']['count'](_0x5e4bf6)[_0xa96a('0x27')](function(_0x2ee9d3){_0x5576b9['count']=_0x2ee9d3;if(_0x1bb965[_0xa96a('0x32')][_0xa96a('0x41')]){_0x55b8be[_0xa96a('0x42')]=[{'all':!![]}];}return db[_0xa96a('0x2d')][_0xa96a('0x43')](_0x55b8be);})[_0xa96a('0x27')](function(_0x4b66f5){_0x5576b9['rows']=_0x4b66f5;return _0x5576b9;})['then'](respondWithFilteredResult(_0x5256cb,_0x55b8be))[_0xa96a('0x44')](handleError(_0x5256cb,null));};exports[_0xa96a('0x45')]=function(_0x231ff2,_0x48cc46){var _0x101191={'raw':!![],'where':{'id':_0x231ff2[_0xa96a('0x46')]['id']}},_0x2edf92={};_0x2edf92['model']=_[_0xa96a('0x47')](db[_0xa96a('0x2d')][_0xa96a('0x48')]);_0x2edf92[_0xa96a('0x32')]=_[_0xa96a('0x47')](_0x231ff2[_0xa96a('0x32')]);_0x2edf92[_0xa96a('0x33')]=_['intersection'](_0x2edf92[_0xa96a('0x31')],_0x2edf92[_0xa96a('0x32')]);_0x101191['attributes']=_['intersection'](_0x2edf92[_0xa96a('0x31')],qs[_0xa96a('0x36')](_0x231ff2['query']['fields']));_0x101191[_0xa96a('0x35')]=_0x101191[_0xa96a('0x35')][_0xa96a('0x37')]?_0x101191[_0xa96a('0x35')]:_0x2edf92[_0xa96a('0x31')];if(_0x231ff2['query'][_0xa96a('0x41')]){_0x101191[_0xa96a('0x42')]=[{'all':!![]}];}_0x101191=_[_0xa96a('0x3d')]({},_0x101191,_0x231ff2['options']);return db['DeskField'][_0xa96a('0x49')](_0x101191)[_0xa96a('0x27')](handleEntityNotFound(_0x48cc46,null))[_0xa96a('0x27')](respondWithResult(_0x48cc46,null))['catch'](handleError(_0x48cc46,null));};exports['create']=function(_0x1eea0f,_0x2bd9e2){return db[_0xa96a('0x2d')][_0xa96a('0x4a')](_0x1eea0f[_0xa96a('0x4b')],{})[_0xa96a('0x27')](respondWithResult(_0x2bd9e2,0xc9))[_0xa96a('0x44')](handleError(_0x2bd9e2,null));};exports[_0xa96a('0x4c')]=function(_0x193042,_0x2afe5b){if(_0x193042[_0xa96a('0x4b')]['id']){delete _0x193042[_0xa96a('0x4b')]['id'];}return db[_0xa96a('0x2d')][_0xa96a('0x49')]({'where':{'id':_0x193042[_0xa96a('0x46')]['id']}})['then'](handleEntityNotFound(_0x2afe5b,null))[_0xa96a('0x27')](saveUpdates(_0x193042['body'],null))['then'](respondWithResult(_0x2afe5b,null))[_0xa96a('0x44')](handleError(_0x2afe5b,null));};exports['destroy']=function(_0x4608fa,_0x195188){return db[_0xa96a('0x2d')][_0xa96a('0x49')]({'where':{'id':_0x4608fa[_0xa96a('0x46')]['id']}})[_0xa96a('0x27')](handleEntityNotFound(_0x195188,null))[_0xa96a('0x27')](removeEntity(_0x195188,null))[_0xa96a('0x44')](handleError(_0x195188,null));};
\ No newline at end of file
index 6c462ee..9b09ba5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa0a=['../../config/logger','api','moment','bluebird','request-promise','path','./intDeskField.attributes','exports','define','idField','FieldId','util'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0xfa0a,0x6b));var _0xafa0=function(_0x5f1d5a,_0x1c85a7){_0x5f1d5a=_0x5f1d5a-0x0;var _0x449071=_0xfa0a[_0x5f1d5a];return _0x449071;};'use strict';var _=require('lodash');var util=require(_0xafa0('0x0'));var logger=require(_0xafa0('0x1'))(_0xafa0('0x2'));var moment=require(_0xafa0('0x3'));var BPromise=require(_0xafa0('0x4'));var rp=require(_0xafa0('0x5'));var fs=require('fs');var path=require(_0xafa0('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xafa0('0x7'));module[_0xafa0('0x8')]=function(_0x231d53,_0x332355){return _0x231d53[_0xafa0('0x9')]('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xafa0('0xa'),_0xafa0('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3933=['../../config/environment','exports','define','DeskField','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x43c8b7,_0x58f5b1){var _0x10ffe9=function(_0x5dd75f){while(--_0x5dd75f){_0x43c8b7['push'](_0x43c8b7['shift']());}};_0x10ffe9(++_0x58f5b1);}(_0x3933,0x1d7));var _0x3393=function(_0x3b818f,_0x1f13ef){_0x3b818f=_0x3b818f-0x0;var _0x165a4e=_0x3933[_0x3b818f];return _0x165a4e;};'use strict';var _=require(_0x3393('0x0'));var util=require(_0x3393('0x1'));var logger=require(_0x3393('0x2'))(_0x3393('0x3'));var moment=require(_0x3393('0x4'));var BPromise=require(_0x3393('0x5'));var rp=require(_0x3393('0x6'));var fs=require('fs');var path=require(_0x3393('0x7'));var rimraf=require(_0x3393('0x8'));var config=require(_0x3393('0x9'));var attributes=require('./intDeskField.attributes');module[_0x3393('0xa')]=function(_0x51f9da,_0x45c9f9){return _0x51f9da[_0x3393('0xb')](_0x3393('0xc'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x3393('0xd'),'fields':[_0x3393('0xe'),_0x3393('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 9f88a95..8e9fcb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e29=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment'];(function(_0x43d7af,_0x6a0acc){var _0xae4ae4=function(_0x37f4dc){while(--_0x37f4dc){_0x43d7af['push'](_0x43d7af['shift']());}};_0xae4ae4(++_0x6a0acc);}(_0x8e29,0x8e));var _0x98e2=function(_0x4905a0,_0x1f4bf8){_0x4905a0=_0x4905a0-0x0;var _0x35e3cc=_0x8e29[_0x4905a0];return _0x35e3cc;};'use strict';var _=require('lodash');var util=require(_0x98e2('0x0'));var moment=require(_0x98e2('0x1'));var BPromise=require(_0x98e2('0x2'));var rs=require(_0x98e2('0x3'));var fs=require('fs');var Redis=require(_0x98e2('0x4'));var db=require(_0x98e2('0x5'))['db'];var utils=require(_0x98e2('0x6'));var logger=require(_0x98e2('0x7'))(_0x98e2('0x8'));var config=require(_0x98e2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x98e2('0xa')][_0x98e2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e762f,_0x29115b,_0x5b13b7){return new BPromise(function(_0x181cca,_0x281e48){return client['request'](_0x3e762f,_0x5b13b7)[_0x98e2('0xc')](function(_0x28a7dc){logger['info'](_0x98e2('0xd'),_0x29115b,_0x98e2('0xe'));logger[_0x98e2('0xf')](_0x98e2('0x10'),_0x29115b,_0x98e2('0xe'),JSON[_0x98e2('0x11')](_0x28a7dc));if(_0x28a7dc[_0x98e2('0x12')]){if(_0x28a7dc[_0x98e2('0x12')][_0x98e2('0x13')]===0x1f4){logger[_0x98e2('0x12')](_0x98e2('0xd'),_0x29115b,_0x28a7dc['error']['message']);return _0x281e48(_0x28a7dc[_0x98e2('0x12')][_0x98e2('0x14')]);}logger['error'](_0x98e2('0xd'),_0x29115b,_0x28a7dc[_0x98e2('0x12')]['message']);return _0x181cca(_0x28a7dc[_0x98e2('0x12')][_0x98e2('0x14')]);}else{logger[_0x98e2('0x15')]('DeskField,\x20%s,\x20%s',_0x29115b,'request\x20sent');_0x181cca(_0x28a7dc[_0x98e2('0x16')][_0x98e2('0x14')]);}})[_0x98e2('0x17')](function(_0x56525b){logger[_0x98e2('0x12')](_0x98e2('0xd'),_0x29115b,_0x56525b);_0x281e48(_0x56525b);});});}
\ No newline at end of file
+var _0x4bbc=['client','http','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x4bbc,0x7c));var _0xc4bb=function(_0x1c3a69,_0x4223e5){_0x1c3a69=_0x1c3a69-0x0;var _0xedb04d=_0x4bbc[_0x1c3a69];return _0xedb04d;};'use strict';var _=require(_0xc4bb('0x0'));var util=require('util');var moment=require(_0xc4bb('0x1'));var BPromise=require('bluebird');var rs=require(_0xc4bb('0x2'));var fs=require('fs');var Redis=require(_0xc4bb('0x3'));var db=require(_0xc4bb('0x4'))['db'];var utils=require(_0xc4bb('0x5'));var logger=require(_0xc4bb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc4bb('0x7'));var client=jayson[_0xc4bb('0x8')][_0xc4bb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x272a9c,_0x3211ff,_0x10943d){return new BPromise(function(_0x56e049,_0x3d491c){return client['request'](_0x272a9c,_0x10943d)[_0xc4bb('0xa')](function(_0xc49a58){logger[_0xc4bb('0xb')](_0xc4bb('0xc'),_0x3211ff,_0xc4bb('0xd'));logger[_0xc4bb('0xe')](_0xc4bb('0xf'),_0x3211ff,_0xc4bb('0xd'),JSON[_0xc4bb('0x10')](_0xc49a58));if(_0xc49a58[_0xc4bb('0x11')]){if(_0xc49a58['error'][_0xc4bb('0x12')]===0x1f4){logger[_0xc4bb('0x11')](_0xc4bb('0xc'),_0x3211ff,_0xc49a58[_0xc4bb('0x11')][_0xc4bb('0x13')]);return _0x3d491c(_0xc49a58[_0xc4bb('0x11')][_0xc4bb('0x13')]);}logger[_0xc4bb('0x11')](_0xc4bb('0xc'),_0x3211ff,_0xc49a58[_0xc4bb('0x11')][_0xc4bb('0x13')]);return _0x56e049(_0xc49a58[_0xc4bb('0x11')][_0xc4bb('0x13')]);}else{logger['info']('DeskField,\x20%s,\x20%s',_0x3211ff,_0xc4bb('0xd'));_0x56e049(_0xc49a58[_0xc4bb('0x14')][_0xc4bb('0x13')]);}})[_0xc4bb('0x15')](function(_0x25c6e4){logger['error'](_0xc4bb('0xc'),_0x3211ff,_0x25c6e4);_0x3d491c(_0x25c6e4);});});}
\ No newline at end of file
index 638a765..8bc2d6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd23=['/:id/fields','getFields','create','post','addConfiguration','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','show','getConfigurations'];(function(_0x857c24,_0x2b0167){var _0x4fb875=function(_0x511824){while(--_0x511824){_0x857c24['push'](_0x857c24['shift']());}};_0x4fb875(++_0x2b0167);}(_0xcd23,0x195));var _0x3cd2=function(_0x1d2443,_0x2fe513){_0x1d2443=_0x1d2443-0x0;var _0x422891=_0xcd23[_0x1d2443];return _0x422891;};'use strict';var multer=require(_0x3cd2('0x0'));var util=require(_0x3cd2('0x1'));var path=require('path');var timeout=require(_0x3cd2('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3cd2('0x3'));var auth=require(_0x3cd2('0x4'));var interaction=require(_0x3cd2('0x5'));var config=require(_0x3cd2('0x6'));var controller=require(_0x3cd2('0x7'));router[_0x3cd2('0x8')]('/',auth[_0x3cd2('0x9')](),controller[_0x3cd2('0xa')]);router[_0x3cd2('0x8')]('/:id',auth[_0x3cd2('0x9')](),controller[_0x3cd2('0xb')]);router[_0x3cd2('0x8')]('/:id/configurations',auth[_0x3cd2('0x9')](),controller[_0x3cd2('0xc')]);router[_0x3cd2('0x8')](_0x3cd2('0xd'),auth[_0x3cd2('0x9')](),controller[_0x3cd2('0xe')]);router['post']('/',auth[_0x3cd2('0x9')](),controller[_0x3cd2('0xf')]);router[_0x3cd2('0x10')]('/:id/configurations',auth[_0x3cd2('0x9')](),controller[_0x3cd2('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3cd2('0x12')]);router[_0x3cd2('0x13')]('/:id',auth[_0x3cd2('0x9')](),controller[_0x3cd2('0x14')]);module[_0x3cd2('0x15')]=router;
\ No newline at end of file
+var _0x0d6b=['/:id','show','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','update','delete','destroy','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get'];(function(_0x403ffc,_0x341ca6){var _0x508d32=function(_0x25f656){while(--_0x25f656){_0x403ffc['push'](_0x403ffc['shift']());}};_0x508d32(++_0x341ca6);}(_0x0d6b,0x173));var _0xb0d6=function(_0x43fe48,_0x4633b8){_0x43fe48=_0x43fe48-0x0;var _0x55dd83=_0x0d6b[_0x43fe48];return _0x55dd83;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb0d6('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb0d6('0x1')]();var fs_extra=require(_0xb0d6('0x2'));var auth=require(_0xb0d6('0x3'));var interaction=require(_0xb0d6('0x4'));var config=require(_0xb0d6('0x5'));var controller=require('./intDynamics365Account.controller');router['get']('/',auth[_0xb0d6('0x6')](),controller[_0xb0d6('0x7')]);router[_0xb0d6('0x8')](_0xb0d6('0x9'),auth[_0xb0d6('0x6')](),controller[_0xb0d6('0xa')]);router[_0xb0d6('0x8')](_0xb0d6('0xb'),auth['isAuthenticated'](),controller[_0xb0d6('0xc')]);router[_0xb0d6('0x8')]('/:id/fields',auth[_0xb0d6('0x6')](),controller[_0xb0d6('0xd')]);router[_0xb0d6('0xe')]('/',auth[_0xb0d6('0x6')](),controller['create']);router[_0xb0d6('0xe')](_0xb0d6('0xb'),auth[_0xb0d6('0x6')](),controller[_0xb0d6('0xf')]);router[_0xb0d6('0x10')](_0xb0d6('0x9'),auth[_0xb0d6('0x6')](),controller[_0xb0d6('0x11')]);router[_0xb0d6('0x12')](_0xb0d6('0x9'),auth['isAuthenticated'](),controller[_0xb0d6('0x13')]);module['exports']=router;
\ No newline at end of file
index 47805fc..1d97a70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28b1=['exports','STRING','sequelize'];(function(_0x2c6870,_0x51f8b2){var _0x2f9265=function(_0x5b3f5b){while(--_0x5b3f5b){_0x2c6870['push'](_0x2c6870['shift']());}};_0x2f9265(++_0x51f8b2);}(_0x28b1,0x1d6));var _0x128b=function(_0x472b66,_0x272c2c){_0x472b66=_0x472b66-0x0;var _0x1dc02a=_0x28b1[_0x472b66];return _0x1dc02a;};'use strict';var Sequelize=require(_0x128b('0x0'));module[_0x128b('0x1')]={'name':{'type':Sequelize[_0x128b('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x128b('0x2')]},'remoteUri':{'type':Sequelize[_0x128b('0x2')]},'tenantId':{'type':Sequelize[_0x128b('0x2')]},'clientId':{'type':Sequelize[_0x128b('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x128b('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xc0a4=['exports','STRING','BOOLEAN'];(function(_0x32e83a,_0x183f8b){var _0xad865e=function(_0x1b1d11){while(--_0x1b1d11){_0x32e83a['push'](_0x32e83a['shift']());}};_0xad865e(++_0x183f8b);}(_0xc0a4,0x147));var _0x4c0a=function(_0x186a29,_0x3ab60b){_0x186a29=_0x186a29-0x0;var _0x4bd665=_0xc0a4[_0x186a29];return _0x4bd665;};'use strict';var Sequelize=require('sequelize');module[_0x4c0a('0x0')]={'name':{'type':Sequelize[_0x4c0a('0x1')]},'username':{'type':Sequelize[_0x4c0a('0x1')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x4c0a('0x1')]},'tenantId':{'type':Sequelize[_0x4c0a('0x1')]},'clientId':{'type':Sequelize[_0x4c0a('0x1')]},'clientSecret':{'type':Sequelize[_0x4c0a('0x1')]},'serverUrl':{'type':Sequelize[_0x4c0a('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x4c0a('0x2')],'defaultValue':!![]}};
\ No newline at end of file
index 12738e8..8d43c88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61d7=['transactioncurrencyidname','traversedpath','concat','tenantId','clientId','modernAuthentication','CloudProvider','data5','data7','access_token','remoteUri','POST','https://login.microsoftonline.com/','/oauth2/token','username','password','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','remove','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','EntityDefinitions(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','UserLocalizedLabel','Label','Value','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','lodash','../../components/parsers/qs','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','count','limit','set','update','destroy','then','end','error','stack','send','index','rawAttributes','fieldName','name','query','filters','intersection','attributes','model','length','nolimit','sort','where','merge','map','type','filter','options','Dynamics365Account','include','rows','show','params','keys','fields','includeAll','find','catch','create','body','findOne','Dynamics365Configuration','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','substring','lastIndexOf','%s/api/data/v9.0/','getFields','ticketType','incident','description','customerid','ownerid','caseorigincode','subject','phonenumber','directioncode','phonecall_activity_parties','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','exchangerate','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','overriddencreatedon','owneridname','owneridtype','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','ticketnumber','timezoneruleversionnumber'];(function(_0x6e8186,_0x4f6d8c){var _0x379fcc=function(_0x4d4047){while(--_0x4d4047){_0x6e8186['push'](_0x6e8186['shift']());}};_0x379fcc(++_0x4f6d8c);}(_0x61d7,0xef));var _0x761d=function(_0x510252,_0x1b934c){_0x510252=_0x510252-0x0;var _0x10cca2=_0x61d7[_0x510252];return _0x10cca2;};'use strict';var rp=require(_0x761d('0x0'));var util=require('util');var _=require(_0x761d('0x1'));var qs=require(_0x761d('0x2'));var logger=require('../../config/logger')(_0x761d('0x3'));var db=require(_0x761d('0x4'))['db'];var integrations=require(_0x761d('0x5'));function respondWithResult(_0x18feea,_0x4ff687){_0x4ff687=_0x4ff687||0xc8;return function(_0x40bd57){if(_0x40bd57){return _0x18feea[_0x761d('0x6')](_0x4ff687)[_0x761d('0x7')](_0x40bd57);}};}function respondWithFilteredResult(_0x13e509,_0x4f1ef6){return function(_0x5cd5e4){if(_0x5cd5e4){var _0x2fdd7b=typeof _0x4f1ef6[_0x761d('0x8')]===_0x761d('0x9')&&typeof _0x4f1ef6['limit']==='undefined';var _0x1e0d59=_0x5cd5e4[_0x761d('0xa')];var _0xe491ca=_0x2fdd7b?0x0:_0x4f1ef6['offset'];var _0x5efb00=_0x2fdd7b?_0x5cd5e4[_0x761d('0xa')]:_0x4f1ef6['offset']+_0x4f1ef6[_0x761d('0xb')];var _0x2d62c3;if(_0x5efb00>=_0x1e0d59){_0x5efb00=_0x1e0d59;_0x2d62c3=0xc8;}else{_0x2d62c3=0xce;}_0x13e509[_0x761d('0x6')](_0x2d62c3);return _0x13e509[_0x761d('0xc')]('Content-Range',_0xe491ca+'-'+_0x5efb00+'/'+_0x1e0d59)[_0x761d('0x7')](_0x5cd5e4);}return null;};}function saveUpdates(_0x442208){return function(_0x1a5b74){if(_0x1a5b74){return _0x1a5b74[_0x761d('0xd')](_0x442208)['then'](function(_0xd13ce9){return _0xd13ce9;});}return null;};}function removeEntity(_0x9dc4bd){return function(_0x4c1e6e){if(_0x4c1e6e){return _0x4c1e6e[_0x761d('0xe')]()[_0x761d('0xf')](function(){_0x9dc4bd[_0x761d('0x6')](0xcc)[_0x761d('0x10')]();});}};}function handleEntityNotFound(_0x3331b2){return function(_0x405e12){if(!_0x405e12){_0x3331b2['sendStatus'](0x194);}return _0x405e12;};}function handleError(_0x4bdf13,_0xabac10){_0xabac10=_0xabac10||0x1f4;return function(_0x237b1d){logger[_0x761d('0x11')](_0x237b1d[_0x761d('0x12')]);if(_0x237b1d['name']){delete _0x237b1d['name'];}_0x4bdf13[_0x761d('0x6')](_0xabac10)[_0x761d('0x13')](_0x237b1d);};}exports[_0x761d('0x14')]=function(_0x2aeb62,_0x18b787){var _0x3fc1a5={},_0x1a3c60={},_0x5e5e3a={'count':0x0,'rows':[]};var _0x55b1d1=_['map'](db['Dynamics365Account'][_0x761d('0x15')],function(_0x1d6272){return{'name':_0x1d6272[_0x761d('0x16')],'type':_0x1d6272['type']['key']};});_0x1a3c60['model']=_['map'](_0x55b1d1,_0x761d('0x17'));_0x1a3c60['query']=_['keys'](_0x2aeb62[_0x761d('0x18')]);_0x1a3c60[_0x761d('0x19')]=_[_0x761d('0x1a')](_0x1a3c60['model'],_0x1a3c60['query']);_0x3fc1a5[_0x761d('0x1b')]=_[_0x761d('0x1a')](_0x1a3c60[_0x761d('0x1c')],qs['fields'](_0x2aeb62[_0x761d('0x18')]['fields']));_0x3fc1a5[_0x761d('0x1b')]=_0x3fc1a5[_0x761d('0x1b')][_0x761d('0x1d')]?_0x3fc1a5[_0x761d('0x1b')]:_0x1a3c60[_0x761d('0x1c')];if(!_0x2aeb62[_0x761d('0x18')]['hasOwnProperty'](_0x761d('0x1e'))){_0x3fc1a5[_0x761d('0xb')]=qs[_0x761d('0xb')](_0x2aeb62[_0x761d('0x18')][_0x761d('0xb')]);_0x3fc1a5[_0x761d('0x8')]=qs[_0x761d('0x8')](_0x2aeb62[_0x761d('0x18')]['offset']);}_0x3fc1a5['order']=qs[_0x761d('0x1f')](_0x2aeb62['query'][_0x761d('0x1f')]);_0x3fc1a5[_0x761d('0x20')]=qs[_0x761d('0x19')](_['pick'](_0x2aeb62[_0x761d('0x18')],_0x1a3c60[_0x761d('0x19')]),_0x55b1d1);if(_0x2aeb62['query']['filter']){_0x3fc1a5[_0x761d('0x20')]=_[_0x761d('0x21')](_0x3fc1a5[_0x761d('0x20')],{'$or':_[_0x761d('0x22')](_0x55b1d1,function(_0x4767cd){if(_0x4767cd[_0x761d('0x23')]!=='VIRTUAL'){var _0x33f37e={};_0x33f37e[_0x4767cd['name']]={'$like':'%'+_0x2aeb62[_0x761d('0x18')][_0x761d('0x24')]+'%'};return _0x33f37e;}})});}_0x3fc1a5=_[_0x761d('0x21')]({},_0x3fc1a5,_0x2aeb62[_0x761d('0x25')]);var _0x2f7c41={'where':_0x3fc1a5[_0x761d('0x20')]};return db[_0x761d('0x26')][_0x761d('0xa')](_0x2f7c41)[_0x761d('0xf')](function(_0x2eda10){_0x5e5e3a[_0x761d('0xa')]=_0x2eda10;if(_0x2aeb62['query']['includeAll']){_0x3fc1a5[_0x761d('0x27')]=[{'all':!![]}];}return db[_0x761d('0x26')]['findAll'](_0x3fc1a5);})[_0x761d('0xf')](function(_0x530172){_0x5e5e3a[_0x761d('0x28')]=_0x530172;return _0x5e5e3a;})[_0x761d('0xf')](respondWithFilteredResult(_0x18b787,_0x3fc1a5))['catch'](handleError(_0x18b787,null));};exports[_0x761d('0x29')]=function(_0x3162aa,_0x284a90){var _0xb17d5a={'raw':![],'where':{'id':_0x3162aa[_0x761d('0x2a')]['id']}},_0x328761={};_0x328761[_0x761d('0x1c')]=_[_0x761d('0x2b')](db[_0x761d('0x26')][_0x761d('0x15')]);_0x328761['query']=_[_0x761d('0x2b')](_0x3162aa[_0x761d('0x18')]);_0x328761[_0x761d('0x19')]=_[_0x761d('0x1a')](_0x328761[_0x761d('0x1c')],_0x328761[_0x761d('0x18')]);_0xb17d5a[_0x761d('0x1b')]=_[_0x761d('0x1a')](_0x328761[_0x761d('0x1c')],qs['fields'](_0x3162aa['query'][_0x761d('0x2c')]));_0xb17d5a[_0x761d('0x1b')]=_0xb17d5a[_0x761d('0x1b')]['length']?_0xb17d5a['attributes']:_0x328761[_0x761d('0x1c')];if(_0x3162aa['query'][_0x761d('0x2d')]){_0xb17d5a[_0x761d('0x27')]=[{'all':!![]}];}_0xb17d5a=_[_0x761d('0x21')]({},_0xb17d5a,_0x3162aa[_0x761d('0x25')]);return db[_0x761d('0x26')][_0x761d('0x2e')](_0xb17d5a)[_0x761d('0xf')](handleEntityNotFound(_0x284a90,null))[_0x761d('0xf')](respondWithResult(_0x284a90,null))[_0x761d('0x2f')](handleError(_0x284a90,null));};exports[_0x761d('0x30')]=function(_0x12d13b,_0x2f50dd){return db[_0x761d('0x26')][_0x761d('0x30')](_0x12d13b['body'],{})['then'](respondWithResult(_0x2f50dd,0xc9))[_0x761d('0x2f')](handleError(_0x2f50dd,null));};exports[_0x761d('0xd')]=function(_0x79f09,_0x2f6e11){if(_0x79f09[_0x761d('0x31')]['id']){delete _0x79f09[_0x761d('0x31')]['id'];}return db['Dynamics365Account'][_0x761d('0x2e')]({'where':{'id':_0x79f09[_0x761d('0x2a')]['id']}})[_0x761d('0xf')](handleEntityNotFound(_0x2f6e11,null))[_0x761d('0xf')](saveUpdates(_0x79f09[_0x761d('0x31')],null))[_0x761d('0xf')](respondWithResult(_0x2f6e11,null))[_0x761d('0x2f')](handleError(_0x2f6e11,null));};exports[_0x761d('0xe')]=function(_0x1031dd,_0x55e8d7){return db[_0x761d('0x26')][_0x761d('0x2e')]({'where':{'id':_0x1031dd[_0x761d('0x2a')]['id']}})[_0x761d('0xf')](handleEntityNotFound(_0x55e8d7,null))[_0x761d('0xf')](removeEntity(_0x55e8d7,null))[_0x761d('0x2f')](handleError(_0x55e8d7,null));};exports['getConfigurations']=function(_0x4ed4b7,_0x2cf788){var _0x318771={};var _0x211c04={};var _0x237600;var _0x107218;return db[_0x761d('0x26')][_0x761d('0x32')]({'where':{'id':_0x4ed4b7['params']['id']}})[_0x761d('0xf')](handleEntityNotFound(_0x2cf788,null))[_0x761d('0xf')](function(_0x5ab469){if(_0x5ab469){_0x237600=_0x5ab469;_0x211c04['model']=_[_0x761d('0x2b')](db[_0x761d('0x33')][_0x761d('0x15')]);_0x211c04[_0x761d('0x18')]=_[_0x761d('0x2b')](_0x4ed4b7[_0x761d('0x18')]);_0x211c04[_0x761d('0x19')]=_[_0x761d('0x1a')](_0x211c04[_0x761d('0x1c')],_0x211c04['query']);_0x318771[_0x761d('0x1b')]=_['intersection'](_0x211c04[_0x761d('0x1c')],qs['fields'](_0x4ed4b7[_0x761d('0x18')][_0x761d('0x2c')]));_0x318771[_0x761d('0x1b')]=_0x318771[_0x761d('0x1b')][_0x761d('0x1d')]?_0x318771['attributes']:_0x211c04[_0x761d('0x1c')];_0x318771[_0x761d('0x34')]=qs[_0x761d('0x1f')](_0x4ed4b7[_0x761d('0x18')][_0x761d('0x1f')]);_0x318771[_0x761d('0x20')]=qs[_0x761d('0x19')](_['pick'](_0x4ed4b7[_0x761d('0x18')],_0x211c04[_0x761d('0x19')]));if(_0x4ed4b7[_0x761d('0x18')][_0x761d('0x24')]){_0x318771['where']=_[_0x761d('0x21')](_0x318771[_0x761d('0x20')],{'$or':_[_0x761d('0x22')](_0x318771[_0x761d('0x1b')],function(_0xe74165){var _0x29c952={};_0x29c952[_0xe74165]={'$like':'%'+_0x4ed4b7[_0x761d('0x18')][_0x761d('0x24')]+'%'};return _0x29c952;})});}_0x318771=_[_0x761d('0x21')]({},_0x318771,_0x4ed4b7['options']);return _0x237600['getConfigurations'](_0x318771);}})['then'](function(_0x31cf2e){if(_0x31cf2e){_0x107218=_0x31cf2e['length'];if(!_0x4ed4b7['query']['hasOwnProperty'](_0x761d('0x1e'))){_0x318771[_0x761d('0xb')]=qs[_0x761d('0xb')](_0x4ed4b7['query'][_0x761d('0xb')]);_0x318771[_0x761d('0x8')]=qs[_0x761d('0x8')](_0x4ed4b7[_0x761d('0x18')][_0x761d('0x8')]);}return _0x237600['getConfigurations'](_0x318771);}})[_0x761d('0xf')](function(_0x229348){if(_0x229348){return _0x229348?{'count':_0x107218,'rows':_0x229348}:null;}})['then'](respondWithResult(_0x2cf788,null))['catch'](handleError(_0x2cf788,null));};exports[_0x761d('0x35')]=function(_0x3083b9,_0x5bbce8){if(_0x3083b9[_0x761d('0x31')]['id']){delete _0x3083b9[_0x761d('0x31')]['id'];}return db[_0x761d('0x26')][_0x761d('0x32')]({'where':{'id':_0x3083b9[_0x761d('0x2a')]['id']}})[_0x761d('0xf')](handleEntityNotFound(_0x5bbce8,null))[_0x761d('0xf')](function(_0x47b8c2){if(_0x47b8c2){_0x3083b9[_0x761d('0x31')][_0x761d('0x36')]=_0x47b8c2['id'];_0x3083b9[_0x761d('0x31')][_0x761d('0x37')]=integrations[_0x761d('0x38')](_0x3083b9[_0x761d('0x31')][_0x761d('0x39')],_0x3083b9[_0x761d('0x31')][_0x761d('0x23')]);_0x3083b9['body'][_0x761d('0x3a')]=integrations[_0x761d('0x3b')](_0x3083b9[_0x761d('0x31')][_0x761d('0x39')],_0x3083b9[_0x761d('0x31')][_0x761d('0x23')]);return db[_0x761d('0x33')][_0x761d('0x30')](_0x3083b9[_0x761d('0x31')],{'include':[{'model':db['Dynamics365Field'],'as':'Subjects'},{'model':db['Dynamics365Field'],'as':_0x761d('0x3a')}]});}return null;})[_0x761d('0xf')](respondWithResult(_0x5bbce8,null))[_0x761d('0x2f')](handleError(_0x5bbce8,null));};function sanitizeRemoteUri(_0x45ff01){var _0x415cd8=_0x45ff01['slice'](-0x1);if(_0x415cd8==='/')return _0x45ff01[_0x761d('0x3c')](0x0,_0x45ff01[_0x761d('0x3d')](_0x415cd8));return _0x45ff01;}function getWebApiUrl(_0x35805e){return util['format'](_0x761d('0x3e'),_0x35805e);}exports[_0x761d('0x3f')]=function(_0x4f6834,_0x674b32){var _0xd85a3a=_0x4f6834[_0x761d('0x18')][_0x761d('0x40')];var _0x19b5eb=_0xd85a3a===_0x761d('0x41')?'Incident':'PhoneCall';var _0xc47b6c='';var _0x165aca='';var _0x4772e2='';var _0x373c3a='';var _0x37eb4a='';var _0xca470d='';var _0x2a202c='';var _0x2a14d6='';var _0x5e75de=['title',_0x761d('0x42'),_0x761d('0x43'),_0x761d('0x44'),_0x761d('0x45'),_0x761d('0x46'),_0x761d('0x47'),'regardingobjectid',_0x761d('0x48'),_0x761d('0x49')];var _0x32c8e9=['accountidname','accountidyominame',_0x761d('0x4a'),_0x761d('0x4b'),_0x761d('0x4c'),_0x761d('0x4d'),_0x761d('0x4e'),_0x761d('0x4f'),_0x761d('0x50'),_0x761d('0x51'),_0x761d('0x52'),_0x761d('0x53'),'createdon','createdonbehalfbyname',_0x761d('0x54'),'customeridname',_0x761d('0x55'),_0x761d('0x56'),_0x761d('0x57'),'entitlementidname',_0x761d('0x58'),_0x761d('0x59'),'escalatedon',_0x761d('0x5a'),'firstresponsebykpiidname',_0x761d('0x5b'),_0x761d('0x5c'),_0x761d('0x5d'),_0x761d('0x5e'),_0x761d('0x5f'),'masteridname','modifiedbyexternalpartyname',_0x761d('0x60'),_0x761d('0x61'),'modifiedbyyominame',_0x761d('0x62'),_0x761d('0x63'),_0x761d('0x64'),'msdyn_incidenttypename',_0x761d('0x65'),'numberofchildincidents','onholdtime',_0x761d('0x66'),_0x761d('0x67'),_0x761d('0x68'),'owneridyominame','parentcaseidname',_0x761d('0x69'),_0x761d('0x6a'),_0x761d('0x6b'),_0x761d('0x6c'),_0x761d('0x6d'),_0x761d('0x6e'),'resolvebykpiidname',_0x761d('0x6f'),_0x761d('0x70'),_0x761d('0x71'),_0x761d('0x72'),_0x761d('0x73'),_0x761d('0x74'),_0x761d('0x75'),_0x761d('0x76'),'statuscode','subjectidname',_0x761d('0x77'),_0x761d('0x78'),_0x761d('0x79'),_0x761d('0x7a'),'utcconversiontimezonecode','versionnumber'];var _0x14659e=_0x5e75de[_0x761d('0x7b')](_0x32c8e9);return db[_0x761d('0x26')][_0x761d('0x32')]({'where':{'id':_0x4f6834[_0x761d('0x2a')]['id']},'attributes':['id','username','password','remoteUri',_0x761d('0x7c'),_0x761d('0x7d'),'clientSecret',_0x761d('0x7e')],'include':[{'model':db[_0x761d('0x7f')],'as':_0x761d('0x7f'),'attributes':['id',_0x761d('0x80'),_0x761d('0x81')]}]})[_0x761d('0xf')](handleEntityNotFound(_0x674b32,null))[_0x761d('0xf')](function(_0x3a740f){if(_0x3a740f){if(_0x3a740f['modernAuthentication']){_0x3a740f[_0x761d('0x82')]=_0x3a740f[_0x761d('0x7f')][_0x761d('0x80')];_0x2a14d6=sanitizeRemoteUri(_0x3a740f[_0x761d('0x7f')][_0x761d('0x81')]);_0x2a202c=getWebApiUrl(_0x2a14d6);return _0x3a740f;}_0x2a14d6=sanitizeRemoteUri(_0x3a740f[_0x761d('0x83')]);_0x2a202c=getWebApiUrl(_0x2a14d6);var _0x254ecc={'method':_0x761d('0x84'),'uri':_0x761d('0x85')+_0x3a740f[_0x761d('0x7c')]+_0x761d('0x86'),'form':{'client_id':_0x3a740f[_0x761d('0x7d')],'resource':_0x2a14d6,'username':_0x3a740f[_0x761d('0x87')],'password':_0x3a740f[_0x761d('0x88')],'grant_type':_0x761d('0x88'),'client_secret':_0x3a740f['clientSecret']},'json':!![]};return rp(_0x254ecc);}})[_0x761d('0xf')](function(_0x5c5b3e){_0xca470d=_0x5c5b3e['access_token'];var _0x2dad5a={'method':_0x761d('0x89'),'uri':encodeURI(_0x2a202c+_0x761d('0x8a')+_0x19b5eb+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0xca470d,'If-None-Match':null,'OData-Version':_0x761d('0x8b')},'json':!![]};return rp(_0x2dad5a);})['then'](function(_0x983574){var _0x42d503=_0x983574[_0x761d('0x8c')][0x0];var _0x2a86a8=_0x42d503[_0x761d('0x8d')];var _0x19c7b9={'method':_0x761d('0x89'),'uri':_0x2a202c+'EntityDefinitions('+_0x2a86a8+_0x761d('0x8e'),'headers':{'Authorization':_0x761d('0x8f')+_0xca470d,'If-None-Match':null,'OData-Version':_0x761d('0x8b')},'json':!![]};return rp(_0x19c7b9);})[_0x761d('0xf')](function(_0x8d886e){_0xc47b6c=_0x8d886e;_0x165aca=_0xc47b6c['Attributes'];_0x165aca=_[_0x761d('0x90')](_0x165aca,function(_0x16c7e5){return!_0x14659e['includes'](_0x16c7e5[_0x761d('0x91')]);});var _0x180877=[];var _0x806f77=[];_0x165aca[_0x761d('0x92')](function(_0x2f0359){if(_0x2f0359[_0x761d('0x93')]){var _0x458fcd=_0x2f0359[_0x761d('0x93')][_0x761d('0x3c')](_0x2f0359[_0x761d('0x93')][_0x761d('0x3d')]('.')+0x1);if(_0x458fcd===_0x761d('0x94')){_0x180877[_0x761d('0x95')](getSelectList(_0x2a202c,_0xd85a3a,_0x806f77,_0xc47b6c[_0x761d('0x8d')],_0x2f0359[_0x761d('0x8d')],_0xca470d));}}});return Promise[_0x761d('0x96')](_0x180877);})[_0x761d('0xf')](function(_0x2e0b9f){_0x4772e2=_0x2e0b9f[0x0];var _0x45f3e0=[];var _0x51148c=[];_0x165aca['forEach'](function(_0x30569d){if(!_[_0x761d('0x97')](_0x30569d[_0x761d('0x93')])){var _0x1f35eb=_0x30569d[_0x761d('0x93')]['substring'](_0x30569d[_0x761d('0x93')]['lastIndexOf']('.')+0x1);if(_0x1f35eb===_0x761d('0x98')){_0x45f3e0[_0x761d('0x95')](getBooleanList(_0x2a202c,_0xd85a3a,_0x51148c,_0xc47b6c['MetadataId'],_0x30569d[_0x761d('0x8d')],_0xca470d));}}});return Promise['all'](_0x45f3e0);})[_0x761d('0xf')](function(_0x31d4ad){_0x373c3a=_0x31d4ad[0x0];var _0x29480e=[];var _0x485d06=[];_0x165aca[_0x761d('0x92')](function(_0x7793ac){if(_0x7793ac['@odata.type']){var _0x53c6d5=_0x7793ac[_0x761d('0x93')][_0x761d('0x3c')](_0x7793ac['@odata.type'][_0x761d('0x3d')]('.')+0x1);if(_0x53c6d5===_0x761d('0x99')||_0x53c6d5===_0x761d('0x9a')||_0x53c6d5===_0x761d('0x9b')||_0x53c6d5===_0x761d('0x9c')||_0x53c6d5===_0x761d('0x9d')||_0x53c6d5==='DateTimeAttributeMetadata'||_0x53c6d5===_0x761d('0x9e')||_0x53c6d5===_0x761d('0x9f')||_0x53c6d5===_0x761d('0xa0')||_0x53c6d5===_0x761d('0xa1')){_0x29480e[_0x761d('0x95')](getInputList(_0x2a202c,_0xd85a3a,_0x53c6d5,_0x485d06,_0xc47b6c['MetadataId'],_0x7793ac[_0x761d('0x8d')],_0xca470d));}}});return Promise['all'](_0x29480e);})['then'](function(_0x3712d3){_0x37eb4a=_0x3712d3[0x0];var _0x412b3c=_0x4772e2[_0x761d('0x7b')](_0x373c3a)[_0x761d('0x7b')](_0x37eb4a);var _0x36a35d={'count':_0x412b3c[_0x761d('0x1d')],'rows':_0x412b3c};return _0x36a35d;})[_0x761d('0xf')](respondWithResult(_0x674b32,null))['catch'](function(_0x4c09d4){var _0x362110=_0x4f6834[_0x761d('0x18')][_0x761d('0xa2')]?0x1f4:_0x4c09d4[_0x761d('0xa3')]||0x1f4;logger[_0x761d('0x11')](_0x4c09d4['stack']);delete _0x4c09d4[_0x761d('0x17')];if(_0x362110===0x191){_0x362110=0x190;}_0x674b32[_0x761d('0x6')](_0x362110)[_0x761d('0x13')](_0x4f6834['query'][_0x761d('0xa2')]?{'message':'Wrong\x20credentials','statusCode':_0x4c09d4['statusCode']}:_0x4c09d4);});};function getSelectList(_0x5425dd,_0x5dc7dd,_0x57bd85,_0x308a63,_0x5ed050,_0x46e06c){var _0x24aeac={'method':'GET','uri':_0x5425dd+_0x761d('0xa4')+_0x308a63+')/Attributes('+_0x5ed050+_0x761d('0xa5')+_0x761d('0xa6'),'headers':{'Authorization':'Bearer\x20'+_0x46e06c,'If-None-Match':null,'OData-Version':_0x761d('0x8b')},'json':!![]};return rp(_0x24aeac)['then'](function(_0x15e4af){var _0x1fe579=[];var _0x5b1bf2=_0x15e4af['OptionSet'][_0x761d('0xa7')];_0x5b1bf2['forEach'](function(_0xa78a38){_0x1fe579[_0x761d('0x95')]({'name':_0xa78a38['Label'][_0x761d('0xa8')][_0x761d('0xa9')],'value':String(_0xa78a38[_0x761d('0xaa')])});});var _0x215f80={'id':_0x5dc7dd+'_'+_0x15e4af[_0x761d('0x91')],'name':_0x15e4af[_0x761d('0xab')][_0x761d('0xa8')][_0x761d('0xa9')],'custom':![],'options':_0x1fe579};_0x57bd85[_0x761d('0x95')](_0x215f80);return _0x57bd85;});}function getBooleanList(_0xe119b4,_0x36bede,_0x18e335,_0x8e4d98,_0x484aae,_0x337a47){var _0x4e2d30={'method':_0x761d('0x89'),'uri':_0xe119b4+_0x761d('0xa4')+_0x8e4d98+_0x761d('0xac')+_0x484aae+_0x761d('0xad'),'headers':{'Authorization':_0x761d('0x8f')+_0x337a47,'If-None-Match':null,'OData-Version':_0x761d('0x8b')},'json':!![]};return rp(_0x4e2d30)[_0x761d('0xf')](function(_0x31455d){var _0x3c7f4e=[];_0x3c7f4e[_0x761d('0x95')]({'name':_0x31455d[_0x761d('0xae')][_0x761d('0xaf')][_0x761d('0xa9')][_0x761d('0xa8')][_0x761d('0xa9')],'value':'true'},{'name':_0x31455d[_0x761d('0xae')][_0x761d('0xb0')]['Label'][_0x761d('0xa8')][_0x761d('0xa9')],'value':_0x761d('0xb1')});var _0x4f4e76={'id':_0x36bede+'_'+_0x31455d['LogicalName'],'name':_0x31455d[_0x761d('0xab')][_0x761d('0xa8')][_0x761d('0xa9')],'custom':![],'options':_0x3c7f4e};_0x18e335[_0x761d('0x95')](_0x4f4e76);return _0x18e335;});}function getInputList(_0x2e7dbe,_0x14046f,_0x25546e,_0x428008,_0x14d6e4,_0x2ff1d0,_0x40e697){var _0x4a7f7d={'method':'GET','uri':_0x2e7dbe+_0x761d('0xa4')+_0x14d6e4+_0x761d('0xac')+_0x2ff1d0+_0x761d('0xb2')+_0x25546e+_0x761d('0xb3'),'headers':{'Authorization':_0x761d('0x8f')+_0x40e697,'If-None-Match':null,'OData-Version':_0x761d('0x8b')},'json':!![]};return rp(_0x4a7f7d)['then'](function(_0x24fc1d){var _0x1c9378={'id':_0x14046f+'_'+_0x24fc1d[_0x761d('0x91')],'name':_0x24fc1d[_0x761d('0xab')][_0x761d('0xa8')]?_0x24fc1d[_0x761d('0xab')][_0x761d('0xa8')][_0x761d('0xa9')]:_0x24fc1d['LogicalName'],'custom':![],'options':[]};_0x428008[_0x761d('0x95')](_0x1c9378);return _0x428008;});}
\ No newline at end of file
+var _0xaf4c=['getConfigurations','pick','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','Dynamics365Configuration','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','ticketType','incident','Incident','PhoneCall','title','customerid','caseorigincode','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidname','contractdetailidname','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','username','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','forEach','@odata.type','PicklistAttributeMetadata','push','all','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','concat','statusCode','stack','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Label','Value','LogicalName','UserLocalizedLabel',')/Attributes(','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','DisplayName','util','lodash','../../config/logger','api','../../mysqldb','json','offset','undefined','limit','count','status','Content-Range','update','then','end','sendStatus','error','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','options','where','Dynamics365Account','include','findAll','rows','catch','params','keys','includeAll','find','create','body','destroy'];(function(_0x7f83a6,_0x4a9ac7){var _0x5b2ba3=function(_0x5ecb87){while(--_0x5ecb87){_0x7f83a6['push'](_0x7f83a6['shift']());}};_0x5b2ba3(++_0x4a9ac7);}(_0xaf4c,0x1ed));var _0xcaf4=function(_0x126bc0,_0x1b3629){_0x126bc0=_0x126bc0-0x0;var _0x49ed12=_0xaf4c[_0x126bc0];return _0x49ed12;};'use strict';var rp=require('request-promise');var util=require(_0xcaf4('0x0'));var _=require(_0xcaf4('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xcaf4('0x2'))(_0xcaf4('0x3'));var db=require(_0xcaf4('0x4'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x3a680c,_0x1e0a53){_0x1e0a53=_0x1e0a53||0xc8;return function(_0x1018ca){if(_0x1018ca){return _0x3a680c['status'](_0x1e0a53)[_0xcaf4('0x5')](_0x1018ca);}};}function respondWithFilteredResult(_0x548527,_0x3de3af){return function(_0x1dc542){if(_0x1dc542){var _0xa95ea2=typeof _0x3de3af[_0xcaf4('0x6')]===_0xcaf4('0x7')&&typeof _0x3de3af[_0xcaf4('0x8')]==='undefined';var _0x5af977=_0x1dc542[_0xcaf4('0x9')];var _0x30773e=_0xa95ea2?0x0:_0x3de3af[_0xcaf4('0x6')];var _0x1c411e=_0xa95ea2?_0x1dc542[_0xcaf4('0x9')]:_0x3de3af[_0xcaf4('0x6')]+_0x3de3af[_0xcaf4('0x8')];var _0x13a6d2;if(_0x1c411e>=_0x5af977){_0x1c411e=_0x5af977;_0x13a6d2=0xc8;}else{_0x13a6d2=0xce;}_0x548527[_0xcaf4('0xa')](_0x13a6d2);return _0x548527['set'](_0xcaf4('0xb'),_0x30773e+'-'+_0x1c411e+'/'+_0x5af977)[_0xcaf4('0x5')](_0x1dc542);}return null;};}function saveUpdates(_0x4d270c){return function(_0x308173){if(_0x308173){return _0x308173[_0xcaf4('0xc')](_0x4d270c)[_0xcaf4('0xd')](function(_0x591297){return _0x591297;});}return null;};}function removeEntity(_0x3738b7){return function(_0x2ad48b){if(_0x2ad48b){return _0x2ad48b['destroy']()[_0xcaf4('0xd')](function(){_0x3738b7['status'](0xcc)[_0xcaf4('0xe')]();});}};}function handleEntityNotFound(_0x191f38){return function(_0x67532a){if(!_0x67532a){_0x191f38[_0xcaf4('0xf')](0x194);}return _0x67532a;};}function handleError(_0x1380f9,_0x3bfcc5){_0x3bfcc5=_0x3bfcc5||0x1f4;return function(_0x4d2817){logger[_0xcaf4('0x10')](_0x4d2817['stack']);if(_0x4d2817[_0xcaf4('0x11')]){delete _0x4d2817['name'];}_0x1380f9[_0xcaf4('0xa')](_0x3bfcc5)[_0xcaf4('0x12')](_0x4d2817);};}exports[_0xcaf4('0x13')]=function(_0x4e174d,_0x585d18){var _0x1ddae3={},_0x2c9828={},_0x23db74={'count':0x0,'rows':[]};var _0x2c4b02=_[_0xcaf4('0x14')](db['Dynamics365Account'][_0xcaf4('0x15')],function(_0x3ba74d){return{'name':_0x3ba74d[_0xcaf4('0x16')],'type':_0x3ba74d['type'][_0xcaf4('0x17')]};});_0x2c9828[_0xcaf4('0x18')]=_[_0xcaf4('0x14')](_0x2c4b02,'name');_0x2c9828[_0xcaf4('0x19')]=_['keys'](_0x4e174d[_0xcaf4('0x19')]);_0x2c9828[_0xcaf4('0x1a')]=_[_0xcaf4('0x1b')](_0x2c9828['model'],_0x2c9828[_0xcaf4('0x19')]);_0x1ddae3[_0xcaf4('0x1c')]=_[_0xcaf4('0x1b')](_0x2c9828[_0xcaf4('0x18')],qs['fields'](_0x4e174d[_0xcaf4('0x19')][_0xcaf4('0x1d')]));_0x1ddae3['attributes']=_0x1ddae3[_0xcaf4('0x1c')][_0xcaf4('0x1e')]?_0x1ddae3[_0xcaf4('0x1c')]:_0x2c9828[_0xcaf4('0x18')];if(!_0x4e174d[_0xcaf4('0x19')][_0xcaf4('0x1f')](_0xcaf4('0x20'))){_0x1ddae3['limit']=qs[_0xcaf4('0x8')](_0x4e174d[_0xcaf4('0x19')][_0xcaf4('0x8')]);_0x1ddae3['offset']=qs[_0xcaf4('0x6')](_0x4e174d[_0xcaf4('0x19')][_0xcaf4('0x6')]);}_0x1ddae3[_0xcaf4('0x21')]=qs[_0xcaf4('0x22')](_0x4e174d[_0xcaf4('0x19')][_0xcaf4('0x22')]);_0x1ddae3['where']=qs[_0xcaf4('0x1a')](_['pick'](_0x4e174d['query'],_0x2c9828[_0xcaf4('0x1a')]),_0x2c4b02);if(_0x4e174d['query'][_0xcaf4('0x23')]){_0x1ddae3['where']=_[_0xcaf4('0x24')](_0x1ddae3['where'],{'$or':_[_0xcaf4('0x14')](_0x2c4b02,function(_0xac02f){if(_0xac02f[_0xcaf4('0x25')]!==_0xcaf4('0x26')){var _0x5f1531={};_0x5f1531[_0xac02f[_0xcaf4('0x11')]]={'$like':'%'+_0x4e174d[_0xcaf4('0x19')][_0xcaf4('0x23')]+'%'};return _0x5f1531;}})});}_0x1ddae3=_['merge']({},_0x1ddae3,_0x4e174d[_0xcaf4('0x27')]);var _0x385c38={'where':_0x1ddae3[_0xcaf4('0x28')]};return db[_0xcaf4('0x29')][_0xcaf4('0x9')](_0x385c38)['then'](function(_0x50213e){_0x23db74['count']=_0x50213e;if(_0x4e174d['query']['includeAll']){_0x1ddae3[_0xcaf4('0x2a')]=[{'all':!![]}];}return db[_0xcaf4('0x29')][_0xcaf4('0x2b')](_0x1ddae3);})['then'](function(_0x60e24){_0x23db74[_0xcaf4('0x2c')]=_0x60e24;return _0x23db74;})[_0xcaf4('0xd')](respondWithFilteredResult(_0x585d18,_0x1ddae3))[_0xcaf4('0x2d')](handleError(_0x585d18,null));};exports['show']=function(_0x4fa706,_0x50a517){var _0x4d3de6={'raw':![],'where':{'id':_0x4fa706[_0xcaf4('0x2e')]['id']}},_0x5bc344={};_0x5bc344[_0xcaf4('0x18')]=_['keys'](db[_0xcaf4('0x29')][_0xcaf4('0x15')]);_0x5bc344['query']=_[_0xcaf4('0x2f')](_0x4fa706[_0xcaf4('0x19')]);_0x5bc344[_0xcaf4('0x1a')]=_['intersection'](_0x5bc344['model'],_0x5bc344[_0xcaf4('0x19')]);_0x4d3de6[_0xcaf4('0x1c')]=_[_0xcaf4('0x1b')](_0x5bc344[_0xcaf4('0x18')],qs['fields'](_0x4fa706[_0xcaf4('0x19')][_0xcaf4('0x1d')]));_0x4d3de6[_0xcaf4('0x1c')]=_0x4d3de6['attributes'][_0xcaf4('0x1e')]?_0x4d3de6[_0xcaf4('0x1c')]:_0x5bc344[_0xcaf4('0x18')];if(_0x4fa706[_0xcaf4('0x19')][_0xcaf4('0x30')]){_0x4d3de6[_0xcaf4('0x2a')]=[{'all':!![]}];}_0x4d3de6=_['merge']({},_0x4d3de6,_0x4fa706['options']);return db[_0xcaf4('0x29')][_0xcaf4('0x31')](_0x4d3de6)['then'](handleEntityNotFound(_0x50a517,null))[_0xcaf4('0xd')](respondWithResult(_0x50a517,null))[_0xcaf4('0x2d')](handleError(_0x50a517,null));};exports[_0xcaf4('0x32')]=function(_0x645b5c,_0x45f1fb){return db['Dynamics365Account'][_0xcaf4('0x32')](_0x645b5c[_0xcaf4('0x33')],{})[_0xcaf4('0xd')](respondWithResult(_0x45f1fb,0xc9))[_0xcaf4('0x2d')](handleError(_0x45f1fb,null));};exports[_0xcaf4('0xc')]=function(_0x594b5b,_0x1f84f1){if(_0x594b5b[_0xcaf4('0x33')]['id']){delete _0x594b5b[_0xcaf4('0x33')]['id'];}return db['Dynamics365Account'][_0xcaf4('0x31')]({'where':{'id':_0x594b5b[_0xcaf4('0x2e')]['id']}})['then'](handleEntityNotFound(_0x1f84f1,null))[_0xcaf4('0xd')](saveUpdates(_0x594b5b[_0xcaf4('0x33')],null))[_0xcaf4('0xd')](respondWithResult(_0x1f84f1,null))['catch'](handleError(_0x1f84f1,null));};exports[_0xcaf4('0x34')]=function(_0xe73a96,_0x3cb593){return db[_0xcaf4('0x29')][_0xcaf4('0x31')]({'where':{'id':_0xe73a96[_0xcaf4('0x2e')]['id']}})[_0xcaf4('0xd')](handleEntityNotFound(_0x3cb593,null))['then'](removeEntity(_0x3cb593,null))[_0xcaf4('0x2d')](handleError(_0x3cb593,null));};exports[_0xcaf4('0x35')]=function(_0x34b6b0,_0x456dbe){var _0x1acdb4={};var _0xdacb05={};var _0x19e989;var _0x3920b2;return db[_0xcaf4('0x29')]['findOne']({'where':{'id':_0x34b6b0['params']['id']}})[_0xcaf4('0xd')](handleEntityNotFound(_0x456dbe,null))[_0xcaf4('0xd')](function(_0x40179c){if(_0x40179c){_0x19e989=_0x40179c;_0xdacb05[_0xcaf4('0x18')]=_['keys'](db['Dynamics365Configuration'][_0xcaf4('0x15')]);_0xdacb05[_0xcaf4('0x19')]=_['keys'](_0x34b6b0[_0xcaf4('0x19')]);_0xdacb05[_0xcaf4('0x1a')]=_[_0xcaf4('0x1b')](_0xdacb05[_0xcaf4('0x18')],_0xdacb05[_0xcaf4('0x19')]);_0x1acdb4[_0xcaf4('0x1c')]=_[_0xcaf4('0x1b')](_0xdacb05[_0xcaf4('0x18')],qs['fields'](_0x34b6b0['query'][_0xcaf4('0x1d')]));_0x1acdb4[_0xcaf4('0x1c')]=_0x1acdb4[_0xcaf4('0x1c')]['length']?_0x1acdb4[_0xcaf4('0x1c')]:_0xdacb05[_0xcaf4('0x18')];_0x1acdb4['order']=qs[_0xcaf4('0x22')](_0x34b6b0[_0xcaf4('0x19')][_0xcaf4('0x22')]);_0x1acdb4[_0xcaf4('0x28')]=qs[_0xcaf4('0x1a')](_[_0xcaf4('0x36')](_0x34b6b0['query'],_0xdacb05[_0xcaf4('0x1a')]));if(_0x34b6b0[_0xcaf4('0x19')]['filter']){_0x1acdb4[_0xcaf4('0x28')]=_['merge'](_0x1acdb4['where'],{'$or':_['map'](_0x1acdb4[_0xcaf4('0x1c')],function(_0x3d2263){var _0x896dd3={};_0x896dd3[_0x3d2263]={'$like':'%'+_0x34b6b0[_0xcaf4('0x19')][_0xcaf4('0x23')]+'%'};return _0x896dd3;})});}_0x1acdb4=_[_0xcaf4('0x24')]({},_0x1acdb4,_0x34b6b0['options']);return _0x19e989['getConfigurations'](_0x1acdb4);}})[_0xcaf4('0xd')](function(_0x27c762){if(_0x27c762){_0x3920b2=_0x27c762['length'];if(!_0x34b6b0[_0xcaf4('0x19')][_0xcaf4('0x1f')](_0xcaf4('0x20'))){_0x1acdb4[_0xcaf4('0x8')]=qs[_0xcaf4('0x8')](_0x34b6b0[_0xcaf4('0x19')]['limit']);_0x1acdb4[_0xcaf4('0x6')]=qs['offset'](_0x34b6b0['query'][_0xcaf4('0x6')]);}return _0x19e989['getConfigurations'](_0x1acdb4);}})[_0xcaf4('0xd')](function(_0x56eda6){if(_0x56eda6){return _0x56eda6?{'count':_0x3920b2,'rows':_0x56eda6}:null;}})[_0xcaf4('0xd')](respondWithResult(_0x456dbe,null))[_0xcaf4('0x2d')](handleError(_0x456dbe,null));};exports[_0xcaf4('0x37')]=function(_0x5f2f31,_0x2f7a0b){if(_0x5f2f31[_0xcaf4('0x33')]['id']){delete _0x5f2f31[_0xcaf4('0x33')]['id'];}return db[_0xcaf4('0x29')][_0xcaf4('0x38')]({'where':{'id':_0x5f2f31[_0xcaf4('0x2e')]['id']}})[_0xcaf4('0xd')](handleEntityNotFound(_0x2f7a0b,null))[_0xcaf4('0xd')](function(_0x190679){if(_0x190679){_0x5f2f31['body'][_0xcaf4('0x39')]=_0x190679['id'];_0x5f2f31['body'][_0xcaf4('0x3a')]=integrations[_0xcaf4('0x3b')](_0x5f2f31[_0xcaf4('0x33')][_0xcaf4('0x3c')],_0x5f2f31[_0xcaf4('0x33')][_0xcaf4('0x25')]);_0x5f2f31[_0xcaf4('0x33')][_0xcaf4('0x3d')]=integrations['getDescriptions'](_0x5f2f31[_0xcaf4('0x33')][_0xcaf4('0x3c')],_0x5f2f31[_0xcaf4('0x33')][_0xcaf4('0x25')]);return db[_0xcaf4('0x3e')][_0xcaf4('0x32')](_0x5f2f31[_0xcaf4('0x33')],{'include':[{'model':db[_0xcaf4('0x3f')],'as':'Subjects'},{'model':db[_0xcaf4('0x3f')],'as':_0xcaf4('0x3d')}]});}return null;})[_0xcaf4('0xd')](respondWithResult(_0x2f7a0b,null))[_0xcaf4('0x2d')](handleError(_0x2f7a0b,null));};function sanitizeRemoteUri(_0x2943a0){var _0x314067=_0x2943a0[_0xcaf4('0x40')](-0x1);if(_0x314067==='/')return _0x2943a0[_0xcaf4('0x41')](0x0,_0x2943a0[_0xcaf4('0x42')](_0x314067));return _0x2943a0;}function getWebApiUrl(_0x49372c){return util[_0xcaf4('0x43')](_0xcaf4('0x44'),_0x49372c);}exports['getFields']=function(_0xd39332,_0x2c3588){var _0x1b000b=_0xd39332[_0xcaf4('0x19')][_0xcaf4('0x45')];var _0x4eb3ca=_0x1b000b===_0xcaf4('0x46')?_0xcaf4('0x47'):_0xcaf4('0x48');var _0x1a6f19='';var _0x44c8c5='';var _0x48f691='';var _0x56c5b8='';var _0x62c81f='';var _0x360a9e='';var _0x243155='';var _0x5e7bd7='';var _0xdc7b0c=[_0xcaf4('0x49'),'description',_0xcaf4('0x4a'),'ownerid',_0xcaf4('0x4b'),'subject',_0xcaf4('0x4c'),_0xcaf4('0x4d'),'directioncode',_0xcaf4('0x4e')];var _0x489742=[_0xcaf4('0x4f'),_0xcaf4('0x50'),_0xcaf4('0x51'),'billedserviceunits',_0xcaf4('0x52'),'contactidyominame',_0xcaf4('0x53'),'contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame',_0xcaf4('0x54'),_0xcaf4('0x55'),_0xcaf4('0x56'),'createdonbehalfbyname',_0xcaf4('0x57'),_0xcaf4('0x58'),_0xcaf4('0x59'),_0xcaf4('0x5a'),_0xcaf4('0x5b'),'entitlementidname','entityimage_timestamp',_0xcaf4('0x5c'),_0xcaf4('0x5d'),_0xcaf4('0x5e'),_0xcaf4('0x5f'),'followupby',_0xcaf4('0x60'),_0xcaf4('0x61'),_0xcaf4('0x62'),_0xcaf4('0x63'),_0xcaf4('0x64'),'modifiedbyexternalpartyname',_0xcaf4('0x65'),_0xcaf4('0x66'),'modifiedbyyominame',_0xcaf4('0x67'),'modifiedonbehalfbyname','modifiedonbehalfbyyominame',_0xcaf4('0x68'),_0xcaf4('0x69'),_0xcaf4('0x6a'),_0xcaf4('0x6b'),_0xcaf4('0x6c'),_0xcaf4('0x6d'),_0xcaf4('0x6e'),_0xcaf4('0x6f'),_0xcaf4('0x70'),'primarycontactidname',_0xcaf4('0x71'),_0xcaf4('0x72'),'productidname',_0xcaf4('0x73'),_0xcaf4('0x74'),_0xcaf4('0x75'),_0xcaf4('0x76'),_0xcaf4('0x77'),_0xcaf4('0x78'),'sentimentvalue',_0xcaf4('0x79'),_0xcaf4('0x7a'),_0xcaf4('0x7b'),_0xcaf4('0x7c'),'statuscode','subjectidname',_0xcaf4('0x7d'),_0xcaf4('0x7e'),_0xcaf4('0x7f'),_0xcaf4('0x80'),_0xcaf4('0x81'),'versionnumber'];var _0x40ccc5=_0xdc7b0c['concat'](_0x489742);return db[_0xcaf4('0x29')][_0xcaf4('0x38')]({'where':{'id':_0xd39332[_0xcaf4('0x2e')]['id']},'attributes':['id','username',_0xcaf4('0x82'),_0xcaf4('0x83'),_0xcaf4('0x84'),_0xcaf4('0x85'),_0xcaf4('0x86'),_0xcaf4('0x87')],'include':[{'model':db[_0xcaf4('0x88')],'as':_0xcaf4('0x88'),'attributes':['id',_0xcaf4('0x89'),_0xcaf4('0x8a')]}]})[_0xcaf4('0xd')](handleEntityNotFound(_0x2c3588,null))[_0xcaf4('0xd')](function(_0x46f320){if(_0x46f320){if(_0x46f320['modernAuthentication']){_0x46f320[_0xcaf4('0x8b')]=_0x46f320[_0xcaf4('0x88')][_0xcaf4('0x89')];_0x5e7bd7=sanitizeRemoteUri(_0x46f320[_0xcaf4('0x88')][_0xcaf4('0x8a')]);_0x243155=getWebApiUrl(_0x5e7bd7);return _0x46f320;}_0x5e7bd7=sanitizeRemoteUri(_0x46f320['remoteUri']);_0x243155=getWebApiUrl(_0x5e7bd7);var _0x4a15dd={'method':_0xcaf4('0x8c'),'uri':_0xcaf4('0x8d')+_0x46f320[_0xcaf4('0x84')]+'/oauth2/token','form':{'client_id':_0x46f320[_0xcaf4('0x85')],'resource':_0x5e7bd7,'username':_0x46f320[_0xcaf4('0x8e')],'password':_0x46f320[_0xcaf4('0x82')],'grant_type':_0xcaf4('0x82'),'client_secret':_0x46f320[_0xcaf4('0x86')]},'json':!![]};return rp(_0x4a15dd);}})[_0xcaf4('0xd')](function(_0xc39155){_0x360a9e=_0xc39155[_0xcaf4('0x8b')];var _0x3fa020={'method':_0xcaf4('0x8f'),'uri':encodeURI(_0x243155+_0xcaf4('0x90')+_0x4eb3ca+'\x27'),'headers':{'Authorization':_0xcaf4('0x91')+_0x360a9e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3fa020);})[_0xcaf4('0xd')](function(_0x21ba9a){var _0x45b886=_0x21ba9a[_0xcaf4('0x92')][0x0];var _0x1645ef=_0x45b886[_0xcaf4('0x93')];var _0x134d97={'method':_0xcaf4('0x8f'),'uri':_0x243155+_0xcaf4('0x94')+_0x1645ef+_0xcaf4('0x95'),'headers':{'Authorization':_0xcaf4('0x91')+_0x360a9e,'If-None-Match':null,'OData-Version':_0xcaf4('0x96')},'json':!![]};return rp(_0x134d97);})[_0xcaf4('0xd')](function(_0x15bb18){_0x1a6f19=_0x15bb18;_0x44c8c5=_0x1a6f19[_0xcaf4('0x97')];_0x44c8c5=_[_0xcaf4('0x98')](_0x44c8c5,function(_0x5461e4){return!_0x40ccc5['includes'](_0x5461e4['LogicalName']);});var _0x3b048e=[];var _0x4fd7d1=[];_0x44c8c5[_0xcaf4('0x99')](function(_0x5a25e7){if(_0x5a25e7[_0xcaf4('0x9a')]){var _0x1c6648=_0x5a25e7[_0xcaf4('0x9a')]['substring'](_0x5a25e7[_0xcaf4('0x9a')][_0xcaf4('0x42')]('.')+0x1);if(_0x1c6648===_0xcaf4('0x9b')){_0x3b048e[_0xcaf4('0x9c')](getSelectList(_0x243155,_0x1b000b,_0x4fd7d1,_0x1a6f19['MetadataId'],_0x5a25e7[_0xcaf4('0x93')],_0x360a9e));}}});return Promise[_0xcaf4('0x9d')](_0x3b048e);})[_0xcaf4('0xd')](function(_0x36ea5a){_0x48f691=_0x36ea5a[0x0];var _0x55dbdd=[];var _0x3cf7ea=[];_0x44c8c5['forEach'](function(_0x9cdb42){if(!_['isNil'](_0x9cdb42[_0xcaf4('0x9a')])){var _0x44a426=_0x9cdb42[_0xcaf4('0x9a')][_0xcaf4('0x41')](_0x9cdb42[_0xcaf4('0x9a')][_0xcaf4('0x42')]('.')+0x1);if(_0x44a426==='BooleanAttributeMetadata'){_0x55dbdd[_0xcaf4('0x9c')](getBooleanList(_0x243155,_0x1b000b,_0x3cf7ea,_0x1a6f19[_0xcaf4('0x93')],_0x9cdb42['MetadataId'],_0x360a9e));}}});return Promise[_0xcaf4('0x9d')](_0x55dbdd);})[_0xcaf4('0xd')](function(_0x18f0cb){_0x56c5b8=_0x18f0cb[0x0];var _0x15db07=[];var _0x2de713=[];_0x44c8c5['forEach'](function(_0x2cc5ad){if(_0x2cc5ad[_0xcaf4('0x9a')]){var _0x1b8535=_0x2cc5ad[_0xcaf4('0x9a')][_0xcaf4('0x41')](_0x2cc5ad['@odata.type'][_0xcaf4('0x42')]('.')+0x1);if(_0x1b8535===_0xcaf4('0x9e')||_0x1b8535===_0xcaf4('0x9f')||_0x1b8535==='BigIntAttributeMetadata'||_0x1b8535===_0xcaf4('0xa0')||_0x1b8535===_0xcaf4('0xa1')||_0x1b8535===_0xcaf4('0xa2')||_0x1b8535===_0xcaf4('0xa3')||_0x1b8535===_0xcaf4('0xa4')||_0x1b8535==='StateAttributeMetadata'||_0x1b8535===_0xcaf4('0xa5')){_0x15db07[_0xcaf4('0x9c')](getInputList(_0x243155,_0x1b000b,_0x1b8535,_0x2de713,_0x1a6f19[_0xcaf4('0x93')],_0x2cc5ad['MetadataId'],_0x360a9e));}}});return Promise[_0xcaf4('0x9d')](_0x15db07);})['then'](function(_0x48b51b){_0x62c81f=_0x48b51b[0x0];var _0x1b8e88=_0x48f691[_0xcaf4('0xa6')](_0x56c5b8)[_0xcaf4('0xa6')](_0x62c81f);var _0x2ecf55={'count':_0x1b8e88[_0xcaf4('0x1e')],'rows':_0x1b8e88};return _0x2ecf55;})[_0xcaf4('0xd')](respondWithResult(_0x2c3588,null))['catch'](function(_0x410893){var _0x35c766=_0xd39332[_0xcaf4('0x19')]['test']?0x1f4:_0x410893[_0xcaf4('0xa7')]||0x1f4;logger[_0xcaf4('0x10')](_0x410893[_0xcaf4('0xa8')]);delete _0x410893[_0xcaf4('0x11')];if(_0x35c766===0x191){_0x35c766=0x190;}_0x2c3588[_0xcaf4('0xa')](_0x35c766)[_0xcaf4('0x12')](_0xd39332[_0xcaf4('0x19')]['test']?{'message':_0xcaf4('0xa9'),'statusCode':_0x410893[_0xcaf4('0xa7')]}:_0x410893);});};function getSelectList(_0x3b292a,_0x3efa97,_0x4d5ee7,_0xa01db1,_0x39dfcb,_0x33ac7b){var _0xa68ec3={'method':'GET','uri':_0x3b292a+_0xcaf4('0x94')+_0xa01db1+')/Attributes('+_0x39dfcb+_0xcaf4('0xaa')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0xcaf4('0x91')+_0x33ac7b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xa68ec3)[_0xcaf4('0xd')](function(_0x695bde){var _0x30e4b1=[];var _0x11b203=_0x695bde[_0xcaf4('0xab')]['Options'];_0x11b203[_0xcaf4('0x99')](function(_0x4bd8a2){_0x30e4b1[_0xcaf4('0x9c')]({'name':_0x4bd8a2[_0xcaf4('0xac')]['UserLocalizedLabel'][_0xcaf4('0xac')],'value':String(_0x4bd8a2[_0xcaf4('0xad')])});});var _0x1e7508={'id':_0x3efa97+'_'+_0x695bde[_0xcaf4('0xae')],'name':_0x695bde['DisplayName'][_0xcaf4('0xaf')]['Label'],'custom':![],'options':_0x30e4b1};_0x4d5ee7[_0xcaf4('0x9c')](_0x1e7508);return _0x4d5ee7;});}function getBooleanList(_0x17a2fc,_0x20dea6,_0x128116,_0x5e5b7a,_0x1c50ed,_0x181936){var _0x530431={'method':_0xcaf4('0x8f'),'uri':_0x17a2fc+_0xcaf4('0x94')+_0x5e5b7a+_0xcaf4('0xb0')+_0x1c50ed+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xcaf4('0x91')+_0x181936,'If-None-Match':null,'OData-Version':_0xcaf4('0x96')},'json':!![]};return rp(_0x530431)[_0xcaf4('0xd')](function(_0xc96ebc){var _0x2cd15b=[];_0x2cd15b['push']({'name':_0xc96ebc[_0xcaf4('0xab')]['TrueOption'][_0xcaf4('0xac')]['UserLocalizedLabel'][_0xcaf4('0xac')],'value':_0xcaf4('0xb1')},{'name':_0xc96ebc[_0xcaf4('0xab')]['FalseOption']['Label'][_0xcaf4('0xaf')]['Label'],'value':_0xcaf4('0xb2')});var _0xeb3618={'id':_0x20dea6+'_'+_0xc96ebc['LogicalName'],'name':_0xc96ebc['DisplayName']['UserLocalizedLabel'][_0xcaf4('0xac')],'custom':![],'options':_0x2cd15b};_0x128116[_0xcaf4('0x9c')](_0xeb3618);return _0x128116;});}function getInputList(_0x3519ec,_0x44b907,_0x52c114,_0x161fc6,_0x23ee4a,_0x253d1e,_0x5d14b2){var _0x15c10b={'method':_0xcaf4('0x8f'),'uri':_0x3519ec+'EntityDefinitions('+_0x23ee4a+_0xcaf4('0xb0')+_0x253d1e+_0xcaf4('0xb3')+_0x52c114+_0xcaf4('0xb4'),'headers':{'Authorization':_0xcaf4('0x91')+_0x5d14b2,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x15c10b)['then'](function(_0x143e79){var _0x4e7e9d={'id':_0x44b907+'_'+_0x143e79[_0xcaf4('0xae')],'name':_0x143e79['DisplayName'][_0xcaf4('0xaf')]?_0x143e79[_0xcaf4('0xb5')][_0xcaf4('0xaf')]['Label']:_0x143e79['LogicalName'],'custom':![],'options':[]};_0x161fc6[_0xcaf4('0x9c')](_0x4e7e9d);return _0x161fc6;});}
\ No newline at end of file
index 9b8193d..e028f59 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(_0x40cd30,_0x25e2c4){var _0x4a2caf=function(_0x1e1ce6){while(--_0x1e1ce6){_0x40cd30['push'](_0x40cd30['shift']());}};_0x4a2caf(++_0x25e2c4);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'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(_0x155b8f,_0x4ba352){var _0x4b54fb=function(_0x307c36){while(--_0x307c36){_0x155b8f['push'](_0x155b8f['shift']());}};_0x4b54fb(++_0x4ba352);}(_0xe706,0xa3));var _0x6e70=function(_0x55976e,_0x27e156){_0x55976e=_0x55976e-0x0;var _0x169ee6=_0xe706[_0x55976e];return _0x169ee6;};'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 c138af2..ef54a7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e9a=['Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','message','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','include','map','model','stringify','find','ShowDynamics365Account','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0x5e9a,0x7a));var _0xa5e9=function(_0x1c4cc8,_0x3bbfe1){_0x1c4cc8=_0x1c4cc8-0x0;var _0x3bfcb3=_0x5e9a[_0x1c4cc8];return _0x3bfcb3;};'use strict';var _=require(_0xa5e9('0x0'));var util=require(_0xa5e9('0x1'));var moment=require('moment');var BPromise=require(_0xa5e9('0x2'));var rs=require(_0xa5e9('0x3'));var fs=require('fs');var Redis=require(_0xa5e9('0x4'));var db=require(_0xa5e9('0x5'))['db'];var utils=require(_0xa5e9('0x6'));var logger=require(_0xa5e9('0x7'))(_0xa5e9('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa5e9('0x9')][_0xa5e9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x239c89,_0x5ca5ca,_0x3a6e10){return new BPromise(function(_0x48ddc7,_0x122222){return client[_0xa5e9('0xb')](_0x239c89,_0x3a6e10)[_0xa5e9('0xc')](function(_0x5301ae){logger[_0xa5e9('0xd')](_0xa5e9('0xe'),_0x5ca5ca,_0xa5e9('0xf'));logger[_0xa5e9('0x10')](_0xa5e9('0x11'),_0x5ca5ca,'request\x20sent',JSON['stringify'](_0x5301ae));if(_0x5301ae[_0xa5e9('0x12')]){if(_0x5301ae[_0xa5e9('0x12')]['code']===0x1f4){logger[_0xa5e9('0x12')](_0xa5e9('0xe'),_0x5ca5ca,_0x5301ae[_0xa5e9('0x12')][_0xa5e9('0x13')]);return _0x122222(_0x5301ae[_0xa5e9('0x12')][_0xa5e9('0x13')]);}logger[_0xa5e9('0x12')](_0xa5e9('0xe'),_0x5ca5ca,_0x5301ae[_0xa5e9('0x12')][_0xa5e9('0x13')]);return _0x48ddc7(_0x5301ae[_0xa5e9('0x12')][_0xa5e9('0x13')]);}else{logger[_0xa5e9('0xd')](_0xa5e9('0xe'),_0x5ca5ca,_0xa5e9('0xf'));_0x48ddc7(_0x5301ae['result'][_0xa5e9('0x13')]);}})[_0xa5e9('0x14')](function(_0x2907ea){logger[_0xa5e9('0x12')](_0xa5e9('0xe'),_0x5ca5ca,_0x2907ea);_0x122222(_0x2907ea);});});}exports[_0xa5e9('0x15')]=function(_0x3da571){var _0x27ffdf=this;return new Promise(function(_0x2f6932,_0x3f4904){return db[_0xa5e9('0x16')][_0xa5e9('0x17')]({'raw':_0x3da571['options']?_0x3da571[_0xa5e9('0x18')][_0xa5e9('0x19')]===undefined?!![]:![]:!![],'where':_0x3da571[_0xa5e9('0x18')]?_0x3da571[_0xa5e9('0x18')][_0xa5e9('0x1a')]||null:null,'attributes':_0x3da571['options']?_0x3da571[_0xa5e9('0x18')][_0xa5e9('0x1b')]||null:null,'limit':_0x3da571[_0xa5e9('0x18')]?_0x3da571['options']['limit']||null:null,'include':_0x3da571[_0xa5e9('0x18')]?_0x3da571[_0xa5e9('0x18')][_0xa5e9('0x1c')]?_['map'](_0x3da571[_0xa5e9('0x18')]['include'],function(_0x4d5576){return{'model':db[_0x4d5576['model']],'as':_0x4d5576['as'],'attributes':_0x4d5576[_0xa5e9('0x1b')],'include':_0x4d5576[_0xa5e9('0x1c')]?_[_0xa5e9('0x1d')](_0x4d5576[_0xa5e9('0x1c')],function(_0x42b3df){return{'model':db[_0x42b3df[_0xa5e9('0x1e')]],'as':_0x42b3df['as'],'attributes':_0x42b3df[_0xa5e9('0x1b')],'include':_0x42b3df['include']?_['map'](_0x42b3df['include'],function(_0x56e637){return{'model':db[_0x56e637[_0xa5e9('0x1e')]],'as':_0x56e637['as'],'attributes':_0x56e637[_0xa5e9('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ea0be){logger['info'](_0xa5e9('0x15'),_0x3da571);logger[_0xa5e9('0x10')](_0xa5e9('0x15'),_0x3da571,JSON[_0xa5e9('0x1f')](_0x3ea0be));_0x2f6932(_0x3ea0be);})[_0xa5e9('0x14')](function(_0x11b3d0){logger['error'](_0xa5e9('0x15'),_0x11b3d0[_0xa5e9('0x13')],_0x3da571);_0x3f4904(_0x27ffdf[_0xa5e9('0x12')](0x1f4,_0x11b3d0[_0xa5e9('0x13')]));});});};exports['ShowDynamics365Account']=function(_0x1489b1){var _0x26df68=this;return new Promise(function(_0x40b034,_0x5e00ab){return db[_0xa5e9('0x16')][_0xa5e9('0x20')]({'raw':_0x1489b1[_0xa5e9('0x18')]?_0x1489b1[_0xa5e9('0x18')][_0xa5e9('0x19')]===undefined?!![]:![]:!![],'where':_0x1489b1['options']?_0x1489b1[_0xa5e9('0x18')][_0xa5e9('0x1a')]||null:null,'attributes':_0x1489b1[_0xa5e9('0x18')]?_0x1489b1[_0xa5e9('0x18')][_0xa5e9('0x1b')]||null:null,'include':_0x1489b1[_0xa5e9('0x18')]?_0x1489b1[_0xa5e9('0x18')][_0xa5e9('0x1c')]?_[_0xa5e9('0x1d')](_0x1489b1[_0xa5e9('0x18')]['include'],function(_0x5cfc9a){return{'model':db[_0x5cfc9a[_0xa5e9('0x1e')]],'as':_0x5cfc9a['as'],'attributes':_0x5cfc9a['attributes'],'include':_0x5cfc9a[_0xa5e9('0x1c')]?_[_0xa5e9('0x1d')](_0x5cfc9a[_0xa5e9('0x1c')],function(_0x5bd548){return{'model':db[_0x5bd548['model']],'as':_0x5bd548['as'],'attributes':_0x5bd548['attributes'],'include':_0x5bd548[_0xa5e9('0x1c')]?_[_0xa5e9('0x1d')](_0x5bd548['include'],function(_0x4bba35){return{'model':db[_0x4bba35[_0xa5e9('0x1e')]],'as':_0x4bba35['as'],'attributes':_0x4bba35[_0xa5e9('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd12e78){logger[_0xa5e9('0xd')]('ShowDynamics365Account',_0x1489b1);logger['debug'](_0xa5e9('0x21'),_0x1489b1,JSON['stringify'](_0xd12e78));_0x40b034(_0xd12e78);})[_0xa5e9('0x14')](function(_0x557d9a){logger['error'](_0xa5e9('0x21'),_0x557d9a[_0xa5e9('0x13')],_0x1489b1);_0x5e00ab(_0x26df68['error'](0x1f4,_0x557d9a[_0xa5e9('0x13')]));});});};
\ No newline at end of file
+var _0xd4b2=['request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetDynamics365Account','options','raw','where','attributes','limit','include','model','map','debug','ShowDynamics365Account','Dynamics365Account','find','util','moment','bluebird','rpc','../../config/environment','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s'];(function(_0x358ae8,_0x57a8de){var _0x306a25=function(_0x14e35d){while(--_0x14e35d){_0x358ae8['push'](_0x358ae8['shift']());}};_0x306a25(++_0x57a8de);}(_0xd4b2,0x1d5));var _0x2d4b=function(_0x38ff2b,_0x3a0316){_0x38ff2b=_0x38ff2b-0x0;var _0x341f5e=_0xd4b2[_0x38ff2b];return _0x341f5e;};'use strict';var _=require('lodash');var util=require(_0x2d4b('0x0'));var moment=require(_0x2d4b('0x1'));var BPromise=require(_0x2d4b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2d4b('0x3'));var config=require(_0x2d4b('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x2d4b('0x5')][_0x2d4b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x34004c,_0x1075de,_0x2e0af0){return new BPromise(function(_0x41ca3d,_0x47bfb6){return client[_0x2d4b('0x7')](_0x34004c,_0x2e0af0)[_0x2d4b('0x8')](function(_0x1aa682){logger[_0x2d4b('0x9')](_0x2d4b('0xa'),_0x1075de,_0x2d4b('0xb'));logger['debug'](_0x2d4b('0xc'),_0x1075de,_0x2d4b('0xb'),JSON[_0x2d4b('0xd')](_0x1aa682));if(_0x1aa682['error']){if(_0x1aa682['error'][_0x2d4b('0xe')]===0x1f4){logger['error'](_0x2d4b('0xa'),_0x1075de,_0x1aa682[_0x2d4b('0xf')][_0x2d4b('0x10')]);return _0x47bfb6(_0x1aa682['error']['message']);}logger[_0x2d4b('0xf')]('Dynamics365Account,\x20%s,\x20%s',_0x1075de,_0x1aa682['error'][_0x2d4b('0x10')]);return _0x41ca3d(_0x1aa682['error'][_0x2d4b('0x10')]);}else{logger['info'](_0x2d4b('0xa'),_0x1075de,'request\x20sent');_0x41ca3d(_0x1aa682[_0x2d4b('0x11')][_0x2d4b('0x10')]);}})[_0x2d4b('0x12')](function(_0x401726){logger[_0x2d4b('0xf')](_0x2d4b('0xa'),_0x1075de,_0x401726);_0x47bfb6(_0x401726);});});}exports[_0x2d4b('0x13')]=function(_0x5833eb){var _0xc5cee6=this;return new Promise(function(_0x34881c,_0x135f78){return db['Dynamics365Account']['findAll']({'raw':_0x5833eb[_0x2d4b('0x14')]?_0x5833eb[_0x2d4b('0x14')][_0x2d4b('0x15')]===undefined?!![]:![]:!![],'where':_0x5833eb[_0x2d4b('0x14')]?_0x5833eb[_0x2d4b('0x14')][_0x2d4b('0x16')]||null:null,'attributes':_0x5833eb[_0x2d4b('0x14')]?_0x5833eb[_0x2d4b('0x14')][_0x2d4b('0x17')]||null:null,'limit':_0x5833eb[_0x2d4b('0x14')]?_0x5833eb[_0x2d4b('0x14')][_0x2d4b('0x18')]||null:null,'include':_0x5833eb[_0x2d4b('0x14')]?_0x5833eb['options'][_0x2d4b('0x19')]?_['map'](_0x5833eb[_0x2d4b('0x14')][_0x2d4b('0x19')],function(_0x5ab120){return{'model':db[_0x5ab120[_0x2d4b('0x1a')]],'as':_0x5ab120['as'],'attributes':_0x5ab120[_0x2d4b('0x17')],'include':_0x5ab120[_0x2d4b('0x19')]?_[_0x2d4b('0x1b')](_0x5ab120[_0x2d4b('0x19')],function(_0x52ccbf){return{'model':db[_0x52ccbf[_0x2d4b('0x1a')]],'as':_0x52ccbf['as'],'attributes':_0x52ccbf[_0x2d4b('0x17')],'include':_0x52ccbf[_0x2d4b('0x19')]?_['map'](_0x52ccbf[_0x2d4b('0x19')],function(_0x5266a4){return{'model':db[_0x5266a4[_0x2d4b('0x1a')]],'as':_0x5266a4['as'],'attributes':_0x5266a4[_0x2d4b('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x25e375){logger['info'](_0x2d4b('0x13'),_0x5833eb);logger[_0x2d4b('0x1c')]('GetDynamics365Account',_0x5833eb,JSON[_0x2d4b('0xd')](_0x25e375));_0x34881c(_0x25e375);})[_0x2d4b('0x12')](function(_0x25476a){logger[_0x2d4b('0xf')]('GetDynamics365Account',_0x25476a[_0x2d4b('0x10')],_0x5833eb);_0x135f78(_0xc5cee6[_0x2d4b('0xf')](0x1f4,_0x25476a[_0x2d4b('0x10')]));});});};exports[_0x2d4b('0x1d')]=function(_0x272858){var _0x2835f3=this;return new Promise(function(_0x1c0dca,_0x2d21f2){return db[_0x2d4b('0x1e')][_0x2d4b('0x1f')]({'raw':_0x272858[_0x2d4b('0x14')]?_0x272858[_0x2d4b('0x14')][_0x2d4b('0x15')]===undefined?!![]:![]:!![],'where':_0x272858['options']?_0x272858[_0x2d4b('0x14')]['where']||null:null,'attributes':_0x272858[_0x2d4b('0x14')]?_0x272858['options'][_0x2d4b('0x17')]||null:null,'include':_0x272858['options']?_0x272858['options'][_0x2d4b('0x19')]?_[_0x2d4b('0x1b')](_0x272858[_0x2d4b('0x14')]['include'],function(_0x5d4ee5){return{'model':db[_0x5d4ee5['model']],'as':_0x5d4ee5['as'],'attributes':_0x5d4ee5[_0x2d4b('0x17')],'include':_0x5d4ee5[_0x2d4b('0x19')]?_['map'](_0x5d4ee5['include'],function(_0x282421){return{'model':db[_0x282421[_0x2d4b('0x1a')]],'as':_0x282421['as'],'attributes':_0x282421['attributes'],'include':_0x282421['include']?_[_0x2d4b('0x1b')](_0x282421[_0x2d4b('0x19')],function(_0xb1607f){return{'model':db[_0xb1607f['model']],'as':_0xb1607f['as'],'attributes':_0xb1607f['attributes']};}):[]};}):[]};}):[]:[]})[_0x2d4b('0x8')](function(_0x3171dc){logger[_0x2d4b('0x9')](_0x2d4b('0x1d'),_0x272858);logger[_0x2d4b('0x1c')]('ShowDynamics365Account',_0x272858,JSON['stringify'](_0x3171dc));_0x1c0dca(_0x3171dc);})[_0x2d4b('0x12')](function(_0x56f188){logger[_0x2d4b('0xf')](_0x2d4b('0x1d'),_0x56f188[_0x2d4b('0x10')],_0x272858);_0x2d21f2(_0x2835f3['error'](0x1f4,_0x56f188[_0x2d4b('0x10')]));});});};
\ No newline at end of file
index fbd40ab..9d0a4d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f97=['../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','index','get','/:id','isAuthenticated','/:id/fields','getFields','/:id/descriptions','getDescriptions','post','create','put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3bb701,_0x446fea){var _0x1dfd05=function(_0x3e3f60){while(--_0x3e3f60){_0x3bb701['push'](_0x3bb701['shift']());}};_0x1dfd05(++_0x446fea);}(_0x0f97,0x196));var _0x70f9=function(_0x5e9a69,_0x40c0ec){_0x5e9a69=_0x5e9a69-0x0;var _0x5979c8=_0x0f97[_0x5e9a69];return _0x5979c8;};'use strict';var multer=require(_0x70f9('0x0'));var util=require(_0x70f9('0x1'));var path=require(_0x70f9('0x2'));var timeout=require(_0x70f9('0x3'));var express=require(_0x70f9('0x4'));var router=express[_0x70f9('0x5')]();var fs_extra=require(_0x70f9('0x6'));var auth=require(_0x70f9('0x7'));var interaction=require(_0x70f9('0x8'));var config=require(_0x70f9('0x9'));var controller=require(_0x70f9('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x70f9('0xb')]);router[_0x70f9('0xc')](_0x70f9('0xd'),auth[_0x70f9('0xe')](),controller['show']);router['get'](_0x70f9('0xf'),auth[_0x70f9('0xe')](),controller[_0x70f9('0x10')]);router[_0x70f9('0xc')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0x70f9('0x11'),auth[_0x70f9('0xe')](),controller[_0x70f9('0x12')]);router[_0x70f9('0x13')]('/',auth['isAuthenticated'](),controller[_0x70f9('0x14')]);router[_0x70f9('0x15')](_0x70f9('0xd'),auth[_0x70f9('0xe')](),controller[_0x70f9('0x16')]);router['delete'](_0x70f9('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x3eae=['fs-extra','../../components/auth/service','./intDynamics365Configuration.controller','get','index','isAuthenticated','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','Router'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x3eae,0x66));var _0xe3ea=function(_0xb65e77,_0x238c3d){_0xb65e77=_0xb65e77-0x0;var _0x38134b=_0x3eae[_0xb65e77];return _0x38134b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe3ea('0x0'));var timeout=require(_0xe3ea('0x1'));var express=require('express');var router=express[_0xe3ea('0x2')]();var fs_extra=require(_0xe3ea('0x3'));var auth=require(_0xe3ea('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe3ea('0x5'));router[_0xe3ea('0x6')]('/',auth['isAuthenticated'](),controller[_0xe3ea('0x7')]);router[_0xe3ea('0x6')]('/:id',auth[_0xe3ea('0x8')](),controller['show']);router[_0xe3ea('0x6')](_0xe3ea('0x9'),auth[_0xe3ea('0x8')](),controller['getFields']);router[_0xe3ea('0x6')](_0xe3ea('0xa'),auth[_0xe3ea('0x8')](),controller[_0xe3ea('0xb')]);router[_0xe3ea('0x6')](_0xe3ea('0xc'),auth[_0xe3ea('0x8')](),controller[_0xe3ea('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe3ea('0xe')]);router[_0xe3ea('0xf')](_0xe3ea('0x10'),auth[_0xe3ea('0x8')](),controller[_0xe3ea('0x11')]);router[_0xe3ea('0x12')](_0xe3ea('0x10'),auth[_0xe3ea('0x8')](),controller[_0xe3ea('0x13')]);module[_0xe3ea('0x14')]=router;
\ No newline at end of file
index 4594e77..53cc5d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95d0=['ENUM','incident','phonecall','contact','nothing','BOOLEAN','sequelize','exports','STRING'];(function(_0x34cbc8,_0x4f6d6a){var _0x5c82b0=function(_0x98d1b2){while(--_0x98d1b2){_0x34cbc8['push'](_0x34cbc8['shift']());}};_0x5c82b0(++_0x4f6d6a);}(_0x95d0,0x69));var _0x095d=function(_0x1c3e7f,_0x161b03){_0x1c3e7f=_0x1c3e7f-0x0;var _0x2f7c3c=_0x95d0[_0x1c3e7f];return _0x2f7c3c;};'use strict';var Sequelize=require(_0x095d('0x0'));module[_0x095d('0x1')]={'name':{'type':Sequelize[_0x095d('0x2')]},'description':{'type':Sequelize[_0x095d('0x2')]},'ticketType':{'type':Sequelize[_0x095d('0x3')](_0x095d('0x4'),_0x095d('0x5')),'defaultValue':_0x095d('0x4')},'moduleCreate':{'type':Sequelize[_0x095d('0x3')](_0x095d('0x6'),_0x095d('0x7')),'defaultValue':_0x095d('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x095d('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x095d('0x8')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x9a29=['STRING','incident','phonecall','ENUM','contact','exports'];(function(_0x4cdc7c,_0x522a62){var _0x54d7f6=function(_0x243ee8){while(--_0x243ee8){_0x4cdc7c['push'](_0x4cdc7c['shift']());}};_0x54d7f6(++_0x522a62);}(_0x9a29,0x191));var _0x99a2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9a29[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0x99a2('0x0')]={'name':{'type':Sequelize[_0x99a2('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0x99a2('0x2'),_0x99a2('0x3')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x99a2('0x4')](_0x99a2('0x5'),'nothing'),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x99a2('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index 8f424a3..e9d0fb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63fb=['bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','count','set','reject','save','update','then','sendStatus','error','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','fields','find','catch','create','body','destroy','Dynamics365Field','getFields','hasOwnProperty','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x12c263,_0x2d9bce){var _0x192cd7=function(_0x3a1fc0){while(--_0x3a1fc0){_0x12c263['push'](_0x12c263['shift']());}};_0x192cd7(++_0x2d9bce);}(_0x63fb,0x1f3));var _0xb63f=function(_0x1b5fff,_0x4a7dad){_0x1b5fff=_0x1b5fff-0x0;var _0x31cc64=_0x63fb[_0x1b5fff];return _0x31cc64;};'use strict';var emlformat=require(_0xb63f('0x0'));var rimraf=require(_0xb63f('0x1'));var zipdir=require(_0xb63f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb63f('0x3'));var moment=require(_0xb63f('0x4'));var BPromise=require(_0xb63f('0x5'));var Mustache=require(_0xb63f('0x6'));var util=require(_0xb63f('0x7'));var path=require(_0xb63f('0x8'));var sox=require('sox');var csv=require(_0xb63f('0x9'));var ejs=require(_0xb63f('0xa'));var fs=require('fs');var fs_extra=require(_0xb63f('0xb'));var _=require(_0xb63f('0xc'));var squel=require(_0xb63f('0xd'));var crypto=require(_0xb63f('0xe'));var jsforce=require(_0xb63f('0xf'));var deskjs=require(_0xb63f('0x10'));var toCsv=require(_0xb63f('0x9'));var querystring=require('querystring');var Papa=require(_0xb63f('0x11'));var Redis=require(_0xb63f('0x12'));var authService=require(_0xb63f('0x13'));var qs=require(_0xb63f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb63f('0x15'));var logger=require(_0xb63f('0x16'))(_0xb63f('0x17'));var utils=require(_0xb63f('0x18'));var config=require(_0xb63f('0x19'));var licenseUtil=require(_0xb63f('0x1a'));var db=require(_0xb63f('0x1b'))['db'];function respondWithStatusCode(_0x26ab69,_0x4f081e){_0x4f081e=_0x4f081e||0xcc;return function(_0x4f3a8e){if(_0x4f3a8e){return _0x26ab69['sendStatus'](_0x4f081e);}return _0x26ab69[_0xb63f('0x1c')](_0x4f081e)[_0xb63f('0x1d')]();};}function respondWithResult(_0x59f7cc,_0x759689){_0x759689=_0x759689||0xc8;return function(_0x2db81f){if(_0x2db81f){return _0x59f7cc['status'](_0x759689)['json'](_0x2db81f);}};}function respondWithFilteredResult(_0x28a11d,_0x5c375f){return function(_0x7a0537){if(_0x7a0537){var _0x28f096=typeof _0x5c375f[_0xb63f('0x1e')]==='undefined'&&typeof _0x5c375f[_0xb63f('0x1f')]==='undefined';var _0x50c123=_0x7a0537[_0xb63f('0x20')];var _0x56c274=_0x28f096?0x0:_0x5c375f[_0xb63f('0x1e')];var _0x520aca=_0x28f096?_0x7a0537[_0xb63f('0x20')]:_0x5c375f[_0xb63f('0x1e')]+_0x5c375f[_0xb63f('0x1f')];var _0x19c018;if(_0x520aca>=_0x50c123){_0x520aca=_0x50c123;_0x19c018=0xc8;}else{_0x19c018=0xce;}_0x28a11d[_0xb63f('0x1c')](_0x19c018);return _0x28a11d[_0xb63f('0x21')]('Content-Range',_0x56c274+'-'+_0x520aca+'/'+_0x50c123)['json'](_0x7a0537);}return null;};}function patchUpdates(_0x95d4a0){return function(_0x1b598a){try{jsonpatch['apply'](_0x1b598a,_0x95d4a0,!![]);}catch(_0x505bab){return BPromise[_0xb63f('0x22')](_0x505bab);}return _0x1b598a[_0xb63f('0x23')]();};}function saveUpdates(_0x10848e,_0x13b799){return function(_0x3f44c7){if(_0x3f44c7){return _0x3f44c7[_0xb63f('0x24')](_0x10848e)[_0xb63f('0x25')](function(_0x4d6a1a){return _0x4d6a1a;});}return null;};}function removeEntity(_0x18bf0c,_0x1bf901){return function(_0x1ca579){if(_0x1ca579){return _0x1ca579['destroy']()['then'](function(){_0x18bf0c[_0xb63f('0x1c')](0xcc)[_0xb63f('0x1d')]();});}};}function handleEntityNotFound(_0x163435,_0x2198a9){return function(_0x11c91f){if(!_0x11c91f){_0x163435[_0xb63f('0x26')](0x194);}return _0x11c91f;};}function handleError(_0x1d451e,_0x307ae1){_0x307ae1=_0x307ae1||0x1f4;return function(_0x2514c7){logger[_0xb63f('0x27')](_0x2514c7[_0xb63f('0x28')]);if(_0x2514c7[_0xb63f('0x29')]){delete _0x2514c7[_0xb63f('0x29')];}_0x1d451e['status'](_0x307ae1)[_0xb63f('0x2a')](_0x2514c7);};}exports[_0xb63f('0x2b')]=function(_0x3d15e5,_0x4c182d){var _0x421d93={},_0xa8f65e={},_0x428df2={'count':0x0,'rows':[]};var _0x41e961=_[_0xb63f('0x2c')](db[_0xb63f('0x2d')][_0xb63f('0x2e')],function(_0xa16f4c){return{'name':_0xa16f4c[_0xb63f('0x2f')],'type':_0xa16f4c[_0xb63f('0x30')][_0xb63f('0x31')]};});_0xa8f65e[_0xb63f('0x32')]=_[_0xb63f('0x2c')](_0x41e961,_0xb63f('0x29'));_0xa8f65e['query']=_[_0xb63f('0x33')](_0x3d15e5['query']);_0xa8f65e[_0xb63f('0x34')]=_[_0xb63f('0x35')](_0xa8f65e['model'],_0xa8f65e[_0xb63f('0x36')]);_0x421d93[_0xb63f('0x37')]=_[_0xb63f('0x35')](_0xa8f65e['model'],qs['fields'](_0x3d15e5[_0xb63f('0x36')]['fields']));_0x421d93['attributes']=_0x421d93[_0xb63f('0x37')][_0xb63f('0x38')]?_0x421d93['attributes']:_0xa8f65e[_0xb63f('0x32')];if(!_0x3d15e5[_0xb63f('0x36')]['hasOwnProperty'](_0xb63f('0x39'))){_0x421d93[_0xb63f('0x1f')]=qs[_0xb63f('0x1f')](_0x3d15e5['query'][_0xb63f('0x1f')]);_0x421d93[_0xb63f('0x1e')]=qs[_0xb63f('0x1e')](_0x3d15e5[_0xb63f('0x36')]['offset']);}_0x421d93[_0xb63f('0x3a')]=qs['sort'](_0x3d15e5[_0xb63f('0x36')][_0xb63f('0x3b')]);_0x421d93[_0xb63f('0x3c')]=qs['filters'](_[_0xb63f('0x3d')](_0x3d15e5[_0xb63f('0x36')],_0xa8f65e[_0xb63f('0x34')]),_0x41e961);if(_0x3d15e5['query'][_0xb63f('0x3e')]){_0x421d93['where']=_[_0xb63f('0x3f')](_0x421d93[_0xb63f('0x3c')],{'$or':_[_0xb63f('0x2c')](_0x41e961,function(_0x364a3e){if(_0x364a3e['type']!==_0xb63f('0x40')){var _0x397713={};_0x397713[_0x364a3e[_0xb63f('0x29')]]={'$like':'%'+_0x3d15e5[_0xb63f('0x36')][_0xb63f('0x3e')]+'%'};return _0x397713;}})});}_0x421d93=_[_0xb63f('0x3f')]({},_0x421d93,_0x3d15e5[_0xb63f('0x41')]);var _0x1ba9f2={'where':_0x421d93['where']};return db[_0xb63f('0x2d')]['count'](_0x1ba9f2)[_0xb63f('0x25')](function(_0x40e2df){_0x428df2[_0xb63f('0x20')]=_0x40e2df;if(_0x3d15e5['query'][_0xb63f('0x42')]){_0x421d93[_0xb63f('0x43')]=[{'all':!![]}];}return db[_0xb63f('0x2d')][_0xb63f('0x44')](_0x421d93);})[_0xb63f('0x25')](function(_0x5a18a9){_0x428df2[_0xb63f('0x45')]=_0x5a18a9;return _0x428df2;})[_0xb63f('0x25')](respondWithFilteredResult(_0x4c182d,_0x421d93))['catch'](handleError(_0x4c182d,null));};exports[_0xb63f('0x46')]=function(_0x20c3d3,_0x3792d0){var _0x40f8e7={'raw':![],'where':{'id':_0x20c3d3[_0xb63f('0x47')]['id']}},_0x351bee={};_0x351bee[_0xb63f('0x32')]=_['keys'](db[_0xb63f('0x2d')][_0xb63f('0x2e')]);_0x351bee['query']=_[_0xb63f('0x33')](_0x20c3d3['query']);_0x351bee[_0xb63f('0x34')]=_['intersection'](_0x351bee[_0xb63f('0x32')],_0x351bee[_0xb63f('0x36')]);_0x40f8e7[_0xb63f('0x37')]=_[_0xb63f('0x35')](_0x351bee[_0xb63f('0x32')],qs[_0xb63f('0x48')](_0x20c3d3[_0xb63f('0x36')][_0xb63f('0x48')]));_0x40f8e7['attributes']=_0x40f8e7['attributes'][_0xb63f('0x38')]?_0x40f8e7[_0xb63f('0x37')]:_0x351bee[_0xb63f('0x32')];if(_0x20c3d3['query'][_0xb63f('0x42')]){_0x40f8e7['include']=[{'all':!![]}];}_0x40f8e7=_['merge']({},_0x40f8e7,_0x20c3d3[_0xb63f('0x41')]);return db[_0xb63f('0x2d')][_0xb63f('0x49')](_0x40f8e7)['then'](handleEntityNotFound(_0x3792d0,null))['then'](respondWithResult(_0x3792d0,null))[_0xb63f('0x4a')](handleError(_0x3792d0,null));};exports[_0xb63f('0x4b')]=function(_0x4f548b,_0x5afe93){return db[_0xb63f('0x2d')][_0xb63f('0x4b')](_0x4f548b[_0xb63f('0x4c')],{})['then'](respondWithResult(_0x5afe93,0xc9))[_0xb63f('0x4a')](handleError(_0x5afe93,null));};exports[_0xb63f('0x24')]=function(_0x59ab2a,_0x235362){if(_0x59ab2a[_0xb63f('0x4c')]['id']){delete _0x59ab2a[_0xb63f('0x4c')]['id'];}return db['Dynamics365Configuration'][_0xb63f('0x49')]({'where':{'id':_0x59ab2a[_0xb63f('0x47')]['id']}})[_0xb63f('0x25')](handleEntityNotFound(_0x235362,null))[_0xb63f('0x25')](saveUpdates(_0x59ab2a[_0xb63f('0x4c')],null))[_0xb63f('0x25')](respondWithResult(_0x235362,null))[_0xb63f('0x4a')](handleError(_0x235362,null));};exports[_0xb63f('0x4d')]=function(_0xa7390a,_0xcd4022){return db[_0xb63f('0x2d')][_0xb63f('0x49')]({'where':{'id':_0xa7390a['params']['id']}})['then'](handleEntityNotFound(_0xcd4022,null))[_0xb63f('0x25')](removeEntity(_0xcd4022,null))[_0xb63f('0x4a')](handleError(_0xcd4022,null));};exports['getFields']=function(_0x19ba58,_0x4c0a57,_0x2ec108){var _0x304cd7={};var _0x432916={};var _0x4d7b11;var _0x1465d0;return db[_0xb63f('0x2d')]['findOne']({'where':{'id':_0x19ba58[_0xb63f('0x47')]['id']}})[_0xb63f('0x25')](handleEntityNotFound(_0x4c0a57,null))[_0xb63f('0x25')](function(_0x1aafc5){if(_0x1aafc5){_0x4d7b11=_0x1aafc5;_0x432916['model']=_[_0xb63f('0x33')](db[_0xb63f('0x4e')]['rawAttributes']);_0x432916[_0xb63f('0x36')]=_['keys'](_0x19ba58[_0xb63f('0x36')]);_0x432916['filters']=_[_0xb63f('0x35')](_0x432916[_0xb63f('0x32')],_0x432916[_0xb63f('0x36')]);_0x304cd7[_0xb63f('0x37')]=_[_0xb63f('0x35')](_0x432916['model'],qs['fields'](_0x19ba58['query'][_0xb63f('0x48')]));_0x304cd7[_0xb63f('0x37')]=_0x304cd7[_0xb63f('0x37')]['length']?_0x304cd7['attributes']:_0x432916[_0xb63f('0x32')];_0x304cd7[_0xb63f('0x3a')]=qs[_0xb63f('0x3b')](_0x19ba58[_0xb63f('0x36')]['sort']);_0x304cd7[_0xb63f('0x3c')]=qs[_0xb63f('0x34')](_['pick'](_0x19ba58[_0xb63f('0x36')],_0x432916[_0xb63f('0x34')]));if(_0x19ba58['query'][_0xb63f('0x3e')]){_0x304cd7[_0xb63f('0x3c')]=_['merge'](_0x304cd7[_0xb63f('0x3c')],{'$or':_['map'](_0x304cd7[_0xb63f('0x37')],function(_0x2a30b1){var _0x5ddeb5={};_0x5ddeb5[_0x2a30b1]={'$like':'%'+_0x19ba58[_0xb63f('0x36')][_0xb63f('0x3e')]+'%'};return _0x5ddeb5;})});}_0x304cd7=_[_0xb63f('0x3f')]({},_0x304cd7,_0x19ba58['options']);return _0x4d7b11[_0xb63f('0x4f')](_0x304cd7);}})['then'](function(_0x2f5ed9){if(_0x2f5ed9){_0x1465d0=_0x2f5ed9[_0xb63f('0x38')];if(!_0x19ba58[_0xb63f('0x36')][_0xb63f('0x50')]('nolimit')){_0x304cd7[_0xb63f('0x1f')]=qs[_0xb63f('0x1f')](_0x19ba58[_0xb63f('0x36')][_0xb63f('0x1f')]);_0x304cd7[_0xb63f('0x1e')]=qs[_0xb63f('0x1e')](_0x19ba58['query'][_0xb63f('0x1e')]);}return _0x4d7b11[_0xb63f('0x4f')](_0x304cd7);}})[_0xb63f('0x25')](function(_0x37e61b){if(_0x37e61b){return _0x37e61b?{'count':_0x1465d0,'rows':_0x37e61b}:null;}})['then'](respondWithResult(_0x4c0a57,null))['catch'](handleError(_0x4c0a57,null));};exports[_0xb63f('0x51')]=function(_0x44bac2,_0x1ca8f4,_0xdddf67){var _0x4d827b={};var _0x5d1278={};var _0x142667;var _0x977526;return db['Dynamics365Configuration'][_0xb63f('0x52')]({'where':{'id':_0x44bac2['params']['id']}})['then'](handleEntityNotFound(_0x1ca8f4,null))[_0xb63f('0x25')](function(_0x49cdea){if(_0x49cdea){_0x142667=_0x49cdea;_0x5d1278[_0xb63f('0x32')]=_[_0xb63f('0x33')](db['Dynamics365Field'][_0xb63f('0x2e')]);_0x5d1278[_0xb63f('0x36')]=_[_0xb63f('0x33')](_0x44bac2[_0xb63f('0x36')]);_0x5d1278[_0xb63f('0x34')]=_[_0xb63f('0x35')](_0x5d1278[_0xb63f('0x32')],_0x5d1278['query']);_0x4d827b['attributes']=_['intersection'](_0x5d1278['model'],qs[_0xb63f('0x48')](_0x44bac2[_0xb63f('0x36')][_0xb63f('0x48')]));_0x4d827b['attributes']=_0x4d827b[_0xb63f('0x37')]['length']?_0x4d827b['attributes']:_0x5d1278[_0xb63f('0x32')];_0x4d827b[_0xb63f('0x3a')]=qs[_0xb63f('0x3b')](_0x44bac2[_0xb63f('0x36')][_0xb63f('0x3b')]);_0x4d827b[_0xb63f('0x3c')]=qs[_0xb63f('0x34')](_[_0xb63f('0x3d')](_0x44bac2[_0xb63f('0x36')],_0x5d1278['filters']));if(_0x44bac2[_0xb63f('0x36')][_0xb63f('0x3e')]){_0x4d827b[_0xb63f('0x3c')]=_['merge'](_0x4d827b[_0xb63f('0x3c')],{'$or':_[_0xb63f('0x2c')](_0x4d827b[_0xb63f('0x37')],function(_0x28e0db){var _0x46d7c5={};_0x46d7c5[_0x28e0db]={'$like':'%'+_0x44bac2[_0xb63f('0x36')][_0xb63f('0x3e')]+'%'};return _0x46d7c5;})});}_0x4d827b=_[_0xb63f('0x3f')]({},_0x4d827b,_0x44bac2['options']);return _0x142667['getSubjects'](_0x4d827b);}})[_0xb63f('0x25')](function(_0x4bf97e){if(_0x4bf97e){_0x977526=_0x4bf97e[_0xb63f('0x38')];if(!_0x44bac2[_0xb63f('0x36')][_0xb63f('0x50')]('nolimit')){_0x4d827b[_0xb63f('0x1f')]=qs[_0xb63f('0x1f')](_0x44bac2['query'][_0xb63f('0x1f')]);_0x4d827b[_0xb63f('0x1e')]=qs[_0xb63f('0x1e')](_0x44bac2[_0xb63f('0x36')][_0xb63f('0x1e')]);}return _0x142667[_0xb63f('0x51')](_0x4d827b);}})[_0xb63f('0x25')](function(_0x3268d7){if(_0x3268d7){return _0x3268d7?{'count':_0x977526,'rows':_0x3268d7}:null;}})[_0xb63f('0x25')](respondWithResult(_0x1ca8f4,null))[_0xb63f('0x4a')](handleError(_0x1ca8f4,null));};exports[_0xb63f('0x53')]=function(_0x2a9864,_0x517133,_0x1c0f7c){var _0x8a0ab0={};var _0xb1b0ef={};var _0x58b9ea;var _0x4c93f8;return db[_0xb63f('0x2d')]['findOne']({'where':{'id':_0x2a9864[_0xb63f('0x47')]['id']}})[_0xb63f('0x25')](handleEntityNotFound(_0x517133,null))[_0xb63f('0x25')](function(_0x46c20f){if(_0x46c20f){_0x58b9ea=_0x46c20f;_0xb1b0ef['model']=_[_0xb63f('0x33')](db['Dynamics365Field'][_0xb63f('0x2e')]);_0xb1b0ef[_0xb63f('0x36')]=_[_0xb63f('0x33')](_0x2a9864[_0xb63f('0x36')]);_0xb1b0ef[_0xb63f('0x34')]=_[_0xb63f('0x35')](_0xb1b0ef['model'],_0xb1b0ef['query']);_0x8a0ab0['attributes']=_[_0xb63f('0x35')](_0xb1b0ef['model'],qs[_0xb63f('0x48')](_0x2a9864[_0xb63f('0x36')][_0xb63f('0x48')]));_0x8a0ab0[_0xb63f('0x37')]=_0x8a0ab0[_0xb63f('0x37')][_0xb63f('0x38')]?_0x8a0ab0['attributes']:_0xb1b0ef[_0xb63f('0x32')];_0x8a0ab0['order']=qs[_0xb63f('0x3b')](_0x2a9864[_0xb63f('0x36')]['sort']);_0x8a0ab0[_0xb63f('0x3c')]=qs['filters'](_[_0xb63f('0x3d')](_0x2a9864[_0xb63f('0x36')],_0xb1b0ef['filters']));if(_0x2a9864[_0xb63f('0x36')][_0xb63f('0x3e')]){_0x8a0ab0[_0xb63f('0x3c')]=_['merge'](_0x8a0ab0[_0xb63f('0x3c')],{'$or':_[_0xb63f('0x2c')](_0x8a0ab0[_0xb63f('0x37')],function(_0x512341){var _0x4d5842={};_0x4d5842[_0x512341]={'$like':'%'+_0x2a9864[_0xb63f('0x36')]['filter']+'%'};return _0x4d5842;})});}_0x8a0ab0=_[_0xb63f('0x3f')]({},_0x8a0ab0,_0x2a9864[_0xb63f('0x41')]);return _0x58b9ea[_0xb63f('0x53')](_0x8a0ab0);}})[_0xb63f('0x25')](function(_0xfe8f3b){if(_0xfe8f3b){_0x4c93f8=_0xfe8f3b[_0xb63f('0x38')];if(!_0x2a9864['query']['hasOwnProperty']('nolimit')){_0x8a0ab0[_0xb63f('0x1f')]=qs[_0xb63f('0x1f')](_0x2a9864[_0xb63f('0x36')][_0xb63f('0x1f')]);_0x8a0ab0[_0xb63f('0x1e')]=qs[_0xb63f('0x1e')](_0x2a9864[_0xb63f('0x36')][_0xb63f('0x1e')]);}return _0x58b9ea[_0xb63f('0x53')](_0x8a0ab0);}})['then'](function(_0x58d8db){if(_0x58d8db){return _0x58d8db?{'count':_0x4c93f8,'rows':_0x58d8db}:null;}})[_0xb63f('0x25')](respondWithResult(_0x517133,null))['catch'](handleError(_0x517133,null));};
\ No newline at end of file
+var _0x48c5=['Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','rows','catch','show','params','includeAll','create','body','find','destroy','getFields','findOne','Dynamics365Field','hasOwnProperty','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','index','map'];(function(_0x4394b6,_0x12357f){var _0x360244=function(_0x5689a1){while(--_0x5689a1){_0x4394b6['push'](_0x4394b6['shift']());}};_0x360244(++_0x12357f);}(_0x48c5,0x7a));var _0x548c=function(_0x30ffad,_0x18c084){_0x30ffad=_0x30ffad-0x0;var _0xec3ef4=_0x48c5[_0x30ffad];return _0xec3ef4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x548c('0x0'));var zipdir=require(_0x548c('0x1'));var jsonpatch=require(_0x548c('0x2'));var rp=require(_0x548c('0x3'));var moment=require(_0x548c('0x4'));var BPromise=require(_0x548c('0x5'));var Mustache=require(_0x548c('0x6'));var util=require(_0x548c('0x7'));var path=require(_0x548c('0x8'));var sox=require(_0x548c('0x9'));var csv=require(_0x548c('0xa'));var ejs=require(_0x548c('0xb'));var fs=require('fs');var fs_extra=require(_0x548c('0xc'));var _=require(_0x548c('0xd'));var squel=require(_0x548c('0xe'));var crypto=require(_0x548c('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x548c('0x10'));var toCsv=require(_0x548c('0xa'));var querystring=require(_0x548c('0x11'));var Papa=require(_0x548c('0x12'));var Redis=require(_0x548c('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x548c('0x14'));var as=require(_0x548c('0x15'));var hardwareService=require(_0x548c('0x16'));var logger=require('../../config/logger')(_0x548c('0x17'));var utils=require(_0x548c('0x18'));var config=require(_0x548c('0x19'));var licenseUtil=require(_0x548c('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c1149,_0x2e8859){_0x2e8859=_0x2e8859||0xcc;return function(_0xaf0f50){if(_0xaf0f50){return _0x5c1149['sendStatus'](_0x2e8859);}return _0x5c1149[_0x548c('0x1b')](_0x2e8859)[_0x548c('0x1c')]();};}function respondWithResult(_0x255bd7,_0x599f2f){_0x599f2f=_0x599f2f||0xc8;return function(_0x35696e){if(_0x35696e){return _0x255bd7[_0x548c('0x1b')](_0x599f2f)[_0x548c('0x1d')](_0x35696e);}};}function respondWithFilteredResult(_0x27828a,_0x5b2c03){return function(_0x17d274){if(_0x17d274){var _0x5ba927=typeof _0x5b2c03[_0x548c('0x1e')]==='undefined'&&typeof _0x5b2c03[_0x548c('0x1f')]===_0x548c('0x20');var _0x5c79d6=_0x17d274[_0x548c('0x21')];var _0x179b44=_0x5ba927?0x0:_0x5b2c03[_0x548c('0x1e')];var _0x895531=_0x5ba927?_0x17d274[_0x548c('0x21')]:_0x5b2c03['offset']+_0x5b2c03['limit'];var _0x53d631;if(_0x895531>=_0x5c79d6){_0x895531=_0x5c79d6;_0x53d631=0xc8;}else{_0x53d631=0xce;}_0x27828a[_0x548c('0x1b')](_0x53d631);return _0x27828a[_0x548c('0x22')](_0x548c('0x23'),_0x179b44+'-'+_0x895531+'/'+_0x5c79d6)[_0x548c('0x1d')](_0x17d274);}return null;};}function patchUpdates(_0x2239fc){return function(_0x4b88e5){try{jsonpatch[_0x548c('0x24')](_0x4b88e5,_0x2239fc,!![]);}catch(_0x31bc8a){return BPromise[_0x548c('0x25')](_0x31bc8a);}return _0x4b88e5['save']();};}function saveUpdates(_0x1e1001,_0x5f32d6){return function(_0x46edeb){if(_0x46edeb){return _0x46edeb[_0x548c('0x26')](_0x1e1001)[_0x548c('0x27')](function(_0x599218){return _0x599218;});}return null;};}function removeEntity(_0x56d67b,_0x13057c){return function(_0x3bc7da){if(_0x3bc7da){return _0x3bc7da['destroy']()['then'](function(){_0x56d67b[_0x548c('0x1b')](0xcc)[_0x548c('0x1c')]();});}};}function handleEntityNotFound(_0x32d212,_0x44a958){return function(_0x1aaa0c){if(!_0x1aaa0c){_0x32d212[_0x548c('0x28')](0x194);}return _0x1aaa0c;};}function handleError(_0x5444a6,_0x2dd756){_0x2dd756=_0x2dd756||0x1f4;return function(_0x492672){logger[_0x548c('0x29')](_0x492672[_0x548c('0x2a')]);if(_0x492672[_0x548c('0x2b')]){delete _0x492672[_0x548c('0x2b')];}_0x5444a6['status'](_0x2dd756)['send'](_0x492672);};}exports[_0x548c('0x2c')]=function(_0x32df3c,_0x1d5abb){var _0x139205={},_0x1883fa={},_0x2bf84b={'count':0x0,'rows':[]};var _0x2f9b8d=_[_0x548c('0x2d')](db[_0x548c('0x2e')][_0x548c('0x2f')],function(_0x253828){return{'name':_0x253828[_0x548c('0x30')],'type':_0x253828[_0x548c('0x31')][_0x548c('0x32')]};});_0x1883fa[_0x548c('0x33')]=_[_0x548c('0x2d')](_0x2f9b8d,'name');_0x1883fa[_0x548c('0x34')]=_[_0x548c('0x35')](_0x32df3c['query']);_0x1883fa[_0x548c('0x36')]=_[_0x548c('0x37')](_0x1883fa[_0x548c('0x33')],_0x1883fa[_0x548c('0x34')]);_0x139205[_0x548c('0x38')]=_[_0x548c('0x37')](_0x1883fa[_0x548c('0x33')],qs['fields'](_0x32df3c['query'][_0x548c('0x39')]));_0x139205['attributes']=_0x139205[_0x548c('0x38')][_0x548c('0x3a')]?_0x139205[_0x548c('0x38')]:_0x1883fa[_0x548c('0x33')];if(!_0x32df3c[_0x548c('0x34')]['hasOwnProperty'](_0x548c('0x3b'))){_0x139205[_0x548c('0x1f')]=qs['limit'](_0x32df3c[_0x548c('0x34')][_0x548c('0x1f')]);_0x139205['offset']=qs[_0x548c('0x1e')](_0x32df3c['query'][_0x548c('0x1e')]);}_0x139205[_0x548c('0x3c')]=qs[_0x548c('0x3d')](_0x32df3c[_0x548c('0x34')][_0x548c('0x3d')]);_0x139205[_0x548c('0x3e')]=qs[_0x548c('0x36')](_[_0x548c('0x3f')](_0x32df3c[_0x548c('0x34')],_0x1883fa[_0x548c('0x36')]),_0x2f9b8d);if(_0x32df3c[_0x548c('0x34')]['filter']){_0x139205[_0x548c('0x3e')]=_[_0x548c('0x40')](_0x139205['where'],{'$or':_[_0x548c('0x2d')](_0x2f9b8d,function(_0x4fcf6b){if(_0x4fcf6b[_0x548c('0x31')]!==_0x548c('0x41')){var _0x3e5d52={};_0x3e5d52[_0x4fcf6b[_0x548c('0x2b')]]={'$like':'%'+_0x32df3c[_0x548c('0x34')][_0x548c('0x42')]+'%'};return _0x3e5d52;}})});}_0x139205=_[_0x548c('0x40')]({},_0x139205,_0x32df3c[_0x548c('0x43')]);var _0x267ec2={'where':_0x139205['where']};return db['Dynamics365Configuration'][_0x548c('0x21')](_0x267ec2)[_0x548c('0x27')](function(_0x4d2ab1){_0x2bf84b[_0x548c('0x21')]=_0x4d2ab1;if(_0x32df3c[_0x548c('0x34')]['includeAll']){_0x139205[_0x548c('0x44')]=[{'all':!![]}];}return db[_0x548c('0x2e')]['findAll'](_0x139205);})[_0x548c('0x27')](function(_0x364b60){_0x2bf84b[_0x548c('0x45')]=_0x364b60;return _0x2bf84b;})[_0x548c('0x27')](respondWithFilteredResult(_0x1d5abb,_0x139205))[_0x548c('0x46')](handleError(_0x1d5abb,null));};exports[_0x548c('0x47')]=function(_0x31ccb6,_0x365b9d){var _0x131c54={'raw':![],'where':{'id':_0x31ccb6[_0x548c('0x48')]['id']}},_0x45f3e8={};_0x45f3e8[_0x548c('0x33')]=_['keys'](db[_0x548c('0x2e')][_0x548c('0x2f')]);_0x45f3e8[_0x548c('0x34')]=_[_0x548c('0x35')](_0x31ccb6[_0x548c('0x34')]);_0x45f3e8[_0x548c('0x36')]=_[_0x548c('0x37')](_0x45f3e8[_0x548c('0x33')],_0x45f3e8[_0x548c('0x34')]);_0x131c54[_0x548c('0x38')]=_['intersection'](_0x45f3e8['model'],qs[_0x548c('0x39')](_0x31ccb6[_0x548c('0x34')]['fields']));_0x131c54['attributes']=_0x131c54[_0x548c('0x38')]['length']?_0x131c54[_0x548c('0x38')]:_0x45f3e8[_0x548c('0x33')];if(_0x31ccb6[_0x548c('0x34')][_0x548c('0x49')]){_0x131c54[_0x548c('0x44')]=[{'all':!![]}];}_0x131c54=_[_0x548c('0x40')]({},_0x131c54,_0x31ccb6[_0x548c('0x43')]);return db[_0x548c('0x2e')]['find'](_0x131c54)[_0x548c('0x27')](handleEntityNotFound(_0x365b9d,null))[_0x548c('0x27')](respondWithResult(_0x365b9d,null))[_0x548c('0x46')](handleError(_0x365b9d,null));};exports[_0x548c('0x4a')]=function(_0x2fd716,_0x49d78e){return db['Dynamics365Configuration']['create'](_0x2fd716['body'],{})[_0x548c('0x27')](respondWithResult(_0x49d78e,0xc9))[_0x548c('0x46')](handleError(_0x49d78e,null));};exports[_0x548c('0x26')]=function(_0x18b794,_0xe3750a){if(_0x18b794['body']['id']){delete _0x18b794[_0x548c('0x4b')]['id'];}return db['Dynamics365Configuration'][_0x548c('0x4c')]({'where':{'id':_0x18b794[_0x548c('0x48')]['id']}})['then'](handleEntityNotFound(_0xe3750a,null))['then'](saveUpdates(_0x18b794[_0x548c('0x4b')],null))['then'](respondWithResult(_0xe3750a,null))['catch'](handleError(_0xe3750a,null));};exports[_0x548c('0x4d')]=function(_0x876f45,_0x1d4bd3){return db[_0x548c('0x2e')][_0x548c('0x4c')]({'where':{'id':_0x876f45[_0x548c('0x48')]['id']}})[_0x548c('0x27')](handleEntityNotFound(_0x1d4bd3,null))[_0x548c('0x27')](removeEntity(_0x1d4bd3,null))[_0x548c('0x46')](handleError(_0x1d4bd3,null));};exports[_0x548c('0x4e')]=function(_0x480366,_0x407659,_0xbe2762){var _0x41760f={};var _0x21e1ce={};var _0x22ce4e;var _0x580d5c;return db[_0x548c('0x2e')][_0x548c('0x4f')]({'where':{'id':_0x480366[_0x548c('0x48')]['id']}})[_0x548c('0x27')](handleEntityNotFound(_0x407659,null))[_0x548c('0x27')](function(_0x55bae6){if(_0x55bae6){_0x22ce4e=_0x55bae6;_0x21e1ce[_0x548c('0x33')]=_[_0x548c('0x35')](db[_0x548c('0x50')][_0x548c('0x2f')]);_0x21e1ce[_0x548c('0x34')]=_[_0x548c('0x35')](_0x480366[_0x548c('0x34')]);_0x21e1ce[_0x548c('0x36')]=_['intersection'](_0x21e1ce[_0x548c('0x33')],_0x21e1ce[_0x548c('0x34')]);_0x41760f[_0x548c('0x38')]=_[_0x548c('0x37')](_0x21e1ce[_0x548c('0x33')],qs[_0x548c('0x39')](_0x480366[_0x548c('0x34')][_0x548c('0x39')]));_0x41760f[_0x548c('0x38')]=_0x41760f[_0x548c('0x38')]['length']?_0x41760f[_0x548c('0x38')]:_0x21e1ce['model'];_0x41760f[_0x548c('0x3c')]=qs[_0x548c('0x3d')](_0x480366[_0x548c('0x34')]['sort']);_0x41760f[_0x548c('0x3e')]=qs[_0x548c('0x36')](_[_0x548c('0x3f')](_0x480366[_0x548c('0x34')],_0x21e1ce[_0x548c('0x36')]));if(_0x480366[_0x548c('0x34')][_0x548c('0x42')]){_0x41760f[_0x548c('0x3e')]=_[_0x548c('0x40')](_0x41760f[_0x548c('0x3e')],{'$or':_[_0x548c('0x2d')](_0x41760f['attributes'],function(_0x4a24ec){var _0x428cc0={};_0x428cc0[_0x4a24ec]={'$like':'%'+_0x480366[_0x548c('0x34')][_0x548c('0x42')]+'%'};return _0x428cc0;})});}_0x41760f=_[_0x548c('0x40')]({},_0x41760f,_0x480366[_0x548c('0x43')]);return _0x22ce4e['getFields'](_0x41760f);}})[_0x548c('0x27')](function(_0x1e7ceb){if(_0x1e7ceb){_0x580d5c=_0x1e7ceb[_0x548c('0x3a')];if(!_0x480366['query'][_0x548c('0x51')](_0x548c('0x3b'))){_0x41760f[_0x548c('0x1f')]=qs[_0x548c('0x1f')](_0x480366[_0x548c('0x34')][_0x548c('0x1f')]);_0x41760f[_0x548c('0x1e')]=qs[_0x548c('0x1e')](_0x480366['query'][_0x548c('0x1e')]);}return _0x22ce4e[_0x548c('0x4e')](_0x41760f);}})[_0x548c('0x27')](function(_0x3f96b4){if(_0x3f96b4){return _0x3f96b4?{'count':_0x580d5c,'rows':_0x3f96b4}:null;}})[_0x548c('0x27')](respondWithResult(_0x407659,null))[_0x548c('0x46')](handleError(_0x407659,null));};exports[_0x548c('0x52')]=function(_0x3cfcac,_0x37107d,_0x1cadfd){var _0x2b8f05={};var _0x3939f1={};var _0x197ef4;var _0xee03a2;return db[_0x548c('0x2e')]['findOne']({'where':{'id':_0x3cfcac['params']['id']}})[_0x548c('0x27')](handleEntityNotFound(_0x37107d,null))[_0x548c('0x27')](function(_0x242ff4){if(_0x242ff4){_0x197ef4=_0x242ff4;_0x3939f1['model']=_[_0x548c('0x35')](db[_0x548c('0x50')][_0x548c('0x2f')]);_0x3939f1[_0x548c('0x34')]=_[_0x548c('0x35')](_0x3cfcac[_0x548c('0x34')]);_0x3939f1[_0x548c('0x36')]=_['intersection'](_0x3939f1['model'],_0x3939f1[_0x548c('0x34')]);_0x2b8f05['attributes']=_[_0x548c('0x37')](_0x3939f1['model'],qs[_0x548c('0x39')](_0x3cfcac[_0x548c('0x34')][_0x548c('0x39')]));_0x2b8f05[_0x548c('0x38')]=_0x2b8f05['attributes'][_0x548c('0x3a')]?_0x2b8f05[_0x548c('0x38')]:_0x3939f1[_0x548c('0x33')];_0x2b8f05[_0x548c('0x3c')]=qs[_0x548c('0x3d')](_0x3cfcac[_0x548c('0x34')]['sort']);_0x2b8f05[_0x548c('0x3e')]=qs[_0x548c('0x36')](_['pick'](_0x3cfcac[_0x548c('0x34')],_0x3939f1[_0x548c('0x36')]));if(_0x3cfcac[_0x548c('0x34')]['filter']){_0x2b8f05[_0x548c('0x3e')]=_[_0x548c('0x40')](_0x2b8f05[_0x548c('0x3e')],{'$or':_[_0x548c('0x2d')](_0x2b8f05[_0x548c('0x38')],function(_0xe868d){var _0x19feab={};_0x19feab[_0xe868d]={'$like':'%'+_0x3cfcac[_0x548c('0x34')][_0x548c('0x42')]+'%'};return _0x19feab;})});}_0x2b8f05=_[_0x548c('0x40')]({},_0x2b8f05,_0x3cfcac[_0x548c('0x43')]);return _0x197ef4[_0x548c('0x52')](_0x2b8f05);}})['then'](function(_0x304992){if(_0x304992){_0xee03a2=_0x304992['length'];if(!_0x3cfcac[_0x548c('0x34')][_0x548c('0x51')](_0x548c('0x3b'))){_0x2b8f05[_0x548c('0x1f')]=qs[_0x548c('0x1f')](_0x3cfcac[_0x548c('0x34')][_0x548c('0x1f')]);_0x2b8f05['offset']=qs[_0x548c('0x1e')](_0x3cfcac['query'][_0x548c('0x1e')]);}return _0x197ef4[_0x548c('0x52')](_0x2b8f05);}})['then'](function(_0x3b2cb8){if(_0x3b2cb8){return _0x3b2cb8?{'count':_0xee03a2,'rows':_0x3b2cb8}:null;}})[_0x548c('0x27')](respondWithResult(_0x37107d,null))[_0x548c('0x46')](handleError(_0x37107d,null));};exports['getDescriptions']=function(_0x532cff,_0x43eeaa,_0x475a3e){var _0x4201d1={};var _0x3a51a5={};var _0xab6dee;var _0x4dcc4d;return db[_0x548c('0x2e')][_0x548c('0x4f')]({'where':{'id':_0x532cff[_0x548c('0x48')]['id']}})[_0x548c('0x27')](handleEntityNotFound(_0x43eeaa,null))[_0x548c('0x27')](function(_0x4d29a2){if(_0x4d29a2){_0xab6dee=_0x4d29a2;_0x3a51a5[_0x548c('0x33')]=_[_0x548c('0x35')](db['Dynamics365Field'][_0x548c('0x2f')]);_0x3a51a5['query']=_[_0x548c('0x35')](_0x532cff['query']);_0x3a51a5[_0x548c('0x36')]=_[_0x548c('0x37')](_0x3a51a5['model'],_0x3a51a5[_0x548c('0x34')]);_0x4201d1[_0x548c('0x38')]=_[_0x548c('0x37')](_0x3a51a5[_0x548c('0x33')],qs[_0x548c('0x39')](_0x532cff['query'][_0x548c('0x39')]));_0x4201d1[_0x548c('0x38')]=_0x4201d1[_0x548c('0x38')][_0x548c('0x3a')]?_0x4201d1[_0x548c('0x38')]:_0x3a51a5[_0x548c('0x33')];_0x4201d1[_0x548c('0x3c')]=qs['sort'](_0x532cff[_0x548c('0x34')]['sort']);_0x4201d1[_0x548c('0x3e')]=qs['filters'](_[_0x548c('0x3f')](_0x532cff[_0x548c('0x34')],_0x3a51a5[_0x548c('0x36')]));if(_0x532cff[_0x548c('0x34')][_0x548c('0x42')]){_0x4201d1['where']=_[_0x548c('0x40')](_0x4201d1[_0x548c('0x3e')],{'$or':_[_0x548c('0x2d')](_0x4201d1[_0x548c('0x38')],function(_0x3fe6a0){var _0x3eb901={};_0x3eb901[_0x3fe6a0]={'$like':'%'+_0x532cff['query'][_0x548c('0x42')]+'%'};return _0x3eb901;})});}_0x4201d1=_[_0x548c('0x40')]({},_0x4201d1,_0x532cff['options']);return _0xab6dee[_0x548c('0x53')](_0x4201d1);}})[_0x548c('0x27')](function(_0x358d00){if(_0x358d00){_0x4dcc4d=_0x358d00['length'];if(!_0x532cff[_0x548c('0x34')][_0x548c('0x51')]('nolimit')){_0x4201d1[_0x548c('0x1f')]=qs[_0x548c('0x1f')](_0x532cff[_0x548c('0x34')][_0x548c('0x1f')]);_0x4201d1[_0x548c('0x1e')]=qs['offset'](_0x532cff[_0x548c('0x34')][_0x548c('0x1e')]);}return _0xab6dee['getDescriptions'](_0x4201d1);}})[_0x548c('0x27')](function(_0x3609e8){if(_0x3609e8){return _0x3609e8?{'count':_0x4dcc4d,'rows':_0x3609e8}:null;}})['then'](respondWithResult(_0x43eeaa,null))[_0x548c('0x46')](handleError(_0x43eeaa,null));};
\ No newline at end of file
index b52fca9..3d723a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb821=['rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util','../../config/logger','bluebird'];(function(_0x1ae878,_0x5bccd5){var _0x174623=function(_0x1e04f9){while(--_0x1e04f9){_0x1ae878['push'](_0x1ae878['shift']());}};_0x174623(++_0x5bccd5);}(_0xb821,0xa7));var _0x1b82=function(_0x4edc55,_0x1676bd){_0x4edc55=_0x4edc55-0x0;var _0x5c6c44=_0xb821[_0x4edc55];return _0x5c6c44;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var logger=require(_0x1b82('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1b82('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1b82('0x3'));var config=require(_0x1b82('0x4'));var attributes=require(_0x1b82('0x5'));module[_0x1b82('0x6')]=function(_0x597ca7,_0x3e27c4){return _0x597ca7[_0x1b82('0x7')](_0x1b82('0x8'),attributes,{'tableName':_0x1b82('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x008c=['define','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0x527dc5,_0x1de7e7){var _0x216de9=function(_0xde9c52){while(--_0xde9c52){_0x527dc5['push'](_0x527dc5['shift']());}};_0x216de9(++_0x1de7e7);}(_0x008c,0x188));var _0xc008=function(_0x28a245,_0x1d817a){_0x28a245=_0x28a245-0x0;var _0x1bfce6=_0x008c[_0x28a245];return _0x1bfce6;};'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')]('Dynamics365Configuration',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 733c78d..ed7b9f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedfd=['../../config/utils','rpc','jayson/promise','request','then','info','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','util','moment','bluebird','randomstring','ioredis'];(function(_0x39f9ea,_0x249630){var _0x5062e5=function(_0x3bc37b){while(--_0x3bc37b){_0x39f9ea['push'](_0x39f9ea['shift']());}};_0x5062e5(++_0x249630);}(_0xedfd,0x1b0));var _0xdedf=function(_0xd39959,_0x302d09){_0xd39959=_0xd39959-0x0;var _0x1ff69c=_0xedfd[_0xd39959];return _0x1ff69c;};'use strict';var _=require('lodash');var util=require(_0xdedf('0x0'));var moment=require(_0xdedf('0x1'));var BPromise=require(_0xdedf('0x2'));var rs=require(_0xdedf('0x3'));var fs=require('fs');var Redis=require(_0xdedf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdedf('0x5'));var logger=require('../../config/logger')(_0xdedf('0x6'));var config=require('../../config/environment');var jayson=require(_0xdedf('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3cd050,_0x43ee21,_0x47e86d){return new BPromise(function(_0x2a0c95,_0x4ddb43){return client[_0xdedf('0x8')](_0x3cd050,_0x47e86d)[_0xdedf('0x9')](function(_0x5b60f0){logger[_0xdedf('0xa')]('Dynamics365Configuration,\x20%s,\x20%s',_0x43ee21,_0xdedf('0xb'));logger[_0xdedf('0xc')](_0xdedf('0xd'),_0x43ee21,_0xdedf('0xb'),JSON[_0xdedf('0xe')](_0x5b60f0));if(_0x5b60f0[_0xdedf('0xf')]){if(_0x5b60f0[_0xdedf('0xf')][_0xdedf('0x10')]===0x1f4){logger[_0xdedf('0xf')](_0xdedf('0x11'),_0x43ee21,_0x5b60f0[_0xdedf('0xf')][_0xdedf('0x12')]);return _0x4ddb43(_0x5b60f0[_0xdedf('0xf')]['message']);}logger[_0xdedf('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x43ee21,_0x5b60f0[_0xdedf('0xf')][_0xdedf('0x12')]);return _0x2a0c95(_0x5b60f0['error'][_0xdedf('0x12')]);}else{logger[_0xdedf('0xa')](_0xdedf('0x11'),_0x43ee21,'request\x20sent');_0x2a0c95(_0x5b60f0['result']['message']);}})['catch'](function(_0x1d2402){logger[_0xdedf('0xf')](_0xdedf('0x11'),_0x43ee21,_0x1d2402);_0x4ddb43(_0x1d2402);});});}
\ No newline at end of file
+var _0x92c9=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','request\x20sent','error'];(function(_0x203c7a,_0x505e99){var _0x1be3f3=function(_0x2428ff){while(--_0x2428ff){_0x203c7a['push'](_0x203c7a['shift']());}};_0x1be3f3(++_0x505e99);}(_0x92c9,0x174));var _0x992c=function(_0x4d961f,_0x2e66ab){_0x4d961f=_0x4d961f-0x0;var _0xfcb2c1=_0x92c9[_0x4d961f];return _0xfcb2c1;};'use strict';var _=require(_0x992c('0x0'));var util=require(_0x992c('0x1'));var moment=require(_0x992c('0x2'));var BPromise=require(_0x992c('0x3'));var rs=require(_0x992c('0x4'));var fs=require('fs');var Redis=require(_0x992c('0x5'));var db=require(_0x992c('0x6'))['db'];var utils=require(_0x992c('0x7'));var logger=require(_0x992c('0x8'))('rpc');var config=require(_0x992c('0x9'));var jayson=require(_0x992c('0xa'));var client=jayson['client'][_0x992c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4bf7cc,_0x22d05f,_0x2bf922){return new BPromise(function(_0x3dc7ff,_0x53a32b){return client[_0x992c('0xc')](_0x4bf7cc,_0x2bf922)[_0x992c('0xd')](function(_0x48a1d5){logger[_0x992c('0xe')](_0x992c('0xf'),_0x22d05f,'request\x20sent');logger[_0x992c('0x10')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x22d05f,_0x992c('0x11'),JSON['stringify'](_0x48a1d5));if(_0x48a1d5['error']){if(_0x48a1d5[_0x992c('0x12')][_0x992c('0x13')]===0x1f4){logger['error'](_0x992c('0xf'),_0x22d05f,_0x48a1d5['error'][_0x992c('0x14')]);return _0x53a32b(_0x48a1d5[_0x992c('0x12')]['message']);}logger[_0x992c('0x12')](_0x992c('0xf'),_0x22d05f,_0x48a1d5[_0x992c('0x12')][_0x992c('0x14')]);return _0x3dc7ff(_0x48a1d5[_0x992c('0x12')][_0x992c('0x14')]);}else{logger[_0x992c('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x22d05f,_0x992c('0x11'));_0x3dc7ff(_0x48a1d5[_0x992c('0x15')]['message']);}})[_0x992c('0x16')](function(_0x18e0cd){logger[_0x992c('0x12')](_0x992c('0xf'),_0x22d05f,_0x18e0cd);_0x53a32b(_0x18e0cd);});});}
\ No newline at end of file
index 3ea879e..e14a4a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46dc=['delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/:id','show','post','create'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x46dc,0xc3));var _0xc46d=function(_0x517443,_0x2cad8d){_0x517443=_0x517443-0x0;var _0x5b397b=_0x46dc[_0x517443];return _0x5b397b;};'use strict';var multer=require(_0xc46d('0x0'));var util=require('util');var path=require(_0xc46d('0x1'));var timeout=require('connect-timeout');var express=require(_0xc46d('0x2'));var router=express[_0xc46d('0x3')]();var fs_extra=require(_0xc46d('0x4'));var auth=require(_0xc46d('0x5'));var interaction=require(_0xc46d('0x6'));var config=require('../../config/environment');var controller=require('./intDynamics365Field.controller');router['get']('/',auth[_0xc46d('0x7')](),controller['index']);router[_0xc46d('0x8')](_0xc46d('0x9'),auth['isAuthenticated'](),controller[_0xc46d('0xa')]);router[_0xc46d('0xb')]('/',auth[_0xc46d('0x7')](),controller[_0xc46d('0xc')]);router['put']('/:id',auth[_0xc46d('0x7')](),controller['update']);router[_0xc46d('0xd')](_0xc46d('0x9'),auth[_0xc46d('0x7')](),controller[_0xc46d('0xe')]);module[_0xc46d('0xf')]=router;
\ No newline at end of file
+var _0xf419=['../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','index','get','show','post','create','put','/:id','update','destroy','multer','path','connect-timeout','express','fs-extra'];(function(_0x4ce98f,_0x26be1e){var _0x40876b=function(_0x2267cc){while(--_0x2267cc){_0x4ce98f['push'](_0x4ce98f['shift']());}};_0x40876b(++_0x26be1e);}(_0xf419,0x175));var _0x9f41=function(_0x276064,_0x198d9a){_0x276064=_0x276064-0x0;var _0x53e995=_0xf419[_0x276064];return _0x53e995;};'use strict';var multer=require(_0x9f41('0x0'));var util=require('util');var path=require(_0x9f41('0x1'));var timeout=require(_0x9f41('0x2'));var express=require(_0x9f41('0x3'));var router=express['Router']();var fs_extra=require(_0x9f41('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9f41('0x5'));var config=require(_0x9f41('0x6'));var controller=require(_0x9f41('0x7'));router['get']('/',auth[_0x9f41('0x8')](),controller[_0x9f41('0x9')]);router[_0x9f41('0xa')]('/:id',auth[_0x9f41('0x8')](),controller[_0x9f41('0xb')]);router[_0x9f41('0xc')]('/',auth['isAuthenticated'](),controller[_0x9f41('0xd')]);router[_0x9f41('0xe')](_0x9f41('0xf'),auth[_0x9f41('0x8')](),controller[_0x9f41('0x10')]);router['delete'](_0x9f41('0xf'),auth[_0x9f41('0x8')](),controller[_0x9f41('0x11')]);module['exports']=router;
\ No newline at end of file
index 82e8f4c..716fa22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe79e=['variable','customVariable','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x620a6e,_0x5a74c2){var _0x50e2c4=function(_0xd36426){while(--_0xd36426){_0x620a6e['push'](_0x620a6e['shift']());}};_0x50e2c4(++_0x5a74c2);}(_0xe79e,0x1a3));var _0xee79=function(_0x150f01,_0x5e1895){_0x150f01=_0x150f01-0x0;var _0x4573c7=_0xe79e[_0x150f01];return _0x4573c7;};'use strict';var Sequelize=require(_0xee79('0x0'));module[_0xee79('0x1')]={'type':{'type':Sequelize[_0xee79('0x2')](_0xee79('0x3'),_0xee79('0x4'),_0xee79('0x5'),'keyValue',_0xee79('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xee79('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xee79('0x3'),_0xee79('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xee79('0x7')]},'idField':{'type':Sequelize[_0xee79('0x7')]},'nameField':{'type':Sequelize[_0xee79('0x7')]},'customField':{'type':Sequelize[_0xee79('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xee79('0x7')]}};
\ No newline at end of file
+var _0xa4f4=['picklist','string','customVariable','STRING','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x380df9,_0x44e2d9){var _0x5696cd=function(_0xcc4203){while(--_0xcc4203){_0x380df9['push'](_0x380df9['shift']());}};_0x5696cd(++_0x44e2d9);}(_0xa4f4,0x1eb));var _0x4a4f=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xa4f4[_0x1beef3];return _0x5af964;};'use strict';var Sequelize=require(_0x4a4f('0x0'));module[_0x4a4f('0x1')]={'type':{'type':Sequelize[_0x4a4f('0x2')]('string',_0x4a4f('0x3'),'customVariable','keyValue',_0x4a4f('0x4')),'defaultValue':_0x4a4f('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x4a4f('0x2')](_0x4a4f('0x5'),_0x4a4f('0x3'),_0x4a4f('0x6'))},'keyContent':{'type':Sequelize[_0x4a4f('0x7')]},'idField':{'type':Sequelize[_0x4a4f('0x7')]},'nameField':{'type':Sequelize[_0x4a4f('0x7')]},'customField':{'type':Sequelize[_0x4a4f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index ca5194c..d43bd1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1746=['apply','reject','save','update','then','destroy','error','stack','name','send','rawAttributes','fieldName','type','model','map','filters','intersection','attributes','fields','query','nolimit','where','pick','filter','merge','options','Dynamics365Field','includeAll','catch','keys','length','include','create','body','params','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range'];(function(_0x3de50d,_0x35e361){var _0x56fdc0=function(_0x1a67e9){while(--_0x1a67e9){_0x3de50d['push'](_0x3de50d['shift']());}};_0x56fdc0(++_0x35e361);}(_0x1746,0x13c));var _0x6174=function(_0x373e50,_0x2444ed){_0x373e50=_0x373e50-0x0;var _0x2529be=_0x1746[_0x373e50];return _0x2529be;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6174('0x0'));var zipdir=require(_0x6174('0x1'));var jsonpatch=require(_0x6174('0x2'));var rp=require(_0x6174('0x3'));var moment=require(_0x6174('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6174('0x5'));var util=require(_0x6174('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6174('0x7'));var ejs=require(_0x6174('0x8'));var fs=require('fs');var fs_extra=require(_0x6174('0x9'));var _=require(_0x6174('0xa'));var squel=require(_0x6174('0xb'));var crypto=require(_0x6174('0xc'));var jsforce=require(_0x6174('0xd'));var deskjs=require(_0x6174('0xe'));var toCsv=require(_0x6174('0x7'));var querystring=require(_0x6174('0xf'));var Papa=require(_0x6174('0x10'));var Redis=require(_0x6174('0x11'));var authService=require(_0x6174('0x12'));var qs=require(_0x6174('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6174('0x14'));var logger=require('../../config/logger')(_0x6174('0x15'));var utils=require(_0x6174('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6174('0x17'));var db=require(_0x6174('0x18'))['db'];function respondWithStatusCode(_0x3a303a,_0x1f8340){_0x1f8340=_0x1f8340||0xcc;return function(_0xbe7883){if(_0xbe7883){return _0x3a303a[_0x6174('0x19')](_0x1f8340);}return _0x3a303a[_0x6174('0x1a')](_0x1f8340)[_0x6174('0x1b')]();};}function respondWithResult(_0x12c1af,_0x38fb0a){_0x38fb0a=_0x38fb0a||0xc8;return function(_0x10ed1a){if(_0x10ed1a){return _0x12c1af[_0x6174('0x1a')](_0x38fb0a)[_0x6174('0x1c')](_0x10ed1a);}};}function respondWithFilteredResult(_0x524795,_0x398eeb){return function(_0xf1669e){if(_0xf1669e){var _0x4d0178=typeof _0x398eeb[_0x6174('0x1d')]===_0x6174('0x1e')&&typeof _0x398eeb[_0x6174('0x1f')]===_0x6174('0x1e');var _0x168c1b=_0xf1669e[_0x6174('0x20')];var _0x3d2457=_0x4d0178?0x0:_0x398eeb[_0x6174('0x1d')];var _0x4fd61f=_0x4d0178?_0xf1669e[_0x6174('0x20')]:_0x398eeb[_0x6174('0x1d')]+_0x398eeb['limit'];var _0x1e6d0c;if(_0x4fd61f>=_0x168c1b){_0x4fd61f=_0x168c1b;_0x1e6d0c=0xc8;}else{_0x1e6d0c=0xce;}_0x524795[_0x6174('0x1a')](_0x1e6d0c);return _0x524795['set'](_0x6174('0x21'),_0x3d2457+'-'+_0x4fd61f+'/'+_0x168c1b)[_0x6174('0x1c')](_0xf1669e);}return null;};}function patchUpdates(_0x56ca68){return function(_0x13d9b5){try{jsonpatch[_0x6174('0x22')](_0x13d9b5,_0x56ca68,!![]);}catch(_0x36b092){return BPromise[_0x6174('0x23')](_0x36b092);}return _0x13d9b5[_0x6174('0x24')]();};}function saveUpdates(_0x2271ac,_0x5af28e){return function(_0x3c5cef){if(_0x3c5cef){return _0x3c5cef[_0x6174('0x25')](_0x2271ac)[_0x6174('0x26')](function(_0x8e9b75){return _0x8e9b75;});}return null;};}function removeEntity(_0x3ed7db,_0x44b0f9){return function(_0x3de127){if(_0x3de127){return _0x3de127[_0x6174('0x27')]()[_0x6174('0x26')](function(){_0x3ed7db[_0x6174('0x1a')](0xcc)[_0x6174('0x1b')]();});}};}function handleEntityNotFound(_0x29f281,_0x3cb8e4){return function(_0xf4df77){if(!_0xf4df77){_0x29f281[_0x6174('0x19')](0x194);}return _0xf4df77;};}function handleError(_0x254597,_0x542657){_0x542657=_0x542657||0x1f4;return function(_0x2e922b){logger[_0x6174('0x28')](_0x2e922b[_0x6174('0x29')]);if(_0x2e922b[_0x6174('0x2a')]){delete _0x2e922b[_0x6174('0x2a')];}_0x254597['status'](_0x542657)[_0x6174('0x2b')](_0x2e922b);};}exports['index']=function(_0x2df556,_0x1d7a2d){var _0x61b565={},_0x1c1194={},_0x39b3c6={'count':0x0,'rows':[]};var _0x388223=_['map'](db['Dynamics365Field'][_0x6174('0x2c')],function(_0xe0c703){return{'name':_0xe0c703[_0x6174('0x2d')],'type':_0xe0c703[_0x6174('0x2e')]['key']};});_0x1c1194[_0x6174('0x2f')]=_[_0x6174('0x30')](_0x388223,_0x6174('0x2a'));_0x1c1194['query']=_['keys'](_0x2df556['query']);_0x1c1194[_0x6174('0x31')]=_[_0x6174('0x32')](_0x1c1194[_0x6174('0x2f')],_0x1c1194['query']);_0x61b565[_0x6174('0x33')]=_[_0x6174('0x32')](_0x1c1194[_0x6174('0x2f')],qs[_0x6174('0x34')](_0x2df556[_0x6174('0x35')]['fields']));_0x61b565[_0x6174('0x33')]=_0x61b565[_0x6174('0x33')]['length']?_0x61b565[_0x6174('0x33')]:_0x1c1194[_0x6174('0x2f')];if(!_0x2df556['query']['hasOwnProperty'](_0x6174('0x36'))){_0x61b565[_0x6174('0x1f')]=qs['limit'](_0x2df556['query'][_0x6174('0x1f')]);_0x61b565[_0x6174('0x1d')]=qs[_0x6174('0x1d')](_0x2df556['query']['offset']);}_0x61b565['order']=qs['sort'](_0x2df556[_0x6174('0x35')]['sort']);_0x61b565[_0x6174('0x37')]=qs['filters'](_[_0x6174('0x38')](_0x2df556[_0x6174('0x35')],_0x1c1194[_0x6174('0x31')]),_0x388223);if(_0x2df556[_0x6174('0x35')][_0x6174('0x39')]){_0x61b565[_0x6174('0x37')]=_['merge'](_0x61b565['where'],{'$or':_[_0x6174('0x30')](_0x388223,function(_0x1a2a52){if(_0x1a2a52['type']!=='VIRTUAL'){var _0x429f54={};_0x429f54[_0x1a2a52[_0x6174('0x2a')]]={'$like':'%'+_0x2df556[_0x6174('0x35')][_0x6174('0x39')]+'%'};return _0x429f54;}})});}_0x61b565=_[_0x6174('0x3a')]({},_0x61b565,_0x2df556[_0x6174('0x3b')]);var _0x10e727={'where':_0x61b565[_0x6174('0x37')]};return db[_0x6174('0x3c')][_0x6174('0x20')](_0x10e727)[_0x6174('0x26')](function(_0x41b43a){_0x39b3c6[_0x6174('0x20')]=_0x41b43a;if(_0x2df556[_0x6174('0x35')][_0x6174('0x3d')]){_0x61b565['include']=[{'all':!![]}];}return db[_0x6174('0x3c')]['findAll'](_0x61b565);})['then'](function(_0x355b2f){_0x39b3c6['rows']=_0x355b2f;return _0x39b3c6;})['then'](respondWithFilteredResult(_0x1d7a2d,_0x61b565))[_0x6174('0x3e')](handleError(_0x1d7a2d,null));};exports['show']=function(_0x5bf890,_0x522845){var _0x21cd2e={'raw':!![],'where':{'id':_0x5bf890['params']['id']}},_0x48d967={};_0x48d967[_0x6174('0x2f')]=_[_0x6174('0x3f')](db[_0x6174('0x3c')][_0x6174('0x2c')]);_0x48d967[_0x6174('0x35')]=_['keys'](_0x5bf890[_0x6174('0x35')]);_0x48d967[_0x6174('0x31')]=_[_0x6174('0x32')](_0x48d967[_0x6174('0x2f')],_0x48d967[_0x6174('0x35')]);_0x21cd2e[_0x6174('0x33')]=_['intersection'](_0x48d967[_0x6174('0x2f')],qs[_0x6174('0x34')](_0x5bf890[_0x6174('0x35')]['fields']));_0x21cd2e[_0x6174('0x33')]=_0x21cd2e[_0x6174('0x33')][_0x6174('0x40')]?_0x21cd2e[_0x6174('0x33')]:_0x48d967['model'];if(_0x5bf890[_0x6174('0x35')][_0x6174('0x3d')]){_0x21cd2e[_0x6174('0x41')]=[{'all':!![]}];}_0x21cd2e=_[_0x6174('0x3a')]({},_0x21cd2e,_0x5bf890[_0x6174('0x3b')]);return db['Dynamics365Field']['find'](_0x21cd2e)['then'](handleEntityNotFound(_0x522845,null))[_0x6174('0x26')](respondWithResult(_0x522845,null))[_0x6174('0x3e')](handleError(_0x522845,null));};exports['create']=function(_0x3ac4bf,_0x450926){return db[_0x6174('0x3c')][_0x6174('0x42')](_0x3ac4bf[_0x6174('0x43')],{})[_0x6174('0x26')](respondWithResult(_0x450926,0xc9))[_0x6174('0x3e')](handleError(_0x450926,null));};exports[_0x6174('0x25')]=function(_0x4af24d,_0x28067e){if(_0x4af24d[_0x6174('0x43')]['id']){delete _0x4af24d[_0x6174('0x43')]['id'];}return db[_0x6174('0x3c')]['find']({'where':{'id':_0x4af24d[_0x6174('0x44')]['id']}})['then'](handleEntityNotFound(_0x28067e,null))['then'](saveUpdates(_0x4af24d[_0x6174('0x43')],null))[_0x6174('0x26')](respondWithResult(_0x28067e,null))[_0x6174('0x3e')](handleError(_0x28067e,null));};exports[_0x6174('0x27')]=function(_0xee2810,_0x1831fa){return db[_0x6174('0x3c')][_0x6174('0x45')]({'where':{'id':_0xee2810['params']['id']}})[_0x6174('0x26')](handleEntityNotFound(_0x1831fa,null))[_0x6174('0x26')](removeEntity(_0x1831fa,null))[_0x6174('0x3e')](handleError(_0x1831fa,null));};
\ No newline at end of file
+var _0x647e=['count','set','apply','reject','save','destroy','error','stack','name','send','index','Dynamics365Field','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit'];(function(_0x50ab95,_0x30f673){var _0xfe781b=function(_0x53ac3d){while(--_0x53ac3d){_0x50ab95['push'](_0x50ab95['shift']());}};_0xfe781b(++_0x30f673);}(_0x647e,0x16b));var _0xe647=function(_0x486823,_0x12fbc3){_0x486823=_0x486823-0x0;var _0x507224=_0x647e[_0x486823];return _0x507224;};'use strict';var emlformat=require(_0xe647('0x0'));var rimraf=require(_0xe647('0x1'));var zipdir=require(_0xe647('0x2'));var jsonpatch=require(_0xe647('0x3'));var rp=require(_0xe647('0x4'));var moment=require(_0xe647('0x5'));var BPromise=require(_0xe647('0x6'));var Mustache=require(_0xe647('0x7'));var util=require(_0xe647('0x8'));var path=require(_0xe647('0x9'));var sox=require('sox');var csv=require(_0xe647('0xa'));var ejs=require(_0xe647('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe647('0xc'));var squel=require('squel');var crypto=require(_0xe647('0xd'));var jsforce=require(_0xe647('0xe'));var deskjs=require(_0xe647('0xf'));var toCsv=require(_0xe647('0xa'));var querystring=require(_0xe647('0x10'));var Papa=require(_0xe647('0x11'));var Redis=require(_0xe647('0x12'));var authService=require(_0xe647('0x13'));var qs=require(_0xe647('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe647('0x15'));var logger=require(_0xe647('0x16'))(_0xe647('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe647('0x18'));var db=require(_0xe647('0x19'))['db'];function respondWithStatusCode(_0x56c527,_0x319e00){_0x319e00=_0x319e00||0xcc;return function(_0x5d238c){if(_0x5d238c){return _0x56c527['sendStatus'](_0x319e00);}return _0x56c527[_0xe647('0x1a')](_0x319e00)[_0xe647('0x1b')]();};}function respondWithResult(_0x2672fb,_0x4e4f76){_0x4e4f76=_0x4e4f76||0xc8;return function(_0x31bf0e){if(_0x31bf0e){return _0x2672fb['status'](_0x4e4f76)[_0xe647('0x1c')](_0x31bf0e);}};}function respondWithFilteredResult(_0x4b5b92,_0x579c67){return function(_0x479171){if(_0x479171){var _0x1ec390=typeof _0x579c67[_0xe647('0x1d')]===_0xe647('0x1e')&&typeof _0x579c67[_0xe647('0x1f')]===_0xe647('0x1e');var _0x211614=_0x479171['count'];var _0x5507d2=_0x1ec390?0x0:_0x579c67[_0xe647('0x1d')];var _0x318bc9=_0x1ec390?_0x479171[_0xe647('0x20')]:_0x579c67[_0xe647('0x1d')]+_0x579c67[_0xe647('0x1f')];var _0x5ca7b2;if(_0x318bc9>=_0x211614){_0x318bc9=_0x211614;_0x5ca7b2=0xc8;}else{_0x5ca7b2=0xce;}_0x4b5b92[_0xe647('0x1a')](_0x5ca7b2);return _0x4b5b92[_0xe647('0x21')]('Content-Range',_0x5507d2+'-'+_0x318bc9+'/'+_0x211614)[_0xe647('0x1c')](_0x479171);}return null;};}function patchUpdates(_0xd05a99){return function(_0xcee3d0){try{jsonpatch[_0xe647('0x22')](_0xcee3d0,_0xd05a99,!![]);}catch(_0xc79963){return BPromise[_0xe647('0x23')](_0xc79963);}return _0xcee3d0[_0xe647('0x24')]();};}function saveUpdates(_0x3b2321,_0x5ce70c){return function(_0x28ab90){if(_0x28ab90){return _0x28ab90['update'](_0x3b2321)['then'](function(_0x34eb1d){return _0x34eb1d;});}return null;};}function removeEntity(_0x34acde,_0x1bda96){return function(_0x3e2c9c){if(_0x3e2c9c){return _0x3e2c9c[_0xe647('0x25')]()['then'](function(){_0x34acde[_0xe647('0x1a')](0xcc)[_0xe647('0x1b')]();});}};}function handleEntityNotFound(_0x32c398,_0x2c9a25){return function(_0x2f5918){if(!_0x2f5918){_0x32c398['sendStatus'](0x194);}return _0x2f5918;};}function handleError(_0x4f9bef,_0x243cf0){_0x243cf0=_0x243cf0||0x1f4;return function(_0x4848fd){logger[_0xe647('0x26')](_0x4848fd[_0xe647('0x27')]);if(_0x4848fd[_0xe647('0x28')]){delete _0x4848fd['name'];}_0x4f9bef[_0xe647('0x1a')](_0x243cf0)[_0xe647('0x29')](_0x4848fd);};}exports[_0xe647('0x2a')]=function(_0x3439e4,_0x145bb0){var _0xac0ed9={},_0x564a3d={},_0x4b2f47={'count':0x0,'rows':[]};var _0x11f0cf=_['map'](db[_0xe647('0x2b')][_0xe647('0x2c')],function(_0x3485b5){return{'name':_0x3485b5[_0xe647('0x2d')],'type':_0x3485b5[_0xe647('0x2e')][_0xe647('0x2f')]};});_0x564a3d[_0xe647('0x30')]=_[_0xe647('0x31')](_0x11f0cf,_0xe647('0x28'));_0x564a3d['query']=_[_0xe647('0x32')](_0x3439e4[_0xe647('0x33')]);_0x564a3d['filters']=_[_0xe647('0x34')](_0x564a3d[_0xe647('0x30')],_0x564a3d[_0xe647('0x33')]);_0xac0ed9['attributes']=_[_0xe647('0x34')](_0x564a3d[_0xe647('0x30')],qs[_0xe647('0x35')](_0x3439e4[_0xe647('0x33')][_0xe647('0x35')]));_0xac0ed9['attributes']=_0xac0ed9['attributes'][_0xe647('0x36')]?_0xac0ed9[_0xe647('0x37')]:_0x564a3d['model'];if(!_0x3439e4[_0xe647('0x33')][_0xe647('0x38')](_0xe647('0x39'))){_0xac0ed9[_0xe647('0x1f')]=qs['limit'](_0x3439e4[_0xe647('0x33')][_0xe647('0x1f')]);_0xac0ed9[_0xe647('0x1d')]=qs[_0xe647('0x1d')](_0x3439e4[_0xe647('0x33')][_0xe647('0x1d')]);}_0xac0ed9[_0xe647('0x3a')]=qs['sort'](_0x3439e4['query'][_0xe647('0x3b')]);_0xac0ed9[_0xe647('0x3c')]=qs['filters'](_[_0xe647('0x3d')](_0x3439e4['query'],_0x564a3d[_0xe647('0x3e')]),_0x11f0cf);if(_0x3439e4['query'][_0xe647('0x3f')]){_0xac0ed9['where']=_[_0xe647('0x40')](_0xac0ed9[_0xe647('0x3c')],{'$or':_[_0xe647('0x31')](_0x11f0cf,function(_0x189589){if(_0x189589[_0xe647('0x2e')]!==_0xe647('0x41')){var _0x456844={};_0x456844[_0x189589['name']]={'$like':'%'+_0x3439e4['query'][_0xe647('0x3f')]+'%'};return _0x456844;}})});}_0xac0ed9=_['merge']({},_0xac0ed9,_0x3439e4[_0xe647('0x42')]);var _0x228ed6={'where':_0xac0ed9['where']};return db[_0xe647('0x2b')][_0xe647('0x20')](_0x228ed6)[_0xe647('0x43')](function(_0xef9a29){_0x4b2f47['count']=_0xef9a29;if(_0x3439e4[_0xe647('0x33')][_0xe647('0x44')]){_0xac0ed9[_0xe647('0x45')]=[{'all':!![]}];}return db[_0xe647('0x2b')][_0xe647('0x46')](_0xac0ed9);})['then'](function(_0x48938f){_0x4b2f47[_0xe647('0x47')]=_0x48938f;return _0x4b2f47;})[_0xe647('0x43')](respondWithFilteredResult(_0x145bb0,_0xac0ed9))[_0xe647('0x48')](handleError(_0x145bb0,null));};exports[_0xe647('0x49')]=function(_0x28eee7,_0x45556e){var _0x1790b8={'raw':!![],'where':{'id':_0x28eee7[_0xe647('0x4a')]['id']}},_0x1a3e42={};_0x1a3e42[_0xe647('0x30')]=_['keys'](db[_0xe647('0x2b')][_0xe647('0x2c')]);_0x1a3e42[_0xe647('0x33')]=_['keys'](_0x28eee7[_0xe647('0x33')]);_0x1a3e42[_0xe647('0x3e')]=_[_0xe647('0x34')](_0x1a3e42[_0xe647('0x30')],_0x1a3e42[_0xe647('0x33')]);_0x1790b8[_0xe647('0x37')]=_[_0xe647('0x34')](_0x1a3e42[_0xe647('0x30')],qs[_0xe647('0x35')](_0x28eee7[_0xe647('0x33')][_0xe647('0x35')]));_0x1790b8[_0xe647('0x37')]=_0x1790b8[_0xe647('0x37')][_0xe647('0x36')]?_0x1790b8[_0xe647('0x37')]:_0x1a3e42['model'];if(_0x28eee7[_0xe647('0x33')][_0xe647('0x44')]){_0x1790b8['include']=[{'all':!![]}];}_0x1790b8=_[_0xe647('0x40')]({},_0x1790b8,_0x28eee7[_0xe647('0x42')]);return db[_0xe647('0x2b')][_0xe647('0x4b')](_0x1790b8)['then'](handleEntityNotFound(_0x45556e,null))[_0xe647('0x43')](respondWithResult(_0x45556e,null))['catch'](handleError(_0x45556e,null));};exports[_0xe647('0x4c')]=function(_0x11b63f,_0x2dabdc){return db[_0xe647('0x2b')][_0xe647('0x4c')](_0x11b63f['body'],{})['then'](respondWithResult(_0x2dabdc,0xc9))[_0xe647('0x48')](handleError(_0x2dabdc,null));};exports[_0xe647('0x4d')]=function(_0x3495c7,_0x2ce161){if(_0x3495c7[_0xe647('0x4e')]['id']){delete _0x3495c7[_0xe647('0x4e')]['id'];}return db['Dynamics365Field'][_0xe647('0x4b')]({'where':{'id':_0x3495c7[_0xe647('0x4a')]['id']}})[_0xe647('0x43')](handleEntityNotFound(_0x2ce161,null))['then'](saveUpdates(_0x3495c7[_0xe647('0x4e')],null))[_0xe647('0x43')](respondWithResult(_0x2ce161,null))[_0xe647('0x48')](handleError(_0x2ce161,null));};exports[_0xe647('0x25')]=function(_0xe53ee9,_0x3f92c4){return db[_0xe647('0x2b')][_0xe647('0x4b')]({'where':{'id':_0xe53ee9[_0xe647('0x4a')]['id']}})[_0xe647('0x43')](handleEntityNotFound(_0x3f92c4,null))[_0xe647('0x43')](removeEntity(_0x3f92c4,null))[_0xe647('0x48')](handleError(_0x3f92c4,null));};
\ No newline at end of file
index ca43fb7..c77d94c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x854b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','dynamics365_unique_index','idField','FieldId','lodash','../../config/logger'];(function(_0xb3b67d,_0x544844){var _0x5d69d8=function(_0x5296dc){while(--_0x5296dc){_0xb3b67d['push'](_0xb3b67d['shift']());}};_0x5d69d8(++_0x544844);}(_0x854b,0x1cf));var _0xb854=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x854b[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0xb854('0x0'));var util=require('util');var logger=require(_0xb854('0x1'))(_0xb854('0x2'));var moment=require(_0xb854('0x3'));var BPromise=require(_0xb854('0x4'));var rp=require(_0xb854('0x5'));var fs=require('fs');var path=require(_0xb854('0x6'));var rimraf=require(_0xb854('0x7'));var config=require(_0xb854('0x8'));var attributes=require(_0xb854('0x9'));module['exports']=function(_0xd82f4,_0x4c7b60){return _0xd82f4[_0xb854('0xa')](_0xb854('0xb'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0xb854('0xc'),'fields':[_0xb854('0xd'),_0xb854('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xdd57=['lodash','api','moment','bluebird','../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','dynamics365_unique_index','FieldId'];(function(_0x32e6f0,_0x15e1e5){var _0x4860c7=function(_0x18b3ad){while(--_0x18b3ad){_0x32e6f0['push'](_0x32e6f0['shift']());}};_0x4860c7(++_0x15e1e5);}(_0xdd57,0xd2));var _0x7dd5=function(_0x5c6299,_0x11bd28){_0x5c6299=_0x5c6299-0x0;var _0x23b564=_0xdd57[_0x5c6299];return _0x23b564;};'use strict';var _=require(_0x7dd5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7dd5('0x1'));var moment=require(_0x7dd5('0x2'));var BPromise=require(_0x7dd5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7dd5('0x4'));var attributes=require(_0x7dd5('0x5'));module['exports']=function(_0x3f1774,_0x3da3cb){return _0x3f1774[_0x7dd5('0x6')](_0x7dd5('0x7'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x7dd5('0x8'),'fields':['idField',_0x7dd5('0x9')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 8f4ed03..cffe13a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x875d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring'];(function(_0x3d6bd3,_0x12f91c){var _0x4fb7fa=function(_0x2567c6){while(--_0x2567c6){_0x3d6bd3['push'](_0x3d6bd3['shift']());}};_0x4fb7fa(++_0x12f91c);}(_0x875d,0xe3));var _0xd875=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x875d[_0x51c819];return _0x15c5d2;};'use strict';var _=require(_0xd875('0x0'));var util=require('util');var moment=require(_0xd875('0x1'));var BPromise=require('bluebird');var rs=require(_0xd875('0x2'));var fs=require('fs');var Redis=require(_0xd875('0x3'));var db=require(_0xd875('0x4'))['db'];var utils=require(_0xd875('0x5'));var logger=require(_0xd875('0x6'))(_0xd875('0x7'));var config=require(_0xd875('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd875('0x9')][_0xd875('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c7b26,_0x955cf1,_0x34a5e0){return new BPromise(function(_0x52dbf0,_0x10e3e0){return client[_0xd875('0xb')](_0x3c7b26,_0x34a5e0)[_0xd875('0xc')](function(_0x5116ae){logger[_0xd875('0xd')](_0xd875('0xe'),_0x955cf1,_0xd875('0xf'));logger['debug'](_0xd875('0x10'),_0x955cf1,_0xd875('0xf'),JSON[_0xd875('0x11')](_0x5116ae));if(_0x5116ae['error']){if(_0x5116ae[_0xd875('0x12')][_0xd875('0x13')]===0x1f4){logger[_0xd875('0x12')](_0xd875('0xe'),_0x955cf1,_0x5116ae['error'][_0xd875('0x14')]);return _0x10e3e0(_0x5116ae[_0xd875('0x12')]['message']);}logger['error'](_0xd875('0xe'),_0x955cf1,_0x5116ae['error'][_0xd875('0x14')]);return _0x52dbf0(_0x5116ae[_0xd875('0x12')][_0xd875('0x14')]);}else{logger[_0xd875('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x955cf1,_0xd875('0xf'));_0x52dbf0(_0x5116ae[_0xd875('0x15')][_0xd875('0x14')]);}})[_0xd875('0x16')](function(_0x3db8af){logger[_0xd875('0x12')](_0xd875('0xe'),_0x955cf1,_0x3db8af);_0x10e3e0(_0x3db8af);});});}
\ No newline at end of file
+var _0x47af=['moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','request\x20sent','debug','stringify','error','message','Dynamics365Field,\x20%s,\x20%s','result','catch','util'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x47af,0x168));var _0xf47a=function(_0x3ce9f1,_0x10bdcc){_0x3ce9f1=_0x3ce9f1-0x0;var _0x1fe372=_0x47af[_0x3ce9f1];return _0x1fe372;};'use strict';var _=require('lodash');var util=require(_0xf47a('0x0'));var moment=require(_0xf47a('0x1'));var BPromise=require('bluebird');var rs=require(_0xf47a('0x2'));var fs=require('fs');var Redis=require(_0xf47a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf47a('0x4'));var logger=require(_0xf47a('0x5'))('rpc');var config=require(_0xf47a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf47a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9407d9,_0x76aa23,_0x3e6cb3){return new BPromise(function(_0x3c5cc2,_0x459ab8){return client[_0xf47a('0x8')](_0x9407d9,_0x3e6cb3)[_0xf47a('0x9')](function(_0x1e07c5){logger[_0xf47a('0xa')]('Dynamics365Field,\x20%s,\x20%s',_0x76aa23,_0xf47a('0xb'));logger[_0xf47a('0xc')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x76aa23,'request\x20sent',JSON[_0xf47a('0xd')](_0x1e07c5));if(_0x1e07c5['error']){if(_0x1e07c5[_0xf47a('0xe')]['code']===0x1f4){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x76aa23,_0x1e07c5[_0xf47a('0xe')][_0xf47a('0xf')]);return _0x459ab8(_0x1e07c5[_0xf47a('0xe')]['message']);}logger[_0xf47a('0xe')](_0xf47a('0x10'),_0x76aa23,_0x1e07c5['error'][_0xf47a('0xf')]);return _0x3c5cc2(_0x1e07c5[_0xf47a('0xe')][_0xf47a('0xf')]);}else{logger[_0xf47a('0xa')]('Dynamics365Field,\x20%s,\x20%s',_0x76aa23,_0xf47a('0xb'));_0x3c5cc2(_0x1e07c5[_0xf47a('0x11')]['message']);}})[_0xf47a('0x12')](function(_0x5ab5d7){logger[_0xf47a('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x76aa23,_0x5ab5d7);_0x459ab8(_0x5ab5d7);});});}
\ No newline at end of file
index b6c2560..05f8bf7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbee=['get','/:id/configurations','getConfigurations','/:id/fields','post','create','put','update','exports','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/:id'];(function(_0xd96162,_0x12f9ec){var _0x56076b=function(_0x53148f){while(--_0x53148f){_0xd96162['push'](_0xd96162['shift']());}};_0x56076b(++_0x12f9ec);}(_0xcbee,0x1e9));var _0xecbe=function(_0x50ae69,_0x113b4b){_0x50ae69=_0x50ae69-0x0;var _0x582561=_0xcbee[_0x50ae69];return _0x582561;};'use strict';var multer=require('multer');var util=require(_0xecbe('0x0'));var path=require('path');var timeout=require(_0xecbe('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xecbe('0x2'));var interaction=require(_0xecbe('0x3'));var config=require(_0xecbe('0x4'));var controller=require('./intFreshdeskAccount.controller');router['get']('/',auth[_0xecbe('0x5')](),controller['index']);router['get'](_0xecbe('0x6'),auth[_0xecbe('0x5')](),controller['show']);router[_0xecbe('0x7')](_0xecbe('0x8'),auth[_0xecbe('0x5')](),controller[_0xecbe('0x9')]);router[_0xecbe('0x7')](_0xecbe('0xa'),auth['isAuthenticated'](),controller['getFields']);router[_0xecbe('0xb')]('/',auth[_0xecbe('0x5')](),controller[_0xecbe('0xc')]);router[_0xecbe('0xb')](_0xecbe('0x8'),auth[_0xecbe('0x5')](),controller['addConfiguration']);router[_0xecbe('0xd')]('/:id',auth[_0xecbe('0x5')](),controller[_0xecbe('0xe')]);router['delete'](_0xecbe('0x6'),auth[_0xecbe('0x5')](),controller['destroy']);module[_0xecbe('0xf')]=router;
\ No newline at end of file
+var _0x29c6=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','index','get','show','getConfigurations','getFields','post','addConfiguration','put','update','/:id','destroy','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x29c6,0x6d));var _0x629c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x29c6[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x629c('0x0'));var util=require('util');var path=require(_0x629c('0x1'));var timeout=require(_0x629c('0x2'));var express=require(_0x629c('0x3'));var router=express[_0x629c('0x4')]();var fs_extra=require(_0x629c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x629c('0x6'));var config=require(_0x629c('0x7'));var controller=require(_0x629c('0x8'));router['get']('/',auth[_0x629c('0x9')](),controller[_0x629c('0xa')]);router[_0x629c('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x629c('0xc')]);router[_0x629c('0xb')]('/:id/configurations',auth[_0x629c('0x9')](),controller[_0x629c('0xd')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x629c('0xe')]);router[_0x629c('0xf')]('/',auth[_0x629c('0x9')](),controller['create']);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0x629c('0x10')]);router[_0x629c('0x11')]('/:id',auth[_0x629c('0x9')](),controller[_0x629c('0x12')]);router['delete'](_0x629c('0x13'),auth['isAuthenticated'](),controller[_0x629c('0x14')]);module[_0x629c('0x15')]=router;
\ No newline at end of file
index f1ffcd4..9dfcae1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5af=['exports','STRING','username','remoteUri'];(function(_0x2aed8b,_0x1492ee){var _0x286b0f=function(_0x21944e){while(--_0x21944e){_0x2aed8b['push'](_0x2aed8b['shift']());}};_0x286b0f(++_0x1492ee);}(_0xe5af,0x9c));var _0xfe5a=function(_0xf4f985,_0x21a7f4){_0xf4f985=_0xf4f985-0x0;var _0x56d65a=_0xe5af[_0xf4f985];return _0x56d65a;};'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')},'apiKey':{'type':Sequelize[_0xfe5a('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xfe5a('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x4bd3=['sequelize','STRING','remoteUri'];(function(_0x2d2b63,_0x277d0a){var _0x5d18f8=function(_0x4eca54){while(--_0x4eca54){_0x2d2b63['push'](_0x2d2b63['shift']());}};_0x5d18f8(++_0x277d0a);}(_0x4bd3,0x174));var _0x34bd=function(_0x439fbd,_0x1cfbad){_0x439fbd=_0x439fbd-0x0;var _0x12b323=_0x4bd3[_0x439fbd];return _0x12b323;};'use strict';var Sequelize=require(_0x34bd('0x0'));module['exports']={'name':{'type':Sequelize[_0x34bd('0x1')]},'description':{'type':Sequelize[_0x34bd('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x34bd('0x1')],'unique':_0x34bd('0x2')},'serverUrl':{'type':Sequelize[_0x34bd('0x1')],'allowNull':![]}};
\ No newline at end of file
index 8b41229..83047d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x153f=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','FreshdeskAccount','rawAttributes','type','key','model','keys','intersection','query','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','findOne','FreshdeskConfiguration','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','base64','requester','description','priority','source','ticket_type','company','remove','includes','custom_text','custom_dropdown','label','default','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x4784f4,_0x199217){var _0x1fb0ce=function(_0x24696c){while(--_0x24696c){_0x4784f4['push'](_0x4784f4['shift']());}};_0x1fb0ce(++_0x199217);}(_0x153f,0x15b));var _0xf153=function(_0x435da2,_0x2ef367){_0x435da2=_0x435da2-0x0;var _0x67b767=_0x153f[_0x435da2];return _0x67b767;};'use strict';var emlformat=require(_0xf153('0x0'));var rimraf=require(_0xf153('0x1'));var zipdir=require(_0xf153('0x2'));var jsonpatch=require(_0xf153('0x3'));var rp=require(_0xf153('0x4'));var moment=require(_0xf153('0x5'));var BPromise=require(_0xf153('0x6'));var Mustache=require('mustache');var util=require(_0xf153('0x7'));var path=require('path');var sox=require(_0xf153('0x8'));var csv=require(_0xf153('0x9'));var ejs=require(_0xf153('0xa'));var fs=require('fs');var fs_extra=require(_0xf153('0xb'));var _=require(_0xf153('0xc'));var squel=require('squel');var crypto=require(_0xf153('0xd'));var jsforce=require(_0xf153('0xe'));var deskjs=require(_0xf153('0xf'));var toCsv=require(_0xf153('0x9'));var querystring=require(_0xf153('0x10'));var Papa=require(_0xf153('0x11'));var Redis=require(_0xf153('0x12'));var authService=require(_0xf153('0x13'));var qs=require(_0xf153('0x14'));var as=require(_0xf153('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf153('0x16'))(_0xf153('0x17'));var utils=require(_0xf153('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xf153('0x19'));var db=require(_0xf153('0x1a'))['db'];var integrations=require(_0xf153('0x1b'));function respondWithStatusCode(_0x1cc666,_0x256b7d){_0x256b7d=_0x256b7d||0xcc;return function(_0x107d31){if(_0x107d31){return _0x1cc666[_0xf153('0x1c')](_0x256b7d);}return _0x1cc666[_0xf153('0x1d')](_0x256b7d)[_0xf153('0x1e')]();};}function respondWithResult(_0x4c5283,_0x18be7e){_0x18be7e=_0x18be7e||0xc8;return function(_0x2340f5){if(_0x2340f5){return _0x4c5283[_0xf153('0x1d')](_0x18be7e)[_0xf153('0x1f')](_0x2340f5);}};}function respondWithFilteredResult(_0x3afea2,_0x68f436){return function(_0x273a90){if(_0x273a90){var _0x287bc6=typeof _0x68f436['offset']===_0xf153('0x20')&&typeof _0x68f436['limit']===_0xf153('0x20');var _0x2c62b6=_0x273a90[_0xf153('0x21')];var _0x44272e=_0x287bc6?0x0:_0x68f436['offset'];var _0x357d57=_0x287bc6?_0x273a90[_0xf153('0x21')]:_0x68f436[_0xf153('0x22')]+_0x68f436[_0xf153('0x23')];var _0x15230c;if(_0x357d57>=_0x2c62b6){_0x357d57=_0x2c62b6;_0x15230c=0xc8;}else{_0x15230c=0xce;}_0x3afea2[_0xf153('0x1d')](_0x15230c);return _0x3afea2[_0xf153('0x24')](_0xf153('0x25'),_0x44272e+'-'+_0x357d57+'/'+_0x2c62b6)[_0xf153('0x1f')](_0x273a90);}return null;};}function patchUpdates(_0x1dd340){return function(_0x33ce52){try{jsonpatch[_0xf153('0x26')](_0x33ce52,_0x1dd340,!![]);}catch(_0x493e8a){return BPromise[_0xf153('0x27')](_0x493e8a);}return _0x33ce52[_0xf153('0x28')]();};}function saveUpdates(_0x3d3e41,_0x32e759){return function(_0x5c9f44){if(_0x5c9f44){return _0x5c9f44[_0xf153('0x29')](_0x3d3e41)[_0xf153('0x2a')](function(_0x4376f7){return _0x4376f7;});}return null;};}function removeEntity(_0xf67cde,_0x38190c){return function(_0x1570fc){if(_0x1570fc){return _0x1570fc[_0xf153('0x2b')]()[_0xf153('0x2a')](function(){_0xf67cde[_0xf153('0x1d')](0xcc)[_0xf153('0x1e')]();});}};}function handleEntityNotFound(_0x35f9da,_0x141ef4){return function(_0x703adb){if(!_0x703adb){_0x35f9da[_0xf153('0x1c')](0x194);}return _0x703adb;};}function handleError(_0x17f7a4,_0x48ebdc){_0x48ebdc=_0x48ebdc||0x1f4;return function(_0x6d62ef){logger[_0xf153('0x2c')](_0x6d62ef['stack']);if(_0x6d62ef[_0xf153('0x2d')]){delete _0x6d62ef[_0xf153('0x2d')];}_0x17f7a4['status'](_0x48ebdc)[_0xf153('0x2e')](_0x6d62ef);};}exports[_0xf153('0x2f')]=function(_0x261ac0,_0x2b9a9c){var _0x339e96={},_0x258976={},_0x441436={'count':0x0,'rows':[]};var _0x3b5f4f=_[_0xf153('0x30')](db[_0xf153('0x31')][_0xf153('0x32')],function(_0x415a5f){return{'name':_0x415a5f['fieldName'],'type':_0x415a5f[_0xf153('0x33')][_0xf153('0x34')]};});_0x258976[_0xf153('0x35')]=_[_0xf153('0x30')](_0x3b5f4f,'name');_0x258976['query']=_[_0xf153('0x36')](_0x261ac0['query']);_0x258976['filters']=_[_0xf153('0x37')](_0x258976['model'],_0x258976[_0xf153('0x38')]);_0x339e96['attributes']=_[_0xf153('0x37')](_0x258976[_0xf153('0x35')],qs['fields'](_0x261ac0[_0xf153('0x38')][_0xf153('0x39')]));_0x339e96[_0xf153('0x3a')]=_0x339e96[_0xf153('0x3a')][_0xf153('0x3b')]?_0x339e96[_0xf153('0x3a')]:_0x258976['model'];if(!_0x261ac0[_0xf153('0x38')]['hasOwnProperty'](_0xf153('0x3c'))){_0x339e96[_0xf153('0x23')]=qs[_0xf153('0x23')](_0x261ac0[_0xf153('0x38')][_0xf153('0x23')]);_0x339e96[_0xf153('0x22')]=qs['offset'](_0x261ac0[_0xf153('0x38')][_0xf153('0x22')]);}_0x339e96[_0xf153('0x3d')]=qs['sort'](_0x261ac0[_0xf153('0x38')][_0xf153('0x3e')]);_0x339e96[_0xf153('0x3f')]=qs[_0xf153('0x40')](_[_0xf153('0x41')](_0x261ac0[_0xf153('0x38')],_0x258976['filters']),_0x3b5f4f);if(_0x261ac0[_0xf153('0x38')][_0xf153('0x42')]){_0x339e96['where']=_[_0xf153('0x43')](_0x339e96[_0xf153('0x3f')],{'$or':_[_0xf153('0x30')](_0x3b5f4f,function(_0x40e9f0){if(_0x40e9f0[_0xf153('0x33')]!==_0xf153('0x44')){var _0xef1510={};_0xef1510[_0x40e9f0['name']]={'$like':'%'+_0x261ac0[_0xf153('0x38')][_0xf153('0x42')]+'%'};return _0xef1510;}})});}_0x339e96=_[_0xf153('0x43')]({},_0x339e96,_0x261ac0[_0xf153('0x45')]);var _0x25657a={'where':_0x339e96[_0xf153('0x3f')]};return db['FreshdeskAccount']['count'](_0x25657a)[_0xf153('0x2a')](function(_0x5051f3){_0x441436[_0xf153('0x21')]=_0x5051f3;if(_0x261ac0[_0xf153('0x38')][_0xf153('0x46')]){_0x339e96[_0xf153('0x47')]=[{'all':!![]}];}return db[_0xf153('0x31')][_0xf153('0x48')](_0x339e96);})['then'](function(_0x537635){_0x441436[_0xf153('0x49')]=_0x537635;return _0x441436;})[_0xf153('0x2a')](respondWithFilteredResult(_0x2b9a9c,_0x339e96))['catch'](handleError(_0x2b9a9c,null));};exports[_0xf153('0x4a')]=function(_0x1c77a6,_0x1edf65){var _0x3a9cb2={'raw':![],'where':{'id':_0x1c77a6[_0xf153('0x4b')]['id']}},_0x72f7ee={};_0x72f7ee[_0xf153('0x35')]=_[_0xf153('0x36')](db[_0xf153('0x31')][_0xf153('0x32')]);_0x72f7ee[_0xf153('0x38')]=_[_0xf153('0x36')](_0x1c77a6['query']);_0x72f7ee[_0xf153('0x40')]=_[_0xf153('0x37')](_0x72f7ee[_0xf153('0x35')],_0x72f7ee['query']);_0x3a9cb2[_0xf153('0x3a')]=_[_0xf153('0x37')](_0x72f7ee['model'],qs[_0xf153('0x39')](_0x1c77a6['query'][_0xf153('0x39')]));_0x3a9cb2[_0xf153('0x3a')]=_0x3a9cb2[_0xf153('0x3a')]['length']?_0x3a9cb2[_0xf153('0x3a')]:_0x72f7ee[_0xf153('0x35')];if(_0x1c77a6[_0xf153('0x38')][_0xf153('0x46')]){_0x3a9cb2[_0xf153('0x47')]=[{'all':!![]}];}_0x3a9cb2=_['merge']({},_0x3a9cb2,_0x1c77a6[_0xf153('0x45')]);return db[_0xf153('0x31')]['find'](_0x3a9cb2)[_0xf153('0x2a')](handleEntityNotFound(_0x1edf65,null))[_0xf153('0x2a')](respondWithResult(_0x1edf65,null))[_0xf153('0x4c')](handleError(_0x1edf65,null));};exports['create']=function(_0x657403,_0x5b21ab){return db[_0xf153('0x31')][_0xf153('0x4d')](_0x657403[_0xf153('0x4e')],{})[_0xf153('0x2a')](respondWithResult(_0x5b21ab,0xc9))[_0xf153('0x4c')](handleError(_0x5b21ab,null));};exports[_0xf153('0x29')]=function(_0x3b91ed,_0x5b33a5){if(_0x3b91ed[_0xf153('0x4e')]['id']){delete _0x3b91ed['body']['id'];}return db['FreshdeskAccount']['find']({'where':{'id':_0x3b91ed[_0xf153('0x4b')]['id']}})[_0xf153('0x2a')](handleEntityNotFound(_0x5b33a5,null))['then'](saveUpdates(_0x3b91ed[_0xf153('0x4e')],null))[_0xf153('0x2a')](respondWithResult(_0x5b33a5,null))['catch'](handleError(_0x5b33a5,null));};exports[_0xf153('0x2b')]=function(_0xe6e023,_0x40b097){return db[_0xf153('0x31')][_0xf153('0x4f')]({'where':{'id':_0xe6e023[_0xf153('0x4b')]['id']}})['then'](handleEntityNotFound(_0x40b097,null))[_0xf153('0x2a')](removeEntity(_0x40b097,null))[_0xf153('0x4c')](handleError(_0x40b097,null));};exports['getConfigurations']=function(_0x566a65,_0x1a92cb,_0x8cbb80){var _0x325651={};var _0x297e9d={};var _0x419e7e;var _0x1e1c33;return db['FreshdeskAccount'][_0xf153('0x50')]({'where':{'id':_0x566a65['params']['id']}})[_0xf153('0x2a')](handleEntityNotFound(_0x1a92cb,null))[_0xf153('0x2a')](function(_0x454fff){if(_0x454fff){_0x419e7e=_0x454fff;_0x297e9d['model']=_[_0xf153('0x36')](db[_0xf153('0x51')][_0xf153('0x32')]);_0x297e9d[_0xf153('0x38')]=_[_0xf153('0x36')](_0x566a65[_0xf153('0x38')]);_0x297e9d[_0xf153('0x40')]=_['intersection'](_0x297e9d[_0xf153('0x35')],_0x297e9d[_0xf153('0x38')]);_0x325651[_0xf153('0x3a')]=_['intersection'](_0x297e9d[_0xf153('0x35')],qs[_0xf153('0x39')](_0x566a65[_0xf153('0x38')][_0xf153('0x39')]));_0x325651[_0xf153('0x3a')]=_0x325651[_0xf153('0x3a')][_0xf153('0x3b')]?_0x325651[_0xf153('0x3a')]:_0x297e9d['model'];_0x325651[_0xf153('0x3d')]=qs[_0xf153('0x3e')](_0x566a65['query'][_0xf153('0x3e')]);_0x325651[_0xf153('0x3f')]=qs[_0xf153('0x40')](_[_0xf153('0x41')](_0x566a65[_0xf153('0x38')],_0x297e9d[_0xf153('0x40')]));if(_0x566a65[_0xf153('0x38')][_0xf153('0x42')]){_0x325651[_0xf153('0x3f')]=_[_0xf153('0x43')](_0x325651[_0xf153('0x3f')],{'$or':_['map'](_0x325651[_0xf153('0x3a')],function(_0x127777){var _0x58f75d={};_0x58f75d[_0x127777]={'$like':'%'+_0x566a65[_0xf153('0x38')][_0xf153('0x42')]+'%'};return _0x58f75d;})});}_0x325651=_[_0xf153('0x43')]({},_0x325651,_0x566a65[_0xf153('0x45')]);return _0x419e7e[_0xf153('0x52')](_0x325651);}})[_0xf153('0x2a')](function(_0x2736e3){if(_0x2736e3){_0x1e1c33=_0x2736e3['length'];if(!_0x566a65[_0xf153('0x38')][_0xf153('0x53')](_0xf153('0x3c'))){_0x325651[_0xf153('0x23')]=qs[_0xf153('0x23')](_0x566a65[_0xf153('0x38')][_0xf153('0x23')]);_0x325651[_0xf153('0x22')]=qs[_0xf153('0x22')](_0x566a65['query'][_0xf153('0x22')]);}return _0x419e7e[_0xf153('0x52')](_0x325651);}})['then'](function(_0x140c41){if(_0x140c41){return _0x140c41?{'count':_0x1e1c33,'rows':_0x140c41}:null;}})['then'](respondWithResult(_0x1a92cb,null))[_0xf153('0x4c')](handleError(_0x1a92cb,null));};exports[_0xf153('0x54')]=function(_0x4ec6ad,_0x1af890,_0x55ea2b){if(_0x4ec6ad[_0xf153('0x4e')]['id']){delete _0x4ec6ad[_0xf153('0x4e')]['id'];}return db[_0xf153('0x31')][_0xf153('0x50')]({'where':{'id':_0x4ec6ad['params']['id']}})[_0xf153('0x2a')](handleEntityNotFound(_0x1af890,null))[_0xf153('0x2a')](function(_0x4be37e){if(_0x4be37e){_0x4ec6ad[_0xf153('0x4e')][_0xf153('0x55')]=_0x4be37e['id'];_0x4ec6ad[_0xf153('0x4e')][_0xf153('0x56')]=integrations[_0xf153('0x57')](_0x4ec6ad['body'][_0xf153('0x58')],_0x4ec6ad['body'][_0xf153('0x33')]);_0x4ec6ad[_0xf153('0x4e')]['Descriptions']=integrations['getDescriptions'](_0x4ec6ad[_0xf153('0x4e')][_0xf153('0x58')],_0x4ec6ad['body'][_0xf153('0x33')]);return db[_0xf153('0x51')][_0xf153('0x4d')](_0x4ec6ad['body'],{'include':[{'model':db[_0xf153('0x59')],'as':_0xf153('0x56')},{'model':db[_0xf153('0x59')],'as':_0xf153('0x5a')}]});}return null;})[_0xf153('0x2a')](respondWithResult(_0x1af890,null))[_0xf153('0x4c')](handleError(_0x1af890,null));};exports[_0xf153('0x5b')]=function(_0x364957,_0x3cde66,_0x858289){var _0x25091c='';return db[_0xf153('0x31')][_0xf153('0x50')]({'where':{'id':_0x364957[_0xf153('0x4b')]['id']},'attributes':['id',_0xf153('0x5c'),_0xf153('0x5d')]})['then'](handleEntityNotFound(_0x3cde66,null))[_0xf153('0x2a')](function(_0x54d39c){if(_0x54d39c){_0x25091c=_0x54d39c['remoteUri'];var _0x6b51d=_0x25091c['slice'](-0x1);if(_0x6b51d==='/'){_0x25091c=_0x25091c[_0xf153('0x5e')](0x0,_0x25091c[_0xf153('0x5f')](_0x6b51d));}return rp({'method':_0xf153('0x60'),'uri':util[_0xf153('0x61')](_0xf153('0x62'),_0x25091c,_0xf153('0x63')),'headers':{'Authorization':util['format'](_0xf153('0x64'),new Buffer(util[_0xf153('0x61')](_0xf153('0x65'),_0x54d39c['apiKey']))['toString'](_0xf153('0x66')))},'json':!![]});}})[_0xf153('0x2a')](function(_0x44da13){if(_0x44da13){var _0x48755d=[_0xf153('0x67'),'subject','agent',_0xf153('0x68'),_0xf153('0x1d'),_0xf153('0x69'),'group',_0xf153('0x6a'),_0xf153('0x6b'),'group',_0xf153('0x6c')];_[_0xf153('0x6d')](_0x44da13,function(_0x205a23){return _0x48755d[_0xf153('0x6e')](_0x205a23[_0xf153('0x2d')])||!_0x205a23['default']&&_0x205a23[_0xf153('0x33')]!==_0xf153('0x6f')&&_0x205a23[_0xf153('0x33')]!==_0xf153('0x70');});return{'count':_0x44da13[_0xf153('0x3b')],'rows':_[_0xf153('0x30')](_0x44da13,function(_0x2e5f2c){return{'id':_0x2e5f2c['name'],'name':_0x2e5f2c[_0xf153('0x71')],'custom':!_0x2e5f2c[_0xf153('0x72')],'options':_0x2e5f2c[_0xf153('0x73')]?_[_0xf153('0x30')](_0x2e5f2c[_0xf153('0x73')],function(_0x38faed){return{'name':_['capitalize'](_0x38faed),'value':_0x38faed};}):[]};})};}})[_0xf153('0x2a')](respondWithResult(_0x3cde66,null))[_0xf153('0x4c')](function(_0x286575){var _0x305549=_0x364957[_0xf153('0x38')][_0xf153('0x74')]?0x1f4:_0x286575[_0xf153('0x75')]||0x1f4;logger[_0xf153('0x2c')](_0xf153('0x76'),_0xf153('0x5b'),_0x305549,JSON['stringify'](_0x286575));delete _0x286575['name'];if(_0x305549===0x191){_0x305549=0x190;}_0x3cde66['status'](_0x305549)['send'](_0x364957[_0xf153('0x38')][_0xf153('0x74')]?{'message':_0xf153('0x77'),'statusCode':_0x286575[_0xf153('0x75')]}:_0x286575);});};
\ No newline at end of file
+var _0x45c8=['requester','subject','agent','description','source','group','remove','default','custom_text','custom_dropdown','label','choices','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','sendStatus','stack','name','send','index','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','catch','params','find','create','body','update','getConfigurations','findOne','FreshdeskConfiguration','order','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','FreshdeskField','Descriptions','getFields','remoteUri','slice','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey','base64'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x45c8,0xef));var _0x845c=function(_0x3777f0,_0x20ac01){_0x3777f0=_0x3777f0-0x0;var _0x11281c=_0x45c8[_0x3777f0];return _0x11281c;};'use strict';var emlformat=require(_0x845c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x845c('0x1'));var jsonpatch=require(_0x845c('0x2'));var rp=require(_0x845c('0x3'));var moment=require(_0x845c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x845c('0x5'));var csv=require(_0x845c('0x6'));var ejs=require(_0x845c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x845c('0x8'));var squel=require('squel');var crypto=require(_0x845c('0x9'));var jsforce=require(_0x845c('0xa'));var deskjs=require(_0x845c('0xb'));var toCsv=require(_0x845c('0x6'));var querystring=require(_0x845c('0xc'));var Papa=require(_0x845c('0xd'));var Redis=require(_0x845c('0xe'));var authService=require(_0x845c('0xf'));var qs=require(_0x845c('0x10'));var as=require(_0x845c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x845c('0x12'));var utils=require(_0x845c('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x845c('0x14'));var db=require(_0x845c('0x15'))['db'];var integrations=require(_0x845c('0x16'));function respondWithStatusCode(_0x3312bd,_0x469056){_0x469056=_0x469056||0xcc;return function(_0x246cef){if(_0x246cef){return _0x3312bd['sendStatus'](_0x469056);}return _0x3312bd[_0x845c('0x17')](_0x469056)[_0x845c('0x18')]();};}function respondWithResult(_0x5c0d9c,_0x185eb0){_0x185eb0=_0x185eb0||0xc8;return function(_0x3ca30e){if(_0x3ca30e){return _0x5c0d9c[_0x845c('0x17')](_0x185eb0)[_0x845c('0x19')](_0x3ca30e);}};}function respondWithFilteredResult(_0xf0cc1b,_0x27cedd){return function(_0x14b400){if(_0x14b400){var _0x4cbe3d=typeof _0x27cedd['offset']===_0x845c('0x1a')&&typeof _0x27cedd[_0x845c('0x1b')]===_0x845c('0x1a');var _0x4ac4d0=_0x14b400[_0x845c('0x1c')];var _0x104314=_0x4cbe3d?0x0:_0x27cedd[_0x845c('0x1d')];var _0x48e7d4=_0x4cbe3d?_0x14b400['count']:_0x27cedd['offset']+_0x27cedd[_0x845c('0x1b')];var _0x5171ed;if(_0x48e7d4>=_0x4ac4d0){_0x48e7d4=_0x4ac4d0;_0x5171ed=0xc8;}else{_0x5171ed=0xce;}_0xf0cc1b[_0x845c('0x17')](_0x5171ed);return _0xf0cc1b[_0x845c('0x1e')](_0x845c('0x1f'),_0x104314+'-'+_0x48e7d4+'/'+_0x4ac4d0)[_0x845c('0x19')](_0x14b400);}return null;};}function patchUpdates(_0x4629d4){return function(_0x55418b){try{jsonpatch[_0x845c('0x20')](_0x55418b,_0x4629d4,!![]);}catch(_0x513ba1){return BPromise[_0x845c('0x21')](_0x513ba1);}return _0x55418b['save']();};}function saveUpdates(_0x2c6bc8,_0x5767e8){return function(_0x18ed7c){if(_0x18ed7c){return _0x18ed7c['update'](_0x2c6bc8)[_0x845c('0x22')](function(_0x21dfef){return _0x21dfef;});}return null;};}function removeEntity(_0x362975,_0x129b6e){return function(_0x132516){if(_0x132516){return _0x132516[_0x845c('0x23')]()['then'](function(){_0x362975[_0x845c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26327b,_0x28f05d){return function(_0x49a2ef){if(!_0x49a2ef){_0x26327b[_0x845c('0x24')](0x194);}return _0x49a2ef;};}function handleError(_0x236529,_0x189c19){_0x189c19=_0x189c19||0x1f4;return function(_0x5ca436){logger['error'](_0x5ca436[_0x845c('0x25')]);if(_0x5ca436[_0x845c('0x26')]){delete _0x5ca436[_0x845c('0x26')];}_0x236529['status'](_0x189c19)[_0x845c('0x27')](_0x5ca436);};}exports[_0x845c('0x28')]=function(_0x447d69,_0x2ba824){var _0x5d7b58={},_0x19a44b={},_0x2003f6={'count':0x0,'rows':[]};var _0x32ba01=_['map'](db[_0x845c('0x29')][_0x845c('0x2a')],function(_0x578d3b){return{'name':_0x578d3b[_0x845c('0x2b')],'type':_0x578d3b[_0x845c('0x2c')][_0x845c('0x2d')]};});_0x19a44b[_0x845c('0x2e')]=_['map'](_0x32ba01,'name');_0x19a44b[_0x845c('0x2f')]=_[_0x845c('0x30')](_0x447d69[_0x845c('0x2f')]);_0x19a44b[_0x845c('0x31')]=_[_0x845c('0x32')](_0x19a44b[_0x845c('0x2e')],_0x19a44b[_0x845c('0x2f')]);_0x5d7b58[_0x845c('0x33')]=_[_0x845c('0x32')](_0x19a44b[_0x845c('0x2e')],qs[_0x845c('0x34')](_0x447d69['query'][_0x845c('0x34')]));_0x5d7b58['attributes']=_0x5d7b58[_0x845c('0x33')][_0x845c('0x35')]?_0x5d7b58[_0x845c('0x33')]:_0x19a44b[_0x845c('0x2e')];if(!_0x447d69[_0x845c('0x2f')]['hasOwnProperty'](_0x845c('0x36'))){_0x5d7b58[_0x845c('0x1b')]=qs['limit'](_0x447d69['query'][_0x845c('0x1b')]);_0x5d7b58['offset']=qs[_0x845c('0x1d')](_0x447d69['query'][_0x845c('0x1d')]);}_0x5d7b58['order']=qs['sort'](_0x447d69[_0x845c('0x2f')][_0x845c('0x37')]);_0x5d7b58[_0x845c('0x38')]=qs[_0x845c('0x31')](_[_0x845c('0x39')](_0x447d69[_0x845c('0x2f')],_0x19a44b['filters']),_0x32ba01);if(_0x447d69[_0x845c('0x2f')]['filter']){_0x5d7b58[_0x845c('0x38')]=_[_0x845c('0x3a')](_0x5d7b58[_0x845c('0x38')],{'$or':_[_0x845c('0x3b')](_0x32ba01,function(_0x3563e8){if(_0x3563e8[_0x845c('0x2c')]!==_0x845c('0x3c')){var _0x3510cc={};_0x3510cc[_0x3563e8[_0x845c('0x26')]]={'$like':'%'+_0x447d69['query'][_0x845c('0x3d')]+'%'};return _0x3510cc;}})});}_0x5d7b58=_[_0x845c('0x3a')]({},_0x5d7b58,_0x447d69[_0x845c('0x3e')]);var _0x20227d={'where':_0x5d7b58[_0x845c('0x38')]};return db[_0x845c('0x29')][_0x845c('0x1c')](_0x20227d)[_0x845c('0x22')](function(_0x22b604){_0x2003f6[_0x845c('0x1c')]=_0x22b604;if(_0x447d69['query'][_0x845c('0x3f')]){_0x5d7b58[_0x845c('0x40')]=[{'all':!![]}];}return db[_0x845c('0x29')][_0x845c('0x41')](_0x5d7b58);})['then'](function(_0x12907e){_0x2003f6['rows']=_0x12907e;return _0x2003f6;})['then'](respondWithFilteredResult(_0x2ba824,_0x5d7b58))[_0x845c('0x42')](handleError(_0x2ba824,null));};exports['show']=function(_0x54d515,_0x4435b8){var _0x1022ad={'raw':![],'where':{'id':_0x54d515[_0x845c('0x43')]['id']}},_0x3d0cad={};_0x3d0cad['model']=_['keys'](db['FreshdeskAccount'][_0x845c('0x2a')]);_0x3d0cad[_0x845c('0x2f')]=_['keys'](_0x54d515['query']);_0x3d0cad[_0x845c('0x31')]=_[_0x845c('0x32')](_0x3d0cad[_0x845c('0x2e')],_0x3d0cad[_0x845c('0x2f')]);_0x1022ad['attributes']=_[_0x845c('0x32')](_0x3d0cad[_0x845c('0x2e')],qs[_0x845c('0x34')](_0x54d515['query'][_0x845c('0x34')]));_0x1022ad[_0x845c('0x33')]=_0x1022ad[_0x845c('0x33')][_0x845c('0x35')]?_0x1022ad[_0x845c('0x33')]:_0x3d0cad['model'];if(_0x54d515[_0x845c('0x2f')]['includeAll']){_0x1022ad[_0x845c('0x40')]=[{'all':!![]}];}_0x1022ad=_[_0x845c('0x3a')]({},_0x1022ad,_0x54d515[_0x845c('0x3e')]);return db[_0x845c('0x29')][_0x845c('0x44')](_0x1022ad)[_0x845c('0x22')](handleEntityNotFound(_0x4435b8,null))[_0x845c('0x22')](respondWithResult(_0x4435b8,null))[_0x845c('0x42')](handleError(_0x4435b8,null));};exports[_0x845c('0x45')]=function(_0x4c706b,_0xeb86a5){return db['FreshdeskAccount'][_0x845c('0x45')](_0x4c706b[_0x845c('0x46')],{})[_0x845c('0x22')](respondWithResult(_0xeb86a5,0xc9))[_0x845c('0x42')](handleError(_0xeb86a5,null));};exports[_0x845c('0x47')]=function(_0x380b74,_0xde0287){if(_0x380b74[_0x845c('0x46')]['id']){delete _0x380b74[_0x845c('0x46')]['id'];}return db[_0x845c('0x29')][_0x845c('0x44')]({'where':{'id':_0x380b74[_0x845c('0x43')]['id']}})[_0x845c('0x22')](handleEntityNotFound(_0xde0287,null))[_0x845c('0x22')](saveUpdates(_0x380b74[_0x845c('0x46')],null))[_0x845c('0x22')](respondWithResult(_0xde0287,null))['catch'](handleError(_0xde0287,null));};exports[_0x845c('0x23')]=function(_0x1f2f80,_0x41a4c9){return db[_0x845c('0x29')][_0x845c('0x44')]({'where':{'id':_0x1f2f80[_0x845c('0x43')]['id']}})[_0x845c('0x22')](handleEntityNotFound(_0x41a4c9,null))['then'](removeEntity(_0x41a4c9,null))['catch'](handleError(_0x41a4c9,null));};exports[_0x845c('0x48')]=function(_0x3b5059,_0x3a8a67,_0x526dba){var _0x4766f2={};var _0xed4ab2={};var _0x369ff6;var _0x4b582c;return db['FreshdeskAccount'][_0x845c('0x49')]({'where':{'id':_0x3b5059[_0x845c('0x43')]['id']}})['then'](handleEntityNotFound(_0x3a8a67,null))[_0x845c('0x22')](function(_0x5f39a7){if(_0x5f39a7){_0x369ff6=_0x5f39a7;_0xed4ab2[_0x845c('0x2e')]=_[_0x845c('0x30')](db[_0x845c('0x4a')][_0x845c('0x2a')]);_0xed4ab2[_0x845c('0x2f')]=_['keys'](_0x3b5059['query']);_0xed4ab2[_0x845c('0x31')]=_['intersection'](_0xed4ab2[_0x845c('0x2e')],_0xed4ab2[_0x845c('0x2f')]);_0x4766f2[_0x845c('0x33')]=_[_0x845c('0x32')](_0xed4ab2['model'],qs[_0x845c('0x34')](_0x3b5059[_0x845c('0x2f')][_0x845c('0x34')]));_0x4766f2[_0x845c('0x33')]=_0x4766f2['attributes'][_0x845c('0x35')]?_0x4766f2[_0x845c('0x33')]:_0xed4ab2[_0x845c('0x2e')];_0x4766f2[_0x845c('0x4b')]=qs[_0x845c('0x37')](_0x3b5059[_0x845c('0x2f')]['sort']);_0x4766f2['where']=qs['filters'](_['pick'](_0x3b5059[_0x845c('0x2f')],_0xed4ab2[_0x845c('0x31')]));if(_0x3b5059[_0x845c('0x2f')][_0x845c('0x3d')]){_0x4766f2['where']=_[_0x845c('0x3a')](_0x4766f2[_0x845c('0x38')],{'$or':_['map'](_0x4766f2[_0x845c('0x33')],function(_0x540dda){var _0x5e0ded={};_0x5e0ded[_0x540dda]={'$like':'%'+_0x3b5059[_0x845c('0x2f')][_0x845c('0x3d')]+'%'};return _0x5e0ded;})});}_0x4766f2=_[_0x845c('0x3a')]({},_0x4766f2,_0x3b5059[_0x845c('0x3e')]);return _0x369ff6['getConfigurations'](_0x4766f2);}})['then'](function(_0x30017d){if(_0x30017d){_0x4b582c=_0x30017d[_0x845c('0x35')];if(!_0x3b5059[_0x845c('0x2f')]['hasOwnProperty'](_0x845c('0x36'))){_0x4766f2[_0x845c('0x1b')]=qs[_0x845c('0x1b')](_0x3b5059['query'][_0x845c('0x1b')]);_0x4766f2[_0x845c('0x1d')]=qs[_0x845c('0x1d')](_0x3b5059['query'][_0x845c('0x1d')]);}return _0x369ff6['getConfigurations'](_0x4766f2);}})[_0x845c('0x22')](function(_0x463f09){if(_0x463f09){return _0x463f09?{'count':_0x4b582c,'rows':_0x463f09}:null;}})[_0x845c('0x22')](respondWithResult(_0x3a8a67,null))[_0x845c('0x42')](handleError(_0x3a8a67,null));};exports[_0x845c('0x4c')]=function(_0x709945,_0x413ddc,_0xb3e7f){if(_0x709945[_0x845c('0x46')]['id']){delete _0x709945[_0x845c('0x46')]['id'];}return db[_0x845c('0x29')][_0x845c('0x49')]({'where':{'id':_0x709945[_0x845c('0x43')]['id']}})['then'](handleEntityNotFound(_0x413ddc,null))[_0x845c('0x22')](function(_0x439e2c){if(_0x439e2c){_0x709945['body'][_0x845c('0x4d')]=_0x439e2c['id'];_0x709945[_0x845c('0x46')][_0x845c('0x4e')]=integrations[_0x845c('0x4f')](_0x709945['body']['channel'],_0x709945[_0x845c('0x46')][_0x845c('0x2c')]);_0x709945[_0x845c('0x46')]['Descriptions']=integrations[_0x845c('0x50')](_0x709945[_0x845c('0x46')]['channel'],_0x709945[_0x845c('0x46')][_0x845c('0x2c')]);return db[_0x845c('0x4a')][_0x845c('0x45')](_0x709945[_0x845c('0x46')],{'include':[{'model':db[_0x845c('0x51')],'as':_0x845c('0x4e')},{'model':db[_0x845c('0x51')],'as':_0x845c('0x52')}]});}return null;})[_0x845c('0x22')](respondWithResult(_0x413ddc,null))[_0x845c('0x42')](handleError(_0x413ddc,null));};exports[_0x845c('0x53')]=function(_0x2eda3e,_0x1a50f9,_0x25bcc0){var _0x41c577='';return db[_0x845c('0x29')][_0x845c('0x49')]({'where':{'id':_0x2eda3e[_0x845c('0x43')]['id']},'attributes':['id',_0x845c('0x54'),'apiKey']})[_0x845c('0x22')](handleEntityNotFound(_0x1a50f9,null))[_0x845c('0x22')](function(_0x321574){if(_0x321574){_0x41c577=_0x321574[_0x845c('0x54')];var _0x248dff=_0x41c577[_0x845c('0x55')](-0x1);if(_0x248dff==='/'){_0x41c577=_0x41c577['substring'](0x0,_0x41c577['lastIndexOf'](_0x248dff));}return rp({'method':_0x845c('0x56'),'uri':util[_0x845c('0x57')](_0x845c('0x58'),_0x41c577,_0x845c('0x59')),'headers':{'Authorization':util[_0x845c('0x57')](_0x845c('0x5a'),new Buffer(util[_0x845c('0x57')](_0x845c('0x5b'),_0x321574[_0x845c('0x5c')]))['toString'](_0x845c('0x5d')))},'json':!![]});}})['then'](function(_0x457036){if(_0x457036){var _0x1f340e=[_0x845c('0x5e'),_0x845c('0x5f'),_0x845c('0x60'),_0x845c('0x61'),_0x845c('0x17'),'priority','group',_0x845c('0x62'),'ticket_type',_0x845c('0x63'),'company'];_[_0x845c('0x64')](_0x457036,function(_0x4ddde7){return _0x1f340e['includes'](_0x4ddde7['name'])||!_0x4ddde7[_0x845c('0x65')]&&_0x4ddde7[_0x845c('0x2c')]!==_0x845c('0x66')&&_0x4ddde7[_0x845c('0x2c')]!==_0x845c('0x67');});return{'count':_0x457036[_0x845c('0x35')],'rows':_[_0x845c('0x3b')](_0x457036,function(_0x2b4aab){return{'id':_0x2b4aab[_0x845c('0x26')],'name':_0x2b4aab[_0x845c('0x68')],'custom':!_0x2b4aab['default'],'options':_0x2b4aab['choices']?_['map'](_0x2b4aab[_0x845c('0x69')],function(_0x240ddb){return{'name':_['capitalize'](_0x240ddb),'value':_0x240ddb};}):[]};})};}})[_0x845c('0x22')](respondWithResult(_0x1a50f9,null))[_0x845c('0x42')](function(_0x1a4e34){var _0x10b298=_0x2eda3e['query'][_0x845c('0x6a')]?0x1f4:_0x1a4e34[_0x845c('0x6b')]||0x1f4;logger[_0x845c('0x6c')](_0x845c('0x6d'),_0x845c('0x53'),_0x10b298,JSON['stringify'](_0x1a4e34));delete _0x1a4e34['name'];if(_0x10b298===0x191){_0x10b298=0x190;}_0x1a50f9[_0x845c('0x17')](_0x10b298)[_0x845c('0x27')](_0x2eda3e[_0x845c('0x2f')][_0x845c('0x6a')]?{'message':_0x845c('0x6e'),'statusCode':_0x1a4e34[_0x845c('0x6b')]}:_0x1a4e34);});};
\ No newline at end of file
index 5a7b69a..fd57c74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3794=['rimraf','../../config/environment','./intFreshdeskAccount.attributes','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','api','moment','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3794,0x1eb));var _0x4379=function(_0x319a03,_0x4456d4){_0x319a03=_0x319a03-0x0;var _0x3b6704=_0x3794[_0x319a03];return _0x3b6704;};'use strict';var _=require(_0x4379('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4379('0x1'));var moment=require(_0x4379('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4379('0x3'));var rimraf=require(_0x4379('0x4'));var config=require(_0x4379('0x5'));var attributes=require(_0x4379('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x4379('0x7')]=function(_0x53e0b4,_0x34df5e){return _0x53e0b4[_0x4379('0x8')](_0x4379('0x9'),attributes,{'tableName':_0x4379('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9700=['moment','bluebird','path','rimraf','./intFreshdeskAccount.attributes','exports','define','FreshdeskAccount','int_freshdesk_accounts','../../config/logger','api'];(function(_0x1c6aa3,_0x1df236){var _0x409780=function(_0x3f4250){while(--_0x3f4250){_0x1c6aa3['push'](_0x1c6aa3['shift']());}};_0x409780(++_0x1df236);}(_0x9700,0xe5));var _0x0970=function(_0x2b828b,_0xa60b46){_0x2b828b=_0x2b828b-0x0;var _0x10cc90=_0x9700[_0x2b828b];return _0x10cc90;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0970('0x0'))(_0x0970('0x1'));var moment=require(_0x0970('0x2'));var BPromise=require(_0x0970('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0970('0x4'));var rimraf=require(_0x0970('0x5'));var config=require('../../config/environment');var attributes=require(_0x0970('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x0970('0x7')]=function(_0x44ea33,_0x20d12b){return _0x44ea33[_0x0970('0x8')](_0x0970('0x9'),attributes,{'tableName':_0x0970('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4ffaa8a..bc8ec69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0333=['FreshdeskAccount','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','findAll','options','where','attributes','limit','include','map','model','GetFreshdeskAccount','ShowFreshdeskAccount'];(function(_0x5ce850,_0x28bfe5){var _0x12753a=function(_0x5eacdb){while(--_0x5eacdb){_0x5ce850['push'](_0x5ce850['shift']());}};_0x12753a(++_0x28bfe5);}(_0x0333,0xe0));var _0x3033=function(_0x400322,_0x4353a8){_0x400322=_0x400322-0x0;var _0xfdd597=_0x0333[_0x400322];return _0xfdd597;};'use strict';var _=require(_0x3033('0x0'));var util=require(_0x3033('0x1'));var moment=require(_0x3033('0x2'));var BPromise=require(_0x3033('0x3'));var rs=require(_0x3033('0x4'));var fs=require('fs');var Redis=require(_0x3033('0x5'));var db=require(_0x3033('0x6'))['db'];var utils=require(_0x3033('0x7'));var logger=require('../../config/logger')(_0x3033('0x8'));var config=require('../../config/environment');var jayson=require(_0x3033('0x9'));var client=jayson[_0x3033('0xa')][_0x3033('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d8ef3,_0x4b2cc3,_0x1fc984){return new BPromise(function(_0xd757b4,_0x1fcf6f){return client[_0x3033('0xc')](_0x3d8ef3,_0x1fc984)[_0x3033('0xd')](function(_0x106231){logger['info'](_0x3033('0xe'),_0x4b2cc3,_0x3033('0xf'));logger[_0x3033('0x10')](_0x3033('0x11'),_0x4b2cc3,_0x3033('0xf'),JSON[_0x3033('0x12')](_0x106231));if(_0x106231[_0x3033('0x13')]){if(_0x106231['error'][_0x3033('0x14')]===0x1f4){logger['error'](_0x3033('0xe'),_0x4b2cc3,_0x106231['error'][_0x3033('0x15')]);return _0x1fcf6f(_0x106231['error'][_0x3033('0x15')]);}logger[_0x3033('0x13')](_0x3033('0xe'),_0x4b2cc3,_0x106231[_0x3033('0x13')][_0x3033('0x15')]);return _0xd757b4(_0x106231['error']['message']);}else{logger[_0x3033('0x16')](_0x3033('0xe'),_0x4b2cc3,_0x3033('0xf'));_0xd757b4(_0x106231[_0x3033('0x17')][_0x3033('0x15')]);}})[_0x3033('0x18')](function(_0x353eb8){logger[_0x3033('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x4b2cc3,_0x353eb8);_0x1fcf6f(_0x353eb8);});});}exports['GetFreshdeskAccount']=function(_0x4f34a1){var _0x248b64=this;return new Promise(function(_0x1edac4,_0x403005){return db['FreshdeskAccount'][_0x3033('0x19')]({'raw':_0x4f34a1['options']?_0x4f34a1[_0x3033('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4f34a1[_0x3033('0x1a')]?_0x4f34a1['options'][_0x3033('0x1b')]||null:null,'attributes':_0x4f34a1[_0x3033('0x1a')]?_0x4f34a1[_0x3033('0x1a')][_0x3033('0x1c')]||null:null,'limit':_0x4f34a1[_0x3033('0x1a')]?_0x4f34a1[_0x3033('0x1a')][_0x3033('0x1d')]||null:null,'include':_0x4f34a1[_0x3033('0x1a')]?_0x4f34a1[_0x3033('0x1a')][_0x3033('0x1e')]?_[_0x3033('0x1f')](_0x4f34a1[_0x3033('0x1a')][_0x3033('0x1e')],function(_0xa25466){return{'model':db[_0xa25466[_0x3033('0x20')]],'as':_0xa25466['as'],'attributes':_0xa25466[_0x3033('0x1c')],'include':_0xa25466[_0x3033('0x1e')]?_[_0x3033('0x1f')](_0xa25466['include'],function(_0x19707f){return{'model':db[_0x19707f[_0x3033('0x20')]],'as':_0x19707f['as'],'attributes':_0x19707f[_0x3033('0x1c')],'include':_0x19707f[_0x3033('0x1e')]?_['map'](_0x19707f[_0x3033('0x1e')],function(_0x4f705c){return{'model':db[_0x4f705c[_0x3033('0x20')]],'as':_0x4f705c['as'],'attributes':_0x4f705c['attributes']};}):[]};}):[]};}):[]:[]})[_0x3033('0xd')](function(_0x3d75e3){logger[_0x3033('0x16')](_0x3033('0x21'),_0x4f34a1);logger[_0x3033('0x10')]('GetFreshdeskAccount',_0x4f34a1,JSON[_0x3033('0x12')](_0x3d75e3));_0x1edac4(_0x3d75e3);})[_0x3033('0x18')](function(_0x5554a4){logger[_0x3033('0x13')](_0x3033('0x21'),_0x5554a4[_0x3033('0x15')],_0x4f34a1);_0x403005(_0x248b64[_0x3033('0x13')](0x1f4,_0x5554a4[_0x3033('0x15')]));});});};exports[_0x3033('0x22')]=function(_0x1a002f){var _0x3e2dd8=this;return new Promise(function(_0x5bd1e1,_0x36f2a0){return db[_0x3033('0x23')]['find']({'raw':_0x1a002f[_0x3033('0x1a')]?_0x1a002f['options'][_0x3033('0x24')]===undefined?!![]:![]:!![],'where':_0x1a002f['options']?_0x1a002f[_0x3033('0x1a')][_0x3033('0x1b')]||null:null,'attributes':_0x1a002f[_0x3033('0x1a')]?_0x1a002f[_0x3033('0x1a')]['attributes']||null:null,'include':_0x1a002f[_0x3033('0x1a')]?_0x1a002f[_0x3033('0x1a')][_0x3033('0x1e')]?_[_0x3033('0x1f')](_0x1a002f[_0x3033('0x1a')][_0x3033('0x1e')],function(_0x247181){return{'model':db[_0x247181[_0x3033('0x20')]],'as':_0x247181['as'],'attributes':_0x247181['attributes'],'include':_0x247181[_0x3033('0x1e')]?_[_0x3033('0x1f')](_0x247181['include'],function(_0x50e720){return{'model':db[_0x50e720['model']],'as':_0x50e720['as'],'attributes':_0x50e720['attributes'],'include':_0x50e720['include']?_[_0x3033('0x1f')](_0x50e720['include'],function(_0x3acd53){return{'model':db[_0x3acd53[_0x3033('0x20')]],'as':_0x3acd53['as'],'attributes':_0x3acd53[_0x3033('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3033('0xd')](function(_0x17f677){logger[_0x3033('0x16')](_0x3033('0x22'),_0x1a002f);logger[_0x3033('0x10')](_0x3033('0x22'),_0x1a002f,JSON[_0x3033('0x12')](_0x17f677));_0x5bd1e1(_0x17f677);})[_0x3033('0x18')](function(_0xe88d33){logger['error'](_0x3033('0x22'),_0xe88d33['message'],_0x1a002f);_0x36f2a0(_0x3e2dd8['error'](0x1f4,_0xe88d33[_0x3033('0x15')]));});});};
\ No newline at end of file
+var _0xa641=['../../config/environment','jayson/promise','client','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','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','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x4a540e,_0x4ee48a){var _0x577c24=function(_0xd453cb){while(--_0xd453cb){_0x4a540e['push'](_0x4a540e['shift']());}};_0x577c24(++_0x4ee48a);}(_0xa641,0x134));var _0x1a64=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xa641[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0x1a64('0x0'));var util=require(_0x1a64('0x1'));var moment=require(_0x1a64('0x2'));var BPromise=require('bluebird');var rs=require(_0x1a64('0x3'));var fs=require('fs');var Redis=require(_0x1a64('0x4'));var db=require(_0x1a64('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1a64('0x6'))('rpc');var config=require(_0x1a64('0x7'));var jayson=require(_0x1a64('0x8'));var client=jayson[_0x1a64('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32a571,_0xa1bb7c,_0x454d97){return new BPromise(function(_0xc2c2ef,_0x532aa1){return client[_0x1a64('0xa')](_0x32a571,_0x454d97)[_0x1a64('0xb')](function(_0x18baca){logger[_0x1a64('0xc')](_0x1a64('0xd'),_0xa1bb7c,_0x1a64('0xe'));logger['debug'](_0x1a64('0xf'),_0xa1bb7c,_0x1a64('0xe'),JSON[_0x1a64('0x10')](_0x18baca));if(_0x18baca[_0x1a64('0x11')]){if(_0x18baca['error'][_0x1a64('0x12')]===0x1f4){logger[_0x1a64('0x11')](_0x1a64('0xd'),_0xa1bb7c,_0x18baca[_0x1a64('0x11')][_0x1a64('0x13')]);return _0x532aa1(_0x18baca[_0x1a64('0x11')]['message']);}logger[_0x1a64('0x11')](_0x1a64('0xd'),_0xa1bb7c,_0x18baca[_0x1a64('0x11')]['message']);return _0xc2c2ef(_0x18baca[_0x1a64('0x11')][_0x1a64('0x13')]);}else{logger[_0x1a64('0xc')](_0x1a64('0xd'),_0xa1bb7c,_0x1a64('0xe'));_0xc2c2ef(_0x18baca['result'][_0x1a64('0x13')]);}})[_0x1a64('0x14')](function(_0x495648){logger[_0x1a64('0x11')](_0x1a64('0xd'),_0xa1bb7c,_0x495648);_0x532aa1(_0x495648);});});}exports[_0x1a64('0x15')]=function(_0x1b174e){var _0x31616e=this;return new Promise(function(_0x2c9d95,_0x3270e5){return db[_0x1a64('0x16')][_0x1a64('0x17')]({'raw':_0x1b174e[_0x1a64('0x18')]?_0x1b174e['options'][_0x1a64('0x19')]===undefined?!![]:![]:!![],'where':_0x1b174e['options']?_0x1b174e[_0x1a64('0x18')][_0x1a64('0x1a')]||null:null,'attributes':_0x1b174e[_0x1a64('0x18')]?_0x1b174e['options'][_0x1a64('0x1b')]||null:null,'limit':_0x1b174e[_0x1a64('0x18')]?_0x1b174e[_0x1a64('0x18')][_0x1a64('0x1c')]||null:null,'include':_0x1b174e[_0x1a64('0x18')]?_0x1b174e[_0x1a64('0x18')][_0x1a64('0x1d')]?_[_0x1a64('0x1e')](_0x1b174e[_0x1a64('0x18')][_0x1a64('0x1d')],function(_0x201573){return{'model':db[_0x201573[_0x1a64('0x1f')]],'as':_0x201573['as'],'attributes':_0x201573[_0x1a64('0x1b')],'include':_0x201573[_0x1a64('0x1d')]?_['map'](_0x201573[_0x1a64('0x1d')],function(_0x1cba52){return{'model':db[_0x1cba52['model']],'as':_0x1cba52['as'],'attributes':_0x1cba52[_0x1a64('0x1b')],'include':_0x1cba52[_0x1a64('0x1d')]?_[_0x1a64('0x1e')](_0x1cba52['include'],function(_0x207ce5){return{'model':db[_0x207ce5[_0x1a64('0x1f')]],'as':_0x207ce5['as'],'attributes':_0x207ce5[_0x1a64('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1a64('0xb')](function(_0x435849){logger[_0x1a64('0xc')](_0x1a64('0x15'),_0x1b174e);logger['debug'](_0x1a64('0x15'),_0x1b174e,JSON[_0x1a64('0x10')](_0x435849));_0x2c9d95(_0x435849);})[_0x1a64('0x14')](function(_0x3d3494){logger[_0x1a64('0x11')](_0x1a64('0x15'),_0x3d3494[_0x1a64('0x13')],_0x1b174e);_0x3270e5(_0x31616e['error'](0x1f4,_0x3d3494['message']));});});};exports[_0x1a64('0x20')]=function(_0xbded14){var _0x58f3c4=this;return new Promise(function(_0x330170,_0x4e1e3f){return db[_0x1a64('0x16')][_0x1a64('0x21')]({'raw':_0xbded14['options']?_0xbded14[_0x1a64('0x18')][_0x1a64('0x19')]===undefined?!![]:![]:!![],'where':_0xbded14[_0x1a64('0x18')]?_0xbded14[_0x1a64('0x18')][_0x1a64('0x1a')]||null:null,'attributes':_0xbded14[_0x1a64('0x18')]?_0xbded14[_0x1a64('0x18')][_0x1a64('0x1b')]||null:null,'include':_0xbded14['options']?_0xbded14[_0x1a64('0x18')][_0x1a64('0x1d')]?_[_0x1a64('0x1e')](_0xbded14[_0x1a64('0x18')]['include'],function(_0x50b9f1){return{'model':db[_0x50b9f1[_0x1a64('0x1f')]],'as':_0x50b9f1['as'],'attributes':_0x50b9f1['attributes'],'include':_0x50b9f1['include']?_[_0x1a64('0x1e')](_0x50b9f1[_0x1a64('0x1d')],function(_0x59cca6){return{'model':db[_0x59cca6['model']],'as':_0x59cca6['as'],'attributes':_0x59cca6['attributes'],'include':_0x59cca6['include']?_[_0x1a64('0x1e')](_0x59cca6[_0x1a64('0x1d')],function(_0x469146){return{'model':db[_0x469146[_0x1a64('0x1f')]],'as':_0x469146['as'],'attributes':_0x469146[_0x1a64('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1a64('0xb')](function(_0x3dd29d){logger[_0x1a64('0xc')](_0x1a64('0x20'),_0xbded14);logger[_0x1a64('0x22')]('ShowFreshdeskAccount',_0xbded14,JSON['stringify'](_0x3dd29d));_0x330170(_0x3dd29d);})['catch'](function(_0x4934c0){logger[_0x1a64('0x11')](_0x1a64('0x20'),_0x4934c0[_0x1a64('0x13')],_0xbded14);_0x4e1e3f(_0x58f3c4['error'](0x1f4,_0x4934c0[_0x1a64('0x13')]));});});};
\ No newline at end of file
index a556513..2bedde9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8b2=['get','isAuthenticated','index','show','getFields','getSubjects','/:id/descriptions','/:id/tags','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intFreshdeskConfiguration.controller'];(function(_0x75e143,_0x218710){var _0xdddfdb=function(_0x32d694){while(--_0x32d694){_0x75e143['push'](_0x75e143['shift']());}};_0xdddfdb(++_0x218710);}(_0xa8b2,0x147));var _0x2a8b=function(_0x485f4f,_0x1e21ce){_0x485f4f=_0x485f4f-0x0;var _0x5936cb=_0xa8b2[_0x485f4f];return _0x5936cb;};'use strict';var multer=require(_0x2a8b('0x0'));var util=require(_0x2a8b('0x1'));var path=require(_0x2a8b('0x2'));var timeout=require(_0x2a8b('0x3'));var express=require(_0x2a8b('0x4'));var router=express[_0x2a8b('0x5')]();var fs_extra=require(_0x2a8b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2a8b('0x7'));var config=require('../../config/environment');var controller=require(_0x2a8b('0x8'));router[_0x2a8b('0x9')]('/',auth[_0x2a8b('0xa')](),controller[_0x2a8b('0xb')]);router['get']('/:id',auth[_0x2a8b('0xa')](),controller[_0x2a8b('0xc')]);router[_0x2a8b('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2a8b('0xd')]);router[_0x2a8b('0x9')]('/:id/subjects',auth[_0x2a8b('0xa')](),controller[_0x2a8b('0xe')]);router[_0x2a8b('0x9')](_0x2a8b('0xf'),auth[_0x2a8b('0xa')](),controller['getDescriptions']);router[_0x2a8b('0x9')](_0x2a8b('0x10'),auth[_0x2a8b('0xa')](),controller['getTags']);router[_0x2a8b('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2a8b('0x11')](_0x2a8b('0x10'),auth['isAuthenticated'](),controller['setTags']);router[_0x2a8b('0x12')](_0x2a8b('0x13'),auth[_0x2a8b('0xa')](),controller[_0x2a8b('0x14')]);router[_0x2a8b('0x15')](_0x2a8b('0x13'),auth[_0x2a8b('0xa')](),controller[_0x2a8b('0x16')]);module[_0x2a8b('0x17')]=router;
\ No newline at end of file
+var _0xe0bb=['get','/:id','isAuthenticated','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller'];(function(_0xd063f7,_0x3be0d1){var _0x1edb87=function(_0x2c2607){while(--_0x2c2607){_0xd063f7['push'](_0xd063f7['shift']());}};_0x1edb87(++_0x3be0d1);}(_0xe0bb,0xd9));var _0xbe0b=function(_0x1a3243,_0x201872){_0x1a3243=_0x1a3243-0x0;var _0x33f2ca=_0xe0bb[_0x1a3243];return _0x33f2ca;};'use strict';var multer=require('multer');var util=require(_0xbe0b('0x0'));var path=require(_0xbe0b('0x1'));var timeout=require('connect-timeout');var express=require(_0xbe0b('0x2'));var router=express[_0xbe0b('0x3')]();var fs_extra=require(_0xbe0b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbe0b('0x5'));var config=require(_0xbe0b('0x6'));var controller=require(_0xbe0b('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xbe0b('0x8')](_0xbe0b('0x9'),auth[_0xbe0b('0xa')](),controller['show']);router[_0xbe0b('0x8')](_0xbe0b('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0xbe0b('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xbe0b('0xc')]);router[_0xbe0b('0x8')](_0xbe0b('0xd'),auth[_0xbe0b('0xa')](),controller[_0xbe0b('0xe')]);router[_0xbe0b('0x8')]('/:id/tags',auth['isAuthenticated'](),controller[_0xbe0b('0xf')]);router[_0xbe0b('0x10')]('/',auth[_0xbe0b('0xa')](),controller[_0xbe0b('0x11')]);router[_0xbe0b('0x10')](_0xbe0b('0x12'),auth['isAuthenticated'](),controller[_0xbe0b('0x13')]);router[_0xbe0b('0x14')](_0xbe0b('0x9'),auth[_0xbe0b('0xa')](),controller[_0xbe0b('0x15')]);router[_0xbe0b('0x16')](_0xbe0b('0x9'),auth[_0xbe0b('0xa')](),controller[_0xbe0b('0x17')]);module[_0xbe0b('0x18')]=router;
\ No newline at end of file
index 6ad6cad..3791241 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf129=['STRING','sequelize','exports'];(function(_0x2716c6,_0x38dd17){var _0x518dc2=function(_0x36e9e9){while(--_0x36e9e9){_0x2716c6['push'](_0x2716c6['shift']());}};_0x518dc2(++_0x38dd17);}(_0xf129,0x106));var _0x9f12=function(_0x5806ee,_0xf669f3){_0x5806ee=_0x5806ee-0x0;var _0x5e624f=_0xf129[_0x5806ee];return _0x5e624f;};'use strict';var Sequelize=require(_0x9f12('0x0'));module[_0x9f12('0x1')]={'name':{'type':Sequelize[_0x9f12('0x2')]},'description':{'type':Sequelize[_0x9f12('0x2')]}};
\ No newline at end of file
+var _0x5abd=['exports','STRING','sequelize'];(function(_0x52b844,_0x434e67){var _0x14432f=function(_0x6b692a){while(--_0x6b692a){_0x52b844['push'](_0x52b844['shift']());}};_0x14432f(++_0x434e67);}(_0x5abd,0x11f));var _0xd5ab=function(_0x52cf9a,_0x400349){_0x52cf9a=_0x52cf9a-0x0;var _0x3589cb=_0x5abd[_0x52cf9a];return _0x3589cb;};'use strict';var Sequelize=require(_0xd5ab('0x0'));module[_0xd5ab('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd5ab('0x2')]}};
\ No newline at end of file
index aae185e..fceb77b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a03=['where','filters','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','keys','FreshdeskConfiguration','find','create','body','params','findOne','pick','getFields','getSubjects','getDescriptions','FreshdeskField','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','save','update','destroy','end','error','name','send','rawAttributes','fieldName','type','key','model','map','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x4e3ffc,_0x570704){var _0x543119=function(_0x396abb){while(--_0x396abb){_0x4e3ffc['push'](_0x4e3ffc['shift']());}};_0x543119(++_0x570704);}(_0x0a03,0x1cb));var _0x30a0=function(_0x527499,_0xcab30c){_0x527499=_0x527499-0x0;var _0x2c15ce=_0x0a03[_0x527499];return _0x2c15ce;};'use strict';var emlformat=require(_0x30a0('0x0'));var rimraf=require(_0x30a0('0x1'));var zipdir=require(_0x30a0('0x2'));var jsonpatch=require(_0x30a0('0x3'));var rp=require(_0x30a0('0x4'));var moment=require(_0x30a0('0x5'));var BPromise=require(_0x30a0('0x6'));var Mustache=require(_0x30a0('0x7'));var util=require(_0x30a0('0x8'));var path=require('path');var sox=require(_0x30a0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x30a0('0xa'));var squel=require(_0x30a0('0xb'));var crypto=require(_0x30a0('0xc'));var jsforce=require(_0x30a0('0xd'));var deskjs=require(_0x30a0('0xe'));var toCsv=require(_0x30a0('0xf'));var querystring=require(_0x30a0('0x10'));var Papa=require(_0x30a0('0x11'));var Redis=require(_0x30a0('0x12'));var authService=require(_0x30a0('0x13'));var qs=require(_0x30a0('0x14'));var as=require(_0x30a0('0x15'));var hardwareService=require(_0x30a0('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x30a0('0x17'));var config=require(_0x30a0('0x18'));var licenseUtil=require(_0x30a0('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ffb6e,_0x42718d){_0x42718d=_0x42718d||0xcc;return function(_0x4e3499){if(_0x4e3499){return _0x3ffb6e[_0x30a0('0x1a')](_0x42718d);}return _0x3ffb6e[_0x30a0('0x1b')](_0x42718d)['end']();};}function respondWithResult(_0x2de5a6,_0x962953){_0x962953=_0x962953||0xc8;return function(_0x3b2759){if(_0x3b2759){return _0x2de5a6[_0x30a0('0x1b')](_0x962953)['json'](_0x3b2759);}};}function respondWithFilteredResult(_0x3889a0,_0x33875c){return function(_0xfeb288){if(_0xfeb288){var _0x5c97c1=typeof _0x33875c['offset']===_0x30a0('0x1c')&&typeof _0x33875c[_0x30a0('0x1d')]===_0x30a0('0x1c');var _0x50fa45=_0xfeb288[_0x30a0('0x1e')];var _0x5991a1=_0x5c97c1?0x0:_0x33875c[_0x30a0('0x1f')];var _0x27cbb8=_0x5c97c1?_0xfeb288[_0x30a0('0x1e')]:_0x33875c[_0x30a0('0x1f')]+_0x33875c[_0x30a0('0x1d')];var _0x5efa63;if(_0x27cbb8>=_0x50fa45){_0x27cbb8=_0x50fa45;_0x5efa63=0xc8;}else{_0x5efa63=0xce;}_0x3889a0['status'](_0x5efa63);return _0x3889a0[_0x30a0('0x20')](_0x30a0('0x21'),_0x5991a1+'-'+_0x27cbb8+'/'+_0x50fa45)[_0x30a0('0x22')](_0xfeb288);}return null;};}function patchUpdates(_0x54a438){return function(_0x2a3144){try{jsonpatch['apply'](_0x2a3144,_0x54a438,!![]);}catch(_0x3ae00d){return BPromise['reject'](_0x3ae00d);}return _0x2a3144[_0x30a0('0x23')]();};}function saveUpdates(_0x1a8a4a,_0x484b1a){return function(_0x549759){if(_0x549759){return _0x549759[_0x30a0('0x24')](_0x1a8a4a)['then'](function(_0x2a7104){return _0x2a7104;});}return null;};}function removeEntity(_0x4cc17e,_0x1a4429){return function(_0x448c78){if(_0x448c78){return _0x448c78[_0x30a0('0x25')]()['then'](function(){_0x4cc17e['status'](0xcc)[_0x30a0('0x26')]();});}};}function handleEntityNotFound(_0x4fb255,_0x3cb0b0){return function(_0x3f8697){if(!_0x3f8697){_0x4fb255[_0x30a0('0x1a')](0x194);}return _0x3f8697;};}function handleError(_0x468112,_0x566651){_0x566651=_0x566651||0x1f4;return function(_0x1894bd){logger[_0x30a0('0x27')](_0x1894bd['stack']);if(_0x1894bd[_0x30a0('0x28')]){delete _0x1894bd[_0x30a0('0x28')];}_0x468112['status'](_0x566651)[_0x30a0('0x29')](_0x1894bd);};}exports['index']=function(_0x4d3284,_0x43b9a3){var _0x20c848={},_0x2cc8ed={},_0x4db15b={'count':0x0,'rows':[]};var _0x1a14ff=_['map'](db['FreshdeskConfiguration'][_0x30a0('0x2a')],function(_0x346abd){return{'name':_0x346abd[_0x30a0('0x2b')],'type':_0x346abd[_0x30a0('0x2c')][_0x30a0('0x2d')]};});_0x2cc8ed[_0x30a0('0x2e')]=_[_0x30a0('0x2f')](_0x1a14ff,_0x30a0('0x28'));_0x2cc8ed['query']=_['keys'](_0x4d3284['query']);_0x2cc8ed['filters']=_[_0x30a0('0x30')](_0x2cc8ed[_0x30a0('0x2e')],_0x2cc8ed[_0x30a0('0x31')]);_0x20c848[_0x30a0('0x32')]=_[_0x30a0('0x30')](_0x2cc8ed[_0x30a0('0x2e')],qs[_0x30a0('0x33')](_0x4d3284[_0x30a0('0x31')][_0x30a0('0x33')]));_0x20c848[_0x30a0('0x32')]=_0x20c848[_0x30a0('0x32')][_0x30a0('0x34')]?_0x20c848[_0x30a0('0x32')]:_0x2cc8ed[_0x30a0('0x2e')];if(!_0x4d3284['query'][_0x30a0('0x35')](_0x30a0('0x36'))){_0x20c848[_0x30a0('0x1d')]=qs[_0x30a0('0x1d')](_0x4d3284[_0x30a0('0x31')]['limit']);_0x20c848[_0x30a0('0x1f')]=qs[_0x30a0('0x1f')](_0x4d3284[_0x30a0('0x31')][_0x30a0('0x1f')]);}_0x20c848[_0x30a0('0x37')]=qs[_0x30a0('0x38')](_0x4d3284[_0x30a0('0x31')][_0x30a0('0x38')]);_0x20c848[_0x30a0('0x39')]=qs[_0x30a0('0x3a')](_['pick'](_0x4d3284[_0x30a0('0x31')],_0x2cc8ed[_0x30a0('0x3a')]),_0x1a14ff);if(_0x4d3284[_0x30a0('0x31')][_0x30a0('0x3b')]){_0x20c848['where']=_[_0x30a0('0x3c')](_0x20c848[_0x30a0('0x39')],{'$or':_['map'](_0x1a14ff,function(_0x367949){if(_0x367949[_0x30a0('0x2c')]!==_0x30a0('0x3d')){var _0xd02bd5={};_0xd02bd5[_0x367949[_0x30a0('0x28')]]={'$like':'%'+_0x4d3284[_0x30a0('0x31')]['filter']+'%'};return _0xd02bd5;}})});}_0x20c848=_[_0x30a0('0x3c')]({},_0x20c848,_0x4d3284[_0x30a0('0x3e')]);var _0x482ca8={'where':_0x20c848['where']};return db['FreshdeskConfiguration']['count'](_0x482ca8)[_0x30a0('0x3f')](function(_0x32c8c9){_0x4db15b[_0x30a0('0x1e')]=_0x32c8c9;if(_0x4d3284[_0x30a0('0x31')][_0x30a0('0x40')]){_0x20c848[_0x30a0('0x41')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x30a0('0x42')](_0x20c848);})[_0x30a0('0x3f')](function(_0x8b9de1){_0x4db15b[_0x30a0('0x43')]=_0x8b9de1;return _0x4db15b;})[_0x30a0('0x3f')](respondWithFilteredResult(_0x43b9a3,_0x20c848))[_0x30a0('0x44')](handleError(_0x43b9a3,null));};exports[_0x30a0('0x45')]=function(_0x4c374c,_0x3ac730){var _0x53951d={'raw':![],'where':{'id':_0x4c374c['params']['id']}},_0x4eac03={};_0x4eac03[_0x30a0('0x2e')]=_[_0x30a0('0x46')](db[_0x30a0('0x47')][_0x30a0('0x2a')]);_0x4eac03['query']=_[_0x30a0('0x46')](_0x4c374c[_0x30a0('0x31')]);_0x4eac03[_0x30a0('0x3a')]=_[_0x30a0('0x30')](_0x4eac03[_0x30a0('0x2e')],_0x4eac03[_0x30a0('0x31')]);_0x53951d['attributes']=_[_0x30a0('0x30')](_0x4eac03[_0x30a0('0x2e')],qs[_0x30a0('0x33')](_0x4c374c['query'][_0x30a0('0x33')]));_0x53951d[_0x30a0('0x32')]=_0x53951d[_0x30a0('0x32')][_0x30a0('0x34')]?_0x53951d[_0x30a0('0x32')]:_0x4eac03[_0x30a0('0x2e')];if(_0x4c374c[_0x30a0('0x31')][_0x30a0('0x40')]){_0x53951d[_0x30a0('0x41')]=[{'all':!![]}];}_0x53951d=_[_0x30a0('0x3c')]({},_0x53951d,_0x4c374c['options']);return db['FreshdeskConfiguration'][_0x30a0('0x48')](_0x53951d)['then'](handleEntityNotFound(_0x3ac730,null))['then'](respondWithResult(_0x3ac730,null))[_0x30a0('0x44')](handleError(_0x3ac730,null));};exports[_0x30a0('0x49')]=function(_0x19d31e,_0x37e2fd){return db[_0x30a0('0x47')][_0x30a0('0x49')](_0x19d31e[_0x30a0('0x4a')],{})[_0x30a0('0x3f')](respondWithResult(_0x37e2fd,0xc9))[_0x30a0('0x44')](handleError(_0x37e2fd,null));};exports[_0x30a0('0x24')]=function(_0x1e9d16,_0x4a7f90){if(_0x1e9d16[_0x30a0('0x4a')]['id']){delete _0x1e9d16[_0x30a0('0x4a')]['id'];}return db[_0x30a0('0x47')][_0x30a0('0x48')]({'where':{'id':_0x1e9d16[_0x30a0('0x4b')]['id']}})[_0x30a0('0x3f')](handleEntityNotFound(_0x4a7f90,null))[_0x30a0('0x3f')](saveUpdates(_0x1e9d16[_0x30a0('0x4a')],null))[_0x30a0('0x3f')](respondWithResult(_0x4a7f90,null))[_0x30a0('0x44')](handleError(_0x4a7f90,null));};exports[_0x30a0('0x25')]=function(_0x5b12d9,_0xa37d2){return db['FreshdeskConfiguration'][_0x30a0('0x48')]({'where':{'id':_0x5b12d9[_0x30a0('0x4b')]['id']}})[_0x30a0('0x3f')](handleEntityNotFound(_0xa37d2,null))[_0x30a0('0x3f')](removeEntity(_0xa37d2,null))[_0x30a0('0x44')](handleError(_0xa37d2,null));};exports['getFields']=function(_0x174569,_0x6a661e,_0x941570){var _0x2ce973={};var _0x8fca43={};var _0x2dad26;var _0x496fe3;return db['FreshdeskConfiguration'][_0x30a0('0x4c')]({'where':{'id':_0x174569['params']['id']}})[_0x30a0('0x3f')](handleEntityNotFound(_0x6a661e,null))[_0x30a0('0x3f')](function(_0x881d06){if(_0x881d06){_0x2dad26=_0x881d06;_0x8fca43[_0x30a0('0x2e')]=_[_0x30a0('0x46')](db['FreshdeskField'][_0x30a0('0x2a')]);_0x8fca43[_0x30a0('0x31')]=_[_0x30a0('0x46')](_0x174569[_0x30a0('0x31')]);_0x8fca43[_0x30a0('0x3a')]=_[_0x30a0('0x30')](_0x8fca43[_0x30a0('0x2e')],_0x8fca43['query']);_0x2ce973[_0x30a0('0x32')]=_[_0x30a0('0x30')](_0x8fca43[_0x30a0('0x2e')],qs[_0x30a0('0x33')](_0x174569[_0x30a0('0x31')][_0x30a0('0x33')]));_0x2ce973[_0x30a0('0x32')]=_0x2ce973[_0x30a0('0x32')][_0x30a0('0x34')]?_0x2ce973[_0x30a0('0x32')]:_0x8fca43[_0x30a0('0x2e')];_0x2ce973['order']=qs[_0x30a0('0x38')](_0x174569[_0x30a0('0x31')]['sort']);_0x2ce973['where']=qs['filters'](_[_0x30a0('0x4d')](_0x174569[_0x30a0('0x31')],_0x8fca43[_0x30a0('0x3a')]));if(_0x174569[_0x30a0('0x31')][_0x30a0('0x3b')]){_0x2ce973[_0x30a0('0x39')]=_[_0x30a0('0x3c')](_0x2ce973[_0x30a0('0x39')],{'$or':_[_0x30a0('0x2f')](_0x2ce973[_0x30a0('0x32')],function(_0x11c025){var _0x188859={};_0x188859[_0x11c025]={'$like':'%'+_0x174569[_0x30a0('0x31')][_0x30a0('0x3b')]+'%'};return _0x188859;})});}_0x2ce973=_[_0x30a0('0x3c')]({},_0x2ce973,_0x174569[_0x30a0('0x3e')]);return _0x2dad26[_0x30a0('0x4e')](_0x2ce973);}})['then'](function(_0x39ff7c){if(_0x39ff7c){_0x496fe3=_0x39ff7c[_0x30a0('0x34')];if(!_0x174569[_0x30a0('0x31')]['hasOwnProperty']('nolimit')){_0x2ce973['limit']=qs['limit'](_0x174569[_0x30a0('0x31')][_0x30a0('0x1d')]);_0x2ce973[_0x30a0('0x1f')]=qs[_0x30a0('0x1f')](_0x174569['query'][_0x30a0('0x1f')]);}return _0x2dad26[_0x30a0('0x4e')](_0x2ce973);}})['then'](function(_0x3200ee){if(_0x3200ee){return _0x3200ee?{'count':_0x496fe3,'rows':_0x3200ee}:null;}})['then'](respondWithResult(_0x6a661e,null))[_0x30a0('0x44')](handleError(_0x6a661e,null));};exports['getSubjects']=function(_0x12ff13,_0x203ccf,_0x2d8235){var _0x5a815e={};var _0x33e598={};var _0x271ca8;var _0x15151e;return db[_0x30a0('0x47')]['findOne']({'where':{'id':_0x12ff13[_0x30a0('0x4b')]['id']}})[_0x30a0('0x3f')](handleEntityNotFound(_0x203ccf,null))[_0x30a0('0x3f')](function(_0xb7857){if(_0xb7857){_0x271ca8=_0xb7857;_0x33e598[_0x30a0('0x2e')]=_[_0x30a0('0x46')](db['FreshdeskField'][_0x30a0('0x2a')]);_0x33e598[_0x30a0('0x31')]=_[_0x30a0('0x46')](_0x12ff13['query']);_0x33e598[_0x30a0('0x3a')]=_['intersection'](_0x33e598[_0x30a0('0x2e')],_0x33e598[_0x30a0('0x31')]);_0x5a815e['attributes']=_[_0x30a0('0x30')](_0x33e598[_0x30a0('0x2e')],qs[_0x30a0('0x33')](_0x12ff13[_0x30a0('0x31')]['fields']));_0x5a815e[_0x30a0('0x32')]=_0x5a815e[_0x30a0('0x32')]['length']?_0x5a815e[_0x30a0('0x32')]:_0x33e598[_0x30a0('0x2e')];_0x5a815e[_0x30a0('0x37')]=qs[_0x30a0('0x38')](_0x12ff13[_0x30a0('0x31')][_0x30a0('0x38')]);_0x5a815e[_0x30a0('0x39')]=qs[_0x30a0('0x3a')](_['pick'](_0x12ff13['query'],_0x33e598['filters']));if(_0x12ff13['query'][_0x30a0('0x3b')]){_0x5a815e[_0x30a0('0x39')]=_[_0x30a0('0x3c')](_0x5a815e[_0x30a0('0x39')],{'$or':_[_0x30a0('0x2f')](_0x5a815e['attributes'],function(_0xdca125){var _0x20b1ea={};_0x20b1ea[_0xdca125]={'$like':'%'+_0x12ff13[_0x30a0('0x31')]['filter']+'%'};return _0x20b1ea;})});}_0x5a815e=_['merge']({},_0x5a815e,_0x12ff13['options']);return _0x271ca8['getSubjects'](_0x5a815e);}})[_0x30a0('0x3f')](function(_0x96e035){if(_0x96e035){_0x15151e=_0x96e035['length'];if(!_0x12ff13[_0x30a0('0x31')]['hasOwnProperty'](_0x30a0('0x36'))){_0x5a815e['limit']=qs[_0x30a0('0x1d')](_0x12ff13[_0x30a0('0x31')][_0x30a0('0x1d')]);_0x5a815e['offset']=qs['offset'](_0x12ff13[_0x30a0('0x31')][_0x30a0('0x1f')]);}return _0x271ca8[_0x30a0('0x4f')](_0x5a815e);}})[_0x30a0('0x3f')](function(_0x5522f8){if(_0x5522f8){return _0x5522f8?{'count':_0x15151e,'rows':_0x5522f8}:null;}})[_0x30a0('0x3f')](respondWithResult(_0x203ccf,null))[_0x30a0('0x44')](handleError(_0x203ccf,null));};exports[_0x30a0('0x50')]=function(_0xb06024,_0x296c90,_0x326c4d){var _0x3121ad={};var _0x1be589={};var _0x51e2c6;var _0x444623;return db[_0x30a0('0x47')][_0x30a0('0x4c')]({'where':{'id':_0xb06024['params']['id']}})[_0x30a0('0x3f')](handleEntityNotFound(_0x296c90,null))[_0x30a0('0x3f')](function(_0x3bca54){if(_0x3bca54){_0x51e2c6=_0x3bca54;_0x1be589[_0x30a0('0x2e')]=_['keys'](db[_0x30a0('0x51')]['rawAttributes']);_0x1be589[_0x30a0('0x31')]=_[_0x30a0('0x46')](_0xb06024[_0x30a0('0x31')]);_0x1be589['filters']=_[_0x30a0('0x30')](_0x1be589[_0x30a0('0x2e')],_0x1be589[_0x30a0('0x31')]);_0x3121ad[_0x30a0('0x32')]=_['intersection'](_0x1be589['model'],qs[_0x30a0('0x33')](_0xb06024['query'][_0x30a0('0x33')]));_0x3121ad[_0x30a0('0x32')]=_0x3121ad[_0x30a0('0x32')][_0x30a0('0x34')]?_0x3121ad['attributes']:_0x1be589[_0x30a0('0x2e')];_0x3121ad['order']=qs[_0x30a0('0x38')](_0xb06024[_0x30a0('0x31')]['sort']);_0x3121ad[_0x30a0('0x39')]=qs[_0x30a0('0x3a')](_[_0x30a0('0x4d')](_0xb06024[_0x30a0('0x31')],_0x1be589['filters']));if(_0xb06024[_0x30a0('0x31')][_0x30a0('0x3b')]){_0x3121ad[_0x30a0('0x39')]=_[_0x30a0('0x3c')](_0x3121ad[_0x30a0('0x39')],{'$or':_[_0x30a0('0x2f')](_0x3121ad['attributes'],function(_0x5a9032){var _0x3ed683={};_0x3ed683[_0x5a9032]={'$like':'%'+_0xb06024['query'][_0x30a0('0x3b')]+'%'};return _0x3ed683;})});}_0x3121ad=_[_0x30a0('0x3c')]({},_0x3121ad,_0xb06024[_0x30a0('0x3e')]);return _0x51e2c6[_0x30a0('0x50')](_0x3121ad);}})[_0x30a0('0x3f')](function(_0x2a7460){if(_0x2a7460){_0x444623=_0x2a7460[_0x30a0('0x34')];if(!_0xb06024[_0x30a0('0x31')]['hasOwnProperty'](_0x30a0('0x36'))){_0x3121ad[_0x30a0('0x1d')]=qs[_0x30a0('0x1d')](_0xb06024[_0x30a0('0x31')][_0x30a0('0x1d')]);_0x3121ad[_0x30a0('0x1f')]=qs[_0x30a0('0x1f')](_0xb06024['query'][_0x30a0('0x1f')]);}return _0x51e2c6['getDescriptions'](_0x3121ad);}})[_0x30a0('0x3f')](function(_0x4ef112){if(_0x4ef112){return _0x4ef112?{'count':_0x444623,'rows':_0x4ef112}:null;}})[_0x30a0('0x3f')](respondWithResult(_0x296c90,null))[_0x30a0('0x44')](handleError(_0x296c90,null));};exports[_0x30a0('0x52')]=function(_0xbbc5f,_0x168f62,_0x2bf91c){var _0x44f17f={};var _0x31a4f9={};var _0xbc33ac;var _0x1cbfc7;return db[_0x30a0('0x47')][_0x30a0('0x4c')]({'where':{'id':_0xbbc5f[_0x30a0('0x4b')]['id']}})['then'](handleEntityNotFound(_0x168f62,null))[_0x30a0('0x3f')](function(_0x23d81b){if(_0x23d81b){_0xbc33ac=_0x23d81b;_0x31a4f9[_0x30a0('0x2e')]=_[_0x30a0('0x46')](db[_0x30a0('0x53')][_0x30a0('0x2a')]);_0x31a4f9[_0x30a0('0x31')]=_[_0x30a0('0x46')](_0xbbc5f[_0x30a0('0x31')]);_0x31a4f9[_0x30a0('0x3a')]=_[_0x30a0('0x30')](_0x31a4f9[_0x30a0('0x2e')],_0x31a4f9[_0x30a0('0x31')]);_0x44f17f['attributes']=_[_0x30a0('0x30')](_0x31a4f9[_0x30a0('0x2e')],qs[_0x30a0('0x33')](_0xbbc5f['query'][_0x30a0('0x33')]));_0x44f17f['attributes']=_0x44f17f['attributes'][_0x30a0('0x34')]?_0x44f17f[_0x30a0('0x32')]:_0x31a4f9[_0x30a0('0x2e')];_0x44f17f[_0x30a0('0x37')]=qs[_0x30a0('0x38')](_0xbbc5f[_0x30a0('0x31')][_0x30a0('0x38')]);_0x44f17f['where']=qs[_0x30a0('0x3a')](_[_0x30a0('0x4d')](_0xbbc5f[_0x30a0('0x31')],_0x31a4f9[_0x30a0('0x3a')]));if(_0xbbc5f[_0x30a0('0x31')][_0x30a0('0x3b')]){_0x44f17f[_0x30a0('0x39')]=_[_0x30a0('0x3c')](_0x44f17f[_0x30a0('0x39')],{'$or':_[_0x30a0('0x2f')](_0x44f17f['attributes'],function(_0x24773c){var _0x59e928={};_0x59e928[_0x24773c]={'$like':'%'+_0xbbc5f[_0x30a0('0x31')][_0x30a0('0x3b')]+'%'};return _0x59e928;})});}_0x44f17f=_[_0x30a0('0x3c')]({},_0x44f17f,_0xbbc5f[_0x30a0('0x3e')]);return _0xbc33ac[_0x30a0('0x52')](_0x44f17f);}})['then'](function(_0x32cfd1){if(_0x32cfd1){_0x1cbfc7=_0x32cfd1[_0x30a0('0x34')];if(!_0xbbc5f['query'][_0x30a0('0x35')](_0x30a0('0x36'))){_0x44f17f['limit']=qs[_0x30a0('0x1d')](_0xbbc5f['query'][_0x30a0('0x1d')]);_0x44f17f['offset']=qs[_0x30a0('0x1f')](_0xbbc5f[_0x30a0('0x31')]['offset']);}return _0xbc33ac[_0x30a0('0x52')](_0x44f17f);}})[_0x30a0('0x3f')](function(_0x11a5dc){if(_0x11a5dc){return _0x11a5dc?{'count':_0x1cbfc7,'rows':_0x11a5dc}:null;}})[_0x30a0('0x3f')](respondWithResult(_0x168f62,null))[_0x30a0('0x44')](handleError(_0x168f62,null));};exports[_0x30a0('0x54')]=function(_0x30fae9,_0x5ab45f,_0x28d975){if(_0x30fae9[_0x30a0('0x4a')]['id']){delete _0x30fae9['body']['id'];}return db[_0x30a0('0x47')][_0x30a0('0x4c')]({'where':{'id':_0x30fae9['params']['id']}})[_0x30a0('0x3f')](handleEntityNotFound(_0x5ab45f,null))[_0x30a0('0x3f')](function(_0x5e704b){if(_0x5e704b){return _0x5e704b[_0x30a0('0x54')](_0x30fae9[_0x30a0('0x4a')][_0x30a0('0x55')]||[]);}return null;})[_0x30a0('0x3f')](respondWithResult(_0x5ab45f,null))['catch'](handleError(_0x5ab45f,null));};
\ No newline at end of file
+var _0xa16c=['fields','attributes','length','order','sort','where','pick','merge','VIRTUAL','filter','FreshdeskConfiguration','includeAll','include','findAll','rows','show','params','rawAttributes','options','body','catch','update','find','getFields','findOne','hasOwnProperty','FreshdeskField','getSubjects','nolimit','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','then','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa16c,0x75));var _0xca16=function(_0x522a39,_0x1e2860){_0x522a39=_0x522a39-0x0;var _0x24a53d=_0xa16c[_0x522a39];return _0x24a53d;};'use strict';var emlformat=require(_0xca16('0x0'));var rimraf=require(_0xca16('0x1'));var zipdir=require(_0xca16('0x2'));var jsonpatch=require(_0xca16('0x3'));var rp=require('request-promise');var moment=require(_0xca16('0x4'));var BPromise=require(_0xca16('0x5'));var Mustache=require(_0xca16('0x6'));var util=require(_0xca16('0x7'));var path=require(_0xca16('0x8'));var sox=require(_0xca16('0x9'));var csv=require(_0xca16('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca16('0xb'));var _=require(_0xca16('0xc'));var squel=require(_0xca16('0xd'));var crypto=require('crypto');var jsforce=require(_0xca16('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xca16('0xf'));var Papa=require('papaparse');var Redis=require(_0xca16('0x10'));var authService=require(_0xca16('0x11'));var qs=require(_0xca16('0x12'));var as=require(_0xca16('0x13'));var hardwareService=require(_0xca16('0x14'));var logger=require(_0xca16('0x15'))('api');var utils=require(_0xca16('0x16'));var config=require(_0xca16('0x17'));var licenseUtil=require(_0xca16('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c851e,_0x29bbdd){_0x29bbdd=_0x29bbdd||0xcc;return function(_0x53a6fa){if(_0x53a6fa){return _0x4c851e[_0xca16('0x19')](_0x29bbdd);}return _0x4c851e[_0xca16('0x1a')](_0x29bbdd)[_0xca16('0x1b')]();};}function respondWithResult(_0x3ff2c9,_0x3db88c){_0x3db88c=_0x3db88c||0xc8;return function(_0x3a5ef0){if(_0x3a5ef0){return _0x3ff2c9[_0xca16('0x1a')](_0x3db88c)[_0xca16('0x1c')](_0x3a5ef0);}};}function respondWithFilteredResult(_0x732da9,_0x40a80a){return function(_0x2a0b0d){if(_0x2a0b0d){var _0x6081ee=typeof _0x40a80a[_0xca16('0x1d')]===_0xca16('0x1e')&&typeof _0x40a80a[_0xca16('0x1f')]===_0xca16('0x1e');var _0x196719=_0x2a0b0d['count'];var _0x97db7f=_0x6081ee?0x0:_0x40a80a['offset'];var _0x4cbdfa=_0x6081ee?_0x2a0b0d[_0xca16('0x20')]:_0x40a80a[_0xca16('0x1d')]+_0x40a80a['limit'];var _0x5df3db;if(_0x4cbdfa>=_0x196719){_0x4cbdfa=_0x196719;_0x5df3db=0xc8;}else{_0x5df3db=0xce;}_0x732da9[_0xca16('0x1a')](_0x5df3db);return _0x732da9[_0xca16('0x21')]('Content-Range',_0x97db7f+'-'+_0x4cbdfa+'/'+_0x196719)[_0xca16('0x1c')](_0x2a0b0d);}return null;};}function patchUpdates(_0x5eabb8){return function(_0xfd13de){try{jsonpatch['apply'](_0xfd13de,_0x5eabb8,!![]);}catch(_0x4ee0f3){return BPromise['reject'](_0x4ee0f3);}return _0xfd13de['save']();};}function saveUpdates(_0x360227,_0x2f8dab){return function(_0x5d07a8){if(_0x5d07a8){return _0x5d07a8['update'](_0x360227)[_0xca16('0x22')](function(_0x39ee28){return _0x39ee28;});}return null;};}function removeEntity(_0x491af7,_0x5f30c1){return function(_0x568fb5){if(_0x568fb5){return _0x568fb5['destroy']()[_0xca16('0x22')](function(){_0x491af7[_0xca16('0x1a')](0xcc)[_0xca16('0x1b')]();});}};}function handleEntityNotFound(_0x2b1f14,_0x17ecf4){return function(_0x19d47a){if(!_0x19d47a){_0x2b1f14[_0xca16('0x19')](0x194);}return _0x19d47a;};}function handleError(_0x1d6b6c,_0xcccb8c){_0xcccb8c=_0xcccb8c||0x1f4;return function(_0x502690){logger[_0xca16('0x23')](_0x502690[_0xca16('0x24')]);if(_0x502690[_0xca16('0x25')]){delete _0x502690[_0xca16('0x25')];}_0x1d6b6c[_0xca16('0x1a')](_0xcccb8c)[_0xca16('0x26')](_0x502690);};}exports[_0xca16('0x27')]=function(_0x573bee,_0x28c43d){var _0x18d3d3={},_0x694220={},_0x4599b1={'count':0x0,'rows':[]};var _0x1e5349=_[_0xca16('0x28')](db['FreshdeskConfiguration']['rawAttributes'],function(_0x3984be){return{'name':_0x3984be[_0xca16('0x29')],'type':_0x3984be[_0xca16('0x2a')][_0xca16('0x2b')]};});_0x694220[_0xca16('0x2c')]=_[_0xca16('0x28')](_0x1e5349,_0xca16('0x25'));_0x694220[_0xca16('0x2d')]=_[_0xca16('0x2e')](_0x573bee[_0xca16('0x2d')]);_0x694220[_0xca16('0x2f')]=_['intersection'](_0x694220[_0xca16('0x2c')],_0x694220[_0xca16('0x2d')]);_0x18d3d3['attributes']=_[_0xca16('0x30')](_0x694220['model'],qs[_0xca16('0x31')](_0x573bee[_0xca16('0x2d')][_0xca16('0x31')]));_0x18d3d3[_0xca16('0x32')]=_0x18d3d3['attributes'][_0xca16('0x33')]?_0x18d3d3['attributes']:_0x694220['model'];if(!_0x573bee[_0xca16('0x2d')]['hasOwnProperty']('nolimit')){_0x18d3d3[_0xca16('0x1f')]=qs[_0xca16('0x1f')](_0x573bee[_0xca16('0x2d')][_0xca16('0x1f')]);_0x18d3d3[_0xca16('0x1d')]=qs[_0xca16('0x1d')](_0x573bee[_0xca16('0x2d')][_0xca16('0x1d')]);}_0x18d3d3[_0xca16('0x34')]=qs[_0xca16('0x35')](_0x573bee[_0xca16('0x2d')][_0xca16('0x35')]);_0x18d3d3[_0xca16('0x36')]=qs['filters'](_[_0xca16('0x37')](_0x573bee[_0xca16('0x2d')],_0x694220[_0xca16('0x2f')]),_0x1e5349);if(_0x573bee['query']['filter']){_0x18d3d3[_0xca16('0x36')]=_[_0xca16('0x38')](_0x18d3d3[_0xca16('0x36')],{'$or':_[_0xca16('0x28')](_0x1e5349,function(_0x547966){if(_0x547966['type']!==_0xca16('0x39')){var _0x5620b0={};_0x5620b0[_0x547966[_0xca16('0x25')]]={'$like':'%'+_0x573bee[_0xca16('0x2d')][_0xca16('0x3a')]+'%'};return _0x5620b0;}})});}_0x18d3d3=_[_0xca16('0x38')]({},_0x18d3d3,_0x573bee['options']);var _0x558260={'where':_0x18d3d3['where']};return db[_0xca16('0x3b')][_0xca16('0x20')](_0x558260)['then'](function(_0x9b4c4f){_0x4599b1[_0xca16('0x20')]=_0x9b4c4f;if(_0x573bee[_0xca16('0x2d')][_0xca16('0x3c')]){_0x18d3d3[_0xca16('0x3d')]=[{'all':!![]}];}return db[_0xca16('0x3b')][_0xca16('0x3e')](_0x18d3d3);})[_0xca16('0x22')](function(_0x432a5d){_0x4599b1[_0xca16('0x3f')]=_0x432a5d;return _0x4599b1;})[_0xca16('0x22')](respondWithFilteredResult(_0x28c43d,_0x18d3d3))['catch'](handleError(_0x28c43d,null));};exports[_0xca16('0x40')]=function(_0x2589d0,_0x29c0f4){var _0x4e0088={'raw':![],'where':{'id':_0x2589d0[_0xca16('0x41')]['id']}},_0x674a9={};_0x674a9[_0xca16('0x2c')]=_['keys'](db[_0xca16('0x3b')][_0xca16('0x42')]);_0x674a9[_0xca16('0x2d')]=_[_0xca16('0x2e')](_0x2589d0['query']);_0x674a9['filters']=_['intersection'](_0x674a9[_0xca16('0x2c')],_0x674a9[_0xca16('0x2d')]);_0x4e0088[_0xca16('0x32')]=_[_0xca16('0x30')](_0x674a9[_0xca16('0x2c')],qs['fields'](_0x2589d0[_0xca16('0x2d')][_0xca16('0x31')]));_0x4e0088['attributes']=_0x4e0088[_0xca16('0x32')]['length']?_0x4e0088[_0xca16('0x32')]:_0x674a9[_0xca16('0x2c')];if(_0x2589d0[_0xca16('0x2d')][_0xca16('0x3c')]){_0x4e0088[_0xca16('0x3d')]=[{'all':!![]}];}_0x4e0088=_['merge']({},_0x4e0088,_0x2589d0[_0xca16('0x43')]);return db['FreshdeskConfiguration']['find'](_0x4e0088)[_0xca16('0x22')](handleEntityNotFound(_0x29c0f4,null))['then'](respondWithResult(_0x29c0f4,null))['catch'](handleError(_0x29c0f4,null));};exports['create']=function(_0x662a69,_0x505017){return db[_0xca16('0x3b')]['create'](_0x662a69[_0xca16('0x44')],{})[_0xca16('0x22')](respondWithResult(_0x505017,0xc9))[_0xca16('0x45')](handleError(_0x505017,null));};exports[_0xca16('0x46')]=function(_0x497f1c,_0x872a7c){if(_0x497f1c['body']['id']){delete _0x497f1c[_0xca16('0x44')]['id'];}return db['FreshdeskConfiguration'][_0xca16('0x47')]({'where':{'id':_0x497f1c[_0xca16('0x41')]['id']}})[_0xca16('0x22')](handleEntityNotFound(_0x872a7c,null))[_0xca16('0x22')](saveUpdates(_0x497f1c[_0xca16('0x44')],null))['then'](respondWithResult(_0x872a7c,null))[_0xca16('0x45')](handleError(_0x872a7c,null));};exports['destroy']=function(_0x24dafa,_0x34cd77){return db[_0xca16('0x3b')][_0xca16('0x47')]({'where':{'id':_0x24dafa['params']['id']}})[_0xca16('0x22')](handleEntityNotFound(_0x34cd77,null))[_0xca16('0x22')](removeEntity(_0x34cd77,null))[_0xca16('0x45')](handleError(_0x34cd77,null));};exports[_0xca16('0x48')]=function(_0x4eff3b,_0x4a1c5d,_0x322e18){var _0x57e268={};var _0x32a98d={};var _0x399050;var _0x136934;return db[_0xca16('0x3b')][_0xca16('0x49')]({'where':{'id':_0x4eff3b[_0xca16('0x41')]['id']}})[_0xca16('0x22')](handleEntityNotFound(_0x4a1c5d,null))[_0xca16('0x22')](function(_0x88c03c){if(_0x88c03c){_0x399050=_0x88c03c;_0x32a98d[_0xca16('0x2c')]=_[_0xca16('0x2e')](db['FreshdeskField']['rawAttributes']);_0x32a98d[_0xca16('0x2d')]=_[_0xca16('0x2e')](_0x4eff3b[_0xca16('0x2d')]);_0x32a98d[_0xca16('0x2f')]=_['intersection'](_0x32a98d[_0xca16('0x2c')],_0x32a98d[_0xca16('0x2d')]);_0x57e268[_0xca16('0x32')]=_[_0xca16('0x30')](_0x32a98d[_0xca16('0x2c')],qs[_0xca16('0x31')](_0x4eff3b['query'][_0xca16('0x31')]));_0x57e268[_0xca16('0x32')]=_0x57e268[_0xca16('0x32')][_0xca16('0x33')]?_0x57e268[_0xca16('0x32')]:_0x32a98d['model'];_0x57e268['order']=qs[_0xca16('0x35')](_0x4eff3b['query'][_0xca16('0x35')]);_0x57e268['where']=qs[_0xca16('0x2f')](_[_0xca16('0x37')](_0x4eff3b['query'],_0x32a98d[_0xca16('0x2f')]));if(_0x4eff3b[_0xca16('0x2d')][_0xca16('0x3a')]){_0x57e268[_0xca16('0x36')]=_[_0xca16('0x38')](_0x57e268[_0xca16('0x36')],{'$or':_[_0xca16('0x28')](_0x57e268[_0xca16('0x32')],function(_0x16300){var _0x511efd={};_0x511efd[_0x16300]={'$like':'%'+_0x4eff3b[_0xca16('0x2d')][_0xca16('0x3a')]+'%'};return _0x511efd;})});}_0x57e268=_[_0xca16('0x38')]({},_0x57e268,_0x4eff3b[_0xca16('0x43')]);return _0x399050[_0xca16('0x48')](_0x57e268);}})[_0xca16('0x22')](function(_0x58d91b){if(_0x58d91b){_0x136934=_0x58d91b[_0xca16('0x33')];if(!_0x4eff3b['query'][_0xca16('0x4a')]('nolimit')){_0x57e268[_0xca16('0x1f')]=qs[_0xca16('0x1f')](_0x4eff3b['query'][_0xca16('0x1f')]);_0x57e268[_0xca16('0x1d')]=qs[_0xca16('0x1d')](_0x4eff3b[_0xca16('0x2d')]['offset']);}return _0x399050[_0xca16('0x48')](_0x57e268);}})[_0xca16('0x22')](function(_0xe74120){if(_0xe74120){return _0xe74120?{'count':_0x136934,'rows':_0xe74120}:null;}})['then'](respondWithResult(_0x4a1c5d,null))[_0xca16('0x45')](handleError(_0x4a1c5d,null));};exports['getSubjects']=function(_0x46fb6e,_0x192c53,_0x4351da){var _0xea4e16={};var _0x29b299={};var _0x5ec843;var _0x53e44e;return db[_0xca16('0x3b')][_0xca16('0x49')]({'where':{'id':_0x46fb6e[_0xca16('0x41')]['id']}})[_0xca16('0x22')](handleEntityNotFound(_0x192c53,null))[_0xca16('0x22')](function(_0x513ad6){if(_0x513ad6){_0x5ec843=_0x513ad6;_0x29b299[_0xca16('0x2c')]=_[_0xca16('0x2e')](db[_0xca16('0x4b')]['rawAttributes']);_0x29b299[_0xca16('0x2d')]=_[_0xca16('0x2e')](_0x46fb6e['query']);_0x29b299['filters']=_['intersection'](_0x29b299[_0xca16('0x2c')],_0x29b299['query']);_0xea4e16[_0xca16('0x32')]=_[_0xca16('0x30')](_0x29b299[_0xca16('0x2c')],qs[_0xca16('0x31')](_0x46fb6e[_0xca16('0x2d')][_0xca16('0x31')]));_0xea4e16['attributes']=_0xea4e16[_0xca16('0x32')][_0xca16('0x33')]?_0xea4e16['attributes']:_0x29b299['model'];_0xea4e16[_0xca16('0x34')]=qs[_0xca16('0x35')](_0x46fb6e[_0xca16('0x2d')][_0xca16('0x35')]);_0xea4e16[_0xca16('0x36')]=qs[_0xca16('0x2f')](_[_0xca16('0x37')](_0x46fb6e[_0xca16('0x2d')],_0x29b299[_0xca16('0x2f')]));if(_0x46fb6e[_0xca16('0x2d')][_0xca16('0x3a')]){_0xea4e16[_0xca16('0x36')]=_[_0xca16('0x38')](_0xea4e16['where'],{'$or':_[_0xca16('0x28')](_0xea4e16[_0xca16('0x32')],function(_0x2659df){var _0x25b215={};_0x25b215[_0x2659df]={'$like':'%'+_0x46fb6e[_0xca16('0x2d')][_0xca16('0x3a')]+'%'};return _0x25b215;})});}_0xea4e16=_[_0xca16('0x38')]({},_0xea4e16,_0x46fb6e[_0xca16('0x43')]);return _0x5ec843[_0xca16('0x4c')](_0xea4e16);}})['then'](function(_0x51df14){if(_0x51df14){_0x53e44e=_0x51df14[_0xca16('0x33')];if(!_0x46fb6e[_0xca16('0x2d')][_0xca16('0x4a')](_0xca16('0x4d'))){_0xea4e16[_0xca16('0x1f')]=qs[_0xca16('0x1f')](_0x46fb6e[_0xca16('0x2d')][_0xca16('0x1f')]);_0xea4e16[_0xca16('0x1d')]=qs[_0xca16('0x1d')](_0x46fb6e['query'][_0xca16('0x1d')]);}return _0x5ec843[_0xca16('0x4c')](_0xea4e16);}})[_0xca16('0x22')](function(_0x7c0735){if(_0x7c0735){return _0x7c0735?{'count':_0x53e44e,'rows':_0x7c0735}:null;}})[_0xca16('0x22')](respondWithResult(_0x192c53,null))[_0xca16('0x45')](handleError(_0x192c53,null));};exports[_0xca16('0x4e')]=function(_0x3d8e01,_0x58115b,_0x4dab66){var _0x383c04={};var _0x4d76cb={};var _0x3856d8;var _0xcb196f;return db[_0xca16('0x3b')][_0xca16('0x49')]({'where':{'id':_0x3d8e01[_0xca16('0x41')]['id']}})[_0xca16('0x22')](handleEntityNotFound(_0x58115b,null))[_0xca16('0x22')](function(_0x2d8d2b){if(_0x2d8d2b){_0x3856d8=_0x2d8d2b;_0x4d76cb[_0xca16('0x2c')]=_[_0xca16('0x2e')](db[_0xca16('0x4b')][_0xca16('0x42')]);_0x4d76cb['query']=_[_0xca16('0x2e')](_0x3d8e01[_0xca16('0x2d')]);_0x4d76cb[_0xca16('0x2f')]=_['intersection'](_0x4d76cb[_0xca16('0x2c')],_0x4d76cb[_0xca16('0x2d')]);_0x383c04['attributes']=_[_0xca16('0x30')](_0x4d76cb['model'],qs[_0xca16('0x31')](_0x3d8e01['query'][_0xca16('0x31')]));_0x383c04[_0xca16('0x32')]=_0x383c04[_0xca16('0x32')][_0xca16('0x33')]?_0x383c04['attributes']:_0x4d76cb[_0xca16('0x2c')];_0x383c04[_0xca16('0x34')]=qs[_0xca16('0x35')](_0x3d8e01[_0xca16('0x2d')]['sort']);_0x383c04['where']=qs[_0xca16('0x2f')](_[_0xca16('0x37')](_0x3d8e01[_0xca16('0x2d')],_0x4d76cb[_0xca16('0x2f')]));if(_0x3d8e01['query'][_0xca16('0x3a')]){_0x383c04[_0xca16('0x36')]=_[_0xca16('0x38')](_0x383c04[_0xca16('0x36')],{'$or':_[_0xca16('0x28')](_0x383c04['attributes'],function(_0x4dac1c){var _0x3188fc={};_0x3188fc[_0x4dac1c]={'$like':'%'+_0x3d8e01['query'][_0xca16('0x3a')]+'%'};return _0x3188fc;})});}_0x383c04=_[_0xca16('0x38')]({},_0x383c04,_0x3d8e01[_0xca16('0x43')]);return _0x3856d8[_0xca16('0x4e')](_0x383c04);}})['then'](function(_0x417b50){if(_0x417b50){_0xcb196f=_0x417b50['length'];if(!_0x3d8e01[_0xca16('0x2d')][_0xca16('0x4a')]('nolimit')){_0x383c04[_0xca16('0x1f')]=qs[_0xca16('0x1f')](_0x3d8e01['query'][_0xca16('0x1f')]);_0x383c04['offset']=qs[_0xca16('0x1d')](_0x3d8e01[_0xca16('0x2d')][_0xca16('0x1d')]);}return _0x3856d8[_0xca16('0x4e')](_0x383c04);}})[_0xca16('0x22')](function(_0x4a9592){if(_0x4a9592){return _0x4a9592?{'count':_0xcb196f,'rows':_0x4a9592}:null;}})[_0xca16('0x22')](respondWithResult(_0x58115b,null))[_0xca16('0x45')](handleError(_0x58115b,null));};exports[_0xca16('0x4f')]=function(_0x4dce9c,_0x5e6636,_0x1a2f98){var _0x2ec11a={};var _0x2bbae4={};var _0x1db603;var _0x304247;return db['FreshdeskConfiguration'][_0xca16('0x49')]({'where':{'id':_0x4dce9c[_0xca16('0x41')]['id']}})[_0xca16('0x22')](handleEntityNotFound(_0x5e6636,null))[_0xca16('0x22')](function(_0xfde614){if(_0xfde614){_0x1db603=_0xfde614;_0x2bbae4[_0xca16('0x2c')]=_[_0xca16('0x2e')](db[_0xca16('0x50')][_0xca16('0x42')]);_0x2bbae4['query']=_['keys'](_0x4dce9c[_0xca16('0x2d')]);_0x2bbae4[_0xca16('0x2f')]=_[_0xca16('0x30')](_0x2bbae4[_0xca16('0x2c')],_0x2bbae4[_0xca16('0x2d')]);_0x2ec11a[_0xca16('0x32')]=_['intersection'](_0x2bbae4[_0xca16('0x2c')],qs[_0xca16('0x31')](_0x4dce9c[_0xca16('0x2d')][_0xca16('0x31')]));_0x2ec11a[_0xca16('0x32')]=_0x2ec11a['attributes'][_0xca16('0x33')]?_0x2ec11a[_0xca16('0x32')]:_0x2bbae4[_0xca16('0x2c')];_0x2ec11a[_0xca16('0x34')]=qs['sort'](_0x4dce9c[_0xca16('0x2d')][_0xca16('0x35')]);_0x2ec11a[_0xca16('0x36')]=qs[_0xca16('0x2f')](_['pick'](_0x4dce9c['query'],_0x2bbae4['filters']));if(_0x4dce9c[_0xca16('0x2d')][_0xca16('0x3a')]){_0x2ec11a[_0xca16('0x36')]=_[_0xca16('0x38')](_0x2ec11a['where'],{'$or':_[_0xca16('0x28')](_0x2ec11a[_0xca16('0x32')],function(_0x1086bd){var _0x3f7270={};_0x3f7270[_0x1086bd]={'$like':'%'+_0x4dce9c[_0xca16('0x2d')][_0xca16('0x3a')]+'%'};return _0x3f7270;})});}_0x2ec11a=_[_0xca16('0x38')]({},_0x2ec11a,_0x4dce9c['options']);return _0x1db603[_0xca16('0x4f')](_0x2ec11a);}})[_0xca16('0x22')](function(_0x178ad2){if(_0x178ad2){_0x304247=_0x178ad2[_0xca16('0x33')];if(!_0x4dce9c[_0xca16('0x2d')][_0xca16('0x4a')](_0xca16('0x4d'))){_0x2ec11a['limit']=qs[_0xca16('0x1f')](_0x4dce9c['query']['limit']);_0x2ec11a[_0xca16('0x1d')]=qs['offset'](_0x4dce9c[_0xca16('0x2d')][_0xca16('0x1d')]);}return _0x1db603[_0xca16('0x4f')](_0x2ec11a);}})['then'](function(_0x4a88fb){if(_0x4a88fb){return _0x4a88fb?{'count':_0x304247,'rows':_0x4a88fb}:null;}})[_0xca16('0x22')](respondWithResult(_0x5e6636,null))['catch'](handleError(_0x5e6636,null));};exports[_0xca16('0x51')]=function(_0x52ef60,_0x4c4fc4,_0x4274f1){if(_0x52ef60[_0xca16('0x44')]['id']){delete _0x52ef60['body']['id'];}return db['FreshdeskConfiguration'][_0xca16('0x49')]({'where':{'id':_0x52ef60[_0xca16('0x41')]['id']}})['then'](handleEntityNotFound(_0x4c4fc4,null))[_0xca16('0x22')](function(_0x5602dd){if(_0x5602dd){return _0x5602dd[_0xca16('0x51')](_0x52ef60['body'][_0xca16('0x52')]||[]);}return null;})[_0xca16('0x22')](respondWithResult(_0x4c4fc4,null))[_0xca16('0x45')](handleError(_0x4c4fc4,null));};
\ No newline at end of file
index 44d7536..70cd871 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32ed=['../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x35e785,_0x503f27){var _0xd0e538=function(_0x30ad2f){while(--_0x30ad2f){_0x35e785['push'](_0x35e785['shift']());}};_0xd0e538(++_0x503f27);}(_0x32ed,0x68));var _0xd32e=function(_0x143727,_0x775f88){_0x143727=_0x143727-0x0;var _0x4753e5=_0x32ed[_0x143727];return _0x4753e5;};'use strict';var _=require('lodash');var util=require(_0xd32e('0x0'));var logger=require(_0xd32e('0x1'))(_0xd32e('0x2'));var moment=require(_0xd32e('0x3'));var BPromise=require(_0xd32e('0x4'));var rp=require(_0xd32e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd32e('0x6'));var attributes=require(_0xd32e('0x7'));module[_0xd32e('0x8')]=function(_0x2b97eb,_0x15a987){return _0x2b97eb[_0xd32e('0x9')](_0xd32e('0xa'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe656=['../../config/environment','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','path','rimraf'];(function(_0x5a6382,_0x43369c){var _0x481b82=function(_0x478dcf){while(--_0x478dcf){_0x5a6382['push'](_0x5a6382['shift']());}};_0x481b82(++_0x43369c);}(_0xe656,0x188));var _0x6e65=function(_0x23c01d,_0x2db22d){_0x23c01d=_0x23c01d-0x0;var _0x12c30e=_0xe656[_0x23c01d];return _0x12c30e;};'use strict';var _=require(_0x6e65('0x0'));var util=require(_0x6e65('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e65('0x2'));var rimraf=require(_0x6e65('0x3'));var config=require(_0x6e65('0x4'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x6e65('0x5')]=function(_0x266fd3,_0x1b974f){return _0x266fd3[_0x6e65('0x6')](_0x6e65('0x7'),attributes,{'tableName':_0x6e65('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f6f0f16..68e7ee7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5424=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring'];(function(_0x64df77,_0x10e33d){var _0x2d8ce7=function(_0x5016ba){while(--_0x5016ba){_0x64df77['push'](_0x64df77['shift']());}};_0x2d8ce7(++_0x10e33d);}(_0x5424,0xa4));var _0x4542=function(_0x3805e9,_0x33a4ed){_0x3805e9=_0x3805e9-0x0;var _0x207e20=_0x5424[_0x3805e9];return _0x207e20;};'use strict';var _=require(_0x4542('0x0'));var util=require(_0x4542('0x1'));var moment=require(_0x4542('0x2'));var BPromise=require('bluebird');var rs=require(_0x4542('0x3'));var fs=require('fs');var Redis=require(_0x4542('0x4'));var db=require(_0x4542('0x5'))['db'];var utils=require(_0x4542('0x6'));var logger=require(_0x4542('0x7'))(_0x4542('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4542('0x9')][_0x4542('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41a3be,_0x36ebea,_0x1ebb01){return new BPromise(function(_0x329c6b,_0x57e349){return client[_0x4542('0xb')](_0x41a3be,_0x1ebb01)[_0x4542('0xc')](function(_0x1f66ba){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x36ebea,'request\x20sent');logger[_0x4542('0xd')](_0x4542('0xe'),_0x36ebea,_0x4542('0xf'),JSON[_0x4542('0x10')](_0x1f66ba));if(_0x1f66ba[_0x4542('0x11')]){if(_0x1f66ba['error'][_0x4542('0x12')]===0x1f4){logger[_0x4542('0x11')](_0x4542('0x13'),_0x36ebea,_0x1f66ba[_0x4542('0x11')][_0x4542('0x14')]);return _0x57e349(_0x1f66ba[_0x4542('0x11')]['message']);}logger[_0x4542('0x11')](_0x4542('0x13'),_0x36ebea,_0x1f66ba[_0x4542('0x11')][_0x4542('0x14')]);return _0x329c6b(_0x1f66ba['error']['message']);}else{logger[_0x4542('0x15')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x36ebea,_0x4542('0xf'));_0x329c6b(_0x1f66ba[_0x4542('0x16')][_0x4542('0x14')]);}})[_0x4542('0x17')](function(_0x1ee7fc){logger[_0x4542('0x11')](_0x4542('0x13'),_0x36ebea,_0x1ee7fc);_0x57e349(_0x1ee7fc);});});}
\ No newline at end of file
+var _0xa93a=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x585829,_0x30a33b){var _0x1166c8=function(_0x54673b){while(--_0x54673b){_0x585829['push'](_0x585829['shift']());}};_0x1166c8(++_0x30a33b);}(_0xa93a,0x17a));var _0xaa93=function(_0x5f061a,_0x4393ce){_0x5f061a=_0x5f061a-0x0;var _0x54c217=_0xa93a[_0x5f061a];return _0x54c217;};'use strict';var _=require(_0xaa93('0x0'));var util=require(_0xaa93('0x1'));var moment=require(_0xaa93('0x2'));var BPromise=require(_0xaa93('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaa93('0x4'));var db=require(_0xaa93('0x5'))['db'];var utils=require(_0xaa93('0x6'));var logger=require(_0xaa93('0x7'))(_0xaa93('0x8'));var config=require(_0xaa93('0x9'));var jayson=require(_0xaa93('0xa'));var client=jayson['client'][_0xaa93('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44ce9c,_0x3da1a0,_0x42d7a9){return new BPromise(function(_0x5a4d47,_0xe27aa2){return client[_0xaa93('0xc')](_0x44ce9c,_0x42d7a9)[_0xaa93('0xd')](function(_0xfcb3a6){logger[_0xaa93('0xe')](_0xaa93('0xf'),_0x3da1a0,_0xaa93('0x10'));logger[_0xaa93('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x3da1a0,_0xaa93('0x10'),JSON[_0xaa93('0x12')](_0xfcb3a6));if(_0xfcb3a6[_0xaa93('0x13')]){if(_0xfcb3a6[_0xaa93('0x13')][_0xaa93('0x14')]===0x1f4){logger[_0xaa93('0x13')](_0xaa93('0xf'),_0x3da1a0,_0xfcb3a6[_0xaa93('0x13')][_0xaa93('0x15')]);return _0xe27aa2(_0xfcb3a6['error'][_0xaa93('0x15')]);}logger['error'](_0xaa93('0xf'),_0x3da1a0,_0xfcb3a6['error'][_0xaa93('0x15')]);return _0x5a4d47(_0xfcb3a6[_0xaa93('0x13')]['message']);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x3da1a0,_0xaa93('0x10'));_0x5a4d47(_0xfcb3a6[_0xaa93('0x16')]['message']);}})[_0xaa93('0x17')](function(_0x5eea0d){logger[_0xaa93('0x13')](_0xaa93('0xf'),_0x3da1a0,_0x5eea0d);_0xe27aa2(_0x5eea0d);});});}
\ No newline at end of file
index ca7ac0d..a05580c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f1d=['post','create','delete','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x12f591,_0x2a1f03){var _0x4e51e1=function(_0x4a4486){while(--_0x4a4486){_0x12f591['push'](_0x12f591['shift']());}};_0x4e51e1(++_0x2a1f03);}(_0x1f1d,0x1e5));var _0xd1f1=function(_0xcf7b69,_0x273a94){_0xcf7b69=_0xcf7b69-0x0;var _0x42d79e=_0x1f1d[_0xcf7b69];return _0x42d79e;};'use strict';var multer=require(_0xd1f1('0x0'));var util=require(_0xd1f1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd1f1('0x2'));var router=express['Router']();var fs_extra=require(_0xd1f1('0x3'));var auth=require(_0xd1f1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd1f1('0x5'));var controller=require(_0xd1f1('0x6'));router[_0xd1f1('0x7')]('/',auth[_0xd1f1('0x8')](),controller[_0xd1f1('0x9')]);router[_0xd1f1('0x7')](_0xd1f1('0xa'),auth[_0xd1f1('0x8')](),controller['show']);router[_0xd1f1('0xb')]('/',auth[_0xd1f1('0x8')](),controller[_0xd1f1('0xc')]);router['put'](_0xd1f1('0xa'),auth[_0xd1f1('0x8')](),controller['update']);router[_0xd1f1('0xd')](_0xd1f1('0xa'),auth['isAuthenticated'](),controller[_0xd1f1('0xe')]);module[_0xd1f1('0xf')]=router;
\ No newline at end of file
+var _0x35a7=['path','Router','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','show','put','/:id','exports','multer','util'];(function(_0x10e188,_0x72cdc6){var _0x47be3a=function(_0x3f821e){while(--_0x3f821e){_0x10e188['push'](_0x10e188['shift']());}};_0x47be3a(++_0x72cdc6);}(_0x35a7,0x132));var _0x735a=function(_0x440a9b,_0x19435a){_0x440a9b=_0x440a9b-0x0;var _0x4fe804=_0x35a7[_0x440a9b];return _0x4fe804;};'use strict';var multer=require(_0x735a('0x0'));var util=require(_0x735a('0x1'));var path=require(_0x735a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x735a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x735a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x735a('0x5'));var controller=require(_0x735a('0x6'));router[_0x735a('0x7')]('/',auth[_0x735a('0x8')](),controller[_0x735a('0x9')]);router[_0x735a('0x7')]('/:id',auth[_0x735a('0x8')](),controller[_0x735a('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x735a('0xb')](_0x735a('0xc'),auth[_0x735a('0x8')](),controller['update']);router['delete'](_0x735a('0xc'),auth[_0x735a('0x8')](),controller['destroy']);module[_0x735a('0xd')]=router;
\ No newline at end of file
index 7c54c94..baafbe7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72dd=['BOOLEAN','exports','ENUM','string','variable','keyValue','picklist','STRING'];(function(_0x111daf,_0x1607db){var _0x48a287=function(_0x24b0cb){while(--_0x24b0cb){_0x111daf['push'](_0x111daf['shift']());}};_0x48a287(++_0x1607db);}(_0x72dd,0x141));var _0xd72d=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x72dd[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0xd72d('0x0')]={'type':{'type':Sequelize[_0xd72d('0x1')](_0xd72d('0x2'),_0xd72d('0x3'),'customVariable',_0xd72d('0x4'),_0xd72d('0x5')),'defaultValue':_0xd72d('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xd72d('0x1')](_0xd72d('0x2'),_0xd72d('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xd72d('0x6')]},'idField':{'type':Sequelize[_0xd72d('0x6')]},'nameField':{'type':Sequelize[_0xd72d('0x6')]},'customField':{'type':Sequelize[_0xd72d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd72d('0x6')]}};
\ No newline at end of file
+var _0x607e=['customVariable','keyValue','picklist','STRING','variable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x48f369,_0x3a7a90){var _0x45a957=function(_0x597ccd){while(--_0x597ccd){_0x48f369['push'](_0x48f369['shift']());}};_0x45a957(++_0x3a7a90);}(_0x607e,0x7e));var _0xe607=function(_0x506cfa,_0x2e301){_0x506cfa=_0x506cfa-0x0;var _0x23c230=_0x607e[_0x506cfa];return _0x23c230;};'use strict';var Sequelize=require(_0xe607('0x0'));module[_0xe607('0x1')]={'type':{'type':Sequelize[_0xe607('0x2')](_0xe607('0x3'),'variable',_0xe607('0x4'),_0xe607('0x5'),_0xe607('0x6')),'defaultValue':_0xe607('0x3')},'content':{'type':Sequelize[_0xe607('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xe607('0x3'),_0xe607('0x8'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe607('0x7')]},'nameField':{'type':Sequelize[_0xe607('0x7')]},'customField':{'type':Sequelize[_0xe607('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe607('0x7')]}};
\ No newline at end of file
index 86b5b07..9164f81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c5e=['body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','FreshdeskField','includeAll','include','findAll','rows','catch','show','keys','find','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c5e,0x9c));var _0xe9c5=function(_0x5b4a98,_0x376257){_0x5b4a98=_0x5b4a98-0x0;var _0x222b95=_0x9c5e[_0x5b4a98];return _0x222b95;};'use strict';var emlformat=require(_0xe9c5('0x0'));var rimraf=require(_0xe9c5('0x1'));var zipdir=require(_0xe9c5('0x2'));var jsonpatch=require(_0xe9c5('0x3'));var rp=require(_0xe9c5('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe9c5('0x5'));var path=require(_0xe9c5('0x6'));var sox=require('sox');var csv=require(_0xe9c5('0x7'));var ejs=require(_0xe9c5('0x8'));var fs=require('fs');var fs_extra=require(_0xe9c5('0x9'));var _=require(_0xe9c5('0xa'));var squel=require('squel');var crypto=require(_0xe9c5('0xb'));var jsforce=require(_0xe9c5('0xc'));var deskjs=require(_0xe9c5('0xd'));var toCsv=require(_0xe9c5('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe9c5('0xe'));var authService=require(_0xe9c5('0xf'));var qs=require(_0xe9c5('0x10'));var as=require(_0xe9c5('0x11'));var hardwareService=require(_0xe9c5('0x12'));var logger=require(_0xe9c5('0x13'))(_0xe9c5('0x14'));var utils=require(_0xe9c5('0x15'));var config=require(_0xe9c5('0x16'));var licenseUtil=require(_0xe9c5('0x17'));var db=require(_0xe9c5('0x18'))['db'];function respondWithStatusCode(_0x27f3e1,_0x471401){_0x471401=_0x471401||0xcc;return function(_0x25ff11){if(_0x25ff11){return _0x27f3e1[_0xe9c5('0x19')](_0x471401);}return _0x27f3e1[_0xe9c5('0x1a')](_0x471401)['end']();};}function respondWithResult(_0x3cce36,_0xe98b11){_0xe98b11=_0xe98b11||0xc8;return function(_0x5eb474){if(_0x5eb474){return _0x3cce36[_0xe9c5('0x1a')](_0xe98b11)[_0xe9c5('0x1b')](_0x5eb474);}};}function respondWithFilteredResult(_0x232584,_0x5d8236){return function(_0x163253){if(_0x163253){var _0x14eb41=typeof _0x5d8236['offset']===_0xe9c5('0x1c')&&typeof _0x5d8236[_0xe9c5('0x1d')]===_0xe9c5('0x1c');var _0x154390=_0x163253[_0xe9c5('0x1e')];var _0x4d9c7d=_0x14eb41?0x0:_0x5d8236[_0xe9c5('0x1f')];var _0x1cecae=_0x14eb41?_0x163253[_0xe9c5('0x1e')]:_0x5d8236[_0xe9c5('0x1f')]+_0x5d8236['limit'];var _0x26492a;if(_0x1cecae>=_0x154390){_0x1cecae=_0x154390;_0x26492a=0xc8;}else{_0x26492a=0xce;}_0x232584[_0xe9c5('0x1a')](_0x26492a);return _0x232584[_0xe9c5('0x20')](_0xe9c5('0x21'),_0x4d9c7d+'-'+_0x1cecae+'/'+_0x154390)[_0xe9c5('0x1b')](_0x163253);}return null;};}function patchUpdates(_0x58fbad){return function(_0x51e860){try{jsonpatch[_0xe9c5('0x22')](_0x51e860,_0x58fbad,!![]);}catch(_0x57818d){return BPromise[_0xe9c5('0x23')](_0x57818d);}return _0x51e860[_0xe9c5('0x24')]();};}function saveUpdates(_0x21b02a,_0x4d16bc){return function(_0x5750ff){if(_0x5750ff){return _0x5750ff[_0xe9c5('0x25')](_0x21b02a)[_0xe9c5('0x26')](function(_0x37fb90){return _0x37fb90;});}return null;};}function removeEntity(_0x189a13,_0x34a7c8){return function(_0x245161){if(_0x245161){return _0x245161[_0xe9c5('0x27')]()[_0xe9c5('0x26')](function(){_0x189a13[_0xe9c5('0x1a')](0xcc)[_0xe9c5('0x28')]();});}};}function handleEntityNotFound(_0x5a3caa,_0x5c8bb7){return function(_0x250e1c){if(!_0x250e1c){_0x5a3caa[_0xe9c5('0x19')](0x194);}return _0x250e1c;};}function handleError(_0x298dca,_0x3bf679){_0x3bf679=_0x3bf679||0x1f4;return function(_0x33fe71){logger[_0xe9c5('0x29')](_0x33fe71['stack']);if(_0x33fe71[_0xe9c5('0x2a')]){delete _0x33fe71['name'];}_0x298dca[_0xe9c5('0x1a')](_0x3bf679)['send'](_0x33fe71);};}exports[_0xe9c5('0x2b')]=function(_0x2112a6,_0x52d008){var _0x36d145={},_0x46d253={},_0x334f5a={'count':0x0,'rows':[]};var _0x37cfa5=_[_0xe9c5('0x2c')](db['FreshdeskField'][_0xe9c5('0x2d')],function(_0x4fcabd){return{'name':_0x4fcabd[_0xe9c5('0x2e')],'type':_0x4fcabd['type'][_0xe9c5('0x2f')]};});_0x46d253[_0xe9c5('0x30')]=_[_0xe9c5('0x2c')](_0x37cfa5,_0xe9c5('0x2a'));_0x46d253[_0xe9c5('0x31')]=_['keys'](_0x2112a6[_0xe9c5('0x31')]);_0x46d253[_0xe9c5('0x32')]=_[_0xe9c5('0x33')](_0x46d253[_0xe9c5('0x30')],_0x46d253[_0xe9c5('0x31')]);_0x36d145['attributes']=_['intersection'](_0x46d253[_0xe9c5('0x30')],qs[_0xe9c5('0x34')](_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x34')]));_0x36d145[_0xe9c5('0x35')]=_0x36d145[_0xe9c5('0x35')][_0xe9c5('0x36')]?_0x36d145[_0xe9c5('0x35')]:_0x46d253['model'];if(!_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x37')]('nolimit')){_0x36d145[_0xe9c5('0x1d')]=qs['limit'](_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x1d')]);_0x36d145[_0xe9c5('0x1f')]=qs[_0xe9c5('0x1f')](_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x1f')]);}_0x36d145[_0xe9c5('0x38')]=qs[_0xe9c5('0x39')](_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x39')]);_0x36d145[_0xe9c5('0x3a')]=qs[_0xe9c5('0x32')](_[_0xe9c5('0x3b')](_0x2112a6[_0xe9c5('0x31')],_0x46d253[_0xe9c5('0x32')]),_0x37cfa5);if(_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x3c')]){_0x36d145[_0xe9c5('0x3a')]=_[_0xe9c5('0x3d')](_0x36d145['where'],{'$or':_[_0xe9c5('0x2c')](_0x37cfa5,function(_0x2e3f15){if(_0x2e3f15[_0xe9c5('0x3e')]!==_0xe9c5('0x3f')){var _0x204b53={};_0x204b53[_0x2e3f15[_0xe9c5('0x2a')]]={'$like':'%'+_0x2112a6['query'][_0xe9c5('0x3c')]+'%'};return _0x204b53;}})});}_0x36d145=_[_0xe9c5('0x3d')]({},_0x36d145,_0x2112a6[_0xe9c5('0x40')]);var _0x480b83={'where':_0x36d145[_0xe9c5('0x3a')]};return db[_0xe9c5('0x41')][_0xe9c5('0x1e')](_0x480b83)[_0xe9c5('0x26')](function(_0x2c1615){_0x334f5a[_0xe9c5('0x1e')]=_0x2c1615;if(_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x42')]){_0x36d145[_0xe9c5('0x43')]=[{'all':!![]}];}return db[_0xe9c5('0x41')][_0xe9c5('0x44')](_0x36d145);})['then'](function(_0x51dd18){_0x334f5a[_0xe9c5('0x45')]=_0x51dd18;return _0x334f5a;})[_0xe9c5('0x26')](respondWithFilteredResult(_0x52d008,_0x36d145))[_0xe9c5('0x46')](handleError(_0x52d008,null));};exports[_0xe9c5('0x47')]=function(_0x4ca4b0,_0x4a3fc5){var _0x382405={'raw':!![],'where':{'id':_0x4ca4b0['params']['id']}},_0x144e85={};_0x144e85[_0xe9c5('0x30')]=_['keys'](db['FreshdeskField']['rawAttributes']);_0x144e85[_0xe9c5('0x31')]=_[_0xe9c5('0x48')](_0x4ca4b0[_0xe9c5('0x31')]);_0x144e85[_0xe9c5('0x32')]=_['intersection'](_0x144e85[_0xe9c5('0x30')],_0x144e85[_0xe9c5('0x31')]);_0x382405[_0xe9c5('0x35')]=_[_0xe9c5('0x33')](_0x144e85[_0xe9c5('0x30')],qs[_0xe9c5('0x34')](_0x4ca4b0[_0xe9c5('0x31')][_0xe9c5('0x34')]));_0x382405['attributes']=_0x382405[_0xe9c5('0x35')][_0xe9c5('0x36')]?_0x382405[_0xe9c5('0x35')]:_0x144e85[_0xe9c5('0x30')];if(_0x4ca4b0[_0xe9c5('0x31')][_0xe9c5('0x42')]){_0x382405['include']=[{'all':!![]}];}_0x382405=_['merge']({},_0x382405,_0x4ca4b0['options']);return db['FreshdeskField'][_0xe9c5('0x49')](_0x382405)[_0xe9c5('0x26')](handleEntityNotFound(_0x4a3fc5,null))[_0xe9c5('0x26')](respondWithResult(_0x4a3fc5,null))['catch'](handleError(_0x4a3fc5,null));};exports[_0xe9c5('0x4a')]=function(_0x520248,_0x1ed99e){return db[_0xe9c5('0x41')][_0xe9c5('0x4a')](_0x520248[_0xe9c5('0x4b')],{})['then'](respondWithResult(_0x1ed99e,0xc9))[_0xe9c5('0x46')](handleError(_0x1ed99e,null));};exports[_0xe9c5('0x25')]=function(_0x1da6a3,_0x249940){if(_0x1da6a3['body']['id']){delete _0x1da6a3[_0xe9c5('0x4b')]['id'];}return db[_0xe9c5('0x41')][_0xe9c5('0x49')]({'where':{'id':_0x1da6a3[_0xe9c5('0x4c')]['id']}})[_0xe9c5('0x26')](handleEntityNotFound(_0x249940,null))[_0xe9c5('0x26')](saveUpdates(_0x1da6a3['body'],null))[_0xe9c5('0x26')](respondWithResult(_0x249940,null))[_0xe9c5('0x46')](handleError(_0x249940,null));};exports[_0xe9c5('0x27')]=function(_0x9d0154,_0x5e7c24){return db[_0xe9c5('0x41')][_0xe9c5('0x49')]({'where':{'id':_0x9d0154[_0xe9c5('0x4c')]['id']}})[_0xe9c5('0x26')](handleEntityNotFound(_0x5e7c24,null))[_0xe9c5('0x26')](removeEntity(_0x5e7c24,null))[_0xe9c5('0x46')](handleError(_0x5e7c24,null));};
\ No newline at end of file
+var _0xda3f=['keys','filters','intersection','attributes','fields','nolimit','sort','filter','where','merge','type','VIRTUAL','options','FreshdeskField','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find','create','body','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','map','key','model','query'];(function(_0x96f74c,_0xfc30a4){var _0x379222=function(_0x1bbde9){while(--_0x1bbde9){_0x96f74c['push'](_0x96f74c['shift']());}};_0x379222(++_0xfc30a4);}(_0xda3f,0xec));var _0xfda3=function(_0x332eb1,_0x5c02ff){_0x332eb1=_0x332eb1-0x0;var _0x47b468=_0xda3f[_0x332eb1];return _0x47b468;};'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['index']=function(_0x3c1549,_0x4101b1){var _0x301509={},_0x474992={},_0xe21ec6={'count':0x0,'rows':[]};var _0x3cfeb2=_[_0xfda3('0x28')](db['FreshdeskField']['rawAttributes'],function(_0x3aef3c){return{'name':_0x3aef3c['fieldName'],'type':_0x3aef3c['type'][_0xfda3('0x29')]};});_0x474992[_0xfda3('0x2a')]=_[_0xfda3('0x28')](_0x3cfeb2,_0xfda3('0x26'));_0x474992[_0xfda3('0x2b')]=_[_0xfda3('0x2c')](_0x3c1549[_0xfda3('0x2b')]);_0x474992[_0xfda3('0x2d')]=_[_0xfda3('0x2e')](_0x474992['model'],_0x474992[_0xfda3('0x2b')]);_0x301509[_0xfda3('0x2f')]=_[_0xfda3('0x2e')](_0x474992[_0xfda3('0x2a')],qs[_0xfda3('0x30')](_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x30')]));_0x301509[_0xfda3('0x2f')]=_0x301509[_0xfda3('0x2f')]['length']?_0x301509['attributes']:_0x474992[_0xfda3('0x2a')];if(!_0x3c1549[_0xfda3('0x2b')]['hasOwnProperty'](_0xfda3('0x31'))){_0x301509[_0xfda3('0x1b')]=qs[_0xfda3('0x1b')](_0x3c1549['query'][_0xfda3('0x1b')]);_0x301509[_0xfda3('0x19')]=qs[_0xfda3('0x19')](_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x19')]);}_0x301509['order']=qs[_0xfda3('0x32')](_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x32')]);_0x301509['where']=qs[_0xfda3('0x2d')](_['pick'](_0x3c1549[_0xfda3('0x2b')],_0x474992[_0xfda3('0x2d')]),_0x3cfeb2);if(_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x33')]){_0x301509[_0xfda3('0x34')]=_[_0xfda3('0x35')](_0x301509[_0xfda3('0x34')],{'$or':_[_0xfda3('0x28')](_0x3cfeb2,function(_0x577be8){if(_0x577be8[_0xfda3('0x36')]!==_0xfda3('0x37')){var _0xd2dde0={};_0xd2dde0[_0x577be8[_0xfda3('0x26')]]={'$like':'%'+_0x3c1549['query'][_0xfda3('0x33')]+'%'};return _0xd2dde0;}})});}_0x301509=_[_0xfda3('0x35')]({},_0x301509,_0x3c1549[_0xfda3('0x38')]);var _0x5bad90={'where':_0x301509['where']};return db[_0xfda3('0x39')][_0xfda3('0x1c')](_0x5bad90)[_0xfda3('0x23')](function(_0x1aaa6c){_0xe21ec6[_0xfda3('0x1c')]=_0x1aaa6c;if(_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x3a')]){_0x301509[_0xfda3('0x3b')]=[{'all':!![]}];}return db[_0xfda3('0x39')][_0xfda3('0x3c')](_0x301509);})['then'](function(_0x27200f){_0xe21ec6[_0xfda3('0x3d')]=_0x27200f;return _0xe21ec6;})['then'](respondWithFilteredResult(_0x4101b1,_0x301509))[_0xfda3('0x3e')](handleError(_0x4101b1,null));};exports['show']=function(_0x51a314,_0x4e6886){var _0x2208bc={'raw':!![],'where':{'id':_0x51a314[_0xfda3('0x3f')]['id']}},_0x107fb1={};_0x107fb1[_0xfda3('0x2a')]=_['keys'](db[_0xfda3('0x39')][_0xfda3('0x40')]);_0x107fb1[_0xfda3('0x2b')]=_[_0xfda3('0x2c')](_0x51a314['query']);_0x107fb1[_0xfda3('0x2d')]=_[_0xfda3('0x2e')](_0x107fb1[_0xfda3('0x2a')],_0x107fb1['query']);_0x2208bc['attributes']=_[_0xfda3('0x2e')](_0x107fb1[_0xfda3('0x2a')],qs[_0xfda3('0x30')](_0x51a314[_0xfda3('0x2b')][_0xfda3('0x30')]));_0x2208bc[_0xfda3('0x2f')]=_0x2208bc[_0xfda3('0x2f')][_0xfda3('0x41')]?_0x2208bc[_0xfda3('0x2f')]:_0x107fb1[_0xfda3('0x2a')];if(_0x51a314[_0xfda3('0x2b')][_0xfda3('0x3a')]){_0x2208bc[_0xfda3('0x3b')]=[{'all':!![]}];}_0x2208bc=_[_0xfda3('0x35')]({},_0x2208bc,_0x51a314['options']);return db['FreshdeskField'][_0xfda3('0x42')](_0x2208bc)[_0xfda3('0x23')](handleEntityNotFound(_0x4e6886,null))[_0xfda3('0x23')](respondWithResult(_0x4e6886,null))[_0xfda3('0x3e')](handleError(_0x4e6886,null));};exports[_0xfda3('0x43')]=function(_0x60a89d,_0x192133){return db[_0xfda3('0x39')][_0xfda3('0x43')](_0x60a89d[_0xfda3('0x44')],{})['then'](respondWithResult(_0x192133,0xc9))[_0xfda3('0x3e')](handleError(_0x192133,null));};exports[_0xfda3('0x22')]=function(_0x481356,_0x36aa3a){if(_0x481356[_0xfda3('0x44')]['id']){delete _0x481356['body']['id'];}return db[_0xfda3('0x39')][_0xfda3('0x42')]({'where':{'id':_0x481356[_0xfda3('0x3f')]['id']}})['then'](handleEntityNotFound(_0x36aa3a,null))[_0xfda3('0x23')](saveUpdates(_0x481356[_0xfda3('0x44')],null))[_0xfda3('0x23')](respondWithResult(_0x36aa3a,null))['catch'](handleError(_0x36aa3a,null));};exports[_0xfda3('0x45')]=function(_0x33565d,_0x2f54eb){return db[_0xfda3('0x39')][_0xfda3('0x42')]({'where':{'id':_0x33565d['params']['id']}})[_0xfda3('0x23')](handleEntityNotFound(_0x2f54eb,null))['then'](removeEntity(_0x2f54eb,null))[_0xfda3('0x3e')](handleError(_0x2f54eb,null));};
\ No newline at end of file
index 56f91ec..3b61ce4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc47c=['../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','freshdesk_unique_index','idField','FieldId','moment','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc47c,0xe0));var _0xcc47=function(_0x5eb1c6,_0x1989ef){_0x5eb1c6=_0x5eb1c6-0x0;var _0x584208=_0xc47c[_0x5eb1c6];return _0x584208;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xcc47('0x0'));var BPromise=require('bluebird');var rp=require(_0xcc47('0x1'));var fs=require('fs');var path=require(_0xcc47('0x2'));var rimraf=require(_0xcc47('0x3'));var config=require(_0xcc47('0x4'));var attributes=require(_0xcc47('0x5'));module[_0xcc47('0x6')]=function(_0x462acf,_0x5e52b0){return _0x462acf[_0xcc47('0x7')](_0xcc47('0x8'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0xcc47('0x9'),'fields':[_0xcc47('0xa'),_0xcc47('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9b40=['request-promise','../../config/environment','define','freshdesk_unique_index','idField','FieldId','util','api','moment','bluebird'];(function(_0x4742a1,_0x3aaadf){var _0x1555b1=function(_0x381116){while(--_0x381116){_0x4742a1['push'](_0x4742a1['shift']());}};_0x1555b1(++_0x3aaadf);}(_0x9b40,0xf6));var _0x09b4=function(_0x3b886d,_0x1b86a8){_0x3b886d=_0x3b886d-0x0;var _0x321ea6=_0x9b40[_0x3b886d];return _0x321ea6;};'use strict';var _=require('lodash');var util=require(_0x09b4('0x0'));var logger=require('../../config/logger')(_0x09b4('0x1'));var moment=require(_0x09b4('0x2'));var BPromise=require(_0x09b4('0x3'));var rp=require(_0x09b4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x09b4('0x5'));var attributes=require('./intFreshdeskField.attributes');module['exports']=function(_0x20e14b,_0x535359){return _0x20e14b[_0x09b4('0x6')]('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x09b4('0x7'),'fields':[_0x09b4('0x8'),_0x09b4('0x9')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 5b1426f..605e54d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5671=['../../config/environment','jayson/promise','client','http','request','FreshdeskField,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1ac051,_0x101a2a){var _0x25eac6=function(_0x43ce26){while(--_0x43ce26){_0x1ac051['push'](_0x1ac051['shift']());}};_0x25eac6(++_0x101a2a);}(_0x5671,0x1d4));var _0x1567=function(_0x476b5f,_0x1f9952){_0x476b5f=_0x476b5f-0x0;var _0x5a23d8=_0x5671[_0x476b5f];return _0x5a23d8;};'use strict';var _=require('lodash');var util=require(_0x1567('0x0'));var moment=require('moment');var BPromise=require(_0x1567('0x1'));var rs=require(_0x1567('0x2'));var fs=require('fs');var Redis=require(_0x1567('0x3'));var db=require(_0x1567('0x4'))['db'];var utils=require(_0x1567('0x5'));var logger=require(_0x1567('0x6'))('rpc');var config=require(_0x1567('0x7'));var jayson=require(_0x1567('0x8'));var client=jayson[_0x1567('0x9')][_0x1567('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2597aa,_0x53afe1,_0x29a86d){return new BPromise(function(_0x414020,_0x5f5778){return client[_0x1567('0xb')](_0x2597aa,_0x29a86d)['then'](function(_0x529764){logger['info'](_0x1567('0xc'),_0x53afe1,_0x1567('0xd'));logger['debug']('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x53afe1,_0x1567('0xd'),JSON[_0x1567('0xe')](_0x529764));if(_0x529764[_0x1567('0xf')]){if(_0x529764[_0x1567('0xf')]['code']===0x1f4){logger[_0x1567('0xf')]('FreshdeskField,\x20%s,\x20%s',_0x53afe1,_0x529764[_0x1567('0xf')]['message']);return _0x5f5778(_0x529764[_0x1567('0xf')][_0x1567('0x10')]);}logger[_0x1567('0xf')](_0x1567('0xc'),_0x53afe1,_0x529764[_0x1567('0xf')][_0x1567('0x10')]);return _0x414020(_0x529764[_0x1567('0xf')]['message']);}else{logger[_0x1567('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x53afe1,_0x1567('0xd'));_0x414020(_0x529764[_0x1567('0x12')][_0x1567('0x10')]);}})['catch'](function(_0x2faaed){logger[_0x1567('0xf')](_0x1567('0xc'),_0x53afe1,_0x2faaed);_0x5f5778(_0x2faaed);});});}
\ No newline at end of file
+var _0xdc81=['code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error'];(function(_0xb41f79,_0x41c4ea){var _0x571207=function(_0xc20cf0){while(--_0xc20cf0){_0xb41f79['push'](_0xb41f79['shift']());}};_0x571207(++_0x41c4ea);}(_0xdc81,0xac));var _0x1dc8=function(_0x3e2e03,_0x1e0695){_0x3e2e03=_0x3e2e03-0x0;var _0x13f7da=_0xdc81[_0x3e2e03];return _0x13f7da;};'use strict';var _=require(_0x1dc8('0x0'));var util=require('util');var moment=require(_0x1dc8('0x1'));var BPromise=require(_0x1dc8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1dc8('0x3'));var db=require(_0x1dc8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1dc8('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1dc8('0x6'));var client=jayson[_0x1dc8('0x7')][_0x1dc8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7c8a86,_0xc2d8eb,_0x32e0d7){return new BPromise(function(_0x392004,_0x8147b5){return client[_0x1dc8('0x9')](_0x7c8a86,_0x32e0d7)[_0x1dc8('0xa')](function(_0x1ea337){logger[_0x1dc8('0xb')](_0x1dc8('0xc'),_0xc2d8eb,_0x1dc8('0xd'));logger[_0x1dc8('0xe')](_0x1dc8('0xf'),_0xc2d8eb,_0x1dc8('0xd'),JSON['stringify'](_0x1ea337));if(_0x1ea337[_0x1dc8('0x10')]){if(_0x1ea337[_0x1dc8('0x10')][_0x1dc8('0x11')]===0x1f4){logger['error'](_0x1dc8('0xc'),_0xc2d8eb,_0x1ea337[_0x1dc8('0x10')]['message']);return _0x8147b5(_0x1ea337[_0x1dc8('0x10')][_0x1dc8('0x12')]);}logger['error']('FreshdeskField,\x20%s,\x20%s',_0xc2d8eb,_0x1ea337[_0x1dc8('0x10')][_0x1dc8('0x12')]);return _0x392004(_0x1ea337[_0x1dc8('0x10')][_0x1dc8('0x12')]);}else{logger[_0x1dc8('0xb')]('FreshdeskField,\x20%s,\x20%s',_0xc2d8eb,_0x1dc8('0xd'));_0x392004(_0x1ea337[_0x1dc8('0x13')][_0x1dc8('0x12')]);}})[_0x1dc8('0x14')](function(_0x4f2b8a){logger[_0x1dc8('0x10')](_0x1dc8('0xc'),_0xc2d8eb,_0x4f2b8a);_0x8147b5(_0x4f2b8a);});});}
\ No newline at end of file
index 286c882..fc5432d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefda=['update','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','getFields','post','create','addConfiguration','put'];(function(_0x21c504,_0x3e00c6){var _0x51b5c3=function(_0x5b3f42){while(--_0x5b3f42){_0x21c504['push'](_0x21c504['shift']());}};_0x51b5c3(++_0x3e00c6);}(_0xefda,0x96));var _0xaefd=function(_0x9adac6,_0x40c370){_0x9adac6=_0x9adac6-0x0;var _0x14eb0a=_0xefda[_0x9adac6];return _0x14eb0a;};'use strict';var multer=require(_0xaefd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaefd('0x1'));var express=require(_0xaefd('0x2'));var router=express['Router']();var fs_extra=require(_0xaefd('0x3'));var auth=require(_0xaefd('0x4'));var interaction=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var controller=require(_0xaefd('0x7'));router[_0xaefd('0x8')]('/',auth['isAuthenticated'](),controller[_0xaefd('0x9')]);router[_0xaefd('0x8')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller['show']);router[_0xaefd('0x8')](_0xaefd('0xc'),auth[_0xaefd('0xb')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0xaefd('0xb')](),controller[_0xaefd('0xd')]);router[_0xaefd('0xe')]('/',auth[_0xaefd('0xb')](),controller[_0xaefd('0xf')]);router[_0xaefd('0xe')](_0xaefd('0xc'),auth[_0xaefd('0xb')](),controller[_0xaefd('0x10')]);router[_0xaefd('0x11')](_0xaefd('0xa'),auth['isAuthenticated'](),controller[_0xaefd('0x12')]);router['delete'](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller[_0xaefd('0x13')]);module[_0xaefd('0x14')]=router;
\ No newline at end of file
+var _0xda3f=['/:id/fields','getFields','post','create','addConfiguration','update','delete','exports','util','path','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations'];(function(_0x44039a,_0x2ac8a8){var _0x525de5=function(_0x1dc635){while(--_0x1dc635){_0x44039a['push'](_0x44039a['shift']());}};_0x525de5(++_0x2ac8a8);}(_0xda3f,0xec));var _0xfda3=function(_0x472bc8,_0x347680){_0x472bc8=_0x472bc8-0x0;var _0x27ec1a=_0xda3f[_0x472bc8];return _0x27ec1a;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./intFreshsalesAccount.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x5')](_0xfda3('0x9'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0x5')](_0xfda3('0xb'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')]('/',auth['isAuthenticated'](),controller[_0xfda3('0xe')]);router[_0xfda3('0xd')](_0xfda3('0x9'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xf')]);router['put'](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0x10')]);router[_0xfda3('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xfda3('0x12')]=router;
\ No newline at end of file
index 519ad6d..6f2a432 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd117=['remoteUri','sequelize','exports','STRING','username'];(function(_0x46df94,_0x5bf7fa){var _0x4721ca=function(_0x34c1e3){while(--_0x34c1e3){_0x46df94['push'](_0x46df94['shift']());}};_0x4721ca(++_0x5bf7fa);}(_0xd117,0x182));var _0x7d11=function(_0x4af01e,_0x543f5c){_0x4af01e=_0x4af01e-0x0;var _0x178c11=_0xd117[_0x4af01e];return _0x178c11;};'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 _0x7096=['exports','STRING','username','remoteUri'];(function(_0x187bd2,_0x2dc613){var _0x360db3=function(_0x361152){while(--_0x361152){_0x187bd2['push'](_0x187bd2['shift']());}};_0x360db3(++_0x2dc613);}(_0x7096,0x10c));var _0x6709=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x7096[_0x33032e];return _0x13316b;};'use strict';var Sequelize=require('sequelize');module[_0x6709('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6709('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x6709('0x2')},'apiKey':{'type':Sequelize[_0x6709('0x1')]},'remoteUri':{'type':Sequelize[_0x6709('0x1')],'unique':_0x6709('0x3')},'serverUrl':{'type':Sequelize[_0x6709('0x1')],'allowNull':![]}};
\ No newline at end of file
index a8d5b6b..94f08a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16a1=['body','params','getConfigurations','findOne','FreshsalesConfiguration','pick','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','Subjects','getFields','apiKey','username','remoteUri','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','stringify','send','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','includeAll','include','findAll','rows','catch','show','options','create'];(function(_0x3d4ef1,_0x5a957c){var _0x409423=function(_0x1ab129){while(--_0x1ab129){_0x3d4ef1['push'](_0x3d4ef1['shift']());}};_0x409423(++_0x5a957c);}(_0x16a1,0xeb));var _0x116a=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x16a1[_0x1035c1];return _0x308d67;};'use strict';var emlformat=require(_0x116a('0x0'));var rimraf=require(_0x116a('0x1'));var zipdir=require(_0x116a('0x2'));var jsonpatch=require(_0x116a('0x3'));var rp=require('request-promise');var moment=require(_0x116a('0x4'));var BPromise=require(_0x116a('0x5'));var Mustache=require(_0x116a('0x6'));var util=require('util');var path=require(_0x116a('0x7'));var sox=require(_0x116a('0x8'));var csv=require(_0x116a('0x9'));var ejs=require(_0x116a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x116a('0xb'));var crypto=require(_0x116a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x116a('0xd'));var toCsv=require(_0x116a('0x9'));var querystring=require(_0x116a('0xe'));var Papa=require(_0x116a('0xf'));var Redis=require(_0x116a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x116a('0x11'));var as=require(_0x116a('0x12'));var hardwareService=require(_0x116a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x116a('0x14'));var config=require(_0x116a('0x15'));var licenseUtil=require(_0x116a('0x16'));var db=require(_0x116a('0x17'))['db'];var integrations=require(_0x116a('0x18'));function respondWithStatusCode(_0x441c39,_0x11b1f8){_0x11b1f8=_0x11b1f8||0xcc;return function(_0x2bc45c){if(_0x2bc45c){return _0x441c39[_0x116a('0x19')](_0x11b1f8);}return _0x441c39[_0x116a('0x1a')](_0x11b1f8)[_0x116a('0x1b')]();};}function respondWithResult(_0x410de8,_0x1cd54c){_0x1cd54c=_0x1cd54c||0xc8;return function(_0x137fca){if(_0x137fca){return _0x410de8['status'](_0x1cd54c)[_0x116a('0x1c')](_0x137fca);}};}function respondWithFilteredResult(_0x190b1b,_0x89b776){return function(_0xcf15c0){if(_0xcf15c0){var _0x426b94=typeof _0x89b776['offset']==='undefined'&&typeof _0x89b776[_0x116a('0x1d')]===_0x116a('0x1e');var _0x59054d=_0xcf15c0['count'];var _0x39a9bf=_0x426b94?0x0:_0x89b776[_0x116a('0x1f')];var _0x346f0c=_0x426b94?_0xcf15c0[_0x116a('0x20')]:_0x89b776['offset']+_0x89b776[_0x116a('0x1d')];var _0x5e47f8;if(_0x346f0c>=_0x59054d){_0x346f0c=_0x59054d;_0x5e47f8=0xc8;}else{_0x5e47f8=0xce;}_0x190b1b[_0x116a('0x1a')](_0x5e47f8);return _0x190b1b[_0x116a('0x21')](_0x116a('0x22'),_0x39a9bf+'-'+_0x346f0c+'/'+_0x59054d)[_0x116a('0x1c')](_0xcf15c0);}return null;};}function patchUpdates(_0x227f5c){return function(_0x19aa12){try{jsonpatch[_0x116a('0x23')](_0x19aa12,_0x227f5c,!![]);}catch(_0x1951ee){return BPromise[_0x116a('0x24')](_0x1951ee);}return _0x19aa12[_0x116a('0x25')]();};}function saveUpdates(_0x57b2fa,_0x489b56){return function(_0x40a34b){if(_0x40a34b){return _0x40a34b[_0x116a('0x26')](_0x57b2fa)[_0x116a('0x27')](function(_0x47e1fb){return _0x47e1fb;});}return null;};}function removeEntity(_0x5272d7,_0x2616f4){return function(_0x1f3ce0){if(_0x1f3ce0){return _0x1f3ce0[_0x116a('0x28')]()[_0x116a('0x27')](function(){_0x5272d7[_0x116a('0x1a')](0xcc)[_0x116a('0x1b')]();});}};}function handleEntityNotFound(_0x7a95d0,_0x400acf){return function(_0x177633){if(!_0x177633){_0x7a95d0[_0x116a('0x19')](0x194);}return _0x177633;};}function handleError(_0x2f4069,_0x2ce237){_0x2ce237=_0x2ce237||0x1f4;return function(_0x349823){logger[_0x116a('0x29')](_0x349823[_0x116a('0x2a')]);if(_0x349823[_0x116a('0x2b')]){delete _0x349823[_0x116a('0x2b')];}_0x2f4069[_0x116a('0x1a')](_0x2ce237)['send'](_0x349823);};}exports[_0x116a('0x2c')]=function(_0x1eac61,_0x20eb77){var _0x293e8f={},_0x5b1638={},_0x1bfde8={'count':0x0,'rows':[]};var _0x21429c=_[_0x116a('0x2d')](db[_0x116a('0x2e')][_0x116a('0x2f')],function(_0x4542ab){return{'name':_0x4542ab[_0x116a('0x30')],'type':_0x4542ab[_0x116a('0x31')][_0x116a('0x32')]};});_0x5b1638[_0x116a('0x33')]=_[_0x116a('0x2d')](_0x21429c,'name');_0x5b1638[_0x116a('0x34')]=_[_0x116a('0x35')](_0x1eac61['query']);_0x5b1638['filters']=_[_0x116a('0x36')](_0x5b1638[_0x116a('0x33')],_0x5b1638[_0x116a('0x34')]);_0x293e8f['attributes']=_[_0x116a('0x36')](_0x5b1638[_0x116a('0x33')],qs[_0x116a('0x37')](_0x1eac61[_0x116a('0x34')][_0x116a('0x37')]));_0x293e8f[_0x116a('0x38')]=_0x293e8f['attributes'][_0x116a('0x39')]?_0x293e8f[_0x116a('0x38')]:_0x5b1638['model'];if(!_0x1eac61['query'][_0x116a('0x3a')](_0x116a('0x3b'))){_0x293e8f[_0x116a('0x1d')]=qs[_0x116a('0x1d')](_0x1eac61['query'][_0x116a('0x1d')]);_0x293e8f['offset']=qs['offset'](_0x1eac61[_0x116a('0x34')]['offset']);}_0x293e8f[_0x116a('0x3c')]=qs[_0x116a('0x3d')](_0x1eac61['query']['sort']);_0x293e8f[_0x116a('0x3e')]=qs[_0x116a('0x3f')](_['pick'](_0x1eac61[_0x116a('0x34')],_0x5b1638[_0x116a('0x3f')]),_0x21429c);if(_0x1eac61[_0x116a('0x34')]['filter']){_0x293e8f[_0x116a('0x3e')]=_[_0x116a('0x40')](_0x293e8f[_0x116a('0x3e')],{'$or':_[_0x116a('0x2d')](_0x21429c,function(_0x1157b5){if(_0x1157b5[_0x116a('0x31')]!=='VIRTUAL'){var _0x12fa1b={};_0x12fa1b[_0x1157b5[_0x116a('0x2b')]]={'$like':'%'+_0x1eac61[_0x116a('0x34')][_0x116a('0x41')]+'%'};return _0x12fa1b;}})});}_0x293e8f=_[_0x116a('0x40')]({},_0x293e8f,_0x1eac61['options']);var _0x2ffb3f={'where':_0x293e8f['where']};return db[_0x116a('0x2e')][_0x116a('0x20')](_0x2ffb3f)['then'](function(_0x56f99e){_0x1bfde8[_0x116a('0x20')]=_0x56f99e;if(_0x1eac61[_0x116a('0x34')][_0x116a('0x42')]){_0x293e8f[_0x116a('0x43')]=[{'all':!![]}];}return db[_0x116a('0x2e')][_0x116a('0x44')](_0x293e8f);})['then'](function(_0x1d3ac1){_0x1bfde8[_0x116a('0x45')]=_0x1d3ac1;return _0x1bfde8;})['then'](respondWithFilteredResult(_0x20eb77,_0x293e8f))[_0x116a('0x46')](handleError(_0x20eb77,null));};exports[_0x116a('0x47')]=function(_0x2cf6a5,_0x4a09d0){var _0x4eee5b={'raw':![],'where':{'id':_0x2cf6a5['params']['id']}},_0x33e902={};_0x33e902['model']=_[_0x116a('0x35')](db[_0x116a('0x2e')][_0x116a('0x2f')]);_0x33e902[_0x116a('0x34')]=_['keys'](_0x2cf6a5[_0x116a('0x34')]);_0x33e902[_0x116a('0x3f')]=_[_0x116a('0x36')](_0x33e902[_0x116a('0x33')],_0x33e902[_0x116a('0x34')]);_0x4eee5b[_0x116a('0x38')]=_[_0x116a('0x36')](_0x33e902['model'],qs['fields'](_0x2cf6a5[_0x116a('0x34')][_0x116a('0x37')]));_0x4eee5b[_0x116a('0x38')]=_0x4eee5b[_0x116a('0x38')][_0x116a('0x39')]?_0x4eee5b[_0x116a('0x38')]:_0x33e902[_0x116a('0x33')];if(_0x2cf6a5[_0x116a('0x34')][_0x116a('0x42')]){_0x4eee5b['include']=[{'all':!![]}];}_0x4eee5b=_[_0x116a('0x40')]({},_0x4eee5b,_0x2cf6a5[_0x116a('0x48')]);return db[_0x116a('0x2e')]['find'](_0x4eee5b)[_0x116a('0x27')](handleEntityNotFound(_0x4a09d0,null))[_0x116a('0x27')](respondWithResult(_0x4a09d0,null))[_0x116a('0x46')](handleError(_0x4a09d0,null));};exports[_0x116a('0x49')]=function(_0x2a0b45,_0x40cdad){return db[_0x116a('0x2e')][_0x116a('0x49')](_0x2a0b45[_0x116a('0x4a')],{})[_0x116a('0x27')](respondWithResult(_0x40cdad,0xc9))[_0x116a('0x46')](handleError(_0x40cdad,null));};exports[_0x116a('0x26')]=function(_0x3557c9,_0x5e2b74){if(_0x3557c9[_0x116a('0x4a')]['id']){delete _0x3557c9[_0x116a('0x4a')]['id'];}return db[_0x116a('0x2e')]['find']({'where':{'id':_0x3557c9[_0x116a('0x4b')]['id']}})[_0x116a('0x27')](handleEntityNotFound(_0x5e2b74,null))[_0x116a('0x27')](saveUpdates(_0x3557c9['body'],null))[_0x116a('0x27')](respondWithResult(_0x5e2b74,null))[_0x116a('0x46')](handleError(_0x5e2b74,null));};exports[_0x116a('0x28')]=function(_0x5477d2,_0x3261da){return db[_0x116a('0x2e')]['find']({'where':{'id':_0x5477d2[_0x116a('0x4b')]['id']}})[_0x116a('0x27')](handleEntityNotFound(_0x3261da,null))[_0x116a('0x27')](removeEntity(_0x3261da,null))['catch'](handleError(_0x3261da,null));};exports[_0x116a('0x4c')]=function(_0x4fabc1,_0x24e8ff,_0x50116f){var _0x260dfd={};var _0x4ce1d3={};var _0x3e6f5c;var _0x59889d;return db[_0x116a('0x2e')][_0x116a('0x4d')]({'where':{'id':_0x4fabc1[_0x116a('0x4b')]['id']}})[_0x116a('0x27')](handleEntityNotFound(_0x24e8ff,null))[_0x116a('0x27')](function(_0x40b00c){if(_0x40b00c){_0x3e6f5c=_0x40b00c;_0x4ce1d3[_0x116a('0x33')]=_[_0x116a('0x35')](db[_0x116a('0x4e')][_0x116a('0x2f')]);_0x4ce1d3[_0x116a('0x34')]=_[_0x116a('0x35')](_0x4fabc1[_0x116a('0x34')]);_0x4ce1d3[_0x116a('0x3f')]=_[_0x116a('0x36')](_0x4ce1d3[_0x116a('0x33')],_0x4ce1d3['query']);_0x260dfd[_0x116a('0x38')]=_[_0x116a('0x36')](_0x4ce1d3[_0x116a('0x33')],qs[_0x116a('0x37')](_0x4fabc1[_0x116a('0x34')][_0x116a('0x37')]));_0x260dfd[_0x116a('0x38')]=_0x260dfd[_0x116a('0x38')][_0x116a('0x39')]?_0x260dfd['attributes']:_0x4ce1d3['model'];_0x260dfd['order']=qs['sort'](_0x4fabc1[_0x116a('0x34')]['sort']);_0x260dfd[_0x116a('0x3e')]=qs['filters'](_[_0x116a('0x4f')](_0x4fabc1[_0x116a('0x34')],_0x4ce1d3['filters']));if(_0x4fabc1['query'][_0x116a('0x41')]){_0x260dfd[_0x116a('0x3e')]=_['merge'](_0x260dfd[_0x116a('0x3e')],{'$or':_['map'](_0x260dfd['attributes'],function(_0x38959f){var _0x1396d7={};_0x1396d7[_0x38959f]={'$like':'%'+_0x4fabc1[_0x116a('0x34')]['filter']+'%'};return _0x1396d7;})});}_0x260dfd=_['merge']({},_0x260dfd,_0x4fabc1[_0x116a('0x48')]);return _0x3e6f5c[_0x116a('0x4c')](_0x260dfd);}})[_0x116a('0x27')](function(_0x2332f3){if(_0x2332f3){_0x59889d=_0x2332f3[_0x116a('0x39')];if(!_0x4fabc1['query'][_0x116a('0x3a')]('nolimit')){_0x260dfd[_0x116a('0x1d')]=qs[_0x116a('0x1d')](_0x4fabc1[_0x116a('0x34')][_0x116a('0x1d')]);_0x260dfd[_0x116a('0x1f')]=qs[_0x116a('0x1f')](_0x4fabc1['query'][_0x116a('0x1f')]);}return _0x3e6f5c[_0x116a('0x4c')](_0x260dfd);}})['then'](function(_0x383283){if(_0x383283){return _0x383283?{'count':_0x59889d,'rows':_0x383283}:null;}})[_0x116a('0x27')](respondWithResult(_0x24e8ff,null))[_0x116a('0x46')](handleError(_0x24e8ff,null));};exports[_0x116a('0x50')]=function(_0x2a41c0,_0x38df3b,_0x1f2807){if(_0x2a41c0[_0x116a('0x4a')]['id']){delete _0x2a41c0[_0x116a('0x4a')]['id'];}return db[_0x116a('0x2e')][_0x116a('0x4d')]({'where':{'id':_0x2a41c0[_0x116a('0x4b')]['id']}})[_0x116a('0x27')](handleEntityNotFound(_0x38df3b,null))[_0x116a('0x27')](function(_0x193b9f){if(_0x193b9f){_0x2a41c0['body'][_0x116a('0x51')]=_0x193b9f['id'];_0x2a41c0[_0x116a('0x4a')]['Subjects']=integrations[_0x116a('0x52')](_0x2a41c0[_0x116a('0x4a')]['channel'],_0x2a41c0['body']['type']);_0x2a41c0[_0x116a('0x4a')][_0x116a('0x53')]=integrations[_0x116a('0x54')](_0x2a41c0[_0x116a('0x4a')][_0x116a('0x55')],_0x2a41c0[_0x116a('0x4a')][_0x116a('0x31')]);return db[_0x116a('0x4e')]['create'](_0x2a41c0[_0x116a('0x4a')],{'include':[{'model':db['FreshsalesField'],'as':_0x116a('0x56')},{'model':db['FreshsalesField'],'as':_0x116a('0x53')}]});}return null;})['then'](respondWithResult(_0x38df3b,null))[_0x116a('0x46')](handleError(_0x38df3b,null));};exports[_0x116a('0x57')]=function(_0x2955f9,_0x398cd7,_0x2cee56){var _0x132329='';var _0x301603='';return db['FreshsalesAccount'][_0x116a('0x4d')]({'where':{'id':_0x2955f9[_0x116a('0x4b')]['id']},'attributes':['id','username','remoteUri',_0x116a('0x58')]})[_0x116a('0x27')](handleEntityNotFound(_0x398cd7,null))[_0x116a('0x27')](function(_0x3cf65d){if(_0x3cf65d){_0x301603=_0x3cf65d[_0x116a('0x59')];_0x132329=_0x3cf65d[_0x116a('0x5a')];var _0x5c24f7=_0x3cf65d[_0x116a('0x5a')]['slice'](-0x1);if(_0x5c24f7==='/'){_0x132329=_0x132329['substring'](0x0,_0x132329[_0x116a('0x5b')](_0x5c24f7));}return rp({'method':_0x116a('0x5c'),'uri':util[_0x116a('0x5d')](_0x116a('0x5e'),_0x132329,_0x116a('0x5f')),'headers':{'Authorization':_0x116a('0x60')+_0x3cf65d[_0x116a('0x58')]},'json':!![]});}})[_0x116a('0x27')](function(_0x5a1cbd){if(_0x5a1cbd){var _0x37f46b=_0x5a1cbd[_0x116a('0x61')];var _0x40f4f4=![];var _0x2e6e95=null;for(_0x2e6e95=0x0;_0x2e6e95<_0x37f46b['length'];_0x2e6e95++){if(_0x37f46b[_0x2e6e95][_0x116a('0x62')]===_0x301603){_0x40f4f4=!![];}}if(_0x40f4f4){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x116a('0x63')});}}})[_0x116a('0x27')](respondWithResult(_0x398cd7,null))[_0x116a('0x46')](function(_0x142adf){var _0x1cf835=_0x2955f9[_0x116a('0x34')][_0x116a('0x64')]?0x1f4:_0x142adf['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x116a('0x57'),_0x1cf835,JSON[_0x116a('0x65')](_0x142adf));delete _0x142adf[_0x116a('0x2b')];if(_0x1cf835===0x191){_0x1cf835=0x190;}_0x398cd7[_0x116a('0x1a')](_0x1cf835)[_0x116a('0x66')](_0x2955f9[_0x116a('0x34')][_0x116a('0x64')]?{'message':'Wrong\x20credentials','statusCode':_0x142adf['statusCode']}:_0x142adf);});};
\ No newline at end of file
+var _0xf188=['fields','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','rows','catch','params','include','options','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','length','pick','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','email','Requested\x20Resource\x20not\x20Found','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','FreshsalesAccount','rawAttributes','type','model','map','query','keys','filters','attributes','intersection'];(function(_0x2c199f,_0x35687f){var _0x4ed647=function(_0x3617ee){while(--_0x3617ee){_0x2c199f['push'](_0x2c199f['shift']());}};_0x4ed647(++_0x35687f);}(_0xf188,0x92));var _0x8f18=function(_0x3c7da0,_0x4dcfbc){_0x3c7da0=_0x3c7da0-0x0;var _0x3daeff=_0xf188[_0x3c7da0];return _0x3daeff;};'use strict';var emlformat=require(_0x8f18('0x0'));var rimraf=require(_0x8f18('0x1'));var zipdir=require(_0x8f18('0x2'));var jsonpatch=require(_0x8f18('0x3'));var rp=require(_0x8f18('0x4'));var moment=require('moment');var BPromise=require(_0x8f18('0x5'));var Mustache=require(_0x8f18('0x6'));var util=require(_0x8f18('0x7'));var path=require(_0x8f18('0x8'));var sox=require(_0x8f18('0x9'));var csv=require(_0x8f18('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8f18('0xb'));var _=require(_0x8f18('0xc'));var squel=require(_0x8f18('0xd'));var crypto=require(_0x8f18('0xe'));var jsforce=require(_0x8f18('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8f18('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8f18('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8f18('0x11'));var hardwareService=require(_0x8f18('0x12'));var logger=require(_0x8f18('0x13'))(_0x8f18('0x14'));var utils=require('../../config/utils');var config=require(_0x8f18('0x15'));var licenseUtil=require(_0x8f18('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x8f18('0x17'));function respondWithStatusCode(_0xa548a4,_0x441de2){_0x441de2=_0x441de2||0xcc;return function(_0x5247c0){if(_0x5247c0){return _0xa548a4[_0x8f18('0x18')](_0x441de2);}return _0xa548a4[_0x8f18('0x19')](_0x441de2)['end']();};}function respondWithResult(_0x2e87b6,_0x2a7a3f){_0x2a7a3f=_0x2a7a3f||0xc8;return function(_0x1244a3){if(_0x1244a3){return _0x2e87b6['status'](_0x2a7a3f)[_0x8f18('0x1a')](_0x1244a3);}};}function respondWithFilteredResult(_0x8537b7,_0x37d527){return function(_0x5cc411){if(_0x5cc411){var _0x4c8990=typeof _0x37d527[_0x8f18('0x1b')]===_0x8f18('0x1c')&&typeof _0x37d527[_0x8f18('0x1d')]===_0x8f18('0x1c');var _0x101d59=_0x5cc411[_0x8f18('0x1e')];var _0x177ec9=_0x4c8990?0x0:_0x37d527[_0x8f18('0x1b')];var _0x4af9c1=_0x4c8990?_0x5cc411['count']:_0x37d527[_0x8f18('0x1b')]+_0x37d527['limit'];var _0x809aba;if(_0x4af9c1>=_0x101d59){_0x4af9c1=_0x101d59;_0x809aba=0xc8;}else{_0x809aba=0xce;}_0x8537b7[_0x8f18('0x19')](_0x809aba);return _0x8537b7[_0x8f18('0x1f')]('Content-Range',_0x177ec9+'-'+_0x4af9c1+'/'+_0x101d59)[_0x8f18('0x1a')](_0x5cc411);}return null;};}function patchUpdates(_0x1c9f03){return function(_0x30d0aa){try{jsonpatch[_0x8f18('0x20')](_0x30d0aa,_0x1c9f03,!![]);}catch(_0x18a07b){return BPromise[_0x8f18('0x21')](_0x18a07b);}return _0x30d0aa[_0x8f18('0x22')]();};}function saveUpdates(_0x553836,_0xe9f4aa){return function(_0x2e948a){if(_0x2e948a){return _0x2e948a[_0x8f18('0x23')](_0x553836)[_0x8f18('0x24')](function(_0x233a61){return _0x233a61;});}return null;};}function removeEntity(_0x910083,_0x34e668){return function(_0x50f8c6){if(_0x50f8c6){return _0x50f8c6[_0x8f18('0x25')]()[_0x8f18('0x24')](function(){_0x910083[_0x8f18('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49a240,_0x135d8f){return function(_0x7a2db6){if(!_0x7a2db6){_0x49a240['sendStatus'](0x194);}return _0x7a2db6;};}function handleError(_0x1efce9,_0x5d43ff){_0x5d43ff=_0x5d43ff||0x1f4;return function(_0x2ab968){logger['error'](_0x2ab968[_0x8f18('0x26')]);if(_0x2ab968[_0x8f18('0x27')]){delete _0x2ab968[_0x8f18('0x27')];}_0x1efce9[_0x8f18('0x19')](_0x5d43ff)['send'](_0x2ab968);};}exports['index']=function(_0x4bb77e,_0x2d0594){var _0xfb5ad3={},_0x3e1895={},_0x3d0979={'count':0x0,'rows':[]};var _0x1f13a7=_['map'](db[_0x8f18('0x28')][_0x8f18('0x29')],function(_0x189d9a){return{'name':_0x189d9a['fieldName'],'type':_0x189d9a[_0x8f18('0x2a')]['key']};});_0x3e1895[_0x8f18('0x2b')]=_[_0x8f18('0x2c')](_0x1f13a7,_0x8f18('0x27'));_0x3e1895[_0x8f18('0x2d')]=_[_0x8f18('0x2e')](_0x4bb77e['query']);_0x3e1895[_0x8f18('0x2f')]=_['intersection'](_0x3e1895['model'],_0x3e1895[_0x8f18('0x2d')]);_0xfb5ad3[_0x8f18('0x30')]=_[_0x8f18('0x31')](_0x3e1895['model'],qs['fields'](_0x4bb77e[_0x8f18('0x2d')][_0x8f18('0x32')]));_0xfb5ad3[_0x8f18('0x30')]=_0xfb5ad3['attributes']['length']?_0xfb5ad3[_0x8f18('0x30')]:_0x3e1895[_0x8f18('0x2b')];if(!_0x4bb77e[_0x8f18('0x2d')]['hasOwnProperty'](_0x8f18('0x33'))){_0xfb5ad3[_0x8f18('0x1d')]=qs['limit'](_0x4bb77e[_0x8f18('0x2d')][_0x8f18('0x1d')]);_0xfb5ad3['offset']=qs[_0x8f18('0x1b')](_0x4bb77e[_0x8f18('0x2d')][_0x8f18('0x1b')]);}_0xfb5ad3[_0x8f18('0x34')]=qs[_0x8f18('0x35')](_0x4bb77e[_0x8f18('0x2d')][_0x8f18('0x35')]);_0xfb5ad3['where']=qs[_0x8f18('0x2f')](_['pick'](_0x4bb77e[_0x8f18('0x2d')],_0x3e1895['filters']),_0x1f13a7);if(_0x4bb77e[_0x8f18('0x2d')][_0x8f18('0x36')]){_0xfb5ad3[_0x8f18('0x37')]=_[_0x8f18('0x38')](_0xfb5ad3[_0x8f18('0x37')],{'$or':_[_0x8f18('0x2c')](_0x1f13a7,function(_0x9ffae5){if(_0x9ffae5[_0x8f18('0x2a')]!==_0x8f18('0x39')){var _0x28d096={};_0x28d096[_0x9ffae5[_0x8f18('0x27')]]={'$like':'%'+_0x4bb77e[_0x8f18('0x2d')][_0x8f18('0x36')]+'%'};return _0x28d096;}})});}_0xfb5ad3=_[_0x8f18('0x38')]({},_0xfb5ad3,_0x4bb77e['options']);var _0x17ff8b={'where':_0xfb5ad3[_0x8f18('0x37')]};return db[_0x8f18('0x28')][_0x8f18('0x1e')](_0x17ff8b)[_0x8f18('0x24')](function(_0x51cf8d){_0x3d0979[_0x8f18('0x1e')]=_0x51cf8d;if(_0x4bb77e[_0x8f18('0x2d')][_0x8f18('0x3a')]){_0xfb5ad3['include']=[{'all':!![]}];}return db[_0x8f18('0x28')]['findAll'](_0xfb5ad3);})[_0x8f18('0x24')](function(_0x25bdb5){_0x3d0979[_0x8f18('0x3b')]=_0x25bdb5;return _0x3d0979;})[_0x8f18('0x24')](respondWithFilteredResult(_0x2d0594,_0xfb5ad3))[_0x8f18('0x3c')](handleError(_0x2d0594,null));};exports['show']=function(_0x13d024,_0x8db276){var _0x11184f={'raw':![],'where':{'id':_0x13d024[_0x8f18('0x3d')]['id']}},_0x35d055={};_0x35d055[_0x8f18('0x2b')]=_['keys'](db[_0x8f18('0x28')][_0x8f18('0x29')]);_0x35d055[_0x8f18('0x2d')]=_[_0x8f18('0x2e')](_0x13d024[_0x8f18('0x2d')]);_0x35d055[_0x8f18('0x2f')]=_[_0x8f18('0x31')](_0x35d055[_0x8f18('0x2b')],_0x35d055[_0x8f18('0x2d')]);_0x11184f[_0x8f18('0x30')]=_['intersection'](_0x35d055[_0x8f18('0x2b')],qs[_0x8f18('0x32')](_0x13d024[_0x8f18('0x2d')][_0x8f18('0x32')]));_0x11184f[_0x8f18('0x30')]=_0x11184f[_0x8f18('0x30')]['length']?_0x11184f[_0x8f18('0x30')]:_0x35d055[_0x8f18('0x2b')];if(_0x13d024[_0x8f18('0x2d')][_0x8f18('0x3a')]){_0x11184f[_0x8f18('0x3e')]=[{'all':!![]}];}_0x11184f=_[_0x8f18('0x38')]({},_0x11184f,_0x13d024[_0x8f18('0x3f')]);return db[_0x8f18('0x28')][_0x8f18('0x40')](_0x11184f)['then'](handleEntityNotFound(_0x8db276,null))['then'](respondWithResult(_0x8db276,null))['catch'](handleError(_0x8db276,null));};exports[_0x8f18('0x41')]=function(_0x508fa6,_0x526474){return db[_0x8f18('0x28')][_0x8f18('0x41')](_0x508fa6[_0x8f18('0x42')],{})[_0x8f18('0x24')](respondWithResult(_0x526474,0xc9))[_0x8f18('0x3c')](handleError(_0x526474,null));};exports[_0x8f18('0x23')]=function(_0x4e7077,_0x2853a6){if(_0x4e7077[_0x8f18('0x42')]['id']){delete _0x4e7077[_0x8f18('0x42')]['id'];}return db['FreshsalesAccount'][_0x8f18('0x40')]({'where':{'id':_0x4e7077['params']['id']}})[_0x8f18('0x24')](handleEntityNotFound(_0x2853a6,null))[_0x8f18('0x24')](saveUpdates(_0x4e7077[_0x8f18('0x42')],null))[_0x8f18('0x24')](respondWithResult(_0x2853a6,null))[_0x8f18('0x3c')](handleError(_0x2853a6,null));};exports[_0x8f18('0x25')]=function(_0x1b5701,_0x59daae){return db['FreshsalesAccount'][_0x8f18('0x40')]({'where':{'id':_0x1b5701['params']['id']}})[_0x8f18('0x24')](handleEntityNotFound(_0x59daae,null))['then'](removeEntity(_0x59daae,null))[_0x8f18('0x3c')](handleError(_0x59daae,null));};exports[_0x8f18('0x43')]=function(_0x2f780b,_0x3eb82c,_0x144d36){var _0x3b559d={};var _0x57c350={};var _0x2fbbc0;var _0x45efd5;return db['FreshsalesAccount'][_0x8f18('0x44')]({'where':{'id':_0x2f780b[_0x8f18('0x3d')]['id']}})[_0x8f18('0x24')](handleEntityNotFound(_0x3eb82c,null))[_0x8f18('0x24')](function(_0x14762c){if(_0x14762c){_0x2fbbc0=_0x14762c;_0x57c350[_0x8f18('0x2b')]=_[_0x8f18('0x2e')](db[_0x8f18('0x45')][_0x8f18('0x29')]);_0x57c350[_0x8f18('0x2d')]=_[_0x8f18('0x2e')](_0x2f780b['query']);_0x57c350['filters']=_[_0x8f18('0x31')](_0x57c350[_0x8f18('0x2b')],_0x57c350[_0x8f18('0x2d')]);_0x3b559d[_0x8f18('0x30')]=_['intersection'](_0x57c350[_0x8f18('0x2b')],qs[_0x8f18('0x32')](_0x2f780b[_0x8f18('0x2d')][_0x8f18('0x32')]));_0x3b559d[_0x8f18('0x30')]=_0x3b559d['attributes'][_0x8f18('0x46')]?_0x3b559d[_0x8f18('0x30')]:_0x57c350[_0x8f18('0x2b')];_0x3b559d['order']=qs[_0x8f18('0x35')](_0x2f780b[_0x8f18('0x2d')][_0x8f18('0x35')]);_0x3b559d[_0x8f18('0x37')]=qs[_0x8f18('0x2f')](_[_0x8f18('0x47')](_0x2f780b['query'],_0x57c350[_0x8f18('0x2f')]));if(_0x2f780b[_0x8f18('0x2d')][_0x8f18('0x36')]){_0x3b559d['where']=_[_0x8f18('0x38')](_0x3b559d[_0x8f18('0x37')],{'$or':_[_0x8f18('0x2c')](_0x3b559d[_0x8f18('0x30')],function(_0x4f2545){var _0x1dd931={};_0x1dd931[_0x4f2545]={'$like':'%'+_0x2f780b[_0x8f18('0x2d')][_0x8f18('0x36')]+'%'};return _0x1dd931;})});}_0x3b559d=_['merge']({},_0x3b559d,_0x2f780b[_0x8f18('0x3f')]);return _0x2fbbc0[_0x8f18('0x43')](_0x3b559d);}})[_0x8f18('0x24')](function(_0xe153f0){if(_0xe153f0){_0x45efd5=_0xe153f0[_0x8f18('0x46')];if(!_0x2f780b[_0x8f18('0x2d')][_0x8f18('0x48')](_0x8f18('0x33'))){_0x3b559d['limit']=qs[_0x8f18('0x1d')](_0x2f780b[_0x8f18('0x2d')][_0x8f18('0x1d')]);_0x3b559d['offset']=qs['offset'](_0x2f780b['query']['offset']);}return _0x2fbbc0[_0x8f18('0x43')](_0x3b559d);}})[_0x8f18('0x24')](function(_0x2566e8){if(_0x2566e8){return _0x2566e8?{'count':_0x45efd5,'rows':_0x2566e8}:null;}})[_0x8f18('0x24')](respondWithResult(_0x3eb82c,null))[_0x8f18('0x3c')](handleError(_0x3eb82c,null));};exports[_0x8f18('0x49')]=function(_0xd2ba0d,_0x289500,_0x57397d){if(_0xd2ba0d[_0x8f18('0x42')]['id']){delete _0xd2ba0d[_0x8f18('0x42')]['id'];}return db[_0x8f18('0x28')][_0x8f18('0x44')]({'where':{'id':_0xd2ba0d['params']['id']}})[_0x8f18('0x24')](handleEntityNotFound(_0x289500,null))[_0x8f18('0x24')](function(_0x28e4ac){if(_0x28e4ac){_0xd2ba0d['body'][_0x8f18('0x4a')]=_0x28e4ac['id'];_0xd2ba0d[_0x8f18('0x42')][_0x8f18('0x4b')]=integrations[_0x8f18('0x4c')](_0xd2ba0d['body'][_0x8f18('0x4d')],_0xd2ba0d['body'][_0x8f18('0x2a')]);_0xd2ba0d['body']['Descriptions']=integrations['getDescriptions'](_0xd2ba0d[_0x8f18('0x42')]['channel'],_0xd2ba0d[_0x8f18('0x42')]['type']);return db['FreshsalesConfiguration'][_0x8f18('0x41')](_0xd2ba0d[_0x8f18('0x42')],{'include':[{'model':db[_0x8f18('0x4e')],'as':_0x8f18('0x4b')},{'model':db[_0x8f18('0x4e')],'as':'Descriptions'}]});}return null;})[_0x8f18('0x24')](respondWithResult(_0x289500,null))[_0x8f18('0x3c')](handleError(_0x289500,null));};exports[_0x8f18('0x4f')]=function(_0x264695,_0x336b68,_0x589db8){var _0x843595='';var _0x215771='';return db[_0x8f18('0x28')][_0x8f18('0x44')]({'where':{'id':_0x264695['params']['id']},'attributes':['id',_0x8f18('0x50'),_0x8f18('0x51'),_0x8f18('0x52')]})[_0x8f18('0x24')](handleEntityNotFound(_0x336b68,null))[_0x8f18('0x24')](function(_0x2079ef){if(_0x2079ef){_0x215771=_0x2079ef[_0x8f18('0x50')];_0x843595=_0x2079ef[_0x8f18('0x51')];var _0x4da1f1=_0x2079ef[_0x8f18('0x51')][_0x8f18('0x53')](-0x1);if(_0x4da1f1==='/'){_0x843595=_0x843595[_0x8f18('0x54')](0x0,_0x843595[_0x8f18('0x55')](_0x4da1f1));}return rp({'method':_0x8f18('0x56'),'uri':util[_0x8f18('0x57')](_0x8f18('0x58'),_0x843595,_0x8f18('0x59')),'headers':{'Authorization':'Token\x20token='+_0x2079ef[_0x8f18('0x52')]},'json':!![]});}})[_0x8f18('0x24')](function(_0x3e9e00){if(_0x3e9e00){var _0x27b647=_0x3e9e00['users'];var _0x394886=![];var _0x3c65ee=null;for(_0x3c65ee=0x0;_0x3c65ee<_0x27b647[_0x8f18('0x46')];_0x3c65ee++){if(_0x27b647[_0x3c65ee][_0x8f18('0x5a')]===_0x215771){_0x394886=!![];}}if(_0x394886){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x8f18('0x5b')});}}})[_0x8f18('0x24')](respondWithResult(_0x336b68,null))[_0x8f18('0x3c')](function(_0x182915){var _0x1516d2=_0x264695['query']['test']?0x1f4:_0x182915[_0x8f18('0x5c')]||0x1f4;logger[_0x8f18('0x5d')](_0x8f18('0x5e'),_0x8f18('0x4f'),_0x1516d2,JSON[_0x8f18('0x5f')](_0x182915));delete _0x182915[_0x8f18('0x27')];if(_0x1516d2===0x191){_0x1516d2=0x190;}_0x336b68[_0x8f18('0x19')](_0x1516d2)['send'](_0x264695[_0x8f18('0x2d')][_0x8f18('0x60')]?{'message':_0x8f18('0x61'),'statusCode':_0x182915['statusCode']}:_0x182915);});};
\ No newline at end of file
index c9d4724..d265ccf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0295=['exports','lodash','api','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x0295,0x1f0));var _0x5029=function(_0x347c14,_0xf2472f){_0x347c14=_0x347c14-0x0;var _0x46deb8=_0x0295[_0x347c14];return _0x46deb8;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var fs=require('fs');var path=require(_0x5029('0x3'));var rimraf=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var attributes=require(_0x5029('0x6'));var integrations=require(_0x5029('0x7'));module[_0x5029('0x8')]=function(_0x215955,_0x5b3cd){return _0x215955['define']('FreshsalesAccount',attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x71ab=['path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','util','api','bluebird','request-promise'];(function(_0x56776a,_0x273156){var _0x26ba85=function(_0x38e8ed){while(--_0x38e8ed){_0x56776a['push'](_0x56776a['shift']());}};_0x26ba85(++_0x273156);}(_0x71ab,0x64));var _0xb71a=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x71ab[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));var integrations=require(_0xb71a('0x8'));module[_0xb71a('0x9')]=function(_0x22c072,_0x35a84e){return _0x22c072[_0xb71a('0xa')](_0xb71a('0xb'),attributes,{'tableName':_0xb71a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d04c895..faba7b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7278=['stringify','error','code','message','result','catch','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowFreshsalesAccount','FreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s'];(function(_0x310c44,_0x541492){var _0x2d128c=function(_0x2f7323){while(--_0x2f7323){_0x310c44['push'](_0x310c44['shift']());}};_0x2d128c(++_0x541492);}(_0x7278,0x161));var _0x8727=function(_0x10c22b,_0x297ac0){_0x10c22b=_0x10c22b-0x0;var _0x211a78=_0x7278[_0x10c22b];return _0x211a78;};'use strict';var _=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var moment=require(_0x8727('0x2'));var BPromise=require(_0x8727('0x3'));var rs=require(_0x8727('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8727('0x5'))['db'];var utils=require(_0x8727('0x6'));var logger=require(_0x8727('0x7'))(_0x8727('0x8'));var config=require(_0x8727('0x9'));var jayson=require(_0x8727('0xa'));var client=jayson[_0x8727('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfd1902,_0x2f491c,_0xffd783){return new BPromise(function(_0x435911,_0x4160c3){return client['request'](_0xfd1902,_0xffd783)['then'](function(_0x4df6f8){logger[_0x8727('0xc')](_0x8727('0xd'),_0x2f491c,_0x8727('0xe'));logger[_0x8727('0xf')](_0x8727('0x10'),_0x2f491c,_0x8727('0xe'),JSON[_0x8727('0x11')](_0x4df6f8));if(_0x4df6f8[_0x8727('0x12')]){if(_0x4df6f8['error'][_0x8727('0x13')]===0x1f4){logger[_0x8727('0x12')](_0x8727('0xd'),_0x2f491c,_0x4df6f8['error'][_0x8727('0x14')]);return _0x4160c3(_0x4df6f8[_0x8727('0x12')]['message']);}logger[_0x8727('0x12')](_0x8727('0xd'),_0x2f491c,_0x4df6f8[_0x8727('0x12')][_0x8727('0x14')]);return _0x435911(_0x4df6f8[_0x8727('0x12')][_0x8727('0x14')]);}else{logger[_0x8727('0xc')](_0x8727('0xd'),_0x2f491c,_0x8727('0xe'));_0x435911(_0x4df6f8[_0x8727('0x15')]['message']);}})[_0x8727('0x16')](function(_0x1f9538){logger[_0x8727('0x12')](_0x8727('0xd'),_0x2f491c,_0x1f9538);_0x4160c3(_0x1f9538);});});}exports[_0x8727('0x17')]=function(_0xba0af5){var _0x533e6d=this;return new Promise(function(_0x575d29,_0x1a90ed){return db['FreshsalesAccount'][_0x8727('0x18')]({'raw':_0xba0af5[_0x8727('0x19')]?_0xba0af5[_0x8727('0x19')][_0x8727('0x1a')]===undefined?!![]:![]:!![],'where':_0xba0af5[_0x8727('0x19')]?_0xba0af5['options'][_0x8727('0x1b')]||null:null,'attributes':_0xba0af5[_0x8727('0x19')]?_0xba0af5[_0x8727('0x19')][_0x8727('0x1c')]||null:null,'limit':_0xba0af5[_0x8727('0x19')]?_0xba0af5[_0x8727('0x19')][_0x8727('0x1d')]||null:null,'include':_0xba0af5[_0x8727('0x19')]?_0xba0af5[_0x8727('0x19')][_0x8727('0x1e')]?_[_0x8727('0x1f')](_0xba0af5[_0x8727('0x19')]['include'],function(_0x464a32){return{'model':db[_0x464a32[_0x8727('0x20')]],'as':_0x464a32['as'],'attributes':_0x464a32['attributes'],'include':_0x464a32['include']?_[_0x8727('0x1f')](_0x464a32[_0x8727('0x1e')],function(_0x15e8bf){return{'model':db[_0x15e8bf['model']],'as':_0x15e8bf['as'],'attributes':_0x15e8bf[_0x8727('0x1c')],'include':_0x15e8bf[_0x8727('0x1e')]?_[_0x8727('0x1f')](_0x15e8bf[_0x8727('0x1e')],function(_0x2c8cd5){return{'model':db[_0x2c8cd5[_0x8727('0x20')]],'as':_0x2c8cd5['as'],'attributes':_0x2c8cd5[_0x8727('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8727('0x21')](function(_0x5d03f2){logger[_0x8727('0xc')](_0x8727('0x17'),_0xba0af5);logger['debug'](_0x8727('0x17'),_0xba0af5,JSON[_0x8727('0x11')](_0x5d03f2));_0x575d29(_0x5d03f2);})[_0x8727('0x16')](function(_0x228ca9){logger[_0x8727('0x12')](_0x8727('0x17'),_0x228ca9['message'],_0xba0af5);_0x1a90ed(_0x533e6d[_0x8727('0x12')](0x1f4,_0x228ca9['message']));});});};exports[_0x8727('0x22')]=function(_0x47e9f9){var _0x44ed83=this;return new Promise(function(_0x391d60,_0x152a53){return db[_0x8727('0x23')][_0x8727('0x24')]({'raw':_0x47e9f9[_0x8727('0x19')]?_0x47e9f9[_0x8727('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x47e9f9[_0x8727('0x19')]?_0x47e9f9[_0x8727('0x19')][_0x8727('0x1b')]||null:null,'attributes':_0x47e9f9[_0x8727('0x19')]?_0x47e9f9[_0x8727('0x19')][_0x8727('0x1c')]||null:null,'include':_0x47e9f9[_0x8727('0x19')]?_0x47e9f9[_0x8727('0x19')][_0x8727('0x1e')]?_[_0x8727('0x1f')](_0x47e9f9[_0x8727('0x19')][_0x8727('0x1e')],function(_0x54bff3){return{'model':db[_0x54bff3['model']],'as':_0x54bff3['as'],'attributes':_0x54bff3[_0x8727('0x1c')],'include':_0x54bff3[_0x8727('0x1e')]?_[_0x8727('0x1f')](_0x54bff3[_0x8727('0x1e')],function(_0x52220f){return{'model':db[_0x52220f[_0x8727('0x20')]],'as':_0x52220f['as'],'attributes':_0x52220f[_0x8727('0x1c')],'include':_0x52220f[_0x8727('0x1e')]?_[_0x8727('0x1f')](_0x52220f[_0x8727('0x1e')],function(_0x5b96cc){return{'model':db[_0x5b96cc[_0x8727('0x20')]],'as':_0x5b96cc['as'],'attributes':_0x5b96cc[_0x8727('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8727('0x21')](function(_0x1b0e88){logger[_0x8727('0xc')](_0x8727('0x22'),_0x47e9f9);logger[_0x8727('0xf')](_0x8727('0x22'),_0x47e9f9,JSON[_0x8727('0x11')](_0x1b0e88));_0x391d60(_0x1b0e88);})[_0x8727('0x16')](function(_0x396f12){logger[_0x8727('0x12')]('ShowFreshsalesAccount',_0x396f12[_0x8727('0x14')],_0x47e9f9);_0x152a53(_0x44ed83[_0x8727('0x12')](0x1f4,_0x396f12[_0x8727('0x14')]));});});};
\ No newline at end of file
+var _0x687b=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','attributes','limit','include','map','model','ShowFreshsalesAccount','find','raw','lodash','util','moment'];(function(_0x899a7b,_0x47f3fe){var _0x501574=function(_0x721be2){while(--_0x721be2){_0x899a7b['push'](_0x899a7b['shift']());}};_0x501574(++_0x47f3fe);}(_0x687b,0x14a));var _0xb687=function(_0x5aa1e2,_0x2b5adb){_0x5aa1e2=_0x5aa1e2-0x0;var _0x399098=_0x687b[_0x5aa1e2];return _0x399098;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var moment=require(_0xb687('0x2'));var BPromise=require(_0xb687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb687('0x4'))['db'];var utils=require(_0xb687('0x5'));var logger=require(_0xb687('0x6'))(_0xb687('0x7'));var config=require(_0xb687('0x8'));var jayson=require(_0xb687('0x9'));var client=jayson[_0xb687('0xa')][_0xb687('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47ffea,_0x27b750,_0x48942b){return new BPromise(function(_0x2aea59,_0xd40346){return client['request'](_0x47ffea,_0x48942b)[_0xb687('0xc')](function(_0x21e3ab){logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));logger[_0xb687('0x10')](_0xb687('0x11'),_0x27b750,_0xb687('0xf'),JSON[_0xb687('0x12')](_0x21e3ab));if(_0x21e3ab['error']){if(_0x21e3ab[_0xb687('0x13')][_0xb687('0x14')]===0x1f4){logger[_0xb687('0x13')](_0xb687('0xe'),_0x27b750,_0x21e3ab['error']['message']);return _0xd40346(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}logger['error'](_0xb687('0xe'),_0x27b750,_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);return _0x2aea59(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}else{logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));_0x2aea59(_0x21e3ab[_0xb687('0x16')][_0xb687('0x15')]);}})[_0xb687('0x17')](function(_0x19bb29){logger['error'](_0xb687('0xe'),_0x27b750,_0x19bb29);_0xd40346(_0x19bb29);});});}exports[_0xb687('0x18')]=function(_0x30d370){var _0x5eb9b9=this;return new Promise(function(_0x48958d,_0x12eff1){return db[_0xb687('0x19')][_0xb687('0x1a')]({'raw':_0x30d370['options']?_0x30d370[_0xb687('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x30d370[_0xb687('0x1b')]?_0x30d370[_0xb687('0x1b')][_0xb687('0x1c')]||null:null,'attributes':_0x30d370[_0xb687('0x1b')]?_0x30d370['options'][_0xb687('0x1d')]||null:null,'limit':_0x30d370['options']?_0x30d370[_0xb687('0x1b')][_0xb687('0x1e')]||null:null,'include':_0x30d370[_0xb687('0x1b')]?_0x30d370['options'][_0xb687('0x1f')]?_[_0xb687('0x20')](_0x30d370[_0xb687('0x1b')][_0xb687('0x1f')],function(_0xbf6c58){return{'model':db[_0xbf6c58[_0xb687('0x21')]],'as':_0xbf6c58['as'],'attributes':_0xbf6c58[_0xb687('0x1d')],'include':_0xbf6c58[_0xb687('0x1f')]?_['map'](_0xbf6c58[_0xb687('0x1f')],function(_0x129347){return{'model':db[_0x129347[_0xb687('0x21')]],'as':_0x129347['as'],'attributes':_0x129347[_0xb687('0x1d')],'include':_0x129347[_0xb687('0x1f')]?_[_0xb687('0x20')](_0x129347[_0xb687('0x1f')],function(_0x3cb2f2){return{'model':db[_0x3cb2f2[_0xb687('0x21')]],'as':_0x3cb2f2['as'],'attributes':_0x3cb2f2[_0xb687('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3712cf){logger[_0xb687('0xd')](_0xb687('0x18'),_0x30d370);logger[_0xb687('0x10')](_0xb687('0x18'),_0x30d370,JSON[_0xb687('0x12')](_0x3712cf));_0x48958d(_0x3712cf);})['catch'](function(_0x28b69a){logger['error'](_0xb687('0x18'),_0x28b69a[_0xb687('0x15')],_0x30d370);_0x12eff1(_0x5eb9b9[_0xb687('0x13')](0x1f4,_0x28b69a[_0xb687('0x15')]));});});};exports[_0xb687('0x22')]=function(_0x43d20d){var _0xf1f0dd=this;return new Promise(function(_0x556815,_0x3da2be){return db[_0xb687('0x19')][_0xb687('0x23')]({'raw':_0x43d20d[_0xb687('0x1b')]?_0x43d20d[_0xb687('0x1b')][_0xb687('0x24')]===undefined?!![]:![]:!![],'where':_0x43d20d[_0xb687('0x1b')]?_0x43d20d[_0xb687('0x1b')][_0xb687('0x1c')]||null:null,'attributes':_0x43d20d[_0xb687('0x1b')]?_0x43d20d[_0xb687('0x1b')]['attributes']||null:null,'include':_0x43d20d['options']?_0x43d20d[_0xb687('0x1b')][_0xb687('0x1f')]?_[_0xb687('0x20')](_0x43d20d[_0xb687('0x1b')]['include'],function(_0x4f0b28){return{'model':db[_0x4f0b28[_0xb687('0x21')]],'as':_0x4f0b28['as'],'attributes':_0x4f0b28[_0xb687('0x1d')],'include':_0x4f0b28['include']?_[_0xb687('0x20')](_0x4f0b28[_0xb687('0x1f')],function(_0x548b83){return{'model':db[_0x548b83[_0xb687('0x21')]],'as':_0x548b83['as'],'attributes':_0x548b83['attributes'],'include':_0x548b83[_0xb687('0x1f')]?_[_0xb687('0x20')](_0x548b83[_0xb687('0x1f')],function(_0x3e146a){return{'model':db[_0x3e146a[_0xb687('0x21')]],'as':_0x3e146a['as'],'attributes':_0x3e146a[_0xb687('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x529b1a){logger[_0xb687('0xd')](_0xb687('0x22'),_0x43d20d);logger[_0xb687('0x10')]('ShowFreshsalesAccount',_0x43d20d,JSON[_0xb687('0x12')](_0x529b1a));_0x556815(_0x529b1a);})[_0xb687('0x17')](function(_0x1f1c88){logger[_0xb687('0x13')](_0xb687('0x22'),_0x1f1c88['message'],_0x43d20d);_0x3da2be(_0xf1f0dd[_0xb687('0x13')](0x1f4,_0x1f1c88[_0xb687('0x15')]));});});};
\ No newline at end of file
index 974d7b4..8e55540 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f5c=['delete','destroy','exports','util','path','express','Router','fs-extra','./intFreshsalesConfiguration.controller','get','isAuthenticated','/:id','show','/:id/subjects','getSubjects','getDescriptions','/:id/fields','getFields','create','put','update'];(function(_0x72ace8,_0x4ba520){var _0x30a740=function(_0x3ab9b6){while(--_0x3ab9b6){_0x72ace8['push'](_0x72ace8['shift']());}};_0x30a740(++_0x4ba520);}(_0x9f5c,0xea));var _0xc9f5=function(_0x29e1f9,_0x3db782){_0x29e1f9=_0x29e1f9-0x0;var _0xde57f9=_0x9f5c[_0x29e1f9];return _0xde57f9;};'use strict';var multer=require('multer');var util=require(_0xc9f5('0x0'));var path=require(_0xc9f5('0x1'));var timeout=require('connect-timeout');var express=require(_0xc9f5('0x2'));var router=express[_0xc9f5('0x3')]();var fs_extra=require(_0xc9f5('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc9f5('0x5'));router[_0xc9f5('0x6')]('/',auth[_0xc9f5('0x7')](),controller['index']);router[_0xc9f5('0x6')](_0xc9f5('0x8'),auth[_0xc9f5('0x7')](),controller[_0xc9f5('0x9')]);router[_0xc9f5('0x6')](_0xc9f5('0xa'),auth[_0xc9f5('0x7')](),controller[_0xc9f5('0xb')]);router[_0xc9f5('0x6')]('/:id/descriptions',auth[_0xc9f5('0x7')](),controller[_0xc9f5('0xc')]);router['get'](_0xc9f5('0xd'),auth[_0xc9f5('0x7')](),controller[_0xc9f5('0xe')]);router['post']('/',auth[_0xc9f5('0x7')](),controller[_0xc9f5('0xf')]);router[_0xc9f5('0x10')](_0xc9f5('0x8'),auth[_0xc9f5('0x7')](),controller[_0xc9f5('0x11')]);router[_0xc9f5('0x12')]('/:id',auth[_0xc9f5('0x7')](),controller[_0xc9f5('0x13')]);module[_0xc9f5('0x14')]=router;
\ No newline at end of file
+var _0x6170=['multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','update','delete','exports'];(function(_0xf13540,_0x45d3df){var _0x5819f3=function(_0x50b7eb){while(--_0x50b7eb){_0xf13540['push'](_0xf13540['shift']());}};_0x5819f3(++_0x45d3df);}(_0x6170,0x114));var _0x0617=function(_0x1262af,_0x36f118){_0x1262af=_0x1262af-0x0;var _0x291426=_0x6170[_0x1262af];return _0x291426;};'use strict';var multer=require(_0x0617('0x0'));var util=require(_0x0617('0x1'));var path=require(_0x0617('0x2'));var timeout=require(_0x0617('0x3'));var express=require('express');var router=express[_0x0617('0x4')]();var fs_extra=require(_0x0617('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0617('0x6'));var controller=require(_0x0617('0x7'));router[_0x0617('0x8')]('/',auth[_0x0617('0x9')](),controller[_0x0617('0xa')]);router[_0x0617('0x8')](_0x0617('0xb'),auth[_0x0617('0x9')](),controller[_0x0617('0xc')]);router[_0x0617('0x8')](_0x0617('0xd'),auth['isAuthenticated'](),controller[_0x0617('0xe')]);router[_0x0617('0x8')](_0x0617('0xf'),auth[_0x0617('0x9')](),controller[_0x0617('0x10')]);router[_0x0617('0x8')](_0x0617('0x11'),auth[_0x0617('0x9')](),controller[_0x0617('0x12')]);router[_0x0617('0x13')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x0617('0xb'),auth['isAuthenticated'](),controller[_0x0617('0x14')]);router[_0x0617('0x15')](_0x0617('0xb'),auth[_0x0617('0x9')](),controller['destroy']);module[_0x0617('0x16')]=router;
\ No newline at end of file
index d4477b6..e643e6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42da=['STRING','sequelize','exports'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x42da,0x14b));var _0xa42d=function(_0x38830b,_0x5d4119){_0x38830b=_0x38830b-0x0;var _0x4a1393=_0x42da[_0x38830b];return _0x4a1393;};'use strict';var Sequelize=require(_0xa42d('0x0'));module[_0xa42d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa42d('0x2')]}};
\ No newline at end of file
+var _0x1ab7=['exports','STRING','sequelize'];(function(_0x2a6fd5,_0x3d6deb){var _0x43c6a4=function(_0x3aecb3){while(--_0x3aecb3){_0x2a6fd5['push'](_0x2a6fd5['shift']());}};_0x43c6a4(++_0x3d6deb);}(_0x1ab7,0x11f));var _0x71ab=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0x1ab7[_0x2c0dc0];return _0x4c0990;};'use strict';var Sequelize=require(_0x71ab('0x0'));module[_0x71ab('0x1')]={'name':{'type':Sequelize[_0x71ab('0x2')]},'description':{'type':Sequelize[_0x71ab('0x2')]}};
\ No newline at end of file
index 45597cf..683bad3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa4f=['save','then','destroy','error','stack','name','send','index','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','options','FreshsalesConfiguration','includeAll','include','rows','catch','show','params','find','create','body','findOne','FreshsalesField','rawAttributes','order','filter','getSubjects','getDescriptions','getFields','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject'];(function(_0x15b2af,_0xae2ce8){var _0x2c8fc3=function(_0x3aecc7){while(--_0x3aecc7){_0x15b2af['push'](_0x15b2af['shift']());}};_0x2c8fc3(++_0xae2ce8);}(_0xfa4f,0x11a));var _0xffa4=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xfa4f[_0x4ff09b];return _0x3f5c2e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xffa4('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xffa4('0x1'));var moment=require(_0xffa4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xffa4('0x3'));var util=require('util');var path=require(_0xffa4('0x4'));var sox=require('sox');var csv=require(_0xffa4('0x5'));var ejs=require(_0xffa4('0x6'));var fs=require('fs');var fs_extra=require(_0xffa4('0x7'));var _=require(_0xffa4('0x8'));var squel=require(_0xffa4('0x9'));var crypto=require('crypto');var jsforce=require(_0xffa4('0xa'));var deskjs=require(_0xffa4('0xb'));var toCsv=require('to-csv');var querystring=require(_0xffa4('0xc'));var Papa=require(_0xffa4('0xd'));var Redis=require(_0xffa4('0xe'));var authService=require(_0xffa4('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xffa4('0x10'));var hardwareService=require(_0xffa4('0x11'));var logger=require(_0xffa4('0x12'))(_0xffa4('0x13'));var utils=require(_0xffa4('0x14'));var config=require(_0xffa4('0x15'));var licenseUtil=require(_0xffa4('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34e631,_0x325c96){_0x325c96=_0x325c96||0xcc;return function(_0x5b6287){if(_0x5b6287){return _0x34e631[_0xffa4('0x17')](_0x325c96);}return _0x34e631[_0xffa4('0x18')](_0x325c96)[_0xffa4('0x19')]();};}function respondWithResult(_0x5bbed0,_0x1a97b4){_0x1a97b4=_0x1a97b4||0xc8;return function(_0x2dde7b){if(_0x2dde7b){return _0x5bbed0[_0xffa4('0x18')](_0x1a97b4)['json'](_0x2dde7b);}};}function respondWithFilteredResult(_0x1ad72d,_0x16bfb4){return function(_0xe01b71){if(_0xe01b71){var _0x29a317=typeof _0x16bfb4['offset']===_0xffa4('0x1a')&&typeof _0x16bfb4[_0xffa4('0x1b')]==='undefined';var _0xdfbb06=_0xe01b71[_0xffa4('0x1c')];var _0x5901d0=_0x29a317?0x0:_0x16bfb4[_0xffa4('0x1d')];var _0x3da02f=_0x29a317?_0xe01b71[_0xffa4('0x1c')]:_0x16bfb4[_0xffa4('0x1d')]+_0x16bfb4['limit'];var _0x5185cb;if(_0x3da02f>=_0xdfbb06){_0x3da02f=_0xdfbb06;_0x5185cb=0xc8;}else{_0x5185cb=0xce;}_0x1ad72d[_0xffa4('0x18')](_0x5185cb);return _0x1ad72d[_0xffa4('0x1e')](_0xffa4('0x1f'),_0x5901d0+'-'+_0x3da02f+'/'+_0xdfbb06)['json'](_0xe01b71);}return null;};}function patchUpdates(_0x1a9b98){return function(_0x7caa16){try{jsonpatch[_0xffa4('0x20')](_0x7caa16,_0x1a9b98,!![]);}catch(_0x1a9726){return BPromise[_0xffa4('0x21')](_0x1a9726);}return _0x7caa16[_0xffa4('0x22')]();};}function saveUpdates(_0x3b2653,_0xda5abb){return function(_0x5007dd){if(_0x5007dd){return _0x5007dd['update'](_0x3b2653)[_0xffa4('0x23')](function(_0x59066b){return _0x59066b;});}return null;};}function removeEntity(_0x4cfc47,_0x2855f7){return function(_0x4157db){if(_0x4157db){return _0x4157db[_0xffa4('0x24')]()['then'](function(){_0x4cfc47[_0xffa4('0x18')](0xcc)[_0xffa4('0x19')]();});}};}function handleEntityNotFound(_0x2d00d4,_0x489380){return function(_0x42a877){if(!_0x42a877){_0x2d00d4['sendStatus'](0x194);}return _0x42a877;};}function handleError(_0x5f5a27,_0x5ad4e1){_0x5ad4e1=_0x5ad4e1||0x1f4;return function(_0x1ac603){logger[_0xffa4('0x25')](_0x1ac603[_0xffa4('0x26')]);if(_0x1ac603[_0xffa4('0x27')]){delete _0x1ac603[_0xffa4('0x27')];}_0x5f5a27[_0xffa4('0x18')](_0x5ad4e1)[_0xffa4('0x28')](_0x1ac603);};}exports[_0xffa4('0x29')]=function(_0x4f2840,_0x1209ea){var _0x2eff15={},_0x25eea0={},_0x15f879={'count':0x0,'rows':[]};var _0x3f8b3f=_[_0xffa4('0x2a')](db['FreshsalesConfiguration']['rawAttributes'],function(_0x4e47f8){return{'name':_0x4e47f8[_0xffa4('0x2b')],'type':_0x4e47f8[_0xffa4('0x2c')][_0xffa4('0x2d')]};});_0x25eea0['model']=_[_0xffa4('0x2a')](_0x3f8b3f,_0xffa4('0x27'));_0x25eea0[_0xffa4('0x2e')]=_[_0xffa4('0x2f')](_0x4f2840[_0xffa4('0x2e')]);_0x25eea0[_0xffa4('0x30')]=_[_0xffa4('0x31')](_0x25eea0[_0xffa4('0x32')],_0x25eea0[_0xffa4('0x2e')]);_0x2eff15[_0xffa4('0x33')]=_[_0xffa4('0x31')](_0x25eea0['model'],qs[_0xffa4('0x34')](_0x4f2840[_0xffa4('0x2e')]['fields']));_0x2eff15[_0xffa4('0x33')]=_0x2eff15[_0xffa4('0x33')][_0xffa4('0x35')]?_0x2eff15[_0xffa4('0x33')]:_0x25eea0['model'];if(!_0x4f2840[_0xffa4('0x2e')][_0xffa4('0x36')](_0xffa4('0x37'))){_0x2eff15[_0xffa4('0x1b')]=qs[_0xffa4('0x1b')](_0x4f2840[_0xffa4('0x2e')][_0xffa4('0x1b')]);_0x2eff15['offset']=qs['offset'](_0x4f2840['query'][_0xffa4('0x1d')]);}_0x2eff15['order']=qs[_0xffa4('0x38')](_0x4f2840[_0xffa4('0x2e')][_0xffa4('0x38')]);_0x2eff15[_0xffa4('0x39')]=qs[_0xffa4('0x30')](_[_0xffa4('0x3a')](_0x4f2840[_0xffa4('0x2e')],_0x25eea0[_0xffa4('0x30')]),_0x3f8b3f);if(_0x4f2840[_0xffa4('0x2e')]['filter']){_0x2eff15[_0xffa4('0x39')]=_[_0xffa4('0x3b')](_0x2eff15['where'],{'$or':_[_0xffa4('0x2a')](_0x3f8b3f,function(_0x119d35){if(_0x119d35['type']!=='VIRTUAL'){var _0x4769e1={};_0x4769e1[_0x119d35[_0xffa4('0x27')]]={'$like':'%'+_0x4f2840['query']['filter']+'%'};return _0x4769e1;}})});}_0x2eff15=_[_0xffa4('0x3b')]({},_0x2eff15,_0x4f2840[_0xffa4('0x3c')]);var _0x15d190={'where':_0x2eff15[_0xffa4('0x39')]};return db[_0xffa4('0x3d')][_0xffa4('0x1c')](_0x15d190)['then'](function(_0x2a258a){_0x15f879[_0xffa4('0x1c')]=_0x2a258a;if(_0x4f2840[_0xffa4('0x2e')][_0xffa4('0x3e')]){_0x2eff15[_0xffa4('0x3f')]=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x2eff15);})[_0xffa4('0x23')](function(_0x2be477){_0x15f879[_0xffa4('0x40')]=_0x2be477;return _0x15f879;})[_0xffa4('0x23')](respondWithFilteredResult(_0x1209ea,_0x2eff15))[_0xffa4('0x41')](handleError(_0x1209ea,null));};exports[_0xffa4('0x42')]=function(_0x551a29,_0x2985f3){var _0x4f1747={'raw':![],'where':{'id':_0x551a29[_0xffa4('0x43')]['id']}},_0x41a34b={};_0x41a34b[_0xffa4('0x32')]=_[_0xffa4('0x2f')](db[_0xffa4('0x3d')]['rawAttributes']);_0x41a34b['query']=_[_0xffa4('0x2f')](_0x551a29['query']);_0x41a34b['filters']=_[_0xffa4('0x31')](_0x41a34b[_0xffa4('0x32')],_0x41a34b['query']);_0x4f1747['attributes']=_['intersection'](_0x41a34b['model'],qs['fields'](_0x551a29[_0xffa4('0x2e')][_0xffa4('0x34')]));_0x4f1747['attributes']=_0x4f1747[_0xffa4('0x33')][_0xffa4('0x35')]?_0x4f1747[_0xffa4('0x33')]:_0x41a34b[_0xffa4('0x32')];if(_0x551a29[_0xffa4('0x2e')][_0xffa4('0x3e')]){_0x4f1747[_0xffa4('0x3f')]=[{'all':!![]}];}_0x4f1747=_['merge']({},_0x4f1747,_0x551a29[_0xffa4('0x3c')]);return db[_0xffa4('0x3d')][_0xffa4('0x44')](_0x4f1747)['then'](handleEntityNotFound(_0x2985f3,null))[_0xffa4('0x23')](respondWithResult(_0x2985f3,null))[_0xffa4('0x41')](handleError(_0x2985f3,null));};exports[_0xffa4('0x45')]=function(_0x1e8924,_0x2960dd){return db[_0xffa4('0x3d')][_0xffa4('0x45')](_0x1e8924['body'],{})['then'](respondWithResult(_0x2960dd,0xc9))['catch'](handleError(_0x2960dd,null));};exports['update']=function(_0x55472d,_0x53b910){if(_0x55472d[_0xffa4('0x46')]['id']){delete _0x55472d[_0xffa4('0x46')]['id'];}return db[_0xffa4('0x3d')][_0xffa4('0x44')]({'where':{'id':_0x55472d[_0xffa4('0x43')]['id']}})[_0xffa4('0x23')](handleEntityNotFound(_0x53b910,null))[_0xffa4('0x23')](saveUpdates(_0x55472d[_0xffa4('0x46')],null))[_0xffa4('0x23')](respondWithResult(_0x53b910,null))[_0xffa4('0x41')](handleError(_0x53b910,null));};exports['destroy']=function(_0x39f4c2,_0x5f0c6e){return db['FreshsalesConfiguration'][_0xffa4('0x44')]({'where':{'id':_0x39f4c2[_0xffa4('0x43')]['id']}})[_0xffa4('0x23')](handleEntityNotFound(_0x5f0c6e,null))[_0xffa4('0x23')](removeEntity(_0x5f0c6e,null))[_0xffa4('0x41')](handleError(_0x5f0c6e,null));};exports['getSubjects']=function(_0x11746c,_0x134c1e,_0x5715cc){var _0x59b1b4={};var _0xda79b={};var _0x27dbbf;var _0x4509fb;return db[_0xffa4('0x3d')][_0xffa4('0x47')]({'where':{'id':_0x11746c[_0xffa4('0x43')]['id']}})[_0xffa4('0x23')](handleEntityNotFound(_0x134c1e,null))[_0xffa4('0x23')](function(_0x24c5c5){if(_0x24c5c5){_0x27dbbf=_0x24c5c5;_0xda79b['model']=_['keys'](db[_0xffa4('0x48')][_0xffa4('0x49')]);_0xda79b[_0xffa4('0x2e')]=_[_0xffa4('0x2f')](_0x11746c['query']);_0xda79b[_0xffa4('0x30')]=_['intersection'](_0xda79b[_0xffa4('0x32')],_0xda79b['query']);_0x59b1b4[_0xffa4('0x33')]=_[_0xffa4('0x31')](_0xda79b[_0xffa4('0x32')],qs['fields'](_0x11746c[_0xffa4('0x2e')][_0xffa4('0x34')]));_0x59b1b4['attributes']=_0x59b1b4['attributes'][_0xffa4('0x35')]?_0x59b1b4[_0xffa4('0x33')]:_0xda79b['model'];_0x59b1b4[_0xffa4('0x4a')]=qs[_0xffa4('0x38')](_0x11746c[_0xffa4('0x2e')][_0xffa4('0x38')]);_0x59b1b4[_0xffa4('0x39')]=qs['filters'](_[_0xffa4('0x3a')](_0x11746c['query'],_0xda79b['filters']));if(_0x11746c[_0xffa4('0x2e')][_0xffa4('0x4b')]){_0x59b1b4[_0xffa4('0x39')]=_[_0xffa4('0x3b')](_0x59b1b4[_0xffa4('0x39')],{'$or':_[_0xffa4('0x2a')](_0x59b1b4[_0xffa4('0x33')],function(_0xd9e0b6){var _0x497d62={};_0x497d62[_0xd9e0b6]={'$like':'%'+_0x11746c[_0xffa4('0x2e')][_0xffa4('0x4b')]+'%'};return _0x497d62;})});}_0x59b1b4=_[_0xffa4('0x3b')]({},_0x59b1b4,_0x11746c['options']);return _0x27dbbf[_0xffa4('0x4c')](_0x59b1b4);}})[_0xffa4('0x23')](function(_0x3f35c9){if(_0x3f35c9){_0x4509fb=_0x3f35c9[_0xffa4('0x35')];if(!_0x11746c['query'][_0xffa4('0x36')](_0xffa4('0x37'))){_0x59b1b4[_0xffa4('0x1b')]=qs[_0xffa4('0x1b')](_0x11746c[_0xffa4('0x2e')]['limit']);_0x59b1b4['offset']=qs[_0xffa4('0x1d')](_0x11746c[_0xffa4('0x2e')][_0xffa4('0x1d')]);}return _0x27dbbf['getSubjects'](_0x59b1b4);}})['then'](function(_0x4a9cf7){if(_0x4a9cf7){return _0x4a9cf7?{'count':_0x4509fb,'rows':_0x4a9cf7}:null;}})[_0xffa4('0x23')](respondWithResult(_0x134c1e,null))[_0xffa4('0x41')](handleError(_0x134c1e,null));};exports[_0xffa4('0x4d')]=function(_0x45c24e,_0x1e4ef0,_0x3c818a){var _0x35650e={};var _0x39dd34={};var _0x504770;var _0x57d762;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x45c24e[_0xffa4('0x43')]['id']}})['then'](handleEntityNotFound(_0x1e4ef0,null))['then'](function(_0x253bf2){if(_0x253bf2){_0x504770=_0x253bf2;_0x39dd34[_0xffa4('0x32')]=_[_0xffa4('0x2f')](db[_0xffa4('0x48')]['rawAttributes']);_0x39dd34['query']=_['keys'](_0x45c24e[_0xffa4('0x2e')]);_0x39dd34[_0xffa4('0x30')]=_[_0xffa4('0x31')](_0x39dd34[_0xffa4('0x32')],_0x39dd34[_0xffa4('0x2e')]);_0x35650e[_0xffa4('0x33')]=_['intersection'](_0x39dd34[_0xffa4('0x32')],qs['fields'](_0x45c24e[_0xffa4('0x2e')][_0xffa4('0x34')]));_0x35650e['attributes']=_0x35650e[_0xffa4('0x33')][_0xffa4('0x35')]?_0x35650e[_0xffa4('0x33')]:_0x39dd34[_0xffa4('0x32')];_0x35650e[_0xffa4('0x4a')]=qs[_0xffa4('0x38')](_0x45c24e[_0xffa4('0x2e')]['sort']);_0x35650e[_0xffa4('0x39')]=qs[_0xffa4('0x30')](_[_0xffa4('0x3a')](_0x45c24e[_0xffa4('0x2e')],_0x39dd34[_0xffa4('0x30')]));if(_0x45c24e[_0xffa4('0x2e')][_0xffa4('0x4b')]){_0x35650e['where']=_[_0xffa4('0x3b')](_0x35650e['where'],{'$or':_[_0xffa4('0x2a')](_0x35650e[_0xffa4('0x33')],function(_0x53f043){var _0x3ba4a2={};_0x3ba4a2[_0x53f043]={'$like':'%'+_0x45c24e[_0xffa4('0x2e')][_0xffa4('0x4b')]+'%'};return _0x3ba4a2;})});}_0x35650e=_[_0xffa4('0x3b')]({},_0x35650e,_0x45c24e['options']);return _0x504770[_0xffa4('0x4d')](_0x35650e);}})['then'](function(_0x2faeea){if(_0x2faeea){_0x57d762=_0x2faeea[_0xffa4('0x35')];if(!_0x45c24e['query'][_0xffa4('0x36')](_0xffa4('0x37'))){_0x35650e[_0xffa4('0x1b')]=qs[_0xffa4('0x1b')](_0x45c24e[_0xffa4('0x2e')][_0xffa4('0x1b')]);_0x35650e['offset']=qs[_0xffa4('0x1d')](_0x45c24e[_0xffa4('0x2e')][_0xffa4('0x1d')]);}return _0x504770[_0xffa4('0x4d')](_0x35650e);}})[_0xffa4('0x23')](function(_0x503698){if(_0x503698){return _0x503698?{'count':_0x57d762,'rows':_0x503698}:null;}})[_0xffa4('0x23')](respondWithResult(_0x1e4ef0,null))[_0xffa4('0x41')](handleError(_0x1e4ef0,null));};exports[_0xffa4('0x4e')]=function(_0x2af5a6,_0x2fcd3b,_0x57b879){var _0x26f278={};var _0x3269f8={};var _0x5d1ec9;var _0x2efc23;return db[_0xffa4('0x3d')][_0xffa4('0x47')]({'where':{'id':_0x2af5a6[_0xffa4('0x43')]['id']}})[_0xffa4('0x23')](handleEntityNotFound(_0x2fcd3b,null))[_0xffa4('0x23')](function(_0x2bbc9e){if(_0x2bbc9e){_0x5d1ec9=_0x2bbc9e;_0x3269f8[_0xffa4('0x32')]=_[_0xffa4('0x2f')](db[_0xffa4('0x48')][_0xffa4('0x49')]);_0x3269f8[_0xffa4('0x2e')]=_[_0xffa4('0x2f')](_0x2af5a6[_0xffa4('0x2e')]);_0x3269f8['filters']=_[_0xffa4('0x31')](_0x3269f8['model'],_0x3269f8[_0xffa4('0x2e')]);_0x26f278[_0xffa4('0x33')]=_['intersection'](_0x3269f8[_0xffa4('0x32')],qs[_0xffa4('0x34')](_0x2af5a6['query'][_0xffa4('0x34')]));_0x26f278['attributes']=_0x26f278[_0xffa4('0x33')][_0xffa4('0x35')]?_0x26f278[_0xffa4('0x33')]:_0x3269f8[_0xffa4('0x32')];_0x26f278[_0xffa4('0x4a')]=qs['sort'](_0x2af5a6['query'][_0xffa4('0x38')]);_0x26f278[_0xffa4('0x39')]=qs[_0xffa4('0x30')](_[_0xffa4('0x3a')](_0x2af5a6[_0xffa4('0x2e')],_0x3269f8[_0xffa4('0x30')]));if(_0x2af5a6[_0xffa4('0x2e')][_0xffa4('0x4b')]){_0x26f278[_0xffa4('0x39')]=_[_0xffa4('0x3b')](_0x26f278[_0xffa4('0x39')],{'$or':_[_0xffa4('0x2a')](_0x26f278[_0xffa4('0x33')],function(_0x1a7956){var _0x3ffcce={};_0x3ffcce[_0x1a7956]={'$like':'%'+_0x2af5a6[_0xffa4('0x2e')][_0xffa4('0x4b')]+'%'};return _0x3ffcce;})});}_0x26f278=_[_0xffa4('0x3b')]({},_0x26f278,_0x2af5a6[_0xffa4('0x3c')]);return _0x5d1ec9['getFields'](_0x26f278);}})['then'](function(_0x4efefd){if(_0x4efefd){_0x2efc23=_0x4efefd['length'];if(!_0x2af5a6[_0xffa4('0x2e')][_0xffa4('0x36')](_0xffa4('0x37'))){_0x26f278[_0xffa4('0x1b')]=qs[_0xffa4('0x1b')](_0x2af5a6['query'][_0xffa4('0x1b')]);_0x26f278[_0xffa4('0x1d')]=qs['offset'](_0x2af5a6[_0xffa4('0x2e')][_0xffa4('0x1d')]);}return _0x5d1ec9[_0xffa4('0x4e')](_0x26f278);}})[_0xffa4('0x23')](function(_0x3e4c5f){if(_0x3e4c5f){return _0x3e4c5f?{'count':_0x2efc23,'rows':_0x3e4c5f}:null;}})['then'](respondWithResult(_0x2fcd3b,null))[_0xffa4('0x41')](handleError(_0x2fcd3b,null));};
\ No newline at end of file
+var _0x3128=['end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','FreshsalesConfiguration','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','catch','show','includeAll','find','create','destroy','getSubjects','params','FreshsalesField','getDescriptions','findOne','pick','getFields','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0xf4f747,_0xae39e7){var _0xe39837=function(_0x591d15){while(--_0x591d15){_0xf4f747['push'](_0xf4f747['shift']());}};_0xe39837(++_0xae39e7);}(_0x3128,0x1d4));var _0x8312=function(_0x1d480b,_0x453a6d){_0x1d480b=_0x1d480b-0x0;var _0x8a357d=_0x3128[_0x1d480b];return _0x8a357d;};'use strict';var emlformat=require(_0x8312('0x0'));var rimraf=require(_0x8312('0x1'));var zipdir=require(_0x8312('0x2'));var jsonpatch=require(_0x8312('0x3'));var rp=require('request-promise');var moment=require(_0x8312('0x4'));var BPromise=require(_0x8312('0x5'));var Mustache=require(_0x8312('0x6'));var util=require(_0x8312('0x7'));var path=require(_0x8312('0x8'));var sox=require(_0x8312('0x9'));var csv=require(_0x8312('0xa'));var ejs=require(_0x8312('0xb'));var fs=require('fs');var fs_extra=require(_0x8312('0xc'));var _=require(_0x8312('0xd'));var squel=require(_0x8312('0xe'));var crypto=require(_0x8312('0xf'));var jsforce=require(_0x8312('0x10'));var deskjs=require(_0x8312('0x11'));var toCsv=require(_0x8312('0xa'));var querystring=require(_0x8312('0x12'));var Papa=require(_0x8312('0x13'));var Redis=require('ioredis');var authService=require(_0x8312('0x14'));var qs=require(_0x8312('0x15'));var as=require(_0x8312('0x16'));var hardwareService=require(_0x8312('0x17'));var logger=require(_0x8312('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x8312('0x19'));var licenseUtil=require(_0x8312('0x1a'));var db=require(_0x8312('0x1b'))['db'];function respondWithStatusCode(_0x9e7727,_0x1c9ad8){_0x1c9ad8=_0x1c9ad8||0xcc;return function(_0x3331d2){if(_0x3331d2){return _0x9e7727[_0x8312('0x1c')](_0x1c9ad8);}return _0x9e7727[_0x8312('0x1d')](_0x1c9ad8)[_0x8312('0x1e')]();};}function respondWithResult(_0x389e37,_0x44b163){_0x44b163=_0x44b163||0xc8;return function(_0x4cb49){if(_0x4cb49){return _0x389e37[_0x8312('0x1d')](_0x44b163)[_0x8312('0x1f')](_0x4cb49);}};}function respondWithFilteredResult(_0x257abf,_0x2547ea){return function(_0x50c131){if(_0x50c131){var _0x49fda0=typeof _0x2547ea[_0x8312('0x20')]===_0x8312('0x21')&&typeof _0x2547ea[_0x8312('0x22')]===_0x8312('0x21');var _0x437116=_0x50c131[_0x8312('0x23')];var _0x165ff0=_0x49fda0?0x0:_0x2547ea[_0x8312('0x20')];var _0xf4f53=_0x49fda0?_0x50c131['count']:_0x2547ea['offset']+_0x2547ea[_0x8312('0x22')];var _0x3ceadb;if(_0xf4f53>=_0x437116){_0xf4f53=_0x437116;_0x3ceadb=0xc8;}else{_0x3ceadb=0xce;}_0x257abf[_0x8312('0x1d')](_0x3ceadb);return _0x257abf['set'](_0x8312('0x24'),_0x165ff0+'-'+_0xf4f53+'/'+_0x437116)[_0x8312('0x1f')](_0x50c131);}return null;};}function patchUpdates(_0x2cbffe){return function(_0x497d76){try{jsonpatch[_0x8312('0x25')](_0x497d76,_0x2cbffe,!![]);}catch(_0x213adb){return BPromise[_0x8312('0x26')](_0x213adb);}return _0x497d76[_0x8312('0x27')]();};}function saveUpdates(_0x4624a4,_0x5df663){return function(_0x21a5c0){if(_0x21a5c0){return _0x21a5c0[_0x8312('0x28')](_0x4624a4)['then'](function(_0x201230){return _0x201230;});}return null;};}function removeEntity(_0x4d36af,_0x29d1a5){return function(_0x2314e4){if(_0x2314e4){return _0x2314e4['destroy']()[_0x8312('0x29')](function(){_0x4d36af[_0x8312('0x1d')](0xcc)[_0x8312('0x1e')]();});}};}function handleEntityNotFound(_0x4e3301,_0x194b7b){return function(_0x5516b2){if(!_0x5516b2){_0x4e3301[_0x8312('0x1c')](0x194);}return _0x5516b2;};}function handleError(_0x2551b5,_0x6da355){_0x6da355=_0x6da355||0x1f4;return function(_0x1997fd){logger[_0x8312('0x2a')](_0x1997fd[_0x8312('0x2b')]);if(_0x1997fd[_0x8312('0x2c')]){delete _0x1997fd[_0x8312('0x2c')];}_0x2551b5['status'](_0x6da355)[_0x8312('0x2d')](_0x1997fd);};}exports['index']=function(_0x5c58aa,_0xaea045){var _0x2a442a={},_0x52393d={},_0x2edfd8={'count':0x0,'rows':[]};var _0x3e9fd8=_[_0x8312('0x2e')](db[_0x8312('0x2f')][_0x8312('0x30')],function(_0x4262d4){return{'name':_0x4262d4[_0x8312('0x31')],'type':_0x4262d4[_0x8312('0x32')]['key']};});_0x52393d['model']=_[_0x8312('0x2e')](_0x3e9fd8,_0x8312('0x2c'));_0x52393d[_0x8312('0x33')]=_[_0x8312('0x34')](_0x5c58aa[_0x8312('0x33')]);_0x52393d[_0x8312('0x35')]=_[_0x8312('0x36')](_0x52393d[_0x8312('0x37')],_0x52393d[_0x8312('0x33')]);_0x2a442a['attributes']=_[_0x8312('0x36')](_0x52393d[_0x8312('0x37')],qs[_0x8312('0x38')](_0x5c58aa[_0x8312('0x33')]['fields']));_0x2a442a[_0x8312('0x39')]=_0x2a442a[_0x8312('0x39')][_0x8312('0x3a')]?_0x2a442a['attributes']:_0x52393d[_0x8312('0x37')];if(!_0x5c58aa['query'][_0x8312('0x3b')](_0x8312('0x3c'))){_0x2a442a['limit']=qs[_0x8312('0x22')](_0x5c58aa['query']['limit']);_0x2a442a['offset']=qs[_0x8312('0x20')](_0x5c58aa[_0x8312('0x33')]['offset']);}_0x2a442a[_0x8312('0x3d')]=qs[_0x8312('0x3e')](_0x5c58aa[_0x8312('0x33')][_0x8312('0x3e')]);_0x2a442a[_0x8312('0x3f')]=qs[_0x8312('0x35')](_['pick'](_0x5c58aa[_0x8312('0x33')],_0x52393d['filters']),_0x3e9fd8);if(_0x5c58aa['query'][_0x8312('0x40')]){_0x2a442a['where']=_[_0x8312('0x41')](_0x2a442a[_0x8312('0x3f')],{'$or':_[_0x8312('0x2e')](_0x3e9fd8,function(_0x2f9101){if(_0x2f9101['type']!=='VIRTUAL'){var _0x3a26a5={};_0x3a26a5[_0x2f9101[_0x8312('0x2c')]]={'$like':'%'+_0x5c58aa[_0x8312('0x33')]['filter']+'%'};return _0x3a26a5;}})});}_0x2a442a=_[_0x8312('0x41')]({},_0x2a442a,_0x5c58aa[_0x8312('0x42')]);var _0x3e6818={'where':_0x2a442a[_0x8312('0x3f')]};return db['FreshsalesConfiguration']['count'](_0x3e6818)['then'](function(_0x78de83){_0x2edfd8[_0x8312('0x23')]=_0x78de83;if(_0x5c58aa[_0x8312('0x33')]['includeAll']){_0x2a442a[_0x8312('0x43')]=[{'all':!![]}];}return db[_0x8312('0x2f')][_0x8312('0x44')](_0x2a442a);})[_0x8312('0x29')](function(_0x4ea1d1){_0x2edfd8[_0x8312('0x45')]=_0x4ea1d1;return _0x2edfd8;})[_0x8312('0x29')](respondWithFilteredResult(_0xaea045,_0x2a442a))[_0x8312('0x46')](handleError(_0xaea045,null));};exports[_0x8312('0x47')]=function(_0x1820fc,_0x4d3dcf){var _0x5ed728={'raw':![],'where':{'id':_0x1820fc['params']['id']}},_0x43ecee={};_0x43ecee[_0x8312('0x37')]=_[_0x8312('0x34')](db['FreshsalesConfiguration'][_0x8312('0x30')]);_0x43ecee[_0x8312('0x33')]=_['keys'](_0x1820fc['query']);_0x43ecee[_0x8312('0x35')]=_[_0x8312('0x36')](_0x43ecee[_0x8312('0x37')],_0x43ecee[_0x8312('0x33')]);_0x5ed728[_0x8312('0x39')]=_[_0x8312('0x36')](_0x43ecee[_0x8312('0x37')],qs[_0x8312('0x38')](_0x1820fc[_0x8312('0x33')][_0x8312('0x38')]));_0x5ed728['attributes']=_0x5ed728[_0x8312('0x39')][_0x8312('0x3a')]?_0x5ed728[_0x8312('0x39')]:_0x43ecee[_0x8312('0x37')];if(_0x1820fc[_0x8312('0x33')][_0x8312('0x48')]){_0x5ed728[_0x8312('0x43')]=[{'all':!![]}];}_0x5ed728=_[_0x8312('0x41')]({},_0x5ed728,_0x1820fc['options']);return db[_0x8312('0x2f')][_0x8312('0x49')](_0x5ed728)[_0x8312('0x29')](handleEntityNotFound(_0x4d3dcf,null))[_0x8312('0x29')](respondWithResult(_0x4d3dcf,null))[_0x8312('0x46')](handleError(_0x4d3dcf,null));};exports[_0x8312('0x4a')]=function(_0x2f725a,_0x57685c){return db['FreshsalesConfiguration'][_0x8312('0x4a')](_0x2f725a['body'],{})[_0x8312('0x29')](respondWithResult(_0x57685c,0xc9))[_0x8312('0x46')](handleError(_0x57685c,null));};exports['update']=function(_0x178ec3,_0xd08605){if(_0x178ec3['body']['id']){delete _0x178ec3['body']['id'];}return db[_0x8312('0x2f')][_0x8312('0x49')]({'where':{'id':_0x178ec3['params']['id']}})[_0x8312('0x29')](handleEntityNotFound(_0xd08605,null))[_0x8312('0x29')](saveUpdates(_0x178ec3['body'],null))[_0x8312('0x29')](respondWithResult(_0xd08605,null))[_0x8312('0x46')](handleError(_0xd08605,null));};exports[_0x8312('0x4b')]=function(_0x3aa1d0,_0x5b2a7d){return db[_0x8312('0x2f')][_0x8312('0x49')]({'where':{'id':_0x3aa1d0['params']['id']}})[_0x8312('0x29')](handleEntityNotFound(_0x5b2a7d,null))['then'](removeEntity(_0x5b2a7d,null))[_0x8312('0x46')](handleError(_0x5b2a7d,null));};exports[_0x8312('0x4c')]=function(_0x227c38,_0x4e333d,_0x23f7da){var _0x1aeb21={};var _0x566cd8={};var _0x1d4199;var _0x5cc263;return db[_0x8312('0x2f')]['findOne']({'where':{'id':_0x227c38[_0x8312('0x4d')]['id']}})[_0x8312('0x29')](handleEntityNotFound(_0x4e333d,null))[_0x8312('0x29')](function(_0x25f2d8){if(_0x25f2d8){_0x1d4199=_0x25f2d8;_0x566cd8['model']=_[_0x8312('0x34')](db[_0x8312('0x4e')][_0x8312('0x30')]);_0x566cd8['query']=_['keys'](_0x227c38['query']);_0x566cd8[_0x8312('0x35')]=_[_0x8312('0x36')](_0x566cd8[_0x8312('0x37')],_0x566cd8['query']);_0x1aeb21['attributes']=_[_0x8312('0x36')](_0x566cd8[_0x8312('0x37')],qs[_0x8312('0x38')](_0x227c38['query'][_0x8312('0x38')]));_0x1aeb21['attributes']=_0x1aeb21[_0x8312('0x39')]['length']?_0x1aeb21[_0x8312('0x39')]:_0x566cd8['model'];_0x1aeb21[_0x8312('0x3d')]=qs[_0x8312('0x3e')](_0x227c38['query']['sort']);_0x1aeb21[_0x8312('0x3f')]=qs['filters'](_['pick'](_0x227c38[_0x8312('0x33')],_0x566cd8['filters']));if(_0x227c38[_0x8312('0x33')][_0x8312('0x40')]){_0x1aeb21['where']=_[_0x8312('0x41')](_0x1aeb21['where'],{'$or':_[_0x8312('0x2e')](_0x1aeb21['attributes'],function(_0x478543){var _0x2f11f4={};_0x2f11f4[_0x478543]={'$like':'%'+_0x227c38[_0x8312('0x33')][_0x8312('0x40')]+'%'};return _0x2f11f4;})});}_0x1aeb21=_[_0x8312('0x41')]({},_0x1aeb21,_0x227c38[_0x8312('0x42')]);return _0x1d4199[_0x8312('0x4c')](_0x1aeb21);}})[_0x8312('0x29')](function(_0x1eec38){if(_0x1eec38){_0x5cc263=_0x1eec38[_0x8312('0x3a')];if(!_0x227c38[_0x8312('0x33')][_0x8312('0x3b')](_0x8312('0x3c'))){_0x1aeb21[_0x8312('0x22')]=qs['limit'](_0x227c38[_0x8312('0x33')][_0x8312('0x22')]);_0x1aeb21[_0x8312('0x20')]=qs[_0x8312('0x20')](_0x227c38[_0x8312('0x33')][_0x8312('0x20')]);}return _0x1d4199[_0x8312('0x4c')](_0x1aeb21);}})['then'](function(_0x27c8b0){if(_0x27c8b0){return _0x27c8b0?{'count':_0x5cc263,'rows':_0x27c8b0}:null;}})[_0x8312('0x29')](respondWithResult(_0x4e333d,null))['catch'](handleError(_0x4e333d,null));};exports[_0x8312('0x4f')]=function(_0x184574,_0x541ae7,_0x45052a){var _0x173340={};var _0x2cf4e8={};var _0x4bd87b;var _0x5e6216;return db['FreshsalesConfiguration'][_0x8312('0x50')]({'where':{'id':_0x184574['params']['id']}})[_0x8312('0x29')](handleEntityNotFound(_0x541ae7,null))['then'](function(_0x19dff4){if(_0x19dff4){_0x4bd87b=_0x19dff4;_0x2cf4e8['model']=_[_0x8312('0x34')](db[_0x8312('0x4e')]['rawAttributes']);_0x2cf4e8[_0x8312('0x33')]=_[_0x8312('0x34')](_0x184574[_0x8312('0x33')]);_0x2cf4e8[_0x8312('0x35')]=_['intersection'](_0x2cf4e8['model'],_0x2cf4e8['query']);_0x173340[_0x8312('0x39')]=_[_0x8312('0x36')](_0x2cf4e8[_0x8312('0x37')],qs[_0x8312('0x38')](_0x184574[_0x8312('0x33')]['fields']));_0x173340[_0x8312('0x39')]=_0x173340[_0x8312('0x39')][_0x8312('0x3a')]?_0x173340[_0x8312('0x39')]:_0x2cf4e8['model'];_0x173340['order']=qs['sort'](_0x184574['query']['sort']);_0x173340[_0x8312('0x3f')]=qs[_0x8312('0x35')](_[_0x8312('0x51')](_0x184574['query'],_0x2cf4e8[_0x8312('0x35')]));if(_0x184574['query'][_0x8312('0x40')]){_0x173340[_0x8312('0x3f')]=_[_0x8312('0x41')](_0x173340[_0x8312('0x3f')],{'$or':_[_0x8312('0x2e')](_0x173340[_0x8312('0x39')],function(_0x5adfcf){var _0x457d5b={};_0x457d5b[_0x5adfcf]={'$like':'%'+_0x184574[_0x8312('0x33')][_0x8312('0x40')]+'%'};return _0x457d5b;})});}_0x173340=_['merge']({},_0x173340,_0x184574[_0x8312('0x42')]);return _0x4bd87b[_0x8312('0x4f')](_0x173340);}})[_0x8312('0x29')](function(_0x47be88){if(_0x47be88){_0x5e6216=_0x47be88[_0x8312('0x3a')];if(!_0x184574[_0x8312('0x33')][_0x8312('0x3b')](_0x8312('0x3c'))){_0x173340[_0x8312('0x22')]=qs[_0x8312('0x22')](_0x184574[_0x8312('0x33')]['limit']);_0x173340[_0x8312('0x20')]=qs[_0x8312('0x20')](_0x184574[_0x8312('0x33')][_0x8312('0x20')]);}return _0x4bd87b['getDescriptions'](_0x173340);}})[_0x8312('0x29')](function(_0x165a87){if(_0x165a87){return _0x165a87?{'count':_0x5e6216,'rows':_0x165a87}:null;}})[_0x8312('0x29')](respondWithResult(_0x541ae7,null))[_0x8312('0x46')](handleError(_0x541ae7,null));};exports[_0x8312('0x52')]=function(_0xe0e28e,_0x34b5db,_0x4be555){var _0x3213d2={};var _0x25e819={};var _0xb13e22;var _0x2dcb09;return db['FreshsalesConfiguration'][_0x8312('0x50')]({'where':{'id':_0xe0e28e[_0x8312('0x4d')]['id']}})[_0x8312('0x29')](handleEntityNotFound(_0x34b5db,null))[_0x8312('0x29')](function(_0x20e6d5){if(_0x20e6d5){_0xb13e22=_0x20e6d5;_0x25e819[_0x8312('0x37')]=_[_0x8312('0x34')](db[_0x8312('0x4e')][_0x8312('0x30')]);_0x25e819[_0x8312('0x33')]=_[_0x8312('0x34')](_0xe0e28e[_0x8312('0x33')]);_0x25e819[_0x8312('0x35')]=_['intersection'](_0x25e819[_0x8312('0x37')],_0x25e819[_0x8312('0x33')]);_0x3213d2[_0x8312('0x39')]=_[_0x8312('0x36')](_0x25e819[_0x8312('0x37')],qs[_0x8312('0x38')](_0xe0e28e[_0x8312('0x33')][_0x8312('0x38')]));_0x3213d2['attributes']=_0x3213d2['attributes'][_0x8312('0x3a')]?_0x3213d2[_0x8312('0x39')]:_0x25e819[_0x8312('0x37')];_0x3213d2[_0x8312('0x3d')]=qs[_0x8312('0x3e')](_0xe0e28e[_0x8312('0x33')][_0x8312('0x3e')]);_0x3213d2[_0x8312('0x3f')]=qs[_0x8312('0x35')](_['pick'](_0xe0e28e[_0x8312('0x33')],_0x25e819['filters']));if(_0xe0e28e['query']['filter']){_0x3213d2[_0x8312('0x3f')]=_[_0x8312('0x41')](_0x3213d2[_0x8312('0x3f')],{'$or':_[_0x8312('0x2e')](_0x3213d2[_0x8312('0x39')],function(_0x4141c1){var _0x1da086={};_0x1da086[_0x4141c1]={'$like':'%'+_0xe0e28e[_0x8312('0x33')][_0x8312('0x40')]+'%'};return _0x1da086;})});}_0x3213d2=_[_0x8312('0x41')]({},_0x3213d2,_0xe0e28e[_0x8312('0x42')]);return _0xb13e22[_0x8312('0x52')](_0x3213d2);}})[_0x8312('0x29')](function(_0x2298fd){if(_0x2298fd){_0x2dcb09=_0x2298fd[_0x8312('0x3a')];if(!_0xe0e28e[_0x8312('0x33')][_0x8312('0x3b')]('nolimit')){_0x3213d2[_0x8312('0x22')]=qs[_0x8312('0x22')](_0xe0e28e['query'][_0x8312('0x22')]);_0x3213d2[_0x8312('0x20')]=qs['offset'](_0xe0e28e[_0x8312('0x33')][_0x8312('0x20')]);}return _0xb13e22[_0x8312('0x52')](_0x3213d2);}})['then'](function(_0x2de319){if(_0x2de319){return _0x2de319?{'count':_0x2dcb09,'rows':_0x2de319}:null;}})[_0x8312('0x29')](respondWithResult(_0x34b5db,null))[_0x8312('0x46')](handleError(_0x34b5db,null));};
\ No newline at end of file
index 185ed54..6e61d07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x768f=['request-promise','path','../../config/environment','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x1c9783,_0x428ceb){var _0x462761=function(_0x28f97f){while(--_0x28f97f){_0x1c9783['push'](_0x1c9783['shift']());}};_0x462761(++_0x428ceb);}(_0x768f,0x1ab));var _0xf768=function(_0x3a7dda,_0x2a4ecf){_0x3a7dda=_0x3a7dda-0x0;var _0x6b11c5=_0x768f[_0x3a7dda];return _0x6b11c5;};'use strict';var _=require(_0xf768('0x0'));var util=require(_0xf768('0x1'));var logger=require(_0xf768('0x2'))(_0xf768('0x3'));var moment=require(_0xf768('0x4'));var BPromise=require('bluebird');var rp=require(_0xf768('0x5'));var fs=require('fs');var path=require(_0xf768('0x6'));var rimraf=require('rimraf');var config=require(_0xf768('0x7'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xf768('0x8')]=function(_0x157d27,_0x973991){return _0x157d27[_0xf768('0x9')](_0xf768('0xa'),attributes,{'tableName':_0xf768('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaafc=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','int_freshsales_configurations'];(function(_0x1f1e31,_0x27b5c3){var _0x229b56=function(_0x16db77){while(--_0x16db77){_0x1f1e31['push'](_0x1f1e31['shift']());}};_0x229b56(++_0x27b5c3);}(_0xaafc,0xcc));var _0xcaaf=function(_0x293abb,_0x1966b3){_0x293abb=_0x293abb-0x0;var _0x246b4f=_0xaafc[_0x293abb];return _0x246b4f;};'use strict';var _=require('lodash');var util=require(_0xcaaf('0x0'));var logger=require(_0xcaaf('0x1'))(_0xcaaf('0x2'));var moment=require(_0xcaaf('0x3'));var BPromise=require(_0xcaaf('0x4'));var rp=require(_0xcaaf('0x5'));var fs=require('fs');var path=require(_0xcaaf('0x6'));var rimraf=require(_0xcaaf('0x7'));var config=require(_0xcaaf('0x8'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xcaaf('0x9')]=function(_0x2fc5e5,_0x1f8352){return _0x2fc5e5[_0xcaaf('0xa')]('FreshsalesConfiguration',attributes,{'tableName':_0xcaaf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 83c7cac..8079084 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf69f=['request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','FreshsalesConfiguration,\x20%s,\x20%s'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xf69f,0xa0));var _0xff69=function(_0x4cf2eb,_0xd1a423){_0x4cf2eb=_0x4cf2eb-0x0;var _0x10f9e8=_0xf69f[_0x4cf2eb];return _0x10f9e8;};'use strict';var _=require(_0xff69('0x0'));var util=require(_0xff69('0x1'));var moment=require(_0xff69('0x2'));var BPromise=require(_0xff69('0x3'));var rs=require(_0xff69('0x4'));var fs=require('fs');var Redis=require(_0xff69('0x5'));var db=require(_0xff69('0x6'))['db'];var utils=require(_0xff69('0x7'));var logger=require(_0xff69('0x8'))(_0xff69('0x9'));var config=require(_0xff69('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xff69('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1dec23,_0xdf3fff,_0x22dfbf){return new BPromise(function(_0x1185ce,_0x14834c){return client[_0xff69('0xc')](_0x1dec23,_0x22dfbf)[_0xff69('0xd')](function(_0x247107){logger['info'](_0xff69('0xe'),_0xdf3fff,_0xff69('0xf'));logger[_0xff69('0x10')](_0xff69('0x11'),_0xdf3fff,_0xff69('0xf'),JSON[_0xff69('0x12')](_0x247107));if(_0x247107[_0xff69('0x13')]){if(_0x247107[_0xff69('0x13')][_0xff69('0x14')]===0x1f4){logger[_0xff69('0x13')](_0xff69('0xe'),_0xdf3fff,_0x247107[_0xff69('0x13')]['message']);return _0x14834c(_0x247107[_0xff69('0x13')][_0xff69('0x15')]);}logger[_0xff69('0x13')](_0xff69('0xe'),_0xdf3fff,_0x247107[_0xff69('0x13')][_0xff69('0x15')]);return _0x1185ce(_0x247107[_0xff69('0x13')][_0xff69('0x15')]);}else{logger[_0xff69('0x16')]('FreshsalesConfiguration,\x20%s,\x20%s',_0xdf3fff,_0xff69('0xf'));_0x1185ce(_0x247107[_0xff69('0x17')][_0xff69('0x15')]);}})[_0xff69('0x18')](function(_0x773f70){logger[_0xff69('0x13')](_0xff69('0xe'),_0xdf3fff,_0x773f70);_0x14834c(_0x773f70);});});}
\ No newline at end of file
+var _0xac15=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x1ea853,_0x318901){var _0x4588f0=function(_0x1daa14){while(--_0x1daa14){_0x1ea853['push'](_0x1ea853['shift']());}};_0x4588f0(++_0x318901);}(_0xac15,0x158));var _0x5ac1=function(_0x3ee617,_0x5a55b3){_0x3ee617=_0x3ee617-0x0;var _0x2efc02=_0xac15[_0x3ee617];return _0x2efc02;};'use strict';var _=require(_0x5ac1('0x0'));var util=require(_0x5ac1('0x1'));var moment=require(_0x5ac1('0x2'));var BPromise=require(_0x5ac1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ac1('0x4'));var db=require(_0x5ac1('0x5'))['db'];var utils=require(_0x5ac1('0x6'));var logger=require('../../config/logger')(_0x5ac1('0x7'));var config=require(_0x5ac1('0x8'));var jayson=require(_0x5ac1('0x9'));var client=jayson[_0x5ac1('0xa')][_0x5ac1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10177a,_0xdad4e0,_0x4d7974){return new BPromise(function(_0x27d9db,_0x459cfe){return client['request'](_0x10177a,_0x4d7974)[_0x5ac1('0xc')](function(_0x3a9511){logger[_0x5ac1('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0xdad4e0,_0x5ac1('0xe'));logger[_0x5ac1('0xf')](_0x5ac1('0x10'),_0xdad4e0,_0x5ac1('0xe'),JSON[_0x5ac1('0x11')](_0x3a9511));if(_0x3a9511[_0x5ac1('0x12')]){if(_0x3a9511[_0x5ac1('0x12')]['code']===0x1f4){logger[_0x5ac1('0x12')](_0x5ac1('0x13'),_0xdad4e0,_0x3a9511[_0x5ac1('0x12')][_0x5ac1('0x14')]);return _0x459cfe(_0x3a9511[_0x5ac1('0x12')][_0x5ac1('0x14')]);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0xdad4e0,_0x3a9511['error'][_0x5ac1('0x14')]);return _0x27d9db(_0x3a9511[_0x5ac1('0x12')]['message']);}else{logger[_0x5ac1('0xd')](_0x5ac1('0x13'),_0xdad4e0,_0x5ac1('0xe'));_0x27d9db(_0x3a9511[_0x5ac1('0x15')]['message']);}})[_0x5ac1('0x16')](function(_0x44ebb3){logger[_0x5ac1('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0xdad4e0,_0x44ebb3);_0x459cfe(_0x44ebb3);});});}
\ No newline at end of file
index 8037b3b..49b8878 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb821=['put','update','delete','destroy','exports','util','path','Router','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','index','/:id','isAuthenticated','show','post','create'];(function(_0x2a211a,_0x20be49){var _0x460f5f=function(_0x2f49d6){while(--_0x2f49d6){_0x2a211a['push'](_0x2a211a['shift']());}};_0x460f5f(++_0x20be49);}(_0xb821,0xa7));var _0x1b82=function(_0x5d6aeb,_0x26d428){_0x5d6aeb=_0x5d6aeb-0x0;var _0x2ce146=_0xb821[_0x5d6aeb];return _0x2ce146;};'use strict';var multer=require('multer');var util=require(_0x1b82('0x0'));var path=require(_0x1b82('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1b82('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1b82('0x3'));var config=require(_0x1b82('0x4'));var controller=require(_0x1b82('0x5'));router[_0x1b82('0x6')]('/',auth['isAuthenticated'](),controller[_0x1b82('0x7')]);router[_0x1b82('0x6')](_0x1b82('0x8'),auth[_0x1b82('0x9')](),controller[_0x1b82('0xa')]);router[_0x1b82('0xb')]('/',auth[_0x1b82('0x9')](),controller[_0x1b82('0xc')]);router[_0x1b82('0xd')]('/:id',auth[_0x1b82('0x9')](),controller[_0x1b82('0xe')]);router[_0x1b82('0xf')](_0x1b82('0x8'),auth[_0x1b82('0x9')](),controller[_0x1b82('0x10')]);module[_0x1b82('0x11')]=router;
\ No newline at end of file
+var _0xe130=['post','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated'];(function(_0x2df509,_0x468b0d){var _0x378ce7=function(_0x48c010){while(--_0x48c010){_0x2df509['push'](_0x2df509['shift']());}};_0x378ce7(++_0x468b0d);}(_0xe130,0x127));var _0x0e13=function(_0x536e58,_0x4187f6){_0x536e58=_0x536e58-0x0;var _0x310c56=_0xe130[_0x536e58];return _0x310c56;};'use strict';var multer=require(_0x0e13('0x0'));var util=require(_0x0e13('0x1'));var path=require('path');var timeout=require(_0x0e13('0x2'));var express=require(_0x0e13('0x3'));var router=express[_0x0e13('0x4')]();var fs_extra=require(_0x0e13('0x5'));var auth=require(_0x0e13('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0e13('0x7'));var controller=require(_0x0e13('0x8'));router[_0x0e13('0x9')]('/',auth[_0x0e13('0xa')](),controller['index']);router[_0x0e13('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x0e13('0xb')]('/',auth[_0x0e13('0xa')](),controller['create']);router['put'](_0x0e13('0xc'),auth[_0x0e13('0xa')](),controller[_0x0e13('0xd')]);router[_0x0e13('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x0e13('0xf')]);module[_0x0e13('0x10')]=router;
\ No newline at end of file
index b415555..bb518de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22d5=['variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string'];(function(_0x5bc6cf,_0x11ecff){var _0xb448d1=function(_0xedbad3){while(--_0xedbad3){_0x5bc6cf['push'](_0x5bc6cf['shift']());}};_0xb448d1(++_0x11ecff);}(_0x22d5,0xcb));var _0x522d=function(_0x1658af,_0x5dbcab){_0x1658af=_0x1658af-0x0;var _0x30d065=_0x22d5[_0x1658af];return _0x30d065;};'use strict';var Sequelize=require(_0x522d('0x0'));module[_0x522d('0x1')]={'type':{'type':Sequelize[_0x522d('0x2')](_0x522d('0x3'),_0x522d('0x4'),_0x522d('0x5'),_0x522d('0x6'),_0x522d('0x7')),'defaultValue':_0x522d('0x3')},'content':{'type':Sequelize[_0x522d('0x8')]},'key':{'type':Sequelize[_0x522d('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x522d('0x3'),_0x522d('0x4'),_0x522d('0x5'))},'keyContent':{'type':Sequelize[_0x522d('0x8')]},'idField':{'type':Sequelize[_0x522d('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x522d('0x8')]}};
\ No newline at end of file
+var _0x0bae=['ENUM','variable','customVariable','sequelize','exports','string','keyValue','STRING'];(function(_0x4577ff,_0x2c272b){var _0x9c934d=function(_0x476e1f){while(--_0x476e1f){_0x4577ff['push'](_0x4577ff['shift']());}};_0x9c934d(++_0x2c272b);}(_0x0bae,0x83));var _0xe0ba=function(_0xc19608,_0x87edc3){_0xc19608=_0xc19608-0x0;var _0x25e07f=_0x0bae[_0xc19608];return _0x25e07f;};'use strict';var Sequelize=require(_0xe0ba('0x0'));module[_0xe0ba('0x1')]={'type':{'type':Sequelize['ENUM'](_0xe0ba('0x2'),'variable','customVariable',_0xe0ba('0x3'),'picklist'),'defaultValue':_0xe0ba('0x2')},'content':{'type':Sequelize[_0xe0ba('0x4')]},'key':{'type':Sequelize[_0xe0ba('0x4')]},'keyType':{'type':Sequelize[_0xe0ba('0x5')](_0xe0ba('0x2'),_0xe0ba('0x6'),_0xe0ba('0x7'))},'keyContent':{'type':Sequelize[_0xe0ba('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xe0ba('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe0ba('0x4')]}};
\ No newline at end of file
index a66fbfc..6be3611 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x244d=['reject','save','update','destroy','then','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','order','where','pick','merge','include','findAll','rows','catch','show','params','fields','length','options','find','create','body','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range'];(function(_0x1406a4,_0x3dc6e3){var _0x28138c=function(_0xcb80a8){while(--_0xcb80a8){_0x1406a4['push'](_0x1406a4['shift']());}};_0x28138c(++_0x3dc6e3);}(_0x244d,0x12a));var _0xd244=function(_0x3b8c63,_0x24a9c6){_0x3b8c63=_0x3b8c63-0x0;var _0x1a8e31=_0x244d[_0x3b8c63];return _0x1a8e31;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd244('0x0'));var jsonpatch=require(_0xd244('0x1'));var rp=require(_0xd244('0x2'));var moment=require('moment');var BPromise=require(_0xd244('0x3'));var Mustache=require(_0xd244('0x4'));var util=require(_0xd244('0x5'));var path=require(_0xd244('0x6'));var sox=require(_0xd244('0x7'));var csv=require(_0xd244('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd244('0x9'));var _=require(_0xd244('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd244('0xb'));var toCsv=require(_0xd244('0x8'));var querystring=require(_0xd244('0xc'));var Papa=require(_0xd244('0xd'));var Redis=require(_0xd244('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd244('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xd244('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0xd244('0x11'))['db'];function respondWithStatusCode(_0x2e0e5b,_0x2d3ad1){_0x2d3ad1=_0x2d3ad1||0xcc;return function(_0x3d4dad){if(_0x3d4dad){return _0x2e0e5b[_0xd244('0x12')](_0x2d3ad1);}return _0x2e0e5b['status'](_0x2d3ad1)[_0xd244('0x13')]();};}function respondWithResult(_0xe6b92d,_0x4ca1c3){_0x4ca1c3=_0x4ca1c3||0xc8;return function(_0x184c40){if(_0x184c40){return _0xe6b92d[_0xd244('0x14')](_0x4ca1c3)[_0xd244('0x15')](_0x184c40);}};}function respondWithFilteredResult(_0x53a250,_0x24cf47){return function(_0x291559){if(_0x291559){var _0x2c188c=typeof _0x24cf47[_0xd244('0x16')]==='undefined'&&typeof _0x24cf47[_0xd244('0x17')]==='undefined';var _0x3a4d03=_0x291559[_0xd244('0x18')];var _0x1290fe=_0x2c188c?0x0:_0x24cf47[_0xd244('0x16')];var _0x5f230a=_0x2c188c?_0x291559[_0xd244('0x18')]:_0x24cf47['offset']+_0x24cf47['limit'];var _0x5c5798;if(_0x5f230a>=_0x3a4d03){_0x5f230a=_0x3a4d03;_0x5c5798=0xc8;}else{_0x5c5798=0xce;}_0x53a250[_0xd244('0x14')](_0x5c5798);return _0x53a250[_0xd244('0x19')](_0xd244('0x1a'),_0x1290fe+'-'+_0x5f230a+'/'+_0x3a4d03)[_0xd244('0x15')](_0x291559);}return null;};}function patchUpdates(_0x5225ed){return function(_0x155a26){try{jsonpatch['apply'](_0x155a26,_0x5225ed,!![]);}catch(_0x6c4e3d){return BPromise[_0xd244('0x1b')](_0x6c4e3d);}return _0x155a26[_0xd244('0x1c')]();};}function saveUpdates(_0x5c41eb,_0x25cf5e){return function(_0x47eaf1){if(_0x47eaf1){return _0x47eaf1[_0xd244('0x1d')](_0x5c41eb)['then'](function(_0x5caead){return _0x5caead;});}return null;};}function removeEntity(_0x19544a,_0x14fd1c){return function(_0x3bc6c7){if(_0x3bc6c7){return _0x3bc6c7[_0xd244('0x1e')]()[_0xd244('0x1f')](function(){_0x19544a[_0xd244('0x14')](0xcc)[_0xd244('0x13')]();});}};}function handleEntityNotFound(_0x425cf6,_0x31729c){return function(_0x5e5744){if(!_0x5e5744){_0x425cf6['sendStatus'](0x194);}return _0x5e5744;};}function handleError(_0x2e4a1b,_0x6d7b30){_0x6d7b30=_0x6d7b30||0x1f4;return function(_0x3523d4){logger[_0xd244('0x20')](_0x3523d4[_0xd244('0x21')]);if(_0x3523d4[_0xd244('0x22')]){delete _0x3523d4[_0xd244('0x22')];}_0x2e4a1b['status'](_0x6d7b30)[_0xd244('0x23')](_0x3523d4);};}exports[_0xd244('0x24')]=function(_0x274f6e,_0xd523d8){var _0xfe44c9={},_0x255ad3={},_0x2c9ab4={'count':0x0,'rows':[]};var _0x4d90f5=_[_0xd244('0x25')](db[_0xd244('0x26')][_0xd244('0x27')],function(_0x568b12){return{'name':_0x568b12[_0xd244('0x28')],'type':_0x568b12[_0xd244('0x29')][_0xd244('0x2a')]};});_0x255ad3[_0xd244('0x2b')]=_[_0xd244('0x25')](_0x4d90f5,'name');_0x255ad3['query']=_[_0xd244('0x2c')](_0x274f6e[_0xd244('0x2d')]);_0x255ad3[_0xd244('0x2e')]=_[_0xd244('0x2f')](_0x255ad3[_0xd244('0x2b')],_0x255ad3['query']);_0xfe44c9[_0xd244('0x30')]=_[_0xd244('0x2f')](_0x255ad3[_0xd244('0x2b')],qs['fields'](_0x274f6e['query']['fields']));_0xfe44c9[_0xd244('0x30')]=_0xfe44c9[_0xd244('0x30')]['length']?_0xfe44c9[_0xd244('0x30')]:_0x255ad3[_0xd244('0x2b')];if(!_0x274f6e[_0xd244('0x2d')]['hasOwnProperty']('nolimit')){_0xfe44c9[_0xd244('0x17')]=qs[_0xd244('0x17')](_0x274f6e['query'][_0xd244('0x17')]);_0xfe44c9['offset']=qs[_0xd244('0x16')](_0x274f6e['query'][_0xd244('0x16')]);}_0xfe44c9[_0xd244('0x31')]=qs['sort'](_0x274f6e[_0xd244('0x2d')]['sort']);_0xfe44c9[_0xd244('0x32')]=qs[_0xd244('0x2e')](_[_0xd244('0x33')](_0x274f6e[_0xd244('0x2d')],_0x255ad3['filters']),_0x4d90f5);if(_0x274f6e[_0xd244('0x2d')]['filter']){_0xfe44c9['where']=_[_0xd244('0x34')](_0xfe44c9[_0xd244('0x32')],{'$or':_[_0xd244('0x25')](_0x4d90f5,function(_0x626e98){if(_0x626e98[_0xd244('0x29')]!=='VIRTUAL'){var _0x1ee5ad={};_0x1ee5ad[_0x626e98['name']]={'$like':'%'+_0x274f6e[_0xd244('0x2d')]['filter']+'%'};return _0x1ee5ad;}})});}_0xfe44c9=_[_0xd244('0x34')]({},_0xfe44c9,_0x274f6e['options']);var _0xfbff0e={'where':_0xfe44c9[_0xd244('0x32')]};return db[_0xd244('0x26')]['count'](_0xfbff0e)[_0xd244('0x1f')](function(_0x2a5546){_0x2c9ab4[_0xd244('0x18')]=_0x2a5546;if(_0x274f6e[_0xd244('0x2d')]['includeAll']){_0xfe44c9[_0xd244('0x35')]=[{'all':!![]}];}return db[_0xd244('0x26')][_0xd244('0x36')](_0xfe44c9);})[_0xd244('0x1f')](function(_0x311e98){_0x2c9ab4[_0xd244('0x37')]=_0x311e98;return _0x2c9ab4;})[_0xd244('0x1f')](respondWithFilteredResult(_0xd523d8,_0xfe44c9))[_0xd244('0x38')](handleError(_0xd523d8,null));};exports[_0xd244('0x39')]=function(_0x36785b,_0x292c46){var _0x57dc3f={'raw':!![],'where':{'id':_0x36785b[_0xd244('0x3a')]['id']}},_0x246b37={};_0x246b37[_0xd244('0x2b')]=_['keys'](db['FreshsalesField'][_0xd244('0x27')]);_0x246b37['query']=_[_0xd244('0x2c')](_0x36785b['query']);_0x246b37['filters']=_[_0xd244('0x2f')](_0x246b37[_0xd244('0x2b')],_0x246b37['query']);_0x57dc3f[_0xd244('0x30')]=_[_0xd244('0x2f')](_0x246b37[_0xd244('0x2b')],qs[_0xd244('0x3b')](_0x36785b['query'][_0xd244('0x3b')]));_0x57dc3f[_0xd244('0x30')]=_0x57dc3f[_0xd244('0x30')][_0xd244('0x3c')]?_0x57dc3f[_0xd244('0x30')]:_0x246b37[_0xd244('0x2b')];if(_0x36785b[_0xd244('0x2d')]['includeAll']){_0x57dc3f[_0xd244('0x35')]=[{'all':!![]}];}_0x57dc3f=_['merge']({},_0x57dc3f,_0x36785b[_0xd244('0x3d')]);return db[_0xd244('0x26')][_0xd244('0x3e')](_0x57dc3f)[_0xd244('0x1f')](handleEntityNotFound(_0x292c46,null))[_0xd244('0x1f')](respondWithResult(_0x292c46,null))[_0xd244('0x38')](handleError(_0x292c46,null));};exports[_0xd244('0x3f')]=function(_0x243107,_0xed0113){return db[_0xd244('0x26')][_0xd244('0x3f')](_0x243107[_0xd244('0x40')],{})[_0xd244('0x1f')](respondWithResult(_0xed0113,0xc9))[_0xd244('0x38')](handleError(_0xed0113,null));};exports[_0xd244('0x1d')]=function(_0x4ad34c,_0x157e43){if(_0x4ad34c[_0xd244('0x40')]['id']){delete _0x4ad34c[_0xd244('0x40')]['id'];}return db[_0xd244('0x26')][_0xd244('0x3e')]({'where':{'id':_0x4ad34c[_0xd244('0x3a')]['id']}})[_0xd244('0x1f')](handleEntityNotFound(_0x157e43,null))[_0xd244('0x1f')](saveUpdates(_0x4ad34c[_0xd244('0x40')],null))[_0xd244('0x1f')](respondWithResult(_0x157e43,null))[_0xd244('0x38')](handleError(_0x157e43,null));};exports['destroy']=function(_0x577105,_0x4daa86){return db[_0xd244('0x26')][_0xd244('0x3e')]({'where':{'id':_0x577105[_0xd244('0x3a')]['id']}})[_0xd244('0x1f')](handleEntityNotFound(_0x4daa86,null))[_0xd244('0x1f')](removeEntity(_0x4daa86,null))[_0xd244('0x38')](handleError(_0x4daa86,null));};
\ No newline at end of file
+var _0x39d5=['send','map','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','FreshsalesField','findAll','catch','show','params','rawAttributes','includeAll','find','body','destroy','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','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','sendStatus','error','stack','name'];(function(_0x2525f1,_0x47034f){var _0x13c1b5=function(_0x2beb2e){while(--_0x2beb2e){_0x2525f1['push'](_0x2525f1['shift']());}};_0x13c1b5(++_0x47034f);}(_0x39d5,0x1a0));var _0x539d=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x39d5[_0x5b78e8];return _0xf2c321;};'use strict';var emlformat=require(_0x539d('0x0'));var rimraf=require(_0x539d('0x1'));var zipdir=require(_0x539d('0x2'));var jsonpatch=require(_0x539d('0x3'));var rp=require(_0x539d('0x4'));var moment=require(_0x539d('0x5'));var BPromise=require(_0x539d('0x6'));var Mustache=require(_0x539d('0x7'));var util=require('util');var path=require(_0x539d('0x8'));var sox=require(_0x539d('0x9'));var csv=require(_0x539d('0xa'));var ejs=require(_0x539d('0xb'));var fs=require('fs');var fs_extra=require(_0x539d('0xc'));var _=require(_0x539d('0xd'));var squel=require(_0x539d('0xe'));var crypto=require(_0x539d('0xf'));var jsforce=require(_0x539d('0x10'));var deskjs=require(_0x539d('0x11'));var toCsv=require(_0x539d('0xa'));var querystring=require(_0x539d('0x12'));var Papa=require(_0x539d('0x13'));var Redis=require(_0x539d('0x14'));var authService=require(_0x539d('0x15'));var qs=require(_0x539d('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x539d('0x17'));var logger=require('../../config/logger')(_0x539d('0x18'));var utils=require(_0x539d('0x19'));var config=require(_0x539d('0x1a'));var licenseUtil=require(_0x539d('0x1b'));var db=require(_0x539d('0x1c'))['db'];function respondWithStatusCode(_0x3a8d74,_0x394adb){_0x394adb=_0x394adb||0xcc;return function(_0x233b12){if(_0x233b12){return _0x3a8d74['sendStatus'](_0x394adb);}return _0x3a8d74[_0x539d('0x1d')](_0x394adb)['end']();};}function respondWithResult(_0x3f6814,_0x1efd57){_0x1efd57=_0x1efd57||0xc8;return function(_0x5ef616){if(_0x5ef616){return _0x3f6814[_0x539d('0x1d')](_0x1efd57)[_0x539d('0x1e')](_0x5ef616);}};}function respondWithFilteredResult(_0xe4957f,_0x5ae051){return function(_0x5eefcf){if(_0x5eefcf){var _0x43d653=typeof _0x5ae051[_0x539d('0x1f')]===_0x539d('0x20')&&typeof _0x5ae051[_0x539d('0x21')]===_0x539d('0x20');var _0x5162f4=_0x5eefcf[_0x539d('0x22')];var _0x815015=_0x43d653?0x0:_0x5ae051[_0x539d('0x1f')];var _0x45c36e=_0x43d653?_0x5eefcf[_0x539d('0x22')]:_0x5ae051['offset']+_0x5ae051[_0x539d('0x21')];var _0x2c2d9e;if(_0x45c36e>=_0x5162f4){_0x45c36e=_0x5162f4;_0x2c2d9e=0xc8;}else{_0x2c2d9e=0xce;}_0xe4957f[_0x539d('0x1d')](_0x2c2d9e);return _0xe4957f[_0x539d('0x23')](_0x539d('0x24'),_0x815015+'-'+_0x45c36e+'/'+_0x5162f4)[_0x539d('0x1e')](_0x5eefcf);}return null;};}function patchUpdates(_0x41ec79){return function(_0x27eb82){try{jsonpatch[_0x539d('0x25')](_0x27eb82,_0x41ec79,!![]);}catch(_0x5c3343){return BPromise[_0x539d('0x26')](_0x5c3343);}return _0x27eb82['save']();};}function saveUpdates(_0x3d230c,_0x2384f7){return function(_0x4998f5){if(_0x4998f5){return _0x4998f5[_0x539d('0x27')](_0x3d230c)[_0x539d('0x28')](function(_0x4aa359){return _0x4aa359;});}return null;};}function removeEntity(_0x2234f7,_0x3d1051){return function(_0x1d0749){if(_0x1d0749){return _0x1d0749['destroy']()[_0x539d('0x28')](function(){_0x2234f7['status'](0xcc)[_0x539d('0x29')]();});}};}function handleEntityNotFound(_0xa6e54,_0x4d0228){return function(_0x2246c3){if(!_0x2246c3){_0xa6e54[_0x539d('0x2a')](0x194);}return _0x2246c3;};}function handleError(_0x5bd07e,_0x12645c){_0x12645c=_0x12645c||0x1f4;return function(_0xfa91a8){logger[_0x539d('0x2b')](_0xfa91a8[_0x539d('0x2c')]);if(_0xfa91a8[_0x539d('0x2d')]){delete _0xfa91a8['name'];}_0x5bd07e[_0x539d('0x1d')](_0x12645c)[_0x539d('0x2e')](_0xfa91a8);};}exports['index']=function(_0x288900,_0x29c0cd){var _0x5bc570={},_0x56840a={},_0x2d47e1={'count':0x0,'rows':[]};var _0x21b550=_[_0x539d('0x2f')](db['FreshsalesField']['rawAttributes'],function(_0x2f3dad){return{'name':_0x2f3dad[_0x539d('0x30')],'type':_0x2f3dad[_0x539d('0x31')]['key']};});_0x56840a[_0x539d('0x32')]=_['map'](_0x21b550,'name');_0x56840a['query']=_[_0x539d('0x33')](_0x288900[_0x539d('0x34')]);_0x56840a[_0x539d('0x35')]=_[_0x539d('0x36')](_0x56840a['model'],_0x56840a[_0x539d('0x34')]);_0x5bc570[_0x539d('0x37')]=_[_0x539d('0x36')](_0x56840a[_0x539d('0x32')],qs[_0x539d('0x38')](_0x288900[_0x539d('0x34')]['fields']));_0x5bc570[_0x539d('0x37')]=_0x5bc570['attributes'][_0x539d('0x39')]?_0x5bc570[_0x539d('0x37')]:_0x56840a[_0x539d('0x32')];if(!_0x288900[_0x539d('0x34')]['hasOwnProperty'](_0x539d('0x3a'))){_0x5bc570[_0x539d('0x21')]=qs[_0x539d('0x21')](_0x288900[_0x539d('0x34')][_0x539d('0x21')]);_0x5bc570[_0x539d('0x1f')]=qs[_0x539d('0x1f')](_0x288900[_0x539d('0x34')][_0x539d('0x1f')]);}_0x5bc570['order']=qs['sort'](_0x288900[_0x539d('0x34')][_0x539d('0x3b')]);_0x5bc570[_0x539d('0x3c')]=qs[_0x539d('0x35')](_[_0x539d('0x3d')](_0x288900[_0x539d('0x34')],_0x56840a[_0x539d('0x35')]),_0x21b550);if(_0x288900[_0x539d('0x34')][_0x539d('0x3e')]){_0x5bc570[_0x539d('0x3c')]=_[_0x539d('0x3f')](_0x5bc570[_0x539d('0x3c')],{'$or':_[_0x539d('0x2f')](_0x21b550,function(_0x4af32b){if(_0x4af32b[_0x539d('0x31')]!==_0x539d('0x40')){var _0x1f1848={};_0x1f1848[_0x4af32b[_0x539d('0x2d')]]={'$like':'%'+_0x288900['query'][_0x539d('0x3e')]+'%'};return _0x1f1848;}})});}_0x5bc570=_[_0x539d('0x3f')]({},_0x5bc570,_0x288900[_0x539d('0x41')]);var _0x2f98aa={'where':_0x5bc570[_0x539d('0x3c')]};return db['FreshsalesField'][_0x539d('0x22')](_0x2f98aa)[_0x539d('0x28')](function(_0x595e96){_0x2d47e1['count']=_0x595e96;if(_0x288900[_0x539d('0x34')]['includeAll']){_0x5bc570[_0x539d('0x42')]=[{'all':!![]}];}return db[_0x539d('0x43')][_0x539d('0x44')](_0x5bc570);})[_0x539d('0x28')](function(_0x5c16a3){_0x2d47e1['rows']=_0x5c16a3;return _0x2d47e1;})['then'](respondWithFilteredResult(_0x29c0cd,_0x5bc570))[_0x539d('0x45')](handleError(_0x29c0cd,null));};exports[_0x539d('0x46')]=function(_0x3a74f0,_0x5a3c9f){var _0x5456f8={'raw':!![],'where':{'id':_0x3a74f0[_0x539d('0x47')]['id']}},_0x8dcdad={};_0x8dcdad[_0x539d('0x32')]=_[_0x539d('0x33')](db[_0x539d('0x43')][_0x539d('0x48')]);_0x8dcdad['query']=_[_0x539d('0x33')](_0x3a74f0[_0x539d('0x34')]);_0x8dcdad['filters']=_[_0x539d('0x36')](_0x8dcdad[_0x539d('0x32')],_0x8dcdad[_0x539d('0x34')]);_0x5456f8[_0x539d('0x37')]=_[_0x539d('0x36')](_0x8dcdad[_0x539d('0x32')],qs[_0x539d('0x38')](_0x3a74f0[_0x539d('0x34')][_0x539d('0x38')]));_0x5456f8[_0x539d('0x37')]=_0x5456f8[_0x539d('0x37')][_0x539d('0x39')]?_0x5456f8['attributes']:_0x8dcdad[_0x539d('0x32')];if(_0x3a74f0[_0x539d('0x34')][_0x539d('0x49')]){_0x5456f8[_0x539d('0x42')]=[{'all':!![]}];}_0x5456f8=_[_0x539d('0x3f')]({},_0x5456f8,_0x3a74f0['options']);return db[_0x539d('0x43')][_0x539d('0x4a')](_0x5456f8)[_0x539d('0x28')](handleEntityNotFound(_0x5a3c9f,null))[_0x539d('0x28')](respondWithResult(_0x5a3c9f,null))[_0x539d('0x45')](handleError(_0x5a3c9f,null));};exports['create']=function(_0x357f90,_0x6ca0c1){return db[_0x539d('0x43')]['create'](_0x357f90['body'],{})[_0x539d('0x28')](respondWithResult(_0x6ca0c1,0xc9))[_0x539d('0x45')](handleError(_0x6ca0c1,null));};exports[_0x539d('0x27')]=function(_0x168b8d,_0x4d8238){if(_0x168b8d['body']['id']){delete _0x168b8d[_0x539d('0x4b')]['id'];}return db['FreshsalesField'][_0x539d('0x4a')]({'where':{'id':_0x168b8d[_0x539d('0x47')]['id']}})[_0x539d('0x28')](handleEntityNotFound(_0x4d8238,null))[_0x539d('0x28')](saveUpdates(_0x168b8d[_0x539d('0x4b')],null))[_0x539d('0x28')](respondWithResult(_0x4d8238,null))[_0x539d('0x45')](handleError(_0x4d8238,null));};exports[_0x539d('0x4c')]=function(_0xdc6cfc,_0x9675b0){return db[_0x539d('0x43')][_0x539d('0x4a')]({'where':{'id':_0xdc6cfc[_0x539d('0x47')]['id']}})[_0x539d('0x28')](handleEntityNotFound(_0x9675b0,null))['then'](removeEntity(_0x9675b0,null))[_0x539d('0x45')](handleError(_0x9675b0,null));};
\ No newline at end of file
index 2c3db0c..63f66dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d11=['idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','define','FreshsalesField'];(function(_0x4726f9,_0xffedd6){var _0x1e45db=function(_0x57aedc){while(--_0x57aedc){_0x4726f9['push'](_0x4726f9['shift']());}};_0x1e45db(++_0xffedd6);}(_0x1d11,0xb6));var _0x11d1=function(_0x49388f,_0x3daa43){_0x49388f=_0x49388f-0x0;var _0x1affdc=_0x1d11[_0x49388f];return _0x1affdc;};'use strict';var _=require(_0x11d1('0x0'));var util=require(_0x11d1('0x1'));var logger=require(_0x11d1('0x2'))(_0x11d1('0x3'));var moment=require(_0x11d1('0x4'));var BPromise=require(_0x11d1('0x5'));var rp=require(_0x11d1('0x6'));var fs=require('fs');var path=require(_0x11d1('0x7'));var rimraf=require(_0x11d1('0x8'));var config=require(_0x11d1('0x9'));var attributes=require(_0x11d1('0xa'));module['exports']=function(_0x32d808,_0x4a9622){return _0x32d808[_0x11d1('0xb')](_0x11d1('0xc'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x11d1('0xd'),_0x11d1('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7cdc=['bluebird','request-promise','rimraf','../../config/environment','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','FieldId','util','../../config/logger','moment'];(function(_0x1820ad,_0x57b1a5){var _0x33bd7e=function(_0xd4e220){while(--_0xd4e220){_0x1820ad['push'](_0x1820ad['shift']());}};_0x33bd7e(++_0x57b1a5);}(_0x7cdc,0x190));var _0xc7cd=function(_0x1203c1,_0x26a31d){_0x1203c1=_0x1203c1-0x0;var _0x7c48f4=_0x7cdc[_0x1203c1];return _0x7c48f4;};'use strict';var _=require('lodash');var util=require(_0xc7cd('0x0'));var logger=require(_0xc7cd('0x1'))('api');var moment=require(_0xc7cd('0x2'));var BPromise=require(_0xc7cd('0x3'));var rp=require(_0xc7cd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc7cd('0x5'));var config=require(_0xc7cd('0x6'));var attributes=require('./intFreshsalesField.attributes');module[_0xc7cd('0x7')]=function(_0x26603f,_0x18bb1b){return _0x26603f[_0xc7cd('0x8')](_0xc7cd('0x9'),attributes,{'tableName':_0xc7cd('0xa'),'paranoid':![],'indexes':[{'name':_0xc7cd('0xb'),'fields':['idField',_0xc7cd('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 635d383..1f3cdba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33af=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x5dfde8,_0xa2f77d){var _0x2253fb=function(_0x16ad74){while(--_0x16ad74){_0x5dfde8['push'](_0x5dfde8['shift']());}};_0x2253fb(++_0xa2f77d);}(_0x33af,0xec));var _0xf33a=function(_0x5aa6a9,_0x3ae14c){_0x5aa6a9=_0x5aa6a9-0x0;var _0x119ce5=_0x33af[_0x5aa6a9];return _0x119ce5;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var moment=require('moment');var BPromise=require(_0xf33a('0x1'));var rs=require(_0xf33a('0x2'));var fs=require('fs');var Redis=require(_0xf33a('0x3'));var db=require(_0xf33a('0x4'))['db'];var utils=require(_0xf33a('0x5'));var logger=require(_0xf33a('0x6'))('rpc');var config=require(_0xf33a('0x7'));var jayson=require(_0xf33a('0x8'));var client=jayson['client'][_0xf33a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x384b14,_0x1b2b01,_0x2f3730){return new BPromise(function(_0x2baabb,_0x2cb169){return client['request'](_0x384b14,_0x2f3730)[_0xf33a('0xa')](function(_0x14eb0e){logger[_0xf33a('0xb')](_0xf33a('0xc'),_0x1b2b01,_0xf33a('0xd'));logger[_0xf33a('0xe')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x1b2b01,'request\x20sent',JSON[_0xf33a('0xf')](_0x14eb0e));if(_0x14eb0e[_0xf33a('0x10')]){if(_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x11')]===0x1f4){logger[_0xf33a('0x10')]('FreshsalesField,\x20%s,\x20%s',_0x1b2b01,_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);return _0x2cb169(_0x14eb0e['error']['message']);}logger[_0xf33a('0x10')](_0xf33a('0xc'),_0x1b2b01,_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);return _0x2baabb(_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);}else{logger[_0xf33a('0xb')](_0xf33a('0xc'),_0x1b2b01,'request\x20sent');_0x2baabb(_0x14eb0e[_0xf33a('0x13')]['message']);}})[_0xf33a('0x14')](function(_0x229389){logger['error'](_0xf33a('0xc'),_0x1b2b01,_0x229389);_0x2cb169(_0x229389);});});}
\ No newline at end of file
+var _0x2bd8=['info','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x5985e4,_0xe87112){var _0x404d47=function(_0x4b1cd7){while(--_0x4b1cd7){_0x5985e4['push'](_0x5985e4['shift']());}};_0x404d47(++_0xe87112);}(_0x2bd8,0x130));var _0x82bd=function(_0x3b8520,_0x284f1e){_0x3b8520=_0x3b8520-0x0;var _0x1e0b08=_0x2bd8[_0x3b8520];return _0x1e0b08;};'use strict';var _=require(_0x82bd('0x0'));var util=require('util');var moment=require(_0x82bd('0x1'));var BPromise=require(_0x82bd('0x2'));var rs=require(_0x82bd('0x3'));var fs=require('fs');var Redis=require(_0x82bd('0x4'));var db=require(_0x82bd('0x5'))['db'];var utils=require(_0x82bd('0x6'));var logger=require(_0x82bd('0x7'))('rpc');var config=require(_0x82bd('0x8'));var jayson=require(_0x82bd('0x9'));var client=jayson[_0x82bd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19dbb1,_0x77d7a9,_0x226f60){return new BPromise(function(_0x1f7463,_0x4dc3a6){return client[_0x82bd('0xb')](_0x19dbb1,_0x226f60)['then'](function(_0x4a9b2c){logger['info'](_0x82bd('0xc'),_0x77d7a9,'request\x20sent');logger['debug'](_0x82bd('0xd'),_0x77d7a9,'request\x20sent',JSON['stringify'](_0x4a9b2c));if(_0x4a9b2c[_0x82bd('0xe')]){if(_0x4a9b2c[_0x82bd('0xe')]['code']===0x1f4){logger[_0x82bd('0xe')]('FreshsalesField,\x20%s,\x20%s',_0x77d7a9,_0x4a9b2c[_0x82bd('0xe')]['message']);return _0x4dc3a6(_0x4a9b2c[_0x82bd('0xe')][_0x82bd('0xf')]);}logger[_0x82bd('0xe')](_0x82bd('0xc'),_0x77d7a9,_0x4a9b2c['error'][_0x82bd('0xf')]);return _0x1f7463(_0x4a9b2c[_0x82bd('0xe')]['message']);}else{logger[_0x82bd('0x10')]('FreshsalesField,\x20%s,\x20%s',_0x77d7a9,_0x82bd('0x11'));_0x1f7463(_0x4a9b2c[_0x82bd('0x12')][_0x82bd('0xf')]);}})[_0x82bd('0x13')](function(_0x209081){logger[_0x82bd('0xe')](_0x82bd('0xc'),_0x77d7a9,_0x209081);_0x4dc3a6(_0x209081);});});}
\ No newline at end of file
index bcfcea0..fed09ae 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(_0x3eb78e,_0x2426d0){var _0x16aa40=function(_0x52697a){while(--_0x52697a){_0x3eb78e['push'](_0x3eb78e['shift']());}};_0x16aa40(++_0x2426d0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router;
\ No newline at end of file
+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(_0x37b7c6,_0x16d450){var _0x923f2a=function(_0x52f106){while(--_0x52f106){_0x37b7c6['push'](_0x37b7c6['shift']());}};_0x923f2a(++_0x16d450);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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
index fc89ddb..b717025 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58cc=['ENUM','integrationTab','sequelize','exports','STRING','username'];(function(_0x244ca4,_0xffa146){var _0x5e44d8=function(_0x50acb1){while(--_0x50acb1){_0x244ca4['push'](_0x244ca4['shift']());}};_0x5e44d8(++_0xffa146);}(_0x58cc,0x7a));var _0xc58c=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x58cc[_0x2b10c6];return _0x3789d2;};'use strict';var Sequelize=require(_0xc58c('0x0'));module[_0xc58c('0x1')]={'name':{'type':Sequelize[_0xc58c('0x2')]},'description':{'type':Sequelize[_0xc58c('0x2')]},'username':{'type':Sequelize[_0xc58c('0x2')],'unique':_0xc58c('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xc58c('0x2')]},'clientId':{'type':Sequelize[_0xc58c('0x2')]},'clientSecret':{'type':Sequelize[_0xc58c('0x2')]},'securityToken':{'type':Sequelize[_0xc58c('0x2')]},'serverUrl':{'type':Sequelize[_0xc58c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xc58c('0x4')]('integrationTab','newTab'),'defaultValue':_0xc58c('0x5')}};
\ No newline at end of file
+var _0xa9fc=['exports','STRING','integrationTab','sequelize'];(function(_0x42bb86,_0x3586c0){var _0x2c33e9=function(_0x4ec793){while(--_0x4ec793){_0x42bb86['push'](_0x42bb86['shift']());}};_0x2c33e9(++_0x3586c0);}(_0xa9fc,0x19f));var _0xca9f=function(_0x280ae7,_0x456fb1){_0x280ae7=_0x280ae7-0x0;var _0x418b9e=_0xa9fc[_0x280ae7];return _0x418b9e;};'use strict';var Sequelize=require(_0xca9f('0x0'));module[_0xca9f('0x1')]={'name':{'type':Sequelize[_0xca9f('0x2')]},'description':{'type':Sequelize[_0xca9f('0x2')]},'username':{'type':Sequelize[_0xca9f('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize[_0xca9f('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xca9f('0x2')]},'clientSecret':{'type':Sequelize[_0xca9f('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xca9f('0x3'),'newTab'),'defaultValue':_0xca9f('0x3')}};
\ No newline at end of file
index d331259..334ac98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5dfb=['type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','SalesforceAccount','includeAll','include','findAll','catch','show','create','body','params','find','getConfigurations','findOne','SalesforceConfiguration','order','addConfiguration','Subjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','Connection','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Description','int','picklist','boolean','textarea','remove','includes','label','custom','picklistValues','value','true','False','false','error','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName'];(function(_0x2ef19c,_0x29caee){var _0x20f642=function(_0x26bcfd){while(--_0x26bcfd){_0x2ef19c['push'](_0x2ef19c['shift']());}};_0x20f642(++_0x29caee);}(_0x5dfb,0x1c3));var _0xb5df=function(_0x1998bb,_0x1f1da1){_0x1998bb=_0x1998bb-0x0;var _0x4ae4c9=_0x5dfb[_0x1998bb];return _0x4ae4c9;};'use strict';var emlformat=require(_0xb5df('0x0'));var rimraf=require(_0xb5df('0x1'));var zipdir=require(_0xb5df('0x2'));var jsonpatch=require(_0xb5df('0x3'));var rp=require(_0xb5df('0x4'));var moment=require('moment');var BPromise=require(_0xb5df('0x5'));var Mustache=require('mustache');var util=require(_0xb5df('0x6'));var path=require(_0xb5df('0x7'));var sox=require(_0xb5df('0x8'));var csv=require(_0xb5df('0x9'));var ejs=require(_0xb5df('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb5df('0xb'));var squel=require(_0xb5df('0xc'));var crypto=require(_0xb5df('0xd'));var jsforce=require(_0xb5df('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5df('0x9'));var querystring=require('querystring');var Papa=require(_0xb5df('0xf'));var Redis=require(_0xb5df('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb5df('0x11'));var as=require(_0xb5df('0x12'));var hardwareService=require(_0xb5df('0x13'));var logger=require(_0xb5df('0x14'))(_0xb5df('0x15'));var utils=require(_0xb5df('0x16'));var config=require(_0xb5df('0x17'));var licenseUtil=require(_0xb5df('0x18'));var db=require(_0xb5df('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5aa500,_0x3b406b){_0x3b406b=_0x3b406b||0xcc;return function(_0x1f4b8e){if(_0x1f4b8e){return _0x5aa500[_0xb5df('0x1a')](_0x3b406b);}return _0x5aa500[_0xb5df('0x1b')](_0x3b406b)[_0xb5df('0x1c')]();};}function respondWithResult(_0x500e40,_0x40a478){_0x40a478=_0x40a478||0xc8;return function(_0x571a20){if(_0x571a20){return _0x500e40[_0xb5df('0x1b')](_0x40a478)[_0xb5df('0x1d')](_0x571a20);}};}function respondWithFilteredResult(_0x15155c,_0x3211dc){return function(_0x2b5d48){if(_0x2b5d48){var _0x2b0611=typeof _0x3211dc[_0xb5df('0x1e')]==='undefined'&&typeof _0x3211dc[_0xb5df('0x1f')]===_0xb5df('0x20');var _0x1d4a69=_0x2b5d48[_0xb5df('0x21')];var _0x736b07=_0x2b0611?0x0:_0x3211dc[_0xb5df('0x1e')];var _0x3578d7=_0x2b0611?_0x2b5d48['count']:_0x3211dc['offset']+_0x3211dc[_0xb5df('0x1f')];var _0x2d6637;if(_0x3578d7>=_0x1d4a69){_0x3578d7=_0x1d4a69;_0x2d6637=0xc8;}else{_0x2d6637=0xce;}_0x15155c[_0xb5df('0x1b')](_0x2d6637);return _0x15155c[_0xb5df('0x22')](_0xb5df('0x23'),_0x736b07+'-'+_0x3578d7+'/'+_0x1d4a69)[_0xb5df('0x1d')](_0x2b5d48);}return null;};}function patchUpdates(_0x3bd52c){return function(_0xb59549){try{jsonpatch[_0xb5df('0x24')](_0xb59549,_0x3bd52c,!![]);}catch(_0x243054){return BPromise[_0xb5df('0x25')](_0x243054);}return _0xb59549[_0xb5df('0x26')]();};}function saveUpdates(_0x518069,_0x572ed6){return function(_0x1ba821){if(_0x1ba821){return _0x1ba821[_0xb5df('0x27')](_0x518069)[_0xb5df('0x28')](function(_0x3d16b1){return _0x3d16b1;});}return null;};}function removeEntity(_0x1f8a39,_0x35218a){return function(_0x4ec204){if(_0x4ec204){return _0x4ec204[_0xb5df('0x29')]()[_0xb5df('0x28')](function(){_0x1f8a39[_0xb5df('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x329449,_0x3b124d){return function(_0x496115){if(!_0x496115){_0x329449[_0xb5df('0x1a')](0x194);}return _0x496115;};}function handleError(_0xd334c9,_0x45fb05){_0x45fb05=_0x45fb05||0x1f4;return function(_0x42c1af){logger['error'](_0x42c1af[_0xb5df('0x2a')]);if(_0x42c1af[_0xb5df('0x2b')]){delete _0x42c1af[_0xb5df('0x2b')];}_0xd334c9[_0xb5df('0x1b')](_0x45fb05)[_0xb5df('0x2c')](_0x42c1af);};}exports[_0xb5df('0x2d')]=function(_0x1beb92,_0x491817){var _0x1cb436={},_0x5a0d2d={},_0x8d91a3={'count':0x0,'rows':[]};var _0x587a55=_[_0xb5df('0x2e')](db['SalesforceAccount'][_0xb5df('0x2f')],function(_0x375d00){return{'name':_0x375d00[_0xb5df('0x30')],'type':_0x375d00[_0xb5df('0x31')][_0xb5df('0x32')]};});_0x5a0d2d[_0xb5df('0x33')]=_[_0xb5df('0x2e')](_0x587a55,_0xb5df('0x2b'));_0x5a0d2d['query']=_[_0xb5df('0x34')](_0x1beb92[_0xb5df('0x35')]);_0x5a0d2d[_0xb5df('0x36')]=_[_0xb5df('0x37')](_0x5a0d2d[_0xb5df('0x33')],_0x5a0d2d['query']);_0x1cb436[_0xb5df('0x38')]=_[_0xb5df('0x37')](_0x5a0d2d[_0xb5df('0x33')],qs[_0xb5df('0x39')](_0x1beb92[_0xb5df('0x35')]['fields']));_0x1cb436[_0xb5df('0x38')]=_0x1cb436[_0xb5df('0x38')][_0xb5df('0x3a')]?_0x1cb436[_0xb5df('0x38')]:_0x5a0d2d[_0xb5df('0x33')];if(!_0x1beb92[_0xb5df('0x35')][_0xb5df('0x3b')]('nolimit')){_0x1cb436[_0xb5df('0x1f')]=qs['limit'](_0x1beb92[_0xb5df('0x35')]['limit']);_0x1cb436['offset']=qs[_0xb5df('0x1e')](_0x1beb92[_0xb5df('0x35')][_0xb5df('0x1e')]);}_0x1cb436['order']=qs[_0xb5df('0x3c')](_0x1beb92['query'][_0xb5df('0x3c')]);_0x1cb436[_0xb5df('0x3d')]=qs[_0xb5df('0x36')](_[_0xb5df('0x3e')](_0x1beb92['query'],_0x5a0d2d[_0xb5df('0x36')]),_0x587a55);if(_0x1beb92[_0xb5df('0x35')][_0xb5df('0x3f')]){_0x1cb436['where']=_[_0xb5df('0x40')](_0x1cb436[_0xb5df('0x3d')],{'$or':_[_0xb5df('0x2e')](_0x587a55,function(_0x5ce2da){if(_0x5ce2da[_0xb5df('0x31')]!==_0xb5df('0x41')){var _0x420745={};_0x420745[_0x5ce2da[_0xb5df('0x2b')]]={'$like':'%'+_0x1beb92[_0xb5df('0x35')][_0xb5df('0x3f')]+'%'};return _0x420745;}})});}_0x1cb436=_[_0xb5df('0x40')]({},_0x1cb436,_0x1beb92[_0xb5df('0x42')]);var _0x102f2b={'where':_0x1cb436[_0xb5df('0x3d')]};return db[_0xb5df('0x43')]['count'](_0x102f2b)[_0xb5df('0x28')](function(_0x384e7f){_0x8d91a3['count']=_0x384e7f;if(_0x1beb92[_0xb5df('0x35')][_0xb5df('0x44')]){_0x1cb436[_0xb5df('0x45')]=[{'all':!![]}];}return db[_0xb5df('0x43')][_0xb5df('0x46')](_0x1cb436);})['then'](function(_0x3ca5e8){_0x8d91a3['rows']=_0x3ca5e8;return _0x8d91a3;})['then'](respondWithFilteredResult(_0x491817,_0x1cb436))[_0xb5df('0x47')](handleError(_0x491817,null));};exports[_0xb5df('0x48')]=function(_0x159710,_0x583b58){var _0x250c9f={'raw':![],'where':{'id':_0x159710['params']['id']}},_0x5698e1={};_0x5698e1[_0xb5df('0x33')]=_['keys'](db[_0xb5df('0x43')][_0xb5df('0x2f')]);_0x5698e1[_0xb5df('0x35')]=_['keys'](_0x159710['query']);_0x5698e1['filters']=_['intersection'](_0x5698e1[_0xb5df('0x33')],_0x5698e1['query']);_0x250c9f[_0xb5df('0x38')]=_['intersection'](_0x5698e1[_0xb5df('0x33')],qs[_0xb5df('0x39')](_0x159710[_0xb5df('0x35')][_0xb5df('0x39')]));_0x250c9f[_0xb5df('0x38')]=_0x250c9f['attributes']['length']?_0x250c9f[_0xb5df('0x38')]:_0x5698e1[_0xb5df('0x33')];if(_0x159710[_0xb5df('0x35')][_0xb5df('0x44')]){_0x250c9f['include']=[{'all':!![]}];}_0x250c9f=_[_0xb5df('0x40')]({},_0x250c9f,_0x159710[_0xb5df('0x42')]);return db['SalesforceAccount']['find'](_0x250c9f)[_0xb5df('0x28')](handleEntityNotFound(_0x583b58,null))[_0xb5df('0x28')](respondWithResult(_0x583b58,null))['catch'](handleError(_0x583b58,null));};exports[_0xb5df('0x49')]=function(_0x460fb0,_0x52f85e){return db[_0xb5df('0x43')][_0xb5df('0x49')](_0x460fb0[_0xb5df('0x4a')],{})[_0xb5df('0x28')](respondWithResult(_0x52f85e,0xc9))[_0xb5df('0x47')](handleError(_0x52f85e,null));};exports[_0xb5df('0x27')]=function(_0x466c14,_0x51e083){if(_0x466c14[_0xb5df('0x4a')]['id']){delete _0x466c14[_0xb5df('0x4a')]['id'];}return db[_0xb5df('0x43')]['find']({'where':{'id':_0x466c14[_0xb5df('0x4b')]['id']}})[_0xb5df('0x28')](handleEntityNotFound(_0x51e083,null))['then'](saveUpdates(_0x466c14[_0xb5df('0x4a')],null))[_0xb5df('0x28')](respondWithResult(_0x51e083,null))[_0xb5df('0x47')](handleError(_0x51e083,null));};exports[_0xb5df('0x29')]=function(_0x1e2487,_0x44949d){return db[_0xb5df('0x43')][_0xb5df('0x4c')]({'where':{'id':_0x1e2487[_0xb5df('0x4b')]['id']}})[_0xb5df('0x28')](handleEntityNotFound(_0x44949d,null))['then'](removeEntity(_0x44949d,null))['catch'](handleError(_0x44949d,null));};exports[_0xb5df('0x4d')]=function(_0x4cd2f8,_0x442e0,_0x485b33){var _0x48a33c={};var _0x38baf7={};var _0xbff59d;var _0x57415e;return db[_0xb5df('0x43')][_0xb5df('0x4e')]({'where':{'id':_0x4cd2f8['params']['id']}})[_0xb5df('0x28')](handleEntityNotFound(_0x442e0,null))[_0xb5df('0x28')](function(_0xc6fabb){if(_0xc6fabb){_0xbff59d=_0xc6fabb;_0x38baf7[_0xb5df('0x33')]=_[_0xb5df('0x34')](db[_0xb5df('0x4f')][_0xb5df('0x2f')]);_0x38baf7[_0xb5df('0x35')]=_[_0xb5df('0x34')](_0x4cd2f8['query']);_0x38baf7[_0xb5df('0x36')]=_['intersection'](_0x38baf7[_0xb5df('0x33')],_0x38baf7['query']);_0x48a33c[_0xb5df('0x38')]=_[_0xb5df('0x37')](_0x38baf7[_0xb5df('0x33')],qs[_0xb5df('0x39')](_0x4cd2f8[_0xb5df('0x35')]['fields']));_0x48a33c[_0xb5df('0x38')]=_0x48a33c[_0xb5df('0x38')][_0xb5df('0x3a')]?_0x48a33c[_0xb5df('0x38')]:_0x38baf7[_0xb5df('0x33')];_0x48a33c[_0xb5df('0x50')]=qs['sort'](_0x4cd2f8['query'][_0xb5df('0x3c')]);_0x48a33c[_0xb5df('0x3d')]=qs[_0xb5df('0x36')](_['pick'](_0x4cd2f8['query'],_0x38baf7['filters']));if(_0x4cd2f8[_0xb5df('0x35')]['filter']){_0x48a33c[_0xb5df('0x3d')]=_['merge'](_0x48a33c[_0xb5df('0x3d')],{'$or':_[_0xb5df('0x2e')](_0x48a33c['attributes'],function(_0x466478){var _0x2e60b2={};_0x2e60b2[_0x466478]={'$like':'%'+_0x4cd2f8[_0xb5df('0x35')][_0xb5df('0x3f')]+'%'};return _0x2e60b2;})});}_0x48a33c=_[_0xb5df('0x40')]({},_0x48a33c,_0x4cd2f8['options']);return _0xbff59d[_0xb5df('0x4d')](_0x48a33c);}})[_0xb5df('0x28')](function(_0x19f0f8){if(_0x19f0f8){_0x57415e=_0x19f0f8[_0xb5df('0x3a')];if(!_0x4cd2f8[_0xb5df('0x35')][_0xb5df('0x3b')]('nolimit')){_0x48a33c[_0xb5df('0x1f')]=qs[_0xb5df('0x1f')](_0x4cd2f8[_0xb5df('0x35')][_0xb5df('0x1f')]);_0x48a33c[_0xb5df('0x1e')]=qs[_0xb5df('0x1e')](_0x4cd2f8[_0xb5df('0x35')][_0xb5df('0x1e')]);}return _0xbff59d[_0xb5df('0x4d')](_0x48a33c);}})[_0xb5df('0x28')](function(_0x2e60cf){if(_0x2e60cf){return _0x2e60cf?{'count':_0x57415e,'rows':_0x2e60cf}:null;}})[_0xb5df('0x28')](respondWithResult(_0x442e0,null))[_0xb5df('0x47')](handleError(_0x442e0,null));};exports[_0xb5df('0x51')]=function(_0x2838bf,_0x4a0595,_0x1e40b4){if(_0x2838bf['body']['id']){delete _0x2838bf['body']['id'];}return db['SalesforceAccount'][_0xb5df('0x4e')]({'where':{'id':_0x2838bf[_0xb5df('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4a0595,null))[_0xb5df('0x28')](function(_0x3bb372){if(_0x3bb372){_0x2838bf[_0xb5df('0x4a')]['AccountId']=_0x3bb372['id'];_0x2838bf[_0xb5df('0x4a')][_0xb5df('0x52')]=integrations['getSubjects'](_0x2838bf['body'][_0xb5df('0x53')],_0x2838bf[_0xb5df('0x4a')][_0xb5df('0x31')]);_0x2838bf[_0xb5df('0x4a')][_0xb5df('0x54')]=integrations[_0xb5df('0x55')](_0x2838bf['body'][_0xb5df('0x53')],_0x2838bf[_0xb5df('0x4a')][_0xb5df('0x31')]);return db[_0xb5df('0x4f')][_0xb5df('0x49')](_0x2838bf['body'],{'include':[{'model':db[_0xb5df('0x56')],'as':_0xb5df('0x52')},{'model':db[_0xb5df('0x56')],'as':'Descriptions'}]});}return null;})[_0xb5df('0x28')](respondWithResult(_0x4a0595,null))[_0xb5df('0x47')](handleError(_0x4a0595,null));};exports[_0xb5df('0x57')]=function(_0x2f9156,_0x359b61,_0x3063e4){var _0x39b6c5;var _0xb4827e='';var _0x308282=_0xb5df('0x58');return db[_0xb5df('0x43')][_0xb5df('0x4e')]({'where':{'id':_0x2f9156['params']['id']},'attributes':['id',_0xb5df('0x59'),_0xb5df('0x5a'),_0xb5df('0x5b'),_0xb5df('0x5c'),_0xb5df('0x5d'),_0xb5df('0x5e')]})[_0xb5df('0x28')](handleEntityNotFound(_0x359b61,null))['then'](function(_0x50645f){if(_0x50645f){_0xb4827e=_0x50645f[_0xb5df('0x59')];var _0x30bc80=_0xb4827e[_0xb5df('0x5f')](-0x1);if(_0x30bc80==='/'){_0xb4827e=_0xb4827e[_0xb5df('0x60')](0x0,_0xb4827e[_0xb5df('0x61')](_0x30bc80));}_0x39b6c5=new jsforce[(_0xb5df('0x62'))]({'oauth2':{'loginUrl':_0xb4827e,'clientId':_0x50645f['clientId'],'clientSecret':_0x50645f['clientSecret']}});return _0x39b6c5['login'](_0x50645f[_0xb5df('0x5c')],_0x50645f['password']['concat'](_0x50645f[_0xb5df('0x5e')]));}})[_0xb5df('0x28')](function(_0xa043ea){if(_0xa043ea){if(!_['isNil'](_0x2f9156[_0xb5df('0x35')][_0xb5df('0x63')])){_0x308282=_0x2f9156[_0xb5df('0x35')][_0xb5df('0x63')];}return _0x39b6c5[_0xb5df('0x64')](_0x308282)[_0xb5df('0x65')]();}})[_0xb5df('0x28')](function(_0xffb004){var _0x3d4f09=[_0xb5df('0x66'),_0xb5df('0x67'),_0xb5df('0x68'),_0xb5df('0x69'),'Subject',_0xb5df('0x6a')];var _0x31041a=['string',_0xb5df('0x6b'),_0xb5df('0x6c'),_0xb5df('0x6d'),'email',_0xb5df('0x6e'),'phone'];if(_0xffb004){_[_0xb5df('0x6f')](_0xffb004[_0xb5df('0x39')],function(_0x835584){return _0x3d4f09['includes'](_0x835584[_0xb5df('0x2b')])||!_0x31041a[_0xb5df('0x70')](_0x835584[_0xb5df('0x31')]);});return{'count':_0xffb004[_0xb5df('0x39')]['length'],'rows':_[_0xb5df('0x2e')](_0xffb004['fields'],function(_0x441e40){return{'id':_0x441e40[_0xb5df('0x2b')],'name':_0x441e40[_0xb5df('0x71')],'custom':_0x441e40[_0xb5df('0x72')],'options':_0x441e40[_0xb5df('0x73')][_0xb5df('0x3a')]>0x0?_[_0xb5df('0x2e')](_0x441e40[_0xb5df('0x73')],function(_0x2636a8){return{'name':_0x2636a8[_0xb5df('0x71')],'value':_0x2636a8[_0xb5df('0x74')]};}):_0x441e40[_0xb5df('0x31')]=='boolean'?[{'name':'True','value':_0xb5df('0x75')},{'name':_0xb5df('0x76'),'value':_0xb5df('0x77')}]:[]};})};}})[_0xb5df('0x28')](respondWithResult(_0x359b61,null))['catch'](function(_0x3c432f){var _0x5adb1d=_0x2f9156[_0xb5df('0x35')]['test']?0x1f4:_0x3c432f['statusCode']||0x1f4;logger[_0xb5df('0x78')]('getFields,\x20%s,\x20%s,\x20%s',_0xb5df('0x57'),_0x5adb1d,JSON[_0xb5df('0x79')](_0x3c432f));delete _0x3c432f[_0xb5df('0x2b')];if(_0x5adb1d===0x191){_0x5adb1d=0x190;}_0x359b61[_0xb5df('0x1b')](_0x5adb1d)[_0xb5df('0x2c')](_0x2f9156[_0xb5df('0x35')][_0xb5df('0x7a')]?{'message':_0xb5df('0x7b'),'statusCode':_0x3c432f[_0xb5df('0x7c')]}:_0x3c432f);});};
\ No newline at end of file
+var _0xb33c=['show','rawAttributes','fields','find','create','body','params','getConfigurations','findOne','SalesforceConfiguration','Subjects','Descriptions','getDescriptions','channel','SalesforceField','getFields','remoteUri','clientId','clientSecret','username','password','securityToken','slice','lastIndexOf','login','concat','isNil','ticketType','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','string','int','picklist','boolean','textarea','phone','includes','custom','picklistValues','label','value','True','False','false','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceAccount','fieldName','type','key','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','catch'];(function(_0x4c4037,_0x15054b){var _0x357862=function(_0x480015){while(--_0x480015){_0x4c4037['push'](_0x4c4037['shift']());}};_0x357862(++_0x15054b);}(_0xb33c,0x12c));var _0xcb33=function(_0x318623,_0x3417ed){_0x318623=_0x318623-0x0;var _0x3467c6=_0xb33c[_0x318623];return _0x3467c6;};'use strict';var emlformat=require(_0xcb33('0x0'));var rimraf=require(_0xcb33('0x1'));var zipdir=require(_0xcb33('0x2'));var jsonpatch=require(_0xcb33('0x3'));var rp=require(_0xcb33('0x4'));var moment=require(_0xcb33('0x5'));var BPromise=require(_0xcb33('0x6'));var Mustache=require('mustache');var util=require(_0xcb33('0x7'));var path=require(_0xcb33('0x8'));var sox=require(_0xcb33('0x9'));var csv=require(_0xcb33('0xa'));var ejs=require(_0xcb33('0xb'));var fs=require('fs');var fs_extra=require(_0xcb33('0xc'));var _=require(_0xcb33('0xd'));var squel=require(_0xcb33('0xe'));var crypto=require('crypto');var jsforce=require(_0xcb33('0xf'));var deskjs=require(_0xcb33('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcb33('0x11'));var Redis=require('ioredis');var authService=require(_0xcb33('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcb33('0x13'));var logger=require(_0xcb33('0x14'))(_0xcb33('0x15'));var utils=require(_0xcb33('0x16'));var config=require(_0xcb33('0x17'));var licenseUtil=require(_0xcb33('0x18'));var db=require(_0xcb33('0x19'))['db'];var integrations=require(_0xcb33('0x1a'));function respondWithStatusCode(_0x40f838,_0x10732a){_0x10732a=_0x10732a||0xcc;return function(_0x287bd0){if(_0x287bd0){return _0x40f838[_0xcb33('0x1b')](_0x10732a);}return _0x40f838[_0xcb33('0x1c')](_0x10732a)['end']();};}function respondWithResult(_0x1b6d2d,_0x2f3b67){_0x2f3b67=_0x2f3b67||0xc8;return function(_0x318e46){if(_0x318e46){return _0x1b6d2d[_0xcb33('0x1c')](_0x2f3b67)[_0xcb33('0x1d')](_0x318e46);}};}function respondWithFilteredResult(_0x47ff84,_0x52fee1){return function(_0x11a96b){if(_0x11a96b){var _0x4e8a66=typeof _0x52fee1[_0xcb33('0x1e')]===_0xcb33('0x1f')&&typeof _0x52fee1['limit']==='undefined';var _0x22e744=_0x11a96b[_0xcb33('0x20')];var _0x23c12f=_0x4e8a66?0x0:_0x52fee1['offset'];var _0x408374=_0x4e8a66?_0x11a96b['count']:_0x52fee1[_0xcb33('0x1e')]+_0x52fee1['limit'];var _0x191fa1;if(_0x408374>=_0x22e744){_0x408374=_0x22e744;_0x191fa1=0xc8;}else{_0x191fa1=0xce;}_0x47ff84[_0xcb33('0x1c')](_0x191fa1);return _0x47ff84[_0xcb33('0x21')](_0xcb33('0x22'),_0x23c12f+'-'+_0x408374+'/'+_0x22e744)[_0xcb33('0x1d')](_0x11a96b);}return null;};}function patchUpdates(_0x49f9fa){return function(_0x28c1cc){try{jsonpatch[_0xcb33('0x23')](_0x28c1cc,_0x49f9fa,!![]);}catch(_0x1f0da1){return BPromise[_0xcb33('0x24')](_0x1f0da1);}return _0x28c1cc[_0xcb33('0x25')]();};}function saveUpdates(_0x20c34f,_0x72eb06){return function(_0x384b8b){if(_0x384b8b){return _0x384b8b[_0xcb33('0x26')](_0x20c34f)[_0xcb33('0x27')](function(_0x39aae1){return _0x39aae1;});}return null;};}function removeEntity(_0x52645d,_0x5cfb8a){return function(_0x44087a){if(_0x44087a){return _0x44087a[_0xcb33('0x28')]()[_0xcb33('0x27')](function(){_0x52645d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa4182,_0x26856c){return function(_0x426597){if(!_0x426597){_0xa4182[_0xcb33('0x1b')](0x194);}return _0x426597;};}function handleError(_0x96ee79,_0x536b4c){_0x536b4c=_0x536b4c||0x1f4;return function(_0x59422b){logger[_0xcb33('0x29')](_0x59422b[_0xcb33('0x2a')]);if(_0x59422b[_0xcb33('0x2b')]){delete _0x59422b[_0xcb33('0x2b')];}_0x96ee79[_0xcb33('0x1c')](_0x536b4c)[_0xcb33('0x2c')](_0x59422b);};}exports[_0xcb33('0x2d')]=function(_0xab203d,_0x5dd257){var _0xf154b8={},_0x1ee591={},_0x1653cb={'count':0x0,'rows':[]};var _0x70eb04=_[_0xcb33('0x2e')](db[_0xcb33('0x2f')]['rawAttributes'],function(_0x48a1c7){return{'name':_0x48a1c7[_0xcb33('0x30')],'type':_0x48a1c7[_0xcb33('0x31')][_0xcb33('0x32')]};});_0x1ee591['model']=_['map'](_0x70eb04,'name');_0x1ee591[_0xcb33('0x33')]=_[_0xcb33('0x34')](_0xab203d[_0xcb33('0x33')]);_0x1ee591['filters']=_['intersection'](_0x1ee591['model'],_0x1ee591[_0xcb33('0x33')]);_0xf154b8['attributes']=_[_0xcb33('0x35')](_0x1ee591[_0xcb33('0x36')],qs['fields'](_0xab203d[_0xcb33('0x33')]['fields']));_0xf154b8[_0xcb33('0x37')]=_0xf154b8['attributes'][_0xcb33('0x38')]?_0xf154b8[_0xcb33('0x37')]:_0x1ee591[_0xcb33('0x36')];if(!_0xab203d['query'][_0xcb33('0x39')](_0xcb33('0x3a'))){_0xf154b8[_0xcb33('0x3b')]=qs['limit'](_0xab203d[_0xcb33('0x33')][_0xcb33('0x3b')]);_0xf154b8[_0xcb33('0x1e')]=qs[_0xcb33('0x1e')](_0xab203d[_0xcb33('0x33')][_0xcb33('0x1e')]);}_0xf154b8[_0xcb33('0x3c')]=qs[_0xcb33('0x3d')](_0xab203d[_0xcb33('0x33')][_0xcb33('0x3d')]);_0xf154b8[_0xcb33('0x3e')]=qs[_0xcb33('0x3f')](_[_0xcb33('0x40')](_0xab203d['query'],_0x1ee591['filters']),_0x70eb04);if(_0xab203d['query']['filter']){_0xf154b8['where']=_[_0xcb33('0x41')](_0xf154b8[_0xcb33('0x3e')],{'$or':_[_0xcb33('0x2e')](_0x70eb04,function(_0x36426b){if(_0x36426b[_0xcb33('0x31')]!==_0xcb33('0x42')){var _0x3d3901={};_0x3d3901[_0x36426b[_0xcb33('0x2b')]]={'$like':'%'+_0xab203d[_0xcb33('0x33')][_0xcb33('0x43')]+'%'};return _0x3d3901;}})});}_0xf154b8=_[_0xcb33('0x41')]({},_0xf154b8,_0xab203d[_0xcb33('0x44')]);var _0x2c3d6f={'where':_0xf154b8[_0xcb33('0x3e')]};return db[_0xcb33('0x2f')][_0xcb33('0x20')](_0x2c3d6f)[_0xcb33('0x27')](function(_0x46c883){_0x1653cb[_0xcb33('0x20')]=_0x46c883;if(_0xab203d[_0xcb33('0x33')][_0xcb33('0x45')]){_0xf154b8[_0xcb33('0x46')]=[{'all':!![]}];}return db[_0xcb33('0x2f')]['findAll'](_0xf154b8);})[_0xcb33('0x27')](function(_0x1ea3fa){_0x1653cb['rows']=_0x1ea3fa;return _0x1653cb;})[_0xcb33('0x27')](respondWithFilteredResult(_0x5dd257,_0xf154b8))[_0xcb33('0x47')](handleError(_0x5dd257,null));};exports[_0xcb33('0x48')]=function(_0x57c94f,_0x113ae9){var _0x3b0ff5={'raw':![],'where':{'id':_0x57c94f['params']['id']}},_0x34304e={};_0x34304e['model']=_['keys'](db[_0xcb33('0x2f')][_0xcb33('0x49')]);_0x34304e[_0xcb33('0x33')]=_['keys'](_0x57c94f['query']);_0x34304e[_0xcb33('0x3f')]=_[_0xcb33('0x35')](_0x34304e[_0xcb33('0x36')],_0x34304e[_0xcb33('0x33')]);_0x3b0ff5[_0xcb33('0x37')]=_['intersection'](_0x34304e['model'],qs[_0xcb33('0x4a')](_0x57c94f[_0xcb33('0x33')][_0xcb33('0x4a')]));_0x3b0ff5[_0xcb33('0x37')]=_0x3b0ff5[_0xcb33('0x37')][_0xcb33('0x38')]?_0x3b0ff5[_0xcb33('0x37')]:_0x34304e['model'];if(_0x57c94f['query']['includeAll']){_0x3b0ff5['include']=[{'all':!![]}];}_0x3b0ff5=_[_0xcb33('0x41')]({},_0x3b0ff5,_0x57c94f[_0xcb33('0x44')]);return db[_0xcb33('0x2f')][_0xcb33('0x4b')](_0x3b0ff5)[_0xcb33('0x27')](handleEntityNotFound(_0x113ae9,null))[_0xcb33('0x27')](respondWithResult(_0x113ae9,null))[_0xcb33('0x47')](handleError(_0x113ae9,null));};exports[_0xcb33('0x4c')]=function(_0x2053b7,_0x5cc32d){return db[_0xcb33('0x2f')][_0xcb33('0x4c')](_0x2053b7[_0xcb33('0x4d')],{})[_0xcb33('0x27')](respondWithResult(_0x5cc32d,0xc9))[_0xcb33('0x47')](handleError(_0x5cc32d,null));};exports[_0xcb33('0x26')]=function(_0x4fb78e,_0x52f2a5){if(_0x4fb78e['body']['id']){delete _0x4fb78e['body']['id'];}return db['SalesforceAccount'][_0xcb33('0x4b')]({'where':{'id':_0x4fb78e['params']['id']}})[_0xcb33('0x27')](handleEntityNotFound(_0x52f2a5,null))[_0xcb33('0x27')](saveUpdates(_0x4fb78e['body'],null))[_0xcb33('0x27')](respondWithResult(_0x52f2a5,null))['catch'](handleError(_0x52f2a5,null));};exports[_0xcb33('0x28')]=function(_0x37eac8,_0x254771){return db[_0xcb33('0x2f')][_0xcb33('0x4b')]({'where':{'id':_0x37eac8[_0xcb33('0x4e')]['id']}})['then'](handleEntityNotFound(_0x254771,null))[_0xcb33('0x27')](removeEntity(_0x254771,null))[_0xcb33('0x47')](handleError(_0x254771,null));};exports[_0xcb33('0x4f')]=function(_0x11e99d,_0x346e6e,_0x1d8d22){var _0x2de1b4={};var _0x5d759c={};var _0x360f46;var _0x27cf8a;return db[_0xcb33('0x2f')][_0xcb33('0x50')]({'where':{'id':_0x11e99d[_0xcb33('0x4e')]['id']}})[_0xcb33('0x27')](handleEntityNotFound(_0x346e6e,null))[_0xcb33('0x27')](function(_0xc37798){if(_0xc37798){_0x360f46=_0xc37798;_0x5d759c['model']=_[_0xcb33('0x34')](db[_0xcb33('0x51')][_0xcb33('0x49')]);_0x5d759c[_0xcb33('0x33')]=_[_0xcb33('0x34')](_0x11e99d[_0xcb33('0x33')]);_0x5d759c[_0xcb33('0x3f')]=_['intersection'](_0x5d759c[_0xcb33('0x36')],_0x5d759c[_0xcb33('0x33')]);_0x2de1b4[_0xcb33('0x37')]=_[_0xcb33('0x35')](_0x5d759c[_0xcb33('0x36')],qs[_0xcb33('0x4a')](_0x11e99d[_0xcb33('0x33')]['fields']));_0x2de1b4[_0xcb33('0x37')]=_0x2de1b4[_0xcb33('0x37')][_0xcb33('0x38')]?_0x2de1b4['attributes']:_0x5d759c[_0xcb33('0x36')];_0x2de1b4['order']=qs['sort'](_0x11e99d[_0xcb33('0x33')][_0xcb33('0x3d')]);_0x2de1b4[_0xcb33('0x3e')]=qs['filters'](_['pick'](_0x11e99d[_0xcb33('0x33')],_0x5d759c['filters']));if(_0x11e99d[_0xcb33('0x33')][_0xcb33('0x43')]){_0x2de1b4[_0xcb33('0x3e')]=_[_0xcb33('0x41')](_0x2de1b4[_0xcb33('0x3e')],{'$or':_[_0xcb33('0x2e')](_0x2de1b4[_0xcb33('0x37')],function(_0x10786b){var _0x263047={};_0x263047[_0x10786b]={'$like':'%'+_0x11e99d[_0xcb33('0x33')][_0xcb33('0x43')]+'%'};return _0x263047;})});}_0x2de1b4=_[_0xcb33('0x41')]({},_0x2de1b4,_0x11e99d[_0xcb33('0x44')]);return _0x360f46[_0xcb33('0x4f')](_0x2de1b4);}})[_0xcb33('0x27')](function(_0x1f8bdd){if(_0x1f8bdd){_0x27cf8a=_0x1f8bdd[_0xcb33('0x38')];if(!_0x11e99d[_0xcb33('0x33')][_0xcb33('0x39')](_0xcb33('0x3a'))){_0x2de1b4['limit']=qs[_0xcb33('0x3b')](_0x11e99d[_0xcb33('0x33')]['limit']);_0x2de1b4['offset']=qs['offset'](_0x11e99d[_0xcb33('0x33')][_0xcb33('0x1e')]);}return _0x360f46[_0xcb33('0x4f')](_0x2de1b4);}})[_0xcb33('0x27')](function(_0x4d59e8){if(_0x4d59e8){return _0x4d59e8?{'count':_0x27cf8a,'rows':_0x4d59e8}:null;}})['then'](respondWithResult(_0x346e6e,null))[_0xcb33('0x47')](handleError(_0x346e6e,null));};exports['addConfiguration']=function(_0xef5121,_0x871224,_0x5a4236){if(_0xef5121[_0xcb33('0x4d')]['id']){delete _0xef5121[_0xcb33('0x4d')]['id'];}return db[_0xcb33('0x2f')]['findOne']({'where':{'id':_0xef5121[_0xcb33('0x4e')]['id']}})['then'](handleEntityNotFound(_0x871224,null))[_0xcb33('0x27')](function(_0x2e00db){if(_0x2e00db){_0xef5121['body']['AccountId']=_0x2e00db['id'];_0xef5121[_0xcb33('0x4d')][_0xcb33('0x52')]=integrations['getSubjects'](_0xef5121[_0xcb33('0x4d')]['channel'],_0xef5121[_0xcb33('0x4d')]['type']);_0xef5121['body'][_0xcb33('0x53')]=integrations[_0xcb33('0x54')](_0xef5121[_0xcb33('0x4d')][_0xcb33('0x55')],_0xef5121['body']['type']);return db[_0xcb33('0x51')]['create'](_0xef5121[_0xcb33('0x4d')],{'include':[{'model':db[_0xcb33('0x56')],'as':_0xcb33('0x52')},{'model':db[_0xcb33('0x56')],'as':_0xcb33('0x53')}]});}return null;})[_0xcb33('0x27')](respondWithResult(_0x871224,null))[_0xcb33('0x47')](handleError(_0x871224,null));};exports[_0xcb33('0x57')]=function(_0x416fee,_0x5fc5a2,_0x49a80b){var _0xf03077;var _0x4a1a8d='';var _0xf996d5='Task';return db['SalesforceAccount'][_0xcb33('0x50')]({'where':{'id':_0x416fee[_0xcb33('0x4e')]['id']},'attributes':['id',_0xcb33('0x58'),_0xcb33('0x59'),_0xcb33('0x5a'),_0xcb33('0x5b'),_0xcb33('0x5c'),_0xcb33('0x5d')]})['then'](handleEntityNotFound(_0x5fc5a2,null))['then'](function(_0x4b6608){if(_0x4b6608){_0x4a1a8d=_0x4b6608['remoteUri'];var _0x139427=_0x4a1a8d[_0xcb33('0x5e')](-0x1);if(_0x139427==='/'){_0x4a1a8d=_0x4a1a8d['substring'](0x0,_0x4a1a8d[_0xcb33('0x5f')](_0x139427));}_0xf03077=new jsforce['Connection']({'oauth2':{'loginUrl':_0x4a1a8d,'clientId':_0x4b6608['clientId'],'clientSecret':_0x4b6608[_0xcb33('0x5a')]}});return _0xf03077[_0xcb33('0x60')](_0x4b6608['username'],_0x4b6608[_0xcb33('0x5c')][_0xcb33('0x61')](_0x4b6608[_0xcb33('0x5d')]));}})[_0xcb33('0x27')](function(_0x1d87b9){if(_0x1d87b9){if(!_[_0xcb33('0x62')](_0x416fee['query'][_0xcb33('0x63')])){_0xf996d5=_0x416fee[_0xcb33('0x33')][_0xcb33('0x63')];}return _0xf03077['sobject'](_0xf996d5)[_0xcb33('0x64')]();}})[_0xcb33('0x27')](function(_0x1d71db){var _0x5b532a=[_0xcb33('0x65'),_0xcb33('0x66'),_0xcb33('0x67'),_0xcb33('0x68'),_0xcb33('0x69'),'Description'];var _0x1fd1a5=[_0xcb33('0x6a'),_0xcb33('0x6b'),_0xcb33('0x6c'),_0xcb33('0x6d'),'email',_0xcb33('0x6e'),_0xcb33('0x6f')];if(_0x1d71db){_['remove'](_0x1d71db['fields'],function(_0x6bb0cb){return _0x5b532a[_0xcb33('0x70')](_0x6bb0cb[_0xcb33('0x2b')])||!_0x1fd1a5['includes'](_0x6bb0cb[_0xcb33('0x31')]);});return{'count':_0x1d71db[_0xcb33('0x4a')][_0xcb33('0x38')],'rows':_[_0xcb33('0x2e')](_0x1d71db['fields'],function(_0x18a857){return{'id':_0x18a857[_0xcb33('0x2b')],'name':_0x18a857['label'],'custom':_0x18a857[_0xcb33('0x71')],'options':_0x18a857['picklistValues']['length']>0x0?_[_0xcb33('0x2e')](_0x18a857[_0xcb33('0x72')],function(_0x191c55){return{'name':_0x191c55[_0xcb33('0x73')],'value':_0x191c55[_0xcb33('0x74')]};}):_0x18a857[_0xcb33('0x31')]==_0xcb33('0x6d')?[{'name':_0xcb33('0x75'),'value':'true'},{'name':_0xcb33('0x76'),'value':_0xcb33('0x77')}]:[]};})};}})[_0xcb33('0x27')](respondWithResult(_0x5fc5a2,null))[_0xcb33('0x47')](function(_0x443086){var _0x2040e9=_0x416fee[_0xcb33('0x33')][_0xcb33('0x78')]?0x1f4:_0x443086[_0xcb33('0x79')]||0x1f4;logger[_0xcb33('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0xcb33('0x57'),_0x2040e9,JSON[_0xcb33('0x7a')](_0x443086));delete _0x443086[_0xcb33('0x2b')];if(_0x2040e9===0x191){_0x2040e9=0x190;}_0x5fc5a2[_0xcb33('0x1c')](_0x2040e9)[_0xcb33('0x2c')](_0x416fee[_0xcb33('0x33')][_0xcb33('0x78')]?{'message':_0xcb33('0x7b'),'statusCode':_0x443086[_0xcb33('0x79')]}:_0x443086);});};
\ No newline at end of file
index 786dbd0..9b38755 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7119=['../../components/integrations/configuration','exports','SalesforceAccount','int_salesforce_accounts','util','api','bluebird','request-promise','path','rimraf','./intSalesforceAccount.attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7119,0x1c7));var _0x9711=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x7119[_0x5d6456];return _0x4d66c1;};'use strict';var _=require('lodash');var util=require(_0x9711('0x0'));var logger=require('../../config/logger')(_0x9711('0x1'));var moment=require('moment');var BPromise=require(_0x9711('0x2'));var rp=require(_0x9711('0x3'));var fs=require('fs');var path=require(_0x9711('0x4'));var rimraf=require(_0x9711('0x5'));var config=require('../../config/environment');var attributes=require(_0x9711('0x6'));var integrations=require(_0x9711('0x7'));module[_0x9711('0x8')]=function(_0x101827,_0x191701){return _0x101827['define'](_0x9711('0x9'),attributes,{'tableName':_0x9711('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1fa7=['request-promise','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','util','../../config/logger','bluebird'];(function(_0x5139bb,_0x3fb5f4){var _0x306e2a=function(_0x3b6036){while(--_0x3b6036){_0x5139bb['push'](_0x5139bb['shift']());}};_0x306e2a(++_0x3fb5f4);}(_0x1fa7,0x151));var _0x71fa=function(_0x5198b6,_0x2c4105){_0x5198b6=_0x5198b6-0x0;var _0x516ea4=_0x1fa7[_0x5198b6];return _0x516ea4;};'use strict';var _=require('lodash');var util=require(_0x71fa('0x0'));var logger=require(_0x71fa('0x1'))('api');var moment=require('moment');var BPromise=require(_0x71fa('0x2'));var rp=require(_0x71fa('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x71fa('0x4'));var config=require('../../config/environment');var attributes=require(_0x71fa('0x5'));var integrations=require(_0x71fa('0x6'));module[_0x71fa('0x7')]=function(_0x53b7a9,_0xa06ae9){return _0x53b7a9[_0x71fa('0x8')](_0x71fa('0x9'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0957579..59d2495 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc858=['find','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','where','limit','include','map','model','attributes','ShowSalesforceAccount'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xc858,0x6e));var _0x8c85=function(_0x4cfafc,_0x4c8f9e){_0x4cfafc=_0x4cfafc-0x0;var _0x45ee5a=_0xc858[_0x4cfafc];return _0x45ee5a;};'use strict';var _=require(_0x8c85('0x0'));var util=require(_0x8c85('0x1'));var moment=require(_0x8c85('0x2'));var BPromise=require('bluebird');var rs=require(_0x8c85('0x3'));var fs=require('fs');var Redis=require(_0x8c85('0x4'));var db=require(_0x8c85('0x5'))['db'];var utils=require(_0x8c85('0x6'));var logger=require(_0x8c85('0x7'))('rpc');var config=require(_0x8c85('0x8'));var jayson=require(_0x8c85('0x9'));var client=jayson[_0x8c85('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55075a,_0x2cf5f5,_0x195580){return new BPromise(function(_0x4dea73,_0x3993af){return client[_0x8c85('0xb')](_0x55075a,_0x195580)[_0x8c85('0xc')](function(_0x460595){logger[_0x8c85('0xd')](_0x8c85('0xe'),_0x2cf5f5,_0x8c85('0xf'));logger[_0x8c85('0x10')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x2cf5f5,_0x8c85('0xf'),JSON[_0x8c85('0x11')](_0x460595));if(_0x460595[_0x8c85('0x12')]){if(_0x460595[_0x8c85('0x12')][_0x8c85('0x13')]===0x1f4){logger[_0x8c85('0x12')](_0x8c85('0xe'),_0x2cf5f5,_0x460595[_0x8c85('0x12')]['message']);return _0x3993af(_0x460595[_0x8c85('0x12')][_0x8c85('0x14')]);}logger[_0x8c85('0x12')](_0x8c85('0xe'),_0x2cf5f5,_0x460595[_0x8c85('0x12')][_0x8c85('0x14')]);return _0x4dea73(_0x460595[_0x8c85('0x12')][_0x8c85('0x14')]);}else{logger[_0x8c85('0xd')](_0x8c85('0xe'),_0x2cf5f5,_0x8c85('0xf'));_0x4dea73(_0x460595[_0x8c85('0x15')][_0x8c85('0x14')]);}})[_0x8c85('0x16')](function(_0x49fa81){logger[_0x8c85('0x12')](_0x8c85('0xe'),_0x2cf5f5,_0x49fa81);_0x3993af(_0x49fa81);});});}exports[_0x8c85('0x17')]=function(_0xa862ee){var _0x3a1ca9=this;return new Promise(function(_0x33dc53,_0x5a0619){return db[_0x8c85('0x18')][_0x8c85('0x19')]({'raw':_0xa862ee['options']?_0xa862ee['options']['raw']===undefined?!![]:![]:!![],'where':_0xa862ee[_0x8c85('0x1a')]?_0xa862ee[_0x8c85('0x1a')][_0x8c85('0x1b')]||null:null,'attributes':_0xa862ee[_0x8c85('0x1a')]?_0xa862ee['options']['attributes']||null:null,'limit':_0xa862ee[_0x8c85('0x1a')]?_0xa862ee[_0x8c85('0x1a')][_0x8c85('0x1c')]||null:null,'include':_0xa862ee[_0x8c85('0x1a')]?_0xa862ee['options'][_0x8c85('0x1d')]?_[_0x8c85('0x1e')](_0xa862ee[_0x8c85('0x1a')][_0x8c85('0x1d')],function(_0x53dbbc){return{'model':db[_0x53dbbc[_0x8c85('0x1f')]],'as':_0x53dbbc['as'],'attributes':_0x53dbbc['attributes'],'include':_0x53dbbc[_0x8c85('0x1d')]?_[_0x8c85('0x1e')](_0x53dbbc['include'],function(_0x2ce327){return{'model':db[_0x2ce327[_0x8c85('0x1f')]],'as':_0x2ce327['as'],'attributes':_0x2ce327[_0x8c85('0x20')],'include':_0x2ce327[_0x8c85('0x1d')]?_[_0x8c85('0x1e')](_0x2ce327[_0x8c85('0x1d')],function(_0x2284a1){return{'model':db[_0x2284a1[_0x8c85('0x1f')]],'as':_0x2284a1['as'],'attributes':_0x2284a1[_0x8c85('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8c85('0xc')](function(_0x22488e){logger['info'](_0x8c85('0x17'),_0xa862ee);logger[_0x8c85('0x10')](_0x8c85('0x17'),_0xa862ee,JSON['stringify'](_0x22488e));_0x33dc53(_0x22488e);})[_0x8c85('0x16')](function(_0x4efcb3){logger[_0x8c85('0x12')](_0x8c85('0x17'),_0x4efcb3[_0x8c85('0x14')],_0xa862ee);_0x5a0619(_0x3a1ca9['error'](0x1f4,_0x4efcb3[_0x8c85('0x14')]));});});};exports[_0x8c85('0x21')]=function(_0x12bba7){var _0x103513=this;return new Promise(function(_0x470c35,_0x4d8bf2){return db['SalesforceAccount'][_0x8c85('0x22')]({'raw':_0x12bba7[_0x8c85('0x1a')]?_0x12bba7[_0x8c85('0x1a')][_0x8c85('0x23')]===undefined?!![]:![]:!![],'where':_0x12bba7[_0x8c85('0x1a')]?_0x12bba7['options'][_0x8c85('0x1b')]||null:null,'attributes':_0x12bba7[_0x8c85('0x1a')]?_0x12bba7[_0x8c85('0x1a')][_0x8c85('0x20')]||null:null,'include':_0x12bba7[_0x8c85('0x1a')]?_0x12bba7[_0x8c85('0x1a')][_0x8c85('0x1d')]?_[_0x8c85('0x1e')](_0x12bba7[_0x8c85('0x1a')][_0x8c85('0x1d')],function(_0x154186){return{'model':db[_0x154186[_0x8c85('0x1f')]],'as':_0x154186['as'],'attributes':_0x154186[_0x8c85('0x20')],'include':_0x154186[_0x8c85('0x1d')]?_[_0x8c85('0x1e')](_0x154186[_0x8c85('0x1d')],function(_0x3a9db1){return{'model':db[_0x3a9db1[_0x8c85('0x1f')]],'as':_0x3a9db1['as'],'attributes':_0x3a9db1[_0x8c85('0x20')],'include':_0x3a9db1[_0x8c85('0x1d')]?_[_0x8c85('0x1e')](_0x3a9db1['include'],function(_0xc5a3ee){return{'model':db[_0xc5a3ee[_0x8c85('0x1f')]],'as':_0xc5a3ee['as'],'attributes':_0xc5a3ee[_0x8c85('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8c85('0xc')](function(_0x40d339){logger[_0x8c85('0xd')]('ShowSalesforceAccount',_0x12bba7);logger[_0x8c85('0x10')](_0x8c85('0x21'),_0x12bba7,JSON['stringify'](_0x40d339));_0x470c35(_0x40d339);})['catch'](function(_0x24a8fc){logger[_0x8c85('0x12')](_0x8c85('0x21'),_0x24a8fc[_0x8c85('0x14')],_0x12bba7);_0x4d8bf2(_0x103513['error'](0x1f4,_0x24a8fc['message']));});});};
\ No newline at end of file
+var _0xefe2=['options','raw','where','attributes','limit','map','include','model','then','debug','ShowSalesforceAccount','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request\x20sent','stringify','error','code','message','info','SalesforceAccount,\x20%s,\x20%s','catch','GetSalesforceAccount','SalesforceAccount','findAll'];(function(_0x5728e5,_0x44be81){var _0x357a0b=function(_0x3fb9f3){while(--_0x3fb9f3){_0x5728e5['push'](_0x5728e5['shift']());}};_0x357a0b(++_0x44be81);}(_0xefe2,0x160));var _0x2efe=function(_0xf92141,_0x118f68){_0xf92141=_0xf92141-0x0;var _0x283a2f=_0xefe2[_0xf92141];return _0x283a2f;};'use strict';var _=require(_0x2efe('0x0'));var util=require(_0x2efe('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2efe('0x2'));var fs=require('fs');var Redis=require(_0x2efe('0x3'));var db=require(_0x2efe('0x4'))['db'];var utils=require(_0x2efe('0x5'));var logger=require(_0x2efe('0x6'))(_0x2efe('0x7'));var config=require(_0x2efe('0x8'));var jayson=require(_0x2efe('0x9'));var client=jayson['client'][_0x2efe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14825c,_0x1fe1ce,_0x318561){return new BPromise(function(_0x103bcc,_0x2c6793){return client['request'](_0x14825c,_0x318561)['then'](function(_0x3b2d99){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x1fe1ce,_0x2efe('0xb'));logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x1fe1ce,_0x2efe('0xb'),JSON[_0x2efe('0xc')](_0x3b2d99));if(_0x3b2d99['error']){if(_0x3b2d99[_0x2efe('0xd')][_0x2efe('0xe')]===0x1f4){logger[_0x2efe('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x1fe1ce,_0x3b2d99[_0x2efe('0xd')][_0x2efe('0xf')]);return _0x2c6793(_0x3b2d99[_0x2efe('0xd')][_0x2efe('0xf')]);}logger[_0x2efe('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x1fe1ce,_0x3b2d99[_0x2efe('0xd')][_0x2efe('0xf')]);return _0x103bcc(_0x3b2d99['error'][_0x2efe('0xf')]);}else{logger[_0x2efe('0x10')](_0x2efe('0x11'),_0x1fe1ce,_0x2efe('0xb'));_0x103bcc(_0x3b2d99['result'][_0x2efe('0xf')]);}})[_0x2efe('0x12')](function(_0x1288f4){logger['error'](_0x2efe('0x11'),_0x1fe1ce,_0x1288f4);_0x2c6793(_0x1288f4);});});}exports[_0x2efe('0x13')]=function(_0x426fb2){var _0x336afd=this;return new Promise(function(_0x20469c,_0x16a560){return db[_0x2efe('0x14')][_0x2efe('0x15')]({'raw':_0x426fb2[_0x2efe('0x16')]?_0x426fb2[_0x2efe('0x16')][_0x2efe('0x17')]===undefined?!![]:![]:!![],'where':_0x426fb2[_0x2efe('0x16')]?_0x426fb2[_0x2efe('0x16')][_0x2efe('0x18')]||null:null,'attributes':_0x426fb2[_0x2efe('0x16')]?_0x426fb2[_0x2efe('0x16')][_0x2efe('0x19')]||null:null,'limit':_0x426fb2[_0x2efe('0x16')]?_0x426fb2['options'][_0x2efe('0x1a')]||null:null,'include':_0x426fb2[_0x2efe('0x16')]?_0x426fb2[_0x2efe('0x16')]['include']?_[_0x2efe('0x1b')](_0x426fb2['options'][_0x2efe('0x1c')],function(_0x1d1586){return{'model':db[_0x1d1586[_0x2efe('0x1d')]],'as':_0x1d1586['as'],'attributes':_0x1d1586[_0x2efe('0x19')],'include':_0x1d1586[_0x2efe('0x1c')]?_[_0x2efe('0x1b')](_0x1d1586[_0x2efe('0x1c')],function(_0x295b58){return{'model':db[_0x295b58[_0x2efe('0x1d')]],'as':_0x295b58['as'],'attributes':_0x295b58[_0x2efe('0x19')],'include':_0x295b58[_0x2efe('0x1c')]?_[_0x2efe('0x1b')](_0x295b58[_0x2efe('0x1c')],function(_0x1b704b){return{'model':db[_0x1b704b[_0x2efe('0x1d')]],'as':_0x1b704b['as'],'attributes':_0x1b704b['attributes']};}):[]};}):[]};}):[]:[]})[_0x2efe('0x1e')](function(_0x28936e){logger[_0x2efe('0x10')]('GetSalesforceAccount',_0x426fb2);logger[_0x2efe('0x1f')]('GetSalesforceAccount',_0x426fb2,JSON[_0x2efe('0xc')](_0x28936e));_0x20469c(_0x28936e);})[_0x2efe('0x12')](function(_0x1c17a3){logger[_0x2efe('0xd')](_0x2efe('0x13'),_0x1c17a3[_0x2efe('0xf')],_0x426fb2);_0x16a560(_0x336afd[_0x2efe('0xd')](0x1f4,_0x1c17a3[_0x2efe('0xf')]));});});};exports[_0x2efe('0x20')]=function(_0x673543){var _0x2199c3=this;return new Promise(function(_0x4b88bc,_0x3233fb){return db[_0x2efe('0x14')][_0x2efe('0x21')]({'raw':_0x673543[_0x2efe('0x16')]?_0x673543[_0x2efe('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x673543['options']?_0x673543[_0x2efe('0x16')][_0x2efe('0x18')]||null:null,'attributes':_0x673543[_0x2efe('0x16')]?_0x673543[_0x2efe('0x16')]['attributes']||null:null,'include':_0x673543[_0x2efe('0x16')]?_0x673543['options'][_0x2efe('0x1c')]?_[_0x2efe('0x1b')](_0x673543['options'][_0x2efe('0x1c')],function(_0xa12905){return{'model':db[_0xa12905[_0x2efe('0x1d')]],'as':_0xa12905['as'],'attributes':_0xa12905[_0x2efe('0x19')],'include':_0xa12905[_0x2efe('0x1c')]?_['map'](_0xa12905['include'],function(_0x20159c){return{'model':db[_0x20159c['model']],'as':_0x20159c['as'],'attributes':_0x20159c[_0x2efe('0x19')],'include':_0x20159c[_0x2efe('0x1c')]?_[_0x2efe('0x1b')](_0x20159c[_0x2efe('0x1c')],function(_0x26c619){return{'model':db[_0x26c619[_0x2efe('0x1d')]],'as':_0x26c619['as'],'attributes':_0x26c619[_0x2efe('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x76e9c){logger[_0x2efe('0x10')]('ShowSalesforceAccount',_0x673543);logger[_0x2efe('0x1f')](_0x2efe('0x20'),_0x673543,JSON[_0x2efe('0xc')](_0x76e9c));_0x4b88bc(_0x76e9c);})[_0x2efe('0x12')](function(_0x293ec3){logger[_0x2efe('0xd')](_0x2efe('0x20'),_0x293ec3[_0x2efe('0xf')],_0x673543);_0x3233fb(_0x2199c3[_0x2efe('0xd')](0x1f4,_0x293ec3[_0x2efe('0xf')]));});});};
\ No newline at end of file
index 61f2a38..f4ab293 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/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xdb28,0x106));var _0x8db2=function(_0x4d92a7,_0x5b777c){_0x4d92a7=_0x4d92a7-0x0;var _0x57dd51=_0xdb28[_0x4d92a7];return _0x57dd51;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router;
\ No newline at end of file
+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(_0x30f4c0,_0x581566){var _0x6b4991=function(_0x52f578){while(--_0x52f578){_0x30f4c0['push'](_0x30f4c0['shift']());}};_0x6b4991(++_0x581566);}(_0x5f2f,0x73));var _0xf5f2=function(_0x361152,_0x495395){_0x361152=_0x361152-0x0;var _0x5c068f=_0x5f2f[_0x361152];return _0x5c068f;};'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
index 094ad0e..64c4c3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc42f=['sequelize','exports','STRING','ENUM','Case','contact_lead','contact','lead','account_contact_lead','account','nothing'];(function(_0xe1770a,_0x4fc5d6){var _0x3e6274=function(_0x1a016f){while(--_0x1a016f){_0xe1770a['push'](_0xe1770a['shift']());}};_0x3e6274(++_0x4fc5d6);}(_0xc42f,0xb0));var _0xfc42=function(_0x4ee6d5,_0x10299f){_0x4ee6d5=_0x4ee6d5-0x0;var _0xcf5445=_0xc42f[_0x4ee6d5];return _0xcf5445;};'use strict';var Sequelize=require(_0xfc42('0x0'));module[_0xfc42('0x1')]={'name':{'type':Sequelize[_0xfc42('0x2')]},'description':{'type':Sequelize[_0xfc42('0x2')]},'ticketType':{'type':Sequelize[_0xfc42('0x3')]('Task',_0xfc42('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM'](_0xfc42('0x5'),_0xfc42('0x6'),_0xfc42('0x7'),_0xfc42('0x8'),_0xfc42('0x9')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xfc42('0x3')](_0xfc42('0xa'),_0xfc42('0x6'),_0xfc42('0x7'),_0xfc42('0x9')),'defaultValue':_0xfc42('0x7')},'leadId':{'type':Sequelize[_0xfc42('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0xfc42('0x2')]},'additionalSearchLead':{'type':Sequelize[_0xfc42('0x2')]}};
\ No newline at end of file
+var _0x3bfb=['STRING','ENUM','Case','contact_lead','contact','lead','account_contact_lead','nothing','sequelize','exports'];(function(_0x1b8f5a,_0x57c154){var _0x594189=function(_0x15b277){while(--_0x15b277){_0x1b8f5a['push'](_0x1b8f5a['shift']());}};_0x594189(++_0x57c154);}(_0x3bfb,0xee));var _0xb3bf=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x3bfb[_0x172747];return _0x509692;};'use strict';var Sequelize=require(_0xb3bf('0x0'));module[_0xb3bf('0x1')]={'name':{'type':Sequelize[_0xb3bf('0x2')]},'description':{'type':Sequelize[_0xb3bf('0x2')]},'ticketType':{'type':Sequelize[_0xb3bf('0x3')]('Task',_0xb3bf('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xb3bf('0x3')](_0xb3bf('0x5'),_0xb3bf('0x6'),_0xb3bf('0x7'),_0xb3bf('0x8'),'account'),'defaultValue':_0xb3bf('0x5')},'moduleCreate':{'type':Sequelize[_0xb3bf('0x3')](_0xb3bf('0x9'),_0xb3bf('0x6'),_0xb3bf('0x7'),'account'),'defaultValue':_0xb3bf('0x7')},'leadId':{'type':Sequelize[_0xb3bf('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0xb3bf('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xb3bf('0x2')]},'additionalSearchLead':{'type':Sequelize[_0xb3bf('0x2')]}};
\ No newline at end of file
index ff5bcb3..a2c1582 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8466=['getDescriptions','eml-format','rimraf','request-promise','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','index','map','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','SalesforceConfiguration','findAll','rows','catch','show','rawAttributes','includeAll','include','find','create','body','update','params','getFields','findOne','getSubjects','SalesforceField'];(function(_0x27c0a8,_0x5e2c33){var _0x260cc6=function(_0x3d93df){while(--_0x3d93df){_0x27c0a8['push'](_0x27c0a8['shift']());}};_0x260cc6(++_0x5e2c33);}(_0x8466,0x139));var _0x6846=function(_0xf86e81,_0x3089d3){_0xf86e81=_0xf86e81-0x0;var _0x477be7=_0x8466[_0xf86e81];return _0x477be7;};'use strict';var emlformat=require(_0x6846('0x0'));var rimraf=require(_0x6846('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6846('0x2'));var moment=require('moment');var BPromise=require(_0x6846('0x3'));var Mustache=require(_0x6846('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6846('0x5'));var ejs=require(_0x6846('0x6'));var fs=require('fs');var fs_extra=require(_0x6846('0x7'));var _=require(_0x6846('0x8'));var squel=require(_0x6846('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6846('0xa'));var toCsv=require(_0x6846('0x5'));var querystring=require(_0x6846('0xb'));var Papa=require(_0x6846('0xc'));var Redis=require(_0x6846('0xd'));var authService=require(_0x6846('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6846('0xf'));var hardwareService=require(_0x6846('0x10'));var logger=require(_0x6846('0x11'))(_0x6846('0x12'));var utils=require(_0x6846('0x13'));var config=require(_0x6846('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6846('0x15'))['db'];function respondWithStatusCode(_0x2d46d6,_0x5db0c2){_0x5db0c2=_0x5db0c2||0xcc;return function(_0x46d013){if(_0x46d013){return _0x2d46d6[_0x6846('0x16')](_0x5db0c2);}return _0x2d46d6[_0x6846('0x17')](_0x5db0c2)[_0x6846('0x18')]();};}function respondWithResult(_0x5e972a,_0x5617e6){_0x5617e6=_0x5617e6||0xc8;return function(_0x16dcad){if(_0x16dcad){return _0x5e972a[_0x6846('0x17')](_0x5617e6)[_0x6846('0x19')](_0x16dcad);}};}function respondWithFilteredResult(_0x2a2c3e,_0x43e4bb){return function(_0x25b8f6){if(_0x25b8f6){var _0x10328e=typeof _0x43e4bb[_0x6846('0x1a')]==='undefined'&&typeof _0x43e4bb['limit']===_0x6846('0x1b');var _0x3ac9cc=_0x25b8f6[_0x6846('0x1c')];var _0xd2c8bb=_0x10328e?0x0:_0x43e4bb[_0x6846('0x1a')];var _0x552ead=_0x10328e?_0x25b8f6[_0x6846('0x1c')]:_0x43e4bb[_0x6846('0x1a')]+_0x43e4bb[_0x6846('0x1d')];var _0x85135e;if(_0x552ead>=_0x3ac9cc){_0x552ead=_0x3ac9cc;_0x85135e=0xc8;}else{_0x85135e=0xce;}_0x2a2c3e[_0x6846('0x17')](_0x85135e);return _0x2a2c3e[_0x6846('0x1e')](_0x6846('0x1f'),_0xd2c8bb+'-'+_0x552ead+'/'+_0x3ac9cc)[_0x6846('0x19')](_0x25b8f6);}return null;};}function patchUpdates(_0x34380e){return function(_0x401f59){try{jsonpatch[_0x6846('0x20')](_0x401f59,_0x34380e,!![]);}catch(_0x57df70){return BPromise[_0x6846('0x21')](_0x57df70);}return _0x401f59[_0x6846('0x22')]();};}function saveUpdates(_0x53fe56,_0x43d7d9){return function(_0x16213f){if(_0x16213f){return _0x16213f['update'](_0x53fe56)[_0x6846('0x23')](function(_0x34ff90){return _0x34ff90;});}return null;};}function removeEntity(_0x5cc4b6,_0x5ec7d1){return function(_0x59bce6){if(_0x59bce6){return _0x59bce6[_0x6846('0x24')]()['then'](function(){_0x5cc4b6['status'](0xcc)[_0x6846('0x18')]();});}};}function handleEntityNotFound(_0x518630,_0x3112ee){return function(_0x907a5){if(!_0x907a5){_0x518630['sendStatus'](0x194);}return _0x907a5;};}function handleError(_0x53527b,_0x29922d){_0x29922d=_0x29922d||0x1f4;return function(_0x4dc001){logger[_0x6846('0x25')](_0x4dc001['stack']);if(_0x4dc001[_0x6846('0x26')]){delete _0x4dc001[_0x6846('0x26')];}_0x53527b['status'](_0x29922d)['send'](_0x4dc001);};}exports[_0x6846('0x27')]=function(_0x2aee50,_0x4de6cf){var _0x4594f1={},_0x5660b2={},_0x491fdb={'count':0x0,'rows':[]};var _0x19955f=_[_0x6846('0x28')](db['SalesforceConfiguration']['rawAttributes'],function(_0x32fae5){return{'name':_0x32fae5['fieldName'],'type':_0x32fae5[_0x6846('0x29')]['key']};});_0x5660b2[_0x6846('0x2a')]=_[_0x6846('0x28')](_0x19955f,'name');_0x5660b2[_0x6846('0x2b')]=_[_0x6846('0x2c')](_0x2aee50[_0x6846('0x2b')]);_0x5660b2[_0x6846('0x2d')]=_['intersection'](_0x5660b2[_0x6846('0x2a')],_0x5660b2[_0x6846('0x2b')]);_0x4594f1[_0x6846('0x2e')]=_[_0x6846('0x2f')](_0x5660b2[_0x6846('0x2a')],qs[_0x6846('0x30')](_0x2aee50[_0x6846('0x2b')][_0x6846('0x30')]));_0x4594f1[_0x6846('0x2e')]=_0x4594f1[_0x6846('0x2e')][_0x6846('0x31')]?_0x4594f1[_0x6846('0x2e')]:_0x5660b2[_0x6846('0x2a')];if(!_0x2aee50['query'][_0x6846('0x32')](_0x6846('0x33'))){_0x4594f1['limit']=qs['limit'](_0x2aee50[_0x6846('0x2b')][_0x6846('0x1d')]);_0x4594f1[_0x6846('0x1a')]=qs['offset'](_0x2aee50[_0x6846('0x2b')]['offset']);}_0x4594f1[_0x6846('0x34')]=qs['sort'](_0x2aee50[_0x6846('0x2b')][_0x6846('0x35')]);_0x4594f1['where']=qs[_0x6846('0x2d')](_[_0x6846('0x36')](_0x2aee50[_0x6846('0x2b')],_0x5660b2[_0x6846('0x2d')]),_0x19955f);if(_0x2aee50['query'][_0x6846('0x37')]){_0x4594f1[_0x6846('0x38')]=_['merge'](_0x4594f1[_0x6846('0x38')],{'$or':_['map'](_0x19955f,function(_0x5b0a35){if(_0x5b0a35[_0x6846('0x29')]!==_0x6846('0x39')){var _0x248b59={};_0x248b59[_0x5b0a35[_0x6846('0x26')]]={'$like':'%'+_0x2aee50[_0x6846('0x2b')][_0x6846('0x37')]+'%'};return _0x248b59;}})});}_0x4594f1=_[_0x6846('0x3a')]({},_0x4594f1,_0x2aee50[_0x6846('0x3b')]);var _0x5bf403={'where':_0x4594f1['where']};return db[_0x6846('0x3c')]['count'](_0x5bf403)[_0x6846('0x23')](function(_0x451019){_0x491fdb[_0x6846('0x1c')]=_0x451019;if(_0x2aee50[_0x6846('0x2b')]['includeAll']){_0x4594f1['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x6846('0x3d')](_0x4594f1);})[_0x6846('0x23')](function(_0x183342){_0x491fdb[_0x6846('0x3e')]=_0x183342;return _0x491fdb;})[_0x6846('0x23')](respondWithFilteredResult(_0x4de6cf,_0x4594f1))[_0x6846('0x3f')](handleError(_0x4de6cf,null));};exports[_0x6846('0x40')]=function(_0x18bf90,_0xbd91bf){var _0xb419a5={'raw':![],'where':{'id':_0x18bf90['params']['id']}},_0x3a5b3f={};_0x3a5b3f['model']=_[_0x6846('0x2c')](db[_0x6846('0x3c')][_0x6846('0x41')]);_0x3a5b3f['query']=_['keys'](_0x18bf90[_0x6846('0x2b')]);_0x3a5b3f[_0x6846('0x2d')]=_[_0x6846('0x2f')](_0x3a5b3f[_0x6846('0x2a')],_0x3a5b3f[_0x6846('0x2b')]);_0xb419a5[_0x6846('0x2e')]=_[_0x6846('0x2f')](_0x3a5b3f['model'],qs['fields'](_0x18bf90[_0x6846('0x2b')]['fields']));_0xb419a5[_0x6846('0x2e')]=_0xb419a5['attributes'][_0x6846('0x31')]?_0xb419a5[_0x6846('0x2e')]:_0x3a5b3f[_0x6846('0x2a')];if(_0x18bf90[_0x6846('0x2b')][_0x6846('0x42')]){_0xb419a5[_0x6846('0x43')]=[{'all':!![]}];}_0xb419a5=_['merge']({},_0xb419a5,_0x18bf90[_0x6846('0x3b')]);return db[_0x6846('0x3c')][_0x6846('0x44')](_0xb419a5)[_0x6846('0x23')](handleEntityNotFound(_0xbd91bf,null))[_0x6846('0x23')](respondWithResult(_0xbd91bf,null))['catch'](handleError(_0xbd91bf,null));};exports[_0x6846('0x45')]=function(_0x538f3b,_0x49b5ae){return db['SalesforceConfiguration'][_0x6846('0x45')](_0x538f3b[_0x6846('0x46')],{})[_0x6846('0x23')](respondWithResult(_0x49b5ae,0xc9))[_0x6846('0x3f')](handleError(_0x49b5ae,null));};exports[_0x6846('0x47')]=function(_0x298115,_0x57cb80){if(_0x298115[_0x6846('0x46')]['id']){delete _0x298115['body']['id'];}return db['SalesforceConfiguration'][_0x6846('0x44')]({'where':{'id':_0x298115[_0x6846('0x48')]['id']}})[_0x6846('0x23')](handleEntityNotFound(_0x57cb80,null))[_0x6846('0x23')](saveUpdates(_0x298115[_0x6846('0x46')],null))[_0x6846('0x23')](respondWithResult(_0x57cb80,null))[_0x6846('0x3f')](handleError(_0x57cb80,null));};exports['destroy']=function(_0x92777f,_0x10cf6d){return db[_0x6846('0x3c')][_0x6846('0x44')]({'where':{'id':_0x92777f[_0x6846('0x48')]['id']}})['then'](handleEntityNotFound(_0x10cf6d,null))[_0x6846('0x23')](removeEntity(_0x10cf6d,null))[_0x6846('0x3f')](handleError(_0x10cf6d,null));};exports[_0x6846('0x49')]=function(_0x4b8b5b,_0x760ab2,_0x50d59e){var _0x28753e={};var _0x14fd98={};var _0x398975;var _0x3d775c;return db[_0x6846('0x3c')][_0x6846('0x4a')]({'where':{'id':_0x4b8b5b['params']['id']}})[_0x6846('0x23')](handleEntityNotFound(_0x760ab2,null))[_0x6846('0x23')](function(_0x3de01c){if(_0x3de01c){_0x398975=_0x3de01c;_0x14fd98[_0x6846('0x2a')]=_[_0x6846('0x2c')](db['SalesforceField'][_0x6846('0x41')]);_0x14fd98[_0x6846('0x2b')]=_['keys'](_0x4b8b5b[_0x6846('0x2b')]);_0x14fd98[_0x6846('0x2d')]=_[_0x6846('0x2f')](_0x14fd98[_0x6846('0x2a')],_0x14fd98['query']);_0x28753e['attributes']=_[_0x6846('0x2f')](_0x14fd98[_0x6846('0x2a')],qs[_0x6846('0x30')](_0x4b8b5b[_0x6846('0x2b')][_0x6846('0x30')]));_0x28753e[_0x6846('0x2e')]=_0x28753e['attributes'][_0x6846('0x31')]?_0x28753e['attributes']:_0x14fd98['model'];_0x28753e[_0x6846('0x34')]=qs[_0x6846('0x35')](_0x4b8b5b[_0x6846('0x2b')][_0x6846('0x35')]);_0x28753e['where']=qs[_0x6846('0x2d')](_[_0x6846('0x36')](_0x4b8b5b[_0x6846('0x2b')],_0x14fd98[_0x6846('0x2d')]));if(_0x4b8b5b['query'][_0x6846('0x37')]){_0x28753e['where']=_[_0x6846('0x3a')](_0x28753e[_0x6846('0x38')],{'$or':_['map'](_0x28753e[_0x6846('0x2e')],function(_0x4a692a){var _0x3ebee0={};_0x3ebee0[_0x4a692a]={'$like':'%'+_0x4b8b5b[_0x6846('0x2b')]['filter']+'%'};return _0x3ebee0;})});}_0x28753e=_[_0x6846('0x3a')]({},_0x28753e,_0x4b8b5b['options']);return _0x398975[_0x6846('0x49')](_0x28753e);}})['then'](function(_0x34725e){if(_0x34725e){_0x3d775c=_0x34725e[_0x6846('0x31')];if(!_0x4b8b5b[_0x6846('0x2b')][_0x6846('0x32')](_0x6846('0x33'))){_0x28753e['limit']=qs['limit'](_0x4b8b5b['query'][_0x6846('0x1d')]);_0x28753e['offset']=qs[_0x6846('0x1a')](_0x4b8b5b[_0x6846('0x2b')][_0x6846('0x1a')]);}return _0x398975['getFields'](_0x28753e);}})[_0x6846('0x23')](function(_0x5e9c3e){if(_0x5e9c3e){return _0x5e9c3e?{'count':_0x3d775c,'rows':_0x5e9c3e}:null;}})[_0x6846('0x23')](respondWithResult(_0x760ab2,null))[_0x6846('0x3f')](handleError(_0x760ab2,null));};exports[_0x6846('0x4b')]=function(_0xc31fa3,_0xbf34dc,_0x386f65){var _0x2d7167={};var _0x36f22a={};var _0x41f637;var _0x4ddf6d;return db[_0x6846('0x3c')][_0x6846('0x4a')]({'where':{'id':_0xc31fa3[_0x6846('0x48')]['id']}})[_0x6846('0x23')](handleEntityNotFound(_0xbf34dc,null))[_0x6846('0x23')](function(_0x177f19){if(_0x177f19){_0x41f637=_0x177f19;_0x36f22a[_0x6846('0x2a')]=_[_0x6846('0x2c')](db[_0x6846('0x4c')][_0x6846('0x41')]);_0x36f22a['query']=_[_0x6846('0x2c')](_0xc31fa3[_0x6846('0x2b')]);_0x36f22a['filters']=_[_0x6846('0x2f')](_0x36f22a[_0x6846('0x2a')],_0x36f22a[_0x6846('0x2b')]);_0x2d7167[_0x6846('0x2e')]=_[_0x6846('0x2f')](_0x36f22a[_0x6846('0x2a')],qs[_0x6846('0x30')](_0xc31fa3[_0x6846('0x2b')][_0x6846('0x30')]));_0x2d7167[_0x6846('0x2e')]=_0x2d7167[_0x6846('0x2e')]['length']?_0x2d7167['attributes']:_0x36f22a[_0x6846('0x2a')];_0x2d7167[_0x6846('0x34')]=qs['sort'](_0xc31fa3['query'][_0x6846('0x35')]);_0x2d7167[_0x6846('0x38')]=qs['filters'](_[_0x6846('0x36')](_0xc31fa3[_0x6846('0x2b')],_0x36f22a[_0x6846('0x2d')]));if(_0xc31fa3[_0x6846('0x2b')][_0x6846('0x37')]){_0x2d7167['where']=_['merge'](_0x2d7167['where'],{'$or':_[_0x6846('0x28')](_0x2d7167[_0x6846('0x2e')],function(_0x1ade30){var _0x12897c={};_0x12897c[_0x1ade30]={'$like':'%'+_0xc31fa3[_0x6846('0x2b')][_0x6846('0x37')]+'%'};return _0x12897c;})});}_0x2d7167=_[_0x6846('0x3a')]({},_0x2d7167,_0xc31fa3[_0x6846('0x3b')]);return _0x41f637[_0x6846('0x4b')](_0x2d7167);}})[_0x6846('0x23')](function(_0x19ed4d){if(_0x19ed4d){_0x4ddf6d=_0x19ed4d[_0x6846('0x31')];if(!_0xc31fa3[_0x6846('0x2b')]['hasOwnProperty']('nolimit')){_0x2d7167[_0x6846('0x1d')]=qs[_0x6846('0x1d')](_0xc31fa3[_0x6846('0x2b')][_0x6846('0x1d')]);_0x2d7167[_0x6846('0x1a')]=qs[_0x6846('0x1a')](_0xc31fa3[_0x6846('0x2b')][_0x6846('0x1a')]);}return _0x41f637[_0x6846('0x4b')](_0x2d7167);}})[_0x6846('0x23')](function(_0x59bbe4){if(_0x59bbe4){return _0x59bbe4?{'count':_0x4ddf6d,'rows':_0x59bbe4}:null;}})[_0x6846('0x23')](respondWithResult(_0xbf34dc,null))[_0x6846('0x3f')](handleError(_0xbf34dc,null));};exports[_0x6846('0x4d')]=function(_0x33785d,_0x31b342,_0x2b9ead){var _0x3b056d={};var _0x3b1cbd={};var _0x224e85;var _0x23a890;return db[_0x6846('0x3c')][_0x6846('0x4a')]({'where':{'id':_0x33785d[_0x6846('0x48')]['id']}})[_0x6846('0x23')](handleEntityNotFound(_0x31b342,null))[_0x6846('0x23')](function(_0x5b62a3){if(_0x5b62a3){_0x224e85=_0x5b62a3;_0x3b1cbd[_0x6846('0x2a')]=_['keys'](db[_0x6846('0x4c')][_0x6846('0x41')]);_0x3b1cbd[_0x6846('0x2b')]=_[_0x6846('0x2c')](_0x33785d['query']);_0x3b1cbd[_0x6846('0x2d')]=_[_0x6846('0x2f')](_0x3b1cbd[_0x6846('0x2a')],_0x3b1cbd[_0x6846('0x2b')]);_0x3b056d['attributes']=_[_0x6846('0x2f')](_0x3b1cbd['model'],qs['fields'](_0x33785d[_0x6846('0x2b')]['fields']));_0x3b056d[_0x6846('0x2e')]=_0x3b056d[_0x6846('0x2e')][_0x6846('0x31')]?_0x3b056d[_0x6846('0x2e')]:_0x3b1cbd['model'];_0x3b056d[_0x6846('0x34')]=qs[_0x6846('0x35')](_0x33785d['query'][_0x6846('0x35')]);_0x3b056d[_0x6846('0x38')]=qs[_0x6846('0x2d')](_[_0x6846('0x36')](_0x33785d['query'],_0x3b1cbd[_0x6846('0x2d')]));if(_0x33785d[_0x6846('0x2b')][_0x6846('0x37')]){_0x3b056d[_0x6846('0x38')]=_[_0x6846('0x3a')](_0x3b056d[_0x6846('0x38')],{'$or':_[_0x6846('0x28')](_0x3b056d[_0x6846('0x2e')],function(_0x11b1b5){var _0x3c7029={};_0x3c7029[_0x11b1b5]={'$like':'%'+_0x33785d[_0x6846('0x2b')][_0x6846('0x37')]+'%'};return _0x3c7029;})});}_0x3b056d=_[_0x6846('0x3a')]({},_0x3b056d,_0x33785d[_0x6846('0x3b')]);return _0x224e85[_0x6846('0x4d')](_0x3b056d);}})[_0x6846('0x23')](function(_0x32fadd){if(_0x32fadd){_0x23a890=_0x32fadd[_0x6846('0x31')];if(!_0x33785d['query'][_0x6846('0x32')]('nolimit')){_0x3b056d[_0x6846('0x1d')]=qs[_0x6846('0x1d')](_0x33785d[_0x6846('0x2b')][_0x6846('0x1d')]);_0x3b056d['offset']=qs[_0x6846('0x1a')](_0x33785d[_0x6846('0x2b')][_0x6846('0x1a')]);}return _0x224e85[_0x6846('0x4d')](_0x3b056d);}})[_0x6846('0x23')](function(_0x4fffd7){if(_0x4fffd7){return _0x4fffd7?{'count':_0x23a890,'rows':_0x4fffd7}:null;}})[_0x6846('0x23')](respondWithResult(_0x31b342,null))[_0x6846('0x3f')](handleError(_0x31b342,null));};
\ No newline at end of file
+var _0x7a59=['../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','type','query','filters','model','intersection','fields','attributes','length','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','SalesforceConfiguration','findAll','show','params','keys','include','find','create','body','catch','update','getFields','SalesforceField','getSubjects','findOne','hasOwnProperty','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x166f43,_0x3bc8cb){var _0x43ae50=function(_0x5c562){while(--_0x5c562){_0x166f43['push'](_0x166f43['shift']());}};_0x43ae50(++_0x3bc8cb);}(_0x7a59,0x16e));var _0x97a5=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0x7a59[_0x3c504b];return _0x2e5354;};'use strict';var emlformat=require(_0x97a5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x97a5('0x1'));var rp=require(_0x97a5('0x2'));var moment=require(_0x97a5('0x3'));var BPromise=require(_0x97a5('0x4'));var Mustache=require(_0x97a5('0x5'));var util=require('util');var path=require(_0x97a5('0x6'));var sox=require(_0x97a5('0x7'));var csv=require(_0x97a5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97a5('0x9'));var _=require(_0x97a5('0xa'));var squel=require(_0x97a5('0xb'));var crypto=require(_0x97a5('0xc'));var jsforce=require(_0x97a5('0xd'));var deskjs=require(_0x97a5('0xe'));var toCsv=require(_0x97a5('0x8'));var querystring=require('querystring');var Papa=require(_0x97a5('0xf'));var Redis=require(_0x97a5('0x10'));var authService=require(_0x97a5('0x11'));var qs=require(_0x97a5('0x12'));var as=require(_0x97a5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x97a5('0x14'));var utils=require(_0x97a5('0x15'));var config=require(_0x97a5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x97a5('0x17'))['db'];function respondWithStatusCode(_0x350720,_0x55305a){_0x55305a=_0x55305a||0xcc;return function(_0x4f85a0){if(_0x4f85a0){return _0x350720[_0x97a5('0x18')](_0x55305a);}return _0x350720[_0x97a5('0x19')](_0x55305a)['end']();};}function respondWithResult(_0x595437,_0x51d5e2){_0x51d5e2=_0x51d5e2||0xc8;return function(_0x5a4471){if(_0x5a4471){return _0x595437[_0x97a5('0x19')](_0x51d5e2)[_0x97a5('0x1a')](_0x5a4471);}};}function respondWithFilteredResult(_0x3603e4,_0x4d8ba7){return function(_0x1a7a62){if(_0x1a7a62){var _0x3fa986=typeof _0x4d8ba7['offset']===_0x97a5('0x1b')&&typeof _0x4d8ba7['limit']===_0x97a5('0x1b');var _0x55071b=_0x1a7a62['count'];var _0x52ce92=_0x3fa986?0x0:_0x4d8ba7[_0x97a5('0x1c')];var _0x5c5740=_0x3fa986?_0x1a7a62[_0x97a5('0x1d')]:_0x4d8ba7[_0x97a5('0x1c')]+_0x4d8ba7[_0x97a5('0x1e')];var _0x1efe8c;if(_0x5c5740>=_0x55071b){_0x5c5740=_0x55071b;_0x1efe8c=0xc8;}else{_0x1efe8c=0xce;}_0x3603e4['status'](_0x1efe8c);return _0x3603e4['set'](_0x97a5('0x1f'),_0x52ce92+'-'+_0x5c5740+'/'+_0x55071b)[_0x97a5('0x1a')](_0x1a7a62);}return null;};}function patchUpdates(_0x4e3386){return function(_0x51858b){try{jsonpatch[_0x97a5('0x20')](_0x51858b,_0x4e3386,!![]);}catch(_0x3d7dba){return BPromise[_0x97a5('0x21')](_0x3d7dba);}return _0x51858b['save']();};}function saveUpdates(_0x34fb55,_0x3a5849){return function(_0x23f4f8){if(_0x23f4f8){return _0x23f4f8['update'](_0x34fb55)[_0x97a5('0x22')](function(_0x33d6da){return _0x33d6da;});}return null;};}function removeEntity(_0x4e2074,_0x5e731e){return function(_0x469592){if(_0x469592){return _0x469592[_0x97a5('0x23')]()[_0x97a5('0x22')](function(){_0x4e2074[_0x97a5('0x19')](0xcc)[_0x97a5('0x24')]();});}};}function handleEntityNotFound(_0x302d78,_0xf7ad1e){return function(_0x4743e0){if(!_0x4743e0){_0x302d78['sendStatus'](0x194);}return _0x4743e0;};}function handleError(_0x2038dd,_0x46ee45){_0x46ee45=_0x46ee45||0x1f4;return function(_0x2ca97c){logger[_0x97a5('0x25')](_0x2ca97c[_0x97a5('0x26')]);if(_0x2ca97c[_0x97a5('0x27')]){delete _0x2ca97c['name'];}_0x2038dd[_0x97a5('0x19')](_0x46ee45)[_0x97a5('0x28')](_0x2ca97c);};}exports['index']=function(_0x274ccb,_0x52248f){var _0x48f1c1={},_0x1bdb74={},_0x2eaae4={'count':0x0,'rows':[]};var _0x5c1c67=_[_0x97a5('0x29')](db['SalesforceConfiguration'][_0x97a5('0x2a')],function(_0x3c5d02){return{'name':_0x3c5d02[_0x97a5('0x2b')],'type':_0x3c5d02[_0x97a5('0x2c')]['key']};});_0x1bdb74['model']=_[_0x97a5('0x29')](_0x5c1c67,_0x97a5('0x27'));_0x1bdb74[_0x97a5('0x2d')]=_['keys'](_0x274ccb[_0x97a5('0x2d')]);_0x1bdb74[_0x97a5('0x2e')]=_['intersection'](_0x1bdb74[_0x97a5('0x2f')],_0x1bdb74[_0x97a5('0x2d')]);_0x48f1c1['attributes']=_[_0x97a5('0x30')](_0x1bdb74[_0x97a5('0x2f')],qs[_0x97a5('0x31')](_0x274ccb['query'][_0x97a5('0x31')]));_0x48f1c1[_0x97a5('0x32')]=_0x48f1c1[_0x97a5('0x32')][_0x97a5('0x33')]?_0x48f1c1[_0x97a5('0x32')]:_0x1bdb74[_0x97a5('0x2f')];if(!_0x274ccb[_0x97a5('0x2d')]['hasOwnProperty'](_0x97a5('0x34'))){_0x48f1c1[_0x97a5('0x1e')]=qs[_0x97a5('0x1e')](_0x274ccb[_0x97a5('0x2d')][_0x97a5('0x1e')]);_0x48f1c1[_0x97a5('0x1c')]=qs[_0x97a5('0x1c')](_0x274ccb[_0x97a5('0x2d')][_0x97a5('0x1c')]);}_0x48f1c1[_0x97a5('0x35')]=qs[_0x97a5('0x36')](_0x274ccb[_0x97a5('0x2d')][_0x97a5('0x36')]);_0x48f1c1['where']=qs[_0x97a5('0x2e')](_[_0x97a5('0x37')](_0x274ccb[_0x97a5('0x2d')],_0x1bdb74[_0x97a5('0x2e')]),_0x5c1c67);if(_0x274ccb[_0x97a5('0x2d')]['filter']){_0x48f1c1['where']=_[_0x97a5('0x38')](_0x48f1c1[_0x97a5('0x39')],{'$or':_[_0x97a5('0x29')](_0x5c1c67,function(_0x45a548){if(_0x45a548[_0x97a5('0x2c')]!==_0x97a5('0x3a')){var _0x57333b={};_0x57333b[_0x45a548[_0x97a5('0x27')]]={'$like':'%'+_0x274ccb['query'][_0x97a5('0x3b')]+'%'};return _0x57333b;}})});}_0x48f1c1=_[_0x97a5('0x38')]({},_0x48f1c1,_0x274ccb[_0x97a5('0x3c')]);var _0x798318={'where':_0x48f1c1[_0x97a5('0x39')]};return db['SalesforceConfiguration'][_0x97a5('0x1d')](_0x798318)[_0x97a5('0x22')](function(_0x64505){_0x2eaae4[_0x97a5('0x1d')]=_0x64505;if(_0x274ccb[_0x97a5('0x2d')]['includeAll']){_0x48f1c1['include']=[{'all':!![]}];}return db[_0x97a5('0x3d')][_0x97a5('0x3e')](_0x48f1c1);})[_0x97a5('0x22')](function(_0x20dbc6){_0x2eaae4['rows']=_0x20dbc6;return _0x2eaae4;})[_0x97a5('0x22')](respondWithFilteredResult(_0x52248f,_0x48f1c1))['catch'](handleError(_0x52248f,null));};exports[_0x97a5('0x3f')]=function(_0x331108,_0x111e72){var _0x5baf77={'raw':![],'where':{'id':_0x331108[_0x97a5('0x40')]['id']}},_0xefb019={};_0xefb019['model']=_[_0x97a5('0x41')](db[_0x97a5('0x3d')][_0x97a5('0x2a')]);_0xefb019[_0x97a5('0x2d')]=_[_0x97a5('0x41')](_0x331108[_0x97a5('0x2d')]);_0xefb019[_0x97a5('0x2e')]=_[_0x97a5('0x30')](_0xefb019[_0x97a5('0x2f')],_0xefb019[_0x97a5('0x2d')]);_0x5baf77[_0x97a5('0x32')]=_[_0x97a5('0x30')](_0xefb019['model'],qs[_0x97a5('0x31')](_0x331108[_0x97a5('0x2d')][_0x97a5('0x31')]));_0x5baf77['attributes']=_0x5baf77[_0x97a5('0x32')][_0x97a5('0x33')]?_0x5baf77[_0x97a5('0x32')]:_0xefb019[_0x97a5('0x2f')];if(_0x331108[_0x97a5('0x2d')]['includeAll']){_0x5baf77[_0x97a5('0x42')]=[{'all':!![]}];}_0x5baf77=_[_0x97a5('0x38')]({},_0x5baf77,_0x331108[_0x97a5('0x3c')]);return db[_0x97a5('0x3d')][_0x97a5('0x43')](_0x5baf77)['then'](handleEntityNotFound(_0x111e72,null))[_0x97a5('0x22')](respondWithResult(_0x111e72,null))['catch'](handleError(_0x111e72,null));};exports[_0x97a5('0x44')]=function(_0x235f9d,_0x330f6a){return db['SalesforceConfiguration'][_0x97a5('0x44')](_0x235f9d[_0x97a5('0x45')],{})[_0x97a5('0x22')](respondWithResult(_0x330f6a,0xc9))[_0x97a5('0x46')](handleError(_0x330f6a,null));};exports[_0x97a5('0x47')]=function(_0x42ced6,_0x49b215){if(_0x42ced6[_0x97a5('0x45')]['id']){delete _0x42ced6[_0x97a5('0x45')]['id'];}return db[_0x97a5('0x3d')][_0x97a5('0x43')]({'where':{'id':_0x42ced6['params']['id']}})[_0x97a5('0x22')](handleEntityNotFound(_0x49b215,null))[_0x97a5('0x22')](saveUpdates(_0x42ced6['body'],null))[_0x97a5('0x22')](respondWithResult(_0x49b215,null))[_0x97a5('0x46')](handleError(_0x49b215,null));};exports[_0x97a5('0x23')]=function(_0x56890f,_0x2a6fa0){return db[_0x97a5('0x3d')]['find']({'where':{'id':_0x56890f[_0x97a5('0x40')]['id']}})[_0x97a5('0x22')](handleEntityNotFound(_0x2a6fa0,null))[_0x97a5('0x22')](removeEntity(_0x2a6fa0,null))['catch'](handleError(_0x2a6fa0,null));};exports[_0x97a5('0x48')]=function(_0xc3c9e5,_0x7adad,_0x5d3944){var _0x5358b7={};var _0x423534={};var _0x7c4886;var _0x3ccb26;return db[_0x97a5('0x3d')]['findOne']({'where':{'id':_0xc3c9e5[_0x97a5('0x40')]['id']}})[_0x97a5('0x22')](handleEntityNotFound(_0x7adad,null))[_0x97a5('0x22')](function(_0x4c91b7){if(_0x4c91b7){_0x7c4886=_0x4c91b7;_0x423534['model']=_['keys'](db[_0x97a5('0x49')][_0x97a5('0x2a')]);_0x423534[_0x97a5('0x2d')]=_['keys'](_0xc3c9e5[_0x97a5('0x2d')]);_0x423534[_0x97a5('0x2e')]=_[_0x97a5('0x30')](_0x423534[_0x97a5('0x2f')],_0x423534[_0x97a5('0x2d')]);_0x5358b7[_0x97a5('0x32')]=_[_0x97a5('0x30')](_0x423534['model'],qs[_0x97a5('0x31')](_0xc3c9e5['query'][_0x97a5('0x31')]));_0x5358b7['attributes']=_0x5358b7['attributes'][_0x97a5('0x33')]?_0x5358b7[_0x97a5('0x32')]:_0x423534['model'];_0x5358b7[_0x97a5('0x35')]=qs[_0x97a5('0x36')](_0xc3c9e5['query'][_0x97a5('0x36')]);_0x5358b7['where']=qs[_0x97a5('0x2e')](_['pick'](_0xc3c9e5[_0x97a5('0x2d')],_0x423534['filters']));if(_0xc3c9e5[_0x97a5('0x2d')][_0x97a5('0x3b')]){_0x5358b7['where']=_[_0x97a5('0x38')](_0x5358b7['where'],{'$or':_[_0x97a5('0x29')](_0x5358b7['attributes'],function(_0x52d423){var _0x537e29={};_0x537e29[_0x52d423]={'$like':'%'+_0xc3c9e5[_0x97a5('0x2d')][_0x97a5('0x3b')]+'%'};return _0x537e29;})});}_0x5358b7=_[_0x97a5('0x38')]({},_0x5358b7,_0xc3c9e5[_0x97a5('0x3c')]);return _0x7c4886[_0x97a5('0x48')](_0x5358b7);}})[_0x97a5('0x22')](function(_0x145c62){if(_0x145c62){_0x3ccb26=_0x145c62[_0x97a5('0x33')];if(!_0xc3c9e5['query']['hasOwnProperty']('nolimit')){_0x5358b7[_0x97a5('0x1e')]=qs['limit'](_0xc3c9e5['query'][_0x97a5('0x1e')]);_0x5358b7[_0x97a5('0x1c')]=qs['offset'](_0xc3c9e5[_0x97a5('0x2d')][_0x97a5('0x1c')]);}return _0x7c4886['getFields'](_0x5358b7);}})['then'](function(_0x189ce9){if(_0x189ce9){return _0x189ce9?{'count':_0x3ccb26,'rows':_0x189ce9}:null;}})[_0x97a5('0x22')](respondWithResult(_0x7adad,null))[_0x97a5('0x46')](handleError(_0x7adad,null));};exports[_0x97a5('0x4a')]=function(_0x58c27c,_0x30d166,_0x270991){var _0x29914a={};var _0x31eca3={};var _0x1a3c2d;var _0x548ef4;return db['SalesforceConfiguration'][_0x97a5('0x4b')]({'where':{'id':_0x58c27c[_0x97a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x30d166,null))[_0x97a5('0x22')](function(_0x3370e8){if(_0x3370e8){_0x1a3c2d=_0x3370e8;_0x31eca3[_0x97a5('0x2f')]=_[_0x97a5('0x41')](db['SalesforceField'][_0x97a5('0x2a')]);_0x31eca3['query']=_['keys'](_0x58c27c['query']);_0x31eca3['filters']=_[_0x97a5('0x30')](_0x31eca3[_0x97a5('0x2f')],_0x31eca3[_0x97a5('0x2d')]);_0x29914a[_0x97a5('0x32')]=_[_0x97a5('0x30')](_0x31eca3[_0x97a5('0x2f')],qs[_0x97a5('0x31')](_0x58c27c[_0x97a5('0x2d')]['fields']));_0x29914a[_0x97a5('0x32')]=_0x29914a[_0x97a5('0x32')]['length']?_0x29914a[_0x97a5('0x32')]:_0x31eca3[_0x97a5('0x2f')];_0x29914a['order']=qs[_0x97a5('0x36')](_0x58c27c[_0x97a5('0x2d')]['sort']);_0x29914a[_0x97a5('0x39')]=qs[_0x97a5('0x2e')](_['pick'](_0x58c27c['query'],_0x31eca3[_0x97a5('0x2e')]));if(_0x58c27c['query'][_0x97a5('0x3b')]){_0x29914a['where']=_[_0x97a5('0x38')](_0x29914a[_0x97a5('0x39')],{'$or':_[_0x97a5('0x29')](_0x29914a[_0x97a5('0x32')],function(_0xc0e844){var _0x3e6160={};_0x3e6160[_0xc0e844]={'$like':'%'+_0x58c27c[_0x97a5('0x2d')]['filter']+'%'};return _0x3e6160;})});}_0x29914a=_[_0x97a5('0x38')]({},_0x29914a,_0x58c27c[_0x97a5('0x3c')]);return _0x1a3c2d[_0x97a5('0x4a')](_0x29914a);}})[_0x97a5('0x22')](function(_0x216715){if(_0x216715){_0x548ef4=_0x216715['length'];if(!_0x58c27c['query'][_0x97a5('0x4c')](_0x97a5('0x34'))){_0x29914a['limit']=qs[_0x97a5('0x1e')](_0x58c27c[_0x97a5('0x2d')]['limit']);_0x29914a[_0x97a5('0x1c')]=qs['offset'](_0x58c27c[_0x97a5('0x2d')][_0x97a5('0x1c')]);}return _0x1a3c2d[_0x97a5('0x4a')](_0x29914a);}})[_0x97a5('0x22')](function(_0x19dbf0){if(_0x19dbf0){return _0x19dbf0?{'count':_0x548ef4,'rows':_0x19dbf0}:null;}})['then'](respondWithResult(_0x30d166,null))[_0x97a5('0x46')](handleError(_0x30d166,null));};exports['getDescriptions']=function(_0x3abe99,_0x4f30fb,_0x140320){var _0x2af841={};var _0x50979b={};var _0x2b84fa;var _0x165da2;return db[_0x97a5('0x3d')]['findOne']({'where':{'id':_0x3abe99[_0x97a5('0x40')]['id']}})[_0x97a5('0x22')](handleEntityNotFound(_0x4f30fb,null))[_0x97a5('0x22')](function(_0x16badc){if(_0x16badc){_0x2b84fa=_0x16badc;_0x50979b[_0x97a5('0x2f')]=_[_0x97a5('0x41')](db[_0x97a5('0x49')][_0x97a5('0x2a')]);_0x50979b[_0x97a5('0x2d')]=_[_0x97a5('0x41')](_0x3abe99[_0x97a5('0x2d')]);_0x50979b[_0x97a5('0x2e')]=_['intersection'](_0x50979b[_0x97a5('0x2f')],_0x50979b[_0x97a5('0x2d')]);_0x2af841[_0x97a5('0x32')]=_['intersection'](_0x50979b[_0x97a5('0x2f')],qs['fields'](_0x3abe99[_0x97a5('0x2d')][_0x97a5('0x31')]));_0x2af841[_0x97a5('0x32')]=_0x2af841[_0x97a5('0x32')][_0x97a5('0x33')]?_0x2af841['attributes']:_0x50979b[_0x97a5('0x2f')];_0x2af841[_0x97a5('0x35')]=qs[_0x97a5('0x36')](_0x3abe99[_0x97a5('0x2d')]['sort']);_0x2af841['where']=qs['filters'](_[_0x97a5('0x37')](_0x3abe99[_0x97a5('0x2d')],_0x50979b[_0x97a5('0x2e')]));if(_0x3abe99[_0x97a5('0x2d')][_0x97a5('0x3b')]){_0x2af841[_0x97a5('0x39')]=_[_0x97a5('0x38')](_0x2af841[_0x97a5('0x39')],{'$or':_[_0x97a5('0x29')](_0x2af841[_0x97a5('0x32')],function(_0x3b3d5d){var _0x4c27f0={};_0x4c27f0[_0x3b3d5d]={'$like':'%'+_0x3abe99[_0x97a5('0x2d')][_0x97a5('0x3b')]+'%'};return _0x4c27f0;})});}_0x2af841=_[_0x97a5('0x38')]({},_0x2af841,_0x3abe99[_0x97a5('0x3c')]);return _0x2b84fa['getDescriptions'](_0x2af841);}})[_0x97a5('0x22')](function(_0x2ddc87){if(_0x2ddc87){_0x165da2=_0x2ddc87['length'];if(!_0x3abe99[_0x97a5('0x2d')][_0x97a5('0x4c')](_0x97a5('0x34'))){_0x2af841[_0x97a5('0x1e')]=qs[_0x97a5('0x1e')](_0x3abe99[_0x97a5('0x2d')][_0x97a5('0x1e')]);_0x2af841['offset']=qs[_0x97a5('0x1c')](_0x3abe99['query'][_0x97a5('0x1c')]);}return _0x2b84fa['getDescriptions'](_0x2af841);}})[_0x97a5('0x22')](function(_0xe46572){if(_0xe46572){return _0xe46572?{'count':_0x165da2,'rows':_0xe46572}:null;}})[_0x97a5('0x22')](respondWithResult(_0x4f30fb,null))[_0x97a5('0x46')](handleError(_0x4f30fb,null));};
\ No newline at end of file
index aab528b..43fd34b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3e1=['rimraf','../../config/environment','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd3e1,0x10a));var _0x1d3e=function(_0x457ee0,_0x3e7bb2){_0x457ee0=_0x457ee0-0x0;var _0x3d415a=_0xd3e1[_0x457ee0];return _0x3d415a;};'use strict';var _=require(_0x1d3e('0x0'));var util=require(_0x1d3e('0x1'));var logger=require(_0x1d3e('0x2'))('api');var moment=require(_0x1d3e('0x3'));var BPromise=require(_0x1d3e('0x4'));var rp=require(_0x1d3e('0x5'));var fs=require('fs');var path=require(_0x1d3e('0x6'));var rimraf=require(_0x1d3e('0x7'));var config=require(_0x1d3e('0x8'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x1d3e('0x9')]=function(_0x561626,_0x478cbf){return _0x561626[_0x1d3e('0xa')](_0x1d3e('0xb'),attributes,{'tableName':_0x1d3e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc5fb=['exports','define','SalesforceConfiguration','util','api','moment','bluebird','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes'];(function(_0x44905d,_0x43d924){var _0x403dfc=function(_0x518483){while(--_0x518483){_0x44905d['push'](_0x44905d['shift']());}};_0x403dfc(++_0x43d924);}(_0xc5fb,0xc9));var _0xbc5f=function(_0x35731c,_0x5ab1d1){_0x35731c=_0x35731c-0x0;var _0x2f2957=_0xc5fb[_0x35731c];return _0x2f2957;};'use strict';var _=require('lodash');var util=require(_0xbc5f('0x0'));var logger=require('../../config/logger')(_0xbc5f('0x1'));var moment=require(_0xbc5f('0x2'));var BPromise=require(_0xbc5f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbc5f('0x4'));var rimraf=require(_0xbc5f('0x5'));var config=require(_0xbc5f('0x6'));var attributes=require(_0xbc5f('0x7'));module[_0xbc5f('0x8')]=function(_0x16bf68,_0x114061){return _0x16bf68[_0xbc5f('0x9')](_0xbc5f('0xa'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3dc18de..df3d436 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ef5=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3d9caa,_0x229fad){var _0x42db79=function(_0x1379a3){while(--_0x1379a3){_0x3d9caa['push'](_0x3d9caa['shift']());}};_0x42db79(++_0x229fad);}(_0x8ef5,0xe6));var _0x58ef=function(_0x1f2cd3,_0x275010){_0x1f2cd3=_0x1f2cd3-0x0;var _0x165869=_0x8ef5[_0x1f2cd3];return _0x165869;};'use strict';var _=require(_0x58ef('0x0'));var util=require(_0x58ef('0x1'));var moment=require(_0x58ef('0x2'));var BPromise=require(_0x58ef('0x3'));var rs=require(_0x58ef('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x58ef('0x5'))['db'];var utils=require(_0x58ef('0x6'));var logger=require(_0x58ef('0x7'))(_0x58ef('0x8'));var config=require(_0x58ef('0x9'));var jayson=require(_0x58ef('0xa'));var client=jayson[_0x58ef('0xb')][_0x58ef('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x27969a,_0xa68125,_0x6079e3){return new BPromise(function(_0x289157,_0x13f2a8){return client[_0x58ef('0xd')](_0x27969a,_0x6079e3)[_0x58ef('0xe')](function(_0x55072c){logger[_0x58ef('0xf')](_0x58ef('0x10'),_0xa68125,_0x58ef('0x11'));logger['debug'](_0x58ef('0x12'),_0xa68125,_0x58ef('0x11'),JSON[_0x58ef('0x13')](_0x55072c));if(_0x55072c[_0x58ef('0x14')]){if(_0x55072c[_0x58ef('0x14')][_0x58ef('0x15')]===0x1f4){logger[_0x58ef('0x14')](_0x58ef('0x10'),_0xa68125,_0x55072c[_0x58ef('0x14')]['message']);return _0x13f2a8(_0x55072c[_0x58ef('0x14')]['message']);}logger[_0x58ef('0x14')](_0x58ef('0x10'),_0xa68125,_0x55072c[_0x58ef('0x14')]['message']);return _0x289157(_0x55072c[_0x58ef('0x14')][_0x58ef('0x16')]);}else{logger['info'](_0x58ef('0x10'),_0xa68125,'request\x20sent');_0x289157(_0x55072c[_0x58ef('0x17')][_0x58ef('0x16')]);}})[_0x58ef('0x18')](function(_0x3ff643){logger[_0x58ef('0x14')](_0x58ef('0x10'),_0xa68125,_0x3ff643);_0x13f2a8(_0x3ff643);});});}
\ No newline at end of file
+var _0xdd61=['../../mysqldb','../../config/logger','rpc','../../config/environment','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','bluebird','randomstring','ioredis'];(function(_0x306dca,_0x4c0d22){var _0x331291=function(_0x4b6641){while(--_0x4b6641){_0x306dca['push'](_0x306dca['shift']());}};_0x331291(++_0x4c0d22);}(_0xdd61,0x165));var _0x1dd6=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xdd61[_0x16d10f];return _0x50c823;};'use strict';var _=require(_0x1dd6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1dd6('0x1'));var rs=require(_0x1dd6('0x2'));var fs=require('fs');var Redis=require(_0x1dd6('0x3'));var db=require(_0x1dd6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1dd6('0x5'))(_0x1dd6('0x6'));var config=require(_0x1dd6('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5cf496,_0x1e582e,_0x44f220){return new BPromise(function(_0x25b5bd,_0x50c36f){return client[_0x1dd6('0x8')](_0x5cf496,_0x44f220)[_0x1dd6('0x9')](function(_0x5c8dab){logger[_0x1dd6('0xa')](_0x1dd6('0xb'),_0x1e582e,_0x1dd6('0xc'));logger[_0x1dd6('0xd')](_0x1dd6('0xe'),_0x1e582e,_0x1dd6('0xc'),JSON[_0x1dd6('0xf')](_0x5c8dab));if(_0x5c8dab[_0x1dd6('0x10')]){if(_0x5c8dab['error'][_0x1dd6('0x11')]===0x1f4){logger[_0x1dd6('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1e582e,_0x5c8dab[_0x1dd6('0x10')][_0x1dd6('0x12')]);return _0x50c36f(_0x5c8dab[_0x1dd6('0x10')]['message']);}logger[_0x1dd6('0x10')](_0x1dd6('0xb'),_0x1e582e,_0x5c8dab[_0x1dd6('0x10')][_0x1dd6('0x12')]);return _0x25b5bd(_0x5c8dab[_0x1dd6('0x10')][_0x1dd6('0x12')]);}else{logger[_0x1dd6('0xa')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1e582e,'request\x20sent');_0x25b5bd(_0x5c8dab['result'][_0x1dd6('0x12')]);}})['catch'](function(_0x3dc3c8){logger[_0x1dd6('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1e582e,_0x3dc3c8);_0x50c36f(_0x3dc3c8);});});}
\ No newline at end of file
index 7b06aa7..c23abda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71a1=['../../config/environment','./intSalesforceField.controller','isAuthenticated','index','get','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x71a1,0x138));var _0x171a=function(_0x2a532c,_0x3d31ad){_0x2a532c=_0x2a532c-0x0;var _0x4e1a25=_0x71a1[_0x2a532c];return _0x4e1a25;};'use strict';var multer=require(_0x171a('0x0'));var util=require('util');var path=require(_0x171a('0x1'));var timeout=require(_0x171a('0x2'));var express=require(_0x171a('0x3'));var router=express[_0x171a('0x4')]();var fs_extra=require(_0x171a('0x5'));var auth=require(_0x171a('0x6'));var interaction=require(_0x171a('0x7'));var config=require(_0x171a('0x8'));var controller=require(_0x171a('0x9'));router['get']('/',auth[_0x171a('0xa')](),controller[_0x171a('0xb')]);router[_0x171a('0xc')]('/:id',auth[_0x171a('0xa')](),controller['show']);router['post']('/',auth[_0x171a('0xa')](),controller[_0x171a('0xd')]);router[_0x171a('0xe')](_0x171a('0xf'),auth[_0x171a('0xa')](),controller[_0x171a('0x10')]);router[_0x171a('0x11')](_0x171a('0xf'),auth['isAuthenticated'](),controller[_0x171a('0x12')]);module[_0x171a('0x13')]=router;
\ No newline at end of file
+var _0x7351=['express','Router','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','create','put','update','destroy','exports','util','path'];(function(_0x2ebec9,_0x339348){var _0x39d431=function(_0x32dfa3){while(--_0x32dfa3){_0x2ebec9['push'](_0x2ebec9['shift']());}};_0x39d431(++_0x339348);}(_0x7351,0xd0));var _0x1735=function(_0x15917b,_0x40bb5f){_0x15917b=_0x15917b-0x0;var _0x16b09b=_0x7351[_0x15917b];return _0x16b09b;};'use strict';var multer=require('multer');var util=require(_0x1735('0x0'));var path=require(_0x1735('0x1'));var timeout=require('connect-timeout');var express=require(_0x1735('0x2'));var router=express[_0x1735('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1735('0x4'));var config=require(_0x1735('0x5'));var controller=require('./intSalesforceField.controller');router[_0x1735('0x6')]('/',auth['isAuthenticated'](),controller[_0x1735('0x7')]);router['get'](_0x1735('0x8'),auth[_0x1735('0x9')](),controller['show']);router['post']('/',auth[_0x1735('0x9')](),controller[_0x1735('0xa')]);router[_0x1735('0xb')](_0x1735('0x8'),auth[_0x1735('0x9')](),controller[_0x1735('0xc')]);router['delete'](_0x1735('0x8'),auth['isAuthenticated'](),controller[_0x1735('0xd')]);module[_0x1735('0xe')]=router;
\ No newline at end of file
index c5ea76f..1b82e20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64bb=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','sequelize'];(function(_0x5eb22e,_0x27cbac){var _0x27fed5=function(_0x565467){while(--_0x565467){_0x5eb22e['push'](_0x5eb22e['shift']());}};_0x27fed5(++_0x27cbac);}(_0x64bb,0x98));var _0xb64b=function(_0x203730,_0x14851f){_0x203730=_0x203730-0x0;var _0x3100f7=_0x64bb[_0x203730];return _0x3100f7;};'use strict';var Sequelize=require(_0xb64b('0x0'));module[_0xb64b('0x1')]={'type':{'type':Sequelize[_0xb64b('0x2')](_0xb64b('0x3'),_0xb64b('0x4'),_0xb64b('0x5'),_0xb64b('0x6'),_0xb64b('0x7')),'defaultValue':_0xb64b('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb64b('0x2')]('string',_0xb64b('0x4'),_0xb64b('0x5'))},'keyContent':{'type':Sequelize[_0xb64b('0x8')]},'idField':{'type':Sequelize[_0xb64b('0x8')]},'variableName':{'type':Sequelize[_0xb64b('0x8')]}};
\ No newline at end of file
+var _0x9042=['sequelize','exports','ENUM','variable','keyValue','picklist','string','STRING','customVariable'];(function(_0x57645b,_0x25f73a){var _0xe82f00=function(_0x526b4){while(--_0x526b4){_0x57645b['push'](_0x57645b['shift']());}};_0xe82f00(++_0x25f73a);}(_0x9042,0x1e6));var _0x2904=function(_0x231a47,_0x46a963){_0x231a47=_0x231a47-0x0;var _0x48d7c9=_0x9042[_0x231a47];return _0x48d7c9;};'use strict';var Sequelize=require(_0x2904('0x0'));module[_0x2904('0x1')]={'type':{'type':Sequelize[_0x2904('0x2')]('string',_0x2904('0x3'),'customVariable',_0x2904('0x4'),_0x2904('0x5')),'defaultValue':_0x2904('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2904('0x7')]},'keyType':{'type':Sequelize[_0x2904('0x2')]('string','variable',_0x2904('0x8'))},'keyContent':{'type':Sequelize[_0x2904('0x7')]},'idField':{'type':Sequelize[_0x2904('0x7')]},'variableName':{'type':Sequelize[_0x2904('0x7')]}};
\ No newline at end of file
index 16de24e..e1b1b6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb62=['update','then','error','stack','name','send','SalesforceField','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','findAll','rows','catch','show','params','includeAll','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject'];(function(_0xa2a4d8,_0x437e16){var _0x25fec5=function(_0x4493d7){while(--_0x4493d7){_0xa2a4d8['push'](_0xa2a4d8['shift']());}};_0x25fec5(++_0x437e16);}(_0xcb62,0x131));var _0x2cb6=function(_0x1d0dad,_0x3eb5ae){_0x1d0dad=_0x1d0dad-0x0;var _0x5c4c46=_0xcb62[_0x1d0dad];return _0x5c4c46;};'use strict';var emlformat=require(_0x2cb6('0x0'));var rimraf=require(_0x2cb6('0x1'));var zipdir=require(_0x2cb6('0x2'));var jsonpatch=require(_0x2cb6('0x3'));var rp=require('request-promise');var moment=require(_0x2cb6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2cb6('0x5'));var path=require(_0x2cb6('0x6'));var sox=require(_0x2cb6('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2cb6('0x8'));var _=require(_0x2cb6('0x9'));var squel=require(_0x2cb6('0xa'));var crypto=require(_0x2cb6('0xb'));var jsforce=require(_0x2cb6('0xc'));var deskjs=require(_0x2cb6('0xd'));var toCsv=require(_0x2cb6('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2cb6('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2cb6('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2cb6('0x11'))(_0x2cb6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2cb6('0x13'))['db'];function respondWithStatusCode(_0x56ee87,_0x12c915){_0x12c915=_0x12c915||0xcc;return function(_0x14b697){if(_0x14b697){return _0x56ee87[_0x2cb6('0x14')](_0x12c915);}return _0x56ee87[_0x2cb6('0x15')](_0x12c915)[_0x2cb6('0x16')]();};}function respondWithResult(_0x5139f2,_0x180fab){_0x180fab=_0x180fab||0xc8;return function(_0x4a1c72){if(_0x4a1c72){return _0x5139f2[_0x2cb6('0x15')](_0x180fab)[_0x2cb6('0x17')](_0x4a1c72);}};}function respondWithFilteredResult(_0x2c7312,_0x4c74){return function(_0x50fd47){if(_0x50fd47){var _0x95976a=typeof _0x4c74[_0x2cb6('0x18')]==='undefined'&&typeof _0x4c74[_0x2cb6('0x19')]==='undefined';var _0x209729=_0x50fd47[_0x2cb6('0x1a')];var _0x470ec0=_0x95976a?0x0:_0x4c74[_0x2cb6('0x18')];var _0x2bb315=_0x95976a?_0x50fd47[_0x2cb6('0x1a')]:_0x4c74['offset']+_0x4c74['limit'];var _0x44a5a8;if(_0x2bb315>=_0x209729){_0x2bb315=_0x209729;_0x44a5a8=0xc8;}else{_0x44a5a8=0xce;}_0x2c7312[_0x2cb6('0x15')](_0x44a5a8);return _0x2c7312['set'](_0x2cb6('0x1b'),_0x470ec0+'-'+_0x2bb315+'/'+_0x209729)[_0x2cb6('0x17')](_0x50fd47);}return null;};}function patchUpdates(_0x183ca3){return function(_0xd26942){try{jsonpatch[_0x2cb6('0x1c')](_0xd26942,_0x183ca3,!![]);}catch(_0x37fb50){return BPromise[_0x2cb6('0x1d')](_0x37fb50);}return _0xd26942['save']();};}function saveUpdates(_0x5343b,_0x53ef50){return function(_0x481dcc){if(_0x481dcc){return _0x481dcc[_0x2cb6('0x1e')](_0x5343b)[_0x2cb6('0x1f')](function(_0x29f172){return _0x29f172;});}return null;};}function removeEntity(_0x30a9d4,_0x5d29bd){return function(_0x314beb){if(_0x314beb){return _0x314beb['destroy']()[_0x2cb6('0x1f')](function(){_0x30a9d4[_0x2cb6('0x15')](0xcc)[_0x2cb6('0x16')]();});}};}function handleEntityNotFound(_0x15827a,_0x13c878){return function(_0x44e279){if(!_0x44e279){_0x15827a[_0x2cb6('0x14')](0x194);}return _0x44e279;};}function handleError(_0x64bccb,_0x3339a7){_0x3339a7=_0x3339a7||0x1f4;return function(_0x178b2f){logger[_0x2cb6('0x20')](_0x178b2f[_0x2cb6('0x21')]);if(_0x178b2f[_0x2cb6('0x22')]){delete _0x178b2f[_0x2cb6('0x22')];}_0x64bccb[_0x2cb6('0x15')](_0x3339a7)[_0x2cb6('0x23')](_0x178b2f);};}exports['index']=function(_0x146fd4,_0x56387f){var _0x1bb726={},_0x28298f={},_0x4569d8={'count':0x0,'rows':[]};var _0x52d559=_['map'](db[_0x2cb6('0x24')][_0x2cb6('0x25')],function(_0x2490d6){return{'name':_0x2490d6[_0x2cb6('0x26')],'type':_0x2490d6[_0x2cb6('0x27')][_0x2cb6('0x28')]};});_0x28298f[_0x2cb6('0x29')]=_[_0x2cb6('0x2a')](_0x52d559,_0x2cb6('0x22'));_0x28298f['query']=_[_0x2cb6('0x2b')](_0x146fd4[_0x2cb6('0x2c')]);_0x28298f[_0x2cb6('0x2d')]=_[_0x2cb6('0x2e')](_0x28298f['model'],_0x28298f['query']);_0x1bb726[_0x2cb6('0x2f')]=_['intersection'](_0x28298f[_0x2cb6('0x29')],qs[_0x2cb6('0x30')](_0x146fd4['query'][_0x2cb6('0x30')]));_0x1bb726[_0x2cb6('0x2f')]=_0x1bb726[_0x2cb6('0x2f')][_0x2cb6('0x31')]?_0x1bb726[_0x2cb6('0x2f')]:_0x28298f[_0x2cb6('0x29')];if(!_0x146fd4['query'][_0x2cb6('0x32')]('nolimit')){_0x1bb726[_0x2cb6('0x19')]=qs['limit'](_0x146fd4[_0x2cb6('0x2c')]['limit']);_0x1bb726[_0x2cb6('0x18')]=qs[_0x2cb6('0x18')](_0x146fd4[_0x2cb6('0x2c')]['offset']);}_0x1bb726[_0x2cb6('0x33')]=qs[_0x2cb6('0x34')](_0x146fd4[_0x2cb6('0x2c')]['sort']);_0x1bb726[_0x2cb6('0x35')]=qs[_0x2cb6('0x2d')](_[_0x2cb6('0x36')](_0x146fd4[_0x2cb6('0x2c')],_0x28298f['filters']),_0x52d559);if(_0x146fd4['query']['filter']){_0x1bb726['where']=_[_0x2cb6('0x37')](_0x1bb726['where'],{'$or':_['map'](_0x52d559,function(_0x124268){if(_0x124268[_0x2cb6('0x27')]!=='VIRTUAL'){var _0x13b68a={};_0x13b68a[_0x124268[_0x2cb6('0x22')]]={'$like':'%'+_0x146fd4[_0x2cb6('0x2c')][_0x2cb6('0x38')]+'%'};return _0x13b68a;}})});}_0x1bb726=_[_0x2cb6('0x37')]({},_0x1bb726,_0x146fd4[_0x2cb6('0x39')]);var _0x1d4d77={'where':_0x1bb726[_0x2cb6('0x35')]};return db[_0x2cb6('0x24')][_0x2cb6('0x1a')](_0x1d4d77)[_0x2cb6('0x1f')](function(_0x19c487){_0x4569d8['count']=_0x19c487;if(_0x146fd4[_0x2cb6('0x2c')]['includeAll']){_0x1bb726['include']=[{'all':!![]}];}return db['SalesforceField'][_0x2cb6('0x3a')](_0x1bb726);})[_0x2cb6('0x1f')](function(_0x9e66eb){_0x4569d8[_0x2cb6('0x3b')]=_0x9e66eb;return _0x4569d8;})['then'](respondWithFilteredResult(_0x56387f,_0x1bb726))[_0x2cb6('0x3c')](handleError(_0x56387f,null));};exports[_0x2cb6('0x3d')]=function(_0x25f15c,_0x5cce43){var _0x583478={'raw':!![],'where':{'id':_0x25f15c[_0x2cb6('0x3e')]['id']}},_0x522713={};_0x522713[_0x2cb6('0x29')]=_[_0x2cb6('0x2b')](db[_0x2cb6('0x24')][_0x2cb6('0x25')]);_0x522713['query']=_[_0x2cb6('0x2b')](_0x25f15c[_0x2cb6('0x2c')]);_0x522713[_0x2cb6('0x2d')]=_[_0x2cb6('0x2e')](_0x522713['model'],_0x522713['query']);_0x583478[_0x2cb6('0x2f')]=_['intersection'](_0x522713[_0x2cb6('0x29')],qs['fields'](_0x25f15c['query'][_0x2cb6('0x30')]));_0x583478['attributes']=_0x583478[_0x2cb6('0x2f')][_0x2cb6('0x31')]?_0x583478[_0x2cb6('0x2f')]:_0x522713[_0x2cb6('0x29')];if(_0x25f15c[_0x2cb6('0x2c')][_0x2cb6('0x3f')]){_0x583478['include']=[{'all':!![]}];}_0x583478=_['merge']({},_0x583478,_0x25f15c[_0x2cb6('0x39')]);return db[_0x2cb6('0x24')]['find'](_0x583478)[_0x2cb6('0x1f')](handleEntityNotFound(_0x5cce43,null))['then'](respondWithResult(_0x5cce43,null))[_0x2cb6('0x3c')](handleError(_0x5cce43,null));};exports[_0x2cb6('0x40')]=function(_0x5289a1,_0x5662c7){return db[_0x2cb6('0x24')][_0x2cb6('0x40')](_0x5289a1[_0x2cb6('0x41')],{})['then'](respondWithResult(_0x5662c7,0xc9))[_0x2cb6('0x3c')](handleError(_0x5662c7,null));};exports[_0x2cb6('0x1e')]=function(_0x3d960e,_0x3bc9a9){if(_0x3d960e[_0x2cb6('0x41')]['id']){delete _0x3d960e[_0x2cb6('0x41')]['id'];}return db[_0x2cb6('0x24')]['find']({'where':{'id':_0x3d960e['params']['id']}})['then'](handleEntityNotFound(_0x3bc9a9,null))[_0x2cb6('0x1f')](saveUpdates(_0x3d960e[_0x2cb6('0x41')],null))[_0x2cb6('0x1f')](respondWithResult(_0x3bc9a9,null))['catch'](handleError(_0x3bc9a9,null));};exports['destroy']=function(_0x4477ab,_0x4a719d){return db[_0x2cb6('0x24')][_0x2cb6('0x42')]({'where':{'id':_0x4477ab[_0x2cb6('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4a719d,null))[_0x2cb6('0x1f')](removeEntity(_0x4a719d,null))[_0x2cb6('0x3c')](handleError(_0x4a719d,null));};
\ No newline at end of file
+var _0x5620=['fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','SalesforceField','fieldName','type','key','model','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','offset','sort','where','filters','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','keys','includeAll','find','create','body','zip-dir'];(function(_0x2af2d8,_0xe7700d){var _0xb17df0=function(_0x29d7b6){while(--_0x29d7b6){_0x2af2d8['push'](_0x2af2d8['shift']());}};_0xb17df0(++_0xe7700d);}(_0x5620,0x8d));var _0x0562=function(_0x59b48b,_0x584733){_0x59b48b=_0x59b48b-0x0;var _0x4c3f79=_0x5620[_0x59b48b];return _0x4c3f79;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0562('0x0'));var jsonpatch=require(_0x0562('0x1'));var rp=require('request-promise');var moment=require(_0x0562('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0562('0x3'));var util=require(_0x0562('0x4'));var path=require(_0x0562('0x5'));var sox=require(_0x0562('0x6'));var csv=require('to-csv');var ejs=require(_0x0562('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0562('0x8'));var squel=require('squel');var crypto=require(_0x0562('0x9'));var jsforce=require(_0x0562('0xa'));var deskjs=require(_0x0562('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0562('0xc'));var qs=require(_0x0562('0xd'));var as=require(_0x0562('0xe'));var hardwareService=require(_0x0562('0xf'));var logger=require(_0x0562('0x10'))('api');var utils=require(_0x0562('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x0562('0x12'));var db=require(_0x0562('0x13'))['db'];function respondWithStatusCode(_0xc3eb64,_0x12b73d){_0x12b73d=_0x12b73d||0xcc;return function(_0x2ff285){if(_0x2ff285){return _0xc3eb64[_0x0562('0x14')](_0x12b73d);}return _0xc3eb64['status'](_0x12b73d)['end']();};}function respondWithResult(_0x43dc9e,_0x76478){_0x76478=_0x76478||0xc8;return function(_0x33a34a){if(_0x33a34a){return _0x43dc9e[_0x0562('0x15')](_0x76478)[_0x0562('0x16')](_0x33a34a);}};}function respondWithFilteredResult(_0x47b9b5,_0x472bf3){return function(_0x150c5f){if(_0x150c5f){var _0x1d8b13=typeof _0x472bf3['offset']===_0x0562('0x17')&&typeof _0x472bf3[_0x0562('0x18')]==='undefined';var _0x49b70d=_0x150c5f[_0x0562('0x19')];var _0x2a0033=_0x1d8b13?0x0:_0x472bf3['offset'];var _0x543079=_0x1d8b13?_0x150c5f[_0x0562('0x19')]:_0x472bf3['offset']+_0x472bf3[_0x0562('0x18')];var _0x286b81;if(_0x543079>=_0x49b70d){_0x543079=_0x49b70d;_0x286b81=0xc8;}else{_0x286b81=0xce;}_0x47b9b5[_0x0562('0x15')](_0x286b81);return _0x47b9b5[_0x0562('0x1a')](_0x0562('0x1b'),_0x2a0033+'-'+_0x543079+'/'+_0x49b70d)[_0x0562('0x16')](_0x150c5f);}return null;};}function patchUpdates(_0x1191df){return function(_0x3d0f87){try{jsonpatch[_0x0562('0x1c')](_0x3d0f87,_0x1191df,!![]);}catch(_0x4676d6){return BPromise[_0x0562('0x1d')](_0x4676d6);}return _0x3d0f87[_0x0562('0x1e')]();};}function saveUpdates(_0x32824f,_0x8a7422){return function(_0x783a5){if(_0x783a5){return _0x783a5[_0x0562('0x1f')](_0x32824f)['then'](function(_0xa54c8c){return _0xa54c8c;});}return null;};}function removeEntity(_0x21b6e5,_0x54e653){return function(_0x2e03fb){if(_0x2e03fb){return _0x2e03fb[_0x0562('0x20')]()[_0x0562('0x21')](function(){_0x21b6e5[_0x0562('0x15')](0xcc)[_0x0562('0x22')]();});}};}function handleEntityNotFound(_0x7f70b6,_0x23c6e2){return function(_0x1f7bec){if(!_0x1f7bec){_0x7f70b6[_0x0562('0x14')](0x194);}return _0x1f7bec;};}function handleError(_0x2b404f,_0x1bde9d){_0x1bde9d=_0x1bde9d||0x1f4;return function(_0x2fe973){logger[_0x0562('0x23')](_0x2fe973[_0x0562('0x24')]);if(_0x2fe973['name']){delete _0x2fe973[_0x0562('0x25')];}_0x2b404f[_0x0562('0x15')](_0x1bde9d)[_0x0562('0x26')](_0x2fe973);};}exports[_0x0562('0x27')]=function(_0x13adcf,_0x3ac0ed){var _0x53afc0={},_0x3ec825={},_0xb94be9={'count':0x0,'rows':[]};var _0x5cea76=_[_0x0562('0x28')](db[_0x0562('0x29')]['rawAttributes'],function(_0x1cc560){return{'name':_0x1cc560[_0x0562('0x2a')],'type':_0x1cc560[_0x0562('0x2b')][_0x0562('0x2c')]};});_0x3ec825[_0x0562('0x2d')]=_['map'](_0x5cea76,_0x0562('0x25'));_0x3ec825['query']=_['keys'](_0x13adcf['query']);_0x3ec825['filters']=_[_0x0562('0x2e')](_0x3ec825['model'],_0x3ec825[_0x0562('0x2f')]);_0x53afc0['attributes']=_['intersection'](_0x3ec825['model'],qs[_0x0562('0x30')](_0x13adcf[_0x0562('0x2f')][_0x0562('0x30')]));_0x53afc0[_0x0562('0x31')]=_0x53afc0[_0x0562('0x31')][_0x0562('0x32')]?_0x53afc0['attributes']:_0x3ec825[_0x0562('0x2d')];if(!_0x13adcf[_0x0562('0x2f')][_0x0562('0x33')](_0x0562('0x34'))){_0x53afc0[_0x0562('0x18')]=qs['limit'](_0x13adcf[_0x0562('0x2f')][_0x0562('0x18')]);_0x53afc0[_0x0562('0x35')]=qs[_0x0562('0x35')](_0x13adcf[_0x0562('0x2f')]['offset']);}_0x53afc0['order']=qs[_0x0562('0x36')](_0x13adcf[_0x0562('0x2f')][_0x0562('0x36')]);_0x53afc0[_0x0562('0x37')]=qs[_0x0562('0x38')](_['pick'](_0x13adcf[_0x0562('0x2f')],_0x3ec825[_0x0562('0x38')]),_0x5cea76);if(_0x13adcf[_0x0562('0x2f')]['filter']){_0x53afc0[_0x0562('0x37')]=_[_0x0562('0x39')](_0x53afc0[_0x0562('0x37')],{'$or':_[_0x0562('0x28')](_0x5cea76,function(_0x41b7db){if(_0x41b7db[_0x0562('0x2b')]!==_0x0562('0x3a')){var _0x399f71={};_0x399f71[_0x41b7db[_0x0562('0x25')]]={'$like':'%'+_0x13adcf['query'][_0x0562('0x3b')]+'%'};return _0x399f71;}})});}_0x53afc0=_[_0x0562('0x39')]({},_0x53afc0,_0x13adcf[_0x0562('0x3c')]);var _0x59b9bc={'where':_0x53afc0[_0x0562('0x37')]};return db['SalesforceField']['count'](_0x59b9bc)[_0x0562('0x21')](function(_0x47fa6a){_0xb94be9[_0x0562('0x19')]=_0x47fa6a;if(_0x13adcf[_0x0562('0x2f')]['includeAll']){_0x53afc0[_0x0562('0x3d')]=[{'all':!![]}];}return db[_0x0562('0x29')][_0x0562('0x3e')](_0x53afc0);})['then'](function(_0x55a71e){_0xb94be9[_0x0562('0x3f')]=_0x55a71e;return _0xb94be9;})['then'](respondWithFilteredResult(_0x3ac0ed,_0x53afc0))[_0x0562('0x40')](handleError(_0x3ac0ed,null));};exports['show']=function(_0x3396b6,_0x5a44fc){var _0x2f1658={'raw':!![],'where':{'id':_0x3396b6[_0x0562('0x41')]['id']}},_0x3b9364={};_0x3b9364[_0x0562('0x2d')]=_[_0x0562('0x42')](db[_0x0562('0x29')]['rawAttributes']);_0x3b9364[_0x0562('0x2f')]=_[_0x0562('0x42')](_0x3396b6[_0x0562('0x2f')]);_0x3b9364[_0x0562('0x38')]=_['intersection'](_0x3b9364['model'],_0x3b9364[_0x0562('0x2f')]);_0x2f1658[_0x0562('0x31')]=_['intersection'](_0x3b9364[_0x0562('0x2d')],qs['fields'](_0x3396b6[_0x0562('0x2f')]['fields']));_0x2f1658[_0x0562('0x31')]=_0x2f1658[_0x0562('0x31')][_0x0562('0x32')]?_0x2f1658[_0x0562('0x31')]:_0x3b9364['model'];if(_0x3396b6['query'][_0x0562('0x43')]){_0x2f1658[_0x0562('0x3d')]=[{'all':!![]}];}_0x2f1658=_[_0x0562('0x39')]({},_0x2f1658,_0x3396b6[_0x0562('0x3c')]);return db['SalesforceField'][_0x0562('0x44')](_0x2f1658)[_0x0562('0x21')](handleEntityNotFound(_0x5a44fc,null))[_0x0562('0x21')](respondWithResult(_0x5a44fc,null))['catch'](handleError(_0x5a44fc,null));};exports[_0x0562('0x45')]=function(_0x5b4e38,_0x2510a0){return db[_0x0562('0x29')][_0x0562('0x45')](_0x5b4e38[_0x0562('0x46')],{})[_0x0562('0x21')](respondWithResult(_0x2510a0,0xc9))[_0x0562('0x40')](handleError(_0x2510a0,null));};exports[_0x0562('0x1f')]=function(_0x44a3ec,_0x239d63){if(_0x44a3ec['body']['id']){delete _0x44a3ec[_0x0562('0x46')]['id'];}return db[_0x0562('0x29')][_0x0562('0x44')]({'where':{'id':_0x44a3ec[_0x0562('0x41')]['id']}})[_0x0562('0x21')](handleEntityNotFound(_0x239d63,null))[_0x0562('0x21')](saveUpdates(_0x44a3ec[_0x0562('0x46')],null))[_0x0562('0x21')](respondWithResult(_0x239d63,null))['catch'](handleError(_0x239d63,null));};exports[_0x0562('0x20')]=function(_0x40ec4c,_0x57770a){return db[_0x0562('0x29')]['find']({'where':{'id':_0x40ec4c[_0x0562('0x41')]['id']}})[_0x0562('0x21')](handleEntityNotFound(_0x57770a,null))['then'](removeEntity(_0x57770a,null))[_0x0562('0x40')](handleError(_0x57770a,null));};
\ No newline at end of file
index 4da578a..bf841bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5299=['rimraf','./intSalesforceField.attributes','exports','define','SalesforceField','salesforce_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x1aab3d,_0x23f693){var _0x3054dd=function(_0x56cf19){while(--_0x56cf19){_0x1aab3d['push'](_0x1aab3d['shift']());}};_0x3054dd(++_0x23f693);}(_0x5299,0x166));var _0x9529=function(_0x4d9398,_0x5f12a3){_0x4d9398=_0x4d9398-0x0;var _0x33fa24=_0x5299[_0x4d9398];return _0x33fa24;};'use strict';var _=require(_0x9529('0x0'));var util=require('util');var logger=require(_0x9529('0x1'))(_0x9529('0x2'));var moment=require(_0x9529('0x3'));var BPromise=require(_0x9529('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9529('0x5'));var rimraf=require(_0x9529('0x6'));var config=require('../../config/environment');var attributes=require(_0x9529('0x7'));module[_0x9529('0x8')]=function(_0x127d51,_0x35180f){return _0x127d51[_0x9529('0x9')](_0x9529('0xa'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x9529('0xb'),'fields':[_0x9529('0xc'),_0x9529('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa3ef=['lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intSalesforceField.attributes','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId'];(function(_0x22dbac,_0x5ddf09){var _0x5ab6af=function(_0x859e7c){while(--_0x859e7c){_0x22dbac['push'](_0x22dbac['shift']());}};_0x5ab6af(++_0x5ddf09);}(_0xa3ef,0x87));var _0xfa3e=function(_0x1b8875,_0x4ff226){_0x1b8875=_0x1b8875-0x0;var _0x498e79=_0xa3ef[_0x1b8875];return _0x498e79;};'use strict';var _=require(_0xfa3e('0x0'));var util=require(_0xfa3e('0x1'));var logger=require(_0xfa3e('0x2'))(_0xfa3e('0x3'));var moment=require(_0xfa3e('0x4'));var BPromise=require('bluebird');var rp=require(_0xfa3e('0x5'));var fs=require('fs');var path=require(_0xfa3e('0x6'));var rimraf=require('rimraf');var config=require(_0xfa3e('0x7'));var attributes=require(_0xfa3e('0x8'));module['exports']=function(_0x11cd70,_0x5979cf){return _0x11cd70[_0xfa3e('0x9')](_0xfa3e('0xa'),attributes,{'tableName':_0xfa3e('0xb'),'paranoid':![],'indexes':[{'name':_0xfa3e('0xc'),'fields':[_0xfa3e('0xd'),_0xfa3e('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index edcd4dd..bf09f2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326a=['SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x115692,_0x128623){var _0x1eec68=function(_0x11eaa4){while(--_0x11eaa4){_0x115692['push'](_0x115692['shift']());}};_0x1eec68(++_0x128623);}(_0x326a,0x77));var _0xa326=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x326a[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0xa326('0x0'));var util=require(_0xa326('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa326('0x2'));var db=require(_0xa326('0x3'))['db'];var utils=require(_0xa326('0x4'));var logger=require('../../config/logger')(_0xa326('0x5'));var config=require('../../config/environment');var jayson=require(_0xa326('0x6'));var client=jayson[_0xa326('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22b9ce,_0x196f8a,_0x4d0992){return new BPromise(function(_0x431607,_0x49ecc9){return client[_0xa326('0x8')](_0x22b9ce,_0x4d0992)[_0xa326('0x9')](function(_0x9a1280){logger[_0xa326('0xa')](_0xa326('0xb'),_0x196f8a,_0xa326('0xc'));logger[_0xa326('0xd')](_0xa326('0xe'),_0x196f8a,_0xa326('0xc'),JSON[_0xa326('0xf')](_0x9a1280));if(_0x9a1280[_0xa326('0x10')]){if(_0x9a1280['error']['code']===0x1f4){logger[_0xa326('0x10')]('SalesforceField,\x20%s,\x20%s',_0x196f8a,_0x9a1280[_0xa326('0x10')][_0xa326('0x11')]);return _0x49ecc9(_0x9a1280[_0xa326('0x10')][_0xa326('0x11')]);}logger[_0xa326('0x10')]('SalesforceField,\x20%s,\x20%s',_0x196f8a,_0x9a1280[_0xa326('0x10')][_0xa326('0x11')]);return _0x431607(_0x9a1280[_0xa326('0x10')][_0xa326('0x11')]);}else{logger[_0xa326('0xa')](_0xa326('0xb'),_0x196f8a,_0xa326('0xc'));_0x431607(_0x9a1280['result']['message']);}})[_0xa326('0x12')](function(_0x194f31){logger[_0xa326('0x10')]('SalesforceField,\x20%s,\x20%s',_0x196f8a,_0x194f31);_0x49ecc9(_0x194f31);});});}
\ No newline at end of file
+var _0x6f4f=['message','result','catch','lodash','util','bluebird','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceField,\x20%s,\x20%s'];(function(_0x4924eb,_0x14e570){var _0x2102df=function(_0x53c32c){while(--_0x53c32c){_0x4924eb['push'](_0x4924eb['shift']());}};_0x2102df(++_0x14e570);}(_0x6f4f,0x193));var _0xf6f4=function(_0x3c8cb9,_0x250f2d){_0x3c8cb9=_0x3c8cb9-0x0;var _0x38ce3d=_0x6f4f[_0x3c8cb9];return _0x38ce3d;};'use strict';var _=require(_0xf6f4('0x0'));var util=require(_0xf6f4('0x1'));var moment=require('moment');var BPromise=require(_0xf6f4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf6f4('0x3'));var logger=require(_0xf6f4('0x4'))('rpc');var config=require(_0xf6f4('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xf6f4('0x6')][_0xf6f4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x123e47,_0x466063,_0x15beed){return new BPromise(function(_0x5c0aeb,_0x5d6b41){return client[_0xf6f4('0x8')](_0x123e47,_0x15beed)[_0xf6f4('0x9')](function(_0x131d31){logger[_0xf6f4('0xa')]('SalesforceField,\x20%s,\x20%s',_0x466063,_0xf6f4('0xb'));logger[_0xf6f4('0xc')](_0xf6f4('0xd'),_0x466063,_0xf6f4('0xb'),JSON[_0xf6f4('0xe')](_0x131d31));if(_0x131d31['error']){if(_0x131d31[_0xf6f4('0xf')]['code']===0x1f4){logger[_0xf6f4('0xf')](_0xf6f4('0x10'),_0x466063,_0x131d31[_0xf6f4('0xf')][_0xf6f4('0x11')]);return _0x5d6b41(_0x131d31[_0xf6f4('0xf')][_0xf6f4('0x11')]);}logger[_0xf6f4('0xf')](_0xf6f4('0x10'),_0x466063,_0x131d31[_0xf6f4('0xf')]['message']);return _0x5c0aeb(_0x131d31[_0xf6f4('0xf')]['message']);}else{logger[_0xf6f4('0xa')](_0xf6f4('0x10'),_0x466063,_0xf6f4('0xb'));_0x5c0aeb(_0x131d31[_0xf6f4('0x12')][_0xf6f4('0x11')]);}})[_0xf6f4('0x13')](function(_0x1ce9f8){logger[_0xf6f4('0xf')](_0xf6f4('0x10'),_0x466063,_0x1ce9f8);_0x5d6b41(_0x1ce9f8);});});}
\ No newline at end of file
index c5b0518..5c72995 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb09d=['/:id/configurations','getConfigurations','/:id/fields','getFields','addConfiguration','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','show'];(function(_0x434672,_0x178e5b){var _0x1a6d6a=function(_0x123b8f){while(--_0x123b8f){_0x434672['push'](_0x434672['shift']());}};_0x1a6d6a(++_0x178e5b);}(_0xb09d,0x171));var _0xdb09=function(_0x295614,_0x40ef59){_0x295614=_0x295614-0x0;var _0x52bf08=_0xb09d[_0x295614];return _0x52bf08;};'use strict';var multer=require('multer');var util=require(_0xdb09('0x0'));var path=require(_0xdb09('0x1'));var timeout=require(_0xdb09('0x2'));var express=require(_0xdb09('0x3'));var router=express[_0xdb09('0x4')]();var fs_extra=require(_0xdb09('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdb09('0x6'));var config=require(_0xdb09('0x7'));var controller=require('./intServicenowAccount.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xdb09('0x8')]('/:id',auth[_0xdb09('0x9')](),controller[_0xdb09('0xa')]);router[_0xdb09('0x8')](_0xdb09('0xb'),auth[_0xdb09('0x9')](),controller[_0xdb09('0xc')]);router[_0xdb09('0x8')](_0xdb09('0xd'),auth[_0xdb09('0x9')](),controller[_0xdb09('0xe')]);router['post']('/',auth[_0xdb09('0x9')](),controller['create']);router['post'](_0xdb09('0xb'),auth[_0xdb09('0x9')](),controller[_0xdb09('0xf')]);router[_0xdb09('0x10')]('/:id',auth[_0xdb09('0x9')](),controller[_0xdb09('0x11')]);router[_0xdb09('0x12')]('/:id',auth[_0xdb09('0x9')](),controller['destroy']);module[_0xdb09('0x13')]=router;
\ No newline at end of file
+var _0xcebd=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','index','get','/:id','show','/:id/configurations','isAuthenticated','getFields','post','addConfiguration','put','update','delete','destroy','multer','path','connect-timeout','express'];(function(_0x4bacb6,_0x2b299d){var _0x58c029=function(_0x2faaf5){while(--_0x2faaf5){_0x4bacb6['push'](_0x4bacb6['shift']());}};_0x58c029(++_0x2b299d);}(_0xcebd,0x15c));var _0xdceb=function(_0x21030f,_0x334383){_0x21030f=_0x21030f-0x0;var _0x2d411c=_0xcebd[_0x21030f];return _0x2d411c;};'use strict';var multer=require(_0xdceb('0x0'));var util=require('util');var path=require(_0xdceb('0x1'));var timeout=require(_0xdceb('0x2'));var express=require(_0xdceb('0x3'));var router=express['Router']();var fs_extra=require(_0xdceb('0x4'));var auth=require(_0xdceb('0x5'));var interaction=require(_0xdceb('0x6'));var config=require(_0xdceb('0x7'));var controller=require(_0xdceb('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xdceb('0x9')]);router[_0xdceb('0xa')](_0xdceb('0xb'),auth['isAuthenticated'](),controller[_0xdceb('0xc')]);router[_0xdceb('0xa')](_0xdceb('0xd'),auth[_0xdceb('0xe')](),controller['getConfigurations']);router[_0xdceb('0xa')]('/:id/fields',auth[_0xdceb('0xe')](),controller[_0xdceb('0xf')]);router['post']('/',auth[_0xdceb('0xe')](),controller['create']);router[_0xdceb('0x10')]('/:id/configurations',auth[_0xdceb('0xe')](),controller[_0xdceb('0x11')]);router[_0xdceb('0x12')](_0xdceb('0xb'),auth['isAuthenticated'](),controller[_0xdceb('0x13')]);router[_0xdceb('0x14')](_0xdceb('0xb'),auth[_0xdceb('0xe')](),controller[_0xdceb('0x15')]);module['exports']=router;
\ No newline at end of file
index fad8a4a..58430b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28c0=['username','remoteUri','sequelize','exports','STRING'];(function(_0x477a50,_0x282b53){var _0xa4c6b6=function(_0x2cc1f2){while(--_0x2cc1f2){_0x477a50['push'](_0x477a50['shift']());}};_0xa4c6b6(++_0x282b53);}(_0x28c0,0x101));var _0x028c=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x28c0[_0x8c43de];return _0xa6591b;};'use strict';var Sequelize=require(_0x028c('0x0'));module[_0x028c('0x1')]={'name':{'type':Sequelize[_0x028c('0x2')]},'description':{'type':Sequelize[_0x028c('0x2')]},'username':{'type':Sequelize[_0x028c('0x2')],'unique':_0x028c('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x028c('0x2')]},'remoteUri':{'type':Sequelize[_0x028c('0x2')],'unique':_0x028c('0x4')},'serverUrl':{'type':Sequelize[_0x028c('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xbb29=['username','remoteUri','sequelize','STRING'];(function(_0x172948,_0x4262cc){var _0x4aeaa9=function(_0x5ec4b3){while(--_0x5ec4b3){_0x172948['push'](_0x172948['shift']());}};_0x4aeaa9(++_0x4262cc);}(_0xbb29,0xee));var _0x9bb2=function(_0x526dd8,_0x4fd4e8){_0x526dd8=_0x526dd8-0x0;var _0x2a4124=_0xbb29[_0x526dd8];return _0x2a4124;};'use strict';var Sequelize=require(_0x9bb2('0x0'));module['exports']={'name':{'type':Sequelize[_0x9bb2('0x1')]},'description':{'type':Sequelize[_0x9bb2('0x1')]},'username':{'type':Sequelize[_0x9bb2('0x1')],'unique':_0x9bb2('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x9bb2('0x1')],'unique':_0x9bb2('0x3')},'serverUrl':{'type':Sequelize[_0x9bb2('0x1')],'allowNull':![]}};
\ No newline at end of file
index 536e06d..18936bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb87d=['order','sort','where','pick','filter','type','VIRTUAL','merge','then','includeAll','findAll','catch','show','params','include','options','find','create','body','update','getConfigurations','ServicenowConfiguration','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','ServicenowField','getFields','knowledge','subcategory','notify','severity','category','caused_by','watch_list','sys_updated_on','child_incidents','hold_reason','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','state','sys_created_by','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','expected_start','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','close_code','delivery_task','work_start','assignment_group','description','sys_class_name','parent_incident','sys_id','incident_state','urgency','problem_id','reassignment_count','activity_due','assigned_to','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','correlation_id','password','email','remoteUri','serverUrl','slice','substring','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','assign','remove','forEach','label','push','all','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','concat','test','statusCode','error','Wrong\x20credentials','boolean','True','true','False','false','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','destroy','stack','name','send','index','ServicenowAccount','rawAttributes','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty'];(function(_0x3a16d4,_0x23ecda){var _0x31ea9c=function(_0x35fea8){while(--_0x35fea8){_0x3a16d4['push'](_0x3a16d4['shift']());}};_0x31ea9c(++_0x23ecda);}(_0xb87d,0x12f));var _0xdb87=function(_0xc02b50,_0x36ae25){_0xc02b50=_0xc02b50-0x0;var _0xc56de1=_0xb87d[_0xc02b50];return _0xc56de1;};'use strict';var emlformat=require(_0xdb87('0x0'));var rimraf=require(_0xdb87('0x1'));var zipdir=require(_0xdb87('0x2'));var jsonpatch=require(_0xdb87('0x3'));var rp=require(_0xdb87('0x4'));var moment=require(_0xdb87('0x5'));var BPromise=require(_0xdb87('0x6'));var Mustache=require(_0xdb87('0x7'));var util=require(_0xdb87('0x8'));var path=require(_0xdb87('0x9'));var sox=require(_0xdb87('0xa'));var csv=require(_0xdb87('0xb'));var ejs=require(_0xdb87('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdb87('0xd'));var squel=require(_0xdb87('0xe'));var crypto=require(_0xdb87('0xf'));var jsforce=require(_0xdb87('0x10'));var deskjs=require(_0xdb87('0x11'));var toCsv=require(_0xdb87('0xb'));var querystring=require(_0xdb87('0x12'));var Papa=require(_0xdb87('0x13'));var Redis=require(_0xdb87('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xdb87('0x15'));var as=require(_0xdb87('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb87('0x17'))(_0xdb87('0x18'));var utils=require(_0xdb87('0x19'));var config=require(_0xdb87('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x20189d,_0x520a6a){_0x520a6a=_0x520a6a||0xcc;return function(_0x13b140){if(_0x13b140){return _0x20189d[_0xdb87('0x1b')](_0x520a6a);}return _0x20189d[_0xdb87('0x1c')](_0x520a6a)[_0xdb87('0x1d')]();};}function respondWithResult(_0x403b40,_0x515a2a){_0x515a2a=_0x515a2a||0xc8;return function(_0x120040){if(_0x120040){return _0x403b40['status'](_0x515a2a)[_0xdb87('0x1e')](_0x120040);}};}function respondWithFilteredResult(_0x3e3430,_0x133e68){return function(_0x3197b4){if(_0x3197b4){var _0x195b58=typeof _0x133e68[_0xdb87('0x1f')]===_0xdb87('0x20')&&typeof _0x133e68[_0xdb87('0x21')]===_0xdb87('0x20');var _0x5034bb=_0x3197b4[_0xdb87('0x22')];var _0x8019f=_0x195b58?0x0:_0x133e68[_0xdb87('0x1f')];var _0x31fc10=_0x195b58?_0x3197b4[_0xdb87('0x22')]:_0x133e68[_0xdb87('0x1f')]+_0x133e68[_0xdb87('0x21')];var _0x51f1af;if(_0x31fc10>=_0x5034bb){_0x31fc10=_0x5034bb;_0x51f1af=0xc8;}else{_0x51f1af=0xce;}_0x3e3430[_0xdb87('0x1c')](_0x51f1af);return _0x3e3430[_0xdb87('0x23')]('Content-Range',_0x8019f+'-'+_0x31fc10+'/'+_0x5034bb)[_0xdb87('0x1e')](_0x3197b4);}return null;};}function patchUpdates(_0x5b01b0){return function(_0x44d562){try{jsonpatch[_0xdb87('0x24')](_0x44d562,_0x5b01b0,!![]);}catch(_0xb9941f){return BPromise[_0xdb87('0x25')](_0xb9941f);}return _0x44d562[_0xdb87('0x26')]();};}function saveUpdates(_0x386b85,_0x4468dc){return function(_0x388ea9){if(_0x388ea9){return _0x388ea9['update'](_0x386b85)['then'](function(_0x40db78){return _0x40db78;});}return null;};}function removeEntity(_0x357a18,_0x115d70){return function(_0x2e5da1){if(_0x2e5da1){return _0x2e5da1[_0xdb87('0x27')]()['then'](function(){_0x357a18[_0xdb87('0x1c')](0xcc)[_0xdb87('0x1d')]();});}};}function handleEntityNotFound(_0x49a6cb,_0x4e4f70){return function(_0x2fbabf){if(!_0x2fbabf){_0x49a6cb[_0xdb87('0x1b')](0x194);}return _0x2fbabf;};}function handleError(_0x46f555,_0x55a5dd){_0x55a5dd=_0x55a5dd||0x1f4;return function(_0x182c66){logger['error'](_0x182c66[_0xdb87('0x28')]);if(_0x182c66[_0xdb87('0x29')]){delete _0x182c66[_0xdb87('0x29')];}_0x46f555[_0xdb87('0x1c')](_0x55a5dd)[_0xdb87('0x2a')](_0x182c66);};}exports[_0xdb87('0x2b')]=function(_0x2c8153,_0x58fb95){var _0x4792d5={},_0xa640a5={},_0x2433fa={'count':0x0,'rows':[]};var _0x3fc99e=_['map'](db[_0xdb87('0x2c')][_0xdb87('0x2d')],function(_0x11df59){return{'name':_0x11df59['fieldName'],'type':_0x11df59['type'][_0xdb87('0x2e')]};});_0xa640a5['model']=_[_0xdb87('0x2f')](_0x3fc99e,_0xdb87('0x29'));_0xa640a5[_0xdb87('0x30')]=_[_0xdb87('0x31')](_0x2c8153[_0xdb87('0x30')]);_0xa640a5[_0xdb87('0x32')]=_[_0xdb87('0x33')](_0xa640a5['model'],_0xa640a5[_0xdb87('0x30')]);_0x4792d5[_0xdb87('0x34')]=_['intersection'](_0xa640a5[_0xdb87('0x35')],qs[_0xdb87('0x36')](_0x2c8153[_0xdb87('0x30')]['fields']));_0x4792d5[_0xdb87('0x34')]=_0x4792d5[_0xdb87('0x34')][_0xdb87('0x37')]?_0x4792d5[_0xdb87('0x34')]:_0xa640a5['model'];if(!_0x2c8153[_0xdb87('0x30')][_0xdb87('0x38')]('nolimit')){_0x4792d5[_0xdb87('0x21')]=qs[_0xdb87('0x21')](_0x2c8153[_0xdb87('0x30')][_0xdb87('0x21')]);_0x4792d5[_0xdb87('0x1f')]=qs[_0xdb87('0x1f')](_0x2c8153['query'][_0xdb87('0x1f')]);}_0x4792d5[_0xdb87('0x39')]=qs['sort'](_0x2c8153[_0xdb87('0x30')][_0xdb87('0x3a')]);_0x4792d5[_0xdb87('0x3b')]=qs[_0xdb87('0x32')](_[_0xdb87('0x3c')](_0x2c8153['query'],_0xa640a5[_0xdb87('0x32')]),_0x3fc99e);if(_0x2c8153[_0xdb87('0x30')][_0xdb87('0x3d')]){_0x4792d5[_0xdb87('0x3b')]=_['merge'](_0x4792d5[_0xdb87('0x3b')],{'$or':_[_0xdb87('0x2f')](_0x3fc99e,function(_0xb6e2c1){if(_0xb6e2c1[_0xdb87('0x3e')]!==_0xdb87('0x3f')){var _0x32075b={};_0x32075b[_0xb6e2c1[_0xdb87('0x29')]]={'$like':'%'+_0x2c8153['query'][_0xdb87('0x3d')]+'%'};return _0x32075b;}})});}_0x4792d5=_[_0xdb87('0x40')]({},_0x4792d5,_0x2c8153['options']);var _0x56a058={'where':_0x4792d5[_0xdb87('0x3b')]};return db[_0xdb87('0x2c')]['count'](_0x56a058)[_0xdb87('0x41')](function(_0x58c7ec){_0x2433fa[_0xdb87('0x22')]=_0x58c7ec;if(_0x2c8153[_0xdb87('0x30')][_0xdb87('0x42')]){_0x4792d5['include']=[{'all':!![]}];}return db[_0xdb87('0x2c')][_0xdb87('0x43')](_0x4792d5);})[_0xdb87('0x41')](function(_0x4c254c){_0x2433fa['rows']=_0x4c254c;return _0x2433fa;})[_0xdb87('0x41')](respondWithFilteredResult(_0x58fb95,_0x4792d5))[_0xdb87('0x44')](handleError(_0x58fb95,null));};exports[_0xdb87('0x45')]=function(_0x50bd71,_0x12dea6){var _0x4d2d94={'raw':![],'where':{'id':_0x50bd71[_0xdb87('0x46')]['id']}},_0x140acf={};_0x140acf[_0xdb87('0x35')]=_[_0xdb87('0x31')](db[_0xdb87('0x2c')][_0xdb87('0x2d')]);_0x140acf['query']=_[_0xdb87('0x31')](_0x50bd71[_0xdb87('0x30')]);_0x140acf[_0xdb87('0x32')]=_['intersection'](_0x140acf[_0xdb87('0x35')],_0x140acf[_0xdb87('0x30')]);_0x4d2d94['attributes']=_['intersection'](_0x140acf[_0xdb87('0x35')],qs[_0xdb87('0x36')](_0x50bd71[_0xdb87('0x30')][_0xdb87('0x36')]));_0x4d2d94['attributes']=_0x4d2d94[_0xdb87('0x34')][_0xdb87('0x37')]?_0x4d2d94[_0xdb87('0x34')]:_0x140acf['model'];if(_0x50bd71[_0xdb87('0x30')]['includeAll']){_0x4d2d94[_0xdb87('0x47')]=[{'all':!![]}];}_0x4d2d94=_['merge']({},_0x4d2d94,_0x50bd71[_0xdb87('0x48')]);return db[_0xdb87('0x2c')][_0xdb87('0x49')](_0x4d2d94)[_0xdb87('0x41')](handleEntityNotFound(_0x12dea6,null))[_0xdb87('0x41')](respondWithResult(_0x12dea6,null))[_0xdb87('0x44')](handleError(_0x12dea6,null));};exports[_0xdb87('0x4a')]=function(_0x1bfdeb,_0x5e605c){return db[_0xdb87('0x2c')][_0xdb87('0x4a')](_0x1bfdeb[_0xdb87('0x4b')],{})['then'](respondWithResult(_0x5e605c,0xc9))[_0xdb87('0x44')](handleError(_0x5e605c,null));};exports[_0xdb87('0x4c')]=function(_0xaae9ff,_0x125847){if(_0xaae9ff['body']['id']){delete _0xaae9ff[_0xdb87('0x4b')]['id'];}return db[_0xdb87('0x2c')][_0xdb87('0x49')]({'where':{'id':_0xaae9ff['params']['id']}})['then'](handleEntityNotFound(_0x125847,null))['then'](saveUpdates(_0xaae9ff[_0xdb87('0x4b')],null))[_0xdb87('0x41')](respondWithResult(_0x125847,null))['catch'](handleError(_0x125847,null));};exports[_0xdb87('0x27')]=function(_0x205b85,_0x30f200){return db['ServicenowAccount'][_0xdb87('0x49')]({'where':{'id':_0x205b85[_0xdb87('0x46')]['id']}})['then'](handleEntityNotFound(_0x30f200,null))[_0xdb87('0x41')](removeEntity(_0x30f200,null))[_0xdb87('0x44')](handleError(_0x30f200,null));};exports[_0xdb87('0x4d')]=function(_0x104c36,_0x22aaf1,_0x19ec2c){var _0x1f76cf={};var _0x56fcfe={};var _0x29e04f;var _0x561a7e;return db[_0xdb87('0x2c')]['findOne']({'where':{'id':_0x104c36[_0xdb87('0x46')]['id']}})[_0xdb87('0x41')](handleEntityNotFound(_0x22aaf1,null))[_0xdb87('0x41')](function(_0x53ceca){if(_0x53ceca){_0x29e04f=_0x53ceca;_0x56fcfe[_0xdb87('0x35')]=_['keys'](db[_0xdb87('0x4e')][_0xdb87('0x2d')]);_0x56fcfe[_0xdb87('0x30')]=_[_0xdb87('0x31')](_0x104c36[_0xdb87('0x30')]);_0x56fcfe[_0xdb87('0x32')]=_[_0xdb87('0x33')](_0x56fcfe[_0xdb87('0x35')],_0x56fcfe[_0xdb87('0x30')]);_0x1f76cf[_0xdb87('0x34')]=_['intersection'](_0x56fcfe['model'],qs[_0xdb87('0x36')](_0x104c36['query'][_0xdb87('0x36')]));_0x1f76cf[_0xdb87('0x34')]=_0x1f76cf['attributes'][_0xdb87('0x37')]?_0x1f76cf[_0xdb87('0x34')]:_0x56fcfe[_0xdb87('0x35')];_0x1f76cf[_0xdb87('0x39')]=qs[_0xdb87('0x3a')](_0x104c36[_0xdb87('0x30')]['sort']);_0x1f76cf[_0xdb87('0x3b')]=qs[_0xdb87('0x32')](_[_0xdb87('0x3c')](_0x104c36[_0xdb87('0x30')],_0x56fcfe[_0xdb87('0x32')]));if(_0x104c36[_0xdb87('0x30')]['filter']){_0x1f76cf[_0xdb87('0x3b')]=_['merge'](_0x1f76cf[_0xdb87('0x3b')],{'$or':_[_0xdb87('0x2f')](_0x1f76cf['attributes'],function(_0x1a5e25){var _0x3058d={};_0x3058d[_0x1a5e25]={'$like':'%'+_0x104c36[_0xdb87('0x30')][_0xdb87('0x3d')]+'%'};return _0x3058d;})});}_0x1f76cf=_[_0xdb87('0x40')]({},_0x1f76cf,_0x104c36[_0xdb87('0x48')]);return _0x29e04f[_0xdb87('0x4d')](_0x1f76cf);}})[_0xdb87('0x41')](function(_0x4c841f){if(_0x4c841f){_0x561a7e=_0x4c841f['length'];if(!_0x104c36[_0xdb87('0x30')][_0xdb87('0x38')](_0xdb87('0x4f'))){_0x1f76cf['limit']=qs['limit'](_0x104c36['query'][_0xdb87('0x21')]);_0x1f76cf[_0xdb87('0x1f')]=qs[_0xdb87('0x1f')](_0x104c36[_0xdb87('0x30')]['offset']);}return _0x29e04f['getConfigurations'](_0x1f76cf);}})[_0xdb87('0x41')](function(_0x5f2688){if(_0x5f2688){return _0x5f2688?{'count':_0x561a7e,'rows':_0x5f2688}:null;}})[_0xdb87('0x41')](respondWithResult(_0x22aaf1,null))[_0xdb87('0x44')](handleError(_0x22aaf1,null));};exports[_0xdb87('0x50')]=function(_0x3169fc,_0x6404e9,_0x72f773){if(_0x3169fc[_0xdb87('0x4b')]['id']){delete _0x3169fc['body']['id'];}return db[_0xdb87('0x2c')][_0xdb87('0x51')]({'where':{'id':_0x3169fc[_0xdb87('0x46')]['id']}})[_0xdb87('0x41')](handleEntityNotFound(_0x6404e9,null))[_0xdb87('0x41')](function(_0x24f3e3){if(_0x24f3e3){_0x3169fc[_0xdb87('0x4b')][_0xdb87('0x52')]=_0x24f3e3['id'];_0x3169fc[_0xdb87('0x4b')][_0xdb87('0x53')]=integrations[_0xdb87('0x54')](_0x3169fc['body']['channel'],_0x3169fc['body']['type']);_0x3169fc[_0xdb87('0x4b')][_0xdb87('0x55')]=integrations[_0xdb87('0x56')](_0x3169fc[_0xdb87('0x4b')]['channel'],_0x3169fc[_0xdb87('0x4b')]['type']);return db[_0xdb87('0x4e')][_0xdb87('0x4a')](_0x3169fc[_0xdb87('0x4b')],{'include':[{'model':db[_0xdb87('0x57')],'as':'Subjects'},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})[_0xdb87('0x41')](respondWithResult(_0x6404e9,null))['catch'](handleError(_0x6404e9,null));};exports[_0xdb87('0x58')]=function(_0x465db7,_0x36d9c4,_0x14a078){var _0x166a68=['made_sla','hold_reason',_0xdb87('0x59'),_0xdb87('0x5a'),'close_code',_0xdb87('0x5b'),'incident_state',_0xdb87('0x5c'),_0xdb87('0x5d')];var _0x1a5de3=['parent','made_sla',_0xdb87('0x5e'),_0xdb87('0x5f'),'upon_reject',_0xdb87('0x60'),_0xdb87('0x61'),_0xdb87('0x62'),_0xdb87('0x63'),_0xdb87('0x64'),_0xdb87('0x65'),_0xdb87('0x66'),_0xdb87('0x67'),_0xdb87('0x68'),_0xdb87('0x69'),'sys_domain',_0xdb87('0x6a'),_0xdb87('0x6b'),_0xdb87('0x59'),_0xdb87('0x39'),'calendar_stc','closed_at',_0xdb87('0x6c'),_0xdb87('0x6d'),_0xdb87('0x6e'),_0xdb87('0x6f'),_0xdb87('0x70'),_0xdb87('0x71'),_0xdb87('0x72'),_0xdb87('0x73'),_0xdb87('0x74'),'time_worked',_0xdb87('0x75'),'opened_at',_0xdb87('0x76'),_0xdb87('0x77'),_0xdb87('0x78'),_0xdb87('0x79'),_0xdb87('0x7a'),_0xdb87('0x7b'),_0xdb87('0x7c'),'subcategory',_0xdb87('0x7d'),_0xdb87('0x7e'),_0xdb87('0x7f'),'correlation_display',_0xdb87('0x80'),_0xdb87('0x81'),_0xdb87('0x82'),'business_stc','additional_assignee_list',_0xdb87('0x83'),'calendar_duration','notify',_0xdb87('0x84'),'close_notes','closed_by','follow_up',_0xdb87('0x85'),_0xdb87('0x86'),'contact_type','reopened_by',_0xdb87('0x87'),_0xdb87('0x88'),_0xdb87('0x89'),'company',_0xdb87('0x8a'),_0xdb87('0x8b'),_0xdb87('0x8c'),_0xdb87('0x5c'),_0xdb87('0x8d'),'sla_due',_0xdb87('0x8e'),_0xdb87('0x8f'),_0xdb87('0x90'),_0xdb87('0x91'),_0xdb87('0x92'),_0xdb87('0x93'),'escalation','upon_approval',_0xdb87('0x94'),'location',_0xdb87('0x5d')];var _0x2898a2='';var _0x555823='';var _0x32309b=[];var _0x16d8a8='';var _0x3519fa='';var _0x16e968=[];var _0x414e7f='';var _0x2d7cb2='';var _0x4190bd={};var _0x4e1c1f='';return db[_0xdb87('0x2c')][_0xdb87('0x51')]({'where':{'id':_0x465db7[_0xdb87('0x46')]['id']},'attributes':['id','username',_0xdb87('0x95'),_0xdb87('0x96'),_0xdb87('0x97'),_0xdb87('0x98')]})['then'](handleEntityNotFound(_0x36d9c4,null))['then'](function(_0x2004a4){if(_0x2004a4){_0x4e1c1f=_0x2004a4['remoteUri'];var _0x4de425=_0x4e1c1f[_0xdb87('0x99')](-0x1);if(_0x4de425==='/'){_0x4e1c1f=_0x4e1c1f[_0xdb87('0x9a')](0x0,_0x4e1c1f['lastIndexOf'](_0x4de425));}_0x2d7cb2=util[_0xdb87('0x9b')]('%s/api/now/doc/table/schema/',_0x4e1c1f);_0x414e7f=util[_0xdb87('0x9b')](_0xdb87('0x9c'),_0x4e1c1f);_0x4190bd={'user':_0x2004a4['username'],'pass':_0x2004a4[_0xdb87('0x95')]};var _0x3e667a={'method':_0xdb87('0x9d'),'uri':_0x2d7cb2+_0xdb87('0x9e'),'auth':_0x4190bd,'json':!![]};return rp(_0x3e667a);}})[_0xdb87('0x41')](function(_0x1834ec){if(_0x1834ec[_0xdb87('0x9f')]['length']>0x0){_0x2898a2=_0x1834ec['result'];}console[_0xdb87('0xa0')]('incident\x20table\x20objects',_0x2898a2);_0x16e968=[];_0x555823=Object[_0xdb87('0xa1')]([],_0x2898a2);_[_0xdb87('0xa2')](_0x555823,function(_0x18f9e9){return!_0x166a68['includes'](_0x18f9e9[_0xdb87('0x29')]);});_0x555823[_0xdb87('0xa3')](function(_0x46b54d){var _0x38f36f=createFieldObject(_0x414e7f,_0x4190bd,_0x46b54d['internalType'],_0x46b54d['name'],_0x46b54d[_0xdb87('0xa4')],![]);_0x16e968[_0xdb87('0xa5')](_0x38f36f);});return Promise[_0xdb87('0xa6')](_0x16e968);})[_0xdb87('0x41')](function(_0x5a3ceb){_0x32309b=_0x5a3ceb;_0x16d8a8=Object[_0xdb87('0xa1')]([],_0x2898a2);console[_0xdb87('0xa0')]('TCL:\x20_object',_0x2898a2);_['remove'](_0x16d8a8,function(_0x4c7755){return _0x1a5de3[_0xdb87('0xa7')](_0x4c7755[_0xdb87('0x29')]);});console['log'](_0xdb87('0xa8'),_0x16d8a8);_0x16e968=[];_0x16d8a8[_0xdb87('0xa3')](function(_0x2b2083){var _0x15aa72=createFieldObject(_0x414e7f,_0x4190bd,_0x2b2083[_0xdb87('0xa9')],_0x2b2083['name'],_0x2b2083[_0xdb87('0xa4')],!![]);_0x16e968[_0xdb87('0xa5')](_0x15aa72);});return Promise['all'](_0x16e968);})[_0xdb87('0x41')](function(_0x145de0){_0x3519fa=_0x145de0;var _0x4255aa=_0x32309b[_0xdb87('0xaa')](_0x3519fa);return{'count':_0x4255aa[_0xdb87('0x37')],'rows':_0x4255aa};})[_0xdb87('0x41')](respondWithResult(_0x36d9c4,null))['catch'](function(_0x35e859){console[_0xdb87('0xa0')]('ServiceNow\x20error:\x20'+_0x35e859);var _0x194f0c=_0x465db7[_0xdb87('0x30')][_0xdb87('0xab')]?0x1f4:_0x35e859[_0xdb87('0xac')]||0x1f4;logger[_0xdb87('0xad')](_0x35e859[_0xdb87('0x28')]);delete _0x35e859[_0xdb87('0x29')];if(_0x194f0c===0x191){_0x194f0c=0x190;}_0x36d9c4[_0xdb87('0x1c')](_0x194f0c)[_0xdb87('0x2a')](_0x465db7[_0xdb87('0x30')][_0xdb87('0xab')]?{'message':_0xdb87('0xae'),'statusCode':_0x35e859['statusCode']}:_0x35e859);});};function createFieldObject(_0x2c8e21,_0x3f4afd,_0x1ec37e,_0x3c6b47,_0x3b2c83,_0x386cf2){return new Promise(function(_0x459192,_0x5d394b){var _0xca894d={'id':_0x3c6b47,'name':_0x3b2c83,'custom':_0x386cf2};if(_0x1ec37e===_0xdb87('0xaf')){_0xca894d['options']=[{'name':_0xdb87('0xb0'),'value':_0xdb87('0xb1')},{'name':_0xdb87('0xb2'),'value':_0xdb87('0xb3')}];_0x459192(_0xca894d);}else{var _0xefe092={'method':'GET','uri':_0x2c8e21+'sys_choice?sysparm_query=name=incident^element='+_0x3c6b47,'auth':_0x3f4afd,'json':!![]};return rp(_0xefe092)[_0xdb87('0x41')](function(_0x1afe55){var _0xc265a3=[];if(_0x1afe55[_0xdb87('0x9f')][_0xdb87('0x37')]>0x0){_0x1afe55[_0xdb87('0x9f')][_0xdb87('0xa3')](function(_0x3b0580){if(_0x3b0580['inactive']===_0xdb87('0xb3')){var _0x5f0a14={'name':_0x3b0580[_0xdb87('0xa4')],'value':_0x3b0580['value']};_0xc265a3[_0xdb87('0xa5')](_0x5f0a14);}});}_0xca894d[_0xdb87('0x48')]=_0xc265a3;if(_0xca894d[_0xdb87('0x48')][_0xdb87('0x37')]>0x0){_0x459192(_0xca894d);}else{if(_0x386cf2==![]){_0x459192();}else{_0x459192(_0xca894d);}}});}});}
\ No newline at end of file
+var _0x1cbb=['correlation_id','category','username','password','email','serverUrl','remoteUri','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','forEach','label','push','all','log','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','True','true','False','sys_choice?sysparm_query=name=incident^element=','inactive','false','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','limit','undefined','count','offset','Content-Range','json','apply','update','then','destroy','error','stack','name','send','map','ServicenowAccount','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','getSubjects','channel','type','Descriptions','getDescriptions','ServicenowField','made_sla','hold_reason','knowledge','close_code','notify','severity','parent','watch_list','child_incidents','approval_history','number','sys_updated_by','opened_by','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','rfc','business_duration','group_list','work_end','reopened_time','resolved_at','approval_set','subcategory','work_notes','short_description','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','description','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','incident_state','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval'];(function(_0x5c0687,_0x315fac){var _0x2b4f12=function(_0x51cc58){while(--_0x51cc58){_0x5c0687['push'](_0x5c0687['shift']());}};_0x2b4f12(++_0x315fac);}(_0x1cbb,0xe1));var _0xb1cb=function(_0x2eed08,_0x2f15a8){_0x2eed08=_0x2eed08-0x0;var _0x509030=_0x1cbb[_0x2eed08];return _0x509030;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb1cb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb1cb('0x1'));var rp=require(_0xb1cb('0x2'));var moment=require(_0xb1cb('0x3'));var BPromise=require(_0xb1cb('0x4'));var Mustache=require(_0xb1cb('0x5'));var util=require(_0xb1cb('0x6'));var path=require(_0xb1cb('0x7'));var sox=require(_0xb1cb('0x8'));var csv=require('to-csv');var ejs=require(_0xb1cb('0x9'));var fs=require('fs');var fs_extra=require(_0xb1cb('0xa'));var _=require(_0xb1cb('0xb'));var squel=require(_0xb1cb('0xc'));var crypto=require(_0xb1cb('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb1cb('0xe'));var querystring=require(_0xb1cb('0xf'));var Papa=require(_0xb1cb('0x10'));var Redis=require('ioredis');var authService=require(_0xb1cb('0x11'));var qs=require(_0xb1cb('0x12'));var as=require(_0xb1cb('0x13'));var hardwareService=require(_0xb1cb('0x14'));var logger=require(_0xb1cb('0x15'))('api');var utils=require(_0xb1cb('0x16'));var config=require(_0xb1cb('0x17'));var licenseUtil=require(_0xb1cb('0x18'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x50aac4,_0x2be9ea){_0x2be9ea=_0x2be9ea||0xcc;return function(_0x36b583){if(_0x36b583){return _0x50aac4[_0xb1cb('0x19')](_0x2be9ea);}return _0x50aac4[_0xb1cb('0x1a')](_0x2be9ea)['end']();};}function respondWithResult(_0x1cf73a,_0x6d1167){_0x6d1167=_0x6d1167||0xc8;return function(_0x4b1f6d){if(_0x4b1f6d){return _0x1cf73a[_0xb1cb('0x1a')](_0x6d1167)['json'](_0x4b1f6d);}};}function respondWithFilteredResult(_0xa800ce,_0x18d972){return function(_0x437637){if(_0x437637){var _0x26b3df=typeof _0x18d972['offset']==='undefined'&&typeof _0x18d972[_0xb1cb('0x1b')]===_0xb1cb('0x1c');var _0x258268=_0x437637[_0xb1cb('0x1d')];var _0x1a4527=_0x26b3df?0x0:_0x18d972['offset'];var _0x58e9ed=_0x26b3df?_0x437637[_0xb1cb('0x1d')]:_0x18d972[_0xb1cb('0x1e')]+_0x18d972['limit'];var _0x43d847;if(_0x58e9ed>=_0x258268){_0x58e9ed=_0x258268;_0x43d847=0xc8;}else{_0x43d847=0xce;}_0xa800ce[_0xb1cb('0x1a')](_0x43d847);return _0xa800ce['set'](_0xb1cb('0x1f'),_0x1a4527+'-'+_0x58e9ed+'/'+_0x258268)[_0xb1cb('0x20')](_0x437637);}return null;};}function patchUpdates(_0x33f6f3){return function(_0x33c641){try{jsonpatch[_0xb1cb('0x21')](_0x33c641,_0x33f6f3,!![]);}catch(_0x5ec051){return BPromise['reject'](_0x5ec051);}return _0x33c641['save']();};}function saveUpdates(_0xd25b3a,_0x18aca3){return function(_0x51b0e5){if(_0x51b0e5){return _0x51b0e5[_0xb1cb('0x22')](_0xd25b3a)[_0xb1cb('0x23')](function(_0x1163a5){return _0x1163a5;});}return null;};}function removeEntity(_0x201e9b,_0x2e2ac0){return function(_0x3dd918){if(_0x3dd918){return _0x3dd918[_0xb1cb('0x24')]()[_0xb1cb('0x23')](function(){_0x201e9b[_0xb1cb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x396c19,_0x49744b){return function(_0x18aa31){if(!_0x18aa31){_0x396c19[_0xb1cb('0x19')](0x194);}return _0x18aa31;};}function handleError(_0x531843,_0x3b360f){_0x3b360f=_0x3b360f||0x1f4;return function(_0x45e8b9){logger[_0xb1cb('0x25')](_0x45e8b9[_0xb1cb('0x26')]);if(_0x45e8b9[_0xb1cb('0x27')]){delete _0x45e8b9['name'];}_0x531843[_0xb1cb('0x1a')](_0x3b360f)[_0xb1cb('0x28')](_0x45e8b9);};}exports['index']=function(_0x5f1597,_0x410154){var _0x3e372b={},_0x1e3864={},_0x5a6ec0={'count':0x0,'rows':[]};var _0x24a22b=_[_0xb1cb('0x29')](db[_0xb1cb('0x2a')][_0xb1cb('0x2b')],function(_0x5bc2e6){return{'name':_0x5bc2e6[_0xb1cb('0x2c')],'type':_0x5bc2e6['type'][_0xb1cb('0x2d')]};});_0x1e3864[_0xb1cb('0x2e')]=_['map'](_0x24a22b,'name');_0x1e3864[_0xb1cb('0x2f')]=_[_0xb1cb('0x30')](_0x5f1597[_0xb1cb('0x2f')]);_0x1e3864[_0xb1cb('0x31')]=_['intersection'](_0x1e3864['model'],_0x1e3864[_0xb1cb('0x2f')]);_0x3e372b[_0xb1cb('0x32')]=_[_0xb1cb('0x33')](_0x1e3864[_0xb1cb('0x2e')],qs[_0xb1cb('0x34')](_0x5f1597[_0xb1cb('0x2f')][_0xb1cb('0x34')]));_0x3e372b[_0xb1cb('0x32')]=_0x3e372b[_0xb1cb('0x32')][_0xb1cb('0x35')]?_0x3e372b[_0xb1cb('0x32')]:_0x1e3864[_0xb1cb('0x2e')];if(!_0x5f1597['query'][_0xb1cb('0x36')](_0xb1cb('0x37'))){_0x3e372b[_0xb1cb('0x1b')]=qs['limit'](_0x5f1597[_0xb1cb('0x2f')][_0xb1cb('0x1b')]);_0x3e372b[_0xb1cb('0x1e')]=qs[_0xb1cb('0x1e')](_0x5f1597['query']['offset']);}_0x3e372b[_0xb1cb('0x38')]=qs[_0xb1cb('0x39')](_0x5f1597[_0xb1cb('0x2f')][_0xb1cb('0x39')]);_0x3e372b[_0xb1cb('0x3a')]=qs[_0xb1cb('0x31')](_[_0xb1cb('0x3b')](_0x5f1597[_0xb1cb('0x2f')],_0x1e3864['filters']),_0x24a22b);if(_0x5f1597[_0xb1cb('0x2f')][_0xb1cb('0x3c')]){_0x3e372b[_0xb1cb('0x3a')]=_[_0xb1cb('0x3d')](_0x3e372b[_0xb1cb('0x3a')],{'$or':_[_0xb1cb('0x29')](_0x24a22b,function(_0x2a29e4){if(_0x2a29e4['type']!==_0xb1cb('0x3e')){var _0x5c1ab2={};_0x5c1ab2[_0x2a29e4[_0xb1cb('0x27')]]={'$like':'%'+_0x5f1597[_0xb1cb('0x2f')]['filter']+'%'};return _0x5c1ab2;}})});}_0x3e372b=_['merge']({},_0x3e372b,_0x5f1597[_0xb1cb('0x3f')]);var _0x3f79ec={'where':_0x3e372b['where']};return db[_0xb1cb('0x2a')][_0xb1cb('0x1d')](_0x3f79ec)[_0xb1cb('0x23')](function(_0x318f68){_0x5a6ec0[_0xb1cb('0x1d')]=_0x318f68;if(_0x5f1597['query'][_0xb1cb('0x40')]){_0x3e372b[_0xb1cb('0x41')]=[{'all':!![]}];}return db[_0xb1cb('0x2a')][_0xb1cb('0x42')](_0x3e372b);})[_0xb1cb('0x23')](function(_0x1b24b3){_0x5a6ec0[_0xb1cb('0x43')]=_0x1b24b3;return _0x5a6ec0;})[_0xb1cb('0x23')](respondWithFilteredResult(_0x410154,_0x3e372b))[_0xb1cb('0x44')](handleError(_0x410154,null));};exports[_0xb1cb('0x45')]=function(_0x57d8cf,_0x15d12f){var _0x7e0368={'raw':![],'where':{'id':_0x57d8cf[_0xb1cb('0x46')]['id']}},_0x577fa5={};_0x577fa5[_0xb1cb('0x2e')]=_[_0xb1cb('0x30')](db[_0xb1cb('0x2a')]['rawAttributes']);_0x577fa5[_0xb1cb('0x2f')]=_[_0xb1cb('0x30')](_0x57d8cf[_0xb1cb('0x2f')]);_0x577fa5[_0xb1cb('0x31')]=_[_0xb1cb('0x33')](_0x577fa5[_0xb1cb('0x2e')],_0x577fa5[_0xb1cb('0x2f')]);_0x7e0368[_0xb1cb('0x32')]=_[_0xb1cb('0x33')](_0x577fa5['model'],qs[_0xb1cb('0x34')](_0x57d8cf[_0xb1cb('0x2f')][_0xb1cb('0x34')]));_0x7e0368['attributes']=_0x7e0368[_0xb1cb('0x32')][_0xb1cb('0x35')]?_0x7e0368[_0xb1cb('0x32')]:_0x577fa5[_0xb1cb('0x2e')];if(_0x57d8cf[_0xb1cb('0x2f')][_0xb1cb('0x40')]){_0x7e0368[_0xb1cb('0x41')]=[{'all':!![]}];}_0x7e0368=_['merge']({},_0x7e0368,_0x57d8cf[_0xb1cb('0x3f')]);return db[_0xb1cb('0x2a')][_0xb1cb('0x47')](_0x7e0368)[_0xb1cb('0x23')](handleEntityNotFound(_0x15d12f,null))[_0xb1cb('0x23')](respondWithResult(_0x15d12f,null))['catch'](handleError(_0x15d12f,null));};exports[_0xb1cb('0x48')]=function(_0x226c72,_0x292d80){return db[_0xb1cb('0x2a')][_0xb1cb('0x48')](_0x226c72[_0xb1cb('0x49')],{})[_0xb1cb('0x23')](respondWithResult(_0x292d80,0xc9))[_0xb1cb('0x44')](handleError(_0x292d80,null));};exports[_0xb1cb('0x22')]=function(_0x454ecd,_0x3876e7){if(_0x454ecd[_0xb1cb('0x49')]['id']){delete _0x454ecd[_0xb1cb('0x49')]['id'];}return db[_0xb1cb('0x2a')][_0xb1cb('0x47')]({'where':{'id':_0x454ecd[_0xb1cb('0x46')]['id']}})[_0xb1cb('0x23')](handleEntityNotFound(_0x3876e7,null))[_0xb1cb('0x23')](saveUpdates(_0x454ecd[_0xb1cb('0x49')],null))['then'](respondWithResult(_0x3876e7,null))['catch'](handleError(_0x3876e7,null));};exports['destroy']=function(_0x55adc8,_0x17ca2c){return db[_0xb1cb('0x2a')][_0xb1cb('0x47')]({'where':{'id':_0x55adc8[_0xb1cb('0x46')]['id']}})[_0xb1cb('0x23')](handleEntityNotFound(_0x17ca2c,null))[_0xb1cb('0x23')](removeEntity(_0x17ca2c,null))[_0xb1cb('0x44')](handleError(_0x17ca2c,null));};exports[_0xb1cb('0x4a')]=function(_0x5d6e75,_0x21b9dc,_0x5d1598){var _0x826d6={};var _0x532578={};var _0x1687d5;var _0x3d4914;return db[_0xb1cb('0x2a')][_0xb1cb('0x4b')]({'where':{'id':_0x5d6e75[_0xb1cb('0x46')]['id']}})[_0xb1cb('0x23')](handleEntityNotFound(_0x21b9dc,null))[_0xb1cb('0x23')](function(_0x54c319){if(_0x54c319){_0x1687d5=_0x54c319;_0x532578['model']=_[_0xb1cb('0x30')](db[_0xb1cb('0x4c')]['rawAttributes']);_0x532578['query']=_['keys'](_0x5d6e75[_0xb1cb('0x2f')]);_0x532578[_0xb1cb('0x31')]=_['intersection'](_0x532578[_0xb1cb('0x2e')],_0x532578[_0xb1cb('0x2f')]);_0x826d6['attributes']=_[_0xb1cb('0x33')](_0x532578['model'],qs[_0xb1cb('0x34')](_0x5d6e75[_0xb1cb('0x2f')]['fields']));_0x826d6[_0xb1cb('0x32')]=_0x826d6['attributes'][_0xb1cb('0x35')]?_0x826d6[_0xb1cb('0x32')]:_0x532578[_0xb1cb('0x2e')];_0x826d6[_0xb1cb('0x38')]=qs[_0xb1cb('0x39')](_0x5d6e75[_0xb1cb('0x2f')][_0xb1cb('0x39')]);_0x826d6[_0xb1cb('0x3a')]=qs[_0xb1cb('0x31')](_[_0xb1cb('0x3b')](_0x5d6e75[_0xb1cb('0x2f')],_0x532578[_0xb1cb('0x31')]));if(_0x5d6e75[_0xb1cb('0x2f')][_0xb1cb('0x3c')]){_0x826d6['where']=_[_0xb1cb('0x3d')](_0x826d6[_0xb1cb('0x3a')],{'$or':_[_0xb1cb('0x29')](_0x826d6[_0xb1cb('0x32')],function(_0xaaac02){var _0x2cfe43={};_0x2cfe43[_0xaaac02]={'$like':'%'+_0x5d6e75[_0xb1cb('0x2f')][_0xb1cb('0x3c')]+'%'};return _0x2cfe43;})});}_0x826d6=_[_0xb1cb('0x3d')]({},_0x826d6,_0x5d6e75['options']);return _0x1687d5[_0xb1cb('0x4a')](_0x826d6);}})[_0xb1cb('0x23')](function(_0x51ce57){if(_0x51ce57){_0x3d4914=_0x51ce57['length'];if(!_0x5d6e75[_0xb1cb('0x2f')][_0xb1cb('0x36')](_0xb1cb('0x37'))){_0x826d6[_0xb1cb('0x1b')]=qs['limit'](_0x5d6e75['query'][_0xb1cb('0x1b')]);_0x826d6['offset']=qs[_0xb1cb('0x1e')](_0x5d6e75[_0xb1cb('0x2f')][_0xb1cb('0x1e')]);}return _0x1687d5['getConfigurations'](_0x826d6);}})[_0xb1cb('0x23')](function(_0x193bcb){if(_0x193bcb){return _0x193bcb?{'count':_0x3d4914,'rows':_0x193bcb}:null;}})['then'](respondWithResult(_0x21b9dc,null))['catch'](handleError(_0x21b9dc,null));};exports[_0xb1cb('0x4d')]=function(_0x387d17,_0x279f6e,_0x30a021){if(_0x387d17['body']['id']){delete _0x387d17[_0xb1cb('0x49')]['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0x387d17[_0xb1cb('0x46')]['id']}})[_0xb1cb('0x23')](handleEntityNotFound(_0x279f6e,null))[_0xb1cb('0x23')](function(_0x19f1f7){if(_0x19f1f7){_0x387d17[_0xb1cb('0x49')]['AccountId']=_0x19f1f7['id'];_0x387d17['body']['Subjects']=integrations[_0xb1cb('0x4e')](_0x387d17[_0xb1cb('0x49')][_0xb1cb('0x4f')],_0x387d17[_0xb1cb('0x49')][_0xb1cb('0x50')]);_0x387d17[_0xb1cb('0x49')][_0xb1cb('0x51')]=integrations[_0xb1cb('0x52')](_0x387d17[_0xb1cb('0x49')]['channel'],_0x387d17[_0xb1cb('0x49')][_0xb1cb('0x50')]);return db[_0xb1cb('0x4c')][_0xb1cb('0x48')](_0x387d17[_0xb1cb('0x49')],{'include':[{'model':db[_0xb1cb('0x53')],'as':'Subjects'},{'model':db[_0xb1cb('0x53')],'as':'Descriptions'}]});}return null;})[_0xb1cb('0x23')](respondWithResult(_0x279f6e,null))[_0xb1cb('0x44')](handleError(_0x279f6e,null));};exports['getFields']=function(_0xb80efc,_0x4e392e,_0x20ce5d){var _0x561e94=[_0xb1cb('0x54'),_0xb1cb('0x55'),_0xb1cb('0x56'),'subcategory',_0xb1cb('0x57'),_0xb1cb('0x58'),'incident_state',_0xb1cb('0x59'),'category'];var _0x101596=[_0xb1cb('0x5a'),'made_sla','caused_by',_0xb1cb('0x5b'),'upon_reject','sys_updated_on',_0xb1cb('0x5c'),_0xb1cb('0x55'),_0xb1cb('0x5d'),_0xb1cb('0x5e'),'resolved_by',_0xb1cb('0x5f'),_0xb1cb('0x60'),'user_input',_0xb1cb('0x61'),_0xb1cb('0x62'),_0xb1cb('0x63'),_0xb1cb('0x64'),_0xb1cb('0x56'),_0xb1cb('0x38'),_0xb1cb('0x65'),_0xb1cb('0x66'),_0xb1cb('0x67'),_0xb1cb('0x68'),_0xb1cb('0x69'),_0xb1cb('0x6a'),_0xb1cb('0x6b'),_0xb1cb('0x6c'),'priority','sys_domain_path',_0xb1cb('0x6d'),'time_worked','expected_start','opened_at',_0xb1cb('0x6e'),_0xb1cb('0x6f'),_0xb1cb('0x70'),_0xb1cb('0x71'),_0xb1cb('0x72'),'caller_id',_0xb1cb('0x73'),_0xb1cb('0x74'),_0xb1cb('0x75'),_0xb1cb('0x76'),_0xb1cb('0x57'),_0xb1cb('0x77'),'delivery_task',_0xb1cb('0x78'),_0xb1cb('0x79'),_0xb1cb('0x7a'),_0xb1cb('0x7b'),_0xb1cb('0x7c'),'calendar_duration',_0xb1cb('0x58'),_0xb1cb('0x7d'),_0xb1cb('0x7e'),_0xb1cb('0x7f'),_0xb1cb('0x80'),'parent_incident',_0xb1cb('0x81'),_0xb1cb('0x82'),_0xb1cb('0x83'),_0xb1cb('0x84'),_0xb1cb('0x85'),_0xb1cb('0x86'),_0xb1cb('0x87'),_0xb1cb('0x88'),_0xb1cb('0x89'),_0xb1cb('0x8a'),_0xb1cb('0x59'),_0xb1cb('0x8b'),_0xb1cb('0x8c'),_0xb1cb('0x8d'),_0xb1cb('0x8e'),_0xb1cb('0x8f'),_0xb1cb('0x90'),_0xb1cb('0x91'),_0xb1cb('0x92'),_0xb1cb('0x93'),_0xb1cb('0x94'),_0xb1cb('0x95'),'location',_0xb1cb('0x96')];var _0x5472f9='';var _0x4607af='';var _0xa03609=[];var _0x2ceeec='';var _0x5811f8='';var _0x346cfe=[];var _0x3cfa61='';var _0x1c1b8a='';var _0xcd855={};var _0x3c8f58='';return db[_0xb1cb('0x2a')][_0xb1cb('0x4b')]({'where':{'id':_0xb80efc[_0xb1cb('0x46')]['id']},'attributes':['id',_0xb1cb('0x97'),_0xb1cb('0x98'),_0xb1cb('0x99'),'remoteUri',_0xb1cb('0x9a')]})['then'](handleEntityNotFound(_0x4e392e,null))[_0xb1cb('0x23')](function(_0x118f55){if(_0x118f55){_0x3c8f58=_0x118f55[_0xb1cb('0x9b')];var _0x5d32e0=_0x3c8f58['slice'](-0x1);if(_0x5d32e0==='/'){_0x3c8f58=_0x3c8f58[_0xb1cb('0x9c')](0x0,_0x3c8f58[_0xb1cb('0x9d')](_0x5d32e0));}_0x1c1b8a=util[_0xb1cb('0x9e')](_0xb1cb('0x9f'),_0x3c8f58);_0x3cfa61=util['format'](_0xb1cb('0xa0'),_0x3c8f58);_0xcd855={'user':_0x118f55[_0xb1cb('0x97')],'pass':_0x118f55[_0xb1cb('0x98')]};var _0x2a706b={'method':_0xb1cb('0xa1'),'uri':_0x1c1b8a+_0xb1cb('0xa2'),'auth':_0xcd855,'json':!![]};return rp(_0x2a706b);}})[_0xb1cb('0x23')](function(_0x2a537c){if(_0x2a537c[_0xb1cb('0xa3')][_0xb1cb('0x35')]>0x0){_0x5472f9=_0x2a537c[_0xb1cb('0xa3')];}console['log'](_0xb1cb('0xa4'),_0x5472f9);_0x346cfe=[];_0x4607af=Object[_0xb1cb('0xa5')]([],_0x5472f9);_[_0xb1cb('0xa6')](_0x4607af,function(_0xa75439){return!_0x561e94['includes'](_0xa75439[_0xb1cb('0x27')]);});_0x4607af[_0xb1cb('0xa7')](function(_0x100ab6){var _0x312a25=createFieldObject(_0x3cfa61,_0xcd855,_0x100ab6['internalType'],_0x100ab6[_0xb1cb('0x27')],_0x100ab6[_0xb1cb('0xa8')],![]);_0x346cfe[_0xb1cb('0xa9')](_0x312a25);});return Promise[_0xb1cb('0xaa')](_0x346cfe);})[_0xb1cb('0x23')](function(_0x181524){_0xa03609=_0x181524;_0x2ceeec=Object['assign']([],_0x5472f9);console[_0xb1cb('0xab')](_0xb1cb('0xac'),_0x5472f9);_[_0xb1cb('0xa6')](_0x2ceeec,function(_0x58c1e9){return _0x101596[_0xb1cb('0xad')](_0x58c1e9[_0xb1cb('0x27')]);});console[_0xb1cb('0xab')](_0xb1cb('0xae'),_0x2ceeec);_0x346cfe=[];_0x2ceeec[_0xb1cb('0xa7')](function(_0x5d6cf2){var _0x316b30=createFieldObject(_0x3cfa61,_0xcd855,_0x5d6cf2[_0xb1cb('0xaf')],_0x5d6cf2['name'],_0x5d6cf2[_0xb1cb('0xa8')],!![]);_0x346cfe[_0xb1cb('0xa9')](_0x316b30);});return Promise[_0xb1cb('0xaa')](_0x346cfe);})[_0xb1cb('0x23')](function(_0x68d18){_0x5811f8=_0x68d18;var _0x437b44=_0xa03609[_0xb1cb('0xb0')](_0x5811f8);return{'count':_0x437b44['length'],'rows':_0x437b44};})[_0xb1cb('0x23')](respondWithResult(_0x4e392e,null))[_0xb1cb('0x44')](function(_0x20ba0e){console[_0xb1cb('0xab')](_0xb1cb('0xb1')+_0x20ba0e);var _0x549d8e=_0xb80efc[_0xb1cb('0x2f')][_0xb1cb('0xb2')]?0x1f4:_0x20ba0e[_0xb1cb('0xb3')]||0x1f4;logger[_0xb1cb('0x25')](_0x20ba0e[_0xb1cb('0x26')]);delete _0x20ba0e[_0xb1cb('0x27')];if(_0x549d8e===0x191){_0x549d8e=0x190;}_0x4e392e[_0xb1cb('0x1a')](_0x549d8e)[_0xb1cb('0x28')](_0xb80efc[_0xb1cb('0x2f')][_0xb1cb('0xb2')]?{'message':_0xb1cb('0xb4'),'statusCode':_0x20ba0e['statusCode']}:_0x20ba0e);});};function createFieldObject(_0x2d17a2,_0x10d966,_0x322ac9,_0x4cd860,_0x3976c8,_0x2e88e3){return new Promise(function(_0x36c9ba,_0x2c3494){var _0x13d2b8={'id':_0x4cd860,'name':_0x3976c8,'custom':_0x2e88e3};if(_0x322ac9==='boolean'){_0x13d2b8['options']=[{'name':_0xb1cb('0xb5'),'value':_0xb1cb('0xb6')},{'name':_0xb1cb('0xb7'),'value':'false'}];_0x36c9ba(_0x13d2b8);}else{var _0x4abb1b={'method':_0xb1cb('0xa1'),'uri':_0x2d17a2+_0xb1cb('0xb8')+_0x4cd860,'auth':_0x10d966,'json':!![]};return rp(_0x4abb1b)['then'](function(_0xa78ad2){var _0x35c1bf=[];if(_0xa78ad2[_0xb1cb('0xa3')][_0xb1cb('0x35')]>0x0){_0xa78ad2[_0xb1cb('0xa3')][_0xb1cb('0xa7')](function(_0x1e23ba){if(_0x1e23ba[_0xb1cb('0xb9')]===_0xb1cb('0xba')){var _0x537ca4={'name':_0x1e23ba[_0xb1cb('0xa8')],'value':_0x1e23ba['value']};_0x35c1bf['push'](_0x537ca4);}});}_0x13d2b8[_0xb1cb('0x3f')]=_0x35c1bf;if(_0x13d2b8['options'][_0xb1cb('0x35')]>0x0){_0x36c9ba(_0x13d2b8);}else{if(_0x2e88e3==![]){_0x36c9ba();}else{_0x36c9ba(_0x13d2b8);}}});}});}
\ No newline at end of file
index fd94950..c16b120 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31f0=['./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0xab5719,_0x34a954){var _0x4f189b=function(_0x5aa411){while(--_0x5aa411){_0xab5719['push'](_0xab5719['shift']());}};_0x4f189b(++_0x34a954);}(_0x31f0,0xb7));var _0x031f=function(_0x356882,_0x35b140){_0x356882=_0x356882-0x0;var _0x4c062b=_0x31f0[_0x356882];return _0x4c062b;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var logger=require(_0x031f('0x1'))('api');var moment=require(_0x031f('0x2'));var BPromise=require(_0x031f('0x3'));var rp=require(_0x031f('0x4'));var fs=require('fs');var path=require(_0x031f('0x5'));var rimraf=require('rimraf');var config=require(_0x031f('0x6'));var attributes=require(_0x031f('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x56328c,_0x3dc98e){return _0x56328c['define'](_0x031f('0x8'),attributes,{'tableName':_0x031f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0x326f,0xd1));var _0xf326=function(_0x2dedb8,_0x42e8e1){_0x2dedb8=_0x2dedb8-0x0;var _0x5af2bc=_0x326f[_0x2dedb8];return _0x5af2bc;};'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'));var integrations=require(_0xf326('0x9'));module[_0xf326('0xa')]=function(_0x4c2249,_0x3c254d){return _0x4c2249[_0xf326('0xb')](_0xf326('0xc'),attributes,{'tableName':_0xf326('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a1b03f5..c7d1a77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa055=['client','request','then','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','ServicenowAccount,\x20%s,\x20%s','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','include','map','model','stringify','find','ShowServicenowAccount','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise'];(function(_0x559a80,_0x3d193d){var _0x42f555=function(_0x24e596){while(--_0x24e596){_0x559a80['push'](_0x559a80['shift']());}};_0x42f555(++_0x3d193d);}(_0xa055,0x1b9));var _0x5a05=function(_0x3050ca,_0x3e36b0){_0x3050ca=_0x3050ca-0x0;var _0x1eed1d=_0xa055[_0x3050ca];return _0x1eed1d;};'use strict';var _=require(_0x5a05('0x0'));var util=require(_0x5a05('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5a05('0x2'));var fs=require('fs');var Redis=require(_0x5a05('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5a05('0x4'));var logger=require(_0x5a05('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5a05('0x6'));var client=jayson[_0x5a05('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1169ec,_0x5be986,_0x483260){return new BPromise(function(_0x30e253,_0x4983b3){return client[_0x5a05('0x8')](_0x1169ec,_0x483260)[_0x5a05('0x9')](function(_0xeb138e){logger[_0x5a05('0xa')]('ServicenowAccount,\x20%s,\x20%s',_0x5be986,_0x5a05('0xb'));logger[_0x5a05('0xc')](_0x5a05('0xd'),_0x5be986,_0x5a05('0xb'),JSON['stringify'](_0xeb138e));if(_0xeb138e[_0x5a05('0xe')]){if(_0xeb138e[_0x5a05('0xe')]['code']===0x1f4){logger[_0x5a05('0xe')](_0x5a05('0xf'),_0x5be986,_0xeb138e['error'][_0x5a05('0x10')]);return _0x4983b3(_0xeb138e[_0x5a05('0xe')]['message']);}logger[_0x5a05('0xe')](_0x5a05('0xf'),_0x5be986,_0xeb138e['error']['message']);return _0x30e253(_0xeb138e[_0x5a05('0xe')][_0x5a05('0x10')]);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x5be986,_0x5a05('0xb'));_0x30e253(_0xeb138e[_0x5a05('0x11')]['message']);}})[_0x5a05('0x12')](function(_0x3477f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x5be986,_0x3477f4);_0x4983b3(_0x3477f4);});});}exports[_0x5a05('0x13')]=function(_0x54ec6e){var _0x1de527=this;return new Promise(function(_0x3db1be,_0x18f3cb){return db[_0x5a05('0x14')][_0x5a05('0x15')]({'raw':_0x54ec6e[_0x5a05('0x16')]?_0x54ec6e['options'][_0x5a05('0x17')]===undefined?!![]:![]:!![],'where':_0x54ec6e[_0x5a05('0x16')]?_0x54ec6e[_0x5a05('0x16')][_0x5a05('0x18')]||null:null,'attributes':_0x54ec6e[_0x5a05('0x16')]?_0x54ec6e['options'][_0x5a05('0x19')]||null:null,'limit':_0x54ec6e[_0x5a05('0x16')]?_0x54ec6e['options']['limit']||null:null,'include':_0x54ec6e['options']?_0x54ec6e[_0x5a05('0x16')][_0x5a05('0x1a')]?_['map'](_0x54ec6e[_0x5a05('0x16')][_0x5a05('0x1a')],function(_0x69bde5){return{'model':db[_0x69bde5['model']],'as':_0x69bde5['as'],'attributes':_0x69bde5[_0x5a05('0x19')],'include':_0x69bde5['include']?_[_0x5a05('0x1b')](_0x69bde5['include'],function(_0x28f423){return{'model':db[_0x28f423[_0x5a05('0x1c')]],'as':_0x28f423['as'],'attributes':_0x28f423[_0x5a05('0x19')],'include':_0x28f423['include']?_[_0x5a05('0x1b')](_0x28f423[_0x5a05('0x1a')],function(_0x1c162f){return{'model':db[_0x1c162f[_0x5a05('0x1c')]],'as':_0x1c162f['as'],'attributes':_0x1c162f[_0x5a05('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5a05('0x9')](function(_0x5c51f7){logger['info'](_0x5a05('0x13'),_0x54ec6e);logger['debug'](_0x5a05('0x13'),_0x54ec6e,JSON[_0x5a05('0x1d')](_0x5c51f7));_0x3db1be(_0x5c51f7);})[_0x5a05('0x12')](function(_0x268c7a){logger[_0x5a05('0xe')]('GetServicenowAccount',_0x268c7a[_0x5a05('0x10')],_0x54ec6e);_0x18f3cb(_0x1de527[_0x5a05('0xe')](0x1f4,_0x268c7a[_0x5a05('0x10')]));});});};exports['ShowServicenowAccount']=function(_0x12a9fb){var _0x56a650=this;return new Promise(function(_0x54fd69,_0x5dffc1){return db[_0x5a05('0x14')][_0x5a05('0x1e')]({'raw':_0x12a9fb[_0x5a05('0x16')]?_0x12a9fb[_0x5a05('0x16')][_0x5a05('0x17')]===undefined?!![]:![]:!![],'where':_0x12a9fb[_0x5a05('0x16')]?_0x12a9fb[_0x5a05('0x16')][_0x5a05('0x18')]||null:null,'attributes':_0x12a9fb['options']?_0x12a9fb['options'][_0x5a05('0x19')]||null:null,'include':_0x12a9fb[_0x5a05('0x16')]?_0x12a9fb['options']['include']?_[_0x5a05('0x1b')](_0x12a9fb[_0x5a05('0x16')][_0x5a05('0x1a')],function(_0x12f825){return{'model':db[_0x12f825['model']],'as':_0x12f825['as'],'attributes':_0x12f825[_0x5a05('0x19')],'include':_0x12f825['include']?_[_0x5a05('0x1b')](_0x12f825['include'],function(_0x38cefe){return{'model':db[_0x38cefe[_0x5a05('0x1c')]],'as':_0x38cefe['as'],'attributes':_0x38cefe[_0x5a05('0x19')],'include':_0x38cefe[_0x5a05('0x1a')]?_['map'](_0x38cefe[_0x5a05('0x1a')],function(_0x40e47d){return{'model':db[_0x40e47d[_0x5a05('0x1c')]],'as':_0x40e47d['as'],'attributes':_0x40e47d[_0x5a05('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5a05('0x9')](function(_0x6e323f){logger['info'](_0x5a05('0x1f'),_0x12a9fb);logger[_0x5a05('0xc')](_0x5a05('0x1f'),_0x12a9fb,JSON[_0x5a05('0x1d')](_0x6e323f));_0x54fd69(_0x6e323f);})['catch'](function(_0x28231d){logger[_0x5a05('0xe')](_0x5a05('0x1f'),_0x28231d['message'],_0x12a9fb);_0x5dffc1(_0x56a650[_0x5a05('0xe')](0x1f4,_0x28231d['message']));});});};
\ No newline at end of file
+var _0x3691=['where','attributes','include','map','model','ShowServicenowAccount','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options'];(function(_0x2da45d,_0x35397b){var _0x1012a0=function(_0x2babc3){while(--_0x2babc3){_0x2da45d['push'](_0x2da45d['shift']());}};_0x1012a0(++_0x35397b);}(_0x3691,0x98));var _0x1369=function(_0x3bfc54,_0x1cac52){_0x3bfc54=_0x3bfc54-0x0;var _0x209245=_0x3691[_0x3bfc54];return _0x209245;};'use strict';var _=require('lodash');var util=require(_0x1369('0x0'));var moment=require(_0x1369('0x1'));var BPromise=require(_0x1369('0x2'));var rs=require(_0x1369('0x3'));var fs=require('fs');var Redis=require(_0x1369('0x4'));var db=require(_0x1369('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1369('0x6'))(_0x1369('0x7'));var config=require(_0x1369('0x8'));var jayson=require(_0x1369('0x9'));var client=jayson['client'][_0x1369('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x189dcf,_0x612bba,_0x3ad7f3){return new BPromise(function(_0x29ef01,_0x5a3357){return client[_0x1369('0xb')](_0x189dcf,_0x3ad7f3)[_0x1369('0xc')](function(_0x3a13c4){logger['info'](_0x1369('0xd'),_0x612bba,'request\x20sent');logger[_0x1369('0xe')](_0x1369('0xf'),_0x612bba,_0x1369('0x10'),JSON[_0x1369('0x11')](_0x3a13c4));if(_0x3a13c4[_0x1369('0x12')]){if(_0x3a13c4[_0x1369('0x12')][_0x1369('0x13')]===0x1f4){logger[_0x1369('0x12')](_0x1369('0xd'),_0x612bba,_0x3a13c4[_0x1369('0x12')][_0x1369('0x14')]);return _0x5a3357(_0x3a13c4[_0x1369('0x12')][_0x1369('0x14')]);}logger[_0x1369('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x612bba,_0x3a13c4[_0x1369('0x12')][_0x1369('0x14')]);return _0x29ef01(_0x3a13c4[_0x1369('0x12')][_0x1369('0x14')]);}else{logger[_0x1369('0x15')](_0x1369('0xd'),_0x612bba,_0x1369('0x10'));_0x29ef01(_0x3a13c4[_0x1369('0x16')][_0x1369('0x14')]);}})[_0x1369('0x17')](function(_0x2d3f22){logger[_0x1369('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x612bba,_0x2d3f22);_0x5a3357(_0x2d3f22);});});}exports[_0x1369('0x18')]=function(_0x876a03){var _0x1392d2=this;return new Promise(function(_0x385d8d,_0x18292b){return db[_0x1369('0x19')][_0x1369('0x1a')]({'raw':_0x876a03['options']?_0x876a03[_0x1369('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x876a03[_0x1369('0x1b')]?_0x876a03['options'][_0x1369('0x1c')]||null:null,'attributes':_0x876a03[_0x1369('0x1b')]?_0x876a03[_0x1369('0x1b')][_0x1369('0x1d')]||null:null,'limit':_0x876a03[_0x1369('0x1b')]?_0x876a03[_0x1369('0x1b')]['limit']||null:null,'include':_0x876a03['options']?_0x876a03[_0x1369('0x1b')][_0x1369('0x1e')]?_[_0x1369('0x1f')](_0x876a03['options'][_0x1369('0x1e')],function(_0x2e6079){return{'model':db[_0x2e6079['model']],'as':_0x2e6079['as'],'attributes':_0x2e6079[_0x1369('0x1d')],'include':_0x2e6079[_0x1369('0x1e')]?_[_0x1369('0x1f')](_0x2e6079[_0x1369('0x1e')],function(_0x5db94a){return{'model':db[_0x5db94a[_0x1369('0x20')]],'as':_0x5db94a['as'],'attributes':_0x5db94a[_0x1369('0x1d')],'include':_0x5db94a[_0x1369('0x1e')]?_[_0x1369('0x1f')](_0x5db94a[_0x1369('0x1e')],function(_0x31d588){return{'model':db[_0x31d588[_0x1369('0x20')]],'as':_0x31d588['as'],'attributes':_0x31d588[_0x1369('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1369('0xc')](function(_0x453341){logger[_0x1369('0x15')](_0x1369('0x18'),_0x876a03);logger[_0x1369('0xe')]('GetServicenowAccount',_0x876a03,JSON[_0x1369('0x11')](_0x453341));_0x385d8d(_0x453341);})['catch'](function(_0x16a0a0){logger[_0x1369('0x12')](_0x1369('0x18'),_0x16a0a0['message'],_0x876a03);_0x18292b(_0x1392d2[_0x1369('0x12')](0x1f4,_0x16a0a0[_0x1369('0x14')]));});});};exports[_0x1369('0x21')]=function(_0x345121){var _0x270b2e=this;return new Promise(function(_0x53c884,_0x3e9f67){return db['ServicenowAccount'][_0x1369('0x22')]({'raw':_0x345121[_0x1369('0x1b')]?_0x345121[_0x1369('0x1b')][_0x1369('0x23')]===undefined?!![]:![]:!![],'where':_0x345121['options']?_0x345121[_0x1369('0x1b')]['where']||null:null,'attributes':_0x345121['options']?_0x345121[_0x1369('0x1b')][_0x1369('0x1d')]||null:null,'include':_0x345121[_0x1369('0x1b')]?_0x345121[_0x1369('0x1b')][_0x1369('0x1e')]?_['map'](_0x345121['options'][_0x1369('0x1e')],function(_0x2c8a10){return{'model':db[_0x2c8a10[_0x1369('0x20')]],'as':_0x2c8a10['as'],'attributes':_0x2c8a10['attributes'],'include':_0x2c8a10[_0x1369('0x1e')]?_[_0x1369('0x1f')](_0x2c8a10[_0x1369('0x1e')],function(_0x760702){return{'model':db[_0x760702['model']],'as':_0x760702['as'],'attributes':_0x760702[_0x1369('0x1d')],'include':_0x760702[_0x1369('0x1e')]?_[_0x1369('0x1f')](_0x760702['include'],function(_0x3757f6){return{'model':db[_0x3757f6[_0x1369('0x20')]],'as':_0x3757f6['as'],'attributes':_0x3757f6[_0x1369('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1369('0xc')](function(_0x30dea7){logger[_0x1369('0x15')](_0x1369('0x21'),_0x345121);logger[_0x1369('0xe')](_0x1369('0x21'),_0x345121,JSON['stringify'](_0x30dea7));_0x53c884(_0x30dea7);})[_0x1369('0x17')](function(_0x547ab0){logger[_0x1369('0x12')](_0x1369('0x21'),_0x547ab0[_0x1369('0x14')],_0x345121);_0x3e9f67(_0x270b2e[_0x1369('0x12')](0x1f4,_0x547ab0['message']));});});};
\ No newline at end of file
index 2f2808c..2c8a0cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0dc7=['/:id','show','/:id/fields','getFields','/:id/subjects','getDescriptions','post','create','put','delete','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','isAuthenticated','index','get'];(function(_0x277c64,_0x5a4d3b){var _0x24ce40=function(_0x4aaff9){while(--_0x4aaff9){_0x277c64['push'](_0x277c64['shift']());}};_0x24ce40(++_0x5a4d3b);}(_0x0dc7,0x186));var _0x70dc=function(_0x240261,_0x4fe66c){_0x240261=_0x240261-0x0;var _0x45c332=_0x0dc7[_0x240261];return _0x45c332;};'use strict';var multer=require(_0x70dc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x70dc('0x1'));var express=require('express');var router=express[_0x70dc('0x2')]();var fs_extra=require(_0x70dc('0x3'));var auth=require(_0x70dc('0x4'));var interaction=require(_0x70dc('0x5'));var config=require('../../config/environment');var controller=require(_0x70dc('0x6'));router['get']('/',auth[_0x70dc('0x7')](),controller[_0x70dc('0x8')]);router[_0x70dc('0x9')](_0x70dc('0xa'),auth['isAuthenticated'](),controller[_0x70dc('0xb')]);router[_0x70dc('0x9')](_0x70dc('0xc'),auth['isAuthenticated'](),controller[_0x70dc('0xd')]);router[_0x70dc('0x9')](_0x70dc('0xe'),auth[_0x70dc('0x7')](),controller['getSubjects']);router[_0x70dc('0x9')]('/:id/descriptions',auth[_0x70dc('0x7')](),controller[_0x70dc('0xf')]);router[_0x70dc('0x10')]('/',auth['isAuthenticated'](),controller[_0x70dc('0x11')]);router[_0x70dc('0x12')](_0x70dc('0xa'),auth[_0x70dc('0x7')](),controller['update']);router[_0x70dc('0x13')](_0x70dc('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xe0ed=['exports','util','path','connect-timeout','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete'];(function(_0x57196e,_0x2058c5){var _0xad5352=function(_0x2f2a65){while(--_0x2f2a65){_0x57196e['push'](_0x57196e['shift']());}};_0xad5352(++_0x2058c5);}(_0xe0ed,0xb1));var _0xde0e=function(_0x134746,_0x404c4c){_0x134746=_0x134746-0x0;var _0x49764d=_0xe0ed[_0x134746];return _0x49764d;};'use strict';var multer=require('multer');var util=require(_0xde0e('0x0'));var path=require(_0xde0e('0x1'));var timeout=require(_0xde0e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xde0e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xde0e('0x4'));var config=require('../../config/environment');var controller=require('./intServicenowConfiguration.controller');router[_0xde0e('0x5')]('/',auth[_0xde0e('0x6')](),controller[_0xde0e('0x7')]);router[_0xde0e('0x5')](_0xde0e('0x8'),auth[_0xde0e('0x6')](),controller[_0xde0e('0x9')]);router['get'](_0xde0e('0xa'),auth[_0xde0e('0x6')](),controller[_0xde0e('0xb')]);router[_0xde0e('0x5')](_0xde0e('0xc'),auth[_0xde0e('0x6')](),controller[_0xde0e('0xd')]);router[_0xde0e('0x5')](_0xde0e('0xe'),auth[_0xde0e('0x6')](),controller[_0xde0e('0xf')]);router[_0xde0e('0x10')]('/',auth[_0xde0e('0x6')](),controller[_0xde0e('0x11')]);router[_0xde0e('0x12')]('/:id',auth[_0xde0e('0x6')](),controller[_0xde0e('0x13')]);router[_0xde0e('0x14')](_0xde0e('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0xde0e('0x15')]=router;
\ No newline at end of file
index 3865cb8..b8daa61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1948=['STRING','exports'];(function(_0x232cf2,_0x4ffb79){var _0x463cec=function(_0x581b60){while(--_0x581b60){_0x232cf2['push'](_0x232cf2['shift']());}};_0x463cec(++_0x4ffb79);}(_0x1948,0x9d));var _0x8194=function(_0x43f362,_0x51990b){_0x43f362=_0x43f362-0x0;var _0x5becc7=_0x1948[_0x43f362];return _0x5becc7;};'use strict';var Sequelize=require('sequelize');module[_0x8194('0x0')]={'name':{'type':Sequelize[_0x8194('0x1')]},'description':{'type':Sequelize[_0x8194('0x1')]}};
\ No newline at end of file
+var _0x0a59=['sequelize','exports','STRING'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x0a59,0xed));var _0x90a5=function(_0x3b9a42,_0x27b59c){_0x3b9a42=_0x3b9a42-0x0;var _0x17dd2d=_0x0a59[_0x3b9a42];return _0x17dd2d;};'use strict';var Sequelize=require(_0x90a5('0x0'));module[_0x90a5('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x90a5('0x2')]}};
\ No newline at end of file
index a048c12..feb06f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4661=['hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','update','body','destroy','getFields','findOne','ServicenowField','options','nolimit','getSubjects','getDescriptions','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','name','index','map','ServicenowConfiguration','key','model','query','keys','intersection','fields','length','attributes'];(function(_0x134fa6,_0x5b4e96){var _0x31fd78=function(_0x1cb9bb){while(--_0x1cb9bb){_0x134fa6['push'](_0x134fa6['shift']());}};_0x31fd78(++_0x5b4e96);}(_0x4661,0x68));var _0x1466=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x4661[_0x138adb];return _0x1b27f2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1466('0x0'));var rp=require(_0x1466('0x1'));var moment=require(_0x1466('0x2'));var BPromise=require(_0x1466('0x3'));var Mustache=require(_0x1466('0x4'));var util=require(_0x1466('0x5'));var path=require(_0x1466('0x6'));var sox=require(_0x1466('0x7'));var csv=require(_0x1466('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1466('0x9'));var _=require(_0x1466('0xa'));var squel=require(_0x1466('0xb'));var crypto=require(_0x1466('0xc'));var jsforce=require(_0x1466('0xd'));var deskjs=require(_0x1466('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1466('0xf'));var Papa=require('papaparse');var Redis=require(_0x1466('0x10'));var authService=require(_0x1466('0x11'));var qs=require(_0x1466('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1466('0x13'));var utils=require(_0x1466('0x14'));var config=require(_0x1466('0x15'));var licenseUtil=require(_0x1466('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47ba4b,_0x56b6d9){_0x56b6d9=_0x56b6d9||0xcc;return function(_0x35c216){if(_0x35c216){return _0x47ba4b[_0x1466('0x17')](_0x56b6d9);}return _0x47ba4b[_0x1466('0x18')](_0x56b6d9)[_0x1466('0x19')]();};}function respondWithResult(_0x287811,_0x4c2880){_0x4c2880=_0x4c2880||0xc8;return function(_0xf20572){if(_0xf20572){return _0x287811[_0x1466('0x18')](_0x4c2880)['json'](_0xf20572);}};}function respondWithFilteredResult(_0x1f5e47,_0x4df480){return function(_0x41060b){if(_0x41060b){var _0x2a7693=typeof _0x4df480[_0x1466('0x1a')]===_0x1466('0x1b')&&typeof _0x4df480[_0x1466('0x1c')]===_0x1466('0x1b');var _0x27b2d9=_0x41060b[_0x1466('0x1d')];var _0x435847=_0x2a7693?0x0:_0x4df480['offset'];var _0x33c2c2=_0x2a7693?_0x41060b['count']:_0x4df480[_0x1466('0x1a')]+_0x4df480['limit'];var _0x3f1f69;if(_0x33c2c2>=_0x27b2d9){_0x33c2c2=_0x27b2d9;_0x3f1f69=0xc8;}else{_0x3f1f69=0xce;}_0x1f5e47['status'](_0x3f1f69);return _0x1f5e47['set'](_0x1466('0x1e'),_0x435847+'-'+_0x33c2c2+'/'+_0x27b2d9)[_0x1466('0x1f')](_0x41060b);}return null;};}function patchUpdates(_0x4d5a78){return function(_0x3e74fb){try{jsonpatch[_0x1466('0x20')](_0x3e74fb,_0x4d5a78,!![]);}catch(_0x42f565){return BPromise[_0x1466('0x21')](_0x42f565);}return _0x3e74fb[_0x1466('0x22')]();};}function saveUpdates(_0xc22168,_0x571b77){return function(_0x97f745){if(_0x97f745){return _0x97f745['update'](_0xc22168)['then'](function(_0x5af2ac){return _0x5af2ac;});}return null;};}function removeEntity(_0x551790,_0x13a4da){return function(_0x31d00e){if(_0x31d00e){return _0x31d00e['destroy']()[_0x1466('0x23')](function(){_0x551790[_0x1466('0x18')](0xcc)[_0x1466('0x19')]();});}};}function handleEntityNotFound(_0x1e7e75,_0x3d35b4){return function(_0x1ae93a){if(!_0x1ae93a){_0x1e7e75['sendStatus'](0x194);}return _0x1ae93a;};}function handleError(_0x568953,_0x3fc71b){_0x3fc71b=_0x3fc71b||0x1f4;return function(_0x293dfa){logger['error'](_0x293dfa['stack']);if(_0x293dfa[_0x1466('0x24')]){delete _0x293dfa['name'];}_0x568953[_0x1466('0x18')](_0x3fc71b)['send'](_0x293dfa);};}exports[_0x1466('0x25')]=function(_0x181343,_0x103d6c){var _0x1c803b={},_0x4e5600={},_0x5e1fbc={'count':0x0,'rows':[]};var _0x2fbba7=_[_0x1466('0x26')](db[_0x1466('0x27')]['rawAttributes'],function(_0x5d490a){return{'name':_0x5d490a['fieldName'],'type':_0x5d490a['type'][_0x1466('0x28')]};});_0x4e5600[_0x1466('0x29')]=_[_0x1466('0x26')](_0x2fbba7,_0x1466('0x24'));_0x4e5600[_0x1466('0x2a')]=_[_0x1466('0x2b')](_0x181343['query']);_0x4e5600['filters']=_[_0x1466('0x2c')](_0x4e5600[_0x1466('0x29')],_0x4e5600[_0x1466('0x2a')]);_0x1c803b['attributes']=_[_0x1466('0x2c')](_0x4e5600[_0x1466('0x29')],qs[_0x1466('0x2d')](_0x181343['query'][_0x1466('0x2d')]));_0x1c803b['attributes']=_0x1c803b['attributes'][_0x1466('0x2e')]?_0x1c803b[_0x1466('0x2f')]:_0x4e5600[_0x1466('0x29')];if(!_0x181343[_0x1466('0x2a')][_0x1466('0x30')]('nolimit')){_0x1c803b[_0x1466('0x1c')]=qs['limit'](_0x181343[_0x1466('0x2a')]['limit']);_0x1c803b['offset']=qs[_0x1466('0x1a')](_0x181343[_0x1466('0x2a')][_0x1466('0x1a')]);}_0x1c803b[_0x1466('0x31')]=qs[_0x1466('0x32')](_0x181343[_0x1466('0x2a')][_0x1466('0x32')]);_0x1c803b[_0x1466('0x33')]=qs[_0x1466('0x34')](_[_0x1466('0x35')](_0x181343['query'],_0x4e5600[_0x1466('0x34')]),_0x2fbba7);if(_0x181343[_0x1466('0x2a')][_0x1466('0x36')]){_0x1c803b[_0x1466('0x33')]=_['merge'](_0x1c803b[_0x1466('0x33')],{'$or':_[_0x1466('0x26')](_0x2fbba7,function(_0x402958){if(_0x402958['type']!==_0x1466('0x37')){var _0x22f094={};_0x22f094[_0x402958[_0x1466('0x24')]]={'$like':'%'+_0x181343[_0x1466('0x2a')][_0x1466('0x36')]+'%'};return _0x22f094;}})});}_0x1c803b=_[_0x1466('0x38')]({},_0x1c803b,_0x181343['options']);var _0x32fe70={'where':_0x1c803b[_0x1466('0x33')]};return db[_0x1466('0x27')]['count'](_0x32fe70)[_0x1466('0x23')](function(_0x2ad0d6){_0x5e1fbc['count']=_0x2ad0d6;if(_0x181343[_0x1466('0x2a')][_0x1466('0x39')]){_0x1c803b[_0x1466('0x3a')]=[{'all':!![]}];}return db[_0x1466('0x27')][_0x1466('0x3b')](_0x1c803b);})[_0x1466('0x23')](function(_0x2a9ccf){_0x5e1fbc[_0x1466('0x3c')]=_0x2a9ccf;return _0x5e1fbc;})[_0x1466('0x23')](respondWithFilteredResult(_0x103d6c,_0x1c803b))[_0x1466('0x3d')](handleError(_0x103d6c,null));};exports['show']=function(_0x18117b,_0x4518e0){var _0xcdb873={'raw':![],'where':{'id':_0x18117b[_0x1466('0x3e')]['id']}},_0x232ef9={};_0x232ef9[_0x1466('0x29')]=_['keys'](db[_0x1466('0x27')][_0x1466('0x3f')]);_0x232ef9[_0x1466('0x2a')]=_[_0x1466('0x2b')](_0x18117b[_0x1466('0x2a')]);_0x232ef9[_0x1466('0x34')]=_[_0x1466('0x2c')](_0x232ef9[_0x1466('0x29')],_0x232ef9[_0x1466('0x2a')]);_0xcdb873['attributes']=_[_0x1466('0x2c')](_0x232ef9[_0x1466('0x29')],qs['fields'](_0x18117b[_0x1466('0x2a')][_0x1466('0x2d')]));_0xcdb873['attributes']=_0xcdb873[_0x1466('0x2f')]['length']?_0xcdb873['attributes']:_0x232ef9[_0x1466('0x29')];if(_0x18117b[_0x1466('0x2a')][_0x1466('0x39')]){_0xcdb873[_0x1466('0x3a')]=[{'all':!![]}];}_0xcdb873=_[_0x1466('0x38')]({},_0xcdb873,_0x18117b['options']);return db[_0x1466('0x27')][_0x1466('0x40')](_0xcdb873)[_0x1466('0x23')](handleEntityNotFound(_0x4518e0,null))[_0x1466('0x23')](respondWithResult(_0x4518e0,null))[_0x1466('0x3d')](handleError(_0x4518e0,null));};exports[_0x1466('0x41')]=function(_0x4b8c5c,_0x3adf00){return db[_0x1466('0x27')][_0x1466('0x41')](_0x4b8c5c['body'],{})[_0x1466('0x23')](respondWithResult(_0x3adf00,0xc9))[_0x1466('0x3d')](handleError(_0x3adf00,null));};exports[_0x1466('0x42')]=function(_0x355bb2,_0x230475){if(_0x355bb2[_0x1466('0x43')]['id']){delete _0x355bb2[_0x1466('0x43')]['id'];}return db[_0x1466('0x27')][_0x1466('0x40')]({'where':{'id':_0x355bb2[_0x1466('0x3e')]['id']}})['then'](handleEntityNotFound(_0x230475,null))['then'](saveUpdates(_0x355bb2[_0x1466('0x43')],null))[_0x1466('0x23')](respondWithResult(_0x230475,null))[_0x1466('0x3d')](handleError(_0x230475,null));};exports[_0x1466('0x44')]=function(_0x5e3c90,_0x416ed9){return db[_0x1466('0x27')][_0x1466('0x40')]({'where':{'id':_0x5e3c90[_0x1466('0x3e')]['id']}})[_0x1466('0x23')](handleEntityNotFound(_0x416ed9,null))['then'](removeEntity(_0x416ed9,null))[_0x1466('0x3d')](handleError(_0x416ed9,null));};exports[_0x1466('0x45')]=function(_0x46199c,_0x5d62c5,_0x427862){var _0xc26183={};var _0x28678f={};var _0x4e6b7d;var _0x13daf5;return db[_0x1466('0x27')][_0x1466('0x46')]({'where':{'id':_0x46199c[_0x1466('0x3e')]['id']}})[_0x1466('0x23')](handleEntityNotFound(_0x5d62c5,null))['then'](function(_0x464957){if(_0x464957){_0x4e6b7d=_0x464957;_0x28678f[_0x1466('0x29')]=_[_0x1466('0x2b')](db[_0x1466('0x47')][_0x1466('0x3f')]);_0x28678f[_0x1466('0x2a')]=_[_0x1466('0x2b')](_0x46199c[_0x1466('0x2a')]);_0x28678f['filters']=_['intersection'](_0x28678f[_0x1466('0x29')],_0x28678f[_0x1466('0x2a')]);_0xc26183['attributes']=_[_0x1466('0x2c')](_0x28678f[_0x1466('0x29')],qs[_0x1466('0x2d')](_0x46199c[_0x1466('0x2a')][_0x1466('0x2d')]));_0xc26183['attributes']=_0xc26183[_0x1466('0x2f')][_0x1466('0x2e')]?_0xc26183['attributes']:_0x28678f[_0x1466('0x29')];_0xc26183[_0x1466('0x31')]=qs[_0x1466('0x32')](_0x46199c['query'][_0x1466('0x32')]);_0xc26183[_0x1466('0x33')]=qs['filters'](_[_0x1466('0x35')](_0x46199c[_0x1466('0x2a')],_0x28678f[_0x1466('0x34')]));if(_0x46199c[_0x1466('0x2a')][_0x1466('0x36')]){_0xc26183[_0x1466('0x33')]=_['merge'](_0xc26183['where'],{'$or':_[_0x1466('0x26')](_0xc26183[_0x1466('0x2f')],function(_0x142742){var _0xf8731b={};_0xf8731b[_0x142742]={'$like':'%'+_0x46199c[_0x1466('0x2a')]['filter']+'%'};return _0xf8731b;})});}_0xc26183=_['merge']({},_0xc26183,_0x46199c[_0x1466('0x48')]);return _0x4e6b7d[_0x1466('0x45')](_0xc26183);}})['then'](function(_0x33279d){if(_0x33279d){_0x13daf5=_0x33279d[_0x1466('0x2e')];if(!_0x46199c[_0x1466('0x2a')][_0x1466('0x30')](_0x1466('0x49'))){_0xc26183[_0x1466('0x1c')]=qs[_0x1466('0x1c')](_0x46199c[_0x1466('0x2a')][_0x1466('0x1c')]);_0xc26183[_0x1466('0x1a')]=qs['offset'](_0x46199c[_0x1466('0x2a')][_0x1466('0x1a')]);}return _0x4e6b7d[_0x1466('0x45')](_0xc26183);}})[_0x1466('0x23')](function(_0x49cf7){if(_0x49cf7){return _0x49cf7?{'count':_0x13daf5,'rows':_0x49cf7}:null;}})[_0x1466('0x23')](respondWithResult(_0x5d62c5,null))['catch'](handleError(_0x5d62c5,null));};exports[_0x1466('0x4a')]=function(_0xd64cdf,_0x113e2e,_0x34002d){var _0x29418b={};var _0x5a2b33={};var _0x123ad0;var _0x57e643;return db[_0x1466('0x27')][_0x1466('0x46')]({'where':{'id':_0xd64cdf['params']['id']}})['then'](handleEntityNotFound(_0x113e2e,null))[_0x1466('0x23')](function(_0x2b34a3){if(_0x2b34a3){_0x123ad0=_0x2b34a3;_0x5a2b33[_0x1466('0x29')]=_[_0x1466('0x2b')](db[_0x1466('0x47')][_0x1466('0x3f')]);_0x5a2b33[_0x1466('0x2a')]=_[_0x1466('0x2b')](_0xd64cdf[_0x1466('0x2a')]);_0x5a2b33[_0x1466('0x34')]=_[_0x1466('0x2c')](_0x5a2b33[_0x1466('0x29')],_0x5a2b33[_0x1466('0x2a')]);_0x29418b[_0x1466('0x2f')]=_['intersection'](_0x5a2b33[_0x1466('0x29')],qs[_0x1466('0x2d')](_0xd64cdf[_0x1466('0x2a')]['fields']));_0x29418b[_0x1466('0x2f')]=_0x29418b[_0x1466('0x2f')][_0x1466('0x2e')]?_0x29418b[_0x1466('0x2f')]:_0x5a2b33[_0x1466('0x29')];_0x29418b[_0x1466('0x31')]=qs[_0x1466('0x32')](_0xd64cdf[_0x1466('0x2a')]['sort']);_0x29418b['where']=qs[_0x1466('0x34')](_[_0x1466('0x35')](_0xd64cdf[_0x1466('0x2a')],_0x5a2b33[_0x1466('0x34')]));if(_0xd64cdf['query'][_0x1466('0x36')]){_0x29418b['where']=_[_0x1466('0x38')](_0x29418b['where'],{'$or':_[_0x1466('0x26')](_0x29418b[_0x1466('0x2f')],function(_0x243f3a){var _0x40ecc0={};_0x40ecc0[_0x243f3a]={'$like':'%'+_0xd64cdf[_0x1466('0x2a')][_0x1466('0x36')]+'%'};return _0x40ecc0;})});}_0x29418b=_[_0x1466('0x38')]({},_0x29418b,_0xd64cdf[_0x1466('0x48')]);return _0x123ad0[_0x1466('0x4a')](_0x29418b);}})[_0x1466('0x23')](function(_0x459cd9){if(_0x459cd9){_0x57e643=_0x459cd9['length'];if(!_0xd64cdf[_0x1466('0x2a')]['hasOwnProperty']('nolimit')){_0x29418b[_0x1466('0x1c')]=qs[_0x1466('0x1c')](_0xd64cdf['query'][_0x1466('0x1c')]);_0x29418b['offset']=qs['offset'](_0xd64cdf[_0x1466('0x2a')][_0x1466('0x1a')]);}return _0x123ad0[_0x1466('0x4a')](_0x29418b);}})[_0x1466('0x23')](function(_0x2fbb57){if(_0x2fbb57){return _0x2fbb57?{'count':_0x57e643,'rows':_0x2fbb57}:null;}})['then'](respondWithResult(_0x113e2e,null))[_0x1466('0x3d')](handleError(_0x113e2e,null));};exports[_0x1466('0x4b')]=function(_0x2be0f8,_0xff458b,_0x2a1be9){var _0x40e4ad={};var _0x1bee7c={};var _0x977fed;var _0x57a706;return db[_0x1466('0x27')][_0x1466('0x46')]({'where':{'id':_0x2be0f8['params']['id']}})[_0x1466('0x23')](handleEntityNotFound(_0xff458b,null))['then'](function(_0x312860){if(_0x312860){_0x977fed=_0x312860;_0x1bee7c[_0x1466('0x29')]=_[_0x1466('0x2b')](db[_0x1466('0x47')][_0x1466('0x3f')]);_0x1bee7c[_0x1466('0x2a')]=_[_0x1466('0x2b')](_0x2be0f8[_0x1466('0x2a')]);_0x1bee7c[_0x1466('0x34')]=_[_0x1466('0x2c')](_0x1bee7c[_0x1466('0x29')],_0x1bee7c[_0x1466('0x2a')]);_0x40e4ad[_0x1466('0x2f')]=_[_0x1466('0x2c')](_0x1bee7c[_0x1466('0x29')],qs[_0x1466('0x2d')](_0x2be0f8[_0x1466('0x2a')]['fields']));_0x40e4ad['attributes']=_0x40e4ad[_0x1466('0x2f')][_0x1466('0x2e')]?_0x40e4ad['attributes']:_0x1bee7c['model'];_0x40e4ad['order']=qs[_0x1466('0x32')](_0x2be0f8[_0x1466('0x2a')][_0x1466('0x32')]);_0x40e4ad[_0x1466('0x33')]=qs[_0x1466('0x34')](_[_0x1466('0x35')](_0x2be0f8['query'],_0x1bee7c['filters']));if(_0x2be0f8['query'][_0x1466('0x36')]){_0x40e4ad[_0x1466('0x33')]=_[_0x1466('0x38')](_0x40e4ad[_0x1466('0x33')],{'$or':_[_0x1466('0x26')](_0x40e4ad[_0x1466('0x2f')],function(_0x17f130){var _0x2512c3={};_0x2512c3[_0x17f130]={'$like':'%'+_0x2be0f8[_0x1466('0x2a')]['filter']+'%'};return _0x2512c3;})});}_0x40e4ad=_[_0x1466('0x38')]({},_0x40e4ad,_0x2be0f8[_0x1466('0x48')]);return _0x977fed[_0x1466('0x4b')](_0x40e4ad);}})[_0x1466('0x23')](function(_0x4729df){if(_0x4729df){_0x57a706=_0x4729df[_0x1466('0x2e')];if(!_0x2be0f8[_0x1466('0x2a')][_0x1466('0x30')]('nolimit')){_0x40e4ad['limit']=qs[_0x1466('0x1c')](_0x2be0f8[_0x1466('0x2a')]['limit']);_0x40e4ad[_0x1466('0x1a')]=qs[_0x1466('0x1a')](_0x2be0f8[_0x1466('0x2a')][_0x1466('0x1a')]);}return _0x977fed['getDescriptions'](_0x40e4ad);}})[_0x1466('0x23')](function(_0x2d9bca){if(_0x2d9bca){return _0x2d9bca?{'count':_0x57a706,'rows':_0x2d9bca}:null;}})[_0x1466('0x23')](respondWithResult(_0xff458b,null))['catch'](handleError(_0xff458b,null));};
\ No newline at end of file
+var _0xbd32=['VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','create','body','update','getFields','getSubjects','ServicenowField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','index','map','ServicenowConfiguration','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type'];(function(_0x3816e6,_0x2604ec){var _0x1f3e88=function(_0x3aa718){while(--_0x3aa718){_0x3816e6['push'](_0x3816e6['shift']());}};_0x1f3e88(++_0x2604ec);}(_0xbd32,0xfd));var _0x2bd3=function(_0x2f8255,_0x44ff85){_0x2f8255=_0x2f8255-0x0;var _0x2207f6=_0xbd32[_0x2f8255];return _0x2207f6;};'use strict';var emlformat=require(_0x2bd3('0x0'));var rimraf=require(_0x2bd3('0x1'));var zipdir=require(_0x2bd3('0x2'));var jsonpatch=require(_0x2bd3('0x3'));var rp=require(_0x2bd3('0x4'));var moment=require('moment');var BPromise=require(_0x2bd3('0x5'));var Mustache=require(_0x2bd3('0x6'));var util=require(_0x2bd3('0x7'));var path=require(_0x2bd3('0x8'));var sox=require(_0x2bd3('0x9'));var csv=require('to-csv');var ejs=require(_0x2bd3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2bd3('0xb'));var squel=require(_0x2bd3('0xc'));var crypto=require(_0x2bd3('0xd'));var jsforce=require(_0x2bd3('0xe'));var deskjs=require(_0x2bd3('0xf'));var toCsv=require(_0x2bd3('0x10'));var querystring=require(_0x2bd3('0x11'));var Papa=require(_0x2bd3('0x12'));var Redis=require(_0x2bd3('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x2bd3('0x14'));var as=require(_0x2bd3('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2bd3('0x16'))(_0x2bd3('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2bd3('0x18'));var db=require(_0x2bd3('0x19'))['db'];function respondWithStatusCode(_0x5d8362,_0x26a3b4){_0x26a3b4=_0x26a3b4||0xcc;return function(_0x5755b2){if(_0x5755b2){return _0x5d8362['sendStatus'](_0x26a3b4);}return _0x5d8362[_0x2bd3('0x1a')](_0x26a3b4)['end']();};}function respondWithResult(_0x4e6e99,_0x2a69ea){_0x2a69ea=_0x2a69ea||0xc8;return function(_0x2832ca){if(_0x2832ca){return _0x4e6e99[_0x2bd3('0x1a')](_0x2a69ea)[_0x2bd3('0x1b')](_0x2832ca);}};}function respondWithFilteredResult(_0x55c48a,_0x16e24){return function(_0x3b60ec){if(_0x3b60ec){var _0x9703f3=typeof _0x16e24[_0x2bd3('0x1c')]===_0x2bd3('0x1d')&&typeof _0x16e24['limit']===_0x2bd3('0x1d');var _0x5d51c0=_0x3b60ec[_0x2bd3('0x1e')];var _0x32d877=_0x9703f3?0x0:_0x16e24[_0x2bd3('0x1c')];var _0x5b053c=_0x9703f3?_0x3b60ec[_0x2bd3('0x1e')]:_0x16e24['offset']+_0x16e24[_0x2bd3('0x1f')];var _0x144c4c;if(_0x5b053c>=_0x5d51c0){_0x5b053c=_0x5d51c0;_0x144c4c=0xc8;}else{_0x144c4c=0xce;}_0x55c48a[_0x2bd3('0x1a')](_0x144c4c);return _0x55c48a[_0x2bd3('0x20')](_0x2bd3('0x21'),_0x32d877+'-'+_0x5b053c+'/'+_0x5d51c0)[_0x2bd3('0x1b')](_0x3b60ec);}return null;};}function patchUpdates(_0x26ee9d){return function(_0x5a9aab){try{jsonpatch['apply'](_0x5a9aab,_0x26ee9d,!![]);}catch(_0x5730da){return BPromise[_0x2bd3('0x22')](_0x5730da);}return _0x5a9aab[_0x2bd3('0x23')]();};}function saveUpdates(_0x5574ce,_0x208632){return function(_0x16450e){if(_0x16450e){return _0x16450e['update'](_0x5574ce)[_0x2bd3('0x24')](function(_0x428404){return _0x428404;});}return null;};}function removeEntity(_0x9e0197,_0x25ac44){return function(_0x512fa8){if(_0x512fa8){return _0x512fa8[_0x2bd3('0x25')]()[_0x2bd3('0x24')](function(){_0x9e0197[_0x2bd3('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x341331,_0x505dee){return function(_0x152f50){if(!_0x152f50){_0x341331[_0x2bd3('0x26')](0x194);}return _0x152f50;};}function handleError(_0x2aaf4a,_0x64da63){_0x64da63=_0x64da63||0x1f4;return function(_0x30674b){logger[_0x2bd3('0x27')](_0x30674b[_0x2bd3('0x28')]);if(_0x30674b[_0x2bd3('0x29')]){delete _0x30674b[_0x2bd3('0x29')];}_0x2aaf4a[_0x2bd3('0x1a')](_0x64da63)['send'](_0x30674b);};}exports[_0x2bd3('0x2a')]=function(_0x4bdbab,_0x13f4f0){var _0xd05969={},_0x2e6a3b={},_0x553d27={'count':0x0,'rows':[]};var _0x472b9f=_[_0x2bd3('0x2b')](db[_0x2bd3('0x2c')][_0x2bd3('0x2d')],function(_0x5b18c0){return{'name':_0x5b18c0[_0x2bd3('0x2e')],'type':_0x5b18c0['type']['key']};});_0x2e6a3b['model']=_[_0x2bd3('0x2b')](_0x472b9f,_0x2bd3('0x29'));_0x2e6a3b[_0x2bd3('0x2f')]=_[_0x2bd3('0x30')](_0x4bdbab[_0x2bd3('0x2f')]);_0x2e6a3b[_0x2bd3('0x31')]=_[_0x2bd3('0x32')](_0x2e6a3b[_0x2bd3('0x33')],_0x2e6a3b[_0x2bd3('0x2f')]);_0xd05969[_0x2bd3('0x34')]=_[_0x2bd3('0x32')](_0x2e6a3b['model'],qs[_0x2bd3('0x35')](_0x4bdbab[_0x2bd3('0x2f')]['fields']));_0xd05969['attributes']=_0xd05969[_0x2bd3('0x34')][_0x2bd3('0x36')]?_0xd05969['attributes']:_0x2e6a3b['model'];if(!_0x4bdbab['query'][_0x2bd3('0x37')](_0x2bd3('0x38'))){_0xd05969[_0x2bd3('0x1f')]=qs[_0x2bd3('0x1f')](_0x4bdbab[_0x2bd3('0x2f')][_0x2bd3('0x1f')]);_0xd05969[_0x2bd3('0x1c')]=qs[_0x2bd3('0x1c')](_0x4bdbab[_0x2bd3('0x2f')][_0x2bd3('0x1c')]);}_0xd05969[_0x2bd3('0x39')]=qs[_0x2bd3('0x3a')](_0x4bdbab[_0x2bd3('0x2f')][_0x2bd3('0x3a')]);_0xd05969[_0x2bd3('0x3b')]=qs[_0x2bd3('0x31')](_[_0x2bd3('0x3c')](_0x4bdbab[_0x2bd3('0x2f')],_0x2e6a3b[_0x2bd3('0x31')]),_0x472b9f);if(_0x4bdbab['query'][_0x2bd3('0x3d')]){_0xd05969['where']=_['merge'](_0xd05969['where'],{'$or':_[_0x2bd3('0x2b')](_0x472b9f,function(_0x4d6742){if(_0x4d6742[_0x2bd3('0x3e')]!==_0x2bd3('0x3f')){var _0x16d0ab={};_0x16d0ab[_0x4d6742[_0x2bd3('0x29')]]={'$like':'%'+_0x4bdbab[_0x2bd3('0x2f')][_0x2bd3('0x3d')]+'%'};return _0x16d0ab;}})});}_0xd05969=_[_0x2bd3('0x40')]({},_0xd05969,_0x4bdbab[_0x2bd3('0x41')]);var _0x132b4b={'where':_0xd05969[_0x2bd3('0x3b')]};return db[_0x2bd3('0x2c')][_0x2bd3('0x1e')](_0x132b4b)[_0x2bd3('0x24')](function(_0x396781){_0x553d27[_0x2bd3('0x1e')]=_0x396781;if(_0x4bdbab[_0x2bd3('0x2f')][_0x2bd3('0x42')]){_0xd05969[_0x2bd3('0x43')]=[{'all':!![]}];}return db[_0x2bd3('0x2c')][_0x2bd3('0x44')](_0xd05969);})['then'](function(_0x9263ce){_0x553d27['rows']=_0x9263ce;return _0x553d27;})['then'](respondWithFilteredResult(_0x13f4f0,_0xd05969))[_0x2bd3('0x45')](handleError(_0x13f4f0,null));};exports[_0x2bd3('0x46')]=function(_0x14e597,_0x4993ac){var _0x7e2d3a={'raw':![],'where':{'id':_0x14e597[_0x2bd3('0x47')]['id']}},_0x1b875d={};_0x1b875d[_0x2bd3('0x33')]=_[_0x2bd3('0x30')](db[_0x2bd3('0x2c')][_0x2bd3('0x2d')]);_0x1b875d[_0x2bd3('0x2f')]=_['keys'](_0x14e597[_0x2bd3('0x2f')]);_0x1b875d[_0x2bd3('0x31')]=_[_0x2bd3('0x32')](_0x1b875d[_0x2bd3('0x33')],_0x1b875d[_0x2bd3('0x2f')]);_0x7e2d3a[_0x2bd3('0x34')]=_[_0x2bd3('0x32')](_0x1b875d[_0x2bd3('0x33')],qs[_0x2bd3('0x35')](_0x14e597[_0x2bd3('0x2f')]['fields']));_0x7e2d3a[_0x2bd3('0x34')]=_0x7e2d3a[_0x2bd3('0x34')][_0x2bd3('0x36')]?_0x7e2d3a[_0x2bd3('0x34')]:_0x1b875d[_0x2bd3('0x33')];if(_0x14e597[_0x2bd3('0x2f')][_0x2bd3('0x42')]){_0x7e2d3a['include']=[{'all':!![]}];}_0x7e2d3a=_['merge']({},_0x7e2d3a,_0x14e597['options']);return db[_0x2bd3('0x2c')]['find'](_0x7e2d3a)[_0x2bd3('0x24')](handleEntityNotFound(_0x4993ac,null))[_0x2bd3('0x24')](respondWithResult(_0x4993ac,null))[_0x2bd3('0x45')](handleError(_0x4993ac,null));};exports[_0x2bd3('0x48')]=function(_0x4f8d24,_0x369a93){return db[_0x2bd3('0x2c')][_0x2bd3('0x48')](_0x4f8d24[_0x2bd3('0x49')],{})['then'](respondWithResult(_0x369a93,0xc9))[_0x2bd3('0x45')](handleError(_0x369a93,null));};exports[_0x2bd3('0x4a')]=function(_0x2748d3,_0x40c634){if(_0x2748d3[_0x2bd3('0x49')]['id']){delete _0x2748d3[_0x2bd3('0x49')]['id'];}return db['ServicenowConfiguration']['find']({'where':{'id':_0x2748d3[_0x2bd3('0x47')]['id']}})[_0x2bd3('0x24')](handleEntityNotFound(_0x40c634,null))[_0x2bd3('0x24')](saveUpdates(_0x2748d3[_0x2bd3('0x49')],null))[_0x2bd3('0x24')](respondWithResult(_0x40c634,null))[_0x2bd3('0x45')](handleError(_0x40c634,null));};exports['destroy']=function(_0x3182c4,_0x11d882){return db[_0x2bd3('0x2c')]['find']({'where':{'id':_0x3182c4['params']['id']}})[_0x2bd3('0x24')](handleEntityNotFound(_0x11d882,null))[_0x2bd3('0x24')](removeEntity(_0x11d882,null))['catch'](handleError(_0x11d882,null));};exports[_0x2bd3('0x4b')]=function(_0x2e66b4,_0xc5cd8b,_0x24b5bf){var _0x5c94fa={};var _0x499b53={};var _0x52e8af;var _0x4c43b6;return db[_0x2bd3('0x2c')]['findOne']({'where':{'id':_0x2e66b4[_0x2bd3('0x47')]['id']}})[_0x2bd3('0x24')](handleEntityNotFound(_0xc5cd8b,null))[_0x2bd3('0x24')](function(_0x280d45){if(_0x280d45){_0x52e8af=_0x280d45;_0x499b53[_0x2bd3('0x33')]=_['keys'](db['ServicenowField'][_0x2bd3('0x2d')]);_0x499b53[_0x2bd3('0x2f')]=_[_0x2bd3('0x30')](_0x2e66b4[_0x2bd3('0x2f')]);_0x499b53[_0x2bd3('0x31')]=_[_0x2bd3('0x32')](_0x499b53[_0x2bd3('0x33')],_0x499b53['query']);_0x5c94fa['attributes']=_[_0x2bd3('0x32')](_0x499b53[_0x2bd3('0x33')],qs[_0x2bd3('0x35')](_0x2e66b4['query']['fields']));_0x5c94fa[_0x2bd3('0x34')]=_0x5c94fa['attributes'][_0x2bd3('0x36')]?_0x5c94fa[_0x2bd3('0x34')]:_0x499b53['model'];_0x5c94fa[_0x2bd3('0x39')]=qs[_0x2bd3('0x3a')](_0x2e66b4['query'][_0x2bd3('0x3a')]);_0x5c94fa[_0x2bd3('0x3b')]=qs[_0x2bd3('0x31')](_['pick'](_0x2e66b4[_0x2bd3('0x2f')],_0x499b53[_0x2bd3('0x31')]));if(_0x2e66b4[_0x2bd3('0x2f')]['filter']){_0x5c94fa[_0x2bd3('0x3b')]=_[_0x2bd3('0x40')](_0x5c94fa[_0x2bd3('0x3b')],{'$or':_['map'](_0x5c94fa[_0x2bd3('0x34')],function(_0x24c386){var _0xc691c6={};_0xc691c6[_0x24c386]={'$like':'%'+_0x2e66b4[_0x2bd3('0x2f')][_0x2bd3('0x3d')]+'%'};return _0xc691c6;})});}_0x5c94fa=_[_0x2bd3('0x40')]({},_0x5c94fa,_0x2e66b4[_0x2bd3('0x41')]);return _0x52e8af[_0x2bd3('0x4b')](_0x5c94fa);}})['then'](function(_0x1c8f6e){if(_0x1c8f6e){_0x4c43b6=_0x1c8f6e['length'];if(!_0x2e66b4[_0x2bd3('0x2f')][_0x2bd3('0x37')](_0x2bd3('0x38'))){_0x5c94fa['limit']=qs[_0x2bd3('0x1f')](_0x2e66b4['query']['limit']);_0x5c94fa[_0x2bd3('0x1c')]=qs[_0x2bd3('0x1c')](_0x2e66b4[_0x2bd3('0x2f')]['offset']);}return _0x52e8af[_0x2bd3('0x4b')](_0x5c94fa);}})[_0x2bd3('0x24')](function(_0x280c2d){if(_0x280c2d){return _0x280c2d?{'count':_0x4c43b6,'rows':_0x280c2d}:null;}})['then'](respondWithResult(_0xc5cd8b,null))[_0x2bd3('0x45')](handleError(_0xc5cd8b,null));};exports[_0x2bd3('0x4c')]=function(_0x20d68c,_0x29fbc2,_0x15e0a2){var _0x3b06d8={};var _0x3f1fda={};var _0x1c6806;var _0xf18222;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x20d68c[_0x2bd3('0x47')]['id']}})[_0x2bd3('0x24')](handleEntityNotFound(_0x29fbc2,null))[_0x2bd3('0x24')](function(_0x1311ca){if(_0x1311ca){_0x1c6806=_0x1311ca;_0x3f1fda[_0x2bd3('0x33')]=_[_0x2bd3('0x30')](db[_0x2bd3('0x4d')][_0x2bd3('0x2d')]);_0x3f1fda[_0x2bd3('0x2f')]=_[_0x2bd3('0x30')](_0x20d68c[_0x2bd3('0x2f')]);_0x3f1fda[_0x2bd3('0x31')]=_['intersection'](_0x3f1fda[_0x2bd3('0x33')],_0x3f1fda[_0x2bd3('0x2f')]);_0x3b06d8[_0x2bd3('0x34')]=_[_0x2bd3('0x32')](_0x3f1fda[_0x2bd3('0x33')],qs[_0x2bd3('0x35')](_0x20d68c[_0x2bd3('0x2f')][_0x2bd3('0x35')]));_0x3b06d8['attributes']=_0x3b06d8[_0x2bd3('0x34')][_0x2bd3('0x36')]?_0x3b06d8[_0x2bd3('0x34')]:_0x3f1fda[_0x2bd3('0x33')];_0x3b06d8['order']=qs['sort'](_0x20d68c['query'][_0x2bd3('0x3a')]);_0x3b06d8[_0x2bd3('0x3b')]=qs[_0x2bd3('0x31')](_['pick'](_0x20d68c[_0x2bd3('0x2f')],_0x3f1fda[_0x2bd3('0x31')]));if(_0x20d68c[_0x2bd3('0x2f')][_0x2bd3('0x3d')]){_0x3b06d8[_0x2bd3('0x3b')]=_[_0x2bd3('0x40')](_0x3b06d8['where'],{'$or':_[_0x2bd3('0x2b')](_0x3b06d8[_0x2bd3('0x34')],function(_0x158820){var _0x3d077e={};_0x3d077e[_0x158820]={'$like':'%'+_0x20d68c['query'][_0x2bd3('0x3d')]+'%'};return _0x3d077e;})});}_0x3b06d8=_['merge']({},_0x3b06d8,_0x20d68c[_0x2bd3('0x41')]);return _0x1c6806['getSubjects'](_0x3b06d8);}})['then'](function(_0x3bb4cf){if(_0x3bb4cf){_0xf18222=_0x3bb4cf[_0x2bd3('0x36')];if(!_0x20d68c[_0x2bd3('0x2f')][_0x2bd3('0x37')](_0x2bd3('0x38'))){_0x3b06d8[_0x2bd3('0x1f')]=qs[_0x2bd3('0x1f')](_0x20d68c[_0x2bd3('0x2f')]['limit']);_0x3b06d8[_0x2bd3('0x1c')]=qs[_0x2bd3('0x1c')](_0x20d68c[_0x2bd3('0x2f')]['offset']);}return _0x1c6806[_0x2bd3('0x4c')](_0x3b06d8);}})['then'](function(_0x1318c0){if(_0x1318c0){return _0x1318c0?{'count':_0xf18222,'rows':_0x1318c0}:null;}})[_0x2bd3('0x24')](respondWithResult(_0x29fbc2,null))[_0x2bd3('0x45')](handleError(_0x29fbc2,null));};exports[_0x2bd3('0x4e')]=function(_0x21548f,_0x562c06,_0x2f0fb9){var _0x4f76df={};var _0x7aa56e={};var _0xa62a7e;var _0x166d6b;return db[_0x2bd3('0x2c')]['findOne']({'where':{'id':_0x21548f[_0x2bd3('0x47')]['id']}})['then'](handleEntityNotFound(_0x562c06,null))[_0x2bd3('0x24')](function(_0x3ce63d){if(_0x3ce63d){_0xa62a7e=_0x3ce63d;_0x7aa56e[_0x2bd3('0x33')]=_[_0x2bd3('0x30')](db[_0x2bd3('0x4d')][_0x2bd3('0x2d')]);_0x7aa56e[_0x2bd3('0x2f')]=_[_0x2bd3('0x30')](_0x21548f[_0x2bd3('0x2f')]);_0x7aa56e[_0x2bd3('0x31')]=_[_0x2bd3('0x32')](_0x7aa56e['model'],_0x7aa56e[_0x2bd3('0x2f')]);_0x4f76df[_0x2bd3('0x34')]=_[_0x2bd3('0x32')](_0x7aa56e[_0x2bd3('0x33')],qs[_0x2bd3('0x35')](_0x21548f[_0x2bd3('0x2f')][_0x2bd3('0x35')]));_0x4f76df[_0x2bd3('0x34')]=_0x4f76df[_0x2bd3('0x34')][_0x2bd3('0x36')]?_0x4f76df[_0x2bd3('0x34')]:_0x7aa56e['model'];_0x4f76df[_0x2bd3('0x39')]=qs['sort'](_0x21548f[_0x2bd3('0x2f')]['sort']);_0x4f76df['where']=qs[_0x2bd3('0x31')](_[_0x2bd3('0x3c')](_0x21548f[_0x2bd3('0x2f')],_0x7aa56e[_0x2bd3('0x31')]));if(_0x21548f['query']['filter']){_0x4f76df[_0x2bd3('0x3b')]=_[_0x2bd3('0x40')](_0x4f76df[_0x2bd3('0x3b')],{'$or':_[_0x2bd3('0x2b')](_0x4f76df[_0x2bd3('0x34')],function(_0x1e8f50){var _0x1f1c9a={};_0x1f1c9a[_0x1e8f50]={'$like':'%'+_0x21548f[_0x2bd3('0x2f')][_0x2bd3('0x3d')]+'%'};return _0x1f1c9a;})});}_0x4f76df=_['merge']({},_0x4f76df,_0x21548f[_0x2bd3('0x41')]);return _0xa62a7e[_0x2bd3('0x4e')](_0x4f76df);}})['then'](function(_0x4a52d4){if(_0x4a52d4){_0x166d6b=_0x4a52d4[_0x2bd3('0x36')];if(!_0x21548f[_0x2bd3('0x2f')][_0x2bd3('0x37')]('nolimit')){_0x4f76df[_0x2bd3('0x1f')]=qs[_0x2bd3('0x1f')](_0x21548f['query'][_0x2bd3('0x1f')]);_0x4f76df['offset']=qs['offset'](_0x21548f['query']['offset']);}return _0xa62a7e[_0x2bd3('0x4e')](_0x4f76df);}})[_0x2bd3('0x24')](function(_0x5b87a1){if(_0x5b87a1){return _0x5b87a1?{'count':_0x166d6b,'rows':_0x5b87a1}:null;}})[_0x2bd3('0x24')](respondWithResult(_0x562c06,null))[_0x2bd3('0x45')](handleError(_0x562c06,null));};
\ No newline at end of file
index 71d62a1..9dfe9e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcefd=['int_servicenow_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xcefd,0x1bd));var _0xdcef=function(_0x369870,_0x101450){_0x369870=_0x369870-0x0;var _0x30b359=_0xcefd[_0x369870];return _0x30b359;};'use strict';var _=require('lodash');var util=require(_0xdcef('0x0'));var logger=require(_0xdcef('0x1'))(_0xdcef('0x2'));var moment=require(_0xdcef('0x3'));var BPromise=require(_0xdcef('0x4'));var rp=require(_0xdcef('0x5'));var fs=require('fs');var path=require(_0xdcef('0x6'));var rimraf=require('rimraf');var config=require(_0xdcef('0x7'));var attributes=require(_0xdcef('0x8'));module[_0xdcef('0x9')]=function(_0x373ed9,_0x31c2d4){return _0x373ed9['define'](_0xdcef('0xa'),attributes,{'tableName':_0xdcef('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3070=['bluebird','request-promise','path','rimraf','exports','define','int_servicenow_configurations','util','api','moment'];(function(_0x311f44,_0x1d7f5b){var _0x46f1e6=function(_0x27342a){while(--_0x27342a){_0x311f44['push'](_0x311f44['shift']());}};_0x46f1e6(++_0x1d7f5b);}(_0x3070,0x75));var _0x0307=function(_0x4141bb,_0x885062){_0x4141bb=_0x4141bb-0x0;var _0x2e72d6=_0x3070[_0x4141bb];return _0x2e72d6;};'use strict';var _=require('lodash');var util=require(_0x0307('0x0'));var logger=require('../../config/logger')(_0x0307('0x1'));var moment=require(_0x0307('0x2'));var BPromise=require(_0x0307('0x3'));var rp=require(_0x0307('0x4'));var fs=require('fs');var path=require(_0x0307('0x5'));var rimraf=require(_0x0307('0x6'));var config=require('../../config/environment');var attributes=require('./intServicenowConfiguration.attributes');module[_0x0307('0x7')]=function(_0x1d3d56,_0xf9f4c0){return _0x1d3d56[_0x0307('0x8')]('ServicenowConfiguration',attributes,{'tableName':_0x0307('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2cf6abc..47c74bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44c2=['ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x2d126e,_0x1e8257){var _0xcb04d3=function(_0x19a2d9){while(--_0x19a2d9){_0x2d126e['push'](_0x2d126e['shift']());}};_0xcb04d3(++_0x1e8257);}(_0x44c2,0x100));var _0x244c=function(_0x445101,_0x2414bf){_0x445101=_0x445101-0x0;var _0x3c3d04=_0x44c2[_0x445101];return _0x3c3d04;};'use strict';var _=require(_0x244c('0x0'));var util=require(_0x244c('0x1'));var moment=require(_0x244c('0x2'));var BPromise=require(_0x244c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x244c('0x4'));var db=require(_0x244c('0x5'))['db'];var utils=require(_0x244c('0x6'));var logger=require(_0x244c('0x7'))(_0x244c('0x8'));var config=require(_0x244c('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x244c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c758e,_0x18491b,_0x5b49a1){return new BPromise(function(_0x54b673,_0x1a0f7d){return client[_0x244c('0xb')](_0x4c758e,_0x5b49a1)['then'](function(_0xf5430e){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x18491b,_0x244c('0xc'));logger['debug'](_0x244c('0xd'),_0x18491b,'request\x20sent',JSON[_0x244c('0xe')](_0xf5430e));if(_0xf5430e['error']){if(_0xf5430e['error'][_0x244c('0xf')]===0x1f4){logger[_0x244c('0x10')](_0x244c('0x11'),_0x18491b,_0xf5430e['error'][_0x244c('0x12')]);return _0x1a0f7d(_0xf5430e[_0x244c('0x10')][_0x244c('0x12')]);}logger[_0x244c('0x10')](_0x244c('0x11'),_0x18491b,_0xf5430e[_0x244c('0x10')][_0x244c('0x12')]);return _0x54b673(_0xf5430e['error'][_0x244c('0x12')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x18491b,_0x244c('0xc'));_0x54b673(_0xf5430e[_0x244c('0x13')][_0x244c('0x12')]);}})[_0x244c('0x14')](function(_0x5f2a11){logger[_0x244c('0x10')](_0x244c('0x11'),_0x18491b,_0x5f2a11);_0x1a0f7d(_0x5f2a11);});});}
\ No newline at end of file
+var _0x8585=['lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x368e09,_0x2c1517){var _0x14b7df=function(_0x5002af){while(--_0x5002af){_0x368e09['push'](_0x368e09['shift']());}};_0x14b7df(++_0x2c1517);}(_0x8585,0x64));var _0x5858=function(_0x1a855c,_0x57b2fd){_0x1a855c=_0x1a855c-0x0;var _0x284473=_0x8585[_0x1a855c];return _0x284473;};'use strict';var _=require(_0x5858('0x0'));var util=require(_0x5858('0x1'));var moment=require(_0x5858('0x2'));var BPromise=require('bluebird');var rs=require(_0x5858('0x3'));var fs=require('fs');var Redis=require(_0x5858('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5858('0x5'));var config=require(_0x5858('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5858('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1d26d1,_0x3fd63f,_0x5c8e94){return new BPromise(function(_0x4d5efe,_0x46f019){return client[_0x5858('0x8')](_0x1d26d1,_0x5c8e94)['then'](function(_0x490bce){logger[_0x5858('0x9')](_0x5858('0xa'),_0x3fd63f,'request\x20sent');logger[_0x5858('0xb')](_0x5858('0xc'),_0x3fd63f,_0x5858('0xd'),JSON[_0x5858('0xe')](_0x490bce));if(_0x490bce[_0x5858('0xf')]){if(_0x490bce[_0x5858('0xf')][_0x5858('0x10')]===0x1f4){logger[_0x5858('0xf')](_0x5858('0xa'),_0x3fd63f,_0x490bce['error'][_0x5858('0x11')]);return _0x46f019(_0x490bce[_0x5858('0xf')][_0x5858('0x11')]);}logger['error'](_0x5858('0xa'),_0x3fd63f,_0x490bce[_0x5858('0xf')][_0x5858('0x11')]);return _0x4d5efe(_0x490bce[_0x5858('0xf')][_0x5858('0x11')]);}else{logger[_0x5858('0x9')](_0x5858('0xa'),_0x3fd63f,_0x5858('0xd'));_0x4d5efe(_0x490bce[_0x5858('0x12')][_0x5858('0x11')]);}})[_0x5858('0x13')](function(_0x310e4c){logger[_0x5858('0xf')](_0x5858('0xa'),_0x3fd63f,_0x310e4c);_0x46f019(_0x310e4c);});});}
\ No newline at end of file
index 3e2a9f0..cee6c48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87ca=['post','create','put','update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id'];(function(_0x508ed6,_0x5f4ee9){var _0x7ad26a=function(_0x4ec9a1){while(--_0x4ec9a1){_0x508ed6['push'](_0x508ed6['shift']());}};_0x7ad26a(++_0x5f4ee9);}(_0x87ca,0x193));var _0xa87c=function(_0x11b8f9,_0x251834){_0x11b8f9=_0x11b8f9-0x0;var _0x51977d=_0x87ca[_0x11b8f9];return _0x51977d;};'use strict';var multer=require(_0xa87c('0x0'));var util=require(_0xa87c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa87c('0x2')]();var fs_extra=require(_0xa87c('0x3'));var auth=require(_0xa87c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa87c('0x5'));var controller=require(_0xa87c('0x6'));router[_0xa87c('0x7')]('/',auth[_0xa87c('0x8')](),controller[_0xa87c('0x9')]);router[_0xa87c('0x7')](_0xa87c('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xa87c('0xb')]('/',auth[_0xa87c('0x8')](),controller[_0xa87c('0xc')]);router[_0xa87c('0xd')](_0xa87c('0xa'),auth[_0xa87c('0x8')](),controller[_0xa87c('0xe')]);router[_0xa87c('0xf')](_0xa87c('0xa'),auth[_0xa87c('0x8')](),controller[_0xa87c('0x10')]);module[_0xa87c('0x11')]=router;
\ No newline at end of file
+var _0x29df=['delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowField.controller','isAuthenticated','index','/:id','show','post','put'];(function(_0x49eac0,_0x3506e0){var _0x544471=function(_0x3ac3a3){while(--_0x3ac3a3){_0x49eac0['push'](_0x49eac0['shift']());}};_0x544471(++_0x3506e0);}(_0x29df,0x1bc));var _0xf29d=function(_0x37278f,_0x6edcd9){_0x37278f=_0x37278f-0x0;var _0x4ad543=_0x29df[_0x37278f];return _0x4ad543;};'use strict';var multer=require(_0xf29d('0x0'));var util=require('util');var path=require(_0xf29d('0x1'));var timeout=require(_0xf29d('0x2'));var express=require(_0xf29d('0x3'));var router=express[_0xf29d('0x4')]();var fs_extra=require(_0xf29d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf29d('0x6'));var config=require(_0xf29d('0x7'));var controller=require(_0xf29d('0x8'));router['get']('/',auth[_0xf29d('0x9')](),controller[_0xf29d('0xa')]);router['get'](_0xf29d('0xb'),auth['isAuthenticated'](),controller[_0xf29d('0xc')]);router[_0xf29d('0xd')]('/',auth[_0xf29d('0x9')](),controller['create']);router[_0xf29d('0xe')]('/:id',auth[_0xf29d('0x9')](),controller['update']);router[_0xf29d('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xf29d('0x10')]);module['exports']=router;
\ No newline at end of file
index 9e4623d..6493de9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cfb=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x466f6c,_0x4645b9){var _0x53c9ed=function(_0x3746a1){while(--_0x3746a1){_0x466f6c['push'](_0x466f6c['shift']());}};_0x53c9ed(++_0x4645b9);}(_0x5cfb,0x6a));var _0xb5cf=function(_0x339411,_0x47f05c){_0x339411=_0x339411-0x0;var _0x9c19a9=_0x5cfb[_0x339411];return _0x9c19a9;};'use strict';var Sequelize=require(_0xb5cf('0x0'));module[_0xb5cf('0x1')]={'type':{'type':Sequelize[_0xb5cf('0x2')](_0xb5cf('0x3'),_0xb5cf('0x4'),_0xb5cf('0x5'),_0xb5cf('0x6'),_0xb5cf('0x7')),'defaultValue':_0xb5cf('0x3')},'content':{'type':Sequelize[_0xb5cf('0x8')]},'key':{'type':Sequelize[_0xb5cf('0x8')]},'keyType':{'type':Sequelize[_0xb5cf('0x2')](_0xb5cf('0x3'),_0xb5cf('0x4'),_0xb5cf('0x5'))},'keyContent':{'type':Sequelize[_0xb5cf('0x8')]},'idField':{'type':Sequelize[_0xb5cf('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xb5cf('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb5cf('0x8')]}};
\ No newline at end of file
+var _0x3aa1=['STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string','keyValue'];(function(_0x44ac93,_0x45c79f){var _0x3505fe=function(_0x220cad){while(--_0x220cad){_0x44ac93['push'](_0x44ac93['shift']());}};_0x3505fe(++_0x45c79f);}(_0x3aa1,0xa3));var _0x13aa=function(_0x52eb3d,_0x14377a){_0x52eb3d=_0x52eb3d-0x0;var _0x11dc80=_0x3aa1[_0x52eb3d];return _0x11dc80;};'use strict';var Sequelize=require(_0x13aa('0x0'));module[_0x13aa('0x1')]={'type':{'type':Sequelize[_0x13aa('0x2')](_0x13aa('0x3'),'variable','customVariable',_0x13aa('0x4'),'picklist'),'defaultValue':_0x13aa('0x3')},'content':{'type':Sequelize[_0x13aa('0x5')]},'key':{'type':Sequelize[_0x13aa('0x5')]},'keyType':{'type':Sequelize[_0x13aa('0x2')](_0x13aa('0x3'),'variable',_0x13aa('0x6'))},'keyContent':{'type':Sequelize[_0x13aa('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x13aa('0x5')]},'customField':{'type':Sequelize[_0x13aa('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x13aa('0x5')]}};
\ No newline at end of file
index efa6cce..154f9c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x633f=['json','offset','limit','count','set','save','update','then','stack','name','send','index','ServicenowField','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','destroy','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x393658,_0x4f642b){var _0x23f7e6=function(_0x37cc9d){while(--_0x37cc9d){_0x393658['push'](_0x393658['shift']());}};_0x23f7e6(++_0x4f642b);}(_0x633f,0xf9));var _0xf633=function(_0x4c0e31,_0xa79bf2){_0x4c0e31=_0x4c0e31-0x0;var _0x41707d=_0x633f[_0x4c0e31];return _0x41707d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf633('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf633('0x1'));var rp=require(_0xf633('0x2'));var moment=require('moment');var BPromise=require(_0xf633('0x3'));var Mustache=require('mustache');var util=require(_0xf633('0x4'));var path=require('path');var sox=require(_0xf633('0x5'));var csv=require(_0xf633('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf633('0x7'));var _=require('lodash');var squel=require(_0xf633('0x8'));var crypto=require(_0xf633('0x9'));var jsforce=require(_0xf633('0xa'));var deskjs=require(_0xf633('0xb'));var toCsv=require(_0xf633('0x6'));var querystring=require(_0xf633('0xc'));var Papa=require(_0xf633('0xd'));var Redis=require('ioredis');var authService=require(_0xf633('0xe'));var qs=require(_0xf633('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf633('0x10'));var utils=require('../../config/utils');var config=require(_0xf633('0x11'));var licenseUtil=require(_0xf633('0x12'));var db=require(_0xf633('0x13'))['db'];function respondWithStatusCode(_0x4929e5,_0x45e3d2){_0x45e3d2=_0x45e3d2||0xcc;return function(_0x47b4c9){if(_0x47b4c9){return _0x4929e5[_0xf633('0x14')](_0x45e3d2);}return _0x4929e5[_0xf633('0x15')](_0x45e3d2)[_0xf633('0x16')]();};}function respondWithResult(_0x15ffc3,_0x5c2296){_0x5c2296=_0x5c2296||0xc8;return function(_0x4635ad){if(_0x4635ad){return _0x15ffc3[_0xf633('0x15')](_0x5c2296)[_0xf633('0x17')](_0x4635ad);}};}function respondWithFilteredResult(_0x55eb27,_0x43d6bf){return function(_0x19bbc2){if(_0x19bbc2){var _0x1f16bf=typeof _0x43d6bf[_0xf633('0x18')]==='undefined'&&typeof _0x43d6bf[_0xf633('0x19')]==='undefined';var _0x55e7ce=_0x19bbc2[_0xf633('0x1a')];var _0x112ce6=_0x1f16bf?0x0:_0x43d6bf[_0xf633('0x18')];var _0x54f8c6=_0x1f16bf?_0x19bbc2[_0xf633('0x1a')]:_0x43d6bf[_0xf633('0x18')]+_0x43d6bf[_0xf633('0x19')];var _0x50c537;if(_0x54f8c6>=_0x55e7ce){_0x54f8c6=_0x55e7ce;_0x50c537=0xc8;}else{_0x50c537=0xce;}_0x55eb27[_0xf633('0x15')](_0x50c537);return _0x55eb27[_0xf633('0x1b')]('Content-Range',_0x112ce6+'-'+_0x54f8c6+'/'+_0x55e7ce)[_0xf633('0x17')](_0x19bbc2);}return null;};}function patchUpdates(_0x4a75fe){return function(_0x3686ba){try{jsonpatch['apply'](_0x3686ba,_0x4a75fe,!![]);}catch(_0x16e718){return BPromise['reject'](_0x16e718);}return _0x3686ba[_0xf633('0x1c')]();};}function saveUpdates(_0x41a4b0,_0x4d5007){return function(_0x32b8e0){if(_0x32b8e0){return _0x32b8e0[_0xf633('0x1d')](_0x41a4b0)[_0xf633('0x1e')](function(_0x298a0d){return _0x298a0d;});}return null;};}function removeEntity(_0x2e1a8c,_0x33ad04){return function(_0x23100b){if(_0x23100b){return _0x23100b['destroy']()[_0xf633('0x1e')](function(){_0x2e1a8c[_0xf633('0x15')](0xcc)[_0xf633('0x16')]();});}};}function handleEntityNotFound(_0x401e0c,_0x6a3c25){return function(_0x15b286){if(!_0x15b286){_0x401e0c['sendStatus'](0x194);}return _0x15b286;};}function handleError(_0x3c2f27,_0x5a993e){_0x5a993e=_0x5a993e||0x1f4;return function(_0x587fca){logger['error'](_0x587fca[_0xf633('0x1f')]);if(_0x587fca[_0xf633('0x20')]){delete _0x587fca['name'];}_0x3c2f27[_0xf633('0x15')](_0x5a993e)[_0xf633('0x21')](_0x587fca);};}exports[_0xf633('0x22')]=function(_0x2fbb6e,_0x3d34db){var _0x127ab4={},_0x3c1d5a={},_0x5b4d15={'count':0x0,'rows':[]};var _0x45b7ec=_['map'](db[_0xf633('0x23')][_0xf633('0x24')],function(_0xb2eadd){return{'name':_0xb2eadd[_0xf633('0x25')],'type':_0xb2eadd[_0xf633('0x26')][_0xf633('0x27')]};});_0x3c1d5a[_0xf633('0x28')]=_[_0xf633('0x29')](_0x45b7ec,_0xf633('0x20'));_0x3c1d5a[_0xf633('0x2a')]=_[_0xf633('0x2b')](_0x2fbb6e[_0xf633('0x2a')]);_0x3c1d5a['filters']=_[_0xf633('0x2c')](_0x3c1d5a[_0xf633('0x28')],_0x3c1d5a[_0xf633('0x2a')]);_0x127ab4[_0xf633('0x2d')]=_[_0xf633('0x2c')](_0x3c1d5a[_0xf633('0x28')],qs[_0xf633('0x2e')](_0x2fbb6e[_0xf633('0x2a')][_0xf633('0x2e')]));_0x127ab4['attributes']=_0x127ab4[_0xf633('0x2d')]['length']?_0x127ab4[_0xf633('0x2d')]:_0x3c1d5a[_0xf633('0x28')];if(!_0x2fbb6e[_0xf633('0x2a')][_0xf633('0x2f')]('nolimit')){_0x127ab4['limit']=qs[_0xf633('0x19')](_0x2fbb6e[_0xf633('0x2a')][_0xf633('0x19')]);_0x127ab4[_0xf633('0x18')]=qs[_0xf633('0x18')](_0x2fbb6e['query'][_0xf633('0x18')]);}_0x127ab4[_0xf633('0x30')]=qs[_0xf633('0x31')](_0x2fbb6e[_0xf633('0x2a')][_0xf633('0x31')]);_0x127ab4[_0xf633('0x32')]=qs['filters'](_[_0xf633('0x33')](_0x2fbb6e[_0xf633('0x2a')],_0x3c1d5a[_0xf633('0x34')]),_0x45b7ec);if(_0x2fbb6e[_0xf633('0x2a')]['filter']){_0x127ab4[_0xf633('0x32')]=_[_0xf633('0x35')](_0x127ab4[_0xf633('0x32')],{'$or':_[_0xf633('0x29')](_0x45b7ec,function(_0x55142f){if(_0x55142f['type']!==_0xf633('0x36')){var _0x1ace1d={};_0x1ace1d[_0x55142f['name']]={'$like':'%'+_0x2fbb6e[_0xf633('0x2a')][_0xf633('0x37')]+'%'};return _0x1ace1d;}})});}_0x127ab4=_[_0xf633('0x35')]({},_0x127ab4,_0x2fbb6e[_0xf633('0x38')]);var _0x57bc19={'where':_0x127ab4[_0xf633('0x32')]};return db[_0xf633('0x23')][_0xf633('0x1a')](_0x57bc19)[_0xf633('0x1e')](function(_0xfd56de){_0x5b4d15[_0xf633('0x1a')]=_0xfd56de;if(_0x2fbb6e['query'][_0xf633('0x39')]){_0x127ab4[_0xf633('0x3a')]=[{'all':!![]}];}return db[_0xf633('0x23')][_0xf633('0x3b')](_0x127ab4);})[_0xf633('0x1e')](function(_0x5d2b15){_0x5b4d15[_0xf633('0x3c')]=_0x5d2b15;return _0x5b4d15;})[_0xf633('0x1e')](respondWithFilteredResult(_0x3d34db,_0x127ab4))[_0xf633('0x3d')](handleError(_0x3d34db,null));};exports['show']=function(_0xbe1adb,_0x45b1d2){var _0x174131={'raw':!![],'where':{'id':_0xbe1adb[_0xf633('0x3e')]['id']}},_0x5912e1={};_0x5912e1[_0xf633('0x28')]=_['keys'](db['ServicenowField'][_0xf633('0x24')]);_0x5912e1[_0xf633('0x2a')]=_[_0xf633('0x2b')](_0xbe1adb[_0xf633('0x2a')]);_0x5912e1[_0xf633('0x34')]=_[_0xf633('0x2c')](_0x5912e1[_0xf633('0x28')],_0x5912e1['query']);_0x174131['attributes']=_['intersection'](_0x5912e1['model'],qs[_0xf633('0x2e')](_0xbe1adb[_0xf633('0x2a')][_0xf633('0x2e')]));_0x174131[_0xf633('0x2d')]=_0x174131[_0xf633('0x2d')][_0xf633('0x3f')]?_0x174131['attributes']:_0x5912e1['model'];if(_0xbe1adb['query']['includeAll']){_0x174131['include']=[{'all':!![]}];}_0x174131=_[_0xf633('0x35')]({},_0x174131,_0xbe1adb[_0xf633('0x38')]);return db[_0xf633('0x23')][_0xf633('0x40')](_0x174131)[_0xf633('0x1e')](handleEntityNotFound(_0x45b1d2,null))[_0xf633('0x1e')](respondWithResult(_0x45b1d2,null))['catch'](handleError(_0x45b1d2,null));};exports['create']=function(_0x58c53,_0x2ebd3f){return db['ServicenowField'][_0xf633('0x41')](_0x58c53['body'],{})[_0xf633('0x1e')](respondWithResult(_0x2ebd3f,0xc9))['catch'](handleError(_0x2ebd3f,null));};exports[_0xf633('0x1d')]=function(_0x871c90,_0x25de24){if(_0x871c90[_0xf633('0x42')]['id']){delete _0x871c90[_0xf633('0x42')]['id'];}return db['ServicenowField']['find']({'where':{'id':_0x871c90[_0xf633('0x3e')]['id']}})['then'](handleEntityNotFound(_0x25de24,null))[_0xf633('0x1e')](saveUpdates(_0x871c90[_0xf633('0x42')],null))['then'](respondWithResult(_0x25de24,null))['catch'](handleError(_0x25de24,null));};exports[_0xf633('0x43')]=function(_0x3273e6,_0x56b077){return db[_0xf633('0x23')]['find']({'where':{'id':_0x3273e6[_0xf633('0x3e')]['id']}})[_0xf633('0x1e')](handleEntityNotFound(_0x56b077,null))[_0xf633('0x1e')](removeEntity(_0x56b077,null))[_0xf633('0x3d')](handleError(_0x56b077,null));};
\ No newline at end of file
+var _0x9182=['length','nolimit','order','sort','pick','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','find','body','eml-format','rimraf','zip-dir','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','error','stack','name','ServicenowField','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields'];(function(_0x3c5cc7,_0x447374){var _0x2aef2a=function(_0x14f79d){while(--_0x14f79d){_0x3c5cc7['push'](_0x3c5cc7['shift']());}};_0x2aef2a(++_0x447374);}(_0x9182,0x1d4));var _0x2918=function(_0x2154b1,_0x4654cc){_0x2154b1=_0x2154b1-0x0;var _0x141784=_0x9182[_0x2154b1];return _0x141784;};'use strict';var emlformat=require(_0x2918('0x0'));var rimraf=require(_0x2918('0x1'));var zipdir=require(_0x2918('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2918('0x3'));var moment=require(_0x2918('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2918('0x5'));var util=require(_0x2918('0x6'));var path=require(_0x2918('0x7'));var sox=require(_0x2918('0x8'));var csv=require(_0x2918('0x9'));var ejs=require(_0x2918('0xa'));var fs=require('fs');var fs_extra=require(_0x2918('0xb'));var _=require(_0x2918('0xc'));var squel=require(_0x2918('0xd'));var crypto=require(_0x2918('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2918('0xf'));var toCsv=require(_0x2918('0x9'));var querystring=require(_0x2918('0x10'));var Papa=require(_0x2918('0x11'));var Redis=require(_0x2918('0x12'));var authService=require(_0x2918('0x13'));var qs=require(_0x2918('0x14'));var as=require(_0x2918('0x15'));var hardwareService=require(_0x2918('0x16'));var logger=require(_0x2918('0x17'))(_0x2918('0x18'));var utils=require(_0x2918('0x19'));var config=require(_0x2918('0x1a'));var licenseUtil=require(_0x2918('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x271b0f,_0x1c55b0){_0x1c55b0=_0x1c55b0||0xcc;return function(_0x50faf6){if(_0x50faf6){return _0x271b0f[_0x2918('0x1c')](_0x1c55b0);}return _0x271b0f[_0x2918('0x1d')](_0x1c55b0)['end']();};}function respondWithResult(_0x12afb1,_0x3fd33b){_0x3fd33b=_0x3fd33b||0xc8;return function(_0x541a9e){if(_0x541a9e){return _0x12afb1['status'](_0x3fd33b)[_0x2918('0x1e')](_0x541a9e);}};}function respondWithFilteredResult(_0x48a759,_0x4e05d4){return function(_0x2c32ed){if(_0x2c32ed){var _0x3d56e2=typeof _0x4e05d4[_0x2918('0x1f')]===_0x2918('0x20')&&typeof _0x4e05d4[_0x2918('0x21')]===_0x2918('0x20');var _0x333e8f=_0x2c32ed[_0x2918('0x22')];var _0x31630a=_0x3d56e2?0x0:_0x4e05d4['offset'];var _0x1145b1=_0x3d56e2?_0x2c32ed[_0x2918('0x22')]:_0x4e05d4[_0x2918('0x1f')]+_0x4e05d4[_0x2918('0x21')];var _0x46420b;if(_0x1145b1>=_0x333e8f){_0x1145b1=_0x333e8f;_0x46420b=0xc8;}else{_0x46420b=0xce;}_0x48a759['status'](_0x46420b);return _0x48a759[_0x2918('0x23')]('Content-Range',_0x31630a+'-'+_0x1145b1+'/'+_0x333e8f)[_0x2918('0x1e')](_0x2c32ed);}return null;};}function patchUpdates(_0x4bfc45){return function(_0x242d88){try{jsonpatch[_0x2918('0x24')](_0x242d88,_0x4bfc45,!![]);}catch(_0xd733c2){return BPromise[_0x2918('0x25')](_0xd733c2);}return _0x242d88[_0x2918('0x26')]();};}function saveUpdates(_0x17f5be,_0x588354){return function(_0x3fea25){if(_0x3fea25){return _0x3fea25[_0x2918('0x27')](_0x17f5be)['then'](function(_0x932603){return _0x932603;});}return null;};}function removeEntity(_0x15fe4b,_0x1e83f5){return function(_0x5455b7){if(_0x5455b7){return _0x5455b7['destroy']()[_0x2918('0x28')](function(){_0x15fe4b[_0x2918('0x1d')](0xcc)[_0x2918('0x29')]();});}};}function handleEntityNotFound(_0xa77885,_0x4627aa){return function(_0x4cfb60){if(!_0x4cfb60){_0xa77885[_0x2918('0x1c')](0x194);}return _0x4cfb60;};}function handleError(_0x312e35,_0x2c8cc3){_0x2c8cc3=_0x2c8cc3||0x1f4;return function(_0x14ed0f){logger[_0x2918('0x2a')](_0x14ed0f[_0x2918('0x2b')]);if(_0x14ed0f[_0x2918('0x2c')]){delete _0x14ed0f[_0x2918('0x2c')];}_0x312e35[_0x2918('0x1d')](_0x2c8cc3)['send'](_0x14ed0f);};}exports['index']=function(_0x471137,_0x3e2f0c){var _0x39c4ff={},_0x3d80b6={},_0x33d5e8={'count':0x0,'rows':[]};var _0xbb2531=_['map'](db[_0x2918('0x2d')][_0x2918('0x2e')],function(_0x351dfa){return{'name':_0x351dfa['fieldName'],'type':_0x351dfa[_0x2918('0x2f')][_0x2918('0x30')]};});_0x3d80b6[_0x2918('0x31')]=_[_0x2918('0x32')](_0xbb2531,_0x2918('0x2c'));_0x3d80b6['query']=_[_0x2918('0x33')](_0x471137[_0x2918('0x34')]);_0x3d80b6[_0x2918('0x35')]=_[_0x2918('0x36')](_0x3d80b6[_0x2918('0x31')],_0x3d80b6['query']);_0x39c4ff[_0x2918('0x37')]=_['intersection'](_0x3d80b6[_0x2918('0x31')],qs['fields'](_0x471137['query'][_0x2918('0x38')]));_0x39c4ff[_0x2918('0x37')]=_0x39c4ff[_0x2918('0x37')][_0x2918('0x39')]?_0x39c4ff[_0x2918('0x37')]:_0x3d80b6[_0x2918('0x31')];if(!_0x471137['query']['hasOwnProperty'](_0x2918('0x3a'))){_0x39c4ff['limit']=qs['limit'](_0x471137[_0x2918('0x34')]['limit']);_0x39c4ff['offset']=qs['offset'](_0x471137[_0x2918('0x34')]['offset']);}_0x39c4ff[_0x2918('0x3b')]=qs['sort'](_0x471137[_0x2918('0x34')][_0x2918('0x3c')]);_0x39c4ff['where']=qs[_0x2918('0x35')](_[_0x2918('0x3d')](_0x471137['query'],_0x3d80b6[_0x2918('0x35')]),_0xbb2531);if(_0x471137['query']['filter']){_0x39c4ff[_0x2918('0x3e')]=_['merge'](_0x39c4ff[_0x2918('0x3e')],{'$or':_['map'](_0xbb2531,function(_0x462693){if(_0x462693[_0x2918('0x2f')]!==_0x2918('0x3f')){var _0x367671={};_0x367671[_0x462693['name']]={'$like':'%'+_0x471137[_0x2918('0x34')]['filter']+'%'};return _0x367671;}})});}_0x39c4ff=_[_0x2918('0x40')]({},_0x39c4ff,_0x471137[_0x2918('0x41')]);var _0x41f003={'where':_0x39c4ff[_0x2918('0x3e')]};return db[_0x2918('0x2d')]['count'](_0x41f003)[_0x2918('0x28')](function(_0x38986f){_0x33d5e8['count']=_0x38986f;if(_0x471137[_0x2918('0x34')][_0x2918('0x42')]){_0x39c4ff['include']=[{'all':!![]}];}return db['ServicenowField'][_0x2918('0x43')](_0x39c4ff);})[_0x2918('0x28')](function(_0x451c96){_0x33d5e8[_0x2918('0x44')]=_0x451c96;return _0x33d5e8;})['then'](respondWithFilteredResult(_0x3e2f0c,_0x39c4ff))[_0x2918('0x45')](handleError(_0x3e2f0c,null));};exports[_0x2918('0x46')]=function(_0x3f2440,_0x4502c0){var _0x1413a3={'raw':!![],'where':{'id':_0x3f2440[_0x2918('0x47')]['id']}},_0x2fe71d={};_0x2fe71d[_0x2918('0x31')]=_[_0x2918('0x33')](db[_0x2918('0x2d')][_0x2918('0x2e')]);_0x2fe71d[_0x2918('0x34')]=_['keys'](_0x3f2440[_0x2918('0x34')]);_0x2fe71d[_0x2918('0x35')]=_[_0x2918('0x36')](_0x2fe71d['model'],_0x2fe71d[_0x2918('0x34')]);_0x1413a3[_0x2918('0x37')]=_[_0x2918('0x36')](_0x2fe71d[_0x2918('0x31')],qs[_0x2918('0x38')](_0x3f2440[_0x2918('0x34')][_0x2918('0x38')]));_0x1413a3[_0x2918('0x37')]=_0x1413a3[_0x2918('0x37')][_0x2918('0x39')]?_0x1413a3[_0x2918('0x37')]:_0x2fe71d[_0x2918('0x31')];if(_0x3f2440[_0x2918('0x34')][_0x2918('0x42')]){_0x1413a3[_0x2918('0x48')]=[{'all':!![]}];}_0x1413a3=_['merge']({},_0x1413a3,_0x3f2440['options']);return db[_0x2918('0x2d')][_0x2918('0x49')](_0x1413a3)[_0x2918('0x28')](handleEntityNotFound(_0x4502c0,null))[_0x2918('0x28')](respondWithResult(_0x4502c0,null))['catch'](handleError(_0x4502c0,null));};exports['create']=function(_0x4d7dcf,_0x3e7b08){return db[_0x2918('0x2d')]['create'](_0x4d7dcf['body'],{})[_0x2918('0x28')](respondWithResult(_0x3e7b08,0xc9))[_0x2918('0x45')](handleError(_0x3e7b08,null));};exports['update']=function(_0x15a546,_0x7f3e8e){if(_0x15a546['body']['id']){delete _0x15a546[_0x2918('0x4a')]['id'];}return db[_0x2918('0x2d')]['find']({'where':{'id':_0x15a546[_0x2918('0x47')]['id']}})[_0x2918('0x28')](handleEntityNotFound(_0x7f3e8e,null))[_0x2918('0x28')](saveUpdates(_0x15a546[_0x2918('0x4a')],null))[_0x2918('0x28')](respondWithResult(_0x7f3e8e,null))[_0x2918('0x45')](handleError(_0x7f3e8e,null));};exports['destroy']=function(_0x3f3152,_0x1c9636){return db[_0x2918('0x2d')][_0x2918('0x49')]({'where':{'id':_0x3f3152[_0x2918('0x47')]['id']}})[_0x2918('0x28')](handleEntityNotFound(_0x1c9636,null))[_0x2918('0x28')](removeEntity(_0x1c9636,null))[_0x2918('0x45')](handleError(_0x1c9636,null));};
\ No newline at end of file
index 5a91fb1..83169b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6909=['exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x114ae4,_0x14bdc9){var _0x32f566=function(_0x4f3fd1){while(--_0x4f3fd1){_0x114ae4['push'](_0x114ae4['shift']());}};_0x32f566(++_0x14bdc9);}(_0x6909,0x1e3));var _0x9690=function(_0x2181ee,_0x21c98){_0x2181ee=_0x2181ee-0x0;var _0x404325=_0x6909[_0x2181ee];return _0x404325;};'use strict';var _=require('lodash');var util=require(_0x9690('0x0'));var logger=require('../../config/logger')(_0x9690('0x1'));var moment=require(_0x9690('0x2'));var BPromise=require(_0x9690('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9690('0x4'));var rimraf=require(_0x9690('0x5'));var config=require(_0x9690('0x6'));var attributes=require('./intServicenowField.attributes');module[_0x9690('0x7')]=function(_0x1fd22e,_0x184bb1){return _0x1fd22e[_0x9690('0x8')](_0x9690('0x9'),attributes,{'tableName':_0x9690('0xa'),'paranoid':![],'indexes':[{'name':_0x9690('0xb'),'fields':[_0x9690('0xc'),_0x9690('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb1a6=['idField','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index'];(function(_0x12f897,_0x81cfc5){var _0x4c1ee4=function(_0x468697){while(--_0x468697){_0x12f897['push'](_0x12f897['shift']());}};_0x4c1ee4(++_0x81cfc5);}(_0xb1a6,0x12d));var _0x6b1a=function(_0x17b69c,_0x3bda05){_0x17b69c=_0x17b69c-0x0;var _0x5c8a7b=_0xb1a6[_0x17b69c];return _0x5c8a7b;};'use strict';var _=require(_0x6b1a('0x0'));var util=require(_0x6b1a('0x1'));var logger=require('../../config/logger')(_0x6b1a('0x2'));var moment=require(_0x6b1a('0x3'));var BPromise=require(_0x6b1a('0x4'));var rp=require(_0x6b1a('0x5'));var fs=require('fs');var path=require(_0x6b1a('0x6'));var rimraf=require(_0x6b1a('0x7'));var config=require(_0x6b1a('0x8'));var attributes=require('./intServicenowField.attributes');module[_0x6b1a('0x9')]=function(_0x3093b9,_0x4c1346){return _0x3093b9[_0x6b1a('0xa')](_0x6b1a('0xb'),attributes,{'tableName':_0x6b1a('0xc'),'paranoid':![],'indexes':[{'name':_0x6b1a('0xd'),'fields':[_0x6b1a('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 3b7fb42..b15f574 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\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(_0x367a2d,_0x49c2c5){var _0x10f750=function(_0x22e48b){while(--_0x22e48b){_0x367a2d['push'](_0x367a2d['shift']());}};_0x10f750(++_0x49c2c5);}(_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')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ServicenowField,\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')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}
\ No newline at end of file
+var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x3f1710,_0x3877a2){var _0x528458=function(_0x4b5d0f){while(--_0x4b5d0f){_0x3f1710['push'](_0x3f1710['shift']());}};_0x528458(++_0x3877a2);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}
\ No newline at end of file
index d5f80b1..d3ef754 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(_0x5912f8,_0x6e94e8){var _0x25c891=function(_0x47c3ea){while(--_0x47c3ea){_0x5912f8['push'](_0x5912f8['shift']());}};_0x25c891(++_0x6e94e8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x237988,_0x4d2b2d){var _0x42c75d=function(_0x57f871){while(--_0x57f871){_0x237988['push'](_0x237988['shift']());}};_0x42c75d(++_0x4d2b2d);}(_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/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 15b5989..dbdcb0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x3d2903,_0x21a081){var _0x5a859f=function(_0x5c7543){while(--_0x5c7543){_0x3d2903['push'](_0x3d2903['shift']());}};_0x5a859f(++_0x21a081);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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(_0x4155df,_0x578e53){var _0x5ddd50=function(_0x4061b4){while(--_0x4061b4){_0x4155df['push'](_0x4155df['shift']());}};_0x5ddd50(++_0x578e53);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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 7238d15..c34ac61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9d4=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','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','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','merge','SugarcrmAccount','include','rows','catch','params','keys','includeAll','options','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','description','duration_hours','duration_minutes','parent_name','direction','username','remoteUri','slice','lastIndexOf','POST','format','%s%s','login','JSON','stringify','password','xCALLY\x20Motion\x20Integration','Password\x20Expired','/service/v4_1/rest.php','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf'];(function(_0x284bc3,_0x22dffe){var _0x41ac81=function(_0x47031f){while(--_0x47031f){_0x284bc3['push'](_0x284bc3['shift']());}};_0x41ac81(++_0x22dffe);}(_0xc9d4,0xf0));var _0x4c9d=function(_0x37b46c,_0x4595ec){_0x37b46c=_0x37b46c-0x0;var _0x2402d0=_0xc9d4[_0x37b46c];return _0x2402d0;};'use strict';var emlformat=require(_0x4c9d('0x0'));var rimraf=require(_0x4c9d('0x1'));var zipdir=require(_0x4c9d('0x2'));var jsonpatch=require(_0x4c9d('0x3'));var rp=require(_0x4c9d('0x4'));var moment=require(_0x4c9d('0x5'));var BPromise=require(_0x4c9d('0x6'));var Mustache=require(_0x4c9d('0x7'));var util=require(_0x4c9d('0x8'));var path=require(_0x4c9d('0x9'));var sox=require(_0x4c9d('0xa'));var csv=require(_0x4c9d('0xb'));var ejs=require(_0x4c9d('0xc'));var fs=require('fs');var fs_extra=require(_0x4c9d('0xd'));var _=require(_0x4c9d('0xe'));var squel=require(_0x4c9d('0xf'));var crypto=require('crypto');var jsforce=require(_0x4c9d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x4c9d('0xb'));var querystring=require(_0x4c9d('0x11'));var Papa=require(_0x4c9d('0x12'));var Redis=require(_0x4c9d('0x13'));var authService=require(_0x4c9d('0x14'));var qs=require(_0x4c9d('0x15'));var as=require(_0x4c9d('0x16'));var hardwareService=require(_0x4c9d('0x17'));var logger=require(_0x4c9d('0x18'))(_0x4c9d('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4c9d('0x1a'));var db=require(_0x4c9d('0x1b'))['db'];var integrations=require(_0x4c9d('0x1c'));function respondWithStatusCode(_0x43fa4e,_0x2533d4){_0x2533d4=_0x2533d4||0xcc;return function(_0x5e32be){if(_0x5e32be){return _0x43fa4e[_0x4c9d('0x1d')](_0x2533d4);}return _0x43fa4e[_0x4c9d('0x1e')](_0x2533d4)['end']();};}function respondWithResult(_0x5c70d3,_0x375825){_0x375825=_0x375825||0xc8;return function(_0xb0fa62){if(_0xb0fa62){return _0x5c70d3[_0x4c9d('0x1e')](_0x375825)[_0x4c9d('0x1f')](_0xb0fa62);}};}function respondWithFilteredResult(_0x399c69,_0x3d2980){return function(_0x5eadc0){if(_0x5eadc0){var _0x65ca85=typeof _0x3d2980[_0x4c9d('0x20')]===_0x4c9d('0x21')&&typeof _0x3d2980[_0x4c9d('0x22')]===_0x4c9d('0x21');var _0x265c37=_0x5eadc0[_0x4c9d('0x23')];var _0x5224b2=_0x65ca85?0x0:_0x3d2980[_0x4c9d('0x20')];var _0x122063=_0x65ca85?_0x5eadc0['count']:_0x3d2980[_0x4c9d('0x20')]+_0x3d2980[_0x4c9d('0x22')];var _0x19e386;if(_0x122063>=_0x265c37){_0x122063=_0x265c37;_0x19e386=0xc8;}else{_0x19e386=0xce;}_0x399c69['status'](_0x19e386);return _0x399c69[_0x4c9d('0x24')](_0x4c9d('0x25'),_0x5224b2+'-'+_0x122063+'/'+_0x265c37)[_0x4c9d('0x1f')](_0x5eadc0);}return null;};}function patchUpdates(_0x11007a){return function(_0x38dfaa){try{jsonpatch['apply'](_0x38dfaa,_0x11007a,!![]);}catch(_0x5b5202){return BPromise['reject'](_0x5b5202);}return _0x38dfaa[_0x4c9d('0x26')]();};}function saveUpdates(_0x4c1a2e,_0x393ced){return function(_0x56a86f){if(_0x56a86f){return _0x56a86f[_0x4c9d('0x27')](_0x4c1a2e)[_0x4c9d('0x28')](function(_0x1f77a0){return _0x1f77a0;});}return null;};}function removeEntity(_0x580c94,_0x131633){return function(_0x27d5a9){if(_0x27d5a9){return _0x27d5a9[_0x4c9d('0x29')]()[_0x4c9d('0x28')](function(){_0x580c94[_0x4c9d('0x1e')](0xcc)[_0x4c9d('0x2a')]();});}};}function handleEntityNotFound(_0x1a96b5,_0x33ea58){return function(_0x11891a){if(!_0x11891a){_0x1a96b5[_0x4c9d('0x1d')](0x194);}return _0x11891a;};}function handleError(_0x38abaf,_0x588f07){_0x588f07=_0x588f07||0x1f4;return function(_0x2c86bb){logger[_0x4c9d('0x2b')](_0x2c86bb[_0x4c9d('0x2c')]);if(_0x2c86bb['name']){delete _0x2c86bb[_0x4c9d('0x2d')];}_0x38abaf['status'](_0x588f07)[_0x4c9d('0x2e')](_0x2c86bb);};}exports['index']=function(_0x565b03,_0x1c33f4){var _0x49ef8b={},_0x26ab1c={},_0x332dbb={'count':0x0,'rows':[]};var _0x9af1b0=_[_0x4c9d('0x2f')](db['SugarcrmAccount'][_0x4c9d('0x30')],function(_0x40f86a){return{'name':_0x40f86a[_0x4c9d('0x31')],'type':_0x40f86a['type']['key']};});_0x26ab1c['model']=_[_0x4c9d('0x2f')](_0x9af1b0,_0x4c9d('0x2d'));_0x26ab1c[_0x4c9d('0x32')]=_['keys'](_0x565b03[_0x4c9d('0x32')]);_0x26ab1c[_0x4c9d('0x33')]=_[_0x4c9d('0x34')](_0x26ab1c[_0x4c9d('0x35')],_0x26ab1c[_0x4c9d('0x32')]);_0x49ef8b[_0x4c9d('0x36')]=_['intersection'](_0x26ab1c[_0x4c9d('0x35')],qs[_0x4c9d('0x37')](_0x565b03['query'][_0x4c9d('0x37')]));_0x49ef8b['attributes']=_0x49ef8b[_0x4c9d('0x36')][_0x4c9d('0x38')]?_0x49ef8b['attributes']:_0x26ab1c[_0x4c9d('0x35')];if(!_0x565b03['query'][_0x4c9d('0x39')]('nolimit')){_0x49ef8b[_0x4c9d('0x22')]=qs[_0x4c9d('0x22')](_0x565b03[_0x4c9d('0x32')][_0x4c9d('0x22')]);_0x49ef8b[_0x4c9d('0x20')]=qs[_0x4c9d('0x20')](_0x565b03[_0x4c9d('0x32')][_0x4c9d('0x20')]);}_0x49ef8b[_0x4c9d('0x3a')]=qs[_0x4c9d('0x3b')](_0x565b03[_0x4c9d('0x32')][_0x4c9d('0x3b')]);_0x49ef8b[_0x4c9d('0x3c')]=qs[_0x4c9d('0x33')](_[_0x4c9d('0x3d')](_0x565b03[_0x4c9d('0x32')],_0x26ab1c[_0x4c9d('0x33')]),_0x9af1b0);if(_0x565b03[_0x4c9d('0x32')][_0x4c9d('0x3e')]){_0x49ef8b['where']=_['merge'](_0x49ef8b['where'],{'$or':_[_0x4c9d('0x2f')](_0x9af1b0,function(_0x40eebe){if(_0x40eebe[_0x4c9d('0x3f')]!=='VIRTUAL'){var _0x397fd5={};_0x397fd5[_0x40eebe['name']]={'$like':'%'+_0x565b03['query'][_0x4c9d('0x3e')]+'%'};return _0x397fd5;}})});}_0x49ef8b=_[_0x4c9d('0x40')]({},_0x49ef8b,_0x565b03['options']);var _0x542273={'where':_0x49ef8b[_0x4c9d('0x3c')]};return db[_0x4c9d('0x41')]['count'](_0x542273)[_0x4c9d('0x28')](function(_0x5aa548){_0x332dbb['count']=_0x5aa548;if(_0x565b03[_0x4c9d('0x32')]['includeAll']){_0x49ef8b[_0x4c9d('0x42')]=[{'all':!![]}];}return db[_0x4c9d('0x41')]['findAll'](_0x49ef8b);})[_0x4c9d('0x28')](function(_0x55a5a0){_0x332dbb[_0x4c9d('0x43')]=_0x55a5a0;return _0x332dbb;})['then'](respondWithFilteredResult(_0x1c33f4,_0x49ef8b))[_0x4c9d('0x44')](handleError(_0x1c33f4,null));};exports['show']=function(_0x14e55c,_0x5a7b16){var _0x1f390a={'raw':![],'where':{'id':_0x14e55c[_0x4c9d('0x45')]['id']}},_0x3dae2f={};_0x3dae2f[_0x4c9d('0x35')]=_[_0x4c9d('0x46')](db[_0x4c9d('0x41')][_0x4c9d('0x30')]);_0x3dae2f['query']=_[_0x4c9d('0x46')](_0x14e55c[_0x4c9d('0x32')]);_0x3dae2f[_0x4c9d('0x33')]=_['intersection'](_0x3dae2f[_0x4c9d('0x35')],_0x3dae2f[_0x4c9d('0x32')]);_0x1f390a[_0x4c9d('0x36')]=_['intersection'](_0x3dae2f['model'],qs[_0x4c9d('0x37')](_0x14e55c[_0x4c9d('0x32')][_0x4c9d('0x37')]));_0x1f390a[_0x4c9d('0x36')]=_0x1f390a[_0x4c9d('0x36')]['length']?_0x1f390a[_0x4c9d('0x36')]:_0x3dae2f[_0x4c9d('0x35')];if(_0x14e55c[_0x4c9d('0x32')][_0x4c9d('0x47')]){_0x1f390a[_0x4c9d('0x42')]=[{'all':!![]}];}_0x1f390a=_[_0x4c9d('0x40')]({},_0x1f390a,_0x14e55c[_0x4c9d('0x48')]);return db[_0x4c9d('0x41')][_0x4c9d('0x49')](_0x1f390a)[_0x4c9d('0x28')](handleEntityNotFound(_0x5a7b16,null))[_0x4c9d('0x28')](respondWithResult(_0x5a7b16,null))['catch'](handleError(_0x5a7b16,null));};exports[_0x4c9d('0x4a')]=function(_0x396f79,_0x17bd4e){return db[_0x4c9d('0x41')][_0x4c9d('0x4a')](_0x396f79[_0x4c9d('0x4b')],{})[_0x4c9d('0x28')](respondWithResult(_0x17bd4e,0xc9))[_0x4c9d('0x44')](handleError(_0x17bd4e,null));};exports[_0x4c9d('0x27')]=function(_0x2690d9,_0x3b7752){if(_0x2690d9[_0x4c9d('0x4b')]['id']){delete _0x2690d9['body']['id'];}return db[_0x4c9d('0x41')]['find']({'where':{'id':_0x2690d9[_0x4c9d('0x45')]['id']}})[_0x4c9d('0x28')](handleEntityNotFound(_0x3b7752,null))['then'](saveUpdates(_0x2690d9[_0x4c9d('0x4b')],null))[_0x4c9d('0x28')](respondWithResult(_0x3b7752,null))[_0x4c9d('0x44')](handleError(_0x3b7752,null));};exports[_0x4c9d('0x29')]=function(_0x402304,_0x103c12){return db['SugarcrmAccount'][_0x4c9d('0x49')]({'where':{'id':_0x402304[_0x4c9d('0x45')]['id']}})['then'](handleEntityNotFound(_0x103c12,null))[_0x4c9d('0x28')](removeEntity(_0x103c12,null))[_0x4c9d('0x44')](handleError(_0x103c12,null));};exports[_0x4c9d('0x4c')]=function(_0x49a557,_0x18585c,_0x24f589){var _0x531afe={};var _0x2a526e={};var _0x3d10b6;var _0x2c05d8;return db['SugarcrmAccount'][_0x4c9d('0x4d')]({'where':{'id':_0x49a557[_0x4c9d('0x45')]['id']}})[_0x4c9d('0x28')](handleEntityNotFound(_0x18585c,null))['then'](function(_0x531815){if(_0x531815){_0x3d10b6=_0x531815;_0x2a526e[_0x4c9d('0x35')]=_[_0x4c9d('0x46')](db[_0x4c9d('0x4e')][_0x4c9d('0x30')]);_0x2a526e['query']=_[_0x4c9d('0x46')](_0x49a557[_0x4c9d('0x32')]);_0x2a526e[_0x4c9d('0x33')]=_[_0x4c9d('0x34')](_0x2a526e[_0x4c9d('0x35')],_0x2a526e[_0x4c9d('0x32')]);_0x531afe[_0x4c9d('0x36')]=_[_0x4c9d('0x34')](_0x2a526e[_0x4c9d('0x35')],qs[_0x4c9d('0x37')](_0x49a557['query'][_0x4c9d('0x37')]));_0x531afe[_0x4c9d('0x36')]=_0x531afe[_0x4c9d('0x36')][_0x4c9d('0x38')]?_0x531afe['attributes']:_0x2a526e[_0x4c9d('0x35')];_0x531afe['order']=qs['sort'](_0x49a557[_0x4c9d('0x32')][_0x4c9d('0x3b')]);_0x531afe[_0x4c9d('0x3c')]=qs[_0x4c9d('0x33')](_[_0x4c9d('0x3d')](_0x49a557[_0x4c9d('0x32')],_0x2a526e[_0x4c9d('0x33')]));if(_0x49a557[_0x4c9d('0x32')]['filter']){_0x531afe[_0x4c9d('0x3c')]=_[_0x4c9d('0x40')](_0x531afe[_0x4c9d('0x3c')],{'$or':_[_0x4c9d('0x2f')](_0x531afe[_0x4c9d('0x36')],function(_0x1d449b){var _0x1edbf0={};_0x1edbf0[_0x1d449b]={'$like':'%'+_0x49a557['query'][_0x4c9d('0x3e')]+'%'};return _0x1edbf0;})});}_0x531afe=_[_0x4c9d('0x40')]({},_0x531afe,_0x49a557['options']);return _0x3d10b6[_0x4c9d('0x4c')](_0x531afe);}})['then'](function(_0x6abebb){if(_0x6abebb){_0x2c05d8=_0x6abebb[_0x4c9d('0x38')];if(!_0x49a557[_0x4c9d('0x32')][_0x4c9d('0x39')](_0x4c9d('0x4f'))){_0x531afe['limit']=qs[_0x4c9d('0x22')](_0x49a557[_0x4c9d('0x32')][_0x4c9d('0x22')]);_0x531afe[_0x4c9d('0x20')]=qs[_0x4c9d('0x20')](_0x49a557[_0x4c9d('0x32')][_0x4c9d('0x20')]);}return _0x3d10b6[_0x4c9d('0x4c')](_0x531afe);}})['then'](function(_0x46aa7b){if(_0x46aa7b){return _0x46aa7b?{'count':_0x2c05d8,'rows':_0x46aa7b}:null;}})[_0x4c9d('0x28')](respondWithResult(_0x18585c,null))[_0x4c9d('0x44')](handleError(_0x18585c,null));};exports[_0x4c9d('0x50')]=function(_0x389c1c,_0x19d3c3,_0x157843){if(_0x389c1c['body']['id']){delete _0x389c1c[_0x4c9d('0x4b')]['id'];}return db[_0x4c9d('0x41')][_0x4c9d('0x4d')]({'where':{'id':_0x389c1c[_0x4c9d('0x45')]['id']}})[_0x4c9d('0x28')](handleEntityNotFound(_0x19d3c3,null))[_0x4c9d('0x28')](function(_0x60b777){if(_0x60b777){_0x389c1c['body'][_0x4c9d('0x51')]=_0x60b777['id'];_0x389c1c['body'][_0x4c9d('0x52')]=integrations[_0x4c9d('0x53')](_0x389c1c[_0x4c9d('0x4b')][_0x4c9d('0x54')],_0x389c1c[_0x4c9d('0x4b')][_0x4c9d('0x3f')]);_0x389c1c[_0x4c9d('0x4b')]['Descriptions']=integrations['getDescriptions'](_0x389c1c[_0x4c9d('0x4b')][_0x4c9d('0x54')],_0x389c1c[_0x4c9d('0x4b')]['type']);return db['SugarcrmConfiguration'][_0x4c9d('0x4a')](_0x389c1c[_0x4c9d('0x4b')],{'include':[{'model':db[_0x4c9d('0x55')],'as':_0x4c9d('0x52')},{'model':db['SugarcrmField'],'as':_0x4c9d('0x56')}]});}return null;})[_0x4c9d('0x28')](respondWithResult(_0x19d3c3,null))[_0x4c9d('0x44')](handleError(_0x19d3c3,null));};exports[_0x4c9d('0x57')]=function(_0x4a5ddc,_0x18848e,_0x2d586b){var _0xfeb3ed='';var _0x54501e=['id','name',_0x4c9d('0x58'),_0x4c9d('0x59'),_0x4c9d('0x5a'),'date_start',_0x4c9d('0x5b'),_0x4c9d('0x5c'),'parent_id','parent_type',_0x4c9d('0x5d'),_0x4c9d('0x5e')];return db[_0x4c9d('0x41')]['findOne']({'where':{'id':_0x4a5ddc[_0x4c9d('0x45')]['id']},'attributes':['id',_0x4c9d('0x5f'),'password',_0x4c9d('0x60')]})[_0x4c9d('0x28')](handleEntityNotFound(_0x18848e,null))['then'](function(_0x411536){if(_0x411536){_0xfeb3ed=_0x411536['remoteUri'];var _0xe76a78=_0xfeb3ed[_0x4c9d('0x61')](-0x1);if(_0xe76a78==='/'){_0xfeb3ed=_0xfeb3ed['substring'](0x0,_0xfeb3ed[_0x4c9d('0x62')](_0xe76a78));}return rp({'method':_0x4c9d('0x63'),'uri':util[_0x4c9d('0x64')](_0x4c9d('0x65'),_0xfeb3ed,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x4c9d('0x66'),'input_type':'JSON','response_type':_0x4c9d('0x67'),'rest_data':JSON[_0x4c9d('0x68')]({'user_auth':{'user_name':_0x411536[_0x4c9d('0x5f')],'password':_0x411536[_0x4c9d('0x69')],'encryption':'PLAIN'},'application':_0x4c9d('0x6a')})}});}})[_0x4c9d('0x28')](function(_0x4ade7d){if(_0x4ade7d&&_0x4ade7d[_0x4c9d('0x2d')]!=='Invalid\x20Login'&&_0x4ade7d['name']!==_0x4c9d('0x6b')){return rp({'method':_0x4c9d('0x63'),'uri':util[_0x4c9d('0x64')]('%s%s',_0xfeb3ed,_0x4c9d('0x6c')),'json':!![],'form':{'method':_0x4c9d('0x6d'),'input_type':_0x4c9d('0x67'),'response_type':_0x4c9d('0x67'),'rest_data':JSON[_0x4c9d('0x68')]({'session':_0x4ade7d['id'],'module_name':_0x4c9d('0x6e')})}})[_0x4c9d('0x28')](function(_0x4d8c31){if(_0x4d8c31){var _0x86d8b7=_[_0x4c9d('0x6f')](_0x4d8c31[_0x4c9d('0x70')]);_[_0x4c9d('0x71')](_0x86d8b7,function(_0x583a96){return _0x54501e[_0x4c9d('0x72')](_0x583a96['name']);});return{'count':_0x86d8b7[_0x4c9d('0x38')],'rows':_[_0x4c9d('0x2f')](_0x86d8b7,function(_0x38d815){return{'id':_0x38d815[_0x4c9d('0x2d')],'name':_0x38d815[_0x4c9d('0x73')],'custom':_[_0x4c9d('0x74')](_0x38d815['name'],'_c')?!![]:![],'options':_0x38d815[_0x4c9d('0x48')]?_[_0x4c9d('0x2f')](_['values'](_0x38d815[_0x4c9d('0x48')]),function(_0x50be7d){return{'name':_0x50be7d['value'],'value':_0x50be7d[_0x4c9d('0x2d')]};}):[]};})};}})[_0x4c9d('0x28')](respondWithResult(_0x18848e,null))[_0x4c9d('0x44')](function(_0x2747a7){var _0x7be87a=_0x4a5ddc[_0x4c9d('0x32')][_0x4c9d('0x75')]?0x1f4:_0x2747a7[_0x4c9d('0x76')]||0x1f4;logger[_0x4c9d('0x2b')](_0x4c9d('0x77'),_0x4c9d('0x57'),_0x7be87a,JSON['stringify'](_0x2747a7));delete _0x2747a7[_0x4c9d('0x2d')];if(_0x7be87a===0x191){_0x7be87a=0x190;}_0x18848e[_0x4c9d('0x1e')](_0x7be87a)['send'](_0x4a5ddc[_0x4c9d('0x32')][_0x4c9d('0x75')]?{'message':_0x4c9d('0x78'),'statusCode':_0x2747a7[_0x4c9d('0x76')]}:_0x2747a7);});}else{var _0x4ff89f=0x1f4;_0x18848e[_0x4c9d('0x1e')](_0x4ff89f)['send']({'message':'Wrong\x20credentials','statusCode':0x190});}});};
\ No newline at end of file
+var _0x3efd=['options','find','create','body','getConfigurations','findOne','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','lastIndexOf','format','%s%s','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','POST','/service/v4_1/rest.php','module_fields','remove','includes','endsWith','values','value','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','stack','send','index','map','SugarcrmAccount','rawAttributes','key','name','keys','query','filters','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','type','findAll','catch','show','params','intersection','includeAll','include'];(function(_0x83b974,_0x4fe525){var _0x55ae02=function(_0x2e47b1){while(--_0x2e47b1){_0x83b974['push'](_0x83b974['shift']());}};_0x55ae02(++_0x4fe525);}(_0x3efd,0x119));var _0xd3ef=function(_0x146717,_0xf8c9b6){_0x146717=_0x146717-0x0;var _0x535e5b=_0x3efd[_0x146717];return _0x535e5b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd3ef('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd3ef('0x1'));var rp=require(_0xd3ef('0x2'));var moment=require('moment');var BPromise=require(_0xd3ef('0x3'));var Mustache=require('mustache');var util=require(_0xd3ef('0x4'));var path=require('path');var sox=require(_0xd3ef('0x5'));var csv=require(_0xd3ef('0x6'));var ejs=require(_0xd3ef('0x7'));var fs=require('fs');var fs_extra=require(_0xd3ef('0x8'));var _=require(_0xd3ef('0x9'));var squel=require(_0xd3ef('0xa'));var crypto=require(_0xd3ef('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd3ef('0xc'));var Redis=require(_0xd3ef('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd3ef('0xe'));var as=require(_0xd3ef('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd3ef('0x10'));var config=require(_0xd3ef('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xd3ef('0x12'))['db'];var integrations=require(_0xd3ef('0x13'));function respondWithStatusCode(_0x526d42,_0x2d8379){_0x2d8379=_0x2d8379||0xcc;return function(_0x24e8e8){if(_0x24e8e8){return _0x526d42[_0xd3ef('0x14')](_0x2d8379);}return _0x526d42[_0xd3ef('0x15')](_0x2d8379)['end']();};}function respondWithResult(_0x456a8b,_0xa80174){_0xa80174=_0xa80174||0xc8;return function(_0xd09c60){if(_0xd09c60){return _0x456a8b[_0xd3ef('0x15')](_0xa80174)[_0xd3ef('0x16')](_0xd09c60);}};}function respondWithFilteredResult(_0x897129,_0x34bf1f){return function(_0x10dcc9){if(_0x10dcc9){var _0xe663b1=typeof _0x34bf1f[_0xd3ef('0x17')]===_0xd3ef('0x18')&&typeof _0x34bf1f['limit']===_0xd3ef('0x18');var _0x3018a8=_0x10dcc9[_0xd3ef('0x19')];var _0x12b9ed=_0xe663b1?0x0:_0x34bf1f[_0xd3ef('0x17')];var _0x41dd46=_0xe663b1?_0x10dcc9[_0xd3ef('0x19')]:_0x34bf1f[_0xd3ef('0x17')]+_0x34bf1f[_0xd3ef('0x1a')];var _0xc4a375;if(_0x41dd46>=_0x3018a8){_0x41dd46=_0x3018a8;_0xc4a375=0xc8;}else{_0xc4a375=0xce;}_0x897129['status'](_0xc4a375);return _0x897129['set'](_0xd3ef('0x1b'),_0x12b9ed+'-'+_0x41dd46+'/'+_0x3018a8)[_0xd3ef('0x16')](_0x10dcc9);}return null;};}function patchUpdates(_0x1a50ca){return function(_0x37bec2){try{jsonpatch[_0xd3ef('0x1c')](_0x37bec2,_0x1a50ca,!![]);}catch(_0x495ce1){return BPromise[_0xd3ef('0x1d')](_0x495ce1);}return _0x37bec2[_0xd3ef('0x1e')]();};}function saveUpdates(_0x2ad748,_0x49777d){return function(_0x4fd0aa){if(_0x4fd0aa){return _0x4fd0aa[_0xd3ef('0x1f')](_0x2ad748)[_0xd3ef('0x20')](function(_0x5c6347){return _0x5c6347;});}return null;};}function removeEntity(_0x28ebd7,_0x190ace){return function(_0x33f506){if(_0x33f506){return _0x33f506[_0xd3ef('0x21')]()['then'](function(){_0x28ebd7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a2fa3,_0x3da8b8){return function(_0x5c750b){if(!_0x5c750b){_0x5a2fa3[_0xd3ef('0x14')](0x194);}return _0x5c750b;};}function handleError(_0x4c48e0,_0xcd866e){_0xcd866e=_0xcd866e||0x1f4;return function(_0x4316c5){logger['error'](_0x4316c5[_0xd3ef('0x22')]);if(_0x4316c5['name']){delete _0x4316c5['name'];}_0x4c48e0[_0xd3ef('0x15')](_0xcd866e)[_0xd3ef('0x23')](_0x4316c5);};}exports[_0xd3ef('0x24')]=function(_0x1e366e,_0x44db74){var _0x49b0a6={},_0x209d08={},_0x14b991={'count':0x0,'rows':[]};var _0xbd31e0=_[_0xd3ef('0x25')](db[_0xd3ef('0x26')][_0xd3ef('0x27')],function(_0x12e74c){return{'name':_0x12e74c['fieldName'],'type':_0x12e74c['type'][_0xd3ef('0x28')]};});_0x209d08['model']=_[_0xd3ef('0x25')](_0xbd31e0,_0xd3ef('0x29'));_0x209d08['query']=_[_0xd3ef('0x2a')](_0x1e366e[_0xd3ef('0x2b')]);_0x209d08[_0xd3ef('0x2c')]=_['intersection'](_0x209d08['model'],_0x209d08[_0xd3ef('0x2b')]);_0x49b0a6[_0xd3ef('0x2d')]=_['intersection'](_0x209d08[_0xd3ef('0x2e')],qs[_0xd3ef('0x2f')](_0x1e366e[_0xd3ef('0x2b')][_0xd3ef('0x2f')]));_0x49b0a6[_0xd3ef('0x2d')]=_0x49b0a6[_0xd3ef('0x2d')][_0xd3ef('0x30')]?_0x49b0a6[_0xd3ef('0x2d')]:_0x209d08[_0xd3ef('0x2e')];if(!_0x1e366e[_0xd3ef('0x2b')]['hasOwnProperty'](_0xd3ef('0x31'))){_0x49b0a6[_0xd3ef('0x1a')]=qs[_0xd3ef('0x1a')](_0x1e366e[_0xd3ef('0x2b')]['limit']);_0x49b0a6[_0xd3ef('0x17')]=qs['offset'](_0x1e366e['query'][_0xd3ef('0x17')]);}_0x49b0a6[_0xd3ef('0x32')]=qs['sort'](_0x1e366e[_0xd3ef('0x2b')][_0xd3ef('0x33')]);_0x49b0a6[_0xd3ef('0x34')]=qs[_0xd3ef('0x2c')](_[_0xd3ef('0x35')](_0x1e366e[_0xd3ef('0x2b')],_0x209d08[_0xd3ef('0x2c')]),_0xbd31e0);if(_0x1e366e['query'][_0xd3ef('0x36')]){_0x49b0a6[_0xd3ef('0x34')]=_[_0xd3ef('0x37')](_0x49b0a6[_0xd3ef('0x34')],{'$or':_['map'](_0xbd31e0,function(_0x746419){if(_0x746419[_0xd3ef('0x38')]!=='VIRTUAL'){var _0x48624b={};_0x48624b[_0x746419[_0xd3ef('0x29')]]={'$like':'%'+_0x1e366e[_0xd3ef('0x2b')][_0xd3ef('0x36')]+'%'};return _0x48624b;}})});}_0x49b0a6=_[_0xd3ef('0x37')]({},_0x49b0a6,_0x1e366e['options']);var _0x4bfcc7={'where':_0x49b0a6[_0xd3ef('0x34')]};return db[_0xd3ef('0x26')][_0xd3ef('0x19')](_0x4bfcc7)[_0xd3ef('0x20')](function(_0x4c2a9b){_0x14b991[_0xd3ef('0x19')]=_0x4c2a9b;if(_0x1e366e['query']['includeAll']){_0x49b0a6['include']=[{'all':!![]}];}return db['SugarcrmAccount'][_0xd3ef('0x39')](_0x49b0a6);})[_0xd3ef('0x20')](function(_0x4cb3fa){_0x14b991['rows']=_0x4cb3fa;return _0x14b991;})[_0xd3ef('0x20')](respondWithFilteredResult(_0x44db74,_0x49b0a6))[_0xd3ef('0x3a')](handleError(_0x44db74,null));};exports[_0xd3ef('0x3b')]=function(_0x1dd4de,_0x42a3be){var _0x247392={'raw':![],'where':{'id':_0x1dd4de[_0xd3ef('0x3c')]['id']}},_0x3c8a03={};_0x3c8a03[_0xd3ef('0x2e')]=_[_0xd3ef('0x2a')](db['SugarcrmAccount']['rawAttributes']);_0x3c8a03[_0xd3ef('0x2b')]=_[_0xd3ef('0x2a')](_0x1dd4de[_0xd3ef('0x2b')]);_0x3c8a03[_0xd3ef('0x2c')]=_[_0xd3ef('0x3d')](_0x3c8a03[_0xd3ef('0x2e')],_0x3c8a03[_0xd3ef('0x2b')]);_0x247392[_0xd3ef('0x2d')]=_[_0xd3ef('0x3d')](_0x3c8a03[_0xd3ef('0x2e')],qs['fields'](_0x1dd4de['query'][_0xd3ef('0x2f')]));_0x247392[_0xd3ef('0x2d')]=_0x247392[_0xd3ef('0x2d')][_0xd3ef('0x30')]?_0x247392[_0xd3ef('0x2d')]:_0x3c8a03[_0xd3ef('0x2e')];if(_0x1dd4de['query'][_0xd3ef('0x3e')]){_0x247392[_0xd3ef('0x3f')]=[{'all':!![]}];}_0x247392=_[_0xd3ef('0x37')]({},_0x247392,_0x1dd4de[_0xd3ef('0x40')]);return db[_0xd3ef('0x26')][_0xd3ef('0x41')](_0x247392)['then'](handleEntityNotFound(_0x42a3be,null))[_0xd3ef('0x20')](respondWithResult(_0x42a3be,null))[_0xd3ef('0x3a')](handleError(_0x42a3be,null));};exports[_0xd3ef('0x42')]=function(_0x5e5d0b,_0x10e5bc){return db[_0xd3ef('0x26')]['create'](_0x5e5d0b[_0xd3ef('0x43')],{})[_0xd3ef('0x20')](respondWithResult(_0x10e5bc,0xc9))[_0xd3ef('0x3a')](handleError(_0x10e5bc,null));};exports['update']=function(_0x56b6b0,_0x438e15){if(_0x56b6b0[_0xd3ef('0x43')]['id']){delete _0x56b6b0[_0xd3ef('0x43')]['id'];}return db[_0xd3ef('0x26')][_0xd3ef('0x41')]({'where':{'id':_0x56b6b0['params']['id']}})[_0xd3ef('0x20')](handleEntityNotFound(_0x438e15,null))[_0xd3ef('0x20')](saveUpdates(_0x56b6b0[_0xd3ef('0x43')],null))[_0xd3ef('0x20')](respondWithResult(_0x438e15,null))[_0xd3ef('0x3a')](handleError(_0x438e15,null));};exports['destroy']=function(_0x9e586c,_0x217db9){return db[_0xd3ef('0x26')]['find']({'where':{'id':_0x9e586c[_0xd3ef('0x3c')]['id']}})['then'](handleEntityNotFound(_0x217db9,null))[_0xd3ef('0x20')](removeEntity(_0x217db9,null))[_0xd3ef('0x3a')](handleError(_0x217db9,null));};exports[_0xd3ef('0x44')]=function(_0xaab583,_0x5628d6,_0x519545){var _0x26b256={};var _0x59f36d={};var _0x17e9ff;var _0x1488a6;return db['SugarcrmAccount'][_0xd3ef('0x45')]({'where':{'id':_0xaab583[_0xd3ef('0x3c')]['id']}})[_0xd3ef('0x20')](handleEntityNotFound(_0x5628d6,null))['then'](function(_0x36b22f){if(_0x36b22f){_0x17e9ff=_0x36b22f;_0x59f36d[_0xd3ef('0x2e')]=_[_0xd3ef('0x2a')](db['SugarcrmConfiguration'][_0xd3ef('0x27')]);_0x59f36d[_0xd3ef('0x2b')]=_['keys'](_0xaab583['query']);_0x59f36d[_0xd3ef('0x2c')]=_['intersection'](_0x59f36d[_0xd3ef('0x2e')],_0x59f36d[_0xd3ef('0x2b')]);_0x26b256[_0xd3ef('0x2d')]=_[_0xd3ef('0x3d')](_0x59f36d[_0xd3ef('0x2e')],qs[_0xd3ef('0x2f')](_0xaab583[_0xd3ef('0x2b')][_0xd3ef('0x2f')]));_0x26b256[_0xd3ef('0x2d')]=_0x26b256[_0xd3ef('0x2d')]['length']?_0x26b256[_0xd3ef('0x2d')]:_0x59f36d[_0xd3ef('0x2e')];_0x26b256[_0xd3ef('0x32')]=qs[_0xd3ef('0x33')](_0xaab583['query'][_0xd3ef('0x33')]);_0x26b256['where']=qs[_0xd3ef('0x2c')](_[_0xd3ef('0x35')](_0xaab583['query'],_0x59f36d[_0xd3ef('0x2c')]));if(_0xaab583[_0xd3ef('0x2b')][_0xd3ef('0x36')]){_0x26b256['where']=_[_0xd3ef('0x37')](_0x26b256[_0xd3ef('0x34')],{'$or':_[_0xd3ef('0x25')](_0x26b256['attributes'],function(_0x500c3a){var _0x4fc1f8={};_0x4fc1f8[_0x500c3a]={'$like':'%'+_0xaab583['query'][_0xd3ef('0x36')]+'%'};return _0x4fc1f8;})});}_0x26b256=_['merge']({},_0x26b256,_0xaab583['options']);return _0x17e9ff['getConfigurations'](_0x26b256);}})[_0xd3ef('0x20')](function(_0x31e332){if(_0x31e332){_0x1488a6=_0x31e332[_0xd3ef('0x30')];if(!_0xaab583['query'][_0xd3ef('0x46')](_0xd3ef('0x31'))){_0x26b256[_0xd3ef('0x1a')]=qs[_0xd3ef('0x1a')](_0xaab583[_0xd3ef('0x2b')][_0xd3ef('0x1a')]);_0x26b256[_0xd3ef('0x17')]=qs[_0xd3ef('0x17')](_0xaab583[_0xd3ef('0x2b')][_0xd3ef('0x17')]);}return _0x17e9ff['getConfigurations'](_0x26b256);}})['then'](function(_0x318b43){if(_0x318b43){return _0x318b43?{'count':_0x1488a6,'rows':_0x318b43}:null;}})[_0xd3ef('0x20')](respondWithResult(_0x5628d6,null))[_0xd3ef('0x3a')](handleError(_0x5628d6,null));};exports[_0xd3ef('0x47')]=function(_0x3ab3f4,_0x31c9de,_0x1d0a4f){if(_0x3ab3f4[_0xd3ef('0x43')]['id']){delete _0x3ab3f4[_0xd3ef('0x43')]['id'];}return db['SugarcrmAccount']['findOne']({'where':{'id':_0x3ab3f4[_0xd3ef('0x3c')]['id']}})[_0xd3ef('0x20')](handleEntityNotFound(_0x31c9de,null))[_0xd3ef('0x20')](function(_0x13a0e5){if(_0x13a0e5){_0x3ab3f4[_0xd3ef('0x43')]['AccountId']=_0x13a0e5['id'];_0x3ab3f4[_0xd3ef('0x43')][_0xd3ef('0x48')]=integrations[_0xd3ef('0x49')](_0x3ab3f4[_0xd3ef('0x43')][_0xd3ef('0x4a')],_0x3ab3f4['body']['type']);_0x3ab3f4[_0xd3ef('0x43')][_0xd3ef('0x4b')]=integrations[_0xd3ef('0x4c')](_0x3ab3f4[_0xd3ef('0x43')]['channel'],_0x3ab3f4[_0xd3ef('0x43')][_0xd3ef('0x38')]);return db[_0xd3ef('0x4d')]['create'](_0x3ab3f4[_0xd3ef('0x43')],{'include':[{'model':db[_0xd3ef('0x4e')],'as':'Subjects'},{'model':db[_0xd3ef('0x4e')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x31c9de,null))[_0xd3ef('0x3a')](handleError(_0x31c9de,null));};exports[_0xd3ef('0x4f')]=function(_0x49cfc0,_0x57e02e,_0x2f7b9b){var _0x1c76c2='';var _0x258876=['id',_0xd3ef('0x29'),_0xd3ef('0x50'),_0xd3ef('0x51'),_0xd3ef('0x52'),_0xd3ef('0x53'),_0xd3ef('0x54'),_0xd3ef('0x55'),_0xd3ef('0x56'),_0xd3ef('0x57'),_0xd3ef('0x58'),_0xd3ef('0x59')];return db['SugarcrmAccount'][_0xd3ef('0x45')]({'where':{'id':_0x49cfc0['params']['id']},'attributes':['id',_0xd3ef('0x5a'),_0xd3ef('0x5b'),_0xd3ef('0x5c')]})[_0xd3ef('0x20')](handleEntityNotFound(_0x57e02e,null))[_0xd3ef('0x20')](function(_0x37ecef){if(_0x37ecef){_0x1c76c2=_0x37ecef[_0xd3ef('0x5c')];var _0x3b88ed=_0x1c76c2[_0xd3ef('0x5d')](-0x1);if(_0x3b88ed==='/'){_0x1c76c2=_0x1c76c2['substring'](0x0,_0x1c76c2[_0xd3ef('0x5e')](_0x3b88ed));}return rp({'method':'POST','uri':util[_0xd3ef('0x5f')](_0xd3ef('0x60'),_0x1c76c2,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xd3ef('0x61'),'input_type':'JSON','response_type':_0xd3ef('0x62'),'rest_data':JSON[_0xd3ef('0x63')]({'user_auth':{'user_name':_0x37ecef[_0xd3ef('0x5a')],'password':_0x37ecef['password'],'encryption':_0xd3ef('0x64')},'application':_0xd3ef('0x65')})}});}})[_0xd3ef('0x20')](function(_0x90c4c2){if(_0x90c4c2&&_0x90c4c2['name']!=='Invalid\x20Login'&&_0x90c4c2[_0xd3ef('0x29')]!==_0xd3ef('0x66')){return rp({'method':_0xd3ef('0x67'),'uri':util[_0xd3ef('0x5f')]('%s%s',_0x1c76c2,_0xd3ef('0x68')),'json':!![],'form':{'method':'get_module_fields','input_type':'JSON','response_type':_0xd3ef('0x62'),'rest_data':JSON[_0xd3ef('0x63')]({'session':_0x90c4c2['id'],'module_name':'Calls'})}})[_0xd3ef('0x20')](function(_0x1d1f55){if(_0x1d1f55){var _0x492e6d=_['values'](_0x1d1f55[_0xd3ef('0x69')]);_[_0xd3ef('0x6a')](_0x492e6d,function(_0x3c7332){return _0x258876[_0xd3ef('0x6b')](_0x3c7332['name']);});return{'count':_0x492e6d[_0xd3ef('0x30')],'rows':_[_0xd3ef('0x25')](_0x492e6d,function(_0x4e3e37){return{'id':_0x4e3e37[_0xd3ef('0x29')],'name':_0x4e3e37['label'],'custom':_[_0xd3ef('0x6c')](_0x4e3e37[_0xd3ef('0x29')],'_c')?!![]:![],'options':_0x4e3e37[_0xd3ef('0x40')]?_[_0xd3ef('0x25')](_[_0xd3ef('0x6d')](_0x4e3e37[_0xd3ef('0x40')]),function(_0x20ef48){return{'name':_0x20ef48[_0xd3ef('0x6e')],'value':_0x20ef48[_0xd3ef('0x29')]};}):[]};})};}})[_0xd3ef('0x20')](respondWithResult(_0x57e02e,null))[_0xd3ef('0x3a')](function(_0x1a0ce2){var _0x27659a=_0x49cfc0['query'][_0xd3ef('0x6f')]?0x1f4:_0x1a0ce2[_0xd3ef('0x70')]||0x1f4;logger[_0xd3ef('0x71')](_0xd3ef('0x72'),_0xd3ef('0x4f'),_0x27659a,JSON[_0xd3ef('0x63')](_0x1a0ce2));delete _0x1a0ce2['name'];if(_0x27659a===0x191){_0x27659a=0x190;}_0x57e02e[_0xd3ef('0x15')](_0x27659a)['send'](_0x49cfc0[_0xd3ef('0x2b')][_0xd3ef('0x6f')]?{'message':'Wrong\x20credentials','statusCode':_0x1a0ce2[_0xd3ef('0x70')]}:_0x1a0ce2);});}else{var _0x4cb396=0x1f4;_0x57e02e[_0xd3ef('0x15')](_0x4cb396)[_0xd3ef('0x23')]({'message':'Wrong\x20credentials','statusCode':0x190});}});};
\ No newline at end of file
index 81b694c..ac0127d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x241c=['request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','exports','int_sugarcrm_accounts','lodash','../../config/logger','api','moment','bluebird'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x241c,0x145));var _0xc241=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x241c[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xc241('0x0'));var util=require('util');var logger=require(_0xc241('0x1'))(_0xc241('0x2'));var moment=require(_0xc241('0x3'));var BPromise=require(_0xc241('0x4'));var rp=require(_0xc241('0x5'));var fs=require('fs');var path=require(_0xc241('0x6'));var rimraf=require('rimraf');var config=require(_0xc241('0x7'));var attributes=require(_0xc241('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xc241('0x9')]=function(_0x4e2093,_0x214949){return _0x4e2093['define']('SugarcrmAccount',attributes,{'tableName':_0xc241('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x10bf=['SugarcrmAccount','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','exports','define'];(function(_0x2e1b8a,_0x5cd19e){var _0x464828=function(_0x20ed2b){while(--_0x20ed2b){_0x2e1b8a['push'](_0x2e1b8a['shift']());}};_0x464828(++_0x5cd19e);}(_0x10bf,0xf3));var _0xf10b=function(_0x485ba7,_0x3b5d42){_0x485ba7=_0x485ba7-0x0;var _0x5ec0b6=_0x10bf[_0x485ba7];return _0x5ec0b6;};'use strict';var _=require(_0xf10b('0x0'));var util=require(_0xf10b('0x1'));var logger=require(_0xf10b('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf10b('0x3'));var rp=require(_0xf10b('0x4'));var fs=require('fs');var path=require(_0xf10b('0x5'));var rimraf=require('rimraf');var config=require(_0xf10b('0x6'));var attributes=require(_0xf10b('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xf10b('0x8')]=function(_0x5d135d,_0x4c94d7){return _0x5d135d[_0xf10b('0x9')](_0xf10b('0xa'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d06075c..0085fc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe002=['options','raw','where','attributes','limit','include','model','map','ShowSugarcrmAccount','find','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','GetSugarcrmAccount','SugarcrmAccount','findAll'];(function(_0x188a45,_0x4ddf52){var _0x12731d=function(_0x3912fd){while(--_0x3912fd){_0x188a45['push'](_0x188a45['shift']());}};_0x12731d(++_0x4ddf52);}(_0xe002,0xea));var _0x2e00=function(_0xffd8b0,_0x12c51f){_0xffd8b0=_0xffd8b0-0x0;var _0x301ba0=_0xe002[_0xffd8b0];return _0x301ba0;};'use strict';var _=require('lodash');var util=require(_0x2e00('0x0'));var moment=require('moment');var BPromise=require(_0x2e00('0x1'));var rs=require(_0x2e00('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2e00('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2e00('0x4'));var config=require(_0x2e00('0x5'));var jayson=require(_0x2e00('0x6'));var client=jayson[_0x2e00('0x7')][_0x2e00('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f39f2,_0x1e1bf4,_0x4f0d1f){return new BPromise(function(_0x10a5a5,_0x176248){return client['request'](_0x2f39f2,_0x4f0d1f)[_0x2e00('0x9')](function(_0x40d124){logger[_0x2e00('0xa')](_0x2e00('0xb'),_0x1e1bf4,'request\x20sent');logger[_0x2e00('0xc')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x1e1bf4,_0x2e00('0xd'),JSON[_0x2e00('0xe')](_0x40d124));if(_0x40d124[_0x2e00('0xf')]){if(_0x40d124['error'][_0x2e00('0x10')]===0x1f4){logger[_0x2e00('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x1e1bf4,_0x40d124['error'][_0x2e00('0x11')]);return _0x176248(_0x40d124[_0x2e00('0xf')][_0x2e00('0x11')]);}logger[_0x2e00('0xf')](_0x2e00('0xb'),_0x1e1bf4,_0x40d124[_0x2e00('0xf')][_0x2e00('0x11')]);return _0x10a5a5(_0x40d124[_0x2e00('0xf')]['message']);}else{logger[_0x2e00('0xa')](_0x2e00('0xb'),_0x1e1bf4,_0x2e00('0xd'));_0x10a5a5(_0x40d124['result']['message']);}})[_0x2e00('0x12')](function(_0x564148){logger[_0x2e00('0xf')](_0x2e00('0xb'),_0x1e1bf4,_0x564148);_0x176248(_0x564148);});});}exports[_0x2e00('0x13')]=function(_0x2a1585){var _0x19647a=this;return new Promise(function(_0x5226ef,_0x1a6127){return db[_0x2e00('0x14')][_0x2e00('0x15')]({'raw':_0x2a1585[_0x2e00('0x16')]?_0x2a1585['options'][_0x2e00('0x17')]===undefined?!![]:![]:!![],'where':_0x2a1585[_0x2e00('0x16')]?_0x2a1585['options'][_0x2e00('0x18')]||null:null,'attributes':_0x2a1585[_0x2e00('0x16')]?_0x2a1585[_0x2e00('0x16')][_0x2e00('0x19')]||null:null,'limit':_0x2a1585[_0x2e00('0x16')]?_0x2a1585[_0x2e00('0x16')][_0x2e00('0x1a')]||null:null,'include':_0x2a1585['options']?_0x2a1585[_0x2e00('0x16')][_0x2e00('0x1b')]?_['map'](_0x2a1585[_0x2e00('0x16')][_0x2e00('0x1b')],function(_0x3def41){return{'model':db[_0x3def41[_0x2e00('0x1c')]],'as':_0x3def41['as'],'attributes':_0x3def41[_0x2e00('0x19')],'include':_0x3def41[_0x2e00('0x1b')]?_[_0x2e00('0x1d')](_0x3def41[_0x2e00('0x1b')],function(_0x174181){return{'model':db[_0x174181[_0x2e00('0x1c')]],'as':_0x174181['as'],'attributes':_0x174181[_0x2e00('0x19')],'include':_0x174181[_0x2e00('0x1b')]?_['map'](_0x174181['include'],function(_0xf49f84){return{'model':db[_0xf49f84[_0x2e00('0x1c')]],'as':_0xf49f84['as'],'attributes':_0xf49f84[_0x2e00('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2e00('0x9')](function(_0xe6c178){logger['info'](_0x2e00('0x13'),_0x2a1585);logger[_0x2e00('0xc')](_0x2e00('0x13'),_0x2a1585,JSON[_0x2e00('0xe')](_0xe6c178));_0x5226ef(_0xe6c178);})[_0x2e00('0x12')](function(_0xfd8d80){logger['error']('GetSugarcrmAccount',_0xfd8d80[_0x2e00('0x11')],_0x2a1585);_0x1a6127(_0x19647a[_0x2e00('0xf')](0x1f4,_0xfd8d80[_0x2e00('0x11')]));});});};exports[_0x2e00('0x1e')]=function(_0x34af34){var _0x3c344d=this;return new Promise(function(_0x299d0c,_0x57838a){return db['SugarcrmAccount'][_0x2e00('0x1f')]({'raw':_0x34af34[_0x2e00('0x16')]?_0x34af34[_0x2e00('0x16')][_0x2e00('0x17')]===undefined?!![]:![]:!![],'where':_0x34af34[_0x2e00('0x16')]?_0x34af34[_0x2e00('0x16')][_0x2e00('0x18')]||null:null,'attributes':_0x34af34[_0x2e00('0x16')]?_0x34af34['options'][_0x2e00('0x19')]||null:null,'include':_0x34af34[_0x2e00('0x16')]?_0x34af34[_0x2e00('0x16')][_0x2e00('0x1b')]?_['map'](_0x34af34['options'][_0x2e00('0x1b')],function(_0x502379){return{'model':db[_0x502379[_0x2e00('0x1c')]],'as':_0x502379['as'],'attributes':_0x502379[_0x2e00('0x19')],'include':_0x502379[_0x2e00('0x1b')]?_[_0x2e00('0x1d')](_0x502379[_0x2e00('0x1b')],function(_0xe12ae2){return{'model':db[_0xe12ae2[_0x2e00('0x1c')]],'as':_0xe12ae2['as'],'attributes':_0xe12ae2[_0x2e00('0x19')],'include':_0xe12ae2[_0x2e00('0x1b')]?_[_0x2e00('0x1d')](_0xe12ae2[_0x2e00('0x1b')],function(_0x166a7f){return{'model':db[_0x166a7f[_0x2e00('0x1c')]],'as':_0x166a7f['as'],'attributes':_0x166a7f[_0x2e00('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2e00('0x9')](function(_0x479f4c){logger[_0x2e00('0xa')]('ShowSugarcrmAccount',_0x34af34);logger[_0x2e00('0xc')](_0x2e00('0x1e'),_0x34af34,JSON[_0x2e00('0xe')](_0x479f4c));_0x299d0c(_0x479f4c);})[_0x2e00('0x12')](function(_0x232b43){logger['error']('ShowSugarcrmAccount',_0x232b43[_0x2e00('0x11')],_0x34af34);_0x57838a(_0x3c344d['error'](0x1f4,_0x232b43[_0x2e00('0x11')]));});});};
\ No newline at end of file
+var _0x909d=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetSugarcrmAccount','options','raw','where','attributes','limit','map','model','include','find','ShowSugarcrmAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x390e14,_0x3d9be4){var _0x32dd03=function(_0x277ec2){while(--_0x277ec2){_0x390e14['push'](_0x390e14['shift']());}};_0x32dd03(++_0x3d9be4);}(_0x909d,0x170));var _0xd909=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0x909d[_0x58afd5];return _0x3e503b;};'use strict';var _=require('lodash');var util=require(_0xd909('0x0'));var moment=require(_0xd909('0x1'));var BPromise=require(_0xd909('0x2'));var rs=require(_0xd909('0x3'));var fs=require('fs');var Redis=require(_0xd909('0x4'));var db=require(_0xd909('0x5'))['db'];var utils=require(_0xd909('0x6'));var logger=require(_0xd909('0x7'))(_0xd909('0x8'));var config=require(_0xd909('0x9'));var jayson=require(_0xd909('0xa'));var client=jayson['client'][_0xd909('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d9994,_0xde462f,_0x38b52a){return new BPromise(function(_0x2d251d,_0x57aa79){return client['request'](_0x4d9994,_0x38b52a)[_0xd909('0xc')](function(_0x1a3718){logger[_0xd909('0xd')](_0xd909('0xe'),_0xde462f,_0xd909('0xf'));logger[_0xd909('0x10')](_0xd909('0x11'),_0xde462f,'request\x20sent',JSON[_0xd909('0x12')](_0x1a3718));if(_0x1a3718[_0xd909('0x13')]){if(_0x1a3718['error'][_0xd909('0x14')]===0x1f4){logger[_0xd909('0x13')](_0xd909('0xe'),_0xde462f,_0x1a3718['error'][_0xd909('0x15')]);return _0x57aa79(_0x1a3718['error'][_0xd909('0x15')]);}logger[_0xd909('0x13')](_0xd909('0xe'),_0xde462f,_0x1a3718[_0xd909('0x13')][_0xd909('0x15')]);return _0x2d251d(_0x1a3718[_0xd909('0x13')][_0xd909('0x15')]);}else{logger[_0xd909('0xd')](_0xd909('0xe'),_0xde462f,_0xd909('0xf'));_0x2d251d(_0x1a3718['result'][_0xd909('0x15')]);}})[_0xd909('0x16')](function(_0x5c5ea7){logger['error'](_0xd909('0xe'),_0xde462f,_0x5c5ea7);_0x57aa79(_0x5c5ea7);});});}exports[_0xd909('0x17')]=function(_0x5b16e7){var _0x46be33=this;return new Promise(function(_0x4b2d35,_0x1e9f5a){return db['SugarcrmAccount']['findAll']({'raw':_0x5b16e7[_0xd909('0x18')]?_0x5b16e7[_0xd909('0x18')][_0xd909('0x19')]===undefined?!![]:![]:!![],'where':_0x5b16e7['options']?_0x5b16e7[_0xd909('0x18')][_0xd909('0x1a')]||null:null,'attributes':_0x5b16e7['options']?_0x5b16e7[_0xd909('0x18')][_0xd909('0x1b')]||null:null,'limit':_0x5b16e7['options']?_0x5b16e7[_0xd909('0x18')][_0xd909('0x1c')]||null:null,'include':_0x5b16e7[_0xd909('0x18')]?_0x5b16e7['options']['include']?_[_0xd909('0x1d')](_0x5b16e7['options']['include'],function(_0x53c4ab){return{'model':db[_0x53c4ab[_0xd909('0x1e')]],'as':_0x53c4ab['as'],'attributes':_0x53c4ab[_0xd909('0x1b')],'include':_0x53c4ab['include']?_['map'](_0x53c4ab[_0xd909('0x1f')],function(_0x1486fb){return{'model':db[_0x1486fb[_0xd909('0x1e')]],'as':_0x1486fb['as'],'attributes':_0x1486fb['attributes'],'include':_0x1486fb[_0xd909('0x1f')]?_[_0xd909('0x1d')](_0x1486fb[_0xd909('0x1f')],function(_0x938572){return{'model':db[_0x938572[_0xd909('0x1e')]],'as':_0x938572['as'],'attributes':_0x938572[_0xd909('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd909('0xc')](function(_0x334d31){logger['info']('GetSugarcrmAccount',_0x5b16e7);logger['debug'](_0xd909('0x17'),_0x5b16e7,JSON['stringify'](_0x334d31));_0x4b2d35(_0x334d31);})[_0xd909('0x16')](function(_0x23870b){logger[_0xd909('0x13')]('GetSugarcrmAccount',_0x23870b[_0xd909('0x15')],_0x5b16e7);_0x1e9f5a(_0x46be33[_0xd909('0x13')](0x1f4,_0x23870b[_0xd909('0x15')]));});});};exports['ShowSugarcrmAccount']=function(_0x12121f){var _0x19b5db=this;return new Promise(function(_0x38376f,_0x45b0c6){return db['SugarcrmAccount'][_0xd909('0x20')]({'raw':_0x12121f[_0xd909('0x18')]?_0x12121f[_0xd909('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x12121f[_0xd909('0x18')]?_0x12121f[_0xd909('0x18')][_0xd909('0x1a')]||null:null,'attributes':_0x12121f[_0xd909('0x18')]?_0x12121f[_0xd909('0x18')][_0xd909('0x1b')]||null:null,'include':_0x12121f[_0xd909('0x18')]?_0x12121f[_0xd909('0x18')][_0xd909('0x1f')]?_[_0xd909('0x1d')](_0x12121f['options'][_0xd909('0x1f')],function(_0x5522a6){return{'model':db[_0x5522a6[_0xd909('0x1e')]],'as':_0x5522a6['as'],'attributes':_0x5522a6['attributes'],'include':_0x5522a6['include']?_['map'](_0x5522a6[_0xd909('0x1f')],function(_0x25f9ae){return{'model':db[_0x25f9ae['model']],'as':_0x25f9ae['as'],'attributes':_0x25f9ae[_0xd909('0x1b')],'include':_0x25f9ae[_0xd909('0x1f')]?_[_0xd909('0x1d')](_0x25f9ae[_0xd909('0x1f')],function(_0x1456f5){return{'model':db[_0x1456f5[_0xd909('0x1e')]],'as':_0x1456f5['as'],'attributes':_0x1456f5['attributes']};}):[]};}):[]};}):[]:[]})[_0xd909('0xc')](function(_0x502155){logger[_0xd909('0xd')](_0xd909('0x21'),_0x12121f);logger[_0xd909('0x10')](_0xd909('0x21'),_0x12121f,JSON[_0xd909('0x12')](_0x502155));_0x38376f(_0x502155);})[_0xd909('0x16')](function(_0x12b68b){logger[_0xd909('0x13')](_0xd909('0x21'),_0x12b68b[_0xd909('0x15')],_0x12121f);_0x45b0c6(_0x19b5db[_0xd909('0x13')](0x1f4,_0x12b68b['message']));});});};
\ No newline at end of file
index a9b3015..95fd0ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde48=['exports','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update'];(function(_0x2447d7,_0x3466fe){var _0x262442=function(_0x4fd8d5){while(--_0x4fd8d5){_0x2447d7['push'](_0x2447d7['shift']());}};_0x262442(++_0x3466fe);}(_0xde48,0x119));var _0x8de4=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xde48[_0x2bf141];return _0x48277b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8de4('0x0'));var timeout=require(_0x8de4('0x1'));var express=require('express');var router=express[_0x8de4('0x2')]();var fs_extra=require(_0x8de4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x8de4('0x4'));var config=require('../../config/environment');var controller=require(_0x8de4('0x5'));router[_0x8de4('0x6')]('/',auth[_0x8de4('0x7')](),controller[_0x8de4('0x8')]);router[_0x8de4('0x6')]('/:id',auth[_0x8de4('0x7')](),controller[_0x8de4('0x9')]);router[_0x8de4('0x6')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x8de4('0x6')](_0x8de4('0xa'),auth[_0x8de4('0x7')](),controller[_0x8de4('0xb')]);router[_0x8de4('0x6')](_0x8de4('0xc'),auth[_0x8de4('0x7')](),controller[_0x8de4('0xd')]);router[_0x8de4('0xe')]('/',auth['isAuthenticated'](),controller[_0x8de4('0xf')]);router[_0x8de4('0x10')](_0x8de4('0x11'),auth[_0x8de4('0x7')](),controller[_0x8de4('0x12')]);router['delete'](_0x8de4('0x11'),auth[_0x8de4('0x7')](),controller['destroy']);module[_0x8de4('0x13')]=router;
\ No newline at end of file
+var _0x51d8=['/:id/descriptions','getDescriptions','post','create','update','destroy','exports','multer','express','Router','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects'];(function(_0x2d4065,_0x38dc95){var _0xef6016=function(_0x195cee){while(--_0x195cee){_0x2d4065['push'](_0x2d4065['shift']());}};_0xef6016(++_0x38dc95);}(_0x51d8,0xcf));var _0x851d=function(_0x491bb4,_0x14d75e){_0x491bb4=_0x491bb4-0x0;var _0x458e08=_0x51d8[_0x491bb4];return _0x458e08;};'use strict';var multer=require(_0x851d('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x851d('0x1'));var router=express[_0x851d('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x851d('0x3'));var controller=require(_0x851d('0x4'));router[_0x851d('0x5')]('/',auth[_0x851d('0x6')](),controller[_0x851d('0x7')]);router[_0x851d('0x5')](_0x851d('0x8'),auth['isAuthenticated'](),controller[_0x851d('0x9')]);router[_0x851d('0x5')](_0x851d('0xa'),auth[_0x851d('0x6')](),controller[_0x851d('0xb')]);router['get'](_0x851d('0xc'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x851d('0x5')](_0x851d('0xd'),auth[_0x851d('0x6')](),controller[_0x851d('0xe')]);router[_0x851d('0xf')]('/',auth['isAuthenticated'](),controller[_0x851d('0x10')]);router['put'](_0x851d('0x8'),auth[_0x851d('0x6')](),controller[_0x851d('0x11')]);router['delete'](_0x851d('0x8'),auth['isAuthenticated'](),controller[_0x851d('0x12')]);module[_0x851d('0x13')]=router;
\ No newline at end of file
index 0da724e..89dc045 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x429d=['sequelize'];(function(_0x3ac563,_0x53621e){var _0x3e855f=function(_0xd0d3fb){while(--_0xd0d3fb){_0x3ac563['push'](_0x3ac563['shift']());}};_0x3e855f(++_0x53621e);}(_0x429d,0xcd));var _0xd429=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x429d[_0x49ca18];return _0x145d54;};'use strict';var Sequelize=require(_0xd429('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0acb=['STRING','sequelize','exports'];(function(_0x5a461e,_0xe83e49){var _0x1fac23=function(_0x32517a){while(--_0x32517a){_0x5a461e['push'](_0x5a461e['shift']());}};_0x1fac23(++_0xe83e49);}(_0x0acb,0x1ae));var _0xb0ac=function(_0x488248,_0x33e8eb){_0x488248=_0x488248-0x0;var _0x337fab=_0x0acb[_0x488248];return _0x337fab;};'use strict';var Sequelize=require(_0xb0ac('0x0'));module[_0xb0ac('0x1')]={'name':{'type':Sequelize[_0xb0ac('0x2')]},'description':{'type':Sequelize[_0xb0ac('0x2')]}};
\ No newline at end of file
index f551181..29635e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb7e=['VIRTUAL','includeAll','SugarcrmConfiguration','findAll','catch','show','params','rawAttributes','include','options','find','create','body','getFields','findOne','SugarcrmField','getSubjects','pick','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge'];(function(_0x4670e1,_0x174851){var _0x25da6b=function(_0x14de0e){while(--_0x14de0e){_0x4670e1['push'](_0x4670e1['shift']());}};_0x25da6b(++_0x174851);}(_0xeb7e,0x65));var _0xeeb7=function(_0x300caf,_0x2d22ad){_0x300caf=_0x300caf-0x0;var _0x9d99a4=_0xeb7e[_0x300caf];return _0x9d99a4;};'use strict';var emlformat=require(_0xeeb7('0x0'));var rimraf=require(_0xeeb7('0x1'));var zipdir=require(_0xeeb7('0x2'));var jsonpatch=require(_0xeeb7('0x3'));var rp=require(_0xeeb7('0x4'));var moment=require(_0xeeb7('0x5'));var BPromise=require(_0xeeb7('0x6'));var Mustache=require('mustache');var util=require(_0xeeb7('0x7'));var path=require(_0xeeb7('0x8'));var sox=require('sox');var csv=require(_0xeeb7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeeb7('0xa'));var _=require(_0xeeb7('0xb'));var squel=require(_0xeeb7('0xc'));var crypto=require('crypto');var jsforce=require(_0xeeb7('0xd'));var deskjs=require(_0xeeb7('0xe'));var toCsv=require(_0xeeb7('0x9'));var querystring=require(_0xeeb7('0xf'));var Papa=require('papaparse');var Redis=require(_0xeeb7('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xeeb7('0x11'));var hardwareService=require(_0xeeb7('0x12'));var logger=require('../../config/logger')(_0xeeb7('0x13'));var utils=require(_0xeeb7('0x14'));var config=require(_0xeeb7('0x15'));var licenseUtil=require(_0xeeb7('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d8e91,_0x436f64){_0x436f64=_0x436f64||0xcc;return function(_0x5bffae){if(_0x5bffae){return _0x4d8e91[_0xeeb7('0x17')](_0x436f64);}return _0x4d8e91[_0xeeb7('0x18')](_0x436f64)[_0xeeb7('0x19')]();};}function respondWithResult(_0x1cb010,_0x5378b1){_0x5378b1=_0x5378b1||0xc8;return function(_0x441c0f){if(_0x441c0f){return _0x1cb010['status'](_0x5378b1)[_0xeeb7('0x1a')](_0x441c0f);}};}function respondWithFilteredResult(_0x2b69a9,_0xcedbf5){return function(_0x4448a0){if(_0x4448a0){var _0x308364=typeof _0xcedbf5[_0xeeb7('0x1b')]==='undefined'&&typeof _0xcedbf5['limit']===_0xeeb7('0x1c');var _0x437f15=_0x4448a0[_0xeeb7('0x1d')];var _0x80c580=_0x308364?0x0:_0xcedbf5[_0xeeb7('0x1b')];var _0x37e4e1=_0x308364?_0x4448a0['count']:_0xcedbf5[_0xeeb7('0x1b')]+_0xcedbf5[_0xeeb7('0x1e')];var _0x486ce1;if(_0x37e4e1>=_0x437f15){_0x37e4e1=_0x437f15;_0x486ce1=0xc8;}else{_0x486ce1=0xce;}_0x2b69a9[_0xeeb7('0x18')](_0x486ce1);return _0x2b69a9[_0xeeb7('0x1f')](_0xeeb7('0x20'),_0x80c580+'-'+_0x37e4e1+'/'+_0x437f15)[_0xeeb7('0x1a')](_0x4448a0);}return null;};}function patchUpdates(_0x1f28cb){return function(_0x3ba69c){try{jsonpatch[_0xeeb7('0x21')](_0x3ba69c,_0x1f28cb,!![]);}catch(_0x844050){return BPromise[_0xeeb7('0x22')](_0x844050);}return _0x3ba69c[_0xeeb7('0x23')]();};}function saveUpdates(_0x4ba49f,_0x32be53){return function(_0x36cb0a){if(_0x36cb0a){return _0x36cb0a[_0xeeb7('0x24')](_0x4ba49f)[_0xeeb7('0x25')](function(_0x5b52f1){return _0x5b52f1;});}return null;};}function removeEntity(_0x5b77bb,_0x135aa3){return function(_0x5f1195){if(_0x5f1195){return _0x5f1195[_0xeeb7('0x26')]()[_0xeeb7('0x25')](function(){_0x5b77bb['status'](0xcc)[_0xeeb7('0x19')]();});}};}function handleEntityNotFound(_0x3a7f8d,_0x2e21f1){return function(_0x38904b){if(!_0x38904b){_0x3a7f8d['sendStatus'](0x194);}return _0x38904b;};}function handleError(_0x429255,_0x5a69b0){_0x5a69b0=_0x5a69b0||0x1f4;return function(_0x3cf8ed){logger[_0xeeb7('0x27')](_0x3cf8ed[_0xeeb7('0x28')]);if(_0x3cf8ed['name']){delete _0x3cf8ed[_0xeeb7('0x29')];}_0x429255[_0xeeb7('0x18')](_0x5a69b0)[_0xeeb7('0x2a')](_0x3cf8ed);};}exports[_0xeeb7('0x2b')]=function(_0x2966f1,_0x561510){var _0x40d612={},_0x58b0b5={},_0x2a4688={'count':0x0,'rows':[]};var _0x1b6e88=_[_0xeeb7('0x2c')](db['SugarcrmConfiguration']['rawAttributes'],function(_0x493775){return{'name':_0x493775[_0xeeb7('0x2d')],'type':_0x493775[_0xeeb7('0x2e')][_0xeeb7('0x2f')]};});_0x58b0b5[_0xeeb7('0x30')]=_['map'](_0x1b6e88,'name');_0x58b0b5[_0xeeb7('0x31')]=_[_0xeeb7('0x32')](_0x2966f1[_0xeeb7('0x31')]);_0x58b0b5[_0xeeb7('0x33')]=_['intersection'](_0x58b0b5['model'],_0x58b0b5[_0xeeb7('0x31')]);_0x40d612['attributes']=_[_0xeeb7('0x34')](_0x58b0b5['model'],qs['fields'](_0x2966f1[_0xeeb7('0x31')][_0xeeb7('0x35')]));_0x40d612[_0xeeb7('0x36')]=_0x40d612[_0xeeb7('0x36')][_0xeeb7('0x37')]?_0x40d612[_0xeeb7('0x36')]:_0x58b0b5[_0xeeb7('0x30')];if(!_0x2966f1[_0xeeb7('0x31')][_0xeeb7('0x38')](_0xeeb7('0x39'))){_0x40d612[_0xeeb7('0x1e')]=qs['limit'](_0x2966f1['query']['limit']);_0x40d612[_0xeeb7('0x1b')]=qs[_0xeeb7('0x1b')](_0x2966f1[_0xeeb7('0x31')][_0xeeb7('0x1b')]);}_0x40d612[_0xeeb7('0x3a')]=qs[_0xeeb7('0x3b')](_0x2966f1[_0xeeb7('0x31')][_0xeeb7('0x3b')]);_0x40d612[_0xeeb7('0x3c')]=qs[_0xeeb7('0x33')](_['pick'](_0x2966f1[_0xeeb7('0x31')],_0x58b0b5[_0xeeb7('0x33')]),_0x1b6e88);if(_0x2966f1[_0xeeb7('0x31')][_0xeeb7('0x3d')]){_0x40d612[_0xeeb7('0x3c')]=_[_0xeeb7('0x3e')](_0x40d612[_0xeeb7('0x3c')],{'$or':_['map'](_0x1b6e88,function(_0x266a8b){if(_0x266a8b['type']!==_0xeeb7('0x3f')){var _0x2a5e6b={};_0x2a5e6b[_0x266a8b[_0xeeb7('0x29')]]={'$like':'%'+_0x2966f1[_0xeeb7('0x31')][_0xeeb7('0x3d')]+'%'};return _0x2a5e6b;}})});}_0x40d612=_[_0xeeb7('0x3e')]({},_0x40d612,_0x2966f1['options']);var _0x1f5e65={'where':_0x40d612[_0xeeb7('0x3c')]};return db['SugarcrmConfiguration'][_0xeeb7('0x1d')](_0x1f5e65)[_0xeeb7('0x25')](function(_0x768b39){_0x2a4688[_0xeeb7('0x1d')]=_0x768b39;if(_0x2966f1[_0xeeb7('0x31')][_0xeeb7('0x40')]){_0x40d612['include']=[{'all':!![]}];}return db[_0xeeb7('0x41')][_0xeeb7('0x42')](_0x40d612);})[_0xeeb7('0x25')](function(_0x581e55){_0x2a4688['rows']=_0x581e55;return _0x2a4688;})[_0xeeb7('0x25')](respondWithFilteredResult(_0x561510,_0x40d612))[_0xeeb7('0x43')](handleError(_0x561510,null));};exports[_0xeeb7('0x44')]=function(_0x5bc44e,_0x39d32d){var _0x498df4={'raw':![],'where':{'id':_0x5bc44e[_0xeeb7('0x45')]['id']}},_0x573c0d={};_0x573c0d['model']=_['keys'](db[_0xeeb7('0x41')][_0xeeb7('0x46')]);_0x573c0d[_0xeeb7('0x31')]=_[_0xeeb7('0x32')](_0x5bc44e[_0xeeb7('0x31')]);_0x573c0d['filters']=_['intersection'](_0x573c0d[_0xeeb7('0x30')],_0x573c0d[_0xeeb7('0x31')]);_0x498df4[_0xeeb7('0x36')]=_[_0xeeb7('0x34')](_0x573c0d[_0xeeb7('0x30')],qs['fields'](_0x5bc44e[_0xeeb7('0x31')][_0xeeb7('0x35')]));_0x498df4[_0xeeb7('0x36')]=_0x498df4[_0xeeb7('0x36')][_0xeeb7('0x37')]?_0x498df4[_0xeeb7('0x36')]:_0x573c0d[_0xeeb7('0x30')];if(_0x5bc44e[_0xeeb7('0x31')]['includeAll']){_0x498df4[_0xeeb7('0x47')]=[{'all':!![]}];}_0x498df4=_[_0xeeb7('0x3e')]({},_0x498df4,_0x5bc44e[_0xeeb7('0x48')]);return db[_0xeeb7('0x41')][_0xeeb7('0x49')](_0x498df4)[_0xeeb7('0x25')](handleEntityNotFound(_0x39d32d,null))['then'](respondWithResult(_0x39d32d,null))[_0xeeb7('0x43')](handleError(_0x39d32d,null));};exports[_0xeeb7('0x4a')]=function(_0x3f4cda,_0x1ab859){return db['SugarcrmConfiguration']['create'](_0x3f4cda[_0xeeb7('0x4b')],{})[_0xeeb7('0x25')](respondWithResult(_0x1ab859,0xc9))[_0xeeb7('0x43')](handleError(_0x1ab859,null));};exports[_0xeeb7('0x24')]=function(_0x1d58c8,_0x4cc5e6){if(_0x1d58c8[_0xeeb7('0x4b')]['id']){delete _0x1d58c8[_0xeeb7('0x4b')]['id'];}return db[_0xeeb7('0x41')][_0xeeb7('0x49')]({'where':{'id':_0x1d58c8[_0xeeb7('0x45')]['id']}})[_0xeeb7('0x25')](handleEntityNotFound(_0x4cc5e6,null))[_0xeeb7('0x25')](saveUpdates(_0x1d58c8[_0xeeb7('0x4b')],null))[_0xeeb7('0x25')](respondWithResult(_0x4cc5e6,null))[_0xeeb7('0x43')](handleError(_0x4cc5e6,null));};exports['destroy']=function(_0x9d48b,_0x5d0277){return db[_0xeeb7('0x41')][_0xeeb7('0x49')]({'where':{'id':_0x9d48b['params']['id']}})['then'](handleEntityNotFound(_0x5d0277,null))[_0xeeb7('0x25')](removeEntity(_0x5d0277,null))[_0xeeb7('0x43')](handleError(_0x5d0277,null));};exports[_0xeeb7('0x4c')]=function(_0x42b2e3,_0x250d1d,_0xe82674){var _0x28d99a={};var _0x56fe4a={};var _0x219d25;var _0x55a336;return db['SugarcrmConfiguration'][_0xeeb7('0x4d')]({'where':{'id':_0x42b2e3[_0xeeb7('0x45')]['id']}})[_0xeeb7('0x25')](handleEntityNotFound(_0x250d1d,null))['then'](function(_0x5df018){if(_0x5df018){_0x219d25=_0x5df018;_0x56fe4a[_0xeeb7('0x30')]=_[_0xeeb7('0x32')](db[_0xeeb7('0x4e')]['rawAttributes']);_0x56fe4a['query']=_[_0xeeb7('0x32')](_0x42b2e3[_0xeeb7('0x31')]);_0x56fe4a[_0xeeb7('0x33')]=_[_0xeeb7('0x34')](_0x56fe4a[_0xeeb7('0x30')],_0x56fe4a['query']);_0x28d99a[_0xeeb7('0x36')]=_['intersection'](_0x56fe4a[_0xeeb7('0x30')],qs[_0xeeb7('0x35')](_0x42b2e3[_0xeeb7('0x31')][_0xeeb7('0x35')]));_0x28d99a['attributes']=_0x28d99a[_0xeeb7('0x36')][_0xeeb7('0x37')]?_0x28d99a[_0xeeb7('0x36')]:_0x56fe4a[_0xeeb7('0x30')];_0x28d99a['order']=qs[_0xeeb7('0x3b')](_0x42b2e3[_0xeeb7('0x31')][_0xeeb7('0x3b')]);_0x28d99a[_0xeeb7('0x3c')]=qs[_0xeeb7('0x33')](_['pick'](_0x42b2e3['query'],_0x56fe4a[_0xeeb7('0x33')]));if(_0x42b2e3['query'][_0xeeb7('0x3d')]){_0x28d99a[_0xeeb7('0x3c')]=_[_0xeeb7('0x3e')](_0x28d99a['where'],{'$or':_['map'](_0x28d99a[_0xeeb7('0x36')],function(_0x2cc6a2){var _0x53992a={};_0x53992a[_0x2cc6a2]={'$like':'%'+_0x42b2e3[_0xeeb7('0x31')][_0xeeb7('0x3d')]+'%'};return _0x53992a;})});}_0x28d99a=_['merge']({},_0x28d99a,_0x42b2e3[_0xeeb7('0x48')]);return _0x219d25[_0xeeb7('0x4c')](_0x28d99a);}})['then'](function(_0x166cff){if(_0x166cff){_0x55a336=_0x166cff[_0xeeb7('0x37')];if(!_0x42b2e3[_0xeeb7('0x31')]['hasOwnProperty'](_0xeeb7('0x39'))){_0x28d99a[_0xeeb7('0x1e')]=qs[_0xeeb7('0x1e')](_0x42b2e3['query'][_0xeeb7('0x1e')]);_0x28d99a[_0xeeb7('0x1b')]=qs[_0xeeb7('0x1b')](_0x42b2e3[_0xeeb7('0x31')][_0xeeb7('0x1b')]);}return _0x219d25[_0xeeb7('0x4c')](_0x28d99a);}})[_0xeeb7('0x25')](function(_0x4b3576){if(_0x4b3576){return _0x4b3576?{'count':_0x55a336,'rows':_0x4b3576}:null;}})[_0xeeb7('0x25')](respondWithResult(_0x250d1d,null))[_0xeeb7('0x43')](handleError(_0x250d1d,null));};exports[_0xeeb7('0x4f')]=function(_0x560f21,_0xb7b51b,_0x1ff40c){var _0x57de33={};var _0x35a826={};var _0x58bad6;var _0x4dbea2;return db[_0xeeb7('0x41')]['findOne']({'where':{'id':_0x560f21[_0xeeb7('0x45')]['id']}})[_0xeeb7('0x25')](handleEntityNotFound(_0xb7b51b,null))[_0xeeb7('0x25')](function(_0xcbf4bc){if(_0xcbf4bc){_0x58bad6=_0xcbf4bc;_0x35a826[_0xeeb7('0x30')]=_[_0xeeb7('0x32')](db[_0xeeb7('0x4e')][_0xeeb7('0x46')]);_0x35a826['query']=_[_0xeeb7('0x32')](_0x560f21[_0xeeb7('0x31')]);_0x35a826[_0xeeb7('0x33')]=_['intersection'](_0x35a826[_0xeeb7('0x30')],_0x35a826['query']);_0x57de33[_0xeeb7('0x36')]=_[_0xeeb7('0x34')](_0x35a826['model'],qs[_0xeeb7('0x35')](_0x560f21[_0xeeb7('0x31')][_0xeeb7('0x35')]));_0x57de33[_0xeeb7('0x36')]=_0x57de33['attributes'][_0xeeb7('0x37')]?_0x57de33[_0xeeb7('0x36')]:_0x35a826['model'];_0x57de33[_0xeeb7('0x3a')]=qs[_0xeeb7('0x3b')](_0x560f21[_0xeeb7('0x31')][_0xeeb7('0x3b')]);_0x57de33[_0xeeb7('0x3c')]=qs[_0xeeb7('0x33')](_[_0xeeb7('0x50')](_0x560f21[_0xeeb7('0x31')],_0x35a826[_0xeeb7('0x33')]));if(_0x560f21[_0xeeb7('0x31')]['filter']){_0x57de33[_0xeeb7('0x3c')]=_[_0xeeb7('0x3e')](_0x57de33[_0xeeb7('0x3c')],{'$or':_['map'](_0x57de33[_0xeeb7('0x36')],function(_0x28b6e9){var _0x194aea={};_0x194aea[_0x28b6e9]={'$like':'%'+_0x560f21[_0xeeb7('0x31')][_0xeeb7('0x3d')]+'%'};return _0x194aea;})});}_0x57de33=_[_0xeeb7('0x3e')]({},_0x57de33,_0x560f21[_0xeeb7('0x48')]);return _0x58bad6[_0xeeb7('0x4f')](_0x57de33);}})[_0xeeb7('0x25')](function(_0x369f29){if(_0x369f29){_0x4dbea2=_0x369f29[_0xeeb7('0x37')];if(!_0x560f21['query'][_0xeeb7('0x38')](_0xeeb7('0x39'))){_0x57de33[_0xeeb7('0x1e')]=qs[_0xeeb7('0x1e')](_0x560f21[_0xeeb7('0x31')][_0xeeb7('0x1e')]);_0x57de33[_0xeeb7('0x1b')]=qs['offset'](_0x560f21[_0xeeb7('0x31')][_0xeeb7('0x1b')]);}return _0x58bad6[_0xeeb7('0x4f')](_0x57de33);}})[_0xeeb7('0x25')](function(_0x515ea6){if(_0x515ea6){return _0x515ea6?{'count':_0x4dbea2,'rows':_0x515ea6}:null;}})[_0xeeb7('0x25')](respondWithResult(_0xb7b51b,null))[_0xeeb7('0x43')](handleError(_0xb7b51b,null));};exports['getDescriptions']=function(_0x2d7c82,_0x1be789,_0x5dbf02){var _0x18b3bc={};var _0x29af7d={};var _0x1984f1;var _0x4bd720;return db[_0xeeb7('0x41')][_0xeeb7('0x4d')]({'where':{'id':_0x2d7c82[_0xeeb7('0x45')]['id']}})[_0xeeb7('0x25')](handleEntityNotFound(_0x1be789,null))[_0xeeb7('0x25')](function(_0x57f463){if(_0x57f463){_0x1984f1=_0x57f463;_0x29af7d[_0xeeb7('0x30')]=_[_0xeeb7('0x32')](db['SugarcrmField'][_0xeeb7('0x46')]);_0x29af7d[_0xeeb7('0x31')]=_[_0xeeb7('0x32')](_0x2d7c82[_0xeeb7('0x31')]);_0x29af7d[_0xeeb7('0x33')]=_[_0xeeb7('0x34')](_0x29af7d[_0xeeb7('0x30')],_0x29af7d[_0xeeb7('0x31')]);_0x18b3bc['attributes']=_[_0xeeb7('0x34')](_0x29af7d[_0xeeb7('0x30')],qs[_0xeeb7('0x35')](_0x2d7c82[_0xeeb7('0x31')][_0xeeb7('0x35')]));_0x18b3bc[_0xeeb7('0x36')]=_0x18b3bc[_0xeeb7('0x36')][_0xeeb7('0x37')]?_0x18b3bc[_0xeeb7('0x36')]:_0x29af7d['model'];_0x18b3bc[_0xeeb7('0x3a')]=qs[_0xeeb7('0x3b')](_0x2d7c82[_0xeeb7('0x31')][_0xeeb7('0x3b')]);_0x18b3bc[_0xeeb7('0x3c')]=qs[_0xeeb7('0x33')](_[_0xeeb7('0x50')](_0x2d7c82[_0xeeb7('0x31')],_0x29af7d[_0xeeb7('0x33')]));if(_0x2d7c82[_0xeeb7('0x31')][_0xeeb7('0x3d')]){_0x18b3bc['where']=_[_0xeeb7('0x3e')](_0x18b3bc['where'],{'$or':_['map'](_0x18b3bc[_0xeeb7('0x36')],function(_0x5626f0){var _0x54c5ca={};_0x54c5ca[_0x5626f0]={'$like':'%'+_0x2d7c82['query'][_0xeeb7('0x3d')]+'%'};return _0x54c5ca;})});}_0x18b3bc=_[_0xeeb7('0x3e')]({},_0x18b3bc,_0x2d7c82[_0xeeb7('0x48')]);return _0x1984f1['getDescriptions'](_0x18b3bc);}})['then'](function(_0x3e5599){if(_0x3e5599){_0x4bd720=_0x3e5599[_0xeeb7('0x37')];if(!_0x2d7c82['query'][_0xeeb7('0x38')](_0xeeb7('0x39'))){_0x18b3bc[_0xeeb7('0x1e')]=qs[_0xeeb7('0x1e')](_0x2d7c82[_0xeeb7('0x31')][_0xeeb7('0x1e')]);_0x18b3bc['offset']=qs[_0xeeb7('0x1b')](_0x2d7c82[_0xeeb7('0x31')][_0xeeb7('0x1b')]);}return _0x1984f1[_0xeeb7('0x51')](_0x18b3bc);}})[_0xeeb7('0x25')](function(_0x58e64e){if(_0x58e64e){return _0x58e64e?{'count':_0x4bd720,'rows':_0x58e64e}:null;}})[_0xeeb7('0x25')](respondWithResult(_0x1be789,null))['catch'](handleError(_0x1be789,null));};
\ No newline at end of file
+var _0x67b4=['rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','SugarcrmConfiguration','rows','catch','show','include','create','body','find','params','getFields','nolimit','findOne','SugarcrmField','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map'];(function(_0x35181c,_0x82694a){var _0xe14bf9=function(_0x2be9b7){while(--_0x2be9b7){_0x35181c['push'](_0x35181c['shift']());}};_0xe14bf9(++_0x82694a);}(_0x67b4,0xd0));var _0x467b=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x67b4[_0x5a9c0c];return _0x53c77d;};'use strict';var emlformat=require(_0x467b('0x0'));var rimraf=require(_0x467b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x467b('0x2'));var rp=require(_0x467b('0x3'));var moment=require(_0x467b('0x4'));var BPromise=require(_0x467b('0x5'));var Mustache=require(_0x467b('0x6'));var util=require(_0x467b('0x7'));var path=require(_0x467b('0x8'));var sox=require(_0x467b('0x9'));var csv=require(_0x467b('0xa'));var ejs=require(_0x467b('0xb'));var fs=require('fs');var fs_extra=require(_0x467b('0xc'));var _=require(_0x467b('0xd'));var squel=require(_0x467b('0xe'));var crypto=require(_0x467b('0xf'));var jsforce=require(_0x467b('0x10'));var deskjs=require(_0x467b('0x11'));var toCsv=require(_0x467b('0xa'));var querystring=require(_0x467b('0x12'));var Papa=require(_0x467b('0x13'));var Redis=require(_0x467b('0x14'));var authService=require(_0x467b('0x15'));var qs=require(_0x467b('0x16'));var as=require(_0x467b('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x467b('0x18'))(_0x467b('0x19'));var utils=require(_0x467b('0x1a'));var config=require(_0x467b('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x467b('0x1c'))['db'];function respondWithStatusCode(_0x30a1af,_0x46824c){_0x46824c=_0x46824c||0xcc;return function(_0x5adbd6){if(_0x5adbd6){return _0x30a1af[_0x467b('0x1d')](_0x46824c);}return _0x30a1af[_0x467b('0x1e')](_0x46824c)[_0x467b('0x1f')]();};}function respondWithResult(_0x4e0d67,_0x122794){_0x122794=_0x122794||0xc8;return function(_0x7b2db){if(_0x7b2db){return _0x4e0d67[_0x467b('0x1e')](_0x122794)[_0x467b('0x20')](_0x7b2db);}};}function respondWithFilteredResult(_0x418335,_0x19fefa){return function(_0xf1a2e){if(_0xf1a2e){var _0x250dc0=typeof _0x19fefa[_0x467b('0x21')]===_0x467b('0x22')&&typeof _0x19fefa['limit']==='undefined';var _0x3553dd=_0xf1a2e[_0x467b('0x23')];var _0x324ff9=_0x250dc0?0x0:_0x19fefa[_0x467b('0x21')];var _0x4d7719=_0x250dc0?_0xf1a2e['count']:_0x19fefa['offset']+_0x19fefa[_0x467b('0x24')];var _0x14d6b9;if(_0x4d7719>=_0x3553dd){_0x4d7719=_0x3553dd;_0x14d6b9=0xc8;}else{_0x14d6b9=0xce;}_0x418335['status'](_0x14d6b9);return _0x418335[_0x467b('0x25')](_0x467b('0x26'),_0x324ff9+'-'+_0x4d7719+'/'+_0x3553dd)[_0x467b('0x20')](_0xf1a2e);}return null;};}function patchUpdates(_0x3c93c9){return function(_0x4a2396){try{jsonpatch[_0x467b('0x27')](_0x4a2396,_0x3c93c9,!![]);}catch(_0x44080d){return BPromise[_0x467b('0x28')](_0x44080d);}return _0x4a2396[_0x467b('0x29')]();};}function saveUpdates(_0x40bd0f,_0x3307ce){return function(_0x330a11){if(_0x330a11){return _0x330a11[_0x467b('0x2a')](_0x40bd0f)[_0x467b('0x2b')](function(_0x10fe97){return _0x10fe97;});}return null;};}function removeEntity(_0x450091,_0x4a1dd6){return function(_0x3540e7){if(_0x3540e7){return _0x3540e7[_0x467b('0x2c')]()[_0x467b('0x2b')](function(){_0x450091[_0x467b('0x1e')](0xcc)[_0x467b('0x1f')]();});}};}function handleEntityNotFound(_0x396178,_0x563b17){return function(_0x242bba){if(!_0x242bba){_0x396178[_0x467b('0x1d')](0x194);}return _0x242bba;};}function handleError(_0x2e7b54,_0x2af700){_0x2af700=_0x2af700||0x1f4;return function(_0x47dde8){logger[_0x467b('0x2d')](_0x47dde8['stack']);if(_0x47dde8[_0x467b('0x2e')]){delete _0x47dde8['name'];}_0x2e7b54['status'](_0x2af700)[_0x467b('0x2f')](_0x47dde8);};}exports[_0x467b('0x30')]=function(_0x343756,_0xfcfb07){var _0x3bd685={},_0x39d4c8={},_0x3507bc={'count':0x0,'rows':[]};var _0x23b177=_[_0x467b('0x31')](db['SugarcrmConfiguration'][_0x467b('0x32')],function(_0x536d10){return{'name':_0x536d10[_0x467b('0x33')],'type':_0x536d10[_0x467b('0x34')][_0x467b('0x35')]};});_0x39d4c8[_0x467b('0x36')]=_[_0x467b('0x31')](_0x23b177,_0x467b('0x2e'));_0x39d4c8[_0x467b('0x37')]=_[_0x467b('0x38')](_0x343756['query']);_0x39d4c8[_0x467b('0x39')]=_['intersection'](_0x39d4c8[_0x467b('0x36')],_0x39d4c8[_0x467b('0x37')]);_0x3bd685[_0x467b('0x3a')]=_[_0x467b('0x3b')](_0x39d4c8[_0x467b('0x36')],qs[_0x467b('0x3c')](_0x343756['query']['fields']));_0x3bd685[_0x467b('0x3a')]=_0x3bd685[_0x467b('0x3a')][_0x467b('0x3d')]?_0x3bd685['attributes']:_0x39d4c8[_0x467b('0x36')];if(!_0x343756[_0x467b('0x37')][_0x467b('0x3e')]('nolimit')){_0x3bd685[_0x467b('0x24')]=qs[_0x467b('0x24')](_0x343756[_0x467b('0x37')][_0x467b('0x24')]);_0x3bd685[_0x467b('0x21')]=qs[_0x467b('0x21')](_0x343756[_0x467b('0x37')][_0x467b('0x21')]);}_0x3bd685[_0x467b('0x3f')]=qs[_0x467b('0x40')](_0x343756[_0x467b('0x37')][_0x467b('0x40')]);_0x3bd685['where']=qs[_0x467b('0x39')](_[_0x467b('0x41')](_0x343756[_0x467b('0x37')],_0x39d4c8[_0x467b('0x39')]),_0x23b177);if(_0x343756['query'][_0x467b('0x42')]){_0x3bd685[_0x467b('0x43')]=_[_0x467b('0x44')](_0x3bd685['where'],{'$or':_[_0x467b('0x31')](_0x23b177,function(_0x5dc98c){if(_0x5dc98c[_0x467b('0x34')]!=='VIRTUAL'){var _0xb2bdd7={};_0xb2bdd7[_0x5dc98c[_0x467b('0x2e')]]={'$like':'%'+_0x343756['query'][_0x467b('0x42')]+'%'};return _0xb2bdd7;}})});}_0x3bd685=_['merge']({},_0x3bd685,_0x343756[_0x467b('0x45')]);var _0x35b2d1={'where':_0x3bd685[_0x467b('0x43')]};return db['SugarcrmConfiguration'][_0x467b('0x23')](_0x35b2d1)[_0x467b('0x2b')](function(_0x486051){_0x3507bc['count']=_0x486051;if(_0x343756['query'][_0x467b('0x46')]){_0x3bd685['include']=[{'all':!![]}];}return db[_0x467b('0x47')]['findAll'](_0x3bd685);})[_0x467b('0x2b')](function(_0x12e29a){_0x3507bc[_0x467b('0x48')]=_0x12e29a;return _0x3507bc;})[_0x467b('0x2b')](respondWithFilteredResult(_0xfcfb07,_0x3bd685))[_0x467b('0x49')](handleError(_0xfcfb07,null));};exports[_0x467b('0x4a')]=function(_0x466011,_0x557533){var _0x45f74a={'raw':![],'where':{'id':_0x466011['params']['id']}},_0x45bf51={};_0x45bf51[_0x467b('0x36')]=_['keys'](db[_0x467b('0x47')]['rawAttributes']);_0x45bf51[_0x467b('0x37')]=_['keys'](_0x466011[_0x467b('0x37')]);_0x45bf51['filters']=_[_0x467b('0x3b')](_0x45bf51[_0x467b('0x36')],_0x45bf51[_0x467b('0x37')]);_0x45f74a[_0x467b('0x3a')]=_[_0x467b('0x3b')](_0x45bf51['model'],qs[_0x467b('0x3c')](_0x466011['query'][_0x467b('0x3c')]));_0x45f74a[_0x467b('0x3a')]=_0x45f74a['attributes'][_0x467b('0x3d')]?_0x45f74a['attributes']:_0x45bf51[_0x467b('0x36')];if(_0x466011['query']['includeAll']){_0x45f74a[_0x467b('0x4b')]=[{'all':!![]}];}_0x45f74a=_[_0x467b('0x44')]({},_0x45f74a,_0x466011['options']);return db['SugarcrmConfiguration']['find'](_0x45f74a)[_0x467b('0x2b')](handleEntityNotFound(_0x557533,null))[_0x467b('0x2b')](respondWithResult(_0x557533,null))['catch'](handleError(_0x557533,null));};exports[_0x467b('0x4c')]=function(_0x46ec28,_0x50f51f){return db[_0x467b('0x47')][_0x467b('0x4c')](_0x46ec28[_0x467b('0x4d')],{})[_0x467b('0x2b')](respondWithResult(_0x50f51f,0xc9))[_0x467b('0x49')](handleError(_0x50f51f,null));};exports['update']=function(_0x5bd036,_0x32b0aa){if(_0x5bd036['body']['id']){delete _0x5bd036[_0x467b('0x4d')]['id'];}return db[_0x467b('0x47')][_0x467b('0x4e')]({'where':{'id':_0x5bd036[_0x467b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x32b0aa,null))[_0x467b('0x2b')](saveUpdates(_0x5bd036[_0x467b('0x4d')],null))[_0x467b('0x2b')](respondWithResult(_0x32b0aa,null))['catch'](handleError(_0x32b0aa,null));};exports['destroy']=function(_0x193197,_0x415953){return db[_0x467b('0x47')][_0x467b('0x4e')]({'where':{'id':_0x193197[_0x467b('0x4f')]['id']}})[_0x467b('0x2b')](handleEntityNotFound(_0x415953,null))[_0x467b('0x2b')](removeEntity(_0x415953,null))[_0x467b('0x49')](handleError(_0x415953,null));};exports[_0x467b('0x50')]=function(_0x27162e,_0x33e016,_0x16388b){var _0x50c446={};var _0x2b1795={};var _0x5ef162;var _0x212766;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x27162e[_0x467b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x33e016,null))[_0x467b('0x2b')](function(_0x1e291d){if(_0x1e291d){_0x5ef162=_0x1e291d;_0x2b1795['model']=_[_0x467b('0x38')](db['SugarcrmField'][_0x467b('0x32')]);_0x2b1795[_0x467b('0x37')]=_['keys'](_0x27162e[_0x467b('0x37')]);_0x2b1795[_0x467b('0x39')]=_['intersection'](_0x2b1795[_0x467b('0x36')],_0x2b1795[_0x467b('0x37')]);_0x50c446[_0x467b('0x3a')]=_['intersection'](_0x2b1795['model'],qs[_0x467b('0x3c')](_0x27162e[_0x467b('0x37')][_0x467b('0x3c')]));_0x50c446['attributes']=_0x50c446[_0x467b('0x3a')]['length']?_0x50c446['attributes']:_0x2b1795['model'];_0x50c446['order']=qs[_0x467b('0x40')](_0x27162e[_0x467b('0x37')][_0x467b('0x40')]);_0x50c446[_0x467b('0x43')]=qs['filters'](_[_0x467b('0x41')](_0x27162e[_0x467b('0x37')],_0x2b1795[_0x467b('0x39')]));if(_0x27162e['query']['filter']){_0x50c446['where']=_[_0x467b('0x44')](_0x50c446['where'],{'$or':_[_0x467b('0x31')](_0x50c446[_0x467b('0x3a')],function(_0x111311){var _0x37308a={};_0x37308a[_0x111311]={'$like':'%'+_0x27162e[_0x467b('0x37')][_0x467b('0x42')]+'%'};return _0x37308a;})});}_0x50c446=_[_0x467b('0x44')]({},_0x50c446,_0x27162e[_0x467b('0x45')]);return _0x5ef162[_0x467b('0x50')](_0x50c446);}})[_0x467b('0x2b')](function(_0x2d6780){if(_0x2d6780){_0x212766=_0x2d6780[_0x467b('0x3d')];if(!_0x27162e[_0x467b('0x37')][_0x467b('0x3e')](_0x467b('0x51'))){_0x50c446[_0x467b('0x24')]=qs[_0x467b('0x24')](_0x27162e[_0x467b('0x37')][_0x467b('0x24')]);_0x50c446['offset']=qs[_0x467b('0x21')](_0x27162e[_0x467b('0x37')]['offset']);}return _0x5ef162[_0x467b('0x50')](_0x50c446);}})['then'](function(_0xb2376e){if(_0xb2376e){return _0xb2376e?{'count':_0x212766,'rows':_0xb2376e}:null;}})[_0x467b('0x2b')](respondWithResult(_0x33e016,null))['catch'](handleError(_0x33e016,null));};exports['getSubjects']=function(_0x562dc9,_0x2fa363,_0x3ae434){var _0x7f775b={};var _0x5a1825={};var _0x5f2e68;var _0x15f80d;return db[_0x467b('0x47')][_0x467b('0x52')]({'where':{'id':_0x562dc9[_0x467b('0x4f')]['id']}})[_0x467b('0x2b')](handleEntityNotFound(_0x2fa363,null))[_0x467b('0x2b')](function(_0x4ad0bf){if(_0x4ad0bf){_0x5f2e68=_0x4ad0bf;_0x5a1825[_0x467b('0x36')]=_[_0x467b('0x38')](db[_0x467b('0x53')]['rawAttributes']);_0x5a1825[_0x467b('0x37')]=_['keys'](_0x562dc9[_0x467b('0x37')]);_0x5a1825[_0x467b('0x39')]=_[_0x467b('0x3b')](_0x5a1825[_0x467b('0x36')],_0x5a1825[_0x467b('0x37')]);_0x7f775b[_0x467b('0x3a')]=_[_0x467b('0x3b')](_0x5a1825[_0x467b('0x36')],qs[_0x467b('0x3c')](_0x562dc9[_0x467b('0x37')][_0x467b('0x3c')]));_0x7f775b[_0x467b('0x3a')]=_0x7f775b[_0x467b('0x3a')]['length']?_0x7f775b[_0x467b('0x3a')]:_0x5a1825[_0x467b('0x36')];_0x7f775b[_0x467b('0x3f')]=qs[_0x467b('0x40')](_0x562dc9[_0x467b('0x37')][_0x467b('0x40')]);_0x7f775b['where']=qs['filters'](_['pick'](_0x562dc9['query'],_0x5a1825['filters']));if(_0x562dc9[_0x467b('0x37')][_0x467b('0x42')]){_0x7f775b['where']=_[_0x467b('0x44')](_0x7f775b[_0x467b('0x43')],{'$or':_[_0x467b('0x31')](_0x7f775b[_0x467b('0x3a')],function(_0x4d0cf9){var _0x3370cc={};_0x3370cc[_0x4d0cf9]={'$like':'%'+_0x562dc9[_0x467b('0x37')][_0x467b('0x42')]+'%'};return _0x3370cc;})});}_0x7f775b=_['merge']({},_0x7f775b,_0x562dc9[_0x467b('0x45')]);return _0x5f2e68[_0x467b('0x54')](_0x7f775b);}})['then'](function(_0x337af7){if(_0x337af7){_0x15f80d=_0x337af7[_0x467b('0x3d')];if(!_0x562dc9[_0x467b('0x37')]['hasOwnProperty']('nolimit')){_0x7f775b[_0x467b('0x24')]=qs[_0x467b('0x24')](_0x562dc9['query'][_0x467b('0x24')]);_0x7f775b['offset']=qs[_0x467b('0x21')](_0x562dc9['query']['offset']);}return _0x5f2e68['getSubjects'](_0x7f775b);}})['then'](function(_0xc9385c){if(_0xc9385c){return _0xc9385c?{'count':_0x15f80d,'rows':_0xc9385c}:null;}})[_0x467b('0x2b')](respondWithResult(_0x2fa363,null))[_0x467b('0x49')](handleError(_0x2fa363,null));};exports['getDescriptions']=function(_0x3ac65d,_0x36fe31,_0x7fcc1){var _0x469081={};var _0x4939e6={};var _0xbf213a;var _0x2292f3;return db[_0x467b('0x47')][_0x467b('0x52')]({'where':{'id':_0x3ac65d[_0x467b('0x4f')]['id']}})[_0x467b('0x2b')](handleEntityNotFound(_0x36fe31,null))[_0x467b('0x2b')](function(_0x5da0fb){if(_0x5da0fb){_0xbf213a=_0x5da0fb;_0x4939e6[_0x467b('0x36')]=_[_0x467b('0x38')](db['SugarcrmField'][_0x467b('0x32')]);_0x4939e6[_0x467b('0x37')]=_['keys'](_0x3ac65d['query']);_0x4939e6[_0x467b('0x39')]=_['intersection'](_0x4939e6[_0x467b('0x36')],_0x4939e6[_0x467b('0x37')]);_0x469081['attributes']=_[_0x467b('0x3b')](_0x4939e6[_0x467b('0x36')],qs[_0x467b('0x3c')](_0x3ac65d[_0x467b('0x37')]['fields']));_0x469081['attributes']=_0x469081[_0x467b('0x3a')]['length']?_0x469081[_0x467b('0x3a')]:_0x4939e6['model'];_0x469081[_0x467b('0x3f')]=qs['sort'](_0x3ac65d[_0x467b('0x37')]['sort']);_0x469081[_0x467b('0x43')]=qs[_0x467b('0x39')](_[_0x467b('0x41')](_0x3ac65d[_0x467b('0x37')],_0x4939e6[_0x467b('0x39')]));if(_0x3ac65d['query']['filter']){_0x469081[_0x467b('0x43')]=_['merge'](_0x469081[_0x467b('0x43')],{'$or':_[_0x467b('0x31')](_0x469081[_0x467b('0x3a')],function(_0x5bf1d6){var _0x5cb6c2={};_0x5cb6c2[_0x5bf1d6]={'$like':'%'+_0x3ac65d['query'][_0x467b('0x42')]+'%'};return _0x5cb6c2;})});}_0x469081=_[_0x467b('0x44')]({},_0x469081,_0x3ac65d[_0x467b('0x45')]);return _0xbf213a[_0x467b('0x55')](_0x469081);}})[_0x467b('0x2b')](function(_0x316f8f){if(_0x316f8f){_0x2292f3=_0x316f8f['length'];if(!_0x3ac65d[_0x467b('0x37')][_0x467b('0x3e')]('nolimit')){_0x469081[_0x467b('0x24')]=qs[_0x467b('0x24')](_0x3ac65d['query'][_0x467b('0x24')]);_0x469081['offset']=qs[_0x467b('0x21')](_0x3ac65d[_0x467b('0x37')][_0x467b('0x21')]);}return _0xbf213a[_0x467b('0x55')](_0x469081);}})[_0x467b('0x2b')](function(_0x5ec41f){if(_0x5ec41f){return _0x5ec41f?{'count':_0x2292f3,'rows':_0x5ec41f}:null;}})['then'](respondWithResult(_0x36fe31,null))[_0x467b('0x49')](handleError(_0x36fe31,null));};
\ No newline at end of file
index 0ed2431..6d29863 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ec4=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x1ec4,0x1c1));var _0x41ec=function(_0x2ca73e,_0x442291){_0x2ca73e=_0x2ca73e-0x0;var _0x247495=_0x1ec4[_0x2ca73e];return _0x247495;};'use strict';var _=require(_0x41ec('0x0'));var util=require(_0x41ec('0x1'));var logger=require(_0x41ec('0x2'))(_0x41ec('0x3'));var moment=require(_0x41ec('0x4'));var BPromise=require(_0x41ec('0x5'));var rp=require(_0x41ec('0x6'));var fs=require('fs');var path=require(_0x41ec('0x7'));var rimraf=require(_0x41ec('0x8'));var config=require('../../config/environment');var attributes=require('./intSugarcrmConfiguration.attributes');module['exports']=function(_0xed9f8f,_0x547e94){return _0xed9f8f['define'](_0x41ec('0x9'),attributes,{'tableName':_0x41ec('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1c9e=['SugarcrmConfiguration','lodash','../../config/logger','bluebird','request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes'];(function(_0x1da36c,_0x56071c){var _0x55d957=function(_0xd1fcf5){while(--_0xd1fcf5){_0x1da36c['push'](_0x1da36c['shift']());}};_0x55d957(++_0x56071c);}(_0x1c9e,0x1d9));var _0xe1c9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1c9e[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xe1c9('0x0'));var util=require('util');var logger=require(_0xe1c9('0x1'))('api');var moment=require('moment');var BPromise=require(_0xe1c9('0x2'));var rp=require(_0xe1c9('0x3'));var fs=require('fs');var path=require(_0xe1c9('0x4'));var rimraf=require('rimraf');var config=require(_0xe1c9('0x5'));var attributes=require(_0xe1c9('0x6'));module['exports']=function(_0x376b07,_0x17cfd6){return _0x376b07['define'](_0xe1c9('0x7'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 62479ef..d55d8d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3bc=['client','http','request','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x231b09,_0x4342ab){var _0x407bb6=function(_0x4744f7){while(--_0x4744f7){_0x231b09['push'](_0x231b09['shift']());}};_0x407bb6(++_0x4342ab);}(_0xf3bc,0x91));var _0xcf3b=function(_0x1a4958,_0x36090e){_0x1a4958=_0x1a4958-0x0;var _0x1b9e68=_0xf3bc[_0x1a4958];return _0x1b9e68;};'use strict';var _=require(_0xcf3b('0x0'));var util=require(_0xcf3b('0x1'));var moment=require(_0xcf3b('0x2'));var BPromise=require(_0xcf3b('0x3'));var rs=require(_0xcf3b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcf3b('0x5'));var logger=require(_0xcf3b('0x6'))(_0xcf3b('0x7'));var config=require('../../config/environment');var jayson=require(_0xcf3b('0x8'));var client=jayson[_0xcf3b('0x9')][_0xcf3b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f3d11,_0x1fdb0c,_0x5ae4b4){return new BPromise(function(_0x570706,_0x275144){return client[_0xcf3b('0xb')](_0x4f3d11,_0x5ae4b4)['then'](function(_0x45ac79){logger[_0xcf3b('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1fdb0c,_0xcf3b('0xd'));logger[_0xcf3b('0xe')](_0xcf3b('0xf'),_0x1fdb0c,_0xcf3b('0xd'),JSON[_0xcf3b('0x10')](_0x45ac79));if(_0x45ac79[_0xcf3b('0x11')]){if(_0x45ac79[_0xcf3b('0x11')][_0xcf3b('0x12')]===0x1f4){logger[_0xcf3b('0x11')](_0xcf3b('0x13'),_0x1fdb0c,_0x45ac79['error'][_0xcf3b('0x14')]);return _0x275144(_0x45ac79[_0xcf3b('0x11')][_0xcf3b('0x14')]);}logger[_0xcf3b('0x11')](_0xcf3b('0x13'),_0x1fdb0c,_0x45ac79['error'][_0xcf3b('0x14')]);return _0x570706(_0x45ac79[_0xcf3b('0x11')][_0xcf3b('0x14')]);}else{logger[_0xcf3b('0xc')](_0xcf3b('0x13'),_0x1fdb0c,_0xcf3b('0xd'));_0x570706(_0x45ac79['result'][_0xcf3b('0x14')]);}})[_0xcf3b('0x15')](function(_0x38c38b){logger[_0xcf3b('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1fdb0c,_0x38c38b);_0x275144(_0x38c38b);});});}
\ No newline at end of file
+var _0xe43a=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x13a945,_0x125536){var _0x411db6=function(_0x4a38b2){while(--_0x4a38b2){_0x13a945['push'](_0x13a945['shift']());}};_0x411db6(++_0x125536);}(_0xe43a,0xba));var _0xae43=function(_0x469940,_0x4ed1e8){_0x469940=_0x469940-0x0;var _0x216421=_0xe43a[_0x469940];return _0x216421;};'use strict';var _=require(_0xae43('0x0'));var util=require(_0xae43('0x1'));var moment=require(_0xae43('0x2'));var BPromise=require(_0xae43('0x3'));var rs=require(_0xae43('0x4'));var fs=require('fs');var Redis=require(_0xae43('0x5'));var db=require(_0xae43('0x6'))['db'];var utils=require(_0xae43('0x7'));var logger=require(_0xae43('0x8'))(_0xae43('0x9'));var config=require(_0xae43('0xa'));var jayson=require(_0xae43('0xb'));var client=jayson[_0xae43('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ad6b2,_0x23d47b,_0x223d9c){return new BPromise(function(_0xb85807,_0x26c6ed){return client[_0xae43('0xd')](_0x2ad6b2,_0x223d9c)[_0xae43('0xe')](function(_0x286f68){logger[_0xae43('0xf')](_0xae43('0x10'),_0x23d47b,_0xae43('0x11'));logger[_0xae43('0x12')](_0xae43('0x13'),_0x23d47b,_0xae43('0x11'),JSON['stringify'](_0x286f68));if(_0x286f68['error']){if(_0x286f68[_0xae43('0x14')]['code']===0x1f4){logger[_0xae43('0x14')](_0xae43('0x10'),_0x23d47b,_0x286f68['error'][_0xae43('0x15')]);return _0x26c6ed(_0x286f68['error'][_0xae43('0x15')]);}logger['error'](_0xae43('0x10'),_0x23d47b,_0x286f68[_0xae43('0x14')][_0xae43('0x15')]);return _0xb85807(_0x286f68[_0xae43('0x14')]['message']);}else{logger[_0xae43('0xf')](_0xae43('0x10'),_0x23d47b,_0xae43('0x11'));_0xb85807(_0x286f68[_0xae43('0x16')][_0xae43('0x15')]);}})['catch'](function(_0x3f694b){logger[_0xae43('0x14')](_0xae43('0x10'),_0x23d47b,_0x3f694b);_0x26c6ed(_0x3f694b);});});}
\ No newline at end of file
index f51922e..bbb07bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d5d=['update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intSugarcrmField.controller','isAuthenticated','get','/:id','post','create','put'];(function(_0x5e60f4,_0x5d2465){var _0x1d664b=function(_0x43eb52){while(--_0x43eb52){_0x5e60f4['push'](_0x5e60f4['shift']());}};_0x1d664b(++_0x5d2465);}(_0x0d5d,0x125));var _0xd0d5=function(_0x48bdf2,_0x1fc99b){_0x48bdf2=_0x48bdf2-0x0;var _0x2c9822=_0x0d5d[_0x48bdf2];return _0x2c9822;};'use strict';var multer=require('multer');var util=require(_0xd0d5('0x0'));var path=require('path');var timeout=require(_0xd0d5('0x1'));var express=require(_0xd0d5('0x2'));var router=express[_0xd0d5('0x3')]();var fs_extra=require(_0xd0d5('0x4'));var auth=require(_0xd0d5('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd0d5('0x6'));router['get']('/',auth[_0xd0d5('0x7')](),controller['index']);router[_0xd0d5('0x8')](_0xd0d5('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xd0d5('0xa')]('/',auth[_0xd0d5('0x7')](),controller[_0xd0d5('0xb')]);router[_0xd0d5('0xc')](_0xd0d5('0x9'),auth[_0xd0d5('0x7')](),controller[_0xd0d5('0xd')]);router[_0xd0d5('0xe')]('/:id',auth[_0xd0d5('0x7')](),controller[_0xd0d5('0xf')]);module[_0xd0d5('0x10')]=router;
\ No newline at end of file
+var _0x1985=['./intSugarcrmField.controller','isAuthenticated','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x22a6f6,_0x5d6ea9){var _0x464440=function(_0x147c88){while(--_0x147c88){_0x22a6f6['push'](_0x22a6f6['shift']());}};_0x464440(++_0x5d6ea9);}(_0x1985,0x147));var _0x5198=function(_0x39ea02,_0x5c3284){_0x39ea02=_0x39ea02-0x0;var _0x2218fb=_0x1985[_0x39ea02];return _0x2218fb;};'use strict';var multer=require(_0x5198('0x0'));var util=require(_0x5198('0x1'));var path=require(_0x5198('0x2'));var timeout=require(_0x5198('0x3'));var express=require(_0x5198('0x4'));var router=express[_0x5198('0x5')]();var fs_extra=require(_0x5198('0x6'));var auth=require(_0x5198('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5198('0x8'));var controller=require(_0x5198('0x9'));router['get']('/',auth[_0x5198('0xa')](),controller['index']);router[_0x5198('0xb')](_0x5198('0xc'),auth[_0x5198('0xa')](),controller[_0x5198('0xd')]);router[_0x5198('0xe')]('/',auth[_0x5198('0xa')](),controller[_0x5198('0xf')]);router[_0x5198('0x10')](_0x5198('0xc'),auth[_0x5198('0xa')](),controller[_0x5198('0x11')]);router[_0x5198('0x12')](_0x5198('0xc'),auth[_0x5198('0xa')](),controller[_0x5198('0x13')]);module[_0x5198('0x14')]=router;
\ No newline at end of file
index e2457db..f54a33b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa633=['BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x99a431,_0x2acee7){var _0x3b9522=function(_0x2b05ea){while(--_0x2b05ea){_0x99a431['push'](_0x99a431['shift']());}};_0x3b9522(++_0x2acee7);}(_0xa633,0x18d));var _0x3a63=function(_0x50e520,_0x9f42d3){_0x50e520=_0x50e520-0x0;var _0x46b7a1=_0xa633[_0x50e520];return _0x46b7a1;};'use strict';var Sequelize=require('sequelize');module[_0x3a63('0x0')]={'type':{'type':Sequelize[_0x3a63('0x1')](_0x3a63('0x2'),_0x3a63('0x3'),_0x3a63('0x4'),_0x3a63('0x5'),_0x3a63('0x6')),'defaultValue':_0x3a63('0x2')},'content':{'type':Sequelize[_0x3a63('0x7')]},'key':{'type':Sequelize[_0x3a63('0x7')]},'keyType':{'type':Sequelize[_0x3a63('0x1')](_0x3a63('0x2'),_0x3a63('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x3a63('0x7')]},'idField':{'type':Sequelize[_0x3a63('0x7')]},'nameField':{'type':Sequelize[_0x3a63('0x7')]},'customField':{'type':Sequelize[_0x3a63('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3a63('0x7')]}};
\ No newline at end of file
+var _0xe132=['customVariable','keyValue','picklist','string','STRING','ENUM','variable','BOOLEAN','sequelize','exports'];(function(_0x582ce7,_0x4427ab){var _0x12ce62=function(_0x2750ef){while(--_0x2750ef){_0x582ce7['push'](_0x582ce7['shift']());}};_0x12ce62(++_0x4427ab);}(_0xe132,0x184));var _0x2e13=function(_0x1dd468,_0x2dbbaf){_0x1dd468=_0x1dd468-0x0;var _0x3bce5f=_0xe132[_0x1dd468];return _0x3bce5f;};'use strict';var Sequelize=require(_0x2e13('0x0'));module[_0x2e13('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x2e13('0x2'),_0x2e13('0x3'),_0x2e13('0x4')),'defaultValue':_0x2e13('0x5')},'content':{'type':Sequelize[_0x2e13('0x6')]},'key':{'type':Sequelize[_0x2e13('0x6')]},'keyType':{'type':Sequelize[_0x2e13('0x7')](_0x2e13('0x5'),_0x2e13('0x8'),'customVariable')},'keyContent':{'type':Sequelize[_0x2e13('0x6')]},'idField':{'type':Sequelize[_0x2e13('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x2e13('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2e13('0x6')]}};
\ No newline at end of file
index df71e38..b661c52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30d9=['desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','undefined','count','offset','limit','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','find','create','body','rimraf','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x1f5c02,_0x1ca255){var _0x5beee3=function(_0x330a26){while(--_0x330a26){_0x1f5c02['push'](_0x1f5c02['shift']());}};_0x5beee3(++_0x1ca255);}(_0x30d9,0x10c));var _0x930d=function(_0x54c42f,_0x5a341f){_0x54c42f=_0x54c42f-0x0;var _0x574932=_0x30d9[_0x54c42f];return _0x574932;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x930d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x930d('0x1'));var moment=require(_0x930d('0x2'));var BPromise=require(_0x930d('0x3'));var Mustache=require(_0x930d('0x4'));var util=require(_0x930d('0x5'));var path=require(_0x930d('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x930d('0x7'));var fs=require('fs');var fs_extra=require(_0x930d('0x8'));var _=require(_0x930d('0x9'));var squel=require(_0x930d('0xa'));var crypto=require('crypto');var jsforce=require(_0x930d('0xb'));var deskjs=require(_0x930d('0xc'));var toCsv=require(_0x930d('0xd'));var querystring=require('querystring');var Papa=require(_0x930d('0xe'));var Redis=require(_0x930d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x930d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x930d('0x11'));var logger=require(_0x930d('0x12'))(_0x930d('0x13'));var utils=require(_0x930d('0x14'));var config=require(_0x930d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x930d('0x16'))['db'];function respondWithStatusCode(_0x283ff6,_0x4db5ad){_0x4db5ad=_0x4db5ad||0xcc;return function(_0x3b4cd4){if(_0x3b4cd4){return _0x283ff6['sendStatus'](_0x4db5ad);}return _0x283ff6['status'](_0x4db5ad)[_0x930d('0x17')]();};}function respondWithResult(_0x3d1bf2,_0x1f203a){_0x1f203a=_0x1f203a||0xc8;return function(_0x2cd558){if(_0x2cd558){return _0x3d1bf2[_0x930d('0x18')](_0x1f203a)['json'](_0x2cd558);}};}function respondWithFilteredResult(_0x555595,_0x105cc4){return function(_0x47556c){if(_0x47556c){var _0x49e7c7=typeof _0x105cc4['offset']===_0x930d('0x19')&&typeof _0x105cc4['limit']===_0x930d('0x19');var _0x17f680=_0x47556c[_0x930d('0x1a')];var _0x3ab253=_0x49e7c7?0x0:_0x105cc4[_0x930d('0x1b')];var _0x11a6ab=_0x49e7c7?_0x47556c[_0x930d('0x1a')]:_0x105cc4['offset']+_0x105cc4[_0x930d('0x1c')];var _0x475865;if(_0x11a6ab>=_0x17f680){_0x11a6ab=_0x17f680;_0x475865=0xc8;}else{_0x475865=0xce;}_0x555595[_0x930d('0x18')](_0x475865);return _0x555595['set']('Content-Range',_0x3ab253+'-'+_0x11a6ab+'/'+_0x17f680)[_0x930d('0x1d')](_0x47556c);}return null;};}function patchUpdates(_0x3ca32f){return function(_0x3ba747){try{jsonpatch[_0x930d('0x1e')](_0x3ba747,_0x3ca32f,!![]);}catch(_0x11603c){return BPromise[_0x930d('0x1f')](_0x11603c);}return _0x3ba747[_0x930d('0x20')]();};}function saveUpdates(_0x543cd9,_0x2bc018){return function(_0x259933){if(_0x259933){return _0x259933[_0x930d('0x21')](_0x543cd9)[_0x930d('0x22')](function(_0xdabc29){return _0xdabc29;});}return null;};}function removeEntity(_0x1c4240,_0x5c8e8d){return function(_0x11ac91){if(_0x11ac91){return _0x11ac91[_0x930d('0x23')]()[_0x930d('0x22')](function(){_0x1c4240['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a022a,_0x631842){return function(_0x20697d){if(!_0x20697d){_0x5a022a['sendStatus'](0x194);}return _0x20697d;};}function handleError(_0x209860,_0x2a9b8e){_0x2a9b8e=_0x2a9b8e||0x1f4;return function(_0x5b7693){logger[_0x930d('0x24')](_0x5b7693[_0x930d('0x25')]);if(_0x5b7693[_0x930d('0x26')]){delete _0x5b7693[_0x930d('0x26')];}_0x209860[_0x930d('0x18')](_0x2a9b8e)[_0x930d('0x27')](_0x5b7693);};}exports[_0x930d('0x28')]=function(_0x10531f,_0x21c79c){var _0x5759a9={},_0x563aa7={},_0xdfff73={'count':0x0,'rows':[]};var _0x1e354b=_[_0x930d('0x29')](db[_0x930d('0x2a')][_0x930d('0x2b')],function(_0x22fe95){return{'name':_0x22fe95[_0x930d('0x2c')],'type':_0x22fe95[_0x930d('0x2d')][_0x930d('0x2e')]};});_0x563aa7[_0x930d('0x2f')]=_[_0x930d('0x29')](_0x1e354b,_0x930d('0x26'));_0x563aa7[_0x930d('0x30')]=_[_0x930d('0x31')](_0x10531f['query']);_0x563aa7[_0x930d('0x32')]=_[_0x930d('0x33')](_0x563aa7[_0x930d('0x2f')],_0x563aa7[_0x930d('0x30')]);_0x5759a9[_0x930d('0x34')]=_[_0x930d('0x33')](_0x563aa7[_0x930d('0x2f')],qs['fields'](_0x10531f['query'][_0x930d('0x35')]));_0x5759a9['attributes']=_0x5759a9[_0x930d('0x34')][_0x930d('0x36')]?_0x5759a9[_0x930d('0x34')]:_0x563aa7['model'];if(!_0x10531f[_0x930d('0x30')]['hasOwnProperty']('nolimit')){_0x5759a9[_0x930d('0x1c')]=qs['limit'](_0x10531f['query']['limit']);_0x5759a9[_0x930d('0x1b')]=qs['offset'](_0x10531f[_0x930d('0x30')][_0x930d('0x1b')]);}_0x5759a9['order']=qs[_0x930d('0x37')](_0x10531f[_0x930d('0x30')]['sort']);_0x5759a9[_0x930d('0x38')]=qs['filters'](_[_0x930d('0x39')](_0x10531f[_0x930d('0x30')],_0x563aa7[_0x930d('0x32')]),_0x1e354b);if(_0x10531f[_0x930d('0x30')][_0x930d('0x3a')]){_0x5759a9[_0x930d('0x38')]=_[_0x930d('0x3b')](_0x5759a9[_0x930d('0x38')],{'$or':_['map'](_0x1e354b,function(_0x278cf5){if(_0x278cf5[_0x930d('0x2d')]!==_0x930d('0x3c')){var _0x2632ad={};_0x2632ad[_0x278cf5[_0x930d('0x26')]]={'$like':'%'+_0x10531f[_0x930d('0x30')]['filter']+'%'};return _0x2632ad;}})});}_0x5759a9=_[_0x930d('0x3b')]({},_0x5759a9,_0x10531f[_0x930d('0x3d')]);var _0x4e142a={'where':_0x5759a9[_0x930d('0x38')]};return db[_0x930d('0x2a')][_0x930d('0x1a')](_0x4e142a)['then'](function(_0x28645){_0xdfff73[_0x930d('0x1a')]=_0x28645;if(_0x10531f[_0x930d('0x30')][_0x930d('0x3e')]){_0x5759a9['include']=[{'all':!![]}];}return db[_0x930d('0x2a')][_0x930d('0x3f')](_0x5759a9);})['then'](function(_0x373059){_0xdfff73[_0x930d('0x40')]=_0x373059;return _0xdfff73;})['then'](respondWithFilteredResult(_0x21c79c,_0x5759a9))[_0x930d('0x41')](handleError(_0x21c79c,null));};exports['show']=function(_0x398ca0,_0x2d70e0){var _0x4d954f={'raw':!![],'where':{'id':_0x398ca0[_0x930d('0x42')]['id']}},_0x15f9ad={};_0x15f9ad[_0x930d('0x2f')]=_['keys'](db['SugarcrmField']['rawAttributes']);_0x15f9ad[_0x930d('0x30')]=_['keys'](_0x398ca0[_0x930d('0x30')]);_0x15f9ad['filters']=_[_0x930d('0x33')](_0x15f9ad[_0x930d('0x2f')],_0x15f9ad[_0x930d('0x30')]);_0x4d954f[_0x930d('0x34')]=_[_0x930d('0x33')](_0x15f9ad[_0x930d('0x2f')],qs[_0x930d('0x35')](_0x398ca0['query'][_0x930d('0x35')]));_0x4d954f[_0x930d('0x34')]=_0x4d954f['attributes']['length']?_0x4d954f[_0x930d('0x34')]:_0x15f9ad[_0x930d('0x2f')];if(_0x398ca0[_0x930d('0x30')]['includeAll']){_0x4d954f['include']=[{'all':!![]}];}_0x4d954f=_[_0x930d('0x3b')]({},_0x4d954f,_0x398ca0[_0x930d('0x3d')]);return db[_0x930d('0x2a')][_0x930d('0x43')](_0x4d954f)[_0x930d('0x22')](handleEntityNotFound(_0x2d70e0,null))[_0x930d('0x22')](respondWithResult(_0x2d70e0,null))[_0x930d('0x41')](handleError(_0x2d70e0,null));};exports[_0x930d('0x44')]=function(_0x9a213c,_0x493285){return db[_0x930d('0x2a')][_0x930d('0x44')](_0x9a213c[_0x930d('0x45')],{})[_0x930d('0x22')](respondWithResult(_0x493285,0xc9))[_0x930d('0x41')](handleError(_0x493285,null));};exports[_0x930d('0x21')]=function(_0x2853d9,_0x5c1f7a){if(_0x2853d9[_0x930d('0x45')]['id']){delete _0x2853d9['body']['id'];}return db[_0x930d('0x2a')][_0x930d('0x43')]({'where':{'id':_0x2853d9[_0x930d('0x42')]['id']}})[_0x930d('0x22')](handleEntityNotFound(_0x5c1f7a,null))[_0x930d('0x22')](saveUpdates(_0x2853d9[_0x930d('0x45')],null))[_0x930d('0x22')](respondWithResult(_0x5c1f7a,null))[_0x930d('0x41')](handleError(_0x5c1f7a,null));};exports[_0x930d('0x23')]=function(_0x11d648,_0x122b72){return db['SugarcrmField']['find']({'where':{'id':_0x11d648[_0x930d('0x42')]['id']}})['then'](handleEntityNotFound(_0x122b72,null))['then'](removeEntity(_0x122b72,null))[_0x930d('0x41')](handleError(_0x122b72,null));};
\ No newline at end of file
+var _0x3545=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','SugarcrmField','find','create','body','rimraf','zip-dir','request-promise','mustache','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'];(function(_0x418117,_0x5de9f2){var _0x2c4e0b=function(_0x941e07){while(--_0x941e07){_0x418117['push'](_0x418117['shift']());}};_0x2c4e0b(++_0x5de9f2);}(_0x3545,0x16a));var _0x5354=function(_0x12ef39,_0x18d320){_0x12ef39=_0x12ef39-0x0;var _0x47a734=_0x3545[_0x12ef39];return _0x47a734;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5354('0x0'));var zipdir=require(_0x5354('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5354('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5354('0x3'));var util=require(_0x5354('0x4'));var path=require(_0x5354('0x5'));var sox=require(_0x5354('0x6'));var csv=require(_0x5354('0x7'));var ejs=require(_0x5354('0x8'));var fs=require('fs');var fs_extra=require(_0x5354('0x9'));var _=require(_0x5354('0xa'));var squel=require(_0x5354('0xb'));var crypto=require(_0x5354('0xc'));var jsforce=require(_0x5354('0xd'));var deskjs=require(_0x5354('0xe'));var toCsv=require(_0x5354('0x7'));var querystring=require(_0x5354('0xf'));var Papa=require(_0x5354('0x10'));var Redis=require(_0x5354('0x11'));var authService=require(_0x5354('0x12'));var qs=require(_0x5354('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5354('0x14'));var logger=require(_0x5354('0x15'))(_0x5354('0x16'));var utils=require(_0x5354('0x17'));var config=require(_0x5354('0x18'));var licenseUtil=require(_0x5354('0x19'));var db=require(_0x5354('0x1a'))['db'];function respondWithStatusCode(_0xccbc2b,_0xe78bc6){_0xe78bc6=_0xe78bc6||0xcc;return function(_0x4eca59){if(_0x4eca59){return _0xccbc2b[_0x5354('0x1b')](_0xe78bc6);}return _0xccbc2b[_0x5354('0x1c')](_0xe78bc6)[_0x5354('0x1d')]();};}function respondWithResult(_0x8b5228,_0x3c2c91){_0x3c2c91=_0x3c2c91||0xc8;return function(_0x370190){if(_0x370190){return _0x8b5228[_0x5354('0x1c')](_0x3c2c91)[_0x5354('0x1e')](_0x370190);}};}function respondWithFilteredResult(_0x5da213,_0x4d52d7){return function(_0x409f2f){if(_0x409f2f){var _0x4e7e8e=typeof _0x4d52d7[_0x5354('0x1f')]===_0x5354('0x20')&&typeof _0x4d52d7[_0x5354('0x21')]===_0x5354('0x20');var _0x7246e=_0x409f2f['count'];var _0xc8dd=_0x4e7e8e?0x0:_0x4d52d7[_0x5354('0x1f')];var _0x28fb29=_0x4e7e8e?_0x409f2f[_0x5354('0x22')]:_0x4d52d7['offset']+_0x4d52d7[_0x5354('0x21')];var _0x1946e7;if(_0x28fb29>=_0x7246e){_0x28fb29=_0x7246e;_0x1946e7=0xc8;}else{_0x1946e7=0xce;}_0x5da213[_0x5354('0x1c')](_0x1946e7);return _0x5da213[_0x5354('0x23')](_0x5354('0x24'),_0xc8dd+'-'+_0x28fb29+'/'+_0x7246e)['json'](_0x409f2f);}return null;};}function patchUpdates(_0x3cda5c){return function(_0xacbfd2){try{jsonpatch[_0x5354('0x25')](_0xacbfd2,_0x3cda5c,!![]);}catch(_0x5571ec){return BPromise[_0x5354('0x26')](_0x5571ec);}return _0xacbfd2['save']();};}function saveUpdates(_0x269f7d,_0x83c9c){return function(_0x3aa9d2){if(_0x3aa9d2){return _0x3aa9d2[_0x5354('0x27')](_0x269f7d)[_0x5354('0x28')](function(_0x51c0bd){return _0x51c0bd;});}return null;};}function removeEntity(_0x158110,_0x405750){return function(_0x497af2){if(_0x497af2){return _0x497af2[_0x5354('0x29')]()[_0x5354('0x28')](function(){_0x158110[_0x5354('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1559aa,_0x1d3d84){return function(_0x1eb589){if(!_0x1eb589){_0x1559aa[_0x5354('0x1b')](0x194);}return _0x1eb589;};}function handleError(_0x5aea62,_0x3913d4){_0x3913d4=_0x3913d4||0x1f4;return function(_0x442674){logger[_0x5354('0x2a')](_0x442674['stack']);if(_0x442674[_0x5354('0x2b')]){delete _0x442674[_0x5354('0x2b')];}_0x5aea62[_0x5354('0x1c')](_0x3913d4)[_0x5354('0x2c')](_0x442674);};}exports[_0x5354('0x2d')]=function(_0x28f480,_0x222324){var _0x399a5d={},_0x68698b={},_0xc3a335={'count':0x0,'rows':[]};var _0x5ca549=_[_0x5354('0x2e')](db['SugarcrmField'][_0x5354('0x2f')],function(_0x11e04d){return{'name':_0x11e04d[_0x5354('0x30')],'type':_0x11e04d['type'][_0x5354('0x31')]};});_0x68698b[_0x5354('0x32')]=_['map'](_0x5ca549,_0x5354('0x2b'));_0x68698b[_0x5354('0x33')]=_[_0x5354('0x34')](_0x28f480[_0x5354('0x33')]);_0x68698b[_0x5354('0x35')]=_[_0x5354('0x36')](_0x68698b[_0x5354('0x32')],_0x68698b[_0x5354('0x33')]);_0x399a5d[_0x5354('0x37')]=_[_0x5354('0x36')](_0x68698b[_0x5354('0x32')],qs[_0x5354('0x38')](_0x28f480['query'][_0x5354('0x38')]));_0x399a5d[_0x5354('0x37')]=_0x399a5d[_0x5354('0x37')][_0x5354('0x39')]?_0x399a5d[_0x5354('0x37')]:_0x68698b[_0x5354('0x32')];if(!_0x28f480[_0x5354('0x33')][_0x5354('0x3a')]('nolimit')){_0x399a5d[_0x5354('0x21')]=qs['limit'](_0x28f480[_0x5354('0x33')]['limit']);_0x399a5d[_0x5354('0x1f')]=qs['offset'](_0x28f480['query']['offset']);}_0x399a5d[_0x5354('0x3b')]=qs['sort'](_0x28f480[_0x5354('0x33')]['sort']);_0x399a5d[_0x5354('0x3c')]=qs[_0x5354('0x35')](_['pick'](_0x28f480[_0x5354('0x33')],_0x68698b[_0x5354('0x35')]),_0x5ca549);if(_0x28f480['query'][_0x5354('0x3d')]){_0x399a5d[_0x5354('0x3c')]=_[_0x5354('0x3e')](_0x399a5d['where'],{'$or':_[_0x5354('0x2e')](_0x5ca549,function(_0x43c7db){if(_0x43c7db[_0x5354('0x3f')]!==_0x5354('0x40')){var _0x41616b={};_0x41616b[_0x43c7db[_0x5354('0x2b')]]={'$like':'%'+_0x28f480['query'][_0x5354('0x3d')]+'%'};return _0x41616b;}})});}_0x399a5d=_[_0x5354('0x3e')]({},_0x399a5d,_0x28f480[_0x5354('0x41')]);var _0x2a84d5={'where':_0x399a5d[_0x5354('0x3c')]};return db['SugarcrmField'][_0x5354('0x22')](_0x2a84d5)[_0x5354('0x28')](function(_0x4d210e){_0xc3a335['count']=_0x4d210e;if(_0x28f480[_0x5354('0x33')][_0x5354('0x42')]){_0x399a5d[_0x5354('0x43')]=[{'all':!![]}];}return db['SugarcrmField'][_0x5354('0x44')](_0x399a5d);})[_0x5354('0x28')](function(_0x380767){_0xc3a335[_0x5354('0x45')]=_0x380767;return _0xc3a335;})[_0x5354('0x28')](respondWithFilteredResult(_0x222324,_0x399a5d))[_0x5354('0x46')](handleError(_0x222324,null));};exports[_0x5354('0x47')]=function(_0x46d75d,_0xef1ec4){var _0x21ea3a={'raw':!![],'where':{'id':_0x46d75d[_0x5354('0x48')]['id']}},_0x1c96ce={};_0x1c96ce[_0x5354('0x32')]=_[_0x5354('0x34')](db[_0x5354('0x49')][_0x5354('0x2f')]);_0x1c96ce['query']=_[_0x5354('0x34')](_0x46d75d[_0x5354('0x33')]);_0x1c96ce[_0x5354('0x35')]=_['intersection'](_0x1c96ce[_0x5354('0x32')],_0x1c96ce[_0x5354('0x33')]);_0x21ea3a['attributes']=_['intersection'](_0x1c96ce[_0x5354('0x32')],qs[_0x5354('0x38')](_0x46d75d[_0x5354('0x33')][_0x5354('0x38')]));_0x21ea3a['attributes']=_0x21ea3a[_0x5354('0x37')][_0x5354('0x39')]?_0x21ea3a[_0x5354('0x37')]:_0x1c96ce[_0x5354('0x32')];if(_0x46d75d[_0x5354('0x33')][_0x5354('0x42')]){_0x21ea3a[_0x5354('0x43')]=[{'all':!![]}];}_0x21ea3a=_[_0x5354('0x3e')]({},_0x21ea3a,_0x46d75d['options']);return db['SugarcrmField'][_0x5354('0x4a')](_0x21ea3a)[_0x5354('0x28')](handleEntityNotFound(_0xef1ec4,null))[_0x5354('0x28')](respondWithResult(_0xef1ec4,null))[_0x5354('0x46')](handleError(_0xef1ec4,null));};exports['create']=function(_0x870ee1,_0x299425){return db['SugarcrmField'][_0x5354('0x4b')](_0x870ee1['body'],{})['then'](respondWithResult(_0x299425,0xc9))[_0x5354('0x46')](handleError(_0x299425,null));};exports['update']=function(_0x4eff24,_0x1b22d8){if(_0x4eff24[_0x5354('0x4c')]['id']){delete _0x4eff24['body']['id'];}return db['SugarcrmField'][_0x5354('0x4a')]({'where':{'id':_0x4eff24['params']['id']}})['then'](handleEntityNotFound(_0x1b22d8,null))[_0x5354('0x28')](saveUpdates(_0x4eff24[_0x5354('0x4c')],null))[_0x5354('0x28')](respondWithResult(_0x1b22d8,null))[_0x5354('0x46')](handleError(_0x1b22d8,null));};exports[_0x5354('0x29')]=function(_0x3e8734,_0x535268){return db[_0x5354('0x49')][_0x5354('0x4a')]({'where':{'id':_0x3e8734[_0x5354('0x48')]['id']}})[_0x5354('0x28')](handleEntityNotFound(_0x535268,null))['then'](removeEntity(_0x535268,null))[_0x5354('0x46')](handleError(_0x535268,null));};
\ No newline at end of file
index 2fa5095..d4755f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2523=['idField','FieldId','lodash','util','../../config/logger','api','moment','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2523,0x122));var _0x3252=function(_0x583ae9,_0x4781bd){_0x583ae9=_0x583ae9-0x0;var _0x4a9264=_0x2523[_0x583ae9];return _0x4a9264;};'use strict';var _=require(_0x3252('0x0'));var util=require(_0x3252('0x1'));var logger=require(_0x3252('0x2'))(_0x3252('0x3'));var moment=require(_0x3252('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3252('0x5'));var attributes=require(_0x3252('0x6'));module[_0x3252('0x7')]=function(_0xb90270,_0x2cee43){return _0xb90270[_0x3252('0x8')](_0x3252('0x9'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x3252('0xa'),_0x3252('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1c7e=['exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes'];(function(_0x30d6ca,_0xe4a23d){var _0x1cced6=function(_0x167188){while(--_0x167188){_0x30d6ca['push'](_0x30d6ca['shift']());}};_0x1cced6(++_0xe4a23d);}(_0x1c7e,0x167));var _0xe1c7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1c7e[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe1c7('0x0'))(_0xe1c7('0x1'));var moment=require(_0xe1c7('0x2'));var BPromise=require(_0xe1c7('0x3'));var rp=require(_0xe1c7('0x4'));var fs=require('fs');var path=require(_0xe1c7('0x5'));var rimraf=require(_0xe1c7('0x6'));var config=require(_0xe1c7('0x7'));var attributes=require(_0xe1c7('0x8'));module[_0xe1c7('0x9')]=function(_0x6f71ea,_0x432430){return _0x6f71ea[_0xe1c7('0xa')](_0xe1c7('0xb'),attributes,{'tableName':_0xe1c7('0xc'),'paranoid':![],'indexes':[{'name':_0xe1c7('0xd'),'fields':[_0xe1c7('0xe'),_0xe1c7('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index f1dda2b..e2da0f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca5f=['../../mysqldb','jayson/promise','client','then','info','SugarcrmField,\x20%s,\x20%s','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x54f7c0,_0x27af83){var _0x245d03=function(_0x1ad6c4){while(--_0x1ad6c4){_0x54f7c0['push'](_0x54f7c0['shift']());}};_0x245d03(++_0x27af83);}(_0xca5f,0x18a));var _0xfca5=function(_0x36388c,_0x4fffb5){_0x36388c=_0x36388c-0x0;var _0x58f353=_0xca5f[_0x36388c];return _0x58f353;};'use strict';var _=require('lodash');var util=require(_0xfca5('0x0'));var moment=require(_0xfca5('0x1'));var BPromise=require(_0xfca5('0x2'));var rs=require(_0xfca5('0x3'));var fs=require('fs');var Redis=require(_0xfca5('0x4'));var db=require(_0xfca5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xfca5('0x6'));var client=jayson[_0xfca5('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f167b,_0x144474,_0x5eadcb){return new BPromise(function(_0x4e99bd,_0x1a9002){return client['request'](_0x3f167b,_0x5eadcb)[_0xfca5('0x8')](function(_0x286c51){logger[_0xfca5('0x9')](_0xfca5('0xa'),_0x144474,'request\x20sent');logger['debug'](_0xfca5('0xb'),_0x144474,_0xfca5('0xc'),JSON[_0xfca5('0xd')](_0x286c51));if(_0x286c51[_0xfca5('0xe')]){if(_0x286c51['error'][_0xfca5('0xf')]===0x1f4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x144474,_0x286c51[_0xfca5('0xe')][_0xfca5('0x10')]);return _0x1a9002(_0x286c51[_0xfca5('0xe')][_0xfca5('0x10')]);}logger['error'](_0xfca5('0xa'),_0x144474,_0x286c51[_0xfca5('0xe')][_0xfca5('0x10')]);return _0x4e99bd(_0x286c51[_0xfca5('0xe')][_0xfca5('0x10')]);}else{logger['info'](_0xfca5('0xa'),_0x144474,'request\x20sent');_0x4e99bd(_0x286c51[_0xfca5('0x11')]['message']);}})[_0xfca5('0x12')](function(_0x3c54ad){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x144474,_0x3c54ad);_0x1a9002(_0x3c54ad);});});}
\ No newline at end of file
+var _0xcbe5=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment'];(function(_0x328809,_0x591a6c){var _0xbe7e21=function(_0x241a7f){while(--_0x241a7f){_0x328809['push'](_0x328809['shift']());}};_0xbe7e21(++_0x591a6c);}(_0xcbe5,0x1ca));var _0x5cbe=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xcbe5[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x5cbe('0x0'));var util=require('util');var moment=require(_0x5cbe('0x1'));var BPromise=require(_0x5cbe('0x2'));var rs=require(_0x5cbe('0x3'));var fs=require('fs');var Redis=require(_0x5cbe('0x4'));var db=require(_0x5cbe('0x5'))['db'];var utils=require(_0x5cbe('0x6'));var logger=require(_0x5cbe('0x7'))(_0x5cbe('0x8'));var config=require('../../config/environment');var jayson=require(_0x5cbe('0x9'));var client=jayson['client'][_0x5cbe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x448641,_0x419cfc,_0x55e585){return new BPromise(function(_0x295101,_0x3c29f9){return client[_0x5cbe('0xb')](_0x448641,_0x55e585)[_0x5cbe('0xc')](function(_0x4bef8e){logger[_0x5cbe('0xd')](_0x5cbe('0xe'),_0x419cfc,'request\x20sent');logger[_0x5cbe('0xf')](_0x5cbe('0x10'),_0x419cfc,_0x5cbe('0x11'),JSON['stringify'](_0x4bef8e));if(_0x4bef8e['error']){if(_0x4bef8e[_0x5cbe('0x12')][_0x5cbe('0x13')]===0x1f4){logger[_0x5cbe('0x12')](_0x5cbe('0xe'),_0x419cfc,_0x4bef8e['error'][_0x5cbe('0x14')]);return _0x3c29f9(_0x4bef8e['error'][_0x5cbe('0x14')]);}logger[_0x5cbe('0x12')](_0x5cbe('0xe'),_0x419cfc,_0x4bef8e['error'][_0x5cbe('0x14')]);return _0x295101(_0x4bef8e[_0x5cbe('0x12')]['message']);}else{logger[_0x5cbe('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x419cfc,_0x5cbe('0x11'));_0x295101(_0x4bef8e[_0x5cbe('0x15')]['message']);}})[_0x5cbe('0x16')](function(_0x303c35){logger[_0x5cbe('0x12')](_0x5cbe('0xe'),_0x419cfc,_0x303c35);_0x3c29f9(_0x303c35);});});}
\ No newline at end of file
index 2ccb825..5ec5635 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09d3=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','update','multer','util','path','connect-timeout','express','Router'];(function(_0x20aadb,_0x5a607a){var _0x520018=function(_0x1d258a){while(--_0x1d258a){_0x20aadb['push'](_0x20aadb['shift']());}};_0x520018(++_0x5a607a);}(_0x09d3,0xa5));var _0x309d=function(_0x95b3a3,_0x360d0c){_0x95b3a3=_0x95b3a3-0x0;var _0x26eeaf=_0x09d3[_0x95b3a3];return _0x26eeaf;};'use strict';var multer=require(_0x309d('0x0'));var util=require(_0x309d('0x1'));var path=require(_0x309d('0x2'));var timeout=require(_0x309d('0x3'));var express=require(_0x309d('0x4'));var router=express[_0x309d('0x5')]();var fs_extra=require(_0x309d('0x6'));var auth=require(_0x309d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x309d('0x8'));var controller=require('./intVtigerAccount.controller');router[_0x309d('0x9')]('/',auth[_0x309d('0xa')](),controller['index']);router[_0x309d('0x9')](_0x309d('0xb'),auth['isAuthenticated'](),controller[_0x309d('0xc')]);router[_0x309d('0x9')](_0x309d('0xd'),auth[_0x309d('0xa')](),controller[_0x309d('0xe')]);router[_0x309d('0x9')]('/:id/fields',auth[_0x309d('0xa')](),controller[_0x309d('0xf')]);router[_0x309d('0x10')]('/',auth[_0x309d('0xa')](),controller[_0x309d('0x11')]);router[_0x309d('0x10')]('/:id/configurations',auth[_0x309d('0xa')](),controller['addConfiguration']);router['put'](_0x309d('0xb'),auth[_0x309d('0xa')](),controller[_0x309d('0x12')]);router['delete'](_0x309d('0xb'),auth[_0x309d('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xe233=['getConfigurations','/:id/fields','create','post','update','delete','destroy','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations'];(function(_0x111903,_0x2aab6f){var _0x4268a9=function(_0x37bfd9){while(--_0x37bfd9){_0x111903['push'](_0x111903['shift']());}};_0x4268a9(++_0x2aab6f);}(_0xe233,0x15b));var _0x3e23=function(_0x5b4a6d,_0x42ad62){_0x5b4a6d=_0x5b4a6d-0x0;var _0x5c2514=_0xe233[_0x5b4a6d];return _0x5c2514;};'use strict';var multer=require(_0x3e23('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3e23('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3e23('0x2'));var auth=require(_0x3e23('0x3'));var interaction=require(_0x3e23('0x4'));var config=require(_0x3e23('0x5'));var controller=require(_0x3e23('0x6'));router['get']('/',auth[_0x3e23('0x7')](),controller[_0x3e23('0x8')]);router[_0x3e23('0x9')](_0x3e23('0xa'),auth[_0x3e23('0x7')](),controller[_0x3e23('0xb')]);router[_0x3e23('0x9')](_0x3e23('0xc'),auth[_0x3e23('0x7')](),controller[_0x3e23('0xd')]);router[_0x3e23('0x9')](_0x3e23('0xe'),auth[_0x3e23('0x7')](),controller['getFields']);router['post']('/',auth[_0x3e23('0x7')](),controller[_0x3e23('0xf')]);router[_0x3e23('0x10')](_0x3e23('0xc'),auth[_0x3e23('0x7')](),controller['addConfiguration']);router['put']('/:id',auth[_0x3e23('0x7')](),controller[_0x3e23('0x11')]);router[_0x3e23('0x12')](_0x3e23('0xa'),auth[_0x3e23('0x7')](),controller[_0x3e23('0x13')]);module['exports']=router;
\ No newline at end of file
index a3592f6..0a25c1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38ba=['exports','STRING','HelpDesk','sequelize'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x38ba,0x103));var _0xa38b=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x38ba[_0x18ab2a];return _0x16dcee;};'use strict';var Sequelize=require(_0xa38b('0x0'));module[_0xa38b('0x1')]={'name':{'type':Sequelize[_0xa38b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa38b('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0xa38b('0x2')],'allowNull':![],'defaultValue':_0xa38b('0x3')},'remoteUri':{'type':Sequelize[_0xa38b('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xa38b('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x7416=['STRING','HelpDesk','sequelize','exports'];(function(_0x538a3b,_0x354a6a){var _0x415494=function(_0x583d8c){while(--_0x583d8c){_0x538a3b['push'](_0x538a3b['shift']());}};_0x415494(++_0x354a6a);}(_0x7416,0x17e));var _0x6741=function(_0x23c73d,_0x357b21){_0x23c73d=_0x23c73d-0x0;var _0x36ba47=_0x7416[_0x23c73d];return _0x36ba47;};'use strict';var Sequelize=require(_0x6741('0x0'));module[_0x6741('0x1')]={'name':{'type':Sequelize[_0x6741('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6741('0x2')]},'username':{'type':Sequelize[_0x6741('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x6741('0x2')],'allowNull':![],'defaultValue':_0x6741('0x3')},'remoteUri':{'type':Sequelize[_0x6741('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x6741('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index c9a9ace..2c2eec6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe39=['picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','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','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','VtigerAccount','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filters','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','VtigerConfiguration','VtigerField','Descriptions','md5','username','description','remoteUri','serverUrl','accessKey','moduleName','slice','substring','lastIndexOf','GET','getchallenge','success','POST','login','result','describe','sessionName','reference','owner','remove','includes','false','length','label','cf_','picklist'];(function(_0x53fc4d,_0x31f802){var _0x35ef36=function(_0x47e31c){while(--_0x47e31c){_0x53fc4d['push'](_0x53fc4d['shift']());}};_0x35ef36(++_0x31f802);}(_0xfe39,0x89));var _0x9fe3=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xfe39[_0x26462c];return _0x509a42;};'use strict';var emlformat=require(_0x9fe3('0x0'));var rimraf=require(_0x9fe3('0x1'));var zipdir=require(_0x9fe3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9fe3('0x3'));var BPromise=require(_0x9fe3('0x4'));var Mustache=require(_0x9fe3('0x5'));var util=require(_0x9fe3('0x6'));var path=require('path');var sox=require(_0x9fe3('0x7'));var csv=require(_0x9fe3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9fe3('0x9'));var _=require(_0x9fe3('0xa'));var squel=require(_0x9fe3('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9fe3('0xc'));var toCsv=require(_0x9fe3('0x8'));var querystring=require(_0x9fe3('0xd'));var Papa=require(_0x9fe3('0xe'));var Redis=require(_0x9fe3('0xf'));var authService=require(_0x9fe3('0x10'));var qs=require(_0x9fe3('0x11'));var as=require(_0x9fe3('0x12'));var hardwareService=require(_0x9fe3('0x13'));var logger=require(_0x9fe3('0x14'))(_0x9fe3('0x15'));var utils=require(_0x9fe3('0x16'));var config=require(_0x9fe3('0x17'));var licenseUtil=require(_0x9fe3('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x9fe3('0x19'));function respondWithStatusCode(_0x1a505b,_0x330dd2){_0x330dd2=_0x330dd2||0xcc;return function(_0x50e9a6){if(_0x50e9a6){return _0x1a505b[_0x9fe3('0x1a')](_0x330dd2);}return _0x1a505b[_0x9fe3('0x1b')](_0x330dd2)[_0x9fe3('0x1c')]();};}function respondWithResult(_0x43c939,_0xcb6c75){_0xcb6c75=_0xcb6c75||0xc8;return function(_0x437501){if(_0x437501){return _0x43c939[_0x9fe3('0x1b')](_0xcb6c75)[_0x9fe3('0x1d')](_0x437501);}};}function respondWithFilteredResult(_0x21f693,_0x129c3f){return function(_0x2201c2){if(_0x2201c2){var _0x4a42cf=typeof _0x129c3f[_0x9fe3('0x1e')]===_0x9fe3('0x1f')&&typeof _0x129c3f['limit']===_0x9fe3('0x1f');var _0x5a62dd=_0x2201c2[_0x9fe3('0x20')];var _0x3f72f8=_0x4a42cf?0x0:_0x129c3f[_0x9fe3('0x1e')];var _0x1b4286=_0x4a42cf?_0x2201c2['count']:_0x129c3f['offset']+_0x129c3f['limit'];var _0x45614c;if(_0x1b4286>=_0x5a62dd){_0x1b4286=_0x5a62dd;_0x45614c=0xc8;}else{_0x45614c=0xce;}_0x21f693[_0x9fe3('0x1b')](_0x45614c);return _0x21f693[_0x9fe3('0x21')](_0x9fe3('0x22'),_0x3f72f8+'-'+_0x1b4286+'/'+_0x5a62dd)[_0x9fe3('0x1d')](_0x2201c2);}return null;};}function patchUpdates(_0x5f0d87){return function(_0x55b018){try{jsonpatch[_0x9fe3('0x23')](_0x55b018,_0x5f0d87,!![]);}catch(_0x4cfa60){return BPromise[_0x9fe3('0x24')](_0x4cfa60);}return _0x55b018[_0x9fe3('0x25')]();};}function saveUpdates(_0x2a3915,_0x9f3b3f){return function(_0x5e8a8f){if(_0x5e8a8f){return _0x5e8a8f[_0x9fe3('0x26')](_0x2a3915)[_0x9fe3('0x27')](function(_0x1306aa){return _0x1306aa;});}return null;};}function removeEntity(_0x1f49cd,_0x4f58fb){return function(_0x4b1960){if(_0x4b1960){return _0x4b1960[_0x9fe3('0x28')]()['then'](function(){_0x1f49cd[_0x9fe3('0x1b')](0xcc)[_0x9fe3('0x1c')]();});}};}function handleEntityNotFound(_0x142de8,_0x1878ae){return function(_0x18e3dd){if(!_0x18e3dd){_0x142de8[_0x9fe3('0x1a')](0x194);}return _0x18e3dd;};}function handleError(_0x39f1ff,_0x2eb3e2){_0x2eb3e2=_0x2eb3e2||0x1f4;return function(_0x5fcf4d){logger[_0x9fe3('0x29')](_0x5fcf4d[_0x9fe3('0x2a')]);if(_0x5fcf4d[_0x9fe3('0x2b')]){delete _0x5fcf4d[_0x9fe3('0x2b')];}_0x39f1ff[_0x9fe3('0x1b')](_0x2eb3e2)[_0x9fe3('0x2c')](_0x5fcf4d);};}exports[_0x9fe3('0x2d')]=function(_0x4d4580,_0x476e0b){var _0x2210ce={},_0x51319c={},_0x54889c={'count':0x0,'rows':[]};var _0x1e66da=_['map'](db[_0x9fe3('0x2e')][_0x9fe3('0x2f')],function(_0x480c3b){return{'name':_0x480c3b[_0x9fe3('0x30')],'type':_0x480c3b[_0x9fe3('0x31')][_0x9fe3('0x32')]};});_0x51319c['model']=_[_0x9fe3('0x33')](_0x1e66da,_0x9fe3('0x2b'));_0x51319c[_0x9fe3('0x34')]=_[_0x9fe3('0x35')](_0x4d4580[_0x9fe3('0x34')]);_0x51319c['filters']=_[_0x9fe3('0x36')](_0x51319c[_0x9fe3('0x37')],_0x51319c['query']);_0x2210ce[_0x9fe3('0x38')]=_[_0x9fe3('0x36')](_0x51319c[_0x9fe3('0x37')],qs[_0x9fe3('0x39')](_0x4d4580[_0x9fe3('0x34')]['fields']));_0x2210ce[_0x9fe3('0x38')]=_0x2210ce[_0x9fe3('0x38')]['length']?_0x2210ce[_0x9fe3('0x38')]:_0x51319c['model'];if(!_0x4d4580['query'][_0x9fe3('0x3a')](_0x9fe3('0x3b'))){_0x2210ce[_0x9fe3('0x3c')]=qs[_0x9fe3('0x3c')](_0x4d4580['query'][_0x9fe3('0x3c')]);_0x2210ce[_0x9fe3('0x1e')]=qs[_0x9fe3('0x1e')](_0x4d4580[_0x9fe3('0x34')]['offset']);}_0x2210ce[_0x9fe3('0x3d')]=qs[_0x9fe3('0x3e')](_0x4d4580[_0x9fe3('0x34')][_0x9fe3('0x3e')]);_0x2210ce['where']=qs[_0x9fe3('0x3f')](_['pick'](_0x4d4580[_0x9fe3('0x34')],_0x51319c[_0x9fe3('0x3f')]),_0x1e66da);if(_0x4d4580[_0x9fe3('0x34')][_0x9fe3('0x40')]){_0x2210ce['where']=_[_0x9fe3('0x41')](_0x2210ce[_0x9fe3('0x42')],{'$or':_[_0x9fe3('0x33')](_0x1e66da,function(_0x2fcf7d){if(_0x2fcf7d[_0x9fe3('0x31')]!==_0x9fe3('0x43')){var _0xec94b1={};_0xec94b1[_0x2fcf7d[_0x9fe3('0x2b')]]={'$like':'%'+_0x4d4580[_0x9fe3('0x34')][_0x9fe3('0x40')]+'%'};return _0xec94b1;}})});}_0x2210ce=_['merge']({},_0x2210ce,_0x4d4580[_0x9fe3('0x44')]);var _0x50835b={'where':_0x2210ce['where']};return db['VtigerAccount'][_0x9fe3('0x20')](_0x50835b)[_0x9fe3('0x27')](function(_0x214493){_0x54889c['count']=_0x214493;if(_0x4d4580[_0x9fe3('0x34')][_0x9fe3('0x45')]){_0x2210ce[_0x9fe3('0x46')]=[{'all':!![]}];}return db[_0x9fe3('0x2e')][_0x9fe3('0x47')](_0x2210ce);})[_0x9fe3('0x27')](function(_0x30b8fa){_0x54889c[_0x9fe3('0x48')]=_0x30b8fa;return _0x54889c;})[_0x9fe3('0x27')](respondWithFilteredResult(_0x476e0b,_0x2210ce))[_0x9fe3('0x49')](handleError(_0x476e0b,null));};exports[_0x9fe3('0x4a')]=function(_0x231805,_0x637b81){var _0x1c866c={'raw':![],'where':{'id':_0x231805[_0x9fe3('0x4b')]['id']}},_0x236f52={};_0x236f52['model']=_['keys'](db[_0x9fe3('0x2e')]['rawAttributes']);_0x236f52['query']=_[_0x9fe3('0x35')](_0x231805[_0x9fe3('0x34')]);_0x236f52[_0x9fe3('0x3f')]=_[_0x9fe3('0x36')](_0x236f52[_0x9fe3('0x37')],_0x236f52[_0x9fe3('0x34')]);_0x1c866c[_0x9fe3('0x38')]=_['intersection'](_0x236f52['model'],qs[_0x9fe3('0x39')](_0x231805['query'][_0x9fe3('0x39')]));_0x1c866c['attributes']=_0x1c866c['attributes']['length']?_0x1c866c[_0x9fe3('0x38')]:_0x236f52[_0x9fe3('0x37')];if(_0x231805[_0x9fe3('0x34')][_0x9fe3('0x45')]){_0x1c866c[_0x9fe3('0x46')]=[{'all':!![]}];}_0x1c866c=_[_0x9fe3('0x41')]({},_0x1c866c,_0x231805[_0x9fe3('0x44')]);return db[_0x9fe3('0x2e')][_0x9fe3('0x4c')](_0x1c866c)['then'](handleEntityNotFound(_0x637b81,null))['then'](respondWithResult(_0x637b81,null))['catch'](handleError(_0x637b81,null));};exports[_0x9fe3('0x4d')]=function(_0x3d71bd,_0xc390a5){return db['VtigerAccount'][_0x9fe3('0x4d')](_0x3d71bd[_0x9fe3('0x4e')],{})['then'](respondWithResult(_0xc390a5,0xc9))[_0x9fe3('0x49')](handleError(_0xc390a5,null));};exports['update']=function(_0x5260f0,_0x4734b5){if(_0x5260f0[_0x9fe3('0x4e')]['id']){delete _0x5260f0['body']['id'];}return db[_0x9fe3('0x2e')]['find']({'where':{'id':_0x5260f0[_0x9fe3('0x4b')]['id']}})[_0x9fe3('0x27')](handleEntityNotFound(_0x4734b5,null))['then'](saveUpdates(_0x5260f0['body'],null))[_0x9fe3('0x27')](respondWithResult(_0x4734b5,null))[_0x9fe3('0x49')](handleError(_0x4734b5,null));};exports[_0x9fe3('0x28')]=function(_0x54e553,_0x51715a){return db[_0x9fe3('0x2e')][_0x9fe3('0x4c')]({'where':{'id':_0x54e553[_0x9fe3('0x4b')]['id']}})[_0x9fe3('0x27')](handleEntityNotFound(_0x51715a,null))[_0x9fe3('0x27')](removeEntity(_0x51715a,null))[_0x9fe3('0x49')](handleError(_0x51715a,null));};exports[_0x9fe3('0x4f')]=function(_0x4e0e83,_0x41b6db,_0x4017f3){var _0x4c655a={};var _0x25d7c0={};var _0x551c98;var _0x3b420f;return db['VtigerAccount'][_0x9fe3('0x50')]({'where':{'id':_0x4e0e83[_0x9fe3('0x4b')]['id']}})[_0x9fe3('0x27')](handleEntityNotFound(_0x41b6db,null))[_0x9fe3('0x27')](function(_0x36f595){if(_0x36f595){_0x551c98=_0x36f595;_0x25d7c0[_0x9fe3('0x37')]=_['keys'](db['VtigerConfiguration'][_0x9fe3('0x2f')]);_0x25d7c0[_0x9fe3('0x34')]=_[_0x9fe3('0x35')](_0x4e0e83[_0x9fe3('0x34')]);_0x25d7c0['filters']=_[_0x9fe3('0x36')](_0x25d7c0['model'],_0x25d7c0[_0x9fe3('0x34')]);_0x4c655a['attributes']=_[_0x9fe3('0x36')](_0x25d7c0[_0x9fe3('0x37')],qs[_0x9fe3('0x39')](_0x4e0e83['query'][_0x9fe3('0x39')]));_0x4c655a['attributes']=_0x4c655a[_0x9fe3('0x38')]['length']?_0x4c655a[_0x9fe3('0x38')]:_0x25d7c0['model'];_0x4c655a[_0x9fe3('0x3d')]=qs[_0x9fe3('0x3e')](_0x4e0e83[_0x9fe3('0x34')][_0x9fe3('0x3e')]);_0x4c655a['where']=qs[_0x9fe3('0x3f')](_[_0x9fe3('0x51')](_0x4e0e83[_0x9fe3('0x34')],_0x25d7c0[_0x9fe3('0x3f')]));if(_0x4e0e83[_0x9fe3('0x34')][_0x9fe3('0x40')]){_0x4c655a[_0x9fe3('0x42')]=_[_0x9fe3('0x41')](_0x4c655a[_0x9fe3('0x42')],{'$or':_[_0x9fe3('0x33')](_0x4c655a['attributes'],function(_0x9573bf){var _0x2751a5={};_0x2751a5[_0x9573bf]={'$like':'%'+_0x4e0e83[_0x9fe3('0x34')]['filter']+'%'};return _0x2751a5;})});}_0x4c655a=_[_0x9fe3('0x41')]({},_0x4c655a,_0x4e0e83[_0x9fe3('0x44')]);return _0x551c98['getConfigurations'](_0x4c655a);}})[_0x9fe3('0x27')](function(_0x52076e){if(_0x52076e){_0x3b420f=_0x52076e['length'];if(!_0x4e0e83[_0x9fe3('0x34')][_0x9fe3('0x3a')](_0x9fe3('0x3b'))){_0x4c655a[_0x9fe3('0x3c')]=qs[_0x9fe3('0x3c')](_0x4e0e83[_0x9fe3('0x34')]['limit']);_0x4c655a[_0x9fe3('0x1e')]=qs[_0x9fe3('0x1e')](_0x4e0e83[_0x9fe3('0x34')][_0x9fe3('0x1e')]);}return _0x551c98['getConfigurations'](_0x4c655a);}})[_0x9fe3('0x27')](function(_0x26fb38){if(_0x26fb38){return _0x26fb38?{'count':_0x3b420f,'rows':_0x26fb38}:null;}})[_0x9fe3('0x27')](respondWithResult(_0x41b6db,null))[_0x9fe3('0x49')](handleError(_0x41b6db,null));};exports[_0x9fe3('0x52')]=function(_0x194880,_0x5dcdfd,_0x217297){if(_0x194880[_0x9fe3('0x4e')]['id']){delete _0x194880[_0x9fe3('0x4e')]['id'];}return db[_0x9fe3('0x2e')][_0x9fe3('0x50')]({'where':{'id':_0x194880[_0x9fe3('0x4b')]['id']}})[_0x9fe3('0x27')](handleEntityNotFound(_0x5dcdfd,null))['then'](function(_0x4d6a60){if(_0x4d6a60){_0x194880[_0x9fe3('0x4e')][_0x9fe3('0x53')]=_0x4d6a60['id'];_0x194880[_0x9fe3('0x4e')][_0x9fe3('0x54')]=integrations[_0x9fe3('0x55')](_0x194880[_0x9fe3('0x4e')]['channel'],_0x194880[_0x9fe3('0x4e')][_0x9fe3('0x31')]);_0x194880['body']['Descriptions']=integrations['getDescriptions'](_0x194880[_0x9fe3('0x4e')][_0x9fe3('0x56')],_0x194880[_0x9fe3('0x4e')][_0x9fe3('0x31')]);return db[_0x9fe3('0x57')][_0x9fe3('0x4d')](_0x194880[_0x9fe3('0x4e')],{'include':[{'model':db[_0x9fe3('0x58')],'as':_0x9fe3('0x54')},{'model':db[_0x9fe3('0x58')],'as':_0x9fe3('0x59')}]});}return null;})['then'](respondWithResult(_0x5dcdfd,null))[_0x9fe3('0x49')](handleError(_0x5dcdfd,null));};var md5=require(_0x9fe3('0x5a'));exports['getFields']=function(_0x1ec14e,_0x5275dc,_0x2e7808){var _0x4a5296=null;var _0x51a5e1=null;var _0xfcd52a=null;var _0x2d0ffe=null;var _0x543429='';return db[_0x9fe3('0x2e')][_0x9fe3('0x50')]({'where':{'id':_0x1ec14e[_0x9fe3('0x4b')]['id']},'attributes':['id',_0x9fe3('0x2b'),_0x9fe3('0x5b'),_0x9fe3('0x5c'),'moduleName',_0x9fe3('0x5d'),_0x9fe3('0x5e'),_0x9fe3('0x5f')]})[_0x9fe3('0x27')](handleEntityNotFound(_0x5275dc,null))['then'](function(_0x572633){if(_0x572633){_0x4a5296=_0x572633[_0x9fe3('0x5b')];_0x51a5e1=_0x572633[_0x9fe3('0x5f')];_0xfcd52a=_0x572633[_0x9fe3('0x60')];_0x543429=_0x572633[_0x9fe3('0x5d')];var _0x5c62e8=_0x543429[_0x9fe3('0x61')](-0x1);if(_0x5c62e8==='/'){_0x543429=_0x543429[_0x9fe3('0x62')](0x0,_0x543429[_0x9fe3('0x63')](_0x5c62e8));}_0x2d0ffe=util['format']('%s/webservice.php',_0x543429);var _0x97e5c9={'method':_0x9fe3('0x64'),'uri':_0x2d0ffe,'qs':{'operation':_0x9fe3('0x65'),'username':_0x572633[_0x9fe3('0x5b')]},'json':!![]};return rp(_0x97e5c9);}})[_0x9fe3('0x27')](function(_0x392aaf){if(_0x392aaf[_0x9fe3('0x66')]){var _0xa040f7={'method':_0x9fe3('0x67'),'uri':_0x2d0ffe,'form':{'operation':_0x9fe3('0x68'),'username':_0x4a5296,'accessKey':md5(_0x392aaf[_0x9fe3('0x69')]['token']+_0x51a5e1)},'json':!![]};return rp(_0xa040f7);}})[_0x9fe3('0x27')](function(_0x35dacb){if(_0x35dacb[_0x9fe3('0x66')]){var _0x1960a7={'method':_0x9fe3('0x64'),'uri':_0x2d0ffe,'qs':{'operation':_0x9fe3('0x6a'),'username':_0x4a5296,'sessionName':_0x35dacb['result'][_0x9fe3('0x6b')],'elementType':_0xfcd52a},'json':!![]};return rp(_0x1960a7);}})[_0x9fe3('0x27')](function(_0x4598f7){if(_0x4598f7[_0x9fe3('0x66')]){var _0x5416f5=['autogenerated',_0x9fe3('0x6c'),_0x9fe3('0x6d')];_[_0x9fe3('0x6e')](_0x4598f7[_0x9fe3('0x69')][_0x9fe3('0x39')],function(_0x1f4714){return _0x5416f5[_0x9fe3('0x6f')](_0x1f4714[_0x9fe3('0x31')][_0x9fe3('0x2b')]);});_[_0x9fe3('0x6e')](_0x4598f7[_0x9fe3('0x69')]['fields'],function(_0x4addbf){return _0x4addbf['editable']===_0x9fe3('0x70');});return{'count':_0x4598f7[_0x9fe3('0x69')][_0x9fe3('0x39')][_0x9fe3('0x71')],'rows':_[_0x9fe3('0x33')](_0x4598f7[_0x9fe3('0x69')]['fields'],function(_0x2af6e0){return{'id':_0x2af6e0[_0x9fe3('0x2b')],'name':_0x2af6e0[_0x9fe3('0x72')],'custom':_['startsWith'](_0x2af6e0[_0x9fe3('0x2b')],_0x9fe3('0x73'))?!![]:![],'options':_0x2af6e0[_0x9fe3('0x31')][_0x9fe3('0x2b')]===_0x9fe3('0x74')&&_0x2af6e0['type'][_0x9fe3('0x75')][_0x9fe3('0x71')]>0x0?_['map'](_0x2af6e0['type'][_0x9fe3('0x75')],function(_0x2414b1){return{'name':_0x2414b1[_0x9fe3('0x72')],'value':_0x2414b1[_0x9fe3('0x76')]};}):[]};})};}})[_0x9fe3('0x27')](respondWithResult(_0x5275dc,null))['catch'](function(_0xca16a9){console[_0x9fe3('0x77')](_0x9fe3('0x78')+_0xca16a9);var _0xae7104=_0x1ec14e[_0x9fe3('0x34')]['test']?0x1f4:_0xca16a9[_0x9fe3('0x79')]||0x1f4;logger[_0x9fe3('0x29')](_0x9fe3('0x7a'),_0x9fe3('0x7b'),_0xae7104,JSON[_0x9fe3('0x7c')](_0xca16a9));delete _0xca16a9[_0x9fe3('0x2b')];if(_0xae7104===0x191){_0xae7104=0x190;}_0x5275dc[_0x9fe3('0x1b')](_0xae7104)[_0x9fe3('0x2c')](_0x1ec14e['query'][_0x9fe3('0x7d')]?{'message':_0x9fe3('0x7e'),'statusCode':_0xca16a9['statusCode']}:_0xca16a9);});};
\ No newline at end of file
+var _0xd467=['reference','owner','remove','includes','editable','false','label','startsWith','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../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','set','save','update','destroy','then','error','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','options','VtigerAccount','includeAll','catch','show','include','create','body','find','params','getConfigurations','findOne','VtigerConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','serverUrl','accessKey','remoteUri','format','%s/webservice.php','GET','getchallenge','success','POST','login','result','describe','sessionName','autogenerated'];(function(_0x12ca16,_0x281fd9){var _0x56fb78=function(_0x3479b2){while(--_0x3479b2){_0x12ca16['push'](_0x12ca16['shift']());}};_0x56fb78(++_0x281fd9);}(_0xd467,0xf4));var _0x7d46=function(_0x423113,_0x52a042){_0x423113=_0x423113-0x0;var _0x4ac171=_0xd467[_0x423113];return _0x4ac171;};'use strict';var emlformat=require(_0x7d46('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7d46('0x1'));var moment=require(_0x7d46('0x2'));var BPromise=require(_0x7d46('0x3'));var Mustache=require('mustache');var util=require(_0x7d46('0x4'));var path=require('path');var sox=require(_0x7d46('0x5'));var csv=require('to-csv');var ejs=require(_0x7d46('0x6'));var fs=require('fs');var fs_extra=require(_0x7d46('0x7'));var _=require(_0x7d46('0x8'));var squel=require(_0x7d46('0x9'));var crypto=require('crypto');var jsforce=require(_0x7d46('0xa'));var deskjs=require(_0x7d46('0xb'));var toCsv=require(_0x7d46('0xc'));var querystring=require('querystring');var Papa=require(_0x7d46('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7d46('0xe'));var as=require(_0x7d46('0xf'));var hardwareService=require(_0x7d46('0x10'));var logger=require(_0x7d46('0x11'))(_0x7d46('0x12'));var utils=require(_0x7d46('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x7d46('0x14'));var db=require(_0x7d46('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x434604,_0x3710db){_0x3710db=_0x3710db||0xcc;return function(_0xa89c1e){if(_0xa89c1e){return _0x434604[_0x7d46('0x16')](_0x3710db);}return _0x434604['status'](_0x3710db)[_0x7d46('0x17')]();};}function respondWithResult(_0x126b6f,_0x31a0ae){_0x31a0ae=_0x31a0ae||0xc8;return function(_0x46ca66){if(_0x46ca66){return _0x126b6f[_0x7d46('0x18')](_0x31a0ae)[_0x7d46('0x19')](_0x46ca66);}};}function respondWithFilteredResult(_0x123a16,_0x1ec777){return function(_0x53f335){if(_0x53f335){var _0x51856a=typeof _0x1ec777['offset']===_0x7d46('0x1a')&&typeof _0x1ec777[_0x7d46('0x1b')]===_0x7d46('0x1a');var _0x57fb72=_0x53f335[_0x7d46('0x1c')];var _0x4ac331=_0x51856a?0x0:_0x1ec777['offset'];var _0x47aa3e=_0x51856a?_0x53f335['count']:_0x1ec777['offset']+_0x1ec777['limit'];var _0x4d1590;if(_0x47aa3e>=_0x57fb72){_0x47aa3e=_0x57fb72;_0x4d1590=0xc8;}else{_0x4d1590=0xce;}_0x123a16[_0x7d46('0x18')](_0x4d1590);return _0x123a16[_0x7d46('0x1d')]('Content-Range',_0x4ac331+'-'+_0x47aa3e+'/'+_0x57fb72)['json'](_0x53f335);}return null;};}function patchUpdates(_0x5bb079){return function(_0x477294){try{jsonpatch['apply'](_0x477294,_0x5bb079,!![]);}catch(_0x211e94){return BPromise['reject'](_0x211e94);}return _0x477294[_0x7d46('0x1e')]();};}function saveUpdates(_0x454fcf,_0x4de4ed){return function(_0x15a985){if(_0x15a985){return _0x15a985[_0x7d46('0x1f')](_0x454fcf)['then'](function(_0x3af9dc){return _0x3af9dc;});}return null;};}function removeEntity(_0x371baa,_0x350305){return function(_0x3b6221){if(_0x3b6221){return _0x3b6221[_0x7d46('0x20')]()[_0x7d46('0x21')](function(){_0x371baa[_0x7d46('0x18')](0xcc)[_0x7d46('0x17')]();});}};}function handleEntityNotFound(_0x3a81fe,_0x50a336){return function(_0x29b464){if(!_0x29b464){_0x3a81fe[_0x7d46('0x16')](0x194);}return _0x29b464;};}function handleError(_0x1e1a4e,_0x1a061f){_0x1a061f=_0x1a061f||0x1f4;return function(_0x274568){logger[_0x7d46('0x22')](_0x274568['stack']);if(_0x274568[_0x7d46('0x23')]){delete _0x274568[_0x7d46('0x23')];}_0x1e1a4e[_0x7d46('0x18')](_0x1a061f)[_0x7d46('0x24')](_0x274568);};}exports['index']=function(_0x51192c,_0x41f543){var _0xed543a={},_0x19dcf2={},_0x40eaae={'count':0x0,'rows':[]};var _0x299d9c=_[_0x7d46('0x25')](db['VtigerAccount'][_0x7d46('0x26')],function(_0x13b9c0){return{'name':_0x13b9c0[_0x7d46('0x27')],'type':_0x13b9c0[_0x7d46('0x28')][_0x7d46('0x29')]};});_0x19dcf2['model']=_[_0x7d46('0x25')](_0x299d9c,_0x7d46('0x23'));_0x19dcf2[_0x7d46('0x2a')]=_[_0x7d46('0x2b')](_0x51192c[_0x7d46('0x2a')]);_0x19dcf2[_0x7d46('0x2c')]=_[_0x7d46('0x2d')](_0x19dcf2[_0x7d46('0x2e')],_0x19dcf2[_0x7d46('0x2a')]);_0xed543a['attributes']=_[_0x7d46('0x2d')](_0x19dcf2[_0x7d46('0x2e')],qs['fields'](_0x51192c[_0x7d46('0x2a')][_0x7d46('0x2f')]));_0xed543a[_0x7d46('0x30')]=_0xed543a['attributes'][_0x7d46('0x31')]?_0xed543a[_0x7d46('0x30')]:_0x19dcf2[_0x7d46('0x2e')];if(!_0x51192c[_0x7d46('0x2a')][_0x7d46('0x32')](_0x7d46('0x33'))){_0xed543a[_0x7d46('0x1b')]=qs['limit'](_0x51192c[_0x7d46('0x2a')][_0x7d46('0x1b')]);_0xed543a[_0x7d46('0x34')]=qs[_0x7d46('0x34')](_0x51192c[_0x7d46('0x2a')][_0x7d46('0x34')]);}_0xed543a[_0x7d46('0x35')]=qs[_0x7d46('0x36')](_0x51192c[_0x7d46('0x2a')]['sort']);_0xed543a['where']=qs[_0x7d46('0x2c')](_[_0x7d46('0x37')](_0x51192c[_0x7d46('0x2a')],_0x19dcf2[_0x7d46('0x2c')]),_0x299d9c);if(_0x51192c[_0x7d46('0x2a')][_0x7d46('0x38')]){_0xed543a[_0x7d46('0x39')]=_[_0x7d46('0x3a')](_0xed543a[_0x7d46('0x39')],{'$or':_[_0x7d46('0x25')](_0x299d9c,function(_0x1de6e7){if(_0x1de6e7['type']!=='VIRTUAL'){var _0x50e317={};_0x50e317[_0x1de6e7[_0x7d46('0x23')]]={'$like':'%'+_0x51192c[_0x7d46('0x2a')][_0x7d46('0x38')]+'%'};return _0x50e317;}})});}_0xed543a=_['merge']({},_0xed543a,_0x51192c[_0x7d46('0x3b')]);var _0x2cae87={'where':_0xed543a[_0x7d46('0x39')]};return db[_0x7d46('0x3c')][_0x7d46('0x1c')](_0x2cae87)['then'](function(_0x2fa32e){_0x40eaae[_0x7d46('0x1c')]=_0x2fa32e;if(_0x51192c[_0x7d46('0x2a')][_0x7d46('0x3d')]){_0xed543a['include']=[{'all':!![]}];}return db[_0x7d46('0x3c')]['findAll'](_0xed543a);})[_0x7d46('0x21')](function(_0x220901){_0x40eaae['rows']=_0x220901;return _0x40eaae;})[_0x7d46('0x21')](respondWithFilteredResult(_0x41f543,_0xed543a))[_0x7d46('0x3e')](handleError(_0x41f543,null));};exports[_0x7d46('0x3f')]=function(_0x4404ba,_0x2ae78d){var _0x161b6c={'raw':![],'where':{'id':_0x4404ba['params']['id']}},_0x37856b={};_0x37856b['model']=_[_0x7d46('0x2b')](db['VtigerAccount'][_0x7d46('0x26')]);_0x37856b[_0x7d46('0x2a')]=_[_0x7d46('0x2b')](_0x4404ba['query']);_0x37856b[_0x7d46('0x2c')]=_[_0x7d46('0x2d')](_0x37856b[_0x7d46('0x2e')],_0x37856b[_0x7d46('0x2a')]);_0x161b6c[_0x7d46('0x30')]=_[_0x7d46('0x2d')](_0x37856b[_0x7d46('0x2e')],qs[_0x7d46('0x2f')](_0x4404ba[_0x7d46('0x2a')][_0x7d46('0x2f')]));_0x161b6c[_0x7d46('0x30')]=_0x161b6c['attributes']['length']?_0x161b6c[_0x7d46('0x30')]:_0x37856b['model'];if(_0x4404ba['query']['includeAll']){_0x161b6c[_0x7d46('0x40')]=[{'all':!![]}];}_0x161b6c=_[_0x7d46('0x3a')]({},_0x161b6c,_0x4404ba['options']);return db[_0x7d46('0x3c')]['find'](_0x161b6c)['then'](handleEntityNotFound(_0x2ae78d,null))['then'](respondWithResult(_0x2ae78d,null))[_0x7d46('0x3e')](handleError(_0x2ae78d,null));};exports[_0x7d46('0x41')]=function(_0x13b7f7,_0xde25c8){return db[_0x7d46('0x3c')][_0x7d46('0x41')](_0x13b7f7[_0x7d46('0x42')],{})[_0x7d46('0x21')](respondWithResult(_0xde25c8,0xc9))[_0x7d46('0x3e')](handleError(_0xde25c8,null));};exports[_0x7d46('0x1f')]=function(_0x4ecc5c,_0x1adca3){if(_0x4ecc5c[_0x7d46('0x42')]['id']){delete _0x4ecc5c[_0x7d46('0x42')]['id'];}return db['VtigerAccount'][_0x7d46('0x43')]({'where':{'id':_0x4ecc5c[_0x7d46('0x44')]['id']}})[_0x7d46('0x21')](handleEntityNotFound(_0x1adca3,null))[_0x7d46('0x21')](saveUpdates(_0x4ecc5c[_0x7d46('0x42')],null))['then'](respondWithResult(_0x1adca3,null))['catch'](handleError(_0x1adca3,null));};exports['destroy']=function(_0xe8eb66,_0x12abc5){return db[_0x7d46('0x3c')][_0x7d46('0x43')]({'where':{'id':_0xe8eb66[_0x7d46('0x44')]['id']}})['then'](handleEntityNotFound(_0x12abc5,null))[_0x7d46('0x21')](removeEntity(_0x12abc5,null))[_0x7d46('0x3e')](handleError(_0x12abc5,null));};exports[_0x7d46('0x45')]=function(_0x4f8411,_0x2124db,_0x411bae){var _0x41d9df={};var _0x2e9307={};var _0x868618;var _0xbe4f7a;return db[_0x7d46('0x3c')][_0x7d46('0x46')]({'where':{'id':_0x4f8411[_0x7d46('0x44')]['id']}})[_0x7d46('0x21')](handleEntityNotFound(_0x2124db,null))[_0x7d46('0x21')](function(_0x1db223){if(_0x1db223){_0x868618=_0x1db223;_0x2e9307[_0x7d46('0x2e')]=_[_0x7d46('0x2b')](db[_0x7d46('0x47')][_0x7d46('0x26')]);_0x2e9307['query']=_[_0x7d46('0x2b')](_0x4f8411['query']);_0x2e9307[_0x7d46('0x2c')]=_[_0x7d46('0x2d')](_0x2e9307['model'],_0x2e9307[_0x7d46('0x2a')]);_0x41d9df[_0x7d46('0x30')]=_[_0x7d46('0x2d')](_0x2e9307['model'],qs[_0x7d46('0x2f')](_0x4f8411[_0x7d46('0x2a')]['fields']));_0x41d9df[_0x7d46('0x30')]=_0x41d9df[_0x7d46('0x30')][_0x7d46('0x31')]?_0x41d9df[_0x7d46('0x30')]:_0x2e9307[_0x7d46('0x2e')];_0x41d9df[_0x7d46('0x35')]=qs['sort'](_0x4f8411[_0x7d46('0x2a')][_0x7d46('0x36')]);_0x41d9df[_0x7d46('0x39')]=qs['filters'](_[_0x7d46('0x37')](_0x4f8411[_0x7d46('0x2a')],_0x2e9307[_0x7d46('0x2c')]));if(_0x4f8411['query'][_0x7d46('0x38')]){_0x41d9df['where']=_[_0x7d46('0x3a')](_0x41d9df['where'],{'$or':_[_0x7d46('0x25')](_0x41d9df['attributes'],function(_0x4e3bd1){var _0x5a3417={};_0x5a3417[_0x4e3bd1]={'$like':'%'+_0x4f8411[_0x7d46('0x2a')][_0x7d46('0x38')]+'%'};return _0x5a3417;})});}_0x41d9df=_[_0x7d46('0x3a')]({},_0x41d9df,_0x4f8411['options']);return _0x868618[_0x7d46('0x45')](_0x41d9df);}})[_0x7d46('0x21')](function(_0x576ff6){if(_0x576ff6){_0xbe4f7a=_0x576ff6['length'];if(!_0x4f8411['query'][_0x7d46('0x32')]('nolimit')){_0x41d9df['limit']=qs[_0x7d46('0x1b')](_0x4f8411['query'][_0x7d46('0x1b')]);_0x41d9df[_0x7d46('0x34')]=qs[_0x7d46('0x34')](_0x4f8411[_0x7d46('0x2a')]['offset']);}return _0x868618['getConfigurations'](_0x41d9df);}})['then'](function(_0x1b3825){if(_0x1b3825){return _0x1b3825?{'count':_0xbe4f7a,'rows':_0x1b3825}:null;}})[_0x7d46('0x21')](respondWithResult(_0x2124db,null))[_0x7d46('0x3e')](handleError(_0x2124db,null));};exports['addConfiguration']=function(_0x47cecd,_0x4c33fa,_0x3e0dcb){if(_0x47cecd[_0x7d46('0x42')]['id']){delete _0x47cecd[_0x7d46('0x42')]['id'];}return db[_0x7d46('0x3c')]['findOne']({'where':{'id':_0x47cecd[_0x7d46('0x44')]['id']}})['then'](handleEntityNotFound(_0x4c33fa,null))[_0x7d46('0x21')](function(_0x1b5ef7){if(_0x1b5ef7){_0x47cecd['body'][_0x7d46('0x48')]=_0x1b5ef7['id'];_0x47cecd[_0x7d46('0x42')][_0x7d46('0x49')]=integrations[_0x7d46('0x4a')](_0x47cecd['body'][_0x7d46('0x4b')],_0x47cecd[_0x7d46('0x42')][_0x7d46('0x28')]);_0x47cecd[_0x7d46('0x42')][_0x7d46('0x4c')]=integrations[_0x7d46('0x4d')](_0x47cecd['body']['channel'],_0x47cecd['body'][_0x7d46('0x28')]);return db[_0x7d46('0x47')]['create'](_0x47cecd[_0x7d46('0x42')],{'include':[{'model':db[_0x7d46('0x4e')],'as':'Subjects'},{'model':db[_0x7d46('0x4e')],'as':_0x7d46('0x4c')}]});}return null;})[_0x7d46('0x21')](respondWithResult(_0x4c33fa,null))[_0x7d46('0x3e')](handleError(_0x4c33fa,null));};var md5=require(_0x7d46('0x4f'));exports[_0x7d46('0x50')]=function(_0x4dbf1a,_0x1b63b2,_0x8ea1f8){var _0x52aaf2=null;var _0x33108a=null;var _0x121111=null;var _0x1eb3f9=null;var _0x433c4f='';return db[_0x7d46('0x3c')][_0x7d46('0x46')]({'where':{'id':_0x4dbf1a[_0x7d46('0x44')]['id']},'attributes':['id',_0x7d46('0x23'),_0x7d46('0x51'),_0x7d46('0x52'),_0x7d46('0x53'),'remoteUri',_0x7d46('0x54'),_0x7d46('0x55')]})['then'](handleEntityNotFound(_0x1b63b2,null))[_0x7d46('0x21')](function(_0x56232f){if(_0x56232f){_0x52aaf2=_0x56232f[_0x7d46('0x51')];_0x33108a=_0x56232f[_0x7d46('0x55')];_0x121111=_0x56232f[_0x7d46('0x53')];_0x433c4f=_0x56232f[_0x7d46('0x56')];var _0x54c746=_0x433c4f['slice'](-0x1);if(_0x54c746==='/'){_0x433c4f=_0x433c4f['substring'](0x0,_0x433c4f['lastIndexOf'](_0x54c746));}_0x1eb3f9=util[_0x7d46('0x57')](_0x7d46('0x58'),_0x433c4f);var _0x4f1e22={'method':_0x7d46('0x59'),'uri':_0x1eb3f9,'qs':{'operation':_0x7d46('0x5a'),'username':_0x56232f[_0x7d46('0x51')]},'json':!![]};return rp(_0x4f1e22);}})[_0x7d46('0x21')](function(_0x4b99eb){if(_0x4b99eb[_0x7d46('0x5b')]){var _0x42445c={'method':_0x7d46('0x5c'),'uri':_0x1eb3f9,'form':{'operation':_0x7d46('0x5d'),'username':_0x52aaf2,'accessKey':md5(_0x4b99eb[_0x7d46('0x5e')]['token']+_0x33108a)},'json':!![]};return rp(_0x42445c);}})['then'](function(_0x507947){if(_0x507947[_0x7d46('0x5b')]){var _0x60a472={'method':_0x7d46('0x59'),'uri':_0x1eb3f9,'qs':{'operation':_0x7d46('0x5f'),'username':_0x52aaf2,'sessionName':_0x507947[_0x7d46('0x5e')][_0x7d46('0x60')],'elementType':_0x121111},'json':!![]};return rp(_0x60a472);}})[_0x7d46('0x21')](function(_0x44e13b){if(_0x44e13b[_0x7d46('0x5b')]){var _0x1d96ab=[_0x7d46('0x61'),_0x7d46('0x62'),_0x7d46('0x63')];_[_0x7d46('0x64')](_0x44e13b['result'][_0x7d46('0x2f')],function(_0x263b79){return _0x1d96ab[_0x7d46('0x65')](_0x263b79['type'][_0x7d46('0x23')]);});_[_0x7d46('0x64')](_0x44e13b[_0x7d46('0x5e')][_0x7d46('0x2f')],function(_0x4e3f23){return _0x4e3f23[_0x7d46('0x66')]===_0x7d46('0x67');});return{'count':_0x44e13b[_0x7d46('0x5e')][_0x7d46('0x2f')]['length'],'rows':_[_0x7d46('0x25')](_0x44e13b[_0x7d46('0x5e')][_0x7d46('0x2f')],function(_0x35941e){return{'id':_0x35941e[_0x7d46('0x23')],'name':_0x35941e[_0x7d46('0x68')],'custom':_[_0x7d46('0x69')](_0x35941e[_0x7d46('0x23')],'cf_')?!![]:![],'options':_0x35941e[_0x7d46('0x28')][_0x7d46('0x23')]==='picklist'&&_0x35941e[_0x7d46('0x28')]['picklistValues']['length']>0x0?_[_0x7d46('0x25')](_0x35941e[_0x7d46('0x28')][_0x7d46('0x6a')],function(_0x288126){return{'name':_0x288126[_0x7d46('0x68')],'value':_0x288126[_0x7d46('0x6b')]};}):[]};})};}})[_0x7d46('0x21')](respondWithResult(_0x1b63b2,null))[_0x7d46('0x3e')](function(_0x3be65b){console[_0x7d46('0x6c')](_0x7d46('0x6d')+_0x3be65b);var _0x35ea97=_0x4dbf1a['query'][_0x7d46('0x6e')]?0x1f4:_0x3be65b[_0x7d46('0x6f')]||0x1f4;logger[_0x7d46('0x22')](_0x7d46('0x70'),'getFields',_0x35ea97,JSON[_0x7d46('0x71')](_0x3be65b));delete _0x3be65b[_0x7d46('0x23')];if(_0x35ea97===0x191){_0x35ea97=0x190;}_0x1b63b2[_0x7d46('0x18')](_0x35ea97)[_0x7d46('0x24')](_0x4dbf1a['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x3be65b[_0x7d46('0x6f')]}:_0x3be65b);});};
\ No newline at end of file
index 3b10d4b..5904ad6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e0c=['define','VtigerAccount','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x5e478f,_0xf6b846){var _0x3750e6=function(_0xe8f774){while(--_0xe8f774){_0x5e478f['push'](_0x5e478f['shift']());}};_0x3750e6(++_0xf6b846);}(_0x6e0c,0x1a6));var _0xc6e0=function(_0x2d398b,_0x5e98f8){_0x2d398b=_0x2d398b-0x0;var _0x5d8b9d=_0x6e0c[_0x2d398b];return _0x5d8b9d;};'use strict';var _=require(_0xc6e0('0x0'));var util=require(_0xc6e0('0x1'));var logger=require(_0xc6e0('0x2'))(_0xc6e0('0x3'));var moment=require(_0xc6e0('0x4'));var BPromise=require('bluebird');var rp=require(_0xc6e0('0x5'));var fs=require('fs');var path=require(_0xc6e0('0x6'));var rimraf=require(_0xc6e0('0x7'));var config=require(_0xc6e0('0x8'));var attributes=require(_0xc6e0('0x9'));var integrations=require(_0xc6e0('0xa'));module[_0xc6e0('0xb')]=function(_0x537b69,_0x54602d){return _0x537b69[_0xc6e0('0xc')](_0xc6e0('0xd'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x69f9=['int_vtiger_accounts','util','api','moment','bluebird','path','../../config/environment','./intVtigerAccount.attributes','define','VtigerAccount'];(function(_0x161448,_0x3373a4){var _0x291faf=function(_0x5b62bc){while(--_0x5b62bc){_0x161448['push'](_0x161448['shift']());}};_0x291faf(++_0x3373a4);}(_0x69f9,0x155));var _0x969f=function(_0x43c579,_0x3d3394){_0x43c579=_0x43c579-0x0;var _0xdf86e1=_0x69f9[_0x43c579];return _0xdf86e1;};'use strict';var _=require('lodash');var util=require(_0x969f('0x0'));var logger=require('../../config/logger')(_0x969f('0x1'));var moment=require(_0x969f('0x2'));var BPromise=require(_0x969f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x969f('0x4'));var rimraf=require('rimraf');var config=require(_0x969f('0x5'));var attributes=require(_0x969f('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x448667,_0x54d1d3){return _0x448667[_0x969f('0x7')](_0x969f('0x8'),attributes,{'tableName':_0x969f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 530f096..33785a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda3f=['GetVtigerAccount','VtigerAccount','findAll','options','raw','attributes','limit','include','map','model','ShowVtigerAccount','find','util','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x54fc68,_0x4d6cd3){var _0x23d6d8=function(_0x4dcf30){while(--_0x4dcf30){_0x54fc68['push'](_0x54fc68['shift']());}};_0x23d6d8(++_0x4d6cd3);}(_0xda3f,0xec));var _0xfda3=function(_0x334df0,_0x4b7222){_0x334df0=_0x334df0-0x0;var _0x467bd1=_0xda3f[_0x334df0];return _0x467bd1;};'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')]('VtigerAccount,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('VtigerAccount,\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);});});}exports[_0xfda3('0x14')]=function(_0x4680bf){var _0xc62ae6=this;return new Promise(function(_0x54a7c6,_0x15ddb9){return db[_0xfda3('0x15')][_0xfda3('0x16')]({'raw':_0x4680bf[_0xfda3('0x17')]?_0x4680bf['options'][_0xfda3('0x18')]===undefined?!![]:![]:!![],'where':_0x4680bf[_0xfda3('0x17')]?_0x4680bf[_0xfda3('0x17')]['where']||null:null,'attributes':_0x4680bf['options']?_0x4680bf[_0xfda3('0x17')][_0xfda3('0x19')]||null:null,'limit':_0x4680bf[_0xfda3('0x17')]?_0x4680bf['options'][_0xfda3('0x1a')]||null:null,'include':_0x4680bf[_0xfda3('0x17')]?_0x4680bf[_0xfda3('0x17')][_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0x4680bf[_0xfda3('0x17')][_0xfda3('0x1b')],function(_0xc6fb9a){return{'model':db[_0xc6fb9a[_0xfda3('0x1d')]],'as':_0xc6fb9a['as'],'attributes':_0xc6fb9a['attributes'],'include':_0xc6fb9a[_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0xc6fb9a[_0xfda3('0x1b')],function(_0x4ae9b9){return{'model':db[_0x4ae9b9[_0xfda3('0x1d')]],'as':_0x4ae9b9['as'],'attributes':_0x4ae9b9[_0xfda3('0x19')],'include':_0x4ae9b9[_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0x4ae9b9[_0xfda3('0x1b')],function(_0xad9f7b){return{'model':db[_0xad9f7b['model']],'as':_0xad9f7b['as'],'attributes':_0xad9f7b[_0xfda3('0x19')]};}):[]};}):[]};}):[]:[]})[_0xfda3('0x8')](function(_0x2bef2b){logger[_0xfda3('0x9')](_0xfda3('0x14'),_0x4680bf);logger['debug'](_0xfda3('0x14'),_0x4680bf,JSON[_0xfda3('0xe')](_0x2bef2b));_0x54a7c6(_0x2bef2b);})[_0xfda3('0x13')](function(_0x474992){logger[_0xfda3('0xf')](_0xfda3('0x14'),_0x474992[_0xfda3('0x11')],_0x4680bf);_0x15ddb9(_0xc62ae6['error'](0x1f4,_0x474992['message']));});});};exports[_0xfda3('0x1e')]=function(_0x4fd277){var _0x4b9d90=this;return new Promise(function(_0x16b4a2,_0x2a5971){return db[_0xfda3('0x15')][_0xfda3('0x1f')]({'raw':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')][_0xfda3('0x18')]===undefined?!![]:![]:!![],'where':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')]['where']||null:null,'attributes':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')][_0xfda3('0x19')]||null:null,'include':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')][_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0x4fd277[_0xfda3('0x17')][_0xfda3('0x1b')],function(_0x59a1c9){return{'model':db[_0x59a1c9['model']],'as':_0x59a1c9['as'],'attributes':_0x59a1c9[_0xfda3('0x19')],'include':_0x59a1c9[_0xfda3('0x1b')]?_['map'](_0x59a1c9[_0xfda3('0x1b')],function(_0xc861d2){return{'model':db[_0xc861d2[_0xfda3('0x1d')]],'as':_0xc861d2['as'],'attributes':_0xc861d2['attributes'],'include':_0xc861d2[_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0xc861d2[_0xfda3('0x1b')],function(_0x3151e6){return{'model':db[_0x3151e6[_0xfda3('0x1d')]],'as':_0x3151e6['as'],'attributes':_0x3151e6['attributes']};}):[]};}):[]};}):[]:[]})[_0xfda3('0x8')](function(_0x2d2043){logger[_0xfda3('0x9')]('ShowVtigerAccount',_0x4fd277);logger[_0xfda3('0xc')]('ShowVtigerAccount',_0x4fd277,JSON[_0xfda3('0xe')](_0x2d2043));_0x16b4a2(_0x2d2043);})[_0xfda3('0x13')](function(_0x43a58a){logger[_0xfda3('0xf')](_0xfda3('0x1e'),_0x43a58a[_0xfda3('0x11')],_0x4fd277);_0x2a5971(_0x4b9d90[_0xfda3('0xf')](0x1f4,_0x43a58a[_0xfda3('0x11')]));});});};
\ No newline at end of file
+var _0xbc9d=['VtigerAccount','options','raw','where','limit','include','model','attributes','map','ShowVtigerAccount','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVtigerAccount'];(function(_0x2e6103,_0x267a69){var _0x5657ac=function(_0x566106){while(--_0x566106){_0x2e6103['push'](_0x2e6103['shift']());}};_0x5657ac(++_0x267a69);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x52267e,_0x23440b){_0x52267e=_0x52267e-0x0;var _0x6feb4f=_0xbc9d[_0x52267e];return _0x6feb4f;};'use strict';var _=require(_0xdbc9('0x0'));var util=require(_0xdbc9('0x1'));var moment=require(_0xdbc9('0x2'));var BPromise=require(_0xdbc9('0x3'));var rs=require(_0xdbc9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdbc9('0x5'))(_0xdbc9('0x6'));var config=require(_0xdbc9('0x7'));var jayson=require(_0xdbc9('0x8'));var client=jayson[_0xdbc9('0x9')][_0xdbc9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x381a0e,_0x4a9246,_0x2dbd23){return new BPromise(function(_0x181f8a,_0x3d4918){return client['request'](_0x381a0e,_0x2dbd23)[_0xdbc9('0xb')](function(_0x53cff1){logger['info'](_0xdbc9('0xc'),_0x4a9246,_0xdbc9('0xd'));logger[_0xdbc9('0xe')](_0xdbc9('0xf'),_0x4a9246,'request\x20sent',JSON[_0xdbc9('0x10')](_0x53cff1));if(_0x53cff1[_0xdbc9('0x11')]){if(_0x53cff1[_0xdbc9('0x11')][_0xdbc9('0x12')]===0x1f4){logger[_0xdbc9('0x11')](_0xdbc9('0xc'),_0x4a9246,_0x53cff1['error']['message']);return _0x3d4918(_0x53cff1[_0xdbc9('0x11')][_0xdbc9('0x13')]);}logger[_0xdbc9('0x11')](_0xdbc9('0xc'),_0x4a9246,_0x53cff1[_0xdbc9('0x11')]['message']);return _0x181f8a(_0x53cff1[_0xdbc9('0x11')][_0xdbc9('0x13')]);}else{logger[_0xdbc9('0x14')]('VtigerAccount,\x20%s,\x20%s',_0x4a9246,_0xdbc9('0xd'));_0x181f8a(_0x53cff1[_0xdbc9('0x15')]['message']);}})[_0xdbc9('0x16')](function(_0x37856d){logger[_0xdbc9('0x11')](_0xdbc9('0xc'),_0x4a9246,_0x37856d);_0x3d4918(_0x37856d);});});}exports[_0xdbc9('0x17')]=function(_0x33f1bd){var _0x9f343d=this;return new Promise(function(_0xc2ddd2,_0x2ad952){return db[_0xdbc9('0x18')]['findAll']({'raw':_0x33f1bd[_0xdbc9('0x19')]?_0x33f1bd['options'][_0xdbc9('0x1a')]===undefined?!![]:![]:!![],'where':_0x33f1bd[_0xdbc9('0x19')]?_0x33f1bd['options'][_0xdbc9('0x1b')]||null:null,'attributes':_0x33f1bd['options']?_0x33f1bd['options']['attributes']||null:null,'limit':_0x33f1bd['options']?_0x33f1bd[_0xdbc9('0x19')][_0xdbc9('0x1c')]||null:null,'include':_0x33f1bd['options']?_0x33f1bd[_0xdbc9('0x19')][_0xdbc9('0x1d')]?_['map'](_0x33f1bd[_0xdbc9('0x19')][_0xdbc9('0x1d')],function(_0x1b1c0d){return{'model':db[_0x1b1c0d[_0xdbc9('0x1e')]],'as':_0x1b1c0d['as'],'attributes':_0x1b1c0d[_0xdbc9('0x1f')],'include':_0x1b1c0d[_0xdbc9('0x1d')]?_[_0xdbc9('0x20')](_0x1b1c0d[_0xdbc9('0x1d')],function(_0x3c8c1d){return{'model':db[_0x3c8c1d['model']],'as':_0x3c8c1d['as'],'attributes':_0x3c8c1d[_0xdbc9('0x1f')],'include':_0x3c8c1d[_0xdbc9('0x1d')]?_[_0xdbc9('0x20')](_0x3c8c1d[_0xdbc9('0x1d')],function(_0x24fdec){return{'model':db[_0x24fdec['model']],'as':_0x24fdec['as'],'attributes':_0x24fdec[_0xdbc9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xdbc9('0xb')](function(_0x5300bd){logger['info'](_0xdbc9('0x17'),_0x33f1bd);logger[_0xdbc9('0xe')](_0xdbc9('0x17'),_0x33f1bd,JSON['stringify'](_0x5300bd));_0xc2ddd2(_0x5300bd);})[_0xdbc9('0x16')](function(_0x539e57){logger['error'](_0xdbc9('0x17'),_0x539e57['message'],_0x33f1bd);_0x2ad952(_0x9f343d['error'](0x1f4,_0x539e57[_0xdbc9('0x13')]));});});};exports[_0xdbc9('0x21')]=function(_0x1cb557){var _0x4db824=this;return new Promise(function(_0x35eaf8,_0x22f8aa){return db['VtigerAccount']['find']({'raw':_0x1cb557[_0xdbc9('0x19')]?_0x1cb557[_0xdbc9('0x19')][_0xdbc9('0x1a')]===undefined?!![]:![]:!![],'where':_0x1cb557[_0xdbc9('0x19')]?_0x1cb557[_0xdbc9('0x19')][_0xdbc9('0x1b')]||null:null,'attributes':_0x1cb557[_0xdbc9('0x19')]?_0x1cb557['options'][_0xdbc9('0x1f')]||null:null,'include':_0x1cb557[_0xdbc9('0x19')]?_0x1cb557[_0xdbc9('0x19')][_0xdbc9('0x1d')]?_[_0xdbc9('0x20')](_0x1cb557[_0xdbc9('0x19')]['include'],function(_0x1cf210){return{'model':db[_0x1cf210['model']],'as':_0x1cf210['as'],'attributes':_0x1cf210['attributes'],'include':_0x1cf210['include']?_['map'](_0x1cf210['include'],function(_0x321a37){return{'model':db[_0x321a37[_0xdbc9('0x1e')]],'as':_0x321a37['as'],'attributes':_0x321a37[_0xdbc9('0x1f')],'include':_0x321a37['include']?_[_0xdbc9('0x20')](_0x321a37[_0xdbc9('0x1d')],function(_0x2c1053){return{'model':db[_0x2c1053[_0xdbc9('0x1e')]],'as':_0x2c1053['as'],'attributes':_0x2c1053[_0xdbc9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xdbc9('0xb')](function(_0x5bc477){logger[_0xdbc9('0x14')](_0xdbc9('0x21'),_0x1cb557);logger[_0xdbc9('0xe')]('ShowVtigerAccount',_0x1cb557,JSON[_0xdbc9('0x10')](_0x5bc477));_0x35eaf8(_0x5bc477);})[_0xdbc9('0x16')](function(_0x30fa5c){logger[_0xdbc9('0x11')]('ShowVtigerAccount',_0x30fa5c['message'],_0x1cb557);_0x22f8aa(_0x4db824[_0xdbc9('0x11')](0x1f4,_0x30fa5c[_0xdbc9('0x13')]));});});};
\ No newline at end of file
index 1d301a8..2b0d863 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2164=['put','delete','/:id','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x3a7cbc,_0x42ad0d){var _0x505bf2=function(_0x431799){while(--_0x431799){_0x3a7cbc['push'](_0x3a7cbc['shift']());}};_0x505bf2(++_0x42ad0d);}(_0x2164,0xc4));var _0x4216=function(_0xafba1f,_0x2111c6){_0xafba1f=_0xafba1f-0x0;var _0x4c6dcf=_0x2164[_0xafba1f];return _0x4c6dcf;};'use strict';var multer=require(_0x4216('0x0'));var util=require(_0x4216('0x1'));var path=require('path');var timeout=require(_0x4216('0x2'));var express=require(_0x4216('0x3'));var router=express[_0x4216('0x4')]();var fs_extra=require(_0x4216('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4216('0x6'));var config=require(_0x4216('0x7'));var controller=require(_0x4216('0x8'));router[_0x4216('0x9')]('/',auth[_0x4216('0xa')](),controller[_0x4216('0xb')]);router[_0x4216('0x9')]('/:id',auth[_0x4216('0xa')](),controller[_0x4216('0xc')]);router[_0x4216('0x9')](_0x4216('0xd'),auth[_0x4216('0xa')](),controller[_0x4216('0xe')]);router['get'](_0x4216('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x4216('0x9')](_0x4216('0x10'),auth[_0x4216('0xa')](),controller[_0x4216('0x11')]);router[_0x4216('0x12')]('/',auth[_0x4216('0xa')](),controller[_0x4216('0x13')]);router[_0x4216('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x4216('0x15')](_0x4216('0x16'),auth[_0x4216('0xa')](),controller[_0x4216('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0xcc58=['getDescriptions','create','put','update','delete','destroy','multer','util','express','fs-extra','../../config/environment','./intVtigerConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','getFields','/:id/descriptions'];(function(_0x5da63e,_0x4d3503){var _0x442aca=function(_0x6d5bca){while(--_0x6d5bca){_0x5da63e['push'](_0x5da63e['shift']());}};_0x442aca(++_0x4d3503);}(_0xcc58,0x110));var _0x8cc5=function(_0x185dad,_0x5dd568){_0x185dad=_0x185dad-0x0;var _0x50510e=_0xcc58[_0x185dad];return _0x50510e;};'use strict';var multer=require(_0x8cc5('0x0'));var util=require(_0x8cc5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8cc5('0x2'));var router=express['Router']();var fs_extra=require(_0x8cc5('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8cc5('0x4'));var controller=require(_0x8cc5('0x5'));router[_0x8cc5('0x6')]('/',auth['isAuthenticated'](),controller[_0x8cc5('0x7')]);router[_0x8cc5('0x6')](_0x8cc5('0x8'),auth[_0x8cc5('0x9')](),controller['show']);router[_0x8cc5('0x6')](_0x8cc5('0xa'),auth[_0x8cc5('0x9')](),controller[_0x8cc5('0xb')]);router[_0x8cc5('0x6')]('/:id/subjects',auth[_0x8cc5('0x9')](),controller['getSubjects']);router[_0x8cc5('0x6')](_0x8cc5('0xc'),auth[_0x8cc5('0x9')](),controller[_0x8cc5('0xd')]);router['post']('/',auth[_0x8cc5('0x9')](),controller[_0x8cc5('0xe')]);router[_0x8cc5('0xf')]('/:id',auth[_0x8cc5('0x9')](),controller[_0x8cc5('0x10')]);router[_0x8cc5('0x11')](_0x8cc5('0x8'),auth[_0x8cc5('0x9')](),controller[_0x8cc5('0x12')]);module['exports']=router;
\ No newline at end of file
index a0bfef5..9b05523 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa044=['STRING','exports'];(function(_0x10b589,_0x3710f2){var _0x5377a1=function(_0xc65ecb){while(--_0xc65ecb){_0x10b589['push'](_0x10b589['shift']());}};_0x5377a1(++_0x3710f2);}(_0xa044,0x111));var _0x4a04=function(_0x4b4340,_0x295fc0){_0x4b4340=_0x4b4340-0x0;var _0x4cdb42=_0xa044[_0x4b4340];return _0x4cdb42;};'use strict';var Sequelize=require('sequelize');module[_0x4a04('0x0')]={'name':{'type':Sequelize[_0x4a04('0x1')]},'description':{'type':Sequelize[_0x4a04('0x1')]}};
\ No newline at end of file
+var _0xc874=['STRING','sequelize','exports'];(function(_0x484852,_0x368c21){var _0x5890c7=function(_0x3a9c02){while(--_0x3a9c02){_0x484852['push'](_0x484852['shift']());}};_0x5890c7(++_0x368c21);}(_0xc874,0x67));var _0x4c87=function(_0x1e6b59,_0x5eca5d){_0x1e6b59=_0x1e6b59-0x0;var _0x40d7c5=_0xc874[_0x1e6b59];return _0x40d7c5;};'use strict';var Sequelize=require(_0x4c87('0x0'));module[_0x4c87('0x1')]={'name':{'type':Sequelize[_0x4c87('0x2')]},'description':{'type':Sequelize[_0x4c87('0x2')]}};
\ No newline at end of file
index fb0a1d3..db25c75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90db=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','VtigerConfiguration','includeAll','include','findAll','rows','catch','params','length','options','find','body','findOne','VtigerField','getFields','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x5c2766,_0x906188){var _0x254981=function(_0x1c05b3){while(--_0x1c05b3){_0x5c2766['push'](_0x5c2766['shift']());}};_0x254981(++_0x906188);}(_0x90db,0x1c0));var _0xb90d=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x90db[_0x3054be];return _0x3df150;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb90d('0x0'));var zipdir=require(_0xb90d('0x1'));var jsonpatch=require(_0xb90d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb90d('0x3'));var sox=require(_0xb90d('0x4'));var csv=require(_0xb90d('0x5'));var ejs=require(_0xb90d('0x6'));var fs=require('fs');var fs_extra=require(_0xb90d('0x7'));var _=require(_0xb90d('0x8'));var squel=require(_0xb90d('0x9'));var crypto=require(_0xb90d('0xa'));var jsforce=require(_0xb90d('0xb'));var deskjs=require(_0xb90d('0xc'));var toCsv=require(_0xb90d('0x5'));var querystring=require(_0xb90d('0xd'));var Papa=require('papaparse');var Redis=require(_0xb90d('0xe'));var authService=require(_0xb90d('0xf'));var qs=require(_0xb90d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb90d('0x11'));var logger=require(_0xb90d('0x12'))(_0xb90d('0x13'));var utils=require(_0xb90d('0x14'));var config=require(_0xb90d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb90d('0x16'))['db'];function respondWithStatusCode(_0x5bc2b9,_0xe1b1d6){_0xe1b1d6=_0xe1b1d6||0xcc;return function(_0x1d5eed){if(_0x1d5eed){return _0x5bc2b9[_0xb90d('0x17')](_0xe1b1d6);}return _0x5bc2b9[_0xb90d('0x18')](_0xe1b1d6)[_0xb90d('0x19')]();};}function respondWithResult(_0x1152fb,_0x1f797c){_0x1f797c=_0x1f797c||0xc8;return function(_0x56c67c){if(_0x56c67c){return _0x1152fb[_0xb90d('0x18')](_0x1f797c)['json'](_0x56c67c);}};}function respondWithFilteredResult(_0x13dbd5,_0x469d74){return function(_0x5af3c4){if(_0x5af3c4){var _0x1b2324=typeof _0x469d74['offset']===_0xb90d('0x1a')&&typeof _0x469d74[_0xb90d('0x1b')]===_0xb90d('0x1a');var _0x23c136=_0x5af3c4[_0xb90d('0x1c')];var _0x47ee5d=_0x1b2324?0x0:_0x469d74[_0xb90d('0x1d')];var _0x4bd383=_0x1b2324?_0x5af3c4[_0xb90d('0x1c')]:_0x469d74['offset']+_0x469d74['limit'];var _0x73eae9;if(_0x4bd383>=_0x23c136){_0x4bd383=_0x23c136;_0x73eae9=0xc8;}else{_0x73eae9=0xce;}_0x13dbd5[_0xb90d('0x18')](_0x73eae9);return _0x13dbd5[_0xb90d('0x1e')](_0xb90d('0x1f'),_0x47ee5d+'-'+_0x4bd383+'/'+_0x23c136)[_0xb90d('0x20')](_0x5af3c4);}return null;};}function patchUpdates(_0x134076){return function(_0x4d3a04){try{jsonpatch[_0xb90d('0x21')](_0x4d3a04,_0x134076,!![]);}catch(_0x14958c){return BPromise['reject'](_0x14958c);}return _0x4d3a04[_0xb90d('0x22')]();};}function saveUpdates(_0x21d28e,_0x3b3b80){return function(_0x39dcc4){if(_0x39dcc4){return _0x39dcc4[_0xb90d('0x23')](_0x21d28e)[_0xb90d('0x24')](function(_0x818e68){return _0x818e68;});}return null;};}function removeEntity(_0x24f299,_0x37b8ec){return function(_0x1cf8cc){if(_0x1cf8cc){return _0x1cf8cc[_0xb90d('0x25')]()[_0xb90d('0x24')](function(){_0x24f299[_0xb90d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x280ec3,_0x54827c){return function(_0x130cc8){if(!_0x130cc8){_0x280ec3[_0xb90d('0x17')](0x194);}return _0x130cc8;};}function handleError(_0x373246,_0x41273b){_0x41273b=_0x41273b||0x1f4;return function(_0x31aee9){logger[_0xb90d('0x26')](_0x31aee9[_0xb90d('0x27')]);if(_0x31aee9[_0xb90d('0x28')]){delete _0x31aee9[_0xb90d('0x28')];}_0x373246[_0xb90d('0x18')](_0x41273b)['send'](_0x31aee9);};}exports[_0xb90d('0x29')]=function(_0x12022d,_0x9428fe){var _0x112370={},_0x1f9151={},_0x21fcea={'count':0x0,'rows':[]};var _0x480d90=_['map'](db['VtigerConfiguration'][_0xb90d('0x2a')],function(_0x506aa0){return{'name':_0x506aa0[_0xb90d('0x2b')],'type':_0x506aa0[_0xb90d('0x2c')]['key']};});_0x1f9151[_0xb90d('0x2d')]=_[_0xb90d('0x2e')](_0x480d90,_0xb90d('0x28'));_0x1f9151[_0xb90d('0x2f')]=_[_0xb90d('0x30')](_0x12022d[_0xb90d('0x2f')]);_0x1f9151[_0xb90d('0x31')]=_[_0xb90d('0x32')](_0x1f9151[_0xb90d('0x2d')],_0x1f9151[_0xb90d('0x2f')]);_0x112370[_0xb90d('0x33')]=_[_0xb90d('0x32')](_0x1f9151[_0xb90d('0x2d')],qs[_0xb90d('0x34')](_0x12022d[_0xb90d('0x2f')][_0xb90d('0x34')]));_0x112370[_0xb90d('0x33')]=_0x112370[_0xb90d('0x33')]['length']?_0x112370['attributes']:_0x1f9151[_0xb90d('0x2d')];if(!_0x12022d[_0xb90d('0x2f')][_0xb90d('0x35')](_0xb90d('0x36'))){_0x112370[_0xb90d('0x1b')]=qs[_0xb90d('0x1b')](_0x12022d[_0xb90d('0x2f')]['limit']);_0x112370[_0xb90d('0x1d')]=qs['offset'](_0x12022d[_0xb90d('0x2f')][_0xb90d('0x1d')]);}_0x112370[_0xb90d('0x37')]=qs[_0xb90d('0x38')](_0x12022d[_0xb90d('0x2f')][_0xb90d('0x38')]);_0x112370[_0xb90d('0x39')]=qs[_0xb90d('0x31')](_[_0xb90d('0x3a')](_0x12022d['query'],_0x1f9151[_0xb90d('0x31')]),_0x480d90);if(_0x12022d[_0xb90d('0x2f')][_0xb90d('0x3b')]){_0x112370[_0xb90d('0x39')]=_['merge'](_0x112370[_0xb90d('0x39')],{'$or':_[_0xb90d('0x2e')](_0x480d90,function(_0x1965a6){if(_0x1965a6[_0xb90d('0x2c')]!==_0xb90d('0x3c')){var _0x4adffe={};_0x4adffe[_0x1965a6[_0xb90d('0x28')]]={'$like':'%'+_0x12022d[_0xb90d('0x2f')][_0xb90d('0x3b')]+'%'};return _0x4adffe;}})});}_0x112370=_[_0xb90d('0x3d')]({},_0x112370,_0x12022d['options']);var _0x396258={'where':_0x112370[_0xb90d('0x39')]};return db[_0xb90d('0x3e')][_0xb90d('0x1c')](_0x396258)[_0xb90d('0x24')](function(_0x5180db){_0x21fcea[_0xb90d('0x1c')]=_0x5180db;if(_0x12022d[_0xb90d('0x2f')][_0xb90d('0x3f')]){_0x112370[_0xb90d('0x40')]=[{'all':!![]}];}return db[_0xb90d('0x3e')][_0xb90d('0x41')](_0x112370);})[_0xb90d('0x24')](function(_0x238a36){_0x21fcea[_0xb90d('0x42')]=_0x238a36;return _0x21fcea;})[_0xb90d('0x24')](respondWithFilteredResult(_0x9428fe,_0x112370))[_0xb90d('0x43')](handleError(_0x9428fe,null));};exports['show']=function(_0x200de3,_0x539ac4){var _0x3497c2={'raw':![],'where':{'id':_0x200de3[_0xb90d('0x44')]['id']}},_0x53ad19={};_0x53ad19[_0xb90d('0x2d')]=_[_0xb90d('0x30')](db[_0xb90d('0x3e')][_0xb90d('0x2a')]);_0x53ad19['query']=_[_0xb90d('0x30')](_0x200de3[_0xb90d('0x2f')]);_0x53ad19['filters']=_['intersection'](_0x53ad19['model'],_0x53ad19['query']);_0x3497c2[_0xb90d('0x33')]=_[_0xb90d('0x32')](_0x53ad19['model'],qs[_0xb90d('0x34')](_0x200de3['query'][_0xb90d('0x34')]));_0x3497c2['attributes']=_0x3497c2['attributes'][_0xb90d('0x45')]?_0x3497c2[_0xb90d('0x33')]:_0x53ad19[_0xb90d('0x2d')];if(_0x200de3[_0xb90d('0x2f')][_0xb90d('0x3f')]){_0x3497c2['include']=[{'all':!![]}];}_0x3497c2=_[_0xb90d('0x3d')]({},_0x3497c2,_0x200de3[_0xb90d('0x46')]);return db[_0xb90d('0x3e')][_0xb90d('0x47')](_0x3497c2)[_0xb90d('0x24')](handleEntityNotFound(_0x539ac4,null))[_0xb90d('0x24')](respondWithResult(_0x539ac4,null))[_0xb90d('0x43')](handleError(_0x539ac4,null));};exports['create']=function(_0xcd3b8b,_0x240e0f){return db[_0xb90d('0x3e')]['create'](_0xcd3b8b[_0xb90d('0x48')],{})[_0xb90d('0x24')](respondWithResult(_0x240e0f,0xc9))[_0xb90d('0x43')](handleError(_0x240e0f,null));};exports['update']=function(_0x4a50aa,_0x25e5f5){if(_0x4a50aa[_0xb90d('0x48')]['id']){delete _0x4a50aa[_0xb90d('0x48')]['id'];}return db[_0xb90d('0x3e')][_0xb90d('0x47')]({'where':{'id':_0x4a50aa[_0xb90d('0x44')]['id']}})[_0xb90d('0x24')](handleEntityNotFound(_0x25e5f5,null))[_0xb90d('0x24')](saveUpdates(_0x4a50aa[_0xb90d('0x48')],null))[_0xb90d('0x24')](respondWithResult(_0x25e5f5,null))[_0xb90d('0x43')](handleError(_0x25e5f5,null));};exports[_0xb90d('0x25')]=function(_0x3f3c14,_0x45821a){return db['VtigerConfiguration'][_0xb90d('0x47')]({'where':{'id':_0x3f3c14[_0xb90d('0x44')]['id']}})[_0xb90d('0x24')](handleEntityNotFound(_0x45821a,null))['then'](removeEntity(_0x45821a,null))['catch'](handleError(_0x45821a,null));};exports['getFields']=function(_0x1aef13,_0x3d681d,_0x4049ca){var _0x2f286d={};var _0x5a5253={};var _0x2b582d;var _0x24a218;return db[_0xb90d('0x3e')][_0xb90d('0x49')]({'where':{'id':_0x1aef13[_0xb90d('0x44')]['id']}})[_0xb90d('0x24')](handleEntityNotFound(_0x3d681d,null))[_0xb90d('0x24')](function(_0x2ed6a4){if(_0x2ed6a4){_0x2b582d=_0x2ed6a4;_0x5a5253['model']=_[_0xb90d('0x30')](db[_0xb90d('0x4a')]['rawAttributes']);_0x5a5253['query']=_['keys'](_0x1aef13[_0xb90d('0x2f')]);_0x5a5253[_0xb90d('0x31')]=_[_0xb90d('0x32')](_0x5a5253[_0xb90d('0x2d')],_0x5a5253['query']);_0x2f286d[_0xb90d('0x33')]=_['intersection'](_0x5a5253[_0xb90d('0x2d')],qs[_0xb90d('0x34')](_0x1aef13[_0xb90d('0x2f')][_0xb90d('0x34')]));_0x2f286d[_0xb90d('0x33')]=_0x2f286d['attributes']['length']?_0x2f286d[_0xb90d('0x33')]:_0x5a5253[_0xb90d('0x2d')];_0x2f286d[_0xb90d('0x37')]=qs['sort'](_0x1aef13['query'][_0xb90d('0x38')]);_0x2f286d[_0xb90d('0x39')]=qs[_0xb90d('0x31')](_['pick'](_0x1aef13[_0xb90d('0x2f')],_0x5a5253['filters']));if(_0x1aef13[_0xb90d('0x2f')][_0xb90d('0x3b')]){_0x2f286d[_0xb90d('0x39')]=_[_0xb90d('0x3d')](_0x2f286d['where'],{'$or':_['map'](_0x2f286d[_0xb90d('0x33')],function(_0x46d0f8){var _0x5b0777={};_0x5b0777[_0x46d0f8]={'$like':'%'+_0x1aef13[_0xb90d('0x2f')][_0xb90d('0x3b')]+'%'};return _0x5b0777;})});}_0x2f286d=_[_0xb90d('0x3d')]({},_0x2f286d,_0x1aef13[_0xb90d('0x46')]);return _0x2b582d[_0xb90d('0x4b')](_0x2f286d);}})[_0xb90d('0x24')](function(_0xc91141){if(_0xc91141){_0x24a218=_0xc91141[_0xb90d('0x45')];if(!_0x1aef13[_0xb90d('0x2f')]['hasOwnProperty'](_0xb90d('0x36'))){_0x2f286d[_0xb90d('0x1b')]=qs['limit'](_0x1aef13[_0xb90d('0x2f')][_0xb90d('0x1b')]);_0x2f286d[_0xb90d('0x1d')]=qs['offset'](_0x1aef13[_0xb90d('0x2f')][_0xb90d('0x1d')]);}return _0x2b582d['getFields'](_0x2f286d);}})[_0xb90d('0x24')](function(_0xfad567){if(_0xfad567){return _0xfad567?{'count':_0x24a218,'rows':_0xfad567}:null;}})['then'](respondWithResult(_0x3d681d,null))[_0xb90d('0x43')](handleError(_0x3d681d,null));};exports[_0xb90d('0x4c')]=function(_0x26b7cc,_0x2553fa,_0x4b860e){var _0x4eefaa={};var _0x469124={};var _0x249080;var _0x17ad0b;return db[_0xb90d('0x3e')][_0xb90d('0x49')]({'where':{'id':_0x26b7cc[_0xb90d('0x44')]['id']}})[_0xb90d('0x24')](handleEntityNotFound(_0x2553fa,null))[_0xb90d('0x24')](function(_0x3fae7a){if(_0x3fae7a){_0x249080=_0x3fae7a;_0x469124[_0xb90d('0x2d')]=_[_0xb90d('0x30')](db[_0xb90d('0x4a')][_0xb90d('0x2a')]);_0x469124[_0xb90d('0x2f')]=_[_0xb90d('0x30')](_0x26b7cc[_0xb90d('0x2f')]);_0x469124[_0xb90d('0x31')]=_[_0xb90d('0x32')](_0x469124[_0xb90d('0x2d')],_0x469124[_0xb90d('0x2f')]);_0x4eefaa[_0xb90d('0x33')]=_[_0xb90d('0x32')](_0x469124[_0xb90d('0x2d')],qs[_0xb90d('0x34')](_0x26b7cc[_0xb90d('0x2f')]['fields']));_0x4eefaa['attributes']=_0x4eefaa[_0xb90d('0x33')]['length']?_0x4eefaa[_0xb90d('0x33')]:_0x469124[_0xb90d('0x2d')];_0x4eefaa[_0xb90d('0x37')]=qs[_0xb90d('0x38')](_0x26b7cc[_0xb90d('0x2f')][_0xb90d('0x38')]);_0x4eefaa['where']=qs['filters'](_['pick'](_0x26b7cc['query'],_0x469124[_0xb90d('0x31')]));if(_0x26b7cc[_0xb90d('0x2f')]['filter']){_0x4eefaa['where']=_[_0xb90d('0x3d')](_0x4eefaa[_0xb90d('0x39')],{'$or':_[_0xb90d('0x2e')](_0x4eefaa[_0xb90d('0x33')],function(_0x249863){var _0x53ad61={};_0x53ad61[_0x249863]={'$like':'%'+_0x26b7cc[_0xb90d('0x2f')]['filter']+'%'};return _0x53ad61;})});}_0x4eefaa=_['merge']({},_0x4eefaa,_0x26b7cc[_0xb90d('0x46')]);return _0x249080['getSubjects'](_0x4eefaa);}})[_0xb90d('0x24')](function(_0x19e7c8){if(_0x19e7c8){_0x17ad0b=_0x19e7c8['length'];if(!_0x26b7cc[_0xb90d('0x2f')][_0xb90d('0x35')](_0xb90d('0x36'))){_0x4eefaa['limit']=qs[_0xb90d('0x1b')](_0x26b7cc[_0xb90d('0x2f')][_0xb90d('0x1b')]);_0x4eefaa[_0xb90d('0x1d')]=qs[_0xb90d('0x1d')](_0x26b7cc['query'][_0xb90d('0x1d')]);}return _0x249080[_0xb90d('0x4c')](_0x4eefaa);}})[_0xb90d('0x24')](function(_0x4c37e0){if(_0x4c37e0){return _0x4c37e0?{'count':_0x17ad0b,'rows':_0x4c37e0}:null;}})[_0xb90d('0x24')](respondWithResult(_0x2553fa,null))[_0xb90d('0x43')](handleError(_0x2553fa,null));};exports['getDescriptions']=function(_0xeed1e4,_0xb580b6,_0x429d64){var _0x1e8420={};var _0xfaa50d={};var _0x2f1d12;var _0x270da5;return db[_0xb90d('0x3e')]['findOne']({'where':{'id':_0xeed1e4[_0xb90d('0x44')]['id']}})[_0xb90d('0x24')](handleEntityNotFound(_0xb580b6,null))[_0xb90d('0x24')](function(_0x233848){if(_0x233848){_0x2f1d12=_0x233848;_0xfaa50d['model']=_[_0xb90d('0x30')](db['VtigerField'][_0xb90d('0x2a')]);_0xfaa50d[_0xb90d('0x2f')]=_[_0xb90d('0x30')](_0xeed1e4[_0xb90d('0x2f')]);_0xfaa50d[_0xb90d('0x31')]=_['intersection'](_0xfaa50d[_0xb90d('0x2d')],_0xfaa50d['query']);_0x1e8420[_0xb90d('0x33')]=_[_0xb90d('0x32')](_0xfaa50d['model'],qs['fields'](_0xeed1e4[_0xb90d('0x2f')]['fields']));_0x1e8420[_0xb90d('0x33')]=_0x1e8420[_0xb90d('0x33')][_0xb90d('0x45')]?_0x1e8420['attributes']:_0xfaa50d[_0xb90d('0x2d')];_0x1e8420[_0xb90d('0x37')]=qs['sort'](_0xeed1e4[_0xb90d('0x2f')][_0xb90d('0x38')]);_0x1e8420[_0xb90d('0x39')]=qs[_0xb90d('0x31')](_[_0xb90d('0x3a')](_0xeed1e4[_0xb90d('0x2f')],_0xfaa50d[_0xb90d('0x31')]));if(_0xeed1e4[_0xb90d('0x2f')][_0xb90d('0x3b')]){_0x1e8420[_0xb90d('0x39')]=_[_0xb90d('0x3d')](_0x1e8420[_0xb90d('0x39')],{'$or':_['map'](_0x1e8420['attributes'],function(_0x3e95bb){var _0x203845={};_0x203845[_0x3e95bb]={'$like':'%'+_0xeed1e4[_0xb90d('0x2f')][_0xb90d('0x3b')]+'%'};return _0x203845;})});}_0x1e8420=_[_0xb90d('0x3d')]({},_0x1e8420,_0xeed1e4[_0xb90d('0x46')]);return _0x2f1d12[_0xb90d('0x4d')](_0x1e8420);}})['then'](function(_0x40f50c){if(_0x40f50c){_0x270da5=_0x40f50c[_0xb90d('0x45')];if(!_0xeed1e4[_0xb90d('0x2f')][_0xb90d('0x35')](_0xb90d('0x36'))){_0x1e8420[_0xb90d('0x1b')]=qs[_0xb90d('0x1b')](_0xeed1e4[_0xb90d('0x2f')][_0xb90d('0x1b')]);_0x1e8420[_0xb90d('0x1d')]=qs[_0xb90d('0x1d')](_0xeed1e4[_0xb90d('0x2f')]['offset']);}return _0x2f1d12[_0xb90d('0x4d')](_0x1e8420);}})[_0xb90d('0x24')](function(_0x13bce7){if(_0x13bce7){return _0x13bce7?{'count':_0x270da5,'rows':_0x13bce7}:null;}})[_0xb90d('0x24')](respondWithResult(_0xb580b6,null))[_0xb90d('0x43')](handleError(_0xb580b6,null));};
\ No newline at end of file
+var _0xe630=['options','count','includeAll','include','catch','show','params','keys','find','create','body','getFields','findOne','VtigerField','sort','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','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','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','offset','apply','reject','update','then','destroy','error','stack','name','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','filter'];(function(_0xa0d34f,_0x744d21){var _0x2bf58f=function(_0xcc6f7){while(--_0xcc6f7){_0xa0d34f['push'](_0xa0d34f['shift']());}};_0x2bf58f(++_0x744d21);}(_0xe630,0x149));var _0x0e63=function(_0x301dce,_0x5c03c4){_0x301dce=_0x301dce-0x0;var _0x494ac3=_0xe630[_0x301dce];return _0x494ac3;};'use strict';var emlformat=require(_0x0e63('0x0'));var rimraf=require(_0x0e63('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e63('0x2'));var rp=require(_0x0e63('0x3'));var moment=require(_0x0e63('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0e63('0x5'));var util=require(_0x0e63('0x6'));var path=require(_0x0e63('0x7'));var sox=require('sox');var csv=require(_0x0e63('0x8'));var ejs=require(_0x0e63('0x9'));var fs=require('fs');var fs_extra=require(_0x0e63('0xa'));var _=require(_0x0e63('0xb'));var squel=require(_0x0e63('0xc'));var crypto=require('crypto');var jsforce=require(_0x0e63('0xd'));var deskjs=require(_0x0e63('0xe'));var toCsv=require(_0x0e63('0x8'));var querystring=require(_0x0e63('0xf'));var Papa=require(_0x0e63('0x10'));var Redis=require(_0x0e63('0x11'));var authService=require(_0x0e63('0x12'));var qs=require(_0x0e63('0x13'));var as=require(_0x0e63('0x14'));var hardwareService=require(_0x0e63('0x15'));var logger=require(_0x0e63('0x16'))('api');var utils=require(_0x0e63('0x17'));var config=require(_0x0e63('0x18'));var licenseUtil=require(_0x0e63('0x19'));var db=require(_0x0e63('0x1a'))['db'];function respondWithStatusCode(_0x34fd3c,_0x1e8200){_0x1e8200=_0x1e8200||0xcc;return function(_0x1282bc){if(_0x1282bc){return _0x34fd3c[_0x0e63('0x1b')](_0x1e8200);}return _0x34fd3c[_0x0e63('0x1c')](_0x1e8200)['end']();};}function respondWithResult(_0x486f8f,_0xf547b8){_0xf547b8=_0xf547b8||0xc8;return function(_0x29ff63){if(_0x29ff63){return _0x486f8f[_0x0e63('0x1c')](_0xf547b8)[_0x0e63('0x1d')](_0x29ff63);}};}function respondWithFilteredResult(_0x61c395,_0x35643c){return function(_0x47f3e2){if(_0x47f3e2){var _0x5d1f1e=typeof _0x35643c['offset']==='undefined'&&typeof _0x35643c[_0x0e63('0x1e')]===_0x0e63('0x1f');var _0x5c22ad=_0x47f3e2['count'];var _0x4dd1db=_0x5d1f1e?0x0:_0x35643c[_0x0e63('0x20')];var _0x5c01e0=_0x5d1f1e?_0x47f3e2['count']:_0x35643c[_0x0e63('0x20')]+_0x35643c['limit'];var _0xb01f46;if(_0x5c01e0>=_0x5c22ad){_0x5c01e0=_0x5c22ad;_0xb01f46=0xc8;}else{_0xb01f46=0xce;}_0x61c395[_0x0e63('0x1c')](_0xb01f46);return _0x61c395['set']('Content-Range',_0x4dd1db+'-'+_0x5c01e0+'/'+_0x5c22ad)[_0x0e63('0x1d')](_0x47f3e2);}return null;};}function patchUpdates(_0x1dfd60){return function(_0x16f166){try{jsonpatch[_0x0e63('0x21')](_0x16f166,_0x1dfd60,!![]);}catch(_0x305506){return BPromise[_0x0e63('0x22')](_0x305506);}return _0x16f166['save']();};}function saveUpdates(_0xb0d024,_0x23ed8c){return function(_0x2a4f55){if(_0x2a4f55){return _0x2a4f55[_0x0e63('0x23')](_0xb0d024)[_0x0e63('0x24')](function(_0x4ab310){return _0x4ab310;});}return null;};}function removeEntity(_0x51bb78,_0x437878){return function(_0x3aaea5){if(_0x3aaea5){return _0x3aaea5[_0x0e63('0x25')]()[_0x0e63('0x24')](function(){_0x51bb78[_0x0e63('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22bdce,_0x3c7de3){return function(_0x42c9ab){if(!_0x42c9ab){_0x22bdce[_0x0e63('0x1b')](0x194);}return _0x42c9ab;};}function handleError(_0x2f95bf,_0x1dc52c){_0x1dc52c=_0x1dc52c||0x1f4;return function(_0x686f37){logger[_0x0e63('0x26')](_0x686f37[_0x0e63('0x27')]);if(_0x686f37[_0x0e63('0x28')]){delete _0x686f37[_0x0e63('0x28')];}_0x2f95bf['status'](_0x1dc52c)['send'](_0x686f37);};}exports['index']=function(_0x66a314,_0x3961bd){var _0x370dd7={},_0x188326={},_0x2ea651={'count':0x0,'rows':[]};var _0x816b25=_[_0x0e63('0x29')](db[_0x0e63('0x2a')][_0x0e63('0x2b')],function(_0x31fc3e){return{'name':_0x31fc3e[_0x0e63('0x2c')],'type':_0x31fc3e[_0x0e63('0x2d')][_0x0e63('0x2e')]};});_0x188326[_0x0e63('0x2f')]=_[_0x0e63('0x29')](_0x816b25,_0x0e63('0x28'));_0x188326[_0x0e63('0x30')]=_['keys'](_0x66a314[_0x0e63('0x30')]);_0x188326[_0x0e63('0x31')]=_['intersection'](_0x188326[_0x0e63('0x2f')],_0x188326[_0x0e63('0x30')]);_0x370dd7[_0x0e63('0x32')]=_[_0x0e63('0x33')](_0x188326['model'],qs[_0x0e63('0x34')](_0x66a314[_0x0e63('0x30')][_0x0e63('0x34')]));_0x370dd7[_0x0e63('0x32')]=_0x370dd7[_0x0e63('0x32')][_0x0e63('0x35')]?_0x370dd7['attributes']:_0x188326[_0x0e63('0x2f')];if(!_0x66a314[_0x0e63('0x30')][_0x0e63('0x36')](_0x0e63('0x37'))){_0x370dd7[_0x0e63('0x1e')]=qs[_0x0e63('0x1e')](_0x66a314['query'][_0x0e63('0x1e')]);_0x370dd7[_0x0e63('0x20')]=qs[_0x0e63('0x20')](_0x66a314[_0x0e63('0x30')][_0x0e63('0x20')]);}_0x370dd7[_0x0e63('0x38')]=qs['sort'](_0x66a314[_0x0e63('0x30')]['sort']);_0x370dd7[_0x0e63('0x39')]=qs[_0x0e63('0x31')](_[_0x0e63('0x3a')](_0x66a314[_0x0e63('0x30')],_0x188326[_0x0e63('0x31')]),_0x816b25);if(_0x66a314['query']['filter']){_0x370dd7['where']=_[_0x0e63('0x3b')](_0x370dd7[_0x0e63('0x39')],{'$or':_[_0x0e63('0x29')](_0x816b25,function(_0x294b4a){if(_0x294b4a[_0x0e63('0x2d')]!=='VIRTUAL'){var _0x51cc1d={};_0x51cc1d[_0x294b4a[_0x0e63('0x28')]]={'$like':'%'+_0x66a314['query'][_0x0e63('0x3c')]+'%'};return _0x51cc1d;}})});}_0x370dd7=_['merge']({},_0x370dd7,_0x66a314[_0x0e63('0x3d')]);var _0x4813df={'where':_0x370dd7['where']};return db[_0x0e63('0x2a')][_0x0e63('0x3e')](_0x4813df)[_0x0e63('0x24')](function(_0x27e577){_0x2ea651[_0x0e63('0x3e')]=_0x27e577;if(_0x66a314[_0x0e63('0x30')][_0x0e63('0x3f')]){_0x370dd7[_0x0e63('0x40')]=[{'all':!![]}];}return db[_0x0e63('0x2a')]['findAll'](_0x370dd7);})['then'](function(_0x3ae899){_0x2ea651['rows']=_0x3ae899;return _0x2ea651;})[_0x0e63('0x24')](respondWithFilteredResult(_0x3961bd,_0x370dd7))[_0x0e63('0x41')](handleError(_0x3961bd,null));};exports[_0x0e63('0x42')]=function(_0x156ba1,_0x592f38){var _0x18e66f={'raw':![],'where':{'id':_0x156ba1[_0x0e63('0x43')]['id']}},_0x31da43={};_0x31da43[_0x0e63('0x2f')]=_[_0x0e63('0x44')](db[_0x0e63('0x2a')][_0x0e63('0x2b')]);_0x31da43[_0x0e63('0x30')]=_[_0x0e63('0x44')](_0x156ba1[_0x0e63('0x30')]);_0x31da43['filters']=_[_0x0e63('0x33')](_0x31da43[_0x0e63('0x2f')],_0x31da43[_0x0e63('0x30')]);_0x18e66f[_0x0e63('0x32')]=_['intersection'](_0x31da43[_0x0e63('0x2f')],qs[_0x0e63('0x34')](_0x156ba1[_0x0e63('0x30')]['fields']));_0x18e66f[_0x0e63('0x32')]=_0x18e66f[_0x0e63('0x32')][_0x0e63('0x35')]?_0x18e66f['attributes']:_0x31da43[_0x0e63('0x2f')];if(_0x156ba1[_0x0e63('0x30')][_0x0e63('0x3f')]){_0x18e66f[_0x0e63('0x40')]=[{'all':!![]}];}_0x18e66f=_['merge']({},_0x18e66f,_0x156ba1[_0x0e63('0x3d')]);return db['VtigerConfiguration'][_0x0e63('0x45')](_0x18e66f)[_0x0e63('0x24')](handleEntityNotFound(_0x592f38,null))[_0x0e63('0x24')](respondWithResult(_0x592f38,null))[_0x0e63('0x41')](handleError(_0x592f38,null));};exports[_0x0e63('0x46')]=function(_0x1fe731,_0x2437d1){return db[_0x0e63('0x2a')]['create'](_0x1fe731['body'],{})['then'](respondWithResult(_0x2437d1,0xc9))[_0x0e63('0x41')](handleError(_0x2437d1,null));};exports[_0x0e63('0x23')]=function(_0xe3f5b7,_0x478e74){if(_0xe3f5b7[_0x0e63('0x47')]['id']){delete _0xe3f5b7[_0x0e63('0x47')]['id'];}return db[_0x0e63('0x2a')][_0x0e63('0x45')]({'where':{'id':_0xe3f5b7['params']['id']}})['then'](handleEntityNotFound(_0x478e74,null))[_0x0e63('0x24')](saveUpdates(_0xe3f5b7[_0x0e63('0x47')],null))['then'](respondWithResult(_0x478e74,null))[_0x0e63('0x41')](handleError(_0x478e74,null));};exports[_0x0e63('0x25')]=function(_0x3f8dca,_0x5d3550){return db[_0x0e63('0x2a')][_0x0e63('0x45')]({'where':{'id':_0x3f8dca[_0x0e63('0x43')]['id']}})['then'](handleEntityNotFound(_0x5d3550,null))[_0x0e63('0x24')](removeEntity(_0x5d3550,null))[_0x0e63('0x41')](handleError(_0x5d3550,null));};exports[_0x0e63('0x48')]=function(_0x43389e,_0x1b0c5c,_0x443c44){var _0x7f4f0b={};var _0x118418={};var _0x39ba10;var _0x1978b1;return db['VtigerConfiguration'][_0x0e63('0x49')]({'where':{'id':_0x43389e[_0x0e63('0x43')]['id']}})[_0x0e63('0x24')](handleEntityNotFound(_0x1b0c5c,null))[_0x0e63('0x24')](function(_0x241e70){if(_0x241e70){_0x39ba10=_0x241e70;_0x118418[_0x0e63('0x2f')]=_[_0x0e63('0x44')](db[_0x0e63('0x4a')]['rawAttributes']);_0x118418[_0x0e63('0x30')]=_[_0x0e63('0x44')](_0x43389e[_0x0e63('0x30')]);_0x118418[_0x0e63('0x31')]=_[_0x0e63('0x33')](_0x118418[_0x0e63('0x2f')],_0x118418[_0x0e63('0x30')]);_0x7f4f0b[_0x0e63('0x32')]=_[_0x0e63('0x33')](_0x118418[_0x0e63('0x2f')],qs[_0x0e63('0x34')](_0x43389e[_0x0e63('0x30')][_0x0e63('0x34')]));_0x7f4f0b['attributes']=_0x7f4f0b[_0x0e63('0x32')][_0x0e63('0x35')]?_0x7f4f0b['attributes']:_0x118418[_0x0e63('0x2f')];_0x7f4f0b[_0x0e63('0x38')]=qs['sort'](_0x43389e['query'][_0x0e63('0x4b')]);_0x7f4f0b[_0x0e63('0x39')]=qs[_0x0e63('0x31')](_[_0x0e63('0x3a')](_0x43389e[_0x0e63('0x30')],_0x118418[_0x0e63('0x31')]));if(_0x43389e[_0x0e63('0x30')][_0x0e63('0x3c')]){_0x7f4f0b[_0x0e63('0x39')]=_[_0x0e63('0x3b')](_0x7f4f0b[_0x0e63('0x39')],{'$or':_[_0x0e63('0x29')](_0x7f4f0b[_0x0e63('0x32')],function(_0x453be1){var _0x3a338a={};_0x3a338a[_0x453be1]={'$like':'%'+_0x43389e[_0x0e63('0x30')][_0x0e63('0x3c')]+'%'};return _0x3a338a;})});}_0x7f4f0b=_[_0x0e63('0x3b')]({},_0x7f4f0b,_0x43389e[_0x0e63('0x3d')]);return _0x39ba10[_0x0e63('0x48')](_0x7f4f0b);}})[_0x0e63('0x24')](function(_0x322a20){if(_0x322a20){_0x1978b1=_0x322a20[_0x0e63('0x35')];if(!_0x43389e[_0x0e63('0x30')][_0x0e63('0x36')]('nolimit')){_0x7f4f0b[_0x0e63('0x1e')]=qs['limit'](_0x43389e[_0x0e63('0x30')]['limit']);_0x7f4f0b['offset']=qs[_0x0e63('0x20')](_0x43389e[_0x0e63('0x30')][_0x0e63('0x20')]);}return _0x39ba10['getFields'](_0x7f4f0b);}})[_0x0e63('0x24')](function(_0x35f143){if(_0x35f143){return _0x35f143?{'count':_0x1978b1,'rows':_0x35f143}:null;}})[_0x0e63('0x24')](respondWithResult(_0x1b0c5c,null))['catch'](handleError(_0x1b0c5c,null));};exports[_0x0e63('0x4c')]=function(_0xb0365b,_0x597cf2,_0x5b84b3){var _0x3e8ca2={};var _0x4b48fa={};var _0x2d925e;var _0x53f299;return db[_0x0e63('0x2a')][_0x0e63('0x49')]({'where':{'id':_0xb0365b[_0x0e63('0x43')]['id']}})[_0x0e63('0x24')](handleEntityNotFound(_0x597cf2,null))[_0x0e63('0x24')](function(_0x4dc3ca){if(_0x4dc3ca){_0x2d925e=_0x4dc3ca;_0x4b48fa[_0x0e63('0x2f')]=_[_0x0e63('0x44')](db[_0x0e63('0x4a')]['rawAttributes']);_0x4b48fa[_0x0e63('0x30')]=_[_0x0e63('0x44')](_0xb0365b[_0x0e63('0x30')]);_0x4b48fa[_0x0e63('0x31')]=_['intersection'](_0x4b48fa[_0x0e63('0x2f')],_0x4b48fa[_0x0e63('0x30')]);_0x3e8ca2[_0x0e63('0x32')]=_['intersection'](_0x4b48fa[_0x0e63('0x2f')],qs['fields'](_0xb0365b['query'][_0x0e63('0x34')]));_0x3e8ca2[_0x0e63('0x32')]=_0x3e8ca2[_0x0e63('0x32')]['length']?_0x3e8ca2['attributes']:_0x4b48fa[_0x0e63('0x2f')];_0x3e8ca2[_0x0e63('0x38')]=qs[_0x0e63('0x4b')](_0xb0365b[_0x0e63('0x30')][_0x0e63('0x4b')]);_0x3e8ca2[_0x0e63('0x39')]=qs['filters'](_['pick'](_0xb0365b[_0x0e63('0x30')],_0x4b48fa['filters']));if(_0xb0365b[_0x0e63('0x30')]['filter']){_0x3e8ca2['where']=_['merge'](_0x3e8ca2['where'],{'$or':_[_0x0e63('0x29')](_0x3e8ca2[_0x0e63('0x32')],function(_0x2bbeed){var _0x3b641f={};_0x3b641f[_0x2bbeed]={'$like':'%'+_0xb0365b[_0x0e63('0x30')][_0x0e63('0x3c')]+'%'};return _0x3b641f;})});}_0x3e8ca2=_[_0x0e63('0x3b')]({},_0x3e8ca2,_0xb0365b[_0x0e63('0x3d')]);return _0x2d925e[_0x0e63('0x4c')](_0x3e8ca2);}})['then'](function(_0x15e33c){if(_0x15e33c){_0x53f299=_0x15e33c[_0x0e63('0x35')];if(!_0xb0365b[_0x0e63('0x30')][_0x0e63('0x36')](_0x0e63('0x37'))){_0x3e8ca2[_0x0e63('0x1e')]=qs[_0x0e63('0x1e')](_0xb0365b['query'][_0x0e63('0x1e')]);_0x3e8ca2[_0x0e63('0x20')]=qs[_0x0e63('0x20')](_0xb0365b['query'][_0x0e63('0x20')]);}return _0x2d925e[_0x0e63('0x4c')](_0x3e8ca2);}})['then'](function(_0x18a77a){if(_0x18a77a){return _0x18a77a?{'count':_0x53f299,'rows':_0x18a77a}:null;}})[_0x0e63('0x24')](respondWithResult(_0x597cf2,null))[_0x0e63('0x41')](handleError(_0x597cf2,null));};exports[_0x0e63('0x4d')]=function(_0x4ccb54,_0x44f752,_0x2c0786){var _0x514645={};var _0xded22a={};var _0x18ca2c;var _0x2a38c3;return db['VtigerConfiguration'][_0x0e63('0x49')]({'where':{'id':_0x4ccb54[_0x0e63('0x43')]['id']}})['then'](handleEntityNotFound(_0x44f752,null))[_0x0e63('0x24')](function(_0x5b19de){if(_0x5b19de){_0x18ca2c=_0x5b19de;_0xded22a['model']=_['keys'](db['VtigerField']['rawAttributes']);_0xded22a[_0x0e63('0x30')]=_[_0x0e63('0x44')](_0x4ccb54[_0x0e63('0x30')]);_0xded22a[_0x0e63('0x31')]=_[_0x0e63('0x33')](_0xded22a[_0x0e63('0x2f')],_0xded22a['query']);_0x514645[_0x0e63('0x32')]=_['intersection'](_0xded22a[_0x0e63('0x2f')],qs[_0x0e63('0x34')](_0x4ccb54[_0x0e63('0x30')]['fields']));_0x514645[_0x0e63('0x32')]=_0x514645['attributes'][_0x0e63('0x35')]?_0x514645[_0x0e63('0x32')]:_0xded22a[_0x0e63('0x2f')];_0x514645['order']=qs[_0x0e63('0x4b')](_0x4ccb54['query']['sort']);_0x514645[_0x0e63('0x39')]=qs[_0x0e63('0x31')](_['pick'](_0x4ccb54['query'],_0xded22a[_0x0e63('0x31')]));if(_0x4ccb54[_0x0e63('0x30')][_0x0e63('0x3c')]){_0x514645['where']=_[_0x0e63('0x3b')](_0x514645[_0x0e63('0x39')],{'$or':_[_0x0e63('0x29')](_0x514645['attributes'],function(_0x825b2b){var _0x5b612c={};_0x5b612c[_0x825b2b]={'$like':'%'+_0x4ccb54[_0x0e63('0x30')][_0x0e63('0x3c')]+'%'};return _0x5b612c;})});}_0x514645=_[_0x0e63('0x3b')]({},_0x514645,_0x4ccb54[_0x0e63('0x3d')]);return _0x18ca2c['getDescriptions'](_0x514645);}})[_0x0e63('0x24')](function(_0x7b2288){if(_0x7b2288){_0x2a38c3=_0x7b2288[_0x0e63('0x35')];if(!_0x4ccb54[_0x0e63('0x30')][_0x0e63('0x36')](_0x0e63('0x37'))){_0x514645['limit']=qs[_0x0e63('0x1e')](_0x4ccb54[_0x0e63('0x30')]['limit']);_0x514645[_0x0e63('0x20')]=qs['offset'](_0x4ccb54[_0x0e63('0x30')][_0x0e63('0x20')]);}return _0x18ca2c['getDescriptions'](_0x514645);}})[_0x0e63('0x24')](function(_0x3a48d0){if(_0x3a48d0){return _0x3a48d0?{'count':_0x2a38c3,'rows':_0x3a48d0}:null;}})[_0x0e63('0x24')](respondWithResult(_0x44f752,null))[_0x0e63('0x41')](handleError(_0x44f752,null));};
\ No newline at end of file
index e57ee08..c373e78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa974=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','int_vtiger_configurations','lodash','util'];(function(_0x1d5e52,_0x54d389){var _0x1ae308=function(_0x2da518){while(--_0x2da518){_0x1d5e52['push'](_0x1d5e52['shift']());}};_0x1ae308(++_0x54d389);}(_0xa974,0x140));var _0x4a97=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa974[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x4a97('0x0'));var util=require(_0x4a97('0x1'));var logger=require(_0x4a97('0x2'))(_0x4a97('0x3'));var moment=require(_0x4a97('0x4'));var BPromise=require(_0x4a97('0x5'));var rp=require(_0x4a97('0x6'));var fs=require('fs');var path=require(_0x4a97('0x7'));var rimraf=require(_0x4a97('0x8'));var config=require(_0x4a97('0x9'));var attributes=require(_0x4a97('0xa'));module[_0x4a97('0xb')]=function(_0x22cc09,_0x280611){return _0x22cc09[_0x4a97('0xc')]('VtigerConfiguration',attributes,{'tableName':_0x4a97('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x324d=['path','rimraf','../../config/environment','exports','define','int_vtiger_configurations','../../config/logger','api','moment','bluebird'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x324d,0x178));var _0xd324=function(_0x44893e,_0x40df39){_0x44893e=_0x44893e-0x0;var _0x191c22=_0x324d[_0x44893e];return _0x191c22;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd324('0x0'))(_0xd324('0x1'));var moment=require(_0xd324('0x2'));var BPromise=require(_0xd324('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd324('0x4'));var rimraf=require(_0xd324('0x5'));var config=require(_0xd324('0x6'));var attributes=require('./intVtigerConfiguration.attributes');module[_0xd324('0x7')]=function(_0xbe4942,_0xf03230){return _0xbe4942[_0xd324('0x8')]('VtigerConfiguration',attributes,{'tableName':_0xd324('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a7825cc..d247d3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea5a=['lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch'];(function(_0x58daaa,_0x3a432e){var _0x362021=function(_0x3848b2){while(--_0x3848b2){_0x58daaa['push'](_0x58daaa['shift']());}};_0x362021(++_0x3a432e);}(_0xea5a,0x18f));var _0xaea5=function(_0x5af305,_0xaf3cf8){_0x5af305=_0x5af305-0x0;var _0x4d9831=_0xea5a[_0x5af305];return _0x4d9831;};'use strict';var _=require(_0xaea5('0x0'));var util=require('util');var moment=require(_0xaea5('0x1'));var BPromise=require(_0xaea5('0x2'));var rs=require(_0xaea5('0x3'));var fs=require('fs');var Redis=require(_0xaea5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xaea5('0x5'));var logger=require(_0xaea5('0x6'))(_0xaea5('0x7'));var config=require('../../config/environment');var jayson=require(_0xaea5('0x8'));var client=jayson[_0xaea5('0x9')][_0xaea5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43eef0,_0x3ced80,_0x64296b){return new BPromise(function(_0x50ad2f,_0x1e7feb){return client['request'](_0x43eef0,_0x64296b)[_0xaea5('0xb')](function(_0x4f36a6){logger['info'](_0xaea5('0xc'),_0x3ced80,_0xaea5('0xd'));logger[_0xaea5('0xe')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x3ced80,'request\x20sent',JSON[_0xaea5('0xf')](_0x4f36a6));if(_0x4f36a6[_0xaea5('0x10')]){if(_0x4f36a6['error'][_0xaea5('0x11')]===0x1f4){logger[_0xaea5('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x3ced80,_0x4f36a6[_0xaea5('0x10')][_0xaea5('0x12')]);return _0x1e7feb(_0x4f36a6[_0xaea5('0x10')][_0xaea5('0x12')]);}logger[_0xaea5('0x10')](_0xaea5('0xc'),_0x3ced80,_0x4f36a6['error'][_0xaea5('0x12')]);return _0x50ad2f(_0x4f36a6[_0xaea5('0x10')][_0xaea5('0x12')]);}else{logger[_0xaea5('0x13')]('VtigerConfiguration,\x20%s,\x20%s',_0x3ced80,_0xaea5('0xd'));_0x50ad2f(_0x4f36a6['result'][_0xaea5('0x12')]);}})[_0xaea5('0x14')](function(_0x14fa79){logger[_0xaea5('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x3ced80,_0x14fa79);_0x1e7feb(_0x14fa79);});});}
\ No newline at end of file
+var _0x99e4=['client','http','then','info','VtigerConfiguration,\x20%s,\x20%s','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0xd21fe7,_0x225a39){var _0x14d570=function(_0x3c0674){while(--_0x3c0674){_0xd21fe7['push'](_0xd21fe7['shift']());}};_0x14d570(++_0x225a39);}(_0x99e4,0xbd));var _0x499e=function(_0x4f9e31,_0x19881c){_0x4f9e31=_0x4f9e31-0x0;var _0x2f9fc7=_0x99e4[_0x4f9e31];return _0x2f9fc7;};'use strict';var _=require(_0x499e('0x0'));var util=require(_0x499e('0x1'));var moment=require(_0x499e('0x2'));var BPromise=require(_0x499e('0x3'));var rs=require(_0x499e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x499e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x499e('0x6'))(_0x499e('0x7'));var config=require(_0x499e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x499e('0x9')][_0x499e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b15a0,_0x5b9bfb,_0x5b13c8){return new BPromise(function(_0x526835,_0x9e5862){return client['request'](_0x2b15a0,_0x5b13c8)[_0x499e('0xb')](function(_0x30792b){logger[_0x499e('0xc')](_0x499e('0xd'),_0x5b9bfb,'request\x20sent');logger['debug'](_0x499e('0xe'),_0x5b9bfb,'request\x20sent',JSON[_0x499e('0xf')](_0x30792b));if(_0x30792b[_0x499e('0x10')]){if(_0x30792b[_0x499e('0x10')]['code']===0x1f4){logger[_0x499e('0x10')](_0x499e('0xd'),_0x5b9bfb,_0x30792b[_0x499e('0x10')]['message']);return _0x9e5862(_0x30792b[_0x499e('0x10')]['message']);}logger[_0x499e('0x10')](_0x499e('0xd'),_0x5b9bfb,_0x30792b['error'][_0x499e('0x11')]);return _0x526835(_0x30792b[_0x499e('0x10')][_0x499e('0x11')]);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x5b9bfb,'request\x20sent');_0x526835(_0x30792b['result']['message']);}})['catch'](function(_0x44201a){logger[_0x499e('0x10')](_0x499e('0xd'),_0x5b9bfb,_0x44201a);_0x9e5862(_0x44201a);});});}
\ No newline at end of file
index 6aa430b..b0757c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafef=['index','/:id','show','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated'];(function(_0xa1671c,_0x57700d){var _0x2107f0=function(_0x436e27){while(--_0x436e27){_0xa1671c['push'](_0xa1671c['shift']());}};_0x2107f0(++_0x57700d);}(_0xafef,0x82));var _0xfafe=function(_0x1c0e39,_0x31d188){_0x1c0e39=_0x1c0e39-0x0;var _0x3d0554=_0xafef[_0x1c0e39];return _0x3d0554;};'use strict';var multer=require('multer');var util=require(_0xfafe('0x0'));var path=require('path');var timeout=require(_0xfafe('0x1'));var express=require(_0xfafe('0x2'));var router=express['Router']();var fs_extra=require(_0xfafe('0x3'));var auth=require(_0xfafe('0x4'));var interaction=require(_0xfafe('0x5'));var config=require(_0xfafe('0x6'));var controller=require(_0xfafe('0x7'));router[_0xfafe('0x8')]('/',auth[_0xfafe('0x9')](),controller[_0xfafe('0xa')]);router[_0xfafe('0x8')](_0xfafe('0xb'),auth['isAuthenticated'](),controller[_0xfafe('0xc')]);router[_0xfafe('0xd')]('/',auth[_0xfafe('0x9')](),controller[_0xfafe('0xe')]);router[_0xfafe('0xf')](_0xfafe('0xb'),auth[_0xfafe('0x9')](),controller[_0xfafe('0x10')]);router[_0xfafe('0x11')](_0xfafe('0xb'),auth[_0xfafe('0x9')](),controller[_0xfafe('0x12')]);module[_0xfafe('0x13')]=router;
\ No newline at end of file
+var _0x5483=['delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','show','create','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5483,0xa4));var _0x3548=function(_0x4c2f30,_0xa91340){_0x4c2f30=_0x4c2f30-0x0;var _0xb8854d=_0x5483[_0x4c2f30];return _0xb8854d;};'use strict';var multer=require(_0x3548('0x0'));var util=require('util');var path=require(_0x3548('0x1'));var timeout=require(_0x3548('0x2'));var express=require(_0x3548('0x3'));var router=express[_0x3548('0x4')]();var fs_extra=require(_0x3548('0x5'));var auth=require(_0x3548('0x6'));var interaction=require(_0x3548('0x7'));var config=require(_0x3548('0x8'));var controller=require(_0x3548('0x9'));router[_0x3548('0xa')]('/',auth[_0x3548('0xb')](),controller[_0x3548('0xc')]);router[_0x3548('0xa')]('/:id',auth[_0x3548('0xb')](),controller[_0x3548('0xd')]);router['post']('/',auth[_0x3548('0xb')](),controller[_0x3548('0xe')]);router['put'](_0x3548('0xf'),auth[_0x3548('0xb')](),controller['update']);router[_0x3548('0x10')](_0x3548('0xf'),auth['isAuthenticated'](),controller[_0x3548('0x11')]);module['exports']=router;
\ No newline at end of file
index 4b2efe5..5ba80e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf924=['exports','ENUM','variable','customVariable','keyValue','picklist','STRING','string','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf924,0xf2));var _0x4f92=function(_0x122fe6,_0x4ac758){_0x122fe6=_0x122fe6-0x0;var _0x36b7d2=_0xf924[_0x122fe6];return _0x36b7d2;};'use strict';var Sequelize=require(_0x4f92('0x0'));module[_0x4f92('0x1')]={'type':{'type':Sequelize[_0x4f92('0x2')]('string',_0x4f92('0x3'),_0x4f92('0x4'),_0x4f92('0x5'),_0x4f92('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x4f92('0x7')]},'key':{'type':Sequelize[_0x4f92('0x7')]},'keyType':{'type':Sequelize[_0x4f92('0x2')](_0x4f92('0x8'),_0x4f92('0x3'),_0x4f92('0x4'))},'keyContent':{'type':Sequelize[_0x4f92('0x7')]},'idField':{'type':Sequelize[_0x4f92('0x7')]},'nameField':{'type':Sequelize[_0x4f92('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4f92('0x7')]}};
\ No newline at end of file
+var _0x650f=['BOOLEAN','sequelize','exports','ENUM','string','keyValue','picklist','STRING','variable','customVariable'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x650f,0x12d));var _0xf650=function(_0x1c6f10,_0x5eed05){_0x1c6f10=_0x1c6f10-0x0;var _0x5a9683=_0x650f[_0x1c6f10];return _0x5a9683;};'use strict';var Sequelize=require(_0xf650('0x0'));module[_0xf650('0x1')]={'type':{'type':Sequelize[_0xf650('0x2')](_0xf650('0x3'),'variable','customVariable',_0xf650('0x4'),_0xf650('0x5')),'defaultValue':_0xf650('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf650('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xf650('0x3'),_0xf650('0x7'),_0xf650('0x8'))},'keyContent':{'type':Sequelize[_0xf650('0x6')]},'idField':{'type':Sequelize[_0xf650('0x6')]},'nameField':{'type':Sequelize[_0xf650('0x6')]},'customField':{'type':Sequelize[_0xf650('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf650('0x6')]}};
\ No newline at end of file
index 920be40..47640ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad62=['merge','findAll','rows','catch','show','includeAll','include','options','create','body','find','params','destroy','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','end','name','index','map','VtigerField','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x404303,_0xcf6dee){var _0x2bb9e5=function(_0x3a2e12){while(--_0x3a2e12){_0x404303['push'](_0x404303['shift']());}};_0x2bb9e5(++_0xcf6dee);}(_0xad62,0xa1));var _0x2ad6=function(_0x2e6c3a,_0x39199f){_0x2e6c3a=_0x2e6c3a-0x0;var _0x1b36bd=_0xad62[_0x2e6c3a];return _0x1b36bd;};'use strict';var emlformat=require(_0x2ad6('0x0'));var rimraf=require(_0x2ad6('0x1'));var zipdir=require(_0x2ad6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2ad6('0x3'));var moment=require(_0x2ad6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2ad6('0x5'));var util=require(_0x2ad6('0x6'));var path=require(_0x2ad6('0x7'));var sox=require(_0x2ad6('0x8'));var csv=require(_0x2ad6('0x9'));var ejs=require(_0x2ad6('0xa'));var fs=require('fs');var fs_extra=require(_0x2ad6('0xb'));var _=require(_0x2ad6('0xc'));var squel=require('squel');var crypto=require(_0x2ad6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2ad6('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2ad6('0xf'));var Redis=require('ioredis');var authService=require(_0x2ad6('0x10'));var qs=require(_0x2ad6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2ad6('0x12'));var logger=require(_0x2ad6('0x13'))(_0x2ad6('0x14'));var utils=require(_0x2ad6('0x15'));var config=require(_0x2ad6('0x16'));var licenseUtil=require(_0x2ad6('0x17'));var db=require(_0x2ad6('0x18'))['db'];function respondWithStatusCode(_0x422cf0,_0x28b569){_0x28b569=_0x28b569||0xcc;return function(_0xf73629){if(_0xf73629){return _0x422cf0[_0x2ad6('0x19')](_0x28b569);}return _0x422cf0[_0x2ad6('0x1a')](_0x28b569)['end']();};}function respondWithResult(_0x39d02f,_0x3ee814){_0x3ee814=_0x3ee814||0xc8;return function(_0xa37005){if(_0xa37005){return _0x39d02f[_0x2ad6('0x1a')](_0x3ee814)[_0x2ad6('0x1b')](_0xa37005);}};}function respondWithFilteredResult(_0x28c34b,_0x1fc97c){return function(_0x114dd5){if(_0x114dd5){var _0x481f56=typeof _0x1fc97c[_0x2ad6('0x1c')]===_0x2ad6('0x1d')&&typeof _0x1fc97c[_0x2ad6('0x1e')]===_0x2ad6('0x1d');var _0x2146a7=_0x114dd5['count'];var _0x18d498=_0x481f56?0x0:_0x1fc97c[_0x2ad6('0x1c')];var _0x386744=_0x481f56?_0x114dd5[_0x2ad6('0x1f')]:_0x1fc97c[_0x2ad6('0x1c')]+_0x1fc97c[_0x2ad6('0x1e')];var _0x2c8d1f;if(_0x386744>=_0x2146a7){_0x386744=_0x2146a7;_0x2c8d1f=0xc8;}else{_0x2c8d1f=0xce;}_0x28c34b[_0x2ad6('0x1a')](_0x2c8d1f);return _0x28c34b[_0x2ad6('0x20')](_0x2ad6('0x21'),_0x18d498+'-'+_0x386744+'/'+_0x2146a7)[_0x2ad6('0x1b')](_0x114dd5);}return null;};}function patchUpdates(_0x3f8d32){return function(_0x4a743a){try{jsonpatch[_0x2ad6('0x22')](_0x4a743a,_0x3f8d32,!![]);}catch(_0x36a938){return BPromise['reject'](_0x36a938);}return _0x4a743a[_0x2ad6('0x23')]();};}function saveUpdates(_0x3376f2,_0x49e023){return function(_0x58e77c){if(_0x58e77c){return _0x58e77c[_0x2ad6('0x24')](_0x3376f2)['then'](function(_0x11bf3b){return _0x11bf3b;});}return null;};}function removeEntity(_0x340d82,_0x314f60){return function(_0x355a13){if(_0x355a13){return _0x355a13['destroy']()[_0x2ad6('0x25')](function(){_0x340d82[_0x2ad6('0x1a')](0xcc)[_0x2ad6('0x26')]();});}};}function handleEntityNotFound(_0x3e8ba6,_0x5ee545){return function(_0x2ece70){if(!_0x2ece70){_0x3e8ba6[_0x2ad6('0x19')](0x194);}return _0x2ece70;};}function handleError(_0x20145a,_0x29b395){_0x29b395=_0x29b395||0x1f4;return function(_0x45a255){logger['error'](_0x45a255['stack']);if(_0x45a255[_0x2ad6('0x27')]){delete _0x45a255[_0x2ad6('0x27')];}_0x20145a[_0x2ad6('0x1a')](_0x29b395)['send'](_0x45a255);};}exports[_0x2ad6('0x28')]=function(_0x491169,_0x3ad999){var _0x42f78d={},_0x49daaf={},_0x75f20e={'count':0x0,'rows':[]};var _0x4ac1d5=_[_0x2ad6('0x29')](db[_0x2ad6('0x2a')][_0x2ad6('0x2b')],function(_0x148d77){return{'name':_0x148d77['fieldName'],'type':_0x148d77[_0x2ad6('0x2c')][_0x2ad6('0x2d')]};});_0x49daaf['model']=_[_0x2ad6('0x29')](_0x4ac1d5,_0x2ad6('0x27'));_0x49daaf[_0x2ad6('0x2e')]=_[_0x2ad6('0x2f')](_0x491169[_0x2ad6('0x2e')]);_0x49daaf[_0x2ad6('0x30')]=_[_0x2ad6('0x31')](_0x49daaf[_0x2ad6('0x32')],_0x49daaf[_0x2ad6('0x2e')]);_0x42f78d['attributes']=_['intersection'](_0x49daaf[_0x2ad6('0x32')],qs['fields'](_0x491169['query'][_0x2ad6('0x33')]));_0x42f78d[_0x2ad6('0x34')]=_0x42f78d[_0x2ad6('0x34')][_0x2ad6('0x35')]?_0x42f78d[_0x2ad6('0x34')]:_0x49daaf[_0x2ad6('0x32')];if(!_0x491169[_0x2ad6('0x2e')][_0x2ad6('0x36')](_0x2ad6('0x37'))){_0x42f78d[_0x2ad6('0x1e')]=qs['limit'](_0x491169[_0x2ad6('0x2e')]['limit']);_0x42f78d[_0x2ad6('0x1c')]=qs[_0x2ad6('0x1c')](_0x491169['query']['offset']);}_0x42f78d[_0x2ad6('0x38')]=qs[_0x2ad6('0x39')](_0x491169[_0x2ad6('0x2e')][_0x2ad6('0x39')]);_0x42f78d['where']=qs['filters'](_[_0x2ad6('0x3a')](_0x491169['query'],_0x49daaf[_0x2ad6('0x30')]),_0x4ac1d5);if(_0x491169['query'][_0x2ad6('0x3b')]){_0x42f78d[_0x2ad6('0x3c')]=_[_0x2ad6('0x3d')](_0x42f78d[_0x2ad6('0x3c')],{'$or':_['map'](_0x4ac1d5,function(_0x3705d1){if(_0x3705d1[_0x2ad6('0x2c')]!=='VIRTUAL'){var _0x2dbfd1={};_0x2dbfd1[_0x3705d1[_0x2ad6('0x27')]]={'$like':'%'+_0x491169[_0x2ad6('0x2e')][_0x2ad6('0x3b')]+'%'};return _0x2dbfd1;}})});}_0x42f78d=_['merge']({},_0x42f78d,_0x491169['options']);var _0x2f64d1={'where':_0x42f78d[_0x2ad6('0x3c')]};return db[_0x2ad6('0x2a')]['count'](_0x2f64d1)['then'](function(_0x5736d0){_0x75f20e[_0x2ad6('0x1f')]=_0x5736d0;if(_0x491169['query']['includeAll']){_0x42f78d['include']=[{'all':!![]}];}return db[_0x2ad6('0x2a')][_0x2ad6('0x3e')](_0x42f78d);})[_0x2ad6('0x25')](function(_0x108ab3){_0x75f20e[_0x2ad6('0x3f')]=_0x108ab3;return _0x75f20e;})['then'](respondWithFilteredResult(_0x3ad999,_0x42f78d))[_0x2ad6('0x40')](handleError(_0x3ad999,null));};exports[_0x2ad6('0x41')]=function(_0x2f6966,_0x5c2aae){var _0x829dc5={'raw':!![],'where':{'id':_0x2f6966['params']['id']}},_0x56319b={};_0x56319b[_0x2ad6('0x32')]=_[_0x2ad6('0x2f')](db[_0x2ad6('0x2a')]['rawAttributes']);_0x56319b[_0x2ad6('0x2e')]=_['keys'](_0x2f6966[_0x2ad6('0x2e')]);_0x56319b[_0x2ad6('0x30')]=_['intersection'](_0x56319b[_0x2ad6('0x32')],_0x56319b[_0x2ad6('0x2e')]);_0x829dc5['attributes']=_[_0x2ad6('0x31')](_0x56319b[_0x2ad6('0x32')],qs[_0x2ad6('0x33')](_0x2f6966[_0x2ad6('0x2e')][_0x2ad6('0x33')]));_0x829dc5[_0x2ad6('0x34')]=_0x829dc5[_0x2ad6('0x34')][_0x2ad6('0x35')]?_0x829dc5[_0x2ad6('0x34')]:_0x56319b[_0x2ad6('0x32')];if(_0x2f6966[_0x2ad6('0x2e')][_0x2ad6('0x42')]){_0x829dc5[_0x2ad6('0x43')]=[{'all':!![]}];}_0x829dc5=_[_0x2ad6('0x3d')]({},_0x829dc5,_0x2f6966[_0x2ad6('0x44')]);return db[_0x2ad6('0x2a')]['find'](_0x829dc5)[_0x2ad6('0x25')](handleEntityNotFound(_0x5c2aae,null))[_0x2ad6('0x25')](respondWithResult(_0x5c2aae,null))[_0x2ad6('0x40')](handleError(_0x5c2aae,null));};exports[_0x2ad6('0x45')]=function(_0x2e1617,_0x40b3eb){return db[_0x2ad6('0x2a')][_0x2ad6('0x45')](_0x2e1617[_0x2ad6('0x46')],{})[_0x2ad6('0x25')](respondWithResult(_0x40b3eb,0xc9))['catch'](handleError(_0x40b3eb,null));};exports['update']=function(_0x595ff5,_0x119295){if(_0x595ff5[_0x2ad6('0x46')]['id']){delete _0x595ff5[_0x2ad6('0x46')]['id'];}return db[_0x2ad6('0x2a')][_0x2ad6('0x47')]({'where':{'id':_0x595ff5[_0x2ad6('0x48')]['id']}})['then'](handleEntityNotFound(_0x119295,null))[_0x2ad6('0x25')](saveUpdates(_0x595ff5['body'],null))[_0x2ad6('0x25')](respondWithResult(_0x119295,null))[_0x2ad6('0x40')](handleError(_0x119295,null));};exports[_0x2ad6('0x49')]=function(_0x1ed2ba,_0x1ae49c){return db[_0x2ad6('0x2a')]['find']({'where':{'id':_0x1ed2ba[_0x2ad6('0x48')]['id']}})['then'](handleEntityNotFound(_0x1ae49c,null))[_0x2ad6('0x25')](removeEntity(_0x1ae49c,null))['catch'](handleError(_0x1ae49c,null));};
\ No newline at end of file
+var _0x42f1=['name','send','index','map','VtigerField','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','filter','includeAll','findAll','rows','show','params','length','include','options','find','catch','create','body','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack'];(function(_0x4cf89a,_0x460785){var _0x4837f5=function(_0x3c5cc5){while(--_0x3c5cc5){_0x4cf89a['push'](_0x4cf89a['shift']());}};_0x4837f5(++_0x460785);}(_0x42f1,0x1de));var _0x142f=function(_0x3ac3ba,_0x4ecd70){_0x3ac3ba=_0x3ac3ba-0x0;var _0x1b0e56=_0x42f1[_0x3ac3ba];return _0x1b0e56;};'use strict';var emlformat=require(_0x142f('0x0'));var rimraf=require(_0x142f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x142f('0x2'));var moment=require('moment');var BPromise=require(_0x142f('0x3'));var Mustache=require(_0x142f('0x4'));var util=require(_0x142f('0x5'));var path=require(_0x142f('0x6'));var sox=require('sox');var csv=require(_0x142f('0x7'));var ejs=require(_0x142f('0x8'));var fs=require('fs');var fs_extra=require(_0x142f('0x9'));var _=require(_0x142f('0xa'));var squel=require('squel');var crypto=require(_0x142f('0xb'));var jsforce=require(_0x142f('0xc'));var deskjs=require(_0x142f('0xd'));var toCsv=require(_0x142f('0x7'));var querystring=require('querystring');var Papa=require(_0x142f('0xe'));var Redis=require(_0x142f('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x142f('0x10'));var logger=require(_0x142f('0x11'))(_0x142f('0x12'));var utils=require(_0x142f('0x13'));var config=require(_0x142f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x142f('0x15'))['db'];function respondWithStatusCode(_0x3f67fa,_0x3db1af){_0x3db1af=_0x3db1af||0xcc;return function(_0x38092b){if(_0x38092b){return _0x3f67fa[_0x142f('0x16')](_0x3db1af);}return _0x3f67fa['status'](_0x3db1af)[_0x142f('0x17')]();};}function respondWithResult(_0x84ef90,_0x2be061){_0x2be061=_0x2be061||0xc8;return function(_0x3aab8c){if(_0x3aab8c){return _0x84ef90[_0x142f('0x18')](_0x2be061)[_0x142f('0x19')](_0x3aab8c);}};}function respondWithFilteredResult(_0x4d569a,_0x3f8a1c){return function(_0x466d52){if(_0x466d52){var _0x31bfec=typeof _0x3f8a1c[_0x142f('0x1a')]===_0x142f('0x1b')&&typeof _0x3f8a1c[_0x142f('0x1c')]===_0x142f('0x1b');var _0x45ad34=_0x466d52['count'];var _0x59152b=_0x31bfec?0x0:_0x3f8a1c[_0x142f('0x1a')];var _0x30aadc=_0x31bfec?_0x466d52[_0x142f('0x1d')]:_0x3f8a1c[_0x142f('0x1a')]+_0x3f8a1c['limit'];var _0x1f0585;if(_0x30aadc>=_0x45ad34){_0x30aadc=_0x45ad34;_0x1f0585=0xc8;}else{_0x1f0585=0xce;}_0x4d569a['status'](_0x1f0585);return _0x4d569a[_0x142f('0x1e')](_0x142f('0x1f'),_0x59152b+'-'+_0x30aadc+'/'+_0x45ad34)['json'](_0x466d52);}return null;};}function patchUpdates(_0x4830aa){return function(_0x31da4f){try{jsonpatch[_0x142f('0x20')](_0x31da4f,_0x4830aa,!![]);}catch(_0x4090d3){return BPromise[_0x142f('0x21')](_0x4090d3);}return _0x31da4f[_0x142f('0x22')]();};}function saveUpdates(_0x3f657f,_0x8b2d5e){return function(_0x261cf4){if(_0x261cf4){return _0x261cf4[_0x142f('0x23')](_0x3f657f)[_0x142f('0x24')](function(_0x1888fe){return _0x1888fe;});}return null;};}function removeEntity(_0x2b96ab,_0x3df60c){return function(_0x25d2b9){if(_0x25d2b9){return _0x25d2b9[_0x142f('0x25')]()['then'](function(){_0x2b96ab[_0x142f('0x18')](0xcc)[_0x142f('0x17')]();});}};}function handleEntityNotFound(_0x39ecfd,_0x2e0b8a){return function(_0x2f2b52){if(!_0x2f2b52){_0x39ecfd[_0x142f('0x16')](0x194);}return _0x2f2b52;};}function handleError(_0xf04ec4,_0x30a492){_0x30a492=_0x30a492||0x1f4;return function(_0x25d4fd){logger[_0x142f('0x26')](_0x25d4fd[_0x142f('0x27')]);if(_0x25d4fd[_0x142f('0x28')]){delete _0x25d4fd['name'];}_0xf04ec4[_0x142f('0x18')](_0x30a492)[_0x142f('0x29')](_0x25d4fd);};}exports[_0x142f('0x2a')]=function(_0x213451,_0x51ab58){var _0x4de9e8={},_0x1031cf={},_0x40617f={'count':0x0,'rows':[]};var _0x21d728=_[_0x142f('0x2b')](db[_0x142f('0x2c')][_0x142f('0x2d')],function(_0x1a065a){return{'name':_0x1a065a['fieldName'],'type':_0x1a065a[_0x142f('0x2e')][_0x142f('0x2f')]};});_0x1031cf['model']=_[_0x142f('0x2b')](_0x21d728,'name');_0x1031cf[_0x142f('0x30')]=_[_0x142f('0x31')](_0x213451[_0x142f('0x30')]);_0x1031cf[_0x142f('0x32')]=_[_0x142f('0x33')](_0x1031cf[_0x142f('0x34')],_0x1031cf[_0x142f('0x30')]);_0x4de9e8['attributes']=_[_0x142f('0x33')](_0x1031cf[_0x142f('0x34')],qs[_0x142f('0x35')](_0x213451['query'][_0x142f('0x35')]));_0x4de9e8[_0x142f('0x36')]=_0x4de9e8[_0x142f('0x36')]['length']?_0x4de9e8[_0x142f('0x36')]:_0x1031cf['model'];if(!_0x213451['query'][_0x142f('0x37')](_0x142f('0x38'))){_0x4de9e8[_0x142f('0x1c')]=qs[_0x142f('0x1c')](_0x213451['query'][_0x142f('0x1c')]);_0x4de9e8[_0x142f('0x1a')]=qs[_0x142f('0x1a')](_0x213451['query']['offset']);}_0x4de9e8[_0x142f('0x39')]=qs[_0x142f('0x3a')](_0x213451['query'][_0x142f('0x3a')]);_0x4de9e8[_0x142f('0x3b')]=qs[_0x142f('0x32')](_['pick'](_0x213451['query'],_0x1031cf[_0x142f('0x32')]),_0x21d728);if(_0x213451['query']['filter']){_0x4de9e8[_0x142f('0x3b')]=_[_0x142f('0x3c')](_0x4de9e8[_0x142f('0x3b')],{'$or':_[_0x142f('0x2b')](_0x21d728,function(_0x50fe25){if(_0x50fe25[_0x142f('0x2e')]!=='VIRTUAL'){var _0x3c7fba={};_0x3c7fba[_0x50fe25[_0x142f('0x28')]]={'$like':'%'+_0x213451[_0x142f('0x30')][_0x142f('0x3d')]+'%'};return _0x3c7fba;}})});}_0x4de9e8=_[_0x142f('0x3c')]({},_0x4de9e8,_0x213451['options']);var _0x51c752={'where':_0x4de9e8['where']};return db['VtigerField'][_0x142f('0x1d')](_0x51c752)[_0x142f('0x24')](function(_0xbb60aa){_0x40617f['count']=_0xbb60aa;if(_0x213451['query'][_0x142f('0x3e')]){_0x4de9e8['include']=[{'all':!![]}];}return db[_0x142f('0x2c')][_0x142f('0x3f')](_0x4de9e8);})[_0x142f('0x24')](function(_0x1e0176){_0x40617f[_0x142f('0x40')]=_0x1e0176;return _0x40617f;})[_0x142f('0x24')](respondWithFilteredResult(_0x51ab58,_0x4de9e8))['catch'](handleError(_0x51ab58,null));};exports[_0x142f('0x41')]=function(_0x30857f,_0xa8986b){var _0x462054={'raw':!![],'where':{'id':_0x30857f[_0x142f('0x42')]['id']}},_0x43379a={};_0x43379a[_0x142f('0x34')]=_[_0x142f('0x31')](db[_0x142f('0x2c')][_0x142f('0x2d')]);_0x43379a[_0x142f('0x30')]=_['keys'](_0x30857f[_0x142f('0x30')]);_0x43379a['filters']=_[_0x142f('0x33')](_0x43379a['model'],_0x43379a[_0x142f('0x30')]);_0x462054[_0x142f('0x36')]=_['intersection'](_0x43379a[_0x142f('0x34')],qs['fields'](_0x30857f[_0x142f('0x30')][_0x142f('0x35')]));_0x462054[_0x142f('0x36')]=_0x462054[_0x142f('0x36')][_0x142f('0x43')]?_0x462054[_0x142f('0x36')]:_0x43379a[_0x142f('0x34')];if(_0x30857f[_0x142f('0x30')][_0x142f('0x3e')]){_0x462054[_0x142f('0x44')]=[{'all':!![]}];}_0x462054=_['merge']({},_0x462054,_0x30857f[_0x142f('0x45')]);return db[_0x142f('0x2c')][_0x142f('0x46')](_0x462054)['then'](handleEntityNotFound(_0xa8986b,null))['then'](respondWithResult(_0xa8986b,null))[_0x142f('0x47')](handleError(_0xa8986b,null));};exports['create']=function(_0x5dc742,_0x11b4f0){return db[_0x142f('0x2c')][_0x142f('0x48')](_0x5dc742[_0x142f('0x49')],{})[_0x142f('0x24')](respondWithResult(_0x11b4f0,0xc9))['catch'](handleError(_0x11b4f0,null));};exports[_0x142f('0x23')]=function(_0x208a15,_0x12a15b){if(_0x208a15[_0x142f('0x49')]['id']){delete _0x208a15[_0x142f('0x49')]['id'];}return db[_0x142f('0x2c')][_0x142f('0x46')]({'where':{'id':_0x208a15[_0x142f('0x42')]['id']}})[_0x142f('0x24')](handleEntityNotFound(_0x12a15b,null))[_0x142f('0x24')](saveUpdates(_0x208a15[_0x142f('0x49')],null))[_0x142f('0x24')](respondWithResult(_0x12a15b,null))[_0x142f('0x47')](handleError(_0x12a15b,null));};exports[_0x142f('0x25')]=function(_0x4cbb47,_0x5cd021){return db[_0x142f('0x2c')][_0x142f('0x46')]({'where':{'id':_0x4cbb47[_0x142f('0x42')]['id']}})[_0x142f('0x24')](handleEntityNotFound(_0x5cd021,null))[_0x142f('0x24')](removeEntity(_0x5cd021,null))[_0x142f('0x47')](handleError(_0x5cd021,null));};
\ No newline at end of file
index 985b055..d61c8ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca72=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','util'];(function(_0x49554d,_0x2f57a8){var _0x2ead18=function(_0x343f82){while(--_0x343f82){_0x49554d['push'](_0x49554d['shift']());}};_0x2ead18(++_0x2f57a8);}(_0xca72,0x167));var _0x2ca7=function(_0x7275e9,_0x321fa5){_0x7275e9=_0x7275e9-0x0;var _0x17b99d=_0xca72[_0x7275e9];return _0x17b99d;};'use strict';var _=require('lodash');var util=require(_0x2ca7('0x0'));var logger=require(_0x2ca7('0x1'))('api');var moment=require(_0x2ca7('0x2'));var BPromise=require(_0x2ca7('0x3'));var rp=require(_0x2ca7('0x4'));var fs=require('fs');var path=require(_0x2ca7('0x5'));var rimraf=require(_0x2ca7('0x6'));var config=require(_0x2ca7('0x7'));var attributes=require(_0x2ca7('0x8'));module[_0x2ca7('0x9')]=function(_0x53e964,_0x34aaa5){return _0x53e964['define'](_0x2ca7('0xa'),attributes,{'tableName':_0x2ca7('0xb'),'paranoid':![],'indexes':[{'name':_0x2ca7('0xc'),'fields':[_0x2ca7('0xd'),_0x2ca7('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb695=['api','moment','bluebird','request-promise','path','./intVtigerField.attributes','exports','define','idField','lodash','../../config/logger'];(function(_0x24f8db,_0x326bec){var _0x42b15d=function(_0x56c85a){while(--_0x56c85a){_0x24f8db['push'](_0x24f8db['shift']());}};_0x42b15d(++_0x326bec);}(_0xb695,0x106));var _0x5b69=function(_0x24bc67,_0xa66880){_0x24bc67=_0x24bc67-0x0;var _0x2dcddc=_0xb695[_0x24bc67];return _0x2dcddc;};'use strict';var _=require(_0x5b69('0x0'));var util=require('util');var logger=require(_0x5b69('0x1'))(_0x5b69('0x2'));var moment=require(_0x5b69('0x3'));var BPromise=require(_0x5b69('0x4'));var rp=require(_0x5b69('0x5'));var fs=require('fs');var path=require(_0x5b69('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5b69('0x7'));module[_0x5b69('0x8')]=function(_0x55b23f,_0x3fbd40){return _0x55b23f[_0x5b69('0x9')]('VtigerField',attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x5b69('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index bef1a58..c9aefe3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e83=['result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x4be31a,_0xc12132){var _0x1321dc=function(_0x157132){while(--_0x157132){_0x4be31a['push'](_0x4be31a['shift']());}};_0x1321dc(++_0xc12132);}(_0x0e83,0x120));var _0x30e8=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x0e83[_0x5a9c0c];return _0x53c77d;};'use strict';var _=require(_0x30e8('0x0'));var util=require(_0x30e8('0x1'));var moment=require('moment');var BPromise=require(_0x30e8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x30e8('0x3'));var db=require(_0x30e8('0x4'))['db'];var utils=require(_0x30e8('0x5'));var logger=require(_0x30e8('0x6'))(_0x30e8('0x7'));var config=require(_0x30e8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x30e8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x582c0f,_0xe5caf5,_0x4235d9){return new BPromise(function(_0xad1684,_0x5ad1fd){return client[_0x30e8('0xa')](_0x582c0f,_0x4235d9)['then'](function(_0x143d55){logger[_0x30e8('0xb')](_0x30e8('0xc'),_0xe5caf5,'request\x20sent');logger[_0x30e8('0xd')](_0x30e8('0xe'),_0xe5caf5,_0x30e8('0xf'),JSON[_0x30e8('0x10')](_0x143d55));if(_0x143d55[_0x30e8('0x11')]){if(_0x143d55[_0x30e8('0x11')][_0x30e8('0x12')]===0x1f4){logger[_0x30e8('0x11')](_0x30e8('0xc'),_0xe5caf5,_0x143d55['error'][_0x30e8('0x13')]);return _0x5ad1fd(_0x143d55[_0x30e8('0x11')][_0x30e8('0x13')]);}logger[_0x30e8('0x11')]('VtigerField,\x20%s,\x20%s',_0xe5caf5,_0x143d55[_0x30e8('0x11')]['message']);return _0xad1684(_0x143d55[_0x30e8('0x11')][_0x30e8('0x13')]);}else{logger['info'](_0x30e8('0xc'),_0xe5caf5,'request\x20sent');_0xad1684(_0x143d55[_0x30e8('0x14')]['message']);}})[_0x30e8('0x15')](function(_0xf1bbe2){logger[_0x30e8('0x11')](_0x30e8('0xc'),_0xe5caf5,_0xf1bbe2);_0x5ad1fd(_0xf1bbe2);});});}
\ No newline at end of file
+var _0xa4e4=['request\x20sent','stringify','error','code','message','VtigerField,\x20%s,\x20%s','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','then','debug','VtigerField,\x20%s,\x20%s,\x20%s'];(function(_0x2604b6,_0x209920){var _0x5a3be9=function(_0x289957){while(--_0x289957){_0x2604b6['push'](_0x2604b6['shift']());}};_0x5a3be9(++_0x209920);}(_0xa4e4,0x197));var _0x4a4e=function(_0x3e9942,_0x12e0e6){_0x3e9942=_0x3e9942-0x0;var _0x2f7e3f=_0xa4e4[_0x3e9942];return _0x2f7e3f;};'use strict';var _=require('lodash');var util=require(_0x4a4e('0x0'));var moment=require(_0x4a4e('0x1'));var BPromise=require(_0x4a4e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4a4e('0x3'));var db=require(_0x4a4e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4a4e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4a4e('0x6'));var client=jayson[_0x4a4e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33a93d,_0x1bc5aa,_0x5ba15){return new BPromise(function(_0x191f42,_0x1bc6db){return client['request'](_0x33a93d,_0x5ba15)[_0x4a4e('0x8')](function(_0x5b9989){logger['info']('VtigerField,\x20%s,\x20%s',_0x1bc5aa,'request\x20sent');logger[_0x4a4e('0x9')](_0x4a4e('0xa'),_0x1bc5aa,_0x4a4e('0xb'),JSON[_0x4a4e('0xc')](_0x5b9989));if(_0x5b9989[_0x4a4e('0xd')]){if(_0x5b9989[_0x4a4e('0xd')][_0x4a4e('0xe')]===0x1f4){logger[_0x4a4e('0xd')]('VtigerField,\x20%s,\x20%s',_0x1bc5aa,_0x5b9989[_0x4a4e('0xd')][_0x4a4e('0xf')]);return _0x1bc6db(_0x5b9989[_0x4a4e('0xd')][_0x4a4e('0xf')]);}logger['error'](_0x4a4e('0x10'),_0x1bc5aa,_0x5b9989[_0x4a4e('0xd')][_0x4a4e('0xf')]);return _0x191f42(_0x5b9989['error'][_0x4a4e('0xf')]);}else{logger['info'](_0x4a4e('0x10'),_0x1bc5aa,_0x4a4e('0xb'));_0x191f42(_0x5b9989[_0x4a4e('0x11')][_0x4a4e('0xf')]);}})[_0x4a4e('0x12')](function(_0x159909){logger[_0x4a4e('0xd')](_0x4a4e('0x10'),_0x1bc5aa,_0x159909);_0x1bc6db(_0x159909);});});}
\ No newline at end of file
index 12583cb..bddb258 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1f6=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','put','update','delete','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xd1f6,0x121));var _0x6d1f=function(_0x1ad709,_0x218051){_0x1ad709=_0x1ad709-0x0;var _0x2282e3=_0xd1f6[_0x1ad709];return _0x2282e3;};'use strict';var multer=require(_0x6d1f('0x0'));var util=require(_0x6d1f('0x1'));var path=require(_0x6d1f('0x2'));var timeout=require('connect-timeout');var express=require(_0x6d1f('0x3'));var router=express[_0x6d1f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6d1f('0x5'));var interaction=require(_0x6d1f('0x6'));var config=require(_0x6d1f('0x7'));var controller=require(_0x6d1f('0x8'));router[_0x6d1f('0x9')]('/',auth[_0x6d1f('0xa')](),controller[_0x6d1f('0xb')]);router[_0x6d1f('0x9')](_0x6d1f('0xc'),auth[_0x6d1f('0xa')](),controller[_0x6d1f('0xd')]);router[_0x6d1f('0x9')](_0x6d1f('0xe'),auth[_0x6d1f('0xa')](),controller[_0x6d1f('0xf')]);router[_0x6d1f('0x9')](_0x6d1f('0x10'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x6d1f('0xa')](),controller[_0x6d1f('0x11')]);router[_0x6d1f('0x12')](_0x6d1f('0xe'),auth['isAuthenticated'](),controller[_0x6d1f('0x13')]);router[_0x6d1f('0x14')]('/:id',auth[_0x6d1f('0xa')](),controller[_0x6d1f('0x15')]);router[_0x6d1f('0x16')](_0x6d1f('0xc'),auth[_0x6d1f('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xe6af=['/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','destroy','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xe6af,0x106));var _0xfe6a=function(_0x460be6,_0x15d2ba){_0x460be6=_0x460be6-0x0;var _0x2dd2c9=_0xe6af[_0x460be6];return _0x2dd2c9;};'use strict';var multer=require('multer');var util=require(_0xfe6a('0x0'));var path=require(_0xfe6a('0x1'));var timeout=require(_0xfe6a('0x2'));var express=require(_0xfe6a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfe6a('0x4'));var config=require(_0xfe6a('0x5'));var controller=require('./intZendeskAccount.controller');router[_0xfe6a('0x6')]('/',auth[_0xfe6a('0x7')](),controller[_0xfe6a('0x8')]);router[_0xfe6a('0x6')](_0xfe6a('0x9'),auth[_0xfe6a('0x7')](),controller[_0xfe6a('0xa')]);router[_0xfe6a('0x6')](_0xfe6a('0xb'),auth[_0xfe6a('0x7')](),controller[_0xfe6a('0xc')]);router[_0xfe6a('0x6')](_0xfe6a('0xd'),auth[_0xfe6a('0x7')](),controller[_0xfe6a('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfe6a('0xf')]);router[_0xfe6a('0x10')](_0xfe6a('0xb'),auth[_0xfe6a('0x7')](),controller[_0xfe6a('0x11')]);router[_0xfe6a('0x12')](_0xfe6a('0x9'),auth[_0xfe6a('0x7')](),controller[_0xfe6a('0x13')]);router['delete'](_0xfe6a('0x9'),auth[_0xfe6a('0x7')](),controller[_0xfe6a('0x14')]);module['exports']=router;
\ No newline at end of file
index 2d1a2d7..d1ba75e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['integrationTab','newTab','sequelize','exports','STRING','username','remoteUri','password','token','ENUM'];(function(_0x1db29a,_0x5263e6){var _0x53525b=function(_0x469d7d){while(--_0x469d7d){_0x1db29a['push'](_0x1db29a['shift']());}};_0x53525b(++_0x5263e6);}(_0xdb28,0x106));var _0x8db2=function(_0x1f7551,_0x120e96){_0x1f7551=_0x1f7551-0x0;var _0x4ccd77=_0xdb28[_0x1f7551];return _0x4ccd77;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'name':{'type':Sequelize[_0x8db2('0x2')]},'description':{'type':Sequelize[_0x8db2('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x8db2('0x3')},'password':{'type':Sequelize[_0x8db2('0x2')]},'token':{'type':Sequelize[_0x8db2('0x2')]},'remoteUri':{'type':Sequelize[_0x8db2('0x2')],'unique':_0x8db2('0x4')},'authType':{'type':Sequelize['ENUM'](_0x8db2('0x5'),_0x8db2('0x6')),'defaultValue':'password'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x8db2('0x7')](_0x8db2('0x8'),_0x8db2('0x9')),'defaultValue':_0x8db2('0x8')}};
\ No newline at end of file
+var _0x4975=['username','remoteUri','ENUM','password','integrationTab','newTab','sequelize','STRING'];(function(_0x1c3a39,_0x59e97f){var _0xaa8e85=function(_0x46f947){while(--_0x46f947){_0x1c3a39['push'](_0x1c3a39['shift']());}};_0xaa8e85(++_0x59e97f);}(_0x4975,0x86));var _0x5497=function(_0x8a7cf,_0x283427){_0x8a7cf=_0x8a7cf-0x0;var _0x2fa976=_0x4975[_0x8a7cf];return _0x2fa976;};'use strict';var Sequelize=require(_0x5497('0x0'));module['exports']={'name':{'type':Sequelize[_0x5497('0x1')]},'description':{'type':Sequelize[_0x5497('0x1')]},'username':{'type':Sequelize[_0x5497('0x1')],'unique':_0x5497('0x2')},'password':{'type':Sequelize[_0x5497('0x1')]},'token':{'type':Sequelize[_0x5497('0x1')]},'remoteUri':{'type':Sequelize[_0x5497('0x1')],'unique':_0x5497('0x3')},'authType':{'type':Sequelize[_0x5497('0x4')](_0x5497('0x5'),'token'),'defaultValue':_0x5497('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x5497('0x4')](_0x5497('0x6'),_0x5497('0x7')),'defaultValue':'integrationTab'}};
\ No newline at end of file
index 32fc208..736cd42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84a0=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','ZendeskAccount','findAll','rows','show','length','include','find','catch','create','body','update','params','findOne','ZendeskConfiguration','order','getConfigurations','hasOwnProperty','AccountId','Subjects','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','username','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','password','headers','Basic\x20%s','%s:%s','toString','%s/token:%s','token','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','error','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch'];(function(_0x38680c,_0x51a854){var _0x378670=function(_0x4bc7c8){while(--_0x4bc7c8){_0x38680c['push'](_0x38680c['shift']());}};_0x378670(++_0x51a854);}(_0x84a0,0x66));var _0x084a=function(_0x457f47,_0x22dc6c){_0x457f47=_0x457f47-0x0;var _0x43e1ca=_0x84a0[_0x457f47];return _0x43e1ca;};'use strict';var emlformat=require(_0x084a('0x0'));var rimraf=require(_0x084a('0x1'));var zipdir=require(_0x084a('0x2'));var jsonpatch=require(_0x084a('0x3'));var rp=require('request-promise');var moment=require(_0x084a('0x4'));var BPromise=require(_0x084a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x084a('0x6'));var sox=require(_0x084a('0x7'));var csv=require('to-csv');var ejs=require(_0x084a('0x8'));var fs=require('fs');var fs_extra=require(_0x084a('0x9'));var _=require(_0x084a('0xa'));var squel=require(_0x084a('0xb'));var crypto=require(_0x084a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x084a('0xd'));var toCsv=require(_0x084a('0xe'));var querystring=require(_0x084a('0xf'));var Papa=require(_0x084a('0x10'));var Redis=require(_0x084a('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x084a('0x12'));var hardwareService=require(_0x084a('0x13'));var logger=require(_0x084a('0x14'))(_0x084a('0x15'));var utils=require(_0x084a('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x084a('0x17'))['db'];var integrations=require(_0x084a('0x18'));function respondWithStatusCode(_0xec90a5,_0x9245b1){_0x9245b1=_0x9245b1||0xcc;return function(_0x1bdfb8){if(_0x1bdfb8){return _0xec90a5[_0x084a('0x19')](_0x9245b1);}return _0xec90a5[_0x084a('0x1a')](_0x9245b1)[_0x084a('0x1b')]();};}function respondWithResult(_0x5aef40,_0x4277c9){_0x4277c9=_0x4277c9||0xc8;return function(_0x4b9cc5){if(_0x4b9cc5){return _0x5aef40[_0x084a('0x1a')](_0x4277c9)[_0x084a('0x1c')](_0x4b9cc5);}};}function respondWithFilteredResult(_0x366624,_0x2d35b8){return function(_0xd20527){if(_0xd20527){var _0x4cbd16=typeof _0x2d35b8[_0x084a('0x1d')]==='undefined'&&typeof _0x2d35b8[_0x084a('0x1e')]===_0x084a('0x1f');var _0x4af43e=_0xd20527[_0x084a('0x20')];var _0x32c729=_0x4cbd16?0x0:_0x2d35b8[_0x084a('0x1d')];var _0x14bb19=_0x4cbd16?_0xd20527[_0x084a('0x20')]:_0x2d35b8[_0x084a('0x1d')]+_0x2d35b8[_0x084a('0x1e')];var _0x34e86e;if(_0x14bb19>=_0x4af43e){_0x14bb19=_0x4af43e;_0x34e86e=0xc8;}else{_0x34e86e=0xce;}_0x366624[_0x084a('0x1a')](_0x34e86e);return _0x366624[_0x084a('0x21')](_0x084a('0x22'),_0x32c729+'-'+_0x14bb19+'/'+_0x4af43e)[_0x084a('0x1c')](_0xd20527);}return null;};}function patchUpdates(_0x116328){return function(_0x126efb){try{jsonpatch[_0x084a('0x23')](_0x126efb,_0x116328,!![]);}catch(_0x506f71){return BPromise[_0x084a('0x24')](_0x506f71);}return _0x126efb[_0x084a('0x25')]();};}function saveUpdates(_0x41a90f,_0x2d62bf){return function(_0x1c3f6c){if(_0x1c3f6c){return _0x1c3f6c['update'](_0x41a90f)[_0x084a('0x26')](function(_0x288e9e){return _0x288e9e;});}return null;};}function removeEntity(_0x6346a5,_0x1f2c9f){return function(_0x18b43d){if(_0x18b43d){return _0x18b43d[_0x084a('0x27')]()['then'](function(){_0x6346a5[_0x084a('0x1a')](0xcc)[_0x084a('0x1b')]();});}};}function handleEntityNotFound(_0x54233b,_0x5b1474){return function(_0x8806d5){if(!_0x8806d5){_0x54233b[_0x084a('0x19')](0x194);}return _0x8806d5;};}function handleError(_0xfc9b8c,_0x4c5658){_0x4c5658=_0x4c5658||0x1f4;return function(_0x5596ac){logger['error'](_0x5596ac['stack']);if(_0x5596ac[_0x084a('0x28')]){delete _0x5596ac['name'];}_0xfc9b8c['status'](_0x4c5658)['send'](_0x5596ac);};}exports[_0x084a('0x29')]=function(_0x4651e6,_0x388062){var _0x2c4149={},_0x3be7a6={},_0x25a2a1={'count':0x0,'rows':[]};var _0x378de6=_[_0x084a('0x2a')](db['ZendeskAccount'][_0x084a('0x2b')],function(_0x3b2b38){return{'name':_0x3b2b38['fieldName'],'type':_0x3b2b38[_0x084a('0x2c')][_0x084a('0x2d')]};});_0x3be7a6[_0x084a('0x2e')]=_[_0x084a('0x2a')](_0x378de6,_0x084a('0x28'));_0x3be7a6[_0x084a('0x2f')]=_[_0x084a('0x30')](_0x4651e6[_0x084a('0x2f')]);_0x3be7a6[_0x084a('0x31')]=_[_0x084a('0x32')](_0x3be7a6[_0x084a('0x2e')],_0x3be7a6[_0x084a('0x2f')]);_0x2c4149[_0x084a('0x33')]=_['intersection'](_0x3be7a6['model'],qs[_0x084a('0x34')](_0x4651e6[_0x084a('0x2f')][_0x084a('0x34')]));_0x2c4149[_0x084a('0x33')]=_0x2c4149[_0x084a('0x33')]['length']?_0x2c4149[_0x084a('0x33')]:_0x3be7a6[_0x084a('0x2e')];if(!_0x4651e6[_0x084a('0x2f')]['hasOwnProperty'](_0x084a('0x35'))){_0x2c4149[_0x084a('0x1e')]=qs[_0x084a('0x1e')](_0x4651e6['query']['limit']);_0x2c4149['offset']=qs[_0x084a('0x1d')](_0x4651e6[_0x084a('0x2f')][_0x084a('0x1d')]);}_0x2c4149['order']=qs[_0x084a('0x36')](_0x4651e6[_0x084a('0x2f')][_0x084a('0x36')]);_0x2c4149[_0x084a('0x37')]=qs[_0x084a('0x31')](_[_0x084a('0x38')](_0x4651e6[_0x084a('0x2f')],_0x3be7a6[_0x084a('0x31')]),_0x378de6);if(_0x4651e6[_0x084a('0x2f')][_0x084a('0x39')]){_0x2c4149[_0x084a('0x37')]=_[_0x084a('0x3a')](_0x2c4149[_0x084a('0x37')],{'$or':_[_0x084a('0x2a')](_0x378de6,function(_0x10983f){if(_0x10983f['type']!==_0x084a('0x3b')){var _0x1dada8={};_0x1dada8[_0x10983f[_0x084a('0x28')]]={'$like':'%'+_0x4651e6[_0x084a('0x2f')][_0x084a('0x39')]+'%'};return _0x1dada8;}})});}_0x2c4149=_[_0x084a('0x3a')]({},_0x2c4149,_0x4651e6[_0x084a('0x3c')]);var _0x183e10={'where':_0x2c4149[_0x084a('0x37')]};return db['ZendeskAccount'][_0x084a('0x20')](_0x183e10)[_0x084a('0x26')](function(_0x25a081){_0x25a2a1[_0x084a('0x20')]=_0x25a081;if(_0x4651e6[_0x084a('0x2f')][_0x084a('0x3d')]){_0x2c4149['include']=[{'all':!![]}];}return db[_0x084a('0x3e')][_0x084a('0x3f')](_0x2c4149);})['then'](function(_0x410fdb){_0x25a2a1[_0x084a('0x40')]=_0x410fdb;return _0x25a2a1;})[_0x084a('0x26')](respondWithFilteredResult(_0x388062,_0x2c4149))['catch'](handleError(_0x388062,null));};exports[_0x084a('0x41')]=function(_0xba1081,_0x4fe9c2){var _0x3e2b92={'raw':![],'where':{'id':_0xba1081['params']['id']}},_0xfb565c={};_0xfb565c['model']=_[_0x084a('0x30')](db[_0x084a('0x3e')][_0x084a('0x2b')]);_0xfb565c[_0x084a('0x2f')]=_[_0x084a('0x30')](_0xba1081[_0x084a('0x2f')]);_0xfb565c[_0x084a('0x31')]=_[_0x084a('0x32')](_0xfb565c[_0x084a('0x2e')],_0xfb565c[_0x084a('0x2f')]);_0x3e2b92[_0x084a('0x33')]=_['intersection'](_0xfb565c['model'],qs[_0x084a('0x34')](_0xba1081[_0x084a('0x2f')][_0x084a('0x34')]));_0x3e2b92['attributes']=_0x3e2b92[_0x084a('0x33')][_0x084a('0x42')]?_0x3e2b92[_0x084a('0x33')]:_0xfb565c[_0x084a('0x2e')];if(_0xba1081[_0x084a('0x2f')]['includeAll']){_0x3e2b92[_0x084a('0x43')]=[{'all':!![]}];}_0x3e2b92=_['merge']({},_0x3e2b92,_0xba1081[_0x084a('0x3c')]);return db[_0x084a('0x3e')][_0x084a('0x44')](_0x3e2b92)['then'](handleEntityNotFound(_0x4fe9c2,null))['then'](respondWithResult(_0x4fe9c2,null))[_0x084a('0x45')](handleError(_0x4fe9c2,null));};exports[_0x084a('0x46')]=function(_0x505965,_0x29d8c2){return db[_0x084a('0x3e')][_0x084a('0x46')](_0x505965[_0x084a('0x47')],{})['then'](respondWithResult(_0x29d8c2,0xc9))[_0x084a('0x45')](handleError(_0x29d8c2,null));};exports[_0x084a('0x48')]=function(_0x31677b,_0x10856d){if(_0x31677b['body']['id']){delete _0x31677b[_0x084a('0x47')]['id'];}return db[_0x084a('0x3e')][_0x084a('0x44')]({'where':{'id':_0x31677b[_0x084a('0x49')]['id']}})['then'](handleEntityNotFound(_0x10856d,null))['then'](saveUpdates(_0x31677b[_0x084a('0x47')],null))[_0x084a('0x26')](respondWithResult(_0x10856d,null))[_0x084a('0x45')](handleError(_0x10856d,null));};exports[_0x084a('0x27')]=function(_0xf936e,_0x3b2df4){return db[_0x084a('0x3e')][_0x084a('0x44')]({'where':{'id':_0xf936e[_0x084a('0x49')]['id']}})[_0x084a('0x26')](handleEntityNotFound(_0x3b2df4,null))[_0x084a('0x26')](removeEntity(_0x3b2df4,null))[_0x084a('0x45')](handleError(_0x3b2df4,null));};exports['getConfigurations']=function(_0xcdd5b,_0x37fce4,_0x29fa4b){var _0x39edc1={};var _0x2091b1={};var _0x1c972c;var _0xa5362;return db['ZendeskAccount'][_0x084a('0x4a')]({'where':{'id':_0xcdd5b[_0x084a('0x49')]['id']}})[_0x084a('0x26')](handleEntityNotFound(_0x37fce4,null))['then'](function(_0x54ca1f){if(_0x54ca1f){_0x1c972c=_0x54ca1f;_0x2091b1[_0x084a('0x2e')]=_['keys'](db[_0x084a('0x4b')][_0x084a('0x2b')]);_0x2091b1['query']=_[_0x084a('0x30')](_0xcdd5b['query']);_0x2091b1['filters']=_[_0x084a('0x32')](_0x2091b1[_0x084a('0x2e')],_0x2091b1[_0x084a('0x2f')]);_0x39edc1[_0x084a('0x33')]=_[_0x084a('0x32')](_0x2091b1[_0x084a('0x2e')],qs[_0x084a('0x34')](_0xcdd5b['query'][_0x084a('0x34')]));_0x39edc1[_0x084a('0x33')]=_0x39edc1[_0x084a('0x33')]['length']?_0x39edc1[_0x084a('0x33')]:_0x2091b1[_0x084a('0x2e')];_0x39edc1[_0x084a('0x4c')]=qs[_0x084a('0x36')](_0xcdd5b['query'][_0x084a('0x36')]);_0x39edc1['where']=qs[_0x084a('0x31')](_[_0x084a('0x38')](_0xcdd5b[_0x084a('0x2f')],_0x2091b1['filters']));if(_0xcdd5b['query'][_0x084a('0x39')]){_0x39edc1[_0x084a('0x37')]=_['merge'](_0x39edc1[_0x084a('0x37')],{'$or':_['map'](_0x39edc1['attributes'],function(_0x195ae2){var _0x3f3fd7={};_0x3f3fd7[_0x195ae2]={'$like':'%'+_0xcdd5b[_0x084a('0x2f')][_0x084a('0x39')]+'%'};return _0x3f3fd7;})});}_0x39edc1=_[_0x084a('0x3a')]({},_0x39edc1,_0xcdd5b[_0x084a('0x3c')]);return _0x1c972c[_0x084a('0x4d')](_0x39edc1);}})[_0x084a('0x26')](function(_0x114aa5){if(_0x114aa5){_0xa5362=_0x114aa5['length'];if(!_0xcdd5b[_0x084a('0x2f')][_0x084a('0x4e')](_0x084a('0x35'))){_0x39edc1['limit']=qs[_0x084a('0x1e')](_0xcdd5b[_0x084a('0x2f')]['limit']);_0x39edc1[_0x084a('0x1d')]=qs['offset'](_0xcdd5b['query'][_0x084a('0x1d')]);}return _0x1c972c['getConfigurations'](_0x39edc1);}})['then'](function(_0x2368f5){if(_0x2368f5){return _0x2368f5?{'count':_0xa5362,'rows':_0x2368f5}:null;}})[_0x084a('0x26')](respondWithResult(_0x37fce4,null))[_0x084a('0x45')](handleError(_0x37fce4,null));};exports['addConfiguration']=function(_0xff6c9e,_0xbd063c,_0x2311f5){if(_0xff6c9e[_0x084a('0x47')]['id']){delete _0xff6c9e[_0x084a('0x47')]['id'];}return db[_0x084a('0x3e')][_0x084a('0x4a')]({'where':{'id':_0xff6c9e['params']['id']}})['then'](handleEntityNotFound(_0xbd063c,null))[_0x084a('0x26')](function(_0x36ba24){if(_0x36ba24){_0xff6c9e['body'][_0x084a('0x4f')]=_0x36ba24['id'];_0xff6c9e[_0x084a('0x47')][_0x084a('0x50')]=integrations[_0x084a('0x51')](_0xff6c9e['body'][_0x084a('0x52')],_0xff6c9e[_0x084a('0x47')][_0x084a('0x2c')]);_0xff6c9e['body']['Descriptions']=integrations[_0x084a('0x53')](_0xff6c9e[_0x084a('0x47')][_0x084a('0x52')],_0xff6c9e[_0x084a('0x47')][_0x084a('0x2c')]);return db[_0x084a('0x4b')][_0x084a('0x46')](_0xff6c9e['body'],{'include':[{'model':db[_0x084a('0x54')],'as':'Subjects'},{'model':db['ZendeskField'],'as':_0x084a('0x55')}]});}return null;})[_0x084a('0x26')](respondWithResult(_0xbd063c,null))[_0x084a('0x45')](handleError(_0xbd063c,null));};exports['getFields']=function(_0x163a5d,_0x57729c,_0x1eb7be){var _0x1054ea='';return db[_0x084a('0x3e')][_0x084a('0x4a')]({'where':{'id':_0x163a5d[_0x084a('0x49')]['id']},'attributes':['id',_0x084a('0x56'),'password','token',_0x084a('0x57'),_0x084a('0x58')]})[_0x084a('0x26')](handleEntityNotFound(_0x57729c,null))[_0x084a('0x26')](function(_0x22abf5){if(_0x22abf5){_0x1054ea=_0x22abf5[_0x084a('0x58')];var _0x5c655f=_0x1054ea[_0x084a('0x59')](-0x1);if(_0x5c655f==='/'){_0x1054ea=_0x1054ea[_0x084a('0x5a')](0x0,_0x1054ea[_0x084a('0x5b')](_0x5c655f));}var _0x33c040={'method':_0x084a('0x5c'),'uri':util[_0x084a('0x5d')](_0x084a('0x5e'),_0x1054ea,'ticket_fields'),'json':!![]};switch(_0x22abf5[_0x084a('0x57')]){case _0x084a('0x5f'):_0x33c040[_0x084a('0x60')]={'Authorization':util[_0x084a('0x5d')](_0x084a('0x61'),new Buffer(util[_0x084a('0x5d')](_0x084a('0x62'),_0x22abf5[_0x084a('0x56')],_0x22abf5[_0x084a('0x5f')]))[_0x084a('0x63')]('base64'))};break;case'token':_0x33c040['headers']={'Authorization':util[_0x084a('0x5d')](_0x084a('0x61'),new Buffer(util['format'](_0x084a('0x64'),_0x22abf5[_0x084a('0x56')],_0x22abf5[_0x084a('0x65')]))[_0x084a('0x63')]('base64'))};break;default:throw new db['Sequelize'][(_0x084a('0x66'))](_0x084a('0x67'));}return rp(_0x33c040);}})[_0x084a('0x26')](function(_0x37d05a){if(_0x37d05a){var _0x155450=[_0x084a('0x68'),_0x084a('0x69'),'group',_0x084a('0x6a')];_[_0x084a('0x6b')](_0x37d05a[_0x084a('0x6c')],function(_0x137bba){return _0x155450[_0x084a('0x6d')](_0x137bba[_0x084a('0x2c')]);});return{'count':_0x37d05a[_0x084a('0x6c')]['length'],'rows':_[_0x084a('0x2a')](_0x37d05a[_0x084a('0x6c')],function(_0x26a88c){return{'id':_0x26a88c['id'],'name':_0x26a88c[_0x084a('0x6e')]>0x7?_0x26a88c[_0x084a('0x6f')]:_0x26a88c[_0x084a('0x2c')],'custom':_0x26a88c[_0x084a('0x6e')]>0x7?!![]:![],'options':_0x26a88c[_0x084a('0x70')]?_0x26a88c[_0x084a('0x70')]:_0x26a88c[_0x084a('0x71')]?_0x26a88c[_0x084a('0x71')]:[]};})};}})['then'](respondWithResult(_0x57729c,null))[_0x084a('0x45')](function(_0x29916a){var _0x4b8f1f=_0x163a5d[_0x084a('0x2f')]['test']?0x1f4:_0x29916a['statusCode']||0x1f4;logger[_0x084a('0x72')](_0x084a('0x73'),'getFields',_0x4b8f1f,JSON[_0x084a('0x74')](_0x29916a));delete _0x29916a[_0x084a('0x28')];if(_0x4b8f1f===0x191){_0x4b8f1f=0x190;}_0x57729c[_0x084a('0x1a')](_0x4b8f1f)[_0x084a('0x75')](_0x163a5d[_0x084a('0x2f')][_0x084a('0x76')]?{'message':_0x084a('0x77'),'statusCode':_0x29916a[_0x084a('0x78')]}:_0x29916a);});};
\ No newline at end of file
+var _0x2f68=['find','create','body','catch','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','getFields','password','token','authType','remoteUri','substring','lastIndexOf','GET','format','%s/%s','Basic\x20%s','%s:%s','username','toString','Sequelize','Unknown\x20authentication\x20type','subject','description','group','ticket_fields','includes','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','send','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','stack','name','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys'];(function(_0x498abf,_0x35673f){var _0x1a6f72=function(_0x377e60){while(--_0x377e60){_0x498abf['push'](_0x498abf['shift']());}};_0x1a6f72(++_0x35673f);}(_0x2f68,0x9a));var _0x82f6=function(_0x41da1d,_0x5acbe4){_0x41da1d=_0x41da1d-0x0;var _0x1be5ce=_0x2f68[_0x41da1d];return _0x1be5ce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82f6('0x0'));var zipdir=require(_0x82f6('0x1'));var jsonpatch=require(_0x82f6('0x2'));var rp=require(_0x82f6('0x3'));var moment=require('moment');var BPromise=require(_0x82f6('0x4'));var Mustache=require('mustache');var util=require(_0x82f6('0x5'));var path=require(_0x82f6('0x6'));var sox=require('sox');var csv=require(_0x82f6('0x7'));var ejs=require(_0x82f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x82f6('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x82f6('0xa'));var toCsv=require(_0x82f6('0x7'));var querystring=require(_0x82f6('0xb'));var Papa=require('papaparse');var Redis=require(_0x82f6('0xc'));var authService=require(_0x82f6('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x82f6('0xe'));var hardwareService=require(_0x82f6('0xf'));var logger=require(_0x82f6('0x10'))(_0x82f6('0x11'));var utils=require(_0x82f6('0x12'));var config=require(_0x82f6('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x82f6('0x14'))['db'];var integrations=require(_0x82f6('0x15'));function respondWithStatusCode(_0x4cc967,_0x194da7){_0x194da7=_0x194da7||0xcc;return function(_0x1f8bf5){if(_0x1f8bf5){return _0x4cc967[_0x82f6('0x16')](_0x194da7);}return _0x4cc967[_0x82f6('0x17')](_0x194da7)[_0x82f6('0x18')]();};}function respondWithResult(_0xa00275,_0x115c7b){_0x115c7b=_0x115c7b||0xc8;return function(_0x171815){if(_0x171815){return _0xa00275[_0x82f6('0x17')](_0x115c7b)['json'](_0x171815);}};}function respondWithFilteredResult(_0x389949,_0x5d0827){return function(_0x249222){if(_0x249222){var _0x1d0263=typeof _0x5d0827[_0x82f6('0x19')]===_0x82f6('0x1a')&&typeof _0x5d0827[_0x82f6('0x1b')]===_0x82f6('0x1a');var _0x326378=_0x249222[_0x82f6('0x1c')];var _0x4072f0=_0x1d0263?0x0:_0x5d0827[_0x82f6('0x19')];var _0x1c79f9=_0x1d0263?_0x249222[_0x82f6('0x1c')]:_0x5d0827[_0x82f6('0x19')]+_0x5d0827[_0x82f6('0x1b')];var _0x3a8269;if(_0x1c79f9>=_0x326378){_0x1c79f9=_0x326378;_0x3a8269=0xc8;}else{_0x3a8269=0xce;}_0x389949['status'](_0x3a8269);return _0x389949[_0x82f6('0x1d')](_0x82f6('0x1e'),_0x4072f0+'-'+_0x1c79f9+'/'+_0x326378)['json'](_0x249222);}return null;};}function patchUpdates(_0x2b03ad){return function(_0x4b9f0){try{jsonpatch[_0x82f6('0x1f')](_0x4b9f0,_0x2b03ad,!![]);}catch(_0x25cae6){return BPromise['reject'](_0x25cae6);}return _0x4b9f0[_0x82f6('0x20')]();};}function saveUpdates(_0x4beccf,_0x8668bb){return function(_0x2a0ce6){if(_0x2a0ce6){return _0x2a0ce6['update'](_0x4beccf)['then'](function(_0x3af5f7){return _0x3af5f7;});}return null;};}function removeEntity(_0x1d96d5,_0x4c57c5){return function(_0x5a5059){if(_0x5a5059){return _0x5a5059[_0x82f6('0x21')]()[_0x82f6('0x22')](function(){_0x1d96d5['status'](0xcc)[_0x82f6('0x18')]();});}};}function handleEntityNotFound(_0x304e83,_0x5037f8){return function(_0x57ac0d){if(!_0x57ac0d){_0x304e83[_0x82f6('0x16')](0x194);}return _0x57ac0d;};}function handleError(_0x5187d0,_0x469b6b){_0x469b6b=_0x469b6b||0x1f4;return function(_0x5a6d69){logger['error'](_0x5a6d69[_0x82f6('0x23')]);if(_0x5a6d69[_0x82f6('0x24')]){delete _0x5a6d69[_0x82f6('0x24')];}_0x5187d0[_0x82f6('0x17')](_0x469b6b)['send'](_0x5a6d69);};}exports[_0x82f6('0x25')]=function(_0x1fb461,_0x14a309){var _0x400137={},_0x271c28={},_0x328707={'count':0x0,'rows':[]};var _0x27e473=_[_0x82f6('0x26')](db[_0x82f6('0x27')][_0x82f6('0x28')],function(_0x3c9419){return{'name':_0x3c9419[_0x82f6('0x29')],'type':_0x3c9419[_0x82f6('0x2a')][_0x82f6('0x2b')]};});_0x271c28['model']=_[_0x82f6('0x26')](_0x27e473,_0x82f6('0x24'));_0x271c28[_0x82f6('0x2c')]=_['keys'](_0x1fb461[_0x82f6('0x2c')]);_0x271c28[_0x82f6('0x2d')]=_[_0x82f6('0x2e')](_0x271c28[_0x82f6('0x2f')],_0x271c28[_0x82f6('0x2c')]);_0x400137[_0x82f6('0x30')]=_[_0x82f6('0x2e')](_0x271c28[_0x82f6('0x2f')],qs[_0x82f6('0x31')](_0x1fb461[_0x82f6('0x2c')][_0x82f6('0x31')]));_0x400137[_0x82f6('0x30')]=_0x400137[_0x82f6('0x30')][_0x82f6('0x32')]?_0x400137['attributes']:_0x271c28[_0x82f6('0x2f')];if(!_0x1fb461[_0x82f6('0x2c')][_0x82f6('0x33')](_0x82f6('0x34'))){_0x400137[_0x82f6('0x1b')]=qs[_0x82f6('0x1b')](_0x1fb461[_0x82f6('0x2c')][_0x82f6('0x1b')]);_0x400137[_0x82f6('0x19')]=qs[_0x82f6('0x19')](_0x1fb461[_0x82f6('0x2c')][_0x82f6('0x19')]);}_0x400137[_0x82f6('0x35')]=qs[_0x82f6('0x36')](_0x1fb461['query'][_0x82f6('0x36')]);_0x400137['where']=qs['filters'](_[_0x82f6('0x37')](_0x1fb461[_0x82f6('0x2c')],_0x271c28['filters']),_0x27e473);if(_0x1fb461[_0x82f6('0x2c')][_0x82f6('0x38')]){_0x400137[_0x82f6('0x39')]=_['merge'](_0x400137[_0x82f6('0x39')],{'$or':_['map'](_0x27e473,function(_0x2be8cf){if(_0x2be8cf['type']!==_0x82f6('0x3a')){var _0x47ef9e={};_0x47ef9e[_0x2be8cf[_0x82f6('0x24')]]={'$like':'%'+_0x1fb461[_0x82f6('0x2c')]['filter']+'%'};return _0x47ef9e;}})});}_0x400137=_[_0x82f6('0x3b')]({},_0x400137,_0x1fb461[_0x82f6('0x3c')]);var _0x3e7c53={'where':_0x400137[_0x82f6('0x39')]};return db['ZendeskAccount'][_0x82f6('0x1c')](_0x3e7c53)[_0x82f6('0x22')](function(_0x23ea04){_0x328707[_0x82f6('0x1c')]=_0x23ea04;if(_0x1fb461['query'][_0x82f6('0x3d')]){_0x400137[_0x82f6('0x3e')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x82f6('0x3f')](_0x400137);})[_0x82f6('0x22')](function(_0x2d7509){_0x328707[_0x82f6('0x40')]=_0x2d7509;return _0x328707;})[_0x82f6('0x22')](respondWithFilteredResult(_0x14a309,_0x400137))['catch'](handleError(_0x14a309,null));};exports[_0x82f6('0x41')]=function(_0x5786ce,_0x139614){var _0x38e82d={'raw':![],'where':{'id':_0x5786ce[_0x82f6('0x42')]['id']}},_0x32d6b5={};_0x32d6b5[_0x82f6('0x2f')]=_[_0x82f6('0x43')](db[_0x82f6('0x27')]['rawAttributes']);_0x32d6b5[_0x82f6('0x2c')]=_[_0x82f6('0x43')](_0x5786ce[_0x82f6('0x2c')]);_0x32d6b5[_0x82f6('0x2d')]=_['intersection'](_0x32d6b5[_0x82f6('0x2f')],_0x32d6b5['query']);_0x38e82d[_0x82f6('0x30')]=_[_0x82f6('0x2e')](_0x32d6b5[_0x82f6('0x2f')],qs[_0x82f6('0x31')](_0x5786ce[_0x82f6('0x2c')][_0x82f6('0x31')]));_0x38e82d['attributes']=_0x38e82d[_0x82f6('0x30')][_0x82f6('0x32')]?_0x38e82d[_0x82f6('0x30')]:_0x32d6b5[_0x82f6('0x2f')];if(_0x5786ce[_0x82f6('0x2c')][_0x82f6('0x3d')]){_0x38e82d[_0x82f6('0x3e')]=[{'all':!![]}];}_0x38e82d=_[_0x82f6('0x3b')]({},_0x38e82d,_0x5786ce['options']);return db[_0x82f6('0x27')][_0x82f6('0x44')](_0x38e82d)['then'](handleEntityNotFound(_0x139614,null))[_0x82f6('0x22')](respondWithResult(_0x139614,null))['catch'](handleError(_0x139614,null));};exports[_0x82f6('0x45')]=function(_0x5e3321,_0x227ab8){return db[_0x82f6('0x27')][_0x82f6('0x45')](_0x5e3321[_0x82f6('0x46')],{})[_0x82f6('0x22')](respondWithResult(_0x227ab8,0xc9))[_0x82f6('0x47')](handleError(_0x227ab8,null));};exports['update']=function(_0x3cb1f0,_0xdc77ca){if(_0x3cb1f0['body']['id']){delete _0x3cb1f0['body']['id'];}return db[_0x82f6('0x27')][_0x82f6('0x44')]({'where':{'id':_0x3cb1f0[_0x82f6('0x42')]['id']}})['then'](handleEntityNotFound(_0xdc77ca,null))[_0x82f6('0x22')](saveUpdates(_0x3cb1f0[_0x82f6('0x46')],null))[_0x82f6('0x22')](respondWithResult(_0xdc77ca,null))[_0x82f6('0x47')](handleError(_0xdc77ca,null));};exports['destroy']=function(_0x495400,_0x1695ea){return db[_0x82f6('0x27')][_0x82f6('0x44')]({'where':{'id':_0x495400['params']['id']}})[_0x82f6('0x22')](handleEntityNotFound(_0x1695ea,null))[_0x82f6('0x22')](removeEntity(_0x1695ea,null))['catch'](handleError(_0x1695ea,null));};exports['getConfigurations']=function(_0x4fa2ca,_0x2e6b03,_0x4a63a6){var _0x259d83={};var _0x57c023={};var _0x33c359;var _0x4f69de;return db[_0x82f6('0x27')]['findOne']({'where':{'id':_0x4fa2ca[_0x82f6('0x42')]['id']}})[_0x82f6('0x22')](handleEntityNotFound(_0x2e6b03,null))[_0x82f6('0x22')](function(_0x1633cf){if(_0x1633cf){_0x33c359=_0x1633cf;_0x57c023[_0x82f6('0x2f')]=_[_0x82f6('0x43')](db['ZendeskConfiguration'][_0x82f6('0x28')]);_0x57c023[_0x82f6('0x2c')]=_[_0x82f6('0x43')](_0x4fa2ca['query']);_0x57c023['filters']=_[_0x82f6('0x2e')](_0x57c023[_0x82f6('0x2f')],_0x57c023[_0x82f6('0x2c')]);_0x259d83[_0x82f6('0x30')]=_['intersection'](_0x57c023[_0x82f6('0x2f')],qs[_0x82f6('0x31')](_0x4fa2ca[_0x82f6('0x2c')]['fields']));_0x259d83['attributes']=_0x259d83['attributes'][_0x82f6('0x32')]?_0x259d83[_0x82f6('0x30')]:_0x57c023[_0x82f6('0x2f')];_0x259d83[_0x82f6('0x35')]=qs[_0x82f6('0x36')](_0x4fa2ca[_0x82f6('0x2c')][_0x82f6('0x36')]);_0x259d83[_0x82f6('0x39')]=qs['filters'](_[_0x82f6('0x37')](_0x4fa2ca[_0x82f6('0x2c')],_0x57c023[_0x82f6('0x2d')]));if(_0x4fa2ca[_0x82f6('0x2c')]['filter']){_0x259d83['where']=_[_0x82f6('0x3b')](_0x259d83[_0x82f6('0x39')],{'$or':_['map'](_0x259d83[_0x82f6('0x30')],function(_0xa12f6e){var _0x404d09={};_0x404d09[_0xa12f6e]={'$like':'%'+_0x4fa2ca['query'][_0x82f6('0x38')]+'%'};return _0x404d09;})});}_0x259d83=_[_0x82f6('0x3b')]({},_0x259d83,_0x4fa2ca[_0x82f6('0x3c')]);return _0x33c359[_0x82f6('0x48')](_0x259d83);}})[_0x82f6('0x22')](function(_0x41da7f){if(_0x41da7f){_0x4f69de=_0x41da7f['length'];if(!_0x4fa2ca[_0x82f6('0x2c')][_0x82f6('0x33')](_0x82f6('0x34'))){_0x259d83[_0x82f6('0x1b')]=qs[_0x82f6('0x1b')](_0x4fa2ca['query'][_0x82f6('0x1b')]);_0x259d83[_0x82f6('0x19')]=qs[_0x82f6('0x19')](_0x4fa2ca[_0x82f6('0x2c')][_0x82f6('0x19')]);}return _0x33c359[_0x82f6('0x48')](_0x259d83);}})[_0x82f6('0x22')](function(_0x17389a){if(_0x17389a){return _0x17389a?{'count':_0x4f69de,'rows':_0x17389a}:null;}})['then'](respondWithResult(_0x2e6b03,null))[_0x82f6('0x47')](handleError(_0x2e6b03,null));};exports['addConfiguration']=function(_0x3f0337,_0x85ea2e,_0x4e51a6){if(_0x3f0337[_0x82f6('0x46')]['id']){delete _0x3f0337[_0x82f6('0x46')]['id'];}return db[_0x82f6('0x27')]['findOne']({'where':{'id':_0x3f0337['params']['id']}})[_0x82f6('0x22')](handleEntityNotFound(_0x85ea2e,null))[_0x82f6('0x22')](function(_0x58b96b){if(_0x58b96b){_0x3f0337['body'][_0x82f6('0x49')]=_0x58b96b['id'];_0x3f0337[_0x82f6('0x46')][_0x82f6('0x4a')]=integrations[_0x82f6('0x4b')](_0x3f0337[_0x82f6('0x46')][_0x82f6('0x4c')],_0x3f0337[_0x82f6('0x46')][_0x82f6('0x2a')]);_0x3f0337[_0x82f6('0x46')][_0x82f6('0x4d')]=integrations[_0x82f6('0x4e')](_0x3f0337[_0x82f6('0x46')]['channel'],_0x3f0337[_0x82f6('0x46')][_0x82f6('0x2a')]);return db[_0x82f6('0x4f')][_0x82f6('0x45')](_0x3f0337[_0x82f6('0x46')],{'include':[{'model':db['ZendeskField'],'as':_0x82f6('0x4a')},{'model':db[_0x82f6('0x50')],'as':_0x82f6('0x4d')}]});}return null;})['then'](respondWithResult(_0x85ea2e,null))[_0x82f6('0x47')](handleError(_0x85ea2e,null));};exports[_0x82f6('0x51')]=function(_0x17924d,_0x27a79c,_0xeec407){var _0x39a4b3='';return db[_0x82f6('0x27')]['findOne']({'where':{'id':_0x17924d[_0x82f6('0x42')]['id']},'attributes':['id','username',_0x82f6('0x52'),_0x82f6('0x53'),_0x82f6('0x54'),_0x82f6('0x55')]})[_0x82f6('0x22')](handleEntityNotFound(_0x27a79c,null))[_0x82f6('0x22')](function(_0x2d8721){if(_0x2d8721){_0x39a4b3=_0x2d8721[_0x82f6('0x55')];var _0x30b903=_0x39a4b3['slice'](-0x1);if(_0x30b903==='/'){_0x39a4b3=_0x39a4b3[_0x82f6('0x56')](0x0,_0x39a4b3[_0x82f6('0x57')](_0x30b903));}var _0x33cc55={'method':_0x82f6('0x58'),'uri':util[_0x82f6('0x59')](_0x82f6('0x5a'),_0x39a4b3,'ticket_fields'),'json':!![]};switch(_0x2d8721[_0x82f6('0x54')]){case _0x82f6('0x52'):_0x33cc55['headers']={'Authorization':util['format'](_0x82f6('0x5b'),new Buffer(util[_0x82f6('0x59')](_0x82f6('0x5c'),_0x2d8721[_0x82f6('0x5d')],_0x2d8721[_0x82f6('0x52')]))[_0x82f6('0x5e')]('base64'))};break;case _0x82f6('0x53'):_0x33cc55['headers']={'Authorization':util[_0x82f6('0x59')]('Basic\x20%s',new Buffer(util[_0x82f6('0x59')]('%s/token:%s',_0x2d8721[_0x82f6('0x5d')],_0x2d8721[_0x82f6('0x53')]))[_0x82f6('0x5e')]('base64'))};break;default:throw new db[(_0x82f6('0x5f'))]['ValidationError'](_0x82f6('0x60'));}return rp(_0x33cc55);}})[_0x82f6('0x22')](function(_0x3e69f6){if(_0x3e69f6){var _0x4d1bfd=[_0x82f6('0x61'),_0x82f6('0x62'),_0x82f6('0x63'),'assignee'];_['remove'](_0x3e69f6[_0x82f6('0x64')],function(_0x30327a){return _0x4d1bfd[_0x82f6('0x65')](_0x30327a[_0x82f6('0x2a')]);});return{'count':_0x3e69f6[_0x82f6('0x64')][_0x82f6('0x32')],'rows':_[_0x82f6('0x26')](_0x3e69f6[_0x82f6('0x64')],function(_0x4df767){return{'id':_0x4df767['id'],'name':_0x4df767[_0x82f6('0x66')]>0x7?_0x4df767[_0x82f6('0x67')]:_0x4df767['type'],'custom':_0x4df767[_0x82f6('0x66')]>0x7?!![]:![],'options':_0x4df767[_0x82f6('0x68')]?_0x4df767[_0x82f6('0x68')]:_0x4df767['custom_field_options']?_0x4df767[_0x82f6('0x69')]:[]};})};}})[_0x82f6('0x22')](respondWithResult(_0x27a79c,null))[_0x82f6('0x47')](function(_0x2cc906){var _0x50ab5c=_0x17924d[_0x82f6('0x2c')][_0x82f6('0x6a')]?0x1f4:_0x2cc906[_0x82f6('0x6b')]||0x1f4;logger[_0x82f6('0x6c')](_0x82f6('0x6d'),_0x82f6('0x51'),_0x50ab5c,JSON['stringify'](_0x2cc906));delete _0x2cc906[_0x82f6('0x24')];if(_0x50ab5c===0x191){_0x50ab5c=0x190;}_0x27a79c[_0x82f6('0x17')](_0x50ab5c)[_0x82f6('0x6e')](_0x17924d[_0x82f6('0x2c')][_0x82f6('0x6a')]?{'message':'Wrong\x20credentials','statusCode':_0x2cc906[_0x82f6('0x6b')]}:_0x2cc906);});};
\ No newline at end of file
index 14f0732..99d5dfa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x295d=['../../config/logger','api','bluebird','request-promise','path','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','util'];(function(_0x3d291c,_0x47ff16){var _0x32498d=function(_0x3613fd){while(--_0x3613fd){_0x3d291c['push'](_0x3d291c['shift']());}};_0x32498d(++_0x47ff16);}(_0x295d,0x8e));var _0xd295=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x295d[_0x56482c];return _0x5aae7a;};'use strict';var _=require('lodash');var util=require(_0xd295('0x0'));var logger=require(_0xd295('0x1'))(_0xd295('0x2'));var moment=require('moment');var BPromise=require(_0xd295('0x3'));var rp=require(_0xd295('0x4'));var fs=require('fs');var path=require(_0xd295('0x5'));var rimraf=require(_0xd295('0x6'));var config=require('../../config/environment');var attributes=require(_0xd295('0x7'));var integrations=require(_0xd295('0x8'));module[_0xd295('0x9')]=function(_0x8b9b49,_0x2175fc){return _0x8b9b49[_0xd295('0xa')](_0xd295('0xb'),attributes,{'tableName':_0xd295('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe7de=['../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1ade94,_0x4932fd){var _0x1da3bf=function(_0x31995f){while(--_0x31995f){_0x1ade94['push'](_0x1ade94['shift']());}};_0x1da3bf(++_0x4932fd);}(_0xe7de,0x12b));var _0xee7d=function(_0xaf7c6c,_0x12f47f){_0xaf7c6c=_0xaf7c6c-0x0;var _0x1c5f18=_0xe7de[_0xaf7c6c];return _0x1c5f18;};'use strict';var _=require(_0xee7d('0x0'));var util=require(_0xee7d('0x1'));var logger=require(_0xee7d('0x2'))(_0xee7d('0x3'));var moment=require(_0xee7d('0x4'));var BPromise=require(_0xee7d('0x5'));var rp=require(_0xee7d('0x6'));var fs=require('fs');var path=require(_0xee7d('0x7'));var rimraf=require(_0xee7d('0x8'));var config=require(_0xee7d('0x9'));var attributes=require(_0xee7d('0xa'));var integrations=require(_0xee7d('0xb'));module[_0xee7d('0xc')]=function(_0x44d57f,_0x8a2d03){return _0x44d57f[_0xee7d('0xd')]('ZendeskAccount',attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index df84131..526f0f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb144=['ZendeskAccount','findAll','options','attributes','include','map','debug','find','where','model','ShowZendeskAccount','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb144,0x146));var _0x4b14=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb144[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x4b14('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4b14('0x1'));var rs=require(_0x4b14('0x2'));var fs=require('fs');var Redis=require(_0x4b14('0x3'));var db=require(_0x4b14('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4b14('0x5'))(_0x4b14('0x6'));var config=require(_0x4b14('0x7'));var jayson=require(_0x4b14('0x8'));var client=jayson[_0x4b14('0x9')][_0x4b14('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51af77,_0x4139fd,_0x6e6817){return new BPromise(function(_0x543e97,_0x231550){return client[_0x4b14('0xb')](_0x51af77,_0x6e6817)[_0x4b14('0xc')](function(_0x3bcdda){logger[_0x4b14('0xd')](_0x4b14('0xe'),_0x4139fd,_0x4b14('0xf'));logger['debug'](_0x4b14('0x10'),_0x4139fd,_0x4b14('0xf'),JSON[_0x4b14('0x11')](_0x3bcdda));if(_0x3bcdda[_0x4b14('0x12')]){if(_0x3bcdda[_0x4b14('0x12')][_0x4b14('0x13')]===0x1f4){logger[_0x4b14('0x12')](_0x4b14('0xe'),_0x4139fd,_0x3bcdda['error']['message']);return _0x231550(_0x3bcdda[_0x4b14('0x12')][_0x4b14('0x14')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x4139fd,_0x3bcdda['error'][_0x4b14('0x14')]);return _0x543e97(_0x3bcdda['error'][_0x4b14('0x14')]);}else{logger['info'](_0x4b14('0xe'),_0x4139fd,_0x4b14('0xf'));_0x543e97(_0x3bcdda[_0x4b14('0x15')][_0x4b14('0x14')]);}})[_0x4b14('0x16')](function(_0x12dafc){logger[_0x4b14('0x12')](_0x4b14('0xe'),_0x4139fd,_0x12dafc);_0x231550(_0x12dafc);});});}exports[_0x4b14('0x17')]=function(_0x50fd0d){var _0x220d03=this;return new Promise(function(_0x417b98,_0x12f04c){return db[_0x4b14('0x18')][_0x4b14('0x19')]({'raw':_0x50fd0d[_0x4b14('0x1a')]?_0x50fd0d['options']['raw']===undefined?!![]:![]:!![],'where':_0x50fd0d[_0x4b14('0x1a')]?_0x50fd0d[_0x4b14('0x1a')]['where']||null:null,'attributes':_0x50fd0d[_0x4b14('0x1a')]?_0x50fd0d[_0x4b14('0x1a')][_0x4b14('0x1b')]||null:null,'limit':_0x50fd0d[_0x4b14('0x1a')]?_0x50fd0d[_0x4b14('0x1a')]['limit']||null:null,'include':_0x50fd0d[_0x4b14('0x1a')]?_0x50fd0d[_0x4b14('0x1a')][_0x4b14('0x1c')]?_[_0x4b14('0x1d')](_0x50fd0d['options'][_0x4b14('0x1c')],function(_0x456a8c){return{'model':db[_0x456a8c['model']],'as':_0x456a8c['as'],'attributes':_0x456a8c[_0x4b14('0x1b')],'include':_0x456a8c[_0x4b14('0x1c')]?_[_0x4b14('0x1d')](_0x456a8c[_0x4b14('0x1c')],function(_0x525206){return{'model':db[_0x525206['model']],'as':_0x525206['as'],'attributes':_0x525206[_0x4b14('0x1b')],'include':_0x525206[_0x4b14('0x1c')]?_[_0x4b14('0x1d')](_0x525206[_0x4b14('0x1c')],function(_0xe963fb){return{'model':db[_0xe963fb['model']],'as':_0xe963fb['as'],'attributes':_0xe963fb['attributes']};}):[]};}):[]};}):[]:[]})[_0x4b14('0xc')](function(_0x420b02){logger[_0x4b14('0xd')](_0x4b14('0x17'),_0x50fd0d);logger[_0x4b14('0x1e')](_0x4b14('0x17'),_0x50fd0d,JSON[_0x4b14('0x11')](_0x420b02));_0x417b98(_0x420b02);})['catch'](function(_0x4b26ae){logger[_0x4b14('0x12')]('GetZendeskAccount',_0x4b26ae[_0x4b14('0x14')],_0x50fd0d);_0x12f04c(_0x220d03['error'](0x1f4,_0x4b26ae[_0x4b14('0x14')]));});});};exports['ShowZendeskAccount']=function(_0x113032){var _0x305d5e=this;return new Promise(function(_0x4135d8,_0x2ee7cc){return db['ZendeskAccount'][_0x4b14('0x1f')]({'raw':_0x113032[_0x4b14('0x1a')]?_0x113032[_0x4b14('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x113032['options']?_0x113032[_0x4b14('0x1a')][_0x4b14('0x20')]||null:null,'attributes':_0x113032[_0x4b14('0x1a')]?_0x113032['options'][_0x4b14('0x1b')]||null:null,'include':_0x113032[_0x4b14('0x1a')]?_0x113032['options']['include']?_[_0x4b14('0x1d')](_0x113032[_0x4b14('0x1a')][_0x4b14('0x1c')],function(_0x104c96){return{'model':db[_0x104c96[_0x4b14('0x21')]],'as':_0x104c96['as'],'attributes':_0x104c96['attributes'],'include':_0x104c96['include']?_[_0x4b14('0x1d')](_0x104c96['include'],function(_0x317a1c){return{'model':db[_0x317a1c[_0x4b14('0x21')]],'as':_0x317a1c['as'],'attributes':_0x317a1c['attributes'],'include':_0x317a1c['include']?_['map'](_0x317a1c[_0x4b14('0x1c')],function(_0x2e0f11){return{'model':db[_0x2e0f11[_0x4b14('0x21')]],'as':_0x2e0f11['as'],'attributes':_0x2e0f11[_0x4b14('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4b14('0xc')](function(_0x1a3c90){logger[_0x4b14('0xd')](_0x4b14('0x22'),_0x113032);logger[_0x4b14('0x1e')](_0x4b14('0x22'),_0x113032,JSON[_0x4b14('0x11')](_0x1a3c90));_0x4135d8(_0x1a3c90);})[_0x4b14('0x16')](function(_0x4f8bef){logger[_0x4b14('0x12')](_0x4b14('0x22'),_0x4f8bef[_0x4b14('0x14')],_0x113032);_0x2ee7cc(_0x305d5e[_0x4b14('0x12')](0x1f4,_0x4f8bef[_0x4b14('0x14')]));});});};
\ No newline at end of file
+var _0xd96f=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetZendeskAccount','ZendeskAccount','findAll','options','raw','attributes','include','map','model','ShowZendeskAccount','find','where','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1d4fcd,_0x36bc07){var _0x9c44f8=function(_0x1831ec){while(--_0x1831ec){_0x1d4fcd['push'](_0x1d4fcd['shift']());}};_0x9c44f8(++_0x36bc07);}(_0xd96f,0xfd));var _0xfd96=function(_0x3d7a7e,_0x430a94){_0x3d7a7e=_0x3d7a7e-0x0;var _0x511475=_0xd96f[_0x3d7a7e];return _0x511475;};'use strict';var _=require('lodash');var util=require(_0xfd96('0x0'));var moment=require(_0xfd96('0x1'));var BPromise=require(_0xfd96('0x2'));var rs=require(_0xfd96('0x3'));var fs=require('fs');var Redis=require(_0xfd96('0x4'));var db=require(_0xfd96('0x5'))['db'];var utils=require(_0xfd96('0x6'));var logger=require(_0xfd96('0x7'))(_0xfd96('0x8'));var config=require(_0xfd96('0x9'));var jayson=require(_0xfd96('0xa'));var client=jayson[_0xfd96('0xb')][_0xfd96('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3b5d80,_0x2095d7,_0x2ab38c){return new BPromise(function(_0x3d2560,_0x17f5b0){return client[_0xfd96('0xd')](_0x3b5d80,_0x2ab38c)[_0xfd96('0xe')](function(_0x3e347b){logger[_0xfd96('0xf')](_0xfd96('0x10'),_0x2095d7,_0xfd96('0x11'));logger[_0xfd96('0x12')](_0xfd96('0x13'),_0x2095d7,_0xfd96('0x11'),JSON[_0xfd96('0x14')](_0x3e347b));if(_0x3e347b[_0xfd96('0x15')]){if(_0x3e347b[_0xfd96('0x15')]['code']===0x1f4){logger[_0xfd96('0x15')](_0xfd96('0x10'),_0x2095d7,_0x3e347b['error']['message']);return _0x17f5b0(_0x3e347b[_0xfd96('0x15')][_0xfd96('0x16')]);}logger[_0xfd96('0x15')](_0xfd96('0x10'),_0x2095d7,_0x3e347b[_0xfd96('0x15')][_0xfd96('0x16')]);return _0x3d2560(_0x3e347b[_0xfd96('0x15')][_0xfd96('0x16')]);}else{logger[_0xfd96('0xf')](_0xfd96('0x10'),_0x2095d7,_0xfd96('0x11'));_0x3d2560(_0x3e347b[_0xfd96('0x17')][_0xfd96('0x16')]);}})['catch'](function(_0x428ad9){logger[_0xfd96('0x15')]('ZendeskAccount,\x20%s,\x20%s',_0x2095d7,_0x428ad9);_0x17f5b0(_0x428ad9);});});}exports[_0xfd96('0x18')]=function(_0x1d7dca){var _0x208849=this;return new Promise(function(_0x252ef5,_0x501fa9){return db[_0xfd96('0x19')][_0xfd96('0x1a')]({'raw':_0x1d7dca[_0xfd96('0x1b')]?_0x1d7dca['options'][_0xfd96('0x1c')]===undefined?!![]:![]:!![],'where':_0x1d7dca[_0xfd96('0x1b')]?_0x1d7dca[_0xfd96('0x1b')]['where']||null:null,'attributes':_0x1d7dca[_0xfd96('0x1b')]?_0x1d7dca[_0xfd96('0x1b')][_0xfd96('0x1d')]||null:null,'limit':_0x1d7dca['options']?_0x1d7dca[_0xfd96('0x1b')]['limit']||null:null,'include':_0x1d7dca[_0xfd96('0x1b')]?_0x1d7dca[_0xfd96('0x1b')][_0xfd96('0x1e')]?_[_0xfd96('0x1f')](_0x1d7dca['options'][_0xfd96('0x1e')],function(_0x156a72){return{'model':db[_0x156a72[_0xfd96('0x20')]],'as':_0x156a72['as'],'attributes':_0x156a72[_0xfd96('0x1d')],'include':_0x156a72['include']?_['map'](_0x156a72[_0xfd96('0x1e')],function(_0x5f09c1){return{'model':db[_0x5f09c1[_0xfd96('0x20')]],'as':_0x5f09c1['as'],'attributes':_0x5f09c1[_0xfd96('0x1d')],'include':_0x5f09c1['include']?_[_0xfd96('0x1f')](_0x5f09c1[_0xfd96('0x1e')],function(_0x58ef26){return{'model':db[_0x58ef26[_0xfd96('0x20')]],'as':_0x58ef26['as'],'attributes':_0x58ef26['attributes']};}):[]};}):[]};}):[]:[]})[_0xfd96('0xe')](function(_0x49ab3b){logger['info'](_0xfd96('0x18'),_0x1d7dca);logger[_0xfd96('0x12')](_0xfd96('0x18'),_0x1d7dca,JSON[_0xfd96('0x14')](_0x49ab3b));_0x252ef5(_0x49ab3b);})['catch'](function(_0x9c57b1){logger[_0xfd96('0x15')](_0xfd96('0x18'),_0x9c57b1[_0xfd96('0x16')],_0x1d7dca);_0x501fa9(_0x208849[_0xfd96('0x15')](0x1f4,_0x9c57b1['message']));});});};exports[_0xfd96('0x21')]=function(_0x22ca09){var _0x204fdb=this;return new Promise(function(_0x3e9ded,_0x3ba3f7){return db[_0xfd96('0x19')][_0xfd96('0x22')]({'raw':_0x22ca09[_0xfd96('0x1b')]?_0x22ca09['options']['raw']===undefined?!![]:![]:!![],'where':_0x22ca09[_0xfd96('0x1b')]?_0x22ca09[_0xfd96('0x1b')][_0xfd96('0x23')]||null:null,'attributes':_0x22ca09['options']?_0x22ca09[_0xfd96('0x1b')][_0xfd96('0x1d')]||null:null,'include':_0x22ca09['options']?_0x22ca09[_0xfd96('0x1b')]['include']?_['map'](_0x22ca09[_0xfd96('0x1b')]['include'],function(_0x49904c){return{'model':db[_0x49904c[_0xfd96('0x20')]],'as':_0x49904c['as'],'attributes':_0x49904c['attributes'],'include':_0x49904c['include']?_[_0xfd96('0x1f')](_0x49904c[_0xfd96('0x1e')],function(_0x291f0c){return{'model':db[_0x291f0c[_0xfd96('0x20')]],'as':_0x291f0c['as'],'attributes':_0x291f0c[_0xfd96('0x1d')],'include':_0x291f0c[_0xfd96('0x1e')]?_['map'](_0x291f0c['include'],function(_0x395dc7){return{'model':db[_0x395dc7[_0xfd96('0x20')]],'as':_0x395dc7['as'],'attributes':_0x395dc7[_0xfd96('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x27da28){logger[_0xfd96('0xf')](_0xfd96('0x21'),_0x22ca09);logger['debug']('ShowZendeskAccount',_0x22ca09,JSON['stringify'](_0x27da28));_0x3e9ded(_0x27da28);})[_0xfd96('0x24')](function(_0x2628b4){logger[_0xfd96('0x15')]('ShowZendeskAccount',_0x2628b4[_0xfd96('0x16')],_0x22ca09);_0x3ba3f7(_0x204fdb[_0xfd96('0x15')](0x1f4,_0x2628b4[_0xfd96('0x16')]));});});};
\ No newline at end of file
index efa9bd0..44933b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['index','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','setTags','put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get'];(function(_0x4d2869,_0x32c524){var _0x122f65=function(_0x5d646c){while(--_0x5d646c){_0x4d2869['push'](_0x4d2869['shift']());}};_0x122f65(++_0x32c524);}(_0x757a,0xde));var _0xa757=function(_0x2e7142,_0x7179f8){_0x2e7142=_0x2e7142-0x0;var _0x1680e8=_0x757a[_0x2e7142];return _0x1680e8;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['getFields']);router[_0xa757('0x7')](_0xa757('0xc'),auth[_0xa757('0x9')](),controller[_0xa757('0xd')]);router[_0xa757('0x7')](_0xa757('0xe'),auth[_0xa757('0x9')](),controller['getDescriptions']);router['get']('/:id/tags',auth['isAuthenticated'](),controller['getTags']);router[_0xa757('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa757('0xf')]('/:id/tags',auth['isAuthenticated'](),controller[_0xa757('0x10')]);router[_0xa757('0x11')](_0xa757('0x12'),auth[_0xa757('0x9')](),controller[_0xa757('0x13')]);router[_0xa757('0x14')](_0xa757('0x12'),auth[_0xa757('0x9')](),controller[_0xa757('0x15')]);module[_0xa757('0x16')]=router;
\ No newline at end of file
+var _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','create','put','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x452971,_0x5ebb4b){var _0x1e2c0a=function(_0x3a00d6){while(--_0x3a00d6){_0x452971['push'](_0x452971['shift']());}};_0x1e2c0a(++_0x5ebb4b);}(_0xda3f,0xec));var _0xfda3=function(_0x20c604,_0x487d12){_0x20c604=_0x20c604-0x0;var _0x2ee3a0=_0xda3f[_0x20c604];return _0x2ee3a0;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./intZendeskConfiguration.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x5')](_0xfda3('0x9'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0x5')](_0xfda3('0xb'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0x5')]('/:id/descriptions',auth[_0xfda3('0x6')](),controller[_0xfda3('0xd')]);router[_0xfda3('0x5')](_0xfda3('0xe'),auth[_0xfda3('0x6')](),controller['getTags']);router[_0xfda3('0xf')]('/',auth['isAuthenticated'](),controller[_0xfda3('0x10')]);router[_0xfda3('0xf')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0xfda3('0x11')](_0xfda3('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x12')]);module[_0xfda3('0x13')]=router;
\ No newline at end of file
index 03c5d45..3e03d6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc659=['sequelize','exports','STRING'];(function(_0x6fc198,_0x1d245c){var _0x3912e0=function(_0x5392e4){while(--_0x5392e4){_0x6fc198['push'](_0x6fc198['shift']());}};_0x3912e0(++_0x1d245c);}(_0xc659,0x72));var _0x9c65=function(_0x368dc9,_0x3eaeb3){_0x368dc9=_0x368dc9-0x0;var _0x11f55d=_0xc659[_0x368dc9];return _0x11f55d;};'use strict';var Sequelize=require(_0x9c65('0x0'));module[_0x9c65('0x1')]={'name':{'type':Sequelize[_0x9c65('0x2')]},'description':{'type':Sequelize[_0x9c65('0x2')]}};
\ No newline at end of file
+var _0xcfbb=['sequelize','exports','STRING'];(function(_0x5ab294,_0x539660){var _0x3a7af0=function(_0x228494){while(--_0x228494){_0x5ab294['push'](_0x5ab294['shift']());}};_0x3a7af0(++_0x539660);}(_0xcfbb,0x1bf));var _0xbcfb=function(_0x689e16,_0x176daf){_0x689e16=_0x689e16-0x0;var _0xf6f855=_0xcfbb[_0x689e16];return _0xf6f855;};'use strict';var Sequelize=require(_0xbcfb('0x0'));module[_0xbcfb('0x1')]={'name':{'type':Sequelize[_0xbcfb('0x2')]},'description':{'type':Sequelize[_0xbcfb('0x2')]}};
\ No newline at end of file
index 52819b8..e1f65b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x573b=['where','merge','filter','options','includeAll','include','rows','catch','show','params','length','find','create','body','getFields','findOne','ZendeskField','getSubjects','pick','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x1f62c3,_0x1ff95b){var _0x385c1c=function(_0x1db580){while(--_0x1db580){_0x1f62c3['push'](_0x1f62c3['shift']());}};_0x385c1c(++_0x1ff95b);}(_0x573b,0x68));var _0xb573=function(_0x1f802b,_0x2be1fd){_0x1f802b=_0x1f802b-0x0;var _0x4185b5=_0x573b[_0x1f802b];return _0x4185b5;};'use strict';var emlformat=require(_0xb573('0x0'));var rimraf=require(_0xb573('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb573('0x2'));var rp=require('request-promise');var moment=require(_0xb573('0x3'));var BPromise=require(_0xb573('0x4'));var Mustache=require(_0xb573('0x5'));var util=require(_0xb573('0x6'));var path=require(_0xb573('0x7'));var sox=require(_0xb573('0x8'));var csv=require(_0xb573('0x9'));var ejs=require(_0xb573('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb573('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb573('0xc'));var deskjs=require(_0xb573('0xd'));var toCsv=require(_0xb573('0x9'));var querystring=require('querystring');var Papa=require(_0xb573('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb573('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb573('0x10'));var utils=require('../../config/utils');var config=require(_0xb573('0x11'));var licenseUtil=require(_0xb573('0x12'));var db=require(_0xb573('0x13'))['db'];function respondWithStatusCode(_0x25645b,_0x51838a){_0x51838a=_0x51838a||0xcc;return function(_0x1d1a85){if(_0x1d1a85){return _0x25645b['sendStatus'](_0x51838a);}return _0x25645b['status'](_0x51838a)[_0xb573('0x14')]();};}function respondWithResult(_0x144e97,_0x419ea){_0x419ea=_0x419ea||0xc8;return function(_0x55b15e){if(_0x55b15e){return _0x144e97[_0xb573('0x15')](_0x419ea)[_0xb573('0x16')](_0x55b15e);}};}function respondWithFilteredResult(_0x3d8d04,_0x47971b){return function(_0x29d56f){if(_0x29d56f){var _0x26ee13=typeof _0x47971b[_0xb573('0x17')]==='undefined'&&typeof _0x47971b[_0xb573('0x18')]===_0xb573('0x19');var _0x4d3407=_0x29d56f[_0xb573('0x1a')];var _0x1b2ccc=_0x26ee13?0x0:_0x47971b[_0xb573('0x17')];var _0x2d4800=_0x26ee13?_0x29d56f[_0xb573('0x1a')]:_0x47971b['offset']+_0x47971b[_0xb573('0x18')];var _0x147af7;if(_0x2d4800>=_0x4d3407){_0x2d4800=_0x4d3407;_0x147af7=0xc8;}else{_0x147af7=0xce;}_0x3d8d04[_0xb573('0x15')](_0x147af7);return _0x3d8d04[_0xb573('0x1b')](_0xb573('0x1c'),_0x1b2ccc+'-'+_0x2d4800+'/'+_0x4d3407)[_0xb573('0x16')](_0x29d56f);}return null;};}function patchUpdates(_0x2e6691){return function(_0x45dc40){try{jsonpatch[_0xb573('0x1d')](_0x45dc40,_0x2e6691,!![]);}catch(_0x5b2eb8){return BPromise[_0xb573('0x1e')](_0x5b2eb8);}return _0x45dc40[_0xb573('0x1f')]();};}function saveUpdates(_0x4c0adb,_0x50a89a){return function(_0x13754d){if(_0x13754d){return _0x13754d['update'](_0x4c0adb)[_0xb573('0x20')](function(_0x54cf92){return _0x54cf92;});}return null;};}function removeEntity(_0x44149a,_0x2a890c){return function(_0x4da085){if(_0x4da085){return _0x4da085[_0xb573('0x21')]()['then'](function(){_0x44149a['status'](0xcc)[_0xb573('0x14')]();});}};}function handleEntityNotFound(_0x3ab48b,_0x23b9c8){return function(_0x1195c5){if(!_0x1195c5){_0x3ab48b[_0xb573('0x22')](0x194);}return _0x1195c5;};}function handleError(_0x4eef41,_0x1b3277){_0x1b3277=_0x1b3277||0x1f4;return function(_0x5a64b2){logger[_0xb573('0x23')](_0x5a64b2[_0xb573('0x24')]);if(_0x5a64b2[_0xb573('0x25')]){delete _0x5a64b2['name'];}_0x4eef41[_0xb573('0x15')](_0x1b3277)[_0xb573('0x26')](_0x5a64b2);};}exports['index']=function(_0x4b6002,_0x5926c2){var _0x6c841c={},_0x25adc7={},_0x395137={'count':0x0,'rows':[]};var _0x495cef=_[_0xb573('0x27')](db[_0xb573('0x28')][_0xb573('0x29')],function(_0x44eb34){return{'name':_0x44eb34[_0xb573('0x2a')],'type':_0x44eb34[_0xb573('0x2b')][_0xb573('0x2c')]};});_0x25adc7[_0xb573('0x2d')]=_[_0xb573('0x27')](_0x495cef,'name');_0x25adc7[_0xb573('0x2e')]=_[_0xb573('0x2f')](_0x4b6002[_0xb573('0x2e')]);_0x25adc7[_0xb573('0x30')]=_[_0xb573('0x31')](_0x25adc7['model'],_0x25adc7[_0xb573('0x2e')]);_0x6c841c[_0xb573('0x32')]=_['intersection'](_0x25adc7['model'],qs[_0xb573('0x33')](_0x4b6002[_0xb573('0x2e')]['fields']));_0x6c841c['attributes']=_0x6c841c['attributes']['length']?_0x6c841c[_0xb573('0x32')]:_0x25adc7[_0xb573('0x2d')];if(!_0x4b6002[_0xb573('0x2e')][_0xb573('0x34')](_0xb573('0x35'))){_0x6c841c[_0xb573('0x18')]=qs[_0xb573('0x18')](_0x4b6002[_0xb573('0x2e')][_0xb573('0x18')]);_0x6c841c[_0xb573('0x17')]=qs[_0xb573('0x17')](_0x4b6002[_0xb573('0x2e')]['offset']);}_0x6c841c[_0xb573('0x36')]=qs[_0xb573('0x37')](_0x4b6002[_0xb573('0x2e')][_0xb573('0x37')]);_0x6c841c[_0xb573('0x38')]=qs[_0xb573('0x30')](_['pick'](_0x4b6002[_0xb573('0x2e')],_0x25adc7[_0xb573('0x30')]),_0x495cef);if(_0x4b6002['query']['filter']){_0x6c841c[_0xb573('0x38')]=_[_0xb573('0x39')](_0x6c841c[_0xb573('0x38')],{'$or':_[_0xb573('0x27')](_0x495cef,function(_0x4c59f4){if(_0x4c59f4[_0xb573('0x2b')]!=='VIRTUAL'){var _0x4f4a63={};_0x4f4a63[_0x4c59f4['name']]={'$like':'%'+_0x4b6002[_0xb573('0x2e')][_0xb573('0x3a')]+'%'};return _0x4f4a63;}})});}_0x6c841c=_[_0xb573('0x39')]({},_0x6c841c,_0x4b6002[_0xb573('0x3b')]);var _0x425c74={'where':_0x6c841c[_0xb573('0x38')]};return db[_0xb573('0x28')][_0xb573('0x1a')](_0x425c74)['then'](function(_0x554db7){_0x395137[_0xb573('0x1a')]=_0x554db7;if(_0x4b6002['query'][_0xb573('0x3c')]){_0x6c841c[_0xb573('0x3d')]=[{'all':!![]}];}return db[_0xb573('0x28')]['findAll'](_0x6c841c);})[_0xb573('0x20')](function(_0x56a6f9){_0x395137[_0xb573('0x3e')]=_0x56a6f9;return _0x395137;})[_0xb573('0x20')](respondWithFilteredResult(_0x5926c2,_0x6c841c))[_0xb573('0x3f')](handleError(_0x5926c2,null));};exports[_0xb573('0x40')]=function(_0xfc6a5c,_0x48e6b0){var _0x550ae9={'raw':![],'where':{'id':_0xfc6a5c[_0xb573('0x41')]['id']}},_0x44b9a5={};_0x44b9a5[_0xb573('0x2d')]=_['keys'](db[_0xb573('0x28')][_0xb573('0x29')]);_0x44b9a5[_0xb573('0x2e')]=_[_0xb573('0x2f')](_0xfc6a5c[_0xb573('0x2e')]);_0x44b9a5[_0xb573('0x30')]=_[_0xb573('0x31')](_0x44b9a5[_0xb573('0x2d')],_0x44b9a5[_0xb573('0x2e')]);_0x550ae9['attributes']=_['intersection'](_0x44b9a5['model'],qs['fields'](_0xfc6a5c['query'][_0xb573('0x33')]));_0x550ae9[_0xb573('0x32')]=_0x550ae9[_0xb573('0x32')][_0xb573('0x42')]?_0x550ae9['attributes']:_0x44b9a5[_0xb573('0x2d')];if(_0xfc6a5c['query'][_0xb573('0x3c')]){_0x550ae9[_0xb573('0x3d')]=[{'all':!![]}];}_0x550ae9=_['merge']({},_0x550ae9,_0xfc6a5c[_0xb573('0x3b')]);return db[_0xb573('0x28')][_0xb573('0x43')](_0x550ae9)[_0xb573('0x20')](handleEntityNotFound(_0x48e6b0,null))[_0xb573('0x20')](respondWithResult(_0x48e6b0,null))['catch'](handleError(_0x48e6b0,null));};exports[_0xb573('0x44')]=function(_0x283ae2,_0x354a29){return db['ZendeskConfiguration'][_0xb573('0x44')](_0x283ae2['body'],{})['then'](respondWithResult(_0x354a29,0xc9))['catch'](handleError(_0x354a29,null));};exports['update']=function(_0x2c0c69,_0x2858c){if(_0x2c0c69[_0xb573('0x45')]['id']){delete _0x2c0c69['body']['id'];}return db[_0xb573('0x28')]['find']({'where':{'id':_0x2c0c69[_0xb573('0x41')]['id']}})[_0xb573('0x20')](handleEntityNotFound(_0x2858c,null))[_0xb573('0x20')](saveUpdates(_0x2c0c69[_0xb573('0x45')],null))[_0xb573('0x20')](respondWithResult(_0x2858c,null))[_0xb573('0x3f')](handleError(_0x2858c,null));};exports[_0xb573('0x21')]=function(_0x2bba81,_0x40a703){return db[_0xb573('0x28')][_0xb573('0x43')]({'where':{'id':_0x2bba81['params']['id']}})[_0xb573('0x20')](handleEntityNotFound(_0x40a703,null))[_0xb573('0x20')](removeEntity(_0x40a703,null))['catch'](handleError(_0x40a703,null));};exports[_0xb573('0x46')]=function(_0x567c91,_0x2021fc,_0x5e0534){var _0x3c4f97={};var _0x464b19={};var _0x4472a0;var _0x4e5cad;return db[_0xb573('0x28')][_0xb573('0x47')]({'where':{'id':_0x567c91[_0xb573('0x41')]['id']}})[_0xb573('0x20')](handleEntityNotFound(_0x2021fc,null))[_0xb573('0x20')](function(_0x295850){if(_0x295850){_0x4472a0=_0x295850;_0x464b19[_0xb573('0x2d')]=_[_0xb573('0x2f')](db[_0xb573('0x48')]['rawAttributes']);_0x464b19['query']=_['keys'](_0x567c91['query']);_0x464b19[_0xb573('0x30')]=_['intersection'](_0x464b19[_0xb573('0x2d')],_0x464b19[_0xb573('0x2e')]);_0x3c4f97[_0xb573('0x32')]=_['intersection'](_0x464b19[_0xb573('0x2d')],qs[_0xb573('0x33')](_0x567c91[_0xb573('0x2e')]['fields']));_0x3c4f97[_0xb573('0x32')]=_0x3c4f97[_0xb573('0x32')][_0xb573('0x42')]?_0x3c4f97[_0xb573('0x32')]:_0x464b19[_0xb573('0x2d')];_0x3c4f97[_0xb573('0x36')]=qs['sort'](_0x567c91[_0xb573('0x2e')][_0xb573('0x37')]);_0x3c4f97[_0xb573('0x38')]=qs[_0xb573('0x30')](_['pick'](_0x567c91[_0xb573('0x2e')],_0x464b19[_0xb573('0x30')]));if(_0x567c91[_0xb573('0x2e')][_0xb573('0x3a')]){_0x3c4f97['where']=_[_0xb573('0x39')](_0x3c4f97[_0xb573('0x38')],{'$or':_[_0xb573('0x27')](_0x3c4f97[_0xb573('0x32')],function(_0x1c8f3f){var _0x9c8b1b={};_0x9c8b1b[_0x1c8f3f]={'$like':'%'+_0x567c91['query'][_0xb573('0x3a')]+'%'};return _0x9c8b1b;})});}_0x3c4f97=_['merge']({},_0x3c4f97,_0x567c91[_0xb573('0x3b')]);return _0x4472a0[_0xb573('0x46')](_0x3c4f97);}})[_0xb573('0x20')](function(_0x4ebcae){if(_0x4ebcae){_0x4e5cad=_0x4ebcae[_0xb573('0x42')];if(!_0x567c91[_0xb573('0x2e')][_0xb573('0x34')](_0xb573('0x35'))){_0x3c4f97[_0xb573('0x18')]=qs['limit'](_0x567c91[_0xb573('0x2e')][_0xb573('0x18')]);_0x3c4f97['offset']=qs['offset'](_0x567c91['query'][_0xb573('0x17')]);}return _0x4472a0[_0xb573('0x46')](_0x3c4f97);}})[_0xb573('0x20')](function(_0x1b5005){if(_0x1b5005){return _0x1b5005?{'count':_0x4e5cad,'rows':_0x1b5005}:null;}})[_0xb573('0x20')](respondWithResult(_0x2021fc,null))[_0xb573('0x3f')](handleError(_0x2021fc,null));};exports[_0xb573('0x49')]=function(_0x4c6bd3,_0x3b1f7b,_0x1fb552){var _0x5f115f={};var _0x4b3b18={};var _0x4927f8;var _0x324da4;return db[_0xb573('0x28')][_0xb573('0x47')]({'where':{'id':_0x4c6bd3['params']['id']}})[_0xb573('0x20')](handleEntityNotFound(_0x3b1f7b,null))[_0xb573('0x20')](function(_0xe870ae){if(_0xe870ae){_0x4927f8=_0xe870ae;_0x4b3b18[_0xb573('0x2d')]=_[_0xb573('0x2f')](db[_0xb573('0x48')]['rawAttributes']);_0x4b3b18[_0xb573('0x2e')]=_[_0xb573('0x2f')](_0x4c6bd3[_0xb573('0x2e')]);_0x4b3b18[_0xb573('0x30')]=_[_0xb573('0x31')](_0x4b3b18['model'],_0x4b3b18[_0xb573('0x2e')]);_0x5f115f[_0xb573('0x32')]=_[_0xb573('0x31')](_0x4b3b18[_0xb573('0x2d')],qs[_0xb573('0x33')](_0x4c6bd3[_0xb573('0x2e')]['fields']));_0x5f115f[_0xb573('0x32')]=_0x5f115f[_0xb573('0x32')][_0xb573('0x42')]?_0x5f115f['attributes']:_0x4b3b18['model'];_0x5f115f[_0xb573('0x36')]=qs[_0xb573('0x37')](_0x4c6bd3[_0xb573('0x2e')][_0xb573('0x37')]);_0x5f115f[_0xb573('0x38')]=qs['filters'](_[_0xb573('0x4a')](_0x4c6bd3[_0xb573('0x2e')],_0x4b3b18[_0xb573('0x30')]));if(_0x4c6bd3[_0xb573('0x2e')][_0xb573('0x3a')]){_0x5f115f[_0xb573('0x38')]=_['merge'](_0x5f115f[_0xb573('0x38')],{'$or':_[_0xb573('0x27')](_0x5f115f[_0xb573('0x32')],function(_0x14864d){var _0x11bec4={};_0x11bec4[_0x14864d]={'$like':'%'+_0x4c6bd3['query'][_0xb573('0x3a')]+'%'};return _0x11bec4;})});}_0x5f115f=_[_0xb573('0x39')]({},_0x5f115f,_0x4c6bd3[_0xb573('0x3b')]);return _0x4927f8[_0xb573('0x49')](_0x5f115f);}})[_0xb573('0x20')](function(_0x147212){if(_0x147212){_0x324da4=_0x147212[_0xb573('0x42')];if(!_0x4c6bd3[_0xb573('0x2e')][_0xb573('0x34')](_0xb573('0x35'))){_0x5f115f[_0xb573('0x18')]=qs[_0xb573('0x18')](_0x4c6bd3['query'][_0xb573('0x18')]);_0x5f115f['offset']=qs[_0xb573('0x17')](_0x4c6bd3[_0xb573('0x2e')]['offset']);}return _0x4927f8[_0xb573('0x49')](_0x5f115f);}})[_0xb573('0x20')](function(_0x200cfa){if(_0x200cfa){return _0x200cfa?{'count':_0x324da4,'rows':_0x200cfa}:null;}})['then'](respondWithResult(_0x3b1f7b,null))['catch'](handleError(_0x3b1f7b,null));};exports[_0xb573('0x4b')]=function(_0x32ae10,_0x3aab0f,_0x240aea){var _0x33d55b={};var _0x467797={};var _0x104888;var _0x2b6b1a;return db[_0xb573('0x28')]['findOne']({'where':{'id':_0x32ae10[_0xb573('0x41')]['id']}})[_0xb573('0x20')](handleEntityNotFound(_0x3aab0f,null))['then'](function(_0x17a858){if(_0x17a858){_0x104888=_0x17a858;_0x467797[_0xb573('0x2d')]=_[_0xb573('0x2f')](db['ZendeskField'][_0xb573('0x29')]);_0x467797[_0xb573('0x2e')]=_[_0xb573('0x2f')](_0x32ae10[_0xb573('0x2e')]);_0x467797[_0xb573('0x30')]=_[_0xb573('0x31')](_0x467797[_0xb573('0x2d')],_0x467797[_0xb573('0x2e')]);_0x33d55b[_0xb573('0x32')]=_['intersection'](_0x467797[_0xb573('0x2d')],qs[_0xb573('0x33')](_0x32ae10[_0xb573('0x2e')][_0xb573('0x33')]));_0x33d55b['attributes']=_0x33d55b[_0xb573('0x32')]['length']?_0x33d55b[_0xb573('0x32')]:_0x467797[_0xb573('0x2d')];_0x33d55b[_0xb573('0x36')]=qs['sort'](_0x32ae10[_0xb573('0x2e')][_0xb573('0x37')]);_0x33d55b[_0xb573('0x38')]=qs['filters'](_[_0xb573('0x4a')](_0x32ae10[_0xb573('0x2e')],_0x467797['filters']));if(_0x32ae10[_0xb573('0x2e')][_0xb573('0x3a')]){_0x33d55b[_0xb573('0x38')]=_['merge'](_0x33d55b['where'],{'$or':_['map'](_0x33d55b[_0xb573('0x32')],function(_0xcf391d){var _0x430563={};_0x430563[_0xcf391d]={'$like':'%'+_0x32ae10[_0xb573('0x2e')][_0xb573('0x3a')]+'%'};return _0x430563;})});}_0x33d55b=_[_0xb573('0x39')]({},_0x33d55b,_0x32ae10[_0xb573('0x3b')]);return _0x104888[_0xb573('0x4b')](_0x33d55b);}})[_0xb573('0x20')](function(_0xdb86c3){if(_0xdb86c3){_0x2b6b1a=_0xdb86c3[_0xb573('0x42')];if(!_0x32ae10[_0xb573('0x2e')][_0xb573('0x34')](_0xb573('0x35'))){_0x33d55b[_0xb573('0x18')]=qs[_0xb573('0x18')](_0x32ae10[_0xb573('0x2e')][_0xb573('0x18')]);_0x33d55b['offset']=qs[_0xb573('0x17')](_0x32ae10[_0xb573('0x2e')][_0xb573('0x17')]);}return _0x104888[_0xb573('0x4b')](_0x33d55b);}})['then'](function(_0x5bf276){if(_0x5bf276){return _0x5bf276?{'count':_0x2b6b1a,'rows':_0x5bf276}:null;}})[_0xb573('0x20')](respondWithResult(_0x3aab0f,null))[_0xb573('0x3f')](handleError(_0x3aab0f,null));};exports[_0xb573('0x4c')]=function(_0x473a48,_0x1fbf76,_0x6b60c3){var _0x808c1c={};var _0x39c2c7={};var _0x503b4b;var _0x57a731;return db[_0xb573('0x28')][_0xb573('0x47')]({'where':{'id':_0x473a48[_0xb573('0x41')]['id']}})[_0xb573('0x20')](handleEntityNotFound(_0x1fbf76,null))[_0xb573('0x20')](function(_0xdc5238){if(_0xdc5238){_0x503b4b=_0xdc5238;_0x39c2c7[_0xb573('0x2d')]=_['keys'](db[_0xb573('0x4d')]['rawAttributes']);_0x39c2c7[_0xb573('0x2e')]=_['keys'](_0x473a48[_0xb573('0x2e')]);_0x39c2c7['filters']=_[_0xb573('0x31')](_0x39c2c7[_0xb573('0x2d')],_0x39c2c7[_0xb573('0x2e')]);_0x808c1c[_0xb573('0x32')]=_[_0xb573('0x31')](_0x39c2c7['model'],qs[_0xb573('0x33')](_0x473a48[_0xb573('0x2e')][_0xb573('0x33')]));_0x808c1c[_0xb573('0x32')]=_0x808c1c[_0xb573('0x32')][_0xb573('0x42')]?_0x808c1c['attributes']:_0x39c2c7[_0xb573('0x2d')];_0x808c1c[_0xb573('0x36')]=qs[_0xb573('0x37')](_0x473a48['query'][_0xb573('0x37')]);_0x808c1c[_0xb573('0x38')]=qs[_0xb573('0x30')](_['pick'](_0x473a48[_0xb573('0x2e')],_0x39c2c7[_0xb573('0x30')]));if(_0x473a48['query'][_0xb573('0x3a')]){_0x808c1c[_0xb573('0x38')]=_[_0xb573('0x39')](_0x808c1c[_0xb573('0x38')],{'$or':_[_0xb573('0x27')](_0x808c1c[_0xb573('0x32')],function(_0x167db6){var _0x2fc9e0={};_0x2fc9e0[_0x167db6]={'$like':'%'+_0x473a48[_0xb573('0x2e')][_0xb573('0x3a')]+'%'};return _0x2fc9e0;})});}_0x808c1c=_[_0xb573('0x39')]({},_0x808c1c,_0x473a48[_0xb573('0x3b')]);return _0x503b4b[_0xb573('0x4c')](_0x808c1c);}})['then'](function(_0x3afa69){if(_0x3afa69){_0x57a731=_0x3afa69[_0xb573('0x42')];if(!_0x473a48['query']['hasOwnProperty']('nolimit')){_0x808c1c[_0xb573('0x18')]=qs['limit'](_0x473a48[_0xb573('0x2e')][_0xb573('0x18')]);_0x808c1c[_0xb573('0x17')]=qs[_0xb573('0x17')](_0x473a48[_0xb573('0x2e')][_0xb573('0x17')]);}return _0x503b4b[_0xb573('0x4c')](_0x808c1c);}})[_0xb573('0x20')](function(_0x44060c){if(_0x44060c){return _0x44060c?{'count':_0x57a731,'rows':_0x44060c}:null;}})['then'](respondWithResult(_0x1fbf76,null))[_0xb573('0x3f')](handleError(_0x1fbf76,null));};exports[_0xb573('0x4e')]=function(_0x25b873,_0x18be06,_0x45d151){if(_0x25b873[_0xb573('0x45')]['id']){delete _0x25b873[_0xb573('0x45')]['id'];}return db['ZendeskConfiguration'][_0xb573('0x47')]({'where':{'id':_0x25b873[_0xb573('0x41')]['id']}})[_0xb573('0x20')](handleEntityNotFound(_0x18be06,null))[_0xb573('0x20')](function(_0x4dce55){if(_0x4dce55){return _0x4dce55[_0xb573('0x4e')](_0x25b873[_0xb573('0x45')][_0xb573('0x4f')]||[]);}return null;})['then'](respondWithResult(_0x18be06,null))[_0xb573('0x3f')](handleError(_0x18be06,null));};
\ No newline at end of file
+var _0x897c=['show','params','keys','fields','include','find','create','body','update','findOne','ZendeskField','rawAttributes','length','filter','getFields','getSubjects','options','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','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','destroy','then','stack','name','send','index','ZendeskConfiguration','fieldName','type','key','model','query','intersection','attributes','hasOwnProperty','nolimit','order','sort','pick','filters','where','merge','map','includeAll','findAll','rows','catch'];(function(_0x49afd8,_0x27b4bb){var _0x19618e=function(_0x43edef){while(--_0x43edef){_0x49afd8['push'](_0x49afd8['shift']());}};_0x19618e(++_0x27b4bb);}(_0x897c,0x1be));var _0xc897=function(_0x1dec45,_0xb7de42){_0x1dec45=_0x1dec45-0x0;var _0x388566=_0x897c[_0x1dec45];return _0x388566;};'use strict';var emlformat=require(_0xc897('0x0'));var rimraf=require(_0xc897('0x1'));var zipdir=require(_0xc897('0x2'));var jsonpatch=require(_0xc897('0x3'));var rp=require(_0xc897('0x4'));var moment=require(_0xc897('0x5'));var BPromise=require(_0xc897('0x6'));var Mustache=require(_0xc897('0x7'));var util=require('util');var path=require(_0xc897('0x8'));var sox=require('sox');var csv=require(_0xc897('0x9'));var ejs=require(_0xc897('0xa'));var fs=require('fs');var fs_extra=require(_0xc897('0xb'));var _=require(_0xc897('0xc'));var squel=require(_0xc897('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc897('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc897('0xf'));var Papa=require('papaparse');var Redis=require(_0xc897('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc897('0x11'));var as=require(_0xc897('0x12'));var hardwareService=require(_0xc897('0x13'));var logger=require('../../config/logger')(_0xc897('0x14'));var utils=require(_0xc897('0x15'));var config=require(_0xc897('0x16'));var licenseUtil=require(_0xc897('0x17'));var db=require(_0xc897('0x18'))['db'];function respondWithStatusCode(_0x5d6f12,_0x5e8a01){_0x5e8a01=_0x5e8a01||0xcc;return function(_0x19cc24){if(_0x19cc24){return _0x5d6f12[_0xc897('0x19')](_0x5e8a01);}return _0x5d6f12[_0xc897('0x1a')](_0x5e8a01)[_0xc897('0x1b')]();};}function respondWithResult(_0x28b5ca,_0x2f5e35){_0x2f5e35=_0x2f5e35||0xc8;return function(_0xf38728){if(_0xf38728){return _0x28b5ca[_0xc897('0x1a')](_0x2f5e35)['json'](_0xf38728);}};}function respondWithFilteredResult(_0x4eefd1,_0x41be3e){return function(_0x1aad15){if(_0x1aad15){var _0x591112=typeof _0x41be3e[_0xc897('0x1c')]==='undefined'&&typeof _0x41be3e[_0xc897('0x1d')]==='undefined';var _0x35e587=_0x1aad15['count'];var _0x126517=_0x591112?0x0:_0x41be3e[_0xc897('0x1c')];var _0x425fd8=_0x591112?_0x1aad15[_0xc897('0x1e')]:_0x41be3e['offset']+_0x41be3e[_0xc897('0x1d')];var _0x4c6fd5;if(_0x425fd8>=_0x35e587){_0x425fd8=_0x35e587;_0x4c6fd5=0xc8;}else{_0x4c6fd5=0xce;}_0x4eefd1['status'](_0x4c6fd5);return _0x4eefd1[_0xc897('0x1f')](_0xc897('0x20'),_0x126517+'-'+_0x425fd8+'/'+_0x35e587)[_0xc897('0x21')](_0x1aad15);}return null;};}function patchUpdates(_0x2e47ec){return function(_0x1329e1){try{jsonpatch[_0xc897('0x22')](_0x1329e1,_0x2e47ec,!![]);}catch(_0x4c44df){return BPromise[_0xc897('0x23')](_0x4c44df);}return _0x1329e1[_0xc897('0x24')]();};}function saveUpdates(_0x661f5c,_0x47c19e){return function(_0x3bfe98){if(_0x3bfe98){return _0x3bfe98['update'](_0x661f5c)['then'](function(_0x5a5bc8){return _0x5a5bc8;});}return null;};}function removeEntity(_0x20a9d7,_0x418b55){return function(_0x7a32cf){if(_0x7a32cf){return _0x7a32cf[_0xc897('0x25')]()[_0xc897('0x26')](function(){_0x20a9d7[_0xc897('0x1a')](0xcc)[_0xc897('0x1b')]();});}};}function handleEntityNotFound(_0x388156,_0x2938d9){return function(_0x29d0f5){if(!_0x29d0f5){_0x388156['sendStatus'](0x194);}return _0x29d0f5;};}function handleError(_0x44ba27,_0x38ce4c){_0x38ce4c=_0x38ce4c||0x1f4;return function(_0x85beb0){logger['error'](_0x85beb0[_0xc897('0x27')]);if(_0x85beb0[_0xc897('0x28')]){delete _0x85beb0['name'];}_0x44ba27['status'](_0x38ce4c)[_0xc897('0x29')](_0x85beb0);};}exports[_0xc897('0x2a')]=function(_0x3195a9,_0x453c2c){var _0x51e787={},_0x14658c={},_0x354a58={'count':0x0,'rows':[]};var _0x507381=_['map'](db[_0xc897('0x2b')]['rawAttributes'],function(_0xa49c10){return{'name':_0xa49c10[_0xc897('0x2c')],'type':_0xa49c10[_0xc897('0x2d')][_0xc897('0x2e')]};});_0x14658c[_0xc897('0x2f')]=_['map'](_0x507381,_0xc897('0x28'));_0x14658c[_0xc897('0x30')]=_['keys'](_0x3195a9[_0xc897('0x30')]);_0x14658c['filters']=_[_0xc897('0x31')](_0x14658c['model'],_0x14658c[_0xc897('0x30')]);_0x51e787[_0xc897('0x32')]=_[_0xc897('0x31')](_0x14658c[_0xc897('0x2f')],qs['fields'](_0x3195a9[_0xc897('0x30')]['fields']));_0x51e787[_0xc897('0x32')]=_0x51e787[_0xc897('0x32')]['length']?_0x51e787[_0xc897('0x32')]:_0x14658c[_0xc897('0x2f')];if(!_0x3195a9['query'][_0xc897('0x33')](_0xc897('0x34'))){_0x51e787[_0xc897('0x1d')]=qs['limit'](_0x3195a9[_0xc897('0x30')]['limit']);_0x51e787['offset']=qs['offset'](_0x3195a9[_0xc897('0x30')][_0xc897('0x1c')]);}_0x51e787[_0xc897('0x35')]=qs[_0xc897('0x36')](_0x3195a9[_0xc897('0x30')]['sort']);_0x51e787['where']=qs['filters'](_[_0xc897('0x37')](_0x3195a9[_0xc897('0x30')],_0x14658c[_0xc897('0x38')]),_0x507381);if(_0x3195a9[_0xc897('0x30')]['filter']){_0x51e787[_0xc897('0x39')]=_[_0xc897('0x3a')](_0x51e787[_0xc897('0x39')],{'$or':_[_0xc897('0x3b')](_0x507381,function(_0x2ea86b){if(_0x2ea86b[_0xc897('0x2d')]!=='VIRTUAL'){var _0xc17658={};_0xc17658[_0x2ea86b[_0xc897('0x28')]]={'$like':'%'+_0x3195a9[_0xc897('0x30')]['filter']+'%'};return _0xc17658;}})});}_0x51e787=_['merge']({},_0x51e787,_0x3195a9['options']);var _0x511324={'where':_0x51e787[_0xc897('0x39')]};return db[_0xc897('0x2b')][_0xc897('0x1e')](_0x511324)['then'](function(_0x5372ed){_0x354a58['count']=_0x5372ed;if(_0x3195a9['query'][_0xc897('0x3c')]){_0x51e787['include']=[{'all':!![]}];}return db[_0xc897('0x2b')][_0xc897('0x3d')](_0x51e787);})[_0xc897('0x26')](function(_0x345b6d){_0x354a58[_0xc897('0x3e')]=_0x345b6d;return _0x354a58;})[_0xc897('0x26')](respondWithFilteredResult(_0x453c2c,_0x51e787))[_0xc897('0x3f')](handleError(_0x453c2c,null));};exports[_0xc897('0x40')]=function(_0x2ac971,_0x220e7e){var _0x39fddb={'raw':![],'where':{'id':_0x2ac971[_0xc897('0x41')]['id']}},_0x4e9542={};_0x4e9542[_0xc897('0x2f')]=_[_0xc897('0x42')](db[_0xc897('0x2b')]['rawAttributes']);_0x4e9542[_0xc897('0x30')]=_['keys'](_0x2ac971[_0xc897('0x30')]);_0x4e9542[_0xc897('0x38')]=_[_0xc897('0x31')](_0x4e9542[_0xc897('0x2f')],_0x4e9542[_0xc897('0x30')]);_0x39fddb[_0xc897('0x32')]=_[_0xc897('0x31')](_0x4e9542[_0xc897('0x2f')],qs[_0xc897('0x43')](_0x2ac971[_0xc897('0x30')][_0xc897('0x43')]));_0x39fddb[_0xc897('0x32')]=_0x39fddb[_0xc897('0x32')]['length']?_0x39fddb[_0xc897('0x32')]:_0x4e9542[_0xc897('0x2f')];if(_0x2ac971['query']['includeAll']){_0x39fddb[_0xc897('0x44')]=[{'all':!![]}];}_0x39fddb=_['merge']({},_0x39fddb,_0x2ac971['options']);return db[_0xc897('0x2b')][_0xc897('0x45')](_0x39fddb)[_0xc897('0x26')](handleEntityNotFound(_0x220e7e,null))[_0xc897('0x26')](respondWithResult(_0x220e7e,null))['catch'](handleError(_0x220e7e,null));};exports[_0xc897('0x46')]=function(_0x30306a,_0x28b87b){return db['ZendeskConfiguration'][_0xc897('0x46')](_0x30306a[_0xc897('0x47')],{})[_0xc897('0x26')](respondWithResult(_0x28b87b,0xc9))[_0xc897('0x3f')](handleError(_0x28b87b,null));};exports[_0xc897('0x48')]=function(_0x47fede,_0x112525){if(_0x47fede['body']['id']){delete _0x47fede[_0xc897('0x47')]['id'];}return db['ZendeskConfiguration'][_0xc897('0x45')]({'where':{'id':_0x47fede['params']['id']}})[_0xc897('0x26')](handleEntityNotFound(_0x112525,null))['then'](saveUpdates(_0x47fede[_0xc897('0x47')],null))[_0xc897('0x26')](respondWithResult(_0x112525,null))[_0xc897('0x3f')](handleError(_0x112525,null));};exports[_0xc897('0x25')]=function(_0x272e6a,_0x499678){return db['ZendeskConfiguration']['find']({'where':{'id':_0x272e6a[_0xc897('0x41')]['id']}})[_0xc897('0x26')](handleEntityNotFound(_0x499678,null))['then'](removeEntity(_0x499678,null))[_0xc897('0x3f')](handleError(_0x499678,null));};exports['getFields']=function(_0x3f3a8d,_0xbe4b45,_0x31bd07){var _0x2c4b8f={};var _0x2c0fd5={};var _0x26c546;var _0x3f9ab1;return db[_0xc897('0x2b')][_0xc897('0x49')]({'where':{'id':_0x3f3a8d[_0xc897('0x41')]['id']}})[_0xc897('0x26')](handleEntityNotFound(_0xbe4b45,null))[_0xc897('0x26')](function(_0x47c798){if(_0x47c798){_0x26c546=_0x47c798;_0x2c0fd5[_0xc897('0x2f')]=_[_0xc897('0x42')](db[_0xc897('0x4a')][_0xc897('0x4b')]);_0x2c0fd5[_0xc897('0x30')]=_['keys'](_0x3f3a8d['query']);_0x2c0fd5[_0xc897('0x38')]=_[_0xc897('0x31')](_0x2c0fd5['model'],_0x2c0fd5[_0xc897('0x30')]);_0x2c4b8f[_0xc897('0x32')]=_[_0xc897('0x31')](_0x2c0fd5[_0xc897('0x2f')],qs[_0xc897('0x43')](_0x3f3a8d[_0xc897('0x30')][_0xc897('0x43')]));_0x2c4b8f[_0xc897('0x32')]=_0x2c4b8f[_0xc897('0x32')][_0xc897('0x4c')]?_0x2c4b8f[_0xc897('0x32')]:_0x2c0fd5[_0xc897('0x2f')];_0x2c4b8f['order']=qs[_0xc897('0x36')](_0x3f3a8d[_0xc897('0x30')][_0xc897('0x36')]);_0x2c4b8f['where']=qs[_0xc897('0x38')](_['pick'](_0x3f3a8d['query'],_0x2c0fd5[_0xc897('0x38')]));if(_0x3f3a8d['query'][_0xc897('0x4d')]){_0x2c4b8f['where']=_[_0xc897('0x3a')](_0x2c4b8f[_0xc897('0x39')],{'$or':_['map'](_0x2c4b8f[_0xc897('0x32')],function(_0x2e5d0b){var _0x4c427b={};_0x4c427b[_0x2e5d0b]={'$like':'%'+_0x3f3a8d[_0xc897('0x30')][_0xc897('0x4d')]+'%'};return _0x4c427b;})});}_0x2c4b8f=_[_0xc897('0x3a')]({},_0x2c4b8f,_0x3f3a8d['options']);return _0x26c546['getFields'](_0x2c4b8f);}})[_0xc897('0x26')](function(_0xd1c75e){if(_0xd1c75e){_0x3f9ab1=_0xd1c75e[_0xc897('0x4c')];if(!_0x3f3a8d[_0xc897('0x30')][_0xc897('0x33')]('nolimit')){_0x2c4b8f[_0xc897('0x1d')]=qs[_0xc897('0x1d')](_0x3f3a8d[_0xc897('0x30')][_0xc897('0x1d')]);_0x2c4b8f['offset']=qs[_0xc897('0x1c')](_0x3f3a8d[_0xc897('0x30')][_0xc897('0x1c')]);}return _0x26c546[_0xc897('0x4e')](_0x2c4b8f);}})['then'](function(_0x42743c){if(_0x42743c){return _0x42743c?{'count':_0x3f9ab1,'rows':_0x42743c}:null;}})[_0xc897('0x26')](respondWithResult(_0xbe4b45,null))[_0xc897('0x3f')](handleError(_0xbe4b45,null));};exports[_0xc897('0x4f')]=function(_0xfc21a4,_0x5a228a,_0x50c35f){var _0x272d1b={};var _0x4dc85a={};var _0x5e2eb3;var _0x1fce01;return db['ZendeskConfiguration'][_0xc897('0x49')]({'where':{'id':_0xfc21a4[_0xc897('0x41')]['id']}})['then'](handleEntityNotFound(_0x5a228a,null))[_0xc897('0x26')](function(_0x3a147e){if(_0x3a147e){_0x5e2eb3=_0x3a147e;_0x4dc85a[_0xc897('0x2f')]=_['keys'](db[_0xc897('0x4a')][_0xc897('0x4b')]);_0x4dc85a['query']=_[_0xc897('0x42')](_0xfc21a4[_0xc897('0x30')]);_0x4dc85a[_0xc897('0x38')]=_[_0xc897('0x31')](_0x4dc85a[_0xc897('0x2f')],_0x4dc85a['query']);_0x272d1b[_0xc897('0x32')]=_['intersection'](_0x4dc85a[_0xc897('0x2f')],qs[_0xc897('0x43')](_0xfc21a4[_0xc897('0x30')]['fields']));_0x272d1b[_0xc897('0x32')]=_0x272d1b[_0xc897('0x32')][_0xc897('0x4c')]?_0x272d1b[_0xc897('0x32')]:_0x4dc85a[_0xc897('0x2f')];_0x272d1b['order']=qs['sort'](_0xfc21a4[_0xc897('0x30')][_0xc897('0x36')]);_0x272d1b[_0xc897('0x39')]=qs['filters'](_[_0xc897('0x37')](_0xfc21a4[_0xc897('0x30')],_0x4dc85a[_0xc897('0x38')]));if(_0xfc21a4['query'][_0xc897('0x4d')]){_0x272d1b[_0xc897('0x39')]=_['merge'](_0x272d1b[_0xc897('0x39')],{'$or':_[_0xc897('0x3b')](_0x272d1b[_0xc897('0x32')],function(_0x3b4b99){var _0x155100={};_0x155100[_0x3b4b99]={'$like':'%'+_0xfc21a4['query']['filter']+'%'};return _0x155100;})});}_0x272d1b=_[_0xc897('0x3a')]({},_0x272d1b,_0xfc21a4[_0xc897('0x50')]);return _0x5e2eb3[_0xc897('0x4f')](_0x272d1b);}})[_0xc897('0x26')](function(_0x3952c6){if(_0x3952c6){_0x1fce01=_0x3952c6['length'];if(!_0xfc21a4[_0xc897('0x30')]['hasOwnProperty'](_0xc897('0x34'))){_0x272d1b[_0xc897('0x1d')]=qs[_0xc897('0x1d')](_0xfc21a4[_0xc897('0x30')][_0xc897('0x1d')]);_0x272d1b['offset']=qs[_0xc897('0x1c')](_0xfc21a4['query'][_0xc897('0x1c')]);}return _0x5e2eb3[_0xc897('0x4f')](_0x272d1b);}})[_0xc897('0x26')](function(_0x28bc27){if(_0x28bc27){return _0x28bc27?{'count':_0x1fce01,'rows':_0x28bc27}:null;}})[_0xc897('0x26')](respondWithResult(_0x5a228a,null))['catch'](handleError(_0x5a228a,null));};exports['getDescriptions']=function(_0x43eee0,_0x25b4d3,_0x228cb7){var _0x4bc0e5={};var _0x42c170={};var _0x291c91;var _0x11132c;return db[_0xc897('0x2b')][_0xc897('0x49')]({'where':{'id':_0x43eee0[_0xc897('0x41')]['id']}})[_0xc897('0x26')](handleEntityNotFound(_0x25b4d3,null))[_0xc897('0x26')](function(_0x570054){if(_0x570054){_0x291c91=_0x570054;_0x42c170[_0xc897('0x2f')]=_[_0xc897('0x42')](db['ZendeskField']['rawAttributes']);_0x42c170[_0xc897('0x30')]=_['keys'](_0x43eee0[_0xc897('0x30')]);_0x42c170[_0xc897('0x38')]=_[_0xc897('0x31')](_0x42c170['model'],_0x42c170[_0xc897('0x30')]);_0x4bc0e5[_0xc897('0x32')]=_['intersection'](_0x42c170[_0xc897('0x2f')],qs[_0xc897('0x43')](_0x43eee0[_0xc897('0x30')][_0xc897('0x43')]));_0x4bc0e5[_0xc897('0x32')]=_0x4bc0e5[_0xc897('0x32')][_0xc897('0x4c')]?_0x4bc0e5['attributes']:_0x42c170[_0xc897('0x2f')];_0x4bc0e5['order']=qs['sort'](_0x43eee0[_0xc897('0x30')][_0xc897('0x36')]);_0x4bc0e5[_0xc897('0x39')]=qs[_0xc897('0x38')](_[_0xc897('0x37')](_0x43eee0['query'],_0x42c170[_0xc897('0x38')]));if(_0x43eee0[_0xc897('0x30')]['filter']){_0x4bc0e5[_0xc897('0x39')]=_[_0xc897('0x3a')](_0x4bc0e5[_0xc897('0x39')],{'$or':_[_0xc897('0x3b')](_0x4bc0e5['attributes'],function(_0x275bed){var _0x2b2879={};_0x2b2879[_0x275bed]={'$like':'%'+_0x43eee0[_0xc897('0x30')][_0xc897('0x4d')]+'%'};return _0x2b2879;})});}_0x4bc0e5=_[_0xc897('0x3a')]({},_0x4bc0e5,_0x43eee0[_0xc897('0x50')]);return _0x291c91[_0xc897('0x51')](_0x4bc0e5);}})[_0xc897('0x26')](function(_0x5c3924){if(_0x5c3924){_0x11132c=_0x5c3924[_0xc897('0x4c')];if(!_0x43eee0[_0xc897('0x30')][_0xc897('0x33')]('nolimit')){_0x4bc0e5[_0xc897('0x1d')]=qs['limit'](_0x43eee0['query'][_0xc897('0x1d')]);_0x4bc0e5[_0xc897('0x1c')]=qs[_0xc897('0x1c')](_0x43eee0['query'][_0xc897('0x1c')]);}return _0x291c91[_0xc897('0x51')](_0x4bc0e5);}})['then'](function(_0x1cf0ad){if(_0x1cf0ad){return _0x1cf0ad?{'count':_0x11132c,'rows':_0x1cf0ad}:null;}})[_0xc897('0x26')](respondWithResult(_0x25b4d3,null))['catch'](handleError(_0x25b4d3,null));};exports[_0xc897('0x52')]=function(_0x56bce5,_0x1d255b,_0x3526df){var _0x47fda3={};var _0x3d640b={};var _0x3303c0;var _0x2ebbee;return db[_0xc897('0x2b')][_0xc897('0x49')]({'where':{'id':_0x56bce5[_0xc897('0x41')]['id']}})[_0xc897('0x26')](handleEntityNotFound(_0x1d255b,null))[_0xc897('0x26')](function(_0x13a611){if(_0x13a611){_0x3303c0=_0x13a611;_0x3d640b[_0xc897('0x2f')]=_[_0xc897('0x42')](db['Tag'][_0xc897('0x4b')]);_0x3d640b[_0xc897('0x30')]=_['keys'](_0x56bce5[_0xc897('0x30')]);_0x3d640b['filters']=_[_0xc897('0x31')](_0x3d640b['model'],_0x3d640b[_0xc897('0x30')]);_0x47fda3['attributes']=_[_0xc897('0x31')](_0x3d640b[_0xc897('0x2f')],qs['fields'](_0x56bce5['query']['fields']));_0x47fda3[_0xc897('0x32')]=_0x47fda3['attributes'][_0xc897('0x4c')]?_0x47fda3[_0xc897('0x32')]:_0x3d640b[_0xc897('0x2f')];_0x47fda3[_0xc897('0x35')]=qs[_0xc897('0x36')](_0x56bce5[_0xc897('0x30')][_0xc897('0x36')]);_0x47fda3[_0xc897('0x39')]=qs[_0xc897('0x38')](_[_0xc897('0x37')](_0x56bce5['query'],_0x3d640b['filters']));if(_0x56bce5[_0xc897('0x30')][_0xc897('0x4d')]){_0x47fda3[_0xc897('0x39')]=_['merge'](_0x47fda3['where'],{'$or':_[_0xc897('0x3b')](_0x47fda3['attributes'],function(_0x276955){var _0x3cc547={};_0x3cc547[_0x276955]={'$like':'%'+_0x56bce5[_0xc897('0x30')][_0xc897('0x4d')]+'%'};return _0x3cc547;})});}_0x47fda3=_['merge']({},_0x47fda3,_0x56bce5[_0xc897('0x50')]);return _0x3303c0['getTags'](_0x47fda3);}})[_0xc897('0x26')](function(_0x5e6962){if(_0x5e6962){_0x2ebbee=_0x5e6962[_0xc897('0x4c')];if(!_0x56bce5[_0xc897('0x30')][_0xc897('0x33')](_0xc897('0x34'))){_0x47fda3['limit']=qs[_0xc897('0x1d')](_0x56bce5['query'][_0xc897('0x1d')]);_0x47fda3[_0xc897('0x1c')]=qs[_0xc897('0x1c')](_0x56bce5[_0xc897('0x30')][_0xc897('0x1c')]);}return _0x3303c0[_0xc897('0x52')](_0x47fda3);}})['then'](function(_0x68c67e){if(_0x68c67e){return _0x68c67e?{'count':_0x2ebbee,'rows':_0x68c67e}:null;}})[_0xc897('0x26')](respondWithResult(_0x1d255b,null))[_0xc897('0x3f')](handleError(_0x1d255b,null));};exports[_0xc897('0x53')]=function(_0x1cb16c,_0x40babe,_0x1343a5){if(_0x1cb16c[_0xc897('0x47')]['id']){delete _0x1cb16c[_0xc897('0x47')]['id'];}return db[_0xc897('0x2b')]['findOne']({'where':{'id':_0x1cb16c[_0xc897('0x41')]['id']}})[_0xc897('0x26')](handleEntityNotFound(_0x40babe,null))[_0xc897('0x26')](function(_0x4a98ba){if(_0x4a98ba){return _0x4a98ba['setTags'](_0x1cb16c['body'][_0xc897('0x54')]||[]);}return null;})[_0xc897('0x26')](respondWithResult(_0x40babe,null))[_0xc897('0x3f')](handleError(_0x40babe,null));};
\ No newline at end of file
index 0b590de..b2758fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf2f=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash'];(function(_0x12deee,_0x21e6e0){var _0x3aab0b=function(_0x5182ec){while(--_0x5182ec){_0x12deee['push'](_0x12deee['shift']());}};_0x3aab0b(++_0x21e6e0);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x38fd57,_0x140b1e){_0x38fd57=_0x38fd57-0x0;var _0x567a2f=_0xcf2f[_0x38fd57];return _0x567a2f;};'use strict';var _=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var logger=require(_0xfcf2('0x2'))(_0xfcf2('0x3'));var moment=require(_0xfcf2('0x4'));var BPromise=require('bluebird');var rp=require(_0xfcf2('0x5'));var fs=require('fs');var path=require(_0xfcf2('0x6'));var rimraf=require(_0xfcf2('0x7'));var config=require(_0xfcf2('0x8'));var attributes=require(_0xfcf2('0x9'));module[_0xfcf2('0xa')]=function(_0x1e6d99,_0x3a4950){return _0x1e6d99[_0xfcf2('0xb')](_0xfcf2('0xc'),attributes,{'tableName':_0xfcf2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1775=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','util'];(function(_0x525f2c,_0x3e9b99){var _0x33819e=function(_0x4e4744){while(--_0x4e4744){_0x525f2c['push'](_0x525f2c['shift']());}};_0x33819e(++_0x3e9b99);}(_0x1775,0x1db));var _0x5177=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x1775[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x5177('0x0'));var logger=require(_0x5177('0x1'))(_0x5177('0x2'));var moment=require(_0x5177('0x3'));var BPromise=require(_0x5177('0x4'));var rp=require(_0x5177('0x5'));var fs=require('fs');var path=require(_0x5177('0x6'));var rimraf=require(_0x5177('0x7'));var config=require(_0x5177('0x8'));var attributes=require(_0x5177('0x9'));module[_0x5177('0xa')]=function(_0x2c5c42,_0x153c1a){return _0x2c5c42[_0x5177('0xb')](_0x5177('0xc'),attributes,{'tableName':_0x5177('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 031c60e..3e8c8de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3f1=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb3f1,0x1a5));var _0x1b3f=function(_0x59a53b,_0x18551f){_0x59a53b=_0x59a53b-0x0;var _0x391317=_0xb3f1[_0x59a53b];return _0x391317;};'use strict';var _=require(_0x1b3f('0x0'));var util=require(_0x1b3f('0x1'));var moment=require(_0x1b3f('0x2'));var BPromise=require(_0x1b3f('0x3'));var rs=require(_0x1b3f('0x4'));var fs=require('fs');var Redis=require(_0x1b3f('0x5'));var db=require(_0x1b3f('0x6'))['db'];var utils=require(_0x1b3f('0x7'));var logger=require(_0x1b3f('0x8'))(_0x1b3f('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x1b3f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x175618,_0x36d541,_0xb11a0){return new BPromise(function(_0x5b2bcc,_0x372376){return client['request'](_0x175618,_0xb11a0)[_0x1b3f('0xb')](function(_0x59108c){logger[_0x1b3f('0xc')](_0x1b3f('0xd'),_0x36d541,_0x1b3f('0xe'));logger[_0x1b3f('0xf')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x36d541,_0x1b3f('0xe'),JSON[_0x1b3f('0x10')](_0x59108c));if(_0x59108c[_0x1b3f('0x11')]){if(_0x59108c[_0x1b3f('0x11')]['code']===0x1f4){logger['error'](_0x1b3f('0xd'),_0x36d541,_0x59108c['error']['message']);return _0x372376(_0x59108c[_0x1b3f('0x11')][_0x1b3f('0x12')]);}logger[_0x1b3f('0x11')](_0x1b3f('0xd'),_0x36d541,_0x59108c['error'][_0x1b3f('0x12')]);return _0x5b2bcc(_0x59108c[_0x1b3f('0x11')][_0x1b3f('0x12')]);}else{logger[_0x1b3f('0xc')](_0x1b3f('0xd'),_0x36d541,_0x1b3f('0xe'));_0x5b2bcc(_0x59108c[_0x1b3f('0x13')][_0x1b3f('0x12')]);}})['catch'](function(_0x4565ce){logger[_0x1b3f('0x11')](_0x1b3f('0xd'),_0x36d541,_0x4565ce);_0x372376(_0x4565ce);});});}
\ No newline at end of file
+var _0xe86e=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash'];(function(_0x492536,_0x308305){var _0x5490c0=function(_0x1c20e7){while(--_0x1c20e7){_0x492536['push'](_0x492536['shift']());}};_0x5490c0(++_0x308305);}(_0xe86e,0x1b7));var _0xee86=function(_0x2d80d0,_0x33ee32){_0x2d80d0=_0x2d80d0-0x0;var _0x5b7582=_0xe86e[_0x2d80d0];return _0x5b7582;};'use strict';var _=require(_0xee86('0x0'));var util=require(_0xee86('0x1'));var moment=require(_0xee86('0x2'));var BPromise=require('bluebird');var rs=require(_0xee86('0x3'));var fs=require('fs');var Redis=require(_0xee86('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xee86('0x5'));var logger=require(_0xee86('0x6'))(_0xee86('0x7'));var config=require(_0xee86('0x8'));var jayson=require(_0xee86('0x9'));var client=jayson[_0xee86('0xa')][_0xee86('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b67c1,_0x1f78e9,_0xae53c9){return new BPromise(function(_0x47cd6d,_0x219049){return client[_0xee86('0xc')](_0x2b67c1,_0xae53c9)[_0xee86('0xd')](function(_0x4a772c){logger[_0xee86('0xe')](_0xee86('0xf'),_0x1f78e9,_0xee86('0x10'));logger[_0xee86('0x11')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x1f78e9,_0xee86('0x10'),JSON['stringify'](_0x4a772c));if(_0x4a772c[_0xee86('0x12')]){if(_0x4a772c[_0xee86('0x12')]['code']===0x1f4){logger[_0xee86('0x12')](_0xee86('0xf'),_0x1f78e9,_0x4a772c[_0xee86('0x12')][_0xee86('0x13')]);return _0x219049(_0x4a772c[_0xee86('0x12')][_0xee86('0x13')]);}logger['error'](_0xee86('0xf'),_0x1f78e9,_0x4a772c[_0xee86('0x12')]['message']);return _0x47cd6d(_0x4a772c[_0xee86('0x12')][_0xee86('0x13')]);}else{logger[_0xee86('0xe')](_0xee86('0xf'),_0x1f78e9,_0xee86('0x10'));_0x47cd6d(_0x4a772c[_0xee86('0x14')]['message']);}})[_0xee86('0x15')](function(_0x449fee){logger[_0xee86('0x12')](_0xee86('0xf'),_0x1f78e9,_0x449fee);_0x219049(_0x449fee);});});}
\ No newline at end of file
index 0d6633b..c761ecb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10e5=['./intZendeskField.controller','get','isAuthenticated','/:id','show','create','put','update','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x860f79,_0x121fbb){var _0xe7c610=function(_0x3b7a11){while(--_0x3b7a11){_0x860f79['push'](_0x860f79['shift']());}};_0xe7c610(++_0x121fbb);}(_0x10e5,0x92));var _0x510e=function(_0x891b81,_0xfbb107){_0x891b81=_0x891b81-0x0;var _0x585932=_0x10e5[_0x891b81];return _0x585932;};'use strict';var multer=require(_0x510e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x510e('0x1'));var express=require(_0x510e('0x2'));var router=express[_0x510e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x510e('0x4'));var interaction=require(_0x510e('0x5'));var config=require(_0x510e('0x6'));var controller=require(_0x510e('0x7'));router[_0x510e('0x8')]('/',auth[_0x510e('0x9')](),controller['index']);router[_0x510e('0x8')](_0x510e('0xa'),auth['isAuthenticated'](),controller[_0x510e('0xb')]);router['post']('/',auth[_0x510e('0x9')](),controller[_0x510e('0xc')]);router[_0x510e('0xd')]('/:id',auth[_0x510e('0x9')](),controller[_0x510e('0xe')]);router[_0x510e('0xf')](_0x510e('0xa'),auth[_0x510e('0x9')](),controller[_0x510e('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x6842=['delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','show','post','create','update'];(function(_0x2f4452,_0x4d52f6){var _0x109198=function(_0x5c63ad){while(--_0x5c63ad){_0x2f4452['push'](_0x2f4452['shift']());}};_0x109198(++_0x4d52f6);}(_0x6842,0x1de));var _0x2684=function(_0x5dbb51,_0x4179fa){_0x5dbb51=_0x5dbb51-0x0;var _0x2296e9=_0x6842[_0x5dbb51];return _0x2296e9;};'use strict';var multer=require('multer');var util=require(_0x2684('0x0'));var path=require(_0x2684('0x1'));var timeout=require('connect-timeout');var express=require(_0x2684('0x2'));var router=express[_0x2684('0x3')]();var fs_extra=require(_0x2684('0x4'));var auth=require(_0x2684('0x5'));var interaction=require(_0x2684('0x6'));var config=require(_0x2684('0x7'));var controller=require(_0x2684('0x8'));router[_0x2684('0x9')]('/',auth[_0x2684('0xa')](),controller[_0x2684('0xb')]);router[_0x2684('0x9')]('/:id',auth[_0x2684('0xa')](),controller[_0x2684('0xc')]);router[_0x2684('0xd')]('/',auth[_0x2684('0xa')](),controller[_0x2684('0xe')]);router['put']('/:id',auth[_0x2684('0xa')](),controller[_0x2684('0xf')]);router[_0x2684('0x10')]('/:id',auth[_0x2684('0xa')](),controller[_0x2684('0x11')]);module[_0x2684('0x12')]=router;
\ No newline at end of file
index 44e4bfc..a91280f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b8e=['variable','customVariable','keyValue','string','STRING','sequelize','exports','ENUM'];(function(_0xbf83ae,_0x34d563){var _0x2899bc=function(_0x35aae4){while(--_0x35aae4){_0xbf83ae['push'](_0xbf83ae['shift']());}};_0x2899bc(++_0x34d563);}(_0x6b8e,0x1cd));var _0xe6b8=function(_0x258ad0,_0xc15ade){_0x258ad0=_0x258ad0-0x0;var _0x14ad52=_0x6b8e[_0x258ad0];return _0x14ad52;};'use strict';var Sequelize=require(_0xe6b8('0x0'));module[_0xe6b8('0x1')]={'type':{'type':Sequelize[_0xe6b8('0x2')]('string',_0xe6b8('0x3'),_0xe6b8('0x4'),_0xe6b8('0x5'),'picklist'),'defaultValue':_0xe6b8('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe6b8('0x7')]},'keyType':{'type':Sequelize[_0xe6b8('0x2')](_0xe6b8('0x6'),_0xe6b8('0x3'),_0xe6b8('0x4'))},'keyContent':{'type':Sequelize[_0xe6b8('0x7')]},'idField':{'type':Sequelize[_0xe6b8('0x7')]},'nameField':{'type':Sequelize[_0xe6b8('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe6b8('0x7')]}};
\ No newline at end of file
+var _0x31b7=['STRING','BOOLEAN','exports','ENUM','string','customVariable','picklist'];(function(_0x4da518,_0x4f1225){var _0xa2608c=function(_0x12ce40){while(--_0x12ce40){_0x4da518['push'](_0x4da518['shift']());}};_0xa2608c(++_0x4f1225);}(_0x31b7,0xc6));var _0x731b=function(_0x5925a5,_0x1c2699){_0x5925a5=_0x5925a5-0x0;var _0x246538=_0x31b7[_0x5925a5];return _0x246538;};'use strict';var Sequelize=require('sequelize');module[_0x731b('0x0')]={'type':{'type':Sequelize[_0x731b('0x1')](_0x731b('0x2'),'variable',_0x731b('0x3'),'keyValue',_0x731b('0x4')),'defaultValue':_0x731b('0x2')},'content':{'type':Sequelize[_0x731b('0x5')]},'key':{'type':Sequelize[_0x731b('0x5')]},'keyType':{'type':Sequelize[_0x731b('0x1')](_0x731b('0x2'),'variable',_0x731b('0x3'))},'keyContent':{'type':Sequelize[_0x731b('0x5')]},'idField':{'type':Sequelize[_0x731b('0x5')]},'nameField':{'type':Sequelize[_0x731b('0x5')]},'customField':{'type':Sequelize[_0x731b('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x731b('0x5')]}};
\ No newline at end of file
index d40a609..dba6267 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe71e=['name','send','index','map','ZendeskField','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','findAll','rows','show','includeAll','include','catch','create','body','update','find','params','destroy','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','fs-extra','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error'];(function(_0x14a3d9,_0x12f232){var _0xeef905=function(_0x1d6f4c){while(--_0x1d6f4c){_0x14a3d9['push'](_0x14a3d9['shift']());}};_0xeef905(++_0x12f232);}(_0xe71e,0x103));var _0xee71=function(_0x419c82,_0x41c464){_0x419c82=_0x419c82-0x0;var _0x270458=_0xe71e[_0x419c82];return _0x270458;};'use strict';var emlformat=require(_0xee71('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xee71('0x1'));var jsonpatch=require(_0xee71('0x2'));var rp=require(_0xee71('0x3'));var moment=require('moment');var BPromise=require(_0xee71('0x4'));var Mustache=require(_0xee71('0x5'));var util=require(_0xee71('0x6'));var path=require('path');var sox=require(_0xee71('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xee71('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xee71('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xee71('0xa'));var toCsv=require(_0xee71('0xb'));var querystring=require('querystring');var Papa=require(_0xee71('0xc'));var Redis=require(_0xee71('0xd'));var authService=require(_0xee71('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xee71('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee71('0x10'))(_0xee71('0x11'));var utils=require(_0xee71('0x12'));var config=require(_0xee71('0x13'));var licenseUtil=require(_0xee71('0x14'));var db=require(_0xee71('0x15'))['db'];function respondWithStatusCode(_0x7afbb8,_0x5d8ddb){_0x5d8ddb=_0x5d8ddb||0xcc;return function(_0x4bb880){if(_0x4bb880){return _0x7afbb8[_0xee71('0x16')](_0x5d8ddb);}return _0x7afbb8['status'](_0x5d8ddb)[_0xee71('0x17')]();};}function respondWithResult(_0x5225eb,_0x56818b){_0x56818b=_0x56818b||0xc8;return function(_0x3c7c31){if(_0x3c7c31){return _0x5225eb[_0xee71('0x18')](_0x56818b)[_0xee71('0x19')](_0x3c7c31);}};}function respondWithFilteredResult(_0x2e2b2a,_0x3d1322){return function(_0x5f1bb2){if(_0x5f1bb2){var _0x53ef3b=typeof _0x3d1322[_0xee71('0x1a')]===_0xee71('0x1b')&&typeof _0x3d1322[_0xee71('0x1c')]===_0xee71('0x1b');var _0x435e4b=_0x5f1bb2[_0xee71('0x1d')];var _0x3660d9=_0x53ef3b?0x0:_0x3d1322[_0xee71('0x1a')];var _0x7a88e2=_0x53ef3b?_0x5f1bb2['count']:_0x3d1322['offset']+_0x3d1322[_0xee71('0x1c')];var _0x54e645;if(_0x7a88e2>=_0x435e4b){_0x7a88e2=_0x435e4b;_0x54e645=0xc8;}else{_0x54e645=0xce;}_0x2e2b2a['status'](_0x54e645);return _0x2e2b2a[_0xee71('0x1e')](_0xee71('0x1f'),_0x3660d9+'-'+_0x7a88e2+'/'+_0x435e4b)[_0xee71('0x19')](_0x5f1bb2);}return null;};}function patchUpdates(_0x19c42a){return function(_0x2ba154){try{jsonpatch[_0xee71('0x20')](_0x2ba154,_0x19c42a,!![]);}catch(_0x3f8018){return BPromise[_0xee71('0x21')](_0x3f8018);}return _0x2ba154[_0xee71('0x22')]();};}function saveUpdates(_0x4f4906,_0x2aa31a){return function(_0x33ce21){if(_0x33ce21){return _0x33ce21['update'](_0x4f4906)[_0xee71('0x23')](function(_0x3846fa){return _0x3846fa;});}return null;};}function removeEntity(_0x4b75b2,_0x1f6419){return function(_0x16a19d){if(_0x16a19d){return _0x16a19d['destroy']()[_0xee71('0x23')](function(){_0x4b75b2['status'](0xcc)[_0xee71('0x17')]();});}};}function handleEntityNotFound(_0x2bf5c1,_0x16fc38){return function(_0x4f23c3){if(!_0x4f23c3){_0x2bf5c1[_0xee71('0x16')](0x194);}return _0x4f23c3;};}function handleError(_0x5f4592,_0x24497b){_0x24497b=_0x24497b||0x1f4;return function(_0x1b9891){logger[_0xee71('0x24')](_0x1b9891['stack']);if(_0x1b9891[_0xee71('0x25')]){delete _0x1b9891[_0xee71('0x25')];}_0x5f4592[_0xee71('0x18')](_0x24497b)[_0xee71('0x26')](_0x1b9891);};}exports[_0xee71('0x27')]=function(_0x69e576,_0xc4afb1){var _0x546f93={},_0x1c38ad={},_0x5b1c93={'count':0x0,'rows':[]};var _0x1dd5af=_[_0xee71('0x28')](db[_0xee71('0x29')][_0xee71('0x2a')],function(_0x3575d3){return{'name':_0x3575d3[_0xee71('0x2b')],'type':_0x3575d3[_0xee71('0x2c')]['key']};});_0x1c38ad[_0xee71('0x2d')]=_['map'](_0x1dd5af,'name');_0x1c38ad['query']=_[_0xee71('0x2e')](_0x69e576['query']);_0x1c38ad[_0xee71('0x2f')]=_[_0xee71('0x30')](_0x1c38ad['model'],_0x1c38ad[_0xee71('0x31')]);_0x546f93[_0xee71('0x32')]=_[_0xee71('0x30')](_0x1c38ad['model'],qs[_0xee71('0x33')](_0x69e576[_0xee71('0x31')][_0xee71('0x33')]));_0x546f93['attributes']=_0x546f93[_0xee71('0x32')][_0xee71('0x34')]?_0x546f93[_0xee71('0x32')]:_0x1c38ad['model'];if(!_0x69e576[_0xee71('0x31')][_0xee71('0x35')](_0xee71('0x36'))){_0x546f93[_0xee71('0x1c')]=qs['limit'](_0x69e576[_0xee71('0x31')][_0xee71('0x1c')]);_0x546f93[_0xee71('0x1a')]=qs[_0xee71('0x1a')](_0x69e576[_0xee71('0x31')][_0xee71('0x1a')]);}_0x546f93[_0xee71('0x37')]=qs[_0xee71('0x38')](_0x69e576[_0xee71('0x31')][_0xee71('0x38')]);_0x546f93['where']=qs[_0xee71('0x2f')](_[_0xee71('0x39')](_0x69e576[_0xee71('0x31')],_0x1c38ad['filters']),_0x1dd5af);if(_0x69e576[_0xee71('0x31')][_0xee71('0x3a')]){_0x546f93['where']=_[_0xee71('0x3b')](_0x546f93[_0xee71('0x3c')],{'$or':_[_0xee71('0x28')](_0x1dd5af,function(_0x27760c){if(_0x27760c['type']!=='VIRTUAL'){var _0x33e653={};_0x33e653[_0x27760c[_0xee71('0x25')]]={'$like':'%'+_0x69e576[_0xee71('0x31')][_0xee71('0x3a')]+'%'};return _0x33e653;}})});}_0x546f93=_[_0xee71('0x3b')]({},_0x546f93,_0x69e576[_0xee71('0x3d')]);var _0x3ae718={'where':_0x546f93['where']};return db[_0xee71('0x29')][_0xee71('0x1d')](_0x3ae718)['then'](function(_0x3d268b){_0x5b1c93[_0xee71('0x1d')]=_0x3d268b;if(_0x69e576[_0xee71('0x31')]['includeAll']){_0x546f93['include']=[{'all':!![]}];}return db[_0xee71('0x29')][_0xee71('0x3e')](_0x546f93);})['then'](function(_0x1b29b7){_0x5b1c93[_0xee71('0x3f')]=_0x1b29b7;return _0x5b1c93;})['then'](respondWithFilteredResult(_0xc4afb1,_0x546f93))['catch'](handleError(_0xc4afb1,null));};exports[_0xee71('0x40')]=function(_0x2aee5f,_0x3de7a9){var _0x120101={'raw':!![],'where':{'id':_0x2aee5f['params']['id']}},_0x3de088={};_0x3de088[_0xee71('0x2d')]=_[_0xee71('0x2e')](db['ZendeskField'][_0xee71('0x2a')]);_0x3de088[_0xee71('0x31')]=_[_0xee71('0x2e')](_0x2aee5f[_0xee71('0x31')]);_0x3de088[_0xee71('0x2f')]=_[_0xee71('0x30')](_0x3de088['model'],_0x3de088[_0xee71('0x31')]);_0x120101[_0xee71('0x32')]=_[_0xee71('0x30')](_0x3de088['model'],qs[_0xee71('0x33')](_0x2aee5f['query'][_0xee71('0x33')]));_0x120101['attributes']=_0x120101['attributes']['length']?_0x120101[_0xee71('0x32')]:_0x3de088[_0xee71('0x2d')];if(_0x2aee5f[_0xee71('0x31')][_0xee71('0x41')]){_0x120101[_0xee71('0x42')]=[{'all':!![]}];}_0x120101=_[_0xee71('0x3b')]({},_0x120101,_0x2aee5f[_0xee71('0x3d')]);return db['ZendeskField']['find'](_0x120101)[_0xee71('0x23')](handleEntityNotFound(_0x3de7a9,null))['then'](respondWithResult(_0x3de7a9,null))[_0xee71('0x43')](handleError(_0x3de7a9,null));};exports[_0xee71('0x44')]=function(_0x252c7a,_0x1349ea){return db[_0xee71('0x29')][_0xee71('0x44')](_0x252c7a[_0xee71('0x45')],{})[_0xee71('0x23')](respondWithResult(_0x1349ea,0xc9))['catch'](handleError(_0x1349ea,null));};exports[_0xee71('0x46')]=function(_0x39e35d,_0x15f1db){if(_0x39e35d['body']['id']){delete _0x39e35d[_0xee71('0x45')]['id'];}return db[_0xee71('0x29')][_0xee71('0x47')]({'where':{'id':_0x39e35d[_0xee71('0x48')]['id']}})[_0xee71('0x23')](handleEntityNotFound(_0x15f1db,null))[_0xee71('0x23')](saveUpdates(_0x39e35d['body'],null))[_0xee71('0x23')](respondWithResult(_0x15f1db,null))[_0xee71('0x43')](handleError(_0x15f1db,null));};exports[_0xee71('0x49')]=function(_0x517827,_0x422ba0){return db['ZendeskField']['find']({'where':{'id':_0x517827[_0xee71('0x48')]['id']}})[_0xee71('0x23')](handleEntityNotFound(_0x422ba0,null))['then'](removeEntity(_0x422ba0,null))[_0xee71('0x43')](handleError(_0x422ba0,null));};
\ No newline at end of file
+var _0x3de8=['intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','options','count','includeAll','findAll','rows','show','params','length','catch','create','body','update','find','eml-format','rimraf','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','offset','undefined','limit','set','Content-Range','apply','save','then','destroy','end','error','stack','name','send','index','ZendeskField','rawAttributes','fieldName','type','key','model','map','query','keys','filters'];(function(_0x15b516,_0x53b695){var _0x8a07eb=function(_0x255d6a){while(--_0x255d6a){_0x15b516['push'](_0x15b516['shift']());}};_0x8a07eb(++_0x53b695);}(_0x3de8,0xe9));var _0x83de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3de8[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x83de('0x0'));var rimraf=require(_0x83de('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x83de('0x2'));var rp=require(_0x83de('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x83de('0x4'));var path=require(_0x83de('0x5'));var sox=require(_0x83de('0x6'));var csv=require(_0x83de('0x7'));var ejs=require(_0x83de('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x83de('0x9'));var squel=require(_0x83de('0xa'));var crypto=require(_0x83de('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x83de('0x7'));var querystring=require(_0x83de('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x83de('0xd'));var qs=require(_0x83de('0xe'));var as=require(_0x83de('0xf'));var hardwareService=require(_0x83de('0x10'));var logger=require(_0x83de('0x11'))(_0x83de('0x12'));var utils=require('../../config/utils');var config=require(_0x83de('0x13'));var licenseUtil=require(_0x83de('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4343a6,_0x3f27da){_0x3f27da=_0x3f27da||0xcc;return function(_0x27a860){if(_0x27a860){return _0x4343a6['sendStatus'](_0x3f27da);}return _0x4343a6[_0x83de('0x15')](_0x3f27da)['end']();};}function respondWithResult(_0x6f89af,_0x59e890){_0x59e890=_0x59e890||0xc8;return function(_0x444399){if(_0x444399){return _0x6f89af[_0x83de('0x15')](_0x59e890)['json'](_0x444399);}};}function respondWithFilteredResult(_0x59b7a7,_0x1c4e5d){return function(_0x2669b5){if(_0x2669b5){var _0x483c30=typeof _0x1c4e5d[_0x83de('0x16')]==='undefined'&&typeof _0x1c4e5d['limit']===_0x83de('0x17');var _0x40d35a=_0x2669b5['count'];var _0x9760b8=_0x483c30?0x0:_0x1c4e5d['offset'];var _0x23d3aa=_0x483c30?_0x2669b5['count']:_0x1c4e5d[_0x83de('0x16')]+_0x1c4e5d[_0x83de('0x18')];var _0x2e535d;if(_0x23d3aa>=_0x40d35a){_0x23d3aa=_0x40d35a;_0x2e535d=0xc8;}else{_0x2e535d=0xce;}_0x59b7a7[_0x83de('0x15')](_0x2e535d);return _0x59b7a7[_0x83de('0x19')](_0x83de('0x1a'),_0x9760b8+'-'+_0x23d3aa+'/'+_0x40d35a)['json'](_0x2669b5);}return null;};}function patchUpdates(_0x2e980b){return function(_0x3ec512){try{jsonpatch[_0x83de('0x1b')](_0x3ec512,_0x2e980b,!![]);}catch(_0x4b0883){return BPromise['reject'](_0x4b0883);}return _0x3ec512[_0x83de('0x1c')]();};}function saveUpdates(_0x2657ed,_0x9946ad){return function(_0x5a0008){if(_0x5a0008){return _0x5a0008['update'](_0x2657ed)[_0x83de('0x1d')](function(_0x2675cb){return _0x2675cb;});}return null;};}function removeEntity(_0x533429,_0x7ecdc4){return function(_0x326b3e){if(_0x326b3e){return _0x326b3e[_0x83de('0x1e')]()[_0x83de('0x1d')](function(){_0x533429[_0x83de('0x15')](0xcc)[_0x83de('0x1f')]();});}};}function handleEntityNotFound(_0x3ff983,_0x2d52fb){return function(_0x2e2a0f){if(!_0x2e2a0f){_0x3ff983['sendStatus'](0x194);}return _0x2e2a0f;};}function handleError(_0x44657c,_0x5cdea1){_0x5cdea1=_0x5cdea1||0x1f4;return function(_0x1d1367){logger[_0x83de('0x20')](_0x1d1367[_0x83de('0x21')]);if(_0x1d1367[_0x83de('0x22')]){delete _0x1d1367[_0x83de('0x22')];}_0x44657c[_0x83de('0x15')](_0x5cdea1)[_0x83de('0x23')](_0x1d1367);};}exports[_0x83de('0x24')]=function(_0x2a23f3,_0x170a27){var _0x2bdbd3={},_0x2a107d={},_0x2d3c05={'count':0x0,'rows':[]};var _0x34541d=_['map'](db[_0x83de('0x25')][_0x83de('0x26')],function(_0x1338d6){return{'name':_0x1338d6[_0x83de('0x27')],'type':_0x1338d6[_0x83de('0x28')][_0x83de('0x29')]};});_0x2a107d[_0x83de('0x2a')]=_[_0x83de('0x2b')](_0x34541d,_0x83de('0x22'));_0x2a107d[_0x83de('0x2c')]=_[_0x83de('0x2d')](_0x2a23f3['query']);_0x2a107d[_0x83de('0x2e')]=_[_0x83de('0x2f')](_0x2a107d[_0x83de('0x2a')],_0x2a107d[_0x83de('0x2c')]);_0x2bdbd3[_0x83de('0x30')]=_[_0x83de('0x2f')](_0x2a107d['model'],qs['fields'](_0x2a23f3[_0x83de('0x2c')][_0x83de('0x31')]));_0x2bdbd3[_0x83de('0x30')]=_0x2bdbd3['attributes']['length']?_0x2bdbd3[_0x83de('0x30')]:_0x2a107d[_0x83de('0x2a')];if(!_0x2a23f3[_0x83de('0x2c')][_0x83de('0x32')]('nolimit')){_0x2bdbd3[_0x83de('0x18')]=qs['limit'](_0x2a23f3[_0x83de('0x2c')]['limit']);_0x2bdbd3[_0x83de('0x16')]=qs[_0x83de('0x16')](_0x2a23f3[_0x83de('0x2c')][_0x83de('0x16')]);}_0x2bdbd3[_0x83de('0x33')]=qs[_0x83de('0x34')](_0x2a23f3[_0x83de('0x2c')][_0x83de('0x34')]);_0x2bdbd3['where']=qs[_0x83de('0x2e')](_[_0x83de('0x35')](_0x2a23f3[_0x83de('0x2c')],_0x2a107d['filters']),_0x34541d);if(_0x2a23f3[_0x83de('0x2c')][_0x83de('0x36')]){_0x2bdbd3[_0x83de('0x37')]=_[_0x83de('0x38')](_0x2bdbd3[_0x83de('0x37')],{'$or':_[_0x83de('0x2b')](_0x34541d,function(_0x50f86e){if(_0x50f86e[_0x83de('0x28')]!=='VIRTUAL'){var _0x33b5ef={};_0x33b5ef[_0x50f86e['name']]={'$like':'%'+_0x2a23f3[_0x83de('0x2c')][_0x83de('0x36')]+'%'};return _0x33b5ef;}})});}_0x2bdbd3=_[_0x83de('0x38')]({},_0x2bdbd3,_0x2a23f3[_0x83de('0x39')]);var _0x410c09={'where':_0x2bdbd3['where']};return db[_0x83de('0x25')]['count'](_0x410c09)[_0x83de('0x1d')](function(_0x378612){_0x2d3c05[_0x83de('0x3a')]=_0x378612;if(_0x2a23f3[_0x83de('0x2c')][_0x83de('0x3b')]){_0x2bdbd3['include']=[{'all':!![]}];}return db['ZendeskField'][_0x83de('0x3c')](_0x2bdbd3);})[_0x83de('0x1d')](function(_0x39810b){_0x2d3c05[_0x83de('0x3d')]=_0x39810b;return _0x2d3c05;})[_0x83de('0x1d')](respondWithFilteredResult(_0x170a27,_0x2bdbd3))['catch'](handleError(_0x170a27,null));};exports[_0x83de('0x3e')]=function(_0x21429c,_0xe9de91){var _0x537191={'raw':!![],'where':{'id':_0x21429c[_0x83de('0x3f')]['id']}},_0x48bd1e={};_0x48bd1e['model']=_[_0x83de('0x2d')](db[_0x83de('0x25')][_0x83de('0x26')]);_0x48bd1e[_0x83de('0x2c')]=_[_0x83de('0x2d')](_0x21429c[_0x83de('0x2c')]);_0x48bd1e[_0x83de('0x2e')]=_[_0x83de('0x2f')](_0x48bd1e[_0x83de('0x2a')],_0x48bd1e[_0x83de('0x2c')]);_0x537191['attributes']=_[_0x83de('0x2f')](_0x48bd1e[_0x83de('0x2a')],qs[_0x83de('0x31')](_0x21429c[_0x83de('0x2c')][_0x83de('0x31')]));_0x537191[_0x83de('0x30')]=_0x537191['attributes'][_0x83de('0x40')]?_0x537191[_0x83de('0x30')]:_0x48bd1e[_0x83de('0x2a')];if(_0x21429c[_0x83de('0x2c')][_0x83de('0x3b')]){_0x537191['include']=[{'all':!![]}];}_0x537191=_[_0x83de('0x38')]({},_0x537191,_0x21429c[_0x83de('0x39')]);return db[_0x83de('0x25')]['find'](_0x537191)[_0x83de('0x1d')](handleEntityNotFound(_0xe9de91,null))[_0x83de('0x1d')](respondWithResult(_0xe9de91,null))[_0x83de('0x41')](handleError(_0xe9de91,null));};exports[_0x83de('0x42')]=function(_0xb4189d,_0x4b7259){return db[_0x83de('0x25')][_0x83de('0x42')](_0xb4189d[_0x83de('0x43')],{})['then'](respondWithResult(_0x4b7259,0xc9))[_0x83de('0x41')](handleError(_0x4b7259,null));};exports[_0x83de('0x44')]=function(_0x55fdb5,_0x16ce3f){if(_0x55fdb5[_0x83de('0x43')]['id']){delete _0x55fdb5[_0x83de('0x43')]['id'];}return db[_0x83de('0x25')][_0x83de('0x45')]({'where':{'id':_0x55fdb5[_0x83de('0x3f')]['id']}})[_0x83de('0x1d')](handleEntityNotFound(_0x16ce3f,null))['then'](saveUpdates(_0x55fdb5['body'],null))[_0x83de('0x1d')](respondWithResult(_0x16ce3f,null))[_0x83de('0x41')](handleError(_0x16ce3f,null));};exports['destroy']=function(_0x3f7b99,_0x65ced4){return db['ZendeskField'][_0x83de('0x45')]({'where':{'id':_0x3f7b99[_0x83de('0x3f')]['id']}})[_0x83de('0x1d')](handleEntityNotFound(_0x65ced4,null))[_0x83de('0x1d')](removeEntity(_0x65ced4,null))[_0x83de('0x41')](handleError(_0x65ced4,null));};
\ No newline at end of file
index 970c2eb..144bba9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7178=['rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7178,0xea));var _0x8717=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x7178[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x8717('0x0'));var util=require(_0x8717('0x1'));var logger=require(_0x8717('0x2'))('api');var moment=require(_0x8717('0x3'));var BPromise=require('bluebird');var rp=require(_0x8717('0x4'));var fs=require('fs');var path=require(_0x8717('0x5'));var rimraf=require(_0x8717('0x6'));var config=require(_0x8717('0x7'));var attributes=require(_0x8717('0x8'));module[_0x8717('0x9')]=function(_0x34b6a8,_0x4d52c5){return _0x34b6a8[_0x8717('0xa')](_0x8717('0xb'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x8717('0xc'),'fields':[_0x8717('0xd'),_0x8717('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf810=['api','bluebird','request-promise','path','../../config/environment','exports','int_zendesk_fields','zendesk_unique_index','FieldId','lodash','util','../../config/logger'];(function(_0x2cddaf,_0x58b553){var _0x335b8e=function(_0x28e8c3){while(--_0x28e8c3){_0x2cddaf['push'](_0x2cddaf['shift']());}};_0x335b8e(++_0x58b553);}(_0xf810,0x105));var _0x0f81=function(_0x1a186e,_0x692ec2){_0x1a186e=_0x1a186e-0x0;var _0x15ba8a=_0xf810[_0x1a186e];return _0x15ba8a;};'use strict';var _=require(_0x0f81('0x0'));var util=require(_0x0f81('0x1'));var logger=require(_0x0f81('0x2'))(_0x0f81('0x3'));var moment=require('moment');var BPromise=require(_0x0f81('0x4'));var rp=require(_0x0f81('0x5'));var fs=require('fs');var path=require(_0x0f81('0x6'));var rimraf=require('rimraf');var config=require(_0x0f81('0x7'));var attributes=require('./intZendeskField.attributes');module[_0x0f81('0x8')]=function(_0x524130,_0x356d5f){return _0x524130['define']('ZendeskField',attributes,{'tableName':_0x0f81('0x9'),'paranoid':![],'indexes':[{'name':_0x0f81('0xa'),'fields':['idField',_0x0f81('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 704247a..c2cf550 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3f1=['util','ioredis','../../mysqldb','rpc','jayson/promise','client','then','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch'];(function(_0x52be88,_0x5e3f77){var _0x3c54a9=function(_0x3dfadf){while(--_0x3dfadf){_0x52be88['push'](_0x52be88['shift']());}};_0x3c54a9(++_0x5e3f77);}(_0xc3f1,0x190));var _0x1c3f=function(_0x324c61,_0x1165dc){_0x324c61=_0x324c61-0x0;var _0x11e812=_0xc3f1[_0x324c61];return _0x11e812;};'use strict';var _=require('lodash');var util=require(_0x1c3f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c3f('0x1'));var db=require(_0x1c3f('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1c3f('0x3'));var config=require('../../config/environment');var jayson=require(_0x1c3f('0x4'));var client=jayson[_0x1c3f('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32412e,_0x1c19e1,_0x4a4334){return new BPromise(function(_0x3ae617,_0x55aa92){return client['request'](_0x32412e,_0x4a4334)[_0x1c3f('0x6')](function(_0x59e133){logger['info'](_0x1c3f('0x7'),_0x1c19e1,_0x1c3f('0x8'));logger[_0x1c3f('0x9')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x1c19e1,'request\x20sent',JSON[_0x1c3f('0xa')](_0x59e133));if(_0x59e133[_0x1c3f('0xb')]){if(_0x59e133[_0x1c3f('0xb')][_0x1c3f('0xc')]===0x1f4){logger['error'](_0x1c3f('0x7'),_0x1c19e1,_0x59e133[_0x1c3f('0xb')][_0x1c3f('0xd')]);return _0x55aa92(_0x59e133['error'][_0x1c3f('0xd')]);}logger[_0x1c3f('0xb')](_0x1c3f('0x7'),_0x1c19e1,_0x59e133[_0x1c3f('0xb')][_0x1c3f('0xd')]);return _0x3ae617(_0x59e133[_0x1c3f('0xb')][_0x1c3f('0xd')]);}else{logger[_0x1c3f('0xe')](_0x1c3f('0x7'),_0x1c19e1,_0x1c3f('0x8'));_0x3ae617(_0x59e133['result'][_0x1c3f('0xd')]);}})[_0x1c3f('0xf')](function(_0x1d33c1){logger[_0x1c3f('0xb')]('ZendeskField,\x20%s,\x20%s',_0x1c19e1,_0x1d33c1);_0x55aa92(_0x1d33c1);});});}
\ No newline at end of file
+var _0xdf0a=['code','ZendeskField,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x15f236,_0x59a12b){var _0x3645c0=function(_0x574879){while(--_0x574879){_0x15f236['push'](_0x15f236['shift']());}};_0x3645c0(++_0x59a12b);}(_0xdf0a,0x17b));var _0xadf0=function(_0x30380e,_0x6b8b9a){_0x30380e=_0x30380e-0x0;var _0x30c47a=_0xdf0a[_0x30380e];return _0x30c47a;};'use strict';var _=require(_0xadf0('0x0'));var util=require('util');var moment=require(_0xadf0('0x1'));var BPromise=require(_0xadf0('0x2'));var rs=require(_0xadf0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xadf0('0x4'))['db'];var utils=require(_0xadf0('0x5'));var logger=require(_0xadf0('0x6'))('rpc');var config=require(_0xadf0('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xadf0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x13183d,_0x5bb599,_0x248f5c){return new BPromise(function(_0x395161,_0x26410f){return client[_0xadf0('0x9')](_0x13183d,_0x248f5c)[_0xadf0('0xa')](function(_0x5b0eb7){logger[_0xadf0('0xb')]('ZendeskField,\x20%s,\x20%s',_0x5bb599,_0xadf0('0xc'));logger[_0xadf0('0xd')](_0xadf0('0xe'),_0x5bb599,_0xadf0('0xc'),JSON[_0xadf0('0xf')](_0x5b0eb7));if(_0x5b0eb7[_0xadf0('0x10')]){if(_0x5b0eb7[_0xadf0('0x10')][_0xadf0('0x11')]===0x1f4){logger[_0xadf0('0x10')](_0xadf0('0x12'),_0x5bb599,_0x5b0eb7['error'][_0xadf0('0x13')]);return _0x26410f(_0x5b0eb7['error']['message']);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x5bb599,_0x5b0eb7[_0xadf0('0x10')][_0xadf0('0x13')]);return _0x395161(_0x5b0eb7[_0xadf0('0x10')][_0xadf0('0x13')]);}else{logger[_0xadf0('0xb')]('ZendeskField,\x20%s,\x20%s',_0x5bb599,_0xadf0('0xc'));_0x395161(_0x5b0eb7[_0xadf0('0x14')]['message']);}})[_0xadf0('0x15')](function(_0x1c9c05){logger['error'](_0xadf0('0x12'),_0x5bb599,_0x1c9c05);_0x26410f(_0x1c9c05);});});}
\ No newline at end of file
index ff28e4b..8920514 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd579=['getFields','post','create','addConfiguration','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields'];(function(_0x2f2ff6,_0x2c0839){var _0x4121f7=function(_0x53d909){while(--_0x53d909){_0x2f2ff6['push'](_0x2f2ff6['shift']());}};_0x4121f7(++_0x2c0839);}(_0xd579,0x1e9));var _0x9d57=function(_0x36a276,_0xc6d265){_0x36a276=_0x36a276-0x0;var _0x5ad0f5=_0xd579[_0x36a276];return _0x5ad0f5;};'use strict';var multer=require(_0x9d57('0x0'));var util=require(_0x9d57('0x1'));var path=require('path');var timeout=require(_0x9d57('0x2'));var express=require(_0x9d57('0x3'));var router=express[_0x9d57('0x4')]();var fs_extra=require(_0x9d57('0x5'));var auth=require(_0x9d57('0x6'));var interaction=require(_0x9d57('0x7'));var config=require(_0x9d57('0x8'));var controller=require(_0x9d57('0x9'));router[_0x9d57('0xa')]('/',auth[_0x9d57('0xb')](),controller[_0x9d57('0xc')]);router[_0x9d57('0xa')](_0x9d57('0xd'),auth[_0x9d57('0xb')](),controller[_0x9d57('0xe')]);router[_0x9d57('0xa')](_0x9d57('0xf'),auth[_0x9d57('0xb')](),controller['getConfigurations']);router[_0x9d57('0xa')](_0x9d57('0x10'),auth[_0x9d57('0xb')](),controller[_0x9d57('0x11')]);router[_0x9d57('0x12')]('/',auth[_0x9d57('0xb')](),controller[_0x9d57('0x13')]);router[_0x9d57('0x12')](_0x9d57('0xf'),auth[_0x9d57('0xb')](),controller[_0x9d57('0x14')]);router['put'](_0x9d57('0xd'),auth[_0x9d57('0xb')](),controller['update']);router[_0x9d57('0x15')](_0x9d57('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x9d57('0x16')]=router;
\ No newline at end of file
+var _0xae5b=['connect-timeout','express','Router','fs-extra','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','create','post','put','update','delete','destroy','exports','multer','path'];(function(_0x2fb72c,_0x3b46b3){var _0x9ce8b7=function(_0x161a3d){while(--_0x161a3d){_0x2fb72c['push'](_0x2fb72c['shift']());}};_0x9ce8b7(++_0x3b46b3);}(_0xae5b,0x112));var _0xbae5=function(_0x531539,_0x2b42c3){_0x531539=_0x531539-0x0;var _0x13fb4b=_0xae5b[_0x531539];return _0x13fb4b;};'use strict';var multer=require(_0xbae5('0x0'));var util=require('util');var path=require(_0xbae5('0x1'));var timeout=require(_0xbae5('0x2'));var express=require(_0xbae5('0x3'));var router=express[_0xbae5('0x4')]();var fs_extra=require(_0xbae5('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbae5('0x6'));var controller=require(_0xbae5('0x7'));router[_0xbae5('0x8')]('/',auth[_0xbae5('0x9')](),controller[_0xbae5('0xa')]);router[_0xbae5('0x8')](_0xbae5('0xb'),auth[_0xbae5('0x9')](),controller[_0xbae5('0xc')]);router[_0xbae5('0x8')](_0xbae5('0xd'),auth[_0xbae5('0x9')](),controller[_0xbae5('0xe')]);router[_0xbae5('0x8')]('/:id/fields',auth[_0xbae5('0x9')](),controller[_0xbae5('0xf')]);router['post']('/',auth[_0xbae5('0x9')](),controller[_0xbae5('0x10')]);router[_0xbae5('0x11')]('/:id/configurations',auth[_0xbae5('0x9')](),controller['addConfiguration']);router[_0xbae5('0x12')](_0xbae5('0xb'),auth['isAuthenticated'](),controller[_0xbae5('0x13')]);router[_0xbae5('0x14')]('/:id',auth[_0xbae5('0x9')](),controller[_0xbae5('0x15')]);module[_0xbae5('0x16')]=router;
\ No newline at end of file
index 3475543..703a769 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c12=['exports','STRING'];(function(_0x25a5b4,_0x428f64){var _0x4c78ec=function(_0x32f47e){while(--_0x32f47e){_0x25a5b4['push'](_0x25a5b4['shift']());}};_0x4c78ec(++_0x428f64);}(_0x5c12,0x188));var _0x25c1=function(_0x21cb7f,_0x48cd16){_0x21cb7f=_0x21cb7f-0x0;var _0x5a079a=_0x5c12[_0x21cb7f];return _0x5a079a;};'use strict';var Sequelize=require('sequelize');module[_0x25c1('0x0')]={'name':{'type':Sequelize[_0x25c1('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x25c1('0x1')]},'zone':{'type':Sequelize[_0x25c1('0x1')]},'clientId':{'type':Sequelize[_0x25c1('0x1')]},'clientSecret':{'type':Sequelize[_0x25c1('0x1')]},'serverUrl':{'type':Sequelize[_0x25c1('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x25c1('0x1')]},'refreshToken':{'type':Sequelize[_0x25c1('0x1')]}};
\ No newline at end of file
+var _0xb4e6=['sequelize','STRING'];(function(_0x12832b,_0x2f6bb6){var _0x9cc12b=function(_0x3dc9d3){while(--_0x3dc9d3){_0x12832b['push'](_0x12832b['shift']());}};_0x9cc12b(++_0x2f6bb6);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x5ef905,_0x564b87){_0x5ef905=_0x5ef905-0x0;var _0x367808=_0xb4e6[_0x5ef905];return _0x367808;};'use strict';var Sequelize=require(_0x6b4e('0x0'));module['exports']={'name':{'type':Sequelize[_0x6b4e('0x1')]},'description':{'type':Sequelize[_0x6b4e('0x1')]},'host':{'type':Sequelize[_0x6b4e('0x1')]},'zone':{'type':Sequelize[_0x6b4e('0x1')]},'clientId':{'type':Sequelize[_0x6b4e('0x1')]},'clientSecret':{'type':Sequelize[_0x6b4e('0x1')]},'serverUrl':{'type':Sequelize[_0x6b4e('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x6b4e('0x1')]}};
\ No newline at end of file
index 239610a..00be2b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f63=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','ZohoAccount','findAll','rows','catch','show','params','length','includeAll','find','create','body','destroy','getConfigurations','findOne','ZohoConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZohoField','Descriptions','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','zone','serverUrl','com','substring','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','error','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','end','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty'];(function(_0x1d3332,_0x57eead){var _0x44b0cc=function(_0x38ef41){while(--_0x38ef41){_0x1d3332['push'](_0x1d3332['shift']());}};_0x44b0cc(++_0x57eead);}(_0x7f63,0xcc));var _0x37f6=function(_0x313927,_0x2b3a6d){_0x313927=_0x313927-0x0;var _0x545b28=_0x7f63[_0x313927];return _0x545b28;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x37f6('0x0'));var jsonpatch=require(_0x37f6('0x1'));var rp=require('request-promise');var moment=require(_0x37f6('0x2'));var BPromise=require(_0x37f6('0x3'));var Mustache=require(_0x37f6('0x4'));var util=require(_0x37f6('0x5'));var path=require('path');var sox=require(_0x37f6('0x6'));var csv=require(_0x37f6('0x7'));var ejs=require(_0x37f6('0x8'));var fs=require('fs');var fs_extra=require(_0x37f6('0x9'));var _=require(_0x37f6('0xa'));var squel=require(_0x37f6('0xb'));var crypto=require(_0x37f6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x37f6('0xd'));var toCsv=require(_0x37f6('0x7'));var querystring=require(_0x37f6('0xe'));var Papa=require(_0x37f6('0xf'));var Redis=require(_0x37f6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x37f6('0x11'));var as=require(_0x37f6('0x12'));var hardwareService=require(_0x37f6('0x13'));var logger=require(_0x37f6('0x14'))('api');var utils=require(_0x37f6('0x15'));var config=require(_0x37f6('0x16'));var licenseUtil=require(_0x37f6('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x37f6('0x18'));function respondWithStatusCode(_0x156a64,_0x5937cc){_0x5937cc=_0x5937cc||0xcc;return function(_0x2317ff){if(_0x2317ff){return _0x156a64[_0x37f6('0x19')](_0x5937cc);}return _0x156a64[_0x37f6('0x1a')](_0x5937cc)['end']();};}function respondWithResult(_0x1df67d,_0x111f92){_0x111f92=_0x111f92||0xc8;return function(_0x2b1910){if(_0x2b1910){return _0x1df67d[_0x37f6('0x1a')](_0x111f92)[_0x37f6('0x1b')](_0x2b1910);}};}function respondWithFilteredResult(_0x3bab6f,_0xf4f975){return function(_0xee6f6c){if(_0xee6f6c){var _0x5bc50c=typeof _0xf4f975[_0x37f6('0x1c')]==='undefined'&&typeof _0xf4f975[_0x37f6('0x1d')]===_0x37f6('0x1e');var _0x5b4e60=_0xee6f6c[_0x37f6('0x1f')];var _0x2b7a92=_0x5bc50c?0x0:_0xf4f975[_0x37f6('0x1c')];var _0x4969ed=_0x5bc50c?_0xee6f6c['count']:_0xf4f975[_0x37f6('0x1c')]+_0xf4f975[_0x37f6('0x1d')];var _0x208809;if(_0x4969ed>=_0x5b4e60){_0x4969ed=_0x5b4e60;_0x208809=0xc8;}else{_0x208809=0xce;}_0x3bab6f[_0x37f6('0x1a')](_0x208809);return _0x3bab6f[_0x37f6('0x20')](_0x37f6('0x21'),_0x2b7a92+'-'+_0x4969ed+'/'+_0x5b4e60)['json'](_0xee6f6c);}return null;};}function patchUpdates(_0x31a9c7){return function(_0x1e33f5){try{jsonpatch[_0x37f6('0x22')](_0x1e33f5,_0x31a9c7,!![]);}catch(_0x2417d6){return BPromise[_0x37f6('0x23')](_0x2417d6);}return _0x1e33f5[_0x37f6('0x24')]();};}function saveUpdates(_0x42f3e3,_0x4ec23f){return function(_0x528127){if(_0x528127){return _0x528127[_0x37f6('0x25')](_0x42f3e3)[_0x37f6('0x26')](function(_0x3119de){return _0x3119de;});}return null;};}function removeEntity(_0x4a936e,_0x4c0fd1){return function(_0xcea90f){if(_0xcea90f){return _0xcea90f['destroy']()[_0x37f6('0x26')](function(){_0x4a936e[_0x37f6('0x1a')](0xcc)[_0x37f6('0x27')]();});}};}function handleEntityNotFound(_0x232af,_0x2ee860){return function(_0x5c2fa3){if(!_0x5c2fa3){_0x232af[_0x37f6('0x19')](0x194);}return _0x5c2fa3;};}function handleError(_0x5e6de3,_0x403546){_0x403546=_0x403546||0x1f4;return function(_0x45760f){logger['error'](_0x45760f[_0x37f6('0x28')]);if(_0x45760f[_0x37f6('0x29')]){delete _0x45760f[_0x37f6('0x29')];}_0x5e6de3['status'](_0x403546)[_0x37f6('0x2a')](_0x45760f);};}exports[_0x37f6('0x2b')]=function(_0x2d0a9b,_0x262032){var _0x54cacd={},_0xb3e667={},_0x498827={'count':0x0,'rows':[]};var _0x4b8fb7=_[_0x37f6('0x2c')](db['ZohoAccount'][_0x37f6('0x2d')],function(_0x1392a0){return{'name':_0x1392a0[_0x37f6('0x2e')],'type':_0x1392a0[_0x37f6('0x2f')]['key']};});_0xb3e667[_0x37f6('0x30')]=_[_0x37f6('0x2c')](_0x4b8fb7,_0x37f6('0x29'));_0xb3e667['query']=_[_0x37f6('0x31')](_0x2d0a9b[_0x37f6('0x32')]);_0xb3e667[_0x37f6('0x33')]=_['intersection'](_0xb3e667[_0x37f6('0x30')],_0xb3e667['query']);_0x54cacd['attributes']=_[_0x37f6('0x34')](_0xb3e667[_0x37f6('0x30')],qs[_0x37f6('0x35')](_0x2d0a9b['query'][_0x37f6('0x35')]));_0x54cacd['attributes']=_0x54cacd[_0x37f6('0x36')]['length']?_0x54cacd[_0x37f6('0x36')]:_0xb3e667[_0x37f6('0x30')];if(!_0x2d0a9b[_0x37f6('0x32')][_0x37f6('0x37')](_0x37f6('0x38'))){_0x54cacd['limit']=qs['limit'](_0x2d0a9b[_0x37f6('0x32')][_0x37f6('0x1d')]);_0x54cacd[_0x37f6('0x1c')]=qs[_0x37f6('0x1c')](_0x2d0a9b[_0x37f6('0x32')]['offset']);}_0x54cacd[_0x37f6('0x39')]=qs[_0x37f6('0x3a')](_0x2d0a9b[_0x37f6('0x32')][_0x37f6('0x3a')]);_0x54cacd[_0x37f6('0x3b')]=qs['filters'](_[_0x37f6('0x3c')](_0x2d0a9b[_0x37f6('0x32')],_0xb3e667[_0x37f6('0x33')]),_0x4b8fb7);if(_0x2d0a9b[_0x37f6('0x32')][_0x37f6('0x3d')]){_0x54cacd['where']=_[_0x37f6('0x3e')](_0x54cacd[_0x37f6('0x3b')],{'$or':_[_0x37f6('0x2c')](_0x4b8fb7,function(_0xbdb04b){if(_0xbdb04b[_0x37f6('0x2f')]!==_0x37f6('0x3f')){var _0x21a24d={};_0x21a24d[_0xbdb04b['name']]={'$like':'%'+_0x2d0a9b[_0x37f6('0x32')][_0x37f6('0x3d')]+'%'};return _0x21a24d;}})});}_0x54cacd=_['merge']({},_0x54cacd,_0x2d0a9b[_0x37f6('0x40')]);var _0x3dfe05={'where':_0x54cacd[_0x37f6('0x3b')]};return db['ZohoAccount']['count'](_0x3dfe05)[_0x37f6('0x26')](function(_0x5bd3fd){_0x498827[_0x37f6('0x1f')]=_0x5bd3fd;if(_0x2d0a9b[_0x37f6('0x32')]['includeAll']){_0x54cacd[_0x37f6('0x41')]=[{'all':!![]}];}return db[_0x37f6('0x42')][_0x37f6('0x43')](_0x54cacd);})[_0x37f6('0x26')](function(_0x3d3a64){_0x498827[_0x37f6('0x44')]=_0x3d3a64;return _0x498827;})[_0x37f6('0x26')](respondWithFilteredResult(_0x262032,_0x54cacd))[_0x37f6('0x45')](handleError(_0x262032,null));};exports[_0x37f6('0x46')]=function(_0x1c3581,_0x3e9272){var _0x11da7b={'raw':![],'where':{'id':_0x1c3581[_0x37f6('0x47')]['id']}},_0x121e8d={};_0x121e8d[_0x37f6('0x30')]=_[_0x37f6('0x31')](db[_0x37f6('0x42')][_0x37f6('0x2d')]);_0x121e8d['query']=_[_0x37f6('0x31')](_0x1c3581[_0x37f6('0x32')]);_0x121e8d[_0x37f6('0x33')]=_[_0x37f6('0x34')](_0x121e8d[_0x37f6('0x30')],_0x121e8d[_0x37f6('0x32')]);_0x11da7b[_0x37f6('0x36')]=_[_0x37f6('0x34')](_0x121e8d[_0x37f6('0x30')],qs[_0x37f6('0x35')](_0x1c3581[_0x37f6('0x32')][_0x37f6('0x35')]));_0x11da7b[_0x37f6('0x36')]=_0x11da7b[_0x37f6('0x36')][_0x37f6('0x48')]?_0x11da7b['attributes']:_0x121e8d[_0x37f6('0x30')];if(_0x1c3581[_0x37f6('0x32')][_0x37f6('0x49')]){_0x11da7b[_0x37f6('0x41')]=[{'all':!![]}];}_0x11da7b=_[_0x37f6('0x3e')]({},_0x11da7b,_0x1c3581[_0x37f6('0x40')]);return db[_0x37f6('0x42')][_0x37f6('0x4a')](_0x11da7b)[_0x37f6('0x26')](handleEntityNotFound(_0x3e9272,null))['then'](respondWithResult(_0x3e9272,null))['catch'](handleError(_0x3e9272,null));};exports[_0x37f6('0x4b')]=function(_0x27de4d,_0x27ed8e){return db[_0x37f6('0x42')]['create'](_0x27de4d['body'],{})[_0x37f6('0x26')](respondWithResult(_0x27ed8e,0xc9))[_0x37f6('0x45')](handleError(_0x27ed8e,null));};exports['update']=function(_0x132fe8,_0x11fa39){if(_0x132fe8[_0x37f6('0x4c')]['id']){delete _0x132fe8['body']['id'];}return db[_0x37f6('0x42')][_0x37f6('0x4a')]({'where':{'id':_0x132fe8[_0x37f6('0x47')]['id']}})['then'](handleEntityNotFound(_0x11fa39,null))[_0x37f6('0x26')](saveUpdates(_0x132fe8['body'],null))[_0x37f6('0x26')](respondWithResult(_0x11fa39,null))[_0x37f6('0x45')](handleError(_0x11fa39,null));};exports[_0x37f6('0x4d')]=function(_0x433b04,_0x78f283){return db[_0x37f6('0x42')]['find']({'where':{'id':_0x433b04['params']['id']}})[_0x37f6('0x26')](handleEntityNotFound(_0x78f283,null))[_0x37f6('0x26')](removeEntity(_0x78f283,null))[_0x37f6('0x45')](handleError(_0x78f283,null));};exports[_0x37f6('0x4e')]=function(_0x1690fa,_0x1499de,_0x7f86ba){var _0x4511e1={};var _0x2bfe17={};var _0x2c0c53;var _0x54f3ae;return db[_0x37f6('0x42')][_0x37f6('0x4f')]({'where':{'id':_0x1690fa[_0x37f6('0x47')]['id']}})[_0x37f6('0x26')](handleEntityNotFound(_0x1499de,null))[_0x37f6('0x26')](function(_0x485311){if(_0x485311){_0x2c0c53=_0x485311;_0x2bfe17[_0x37f6('0x30')]=_[_0x37f6('0x31')](db[_0x37f6('0x50')][_0x37f6('0x2d')]);_0x2bfe17[_0x37f6('0x32')]=_[_0x37f6('0x31')](_0x1690fa[_0x37f6('0x32')]);_0x2bfe17['filters']=_['intersection'](_0x2bfe17[_0x37f6('0x30')],_0x2bfe17[_0x37f6('0x32')]);_0x4511e1[_0x37f6('0x36')]=_[_0x37f6('0x34')](_0x2bfe17['model'],qs['fields'](_0x1690fa[_0x37f6('0x32')][_0x37f6('0x35')]));_0x4511e1[_0x37f6('0x36')]=_0x4511e1['attributes'][_0x37f6('0x48')]?_0x4511e1[_0x37f6('0x36')]:_0x2bfe17[_0x37f6('0x30')];_0x4511e1[_0x37f6('0x39')]=qs[_0x37f6('0x3a')](_0x1690fa['query'][_0x37f6('0x3a')]);_0x4511e1[_0x37f6('0x3b')]=qs[_0x37f6('0x33')](_[_0x37f6('0x3c')](_0x1690fa[_0x37f6('0x32')],_0x2bfe17[_0x37f6('0x33')]));if(_0x1690fa[_0x37f6('0x32')][_0x37f6('0x3d')]){_0x4511e1[_0x37f6('0x3b')]=_[_0x37f6('0x3e')](_0x4511e1[_0x37f6('0x3b')],{'$or':_[_0x37f6('0x2c')](_0x4511e1[_0x37f6('0x36')],function(_0x28a42f){var _0xe35bc={};_0xe35bc[_0x28a42f]={'$like':'%'+_0x1690fa[_0x37f6('0x32')][_0x37f6('0x3d')]+'%'};return _0xe35bc;})});}_0x4511e1=_['merge']({},_0x4511e1,_0x1690fa[_0x37f6('0x40')]);return _0x2c0c53[_0x37f6('0x4e')](_0x4511e1);}})[_0x37f6('0x26')](function(_0x14a2ec){if(_0x14a2ec){_0x54f3ae=_0x14a2ec['length'];if(!_0x1690fa[_0x37f6('0x32')][_0x37f6('0x37')](_0x37f6('0x38'))){_0x4511e1[_0x37f6('0x1d')]=qs[_0x37f6('0x1d')](_0x1690fa['query'][_0x37f6('0x1d')]);_0x4511e1['offset']=qs[_0x37f6('0x1c')](_0x1690fa[_0x37f6('0x32')][_0x37f6('0x1c')]);}return _0x2c0c53['getConfigurations'](_0x4511e1);}})['then'](function(_0x8d1ec5){if(_0x8d1ec5){return _0x8d1ec5?{'count':_0x54f3ae,'rows':_0x8d1ec5}:null;}})[_0x37f6('0x26')](respondWithResult(_0x1499de,null))['catch'](handleError(_0x1499de,null));};exports['addConfiguration']=function(_0x28ac8a,_0x37e63f,_0x205244){if(_0x28ac8a[_0x37f6('0x4c')]['id']){delete _0x28ac8a[_0x37f6('0x4c')]['id'];}return db[_0x37f6('0x42')][_0x37f6('0x4f')]({'where':{'id':_0x28ac8a[_0x37f6('0x47')]['id']}})[_0x37f6('0x26')](handleEntityNotFound(_0x37e63f,null))[_0x37f6('0x26')](function(_0x1902d0){if(_0x1902d0){_0x28ac8a[_0x37f6('0x4c')][_0x37f6('0x51')]=_0x1902d0['id'];_0x28ac8a[_0x37f6('0x4c')][_0x37f6('0x52')]=integrations[_0x37f6('0x53')](_0x28ac8a[_0x37f6('0x4c')][_0x37f6('0x54')],_0x28ac8a[_0x37f6('0x4c')][_0x37f6('0x2f')]);_0x28ac8a[_0x37f6('0x4c')]['Descriptions']=integrations[_0x37f6('0x55')](_0x28ac8a[_0x37f6('0x4c')]['channel'],_0x28ac8a[_0x37f6('0x4c')][_0x37f6('0x2f')]);return db[_0x37f6('0x50')][_0x37f6('0x4b')](_0x28ac8a[_0x37f6('0x4c')],{'include':[{'model':db[_0x37f6('0x56')],'as':'Subjects'},{'model':db['ZohoField'],'as':_0x37f6('0x57')}]});}return null;})[_0x37f6('0x26')](respondWithResult(_0x37e63f,null))[_0x37f6('0x45')](handleError(_0x37e63f,null));};function getAccessToken(_0x2587b9){return new Promise(function(_0x17873c,_0x4b2436){var _0x43e85d;switch(_0x2587b9['zone']){case'US':_0x43e85d=_0x37f6('0x58');break;case'AU':_0x43e85d='https://accounts.zoho.com.au';break;case'EU':_0x43e85d=_0x37f6('0x59');break;case'IN':_0x43e85d=_0x37f6('0x5a');break;case'CN':_0x43e85d=_0x37f6('0x5b');break;default:_0x43e85d=_0x37f6('0x59');break;}var _0x1a84c8={'method':_0x37f6('0x5c'),'uri':_0x43e85d+'/oauth/v2/token','qs':{'refresh_token':_0x2587b9[_0x37f6('0x5d')],'client_id':_0x2587b9[_0x37f6('0x5e')],'client_secret':_0x2587b9[_0x37f6('0x5f')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x1a84c8)[_0x37f6('0x26')](function(_0x48a25a){if(_0x48a25a[_0x37f6('0x60')]){_0x17873c(_0x48a25a[_0x37f6('0x60')]);}else{_0x4b2436(_0x37f6('0x61'));}})[_0x37f6('0x45')](function(_0xf812d8){_0x4b2436(_0xf812d8);});});}exports['getFields']=function(_0x475054,_0x3e9774,_0x253703){var _0x56079f,_0x44d03f,_0x31b21e,_0x5fec70,_0x2d3edd;return db[_0x37f6('0x42')][_0x37f6('0x4f')]({'where':{'id':_0x475054[_0x37f6('0x47')]['id']},'attributes':['id',_0x37f6('0x62'),_0x37f6('0x63'),_0x37f6('0x5e'),_0x37f6('0x5f'),_0x37f6('0x64'),'code','refreshToken']})[_0x37f6('0x26')](handleEntityNotFound(_0x3e9774,null))['then'](function(_0x257f88){_0x2d3edd=_0x257f88;_0x56079f=_0x2d3edd[_0x37f6('0x62')];_0x44d03f=_0x56079f==='zoho.eu'?'eu':_0x37f6('0x65');_0x31b21e=_0x2d3edd['serverUrl'];var _0x28ff5a=_0x31b21e['slice'](-0x1);if(_0x28ff5a==='/'||_0x28ff5a==='\x5c'||_0x28ff5a===':'){_0x31b21e=_0x31b21e[_0x37f6('0x66')](0x0,_0x31b21e['lastIndexOf'](_0x28ff5a));}if(!_0x2d3edd[_0x37f6('0x5d')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x2d3edd);})[_0x37f6('0x26')](function(_0x14660d){if(_0x14660d){return rp({'method':_0x37f6('0x67'),'uri':util['format'](_0x37f6('0x68'),_0x44d03f),'qs':{'module':'Calls'},'headers':{'Authorization':_0x37f6('0x69')+_0x14660d},'json':!![]});}})['then'](function(_0x111cf4){if(_0x111cf4){if(_0x111cf4[_0x37f6('0x6a')]&&_0x111cf4[_0x37f6('0x6a')][_0x37f6('0x6b')]){throw new Error(_0x111cf4[_0x37f6('0x6a')][_0x37f6('0x6b')][_0x37f6('0x6c')]);}var _0x41aff2=[];var _0x332c8e=[];var _0x40547c=[_0x37f6('0x6d'),_0x37f6('0x6e'),_0x37f6('0x6f'),_0x37f6('0x70'),_0x37f6('0x71'),_0x37f6('0x72'),_0x37f6('0x73'),_0x37f6('0x74')];_0x332c8e=_[_0x37f6('0x75')](_0x111cf4['fields'],function(_0x1b2048){return _0x40547c[_0x37f6('0x76')](_0x1b2048[_0x37f6('0x77')]);});for(var _0x3724b7=0x0;_0x3724b7<_0x332c8e['length'];_0x3724b7++){if(_0x332c8e[_0x3724b7][_0x37f6('0x78')]===![]){_0x41aff2[_0x37f6('0x79')]({'id':_0x332c8e[_0x3724b7]['id'],'name':_0x332c8e[_0x3724b7]['display_label'],'custom':_0x332c8e[_0x3724b7][_0x37f6('0x7a')],'options':_0x332c8e[_0x3724b7][_0x37f6('0x7b')]===_0x37f6('0x7c')&&_0x332c8e[_0x3724b7][_0x37f6('0x7d')][_0x37f6('0x48')]>-0x1?_[_0x37f6('0x2c')](_0x332c8e[_0x3724b7][_0x37f6('0x7d')],function(_0x5dcf1e){return{'name':_0x5dcf1e,'value':_0x5dcf1e};}):[]});}}return{'count':_0x41aff2[_0x37f6('0x48')],'rows':_0x41aff2};}else{return{'count':0x0,'rows':[]};}})[_0x37f6('0x26')](respondWithResult(_0x3e9774,null))[_0x37f6('0x45')](function(_0x77b61b){var _0x19cf93=_0x475054[_0x37f6('0x32')][_0x37f6('0x7e')]?0x1f4:_0x77b61b[_0x37f6('0x7f')]||0x1f4;logger[_0x37f6('0x6b')](_0x37f6('0x80'),_0x37f6('0x81'),_0x19cf93,JSON['stringify'](_0x77b61b));delete _0x77b61b[_0x37f6('0x29')];if(_0x19cf93===0x191){_0x19cf93=0x190;}_0x3e9774[_0x37f6('0x1a')](_0x19cf93)[_0x37f6('0x2a')](_0x475054[_0x37f6('0x32')][_0x37f6('0x7e')]?{'message':'Wrong\x20credentials','statusCode':_0x77b61b[_0x37f6('0x7f')]}:_0x77b61b);});};
\ No newline at end of file
+var _0x276c=['reject','update','then','destroy','error','name','map','ZohoAccount','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','keys','catch','create','body','find','getConfigurations','ZohoConfiguration','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ZohoField','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','code','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','Call_Duration','Call_Result','Call_Start_Time','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../components/integrations/configuration','sendStatus','end','json','undefined','limit','offset','count','status','set','apply'];(function(_0xe8e1a7,_0x5ec6b0){var _0x1c5ed7=function(_0x534c9e){while(--_0x534c9e){_0xe8e1a7['push'](_0xe8e1a7['shift']());}};_0x1c5ed7(++_0x5ec6b0);}(_0x276c,0x15a));var _0xc276=function(_0x24bdc2,_0x15b232){_0x24bdc2=_0x24bdc2-0x0;var _0x34310e=_0x276c[_0x24bdc2];return _0x34310e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc276('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc276('0x1'));var rp=require(_0xc276('0x2'));var moment=require(_0xc276('0x3'));var BPromise=require(_0xc276('0x4'));var Mustache=require(_0xc276('0x5'));var util=require('util');var path=require(_0xc276('0x6'));var sox=require(_0xc276('0x7'));var csv=require('to-csv');var ejs=require(_0xc276('0x8'));var fs=require('fs');var fs_extra=require(_0xc276('0x9'));var _=require(_0xc276('0xa'));var squel=require(_0xc276('0xb'));var crypto=require(_0xc276('0xc'));var jsforce=require(_0xc276('0xd'));var deskjs=require(_0xc276('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc276('0xf'));var Papa=require(_0xc276('0x10'));var Redis=require(_0xc276('0x11'));var authService=require(_0xc276('0x12'));var qs=require(_0xc276('0x13'));var as=require(_0xc276('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc276('0x15'))(_0xc276('0x16'));var utils=require('../../config/utils');var config=require(_0xc276('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xc276('0x18'));function respondWithStatusCode(_0x54953d,_0x400e51){_0x400e51=_0x400e51||0xcc;return function(_0x43f7f3){if(_0x43f7f3){return _0x54953d[_0xc276('0x19')](_0x400e51);}return _0x54953d['status'](_0x400e51)[_0xc276('0x1a')]();};}function respondWithResult(_0x35a2d5,_0x12e860){_0x12e860=_0x12e860||0xc8;return function(_0x4459f6){if(_0x4459f6){return _0x35a2d5['status'](_0x12e860)[_0xc276('0x1b')](_0x4459f6);}};}function respondWithFilteredResult(_0x34c547,_0x5c5a42){return function(_0x1aeb12){if(_0x1aeb12){var _0x3c4309=typeof _0x5c5a42['offset']===_0xc276('0x1c')&&typeof _0x5c5a42[_0xc276('0x1d')]==='undefined';var _0x3971b7=_0x1aeb12['count'];var _0x35186b=_0x3c4309?0x0:_0x5c5a42[_0xc276('0x1e')];var _0x2f8b17=_0x3c4309?_0x1aeb12[_0xc276('0x1f')]:_0x5c5a42[_0xc276('0x1e')]+_0x5c5a42['limit'];var _0x36bf88;if(_0x2f8b17>=_0x3971b7){_0x2f8b17=_0x3971b7;_0x36bf88=0xc8;}else{_0x36bf88=0xce;}_0x34c547[_0xc276('0x20')](_0x36bf88);return _0x34c547[_0xc276('0x21')]('Content-Range',_0x35186b+'-'+_0x2f8b17+'/'+_0x3971b7)[_0xc276('0x1b')](_0x1aeb12);}return null;};}function patchUpdates(_0x37c5d9){return function(_0x280828){try{jsonpatch[_0xc276('0x22')](_0x280828,_0x37c5d9,!![]);}catch(_0x1d6c4f){return BPromise[_0xc276('0x23')](_0x1d6c4f);}return _0x280828['save']();};}function saveUpdates(_0x1ac608,_0x14a577){return function(_0x8c33ed){if(_0x8c33ed){return _0x8c33ed[_0xc276('0x24')](_0x1ac608)[_0xc276('0x25')](function(_0x4bb1c2){return _0x4bb1c2;});}return null;};}function removeEntity(_0x5315b5,_0x26a3d6){return function(_0x2cf272){if(_0x2cf272){return _0x2cf272[_0xc276('0x26')]()[_0xc276('0x25')](function(){_0x5315b5[_0xc276('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cd2b5,_0x52f14d){return function(_0x5b249d){if(!_0x5b249d){_0x1cd2b5['sendStatus'](0x194);}return _0x5b249d;};}function handleError(_0x105086,_0xf20b89){_0xf20b89=_0xf20b89||0x1f4;return function(_0xeedfbd){logger[_0xc276('0x27')](_0xeedfbd['stack']);if(_0xeedfbd[_0xc276('0x28')]){delete _0xeedfbd[_0xc276('0x28')];}_0x105086[_0xc276('0x20')](_0xf20b89)['send'](_0xeedfbd);};}exports['index']=function(_0x7be6a0,_0x3490cc){var _0xc8b94c={},_0x48a83a={},_0x521e4b={'count':0x0,'rows':[]};var _0x354063=_[_0xc276('0x29')](db[_0xc276('0x2a')][_0xc276('0x2b')],function(_0x18a5e6){return{'name':_0x18a5e6['fieldName'],'type':_0x18a5e6[_0xc276('0x2c')][_0xc276('0x2d')]};});_0x48a83a[_0xc276('0x2e')]=_[_0xc276('0x29')](_0x354063,_0xc276('0x28'));_0x48a83a[_0xc276('0x2f')]=_['keys'](_0x7be6a0[_0xc276('0x2f')]);_0x48a83a[_0xc276('0x30')]=_['intersection'](_0x48a83a['model'],_0x48a83a[_0xc276('0x2f')]);_0xc8b94c[_0xc276('0x31')]=_[_0xc276('0x32')](_0x48a83a[_0xc276('0x2e')],qs[_0xc276('0x33')](_0x7be6a0[_0xc276('0x2f')][_0xc276('0x33')]));_0xc8b94c[_0xc276('0x31')]=_0xc8b94c['attributes'][_0xc276('0x34')]?_0xc8b94c[_0xc276('0x31')]:_0x48a83a[_0xc276('0x2e')];if(!_0x7be6a0[_0xc276('0x2f')][_0xc276('0x35')](_0xc276('0x36'))){_0xc8b94c[_0xc276('0x1d')]=qs[_0xc276('0x1d')](_0x7be6a0[_0xc276('0x2f')][_0xc276('0x1d')]);_0xc8b94c[_0xc276('0x1e')]=qs[_0xc276('0x1e')](_0x7be6a0['query']['offset']);}_0xc8b94c['order']=qs[_0xc276('0x37')](_0x7be6a0[_0xc276('0x2f')][_0xc276('0x37')]);_0xc8b94c[_0xc276('0x38')]=qs[_0xc276('0x30')](_[_0xc276('0x39')](_0x7be6a0['query'],_0x48a83a[_0xc276('0x30')]),_0x354063);if(_0x7be6a0[_0xc276('0x2f')][_0xc276('0x3a')]){_0xc8b94c[_0xc276('0x38')]=_[_0xc276('0x3b')](_0xc8b94c['where'],{'$or':_[_0xc276('0x29')](_0x354063,function(_0x31473a){if(_0x31473a[_0xc276('0x2c')]!==_0xc276('0x3c')){var _0xc0c99f={};_0xc0c99f[_0x31473a[_0xc276('0x28')]]={'$like':'%'+_0x7be6a0[_0xc276('0x2f')][_0xc276('0x3a')]+'%'};return _0xc0c99f;}})});}_0xc8b94c=_[_0xc276('0x3b')]({},_0xc8b94c,_0x7be6a0[_0xc276('0x3d')]);var _0x53987a={'where':_0xc8b94c[_0xc276('0x38')]};return db[_0xc276('0x2a')][_0xc276('0x1f')](_0x53987a)[_0xc276('0x25')](function(_0x49be84){_0x521e4b[_0xc276('0x1f')]=_0x49be84;if(_0x7be6a0['query'][_0xc276('0x3e')]){_0xc8b94c[_0xc276('0x3f')]=[{'all':!![]}];}return db['ZohoAccount'][_0xc276('0x40')](_0xc8b94c);})[_0xc276('0x25')](function(_0x45ebe2){_0x521e4b['rows']=_0x45ebe2;return _0x521e4b;})[_0xc276('0x25')](respondWithFilteredResult(_0x3490cc,_0xc8b94c))['catch'](handleError(_0x3490cc,null));};exports[_0xc276('0x41')]=function(_0x43a035,_0x367efd){var _0x4ce9a4={'raw':![],'where':{'id':_0x43a035[_0xc276('0x42')]['id']}},_0x17e28e={};_0x17e28e[_0xc276('0x2e')]=_[_0xc276('0x43')](db[_0xc276('0x2a')]['rawAttributes']);_0x17e28e[_0xc276('0x2f')]=_[_0xc276('0x43')](_0x43a035['query']);_0x17e28e[_0xc276('0x30')]=_[_0xc276('0x32')](_0x17e28e['model'],_0x17e28e[_0xc276('0x2f')]);_0x4ce9a4['attributes']=_[_0xc276('0x32')](_0x17e28e[_0xc276('0x2e')],qs[_0xc276('0x33')](_0x43a035['query'][_0xc276('0x33')]));_0x4ce9a4[_0xc276('0x31')]=_0x4ce9a4['attributes']['length']?_0x4ce9a4[_0xc276('0x31')]:_0x17e28e[_0xc276('0x2e')];if(_0x43a035[_0xc276('0x2f')]['includeAll']){_0x4ce9a4[_0xc276('0x3f')]=[{'all':!![]}];}_0x4ce9a4=_['merge']({},_0x4ce9a4,_0x43a035[_0xc276('0x3d')]);return db[_0xc276('0x2a')]['find'](_0x4ce9a4)['then'](handleEntityNotFound(_0x367efd,null))[_0xc276('0x25')](respondWithResult(_0x367efd,null))[_0xc276('0x44')](handleError(_0x367efd,null));};exports[_0xc276('0x45')]=function(_0x167094,_0x2dcd63){return db[_0xc276('0x2a')][_0xc276('0x45')](_0x167094[_0xc276('0x46')],{})[_0xc276('0x25')](respondWithResult(_0x2dcd63,0xc9))[_0xc276('0x44')](handleError(_0x2dcd63,null));};exports[_0xc276('0x24')]=function(_0x5d6ec5,_0x449883){if(_0x5d6ec5[_0xc276('0x46')]['id']){delete _0x5d6ec5[_0xc276('0x46')]['id'];}return db[_0xc276('0x2a')][_0xc276('0x47')]({'where':{'id':_0x5d6ec5[_0xc276('0x42')]['id']}})['then'](handleEntityNotFound(_0x449883,null))[_0xc276('0x25')](saveUpdates(_0x5d6ec5[_0xc276('0x46')],null))[_0xc276('0x25')](respondWithResult(_0x449883,null))[_0xc276('0x44')](handleError(_0x449883,null));};exports[_0xc276('0x26')]=function(_0x3c71f7,_0x435692){return db[_0xc276('0x2a')][_0xc276('0x47')]({'where':{'id':_0x3c71f7[_0xc276('0x42')]['id']}})[_0xc276('0x25')](handleEntityNotFound(_0x435692,null))[_0xc276('0x25')](removeEntity(_0x435692,null))[_0xc276('0x44')](handleError(_0x435692,null));};exports[_0xc276('0x48')]=function(_0x15e04e,_0x3a37e9,_0x58c96f){var _0xa58a6c={};var _0x57717f={};var _0xf99463;var _0x5bada8;return db[_0xc276('0x2a')]['findOne']({'where':{'id':_0x15e04e[_0xc276('0x42')]['id']}})['then'](handleEntityNotFound(_0x3a37e9,null))[_0xc276('0x25')](function(_0xc4e6e0){if(_0xc4e6e0){_0xf99463=_0xc4e6e0;_0x57717f[_0xc276('0x2e')]=_[_0xc276('0x43')](db[_0xc276('0x49')]['rawAttributes']);_0x57717f['query']=_['keys'](_0x15e04e['query']);_0x57717f[_0xc276('0x30')]=_[_0xc276('0x32')](_0x57717f[_0xc276('0x2e')],_0x57717f['query']);_0xa58a6c[_0xc276('0x31')]=_['intersection'](_0x57717f[_0xc276('0x2e')],qs[_0xc276('0x33')](_0x15e04e[_0xc276('0x2f')][_0xc276('0x33')]));_0xa58a6c[_0xc276('0x31')]=_0xa58a6c[_0xc276('0x31')]['length']?_0xa58a6c[_0xc276('0x31')]:_0x57717f[_0xc276('0x2e')];_0xa58a6c[_0xc276('0x4a')]=qs[_0xc276('0x37')](_0x15e04e[_0xc276('0x2f')]['sort']);_0xa58a6c[_0xc276('0x38')]=qs[_0xc276('0x30')](_[_0xc276('0x39')](_0x15e04e[_0xc276('0x2f')],_0x57717f[_0xc276('0x30')]));if(_0x15e04e[_0xc276('0x2f')][_0xc276('0x3a')]){_0xa58a6c[_0xc276('0x38')]=_[_0xc276('0x3b')](_0xa58a6c[_0xc276('0x38')],{'$or':_[_0xc276('0x29')](_0xa58a6c[_0xc276('0x31')],function(_0xfd8014){var _0x17b7d5={};_0x17b7d5[_0xfd8014]={'$like':'%'+_0x15e04e[_0xc276('0x2f')][_0xc276('0x3a')]+'%'};return _0x17b7d5;})});}_0xa58a6c=_[_0xc276('0x3b')]({},_0xa58a6c,_0x15e04e[_0xc276('0x3d')]);return _0xf99463[_0xc276('0x48')](_0xa58a6c);}})[_0xc276('0x25')](function(_0x4f06a1){if(_0x4f06a1){_0x5bada8=_0x4f06a1[_0xc276('0x34')];if(!_0x15e04e[_0xc276('0x2f')][_0xc276('0x35')]('nolimit')){_0xa58a6c['limit']=qs[_0xc276('0x1d')](_0x15e04e[_0xc276('0x2f')][_0xc276('0x1d')]);_0xa58a6c[_0xc276('0x1e')]=qs[_0xc276('0x1e')](_0x15e04e[_0xc276('0x2f')][_0xc276('0x1e')]);}return _0xf99463[_0xc276('0x48')](_0xa58a6c);}})[_0xc276('0x25')](function(_0x4db2f4){if(_0x4db2f4){return _0x4db2f4?{'count':_0x5bada8,'rows':_0x4db2f4}:null;}})[_0xc276('0x25')](respondWithResult(_0x3a37e9,null))['catch'](handleError(_0x3a37e9,null));};exports[_0xc276('0x4b')]=function(_0x24a6ad,_0x378dc3,_0x49968a){if(_0x24a6ad[_0xc276('0x46')]['id']){delete _0x24a6ad['body']['id'];}return db['ZohoAccount']['findOne']({'where':{'id':_0x24a6ad[_0xc276('0x42')]['id']}})[_0xc276('0x25')](handleEntityNotFound(_0x378dc3,null))[_0xc276('0x25')](function(_0x2306ca){if(_0x2306ca){_0x24a6ad['body'][_0xc276('0x4c')]=_0x2306ca['id'];_0x24a6ad[_0xc276('0x46')][_0xc276('0x4d')]=integrations[_0xc276('0x4e')](_0x24a6ad[_0xc276('0x46')][_0xc276('0x4f')],_0x24a6ad['body'][_0xc276('0x2c')]);_0x24a6ad[_0xc276('0x46')][_0xc276('0x50')]=integrations['getDescriptions'](_0x24a6ad[_0xc276('0x46')][_0xc276('0x4f')],_0x24a6ad[_0xc276('0x46')][_0xc276('0x2c')]);return db['ZohoConfiguration'][_0xc276('0x45')](_0x24a6ad[_0xc276('0x46')],{'include':[{'model':db[_0xc276('0x51')],'as':_0xc276('0x4d')},{'model':db[_0xc276('0x51')],'as':'Descriptions'}]});}return null;})[_0xc276('0x25')](respondWithResult(_0x378dc3,null))[_0xc276('0x44')](handleError(_0x378dc3,null));};function getAccessToken(_0x321b1b){return new Promise(function(_0x10d78c,_0x23e753){var _0x245d04;switch(_0x321b1b['zone']){case'US':_0x245d04='https://accounts.zoho.com';break;case'AU':_0x245d04='https://accounts.zoho.com.au';break;case'EU':_0x245d04=_0xc276('0x52');break;case'IN':_0x245d04=_0xc276('0x53');break;case'CN':_0x245d04=_0xc276('0x54');break;default:_0x245d04=_0xc276('0x52');break;}var _0x101a14={'method':_0xc276('0x55'),'uri':_0x245d04+_0xc276('0x56'),'qs':{'refresh_token':_0x321b1b[_0xc276('0x57')],'client_id':_0x321b1b['clientId'],'client_secret':_0x321b1b[_0xc276('0x58')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x101a14)[_0xc276('0x25')](function(_0x3e2db7){if(_0x3e2db7[_0xc276('0x59')]){_0x10d78c(_0x3e2db7[_0xc276('0x59')]);}else{_0x23e753(_0xc276('0x5a'));}})[_0xc276('0x44')](function(_0x4bcffd){_0x23e753(_0x4bcffd);});});}exports[_0xc276('0x5b')]=function(_0x1855f9,_0x541594,_0x52fbd0){var _0x57f444,_0x2cc5f6,_0xe75405,_0x1e1b6f,_0x383c38;return db[_0xc276('0x2a')]['findOne']({'where':{'id':_0x1855f9[_0xc276('0x42')]['id']},'attributes':['id',_0xc276('0x5c'),'zone','clientId',_0xc276('0x58'),'serverUrl',_0xc276('0x5d'),_0xc276('0x57')]})[_0xc276('0x25')](handleEntityNotFound(_0x541594,null))[_0xc276('0x25')](function(_0x41345e){_0x383c38=_0x41345e;_0x57f444=_0x383c38['host'];_0x2cc5f6=_0x57f444===_0xc276('0x5e')?'eu':_0xc276('0x5f');_0xe75405=_0x383c38['serverUrl'];var _0x160480=_0xe75405[_0xc276('0x60')](-0x1);if(_0x160480==='/'||_0x160480==='\x5c'||_0x160480===':'){_0xe75405=_0xe75405[_0xc276('0x61')](0x0,_0xe75405[_0xc276('0x62')](_0x160480));}if(!_0x383c38[_0xc276('0x57')]){throw new Error(_0xc276('0x63'));}return getAccessToken(_0x383c38);})[_0xc276('0x25')](function(_0x3ddca4){if(_0x3ddca4){return rp({'method':_0xc276('0x64'),'uri':util[_0xc276('0x65')](_0xc276('0x66'),_0x2cc5f6),'qs':{'module':_0xc276('0x67')},'headers':{'Authorization':_0xc276('0x68')+_0x3ddca4},'json':!![]});}})[_0xc276('0x25')](function(_0xbe67e5){if(_0xbe67e5){if(_0xbe67e5[_0xc276('0x69')]&&_0xbe67e5[_0xc276('0x69')][_0xc276('0x27')]){throw new Error(_0xbe67e5[_0xc276('0x69')][_0xc276('0x27')][_0xc276('0x6a')]);}var _0x22c833=[];var _0x4fe5ff=[];var _0x1644e2=[_0xc276('0x6b'),_0xc276('0x6c'),_0xc276('0x6d'),'WhoId',_0xc276('0x6e'),_0xc276('0x6f'),_0xc276('0x70'),'Call_Type'];_0x4fe5ff=_['remove'](_0xbe67e5[_0xc276('0x33')],function(_0x3aa590){return _0x1644e2['includes'](_0x3aa590[_0xc276('0x71')]);});for(var _0x45ffb5=0x0;_0x45ffb5<_0x4fe5ff[_0xc276('0x34')];_0x45ffb5++){if(_0x4fe5ff[_0x45ffb5][_0xc276('0x72')]===![]){_0x22c833[_0xc276('0x73')]({'id':_0x4fe5ff[_0x45ffb5]['id'],'name':_0x4fe5ff[_0x45ffb5][_0xc276('0x74')],'custom':_0x4fe5ff[_0x45ffb5][_0xc276('0x75')],'options':_0x4fe5ff[_0x45ffb5][_0xc276('0x76')]===_0xc276('0x77')&&_0x4fe5ff[_0x45ffb5][_0xc276('0x78')][_0xc276('0x34')]>-0x1?_[_0xc276('0x29')](_0x4fe5ff[_0x45ffb5][_0xc276('0x78')],function(_0x1f18e0){return{'name':_0x1f18e0,'value':_0x1f18e0};}):[]});}}return{'count':_0x22c833[_0xc276('0x34')],'rows':_0x22c833};}else{return{'count':0x0,'rows':[]};}})[_0xc276('0x25')](respondWithResult(_0x541594,null))[_0xc276('0x44')](function(_0x250450){var _0x456734=_0x1855f9[_0xc276('0x2f')][_0xc276('0x79')]?0x1f4:_0x250450['statusCode']||0x1f4;logger[_0xc276('0x27')](_0xc276('0x7a'),_0xc276('0x5b'),_0x456734,JSON[_0xc276('0x7b')](_0x250450));delete _0x250450[_0xc276('0x28')];if(_0x456734===0x191){_0x456734=0x190;}_0x541594[_0xc276('0x20')](_0x456734)[_0xc276('0x7c')](_0x1855f9[_0xc276('0x2f')][_0xc276('0x79')]?{'message':_0xc276('0x7d'),'statusCode':_0x250450[_0xc276('0x7e')]}:_0x250450);});};
\ No newline at end of file
index c5c3bbe..122f80b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x979d=['path','./intZohoAccount.attributes','../../components/integrations/configuration','define','int_zoho_accounts','changed','zone','clientId','clientSecret','host','serverUrl','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','code','then','refresh_token','refreshToken','info','name','error','format','catch','inspect','application/x-www-form-urlencoded','parse','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','util','../../config/logger','api'];(function(_0x519756,_0x288785){var _0x37047e=function(_0x3d64a7){while(--_0x3d64a7){_0x519756['push'](_0x519756['shift']());}};_0x37047e(++_0x288785);}(_0x979d,0xdb));var _0xd979=function(_0x3ae0ab,_0x2083a1){_0x3ae0ab=_0x3ae0ab-0x0;var _0x58bb98=_0x979d[_0x3ae0ab];return _0x58bb98;};'use strict';var _=require('lodash');var util=require(_0xd979('0x0'));var logger=require(_0xd979('0x1'))(_0xd979('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd979('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd979('0x4'));var integrations=require(_0xd979('0x5'));module['exports']=function(_0x47a680,_0x279784){return _0x47a680[_0xd979('0x6')]('ZohoAccount',attributes,{'tableName':_0xd979('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x512aa2,_0x525fcf,_0x3cf5f3){if(_0x512aa2[_0xd979('0x8')](_0xd979('0x9'))||_0x512aa2[_0xd979('0x8')]('serverUrl')||_0x512aa2[_0xd979('0x8')](_0xd979('0xa'))||_0x512aa2[_0xd979('0x8')](_0xd979('0xb'))||_0x512aa2[_0xd979('0x8')]('code')||_0x512aa2[_0xd979('0x8')](_0xd979('0xc'))){var _0x308e15,_0x8170f;_0x308e15=_0x512aa2[_0xd979('0xd')];var _0x4d83a8=_0x308e15['slice'](-0x1);if(_0x4d83a8==='/'||_0x4d83a8==='\x5c'||_0x4d83a8===':'){_0x308e15=_0x308e15[_0xd979('0xe')](0x0,_0x308e15[_0xd979('0xf')](_0x4d83a8));}switch(_0x512aa2['zone']){case'US':_0x8170f=_0xd979('0x10');break;case'AU':_0x8170f=_0xd979('0x11');break;case'IN':_0x8170f=_0xd979('0x12');break;case'CN':_0x8170f=_0xd979('0x13');break;default:_0x8170f=_0xd979('0x14');break;}var _0x20382d={'method':_0xd979('0x15'),'uri':_0x8170f+_0xd979('0x16'),'form':{'grant_type':_0xd979('0x17'),'client_id':_0x512aa2[_0xd979('0xa')],'client_secret':_0x512aa2[_0xd979('0xb')],'redirect_uri':_0x512aa2[_0xd979('0xd')],'code':_0x512aa2[_0xd979('0x18')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x20382d)[_0xd979('0x19')](function(_0x561483){var _0x212c49=JSON['parse'](_0x561483);if(_0x212c49[_0xd979('0x1a')]){_0x512aa2[_0xd979('0x1b')]=_0x212c49['refresh_token'];logger[_0xd979('0x1c')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x512aa2[_0xd979('0x1d')],_0x512aa2['id']));}else{logger[_0xd979('0x1e')](util[_0xd979('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x512aa2[_0xd979('0x1d')],_0x512aa2['id']),util['inspect'](_0x212c49,{'showHidden':![],'depth':null}));}return _0x3cf5f3(null,_0x525fcf);})[_0xd979('0x20')](function(_0x5c184a){logger[_0xd979('0x1e')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x512aa2['name'],_0x512aa2['id']),util[_0xd979('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x3cf5f3(_0x5c184a);});}else{return _0x3cf5f3(null,_0x525fcf);}},'beforeUpdate':function(_0x345842,_0x25ce56,_0x4432af){if(_0x345842[_0xd979('0x8')](_0xd979('0x9'))||_0x345842['changed']('serverUrl')||_0x345842[_0xd979('0x8')](_0xd979('0xa'))||_0x345842[_0xd979('0x8')]('clientSecret')||_0x345842['changed'](_0xd979('0x18'))||_0x345842[_0xd979('0x8')](_0xd979('0xc'))){var _0x71ab94,_0x14ff2c;_0x71ab94=_0x345842[_0xd979('0xd')];var _0x2de722=_0x71ab94['slice'](-0x1);if(_0x2de722==='/'||_0x2de722==='\x5c'||_0x2de722===':'){_0x71ab94=_0x71ab94[_0xd979('0xe')](0x0,_0x71ab94[_0xd979('0xf')](_0x2de722));}switch(_0x345842[_0xd979('0x9')]){case'US':_0x14ff2c=_0xd979('0x10');break;case'AU':_0x14ff2c='https://accounts.zoho.com.au';break;case'IN':_0x14ff2c=_0xd979('0x12');break;case'CN':_0x14ff2c='https://accounts.zoho.com.cn';break;default:_0x14ff2c='https://accounts.zoho.eu';break;}var _0x274f57={'method':'POST','uri':_0x14ff2c+'/oauth/v2/token','form':{'grant_type':_0xd979('0x17'),'client_id':_0x345842['clientId'],'client_secret':_0x345842[_0xd979('0xb')],'redirect_uri':_0x345842[_0xd979('0xd')],'code':_0x345842[_0xd979('0x18')]},'headers':{'Content-Type':_0xd979('0x22')}};return rp(_0x274f57)['then'](function(_0x574b9d){var _0x5b09ba=JSON[_0xd979('0x23')](_0x574b9d);if(_0x5b09ba[_0xd979('0x1a')]){_0x345842[_0xd979('0x1b')]=_0x5b09ba[_0xd979('0x1a')];logger[_0xd979('0x1c')](util[_0xd979('0x1f')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x345842[_0xd979('0x1d')],_0x345842['id']));}else{logger[_0xd979('0x1e')](util[_0xd979('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x345842[_0xd979('0x1d')],_0x345842['id']),util[_0xd979('0x21')](_0x5b09ba,{'showHidden':![],'depth':null}));}return _0x4432af(null,_0x25ce56);})['catch'](function(_0x318642){logger[_0xd979('0x1e')](util[_0xd979('0x1f')](_0xd979('0x24'),_0x345842[_0xd979('0x1d')],_0x345842['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x4432af(_0x318642);});}else{return _0x4432af(null,_0x25ce56);}}}});};
\ No newline at end of file
+var _0x3dcc=['lastIndexOf','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','https://accounts.zoho.com','https://accounts.zoho.com.cn','authorization_code','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','zone','serverUrl','changed','clientId','clientSecret','code','host','slice','substring'];(function(_0x52d99c,_0x5745a8){var _0x44b4c9=function(_0x3e50a5){while(--_0x3e50a5){_0x52d99c['push'](_0x52d99c['shift']());}};_0x44b4c9(++_0x5745a8);}(_0x3dcc,0x99));var _0xc3dc=function(_0x176d14,_0x3984ea){_0x176d14=_0x176d14-0x0;var _0x89522c=_0x3dcc[_0x176d14];return _0x89522c;};'use strict';var _=require('lodash');var util=require(_0xc3dc('0x0'));var logger=require(_0xc3dc('0x1'))(_0xc3dc('0x2'));var moment=require(_0xc3dc('0x3'));var BPromise=require(_0xc3dc('0x4'));var rp=require(_0xc3dc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc3dc('0x6'));var config=require(_0xc3dc('0x7'));var attributes=require(_0xc3dc('0x8'));var integrations=require(_0xc3dc('0x9'));module[_0xc3dc('0xa')]=function(_0x22a2ea,_0x5b796c){return _0x22a2ea[_0xc3dc('0xb')](_0xc3dc('0xc'),attributes,{'tableName':_0xc3dc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x14e25f,_0x4c399b,_0x364231){if(_0x14e25f['changed'](_0xc3dc('0xe'))||_0x14e25f['changed'](_0xc3dc('0xf'))||_0x14e25f[_0xc3dc('0x10')](_0xc3dc('0x11'))||_0x14e25f[_0xc3dc('0x10')](_0xc3dc('0x12'))||_0x14e25f[_0xc3dc('0x10')](_0xc3dc('0x13'))||_0x14e25f[_0xc3dc('0x10')](_0xc3dc('0x14'))){var _0x78cec5,_0x1557b4;_0x78cec5=_0x14e25f[_0xc3dc('0xf')];var _0x2ea2ee=_0x78cec5[_0xc3dc('0x15')](-0x1);if(_0x2ea2ee==='/'||_0x2ea2ee==='\x5c'||_0x2ea2ee===':'){_0x78cec5=_0x78cec5[_0xc3dc('0x16')](0x0,_0x78cec5[_0xc3dc('0x17')](_0x2ea2ee));}switch(_0x14e25f[_0xc3dc('0xe')]){case'US':_0x1557b4='https://accounts.zoho.com';break;case'AU':_0x1557b4='https://accounts.zoho.com.au';break;case'IN':_0x1557b4=_0xc3dc('0x18');break;case'CN':_0x1557b4='https://accounts.zoho.com.cn';break;default:_0x1557b4=_0xc3dc('0x19');break;}var _0x9010e8={'method':_0xc3dc('0x1a'),'uri':_0x1557b4+_0xc3dc('0x1b'),'form':{'grant_type':'authorization_code','client_id':_0x14e25f['clientId'],'client_secret':_0x14e25f['clientSecret'],'redirect_uri':_0x14e25f[_0xc3dc('0xf')],'code':_0x14e25f[_0xc3dc('0x13')]},'headers':{'Content-Type':_0xc3dc('0x1c')}};return rp(_0x9010e8)[_0xc3dc('0x1d')](function(_0x4b7b49){var _0x5f46f2=JSON[_0xc3dc('0x1e')](_0x4b7b49);if(_0x5f46f2[_0xc3dc('0x1f')]){_0x14e25f[_0xc3dc('0x20')]=_0x5f46f2[_0xc3dc('0x1f')];logger[_0xc3dc('0x21')](util[_0xc3dc('0x22')](_0xc3dc('0x23'),_0x14e25f[_0xc3dc('0x24')],_0x14e25f['id']));}else{logger[_0xc3dc('0x25')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x14e25f[_0xc3dc('0x24')],_0x14e25f['id']),util[_0xc3dc('0x26')](_0x5f46f2,{'showHidden':![],'depth':null}));}return _0x364231(null,_0x4c399b);})[_0xc3dc('0x27')](function(_0x136a67){logger['error'](util[_0xc3dc('0x22')](_0xc3dc('0x28'),_0x14e25f[_0xc3dc('0x24')],_0x14e25f['id']),util[_0xc3dc('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x364231(_0x136a67);});}else{return _0x364231(null,_0x4c399b);}},'beforeUpdate':function(_0x254da3,_0xe0b588,_0xa0837d){if(_0x254da3[_0xc3dc('0x10')]('zone')||_0x254da3[_0xc3dc('0x10')](_0xc3dc('0xf'))||_0x254da3[_0xc3dc('0x10')]('clientId')||_0x254da3[_0xc3dc('0x10')](_0xc3dc('0x12'))||_0x254da3[_0xc3dc('0x10')](_0xc3dc('0x13'))||_0x254da3[_0xc3dc('0x10')](_0xc3dc('0x14'))){var _0x607a0c,_0x77fdaf;_0x607a0c=_0x254da3[_0xc3dc('0xf')];var _0x57cb26=_0x607a0c[_0xc3dc('0x15')](-0x1);if(_0x57cb26==='/'||_0x57cb26==='\x5c'||_0x57cb26===':'){_0x607a0c=_0x607a0c[_0xc3dc('0x16')](0x0,_0x607a0c[_0xc3dc('0x17')](_0x57cb26));}switch(_0x254da3[_0xc3dc('0xe')]){case'US':_0x77fdaf=_0xc3dc('0x29');break;case'AU':_0x77fdaf='https://accounts.zoho.com.au';break;case'IN':_0x77fdaf='https://accounts.zoho.in';break;case'CN':_0x77fdaf=_0xc3dc('0x2a');break;default:_0x77fdaf=_0xc3dc('0x19');break;}var _0x5d54bf={'method':'POST','uri':_0x77fdaf+_0xc3dc('0x1b'),'form':{'grant_type':_0xc3dc('0x2b'),'client_id':_0x254da3[_0xc3dc('0x11')],'client_secret':_0x254da3[_0xc3dc('0x12')],'redirect_uri':_0x254da3[_0xc3dc('0xf')],'code':_0x254da3['code']},'headers':{'Content-Type':_0xc3dc('0x1c')}};return rp(_0x5d54bf)[_0xc3dc('0x1d')](function(_0x47469c){var _0x612103=JSON[_0xc3dc('0x1e')](_0x47469c);if(_0x612103[_0xc3dc('0x1f')]){_0x254da3['refreshToken']=_0x612103[_0xc3dc('0x1f')];logger['info'](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x254da3[_0xc3dc('0x24')],_0x254da3['id']));}else{logger[_0xc3dc('0x25')](util['format'](_0xc3dc('0x28'),_0x254da3[_0xc3dc('0x24')],_0x254da3['id']),util[_0xc3dc('0x26')](_0x612103,{'showHidden':![],'depth':null}));}return _0xa0837d(null,_0xe0b588);})['catch'](function(_0x22e34a){logger[_0xc3dc('0x25')](util[_0xc3dc('0x22')](_0xc3dc('0x28'),_0x254da3[_0xc3dc('0x24')],_0x254da3['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0xa0837d(_0x22e34a);});}else{return _0xa0837d(null,_0xe0b588);}}}});};
\ No newline at end of file
index c7d4f2a..a304b20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1ad=['rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','GetZohoAccount','ZohoAccount','findAll','options','where','attributes','limit','include','map','model','debug','ShowZohoAccount','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x5e4f45,_0x1d31c0){var _0x20b528=function(_0x11f4fc){while(--_0x11f4fc){_0x5e4f45['push'](_0x5e4f45['shift']());}};_0x20b528(++_0x1d31c0);}(_0xb1ad,0x184));var _0xdb1a=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xb1ad[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0xdb1a('0x0'));var util=require(_0xdb1a('0x1'));var moment=require(_0xdb1a('0x2'));var BPromise=require(_0xdb1a('0x3'));var rs=require(_0xdb1a('0x4'));var fs=require('fs');var Redis=require(_0xdb1a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdb1a('0x6'));var logger=require(_0xdb1a('0x7'))(_0xdb1a('0x8'));var config=require(_0xdb1a('0x9'));var jayson=require(_0xdb1a('0xa'));var client=jayson[_0xdb1a('0xb')][_0xdb1a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x12b8c5,_0x2712fe,_0x2a24f2){return new BPromise(function(_0x5fc831,_0x188988){return client[_0xdb1a('0xd')](_0x12b8c5,_0x2a24f2)[_0xdb1a('0xe')](function(_0x122af8){logger['info'](_0xdb1a('0xf'),_0x2712fe,_0xdb1a('0x10'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x2712fe,'request\x20sent',JSON[_0xdb1a('0x11')](_0x122af8));if(_0x122af8[_0xdb1a('0x12')]){if(_0x122af8[_0xdb1a('0x12')][_0xdb1a('0x13')]===0x1f4){logger[_0xdb1a('0x12')](_0xdb1a('0xf'),_0x2712fe,_0x122af8[_0xdb1a('0x12')][_0xdb1a('0x14')]);return _0x188988(_0x122af8[_0xdb1a('0x12')][_0xdb1a('0x14')]);}logger[_0xdb1a('0x12')](_0xdb1a('0xf'),_0x2712fe,_0x122af8[_0xdb1a('0x12')]['message']);return _0x5fc831(_0x122af8[_0xdb1a('0x12')][_0xdb1a('0x14')]);}else{logger[_0xdb1a('0x15')]('ZohoAccount,\x20%s,\x20%s',_0x2712fe,_0xdb1a('0x10'));_0x5fc831(_0x122af8['result'][_0xdb1a('0x14')]);}})[_0xdb1a('0x16')](function(_0x1637fa){logger['error'](_0xdb1a('0xf'),_0x2712fe,_0x1637fa);_0x188988(_0x1637fa);});});}exports[_0xdb1a('0x17')]=function(_0x268ce8){var _0x5539bf=this;return new Promise(function(_0xe3780b,_0x30b54c){return db[_0xdb1a('0x18')][_0xdb1a('0x19')]({'raw':_0x268ce8[_0xdb1a('0x1a')]?_0x268ce8[_0xdb1a('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x268ce8[_0xdb1a('0x1a')]?_0x268ce8[_0xdb1a('0x1a')][_0xdb1a('0x1b')]||null:null,'attributes':_0x268ce8[_0xdb1a('0x1a')]?_0x268ce8[_0xdb1a('0x1a')][_0xdb1a('0x1c')]||null:null,'limit':_0x268ce8[_0xdb1a('0x1a')]?_0x268ce8[_0xdb1a('0x1a')][_0xdb1a('0x1d')]||null:null,'include':_0x268ce8[_0xdb1a('0x1a')]?_0x268ce8['options'][_0xdb1a('0x1e')]?_['map'](_0x268ce8[_0xdb1a('0x1a')][_0xdb1a('0x1e')],function(_0x3d07fc){return{'model':db[_0x3d07fc['model']],'as':_0x3d07fc['as'],'attributes':_0x3d07fc[_0xdb1a('0x1c')],'include':_0x3d07fc['include']?_[_0xdb1a('0x1f')](_0x3d07fc[_0xdb1a('0x1e')],function(_0x22c95e){return{'model':db[_0x22c95e[_0xdb1a('0x20')]],'as':_0x22c95e['as'],'attributes':_0x22c95e[_0xdb1a('0x1c')],'include':_0x22c95e[_0xdb1a('0x1e')]?_[_0xdb1a('0x1f')](_0x22c95e[_0xdb1a('0x1e')],function(_0x5c963b){return{'model':db[_0x5c963b['model']],'as':_0x5c963b['as'],'attributes':_0x5c963b[_0xdb1a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xdb1a('0xe')](function(_0x151af7){logger[_0xdb1a('0x15')](_0xdb1a('0x17'),_0x268ce8);logger[_0xdb1a('0x21')]('GetZohoAccount',_0x268ce8,JSON[_0xdb1a('0x11')](_0x151af7));_0xe3780b(_0x151af7);})['catch'](function(_0x5a67c4){logger[_0xdb1a('0x12')]('GetZohoAccount',_0x5a67c4['message'],_0x268ce8);_0x30b54c(_0x5539bf[_0xdb1a('0x12')](0x1f4,_0x5a67c4[_0xdb1a('0x14')]));});});};exports[_0xdb1a('0x22')]=function(_0x4f8c08){var _0x3ef1ce=this;return new Promise(function(_0x2080a4,_0xc684d5){return db[_0xdb1a('0x18')]['find']({'raw':_0x4f8c08[_0xdb1a('0x1a')]?_0x4f8c08[_0xdb1a('0x1a')][_0xdb1a('0x23')]===undefined?!![]:![]:!![],'where':_0x4f8c08['options']?_0x4f8c08[_0xdb1a('0x1a')][_0xdb1a('0x1b')]||null:null,'attributes':_0x4f8c08[_0xdb1a('0x1a')]?_0x4f8c08[_0xdb1a('0x1a')]['attributes']||null:null,'include':_0x4f8c08['options']?_0x4f8c08['options'][_0xdb1a('0x1e')]?_[_0xdb1a('0x1f')](_0x4f8c08['options'][_0xdb1a('0x1e')],function(_0xdd719a){return{'model':db[_0xdd719a[_0xdb1a('0x20')]],'as':_0xdd719a['as'],'attributes':_0xdd719a[_0xdb1a('0x1c')],'include':_0xdd719a[_0xdb1a('0x1e')]?_['map'](_0xdd719a['include'],function(_0x56fcf1){return{'model':db[_0x56fcf1[_0xdb1a('0x20')]],'as':_0x56fcf1['as'],'attributes':_0x56fcf1['attributes'],'include':_0x56fcf1['include']?_[_0xdb1a('0x1f')](_0x56fcf1[_0xdb1a('0x1e')],function(_0x57feab){return{'model':db[_0x57feab[_0xdb1a('0x20')]],'as':_0x57feab['as'],'attributes':_0x57feab[_0xdb1a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xdb1a('0xe')](function(_0x3459e5){logger[_0xdb1a('0x15')]('ShowZohoAccount',_0x4f8c08);logger['debug'](_0xdb1a('0x22'),_0x4f8c08,JSON[_0xdb1a('0x11')](_0x3459e5));_0x2080a4(_0x3459e5);})[_0xdb1a('0x16')](function(_0x14f66a){logger[_0xdb1a('0x12')](_0xdb1a('0x22'),_0x14f66a[_0xdb1a('0x14')],_0x4f8c08);_0xc684d5(_0x3ef1ce['error'](0x1f4,_0x14f66a[_0xdb1a('0x14')]));});});};
\ No newline at end of file
+var _0x29b6=['include','map','model','then','GetZohoAccount','catch','find','ShowZohoAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','ZohoAccount','options','raw','attributes','limit'];(function(_0x354164,_0x4c30de){var _0x5db9a8=function(_0x319b08){while(--_0x319b08){_0x354164['push'](_0x354164['shift']());}};_0x5db9a8(++_0x4c30de);}(_0x29b6,0x17e));var _0x629b=function(_0xb02a51,_0x4fefca){_0xb02a51=_0xb02a51-0x0;var _0xfdc48f=_0x29b6[_0xb02a51];return _0xfdc48f;};'use strict';var _=require(_0x629b('0x0'));var util=require(_0x629b('0x1'));var moment=require(_0x629b('0x2'));var BPromise=require(_0x629b('0x3'));var rs=require(_0x629b('0x4'));var fs=require('fs');var Redis=require(_0x629b('0x5'));var db=require(_0x629b('0x6'))['db'];var utils=require(_0x629b('0x7'));var logger=require(_0x629b('0x8'))(_0x629b('0x9'));var config=require('../../config/environment');var jayson=require(_0x629b('0xa'));var client=jayson['client'][_0x629b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4acc5a,_0x26e439,_0x398ecb){return new BPromise(function(_0x4e90cd,_0xc44b27){return client[_0x629b('0xc')](_0x4acc5a,_0x398ecb)['then'](function(_0x28c152){logger[_0x629b('0xd')](_0x629b('0xe'),_0x26e439,_0x629b('0xf'));logger[_0x629b('0x10')](_0x629b('0x11'),_0x26e439,_0x629b('0xf'),JSON[_0x629b('0x12')](_0x28c152));if(_0x28c152[_0x629b('0x13')]){if(_0x28c152[_0x629b('0x13')]['code']===0x1f4){logger['error'](_0x629b('0xe'),_0x26e439,_0x28c152[_0x629b('0x13')][_0x629b('0x14')]);return _0xc44b27(_0x28c152['error'][_0x629b('0x14')]);}logger[_0x629b('0x13')](_0x629b('0xe'),_0x26e439,_0x28c152[_0x629b('0x13')]['message']);return _0x4e90cd(_0x28c152[_0x629b('0x13')][_0x629b('0x14')]);}else{logger[_0x629b('0xd')](_0x629b('0xe'),_0x26e439,_0x629b('0xf'));_0x4e90cd(_0x28c152['result'][_0x629b('0x14')]);}})['catch'](function(_0x151b93){logger[_0x629b('0x13')](_0x629b('0xe'),_0x26e439,_0x151b93);_0xc44b27(_0x151b93);});});}exports['GetZohoAccount']=function(_0x7f24d3){var _0x58f5a8=this;return new Promise(function(_0x1c93a1,_0x4f28dd){return db[_0x629b('0x15')]['findAll']({'raw':_0x7f24d3[_0x629b('0x16')]?_0x7f24d3[_0x629b('0x16')][_0x629b('0x17')]===undefined?!![]:![]:!![],'where':_0x7f24d3['options']?_0x7f24d3[_0x629b('0x16')]['where']||null:null,'attributes':_0x7f24d3[_0x629b('0x16')]?_0x7f24d3[_0x629b('0x16')][_0x629b('0x18')]||null:null,'limit':_0x7f24d3[_0x629b('0x16')]?_0x7f24d3['options'][_0x629b('0x19')]||null:null,'include':_0x7f24d3['options']?_0x7f24d3[_0x629b('0x16')][_0x629b('0x1a')]?_[_0x629b('0x1b')](_0x7f24d3['options'][_0x629b('0x1a')],function(_0x1e773e){return{'model':db[_0x1e773e[_0x629b('0x1c')]],'as':_0x1e773e['as'],'attributes':_0x1e773e[_0x629b('0x18')],'include':_0x1e773e[_0x629b('0x1a')]?_[_0x629b('0x1b')](_0x1e773e[_0x629b('0x1a')],function(_0x547b3c){return{'model':db[_0x547b3c['model']],'as':_0x547b3c['as'],'attributes':_0x547b3c['attributes'],'include':_0x547b3c['include']?_[_0x629b('0x1b')](_0x547b3c[_0x629b('0x1a')],function(_0xf68af8){return{'model':db[_0xf68af8[_0x629b('0x1c')]],'as':_0xf68af8['as'],'attributes':_0xf68af8[_0x629b('0x18')]};}):[]};}):[]};}):[]:[]})[_0x629b('0x1d')](function(_0x4c1f21){logger[_0x629b('0xd')](_0x629b('0x1e'),_0x7f24d3);logger[_0x629b('0x10')](_0x629b('0x1e'),_0x7f24d3,JSON[_0x629b('0x12')](_0x4c1f21));_0x1c93a1(_0x4c1f21);})[_0x629b('0x1f')](function(_0x3ef549){logger[_0x629b('0x13')]('GetZohoAccount',_0x3ef549['message'],_0x7f24d3);_0x4f28dd(_0x58f5a8[_0x629b('0x13')](0x1f4,_0x3ef549[_0x629b('0x14')]));});});};exports['ShowZohoAccount']=function(_0x1628cb){var _0x56c088=this;return new Promise(function(_0x86ee7c,_0x37b918){return db['ZohoAccount'][_0x629b('0x20')]({'raw':_0x1628cb[_0x629b('0x16')]?_0x1628cb[_0x629b('0x16')][_0x629b('0x17')]===undefined?!![]:![]:!![],'where':_0x1628cb[_0x629b('0x16')]?_0x1628cb[_0x629b('0x16')]['where']||null:null,'attributes':_0x1628cb[_0x629b('0x16')]?_0x1628cb[_0x629b('0x16')][_0x629b('0x18')]||null:null,'include':_0x1628cb[_0x629b('0x16')]?_0x1628cb[_0x629b('0x16')][_0x629b('0x1a')]?_[_0x629b('0x1b')](_0x1628cb[_0x629b('0x16')][_0x629b('0x1a')],function(_0x26a541){return{'model':db[_0x26a541[_0x629b('0x1c')]],'as':_0x26a541['as'],'attributes':_0x26a541[_0x629b('0x18')],'include':_0x26a541[_0x629b('0x1a')]?_['map'](_0x26a541['include'],function(_0x17aaef){return{'model':db[_0x17aaef[_0x629b('0x1c')]],'as':_0x17aaef['as'],'attributes':_0x17aaef[_0x629b('0x18')],'include':_0x17aaef[_0x629b('0x1a')]?_['map'](_0x17aaef[_0x629b('0x1a')],function(_0x202348){return{'model':db[_0x202348[_0x629b('0x1c')]],'as':_0x202348['as'],'attributes':_0x202348[_0x629b('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x13cac7){logger[_0x629b('0xd')](_0x629b('0x21'),_0x1628cb);logger[_0x629b('0x10')](_0x629b('0x21'),_0x1628cb,JSON['stringify'](_0x13cac7));_0x86ee7c(_0x13cac7);})[_0x629b('0x1f')](function(_0x4024c7){logger[_0x629b('0x13')](_0x629b('0x21'),_0x4024c7[_0x629b('0x14')],_0x1628cb);_0x37b918(_0x56c088[_0x629b('0x13')](0x1f4,_0x4024c7[_0x629b('0x14')]));});});};
\ No newline at end of file
index 9ec01cb..1f17695 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32fc=['isAuthenticated','/:id/fields','getFields','/:id/subjects','/:id/descriptions','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','index','/:id'];(function(_0x25e109,_0x6ab24c){var _0xc0f7d6=function(_0x2fb92b){while(--_0x2fb92b){_0x25e109['push'](_0x25e109['shift']());}};_0xc0f7d6(++_0x6ab24c);}(_0x32fc,0x6b));var _0xc32f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x32fc[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc32f('0x0'));var util=require('util');var path=require(_0xc32f('0x1'));var timeout=require(_0xc32f('0x2'));var express=require(_0xc32f('0x3'));var router=express[_0xc32f('0x4')]();var fs_extra=require(_0xc32f('0x5'));var auth=require(_0xc32f('0x6'));var interaction=require(_0xc32f('0x7'));var config=require(_0xc32f('0x8'));var controller=require(_0xc32f('0x9'));router[_0xc32f('0xa')]('/',auth['isAuthenticated'](),controller[_0xc32f('0xb')]);router[_0xc32f('0xa')](_0xc32f('0xc'),auth[_0xc32f('0xd')](),controller['show']);router['get'](_0xc32f('0xe'),auth['isAuthenticated'](),controller[_0xc32f('0xf')]);router[_0xc32f('0xa')](_0xc32f('0x10'),auth[_0xc32f('0xd')](),controller['getSubjects']);router[_0xc32f('0xa')](_0xc32f('0x11'),auth[_0xc32f('0xd')](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller[_0xc32f('0x12')]);router[_0xc32f('0x13')](_0xc32f('0xc'),auth[_0xc32f('0xd')](),controller[_0xc32f('0x14')]);router[_0xc32f('0x15')]('/:id',auth[_0xc32f('0xd')](),controller[_0xc32f('0x16')]);module[_0xc32f('0x17')]=router;
\ No newline at end of file
+var _0xeff3=['path','connect-timeout','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x122eab,_0x202d5f){var _0x3bd84d=function(_0x2f2208){while(--_0x2f2208){_0x122eab['push'](_0x122eab['shift']());}};_0x3bd84d(++_0x202d5f);}(_0xeff3,0x67));var _0x3eff=function(_0x1b1f04,_0xc66e12){_0x1b1f04=_0x1b1f04-0x0;var _0x1c0109=_0xeff3[_0x1b1f04];return _0x1c0109;};'use strict';var multer=require(_0x3eff('0x0'));var util=require(_0x3eff('0x1'));var path=require(_0x3eff('0x2'));var timeout=require(_0x3eff('0x3'));var express=require('express');var router=express[_0x3eff('0x4')]();var fs_extra=require(_0x3eff('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3eff('0x6'));var config=require('../../config/environment');var controller=require('./intZohoConfiguration.controller');router[_0x3eff('0x7')]('/',auth[_0x3eff('0x8')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3eff('0x9')]);router['get'](_0x3eff('0xa'),auth[_0x3eff('0x8')](),controller[_0x3eff('0xb')]);router['get'](_0x3eff('0xc'),auth['isAuthenticated'](),controller[_0x3eff('0xd')]);router['get']('/:id/descriptions',auth[_0x3eff('0x8')](),controller[_0x3eff('0xe')]);router['post']('/',auth[_0x3eff('0x8')](),controller['create']);router[_0x3eff('0xf')](_0x3eff('0x10'),auth['isAuthenticated'](),controller[_0x3eff('0x11')]);router[_0x3eff('0x12')](_0x3eff('0x10'),auth['isAuthenticated'](),controller[_0x3eff('0x13')]);module[_0x3eff('0x14')]=router;
\ No newline at end of file
index 324e098..47f7e26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf505=['contact_lead','STRING','ENUM','lead','contact','nothing'];(function(_0xd5d972,_0x22bddb){var _0x389593=function(_0x34f2a1){while(--_0x34f2a1){_0xd5d972['push'](_0xd5d972['shift']());}};_0x389593(++_0x22bddb);}(_0xf505,0x14b));var _0x5f50=function(_0xc45596,_0x5c410e){_0xc45596=_0xc45596-0x0;var _0x425ffe=_0xf505[_0xc45596];return _0x425ffe;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5f50('0x0')]},'moduleCreate':{'type':Sequelize[_0x5f50('0x1')](_0x5f50('0x2'),_0x5f50('0x3'),_0x5f50('0x4')),'defaultValue':_0x5f50('0x2')},'moduleSearch':{'type':Sequelize['ENUM'](_0x5f50('0x5'),_0x5f50('0x3'),_0x5f50('0x2')),'defaultValue':_0x5f50('0x5')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x930b=['ENUM','lead','contact','contact_lead','sequelize','exports','STRING'];(function(_0x2c3a47,_0x170687){var _0x1c04de=function(_0x367deb){while(--_0x367deb){_0x2c3a47['push'](_0x2c3a47['shift']());}};_0x1c04de(++_0x170687);}(_0x930b,0x123));var _0xb930=function(_0x5ca1e4,_0x71441c){_0x5ca1e4=_0x5ca1e4-0x0;var _0x3246b1=_0x930b[_0x5ca1e4];return _0x3246b1;};'use strict';var Sequelize=require(_0xb930('0x0'));module[_0xb930('0x1')]={'name':{'type':Sequelize[_0xb930('0x2')]},'moduleCreate':{'type':Sequelize[_0xb930('0x3')](_0xb930('0x4'),_0xb930('0x5'),'nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead','contact',_0xb930('0x4')),'defaultValue':_0xb930('0x6')},'description':{'type':Sequelize[_0xb930('0x2')]}};
\ No newline at end of file
index c09d88e..506c324 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb39=['json','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','options','find','create','body','getFields','findOne','ZohoField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','set','Content-Range'];(function(_0x5e09c5,_0x9abc70){var _0xcf3bc1=function(_0x47b9e6){while(--_0x47b9e6){_0x5e09c5['push'](_0x5e09c5['shift']());}};_0xcf3bc1(++_0x9abc70);}(_0xbb39,0x126));var _0x9bb3=function(_0x38a62f,_0x26b533){_0x38a62f=_0x38a62f-0x0;var _0x1f734b=_0xbb39[_0x38a62f];return _0x1f734b;};'use strict';var emlformat=require(_0x9bb3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9bb3('0x1'));var jsonpatch=require(_0x9bb3('0x2'));var rp=require(_0x9bb3('0x3'));var moment=require(_0x9bb3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9bb3('0x5'));var util=require(_0x9bb3('0x6'));var path=require('path');var sox=require(_0x9bb3('0x7'));var csv=require('to-csv');var ejs=require(_0x9bb3('0x8'));var fs=require('fs');var fs_extra=require(_0x9bb3('0x9'));var _=require(_0x9bb3('0xa'));var squel=require(_0x9bb3('0xb'));var crypto=require(_0x9bb3('0xc'));var jsforce=require(_0x9bb3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9bb3('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9bb3('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9bb3('0x10'));var as=require(_0x9bb3('0x11'));var hardwareService=require(_0x9bb3('0x12'));var logger=require(_0x9bb3('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x9bb3('0x14'));var licenseUtil=require(_0x9bb3('0x15'));var db=require(_0x9bb3('0x16'))['db'];function respondWithStatusCode(_0x41fd8f,_0x295c10){_0x295c10=_0x295c10||0xcc;return function(_0xed8a15){if(_0xed8a15){return _0x41fd8f['sendStatus'](_0x295c10);}return _0x41fd8f[_0x9bb3('0x17')](_0x295c10)[_0x9bb3('0x18')]();};}function respondWithResult(_0x510d35,_0x262bee){_0x262bee=_0x262bee||0xc8;return function(_0x193aa3){if(_0x193aa3){return _0x510d35[_0x9bb3('0x17')](_0x262bee)['json'](_0x193aa3);}};}function respondWithFilteredResult(_0x3291e1,_0x3b1389){return function(_0x59e3c5){if(_0x59e3c5){var _0x13f798=typeof _0x3b1389['offset']===_0x9bb3('0x19')&&typeof _0x3b1389['limit']==='undefined';var _0x3bbfd3=_0x59e3c5[_0x9bb3('0x1a')];var _0x25f86d=_0x13f798?0x0:_0x3b1389[_0x9bb3('0x1b')];var _0x5209b2=_0x13f798?_0x59e3c5[_0x9bb3('0x1a')]:_0x3b1389[_0x9bb3('0x1b')]+_0x3b1389['limit'];var _0xbec0e2;if(_0x5209b2>=_0x3bbfd3){_0x5209b2=_0x3bbfd3;_0xbec0e2=0xc8;}else{_0xbec0e2=0xce;}_0x3291e1['status'](_0xbec0e2);return _0x3291e1[_0x9bb3('0x1c')](_0x9bb3('0x1d'),_0x25f86d+'-'+_0x5209b2+'/'+_0x3bbfd3)[_0x9bb3('0x1e')](_0x59e3c5);}return null;};}function patchUpdates(_0x52fb17){return function(_0x5e0d7a){try{jsonpatch[_0x9bb3('0x1f')](_0x5e0d7a,_0x52fb17,!![]);}catch(_0x5054a1){return BPromise[_0x9bb3('0x20')](_0x5054a1);}return _0x5e0d7a[_0x9bb3('0x21')]();};}function saveUpdates(_0x390f9d,_0x3cc790){return function(_0x3b2c90){if(_0x3b2c90){return _0x3b2c90[_0x9bb3('0x22')](_0x390f9d)[_0x9bb3('0x23')](function(_0x6f723c){return _0x6f723c;});}return null;};}function removeEntity(_0x417311,_0x5d07a9){return function(_0x178d60){if(_0x178d60){return _0x178d60[_0x9bb3('0x24')]()['then'](function(){_0x417311[_0x9bb3('0x17')](0xcc)[_0x9bb3('0x18')]();});}};}function handleEntityNotFound(_0x288284,_0x4fa9db){return function(_0xcc619d){if(!_0xcc619d){_0x288284[_0x9bb3('0x25')](0x194);}return _0xcc619d;};}function handleError(_0x51cba5,_0x2e0460){_0x2e0460=_0x2e0460||0x1f4;return function(_0x4bcc3a){logger[_0x9bb3('0x26')](_0x4bcc3a['stack']);if(_0x4bcc3a[_0x9bb3('0x27')]){delete _0x4bcc3a[_0x9bb3('0x27')];}_0x51cba5['status'](_0x2e0460)[_0x9bb3('0x28')](_0x4bcc3a);};}exports[_0x9bb3('0x29')]=function(_0x402d46,_0x40abb2){var _0x3e04d2={},_0x2464e0={},_0x15db06={'count':0x0,'rows':[]};var _0x1bfbc9=_[_0x9bb3('0x2a')](db[_0x9bb3('0x2b')][_0x9bb3('0x2c')],function(_0x131fb6){return{'name':_0x131fb6[_0x9bb3('0x2d')],'type':_0x131fb6['type'][_0x9bb3('0x2e')]};});_0x2464e0[_0x9bb3('0x2f')]=_['map'](_0x1bfbc9,_0x9bb3('0x27'));_0x2464e0[_0x9bb3('0x30')]=_[_0x9bb3('0x31')](_0x402d46['query']);_0x2464e0[_0x9bb3('0x32')]=_[_0x9bb3('0x33')](_0x2464e0[_0x9bb3('0x2f')],_0x2464e0[_0x9bb3('0x30')]);_0x3e04d2[_0x9bb3('0x34')]=_[_0x9bb3('0x33')](_0x2464e0[_0x9bb3('0x2f')],qs['fields'](_0x402d46[_0x9bb3('0x30')][_0x9bb3('0x35')]));_0x3e04d2[_0x9bb3('0x34')]=_0x3e04d2[_0x9bb3('0x34')][_0x9bb3('0x36')]?_0x3e04d2[_0x9bb3('0x34')]:_0x2464e0[_0x9bb3('0x2f')];if(!_0x402d46[_0x9bb3('0x30')][_0x9bb3('0x37')](_0x9bb3('0x38'))){_0x3e04d2[_0x9bb3('0x39')]=qs[_0x9bb3('0x39')](_0x402d46['query'][_0x9bb3('0x39')]);_0x3e04d2[_0x9bb3('0x1b')]=qs[_0x9bb3('0x1b')](_0x402d46[_0x9bb3('0x30')]['offset']);}_0x3e04d2[_0x9bb3('0x3a')]=qs[_0x9bb3('0x3b')](_0x402d46['query'][_0x9bb3('0x3b')]);_0x3e04d2[_0x9bb3('0x3c')]=qs[_0x9bb3('0x32')](_[_0x9bb3('0x3d')](_0x402d46['query'],_0x2464e0[_0x9bb3('0x32')]),_0x1bfbc9);if(_0x402d46[_0x9bb3('0x30')][_0x9bb3('0x3e')]){_0x3e04d2['where']=_['merge'](_0x3e04d2[_0x9bb3('0x3c')],{'$or':_[_0x9bb3('0x2a')](_0x1bfbc9,function(_0x172b86){if(_0x172b86[_0x9bb3('0x3f')]!==_0x9bb3('0x40')){var _0x564a48={};_0x564a48[_0x172b86['name']]={'$like':'%'+_0x402d46['query']['filter']+'%'};return _0x564a48;}})});}_0x3e04d2=_[_0x9bb3('0x41')]({},_0x3e04d2,_0x402d46['options']);var _0x5e760b={'where':_0x3e04d2['where']};return db[_0x9bb3('0x2b')][_0x9bb3('0x1a')](_0x5e760b)[_0x9bb3('0x23')](function(_0x5e34b5){_0x15db06['count']=_0x5e34b5;if(_0x402d46['query'][_0x9bb3('0x42')]){_0x3e04d2['include']=[{'all':!![]}];}return db[_0x9bb3('0x2b')][_0x9bb3('0x43')](_0x3e04d2);})[_0x9bb3('0x23')](function(_0x25cd1c){_0x15db06[_0x9bb3('0x44')]=_0x25cd1c;return _0x15db06;})[_0x9bb3('0x23')](respondWithFilteredResult(_0x40abb2,_0x3e04d2))[_0x9bb3('0x45')](handleError(_0x40abb2,null));};exports[_0x9bb3('0x46')]=function(_0x3a1e97,_0x2bcb94){var _0x4298cb={'raw':![],'where':{'id':_0x3a1e97[_0x9bb3('0x47')]['id']}},_0x190e06={};_0x190e06[_0x9bb3('0x2f')]=_[_0x9bb3('0x31')](db[_0x9bb3('0x2b')][_0x9bb3('0x2c')]);_0x190e06[_0x9bb3('0x30')]=_[_0x9bb3('0x31')](_0x3a1e97['query']);_0x190e06['filters']=_[_0x9bb3('0x33')](_0x190e06[_0x9bb3('0x2f')],_0x190e06[_0x9bb3('0x30')]);_0x4298cb['attributes']=_['intersection'](_0x190e06[_0x9bb3('0x2f')],qs[_0x9bb3('0x35')](_0x3a1e97[_0x9bb3('0x30')]['fields']));_0x4298cb[_0x9bb3('0x34')]=_0x4298cb[_0x9bb3('0x34')][_0x9bb3('0x36')]?_0x4298cb[_0x9bb3('0x34')]:_0x190e06[_0x9bb3('0x2f')];if(_0x3a1e97[_0x9bb3('0x30')]['includeAll']){_0x4298cb['include']=[{'all':!![]}];}_0x4298cb=_[_0x9bb3('0x41')]({},_0x4298cb,_0x3a1e97[_0x9bb3('0x48')]);return db[_0x9bb3('0x2b')][_0x9bb3('0x49')](_0x4298cb)[_0x9bb3('0x23')](handleEntityNotFound(_0x2bcb94,null))[_0x9bb3('0x23')](respondWithResult(_0x2bcb94,null))['catch'](handleError(_0x2bcb94,null));};exports[_0x9bb3('0x4a')]=function(_0x23e8e7,_0x39d3eb){return db[_0x9bb3('0x2b')]['create'](_0x23e8e7[_0x9bb3('0x4b')],{})['then'](respondWithResult(_0x39d3eb,0xc9))[_0x9bb3('0x45')](handleError(_0x39d3eb,null));};exports[_0x9bb3('0x22')]=function(_0x34a34f,_0xd47a0b){if(_0x34a34f[_0x9bb3('0x4b')]['id']){delete _0x34a34f[_0x9bb3('0x4b')]['id'];}return db[_0x9bb3('0x2b')][_0x9bb3('0x49')]({'where':{'id':_0x34a34f['params']['id']}})[_0x9bb3('0x23')](handleEntityNotFound(_0xd47a0b,null))[_0x9bb3('0x23')](saveUpdates(_0x34a34f['body'],null))[_0x9bb3('0x23')](respondWithResult(_0xd47a0b,null))['catch'](handleError(_0xd47a0b,null));};exports[_0x9bb3('0x24')]=function(_0xe35576,_0x2b3870){return db[_0x9bb3('0x2b')]['find']({'where':{'id':_0xe35576[_0x9bb3('0x47')]['id']}})[_0x9bb3('0x23')](handleEntityNotFound(_0x2b3870,null))[_0x9bb3('0x23')](removeEntity(_0x2b3870,null))[_0x9bb3('0x45')](handleError(_0x2b3870,null));};exports[_0x9bb3('0x4c')]=function(_0x3d171f,_0x5a7ced,_0xd57314){var _0x2f4326={};var _0x30243b={};var _0x51a48e;var _0x5b2e80;return db[_0x9bb3('0x2b')][_0x9bb3('0x4d')]({'where':{'id':_0x3d171f[_0x9bb3('0x47')]['id']}})[_0x9bb3('0x23')](handleEntityNotFound(_0x5a7ced,null))[_0x9bb3('0x23')](function(_0x2b732c){if(_0x2b732c){_0x51a48e=_0x2b732c;_0x30243b[_0x9bb3('0x2f')]=_[_0x9bb3('0x31')](db[_0x9bb3('0x4e')][_0x9bb3('0x2c')]);_0x30243b[_0x9bb3('0x30')]=_['keys'](_0x3d171f[_0x9bb3('0x30')]);_0x30243b[_0x9bb3('0x32')]=_['intersection'](_0x30243b[_0x9bb3('0x2f')],_0x30243b[_0x9bb3('0x30')]);_0x2f4326[_0x9bb3('0x34')]=_['intersection'](_0x30243b[_0x9bb3('0x2f')],qs[_0x9bb3('0x35')](_0x3d171f[_0x9bb3('0x30')]['fields']));_0x2f4326['attributes']=_0x2f4326[_0x9bb3('0x34')][_0x9bb3('0x36')]?_0x2f4326[_0x9bb3('0x34')]:_0x30243b[_0x9bb3('0x2f')];_0x2f4326['order']=qs[_0x9bb3('0x3b')](_0x3d171f[_0x9bb3('0x30')][_0x9bb3('0x3b')]);_0x2f4326[_0x9bb3('0x3c')]=qs[_0x9bb3('0x32')](_[_0x9bb3('0x3d')](_0x3d171f['query'],_0x30243b[_0x9bb3('0x32')]));if(_0x3d171f[_0x9bb3('0x30')]['filter']){_0x2f4326[_0x9bb3('0x3c')]=_[_0x9bb3('0x41')](_0x2f4326[_0x9bb3('0x3c')],{'$or':_['map'](_0x2f4326[_0x9bb3('0x34')],function(_0x5bbb1c){var _0x44ce2d={};_0x44ce2d[_0x5bbb1c]={'$like':'%'+_0x3d171f[_0x9bb3('0x30')][_0x9bb3('0x3e')]+'%'};return _0x44ce2d;})});}_0x2f4326=_[_0x9bb3('0x41')]({},_0x2f4326,_0x3d171f[_0x9bb3('0x48')]);return _0x51a48e[_0x9bb3('0x4c')](_0x2f4326);}})[_0x9bb3('0x23')](function(_0x1434da){if(_0x1434da){_0x5b2e80=_0x1434da['length'];if(!_0x3d171f[_0x9bb3('0x30')][_0x9bb3('0x37')]('nolimit')){_0x2f4326[_0x9bb3('0x39')]=qs['limit'](_0x3d171f[_0x9bb3('0x30')][_0x9bb3('0x39')]);_0x2f4326['offset']=qs[_0x9bb3('0x1b')](_0x3d171f[_0x9bb3('0x30')][_0x9bb3('0x1b')]);}return _0x51a48e['getFields'](_0x2f4326);}})[_0x9bb3('0x23')](function(_0x2cd5a0){if(_0x2cd5a0){return _0x2cd5a0?{'count':_0x5b2e80,'rows':_0x2cd5a0}:null;}})[_0x9bb3('0x23')](respondWithResult(_0x5a7ced,null))['catch'](handleError(_0x5a7ced,null));};exports[_0x9bb3('0x4f')]=function(_0x15b65d,_0x420961,_0xd48cdd){var _0x4d4cbc={};var _0x3aa527={};var _0x3ed1ca;var _0x4f3367;return db[_0x9bb3('0x2b')][_0x9bb3('0x4d')]({'where':{'id':_0x15b65d[_0x9bb3('0x47')]['id']}})['then'](handleEntityNotFound(_0x420961,null))['then'](function(_0x1a5ef1){if(_0x1a5ef1){_0x3ed1ca=_0x1a5ef1;_0x3aa527[_0x9bb3('0x2f')]=_[_0x9bb3('0x31')](db[_0x9bb3('0x4e')][_0x9bb3('0x2c')]);_0x3aa527[_0x9bb3('0x30')]=_[_0x9bb3('0x31')](_0x15b65d['query']);_0x3aa527[_0x9bb3('0x32')]=_['intersection'](_0x3aa527['model'],_0x3aa527[_0x9bb3('0x30')]);_0x4d4cbc['attributes']=_[_0x9bb3('0x33')](_0x3aa527[_0x9bb3('0x2f')],qs['fields'](_0x15b65d[_0x9bb3('0x30')][_0x9bb3('0x35')]));_0x4d4cbc[_0x9bb3('0x34')]=_0x4d4cbc[_0x9bb3('0x34')][_0x9bb3('0x36')]?_0x4d4cbc['attributes']:_0x3aa527[_0x9bb3('0x2f')];_0x4d4cbc['order']=qs[_0x9bb3('0x3b')](_0x15b65d[_0x9bb3('0x30')]['sort']);_0x4d4cbc[_0x9bb3('0x3c')]=qs['filters'](_[_0x9bb3('0x3d')](_0x15b65d[_0x9bb3('0x30')],_0x3aa527[_0x9bb3('0x32')]));if(_0x15b65d[_0x9bb3('0x30')][_0x9bb3('0x3e')]){_0x4d4cbc[_0x9bb3('0x3c')]=_[_0x9bb3('0x41')](_0x4d4cbc[_0x9bb3('0x3c')],{'$or':_[_0x9bb3('0x2a')](_0x4d4cbc[_0x9bb3('0x34')],function(_0x4f9040){var _0x105da1={};_0x105da1[_0x4f9040]={'$like':'%'+_0x15b65d[_0x9bb3('0x30')]['filter']+'%'};return _0x105da1;})});}_0x4d4cbc=_[_0x9bb3('0x41')]({},_0x4d4cbc,_0x15b65d[_0x9bb3('0x48')]);return _0x3ed1ca[_0x9bb3('0x4f')](_0x4d4cbc);}})['then'](function(_0x11a8cf){if(_0x11a8cf){_0x4f3367=_0x11a8cf[_0x9bb3('0x36')];if(!_0x15b65d[_0x9bb3('0x30')][_0x9bb3('0x37')](_0x9bb3('0x38'))){_0x4d4cbc['limit']=qs[_0x9bb3('0x39')](_0x15b65d[_0x9bb3('0x30')][_0x9bb3('0x39')]);_0x4d4cbc[_0x9bb3('0x1b')]=qs[_0x9bb3('0x1b')](_0x15b65d[_0x9bb3('0x30')]['offset']);}return _0x3ed1ca[_0x9bb3('0x4f')](_0x4d4cbc);}})[_0x9bb3('0x23')](function(_0x2091ad){if(_0x2091ad){return _0x2091ad?{'count':_0x4f3367,'rows':_0x2091ad}:null;}})['then'](respondWithResult(_0x420961,null))[_0x9bb3('0x45')](handleError(_0x420961,null));};exports[_0x9bb3('0x50')]=function(_0x2927f0,_0x310725,_0x42fdc){var _0x43830e={};var _0x3686c9={};var _0x4dbcb3;var _0x15a7d8;return db[_0x9bb3('0x2b')][_0x9bb3('0x4d')]({'where':{'id':_0x2927f0[_0x9bb3('0x47')]['id']}})[_0x9bb3('0x23')](handleEntityNotFound(_0x310725,null))['then'](function(_0x3be682){if(_0x3be682){_0x4dbcb3=_0x3be682;_0x3686c9['model']=_[_0x9bb3('0x31')](db[_0x9bb3('0x4e')][_0x9bb3('0x2c')]);_0x3686c9['query']=_['keys'](_0x2927f0[_0x9bb3('0x30')]);_0x3686c9[_0x9bb3('0x32')]=_[_0x9bb3('0x33')](_0x3686c9[_0x9bb3('0x2f')],_0x3686c9[_0x9bb3('0x30')]);_0x43830e[_0x9bb3('0x34')]=_[_0x9bb3('0x33')](_0x3686c9[_0x9bb3('0x2f')],qs[_0x9bb3('0x35')](_0x2927f0[_0x9bb3('0x30')][_0x9bb3('0x35')]));_0x43830e[_0x9bb3('0x34')]=_0x43830e[_0x9bb3('0x34')]['length']?_0x43830e[_0x9bb3('0x34')]:_0x3686c9[_0x9bb3('0x2f')];_0x43830e['order']=qs['sort'](_0x2927f0['query']['sort']);_0x43830e['where']=qs['filters'](_['pick'](_0x2927f0['query'],_0x3686c9[_0x9bb3('0x32')]));if(_0x2927f0[_0x9bb3('0x30')][_0x9bb3('0x3e')]){_0x43830e[_0x9bb3('0x3c')]=_['merge'](_0x43830e[_0x9bb3('0x3c')],{'$or':_[_0x9bb3('0x2a')](_0x43830e[_0x9bb3('0x34')],function(_0x40c825){var _0xcbbce7={};_0xcbbce7[_0x40c825]={'$like':'%'+_0x2927f0[_0x9bb3('0x30')][_0x9bb3('0x3e')]+'%'};return _0xcbbce7;})});}_0x43830e=_[_0x9bb3('0x41')]({},_0x43830e,_0x2927f0[_0x9bb3('0x48')]);return _0x4dbcb3[_0x9bb3('0x50')](_0x43830e);}})[_0x9bb3('0x23')](function(_0x166333){if(_0x166333){_0x15a7d8=_0x166333['length'];if(!_0x2927f0[_0x9bb3('0x30')]['hasOwnProperty'](_0x9bb3('0x38'))){_0x43830e['limit']=qs[_0x9bb3('0x39')](_0x2927f0[_0x9bb3('0x30')][_0x9bb3('0x39')]);_0x43830e['offset']=qs[_0x9bb3('0x1b')](_0x2927f0['query'][_0x9bb3('0x1b')]);}return _0x4dbcb3['getDescriptions'](_0x43830e);}})['then'](function(_0x1d1b0f){if(_0x1d1b0f){return _0x1d1b0f?{'count':_0x15a7d8,'rows':_0x1d1b0f}:null;}})[_0x9bb3('0x23')](respondWithResult(_0x310725,null))[_0x9bb3('0x45')](handleError(_0x310725,null));};
\ No newline at end of file
+var _0x375d=['reject','update','then','stack','name','index','map','ZohoConfiguration','rawAttributes','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','find','create','body','params','destroy','getFields','findOne','pick','nolimit','getSubjects','ZohoField','order','getDescriptions','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply'];(function(_0x79dd44,_0x4dc5f8){var _0x534aff=function(_0x11eadc){while(--_0x11eadc){_0x79dd44['push'](_0x79dd44['shift']());}};_0x534aff(++_0x4dc5f8);}(_0x375d,0x1ad));var _0xd375=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x375d[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd375('0x0'));var jsonpatch=require(_0xd375('0x1'));var rp=require(_0xd375('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd375('0x3'));var util=require(_0xd375('0x4'));var path=require(_0xd375('0x5'));var sox=require(_0xd375('0x6'));var csv=require(_0xd375('0x7'));var ejs=require(_0xd375('0x8'));var fs=require('fs');var fs_extra=require(_0xd375('0x9'));var _=require('lodash');var squel=require(_0xd375('0xa'));var crypto=require(_0xd375('0xb'));var jsforce=require(_0xd375('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd375('0x7'));var querystring=require(_0xd375('0xd'));var Papa=require(_0xd375('0xe'));var Redis=require(_0xd375('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd375('0x10'));var hardwareService=require(_0xd375('0x11'));var logger=require(_0xd375('0x12'))(_0xd375('0x13'));var utils=require(_0xd375('0x14'));var config=require(_0xd375('0x15'));var licenseUtil=require(_0xd375('0x16'));var db=require(_0xd375('0x17'))['db'];function respondWithStatusCode(_0x231c39,_0x41e164){_0x41e164=_0x41e164||0xcc;return function(_0x2a952b){if(_0x2a952b){return _0x231c39[_0xd375('0x18')](_0x41e164);}return _0x231c39[_0xd375('0x19')](_0x41e164)[_0xd375('0x1a')]();};}function respondWithResult(_0x427cd4,_0x16e0e4){_0x16e0e4=_0x16e0e4||0xc8;return function(_0x54b7f7){if(_0x54b7f7){return _0x427cd4[_0xd375('0x19')](_0x16e0e4)[_0xd375('0x1b')](_0x54b7f7);}};}function respondWithFilteredResult(_0x9d924b,_0x2551e){return function(_0xcce4c){if(_0xcce4c){var _0x3bee25=typeof _0x2551e[_0xd375('0x1c')]===_0xd375('0x1d')&&typeof _0x2551e[_0xd375('0x1e')]===_0xd375('0x1d');var _0x2d7332=_0xcce4c[_0xd375('0x1f')];var _0x2499b4=_0x3bee25?0x0:_0x2551e['offset'];var _0xcbc73=_0x3bee25?_0xcce4c['count']:_0x2551e[_0xd375('0x1c')]+_0x2551e[_0xd375('0x1e')];var _0x1d0431;if(_0xcbc73>=_0x2d7332){_0xcbc73=_0x2d7332;_0x1d0431=0xc8;}else{_0x1d0431=0xce;}_0x9d924b['status'](_0x1d0431);return _0x9d924b['set']('Content-Range',_0x2499b4+'-'+_0xcbc73+'/'+_0x2d7332)[_0xd375('0x1b')](_0xcce4c);}return null;};}function patchUpdates(_0x12cdf4){return function(_0x4cdebe){try{jsonpatch[_0xd375('0x20')](_0x4cdebe,_0x12cdf4,!![]);}catch(_0x34733c){return BPromise[_0xd375('0x21')](_0x34733c);}return _0x4cdebe['save']();};}function saveUpdates(_0x53e50e,_0x3e4390){return function(_0x41cfbb){if(_0x41cfbb){return _0x41cfbb[_0xd375('0x22')](_0x53e50e)[_0xd375('0x23')](function(_0x2e3804){return _0x2e3804;});}return null;};}function removeEntity(_0x315539,_0x544a18){return function(_0x23381e){if(_0x23381e){return _0x23381e['destroy']()['then'](function(){_0x315539[_0xd375('0x19')](0xcc)[_0xd375('0x1a')]();});}};}function handleEntityNotFound(_0x2fe24f,_0xfd9e84){return function(_0x108d3f){if(!_0x108d3f){_0x2fe24f[_0xd375('0x18')](0x194);}return _0x108d3f;};}function handleError(_0x40979c,_0x2343b6){_0x2343b6=_0x2343b6||0x1f4;return function(_0x27bea1){logger['error'](_0x27bea1[_0xd375('0x24')]);if(_0x27bea1['name']){delete _0x27bea1[_0xd375('0x25')];}_0x40979c['status'](_0x2343b6)['send'](_0x27bea1);};}exports[_0xd375('0x26')]=function(_0x463357,_0x222cb1){var _0x4a554b={},_0x636b7d={},_0x5808a9={'count':0x0,'rows':[]};var _0x571f73=_[_0xd375('0x27')](db[_0xd375('0x28')][_0xd375('0x29')],function(_0x150851){return{'name':_0x150851[_0xd375('0x2a')],'type':_0x150851[_0xd375('0x2b')]['key']};});_0x636b7d['model']=_[_0xd375('0x27')](_0x571f73,_0xd375('0x25'));_0x636b7d['query']=_[_0xd375('0x2c')](_0x463357[_0xd375('0x2d')]);_0x636b7d[_0xd375('0x2e')]=_[_0xd375('0x2f')](_0x636b7d['model'],_0x636b7d['query']);_0x4a554b[_0xd375('0x30')]=_[_0xd375('0x2f')](_0x636b7d['model'],qs[_0xd375('0x31')](_0x463357[_0xd375('0x2d')][_0xd375('0x31')]));_0x4a554b[_0xd375('0x30')]=_0x4a554b[_0xd375('0x30')][_0xd375('0x32')]?_0x4a554b[_0xd375('0x30')]:_0x636b7d[_0xd375('0x33')];if(!_0x463357[_0xd375('0x2d')][_0xd375('0x34')]('nolimit')){_0x4a554b[_0xd375('0x1e')]=qs[_0xd375('0x1e')](_0x463357[_0xd375('0x2d')][_0xd375('0x1e')]);_0x4a554b['offset']=qs[_0xd375('0x1c')](_0x463357[_0xd375('0x2d')][_0xd375('0x1c')]);}_0x4a554b['order']=qs['sort'](_0x463357[_0xd375('0x2d')][_0xd375('0x35')]);_0x4a554b[_0xd375('0x36')]=qs[_0xd375('0x2e')](_['pick'](_0x463357[_0xd375('0x2d')],_0x636b7d[_0xd375('0x2e')]),_0x571f73);if(_0x463357['query']['filter']){_0x4a554b['where']=_[_0xd375('0x37')](_0x4a554b[_0xd375('0x36')],{'$or':_[_0xd375('0x27')](_0x571f73,function(_0x1fa8d1){if(_0x1fa8d1[_0xd375('0x2b')]!==_0xd375('0x38')){var _0x563170={};_0x563170[_0x1fa8d1[_0xd375('0x25')]]={'$like':'%'+_0x463357['query'][_0xd375('0x39')]+'%'};return _0x563170;}})});}_0x4a554b=_[_0xd375('0x37')]({},_0x4a554b,_0x463357[_0xd375('0x3a')]);var _0x1257ea={'where':_0x4a554b[_0xd375('0x36')]};return db[_0xd375('0x28')]['count'](_0x1257ea)[_0xd375('0x23')](function(_0x35dea7){_0x5808a9[_0xd375('0x1f')]=_0x35dea7;if(_0x463357[_0xd375('0x2d')][_0xd375('0x3b')]){_0x4a554b['include']=[{'all':!![]}];}return db[_0xd375('0x28')][_0xd375('0x3c')](_0x4a554b);})['then'](function(_0x3b30cf){_0x5808a9[_0xd375('0x3d')]=_0x3b30cf;return _0x5808a9;})[_0xd375('0x23')](respondWithFilteredResult(_0x222cb1,_0x4a554b))[_0xd375('0x3e')](handleError(_0x222cb1,null));};exports[_0xd375('0x3f')]=function(_0x24af53,_0x3e47f4){var _0x57623c={'raw':![],'where':{'id':_0x24af53['params']['id']}},_0x404917={};_0x404917[_0xd375('0x33')]=_[_0xd375('0x2c')](db[_0xd375('0x28')][_0xd375('0x29')]);_0x404917[_0xd375('0x2d')]=_['keys'](_0x24af53['query']);_0x404917[_0xd375('0x2e')]=_[_0xd375('0x2f')](_0x404917['model'],_0x404917[_0xd375('0x2d')]);_0x57623c[_0xd375('0x30')]=_[_0xd375('0x2f')](_0x404917[_0xd375('0x33')],qs[_0xd375('0x31')](_0x24af53[_0xd375('0x2d')][_0xd375('0x31')]));_0x57623c[_0xd375('0x30')]=_0x57623c[_0xd375('0x30')][_0xd375('0x32')]?_0x57623c[_0xd375('0x30')]:_0x404917['model'];if(_0x24af53[_0xd375('0x2d')]['includeAll']){_0x57623c['include']=[{'all':!![]}];}_0x57623c=_[_0xd375('0x37')]({},_0x57623c,_0x24af53['options']);return db[_0xd375('0x28')][_0xd375('0x40')](_0x57623c)['then'](handleEntityNotFound(_0x3e47f4,null))['then'](respondWithResult(_0x3e47f4,null))[_0xd375('0x3e')](handleError(_0x3e47f4,null));};exports[_0xd375('0x41')]=function(_0x218501,_0x5e026b){return db[_0xd375('0x28')][_0xd375('0x41')](_0x218501['body'],{})[_0xd375('0x23')](respondWithResult(_0x5e026b,0xc9))[_0xd375('0x3e')](handleError(_0x5e026b,null));};exports['update']=function(_0x5dedd8,_0xeb5406){if(_0x5dedd8[_0xd375('0x42')]['id']){delete _0x5dedd8['body']['id'];}return db['ZohoConfiguration'][_0xd375('0x40')]({'where':{'id':_0x5dedd8[_0xd375('0x43')]['id']}})[_0xd375('0x23')](handleEntityNotFound(_0xeb5406,null))['then'](saveUpdates(_0x5dedd8[_0xd375('0x42')],null))[_0xd375('0x23')](respondWithResult(_0xeb5406,null))['catch'](handleError(_0xeb5406,null));};exports[_0xd375('0x44')]=function(_0x176e15,_0x3c7ec6){return db[_0xd375('0x28')][_0xd375('0x40')]({'where':{'id':_0x176e15['params']['id']}})[_0xd375('0x23')](handleEntityNotFound(_0x3c7ec6,null))[_0xd375('0x23')](removeEntity(_0x3c7ec6,null))[_0xd375('0x3e')](handleError(_0x3c7ec6,null));};exports[_0xd375('0x45')]=function(_0x4b0ace,_0x3a516a,_0x589d91){var _0x3e6536={};var _0x38d78a={};var _0x6041bd;var _0x439651;return db['ZohoConfiguration'][_0xd375('0x46')]({'where':{'id':_0x4b0ace[_0xd375('0x43')]['id']}})[_0xd375('0x23')](handleEntityNotFound(_0x3a516a,null))[_0xd375('0x23')](function(_0x2e6ffc){if(_0x2e6ffc){_0x6041bd=_0x2e6ffc;_0x38d78a['model']=_[_0xd375('0x2c')](db['ZohoField'][_0xd375('0x29')]);_0x38d78a[_0xd375('0x2d')]=_['keys'](_0x4b0ace[_0xd375('0x2d')]);_0x38d78a[_0xd375('0x2e')]=_[_0xd375('0x2f')](_0x38d78a[_0xd375('0x33')],_0x38d78a[_0xd375('0x2d')]);_0x3e6536[_0xd375('0x30')]=_[_0xd375('0x2f')](_0x38d78a[_0xd375('0x33')],qs[_0xd375('0x31')](_0x4b0ace['query'][_0xd375('0x31')]));_0x3e6536[_0xd375('0x30')]=_0x3e6536['attributes'][_0xd375('0x32')]?_0x3e6536['attributes']:_0x38d78a[_0xd375('0x33')];_0x3e6536['order']=qs['sort'](_0x4b0ace[_0xd375('0x2d')][_0xd375('0x35')]);_0x3e6536['where']=qs[_0xd375('0x2e')](_[_0xd375('0x47')](_0x4b0ace[_0xd375('0x2d')],_0x38d78a['filters']));if(_0x4b0ace[_0xd375('0x2d')][_0xd375('0x39')]){_0x3e6536[_0xd375('0x36')]=_['merge'](_0x3e6536[_0xd375('0x36')],{'$or':_[_0xd375('0x27')](_0x3e6536['attributes'],function(_0x251df8){var _0x15ebfd={};_0x15ebfd[_0x251df8]={'$like':'%'+_0x4b0ace[_0xd375('0x2d')][_0xd375('0x39')]+'%'};return _0x15ebfd;})});}_0x3e6536=_[_0xd375('0x37')]({},_0x3e6536,_0x4b0ace[_0xd375('0x3a')]);return _0x6041bd['getFields'](_0x3e6536);}})[_0xd375('0x23')](function(_0x44e1af){if(_0x44e1af){_0x439651=_0x44e1af['length'];if(!_0x4b0ace[_0xd375('0x2d')]['hasOwnProperty'](_0xd375('0x48'))){_0x3e6536['limit']=qs[_0xd375('0x1e')](_0x4b0ace[_0xd375('0x2d')][_0xd375('0x1e')]);_0x3e6536[_0xd375('0x1c')]=qs['offset'](_0x4b0ace[_0xd375('0x2d')]['offset']);}return _0x6041bd[_0xd375('0x45')](_0x3e6536);}})[_0xd375('0x23')](function(_0x355069){if(_0x355069){return _0x355069?{'count':_0x439651,'rows':_0x355069}:null;}})[_0xd375('0x23')](respondWithResult(_0x3a516a,null))[_0xd375('0x3e')](handleError(_0x3a516a,null));};exports[_0xd375('0x49')]=function(_0x7bc265,_0x5d5323,_0x39edcb){var _0x3e7ab1={};var _0x14c318={};var _0x544da4;var _0x400bf0;return db[_0xd375('0x28')][_0xd375('0x46')]({'where':{'id':_0x7bc265['params']['id']}})['then'](handleEntityNotFound(_0x5d5323,null))[_0xd375('0x23')](function(_0x225c19){if(_0x225c19){_0x544da4=_0x225c19;_0x14c318[_0xd375('0x33')]=_[_0xd375('0x2c')](db[_0xd375('0x4a')][_0xd375('0x29')]);_0x14c318[_0xd375('0x2d')]=_[_0xd375('0x2c')](_0x7bc265['query']);_0x14c318[_0xd375('0x2e')]=_[_0xd375('0x2f')](_0x14c318['model'],_0x14c318[_0xd375('0x2d')]);_0x3e7ab1[_0xd375('0x30')]=_[_0xd375('0x2f')](_0x14c318[_0xd375('0x33')],qs['fields'](_0x7bc265[_0xd375('0x2d')]['fields']));_0x3e7ab1[_0xd375('0x30')]=_0x3e7ab1[_0xd375('0x30')][_0xd375('0x32')]?_0x3e7ab1[_0xd375('0x30')]:_0x14c318['model'];_0x3e7ab1[_0xd375('0x4b')]=qs[_0xd375('0x35')](_0x7bc265[_0xd375('0x2d')]['sort']);_0x3e7ab1[_0xd375('0x36')]=qs['filters'](_[_0xd375('0x47')](_0x7bc265['query'],_0x14c318[_0xd375('0x2e')]));if(_0x7bc265['query']['filter']){_0x3e7ab1[_0xd375('0x36')]=_['merge'](_0x3e7ab1[_0xd375('0x36')],{'$or':_['map'](_0x3e7ab1[_0xd375('0x30')],function(_0x43a4dd){var _0x133171={};_0x133171[_0x43a4dd]={'$like':'%'+_0x7bc265[_0xd375('0x2d')][_0xd375('0x39')]+'%'};return _0x133171;})});}_0x3e7ab1=_[_0xd375('0x37')]({},_0x3e7ab1,_0x7bc265[_0xd375('0x3a')]);return _0x544da4['getSubjects'](_0x3e7ab1);}})['then'](function(_0x3d57a5){if(_0x3d57a5){_0x400bf0=_0x3d57a5[_0xd375('0x32')];if(!_0x7bc265[_0xd375('0x2d')][_0xd375('0x34')](_0xd375('0x48'))){_0x3e7ab1['limit']=qs['limit'](_0x7bc265[_0xd375('0x2d')]['limit']);_0x3e7ab1[_0xd375('0x1c')]=qs['offset'](_0x7bc265[_0xd375('0x2d')][_0xd375('0x1c')]);}return _0x544da4[_0xd375('0x49')](_0x3e7ab1);}})[_0xd375('0x23')](function(_0x4f9392){if(_0x4f9392){return _0x4f9392?{'count':_0x400bf0,'rows':_0x4f9392}:null;}})['then'](respondWithResult(_0x5d5323,null))[_0xd375('0x3e')](handleError(_0x5d5323,null));};exports[_0xd375('0x4c')]=function(_0x1cbddf,_0x4a4007,_0x1dd341){var _0x409577={};var _0x5c92ca={};var _0x63e281;var _0x22c55d;return db[_0xd375('0x28')][_0xd375('0x46')]({'where':{'id':_0x1cbddf[_0xd375('0x43')]['id']}})[_0xd375('0x23')](handleEntityNotFound(_0x4a4007,null))[_0xd375('0x23')](function(_0x32da10){if(_0x32da10){_0x63e281=_0x32da10;_0x5c92ca['model']=_['keys'](db[_0xd375('0x4a')][_0xd375('0x29')]);_0x5c92ca[_0xd375('0x2d')]=_[_0xd375('0x2c')](_0x1cbddf[_0xd375('0x2d')]);_0x5c92ca[_0xd375('0x2e')]=_[_0xd375('0x2f')](_0x5c92ca[_0xd375('0x33')],_0x5c92ca['query']);_0x409577[_0xd375('0x30')]=_[_0xd375('0x2f')](_0x5c92ca[_0xd375('0x33')],qs[_0xd375('0x31')](_0x1cbddf[_0xd375('0x2d')][_0xd375('0x31')]));_0x409577[_0xd375('0x30')]=_0x409577[_0xd375('0x30')][_0xd375('0x32')]?_0x409577['attributes']:_0x5c92ca[_0xd375('0x33')];_0x409577[_0xd375('0x4b')]=qs[_0xd375('0x35')](_0x1cbddf[_0xd375('0x2d')][_0xd375('0x35')]);_0x409577[_0xd375('0x36')]=qs[_0xd375('0x2e')](_[_0xd375('0x47')](_0x1cbddf[_0xd375('0x2d')],_0x5c92ca[_0xd375('0x2e')]));if(_0x1cbddf['query'][_0xd375('0x39')]){_0x409577[_0xd375('0x36')]=_[_0xd375('0x37')](_0x409577[_0xd375('0x36')],{'$or':_['map'](_0x409577[_0xd375('0x30')],function(_0x3e7eaa){var _0x5ded99={};_0x5ded99[_0x3e7eaa]={'$like':'%'+_0x1cbddf[_0xd375('0x2d')][_0xd375('0x39')]+'%'};return _0x5ded99;})});}_0x409577=_[_0xd375('0x37')]({},_0x409577,_0x1cbddf[_0xd375('0x3a')]);return _0x63e281['getDescriptions'](_0x409577);}})[_0xd375('0x23')](function(_0x5bb989){if(_0x5bb989){_0x22c55d=_0x5bb989[_0xd375('0x32')];if(!_0x1cbddf['query'][_0xd375('0x34')]('nolimit')){_0x409577[_0xd375('0x1e')]=qs[_0xd375('0x1e')](_0x1cbddf[_0xd375('0x2d')][_0xd375('0x1e')]);_0x409577[_0xd375('0x1c')]=qs[_0xd375('0x1c')](_0x1cbddf[_0xd375('0x2d')][_0xd375('0x1c')]);}return _0x63e281[_0xd375('0x4c')](_0x409577);}})[_0xd375('0x23')](function(_0x4829dd){if(_0x4829dd){return _0x4829dd?{'count':_0x22c55d,'rows':_0x4829dd}:null;}})[_0xd375('0x23')](respondWithResult(_0x4a4007,null))[_0xd375('0x3e')](handleError(_0x4a4007,null));};
\ No newline at end of file
index 6c0586a..eeaf965 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x440c=['int_zoho_configurations','util','../../config/logger','api','bluebird','../../config/environment','exports','define','ZohoConfiguration'];(function(_0x3a9623,_0x1ca157){var _0xf7c401=function(_0x8b55ae){while(--_0x8b55ae){_0x3a9623['push'](_0x3a9623['shift']());}};_0xf7c401(++_0x1ca157);}(_0x440c,0x172));var _0xc440=function(_0x1ab57e,_0x14630d){_0x1ab57e=_0x1ab57e-0x0;var _0x32cf90=_0x440c[_0x1ab57e];return _0x32cf90;};'use strict';var _=require('lodash');var util=require(_0xc440('0x0'));var logger=require(_0xc440('0x1'))(_0xc440('0x2'));var moment=require('moment');var BPromise=require(_0xc440('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc440('0x4'));var attributes=require('./intZohoConfiguration.attributes');module[_0xc440('0x5')]=function(_0x1f028c,_0x480c6e){return _0x1f028c[_0xc440('0x6')](_0xc440('0x7'),attributes,{'tableName':_0xc440('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x599e=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoConfiguration.attributes','define','ZohoConfiguration','int_zoho_configurations'];(function(_0x27e6cb,_0x33268a){var _0xb70baa=function(_0x5dee14){while(--_0x5dee14){_0x27e6cb['push'](_0x27e6cb['shift']());}};_0xb70baa(++_0x33268a);}(_0x599e,0xdc));var _0xe599=function(_0x104f84,_0x247994){_0x104f84=_0x104f84-0x0;var _0x3ef5ec=_0x599e[_0x104f84];return _0x3ef5ec;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe599('0x0'))(_0xe599('0x1'));var moment=require(_0xe599('0x2'));var BPromise=require(_0xe599('0x3'));var rp=require(_0xe599('0x4'));var fs=require('fs');var path=require(_0xe599('0x5'));var rimraf=require('rimraf');var config=require(_0xe599('0x6'));var attributes=require(_0xe599('0x7'));module['exports']=function(_0x354030,_0x2c00c0){return _0x354030[_0xe599('0x8')](_0xe599('0x9'),attributes,{'tableName':_0xe599('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bf4e50b..d6be8b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa21e=['../../config/logger','jayson/promise','request','ZohoConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xa16e4e,_0x50a69b){var _0x1da279=function(_0x3fe938){while(--_0x3fe938){_0xa16e4e['push'](_0xa16e4e['shift']());}};_0x1da279(++_0x50a69b);}(_0xa21e,0x12b));var _0xea21=function(_0x5ef55a,_0x2a03b1){_0x5ef55a=_0x5ef55a-0x0;var _0x20ae40=_0xa21e[_0x5ef55a];return _0x20ae40;};'use strict';var _=require(_0xea21('0x0'));var util=require('util');var moment=require(_0xea21('0x1'));var BPromise=require(_0xea21('0x2'));var rs=require(_0xea21('0x3'));var fs=require('fs');var Redis=require(_0xea21('0x4'));var db=require(_0xea21('0x5'))['db'];var utils=require(_0xea21('0x6'));var logger=require(_0xea21('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xea21('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x225035,_0x1a7877,_0xaa683e){return new BPromise(function(_0x508f65,_0x294c82){return client[_0xea21('0x9')](_0x225035,_0xaa683e)['then'](function(_0x557ca8){logger['info'](_0xea21('0xa'),_0x1a7877,'request\x20sent');logger[_0xea21('0xb')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x1a7877,_0xea21('0xc'),JSON[_0xea21('0xd')](_0x557ca8));if(_0x557ca8[_0xea21('0xe')]){if(_0x557ca8[_0xea21('0xe')][_0xea21('0xf')]===0x1f4){logger['error'](_0xea21('0xa'),_0x1a7877,_0x557ca8[_0xea21('0xe')]['message']);return _0x294c82(_0x557ca8[_0xea21('0xe')]['message']);}logger['error'](_0xea21('0xa'),_0x1a7877,_0x557ca8[_0xea21('0xe')]['message']);return _0x508f65(_0x557ca8['error'][_0xea21('0x10')]);}else{logger['info'](_0xea21('0xa'),_0x1a7877,_0xea21('0xc'));_0x508f65(_0x557ca8[_0xea21('0x11')]['message']);}})['catch'](function(_0x35cc6c){logger[_0xea21('0xe')](_0xea21('0xa'),_0x1a7877,_0x35cc6c);_0x294c82(_0x35cc6c);});});}
\ No newline at end of file
+var _0xc09f=['debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ZohoConfiguration,\x20%s,\x20%s'];(function(_0x5637f5,_0x1082c5){var _0x2f1873=function(_0x5ac507){while(--_0x5ac507){_0x5637f5['push'](_0x5637f5['shift']());}};_0x2f1873(++_0x1082c5);}(_0xc09f,0x1d0));var _0xfc09=function(_0x5ce268,_0x1835b6){_0x5ce268=_0x5ce268-0x0;var _0x28c96a=_0xc09f[_0x5ce268];return _0x28c96a;};'use strict';var _=require('lodash');var util=require(_0xfc09('0x0'));var moment=require(_0xfc09('0x1'));var BPromise=require('bluebird');var rs=require(_0xfc09('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfc09('0x3'))(_0xfc09('0x4'));var config=require(_0xfc09('0x5'));var jayson=require(_0xfc09('0x6'));var client=jayson[_0xfc09('0x7')][_0xfc09('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4045bc,_0x35d67b,_0x121efa){return new BPromise(function(_0x27510a,_0x35055e){return client[_0xfc09('0x9')](_0x4045bc,_0x121efa)['then'](function(_0x1c9f48){logger['info'](_0xfc09('0xa'),_0x35d67b,'request\x20sent');logger[_0xfc09('0xb')](_0xfc09('0xc'),_0x35d67b,_0xfc09('0xd'),JSON[_0xfc09('0xe')](_0x1c9f48));if(_0x1c9f48[_0xfc09('0xf')]){if(_0x1c9f48['error'][_0xfc09('0x10')]===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x35d67b,_0x1c9f48[_0xfc09('0xf')][_0xfc09('0x11')]);return _0x35055e(_0x1c9f48['error'][_0xfc09('0x11')]);}logger[_0xfc09('0xf')](_0xfc09('0xa'),_0x35d67b,_0x1c9f48['error']['message']);return _0x27510a(_0x1c9f48['error']['message']);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x35d67b,_0xfc09('0xd'));_0x27510a(_0x1c9f48[_0xfc09('0x12')][_0xfc09('0x11')]);}})['catch'](function(_0xd5b393){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x35d67b,_0xd5b393);_0x35055e(_0xd5b393);});});}
\ No newline at end of file
index b05002f..209266a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f09=['isAuthenticated','show','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get'];(function(_0x4c61fc,_0x275686){var _0x4c360f=function(_0x2e6b51){while(--_0x2e6b51){_0x4c61fc['push'](_0x4c61fc['shift']());}};_0x4c360f(++_0x275686);}(_0x7f09,0x1b7));var _0x97f0=function(_0x512a86,_0x3e0aa4){_0x512a86=_0x512a86-0x0;var _0xf1b854=_0x7f09[_0x512a86];return _0xf1b854;};'use strict';var multer=require(_0x97f0('0x0'));var util=require(_0x97f0('0x1'));var path=require('path');var timeout=require(_0x97f0('0x2'));var express=require(_0x97f0('0x3'));var router=express[_0x97f0('0x4')]();var fs_extra=require(_0x97f0('0x5'));var auth=require(_0x97f0('0x6'));var interaction=require(_0x97f0('0x7'));var config=require(_0x97f0('0x8'));var controller=require(_0x97f0('0x9'));router[_0x97f0('0xa')]('/',auth[_0x97f0('0xb')](),controller['index']);router[_0x97f0('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x97f0('0xc')]);router['post']('/',auth[_0x97f0('0xb')](),controller['create']);router['put'](_0x97f0('0xd'),auth[_0x97f0('0xb')](),controller[_0x97f0('0xe')]);router[_0x97f0('0xf')](_0x97f0('0xd'),auth[_0x97f0('0xb')](),controller[_0x97f0('0x10')]);module[_0x97f0('0x11')]=router;
\ No newline at end of file
+var _0xb2d4=['./intZohoField.controller','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service'];(function(_0xcd3806,_0x3182ad){var _0x5e3594=function(_0x12874d){while(--_0x12874d){_0xcd3806['push'](_0xcd3806['shift']());}};_0x5e3594(++_0x3182ad);}(_0xb2d4,0x1aa));var _0x4b2d=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xb2d4[_0x1e7b16];return _0x37fadc;};'use strict';var multer=require(_0x4b2d('0x0'));var util=require('util');var path=require(_0x4b2d('0x1'));var timeout=require('connect-timeout');var express=require(_0x4b2d('0x2'));var router=express[_0x4b2d('0x3')]();var fs_extra=require(_0x4b2d('0x4'));var auth=require(_0x4b2d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4b2d('0x6'));router['get']('/',auth[_0x4b2d('0x7')](),controller[_0x4b2d('0x8')]);router['get'](_0x4b2d('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x4b2d('0xa')]('/',auth['isAuthenticated'](),controller[_0x4b2d('0xb')]);router[_0x4b2d('0xc')]('/:id',auth[_0x4b2d('0x7')](),controller[_0x4b2d('0xd')]);router[_0x4b2d('0xe')]('/:id',auth[_0x4b2d('0x7')](),controller[_0x4b2d('0xf')]);module['exports']=router;
\ No newline at end of file
index 4c6b22b..6b911fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ac2=['customVariable','BOOLEAN','sequelize','exports','string','variable','picklist','STRING','ENUM'];(function(_0x2809e3,_0x8e5e76){var _0x5cdb21=function(_0xbace9b){while(--_0xbace9b){_0x2809e3['push'](_0x2809e3['shift']());}};_0x5cdb21(++_0x8e5e76);}(_0x8ac2,0x173));var _0x28ac=function(_0x58a4ac,_0x26f3e7){_0x58a4ac=_0x58a4ac-0x0;var _0x435e2d=_0x8ac2[_0x58a4ac];return _0x435e2d;};'use strict';var Sequelize=require(_0x28ac('0x0'));module[_0x28ac('0x1')]={'type':{'type':Sequelize['ENUM'](_0x28ac('0x2'),_0x28ac('0x3'),'customVariable','keyValue',_0x28ac('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x28ac('0x5')]},'key':{'type':Sequelize[_0x28ac('0x5')]},'keyType':{'type':Sequelize[_0x28ac('0x6')](_0x28ac('0x2'),_0x28ac('0x3'),_0x28ac('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x28ac('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x28ac('0x5')]}};
\ No newline at end of file
+var _0xee83=['STRING','variable','BOOLEAN','exports','ENUM','customVariable','keyValue','picklist'];(function(_0x4e8808,_0x446bb0){var _0x3f6144=function(_0x4d4217){while(--_0x4d4217){_0x4e8808['push'](_0x4e8808['shift']());}};_0x3f6144(++_0x446bb0);}(_0xee83,0x73));var _0x3ee8=function(_0x563c23,_0x3a114e){_0x563c23=_0x563c23-0x0;var _0x5f305c=_0xee83[_0x563c23];return _0x5f305c;};'use strict';var Sequelize=require('sequelize');module[_0x3ee8('0x0')]={'type':{'type':Sequelize[_0x3ee8('0x1')]('string','variable',_0x3ee8('0x2'),_0x3ee8('0x3'),_0x3ee8('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3ee8('0x5')]},'keyType':{'type':Sequelize[_0x3ee8('0x1')]('string',_0x3ee8('0x6'),_0x3ee8('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3ee8('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3ee8('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3ee8('0x5')]}};
\ No newline at end of file
index 1deded5..fc73cc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6302=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','end','stack','name','send','index','map','ZohoField','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','count','include','rows','catch','params','rawAttributes','includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x20be97,_0x347bb5){var _0x3492f8=function(_0x59e258){while(--_0x59e258){_0x20be97['push'](_0x20be97['shift']());}};_0x3492f8(++_0x347bb5);}(_0x6302,0x109));var _0x2630=function(_0x250228,_0x86c53d){_0x250228=_0x250228-0x0;var _0x3f001d=_0x6302[_0x250228];return _0x3f001d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2630('0x0'));var zipdir=require(_0x2630('0x1'));var jsonpatch=require(_0x2630('0x2'));var rp=require(_0x2630('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2630('0x4'));var util=require('util');var path=require('path');var sox=require(_0x2630('0x5'));var csv=require(_0x2630('0x6'));var ejs=require(_0x2630('0x7'));var fs=require('fs');var fs_extra=require(_0x2630('0x8'));var _=require(_0x2630('0x9'));var squel=require(_0x2630('0xa'));var crypto=require(_0x2630('0xb'));var jsforce=require(_0x2630('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2630('0xd'));var Papa=require(_0x2630('0xe'));var Redis=require('ioredis');var authService=require(_0x2630('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2630('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2630('0x11'))(_0x2630('0x12'));var utils=require(_0x2630('0x13'));var config=require(_0x2630('0x14'));var licenseUtil=require(_0x2630('0x15'));var db=require(_0x2630('0x16'))['db'];function respondWithStatusCode(_0x50b8e5,_0x4424c1){_0x4424c1=_0x4424c1||0xcc;return function(_0x35ad63){if(_0x35ad63){return _0x50b8e5[_0x2630('0x17')](_0x4424c1);}return _0x50b8e5[_0x2630('0x18')](_0x4424c1)['end']();};}function respondWithResult(_0x33f40d,_0x467d72){_0x467d72=_0x467d72||0xc8;return function(_0x23179e){if(_0x23179e){return _0x33f40d['status'](_0x467d72)[_0x2630('0x19')](_0x23179e);}};}function respondWithFilteredResult(_0x53b1d2,_0x1e4731){return function(_0x37c8d7){if(_0x37c8d7){var _0x3b1b78=typeof _0x1e4731[_0x2630('0x1a')]===_0x2630('0x1b')&&typeof _0x1e4731[_0x2630('0x1c')]===_0x2630('0x1b');var _0x2c7855=_0x37c8d7['count'];var _0x427b3c=_0x3b1b78?0x0:_0x1e4731['offset'];var _0x4b6fb9=_0x3b1b78?_0x37c8d7['count']:_0x1e4731[_0x2630('0x1a')]+_0x1e4731[_0x2630('0x1c')];var _0x1fd31c;if(_0x4b6fb9>=_0x2c7855){_0x4b6fb9=_0x2c7855;_0x1fd31c=0xc8;}else{_0x1fd31c=0xce;}_0x53b1d2[_0x2630('0x18')](_0x1fd31c);return _0x53b1d2[_0x2630('0x1d')](_0x2630('0x1e'),_0x427b3c+'-'+_0x4b6fb9+'/'+_0x2c7855)[_0x2630('0x19')](_0x37c8d7);}return null;};}function patchUpdates(_0x608d15){return function(_0x13b5d5){try{jsonpatch[_0x2630('0x1f')](_0x13b5d5,_0x608d15,!![]);}catch(_0x713af1){return BPromise[_0x2630('0x20')](_0x713af1);}return _0x13b5d5['save']();};}function saveUpdates(_0x47a037,_0x2c4a50){return function(_0x42f98a){if(_0x42f98a){return _0x42f98a['update'](_0x47a037)[_0x2630('0x21')](function(_0x5c67b7){return _0x5c67b7;});}return null;};}function removeEntity(_0x452a9c,_0x3d303a){return function(_0xafc7c6){if(_0xafc7c6){return _0xafc7c6[_0x2630('0x22')]()['then'](function(){_0x452a9c[_0x2630('0x18')](0xcc)[_0x2630('0x23')]();});}};}function handleEntityNotFound(_0x126ec3,_0x81ced7){return function(_0x3468dc){if(!_0x3468dc){_0x126ec3[_0x2630('0x17')](0x194);}return _0x3468dc;};}function handleError(_0x4ef7fb,_0xb6442a){_0xb6442a=_0xb6442a||0x1f4;return function(_0x4acf70){logger['error'](_0x4acf70[_0x2630('0x24')]);if(_0x4acf70[_0x2630('0x25')]){delete _0x4acf70[_0x2630('0x25')];}_0x4ef7fb['status'](_0xb6442a)[_0x2630('0x26')](_0x4acf70);};}exports[_0x2630('0x27')]=function(_0x3e0f49,_0x4c63a5){var _0x3ad356={},_0x4ad461={},_0x336226={'count':0x0,'rows':[]};var _0x4fe723=_[_0x2630('0x28')](db[_0x2630('0x29')]['rawAttributes'],function(_0x683f3d){return{'name':_0x683f3d['fieldName'],'type':_0x683f3d['type'][_0x2630('0x2a')]};});_0x4ad461[_0x2630('0x2b')]=_['map'](_0x4fe723,_0x2630('0x25'));_0x4ad461[_0x2630('0x2c')]=_[_0x2630('0x2d')](_0x3e0f49[_0x2630('0x2c')]);_0x4ad461[_0x2630('0x2e')]=_[_0x2630('0x2f')](_0x4ad461[_0x2630('0x2b')],_0x4ad461['query']);_0x3ad356[_0x2630('0x30')]=_[_0x2630('0x2f')](_0x4ad461['model'],qs[_0x2630('0x31')](_0x3e0f49['query'][_0x2630('0x31')]));_0x3ad356['attributes']=_0x3ad356['attributes'][_0x2630('0x32')]?_0x3ad356[_0x2630('0x30')]:_0x4ad461[_0x2630('0x2b')];if(!_0x3e0f49['query'][_0x2630('0x33')](_0x2630('0x34'))){_0x3ad356['limit']=qs[_0x2630('0x1c')](_0x3e0f49[_0x2630('0x2c')]['limit']);_0x3ad356[_0x2630('0x1a')]=qs['offset'](_0x3e0f49[_0x2630('0x2c')][_0x2630('0x1a')]);}_0x3ad356['order']=qs[_0x2630('0x35')](_0x3e0f49[_0x2630('0x2c')]['sort']);_0x3ad356[_0x2630('0x36')]=qs[_0x2630('0x2e')](_[_0x2630('0x37')](_0x3e0f49[_0x2630('0x2c')],_0x4ad461[_0x2630('0x2e')]),_0x4fe723);if(_0x3e0f49[_0x2630('0x2c')][_0x2630('0x38')]){_0x3ad356[_0x2630('0x36')]=_[_0x2630('0x39')](_0x3ad356['where'],{'$or':_[_0x2630('0x28')](_0x4fe723,function(_0x52bbe5){if(_0x52bbe5[_0x2630('0x3a')]!==_0x2630('0x3b')){var _0xd67ae9={};_0xd67ae9[_0x52bbe5[_0x2630('0x25')]]={'$like':'%'+_0x3e0f49[_0x2630('0x2c')][_0x2630('0x38')]+'%'};return _0xd67ae9;}})});}_0x3ad356=_['merge']({},_0x3ad356,_0x3e0f49[_0x2630('0x3c')]);var _0x2137f4={'where':_0x3ad356['where']};return db['ZohoField'][_0x2630('0x3d')](_0x2137f4)['then'](function(_0x9e4a91){_0x336226[_0x2630('0x3d')]=_0x9e4a91;if(_0x3e0f49[_0x2630('0x2c')]['includeAll']){_0x3ad356[_0x2630('0x3e')]=[{'all':!![]}];}return db[_0x2630('0x29')]['findAll'](_0x3ad356);})['then'](function(_0x181fec){_0x336226[_0x2630('0x3f')]=_0x181fec;return _0x336226;})[_0x2630('0x21')](respondWithFilteredResult(_0x4c63a5,_0x3ad356))[_0x2630('0x40')](handleError(_0x4c63a5,null));};exports['show']=function(_0x368764,_0x241354){var _0x3d3bf0={'raw':!![],'where':{'id':_0x368764[_0x2630('0x41')]['id']}},_0x45f5b0={};_0x45f5b0[_0x2630('0x2b')]=_[_0x2630('0x2d')](db['ZohoField'][_0x2630('0x42')]);_0x45f5b0[_0x2630('0x2c')]=_[_0x2630('0x2d')](_0x368764[_0x2630('0x2c')]);_0x45f5b0[_0x2630('0x2e')]=_[_0x2630('0x2f')](_0x45f5b0[_0x2630('0x2b')],_0x45f5b0[_0x2630('0x2c')]);_0x3d3bf0['attributes']=_['intersection'](_0x45f5b0[_0x2630('0x2b')],qs[_0x2630('0x31')](_0x368764[_0x2630('0x2c')][_0x2630('0x31')]));_0x3d3bf0[_0x2630('0x30')]=_0x3d3bf0['attributes'][_0x2630('0x32')]?_0x3d3bf0['attributes']:_0x45f5b0[_0x2630('0x2b')];if(_0x368764['query'][_0x2630('0x43')]){_0x3d3bf0[_0x2630('0x3e')]=[{'all':!![]}];}_0x3d3bf0=_[_0x2630('0x39')]({},_0x3d3bf0,_0x368764[_0x2630('0x3c')]);return db[_0x2630('0x29')][_0x2630('0x44')](_0x3d3bf0)[_0x2630('0x21')](handleEntityNotFound(_0x241354,null))[_0x2630('0x21')](respondWithResult(_0x241354,null))['catch'](handleError(_0x241354,null));};exports[_0x2630('0x45')]=function(_0xaf34be,_0x21b87c){return db[_0x2630('0x29')]['create'](_0xaf34be[_0x2630('0x46')],{})[_0x2630('0x21')](respondWithResult(_0x21b87c,0xc9))['catch'](handleError(_0x21b87c,null));};exports['update']=function(_0x23d240,_0x35a0e5){if(_0x23d240['body']['id']){delete _0x23d240[_0x2630('0x46')]['id'];}return db[_0x2630('0x29')][_0x2630('0x44')]({'where':{'id':_0x23d240['params']['id']}})[_0x2630('0x21')](handleEntityNotFound(_0x35a0e5,null))[_0x2630('0x21')](saveUpdates(_0x23d240['body'],null))['then'](respondWithResult(_0x35a0e5,null))['catch'](handleError(_0x35a0e5,null));};exports[_0x2630('0x22')]=function(_0x25efd0,_0x524ebd){return db[_0x2630('0x29')][_0x2630('0x44')]({'where':{'id':_0x25efd0['params']['id']}})[_0x2630('0x21')](handleEntityNotFound(_0x524ebd,null))[_0x2630('0x21')](removeEntity(_0x524ebd,null))[_0x2630('0x40')](handleError(_0x524ebd,null));};
\ No newline at end of file
+var _0x5885=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','nolimit','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','merge','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x5885,0x7f));var _0x5588=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5885[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5588('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5588('0x1'));var rp=require(_0x5588('0x2'));var moment=require(_0x5588('0x3'));var BPromise=require(_0x5588('0x4'));var Mustache=require(_0x5588('0x5'));var util=require(_0x5588('0x6'));var path=require(_0x5588('0x7'));var sox=require(_0x5588('0x8'));var csv=require(_0x5588('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5588('0xa'));var crypto=require(_0x5588('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5588('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5588('0xd'));var Papa=require(_0x5588('0xe'));var Redis=require('ioredis');var authService=require(_0x5588('0xf'));var qs=require(_0x5588('0x10'));var as=require(_0x5588('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5588('0x12'));var utils=require(_0x5588('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5eb066,_0x3b9047){_0x3b9047=_0x3b9047||0xcc;return function(_0x31e46f){if(_0x31e46f){return _0x5eb066[_0x5588('0x14')](_0x3b9047);}return _0x5eb066[_0x5588('0x15')](_0x3b9047)[_0x5588('0x16')]();};}function respondWithResult(_0x3550ae,_0x37d739){_0x37d739=_0x37d739||0xc8;return function(_0x51b118){if(_0x51b118){return _0x3550ae[_0x5588('0x15')](_0x37d739)['json'](_0x51b118);}};}function respondWithFilteredResult(_0x1663e6,_0x10b847){return function(_0x5902f4){if(_0x5902f4){var _0x3ea85c=typeof _0x10b847[_0x5588('0x17')]===_0x5588('0x18')&&typeof _0x10b847['limit']==='undefined';var _0x483fbc=_0x5902f4[_0x5588('0x19')];var _0x2826e0=_0x3ea85c?0x0:_0x10b847['offset'];var _0x50c1e4=_0x3ea85c?_0x5902f4[_0x5588('0x19')]:_0x10b847[_0x5588('0x17')]+_0x10b847[_0x5588('0x1a')];var _0x4cefee;if(_0x50c1e4>=_0x483fbc){_0x50c1e4=_0x483fbc;_0x4cefee=0xc8;}else{_0x4cefee=0xce;}_0x1663e6[_0x5588('0x15')](_0x4cefee);return _0x1663e6[_0x5588('0x1b')](_0x5588('0x1c'),_0x2826e0+'-'+_0x50c1e4+'/'+_0x483fbc)[_0x5588('0x1d')](_0x5902f4);}return null;};}function patchUpdates(_0x4b79af){return function(_0x1c0c2a){try{jsonpatch[_0x5588('0x1e')](_0x1c0c2a,_0x4b79af,!![]);}catch(_0x4ee8f4){return BPromise[_0x5588('0x1f')](_0x4ee8f4);}return _0x1c0c2a[_0x5588('0x20')]();};}function saveUpdates(_0x55ce64,_0x49a394){return function(_0x3d2d26){if(_0x3d2d26){return _0x3d2d26[_0x5588('0x21')](_0x55ce64)[_0x5588('0x22')](function(_0x146daa){return _0x146daa;});}return null;};}function removeEntity(_0x56741f,_0x5d175d){return function(_0x14c6fc){if(_0x14c6fc){return _0x14c6fc[_0x5588('0x23')]()[_0x5588('0x22')](function(){_0x56741f[_0x5588('0x15')](0xcc)[_0x5588('0x16')]();});}};}function handleEntityNotFound(_0x20ebdd,_0x1e19ce){return function(_0x4585c4){if(!_0x4585c4){_0x20ebdd['sendStatus'](0x194);}return _0x4585c4;};}function handleError(_0x14a794,_0x4f80a4){_0x4f80a4=_0x4f80a4||0x1f4;return function(_0x63884a){logger['error'](_0x63884a[_0x5588('0x24')]);if(_0x63884a['name']){delete _0x63884a[_0x5588('0x25')];}_0x14a794[_0x5588('0x15')](_0x4f80a4)[_0x5588('0x26')](_0x63884a);};}exports[_0x5588('0x27')]=function(_0x367eb4,_0x45ea4c){var _0x48c864={},_0x12366e={},_0x234466={'count':0x0,'rows':[]};var _0xf703e9=_[_0x5588('0x28')](db[_0x5588('0x29')][_0x5588('0x2a')],function(_0x1eb6a0){return{'name':_0x1eb6a0[_0x5588('0x2b')],'type':_0x1eb6a0[_0x5588('0x2c')][_0x5588('0x2d')]};});_0x12366e[_0x5588('0x2e')]=_[_0x5588('0x28')](_0xf703e9,_0x5588('0x25'));_0x12366e[_0x5588('0x2f')]=_['keys'](_0x367eb4[_0x5588('0x2f')]);_0x12366e['filters']=_['intersection'](_0x12366e[_0x5588('0x2e')],_0x12366e[_0x5588('0x2f')]);_0x48c864['attributes']=_[_0x5588('0x30')](_0x12366e['model'],qs[_0x5588('0x31')](_0x367eb4[_0x5588('0x2f')][_0x5588('0x31')]));_0x48c864[_0x5588('0x32')]=_0x48c864['attributes'][_0x5588('0x33')]?_0x48c864['attributes']:_0x12366e[_0x5588('0x2e')];if(!_0x367eb4[_0x5588('0x2f')]['hasOwnProperty'](_0x5588('0x34'))){_0x48c864[_0x5588('0x1a')]=qs[_0x5588('0x1a')](_0x367eb4[_0x5588('0x2f')][_0x5588('0x1a')]);_0x48c864['offset']=qs['offset'](_0x367eb4['query']['offset']);}_0x48c864['order']=qs[_0x5588('0x35')](_0x367eb4[_0x5588('0x2f')][_0x5588('0x35')]);_0x48c864[_0x5588('0x36')]=qs[_0x5588('0x37')](_[_0x5588('0x38')](_0x367eb4[_0x5588('0x2f')],_0x12366e[_0x5588('0x37')]),_0xf703e9);if(_0x367eb4[_0x5588('0x2f')][_0x5588('0x39')]){_0x48c864[_0x5588('0x36')]=_['merge'](_0x48c864['where'],{'$or':_[_0x5588('0x28')](_0xf703e9,function(_0x1b994a){if(_0x1b994a[_0x5588('0x2c')]!==_0x5588('0x3a')){var _0x1384f4={};_0x1384f4[_0x1b994a['name']]={'$like':'%'+_0x367eb4[_0x5588('0x2f')]['filter']+'%'};return _0x1384f4;}})});}_0x48c864=_['merge']({},_0x48c864,_0x367eb4[_0x5588('0x3b')]);var _0x3927a8={'where':_0x48c864['where']};return db[_0x5588('0x29')][_0x5588('0x19')](_0x3927a8)[_0x5588('0x22')](function(_0x55f6a9){_0x234466[_0x5588('0x19')]=_0x55f6a9;if(_0x367eb4[_0x5588('0x2f')][_0x5588('0x3c')]){_0x48c864[_0x5588('0x3d')]=[{'all':!![]}];}return db['ZohoField'][_0x5588('0x3e')](_0x48c864);})[_0x5588('0x22')](function(_0x4bdbdd){_0x234466[_0x5588('0x3f')]=_0x4bdbdd;return _0x234466;})[_0x5588('0x22')](respondWithFilteredResult(_0x45ea4c,_0x48c864))[_0x5588('0x40')](handleError(_0x45ea4c,null));};exports['show']=function(_0x2cb588,_0x285f00){var _0x5e0ae1={'raw':!![],'where':{'id':_0x2cb588[_0x5588('0x41')]['id']}},_0x4d0a53={};_0x4d0a53[_0x5588('0x2e')]=_[_0x5588('0x42')](db['ZohoField']['rawAttributes']);_0x4d0a53[_0x5588('0x2f')]=_[_0x5588('0x42')](_0x2cb588[_0x5588('0x2f')]);_0x4d0a53['filters']=_['intersection'](_0x4d0a53['model'],_0x4d0a53[_0x5588('0x2f')]);_0x5e0ae1[_0x5588('0x32')]=_['intersection'](_0x4d0a53[_0x5588('0x2e')],qs[_0x5588('0x31')](_0x2cb588[_0x5588('0x2f')][_0x5588('0x31')]));_0x5e0ae1[_0x5588('0x32')]=_0x5e0ae1['attributes'][_0x5588('0x33')]?_0x5e0ae1[_0x5588('0x32')]:_0x4d0a53[_0x5588('0x2e')];if(_0x2cb588[_0x5588('0x2f')]['includeAll']){_0x5e0ae1[_0x5588('0x3d')]=[{'all':!![]}];}_0x5e0ae1=_[_0x5588('0x43')]({},_0x5e0ae1,_0x2cb588[_0x5588('0x3b')]);return db[_0x5588('0x29')][_0x5588('0x44')](_0x5e0ae1)[_0x5588('0x22')](handleEntityNotFound(_0x285f00,null))[_0x5588('0x22')](respondWithResult(_0x285f00,null))['catch'](handleError(_0x285f00,null));};exports[_0x5588('0x45')]=function(_0x14fd07,_0x48528c){return db['ZohoField'][_0x5588('0x45')](_0x14fd07[_0x5588('0x46')],{})[_0x5588('0x22')](respondWithResult(_0x48528c,0xc9))[_0x5588('0x40')](handleError(_0x48528c,null));};exports[_0x5588('0x21')]=function(_0x313278,_0x3ca184){if(_0x313278[_0x5588('0x46')]['id']){delete _0x313278[_0x5588('0x46')]['id'];}return db[_0x5588('0x29')][_0x5588('0x44')]({'where':{'id':_0x313278[_0x5588('0x41')]['id']}})['then'](handleEntityNotFound(_0x3ca184,null))['then'](saveUpdates(_0x313278[_0x5588('0x46')],null))['then'](respondWithResult(_0x3ca184,null))['catch'](handleError(_0x3ca184,null));};exports['destroy']=function(_0x17c2c6,_0x2d241f){return db[_0x5588('0x29')][_0x5588('0x44')]({'where':{'id':_0x17c2c6[_0x5588('0x41')]['id']}})[_0x5588('0x22')](handleEntityNotFound(_0x2d241f,null))[_0x5588('0x22')](removeEntity(_0x2d241f,null))[_0x5588('0x40')](handleError(_0x2d241f,null));};
\ No newline at end of file
index 1f9d7cc..0a621ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a07=['api','moment','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x3eb9fb,_0x5b8af6){var _0x4c9d13=function(_0x276bf7){while(--_0x276bf7){_0x3eb9fb['push'](_0x3eb9fb['shift']());}};_0x4c9d13(++_0x5b8af6);}(_0x2a07,0x74));var _0x72a0=function(_0x30ae7b,_0x3a718f){_0x30ae7b=_0x30ae7b-0x0;var _0xa9d0cf=_0x2a07[_0x30ae7b];return _0xa9d0cf;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var logger=require(_0x72a0('0x2'))(_0x72a0('0x3'));var moment=require(_0x72a0('0x4'));var BPromise=require('bluebird');var rp=require(_0x72a0('0x5'));var fs=require('fs');var path=require(_0x72a0('0x6'));var rimraf=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var attributes=require(_0x72a0('0x9'));module[_0x72a0('0xa')]=function(_0x3ccf6d,_0x20dab9){return _0x3ccf6d[_0x72a0('0xb')](_0x72a0('0xc'),attributes,{'tableName':_0x72a0('0xd'),'paranoid':![],'indexes':[{'name':_0x72a0('0xe'),'fields':[_0x72a0('0xf'),_0x72a0('0x10')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0a6b=['int_zoho_fields','zoho_unique_index','lodash','moment','request-promise','path','rimraf','./intZohoField.attributes','ZohoField'];(function(_0x1fdefe,_0x4dcce2){var _0x4c5fdc=function(_0x44fe3e){while(--_0x44fe3e){_0x1fdefe['push'](_0x1fdefe['shift']());}};_0x4c5fdc(++_0x4dcce2);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x3a7972,_0x307bc9){_0x3a7972=_0x3a7972-0x0;var _0x2747e8=_0x0a6b[_0x3a7972];return _0x2747e8;};'use strict';var _=require(_0xb0a6('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb0a6('0x1'));var BPromise=require('bluebird');var rp=require(_0xb0a6('0x2'));var fs=require('fs');var path=require(_0xb0a6('0x3'));var rimraf=require(_0xb0a6('0x4'));var config=require('../../config/environment');var attributes=require(_0xb0a6('0x5'));module['exports']=function(_0xbbdf89,_0x415e9e){return _0xbbdf89['define'](_0xb0a6('0x6'),attributes,{'tableName':_0xb0a6('0x7'),'paranoid':![],'indexes':[{'name':_0xb0a6('0x8'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 6e23d06..c070c6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37d0=['info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','then'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x37d0,0x181));var _0x037d=function(_0x5c0e16,_0x1e44e3){_0x5c0e16=_0x5c0e16-0x0;var _0xa07949=_0x37d0[_0x5c0e16];return _0xa07949;};'use strict';var _=require(_0x037d('0x0'));var util=require('util');var moment=require(_0x037d('0x1'));var BPromise=require(_0x037d('0x2'));var rs=require(_0x037d('0x3'));var fs=require('fs');var Redis=require(_0x037d('0x4'));var db=require(_0x037d('0x5'))['db'];var utils=require(_0x037d('0x6'));var logger=require('../../config/logger')(_0x037d('0x7'));var config=require(_0x037d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x037d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4db204,_0x161ba7,_0x44606){return new BPromise(function(_0x50f8f2,_0x1a6244){return client['request'](_0x4db204,_0x44606)[_0x037d('0xa')](function(_0x59956a){logger[_0x037d('0xb')](_0x037d('0xc'),_0x161ba7,_0x037d('0xd'));logger[_0x037d('0xe')](_0x037d('0xf'),_0x161ba7,_0x037d('0xd'),JSON[_0x037d('0x10')](_0x59956a));if(_0x59956a[_0x037d('0x11')]){if(_0x59956a[_0x037d('0x11')][_0x037d('0x12')]===0x1f4){logger['error'](_0x037d('0xc'),_0x161ba7,_0x59956a[_0x037d('0x11')][_0x037d('0x13')]);return _0x1a6244(_0x59956a['error'][_0x037d('0x13')]);}logger[_0x037d('0x11')](_0x037d('0xc'),_0x161ba7,_0x59956a[_0x037d('0x11')][_0x037d('0x13')]);return _0x50f8f2(_0x59956a[_0x037d('0x11')]['message']);}else{logger[_0x037d('0xb')](_0x037d('0xc'),_0x161ba7,_0x037d('0xd'));_0x50f8f2(_0x59956a[_0x037d('0x14')][_0x037d('0x13')]);}})[_0x037d('0x15')](function(_0x186ae5){logger[_0x037d('0x11')](_0x037d('0xc'),_0x161ba7,_0x186ae5);_0x1a6244(_0x186ae5);});});}
\ No newline at end of file
+var _0xb9a8=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment'];(function(_0x1fda70,_0x4c091c){var _0x5bfd7d=function(_0x3fc722){while(--_0x3fc722){_0x1fda70['push'](_0x1fda70['shift']());}};_0x5bfd7d(++_0x4c091c);}(_0xb9a8,0x1b3));var _0x8b9a=function(_0x1a2ce7,_0x454834){_0x1a2ce7=_0x1a2ce7-0x0;var _0x2bf7d0=_0xb9a8[_0x1a2ce7];return _0x2bf7d0;};'use strict';var _=require('lodash');var util=require(_0x8b9a('0x0'));var moment=require(_0x8b9a('0x1'));var BPromise=require('bluebird');var rs=require(_0x8b9a('0x2'));var fs=require('fs');var Redis=require(_0x8b9a('0x3'));var db=require(_0x8b9a('0x4'))['db'];var utils=require(_0x8b9a('0x5'));var logger=require(_0x8b9a('0x6'))(_0x8b9a('0x7'));var config=require('../../config/environment');var jayson=require(_0x8b9a('0x8'));var client=jayson[_0x8b9a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c4fb6,_0x293700,_0xa6dbb1){return new BPromise(function(_0x300d4b,_0xadd9ae){return client[_0x8b9a('0xa')](_0x3c4fb6,_0xa6dbb1)[_0x8b9a('0xb')](function(_0x1e2560){logger[_0x8b9a('0xc')](_0x8b9a('0xd'),_0x293700,_0x8b9a('0xe'));logger[_0x8b9a('0xf')](_0x8b9a('0x10'),_0x293700,'request\x20sent',JSON[_0x8b9a('0x11')](_0x1e2560));if(_0x1e2560['error']){if(_0x1e2560[_0x8b9a('0x12')][_0x8b9a('0x13')]===0x1f4){logger[_0x8b9a('0x12')](_0x8b9a('0xd'),_0x293700,_0x1e2560[_0x8b9a('0x12')][_0x8b9a('0x14')]);return _0xadd9ae(_0x1e2560[_0x8b9a('0x12')][_0x8b9a('0x14')]);}logger[_0x8b9a('0x12')](_0x8b9a('0xd'),_0x293700,_0x1e2560[_0x8b9a('0x12')][_0x8b9a('0x14')]);return _0x300d4b(_0x1e2560[_0x8b9a('0x12')][_0x8b9a('0x14')]);}else{logger[_0x8b9a('0xc')](_0x8b9a('0xd'),_0x293700,'request\x20sent');_0x300d4b(_0x1e2560[_0x8b9a('0x15')][_0x8b9a('0x14')]);}})[_0x8b9a('0x16')](function(_0x239f7e){logger['error'](_0x8b9a('0xd'),_0x293700,_0x239f7e);_0xadd9ae(_0x239f7e);});});}
\ No newline at end of file
index a969160..ca4874b 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(_0x589ef5,_0x189fda){var _0x45561a=function(_0x281e44){while(--_0x281e44){_0x589ef5['push'](_0x589ef5['shift']());}};_0x45561a(++_0x189fda);}(_0xe706,0xa3));var _0x6e70=function(_0x18b2a3,_0x2a639b){_0x18b2a3=_0x18b2a3-0x0;var _0x50659f=_0xe706[_0x18b2a3];return _0x50659f;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x13ed6f,_0x515c3c){var _0x3b42dd=function(_0x570416){while(--_0x570416){_0x13ed6f['push'](_0x13ed6f['shift']());}};_0x3b42dd(++_0x515c3c);}(_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
index 8c219d7..465b91f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa977=['exports','STRING','unique_name_and_version','app.js','INTEGER','sequelize'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xa977,0x125));var _0x7a97=function(_0x38450f,_0x5356e0){_0x38450f=_0x38450f-0x0;var _0x2854d8=_0xa977[_0x38450f];return _0x2854d8;};'use strict';var Sequelize=require(_0x7a97('0x0'));module[_0x7a97('0x1')]={'name':{'type':Sequelize[_0x7a97('0x2')],'allowNull':![],'unique':_0x7a97('0x3')},'version':{'type':Sequelize[_0x7a97('0x2')],'allowNull':![],'unique':_0x7a97('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x7a97('0x4')},'filename':{'type':Sequelize[_0x7a97('0x2')]},'path':{'type':Sequelize[_0x7a97('0x2')]},'type':{'type':Sequelize[_0x7a97('0x2')]},'size':{'type':Sequelize[_0x7a97('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x7a97('0x2')]},'state':{'type':Sequelize['STRING'],'unique':'state'},'description':{'type':Sequelize[_0x7a97('0x2')]},'title':{'type':Sequelize[_0x7a97('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x7a97('0x2')],'defaultValue':'#'}};
\ No newline at end of file
+var _0x10ca=['app.js','INTEGER','state','sequelize','exports','unique_name_and_version','STRING'];(function(_0x520ce8,_0x445e56){var _0x64369e=function(_0x3861e4){while(--_0x3861e4){_0x520ce8['push'](_0x520ce8['shift']());}};_0x64369e(++_0x445e56);}(_0x10ca,0x1a7));var _0xa10c=function(_0x42fda6,_0x5d6a9c){_0x42fda6=_0x42fda6-0x0;var _0x37980f=_0x10ca[_0x42fda6];return _0x37980f;};'use strict';var Sequelize=require(_0xa10c('0x0'));module[_0xa10c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa10c('0x2')},'version':{'type':Sequelize[_0xa10c('0x3')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xa10c('0x3')],'defaultValue':_0xa10c('0x4')},'filename':{'type':Sequelize[_0xa10c('0x3')]},'path':{'type':Sequelize[_0xa10c('0x3')]},'type':{'type':Sequelize[_0xa10c('0x3')]},'size':{'type':Sequelize[_0xa10c('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xa10c('0x3')]},'logo':{'type':Sequelize[_0xa10c('0x3')]},'state':{'type':Sequelize[_0xa10c('0x3')],'unique':_0xa10c('0x6')},'description':{'type':Sequelize[_0xa10c('0x3')]},'title':{'type':Sequelize[_0xa10c('0x3')]},'remoteUri':{'type':Sequelize[_0xa10c('0x3')]},'link':{'type':Sequelize[_0xa10c('0x3')],'defaultValue':'#'}};
\ No newline at end of file
index 9fc90e9..ae36fd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a07=['name','send','index','map','Integration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','catch','show','params','fields','includeAll','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','error'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x2a07,0x74));var _0x72a0=function(_0x38d8e2,_0x48603c){_0x38d8e2=_0x38d8e2-0x0;var _0x5afbee=_0x2a07[_0x38d8e2];return _0x5afbee;};'use strict';var emlformat=require(_0x72a0('0x0'));var rimraf=require(_0x72a0('0x1'));var zipdir=require(_0x72a0('0x2'));var jsonpatch=require(_0x72a0('0x3'));var rp=require(_0x72a0('0x4'));var moment=require('moment');var BPromise=require(_0x72a0('0x5'));var Mustache=require(_0x72a0('0x6'));var util=require(_0x72a0('0x7'));var path=require(_0x72a0('0x8'));var sox=require(_0x72a0('0x9'));var csv=require(_0x72a0('0xa'));var ejs=require(_0x72a0('0xb'));var fs=require('fs');var fs_extra=require(_0x72a0('0xc'));var _=require(_0x72a0('0xd'));var squel=require(_0x72a0('0xe'));var crypto=require(_0x72a0('0xf'));var jsforce=require(_0x72a0('0x10'));var deskjs=require(_0x72a0('0x11'));var toCsv=require(_0x72a0('0xa'));var querystring=require(_0x72a0('0x12'));var Papa=require(_0x72a0('0x13'));var Redis=require('ioredis');var authService=require(_0x72a0('0x14'));var qs=require(_0x72a0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72a0('0x16'));var logger=require(_0x72a0('0x17'))(_0x72a0('0x18'));var utils=require(_0x72a0('0x19'));var config=require(_0x72a0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x72a0('0x1b'))['db'];function respondWithStatusCode(_0x335b9f,_0x123ca4){_0x123ca4=_0x123ca4||0xcc;return function(_0xf91a82){if(_0xf91a82){return _0x335b9f[_0x72a0('0x1c')](_0x123ca4);}return _0x335b9f[_0x72a0('0x1d')](_0x123ca4)[_0x72a0('0x1e')]();};}function respondWithResult(_0x5e0b5f,_0x4930c5){_0x4930c5=_0x4930c5||0xc8;return function(_0xe103dc){if(_0xe103dc){return _0x5e0b5f[_0x72a0('0x1d')](_0x4930c5)[_0x72a0('0x1f')](_0xe103dc);}};}function respondWithFilteredResult(_0x1d1133,_0x23b001){return function(_0x3f3d62){if(_0x3f3d62){var _0x4ab55e=typeof _0x23b001[_0x72a0('0x20')]===_0x72a0('0x21')&&typeof _0x23b001[_0x72a0('0x22')]===_0x72a0('0x21');var _0x2d1e95=_0x3f3d62['count'];var _0x100d8f=_0x4ab55e?0x0:_0x23b001[_0x72a0('0x20')];var _0x131b73=_0x4ab55e?_0x3f3d62['count']:_0x23b001[_0x72a0('0x20')]+_0x23b001[_0x72a0('0x22')];var _0x30899b;if(_0x131b73>=_0x2d1e95){_0x131b73=_0x2d1e95;_0x30899b=0xc8;}else{_0x30899b=0xce;}_0x1d1133[_0x72a0('0x1d')](_0x30899b);return _0x1d1133['set'](_0x72a0('0x23'),_0x100d8f+'-'+_0x131b73+'/'+_0x2d1e95)['json'](_0x3f3d62);}return null;};}function patchUpdates(_0x3d0607){return function(_0x315413){try{jsonpatch[_0x72a0('0x24')](_0x315413,_0x3d0607,!![]);}catch(_0x5c7479){return BPromise[_0x72a0('0x25')](_0x5c7479);}return _0x315413[_0x72a0('0x26')]();};}function saveUpdates(_0x1d22d8,_0x3d1965){return function(_0x5d6145){if(_0x5d6145){return _0x5d6145[_0x72a0('0x27')](_0x1d22d8)[_0x72a0('0x28')](function(_0x1ddd54){return _0x1ddd54;});}return null;};}function removeEntity(_0x23b918,_0x3022b0){return function(_0x174b1b){if(_0x174b1b){return _0x174b1b['destroy']()['then'](function(){_0x23b918[_0x72a0('0x1d')](0xcc)[_0x72a0('0x1e')]();});}};}function handleEntityNotFound(_0x123df4,_0x1504ed){return function(_0xf5cb49){if(!_0xf5cb49){_0x123df4[_0x72a0('0x1c')](0x194);}return _0xf5cb49;};}function handleError(_0xa5bda0,_0x15922a){_0x15922a=_0x15922a||0x1f4;return function(_0xee99e2){logger[_0x72a0('0x29')](_0xee99e2['stack']);if(_0xee99e2[_0x72a0('0x2a')]){delete _0xee99e2[_0x72a0('0x2a')];}_0xa5bda0[_0x72a0('0x1d')](_0x15922a)[_0x72a0('0x2b')](_0xee99e2);};}exports[_0x72a0('0x2c')]=function(_0x177a3a,_0x432179){var _0x12eda2={},_0x23c96a={},_0x916733={'count':0x0,'rows':[]};var _0x4ba037=_[_0x72a0('0x2d')](db[_0x72a0('0x2e')][_0x72a0('0x2f')],function(_0xfbe9b3){return{'name':_0xfbe9b3[_0x72a0('0x30')],'type':_0xfbe9b3[_0x72a0('0x31')][_0x72a0('0x32')]};});_0x23c96a['model']=_[_0x72a0('0x2d')](_0x4ba037,_0x72a0('0x2a'));_0x23c96a[_0x72a0('0x33')]=_[_0x72a0('0x34')](_0x177a3a[_0x72a0('0x33')]);_0x23c96a[_0x72a0('0x35')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],_0x23c96a['query']);_0x12eda2[_0x72a0('0x38')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],qs['fields'](_0x177a3a[_0x72a0('0x33')]['fields']));_0x12eda2[_0x72a0('0x38')]=_0x12eda2[_0x72a0('0x38')][_0x72a0('0x39')]?_0x12eda2[_0x72a0('0x38')]:_0x23c96a[_0x72a0('0x37')];if(!_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3a')](_0x72a0('0x3b'))){_0x12eda2[_0x72a0('0x22')]=qs[_0x72a0('0x22')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x22')]);_0x12eda2['offset']=qs[_0x72a0('0x20')](_0x177a3a['query'][_0x72a0('0x20')]);}_0x12eda2[_0x72a0('0x3c')]=qs[_0x72a0('0x3d')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3d')]);_0x12eda2[_0x72a0('0x3e')]=qs[_0x72a0('0x35')](_[_0x72a0('0x3f')](_0x177a3a[_0x72a0('0x33')],_0x23c96a['filters']),_0x4ba037);if(_0x177a3a['query'][_0x72a0('0x40')]){_0x12eda2[_0x72a0('0x3e')]=_[_0x72a0('0x41')](_0x12eda2[_0x72a0('0x3e')],{'$or':_[_0x72a0('0x2d')](_0x4ba037,function(_0x512a06){if(_0x512a06[_0x72a0('0x31')]!==_0x72a0('0x42')){var _0x582c90={};_0x582c90[_0x512a06[_0x72a0('0x2a')]]={'$like':'%'+_0x177a3a['query']['filter']+'%'};return _0x582c90;}})});}_0x12eda2=_['merge']({},_0x12eda2,_0x177a3a[_0x72a0('0x43')]);var _0x49633b={'where':_0x12eda2[_0x72a0('0x3e')]};return db[_0x72a0('0x2e')][_0x72a0('0x44')](_0x49633b)[_0x72a0('0x28')](function(_0x4bf56e){_0x916733['count']=_0x4bf56e;if(_0x177a3a['query']['includeAll']){_0x12eda2[_0x72a0('0x45')]=[{'all':!![]}];}return db[_0x72a0('0x2e')]['findAll'](_0x12eda2);})[_0x72a0('0x28')](function(_0x35d790){_0x916733['rows']=_0x35d790;return _0x916733;})[_0x72a0('0x28')](respondWithFilteredResult(_0x432179,_0x12eda2))[_0x72a0('0x46')](handleError(_0x432179,null));};exports[_0x72a0('0x47')]=function(_0xe4abe1,_0x340153){var _0x341451={'raw':![],'where':{'id':_0xe4abe1[_0x72a0('0x48')]['id']}},_0x50eb7f={};_0x50eb7f['model']=_[_0x72a0('0x34')](db['Integration'][_0x72a0('0x2f')]);_0x50eb7f[_0x72a0('0x33')]=_['keys'](_0xe4abe1[_0x72a0('0x33')]);_0x50eb7f['filters']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],_0x50eb7f[_0x72a0('0x33')]);_0x341451['attributes']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],qs[_0x72a0('0x49')](_0xe4abe1['query']['fields']));_0x341451[_0x72a0('0x38')]=_0x341451['attributes'][_0x72a0('0x39')]?_0x341451[_0x72a0('0x38')]:_0x50eb7f[_0x72a0('0x37')];if(_0xe4abe1[_0x72a0('0x33')][_0x72a0('0x4a')]){_0x341451[_0x72a0('0x45')]=[{'all':!![]}];}_0x341451=_[_0x72a0('0x41')]({},_0x341451,_0xe4abe1[_0x72a0('0x43')]);return db[_0x72a0('0x2e')]['find'](_0x341451)[_0x72a0('0x28')](handleEntityNotFound(_0x340153,null))[_0x72a0('0x28')](respondWithResult(_0x340153,null))[_0x72a0('0x46')](handleError(_0x340153,null));};exports[_0x72a0('0x4b')]=function(_0x3a669d,_0x304400){return db[_0x72a0('0x2e')]['create'](_0x3a669d['body'],{})[_0x72a0('0x28')](respondWithResult(_0x304400,0xc9))[_0x72a0('0x46')](handleError(_0x304400,null));};exports[_0x72a0('0x27')]=function(_0x3cab6a,_0x35a6ad){if(_0x3cab6a[_0x72a0('0x4c')]['id']){delete _0x3cab6a[_0x72a0('0x4c')]['id'];}return db[_0x72a0('0x2e')][_0x72a0('0x4d')]({'where':{'id':_0x3cab6a[_0x72a0('0x48')]['id']}})['then'](handleEntityNotFound(_0x35a6ad,null))[_0x72a0('0x28')](saveUpdates(_0x3cab6a[_0x72a0('0x4c')],null))[_0x72a0('0x28')](respondWithResult(_0x35a6ad,null))[_0x72a0('0x46')](handleError(_0x35a6ad,null));};exports[_0x72a0('0x4e')]=function(_0x5c1570,_0x143410){return db['Integration']['find']({'where':{'id':_0x5c1570[_0x72a0('0x48')]['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x143410,null))[_0x72a0('0x28')](removeEntity(_0x143410,null))[_0x72a0('0x46')](handleError(_0x143410,null));};
\ No newline at end of file
+var _0x1a85=['includeAll','find','create','body','params','destroy','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','squel','crypto','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','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','Integration','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','map','VIRTUAL','merge','options','include','findAll','rows','catch','show','fields'];(function(_0x13b152,_0x30ca28){var _0x2ce949=function(_0x37667e){while(--_0x37667e){_0x13b152['push'](_0x13b152['shift']());}};_0x2ce949(++_0x30ca28);}(_0x1a85,0x178));var _0x51a8=function(_0xef2a14,_0x4c359a){_0xef2a14=_0xef2a14-0x0;var _0x242a4d=_0x1a85[_0xef2a14];return _0x242a4d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x51a8('0x0'));var jsonpatch=require(_0x51a8('0x1'));var rp=require(_0x51a8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x51a8('0x3'));var util=require(_0x51a8('0x4'));var path=require(_0x51a8('0x5'));var sox=require('sox');var csv=require(_0x51a8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51a8('0x7'));var _=require('lodash');var squel=require(_0x51a8('0x8'));var crypto=require(_0x51a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x51a8('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51a8('0xb'));var Redis=require(_0x51a8('0xc'));var authService=require(_0x51a8('0xd'));var qs=require(_0x51a8('0xe'));var as=require(_0x51a8('0xf'));var hardwareService=require(_0x51a8('0x10'));var logger=require(_0x51a8('0x11'))(_0x51a8('0x12'));var utils=require(_0x51a8('0x13'));var config=require(_0x51a8('0x14'));var licenseUtil=require(_0x51a8('0x15'));var db=require(_0x51a8('0x16'))['db'];function respondWithStatusCode(_0x38a1d2,_0x1827e6){_0x1827e6=_0x1827e6||0xcc;return function(_0x43c042){if(_0x43c042){return _0x38a1d2[_0x51a8('0x17')](_0x1827e6);}return _0x38a1d2[_0x51a8('0x18')](_0x1827e6)['end']();};}function respondWithResult(_0x461f5c,_0x7a4c36){_0x7a4c36=_0x7a4c36||0xc8;return function(_0xaec066){if(_0xaec066){return _0x461f5c['status'](_0x7a4c36)[_0x51a8('0x19')](_0xaec066);}};}function respondWithFilteredResult(_0x547d40,_0x10584b){return function(_0x2b8d37){if(_0x2b8d37){var _0x39cd45=typeof _0x10584b[_0x51a8('0x1a')]===_0x51a8('0x1b')&&typeof _0x10584b[_0x51a8('0x1c')]===_0x51a8('0x1b');var _0x516abc=_0x2b8d37[_0x51a8('0x1d')];var _0x45a433=_0x39cd45?0x0:_0x10584b[_0x51a8('0x1a')];var _0x23539e=_0x39cd45?_0x2b8d37[_0x51a8('0x1d')]:_0x10584b[_0x51a8('0x1a')]+_0x10584b['limit'];var _0x1df8c2;if(_0x23539e>=_0x516abc){_0x23539e=_0x516abc;_0x1df8c2=0xc8;}else{_0x1df8c2=0xce;}_0x547d40[_0x51a8('0x18')](_0x1df8c2);return _0x547d40[_0x51a8('0x1e')](_0x51a8('0x1f'),_0x45a433+'-'+_0x23539e+'/'+_0x516abc)[_0x51a8('0x19')](_0x2b8d37);}return null;};}function patchUpdates(_0x3bc044){return function(_0x28aea0){try{jsonpatch[_0x51a8('0x20')](_0x28aea0,_0x3bc044,!![]);}catch(_0x5ac1c0){return BPromise[_0x51a8('0x21')](_0x5ac1c0);}return _0x28aea0['save']();};}function saveUpdates(_0xfe0ddb,_0x12c029){return function(_0x8bda40){if(_0x8bda40){return _0x8bda40[_0x51a8('0x22')](_0xfe0ddb)['then'](function(_0xae3588){return _0xae3588;});}return null;};}function removeEntity(_0x4b9cdd,_0x47f063){return function(_0x23d26a){if(_0x23d26a){return _0x23d26a['destroy']()[_0x51a8('0x23')](function(){_0x4b9cdd[_0x51a8('0x18')](0xcc)[_0x51a8('0x24')]();});}};}function handleEntityNotFound(_0x18e2f3,_0x157554){return function(_0x2f2f05){if(!_0x2f2f05){_0x18e2f3[_0x51a8('0x17')](0x194);}return _0x2f2f05;};}function handleError(_0x1326a2,_0x5b3f49){_0x5b3f49=_0x5b3f49||0x1f4;return function(_0x273ce2){logger[_0x51a8('0x25')](_0x273ce2[_0x51a8('0x26')]);if(_0x273ce2[_0x51a8('0x27')]){delete _0x273ce2[_0x51a8('0x27')];}_0x1326a2[_0x51a8('0x18')](_0x5b3f49)[_0x51a8('0x28')](_0x273ce2);};}exports[_0x51a8('0x29')]=function(_0xec08ae,_0x4b5cda){var _0x20c6b5={},_0x347a02={},_0x4a1548={'count':0x0,'rows':[]};var _0x2f9d53=_['map'](db[_0x51a8('0x2a')][_0x51a8('0x2b')],function(_0x143f46){return{'name':_0x143f46[_0x51a8('0x2c')],'type':_0x143f46[_0x51a8('0x2d')]['key']};});_0x347a02[_0x51a8('0x2e')]=_['map'](_0x2f9d53,_0x51a8('0x27'));_0x347a02[_0x51a8('0x2f')]=_[_0x51a8('0x30')](_0xec08ae['query']);_0x347a02[_0x51a8('0x31')]=_['intersection'](_0x347a02[_0x51a8('0x2e')],_0x347a02[_0x51a8('0x2f')]);_0x20c6b5[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x347a02[_0x51a8('0x2e')],qs['fields'](_0xec08ae[_0x51a8('0x2f')]['fields']));_0x20c6b5[_0x51a8('0x32')]=_0x20c6b5[_0x51a8('0x32')][_0x51a8('0x34')]?_0x20c6b5['attributes']:_0x347a02[_0x51a8('0x2e')];if(!_0xec08ae[_0x51a8('0x2f')][_0x51a8('0x35')](_0x51a8('0x36'))){_0x20c6b5[_0x51a8('0x1c')]=qs['limit'](_0xec08ae['query']['limit']);_0x20c6b5[_0x51a8('0x1a')]=qs[_0x51a8('0x1a')](_0xec08ae['query'][_0x51a8('0x1a')]);}_0x20c6b5['order']=qs[_0x51a8('0x37')](_0xec08ae[_0x51a8('0x2f')][_0x51a8('0x37')]);_0x20c6b5[_0x51a8('0x38')]=qs[_0x51a8('0x31')](_[_0x51a8('0x39')](_0xec08ae['query'],_0x347a02['filters']),_0x2f9d53);if(_0xec08ae[_0x51a8('0x2f')]['filter']){_0x20c6b5['where']=_['merge'](_0x20c6b5[_0x51a8('0x38')],{'$or':_[_0x51a8('0x3a')](_0x2f9d53,function(_0x3cbf97){if(_0x3cbf97['type']!==_0x51a8('0x3b')){var _0x25d772={};_0x25d772[_0x3cbf97[_0x51a8('0x27')]]={'$like':'%'+_0xec08ae[_0x51a8('0x2f')]['filter']+'%'};return _0x25d772;}})});}_0x20c6b5=_[_0x51a8('0x3c')]({},_0x20c6b5,_0xec08ae[_0x51a8('0x3d')]);var _0x1b0333={'where':_0x20c6b5['where']};return db[_0x51a8('0x2a')]['count'](_0x1b0333)[_0x51a8('0x23')](function(_0x1e637a){_0x4a1548[_0x51a8('0x1d')]=_0x1e637a;if(_0xec08ae[_0x51a8('0x2f')]['includeAll']){_0x20c6b5[_0x51a8('0x3e')]=[{'all':!![]}];}return db[_0x51a8('0x2a')][_0x51a8('0x3f')](_0x20c6b5);})[_0x51a8('0x23')](function(_0xa33fc){_0x4a1548[_0x51a8('0x40')]=_0xa33fc;return _0x4a1548;})[_0x51a8('0x23')](respondWithFilteredResult(_0x4b5cda,_0x20c6b5))[_0x51a8('0x41')](handleError(_0x4b5cda,null));};exports[_0x51a8('0x42')]=function(_0x4b8467,_0x22e6e6){var _0x2afb74={'raw':![],'where':{'id':_0x4b8467['params']['id']}},_0x4c7c67={};_0x4c7c67[_0x51a8('0x2e')]=_[_0x51a8('0x30')](db[_0x51a8('0x2a')][_0x51a8('0x2b')]);_0x4c7c67[_0x51a8('0x2f')]=_[_0x51a8('0x30')](_0x4b8467[_0x51a8('0x2f')]);_0x4c7c67[_0x51a8('0x31')]=_[_0x51a8('0x33')](_0x4c7c67[_0x51a8('0x2e')],_0x4c7c67['query']);_0x2afb74[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x4c7c67[_0x51a8('0x2e')],qs[_0x51a8('0x43')](_0x4b8467[_0x51a8('0x2f')][_0x51a8('0x43')]));_0x2afb74['attributes']=_0x2afb74[_0x51a8('0x32')]['length']?_0x2afb74[_0x51a8('0x32')]:_0x4c7c67[_0x51a8('0x2e')];if(_0x4b8467[_0x51a8('0x2f')][_0x51a8('0x44')]){_0x2afb74[_0x51a8('0x3e')]=[{'all':!![]}];}_0x2afb74=_['merge']({},_0x2afb74,_0x4b8467['options']);return db[_0x51a8('0x2a')][_0x51a8('0x45')](_0x2afb74)[_0x51a8('0x23')](handleEntityNotFound(_0x22e6e6,null))[_0x51a8('0x23')](respondWithResult(_0x22e6e6,null))[_0x51a8('0x41')](handleError(_0x22e6e6,null));};exports['create']=function(_0x504a43,_0xcbd998){return db[_0x51a8('0x2a')][_0x51a8('0x46')](_0x504a43[_0x51a8('0x47')],{})[_0x51a8('0x23')](respondWithResult(_0xcbd998,0xc9))[_0x51a8('0x41')](handleError(_0xcbd998,null));};exports[_0x51a8('0x22')]=function(_0x1103a3,_0x301578){if(_0x1103a3['body']['id']){delete _0x1103a3['body']['id'];}return db['Integration'][_0x51a8('0x45')]({'where':{'id':_0x1103a3[_0x51a8('0x48')]['id']}})[_0x51a8('0x23')](handleEntityNotFound(_0x301578,null))['then'](saveUpdates(_0x1103a3[_0x51a8('0x47')],null))[_0x51a8('0x23')](respondWithResult(_0x301578,null))['catch'](handleError(_0x301578,null));};exports[_0x51a8('0x49')]=function(_0x4fb93c,_0x50a2f8){return db[_0x51a8('0x2a')][_0x51a8('0x45')]({'where':{'id':_0x4fb93c[_0x51a8('0x48')]['id']}})['then'](handleEntityNotFound(_0x50a2f8,null))['then'](removeEntity(_0x50a2f8,null))[_0x51a8('0x41')](handleError(_0x50a2f8,null));};
\ No newline at end of file
index 0f0d836..7571a51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4aac=['../../config/environment','./integration.attributes','define','Integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5b24c7,_0x4d4a3b){var _0x4aa715=function(_0x319e0c){while(--_0x319e0c){_0x5b24c7['push'](_0x5b24c7['shift']());}};_0x4aa715(++_0x4d4a3b);}(_0x4aac,0xdc));var _0xc4aa=function(_0x181f95,_0x118690){_0x181f95=_0x181f95-0x0;var _0x23614e=_0x4aac[_0x181f95];return _0x23614e;};'use strict';var _=require(_0xc4aa('0x0'));var util=require(_0xc4aa('0x1'));var logger=require(_0xc4aa('0x2'))(_0xc4aa('0x3'));var moment=require(_0xc4aa('0x4'));var BPromise=require(_0xc4aa('0x5'));var rp=require(_0xc4aa('0x6'));var fs=require('fs');var path=require(_0xc4aa('0x7'));var rimraf=require('rimraf');var config=require(_0xc4aa('0x8'));var attributes=require(_0xc4aa('0x9'));module['exports']=function(_0x2ba71d,_0x3ac022){return _0x2ba71d[_0xc4aa('0xa')](_0xc4aa('0xb'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0ec8=['request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','define','integrations','lodash','../../config/logger','api','bluebird'];(function(_0x1f258b,_0x34daee){var _0x32c540=function(_0x120baf){while(--_0x120baf){_0x1f258b['push'](_0x1f258b['shift']());}};_0x32c540(++_0x34daee);}(_0x0ec8,0xc8));var _0x80ec=function(_0x23e611,_0x188ba4){_0x23e611=_0x23e611-0x0;var _0x3568c6=_0x0ec8[_0x23e611];return _0x3568c6;};'use strict';var _=require(_0x80ec('0x0'));var util=require('util');var logger=require(_0x80ec('0x1'))(_0x80ec('0x2'));var moment=require('moment');var BPromise=require(_0x80ec('0x3'));var rp=require(_0x80ec('0x4'));var fs=require('fs');var path=require(_0x80ec('0x5'));var rimraf=require(_0x80ec('0x6'));var config=require(_0x80ec('0x7'));var attributes=require(_0x80ec('0x8'));module[_0x80ec('0x9')]=function(_0x1ae752,_0x1ae8c4){return _0x1ae752[_0x80ec('0xa')]('Integration',attributes,{'tableName':_0x80ec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cc3a41c..928fa75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x896e=['Integration,\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(_0x1ef676,_0x4fc8a6){var _0x151519=function(_0x53df0b){while(--_0x53df0b){_0x1ef676['push'](_0x1ef676['shift']());}};_0x151519(++_0x4fc8a6);}(_0x896e,0x1e9));var _0xe896=function(_0x187ab2,_0x2c2f2c){_0x187ab2=_0x187ab2-0x0;var _0x88c342=_0x896e[_0x187ab2];return _0x88c342;};'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')]('Integration,\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')]('Integration,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});}
\ No newline at end of file
+var _0x2542=['info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x4c2761,_0x3279c6){var _0x5d4d84=function(_0x3dd9e5){while(--_0x3dd9e5){_0x4c2761['push'](_0x4c2761['shift']());}};_0x5d4d84(++_0x3279c6);}(_0x2542,0x169));var _0x2254=function(_0x407105,_0x254f4e){_0x407105=_0x407105-0x0;var _0x24e4e8=_0x2542[_0x407105];return _0x24e4e8;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});}
\ No newline at end of file
index 426a7c9..6a0931d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d38=['path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./integrationReport.controller','isAuthenticated','index','get','/describe','/:id','create','update','destroy','exports','util'];(function(_0x5286f5,_0x3cd19d){var _0x348723=function(_0x3434e2){while(--_0x3434e2){_0x5286f5['push'](_0x5286f5['shift']());}};_0x348723(++_0x3cd19d);}(_0x6d38,0x1ef));var _0x86d3=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x6d38[_0x297fd3];return _0x2af381;};'use strict';var multer=require('multer');var util=require(_0x86d3('0x0'));var path=require(_0x86d3('0x1'));var timeout=require(_0x86d3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x86d3('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x86d3('0x4'));var config=require(_0x86d3('0x5'));var controller=require(_0x86d3('0x6'));router['get']('/',auth[_0x86d3('0x7')](),controller[_0x86d3('0x8')]);router[_0x86d3('0x9')](_0x86d3('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x86d3('0x9')](_0x86d3('0xb'),auth[_0x86d3('0x7')](),controller['show']);router['post']('/',auth[_0x86d3('0x7')](),controller[_0x86d3('0xc')]);router['put']('/:id',auth[_0x86d3('0x7')](),controller[_0x86d3('0xd')]);router['delete'](_0x86d3('0xb'),auth['isAuthenticated'](),controller[_0x86d3('0xe')]);module[_0x86d3('0xf')]=router;
\ No newline at end of file
+var _0x4137=['show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','/:id'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x4137,0xf8));var _0x7413=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x4137[_0x27af45];return _0x18df21;};'use strict';var multer=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var path=require(_0x7413('0x2'));var timeout=require(_0x7413('0x3'));var express=require(_0x7413('0x4'));var router=express[_0x7413('0x5')]();var fs_extra=require(_0x7413('0x6'));var auth=require(_0x7413('0x7'));var interaction=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var controller=require(_0x7413('0xa'));router[_0x7413('0xb')]('/',auth['isAuthenticated'](),controller[_0x7413('0xc')]);router[_0x7413('0xb')](_0x7413('0xd'),auth[_0x7413('0xe')](),controller['describe']);router[_0x7413('0xb')](_0x7413('0xf'),auth['isAuthenticated'](),controller[_0x7413('0x10')]);router[_0x7413('0x11')]('/',auth['isAuthenticated'](),controller[_0x7413('0x12')]);router[_0x7413('0x13')](_0x7413('0xf'),auth[_0x7413('0xe')](),controller[_0x7413('0x14')]);router['delete'](_0x7413('0xf'),auth[_0x7413('0xe')](),controller['destroy']);module[_0x7413('0x15')]=router;
\ No newline at end of file
index b09e4b8..4cce5df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa41d=['TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x1aabb5,_0x1adc82){var _0x436413=function(_0x2a4bb7){while(--_0x2a4bb7){_0x1aabb5['push'](_0x1aabb5['shift']());}};_0x436413(++_0x1adc82);}(_0xa41d,0x1b6));var _0xda41=function(_0x4b9d59,_0x910c53){_0x4b9d59=_0x4b9d59-0x0;var _0x2426ba=_0xa41d[_0x4b9d59];return _0x2426ba;};'use strict';var Sequelize=require(_0xda41('0x0'));module[_0xda41('0x1')]={'integration':{'type':Sequelize[_0xda41('0x2')]},'eventChannel':{'type':Sequelize[_0xda41('0x2')]},'exitStatus':{'type':Sequelize[_0xda41('0x2')]},'ticketId':{'type':Sequelize[_0xda41('0x2')]},'integrationId':{'type':Sequelize[_0xda41('0x3')]},'contacts':{'type':Sequelize[_0xda41('0x2')]},'uniqueid':{'type':Sequelize[_0xda41('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xda41('0x2')]},'queue':{'type':Sequelize[_0xda41('0x2')]},'interface':{'type':Sequelize[_0xda41('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xda41('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xda41('0x3')]},'agentcomplete':{'type':Sequelize[_0xda41('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xda41('0x4')]},'talktime':{'type':Sequelize[_0xda41('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xda41('0x3')]},'reason':{'type':Sequelize[_0xda41('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xda41('0x4')]},'agentdump':{'type':Sequelize[_0xda41('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xda41('0x4')]},'lastevent':{'type':Sequelize[_0xda41('0x2')]},'channel':{'type':Sequelize[_0xda41('0x2')]},'channelstate':{'type':Sequelize[_0xda41('0x3')]},'channelstatedesc':{'type':Sequelize[_0xda41('0x2')]},'connectedlinenum':{'type':Sequelize[_0xda41('0x2')]},'connectedlinename':{'type':Sequelize[_0xda41('0x2')]},'language':{'type':Sequelize[_0xda41('0x2')]},'accountcode':{'type':Sequelize[_0xda41('0x2')]},'context':{'type':Sequelize[_0xda41('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xda41('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xda41('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xda41('0x2')]},'destcalleridname':{'type':Sequelize[_0xda41('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xda41('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xda41('0x2')]},'destaccountcode':{'type':Sequelize[_0xda41('0x2')]},'destcontext':{'type':Sequelize[_0xda41('0x2')]},'destexten':{'type':Sequelize[_0xda41('0x2')]},'destpriority':{'type':Sequelize[_0xda41('0x2')]},'destuniqueid':{'type':Sequelize[_0xda41('0x2')]},'messageId':{'type':Sequelize[_0xda41('0x2')]},'inReplyTo':{'type':Sequelize[_0xda41('0x2')]},'subject':{'type':Sequelize[_0xda41('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xda41('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0xda41('0x6')]},'html':{'type':Sequelize[_0xda41('0x6')]},'text':{'type':Sequelize[_0xda41('0x6')]},'status':{'type':Sequelize[_0xda41('0x7')](_0xda41('0x8'),_0xda41('0x9'),_0xda41('0xa'),_0xda41('0xb'))},'url':{'type':Sequelize[_0xda41('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0xda41('0x2')]},'projectId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x147f=['SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT'];(function(_0x24337b,_0xd0b766){var _0x5c776a=function(_0x14eab0){while(--_0x14eab0){_0x24337b['push'](_0x24337b['shift']());}};_0x5c776a(++_0xd0b766);}(_0x147f,0xcf));var _0xf147=function(_0x522912,_0x5ecce4){_0x522912=_0x522912-0x0;var _0x1160cf=_0x147f[_0x522912];return _0x1160cf;};'use strict';var Sequelize=require(_0xf147('0x0'));module[_0xf147('0x1')]={'integration':{'type':Sequelize[_0xf147('0x2')]},'eventChannel':{'type':Sequelize[_0xf147('0x2')]},'exitStatus':{'type':Sequelize[_0xf147('0x2')]},'ticketId':{'type':Sequelize[_0xf147('0x2')]},'integrationId':{'type':Sequelize[_0xf147('0x3')]},'contacts':{'type':Sequelize[_0xf147('0x2')]},'uniqueid':{'type':Sequelize[_0xf147('0x2')]},'calleridnum':{'type':Sequelize[_0xf147('0x2')]},'calleridname':{'type':Sequelize[_0xf147('0x2')]},'queue':{'type':Sequelize[_0xf147('0x2')]},'interface':{'type':Sequelize[_0xf147('0x2')]},'membername':{'type':Sequelize[_0xf147('0x2')]},'agentcalledAt':{'type':Sequelize[_0xf147('0x4')]},'agentconnectAt':{'type':Sequelize[_0xf147('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xf147('0x4')]},'talktime':{'type':Sequelize[_0xf147('0x3')]},'agentacw':{'type':Sequelize[_0xf147('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xf147('0x3')]},'reason':{'type':Sequelize[_0xf147('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xf147('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xf147('0x4')]},'agentdump':{'type':Sequelize[_0xf147('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xf147('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xf147('0x2')]},'connectedlinenum':{'type':Sequelize[_0xf147('0x2')]},'connectedlinename':{'type':Sequelize[_0xf147('0x2')]},'language':{'type':Sequelize[_0xf147('0x2')]},'accountcode':{'type':Sequelize[_0xf147('0x2')]},'context':{'type':Sequelize[_0xf147('0x2')]},'exten':{'type':Sequelize[_0xf147('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xf147('0x2')]},'destcalleridnum':{'type':Sequelize[_0xf147('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xf147('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xf147('0x2')]},'destpriority':{'type':Sequelize[_0xf147('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0xf147('0x2')]},'inReplyTo':{'type':Sequelize[_0xf147('0x2')]},'subject':{'type':Sequelize[_0xf147('0x2')]},'from':{'type':Sequelize[_0xf147('0x2')]},'to':{'type':Sequelize[_0xf147('0x2')]},'cc':{'type':Sequelize[_0xf147('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0xf147('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0xf147('0x7')](_0xf147('0x8'),_0xf147('0x9'),_0xf147('0xa'),_0xf147('0xb'))},'url':{'type':Sequelize[_0xf147('0x2')]},'app':{'type':Sequelize[_0xf147('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0xf147('0x3')]}};
\ No newline at end of file
index 3fd6819..e617038 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ec1=['pick','filter','merge','VIRTUAL','options','then','includeAll','include','rows','catch','params','intersection','length','find','create','body','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','destroy','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','query','keys','filters','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x188fbd,_0x4e662b){var _0x17745b=function(_0x23386b){while(--_0x23386b){_0x188fbd['push'](_0x188fbd['shift']());}};_0x17745b(++_0x4e662b);}(_0x5ec1,0x13d));var _0x15ec=function(_0x101802,_0x11f913){_0x101802=_0x101802-0x0;var _0x5d61ce=_0x5ec1[_0x101802];return _0x5d61ce;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x15ec('0x0'));var jsonpatch=require(_0x15ec('0x1'));var rp=require('request-promise');var moment=require(_0x15ec('0x2'));var BPromise=require(_0x15ec('0x3'));var Mustache=require(_0x15ec('0x4'));var util=require(_0x15ec('0x5'));var path=require(_0x15ec('0x6'));var sox=require(_0x15ec('0x7'));var csv=require(_0x15ec('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x15ec('0x9'));var _=require('lodash');var squel=require(_0x15ec('0xa'));var crypto=require(_0x15ec('0xb'));var jsforce=require(_0x15ec('0xc'));var deskjs=require(_0x15ec('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x15ec('0xe'));var authService=require(_0x15ec('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x15ec('0x10'));var hardwareService=require(_0x15ec('0x11'));var logger=require(_0x15ec('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x15ec('0x13'));var licenseUtil=require(_0x15ec('0x14'));var db=require(_0x15ec('0x15'))['db'];function respondWithStatusCode(_0x4255ca,_0x560bde){_0x560bde=_0x560bde||0xcc;return function(_0x5c90fd){if(_0x5c90fd){return _0x4255ca[_0x15ec('0x16')](_0x560bde);}return _0x4255ca['status'](_0x560bde)[_0x15ec('0x17')]();};}function respondWithResult(_0x599db6,_0x1af550){_0x1af550=_0x1af550||0xc8;return function(_0x569f9b){if(_0x569f9b){return _0x599db6[_0x15ec('0x18')](_0x1af550)[_0x15ec('0x19')](_0x569f9b);}};}function respondWithFilteredResult(_0x4abeaf,_0x3c9b2b){return function(_0x6ad1){if(_0x6ad1){var _0x53b022=typeof _0x3c9b2b['offset']===_0x15ec('0x1a')&&typeof _0x3c9b2b['limit']===_0x15ec('0x1a');var _0x28ce6b=_0x6ad1[_0x15ec('0x1b')];var _0x171d11=_0x53b022?0x0:_0x3c9b2b[_0x15ec('0x1c')];var _0x4b1064=_0x53b022?_0x6ad1[_0x15ec('0x1b')]:_0x3c9b2b[_0x15ec('0x1c')]+_0x3c9b2b[_0x15ec('0x1d')];var _0x39738e;if(_0x4b1064>=_0x28ce6b){_0x4b1064=_0x28ce6b;_0x39738e=0xc8;}else{_0x39738e=0xce;}_0x4abeaf[_0x15ec('0x18')](_0x39738e);return _0x4abeaf[_0x15ec('0x1e')](_0x15ec('0x1f'),_0x171d11+'-'+_0x4b1064+'/'+_0x28ce6b)[_0x15ec('0x19')](_0x6ad1);}return null;};}function patchUpdates(_0x213bc4){return function(_0x12310a){try{jsonpatch[_0x15ec('0x20')](_0x12310a,_0x213bc4,!![]);}catch(_0x482bd2){return BPromise['reject'](_0x482bd2);}return _0x12310a[_0x15ec('0x21')]();};}function saveUpdates(_0x5a1e8f,_0x2e6cb8){return function(_0x431ae3){if(_0x431ae3){return _0x431ae3[_0x15ec('0x22')](_0x5a1e8f)['then'](function(_0x39bfac){return _0x39bfac;});}return null;};}function removeEntity(_0x1b40b4,_0x566446){return function(_0x2ce7d2){if(_0x2ce7d2){return _0x2ce7d2[_0x15ec('0x23')]()['then'](function(){_0x1b40b4[_0x15ec('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9db0f0,_0x58ecc2){return function(_0x180c44){if(!_0x180c44){_0x9db0f0[_0x15ec('0x16')](0x194);}return _0x180c44;};}function handleError(_0x4bfaa6,_0xc5eb0d){_0xc5eb0d=_0xc5eb0d||0x1f4;return function(_0x2d857a){logger[_0x15ec('0x24')](_0x2d857a[_0x15ec('0x25')]);if(_0x2d857a[_0x15ec('0x26')]){delete _0x2d857a['name'];}_0x4bfaa6[_0x15ec('0x18')](_0xc5eb0d)[_0x15ec('0x27')](_0x2d857a);};}exports[_0x15ec('0x28')]=function(_0x723916,_0x5e8ed0){var _0x1f8fd6={},_0x28e2d0={},_0x705c9e={'count':0x0,'rows':[]};var _0x4c560a=_[_0x15ec('0x29')](db[_0x15ec('0x2a')][_0x15ec('0x2b')],function(_0x2814f4){return{'name':_0x2814f4[_0x15ec('0x2c')],'type':_0x2814f4[_0x15ec('0x2d')][_0x15ec('0x2e')]};});_0x28e2d0['model']=_[_0x15ec('0x29')](_0x4c560a,_0x15ec('0x26'));_0x28e2d0[_0x15ec('0x2f')]=_[_0x15ec('0x30')](_0x723916['query']);_0x28e2d0[_0x15ec('0x31')]=_['intersection'](_0x28e2d0['model'],_0x28e2d0[_0x15ec('0x2f')]);_0x1f8fd6[_0x15ec('0x32')]=_['intersection'](_0x28e2d0[_0x15ec('0x33')],qs['fields'](_0x723916['query'][_0x15ec('0x34')]));_0x1f8fd6['attributes']=_0x1f8fd6[_0x15ec('0x32')]['length']?_0x1f8fd6[_0x15ec('0x32')]:_0x28e2d0['model'];if(!_0x723916[_0x15ec('0x2f')][_0x15ec('0x35')](_0x15ec('0x36'))){_0x1f8fd6[_0x15ec('0x1d')]=qs[_0x15ec('0x1d')](_0x723916[_0x15ec('0x2f')][_0x15ec('0x1d')]);_0x1f8fd6['offset']=qs[_0x15ec('0x1c')](_0x723916[_0x15ec('0x2f')]['offset']);}_0x1f8fd6[_0x15ec('0x37')]=qs[_0x15ec('0x38')](_0x723916[_0x15ec('0x2f')][_0x15ec('0x38')]);_0x1f8fd6[_0x15ec('0x39')]=qs[_0x15ec('0x31')](_[_0x15ec('0x3a')](_0x723916['query'],_0x28e2d0[_0x15ec('0x31')]),_0x4c560a);if(_0x723916[_0x15ec('0x2f')][_0x15ec('0x3b')]){_0x1f8fd6[_0x15ec('0x39')]=_[_0x15ec('0x3c')](_0x1f8fd6[_0x15ec('0x39')],{'$or':_[_0x15ec('0x29')](_0x4c560a,function(_0x21df66){if(_0x21df66[_0x15ec('0x2d')]!==_0x15ec('0x3d')){var _0x252b6f={};_0x252b6f[_0x21df66[_0x15ec('0x26')]]={'$like':'%'+_0x723916['query']['filter']+'%'};return _0x252b6f;}})});}_0x1f8fd6=_['merge']({},_0x1f8fd6,_0x723916[_0x15ec('0x3e')]);var _0x5b4001={'where':_0x1f8fd6['where']};return db[_0x15ec('0x2a')][_0x15ec('0x1b')](_0x5b4001)[_0x15ec('0x3f')](function(_0x25ce92){_0x705c9e[_0x15ec('0x1b')]=_0x25ce92;if(_0x723916[_0x15ec('0x2f')][_0x15ec('0x40')]){_0x1f8fd6[_0x15ec('0x41')]=[{'all':!![]}];}return db[_0x15ec('0x2a')]['findAll'](_0x1f8fd6);})[_0x15ec('0x3f')](function(_0x5e1ceb){_0x705c9e[_0x15ec('0x42')]=_0x5e1ceb;return _0x705c9e;})[_0x15ec('0x3f')](respondWithFilteredResult(_0x5e8ed0,_0x1f8fd6))[_0x15ec('0x43')](handleError(_0x5e8ed0,null));};exports['show']=function(_0x13c60a,_0x250786){var _0x831dba={'raw':![],'where':{'id':_0x13c60a[_0x15ec('0x44')]['id']}},_0x5a0b37={};_0x5a0b37[_0x15ec('0x33')]=_[_0x15ec('0x30')](db[_0x15ec('0x2a')]['rawAttributes']);_0x5a0b37[_0x15ec('0x2f')]=_[_0x15ec('0x30')](_0x13c60a[_0x15ec('0x2f')]);_0x5a0b37[_0x15ec('0x31')]=_[_0x15ec('0x45')](_0x5a0b37[_0x15ec('0x33')],_0x5a0b37[_0x15ec('0x2f')]);_0x831dba[_0x15ec('0x32')]=_[_0x15ec('0x45')](_0x5a0b37[_0x15ec('0x33')],qs['fields'](_0x13c60a['query'][_0x15ec('0x34')]));_0x831dba[_0x15ec('0x32')]=_0x831dba[_0x15ec('0x32')][_0x15ec('0x46')]?_0x831dba[_0x15ec('0x32')]:_0x5a0b37[_0x15ec('0x33')];if(_0x13c60a[_0x15ec('0x2f')][_0x15ec('0x40')]){_0x831dba[_0x15ec('0x41')]=[{'all':!![]}];}_0x831dba=_[_0x15ec('0x3c')]({},_0x831dba,_0x13c60a[_0x15ec('0x3e')]);return db[_0x15ec('0x2a')][_0x15ec('0x47')](_0x831dba)[_0x15ec('0x3f')](handleEntityNotFound(_0x250786,null))[_0x15ec('0x3f')](respondWithResult(_0x250786,null))['catch'](handleError(_0x250786,null));};exports['create']=function(_0x299da8,_0x23182a){return db[_0x15ec('0x2a')][_0x15ec('0x48')](_0x299da8[_0x15ec('0x49')],{})[_0x15ec('0x3f')](respondWithResult(_0x23182a,0xc9))[_0x15ec('0x43')](handleError(_0x23182a,null));};exports[_0x15ec('0x22')]=function(_0x25fc7e,_0x590a29){if(_0x25fc7e[_0x15ec('0x49')]['id']){delete _0x25fc7e[_0x15ec('0x49')]['id'];}return db[_0x15ec('0x2a')][_0x15ec('0x47')]({'where':{'id':_0x25fc7e[_0x15ec('0x44')]['id']}})[_0x15ec('0x3f')](handleEntityNotFound(_0x590a29,null))[_0x15ec('0x3f')](saveUpdates(_0x25fc7e[_0x15ec('0x49')],null))['then'](respondWithResult(_0x590a29,null))[_0x15ec('0x43')](handleError(_0x590a29,null));};exports[_0x15ec('0x23')]=function(_0x198228,_0xd7bd60){return db['IntegrationReport'][_0x15ec('0x47')]({'where':{'id':_0x198228[_0x15ec('0x44')]['id']}})[_0x15ec('0x3f')](handleEntityNotFound(_0xd7bd60,null))['then'](removeEntity(_0xd7bd60,null))['catch'](handleError(_0xd7bd60,null));};exports[_0x15ec('0x4a')]=function(_0x25ce26,_0x45ac30){return db[_0x15ec('0x2a')]['describe']()[_0x15ec('0x3f')](respondWithResult(_0x45ac30,null))[_0x15ec('0x43')](handleError(_0x45ac30,null));};
\ No newline at end of file
+var _0x0bd3=['squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','query','keys','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','pick','filter','where','merge','map','IntegrationReport','includeAll','include','rows','catch','show','params','rawAttributes','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash'];(function(_0x369a27,_0x567704){var _0x3a5bba=function(_0x892a01){while(--_0x892a01){_0x369a27['push'](_0x369a27['shift']());}};_0x3a5bba(++_0x567704);}(_0x0bd3,0x8c));var _0x30bd=function(_0x5ebe34,_0x421337){_0x5ebe34=_0x5ebe34-0x0;var _0x36a3ee=_0x0bd3[_0x5ebe34];return _0x36a3ee;};'use strict';var emlformat=require(_0x30bd('0x0'));var rimraf=require(_0x30bd('0x1'));var zipdir=require(_0x30bd('0x2'));var jsonpatch=require(_0x30bd('0x3'));var rp=require(_0x30bd('0x4'));var moment=require(_0x30bd('0x5'));var BPromise=require(_0x30bd('0x6'));var Mustache=require(_0x30bd('0x7'));var util=require(_0x30bd('0x8'));var path=require(_0x30bd('0x9'));var sox=require(_0x30bd('0xa'));var csv=require('to-csv');var ejs=require(_0x30bd('0xb'));var fs=require('fs');var fs_extra=require(_0x30bd('0xc'));var _=require(_0x30bd('0xd'));var squel=require(_0x30bd('0xe'));var crypto=require(_0x30bd('0xf'));var jsforce=require(_0x30bd('0x10'));var deskjs=require(_0x30bd('0x11'));var toCsv=require(_0x30bd('0x12'));var querystring=require('querystring');var Papa=require(_0x30bd('0x13'));var Redis=require(_0x30bd('0x14'));var authService=require(_0x30bd('0x15'));var qs=require(_0x30bd('0x16'));var as=require(_0x30bd('0x17'));var hardwareService=require(_0x30bd('0x18'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x30bd('0x19'));var licenseUtil=require(_0x30bd('0x1a'));var db=require(_0x30bd('0x1b'))['db'];function respondWithStatusCode(_0x39d008,_0x287c05){_0x287c05=_0x287c05||0xcc;return function(_0x41ff5b){if(_0x41ff5b){return _0x39d008[_0x30bd('0x1c')](_0x287c05);}return _0x39d008[_0x30bd('0x1d')](_0x287c05)[_0x30bd('0x1e')]();};}function respondWithResult(_0xc6987,_0x2e0bb4){_0x2e0bb4=_0x2e0bb4||0xc8;return function(_0x1e6ffb){if(_0x1e6ffb){return _0xc6987[_0x30bd('0x1d')](_0x2e0bb4)[_0x30bd('0x1f')](_0x1e6ffb);}};}function respondWithFilteredResult(_0xf2dacb,_0x1c96c7){return function(_0x3a1c8d){if(_0x3a1c8d){var _0x38a9c0=typeof _0x1c96c7[_0x30bd('0x20')]===_0x30bd('0x21')&&typeof _0x1c96c7['limit']===_0x30bd('0x21');var _0x22a077=_0x3a1c8d[_0x30bd('0x22')];var _0x343401=_0x38a9c0?0x0:_0x1c96c7[_0x30bd('0x20')];var _0x1f4884=_0x38a9c0?_0x3a1c8d[_0x30bd('0x22')]:_0x1c96c7['offset']+_0x1c96c7['limit'];var _0x1ea959;if(_0x1f4884>=_0x22a077){_0x1f4884=_0x22a077;_0x1ea959=0xc8;}else{_0x1ea959=0xce;}_0xf2dacb[_0x30bd('0x1d')](_0x1ea959);return _0xf2dacb[_0x30bd('0x23')](_0x30bd('0x24'),_0x343401+'-'+_0x1f4884+'/'+_0x22a077)['json'](_0x3a1c8d);}return null;};}function patchUpdates(_0x4bd5bb){return function(_0x1eab0f){try{jsonpatch[_0x30bd('0x25')](_0x1eab0f,_0x4bd5bb,!![]);}catch(_0x598099){return BPromise[_0x30bd('0x26')](_0x598099);}return _0x1eab0f[_0x30bd('0x27')]();};}function saveUpdates(_0x40f780,_0x32fd6c){return function(_0x109f9b){if(_0x109f9b){return _0x109f9b[_0x30bd('0x28')](_0x40f780)[_0x30bd('0x29')](function(_0x51d3b4){return _0x51d3b4;});}return null;};}function removeEntity(_0x3b7145,_0x5c6b9e){return function(_0x5df68e){if(_0x5df68e){return _0x5df68e[_0x30bd('0x2a')]()[_0x30bd('0x29')](function(){_0x3b7145[_0x30bd('0x1d')](0xcc)[_0x30bd('0x1e')]();});}};}function handleEntityNotFound(_0x30efe8,_0x185cbd){return function(_0x34ad0b){if(!_0x34ad0b){_0x30efe8[_0x30bd('0x1c')](0x194);}return _0x34ad0b;};}function handleError(_0x18be21,_0x641ad1){_0x641ad1=_0x641ad1||0x1f4;return function(_0x284fc0){logger[_0x30bd('0x2b')](_0x284fc0['stack']);if(_0x284fc0[_0x30bd('0x2c')]){delete _0x284fc0[_0x30bd('0x2c')];}_0x18be21['status'](_0x641ad1)[_0x30bd('0x2d')](_0x284fc0);};}exports[_0x30bd('0x2e')]=function(_0x1e5a99,_0x482812){var _0x20afdb={},_0x59dd25={},_0x3ba157={'count':0x0,'rows':[]};var _0x310a20=_['map'](db['IntegrationReport']['rawAttributes'],function(_0x3e008c){return{'name':_0x3e008c['fieldName'],'type':_0x3e008c['type']['key']};});_0x59dd25['model']=_['map'](_0x310a20,'name');_0x59dd25[_0x30bd('0x2f')]=_[_0x30bd('0x30')](_0x1e5a99[_0x30bd('0x2f')]);_0x59dd25[_0x30bd('0x31')]=_[_0x30bd('0x32')](_0x59dd25[_0x30bd('0x33')],_0x59dd25['query']);_0x20afdb[_0x30bd('0x34')]=_[_0x30bd('0x32')](_0x59dd25[_0x30bd('0x33')],qs[_0x30bd('0x35')](_0x1e5a99[_0x30bd('0x2f')][_0x30bd('0x35')]));_0x20afdb[_0x30bd('0x34')]=_0x20afdb['attributes'][_0x30bd('0x36')]?_0x20afdb[_0x30bd('0x34')]:_0x59dd25[_0x30bd('0x33')];if(!_0x1e5a99[_0x30bd('0x2f')]['hasOwnProperty'](_0x30bd('0x37'))){_0x20afdb[_0x30bd('0x38')]=qs[_0x30bd('0x38')](_0x1e5a99['query']['limit']);_0x20afdb[_0x30bd('0x20')]=qs[_0x30bd('0x20')](_0x1e5a99[_0x30bd('0x2f')][_0x30bd('0x20')]);}_0x20afdb[_0x30bd('0x39')]=qs['sort'](_0x1e5a99['query'][_0x30bd('0x3a')]);_0x20afdb['where']=qs['filters'](_[_0x30bd('0x3b')](_0x1e5a99['query'],_0x59dd25[_0x30bd('0x31')]),_0x310a20);if(_0x1e5a99[_0x30bd('0x2f')][_0x30bd('0x3c')]){_0x20afdb[_0x30bd('0x3d')]=_[_0x30bd('0x3e')](_0x20afdb[_0x30bd('0x3d')],{'$or':_[_0x30bd('0x3f')](_0x310a20,function(_0x1c5b34){if(_0x1c5b34['type']!=='VIRTUAL'){var _0x4a33ec={};_0x4a33ec[_0x1c5b34[_0x30bd('0x2c')]]={'$like':'%'+_0x1e5a99['query'][_0x30bd('0x3c')]+'%'};return _0x4a33ec;}})});}_0x20afdb=_[_0x30bd('0x3e')]({},_0x20afdb,_0x1e5a99['options']);var _0x484cf8={'where':_0x20afdb[_0x30bd('0x3d')]};return db[_0x30bd('0x40')]['count'](_0x484cf8)['then'](function(_0x4f873c){_0x3ba157[_0x30bd('0x22')]=_0x4f873c;if(_0x1e5a99['query'][_0x30bd('0x41')]){_0x20afdb[_0x30bd('0x42')]=[{'all':!![]}];}return db['IntegrationReport']['findAll'](_0x20afdb);})['then'](function(_0x23b1a8){_0x3ba157[_0x30bd('0x43')]=_0x23b1a8;return _0x3ba157;})[_0x30bd('0x29')](respondWithFilteredResult(_0x482812,_0x20afdb))[_0x30bd('0x44')](handleError(_0x482812,null));};exports[_0x30bd('0x45')]=function(_0xc9d7ac,_0x4e87d9){var _0x485864={'raw':![],'where':{'id':_0xc9d7ac[_0x30bd('0x46')]['id']}},_0x4af87b={};_0x4af87b[_0x30bd('0x33')]=_['keys'](db[_0x30bd('0x40')][_0x30bd('0x47')]);_0x4af87b[_0x30bd('0x2f')]=_[_0x30bd('0x30')](_0xc9d7ac['query']);_0x4af87b[_0x30bd('0x31')]=_[_0x30bd('0x32')](_0x4af87b[_0x30bd('0x33')],_0x4af87b[_0x30bd('0x2f')]);_0x485864[_0x30bd('0x34')]=_[_0x30bd('0x32')](_0x4af87b['model'],qs[_0x30bd('0x35')](_0xc9d7ac[_0x30bd('0x2f')][_0x30bd('0x35')]));_0x485864['attributes']=_0x485864['attributes'][_0x30bd('0x36')]?_0x485864[_0x30bd('0x34')]:_0x4af87b[_0x30bd('0x33')];if(_0xc9d7ac[_0x30bd('0x2f')]['includeAll']){_0x485864[_0x30bd('0x42')]=[{'all':!![]}];}_0x485864=_[_0x30bd('0x3e')]({},_0x485864,_0xc9d7ac[_0x30bd('0x48')]);return db[_0x30bd('0x40')][_0x30bd('0x49')](_0x485864)[_0x30bd('0x29')](handleEntityNotFound(_0x4e87d9,null))[_0x30bd('0x29')](respondWithResult(_0x4e87d9,null))[_0x30bd('0x44')](handleError(_0x4e87d9,null));};exports[_0x30bd('0x4a')]=function(_0x4406c2,_0x1c7021){return db[_0x30bd('0x40')][_0x30bd('0x4a')](_0x4406c2['body'],{})[_0x30bd('0x29')](respondWithResult(_0x1c7021,0xc9))['catch'](handleError(_0x1c7021,null));};exports['update']=function(_0x3fbefc,_0x454b8f){if(_0x3fbefc[_0x30bd('0x4b')]['id']){delete _0x3fbefc['body']['id'];}return db[_0x30bd('0x40')][_0x30bd('0x49')]({'where':{'id':_0x3fbefc[_0x30bd('0x46')]['id']}})['then'](handleEntityNotFound(_0x454b8f,null))[_0x30bd('0x29')](saveUpdates(_0x3fbefc[_0x30bd('0x4b')],null))[_0x30bd('0x29')](respondWithResult(_0x454b8f,null))['catch'](handleError(_0x454b8f,null));};exports[_0x30bd('0x2a')]=function(_0x12132b,_0x178eaf){return db[_0x30bd('0x40')][_0x30bd('0x49')]({'where':{'id':_0x12132b[_0x30bd('0x46')]['id']}})['then'](handleEntityNotFound(_0x178eaf,null))['then'](removeEntity(_0x178eaf,null))[_0x30bd('0x44')](handleError(_0x178eaf,null));};exports['describe']=function(_0x4a1e83,_0x305741){return db['IntegrationReport'][_0x30bd('0x4c')]()[_0x30bd('0x29')](respondWithResult(_0x305741,null))[_0x30bd('0x44')](handleError(_0x305741,null));};
\ No newline at end of file
index 32a46b6..681fd9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8503=['define','IntegrationReport','util','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x8503,0xa2));var _0x3850=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x8503[_0x565c49];return _0x20ca34;};'use strict';var _=require('lodash');var util=require(_0x3850('0x0'));var logger=require(_0x3850('0x1'))('api');var moment=require(_0x3850('0x2'));var BPromise=require('bluebird');var rp=require(_0x3850('0x3'));var fs=require('fs');var path=require(_0x3850('0x4'));var rimraf=require('rimraf');var config=require(_0x3850('0x5'));var attributes=require('./integrationReport.attributes');module['exports']=function(_0x984862,_0x3a12bb){return _0x984862[_0x3850('0x6')](_0x3850('0x7'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xad74=['../../config/logger','api','moment','bluebird','path','./integrationReport.attributes','define','IntegrationReport','report_integration','lodash','util'];(function(_0x34dafa,_0x550842){var _0x33d501=function(_0x127e84){while(--_0x127e84){_0x34dafa['push'](_0x34dafa['shift']());}};_0x33d501(++_0x550842);}(_0xad74,0x77));var _0x4ad7=function(_0x188cb8,_0x3b12b3){_0x188cb8=_0x188cb8-0x0;var _0x25eb9b=_0xad74[_0x188cb8];return _0x25eb9b;};'use strict';var _=require(_0x4ad7('0x0'));var util=require(_0x4ad7('0x1'));var logger=require(_0x4ad7('0x2'))(_0x4ad7('0x3'));var moment=require(_0x4ad7('0x4'));var BPromise=require(_0x4ad7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ad7('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4ad7('0x7'));module['exports']=function(_0x337e75,_0x5e90ad){return _0x337e75[_0x4ad7('0x8')](_0x4ad7('0x9'),attributes,{'tableName':_0x4ad7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c88fc76..07fd4e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x53ec,0x192));var _0xc53e=function(_0x3369c5,_0xce66ba){_0x3369c5=_0x3369c5-0x0;var _0x10fae9=_0x53ec[_0x3369c5];return _0x10fae9;};'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
+var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x5352aa,_0x13fbee){var _0x19b8ad=function(_0x482514){while(--_0x482514){_0x5352aa['push'](_0x5352aa['shift']());}};_0x19b8ad(++_0x13fbee);}(_0x2ef3,0xba));var _0x32ef=function(_0x19c17d,_0x29b2c2){_0x19c17d=_0x19c17d-0x0;var _0x175f87=_0x2ef3[_0x19c17d];return _0x175f87;};'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')]('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
index 3644cb4..0080dce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac39=['create','addInterval','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','show','/:id/sub_intervals'];(function(_0x49a672,_0x15a267){var _0x57b393=function(_0x14c957){while(--_0x14c957){_0x49a672['push'](_0x49a672['shift']());}};_0x57b393(++_0x15a267);}(_0xac39,0x11c));var _0x9ac3=function(_0x2338bc,_0x4abdd7){_0x2338bc=_0x2338bc-0x0;var _0x1d1900=_0xac39[_0x2338bc];return _0x1d1900;};'use strict';var multer=require(_0x9ac3('0x0'));var util=require(_0x9ac3('0x1'));var path=require(_0x9ac3('0x2'));var timeout=require(_0x9ac3('0x3'));var express=require(_0x9ac3('0x4'));var router=express[_0x9ac3('0x5')]();var fs_extra=require(_0x9ac3('0x6'));var auth=require(_0x9ac3('0x7'));var interaction=require(_0x9ac3('0x8'));var config=require(_0x9ac3('0x9'));var controller=require(_0x9ac3('0xa'));router[_0x9ac3('0xb')]('/',auth[_0x9ac3('0xc')](),controller[_0x9ac3('0xd')]);router[_0x9ac3('0xb')]('/:id',auth[_0x9ac3('0xc')](),controller[_0x9ac3('0xe')]);router[_0x9ac3('0xb')](_0x9ac3('0xf'),auth['isAuthenticated'](),controller['getIntervals']);router['post']('/',auth[_0x9ac3('0xc')](),controller[_0x9ac3('0x10')]);router['post']('/:id/sub_intervals',auth[_0x9ac3('0xc')](),controller[_0x9ac3('0x11')]);router[_0x9ac3('0x12')]('/:id/sub_intervals/create_many',auth[_0x9ac3('0xc')](),controller['addIntervals']);router[_0x9ac3('0x13')](_0x9ac3('0x14'),auth['isAuthenticated'](),controller[_0x9ac3('0x15')]);router[_0x9ac3('0x16')](_0x9ac3('0x14'),auth[_0x9ac3('0xc')](),controller[_0x9ac3('0x17')]);module[_0x9ac3('0x18')]=router;
\ No newline at end of file
+var _0x4629=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','/:id','update','destroy','exports','util','path'];(function(_0x45237a,_0x2a4a3e){var _0x552ca7=function(_0x5ef370){while(--_0x5ef370){_0x45237a['push'](_0x45237a['shift']());}};_0x552ca7(++_0x2a4a3e);}(_0x4629,0x136));var _0x9462=function(_0x29e35f,_0x4859ef){_0x29e35f=_0x29e35f-0x0;var _0x266b74=_0x4629[_0x29e35f];return _0x266b74;};'use strict';var multer=require('multer');var util=require(_0x9462('0x0'));var path=require(_0x9462('0x1'));var timeout=require(_0x9462('0x2'));var express=require(_0x9462('0x3'));var router=express[_0x9462('0x4')]();var fs_extra=require(_0x9462('0x5'));var auth=require(_0x9462('0x6'));var interaction=require(_0x9462('0x7'));var config=require(_0x9462('0x8'));var controller=require(_0x9462('0x9'));router[_0x9462('0xa')]('/',auth[_0x9462('0xb')](),controller[_0x9462('0xc')]);router[_0x9462('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x9462('0xd')]);router['get'](_0x9462('0xe'),auth[_0x9462('0xb')](),controller[_0x9462('0xf')]);router[_0x9462('0x10')]('/',auth['isAuthenticated'](),controller[_0x9462('0x11')]);router[_0x9462('0x10')]('/:id/sub_intervals',auth[_0x9462('0xb')](),controller[_0x9462('0x12')]);router[_0x9462('0x10')](_0x9462('0x13'),auth['isAuthenticated'](),controller[_0x9462('0x14')]);router[_0x9462('0x15')](_0x9462('0x16'),auth[_0x9462('0xb')](),controller[_0x9462('0x17')]);router['delete'](_0x9462('0x16'),auth[_0x9462('0xb')](),controller[_0x9462('0x18')]);module[_0x9462('0x19')]=router;
\ No newline at end of file
index 8960db5..82451b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3312=['STRING','sequelize','exports'];(function(_0x4c7d8b,_0x572388){var _0x187158=function(_0x5e956d){while(--_0x5e956d){_0x4c7d8b['push'](_0x4c7d8b['shift']());}};_0x187158(++_0x572388);}(_0x3312,0xee));var _0x2331=function(_0x16102f,_0x5ba16f){_0x16102f=_0x16102f-0x0;var _0x170ec9=_0x3312[_0x16102f];return _0x170ec9;};'use strict';var Sequelize=require(_0x2331('0x0'));module[_0x2331('0x1')]={'name':{'type':Sequelize[_0x2331('0x2')]},'description':{'type':Sequelize[_0x2331('0x2')]},'interval':{'type':Sequelize[_0x2331('0x2')],'allowNull':!![]}};
\ No newline at end of file
+var _0x4dee=['exports','STRING'];(function(_0x5002a6,_0x32b889){var _0x656f71=function(_0x57793f){while(--_0x57793f){_0x5002a6['push'](_0x5002a6['shift']());}};_0x656f71(++_0x32b889);}(_0x4dee,0x9c));var _0xe4de=function(_0x54182e,_0x52204c){_0x54182e=_0x54182e-0x0;var _0x2e658d=_0x4dee[_0x54182e];return _0x2e658d;};'use strict';var Sequelize=require('sequelize');module[_0xe4de('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xe4de('0x1')],'allowNull':!![]}};
\ No newline at end of file
index 6602b52..5fe0ab1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6dae=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','Intervals','UserProfileResource','destroy','error','stack','name','index','map','Interval','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','IntervalId','getIntervals','sort','addIntervals','findOne','sequelize','bulkCreate','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x3a422c,_0x4c5700){var _0x2ca0ce=function(_0x31443b){while(--_0x31443b){_0x3a422c['push'](_0x3a422c['shift']());}};_0x2ca0ce(++_0x4c5700);}(_0x6dae,0x100));var _0xe6da=function(_0x497844,_0x40738d){_0x497844=_0x497844-0x0;var _0x20c1ca=_0x6dae[_0x497844];return _0x20c1ca;};'use strict';var emlformat=require(_0xe6da('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe6da('0x1'));var jsonpatch=require(_0xe6da('0x2'));var rp=require(_0xe6da('0x3'));var moment=require('moment');var BPromise=require(_0xe6da('0x4'));var Mustache=require(_0xe6da('0x5'));var util=require('util');var path=require(_0xe6da('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe6da('0x7'));var _=require(_0xe6da('0x8'));var squel=require(_0xe6da('0x9'));var crypto=require(_0xe6da('0xa'));var jsforce=require(_0xe6da('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe6da('0xc'));var querystring=require(_0xe6da('0xd'));var Papa=require(_0xe6da('0xe'));var Redis=require('ioredis');var authService=require(_0xe6da('0xf'));var qs=require(_0xe6da('0x10'));var as=require(_0xe6da('0x11'));var hardwareService=require(_0xe6da('0x12'));var logger=require(_0xe6da('0x13'))(_0xe6da('0x14'));var utils=require(_0xe6da('0x15'));var config=require(_0xe6da('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe6da('0x17'))['db'];var extensions=require(_0xe6da('0x18'));function respondWithStatusCode(_0xe30c98,_0x57d57c){_0x57d57c=_0x57d57c||0xcc;return function(_0x275e6f){if(_0x275e6f){return _0xe30c98[_0xe6da('0x19')](_0x57d57c);}return _0xe30c98[_0xe6da('0x1a')](_0x57d57c)[_0xe6da('0x1b')]();};}function respondWithResult(_0x3cac77,_0x1b28f9){_0x1b28f9=_0x1b28f9||0xc8;return function(_0x5153c8){if(_0x5153c8){return _0x3cac77[_0xe6da('0x1a')](_0x1b28f9)[_0xe6da('0x1c')](_0x5153c8);}};}function respondWithFilteredResult(_0x14acd7,_0x1fa275){return function(_0x22fabf){if(_0x22fabf){var _0x21d587=typeof _0x1fa275[_0xe6da('0x1d')]===_0xe6da('0x1e')&&typeof _0x1fa275[_0xe6da('0x1f')]===_0xe6da('0x1e');var _0x530d2f=_0x22fabf['count'];var _0x2a854b=_0x21d587?0x0:_0x1fa275[_0xe6da('0x1d')];var _0x2568bc=_0x21d587?_0x22fabf[_0xe6da('0x20')]:_0x1fa275[_0xe6da('0x1d')]+_0x1fa275[_0xe6da('0x1f')];var _0x51dcb7;if(_0x2568bc>=_0x530d2f){_0x2568bc=_0x530d2f;_0x51dcb7=0xc8;}else{_0x51dcb7=0xce;}_0x14acd7[_0xe6da('0x1a')](_0x51dcb7);return _0x14acd7['set'](_0xe6da('0x21'),_0x2a854b+'-'+_0x2568bc+'/'+_0x530d2f)['json'](_0x22fabf);}return null;};}function patchUpdates(_0x451b35){return function(_0x5b80d6){try{jsonpatch[_0xe6da('0x22')](_0x5b80d6,_0x451b35,!![]);}catch(_0x1f5b46){return BPromise['reject'](_0x1f5b46);}return _0x5b80d6[_0xe6da('0x23')]();};}function saveUpdates(_0x432068,_0x58c290){return function(_0x6d7dec){if(_0x6d7dec){return _0x6d7dec[_0xe6da('0x24')](_0x432068)['then'](function(_0x341c23){return _0x341c23;});}return null;};}function removeEntity(_0x2bdcf4,_0x56ee2c){return function(_0xe9519f){if(_0xe9519f){return _0xe9519f['destroy']()[_0xe6da('0x25')](function(){var _0x1fe1b7=_0xe9519f[_0xe6da('0x26')]({'plain':!![]});var _0x56a616=_0xe6da('0x27');return db[_0xe6da('0x28')][_0xe6da('0x29')]({'where':{'type':_0x56a616,'resourceId':_0x1fe1b7['id']}})[_0xe6da('0x25')](function(){return _0xe9519f;});})[_0xe6da('0x25')](function(){_0x2bdcf4[_0xe6da('0x1a')](0xcc)[_0xe6da('0x1b')]();});}};}function handleEntityNotFound(_0x2ddb38,_0x349722){return function(_0x4be111){if(!_0x4be111){_0x2ddb38[_0xe6da('0x19')](0x194);}return _0x4be111;};}function handleError(_0x2cb863,_0x3487db){_0x3487db=_0x3487db||0x1f4;return function(_0x80377a){logger[_0xe6da('0x2a')](_0x80377a[_0xe6da('0x2b')]);if(_0x80377a[_0xe6da('0x2c')]){delete _0x80377a[_0xe6da('0x2c')];}_0x2cb863[_0xe6da('0x1a')](_0x3487db)['send'](_0x80377a);};}exports[_0xe6da('0x2d')]=function(_0x45f0ff,_0x2cd8e5){var _0x222a83={},_0x545a87={},_0x4b99e7={'count':0x0,'rows':[]};var _0x5b4364=_[_0xe6da('0x2e')](db[_0xe6da('0x2f')][_0xe6da('0x30')],function(_0x270029){return{'name':_0x270029[_0xe6da('0x31')],'type':_0x270029[_0xe6da('0x32')][_0xe6da('0x33')]};});_0x545a87[_0xe6da('0x34')]=_[_0xe6da('0x2e')](_0x5b4364,_0xe6da('0x2c'));_0x545a87[_0xe6da('0x35')]=_[_0xe6da('0x36')](_0x45f0ff[_0xe6da('0x35')]);_0x545a87['filters']=_[_0xe6da('0x37')](_0x545a87[_0xe6da('0x34')],_0x545a87[_0xe6da('0x35')]);_0x222a83[_0xe6da('0x38')]=_[_0xe6da('0x37')](_0x545a87[_0xe6da('0x34')],qs['fields'](_0x45f0ff['query'][_0xe6da('0x39')]));_0x222a83[_0xe6da('0x38')]=_0x222a83[_0xe6da('0x38')][_0xe6da('0x3a')]?_0x222a83[_0xe6da('0x38')]:_0x545a87[_0xe6da('0x34')];if(!_0x45f0ff['query'][_0xe6da('0x3b')](_0xe6da('0x3c'))){_0x222a83[_0xe6da('0x1f')]=qs['limit'](_0x45f0ff['query'][_0xe6da('0x1f')]);_0x222a83[_0xe6da('0x1d')]=qs[_0xe6da('0x1d')](_0x45f0ff[_0xe6da('0x35')][_0xe6da('0x1d')]);}_0x222a83[_0xe6da('0x3d')]=qs['sort'](_0x45f0ff['query']['sort']);_0x222a83[_0xe6da('0x3e')]=qs['filters'](_[_0xe6da('0x3f')](_0x45f0ff[_0xe6da('0x35')],_0x545a87[_0xe6da('0x40')]),_0x5b4364);if(_0x45f0ff[_0xe6da('0x35')][_0xe6da('0x41')]){_0x222a83[_0xe6da('0x3e')]=_[_0xe6da('0x42')](_0x222a83[_0xe6da('0x3e')],{'$or':_[_0xe6da('0x2e')](_0x5b4364,function(_0x29aebc){if(_0x29aebc['type']!==_0xe6da('0x43')){var _0xe722ca={};_0xe722ca[_0x29aebc[_0xe6da('0x2c')]]={'$like':'%'+_0x45f0ff[_0xe6da('0x35')][_0xe6da('0x41')]+'%'};return _0xe722ca;}})});}_0x222a83=_[_0xe6da('0x42')]({},_0x222a83,_0x45f0ff[_0xe6da('0x44')]);var _0x52d9e1={'where':_0x222a83[_0xe6da('0x3e')]};return db[_0xe6da('0x2f')][_0xe6da('0x20')](_0x52d9e1)[_0xe6da('0x25')](function(_0x1168da){_0x4b99e7['count']=_0x1168da;if(_0x45f0ff[_0xe6da('0x35')]['includeAll']){_0x222a83[_0xe6da('0x45')]=[{'all':!![]}];}return db[_0xe6da('0x2f')][_0xe6da('0x46')](_0x222a83);})['then'](function(_0x43e9ff){_0x4b99e7[_0xe6da('0x47')]=_0x43e9ff;return _0x4b99e7;})['then'](respondWithFilteredResult(_0x2cd8e5,_0x222a83))[_0xe6da('0x48')](handleError(_0x2cd8e5,null));};exports[_0xe6da('0x49')]=function(_0x536f70,_0x26f708){var _0xa7e331={'raw':!![],'where':{'id':_0x536f70[_0xe6da('0x4a')]['id']}},_0x3d3cc7={};_0x3d3cc7[_0xe6da('0x34')]=_[_0xe6da('0x36')](db[_0xe6da('0x2f')][_0xe6da('0x30')]);_0x3d3cc7[_0xe6da('0x35')]=_[_0xe6da('0x36')](_0x536f70[_0xe6da('0x35')]);_0x3d3cc7[_0xe6da('0x40')]=_[_0xe6da('0x37')](_0x3d3cc7[_0xe6da('0x34')],_0x3d3cc7['query']);_0xa7e331['attributes']=_[_0xe6da('0x37')](_0x3d3cc7[_0xe6da('0x34')],qs['fields'](_0x536f70[_0xe6da('0x35')]['fields']));_0xa7e331[_0xe6da('0x38')]=_0xa7e331[_0xe6da('0x38')]['length']?_0xa7e331[_0xe6da('0x38')]:_0x3d3cc7[_0xe6da('0x34')];if(_0x536f70['query']['includeAll']){_0xa7e331[_0xe6da('0x45')]=[{'all':!![]}];}_0xa7e331=_[_0xe6da('0x42')]({},_0xa7e331,_0x536f70[_0xe6da('0x44')]);return db[_0xe6da('0x2f')][_0xe6da('0x4b')](_0xa7e331)[_0xe6da('0x25')](handleEntityNotFound(_0x26f708,null))[_0xe6da('0x25')](respondWithResult(_0x26f708,null))[_0xe6da('0x48')](handleError(_0x26f708,null));};exports['create']=function(_0x518beb,_0x241057){return db[_0xe6da('0x2f')][_0xe6da('0x4c')](_0x518beb['body'],{})[_0xe6da('0x25')](function(_0x45b297){var _0x508bc4=_0x518beb[_0xe6da('0x4d')][_0xe6da('0x26')]({'plain':!![]});if(!_0x508bc4)throw new Error(_0xe6da('0x4e'));if(_0x508bc4['role']===_0xe6da('0x4d')){var _0x3a48b8=_0x45b297[_0xe6da('0x26')]({'plain':!![]});var _0x45be43=_0xe6da('0x27');return db[_0xe6da('0x4f')][_0xe6da('0x4b')]({'where':{'name':_0x45be43,'userProfileId':_0x508bc4['userProfileId']},'raw':!![]})[_0xe6da('0x25')](function(_0x33b5f3){if(_0x33b5f3&&_0x33b5f3[_0xe6da('0x50')]===0x0){return db[_0xe6da('0x28')][_0xe6da('0x4c')]({'name':_0x3a48b8['name'],'resourceId':_0x3a48b8['id'],'type':_0x33b5f3[_0xe6da('0x2c')],'sectionId':_0x33b5f3['id']},{})['then'](function(){return _0x45b297;});}else{return _0x45b297;}})[_0xe6da('0x48')](function(_0x2e9563){logger[_0xe6da('0x2a')](_0xe6da('0x51'),_0x2e9563);throw _0x2e9563;});}return _0x45b297;})[_0xe6da('0x25')](respondWithResult(_0x241057,0xc9))['catch'](handleError(_0x241057,null));};exports[_0xe6da('0x24')]=function(_0x3f86da,_0xccfa5d){if(_0x3f86da[_0xe6da('0x52')]['id']){delete _0x3f86da[_0xe6da('0x52')]['id'];}return db['Interval'][_0xe6da('0x4b')]({'where':{'id':_0x3f86da[_0xe6da('0x4a')]['id']}})[_0xe6da('0x25')](handleEntityNotFound(_0xccfa5d,null))[_0xe6da('0x25')](saveUpdates(_0x3f86da['body'],null))[_0xe6da('0x25')](respondWithResult(_0xccfa5d,null))[_0xe6da('0x48')](handleError(_0xccfa5d,null));};exports[_0xe6da('0x29')]=function(_0x37f55b,_0x3fb366){return db[_0xe6da('0x2f')]['find']({'where':{'id':_0x37f55b['params']['id']}})[_0xe6da('0x25')](handleEntityNotFound(_0x3fb366,null))[_0xe6da('0x25')](removeEntity(_0x3fb366,null))['catch'](handleError(_0x3fb366,null));};exports[_0xe6da('0x53')]=function(_0x1158cd,_0x33df6c,_0x5a4596){if(_0x1158cd['body']['id']){delete _0x1158cd[_0xe6da('0x52')]['id'];}return db[_0xe6da('0x2f')][_0xe6da('0x4b')]({'where':{'id':_0x1158cd[_0xe6da('0x4a')]['id']}})[_0xe6da('0x25')](handleEntityNotFound(_0x33df6c,null))[_0xe6da('0x25')](function(_0x1b5b5e){if(_0x1b5b5e){_0x1158cd['body'][_0xe6da('0x54')]=_0x1b5b5e['id'];return db['Interval'][_0xe6da('0x4c')](_0x1158cd['body']);}})['then'](respondWithResult(_0x33df6c,null))[_0xe6da('0x48')](handleError(_0x33df6c,null));};exports[_0xe6da('0x55')]=function(_0x4816ad,_0x1f3655,_0x2e135f){var _0xc6844a={};var _0x372e96={};var _0x366f4d;var _0x27eb03;return db[_0xe6da('0x2f')]['findOne']({'where':{'id':_0x4816ad[_0xe6da('0x4a')]['id']}})[_0xe6da('0x25')](handleEntityNotFound(_0x1f3655,null))[_0xe6da('0x25')](function(_0xb36591){if(_0xb36591){_0x366f4d=_0xb36591;_0x372e96[_0xe6da('0x34')]=_[_0xe6da('0x36')](db[_0xe6da('0x2f')][_0xe6da('0x30')]);_0x372e96[_0xe6da('0x35')]=_['keys'](_0x4816ad[_0xe6da('0x35')]);_0x372e96[_0xe6da('0x40')]=_['intersection'](_0x372e96[_0xe6da('0x34')],_0x372e96['query']);_0xc6844a[_0xe6da('0x38')]=_[_0xe6da('0x37')](_0x372e96['model'],qs[_0xe6da('0x39')](_0x4816ad['query'][_0xe6da('0x39')]));_0xc6844a[_0xe6da('0x38')]=_0xc6844a['attributes'][_0xe6da('0x3a')]?_0xc6844a[_0xe6da('0x38')]:_0x372e96[_0xe6da('0x34')];_0xc6844a[_0xe6da('0x3d')]=qs[_0xe6da('0x56')](_0x4816ad[_0xe6da('0x35')][_0xe6da('0x56')]);_0xc6844a[_0xe6da('0x3e')]=qs['filters'](_[_0xe6da('0x3f')](_0x4816ad[_0xe6da('0x35')],_0x372e96[_0xe6da('0x40')]));if(_0x4816ad['query'][_0xe6da('0x41')]){_0xc6844a[_0xe6da('0x3e')]=_['merge'](_0xc6844a[_0xe6da('0x3e')],{'$or':_[_0xe6da('0x2e')](_0xc6844a['attributes'],function(_0x565798){var _0x3fa04d={};_0x3fa04d[_0x565798]={'$like':'%'+_0x4816ad[_0xe6da('0x35')][_0xe6da('0x41')]+'%'};return _0x3fa04d;})});}_0xc6844a=_[_0xe6da('0x42')]({},_0xc6844a,_0x4816ad[_0xe6da('0x44')]);return _0x366f4d[_0xe6da('0x55')](_0xc6844a);}})['then'](function(_0x304969){if(_0x304969){_0x27eb03=_0x304969[_0xe6da('0x3a')];if(!_0x4816ad[_0xe6da('0x35')][_0xe6da('0x3b')](_0xe6da('0x3c'))){_0xc6844a['limit']=qs[_0xe6da('0x1f')](_0x4816ad['query'][_0xe6da('0x1f')]);_0xc6844a[_0xe6da('0x1d')]=qs['offset'](_0x4816ad['query'][_0xe6da('0x1d')]);}return _0x366f4d[_0xe6da('0x55')](_0xc6844a);}})[_0xe6da('0x25')](function(_0x12d3b5){if(_0x12d3b5){return _0x12d3b5?{'count':_0x27eb03,'rows':_0x12d3b5}:null;}})[_0xe6da('0x25')](respondWithResult(_0x1f3655,null))[_0xe6da('0x48')](handleError(_0x1f3655,null));};exports[_0xe6da('0x57')]=function(_0x36831a,_0x1f1b8d,_0x551b01){return db[_0xe6da('0x2f')][_0xe6da('0x58')]({'where':{'id':_0x36831a[_0xe6da('0x4a')]['id']}})[_0xe6da('0x25')](handleEntityNotFound(_0x1f1b8d,null))['then'](function(_0x1704ec){if(_0x1704ec){return db[_0xe6da('0x59')]['transaction'](function(_0x569a04){return db[_0xe6da('0x2f')]['destroy']({'where':{'IntervalId':_0x36831a['params']['id']},'transaction':_0x569a04})[_0xe6da('0x25')](function(_0x1355cc){var _0x504754=_[_0xe6da('0x2e')](_0x36831a[_0xe6da('0x52')],function(_0x9bbfe7){delete _0x9bbfe7['id'];_0x9bbfe7[_0xe6da('0x54')]=_0x36831a[_0xe6da('0x4a')]['id'];return _0x9bbfe7;});return db[_0xe6da('0x2f')][_0xe6da('0x5a')](_0x504754,{'transaction':_0x569a04});});})[_0xe6da('0x25')](function(){return db['Interval'][_0xe6da('0x46')]({'where':{'IntervalId':_0x36831a[_0xe6da('0x4a')]['id']}});});}})[_0xe6da('0x25')](respondWithResult(_0x1f1b8d,null))[_0xe6da('0x48')](handleError(_0x1f1b8d,null));};
\ No newline at end of file
+var _0x1433=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/extensions/rewrite','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','Intervals','UserProfileResource','error','name','send','index','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','pick','filter','where','merge','options','Interval','include','findAll','rows','show','params','keys','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','rawAttributes','order','sort','addIntervals','transaction','bulkCreate','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x340c13,_0x595d66){var _0x5a7d96=function(_0x250118){while(--_0x250118){_0x340c13['push'](_0x340c13['shift']());}};_0x5a7d96(++_0x595d66);}(_0x1433,0x107));var _0x3143=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x1433[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0x3143('0x0'));var rimraf=require(_0x3143('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3143('0x2'));var rp=require(_0x3143('0x3'));var moment=require('moment');var BPromise=require(_0x3143('0x4'));var Mustache=require(_0x3143('0x5'));var util=require(_0x3143('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x3143('0x7'));var ejs=require(_0x3143('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3143('0x9'));var squel=require(_0x3143('0xa'));var crypto=require(_0x3143('0xb'));var jsforce=require(_0x3143('0xc'));var deskjs=require(_0x3143('0xd'));var toCsv=require(_0x3143('0x7'));var querystring=require(_0x3143('0xe'));var Papa=require(_0x3143('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3143('0x10'));var as=require(_0x3143('0x11'));var hardwareService=require(_0x3143('0x12'));var logger=require(_0x3143('0x13'))(_0x3143('0x14'));var utils=require(_0x3143('0x15'));var config=require(_0x3143('0x16'));var licenseUtil=require(_0x3143('0x17'));var db=require('../../mysqldb')['db'];var extensions=require(_0x3143('0x18'));function respondWithStatusCode(_0x37c1f2,_0x3d61e5){_0x3d61e5=_0x3d61e5||0xcc;return function(_0x3604e2){if(_0x3604e2){return _0x37c1f2['sendStatus'](_0x3d61e5);}return _0x37c1f2[_0x3143('0x19')](_0x3d61e5)[_0x3143('0x1a')]();};}function respondWithResult(_0x2456a1,_0x38c422){_0x38c422=_0x38c422||0xc8;return function(_0x1f4f23){if(_0x1f4f23){return _0x2456a1[_0x3143('0x19')](_0x38c422)[_0x3143('0x1b')](_0x1f4f23);}};}function respondWithFilteredResult(_0x522f7b,_0x31396c){return function(_0x18d742){if(_0x18d742){var _0x107e06=typeof _0x31396c[_0x3143('0x1c')]===_0x3143('0x1d')&&typeof _0x31396c['limit']===_0x3143('0x1d');var _0x24ea6c=_0x18d742['count'];var _0x232766=_0x107e06?0x0:_0x31396c['offset'];var _0x240850=_0x107e06?_0x18d742[_0x3143('0x1e')]:_0x31396c[_0x3143('0x1c')]+_0x31396c[_0x3143('0x1f')];var _0x13fc2f;if(_0x240850>=_0x24ea6c){_0x240850=_0x24ea6c;_0x13fc2f=0xc8;}else{_0x13fc2f=0xce;}_0x522f7b[_0x3143('0x19')](_0x13fc2f);return _0x522f7b[_0x3143('0x20')](_0x3143('0x21'),_0x232766+'-'+_0x240850+'/'+_0x24ea6c)[_0x3143('0x1b')](_0x18d742);}return null;};}function patchUpdates(_0x21e0dc){return function(_0x375240){try{jsonpatch[_0x3143('0x22')](_0x375240,_0x21e0dc,!![]);}catch(_0x32b1f7){return BPromise[_0x3143('0x23')](_0x32b1f7);}return _0x375240['save']();};}function saveUpdates(_0x3992c3,_0xd87ab2){return function(_0x415b67){if(_0x415b67){return _0x415b67[_0x3143('0x24')](_0x3992c3)[_0x3143('0x25')](function(_0x4ba632){return _0x4ba632;});}return null;};}function removeEntity(_0x311f44,_0xaee97d){return function(_0xb09f39){if(_0xb09f39){return _0xb09f39[_0x3143('0x26')]()[_0x3143('0x25')](function(){var _0x34a280=_0xb09f39[_0x3143('0x27')]({'plain':!![]});var _0x40434c=_0x3143('0x28');return db[_0x3143('0x29')]['destroy']({'where':{'type':_0x40434c,'resourceId':_0x34a280['id']}})['then'](function(){return _0xb09f39;});})[_0x3143('0x25')](function(){_0x311f44[_0x3143('0x19')](0xcc)[_0x3143('0x1a')]();});}};}function handleEntityNotFound(_0x274d1a,_0x411c92){return function(_0x4eeae9){if(!_0x4eeae9){_0x274d1a['sendStatus'](0x194);}return _0x4eeae9;};}function handleError(_0x37a480,_0x47c8cd){_0x47c8cd=_0x47c8cd||0x1f4;return function(_0x22f409){logger[_0x3143('0x2a')](_0x22f409['stack']);if(_0x22f409[_0x3143('0x2b')]){delete _0x22f409[_0x3143('0x2b')];}_0x37a480[_0x3143('0x19')](_0x47c8cd)[_0x3143('0x2c')](_0x22f409);};}exports[_0x3143('0x2d')]=function(_0xbcd998,_0xf88ceb){var _0x3d48f0={},_0x26918d={},_0x5d4cd2={'count':0x0,'rows':[]};var _0x25c9e7=_['map'](db['Interval']['rawAttributes'],function(_0x47daad){return{'name':_0x47daad[_0x3143('0x2e')],'type':_0x47daad[_0x3143('0x2f')][_0x3143('0x30')]};});_0x26918d[_0x3143('0x31')]=_[_0x3143('0x32')](_0x25c9e7,_0x3143('0x2b'));_0x26918d[_0x3143('0x33')]=_['keys'](_0xbcd998[_0x3143('0x33')]);_0x26918d[_0x3143('0x34')]=_[_0x3143('0x35')](_0x26918d[_0x3143('0x31')],_0x26918d['query']);_0x3d48f0['attributes']=_['intersection'](_0x26918d[_0x3143('0x31')],qs[_0x3143('0x36')](_0xbcd998[_0x3143('0x33')]['fields']));_0x3d48f0[_0x3143('0x37')]=_0x3d48f0[_0x3143('0x37')][_0x3143('0x38')]?_0x3d48f0[_0x3143('0x37')]:_0x26918d['model'];if(!_0xbcd998['query'][_0x3143('0x39')](_0x3143('0x3a'))){_0x3d48f0['limit']=qs[_0x3143('0x1f')](_0xbcd998[_0x3143('0x33')][_0x3143('0x1f')]);_0x3d48f0[_0x3143('0x1c')]=qs[_0x3143('0x1c')](_0xbcd998['query']['offset']);}_0x3d48f0['order']=qs['sort'](_0xbcd998[_0x3143('0x33')]['sort']);_0x3d48f0['where']=qs[_0x3143('0x34')](_[_0x3143('0x3b')](_0xbcd998[_0x3143('0x33')],_0x26918d['filters']),_0x25c9e7);if(_0xbcd998[_0x3143('0x33')][_0x3143('0x3c')]){_0x3d48f0[_0x3143('0x3d')]=_[_0x3143('0x3e')](_0x3d48f0[_0x3143('0x3d')],{'$or':_['map'](_0x25c9e7,function(_0x1f3569){if(_0x1f3569[_0x3143('0x2f')]!=='VIRTUAL'){var _0x1b4b5e={};_0x1b4b5e[_0x1f3569[_0x3143('0x2b')]]={'$like':'%'+_0xbcd998[_0x3143('0x33')][_0x3143('0x3c')]+'%'};return _0x1b4b5e;}})});}_0x3d48f0=_[_0x3143('0x3e')]({},_0x3d48f0,_0xbcd998[_0x3143('0x3f')]);var _0x5aed56={'where':_0x3d48f0[_0x3143('0x3d')]};return db[_0x3143('0x40')][_0x3143('0x1e')](_0x5aed56)['then'](function(_0x267ce9){_0x5d4cd2[_0x3143('0x1e')]=_0x267ce9;if(_0xbcd998[_0x3143('0x33')]['includeAll']){_0x3d48f0[_0x3143('0x41')]=[{'all':!![]}];}return db[_0x3143('0x40')][_0x3143('0x42')](_0x3d48f0);})[_0x3143('0x25')](function(_0x205a50){_0x5d4cd2[_0x3143('0x43')]=_0x205a50;return _0x5d4cd2;})[_0x3143('0x25')](respondWithFilteredResult(_0xf88ceb,_0x3d48f0))['catch'](handleError(_0xf88ceb,null));};exports[_0x3143('0x44')]=function(_0x42833a,_0x4fbc17){var _0x1ac6b4={'raw':!![],'where':{'id':_0x42833a[_0x3143('0x45')]['id']}},_0x50abdb={};_0x50abdb[_0x3143('0x31')]=_[_0x3143('0x46')](db[_0x3143('0x40')]['rawAttributes']);_0x50abdb[_0x3143('0x33')]=_['keys'](_0x42833a[_0x3143('0x33')]);_0x50abdb[_0x3143('0x34')]=_[_0x3143('0x35')](_0x50abdb[_0x3143('0x31')],_0x50abdb[_0x3143('0x33')]);_0x1ac6b4[_0x3143('0x37')]=_[_0x3143('0x35')](_0x50abdb[_0x3143('0x31')],qs[_0x3143('0x36')](_0x42833a[_0x3143('0x33')][_0x3143('0x36')]));_0x1ac6b4[_0x3143('0x37')]=_0x1ac6b4[_0x3143('0x37')][_0x3143('0x38')]?_0x1ac6b4[_0x3143('0x37')]:_0x50abdb['model'];if(_0x42833a[_0x3143('0x33')][_0x3143('0x47')]){_0x1ac6b4[_0x3143('0x41')]=[{'all':!![]}];}_0x1ac6b4=_[_0x3143('0x3e')]({},_0x1ac6b4,_0x42833a[_0x3143('0x3f')]);return db['Interval']['find'](_0x1ac6b4)[_0x3143('0x25')](handleEntityNotFound(_0x4fbc17,null))[_0x3143('0x25')](respondWithResult(_0x4fbc17,null))['catch'](handleError(_0x4fbc17,null));};exports[_0x3143('0x48')]=function(_0x5c15bf,_0x11cd31){return db[_0x3143('0x40')]['create'](_0x5c15bf[_0x3143('0x49')],{})[_0x3143('0x25')](function(_0x48fbd2){var _0x478348=_0x5c15bf[_0x3143('0x4a')][_0x3143('0x27')]({'plain':!![]});if(!_0x478348)throw new Error(_0x3143('0x4b'));if(_0x478348[_0x3143('0x4c')]===_0x3143('0x4a')){var _0x338490=_0x48fbd2[_0x3143('0x27')]({'plain':!![]});var _0x5d956b=_0x3143('0x28');return db[_0x3143('0x4d')][_0x3143('0x4e')]({'where':{'name':_0x5d956b,'userProfileId':_0x478348[_0x3143('0x4f')]},'raw':!![]})[_0x3143('0x25')](function(_0x2ecb25){if(_0x2ecb25&&_0x2ecb25[_0x3143('0x50')]===0x0){return db[_0x3143('0x29')][_0x3143('0x48')]({'name':_0x338490['name'],'resourceId':_0x338490['id'],'type':_0x2ecb25[_0x3143('0x2b')],'sectionId':_0x2ecb25['id']},{})[_0x3143('0x25')](function(){return _0x48fbd2;});}else{return _0x48fbd2;}})[_0x3143('0x51')](function(_0x137dd1){logger['error'](_0x3143('0x52'),_0x137dd1);throw _0x137dd1;});}return _0x48fbd2;})[_0x3143('0x25')](respondWithResult(_0x11cd31,0xc9))[_0x3143('0x51')](handleError(_0x11cd31,null));};exports[_0x3143('0x24')]=function(_0x44c8a1,_0x218b8a){if(_0x44c8a1[_0x3143('0x49')]['id']){delete _0x44c8a1['body']['id'];}return db['Interval'][_0x3143('0x4e')]({'where':{'id':_0x44c8a1[_0x3143('0x45')]['id']}})[_0x3143('0x25')](handleEntityNotFound(_0x218b8a,null))[_0x3143('0x25')](saveUpdates(_0x44c8a1[_0x3143('0x49')],null))[_0x3143('0x25')](respondWithResult(_0x218b8a,null))[_0x3143('0x51')](handleError(_0x218b8a,null));};exports[_0x3143('0x26')]=function(_0x6eb7b8,_0x140634){return db[_0x3143('0x40')]['find']({'where':{'id':_0x6eb7b8[_0x3143('0x45')]['id']}})[_0x3143('0x25')](handleEntityNotFound(_0x140634,null))[_0x3143('0x25')](removeEntity(_0x140634,null))[_0x3143('0x51')](handleError(_0x140634,null));};exports[_0x3143('0x53')]=function(_0x576b90,_0x25d34e,_0x299155){if(_0x576b90[_0x3143('0x49')]['id']){delete _0x576b90[_0x3143('0x49')]['id'];}return db['Interval'][_0x3143('0x4e')]({'where':{'id':_0x576b90[_0x3143('0x45')]['id']}})['then'](handleEntityNotFound(_0x25d34e,null))['then'](function(_0x480499){if(_0x480499){_0x576b90[_0x3143('0x49')][_0x3143('0x54')]=_0x480499['id'];return db[_0x3143('0x40')]['create'](_0x576b90[_0x3143('0x49')]);}})[_0x3143('0x25')](respondWithResult(_0x25d34e,null))[_0x3143('0x51')](handleError(_0x25d34e,null));};exports[_0x3143('0x55')]=function(_0x5cd456,_0x3c1774,_0x44972d){var _0x433b19={};var _0x409c10={};var _0x4f7cc8;var _0x3b2e62;return db[_0x3143('0x40')][_0x3143('0x56')]({'where':{'id':_0x5cd456[_0x3143('0x45')]['id']}})['then'](handleEntityNotFound(_0x3c1774,null))['then'](function(_0xb0d4f4){if(_0xb0d4f4){_0x4f7cc8=_0xb0d4f4;_0x409c10[_0x3143('0x31')]=_[_0x3143('0x46')](db['Interval'][_0x3143('0x57')]);_0x409c10[_0x3143('0x33')]=_[_0x3143('0x46')](_0x5cd456[_0x3143('0x33')]);_0x409c10['filters']=_[_0x3143('0x35')](_0x409c10[_0x3143('0x31')],_0x409c10['query']);_0x433b19[_0x3143('0x37')]=_[_0x3143('0x35')](_0x409c10[_0x3143('0x31')],qs[_0x3143('0x36')](_0x5cd456['query'][_0x3143('0x36')]));_0x433b19[_0x3143('0x37')]=_0x433b19[_0x3143('0x37')][_0x3143('0x38')]?_0x433b19[_0x3143('0x37')]:_0x409c10[_0x3143('0x31')];_0x433b19[_0x3143('0x58')]=qs[_0x3143('0x59')](_0x5cd456['query'][_0x3143('0x59')]);_0x433b19[_0x3143('0x3d')]=qs['filters'](_[_0x3143('0x3b')](_0x5cd456['query'],_0x409c10[_0x3143('0x34')]));if(_0x5cd456[_0x3143('0x33')][_0x3143('0x3c')]){_0x433b19[_0x3143('0x3d')]=_['merge'](_0x433b19[_0x3143('0x3d')],{'$or':_[_0x3143('0x32')](_0x433b19[_0x3143('0x37')],function(_0x22615f){var _0x3e7a25={};_0x3e7a25[_0x22615f]={'$like':'%'+_0x5cd456['query'][_0x3143('0x3c')]+'%'};return _0x3e7a25;})});}_0x433b19=_['merge']({},_0x433b19,_0x5cd456[_0x3143('0x3f')]);return _0x4f7cc8['getIntervals'](_0x433b19);}})[_0x3143('0x25')](function(_0x38a729){if(_0x38a729){_0x3b2e62=_0x38a729['length'];if(!_0x5cd456[_0x3143('0x33')][_0x3143('0x39')](_0x3143('0x3a'))){_0x433b19['limit']=qs[_0x3143('0x1f')](_0x5cd456['query'][_0x3143('0x1f')]);_0x433b19[_0x3143('0x1c')]=qs[_0x3143('0x1c')](_0x5cd456[_0x3143('0x33')][_0x3143('0x1c')]);}return _0x4f7cc8[_0x3143('0x55')](_0x433b19);}})[_0x3143('0x25')](function(_0x374664){if(_0x374664){return _0x374664?{'count':_0x3b2e62,'rows':_0x374664}:null;}})['then'](respondWithResult(_0x3c1774,null))['catch'](handleError(_0x3c1774,null));};exports[_0x3143('0x5a')]=function(_0x11b451,_0x2be9b8,_0x118f1b){return db[_0x3143('0x40')][_0x3143('0x56')]({'where':{'id':_0x11b451[_0x3143('0x45')]['id']}})[_0x3143('0x25')](handleEntityNotFound(_0x2be9b8,null))[_0x3143('0x25')](function(_0x152c03){if(_0x152c03){return db['sequelize'][_0x3143('0x5b')](function(_0x2e0c68){return db[_0x3143('0x40')][_0x3143('0x26')]({'where':{'IntervalId':_0x11b451[_0x3143('0x45')]['id']},'transaction':_0x2e0c68})['then'](function(_0x4d5f4a){var _0xed2a01=_[_0x3143('0x32')](_0x11b451['body'],function(_0x385606){delete _0x385606['id'];_0x385606[_0x3143('0x54')]=_0x11b451[_0x3143('0x45')]['id'];return _0x385606;});return db[_0x3143('0x40')][_0x3143('0x5c')](_0xed2a01,{'transaction':_0x2e0c68});});})[_0x3143('0x25')](function(){return db[_0x3143('0x40')][_0x3143('0x42')]({'where':{'IntervalId':_0x11b451[_0x3143('0x45')]['id']}});});}})[_0x3143('0x25')](respondWithResult(_0x2be9b8,null))['catch'](handleError(_0x2be9b8,null));};
\ No newline at end of file
index 793e60d..20e2c76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa199=['api','request-promise','rimraf','../../config/environment','../../components/extensions/rewrite','exports','rewrite','lodash','../../config/logger'];(function(_0x1be853,_0x26a527){var _0x572072=function(_0x4eb8c5){while(--_0x4eb8c5){_0x1be853['push'](_0x1be853['shift']());}};_0x572072(++_0x26a527);}(_0xa199,0xfa));var _0x9a19=function(_0x3130d5,_0x2b518a){_0x3130d5=_0x3130d5-0x0;var _0x4d5df1=_0xa199[_0x3130d5];return _0x4d5df1;};'use strict';var _=require(_0x9a19('0x0'));var util=require('util');var logger=require(_0x9a19('0x1'))(_0x9a19('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9a19('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9a19('0x4'));var config=require(_0x9a19('0x5'));var attributes=require('./interval.attributes');var extensions=require(_0x9a19('0x6'));module[_0x9a19('0x7')]=function(_0x5d16b7,_0x287976){return _0x5d16b7['define']('Interval',attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2ccf29,_0x2ca822){extensions[_0x9a19('0x8')](_0x5d16b7,_0x2ccf29);},'afterBulkCreate':function(_0x36993a,_0x2dd0cf,_0x226887){_0x226887();extensions[_0x9a19('0x8')](_0x5d16b7,_0x36993a[0x0]);},'afterUpdate':function(_0x357c98,_0x2f8100){extensions[_0x9a19('0x8')](_0x5d16b7,_0x357c98);},'afterDestroy':function(_0x471a58,_0x25bf2b){extensions[_0x9a19('0x8')](_0x5d16b7,_0x471a58);}}});};
\ No newline at end of file
+var _0xaffc=['Interval','rewrite','util','../../config/logger','api','bluebird','path','rimraf','../../components/extensions/rewrite','exports','define'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xaffc,0xc8));var _0xcaff=function(_0xddf71c,_0x11366d){_0xddf71c=_0xddf71c-0x0;var _0x889654=_0xaffc[_0xddf71c];return _0x889654;};'use strict';var _=require('lodash');var util=require(_0xcaff('0x0'));var logger=require(_0xcaff('0x1'))(_0xcaff('0x2'));var moment=require('moment');var BPromise=require(_0xcaff('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcaff('0x4'));var rimraf=require(_0xcaff('0x5'));var config=require('../../config/environment');var attributes=require('./interval.attributes');var extensions=require(_0xcaff('0x6'));module[_0xcaff('0x7')]=function(_0x484735,_0x4e6779){return _0x484735[_0xcaff('0x8')](_0xcaff('0x9'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x499230,_0x4330b0){extensions['rewrite'](_0x484735,_0x499230);},'afterBulkCreate':function(_0x3bb20b,_0xec7017,_0x47b7c9){_0x47b7c9();extensions[_0xcaff('0xa')](_0x484735,_0x3bb20b[0x0]);},'afterUpdate':function(_0x27ed5e,_0x5ab5e7){extensions[_0xcaff('0xa')](_0x484735,_0x27ed5e);},'afterDestroy':function(_0x26e8fc,_0x5cd9de){extensions[_0xcaff('0xa')](_0x484735,_0x26e8fc);}}});};
\ No newline at end of file
index 1f081da..9f9d90f 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(_0x3b3210,_0x25e8ed){var _0x5b5484=function(_0x417858){while(--_0x417858){_0x3b3210['push'](_0x3b3210['shift']());}};_0x5b5484(++_0x25e8ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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(_0x52e0ee,_0x52f7c1){var _0x32534c=function(_0x535d65){while(--_0x535d65){_0x52e0ee['push'](_0x52e0ee['shift']());}};_0x32534c(++_0x52f7c1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}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 efb57db..f212944 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x206502,_0x55e258){var _0x2d62c8=function(_0xdf645){while(--_0xdf645){_0x206502['push'](_0x206502['shift']());}};_0x2d62c8(++_0x55e258);}(_0x5f2f,0x73));var _0xf5f2=function(_0xe6113b,_0x105e0e){_0xe6113b=_0xe6113b-0x0;var _0x251eed=_0x5f2f[_0xe6113b];return _0x251eed;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router;
\ No newline at end of file
+var _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x3d78d7,_0x44acea){var _0x4b6784=function(_0x284157){while(--_0x284157){_0x3d78d7['push'](_0x3d78d7['shift']());}};_0x4b6784(++_0x44acea);}(_0x5f66,0x1a0));var _0x65f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5f66[_0x164eca];return _0x2ce562;};'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')]);module[_0x65f6('0x5')]=router;
\ No newline at end of file
index 536b425..665d6c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9dc7=['write','openIssue','body','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','description','stringify','issuetype','Bug','customfield_11500','email','customfield_11501','oldToken','fields','customfield_11502','newToken','customfield_11503','name','reason','customfield_10102','POST','application/json','toString','request','setEncoding','utf8','data','end','status','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9dc7,0xbb));var _0x79dc=function(_0x106586,_0x1ef8fe){_0x106586=_0x106586-0x0;var _0x4ae99e=_0x9dc7[_0x106586];return _0x4ae99e;};'use strict';var BPromise=require(_0x79dc('0x0'));var https=require(_0x79dc('0x1'));var logger=require(_0x79dc('0x2'))(_0x79dc('0x3'));var USERNAME=_0x79dc('0x4');var PASSWORD=_0x79dc('0x5');function openIssue(_0x51937a,_0x4b7688){var _0x2c231a={'fields':{'project':{'key':_0x51937a[_0x79dc('0x6')]||_0x79dc('0x7')},'summary':(_0x51937a[_0x79dc('0x8')]||'Report')+'\x20from\x20'+_0x51937a['ip'],'description':_0x51937a[_0x79dc('0x9')]||JSON[_0x79dc('0xa')](_0x51937a),'issuetype':{'name':_0x51937a[_0x79dc('0xb')]||_0x79dc('0xc')}}};_0x2c231a['fields'][_0x79dc('0xd')]=_0x51937a[_0x79dc('0xe')];_0x2c231a['fields'][_0x79dc('0xf')]=_0x51937a[_0x79dc('0x10')];_0x2c231a[_0x79dc('0x11')][_0x79dc('0x12')]=_0x51937a[_0x79dc('0x13')];_0x2c231a[_0x79dc('0x11')][_0x79dc('0x14')]=_0x51937a[_0x79dc('0x15')];_0x2c231a[_0x79dc('0x11')]['customfield_11504']=_0x51937a[_0x79dc('0x16')];_0x2c231a['fields'][_0x79dc('0x17')]=_0x51937a['ip'];var _0x4ec937={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':_0x79dc('0x18'),'timeout':0x4e20,'headers':{'Content-Type':_0x79dc('0x19'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x79dc('0x1a')]('base64')}};var _0x2015b2=JSON[_0x79dc('0xa')](_0x2c231a);var _0x4b7e9b=https[_0x79dc('0x1b')](_0x4ec937,function(_0x188821){_0x188821[_0x79dc('0x1c')](_0x79dc('0x1d'));var _0x2937ff='';_0x188821['on'](_0x79dc('0x1e'),function(_0xcdc598){_0x2937ff+=_0xcdc598;});_0x188821['on'](_0x79dc('0x1f'),function(){if(_0x4b7688){return _0x4b7688[_0x79dc('0x20')](_0x188821['statusCode'])[_0x79dc('0x21')](JSON[_0x79dc('0x22')](_0x2937ff));}});});_0x4b7e9b['on'](_0x79dc('0x23'),function(_0xd5064d){if(_0x4b7688){return _0x4b7688['status'](0x1f4)[_0x79dc('0x21')]({'errors':[{'message':_0x79dc('0x24'),'type':_0x79dc('0x25')}]});}});_0x4b7e9b[_0x79dc('0x26')](_0x2015b2);_0x4b7e9b['end']();}exports[_0x79dc('0x27')]=openIssue;exports['send']=function(_0x409358,_0x2d77df){_0x409358[_0x79dc('0x28')]['ip']=_0x409358['headers'][_0x79dc('0x29')]||_0x409358[_0x79dc('0x2a')][_0x79dc('0x2b')]||_0x409358[_0x79dc('0x2c')][_0x79dc('0x2b')]||_0x409358['connection'][_0x79dc('0x2c')][_0x79dc('0x2b')];return openIssue(_0x409358[_0x79dc('0x28')],_0x2d77df);};
\ No newline at end of file
+var _0xcfcf=['track.xcallymotion.com','/rest/api/2/issue','POST','Basic\x20','toString','base64','request','setEncoding','utf8','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','end','openIssue','send','headers','x-forwarded-for','connection','socket','remoteAddress','bluebird','https','support','key','MOTGUI','Report','\x20from\x20','description','stringify','issuetype','fields','customfield_11501','oldToken','customfield_11502','newToken','name','customfield_11504','reason','customfield_10102'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcfcf,0x13d));var _0xfcfc=function(_0x26d386,_0x1660c0){_0x26d386=_0x26d386-0x0;var _0x4ef9a8=_0xcfcf[_0x26d386];return _0x4ef9a8;};'use strict';var BPromise=require(_0xfcfc('0x0'));var https=require(_0xfcfc('0x1'));var logger=require('../../config/logger')('api');var USERNAME=_0xfcfc('0x2');var PASSWORD='3eAmWpBVP0';function openIssue(_0x276d75,_0x13051f){var _0x2f255e={'fields':{'project':{'key':_0x276d75[_0xfcfc('0x3')]||_0xfcfc('0x4')},'summary':(_0x276d75['summary']||_0xfcfc('0x5'))+_0xfcfc('0x6')+_0x276d75['ip'],'description':_0x276d75[_0xfcfc('0x7')]||JSON[_0xfcfc('0x8')](_0x276d75),'issuetype':{'name':_0x276d75[_0xfcfc('0x9')]||'Bug'}}};_0x2f255e[_0xfcfc('0xa')]['customfield_11500']=_0x276d75['email'];_0x2f255e[_0xfcfc('0xa')][_0xfcfc('0xb')]=_0x276d75[_0xfcfc('0xc')];_0x2f255e[_0xfcfc('0xa')][_0xfcfc('0xd')]=_0x276d75[_0xfcfc('0xe')];_0x2f255e[_0xfcfc('0xa')]['customfield_11503']=_0x276d75[_0xfcfc('0xf')];_0x2f255e[_0xfcfc('0xa')][_0xfcfc('0x10')]=_0x276d75[_0xfcfc('0x11')];_0x2f255e[_0xfcfc('0xa')][_0xfcfc('0x12')]=_0x276d75['ip'];var _0x44771c={'host':_0xfcfc('0x13'),'port':0x1bb,'path':_0xfcfc('0x14'),'method':_0xfcfc('0x15'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0xfcfc('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0xfcfc('0x17')](_0xfcfc('0x18'))}};var _0x34658a=JSON[_0xfcfc('0x8')](_0x2f255e);var _0x1d1a6f=https[_0xfcfc('0x19')](_0x44771c,function(_0x48e460){_0x48e460[_0xfcfc('0x1a')](_0xfcfc('0x1b'));var _0x9f8453='';_0x48e460['on']('data',function(_0x2b9164){_0x9f8453+=_0x2b9164;});_0x48e460['on']('end',function(){if(_0x13051f){return _0x13051f[_0xfcfc('0x1c')](_0x48e460[_0xfcfc('0x1d')])[_0xfcfc('0x1e')](JSON[_0xfcfc('0x1f')](_0x9f8453));}});});_0x1d1a6f['on'](_0xfcfc('0x20'),function(_0x53a6bd){if(_0x13051f){return _0x13051f[_0xfcfc('0x1c')](0x1f4)[_0xfcfc('0x1e')]({'errors':[{'message':_0xfcfc('0x21'),'type':'api.jira'}]});}});_0x1d1a6f['write'](_0x34658a);_0x1d1a6f[_0xfcfc('0x22')]();}exports[_0xfcfc('0x23')]=openIssue;exports[_0xfcfc('0x24')]=function(_0x509dcc,_0x344479){_0x509dcc['body']['ip']=_0x509dcc[_0xfcfc('0x25')][_0xfcfc('0x26')]||_0x509dcc[_0xfcfc('0x27')]['remoteAddress']||_0x509dcc[_0xfcfc('0x28')][_0xfcfc('0x29')]||_0x509dcc[_0xfcfc('0x27')][_0xfcfc('0x28')][_0xfcfc('0x29')];return openIssue(_0x509dcc['body'],_0x344479);};
\ No newline at end of file
index 3430975..6bc628a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4e6=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x786db4,_0x276f24){var _0x4a6a73=function(_0x3fcb98){while(--_0x3fcb98){_0x786db4['push'](_0x786db4['shift']());}};_0x4a6a73(++_0x276f24);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x16a637,_0x5eb627){_0x16a637=_0x16a637-0x0;var _0x25126d=_0xb4e6[_0x16a637];return _0x25126d;};'use strict';var multer=require(_0x6b4e('0x0'));var util=require('util');var path=require(_0x6b4e('0x1'));var timeout=require(_0x6b4e('0x2'));var express=require(_0x6b4e('0x3'));var router=express[_0x6b4e('0x4')]();var fs_extra=require(_0x6b4e('0x5'));var auth=require(_0x6b4e('0x6'));var interaction=require(_0x6b4e('0x7'));var config=require('../../config/environment');var controller=require(_0x6b4e('0x8'));router[_0x6b4e('0x9')]('/',auth[_0x6b4e('0xa')](),controller['index']);router[_0x6b4e('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x6b4e('0xb')]);router['get']('/:id',auth[_0x6b4e('0xa')](),controller[_0x6b4e('0xc')]);router[_0x6b4e('0xd')]('/',auth[_0x6b4e('0xa')](),controller[_0x6b4e('0xe')]);router[_0x6b4e('0xf')](_0x6b4e('0x10'),auth['isAuthenticated'](),controller[_0x6b4e('0x11')]);router[_0x6b4e('0x12')]('/:id',auth[_0x6b4e('0xa')](),controller[_0x6b4e('0x13')]);module[_0x6b4e('0x14')]=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','./jscriptyAnswerReport.controller','get','index','/describe','show','post'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var 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 90af0e5..3613db9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x7a54,0x106));var _0x47a5=function(_0x530efe,_0x29bea7){_0x530efe=_0x530efe-0x0;var _0x10cc27=_0x7a54[_0x530efe];return _0x10cc27;};'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(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x7a54,0x106));var _0x47a5=function(_0x5ad043,_0x3adef8){_0x5ad043=_0x5ad043-0x0;var _0x5033bb=_0x7a54[_0x5ad043];return _0x5033bb;};'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 fa841a5..b0d29a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfe8=['mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','reject','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','pick','filter','where','VIRTUAL','merge','options','includeAll','include','JscriptyAnswerReport','findAll','rows','catch','show','params','find','create','body','destroy','describe','rimraf','fast-json-patch','request-promise'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0xbfe8,0x1b9));var _0x8bfe=function(_0x5d22ed,_0x46b7f8){_0x5d22ed=_0x5d22ed-0x0;var _0x19fdd4=_0xbfe8[_0x5d22ed];return _0x19fdd4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8bfe('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8bfe('0x1'));var rp=require(_0x8bfe('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8bfe('0x3'));var util=require(_0x8bfe('0x4'));var path=require('path');var sox=require(_0x8bfe('0x5'));var csv=require(_0x8bfe('0x6'));var ejs=require(_0x8bfe('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8bfe('0x8'));var squel=require(_0x8bfe('0x9'));var crypto=require(_0x8bfe('0xa'));var jsforce=require(_0x8bfe('0xb'));var deskjs=require(_0x8bfe('0xc'));var toCsv=require(_0x8bfe('0x6'));var querystring=require(_0x8bfe('0xd'));var Papa=require(_0x8bfe('0xe'));var Redis=require(_0x8bfe('0xf'));var authService=require(_0x8bfe('0x10'));var qs=require(_0x8bfe('0x11'));var as=require(_0x8bfe('0x12'));var hardwareService=require(_0x8bfe('0x13'));var logger=require(_0x8bfe('0x14'))(_0x8bfe('0x15'));var utils=require('../../config/utils');var config=require(_0x8bfe('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8bfe('0x17'))['db'];function respondWithStatusCode(_0x2f479d,_0x22a131){_0x22a131=_0x22a131||0xcc;return function(_0x5ba48c){if(_0x5ba48c){return _0x2f479d['sendStatus'](_0x22a131);}return _0x2f479d[_0x8bfe('0x18')](_0x22a131)[_0x8bfe('0x19')]();};}function respondWithResult(_0x22737f,_0x36fd25){_0x36fd25=_0x36fd25||0xc8;return function(_0x46c8e3){if(_0x46c8e3){return _0x22737f['status'](_0x36fd25)[_0x8bfe('0x1a')](_0x46c8e3);}};}function respondWithFilteredResult(_0x5520d7,_0x55914b){return function(_0x778f01){if(_0x778f01){var _0xe57cb1=typeof _0x55914b[_0x8bfe('0x1b')]==='undefined'&&typeof _0x55914b['limit']===_0x8bfe('0x1c');var _0x5019ba=_0x778f01['count'];var _0x2e7c29=_0xe57cb1?0x0:_0x55914b[_0x8bfe('0x1b')];var _0x5d8bf1=_0xe57cb1?_0x778f01[_0x8bfe('0x1d')]:_0x55914b[_0x8bfe('0x1b')]+_0x55914b[_0x8bfe('0x1e')];var _0x3b0837;if(_0x5d8bf1>=_0x5019ba){_0x5d8bf1=_0x5019ba;_0x3b0837=0xc8;}else{_0x3b0837=0xce;}_0x5520d7['status'](_0x3b0837);return _0x5520d7[_0x8bfe('0x1f')]('Content-Range',_0x2e7c29+'-'+_0x5d8bf1+'/'+_0x5019ba)[_0x8bfe('0x1a')](_0x778f01);}return null;};}function patchUpdates(_0x3f8050){return function(_0x3c6e7b){try{jsonpatch['apply'](_0x3c6e7b,_0x3f8050,!![]);}catch(_0x55af8c){return BPromise[_0x8bfe('0x20')](_0x55af8c);}return _0x3c6e7b['save']();};}function saveUpdates(_0x55f5bc,_0xef5e81){return function(_0x5397fb){if(_0x5397fb){return _0x5397fb[_0x8bfe('0x21')](_0x55f5bc)['then'](function(_0x34043a){return _0x34043a;});}return null;};}function removeEntity(_0x19058e,_0x42a93f){return function(_0x260dd9){if(_0x260dd9){return _0x260dd9['destroy']()[_0x8bfe('0x22')](function(){_0x19058e[_0x8bfe('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f73d0,_0x1789f7){return function(_0x46526f){if(!_0x46526f){_0x2f73d0[_0x8bfe('0x23')](0x194);}return _0x46526f;};}function handleError(_0x2dc8d5,_0x91271f){_0x91271f=_0x91271f||0x1f4;return function(_0x4fcb3a){logger[_0x8bfe('0x24')](_0x4fcb3a[_0x8bfe('0x25')]);if(_0x4fcb3a[_0x8bfe('0x26')]){delete _0x4fcb3a[_0x8bfe('0x26')];}_0x2dc8d5[_0x8bfe('0x18')](_0x91271f)[_0x8bfe('0x27')](_0x4fcb3a);};}exports[_0x8bfe('0x28')]=function(_0x2cbfb3,_0x15fccc){var _0x2b47c6={},_0x3c6a3c={},_0x597651={'count':0x0,'rows':[]};var _0xdf4c3f=_[_0x8bfe('0x29')](db['JscriptyAnswerReport'][_0x8bfe('0x2a')],function(_0x2e86ee){return{'name':_0x2e86ee[_0x8bfe('0x2b')],'type':_0x2e86ee['type'][_0x8bfe('0x2c')]};});_0x3c6a3c[_0x8bfe('0x2d')]=_['map'](_0xdf4c3f,'name');_0x3c6a3c[_0x8bfe('0x2e')]=_[_0x8bfe('0x2f')](_0x2cbfb3[_0x8bfe('0x2e')]);_0x3c6a3c[_0x8bfe('0x30')]=_[_0x8bfe('0x31')](_0x3c6a3c[_0x8bfe('0x2d')],_0x3c6a3c[_0x8bfe('0x2e')]);_0x2b47c6[_0x8bfe('0x32')]=_[_0x8bfe('0x31')](_0x3c6a3c[_0x8bfe('0x2d')],qs['fields'](_0x2cbfb3['query'][_0x8bfe('0x33')]));_0x2b47c6[_0x8bfe('0x32')]=_0x2b47c6[_0x8bfe('0x32')][_0x8bfe('0x34')]?_0x2b47c6[_0x8bfe('0x32')]:_0x3c6a3c[_0x8bfe('0x2d')];if(!_0x2cbfb3[_0x8bfe('0x2e')]['hasOwnProperty'](_0x8bfe('0x35'))){_0x2b47c6[_0x8bfe('0x1e')]=qs['limit'](_0x2cbfb3[_0x8bfe('0x2e')][_0x8bfe('0x1e')]);_0x2b47c6[_0x8bfe('0x1b')]=qs[_0x8bfe('0x1b')](_0x2cbfb3[_0x8bfe('0x2e')]['offset']);}_0x2b47c6[_0x8bfe('0x36')]=qs['sort'](_0x2cbfb3['query']['sort']);_0x2b47c6['where']=qs[_0x8bfe('0x30')](_[_0x8bfe('0x37')](_0x2cbfb3[_0x8bfe('0x2e')],_0x3c6a3c[_0x8bfe('0x30')]),_0xdf4c3f);if(_0x2cbfb3[_0x8bfe('0x2e')][_0x8bfe('0x38')]){_0x2b47c6[_0x8bfe('0x39')]=_['merge'](_0x2b47c6[_0x8bfe('0x39')],{'$or':_['map'](_0xdf4c3f,function(_0x5c5801){if(_0x5c5801['type']!==_0x8bfe('0x3a')){var _0x65a1a3={};_0x65a1a3[_0x5c5801[_0x8bfe('0x26')]]={'$like':'%'+_0x2cbfb3[_0x8bfe('0x2e')][_0x8bfe('0x38')]+'%'};return _0x65a1a3;}})});}_0x2b47c6=_[_0x8bfe('0x3b')]({},_0x2b47c6,_0x2cbfb3[_0x8bfe('0x3c')]);var _0x20b085={'where':_0x2b47c6['where']};return db['JscriptyAnswerReport'][_0x8bfe('0x1d')](_0x20b085)[_0x8bfe('0x22')](function(_0x36d23c){_0x597651[_0x8bfe('0x1d')]=_0x36d23c;if(_0x2cbfb3[_0x8bfe('0x2e')][_0x8bfe('0x3d')]){_0x2b47c6[_0x8bfe('0x3e')]=[{'all':!![]}];}return db[_0x8bfe('0x3f')][_0x8bfe('0x40')](_0x2b47c6);})['then'](function(_0x62a6e2){_0x597651[_0x8bfe('0x41')]=_0x62a6e2;return _0x597651;})[_0x8bfe('0x22')](respondWithFilteredResult(_0x15fccc,_0x2b47c6))[_0x8bfe('0x42')](handleError(_0x15fccc,null));};exports[_0x8bfe('0x43')]=function(_0x234edc,_0x403456){var _0x55814c={'raw':!![],'where':{'id':_0x234edc[_0x8bfe('0x44')]['id']}},_0x25d26f={};_0x25d26f['model']=_[_0x8bfe('0x2f')](db['JscriptyAnswerReport']['rawAttributes']);_0x25d26f[_0x8bfe('0x2e')]=_[_0x8bfe('0x2f')](_0x234edc[_0x8bfe('0x2e')]);_0x25d26f['filters']=_[_0x8bfe('0x31')](_0x25d26f['model'],_0x25d26f[_0x8bfe('0x2e')]);_0x55814c[_0x8bfe('0x32')]=_['intersection'](_0x25d26f[_0x8bfe('0x2d')],qs[_0x8bfe('0x33')](_0x234edc[_0x8bfe('0x2e')][_0x8bfe('0x33')]));_0x55814c['attributes']=_0x55814c[_0x8bfe('0x32')][_0x8bfe('0x34')]?_0x55814c[_0x8bfe('0x32')]:_0x25d26f['model'];if(_0x234edc['query'][_0x8bfe('0x3d')]){_0x55814c[_0x8bfe('0x3e')]=[{'all':!![]}];}_0x55814c=_[_0x8bfe('0x3b')]({},_0x55814c,_0x234edc[_0x8bfe('0x3c')]);return db[_0x8bfe('0x3f')][_0x8bfe('0x45')](_0x55814c)[_0x8bfe('0x22')](handleEntityNotFound(_0x403456,null))[_0x8bfe('0x22')](respondWithResult(_0x403456,null))['catch'](handleError(_0x403456,null));};exports[_0x8bfe('0x46')]=function(_0x2af8fa,_0x4e6949){return db['JscriptyAnswerReport'][_0x8bfe('0x46')](_0x2af8fa[_0x8bfe('0x47')],{})[_0x8bfe('0x22')](respondWithResult(_0x4e6949,0xc9))['catch'](handleError(_0x4e6949,null));};exports[_0x8bfe('0x21')]=function(_0x3c4086,_0x55ad6e){if(_0x3c4086[_0x8bfe('0x47')]['id']){delete _0x3c4086[_0x8bfe('0x47')]['id'];}return db[_0x8bfe('0x3f')][_0x8bfe('0x45')]({'where':{'id':_0x3c4086[_0x8bfe('0x44')]['id']}})[_0x8bfe('0x22')](handleEntityNotFound(_0x55ad6e,null))['then'](saveUpdates(_0x3c4086['body'],null))['then'](respondWithResult(_0x55ad6e,null))['catch'](handleError(_0x55ad6e,null));};exports[_0x8bfe('0x48')]=function(_0x2b84a3,_0x36e938){return db[_0x8bfe('0x3f')][_0x8bfe('0x45')]({'where':{'id':_0x2b84a3['params']['id']}})[_0x8bfe('0x22')](handleEntityNotFound(_0x36e938,null))[_0x8bfe('0x22')](removeEntity(_0x36e938,null))[_0x8bfe('0x42')](handleError(_0x36e938,null));};exports[_0x8bfe('0x49')]=function(_0x3c6cbc,_0x43a0c5){return db['JscriptyAnswerReport'][_0x8bfe('0x49')]()[_0x8bfe('0x22')](respondWithResult(_0x43a0c5,null))['catch'](handleError(_0x43a0c5,null));};
\ No newline at end of file
+var _0x7da7=['count','limit','json','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','JscriptyAnswerReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7da7,0x10d));var _0x77da=function(_0x4653f7,_0x3d3ae3){_0x4653f7=_0x4653f7-0x0;var _0x5454da=_0x7da7[_0x4653f7];return _0x5454da;};'use strict';var emlformat=require(_0x77da('0x0'));var rimraf=require(_0x77da('0x1'));var zipdir=require(_0x77da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x77da('0x3'));var BPromise=require(_0x77da('0x4'));var Mustache=require('mustache');var util=require(_0x77da('0x5'));var path=require(_0x77da('0x6'));var sox=require('sox');var csv=require(_0x77da('0x7'));var ejs=require(_0x77da('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x7'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var Redis=require(_0x77da('0xe'));var authService=require(_0x77da('0xf'));var qs=require(_0x77da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77da('0x11'));var logger=require(_0x77da('0x12'))(_0x77da('0x13'));var utils=require(_0x77da('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x77da('0x15'));var db=require(_0x77da('0x16'))['db'];function respondWithStatusCode(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xcc;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0x17')](_0x5d6e2f);}return _0x2acc65[_0x77da('0x18')](_0x5d6e2f)['end']();};}function respondWithResult(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0xc8;return function(_0x355719){if(_0x355719){return _0x3b0ff2[_0x77da('0x18')](_0x369df0)['json'](_0x355719);}};}function respondWithFilteredResult(_0x2172d0,_0x4e130c){return function(_0x29cd7b){if(_0x29cd7b){var _0x366443=typeof _0x4e130c[_0x77da('0x19')]===_0x77da('0x1a')&&typeof _0x4e130c['limit']==='undefined';var _0x514016=_0x29cd7b['count'];var _0x103e46=_0x366443?0x0:_0x4e130c[_0x77da('0x19')];var _0x289887=_0x366443?_0x29cd7b[_0x77da('0x1b')]:_0x4e130c[_0x77da('0x19')]+_0x4e130c[_0x77da('0x1c')];var _0x1d325c;if(_0x289887>=_0x514016){_0x289887=_0x514016;_0x1d325c=0xc8;}else{_0x1d325c=0xce;}_0x2172d0[_0x77da('0x18')](_0x1d325c);return _0x2172d0['set']('Content-Range',_0x103e46+'-'+_0x289887+'/'+_0x514016)[_0x77da('0x1d')](_0x29cd7b);}return null;};}function patchUpdates(_0x4d1512){return function(_0x507979){try{jsonpatch[_0x77da('0x1e')](_0x507979,_0x4d1512,!![]);}catch(_0x304a2b){return BPromise[_0x77da('0x1f')](_0x304a2b);}return _0x507979['save']();};}function saveUpdates(_0x58270c,_0x3e6cfe){return function(_0x58f6c1){if(_0x58f6c1){return _0x58f6c1[_0x77da('0x20')](_0x58270c)[_0x77da('0x21')](function(_0xc52f0e){return _0xc52f0e;});}return null;};}function removeEntity(_0x27b6c7,_0x10399a){return function(_0x270318){if(_0x270318){return _0x270318[_0x77da('0x22')]()['then'](function(){_0x27b6c7['status'](0xcc)[_0x77da('0x23')]();});}};}function handleEntityNotFound(_0x2d009f,_0x835167){return function(_0xbd06b7){if(!_0xbd06b7){_0x2d009f['sendStatus'](0x194);}return _0xbd06b7;};}function handleError(_0x42240b,_0x167240){_0x167240=_0x167240||0x1f4;return function(_0x470c9f){logger[_0x77da('0x24')](_0x470c9f[_0x77da('0x25')]);if(_0x470c9f['name']){delete _0x470c9f[_0x77da('0x26')];}_0x42240b[_0x77da('0x18')](_0x167240)[_0x77da('0x27')](_0x470c9f);};}exports[_0x77da('0x28')]=function(_0x496ecd,_0x5b4638){var _0x4d395a={},_0x2258e9={},_0x30456a={'count':0x0,'rows':[]};var _0x410d09=_[_0x77da('0x29')](db[_0x77da('0x2a')]['rawAttributes'],function(_0x350b4e){return{'name':_0x350b4e[_0x77da('0x2b')],'type':_0x350b4e[_0x77da('0x2c')][_0x77da('0x2d')]};});_0x2258e9[_0x77da('0x2e')]=_[_0x77da('0x29')](_0x410d09,'name');_0x2258e9[_0x77da('0x2f')]=_[_0x77da('0x30')](_0x496ecd[_0x77da('0x2f')]);_0x2258e9[_0x77da('0x31')]=_[_0x77da('0x32')](_0x2258e9[_0x77da('0x2e')],_0x2258e9[_0x77da('0x2f')]);_0x4d395a[_0x77da('0x33')]=_['intersection'](_0x2258e9['model'],qs[_0x77da('0x34')](_0x496ecd[_0x77da('0x2f')]['fields']));_0x4d395a[_0x77da('0x33')]=_0x4d395a[_0x77da('0x33')][_0x77da('0x35')]?_0x4d395a[_0x77da('0x33')]:_0x2258e9[_0x77da('0x2e')];if(!_0x496ecd[_0x77da('0x2f')][_0x77da('0x36')]('nolimit')){_0x4d395a[_0x77da('0x1c')]=qs['limit'](_0x496ecd['query']['limit']);_0x4d395a[_0x77da('0x19')]=qs['offset'](_0x496ecd[_0x77da('0x2f')][_0x77da('0x19')]);}_0x4d395a[_0x77da('0x37')]=qs[_0x77da('0x38')](_0x496ecd[_0x77da('0x2f')][_0x77da('0x38')]);_0x4d395a[_0x77da('0x39')]=qs['filters'](_[_0x77da('0x3a')](_0x496ecd[_0x77da('0x2f')],_0x2258e9[_0x77da('0x31')]),_0x410d09);if(_0x496ecd[_0x77da('0x2f')][_0x77da('0x3b')]){_0x4d395a[_0x77da('0x39')]=_['merge'](_0x4d395a[_0x77da('0x39')],{'$or':_[_0x77da('0x29')](_0x410d09,function(_0x2cd190){if(_0x2cd190['type']!==_0x77da('0x3c')){var _0x505ffb={};_0x505ffb[_0x2cd190['name']]={'$like':'%'+_0x496ecd['query']['filter']+'%'};return _0x505ffb;}})});}_0x4d395a=_[_0x77da('0x3d')]({},_0x4d395a,_0x496ecd[_0x77da('0x3e')]);var _0xebdea1={'where':_0x4d395a['where']};return db[_0x77da('0x2a')]['count'](_0xebdea1)[_0x77da('0x21')](function(_0x517bd0){_0x30456a[_0x77da('0x1b')]=_0x517bd0;if(_0x496ecd[_0x77da('0x2f')][_0x77da('0x3f')]){_0x4d395a[_0x77da('0x40')]=[{'all':!![]}];}return db[_0x77da('0x2a')]['findAll'](_0x4d395a);})[_0x77da('0x21')](function(_0x1f48bd){_0x30456a[_0x77da('0x41')]=_0x1f48bd;return _0x30456a;})[_0x77da('0x21')](respondWithFilteredResult(_0x5b4638,_0x4d395a))[_0x77da('0x42')](handleError(_0x5b4638,null));};exports[_0x77da('0x43')]=function(_0x4ea24c,_0x319625){var _0x2f0495={'raw':!![],'where':{'id':_0x4ea24c[_0x77da('0x44')]['id']}},_0x21de41={};_0x21de41[_0x77da('0x2e')]=_[_0x77da('0x30')](db['JscriptyAnswerReport'][_0x77da('0x45')]);_0x21de41['query']=_[_0x77da('0x30')](_0x4ea24c[_0x77da('0x2f')]);_0x21de41[_0x77da('0x31')]=_['intersection'](_0x21de41[_0x77da('0x2e')],_0x21de41[_0x77da('0x2f')]);_0x2f0495[_0x77da('0x33')]=_[_0x77da('0x32')](_0x21de41[_0x77da('0x2e')],qs[_0x77da('0x34')](_0x4ea24c[_0x77da('0x2f')][_0x77da('0x34')]));_0x2f0495[_0x77da('0x33')]=_0x2f0495['attributes'][_0x77da('0x35')]?_0x2f0495[_0x77da('0x33')]:_0x21de41[_0x77da('0x2e')];if(_0x4ea24c[_0x77da('0x2f')][_0x77da('0x3f')]){_0x2f0495[_0x77da('0x40')]=[{'all':!![]}];}_0x2f0495=_['merge']({},_0x2f0495,_0x4ea24c['options']);return db[_0x77da('0x2a')][_0x77da('0x46')](_0x2f0495)[_0x77da('0x21')](handleEntityNotFound(_0x319625,null))[_0x77da('0x21')](respondWithResult(_0x319625,null))[_0x77da('0x42')](handleError(_0x319625,null));};exports[_0x77da('0x47')]=function(_0x4e811e,_0x6ccb8f){return db[_0x77da('0x2a')][_0x77da('0x47')](_0x4e811e[_0x77da('0x48')],{})['then'](respondWithResult(_0x6ccb8f,0xc9))[_0x77da('0x42')](handleError(_0x6ccb8f,null));};exports['update']=function(_0x518fd5,_0x36263b){if(_0x518fd5[_0x77da('0x48')]['id']){delete _0x518fd5[_0x77da('0x48')]['id'];}return db[_0x77da('0x2a')]['find']({'where':{'id':_0x518fd5[_0x77da('0x44')]['id']}})[_0x77da('0x21')](handleEntityNotFound(_0x36263b,null))['then'](saveUpdates(_0x518fd5[_0x77da('0x48')],null))[_0x77da('0x21')](respondWithResult(_0x36263b,null))['catch'](handleError(_0x36263b,null));};exports[_0x77da('0x22')]=function(_0x3aaf5b,_0x2b73d3){return db[_0x77da('0x2a')][_0x77da('0x46')]({'where':{'id':_0x3aaf5b[_0x77da('0x44')]['id']}})[_0x77da('0x21')](handleEntityNotFound(_0x2b73d3,null))[_0x77da('0x21')](removeEntity(_0x2b73d3,null))[_0x77da('0x42')](handleError(_0x2b73d3,null));};exports[_0x77da('0x49')]=function(_0x52aa0a,_0x3d04a3){return db['JscriptyAnswerReport'][_0x77da('0x49')]()[_0x77da('0x21')](respondWithResult(_0x3d04a3,null))[_0x77da('0x42')](handleError(_0x3d04a3,null));};
\ No newline at end of file
index d4dfeff..3eb8237 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a41=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util'];(function(_0x3cb152,_0x57eb54){var _0x4f54c3=function(_0x273a45){while(--_0x273a45){_0x3cb152['push'](_0x3cb152['shift']());}};_0x4f54c3(++_0x57eb54);}(_0x2a41,0x108));var _0x12a4=function(_0x4d9a42,_0x4baeaa){_0x4d9a42=_0x4d9a42-0x0;var _0x5833d3=_0x2a41[_0x4d9a42];return _0x5833d3;};'use strict';var _=require(_0x12a4('0x0'));var util=require(_0x12a4('0x1'));var logger=require(_0x12a4('0x2'))(_0x12a4('0x3'));var moment=require(_0x12a4('0x4'));var BPromise=require(_0x12a4('0x5'));var rp=require(_0x12a4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x12a4('0x7'));var config=require(_0x12a4('0x8'));var attributes=require(_0x12a4('0x9'));module[_0x12a4('0xa')]=function(_0x596c6a,_0x31463d){return _0x596c6a[_0x12a4('0xb')](_0x12a4('0xc'),attributes,{'tableName':_0x12a4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1c3f=['request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','moment'];(function(_0x1e3f2b,_0x3b0f1e){var _0x3f6400=function(_0x1c1ca4){while(--_0x1c1ca4){_0x1e3f2b['push'](_0x1e3f2b['shift']());}};_0x3f6400(++_0x3b0f1e);}(_0x1c3f,0x1b8));var _0xf1c3=function(_0x25b854,_0x2e19ff){_0x25b854=_0x25b854-0x0;var _0x35bcd8=_0x1c3f[_0x25b854];return _0x35bcd8;};'use strict';var _=require(_0xf1c3('0x0'));var util=require(_0xf1c3('0x1'));var logger=require(_0xf1c3('0x2'))('api');var moment=require(_0xf1c3('0x3'));var BPromise=require('bluebird');var rp=require(_0xf1c3('0x4'));var fs=require('fs');var path=require(_0xf1c3('0x5'));var rimraf=require(_0xf1c3('0x6'));var config=require(_0xf1c3('0x7'));var attributes=require(_0xf1c3('0x8'));module['exports']=function(_0x3365da,_0x2c220e){return _0x3365da[_0xf1c3('0x9')](_0xf1c3('0xa'),attributes,{'tableName':_0xf1c3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f735e9c..050ba20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccfc=['debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xccfc,0x181));var _0xcccf=function(_0x452351,_0x5c1047){_0x452351=_0x452351-0x0;var _0x120160=_0xccfc[_0x452351];return _0x120160;};'use strict';var _=require(_0xcccf('0x0'));var util=require(_0xcccf('0x1'));var moment=require(_0xcccf('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcccf('0x3'));var db=require(_0xcccf('0x4'))['db'];var utils=require(_0xcccf('0x5'));var logger=require('../../config/logger')(_0xcccf('0x6'));var config=require('../../config/environment');var jayson=require(_0xcccf('0x7'));var client=jayson['client'][_0xcccf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x34817f,_0xffec35,_0xe380b1){return new BPromise(function(_0x490170,_0x1b5a3f){return client[_0xcccf('0x9')](_0x34817f,_0xe380b1)[_0xcccf('0xa')](function(_0x34227c){logger[_0xcccf('0xb')](_0xcccf('0xc'),_0xffec35,_0xcccf('0xd'));logger[_0xcccf('0xe')](_0xcccf('0xf'),_0xffec35,_0xcccf('0xd'),JSON[_0xcccf('0x10')](_0x34227c));if(_0x34227c[_0xcccf('0x11')]){if(_0x34227c[_0xcccf('0x11')]['code']===0x1f4){logger[_0xcccf('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0xffec35,_0x34227c[_0xcccf('0x11')][_0xcccf('0x12')]);return _0x1b5a3f(_0x34227c[_0xcccf('0x11')][_0xcccf('0x12')]);}logger[_0xcccf('0x11')](_0xcccf('0xc'),_0xffec35,_0x34227c[_0xcccf('0x11')][_0xcccf('0x12')]);return _0x490170(_0x34227c[_0xcccf('0x11')]['message']);}else{logger[_0xcccf('0xb')](_0xcccf('0xc'),_0xffec35,'request\x20sent');_0x490170(_0x34227c[_0xcccf('0x13')][_0xcccf('0x12')]);}})[_0xcccf('0x14')](function(_0x3de743){logger[_0xcccf('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0xffec35,_0x3de743);_0x1b5a3f(_0x3de743);});});}
\ No newline at end of file
+var _0x0ca8=['code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x485481,_0x32de2a){var _0x387b4e=function(_0x2b7ad1){while(--_0x2b7ad1){_0x485481['push'](_0x485481['shift']());}};_0x387b4e(++_0x32de2a);}(_0x0ca8,0x143));var _0x80ca=function(_0x494048,_0x5e39df){_0x494048=_0x494048-0x0;var _0x2875f5=_0x0ca8[_0x494048];return _0x2875f5;};'use strict';var _=require(_0x80ca('0x0'));var util=require('util');var moment=require(_0x80ca('0x1'));var BPromise=require('bluebird');var rs=require(_0x80ca('0x2'));var fs=require('fs');var Redis=require(_0x80ca('0x3'));var db=require(_0x80ca('0x4'))['db'];var utils=require(_0x80ca('0x5'));var logger=require(_0x80ca('0x6'))(_0x80ca('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x80ca('0x8')][_0x80ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a089d,_0xe3189a,_0x344530){return new BPromise(function(_0xf60069,_0x8c65a0){return client[_0x80ca('0xa')](_0x2a089d,_0x344530)['then'](function(_0x4baa5d){logger[_0x80ca('0xb')](_0x80ca('0xc'),_0xe3189a,_0x80ca('0xd'));logger[_0x80ca('0xe')](_0x80ca('0xf'),_0xe3189a,_0x80ca('0xd'),JSON['stringify'](_0x4baa5d));if(_0x4baa5d[_0x80ca('0x10')]){if(_0x4baa5d[_0x80ca('0x10')][_0x80ca('0x11')]===0x1f4){logger[_0x80ca('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0xe3189a,_0x4baa5d[_0x80ca('0x10')][_0x80ca('0x12')]);return _0x8c65a0(_0x4baa5d[_0x80ca('0x10')][_0x80ca('0x12')]);}logger[_0x80ca('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0xe3189a,_0x4baa5d['error']['message']);return _0xf60069(_0x4baa5d[_0x80ca('0x10')][_0x80ca('0x12')]);}else{logger[_0x80ca('0xb')](_0x80ca('0xc'),_0xe3189a,_0x80ca('0xd'));_0xf60069(_0x4baa5d[_0x80ca('0x13')][_0x80ca('0x12')]);}})['catch'](function(_0x2169c5){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0xe3189a,_0x2169c5);_0x8c65a0(_0x2169c5);});});}
\ No newline at end of file
index 754bfe7..20bfe33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4347=['clone','put','/:id','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id/sessions','/:id/answers','/:id/summary','getSummary','post','create','/:id/clone'];(function(_0x5a3841,_0x3756b3){var _0x5ceba5=function(_0x50b9f0){while(--_0x50b9f0){_0x5a3841['push'](_0x5a3841['shift']());}};_0x5ceba5(++_0x3756b3);}(_0x4347,0xff));var _0x7434=function(_0x350ee3,_0x2f9e23){_0x350ee3=_0x350ee3-0x0;var _0x4bfb4e=_0x4347[_0x350ee3];return _0x4bfb4e;};'use strict';var multer=require(_0x7434('0x0'));var util=require(_0x7434('0x1'));var path=require(_0x7434('0x2'));var timeout=require(_0x7434('0x3'));var express=require(_0x7434('0x4'));var router=express['Router']();var fs_extra=require(_0x7434('0x5'));var auth=require(_0x7434('0x6'));var interaction=require(_0x7434('0x7'));var config=require(_0x7434('0x8'));var controller=require(_0x7434('0x9'));router[_0x7434('0xa')]('/',auth[_0x7434('0xb')](),controller[_0x7434('0xc')]);router['get']('/:id',auth[_0x7434('0xb')](),controller['show']);router['get'](_0x7434('0xd'),auth[_0x7434('0xb')](),controller['getSessions']);router[_0x7434('0xa')](_0x7434('0xe'),auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x7434('0xf'),auth['isAuthenticated'](),timeout('30s'),controller[_0x7434('0x10')]);router[_0x7434('0x11')]('/',auth[_0x7434('0xb')](),controller[_0x7434('0x12')]);router[_0x7434('0x11')](_0x7434('0x13'),auth[_0x7434('0xb')](),controller[_0x7434('0x14')]);router[_0x7434('0x15')](_0x7434('0x16'),auth[_0x7434('0xb')](),controller['update']);router[_0x7434('0x17')](_0x7434('0x16'),auth['isAuthenticated'](),controller['destroy']);module[_0x7434('0x18')]=router;
\ No newline at end of file
+var _0x4249=['/:id/answers','getAnswers','/:id/summary','30s','post','create','clone','put','update','delete','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/sessions'];(function(_0x51cafc,_0xacc84b){var _0x4a766c=function(_0x1a04cf){while(--_0x1a04cf){_0x51cafc['push'](_0x51cafc['shift']());}};_0x4a766c(++_0xacc84b);}(_0x4249,0x184));var _0x9424=function(_0x396fa5,_0x4afb3c){_0x396fa5=_0x396fa5-0x0;var _0x41c341=_0x4249[_0x396fa5];return _0x41c341;};'use strict';var multer=require(_0x9424('0x0'));var util=require('util');var path=require(_0x9424('0x1'));var timeout=require(_0x9424('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9424('0x3'));var interaction=require(_0x9424('0x4'));var config=require(_0x9424('0x5'));var controller=require('./jscriptyProject.controller');router[_0x9424('0x6')]('/',auth[_0x9424('0x7')](),controller[_0x9424('0x8')]);router[_0x9424('0x6')](_0x9424('0x9'),auth[_0x9424('0x7')](),controller['show']);router[_0x9424('0x6')](_0x9424('0xa'),auth[_0x9424('0x7')](),controller['getSessions']);router[_0x9424('0x6')](_0x9424('0xb'),auth[_0x9424('0x7')](),controller[_0x9424('0xc')]);router[_0x9424('0x6')](_0x9424('0xd'),auth[_0x9424('0x7')](),timeout(_0x9424('0xe')),controller['getSummary']);router[_0x9424('0xf')]('/',auth[_0x9424('0x7')](),controller[_0x9424('0x10')]);router['post']('/:id/clone',auth[_0x9424('0x7')](),controller[_0x9424('0x11')]);router[_0x9424('0x12')]('/:id',auth[_0x9424('0x7')](),controller[_0x9424('0x13')]);router[_0x9424('0x14')](_0x9424('0x9'),auth[_0x9424('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 2ba8d53..12c3950 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7933=['sequelize','lodash','util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','format','getDataValue','description','BOOLEAN'];(function(_0x29dab5,_0x703f04){var _0x2af667=function(_0x341e13){while(--_0x341e13){_0x29dab5['push'](_0x29dab5['shift']());}};_0x2af667(++_0x703f04);}(_0x7933,0x168));var _0x3793=function(_0x2e6645,_0x5b19e5){_0x2e6645=_0x2e6645-0x0;var _0x45dd5a=_0x7933[_0x2e6645];return _0x45dd5a;};'use strict';var Sequelize=require(_0x3793('0x0'));var _=require(_0x3793('0x1'));var util=require(_0x3793('0x2'));module[_0x3793('0x3')]={'name':{'type':Sequelize[_0x3793('0x4')],'unique':_0x3793('0x5')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x3793('0x6')](_0x3793('0x7')),'set':function(_0xf08b38){if(_[_0x3793('0x8')](_0xf08b38)){this[_0x3793('0x9')](_0x3793('0xa'),JSON['stringify'](_0xf08b38));}else if(_['isString'](_0xf08b38)){this[_0x3793('0x9')]('formData',_0xf08b38);}else{this[_0x3793('0x9')](_0x3793('0xa'),util[_0x3793('0xb')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x3793('0xc')](_0x3793('0x5'))||'',this[_0x3793('0xc')](_0x3793('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x3793('0xe')],'defaultValue':![]}};
\ No newline at end of file
+var _0x5f74=['TEXT','long','isObjectLike','setDataValue','formData','stringify','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','description','BOOLEAN','sequelize','lodash','exports','STRING'];(function(_0x26e917,_0x212f8f){var _0x406b10=function(_0x35a71e){while(--_0x35a71e){_0x26e917['push'](_0x26e917['shift']());}};_0x406b10(++_0x212f8f);}(_0x5f74,0x11c));var _0x45f7=function(_0xbceea5,_0x31ac66){_0xbceea5=_0xbceea5-0x0;var _0x4e007b=_0x5f74[_0xbceea5];return _0x4e007b;};'use strict';var Sequelize=require(_0x45f7('0x0'));var _=require(_0x45f7('0x1'));var util=require('util');module[_0x45f7('0x2')]={'name':{'type':Sequelize[_0x45f7('0x3')],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x45f7('0x4')](_0x45f7('0x5')),'set':function(_0x407da4){if(_[_0x45f7('0x6')](_0x407da4)){this[_0x45f7('0x7')](_0x45f7('0x8'),JSON[_0x45f7('0x9')](_0x407da4));}else if(_['isString'](_0x407da4)){this[_0x45f7('0x7')](_0x45f7('0x8'),_0x407da4);}else{this[_0x45f7('0x7')](_0x45f7('0x8'),util[_0x45f7('0xa')](_0x45f7('0xb'),this[_0x45f7('0xc')](_0x45f7('0xd'))||'',this[_0x45f7('0xc')](_0x45f7('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x45f7('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x45f7('0xf')],'defaultValue':![]}};
\ No newline at end of file
index 62bdaf1..f229c30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5074=['rows','JscriptyAnswerReport','ProjectId','findAll','fromCharCode','toString','indexOf','getSummary','starttime','parse','startTime','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Content-type','text/csv','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Projects','end','error','stack','name','index','map','JscriptyProject','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','catch','show','keys','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','createdAt','updatedAt','params','findOne','JscriptySessionReport'];(function(_0x5219af,_0x22cfef){var _0x2c642a=function(_0x274124){while(--_0x274124){_0x5219af['push'](_0x5219af['shift']());}};_0x2c642a(++_0x22cfef);}(_0x5074,0x1e7));var _0x4507=function(_0x10dfdf,_0x36b623){_0x10dfdf=_0x10dfdf-0x0;var _0x4d857d=_0x5074[_0x10dfdf];return _0x4d857d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4507('0x0'));var zipdir=require(_0x4507('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4507('0x2'));var moment=require(_0x4507('0x3'));var BPromise=require(_0x4507('0x4'));var Mustache=require(_0x4507('0x5'));var util=require(_0x4507('0x6'));var path=require(_0x4507('0x7'));var sox=require(_0x4507('0x8'));var csv=require(_0x4507('0x9'));var ejs=require(_0x4507('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4507('0xb'));var squel=require('squel');var crypto=require(_0x4507('0xc'));var jsforce=require(_0x4507('0xd'));var deskjs=require(_0x4507('0xe'));var toCsv=require(_0x4507('0x9'));var querystring=require('querystring');var Papa=require(_0x4507('0xf'));var Redis=require(_0x4507('0x10'));var authService=require(_0x4507('0x11'));var qs=require(_0x4507('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4507('0x13'));var logger=require(_0x4507('0x14'))(_0x4507('0x15'));var utils=require('../../config/utils');var config=require(_0x4507('0x16'));var licenseUtil=require(_0x4507('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51424a,_0x389172){_0x389172=_0x389172||0xcc;return function(_0x55ae6f){if(_0x55ae6f){return _0x51424a[_0x4507('0x18')](_0x389172);}return _0x51424a['status'](_0x389172)['end']();};}function respondWithResult(_0x13cb5d,_0x55a142){_0x55a142=_0x55a142||0xc8;return function(_0x278fe5){if(_0x278fe5){return _0x13cb5d[_0x4507('0x19')](_0x55a142)['json'](_0x278fe5);}};}function respondWithFilteredResult(_0x490b69,_0x1282f0){return function(_0x5ce8bf){if(_0x5ce8bf){var _0x3d95b1=typeof _0x1282f0[_0x4507('0x1a')]==='undefined'&&typeof _0x1282f0[_0x4507('0x1b')]==='undefined';var _0x2f189c=_0x5ce8bf[_0x4507('0x1c')];var _0x2535a0=_0x3d95b1?0x0:_0x1282f0['offset'];var _0x6ac401=_0x3d95b1?_0x5ce8bf[_0x4507('0x1c')]:_0x1282f0[_0x4507('0x1a')]+_0x1282f0[_0x4507('0x1b')];var _0x16261c;if(_0x6ac401>=_0x2f189c){_0x6ac401=_0x2f189c;_0x16261c=0xc8;}else{_0x16261c=0xce;}_0x490b69[_0x4507('0x19')](_0x16261c);return _0x490b69[_0x4507('0x1d')](_0x4507('0x1e'),_0x2535a0+'-'+_0x6ac401+'/'+_0x2f189c)['json'](_0x5ce8bf);}return null;};}function patchUpdates(_0x4f173c){return function(_0x165ed4){try{jsonpatch[_0x4507('0x1f')](_0x165ed4,_0x4f173c,!![]);}catch(_0x185e00){return BPromise[_0x4507('0x20')](_0x185e00);}return _0x165ed4[_0x4507('0x21')]();};}function saveUpdates(_0x45688c,_0x1278c0){return function(_0x178765){if(_0x178765){return _0x178765[_0x4507('0x22')](_0x45688c)[_0x4507('0x23')](function(_0x17a74b){return _0x17a74b;});}return null;};}function removeEntity(_0xdfc367,_0x1f4f4){return function(_0x5f3d8b){if(_0x5f3d8b){return _0x5f3d8b[_0x4507('0x24')]()[_0x4507('0x23')](function(){var _0x365805=_0x5f3d8b[_0x4507('0x25')]({'plain':!![]});var _0x208dc8=_0x4507('0x26');return db['UserProfileResource'][_0x4507('0x24')]({'where':{'type':_0x208dc8,'resourceId':_0x365805['id']}})[_0x4507('0x23')](function(){return _0x5f3d8b;});})['then'](function(){_0xdfc367['status'](0xcc)[_0x4507('0x27')]();});}};}function handleEntityNotFound(_0x252ce8,_0x5c1aa6){return function(_0x32f5c1){if(!_0x32f5c1){_0x252ce8['sendStatus'](0x194);}return _0x32f5c1;};}function handleError(_0x36d103,_0x5a4eef){_0x5a4eef=_0x5a4eef||0x1f4;return function(_0x70e6ef){logger[_0x4507('0x28')](_0x70e6ef[_0x4507('0x29')]);if(_0x70e6ef[_0x4507('0x2a')]){delete _0x70e6ef['name'];}_0x36d103[_0x4507('0x19')](_0x5a4eef)['send'](_0x70e6ef);};}exports[_0x4507('0x2b')]=function(_0x8f91f3,_0xf985e7){var _0x2f86cf={},_0xfb2937={},_0x22d8ce={'count':0x0,'rows':[]};var _0x4f1567=_[_0x4507('0x2c')](db[_0x4507('0x2d')]['rawAttributes'],function(_0x5d4b58){return{'name':_0x5d4b58[_0x4507('0x2e')],'type':_0x5d4b58['type'][_0x4507('0x2f')]};});_0xfb2937[_0x4507('0x30')]=_[_0x4507('0x2c')](_0x4f1567,_0x4507('0x2a'));_0xfb2937[_0x4507('0x31')]=_['keys'](_0x8f91f3[_0x4507('0x31')]);_0xfb2937[_0x4507('0x32')]=_[_0x4507('0x33')](_0xfb2937['model'],_0xfb2937[_0x4507('0x31')]);_0x2f86cf['attributes']=_[_0x4507('0x33')](_0xfb2937[_0x4507('0x30')],qs[_0x4507('0x34')](_0x8f91f3[_0x4507('0x31')]['fields']));_0x2f86cf[_0x4507('0x35')]=_0x2f86cf[_0x4507('0x35')][_0x4507('0x36')]?_0x2f86cf['attributes']:_0xfb2937[_0x4507('0x30')];if(!_0x8f91f3[_0x4507('0x31')][_0x4507('0x37')](_0x4507('0x38'))){_0x2f86cf[_0x4507('0x1b')]=qs[_0x4507('0x1b')](_0x8f91f3[_0x4507('0x31')][_0x4507('0x1b')]);_0x2f86cf[_0x4507('0x1a')]=qs[_0x4507('0x1a')](_0x8f91f3[_0x4507('0x31')][_0x4507('0x1a')]);}_0x2f86cf[_0x4507('0x39')]=qs[_0x4507('0x3a')](_0x8f91f3[_0x4507('0x31')][_0x4507('0x3a')]);_0x2f86cf['where']=qs[_0x4507('0x32')](_[_0x4507('0x3b')](_0x8f91f3[_0x4507('0x31')],_0xfb2937[_0x4507('0x32')]),_0x4f1567);if(_0x8f91f3[_0x4507('0x31')][_0x4507('0x3c')]){_0x2f86cf['where']=_[_0x4507('0x3d')](_0x2f86cf[_0x4507('0x3e')],{'$or':_[_0x4507('0x2c')](_0x4f1567,function(_0x1c0792){if(_0x1c0792[_0x4507('0x3f')]!==_0x4507('0x40')){var _0x360161={};_0x360161[_0x1c0792[_0x4507('0x2a')]]={'$like':'%'+_0x8f91f3[_0x4507('0x31')][_0x4507('0x3c')]+'%'};return _0x360161;}})});}_0x2f86cf=_[_0x4507('0x3d')]({},_0x2f86cf,_0x8f91f3[_0x4507('0x41')]);var _0x211e8c={'where':_0x2f86cf[_0x4507('0x3e')]};return db[_0x4507('0x2d')][_0x4507('0x1c')](_0x211e8c)[_0x4507('0x23')](function(_0x398623){_0x22d8ce[_0x4507('0x1c')]=_0x398623;if(_0x8f91f3['query'][_0x4507('0x42')]){_0x2f86cf['include']=[{'all':!![]}];}return db[_0x4507('0x2d')]['findAll'](_0x2f86cf);})[_0x4507('0x23')](function(_0x1a0c1f){_0x22d8ce['rows']=_0x1a0c1f;return _0x22d8ce;})[_0x4507('0x23')](respondWithFilteredResult(_0xf985e7,_0x2f86cf))[_0x4507('0x43')](handleError(_0xf985e7,null));};exports[_0x4507('0x44')]=function(_0x24b04b,_0x337581){var _0x90a611={'raw':![],'where':{'id':_0x24b04b['params']['id']}},_0x45041b={};_0x45041b[_0x4507('0x30')]=_[_0x4507('0x45')](db['JscriptyProject']['rawAttributes']);_0x45041b[_0x4507('0x31')]=_[_0x4507('0x45')](_0x24b04b[_0x4507('0x31')]);_0x45041b['filters']=_[_0x4507('0x33')](_0x45041b['model'],_0x45041b[_0x4507('0x31')]);_0x90a611['attributes']=_['intersection'](_0x45041b[_0x4507('0x30')],qs[_0x4507('0x34')](_0x24b04b[_0x4507('0x31')][_0x4507('0x34')]));_0x90a611[_0x4507('0x35')]=_0x90a611[_0x4507('0x35')]['length']?_0x90a611[_0x4507('0x35')]:_0x45041b['model'];if(_0x24b04b[_0x4507('0x31')]['includeAll']){_0x90a611[_0x4507('0x46')]=[{'all':!![]}];}_0x90a611=_[_0x4507('0x3d')]({},_0x90a611,_0x24b04b[_0x4507('0x41')]);return db[_0x4507('0x2d')][_0x4507('0x47')](_0x90a611)[_0x4507('0x23')](handleEntityNotFound(_0x337581,null))[_0x4507('0x23')](respondWithResult(_0x337581,null))[_0x4507('0x43')](handleError(_0x337581,null));};exports[_0x4507('0x48')]=function(_0x136fe5,_0x3c2ea6){return db[_0x4507('0x2d')][_0x4507('0x48')](_0x136fe5[_0x4507('0x49')],{})[_0x4507('0x23')](function(_0x2e2ea3){var _0xcceafb=_0x136fe5['user'][_0x4507('0x25')]({'plain':!![]});if(!_0xcceafb)throw new Error(_0x4507('0x4a'));if(_0xcceafb[_0x4507('0x4b')]===_0x4507('0x4c')){var _0x3f846f=_0x2e2ea3[_0x4507('0x25')]({'plain':!![]});var _0x535b5e='Projects';return db[_0x4507('0x4d')][_0x4507('0x47')]({'where':{'name':_0x535b5e,'userProfileId':_0xcceafb['userProfileId']},'raw':!![]})[_0x4507('0x23')](function(_0x3f81eb){if(_0x3f81eb&&_0x3f81eb[_0x4507('0x4e')]===0x0){return db[_0x4507('0x4f')]['create']({'name':_0x3f846f[_0x4507('0x2a')],'resourceId':_0x3f846f['id'],'type':_0x3f81eb['name'],'sectionId':_0x3f81eb['id']},{})['then'](function(){return _0x2e2ea3;});}else{return _0x2e2ea3;}})['catch'](function(_0x5df3f1){logger['error'](_0x4507('0x50'),_0x5df3f1);throw _0x5df3f1;});}return _0x2e2ea3;})[_0x4507('0x23')](respondWithResult(_0x3c2ea6,0xc9))[_0x4507('0x43')](handleError(_0x3c2ea6,null));};exports[_0x4507('0x51')]=function(_0x165683,_0x3a898b){var _0x2e1007={'where':{'id':_0x165683['params']['id']}},_0x3e813c={};_0x3e813c[_0x4507('0x30')]=_['keys'](db[_0x4507('0x2d')][_0x4507('0x52')]);_0x2e1007['attributes']=_['intersection'](_0x3e813c['model'],qs[_0x4507('0x34')](_0x165683[_0x4507('0x31')][_0x4507('0x34')]));_0x2e1007[_0x4507('0x35')]=_0x2e1007[_0x4507('0x35')]['length']?_0x2e1007[_0x4507('0x35')]:_0x3e813c[_0x4507('0x30')];if(_0x165683[_0x4507('0x31')]['includeAll']){_0x2e1007['include']=[{'all':!![]}];}_0x2e1007=_[_0x4507('0x3d')]({},_0x2e1007,_0x165683['options']);return db[_0x4507('0x2d')][_0x4507('0x47')](_0x2e1007)[_0x4507('0x23')](handleEntityNotFound(_0x3a898b,null))['then'](function(_0x2dc85a){if(_0x2dc85a){var _0x41690e=_0x2dc85a['get']({'plain':!![]});_0x41690e=qs['omit'](_0x41690e,['id',_0x4507('0x53'),_0x4507('0x54')]);_0x165683[_0x4507('0x49')]=_['omit'](_0x165683['body'],['id',_0x4507('0x53'),_0x4507('0x54')]);return db[_0x4507('0x2d')][_0x4507('0x48')](_[_0x4507('0x3d')](_0x41690e,_0x165683[_0x4507('0x49')]),{'include':_0x165683['query'][_0x4507('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0xac0e54){var _0x1dd12f=_0x165683[_0x4507('0x4c')][_0x4507('0x25')]({'plain':!![]});if(!_0x1dd12f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1dd12f['role']===_0x4507('0x4c')){var _0x19ae0a=_0xac0e54[_0x4507('0x25')]({'plain':!![]});var _0x3339f3='Projects';return db[_0x4507('0x4d')][_0x4507('0x47')]({'where':{'name':_0x3339f3,'userProfileId':_0x1dd12f['userProfileId']},'raw':!![]})[_0x4507('0x23')](function(_0x3cd835){if(_0x3cd835&&_0x3cd835[_0x4507('0x4e')]===0x0){return db[_0x4507('0x4f')][_0x4507('0x48')]({'name':_0x19ae0a[_0x4507('0x2a')],'resourceId':_0x19ae0a['id'],'type':_0x3cd835[_0x4507('0x2a')],'sectionId':_0x3cd835['id']},{})[_0x4507('0x23')](function(){return _0xac0e54;});}else{return _0xac0e54;}})['catch'](function(_0x4a51bf){logger[_0x4507('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a51bf);throw _0x4a51bf;});}return _0xac0e54;});}})[_0x4507('0x23')](respondWithResult(_0x3a898b,0xc9))[_0x4507('0x43')](handleError(_0x3a898b,null));};exports[_0x4507('0x22')]=function(_0x2d1dfd,_0x30229d){if(_0x2d1dfd[_0x4507('0x49')]['id']){delete _0x2d1dfd['body']['id'];}return db[_0x4507('0x2d')][_0x4507('0x47')]({'where':{'id':_0x2d1dfd[_0x4507('0x55')]['id']}})[_0x4507('0x23')](handleEntityNotFound(_0x30229d,null))[_0x4507('0x23')](saveUpdates(_0x2d1dfd[_0x4507('0x49')],null))[_0x4507('0x23')](respondWithResult(_0x30229d,null))[_0x4507('0x43')](handleError(_0x30229d,null));};exports[_0x4507('0x24')]=function(_0x4c1448,_0x58240c){return db['JscriptyProject'][_0x4507('0x47')]({'where':{'id':_0x4c1448[_0x4507('0x55')]['id']}})['then'](handleEntityNotFound(_0x58240c,null))['then'](removeEntity(_0x58240c,null))[_0x4507('0x43')](handleError(_0x58240c,null));};exports['getSessions']=function(_0x5eb699,_0x151924,_0x37e235){var _0x26c44c={'raw':!![],'where':{}};var _0x40a233={};var _0x4a5b72={'count':0x0,'rows':[]};return db[_0x4507('0x2d')][_0x4507('0x56')]({'where':{'id':_0x5eb699[_0x4507('0x55')]['id']}})['then'](handleEntityNotFound(_0x151924,null))['then'](function(_0x47b51a){if(_0x47b51a){_0x40a233[_0x4507('0x30')]=_[_0x4507('0x45')](db[_0x4507('0x57')][_0x4507('0x52')]);_0x40a233[_0x4507('0x31')]=_[_0x4507('0x45')](_0x5eb699[_0x4507('0x31')]);_0x40a233[_0x4507('0x32')]=_[_0x4507('0x33')](_0x40a233[_0x4507('0x30')],_0x40a233[_0x4507('0x31')]);_0x26c44c[_0x4507('0x35')]=_[_0x4507('0x33')](_0x40a233[_0x4507('0x30')],qs[_0x4507('0x34')](_0x5eb699[_0x4507('0x31')][_0x4507('0x34')]));_0x26c44c[_0x4507('0x35')]=_0x26c44c[_0x4507('0x35')][_0x4507('0x36')]?_0x26c44c['attributes']:_0x40a233[_0x4507('0x30')];if(!_0x5eb699[_0x4507('0x31')][_0x4507('0x37')](_0x4507('0x38'))){_0x26c44c[_0x4507('0x1b')]=qs[_0x4507('0x1b')](_0x5eb699[_0x4507('0x31')][_0x4507('0x1b')]);_0x26c44c[_0x4507('0x1a')]=qs[_0x4507('0x1a')](_0x5eb699[_0x4507('0x31')][_0x4507('0x1a')]);}_0x26c44c[_0x4507('0x39')]=qs['sort'](_0x5eb699[_0x4507('0x31')][_0x4507('0x3a')]);_0x26c44c['where']=qs[_0x4507('0x32')](_[_0x4507('0x3b')](_0x5eb699[_0x4507('0x31')],_0x40a233[_0x4507('0x32')]));_0x26c44c[_0x4507('0x3e')]['ProjectId']=_0x47b51a['id'];if(_0x5eb699[_0x4507('0x31')][_0x4507('0x3c')]){_0x26c44c[_0x4507('0x3e')]=_[_0x4507('0x3d')](_0x26c44c[_0x4507('0x3e')],{'$or':_[_0x4507('0x2c')](_0x26c44c[_0x4507('0x35')],function(_0x5c77ec){var _0x4d2acd={};_0x4d2acd[_0x5c77ec]={'$like':'%'+_0x5eb699[_0x4507('0x31')][_0x4507('0x3c')]+'%'};return _0x4d2acd;})});}_0x26c44c=_[_0x4507('0x3d')]({},_0x26c44c,_0x5eb699[_0x4507('0x41')]);return db[_0x4507('0x57')][_0x4507('0x1c')]({'where':_0x26c44c[_0x4507('0x3e')]})['then'](function(_0x3dd2cb){_0x4a5b72[_0x4507('0x1c')]=_0x3dd2cb;if(_0x5eb699[_0x4507('0x31')][_0x4507('0x42')]){_0x26c44c[_0x4507('0x46')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x26c44c);})[_0x4507('0x23')](function(_0xadaac9){_0x4a5b72[_0x4507('0x58')]=_0xadaac9;return _0x4a5b72;});}})[_0x4507('0x23')](respondWithFilteredResult(_0x151924,_0x26c44c))[_0x4507('0x43')](handleError(_0x151924,null));};exports['getAnswers']=function(_0x4abd1f,_0x4b3299,_0x151c65){var _0x1a71b8={'raw':!![],'where':{}};var _0x1a2146={};var _0x1bbb32={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x4507('0x56')]({'where':{'id':_0x4abd1f[_0x4507('0x55')]['id']}})[_0x4507('0x23')](handleEntityNotFound(_0x4b3299,null))[_0x4507('0x23')](function(_0x4ef82f){if(_0x4ef82f){_0x1a2146['model']=_[_0x4507('0x45')](db[_0x4507('0x59')][_0x4507('0x52')]);_0x1a2146[_0x4507('0x31')]=_[_0x4507('0x45')](_0x4abd1f['query']);_0x1a2146['filters']=_[_0x4507('0x33')](_0x1a2146[_0x4507('0x30')],_0x1a2146[_0x4507('0x31')]);_0x1a71b8[_0x4507('0x35')]=_[_0x4507('0x33')](_0x1a2146[_0x4507('0x30')],qs['fields'](_0x4abd1f[_0x4507('0x31')]['fields']));_0x1a71b8['attributes']=_0x1a71b8[_0x4507('0x35')][_0x4507('0x36')]?_0x1a71b8['attributes']:_0x1a2146[_0x4507('0x30')];if(!_0x4abd1f[_0x4507('0x31')][_0x4507('0x37')]('nolimit')){_0x1a71b8[_0x4507('0x1b')]=qs['limit'](_0x4abd1f[_0x4507('0x31')][_0x4507('0x1b')]);_0x1a71b8[_0x4507('0x1a')]=qs[_0x4507('0x1a')](_0x4abd1f['query'][_0x4507('0x1a')]);}_0x1a71b8[_0x4507('0x39')]=qs[_0x4507('0x3a')](_0x4abd1f[_0x4507('0x31')]['sort']);_0x1a71b8['where']=qs[_0x4507('0x32')](_[_0x4507('0x3b')](_0x4abd1f['query'],_0x1a2146[_0x4507('0x32')]));_0x1a71b8['where'][_0x4507('0x5a')]=_0x4ef82f['id'];if(_0x4abd1f[_0x4507('0x31')][_0x4507('0x3c')]){_0x1a71b8['where']=_[_0x4507('0x3d')](_0x1a71b8[_0x4507('0x3e')],{'$or':_[_0x4507('0x2c')](_0x1a71b8[_0x4507('0x35')],function(_0x7f96b){var _0x211b4d={};_0x211b4d[_0x7f96b]={'$like':'%'+_0x4abd1f[_0x4507('0x31')][_0x4507('0x3c')]+'%'};return _0x211b4d;})});}_0x1a71b8=_[_0x4507('0x3d')]({},_0x1a71b8,_0x4abd1f['options']);return db['JscriptyAnswerReport'][_0x4507('0x1c')]({'where':_0x1a71b8['where']})[_0x4507('0x23')](function(_0x20d1c7){_0x1bbb32['count']=_0x20d1c7;if(_0x4abd1f['query'][_0x4507('0x42')]){_0x1a71b8[_0x4507('0x46')]=[{'all':!![]}];}return db[_0x4507('0x59')][_0x4507('0x5b')](_0x1a71b8);})[_0x4507('0x23')](function(_0x2be177){_0x1bbb32[_0x4507('0x58')]=_0x2be177;return _0x1bbb32;});}})['then'](respondWithFilteredResult(_0x4b3299,_0x1a71b8))[_0x4507('0x43')](handleError(_0x4b3299,null));};function char(_0x5c2429){return'number'===typeof _0x5c2429?String[_0x4507('0x5c')]['apply'](null,arguments):_0x5c2429;}function needsEncapsulation(_0x486445){return!!_0x486445&&(_0x486445[_0x4507('0x5d')]()[_0x4507('0x5e')](char(0xd))>=0x0||_0x486445[_0x4507('0x5d')]()[_0x4507('0x5e')](char(0xa))>=0x0||_0x486445[_0x4507('0x5d')]()[_0x4507('0x5e')](char(0x2c))>=0x0||_0x486445[_0x4507('0x5d')]()[_0x4507('0x5e')](char(0x22))>=0x0);}function encapsulate(_0x1601f1){var _0x26ce8f=char(0x22),_0x46472a='\x5c'+char(0x22),_0x93651d=_0x1601f1[_0x4507('0x5d')]()['replace'](new RegExp(_0x26ce8f,'g'),_0x46472a);return _0x26ce8f+_0x93651d+_0x26ce8f;}exports[_0x4507('0x5f')]=function(_0x4de122,_0x2adfd3,_0x1fa893){var _0x1577a0,_0x24ae92;var _0x18cbb2={'where':{'ProjectId':_0x4de122[_0x4507('0x55')]['id']}};if(_0x4de122['query']['startTime']){_0x18cbb2['where'][_0x4507('0x60')]=JSON[_0x4507('0x61')](_0x4de122[_0x4507('0x31')][_0x4507('0x62')]);}return db[_0x4507('0x57')][_0x4507('0x5b')](_0x18cbb2)[_0x4507('0x23')](handleEntityNotFound(_0x2adfd3,null))[_0x4507('0x23')](function(_0x324767){if(_0x324767){_0x1577a0=_0x324767;return db[_0x4507('0x63')]['findAll']({'where':{'SessionId':{'$in':_[_0x4507('0x2c')](_0x1577a0,'id')},'ProjectId':_0x4de122[_0x4507('0x55')]['id']},'order':'-createdAt'});}})[_0x4507('0x23')](handleEntityNotFound(_0x2adfd3,null))[_0x4507('0x23')](function(_0x5d5597){if(_0x5d5597){_0x24ae92=_0x5d5597;var _0x4f8111={};for(var _0x415fc6=0x0,_0x394d1b=_0x24ae92[_0x4507('0x36')];_0x415fc6<_0x394d1b;_0x415fc6++){if(!_0x4f8111[_0x4507('0x37')](_0x24ae92[_0x415fc6]['questionId'])){_0x4f8111[_0x24ae92[_0x415fc6][_0x4507('0x64')]]=needsEncapsulation(_0x24ae92[_0x415fc6]['question'])?encapsulate(_0x24ae92[_0x415fc6][_0x4507('0x65')]):_0x24ae92[_0x415fc6][_0x4507('0x65')];}}var _0x5e87da=[],_0x1dc7dd={};for(var _0x19085b=0x0,_0x3d0868=_0x1577a0['length'];_0x19085b<_0x3d0868;_0x19085b++){_0x1dc7dd={'ProjectId':_0x4de122[_0x4507('0x55')]['id'],'SessionId':_0x1577a0[_0x19085b]['id'],'StartTime':moment(_0x1577a0[_0x19085b]['starttime'])[_0x4507('0x66')](_0x4507('0x67'))};for(var _0x3c9088=0x0,_0x4e1449=_0x24ae92['length'];_0x3c9088<_0x4e1449;_0x3c9088++){if(_0x24ae92[_0x3c9088][_0x4507('0x68')]==_0x1577a0[_0x19085b]['id']&&_0x4f8111[_0x4507('0x37')](_0x24ae92[_0x3c9088][_0x4507('0x64')])){_0x1dc7dd[_0x4f8111[_0x24ae92[_0x3c9088][_0x4507('0x64')]]]=_0x24ae92[_0x3c9088][_0x4507('0x69')];}}for(var _0x246346 in _0x4f8111){if(!_0x1dc7dd[_0x4507('0x37')](_0x4f8111[_0x246346])){_0x1dc7dd[_0x4f8111[_0x246346]]=null;}}_0x5e87da[_0x4507('0x6a')](_0x1dc7dd);}return _0x5e87da;}})['then'](function(_0x80429a){if(!_[_0x4507('0x6b')](_0x80429a)){var _0x30a761=toCsv(_0x80429a);var _0x1fcafa=Date[_0x4507('0x6c')]();fs[_0x4507('0x6d')](util[_0x4507('0x66')](_0x4507('0x6e'),_0x4de122[_0x4507('0x55')]['id'],_0x1fcafa),_0x30a761);_0x2adfd3['setHeader'](_0x4507('0x6f'),_0x4507('0x70')+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x4de122[_0x4507('0x55')]['id'],_0x1fcafa));_0x2adfd3['setHeader'](_0x4507('0x71'),_0x4507('0x72'));return _0x2adfd3['download'](util[_0x4507('0x66')](_0x4507('0x6e'),_0x4de122[_0x4507('0x55')]['id'],_0x1fcafa));}else{return _0x2adfd3[_0x4507('0x18')](0xcc);}})[_0x4507('0x43')](handleError(_0x2adfd3,null));};
\ No newline at end of file
+var _0x2d6d=['jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','count','status','Content-Range','json','apply','reject','update','then','destroy','get','Projects','UserProfileResource','error','stack','name','send','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','filters','pick','filter','where','merge','map','JscriptyProject','includeAll','include','rows','show','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','updatedAt','UserProfileSection','JscriptySessionReport','order','ProjectId','findAll','getAnswers','findOne','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x2d6d,0x66));var _0xd2d6=function(_0x48326a,_0x8cfa0c){_0x48326a=_0x48326a-0x0;var _0x466709=_0x2d6d[_0x48326a];return _0x466709;};'use strict';var emlformat=require(_0xd2d6('0x0'));var rimraf=require(_0xd2d6('0x1'));var zipdir=require(_0xd2d6('0x2'));var jsonpatch=require(_0xd2d6('0x3'));var rp=require(_0xd2d6('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd2d6('0x5'));var util=require(_0xd2d6('0x6'));var path=require(_0xd2d6('0x7'));var sox=require(_0xd2d6('0x8'));var csv=require(_0xd2d6('0x9'));var ejs=require(_0xd2d6('0xa'));var fs=require('fs');var fs_extra=require(_0xd2d6('0xb'));var _=require(_0xd2d6('0xc'));var squel=require(_0xd2d6('0xd'));var crypto=require('crypto');var jsforce=require(_0xd2d6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd2d6('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd2d6('0xf'));var authService=require(_0xd2d6('0x10'));var qs=require(_0xd2d6('0x11'));var as=require(_0xd2d6('0x12'));var hardwareService=require(_0xd2d6('0x13'));var logger=require(_0xd2d6('0x14'))(_0xd2d6('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd2d6('0x16'));var db=require(_0xd2d6('0x17'))['db'];function respondWithStatusCode(_0x43dbae,_0x199206){_0x199206=_0x199206||0xcc;return function(_0x38a8be){if(_0x38a8be){return _0x43dbae[_0xd2d6('0x18')](_0x199206);}return _0x43dbae['status'](_0x199206)[_0xd2d6('0x19')]();};}function respondWithResult(_0x1ed2e8,_0xb0a34){_0xb0a34=_0xb0a34||0xc8;return function(_0x439e3d){if(_0x439e3d){return _0x1ed2e8['status'](_0xb0a34)['json'](_0x439e3d);}};}function respondWithFilteredResult(_0x37a6bc,_0x352619){return function(_0x2a4b1a){if(_0x2a4b1a){var _0x8ba7fb=typeof _0x352619[_0xd2d6('0x1a')]===_0xd2d6('0x1b')&&typeof _0x352619['limit']===_0xd2d6('0x1b');var _0x57a7ea=_0x2a4b1a['count'];var _0x568aff=_0x8ba7fb?0x0:_0x352619[_0xd2d6('0x1a')];var _0x322a52=_0x8ba7fb?_0x2a4b1a[_0xd2d6('0x1c')]:_0x352619[_0xd2d6('0x1a')]+_0x352619['limit'];var _0x2d3bcb;if(_0x322a52>=_0x57a7ea){_0x322a52=_0x57a7ea;_0x2d3bcb=0xc8;}else{_0x2d3bcb=0xce;}_0x37a6bc[_0xd2d6('0x1d')](_0x2d3bcb);return _0x37a6bc['set'](_0xd2d6('0x1e'),_0x568aff+'-'+_0x322a52+'/'+_0x57a7ea)[_0xd2d6('0x1f')](_0x2a4b1a);}return null;};}function patchUpdates(_0x4313ae){return function(_0x5666e9){try{jsonpatch[_0xd2d6('0x20')](_0x5666e9,_0x4313ae,!![]);}catch(_0x213e96){return BPromise[_0xd2d6('0x21')](_0x213e96);}return _0x5666e9['save']();};}function saveUpdates(_0x39d3f0,_0x2422c0){return function(_0x5d4f17){if(_0x5d4f17){return _0x5d4f17[_0xd2d6('0x22')](_0x39d3f0)[_0xd2d6('0x23')](function(_0x485ea5){return _0x485ea5;});}return null;};}function removeEntity(_0x47f7a1,_0x1f296e){return function(_0x50544a){if(_0x50544a){return _0x50544a[_0xd2d6('0x24')]()[_0xd2d6('0x23')](function(){var _0x1eb5b7=_0x50544a[_0xd2d6('0x25')]({'plain':!![]});var _0x4f52bb=_0xd2d6('0x26');return db[_0xd2d6('0x27')][_0xd2d6('0x24')]({'where':{'type':_0x4f52bb,'resourceId':_0x1eb5b7['id']}})[_0xd2d6('0x23')](function(){return _0x50544a;});})['then'](function(){_0x47f7a1[_0xd2d6('0x1d')](0xcc)[_0xd2d6('0x19')]();});}};}function handleEntityNotFound(_0x1ffd00,_0xa7925f){return function(_0x5ee73e){if(!_0x5ee73e){_0x1ffd00[_0xd2d6('0x18')](0x194);}return _0x5ee73e;};}function handleError(_0x4999a5,_0x381afa){_0x381afa=_0x381afa||0x1f4;return function(_0x4c1828){logger[_0xd2d6('0x28')](_0x4c1828[_0xd2d6('0x29')]);if(_0x4c1828[_0xd2d6('0x2a')]){delete _0x4c1828[_0xd2d6('0x2a')];}_0x4999a5[_0xd2d6('0x1d')](_0x381afa)[_0xd2d6('0x2b')](_0x4c1828);};}exports['index']=function(_0x50b68a,_0x26c198){var _0x4adb9d={},_0x469e19={},_0x2fd3cf={'count':0x0,'rows':[]};var _0x2553a7=_['map'](db['JscriptyProject'][_0xd2d6('0x2c')],function(_0x45c134){return{'name':_0x45c134['fieldName'],'type':_0x45c134[_0xd2d6('0x2d')][_0xd2d6('0x2e')]};});_0x469e19[_0xd2d6('0x2f')]=_['map'](_0x2553a7,'name');_0x469e19['query']=_[_0xd2d6('0x30')](_0x50b68a[_0xd2d6('0x31')]);_0x469e19['filters']=_[_0xd2d6('0x32')](_0x469e19[_0xd2d6('0x2f')],_0x469e19[_0xd2d6('0x31')]);_0x4adb9d[_0xd2d6('0x33')]=_[_0xd2d6('0x32')](_0x469e19[_0xd2d6('0x2f')],qs[_0xd2d6('0x34')](_0x50b68a[_0xd2d6('0x31')][_0xd2d6('0x34')]));_0x4adb9d[_0xd2d6('0x33')]=_0x4adb9d[_0xd2d6('0x33')][_0xd2d6('0x35')]?_0x4adb9d[_0xd2d6('0x33')]:_0x469e19[_0xd2d6('0x2f')];if(!_0x50b68a[_0xd2d6('0x31')][_0xd2d6('0x36')](_0xd2d6('0x37'))){_0x4adb9d[_0xd2d6('0x38')]=qs[_0xd2d6('0x38')](_0x50b68a[_0xd2d6('0x31')][_0xd2d6('0x38')]);_0x4adb9d[_0xd2d6('0x1a')]=qs[_0xd2d6('0x1a')](_0x50b68a['query'][_0xd2d6('0x1a')]);}_0x4adb9d['order']=qs[_0xd2d6('0x39')](_0x50b68a[_0xd2d6('0x31')][_0xd2d6('0x39')]);_0x4adb9d['where']=qs[_0xd2d6('0x3a')](_[_0xd2d6('0x3b')](_0x50b68a[_0xd2d6('0x31')],_0x469e19[_0xd2d6('0x3a')]),_0x2553a7);if(_0x50b68a['query'][_0xd2d6('0x3c')]){_0x4adb9d[_0xd2d6('0x3d')]=_[_0xd2d6('0x3e')](_0x4adb9d[_0xd2d6('0x3d')],{'$or':_[_0xd2d6('0x3f')](_0x2553a7,function(_0x5c9cbf){if(_0x5c9cbf[_0xd2d6('0x2d')]!=='VIRTUAL'){var _0x43fdaa={};_0x43fdaa[_0x5c9cbf['name']]={'$like':'%'+_0x50b68a['query'][_0xd2d6('0x3c')]+'%'};return _0x43fdaa;}})});}_0x4adb9d=_[_0xd2d6('0x3e')]({},_0x4adb9d,_0x50b68a['options']);var _0x12c794={'where':_0x4adb9d[_0xd2d6('0x3d')]};return db[_0xd2d6('0x40')]['count'](_0x12c794)[_0xd2d6('0x23')](function(_0x5baf88){_0x2fd3cf[_0xd2d6('0x1c')]=_0x5baf88;if(_0x50b68a[_0xd2d6('0x31')][_0xd2d6('0x41')]){_0x4adb9d[_0xd2d6('0x42')]=[{'all':!![]}];}return db['JscriptyProject']['findAll'](_0x4adb9d);})[_0xd2d6('0x23')](function(_0x18ed22){_0x2fd3cf[_0xd2d6('0x43')]=_0x18ed22;return _0x2fd3cf;})['then'](respondWithFilteredResult(_0x26c198,_0x4adb9d))['catch'](handleError(_0x26c198,null));};exports[_0xd2d6('0x44')]=function(_0x354474,_0x2ea506){var _0x4f37f0={'raw':![],'where':{'id':_0x354474['params']['id']}},_0x548015={};_0x548015[_0xd2d6('0x2f')]=_[_0xd2d6('0x30')](db['JscriptyProject']['rawAttributes']);_0x548015[_0xd2d6('0x31')]=_['keys'](_0x354474[_0xd2d6('0x31')]);_0x548015[_0xd2d6('0x3a')]=_[_0xd2d6('0x32')](_0x548015[_0xd2d6('0x2f')],_0x548015[_0xd2d6('0x31')]);_0x4f37f0[_0xd2d6('0x33')]=_['intersection'](_0x548015[_0xd2d6('0x2f')],qs[_0xd2d6('0x34')](_0x354474['query'][_0xd2d6('0x34')]));_0x4f37f0[_0xd2d6('0x33')]=_0x4f37f0[_0xd2d6('0x33')][_0xd2d6('0x35')]?_0x4f37f0[_0xd2d6('0x33')]:_0x548015[_0xd2d6('0x2f')];if(_0x354474[_0xd2d6('0x31')][_0xd2d6('0x41')]){_0x4f37f0[_0xd2d6('0x42')]=[{'all':!![]}];}_0x4f37f0=_['merge']({},_0x4f37f0,_0x354474[_0xd2d6('0x45')]);return db['JscriptyProject']['find'](_0x4f37f0)[_0xd2d6('0x23')](handleEntityNotFound(_0x2ea506,null))[_0xd2d6('0x23')](respondWithResult(_0x2ea506,null))[_0xd2d6('0x46')](handleError(_0x2ea506,null));};exports[_0xd2d6('0x47')]=function(_0x3c3db5,_0x1e30b2){return db[_0xd2d6('0x40')][_0xd2d6('0x47')](_0x3c3db5[_0xd2d6('0x48')],{})[_0xd2d6('0x23')](function(_0x1a41a9){var _0x2be7fc=_0x3c3db5[_0xd2d6('0x49')][_0xd2d6('0x25')]({'plain':!![]});if(!_0x2be7fc)throw new Error(_0xd2d6('0x4a'));if(_0x2be7fc[_0xd2d6('0x4b')]==='user'){var _0x1ae825=_0x1a41a9[_0xd2d6('0x25')]({'plain':!![]});var _0x28ca97=_0xd2d6('0x26');return db['UserProfileSection'][_0xd2d6('0x4c')]({'where':{'name':_0x28ca97,'userProfileId':_0x2be7fc[_0xd2d6('0x4d')]},'raw':!![]})[_0xd2d6('0x23')](function(_0x277fe9){if(_0x277fe9&&_0x277fe9['autoAssociation']===0x0){return db[_0xd2d6('0x27')][_0xd2d6('0x47')]({'name':_0x1ae825[_0xd2d6('0x2a')],'resourceId':_0x1ae825['id'],'type':_0x277fe9[_0xd2d6('0x2a')],'sectionId':_0x277fe9['id']},{})['then'](function(){return _0x1a41a9;});}else{return _0x1a41a9;}})[_0xd2d6('0x46')](function(_0x1de120){logger[_0xd2d6('0x28')](_0xd2d6('0x4e'),_0x1de120);throw _0x1de120;});}return _0x1a41a9;})['then'](respondWithResult(_0x1e30b2,0xc9))[_0xd2d6('0x46')](handleError(_0x1e30b2,null));};exports[_0xd2d6('0x4f')]=function(_0xf27361,_0x4ddb3a){var _0x4fbb28={'where':{'id':_0xf27361[_0xd2d6('0x50')]['id']}},_0x291731={};_0x291731['model']=_[_0xd2d6('0x30')](db[_0xd2d6('0x40')][_0xd2d6('0x2c')]);_0x4fbb28[_0xd2d6('0x33')]=_['intersection'](_0x291731[_0xd2d6('0x2f')],qs[_0xd2d6('0x34')](_0xf27361['query'][_0xd2d6('0x34')]));_0x4fbb28[_0xd2d6('0x33')]=_0x4fbb28[_0xd2d6('0x33')]['length']?_0x4fbb28[_0xd2d6('0x33')]:_0x291731[_0xd2d6('0x2f')];if(_0xf27361[_0xd2d6('0x31')]['includeAll']){_0x4fbb28['include']=[{'all':!![]}];}_0x4fbb28=_[_0xd2d6('0x3e')]({},_0x4fbb28,_0xf27361['options']);return db[_0xd2d6('0x40')][_0xd2d6('0x4c')](_0x4fbb28)[_0xd2d6('0x23')](handleEntityNotFound(_0x4ddb3a,null))[_0xd2d6('0x23')](function(_0x4652a9){if(_0x4652a9){var _0x2861e7=_0x4652a9[_0xd2d6('0x25')]({'plain':!![]});_0x2861e7=qs['omit'](_0x2861e7,['id',_0xd2d6('0x51'),'updatedAt']);_0xf27361[_0xd2d6('0x48')]=_['omit'](_0xf27361['body'],['id',_0xd2d6('0x51'),_0xd2d6('0x52')]);return db[_0xd2d6('0x40')][_0xd2d6('0x47')](_['merge'](_0x2861e7,_0xf27361[_0xd2d6('0x48')]),{'include':_0xf27361[_0xd2d6('0x31')][_0xd2d6('0x41')]?[{'all':!![]}]:undefined})[_0xd2d6('0x23')](function(_0xdda55c){var _0x37e5c0=_0xf27361['user'][_0xd2d6('0x25')]({'plain':!![]});if(!_0x37e5c0)throw new Error(_0xd2d6('0x4a'));if(_0x37e5c0[_0xd2d6('0x4b')]===_0xd2d6('0x49')){var _0x55f370=_0xdda55c['get']({'plain':!![]});var _0x43548e=_0xd2d6('0x26');return db[_0xd2d6('0x53')][_0xd2d6('0x4c')]({'where':{'name':_0x43548e,'userProfileId':_0x37e5c0[_0xd2d6('0x4d')]},'raw':!![]})[_0xd2d6('0x23')](function(_0x28ef08){if(_0x28ef08&&_0x28ef08['autoAssociation']===0x0){return db[_0xd2d6('0x27')]['create']({'name':_0x55f370['name'],'resourceId':_0x55f370['id'],'type':_0x28ef08[_0xd2d6('0x2a')],'sectionId':_0x28ef08['id']},{})[_0xd2d6('0x23')](function(){return _0xdda55c;});}else{return _0xdda55c;}})[_0xd2d6('0x46')](function(_0x31dc25){logger[_0xd2d6('0x28')](_0xd2d6('0x4e'),_0x31dc25);throw _0x31dc25;});}return _0xdda55c;});}})[_0xd2d6('0x23')](respondWithResult(_0x4ddb3a,0xc9))['catch'](handleError(_0x4ddb3a,null));};exports[_0xd2d6('0x22')]=function(_0x451d44,_0x26f9b3){if(_0x451d44[_0xd2d6('0x48')]['id']){delete _0x451d44['body']['id'];}return db[_0xd2d6('0x40')]['find']({'where':{'id':_0x451d44['params']['id']}})[_0xd2d6('0x23')](handleEntityNotFound(_0x26f9b3,null))[_0xd2d6('0x23')](saveUpdates(_0x451d44[_0xd2d6('0x48')],null))[_0xd2d6('0x23')](respondWithResult(_0x26f9b3,null))[_0xd2d6('0x46')](handleError(_0x26f9b3,null));};exports[_0xd2d6('0x24')]=function(_0x5a745e,_0x2d1334){return db[_0xd2d6('0x40')][_0xd2d6('0x4c')]({'where':{'id':_0x5a745e[_0xd2d6('0x50')]['id']}})[_0xd2d6('0x23')](handleEntityNotFound(_0x2d1334,null))[_0xd2d6('0x23')](removeEntity(_0x2d1334,null))[_0xd2d6('0x46')](handleError(_0x2d1334,null));};exports['getSessions']=function(_0x26688e,_0x8b8a8a,_0x5e74a7){var _0x4a8eb2={'raw':!![],'where':{}};var _0x405477={};var _0x463edb={'count':0x0,'rows':[]};return db[_0xd2d6('0x40')]['findOne']({'where':{'id':_0x26688e['params']['id']}})['then'](handleEntityNotFound(_0x8b8a8a,null))['then'](function(_0x3594a3){if(_0x3594a3){_0x405477[_0xd2d6('0x2f')]=_[_0xd2d6('0x30')](db[_0xd2d6('0x54')]['rawAttributes']);_0x405477['query']=_[_0xd2d6('0x30')](_0x26688e[_0xd2d6('0x31')]);_0x405477[_0xd2d6('0x3a')]=_[_0xd2d6('0x32')](_0x405477['model'],_0x405477['query']);_0x4a8eb2[_0xd2d6('0x33')]=_['intersection'](_0x405477[_0xd2d6('0x2f')],qs['fields'](_0x26688e['query'][_0xd2d6('0x34')]));_0x4a8eb2[_0xd2d6('0x33')]=_0x4a8eb2[_0xd2d6('0x33')][_0xd2d6('0x35')]?_0x4a8eb2[_0xd2d6('0x33')]:_0x405477[_0xd2d6('0x2f')];if(!_0x26688e['query'][_0xd2d6('0x36')](_0xd2d6('0x37'))){_0x4a8eb2[_0xd2d6('0x38')]=qs[_0xd2d6('0x38')](_0x26688e['query'][_0xd2d6('0x38')]);_0x4a8eb2['offset']=qs[_0xd2d6('0x1a')](_0x26688e[_0xd2d6('0x31')][_0xd2d6('0x1a')]);}_0x4a8eb2[_0xd2d6('0x55')]=qs[_0xd2d6('0x39')](_0x26688e[_0xd2d6('0x31')][_0xd2d6('0x39')]);_0x4a8eb2['where']=qs['filters'](_[_0xd2d6('0x3b')](_0x26688e[_0xd2d6('0x31')],_0x405477[_0xd2d6('0x3a')]));_0x4a8eb2['where'][_0xd2d6('0x56')]=_0x3594a3['id'];if(_0x26688e[_0xd2d6('0x31')][_0xd2d6('0x3c')]){_0x4a8eb2[_0xd2d6('0x3d')]=_[_0xd2d6('0x3e')](_0x4a8eb2[_0xd2d6('0x3d')],{'$or':_[_0xd2d6('0x3f')](_0x4a8eb2['attributes'],function(_0x639743){var _0x58465d={};_0x58465d[_0x639743]={'$like':'%'+_0x26688e[_0xd2d6('0x31')][_0xd2d6('0x3c')]+'%'};return _0x58465d;})});}_0x4a8eb2=_['merge']({},_0x4a8eb2,_0x26688e[_0xd2d6('0x45')]);return db[_0xd2d6('0x54')][_0xd2d6('0x1c')]({'where':_0x4a8eb2[_0xd2d6('0x3d')]})[_0xd2d6('0x23')](function(_0x16c54d){_0x463edb['count']=_0x16c54d;if(_0x26688e[_0xd2d6('0x31')][_0xd2d6('0x41')]){_0x4a8eb2[_0xd2d6('0x42')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xd2d6('0x57')](_0x4a8eb2);})[_0xd2d6('0x23')](function(_0x1c229f){_0x463edb[_0xd2d6('0x43')]=_0x1c229f;return _0x463edb;});}})[_0xd2d6('0x23')](respondWithFilteredResult(_0x8b8a8a,_0x4a8eb2))['catch'](handleError(_0x8b8a8a,null));};exports[_0xd2d6('0x58')]=function(_0x1ccc10,_0x7975c8,_0x50a4ab){var _0x1a42b7={'raw':!![],'where':{}};var _0x469947={};var _0x55ea79={'count':0x0,'rows':[]};return db[_0xd2d6('0x40')][_0xd2d6('0x59')]({'where':{'id':_0x1ccc10[_0xd2d6('0x50')]['id']}})[_0xd2d6('0x23')](handleEntityNotFound(_0x7975c8,null))[_0xd2d6('0x23')](function(_0x4ecd77){if(_0x4ecd77){_0x469947[_0xd2d6('0x2f')]=_[_0xd2d6('0x30')](db[_0xd2d6('0x5a')]['rawAttributes']);_0x469947[_0xd2d6('0x31')]=_['keys'](_0x1ccc10[_0xd2d6('0x31')]);_0x469947['filters']=_['intersection'](_0x469947[_0xd2d6('0x2f')],_0x469947[_0xd2d6('0x31')]);_0x1a42b7[_0xd2d6('0x33')]=_[_0xd2d6('0x32')](_0x469947[_0xd2d6('0x2f')],qs[_0xd2d6('0x34')](_0x1ccc10['query']['fields']));_0x1a42b7[_0xd2d6('0x33')]=_0x1a42b7[_0xd2d6('0x33')][_0xd2d6('0x35')]?_0x1a42b7['attributes']:_0x469947[_0xd2d6('0x2f')];if(!_0x1ccc10['query'][_0xd2d6('0x36')](_0xd2d6('0x37'))){_0x1a42b7['limit']=qs[_0xd2d6('0x38')](_0x1ccc10['query'][_0xd2d6('0x38')]);_0x1a42b7[_0xd2d6('0x1a')]=qs[_0xd2d6('0x1a')](_0x1ccc10['query'][_0xd2d6('0x1a')]);}_0x1a42b7['order']=qs[_0xd2d6('0x39')](_0x1ccc10[_0xd2d6('0x31')][_0xd2d6('0x39')]);_0x1a42b7[_0xd2d6('0x3d')]=qs[_0xd2d6('0x3a')](_[_0xd2d6('0x3b')](_0x1ccc10[_0xd2d6('0x31')],_0x469947[_0xd2d6('0x3a')]));_0x1a42b7['where']['ProjectId']=_0x4ecd77['id'];if(_0x1ccc10[_0xd2d6('0x31')][_0xd2d6('0x3c')]){_0x1a42b7[_0xd2d6('0x3d')]=_['merge'](_0x1a42b7[_0xd2d6('0x3d')],{'$or':_[_0xd2d6('0x3f')](_0x1a42b7[_0xd2d6('0x33')],function(_0x46bee6){var _0x4e79eb={};_0x4e79eb[_0x46bee6]={'$like':'%'+_0x1ccc10[_0xd2d6('0x31')][_0xd2d6('0x3c')]+'%'};return _0x4e79eb;})});}_0x1a42b7=_[_0xd2d6('0x3e')]({},_0x1a42b7,_0x1ccc10['options']);return db['JscriptyAnswerReport'][_0xd2d6('0x1c')]({'where':_0x1a42b7[_0xd2d6('0x3d')]})['then'](function(_0x586034){_0x55ea79['count']=_0x586034;if(_0x1ccc10[_0xd2d6('0x31')][_0xd2d6('0x41')]){_0x1a42b7[_0xd2d6('0x42')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xd2d6('0x57')](_0x1a42b7);})[_0xd2d6('0x23')](function(_0x422dc5){_0x55ea79['rows']=_0x422dc5;return _0x55ea79;});}})['then'](respondWithFilteredResult(_0x7975c8,_0x1a42b7))[_0xd2d6('0x46')](handleError(_0x7975c8,null));};function char(_0x2c3e7b){return _0xd2d6('0x5b')===typeof _0x2c3e7b?String[_0xd2d6('0x5c')][_0xd2d6('0x20')](null,arguments):_0x2c3e7b;}function needsEncapsulation(_0x4f362e){return!!_0x4f362e&&(_0x4f362e[_0xd2d6('0x5d')]()['indexOf'](char(0xd))>=0x0||_0x4f362e[_0xd2d6('0x5d')]()[_0xd2d6('0x5e')](char(0xa))>=0x0||_0x4f362e[_0xd2d6('0x5d')]()[_0xd2d6('0x5e')](char(0x2c))>=0x0||_0x4f362e[_0xd2d6('0x5d')]()[_0xd2d6('0x5e')](char(0x22))>=0x0);}function encapsulate(_0x32ed95){var _0x343623=char(0x22),_0x9a4aca='\x5c'+char(0x22),_0x2ef7fe=_0x32ed95[_0xd2d6('0x5d')]()[_0xd2d6('0x5f')](new RegExp(_0x343623,'g'),_0x9a4aca);return _0x343623+_0x2ef7fe+_0x343623;}exports['getSummary']=function(_0x137e27,_0x49ca03,_0x44fed0){var _0x3192cc,_0x11831c;var _0x14ece9={'where':{'ProjectId':_0x137e27['params']['id']}};if(_0x137e27[_0xd2d6('0x31')][_0xd2d6('0x60')]){_0x14ece9[_0xd2d6('0x3d')][_0xd2d6('0x61')]=JSON[_0xd2d6('0x62')](_0x137e27[_0xd2d6('0x31')]['startTime']);}return db[_0xd2d6('0x54')][_0xd2d6('0x57')](_0x14ece9)['then'](handleEntityNotFound(_0x49ca03,null))[_0xd2d6('0x23')](function(_0x6ec79f){if(_0x6ec79f){_0x3192cc=_0x6ec79f;return db[_0xd2d6('0x63')][_0xd2d6('0x57')]({'where':{'SessionId':{'$in':_[_0xd2d6('0x3f')](_0x3192cc,'id')},'ProjectId':_0x137e27[_0xd2d6('0x50')]['id']},'order':'-createdAt'});}})[_0xd2d6('0x23')](handleEntityNotFound(_0x49ca03,null))[_0xd2d6('0x23')](function(_0x3059ac){if(_0x3059ac){_0x11831c=_0x3059ac;var _0x4d0e8c={};for(var _0x65556d=0x0,_0x152803=_0x11831c[_0xd2d6('0x35')];_0x65556d<_0x152803;_0x65556d++){if(!_0x4d0e8c[_0xd2d6('0x36')](_0x11831c[_0x65556d][_0xd2d6('0x64')])){_0x4d0e8c[_0x11831c[_0x65556d][_0xd2d6('0x64')]]=needsEncapsulation(_0x11831c[_0x65556d][_0xd2d6('0x65')])?encapsulate(_0x11831c[_0x65556d]['question']):_0x11831c[_0x65556d][_0xd2d6('0x65')];}}var _0xb08af8=[],_0x3b1ad5={};for(var _0x3f53c6=0x0,_0x50b1c3=_0x3192cc[_0xd2d6('0x35')];_0x3f53c6<_0x50b1c3;_0x3f53c6++){_0x3b1ad5={'ProjectId':_0x137e27[_0xd2d6('0x50')]['id'],'SessionId':_0x3192cc[_0x3f53c6]['id'],'StartTime':moment(_0x3192cc[_0x3f53c6][_0xd2d6('0x61')])[_0xd2d6('0x66')](_0xd2d6('0x67'))};for(var _0x4bb643=0x0,_0xf03e72=_0x11831c[_0xd2d6('0x35')];_0x4bb643<_0xf03e72;_0x4bb643++){if(_0x11831c[_0x4bb643][_0xd2d6('0x68')]==_0x3192cc[_0x3f53c6]['id']&&_0x4d0e8c['hasOwnProperty'](_0x11831c[_0x4bb643][_0xd2d6('0x64')])){_0x3b1ad5[_0x4d0e8c[_0x11831c[_0x4bb643]['questionId']]]=_0x11831c[_0x4bb643][_0xd2d6('0x69')];}}for(var _0x56d098 in _0x4d0e8c){if(!_0x3b1ad5[_0xd2d6('0x36')](_0x4d0e8c[_0x56d098])){_0x3b1ad5[_0x4d0e8c[_0x56d098]]=null;}}_0xb08af8[_0xd2d6('0x6a')](_0x3b1ad5);}return _0xb08af8;}})[_0xd2d6('0x23')](function(_0xf599e8){if(!_[_0xd2d6('0x6b')](_0xf599e8)){var _0x4eb454=toCsv(_0xf599e8);var _0x2e119c=Date[_0xd2d6('0x6c')]();fs['writeFileSync'](util[_0xd2d6('0x66')](_0xd2d6('0x6d'),_0x137e27[_0xd2d6('0x50')]['id'],_0x2e119c),_0x4eb454);_0x49ca03[_0xd2d6('0x6e')](_0xd2d6('0x6f'),_0xd2d6('0x70')+util[_0xd2d6('0x66')](_0xd2d6('0x71'),_0x137e27[_0xd2d6('0x50')]['id'],_0x2e119c));_0x49ca03['setHeader']('Content-type',_0xd2d6('0x72'));return _0x49ca03[_0xd2d6('0x73')](util[_0xd2d6('0x66')](_0xd2d6('0x6d'),_0x137e27[_0xd2d6('0x50')]['id'],_0x2e119c));}else{return _0x49ca03[_0xd2d6('0x18')](0xcc);}})[_0xd2d6('0x46')](handleError(_0x49ca03,null));};
\ No newline at end of file
index 817a0ea..7ea4f02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23f4=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','util'];(function(_0x22420f,_0x2a1dad){var _0x31f7dd=function(_0x293125){while(--_0x293125){_0x22420f['push'](_0x22420f['shift']());}};_0x31f7dd(++_0x2a1dad);}(_0x23f4,0x1ee));var _0x423f=function(_0x1b259a,_0x554793){_0x1b259a=_0x1b259a-0x0;var _0xcb599=_0x23f4[_0x1b259a];return _0xcb599;};'use strict';var _=require('lodash');var util=require(_0x423f('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x423f('0x1'));var BPromise=require(_0x423f('0x2'));var rp=require(_0x423f('0x3'));var fs=require('fs');var path=require(_0x423f('0x4'));var rimraf=require(_0x423f('0x5'));var config=require(_0x423f('0x6'));var attributes=require(_0x423f('0x7'));module[_0x423f('0x8')]=function(_0x34a2d9,_0x51066b){return _0x34a2d9[_0x423f('0x9')](_0x423f('0xa'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x885a=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x885a,0x180));var _0xa885=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x885a[_0x27af45];return _0x18df21;};'use strict';var _=require('lodash');var util=require(_0xa885('0x0'));var logger=require(_0xa885('0x1'))(_0xa885('0x2'));var moment=require(_0xa885('0x3'));var BPromise=require('bluebird');var rp=require(_0xa885('0x4'));var fs=require('fs');var path=require(_0xa885('0x5'));var rimraf=require(_0xa885('0x6'));var config=require(_0xa885('0x7'));var attributes=require(_0xa885('0x8'));module[_0xa885('0x9')]=function(_0x5dfd7e,_0x7ac6bd){return _0x5dfd7e[_0xa885('0xa')](_0xa885('0xb'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9ac1a58..094590f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x2652e9,_0x1b1faa){var _0x30652e=function(_0x4d8edf){while(--_0x4d8edf){_0x2652e9['push'](_0x2652e9['shift']());}};_0x30652e(++_0x1b1faa);}(_0xaa88,0x137));var _0x8aa8=function(_0x2cc594,_0x4d727b){_0x2cc594=_0x2cc594-0x0;var _0x4abff7=_0xaa88[_0x2cc594];return _0x4abff7;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});}
\ No newline at end of file
+var _0x70e0=['code','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1e2e9f,_0x2c71d1){var _0x59c2a2=function(_0xa7bb6c){while(--_0xa7bb6c){_0x1e2e9f['push'](_0x1e2e9f['shift']());}};_0x59c2a2(++_0x2c71d1);}(_0x70e0,0x17b));var _0x070e=function(_0x1b3a0d,_0xc0ed87){_0x1b3a0d=_0x1b3a0d-0x0;var _0x580ae2=_0x70e0[_0x1b3a0d];return _0x580ae2;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});}
\ No newline at end of file
index d45ce50..a9eff10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf95e=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','post','/:id','update','destroy','exports','multer','util'];(function(_0x81ec17,_0x592c0c){var _0x100bc1=function(_0x5e22da){while(--_0x5e22da){_0x81ec17['push'](_0x81ec17['shift']());}};_0x100bc1(++_0x592c0c);}(_0xf95e,0x18a));var _0xef95=function(_0x5628cd,_0x45a88a){_0x5628cd=_0x5628cd-0x0;var _0x57d6d6=_0xf95e[_0x5628cd];return _0x57d6d6;};'use strict';var multer=require(_0xef95('0x0'));var util=require(_0xef95('0x1'));var path=require(_0xef95('0x2'));var timeout=require(_0xef95('0x3'));var express=require('express');var router=express[_0xef95('0x4')]();var fs_extra=require(_0xef95('0x5'));var auth=require(_0xef95('0x6'));var interaction=require(_0xef95('0x7'));var config=require(_0xef95('0x8'));var controller=require('./jscriptyQuestionReport.controller');router[_0xef95('0x9')]('/',auth[_0xef95('0xa')](),controller[_0xef95('0xb')]);router[_0xef95('0x9')](_0xef95('0xc'),auth[_0xef95('0xa')](),controller['describe']);router[_0xef95('0x9')]('/:id',auth[_0xef95('0xa')](),controller['show']);router[_0xef95('0xd')]('/',auth[_0xef95('0xa')](),controller['create']);router['put'](_0xef95('0xe'),auth[_0xef95('0xa')](),controller[_0xef95('0xf')]);router['delete'](_0xef95('0xe'),auth[_0xef95('0xa')](),controller[_0xef95('0x10')]);module[_0xef95('0x11')]=router;
\ No newline at end of file
+var _0x65f4=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','express'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x65f4,0x1a1));var _0x465f=function(_0x24d725,_0x5ac0f3){_0x24d725=_0x24d725-0x0;var _0x529dac=_0x65f4[_0x24d725];return _0x529dac;};'use strict';var multer=require('multer');var util=require(_0x465f('0x0'));var path=require(_0x465f('0x1'));var timeout=require('connect-timeout');var express=require(_0x465f('0x2'));var router=express['Router']();var fs_extra=require(_0x465f('0x3'));var auth=require(_0x465f('0x4'));var interaction=require(_0x465f('0x5'));var config=require(_0x465f('0x6'));var controller=require(_0x465f('0x7'));router[_0x465f('0x8')]('/',auth[_0x465f('0x9')](),controller['index']);router[_0x465f('0x8')]('/describe',auth[_0x465f('0x9')](),controller[_0x465f('0xa')]);router[_0x465f('0x8')](_0x465f('0xb'),auth[_0x465f('0x9')](),controller[_0x465f('0xc')]);router[_0x465f('0xd')]('/',auth[_0x465f('0x9')](),controller[_0x465f('0xe')]);router[_0x465f('0xf')](_0x465f('0xb'),auth[_0x465f('0x9')](),controller[_0x465f('0x10')]);router[_0x465f('0x11')](_0x465f('0xb'),auth['isAuthenticated'](),controller[_0x465f('0x12')]);module[_0x465f('0x13')]=router;
\ No newline at end of file
index 8144628..6ec3ffb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x7a54,0x106));var _0x47a5=function(_0x54fc0d,_0x4514dc){_0x54fc0d=_0x54fc0d-0x0;var _0x1cad96=_0x7a54[_0x54fc0d];return _0x1cad96;};'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(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x7a54,0x106));var _0x47a5=function(_0x3aeedb,_0x1166d7){_0x3aeedb=_0x3aeedb-0x0;var _0x26e0cd=_0x7a54[_0x3aeedb];return _0x26e0cd;};'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 f284518..b376d1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3d8=['query','intersection','attributes','fields','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','catch','params','length','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model'];(function(_0x3659e0,_0x364f9a){var _0x21d0ab=function(_0x2efd4f){while(--_0x2efd4f){_0x3659e0['push'](_0x3659e0['shift']());}};_0x21d0ab(++_0x364f9a);}(_0xf3d8,0x198));var _0x8f3d=function(_0x9d1e6b,_0x3bdc22){_0x9d1e6b=_0x9d1e6b-0x0;var _0x2b3070=_0xf3d8[_0x9d1e6b];return _0x2b3070;};'use strict';var emlformat=require(_0x8f3d('0x0'));var rimraf=require(_0x8f3d('0x1'));var zipdir=require(_0x8f3d('0x2'));var jsonpatch=require(_0x8f3d('0x3'));var rp=require(_0x8f3d('0x4'));var moment=require(_0x8f3d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8f3d('0x6'));var util=require('util');var path=require(_0x8f3d('0x7'));var sox=require(_0x8f3d('0x8'));var csv=require(_0x8f3d('0x9'));var ejs=require(_0x8f3d('0xa'));var fs=require('fs');var fs_extra=require(_0x8f3d('0xb'));var _=require(_0x8f3d('0xc'));var squel=require(_0x8f3d('0xd'));var crypto=require(_0x8f3d('0xe'));var jsforce=require(_0x8f3d('0xf'));var deskjs=require(_0x8f3d('0x10'));var toCsv=require(_0x8f3d('0x9'));var querystring=require(_0x8f3d('0x11'));var Papa=require(_0x8f3d('0x12'));var Redis=require(_0x8f3d('0x13'));var authService=require(_0x8f3d('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x8f3d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8f3d('0x16'));var utils=require(_0x8f3d('0x17'));var config=require(_0x8f3d('0x18'));var licenseUtil=require(_0x8f3d('0x19'));var db=require(_0x8f3d('0x1a'))['db'];function respondWithStatusCode(_0x14ffd9,_0x55129c){_0x55129c=_0x55129c||0xcc;return function(_0x8ec7b4){if(_0x8ec7b4){return _0x14ffd9['sendStatus'](_0x55129c);}return _0x14ffd9[_0x8f3d('0x1b')](_0x55129c)[_0x8f3d('0x1c')]();};}function respondWithResult(_0x1926d1,_0x1839d3){_0x1839d3=_0x1839d3||0xc8;return function(_0x297664){if(_0x297664){return _0x1926d1[_0x8f3d('0x1b')](_0x1839d3)[_0x8f3d('0x1d')](_0x297664);}};}function respondWithFilteredResult(_0x148663,_0x4aeeea){return function(_0x313581){if(_0x313581){var _0x2de542=typeof _0x4aeeea['offset']===_0x8f3d('0x1e')&&typeof _0x4aeeea[_0x8f3d('0x1f')]==='undefined';var _0x1acbf6=_0x313581[_0x8f3d('0x20')];var _0x1e86e4=_0x2de542?0x0:_0x4aeeea['offset'];var _0x2327a9=_0x2de542?_0x313581['count']:_0x4aeeea[_0x8f3d('0x21')]+_0x4aeeea[_0x8f3d('0x1f')];var _0x563805;if(_0x2327a9>=_0x1acbf6){_0x2327a9=_0x1acbf6;_0x563805=0xc8;}else{_0x563805=0xce;}_0x148663[_0x8f3d('0x1b')](_0x563805);return _0x148663[_0x8f3d('0x22')](_0x8f3d('0x23'),_0x1e86e4+'-'+_0x2327a9+'/'+_0x1acbf6)['json'](_0x313581);}return null;};}function patchUpdates(_0x2ccf21){return function(_0x13df52){try{jsonpatch['apply'](_0x13df52,_0x2ccf21,!![]);}catch(_0x2d5d56){return BPromise[_0x8f3d('0x24')](_0x2d5d56);}return _0x13df52[_0x8f3d('0x25')]();};}function saveUpdates(_0x639d3a,_0x5bae8c){return function(_0x5491da){if(_0x5491da){return _0x5491da[_0x8f3d('0x26')](_0x639d3a)[_0x8f3d('0x27')](function(_0xe887eb){return _0xe887eb;});}return null;};}function removeEntity(_0x6d40ec,_0x5e51f8){return function(_0x110b4b){if(_0x110b4b){return _0x110b4b[_0x8f3d('0x28')]()[_0x8f3d('0x27')](function(){_0x6d40ec[_0x8f3d('0x1b')](0xcc)[_0x8f3d('0x1c')]();});}};}function handleEntityNotFound(_0x4ebedf,_0x2643bf){return function(_0x576962){if(!_0x576962){_0x4ebedf[_0x8f3d('0x29')](0x194);}return _0x576962;};}function handleError(_0x4eb021,_0xb5aeef){_0xb5aeef=_0xb5aeef||0x1f4;return function(_0x137682){logger[_0x8f3d('0x2a')](_0x137682[_0x8f3d('0x2b')]);if(_0x137682[_0x8f3d('0x2c')]){delete _0x137682[_0x8f3d('0x2c')];}_0x4eb021[_0x8f3d('0x1b')](_0xb5aeef)[_0x8f3d('0x2d')](_0x137682);};}exports[_0x8f3d('0x2e')]=function(_0x439260,_0x1eeb5b){var _0x2888c3={},_0x3482a9={},_0x12e812={'count':0x0,'rows':[]};var _0x39211a=_[_0x8f3d('0x2f')](db[_0x8f3d('0x30')][_0x8f3d('0x31')],function(_0x511c50){return{'name':_0x511c50[_0x8f3d('0x32')],'type':_0x511c50[_0x8f3d('0x33')][_0x8f3d('0x34')]};});_0x3482a9[_0x8f3d('0x35')]=_[_0x8f3d('0x2f')](_0x39211a,_0x8f3d('0x2c'));_0x3482a9['query']=_['keys'](_0x439260[_0x8f3d('0x36')]);_0x3482a9['filters']=_[_0x8f3d('0x37')](_0x3482a9[_0x8f3d('0x35')],_0x3482a9[_0x8f3d('0x36')]);_0x2888c3[_0x8f3d('0x38')]=_['intersection'](_0x3482a9['model'],qs[_0x8f3d('0x39')](_0x439260['query']['fields']));_0x2888c3[_0x8f3d('0x38')]=_0x2888c3[_0x8f3d('0x38')]['length']?_0x2888c3[_0x8f3d('0x38')]:_0x3482a9[_0x8f3d('0x35')];if(!_0x439260[_0x8f3d('0x36')]['hasOwnProperty'](_0x8f3d('0x3a'))){_0x2888c3[_0x8f3d('0x1f')]=qs[_0x8f3d('0x1f')](_0x439260[_0x8f3d('0x36')][_0x8f3d('0x1f')]);_0x2888c3[_0x8f3d('0x21')]=qs['offset'](_0x439260[_0x8f3d('0x36')][_0x8f3d('0x21')]);}_0x2888c3[_0x8f3d('0x3b')]=qs[_0x8f3d('0x3c')](_0x439260[_0x8f3d('0x36')]['sort']);_0x2888c3[_0x8f3d('0x3d')]=qs[_0x8f3d('0x3e')](_['pick'](_0x439260['query'],_0x3482a9['filters']),_0x39211a);if(_0x439260['query'][_0x8f3d('0x3f')]){_0x2888c3[_0x8f3d('0x3d')]=_[_0x8f3d('0x40')](_0x2888c3[_0x8f3d('0x3d')],{'$or':_['map'](_0x39211a,function(_0x5e95c5){if(_0x5e95c5[_0x8f3d('0x33')]!==_0x8f3d('0x41')){var _0xae3156={};_0xae3156[_0x5e95c5[_0x8f3d('0x2c')]]={'$like':'%'+_0x439260[_0x8f3d('0x36')]['filter']+'%'};return _0xae3156;}})});}_0x2888c3=_[_0x8f3d('0x40')]({},_0x2888c3,_0x439260[_0x8f3d('0x42')]);var _0x5920e3={'where':_0x2888c3[_0x8f3d('0x3d')]};return db[_0x8f3d('0x30')][_0x8f3d('0x20')](_0x5920e3)[_0x8f3d('0x27')](function(_0xc8d88b){_0x12e812[_0x8f3d('0x20')]=_0xc8d88b;if(_0x439260[_0x8f3d('0x36')]['includeAll']){_0x2888c3[_0x8f3d('0x43')]=[{'all':!![]}];}return db[_0x8f3d('0x30')][_0x8f3d('0x44')](_0x2888c3);})['then'](function(_0x4bc5ae){_0x12e812['rows']=_0x4bc5ae;return _0x12e812;})[_0x8f3d('0x27')](respondWithFilteredResult(_0x1eeb5b,_0x2888c3))[_0x8f3d('0x45')](handleError(_0x1eeb5b,null));};exports['show']=function(_0x5cc458,_0x999bb4){var _0x34b6f2={'raw':!![],'where':{'id':_0x5cc458[_0x8f3d('0x46')]['id']}},_0x3c49db={};_0x3c49db[_0x8f3d('0x35')]=_['keys'](db[_0x8f3d('0x30')]['rawAttributes']);_0x3c49db['query']=_['keys'](_0x5cc458[_0x8f3d('0x36')]);_0x3c49db[_0x8f3d('0x3e')]=_[_0x8f3d('0x37')](_0x3c49db[_0x8f3d('0x35')],_0x3c49db['query']);_0x34b6f2[_0x8f3d('0x38')]=_[_0x8f3d('0x37')](_0x3c49db[_0x8f3d('0x35')],qs['fields'](_0x5cc458['query']['fields']));_0x34b6f2[_0x8f3d('0x38')]=_0x34b6f2[_0x8f3d('0x38')][_0x8f3d('0x47')]?_0x34b6f2[_0x8f3d('0x38')]:_0x3c49db[_0x8f3d('0x35')];if(_0x5cc458[_0x8f3d('0x36')][_0x8f3d('0x48')]){_0x34b6f2[_0x8f3d('0x43')]=[{'all':!![]}];}_0x34b6f2=_[_0x8f3d('0x40')]({},_0x34b6f2,_0x5cc458['options']);return db[_0x8f3d('0x30')]['find'](_0x34b6f2)[_0x8f3d('0x27')](handleEntityNotFound(_0x999bb4,null))[_0x8f3d('0x27')](respondWithResult(_0x999bb4,null))[_0x8f3d('0x45')](handleError(_0x999bb4,null));};exports[_0x8f3d('0x49')]=function(_0x20685f,_0x16b21c){return db[_0x8f3d('0x30')][_0x8f3d('0x49')](_0x20685f[_0x8f3d('0x4a')],{})[_0x8f3d('0x27')](respondWithResult(_0x16b21c,0xc9))['catch'](handleError(_0x16b21c,null));};exports['update']=function(_0xaa0b72,_0x43eb5a){if(_0xaa0b72[_0x8f3d('0x4a')]['id']){delete _0xaa0b72[_0x8f3d('0x4a')]['id'];}return db[_0x8f3d('0x30')][_0x8f3d('0x4b')]({'where':{'id':_0xaa0b72['params']['id']}})[_0x8f3d('0x27')](handleEntityNotFound(_0x43eb5a,null))['then'](saveUpdates(_0xaa0b72[_0x8f3d('0x4a')],null))[_0x8f3d('0x27')](respondWithResult(_0x43eb5a,null))[_0x8f3d('0x45')](handleError(_0x43eb5a,null));};exports[_0x8f3d('0x28')]=function(_0x1f8111,_0x151888){return db[_0x8f3d('0x30')][_0x8f3d('0x4b')]({'where':{'id':_0x1f8111[_0x8f3d('0x46')]['id']}})[_0x8f3d('0x27')](handleEntityNotFound(_0x151888,null))['then'](removeEntity(_0x151888,null))[_0x8f3d('0x45')](handleError(_0x151888,null));};exports[_0x8f3d('0x4c')]=function(_0x3a926f,_0x3e0cd3){return db['JscriptyQuestionReport'][_0x8f3d('0x4c')]()['then'](respondWithResult(_0x3e0cd3,null))[_0x8f3d('0x45')](handleError(_0x3e0cd3,null));};
\ No newline at end of file
+var _0x8a2b=['merge','options','includeAll','findAll','rows','catch','params','include','find','create','body','describe','eml-format','rimraf','zip-dir','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8a2b,0x9c));var _0xb8a2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a2b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb8a2('0x0'));var rimraf=require(_0xb8a2('0x1'));var zipdir=require(_0xb8a2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb8a2('0x3'));var Mustache=require('mustache');var util=require(_0xb8a2('0x4'));var path=require(_0xb8a2('0x5'));var sox=require(_0xb8a2('0x6'));var csv=require(_0xb8a2('0x7'));var ejs=require(_0xb8a2('0x8'));var fs=require('fs');var fs_extra=require(_0xb8a2('0x9'));var _=require(_0xb8a2('0xa'));var squel=require(_0xb8a2('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb8a2('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb8a2('0xd'));var Papa=require('papaparse');var Redis=require(_0xb8a2('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb8a2('0xf'));var as=require(_0xb8a2('0x10'));var hardwareService=require(_0xb8a2('0x11'));var logger=require(_0xb8a2('0x12'))(_0xb8a2('0x13'));var utils=require(_0xb8a2('0x14'));var config=require(_0xb8a2('0x15'));var licenseUtil=require(_0xb8a2('0x16'));var db=require(_0xb8a2('0x17'))['db'];function respondWithStatusCode(_0x2e7232,_0x115439){_0x115439=_0x115439||0xcc;return function(_0x3a3e70){if(_0x3a3e70){return _0x2e7232['sendStatus'](_0x115439);}return _0x2e7232['status'](_0x115439)['end']();};}function respondWithResult(_0x196bb9,_0x2276d1){_0x2276d1=_0x2276d1||0xc8;return function(_0x20db06){if(_0x20db06){return _0x196bb9[_0xb8a2('0x18')](_0x2276d1)[_0xb8a2('0x19')](_0x20db06);}};}function respondWithFilteredResult(_0x372de4,_0x4c01aa){return function(_0x13230e){if(_0x13230e){var _0x6c66ca=typeof _0x4c01aa[_0xb8a2('0x1a')]===_0xb8a2('0x1b')&&typeof _0x4c01aa[_0xb8a2('0x1c')]===_0xb8a2('0x1b');var _0x4517e4=_0x13230e[_0xb8a2('0x1d')];var _0x2c9332=_0x6c66ca?0x0:_0x4c01aa[_0xb8a2('0x1a')];var _0x3e4501=_0x6c66ca?_0x13230e[_0xb8a2('0x1d')]:_0x4c01aa[_0xb8a2('0x1a')]+_0x4c01aa[_0xb8a2('0x1c')];var _0x236752;if(_0x3e4501>=_0x4517e4){_0x3e4501=_0x4517e4;_0x236752=0xc8;}else{_0x236752=0xce;}_0x372de4[_0xb8a2('0x18')](_0x236752);return _0x372de4[_0xb8a2('0x1e')]('Content-Range',_0x2c9332+'-'+_0x3e4501+'/'+_0x4517e4)[_0xb8a2('0x19')](_0x13230e);}return null;};}function patchUpdates(_0x5e0bca){return function(_0x1f7fec){try{jsonpatch[_0xb8a2('0x1f')](_0x1f7fec,_0x5e0bca,!![]);}catch(_0x98677d){return BPromise[_0xb8a2('0x20')](_0x98677d);}return _0x1f7fec[_0xb8a2('0x21')]();};}function saveUpdates(_0x514475,_0x1f1535){return function(_0x5598dd){if(_0x5598dd){return _0x5598dd[_0xb8a2('0x22')](_0x514475)[_0xb8a2('0x23')](function(_0x3034e6){return _0x3034e6;});}return null;};}function removeEntity(_0x297ad9,_0x1af360){return function(_0x3d6db0){if(_0x3d6db0){return _0x3d6db0['destroy']()[_0xb8a2('0x23')](function(){_0x297ad9[_0xb8a2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34334d,_0x817bfb){return function(_0x2a1d7a){if(!_0x2a1d7a){_0x34334d['sendStatus'](0x194);}return _0x2a1d7a;};}function handleError(_0x27741a,_0x742e01){_0x742e01=_0x742e01||0x1f4;return function(_0x5b677d){logger[_0xb8a2('0x24')](_0x5b677d[_0xb8a2('0x25')]);if(_0x5b677d[_0xb8a2('0x26')]){delete _0x5b677d[_0xb8a2('0x26')];}_0x27741a[_0xb8a2('0x18')](_0x742e01)[_0xb8a2('0x27')](_0x5b677d);};}exports[_0xb8a2('0x28')]=function(_0x5ad119,_0x5c36dd){var _0x5838d5={},_0x57dd41={},_0x10fd76={'count':0x0,'rows':[]};var _0x49bcc3=_[_0xb8a2('0x29')](db[_0xb8a2('0x2a')][_0xb8a2('0x2b')],function(_0x3981e1){return{'name':_0x3981e1['fieldName'],'type':_0x3981e1[_0xb8a2('0x2c')]['key']};});_0x57dd41[_0xb8a2('0x2d')]=_[_0xb8a2('0x29')](_0x49bcc3,_0xb8a2('0x26'));_0x57dd41[_0xb8a2('0x2e')]=_[_0xb8a2('0x2f')](_0x5ad119[_0xb8a2('0x2e')]);_0x57dd41[_0xb8a2('0x30')]=_[_0xb8a2('0x31')](_0x57dd41[_0xb8a2('0x2d')],_0x57dd41['query']);_0x5838d5[_0xb8a2('0x32')]=_[_0xb8a2('0x31')](_0x57dd41[_0xb8a2('0x2d')],qs[_0xb8a2('0x33')](_0x5ad119[_0xb8a2('0x2e')][_0xb8a2('0x33')]));_0x5838d5[_0xb8a2('0x32')]=_0x5838d5[_0xb8a2('0x32')][_0xb8a2('0x34')]?_0x5838d5[_0xb8a2('0x32')]:_0x57dd41[_0xb8a2('0x2d')];if(!_0x5ad119[_0xb8a2('0x2e')][_0xb8a2('0x35')](_0xb8a2('0x36'))){_0x5838d5['limit']=qs[_0xb8a2('0x1c')](_0x5ad119[_0xb8a2('0x2e')][_0xb8a2('0x1c')]);_0x5838d5[_0xb8a2('0x1a')]=qs[_0xb8a2('0x1a')](_0x5ad119[_0xb8a2('0x2e')][_0xb8a2('0x1a')]);}_0x5838d5[_0xb8a2('0x37')]=qs['sort'](_0x5ad119['query']['sort']);_0x5838d5[_0xb8a2('0x38')]=qs[_0xb8a2('0x30')](_[_0xb8a2('0x39')](_0x5ad119[_0xb8a2('0x2e')],_0x57dd41[_0xb8a2('0x30')]),_0x49bcc3);if(_0x5ad119[_0xb8a2('0x2e')][_0xb8a2('0x3a')]){_0x5838d5['where']=_['merge'](_0x5838d5[_0xb8a2('0x38')],{'$or':_[_0xb8a2('0x29')](_0x49bcc3,function(_0x5b152b){if(_0x5b152b[_0xb8a2('0x2c')]!==_0xb8a2('0x3b')){var _0x5cd70f={};_0x5cd70f[_0x5b152b[_0xb8a2('0x26')]]={'$like':'%'+_0x5ad119[_0xb8a2('0x2e')][_0xb8a2('0x3a')]+'%'};return _0x5cd70f;}})});}_0x5838d5=_[_0xb8a2('0x3c')]({},_0x5838d5,_0x5ad119[_0xb8a2('0x3d')]);var _0x1892d1={'where':_0x5838d5[_0xb8a2('0x38')]};return db[_0xb8a2('0x2a')][_0xb8a2('0x1d')](_0x1892d1)[_0xb8a2('0x23')](function(_0x542c13){_0x10fd76['count']=_0x542c13;if(_0x5ad119[_0xb8a2('0x2e')][_0xb8a2('0x3e')]){_0x5838d5['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xb8a2('0x3f')](_0x5838d5);})[_0xb8a2('0x23')](function(_0x4f369c){_0x10fd76[_0xb8a2('0x40')]=_0x4f369c;return _0x10fd76;})['then'](respondWithFilteredResult(_0x5c36dd,_0x5838d5))[_0xb8a2('0x41')](handleError(_0x5c36dd,null));};exports['show']=function(_0x13281c,_0x4358ba){var _0x502336={'raw':!![],'where':{'id':_0x13281c[_0xb8a2('0x42')]['id']}},_0x1f57a5={};_0x1f57a5['model']=_[_0xb8a2('0x2f')](db[_0xb8a2('0x2a')][_0xb8a2('0x2b')]);_0x1f57a5['query']=_['keys'](_0x13281c[_0xb8a2('0x2e')]);_0x1f57a5[_0xb8a2('0x30')]=_[_0xb8a2('0x31')](_0x1f57a5[_0xb8a2('0x2d')],_0x1f57a5[_0xb8a2('0x2e')]);_0x502336['attributes']=_['intersection'](_0x1f57a5['model'],qs['fields'](_0x13281c[_0xb8a2('0x2e')]['fields']));_0x502336[_0xb8a2('0x32')]=_0x502336[_0xb8a2('0x32')]['length']?_0x502336[_0xb8a2('0x32')]:_0x1f57a5[_0xb8a2('0x2d')];if(_0x13281c[_0xb8a2('0x2e')][_0xb8a2('0x3e')]){_0x502336[_0xb8a2('0x43')]=[{'all':!![]}];}_0x502336=_[_0xb8a2('0x3c')]({},_0x502336,_0x13281c[_0xb8a2('0x3d')]);return db[_0xb8a2('0x2a')][_0xb8a2('0x44')](_0x502336)[_0xb8a2('0x23')](handleEntityNotFound(_0x4358ba,null))[_0xb8a2('0x23')](respondWithResult(_0x4358ba,null))[_0xb8a2('0x41')](handleError(_0x4358ba,null));};exports[_0xb8a2('0x45')]=function(_0x2dcbd9,_0x1cef04){return db[_0xb8a2('0x2a')]['create'](_0x2dcbd9[_0xb8a2('0x46')],{})[_0xb8a2('0x23')](respondWithResult(_0x1cef04,0xc9))['catch'](handleError(_0x1cef04,null));};exports[_0xb8a2('0x22')]=function(_0x514da4,_0x555bc1){if(_0x514da4['body']['id']){delete _0x514da4['body']['id'];}return db[_0xb8a2('0x2a')][_0xb8a2('0x44')]({'where':{'id':_0x514da4[_0xb8a2('0x42')]['id']}})[_0xb8a2('0x23')](handleEntityNotFound(_0x555bc1,null))[_0xb8a2('0x23')](saveUpdates(_0x514da4[_0xb8a2('0x46')],null))[_0xb8a2('0x23')](respondWithResult(_0x555bc1,null))[_0xb8a2('0x41')](handleError(_0x555bc1,null));};exports['destroy']=function(_0x203d98,_0x1438b4){return db[_0xb8a2('0x2a')][_0xb8a2('0x44')]({'where':{'id':_0x203d98[_0xb8a2('0x42')]['id']}})['then'](handleEntityNotFound(_0x1438b4,null))[_0xb8a2('0x23')](removeEntity(_0x1438b4,null))[_0xb8a2('0x41')](handleError(_0x1438b4,null));};exports[_0xb8a2('0x47')]=function(_0x48157d,_0x3145eb){return db[_0xb8a2('0x2a')][_0xb8a2('0x47')]()[_0xb8a2('0x23')](respondWithResult(_0x3145eb,null))[_0xb8a2('0x41')](handleError(_0x3145eb,null));};
\ No newline at end of file
index 35fd882..429d3b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0dcb=['./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x4f3f85,_0x537743){var _0x33b1bc=function(_0x2ba2cf){while(--_0x2ba2cf){_0x4f3f85['push'](_0x4f3f85['shift']());}};_0x33b1bc(++_0x537743);}(_0x0dcb,0x100));var _0xb0dc=function(_0x3eb435,_0x3be1e3){_0x3eb435=_0x3eb435-0x0;var _0x42203d=_0x0dcb[_0x3eb435];return _0x42203d;};'use strict';var _=require(_0xb0dc('0x0'));var util=require(_0xb0dc('0x1'));var logger=require(_0xb0dc('0x2'))(_0xb0dc('0x3'));var moment=require(_0xb0dc('0x4'));var BPromise=require(_0xb0dc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb0dc('0x6'));var rimraf=require('rimraf');var config=require(_0xb0dc('0x7'));var attributes=require(_0xb0dc('0x8'));module['exports']=function(_0x2feb8e,_0x23d5b1){return _0x2feb8e[_0xb0dc('0x9')](_0xb0dc('0xa'),attributes,{'tableName':_0xb0dc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x720a=['util','../../config/logger','moment','bluebird','request-promise','../../config/environment','exports','define','JscriptyQuestionReport','report_jscripty_questions'];(function(_0x475923,_0x25d9ec){var _0x374030=function(_0x3f256b){while(--_0x3f256b){_0x475923['push'](_0x475923['shift']());}};_0x374030(++_0x25d9ec);}(_0x720a,0xbe));var _0xa720=function(_0x3f9810,_0x51f178){_0x3f9810=_0x3f9810-0x0;var _0x792109=_0x720a[_0x3f9810];return _0x792109;};'use strict';var _=require('lodash');var util=require(_0xa720('0x0'));var logger=require(_0xa720('0x1'))('api');var moment=require(_0xa720('0x2'));var BPromise=require(_0xa720('0x3'));var rp=require(_0xa720('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa720('0x5'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0xa720('0x6')]=function(_0x2e6442,_0x3fdef9){return _0x2e6442[_0xa720('0x7')](_0xa720('0x8'),attributes,{'tableName':_0xa720('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5c9a1a3..4700037 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6802=['message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x10e057,_0x260324){var _0x2eb129=function(_0x9b7422){while(--_0x9b7422){_0x10e057['push'](_0x10e057['shift']());}};_0x2eb129(++_0x260324);}(_0x6802,0x1b9));var _0x2680=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x6802[_0xdc37a1];return _0x99b4fe;};'use strict';var _=require('lodash');var util=require(_0x2680('0x0'));var moment=require(_0x2680('0x1'));var BPromise=require(_0x2680('0x2'));var rs=require(_0x2680('0x3'));var fs=require('fs');var Redis=require(_0x2680('0x4'));var db=require(_0x2680('0x5'))['db'];var utils=require(_0x2680('0x6'));var logger=require(_0x2680('0x7'))(_0x2680('0x8'));var config=require(_0x2680('0x9'));var jayson=require(_0x2680('0xa'));var client=jayson[_0x2680('0xb')][_0x2680('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xad611f,_0x5111e5,_0x57d025){return new BPromise(function(_0x4d28ec,_0x2733ac){return client[_0x2680('0xd')](_0xad611f,_0x57d025)[_0x2680('0xe')](function(_0x497321){logger['info'](_0x2680('0xf'),_0x5111e5,_0x2680('0x10'));logger['debug'](_0x2680('0x11'),_0x5111e5,_0x2680('0x10'),JSON['stringify'](_0x497321));if(_0x497321['error']){if(_0x497321[_0x2680('0x12')]['code']===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x5111e5,_0x497321[_0x2680('0x12')]['message']);return _0x2733ac(_0x497321[_0x2680('0x12')][_0x2680('0x13')]);}logger[_0x2680('0x12')](_0x2680('0xf'),_0x5111e5,_0x497321['error']['message']);return _0x4d28ec(_0x497321[_0x2680('0x12')][_0x2680('0x13')]);}else{logger[_0x2680('0x14')](_0x2680('0xf'),_0x5111e5,'request\x20sent');_0x4d28ec(_0x497321[_0x2680('0x15')]['message']);}})[_0x2680('0x16')](function(_0x18d62c){logger[_0x2680('0x12')](_0x2680('0xf'),_0x5111e5,_0x18d62c);_0x2733ac(_0x18d62c);});});}
\ No newline at end of file
+var _0x9f32=['message','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s'];(function(_0x2a92e1,_0x1efc55){var _0x160ba3=function(_0x236722){while(--_0x236722){_0x2a92e1['push'](_0x2a92e1['shift']());}};_0x160ba3(++_0x1efc55);}(_0x9f32,0x177));var _0x29f3=function(_0x6d908d,_0x4006a8){_0x6d908d=_0x6d908d-0x0;var _0x31259b=_0x9f32[_0x6d908d];return _0x31259b;};'use strict';var _=require(_0x29f3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x29f3('0x1'));var rs=require(_0x29f3('0x2'));var fs=require('fs');var Redis=require(_0x29f3('0x3'));var db=require(_0x29f3('0x4'))['db'];var utils=require(_0x29f3('0x5'));var logger=require('../../config/logger')(_0x29f3('0x6'));var config=require(_0x29f3('0x7'));var jayson=require(_0x29f3('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xad1632,_0x45899f,_0x417563){return new BPromise(function(_0x61ac5a,_0x2b7d7c){return client[_0x29f3('0x9')](_0xad1632,_0x417563)['then'](function(_0x3e88de){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x45899f,_0x29f3('0xa'));logger['debug'](_0x29f3('0xb'),_0x45899f,_0x29f3('0xa'),JSON[_0x29f3('0xc')](_0x3e88de));if(_0x3e88de[_0x29f3('0xd')]){if(_0x3e88de['error'][_0x29f3('0xe')]===0x1f4){logger[_0x29f3('0xd')](_0x29f3('0xf'),_0x45899f,_0x3e88de['error'][_0x29f3('0x10')]);return _0x2b7d7c(_0x3e88de[_0x29f3('0xd')]['message']);}logger[_0x29f3('0xd')](_0x29f3('0xf'),_0x45899f,_0x3e88de[_0x29f3('0xd')][_0x29f3('0x10')]);return _0x61ac5a(_0x3e88de['error'][_0x29f3('0x10')]);}else{logger['info'](_0x29f3('0xf'),_0x45899f,_0x29f3('0xa'));_0x61ac5a(_0x3e88de['result'][_0x29f3('0x10')]);}})['catch'](function(_0x58f6eb){logger[_0x29f3('0xd')](_0x29f3('0xf'),_0x45899f,_0x58f6eb);_0x2b7d7c(_0x58f6eb);});});}
\ No newline at end of file
index 099b02f..91707c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x148a=['describe','/:id','show','/:id/questions','getQuestions','post','create','put','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptySessionReport.controller','get','/describe','isAuthenticated'];(function(_0x42f437,_0x3fa40e){var _0x1ff49a=function(_0x286dbf){while(--_0x286dbf){_0x42f437['push'](_0x42f437['shift']());}};_0x1ff49a(++_0x3fa40e);}(_0x148a,0xe6));var _0xa148=function(_0x245323,_0x3bf64d){_0x245323=_0x245323-0x0;var _0x5c2ba4=_0x148a[_0x245323];return _0x5c2ba4;};'use strict';var multer=require('multer');var util=require(_0xa148('0x0'));var path=require(_0xa148('0x1'));var timeout=require(_0xa148('0x2'));var express=require(_0xa148('0x3'));var router=express[_0xa148('0x4')]();var fs_extra=require(_0xa148('0x5'));var auth=require(_0xa148('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa148('0x7'));var controller=require(_0xa148('0x8'));router[_0xa148('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa148('0x9')](_0xa148('0xa'),auth[_0xa148('0xb')](),controller[_0xa148('0xc')]);router[_0xa148('0x9')](_0xa148('0xd'),auth[_0xa148('0xb')](),controller[_0xa148('0xe')]);router[_0xa148('0x9')](_0xa148('0xf'),auth[_0xa148('0xb')](),controller[_0xa148('0x10')]);router[_0xa148('0x11')]('/',auth['isAuthenticated'](),controller[_0xa148('0x12')]);router[_0xa148('0x13')](_0xa148('0xd'),auth[_0xa148('0xb')](),controller['update']);router['delete'](_0xa148('0xd'),auth[_0xa148('0xb')](),controller[_0xa148('0x14')]);module[_0xa148('0x15')]=router;
\ No newline at end of file
+var _0x6592=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','index','/describe','/:id','isAuthenticated','show','/:id/questions','getQuestions','create','put','update','delete','exports','multer','util'];(function(_0x68bfc4,_0xcf9a9b){var _0x29d307=function(_0x24026c){while(--_0x24026c){_0x68bfc4['push'](_0x68bfc4['shift']());}};_0x29d307(++_0xcf9a9b);}(_0x6592,0xb6));var _0x2659=function(_0x1a526a,_0x3f1a43){_0x1a526a=_0x1a526a-0x0;var _0x355d5f=_0x6592[_0x1a526a];return _0x355d5f;};'use strict';var multer=require(_0x2659('0x0'));var util=require(_0x2659('0x1'));var path=require(_0x2659('0x2'));var timeout=require('connect-timeout');var express=require(_0x2659('0x3'));var router=express[_0x2659('0x4')]();var fs_extra=require(_0x2659('0x5'));var auth=require(_0x2659('0x6'));var interaction=require(_0x2659('0x7'));var config=require(_0x2659('0x8'));var controller=require(_0x2659('0x9'));router[_0x2659('0xa')]('/',auth['isAuthenticated'](),controller[_0x2659('0xb')]);router[_0x2659('0xa')](_0x2659('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x2659('0xa')](_0x2659('0xd'),auth[_0x2659('0xe')](),controller[_0x2659('0xf')]);router[_0x2659('0xa')](_0x2659('0x10'),auth[_0x2659('0xe')](),controller[_0x2659('0x11')]);router['post']('/',auth[_0x2659('0xe')](),controller[_0x2659('0x12')]);router[_0x2659('0x13')](_0x2659('0xd'),auth[_0x2659('0xe')](),controller[_0x2659('0x14')]);router[_0x2659('0x15')]('/:id',auth[_0x2659('0xe')](),controller['destroy']);module[_0x2659('0x16')]=router;
\ No newline at end of file
index 6ca21b7..cfaeefb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf23b=['setDataValue','starttime','endtime','STRING','moment','sequelize','exports','DATE'];(function(_0x342424,_0x1fe35f){var _0xa06c9d=function(_0x44f94d){while(--_0x44f94d){_0x342424['push'](_0x342424['shift']());}};_0xa06c9d(++_0x1fe35f);}(_0xf23b,0xd4));var _0xbf23=function(_0x3d4401,_0xe99a21){_0x3d4401=_0x3d4401-0x0;var _0x454d8d=_0xf23b[_0x3d4401];return _0x454d8d;};'use strict';var moment=require(_0xbf23('0x0'));var Sequelize=require(_0xbf23('0x1'));module[_0xbf23('0x2')]={'starttime':{'type':Sequelize[_0xbf23('0x3')],'set':function(_0x4500e4){this[_0xbf23('0x4')](_0xbf23('0x5'),_0x4500e4);this[_0xbf23('0x4')](_0xbf23('0x6'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xbf23('0x7')]},'projectname':{'type':Sequelize[_0xbf23('0x7')]},'queue':{'type':Sequelize[_0xbf23('0x7')]},'uniqueid':{'type':Sequelize[_0xbf23('0x7')]},'calleridname':{'type':Sequelize[_0xbf23('0x7')]},'calleridnum':{'type':Sequelize[_0xbf23('0x7')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x976c=['setDataValue','starttime','endtime','format','STRING','BOOLEAN','moment','exports','DATE'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x976c,0x1bf));var _0xc976=function(_0x39b47c,_0x22db9f){_0x39b47c=_0x39b47c-0x0;var _0xf9c65c=_0x976c[_0x39b47c];return _0xf9c65c;};'use strict';var moment=require(_0xc976('0x0'));var Sequelize=require('sequelize');module[_0xc976('0x1')]={'starttime':{'type':Sequelize[_0xc976('0x2')],'set':function(_0x53cf34){this[_0xc976('0x3')](_0xc976('0x4'),_0x53cf34);this['setDataValue'](_0xc976('0x5'),moment()[_0xc976('0x6')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xc976('0x7')]},'queue':{'type':Sequelize[_0xc976('0x7')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc976('0x7')]},'completed':{'type':Sequelize[_0xc976('0x8')],'defaultValue':![]}};
\ No newline at end of file
index 99ff05b..34a0ab3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc183=['sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','JscriptySessionReport','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','merge','type','filter','include','findAll','rows','catch','params','keys','includeAll','options','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','SessionId','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xc183,0x1c7));var _0x3c18=function(_0x4e5249,_0x8fc71d){_0x4e5249=_0x4e5249-0x0;var _0x221f04=_0xc183[_0x4e5249];return _0x221f04;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3c18('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3c18('0x1'));var rp=require(_0x3c18('0x2'));var moment=require(_0x3c18('0x3'));var BPromise=require(_0x3c18('0x4'));var Mustache=require(_0x3c18('0x5'));var util=require(_0x3c18('0x6'));var path=require(_0x3c18('0x7'));var sox=require(_0x3c18('0x8'));var csv=require('to-csv');var ejs=require(_0x3c18('0x9'));var fs=require('fs');var fs_extra=require(_0x3c18('0xa'));var _=require(_0x3c18('0xb'));var squel=require(_0x3c18('0xc'));var crypto=require(_0x3c18('0xd'));var jsforce=require(_0x3c18('0xe'));var deskjs=require(_0x3c18('0xf'));var toCsv=require(_0x3c18('0x10'));var querystring=require('querystring');var Papa=require(_0x3c18('0x11'));var Redis=require(_0x3c18('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3c18('0x13'));var as=require(_0x3c18('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3c18('0x15'));var utils=require(_0x3c18('0x16'));var config=require(_0x3c18('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3c18('0x18'))['db'];function respondWithStatusCode(_0x3cc72c,_0x101728){_0x101728=_0x101728||0xcc;return function(_0x4b4012){if(_0x4b4012){return _0x3cc72c[_0x3c18('0x19')](_0x101728);}return _0x3cc72c[_0x3c18('0x1a')](_0x101728)[_0x3c18('0x1b')]();};}function respondWithResult(_0x3f9ff3,_0x397842){_0x397842=_0x397842||0xc8;return function(_0xd442b){if(_0xd442b){return _0x3f9ff3[_0x3c18('0x1a')](_0x397842)[_0x3c18('0x1c')](_0xd442b);}};}function respondWithFilteredResult(_0xf837d5,_0x3110c3){return function(_0x27f9f6){if(_0x27f9f6){var _0x570df6=typeof _0x3110c3[_0x3c18('0x1d')]==='undefined'&&typeof _0x3110c3['limit']===_0x3c18('0x1e');var _0x3b37dd=_0x27f9f6[_0x3c18('0x1f')];var _0x426550=_0x570df6?0x0:_0x3110c3[_0x3c18('0x1d')];var _0x4fee17=_0x570df6?_0x27f9f6[_0x3c18('0x1f')]:_0x3110c3[_0x3c18('0x1d')]+_0x3110c3['limit'];var _0x333178;if(_0x4fee17>=_0x3b37dd){_0x4fee17=_0x3b37dd;_0x333178=0xc8;}else{_0x333178=0xce;}_0xf837d5[_0x3c18('0x1a')](_0x333178);return _0xf837d5[_0x3c18('0x20')](_0x3c18('0x21'),_0x426550+'-'+_0x4fee17+'/'+_0x3b37dd)[_0x3c18('0x1c')](_0x27f9f6);}return null;};}function patchUpdates(_0x3d60e6){return function(_0x5151d9){try{jsonpatch[_0x3c18('0x22')](_0x5151d9,_0x3d60e6,!![]);}catch(_0x477f8d){return BPromise[_0x3c18('0x23')](_0x477f8d);}return _0x5151d9[_0x3c18('0x24')]();};}function saveUpdates(_0x55cf48,_0x19f6a2){return function(_0x2198ca){if(_0x2198ca){return _0x2198ca[_0x3c18('0x25')](_0x55cf48)[_0x3c18('0x26')](function(_0x72562d){return _0x72562d;});}return null;};}function removeEntity(_0x3eb368,_0xd64ec5){return function(_0x17bc91){if(_0x17bc91){return _0x17bc91[_0x3c18('0x27')]()[_0x3c18('0x26')](function(){_0x3eb368[_0x3c18('0x1a')](0xcc)[_0x3c18('0x1b')]();});}};}function handleEntityNotFound(_0xae9e3c,_0x11c916){return function(_0x1624f5){if(!_0x1624f5){_0xae9e3c['sendStatus'](0x194);}return _0x1624f5;};}function handleError(_0x4f82c9,_0x1a1128){_0x1a1128=_0x1a1128||0x1f4;return function(_0x1bbcd7){logger['error'](_0x1bbcd7[_0x3c18('0x28')]);if(_0x1bbcd7[_0x3c18('0x29')]){delete _0x1bbcd7['name'];}_0x4f82c9['status'](_0x1a1128)[_0x3c18('0x2a')](_0x1bbcd7);};}exports['index']=function(_0x4975fe,_0x512568){var _0x567495={},_0x3d5001={},_0x285a22={'count':0x0,'rows':[]};var _0x2a16fd=_[_0x3c18('0x2b')](db[_0x3c18('0x2c')][_0x3c18('0x2d')],function(_0x56705f){return{'name':_0x56705f[_0x3c18('0x2e')],'type':_0x56705f['type']['key']};});_0x3d5001[_0x3c18('0x2f')]=_[_0x3c18('0x2b')](_0x2a16fd,_0x3c18('0x29'));_0x3d5001[_0x3c18('0x30')]=_['keys'](_0x4975fe[_0x3c18('0x30')]);_0x3d5001[_0x3c18('0x31')]=_[_0x3c18('0x32')](_0x3d5001[_0x3c18('0x2f')],_0x3d5001['query']);_0x567495['attributes']=_[_0x3c18('0x32')](_0x3d5001[_0x3c18('0x2f')],qs['fields'](_0x4975fe[_0x3c18('0x30')][_0x3c18('0x33')]));_0x567495['attributes']=_0x567495[_0x3c18('0x34')][_0x3c18('0x35')]?_0x567495[_0x3c18('0x34')]:_0x3d5001[_0x3c18('0x2f')];if(!_0x4975fe['query']['hasOwnProperty'](_0x3c18('0x36'))){_0x567495[_0x3c18('0x37')]=qs[_0x3c18('0x37')](_0x4975fe[_0x3c18('0x30')][_0x3c18('0x37')]);_0x567495[_0x3c18('0x1d')]=qs[_0x3c18('0x1d')](_0x4975fe[_0x3c18('0x30')][_0x3c18('0x1d')]);}_0x567495[_0x3c18('0x38')]=qs[_0x3c18('0x39')](_0x4975fe['query']['sort']);_0x567495[_0x3c18('0x3a')]=qs[_0x3c18('0x31')](_[_0x3c18('0x3b')](_0x4975fe[_0x3c18('0x30')],_0x3d5001[_0x3c18('0x31')]),_0x2a16fd);if(_0x4975fe[_0x3c18('0x30')]['filter']){_0x567495['where']=_[_0x3c18('0x3c')](_0x567495['where'],{'$or':_[_0x3c18('0x2b')](_0x2a16fd,function(_0xc1a50c){if(_0xc1a50c[_0x3c18('0x3d')]!=='VIRTUAL'){var _0x131ead={};_0x131ead[_0xc1a50c['name']]={'$like':'%'+_0x4975fe[_0x3c18('0x30')][_0x3c18('0x3e')]+'%'};return _0x131ead;}})});}_0x567495=_['merge']({},_0x567495,_0x4975fe['options']);var _0x5dfd60={'where':_0x567495[_0x3c18('0x3a')]};return db[_0x3c18('0x2c')][_0x3c18('0x1f')](_0x5dfd60)[_0x3c18('0x26')](function(_0xc6582b){_0x285a22['count']=_0xc6582b;if(_0x4975fe[_0x3c18('0x30')]['includeAll']){_0x567495[_0x3c18('0x3f')]=[{'all':!![]}];}return db[_0x3c18('0x2c')][_0x3c18('0x40')](_0x567495);})['then'](function(_0x4398c8){_0x285a22[_0x3c18('0x41')]=_0x4398c8;return _0x285a22;})[_0x3c18('0x26')](respondWithFilteredResult(_0x512568,_0x567495))[_0x3c18('0x42')](handleError(_0x512568,null));};exports['show']=function(_0x6e98aa,_0x16cbfd){var _0x277767={'raw':!![],'where':{'id':_0x6e98aa[_0x3c18('0x43')]['id']}},_0x249c6e={};_0x249c6e[_0x3c18('0x2f')]=_[_0x3c18('0x44')](db[_0x3c18('0x2c')][_0x3c18('0x2d')]);_0x249c6e['query']=_['keys'](_0x6e98aa[_0x3c18('0x30')]);_0x249c6e[_0x3c18('0x31')]=_[_0x3c18('0x32')](_0x249c6e[_0x3c18('0x2f')],_0x249c6e['query']);_0x277767['attributes']=_['intersection'](_0x249c6e[_0x3c18('0x2f')],qs[_0x3c18('0x33')](_0x6e98aa[_0x3c18('0x30')][_0x3c18('0x33')]));_0x277767[_0x3c18('0x34')]=_0x277767[_0x3c18('0x34')]['length']?_0x277767['attributes']:_0x249c6e['model'];if(_0x6e98aa[_0x3c18('0x30')][_0x3c18('0x45')]){_0x277767['include']=[{'all':!![]}];}_0x277767=_[_0x3c18('0x3c')]({},_0x277767,_0x6e98aa[_0x3c18('0x46')]);return db[_0x3c18('0x2c')][_0x3c18('0x47')](_0x277767)[_0x3c18('0x26')](handleEntityNotFound(_0x16cbfd,null))[_0x3c18('0x26')](respondWithResult(_0x16cbfd,null))['catch'](handleError(_0x16cbfd,null));};exports[_0x3c18('0x48')]=function(_0x1f2b71,_0x80e5a3){return db['JscriptySessionReport'][_0x3c18('0x48')](_0x1f2b71[_0x3c18('0x49')],{})[_0x3c18('0x26')](respondWithResult(_0x80e5a3,0xc9))['catch'](handleError(_0x80e5a3,null));};exports[_0x3c18('0x25')]=function(_0x1ddfa6,_0x18f48a){if(_0x1ddfa6[_0x3c18('0x49')]['id']){delete _0x1ddfa6[_0x3c18('0x49')]['id'];}return db['JscriptySessionReport'][_0x3c18('0x47')]({'where':{'id':_0x1ddfa6['params']['id']}})[_0x3c18('0x26')](handleEntityNotFound(_0x18f48a,null))[_0x3c18('0x26')](saveUpdates(_0x1ddfa6[_0x3c18('0x49')],null))[_0x3c18('0x26')](respondWithResult(_0x18f48a,null))[_0x3c18('0x42')](handleError(_0x18f48a,null));};exports[_0x3c18('0x27')]=function(_0x5dabd8,_0x4dee0d){return db[_0x3c18('0x2c')][_0x3c18('0x47')]({'where':{'id':_0x5dabd8[_0x3c18('0x43')]['id']}})[_0x3c18('0x26')](handleEntityNotFound(_0x4dee0d,null))[_0x3c18('0x26')](removeEntity(_0x4dee0d,null))[_0x3c18('0x42')](handleError(_0x4dee0d,null));};exports['describe']=function(_0x4df495,_0x2acca1){return db['JscriptySessionReport'][_0x3c18('0x4a')]()[_0x3c18('0x26')](respondWithResult(_0x2acca1,null))['catch'](handleError(_0x2acca1,null));};exports[_0x3c18('0x4b')]=function(_0x3e1583,_0x29f0c1,_0x2bae74){var _0x22415e={'raw':!![],'where':{}};var _0x334ad2={};var _0x4a93eb={'count':0x0,'rows':[]};return db[_0x3c18('0x2c')][_0x3c18('0x4c')]({'where':{'id':_0x3e1583[_0x3c18('0x43')]['id']}})[_0x3c18('0x26')](handleEntityNotFound(_0x29f0c1,null))[_0x3c18('0x26')](function(_0x3fe4b2){if(_0x3fe4b2){_0x334ad2[_0x3c18('0x2f')]=_['keys'](db[_0x3c18('0x4d')][_0x3c18('0x2d')]);_0x334ad2[_0x3c18('0x30')]=_[_0x3c18('0x44')](_0x3e1583[_0x3c18('0x30')]);_0x334ad2[_0x3c18('0x31')]=_['intersection'](_0x334ad2[_0x3c18('0x2f')],_0x334ad2[_0x3c18('0x30')]);_0x22415e[_0x3c18('0x34')]=_[_0x3c18('0x32')](_0x334ad2[_0x3c18('0x2f')],qs[_0x3c18('0x33')](_0x3e1583[_0x3c18('0x30')][_0x3c18('0x33')]));_0x22415e[_0x3c18('0x34')]=_0x22415e[_0x3c18('0x34')]['length']?_0x22415e[_0x3c18('0x34')]:_0x334ad2[_0x3c18('0x2f')];if(!_0x3e1583['query'][_0x3c18('0x4e')](_0x3c18('0x36'))){_0x22415e[_0x3c18('0x37')]=qs[_0x3c18('0x37')](_0x3e1583[_0x3c18('0x30')][_0x3c18('0x37')]);_0x22415e[_0x3c18('0x1d')]=qs[_0x3c18('0x1d')](_0x3e1583['query'][_0x3c18('0x1d')]);}_0x22415e[_0x3c18('0x38')]=qs[_0x3c18('0x39')](_0x3e1583[_0x3c18('0x30')][_0x3c18('0x39')]);_0x22415e[_0x3c18('0x3a')]=qs['filters'](_[_0x3c18('0x3b')](_0x3e1583[_0x3c18('0x30')],_0x334ad2[_0x3c18('0x31')]));_0x22415e[_0x3c18('0x3a')][_0x3c18('0x4f')]=_0x3fe4b2['id'];if(_0x3e1583[_0x3c18('0x30')][_0x3c18('0x3e')]){_0x22415e[_0x3c18('0x3a')]=_[_0x3c18('0x3c')](_0x22415e[_0x3c18('0x3a')],{'$or':_[_0x3c18('0x2b')](_0x22415e[_0x3c18('0x34')],function(_0x2ce97c){var _0x369b0c={};_0x369b0c[_0x2ce97c]={'$like':'%'+_0x3e1583[_0x3c18('0x30')][_0x3c18('0x3e')]+'%'};return _0x369b0c;})});}_0x22415e=_[_0x3c18('0x3c')]({},_0x22415e,_0x3e1583[_0x3c18('0x46')]);return db[_0x3c18('0x4d')][_0x3c18('0x1f')]({'where':_0x22415e['where']})[_0x3c18('0x26')](function(_0x15d777){_0x4a93eb[_0x3c18('0x1f')]=_0x15d777;if(_0x3e1583[_0x3c18('0x30')][_0x3c18('0x45')]){_0x22415e[_0x3c18('0x3f')]=[{'all':!![]}];}return db[_0x3c18('0x4d')][_0x3c18('0x40')](_0x22415e);})[_0x3c18('0x26')](function(_0x555d4d){_0x4a93eb[_0x3c18('0x41')]=_0x555d4d;return _0x4a93eb;});}})['then'](respondWithFilteredResult(_0x29f0c1,_0x22415e))[_0x3c18('0x42')](handleError(_0x29f0c1,null));};
\ No newline at end of file
+var _0x3c2f=['jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','error','stack','name','index','map','JscriptySessionReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','update','destroy','describe','getQuestions','findOne','SessionId','JscriptyQuestionReport','eml-format','mustache','sox','ejs','fs-extra','lodash','squel','crypto'];(function(_0x26693e,_0x4e0d14){var _0x54a2b4=function(_0x1852d2){while(--_0x1852d2){_0x26693e['push'](_0x26693e['shift']());}};_0x54a2b4(++_0x4e0d14);}(_0x3c2f,0x1d2));var _0xf3c2=function(_0x23200d,_0x15fb6e){_0x23200d=_0x23200d-0x0;var _0x3f8381=_0x3c2f[_0x23200d];return _0x3f8381;};'use strict';var emlformat=require(_0xf3c2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf3c2('0x1'));var util=require('util');var path=require('path');var sox=require(_0xf3c2('0x2'));var csv=require('to-csv');var ejs=require(_0xf3c2('0x3'));var fs=require('fs');var fs_extra=require(_0xf3c2('0x4'));var _=require(_0xf3c2('0x5'));var squel=require(_0xf3c2('0x6'));var crypto=require(_0xf3c2('0x7'));var jsforce=require(_0xf3c2('0x8'));var deskjs=require('desk.js');var toCsv=require(_0xf3c2('0x9'));var querystring=require(_0xf3c2('0xa'));var Papa=require(_0xf3c2('0xb'));var Redis=require(_0xf3c2('0xc'));var authService=require(_0xf3c2('0xd'));var qs=require(_0xf3c2('0xe'));var as=require(_0xf3c2('0xf'));var hardwareService=require(_0xf3c2('0x10'));var logger=require(_0xf3c2('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xf3c2('0x12'));var licenseUtil=require(_0xf3c2('0x13'));var db=require(_0xf3c2('0x14'))['db'];function respondWithStatusCode(_0x101245,_0x22c4d8){_0x22c4d8=_0x22c4d8||0xcc;return function(_0x4af1a7){if(_0x4af1a7){return _0x101245[_0xf3c2('0x15')](_0x22c4d8);}return _0x101245[_0xf3c2('0x16')](_0x22c4d8)[_0xf3c2('0x17')]();};}function respondWithResult(_0x25346e,_0x4e3685){_0x4e3685=_0x4e3685||0xc8;return function(_0x4ee47d){if(_0x4ee47d){return _0x25346e[_0xf3c2('0x16')](_0x4e3685)[_0xf3c2('0x18')](_0x4ee47d);}};}function respondWithFilteredResult(_0x3289d8,_0x4c9284){return function(_0x49169a){if(_0x49169a){var _0x4af410=typeof _0x4c9284[_0xf3c2('0x19')]==='undefined'&&typeof _0x4c9284['limit']===_0xf3c2('0x1a');var _0x291238=_0x49169a[_0xf3c2('0x1b')];var _0x57d22a=_0x4af410?0x0:_0x4c9284['offset'];var _0x41a50b=_0x4af410?_0x49169a[_0xf3c2('0x1b')]:_0x4c9284[_0xf3c2('0x19')]+_0x4c9284[_0xf3c2('0x1c')];var _0x1f12bc;if(_0x41a50b>=_0x291238){_0x41a50b=_0x291238;_0x1f12bc=0xc8;}else{_0x1f12bc=0xce;}_0x3289d8[_0xf3c2('0x16')](_0x1f12bc);return _0x3289d8[_0xf3c2('0x1d')](_0xf3c2('0x1e'),_0x57d22a+'-'+_0x41a50b+'/'+_0x291238)[_0xf3c2('0x18')](_0x49169a);}return null;};}function patchUpdates(_0x2bdc7e){return function(_0x20d943){try{jsonpatch['apply'](_0x20d943,_0x2bdc7e,!![]);}catch(_0x404871){return BPromise[_0xf3c2('0x1f')](_0x404871);}return _0x20d943[_0xf3c2('0x20')]();};}function saveUpdates(_0x49bf97,_0x33c0ab){return function(_0x1ed8de){if(_0x1ed8de){return _0x1ed8de['update'](_0x49bf97)[_0xf3c2('0x21')](function(_0x2d6398){return _0x2d6398;});}return null;};}function removeEntity(_0x3e4bf0,_0x567341){return function(_0x215246){if(_0x215246){return _0x215246['destroy']()[_0xf3c2('0x21')](function(){_0x3e4bf0[_0xf3c2('0x16')](0xcc)[_0xf3c2('0x17')]();});}};}function handleEntityNotFound(_0x214ab8,_0x4d3326){return function(_0x336f02){if(!_0x336f02){_0x214ab8[_0xf3c2('0x15')](0x194);}return _0x336f02;};}function handleError(_0x18b456,_0x558f0b){_0x558f0b=_0x558f0b||0x1f4;return function(_0x43c74f){logger[_0xf3c2('0x22')](_0x43c74f[_0xf3c2('0x23')]);if(_0x43c74f[_0xf3c2('0x24')]){delete _0x43c74f[_0xf3c2('0x24')];}_0x18b456['status'](_0x558f0b)['send'](_0x43c74f);};}exports[_0xf3c2('0x25')]=function(_0x5d36be,_0x1e542e){var _0x62b6c={},_0x4cdcb1={},_0x167390={'count':0x0,'rows':[]};var _0x3a33a9=_[_0xf3c2('0x26')](db[_0xf3c2('0x27')][_0xf3c2('0x28')],function(_0x3b7a66){return{'name':_0x3b7a66[_0xf3c2('0x29')],'type':_0x3b7a66['type'][_0xf3c2('0x2a')]};});_0x4cdcb1[_0xf3c2('0x2b')]=_[_0xf3c2('0x26')](_0x3a33a9,_0xf3c2('0x24'));_0x4cdcb1[_0xf3c2('0x2c')]=_[_0xf3c2('0x2d')](_0x5d36be[_0xf3c2('0x2c')]);_0x4cdcb1[_0xf3c2('0x2e')]=_[_0xf3c2('0x2f')](_0x4cdcb1[_0xf3c2('0x2b')],_0x4cdcb1[_0xf3c2('0x2c')]);_0x62b6c[_0xf3c2('0x30')]=_['intersection'](_0x4cdcb1[_0xf3c2('0x2b')],qs[_0xf3c2('0x31')](_0x5d36be[_0xf3c2('0x2c')][_0xf3c2('0x31')]));_0x62b6c[_0xf3c2('0x30')]=_0x62b6c[_0xf3c2('0x30')][_0xf3c2('0x32')]?_0x62b6c[_0xf3c2('0x30')]:_0x4cdcb1[_0xf3c2('0x2b')];if(!_0x5d36be['query'][_0xf3c2('0x33')](_0xf3c2('0x34'))){_0x62b6c[_0xf3c2('0x1c')]=qs['limit'](_0x5d36be[_0xf3c2('0x2c')][_0xf3c2('0x1c')]);_0x62b6c[_0xf3c2('0x19')]=qs[_0xf3c2('0x19')](_0x5d36be[_0xf3c2('0x2c')][_0xf3c2('0x19')]);}_0x62b6c[_0xf3c2('0x35')]=qs[_0xf3c2('0x36')](_0x5d36be[_0xf3c2('0x2c')][_0xf3c2('0x36')]);_0x62b6c[_0xf3c2('0x37')]=qs[_0xf3c2('0x2e')](_[_0xf3c2('0x38')](_0x5d36be[_0xf3c2('0x2c')],_0x4cdcb1['filters']),_0x3a33a9);if(_0x5d36be[_0xf3c2('0x2c')][_0xf3c2('0x39')]){_0x62b6c[_0xf3c2('0x37')]=_[_0xf3c2('0x3a')](_0x62b6c[_0xf3c2('0x37')],{'$or':_[_0xf3c2('0x26')](_0x3a33a9,function(_0x12c439){if(_0x12c439[_0xf3c2('0x3b')]!==_0xf3c2('0x3c')){var _0x2035f5={};_0x2035f5[_0x12c439['name']]={'$like':'%'+_0x5d36be[_0xf3c2('0x2c')]['filter']+'%'};return _0x2035f5;}})});}_0x62b6c=_[_0xf3c2('0x3a')]({},_0x62b6c,_0x5d36be[_0xf3c2('0x3d')]);var _0x3901d7={'where':_0x62b6c[_0xf3c2('0x37')]};return db[_0xf3c2('0x27')][_0xf3c2('0x1b')](_0x3901d7)[_0xf3c2('0x21')](function(_0x1c1788){_0x167390[_0xf3c2('0x1b')]=_0x1c1788;if(_0x5d36be['query']['includeAll']){_0x62b6c[_0xf3c2('0x3e')]=[{'all':!![]}];}return db[_0xf3c2('0x27')][_0xf3c2('0x3f')](_0x62b6c);})[_0xf3c2('0x21')](function(_0x37e37b){_0x167390[_0xf3c2('0x40')]=_0x37e37b;return _0x167390;})[_0xf3c2('0x21')](respondWithFilteredResult(_0x1e542e,_0x62b6c))[_0xf3c2('0x41')](handleError(_0x1e542e,null));};exports[_0xf3c2('0x42')]=function(_0x1c5c16,_0x54403e){var _0x412a5d={'raw':!![],'where':{'id':_0x1c5c16[_0xf3c2('0x43')]['id']}},_0x5e8551={};_0x5e8551['model']=_[_0xf3c2('0x2d')](db['JscriptySessionReport'][_0xf3c2('0x28')]);_0x5e8551[_0xf3c2('0x2c')]=_['keys'](_0x1c5c16[_0xf3c2('0x2c')]);_0x5e8551['filters']=_[_0xf3c2('0x2f')](_0x5e8551[_0xf3c2('0x2b')],_0x5e8551[_0xf3c2('0x2c')]);_0x412a5d[_0xf3c2('0x30')]=_['intersection'](_0x5e8551[_0xf3c2('0x2b')],qs[_0xf3c2('0x31')](_0x1c5c16['query'][_0xf3c2('0x31')]));_0x412a5d[_0xf3c2('0x30')]=_0x412a5d[_0xf3c2('0x30')][_0xf3c2('0x32')]?_0x412a5d['attributes']:_0x5e8551[_0xf3c2('0x2b')];if(_0x1c5c16[_0xf3c2('0x2c')][_0xf3c2('0x44')]){_0x412a5d[_0xf3c2('0x3e')]=[{'all':!![]}];}_0x412a5d=_[_0xf3c2('0x3a')]({},_0x412a5d,_0x1c5c16[_0xf3c2('0x3d')]);return db[_0xf3c2('0x27')][_0xf3c2('0x45')](_0x412a5d)[_0xf3c2('0x21')](handleEntityNotFound(_0x54403e,null))['then'](respondWithResult(_0x54403e,null))[_0xf3c2('0x41')](handleError(_0x54403e,null));};exports[_0xf3c2('0x46')]=function(_0x13c00a,_0x4a2d77){return db[_0xf3c2('0x27')][_0xf3c2('0x46')](_0x13c00a[_0xf3c2('0x47')],{})[_0xf3c2('0x21')](respondWithResult(_0x4a2d77,0xc9))[_0xf3c2('0x41')](handleError(_0x4a2d77,null));};exports[_0xf3c2('0x48')]=function(_0x46312c,_0x260e31){if(_0x46312c[_0xf3c2('0x47')]['id']){delete _0x46312c[_0xf3c2('0x47')]['id'];}return db[_0xf3c2('0x27')]['find']({'where':{'id':_0x46312c[_0xf3c2('0x43')]['id']}})[_0xf3c2('0x21')](handleEntityNotFound(_0x260e31,null))[_0xf3c2('0x21')](saveUpdates(_0x46312c[_0xf3c2('0x47')],null))[_0xf3c2('0x21')](respondWithResult(_0x260e31,null))[_0xf3c2('0x41')](handleError(_0x260e31,null));};exports[_0xf3c2('0x49')]=function(_0x408d42,_0x13788e){return db[_0xf3c2('0x27')][_0xf3c2('0x45')]({'where':{'id':_0x408d42['params']['id']}})['then'](handleEntityNotFound(_0x13788e,null))['then'](removeEntity(_0x13788e,null))[_0xf3c2('0x41')](handleError(_0x13788e,null));};exports[_0xf3c2('0x4a')]=function(_0x1ea402,_0x336a78){return db['JscriptySessionReport'][_0xf3c2('0x4a')]()[_0xf3c2('0x21')](respondWithResult(_0x336a78,null))[_0xf3c2('0x41')](handleError(_0x336a78,null));};exports[_0xf3c2('0x4b')]=function(_0x5b7798,_0x1c8bec,_0x41c96d){var _0x2b57f6={'raw':!![],'where':{}};var _0x31dfe9={};var _0x296a59={'count':0x0,'rows':[]};return db[_0xf3c2('0x27')][_0xf3c2('0x4c')]({'where':{'id':_0x5b7798['params']['id']}})['then'](handleEntityNotFound(_0x1c8bec,null))[_0xf3c2('0x21')](function(_0x27f327){if(_0x27f327){_0x31dfe9[_0xf3c2('0x2b')]=_[_0xf3c2('0x2d')](db['JscriptyQuestionReport'][_0xf3c2('0x28')]);_0x31dfe9[_0xf3c2('0x2c')]=_[_0xf3c2('0x2d')](_0x5b7798[_0xf3c2('0x2c')]);_0x31dfe9[_0xf3c2('0x2e')]=_[_0xf3c2('0x2f')](_0x31dfe9[_0xf3c2('0x2b')],_0x31dfe9['query']);_0x2b57f6[_0xf3c2('0x30')]=_[_0xf3c2('0x2f')](_0x31dfe9['model'],qs[_0xf3c2('0x31')](_0x5b7798[_0xf3c2('0x2c')][_0xf3c2('0x31')]));_0x2b57f6[_0xf3c2('0x30')]=_0x2b57f6[_0xf3c2('0x30')][_0xf3c2('0x32')]?_0x2b57f6[_0xf3c2('0x30')]:_0x31dfe9[_0xf3c2('0x2b')];if(!_0x5b7798[_0xf3c2('0x2c')]['hasOwnProperty']('nolimit')){_0x2b57f6[_0xf3c2('0x1c')]=qs[_0xf3c2('0x1c')](_0x5b7798['query']['limit']);_0x2b57f6[_0xf3c2('0x19')]=qs[_0xf3c2('0x19')](_0x5b7798[_0xf3c2('0x2c')][_0xf3c2('0x19')]);}_0x2b57f6[_0xf3c2('0x35')]=qs[_0xf3c2('0x36')](_0x5b7798[_0xf3c2('0x2c')][_0xf3c2('0x36')]);_0x2b57f6[_0xf3c2('0x37')]=qs[_0xf3c2('0x2e')](_[_0xf3c2('0x38')](_0x5b7798[_0xf3c2('0x2c')],_0x31dfe9[_0xf3c2('0x2e')]));_0x2b57f6[_0xf3c2('0x37')][_0xf3c2('0x4d')]=_0x27f327['id'];if(_0x5b7798[_0xf3c2('0x2c')][_0xf3c2('0x39')]){_0x2b57f6[_0xf3c2('0x37')]=_[_0xf3c2('0x3a')](_0x2b57f6[_0xf3c2('0x37')],{'$or':_['map'](_0x2b57f6[_0xf3c2('0x30')],function(_0x4ad7ad){var _0x1efff9={};_0x1efff9[_0x4ad7ad]={'$like':'%'+_0x5b7798[_0xf3c2('0x2c')][_0xf3c2('0x39')]+'%'};return _0x1efff9;})});}_0x2b57f6=_[_0xf3c2('0x3a')]({},_0x2b57f6,_0x5b7798[_0xf3c2('0x3d')]);return db[_0xf3c2('0x4e')][_0xf3c2('0x1b')]({'where':_0x2b57f6['where']})[_0xf3c2('0x21')](function(_0x196938){_0x296a59['count']=_0x196938;if(_0x5b7798['query']['includeAll']){_0x2b57f6[_0xf3c2('0x3e')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xf3c2('0x3f')](_0x2b57f6);})[_0xf3c2('0x21')](function(_0x344c46){_0x296a59[_0xf3c2('0x40')]=_0x344c46;return _0x296a59;});}})[_0xf3c2('0x21')](respondWithFilteredResult(_0x1c8bec,_0x2b57f6))['catch'](handleError(_0x1c8bec,null));};
\ No newline at end of file
index 9b77628..4c104f4 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(_0x40f19c,_0x53bc50){var _0x461f19=function(_0x35a318){while(--_0x35a318){_0x40f19c['push'](_0x40f19c['shift']());}};_0x461f19(++_0x53bc50);}(_0x277c,0x153));var _0xc277=function(_0x16e61a,_0x3d3fcc){_0x16e61a=_0x16e61a-0x0;var _0x410e2c=_0x277c[_0x16e61a];return _0x410e2c;};'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 _0xeff8=['rimraf','../../config/environment','./jscriptySessionReport.attributes','define','JscriptySessionReport','lodash','util','api','moment','bluebird','path'];(function(_0x2592da,_0x3088ba){var _0x4b89f6=function(_0x32e989){while(--_0x32e989){_0x2592da['push'](_0x2592da['shift']());}};_0x4b89f6(++_0x3088ba);}(_0xeff8,0x186));var _0x8eff=function(_0x3df223,_0x1740fc){_0x3df223=_0x3df223-0x0;var _0x562d11=_0xeff8[_0x3df223];return _0x562d11;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var logger=require('../../config/logger')(_0x8eff('0x2'));var moment=require(_0x8eff('0x3'));var BPromise=require(_0x8eff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eff('0x5'));var rimraf=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var attributes=require(_0x8eff('0x8'));module['exports']=function(_0x469641,_0xb54063){return _0x469641[_0x8eff('0x9')](_0x8eff('0xa'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b90a858..382a9bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d04=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','stringify','error','JscriptySessionReport,\x20%s,\x20%s','message','info'];(function(_0x5dd4ac,_0x401087){var _0x100498=function(_0x3eba2b){while(--_0x3eba2b){_0x5dd4ac['push'](_0x5dd4ac['shift']());}};_0x100498(++_0x401087);}(_0x3d04,0xbe));var _0x43d0=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3d04[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x43d0('0x0'));var util=require(_0x43d0('0x1'));var moment=require(_0x43d0('0x2'));var BPromise=require(_0x43d0('0x3'));var rs=require(_0x43d0('0x4'));var fs=require('fs');var Redis=require(_0x43d0('0x5'));var db=require(_0x43d0('0x6'))['db'];var utils=require(_0x43d0('0x7'));var logger=require('../../config/logger')(_0x43d0('0x8'));var config=require(_0x43d0('0x9'));var jayson=require(_0x43d0('0xa'));var client=jayson[_0x43d0('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x484271,_0x50919e,_0x5efb95){return new BPromise(function(_0x457550,_0x3344d3){return client[_0x43d0('0xc')](_0x484271,_0x5efb95)[_0x43d0('0xd')](function(_0x44a763){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x50919e,_0x43d0('0xe'));logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x50919e,_0x43d0('0xe'),JSON[_0x43d0('0xf')](_0x44a763));if(_0x44a763[_0x43d0('0x10')]){if(_0x44a763[_0x43d0('0x10')]['code']===0x1f4){logger[_0x43d0('0x10')](_0x43d0('0x11'),_0x50919e,_0x44a763['error'][_0x43d0('0x12')]);return _0x3344d3(_0x44a763[_0x43d0('0x10')][_0x43d0('0x12')]);}logger['error'](_0x43d0('0x11'),_0x50919e,_0x44a763[_0x43d0('0x10')][_0x43d0('0x12')]);return _0x457550(_0x44a763['error'][_0x43d0('0x12')]);}else{logger[_0x43d0('0x13')](_0x43d0('0x11'),_0x50919e,_0x43d0('0xe'));_0x457550(_0x44a763[_0x43d0('0x14')]['message']);}})['catch'](function(_0x1e91a7){logger[_0x43d0('0x10')](_0x43d0('0x11'),_0x50919e,_0x1e91a7);_0x3344d3(_0x1e91a7);});});}
\ No newline at end of file
+var _0x4991=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x24392f,_0x15a3e5){var _0x591e33=function(_0xe0ccea){while(--_0xe0ccea){_0x24392f['push'](_0x24392f['shift']());}};_0x591e33(++_0x15a3e5);}(_0x4991,0xf7));var _0x1499=function(_0x53a142,_0x3498b0){_0x53a142=_0x53a142-0x0;var _0x461127=_0x4991[_0x53a142];return _0x461127;};'use strict';var _=require(_0x1499('0x0'));var util=require('util');var moment=require(_0x1499('0x1'));var BPromise=require('bluebird');var rs=require(_0x1499('0x2'));var fs=require('fs');var Redis=require(_0x1499('0x3'));var db=require(_0x1499('0x4'))['db'];var utils=require(_0x1499('0x5'));var logger=require(_0x1499('0x6'))(_0x1499('0x7'));var config=require(_0x1499('0x8'));var jayson=require(_0x1499('0x9'));var client=jayson['client'][_0x1499('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c3bd7,_0x1c65c3,_0x33b261){return new BPromise(function(_0x133bae,_0x380e48){return client[_0x1499('0xb')](_0x1c3bd7,_0x33b261)[_0x1499('0xc')](function(_0x48d2ca){logger[_0x1499('0xd')](_0x1499('0xe'),_0x1c65c3,'request\x20sent');logger[_0x1499('0xf')](_0x1499('0x10'),_0x1c65c3,'request\x20sent',JSON[_0x1499('0x11')](_0x48d2ca));if(_0x48d2ca[_0x1499('0x12')]){if(_0x48d2ca['error']['code']===0x1f4){logger['error'](_0x1499('0xe'),_0x1c65c3,_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);return _0x380e48(_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x1c65c3,_0x48d2ca[_0x1499('0x12')]['message']);return _0x133bae(_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);}else{logger[_0x1499('0xd')](_0x1499('0xe'),_0x1c65c3,'request\x20sent');_0x133bae(_0x48d2ca[_0x1499('0x14')][_0x1499('0x13')]);}})['catch'](function(_0x25164c){logger[_0x1499('0x12')](_0x1499('0xe'),_0x1c65c3,_0x25164c);_0x380e48(_0x25164c);});});}
\ No newline at end of file
index d13571e..4ae4a28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd846=['express','fs-extra','../../components/auth/service','../../config/environment','./license.controller','get','index','isAuthenticated','update','downloadLogFile','exports','multer','util'];(function(_0x1fceea,_0x399997){var _0x571097=function(_0x56b76c){while(--_0x56b76c){_0x1fceea['push'](_0x1fceea['shift']());}};_0x571097(++_0x399997);}(_0xd846,0xa7));var _0x6d84=function(_0x1dec02,_0x5ae0a8){_0x1dec02=_0x1dec02-0x0;var _0x403795=_0xd846[_0x1dec02];return _0x403795;};'use strict';var multer=require(_0x6d84('0x0'));var util=require(_0x6d84('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6d84('0x2'));var router=express['Router']();var fs_extra=require(_0x6d84('0x3'));var auth=require(_0x6d84('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6d84('0x5'));var controller=require(_0x6d84('0x6'));router[_0x6d84('0x7')]('/',controller[_0x6d84('0x8')]);router['put']('/:id',auth[_0x6d84('0x9')](),controller[_0x6d84('0xa')]);router[_0x6d84('0x7')]('/download_log_file',auth[_0x6d84('0x9')](),controller[_0x6d84('0xb')]);module[_0x6d84('0xc')]=router;
\ No newline at end of file
+var _0x6f9f=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','/:id','update','isAuthenticated','exports'];(function(_0x3e3217,_0x518c13){var _0x425fac=function(_0x22a925){while(--_0x22a925){_0x3e3217['push'](_0x3e3217['shift']());}};_0x425fac(++_0x518c13);}(_0x6f9f,0x11d));var _0xf6f9=function(_0x4e85ec,_0x2913b6){_0x4e85ec=_0x4e85ec-0x0;var _0x1c1ab3=_0x6f9f[_0x4e85ec];return _0x1c1ab3;};'use strict';var multer=require('multer');var util=require(_0xf6f9('0x0'));var path=require('path');var timeout=require(_0xf6f9('0x1'));var express=require(_0xf6f9('0x2'));var router=express[_0xf6f9('0x3')]();var fs_extra=require(_0xf6f9('0x4'));var auth=require(_0xf6f9('0x5'));var interaction=require(_0xf6f9('0x6'));var config=require(_0xf6f9('0x7'));var controller=require(_0xf6f9('0x8'));router[_0xf6f9('0x9')]('/',controller[_0xf6f9('0xa')]);router['put'](_0xf6f9('0xb'),auth['isAuthenticated'](),controller[_0xf6f9('0xc')]);router[_0xf6f9('0x9')]('/download_log_file',auth[_0xf6f9('0xd')](),controller['downloadLogFile']);module[_0xf6f9('0xe')]=router;
\ No newline at end of file
index 40ba836..1f8316d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7981=['exports','TEXT','STRING'];(function(_0x5a9c57,_0x24ee34){var _0x39dac7=function(_0x4fb603){while(--_0x4fb603){_0x5a9c57['push'](_0x5a9c57['shift']());}};_0x39dac7(++_0x24ee34);}(_0x7981,0xcf));var _0x1798=function(_0x1b084d,_0x1c6bf8){_0x1b084d=_0x1b084d-0x0;var _0x3e4fef=_0x7981[_0x1b084d];return _0x3e4fef;};'use strict';var Sequelize=require('sequelize');module[_0x1798('0x0')]={'license':{'type':Sequelize[_0x1798('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x1798('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x79cf=['INTEGER','sequelize','exports','TEXT','STRING'];(function(_0x73f672,_0x522a03){var _0x35f730=function(_0x3b91ed){while(--_0x3b91ed){_0x73f672['push'](_0x73f672['shift']());}};_0x35f730(++_0x522a03);}(_0x79cf,0x92));var _0xf79c=function(_0x4fba11,_0x2d850d){_0x4fba11=_0x4fba11-0x0;var _0x249111=_0x79cf[_0x4fba11];return _0x249111;};'use strict';var Sequelize=require(_0xf79c('0x0'));module[_0xf79c('0x1')]={'license':{'type':Sequelize[_0xf79c('0x2')]},'data1':{'type':Sequelize[_0xf79c('0x3')]},'data2':{'type':Sequelize[_0xf79c('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xf79c('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index 2070ced..d28210e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50b5=['options','getLicense','body','License','find','get','checkLicense','key','catch','downloadLogFile','license-info.log','join','/var','xcally','setHeader','Content-disposition','Content-Type','text/plain','download','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','update','then','error','name','send','index','model','keys','rawAttributes','query','filters','intersection','attributes','fields'];(function(_0x52f653,_0xab958b){var _0xaba06a=function(_0xe22017){while(--_0xe22017){_0x52f653['push'](_0x52f653['shift']());}};_0xaba06a(++_0xab958b);}(_0x50b5,0xdc));var _0x550b=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x50b5[_0x55e08b];return _0xd1a7ff;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x550b('0x0'));var jsonpatch=require(_0x550b('0x1'));var rp=require(_0x550b('0x2'));var moment=require('moment');var BPromise=require(_0x550b('0x3'));var Mustache=require(_0x550b('0x4'));var util=require(_0x550b('0x5'));var path=require(_0x550b('0x6'));var sox=require(_0x550b('0x7'));var csv=require(_0x550b('0x8'));var ejs=require(_0x550b('0x9'));var fs=require('fs');var fs_extra=require(_0x550b('0xa'));var _=require('lodash');var squel=require(_0x550b('0xb'));var crypto=require(_0x550b('0xc'));var jsforce=require(_0x550b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x550b('0x8'));var querystring=require(_0x550b('0xe'));var Papa=require(_0x550b('0xf'));var Redis=require(_0x550b('0x10'));var authService=require(_0x550b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x550b('0x12'));var hardwareService=require(_0x550b('0x13'));var logger=require('../../config/logger')(_0x550b('0x14'));var utils=require('../../config/utils');var config=require(_0x550b('0x15'));var licenseUtil=require(_0x550b('0x16'));var db=require(_0x550b('0x17'))['db'];function respondWithStatusCode(_0x22e079,_0x37ea70){_0x37ea70=_0x37ea70||0xcc;return function(_0x43ec97){if(_0x43ec97){return _0x22e079[_0x550b('0x18')](_0x37ea70);}return _0x22e079[_0x550b('0x19')](_0x37ea70)[_0x550b('0x1a')]();};}function respondWithResult(_0x4d9ad8,_0x2ae9cb){_0x2ae9cb=_0x2ae9cb||0xc8;return function(_0x3ff0b0){if(_0x3ff0b0){return _0x4d9ad8[_0x550b('0x19')](_0x2ae9cb)['json'](_0x3ff0b0);}};}function respondWithFilteredResult(_0xf67648,_0x33bfb6){return function(_0x5bc307){if(_0x5bc307){var _0x367309=typeof _0x33bfb6[_0x550b('0x1b')]===_0x550b('0x1c')&&typeof _0x33bfb6[_0x550b('0x1d')]==='undefined';var _0x31580f=_0x5bc307['count'];var _0x54c6de=_0x367309?0x0:_0x33bfb6[_0x550b('0x1b')];var _0xf1a64=_0x367309?_0x5bc307[_0x550b('0x1e')]:_0x33bfb6[_0x550b('0x1b')]+_0x33bfb6[_0x550b('0x1d')];var _0x14237c;if(_0xf1a64>=_0x31580f){_0xf1a64=_0x31580f;_0x14237c=0xc8;}else{_0x14237c=0xce;}_0xf67648[_0x550b('0x19')](_0x14237c);return _0xf67648['set'](_0x550b('0x1f'),_0x54c6de+'-'+_0xf1a64+'/'+_0x31580f)[_0x550b('0x20')](_0x5bc307);}return null;};}function patchUpdates(_0x378cf2){return function(_0x563b89){try{jsonpatch['apply'](_0x563b89,_0x378cf2,!![]);}catch(_0x190548){return BPromise[_0x550b('0x21')](_0x190548);}return _0x563b89['save']();};}function saveUpdates(_0x3dd297,_0x28faff){return function(_0x3bb2b4){if(_0x3bb2b4){return _0x3bb2b4[_0x550b('0x22')](_0x3dd297)['then'](function(_0x4d34ed){return _0x4d34ed;});}return null;};}function removeEntity(_0x16ff4f,_0x533f94){return function(_0x30ff52){if(_0x30ff52){return _0x30ff52['destroy']()[_0x550b('0x23')](function(){_0x16ff4f[_0x550b('0x19')](0xcc)[_0x550b('0x1a')]();});}};}function handleEntityNotFound(_0x466e59,_0x3beee4){return function(_0x3cd93e){if(!_0x3cd93e){_0x466e59[_0x550b('0x18')](0x194);}return _0x3cd93e;};}function handleError(_0x388e0b,_0x1dd145){_0x1dd145=_0x1dd145||0x1f4;return function(_0x5ea6eb){logger[_0x550b('0x24')](_0x5ea6eb['stack']);if(_0x5ea6eb['name']){delete _0x5ea6eb[_0x550b('0x25')];}_0x388e0b[_0x550b('0x19')](_0x1dd145)[_0x550b('0x26')](_0x5ea6eb);};}var utilLicense=require('../../config/license/util');exports[_0x550b('0x27')]=function(_0x56ef6a,_0x43df1d){var _0x5d6367={'raw':!![],'where':{'id':0x1}},_0x370f11={};_0x370f11[_0x550b('0x28')]=_[_0x550b('0x29')](db['License'][_0x550b('0x2a')]);_0x370f11[_0x550b('0x2b')]=_['keys'](_0x56ef6a[_0x550b('0x2b')]);_0x370f11[_0x550b('0x2c')]=_[_0x550b('0x2d')](_0x370f11['model'],_0x370f11[_0x550b('0x2b')]);_0x5d6367[_0x550b('0x2e')]=_['intersection'](_0x370f11[_0x550b('0x28')],qs[_0x550b('0x2f')](_0x56ef6a['query'][_0x550b('0x2f')]));_0x5d6367[_0x550b('0x2e')]=_0x5d6367['attributes']['length']?_0x5d6367['attributes']:_0x370f11[_0x550b('0x28')];_0x5d6367=_['merge']({},_0x5d6367,_0x56ef6a[_0x550b('0x30')]);return utilLicense[_0x550b('0x31')](_0x5d6367)[_0x550b('0x23')](respondWithResult(_0x43df1d,null))['catch'](handleError(_0x43df1d,null));};exports[_0x550b('0x22')]=function(_0x419bd5,_0x3f604e){if(_0x419bd5[_0x550b('0x32')]['id']){delete _0x419bd5[_0x550b('0x32')]['id'];}return db[_0x550b('0x33')][_0x550b('0x34')]({'where':{'id':_0x419bd5['params']['id']}})[_0x550b('0x23')](handleEntityNotFound(_0x3f604e,null))[_0x550b('0x23')](function(_0x130191){var _0x22bfd4=_0x130191[_0x550b('0x35')]({'plain':!![]});return utilLicense[_0x550b('0x36')](_0x22bfd4,_0x419bd5[_0x550b('0x32')][_0x550b('0x37')]);})['then'](function(_0x4fbb32){if(!_0x4fbb32['demo']){return saveUpdates(_0x419bd5[_0x550b('0x32')],null);}return _0x4fbb32;})[_0x550b('0x23')](respondWithResult(_0x3f604e,null))[_0x550b('0x38')](handleError(_0x3f604e,null));};exports[_0x550b('0x39')]=function(_0x58f2a7,_0x282fc0){var _0x5490fa=_0x550b('0x3a');var _0x46ecf6=path[_0x550b('0x3b')](_0x550b('0x3c'),'log',_0x550b('0x3d'),_0x5490fa);_0x282fc0[_0x550b('0x3e')](_0x550b('0x3f'),'attachment;\x20filename='+_0x5490fa);_0x282fc0['set'](_0x550b('0x40'),_0x550b('0x41'));_0x282fc0[_0x550b('0x42')](_0x46ecf6);};
\ No newline at end of file
+var _0x8eb4=['update','then','destroy','sendStatus','error','stack','name','send','../../config/license/util','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','merge','getLicense','catch','params','get','checkLicense','body','key','demo','license-info.log','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','eml-format','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','save'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8eb4,0x1c2));var _0x48eb=function(_0x37ded3,_0x371ebb){_0x37ded3=_0x37ded3-0x0;var _0x51e49e=_0x8eb4[_0x37ded3];return _0x51e49e;};'use strict';var emlformat=require(_0x48eb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x48eb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x48eb('0x2'));var moment=require(_0x48eb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x48eb('0x4'));var util=require('util');var path=require(_0x48eb('0x5'));var sox=require(_0x48eb('0x6'));var csv=require(_0x48eb('0x7'));var ejs=require(_0x48eb('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x48eb('0x9'));var squel=require('squel');var crypto=require(_0x48eb('0xa'));var jsforce=require(_0x48eb('0xb'));var deskjs=require(_0x48eb('0xc'));var toCsv=require(_0x48eb('0x7'));var querystring=require(_0x48eb('0xd'));var Papa=require('papaparse');var Redis=require(_0x48eb('0xe'));var authService=require(_0x48eb('0xf'));var qs=require(_0x48eb('0x10'));var as=require(_0x48eb('0x11'));var hardwareService=require(_0x48eb('0x12'));var logger=require('../../config/logger')(_0x48eb('0x13'));var utils=require(_0x48eb('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x48eb('0x15'))['db'];function respondWithStatusCode(_0x1dd43a,_0x27af5f){_0x27af5f=_0x27af5f||0xcc;return function(_0xc8cf55){if(_0xc8cf55){return _0x1dd43a['sendStatus'](_0x27af5f);}return _0x1dd43a[_0x48eb('0x16')](_0x27af5f)[_0x48eb('0x17')]();};}function respondWithResult(_0x5dd21b,_0x456e40){_0x456e40=_0x456e40||0xc8;return function(_0x5317d6){if(_0x5317d6){return _0x5dd21b['status'](_0x456e40)[_0x48eb('0x18')](_0x5317d6);}};}function respondWithFilteredResult(_0x1b743b,_0x360f65){return function(_0x3ad7dc){if(_0x3ad7dc){var _0x4531c8=typeof _0x360f65['offset']==='undefined'&&typeof _0x360f65[_0x48eb('0x19')]===_0x48eb('0x1a');var _0x45bcab=_0x3ad7dc['count'];var _0x60dbf6=_0x4531c8?0x0:_0x360f65[_0x48eb('0x1b')];var _0x508725=_0x4531c8?_0x3ad7dc[_0x48eb('0x1c')]:_0x360f65['offset']+_0x360f65[_0x48eb('0x19')];var _0x1bdf6f;if(_0x508725>=_0x45bcab){_0x508725=_0x45bcab;_0x1bdf6f=0xc8;}else{_0x1bdf6f=0xce;}_0x1b743b[_0x48eb('0x16')](_0x1bdf6f);return _0x1b743b[_0x48eb('0x1d')](_0x48eb('0x1e'),_0x60dbf6+'-'+_0x508725+'/'+_0x45bcab)[_0x48eb('0x18')](_0x3ad7dc);}return null;};}function patchUpdates(_0x1359fe){return function(_0x4c85f6){try{jsonpatch[_0x48eb('0x1f')](_0x4c85f6,_0x1359fe,!![]);}catch(_0x56c128){return BPromise['reject'](_0x56c128);}return _0x4c85f6[_0x48eb('0x20')]();};}function saveUpdates(_0x33a97d,_0x3a1499){return function(_0x520c18){if(_0x520c18){return _0x520c18[_0x48eb('0x21')](_0x33a97d)[_0x48eb('0x22')](function(_0x324cfc){return _0x324cfc;});}return null;};}function removeEntity(_0x5ed352,_0x6dad32){return function(_0x2a3a23){if(_0x2a3a23){return _0x2a3a23[_0x48eb('0x23')]()['then'](function(){_0x5ed352['status'](0xcc)[_0x48eb('0x17')]();});}};}function handleEntityNotFound(_0x589cb6,_0x140709){return function(_0x25b1f0){if(!_0x25b1f0){_0x589cb6[_0x48eb('0x24')](0x194);}return _0x25b1f0;};}function handleError(_0x46392f,_0x5bc49d){_0x5bc49d=_0x5bc49d||0x1f4;return function(_0x38f1f9){logger[_0x48eb('0x25')](_0x38f1f9[_0x48eb('0x26')]);if(_0x38f1f9[_0x48eb('0x27')]){delete _0x38f1f9[_0x48eb('0x27')];}_0x46392f[_0x48eb('0x16')](_0x5bc49d)[_0x48eb('0x28')](_0x38f1f9);};}var utilLicense=require(_0x48eb('0x29'));exports['index']=function(_0x65b27d,_0x263784){var _0x605324={'raw':!![],'where':{'id':0x1}},_0x565802={};_0x565802[_0x48eb('0x2a')]=_[_0x48eb('0x2b')](db[_0x48eb('0x2c')][_0x48eb('0x2d')]);_0x565802[_0x48eb('0x2e')]=_[_0x48eb('0x2b')](_0x65b27d[_0x48eb('0x2e')]);_0x565802[_0x48eb('0x2f')]=_[_0x48eb('0x30')](_0x565802[_0x48eb('0x2a')],_0x565802[_0x48eb('0x2e')]);_0x605324[_0x48eb('0x31')]=_[_0x48eb('0x30')](_0x565802[_0x48eb('0x2a')],qs[_0x48eb('0x32')](_0x65b27d['query'][_0x48eb('0x32')]));_0x605324['attributes']=_0x605324[_0x48eb('0x31')][_0x48eb('0x33')]?_0x605324['attributes']:_0x565802[_0x48eb('0x2a')];_0x605324=_[_0x48eb('0x34')]({},_0x605324,_0x65b27d['options']);return utilLicense[_0x48eb('0x35')](_0x605324)['then'](respondWithResult(_0x263784,null))[_0x48eb('0x36')](handleError(_0x263784,null));};exports[_0x48eb('0x21')]=function(_0x458a3b,_0x3682fb){if(_0x458a3b['body']['id']){delete _0x458a3b['body']['id'];}return db[_0x48eb('0x2c')]['find']({'where':{'id':_0x458a3b[_0x48eb('0x37')]['id']}})['then'](handleEntityNotFound(_0x3682fb,null))[_0x48eb('0x22')](function(_0x10ddbb){var _0x10c0bc=_0x10ddbb[_0x48eb('0x38')]({'plain':!![]});return utilLicense[_0x48eb('0x39')](_0x10c0bc,_0x458a3b[_0x48eb('0x3a')][_0x48eb('0x3b')]);})[_0x48eb('0x22')](function(_0x4a1cd8){if(!_0x4a1cd8[_0x48eb('0x3c')]){return saveUpdates(_0x458a3b[_0x48eb('0x3a')],null);}return _0x4a1cd8;})[_0x48eb('0x22')](respondWithResult(_0x3682fb,null))[_0x48eb('0x36')](handleError(_0x3682fb,null));};exports['downloadLogFile']=function(_0x2a9f0e,_0x33df55){var _0x2c169a=_0x48eb('0x3d');var _0x4a24ad=path['join'](_0x48eb('0x3e'),_0x48eb('0x3f'),_0x48eb('0x40'),_0x2c169a);_0x33df55[_0x48eb('0x41')](_0x48eb('0x42'),_0x48eb('0x43')+_0x2c169a);_0x33df55['set'](_0x48eb('0x44'),'text/plain');_0x33df55['download'](_0x4a24ad);};
\ No newline at end of file
index 499f2db..ee189e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2380=['request-promise','path','rimraf','../../config/environment','./license.attributes','exports','License','license','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x344c0c,_0xb4f9ea){var _0x34135e=function(_0x504e5c){while(--_0x504e5c){_0x344c0c['push'](_0x344c0c['shift']());}};_0x34135e(++_0xb4f9ea);}(_0x2380,0x86));var _0x0238=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x2380[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require(_0x0238('0x0'));var util=require(_0x0238('0x1'));var logger=require(_0x0238('0x2'))(_0x0238('0x3'));var moment=require(_0x0238('0x4'));var BPromise=require(_0x0238('0x5'));var rp=require(_0x0238('0x6'));var fs=require('fs');var path=require(_0x0238('0x7'));var rimraf=require(_0x0238('0x8'));var config=require(_0x0238('0x9'));var attributes=require(_0x0238('0xa'));module[_0x0238('0xb')]=function(_0x54d753,_0x1c08ee){return _0x54d753['define'](_0x0238('0xc'),attributes,{'tableName':_0x0238('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeb6a=['define','License','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','exports'];(function(_0x3793b1,_0x24831a){var _0x104cb6=function(_0xd499c2){while(--_0xd499c2){_0x3793b1['push'](_0x3793b1['shift']());}};_0x104cb6(++_0x24831a);}(_0xeb6a,0x1f0));var _0xaeb6=function(_0x49f2ac,_0xebce40){_0x49f2ac=_0x49f2ac-0x0;var _0x5ee398=_0xeb6a[_0x49f2ac];return _0x5ee398;};'use strict';var _=require(_0xaeb6('0x0'));var util=require(_0xaeb6('0x1'));var logger=require('../../config/logger')(_0xaeb6('0x2'));var moment=require(_0xaeb6('0x3'));var BPromise=require(_0xaeb6('0x4'));var rp=require(_0xaeb6('0x5'));var fs=require('fs');var path=require(_0xaeb6('0x6'));var rimraf=require(_0xaeb6('0x7'));var config=require(_0xaeb6('0x8'));var attributes=require(_0xaeb6('0x9'));module[_0xaeb6('0xa')]=function(_0x48d43c,_0x16268c){return _0x48d43c[_0xaeb6('0xb')](_0xaeb6('0xc'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5f0f049..a896d6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf949=['../../config/logger','../../config/environment','http','request','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','../../mysqldb','../../config/utils'];(function(_0x2eac4f,_0x5173f9){var _0x58f73b=function(_0x529f28){while(--_0x529f28){_0x2eac4f['push'](_0x2eac4f['shift']());}};_0x58f73b(++_0x5173f9);}(_0xf949,0x1b1));var _0x9f94=function(_0x6c31a8,_0x417cb7){_0x6c31a8=_0x6c31a8-0x0;var _0x138b37=_0xf949[_0x6c31a8];return _0x138b37;};'use strict';var _=require(_0x9f94('0x0'));var util=require('util');var moment=require(_0x9f94('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f94('0x2'))['db'];var utils=require(_0x9f94('0x3'));var logger=require(_0x9f94('0x4'))('rpc');var config=require(_0x9f94('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9f94('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2338d7,_0xeb4a56,_0x5dd4ea){return new BPromise(function(_0x375d2f,_0x18be18){return client[_0x9f94('0x7')](_0x2338d7,_0x5dd4ea)[_0x9f94('0x8')](function(_0x173b9d){logger[_0x9f94('0x9')](_0x9f94('0xa'),_0xeb4a56,'request\x20sent');logger[_0x9f94('0xb')](_0x9f94('0xc'),_0xeb4a56,_0x9f94('0xd'),JSON[_0x9f94('0xe')](_0x173b9d));if(_0x173b9d[_0x9f94('0xf')]){if(_0x173b9d[_0x9f94('0xf')]['code']===0x1f4){logger['error'](_0x9f94('0xa'),_0xeb4a56,_0x173b9d[_0x9f94('0xf')][_0x9f94('0x10')]);return _0x18be18(_0x173b9d[_0x9f94('0xf')][_0x9f94('0x10')]);}logger[_0x9f94('0xf')](_0x9f94('0xa'),_0xeb4a56,_0x173b9d[_0x9f94('0xf')]['message']);return _0x375d2f(_0x173b9d[_0x9f94('0xf')][_0x9f94('0x10')]);}else{logger[_0x9f94('0x9')]('License,\x20%s,\x20%s',_0xeb4a56,_0x9f94('0xd'));_0x375d2f(_0x173b9d[_0x9f94('0x11')][_0x9f94('0x10')]);}})[_0x9f94('0x12')](function(_0x3650e4){logger[_0x9f94('0xf')](_0x9f94('0xa'),_0xeb4a56,_0x3650e4);_0x18be18(_0x3650e4);});});}
\ No newline at end of file
+var _0x1d25=['http','request','then','info','License,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x54bc2e,_0x1cfcca){var _0x3abfc8=function(_0x26c2a1){while(--_0x26c2a1){_0x54bc2e['push'](_0x54bc2e['shift']());}};_0x3abfc8(++_0x1cfcca);}(_0x1d25,0x16b));var _0x51d2=function(_0x457b64,_0x49a219){_0x457b64=_0x457b64-0x0;var _0x437111=_0x1d25[_0x457b64];return _0x437111;};'use strict';var _=require(_0x51d2('0x0'));var util=require(_0x51d2('0x1'));var moment=require(_0x51d2('0x2'));var BPromise=require('bluebird');var rs=require(_0x51d2('0x3'));var fs=require('fs');var Redis=require(_0x51d2('0x4'));var db=require(_0x51d2('0x5'))['db'];var utils=require(_0x51d2('0x6'));var logger=require(_0x51d2('0x7'))(_0x51d2('0x8'));var config=require('../../config/environment');var jayson=require(_0x51d2('0x9'));var client=jayson[_0x51d2('0xa')][_0x51d2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x487c9f,_0x37170,_0x3aa639){return new BPromise(function(_0x18aa3b,_0x1b55c5){return client[_0x51d2('0xc')](_0x487c9f,_0x3aa639)[_0x51d2('0xd')](function(_0x1e5201){logger[_0x51d2('0xe')](_0x51d2('0xf'),_0x37170,'request\x20sent');logger['debug']('License,\x20%s,\x20%s,\x20%s',_0x37170,_0x51d2('0x10'),JSON[_0x51d2('0x11')](_0x1e5201));if(_0x1e5201[_0x51d2('0x12')]){if(_0x1e5201[_0x51d2('0x12')]['code']===0x1f4){logger[_0x51d2('0x12')](_0x51d2('0xf'),_0x37170,_0x1e5201[_0x51d2('0x12')][_0x51d2('0x13')]);return _0x1b55c5(_0x1e5201['error'][_0x51d2('0x13')]);}logger[_0x51d2('0x12')](_0x51d2('0xf'),_0x37170,_0x1e5201['error'][_0x51d2('0x13')]);return _0x18aa3b(_0x1e5201[_0x51d2('0x12')]['message']);}else{logger['info'](_0x51d2('0xf'),_0x37170,_0x51d2('0x10'));_0x18aa3b(_0x1e5201[_0x51d2('0x14')]['message']);}})[_0x51d2('0x15')](function(_0x3e9c7c){logger[_0x51d2('0x12')](_0x51d2('0xf'),_0x37170,_0x3e9c7c);_0x1b55c5(_0x3e9c7c);});});}
\ No newline at end of file
index 5ae29b1..5acc464 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f71=['/:id/canned_answers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','getInteractions','/:id/applications','/:id/messages','/:id/verify','/:id/users','getAgents','post','addAnswer','create','addImap','addSmtp','/:id/interactions','addInteraction','addApplications','send','put','update','removeDispositions','removeAnswers','delete','removeImap','removeSmtp','destroy','removeAgents','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x2d09f1,_0x49da09){var _0x5f3338=function(_0x596a87){while(--_0x596a87){_0x2d09f1['push'](_0x2d09f1['shift']());}};_0x5f3338(++_0x49da09);}(_0x3f71,0x158));var _0x13f7=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x3f71[_0x20c9b2];return _0x2c6030;};'use strict';var multer=require('multer');var util=require(_0x13f7('0x0'));var path=require('path');var timeout=require(_0x13f7('0x1'));var express=require(_0x13f7('0x2'));var router=express[_0x13f7('0x3')]();var fs_extra=require(_0x13f7('0x4'));var auth=require(_0x13f7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x13f7('0x6'));var controller=require(_0x13f7('0x7'));router[_0x13f7('0x8')]('/',auth[_0x13f7('0x9')](),controller[_0x13f7('0xa')]);router[_0x13f7('0x8')]('/describe',auth[_0x13f7('0x9')](),controller[_0x13f7('0xb')]);router[_0x13f7('0x8')](_0x13f7('0xc'),auth[_0x13f7('0x9')](),controller[_0x13f7('0xd')]);router[_0x13f7('0x8')](_0x13f7('0xe'),auth[_0x13f7('0x9')](),controller[_0x13f7('0xf')]);router[_0x13f7('0x8')](_0x13f7('0x10'),auth[_0x13f7('0x9')](),controller['getAnswers']);router[_0x13f7('0x8')](_0x13f7('0x11'),auth['isAuthenticated'](),controller[_0x13f7('0x12')]);router[_0x13f7('0x8')](_0x13f7('0x13'),auth[_0x13f7('0x9')](),controller[_0x13f7('0x14')]);router['get']('/:id/interactions',auth[_0x13f7('0x9')](),controller[_0x13f7('0x15')]);router[_0x13f7('0x8')](_0x13f7('0x16'),auth[_0x13f7('0x9')](),controller['getApplications']);router['get'](_0x13f7('0x17'),auth[_0x13f7('0x9')](),controller['getMessages']);router['get'](_0x13f7('0x18'),auth[_0x13f7('0x9')](),controller['verifySmtp']);router[_0x13f7('0x8')](_0x13f7('0x19'),auth['isAuthenticated'](),controller[_0x13f7('0x1a')]);router[_0x13f7('0x1b')](_0x13f7('0xe'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x13f7('0x1b')](_0x13f7('0x10'),auth['isAuthenticated'](),controller[_0x13f7('0x1c')]);router[_0x13f7('0x1b')]('/',auth['isAuthenticated'](),controller[_0x13f7('0x1d')]);router[_0x13f7('0x1b')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0x13f7('0x1e')]);router[_0x13f7('0x1b')](_0x13f7('0x13'),auth[_0x13f7('0x9')](),controller[_0x13f7('0x1f')]);router[_0x13f7('0x1b')](_0x13f7('0x20'),auth[_0x13f7('0x9')](),controller[_0x13f7('0x21')]);router[_0x13f7('0x1b')](_0x13f7('0x16'),auth[_0x13f7('0x9')](),controller[_0x13f7('0x22')]);router[_0x13f7('0x1b')]('/:id/send',auth['isAuthenticated'](),controller[_0x13f7('0x23')]);router[_0x13f7('0x1b')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x13f7('0x24')](_0x13f7('0xc'),auth['isAuthenticated'](),controller[_0x13f7('0x25')]);router['delete']('/:id/dispositions',auth[_0x13f7('0x9')](),controller[_0x13f7('0x26')]);router['delete'](_0x13f7('0x10'),auth[_0x13f7('0x9')](),controller[_0x13f7('0x27')]);router[_0x13f7('0x28')](_0x13f7('0x11'),auth['isAuthenticated'](),controller[_0x13f7('0x29')]);router[_0x13f7('0x28')]('/:id/out_servers',auth[_0x13f7('0x9')](),controller[_0x13f7('0x2a')]);router['delete'](_0x13f7('0xc'),auth[_0x13f7('0x9')](),controller[_0x13f7('0x2b')]);router[_0x13f7('0x28')](_0x13f7('0x19'),auth[_0x13f7('0x9')](),controller[_0x13f7('0x2c')]);module['exports']=router;
\ No newline at end of file
+var _0x7d98=['/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','addImap','addSmtp','addApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','/:id/canned_answers','removeAnswers','removeImap','destroy','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/in_servers','/:id/out_servers','/:id/interactions','/:id/applications','getApplications','getMessages'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7d98,0xa4));var _0x87d9=function(_0x5be7aa,_0x5de661){_0x5be7aa=_0x5be7aa-0x0;var _0x215408=_0x7d98[_0x5be7aa];return _0x215408;};'use strict';var multer=require(_0x87d9('0x0'));var util=require(_0x87d9('0x1'));var path=require(_0x87d9('0x2'));var timeout=require(_0x87d9('0x3'));var express=require('express');var router=express[_0x87d9('0x4')]();var fs_extra=require(_0x87d9('0x5'));var auth=require(_0x87d9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x87d9('0x7'));var controller=require(_0x87d9('0x8'));router[_0x87d9('0x9')]('/',auth[_0x87d9('0xa')](),controller[_0x87d9('0xb')]);router[_0x87d9('0x9')](_0x87d9('0xc'),auth[_0x87d9('0xa')](),controller['describe']);router['get'](_0x87d9('0xd'),auth[_0x87d9('0xa')](),controller[_0x87d9('0xe')]);router[_0x87d9('0x9')](_0x87d9('0xf'),auth[_0x87d9('0xa')](),controller[_0x87d9('0x10')]);router['get']('/:id/canned_answers',auth[_0x87d9('0xa')](),controller[_0x87d9('0x11')]);router['get'](_0x87d9('0x12'),auth[_0x87d9('0xa')](),controller['getImap']);router[_0x87d9('0x9')](_0x87d9('0x13'),auth['isAuthenticated'](),controller['getSmtp']);router[_0x87d9('0x9')](_0x87d9('0x14'),auth[_0x87d9('0xa')](),controller['getInteractions']);router['get'](_0x87d9('0x15'),auth[_0x87d9('0xa')](),controller[_0x87d9('0x16')]);router['get']('/:id/messages',auth[_0x87d9('0xa')](),controller[_0x87d9('0x17')]);router[_0x87d9('0x9')](_0x87d9('0x18'),auth['isAuthenticated'](),controller[_0x87d9('0x19')]);router[_0x87d9('0x9')](_0x87d9('0x1a'),auth[_0x87d9('0xa')](),controller[_0x87d9('0x1b')]);router[_0x87d9('0x1c')](_0x87d9('0xf'),auth['isAuthenticated'](),controller[_0x87d9('0x1d')]);router[_0x87d9('0x1c')]('/:id/canned_answers',auth[_0x87d9('0xa')](),controller[_0x87d9('0x1e')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x87d9('0x1c')](_0x87d9('0x12'),auth[_0x87d9('0xa')](),controller[_0x87d9('0x1f')]);router[_0x87d9('0x1c')](_0x87d9('0x13'),auth[_0x87d9('0xa')](),controller[_0x87d9('0x20')]);router['post'](_0x87d9('0x14'),auth[_0x87d9('0xa')](),controller['addInteraction']);router['post'](_0x87d9('0x15'),auth[_0x87d9('0xa')](),controller[_0x87d9('0x21')]);router[_0x87d9('0x1c')](_0x87d9('0x22'),auth[_0x87d9('0xa')](),controller[_0x87d9('0x23')]);router[_0x87d9('0x1c')](_0x87d9('0x1a'),auth[_0x87d9('0xa')](),controller[_0x87d9('0x24')]);router[_0x87d9('0x25')](_0x87d9('0xd'),auth[_0x87d9('0xa')](),controller[_0x87d9('0x26')]);router[_0x87d9('0x27')](_0x87d9('0xf'),auth[_0x87d9('0xa')](),controller[_0x87d9('0x28')]);router[_0x87d9('0x27')](_0x87d9('0x29'),auth['isAuthenticated'](),controller[_0x87d9('0x2a')]);router[_0x87d9('0x27')](_0x87d9('0x12'),auth[_0x87d9('0xa')](),controller[_0x87d9('0x2b')]);router['delete'](_0x87d9('0x13'),auth[_0x87d9('0xa')](),controller['removeSmtp']);router['delete'](_0x87d9('0xd'),auth[_0x87d9('0xa')](),controller[_0x87d9('0x2c')]);router['delete'](_0x87d9('0x1a'),auth[_0x87d9('0xa')](),controller[_0x87d9('0x2d')]);module[_0x87d9('0x2e')]=router;
\ No newline at end of file
index ef63862..5f7421e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5419=['mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','getDataValue','provider','custom','sequelize','STRING','TEXT','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','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'];(function(_0x5af009,_0x19565d){var _0x1749a5=function(_0x346ade){while(--_0x346ade){_0x5af009['push'](_0x5af009['shift']());}};_0x1749a5(++_0x19565d);}(_0x5419,0x1c1));var _0x9541=function(_0x16dbab,_0x3ac1e1){_0x16dbab=_0x16dbab-0x0;var _0x59b0b2=_0x5419[_0x16dbab];return _0x59b0b2;};'use strict';var Sequelize=require(_0x9541('0x0'));module['exports']={'description':{'type':Sequelize[_0x9541('0x1')]},'name':{'type':Sequelize[_0x9541('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x9541('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x9541('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x9541('0x2')]},'markAsUnread':{'type':Sequelize[_0x9541('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x9541('0x1')],'allowNull':![],'defaultValue':_0x9541('0x4')},'fontSize':{'type':Sequelize[_0x9541('0x5')](0x2)[_0x9541('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9541('0x7');}},'notificationSound':{'type':Sequelize[_0x9541('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9541('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9541('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9541('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9541('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9541('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x9541('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x9541('0x3')],'defaultValue':![],'comment':_0x9541('0x9'),'set':function(_0x760ea9){if(!_0x760ea9)this[_0x9541('0xa')](_0x9541('0xb'),null);this[_0x9541('0xa')](_0x9541('0xc'),_0x760ea9);}},'provider':{'type':Sequelize[_0x9541('0xd')](_0x9541('0xe'),_0x9541('0xf'),_0x9541('0x10'),'outlook365'),'defaultValue':null,'get':function(){if(!this['getDataValue']('provider'))return'custom';return this[_0x9541('0x11')](_0x9541('0x12'));},'set':function(_0x3cf776){if(_0x3cf776===_0x9541('0x13'))_0x3cf776=null;return this['setDataValue'](_0x9541('0x12'),_0x3cf776);}}};
\ No newline at end of file
+var _0x2e1a=['mandatoryDisposition','ENUM','gmail','hotmail','outlook365','getDataValue','provider','custom','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','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'];(function(_0x5023cb,_0x5ae9a6){var _0x52c5d6=function(_0x4fe596){while(--_0x4fe596){_0x5023cb['push'](_0x5023cb['shift']());}};_0x52c5d6(++_0x5ae9a6);}(_0x2e1a,0xaa));var _0xa2e1=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x2e1a[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require('sequelize');module[_0xa2e1('0x0')]={'description':{'type':Sequelize[_0xa2e1('0x1')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0xa2e1('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xa2e1('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xa2e1('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0xa2e1('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0xa2e1('0x3')]},'markAsUnread':{'type':Sequelize[_0xa2e1('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xa2e1('0x1')],'allowNull':![],'defaultValue':_0xa2e1('0x4')},'fontSize':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xa2e1('0x3')],'defaultValue':function(){return _0xa2e1('0x5');}},'notificationSound':{'type':Sequelize[_0xa2e1('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa2e1('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa2e1('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa2e1('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa2e1('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa2e1('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa2e1('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xa2e1('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xa2e1('0x2')],'defaultValue':![],'comment':_0xa2e1('0x8'),'set':function(_0x224544){if(!_0x224544)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xa2e1('0x9')](_0xa2e1('0xa'),_0x224544);}},'provider':{'type':Sequelize[_0xa2e1('0xb')](_0xa2e1('0xc'),_0xa2e1('0xd'),'yahoo',_0xa2e1('0xe')),'defaultValue':null,'get':function(){if(!this[_0xa2e1('0xf')](_0xa2e1('0x10')))return'custom';return this['getDataValue'](_0xa2e1('0x10'));},'set':function(_0x52690b){if(_0x52690b===_0xa2e1('0x11'))_0x52690b=null;return this[_0xa2e1('0x9')](_0xa2e1('0x10'),_0x52690b);}}};
\ No newline at end of file
index 6d1045e..dd842ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0ca=['defaults','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','UserProfileResource','end','stack','name','send','gmail','imap-mail.outlook.com','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','yahoo','smtp.mail.yahoo.com','hotmail','smtp.office365.com','user','username','pass','password','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','includeAll','include','findAll','rows','catch','length','options','find','body','provider','params','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','key','custom','email','isNil','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','omit','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','transaction','sequelize','Transaction','READ_COMMITTED','MailApplication','findAndCountAll','priority','finally','getApplications','$gte','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','split','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','server/files/attachments','basename','getSmtpOptions','SendMail','List','List\x20not\x20found','messageId','subject','attach','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','bluebird','util','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis'];(function(_0x4e20dd,_0x5a1f0c){var _0x2e199b=function(_0x195ffc){while(--_0x195ffc){_0x4e20dd['push'](_0x4e20dd['shift']());}};_0x2e199b(++_0x5a1f0c);}(_0xb0ca,0x17e));var _0xab0c=function(_0x24acae,_0x3453a8){_0x24acae=_0x24acae-0x0;var _0x29e9cc=_0xb0ca[_0x24acae];return _0x29e9cc;};'use strict';var moment=require('moment');var BPromise=require(_0xab0c('0x0'));var util=require(_0xab0c('0x1'));var path=require('path');var _=require(_0xab0c('0x2'));var juice=require(_0xab0c('0x3'));var Redis=require(_0xab0c('0x4'));var qs=require(_0xab0c('0x5'));var logger=require(_0xab0c('0x6'))('api');var config=require(_0xab0c('0x7'));var db=require(_0xab0c('0x8'))['db'];config[_0xab0c('0x9')]=_[_0xab0c('0xa')](config[_0xab0c('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xab0c('0xb'))(new Redis(config[_0xab0c('0x9')]));require(_0xab0c('0xc'))[_0xab0c('0xd')](socket);var jayson=require(_0xab0c('0xe'));var client=jayson[_0xab0c('0xf')]['http']({'port':0x232b});function respondWithRpcPromise(_0x3b218f,_0x30cd18,_0x573bb0,_0x10f616){return new BPromise(function(_0x4401b1,_0x56fa04){var _0x30b2ad=_0x10f616||client;return _0x30b2ad[_0xab0c('0x10')](_0x3b218f,_0x573bb0)[_0xab0c('0x11')](function(_0x5bb9d1){logger[_0xab0c('0x12')](_0xab0c('0x13'),_0x30cd18,_0xab0c('0x14'));logger['debug'](_0xab0c('0x15'),_0x30cd18,_0xab0c('0x14'),JSON[_0xab0c('0x16')](_0x5bb9d1));if(_0x5bb9d1[_0xab0c('0x17')]){if(_0x5bb9d1[_0xab0c('0x17')][_0xab0c('0x18')]===0x1f4){logger[_0xab0c('0x17')]('MailAccount,\x20%s,\x20%s',_0x30cd18,_0x5bb9d1[_0xab0c('0x17')][_0xab0c('0x19')]);return _0x56fa04(_0x5bb9d1[_0xab0c('0x17')][_0xab0c('0x19')]);}logger[_0xab0c('0x17')](_0xab0c('0x13'),_0x30cd18,_0x5bb9d1[_0xab0c('0x17')][_0xab0c('0x19')]);return _0x4401b1(_0x5bb9d1[_0xab0c('0x17')][_0xab0c('0x19')]);}else{logger[_0xab0c('0x12')]('MailAccount,\x20%s,\x20%s',_0x30cd18,_0xab0c('0x14'));_0x4401b1(_0x5bb9d1[_0xab0c('0x1a')][_0xab0c('0x19')]);}})['catch'](function(_0x4cdaba){logger[_0xab0c('0x17')](_0xab0c('0x13'),_0x30cd18,_0x4cdaba);_0x56fa04(_0x4cdaba);});});}function respondWithStatusCode(_0x50af11,_0x1bda49){_0x1bda49=_0x1bda49||0xcc;return function(_0x49cabf){if(_0x49cabf){return _0x50af11[_0xab0c('0x1b')](_0x1bda49);}return _0x50af11[_0xab0c('0x1c')](_0x1bda49)['end']();};}function respondWithResult(_0x10f5a4,_0x5abe2f){_0x5abe2f=_0x5abe2f||0xc8;return function(_0x53febf){if(_0x53febf){return _0x10f5a4[_0xab0c('0x1c')](_0x5abe2f)[_0xab0c('0x1d')](_0x53febf);}};}function respondWithFilteredResult(_0x55447e,_0xf0f2da){return function(_0x6b7351){if(_0x6b7351){var _0x1f2efe=typeof _0xf0f2da[_0xab0c('0x1e')]===_0xab0c('0x1f')&&typeof _0xf0f2da[_0xab0c('0x20')]===_0xab0c('0x1f');var _0x48ef11=_0x6b7351[_0xab0c('0x21')];var _0x3e6fd5=_0x1f2efe?0x0:_0xf0f2da[_0xab0c('0x1e')];var _0x4f9524=_0x1f2efe?_0x6b7351[_0xab0c('0x21')]:_0xf0f2da['offset']+_0xf0f2da[_0xab0c('0x20')];var _0x1ab4cc;if(_0x4f9524>=_0x48ef11){_0x4f9524=_0x48ef11;_0x1ab4cc=0xc8;}else{_0x1ab4cc=0xce;}_0x55447e['status'](_0x1ab4cc);return _0x55447e[_0xab0c('0x22')](_0xab0c('0x23'),_0x3e6fd5+'-'+_0x4f9524+'/'+_0x48ef11)[_0xab0c('0x1d')](_0x6b7351);}return null;};}function saveUpdates(_0xc0b95){return function(_0xb71e9d){if(_0xb71e9d){return _0xb71e9d[_0xab0c('0x24')](_0xc0b95)[_0xab0c('0x11')](function(_0x1c706d){return _0x1c706d;});}return null;};}function removeEntity(_0x5e856f){return function(_0x12ae6b){if(_0x12ae6b){return _0x12ae6b[_0xab0c('0x25')]()['then'](function(){var _0x4d1f14=_0x12ae6b[_0xab0c('0x26')]({'plain':!![]});var _0x95845='MailAccounts';return db[_0xab0c('0x27')]['destroy']({'where':{'type':_0x95845,'resourceId':_0x4d1f14['id']}})['then'](function(){return _0x12ae6b;});})[_0xab0c('0x11')](function(){_0x5e856f['status'](0xcc)[_0xab0c('0x28')]();});}};}function handleEntityNotFound(_0xd72ffa){return function(_0x12b141){if(!_0x12b141){_0xd72ffa[_0xab0c('0x1b')](0x194);}return _0x12b141;};}function handleError(_0x11c8a7,_0x34a510){_0x34a510=_0x34a510||0x1f4;return function(_0x336c72){logger['error'](_0x336c72[_0xab0c('0x29')]);if(_0x336c72[_0xab0c('0x2a')]){delete _0x336c72[_0xab0c('0x2a')];}_0x11c8a7[_0xab0c('0x1c')](_0x34a510)[_0xab0c('0x2b')](_0x336c72);};}function getImapHost(_0x189833){switch(_0x189833){case _0xab0c('0x2c'):return'imap.gmail.com';case'yahoo':return'imap.mail.yahoo.com';case'hotmail':return _0xab0c('0x2d');case'outlook365':return _0xab0c('0x2e');}throw new Error(_0xab0c('0x2f'),_0x189833);}function getSmtpHost(_0x5b6a24){switch(_0x5b6a24){case'gmail':return _0xab0c('0x30');case _0xab0c('0x31'):return _0xab0c('0x32');case _0xab0c('0x33'):return'smtp-mail.outlook.com';case'outlook365':return _0xab0c('0x34');}throw new Error(_0xab0c('0x2f'),_0x5b6a24);}function getAuthenticationOptions(_0x54d2cf,_0x2eea3c){var _0x5670e={};var _0x509fa3={};if(_0x54d2cf){_0x5670e[_0xab0c('0x35')]=_0x509fa3[_0xab0c('0x35')]=_0x2eea3c[_0xab0c('0x36')];_0x5670e['password']=_0x509fa3[_0xab0c('0x37')]=_0x2eea3c[_0xab0c('0x38')];if(_0x2eea3c[_0xab0c('0x39')]){_0x5670e[_0xab0c('0x39')]=_0x509fa3[_0xab0c('0x39')]=!![];_0x5670e[_0xab0c('0x3a')]=_0x509fa3[_0xab0c('0x3a')]=_0x2eea3c['CloudProviderId'];_0x5670e[_0xab0c('0x38')]=_0x509fa3[_0xab0c('0x37')]=null;}else{_0x5670e['CloudProviderId']=_0x509fa3['CloudProviderId']=null;}_0x5670e[_0xab0c('0x3b')]=getImapHost(_0x54d2cf);_0x5670e[_0xab0c('0x3c')]=0x3e1;_0x509fa3[_0xab0c('0x3b')]=getSmtpHost(_0x54d2cf);_0x509fa3[_0xab0c('0x3c')]=0x24b;_0x509fa3[_0xab0c('0x3d')]=![];_0x5670e['service']=_0x509fa3[_0xab0c('0x3e')]=null;}else{if(_0x2eea3c[_0xab0c('0x3f')]){_0x5670e[_0xab0c('0x35')]=_0x509fa3[_0xab0c('0x35')]=_0x2eea3c[_0xab0c('0x36')];_0x5670e['password']=_0x509fa3[_0xab0c('0x37')]=_0x2eea3c[_0xab0c('0x38')];}else{_0x5670e['authentication']=_0x509fa3[_0xab0c('0x3f')]=![];_0x5670e[_0xab0c('0x35')]=_0x509fa3['user']=null;_0x5670e[_0xab0c('0x38')]=_0x509fa3[_0xab0c('0x37')]=null;}_0x5670e[_0xab0c('0x3b')]=_0x2eea3c[_0xab0c('0x40')][_0xab0c('0x3b')];_0x5670e[_0xab0c('0x3c')]=_0x2eea3c[_0xab0c('0x40')][_0xab0c('0x3c')];_0x509fa3[_0xab0c('0x3b')]=_0x2eea3c[_0xab0c('0x41')][_0xab0c('0x3b')];_0x509fa3['port']=_0x2eea3c[_0xab0c('0x41')]['port'];}return{'Imap':_0x5670e,'Smtp':_0x509fa3};}exports['index']=function(_0x2e64ff,_0x176f9d){var _0x6d8d32={'include':[{'model':db[_0xab0c('0x42')],'as':_0xab0c('0x40')},{'model':db[_0xab0c('0x43')],'as':_0xab0c('0x41')},{'model':db[_0xab0c('0x44')],'as':_0xab0c('0x45')}]},_0x41eb29={},_0x3c84b2={'count':0x0,'rows':[]};var _0x308272=_[_0xab0c('0x46')](db[_0xab0c('0x47')][_0xab0c('0x48')],function(_0x5280a3){return{'name':_0x5280a3[_0xab0c('0x49')],'type':_0x5280a3[_0xab0c('0x4a')]['key']};});_0x41eb29['model']=_[_0xab0c('0x46')](_0x308272,_0xab0c('0x2a'));_0x41eb29[_0xab0c('0x4b')]=_[_0xab0c('0x4c')](_0x2e64ff[_0xab0c('0x4b')]);_0x41eb29[_0xab0c('0x4d')]=_['intersection'](_0x41eb29[_0xab0c('0x4e')],_0x41eb29[_0xab0c('0x4b')]);_0x6d8d32['attributes']=_[_0xab0c('0x4f')](_0x41eb29['model'],qs[_0xab0c('0x50')](_0x2e64ff[_0xab0c('0x4b')][_0xab0c('0x50')]));_0x6d8d32[_0xab0c('0x51')]=_0x6d8d32[_0xab0c('0x51')]['length']?_0x6d8d32[_0xab0c('0x51')]:_0x41eb29[_0xab0c('0x4e')];if(!_0x2e64ff[_0xab0c('0x4b')][_0xab0c('0x52')](_0xab0c('0x53'))){_0x6d8d32[_0xab0c('0x20')]=qs['limit'](_0x2e64ff[_0xab0c('0x4b')][_0xab0c('0x20')]);_0x6d8d32[_0xab0c('0x1e')]=qs[_0xab0c('0x1e')](_0x2e64ff[_0xab0c('0x4b')][_0xab0c('0x1e')]);}_0x6d8d32[_0xab0c('0x54')]=qs[_0xab0c('0x55')](_0x2e64ff[_0xab0c('0x4b')]['sort']);_0x6d8d32['where']=qs[_0xab0c('0x4d')](_[_0xab0c('0x56')](_0x2e64ff['query'],_0x41eb29[_0xab0c('0x4d')]),_0x308272);if(_0x2e64ff[_0xab0c('0x4b')]['filter']){_0x6d8d32[_0xab0c('0x57')]=_[_0xab0c('0x58')](_0x6d8d32['where'],{'$or':_[_0xab0c('0x46')](_0x308272,function(_0x1550a0){if(_0x1550a0[_0xab0c('0x4a')]!=='VIRTUAL'){var _0x4ffc86={};_0x4ffc86[_0x1550a0[_0xab0c('0x2a')]]={'$like':'%'+_0x2e64ff[_0xab0c('0x4b')][_0xab0c('0x59')]+'%'};return _0x4ffc86;}})});}_0x6d8d32=_[_0xab0c('0x58')]({},_0x6d8d32,_0x2e64ff['options']);var _0x5bf22b={'where':_0x6d8d32[_0xab0c('0x57')]};return db['MailAccount'][_0xab0c('0x21')](_0x5bf22b)['then'](function(_0x100863){_0x3c84b2['count']=_0x100863;if(_0x2e64ff[_0xab0c('0x4b')][_0xab0c('0x5a')]){_0x6d8d32[_0xab0c('0x5b')]=[{'all':!![]}];}return db[_0xab0c('0x47')][_0xab0c('0x5c')](_0x6d8d32);})['then'](function(_0x2535a1){_0x3c84b2[_0xab0c('0x5d')]=_0x2535a1;return _0x3c84b2;})[_0xab0c('0x11')](respondWithFilteredResult(_0x176f9d,_0x6d8d32))[_0xab0c('0x5e')](handleError(_0x176f9d,null));};exports['show']=function(_0x4bd63,_0x11fc58){var _0xba6683={'raw':![],'where':{'id':_0x4bd63['params']['id']},'include':[{'model':db[_0xab0c('0x42')],'as':_0xab0c('0x40')},{'model':db[_0xab0c('0x43')],'as':_0xab0c('0x41')},{'model':db['Pause'],'as':_0xab0c('0x45')}]},_0x26694a={};_0x26694a[_0xab0c('0x4e')]=_[_0xab0c('0x4c')](db['MailAccount'][_0xab0c('0x48')]);_0x26694a[_0xab0c('0x4b')]=_[_0xab0c('0x4c')](_0x4bd63[_0xab0c('0x4b')]);_0x26694a[_0xab0c('0x4d')]=_[_0xab0c('0x4f')](_0x26694a[_0xab0c('0x4e')],_0x26694a[_0xab0c('0x4b')]);_0xba6683[_0xab0c('0x51')]=_[_0xab0c('0x4f')](_0x26694a[_0xab0c('0x4e')],qs[_0xab0c('0x50')](_0x4bd63['query'][_0xab0c('0x50')]));_0xba6683[_0xab0c('0x51')]=_0xba6683[_0xab0c('0x51')][_0xab0c('0x5f')]?_0xba6683[_0xab0c('0x51')]:_0x26694a[_0xab0c('0x4e')];if(_0x4bd63['query'][_0xab0c('0x5a')]){_0xba6683['include']=[{'all':!![]}];}_0xba6683=_['merge']({},_0xba6683,_0x4bd63[_0xab0c('0x60')]);return db['MailAccount'][_0xab0c('0x61')](_0xba6683)[_0xab0c('0x11')](handleEntityNotFound(_0x11fc58,null))[_0xab0c('0x11')](respondWithResult(_0x11fc58,null))[_0xab0c('0x5e')](handleError(_0x11fc58,null));};exports[_0xab0c('0x24')]=function(_0x52a901,_0x3de118){if(_0x52a901[_0xab0c('0x62')]['id']){delete _0x52a901[_0xab0c('0x62')]['id'];}var _0x1f2199=_0x52a901[_0xab0c('0x62')]['provider']==='custom'?null:_0x52a901[_0xab0c('0x62')][_0xab0c('0x63')];var _0x50f41e=_0x52a901[_0xab0c('0x62')][_0xab0c('0x40')]||{};var _0x1c86de=_0x52a901[_0xab0c('0x62')]['Smtp']||{};if(_0x1f2199){_0x50f41e[_0xab0c('0x3b')]=getImapHost(_0x1f2199);_0x50f41e['port']=0x3e1;_0x1c86de[_0xab0c('0x3b')]=getSmtpHost(_0x1f2199);_0x1c86de[_0xab0c('0x3c')]=0x24b;_0x1c86de[_0xab0c('0x3d')]=![];}if(_0x1c86de[_0xab0c('0x39')]){_0x1c86de['secure']=![];}else{_0x1c86de[_0xab0c('0x3a')]=null;}if(!_0x50f41e[_0xab0c('0x39')])_0x50f41e[_0xab0c('0x3a')]=null;_0x52a901['body'][_0xab0c('0x40')]=_0x50f41e;_0x52a901[_0xab0c('0x62')][_0xab0c('0x41')]=_0x1c86de;return db[_0xab0c('0x47')][_0xab0c('0x61')]({'where':{'id':_0x52a901[_0xab0c('0x64')]['id']},'include':[{'model':db[_0xab0c('0x42')],'as':'Imap'},{'model':db[_0xab0c('0x43')],'as':'Smtp'},{'model':db[_0xab0c('0x44')],'as':'mandatoryDispositionPause'}]})[_0xab0c('0x11')](handleEntityNotFound(_0x3de118,null))[_0xab0c('0x11')](function(_0x3fe86c){if(!_0x3fe86c)throw new Error(_0xab0c('0x65'));if(_0x3fe86c[_0xab0c('0x3e')])delete _0x52a901[_0xab0c('0x62')][_0xab0c('0x40')];return _0x3fe86c;})[_0xab0c('0x11')](saveUpdates(_0x52a901[_0xab0c('0x62')],null))[_0xab0c('0x11')](function(_0x5bec27){if(!_0x52a901[_0xab0c('0x62')][_0xab0c('0x40')])return _0x5bec27;return db[_0xab0c('0x42')][_0xab0c('0x24')](_0x52a901['body'][_0xab0c('0x40')],{'where':{'MailAccountId':_0x5bec27['id']}})[_0xab0c('0x11')](function(){return _0x5bec27;});})[_0xab0c('0x11')](function(_0x37c6b7){if(!_0x52a901['body'][_0xab0c('0x41')])return _0x37c6b7;return db[_0xab0c('0x43')][_0xab0c('0x24')](_0x52a901['body'][_0xab0c('0x41')],{'where':{'MailAccountId':_0x37c6b7['id']}})[_0xab0c('0x11')](function(){return _0x37c6b7;});})[_0xab0c('0x11')](respondWithResult(_0x3de118,null))[_0xab0c('0x5e')](handleError(_0x3de118,null));};exports[_0xab0c('0x66')]=function(_0x1da7db,_0x3c11e3){return db[_0xab0c('0x47')][_0xab0c('0x66')]()[_0xab0c('0x11')](respondWithResult(_0x3c11e3,null))[_0xab0c('0x5e')](handleError(_0x3c11e3,null));};exports[_0xab0c('0x67')]=function(_0x268476,_0x877930){if(_0x268476['body']['id']){delete _0x268476[_0xab0c('0x62')]['id'];}return db[_0xab0c('0x47')][_0xab0c('0x61')]({'where':{'id':_0x268476[_0xab0c('0x64')]['id']}})['then'](handleEntityNotFound(_0x877930,null))[_0xab0c('0x11')](function(_0x313c8c){if(_0x313c8c){_0x268476[_0xab0c('0x62')][_0xab0c('0x68')]=_0x313c8c['id'];return db[_0xab0c('0x69')][_0xab0c('0x6a')](_0x268476[_0xab0c('0x62')]);}})[_0xab0c('0x11')](respondWithResult(_0x877930,null))['catch'](handleError(_0x877930,null));};exports[_0xab0c('0x6b')]=function(_0x2cec37,_0x49e467){var _0x2e67da={'raw':![],'where':{}};var _0x336dd1={};var _0x4b48f4={'count':0x0,'rows':[]};return db[_0xab0c('0x47')][_0xab0c('0x6c')]({'where':{'id':_0x2cec37[_0xab0c('0x64')]['id']}})[_0xab0c('0x11')](handleEntityNotFound(_0x49e467,null))['then'](function(_0x4c6b3a){if(_0x4c6b3a){_0x336dd1[_0xab0c('0x4e')]=_[_0xab0c('0x4c')](db[_0xab0c('0x69')][_0xab0c('0x48')]);_0x336dd1['query']=_['keys'](_0x2cec37[_0xab0c('0x4b')]);_0x336dd1[_0xab0c('0x4d')]=_[_0xab0c('0x4f')](_0x336dd1['model'],_0x336dd1[_0xab0c('0x4b')]);_0x2e67da[_0xab0c('0x51')]=_[_0xab0c('0x4f')](_0x336dd1[_0xab0c('0x4e')],qs[_0xab0c('0x50')](_0x2cec37['query'][_0xab0c('0x50')]));_0x2e67da['attributes']=_0x2e67da[_0xab0c('0x51')]['length']?_0x2e67da['attributes']:_0x336dd1[_0xab0c('0x4e')];if(!_0x2cec37[_0xab0c('0x4b')]['hasOwnProperty'](_0xab0c('0x53'))){_0x2e67da[_0xab0c('0x20')]=qs[_0xab0c('0x20')](_0x2cec37[_0xab0c('0x4b')][_0xab0c('0x20')]);_0x2e67da['offset']=qs[_0xab0c('0x1e')](_0x2cec37[_0xab0c('0x4b')][_0xab0c('0x1e')]);}_0x2e67da[_0xab0c('0x54')]=qs[_0xab0c('0x55')](_0x2cec37['query']['sort']);_0x2e67da['where']=qs['filters'](_[_0xab0c('0x56')](_0x2cec37[_0xab0c('0x4b')],_0x336dd1[_0xab0c('0x4d')]));_0x2e67da[_0xab0c('0x57')][_0xab0c('0x68')]=_0x4c6b3a['id'];if(_0x2cec37['query']['filter']){_0x2e67da[_0xab0c('0x57')]=_[_0xab0c('0x58')](_0x2e67da[_0xab0c('0x57')],{'$or':_[_0xab0c('0x46')](_0x2e67da[_0xab0c('0x51')],function(_0x59e0b8){var _0xb19a94={};_0xb19a94[_0x59e0b8]={'$like':'%'+_0x2cec37[_0xab0c('0x4b')]['filter']+'%'};return _0xb19a94;})});}_0x2e67da=_[_0xab0c('0x58')]({},_0x2e67da,_0x2cec37['options']);return db[_0xab0c('0x69')][_0xab0c('0x21')]({'where':_0x2e67da['where']})[_0xab0c('0x11')](function(_0x1496c3){_0x4b48f4[_0xab0c('0x21')]=_0x1496c3;if(_0x2cec37[_0xab0c('0x4b')]['includeAll']){_0x2e67da[_0xab0c('0x5b')]=[{'all':!![]}];}return db[_0xab0c('0x69')]['findAll'](_0x2e67da);})[_0xab0c('0x11')](function(_0x2ef967){_0x4b48f4['rows']=_0x2ef967;return _0x4b48f4;});}})[_0xab0c('0x11')](respondWithFilteredResult(_0x49e467,_0x2e67da))[_0xab0c('0x5e')](handleError(_0x49e467,null));};exports['removeDispositions']=function(_0x3549de,_0x22d9ce){return db[_0xab0c('0x47')][_0xab0c('0x61')]({'where':{'id':_0x3549de[_0xab0c('0x64')]['id']}})[_0xab0c('0x11')](handleEntityNotFound(_0x22d9ce,null))[_0xab0c('0x11')](function(_0x28d1fe){if(_0x28d1fe){return _0x28d1fe[_0xab0c('0x6d')](_0x3549de[_0xab0c('0x4b')][_0xab0c('0x6e')]);}})[_0xab0c('0x11')](respondWithStatusCode(_0x22d9ce,null))[_0xab0c('0x5e')](handleError(_0x22d9ce,null));};exports[_0xab0c('0x6f')]=function(_0x3e830d,_0x575f2d){if(_0x3e830d[_0xab0c('0x62')]['id']){delete _0x3e830d[_0xab0c('0x62')]['id'];}return db[_0xab0c('0x47')][_0xab0c('0x61')]({'where':{'id':_0x3e830d[_0xab0c('0x64')]['id']}})[_0xab0c('0x11')](handleEntityNotFound(_0x575f2d,null))[_0xab0c('0x11')](function(_0x2d599f){if(_0x2d599f){_0x3e830d['body'][_0xab0c('0x68')]=_0x2d599f['id'];return db[_0xab0c('0x70')][_0xab0c('0x6a')](_0x3e830d['body']);}})[_0xab0c('0x11')](respondWithResult(_0x575f2d,null))[_0xab0c('0x5e')](handleError(_0x575f2d,null));};exports[_0xab0c('0x71')]=function(_0x18fc0f,_0x4b231e){var _0x84ed55={'raw':![],'where':{}};var _0x7a40fe={};var _0x27d046={'count':0x0,'rows':[]};return db['MailAccount'][_0xab0c('0x6c')]({'where':{'id':_0x18fc0f[_0xab0c('0x64')]['id']}})[_0xab0c('0x11')](handleEntityNotFound(_0x4b231e,null))[_0xab0c('0x11')](function(_0x1ce940){if(_0x1ce940){_0x7a40fe[_0xab0c('0x4e')]=_[_0xab0c('0x4c')](db[_0xab0c('0x70')][_0xab0c('0x48')]);_0x7a40fe[_0xab0c('0x4b')]=_[_0xab0c('0x4c')](_0x18fc0f[_0xab0c('0x4b')]);_0x7a40fe['filters']=_[_0xab0c('0x4f')](_0x7a40fe[_0xab0c('0x4e')],_0x7a40fe[_0xab0c('0x4b')]);_0x84ed55['attributes']=_['intersection'](_0x7a40fe[_0xab0c('0x4e')],qs[_0xab0c('0x50')](_0x18fc0f[_0xab0c('0x4b')]['fields']));_0x84ed55[_0xab0c('0x51')]=_0x84ed55[_0xab0c('0x51')][_0xab0c('0x5f')]?_0x84ed55[_0xab0c('0x51')]:_0x7a40fe[_0xab0c('0x4e')];if(!_0x18fc0f[_0xab0c('0x4b')][_0xab0c('0x52')](_0xab0c('0x53'))){_0x84ed55[_0xab0c('0x20')]=qs[_0xab0c('0x20')](_0x18fc0f[_0xab0c('0x4b')][_0xab0c('0x20')]);_0x84ed55[_0xab0c('0x1e')]=qs[_0xab0c('0x1e')](_0x18fc0f['query'][_0xab0c('0x1e')]);}_0x84ed55[_0xab0c('0x54')]=qs['sort'](_0x18fc0f[_0xab0c('0x4b')]['sort']);_0x84ed55[_0xab0c('0x57')]=qs[_0xab0c('0x4d')](_[_0xab0c('0x56')](_0x18fc0f['query'],_0x7a40fe[_0xab0c('0x4d')]));_0x84ed55[_0xab0c('0x57')][_0xab0c('0x68')]=_0x1ce940['id'];if(_0x18fc0f[_0xab0c('0x4b')][_0xab0c('0x59')]){_0x84ed55[_0xab0c('0x57')]=_[_0xab0c('0x58')](_0x84ed55[_0xab0c('0x57')],{'$or':_[_0xab0c('0x46')](_0x84ed55['attributes'],function(_0x58fd73){var _0x128106={};_0x128106[_0x58fd73]={'$like':'%'+_0x18fc0f[_0xab0c('0x4b')][_0xab0c('0x59')]+'%'};return _0x128106;})});}_0x84ed55=_[_0xab0c('0x58')]({},_0x84ed55,_0x18fc0f[_0xab0c('0x60')]);return db[_0xab0c('0x70')][_0xab0c('0x21')]({'where':_0x84ed55['where']})[_0xab0c('0x11')](function(_0x9eb97){_0x27d046['count']=_0x9eb97;if(_0x18fc0f['query'][_0xab0c('0x5a')]){_0x84ed55[_0xab0c('0x5b')]=[{'all':!![]}];}return db[_0xab0c('0x70')][_0xab0c('0x5c')](_0x84ed55);})[_0xab0c('0x11')](function(_0x54b47a){_0x27d046[_0xab0c('0x5d')]=_0x54b47a;return _0x27d046;});}})[_0xab0c('0x11')](respondWithFilteredResult(_0x4b231e,_0x84ed55))[_0xab0c('0x5e')](handleError(_0x4b231e,null));};exports['removeAnswers']=function(_0xb902fb,_0x14969f){return db[_0xab0c('0x47')][_0xab0c('0x61')]({'where':{'id':_0xb902fb[_0xab0c('0x64')]['id']}})['then'](handleEntityNotFound(_0x14969f,null))['then'](function(_0xc613f1){if(_0xc613f1){return _0xc613f1[_0xab0c('0x72')](_0xb902fb[_0xab0c('0x4b')]['ids']);}})[_0xab0c('0x11')](respondWithStatusCode(_0x14969f,null))[_0xab0c('0x5e')](handleError(_0x14969f,null));};exports['create']=function(_0x581280,_0x61bcc8){var _0x52d731={'name':_0x581280['body'][_0xab0c('0x2a')],'key':_0x581280[_0xab0c('0x62')][_0xab0c('0x73')],'provider':_0x581280[_0xab0c('0x62')][_0xab0c('0x63')]===_0xab0c('0x74')?null:_0x581280[_0xab0c('0x62')][_0xab0c('0x63')],'email':_0x581280[_0xab0c('0x62')][_0xab0c('0x75')],'ListId':_0x581280[_0xab0c('0x62')]['ListId'],'active':!_[_0xab0c('0x76')](_0x581280[_0xab0c('0x62')]['active'])?_0x581280[_0xab0c('0x62')]['active']:!![],'description':_0x581280['body'][_0xab0c('0x77')]||null};var _0x531442=getAuthenticationOptions(_0x52d731[_0xab0c('0x63')],_0x581280[_0xab0c('0x62')]);_0x52d731['Imap']=_0x531442[_0xab0c('0x40')];_0x52d731[_0xab0c('0x41')]=_0x531442[_0xab0c('0x41')];return db['MailAccount'][_0xab0c('0x6a')](_0x52d731,{'include':[{'model':db[_0xab0c('0x43')],'as':_0xab0c('0x41')},{'model':db['MailServerIn'],'as':_0xab0c('0x40')}]})[_0xab0c('0x11')](function(_0xdcf112){var _0x1bc81c=_0x581280[_0xab0c('0x35')][_0xab0c('0x26')]({'plain':!![]});if(!_0x1bc81c)throw new Error(_0xab0c('0x78'));if(_0x1bc81c[_0xab0c('0x79')]===_0xab0c('0x35')){var _0x5aa5c7=_0xdcf112[_0xab0c('0x26')]({'plain':!![]});return db[_0xab0c('0x7a')][_0xab0c('0x61')]({'where':{'name':_0xab0c('0x7b'),'userProfileId':_0x1bc81c[_0xab0c('0x7c')]},'raw':!![]})[_0xab0c('0x11')](function(_0x45fa6a){if(_0x45fa6a&&_0x45fa6a[_0xab0c('0x7d')]===0x0){return db[_0xab0c('0x27')]['create']({'name':_0x5aa5c7[_0xab0c('0x2a')],'resourceId':_0x5aa5c7['id'],'type':_0x45fa6a['name'],'sectionId':_0x45fa6a['id']},{})[_0xab0c('0x11')](function(){return _0xdcf112;});}else{return _0xdcf112;}})[_0xab0c('0x5e')](function(_0x48e121){logger[_0xab0c('0x17')](_0xab0c('0x7e'),_0x48e121);throw _0x48e121;});}return _0xdcf112;})[_0xab0c('0x11')](respondWithResult(_0x61bcc8,0xc9))[_0xab0c('0x5e')](handleError(_0x61bcc8,null));};exports['getImap']=function(_0x58a080,_0x2b60af){return db['MailAccount'][_0xab0c('0x6c')]({'where':{'id':_0x58a080[_0xab0c('0x64')]['id']}})[_0xab0c('0x11')](handleEntityNotFound(_0x2b60af,null))[_0xab0c('0x11')](function(_0xd716){if(_0xd716){return _0xd716[_0xab0c('0x7f')]();}return null;})['then'](respondWithResult(_0x2b60af,null))[_0xab0c('0x5e')](handleError(_0x2b60af,null));};exports[_0xab0c('0x80')]=function(_0x5457e8,_0x53de42){if(_0x5457e8['body']['id']){delete _0x5457e8[_0xab0c('0x62')]['id'];}return db[_0xab0c('0x47')][_0xab0c('0x61')]({'where':{'id':_0x5457e8[_0xab0c('0x64')]['id']}})[_0xab0c('0x11')](handleEntityNotFound(_0x53de42,null))['then'](function(_0x34bfb3){if(_0x34bfb3){_0x5457e8[_0xab0c('0x62')]['MailAccountId']=_0x34bfb3['id'];return db[_0xab0c('0x42')][_0xab0c('0x6a')](_0x5457e8['body']);}})[_0xab0c('0x11')](respondWithResult(_0x53de42,null))['catch'](handleError(_0x53de42,null));};exports[_0xab0c('0x81')]=function(_0x4ed147,_0x2e281f){return db['MailAccount'][_0xab0c('0x6c')]({'where':{'id':_0x4ed147[_0xab0c('0x64')]['id']}})['then'](handleEntityNotFound(_0x2e281f,null))[_0xab0c('0x11')](function(_0x5d41c9){if(_0x5d41c9){return _0x5d41c9[_0xab0c('0x82')](null);}return null;})['then'](respondWithStatusCode(_0x2e281f,null))['catch'](handleError(_0x2e281f,null));};exports[_0xab0c('0x83')]=function(_0x202e94,_0x151104){return db[_0xab0c('0x47')][_0xab0c('0x6c')]({'where':{'id':_0x202e94[_0xab0c('0x64')]['id']}})[_0xab0c('0x11')](handleEntityNotFound(_0x151104,null))[_0xab0c('0x11')](function(_0x3c370e){if(_0x3c370e){return _0x3c370e[_0xab0c('0x83')]();}return null;})[_0xab0c('0x11')](respondWithResult(_0x151104,null))['catch'](handleError(_0x151104,null));};exports[_0xab0c('0x84')]=function(_0x394c6e,_0x24bf8f){if(_0x394c6e[_0xab0c('0x62')]['id']){delete _0x394c6e[_0xab0c('0x62')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x394c6e['params']['id']}})[_0xab0c('0x11')](handleEntityNotFound(_0x24bf8f,null))[_0xab0c('0x11')](function(_0x39aceb){if(_0x39aceb){_0x394c6e[_0xab0c('0x62')]['MailAccountId']=_0x39aceb['id'];return db[_0xab0c('0x43')]['create'](_0x394c6e[_0xab0c('0x62')]);}})['then'](respondWithResult(_0x24bf8f,null))[_0xab0c('0x5e')](handleError(_0x24bf8f,null));};exports[_0xab0c('0x85')]=function(_0x2c40c9,_0x3b8c99){return db[_0xab0c('0x47')][_0xab0c('0x6c')]({'where':{'id':_0x2c40c9[_0xab0c('0x64')]['id']}})['then'](handleEntityNotFound(_0x3b8c99,null))[_0xab0c('0x11')](function(_0x14c047){if(_0x14c047){return _0x14c047['setSmtp'](null);}return null;})[_0xab0c('0x11')](respondWithStatusCode(_0x3b8c99,null))[_0xab0c('0x5e')](handleError(_0x3b8c99,null));};exports[_0xab0c('0x86')]=function(_0x5455ae,_0x3328d6){return db[_0xab0c('0x87')][_0xab0c('0x61')]({'where':{'id':_0x5455ae['params']['id']}})['then'](handleEntityNotFound(_0x3328d6,null))[_0xab0c('0x11')](function(_0x35fd0e){if(_0x35fd0e){return _0x35fd0e[_0xab0c('0x86')](_0x5455ae[_0xab0c('0x62')][_0xab0c('0x6e')],_[_0xab0c('0x88')](_0x5455ae[_0xab0c('0x62')],[_0xab0c('0x6e'),'id'])||{});}})['then'](respondWithResult(_0x3328d6,null))['catch'](handleError(_0x3328d6,null));};exports['getInteractions']=function(_0x313af7,_0x2b5323){var _0x43d9e8={'raw':![],'where':{}};var _0x11bd8e={};var _0x1ff2cf={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x313af7[_0xab0c('0x64')]['id']}})[_0xab0c('0x11')](handleEntityNotFound(_0x2b5323,null))[_0xab0c('0x11')](function(_0x320066){if(_0x320066){_0x11bd8e[_0xab0c('0x4e')]=_[_0xab0c('0x4c')](db['MailInteraction'][_0xab0c('0x48')]);_0x11bd8e['query']=_[_0xab0c('0x4c')](_0x313af7[_0xab0c('0x4b')]);_0x11bd8e[_0xab0c('0x4d')]=_[_0xab0c('0x4f')](_0x11bd8e[_0xab0c('0x4e')],_0x11bd8e['query']);_0x43d9e8['attributes']=_[_0xab0c('0x4f')](_0x11bd8e['model'],qs[_0xab0c('0x50')](_0x313af7[_0xab0c('0x4b')]['fields']));_0x43d9e8[_0xab0c('0x51')]=_0x43d9e8[_0xab0c('0x51')][_0xab0c('0x5f')]?_0x43d9e8[_0xab0c('0x51')]:_0x11bd8e[_0xab0c('0x4e')];if(!_0x313af7[_0xab0c('0x4b')][_0xab0c('0x52')](_0xab0c('0x53'))){_0x43d9e8[_0xab0c('0x20')]=qs[_0xab0c('0x20')](_0x313af7[_0xab0c('0x4b')][_0xab0c('0x20')]);_0x43d9e8['offset']=qs[_0xab0c('0x1e')](_0x313af7[_0xab0c('0x4b')][_0xab0c('0x1e')]);}_0x43d9e8[_0xab0c('0x54')]=qs[_0xab0c('0x55')](_0x313af7[_0xab0c('0x4b')][_0xab0c('0x55')]);_0x43d9e8['where']=qs[_0xab0c('0x4d')](_[_0xab0c('0x56')](_0x313af7[_0xab0c('0x4b')],_0x11bd8e['filters']));_0x43d9e8[_0xab0c('0x57')]['MailAccountId']=_0x320066['id'];if(_0x313af7['query']['filter']){_0x43d9e8['where']=_[_0xab0c('0x58')](_0x43d9e8[_0xab0c('0x57')],{'$or':_[_0xab0c('0x46')](_0x43d9e8[_0xab0c('0x51')],function(_0x4e00f7){var _0x4e5951={};_0x4e5951[_0x4e00f7]={'$like':'%'+_0x313af7['query'][_0xab0c('0x59')]+'%'};return _0x4e5951;})});}_0x43d9e8=_[_0xab0c('0x58')]({},_0x43d9e8,_0x313af7[_0xab0c('0x60')]);return db[_0xab0c('0x87')]['count']({'where':_0x43d9e8[_0xab0c('0x57')]})[_0xab0c('0x11')](function(_0x28d6e5){_0x1ff2cf[_0xab0c('0x21')]=_0x28d6e5;if(_0x313af7[_0xab0c('0x4b')][_0xab0c('0x5a')]){_0x43d9e8[_0xab0c('0x5b')]=[{'model':db[_0xab0c('0x89')],'as':_0xab0c('0x8a'),'required':![]},{'model':db[_0xab0c('0x8b')],'as':_0xab0c('0x8c'),'attributes':[_0xab0c('0x2a'),_0xab0c('0x8d'),_0xab0c('0x8e')],'required':![]},{'model':db[_0xab0c('0x8f')],'as':_0xab0c('0x90'),'attributes':['id',_0xab0c('0x2a'),_0xab0c('0x91')],'where':_0x313af7[_0xab0c('0x4b')][_0xab0c('0x92')]?{'id':_0x313af7[_0xab0c('0x4b')][_0xab0c('0x92')]}:undefined,'required':_0x313af7[_0xab0c('0x4b')][_0xab0c('0x92')]?!![]:![]}];}return db[_0xab0c('0x87')][_0xab0c('0x5c')](_0x43d9e8);})[_0xab0c('0x11')](function(_0x239fac){_0x1ff2cf[_0xab0c('0x5d')]=_0x239fac;return _0x1ff2cf;});}})[_0xab0c('0x11')](respondWithFilteredResult(_0x2b5323,_0x43d9e8))[_0xab0c('0x5e')](handleError(_0x2b5323,null));};exports[_0xab0c('0x93')]=function addApplications(_0xfccc20,_0x10a0b3){var _0x29106d=_0xfccc20[_0xab0c('0x64')]['id'];var _0x3db139=_0xfccc20['body'];var _0x41c743=0xc8;var _0xb33bd5=null;return db['sequelize'][_0xab0c('0x94')]({'isolationLevel':db[_0xab0c('0x95')][_0xab0c('0x96')]['ISOLATION_LEVELS'][_0xab0c('0x97')]},function(_0x44aa8a){return db[_0xab0c('0x47')][_0xab0c('0x6c')]({'where':{'id':_0x29106d},'transaction':_0x44aa8a})['then'](function(_0x1f669b){if(_0x1f669b){return db['MailApplication'][_0xab0c('0x25')]({'where':{'MailAccountId':_0x29106d},'transaction':_0x44aa8a})[_0xab0c('0x11')](function(){var _0x3b6c3b=_[_0xab0c('0x46')](_0x3db139,function(_0x1546d4){_0x1546d4[_0xab0c('0x68')]=_0x29106d;return _0x1546d4;});return db[_0xab0c('0x98')]['bulkCreate'](_0x3b6c3b,{'transaction':_0x44aa8a});});}else{_0x41c743=0x194;_0xb33bd5=[];}});})[_0xab0c('0x11')](function(){if(_0x41c743!==0x194){return db[_0xab0c('0x98')][_0xab0c('0x99')]({'where':{'MailAccountId':_0x29106d},'order':_0xab0c('0x9a')})[_0xab0c('0x11')](function(_0x47277e){_0xb33bd5=_0x47277e;});}})[_0xab0c('0x5e')](function(_0x2e2fe8){_0x41c743=0x1f4;logger[_0xab0c('0x17')](_0x2e2fe8['stack']);if(_0x2e2fe8[_0xab0c('0x2a')]){delete _0x2e2fe8[_0xab0c('0x2a')];}_0xb33bd5=_0x2e2fe8;})[_0xab0c('0x9b')](function(){if(_0xb33bd5===null){_0x10a0b3[_0xab0c('0x1b')](_0x41c743);}else{if(_0x41c743===0x1f4){_0x10a0b3['status'](_0x41c743)['send'](_0xb33bd5);}else{_0x10a0b3[_0xab0c('0x1c')](_0x41c743)['json'](_0xb33bd5);}}});};exports[_0xab0c('0x9c')]=function(_0x17f0d3,_0x390b80){var _0x477afc={};var _0x5e889f={};var _0x242395;var _0x224225;return db[_0xab0c('0x47')]['findOne']({'where':{'id':_0x17f0d3['params']['id']}})[_0xab0c('0x11')](handleEntityNotFound(_0x390b80,null))['then'](function(_0x317591){if(_0x317591){_0x242395=_0x317591;_0x5e889f[_0xab0c('0x4e')]=_[_0xab0c('0x4c')](db[_0xab0c('0x98')]['rawAttributes']);_0x5e889f[_0xab0c('0x4b')]=_[_0xab0c('0x4c')](_0x17f0d3[_0xab0c('0x4b')]);_0x5e889f['filters']=_['intersection'](_0x5e889f[_0xab0c('0x4e')],_0x5e889f['query']);_0x477afc[_0xab0c('0x51')]=_[_0xab0c('0x4f')](_0x5e889f['model'],qs[_0xab0c('0x50')](_0x17f0d3[_0xab0c('0x4b')][_0xab0c('0x50')]));_0x477afc[_0xab0c('0x51')]=_0x477afc[_0xab0c('0x51')][_0xab0c('0x5f')]?_0x477afc[_0xab0c('0x51')]:_0x5e889f[_0xab0c('0x4e')];_0x477afc[_0xab0c('0x54')]=qs[_0xab0c('0x55')](_0x17f0d3[_0xab0c('0x4b')][_0xab0c('0x55')]);_0x477afc['where']=qs[_0xab0c('0x4d')](_[_0xab0c('0x56')](_0x17f0d3[_0xab0c('0x4b')],_0x5e889f[_0xab0c('0x4d')]));if(_0x17f0d3['query'][_0xab0c('0x59')]){_0x477afc[_0xab0c('0x57')]=_[_0xab0c('0x58')](_0x477afc[_0xab0c('0x57')],{'$or':_[_0xab0c('0x46')](_0x477afc[_0xab0c('0x51')],function(_0x9081f1){var _0x38859f={};_0x38859f[_0x9081f1]={'$like':'%'+_0x17f0d3[_0xab0c('0x4b')][_0xab0c('0x59')]+'%'};return _0x38859f;})});}_0x477afc=_[_0xab0c('0x58')]({},_0x477afc,_0x17f0d3[_0xab0c('0x60')]);return _0x242395[_0xab0c('0x9c')](_0x477afc);}})[_0xab0c('0x11')](function(_0x48503c){if(_0x48503c){_0x224225=_0x48503c['length'];if(!_0x17f0d3[_0xab0c('0x4b')]['hasOwnProperty'](_0xab0c('0x53'))){_0x477afc[_0xab0c('0x20')]=qs[_0xab0c('0x20')](_0x17f0d3[_0xab0c('0x4b')][_0xab0c('0x20')]);_0x477afc[_0xab0c('0x1e')]=qs[_0xab0c('0x1e')](_0x17f0d3[_0xab0c('0x4b')]['offset']);}return _0x242395[_0xab0c('0x9c')](_0x477afc);}})[_0xab0c('0x11')](function(_0x241105){if(_0x241105){return _0x241105?{'count':_0x224225,'rows':_0x241105}:null;}})[_0xab0c('0x11')](respondWithResult(_0x390b80,null))['catch'](handleError(_0x390b80,null));};exports['getMessages']=function(_0xfd96b6,_0x45e6f5){var _0x15f2dd={'raw':!![],'where':{}};var _0x1573a3={};var _0x385e4f={'count':0x0,'rows':[]};return db[_0xab0c('0x47')][_0xab0c('0x6c')]({'where':{'id':_0xfd96b6[_0xab0c('0x64')]['id']}})['then'](handleEntityNotFound(_0x45e6f5,null))[_0xab0c('0x11')](function(_0x21a4cb){if(_0x21a4cb){_0x1573a3[_0xab0c('0x4e')]=_['keys'](db['MailMessage'][_0xab0c('0x48')]);_0x1573a3[_0xab0c('0x4b')]=_['keys'](_0xfd96b6[_0xab0c('0x4b')]);_0x1573a3[_0xab0c('0x4d')]=_['intersection'](_0x1573a3[_0xab0c('0x4e')],_0x1573a3[_0xab0c('0x4b')]);_0x15f2dd[_0xab0c('0x51')]=_[_0xab0c('0x4f')](_0x1573a3[_0xab0c('0x4e')],qs[_0xab0c('0x50')](_0xfd96b6['query']['fields']));_0x15f2dd[_0xab0c('0x51')]=_0x15f2dd[_0xab0c('0x51')][_0xab0c('0x5f')]?_0x15f2dd['attributes']:_0x1573a3[_0xab0c('0x4e')];if(!_0xfd96b6[_0xab0c('0x4b')][_0xab0c('0x52')](_0xab0c('0x53'))){_0x15f2dd[_0xab0c('0x20')]=qs[_0xab0c('0x20')](_0xfd96b6[_0xab0c('0x4b')][_0xab0c('0x20')]);_0x15f2dd[_0xab0c('0x1e')]=qs[_0xab0c('0x1e')](_0xfd96b6['query']['offset']);}_0x15f2dd[_0xab0c('0x54')]=qs[_0xab0c('0x55')](_0xfd96b6[_0xab0c('0x4b')][_0xab0c('0x55')]);_0x15f2dd['where']=qs[_0xab0c('0x4d')](_[_0xab0c('0x56')](_0xfd96b6[_0xab0c('0x4b')],_0x1573a3[_0xab0c('0x4d')]));_0x15f2dd['where'][_0xab0c('0x68')]=_0x21a4cb['id'];if(_0xfd96b6[_0xab0c('0x4b')]['filter']){_0x15f2dd[_0xab0c('0x57')]=_['merge'](_0x15f2dd['where'],{'$or':_[_0xab0c('0x46')](_0x15f2dd[_0xab0c('0x51')],function(_0x443015){var _0xbeba96={};_0xbeba96[_0x443015]={'$like':'%'+_0xfd96b6[_0xab0c('0x4b')][_0xab0c('0x59')]+'%'};return _0xbeba96;})});}if(_0xfd96b6[_0xab0c('0x4b')][_0xab0c('0x9d')]){var _0x28762a=_0xfd96b6[_0xab0c('0x4b')]['$gte']['split'](',');var _0x4ce851={};_0x4ce851[_0x28762a[0x0]]={'$gte':moment(_0x28762a[0x1])[_0xab0c('0x9e')](_0xab0c('0x9f'))};_0x15f2dd[_0xab0c('0x57')]=_[_0xab0c('0x58')](_0x15f2dd['where'],_0x4ce851);}_0x15f2dd=_[_0xab0c('0x58')]({},_0x15f2dd,_0xfd96b6['options']);return db[_0xab0c('0xa0')][_0xab0c('0x21')]({'where':_0x15f2dd[_0xab0c('0x57')]})[_0xab0c('0x11')](function(_0x2c8c25){_0x385e4f[_0xab0c('0x21')]=_0x2c8c25;if(_0xfd96b6[_0xab0c('0x4b')][_0xab0c('0x5a')]){_0x15f2dd['include']=[{'all':!![]}];}return db[_0xab0c('0xa0')]['findAll'](_0x15f2dd);})[_0xab0c('0x11')](function(_0x56db9f){if(_0xfd96b6[_0xab0c('0x4b')][_0xab0c('0xa1')]==='true'){for(var _0x5bc695=0x0;_0x5bc695<_0x56db9f[_0xab0c('0x5f')];_0x5bc695++){_0x56db9f[_0x5bc695][_0xab0c('0x62')]=juice(_0x56db9f[_0x5bc695][_0xab0c('0x62')]);}}_0x385e4f[_0xab0c('0x5d')]=_0x56db9f;return _0x385e4f;});}})[_0xab0c('0x11')](respondWithFilteredResult(_0x45e6f5,_0x15f2dd))[_0xab0c('0x5e')](handleError(_0x45e6f5,null));};exports[_0xab0c('0x2b')]=function(_0x12df92,_0x12efa5){var _0x9d4e2d,_0x35082a={},_0x513a9a;if(_0x12df92[_0xab0c('0x62')]['to']){_0x513a9a=_0x12df92['body']['to'][_0xab0c('0xa2')](',')[0x0];}return db[_0xab0c('0x47')][_0xab0c('0x61')]({'where':{'id':_0x12df92[_0xab0c('0x64')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0xab0c('0xa3'),'where':{'email':_0x513a9a},'limit':0x1,'order':[[_0xab0c('0xa4'),_0xab0c('0xa5')]]}]},{'model':db[_0xab0c('0x43')],'as':_0xab0c('0x41'),'raw':!![],'include':[{'model':db[_0xab0c('0xa6')],'as':_0xab0c('0xa6'),'raw':!![]}]}]})[_0xab0c('0x11')](handleEntityNotFound(_0x12efa5,null))[_0xab0c('0x11')](function(_0x28fca5){if(!_0x28fca5)return;_0x9d4e2d=_0x28fca5;if(!_0x28fca5[_0xab0c('0x41')])throw new Error(_0xab0c('0xa7'));if(_[_0xab0c('0x76')](_0x12df92[_0xab0c('0x62')]['from'])){_0x12df92[_0xab0c('0x62')][_0xab0c('0xa8')]=util[_0xab0c('0x9e')](_0xab0c('0xa9'),_0x28fca5[_0xab0c('0x2a')],_0x28fca5[_0xab0c('0x75')]||_0x28fca5['Smtp'][_0xab0c('0x35')]);}if(_0x12df92[_0xab0c('0x62')][_0xab0c('0xaa')]&&_0x12df92[_0xab0c('0x62')][_0xab0c('0xaa')][_0xab0c('0x5f')]){for(var _0x2406f4=0x0;_0x2406f4<_0x12df92[_0xab0c('0x62')]['attachments'][_0xab0c('0x5f')];_0x2406f4+=0x1){_0x12df92[_0xab0c('0x62')][_0xab0c('0xaa')][_0x2406f4]={'filename':_0x12df92[_0xab0c('0x62')]['attachments'][_0x2406f4][_0xab0c('0x2a')],'path':path[_0xab0c('0xab')](config['root'],_0xab0c('0xac'),_0x12df92['body'][_0xab0c('0xaa')][_0x2406f4][_0xab0c('0xad')])};}}var _0x2ca542=_0x28fca5[_0xab0c('0xae')]();return respondWithRpcPromise(_0xab0c('0xaf'),'sendMail',{'account':_0x2ca542,'message':_0x12df92[_0xab0c('0x62')]});})['then'](function(_0x2f4b78){if(!_0x2f4b78)return;_0x35082a=_0x2f4b78;if(!_0x9d4e2d[_0xab0c('0xb0')])throw new Error(_0xab0c('0xb1'));if(_0x9d4e2d['List'][_0xab0c('0xa3')][_0xab0c('0x5f')])return _0x9d4e2d[_0xab0c('0xb0')]['Contacts'][0x0];return db[_0xab0c('0x89')][_0xab0c('0x6a')](_[_0xab0c('0xa')](_0x12df92[_0xab0c('0x62')],{'firstName':_0x12df92['body']['to'],'email':_0x12df92[_0xab0c('0x62')]['to'],'phone':_0x12df92[_0xab0c('0x62')]['to'],'ListId':_0x9d4e2d['ListId']}));})[_0xab0c('0x11')](function(_0x2b5d23){if(!_0x2b5d23)return;var _0x3f4e0f={'UserId':_0x12df92['user']['id'],'ContactId':_0x2b5d23['id'],'MailAccountId':_0x9d4e2d['id'],'inReplyTo':_0x35082a[_0xab0c('0xb2')],'to':_0x12df92['body'][_0xab0c('0xa8')],'cc':_0x12df92['body']['cc'],'subject':_0x12df92[_0xab0c('0x62')][_0xab0c('0xb3')],'attach':_0x12df92['body'][_0xab0c('0xb4')],'firstMsgDirection':'out','lastMsgAt':moment()[_0xab0c('0x9e')](_0xab0c('0x9f')),'lastMsgDirection':'out','Messages':[_[_0xab0c('0x58')](_0x12df92[_0xab0c('0x62')],{'messageId':_0x35082a[_0xab0c('0xb2')],'sentAt':moment()[_0xab0c('0x9e')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x9d4e2d['id'],'UserId':_0x12df92[_0xab0c('0x35')]['id'],'ContactId':_0x2b5d23['id']})]};if(_0x12df92[_0xab0c('0x62')][_0xab0c('0xb5')]){_0x3f4e0f=_['merge'](_0x3f4e0f,_0x12df92['body'][_0xab0c('0xb5')]);}return db[_0xab0c('0x87')][_0xab0c('0x6a')](_0x3f4e0f,{'include':[{'model':db[_0xab0c('0xa0')],'as':_0xab0c('0xb6')}]});})[_0xab0c('0x11')](respondWithResult(_0x12efa5,null))[_0xab0c('0x5e')](handleError(_0x12efa5,null));};exports[_0xab0c('0xb7')]=function(_0x40957a,_0x51dd19){return db[_0xab0c('0x47')][_0xab0c('0x61')]({'where':{'id':_0x40957a[_0xab0c('0x64')]['id']},'include':[{'model':db[_0xab0c('0x43')],'as':_0xab0c('0x41'),'raw':!![],'include':[{'model':db[_0xab0c('0xa6')],'as':_0xab0c('0xa6'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x51dd19,null))[_0xab0c('0x11')](function(_0x599729){if(!_0x599729[_0xab0c('0x41')])return;var _0x4bb217=_0x599729['getSmtpOptions']();return respondWithRpcPromise(_0xab0c('0xb8'),_0xab0c('0xb7'),{'account':_0x4bb217});})[_0xab0c('0x11')](respondWithResult(_0x51dd19,null))[_0xab0c('0x5e')](handleError(_0x51dd19,null));};exports['destroy']=function(_0x26496f,_0x5ada29){return db[_0xab0c('0x47')][_0xab0c('0x61')]({'where':{'id':_0x26496f[_0xab0c('0x64')]['id']}})[_0xab0c('0x11')](handleEntityNotFound(_0x5ada29,null))[_0xab0c('0x11')](function(_0x4f5e65){if(_0x4f5e65&&_0x4f5e65[_0xab0c('0x3e')]){throw new db[(_0xab0c('0xb9'))][(_0xab0c('0xba'))](_0xab0c('0xbb'));}return _0x4f5e65;})[_0xab0c('0x11')](removeEntity(_0x5ada29,null))[_0xab0c('0x5e')](handleError(_0x5ada29,null));};exports[_0xab0c('0xbc')]=function(_0x589792,_0x2ecea9){return db[_0xab0c('0x47')]['find']({'where':{'id':_0x589792[_0xab0c('0x64')]['id']}})[_0xab0c('0x11')](handleEntityNotFound(_0x2ecea9,null))[_0xab0c('0x11')](function(_0x4595ab){if(_0x4595ab){return _0x4595ab[_0xab0c('0xbc')](_0x589792[_0xab0c('0x62')][_0xab0c('0x6e')],_[_0xab0c('0x88')](_0x589792[_0xab0c('0x62')],[_0xab0c('0x6e'),'id'])||{})[_0xab0c('0xbd')](function(_0x2ce988){for(var _0x465c72=0x0;_0x465c72<_0x589792[_0xab0c('0x62')]['ids']['length'];_0x465c72+=0x1){socket[_0xab0c('0xbe')](_0xab0c('0xbf'),{'UserId':Number(_0x589792[_0xab0c('0x62')]['ids'][_0x465c72]),'MailAccountId':Number(_0x589792[_0xab0c('0x64')]['id'])});}return _0x2ce988;});}})['then'](respondWithResult(_0x2ecea9,null))['catch'](handleError(_0x2ecea9,null));};exports[_0xab0c('0xc0')]=function(_0x5bd559,_0x26b4d8){return db['MailAccount'][_0xab0c('0x61')]({'where':{'id':_0x5bd559['params']['id']}})[_0xab0c('0x11')](handleEntityNotFound(_0x26b4d8,null))[_0xab0c('0x11')](function(_0x2e6e58){if(_0x2e6e58){return _0x2e6e58['removeAgents'](_0x5bd559['query'][_0xab0c('0x6e')])[_0xab0c('0x11')](function(){if(_[_0xab0c('0xc1')](_0x5bd559[_0xab0c('0x4b')][_0xab0c('0x6e')])){for(var _0x9bfd62=0x0;_0x9bfd62<_0x5bd559[_0xab0c('0x4b')]['ids'][_0xab0c('0x5f')];_0x9bfd62+=0x1){socket[_0xab0c('0xbe')](_0xab0c('0xc2'),{'UserId':Number(_0x5bd559[_0xab0c('0x4b')]['ids'][_0x9bfd62]),'MailAccountId':Number(_0x5bd559[_0xab0c('0x64')]['id'])});}}else{socket[_0xab0c('0xbe')](_0xab0c('0xc2'),{'UserId':Number(_0x5bd559['query'][_0xab0c('0x6e')]),'MailAccountId':Number(_0x5bd559[_0xab0c('0x64')]['id'])});}});}})[_0xab0c('0x11')](respondWithStatusCode(_0x26b4d8,null))[_0xab0c('0x5e')](handleError(_0x26b4d8,null));};exports[_0xab0c('0xc3')]=function(_0x5510f0,_0x467c94){var _0x3e852a={};var _0x1b044c={};var _0x10b069;var _0x1a8ff8;return db[_0xab0c('0x47')]['findOne']({'where':{'id':_0x5510f0[_0xab0c('0x64')]['id']}})[_0xab0c('0x11')](handleEntityNotFound(_0x467c94,null))['then'](function(_0x271ce5){if(_0x271ce5){_0x10b069=_0x271ce5;_0x1b044c['model']=_['keys'](db['User'][_0xab0c('0x48')]);_0x1b044c['query']=_[_0xab0c('0x4c')](_0x5510f0['query']);_0x1b044c['filters']=_['intersection'](_0x1b044c[_0xab0c('0x4e')],_0x1b044c['query']);_0x3e852a[_0xab0c('0x51')]=_[_0xab0c('0x4f')](_0x1b044c[_0xab0c('0x4e')],qs[_0xab0c('0x50')](_0x5510f0[_0xab0c('0x4b')]['fields']));_0x3e852a[_0xab0c('0x51')]=_0x3e852a[_0xab0c('0x51')][_0xab0c('0x5f')]?_0x3e852a[_0xab0c('0x51')]:_0x1b044c[_0xab0c('0x4e')];_0x3e852a[_0xab0c('0x54')]=qs['sort'](_0x5510f0[_0xab0c('0x4b')]['sort']);_0x3e852a[_0xab0c('0x57')]=qs['filters'](_[_0xab0c('0x56')](_0x5510f0['query'],_0x1b044c[_0xab0c('0x4d')]));if(_0x5510f0[_0xab0c('0x4b')]['filter']){_0x3e852a[_0xab0c('0x57')]=_['merge'](_0x3e852a[_0xab0c('0x57')],{'$or':_['map'](_0x3e852a[_0xab0c('0x51')],function(_0x57ace2){var _0x2226eb={};_0x2226eb[_0x57ace2]={'$like':'%'+_0x5510f0['query'][_0xab0c('0x59')]+'%'};return _0x2226eb;})});}_0x3e852a=_['merge']({},_0x3e852a,_0x5510f0[_0xab0c('0x60')]);return _0x10b069[_0xab0c('0xc3')](_0x3e852a);}})[_0xab0c('0x11')](function(_0x169041){if(_0x169041){_0x1a8ff8=_0x169041['length'];if(!_0x5510f0[_0xab0c('0x4b')][_0xab0c('0x52')](_0xab0c('0x53'))){_0x3e852a[_0xab0c('0x20')]=qs[_0xab0c('0x20')](_0x5510f0[_0xab0c('0x4b')]['limit']);_0x3e852a[_0xab0c('0x1e')]=qs[_0xab0c('0x1e')](_0x5510f0[_0xab0c('0x4b')][_0xab0c('0x1e')]);}return _0x10b069['getAgents'](_0x3e852a);}})[_0xab0c('0x11')](function(_0xc0dfaf){if(_0xc0dfaf){return _0xc0dfaf?{'count':_0x1a8ff8,'rows':_0xc0dfaf}:null;}})[_0xab0c('0x11')](respondWithResult(_0x467c94,null))[_0xab0c('0x5e')](handleError(_0x467c94,null));};
\ No newline at end of file
+var _0xce7a=['subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','getSmtpOptions','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','defaults','redis','localhost','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','MailAccounts','UserProfileResource','sendStatus','stack','name','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','hotmail','smtp-mail.outlook.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','index','MailServerIn','map','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','MailAccount','includeAll','include','findAll','rows','Pause','keys','update','body','custom','provider','find','params','MailServerOut','Mail\x20Account\x20not\x20found','describe','addDisposition','Disposition','create','getDispositions','findOne','rawAttributes','options','removeDispositions','ids','addAnswer','MailAccountId','CannedAnswer','getAnswers','removeAnswers','ListId','isNil','active','description','get','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','User','Owner','Tag','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','bulkCreate','priority','finally','getApplications','MailApplication','getMessages','$gte','split','format','MailMessage','updatedAt','DESC','CloudProvider','from','%s\x20<%s>','email','attachments','join','root','server/files/attachments','basename','SendMail','List','List\x20not\x20found','CmContact','messageId'];(function(_0x138d20,_0x459964){var _0x24a54a=function(_0x45bf03){while(--_0x45bf03){_0x138d20['push'](_0x138d20['shift']());}};_0x24a54a(++_0x459964);}(_0xce7a,0x190));var _0xace7=function(_0x5a82f6,_0x7ba288){_0x5a82f6=_0x5a82f6-0x0;var _0x1738a9=_0xce7a[_0x5a82f6];return _0x1738a9;};'use strict';var moment=require('moment');var BPromise=require(_0xace7('0x0'));var util=require(_0xace7('0x1'));var path=require('path');var _=require(_0xace7('0x2'));var juice=require('juice');var Redis=require(_0xace7('0x3'));var qs=require(_0xace7('0x4'));var logger=require('../../config/logger')('api');var config=require(_0xace7('0x5'));var db=require(_0xace7('0x6'))['db'];config['redis']=_[_0xace7('0x7')](config[_0xace7('0x8')],{'host':_0xace7('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xace7('0xa'))[_0xace7('0xb')](socket);var jayson=require(_0xace7('0xc'));var client=jayson[_0xace7('0xd')][_0xace7('0xe')]({'port':0x232b});function respondWithRpcPromise(_0x219f69,_0x591afc,_0x2e58cd,_0x2ce37f){return new BPromise(function(_0x16fe05,_0x283561){var _0x180317=_0x2ce37f||client;return _0x180317[_0xace7('0xf')](_0x219f69,_0x2e58cd)[_0xace7('0x10')](function(_0x9d15c6){logger[_0xace7('0x11')](_0xace7('0x12'),_0x591afc,_0xace7('0x13'));logger[_0xace7('0x14')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x591afc,_0xace7('0x13'),JSON['stringify'](_0x9d15c6));if(_0x9d15c6['error']){if(_0x9d15c6[_0xace7('0x15')][_0xace7('0x16')]===0x1f4){logger[_0xace7('0x15')](_0xace7('0x12'),_0x591afc,_0x9d15c6['error']['message']);return _0x283561(_0x9d15c6[_0xace7('0x15')]['message']);}logger['error']('MailAccount,\x20%s,\x20%s',_0x591afc,_0x9d15c6[_0xace7('0x15')][_0xace7('0x17')]);return _0x16fe05(_0x9d15c6['error'][_0xace7('0x17')]);}else{logger['info'](_0xace7('0x12'),_0x591afc,_0xace7('0x13'));_0x16fe05(_0x9d15c6['result']['message']);}})[_0xace7('0x18')](function(_0x329d0a){logger[_0xace7('0x15')](_0xace7('0x12'),_0x591afc,_0x329d0a);_0x283561(_0x329d0a);});});}function respondWithStatusCode(_0x50e407,_0x202f6e){_0x202f6e=_0x202f6e||0xcc;return function(_0x38fd14){if(_0x38fd14){return _0x50e407['sendStatus'](_0x202f6e);}return _0x50e407[_0xace7('0x19')](_0x202f6e)[_0xace7('0x1a')]();};}function respondWithResult(_0x9f58ca,_0x13e928){_0x13e928=_0x13e928||0xc8;return function(_0x4d2274){if(_0x4d2274){return _0x9f58ca[_0xace7('0x19')](_0x13e928)[_0xace7('0x1b')](_0x4d2274);}};}function respondWithFilteredResult(_0x437e1b,_0x24219a){return function(_0x5b2664){if(_0x5b2664){var _0x5ad6c4=typeof _0x24219a[_0xace7('0x1c')]===_0xace7('0x1d')&&typeof _0x24219a[_0xace7('0x1e')]==='undefined';var _0x304b97=_0x5b2664['count'];var _0x4a1324=_0x5ad6c4?0x0:_0x24219a[_0xace7('0x1c')];var _0xdb04d2=_0x5ad6c4?_0x5b2664[_0xace7('0x1f')]:_0x24219a['offset']+_0x24219a[_0xace7('0x1e')];var _0x252c2c;if(_0xdb04d2>=_0x304b97){_0xdb04d2=_0x304b97;_0x252c2c=0xc8;}else{_0x252c2c=0xce;}_0x437e1b[_0xace7('0x19')](_0x252c2c);return _0x437e1b[_0xace7('0x20')](_0xace7('0x21'),_0x4a1324+'-'+_0xdb04d2+'/'+_0x304b97)[_0xace7('0x1b')](_0x5b2664);}return null;};}function saveUpdates(_0x5d199e){return function(_0xab17a7){if(_0xab17a7){return _0xab17a7['update'](_0x5d199e)['then'](function(_0x57884c){return _0x57884c;});}return null;};}function removeEntity(_0x44ba6c){return function(_0xd8c887){if(_0xd8c887){return _0xd8c887[_0xace7('0x22')]()[_0xace7('0x10')](function(){var _0x321f3a=_0xd8c887['get']({'plain':!![]});var _0x1a9ff=_0xace7('0x23');return db[_0xace7('0x24')][_0xace7('0x22')]({'where':{'type':_0x1a9ff,'resourceId':_0x321f3a['id']}})[_0xace7('0x10')](function(){return _0xd8c887;});})[_0xace7('0x10')](function(){_0x44ba6c[_0xace7('0x19')](0xcc)[_0xace7('0x1a')]();});}};}function handleEntityNotFound(_0x56a126){return function(_0x27bd22){if(!_0x27bd22){_0x56a126[_0xace7('0x25')](0x194);}return _0x27bd22;};}function handleError(_0x59ff21,_0x19b483){_0x19b483=_0x19b483||0x1f4;return function(_0x27f320){logger[_0xace7('0x15')](_0x27f320[_0xace7('0x26')]);if(_0x27f320[_0xace7('0x27')]){delete _0x27f320[_0xace7('0x27')];}_0x59ff21[_0xace7('0x19')](_0x19b483)[_0xace7('0x28')](_0x27f320);};}function getImapHost(_0x81d66d){switch(_0x81d66d){case _0xace7('0x29'):return _0xace7('0x2a');case _0xace7('0x2b'):return _0xace7('0x2c');case'hotmail':return _0xace7('0x2d');case _0xace7('0x2e'):return _0xace7('0x2f');}throw new Error(_0xace7('0x30'),_0x81d66d);}function getSmtpHost(_0x3a52ff){switch(_0x3a52ff){case _0xace7('0x29'):return _0xace7('0x31');case _0xace7('0x2b'):return _0xace7('0x32');case _0xace7('0x33'):return _0xace7('0x34');case'outlook365':return'smtp.office365.com';}throw new Error(_0xace7('0x30'),_0x3a52ff);}function getAuthenticationOptions(_0x1d2c64,_0x2d4b07){var _0x49c3f7={};var _0x512332={};if(_0x1d2c64){_0x49c3f7['user']=_0x512332[_0xace7('0x35')]=_0x2d4b07[_0xace7('0x36')];_0x49c3f7[_0xace7('0x37')]=_0x512332[_0xace7('0x38')]=_0x2d4b07['password'];if(_0x2d4b07[_0xace7('0x39')]){_0x49c3f7[_0xace7('0x39')]=_0x512332[_0xace7('0x39')]=!![];_0x49c3f7['CloudProviderId']=_0x512332[_0xace7('0x3a')]=_0x2d4b07['CloudProviderId'];_0x49c3f7[_0xace7('0x37')]=_0x512332['pass']=null;}else{_0x49c3f7[_0xace7('0x3a')]=_0x512332[_0xace7('0x3a')]=null;}_0x49c3f7[_0xace7('0x3b')]=getImapHost(_0x1d2c64);_0x49c3f7[_0xace7('0x3c')]=0x3e1;_0x512332[_0xace7('0x3b')]=getSmtpHost(_0x1d2c64);_0x512332['port']=0x24b;_0x512332[_0xace7('0x3d')]=![];_0x49c3f7[_0xace7('0x3e')]=_0x512332[_0xace7('0x3e')]=null;}else{if(_0x2d4b07[_0xace7('0x3f')]){_0x49c3f7[_0xace7('0x35')]=_0x512332[_0xace7('0x35')]=_0x2d4b07['username'];_0x49c3f7['password']=_0x512332[_0xace7('0x38')]=_0x2d4b07[_0xace7('0x37')];}else{_0x49c3f7[_0xace7('0x3f')]=_0x512332[_0xace7('0x3f')]=![];_0x49c3f7[_0xace7('0x35')]=_0x512332[_0xace7('0x35')]=null;_0x49c3f7[_0xace7('0x37')]=_0x512332[_0xace7('0x38')]=null;}_0x49c3f7[_0xace7('0x3b')]=_0x2d4b07[_0xace7('0x40')][_0xace7('0x3b')];_0x49c3f7['port']=_0x2d4b07['Imap'][_0xace7('0x3c')];_0x512332[_0xace7('0x3b')]=_0x2d4b07[_0xace7('0x41')]['host'];_0x512332[_0xace7('0x3c')]=_0x2d4b07[_0xace7('0x41')][_0xace7('0x3c')];}return{'Imap':_0x49c3f7,'Smtp':_0x512332};}exports[_0xace7('0x42')]=function(_0x8900ae,_0x10a869){var _0x3e17e9={'include':[{'model':db[_0xace7('0x43')],'as':_0xace7('0x40')},{'model':db['MailServerOut'],'as':_0xace7('0x41')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1a58c5={},_0x55dcaa={'count':0x0,'rows':[]};var _0x47d48e=_[_0xace7('0x44')](db['MailAccount']['rawAttributes'],function(_0x34fdb8){return{'name':_0x34fdb8[_0xace7('0x45')],'type':_0x34fdb8[_0xace7('0x46')][_0xace7('0x47')]};});_0x1a58c5[_0xace7('0x48')]=_['map'](_0x47d48e,_0xace7('0x27'));_0x1a58c5[_0xace7('0x49')]=_['keys'](_0x8900ae[_0xace7('0x49')]);_0x1a58c5[_0xace7('0x4a')]=_['intersection'](_0x1a58c5['model'],_0x1a58c5[_0xace7('0x49')]);_0x3e17e9[_0xace7('0x4b')]=_[_0xace7('0x4c')](_0x1a58c5[_0xace7('0x48')],qs[_0xace7('0x4d')](_0x8900ae[_0xace7('0x49')][_0xace7('0x4d')]));_0x3e17e9['attributes']=_0x3e17e9[_0xace7('0x4b')][_0xace7('0x4e')]?_0x3e17e9['attributes']:_0x1a58c5[_0xace7('0x48')];if(!_0x8900ae['query'][_0xace7('0x4f')](_0xace7('0x50'))){_0x3e17e9[_0xace7('0x1e')]=qs[_0xace7('0x1e')](_0x8900ae[_0xace7('0x49')][_0xace7('0x1e')]);_0x3e17e9[_0xace7('0x1c')]=qs[_0xace7('0x1c')](_0x8900ae[_0xace7('0x49')][_0xace7('0x1c')]);}_0x3e17e9[_0xace7('0x51')]=qs[_0xace7('0x52')](_0x8900ae[_0xace7('0x49')][_0xace7('0x52')]);_0x3e17e9['where']=qs[_0xace7('0x4a')](_[_0xace7('0x53')](_0x8900ae[_0xace7('0x49')],_0x1a58c5[_0xace7('0x4a')]),_0x47d48e);if(_0x8900ae[_0xace7('0x49')][_0xace7('0x54')]){_0x3e17e9[_0xace7('0x55')]=_[_0xace7('0x56')](_0x3e17e9['where'],{'$or':_[_0xace7('0x44')](_0x47d48e,function(_0x4c07af){if(_0x4c07af['type']!=='VIRTUAL'){var _0x585bd1={};_0x585bd1[_0x4c07af[_0xace7('0x27')]]={'$like':'%'+_0x8900ae[_0xace7('0x49')][_0xace7('0x54')]+'%'};return _0x585bd1;}})});}_0x3e17e9=_[_0xace7('0x56')]({},_0x3e17e9,_0x8900ae['options']);var _0x2993a3={'where':_0x3e17e9[_0xace7('0x55')]};return db[_0xace7('0x57')][_0xace7('0x1f')](_0x2993a3)[_0xace7('0x10')](function(_0x5decd2){_0x55dcaa[_0xace7('0x1f')]=_0x5decd2;if(_0x8900ae[_0xace7('0x49')][_0xace7('0x58')]){_0x3e17e9[_0xace7('0x59')]=[{'all':!![]}];}return db[_0xace7('0x57')][_0xace7('0x5a')](_0x3e17e9);})[_0xace7('0x10')](function(_0x1d3e92){_0x55dcaa[_0xace7('0x5b')]=_0x1d3e92;return _0x55dcaa;})[_0xace7('0x10')](respondWithFilteredResult(_0x10a869,_0x3e17e9))[_0xace7('0x18')](handleError(_0x10a869,null));};exports['show']=function(_0x5777bf,_0x14ff8f){var _0x217164={'raw':![],'where':{'id':_0x5777bf['params']['id']},'include':[{'model':db[_0xace7('0x43')],'as':_0xace7('0x40')},{'model':db['MailServerOut'],'as':_0xace7('0x41')},{'model':db[_0xace7('0x5c')],'as':'mandatoryDispositionPause'}]},_0x1de44d={};_0x1de44d[_0xace7('0x48')]=_['keys'](db[_0xace7('0x57')]['rawAttributes']);_0x1de44d[_0xace7('0x49')]=_[_0xace7('0x5d')](_0x5777bf[_0xace7('0x49')]);_0x1de44d[_0xace7('0x4a')]=_[_0xace7('0x4c')](_0x1de44d[_0xace7('0x48')],_0x1de44d[_0xace7('0x49')]);_0x217164[_0xace7('0x4b')]=_[_0xace7('0x4c')](_0x1de44d[_0xace7('0x48')],qs[_0xace7('0x4d')](_0x5777bf[_0xace7('0x49')]['fields']));_0x217164[_0xace7('0x4b')]=_0x217164[_0xace7('0x4b')][_0xace7('0x4e')]?_0x217164[_0xace7('0x4b')]:_0x1de44d[_0xace7('0x48')];if(_0x5777bf[_0xace7('0x49')][_0xace7('0x58')]){_0x217164[_0xace7('0x59')]=[{'all':!![]}];}_0x217164=_['merge']({},_0x217164,_0x5777bf['options']);return db[_0xace7('0x57')]['find'](_0x217164)['then'](handleEntityNotFound(_0x14ff8f,null))[_0xace7('0x10')](respondWithResult(_0x14ff8f,null))[_0xace7('0x18')](handleError(_0x14ff8f,null));};exports[_0xace7('0x5e')]=function(_0x23d320,_0x577fcd){if(_0x23d320[_0xace7('0x5f')]['id']){delete _0x23d320['body']['id'];}var _0xc596ae=_0x23d320[_0xace7('0x5f')]['provider']===_0xace7('0x60')?null:_0x23d320[_0xace7('0x5f')][_0xace7('0x61')];var _0x24d500=_0x23d320[_0xace7('0x5f')][_0xace7('0x40')]||{};var _0x5b42e1=_0x23d320[_0xace7('0x5f')][_0xace7('0x41')]||{};if(_0xc596ae){_0x24d500[_0xace7('0x3b')]=getImapHost(_0xc596ae);_0x24d500['port']=0x3e1;_0x5b42e1[_0xace7('0x3b')]=getSmtpHost(_0xc596ae);_0x5b42e1[_0xace7('0x3c')]=0x24b;_0x5b42e1[_0xace7('0x3d')]=![];}if(_0x5b42e1[_0xace7('0x39')]){_0x5b42e1[_0xace7('0x3d')]=![];}else{_0x5b42e1['CloudProviderId']=null;}if(!_0x24d500['modernAuthentication'])_0x24d500[_0xace7('0x3a')]=null;_0x23d320[_0xace7('0x5f')][_0xace7('0x40')]=_0x24d500;_0x23d320[_0xace7('0x5f')][_0xace7('0x41')]=_0x5b42e1;return db[_0xace7('0x57')][_0xace7('0x62')]({'where':{'id':_0x23d320[_0xace7('0x63')]['id']},'include':[{'model':db[_0xace7('0x43')],'as':_0xace7('0x40')},{'model':db[_0xace7('0x64')],'as':_0xace7('0x41')},{'model':db[_0xace7('0x5c')],'as':'mandatoryDispositionPause'}]})[_0xace7('0x10')](handleEntityNotFound(_0x577fcd,null))['then'](function(_0x4ae12d){if(!_0x4ae12d)throw new Error(_0xace7('0x65'));if(_0x4ae12d['service'])delete _0x23d320['body'][_0xace7('0x40')];return _0x4ae12d;})['then'](saveUpdates(_0x23d320[_0xace7('0x5f')],null))[_0xace7('0x10')](function(_0x3e606e){if(!_0x23d320['body'][_0xace7('0x40')])return _0x3e606e;return db[_0xace7('0x43')][_0xace7('0x5e')](_0x23d320[_0xace7('0x5f')]['Imap'],{'where':{'MailAccountId':_0x3e606e['id']}})[_0xace7('0x10')](function(){return _0x3e606e;});})['then'](function(_0x1e7a8c){if(!_0x23d320[_0xace7('0x5f')]['Smtp'])return _0x1e7a8c;return db[_0xace7('0x64')]['update'](_0x23d320['body'][_0xace7('0x41')],{'where':{'MailAccountId':_0x1e7a8c['id']}})[_0xace7('0x10')](function(){return _0x1e7a8c;});})['then'](respondWithResult(_0x577fcd,null))[_0xace7('0x18')](handleError(_0x577fcd,null));};exports[_0xace7('0x66')]=function(_0x1b9f5c,_0x4af061){return db['MailAccount'][_0xace7('0x66')]()[_0xace7('0x10')](respondWithResult(_0x4af061,null))[_0xace7('0x18')](handleError(_0x4af061,null));};exports[_0xace7('0x67')]=function(_0x9121f2,_0x25ba3f){if(_0x9121f2[_0xace7('0x5f')]['id']){delete _0x9121f2[_0xace7('0x5f')]['id'];}return db[_0xace7('0x57')][_0xace7('0x62')]({'where':{'id':_0x9121f2['params']['id']}})[_0xace7('0x10')](handleEntityNotFound(_0x25ba3f,null))[_0xace7('0x10')](function(_0x4a9bee){if(_0x4a9bee){_0x9121f2[_0xace7('0x5f')]['MailAccountId']=_0x4a9bee['id'];return db[_0xace7('0x68')][_0xace7('0x69')](_0x9121f2[_0xace7('0x5f')]);}})[_0xace7('0x10')](respondWithResult(_0x25ba3f,null))[_0xace7('0x18')](handleError(_0x25ba3f,null));};exports[_0xace7('0x6a')]=function(_0x28e5a0,_0x408720){var _0x5a62e7={'raw':![],'where':{}};var _0x54b760={};var _0x5736a0={'count':0x0,'rows':[]};return db[_0xace7('0x57')][_0xace7('0x6b')]({'where':{'id':_0x28e5a0['params']['id']}})[_0xace7('0x10')](handleEntityNotFound(_0x408720,null))[_0xace7('0x10')](function(_0x5b1be3){if(_0x5b1be3){_0x54b760[_0xace7('0x48')]=_[_0xace7('0x5d')](db['Disposition'][_0xace7('0x6c')]);_0x54b760['query']=_['keys'](_0x28e5a0['query']);_0x54b760[_0xace7('0x4a')]=_['intersection'](_0x54b760[_0xace7('0x48')],_0x54b760['query']);_0x5a62e7[_0xace7('0x4b')]=_[_0xace7('0x4c')](_0x54b760[_0xace7('0x48')],qs['fields'](_0x28e5a0['query'][_0xace7('0x4d')]));_0x5a62e7[_0xace7('0x4b')]=_0x5a62e7[_0xace7('0x4b')][_0xace7('0x4e')]?_0x5a62e7[_0xace7('0x4b')]:_0x54b760[_0xace7('0x48')];if(!_0x28e5a0['query']['hasOwnProperty'](_0xace7('0x50'))){_0x5a62e7[_0xace7('0x1e')]=qs[_0xace7('0x1e')](_0x28e5a0[_0xace7('0x49')][_0xace7('0x1e')]);_0x5a62e7[_0xace7('0x1c')]=qs[_0xace7('0x1c')](_0x28e5a0[_0xace7('0x49')][_0xace7('0x1c')]);}_0x5a62e7[_0xace7('0x51')]=qs['sort'](_0x28e5a0['query']['sort']);_0x5a62e7['where']=qs[_0xace7('0x4a')](_[_0xace7('0x53')](_0x28e5a0[_0xace7('0x49')],_0x54b760[_0xace7('0x4a')]));_0x5a62e7['where']['MailAccountId']=_0x5b1be3['id'];if(_0x28e5a0[_0xace7('0x49')][_0xace7('0x54')]){_0x5a62e7['where']=_[_0xace7('0x56')](_0x5a62e7[_0xace7('0x55')],{'$or':_[_0xace7('0x44')](_0x5a62e7[_0xace7('0x4b')],function(_0x37e4ae){var _0x5a6403={};_0x5a6403[_0x37e4ae]={'$like':'%'+_0x28e5a0[_0xace7('0x49')]['filter']+'%'};return _0x5a6403;})});}_0x5a62e7=_[_0xace7('0x56')]({},_0x5a62e7,_0x28e5a0[_0xace7('0x6d')]);return db[_0xace7('0x68')]['count']({'where':_0x5a62e7[_0xace7('0x55')]})[_0xace7('0x10')](function(_0x2edf30){_0x5736a0[_0xace7('0x1f')]=_0x2edf30;if(_0x28e5a0[_0xace7('0x49')][_0xace7('0x58')]){_0x5a62e7[_0xace7('0x59')]=[{'all':!![]}];}return db[_0xace7('0x68')][_0xace7('0x5a')](_0x5a62e7);})[_0xace7('0x10')](function(_0xfabc8){_0x5736a0[_0xace7('0x5b')]=_0xfabc8;return _0x5736a0;});}})[_0xace7('0x10')](respondWithFilteredResult(_0x408720,_0x5a62e7))[_0xace7('0x18')](handleError(_0x408720,null));};exports[_0xace7('0x6e')]=function(_0x36f694,_0x2f6615){return db[_0xace7('0x57')][_0xace7('0x62')]({'where':{'id':_0x36f694[_0xace7('0x63')]['id']}})[_0xace7('0x10')](handleEntityNotFound(_0x2f6615,null))[_0xace7('0x10')](function(_0x4af97f){if(_0x4af97f){return _0x4af97f[_0xace7('0x6e')](_0x36f694[_0xace7('0x49')][_0xace7('0x6f')]);}})[_0xace7('0x10')](respondWithStatusCode(_0x2f6615,null))[_0xace7('0x18')](handleError(_0x2f6615,null));};exports[_0xace7('0x70')]=function(_0x2279b0,_0x1d8587){if(_0x2279b0['body']['id']){delete _0x2279b0[_0xace7('0x5f')]['id'];}return db[_0xace7('0x57')]['find']({'where':{'id':_0x2279b0[_0xace7('0x63')]['id']}})[_0xace7('0x10')](handleEntityNotFound(_0x1d8587,null))[_0xace7('0x10')](function(_0x4785c6){if(_0x4785c6){_0x2279b0[_0xace7('0x5f')][_0xace7('0x71')]=_0x4785c6['id'];return db[_0xace7('0x72')]['create'](_0x2279b0[_0xace7('0x5f')]);}})['then'](respondWithResult(_0x1d8587,null))['catch'](handleError(_0x1d8587,null));};exports[_0xace7('0x73')]=function(_0x11fe02,_0x2248ec){var _0x305034={'raw':![],'where':{}};var _0x17505b={};var _0x3ecdae={'count':0x0,'rows':[]};return db[_0xace7('0x57')]['findOne']({'where':{'id':_0x11fe02[_0xace7('0x63')]['id']}})['then'](handleEntityNotFound(_0x2248ec,null))[_0xace7('0x10')](function(_0x15dd83){if(_0x15dd83){_0x17505b['model']=_[_0xace7('0x5d')](db[_0xace7('0x72')]['rawAttributes']);_0x17505b['query']=_[_0xace7('0x5d')](_0x11fe02[_0xace7('0x49')]);_0x17505b['filters']=_[_0xace7('0x4c')](_0x17505b['model'],_0x17505b[_0xace7('0x49')]);_0x305034[_0xace7('0x4b')]=_[_0xace7('0x4c')](_0x17505b[_0xace7('0x48')],qs[_0xace7('0x4d')](_0x11fe02[_0xace7('0x49')][_0xace7('0x4d')]));_0x305034[_0xace7('0x4b')]=_0x305034[_0xace7('0x4b')][_0xace7('0x4e')]?_0x305034[_0xace7('0x4b')]:_0x17505b[_0xace7('0x48')];if(!_0x11fe02['query'][_0xace7('0x4f')](_0xace7('0x50'))){_0x305034[_0xace7('0x1e')]=qs[_0xace7('0x1e')](_0x11fe02[_0xace7('0x49')]['limit']);_0x305034[_0xace7('0x1c')]=qs[_0xace7('0x1c')](_0x11fe02[_0xace7('0x49')][_0xace7('0x1c')]);}_0x305034[_0xace7('0x51')]=qs[_0xace7('0x52')](_0x11fe02[_0xace7('0x49')][_0xace7('0x52')]);_0x305034[_0xace7('0x55')]=qs[_0xace7('0x4a')](_[_0xace7('0x53')](_0x11fe02[_0xace7('0x49')],_0x17505b[_0xace7('0x4a')]));_0x305034[_0xace7('0x55')][_0xace7('0x71')]=_0x15dd83['id'];if(_0x11fe02[_0xace7('0x49')][_0xace7('0x54')]){_0x305034[_0xace7('0x55')]=_[_0xace7('0x56')](_0x305034[_0xace7('0x55')],{'$or':_[_0xace7('0x44')](_0x305034[_0xace7('0x4b')],function(_0x3426fe){var _0x53e624={};_0x53e624[_0x3426fe]={'$like':'%'+_0x11fe02['query'][_0xace7('0x54')]+'%'};return _0x53e624;})});}_0x305034=_[_0xace7('0x56')]({},_0x305034,_0x11fe02[_0xace7('0x6d')]);return db[_0xace7('0x72')][_0xace7('0x1f')]({'where':_0x305034[_0xace7('0x55')]})['then'](function(_0x81f061){_0x3ecdae[_0xace7('0x1f')]=_0x81f061;if(_0x11fe02[_0xace7('0x49')][_0xace7('0x58')]){_0x305034[_0xace7('0x59')]=[{'all':!![]}];}return db[_0xace7('0x72')][_0xace7('0x5a')](_0x305034);})[_0xace7('0x10')](function(_0x1dd64b){_0x3ecdae[_0xace7('0x5b')]=_0x1dd64b;return _0x3ecdae;});}})['then'](respondWithFilteredResult(_0x2248ec,_0x305034))[_0xace7('0x18')](handleError(_0x2248ec,null));};exports[_0xace7('0x74')]=function(_0xfe7a0e,_0x5ccb6c){return db['MailAccount']['find']({'where':{'id':_0xfe7a0e[_0xace7('0x63')]['id']}})[_0xace7('0x10')](handleEntityNotFound(_0x5ccb6c,null))[_0xace7('0x10')](function(_0xae6332){if(_0xae6332){return _0xae6332['removeAnswers'](_0xfe7a0e[_0xace7('0x49')][_0xace7('0x6f')]);}})['then'](respondWithStatusCode(_0x5ccb6c,null))['catch'](handleError(_0x5ccb6c,null));};exports[_0xace7('0x69')]=function(_0x2f4578,_0x3b2800){var _0x49e580={'name':_0x2f4578[_0xace7('0x5f')][_0xace7('0x27')],'key':_0x2f4578[_0xace7('0x5f')]['key'],'provider':_0x2f4578[_0xace7('0x5f')][_0xace7('0x61')]==='custom'?null:_0x2f4578['body'][_0xace7('0x61')],'email':_0x2f4578[_0xace7('0x5f')]['email'],'ListId':_0x2f4578[_0xace7('0x5f')][_0xace7('0x75')],'active':!_[_0xace7('0x76')](_0x2f4578[_0xace7('0x5f')][_0xace7('0x77')])?_0x2f4578['body'][_0xace7('0x77')]:!![],'description':_0x2f4578[_0xace7('0x5f')][_0xace7('0x78')]||null};var _0x385f1c=getAuthenticationOptions(_0x49e580[_0xace7('0x61')],_0x2f4578[_0xace7('0x5f')]);_0x49e580[_0xace7('0x40')]=_0x385f1c[_0xace7('0x40')];_0x49e580['Smtp']=_0x385f1c['Smtp'];return db['MailAccount']['create'](_0x49e580,{'include':[{'model':db['MailServerOut'],'as':_0xace7('0x41')},{'model':db[_0xace7('0x43')],'as':_0xace7('0x40')}]})['then'](function(_0x530b39){var _0x3e9be=_0x2f4578[_0xace7('0x35')][_0xace7('0x79')]({'plain':!![]});if(!_0x3e9be)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e9be[_0xace7('0x7a')]===_0xace7('0x35')){var _0x1a8cf7=_0x530b39[_0xace7('0x79')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'MailAccounts','userProfileId':_0x3e9be[_0xace7('0x7b')]},'raw':!![]})['then'](function(_0x18616c){if(_0x18616c&&_0x18616c['autoAssociation']===0x0){return db[_0xace7('0x24')][_0xace7('0x69')]({'name':_0x1a8cf7[_0xace7('0x27')],'resourceId':_0x1a8cf7['id'],'type':_0x18616c[_0xace7('0x27')],'sectionId':_0x18616c['id']},{})[_0xace7('0x10')](function(){return _0x530b39;});}else{return _0x530b39;}})[_0xace7('0x18')](function(_0x5b3321){logger[_0xace7('0x15')](_0xace7('0x7c'),_0x5b3321);throw _0x5b3321;});}return _0x530b39;})['then'](respondWithResult(_0x3b2800,0xc9))[_0xace7('0x18')](handleError(_0x3b2800,null));};exports['getImap']=function(_0x49fd9d,_0x516aa9){return db[_0xace7('0x57')][_0xace7('0x6b')]({'where':{'id':_0x49fd9d[_0xace7('0x63')]['id']}})['then'](handleEntityNotFound(_0x516aa9,null))[_0xace7('0x10')](function(_0x30db15){if(_0x30db15){return _0x30db15[_0xace7('0x7d')]();}return null;})['then'](respondWithResult(_0x516aa9,null))[_0xace7('0x18')](handleError(_0x516aa9,null));};exports[_0xace7('0x7e')]=function(_0x345961,_0xd139e1){if(_0x345961[_0xace7('0x5f')]['id']){delete _0x345961['body']['id'];}return db[_0xace7('0x57')]['find']({'where':{'id':_0x345961[_0xace7('0x63')]['id']}})[_0xace7('0x10')](handleEntityNotFound(_0xd139e1,null))['then'](function(_0x37b18f){if(_0x37b18f){_0x345961[_0xace7('0x5f')]['MailAccountId']=_0x37b18f['id'];return db['MailServerIn'][_0xace7('0x69')](_0x345961['body']);}})[_0xace7('0x10')](respondWithResult(_0xd139e1,null))[_0xace7('0x18')](handleError(_0xd139e1,null));};exports[_0xace7('0x7f')]=function(_0x1a3bd2,_0x290886){return db[_0xace7('0x57')][_0xace7('0x6b')]({'where':{'id':_0x1a3bd2[_0xace7('0x63')]['id']}})[_0xace7('0x10')](handleEntityNotFound(_0x290886,null))['then'](function(_0x16ed51){if(_0x16ed51){return _0x16ed51[_0xace7('0x80')](null);}return null;})[_0xace7('0x10')](respondWithStatusCode(_0x290886,null))[_0xace7('0x18')](handleError(_0x290886,null));};exports['getSmtp']=function(_0x10ae62,_0x4ba37c){return db['MailAccount'][_0xace7('0x6b')]({'where':{'id':_0x10ae62[_0xace7('0x63')]['id']}})[_0xace7('0x10')](handleEntityNotFound(_0x4ba37c,null))[_0xace7('0x10')](function(_0x167b82){if(_0x167b82){return _0x167b82[_0xace7('0x81')]();}return null;})[_0xace7('0x10')](respondWithResult(_0x4ba37c,null))[_0xace7('0x18')](handleError(_0x4ba37c,null));};exports[_0xace7('0x82')]=function(_0x1d105d,_0x5a49ef){if(_0x1d105d['body']['id']){delete _0x1d105d[_0xace7('0x5f')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x1d105d[_0xace7('0x63')]['id']}})['then'](handleEntityNotFound(_0x5a49ef,null))['then'](function(_0x17976a){if(_0x17976a){_0x1d105d[_0xace7('0x5f')][_0xace7('0x71')]=_0x17976a['id'];return db[_0xace7('0x64')][_0xace7('0x69')](_0x1d105d[_0xace7('0x5f')]);}})['then'](respondWithResult(_0x5a49ef,null))['catch'](handleError(_0x5a49ef,null));};exports[_0xace7('0x83')]=function(_0xdce6b4,_0x33bc82){return db[_0xace7('0x57')][_0xace7('0x6b')]({'where':{'id':_0xdce6b4[_0xace7('0x63')]['id']}})[_0xace7('0x10')](handleEntityNotFound(_0x33bc82,null))[_0xace7('0x10')](function(_0x2922c5){if(_0x2922c5){return _0x2922c5[_0xace7('0x84')](null);}return null;})[_0xace7('0x10')](respondWithStatusCode(_0x33bc82,null))[_0xace7('0x18')](handleError(_0x33bc82,null));};exports[_0xace7('0x85')]=function(_0x326541,_0x229b94){return db[_0xace7('0x86')][_0xace7('0x62')]({'where':{'id':_0x326541[_0xace7('0x63')]['id']}})['then'](handleEntityNotFound(_0x229b94,null))['then'](function(_0x395484){if(_0x395484){return _0x395484[_0xace7('0x85')](_0x326541[_0xace7('0x5f')]['ids'],_[_0xace7('0x87')](_0x326541[_0xace7('0x5f')],[_0xace7('0x6f'),'id'])||{});}})['then'](respondWithResult(_0x229b94,null))['catch'](handleError(_0x229b94,null));};exports[_0xace7('0x88')]=function(_0x206f83,_0x26fa86){var _0x31527c={'raw':![],'where':{}};var _0xae753e={};var _0x27151e={'count':0x0,'rows':[]};return db[_0xace7('0x57')][_0xace7('0x6b')]({'where':{'id':_0x206f83[_0xace7('0x63')]['id']}})[_0xace7('0x10')](handleEntityNotFound(_0x26fa86,null))[_0xace7('0x10')](function(_0x2af628){if(_0x2af628){_0xae753e['model']=_[_0xace7('0x5d')](db[_0xace7('0x86')][_0xace7('0x6c')]);_0xae753e['query']=_[_0xace7('0x5d')](_0x206f83[_0xace7('0x49')]);_0xae753e['filters']=_[_0xace7('0x4c')](_0xae753e['model'],_0xae753e[_0xace7('0x49')]);_0x31527c[_0xace7('0x4b')]=_[_0xace7('0x4c')](_0xae753e[_0xace7('0x48')],qs[_0xace7('0x4d')](_0x206f83[_0xace7('0x49')][_0xace7('0x4d')]));_0x31527c[_0xace7('0x4b')]=_0x31527c[_0xace7('0x4b')][_0xace7('0x4e')]?_0x31527c['attributes']:_0xae753e['model'];if(!_0x206f83[_0xace7('0x49')][_0xace7('0x4f')](_0xace7('0x50'))){_0x31527c[_0xace7('0x1e')]=qs[_0xace7('0x1e')](_0x206f83[_0xace7('0x49')][_0xace7('0x1e')]);_0x31527c[_0xace7('0x1c')]=qs['offset'](_0x206f83[_0xace7('0x49')][_0xace7('0x1c')]);}_0x31527c[_0xace7('0x51')]=qs[_0xace7('0x52')](_0x206f83[_0xace7('0x49')]['sort']);_0x31527c[_0xace7('0x55')]=qs[_0xace7('0x4a')](_[_0xace7('0x53')](_0x206f83[_0xace7('0x49')],_0xae753e[_0xace7('0x4a')]));_0x31527c[_0xace7('0x55')]['MailAccountId']=_0x2af628['id'];if(_0x206f83[_0xace7('0x49')][_0xace7('0x54')]){_0x31527c['where']=_[_0xace7('0x56')](_0x31527c['where'],{'$or':_[_0xace7('0x44')](_0x31527c[_0xace7('0x4b')],function(_0x29b649){var _0x4456d5={};_0x4456d5[_0x29b649]={'$like':'%'+_0x206f83['query'][_0xace7('0x54')]+'%'};return _0x4456d5;})});}_0x31527c=_[_0xace7('0x56')]({},_0x31527c,_0x206f83[_0xace7('0x6d')]);return db[_0xace7('0x86')]['count']({'where':_0x31527c['where']})[_0xace7('0x10')](function(_0x1b8c21){_0x27151e[_0xace7('0x1f')]=_0x1b8c21;if(_0x206f83[_0xace7('0x49')][_0xace7('0x58')]){_0x31527c[_0xace7('0x59')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xace7('0x89')],'as':_0xace7('0x8a'),'attributes':[_0xace7('0x27'),'fullname','internal'],'required':![]},{'model':db[_0xace7('0x8b')],'as':'Tags','attributes':['id',_0xace7('0x27'),_0xace7('0x8c')],'where':_0x206f83[_0xace7('0x49')][_0xace7('0x8d')]?{'id':_0x206f83[_0xace7('0x49')]['tag']}:undefined,'required':_0x206f83['query'][_0xace7('0x8d')]?!![]:![]}];}return db[_0xace7('0x86')][_0xace7('0x5a')](_0x31527c);})[_0xace7('0x10')](function(_0x230887){_0x27151e['rows']=_0x230887;return _0x27151e;});}})[_0xace7('0x10')](respondWithFilteredResult(_0x26fa86,_0x31527c))[_0xace7('0x18')](handleError(_0x26fa86,null));};exports[_0xace7('0x8e')]=function addApplications(_0x33f3af,_0x3dd50c){var _0x2e5abf=_0x33f3af[_0xace7('0x63')]['id'];var _0x387a90=_0x33f3af[_0xace7('0x5f')];var _0x1d2ddd=0xc8;var _0x1742fe=null;return db[_0xace7('0x8f')][_0xace7('0x90')]({'isolationLevel':db[_0xace7('0x8f')][_0xace7('0x91')][_0xace7('0x92')]['READ_COMMITTED']},function(_0x254701){return db[_0xace7('0x57')][_0xace7('0x6b')]({'where':{'id':_0x2e5abf},'transaction':_0x254701})[_0xace7('0x10')](function(_0x5d00b1){if(_0x5d00b1){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0x2e5abf},'transaction':_0x254701})[_0xace7('0x10')](function(){var _0x30a29d=_[_0xace7('0x44')](_0x387a90,function(_0x23131e){_0x23131e['MailAccountId']=_0x2e5abf;return _0x23131e;});return db['MailApplication'][_0xace7('0x93')](_0x30a29d,{'transaction':_0x254701});});}else{_0x1d2ddd=0x194;_0x1742fe=[];}});})['then'](function(){if(_0x1d2ddd!==0x194){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x2e5abf},'order':_0xace7('0x94')})[_0xace7('0x10')](function(_0x5dcef9){_0x1742fe=_0x5dcef9;});}})[_0xace7('0x18')](function(_0x593242){_0x1d2ddd=0x1f4;logger['error'](_0x593242[_0xace7('0x26')]);if(_0x593242[_0xace7('0x27')]){delete _0x593242[_0xace7('0x27')];}_0x1742fe=_0x593242;})[_0xace7('0x95')](function(){if(_0x1742fe===null){_0x3dd50c['sendStatus'](_0x1d2ddd);}else{if(_0x1d2ddd===0x1f4){_0x3dd50c['status'](_0x1d2ddd)[_0xace7('0x28')](_0x1742fe);}else{_0x3dd50c[_0xace7('0x19')](_0x1d2ddd)['json'](_0x1742fe);}}});};exports[_0xace7('0x96')]=function(_0x3c5bbb,_0x441393){var _0x104c91={};var _0x2370df={};var _0x47ee17;var _0x1f48eb;return db[_0xace7('0x57')]['findOne']({'where':{'id':_0x3c5bbb[_0xace7('0x63')]['id']}})['then'](handleEntityNotFound(_0x441393,null))[_0xace7('0x10')](function(_0x3b86c5){if(_0x3b86c5){_0x47ee17=_0x3b86c5;_0x2370df[_0xace7('0x48')]=_[_0xace7('0x5d')](db[_0xace7('0x97')][_0xace7('0x6c')]);_0x2370df[_0xace7('0x49')]=_[_0xace7('0x5d')](_0x3c5bbb[_0xace7('0x49')]);_0x2370df[_0xace7('0x4a')]=_[_0xace7('0x4c')](_0x2370df['model'],_0x2370df[_0xace7('0x49')]);_0x104c91[_0xace7('0x4b')]=_[_0xace7('0x4c')](_0x2370df[_0xace7('0x48')],qs[_0xace7('0x4d')](_0x3c5bbb[_0xace7('0x49')]['fields']));_0x104c91[_0xace7('0x4b')]=_0x104c91[_0xace7('0x4b')]['length']?_0x104c91[_0xace7('0x4b')]:_0x2370df[_0xace7('0x48')];_0x104c91[_0xace7('0x51')]=qs['sort'](_0x3c5bbb['query'][_0xace7('0x52')]);_0x104c91['where']=qs[_0xace7('0x4a')](_[_0xace7('0x53')](_0x3c5bbb['query'],_0x2370df['filters']));if(_0x3c5bbb['query'][_0xace7('0x54')]){_0x104c91[_0xace7('0x55')]=_[_0xace7('0x56')](_0x104c91['where'],{'$or':_[_0xace7('0x44')](_0x104c91[_0xace7('0x4b')],function(_0x3cb89c){var _0x365eb0={};_0x365eb0[_0x3cb89c]={'$like':'%'+_0x3c5bbb[_0xace7('0x49')][_0xace7('0x54')]+'%'};return _0x365eb0;})});}_0x104c91=_['merge']({},_0x104c91,_0x3c5bbb[_0xace7('0x6d')]);return _0x47ee17['getApplications'](_0x104c91);}})[_0xace7('0x10')](function(_0x6842c6){if(_0x6842c6){_0x1f48eb=_0x6842c6['length'];if(!_0x3c5bbb[_0xace7('0x49')][_0xace7('0x4f')](_0xace7('0x50'))){_0x104c91[_0xace7('0x1e')]=qs[_0xace7('0x1e')](_0x3c5bbb[_0xace7('0x49')][_0xace7('0x1e')]);_0x104c91['offset']=qs[_0xace7('0x1c')](_0x3c5bbb[_0xace7('0x49')][_0xace7('0x1c')]);}return _0x47ee17[_0xace7('0x96')](_0x104c91);}})['then'](function(_0x53189f){if(_0x53189f){return _0x53189f?{'count':_0x1f48eb,'rows':_0x53189f}:null;}})[_0xace7('0x10')](respondWithResult(_0x441393,null))[_0xace7('0x18')](handleError(_0x441393,null));};exports[_0xace7('0x98')]=function(_0x16953f,_0x3ac45b){var _0x33bda2={'raw':!![],'where':{}};var _0x1d6c23={};var _0x4633f1={'count':0x0,'rows':[]};return db['MailAccount'][_0xace7('0x6b')]({'where':{'id':_0x16953f[_0xace7('0x63')]['id']}})[_0xace7('0x10')](handleEntityNotFound(_0x3ac45b,null))[_0xace7('0x10')](function(_0x8dbe92){if(_0x8dbe92){_0x1d6c23[_0xace7('0x48')]=_['keys'](db['MailMessage']['rawAttributes']);_0x1d6c23['query']=_[_0xace7('0x5d')](_0x16953f['query']);_0x1d6c23[_0xace7('0x4a')]=_[_0xace7('0x4c')](_0x1d6c23[_0xace7('0x48')],_0x1d6c23[_0xace7('0x49')]);_0x33bda2[_0xace7('0x4b')]=_[_0xace7('0x4c')](_0x1d6c23[_0xace7('0x48')],qs[_0xace7('0x4d')](_0x16953f[_0xace7('0x49')][_0xace7('0x4d')]));_0x33bda2[_0xace7('0x4b')]=_0x33bda2[_0xace7('0x4b')][_0xace7('0x4e')]?_0x33bda2['attributes']:_0x1d6c23[_0xace7('0x48')];if(!_0x16953f[_0xace7('0x49')][_0xace7('0x4f')]('nolimit')){_0x33bda2[_0xace7('0x1e')]=qs[_0xace7('0x1e')](_0x16953f[_0xace7('0x49')][_0xace7('0x1e')]);_0x33bda2[_0xace7('0x1c')]=qs['offset'](_0x16953f[_0xace7('0x49')]['offset']);}_0x33bda2['order']=qs[_0xace7('0x52')](_0x16953f[_0xace7('0x49')][_0xace7('0x52')]);_0x33bda2['where']=qs[_0xace7('0x4a')](_[_0xace7('0x53')](_0x16953f[_0xace7('0x49')],_0x1d6c23[_0xace7('0x4a')]));_0x33bda2[_0xace7('0x55')][_0xace7('0x71')]=_0x8dbe92['id'];if(_0x16953f[_0xace7('0x49')][_0xace7('0x54')]){_0x33bda2[_0xace7('0x55')]=_[_0xace7('0x56')](_0x33bda2[_0xace7('0x55')],{'$or':_[_0xace7('0x44')](_0x33bda2[_0xace7('0x4b')],function(_0x4e773b){var _0xe357cd={};_0xe357cd[_0x4e773b]={'$like':'%'+_0x16953f[_0xace7('0x49')][_0xace7('0x54')]+'%'};return _0xe357cd;})});}if(_0x16953f[_0xace7('0x49')][_0xace7('0x99')]){var _0x3017d0=_0x16953f[_0xace7('0x49')]['$gte'][_0xace7('0x9a')](',');var _0x5cd069={};_0x5cd069[_0x3017d0[0x0]]={'$gte':moment(_0x3017d0[0x1])[_0xace7('0x9b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x33bda2[_0xace7('0x55')]=_[_0xace7('0x56')](_0x33bda2[_0xace7('0x55')],_0x5cd069);}_0x33bda2=_[_0xace7('0x56')]({},_0x33bda2,_0x16953f[_0xace7('0x6d')]);return db['MailMessage'][_0xace7('0x1f')]({'where':_0x33bda2[_0xace7('0x55')]})['then'](function(_0x58b8a2){_0x4633f1[_0xace7('0x1f')]=_0x58b8a2;if(_0x16953f['query'][_0xace7('0x58')]){_0x33bda2[_0xace7('0x59')]=[{'all':!![]}];}return db[_0xace7('0x9c')][_0xace7('0x5a')](_0x33bda2);})[_0xace7('0x10')](function(_0x1c1f10){if(_0x16953f[_0xace7('0x49')]['inlineCss']==='true'){for(var _0x24a33e=0x0;_0x24a33e<_0x1c1f10[_0xace7('0x4e')];_0x24a33e++){_0x1c1f10[_0x24a33e]['body']=juice(_0x1c1f10[_0x24a33e][_0xace7('0x5f')]);}}_0x4633f1['rows']=_0x1c1f10;return _0x4633f1;});}})['then'](respondWithFilteredResult(_0x3ac45b,_0x33bda2))[_0xace7('0x18')](handleError(_0x3ac45b,null));};exports[_0xace7('0x28')]=function(_0x43e912,_0x52cd78){var _0x492d2c,_0x337f1f={},_0x119b02;if(_0x43e912['body']['to']){_0x119b02=_0x43e912[_0xace7('0x5f')]['to'][_0xace7('0x9a')](',')[0x0];}return db[_0xace7('0x57')][_0xace7('0x62')]({'where':{'id':_0x43e912[_0xace7('0x63')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x119b02},'limit':0x1,'order':[[_0xace7('0x9d'),_0xace7('0x9e')]]}]},{'model':db[_0xace7('0x64')],'as':_0xace7('0x41'),'raw':!![],'include':[{'model':db[_0xace7('0x9f')],'as':'CloudProvider','raw':!![]}]}]})[_0xace7('0x10')](handleEntityNotFound(_0x52cd78,null))[_0xace7('0x10')](function(_0x5c2732){if(!_0x5c2732)return;_0x492d2c=_0x5c2732;if(!_0x5c2732[_0xace7('0x41')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0xace7('0x76')](_0x43e912[_0xace7('0x5f')][_0xace7('0xa0')])){_0x43e912[_0xace7('0x5f')][_0xace7('0xa0')]=util['format'](_0xace7('0xa1'),_0x5c2732[_0xace7('0x27')],_0x5c2732[_0xace7('0xa2')]||_0x5c2732[_0xace7('0x41')]['user']);}if(_0x43e912['body'][_0xace7('0xa3')]&&_0x43e912[_0xace7('0x5f')][_0xace7('0xa3')][_0xace7('0x4e')]){for(var _0xeff0e=0x0;_0xeff0e<_0x43e912[_0xace7('0x5f')][_0xace7('0xa3')][_0xace7('0x4e')];_0xeff0e+=0x1){_0x43e912[_0xace7('0x5f')][_0xace7('0xa3')][_0xeff0e]={'filename':_0x43e912['body'][_0xace7('0xa3')][_0xeff0e][_0xace7('0x27')],'path':path[_0xace7('0xa4')](config[_0xace7('0xa5')],_0xace7('0xa6'),_0x43e912[_0xace7('0x5f')][_0xace7('0xa3')][_0xeff0e][_0xace7('0xa7')])};}}var _0x49e1f9=_0x5c2732['getSmtpOptions']();return respondWithRpcPromise(_0xace7('0xa8'),'sendMail',{'account':_0x49e1f9,'message':_0x43e912[_0xace7('0x5f')]});})[_0xace7('0x10')](function(_0x371791){if(!_0x371791)return;_0x337f1f=_0x371791;if(!_0x492d2c[_0xace7('0xa9')])throw new Error(_0xace7('0xaa'));if(_0x492d2c[_0xace7('0xa9')]['Contacts'][_0xace7('0x4e')])return _0x492d2c[_0xace7('0xa9')]['Contacts'][0x0];return db[_0xace7('0xab')][_0xace7('0x69')](_[_0xace7('0x7')](_0x43e912['body'],{'firstName':_0x43e912[_0xace7('0x5f')]['to'],'email':_0x43e912[_0xace7('0x5f')]['to'],'phone':_0x43e912[_0xace7('0x5f')]['to'],'ListId':_0x492d2c[_0xace7('0x75')]}));})[_0xace7('0x10')](function(_0x48e5a3){if(!_0x48e5a3)return;var _0x52b13a={'UserId':_0x43e912['user']['id'],'ContactId':_0x48e5a3['id'],'MailAccountId':_0x492d2c['id'],'inReplyTo':_0x337f1f[_0xace7('0xac')],'to':_0x43e912[_0xace7('0x5f')][_0xace7('0xa0')],'cc':_0x43e912[_0xace7('0x5f')]['cc'],'subject':_0x43e912[_0xace7('0x5f')][_0xace7('0xad')],'attach':_0x43e912[_0xace7('0x5f')][_0xace7('0xae')],'firstMsgDirection':_0xace7('0xaf'),'lastMsgAt':moment()['format'](_0xace7('0xb0')),'lastMsgDirection':_0xace7('0xaf'),'Messages':[_[_0xace7('0x56')](_0x43e912[_0xace7('0x5f')],{'messageId':_0x337f1f[_0xace7('0xac')],'sentAt':moment()[_0xace7('0x9b')](_0xace7('0xb0')),'read':!![],'MailAccountId':_0x492d2c['id'],'UserId':_0x43e912['user']['id'],'ContactId':_0x48e5a3['id']})]};if(_0x43e912[_0xace7('0x5f')][_0xace7('0xb1')]){_0x52b13a=_[_0xace7('0x56')](_0x52b13a,_0x43e912[_0xace7('0x5f')][_0xace7('0xb1')]);}return db[_0xace7('0x86')][_0xace7('0x69')](_0x52b13a,{'include':[{'model':db[_0xace7('0x9c')],'as':_0xace7('0xb2')}]});})[_0xace7('0x10')](respondWithResult(_0x52cd78,null))[_0xace7('0x18')](handleError(_0x52cd78,null));};exports[_0xace7('0xb3')]=function(_0x57b9b1,_0x5bd059){return db[_0xace7('0x57')][_0xace7('0x62')]({'where':{'id':_0x57b9b1[_0xace7('0x63')]['id']},'include':[{'model':db[_0xace7('0x64')],'as':_0xace7('0x41'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x5bd059,null))['then'](function(_0x43caf1){if(!_0x43caf1[_0xace7('0x41')])return;var _0x328c1b=_0x43caf1[_0xace7('0xb4')]();return respondWithRpcPromise(_0xace7('0xb5'),'verifySmtp',{'account':_0x328c1b});})[_0xace7('0x10')](respondWithResult(_0x5bd059,null))['catch'](handleError(_0x5bd059,null));};exports[_0xace7('0x22')]=function(_0x2fd83c,_0x17c0be){return db[_0xace7('0x57')][_0xace7('0x62')]({'where':{'id':_0x2fd83c[_0xace7('0x63')]['id']}})[_0xace7('0x10')](handleEntityNotFound(_0x17c0be,null))[_0xace7('0x10')](function(_0x46b2e8){if(_0x46b2e8&&_0x46b2e8[_0xace7('0x3e')]){throw new db[(_0xace7('0xb6'))]['ValidationError'](_0xace7('0xb7'));}return _0x46b2e8;})[_0xace7('0x10')](removeEntity(_0x17c0be,null))[_0xace7('0x18')](handleError(_0x17c0be,null));};exports[_0xace7('0xb8')]=function(_0x131391,_0x233c88){return db[_0xace7('0x57')][_0xace7('0x62')]({'where':{'id':_0x131391[_0xace7('0x63')]['id']}})[_0xace7('0x10')](handleEntityNotFound(_0x233c88,null))[_0xace7('0x10')](function(_0x30aa7c){if(_0x30aa7c){return _0x30aa7c[_0xace7('0xb8')](_0x131391[_0xace7('0x5f')][_0xace7('0x6f')],_[_0xace7('0x87')](_0x131391[_0xace7('0x5f')],['ids','id'])||{})[_0xace7('0xb9')](function(_0x38e8d8){for(var _0x16bc1f=0x0;_0x16bc1f<_0x131391['body'][_0xace7('0x6f')][_0xace7('0x4e')];_0x16bc1f+=0x1){socket[_0xace7('0xba')](_0xace7('0xbb'),{'UserId':Number(_0x131391[_0xace7('0x5f')]['ids'][_0x16bc1f]),'MailAccountId':Number(_0x131391[_0xace7('0x63')]['id'])});}return _0x38e8d8;});}})['then'](respondWithResult(_0x233c88,null))[_0xace7('0x18')](handleError(_0x233c88,null));};exports[_0xace7('0xbc')]=function(_0x5345ee,_0x5bbc2a){return db[_0xace7('0x57')][_0xace7('0x62')]({'where':{'id':_0x5345ee[_0xace7('0x63')]['id']}})[_0xace7('0x10')](handleEntityNotFound(_0x5bbc2a,null))[_0xace7('0x10')](function(_0x3d75a2){if(_0x3d75a2){return _0x3d75a2[_0xace7('0xbc')](_0x5345ee[_0xace7('0x49')]['ids'])[_0xace7('0x10')](function(){if(_['isArray'](_0x5345ee[_0xace7('0x49')][_0xace7('0x6f')])){for(var _0x1dfde2=0x0;_0x1dfde2<_0x5345ee[_0xace7('0x49')][_0xace7('0x6f')][_0xace7('0x4e')];_0x1dfde2+=0x1){socket[_0xace7('0xba')]('userMailAccount:remove',{'UserId':Number(_0x5345ee['query']['ids'][_0x1dfde2]),'MailAccountId':Number(_0x5345ee[_0xace7('0x63')]['id'])});}}else{socket[_0xace7('0xba')](_0xace7('0xbd'),{'UserId':Number(_0x5345ee[_0xace7('0x49')][_0xace7('0x6f')]),'MailAccountId':Number(_0x5345ee[_0xace7('0x63')]['id'])});}});}})[_0xace7('0x10')](respondWithStatusCode(_0x5bbc2a,null))[_0xace7('0x18')](handleError(_0x5bbc2a,null));};exports['getAgents']=function(_0x278525,_0x37d43b){var _0x2dab83={};var _0x550916={};var _0x5b02bb;var _0x592571;return db[_0xace7('0x57')][_0xace7('0x6b')]({'where':{'id':_0x278525[_0xace7('0x63')]['id']}})[_0xace7('0x10')](handleEntityNotFound(_0x37d43b,null))[_0xace7('0x10')](function(_0x7d192d){if(_0x7d192d){_0x5b02bb=_0x7d192d;_0x550916[_0xace7('0x48')]=_[_0xace7('0x5d')](db[_0xace7('0x89')][_0xace7('0x6c')]);_0x550916[_0xace7('0x49')]=_[_0xace7('0x5d')](_0x278525[_0xace7('0x49')]);_0x550916['filters']=_[_0xace7('0x4c')](_0x550916[_0xace7('0x48')],_0x550916['query']);_0x2dab83[_0xace7('0x4b')]=_['intersection'](_0x550916[_0xace7('0x48')],qs[_0xace7('0x4d')](_0x278525[_0xace7('0x49')][_0xace7('0x4d')]));_0x2dab83['attributes']=_0x2dab83['attributes']['length']?_0x2dab83[_0xace7('0x4b')]:_0x550916[_0xace7('0x48')];_0x2dab83['order']=qs[_0xace7('0x52')](_0x278525['query']['sort']);_0x2dab83[_0xace7('0x55')]=qs[_0xace7('0x4a')](_[_0xace7('0x53')](_0x278525[_0xace7('0x49')],_0x550916[_0xace7('0x4a')]));if(_0x278525[_0xace7('0x49')][_0xace7('0x54')]){_0x2dab83[_0xace7('0x55')]=_[_0xace7('0x56')](_0x2dab83[_0xace7('0x55')],{'$or':_[_0xace7('0x44')](_0x2dab83['attributes'],function(_0xb993ad){var _0x489122={};_0x489122[_0xb993ad]={'$like':'%'+_0x278525[_0xace7('0x49')][_0xace7('0x54')]+'%'};return _0x489122;})});}_0x2dab83=_[_0xace7('0x56')]({},_0x2dab83,_0x278525[_0xace7('0x6d')]);return _0x5b02bb[_0xace7('0xbe')](_0x2dab83);}})['then'](function(_0x3917e0){if(_0x3917e0){_0x592571=_0x3917e0[_0xace7('0x4e')];if(!_0x278525[_0xace7('0x49')][_0xace7('0x4f')]('nolimit')){_0x2dab83['limit']=qs[_0xace7('0x1e')](_0x278525[_0xace7('0x49')]['limit']);_0x2dab83[_0xace7('0x1c')]=qs[_0xace7('0x1c')](_0x278525[_0xace7('0x49')][_0xace7('0x1c')]);}return _0x5b02bb[_0xace7('0xbe')](_0x2dab83);}})[_0xace7('0x10')](function(_0x5772a1){if(_0x5772a1){return _0x5772a1?{'count':_0x592571,'rows':_0x5772a1}:null;}})[_0xace7('0x10')](respondWithResult(_0x37d43b,null))[_0xace7('0x18')](handleError(_0x37d43b,null));};
\ No newline at end of file
index a7391bf..5fdcc50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7409=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5bf9a4,_0x33d20c){var _0x2bb53a=function(_0x48f0aa){while(--_0x48f0aa){_0x5bf9a4['push'](_0x5bf9a4['shift']());}};_0x2bb53a(++_0x33d20c);}(_0x7409,0x6e));var _0x9740=function(_0x27ad07,_0x2d3d47){_0x27ad07=_0x27ad07-0x0;var _0x3148b4=_0x7409[_0x27ad07];return _0x3148b4;};'use strict';var EventEmitter=require(_0x9740('0x0'));var MailAccount=require(_0x9740('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x9740('0x2')](0x0);var events={'afterCreate':_0x9740('0x3'),'afterUpdate':_0x9740('0x4'),'afterDestroy':_0x9740('0x5')};function emitEvent(_0x1109e2){return function(_0x2c15f1,_0xf40233,_0x2bb453){MailAccountEvents[_0x9740('0x6')](_0x1109e2+':'+_0x2c15f1['id'],_0x2c15f1);MailAccountEvents['emit'](_0x1109e2,_0x2c15f1);_0x2bb453(null);};}for(var e in events){if(events[_0x9740('0x7')](e)){var event=events[e];MailAccount[_0x9740('0x8')](e,emitEvent(event));}}module[_0x9740('0x9')]=MailAccountEvents;
\ No newline at end of file
+var _0xd386=['MailAccount','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1a1f02,_0x33bb4d){var _0x4ff145=function(_0x47ff99){while(--_0x47ff99){_0x1a1f02['push'](_0x1a1f02['shift']());}};_0x4ff145(++_0x33bb4d);}(_0xd386,0x10c));var _0x6d38=function(_0x16c2b1,_0x36a70c){_0x16c2b1=_0x16c2b1-0x0;var _0x199ac4=_0xd386[_0x16c2b1];return _0x199ac4;};'use strict';var EventEmitter=require(_0x6d38('0x0'));var MailAccount=require(_0x6d38('0x1'))['db'][_0x6d38('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6d38('0x3'),'afterUpdate':_0x6d38('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1ce7c5){return function(_0x21b7ee,_0x97f669,_0xa6b2b3){MailAccountEvents['emit'](_0x1ce7c5+':'+_0x21b7ee['id'],_0x21b7ee);MailAccountEvents[_0x6d38('0x5')](_0x1ce7c5,_0x21b7ee);_0xa6b2b3(null);};}for(var e in events){if(events[_0x6d38('0x6')](e)){var event=events[e];MailAccount[_0x6d38('0x7')](e,emitEvent(event));}}module[_0x6d38('0x8')]=MailAccountEvents;
\ No newline at end of file
index 2e09a7b..7e18799 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdca8=['authentication','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','auth','user','CloudProvider','data5','./mailAccount.attributes','exports','MailAccount','mail_accounts','provider','custom','host','Smtp','port','secure'];(function(_0x1f448a,_0x477d9d){var _0x24c6ac=function(_0x114123){while(--_0x114123){_0x1f448a['push'](_0x1f448a['shift']());}};_0x24c6ac(++_0x477d9d);}(_0xdca8,0x1e3));var _0x8dca=function(_0x53f8de,_0x32626e){_0x53f8de=_0x53f8de-0x0;var _0x432003=_0xdca8[_0x53f8de];return _0x432003;};'use strict';var attributes=require(_0x8dca('0x0'));module[_0x8dca('0x1')]=function(_0xae07bd){return _0xae07bd['define'](_0x8dca('0x2'),attributes,{'tableName':_0x8dca('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3e5944=this;var _0x2ea14e={'id':_0x3e5944['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3e5944[_0x8dca('0x4')]!==_0x8dca('0x5')){_0x2ea14e['service']=_0x3e5944[_0x8dca('0x4')];}else{_0x2ea14e[_0x8dca('0x6')]=_0x3e5944['Smtp']['host'];_0x2ea14e['port']=_0x3e5944[_0x8dca('0x7')][_0x8dca('0x8')];_0x2ea14e[_0x8dca('0x9')]=_0x3e5944[_0x8dca('0x7')]['secure'];}if(_0x3e5944[_0x8dca('0x7')][_0x8dca('0xa')]){if(_0x3e5944[_0x8dca('0x7')][_0x8dca('0xb')]){if(!_0x3e5944[_0x8dca('0x7')]['CloudProvider'])throw new Error(_0x8dca('0xc'));_0x2ea14e[_0x8dca('0xd')]={'type':'OAuth2','user':_0x3e5944['Smtp'][_0x8dca('0xe')],'accessToken':_0x3e5944[_0x8dca('0x7')][_0x8dca('0xf')][_0x8dca('0x10')]};}else{_0x2ea14e['auth']={'user':_0x3e5944[_0x8dca('0x7')]['user'],'pass':_0x3e5944[_0x8dca('0x7')]['pass']};}}return _0x2ea14e;}}});};
\ No newline at end of file
+var _0x5179=['./mailAccount.attributes','exports','MailAccount','mail_accounts','provider','custom','Smtp','host','port','secure','authentication','modernAuthentication','CloudProvider','auth','user','data5','pass'];(function(_0x297c55,_0x34fa75){var _0x120389=function(_0x595108){while(--_0x595108){_0x297c55['push'](_0x297c55['shift']());}};_0x120389(++_0x34fa75);}(_0x5179,0x1a9));var _0x9517=function(_0x3b150c,_0x2f93f8){_0x3b150c=_0x3b150c-0x0;var _0x5cd414=_0x5179[_0x3b150c];return _0x5cd414;};'use strict';var attributes=require(_0x9517('0x0'));module[_0x9517('0x1')]=function(_0x357fe8){return _0x357fe8['define'](_0x9517('0x2'),attributes,{'tableName':_0x9517('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0xe2974c=this;var _0x991c0f={'id':_0xe2974c['id'],'tls':{'rejectUnauthorized':![]}};if(_0xe2974c[_0x9517('0x4')]!==_0x9517('0x5')){_0x991c0f['service']=_0xe2974c[_0x9517('0x4')];}else{_0x991c0f['host']=_0xe2974c[_0x9517('0x6')][_0x9517('0x7')];_0x991c0f[_0x9517('0x8')]=_0xe2974c[_0x9517('0x6')][_0x9517('0x8')];_0x991c0f[_0x9517('0x9')]=_0xe2974c[_0x9517('0x6')][_0x9517('0x9')];}if(_0xe2974c[_0x9517('0x6')][_0x9517('0xa')]){if(_0xe2974c[_0x9517('0x6')][_0x9517('0xb')]){if(!_0xe2974c[_0x9517('0x6')][_0x9517('0xc')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x991c0f[_0x9517('0xd')]={'type':'OAuth2','user':_0xe2974c[_0x9517('0x6')][_0x9517('0xe')],'accessToken':_0xe2974c[_0x9517('0x6')][_0x9517('0xc')][_0x9517('0xf')]};}else{_0x991c0f[_0x9517('0xd')]={'user':_0xe2974c['Smtp'][_0x9517('0xe')],'pass':_0xe2974c[_0x9517('0x6')][_0x9517('0x10')]};}}return _0x991c0f;}}});};
\ No newline at end of file
index 975e459..fc8135b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','debug','request\x20sent','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','options','raw','where','limit','include','map','model','attributes','stringify','find','smtp','smtpOptions','ShowMailAccount','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','Contacts','updatedAt','DESC','MailApplication','Applications','MailServerOut','CloudProvider','get','omit','getSmtpOptions','list','applications','orderBy','priority','autoclose','push','close','defaults','List\x20not\x20found','contact','messageId','generate','subject','attach','format','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','spread','YYYY-MM-DD\x20HH:mm:ss','interaction','MailMessage','create','attachments','originTo','originCc','ChatWebsiteId','originChannel','ChatOfflineMessageId','Attachment','UserId','name','unshift','agent','*,*,*,*','startRouting','Start','moment','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var moment=require(_0x65f6('0x0'));var BPromise=require('bluebird');var rs=require(_0x65f6('0x1'));var Redis=require(_0x65f6('0x2'));var db=require(_0x65f6('0x3'))['db'];var logger=require(_0x65f6('0x4'))(_0x65f6('0x5'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x6'));var client=jayson['client'][_0x65f6('0x7')]({'port':0x232c});config[_0x65f6('0x8')]=_['defaults'](config['redis'],{'host':_0x65f6('0x9'),'port':0x18eb});var socket=require(_0x65f6('0xa'))(new Redis(config[_0x65f6('0x8')]));require(_0x65f6('0xb'))[_0x65f6('0xc')](socket);function respondWithRpcPromise(_0x14f4c7,_0x48d85c,_0x5123ee){return new BPromise(function(_0x18fea1,_0x2f6d5b){return client[_0x65f6('0xd')](_0x14f4c7,_0x5123ee)[_0x65f6('0xe')](function(_0x50d26d){logger[_0x65f6('0xf')]('MailAccount,\x20%s,\x20%s',_0x48d85c,'request\x20sent');logger[_0x65f6('0x10')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x48d85c,_0x65f6('0x11'),JSON['stringify'](_0x50d26d));if(_0x50d26d[_0x65f6('0x12')]){if(_0x50d26d[_0x65f6('0x12')][_0x65f6('0x13')]===0x1f4){logger[_0x65f6('0x12')](_0x65f6('0x14'),_0x48d85c,_0x50d26d[_0x65f6('0x12')][_0x65f6('0x15')]);return _0x2f6d5b(_0x50d26d[_0x65f6('0x12')][_0x65f6('0x15')]);}logger[_0x65f6('0x12')]('MailAccount,\x20%s,\x20%s',_0x48d85c,_0x50d26d[_0x65f6('0x12')]['message']);return _0x18fea1(_0x50d26d['error'][_0x65f6('0x15')]);}else{logger[_0x65f6('0xf')](_0x65f6('0x14'),_0x48d85c,_0x65f6('0x11'));_0x18fea1(_0x50d26d[_0x65f6('0x16')][_0x65f6('0x15')]);}})[_0x65f6('0x17')](function(_0x18380e){logger['error']('MailAccount,\x20%s,\x20%s',_0x48d85c,_0x18380e);_0x2f6d5b(_0x18380e);});});}exports[_0x65f6('0x18')]=function(_0x5b4055){var _0x4c81f3=this;return new Promise(function(_0x5c5b91,_0x365159){return db[_0x65f6('0x19')]['findAll']({'raw':_0x5b4055[_0x65f6('0x1a')]?_0x5b4055[_0x65f6('0x1a')][_0x65f6('0x1b')]===undefined?!![]:![]:!![],'where':_0x5b4055[_0x65f6('0x1a')]?_0x5b4055[_0x65f6('0x1a')][_0x65f6('0x1c')]||null:null,'attributes':_0x5b4055['options']?_0x5b4055[_0x65f6('0x1a')]['attributes']||null:null,'limit':_0x5b4055['options']?_0x5b4055[_0x65f6('0x1a')][_0x65f6('0x1d')]||null:null,'include':_0x5b4055['options']?_0x5b4055[_0x65f6('0x1a')][_0x65f6('0x1e')]?_[_0x65f6('0x1f')](_0x5b4055[_0x65f6('0x1a')]['include'],function(_0x9d7bb0){return{'model':db[_0x9d7bb0[_0x65f6('0x20')]],'as':_0x9d7bb0['as'],'attributes':_0x9d7bb0[_0x65f6('0x21')],'include':_0x9d7bb0['include']?_['map'](_0x9d7bb0['include'],function(_0x29abdb){return{'model':db[_0x29abdb[_0x65f6('0x20')]],'as':_0x29abdb['as'],'attributes':_0x29abdb['attributes'],'include':_0x29abdb[_0x65f6('0x1e')]?_[_0x65f6('0x1f')](_0x29abdb['include'],function(_0x325cb4){return{'model':db[_0x325cb4[_0x65f6('0x20')]],'as':_0x325cb4['as'],'attributes':_0x325cb4[_0x65f6('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ac04b){logger['info'](_0x65f6('0x18'),_0x5b4055);logger[_0x65f6('0x10')](_0x65f6('0x18'),_0x5b4055,JSON[_0x65f6('0x22')](_0x4ac04b));_0x5c5b91(_0x4ac04b);})[_0x65f6('0x17')](function(_0x14a387){logger[_0x65f6('0x12')]('GetMailAccount',_0x14a387['message'],_0x5b4055);_0x365159(_0x4c81f3[_0x65f6('0x12')](0x1f4,_0x14a387[_0x65f6('0x15')]));});});};exports['ShowMailAccount']=function(_0x4e50c0){var _0x10b368=this;return new Promise(function(_0x1ce43c,_0x11fe3b){return db[_0x65f6('0x19')][_0x65f6('0x23')]({'raw':_0x4e50c0[_0x65f6('0x1a')]?_0x4e50c0['options'][_0x65f6('0x1b')]===undefined?!![]:![]:!![],'where':_0x4e50c0[_0x65f6('0x1a')]?_0x4e50c0[_0x65f6('0x1a')]['where']||null:null,'attributes':_0x4e50c0[_0x65f6('0x1a')]?_0x4e50c0[_0x65f6('0x1a')][_0x65f6('0x21')]||null:null,'include':_0x4e50c0[_0x65f6('0x1a')]?_0x4e50c0[_0x65f6('0x1a')][_0x65f6('0x1e')]?_['map'](_0x4e50c0[_0x65f6('0x1a')][_0x65f6('0x1e')],function(_0x4f3e22){return{'model':db[_0x4f3e22[_0x65f6('0x20')]],'as':_0x4f3e22['as'],'attributes':_0x4f3e22['attributes'],'include':_0x4f3e22[_0x65f6('0x1e')]?_['map'](_0x4f3e22[_0x65f6('0x1e')],function(_0x24f7fd){return{'model':db[_0x24f7fd['model']],'as':_0x24f7fd['as'],'attributes':_0x24f7fd[_0x65f6('0x21')],'include':_0x24f7fd[_0x65f6('0x1e')]?_[_0x65f6('0x1f')](_0x24f7fd['include'],function(_0x582c7e){return{'model':db[_0x582c7e[_0x65f6('0x20')]],'as':_0x582c7e['as'],'attributes':_0x582c7e['attributes']};}):[]};}):[]};}):[]:[]})[_0x65f6('0xe')](function(_0x4e6653){if(_0x4e50c0[_0x65f6('0x1a')][_0x65f6('0x24')]===!![])_0x4e6653['setDataValue'](_0x65f6('0x25'),_0x4e6653['getSmtpOptions']());logger['info'](_0x65f6('0x26'),_0x4e50c0);logger[_0x65f6('0x10')](_0x65f6('0x26'),_0x4e50c0,JSON[_0x65f6('0x22')](_0x4e6653));_0x1ce43c(_0x4e6653);})[_0x65f6('0x17')](function(_0x28845a){logger[_0x65f6('0x12')](_0x65f6('0x26'),_0x28845a['message'],_0x4e50c0);_0x11fe3b(_0x10b368[_0x65f6('0x12')](0x1f4,_0x28845a['message']));});});};exports[_0x65f6('0x27')]=function(_0xa4394a){var _0x4ba7db=this;return new Promise(function(_0x2ea7f7,_0x5ef5c2){var _0x32148f={'body':_0xa4394a[_0x65f6('0x28')],'channel':_0x65f6('0x29')};var _0x3fb1c6=_[_0x65f6('0x2a')](_[_0x65f6('0x2b')](db[_0x65f6('0x2c')][_0x65f6('0x2d')]),[_0x65f6('0x2e'),'updatedAt',_0x65f6('0x2f'),_0x65f6('0x30')]);var _0x377ae5=![];if(_0xa4394a[_0x65f6('0x28')]['id']){delete _0xa4394a[_0x65f6('0x28')]['id'];}if(_[_0x65f6('0x31')](_0xa4394a[_0x65f6('0x28')][_0x65f6('0x32')])){return _0x5ef5c2(_0x4ba7db[_0x65f6('0x12')](0x1f4,_0x65f6('0x33')));}if(_[_0x65f6('0x31')](_0xa4394a[_0x65f6('0x28')][_0x65f6('0x28')])||_0xa4394a[_0x65f6('0x28')][_0x65f6('0x28')]===''){return _0x5ef5c2(_0x4ba7db[_0x65f6('0x12')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x65f6('0x31')](_0xa4394a[_0x65f6('0x28')][_0x65f6('0x34')])){return _0x5ef5c2(_0x4ba7db[_0x65f6('0x12')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3fb1c6));}if(!_[_0x65f6('0x35')](_0x3fb1c6,_0xa4394a[_0x65f6('0x28')][_0x65f6('0x34')])){return _0x5ef5c2(_0x4ba7db['error'](0x1f4,_0x65f6('0x36')+_0x3fb1c6));}var _0x3386a2={};_0x3386a2[_0xa4394a[_0x65f6('0x28')][_0x65f6('0x34')]]=_0xa4394a['body'][_0x65f6('0x32')];return db['MailAccount'][_0x65f6('0x23')]({'where':{'id':_0xa4394a[_0x65f6('0x37')]['id']},'include':[{'model':db['CmList'],'as':_0x65f6('0x38'),'include':[{'model':db['CmContact'],'as':_0x65f6('0x39'),'where':_0x3386a2,'limit':0x1,'order':[[_0x65f6('0x3a'),_0x65f6('0x3b')]]}]},{'model':db[_0x65f6('0x3c')],'as':_0x65f6('0x3d')},{'model':db[_0x65f6('0x3e')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0x65f6('0x3f')}]}]})[_0x65f6('0xe')](function(_0x3b647a){if(_0x3b647a&&_0x3b647a[_0x65f6('0x38')]){var _0x3b907c=_0x3b647a[_0x65f6('0x40')]({'plain':!![]});_0x32148f[_0x65f6('0x37')]=_[_0x65f6('0x41')](_0x3b907c,[_0x65f6('0x3d'),'List']);_0x32148f[_0x65f6('0x37')][_0x65f6('0x25')]=_0x3b647a[_0x65f6('0x42')]();_0x32148f['applications']=_0x3b907c[_0x65f6('0x3d')];_0x32148f[_0x65f6('0x43')]=_0x3b907c['List'];_0x32148f[_0x65f6('0x44')]=_[_0x65f6('0x45')](_0x32148f['applications'],[_0x65f6('0x46')],['asc']);if(_0x32148f[_0x65f6('0x37')]&&_0x32148f[_0x65f6('0x37')][_0x65f6('0x47')]){_0x32148f['applications'][_0x65f6('0x48')]({'id':0x0,'priority':_0x32148f[_0x65f6('0x44')]['length']+0x1,'app':_0x65f6('0x49'),'appdata':_0x65f6('0x47'),'interval':'*,*,*,*'});}if(_0x32148f[_0x65f6('0x37')][_0x65f6('0x3d')]){delete _0x32148f[_0x65f6('0x37')][_0x65f6('0x3d')];}if(_0x32148f[_0x65f6('0x37')][_0x65f6('0x38')]){delete _0x32148f[_0x65f6('0x37')][_0x65f6('0x38')];}if(_0x3b907c['List']['Contacts']['length']){return _0x3b907c[_0x65f6('0x38')][_0x65f6('0x39')][0x0];}var _0x111a8a=_[_0x65f6('0x4a')](_0xa4394a['body'],{'firstName':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x32')],'ListId':_0x3b907c[_0x65f6('0x30')]});_0x111a8a[_0xa4394a['body'][_0x65f6('0x34')]]=_0xa4394a[_0x65f6('0x28')][_0x65f6('0x32')];return db['CmContact']['create'](_0x111a8a);}else{throw new Error(_0x65f6('0x4b'));}})[_0x65f6('0xe')](function(_0x4125cb){_0x32148f[_0x65f6('0x4c')]=_0x4125cb;if(_0x4125cb){if(!_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x4d')]){_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x4d')]=rs[_0x65f6('0x4e')]()+'\x20'+_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x32')];}var _0x5ba9c6={'ContactId':_0x4125cb['id'],'MailAccountId':_0xa4394a[_0x65f6('0x37')]['id'],'inReplyTo':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')]['messageId'],'to':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x32')],'cc':_0xa4394a[_0x65f6('0x28')]['message']['cc'],'subject':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x4f')],'attach':_0xa4394a[_0x65f6('0x28')]['message'][_0x65f6('0x50')],'lastMsgAt':moment()[_0x65f6('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x65f6('0x52')][_0x65f6('0x23')]({'where':{'closed':![],'MailAccountId':_0xa4394a[_0x65f6('0x37')]['id']},'include':[{'model':db['MailMessage'],'as':_0x65f6('0x53'),'attributes':[_0x65f6('0x4d')],'where':{'messageId':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x54')]}}]})[_0x65f6('0xe')](function(_0x5e4759){if(_0x5e4759){return[_0x5e4759,![]];}return db['MailInteraction']['create'](_0x5ba9c6)[_0x65f6('0xe')](function(_0x367d95){return[_0x367d95,!![]];});});}else{throw new Error(_0x65f6('0x55'));}})[_0x65f6('0x56')](function(_0xab6f0,_0x304cf9){if(_0xab6f0){_0x377ae5=_0x304cf9;if(!_0x304cf9){return _0xab6f0['update']({'inReplyTo':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')]['messageId'],'to':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x32')],'cc':_0xa4394a['body'][_0x65f6('0x15')]['cc'],'subject':_0xa4394a[_0x65f6('0x28')]['message'][_0x65f6('0x4f')],'attach':_0xab6f0[_0x65f6('0x50')]?_0xab6f0[_0x65f6('0x50')]:_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x50')],'substatus':null,'substatusAt':moment()[_0x65f6('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format'](_0x65f6('0x57')),'lastMsgDirection':'in'});}else{return _0xab6f0;}}})[_0x65f6('0xe')](function(_0x4a9524){_0x32148f[_0x65f6('0x58')]=_0x4a9524['get']({'plain':!![]});_0x32148f[_0x65f6('0x58')]['created']=_0x377ae5;return db[_0x65f6('0x59')][_0x65f6('0x5a')]({'body':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x28')],'MailAccountId':_0xa4394a[_0x65f6('0x37')]['id'],'MailInteractionId':_0x4a9524['id'],'direction':'in','ContactId':_0x32148f[_0x65f6('0x4c')]['id'],'messageId':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x4d')],'from':_0xa4394a['body']['message'][_0x65f6('0x32')],'to':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')]['to'],'cc':_0xa4394a['body']['message']['cc'],'subject':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x4f')],'attach':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x50')],'Attachments':_0xa4394a['body']['message'][_0x65f6('0x5b')],'originTo':_0xa4394a[_0x65f6('0x28')]['message'][_0x65f6('0x5c')],'originCc':_0xa4394a['body'][_0x65f6('0x15')][_0x65f6('0x5d')],'bcc':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')]['bcc'],'ChatWebsiteId':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x5e')]||null,'originChannel':_0xa4394a['body']['message'][_0x65f6('0x5f')]||'Email','ChatOfflineMessageId':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x60')]||null},{'include':[{'model':db[_0x65f6('0x61')],'as':'Attachments'}]});})['then'](function(_0x56f7f1){_0x32148f[_0x65f6('0x15')]=_0x56f7f1;if(_0x32148f[_0x65f6('0x58')][_0x65f6('0x62')]){return db['User'][_0x65f6('0x23')]({'attributes':['id',_0x65f6('0x63')],'where':{'id':_0x32148f[_0x65f6('0x58')]['UserId']}})[_0x65f6('0xe')](function(_0x15809e){if(_0x15809e){_0x32148f['applications'][_0x65f6('0x64')]({'id':0x0,'priority':0x0,'app':_0x65f6('0x65'),'appdata':_0x15809e['name']+','+(_0x32148f[_0x65f6('0x37')]['waitForTheAssignedAgent']||0xa),'interval':_0x65f6('0x66')});}return respondWithRpcPromise('Start',_0x65f6('0x67'),_0x32148f);});}return respondWithRpcPromise(_0x65f6('0x68'),'startRouting',_0x32148f);})[_0x65f6('0xe')](function(_0x442e25){_0x2ea7f7(_0x442e25);})[_0x65f6('0x17')](function(_0x299b85){_0x5ef5c2(_0x4ba7db[_0x65f6('0x12')](0x1f4,_0x299b85[_0x65f6('0x15')]));});});};
\ No newline at end of file
+var _0x9f0e=['updatedAt','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','Contacts','DESC','Applications','MailServerOut','Smtp','CloudProvider','get','omit','getSmtpOptions','applications','orderBy','asc','autoclose','push','close','*,*,*,*','length','defaults','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','create','Contact\x20not\x20found','update','interaction','created','MailMessage','originTo','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','options','where','attributes','limit','include','map','model','debug','ShowMailAccount','find','raw','smtp','setDataValue','smtpOptions','NotifyMailAccount','body','mail','difference','keys','CmContact'];(function(_0x55e615,_0x28bc32){var _0x27c678=function(_0x416be7){while(--_0x416be7){_0x55e615['push'](_0x55e615['shift']());}};_0x27c678(++_0x28bc32);}(_0x9f0e,0x116));var _0xe9f0=function(_0x504edf,_0x5493dc){_0x504edf=_0x504edf-0x0;var _0x9d6f76=_0x9f0e[_0x504edf];return _0x9d6f76;};'use strict';var _=require(_0xe9f0('0x0'));var moment=require(_0xe9f0('0x1'));var BPromise=require(_0xe9f0('0x2'));var rs=require(_0xe9f0('0x3'));var Redis=require(_0xe9f0('0x4'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0xe9f0('0x5'));var config=require(_0xe9f0('0x6'));var jayson=require(_0xe9f0('0x7'));var client=jayson[_0xe9f0('0x8')][_0xe9f0('0x9')]({'port':0x232c});config['redis']=_['defaults'](config[_0xe9f0('0xa')],{'host':_0xe9f0('0xb'),'port':0x18eb});var socket=require(_0xe9f0('0xc'))(new Redis(config['redis']));require(_0xe9f0('0xd'))[_0xe9f0('0xe')](socket);function respondWithRpcPromise(_0x20d602,_0x3386a8,_0xa523c0){return new BPromise(function(_0x240932,_0x807322){return client[_0xe9f0('0xf')](_0x20d602,_0xa523c0)[_0xe9f0('0x10')](function(_0x5352e0){logger[_0xe9f0('0x11')](_0xe9f0('0x12'),_0x3386a8,_0xe9f0('0x13'));logger['debug'](_0xe9f0('0x14'),_0x3386a8,'request\x20sent',JSON[_0xe9f0('0x15')](_0x5352e0));if(_0x5352e0[_0xe9f0('0x16')]){if(_0x5352e0[_0xe9f0('0x16')][_0xe9f0('0x17')]===0x1f4){logger['error'](_0xe9f0('0x12'),_0x3386a8,_0x5352e0['error'][_0xe9f0('0x18')]);return _0x807322(_0x5352e0[_0xe9f0('0x16')][_0xe9f0('0x18')]);}logger['error'](_0xe9f0('0x12'),_0x3386a8,_0x5352e0[_0xe9f0('0x16')][_0xe9f0('0x18')]);return _0x240932(_0x5352e0['error'][_0xe9f0('0x18')]);}else{logger[_0xe9f0('0x11')](_0xe9f0('0x12'),_0x3386a8,_0xe9f0('0x13'));_0x240932(_0x5352e0[_0xe9f0('0x19')][_0xe9f0('0x18')]);}})[_0xe9f0('0x1a')](function(_0x59bf5a){logger[_0xe9f0('0x16')](_0xe9f0('0x12'),_0x3386a8,_0x59bf5a);_0x807322(_0x59bf5a);});});}exports[_0xe9f0('0x1b')]=function(_0x5c4182){var _0x35e841=this;return new Promise(function(_0x30b8c7,_0x1698cf){return db[_0xe9f0('0x1c')]['findAll']({'raw':_0x5c4182[_0xe9f0('0x1d')]?_0x5c4182[_0xe9f0('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5c4182['options']?_0x5c4182['options'][_0xe9f0('0x1e')]||null:null,'attributes':_0x5c4182[_0xe9f0('0x1d')]?_0x5c4182[_0xe9f0('0x1d')][_0xe9f0('0x1f')]||null:null,'limit':_0x5c4182[_0xe9f0('0x1d')]?_0x5c4182['options'][_0xe9f0('0x20')]||null:null,'include':_0x5c4182[_0xe9f0('0x1d')]?_0x5c4182[_0xe9f0('0x1d')][_0xe9f0('0x21')]?_[_0xe9f0('0x22')](_0x5c4182[_0xe9f0('0x1d')][_0xe9f0('0x21')],function(_0x1321bb){return{'model':db[_0x1321bb[_0xe9f0('0x23')]],'as':_0x1321bb['as'],'attributes':_0x1321bb[_0xe9f0('0x1f')],'include':_0x1321bb['include']?_[_0xe9f0('0x22')](_0x1321bb[_0xe9f0('0x21')],function(_0x2ddfba){return{'model':db[_0x2ddfba[_0xe9f0('0x23')]],'as':_0x2ddfba['as'],'attributes':_0x2ddfba['attributes'],'include':_0x2ddfba[_0xe9f0('0x21')]?_[_0xe9f0('0x22')](_0x2ddfba[_0xe9f0('0x21')],function(_0x1f98a7){return{'model':db[_0x1f98a7[_0xe9f0('0x23')]],'as':_0x1f98a7['as'],'attributes':_0x1f98a7['attributes']};}):[]};}):[]};}):[]:[]})[_0xe9f0('0x10')](function(_0xdc16bc){logger[_0xe9f0('0x11')](_0xe9f0('0x1b'),_0x5c4182);logger[_0xe9f0('0x24')](_0xe9f0('0x1b'),_0x5c4182,JSON[_0xe9f0('0x15')](_0xdc16bc));_0x30b8c7(_0xdc16bc);})[_0xe9f0('0x1a')](function(_0x2b6503){logger[_0xe9f0('0x16')](_0xe9f0('0x1b'),_0x2b6503[_0xe9f0('0x18')],_0x5c4182);_0x1698cf(_0x35e841[_0xe9f0('0x16')](0x1f4,_0x2b6503[_0xe9f0('0x18')]));});});};exports[_0xe9f0('0x25')]=function(_0x2097c4){var _0x80e3ac=this;return new Promise(function(_0x3e1846,_0x2e7535){return db[_0xe9f0('0x1c')][_0xe9f0('0x26')]({'raw':_0x2097c4[_0xe9f0('0x1d')]?_0x2097c4[_0xe9f0('0x1d')][_0xe9f0('0x27')]===undefined?!![]:![]:!![],'where':_0x2097c4['options']?_0x2097c4['options']['where']||null:null,'attributes':_0x2097c4[_0xe9f0('0x1d')]?_0x2097c4['options'][_0xe9f0('0x1f')]||null:null,'include':_0x2097c4[_0xe9f0('0x1d')]?_0x2097c4['options'][_0xe9f0('0x21')]?_['map'](_0x2097c4['options']['include'],function(_0x165440){return{'model':db[_0x165440[_0xe9f0('0x23')]],'as':_0x165440['as'],'attributes':_0x165440['attributes'],'include':_0x165440[_0xe9f0('0x21')]?_[_0xe9f0('0x22')](_0x165440[_0xe9f0('0x21')],function(_0x4d4186){return{'model':db[_0x4d4186['model']],'as':_0x4d4186['as'],'attributes':_0x4d4186[_0xe9f0('0x1f')],'include':_0x4d4186[_0xe9f0('0x21')]?_[_0xe9f0('0x22')](_0x4d4186['include'],function(_0x3ca032){return{'model':db[_0x3ca032[_0xe9f0('0x23')]],'as':_0x3ca032['as'],'attributes':_0x3ca032[_0xe9f0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe9f0('0x10')](function(_0x2b38de){if(_0x2097c4['options'][_0xe9f0('0x28')]===!![])_0x2b38de[_0xe9f0('0x29')](_0xe9f0('0x2a'),_0x2b38de['getSmtpOptions']());logger[_0xe9f0('0x11')](_0xe9f0('0x25'),_0x2097c4);logger['debug'](_0xe9f0('0x25'),_0x2097c4,JSON['stringify'](_0x2b38de));_0x3e1846(_0x2b38de);})[_0xe9f0('0x1a')](function(_0x55c0bd){logger['error']('ShowMailAccount',_0x55c0bd['message'],_0x2097c4);_0x2e7535(_0x80e3ac['error'](0x1f4,_0x55c0bd[_0xe9f0('0x18')]));});});};exports[_0xe9f0('0x2b')]=function(_0x2d8f93){var _0x40c2c6=this;return new Promise(function(_0x2560c6,_0xd9b61b){var _0x3d4eb7={'body':_0x2d8f93[_0xe9f0('0x2c')],'channel':_0xe9f0('0x2d')};var _0x4e1c68=_[_0xe9f0('0x2e')](_[_0xe9f0('0x2f')](db[_0xe9f0('0x30')]['rawAttributes']),['createdAt',_0xe9f0('0x31'),'CompanyId',_0xe9f0('0x32')]);var _0x52613a=![];if(_0x2d8f93[_0xe9f0('0x2c')]['id']){delete _0x2d8f93[_0xe9f0('0x2c')]['id'];}if(_['isNil'](_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x33')])){return _0xd9b61b(_0x40c2c6[_0xe9f0('0x16')](0x1f4,_0xe9f0('0x34')));}if(_[_0xe9f0('0x35')](_0x2d8f93['body'][_0xe9f0('0x2c')])||_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x2c')]===''){return _0xd9b61b(_0x40c2c6[_0xe9f0('0x16')](0x1f4,_0xe9f0('0x36')));}if(_['isNil'](_0x2d8f93[_0xe9f0('0x2c')]['mapKey'])){return _0xd9b61b(_0x40c2c6['error'](0x1f4,_0xe9f0('0x37')+_0x4e1c68));}if(!_[_0xe9f0('0x38')](_0x4e1c68,_0x2d8f93['body'][_0xe9f0('0x39')])){return _0xd9b61b(_0x40c2c6[_0xe9f0('0x16')](0x1f4,_0xe9f0('0x3a')+_0x4e1c68));}var _0x7b167b={};_0x7b167b[_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x39')]]=_0x2d8f93[_0xe9f0('0x2c')]['from'];return db[_0xe9f0('0x1c')]['find']({'where':{'id':_0x2d8f93[_0xe9f0('0x3b')]['id']},'include':[{'model':db['CmList'],'as':_0xe9f0('0x3c'),'include':[{'model':db['CmContact'],'as':_0xe9f0('0x3d'),'where':_0x7b167b,'limit':0x1,'order':[[_0xe9f0('0x31'),_0xe9f0('0x3e')]]}]},{'model':db['MailApplication'],'as':_0xe9f0('0x3f')},{'model':db[_0xe9f0('0x40')],'as':_0xe9f0('0x41'),'include':[{'model':db[_0xe9f0('0x42')],'as':_0xe9f0('0x42')}]}]})[_0xe9f0('0x10')](function(_0x6ece3f){if(_0x6ece3f&&_0x6ece3f[_0xe9f0('0x3c')]){var _0x18fc2b=_0x6ece3f[_0xe9f0('0x43')]({'plain':!![]});_0x3d4eb7[_0xe9f0('0x3b')]=_[_0xe9f0('0x44')](_0x18fc2b,['Applications','List']);_0x3d4eb7[_0xe9f0('0x3b')][_0xe9f0('0x2a')]=_0x6ece3f[_0xe9f0('0x45')]();_0x3d4eb7['applications']=_0x18fc2b[_0xe9f0('0x3f')];_0x3d4eb7['list']=_0x18fc2b[_0xe9f0('0x3c')];_0x3d4eb7[_0xe9f0('0x46')]=_[_0xe9f0('0x47')](_0x3d4eb7[_0xe9f0('0x46')],['priority'],[_0xe9f0('0x48')]);if(_0x3d4eb7[_0xe9f0('0x3b')]&&_0x3d4eb7['account'][_0xe9f0('0x49')]){_0x3d4eb7[_0xe9f0('0x46')][_0xe9f0('0x4a')]({'id':0x0,'priority':_0x3d4eb7[_0xe9f0('0x46')]['length']+0x1,'app':_0xe9f0('0x4b'),'appdata':_0xe9f0('0x49'),'interval':_0xe9f0('0x4c')});}if(_0x3d4eb7[_0xe9f0('0x3b')][_0xe9f0('0x3f')]){delete _0x3d4eb7[_0xe9f0('0x3b')][_0xe9f0('0x3f')];}if(_0x3d4eb7[_0xe9f0('0x3b')]['List']){delete _0x3d4eb7[_0xe9f0('0x3b')][_0xe9f0('0x3c')];}if(_0x18fc2b[_0xe9f0('0x3c')][_0xe9f0('0x3d')][_0xe9f0('0x4d')]){return _0x18fc2b[_0xe9f0('0x3c')][_0xe9f0('0x3d')][0x0];}var _0xec9b3c=_[_0xe9f0('0x4e')](_0x2d8f93[_0xe9f0('0x2c')],{'firstName':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x33')],'ListId':_0x18fc2b[_0xe9f0('0x32')]});_0xec9b3c[_0x2d8f93[_0xe9f0('0x2c')]['mapKey']]=_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x33')];return db[_0xe9f0('0x30')]['create'](_0xec9b3c);}else{throw new Error('List\x20not\x20found');}})[_0xe9f0('0x10')](function(_0x57b904){_0x3d4eb7[_0xe9f0('0x4f')]=_0x57b904;if(_0x57b904){if(!_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')]['messageId']){_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')][_0xe9f0('0x50')]=rs[_0xe9f0('0x51')]()+'\x20'+_0x2d8f93['body'][_0xe9f0('0x18')][_0xe9f0('0x33')];}var _0x28a66e={'ContactId':_0x57b904['id'],'MailAccountId':_0x2d8f93[_0xe9f0('0x3b')]['id'],'inReplyTo':_0x2d8f93['body']['message'][_0xe9f0('0x50')],'to':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')][_0xe9f0('0x33')],'cc':_0x2d8f93[_0xe9f0('0x2c')]['message']['cc'],'subject':_0x2d8f93[_0xe9f0('0x2c')]['message'][_0xe9f0('0x52')],'attach':_0x2d8f93['body'][_0xe9f0('0x18')][_0xe9f0('0x53')],'lastMsgAt':moment()[_0xe9f0('0x54')](_0xe9f0('0x55')),'lastMsgDirection':'in'};return db[_0xe9f0('0x56')]['find']({'where':{'closed':![],'MailAccountId':_0x2d8f93['account']['id']},'include':[{'model':db['MailMessage'],'as':_0xe9f0('0x57'),'attributes':[_0xe9f0('0x50')],'where':{'messageId':_0x2d8f93['body'][_0xe9f0('0x18')]['inReplyTo']}}]})['then'](function(_0x156c65){if(_0x156c65){return[_0x156c65,![]];}return db[_0xe9f0('0x56')][_0xe9f0('0x58')](_0x28a66e)[_0xe9f0('0x10')](function(_0x1d2fb2){return[_0x1d2fb2,!![]];});});}else{throw new Error(_0xe9f0('0x59'));}})['spread'](function(_0x5e4ad4,_0x1255e6){if(_0x5e4ad4){_0x52613a=_0x1255e6;if(!_0x1255e6){return _0x5e4ad4[_0xe9f0('0x5a')]({'inReplyTo':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')]['messageId'],'to':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')][_0xe9f0('0x33')],'cc':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')]['cc'],'subject':_0x2d8f93[_0xe9f0('0x2c')]['message'][_0xe9f0('0x52')],'attach':_0x5e4ad4[_0xe9f0('0x53')]?_0x5e4ad4[_0xe9f0('0x53')]:_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')]['attach'],'substatus':null,'substatusAt':moment()[_0xe9f0('0x54')](_0xe9f0('0x55')),'lastMsgAt':moment()[_0xe9f0('0x54')](_0xe9f0('0x55')),'lastMsgDirection':'in'});}else{return _0x5e4ad4;}}})[_0xe9f0('0x10')](function(_0x42aab8){_0x3d4eb7[_0xe9f0('0x5b')]=_0x42aab8[_0xe9f0('0x43')]({'plain':!![]});_0x3d4eb7[_0xe9f0('0x5b')][_0xe9f0('0x5c')]=_0x52613a;return db[_0xe9f0('0x5d')][_0xe9f0('0x58')]({'body':_0x2d8f93['body'][_0xe9f0('0x2c')],'MailAccountId':_0x2d8f93[_0xe9f0('0x3b')]['id'],'MailInteractionId':_0x42aab8['id'],'direction':'in','ContactId':_0x3d4eb7[_0xe9f0('0x4f')]['id'],'messageId':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')][_0xe9f0('0x50')],'from':_0x2d8f93[_0xe9f0('0x2c')]['message'][_0xe9f0('0x33')],'to':_0x2d8f93[_0xe9f0('0x2c')]['message']['to'],'cc':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')]['cc'],'subject':_0x2d8f93[_0xe9f0('0x2c')]['message'][_0xe9f0('0x52')],'attach':_0x2d8f93[_0xe9f0('0x2c')]['message'][_0xe9f0('0x53')],'Attachments':_0x2d8f93[_0xe9f0('0x2c')]['message']['attachments'],'originTo':_0x2d8f93[_0xe9f0('0x2c')]['message'][_0xe9f0('0x5e')],'originCc':_0x2d8f93[_0xe9f0('0x2c')]['message'][_0xe9f0('0x5f')],'bcc':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')][_0xe9f0('0x60')],'ChatWebsiteId':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')][_0xe9f0('0x61')]||null,'originChannel':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')]['originChannel']||_0xe9f0('0x62'),'ChatOfflineMessageId':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')][_0xe9f0('0x63')]||null},{'include':[{'model':db[_0xe9f0('0x64')],'as':_0xe9f0('0x65')}]});})[_0xe9f0('0x10')](function(_0x114033){_0x3d4eb7['message']=_0x114033;if(_0x3d4eb7[_0xe9f0('0x5b')][_0xe9f0('0x66')]){return db[_0xe9f0('0x67')][_0xe9f0('0x26')]({'attributes':['id',_0xe9f0('0x68')],'where':{'id':_0x3d4eb7[_0xe9f0('0x5b')]['UserId']}})[_0xe9f0('0x10')](function(_0x568a13){if(_0x568a13){_0x3d4eb7['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xe9f0('0x69'),'appdata':_0x568a13[_0xe9f0('0x68')]+','+(_0x3d4eb7[_0xe9f0('0x3b')][_0xe9f0('0x6a')]||0xa),'interval':_0xe9f0('0x4c')});}return respondWithRpcPromise(_0xe9f0('0x6b'),_0xe9f0('0x6c'),_0x3d4eb7);});}return respondWithRpcPromise(_0xe9f0('0x6b'),_0xe9f0('0x6c'),_0x3d4eb7);})['then'](function(_0x3b5047){_0x2560c6(_0x3b5047);})[_0xe9f0('0x1a')](function(_0xef6284){_0xd9b61b(_0x40c2c6[_0xe9f0('0x16')](0x1f4,_0xef6284[_0xe9f0('0x18')]));});});};
\ No newline at end of file
index b8defd3..f3ec0b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bbd=['remove','update','emit','removeListener','register','mailAccount:'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9bbd,0x198));var _0xd9bb=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9bbd[_0x618414];return _0x21c19a;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save',_0xd9bb('0x0'),_0xd9bb('0x1')];function createListener(_0x422231,_0x192df6){return function(_0x287a31){_0x192df6[_0xd9bb('0x2')](_0x422231,_0x287a31);};}function removeListener(_0x1b989d,_0x416085){return function(){MailAccountEvents[_0xd9bb('0x3')](_0x1b989d,_0x416085);};}exports[_0xd9bb('0x4')]=function(_0x2a6001){for(var _0x5a7e41=0x0,_0x578b72=events['length'];_0x5a7e41<_0x578b72;_0x5a7e41++){var _0x1e56f4=events[_0x5a7e41];var _0x33dd28=createListener(_0xd9bb('0x5')+_0x1e56f4,_0x2a6001);MailAccountEvents['on'](_0x1e56f4,_0x33dd28);}};
\ No newline at end of file
+var _0xa2bf=['update','emit','removeListener','register','length','mailAccount:','./mailAccount.events','save','remove'];(function(_0x3fccdc,_0x543784){var _0x2c37a2=function(_0x5b8ed5){while(--_0x5b8ed5){_0x3fccdc['push'](_0x3fccdc['shift']());}};_0x2c37a2(++_0x543784);}(_0xa2bf,0xa8));var _0xfa2b=function(_0x56bf3d,_0x2aef9f){_0x56bf3d=_0x56bf3d-0x0;var _0x497add=_0xa2bf[_0x56bf3d];return _0x497add;};'use strict';var MailAccountEvents=require(_0xfa2b('0x0'));var events=[_0xfa2b('0x1'),_0xfa2b('0x2'),_0xfa2b('0x3')];function createListener(_0x4dddd8,_0x687f72){return function(_0x36224b){_0x687f72[_0xfa2b('0x4')](_0x4dddd8,_0x36224b);};}function removeListener(_0x12f91f,_0x1caf86){return function(){MailAccountEvents[_0xfa2b('0x5')](_0x12f91f,_0x1caf86);};}exports[_0xfa2b('0x6')]=function(_0x249860){for(var _0x164a9=0x0,_0x11b198=events[_0xfa2b('0x7')];_0x164a9<_0x11b198;_0x164a9++){var _0x396ef2=events[_0x164a9];var _0xfb9e6e=createListener(_0xfa2b('0x8')+_0x396ef2,_0x249860);MailAccountEvents['on'](_0x396ef2,_0xfb9e6e);}};
\ No newline at end of file
index 8b80758..19f1324 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cb2=['fs-extra','../../components/auth/service','../../config/environment','./mailApplication.controller','get','isAuthenticated','show','put','/:id','destroy','exports','multer','connect-timeout','express','Router'];(function(_0x399869,_0x11b444){var _0x4ff731=function(_0x1a0cc2){while(--_0x1a0cc2){_0x399869['push'](_0x399869['shift']());}};_0x4ff731(++_0x11b444);}(_0x3cb2,0x191));var _0x23cb=function(_0x2300c7,_0x255f74){_0x2300c7=_0x2300c7-0x0;var _0x23f720=_0x3cb2[_0x2300c7];return _0x23f720;};'use strict';var multer=require(_0x23cb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x23cb('0x1'));var express=require(_0x23cb('0x2'));var router=express[_0x23cb('0x3')]();var fs_extra=require(_0x23cb('0x4'));var auth=require(_0x23cb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x23cb('0x6'));var controller=require(_0x23cb('0x7'));router[_0x23cb('0x8')]('/:id',auth[_0x23cb('0x9')](),controller[_0x23cb('0xa')]);router[_0x23cb('0xb')](_0x23cb('0xc'),auth[_0x23cb('0x9')](),controller['update']);router['delete'](_0x23cb('0xc'),auth['isAuthenticated'](),controller[_0x23cb('0xd')]);module[_0x23cb('0xe')]=router;
\ No newline at end of file
+var _0x296c=['path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','delete','exports','multer'];(function(_0xf547c,_0x5da7db){var _0x230cab=function(_0x5c4fef){while(--_0x5c4fef){_0xf547c['push'](_0xf547c['shift']());}};_0x230cab(++_0x5da7db);}(_0x296c,0xed));var _0xc296=function(_0x2e7e7a,_0x4385d0){_0x2e7e7a=_0x2e7e7a-0x0;var _0x45aea8=_0x296c[_0x2e7e7a];return _0x45aea8;};'use strict';var multer=require(_0xc296('0x0'));var util=require('util');var path=require(_0xc296('0x1'));var timeout=require(_0xc296('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc296('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xc296('0x4'));var config=require(_0xc296('0x5'));var controller=require(_0xc296('0x6'));router[_0xc296('0x7')](_0xc296('0x8'),auth[_0xc296('0x9')](),controller[_0xc296('0xa')]);router[_0xc296('0xb')](_0xc296('0x8'),auth[_0xc296('0x9')](),controller['update']);router[_0xc296('0xc')]('/:id',auth[_0xc296('0x9')](),controller['destroy']);module[_0xc296('0xd')]=router;
\ No newline at end of file
index 3aa36bf..1bac40f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffc2=['exports','INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize'];(function(_0x5c6299,_0x11bd28){var _0x23b564=function(_0x329ed6){while(--_0x329ed6){_0x5c6299['push'](_0x5c6299['shift']());}};_0x23b564(++_0x11bd28);}(_0xffc2,0xf4));var _0x2ffc=function(_0x5f2acc,_0x47fcfd){_0x5f2acc=_0x5f2acc-0x0;var _0x1ec79c=_0xffc2[_0x5f2acc];return _0x1ec79c;};'use strict';var Sequelize=require(_0x2ffc('0x0'));module[_0x2ffc('0x1')]={'priority':{'type':Sequelize[_0x2ffc('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2ffc('0x3')},'appdata':{'type':Sequelize[_0x2ffc('0x4')]()},'description':{'type':Sequelize[_0x2ffc('0x5')]},'interval':{'type':Sequelize[_0x2ffc('0x5')],'defaultValue':_0x2ffc('0x6')}};
\ No newline at end of file
+var _0xb012=['exports','STRING','noop','TEXT','*,*,*,*'];(function(_0x18f4d3,_0x4f77fe){var _0x447644=function(_0xb06970){while(--_0xb06970){_0x18f4d3['push'](_0x18f4d3['shift']());}};_0x447644(++_0x4f77fe);}(_0xb012,0x87));var _0x2b01=function(_0x159fa3,_0x561946){_0x159fa3=_0x159fa3-0x0;var _0x4220fe=_0xb012[_0x159fa3];return _0x4220fe;};'use strict';var Sequelize=require('sequelize');module[_0x2b01('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x2b01('0x1')],'allowNull':![],'defaultValue':_0x2b01('0x2')},'appdata':{'type':Sequelize[_0x2b01('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2b01('0x1')],'defaultValue':_0x2b01('0x4')}};
\ No newline at end of file
index 15170c7..46cc594 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['attributes','length','include','merge','find','catch','body','params','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','show','model','MailApplication','query','keys','intersection','fields'];(function(_0x18baf4,_0x33086b){var _0x278ed1=function(_0x3ea0a2){while(--_0x3ea0a2){_0x18baf4['push'](_0x18baf4['shift']());}};_0x278ed1(++_0x33086b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x0d8b('0x0'));var rimraf=require(_0x0d8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d8b('0x2'));var BPromise=require(_0x0d8b('0x3'));var Mustache=require(_0x0d8b('0x4'));var util=require(_0x0d8b('0x5'));var path=require(_0x0d8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8b('0x7'));var fs=require('fs');var fs_extra=require(_0x0d8b('0x8'));var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0xc'));var querystring=require(_0x0d8b('0xd'));var Papa=require(_0x0d8b('0xe'));var Redis=require(_0x0d8b('0xf'));var authService=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var as=require(_0x0d8b('0x12'));var hardwareService=require(_0x0d8b('0x13'));var logger=require('../../config/logger')(_0x0d8b('0x14'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x15'));var licenseUtil=require(_0x0d8b('0x16'));var db=require(_0x0d8b('0x17'))['db'];function respondWithStatusCode(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xcc;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0x18')](_0x35a07b);}return _0x92cdd8[_0x0d8b('0x19')](_0x35a07b)[_0x0d8b('0x1a')]();};}function respondWithResult(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xc8;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x19')](_0x5ad086)[_0x0d8b('0x1b')](_0xe65334);}};}function respondWithFilteredResult(_0x4f6f21,_0x23eb7b){return function(_0xa86349){if(_0xa86349){var _0x17f7df=typeof _0x23eb7b[_0x0d8b('0x1c')]===_0x0d8b('0x1d')&&typeof _0x23eb7b['limit']===_0x0d8b('0x1d');var _0x4586c2=_0xa86349[_0x0d8b('0x1e')];var _0x5fecbd=_0x17f7df?0x0:_0x23eb7b[_0x0d8b('0x1c')];var _0x18dd2d=_0x17f7df?_0xa86349[_0x0d8b('0x1e')]:_0x23eb7b[_0x0d8b('0x1c')]+_0x23eb7b['limit'];var _0x27512e;if(_0x18dd2d>=_0x4586c2){_0x18dd2d=_0x4586c2;_0x27512e=0xc8;}else{_0x27512e=0xce;}_0x4f6f21[_0x0d8b('0x19')](_0x27512e);return _0x4f6f21[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x5fecbd+'-'+_0x18dd2d+'/'+_0x4586c2)[_0x0d8b('0x1b')](_0xa86349);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x21')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x22')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x23')](_0x54a9a7)[_0x0d8b('0x24')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x25')]()[_0x0d8b('0x24')](function(){_0x38efc8[_0x0d8b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8bbee,_0x4463ee){return function(_0x5363e3){if(!_0x5363e3){_0xe8bbee[_0x0d8b('0x18')](0x194);}return _0x5363e3;};}function handleError(_0x4a0ae4,_0x3dd149){_0x3dd149=_0x3dd149||0x1f4;return function(_0x234bdd){logger[_0x0d8b('0x26')](_0x234bdd['stack']);if(_0x234bdd['name']){delete _0x234bdd[_0x0d8b('0x27')];}_0x4a0ae4[_0x0d8b('0x19')](_0x3dd149)['send'](_0x234bdd);};}exports[_0x0d8b('0x28')]=function(_0x59aa83,_0x1b2b59){var _0x4b59e5={'raw':!![],'where':{'id':_0x59aa83['params']['id']}},_0x97050a={};_0x97050a[_0x0d8b('0x29')]=_['keys'](db[_0x0d8b('0x2a')]['rawAttributes']);_0x97050a[_0x0d8b('0x2b')]=_[_0x0d8b('0x2c')](_0x59aa83[_0x0d8b('0x2b')]);_0x97050a['filters']=_['intersection'](_0x97050a['model'],_0x97050a[_0x0d8b('0x2b')]);_0x4b59e5['attributes']=_[_0x0d8b('0x2d')](_0x97050a['model'],qs['fields'](_0x59aa83[_0x0d8b('0x2b')][_0x0d8b('0x2e')]));_0x4b59e5[_0x0d8b('0x2f')]=_0x4b59e5[_0x0d8b('0x2f')][_0x0d8b('0x30')]?_0x4b59e5[_0x0d8b('0x2f')]:_0x97050a[_0x0d8b('0x29')];if(_0x59aa83[_0x0d8b('0x2b')]['includeAll']){_0x4b59e5[_0x0d8b('0x31')]=[{'all':!![]}];}_0x4b59e5=_[_0x0d8b('0x32')]({},_0x4b59e5,_0x59aa83['options']);return db[_0x0d8b('0x2a')][_0x0d8b('0x33')](_0x4b59e5)[_0x0d8b('0x24')](handleEntityNotFound(_0x1b2b59,null))['then'](respondWithResult(_0x1b2b59,null))[_0x0d8b('0x34')](handleError(_0x1b2b59,null));};exports[_0x0d8b('0x23')]=function(_0x206157,_0x31ceba){if(_0x206157[_0x0d8b('0x35')]['id']){delete _0x206157['body']['id'];}return db[_0x0d8b('0x2a')][_0x0d8b('0x33')]({'where':{'id':_0x206157['params']['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x31ceba,null))[_0x0d8b('0x24')](saveUpdates(_0x206157[_0x0d8b('0x35')],null))[_0x0d8b('0x24')](respondWithResult(_0x31ceba,null))[_0x0d8b('0x34')](handleError(_0x31ceba,null));};exports['destroy']=function(_0x497a71,_0x41b4f9){return db['MailApplication']['find']({'where':{'id':_0x497a71[_0x0d8b('0x36')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x41b4f9,null))[_0x0d8b('0x24')](removeEntity(_0x41b4f9,null))[_0x0d8b('0x34')](handleError(_0x41b4f9,null));};
\ No newline at end of file
+var _0xe706=['limit','count','offset','set','Content-Range','json','apply','save','update','then','end','name','send','show','params','model','keys','MailApplication','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','body','catch','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined'];(function(_0x7880d2,_0x32e7d6){var _0x35ebbe=function(_0x5c27fa){while(--_0x5c27fa){_0x7880d2['push'](_0x7880d2['shift']());}};_0x35ebbe(++_0x32e7d6);}(_0xe706,0xa3));var _0x6e70=function(_0x4d94db,_0x5a2d71){_0x4d94db=_0x4d94db-0x0;var _0x41d157=_0xe706[_0x4d94db];return _0x41d157;};'use strict';var emlformat=require(_0x6e70('0x0'));var rimraf=require(_0x6e70('0x1'));var zipdir=require(_0x6e70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e70('0x3'));var moment=require(_0x6e70('0x4'));var BPromise=require(_0x6e70('0x5'));var Mustache=require(_0x6e70('0x6'));var util=require(_0x6e70('0x7'));var path=require(_0x6e70('0x8'));var sox=require(_0x6e70('0x9'));var csv=require(_0x6e70('0xa'));var ejs=require(_0x6e70('0xb'));var fs=require('fs');var fs_extra=require(_0x6e70('0xc'));var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xa'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var licenseUtil=require(_0x6e70('0x1b'));var db=require(_0x6e70('0x1c'))['db'];function respondWithStatusCode(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xcc;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x1d')](_0x3b38f3);}return _0x27dd9b[_0x6e70('0x1e')](_0x3b38f3)['end']();};}function respondWithResult(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0xc8;return function(_0x257e81){if(_0x257e81){return _0x52737e['status'](_0x48bc72)['json'](_0x257e81);}};}function respondWithFilteredResult(_0x304716,_0x22c50c){return function(_0x5d9263){if(_0x5d9263){var _0x24f3ac=typeof _0x22c50c['offset']===_0x6e70('0x1f')&&typeof _0x22c50c[_0x6e70('0x20')]==='undefined';var _0x49029f=_0x5d9263[_0x6e70('0x21')];var _0x5ea7a5=_0x24f3ac?0x0:_0x22c50c[_0x6e70('0x22')];var _0x173afe=_0x24f3ac?_0x5d9263['count']:_0x22c50c['offset']+_0x22c50c[_0x6e70('0x20')];var _0x208e21;if(_0x173afe>=_0x49029f){_0x173afe=_0x49029f;_0x208e21=0xc8;}else{_0x208e21=0xce;}_0x304716[_0x6e70('0x1e')](_0x208e21);return _0x304716[_0x6e70('0x23')](_0x6e70('0x24'),_0x5ea7a5+'-'+_0x173afe+'/'+_0x49029f)[_0x6e70('0x25')](_0x5d9263);}return null;};}function patchUpdates(_0x1b2453){return function(_0x44a49f){try{jsonpatch[_0x6e70('0x26')](_0x44a49f,_0x1b2453,!![]);}catch(_0xb29a2a){return BPromise['reject'](_0xb29a2a);}return _0x44a49f[_0x6e70('0x27')]();};}function saveUpdates(_0x344b65,_0x27b294){return function(_0x502b2d){if(_0x502b2d){return _0x502b2d[_0x6e70('0x28')](_0x344b65)[_0x6e70('0x29')](function(_0x3337a6){return _0x3337a6;});}return null;};}function removeEntity(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(_0x538b9c){return _0x538b9c['destroy']()['then'](function(){_0x50da2c[_0x6e70('0x1e')](0xcc)[_0x6e70('0x2a')]();});}};}function handleEntityNotFound(_0x51d292,_0x3ecdf1){return function(_0x1196ed){if(!_0x1196ed){_0x51d292['sendStatus'](0x194);}return _0x1196ed;};}function handleError(_0x338ad6,_0x67fb43){_0x67fb43=_0x67fb43||0x1f4;return function(_0x2bb231){logger['error'](_0x2bb231['stack']);if(_0x2bb231[_0x6e70('0x2b')]){delete _0x2bb231[_0x6e70('0x2b')];}_0x338ad6[_0x6e70('0x1e')](_0x67fb43)[_0x6e70('0x2c')](_0x2bb231);};}exports[_0x6e70('0x2d')]=function(_0x5d772a,_0x1952ea){var _0x406f29={'raw':!![],'where':{'id':_0x5d772a[_0x6e70('0x2e')]['id']}},_0xecf336={};_0xecf336[_0x6e70('0x2f')]=_[_0x6e70('0x30')](db[_0x6e70('0x31')][_0x6e70('0x32')]);_0xecf336[_0x6e70('0x33')]=_[_0x6e70('0x30')](_0x5d772a['query']);_0xecf336[_0x6e70('0x34')]=_['intersection'](_0xecf336[_0x6e70('0x2f')],_0xecf336['query']);_0x406f29[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0xecf336[_0x6e70('0x2f')],qs['fields'](_0x5d772a[_0x6e70('0x33')][_0x6e70('0x37')]));_0x406f29['attributes']=_0x406f29[_0x6e70('0x35')][_0x6e70('0x38')]?_0x406f29['attributes']:_0xecf336[_0x6e70('0x2f')];if(_0x5d772a[_0x6e70('0x33')][_0x6e70('0x39')]){_0x406f29[_0x6e70('0x3a')]=[{'all':!![]}];}_0x406f29=_[_0x6e70('0x3b')]({},_0x406f29,_0x5d772a[_0x6e70('0x3c')]);return db[_0x6e70('0x31')][_0x6e70('0x3d')](_0x406f29)[_0x6e70('0x29')](handleEntityNotFound(_0x1952ea,null))[_0x6e70('0x29')](respondWithResult(_0x1952ea,null))['catch'](handleError(_0x1952ea,null));};exports[_0x6e70('0x28')]=function(_0x4795a0,_0x23cd1a){if(_0x4795a0[_0x6e70('0x3e')]['id']){delete _0x4795a0[_0x6e70('0x3e')]['id'];}return db[_0x6e70('0x31')][_0x6e70('0x3d')]({'where':{'id':_0x4795a0[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x23cd1a,null))[_0x6e70('0x29')](saveUpdates(_0x4795a0[_0x6e70('0x3e')],null))[_0x6e70('0x29')](respondWithResult(_0x23cd1a,null))[_0x6e70('0x3f')](handleError(_0x23cd1a,null));};exports[_0x6e70('0x40')]=function(_0x5594d3,_0x501b53){return db['MailApplication']['find']({'where':{'id':_0x5594d3[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x501b53,null))[_0x6e70('0x29')](removeEntity(_0x501b53,null))[_0x6e70('0x3f')](handleError(_0x501b53,null));};
\ No newline at end of file
index 3e2ac7c..f698611 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc80=['utf8mb4_unicode_ci','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications'];(function(_0x339d43,_0x2e8388){var _0x453e41=function(_0x14cdd4){while(--_0x14cdd4){_0x339d43['push'](_0x339d43['shift']());}};_0x453e41(++_0x2e8388);}(_0xbc80,0x187));var _0x0bc8=function(_0x265aa2,_0x220072){_0x265aa2=_0x265aa2-0x0;var _0x447a3a=_0xbc80[_0x265aa2];return _0x447a3a;};'use strict';var _=require('lodash');var util=require(_0x0bc8('0x0'));var logger=require('../../config/logger')(_0x0bc8('0x1'));var moment=require('moment');var BPromise=require(_0x0bc8('0x2'));var rp=require(_0x0bc8('0x3'));var fs=require('fs');var path=require(_0x0bc8('0x4'));var rimraf=require(_0x0bc8('0x5'));var config=require(_0x0bc8('0x6'));var attributes=require(_0x0bc8('0x7'));module[_0x0bc8('0x8')]=function(_0x82d952,_0x46434a){return _0x82d952[_0x0bc8('0x9')](_0x0bc8('0xa'),attributes,{'tableName':_0x0bc8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0bc8('0xc')});};
\ No newline at end of file
+var _0x5c7c=['api','moment','bluebird','path','rimraf','../../config/environment','./mailApplication.attributes','exports','MailApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x27f616,_0xf48a6d){var _0x5ebae0=function(_0x323d0a){while(--_0x323d0a){_0x27f616['push'](_0x27f616['shift']());}};_0x5ebae0(++_0xf48a6d);}(_0x5c7c,0x11c));var _0xc5c7=function(_0x35c013,_0x456f78){_0x35c013=_0x35c013-0x0;var _0x3e1e17=_0x5c7c[_0x35c013];return _0x3e1e17;};'use strict';var _=require(_0xc5c7('0x0'));var util=require('util');var logger=require(_0xc5c7('0x1'))(_0xc5c7('0x2'));var moment=require(_0xc5c7('0x3'));var BPromise=require(_0xc5c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc5c7('0x5'));var rimraf=require(_0xc5c7('0x6'));var config=require(_0xc5c7('0x7'));var attributes=require(_0xc5c7('0x8'));module[_0xc5c7('0x9')]=function(_0x374ce8,_0x5149b3){return _0x374ce8['define'](_0xc5c7('0xa'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc5c7('0xb'),'collate':_0xc5c7('0xc')});};
\ No newline at end of file
index 795f3be..dfdb645 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe39a=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','update','body','options','raw','attributes','limit','UpdateMailApplication','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x323c6a,_0x1378c0){var _0x4148d8=function(_0xc686b3){while(--_0xc686b3){_0x323c6a['push'](_0x323c6a['shift']());}};_0x4148d8(++_0x1378c0);}(_0xe39a,0x155));var _0xae39=function(_0x580196,_0x49b792){_0x580196=_0x580196-0x0;var _0x1a1ed8=_0xe39a[_0x580196];return _0x1a1ed8;};'use strict';var _=require(_0xae39('0x0'));var util=require(_0xae39('0x1'));var moment=require(_0xae39('0x2'));var BPromise=require(_0xae39('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae39('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xae39('0x5'));var logger=require(_0xae39('0x6'))(_0xae39('0x7'));var config=require(_0xae39('0x8'));var jayson=require(_0xae39('0x9'));var client=jayson[_0xae39('0xa')][_0xae39('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x257a95,_0x178fd4,_0x416e6c){return new BPromise(function(_0x2b218d,_0x3cf301){return client[_0xae39('0xc')](_0x257a95,_0x416e6c)[_0xae39('0xd')](function(_0x386d39){logger[_0xae39('0xe')](_0xae39('0xf'),_0x178fd4,_0xae39('0x10'));logger['debug'](_0xae39('0x11'),_0x178fd4,_0xae39('0x10'),JSON[_0xae39('0x12')](_0x386d39));if(_0x386d39['error']){if(_0x386d39[_0xae39('0x13')][_0xae39('0x14')]===0x1f4){logger['error'](_0xae39('0xf'),_0x178fd4,_0x386d39[_0xae39('0x13')]['message']);return _0x3cf301(_0x386d39['error'][_0xae39('0x15')]);}logger[_0xae39('0x13')](_0xae39('0xf'),_0x178fd4,_0x386d39['error']['message']);return _0x2b218d(_0x386d39[_0xae39('0x13')][_0xae39('0x15')]);}else{logger[_0xae39('0xe')](_0xae39('0xf'),_0x178fd4,_0xae39('0x10'));_0x2b218d(_0x386d39['result'][_0xae39('0x15')]);}})['catch'](function(_0x439669){logger[_0xae39('0x13')](_0xae39('0xf'),_0x178fd4,_0x439669);_0x3cf301(_0x439669);});});}exports['UpdateMailApplication']=function(_0x198c14){var _0x186a84=this;return new Promise(function(_0xcbef8c,_0x4ebc1a){return db['MailApplication'][_0xae39('0x16')](_0x198c14[_0xae39('0x17')],{'raw':_0x198c14['options']?_0x198c14[_0xae39('0x18')][_0xae39('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x198c14[_0xae39('0x18')]?_0x198c14[_0xae39('0x18')]['where']||null:null,'attributes':_0x198c14[_0xae39('0x18')]?_0x198c14[_0xae39('0x18')][_0xae39('0x1a')]||null:null,'limit':_0x198c14[_0xae39('0x18')]?_0x198c14[_0xae39('0x18')][_0xae39('0x1b')]||null:null})[_0xae39('0xd')](function(_0x586a5d){logger[_0xae39('0xe')](_0xae39('0x1c'),_0x198c14);logger['debug'](_0xae39('0x1c'),_0x198c14,JSON[_0xae39('0x12')](_0x586a5d));_0xcbef8c(_0x586a5d);})['catch'](function(_0x3f3541){logger[_0xae39('0x13')](_0xae39('0x1c'),_0x3f3541['message'],_0x198c14);_0x4ebc1a(_0x186a84[_0xae39('0x13')](0x1f4,_0x3f3541['message']));});});};
\ No newline at end of file
+var _0xd8da=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','update','options','raw','where','attributes','UpdateMailApplication','util','moment','bluebird'];(function(_0x2c753c,_0x3378e7){var _0x23ba20=function(_0xac82d){while(--_0xac82d){_0x2c753c['push'](_0x2c753c['shift']());}};_0x23ba20(++_0x3378e7);}(_0xd8da,0x11d));var _0xad8d=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xd8da[_0x4b2863];return _0x567d67;};'use strict';var _=require('lodash');var util=require(_0xad8d('0x0'));var moment=require(_0xad8d('0x1'));var BPromise=require(_0xad8d('0x2'));var rs=require(_0xad8d('0x3'));var fs=require('fs');var Redis=require(_0xad8d('0x4'));var db=require(_0xad8d('0x5'))['db'];var utils=require(_0xad8d('0x6'));var logger=require(_0xad8d('0x7'))(_0xad8d('0x8'));var config=require(_0xad8d('0x9'));var jayson=require(_0xad8d('0xa'));var client=jayson[_0xad8d('0xb')][_0xad8d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x54fead,_0x18b2e2,_0x1a03d8){return new BPromise(function(_0x53e4e4,_0xb41d61){return client[_0xad8d('0xd')](_0x54fead,_0x1a03d8)[_0xad8d('0xe')](function(_0x57ae3b){logger['info'](_0xad8d('0xf'),_0x18b2e2,'request\x20sent');logger[_0xad8d('0x10')](_0xad8d('0x11'),_0x18b2e2,_0xad8d('0x12'),JSON[_0xad8d('0x13')](_0x57ae3b));if(_0x57ae3b[_0xad8d('0x14')]){if(_0x57ae3b['error'][_0xad8d('0x15')]===0x1f4){logger['error'](_0xad8d('0xf'),_0x18b2e2,_0x57ae3b[_0xad8d('0x14')][_0xad8d('0x16')]);return _0xb41d61(_0x57ae3b[_0xad8d('0x14')][_0xad8d('0x16')]);}logger[_0xad8d('0x14')]('MailApplication,\x20%s,\x20%s',_0x18b2e2,_0x57ae3b[_0xad8d('0x14')][_0xad8d('0x16')]);return _0x53e4e4(_0x57ae3b[_0xad8d('0x14')]['message']);}else{logger[_0xad8d('0x17')](_0xad8d('0xf'),_0x18b2e2,_0xad8d('0x12'));_0x53e4e4(_0x57ae3b[_0xad8d('0x18')][_0xad8d('0x16')]);}})[_0xad8d('0x19')](function(_0x5d4466){logger[_0xad8d('0x14')](_0xad8d('0xf'),_0x18b2e2,_0x5d4466);_0xb41d61(_0x5d4466);});});}exports['UpdateMailApplication']=function(_0x9c015){var _0xfbc041=this;return new Promise(function(_0x2f8888,_0x34d842){return db['MailApplication'][_0xad8d('0x1a')](_0x9c015['body'],{'raw':_0x9c015[_0xad8d('0x1b')]?_0x9c015[_0xad8d('0x1b')][_0xad8d('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9c015[_0xad8d('0x1b')]?_0x9c015[_0xad8d('0x1b')][_0xad8d('0x1d')]||null:null,'attributes':_0x9c015['options']?_0x9c015['options'][_0xad8d('0x1e')]||null:null,'limit':_0x9c015[_0xad8d('0x1b')]?_0x9c015[_0xad8d('0x1b')]['limit']||null:null})['then'](function(_0x20d9ee){logger['info']('UpdateMailApplication',_0x9c015);logger[_0xad8d('0x10')]('UpdateMailApplication',_0x9c015,JSON[_0xad8d('0x13')](_0x20d9ee));_0x2f8888(_0x20d9ee);})[_0xad8d('0x19')](function(_0x434b4b){logger[_0xad8d('0x14')](_0xad8d('0x1f'),_0x434b4b[_0xad8d('0x16')],_0x9c015);_0x34d842(_0xfbc041[_0xad8d('0x14')](0x1f4,_0x434b4b[_0xad8d('0x16')]));});});};
\ No newline at end of file
index 564fd56..76939ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3a3=['mailinteraction:update','update','delete','removeTags','exports','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','/:id','/:id/download','download','post','create','/:id/messages','/:id/tags','tracked','mail','mailinteraction:addtags','put'];(function(_0x430715,_0x1b1702){var _0x28856f=function(_0xea06a4){while(--_0xea06a4){_0x430715['push'](_0x430715['shift']());}};_0x28856f(++_0x1b1702);}(_0xa3a3,0x95));var _0x3a3a=function(_0xc2768f,_0x59e6a4){_0xc2768f=_0xc2768f-0x0;var _0x2be6ff=_0xa3a3[_0xc2768f];return _0x2be6ff;};'use strict';var express=require('express');var router=express[_0x3a3a('0x0')]();var auth=require(_0x3a3a('0x1'));var interaction=require(_0x3a3a('0x2'));var controller=require(_0x3a3a('0x3'));router[_0x3a3a('0x4')]('/',auth[_0x3a3a('0x5')](),controller[_0x3a3a('0x6')]);router[_0x3a3a('0x4')](_0x3a3a('0x7'),auth[_0x3a3a('0x5')](),controller['describe']);router['get'](_0x3a3a('0x8'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/messages',auth[_0x3a3a('0x5')](),controller['getMessages']);router['get'](_0x3a3a('0x9'),auth[_0x3a3a('0x5')](),controller[_0x3a3a('0xa')]);router[_0x3a3a('0xb')]('/',auth[_0x3a3a('0x5')](),controller[_0x3a3a('0xc')]);router['post'](_0x3a3a('0xd'),auth[_0x3a3a('0x5')](),controller['addMessage']);router[_0x3a3a('0xb')](_0x3a3a('0xe'),auth['isAuthenticated'](),interaction[_0x3a3a('0xf')](_0x3a3a('0x10'),_0x3a3a('0x11')),controller['addTags']);router[_0x3a3a('0x12')](_0x3a3a('0x8'),auth[_0x3a3a('0x5')](),interaction['tracked']('mail',_0x3a3a('0x13')),controller[_0x3a3a('0x14')]);router['delete'](_0x3a3a('0x8'),auth[_0x3a3a('0x5')](),interaction['tracked'](_0x3a3a('0x10'),'mailinteraction:destroy'),controller['destroy']);router[_0x3a3a('0x15')](_0x3a3a('0xe'),auth[_0x3a3a('0x5')](),controller[_0x3a3a('0x16')]);module[_0x3a3a('0x17')]=router;
\ No newline at end of file
+var _0xbfff=['../../components/interaction/service','get','isAuthenticated','index','describe','/:id','/:id/messages','download','post','create','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','mailinteraction:destroy','exports','Router','../../components/auth/service'];(function(_0x307bf6,_0x55bdd5){var _0x2878fc=function(_0x4fa44f){while(--_0x4fa44f){_0x307bf6['push'](_0x307bf6['shift']());}};_0x2878fc(++_0x55bdd5);}(_0xbfff,0xfb));var _0xfbff=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbfff[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var router=express[_0xfbff('0x0')]();var auth=require(_0xfbff('0x1'));var interaction=require(_0xfbff('0x2'));var controller=require('./mailInteraction.controller');router[_0xfbff('0x3')]('/',auth[_0xfbff('0x4')](),controller[_0xfbff('0x5')]);router[_0xfbff('0x3')]('/describe',auth[_0xfbff('0x4')](),controller[_0xfbff('0x6')]);router[_0xfbff('0x3')](_0xfbff('0x7'),auth[_0xfbff('0x4')](),controller['show']);router['get'](_0xfbff('0x8'),auth[_0xfbff('0x4')](),controller['getMessages']);router[_0xfbff('0x3')]('/:id/download',auth[_0xfbff('0x4')](),controller[_0xfbff('0x9')]);router[_0xfbff('0xa')]('/',auth[_0xfbff('0x4')](),controller[_0xfbff('0xb')]);router[_0xfbff('0xa')](_0xfbff('0x8'),auth[_0xfbff('0x4')](),controller['addMessage']);router['post'](_0xfbff('0xc'),auth[_0xfbff('0x4')](),interaction[_0xfbff('0xd')](_0xfbff('0xe'),_0xfbff('0xf')),controller[_0xfbff('0x10')]);router[_0xfbff('0x11')]('/:id',auth['isAuthenticated'](),interaction[_0xfbff('0xd')](_0xfbff('0xe'),_0xfbff('0x12')),controller[_0xfbff('0x13')]);router[_0xfbff('0x14')](_0xfbff('0x7'),auth[_0xfbff('0x4')](),interaction[_0xfbff('0xd')]('mail',_0xfbff('0x15')),controller['destroy']);router[_0xfbff('0x14')](_0xfbff('0xc'),auth['isAuthenticated'](),controller['removeTags']);module[_0xfbff('0x16')]=router;
\ No newline at end of file
index dde68a5..6a81b7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe67d=['DATE','ENUM','out','sequelize','iconv','exports','BOOLEAN','STRING','TEXT'];(function(_0x49a655,_0x1ca0b3){var _0x2d513c=function(_0x2b64af){while(--_0x2b64af){_0x49a655['push'](_0x49a655['shift']());}};_0x2d513c(++_0x1ca0b3);}(_0xe67d,0x123));var _0xde67=function(_0x57d500,_0xf52c67){_0x57d500=_0x57d500-0x0;var _0x142c14=_0xe67d[_0x57d500];return _0x142c14;};'use strict';var Sequelize=require(_0xde67('0x0'));var iconv=require(_0xde67('0x1'));module[_0xde67('0x2')]={'closed':{'type':Sequelize[_0xde67('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xde67('0x4')]},'secondDisposition':{'type':Sequelize[_0xde67('0x4')]},'thirdDisposition':{'type':Sequelize[_0xde67('0x4')]},'note':{'type':Sequelize[_0xde67('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xde67('0x4')]},'cc':{'type':Sequelize[_0xde67('0x5')]('long')},'subject':{'type':Sequelize[_0xde67('0x5')]()},'attach':{'type':Sequelize[_0xde67('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xde67('0x6')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xde67('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xde67('0x6')]},'lastMsgDirection':{'type':Sequelize[_0xde67('0x7')]('in',_0xde67('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xde67('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xbade=['TEXT','long','ENUM','out','sequelize','iconv','exports','BOOLEAN','DATE','STRING'];(function(_0x494241,_0x29030d){var _0x172e2a=function(_0x5b8bd5){while(--_0x5b8bd5){_0x494241['push'](_0x494241['shift']());}};_0x172e2a(++_0x29030d);}(_0xbade,0xa4));var _0xebad=function(_0x1e4f2f,_0x35edfa){_0x1e4f2f=_0x1e4f2f-0x0;var _0xccea89=_0xbade[_0x1e4f2f];return _0xccea89;};'use strict';var Sequelize=require(_0xebad('0x0'));var iconv=require(_0xebad('0x1'));module[_0xebad('0x2')]={'closed':{'type':Sequelize[_0xebad('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xebad('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xebad('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xebad('0x5')](0x1fe)},'to':{'type':Sequelize[_0xebad('0x5')]},'cc':{'type':Sequelize[_0xebad('0x6')](_0xebad('0x7'))},'subject':{'type':Sequelize[_0xebad('0x6')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0xebad('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0xebad('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xebad('0x8')]('in',_0xebad('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xebad('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xebad('0x8')]('in',_0xebad('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xebad('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 9669737..0787d9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6570=['hasOwnProperty','nolimit','order','sort','where','pick','filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','true','spread','Tag','findAll','emit','mailInteractionTags:save','removeTags','unix','toString','root','server','files','tmp','attachments','push','Attachment','Attachments','Messages','from','bcc','subject','createdAt','mkdirSync','missing.recipient@your.company.com','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','join','basename','existsSync','build','writeFileSync','unlinkSync','eml-format','zip-dir','moment','bluebird','util','path','lodash','juice','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','status','end','json','offset','count','limit','set','Content-Range','update','then','destroy','sendStatus','error','stack','name','send','index','MailInteraction','rawAttributes','type','key','getOptions','mail','query','catch','show','params','model','keys','intersection','fields','attributes','length','includeAll','include','merge','options','find','create','body','describe','addMessage','MailMessage','ids','omit','filters'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x6570,0x10c));var _0x0657=function(_0x9defc4,_0x569d66){_0x9defc4=_0x9defc4-0x0;var _0x5bb415=_0x6570[_0x9defc4];return _0x5bb415;};'use strict';var emlformat=require(_0x0657('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0657('0x1'));var moment=require(_0x0657('0x2'));var BPromise=require(_0x0657('0x3'));var util=require(_0x0657('0x4'));var path=require(_0x0657('0x5'));var fs=require('fs');var _=require(_0x0657('0x6'));var juice=require(_0x0657('0x7'));var Redis=require('ioredis');var interaction=require(_0x0657('0x8'));var qs=require(_0x0657('0x9'));var logger=require(_0x0657('0xa'))(_0x0657('0xb'));var config=require(_0x0657('0xc'));var db=require(_0x0657('0xd'))['db'];var htmlEntities=require(_0x0657('0xe'));config[_0x0657('0xf')]=_[_0x0657('0x10')](config['redis'],{'host':_0x0657('0x11'),'port':0x18eb});var socket=require(_0x0657('0x12'))(new Redis(config[_0x0657('0xf')]));require('./mailInteraction.socket')['register'](socket);function respondWithStatusCode(_0x5db135,_0x5f1d5a){_0x5f1d5a=_0x5f1d5a||0xcc;return function(_0x30c43d){if(_0x30c43d){return _0x5db135['sendStatus'](_0x5f1d5a);}return _0x5db135[_0x0657('0x13')](_0x5f1d5a)[_0x0657('0x14')]();};}function respondWithResult(_0x370987,_0x27cef7){_0x27cef7=_0x27cef7||0xc8;return function(_0x2bb9d5){if(_0x2bb9d5){return _0x370987[_0x0657('0x13')](_0x27cef7)[_0x0657('0x15')](_0x2bb9d5);}};}function respondWithFilteredResult(_0x3f527a,_0x1fd85a){return function(_0x2b9141){if(_0x2b9141){var _0x1f2f61=typeof _0x1fd85a[_0x0657('0x16')]==='undefined'&&typeof _0x1fd85a['limit']==='undefined';var _0x23a497=_0x2b9141[_0x0657('0x17')];var _0x44ae1e=_0x1f2f61?0x0:_0x1fd85a[_0x0657('0x16')];var _0x5e4aed=_0x1f2f61?_0x2b9141['count']:_0x1fd85a[_0x0657('0x16')]+_0x1fd85a[_0x0657('0x18')];var _0xebc032;if(_0x5e4aed>=_0x23a497){_0x5e4aed=_0x23a497;_0xebc032=0xc8;}else{_0xebc032=0xce;}_0x3f527a[_0x0657('0x13')](_0xebc032);return _0x3f527a[_0x0657('0x19')](_0x0657('0x1a'),_0x44ae1e+'-'+_0x5e4aed+'/'+_0x23a497)['json'](_0x2b9141);}return null;};}function saveUpdates(_0x350534){return function(_0x5ce5b7){if(_0x5ce5b7){return _0x5ce5b7[_0x0657('0x1b')](_0x350534)[_0x0657('0x1c')](function(_0x42af18){return _0x42af18;});}return null;};}function removeEntity(_0x279e83){return function(_0x585c7d){if(_0x585c7d){return _0x585c7d[_0x0657('0x1d')]()[_0x0657('0x1c')](function(){_0x279e83['status'](0xcc)[_0x0657('0x14')]();});}};}function handleEntityNotFound(_0x312e14){return function(_0x4e0a43){if(!_0x4e0a43){_0x312e14[_0x0657('0x1e')](0x194);}return _0x4e0a43;};}function handleError(_0x1320e2,_0x3679db){_0x3679db=_0x3679db||0x1f4;return function(_0x131e05){logger[_0x0657('0x1f')](_0x131e05[_0x0657('0x20')]);if(_0x131e05[_0x0657('0x21')]){delete _0x131e05[_0x0657('0x21')];}_0x1320e2[_0x0657('0x13')](_0x3679db)[_0x0657('0x22')](_0x131e05);};}exports[_0x0657('0x23')]=function(_0x160136,_0x1f3b2f){var _0x2ac91e={};var _0x16e3ee=_['map'](db[_0x0657('0x24')][_0x0657('0x25')],function(_0xd9054){return{'name':_0xd9054['fieldName'],'type':_0xd9054[_0x0657('0x26')][_0x0657('0x27')]};});_0x2ac91e=qs[_0x0657('0x28')](_0x16e3ee,_0x160136);return interaction['findAll'](_0x0657('0x29'),_0x160136[_0x0657('0x2a')],_0x160136['user'],_0x2ac91e,_0x16e3ee)[_0x0657('0x1c')](respondWithFilteredResult(_0x1f3b2f,_0x2ac91e))[_0x0657('0x2b')](handleError(_0x1f3b2f,null));};exports[_0x0657('0x2c')]=function(_0x58b858,_0x349d9d){var _0x4a16a5={'raw':![],'where':{'id':_0x58b858[_0x0657('0x2d')]['id']}},_0x10b2c8={};_0x10b2c8[_0x0657('0x2e')]=_[_0x0657('0x2f')](db[_0x0657('0x24')]['rawAttributes']);_0x10b2c8['query']=_[_0x0657('0x2f')](_0x58b858[_0x0657('0x2a')]);_0x10b2c8['filters']=_['intersection'](_0x10b2c8[_0x0657('0x2e')],_0x10b2c8[_0x0657('0x2a')]);_0x4a16a5['attributes']=_[_0x0657('0x30')](_0x10b2c8['model'],qs[_0x0657('0x31')](_0x58b858['query'][_0x0657('0x31')]));_0x4a16a5[_0x0657('0x32')]=_0x4a16a5[_0x0657('0x32')][_0x0657('0x33')]?_0x4a16a5[_0x0657('0x32')]:_0x10b2c8['model'];if(_0x58b858[_0x0657('0x2a')][_0x0657('0x34')]){_0x4a16a5[_0x0657('0x35')]=[{'all':!![]}];}_0x4a16a5=_[_0x0657('0x36')]({},_0x4a16a5,_0x58b858[_0x0657('0x37')]);return db[_0x0657('0x24')][_0x0657('0x38')](_0x4a16a5)['then'](handleEntityNotFound(_0x349d9d,null))[_0x0657('0x1c')](respondWithResult(_0x349d9d,null))[_0x0657('0x2b')](handleError(_0x349d9d,null));};exports[_0x0657('0x39')]=function(_0x10cd96,_0x56d489){return db['MailInteraction'][_0x0657('0x39')](_0x10cd96[_0x0657('0x3a')],{})['then'](respondWithResult(_0x56d489,0xc9))['catch'](handleError(_0x56d489,null));};exports['update']=function(_0x3ebf47,_0x4ba8b7){if(_0x3ebf47[_0x0657('0x3a')]['id']){delete _0x3ebf47[_0x0657('0x3a')]['id'];}return db['MailInteraction'][_0x0657('0x38')]({'where':{'id':_0x3ebf47['params']['id']}})[_0x0657('0x1c')](handleEntityNotFound(_0x4ba8b7,null))[_0x0657('0x1c')](saveUpdates(_0x3ebf47[_0x0657('0x3a')],null))[_0x0657('0x1c')](respondWithResult(_0x4ba8b7,null))['catch'](handleError(_0x4ba8b7,null));};exports[_0x0657('0x1d')]=function(_0x1c427b,_0x89471e){return db[_0x0657('0x24')][_0x0657('0x38')]({'where':{'id':_0x1c427b[_0x0657('0x2d')]['id']}})[_0x0657('0x1c')](handleEntityNotFound(_0x89471e,null))[_0x0657('0x1c')](removeEntity(_0x89471e,null))[_0x0657('0x2b')](handleError(_0x89471e,null));};exports[_0x0657('0x3b')]=function(_0x2d6c86,_0x202990){return db[_0x0657('0x24')][_0x0657('0x3b')]()[_0x0657('0x1c')](respondWithResult(_0x202990,null))[_0x0657('0x2b')](handleError(_0x202990,null));};exports[_0x0657('0x3c')]=function(_0x350db7,_0x2438f2){return db[_0x0657('0x3d')][_0x0657('0x38')]({'where':{'id':_0x350db7[_0x0657('0x2d')]['id']}})[_0x0657('0x1c')](handleEntityNotFound(_0x2438f2,null))[_0x0657('0x1c')](function(_0x32f516){if(_0x32f516){return _0x32f516[_0x0657('0x3c')](_0x350db7['body'][_0x0657('0x3e')],_[_0x0657('0x3f')](_0x350db7[_0x0657('0x3a')],[_0x0657('0x3e'),'id'])||{});}})[_0x0657('0x1c')](respondWithResult(_0x2438f2,null))[_0x0657('0x2b')](handleError(_0x2438f2,null));};exports['getMessages']=function(_0x433e18,_0x179224){var _0x1ec525={'raw':![],'where':{}};var _0x594447={};var _0x1e9075={'count':0x0,'rows':[]};return db['MailInteraction']['findOne']({'where':{'id':_0x433e18[_0x0657('0x2d')]['id']}})[_0x0657('0x1c')](handleEntityNotFound(_0x179224,null))['then'](function(_0x3df96e){if(_0x3df96e){_0x594447['model']=_[_0x0657('0x2f')](db['MailMessage'][_0x0657('0x25')]);_0x594447[_0x0657('0x2a')]=_[_0x0657('0x2f')](_0x433e18['query']);_0x594447[_0x0657('0x40')]=_[_0x0657('0x30')](_0x594447[_0x0657('0x2e')],_0x594447[_0x0657('0x2a')]);_0x1ec525['attributes']=_['intersection'](_0x594447[_0x0657('0x2e')],qs[_0x0657('0x31')](_0x433e18[_0x0657('0x2a')][_0x0657('0x31')]));_0x1ec525['attributes']=_0x1ec525[_0x0657('0x32')][_0x0657('0x33')]?_0x1ec525['attributes']:_0x594447[_0x0657('0x2e')];if(!_0x433e18[_0x0657('0x2a')][_0x0657('0x41')](_0x0657('0x42'))){_0x1ec525[_0x0657('0x18')]=qs[_0x0657('0x18')](_0x433e18['query'][_0x0657('0x18')]);_0x1ec525[_0x0657('0x16')]=qs[_0x0657('0x16')](_0x433e18[_0x0657('0x2a')][_0x0657('0x16')]);}_0x1ec525[_0x0657('0x43')]=qs[_0x0657('0x44')](_0x433e18[_0x0657('0x2a')]['sort']);_0x1ec525[_0x0657('0x45')]=qs[_0x0657('0x40')](_[_0x0657('0x46')](_0x433e18['query'],_0x594447[_0x0657('0x40')]));_0x1ec525[_0x0657('0x45')]['MailInteractionId']=_0x3df96e['id'];if(_0x433e18[_0x0657('0x2a')][_0x0657('0x47')]){_0x1ec525['where']=_[_0x0657('0x36')](_0x1ec525[_0x0657('0x45')],{'$or':_[_0x0657('0x48')](_0x1ec525['attributes'],function(_0x28d2cd){var _0x1961aa={};_0x1961aa[_0x28d2cd]={'$like':'%'+_0x433e18[_0x0657('0x2a')][_0x0657('0x47')]+'%'};return _0x1961aa;})});}if(_0x433e18[_0x0657('0x2a')]['$gte']){var _0x1d99ca=_0x433e18['query'][_0x0657('0x49')][_0x0657('0x4a')](',');var _0x585cb9={};_0x585cb9[_0x1d99ca[0x0]]={'$gte':moment(_0x1d99ca[0x1])[_0x0657('0x4b')](_0x0657('0x4c'))};_0x1ec525[_0x0657('0x45')]=_[_0x0657('0x36')](_0x1ec525['where'],_0x585cb9);}_0x1ec525=_[_0x0657('0x36')]({},_0x1ec525,_0x433e18[_0x0657('0x37')]);return db[_0x0657('0x3d')]['count']({'where':_0x1ec525[_0x0657('0x45')]})[_0x0657('0x1c')](function(_0x505257){_0x1e9075['count']=_0x505257;if(_0x433e18[_0x0657('0x2a')][_0x0657('0x34')]){_0x1ec525[_0x0657('0x35')]=[{'all':!![]}];}return db[_0x0657('0x3d')]['findAll'](_0x1ec525);})['then'](function(_0x1c03c2){if(_0x433e18['query']['inlineCss']===_0x0657('0x4d')){for(var _0x3f50d9=0x0;_0x3f50d9<_0x1c03c2['length'];_0x3f50d9++){_0x1c03c2[_0x3f50d9][_0x0657('0x3a')]=juice(_0x1c03c2[_0x3f50d9]['body']);}}_0x1e9075['rows']=_0x1c03c2;return _0x1e9075;});}})[_0x0657('0x1c')](respondWithFilteredResult(_0x179224,_0x1ec525))[_0x0657('0x2b')](handleError(_0x179224,null));};exports['addTags']=function(_0x2c58a4,_0x5a88e6){return db[_0x0657('0x24')][_0x0657('0x38')]({'where':{'id':_0x2c58a4[_0x0657('0x2d')]['id']}})[_0x0657('0x1c')](handleEntityNotFound(_0x5a88e6,null))['then'](function(_0x45c0b9){if(_0x45c0b9){return _0x45c0b9['setTags'](_0x2c58a4[_0x0657('0x3a')][_0x0657('0x3e')],_[_0x0657('0x3f')](_0x2c58a4[_0x0657('0x3a')],[_0x0657('0x3e'),'id'])||{})[_0x0657('0x4e')](function(){return db[_0x0657('0x4f')][_0x0657('0x50')]({'attributes':['id',_0x0657('0x21'),'color'],'where':{'id':_0x2c58a4[_0x0657('0x3a')]['ids']}});})[_0x0657('0x1c')](function(_0x378da4){socket[_0x0657('0x51')](_0x0657('0x52'),{'id':Number(_0x2c58a4[_0x0657('0x2d')]['id']),'tags':_0x378da4||[]});return{'id':Number(_0x2c58a4[_0x0657('0x2d')]['id']),'tags':_0x378da4||[]};});}})[_0x0657('0x1c')](respondWithResult(_0x5a88e6,null))[_0x0657('0x2b')](handleError(_0x5a88e6,null));};exports[_0x0657('0x53')]=function(_0x182385,_0xd0caa0){return db['MailInteraction'][_0x0657('0x38')]({'where':{'id':_0x182385[_0x0657('0x2d')]['id']}})[_0x0657('0x1c')](handleEntityNotFound(_0xd0caa0,null))[_0x0657('0x1c')](function(_0x30b02f){if(_0x30b02f){return _0x30b02f[_0x0657('0x53')](_0x182385['query'][_0x0657('0x3e')]);}})[_0x0657('0x1c')](respondWithStatusCode(_0xd0caa0,null))[_0x0657('0x2b')](handleError(_0xd0caa0,null));};exports['download']=function(_0x13816b,_0x2557a3){var _0x5281b9=moment()[_0x0657('0x54')]()[_0x0657('0x55')]();var _0x273d93=path['join'](config[_0x0657('0x56')],_0x0657('0x57'),_0x0657('0x58'),_0x0657('0x59'));var _0x54cd37=path['join'](config['root'],'server',_0x0657('0x58'),'attachments');var _0x50348c=path['join'](_0x273d93,_0x5281b9);var _0x4e7ca7=util[_0x0657('0x4b')]('transcript-%d-%s.zip',_0x13816b[_0x0657('0x2d')]['id'],_0x5281b9);var _0x55f412=path['join'](_0x273d93,_0x4e7ca7);var _0x2fdc97=[];if(_0x13816b[_0x0657('0x2a')][_0x0657('0x5a')]){_0x2fdc97[_0x0657('0x5b')]({'model':db[_0x0657('0x5c')],'as':_0x0657('0x5d'),'raw':!![]});}var _0x3fcc13=[{'model':db[_0x0657('0x3d')],'as':_0x0657('0x5e'),'attributes':['id',_0x0657('0x3a'),_0x0657('0x5f'),'to','cc',_0x0657('0x60'),_0x0657('0x61'),_0x0657('0x62')],'where':{'secret':![]},'order':qs[_0x0657('0x44')]('id'),'include':_0x2fdc97}];return db[_0x0657('0x24')][_0x0657('0x38')]({'where':{'id':_0x13816b[_0x0657('0x2d')]['id']},'include':_0x3fcc13})[_0x0657('0x1c')](handleEntityNotFound(_0x2557a3,null))['then'](function(_0x4a9a05){if(_0x4a9a05&&_0x4a9a05[_0x0657('0x5e')]){var _0x3c46dd=_0x4a9a05['get']({'plain':!![]});fs[_0x0657('0x63')](_0x50348c);return BPromise['each'](_0x3c46dd[_0x0657('0x5e')],function(_0x5244d4,_0x33e6ea){var _0x34f4e5={'from':_0x5244d4[_0x0657('0x5f')],'to':_0x5244d4['to']||_0x0657('0x64'),'subject':_0x5244d4[_0x0657('0x61')],'html':htmlEntities[_0x0657('0x65')](_0x5244d4[_0x0657('0x3a')]),'headers':{'Date':moment(_0x5244d4['createdAt'])['format'](_0x0657('0x66'))},'attachments':[]};if(_0x5244d4['cc']){_0x34f4e5[_0x0657('0x67')]['Cc']=_0x5244d4['cc'];}if(_0x5244d4[_0x0657('0x60')]){_0x34f4e5[_0x0657('0x67')][_0x0657('0x68')]=_0x5244d4[_0x0657('0x60')];}return new BPromise(function(_0x566bf9,_0x5ddf41){if(_0x5244d4['Attachments']){for(var _0x12efee=0x0;_0x12efee<_0x5244d4[_0x0657('0x5d')][_0x0657('0x33')];_0x12efee++){var _0x20bde7=_0x5244d4['Attachments'][_0x12efee];var _0x371619=path[_0x0657('0x69')](_0x54cd37,_0x20bde7[_0x0657('0x6a')]);if(fs[_0x0657('0x6b')](_0x371619)){_0x34f4e5['attachments'][_0x0657('0x5b')]({'name':_0x20bde7['name'],'contentType':_0x20bde7[_0x0657('0x26')],'data':fs['readFileSync'](_0x371619)});}}}emlformat[_0x0657('0x6c')](_0x34f4e5,function(_0x3780f7,_0x43e3e9){if(_0x3780f7)return _0x5ddf41(_0x3780f7);fs[_0x0657('0x6d')](path[_0x0657('0x69')](_0x50348c,util[_0x0657('0x4b')]('message%d.eml',_0x33e6ea)),_0x43e3e9);return _0x566bf9(_0x43e3e9);});});})['then'](function(){return new BPromise(function(_0x14fc37,_0xec65b){zipdir(_0x50348c,{'saveTo':_0x55f412},function(_0x4b3d31,_0x5ad697){if(_0x4b3d31)return _0xec65b(_0x4b3d31);return _0x14fc37(_0x5ad697);});})[_0x0657('0x1c')](function(){return new BPromise(function(_0x796b0d,_0x2f179a){rimraf(_0x50348c,function(_0x3b66da){if(_0x3b66da)_0x2f179a(_0x3b66da);return _0x796b0d();});});})[_0x0657('0x1c')](function(){return _0x2557a3['download'](_0x55f412,_0x4e7ca7,function(_0x15a4d6){if(!_0x15a4d6)fs[_0x0657('0x6e')](_0x55f412);});});});}else{return _0x2557a3['sendStatus'](0xc8);}})['catch'](handleError(_0x2557a3,null));};
\ No newline at end of file
+var _0x42bf=['root','server','files','tmp','transcript-%d-%s.zip','attachments','Attachments','Messages','from','bcc','subject','createdAt','get','each','missing.recipient@your.company.com','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','push','readFileSync','build','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','ioredis','../../config/logger','api','../../mysqldb','html-entities','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','set','error','name','send','index','map','MailInteraction','rawAttributes','type','getOptions','findAll','user','then','catch','show','params','model','query','keys','filters','intersection','attributes','length','includeAll','include','merge','create','body','update','find','destroy','describe','addMessage','MailMessage','ids','getMessages','fields','nolimit','order','sort','pick','where','MailInteractionId','filter','$gte','split','format','options','inlineCss','rows','addTags','setTags','omit','spread','Tag','color','emit','mailInteractionTags:save','download','unix','toString','join'];(function(_0x2d892a,_0x59e61a){var _0x367765=function(_0x1c9901){while(--_0x1c9901){_0x2d892a['push'](_0x2d892a['shift']());}};_0x367765(++_0x59e61a);}(_0x42bf,0x1d5));var _0xf42b=function(_0x3f6298,_0x53f1f3){_0x3f6298=_0x3f6298-0x0;var _0xa237ae=_0x42bf[_0x3f6298];return _0xa237ae;};'use strict';var emlformat=require(_0xf42b('0x0'));var rimraf=require(_0xf42b('0x1'));var zipdir=require(_0xf42b('0x2'));var moment=require(_0xf42b('0x3'));var BPromise=require(_0xf42b('0x4'));var util=require(_0xf42b('0x5'));var path=require(_0xf42b('0x6'));var fs=require('fs');var _=require('lodash');var juice=require('juice');var Redis=require(_0xf42b('0x7'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var logger=require(_0xf42b('0x8'))(_0xf42b('0x9'));var config=require('../../config/environment');var db=require(_0xf42b('0xa'))['db'];var htmlEntities=require(_0xf42b('0xb'));config[_0xf42b('0xc')]=_['defaults'](config[_0xf42b('0xc')],{'host':_0xf42b('0xd'),'port':0x18eb});var socket=require(_0xf42b('0xe'))(new Redis(config[_0xf42b('0xc')]));require('./mailInteraction.socket')[_0xf42b('0xf')](socket);function respondWithStatusCode(_0x5d4f35,_0xf7b672){_0xf7b672=_0xf7b672||0xcc;return function(_0x13dd94){if(_0x13dd94){return _0x5d4f35[_0xf42b('0x10')](_0xf7b672);}return _0x5d4f35[_0xf42b('0x11')](_0xf7b672)[_0xf42b('0x12')]();};}function respondWithResult(_0x4f6c0b,_0x4d00ea){_0x4d00ea=_0x4d00ea||0xc8;return function(_0x329408){if(_0x329408){return _0x4f6c0b['status'](_0x4d00ea)[_0xf42b('0x13')](_0x329408);}};}function respondWithFilteredResult(_0x5418a4,_0x1f86ee){return function(_0x56dc74){if(_0x56dc74){var _0x7f578d=typeof _0x1f86ee['offset']===_0xf42b('0x14')&&typeof _0x1f86ee[_0xf42b('0x15')]===_0xf42b('0x14');var _0x318eb9=_0x56dc74[_0xf42b('0x16')];var _0x1796a6=_0x7f578d?0x0:_0x1f86ee[_0xf42b('0x17')];var _0x389df9=_0x7f578d?_0x56dc74[_0xf42b('0x16')]:_0x1f86ee[_0xf42b('0x17')]+_0x1f86ee[_0xf42b('0x15')];var _0x2d48e2;if(_0x389df9>=_0x318eb9){_0x389df9=_0x318eb9;_0x2d48e2=0xc8;}else{_0x2d48e2=0xce;}_0x5418a4['status'](_0x2d48e2);return _0x5418a4[_0xf42b('0x18')]('Content-Range',_0x1796a6+'-'+_0x389df9+'/'+_0x318eb9)['json'](_0x56dc74);}return null;};}function saveUpdates(_0xe9b406){return function(_0x33d5b7){if(_0x33d5b7){return _0x33d5b7['update'](_0xe9b406)['then'](function(_0x1e98a9){return _0x1e98a9;});}return null;};}function removeEntity(_0x4710c9){return function(_0xf00fca){if(_0xf00fca){return _0xf00fca['destroy']()['then'](function(){_0x4710c9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e829e){return function(_0x3d5260){if(!_0x3d5260){_0x1e829e['sendStatus'](0x194);}return _0x3d5260;};}function handleError(_0x2c5edc,_0x3c83a8){_0x3c83a8=_0x3c83a8||0x1f4;return function(_0x46880d){logger[_0xf42b('0x19')](_0x46880d['stack']);if(_0x46880d[_0xf42b('0x1a')]){delete _0x46880d[_0xf42b('0x1a')];}_0x2c5edc['status'](_0x3c83a8)[_0xf42b('0x1b')](_0x46880d);};}exports[_0xf42b('0x1c')]=function(_0x257c03,_0x1aef9c){var _0x5ce620={};var _0x5f3d22=_[_0xf42b('0x1d')](db[_0xf42b('0x1e')][_0xf42b('0x1f')],function(_0x4a2eca){return{'name':_0x4a2eca['fieldName'],'type':_0x4a2eca[_0xf42b('0x20')]['key']};});_0x5ce620=qs[_0xf42b('0x21')](_0x5f3d22,_0x257c03);return interaction[_0xf42b('0x22')]('mail',_0x257c03['query'],_0x257c03[_0xf42b('0x23')],_0x5ce620,_0x5f3d22)[_0xf42b('0x24')](respondWithFilteredResult(_0x1aef9c,_0x5ce620))[_0xf42b('0x25')](handleError(_0x1aef9c,null));};exports[_0xf42b('0x26')]=function(_0xc029f1,_0x3975aa){var _0x3c9e04={'raw':![],'where':{'id':_0xc029f1[_0xf42b('0x27')]['id']}},_0x51edba={};_0x51edba[_0xf42b('0x28')]=_['keys'](db[_0xf42b('0x1e')][_0xf42b('0x1f')]);_0x51edba[_0xf42b('0x29')]=_[_0xf42b('0x2a')](_0xc029f1[_0xf42b('0x29')]);_0x51edba[_0xf42b('0x2b')]=_[_0xf42b('0x2c')](_0x51edba['model'],_0x51edba[_0xf42b('0x29')]);_0x3c9e04[_0xf42b('0x2d')]=_[_0xf42b('0x2c')](_0x51edba['model'],qs['fields'](_0xc029f1[_0xf42b('0x29')]['fields']));_0x3c9e04['attributes']=_0x3c9e04[_0xf42b('0x2d')][_0xf42b('0x2e')]?_0x3c9e04[_0xf42b('0x2d')]:_0x51edba[_0xf42b('0x28')];if(_0xc029f1[_0xf42b('0x29')][_0xf42b('0x2f')]){_0x3c9e04[_0xf42b('0x30')]=[{'all':!![]}];}_0x3c9e04=_[_0xf42b('0x31')]({},_0x3c9e04,_0xc029f1['options']);return db[_0xf42b('0x1e')]['find'](_0x3c9e04)[_0xf42b('0x24')](handleEntityNotFound(_0x3975aa,null))[_0xf42b('0x24')](respondWithResult(_0x3975aa,null))[_0xf42b('0x25')](handleError(_0x3975aa,null));};exports[_0xf42b('0x32')]=function(_0x58fa00,_0x32538d){return db['MailInteraction'][_0xf42b('0x32')](_0x58fa00[_0xf42b('0x33')],{})[_0xf42b('0x24')](respondWithResult(_0x32538d,0xc9))['catch'](handleError(_0x32538d,null));};exports[_0xf42b('0x34')]=function(_0x2d4f1e,_0x1e3f71){if(_0x2d4f1e['body']['id']){delete _0x2d4f1e[_0xf42b('0x33')]['id'];}return db[_0xf42b('0x1e')][_0xf42b('0x35')]({'where':{'id':_0x2d4f1e[_0xf42b('0x27')]['id']}})['then'](handleEntityNotFound(_0x1e3f71,null))[_0xf42b('0x24')](saveUpdates(_0x2d4f1e[_0xf42b('0x33')],null))[_0xf42b('0x24')](respondWithResult(_0x1e3f71,null))['catch'](handleError(_0x1e3f71,null));};exports[_0xf42b('0x36')]=function(_0x255d1c,_0x100c0a){return db[_0xf42b('0x1e')]['find']({'where':{'id':_0x255d1c[_0xf42b('0x27')]['id']}})['then'](handleEntityNotFound(_0x100c0a,null))['then'](removeEntity(_0x100c0a,null))[_0xf42b('0x25')](handleError(_0x100c0a,null));};exports[_0xf42b('0x37')]=function(_0x5dd484,_0x38678f){return db['MailInteraction'][_0xf42b('0x37')]()[_0xf42b('0x24')](respondWithResult(_0x38678f,null))[_0xf42b('0x25')](handleError(_0x38678f,null));};exports[_0xf42b('0x38')]=function(_0x5d1a1d,_0x3da2df){return db[_0xf42b('0x39')][_0xf42b('0x35')]({'where':{'id':_0x5d1a1d[_0xf42b('0x27')]['id']}})[_0xf42b('0x24')](handleEntityNotFound(_0x3da2df,null))[_0xf42b('0x24')](function(_0x4fe016){if(_0x4fe016){return _0x4fe016['addMessage'](_0x5d1a1d[_0xf42b('0x33')][_0xf42b('0x3a')],_['omit'](_0x5d1a1d[_0xf42b('0x33')],[_0xf42b('0x3a'),'id'])||{});}})[_0xf42b('0x24')](respondWithResult(_0x3da2df,null))[_0xf42b('0x25')](handleError(_0x3da2df,null));};exports[_0xf42b('0x3b')]=function(_0x459eb3,_0x42f501){var _0x4ed505={'raw':![],'where':{}};var _0x3e7427={};var _0x3b0be1={'count':0x0,'rows':[]};return db['MailInteraction']['findOne']({'where':{'id':_0x459eb3[_0xf42b('0x27')]['id']}})[_0xf42b('0x24')](handleEntityNotFound(_0x42f501,null))[_0xf42b('0x24')](function(_0x54b1cc){if(_0x54b1cc){_0x3e7427[_0xf42b('0x28')]=_[_0xf42b('0x2a')](db['MailMessage'][_0xf42b('0x1f')]);_0x3e7427[_0xf42b('0x29')]=_[_0xf42b('0x2a')](_0x459eb3['query']);_0x3e7427[_0xf42b('0x2b')]=_[_0xf42b('0x2c')](_0x3e7427[_0xf42b('0x28')],_0x3e7427['query']);_0x4ed505[_0xf42b('0x2d')]=_['intersection'](_0x3e7427[_0xf42b('0x28')],qs['fields'](_0x459eb3['query'][_0xf42b('0x3c')]));_0x4ed505['attributes']=_0x4ed505['attributes'][_0xf42b('0x2e')]?_0x4ed505[_0xf42b('0x2d')]:_0x3e7427[_0xf42b('0x28')];if(!_0x459eb3['query']['hasOwnProperty'](_0xf42b('0x3d'))){_0x4ed505[_0xf42b('0x15')]=qs[_0xf42b('0x15')](_0x459eb3[_0xf42b('0x29')][_0xf42b('0x15')]);_0x4ed505[_0xf42b('0x17')]=qs['offset'](_0x459eb3[_0xf42b('0x29')][_0xf42b('0x17')]);}_0x4ed505[_0xf42b('0x3e')]=qs['sort'](_0x459eb3[_0xf42b('0x29')][_0xf42b('0x3f')]);_0x4ed505['where']=qs[_0xf42b('0x2b')](_[_0xf42b('0x40')](_0x459eb3[_0xf42b('0x29')],_0x3e7427[_0xf42b('0x2b')]));_0x4ed505[_0xf42b('0x41')][_0xf42b('0x42')]=_0x54b1cc['id'];if(_0x459eb3['query'][_0xf42b('0x43')]){_0x4ed505['where']=_[_0xf42b('0x31')](_0x4ed505[_0xf42b('0x41')],{'$or':_[_0xf42b('0x1d')](_0x4ed505[_0xf42b('0x2d')],function(_0x16a67b){var _0x19b3e9={};_0x19b3e9[_0x16a67b]={'$like':'%'+_0x459eb3['query']['filter']+'%'};return _0x19b3e9;})});}if(_0x459eb3['query'][_0xf42b('0x44')]){var _0xad7fcd=_0x459eb3[_0xf42b('0x29')][_0xf42b('0x44')][_0xf42b('0x45')](',');var _0x402545={};_0x402545[_0xad7fcd[0x0]]={'$gte':moment(_0xad7fcd[0x1])[_0xf42b('0x46')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4ed505['where']=_[_0xf42b('0x31')](_0x4ed505[_0xf42b('0x41')],_0x402545);}_0x4ed505=_['merge']({},_0x4ed505,_0x459eb3[_0xf42b('0x47')]);return db['MailMessage']['count']({'where':_0x4ed505[_0xf42b('0x41')]})['then'](function(_0x6384de){_0x3b0be1['count']=_0x6384de;if(_0x459eb3['query'][_0xf42b('0x2f')]){_0x4ed505['include']=[{'all':!![]}];}return db[_0xf42b('0x39')][_0xf42b('0x22')](_0x4ed505);})['then'](function(_0x554593){if(_0x459eb3['query'][_0xf42b('0x48')]==='true'){for(var _0xef69f5=0x0;_0xef69f5<_0x554593[_0xf42b('0x2e')];_0xef69f5++){_0x554593[_0xef69f5][_0xf42b('0x33')]=juice(_0x554593[_0xef69f5][_0xf42b('0x33')]);}}_0x3b0be1[_0xf42b('0x49')]=_0x554593;return _0x3b0be1;});}})[_0xf42b('0x24')](respondWithFilteredResult(_0x42f501,_0x4ed505))[_0xf42b('0x25')](handleError(_0x42f501,null));};exports[_0xf42b('0x4a')]=function(_0x28c323,_0x3989d2){return db[_0xf42b('0x1e')]['find']({'where':{'id':_0x28c323['params']['id']}})['then'](handleEntityNotFound(_0x3989d2,null))[_0xf42b('0x24')](function(_0x361f75){if(_0x361f75){return _0x361f75[_0xf42b('0x4b')](_0x28c323[_0xf42b('0x33')][_0xf42b('0x3a')],_[_0xf42b('0x4c')](_0x28c323[_0xf42b('0x33')],[_0xf42b('0x3a'),'id'])||{})[_0xf42b('0x4d')](function(){return db[_0xf42b('0x4e')]['findAll']({'attributes':['id','name',_0xf42b('0x4f')],'where':{'id':_0x28c323[_0xf42b('0x33')][_0xf42b('0x3a')]}});})[_0xf42b('0x24')](function(_0x5025ac){socket[_0xf42b('0x50')](_0xf42b('0x51'),{'id':Number(_0x28c323['params']['id']),'tags':_0x5025ac||[]});return{'id':Number(_0x28c323['params']['id']),'tags':_0x5025ac||[]};});}})[_0xf42b('0x24')](respondWithResult(_0x3989d2,null))['catch'](handleError(_0x3989d2,null));};exports['removeTags']=function(_0x16e7a1,_0x8af5ad){return db[_0xf42b('0x1e')]['find']({'where':{'id':_0x16e7a1[_0xf42b('0x27')]['id']}})[_0xf42b('0x24')](handleEntityNotFound(_0x8af5ad,null))[_0xf42b('0x24')](function(_0x3446db){if(_0x3446db){return _0x3446db['removeTags'](_0x16e7a1[_0xf42b('0x29')]['ids']);}})['then'](respondWithStatusCode(_0x8af5ad,null))['catch'](handleError(_0x8af5ad,null));};exports[_0xf42b('0x52')]=function(_0xd63c56,_0x2f1b32){var _0x3cef2f=moment()[_0xf42b('0x53')]()[_0xf42b('0x54')]();var _0xef41ee=path[_0xf42b('0x55')](config[_0xf42b('0x56')],_0xf42b('0x57'),_0xf42b('0x58'),_0xf42b('0x59'));var _0x2cc52e=path[_0xf42b('0x55')](config[_0xf42b('0x56')],_0xf42b('0x57'),'files','attachments');var _0x40dcba=path[_0xf42b('0x55')](_0xef41ee,_0x3cef2f);var _0x5556a6=util['format'](_0xf42b('0x5a'),_0xd63c56['params']['id'],_0x3cef2f);var _0x2ad532=path[_0xf42b('0x55')](_0xef41ee,_0x5556a6);var _0x5698bf=[];if(_0xd63c56[_0xf42b('0x29')][_0xf42b('0x5b')]){_0x5698bf['push']({'model':db['Attachment'],'as':_0xf42b('0x5c'),'raw':!![]});}var _0x35ec64=[{'model':db[_0xf42b('0x39')],'as':_0xf42b('0x5d'),'attributes':['id',_0xf42b('0x33'),_0xf42b('0x5e'),'to','cc',_0xf42b('0x5f'),_0xf42b('0x60'),_0xf42b('0x61')],'where':{'secret':![]},'order':qs[_0xf42b('0x3f')]('id'),'include':_0x5698bf}];return db[_0xf42b('0x1e')][_0xf42b('0x35')]({'where':{'id':_0xd63c56[_0xf42b('0x27')]['id']},'include':_0x35ec64})[_0xf42b('0x24')](handleEntityNotFound(_0x2f1b32,null))[_0xf42b('0x24')](function(_0x5b3ce5){if(_0x5b3ce5&&_0x5b3ce5[_0xf42b('0x5d')]){var _0x1d3006=_0x5b3ce5[_0xf42b('0x62')]({'plain':!![]});fs['mkdirSync'](_0x40dcba);return BPromise[_0xf42b('0x63')](_0x1d3006[_0xf42b('0x5d')],function(_0x336352,_0x4c7d3c){var _0x17837c={'from':_0x336352[_0xf42b('0x5e')],'to':_0x336352['to']||_0xf42b('0x64'),'subject':_0x336352[_0xf42b('0x60')],'html':htmlEntities[_0xf42b('0x65')](_0x336352[_0xf42b('0x33')]),'headers':{'Date':moment(_0x336352[_0xf42b('0x61')])['format'](_0xf42b('0x66'))},'attachments':[]};if(_0x336352['cc']){_0x17837c[_0xf42b('0x67')]['Cc']=_0x336352['cc'];}if(_0x336352[_0xf42b('0x5f')]){_0x17837c[_0xf42b('0x67')][_0xf42b('0x68')]=_0x336352[_0xf42b('0x5f')];}return new BPromise(function(_0x3c31b1,_0x4d676a){if(_0x336352[_0xf42b('0x5c')]){for(var _0x49f879=0x0;_0x49f879<_0x336352[_0xf42b('0x5c')][_0xf42b('0x2e')];_0x49f879++){var _0x29e797=_0x336352['Attachments'][_0x49f879];var _0x20c6c9=path[_0xf42b('0x55')](_0x2cc52e,_0x29e797[_0xf42b('0x69')]);if(fs[_0xf42b('0x6a')](_0x20c6c9)){_0x17837c[_0xf42b('0x5b')][_0xf42b('0x6b')]({'name':_0x29e797['name'],'contentType':_0x29e797[_0xf42b('0x20')],'data':fs[_0xf42b('0x6c')](_0x20c6c9)});}}}emlformat[_0xf42b('0x6d')](_0x17837c,function(_0x11c7cb,_0x46c96f){if(_0x11c7cb)return _0x4d676a(_0x11c7cb);fs['writeFileSync'](path['join'](_0x40dcba,util['format']('message%d.eml',_0x4c7d3c)),_0x46c96f);return _0x3c31b1(_0x46c96f);});});})[_0xf42b('0x24')](function(){return new BPromise(function(_0x549b9e,_0x299bb5){zipdir(_0x40dcba,{'saveTo':_0x2ad532},function(_0x2c2ef9,_0x395523){if(_0x2c2ef9)return _0x299bb5(_0x2c2ef9);return _0x549b9e(_0x395523);});})['then'](function(){return new BPromise(function(_0x189ec0,_0x1a18f5){rimraf(_0x40dcba,function(_0x149ded){if(_0x149ded)_0x1a18f5(_0x149ded);return _0x189ec0();});});})['then'](function(){return _0x2f1b32[_0xf42b('0x52')](_0x2ad532,_0x5556a6,function(_0x4acc20){if(!_0x4acc20)fs[_0xf42b('0x6e')](_0x2ad532);});});});}else{return _0x2f1b32[_0xf42b('0x10')](0xc8);}})[_0xf42b('0x25')](handleError(_0x2f1b32,null));};
\ No newline at end of file
index c403077..72956f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c2f=['MailMessage','setMaxListeners','save','update','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hook','exports','events'];(function(_0x567248,_0x48cd55){var _0x1d30e0=function(_0x4f016e){while(--_0x4f016e){_0x567248['push'](_0x567248['shift']());}};_0x1d30e0(++_0x48cd55);}(_0x1c2f,0x16f));var _0xf1c2=function(_0x40930b,_0x3ac259){_0x40930b=_0x40930b-0x0;var _0x5eda6b=_0x1c2f[_0x40930b];return _0x5eda6b;};'use strict';var EventEmitter=require(_0xf1c2('0x0'));var MailInteraction=require('../../mysqldb')['db']['MailInteraction'];var MailMessage=require('../../mysqldb')['db'][_0xf1c2('0x1')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xf1c2('0x2')](0x0);var events={'afterCreate':_0xf1c2('0x3'),'afterUpdate':_0xf1c2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x26e79b){return function(_0x5f10af,_0x140a29,_0xb75df5){_0x5f10af['getUsers']({'attributes':['id'],'raw':!![]})[_0xf1c2('0x5')](function(_0x2e9b13){_0x5f10af[_0xf1c2('0x6')](_0xf1c2('0x7'),_0x2e9b13[_0xf1c2('0x8')](function(_0x5eeac8){return{'id':_0x5eeac8['id']};}));return MailMessage[_0xf1c2('0x9')]({'where':{'MailInteractionId':_0x5f10af['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3ad82c){_0x5f10af['setDataValue'](_0xf1c2('0xa'),_0x3ad82c[_0xf1c2('0xb')]);MailInteractionEvents[_0xf1c2('0xc')](_0x26e79b+':'+_0x5f10af['id'],_0x5f10af);MailInteractionEvents[_0xf1c2('0xc')](_0x26e79b,_0x5f10af);_0xb75df5(null);})[_0xf1c2('0xd')](_0xb75df5(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xf1c2('0xe')](e,emitEvent(event));}}module[_0xf1c2('0xf')]=MailInteractionEvents;
\ No newline at end of file
+var _0x6af6=['catch','events','MailInteraction','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit'];(function(_0x5cf87f,_0x32a531){var _0x556af7=function(_0x49e0c6){while(--_0x49e0c6){_0x5cf87f['push'](_0x5cf87f['shift']());}};_0x556af7(++_0x32a531);}(_0x6af6,0x1bb));var _0x66af=function(_0x1b73fe,_0x2736e3){_0x1b73fe=_0x1b73fe-0x0;var _0x5bc495=_0x6af6[_0x1b73fe];return _0x5bc495;};'use strict';var EventEmitter=require(_0x66af('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x66af('0x1')];var MailMessage=require(_0x66af('0x2'))['db'][_0x66af('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x66af('0x4')](0x0);var events={'afterCreate':_0x66af('0x5'),'afterUpdate':_0x66af('0x6'),'afterDestroy':_0x66af('0x7')};function emitEvent(_0x4cad95){return function(_0x4144a6,_0x4cf212,_0x466073){_0x4144a6[_0x66af('0x8')]({'attributes':['id'],'raw':!![]})[_0x66af('0x9')](function(_0x206751){_0x4144a6[_0x66af('0xa')]('Users',_0x206751[_0x66af('0xb')](function(_0x4deb5b){return{'id':_0x4deb5b['id']};}));return MailMessage[_0x66af('0xc')]({'where':{'MailInteractionId':_0x4144a6['id'],'direction':'in','read':![]},'raw':!![]});})[_0x66af('0x9')](function(_0x576c7a){_0x4144a6['setDataValue'](_0x66af('0xd'),_0x576c7a[_0x66af('0xe')]);MailInteractionEvents[_0x66af('0xf')](_0x4cad95+':'+_0x4144a6['id'],_0x4144a6);MailInteractionEvents[_0x66af('0xf')](_0x4cad95,_0x4144a6);_0x466073(null);})[_0x66af('0x10')](_0x466073(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module['exports']=MailInteractionEvents;
\ No newline at end of file
index 35b305c..8dcb139 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe23b=['moment','bluebird','request-promise','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','format','closed','YYYY-MM-DD\x20HH:mm:ss','changed','substatus','closedAt','substatusAt','models','get','MailMessage','update','catch','utf8mb4','lodash','util','api'];(function(_0x294ccc,_0x1ef0b8){var _0x3fa77e=function(_0x452f26){while(--_0x452f26){_0x294ccc['push'](_0x294ccc['shift']());}};_0x3fa77e(++_0x1ef0b8);}(_0xe23b,0x1c8));var _0xbe23=function(_0x394300,_0x2a1268){_0x394300=_0x394300-0x0;var _0x12fc3d=_0xe23b[_0x394300];return _0x12fc3d;};'use strict';var _=require(_0xbe23('0x0'));var util=require(_0xbe23('0x1'));var logger=require('../../config/logger')(_0xbe23('0x2'));var moment=require(_0xbe23('0x3'));var BPromise=require(_0xbe23('0x4'));var rp=require(_0xbe23('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbe23('0x6'));var attributes=require(_0xbe23('0x7'));module[_0xbe23('0x8')]=function(_0x1673c5,_0x479b1e){return _0x1673c5[_0xbe23('0x9')](_0xbe23('0xa'),attributes,{'tableName':_0xbe23('0xb'),'paranoid':![],'indexes':[{'name':_0xbe23('0xc'),'fields':[_0xbe23('0xd'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x47304c,_0x122d88,_0x407b71){if(_0x47304c['substatus']){_0x47304c['substatusAt']=moment()[_0xbe23('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x47304c[_0xbe23('0xf')]){_0x47304c['closedAt']=moment()[_0xbe23('0xe')](_0xbe23('0x10'));}_0x407b71(null,_0x122d88);},'beforeUpdate':function(_0xc76b27,_0x522b07,_0x297342){if(_0xc76b27[_0xbe23('0x11')]('substatus')){_0xc76b27['substatusAt']=_0xc76b27[_0xbe23('0x12')]?moment()[_0xbe23('0xe')](_0xbe23('0x10')):null;}if(_0xc76b27[_0xbe23('0x11')](_0xbe23('0xf'))){_0xc76b27[_0xbe23('0x13')]=moment()[_0xbe23('0xe')](_0xbe23('0x10'));_0xc76b27['substatus']=null;_0xc76b27[_0xbe23('0x14')]=null;}_0x297342(null,_0xc76b27);},'afterUpdate':function(_0x18992c,_0x4fc2e6,_0x4d2473){var _0x329e3d=_0x1673c5[_0xbe23('0x15')];var _0x1812aa=_0x18992c[_0xbe23('0x16')]({'plain':!![]});if(_0x1812aa['closed']){return _0x329e3d[_0xbe23('0x17')][_0xbe23('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x1812aa['id']}})['then'](function(){_0x4d2473();})[_0xbe23('0x19')](function(_0x41cafa){_0x4d2473(_0x41cafa);});}else{_0x4d2473();}}},'charset':_0xbe23('0x1a'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x85e6=['fti_mail_interactions','subject','FULLTEXT','substatus','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','substatusAt','models','get','MailMessage','update','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions'];(function(_0x384c48,_0x3c5cf2){var _0x4956ea=function(_0x248916){while(--_0x248916){_0x384c48['push'](_0x384c48['shift']());}};_0x4956ea(++_0x3c5cf2);}(_0x85e6,0x13c));var _0x685e=function(_0x4f0c0,_0x16ab9b){_0x4f0c0=_0x4f0c0-0x0;var _0x1383d1=_0x85e6[_0x4f0c0];return _0x1383d1;};'use strict';var _=require(_0x685e('0x0'));var util=require(_0x685e('0x1'));var logger=require(_0x685e('0x2'))(_0x685e('0x3'));var moment=require('moment');var BPromise=require(_0x685e('0x4'));var rp=require(_0x685e('0x5'));var fs=require('fs');var path=require(_0x685e('0x6'));var rimraf=require(_0x685e('0x7'));var config=require(_0x685e('0x8'));var attributes=require(_0x685e('0x9'));module[_0x685e('0xa')]=function(_0x5ed94c,_0x1cdb1a){return _0x5ed94c[_0x685e('0xb')](_0x685e('0xc'),attributes,{'tableName':_0x685e('0xd'),'paranoid':![],'indexes':[{'name':_0x685e('0xe'),'fields':[_0x685e('0xf'),'to'],'type':_0x685e('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2f7e26,_0x283d73,_0x46de11){if(_0x2f7e26[_0x685e('0x11')]){_0x2f7e26['substatusAt']=moment()['format'](_0x685e('0x12'));}if(_0x2f7e26[_0x685e('0x13')]){_0x2f7e26[_0x685e('0x14')]=moment()[_0x685e('0x15')](_0x685e('0x12'));}_0x46de11(null,_0x283d73);},'beforeUpdate':function(_0x3f8cae,_0x4939c5,_0x565c18){if(_0x3f8cae[_0x685e('0x16')](_0x685e('0x11'))){_0x3f8cae[_0x685e('0x17')]=_0x3f8cae[_0x685e('0x11')]?moment()[_0x685e('0x15')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x3f8cae[_0x685e('0x16')]('closed')){_0x3f8cae[_0x685e('0x14')]=moment()[_0x685e('0x15')](_0x685e('0x12'));_0x3f8cae[_0x685e('0x11')]=null;_0x3f8cae[_0x685e('0x17')]=null;}_0x565c18(null,_0x3f8cae);},'afterUpdate':function(_0x4bc963,_0x1dc0ca,_0x2a9aa5){var _0x4963ab=_0x5ed94c[_0x685e('0x18')];var _0x3ab3c5=_0x4bc963[_0x685e('0x19')]({'plain':!![]});if(_0x3ab3c5[_0x685e('0x13')]){return _0x4963ab[_0x685e('0x1a')][_0x685e('0x1b')]({'read':!![]},{'where':{'MailInteractionId':_0x3ab3c5['id']}})['then'](function(){_0x2a9aa5();})[_0x685e('0x1c')](function(_0xebd8a2){_0x2a9aa5(_0xebd8a2);});}else{_0x2a9aa5();}}},'charset':'utf8mb4','collate':_0x685e('0x1d')});};
\ No newline at end of file
index 38e8fbe..dd1d89b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0127=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','MailInteraction,\x20%s,\x20%s','info','result','catch','UpdateMailInteraction','MailInteraction','update','options','raw','where','attributes','limit','stringify','AddTagsToMailInteraction','body','ids','spread','AddTags','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x58f923,_0x2ac4a7){var _0x12088c=function(_0x415533){while(--_0x415533){_0x58f923['push'](_0x58f923['shift']());}};_0x12088c(++_0x2ac4a7);}(_0x0127,0xa0));var _0x7012=function(_0x255905,_0x5e28c0){_0x255905=_0x255905-0x0;var _0xffc3c2=_0x0127[_0x255905];return _0xffc3c2;};'use strict';var _=require(_0x7012('0x0'));var util=require('util');var moment=require(_0x7012('0x1'));var BPromise=require(_0x7012('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7012('0x3'));var db=require(_0x7012('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7012('0x5'))(_0x7012('0x6'));var config=require(_0x7012('0x7'));var jayson=require(_0x7012('0x8'));var client=jayson[_0x7012('0x9')][_0x7012('0xa')]({'port':0x232a});config[_0x7012('0xb')]=_['defaults'](config[_0x7012('0xb')],{'host':_0x7012('0xc'),'port':0x18eb});var socket=require(_0x7012('0xd'))(new Redis(config[_0x7012('0xb')]));require(_0x7012('0xe'))[_0x7012('0xf')](socket);function respondWithRpcPromise(_0x5da294,_0x7605c2,_0xc758ad){return new BPromise(function(_0x17599d,_0x42d0a2){return client[_0x7012('0x10')](_0x5da294,_0xc758ad)[_0x7012('0x11')](function(_0x15886e){logger['info']('MailInteraction,\x20%s,\x20%s',_0x7605c2,_0x7012('0x12'));logger[_0x7012('0x13')](_0x7012('0x14'),_0x7605c2,'request\x20sent',JSON['stringify'](_0x15886e));if(_0x15886e[_0x7012('0x15')]){if(_0x15886e[_0x7012('0x15')][_0x7012('0x16')]===0x1f4){logger[_0x7012('0x15')]('MailInteraction,\x20%s,\x20%s',_0x7605c2,_0x15886e[_0x7012('0x15')][_0x7012('0x17')]);return _0x42d0a2(_0x15886e[_0x7012('0x15')]['message']);}logger['error'](_0x7012('0x18'),_0x7605c2,_0x15886e[_0x7012('0x15')]['message']);return _0x17599d(_0x15886e[_0x7012('0x15')][_0x7012('0x17')]);}else{logger[_0x7012('0x19')]('MailInteraction,\x20%s,\x20%s',_0x7605c2,'request\x20sent');_0x17599d(_0x15886e[_0x7012('0x1a')][_0x7012('0x17')]);}})[_0x7012('0x1b')](function(_0x5840d4){logger['error']('MailInteraction,\x20%s,\x20%s',_0x7605c2,_0x5840d4);_0x42d0a2(_0x5840d4);});});}exports[_0x7012('0x1c')]=function(_0x3e959b){var _0x2802c1=this;return new Promise(function(_0x35a02f,_0x3b2152){return db[_0x7012('0x1d')][_0x7012('0x1e')](_0x3e959b['body'],{'raw':_0x3e959b['options']?_0x3e959b[_0x7012('0x1f')][_0x7012('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e959b[_0x7012('0x1f')]?_0x3e959b[_0x7012('0x1f')][_0x7012('0x21')]||null:null,'attributes':_0x3e959b[_0x7012('0x1f')]?_0x3e959b['options'][_0x7012('0x22')]||null:null,'limit':_0x3e959b[_0x7012('0x1f')]?_0x3e959b[_0x7012('0x1f')][_0x7012('0x23')]||null:null})[_0x7012('0x11')](function(_0x1946fb){logger[_0x7012('0x19')](_0x7012('0x1c'),_0x3e959b);logger[_0x7012('0x13')](_0x7012('0x1c'),_0x3e959b,JSON[_0x7012('0x24')](_0x1946fb));_0x35a02f(_0x1946fb);})[_0x7012('0x1b')](function(_0x385968){logger[_0x7012('0x15')](_0x7012('0x1c'),_0x385968[_0x7012('0x17')],_0x3e959b);_0x3b2152(_0x2802c1['error'](0x1f4,_0x385968[_0x7012('0x17')]));});});};exports[_0x7012('0x25')]=function(_0x4d78ce){return new Promise(function(_0x2b5488,_0x56012f){return db['MailInteraction']['find']({'where':_0x4d78ce['options']?_0x4d78ce[_0x7012('0x1f')][_0x7012('0x21')]||null:null})['then'](function(_0x394f07){if(_0x394f07){return _0x394f07['addTags'](_0x4d78ce[_0x7012('0x26')][_0x7012('0x27')],_['omit'](_0x4d78ce[_0x7012('0x26')],[_0x7012('0x27'),'id'])||{});}})[_0x7012('0x28')](function(_0x3a48e4){logger[_0x7012('0x19')](_0x7012('0x29'),_0x4d78ce);logger['debug'](_0x7012('0x29'),_0x4d78ce,JSON[_0x7012('0x24')](_0x3a48e4));_0x2b5488(_0x3a48e4);})[_0x7012('0x1b')](function(_0x419541){logger[_0x7012('0x15')]('AddTags',_0x419541[_0x7012('0x17')],_0x4d78ce);_0x56012f(_this[_0x7012('0x15')](0x1f4,_0x419541[_0x7012('0x17')]));});});};
\ No newline at end of file
+var _0xa759=['AddTags','lodash','util','moment','bluebird','randomstring','rpc','jayson/promise','http','defaults','redis','localhost','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','MailInteraction','raw','options','where','attributes','UpdateMailInteraction','addTags','ids','omit','body','spread'];(function(_0x43aee5,_0x11268b){var _0x76d1d0=function(_0x3faee6){while(--_0x3faee6){_0x43aee5['push'](_0x43aee5['shift']());}};_0x76d1d0(++_0x11268b);}(_0xa759,0xb5));var _0x9a75=function(_0x3f2f19,_0x2ea0c4){_0x3f2f19=_0x3f2f19-0x0;var _0x18f929=_0xa759[_0x3f2f19];return _0x18f929;};'use strict';var _=require(_0x9a75('0x0'));var util=require(_0x9a75('0x1'));var moment=require(_0x9a75('0x2'));var BPromise=require(_0x9a75('0x3'));var rs=require(_0x9a75('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9a75('0x5'));var config=require('../../config/environment');var jayson=require(_0x9a75('0x6'));var client=jayson['client'][_0x9a75('0x7')]({'port':0x232a});config['redis']=_[_0x9a75('0x8')](config[_0x9a75('0x9')],{'host':_0x9a75('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9a75('0x9')]));require(_0x9a75('0xb'))[_0x9a75('0xc')](socket);function respondWithRpcPromise(_0x62734b,_0x2e256b,_0x47d6e5){return new BPromise(function(_0x254ff1,_0x25781f){return client[_0x9a75('0xd')](_0x62734b,_0x47d6e5)[_0x9a75('0xe')](function(_0x490a3e){logger[_0x9a75('0xf')](_0x9a75('0x10'),_0x2e256b,'request\x20sent');logger[_0x9a75('0x11')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x2e256b,_0x9a75('0x12'),JSON[_0x9a75('0x13')](_0x490a3e));if(_0x490a3e['error']){if(_0x490a3e[_0x9a75('0x14')]['code']===0x1f4){logger[_0x9a75('0x14')]('MailInteraction,\x20%s,\x20%s',_0x2e256b,_0x490a3e[_0x9a75('0x14')][_0x9a75('0x15')]);return _0x25781f(_0x490a3e['error'][_0x9a75('0x15')]);}logger[_0x9a75('0x14')](_0x9a75('0x10'),_0x2e256b,_0x490a3e[_0x9a75('0x14')][_0x9a75('0x15')]);return _0x254ff1(_0x490a3e[_0x9a75('0x14')][_0x9a75('0x15')]);}else{logger['info']('MailInteraction,\x20%s,\x20%s',_0x2e256b,_0x9a75('0x12'));_0x254ff1(_0x490a3e[_0x9a75('0x16')][_0x9a75('0x15')]);}})[_0x9a75('0x17')](function(_0x43d08f){logger[_0x9a75('0x14')](_0x9a75('0x10'),_0x2e256b,_0x43d08f);_0x25781f(_0x43d08f);});});}exports['UpdateMailInteraction']=function(_0x2f4f16){var _0x989db1=this;return new Promise(function(_0x58b10d,_0x1bde9b){return db[_0x9a75('0x18')]['update'](_0x2f4f16['body'],{'raw':_0x2f4f16['options']?_0x2f4f16['options'][_0x9a75('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f4f16[_0x9a75('0x1a')]?_0x2f4f16[_0x9a75('0x1a')][_0x9a75('0x1b')]||null:null,'attributes':_0x2f4f16[_0x9a75('0x1a')]?_0x2f4f16[_0x9a75('0x1a')][_0x9a75('0x1c')]||null:null,'limit':_0x2f4f16['options']?_0x2f4f16['options']['limit']||null:null})[_0x9a75('0xe')](function(_0x10163c){logger[_0x9a75('0xf')]('UpdateMailInteraction',_0x2f4f16);logger['debug'](_0x9a75('0x1d'),_0x2f4f16,JSON[_0x9a75('0x13')](_0x10163c));_0x58b10d(_0x10163c);})[_0x9a75('0x17')](function(_0x24e19f){logger['error'](_0x9a75('0x1d'),_0x24e19f['message'],_0x2f4f16);_0x1bde9b(_0x989db1['error'](0x1f4,_0x24e19f[_0x9a75('0x15')]));});});};exports['AddTagsToMailInteraction']=function(_0x49e346){return new Promise(function(_0x180483,_0x482c68){return db[_0x9a75('0x18')]['find']({'where':_0x49e346['options']?_0x49e346[_0x9a75('0x1a')][_0x9a75('0x1b')]||null:null})[_0x9a75('0xe')](function(_0x462d93){if(_0x462d93){return _0x462d93[_0x9a75('0x1e')](_0x49e346['body'][_0x9a75('0x1f')],_[_0x9a75('0x20')](_0x49e346[_0x9a75('0x21')],[_0x9a75('0x1f'),'id'])||{});}})[_0x9a75('0x22')](function(_0x5c6c8a){logger[_0x9a75('0xf')](_0x9a75('0x23'),_0x49e346);logger[_0x9a75('0x11')](_0x9a75('0x23'),_0x49e346,JSON[_0x9a75('0x13')](_0x5c6c8a));_0x180483(_0x5c6c8a);})[_0x9a75('0x17')](function(_0x53c236){logger['error'](_0x9a75('0x23'),_0x53c236[_0x9a75('0x15')],_0x49e346);_0x482c68(_this['error'](0x1f4,_0x53c236[_0x9a75('0x15')]));});});};
\ No newline at end of file
index 45b7ccd..df7f6b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1975=['register','mailInteraction:','./mailInteraction.events','save','remove','update','emit','removeListener'];(function(_0x5d2f3d,_0x2ab56a){var _0x44a9de=function(_0x6a7ab8){while(--_0x6a7ab8){_0x5d2f3d['push'](_0x5d2f3d['shift']());}};_0x44a9de(++_0x2ab56a);}(_0x1975,0x12a));var _0x5197=function(_0x40b981,_0x48b308){_0x40b981=_0x40b981-0x0;var _0x58696b=_0x1975[_0x40b981];return _0x58696b;};'use strict';var MailInteractionEvents=require(_0x5197('0x0'));var events=[_0x5197('0x1'),_0x5197('0x2'),_0x5197('0x3')];function createListener(_0x340dcc,_0x4cbf67){return function(_0x1155d2){_0x4cbf67[_0x5197('0x4')](_0x340dcc,_0x1155d2);};}function removeListener(_0x3ef83e,_0x9da29b){return function(){MailInteractionEvents[_0x5197('0x5')](_0x3ef83e,_0x9da29b);};}exports[_0x5197('0x6')]=function(_0x436a92){for(var _0x4c7bb5=0x0,_0x2ac84b=events['length'];_0x4c7bb5<_0x2ac84b;_0x4c7bb5++){var _0x1b6378=events[_0x4c7bb5];var _0x108c10=createListener(_0x5197('0x7')+_0x1b6378,_0x436a92);MailInteractionEvents['on'](_0x1b6378,_0x108c10);}};
\ No newline at end of file
+var _0x4cdc=['save','remove','emit','removeListener','register','length','mailInteraction:','./mailInteraction.events'];(function(_0x602ca8,_0x568e82){var _0x26e8ab=function(_0x3fb700){while(--_0x3fb700){_0x602ca8['push'](_0x602ca8['shift']());}};_0x26e8ab(++_0x568e82);}(_0x4cdc,0x147));var _0xc4cd=function(_0x431bde,_0x2cc32b){_0x431bde=_0x431bde-0x0;var _0x58ac53=_0x4cdc[_0x431bde];return _0x58ac53;};'use strict';var MailInteractionEvents=require(_0xc4cd('0x0'));var events=[_0xc4cd('0x1'),_0xc4cd('0x2'),'update'];function createListener(_0x1e5875,_0x30543c){return function(_0x7fd151){_0x30543c[_0xc4cd('0x3')](_0x1e5875,_0x7fd151);};}function removeListener(_0x35fba4,_0x4754cc){return function(){MailInteractionEvents[_0xc4cd('0x4')](_0x35fba4,_0x4754cc);};}exports[_0xc4cd('0x5')]=function(_0xfa7fa2){for(var _0xcad2a0=0x0,_0x382d81=events[_0xc4cd('0x6')];_0xcad2a0<_0x382d81;_0xcad2a0++){var _0x13cd4a=events[_0xcad2a0];var _0x55d0b7=createListener(_0xc4cd('0x7')+_0x13cd4a,_0xfa7fa2);MailInteractionEvents['on'](_0x13cd4a,_0x55d0b7);}};
\ No newline at end of file
index 2cc50bd..5a5cf66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc9b=['download','post','tracked','mail','mailmessage:create','create','put','update','/:id/reject','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/download'];(function(_0x295172,_0x308de9){var _0x38ea7f=function(_0x3a56f9){while(--_0x3a56f9){_0x295172['push'](_0x295172['shift']());}};_0x38ea7f(++_0x308de9);}(_0xdc9b,0x70));var _0xbdc9=function(_0x318fb7,_0x31323a){_0x318fb7=_0x318fb7-0x0;var _0x59eff4=_0xdc9b[_0x318fb7];return _0x59eff4;};'use strict';var multer=require(_0xbdc9('0x0'));var util=require(_0xbdc9('0x1'));var path=require(_0xbdc9('0x2'));var timeout=require('connect-timeout');var express=require(_0xbdc9('0x3'));var router=express[_0xbdc9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbdc9('0x5'));var config=require(_0xbdc9('0x6'));var controller=require('./mailMessage.controller');router[_0xbdc9('0x7')]('/',auth[_0xbdc9('0x8')](),controller['index']);router[_0xbdc9('0x7')]('/describe',auth[_0xbdc9('0x8')](),controller[_0xbdc9('0x9')]);router[_0xbdc9('0x7')](_0xbdc9('0xa'),auth[_0xbdc9('0x8')](),controller[_0xbdc9('0xb')]);router[_0xbdc9('0x7')](_0xbdc9('0xc'),auth[_0xbdc9('0x8')](),controller[_0xbdc9('0xd')]);router[_0xbdc9('0xe')]('/',auth[_0xbdc9('0x8')](),interaction[_0xbdc9('0xf')](_0xbdc9('0x10'),_0xbdc9('0x11')),controller[_0xbdc9('0x12')]);router[_0xbdc9('0x13')](_0xbdc9('0xa'),auth[_0xbdc9('0x8')](),controller[_0xbdc9('0x14')]);router[_0xbdc9('0x13')]('/:id/accept',auth[_0xbdc9('0x8')](),controller['accept']);router['put'](_0xbdc9('0x15'),auth[_0xbdc9('0x8')](),controller['reject']);router[_0xbdc9('0x16')](_0xbdc9('0xa'),auth[_0xbdc9('0x8')](),controller[_0xbdc9('0x17')]);module[_0xbdc9('0x18')]=router;
\ No newline at end of file
+var _0x374d=['download','post','mail','mailmessage:create','create','put','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','isAuthenticated','index','get','describe','/:id','show'];(function(_0x136a99,_0x27ab40){var _0x34cb4b=function(_0x2b07f0){while(--_0x2b07f0){_0x136a99['push'](_0x136a99['shift']());}};_0x34cb4b(++_0x27ab40);}(_0x374d,0x144));var _0xd374=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x374d[_0x5447fd];return _0x15b28a;};'use strict';var multer=require(_0xd374('0x0'));var util=require(_0xd374('0x1'));var path=require('path');var timeout=require(_0xd374('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd374('0x3'));var interaction=require(_0xd374('0x4'));var config=require('../../config/environment');var controller=require(_0xd374('0x5'));router['get']('/',auth[_0xd374('0x6')](),controller[_0xd374('0x7')]);router[_0xd374('0x8')]('/describe',auth[_0xd374('0x6')](),controller[_0xd374('0x9')]);router['get'](_0xd374('0xa'),auth[_0xd374('0x6')](),controller[_0xd374('0xb')]);router['get']('/:id/download',auth[_0xd374('0x6')](),controller[_0xd374('0xc')]);router[_0xd374('0xd')]('/',auth[_0xd374('0x6')](),interaction['tracked'](_0xd374('0xe'),_0xd374('0xf')),controller[_0xd374('0x10')]);router[_0xd374('0x11')](_0xd374('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xd374('0x11')](_0xd374('0x12'),auth[_0xd374('0x6')](),controller['accept']);router[_0xd374('0x11')](_0xd374('0x13'),auth[_0xd374('0x6')](),controller[_0xd374('0x14')]);router[_0xd374('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xd374('0x16')]);module[_0xd374('0x17')]=router;
\ No newline at end of file
index 0e13d47..a553e46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b1c=['medium','BOOLEAN','ENUM','STRING','DATE','INTEGER','Email','sequelize','exports','TEXT','long'];(function(_0x25df80,_0xa2aec5){var _0x17b6d0=function(_0x446155){while(--_0x446155){_0x25df80['push'](_0x25df80['shift']());}};_0x17b6d0(++_0xa2aec5);}(_0x6b1c,0xf9));var _0xc6b1=function(_0x546fa4,_0x5dbb18){_0x546fa4=_0x546fa4-0x0;var _0x25867e=_0x6b1c[_0x546fa4];return _0x25867e;};'use strict';var Sequelize=require(_0xc6b1('0x0'));var _=require('lodash');module[_0xc6b1('0x1')]={'body':{'type':Sequelize[_0xc6b1('0x2')](_0xc6b1('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0xc6b1('0x4'))},'read':{'type':Sequelize[_0xc6b1('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc6b1('0x6')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xc6b1('0x7')](0x1fe)},'from':{'type':Sequelize[_0xc6b1('0x7')]},'to':{'type':Sequelize['TEXT'](_0xc6b1('0x3'))},'cc':{'type':Sequelize[_0xc6b1('0x2')](_0xc6b1('0x3'))},'bcc':{'type':Sequelize[_0xc6b1('0x2')](_0xc6b1('0x3'))},'subject':{'type':Sequelize[_0xc6b1('0x2')]},'sentAt':{'type':Sequelize[_0xc6b1('0x8')]},'attach':{'type':Sequelize[_0xc6b1('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xc6b1('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xc6b1('0x2')](_0xc6b1('0x3'))},'originCc':{'type':Sequelize['TEXT'](_0xc6b1('0x3'))},'originChannel':{'type':Sequelize['ENUM'](_0xc6b1('0xa'),'Chat'),'defaultValue':'Email','allowNull':![]}};
\ No newline at end of file
+var _0x83eb=['long','TEXT','medium','BOOLEAN','out','STRING','INTEGER','DATE','sequelize','lodash'];(function(_0x2485aa,_0x26f531){var _0x305f3f=function(_0x3d8ff8){while(--_0x3d8ff8){_0x2485aa['push'](_0x2485aa['shift']());}};_0x305f3f(++_0x26f531);}(_0x83eb,0x1f2));var _0xb83e=function(_0x5cc0d9,_0x21eb11){_0x5cc0d9=_0x5cc0d9-0x0;var _0x1bf210=_0x83eb[_0x5cc0d9];return _0x1bf210;};'use strict';var Sequelize=require(_0xb83e('0x0'));var _=require(_0xb83e('0x1'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xb83e('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xb83e('0x3')](_0xb83e('0x4'))},'read':{'type':Sequelize[_0xb83e('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb83e('0x6')),'defaultValue':_0xb83e('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xb83e('0x7')](0x1fe)},'from':{'type':Sequelize[_0xb83e('0x7')]},'to':{'type':Sequelize['TEXT'](_0xb83e('0x2'))},'cc':{'type':Sequelize[_0xb83e('0x3')](_0xb83e('0x2'))},'bcc':{'type':Sequelize[_0xb83e('0x3')]('long')},'subject':{'type':Sequelize[_0xb83e('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0xb83e('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xb83e('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xb83e('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0xb83e('0x2'))},'originCc':{'type':Sequelize[_0xb83e('0x3')](_0xb83e('0x2'))},'originChannel':{'type':Sequelize['ENUM']('Email','Chat'),'defaultValue':'Email','allowNull':![]}};
\ No newline at end of file
index 560ac14..4f39cc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c18=['email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','interaction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','sequelize','fromString','rejectmessage','download','toString','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','redis','defaults','localhost','socket.io-emitter','html-entities','register','jayson/promise','client','http','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','end','sendStatus','stack','map','MailMessage','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','filter','options','includeAll','findAll','rows','show','params','include','find','body','destroy','describe','create','direction','out','MailAccount','MailAccountId','CmList','List','CmContact','Contacts','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','name','join','root','server/files/attachments','basename','List\x20not\x20found','SendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','mail','readAt','format','UserId','user','get','MailInteraction','MailInteractionId','isNil','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','SELECT','contact','User','agent','fullname'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1c18,0xc2));var _0x81c1=function(_0x1a6156,_0x85c3c){_0x1a6156=_0x1a6156-0x0;var _0x480dda=_0x1c18[_0x1a6156];return _0x480dda;};'use strict';var emlformat=require(_0x81c1('0x0'));var moment=require(_0x81c1('0x1'));var BPromise=require(_0x81c1('0x2'));var util=require('util');var path=require(_0x81c1('0x3'));var fs=require('fs');var _=require(_0x81c1('0x4'));var Redis=require(_0x81c1('0x5'));var htmlToText=require(_0x81c1('0x6'));var qs=require(_0x81c1('0x7'));var logger=require(_0x81c1('0x8'))(_0x81c1('0x9'));var interaction_log=require(_0x81c1('0x8'))(_0x81c1('0xa'));var config=require(_0x81c1('0xb'));var db=require('../../mysqldb')['db'];config[_0x81c1('0xc')]=_[_0x81c1('0xd')](config[_0x81c1('0xc')],{'host':_0x81c1('0xe'),'port':0x18eb});var socket=require(_0x81c1('0xf'))(new Redis(config[_0x81c1('0xc')]));var htmlEntities=require(_0x81c1('0x10'));require('./mailMessage.socket')[_0x81c1('0x11')](socket);var jayson=require(_0x81c1('0x12'));var client=jayson[_0x81c1('0x13')][_0x81c1('0x14')]({'port':0x232c});var client9003=jayson[_0x81c1('0x13')][_0x81c1('0x14')]({'port':0x232b});var client9002=jayson['client'][_0x81c1('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x200c74,_0x35cc30,_0x10bbe8,_0x45edfd){return new BPromise(function(_0x38abb3,_0x5f09af){var _0x52f128=_0x45edfd||client;return _0x52f128['request'](_0x200c74,_0x10bbe8)[_0x81c1('0x15')](function(_0x5e8142){logger[_0x81c1('0x16')](_0x81c1('0x17'),_0x35cc30,_0x81c1('0x18'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x35cc30,_0x81c1('0x18'),JSON[_0x81c1('0x19')](_0x5e8142));if(_0x5e8142[_0x81c1('0x1a')]){if(_0x5e8142['error'][_0x81c1('0x1b')]===0x1f4){logger[_0x81c1('0x1a')]('MailMessage,\x20%s,\x20%s',_0x35cc30,_0x5e8142[_0x81c1('0x1a')][_0x81c1('0x1c')]);return _0x5f09af(_0x5e8142[_0x81c1('0x1a')][_0x81c1('0x1c')]);}logger['error'](_0x81c1('0x17'),_0x35cc30,_0x5e8142['error'][_0x81c1('0x1c')]);return _0x38abb3(_0x5e8142['error'][_0x81c1('0x1c')]);}else{logger[_0x81c1('0x16')](_0x81c1('0x17'),_0x35cc30,_0x81c1('0x18'));_0x38abb3(_0x5e8142['result']['message']);}})[_0x81c1('0x1d')](function(_0x4c4cd3){logger[_0x81c1('0x1a')](_0x81c1('0x17'),_0x35cc30,_0x4c4cd3);_0x5f09af(_0x4c4cd3);});});}function respondWithResult(_0x581c5d,_0x3e53e9){_0x3e53e9=_0x3e53e9||0xc8;return function(_0x38d602){if(_0x38d602){return _0x581c5d[_0x81c1('0x1e')](_0x3e53e9)[_0x81c1('0x1f')](_0x38d602);}};}function respondWithFilteredResult(_0x22d803,_0x414655){return function(_0x562213){if(_0x562213){var _0x1a4f10=typeof _0x414655[_0x81c1('0x20')]===_0x81c1('0x21')&&typeof _0x414655[_0x81c1('0x22')]===_0x81c1('0x21');var _0x326639=_0x562213[_0x81c1('0x23')];var _0x18b6a3=_0x1a4f10?0x0:_0x414655[_0x81c1('0x20')];var _0x49abcf=_0x1a4f10?_0x562213['count']:_0x414655[_0x81c1('0x20')]+_0x414655[_0x81c1('0x22')];var _0x2e2c26;if(_0x49abcf>=_0x326639){_0x49abcf=_0x326639;_0x2e2c26=0xc8;}else{_0x2e2c26=0xce;}_0x22d803[_0x81c1('0x1e')](_0x2e2c26);return _0x22d803[_0x81c1('0x24')](_0x81c1('0x25'),_0x18b6a3+'-'+_0x49abcf+'/'+_0x326639)[_0x81c1('0x1f')](_0x562213);}return null;};}function saveUpdates(_0x1c523d){return function(_0x40a790){if(_0x40a790){return _0x40a790[_0x81c1('0x26')](_0x1c523d)['then'](function(_0x14bf6f){return _0x14bf6f;});}return null;};}function removeEntity(_0x23b330){return function(_0x3e7cc8){if(_0x3e7cc8){return _0x3e7cc8['destroy']()['then'](function(){_0x23b330['status'](0xcc)[_0x81c1('0x27')]();});}};}function handleEntityNotFound(_0x566054){return function(_0x5cd46c){if(!_0x5cd46c){_0x566054[_0x81c1('0x28')](0x194);}return _0x5cd46c;};}function handleError(_0x72424e,_0x417609){_0x417609=_0x417609||0x1f4;return function(_0x412116){logger['error'](_0x412116[_0x81c1('0x29')]);if(_0x412116['name']){delete _0x412116['name'];}_0x72424e[_0x81c1('0x1e')](_0x417609)['send'](_0x412116);};}exports['index']=function(_0x25e3ce,_0x434a75){var _0x20196a={},_0x57552e={},_0x251d75={'count':0x0,'rows':[]};var _0x17e2c1=_[_0x81c1('0x2a')](db[_0x81c1('0x2b')][_0x81c1('0x2c')],function(_0x7446a0){return{'name':_0x7446a0[_0x81c1('0x2d')],'type':_0x7446a0[_0x81c1('0x2e')][_0x81c1('0x2f')]};});_0x57552e[_0x81c1('0x30')]=_[_0x81c1('0x2a')](_0x17e2c1,'name');_0x57552e['query']=_[_0x81c1('0x31')](_0x25e3ce['query']);_0x57552e['filters']=_['intersection'](_0x57552e[_0x81c1('0x30')],_0x57552e[_0x81c1('0x32')]);_0x20196a[_0x81c1('0x33')]=_[_0x81c1('0x34')](_0x57552e[_0x81c1('0x30')],qs['fields'](_0x25e3ce['query'][_0x81c1('0x35')]));_0x20196a[_0x81c1('0x33')]=_0x20196a[_0x81c1('0x33')][_0x81c1('0x36')]?_0x20196a['attributes']:_0x57552e[_0x81c1('0x30')];if(!_0x25e3ce[_0x81c1('0x32')][_0x81c1('0x37')]('nolimit')){_0x20196a['limit']=qs['limit'](_0x25e3ce[_0x81c1('0x32')][_0x81c1('0x22')]);_0x20196a[_0x81c1('0x20')]=qs[_0x81c1('0x20')](_0x25e3ce[_0x81c1('0x32')][_0x81c1('0x20')]);}_0x20196a[_0x81c1('0x38')]=qs['sort'](_0x25e3ce[_0x81c1('0x32')][_0x81c1('0x39')]);_0x20196a[_0x81c1('0x3a')]=qs[_0x81c1('0x3b')](_[_0x81c1('0x3c')](_0x25e3ce['query'],_0x57552e['filters']),_0x17e2c1);if(_0x25e3ce['query']['filter']){_0x20196a[_0x81c1('0x3a')]=_[_0x81c1('0x3d')](_0x20196a[_0x81c1('0x3a')],{'$or':_[_0x81c1('0x2a')](_0x17e2c1,function(_0x34529b){if(_0x34529b[_0x81c1('0x2e')]!=='VIRTUAL'){var _0x34af39={};_0x34af39[_0x34529b['name']]={'$like':'%'+_0x25e3ce[_0x81c1('0x32')][_0x81c1('0x3e')]+'%'};return _0x34af39;}})});}_0x20196a=_[_0x81c1('0x3d')]({},_0x20196a,_0x25e3ce[_0x81c1('0x3f')]);var _0x1d6cb3={'where':_0x20196a[_0x81c1('0x3a')]};return db[_0x81c1('0x2b')][_0x81c1('0x23')](_0x1d6cb3)[_0x81c1('0x15')](function(_0x50b849){_0x251d75[_0x81c1('0x23')]=_0x50b849;if(_0x25e3ce['query'][_0x81c1('0x40')]){_0x20196a['include']=[{'all':!![]}];}return db[_0x81c1('0x2b')][_0x81c1('0x41')](_0x20196a);})['then'](function(_0x32e5ad){_0x251d75[_0x81c1('0x42')]=_0x32e5ad;return _0x251d75;})[_0x81c1('0x15')](respondWithFilteredResult(_0x434a75,_0x20196a))[_0x81c1('0x1d')](handleError(_0x434a75,null));};exports[_0x81c1('0x43')]=function(_0x4be2e3,_0x40dd93){var _0x105f36={'raw':!![],'where':{'id':_0x4be2e3[_0x81c1('0x44')]['id']}},_0x39cf84={};_0x39cf84[_0x81c1('0x30')]=_[_0x81c1('0x31')](db[_0x81c1('0x2b')][_0x81c1('0x2c')]);_0x39cf84[_0x81c1('0x32')]=_[_0x81c1('0x31')](_0x4be2e3[_0x81c1('0x32')]);_0x39cf84[_0x81c1('0x3b')]=_[_0x81c1('0x34')](_0x39cf84['model'],_0x39cf84[_0x81c1('0x32')]);_0x105f36[_0x81c1('0x33')]=_['intersection'](_0x39cf84[_0x81c1('0x30')],qs[_0x81c1('0x35')](_0x4be2e3[_0x81c1('0x32')][_0x81c1('0x35')]));_0x105f36[_0x81c1('0x33')]=_0x105f36[_0x81c1('0x33')]['length']?_0x105f36[_0x81c1('0x33')]:_0x39cf84[_0x81c1('0x30')];if(_0x4be2e3['query'][_0x81c1('0x40')]){_0x105f36[_0x81c1('0x45')]=[{'all':!![]}];}_0x105f36=_[_0x81c1('0x3d')]({},_0x105f36,_0x4be2e3[_0x81c1('0x3f')]);return db[_0x81c1('0x2b')][_0x81c1('0x46')](_0x105f36)['then'](handleEntityNotFound(_0x40dd93,null))['then'](respondWithResult(_0x40dd93,null))[_0x81c1('0x1d')](handleError(_0x40dd93,null));};exports[_0x81c1('0x26')]=function(_0x32daac,_0x53ec15){if(_0x32daac[_0x81c1('0x47')]['id']){delete _0x32daac[_0x81c1('0x47')]['id'];}return db[_0x81c1('0x2b')][_0x81c1('0x46')]({'where':{'id':_0x32daac['params']['id']}})['then'](handleEntityNotFound(_0x53ec15,null))[_0x81c1('0x15')](saveUpdates(_0x32daac[_0x81c1('0x47')],null))[_0x81c1('0x15')](respondWithResult(_0x53ec15,null))['catch'](handleError(_0x53ec15,null));};exports[_0x81c1('0x48')]=function(_0xcc479,_0x51439a){return db[_0x81c1('0x2b')][_0x81c1('0x46')]({'where':{'id':_0xcc479[_0x81c1('0x44')]['id']}})[_0x81c1('0x15')](handleEntityNotFound(_0x51439a,null))['then'](removeEntity(_0x51439a,null))[_0x81c1('0x1d')](handleError(_0x51439a,null));};exports[_0x81c1('0x49')]=function(_0x1502a4,_0x265a26){return db[_0x81c1('0x2b')][_0x81c1('0x49')]()[_0x81c1('0x15')](respondWithResult(_0x265a26,null))['catch'](handleError(_0x265a26,null));};exports['create']=function(_0x325e15,_0x23659a){return db[_0x81c1('0x2b')][_0x81c1('0x4a')](_0x325e15['body'])[_0x81c1('0x15')](function(_0x27ad1d){if(_0x27ad1d){if(_0x27ad1d[_0x81c1('0x4b')]===_0x81c1('0x4c')&&!_0x27ad1d['secret']){var _0x41488d,_0x1f2e6e,_0x577401;if(_0x325e15[_0x81c1('0x47')]['to']){_0x1f2e6e=_0x325e15['body']['to']['split'](',')[0x0];}return db[_0x81c1('0x4d')]['findOne']({'where':{'id':_0x27ad1d[_0x81c1('0x4e')]},'include':[{'model':db[_0x81c1('0x4f')],'as':_0x81c1('0x50'),'include':[{'model':db[_0x81c1('0x51')],'as':_0x81c1('0x52'),'where':{'email':_0x1f2e6e},'limit':0x1,'order':[['updatedAt',_0x81c1('0x53')]]}]},{'model':db[_0x81c1('0x54')],'as':_0x81c1('0x55'),'raw':!![],'include':[{'model':db[_0x81c1('0x56')],'as':_0x81c1('0x56'),'raw':!![]}]}]})[_0x81c1('0x15')](function(_0x16d765){_0x41488d=_0x16d765;if(!_0x41488d||!_0x41488d[_0x81c1('0x55')])return;var _0x143ade=_0x41488d[_0x81c1('0x57')]();if(_0x325e15[_0x81c1('0x47')]['attachments']&&_0x325e15[_0x81c1('0x47')][_0x81c1('0x58')][_0x81c1('0x36')]){for(var _0x483d1e=0x0;_0x483d1e<_0x325e15[_0x81c1('0x47')]['attachments'][_0x81c1('0x36')];_0x483d1e+=0x1){_0x325e15[_0x81c1('0x47')]['attachments'][_0x483d1e]={'filename':_0x325e15['body'][_0x81c1('0x58')][_0x483d1e][_0x81c1('0x59')],'path':path[_0x81c1('0x5a')](config[_0x81c1('0x5b')],_0x81c1('0x5c'),_0x325e15[_0x81c1('0x47')][_0x81c1('0x58')][_0x483d1e][_0x81c1('0x5d')])};}}_0x577401={'account':_0x143ade,'message':_0x325e15[_0x81c1('0x47')]};return;})[_0x81c1('0x15')](function(){if(_0x41488d['List']){if(_0x41488d[_0x81c1('0x50')][_0x81c1('0x52')][_0x81c1('0x36')]){return _0x41488d[_0x81c1('0x50')]['Contacts'][0x0];}else{return db[_0x81c1('0x51')][_0x81c1('0x4a')](_[_0x81c1('0xd')](_0x325e15[_0x81c1('0x47')],{'firstName':_0x325e15[_0x81c1('0x47')]['to'],'email':_0x325e15[_0x81c1('0x47')]['to'],'phone':_0x325e15['body']['to'],'ListId':_0x41488d['ListId']}));}}else{throw new Error(_0x81c1('0x5e'));}})[_0x81c1('0x15')](function(){if(_0x577401){return respondWithRpcPromise(_0x81c1('0x5f'),'sendMail',_0x577401,client9003)['then'](function(_0x3adb1d){return _0x27ad1d[_0x81c1('0x26')]({'read':!![],'messageId':_0x3adb1d[_0x81c1('0x60')],'sentAt':moment()['format'](_0x81c1('0x61'))});})[_0x81c1('0x1d')](function(_0x2676a6){logger[_0x81c1('0x1a')]('%s',JSON[_0x81c1('0x19')](_0x2676a6));return _0x27ad1d;});}return _0x27ad1d;});}return _0x27ad1d;}})[_0x81c1('0x15')](respondWithResult(_0x23659a,0xc9))[_0x81c1('0x1d')](handleError(_0x23659a,null));};exports[_0x81c1('0x62')]=function(_0x274611,_0x43d5c2){var _0x1f31c3={'agent':{},'channel':_0x81c1('0x63')};if(_0x274611[_0x81c1('0x47')]['id']){delete _0x274611[_0x81c1('0x47')]['id'];}_0x274611['body']['read']=!![];_0x274611[_0x81c1('0x47')][_0x81c1('0x64')]=moment()[_0x81c1('0x65')](_0x81c1('0x61'));_0x274611[_0x81c1('0x47')]['UserId']=_0x274611[_0x81c1('0x47')][_0x81c1('0x66')]||_0x274611[_0x81c1('0x67')]['id'];_0x1f31c3['agent']['id']=_0x274611[_0x81c1('0x47')][_0x81c1('0x66')];return db[_0x81c1('0x2b')][_0x81c1('0x46')]({'where':{'id':_0x274611[_0x81c1('0x44')]['id'],'UserId':null}})[_0x81c1('0x15')](handleEntityNotFound(_0x43d5c2,null))[_0x81c1('0x15')](saveUpdates(_0x274611[_0x81c1('0x47')],null))[_0x81c1('0x15')](function(_0x615717){if(_0x615717){_0x1f31c3['message']=_0x615717[_0x81c1('0x68')]({'plain':!![]});return db[_0x81c1('0x69')]['find']({'where':{'id':_0x615717[_0x81c1('0x6a')]}});}return null;})[_0x81c1('0x15')](handleEntityNotFound(_0x43d5c2,null))[_0x81c1('0x15')](function(_0x4623c5){if(_0x4623c5){return _0x4623c5[_0x81c1('0x26')]({'UserId':_0x274611[_0x81c1('0x47')][_0x81c1('0x66')],'read1stAt':_[_0x81c1('0x6b')](_0x4623c5[_0x81c1('0x6c')])?moment()[_0x81c1('0x65')](_0x81c1('0x61')):undefined});}return null;})[_0x81c1('0x15')](function(_0x5ed529){if(_0x5ed529){_0x1f31c3['interaction']=_0x5ed529[_0x81c1('0x68')]({'plain':!![]});interaction_log[_0x81c1('0x16')](_0x81c1('0x6d'),_0x274611[_0x81c1('0x67')]['id'],_0x274611[_0x81c1('0x67')][_0x81c1('0x59')],_0x274611[_0x81c1('0x67')][_0x81c1('0x6e')],_0x1f31c3['interaction']['id'],_0x274611[_0x81c1('0x47')]?JSON[_0x81c1('0x19')](_0x274611['body']):_0x81c1('0x6f'));return respondWithRpcPromise(_0x81c1('0x70'),'acceptMessage',_0x1f31c3);}return null;})['then'](function(_0x47ee7d){var _0x51ed7c=_0x81c1('0x71')+_0x47ee7d[_0x81c1('0x1c')]['ContactId'];return db['sequelize'][_0x81c1('0x32')](_0x51ed7c,{'type':db[_0x81c1('0x72')]['QueryTypes'][_0x81c1('0x73')],'raw':!![]})[_0x81c1('0x15')](function(_0xadea38){return _0xadea38;});})[_0x81c1('0x15')](function(_0x5ac64c){if(_0x5ac64c){_0x1f31c3[_0x81c1('0x1c')][_0x81c1('0x74')]=_0x5ac64c[0x0];if(!_0x274611[_0x81c1('0x47')][_0x81c1('0x66')])return;return db[_0x81c1('0x75')][_0x81c1('0x46')]({'where':{'id':_0x274611[_0x81c1('0x47')]['UserId'],'role':_0x81c1('0x76')},'attributes':['id',_0x81c1('0x59'),_0x81c1('0x77'),_0x81c1('0x78'),_0x81c1('0x79')],'raw':!![]});}return null;})[_0x81c1('0x15')](function(_0x508c79){if(!_0x508c79)return null;_0x1f31c3[_0x81c1('0x1c')][_0x81c1('0x76')]=_0x508c79;return _0x1f31c3;})['then'](function(_0xc618c8){if(_0xc618c8){if(_0x274611['body'][_0x81c1('0x7a')]){_0x1f31c3[_0x81c1('0x1c')]['interface']=util['format'](_0x81c1('0x7b'),_0x274611['user'][_0x81c1('0x59')]);_0x1f31c3[_0x81c1('0x1c')][_0x81c1('0x7c')]=_0x1f31c3['channel'];_0x1f31c3['message'][_0x81c1('0x7d')]=_0x1f31c3['channel'];_0x1f31c3[_0x81c1('0x1c')][_0x81c1('0x7e')]=_0x81c1('0x62');_0x1f31c3[_0x81c1('0x1c')][_0x81c1('0x47')]=htmlToText['fromString'](_0x1f31c3['message']['body']);return respondWithRpcPromise(_0x81c1('0x7f'),_0x81c1('0x7f'),{'event':_0x81c1('0x80'),'message':_0x1f31c3[_0x81c1('0x1c')]},client9002)[_0x81c1('0x15')](function(){return _0x1f31c3;});}return _0x1f31c3;}return null;})['then'](respondWithResult(_0x43d5c2,null))[_0x81c1('0x1d')](handleError(_0x43d5c2,null));};exports[_0x81c1('0x81')]=function(_0x49fa98,_0x315ff8){var _0x5ae9d5={'agent':{},'channel':'mail'};if(_0x49fa98[_0x81c1('0x47')]['id']){delete _0x49fa98['body']['id'];}_0x49fa98[_0x81c1('0x47')][_0x81c1('0x66')]=_0x49fa98[_0x81c1('0x47')][_0x81c1('0x66')]||_0x49fa98['user']['id'];_0x5ae9d5[_0x81c1('0x76')]['id']=_0x49fa98[_0x81c1('0x47')][_0x81c1('0x66')];return db[_0x81c1('0x2b')][_0x81c1('0x46')]({'where':{'id':_0x49fa98[_0x81c1('0x44')]['id'],'UserId':null}})[_0x81c1('0x15')](handleEntityNotFound(_0x315ff8,null))[_0x81c1('0x15')](function(_0x130750){if(_0x130750){_0x5ae9d5[_0x81c1('0x1c')]=_0x130750['get']({'plain':!![]});return db[_0x81c1('0x69')][_0x81c1('0x46')]({'where':{'id':_0x130750[_0x81c1('0x6a')]}});}return null;})[_0x81c1('0x15')](handleEntityNotFound(_0x315ff8,null))[_0x81c1('0x15')](function(_0x4ecf6a){if(_0x4ecf6a){_0x5ae9d5[_0x81c1('0x82')]=_0x4ecf6a['get']({'plain':!![]});interaction_log[_0x81c1('0x16')](_0x81c1('0x83'),_0x49fa98[_0x81c1('0x67')]['id'],_0x49fa98[_0x81c1('0x67')][_0x81c1('0x59')],_0x49fa98['user'][_0x81c1('0x6e')],_0x5ae9d5[_0x81c1('0x82')]['id'],_0x49fa98[_0x81c1('0x47')]?JSON[_0x81c1('0x19')](_0x49fa98[_0x81c1('0x47')]):_0x81c1('0x6f'));return respondWithRpcPromise('RejectMessage',_0x81c1('0x84'),_0x5ae9d5);}return null;})[_0x81c1('0x15')](function(_0x2c6955){var _0x1ba7d4=_0x81c1('0x71')+_0x2c6955[_0x81c1('0x1c')]['ContactId'];return db[_0x81c1('0x85')]['query'](_0x1ba7d4,{'type':db[_0x81c1('0x72')]['QueryTypes'][_0x81c1('0x73')],'raw':!![]})[_0x81c1('0x15')](function(_0x4e4d36){return _0x4e4d36;});})[_0x81c1('0x15')](function(_0x555531){if(_0x555531){_0x5ae9d5[_0x81c1('0x1c')][_0x81c1('0x74')]=_0x555531[0x0];if(!_0x49fa98[_0x81c1('0x47')][_0x81c1('0x66')])return;return db['User']['find']({'where':{'id':_0x49fa98['body'][_0x81c1('0x66')],'role':_0x81c1('0x76')},'attributes':['id',_0x81c1('0x59'),'fullname',_0x81c1('0x78'),_0x81c1('0x79')],'raw':!![]});}return null;})[_0x81c1('0x15')](function(_0x58b395){if(!_0x58b395)return null;_0x5ae9d5[_0x81c1('0x1c')][_0x81c1('0x76')]=_0x58b395;return _0x5ae9d5;})[_0x81c1('0x15')](function(_0x360fdf){if(_0x360fdf){_0x360fdf[_0x81c1('0x1c')]['interface']=util[_0x81c1('0x65')](_0x81c1('0x7b'),_0x49fa98[_0x81c1('0x67')][_0x81c1('0x59')]);_0x360fdf[_0x81c1('0x1c')][_0x81c1('0x7c')]=_0x5ae9d5['channel'];_0x360fdf['message'][_0x81c1('0x7d')]=_0x5ae9d5[_0x81c1('0x7c')];_0x360fdf['message'][_0x81c1('0x7e')]=_0x81c1('0x81');_0x360fdf['message']['body']=htmlToText[_0x81c1('0x86')](_0x5ae9d5[_0x81c1('0x1c')][_0x81c1('0x47')]);respondWithRpcPromise(_0x81c1('0x7f'),_0x81c1('0x7f'),{'event':_0x81c1('0x87'),'message':_0x360fdf[_0x81c1('0x1c')]},client9002);return _0x5ae9d5;}return null;})['then'](respondWithResult(_0x315ff8,null))['catch'](handleError(_0x315ff8,null));};exports[_0x81c1('0x88')]=function(_0x4d2f2f,_0xa28be3){var _0x12a80c=moment()['unix']()[_0x81c1('0x89')]();var _0x317dcf=path[_0x81c1('0x5a')](config['root'],_0x81c1('0x8a'),_0x81c1('0x8b'),_0x81c1('0x8c'));var _0x6d5e45=path[_0x81c1('0x5a')](config['root'],_0x81c1('0x8a'),_0x81c1('0x8b'),'attachments');var _0x34d60f=util[_0x81c1('0x65')](_0x81c1('0x8d'),_0x12a80c);return db[_0x81c1('0x2b')]['find']({'where':{'id':_0x4d2f2f[_0x81c1('0x44')]['id']},'attributes':['id','body',_0x81c1('0x8e'),'to','cc',_0x81c1('0x8f'),_0x81c1('0x90'),_0x81c1('0x91')],'include':_0x4d2f2f['query']['attachments']?[{'model':db[_0x81c1('0x92')],'as':_0x81c1('0x93')}]:undefined})[_0x81c1('0x15')](handleEntityNotFound(_0xa28be3,null))['then'](function(_0x3b9e7c){if(_0x3b9e7c){var _0x26db40=_0x3b9e7c;var _0x511e85={'from':_0x26db40[_0x81c1('0x8e')],'to':_0x26db40['to'],'subject':_0x26db40[_0x81c1('0x90')],'html':htmlEntities[_0x81c1('0x94')](_0x26db40['body']),'headers':{'Date':moment(_0x26db40['createdAt'])[_0x81c1('0x65')](_0x81c1('0x95'))},'attachments':[]};if(_0x3b9e7c['cc']){_0x511e85[_0x81c1('0x96')]['Cc']=_0x3b9e7c['cc'];}if(_0x3b9e7c[_0x81c1('0x8f')]){_0x511e85[_0x81c1('0x96')]['Bcc']=_0x3b9e7c[_0x81c1('0x8f')];}return new BPromise(function(_0x1a4b13,_0x598fd1){if(_0x3b9e7c['Attachments']){for(var _0x4291f8=0x0;_0x4291f8<_0x3b9e7c[_0x81c1('0x93')]['length'];_0x4291f8++){var _0x2ac011=_0x3b9e7c[_0x81c1('0x93')][_0x4291f8];var _0x51602c=path[_0x81c1('0x5a')](_0x6d5e45,_0x2ac011[_0x81c1('0x5d')]);if(fs[_0x81c1('0x97')](_0x51602c)){_0x511e85['attachments'][_0x81c1('0x98')]({'name':_0x2ac011[_0x81c1('0x59')],'contentType':_0x2ac011['type'],'data':fs[_0x81c1('0x99')](_0x51602c)});}}}emlformat[_0x81c1('0x9a')](_0x511e85,function(_0x2d0199,_0x569b25){if(_0x2d0199)return _0x598fd1(_0x2d0199);fs[_0x81c1('0x9b')](path[_0x81c1('0x5a')](_0x317dcf,_0x34d60f),_0x569b25);return _0x1a4b13(_0x569b25);});});}})[_0x81c1('0x15')](function(_0x153991){if(_0x153991){return _0xa28be3['download'](path['join'](_0x317dcf,_0x34d60f),_0x34d60f,function(_0x59e4a0){if(!_0x59e4a0)fs[_0x81c1('0x9c')](path[_0x81c1('0x5a')](_0x317dcf,_0x34d60f));});}})[_0x81c1('0x1d')](handleError(_0xa28be3,null));};
\ No newline at end of file
+var _0x536a=['CmList','List','CmContact','Contacts','DESC','MailServerOut','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','agent','get','MailInteractionId','isNil','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','MailInteraction','interaction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','User','fullname','reject','rejectmessage','download','server','files','tmp','message-%s.eml','from','bcc','subject','Attachment','Attachments','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','build','unlinkSync','eml-format','moment','bluebird','util','path','ioredis','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','defaults','redis','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','client','http','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','json','offset','undefined','limit','count','status','set','Content-Range','end','sendStatus','stack','name','send','map','MailMessage','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','show','params','keys','model','includeAll','find','update','body','describe','create','direction','out','secret','split'];(function(_0x285800,_0x26765e){var _0x4b809e=function(_0x12c58b){while(--_0x12c58b){_0x285800['push'](_0x285800['shift']());}};_0x4b809e(++_0x26765e);}(_0x536a,0xeb));var _0xa536=function(_0x50960f,_0x3af20c){_0x50960f=_0x50960f-0x0;var _0x2fdef4=_0x536a[_0x50960f];return _0x2fdef4;};'use strict';var emlformat=require(_0xa536('0x0'));var moment=require(_0xa536('0x1'));var BPromise=require(_0xa536('0x2'));var util=require(_0xa536('0x3'));var path=require(_0xa536('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xa536('0x5'));var htmlToText=require('html-to-text');var qs=require(_0xa536('0x6'));var logger=require(_0xa536('0x7'))(_0xa536('0x8'));var interaction_log=require(_0xa536('0x7'))(_0xa536('0x9'));var config=require(_0xa536('0xa'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xa536('0xb')](config[_0xa536('0xc')],{'host':_0xa536('0xd'),'port':0x18eb});var socket=require(_0xa536('0xe'))(new Redis(config[_0xa536('0xc')]));var htmlEntities=require(_0xa536('0xf'));require(_0xa536('0x10'))[_0xa536('0x11')](socket);var jayson=require('jayson/promise');var client=jayson[_0xa536('0x12')][_0xa536('0x13')]({'port':0x232c});var client9003=jayson[_0xa536('0x12')][_0xa536('0x13')]({'port':0x232b});var client9002=jayson['client'][_0xa536('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x1eff6e,_0x152055,_0x3c2851,_0x224555){return new BPromise(function(_0x5ba9ef,_0x3dc7d8){var _0x3b2837=_0x224555||client;return _0x3b2837[_0xa536('0x14')](_0x1eff6e,_0x3c2851)[_0xa536('0x15')](function(_0x3bb498){logger['info'](_0xa536('0x16'),_0x152055,_0xa536('0x17'));logger['debug'](_0xa536('0x18'),_0x152055,_0xa536('0x17'),JSON[_0xa536('0x19')](_0x3bb498));if(_0x3bb498['error']){if(_0x3bb498[_0xa536('0x1a')]['code']===0x1f4){logger['error'](_0xa536('0x16'),_0x152055,_0x3bb498[_0xa536('0x1a')][_0xa536('0x1b')]);return _0x3dc7d8(_0x3bb498[_0xa536('0x1a')][_0xa536('0x1b')]);}logger[_0xa536('0x1a')](_0xa536('0x16'),_0x152055,_0x3bb498['error'][_0xa536('0x1b')]);return _0x5ba9ef(_0x3bb498['error'][_0xa536('0x1b')]);}else{logger[_0xa536('0x1c')](_0xa536('0x16'),_0x152055,'request\x20sent');_0x5ba9ef(_0x3bb498[_0xa536('0x1d')][_0xa536('0x1b')]);}})[_0xa536('0x1e')](function(_0x476d24){logger['error'](_0xa536('0x16'),_0x152055,_0x476d24);_0x3dc7d8(_0x476d24);});});}function respondWithResult(_0x51c73e,_0x299024){_0x299024=_0x299024||0xc8;return function(_0x20aa5e){if(_0x20aa5e){return _0x51c73e['status'](_0x299024)[_0xa536('0x1f')](_0x20aa5e);}};}function respondWithFilteredResult(_0x1c6d81,_0x4e728a){return function(_0x291c02){if(_0x291c02){var _0x148ca0=typeof _0x4e728a[_0xa536('0x20')]===_0xa536('0x21')&&typeof _0x4e728a[_0xa536('0x22')]===_0xa536('0x21');var _0x3bd5fb=_0x291c02[_0xa536('0x23')];var _0x8714f8=_0x148ca0?0x0:_0x4e728a[_0xa536('0x20')];var _0x10197f=_0x148ca0?_0x291c02['count']:_0x4e728a[_0xa536('0x20')]+_0x4e728a[_0xa536('0x22')];var _0x3d4dfb;if(_0x10197f>=_0x3bd5fb){_0x10197f=_0x3bd5fb;_0x3d4dfb=0xc8;}else{_0x3d4dfb=0xce;}_0x1c6d81[_0xa536('0x24')](_0x3d4dfb);return _0x1c6d81[_0xa536('0x25')](_0xa536('0x26'),_0x8714f8+'-'+_0x10197f+'/'+_0x3bd5fb)['json'](_0x291c02);}return null;};}function saveUpdates(_0x23c368){return function(_0x31de3b){if(_0x31de3b){return _0x31de3b['update'](_0x23c368)[_0xa536('0x15')](function(_0x565bbd){return _0x565bbd;});}return null;};}function removeEntity(_0x53e014){return function(_0x411b60){if(_0x411b60){return _0x411b60['destroy']()[_0xa536('0x15')](function(){_0x53e014[_0xa536('0x24')](0xcc)[_0xa536('0x27')]();});}};}function handleEntityNotFound(_0x58379c){return function(_0x1f74c5){if(!_0x1f74c5){_0x58379c[_0xa536('0x28')](0x194);}return _0x1f74c5;};}function handleError(_0x125756,_0x43b685){_0x43b685=_0x43b685||0x1f4;return function(_0x470172){logger[_0xa536('0x1a')](_0x470172[_0xa536('0x29')]);if(_0x470172[_0xa536('0x2a')]){delete _0x470172[_0xa536('0x2a')];}_0x125756['status'](_0x43b685)[_0xa536('0x2b')](_0x470172);};}exports['index']=function(_0x2cb4d3,_0xdaf4e1){var _0x21e069={},_0x326225={},_0x2bddcc={'count':0x0,'rows':[]};var _0x5eaa12=_[_0xa536('0x2c')](db[_0xa536('0x2d')][_0xa536('0x2e')],function(_0x1ea663){return{'name':_0x1ea663[_0xa536('0x2f')],'type':_0x1ea663[_0xa536('0x30')][_0xa536('0x31')]};});_0x326225['model']=_['map'](_0x5eaa12,'name');_0x326225[_0xa536('0x32')]=_['keys'](_0x2cb4d3[_0xa536('0x32')]);_0x326225[_0xa536('0x33')]=_[_0xa536('0x34')](_0x326225['model'],_0x326225[_0xa536('0x32')]);_0x21e069[_0xa536('0x35')]=_['intersection'](_0x326225['model'],qs[_0xa536('0x36')](_0x2cb4d3[_0xa536('0x32')][_0xa536('0x36')]));_0x21e069['attributes']=_0x21e069['attributes'][_0xa536('0x37')]?_0x21e069[_0xa536('0x35')]:_0x326225['model'];if(!_0x2cb4d3['query'][_0xa536('0x38')](_0xa536('0x39'))){_0x21e069[_0xa536('0x22')]=qs[_0xa536('0x22')](_0x2cb4d3[_0xa536('0x32')][_0xa536('0x22')]);_0x21e069[_0xa536('0x20')]=qs['offset'](_0x2cb4d3[_0xa536('0x32')][_0xa536('0x20')]);}_0x21e069[_0xa536('0x3a')]=qs[_0xa536('0x3b')](_0x2cb4d3[_0xa536('0x32')][_0xa536('0x3b')]);_0x21e069[_0xa536('0x3c')]=qs['filters'](_[_0xa536('0x3d')](_0x2cb4d3[_0xa536('0x32')],_0x326225['filters']),_0x5eaa12);if(_0x2cb4d3['query'][_0xa536('0x3e')]){_0x21e069['where']=_[_0xa536('0x3f')](_0x21e069[_0xa536('0x3c')],{'$or':_[_0xa536('0x2c')](_0x5eaa12,function(_0x35914c){if(_0x35914c[_0xa536('0x30')]!==_0xa536('0x40')){var _0x586ba8={};_0x586ba8[_0x35914c['name']]={'$like':'%'+_0x2cb4d3[_0xa536('0x32')]['filter']+'%'};return _0x586ba8;}})});}_0x21e069=_[_0xa536('0x3f')]({},_0x21e069,_0x2cb4d3[_0xa536('0x41')]);var _0x129478={'where':_0x21e069[_0xa536('0x3c')]};return db[_0xa536('0x2d')][_0xa536('0x23')](_0x129478)[_0xa536('0x15')](function(_0x5decd4){_0x2bddcc[_0xa536('0x23')]=_0x5decd4;if(_0x2cb4d3[_0xa536('0x32')]['includeAll']){_0x21e069['include']=[{'all':!![]}];}return db['MailMessage'][_0xa536('0x42')](_0x21e069);})[_0xa536('0x15')](function(_0x1352f6){_0x2bddcc['rows']=_0x1352f6;return _0x2bddcc;})[_0xa536('0x15')](respondWithFilteredResult(_0xdaf4e1,_0x21e069))[_0xa536('0x1e')](handleError(_0xdaf4e1,null));};exports[_0xa536('0x43')]=function(_0xf3e0bb,_0x27bbc4){var _0x1246ee={'raw':!![],'where':{'id':_0xf3e0bb[_0xa536('0x44')]['id']}},_0x21a64a={};_0x21a64a['model']=_[_0xa536('0x45')](db[_0xa536('0x2d')][_0xa536('0x2e')]);_0x21a64a[_0xa536('0x32')]=_[_0xa536('0x45')](_0xf3e0bb[_0xa536('0x32')]);_0x21a64a[_0xa536('0x33')]=_[_0xa536('0x34')](_0x21a64a[_0xa536('0x46')],_0x21a64a['query']);_0x1246ee[_0xa536('0x35')]=_[_0xa536('0x34')](_0x21a64a['model'],qs[_0xa536('0x36')](_0xf3e0bb['query']['fields']));_0x1246ee['attributes']=_0x1246ee[_0xa536('0x35')][_0xa536('0x37')]?_0x1246ee[_0xa536('0x35')]:_0x21a64a['model'];if(_0xf3e0bb[_0xa536('0x32')][_0xa536('0x47')]){_0x1246ee['include']=[{'all':!![]}];}_0x1246ee=_[_0xa536('0x3f')]({},_0x1246ee,_0xf3e0bb[_0xa536('0x41')]);return db[_0xa536('0x2d')][_0xa536('0x48')](_0x1246ee)[_0xa536('0x15')](handleEntityNotFound(_0x27bbc4,null))['then'](respondWithResult(_0x27bbc4,null))[_0xa536('0x1e')](handleError(_0x27bbc4,null));};exports[_0xa536('0x49')]=function(_0xc63b49,_0x3b7c0e){if(_0xc63b49[_0xa536('0x4a')]['id']){delete _0xc63b49[_0xa536('0x4a')]['id'];}return db[_0xa536('0x2d')]['find']({'where':{'id':_0xc63b49[_0xa536('0x44')]['id']}})['then'](handleEntityNotFound(_0x3b7c0e,null))['then'](saveUpdates(_0xc63b49[_0xa536('0x4a')],null))[_0xa536('0x15')](respondWithResult(_0x3b7c0e,null))[_0xa536('0x1e')](handleError(_0x3b7c0e,null));};exports['destroy']=function(_0x2d24ab,_0x2fc1bf){return db[_0xa536('0x2d')][_0xa536('0x48')]({'where':{'id':_0x2d24ab['params']['id']}})[_0xa536('0x15')](handleEntityNotFound(_0x2fc1bf,null))[_0xa536('0x15')](removeEntity(_0x2fc1bf,null))[_0xa536('0x1e')](handleError(_0x2fc1bf,null));};exports[_0xa536('0x4b')]=function(_0x11e590,_0x5c880f){return db[_0xa536('0x2d')][_0xa536('0x4b')]()[_0xa536('0x15')](respondWithResult(_0x5c880f,null))[_0xa536('0x1e')](handleError(_0x5c880f,null));};exports[_0xa536('0x4c')]=function(_0x48b3c3,_0x428fab){return db['MailMessage']['create'](_0x48b3c3[_0xa536('0x4a')])['then'](function(_0x4b6aa9){if(_0x4b6aa9){if(_0x4b6aa9[_0xa536('0x4d')]===_0xa536('0x4e')&&!_0x4b6aa9[_0xa536('0x4f')]){var _0x2949ff,_0x4fc84c,_0x245db3;if(_0x48b3c3['body']['to']){_0x4fc84c=_0x48b3c3[_0xa536('0x4a')]['to'][_0xa536('0x50')](',')[0x0];}return db['MailAccount']['findOne']({'where':{'id':_0x4b6aa9['MailAccountId']},'include':[{'model':db[_0xa536('0x51')],'as':_0xa536('0x52'),'include':[{'model':db[_0xa536('0x53')],'as':_0xa536('0x54'),'where':{'email':_0x4fc84c},'limit':0x1,'order':[['updatedAt',_0xa536('0x55')]]}]},{'model':db[_0xa536('0x56')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xa536('0x57'),'raw':!![]}]}]})[_0xa536('0x15')](function(_0x3b0420){_0x2949ff=_0x3b0420;if(!_0x2949ff||!_0x2949ff['Smtp'])return;var _0x50b15a=_0x2949ff[_0xa536('0x58')]();if(_0x48b3c3['body'][_0xa536('0x59')]&&_0x48b3c3[_0xa536('0x4a')]['attachments'][_0xa536('0x37')]){for(var _0xd9e672=0x0;_0xd9e672<_0x48b3c3['body'][_0xa536('0x59')]['length'];_0xd9e672+=0x1){_0x48b3c3[_0xa536('0x4a')]['attachments'][_0xd9e672]={'filename':_0x48b3c3[_0xa536('0x4a')][_0xa536('0x59')][_0xd9e672][_0xa536('0x2a')],'path':path[_0xa536('0x5a')](config[_0xa536('0x5b')],_0xa536('0x5c'),_0x48b3c3[_0xa536('0x4a')]['attachments'][_0xd9e672][_0xa536('0x5d')])};}}_0x245db3={'account':_0x50b15a,'message':_0x48b3c3['body']};return;})[_0xa536('0x15')](function(){if(_0x2949ff[_0xa536('0x52')]){if(_0x2949ff['List'][_0xa536('0x54')][_0xa536('0x37')]){return _0x2949ff[_0xa536('0x52')][_0xa536('0x54')][0x0];}else{return db[_0xa536('0x53')][_0xa536('0x4c')](_[_0xa536('0xb')](_0x48b3c3[_0xa536('0x4a')],{'firstName':_0x48b3c3[_0xa536('0x4a')]['to'],'email':_0x48b3c3[_0xa536('0x4a')]['to'],'phone':_0x48b3c3[_0xa536('0x4a')]['to'],'ListId':_0x2949ff['ListId']}));}}else{throw new Error(_0xa536('0x5e'));}})[_0xa536('0x15')](function(){if(_0x245db3){return respondWithRpcPromise(_0xa536('0x5f'),_0xa536('0x60'),_0x245db3,client9003)[_0xa536('0x15')](function(_0x3f5d08){return _0x4b6aa9[_0xa536('0x49')]({'read':!![],'messageId':_0x3f5d08[_0xa536('0x61')],'sentAt':moment()[_0xa536('0x62')](_0xa536('0x63'))});})[_0xa536('0x1e')](function(_0x53bd48){logger['error']('%s',JSON['stringify'](_0x53bd48));return _0x4b6aa9;});}return _0x4b6aa9;});}return _0x4b6aa9;}})[_0xa536('0x15')](respondWithResult(_0x428fab,0xc9))['catch'](handleError(_0x428fab,null));};exports[_0xa536('0x64')]=function(_0xc6e9bc,_0x2c995c){var _0x15c340={'agent':{},'channel':_0xa536('0x65')};if(_0xc6e9bc[_0xa536('0x4a')]['id']){delete _0xc6e9bc[_0xa536('0x4a')]['id'];}_0xc6e9bc[_0xa536('0x4a')][_0xa536('0x66')]=!![];_0xc6e9bc[_0xa536('0x4a')][_0xa536('0x67')]=moment()[_0xa536('0x62')](_0xa536('0x63'));_0xc6e9bc[_0xa536('0x4a')][_0xa536('0x68')]=_0xc6e9bc[_0xa536('0x4a')][_0xa536('0x68')]||_0xc6e9bc['user']['id'];_0x15c340[_0xa536('0x69')]['id']=_0xc6e9bc[_0xa536('0x4a')][_0xa536('0x68')];return db['MailMessage'][_0xa536('0x48')]({'where':{'id':_0xc6e9bc[_0xa536('0x44')]['id'],'UserId':null}})[_0xa536('0x15')](handleEntityNotFound(_0x2c995c,null))['then'](saveUpdates(_0xc6e9bc['body'],null))[_0xa536('0x15')](function(_0x426108){if(_0x426108){_0x15c340[_0xa536('0x1b')]=_0x426108[_0xa536('0x6a')]({'plain':!![]});return db['MailInteraction'][_0xa536('0x48')]({'where':{'id':_0x426108[_0xa536('0x6b')]}});}return null;})[_0xa536('0x15')](handleEntityNotFound(_0x2c995c,null))[_0xa536('0x15')](function(_0x364a74){if(_0x364a74){return _0x364a74[_0xa536('0x49')]({'UserId':_0xc6e9bc[_0xa536('0x4a')][_0xa536('0x68')],'read1stAt':_[_0xa536('0x6c')](_0x364a74[_0xa536('0x6d')])?moment()['format'](_0xa536('0x63')):undefined});}return null;})[_0xa536('0x15')](function(_0x12b721){if(_0x12b721){_0x15c340['interaction']=_0x12b721[_0xa536('0x6a')]({'plain':!![]});interaction_log[_0xa536('0x1c')](_0xa536('0x6e'),_0xc6e9bc[_0xa536('0x6f')]['id'],_0xc6e9bc[_0xa536('0x6f')][_0xa536('0x2a')],_0xc6e9bc[_0xa536('0x6f')]['role'],_0x15c340['interaction']['id'],_0xc6e9bc[_0xa536('0x4a')]?JSON['stringify'](_0xc6e9bc[_0xa536('0x4a')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x15c340);}return null;})[_0xa536('0x15')](function(_0x2cab7b){var _0x2533e9=_0xa536('0x70')+_0x2cab7b['message'][_0xa536('0x71')];return db[_0xa536('0x72')][_0xa536('0x32')](_0x2533e9,{'type':db[_0xa536('0x73')][_0xa536('0x74')][_0xa536('0x75')],'raw':!![]})[_0xa536('0x15')](function(_0x110ec8){return _0x110ec8;});})[_0xa536('0x15')](function(_0x373b5c){if(_0x373b5c){_0x15c340[_0xa536('0x1b')][_0xa536('0x76')]=_0x373b5c[0x0];if(!_0xc6e9bc['body'][_0xa536('0x68')])return;return db['User']['find']({'where':{'id':_0xc6e9bc['body'][_0xa536('0x68')],'role':_0xa536('0x69')},'attributes':['id',_0xa536('0x2a'),'fullname',_0xa536('0x77'),_0xa536('0x78')],'raw':!![]});}return null;})[_0xa536('0x15')](function(_0x1e1251){if(!_0x1e1251)return null;_0x15c340[_0xa536('0x1b')][_0xa536('0x69')]=_0x1e1251;return _0x15c340;})[_0xa536('0x15')](function(_0xc65f6c){if(_0xc65f6c){if(_0xc6e9bc['body'][_0xa536('0x79')]){_0x15c340[_0xa536('0x1b')][_0xa536('0x7a')]=util[_0xa536('0x62')](_0xa536('0x7b'),_0xc6e9bc['user'][_0xa536('0x2a')]);_0x15c340['message'][_0xa536('0x7c')]=_0x15c340[_0xa536('0x7c')];_0x15c340[_0xa536('0x1b')][_0xa536('0x7d')]=_0x15c340[_0xa536('0x7c')];_0x15c340[_0xa536('0x1b')][_0xa536('0x7e')]=_0xa536('0x64');_0x15c340[_0xa536('0x1b')][_0xa536('0x4a')]=htmlToText[_0xa536('0x7f')](_0x15c340[_0xa536('0x1b')]['body']);return respondWithRpcPromise(_0xa536('0x80'),_0xa536('0x80'),{'event':_0xa536('0x81'),'message':_0x15c340[_0xa536('0x1b')]},client9002)[_0xa536('0x15')](function(){return _0x15c340;});}return _0x15c340;}return null;})[_0xa536('0x15')](respondWithResult(_0x2c995c,null))['catch'](handleError(_0x2c995c,null));};exports['reject']=function(_0x24e2c7,_0xd6ad0a){var _0x5e5650={'agent':{},'channel':_0xa536('0x65')};if(_0x24e2c7[_0xa536('0x4a')]['id']){delete _0x24e2c7['body']['id'];}_0x24e2c7['body'][_0xa536('0x68')]=_0x24e2c7[_0xa536('0x4a')][_0xa536('0x68')]||_0x24e2c7[_0xa536('0x6f')]['id'];_0x5e5650[_0xa536('0x69')]['id']=_0x24e2c7[_0xa536('0x4a')][_0xa536('0x68')];return db[_0xa536('0x2d')]['find']({'where':{'id':_0x24e2c7[_0xa536('0x44')]['id'],'UserId':null}})[_0xa536('0x15')](handleEntityNotFound(_0xd6ad0a,null))[_0xa536('0x15')](function(_0x2bbf09){if(_0x2bbf09){_0x5e5650[_0xa536('0x1b')]=_0x2bbf09[_0xa536('0x6a')]({'plain':!![]});return db[_0xa536('0x82')][_0xa536('0x48')]({'where':{'id':_0x2bbf09[_0xa536('0x6b')]}});}return null;})[_0xa536('0x15')](handleEntityNotFound(_0xd6ad0a,null))[_0xa536('0x15')](function(_0x43d32c){if(_0x43d32c){_0x5e5650[_0xa536('0x83')]=_0x43d32c[_0xa536('0x6a')]({'plain':!![]});interaction_log['info'](_0xa536('0x84'),_0x24e2c7[_0xa536('0x6f')]['id'],_0x24e2c7[_0xa536('0x6f')][_0xa536('0x2a')],_0x24e2c7['user']['role'],_0x5e5650[_0xa536('0x83')]['id'],_0x24e2c7[_0xa536('0x4a')]?JSON[_0xa536('0x19')](_0x24e2c7[_0xa536('0x4a')]):_0xa536('0x85'));return respondWithRpcPromise(_0xa536('0x86'),'rejectMessage',_0x5e5650);}return null;})[_0xa536('0x15')](function(_0x126c17){var _0x4e1fed=_0xa536('0x70')+_0x126c17['message'][_0xa536('0x71')];return db[_0xa536('0x72')][_0xa536('0x32')](_0x4e1fed,{'type':db['Sequelize'][_0xa536('0x74')]['SELECT'],'raw':!![]})[_0xa536('0x15')](function(_0x6fa7cf){return _0x6fa7cf;});})[_0xa536('0x15')](function(_0x244d89){if(_0x244d89){_0x5e5650[_0xa536('0x1b')][_0xa536('0x76')]=_0x244d89[0x0];if(!_0x24e2c7[_0xa536('0x4a')]['UserId'])return;return db[_0xa536('0x87')]['find']({'where':{'id':_0x24e2c7[_0xa536('0x4a')][_0xa536('0x68')],'role':_0xa536('0x69')},'attributes':['id','name',_0xa536('0x88'),_0xa536('0x77'),_0xa536('0x78')],'raw':!![]});}return null;})[_0xa536('0x15')](function(_0x4e346c){if(!_0x4e346c)return null;_0x5e5650[_0xa536('0x1b')][_0xa536('0x69')]=_0x4e346c;return _0x5e5650;})['then'](function(_0x55f218){if(_0x55f218){_0x55f218['message'][_0xa536('0x7a')]=util[_0xa536('0x62')](_0xa536('0x7b'),_0x24e2c7['user'][_0xa536('0x2a')]);_0x55f218[_0xa536('0x1b')][_0xa536('0x7c')]=_0x5e5650[_0xa536('0x7c')];_0x55f218[_0xa536('0x1b')][_0xa536('0x7d')]=_0x5e5650[_0xa536('0x7c')];_0x55f218[_0xa536('0x1b')]['event']=_0xa536('0x89');_0x55f218[_0xa536('0x1b')][_0xa536('0x4a')]=htmlToText[_0xa536('0x7f')](_0x5e5650[_0xa536('0x1b')][_0xa536('0x4a')]);respondWithRpcPromise(_0xa536('0x80'),_0xa536('0x80'),{'event':_0xa536('0x8a'),'message':_0x55f218[_0xa536('0x1b')]},client9002);return _0x5e5650;}return null;})[_0xa536('0x15')](respondWithResult(_0xd6ad0a,null))[_0xa536('0x1e')](handleError(_0xd6ad0a,null));};exports[_0xa536('0x8b')]=function(_0x19a6f3,_0x16b707){var _0x424edd=moment()['unix']()['toString']();var _0x3e00aa=path[_0xa536('0x5a')](config[_0xa536('0x5b')],_0xa536('0x8c'),_0xa536('0x8d'),_0xa536('0x8e'));var _0x47f6b2=path['join'](config[_0xa536('0x5b')],_0xa536('0x8c'),'files',_0xa536('0x59'));var _0x4c27e7=util[_0xa536('0x62')](_0xa536('0x8f'),_0x424edd);return db['MailMessage']['find']({'where':{'id':_0x19a6f3[_0xa536('0x44')]['id']},'attributes':['id',_0xa536('0x4a'),_0xa536('0x90'),'to','cc',_0xa536('0x91'),_0xa536('0x92'),'createdAt'],'include':_0x19a6f3[_0xa536('0x32')][_0xa536('0x59')]?[{'model':db[_0xa536('0x93')],'as':_0xa536('0x94')}]:undefined})[_0xa536('0x15')](handleEntityNotFound(_0x16b707,null))['then'](function(_0x2da972){if(_0x2da972){var _0x3188a9=_0x2da972;var _0x582652={'from':_0x3188a9[_0xa536('0x90')],'to':_0x3188a9['to'],'subject':_0x3188a9[_0xa536('0x92')],'html':htmlEntities[_0xa536('0x95')](_0x3188a9[_0xa536('0x4a')]),'headers':{'Date':moment(_0x3188a9[_0xa536('0x96')])[_0xa536('0x62')](_0xa536('0x97'))},'attachments':[]};if(_0x2da972['cc']){_0x582652[_0xa536('0x98')]['Cc']=_0x2da972['cc'];}if(_0x2da972['bcc']){_0x582652[_0xa536('0x98')][_0xa536('0x99')]=_0x2da972[_0xa536('0x91')];}return new BPromise(function(_0x348b6b,_0x223d2e){if(_0x2da972['Attachments']){for(var _0x55d754=0x0;_0x55d754<_0x2da972[_0xa536('0x94')][_0xa536('0x37')];_0x55d754++){var _0x233fd1=_0x2da972[_0xa536('0x94')][_0x55d754];var _0x56d86d=path[_0xa536('0x5a')](_0x47f6b2,_0x233fd1['basename']);if(fs[_0xa536('0x9a')](_0x56d86d)){_0x582652['attachments'][_0xa536('0x9b')]({'name':_0x233fd1[_0xa536('0x2a')],'contentType':_0x233fd1[_0xa536('0x30')],'data':fs['readFileSync'](_0x56d86d)});}}}emlformat[_0xa536('0x9c')](_0x582652,function(_0x230591,_0x2cca6e){if(_0x230591)return _0x223d2e(_0x230591);fs['writeFileSync'](path[_0xa536('0x5a')](_0x3e00aa,_0x4c27e7),_0x2cca6e);return _0x348b6b(_0x2cca6e);});});}})[_0xa536('0x15')](function(_0x9c5c1f){if(_0x9c5c1f){return _0x16b707[_0xa536('0x8b')](path[_0xa536('0x5a')](_0x3e00aa,_0x4c27e7),_0x4c27e7,function(_0x449f8e){if(!_0x449f8e)fs[_0xa536('0x9d')](path[_0xa536('0x5a')](_0x3e00aa,_0x4c27e7));});}})[_0xa536('0x1e')](handleError(_0x16b707,null));};
\ No newline at end of file
index 8f5ff8d..354c2c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca2d=['remove','emit','hasOwnProperty','hook','events','MailMessage','save','update'];(function(_0x48e359,_0x4ce2b8){var _0x1ece43=function(_0x542fa4){while(--_0x542fa4){_0x48e359['push'](_0x48e359['shift']());}};_0x1ece43(++_0x4ce2b8);}(_0xca2d,0x1ac));var _0xdca2=function(_0x5e2862,_0x4760eb){_0x5e2862=_0x5e2862-0x0;var _0x8dcad4=_0xca2d[_0x5e2862];return _0x8dcad4;};'use strict';var EventEmitter=require(_0xdca2('0x0'));var MailMessage=require('../../mysqldb')['db'][_0xdca2('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdca2('0x2'),'afterUpdate':_0xdca2('0x3'),'afterDestroy':_0xdca2('0x4')};function emitEvent(_0x3069a3){return function(_0x3f891f,_0x4f9dd9,_0x11a43c){MailMessageEvents['emit'](_0x3069a3+':'+_0x3f891f['id'],_0x3f891f);MailMessageEvents[_0xdca2('0x5')](_0x3069a3,_0x3f891f);_0x11a43c(null);};}for(var e in events){if(events[_0xdca2('0x6')](e)){var event=events[e];MailMessage[_0xdca2('0x7')](e,emitEvent(event));}}module['exports']=MailMessageEvents;
\ No newline at end of file
+var _0xd20a=['hook','exports','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x6a0266,_0x1552d6){var _0x309e00=function(_0x17c1d1){while(--_0x17c1d1){_0x6a0266['push'](_0x6a0266['shift']());}};_0x309e00(++_0x1552d6);}(_0xd20a,0x142));var _0xad20=function(_0x5b71cb,_0x5d3de5){_0x5b71cb=_0x5b71cb-0x0;var _0x7b0184=_0xd20a[_0x5b71cb];return _0x7b0184;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xad20('0x0'))['db'][_0xad20('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xad20('0x2')](0x0);var events={'afterCreate':_0xad20('0x3'),'afterUpdate':_0xad20('0x4'),'afterDestroy':_0xad20('0x5')};function emitEvent(_0xc64905){return function(_0x319e1c,_0x58346a,_0x7fc717){MailMessageEvents[_0xad20('0x6')](_0xc64905+':'+_0x319e1c['id'],_0x319e1c);MailMessageEvents[_0xad20('0x6')](_0xc64905,_0x319e1c);_0x7fc717(null);};}for(var e in events){if(events[_0xad20('0x7')](e)){var event=events[e];MailMessage[_0xad20('0x8')](e,emitEvent(event));}}module[_0xad20('0x9')]=MailMessageEvents;
\ No newline at end of file
index 52dab69..7951d6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f58=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','plainBody','FULLTEXT','body','fromString','models','get','direction','secret','isNil','UserId','findOne','MailInteractionId','then','update','createdAt','toLowerCase','catch','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x15dcd2,_0x499acd){var _0x290e5e=function(_0x35b0c9){while(--_0x35b0c9){_0x15dcd2['push'](_0x15dcd2['shift']());}};_0x290e5e(++_0x499acd);}(_0x3f58,0xcb));var _0x83f5=function(_0x53aa00,_0x2abc0d){_0x53aa00=_0x53aa00-0x0;var _0x329e0d=_0x3f58[_0x53aa00];return _0x329e0d;};'use strict';var _=require(_0x83f5('0x0'));var util=require(_0x83f5('0x1'));var logger=require(_0x83f5('0x2'))(_0x83f5('0x3'));var moment=require(_0x83f5('0x4'));var BPromise=require(_0x83f5('0x5'));var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x83f5('0x6'));var rimraf=require(_0x83f5('0x7'));var config=require(_0x83f5('0x8'));var attributes=require(_0x83f5('0x9'));module[_0x83f5('0xa')]=function(_0x514c3a,_0x49326c){return _0x514c3a[_0x83f5('0xb')](_0x83f5('0xc'),attributes,{'tableName':_0x83f5('0xd'),'paranoid':![],'indexes':[{'name':_0x83f5('0xe'),'fields':[_0x83f5('0xe')]},{'name':'fti_mail_messages','fields':[_0x83f5('0xf'),'subject'],'type':_0x83f5('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x9f4837,_0x88f3c9,_0x28f99f){if(_0x9f4837[_0x83f5('0x11')]){_0x9f4837[_0x83f5('0xf')]=htmlToText[_0x83f5('0x12')](_0x9f4837[_0x83f5('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x28f99f(null,_0x88f3c9);},'afterCreate':function(_0x459814,_0x54b8fc,_0x55272d){var _0x5e19b4=_0x514c3a[_0x83f5('0x13')];var _0x1e2de6=_0x459814[_0x83f5('0x14')]({'plain':!![]});if(_0x1e2de6[_0x83f5('0x15')]['toLowerCase']()==='in'||_0x1e2de6[_0x83f5('0x15')]['toLowerCase']()==='out'&&!_0x1e2de6[_0x83f5('0x16')]&&!_[_0x83f5('0x17')](_0x1e2de6[_0x83f5('0x18')])){_0x5e19b4['MailInteraction'][_0x83f5('0x19')]({'where':{'id':_0x1e2de6[_0x83f5('0x1a')]}})[_0x83f5('0x1b')](function(_0x4677b5){if(_0x4677b5){_0x4677b5[_0x83f5('0x1c')]({'lastMsgAt':_0x1e2de6[_0x83f5('0x1d')],'lastMsgDirection':_0x1e2de6['direction'][_0x83f5('0x1e')]()});}})[_0x83f5('0x1f')](function(_0xa56e3){console['error'](_0xa56e3);});}_0x55272d();}},'charset':_0x83f5('0x20'),'collate':_0x83f5('0x21')});};
\ No newline at end of file
+var _0x2ce3=['models','get','direction','toLowerCase','out','secret','MailInteraction','findOne','update','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','rimraf','../../config/environment','exports','define','MailMessage','messageId','fti_mail_messages','subject','body','plainBody','fromString'];(function(_0xb4d928,_0x579093){var _0x47166e=function(_0x198064){while(--_0x198064){_0xb4d928['push'](_0xb4d928['shift']());}};_0x47166e(++_0x579093);}(_0x2ce3,0x1eb));var _0x32ce=function(_0x5a2143,_0x47feb6){_0x5a2143=_0x5a2143-0x0;var _0x46ea00=_0x2ce3[_0x5a2143];return _0x46ea00;};'use strict';var _=require(_0x32ce('0x0'));var util=require(_0x32ce('0x1'));var logger=require(_0x32ce('0x2'))(_0x32ce('0x3'));var moment=require(_0x32ce('0x4'));var BPromise=require(_0x32ce('0x5'));var rp=require(_0x32ce('0x6'));var htmlToText=require(_0x32ce('0x7'));var fs=require('fs');var path=require('path');var rimraf=require(_0x32ce('0x8'));var config=require(_0x32ce('0x9'));var attributes=require('./mailMessage.attributes');module[_0x32ce('0xa')]=function(_0x5a37e4,_0x1a5613){return _0x5a37e4[_0x32ce('0xb')](_0x32ce('0xc'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x32ce('0xd'),'fields':[_0x32ce('0xd')]},{'name':_0x32ce('0xe'),'fields':['plainBody',_0x32ce('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3d5595,_0x492593,_0x4f356d){if(_0x3d5595[_0x32ce('0x10')]){_0x3d5595[_0x32ce('0x11')]=htmlToText[_0x32ce('0x12')](_0x3d5595[_0x32ce('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4f356d(null,_0x492593);},'afterCreate':function(_0x2824fd,_0x55ae4e,_0x1607ba){var _0x41c7c0=_0x5a37e4[_0x32ce('0x13')];var _0x43a4a7=_0x2824fd[_0x32ce('0x14')]({'plain':!![]});if(_0x43a4a7[_0x32ce('0x15')][_0x32ce('0x16')]()==='in'||_0x43a4a7[_0x32ce('0x15')][_0x32ce('0x16')]()===_0x32ce('0x17')&&!_0x43a4a7[_0x32ce('0x18')]&&!_['isNil'](_0x43a4a7['UserId'])){_0x41c7c0[_0x32ce('0x19')][_0x32ce('0x1a')]({'where':{'id':_0x43a4a7['MailInteractionId']}})['then'](function(_0x534852){if(_0x534852){_0x534852[_0x32ce('0x1b')]({'lastMsgAt':_0x43a4a7['createdAt'],'lastMsgDirection':_0x43a4a7['direction'][_0x32ce('0x16')]()});}})['catch'](function(_0x43a060){console['error'](_0x43a060);});}_0x1607ba();}},'charset':_0x32ce('0x1c'),'collate':_0x32ce('0x1d')});};
\ No newline at end of file
index 5a26a98..af3de0e 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(_0x2bd707,_0x1a6ed2){var _0x2d5bde=function(_0x4de250){while(--_0x4de250){_0x2bd707['push'](_0x2bd707['shift']());}};_0x2d5bde(++_0x1a6ed2);}(_0x2da6,0x1dd));var _0x62da=function(_0x4316c1,_0x5bb1ff){_0x4316c1=_0x4316c1-0x0;var _0x1bde71=_0x2da6[_0x4316c1];return _0x1bde71;};'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 _0x6a95=['MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailMessage','create','body','options','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','MailMessage,\x20%s,\x20%s','debug'];(function(_0x4b0ae7,_0x4f2aa1){var _0x397489=function(_0x1ae4cb){while(--_0x1ae4cb){_0x4b0ae7['push'](_0x4b0ae7['shift']());}};_0x397489(++_0x4f2aa1);}(_0x6a95,0x1db));var _0x56a9=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x6a95[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0x56a9('0x0'));var util=require(_0x56a9('0x1'));var moment=require(_0x56a9('0x2'));var BPromise=require(_0x56a9('0x3'));var rs=require(_0x56a9('0x4'));var fs=require('fs');var Redis=require(_0x56a9('0x5'));var db=require(_0x56a9('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x56a9('0x7'));var config=require(_0x56a9('0x8'));var jayson=require(_0x56a9('0x9'));var client=jayson[_0x56a9('0xa')][_0x56a9('0xb')]({'port':0x232a});config[_0x56a9('0xc')]=_[_0x56a9('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x56a9('0xe'))(new Redis(config[_0x56a9('0xc')]));require('./mailMessage.socket')[_0x56a9('0xf')](socket);function respondWithRpcPromise(_0x1eddfd,_0x2d590d,_0xcf7c){return new BPromise(function(_0x3c1506,_0x319ff3){return client[_0x56a9('0x10')](_0x1eddfd,_0xcf7c)[_0x56a9('0x11')](function(_0x9ab10c){logger['info'](_0x56a9('0x12'),_0x2d590d,'request\x20sent');logger[_0x56a9('0x13')](_0x56a9('0x14'),_0x2d590d,_0x56a9('0x15'),JSON[_0x56a9('0x16')](_0x9ab10c));if(_0x9ab10c[_0x56a9('0x17')]){if(_0x9ab10c[_0x56a9('0x17')][_0x56a9('0x18')]===0x1f4){logger[_0x56a9('0x17')](_0x56a9('0x12'),_0x2d590d,_0x9ab10c['error']['message']);return _0x319ff3(_0x9ab10c[_0x56a9('0x17')][_0x56a9('0x19')]);}logger[_0x56a9('0x17')](_0x56a9('0x12'),_0x2d590d,_0x9ab10c['error'][_0x56a9('0x19')]);return _0x3c1506(_0x9ab10c['error']['message']);}else{logger['info'](_0x56a9('0x12'),_0x2d590d,_0x56a9('0x15'));_0x3c1506(_0x9ab10c[_0x56a9('0x1a')][_0x56a9('0x19')]);}})[_0x56a9('0x1b')](function(_0x429e24){logger[_0x56a9('0x17')](_0x56a9('0x12'),_0x2d590d,_0x429e24);_0x319ff3(_0x429e24);});});}exports[_0x56a9('0x1c')]=function(_0x335cc3){var _0x2ff2ca=this;return new Promise(function(_0x62f79f,_0x5f145f){return db['MailMessage'][_0x56a9('0x1d')](_0x335cc3[_0x56a9('0x1e')],{'raw':_0x335cc3[_0x56a9('0x1f')]?_0x335cc3[_0x56a9('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x56a9('0x11')](function(_0x3355c4){logger[_0x56a9('0x20')](_0x56a9('0x1c'),_0x335cc3);logger['debug'](_0x56a9('0x1c'),_0x335cc3,JSON[_0x56a9('0x16')](_0x3355c4));_0x62f79f(_0x3355c4);})[_0x56a9('0x1b')](function(_0xd029f7){logger[_0x56a9('0x17')]('CreateMailMessage',_0xd029f7[_0x56a9('0x19')],_0x335cc3);_0x5f145f(_0x2ff2ca[_0x56a9('0x17')](0x1f4,_0xd029f7[_0x56a9('0x19')]));});});};
\ No newline at end of file
index 9872634..533d0c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x072f=['removeListener','length','mailMessage:','save','remove','update'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x072f,0x1a7));var _0xf072=function(_0x2cf07e,_0x108442){_0x2cf07e=_0x2cf07e-0x0;var _0x4cfc65=_0x072f[_0x2cf07e];return _0x4cfc65;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xf072('0x0'),_0xf072('0x1'),_0xf072('0x2')];function createListener(_0x2bab21,_0x19015f){return function(_0x50ea00){_0x19015f['emit'](_0x2bab21,_0x50ea00);};}function removeListener(_0x35cf74,_0x105a7c){return function(){MailMessageEvents[_0xf072('0x3')](_0x35cf74,_0x105a7c);};}exports['register']=function(_0x2b278f){for(var _0xe1502d=0x0,_0x9dd048=events[_0xf072('0x4')];_0xe1502d<_0x9dd048;_0xe1502d++){var _0x2bca9c=events[_0xe1502d];var _0x40ebb9=createListener(_0xf072('0x5')+_0x2bca9c,_0x2b278f);MailMessageEvents['on'](_0x2bca9c,_0x40ebb9);}};
\ No newline at end of file
+var _0xa809=['./mailMessage.events','save','remove','update','removeListener','register','length','mailMessage:'];(function(_0x6c5964,_0x5c9039){var _0x5338d9=function(_0x5a3d95){while(--_0x5a3d95){_0x6c5964['push'](_0x6c5964['shift']());}};_0x5338d9(++_0x5c9039);}(_0xa809,0x1a8));var _0x9a80=function(_0x154980,_0x2710e5){_0x154980=_0x154980-0x0;var _0x55a463=_0xa809[_0x154980];return _0x55a463;};'use strict';var MailMessageEvents=require(_0x9a80('0x0'));var events=[_0x9a80('0x1'),_0x9a80('0x2'),_0x9a80('0x3')];function createListener(_0x1afe2f,_0x71c254){return function(_0x3016d1){_0x71c254['emit'](_0x1afe2f,_0x3016d1);};}function removeListener(_0x360c00,_0x2510a7){return function(){MailMessageEvents[_0x9a80('0x4')](_0x360c00,_0x2510a7);};}exports[_0x9a80('0x5')]=function(_0x44f3cd){for(var _0x428862=0x0,_0x121e44=events[_0x9a80('0x6')];_0x428862<_0x121e44;_0x428862++){var _0x3fca86=events[_0x428862];var _0x1daa7e=createListener(_0x9a80('0x7')+_0x3fca86,_0x44f3cd);MailMessageEvents['on'](_0x3fca86,_0x1daa7e);}};
\ No newline at end of file
index acfe7f9..bdbeed9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76ad=['../../components/auth/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','delete','destroy','removeAgents','exports','multer','util','path','express','Router','fs-extra'];(function(_0x92dbd0,_0x2c986e){var _0x40759f=function(_0x8ab1f4){while(--_0x8ab1f4){_0x92dbd0['push'](_0x92dbd0['shift']());}};_0x40759f(++_0x2c986e);}(_0x76ad,0xc5));var _0xd76a=function(_0x43616d,_0xf7203c){_0x43616d=_0x43616d-0x0;var _0x5d0681=_0x76ad[_0x43616d];return _0x5d0681;};'use strict';var multer=require(_0xd76a('0x0'));var util=require(_0xd76a('0x1'));var path=require(_0xd76a('0x2'));var timeout=require('connect-timeout');var express=require(_0xd76a('0x3'));var router=express[_0xd76a('0x4')]();var fs_extra=require(_0xd76a('0x5'));var auth=require(_0xd76a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd76a('0x7'));var controller=require(_0xd76a('0x8'));router[_0xd76a('0x9')]('/',auth[_0xd76a('0xa')](),controller[_0xd76a('0xb')]);router[_0xd76a('0x9')](_0xd76a('0xc'),auth[_0xd76a('0xa')](),controller[_0xd76a('0xd')]);router[_0xd76a('0x9')]('/:id',auth[_0xd76a('0xa')](),controller['show']);router[_0xd76a('0x9')](_0xd76a('0xe'),auth[_0xd76a('0xa')](),controller[_0xd76a('0xf')]);router['get'](_0xd76a('0x10'),auth['isAuthenticated'](),controller[_0xd76a('0x11')]);router['get'](_0xd76a('0x12'),auth[_0xd76a('0xa')](),controller[_0xd76a('0x13')]);router['post']('/',auth[_0xd76a('0xa')](),controller[_0xd76a('0x14')]);router[_0xd76a('0x15')](_0xd76a('0x10'),auth[_0xd76a('0xa')](),controller[_0xd76a('0x16')]);router[_0xd76a('0x15')]('/:id/users',auth[_0xd76a('0xa')](),controller[_0xd76a('0x17')]);router[_0xd76a('0x18')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd76a('0x19')]('/:id',auth[_0xd76a('0xa')](),controller[_0xd76a('0x1a')]);router[_0xd76a('0x19')]('/:id/teams',auth[_0xd76a('0xa')](),controller['removeTeams']);router[_0xd76a('0x19')](_0xd76a('0x12'),auth[_0xd76a('0xa')](),controller[_0xd76a('0x1b')]);module[_0xd76a('0x1c')]=router;
\ No newline at end of file
+var _0x7771=['connect-timeout','express','Router','fs-extra','./mailQueue.controller','get','isAuthenticated','/:id','show','getMembers','/:id/teams','getTeams','create','post','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeAgents','multer','util','path'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0x7771,0x174));var _0x1777=function(_0x54e6f5,_0x4f4e99){_0x54e6f5=_0x54e6f5-0x0;var _0x5e8794=_0x7771[_0x54e6f5];return _0x5e8794;};'use strict';var multer=require(_0x1777('0x0'));var util=require(_0x1777('0x1'));var path=require(_0x1777('0x2'));var timeout=require(_0x1777('0x3'));var express=require(_0x1777('0x4'));var router=express[_0x1777('0x5')]();var fs_extra=require(_0x1777('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1777('0x7'));router[_0x1777('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1777('0x8')]('/describe',auth[_0x1777('0x9')](),controller['describe']);router[_0x1777('0x8')](_0x1777('0xa'),auth['isAuthenticated'](),controller[_0x1777('0xb')]);router['get']('/:id/members',auth['isAuthenticated'](),controller[_0x1777('0xc')]);router[_0x1777('0x8')](_0x1777('0xd'),auth[_0x1777('0x9')](),controller[_0x1777('0xe')]);router[_0x1777('0x8')]('/:id/users',auth[_0x1777('0x9')](),controller['getAgents']);router['post']('/',auth[_0x1777('0x9')](),controller[_0x1777('0xf')]);router[_0x1777('0x10')](_0x1777('0xd'),auth[_0x1777('0x9')](),controller[_0x1777('0x11')]);router[_0x1777('0x10')](_0x1777('0x12'),auth['isAuthenticated'](),controller[_0x1777('0x13')]);router[_0x1777('0x14')](_0x1777('0xa'),auth[_0x1777('0x9')](),controller[_0x1777('0x15')]);router[_0x1777('0x16')](_0x1777('0xa'),auth[_0x1777('0x9')](),controller[_0x1777('0x17')]);router['delete'](_0x1777('0xd'),auth[_0x1777('0x9')](),controller['removeTeams']);router[_0x1777('0x16')]('/:id/users',auth[_0x1777('0x9')](),controller[_0x1777('0x18')]);module['exports']=router;
\ No newline at end of file
index 169063c..8a7ca20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x400c=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x3309bc,_0x3cc5ef){var _0xb77040=function(_0x48dc41){while(--_0x48dc41){_0x3309bc['push'](_0x3309bc['shift']());}};_0xb77040(++_0x3cc5ef);}(_0x400c,0xcb));var _0xc400=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x400c[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0xc400('0x0'));module[_0xc400('0x1')]={'name':{'type':Sequelize[_0xc400('0x2')],'unique':_0xc400('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc400('0x2')]},'timeout':{'type':Sequelize[_0xc400('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc400('0x5')](_0xc400('0x6'),_0xc400('0x7'),_0xc400('0x8'))}};
\ No newline at end of file
+var _0xff48=['sequelize','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x1a5a2f,_0x4fef1b){var _0x125ad8=function(_0x1b1813){while(--_0x1b1813){_0x1a5a2f['push'](_0x1a5a2f['shift']());}};_0x125ad8(++_0x4fef1b);}(_0xff48,0x1c7));var _0x8ff4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xff48[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8ff4('0x0'));module['exports']={'name':{'type':Sequelize[_0x8ff4('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8ff4('0x1')]},'timeout':{'type':Sequelize[_0x8ff4('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8ff4('0x3')](_0x8ff4('0x4'),_0x8ff4('0x5'),_0x8ff4('0x6'))}};
\ No newline at end of file
index 2b80576..1804e78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ce1=['union','value','transaction','removeTeams','isEmpty','removeAgents','addAgents','omit','spread','userMailQueue:save','isArray','userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','destroy','then','get','MailQueues','UserProfileResource','end','error','stack','index','map','MailQueue','rawAttributes','fieldName','type','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','UserMailQueue','sort','MailQueueId','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','Team','getTeams','ids','User','Agents','online','voicePause','addTeams','each','findOrCreate','forEach','emit','select','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','QueryTypes','every','TeamId','includes','all'];(function(_0x53a7af,_0x1408a5){var _0x3cc7f6=function(_0x4bf101){while(--_0x4bf101){_0x53a7af['push'](_0x53a7af['shift']());}};_0x3cc7f6(++_0x1408a5);}(_0x8ce1,0x97));var _0x18ce=function(_0x37f65b,_0x874ce7){_0x37f65b=_0x37f65b-0x0;var _0x1df470=_0x8ce1[_0x37f65b];return _0x1df470;};'use strict';var emlformat=require(_0x18ce('0x0'));var rimraf=require(_0x18ce('0x1'));var zipdir=require(_0x18ce('0x2'));var jsonpatch=require(_0x18ce('0x3'));var rp=require('request-promise');var moment=require(_0x18ce('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x18ce('0x5'));var util=require(_0x18ce('0x6'));var path=require(_0x18ce('0x7'));var sox=require('sox');var csv=require(_0x18ce('0x8'));var ejs=require(_0x18ce('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x18ce('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x18ce('0xb'));var toCsv=require(_0x18ce('0x8'));var querystring=require(_0x18ce('0xc'));var Papa=require(_0x18ce('0xd'));var Redis=require(_0x18ce('0xe'));var authService=require(_0x18ce('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x18ce('0x10'));var hardwareService=require(_0x18ce('0x11'));var logger=require(_0x18ce('0x12'))(_0x18ce('0x13'));var utils=require(_0x18ce('0x14'));var config=require(_0x18ce('0x15'));var licenseUtil=require(_0x18ce('0x16'));var db=require(_0x18ce('0x17'))['db'];config[_0x18ce('0x18')]=_[_0x18ce('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x18ce('0x1a'))(new Redis(config['redis']));require('./mailQueue.socket')['register'](socket);function respondWithStatusCode(_0x5b4220,_0x19b8f4){_0x19b8f4=_0x19b8f4||0xcc;return function(_0x4348d4){if(_0x4348d4){return _0x5b4220[_0x18ce('0x1b')](_0x19b8f4);}return _0x5b4220[_0x18ce('0x1c')](_0x19b8f4)['end']();};}function respondWithResult(_0x43b382,_0xe4fec8){_0xe4fec8=_0xe4fec8||0xc8;return function(_0x40f587){if(_0x40f587){return _0x43b382[_0x18ce('0x1c')](_0xe4fec8)[_0x18ce('0x1d')](_0x40f587);}};}function respondWithFilteredResult(_0x444f12,_0x4a7b92){return function(_0x27d6e5){if(_0x27d6e5){var _0x217fdb=typeof _0x4a7b92[_0x18ce('0x1e')]===_0x18ce('0x1f')&&typeof _0x4a7b92['limit']===_0x18ce('0x1f');var _0x5a1651=_0x27d6e5['count'];var _0x14a73d=_0x217fdb?0x0:_0x4a7b92[_0x18ce('0x1e')];var _0x5bbe7f=_0x217fdb?_0x27d6e5[_0x18ce('0x20')]:_0x4a7b92['offset']+_0x4a7b92[_0x18ce('0x21')];var _0x4462e4;if(_0x5bbe7f>=_0x5a1651){_0x5bbe7f=_0x5a1651;_0x4462e4=0xc8;}else{_0x4462e4=0xce;}_0x444f12[_0x18ce('0x1c')](_0x4462e4);return _0x444f12['set'](_0x18ce('0x22'),_0x14a73d+'-'+_0x5bbe7f+'/'+_0x5a1651)['json'](_0x27d6e5);}return null;};}function patchUpdates(_0x11d92d){return function(_0x3b5d67){try{jsonpatch[_0x18ce('0x23')](_0x3b5d67,_0x11d92d,!![]);}catch(_0xfaceef){return BPromise['reject'](_0xfaceef);}return _0x3b5d67[_0x18ce('0x24')]();};}function saveUpdates(_0x52cf95,_0x484e91){return function(_0x5b6e47){if(_0x5b6e47){return _0x5b6e47[_0x18ce('0x25')](_0x52cf95)['then'](function(_0x33c0f8){return _0x33c0f8;});}return null;};}function removeEntity(_0xa01faa,_0x1ff501){return function(_0x3c44cd){if(_0x3c44cd){return _0x3c44cd[_0x18ce('0x26')]()[_0x18ce('0x27')](function(){var _0x2dd300=_0x3c44cd[_0x18ce('0x28')]({'plain':!![]});var _0x525f59=_0x18ce('0x29');return db[_0x18ce('0x2a')][_0x18ce('0x26')]({'where':{'type':_0x525f59,'resourceId':_0x2dd300['id']}})[_0x18ce('0x27')](function(){return _0x3c44cd;});})[_0x18ce('0x27')](function(){_0xa01faa[_0x18ce('0x1c')](0xcc)[_0x18ce('0x2b')]();});}};}function handleEntityNotFound(_0x4b6b78,_0x3761ba){return function(_0x4a9d2d){if(!_0x4a9d2d){_0x4b6b78[_0x18ce('0x1b')](0x194);}return _0x4a9d2d;};}function handleError(_0x41866b,_0x52f704){_0x52f704=_0x52f704||0x1f4;return function(_0x515c9c){logger[_0x18ce('0x2c')](_0x515c9c[_0x18ce('0x2d')]);if(_0x515c9c['name']){delete _0x515c9c['name'];}_0x41866b['status'](_0x52f704)['send'](_0x515c9c);};}exports[_0x18ce('0x2e')]=function(_0x3fc5f5,_0x396598){var _0x48f384={},_0x26509c={},_0x747bf7={'count':0x0,'rows':[]};var _0x81810=_[_0x18ce('0x2f')](db[_0x18ce('0x30')][_0x18ce('0x31')],function(_0xe07916){return{'name':_0xe07916[_0x18ce('0x32')],'type':_0xe07916[_0x18ce('0x33')]['key']};});_0x26509c['model']=_[_0x18ce('0x2f')](_0x81810,_0x18ce('0x34'));_0x26509c[_0x18ce('0x35')]=_[_0x18ce('0x36')](_0x3fc5f5['query']);_0x26509c[_0x18ce('0x37')]=_[_0x18ce('0x38')](_0x26509c[_0x18ce('0x39')],_0x26509c[_0x18ce('0x35')]);_0x48f384[_0x18ce('0x3a')]=_[_0x18ce('0x38')](_0x26509c['model'],qs[_0x18ce('0x3b')](_0x3fc5f5[_0x18ce('0x35')][_0x18ce('0x3b')]));_0x48f384[_0x18ce('0x3a')]=_0x48f384[_0x18ce('0x3a')][_0x18ce('0x3c')]?_0x48f384['attributes']:_0x26509c[_0x18ce('0x39')];if(!_0x3fc5f5[_0x18ce('0x35')][_0x18ce('0x3d')](_0x18ce('0x3e'))){_0x48f384[_0x18ce('0x21')]=qs[_0x18ce('0x21')](_0x3fc5f5[_0x18ce('0x35')]['limit']);_0x48f384[_0x18ce('0x1e')]=qs['offset'](_0x3fc5f5[_0x18ce('0x35')]['offset']);}_0x48f384[_0x18ce('0x3f')]=qs['sort'](_0x3fc5f5[_0x18ce('0x35')]['sort']);_0x48f384['where']=qs['filters'](_[_0x18ce('0x40')](_0x3fc5f5[_0x18ce('0x35')],_0x26509c[_0x18ce('0x37')]),_0x81810);if(_0x3fc5f5[_0x18ce('0x35')][_0x18ce('0x41')]){_0x48f384['where']=_[_0x18ce('0x42')](_0x48f384[_0x18ce('0x43')],{'$or':_['map'](_0x81810,function(_0x5d497a){if(_0x5d497a[_0x18ce('0x33')]!==_0x18ce('0x44')){var _0xbcda62={};_0xbcda62[_0x5d497a[_0x18ce('0x34')]]={'$like':'%'+_0x3fc5f5['query'][_0x18ce('0x41')]+'%'};return _0xbcda62;}})});}_0x48f384=_[_0x18ce('0x42')]({},_0x48f384,_0x3fc5f5[_0x18ce('0x45')]);var _0x903a44={'where':_0x48f384[_0x18ce('0x43')]};return db[_0x18ce('0x30')][_0x18ce('0x20')](_0x903a44)['then'](function(_0x4116c1){_0x747bf7[_0x18ce('0x20')]=_0x4116c1;if(_0x3fc5f5[_0x18ce('0x35')][_0x18ce('0x46')]){_0x48f384[_0x18ce('0x47')]=[{'all':!![]}];}return db['MailQueue'][_0x18ce('0x48')](_0x48f384);})[_0x18ce('0x27')](function(_0x5b735f){_0x747bf7[_0x18ce('0x49')]=_0x5b735f;return _0x747bf7;})[_0x18ce('0x27')](respondWithFilteredResult(_0x396598,_0x48f384))[_0x18ce('0x4a')](handleError(_0x396598,null));};exports[_0x18ce('0x4b')]=function(_0x2bb0e9,_0x22f07a){var _0x2d7557={'raw':!![],'where':{'id':_0x2bb0e9[_0x18ce('0x4c')]['id']}},_0x2c8897={};_0x2c8897[_0x18ce('0x39')]=_[_0x18ce('0x36')](db[_0x18ce('0x30')]['rawAttributes']);_0x2c8897[_0x18ce('0x35')]=_['keys'](_0x2bb0e9[_0x18ce('0x35')]);_0x2c8897[_0x18ce('0x37')]=_[_0x18ce('0x38')](_0x2c8897[_0x18ce('0x39')],_0x2c8897[_0x18ce('0x35')]);_0x2d7557[_0x18ce('0x3a')]=_[_0x18ce('0x38')](_0x2c8897[_0x18ce('0x39')],qs[_0x18ce('0x3b')](_0x2bb0e9['query'][_0x18ce('0x3b')]));_0x2d7557[_0x18ce('0x3a')]=_0x2d7557[_0x18ce('0x3a')][_0x18ce('0x3c')]?_0x2d7557[_0x18ce('0x3a')]:_0x2c8897[_0x18ce('0x39')];if(_0x2bb0e9[_0x18ce('0x35')]['includeAll']){_0x2d7557[_0x18ce('0x47')]=[{'all':!![]}];}_0x2d7557=_['merge']({},_0x2d7557,_0x2bb0e9[_0x18ce('0x45')]);return db[_0x18ce('0x30')][_0x18ce('0x4d')](_0x2d7557)['then'](handleEntityNotFound(_0x22f07a,null))[_0x18ce('0x27')](respondWithResult(_0x22f07a,null))['catch'](handleError(_0x22f07a,null));};exports['create']=function(_0x240db2,_0x3f4630){return db['MailQueue'][_0x18ce('0x4e')](_0x240db2[_0x18ce('0x4f')],{})[_0x18ce('0x27')](function(_0x35297c){var _0x4be318=_0x240db2[_0x18ce('0x50')][_0x18ce('0x28')]({'plain':!![]});if(!_0x4be318)throw new Error(_0x18ce('0x51'));if(_0x4be318['role']===_0x18ce('0x50')){var _0x48444a=_0x35297c['get']({'plain':!![]});var _0x2bbfd8=_0x18ce('0x29');return db[_0x18ce('0x52')][_0x18ce('0x4d')]({'where':{'name':_0x2bbfd8,'userProfileId':_0x4be318[_0x18ce('0x53')]},'raw':!![]})[_0x18ce('0x27')](function(_0x152c3f){if(_0x152c3f&&_0x152c3f[_0x18ce('0x54')]===0x0){return db[_0x18ce('0x2a')][_0x18ce('0x4e')]({'name':_0x48444a[_0x18ce('0x34')],'resourceId':_0x48444a['id'],'type':_0x152c3f[_0x18ce('0x34')],'sectionId':_0x152c3f['id']},{})[_0x18ce('0x27')](function(){return _0x35297c;});}else{return _0x35297c;}})[_0x18ce('0x4a')](function(_0xe579c1){logger[_0x18ce('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe579c1);throw _0xe579c1;});}return _0x35297c;})['then'](respondWithResult(_0x3f4630,0xc9))['catch'](handleError(_0x3f4630,null));};exports['update']=function(_0x4ef2e4,_0x10d532){if(_0x4ef2e4['body']['id']){delete _0x4ef2e4['body']['id'];}return db['MailQueue'][_0x18ce('0x4d')]({'where':{'id':_0x4ef2e4[_0x18ce('0x4c')]['id']}})['then'](handleEntityNotFound(_0x10d532,null))[_0x18ce('0x27')](saveUpdates(_0x4ef2e4['body'],null))['then'](respondWithResult(_0x10d532,null))[_0x18ce('0x4a')](handleError(_0x10d532,null));};exports['destroy']=function(_0x2652df,_0x4e1bdd){return db[_0x18ce('0x30')][_0x18ce('0x4d')]({'where':{'id':_0x2652df[_0x18ce('0x4c')]['id']}})[_0x18ce('0x27')](handleEntityNotFound(_0x4e1bdd,null))['then'](removeEntity(_0x4e1bdd,null))['catch'](handleError(_0x4e1bdd,null));};exports[_0x18ce('0x55')]=function(_0x542d5e,_0x3dab43){return db['MailQueue'][_0x18ce('0x55')]()['then'](respondWithResult(_0x3dab43,null))['catch'](handleError(_0x3dab43,null));};exports[_0x18ce('0x56')]=function(_0x5a3283,_0x486777,_0x1d3d53){var _0x20d59f={'raw':!![],'where':{}},_0x55cc56={},_0x5ea909;return db[_0x18ce('0x30')][_0x18ce('0x57')]({'where':{'id':_0x5a3283[_0x18ce('0x4c')]['id']}})[_0x18ce('0x27')](handleEntityNotFound(_0x486777,null))[_0x18ce('0x27')](function(_0x4d81c7){if(_0x4d81c7){_0x5ea909=_0x4d81c7[_0x18ce('0x28')]({'plain':!![]});_0x55cc56[_0x18ce('0x39')]=_['keys'](db[_0x18ce('0x58')][_0x18ce('0x31')]);_0x55cc56[_0x18ce('0x35')]=_[_0x18ce('0x36')](_0x5a3283['query']);_0x55cc56[_0x18ce('0x37')]=_[_0x18ce('0x38')](_0x55cc56['model'],_0x55cc56[_0x18ce('0x35')]);_0x20d59f[_0x18ce('0x3a')]=_[_0x18ce('0x38')](_0x55cc56[_0x18ce('0x39')],qs[_0x18ce('0x3b')](_0x5a3283[_0x18ce('0x35')]['fields']));_0x20d59f[_0x18ce('0x3a')]=_0x20d59f[_0x18ce('0x3a')][_0x18ce('0x3c')]?_0x20d59f['attributes']:_0x55cc56[_0x18ce('0x39')];if(!_0x5a3283['query']['hasOwnProperty'](_0x18ce('0x3e'))){_0x20d59f['limit']=qs[_0x18ce('0x21')](_0x5a3283[_0x18ce('0x35')][_0x18ce('0x21')]);_0x20d59f[_0x18ce('0x1e')]=qs['offset'](_0x5a3283[_0x18ce('0x35')][_0x18ce('0x1e')]);}_0x20d59f[_0x18ce('0x3f')]=qs[_0x18ce('0x59')](_0x5a3283[_0x18ce('0x35')][_0x18ce('0x59')]);_0x20d59f[_0x18ce('0x43')]=qs[_0x18ce('0x37')](_[_0x18ce('0x40')](_0x5a3283[_0x18ce('0x35')],_0x55cc56[_0x18ce('0x37')]));_0x20d59f[_0x18ce('0x43')][_0x18ce('0x5a')]=_0x4d81c7['id'];if(_0x5a3283['query'][_0x18ce('0x41')]){_0x20d59f['where']=_['merge'](_0x20d59f[_0x18ce('0x43')],{'$or':_['map'](_0x20d59f['attributes'],function(_0x597b5e){var _0xf48e92={};_0xf48e92[_0x597b5e]={'$like':'%'+_0x5a3283[_0x18ce('0x35')]['filter']+'%'};return _0xf48e92;})});}_0x20d59f=_[_0x18ce('0x42')]({},_0x20d59f,_0x5a3283[_0x18ce('0x45')]);return db[_0x18ce('0x58')]['findAll'](_0x20d59f);}})['then'](function(_0x2e7f88){if(_0x2e7f88){return db['User'][_0x18ce('0x5b')]({'where':{'id':_[_0x18ce('0x2f')](_0x2e7f88,_0x18ce('0x5c')),'role':_0x18ce('0x5d')},'attributes':['id',_0x18ce('0x34'),_0x18ce('0x5e'),_0x18ce('0x5f'),_0x18ce('0x60')]});}})[_0x18ce('0x27')](function(_0x459ff1){if(_0x459ff1){return{'count':_0x459ff1[_0x18ce('0x20')],'rows':_['map'](_0x459ff1[_0x18ce('0x49')],function(_0x5288d1){return{'membername':_0x5288d1[_0x18ce('0x34')],'UserId':_0x5288d1['id'],'queue_name':_0x5ea909[_0x18ce('0x34')],'MailQueueId':_0x5ea909['id'],'interface':util[_0x18ce('0x61')]('%s/%s','SIP',_0x5288d1['name']),'penalty':0x0,'paused':_0x5288d1[_0x18ce('0x5e')],'createdAt':_0x5288d1[_0x18ce('0x60')],'updatedAt':_0x5288d1[_0x18ce('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x18ce('0x27')](respondWithFilteredResult(_0x486777,_0x20d59f))['catch'](handleError(_0x486777,null));};exports['getTeams']=function(_0x14ebb9,_0x2eeebc,_0x3bbaf2){var _0x417736={};var _0x183395={};var _0xa946a;var _0x2be10c;return db[_0x18ce('0x30')][_0x18ce('0x57')]({'where':{'id':_0x14ebb9[_0x18ce('0x4c')]['id']}})[_0x18ce('0x27')](handleEntityNotFound(_0x2eeebc,null))['then'](function(_0x52a2be){if(_0x52a2be){_0xa946a=_0x52a2be;_0x183395[_0x18ce('0x39')]=_[_0x18ce('0x36')](db[_0x18ce('0x62')][_0x18ce('0x31')]);_0x183395['query']=_[_0x18ce('0x36')](_0x14ebb9['query']);_0x183395[_0x18ce('0x37')]=_['intersection'](_0x183395[_0x18ce('0x39')],_0x183395[_0x18ce('0x35')]);_0x417736['attributes']=_[_0x18ce('0x38')](_0x183395['model'],qs[_0x18ce('0x3b')](_0x14ebb9[_0x18ce('0x35')][_0x18ce('0x3b')]));_0x417736[_0x18ce('0x3a')]=_0x417736[_0x18ce('0x3a')]['length']?_0x417736[_0x18ce('0x3a')]:_0x183395[_0x18ce('0x39')];_0x417736['order']=qs[_0x18ce('0x59')](_0x14ebb9[_0x18ce('0x35')][_0x18ce('0x59')]);_0x417736[_0x18ce('0x43')]=qs[_0x18ce('0x37')](_['pick'](_0x14ebb9[_0x18ce('0x35')],_0x183395['filters']));if(_0x14ebb9['query']['filter']){_0x417736['where']=_[_0x18ce('0x42')](_0x417736['where'],{'$or':_[_0x18ce('0x2f')](_0x417736[_0x18ce('0x3a')],function(_0x689827){var _0x271b17={};_0x271b17[_0x689827]={'$like':'%'+_0x14ebb9[_0x18ce('0x35')]['filter']+'%'};return _0x271b17;})});}_0x417736=_[_0x18ce('0x42')]({},_0x417736,_0x14ebb9[_0x18ce('0x45')]);return _0xa946a[_0x18ce('0x63')](_0x417736);}})[_0x18ce('0x27')](function(_0x2fcca1){if(_0x2fcca1){_0x2be10c=_0x2fcca1[_0x18ce('0x3c')];if(!_0x14ebb9[_0x18ce('0x35')][_0x18ce('0x3d')](_0x18ce('0x3e'))){_0x417736[_0x18ce('0x21')]=qs[_0x18ce('0x21')](_0x14ebb9[_0x18ce('0x35')][_0x18ce('0x21')]);_0x417736[_0x18ce('0x1e')]=qs['offset'](_0x14ebb9['query'][_0x18ce('0x1e')]);}return _0xa946a[_0x18ce('0x63')](_0x417736);}})[_0x18ce('0x27')](function(_0x2cdace){if(_0x2cdace){return _0x2cdace?{'count':_0x2be10c,'rows':_0x2cdace}:null;}})[_0x18ce('0x27')](respondWithResult(_0x2eeebc,null))[_0x18ce('0x4a')](handleError(_0x2eeebc,null));};exports['addTeams']=function(_0x1a4589,_0xe6ce2f,_0x831a41){var _0x20716c=_0x1a4589[_0x18ce('0x4f')][_0x18ce('0x64')];return db[_0x18ce('0x62')]['findAll']({'where':{'id':_0x20716c},'attributes':['id'],'include':[{'model':db[_0x18ce('0x65')],'as':_0x18ce('0x66'),'attributes':['id',_0x18ce('0x34'),_0x18ce('0x67'),_0x18ce('0x68'),'interface'],'raw':!![]}]})[_0x18ce('0x27')](function(_0x18bd0e){if(_0x18bd0e){var _0x487245=_['flatMap'](_0x18bd0e,function(_0x504b0f){var _0x58bfdd=_0x504b0f[_0x18ce('0x28')]({'plain':!![]});return _0x58bfdd[_0x18ce('0x66')];});return db[_0x18ce('0x30')][_0x18ce('0x4d')]({'where':{'id':_0x1a4589[_0x18ce('0x4c')]['id']}})[_0x18ce('0x27')](function(_0x2fbc69){return db['sequelize']['transaction'](function(_0xf9eecf){return _0x2fbc69[_0x18ce('0x69')](_0x20716c,{'transaction':_0xf9eecf})[_0x18ce('0x27')](function(){return BPromise[_0x18ce('0x6a')](_0x487245,function(_0x3f61ce){return db[_0x18ce('0x58')][_0x18ce('0x6b')]({'where':{'UserId':_0x3f61ce['id'],'MailQueueId':_0x1a4589[_0x18ce('0x4c')]['id']},'transaction':_0xf9eecf});});})[_0x18ce('0x27')](function(){_0x487245[_0x18ce('0x6c')](function(_0x746ed7){socket[_0x18ce('0x6d')]('userMailQueue:save',{'UserId':_0x746ed7['id'],'MailQueueId':_0x2fbc69['id']});});});});});}})[_0x18ce('0x27')](respondWithStatusCode(_0xe6ce2f,null))['catch'](handleError(_0xe6ce2f,null));};exports['removeTeams']=function(_0x277dce,_0x371574,_0x5511e6){return db[_0x18ce('0x62')][_0x18ce('0x48')]({'where':{'id':_0x277dce[_0x18ce('0x35')][_0x18ce('0x64')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x18ce('0x66'),'attributes':['id'],'raw':!![]}]})[_0x18ce('0x27')](handleEntityNotFound(_0x371574,null))['then'](function(_0x290bd2){var _0x4db9ae=_[_0x18ce('0x2f')](_0x290bd2,'id');var _0x82a271=[];var _0x54e318=[];var _0x200388=squel[_0x18ce('0x6e')]();_0x200388['field']('tq.TeamId')[_0x18ce('0x6f')](_0x18ce('0x70'),'tq')[_0x18ce('0x71')](_0x18ce('0x72'),'ut',_0x18ce('0x73'))['where'](_0x18ce('0x74'),_0x277dce[_0x18ce('0x4c')]['id']);for(var _0x31391b=0x0;_0x31391b<_0x290bd2[_0x18ce('0x3c')];_0x31391b+=0x1){let _0x47f878=_0x290bd2[_0x31391b];for(var _0x32e8c6=0x0;_0x32e8c6<_0x47f878[_0x18ce('0x66')]['length'];_0x32e8c6+=0x1){let _0x2e70a4=_0x47f878[_0x18ce('0x66')][_0x32e8c6];var _0x311c4d=_0x200388[_0x18ce('0x75')]();_0x311c4d['where'](_0x18ce('0x76'),_0x2e70a4['id']);_0x54e318['push'](db[_0x18ce('0x77')]['query'](_0x311c4d['toString'](),{'type':db['sequelize'][_0x18ce('0x78')]['SELECT']})[_0x18ce('0x27')](function(_0x5665ae){if(_0x5665ae['length']===0x1){return _0x2e70a4['id'];}else{var _0xef12b8=_[_0x18ce('0x79')](_['map'](_0x5665ae,_0x18ce('0x7a')),function(_0x117d00){return _[_0x18ce('0x7b')](_0x4db9ae,_0x117d00);});if(_0xef12b8){return _0x2e70a4['id'];}}}));}}return BPromise[_0x18ce('0x7c')](_0x54e318)[_0x18ce('0x27')](function(_0x453a20){_0x82a271=_(_0x82a271)[_0x18ce('0x7d')](_0x453a20)['compact']()[_0x18ce('0x7e')]();return db[_0x18ce('0x30')]['find']({'where':{'id':_0x277dce[_0x18ce('0x4c')]['id']}})['then'](function(_0x2d6e10){return db[_0x18ce('0x77')][_0x18ce('0x7f')](function(_0x3513c6){return _0x2d6e10[_0x18ce('0x80')](_0x277dce['query'][_0x18ce('0x64')],{'transaction':_0x3513c6})['then'](function(){if(!_[_0x18ce('0x81')](_0x82a271)){return _0x2d6e10[_0x18ce('0x82')](_0x82a271,{'transaction':_0x3513c6});}})['then'](function(){_0x82a271[_0x18ce('0x6c')](function(_0x19d6c7){socket[_0x18ce('0x6d')]('userMailQueue:remove',{'UserId':_0x19d6c7,'MailQueueId':_0x2d6e10['id']});});});});});});})[_0x18ce('0x27')](respondWithStatusCode(_0x371574,null))[_0x18ce('0x4a')](handleError(_0x371574,null));};exports['addAgents']=function(_0x54805c,_0x2d461e,_0x4dd877){return db[_0x18ce('0x30')][_0x18ce('0x4d')]({'where':{'id':_0x54805c[_0x18ce('0x4c')]['id']}})[_0x18ce('0x27')](handleEntityNotFound(_0x2d461e,null))[_0x18ce('0x27')](function(_0xc46d72){if(_0xc46d72){return _0xc46d72[_0x18ce('0x83')](_0x54805c[_0x18ce('0x4f')][_0x18ce('0x64')],_[_0x18ce('0x84')](_0x54805c[_0x18ce('0x4f')],[_0x18ce('0x64'),'id'])||{})[_0x18ce('0x85')](function(_0x2806fb){for(var _0x1ed8b3=0x0;_0x1ed8b3<_0x54805c[_0x18ce('0x4f')][_0x18ce('0x64')]['length'];_0x1ed8b3+=0x1){socket[_0x18ce('0x6d')](_0x18ce('0x86'),{'UserId':Number(_0x54805c[_0x18ce('0x4f')][_0x18ce('0x64')][_0x1ed8b3]),'MailQueueId':Number(_0x54805c[_0x18ce('0x4c')]['id'])});}return _0x2806fb;});}})[_0x18ce('0x27')](respondWithResult(_0x2d461e,null))[_0x18ce('0x4a')](handleError(_0x2d461e,null));};exports[_0x18ce('0x82')]=function(_0x4a10e5,_0x3890bd,_0x38588e){return db['MailQueue'][_0x18ce('0x4d')]({'where':{'id':_0x4a10e5[_0x18ce('0x4c')]['id']}})[_0x18ce('0x27')](handleEntityNotFound(_0x3890bd,null))[_0x18ce('0x27')](function(_0x77f5b7){if(_0x77f5b7){return _0x77f5b7['removeAgents'](_0x4a10e5['query'][_0x18ce('0x64')])[_0x18ce('0x27')](function(){if(_[_0x18ce('0x87')](_0x4a10e5[_0x18ce('0x35')][_0x18ce('0x64')])){for(var _0x6d9461=0x0;_0x6d9461<_0x4a10e5['query'][_0x18ce('0x64')][_0x18ce('0x3c')];_0x6d9461+=0x1){socket[_0x18ce('0x6d')](_0x18ce('0x88'),{'UserId':Number(_0x4a10e5[_0x18ce('0x35')]['ids'][_0x6d9461]),'MailQueueId':Number(_0x4a10e5['params']['id'])});}}else{socket[_0x18ce('0x6d')](_0x18ce('0x88'),{'UserId':Number(_0x4a10e5[_0x18ce('0x35')][_0x18ce('0x64')]),'MailQueueId':Number(_0x4a10e5[_0x18ce('0x4c')]['id'])});}});}})[_0x18ce('0x27')](respondWithStatusCode(_0x3890bd,null))[_0x18ce('0x4a')](handleError(_0x3890bd,null));};exports[_0x18ce('0x89')]=function(_0x370813,_0x21c38c,_0x4556b0){var _0x3d8784={};var _0x5bfe4c={};var _0x5d3add;var _0x1baf52;return db[_0x18ce('0x30')][_0x18ce('0x57')]({'where':{'id':_0x370813[_0x18ce('0x4c')]['id']}})[_0x18ce('0x27')](handleEntityNotFound(_0x21c38c,null))['then'](function(_0x35522a){if(_0x35522a){_0x5d3add=_0x35522a;_0x5bfe4c['model']=_[_0x18ce('0x36')](db['User']['rawAttributes']);_0x5bfe4c[_0x18ce('0x35')]=_[_0x18ce('0x36')](_0x370813[_0x18ce('0x35')]);_0x5bfe4c[_0x18ce('0x37')]=_[_0x18ce('0x38')](_0x5bfe4c['model'],_0x5bfe4c[_0x18ce('0x35')]);_0x3d8784[_0x18ce('0x3a')]=_[_0x18ce('0x38')](_0x5bfe4c[_0x18ce('0x39')],qs[_0x18ce('0x3b')](_0x370813[_0x18ce('0x35')][_0x18ce('0x3b')]));_0x3d8784[_0x18ce('0x3a')]=_0x3d8784[_0x18ce('0x3a')]['length']?_0x3d8784[_0x18ce('0x3a')]:_0x5bfe4c[_0x18ce('0x39')];_0x3d8784[_0x18ce('0x3f')]=qs[_0x18ce('0x59')](_0x370813[_0x18ce('0x35')][_0x18ce('0x59')]);_0x3d8784[_0x18ce('0x43')]=qs[_0x18ce('0x37')](_[_0x18ce('0x40')](_0x370813[_0x18ce('0x35')],_0x5bfe4c[_0x18ce('0x37')]));if(_0x370813[_0x18ce('0x35')][_0x18ce('0x41')]){_0x3d8784[_0x18ce('0x43')]=_[_0x18ce('0x42')](_0x3d8784['where'],{'$or':_['map'](_0x3d8784['attributes'],function(_0x12a1a9){var _0x1ddaa8={};_0x1ddaa8[_0x12a1a9]={'$like':'%'+_0x370813['query'][_0x18ce('0x41')]+'%'};return _0x1ddaa8;})});}_0x3d8784=_[_0x18ce('0x42')]({},_0x3d8784,_0x370813['options']);return _0x5d3add['getAgents'](_0x3d8784);}})[_0x18ce('0x27')](function(_0x3d4b7c){if(_0x3d4b7c){_0x1baf52=_0x3d4b7c[_0x18ce('0x3c')];if(!_0x370813[_0x18ce('0x35')][_0x18ce('0x3d')](_0x18ce('0x3e'))){_0x3d8784[_0x18ce('0x21')]=qs[_0x18ce('0x21')](_0x370813[_0x18ce('0x35')][_0x18ce('0x21')]);_0x3d8784[_0x18ce('0x1e')]=qs[_0x18ce('0x1e')](_0x370813[_0x18ce('0x35')][_0x18ce('0x1e')]);}return _0x5d3add[_0x18ce('0x89')](_0x3d8784);}})['then'](function(_0x17ef3d){if(_0x17ef3d){return _0x17ef3d?{'count':_0x1baf52,'rows':_0x17ef3d}:null;}})[_0x18ce('0x27')](respondWithResult(_0x21c38c,null))[_0x18ce('0x4a')](handleError(_0x21c38c,null));};
\ No newline at end of file
+var _0xdba8=['UserProfileResource','destroy','then','end','error','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','length','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','nolimit','UserId','agent','mailPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','ids','online','voicePause','interface','flatMap','Agents','transaction','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','User','select','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','every','TeamId','all','union','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','json','offset','limit','undefined','count','apply','reject','save','update','get','MailQueues'];(function(_0x5c6469,_0x54afe8){var _0x4a85d0=function(_0x668156){while(--_0x668156){_0x5c6469['push'](_0x5c6469['shift']());}};_0x4a85d0(++_0x54afe8);}(_0xdba8,0x179));var _0x8dba=function(_0x204d3f,_0x340cd0){_0x204d3f=_0x204d3f-0x0;var _0x2d9a8a=_0xdba8[_0x204d3f];return _0x2d9a8a;};'use strict';var emlformat=require(_0x8dba('0x0'));var rimraf=require(_0x8dba('0x1'));var zipdir=require(_0x8dba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8dba('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8dba('0x4'));var util=require(_0x8dba('0x5'));var path=require('path');var sox=require(_0x8dba('0x6'));var csv=require(_0x8dba('0x7'));var ejs=require(_0x8dba('0x8'));var fs=require('fs');var fs_extra=require(_0x8dba('0x9'));var _=require(_0x8dba('0xa'));var squel=require(_0x8dba('0xb'));var crypto=require(_0x8dba('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8dba('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8dba('0xe'));var Papa=require(_0x8dba('0xf'));var Redis=require('ioredis');var authService=require(_0x8dba('0x10'));var qs=require(_0x8dba('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8dba('0x12'));var logger=require('../../config/logger')(_0x8dba('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8dba('0x14'));var db=require(_0x8dba('0x15'))['db'];config['redis']=_[_0x8dba('0x16')](config['redis'],{'host':_0x8dba('0x17'),'port':0x18eb});var socket=require(_0x8dba('0x18'))(new Redis(config[_0x8dba('0x19')]));require('./mailQueue.socket')[_0x8dba('0x1a')](socket);function respondWithStatusCode(_0x447beb,_0x59dba3){_0x59dba3=_0x59dba3||0xcc;return function(_0x2c0d4f){if(_0x2c0d4f){return _0x447beb[_0x8dba('0x1b')](_0x59dba3);}return _0x447beb[_0x8dba('0x1c')](_0x59dba3)['end']();};}function respondWithResult(_0x3ceaff,_0x39256c){_0x39256c=_0x39256c||0xc8;return function(_0x28ee69){if(_0x28ee69){return _0x3ceaff[_0x8dba('0x1c')](_0x39256c)[_0x8dba('0x1d')](_0x28ee69);}};}function respondWithFilteredResult(_0xeecd9b,_0x39360a){return function(_0x58f09f){if(_0x58f09f){var _0x2e8dca=typeof _0x39360a[_0x8dba('0x1e')]==='undefined'&&typeof _0x39360a[_0x8dba('0x1f')]===_0x8dba('0x20');var _0x2a38aa=_0x58f09f[_0x8dba('0x21')];var _0x191283=_0x2e8dca?0x0:_0x39360a[_0x8dba('0x1e')];var _0x1f04b8=_0x2e8dca?_0x58f09f[_0x8dba('0x21')]:_0x39360a[_0x8dba('0x1e')]+_0x39360a['limit'];var _0xc098db;if(_0x1f04b8>=_0x2a38aa){_0x1f04b8=_0x2a38aa;_0xc098db=0xc8;}else{_0xc098db=0xce;}_0xeecd9b['status'](_0xc098db);return _0xeecd9b['set']('Content-Range',_0x191283+'-'+_0x1f04b8+'/'+_0x2a38aa)['json'](_0x58f09f);}return null;};}function patchUpdates(_0x13d737){return function(_0x5573a1){try{jsonpatch[_0x8dba('0x22')](_0x5573a1,_0x13d737,!![]);}catch(_0xc33041){return BPromise[_0x8dba('0x23')](_0xc33041);}return _0x5573a1[_0x8dba('0x24')]();};}function saveUpdates(_0x11a50e,_0x14db25){return function(_0x5ed37b){if(_0x5ed37b){return _0x5ed37b[_0x8dba('0x25')](_0x11a50e)['then'](function(_0x3bb3d2){return _0x3bb3d2;});}return null;};}function removeEntity(_0x5ba65e,_0x1156c6){return function(_0x459390){if(_0x459390){return _0x459390['destroy']()['then'](function(){var _0x122410=_0x459390[_0x8dba('0x26')]({'plain':!![]});var _0x3f1ec4=_0x8dba('0x27');return db[_0x8dba('0x28')][_0x8dba('0x29')]({'where':{'type':_0x3f1ec4,'resourceId':_0x122410['id']}})[_0x8dba('0x2a')](function(){return _0x459390;});})[_0x8dba('0x2a')](function(){_0x5ba65e[_0x8dba('0x1c')](0xcc)[_0x8dba('0x2b')]();});}};}function handleEntityNotFound(_0x4fb611,_0x5e1a4f){return function(_0x561dfb){if(!_0x561dfb){_0x4fb611['sendStatus'](0x194);}return _0x561dfb;};}function handleError(_0x2da597,_0x21b9bb){_0x21b9bb=_0x21b9bb||0x1f4;return function(_0x103078){logger[_0x8dba('0x2c')](_0x103078['stack']);if(_0x103078[_0x8dba('0x2d')]){delete _0x103078[_0x8dba('0x2d')];}_0x2da597[_0x8dba('0x1c')](_0x21b9bb)[_0x8dba('0x2e')](_0x103078);};}exports[_0x8dba('0x2f')]=function(_0x4232e2,_0x2c346a){var _0x3c0e83={},_0x2e34b4={},_0x2d04c4={'count':0x0,'rows':[]};var _0x1039f7=_[_0x8dba('0x30')](db[_0x8dba('0x31')][_0x8dba('0x32')],function(_0x3d04d5){return{'name':_0x3d04d5[_0x8dba('0x33')],'type':_0x3d04d5[_0x8dba('0x34')][_0x8dba('0x35')]};});_0x2e34b4[_0x8dba('0x36')]=_['map'](_0x1039f7,_0x8dba('0x2d'));_0x2e34b4[_0x8dba('0x37')]=_[_0x8dba('0x38')](_0x4232e2['query']);_0x2e34b4[_0x8dba('0x39')]=_[_0x8dba('0x3a')](_0x2e34b4['model'],_0x2e34b4[_0x8dba('0x37')]);_0x3c0e83[_0x8dba('0x3b')]=_[_0x8dba('0x3a')](_0x2e34b4[_0x8dba('0x36')],qs[_0x8dba('0x3c')](_0x4232e2[_0x8dba('0x37')][_0x8dba('0x3c')]));_0x3c0e83['attributes']=_0x3c0e83['attributes']['length']?_0x3c0e83[_0x8dba('0x3b')]:_0x2e34b4[_0x8dba('0x36')];if(!_0x4232e2[_0x8dba('0x37')][_0x8dba('0x3d')]('nolimit')){_0x3c0e83[_0x8dba('0x1f')]=qs[_0x8dba('0x1f')](_0x4232e2['query'][_0x8dba('0x1f')]);_0x3c0e83[_0x8dba('0x1e')]=qs['offset'](_0x4232e2['query'][_0x8dba('0x1e')]);}_0x3c0e83[_0x8dba('0x3e')]=qs[_0x8dba('0x3f')](_0x4232e2['query']['sort']);_0x3c0e83[_0x8dba('0x40')]=qs[_0x8dba('0x39')](_[_0x8dba('0x41')](_0x4232e2[_0x8dba('0x37')],_0x2e34b4['filters']),_0x1039f7);if(_0x4232e2['query']['filter']){_0x3c0e83['where']=_[_0x8dba('0x42')](_0x3c0e83['where'],{'$or':_['map'](_0x1039f7,function(_0x1afb28){if(_0x1afb28[_0x8dba('0x34')]!==_0x8dba('0x43')){var _0x4a2a6a={};_0x4a2a6a[_0x1afb28[_0x8dba('0x2d')]]={'$like':'%'+_0x4232e2['query'][_0x8dba('0x44')]+'%'};return _0x4a2a6a;}})});}_0x3c0e83=_[_0x8dba('0x42')]({},_0x3c0e83,_0x4232e2[_0x8dba('0x45')]);var _0x541a34={'where':_0x3c0e83[_0x8dba('0x40')]};return db['MailQueue'][_0x8dba('0x21')](_0x541a34)[_0x8dba('0x2a')](function(_0x6d3d87){_0x2d04c4[_0x8dba('0x21')]=_0x6d3d87;if(_0x4232e2[_0x8dba('0x37')]['includeAll']){_0x3c0e83[_0x8dba('0x46')]=[{'all':!![]}];}return db[_0x8dba('0x31')][_0x8dba('0x47')](_0x3c0e83);})[_0x8dba('0x2a')](function(_0x7ef9e9){_0x2d04c4[_0x8dba('0x48')]=_0x7ef9e9;return _0x2d04c4;})['then'](respondWithFilteredResult(_0x2c346a,_0x3c0e83))[_0x8dba('0x49')](handleError(_0x2c346a,null));};exports[_0x8dba('0x4a')]=function(_0x237949,_0x5ba4e2){var _0x3e3006={'raw':!![],'where':{'id':_0x237949[_0x8dba('0x4b')]['id']}},_0x46ac91={};_0x46ac91[_0x8dba('0x36')]=_[_0x8dba('0x38')](db[_0x8dba('0x31')][_0x8dba('0x32')]);_0x46ac91['query']=_[_0x8dba('0x38')](_0x237949['query']);_0x46ac91[_0x8dba('0x39')]=_[_0x8dba('0x3a')](_0x46ac91['model'],_0x46ac91['query']);_0x3e3006[_0x8dba('0x3b')]=_[_0x8dba('0x3a')](_0x46ac91['model'],qs['fields'](_0x237949[_0x8dba('0x37')][_0x8dba('0x3c')]));_0x3e3006['attributes']=_0x3e3006[_0x8dba('0x3b')][_0x8dba('0x4c')]?_0x3e3006[_0x8dba('0x3b')]:_0x46ac91['model'];if(_0x237949[_0x8dba('0x37')][_0x8dba('0x4d')]){_0x3e3006['include']=[{'all':!![]}];}_0x3e3006=_[_0x8dba('0x42')]({},_0x3e3006,_0x237949[_0x8dba('0x45')]);return db[_0x8dba('0x31')]['find'](_0x3e3006)[_0x8dba('0x2a')](handleEntityNotFound(_0x5ba4e2,null))[_0x8dba('0x2a')](respondWithResult(_0x5ba4e2,null))['catch'](handleError(_0x5ba4e2,null));};exports['create']=function(_0x305369,_0x3615c7){return db[_0x8dba('0x31')][_0x8dba('0x4e')](_0x305369[_0x8dba('0x4f')],{})[_0x8dba('0x2a')](function(_0x7324e4){var _0x4a0345=_0x305369[_0x8dba('0x50')][_0x8dba('0x26')]({'plain':!![]});if(!_0x4a0345)throw new Error(_0x8dba('0x51'));if(_0x4a0345['role']==='user'){var _0xf95055=_0x7324e4[_0x8dba('0x26')]({'plain':!![]});var _0x43c282=_0x8dba('0x27');return db[_0x8dba('0x52')][_0x8dba('0x53')]({'where':{'name':_0x43c282,'userProfileId':_0x4a0345[_0x8dba('0x54')]},'raw':!![]})[_0x8dba('0x2a')](function(_0x449872){if(_0x449872&&_0x449872[_0x8dba('0x55')]===0x0){return db[_0x8dba('0x28')][_0x8dba('0x4e')]({'name':_0xf95055[_0x8dba('0x2d')],'resourceId':_0xf95055['id'],'type':_0x449872[_0x8dba('0x2d')],'sectionId':_0x449872['id']},{})[_0x8dba('0x2a')](function(){return _0x7324e4;});}else{return _0x7324e4;}})[_0x8dba('0x49')](function(_0x28650e){logger[_0x8dba('0x2c')](_0x8dba('0x56'),_0x28650e);throw _0x28650e;});}return _0x7324e4;})[_0x8dba('0x2a')](respondWithResult(_0x3615c7,0xc9))[_0x8dba('0x49')](handleError(_0x3615c7,null));};exports['update']=function(_0x3b4443,_0x27094d){if(_0x3b4443['body']['id']){delete _0x3b4443[_0x8dba('0x4f')]['id'];}return db[_0x8dba('0x31')][_0x8dba('0x53')]({'where':{'id':_0x3b4443[_0x8dba('0x4b')]['id']}})[_0x8dba('0x2a')](handleEntityNotFound(_0x27094d,null))[_0x8dba('0x2a')](saveUpdates(_0x3b4443[_0x8dba('0x4f')],null))['then'](respondWithResult(_0x27094d,null))[_0x8dba('0x49')](handleError(_0x27094d,null));};exports[_0x8dba('0x29')]=function(_0x500c58,_0x3b35ef){return db['MailQueue'][_0x8dba('0x53')]({'where':{'id':_0x500c58['params']['id']}})['then'](handleEntityNotFound(_0x3b35ef,null))[_0x8dba('0x2a')](removeEntity(_0x3b35ef,null))[_0x8dba('0x49')](handleError(_0x3b35ef,null));};exports['describe']=function(_0x46863c,_0x13183e){return db[_0x8dba('0x31')][_0x8dba('0x57')]()[_0x8dba('0x2a')](respondWithResult(_0x13183e,null))['catch'](handleError(_0x13183e,null));};exports[_0x8dba('0x58')]=function(_0x55e44a,_0x6c6c7e,_0x24c5f1){var _0x3833dd={'raw':!![],'where':{}},_0x3af9d0={},_0x2021ea;return db[_0x8dba('0x31')][_0x8dba('0x59')]({'where':{'id':_0x55e44a[_0x8dba('0x4b')]['id']}})['then'](handleEntityNotFound(_0x6c6c7e,null))[_0x8dba('0x2a')](function(_0x3b4ed1){if(_0x3b4ed1){_0x2021ea=_0x3b4ed1[_0x8dba('0x26')]({'plain':!![]});_0x3af9d0[_0x8dba('0x36')]=_['keys'](db[_0x8dba('0x5a')][_0x8dba('0x32')]);_0x3af9d0[_0x8dba('0x37')]=_['keys'](_0x55e44a[_0x8dba('0x37')]);_0x3af9d0['filters']=_[_0x8dba('0x3a')](_0x3af9d0[_0x8dba('0x36')],_0x3af9d0['query']);_0x3833dd['attributes']=_[_0x8dba('0x3a')](_0x3af9d0[_0x8dba('0x36')],qs['fields'](_0x55e44a['query'][_0x8dba('0x3c')]));_0x3833dd[_0x8dba('0x3b')]=_0x3833dd['attributes']['length']?_0x3833dd['attributes']:_0x3af9d0['model'];if(!_0x55e44a[_0x8dba('0x37')][_0x8dba('0x3d')](_0x8dba('0x5b'))){_0x3833dd['limit']=qs[_0x8dba('0x1f')](_0x55e44a[_0x8dba('0x37')]['limit']);_0x3833dd[_0x8dba('0x1e')]=qs[_0x8dba('0x1e')](_0x55e44a['query']['offset']);}_0x3833dd[_0x8dba('0x3e')]=qs[_0x8dba('0x3f')](_0x55e44a[_0x8dba('0x37')][_0x8dba('0x3f')]);_0x3833dd[_0x8dba('0x40')]=qs[_0x8dba('0x39')](_[_0x8dba('0x41')](_0x55e44a[_0x8dba('0x37')],_0x3af9d0[_0x8dba('0x39')]));_0x3833dd[_0x8dba('0x40')]['MailQueueId']=_0x3b4ed1['id'];if(_0x55e44a[_0x8dba('0x37')]['filter']){_0x3833dd[_0x8dba('0x40')]=_[_0x8dba('0x42')](_0x3833dd[_0x8dba('0x40')],{'$or':_['map'](_0x3833dd[_0x8dba('0x3b')],function(_0x1550b2){var _0x31b7d7={};_0x31b7d7[_0x1550b2]={'$like':'%'+_0x55e44a[_0x8dba('0x37')][_0x8dba('0x44')]+'%'};return _0x31b7d7;})});}_0x3833dd=_[_0x8dba('0x42')]({},_0x3833dd,_0x55e44a[_0x8dba('0x45')]);return db[_0x8dba('0x5a')][_0x8dba('0x47')](_0x3833dd);}})['then'](function(_0x36f242){if(_0x36f242){return db['User']['findAndCountAll']({'where':{'id':_[_0x8dba('0x30')](_0x36f242,_0x8dba('0x5c')),'role':_0x8dba('0x5d')},'attributes':['id',_0x8dba('0x2d'),_0x8dba('0x5e'),_0x8dba('0x5f'),_0x8dba('0x60')]});}})[_0x8dba('0x2a')](function(_0xa22fa5){if(_0xa22fa5){return{'count':_0xa22fa5['count'],'rows':_[_0x8dba('0x30')](_0xa22fa5[_0x8dba('0x48')],function(_0x2aa364){return{'membername':_0x2aa364[_0x8dba('0x2d')],'UserId':_0x2aa364['id'],'queue_name':_0x2021ea[_0x8dba('0x2d')],'MailQueueId':_0x2021ea['id'],'interface':util['format'](_0x8dba('0x61'),_0x8dba('0x62'),_0x2aa364[_0x8dba('0x2d')]),'penalty':0x0,'paused':_0x2aa364['mailPause'],'createdAt':_0x2aa364[_0x8dba('0x60')],'updatedAt':_0x2aa364[_0x8dba('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8dba('0x2a')](respondWithFilteredResult(_0x6c6c7e,_0x3833dd))['catch'](handleError(_0x6c6c7e,null));};exports[_0x8dba('0x63')]=function(_0x35c80b,_0x5dfa1c,_0x2ed84c){var _0x40aa78={};var _0x3bedee={};var _0x58d207;var _0x25c236;return db[_0x8dba('0x31')][_0x8dba('0x59')]({'where':{'id':_0x35c80b[_0x8dba('0x4b')]['id']}})[_0x8dba('0x2a')](handleEntityNotFound(_0x5dfa1c,null))['then'](function(_0x453622){if(_0x453622){_0x58d207=_0x453622;_0x3bedee['model']=_[_0x8dba('0x38')](db[_0x8dba('0x64')][_0x8dba('0x32')]);_0x3bedee[_0x8dba('0x37')]=_[_0x8dba('0x38')](_0x35c80b[_0x8dba('0x37')]);_0x3bedee[_0x8dba('0x39')]=_['intersection'](_0x3bedee[_0x8dba('0x36')],_0x3bedee['query']);_0x40aa78[_0x8dba('0x3b')]=_[_0x8dba('0x3a')](_0x3bedee[_0x8dba('0x36')],qs[_0x8dba('0x3c')](_0x35c80b[_0x8dba('0x37')][_0x8dba('0x3c')]));_0x40aa78['attributes']=_0x40aa78['attributes']['length']?_0x40aa78[_0x8dba('0x3b')]:_0x3bedee[_0x8dba('0x36')];_0x40aa78['order']=qs[_0x8dba('0x3f')](_0x35c80b[_0x8dba('0x37')][_0x8dba('0x3f')]);_0x40aa78[_0x8dba('0x40')]=qs['filters'](_[_0x8dba('0x41')](_0x35c80b[_0x8dba('0x37')],_0x3bedee['filters']));if(_0x35c80b['query']['filter']){_0x40aa78[_0x8dba('0x40')]=_['merge'](_0x40aa78[_0x8dba('0x40')],{'$or':_[_0x8dba('0x30')](_0x40aa78[_0x8dba('0x3b')],function(_0x2c36b2){var _0x4e7454={};_0x4e7454[_0x2c36b2]={'$like':'%'+_0x35c80b[_0x8dba('0x37')][_0x8dba('0x44')]+'%'};return _0x4e7454;})});}_0x40aa78=_[_0x8dba('0x42')]({},_0x40aa78,_0x35c80b[_0x8dba('0x45')]);return _0x58d207[_0x8dba('0x63')](_0x40aa78);}})['then'](function(_0x3d49b3){if(_0x3d49b3){_0x25c236=_0x3d49b3[_0x8dba('0x4c')];if(!_0x35c80b['query']['hasOwnProperty'](_0x8dba('0x5b'))){_0x40aa78['limit']=qs[_0x8dba('0x1f')](_0x35c80b[_0x8dba('0x37')][_0x8dba('0x1f')]);_0x40aa78[_0x8dba('0x1e')]=qs['offset'](_0x35c80b['query']['offset']);}return _0x58d207[_0x8dba('0x63')](_0x40aa78);}})[_0x8dba('0x2a')](function(_0x21e1cb){if(_0x21e1cb){return _0x21e1cb?{'count':_0x25c236,'rows':_0x21e1cb}:null;}})[_0x8dba('0x2a')](respondWithResult(_0x5dfa1c,null))[_0x8dba('0x49')](handleError(_0x5dfa1c,null));};exports[_0x8dba('0x65')]=function(_0x572e16,_0x240355,_0x35c9f8){var _0x3523f2=_0x572e16[_0x8dba('0x4f')][_0x8dba('0x66')];return db[_0x8dba('0x64')]['findAll']({'where':{'id':_0x3523f2},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x8dba('0x67'),_0x8dba('0x68'),_0x8dba('0x69')],'raw':!![]}]})[_0x8dba('0x2a')](function(_0xe2aa1d){if(_0xe2aa1d){var _0x27f2ba=_[_0x8dba('0x6a')](_0xe2aa1d,function(_0x482c81){var _0x1d5bfa=_0x482c81['get']({'plain':!![]});return _0x1d5bfa[_0x8dba('0x6b')];});return db[_0x8dba('0x31')]['find']({'where':{'id':_0x572e16[_0x8dba('0x4b')]['id']}})[_0x8dba('0x2a')](function(_0x4ec9a6){return db['sequelize'][_0x8dba('0x6c')](function(_0x46978c){return _0x4ec9a6['addTeams'](_0x3523f2,{'transaction':_0x46978c})['then'](function(){return BPromise['each'](_0x27f2ba,function(_0x12933f){return db['UserMailQueue'][_0x8dba('0x6d')]({'where':{'UserId':_0x12933f['id'],'MailQueueId':_0x572e16[_0x8dba('0x4b')]['id']},'transaction':_0x46978c});});})[_0x8dba('0x2a')](function(){_0x27f2ba[_0x8dba('0x6e')](function(_0x4aa82b){socket[_0x8dba('0x6f')](_0x8dba('0x70'),{'UserId':_0x4aa82b['id'],'MailQueueId':_0x4ec9a6['id']});});});});});}})['then'](respondWithStatusCode(_0x240355,null))[_0x8dba('0x49')](handleError(_0x240355,null));};exports[_0x8dba('0x71')]=function(_0x2611c7,_0x29d033,_0x54bfd1){return db[_0x8dba('0x64')][_0x8dba('0x47')]({'where':{'id':_0x2611c7[_0x8dba('0x37')][_0x8dba('0x66')]},'attributes':['id'],'include':[{'model':db[_0x8dba('0x72')],'as':_0x8dba('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x8dba('0x2a')](handleEntityNotFound(_0x29d033,null))[_0x8dba('0x2a')](function(_0xf4379c){var _0x4ea2df=_[_0x8dba('0x30')](_0xf4379c,'id');var _0x16c1d7=[];var _0x2a587c=[];var _0x5b7497=squel[_0x8dba('0x73')]();_0x5b7497['field']('tq.TeamId')[_0x8dba('0x74')](_0x8dba('0x75'),'tq')[_0x8dba('0x76')]('user_has_teams','ut',_0x8dba('0x77'))[_0x8dba('0x40')](_0x8dba('0x78'),_0x2611c7[_0x8dba('0x4b')]['id']);for(var _0x22ea4c=0x0;_0x22ea4c<_0xf4379c['length'];_0x22ea4c+=0x1){let _0x398422=_0xf4379c[_0x22ea4c];for(var _0x35ad8f=0x0;_0x35ad8f<_0x398422[_0x8dba('0x6b')][_0x8dba('0x4c')];_0x35ad8f+=0x1){let _0xc27ec6=_0x398422[_0x8dba('0x6b')][_0x35ad8f];var _0x51987c=_0x5b7497[_0x8dba('0x79')]();_0x51987c['where']('ut.UserId\x20=\x20?',_0xc27ec6['id']);_0x2a587c[_0x8dba('0x7a')](db[_0x8dba('0x7b')][_0x8dba('0x37')](_0x51987c[_0x8dba('0x7c')](),{'type':db[_0x8dba('0x7b')][_0x8dba('0x7d')]['SELECT']})['then'](function(_0x1cade0){if(_0x1cade0['length']===0x1){return _0xc27ec6['id'];}else{var _0x25def1=_[_0x8dba('0x7e')](_[_0x8dba('0x30')](_0x1cade0,_0x8dba('0x7f')),function(_0x2ed271){return _['includes'](_0x4ea2df,_0x2ed271);});if(_0x25def1){return _0xc27ec6['id'];}}}));}}return BPromise[_0x8dba('0x80')](_0x2a587c)[_0x8dba('0x2a')](function(_0x49974c){_0x16c1d7=_(_0x16c1d7)[_0x8dba('0x81')](_0x49974c)[_0x8dba('0x82')]()[_0x8dba('0x83')]();return db[_0x8dba('0x31')]['find']({'where':{'id':_0x2611c7[_0x8dba('0x4b')]['id']}})[_0x8dba('0x2a')](function(_0xac80ec){return db[_0x8dba('0x7b')]['transaction'](function(_0x5af9bb){return _0xac80ec[_0x8dba('0x71')](_0x2611c7[_0x8dba('0x37')][_0x8dba('0x66')],{'transaction':_0x5af9bb})['then'](function(){if(!_[_0x8dba('0x84')](_0x16c1d7)){return _0xac80ec[_0x8dba('0x85')](_0x16c1d7,{'transaction':_0x5af9bb});}})[_0x8dba('0x2a')](function(){_0x16c1d7[_0x8dba('0x6e')](function(_0xbf7d4f){socket[_0x8dba('0x6f')](_0x8dba('0x86'),{'UserId':_0xbf7d4f,'MailQueueId':_0xac80ec['id']});});});});});});})[_0x8dba('0x2a')](respondWithStatusCode(_0x29d033,null))[_0x8dba('0x49')](handleError(_0x29d033,null));};exports[_0x8dba('0x87')]=function(_0x4976ff,_0x56ebb9,_0x13d643){return db['MailQueue']['find']({'where':{'id':_0x4976ff[_0x8dba('0x4b')]['id']}})[_0x8dba('0x2a')](handleEntityNotFound(_0x56ebb9,null))[_0x8dba('0x2a')](function(_0x5bf1ba){if(_0x5bf1ba){return _0x5bf1ba[_0x8dba('0x87')](_0x4976ff['body']['ids'],_[_0x8dba('0x88')](_0x4976ff[_0x8dba('0x4f')],[_0x8dba('0x66'),'id'])||{})[_0x8dba('0x89')](function(_0xaee8e4){for(var _0x1870c1=0x0;_0x1870c1<_0x4976ff['body']['ids'][_0x8dba('0x4c')];_0x1870c1+=0x1){socket['emit'](_0x8dba('0x70'),{'UserId':Number(_0x4976ff[_0x8dba('0x4f')][_0x8dba('0x66')][_0x1870c1]),'MailQueueId':Number(_0x4976ff[_0x8dba('0x4b')]['id'])});}return _0xaee8e4;});}})[_0x8dba('0x2a')](respondWithResult(_0x56ebb9,null))[_0x8dba('0x49')](handleError(_0x56ebb9,null));};exports[_0x8dba('0x85')]=function(_0x31baeb,_0x1ad781,_0x520b7b){return db[_0x8dba('0x31')][_0x8dba('0x53')]({'where':{'id':_0x31baeb[_0x8dba('0x4b')]['id']}})[_0x8dba('0x2a')](handleEntityNotFound(_0x1ad781,null))[_0x8dba('0x2a')](function(_0x5a539c){if(_0x5a539c){return _0x5a539c[_0x8dba('0x85')](_0x31baeb[_0x8dba('0x37')][_0x8dba('0x66')])[_0x8dba('0x2a')](function(){if(_['isArray'](_0x31baeb[_0x8dba('0x37')][_0x8dba('0x66')])){for(var _0x5ba5a4=0x0;_0x5ba5a4<_0x31baeb[_0x8dba('0x37')][_0x8dba('0x66')][_0x8dba('0x4c')];_0x5ba5a4+=0x1){socket[_0x8dba('0x6f')](_0x8dba('0x86'),{'UserId':Number(_0x31baeb['query'][_0x8dba('0x66')][_0x5ba5a4]),'MailQueueId':Number(_0x31baeb[_0x8dba('0x4b')]['id'])});}}else{socket['emit'](_0x8dba('0x86'),{'UserId':Number(_0x31baeb['query']['ids']),'MailQueueId':Number(_0x31baeb[_0x8dba('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x1ad781,null))[_0x8dba('0x49')](handleError(_0x1ad781,null));};exports[_0x8dba('0x8a')]=function(_0x55e6ee,_0x358196,_0x400596){var _0x2bcfb9={};var _0x19ab8a={};var _0x3039ee;var _0x3ec32b;return db['MailQueue'][_0x8dba('0x59')]({'where':{'id':_0x55e6ee[_0x8dba('0x4b')]['id']}})[_0x8dba('0x2a')](handleEntityNotFound(_0x358196,null))[_0x8dba('0x2a')](function(_0x4c76c7){if(_0x4c76c7){_0x3039ee=_0x4c76c7;_0x19ab8a[_0x8dba('0x36')]=_[_0x8dba('0x38')](db[_0x8dba('0x72')][_0x8dba('0x32')]);_0x19ab8a[_0x8dba('0x37')]=_[_0x8dba('0x38')](_0x55e6ee[_0x8dba('0x37')]);_0x19ab8a[_0x8dba('0x39')]=_['intersection'](_0x19ab8a[_0x8dba('0x36')],_0x19ab8a[_0x8dba('0x37')]);_0x2bcfb9[_0x8dba('0x3b')]=_[_0x8dba('0x3a')](_0x19ab8a[_0x8dba('0x36')],qs[_0x8dba('0x3c')](_0x55e6ee['query'][_0x8dba('0x3c')]));_0x2bcfb9[_0x8dba('0x3b')]=_0x2bcfb9[_0x8dba('0x3b')][_0x8dba('0x4c')]?_0x2bcfb9[_0x8dba('0x3b')]:_0x19ab8a[_0x8dba('0x36')];_0x2bcfb9[_0x8dba('0x3e')]=qs['sort'](_0x55e6ee['query'][_0x8dba('0x3f')]);_0x2bcfb9['where']=qs[_0x8dba('0x39')](_[_0x8dba('0x41')](_0x55e6ee['query'],_0x19ab8a[_0x8dba('0x39')]));if(_0x55e6ee['query'][_0x8dba('0x44')]){_0x2bcfb9[_0x8dba('0x40')]=_[_0x8dba('0x42')](_0x2bcfb9['where'],{'$or':_[_0x8dba('0x30')](_0x2bcfb9[_0x8dba('0x3b')],function(_0x14f41e){var _0x7b70f9={};_0x7b70f9[_0x14f41e]={'$like':'%'+_0x55e6ee['query']['filter']+'%'};return _0x7b70f9;})});}_0x2bcfb9=_[_0x8dba('0x42')]({},_0x2bcfb9,_0x55e6ee[_0x8dba('0x45')]);return _0x3039ee[_0x8dba('0x8a')](_0x2bcfb9);}})[_0x8dba('0x2a')](function(_0x10846a){if(_0x10846a){_0x3ec32b=_0x10846a['length'];if(!_0x55e6ee[_0x8dba('0x37')][_0x8dba('0x3d')]('nolimit')){_0x2bcfb9[_0x8dba('0x1f')]=qs[_0x8dba('0x1f')](_0x55e6ee[_0x8dba('0x37')][_0x8dba('0x1f')]);_0x2bcfb9['offset']=qs['offset'](_0x55e6ee['query'][_0x8dba('0x1e')]);}return _0x3039ee[_0x8dba('0x8a')](_0x2bcfb9);}})[_0x8dba('0x2a')](function(_0x360797){if(_0x360797){return _0x360797?{'count':_0x3ec32b,'rows':_0x360797}:null;}})[_0x8dba('0x2a')](respondWithResult(_0x358196,null))[_0x8dba('0x49')](handleError(_0x358196,null));};
\ No newline at end of file
index 4099f33..d1dc511 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c09=['remove','emit','hasOwnProperty','exports','MailQueue','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c09,0x1e7));var _0x90c0=function(_0x4ff677,_0x188382){_0x4ff677=_0x4ff677-0x0;var _0x47a535=_0x0c09[_0x4ff677];return _0x47a535;};'use strict';var EventEmitter=require('events');var MailQueue=require('../../mysqldb')['db'][_0x90c0('0x0')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x90c0('0x1'),'afterUpdate':_0x90c0('0x2'),'afterDestroy':_0x90c0('0x3')};function emitEvent(_0x45e53f){return function(_0x468ed1,_0x479959,_0x24e05e){MailQueueEvents[_0x90c0('0x4')](_0x45e53f+':'+_0x468ed1['id'],_0x468ed1);MailQueueEvents[_0x90c0('0x4')](_0x45e53f,_0x468ed1);_0x24e05e(null);};}for(var e in events){if(events[_0x90c0('0x5')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x90c0('0x6')]=MailQueueEvents;
\ No newline at end of file
+var _0xf80c=['remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update'];(function(_0x2dce30,_0x15ef19){var _0x47d3d6=function(_0x43a463){while(--_0x43a463){_0x2dce30['push'](_0x2dce30['shift']());}};_0x47d3d6(++_0x15ef19);}(_0xf80c,0xd4));var _0xcf80=function(_0x22c381,_0x33b1c9){_0x22c381=_0x22c381-0x0;var _0x38b357=_0xf80c[_0x22c381];return _0x38b357;};'use strict';var EventEmitter=require(_0xcf80('0x0'));var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xcf80('0x1')](0x0);var events={'afterCreate':_0xcf80('0x2'),'afterUpdate':_0xcf80('0x3'),'afterDestroy':_0xcf80('0x4')};function emitEvent(_0xd2a09){return function(_0x2c15c0,_0x54b2cb,_0xff29bb){MailQueueEvents[_0xcf80('0x5')](_0xd2a09+':'+_0x2c15c0['id'],_0x2c15c0);MailQueueEvents[_0xcf80('0x5')](_0xd2a09,_0x2c15c0);_0xff29bb(null);};}for(var e in events){if(events[_0xcf80('0x6')](e)){var event=events[e];MailQueue[_0xcf80('0x7')](e,emitEvent(event));}}module[_0xcf80('0x8')]=MailQueueEvents;
\ No newline at end of file
index fe8bd87..2196f6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe400=['MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','define'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe400,0x1d3));var _0x0e40=function(_0x58ab31,_0x1007c1){_0x58ab31=_0x58ab31-0x0;var _0x26bc8c=_0xe400[_0x58ab31];return _0x26bc8c;};'use strict';var _=require(_0x0e40('0x0'));var util=require(_0x0e40('0x1'));var logger=require(_0x0e40('0x2'))(_0x0e40('0x3'));var moment=require(_0x0e40('0x4'));var BPromise=require(_0x0e40('0x5'));var rp=require(_0x0e40('0x6'));var fs=require('fs');var path=require(_0x0e40('0x7'));var rimraf=require(_0x0e40('0x8'));var config=require(_0x0e40('0x9'));var attributes=require(_0x0e40('0xa'));module[_0x0e40('0xb')]=function(_0x40142e,_0x34b511){return _0x40142e[_0x0e40('0xc')](_0x0e40('0xd'),attributes,{'tableName':_0x0e40('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4973=['mail_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','define','MailQueue'];(function(_0xba0402,_0x57e78e){var _0x2c224a=function(_0x334925){while(--_0x334925){_0xba0402['push'](_0xba0402['shift']());}};_0x2c224a(++_0x57e78e);}(_0x4973,0x9d));var _0x3497=function(_0x2efa92,_0x2557f6){_0x2efa92=_0x2efa92-0x0;var _0x32704b=_0x4973[_0x2efa92];return _0x32704b;};'use strict';var _=require(_0x3497('0x0'));var util=require(_0x3497('0x1'));var logger=require('../../config/logger')(_0x3497('0x2'));var moment=require(_0x3497('0x3'));var BPromise=require(_0x3497('0x4'));var rp=require(_0x3497('0x5'));var fs=require('fs');var path=require(_0x3497('0x6'));var rimraf=require(_0x3497('0x7'));var config=require(_0x3497('0x8'));var attributes=require(_0x3497('0x9'));module['exports']=function(_0x5a1114,_0x2b94f9){return _0x5a1114[_0x3497('0xa')](_0x3497('0xb'),attributes,{'tableName':_0x3497('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c2af246..919acc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d4d=['code','message','result','catch','GetMailQueue','MailQueue','options','raw','where','attributes','limit','include','map','model','ShowMailQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x191460,_0x16a0cb){var _0x49eeaa=function(_0x3673fa){while(--_0x3673fa){_0x191460['push'](_0x191460['shift']());}};_0x49eeaa(++_0x16a0cb);}(_0x7d4d,0x18a));var _0xd7d4=function(_0xe501ff,_0x955b7e){_0xe501ff=_0xe501ff-0x0;var _0x17135d=_0x7d4d[_0xe501ff];return _0x17135d;};'use strict';var _=require('lodash');var util=require(_0xd7d4('0x0'));var moment=require(_0xd7d4('0x1'));var BPromise=require(_0xd7d4('0x2'));var rs=require(_0xd7d4('0x3'));var fs=require('fs');var Redis=require(_0xd7d4('0x4'));var db=require(_0xd7d4('0x5'))['db'];var utils=require(_0xd7d4('0x6'));var logger=require(_0xd7d4('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd7d4('0x8'));var client=jayson[_0xd7d4('0x9')][_0xd7d4('0xa')]({'port':0x232a});config['redis']=_[_0xd7d4('0xb')](config[_0xd7d4('0xc')],{'host':_0xd7d4('0xd'),'port':0x18eb});var socket=require(_0xd7d4('0xe'))(new Redis(config[_0xd7d4('0xc')]));require(_0xd7d4('0xf'))[_0xd7d4('0x10')](socket);function respondWithRpcPromise(_0x47e13b,_0x432c1e,_0x2abc03){return new BPromise(function(_0x3fe95,_0x7cfc45){return client[_0xd7d4('0x11')](_0x47e13b,_0x2abc03)[_0xd7d4('0x12')](function(_0x40c38a){logger[_0xd7d4('0x13')](_0xd7d4('0x14'),_0x432c1e,'request\x20sent');logger[_0xd7d4('0x15')](_0xd7d4('0x16'),_0x432c1e,_0xd7d4('0x17'),JSON[_0xd7d4('0x18')](_0x40c38a));if(_0x40c38a[_0xd7d4('0x19')]){if(_0x40c38a[_0xd7d4('0x19')][_0xd7d4('0x1a')]===0x1f4){logger[_0xd7d4('0x19')]('MailQueue,\x20%s,\x20%s',_0x432c1e,_0x40c38a[_0xd7d4('0x19')][_0xd7d4('0x1b')]);return _0x7cfc45(_0x40c38a[_0xd7d4('0x19')][_0xd7d4('0x1b')]);}logger[_0xd7d4('0x19')](_0xd7d4('0x14'),_0x432c1e,_0x40c38a['error']['message']);return _0x3fe95(_0x40c38a['error']['message']);}else{logger[_0xd7d4('0x13')](_0xd7d4('0x14'),_0x432c1e,_0xd7d4('0x17'));_0x3fe95(_0x40c38a[_0xd7d4('0x1c')][_0xd7d4('0x1b')]);}})[_0xd7d4('0x1d')](function(_0x1bd27e){logger[_0xd7d4('0x19')](_0xd7d4('0x14'),_0x432c1e,_0x1bd27e);_0x7cfc45(_0x1bd27e);});});}exports[_0xd7d4('0x1e')]=function(_0x30e7d1){var _0x1ed3d6=this;return new Promise(function(_0x1bf200,_0x5ea54e){return db[_0xd7d4('0x1f')]['findAll']({'raw':_0x30e7d1['options']?_0x30e7d1[_0xd7d4('0x20')][_0xd7d4('0x21')]===undefined?!![]:![]:!![],'where':_0x30e7d1[_0xd7d4('0x20')]?_0x30e7d1[_0xd7d4('0x20')][_0xd7d4('0x22')]||null:null,'attributes':_0x30e7d1[_0xd7d4('0x20')]?_0x30e7d1[_0xd7d4('0x20')][_0xd7d4('0x23')]||null:null,'limit':_0x30e7d1[_0xd7d4('0x20')]?_0x30e7d1[_0xd7d4('0x20')][_0xd7d4('0x24')]||null:null,'include':_0x30e7d1[_0xd7d4('0x20')]?_0x30e7d1['options'][_0xd7d4('0x25')]?_[_0xd7d4('0x26')](_0x30e7d1['options']['include'],function(_0x71d327){return{'model':db[_0x71d327[_0xd7d4('0x27')]],'as':_0x71d327['as'],'attributes':_0x71d327[_0xd7d4('0x23')],'include':_0x71d327[_0xd7d4('0x25')]?_[_0xd7d4('0x26')](_0x71d327[_0xd7d4('0x25')],function(_0xbbee5b){return{'model':db[_0xbbee5b[_0xd7d4('0x27')]],'as':_0xbbee5b['as'],'attributes':_0xbbee5b[_0xd7d4('0x23')],'include':_0xbbee5b[_0xd7d4('0x25')]?_['map'](_0xbbee5b['include'],function(_0x4c03d1){return{'model':db[_0x4c03d1[_0xd7d4('0x27')]],'as':_0x4c03d1['as'],'attributes':_0x4c03d1[_0xd7d4('0x23')]};}):[]};}):[]};}):[]:[]})[_0xd7d4('0x12')](function(_0xae1e18){logger[_0xd7d4('0x13')](_0xd7d4('0x1e'),_0x30e7d1);logger[_0xd7d4('0x15')]('GetMailQueue',_0x30e7d1,JSON[_0xd7d4('0x18')](_0xae1e18));_0x1bf200(_0xae1e18);})[_0xd7d4('0x1d')](function(_0xefbf3){logger[_0xd7d4('0x19')](_0xd7d4('0x1e'),_0xefbf3['message'],_0x30e7d1);_0x5ea54e(_0x1ed3d6['error'](0x1f4,_0xefbf3[_0xd7d4('0x1b')]));});});};exports[_0xd7d4('0x28')]=function(_0x2eb18d){var _0x505599=this;return new Promise(function(_0x3e5265,_0x56cf19){return db[_0xd7d4('0x1f')][_0xd7d4('0x29')]({'raw':_0x2eb18d[_0xd7d4('0x20')]?_0x2eb18d['options'][_0xd7d4('0x21')]===undefined?!![]:![]:!![],'where':_0x2eb18d[_0xd7d4('0x20')]?_0x2eb18d[_0xd7d4('0x20')]['where']||null:null,'attributes':_0x2eb18d[_0xd7d4('0x20')]?_0x2eb18d[_0xd7d4('0x20')]['attributes']||null:null,'include':_0x2eb18d[_0xd7d4('0x20')]?_0x2eb18d[_0xd7d4('0x20')][_0xd7d4('0x25')]?_[_0xd7d4('0x26')](_0x2eb18d[_0xd7d4('0x20')][_0xd7d4('0x25')],function(_0x346cbf){return{'model':db[_0x346cbf[_0xd7d4('0x27')]],'as':_0x346cbf['as'],'attributes':_0x346cbf[_0xd7d4('0x23')],'include':_0x346cbf[_0xd7d4('0x25')]?_[_0xd7d4('0x26')](_0x346cbf[_0xd7d4('0x25')],function(_0x4a7013){return{'model':db[_0x4a7013[_0xd7d4('0x27')]],'as':_0x4a7013['as'],'attributes':_0x4a7013[_0xd7d4('0x23')],'include':_0x4a7013[_0xd7d4('0x25')]?_[_0xd7d4('0x26')](_0x4a7013['include'],function(_0x634ed3){return{'model':db[_0x634ed3[_0xd7d4('0x27')]],'as':_0x634ed3['as'],'attributes':_0x634ed3['attributes']};}):[]};}):[]};}):[]:[]})[_0xd7d4('0x12')](function(_0x5cf957){logger['info'](_0xd7d4('0x28'),_0x2eb18d);logger[_0xd7d4('0x15')]('ShowMailQueue',_0x2eb18d,JSON['stringify'](_0x5cf957));_0x3e5265(_0x5cf957);})['catch'](function(_0x1fd7c0){logger['error'](_0xd7d4('0x28'),_0x1fd7c0[_0xd7d4('0x1b')],_0x2eb18d);_0x56cf19(_0x505599[_0xd7d4('0x19')](0x1f4,_0x1fd7c0[_0xd7d4('0x1b')]));});});};
\ No newline at end of file
+var _0xbde2=['include','map','debug','ShowMailQueue','find','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','options','raw','where','limit','model','attributes'];(function(_0x41c388,_0x4ef179){var _0x993bb4=function(_0x426bea){while(--_0x426bea){_0x41c388['push'](_0x41c388['shift']());}};_0x993bb4(++_0x4ef179);}(_0xbde2,0x7a));var _0x2bde=function(_0x9edbb6,_0x2e56e0){_0x9edbb6=_0x9edbb6-0x0;var _0x3d855f=_0xbde2[_0x9edbb6];return _0x3d855f;};'use strict';var _=require('lodash');var util=require(_0x2bde('0x0'));var moment=require(_0x2bde('0x1'));var BPromise=require(_0x2bde('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2bde('0x3'));var db=require(_0x2bde('0x4'))['db'];var utils=require(_0x2bde('0x5'));var logger=require('../../config/logger')(_0x2bde('0x6'));var config=require(_0x2bde('0x7'));var jayson=require(_0x2bde('0x8'));var client=jayson[_0x2bde('0x9')]['http']({'port':0x232a});config[_0x2bde('0xa')]=_[_0x2bde('0xb')](config[_0x2bde('0xa')],{'host':_0x2bde('0xc'),'port':0x18eb});var socket=require(_0x2bde('0xd'))(new Redis(config[_0x2bde('0xa')]));require('./mailQueue.socket')['register'](socket);function respondWithRpcPromise(_0x4a4bf0,_0x3ae001,_0x2b9c2f){return new BPromise(function(_0xbbdbc9,_0x57c636){return client[_0x2bde('0xe')](_0x4a4bf0,_0x2b9c2f)[_0x2bde('0xf')](function(_0x10d9f4){logger[_0x2bde('0x10')](_0x2bde('0x11'),_0x3ae001,_0x2bde('0x12'));logger['debug'](_0x2bde('0x13'),_0x3ae001,'request\x20sent',JSON[_0x2bde('0x14')](_0x10d9f4));if(_0x10d9f4[_0x2bde('0x15')]){if(_0x10d9f4[_0x2bde('0x15')][_0x2bde('0x16')]===0x1f4){logger[_0x2bde('0x15')](_0x2bde('0x11'),_0x3ae001,_0x10d9f4[_0x2bde('0x15')][_0x2bde('0x17')]);return _0x57c636(_0x10d9f4[_0x2bde('0x15')][_0x2bde('0x17')]);}logger[_0x2bde('0x15')](_0x2bde('0x11'),_0x3ae001,_0x10d9f4[_0x2bde('0x15')][_0x2bde('0x17')]);return _0xbbdbc9(_0x10d9f4['error']['message']);}else{logger[_0x2bde('0x10')](_0x2bde('0x11'),_0x3ae001,_0x2bde('0x12'));_0xbbdbc9(_0x10d9f4[_0x2bde('0x18')]['message']);}})[_0x2bde('0x19')](function(_0x1679ed){logger[_0x2bde('0x15')](_0x2bde('0x11'),_0x3ae001,_0x1679ed);_0x57c636(_0x1679ed);});});}exports[_0x2bde('0x1a')]=function(_0x3c0acf){var _0x1dcdd6=this;return new Promise(function(_0x18ed23,_0x58e640){return db[_0x2bde('0x1b')]['findAll']({'raw':_0x3c0acf['options']?_0x3c0acf[_0x2bde('0x1c')][_0x2bde('0x1d')]===undefined?!![]:![]:!![],'where':_0x3c0acf[_0x2bde('0x1c')]?_0x3c0acf['options'][_0x2bde('0x1e')]||null:null,'attributes':_0x3c0acf[_0x2bde('0x1c')]?_0x3c0acf[_0x2bde('0x1c')]['attributes']||null:null,'limit':_0x3c0acf[_0x2bde('0x1c')]?_0x3c0acf[_0x2bde('0x1c')][_0x2bde('0x1f')]||null:null,'include':_0x3c0acf['options']?_0x3c0acf['options']['include']?_['map'](_0x3c0acf[_0x2bde('0x1c')]['include'],function(_0x24139d){return{'model':db[_0x24139d[_0x2bde('0x20')]],'as':_0x24139d['as'],'attributes':_0x24139d[_0x2bde('0x21')],'include':_0x24139d[_0x2bde('0x22')]?_['map'](_0x24139d[_0x2bde('0x22')],function(_0x3e9222){return{'model':db[_0x3e9222[_0x2bde('0x20')]],'as':_0x3e9222['as'],'attributes':_0x3e9222['attributes'],'include':_0x3e9222[_0x2bde('0x22')]?_[_0x2bde('0x23')](_0x3e9222[_0x2bde('0x22')],function(_0x336c7d){return{'model':db[_0x336c7d[_0x2bde('0x20')]],'as':_0x336c7d['as'],'attributes':_0x336c7d[_0x2bde('0x21')]};}):[]};}):[]};}):[]:[]})[_0x2bde('0xf')](function(_0x4d668f){logger[_0x2bde('0x10')]('GetMailQueue',_0x3c0acf);logger[_0x2bde('0x24')](_0x2bde('0x1a'),_0x3c0acf,JSON[_0x2bde('0x14')](_0x4d668f));_0x18ed23(_0x4d668f);})[_0x2bde('0x19')](function(_0x10d1b3){logger[_0x2bde('0x15')](_0x2bde('0x1a'),_0x10d1b3[_0x2bde('0x17')],_0x3c0acf);_0x58e640(_0x1dcdd6['error'](0x1f4,_0x10d1b3['message']));});});};exports[_0x2bde('0x25')]=function(_0xb2f804){var _0x3e597b=this;return new Promise(function(_0x16ee9e,_0x3b2165){return db[_0x2bde('0x1b')][_0x2bde('0x26')]({'raw':_0xb2f804['options']?_0xb2f804['options'][_0x2bde('0x1d')]===undefined?!![]:![]:!![],'where':_0xb2f804[_0x2bde('0x1c')]?_0xb2f804['options'][_0x2bde('0x1e')]||null:null,'attributes':_0xb2f804[_0x2bde('0x1c')]?_0xb2f804[_0x2bde('0x1c')][_0x2bde('0x21')]||null:null,'include':_0xb2f804['options']?_0xb2f804[_0x2bde('0x1c')][_0x2bde('0x22')]?_[_0x2bde('0x23')](_0xb2f804[_0x2bde('0x1c')][_0x2bde('0x22')],function(_0x1321ab){return{'model':db[_0x1321ab['model']],'as':_0x1321ab['as'],'attributes':_0x1321ab[_0x2bde('0x21')],'include':_0x1321ab['include']?_[_0x2bde('0x23')](_0x1321ab[_0x2bde('0x22')],function(_0xab98ba){return{'model':db[_0xab98ba[_0x2bde('0x20')]],'as':_0xab98ba['as'],'attributes':_0xab98ba['attributes'],'include':_0xab98ba[_0x2bde('0x22')]?_['map'](_0xab98ba[_0x2bde('0x22')],function(_0x28f77a){return{'model':db[_0x28f77a[_0x2bde('0x20')]],'as':_0x28f77a['as'],'attributes':_0x28f77a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x12162c){logger[_0x2bde('0x10')]('ShowMailQueue',_0xb2f804);logger[_0x2bde('0x24')]('ShowMailQueue',_0xb2f804,JSON[_0x2bde('0x14')](_0x12162c));_0x16ee9e(_0x12162c);})['catch'](function(_0x2f445d){logger[_0x2bde('0x15')](_0x2bde('0x25'),_0x2f445d['message'],_0xb2f804);_0x3b2165(_0x3e597b[_0x2bde('0x15')](0x1f4,_0x2f445d['message']));});});};
\ No newline at end of file
index ea68f26..124f889 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7871=['remove','update','emit','removeListener','register','mailQueue:','./mailQueue.events'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x7871,0xb5));var _0x1787=function(_0x166c8f,_0x518985){_0x166c8f=_0x166c8f-0x0;var _0x1791d3=_0x7871[_0x166c8f];return _0x1791d3;};'use strict';var MailQueueEvents=require(_0x1787('0x0'));var events=['save',_0x1787('0x1'),_0x1787('0x2')];function createListener(_0x31d18f,_0x3b79aa){return function(_0x404528){_0x3b79aa[_0x1787('0x3')](_0x31d18f,_0x404528);};}function removeListener(_0x15eb27,_0x526c67){return function(){MailQueueEvents[_0x1787('0x4')](_0x15eb27,_0x526c67);};}exports[_0x1787('0x5')]=function(_0x143a97){for(var _0x84bcc6=0x0,_0x314578=events['length'];_0x84bcc6<_0x314578;_0x84bcc6++){var _0x2f60c2=events[_0x84bcc6];var _0x304710=createListener(_0x1787('0x6')+_0x2f60c2,_0x143a97);MailQueueEvents['on'](_0x2f60c2,_0x304710);}};
\ No newline at end of file
+var _0x8234=['update','removeListener','length','./mailQueue.events','save','remove'];(function(_0x3ba1a4,_0x446444){var _0x563e4e=function(_0x264adb){while(--_0x264adb){_0x3ba1a4['push'](_0x3ba1a4['shift']());}};_0x563e4e(++_0x446444);}(_0x8234,0x1cb));var _0x4823=function(_0x5a5038,_0x5044c0){_0x5a5038=_0x5a5038-0x0;var _0x42cc9e=_0x8234[_0x5a5038];return _0x42cc9e;};'use strict';var MailQueueEvents=require(_0x4823('0x0'));var events=[_0x4823('0x1'),_0x4823('0x2'),_0x4823('0x3')];function createListener(_0x60a4d1,_0x859c41){return function(_0x187baa){_0x859c41['emit'](_0x60a4d1,_0x187baa);};}function removeListener(_0x17ed03,_0xc431f){return function(){MailQueueEvents[_0x4823('0x4')](_0x17ed03,_0xc431f);};}exports['register']=function(_0x1cc229){for(var _0x54f1db=0x0,_0x1cf59b=events[_0x4823('0x5')];_0x54f1db<_0x1cf59b;_0x54f1db++){var _0x4946a2=events[_0x54f1db];var _0x2a8fda=createListener('mailQueue:'+_0x4946a2,_0x1cc229);MailQueueEvents['on'](_0x4946a2,_0x2a8fda);}};
\ No newline at end of file
index 894b8ac..949b1d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb53c=['get','/:id','show','post','create','put','update','delete','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','index','/describe','isAuthenticated','describe'];(function(_0x1031ab,_0x1a69f9){var _0x3f312b=function(_0x22d587){while(--_0x22d587){_0x1031ab['push'](_0x1031ab['shift']());}};_0x3f312b(++_0x1a69f9);}(_0xb53c,0x169));var _0xcb53=function(_0x20c488,_0x188c7a){_0x20c488=_0x20c488-0x0;var _0x5a0816=_0xb53c[_0x20c488];return _0x5a0816;};'use strict';var multer=require(_0xcb53('0x0'));var util=require('util');var path=require(_0xcb53('0x1'));var timeout=require('connect-timeout');var express=require(_0xcb53('0x2'));var router=express[_0xcb53('0x3')]();var fs_extra=require(_0xcb53('0x4'));var auth=require(_0xcb53('0x5'));var interaction=require(_0xcb53('0x6'));var config=require(_0xcb53('0x7'));var controller=require(_0xcb53('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xcb53('0x9')]);router['get'](_0xcb53('0xa'),auth[_0xcb53('0xb')](),controller[_0xcb53('0xc')]);router[_0xcb53('0xd')](_0xcb53('0xe'),auth[_0xcb53('0xb')](),controller[_0xcb53('0xf')]);router[_0xcb53('0x10')]('/',auth[_0xcb53('0xb')](),controller[_0xcb53('0x11')]);router[_0xcb53('0x12')](_0xcb53('0xe'),auth[_0xcb53('0xb')](),controller[_0xcb53('0x13')]);router[_0xcb53('0x14')](_0xcb53('0xe'),auth[_0xcb53('0xb')](),controller['destroy']);module[_0xcb53('0x15')]=router;
\ No newline at end of file
+var _0xa8dd=['path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','/:id','post','put','update','delete','destroy','exports','multer','util'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xa8dd,0x1d9));var _0xda8d=function(_0x2843d2,_0x27cfa5){_0x2843d2=_0x2843d2-0x0;var _0x214d1b=_0xa8dd[_0x2843d2];return _0x214d1b;};'use strict';var multer=require(_0xda8d('0x0'));var util=require(_0xda8d('0x1'));var path=require(_0xda8d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xda8d('0x3'));var auth=require(_0xda8d('0x4'));var interaction=require(_0xda8d('0x5'));var config=require(_0xda8d('0x6'));var controller=require(_0xda8d('0x7'));router[_0xda8d('0x8')]('/',auth[_0xda8d('0x9')](),controller[_0xda8d('0xa')]);router['get'](_0xda8d('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xda8d('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xda8d('0xd')]('/',auth[_0xda8d('0x9')](),controller['create']);router[_0xda8d('0xe')](_0xda8d('0xc'),auth[_0xda8d('0x9')](),controller[_0xda8d('0xf')]);router[_0xda8d('0x10')](_0xda8d('0xc'),auth[_0xda8d('0x9')](),controller[_0xda8d('0x11')]);module[_0xda8d('0x12')]=router;
\ No newline at end of file
index 87af76e..cd20acd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2707=['STRING','DATE','moment'];(function(_0x5517c0,_0x358609){var _0x33803b=function(_0x513c18){while(--_0x513c18){_0x5517c0['push'](_0x5517c0['shift']());}};_0x33803b(++_0x358609);}(_0x2707,0x143));var _0x7270=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x2707[_0x22b68a];return _0x1ac67a;};'use strict';var moment=require(_0x7270('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x7270('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x7270('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x7270('0x2')]},'reason':{'type':Sequelize[_0x7270('0x1')]}};
\ No newline at end of file
+var _0xc2a5=['sequelize','STRING','DATE'];(function(_0x569fef,_0x49c37a){var _0x11f20b=function(_0x3721d8){while(--_0x3721d8){_0x569fef['push'](_0x569fef['shift']());}};_0x11f20b(++_0x49c37a);}(_0xc2a5,0x11d));var _0x5c2a=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xc2a5[_0x21a9d9];return _0x46adce;};'use strict';var moment=require('moment');var Sequelize=require(_0x5c2a('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x5c2a('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x5c2a('0x1')]},'joinAt':{'type':Sequelize[_0x5c2a('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x5c2a('0x2')]},'exitAt':{'type':Sequelize[_0x5c2a('0x2')]},'reason':{'type':Sequelize[_0x5c2a('0x1')]}};
\ No newline at end of file
index 9ccd2fa..aec1654 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','MailQueueReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body','update','catch','describe','rimraf','fast-json-patch','request-promise','moment'];(function(_0x4cc280,_0x3b77f3){var _0x16ed24=function(_0x473e10){while(--_0x473e10){_0x4cc280['push'](_0x4cc280['shift']());}};_0x16ed24(++_0x3b77f3);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':!![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['MailQueueReport'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));};exports[_0x65f6('0x45')]=function(_0x3b241f,_0x1ca67e){return db['MailQueueReport'][_0x65f6('0x45')]()[_0x65f6('0x21')](respondWithResult(_0x1ca67e,null))['catch'](handleError(_0x1ca67e,null));};
\ No newline at end of file
+var _0x0424=['index','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','MailQueueReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','stack','name','send'];(function(_0x1d5ccb,_0x136776){var _0x49fc07=function(_0x3c29c6){while(--_0x3c29c6){_0x1d5ccb['push'](_0x1d5ccb['shift']());}};_0x49fc07(++_0x136776);}(_0x0424,0x159));var _0x4042=function(_0x261b08,_0x563d91){_0x261b08=_0x261b08-0x0;var _0xeeaf84=_0x0424[_0x261b08];return _0xeeaf84;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4042('0x0'));var jsonpatch=require(_0x4042('0x1'));var rp=require(_0x4042('0x2'));var moment=require(_0x4042('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4042('0x4'));var util=require('util');var path=require('path');var sox=require(_0x4042('0x5'));var csv=require(_0x4042('0x6'));var ejs=require(_0x4042('0x7'));var fs=require('fs');var fs_extra=require(_0x4042('0x8'));var _=require(_0x4042('0x9'));var squel=require(_0x4042('0xa'));var crypto=require(_0x4042('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4042('0x6'));var querystring=require(_0x4042('0xc'));var Papa=require(_0x4042('0xd'));var Redis=require('ioredis');var authService=require(_0x4042('0xe'));var qs=require(_0x4042('0xf'));var as=require(_0x4042('0x10'));var hardwareService=require(_0x4042('0x11'));var logger=require(_0x4042('0x12'))(_0x4042('0x13'));var utils=require(_0x4042('0x14'));var config=require(_0x4042('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4042('0x16'))['db'];function respondWithStatusCode(_0x357838,_0x59a068){_0x59a068=_0x59a068||0xcc;return function(_0x25fd0a){if(_0x25fd0a){return _0x357838[_0x4042('0x17')](_0x59a068);}return _0x357838[_0x4042('0x18')](_0x59a068)[_0x4042('0x19')]();};}function respondWithResult(_0x35f82a,_0x1ff3ca){_0x1ff3ca=_0x1ff3ca||0xc8;return function(_0xc115bd){if(_0xc115bd){return _0x35f82a['status'](_0x1ff3ca)[_0x4042('0x1a')](_0xc115bd);}};}function respondWithFilteredResult(_0x291e5c,_0x50206f){return function(_0x28087d){if(_0x28087d){var _0x3f99f8=typeof _0x50206f[_0x4042('0x1b')]===_0x4042('0x1c')&&typeof _0x50206f[_0x4042('0x1d')]===_0x4042('0x1c');var _0x62cb76=_0x28087d[_0x4042('0x1e')];var _0x466077=_0x3f99f8?0x0:_0x50206f['offset'];var _0xe5c1ec=_0x3f99f8?_0x28087d['count']:_0x50206f[_0x4042('0x1b')]+_0x50206f['limit'];var _0xca9ca6;if(_0xe5c1ec>=_0x62cb76){_0xe5c1ec=_0x62cb76;_0xca9ca6=0xc8;}else{_0xca9ca6=0xce;}_0x291e5c[_0x4042('0x18')](_0xca9ca6);return _0x291e5c[_0x4042('0x1f')](_0x4042('0x20'),_0x466077+'-'+_0xe5c1ec+'/'+_0x62cb76)['json'](_0x28087d);}return null;};}function patchUpdates(_0xb72021){return function(_0x4561e3){try{jsonpatch[_0x4042('0x21')](_0x4561e3,_0xb72021,!![]);}catch(_0xd1ddb){return BPromise['reject'](_0xd1ddb);}return _0x4561e3[_0x4042('0x22')]();};}function saveUpdates(_0xf0e0c6,_0xd6fe6c){return function(_0x83ce71){if(_0x83ce71){return _0x83ce71[_0x4042('0x23')](_0xf0e0c6)['then'](function(_0x1f9d4a){return _0x1f9d4a;});}return null;};}function removeEntity(_0x6d12a5,_0x519f2c){return function(_0x1daee8){if(_0x1daee8){return _0x1daee8['destroy']()[_0x4042('0x24')](function(){_0x6d12a5[_0x4042('0x18')](0xcc)[_0x4042('0x19')]();});}};}function handleEntityNotFound(_0x5d5c6d,_0x461c5e){return function(_0x3b9e78){if(!_0x3b9e78){_0x5d5c6d[_0x4042('0x17')](0x194);}return _0x3b9e78;};}function handleError(_0xbdadc8,_0x1c4d9f){_0x1c4d9f=_0x1c4d9f||0x1f4;return function(_0x52e575){logger['error'](_0x52e575[_0x4042('0x25')]);if(_0x52e575[_0x4042('0x26')]){delete _0x52e575[_0x4042('0x26')];}_0xbdadc8[_0x4042('0x18')](_0x1c4d9f)[_0x4042('0x27')](_0x52e575);};}exports[_0x4042('0x28')]=function(_0x5eb84b,_0x33733b){var _0x1e9bd7={},_0x4a6a6e={},_0xae26c2={'count':0x0,'rows':[]};var _0x89e16=_[_0x4042('0x29')](db['MailQueueReport']['rawAttributes'],function(_0x3d1f48){return{'name':_0x3d1f48[_0x4042('0x2a')],'type':_0x3d1f48['type'][_0x4042('0x2b')]};});_0x4a6a6e[_0x4042('0x2c')]=_[_0x4042('0x29')](_0x89e16,_0x4042('0x26'));_0x4a6a6e[_0x4042('0x2d')]=_[_0x4042('0x2e')](_0x5eb84b[_0x4042('0x2d')]);_0x4a6a6e[_0x4042('0x2f')]=_[_0x4042('0x30')](_0x4a6a6e['model'],_0x4a6a6e[_0x4042('0x2d')]);_0x1e9bd7[_0x4042('0x31')]=_['intersection'](_0x4a6a6e[_0x4042('0x2c')],qs[_0x4042('0x32')](_0x5eb84b['query'][_0x4042('0x32')]));_0x1e9bd7[_0x4042('0x31')]=_0x1e9bd7[_0x4042('0x31')][_0x4042('0x33')]?_0x1e9bd7[_0x4042('0x31')]:_0x4a6a6e[_0x4042('0x2c')];if(!_0x5eb84b[_0x4042('0x2d')][_0x4042('0x34')](_0x4042('0x35'))){_0x1e9bd7[_0x4042('0x1d')]=qs[_0x4042('0x1d')](_0x5eb84b[_0x4042('0x2d')][_0x4042('0x1d')]);_0x1e9bd7[_0x4042('0x1b')]=qs[_0x4042('0x1b')](_0x5eb84b[_0x4042('0x2d')][_0x4042('0x1b')]);}_0x1e9bd7[_0x4042('0x36')]=qs[_0x4042('0x37')](_0x5eb84b[_0x4042('0x2d')][_0x4042('0x37')]);_0x1e9bd7['where']=qs[_0x4042('0x2f')](_[_0x4042('0x38')](_0x5eb84b[_0x4042('0x2d')],_0x4a6a6e[_0x4042('0x2f')]),_0x89e16);if(_0x5eb84b['query'][_0x4042('0x39')]){_0x1e9bd7[_0x4042('0x3a')]=_[_0x4042('0x3b')](_0x1e9bd7[_0x4042('0x3a')],{'$or':_[_0x4042('0x29')](_0x89e16,function(_0x13da64){if(_0x13da64[_0x4042('0x3c')]!==_0x4042('0x3d')){var _0x341083={};_0x341083[_0x13da64[_0x4042('0x26')]]={'$like':'%'+_0x5eb84b['query'][_0x4042('0x39')]+'%'};return _0x341083;}})});}_0x1e9bd7=_[_0x4042('0x3b')]({},_0x1e9bd7,_0x5eb84b[_0x4042('0x3e')]);var _0x1eab87={'where':_0x1e9bd7[_0x4042('0x3a')]};return db[_0x4042('0x3f')][_0x4042('0x1e')](_0x1eab87)[_0x4042('0x24')](function(_0x52b1bd){_0xae26c2['count']=_0x52b1bd;if(_0x5eb84b[_0x4042('0x2d')][_0x4042('0x40')]){_0x1e9bd7[_0x4042('0x41')]=[{'all':!![]}];}return db[_0x4042('0x3f')][_0x4042('0x42')](_0x1e9bd7);})[_0x4042('0x24')](function(_0xdfb5cb){_0xae26c2[_0x4042('0x43')]=_0xdfb5cb;return _0xae26c2;})[_0x4042('0x24')](respondWithFilteredResult(_0x33733b,_0x1e9bd7))[_0x4042('0x44')](handleError(_0x33733b,null));};exports[_0x4042('0x45')]=function(_0x35fdc2,_0x5666ed){var _0x5dea57={'raw':!![],'where':{'id':_0x35fdc2[_0x4042('0x46')]['id']}},_0x929884={};_0x929884['model']=_[_0x4042('0x2e')](db['MailQueueReport'][_0x4042('0x47')]);_0x929884[_0x4042('0x2d')]=_[_0x4042('0x2e')](_0x35fdc2['query']);_0x929884[_0x4042('0x2f')]=_[_0x4042('0x30')](_0x929884['model'],_0x929884[_0x4042('0x2d')]);_0x5dea57[_0x4042('0x31')]=_[_0x4042('0x30')](_0x929884[_0x4042('0x2c')],qs[_0x4042('0x32')](_0x35fdc2['query']['fields']));_0x5dea57['attributes']=_0x5dea57[_0x4042('0x31')][_0x4042('0x33')]?_0x5dea57['attributes']:_0x929884['model'];if(_0x35fdc2['query'][_0x4042('0x40')]){_0x5dea57['include']=[{'all':!![]}];}_0x5dea57=_['merge']({},_0x5dea57,_0x35fdc2[_0x4042('0x3e')]);return db[_0x4042('0x3f')][_0x4042('0x48')](_0x5dea57)[_0x4042('0x24')](handleEntityNotFound(_0x5666ed,null))[_0x4042('0x24')](respondWithResult(_0x5666ed,null))[_0x4042('0x44')](handleError(_0x5666ed,null));};exports[_0x4042('0x49')]=function(_0x2abc13,_0x198209){return db['MailQueueReport']['create'](_0x2abc13['body'],{})['then'](respondWithResult(_0x198209,0xc9))[_0x4042('0x44')](handleError(_0x198209,null));};exports[_0x4042('0x23')]=function(_0xd898ea,_0x250434){if(_0xd898ea[_0x4042('0x4a')]['id']){delete _0xd898ea[_0x4042('0x4a')]['id'];}return db[_0x4042('0x3f')][_0x4042('0x48')]({'where':{'id':_0xd898ea['params']['id']}})[_0x4042('0x24')](handleEntityNotFound(_0x250434,null))[_0x4042('0x24')](saveUpdates(_0xd898ea[_0x4042('0x4a')],null))[_0x4042('0x24')](respondWithResult(_0x250434,null))[_0x4042('0x44')](handleError(_0x250434,null));};exports[_0x4042('0x4b')]=function(_0xf5f38a,_0x591a0f){return db['MailQueueReport']['find']({'where':{'id':_0xf5f38a[_0x4042('0x46')]['id']}})[_0x4042('0x24')](handleEntityNotFound(_0x591a0f,null))['then'](removeEntity(_0x591a0f,null))[_0x4042('0x44')](handleError(_0x591a0f,null));};exports[_0x4042('0x4c')]=function(_0x5d42a7,_0x4ec047){return db[_0x4042('0x3f')][_0x4042('0x4c')]()[_0x4042('0x24')](respondWithResult(_0x4ec047,null))[_0x4042('0x44')](handleError(_0x4ec047,null));};
\ No newline at end of file
index bbe7f75..c82f782 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa635=['define','MailQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailQueueReport.attributes','exports'];(function(_0x4c9f6a,_0xcb2cb2){var _0x5df5b9=function(_0x303cf2){while(--_0x303cf2){_0x4c9f6a['push'](_0x4c9f6a['shift']());}};_0x5df5b9(++_0xcb2cb2);}(_0xa635,0x73));var _0x5a63=function(_0x1e1ec0,_0x276bdd){_0x1e1ec0=_0x1e1ec0-0x0;var _0x215da1=_0xa635[_0x1e1ec0];return _0x215da1;};'use strict';var _=require(_0x5a63('0x0'));var util=require(_0x5a63('0x1'));var logger=require(_0x5a63('0x2'))(_0x5a63('0x3'));var moment=require(_0x5a63('0x4'));var BPromise=require(_0x5a63('0x5'));var rp=require(_0x5a63('0x6'));var fs=require('fs');var path=require(_0x5a63('0x7'));var rimraf=require('rimraf');var config=require(_0x5a63('0x8'));var attributes=require(_0x5a63('0x9'));module[_0x5a63('0xa')]=function(_0x58df88,_0x5ad151){return _0x58df88[_0x5a63('0xb')](_0x5a63('0xc'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x5a63('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0a4d=['define','MailQueueReport','report_mail_queue','uniqueid','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./mailQueueReport.attributes','exports'];(function(_0x255ac0,_0x3f6645){var _0x437bf1=function(_0x5baff0){while(--_0x5baff0){_0x255ac0['push'](_0x255ac0['shift']());}};_0x437bf1(++_0x3f6645);}(_0x0a4d,0xad));var _0xd0a4=function(_0x3e3c9f,_0x5470a2){_0x3e3c9f=_0x3e3c9f-0x0;var _0x11c88f=_0x0a4d[_0x3e3c9f];return _0x11c88f;};'use strict';var _=require('lodash');var util=require(_0xd0a4('0x0'));var logger=require(_0xd0a4('0x1'))(_0xd0a4('0x2'));var moment=require(_0xd0a4('0x3'));var BPromise=require('bluebird');var rp=require(_0xd0a4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd0a4('0x5'));var config=require(_0xd0a4('0x6'));var attributes=require(_0xd0a4('0x7'));module[_0xd0a4('0x8')]=function(_0xa04e0b,_0x257a92){return _0xa04e0b[_0xd0a4('0x9')](_0xd0a4('0xa'),attributes,{'tableName':_0xd0a4('0xb'),'paranoid':![],'indexes':[{'name':_0xd0a4('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 388a888..74c833c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x1bf34f,_0x19c960){var _0x2d15c9=function(_0x1ea399){while(--_0x1ea399){_0x1bf34f['push'](_0x1bf34f['shift']());}};_0x2d15c9(++_0x19c960);}(_0x1261,0x144));var _0x1126=function(_0xb0de07,_0x3ca2a0){_0xb0de07=_0xb0de07-0x0;var _0x4633d8=_0x1261[_0xb0de07];return _0x4633d8;};'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
+var _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x53fb4a,_0x49fcf9){var _0x58bb76=function(_0x520b84){while(--_0x520b84){_0x53fb4a['push'](_0x53fb4a['shift']());}};_0x58bb76(++_0x49fcf9);}(_0xadb5,0xad));var _0x5adb=function(_0x57e184,_0x50fe9c){_0x57e184=_0x57e184-0x0;var _0xff206b=_0xadb5[_0x57e184];return _0xff206b;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});};
\ No newline at end of file
index f2580e3..5bdf000 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(_0x1de77e,_0x503bf2){var _0x25d751=function(_0x3d093c){while(--_0x3d093c){_0x1de77e['push'](_0x1de77e['shift']());}};_0x25d751(++_0x503bf2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4bc4c8,_0x3139d3){_0x4bc4c8=_0x4bc4c8-0x0;var _0x3bb121=_0xcb91[_0x4bc4c8];return _0x3bb121;};'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(_0x265e81,_0x514eff){var _0x55b6b7=function(_0x2e3207){while(--_0x2e3207){_0x265e81['push'](_0x265e81['shift']());}};_0x55b6b7(++_0x514eff);}(_0x9c44,0x178));var _0x49c4=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x9c44[_0x15bc81];return _0x59440e;};'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 96c05b7..4da02cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb093=['INTEGER','INBOX','sequelize','exports','STRING','BOOLEAN'];(function(_0x2cec4d,_0x4efe7f){var _0x68a65=function(_0x5503c4){while(--_0x5503c4){_0x2cec4d['push'](_0x2cec4d['shift']());}};_0x68a65(++_0x4efe7f);}(_0xb093,0x188));var _0x3b09=function(_0x7ecb42,_0x285da2){_0x7ecb42=_0x7ecb42-0x0;var _0x28b560=_0xb093[_0x7ecb42];return _0x28b560;};'use strict';var Sequelize=require(_0x3b09('0x0'));module[_0x3b09('0x1')]={'description':{'type':Sequelize[_0x3b09('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x3b09('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x3b09('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x3b09('0x4')]},'tls':{'type':Sequelize[_0x3b09('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x3b09('0x2')],'defaultValue':_0x3b09('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x3b09('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xaeaa=['STRING','BOOLEAN','INTEGER','INBOX','sequelize'];(function(_0x5457d2,_0x212c2b){var _0x311ac6=function(_0x539fbd){while(--_0x539fbd){_0x5457d2['push'](_0x5457d2['shift']());}};_0x311ac6(++_0x212c2b);}(_0xaeaa,0x11c));var _0xaaea=function(_0x14fd1d,_0x27b5d7){_0x14fd1d=_0x14fd1d-0x0;var _0x5062e=_0xaeaa[_0x14fd1d];return _0x5062e;};'use strict';var Sequelize=require(_0xaaea('0x0'));module['exports']={'description':{'type':Sequelize[_0xaaea('0x1')]},'host':{'type':Sequelize[_0xaaea('0x1')]},'authentication':{'type':Sequelize[_0xaaea('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xaaea('0x1')]},'port':{'type':Sequelize[_0xaaea('0x3')]},'tls':{'type':Sequelize[_0xaaea('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xaaea('0x4')},'connTimeout':{'type':Sequelize[_0xaaea('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xaaea('0x1')]},'modernAuthentication':{'type':Sequelize[_0xaaea('0x2')],'defaultValue':![]}};
\ No newline at end of file
index df306aa..66e1b33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2da=['path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','api','moment','bluebird','request-promise'];(function(_0x4fb459,_0x39daf6){var _0x5680f7=function(_0x5d3d66){while(--_0x5d3d66){_0x4fb459['push'](_0x4fb459['shift']());}};_0x5680f7(++_0x39daf6);}(_0xb2da,0x166));var _0xab2d=function(_0x40de37,_0x58a91d){_0x40de37=_0x40de37-0x0;var _0x1ba03e=_0xb2da[_0x40de37];return _0x1ba03e;};'use strict';var _=require(_0xab2d('0x0'));var util=require(_0xab2d('0x1'));var logger=require('../../config/logger')(_0xab2d('0x2'));var moment=require(_0xab2d('0x3'));var BPromise=require(_0xab2d('0x4'));var rp=require(_0xab2d('0x5'));var fs=require('fs');var path=require(_0xab2d('0x6'));var rimraf=require(_0xab2d('0x7'));var config=require(_0xab2d('0x8'));var attributes=require(_0xab2d('0x9'));module[_0xab2d('0xa')]=function(_0x508d2f,_0x2eb581){return _0x508d2f[_0xab2d('0xb')](_0xab2d('0xc'),attributes,{'tableName':_0xab2d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x490d=['MailServerIn','mail_servers_in','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x490d,0x146));var _0xd490=function(_0x26a74c,_0x59d5dc){_0x26a74c=_0x26a74c-0x0;var _0x20e380=_0x490d[_0x26a74c];return _0x20e380;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd490('0x0'))('api');var moment=require(_0xd490('0x1'));var BPromise=require(_0xd490('0x2'));var rp=require(_0xd490('0x3'));var fs=require('fs');var path=require(_0xd490('0x4'));var rimraf=require(_0xd490('0x5'));var config=require(_0xd490('0x6'));var attributes=require(_0xd490('0x7'));module[_0xd490('0x8')]=function(_0x2cf9fa,_0x2fede8){return _0x2cf9fa[_0xd490('0x9')](_0xd490('0xa'),attributes,{'tableName':_0xd490('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3585ef0..6bf5471 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c8a=['http','then','info','debug','request\x20sent','code','error','MailServerIn,\x20%s,\x20%s','message','result','catch','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','GetMailServerIn','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x5c9e54,_0x5dd451){var _0x118611=function(_0x2a92da){while(--_0x2a92da){_0x5c9e54['push'](_0x5c9e54['shift']());}};_0x118611(++_0x5dd451);}(_0x1c8a,0x140));var _0xa1c8=function(_0x2cac01,_0x2e8b3d){_0x2cac01=_0x2cac01-0x0;var _0x2257b7=_0x1c8a[_0x2cac01];return _0x2257b7;};'use strict';var _=require(_0xa1c8('0x0'));var util=require(_0xa1c8('0x1'));var moment=require(_0xa1c8('0x2'));var BPromise=require(_0xa1c8('0x3'));var rs=require(_0xa1c8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1c8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1c8('0x6'))(_0xa1c8('0x7'));var config=require(_0xa1c8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa1c8('0x9')][_0xa1c8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14d2f0,_0x57d2d4,_0x32993e){return new BPromise(function(_0xf93962,_0x44cf0d){return client['request'](_0x14d2f0,_0x32993e)[_0xa1c8('0xb')](function(_0x23d253){logger[_0xa1c8('0xc')]('MailServerIn,\x20%s,\x20%s',_0x57d2d4,'request\x20sent');logger[_0xa1c8('0xd')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x57d2d4,_0xa1c8('0xe'),JSON['stringify'](_0x23d253));if(_0x23d253['error']){if(_0x23d253['error'][_0xa1c8('0xf')]===0x1f4){logger[_0xa1c8('0x10')](_0xa1c8('0x11'),_0x57d2d4,_0x23d253[_0xa1c8('0x10')][_0xa1c8('0x12')]);return _0x44cf0d(_0x23d253[_0xa1c8('0x10')]['message']);}logger[_0xa1c8('0x10')](_0xa1c8('0x11'),_0x57d2d4,_0x23d253[_0xa1c8('0x10')][_0xa1c8('0x12')]);return _0xf93962(_0x23d253[_0xa1c8('0x10')][_0xa1c8('0x12')]);}else{logger['info'](_0xa1c8('0x11'),_0x57d2d4,_0xa1c8('0xe'));_0xf93962(_0x23d253[_0xa1c8('0x13')][_0xa1c8('0x12')]);}})[_0xa1c8('0x14')](function(_0x5ab171){logger[_0xa1c8('0x10')]('MailServerIn,\x20%s,\x20%s',_0x57d2d4,_0x5ab171);_0x44cf0d(_0x5ab171);});});}exports['GetMailServerIn']=function(_0x1fe87f){var _0x112ab0=this;return new Promise(function(_0x57fe23,_0x3c66c3){return db[_0xa1c8('0x15')][_0xa1c8('0x16')]({'raw':_0x1fe87f['options']?_0x1fe87f[_0xa1c8('0x17')][_0xa1c8('0x18')]===undefined?!![]:![]:!![],'where':_0x1fe87f[_0xa1c8('0x17')]?_0x1fe87f['options'][_0xa1c8('0x19')]||null:null,'attributes':_0x1fe87f[_0xa1c8('0x17')]?_0x1fe87f['options'][_0xa1c8('0x1a')]||null:null,'limit':_0x1fe87f[_0xa1c8('0x17')]?_0x1fe87f[_0xa1c8('0x17')][_0xa1c8('0x1b')]||null:null,'include':_0x1fe87f[_0xa1c8('0x17')]?_0x1fe87f[_0xa1c8('0x17')][_0xa1c8('0x1c')]?_[_0xa1c8('0x1d')](_0x1fe87f[_0xa1c8('0x17')][_0xa1c8('0x1c')],function(_0x28473c){return{'model':db[_0x28473c[_0xa1c8('0x1e')]],'as':_0x28473c['as'],'attributes':_0x28473c[_0xa1c8('0x1a')],'include':_0x28473c[_0xa1c8('0x1c')]?_[_0xa1c8('0x1d')](_0x28473c[_0xa1c8('0x1c')],function(_0x572362){return{'model':db[_0x572362[_0xa1c8('0x1e')]],'as':_0x572362['as'],'attributes':_0x572362['attributes'],'include':_0x572362[_0xa1c8('0x1c')]?_['map'](_0x572362[_0xa1c8('0x1c')],function(_0x508742){return{'model':db[_0x508742[_0xa1c8('0x1e')]],'as':_0x508742['as'],'attributes':_0x508742['attributes']};}):[]};}):[]};}):[]:[]})[_0xa1c8('0xb')](function(_0x914018){logger[_0xa1c8('0xc')](_0xa1c8('0x1f'),_0x1fe87f);logger['debug'](_0xa1c8('0x1f'),_0x1fe87f,JSON[_0xa1c8('0x20')](_0x914018));_0x57fe23(_0x914018);})[_0xa1c8('0x14')](function(_0x4d0a4f){logger['error'](_0xa1c8('0x1f'),_0x4d0a4f[_0xa1c8('0x12')],_0x1fe87f);_0x3c66c3(_0x112ab0['error'](0x1f4,_0x4d0a4f[_0xa1c8('0x12')]));});});};
\ No newline at end of file
+var _0x7070=['then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','result','MailServerIn','findAll','options','raw','where','limit','map','include','model','attributes','GetMailServerIn','stringify','catch','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x5057b6,_0x48fd8b){var _0x2d7dba=function(_0x3197b4){while(--_0x3197b4){_0x5057b6['push'](_0x5057b6['shift']());}};_0x2d7dba(++_0x48fd8b);}(_0x7070,0x1d7));var _0x0707=function(_0x48d93b,_0x52b108){_0x48d93b=_0x48d93b-0x0;var _0x414a2a=_0x7070[_0x48d93b];return _0x414a2a;};'use strict';var _=require('lodash');var util=require(_0x0707('0x0'));var moment=require('moment');var BPromise=require(_0x0707('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0707('0x2'))['db'];var utils=require(_0x0707('0x3'));var logger=require(_0x0707('0x4'))(_0x0707('0x5'));var config=require('../../config/environment');var jayson=require(_0x0707('0x6'));var client=jayson[_0x0707('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49c759,_0x2e2dc0,_0x591e4c){return new BPromise(function(_0x5777eb,_0x170332){return client[_0x0707('0x8')](_0x49c759,_0x591e4c)[_0x0707('0x9')](function(_0x36cc62){logger[_0x0707('0xa')](_0x0707('0xb'),_0x2e2dc0,_0x0707('0xc'));logger[_0x0707('0xd')](_0x0707('0xe'),_0x2e2dc0,_0x0707('0xc'),JSON['stringify'](_0x36cc62));if(_0x36cc62[_0x0707('0xf')]){if(_0x36cc62['error'][_0x0707('0x10')]===0x1f4){logger['error'](_0x0707('0xb'),_0x2e2dc0,_0x36cc62[_0x0707('0xf')][_0x0707('0x11')]);return _0x170332(_0x36cc62[_0x0707('0xf')][_0x0707('0x11')]);}logger[_0x0707('0xf')](_0x0707('0xb'),_0x2e2dc0,_0x36cc62[_0x0707('0xf')][_0x0707('0x11')]);return _0x5777eb(_0x36cc62[_0x0707('0xf')]['message']);}else{logger['info'](_0x0707('0xb'),_0x2e2dc0,_0x0707('0xc'));_0x5777eb(_0x36cc62[_0x0707('0x12')][_0x0707('0x11')]);}})['catch'](function(_0x17b571){logger[_0x0707('0xf')](_0x0707('0xb'),_0x2e2dc0,_0x17b571);_0x170332(_0x17b571);});});}exports['GetMailServerIn']=function(_0x13d5de){var _0x5e8489=this;return new Promise(function(_0x471431,_0x529363){return db[_0x0707('0x13')][_0x0707('0x14')]({'raw':_0x13d5de[_0x0707('0x15')]?_0x13d5de[_0x0707('0x15')][_0x0707('0x16')]===undefined?!![]:![]:!![],'where':_0x13d5de['options']?_0x13d5de[_0x0707('0x15')][_0x0707('0x17')]||null:null,'attributes':_0x13d5de[_0x0707('0x15')]?_0x13d5de['options']['attributes']||null:null,'limit':_0x13d5de['options']?_0x13d5de[_0x0707('0x15')][_0x0707('0x18')]||null:null,'include':_0x13d5de[_0x0707('0x15')]?_0x13d5de['options']['include']?_[_0x0707('0x19')](_0x13d5de[_0x0707('0x15')][_0x0707('0x1a')],function(_0x3e9c41){return{'model':db[_0x3e9c41[_0x0707('0x1b')]],'as':_0x3e9c41['as'],'attributes':_0x3e9c41[_0x0707('0x1c')],'include':_0x3e9c41[_0x0707('0x1a')]?_[_0x0707('0x19')](_0x3e9c41[_0x0707('0x1a')],function(_0x3dc5fb){return{'model':db[_0x3dc5fb[_0x0707('0x1b')]],'as':_0x3dc5fb['as'],'attributes':_0x3dc5fb[_0x0707('0x1c')],'include':_0x3dc5fb['include']?_[_0x0707('0x19')](_0x3dc5fb[_0x0707('0x1a')],function(_0x3be832){return{'model':db[_0x3be832[_0x0707('0x1b')]],'as':_0x3be832['as'],'attributes':_0x3be832['attributes']};}):[]};}):[]};}):[]:[]})[_0x0707('0x9')](function(_0xb5bb75){logger[_0x0707('0xa')](_0x0707('0x1d'),_0x13d5de);logger[_0x0707('0xd')]('GetMailServerIn',_0x13d5de,JSON[_0x0707('0x1e')](_0xb5bb75));_0x471431(_0xb5bb75);})[_0x0707('0x1f')](function(_0x2f0ed2){logger[_0x0707('0xf')]('GetMailServerIn',_0x2f0ed2[_0x0707('0x11')],_0x13d5de);_0x529363(_0x5e8489[_0x0707('0xf')](0x1f4,_0x2f0ed2[_0x0707('0x11')]));});});};
\ No newline at end of file
index c4d2725..f5dd013 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','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 _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(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x7a54,0x106));var _0x47a5=function(_0x32349a,_0x1b2a77){_0x32349a=_0x32349a-0x0;var _0x43916b=_0x7a54[_0x32349a];return _0x43916b;};'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 9250759..e8f30d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fc2=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x4db72a,_0x5e838b){var _0x394224=function(_0x6fdb6c){while(--_0x6fdb6c){_0x4db72a['push'](_0x4db72a['shift']());}};_0x394224(++_0x5e838b);}(_0x4fc2,0x111));var _0x24fc=function(_0xdee30,_0x41b7b5){_0xdee30=_0xdee30-0x0;var _0x4b95ee=_0x4fc2[_0xdee30];return _0x4b95ee;};'use strict';var Sequelize=require(_0x24fc('0x0'));module[_0x24fc('0x1')]={'description':{'type':Sequelize[_0x24fc('0x2')]},'host':{'type':Sequelize[_0x24fc('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x24fc('0x2')]},'port':{'type':Sequelize[_0x24fc('0x3')]},'secure':{'type':Sequelize[_0x24fc('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x24fc('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x24fc('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x3423=['INTEGER','BOOLEAN','STRING'];(function(_0x1e2332,_0xd459da){var _0x2072bd=function(_0x57ed2d){while(--_0x57ed2d){_0x1e2332['push'](_0x1e2332['shift']());}};_0x2072bd(++_0xd459da);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x3342('0x0')]},'host':{'type':Sequelize[_0x3342('0x0')]},'user':{'type':Sequelize[_0x3342('0x0')]},'pass':{'type':Sequelize[_0x3342('0x0')]},'port':{'type':Sequelize[_0x3342('0x1')]},'secure':{'type':Sequelize[_0x3342('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0x3342('0x0')]},'authentication':{'type':Sequelize[_0x3342('0x2')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x3342('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 2453f60..f46220c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19fa=['include','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','keys'];(function(_0x113b57,_0x203caa){var _0x5e21df=function(_0x3c65e2){while(--_0x3c65e2){_0x113b57['push'](_0x113b57['shift']());}};_0x5e21df(++_0x203caa);}(_0x19fa,0x99));var _0xa19f=function(_0x3447e1,_0x1e883b){_0x3447e1=_0x3447e1-0x0;var _0x58c11f=_0x19fa[_0x3447e1];return _0x58c11f;};'use strict';var emlformat=require(_0xa19f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa19f('0x1'));var jsonpatch=require(_0xa19f('0x2'));var rp=require(_0xa19f('0x3'));var moment=require(_0xa19f('0x4'));var BPromise=require(_0xa19f('0x5'));var Mustache=require(_0xa19f('0x6'));var util=require(_0xa19f('0x7'));var path=require(_0xa19f('0x8'));var sox=require(_0xa19f('0x9'));var csv=require(_0xa19f('0xa'));var ejs=require(_0xa19f('0xb'));var fs=require('fs');var fs_extra=require(_0xa19f('0xc'));var _=require(_0xa19f('0xd'));var squel=require(_0xa19f('0xe'));var crypto=require('crypto');var jsforce=require(_0xa19f('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa19f('0x10'));var Redis=require(_0xa19f('0x11'));var authService=require(_0xa19f('0x12'));var qs=require(_0xa19f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa19f('0x14'))(_0xa19f('0x15'));var utils=require('../../config/utils');var config=require(_0xa19f('0x16'));var licenseUtil=require(_0xa19f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd03f95,_0x9ae304){_0x9ae304=_0x9ae304||0xcc;return function(_0x15e989){if(_0x15e989){return _0xd03f95['sendStatus'](_0x9ae304);}return _0xd03f95[_0xa19f('0x18')](_0x9ae304)[_0xa19f('0x19')]();};}function respondWithResult(_0x416d0a,_0x375f26){_0x375f26=_0x375f26||0xc8;return function(_0x2fd226){if(_0x2fd226){return _0x416d0a[_0xa19f('0x18')](_0x375f26)['json'](_0x2fd226);}};}function respondWithFilteredResult(_0x24d2c7,_0x39ddda){return function(_0x3935e4){if(_0x3935e4){var _0x8578be=typeof _0x39ddda[_0xa19f('0x1a')]===_0xa19f('0x1b')&&typeof _0x39ddda[_0xa19f('0x1c')]===_0xa19f('0x1b');var _0x537962=_0x3935e4[_0xa19f('0x1d')];var _0x4a745c=_0x8578be?0x0:_0x39ddda[_0xa19f('0x1a')];var _0x13793f=_0x8578be?_0x3935e4['count']:_0x39ddda[_0xa19f('0x1a')]+_0x39ddda[_0xa19f('0x1c')];var _0x502052;if(_0x13793f>=_0x537962){_0x13793f=_0x537962;_0x502052=0xc8;}else{_0x502052=0xce;}_0x24d2c7[_0xa19f('0x18')](_0x502052);return _0x24d2c7[_0xa19f('0x1e')](_0xa19f('0x1f'),_0x4a745c+'-'+_0x13793f+'/'+_0x537962)['json'](_0x3935e4);}return null;};}function patchUpdates(_0x185efc){return function(_0x59df9b){try{jsonpatch[_0xa19f('0x20')](_0x59df9b,_0x185efc,!![]);}catch(_0x26a784){return BPromise[_0xa19f('0x21')](_0x26a784);}return _0x59df9b[_0xa19f('0x22')]();};}function saveUpdates(_0x26e560,_0x524107){return function(_0x4f6d77){if(_0x4f6d77){return _0x4f6d77[_0xa19f('0x23')](_0x26e560)[_0xa19f('0x24')](function(_0x18add4){return _0x18add4;});}return null;};}function removeEntity(_0x9fba4a,_0x57ca28){return function(_0x43a388){if(_0x43a388){return _0x43a388[_0xa19f('0x25')]()[_0xa19f('0x24')](function(){_0x9fba4a[_0xa19f('0x18')](0xcc)[_0xa19f('0x19')]();});}};}function handleEntityNotFound(_0x28511b,_0x541c4d){return function(_0x5bf7c9){if(!_0x5bf7c9){_0x28511b[_0xa19f('0x26')](0x194);}return _0x5bf7c9;};}function handleError(_0x13d46d,_0x128137){_0x128137=_0x128137||0x1f4;return function(_0x36458d){logger[_0xa19f('0x27')](_0x36458d[_0xa19f('0x28')]);if(_0x36458d[_0xa19f('0x29')]){delete _0x36458d[_0xa19f('0x29')];}_0x13d46d[_0xa19f('0x18')](_0x128137)['send'](_0x36458d);};}exports['index']=function(_0x3109d6,_0x58cb96){var _0x51b5f9={},_0x473787={},_0x4c2ac={'count':0x0,'rows':[]};var _0x55e05=_[_0xa19f('0x2a')](db[_0xa19f('0x2b')][_0xa19f('0x2c')],function(_0x4720bd){return{'name':_0x4720bd[_0xa19f('0x2d')],'type':_0x4720bd[_0xa19f('0x2e')][_0xa19f('0x2f')]};});_0x473787[_0xa19f('0x30')]=_[_0xa19f('0x2a')](_0x55e05,'name');_0x473787[_0xa19f('0x31')]=_['keys'](_0x3109d6[_0xa19f('0x31')]);_0x473787[_0xa19f('0x32')]=_[_0xa19f('0x33')](_0x473787['model'],_0x473787['query']);_0x51b5f9[_0xa19f('0x34')]=_[_0xa19f('0x33')](_0x473787['model'],qs[_0xa19f('0x35')](_0x3109d6[_0xa19f('0x31')]['fields']));_0x51b5f9[_0xa19f('0x34')]=_0x51b5f9['attributes'][_0xa19f('0x36')]?_0x51b5f9['attributes']:_0x473787[_0xa19f('0x30')];if(!_0x3109d6['query'][_0xa19f('0x37')](_0xa19f('0x38'))){_0x51b5f9[_0xa19f('0x1c')]=qs[_0xa19f('0x1c')](_0x3109d6[_0xa19f('0x31')][_0xa19f('0x1c')]);_0x51b5f9[_0xa19f('0x1a')]=qs[_0xa19f('0x1a')](_0x3109d6['query'][_0xa19f('0x1a')]);}_0x51b5f9['order']=qs[_0xa19f('0x39')](_0x3109d6[_0xa19f('0x31')][_0xa19f('0x39')]);_0x51b5f9[_0xa19f('0x3a')]=qs['filters'](_[_0xa19f('0x3b')](_0x3109d6[_0xa19f('0x31')],_0x473787['filters']),_0x55e05);if(_0x3109d6[_0xa19f('0x31')][_0xa19f('0x3c')]){_0x51b5f9[_0xa19f('0x3a')]=_[_0xa19f('0x3d')](_0x51b5f9[_0xa19f('0x3a')],{'$or':_[_0xa19f('0x2a')](_0x55e05,function(_0x4dfc80){if(_0x4dfc80['type']!==_0xa19f('0x3e')){var _0x5524af={};_0x5524af[_0x4dfc80[_0xa19f('0x29')]]={'$like':'%'+_0x3109d6[_0xa19f('0x31')][_0xa19f('0x3c')]+'%'};return _0x5524af;}})});}_0x51b5f9=_[_0xa19f('0x3d')]({},_0x51b5f9,_0x3109d6['options']);var _0x3ed35c={'where':_0x51b5f9[_0xa19f('0x3a')]};return db[_0xa19f('0x2b')][_0xa19f('0x1d')](_0x3ed35c)['then'](function(_0x49aed4){_0x4c2ac['count']=_0x49aed4;if(_0x3109d6['query'][_0xa19f('0x3f')]){_0x51b5f9['include']=[{'all':!![]}];}return db['MailServerOut'][_0xa19f('0x40')](_0x51b5f9);})[_0xa19f('0x24')](function(_0x1e49a4){_0x4c2ac[_0xa19f('0x41')]=_0x1e49a4;return _0x4c2ac;})[_0xa19f('0x24')](respondWithFilteredResult(_0x58cb96,_0x51b5f9))[_0xa19f('0x42')](handleError(_0x58cb96,null));};exports[_0xa19f('0x43')]=function(_0x4b61bb,_0x41f6f4){var _0x5aa0ce={'raw':!![],'where':{'id':_0x4b61bb['params']['id']}},_0x3d0c0f={};_0x3d0c0f[_0xa19f('0x30')]=_['keys'](db[_0xa19f('0x2b')][_0xa19f('0x2c')]);_0x3d0c0f['query']=_[_0xa19f('0x44')](_0x4b61bb['query']);_0x3d0c0f[_0xa19f('0x32')]=_[_0xa19f('0x33')](_0x3d0c0f[_0xa19f('0x30')],_0x3d0c0f['query']);_0x5aa0ce[_0xa19f('0x34')]=_[_0xa19f('0x33')](_0x3d0c0f[_0xa19f('0x30')],qs[_0xa19f('0x35')](_0x4b61bb[_0xa19f('0x31')][_0xa19f('0x35')]));_0x5aa0ce[_0xa19f('0x34')]=_0x5aa0ce[_0xa19f('0x34')]['length']?_0x5aa0ce[_0xa19f('0x34')]:_0x3d0c0f[_0xa19f('0x30')];if(_0x4b61bb[_0xa19f('0x31')][_0xa19f('0x3f')]){_0x5aa0ce[_0xa19f('0x45')]=[{'all':!![]}];}_0x5aa0ce=_[_0xa19f('0x3d')]({},_0x5aa0ce,_0x4b61bb['options']);return db[_0xa19f('0x2b')][_0xa19f('0x46')](_0x5aa0ce)[_0xa19f('0x24')](handleEntityNotFound(_0x41f6f4,null))['then'](respondWithResult(_0x41f6f4,null))[_0xa19f('0x42')](handleError(_0x41f6f4,null));};exports['create']=function(_0x319699,_0x523ed6){return db['MailServerOut'][_0xa19f('0x47')](_0x319699[_0xa19f('0x48')],{})[_0xa19f('0x24')](respondWithResult(_0x523ed6,0xc9))['catch'](handleError(_0x523ed6,null));};exports[_0xa19f('0x23')]=function(_0x56fc80,_0x3e9ab9){if(_0x56fc80[_0xa19f('0x48')]['id']){delete _0x56fc80[_0xa19f('0x48')]['id'];}return db[_0xa19f('0x2b')][_0xa19f('0x46')]({'where':{'id':_0x56fc80['params']['id']}})[_0xa19f('0x24')](handleEntityNotFound(_0x3e9ab9,null))['then'](saveUpdates(_0x56fc80[_0xa19f('0x48')],null))['then'](respondWithResult(_0x3e9ab9,null))['catch'](handleError(_0x3e9ab9,null));};exports[_0xa19f('0x25')]=function(_0x2450ca,_0x43a4c6){return db[_0xa19f('0x2b')][_0xa19f('0x46')]({'where':{'id':_0x2450ca[_0xa19f('0x49')]['id']}})[_0xa19f('0x24')](handleEntityNotFound(_0x43a4c6,null))['then'](removeEntity(_0x43a4c6,null))[_0xa19f('0x42')](handleError(_0x43a4c6,null));};
\ No newline at end of file
+var _0x08b2=['then','includeAll','include','rows','catch','show','params','keys','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0xddc967,_0x4ea7bc){var _0x379ed4=function(_0x5d7677){while(--_0x5d7677){_0xddc967['push'](_0xddc967['shift']());}};_0x379ed4(++_0x4ea7bc);}(_0x08b2,0xf8));var _0x208b=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x08b2[_0x2cfb58];return _0xd99951;};'use strict';var emlformat=require(_0x208b('0x0'));var rimraf=require(_0x208b('0x1'));var zipdir=require(_0x208b('0x2'));var jsonpatch=require(_0x208b('0x3'));var rp=require(_0x208b('0x4'));var moment=require(_0x208b('0x5'));var BPromise=require(_0x208b('0x6'));var Mustache=require(_0x208b('0x7'));var util=require('util');var path=require(_0x208b('0x8'));var sox=require(_0x208b('0x9'));var csv=require('to-csv');var ejs=require(_0x208b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x208b('0xb'));var squel=require(_0x208b('0xc'));var crypto=require(_0x208b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x208b('0xe'));var toCsv=require(_0x208b('0xf'));var querystring=require(_0x208b('0x10'));var Papa=require(_0x208b('0x11'));var Redis=require('ioredis');var authService=require(_0x208b('0x12'));var qs=require(_0x208b('0x13'));var as=require(_0x208b('0x14'));var hardwareService=require(_0x208b('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x208b('0x16'));var config=require(_0x208b('0x17'));var licenseUtil=require(_0x208b('0x18'));var db=require(_0x208b('0x19'))['db'];function respondWithStatusCode(_0x5dd66c,_0x478c8f){_0x478c8f=_0x478c8f||0xcc;return function(_0xd330d8){if(_0xd330d8){return _0x5dd66c[_0x208b('0x1a')](_0x478c8f);}return _0x5dd66c[_0x208b('0x1b')](_0x478c8f)[_0x208b('0x1c')]();};}function respondWithResult(_0x233593,_0x4db3cf){_0x4db3cf=_0x4db3cf||0xc8;return function(_0x117cc4){if(_0x117cc4){return _0x233593[_0x208b('0x1b')](_0x4db3cf)[_0x208b('0x1d')](_0x117cc4);}};}function respondWithFilteredResult(_0x440dca,_0x55ac80){return function(_0x58b368){if(_0x58b368){var _0xe856f=typeof _0x55ac80['offset']===_0x208b('0x1e')&&typeof _0x55ac80[_0x208b('0x1f')]===_0x208b('0x1e');var _0x538ff7=_0x58b368[_0x208b('0x20')];var _0x563037=_0xe856f?0x0:_0x55ac80['offset'];var _0x4fccd7=_0xe856f?_0x58b368['count']:_0x55ac80['offset']+_0x55ac80[_0x208b('0x1f')];var _0x41653e;if(_0x4fccd7>=_0x538ff7){_0x4fccd7=_0x538ff7;_0x41653e=0xc8;}else{_0x41653e=0xce;}_0x440dca[_0x208b('0x1b')](_0x41653e);return _0x440dca[_0x208b('0x21')](_0x208b('0x22'),_0x563037+'-'+_0x4fccd7+'/'+_0x538ff7)[_0x208b('0x1d')](_0x58b368);}return null;};}function patchUpdates(_0x533a76){return function(_0x1035a4){try{jsonpatch[_0x208b('0x23')](_0x1035a4,_0x533a76,!![]);}catch(_0x5e80c2){return BPromise[_0x208b('0x24')](_0x5e80c2);}return _0x1035a4[_0x208b('0x25')]();};}function saveUpdates(_0x15e18c,_0x52395a){return function(_0x52c7ef){if(_0x52c7ef){return _0x52c7ef[_0x208b('0x26')](_0x15e18c)['then'](function(_0xc2789c){return _0xc2789c;});}return null;};}function removeEntity(_0x164be6,_0x3fa0ee){return function(_0x4ea283){if(_0x4ea283){return _0x4ea283[_0x208b('0x27')]()['then'](function(){_0x164be6[_0x208b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb3b01c,_0xaadf69){return function(_0x1dfcef){if(!_0x1dfcef){_0xb3b01c[_0x208b('0x1a')](0x194);}return _0x1dfcef;};}function handleError(_0x40590d,_0x29aad5){_0x29aad5=_0x29aad5||0x1f4;return function(_0x2dcc1d){logger[_0x208b('0x28')](_0x2dcc1d[_0x208b('0x29')]);if(_0x2dcc1d[_0x208b('0x2a')]){delete _0x2dcc1d[_0x208b('0x2a')];}_0x40590d[_0x208b('0x1b')](_0x29aad5)[_0x208b('0x2b')](_0x2dcc1d);};}exports[_0x208b('0x2c')]=function(_0x21e5ef,_0x2ae8cb){var _0x1e8c9e={},_0x2f6c8e={},_0x43e00d={'count':0x0,'rows':[]};var _0xa995c2=_[_0x208b('0x2d')](db[_0x208b('0x2e')][_0x208b('0x2f')],function(_0x249617){return{'name':_0x249617[_0x208b('0x30')],'type':_0x249617[_0x208b('0x31')]['key']};});_0x2f6c8e['model']=_[_0x208b('0x2d')](_0xa995c2,_0x208b('0x2a'));_0x2f6c8e[_0x208b('0x32')]=_['keys'](_0x21e5ef['query']);_0x2f6c8e[_0x208b('0x33')]=_[_0x208b('0x34')](_0x2f6c8e['model'],_0x2f6c8e['query']);_0x1e8c9e[_0x208b('0x35')]=_['intersection'](_0x2f6c8e[_0x208b('0x36')],qs[_0x208b('0x37')](_0x21e5ef[_0x208b('0x32')][_0x208b('0x37')]));_0x1e8c9e[_0x208b('0x35')]=_0x1e8c9e[_0x208b('0x35')][_0x208b('0x38')]?_0x1e8c9e['attributes']:_0x2f6c8e[_0x208b('0x36')];if(!_0x21e5ef[_0x208b('0x32')][_0x208b('0x39')](_0x208b('0x3a'))){_0x1e8c9e['limit']=qs[_0x208b('0x1f')](_0x21e5ef['query'][_0x208b('0x1f')]);_0x1e8c9e[_0x208b('0x3b')]=qs[_0x208b('0x3b')](_0x21e5ef['query'][_0x208b('0x3b')]);}_0x1e8c9e[_0x208b('0x3c')]=qs[_0x208b('0x3d')](_0x21e5ef['query'][_0x208b('0x3d')]);_0x1e8c9e[_0x208b('0x3e')]=qs['filters'](_[_0x208b('0x3f')](_0x21e5ef[_0x208b('0x32')],_0x2f6c8e[_0x208b('0x33')]),_0xa995c2);if(_0x21e5ef[_0x208b('0x32')][_0x208b('0x40')]){_0x1e8c9e[_0x208b('0x3e')]=_[_0x208b('0x41')](_0x1e8c9e['where'],{'$or':_[_0x208b('0x2d')](_0xa995c2,function(_0x22a291){if(_0x22a291[_0x208b('0x31')]!==_0x208b('0x42')){var _0x3e15d3={};_0x3e15d3[_0x22a291['name']]={'$like':'%'+_0x21e5ef[_0x208b('0x32')][_0x208b('0x40')]+'%'};return _0x3e15d3;}})});}_0x1e8c9e=_[_0x208b('0x41')]({},_0x1e8c9e,_0x21e5ef[_0x208b('0x43')]);var _0x3cd6d1={'where':_0x1e8c9e[_0x208b('0x3e')]};return db[_0x208b('0x2e')][_0x208b('0x20')](_0x3cd6d1)[_0x208b('0x44')](function(_0x17802c){_0x43e00d[_0x208b('0x20')]=_0x17802c;if(_0x21e5ef[_0x208b('0x32')][_0x208b('0x45')]){_0x1e8c9e[_0x208b('0x46')]=[{'all':!![]}];}return db[_0x208b('0x2e')]['findAll'](_0x1e8c9e);})[_0x208b('0x44')](function(_0x3f8cd4){_0x43e00d[_0x208b('0x47')]=_0x3f8cd4;return _0x43e00d;})[_0x208b('0x44')](respondWithFilteredResult(_0x2ae8cb,_0x1e8c9e))[_0x208b('0x48')](handleError(_0x2ae8cb,null));};exports[_0x208b('0x49')]=function(_0x19ac9a,_0x57d7ba){var _0x5b92a4={'raw':!![],'where':{'id':_0x19ac9a[_0x208b('0x4a')]['id']}},_0x5a94fe={};_0x5a94fe[_0x208b('0x36')]=_[_0x208b('0x4b')](db[_0x208b('0x2e')][_0x208b('0x2f')]);_0x5a94fe[_0x208b('0x32')]=_['keys'](_0x19ac9a[_0x208b('0x32')]);_0x5a94fe[_0x208b('0x33')]=_[_0x208b('0x34')](_0x5a94fe[_0x208b('0x36')],_0x5a94fe[_0x208b('0x32')]);_0x5b92a4[_0x208b('0x35')]=_[_0x208b('0x34')](_0x5a94fe[_0x208b('0x36')],qs[_0x208b('0x37')](_0x19ac9a['query'][_0x208b('0x37')]));_0x5b92a4[_0x208b('0x35')]=_0x5b92a4[_0x208b('0x35')][_0x208b('0x38')]?_0x5b92a4[_0x208b('0x35')]:_0x5a94fe['model'];if(_0x19ac9a['query'][_0x208b('0x45')]){_0x5b92a4[_0x208b('0x46')]=[{'all':!![]}];}_0x5b92a4=_[_0x208b('0x41')]({},_0x5b92a4,_0x19ac9a['options']);return db[_0x208b('0x2e')]['find'](_0x5b92a4)[_0x208b('0x44')](handleEntityNotFound(_0x57d7ba,null))['then'](respondWithResult(_0x57d7ba,null))['catch'](handleError(_0x57d7ba,null));};exports['create']=function(_0x2c449e,_0x4812ec){return db[_0x208b('0x2e')][_0x208b('0x4c')](_0x2c449e[_0x208b('0x4d')],{})[_0x208b('0x44')](respondWithResult(_0x4812ec,0xc9))['catch'](handleError(_0x4812ec,null));};exports[_0x208b('0x26')]=function(_0x5578af,_0x385760){if(_0x5578af[_0x208b('0x4d')]['id']){delete _0x5578af['body']['id'];}return db['MailServerOut'][_0x208b('0x4e')]({'where':{'id':_0x5578af[_0x208b('0x4a')]['id']}})[_0x208b('0x44')](handleEntityNotFound(_0x385760,null))['then'](saveUpdates(_0x5578af['body'],null))['then'](respondWithResult(_0x385760,null))['catch'](handleError(_0x385760,null));};exports[_0x208b('0x27')]=function(_0x31090d,_0x489203){return db[_0x208b('0x2e')][_0x208b('0x4e')]({'where':{'id':_0x31090d[_0x208b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x489203,null))[_0x208b('0x44')](removeEntity(_0x489203,null))[_0x208b('0x48')](handleError(_0x489203,null));};
\ No newline at end of file
index 30457b7..4f8f8db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9527=['bluebird','request-promise','../../config/environment','./mailServerOut.attributes','exports','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment'];(function(_0x49c653,_0x390195){var _0x31e169=function(_0x3684ac){while(--_0x3684ac){_0x49c653['push'](_0x49c653['shift']());}};_0x31e169(++_0x390195);}(_0x9527,0xdf));var _0x7952=function(_0x4b0848,_0x50bcff){_0x4b0848=_0x4b0848-0x0;var _0x93aad9=_0x9527[_0x4b0848];return _0x93aad9;};'use strict';var _=require(_0x7952('0x0'));var util=require(_0x7952('0x1'));var logger=require(_0x7952('0x2'))(_0x7952('0x3'));var moment=require(_0x7952('0x4'));var BPromise=require(_0x7952('0x5'));var rp=require(_0x7952('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7952('0x7'));var attributes=require(_0x7952('0x8'));module[_0x7952('0x9')]=function(_0x1827f0,_0x83b22c){return _0x1827f0['define'](_0x7952('0xa'),attributes,{'tableName':_0x7952('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xab54=['mail_servers_out','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','define','MailServerOut'];(function(_0x523adf,_0x3e1620){var _0x283870=function(_0xa0e816){while(--_0xa0e816){_0x523adf['push'](_0x523adf['shift']());}};_0x283870(++_0x3e1620);}(_0xab54,0x139));var _0x4ab5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab54[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4ab5('0x0'));var util=require('util');var logger=require(_0x4ab5('0x1'))(_0x4ab5('0x2'));var moment=require(_0x4ab5('0x3'));var BPromise=require(_0x4ab5('0x4'));var rp=require(_0x4ab5('0x5'));var fs=require('fs');var path=require(_0x4ab5('0x6'));var rimraf=require(_0x4ab5('0x7'));var config=require(_0x4ab5('0x8'));var attributes=require(_0x4ab5('0x9'));module['exports']=function(_0x31d30b,_0x35eaa2){return _0x31d30b[_0x4ab5('0xa')](_0x4ab5('0xb'),attributes,{'tableName':_0x4ab5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2fc16b5..d5523c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x5c8d33,_0x222550){var _0x20692d=function(_0x27701f){while(--_0x27701f){_0x5c8d33['push'](_0x5c8d33['shift']());}};_0x20692d(++_0x222550);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1b6158,_0x1b7c2f){_0x1b6158=_0x1b6158-0x0;var _0x5c6338=_0x5f2f[_0x1b6158];return _0x5c6338;};'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')]('MailServerOut,\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);});});}
\ No newline at end of file
+var _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x1e21e9,_0x3e2b5c){_0x1e21e9=_0x1e21e9-0x0;var _0x37ee77=_0x7a54[_0x1e21e9];return _0x37ee77;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
index 72ff1a6..3d4b257 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x729e=['describe','get','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','/describe'];(function(_0x58ee62,_0x180e9a){var _0x1a10ba=function(_0x2ddf13){while(--_0x2ddf13){_0x58ee62['push'](_0x58ee62['shift']());}};_0x1a10ba(++_0x180e9a);}(_0x729e,0xbd));var _0xe729=function(_0x257974,_0x9bba3a){_0x257974=_0x257974-0x0;var _0x425d11=_0x729e[_0x257974];return _0x425d11;};'use strict';var multer=require(_0xe729('0x0'));var util=require(_0xe729('0x1'));var path=require('path');var timeout=require(_0xe729('0x2'));var express=require('express');var router=express[_0xe729('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe729('0x4'));var interaction=require(_0xe729('0x5'));var config=require(_0xe729('0x6'));var controller=require(_0xe729('0x7'));router['get']('/',auth[_0xe729('0x8')](),controller[_0xe729('0x9')]);router['get'](_0xe729('0xa'),auth[_0xe729('0x8')](),controller[_0xe729('0xb')]);router[_0xe729('0xc')]('/:id',auth[_0xe729('0x8')](),controller[_0xe729('0xd')]);router[_0xe729('0xe')]('/',auth[_0xe729('0x8')](),controller[_0xe729('0xf')]);router[_0xe729('0x10')]('/:id',auth[_0xe729('0x8')](),controller[_0xe729('0x11')]);router[_0xe729('0x12')]('/:id',auth[_0xe729('0x8')](),controller[_0xe729('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x6bc9=['exports','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe','post','create','put','update','delete','/:id','destroy'];(function(_0x1852db,_0x41312c){var _0x540037=function(_0x53dd3f){while(--_0x53dd3f){_0x1852db['push'](_0x1852db['shift']());}};_0x540037(++_0x41312c);}(_0x6bc9,0xfd));var _0x96bc=function(_0xc5a279,_0x155360){_0xc5a279=_0xc5a279-0x0;var _0xc755d3=_0x6bc9[_0xc5a279];return _0xc755d3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x96bc('0x0'));var timeout=require(_0x96bc('0x1'));var express=require('express');var router=express[_0x96bc('0x2')]();var fs_extra=require(_0x96bc('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x96bc('0x4'));var config=require(_0x96bc('0x5'));var controller=require(_0x96bc('0x6'));router[_0x96bc('0x7')]('/',auth[_0x96bc('0x8')](),controller['index']);router['get'](_0x96bc('0x9'),auth[_0x96bc('0x8')](),controller['describe']);router['get']('/:id',auth[_0x96bc('0x8')](),controller['show']);router[_0x96bc('0xa')]('/',auth['isAuthenticated'](),controller[_0x96bc('0xb')]);router[_0x96bc('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x96bc('0xd')]);router[_0x96bc('0xe')](_0x96bc('0xf'),auth[_0x96bc('0x8')](),controller[_0x96bc('0x10')]);module[_0x96bc('0x11')]=router;
\ No newline at end of file
index ab88aa2..9fd9f59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f8a=['name','sequelize','exports','STRING'];(function(_0x4b5b42,_0xe84f7){var _0x155026=function(_0xc5057a){while(--_0xc5057a){_0x4b5b42['push'](_0x4b5b42['shift']());}};_0x155026(++_0xe84f7);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x588c33,_0xe686f7){_0x588c33=_0x588c33-0x0;var _0x5c639c=_0x3f8a[_0x588c33];return _0x5c639c;};'use strict';var Sequelize=require(_0xa3f8('0x0'));module[_0xa3f8('0x1')]={'name':{'type':Sequelize[_0xa3f8('0x2')],'unique':_0xa3f8('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x8f9d=['STRING','sequelize'];(function(_0x5a4400,_0xfae3b6){var _0xf9b532=function(_0x39804e){while(--_0x39804e){_0x5a4400['push'](_0x5a4400['shift']());}};_0xf9b532(++_0xfae3b6);}(_0x8f9d,0x93));var _0xd8f9=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8f9d[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0xd8f9('0x0'));module['exports']={'name':{'type':Sequelize[_0xd8f9('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd8f9('0x1')]}};
\ No newline at end of file
index 2c5ca65..1372d44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd65d=['rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','MailSubstatus','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','stack','name','send','index'];(function(_0xf0ec6e,_0xa183d3){var _0x8bbc27=function(_0x39822b){while(--_0x39822b){_0xf0ec6e['push'](_0xf0ec6e['shift']());}};_0x8bbc27(++_0xa183d3);}(_0xd65d,0x6d));var _0xdd65=function(_0x23fcf7,_0x492315){_0x23fcf7=_0x23fcf7-0x0;var _0x120a25=_0xd65d[_0x23fcf7];return _0x120a25;};'use strict';var emlformat=require(_0xdd65('0x0'));var rimraf=require(_0xdd65('0x1'));var zipdir=require(_0xdd65('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdd65('0x3'));var moment=require(_0xdd65('0x4'));var BPromise=require(_0xdd65('0x5'));var Mustache=require('mustache');var util=require(_0xdd65('0x6'));var path=require(_0xdd65('0x7'));var sox=require(_0xdd65('0x8'));var csv=require('to-csv');var ejs=require(_0xdd65('0x9'));var fs=require('fs');var fs_extra=require(_0xdd65('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xdd65('0xb'));var jsforce=require(_0xdd65('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdd65('0xd'));var querystring=require(_0xdd65('0xe'));var Papa=require(_0xdd65('0xf'));var Redis=require(_0xdd65('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xdd65('0x11'));var as=require(_0xdd65('0x12'));var hardwareService=require(_0xdd65('0x13'));var logger=require(_0xdd65('0x14'))(_0xdd65('0x15'));var utils=require(_0xdd65('0x16'));var config=require(_0xdd65('0x17'));var licenseUtil=require(_0xdd65('0x18'));var db=require(_0xdd65('0x19'))['db'];function respondWithStatusCode(_0x4ae2fd,_0x1b0df4){_0x1b0df4=_0x1b0df4||0xcc;return function(_0x130f02){if(_0x130f02){return _0x4ae2fd[_0xdd65('0x1a')](_0x1b0df4);}return _0x4ae2fd['status'](_0x1b0df4)[_0xdd65('0x1b')]();};}function respondWithResult(_0x4bab86,_0x35d87c){_0x35d87c=_0x35d87c||0xc8;return function(_0x207689){if(_0x207689){return _0x4bab86[_0xdd65('0x1c')](_0x35d87c)[_0xdd65('0x1d')](_0x207689);}};}function respondWithFilteredResult(_0x378363,_0x27d412){return function(_0x4a1db8){if(_0x4a1db8){var _0x3ff779=typeof _0x27d412[_0xdd65('0x1e')]==='undefined'&&typeof _0x27d412[_0xdd65('0x1f')]===_0xdd65('0x20');var _0x330483=_0x4a1db8[_0xdd65('0x21')];var _0x3a2402=_0x3ff779?0x0:_0x27d412[_0xdd65('0x1e')];var _0x2f30e4=_0x3ff779?_0x4a1db8[_0xdd65('0x21')]:_0x27d412[_0xdd65('0x1e')]+_0x27d412[_0xdd65('0x1f')];var _0x222a03;if(_0x2f30e4>=_0x330483){_0x2f30e4=_0x330483;_0x222a03=0xc8;}else{_0x222a03=0xce;}_0x378363['status'](_0x222a03);return _0x378363[_0xdd65('0x22')]('Content-Range',_0x3a2402+'-'+_0x2f30e4+'/'+_0x330483)[_0xdd65('0x1d')](_0x4a1db8);}return null;};}function patchUpdates(_0x5aea2b){return function(_0x500d08){try{jsonpatch[_0xdd65('0x23')](_0x500d08,_0x5aea2b,!![]);}catch(_0x2f3156){return BPromise[_0xdd65('0x24')](_0x2f3156);}return _0x500d08[_0xdd65('0x25')]();};}function saveUpdates(_0x5622b1,_0x4e3499){return function(_0x96f03){if(_0x96f03){return _0x96f03[_0xdd65('0x26')](_0x5622b1)[_0xdd65('0x27')](function(_0x38680b){return _0x38680b;});}return null;};}function removeEntity(_0x33bf54,_0x231359){return function(_0x574f0a){if(_0x574f0a){return _0x574f0a[_0xdd65('0x28')]()['then'](function(){_0x33bf54[_0xdd65('0x1c')](0xcc)[_0xdd65('0x1b')]();});}};}function handleEntityNotFound(_0x17447c,_0x75001a){return function(_0x3d28d7){if(!_0x3d28d7){_0x17447c[_0xdd65('0x1a')](0x194);}return _0x3d28d7;};}function handleError(_0x28a685,_0x47af25){_0x47af25=_0x47af25||0x1f4;return function(_0x5d48e3){logger['error'](_0x5d48e3[_0xdd65('0x29')]);if(_0x5d48e3[_0xdd65('0x2a')]){delete _0x5d48e3[_0xdd65('0x2a')];}_0x28a685[_0xdd65('0x1c')](_0x47af25)[_0xdd65('0x2b')](_0x5d48e3);};}exports[_0xdd65('0x2c')]=function(_0x16af79,_0x1fb25e){var _0x1ea936={},_0x3fc887={},_0x26a69d={'count':0x0,'rows':[]};var _0x1aad0f=_['map'](db['MailSubstatus'][_0xdd65('0x2d')],function(_0x516052){return{'name':_0x516052[_0xdd65('0x2e')],'type':_0x516052['type'][_0xdd65('0x2f')]};});_0x3fc887[_0xdd65('0x30')]=_[_0xdd65('0x31')](_0x1aad0f,_0xdd65('0x2a'));_0x3fc887[_0xdd65('0x32')]=_[_0xdd65('0x33')](_0x16af79[_0xdd65('0x32')]);_0x3fc887[_0xdd65('0x34')]=_[_0xdd65('0x35')](_0x3fc887[_0xdd65('0x30')],_0x3fc887[_0xdd65('0x32')]);_0x1ea936[_0xdd65('0x36')]=_[_0xdd65('0x35')](_0x3fc887['model'],qs[_0xdd65('0x37')](_0x16af79['query'][_0xdd65('0x37')]));_0x1ea936[_0xdd65('0x36')]=_0x1ea936[_0xdd65('0x36')][_0xdd65('0x38')]?_0x1ea936[_0xdd65('0x36')]:_0x3fc887[_0xdd65('0x30')];if(!_0x16af79[_0xdd65('0x32')]['hasOwnProperty'](_0xdd65('0x39'))){_0x1ea936['limit']=qs[_0xdd65('0x1f')](_0x16af79[_0xdd65('0x32')]['limit']);_0x1ea936['offset']=qs[_0xdd65('0x1e')](_0x16af79['query'][_0xdd65('0x1e')]);}_0x1ea936[_0xdd65('0x3a')]=qs[_0xdd65('0x3b')](_0x16af79[_0xdd65('0x32')]['sort']);_0x1ea936[_0xdd65('0x3c')]=qs[_0xdd65('0x34')](_[_0xdd65('0x3d')](_0x16af79[_0xdd65('0x32')],_0x3fc887[_0xdd65('0x34')]),_0x1aad0f);if(_0x16af79[_0xdd65('0x32')][_0xdd65('0x3e')]){_0x1ea936['where']=_[_0xdd65('0x3f')](_0x1ea936[_0xdd65('0x3c')],{'$or':_['map'](_0x1aad0f,function(_0x1a0df8){if(_0x1a0df8[_0xdd65('0x40')]!==_0xdd65('0x41')){var _0x400baa={};_0x400baa[_0x1a0df8[_0xdd65('0x2a')]]={'$like':'%'+_0x16af79['query'][_0xdd65('0x3e')]+'%'};return _0x400baa;}})});}_0x1ea936=_['merge']({},_0x1ea936,_0x16af79[_0xdd65('0x42')]);var _0x3ac220={'where':_0x1ea936[_0xdd65('0x3c')]};return db['MailSubstatus'][_0xdd65('0x21')](_0x3ac220)[_0xdd65('0x27')](function(_0x3f107a){_0x26a69d[_0xdd65('0x21')]=_0x3f107a;if(_0x16af79[_0xdd65('0x32')][_0xdd65('0x43')]){_0x1ea936[_0xdd65('0x44')]=[{'all':!![]}];}return db['MailSubstatus']['findAll'](_0x1ea936);})[_0xdd65('0x27')](function(_0x40a4d6){_0x26a69d[_0xdd65('0x45')]=_0x40a4d6;return _0x26a69d;})[_0xdd65('0x27')](respondWithFilteredResult(_0x1fb25e,_0x1ea936))[_0xdd65('0x46')](handleError(_0x1fb25e,null));};exports['show']=function(_0x205581,_0x4a0e30){var _0xfd6837={'raw':!![],'where':{'id':_0x205581['params']['id']}},_0x246f2f={};_0x246f2f[_0xdd65('0x30')]=_[_0xdd65('0x33')](db[_0xdd65('0x47')][_0xdd65('0x2d')]);_0x246f2f[_0xdd65('0x32')]=_['keys'](_0x205581['query']);_0x246f2f[_0xdd65('0x34')]=_[_0xdd65('0x35')](_0x246f2f[_0xdd65('0x30')],_0x246f2f['query']);_0xfd6837[_0xdd65('0x36')]=_[_0xdd65('0x35')](_0x246f2f[_0xdd65('0x30')],qs[_0xdd65('0x37')](_0x205581[_0xdd65('0x32')]['fields']));_0xfd6837['attributes']=_0xfd6837['attributes'][_0xdd65('0x38')]?_0xfd6837[_0xdd65('0x36')]:_0x246f2f[_0xdd65('0x30')];if(_0x205581[_0xdd65('0x32')]['includeAll']){_0xfd6837[_0xdd65('0x44')]=[{'all':!![]}];}_0xfd6837=_['merge']({},_0xfd6837,_0x205581[_0xdd65('0x42')]);return db['MailSubstatus'][_0xdd65('0x48')](_0xfd6837)['then'](handleEntityNotFound(_0x4a0e30,null))[_0xdd65('0x27')](respondWithResult(_0x4a0e30,null))[_0xdd65('0x46')](handleError(_0x4a0e30,null));};exports['create']=function(_0x2cb6f0,_0x164add){return db[_0xdd65('0x47')][_0xdd65('0x49')](_0x2cb6f0[_0xdd65('0x4a')],{})[_0xdd65('0x27')](respondWithResult(_0x164add,0xc9))[_0xdd65('0x46')](handleError(_0x164add,null));};exports[_0xdd65('0x26')]=function(_0x1e15c2,_0x35a49c){if(_0x1e15c2[_0xdd65('0x4a')]['id']){delete _0x1e15c2['body']['id'];}return db[_0xdd65('0x47')][_0xdd65('0x48')]({'where':{'id':_0x1e15c2[_0xdd65('0x4b')]['id']}})[_0xdd65('0x27')](handleEntityNotFound(_0x35a49c,null))[_0xdd65('0x27')](saveUpdates(_0x1e15c2['body'],null))[_0xdd65('0x27')](respondWithResult(_0x35a49c,null))[_0xdd65('0x46')](handleError(_0x35a49c,null));};exports[_0xdd65('0x28')]=function(_0x4f8194,_0x3be1f5){return db['MailSubstatus']['find']({'where':{'id':_0x4f8194[_0xdd65('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3be1f5,null))[_0xdd65('0x27')](removeEntity(_0x3be1f5,null))[_0xdd65('0x46')](handleError(_0x3be1f5,null));};exports[_0xdd65('0x4c')]=function(_0x4d100d,_0x2ed55d){return db[_0xdd65('0x47')][_0xdd65('0x4c')]()[_0xdd65('0x27')](respondWithResult(_0x2ed55d,null))[_0xdd65('0x46')](handleError(_0x2ed55d,null));};
\ No newline at end of file
+var _0xf844=['querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','MailSubstatus','findAll','catch','show','params','keys','includeAll','create','body','find','describe','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xf844,0x1a3));var _0x4f84=function(_0x84dbc9,_0x804160){_0x84dbc9=_0x84dbc9-0x0;var _0x365eea=_0xf844[_0x84dbc9];return _0x365eea;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4f84('0x0'));var rp=require(_0x4f84('0x1'));var moment=require(_0x4f84('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4f84('0x3'));var util=require(_0x4f84('0x4'));var path=require(_0x4f84('0x5'));var sox=require(_0x4f84('0x6'));var csv=require(_0x4f84('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4f84('0x8'));var _=require(_0x4f84('0x9'));var squel=require(_0x4f84('0xa'));var crypto=require('crypto');var jsforce=require(_0x4f84('0xb'));var deskjs=require(_0x4f84('0xc'));var toCsv=require(_0x4f84('0x7'));var querystring=require(_0x4f84('0xd'));var Papa=require('papaparse');var Redis=require(_0x4f84('0xe'));var authService=require(_0x4f84('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4f84('0x10'));var hardwareService=require(_0x4f84('0x11'));var logger=require(_0x4f84('0x12'))('api');var utils=require(_0x4f84('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4f84('0x14'));var db=require(_0x4f84('0x15'))['db'];function respondWithStatusCode(_0x530f16,_0x493b21){_0x493b21=_0x493b21||0xcc;return function(_0x2550d4){if(_0x2550d4){return _0x530f16[_0x4f84('0x16')](_0x493b21);}return _0x530f16[_0x4f84('0x17')](_0x493b21)[_0x4f84('0x18')]();};}function respondWithResult(_0x11003f,_0x58831a){_0x58831a=_0x58831a||0xc8;return function(_0x57e9c2){if(_0x57e9c2){return _0x11003f[_0x4f84('0x17')](_0x58831a)[_0x4f84('0x19')](_0x57e9c2);}};}function respondWithFilteredResult(_0x38c459,_0x4e4623){return function(_0x1be2c0){if(_0x1be2c0){var _0x57589c=typeof _0x4e4623[_0x4f84('0x1a')]==='undefined'&&typeof _0x4e4623[_0x4f84('0x1b')]===_0x4f84('0x1c');var _0x4d9840=_0x1be2c0[_0x4f84('0x1d')];var _0x42e8fa=_0x57589c?0x0:_0x4e4623['offset'];var _0xb13138=_0x57589c?_0x1be2c0[_0x4f84('0x1d')]:_0x4e4623[_0x4f84('0x1a')]+_0x4e4623[_0x4f84('0x1b')];var _0x126598;if(_0xb13138>=_0x4d9840){_0xb13138=_0x4d9840;_0x126598=0xc8;}else{_0x126598=0xce;}_0x38c459['status'](_0x126598);return _0x38c459[_0x4f84('0x1e')]('Content-Range',_0x42e8fa+'-'+_0xb13138+'/'+_0x4d9840)['json'](_0x1be2c0);}return null;};}function patchUpdates(_0x335aeb){return function(_0x139b05){try{jsonpatch['apply'](_0x139b05,_0x335aeb,!![]);}catch(_0x542098){return BPromise[_0x4f84('0x1f')](_0x542098);}return _0x139b05[_0x4f84('0x20')]();};}function saveUpdates(_0x82a0b9,_0x102ad4){return function(_0x1de3c1){if(_0x1de3c1){return _0x1de3c1[_0x4f84('0x21')](_0x82a0b9)[_0x4f84('0x22')](function(_0x57393b){return _0x57393b;});}return null;};}function removeEntity(_0x9a54f2,_0xae4f62){return function(_0x7e376c){if(_0x7e376c){return _0x7e376c[_0x4f84('0x23')]()[_0x4f84('0x22')](function(){_0x9a54f2[_0x4f84('0x17')](0xcc)[_0x4f84('0x18')]();});}};}function handleEntityNotFound(_0x5283bb,_0x4ea606){return function(_0xd3fb9c){if(!_0xd3fb9c){_0x5283bb[_0x4f84('0x16')](0x194);}return _0xd3fb9c;};}function handleError(_0x341fef,_0x46f29d){_0x46f29d=_0x46f29d||0x1f4;return function(_0x2ed6ac){logger[_0x4f84('0x24')](_0x2ed6ac[_0x4f84('0x25')]);if(_0x2ed6ac[_0x4f84('0x26')]){delete _0x2ed6ac[_0x4f84('0x26')];}_0x341fef[_0x4f84('0x17')](_0x46f29d)[_0x4f84('0x27')](_0x2ed6ac);};}exports[_0x4f84('0x28')]=function(_0xf047ad,_0x345107){var _0x2dda63={},_0x59b2c6={},_0x55a03c={'count':0x0,'rows':[]};var _0x428c34=_[_0x4f84('0x29')](db['MailSubstatus'][_0x4f84('0x2a')],function(_0x5d86cd){return{'name':_0x5d86cd[_0x4f84('0x2b')],'type':_0x5d86cd[_0x4f84('0x2c')][_0x4f84('0x2d')]};});_0x59b2c6[_0x4f84('0x2e')]=_[_0x4f84('0x29')](_0x428c34,'name');_0x59b2c6[_0x4f84('0x2f')]=_['keys'](_0xf047ad['query']);_0x59b2c6[_0x4f84('0x30')]=_[_0x4f84('0x31')](_0x59b2c6[_0x4f84('0x2e')],_0x59b2c6[_0x4f84('0x2f')]);_0x2dda63[_0x4f84('0x32')]=_[_0x4f84('0x31')](_0x59b2c6[_0x4f84('0x2e')],qs[_0x4f84('0x33')](_0xf047ad[_0x4f84('0x2f')][_0x4f84('0x33')]));_0x2dda63[_0x4f84('0x32')]=_0x2dda63[_0x4f84('0x32')][_0x4f84('0x34')]?_0x2dda63[_0x4f84('0x32')]:_0x59b2c6[_0x4f84('0x2e')];if(!_0xf047ad[_0x4f84('0x2f')][_0x4f84('0x35')](_0x4f84('0x36'))){_0x2dda63[_0x4f84('0x1b')]=qs[_0x4f84('0x1b')](_0xf047ad['query'][_0x4f84('0x1b')]);_0x2dda63[_0x4f84('0x1a')]=qs[_0x4f84('0x1a')](_0xf047ad[_0x4f84('0x2f')][_0x4f84('0x1a')]);}_0x2dda63['order']=qs[_0x4f84('0x37')](_0xf047ad[_0x4f84('0x2f')]['sort']);_0x2dda63[_0x4f84('0x38')]=qs['filters'](_[_0x4f84('0x39')](_0xf047ad[_0x4f84('0x2f')],_0x59b2c6['filters']),_0x428c34);if(_0xf047ad[_0x4f84('0x2f')][_0x4f84('0x3a')]){_0x2dda63['where']=_[_0x4f84('0x3b')](_0x2dda63['where'],{'$or':_[_0x4f84('0x29')](_0x428c34,function(_0x2fee1d){if(_0x2fee1d['type']!=='VIRTUAL'){var _0x36606b={};_0x36606b[_0x2fee1d[_0x4f84('0x26')]]={'$like':'%'+_0xf047ad[_0x4f84('0x2f')][_0x4f84('0x3a')]+'%'};return _0x36606b;}})});}_0x2dda63=_['merge']({},_0x2dda63,_0xf047ad[_0x4f84('0x3c')]);var _0x2ac58f={'where':_0x2dda63[_0x4f84('0x38')]};return db[_0x4f84('0x3d')][_0x4f84('0x1d')](_0x2ac58f)[_0x4f84('0x22')](function(_0x3cada8){_0x55a03c[_0x4f84('0x1d')]=_0x3cada8;if(_0xf047ad[_0x4f84('0x2f')]['includeAll']){_0x2dda63['include']=[{'all':!![]}];}return db['MailSubstatus'][_0x4f84('0x3e')](_0x2dda63);})['then'](function(_0x34d0a1){_0x55a03c['rows']=_0x34d0a1;return _0x55a03c;})['then'](respondWithFilteredResult(_0x345107,_0x2dda63))[_0x4f84('0x3f')](handleError(_0x345107,null));};exports[_0x4f84('0x40')]=function(_0x9a58f9,_0x97765d){var _0x1edbfd={'raw':!![],'where':{'id':_0x9a58f9[_0x4f84('0x41')]['id']}},_0x1caa87={};_0x1caa87['model']=_[_0x4f84('0x42')](db[_0x4f84('0x3d')][_0x4f84('0x2a')]);_0x1caa87[_0x4f84('0x2f')]=_[_0x4f84('0x42')](_0x9a58f9['query']);_0x1caa87[_0x4f84('0x30')]=_[_0x4f84('0x31')](_0x1caa87[_0x4f84('0x2e')],_0x1caa87[_0x4f84('0x2f')]);_0x1edbfd[_0x4f84('0x32')]=_[_0x4f84('0x31')](_0x1caa87[_0x4f84('0x2e')],qs[_0x4f84('0x33')](_0x9a58f9[_0x4f84('0x2f')][_0x4f84('0x33')]));_0x1edbfd[_0x4f84('0x32')]=_0x1edbfd[_0x4f84('0x32')][_0x4f84('0x34')]?_0x1edbfd['attributes']:_0x1caa87[_0x4f84('0x2e')];if(_0x9a58f9[_0x4f84('0x2f')][_0x4f84('0x43')]){_0x1edbfd['include']=[{'all':!![]}];}_0x1edbfd=_['merge']({},_0x1edbfd,_0x9a58f9[_0x4f84('0x3c')]);return db[_0x4f84('0x3d')]['find'](_0x1edbfd)['then'](handleEntityNotFound(_0x97765d,null))[_0x4f84('0x22')](respondWithResult(_0x97765d,null))['catch'](handleError(_0x97765d,null));};exports[_0x4f84('0x44')]=function(_0x1f4532,_0x14e2b0){return db['MailSubstatus'][_0x4f84('0x44')](_0x1f4532[_0x4f84('0x45')],{})['then'](respondWithResult(_0x14e2b0,0xc9))[_0x4f84('0x3f')](handleError(_0x14e2b0,null));};exports[_0x4f84('0x21')]=function(_0x5aa43a,_0x28048d){if(_0x5aa43a[_0x4f84('0x45')]['id']){delete _0x5aa43a[_0x4f84('0x45')]['id'];}return db[_0x4f84('0x3d')][_0x4f84('0x46')]({'where':{'id':_0x5aa43a[_0x4f84('0x41')]['id']}})[_0x4f84('0x22')](handleEntityNotFound(_0x28048d,null))['then'](saveUpdates(_0x5aa43a[_0x4f84('0x45')],null))[_0x4f84('0x22')](respondWithResult(_0x28048d,null))[_0x4f84('0x3f')](handleError(_0x28048d,null));};exports['destroy']=function(_0x2bc211,_0x32bd37){return db[_0x4f84('0x3d')][_0x4f84('0x46')]({'where':{'id':_0x2bc211['params']['id']}})[_0x4f84('0x22')](handleEntityNotFound(_0x32bd37,null))['then'](removeEntity(_0x32bd37,null))[_0x4f84('0x3f')](handleError(_0x32bd37,null));};exports[_0x4f84('0x47')]=function(_0x42b754,_0x364a13){return db[_0x4f84('0x3d')][_0x4f84('0x47')]()[_0x4f84('0x22')](respondWithResult(_0x364a13,null))[_0x4f84('0x3f')](handleError(_0x364a13,null));};
\ No newline at end of file
index 0750fb4..dcf94f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a8c=['hook','exports','events','../../mysqldb','MailSubstatus','update','emit','hasOwnProperty'];(function(_0x21b451,_0x26c9d9){var _0x4c53d2=function(_0x4c90a9){while(--_0x4c90a9){_0x21b451['push'](_0x21b451['shift']());}};_0x4c53d2(++_0x26c9d9);}(_0x3a8c,0xa2));var _0xc3a8=function(_0x31a6c4,_0x1dba34){_0x31a6c4=_0x31a6c4-0x0;var _0x3b4052=_0x3a8c[_0x31a6c4];return _0x3b4052;};'use strict';var EventEmitter=require(_0xc3a8('0x0'));var MailSubstatus=require(_0xc3a8('0x1'))['db'][_0xc3a8('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0xc3a8('0x3')};function emitEvent(_0x5c039d){return function(_0x5d7e98,_0x529d9a,_0x3c3c4e){MailSubstatusEvents[_0xc3a8('0x4')](_0x5c039d+':'+_0x5d7e98['id'],_0x5d7e98);MailSubstatusEvents[_0xc3a8('0x4')](_0x5c039d,_0x5d7e98);_0x3c3c4e(null);};}for(var e in events){if(events[_0xc3a8('0x5')](e)){var event=events[e];MailSubstatus[_0xc3a8('0x6')](e,emitEvent(event));}}module[_0xc3a8('0x7')]=MailSubstatusEvents;
\ No newline at end of file
+var _0xc95c=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xc95c,0x124));var _0xcc95=function(_0x15b0d0,_0x5547a9){_0x15b0d0=_0x15b0d0-0x0;var _0x16bfe6=_0xc95c[_0x15b0d0];return _0x16bfe6;};'use strict';var EventEmitter=require(_0xcc95('0x0'));var MailSubstatus=require(_0xcc95('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0xcc95('0x2')};function emitEvent(_0x280bac){return function(_0x1e0eaf,_0x4edc81,_0x1696d4){MailSubstatusEvents[_0xcc95('0x3')](_0x280bac+':'+_0x1e0eaf['id'],_0x1e0eaf);MailSubstatusEvents['emit'](_0x280bac,_0x1e0eaf);_0x1696d4(null);};}for(var e in events){if(events[_0xcc95('0x4')](e)){var event=events[e];MailSubstatus[_0xcc95('0x5')](e,emitEvent(event));}}module[_0xcc95('0x6')]=MailSubstatusEvents;
\ No newline at end of file
index 7984730..f3b1369 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ab8=['mail_substatuses','Condition','update','name','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes','exports','define'];(function(_0x5229d4,_0x66beb7){var _0x5813a6=function(_0x40e4ce){while(--_0x40e4ce){_0x5229d4['push'](_0x5229d4['shift']());}};_0x5813a6(++_0x66beb7);}(_0x9ab8,0x81));var _0x89ab=function(_0x616efe,_0x2ecbe1){_0x616efe=_0x616efe-0x0;var _0x2ae03c=_0x9ab8[_0x616efe];return _0x2ae03c;};'use strict';var attributes=require(_0x89ab('0x0'));module[_0x89ab('0x1')]=function(_0x23649f){var _0x530b31=_0x23649f['models'];return _0x23649f[_0x89ab('0x2')]('MailSubstatus',attributes,{'tableName':_0x89ab('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x490c1e,_0x50b72d,_0x19fc7e){return _0x530b31[_0x89ab('0x4')][_0x89ab('0x5')]({'value':_0x490c1e[_0x89ab('0x6')]},{'where':{'field':_0x89ab('0x7'),'value':_0x490c1e[_0x89ab('0x8')][_0x89ab('0x6')]}})[_0x89ab('0x9')](function(){_0x19fc7e();})[_0x89ab('0xa')](function(_0x254add){_0x19fc7e(_0x254add);});}}});};
\ No newline at end of file
+var _0xbd4a=['then','catch','exports','models','MailSubstatus','Condition','update','_previousDataValues','name'];(function(_0x2cbd11,_0x1b13a9){var _0x413c57=function(_0x1b20fc){while(--_0x1b20fc){_0x2cbd11['push'](_0x2cbd11['shift']());}};_0x413c57(++_0x1b13a9);}(_0xbd4a,0x119));var _0xabd4=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xbd4a[_0x4565bf];return _0x5610ba;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0xabd4('0x0')]=function(_0x596bb2){var _0x101cb7=_0x596bb2[_0xabd4('0x1')];return _0x596bb2['define'](_0xabd4('0x2'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x162ae0,_0x15ebb2,_0x5503c7){return _0x101cb7[_0xabd4('0x3')][_0xabd4('0x4')]({'value':_0x162ae0['name']},{'where':{'field':'mailSubstatus','value':_0x162ae0[_0xabd4('0x5')][_0xabd4('0x6')]}})[_0xabd4('0x7')](function(){_0x5503c7();})[_0xabd4('0x8')](function(_0x2039f1){_0x5503c7(_0x2039f1);});}}});};
\ No newline at end of file
index 9f3d5f3..ac164bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f03=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment'];(function(_0x543b14,_0x238ee5){var _0x4668c9=function(_0xa218d1){while(--_0xa218d1){_0x543b14['push'](_0x543b14['shift']());}};_0x4668c9(++_0x238ee5);}(_0x0f03,0x18e));var _0x30f0=function(_0x35b439,_0x3e1b23){_0x35b439=_0x35b439-0x0;var _0x4f4473=_0x0f03[_0x35b439];return _0x4f4473;};'use strict';var _=require('lodash');var util=require(_0x30f0('0x0'));var moment=require(_0x30f0('0x1'));var BPromise=require('bluebird');var rs=require(_0x30f0('0x2'));var fs=require('fs');var Redis=require(_0x30f0('0x3'));var db=require(_0x30f0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x30f0('0x5'))(_0x30f0('0x6'));var config=require('../../config/environment');var jayson=require(_0x30f0('0x7'));var client=jayson[_0x30f0('0x8')][_0x30f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c86d2,_0x31aa3a,_0x26d761){return new BPromise(function(_0x4e29fd,_0x1469ea){return client[_0x30f0('0xa')](_0x4c86d2,_0x26d761)[_0x30f0('0xb')](function(_0xc37b1d){logger[_0x30f0('0xc')](_0x30f0('0xd'),_0x31aa3a,_0x30f0('0xe'));logger['debug']('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x31aa3a,_0x30f0('0xe'),JSON[_0x30f0('0xf')](_0xc37b1d));if(_0xc37b1d['error']){if(_0xc37b1d[_0x30f0('0x10')][_0x30f0('0x11')]===0x1f4){logger[_0x30f0('0x10')](_0x30f0('0xd'),_0x31aa3a,_0xc37b1d[_0x30f0('0x10')][_0x30f0('0x12')]);return _0x1469ea(_0xc37b1d[_0x30f0('0x10')][_0x30f0('0x12')]);}logger[_0x30f0('0x10')](_0x30f0('0xd'),_0x31aa3a,_0xc37b1d[_0x30f0('0x10')][_0x30f0('0x12')]);return _0x4e29fd(_0xc37b1d[_0x30f0('0x10')][_0x30f0('0x12')]);}else{logger['info'](_0x30f0('0xd'),_0x31aa3a,_0x30f0('0xe'));_0x4e29fd(_0xc37b1d['result'][_0x30f0('0x12')]);}})[_0x30f0('0x13')](function(_0x56dd24){logger[_0x30f0('0x10')](_0x30f0('0xd'),_0x31aa3a,_0x56dd24);_0x1469ea(_0x56dd24);});});}
\ No newline at end of file
+var _0x6ed4=['debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailSubstatus,\x20%s,\x20%s'];(function(_0x5d5cde,_0x8b3c2e){var _0x14e6bd=function(_0x149d2a){while(--_0x149d2a){_0x5d5cde['push'](_0x5d5cde['shift']());}};_0x14e6bd(++_0x8b3c2e);}(_0x6ed4,0x99));var _0x46ed=function(_0x5eb83a,_0x183f31){_0x5eb83a=_0x5eb83a-0x0;var _0x3b4da5=_0x6ed4[_0x5eb83a];return _0x3b4da5;};'use strict';var _=require(_0x46ed('0x0'));var util=require(_0x46ed('0x1'));var moment=require(_0x46ed('0x2'));var BPromise=require(_0x46ed('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x46ed('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x46ed('0x5'));var logger=require(_0x46ed('0x6'))(_0x46ed('0x7'));var config=require(_0x46ed('0x8'));var jayson=require(_0x46ed('0x9'));var client=jayson[_0x46ed('0xa')][_0x46ed('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x285171,_0x4b1899,_0x3daaf2){return new BPromise(function(_0x228d4a,_0x523d2d){return client['request'](_0x285171,_0x3daaf2)[_0x46ed('0xc')](function(_0x38f781){logger[_0x46ed('0xd')](_0x46ed('0xe'),_0x4b1899,'request\x20sent');logger[_0x46ed('0xf')](_0x46ed('0x10'),_0x4b1899,_0x46ed('0x11'),JSON[_0x46ed('0x12')](_0x38f781));if(_0x38f781[_0x46ed('0x13')]){if(_0x38f781[_0x46ed('0x13')][_0x46ed('0x14')]===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x4b1899,_0x38f781[_0x46ed('0x13')][_0x46ed('0x15')]);return _0x523d2d(_0x38f781['error']['message']);}logger[_0x46ed('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x4b1899,_0x38f781['error'][_0x46ed('0x15')]);return _0x228d4a(_0x38f781[_0x46ed('0x13')][_0x46ed('0x15')]);}else{logger[_0x46ed('0xd')](_0x46ed('0xe'),_0x4b1899,_0x46ed('0x11'));_0x228d4a(_0x38f781[_0x46ed('0x16')][_0x46ed('0x15')]);}})[_0x46ed('0x17')](function(_0x19d85e){logger[_0x46ed('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x4b1899,_0x19d85e);_0x523d2d(_0x19d85e);});});}
\ No newline at end of file
index 4ae00f6..2c9006e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b81=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','post','create','put','/:id','update','delete','exports'];(function(_0x3e723b,_0x5aad35){var _0x16ebf4=function(_0x4828f2){while(--_0x4828f2){_0x3e723b['push'](_0x3e723b['shift']());}};_0x16ebf4(++_0x5aad35);}(_0x4b81,0x104));var _0x14b8=function(_0x5921fc,_0x3f5277){_0x5921fc=_0x5921fc-0x0;var _0x35f8f0=_0x4b81[_0x5921fc];return _0x35f8f0;};'use strict';var multer=require(_0x14b8('0x0'));var util=require(_0x14b8('0x1'));var path=require(_0x14b8('0x2'));var timeout=require(_0x14b8('0x3'));var express=require('express');var router=express[_0x14b8('0x4')]();var fs_extra=require(_0x14b8('0x5'));var auth=require(_0x14b8('0x6'));var interaction=require(_0x14b8('0x7'));var config=require(_0x14b8('0x8'));var controller=require('./mailTransferReport.controller');router[_0x14b8('0x9')]('/',auth['isAuthenticated'](),controller[_0x14b8('0xa')]);router[_0x14b8('0x9')]('/describe',auth[_0x14b8('0xb')](),controller[_0x14b8('0xc')]);router['get']('/:id',auth[_0x14b8('0xb')](),controller['show']);router[_0x14b8('0xd')]('/',auth[_0x14b8('0xb')](),controller[_0x14b8('0xe')]);router[_0x14b8('0xf')](_0x14b8('0x10'),auth['isAuthenticated'](),controller[_0x14b8('0x11')]);router[_0x14b8('0x12')](_0x14b8('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x14b8('0x13')]=router;
\ No newline at end of file
+var _0xf141=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','get','describe','show','post','/:id','update','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf141,0x17a));var _0x1f14=function(_0x3c1ed4,_0x5b0e1d){_0x3c1ed4=_0x3c1ed4-0x0;var _0x4bd601=_0xf141[_0x3c1ed4];return _0x4bd601;};'use strict';var multer=require(_0x1f14('0x0'));var util=require(_0x1f14('0x1'));var path=require('path');var timeout=require(_0x1f14('0x2'));var express=require(_0x1f14('0x3'));var router=express[_0x1f14('0x4')]();var fs_extra=require(_0x1f14('0x5'));var auth=require(_0x1f14('0x6'));var interaction=require(_0x1f14('0x7'));var config=require(_0x1f14('0x8'));var controller=require(_0x1f14('0x9'));router['get']('/',auth[_0x1f14('0xa')](),controller['index']);router[_0x1f14('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x1f14('0xc')]);router[_0x1f14('0xb')]('/:id',auth[_0x1f14('0xa')](),controller[_0x1f14('0xd')]);router[_0x1f14('0xe')]('/',auth[_0x1f14('0xa')](),controller['create']);router['put'](_0x1f14('0xf'),auth[_0x1f14('0xa')](),controller[_0x1f14('0x10')]);router['delete'](_0x1f14('0xf'),auth[_0x1f14('0xa')](),controller[_0x1f14('0x11')]);module['exports']=router;
\ No newline at end of file
index aa28c5b..8fe9968 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(_0x3eee78,_0x5acc63){var _0x53a5e5=function(_0x472fb6){while(--_0x472fb6){_0x3eee78['push'](_0x3eee78['shift']());}};_0x53a5e5(++_0x5acc63);}(_0x34e8,0x12c));var _0x834e=function(_0x2d9550,_0x319cdb){_0x2d9550=_0x2d9550-0x0;var _0x4c312c=_0x34e8[_0x2d9550];return _0x4c312c;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}};
\ No newline at end of file
+var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x1b3774,_0x2a94da){var _0x2ce24c=function(_0x105924){while(--_0x105924){_0x1b3774['push'](_0x1b3774['shift']());}};_0x2ce24c(++_0x2a94da);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x4b64a4,_0x1bdc50){_0x4b64a4=_0x4b64a4-0x0;var _0xd19b0e=_0xf3cd[_0x4b64a4];return _0xd19b0e;};'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
index 6dd6d44..635f0a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x096d=['rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','sendStatus','error','stack','name','send','index','MailTransferReport','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','include','find','create','body','update','params','destroy','describe'];(function(_0x1a7fcc,_0x2c3737){var _0x5c8a54=function(_0x2d35b3){while(--_0x2d35b3){_0x1a7fcc['push'](_0x1a7fcc['shift']());}};_0x5c8a54(++_0x2c3737);}(_0x096d,0x9a));var _0xd096=function(_0x443e9e,_0x3c1baf){_0x443e9e=_0x443e9e-0x0;var _0x5db340=_0x096d[_0x443e9e];return _0x5db340;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd096('0x0'));var zipdir=require(_0xd096('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd096('0x2'));var BPromise=require(_0xd096('0x3'));var Mustache=require(_0xd096('0x4'));var util=require(_0xd096('0x5'));var path=require(_0xd096('0x6'));var sox=require(_0xd096('0x7'));var csv=require(_0xd096('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd096('0x9'));var _=require('lodash');var squel=require(_0xd096('0xa'));var crypto=require(_0xd096('0xb'));var jsforce=require(_0xd096('0xc'));var deskjs=require(_0xd096('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd096('0xe'));var Papa=require('papaparse');var Redis=require(_0xd096('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd096('0x10'));var as=require(_0xd096('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd096('0x12'))(_0xd096('0x13'));var utils=require('../../config/utils');var config=require(_0xd096('0x14'));var licenseUtil=require(_0xd096('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bd482,_0xf0bee3){_0xf0bee3=_0xf0bee3||0xcc;return function(_0x41b16f){if(_0x41b16f){return _0x2bd482['sendStatus'](_0xf0bee3);}return _0x2bd482[_0xd096('0x16')](_0xf0bee3)[_0xd096('0x17')]();};}function respondWithResult(_0xa3c5ca,_0x328d4c){_0x328d4c=_0x328d4c||0xc8;return function(_0x1a36d3){if(_0x1a36d3){return _0xa3c5ca[_0xd096('0x16')](_0x328d4c)['json'](_0x1a36d3);}};}function respondWithFilteredResult(_0x12098c,_0x1280cc){return function(_0x5b04ed){if(_0x5b04ed){var _0x41dbf5=typeof _0x1280cc[_0xd096('0x18')]===_0xd096('0x19')&&typeof _0x1280cc[_0xd096('0x1a')]===_0xd096('0x19');var _0x407f2c=_0x5b04ed[_0xd096('0x1b')];var _0x5e65e4=_0x41dbf5?0x0:_0x1280cc['offset'];var _0x2f283e=_0x41dbf5?_0x5b04ed['count']:_0x1280cc[_0xd096('0x18')]+_0x1280cc[_0xd096('0x1a')];var _0x54c4f8;if(_0x2f283e>=_0x407f2c){_0x2f283e=_0x407f2c;_0x54c4f8=0xc8;}else{_0x54c4f8=0xce;}_0x12098c[_0xd096('0x16')](_0x54c4f8);return _0x12098c['set'](_0xd096('0x1c'),_0x5e65e4+'-'+_0x2f283e+'/'+_0x407f2c)[_0xd096('0x1d')](_0x5b04ed);}return null;};}function patchUpdates(_0x120b2a){return function(_0x1d997d){try{jsonpatch[_0xd096('0x1e')](_0x1d997d,_0x120b2a,!![]);}catch(_0x4092b2){return BPromise[_0xd096('0x1f')](_0x4092b2);}return _0x1d997d[_0xd096('0x20')]();};}function saveUpdates(_0x9424ce,_0x394ffd){return function(_0x4b9a6d){if(_0x4b9a6d){return _0x4b9a6d['update'](_0x9424ce)[_0xd096('0x21')](function(_0x18b076){return _0x18b076;});}return null;};}function removeEntity(_0x10f06e,_0x2b144a){return function(_0x33ecdf){if(_0x33ecdf){return _0x33ecdf['destroy']()[_0xd096('0x21')](function(){_0x10f06e[_0xd096('0x16')](0xcc)[_0xd096('0x17')]();});}};}function handleEntityNotFound(_0x2cf23f,_0x1bbd17){return function(_0x55147e){if(!_0x55147e){_0x2cf23f[_0xd096('0x22')](0x194);}return _0x55147e;};}function handleError(_0x2c0ece,_0x1dba1b){_0x1dba1b=_0x1dba1b||0x1f4;return function(_0x319bbe){logger[_0xd096('0x23')](_0x319bbe[_0xd096('0x24')]);if(_0x319bbe[_0xd096('0x25')]){delete _0x319bbe['name'];}_0x2c0ece[_0xd096('0x16')](_0x1dba1b)[_0xd096('0x26')](_0x319bbe);};}exports[_0xd096('0x27')]=function(_0x781b92,_0x457da7){var _0x470d3f={},_0x22c45e={},_0x2f00c9={'count':0x0,'rows':[]};var _0x1751c9=_['map'](db[_0xd096('0x28')][_0xd096('0x29')],function(_0x31325d){return{'name':_0x31325d[_0xd096('0x2a')],'type':_0x31325d['type'][_0xd096('0x2b')]};});_0x22c45e[_0xd096('0x2c')]=_[_0xd096('0x2d')](_0x1751c9,_0xd096('0x25'));_0x22c45e[_0xd096('0x2e')]=_[_0xd096('0x2f')](_0x781b92[_0xd096('0x2e')]);_0x22c45e['filters']=_[_0xd096('0x30')](_0x22c45e[_0xd096('0x2c')],_0x22c45e[_0xd096('0x2e')]);_0x470d3f[_0xd096('0x31')]=_[_0xd096('0x30')](_0x22c45e[_0xd096('0x2c')],qs[_0xd096('0x32')](_0x781b92[_0xd096('0x2e')][_0xd096('0x32')]));_0x470d3f[_0xd096('0x31')]=_0x470d3f[_0xd096('0x31')][_0xd096('0x33')]?_0x470d3f[_0xd096('0x31')]:_0x22c45e[_0xd096('0x2c')];if(!_0x781b92[_0xd096('0x2e')][_0xd096('0x34')](_0xd096('0x35'))){_0x470d3f[_0xd096('0x1a')]=qs[_0xd096('0x1a')](_0x781b92[_0xd096('0x2e')][_0xd096('0x1a')]);_0x470d3f[_0xd096('0x18')]=qs['offset'](_0x781b92['query'][_0xd096('0x18')]);}_0x470d3f[_0xd096('0x36')]=qs[_0xd096('0x37')](_0x781b92['query'][_0xd096('0x37')]);_0x470d3f[_0xd096('0x38')]=qs[_0xd096('0x39')](_[_0xd096('0x3a')](_0x781b92[_0xd096('0x2e')],_0x22c45e[_0xd096('0x39')]),_0x1751c9);if(_0x781b92['query'][_0xd096('0x3b')]){_0x470d3f[_0xd096('0x38')]=_['merge'](_0x470d3f[_0xd096('0x38')],{'$or':_[_0xd096('0x2d')](_0x1751c9,function(_0x394f75){if(_0x394f75[_0xd096('0x3c')]!==_0xd096('0x3d')){var _0x13e0a9={};_0x13e0a9[_0x394f75[_0xd096('0x25')]]={'$like':'%'+_0x781b92[_0xd096('0x2e')][_0xd096('0x3b')]+'%'};return _0x13e0a9;}})});}_0x470d3f=_[_0xd096('0x3e')]({},_0x470d3f,_0x781b92[_0xd096('0x3f')]);var _0xb2fe4={'where':_0x470d3f[_0xd096('0x38')]};return db[_0xd096('0x28')]['count'](_0xb2fe4)[_0xd096('0x21')](function(_0x56d3d2){_0x2f00c9['count']=_0x56d3d2;if(_0x781b92[_0xd096('0x2e')][_0xd096('0x40')]){_0x470d3f['include']=[{'all':!![]}];}return db['MailTransferReport'][_0xd096('0x41')](_0x470d3f);})[_0xd096('0x21')](function(_0x34efba){_0x2f00c9[_0xd096('0x42')]=_0x34efba;return _0x2f00c9;})[_0xd096('0x21')](respondWithFilteredResult(_0x457da7,_0x470d3f))[_0xd096('0x43')](handleError(_0x457da7,null));};exports[_0xd096('0x44')]=function(_0x1d9f68,_0x948a27){var _0x300258={'raw':!![],'where':{'id':_0x1d9f68['params']['id']}},_0x2ea85c={};_0x2ea85c[_0xd096('0x2c')]=_['keys'](db[_0xd096('0x28')]['rawAttributes']);_0x2ea85c[_0xd096('0x2e')]=_['keys'](_0x1d9f68[_0xd096('0x2e')]);_0x2ea85c[_0xd096('0x39')]=_['intersection'](_0x2ea85c[_0xd096('0x2c')],_0x2ea85c[_0xd096('0x2e')]);_0x300258[_0xd096('0x31')]=_[_0xd096('0x30')](_0x2ea85c[_0xd096('0x2c')],qs[_0xd096('0x32')](_0x1d9f68[_0xd096('0x2e')]['fields']));_0x300258[_0xd096('0x31')]=_0x300258[_0xd096('0x31')][_0xd096('0x33')]?_0x300258[_0xd096('0x31')]:_0x2ea85c[_0xd096('0x2c')];if(_0x1d9f68['query'][_0xd096('0x40')]){_0x300258[_0xd096('0x45')]=[{'all':!![]}];}_0x300258=_[_0xd096('0x3e')]({},_0x300258,_0x1d9f68[_0xd096('0x3f')]);return db[_0xd096('0x28')][_0xd096('0x46')](_0x300258)[_0xd096('0x21')](handleEntityNotFound(_0x948a27,null))[_0xd096('0x21')](respondWithResult(_0x948a27,null))['catch'](handleError(_0x948a27,null));};exports[_0xd096('0x47')]=function(_0x386a0b,_0x2c73a2){return db[_0xd096('0x28')]['create'](_0x386a0b[_0xd096('0x48')],{})[_0xd096('0x21')](respondWithResult(_0x2c73a2,0xc9))[_0xd096('0x43')](handleError(_0x2c73a2,null));};exports[_0xd096('0x49')]=function(_0x9352c0,_0xf7f0d){if(_0x9352c0[_0xd096('0x48')]['id']){delete _0x9352c0[_0xd096('0x48')]['id'];}return db[_0xd096('0x28')][_0xd096('0x46')]({'where':{'id':_0x9352c0[_0xd096('0x4a')]['id']}})[_0xd096('0x21')](handleEntityNotFound(_0xf7f0d,null))[_0xd096('0x21')](saveUpdates(_0x9352c0[_0xd096('0x48')],null))[_0xd096('0x21')](respondWithResult(_0xf7f0d,null))[_0xd096('0x43')](handleError(_0xf7f0d,null));};exports[_0xd096('0x4b')]=function(_0x381f96,_0xf91aac){return db[_0xd096('0x28')][_0xd096('0x46')]({'where':{'id':_0x381f96[_0xd096('0x4a')]['id']}})[_0xd096('0x21')](handleEntityNotFound(_0xf91aac,null))[_0xd096('0x21')](removeEntity(_0xf91aac,null))[_0xd096('0x43')](handleError(_0xf91aac,null));};exports['describe']=function(_0x6aa1b0,_0x53ac91){return db[_0xd096('0x28')][_0xd096('0x4c')]()[_0xd096('0x21')](respondWithResult(_0x53ac91,null))[_0xd096('0x43')](handleError(_0x53ac91,null));};
\ No newline at end of file
+var _0xb1db=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','MailTransferReport','then','includeAll','include','findAll','catch','show','params','fields','options','find','create','body','describe','eml-format','rimraf','request-promise','moment','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0xee51f8,_0x13dd4d){var _0x108227=function(_0x74a7ce){while(--_0x74a7ce){_0xee51f8['push'](_0xee51f8['shift']());}};_0x108227(++_0x13dd4d);}(_0xb1db,0x88));var _0xbb1d=function(_0xb71bc3,_0x435a43){_0xb71bc3=_0xb71bc3-0x0;var _0x24beb7=_0xb1db[_0xb71bc3];return _0x24beb7;};'use strict';var emlformat=require(_0xbb1d('0x0'));var rimraf=require(_0xbb1d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbb1d('0x2'));var moment=require(_0xbb1d('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbb1d('0x4'));var path=require(_0xbb1d('0x5'));var sox=require('sox');var csv=require(_0xbb1d('0x6'));var ejs=require(_0xbb1d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb1d('0x8'));var squel=require('squel');var crypto=require(_0xbb1d('0x9'));var jsforce=require(_0xbb1d('0xa'));var deskjs=require(_0xbb1d('0xb'));var toCsv=require('to-csv');var querystring=require(_0xbb1d('0xc'));var Papa=require(_0xbb1d('0xd'));var Redis=require('ioredis');var authService=require(_0xbb1d('0xe'));var qs=require(_0xbb1d('0xf'));var as=require(_0xbb1d('0x10'));var hardwareService=require(_0xbb1d('0x11'));var logger=require(_0xbb1d('0x12'))(_0xbb1d('0x13'));var utils=require(_0xbb1d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xbb1d('0x15'));var db=require(_0xbb1d('0x16'))['db'];function respondWithStatusCode(_0x4ce52f,_0x50b0c7){_0x50b0c7=_0x50b0c7||0xcc;return function(_0x2a5674){if(_0x2a5674){return _0x4ce52f[_0xbb1d('0x17')](_0x50b0c7);}return _0x4ce52f['status'](_0x50b0c7)[_0xbb1d('0x18')]();};}function respondWithResult(_0x1f314e,_0x4163bc){_0x4163bc=_0x4163bc||0xc8;return function(_0x9af799){if(_0x9af799){return _0x1f314e['status'](_0x4163bc)[_0xbb1d('0x19')](_0x9af799);}};}function respondWithFilteredResult(_0x34cbc0,_0x398d81){return function(_0x37e881){if(_0x37e881){var _0x59d70f=typeof _0x398d81[_0xbb1d('0x1a')]===_0xbb1d('0x1b')&&typeof _0x398d81[_0xbb1d('0x1c')]==='undefined';var _0x29758d=_0x37e881['count'];var _0x54e086=_0x59d70f?0x0:_0x398d81[_0xbb1d('0x1a')];var _0x57fe88=_0x59d70f?_0x37e881[_0xbb1d('0x1d')]:_0x398d81[_0xbb1d('0x1a')]+_0x398d81[_0xbb1d('0x1c')];var _0x337428;if(_0x57fe88>=_0x29758d){_0x57fe88=_0x29758d;_0x337428=0xc8;}else{_0x337428=0xce;}_0x34cbc0[_0xbb1d('0x1e')](_0x337428);return _0x34cbc0[_0xbb1d('0x1f')](_0xbb1d('0x20'),_0x54e086+'-'+_0x57fe88+'/'+_0x29758d)[_0xbb1d('0x19')](_0x37e881);}return null;};}function patchUpdates(_0x31d65d){return function(_0x3f9617){try{jsonpatch[_0xbb1d('0x21')](_0x3f9617,_0x31d65d,!![]);}catch(_0x1d8617){return BPromise[_0xbb1d('0x22')](_0x1d8617);}return _0x3f9617[_0xbb1d('0x23')]();};}function saveUpdates(_0x4338ca,_0x35fd09){return function(_0x2a2c73){if(_0x2a2c73){return _0x2a2c73['update'](_0x4338ca)['then'](function(_0x2e132e){return _0x2e132e;});}return null;};}function removeEntity(_0x1638a3,_0x4bdf41){return function(_0x1f7ffb){if(_0x1f7ffb){return _0x1f7ffb[_0xbb1d('0x24')]()['then'](function(){_0x1638a3[_0xbb1d('0x1e')](0xcc)[_0xbb1d('0x18')]();});}};}function handleEntityNotFound(_0x36170c,_0x530a57){return function(_0x463ac8){if(!_0x463ac8){_0x36170c[_0xbb1d('0x17')](0x194);}return _0x463ac8;};}function handleError(_0x12a581,_0x62cfbc){_0x62cfbc=_0x62cfbc||0x1f4;return function(_0x26cdf7){logger[_0xbb1d('0x25')](_0x26cdf7[_0xbb1d('0x26')]);if(_0x26cdf7[_0xbb1d('0x27')]){delete _0x26cdf7[_0xbb1d('0x27')];}_0x12a581[_0xbb1d('0x1e')](_0x62cfbc)[_0xbb1d('0x28')](_0x26cdf7);};}exports[_0xbb1d('0x29')]=function(_0x58ada5,_0x4d0cf3){var _0x223179={},_0x58d2e9={},_0x5cf596={'count':0x0,'rows':[]};var _0x4cf311=_['map'](db['MailTransferReport'][_0xbb1d('0x2a')],function(_0x26b52e){return{'name':_0x26b52e[_0xbb1d('0x2b')],'type':_0x26b52e[_0xbb1d('0x2c')][_0xbb1d('0x2d')]};});_0x58d2e9[_0xbb1d('0x2e')]=_[_0xbb1d('0x2f')](_0x4cf311,_0xbb1d('0x27'));_0x58d2e9[_0xbb1d('0x30')]=_[_0xbb1d('0x31')](_0x58ada5[_0xbb1d('0x30')]);_0x58d2e9[_0xbb1d('0x32')]=_[_0xbb1d('0x33')](_0x58d2e9[_0xbb1d('0x2e')],_0x58d2e9['query']);_0x223179[_0xbb1d('0x34')]=_[_0xbb1d('0x33')](_0x58d2e9[_0xbb1d('0x2e')],qs['fields'](_0x58ada5[_0xbb1d('0x30')]['fields']));_0x223179[_0xbb1d('0x34')]=_0x223179[_0xbb1d('0x34')][_0xbb1d('0x35')]?_0x223179['attributes']:_0x58d2e9[_0xbb1d('0x2e')];if(!_0x58ada5['query'][_0xbb1d('0x36')](_0xbb1d('0x37'))){_0x223179[_0xbb1d('0x1c')]=qs['limit'](_0x58ada5[_0xbb1d('0x30')][_0xbb1d('0x1c')]);_0x223179[_0xbb1d('0x1a')]=qs[_0xbb1d('0x1a')](_0x58ada5[_0xbb1d('0x30')][_0xbb1d('0x1a')]);}_0x223179[_0xbb1d('0x38')]=qs['sort'](_0x58ada5[_0xbb1d('0x30')][_0xbb1d('0x39')]);_0x223179[_0xbb1d('0x3a')]=qs[_0xbb1d('0x32')](_['pick'](_0x58ada5[_0xbb1d('0x30')],_0x58d2e9[_0xbb1d('0x32')]),_0x4cf311);if(_0x58ada5[_0xbb1d('0x30')][_0xbb1d('0x3b')]){_0x223179[_0xbb1d('0x3a')]=_[_0xbb1d('0x3c')](_0x223179[_0xbb1d('0x3a')],{'$or':_['map'](_0x4cf311,function(_0x346d8f){if(_0x346d8f['type']!=='VIRTUAL'){var _0x2d9da2={};_0x2d9da2[_0x346d8f[_0xbb1d('0x27')]]={'$like':'%'+_0x58ada5[_0xbb1d('0x30')]['filter']+'%'};return _0x2d9da2;}})});}_0x223179=_['merge']({},_0x223179,_0x58ada5['options']);var _0x46c0d4={'where':_0x223179[_0xbb1d('0x3a')]};return db[_0xbb1d('0x3d')]['count'](_0x46c0d4)[_0xbb1d('0x3e')](function(_0x14d72e){_0x5cf596[_0xbb1d('0x1d')]=_0x14d72e;if(_0x58ada5[_0xbb1d('0x30')][_0xbb1d('0x3f')]){_0x223179[_0xbb1d('0x40')]=[{'all':!![]}];}return db[_0xbb1d('0x3d')][_0xbb1d('0x41')](_0x223179);})['then'](function(_0x1c8e97){_0x5cf596['rows']=_0x1c8e97;return _0x5cf596;})[_0xbb1d('0x3e')](respondWithFilteredResult(_0x4d0cf3,_0x223179))[_0xbb1d('0x42')](handleError(_0x4d0cf3,null));};exports[_0xbb1d('0x43')]=function(_0x8e8771,_0x311c08){var _0x147178={'raw':!![],'where':{'id':_0x8e8771[_0xbb1d('0x44')]['id']}},_0x5e3503={};_0x5e3503[_0xbb1d('0x2e')]=_[_0xbb1d('0x31')](db[_0xbb1d('0x3d')][_0xbb1d('0x2a')]);_0x5e3503[_0xbb1d('0x30')]=_[_0xbb1d('0x31')](_0x8e8771[_0xbb1d('0x30')]);_0x5e3503['filters']=_['intersection'](_0x5e3503['model'],_0x5e3503['query']);_0x147178['attributes']=_[_0xbb1d('0x33')](_0x5e3503[_0xbb1d('0x2e')],qs[_0xbb1d('0x45')](_0x8e8771[_0xbb1d('0x30')][_0xbb1d('0x45')]));_0x147178['attributes']=_0x147178[_0xbb1d('0x34')][_0xbb1d('0x35')]?_0x147178[_0xbb1d('0x34')]:_0x5e3503[_0xbb1d('0x2e')];if(_0x8e8771[_0xbb1d('0x30')][_0xbb1d('0x3f')]){_0x147178[_0xbb1d('0x40')]=[{'all':!![]}];}_0x147178=_[_0xbb1d('0x3c')]({},_0x147178,_0x8e8771[_0xbb1d('0x46')]);return db['MailTransferReport'][_0xbb1d('0x47')](_0x147178)[_0xbb1d('0x3e')](handleEntityNotFound(_0x311c08,null))[_0xbb1d('0x3e')](respondWithResult(_0x311c08,null))[_0xbb1d('0x42')](handleError(_0x311c08,null));};exports[_0xbb1d('0x48')]=function(_0x506a97,_0x3494df){return db[_0xbb1d('0x3d')][_0xbb1d('0x48')](_0x506a97['body'],{})[_0xbb1d('0x3e')](respondWithResult(_0x3494df,0xc9))['catch'](handleError(_0x3494df,null));};exports['update']=function(_0x284cd7,_0x4892be){if(_0x284cd7['body']['id']){delete _0x284cd7[_0xbb1d('0x49')]['id'];}return db[_0xbb1d('0x3d')]['find']({'where':{'id':_0x284cd7['params']['id']}})['then'](handleEntityNotFound(_0x4892be,null))[_0xbb1d('0x3e')](saveUpdates(_0x284cd7[_0xbb1d('0x49')],null))[_0xbb1d('0x3e')](respondWithResult(_0x4892be,null))[_0xbb1d('0x42')](handleError(_0x4892be,null));};exports[_0xbb1d('0x24')]=function(_0x3f45c6,_0x4eb582){return db['MailTransferReport'][_0xbb1d('0x47')]({'where':{'id':_0x3f45c6[_0xbb1d('0x44')]['id']}})[_0xbb1d('0x3e')](handleEntityNotFound(_0x4eb582,null))[_0xbb1d('0x3e')](removeEntity(_0x4eb582,null))['catch'](handleError(_0x4eb582,null));};exports['describe']=function(_0x350ca8,_0x462f35){return db[_0xbb1d('0x3d')][_0xbb1d('0x4a')]()['then'](respondWithResult(_0x462f35,null))[_0xbb1d('0x42')](handleError(_0x462f35,null));};
\ No newline at end of file
index 632ac7b..9a6623e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['../../config/logger','api','moment','path','../../config/environment','./mailTransferReport.attributes','exports','MailTransferReport','report_mail_transfer','uniqueid','lodash'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x3e74,0x175));var _0x43e7=function(_0x373f2b,_0x29893f){_0x373f2b=_0x373f2b-0x0;var _0x500ab6=_0x3e74[_0x373f2b];return _0x500ab6;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[{'name':_0x43e7('0xa'),'fields':[_0x43e7('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x212b=['exports','MailTransferReport','report_mail_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x172720,_0x833c20){var _0x5106c1=function(_0x2f70a2){while(--_0x2f70a2){_0x172720['push'](_0x172720['shift']());}};_0x5106c1(++_0x833c20);}(_0x212b,0x148));var _0xb212=function(_0x3dacbd,_0x58fe95){_0x3dacbd=_0x3dacbd-0x0;var _0x232895=_0x212b[_0x3dacbd];return _0x232895;};'use strict';var _=require(_0xb212('0x0'));var util=require('util');var logger=require(_0xb212('0x1'))(_0xb212('0x2'));var moment=require(_0xb212('0x3'));var BPromise=require(_0xb212('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb212('0x5'));var rimraf=require(_0xb212('0x6'));var config=require(_0xb212('0x7'));var attributes=require('./mailTransferReport.attributes');module[_0xb212('0x8')]=function(_0x49a13c,_0x21825a){return _0x49a13c['define'](_0xb212('0x9'),attributes,{'tableName':_0xb212('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb212('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index c96af65..6ffc1eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3707=['error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x482815,_0x3601b1){var _0x272d11=function(_0x414e63){while(--_0x414e63){_0x482815['push'](_0x482815['shift']());}};_0x272d11(++_0x3601b1);}(_0x3707,0x14b));var _0x7370=function(_0x348c9a,_0x17e3cd){_0x348c9a=_0x348c9a-0x0;var _0x5249f4=_0x3707[_0x348c9a];return _0x5249f4;};'use strict';var _=require(_0x7370('0x0'));var util=require(_0x7370('0x1'));var moment=require(_0x7370('0x2'));var BPromise=require(_0x7370('0x3'));var rs=require(_0x7370('0x4'));var fs=require('fs');var Redis=require(_0x7370('0x5'));var db=require(_0x7370('0x6'))['db'];var utils=require(_0x7370('0x7'));var logger=require(_0x7370('0x8'))(_0x7370('0x9'));var config=require(_0x7370('0xa'));var jayson=require(_0x7370('0xb'));var client=jayson[_0x7370('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x574ad5,_0x201093,_0x35fd0e){return new BPromise(function(_0x1a2680,_0x4330dd){return client[_0x7370('0xd')](_0x574ad5,_0x35fd0e)['then'](function(_0x3e01d0){logger[_0x7370('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x201093,_0x7370('0xf'));logger[_0x7370('0x10')](_0x7370('0x11'),_0x201093,_0x7370('0xf'),JSON[_0x7370('0x12')](_0x3e01d0));if(_0x3e01d0[_0x7370('0x13')]){if(_0x3e01d0[_0x7370('0x13')][_0x7370('0x14')]===0x1f4){logger[_0x7370('0x13')](_0x7370('0x15'),_0x201093,_0x3e01d0[_0x7370('0x13')]['message']);return _0x4330dd(_0x3e01d0['error'][_0x7370('0x16')]);}logger[_0x7370('0x13')](_0x7370('0x15'),_0x201093,_0x3e01d0['error'][_0x7370('0x16')]);return _0x1a2680(_0x3e01d0['error'][_0x7370('0x16')]);}else{logger[_0x7370('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x201093,_0x7370('0xf'));_0x1a2680(_0x3e01d0[_0x7370('0x17')]['message']);}})[_0x7370('0x18')](function(_0x1a371a){logger[_0x7370('0x13')](_0x7370('0x15'),_0x201093,_0x1a371a);_0x4330dd(_0x1a371a);});});}
\ No newline at end of file
+var _0x663d=['message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x495b01,_0x1a33b7){var _0x5ac8bc=function(_0x33a5bc){while(--_0x33a5bc){_0x495b01['push'](_0x495b01['shift']());}};_0x5ac8bc(++_0x1a33b7);}(_0x663d,0x18e));var _0xd663=function(_0x490151,_0x408c85){_0x490151=_0x490151-0x0;var _0x5d8673=_0x663d[_0x490151];return _0x5d8673;};'use strict';var _=require(_0xd663('0x0'));var util=require('util');var moment=require(_0xd663('0x1'));var BPromise=require(_0xd663('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd663('0x3'));var db=require(_0xd663('0x4'))['db'];var utils=require(_0xd663('0x5'));var logger=require(_0xd663('0x6'))(_0xd663('0x7'));var config=require(_0xd663('0x8'));var jayson=require(_0xd663('0x9'));var client=jayson['client'][_0xd663('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46f2d3,_0x2fea21,_0x34e665){return new BPromise(function(_0x389fd8,_0x48339c){return client[_0xd663('0xb')](_0x46f2d3,_0x34e665)[_0xd663('0xc')](function(_0xa9aa82){logger[_0xd663('0xd')](_0xd663('0xe'),_0x2fea21,'request\x20sent');logger[_0xd663('0xf')](_0xd663('0x10'),_0x2fea21,_0xd663('0x11'),JSON['stringify'](_0xa9aa82));if(_0xa9aa82['error']){if(_0xa9aa82[_0xd663('0x12')][_0xd663('0x13')]===0x1f4){logger['error'](_0xd663('0xe'),_0x2fea21,_0xa9aa82[_0xd663('0x12')][_0xd663('0x14')]);return _0x48339c(_0xa9aa82[_0xd663('0x12')][_0xd663('0x14')]);}logger['error'](_0xd663('0xe'),_0x2fea21,_0xa9aa82['error'][_0xd663('0x14')]);return _0x389fd8(_0xa9aa82['error'][_0xd663('0x14')]);}else{logger[_0xd663('0xd')](_0xd663('0xe'),_0x2fea21,_0xd663('0x11'));_0x389fd8(_0xa9aa82['result'][_0xd663('0x14')]);}})[_0xd663('0x15')](function(_0x1435c3){logger[_0xd663('0x12')](_0xd663('0xe'),_0x2fea21,_0x1435c3);_0x48339c(_0x1435c3);});});}
\ No newline at end of file
index 90f8cd7..319180c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c7e=['put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./memberReport.controller','get','index','/describe','describe','isAuthenticated','show','post'];(function(_0x441ef6,_0xe1d009){var _0x19e8df=function(_0xbebf8){while(--_0xbebf8){_0x441ef6['push'](_0x441ef6['shift']());}};_0x19e8df(++_0xe1d009);}(_0x9c7e,0x182));var _0xe9c7=function(_0x137728,_0x3ccab8){_0x137728=_0x137728-0x0;var _0x95a1ce=_0x9c7e[_0x137728];return _0x95a1ce;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe9c7('0x0'));var timeout=require(_0xe9c7('0x1'));var express=require(_0xe9c7('0x2'));var router=express[_0xe9c7('0x3')]();var fs_extra=require(_0xe9c7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe9c7('0x5'));var config=require('../../config/environment');var controller=require(_0xe9c7('0x6'));router[_0xe9c7('0x7')]('/',auth['isAuthenticated'](),controller[_0xe9c7('0x8')]);router['get'](_0xe9c7('0x9'),auth['isAuthenticated'](),controller[_0xe9c7('0xa')]);router[_0xe9c7('0x7')]('/:id',auth[_0xe9c7('0xb')](),controller[_0xe9c7('0xc')]);router[_0xe9c7('0xd')]('/',auth[_0xe9c7('0xb')](),controller['create']);router[_0xe9c7('0xe')](_0xe9c7('0xf'),auth[_0xe9c7('0xb')](),controller[_0xe9c7('0x10')]);router[_0xe9c7('0x11')](_0xe9c7('0xf'),auth[_0xe9c7('0xb')](),controller[_0xe9c7('0x12')]);module[_0xe9c7('0x13')]=router;
\ No newline at end of file
+var _0xd454=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','multer','connect-timeout','express'];(function(_0x19def3,_0x3c8d6c){var _0x2a0210=function(_0x3223ad){while(--_0x3223ad){_0x19def3['push'](_0x19def3['shift']());}};_0x2a0210(++_0x3c8d6c);}(_0xd454,0x115));var _0x4d45=function(_0x3376a8,_0x56524c){_0x3376a8=_0x3376a8-0x0;var _0x560186=_0xd454[_0x3376a8];return _0x560186;};'use strict';var multer=require(_0x4d45('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4d45('0x1'));var express=require(_0x4d45('0x2'));var router=express[_0x4d45('0x3')]();var fs_extra=require(_0x4d45('0x4'));var auth=require(_0x4d45('0x5'));var interaction=require(_0x4d45('0x6'));var config=require(_0x4d45('0x7'));var controller=require('./memberReport.controller');router[_0x4d45('0x8')]('/',auth[_0x4d45('0x9')](),controller[_0x4d45('0xa')]);router[_0x4d45('0x8')](_0x4d45('0xb'),auth[_0x4d45('0x9')](),controller[_0x4d45('0xc')]);router['get'](_0x4d45('0xd'),auth['isAuthenticated'](),controller[_0x4d45('0xe')]);router['post']('/',auth[_0x4d45('0x9')](),controller[_0x4d45('0xf')]);router[_0x4d45('0x10')](_0x4d45('0xd'),auth[_0x4d45('0x9')](),controller[_0x4d45('0x11')]);router[_0x4d45('0x12')](_0x4d45('0xd'),auth[_0x4d45('0x9')](),controller[_0x4d45('0x13')]);module['exports']=router;
\ No newline at end of file
index 2994fae..3171ab2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cb1=['seconds','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','INTEGER','moment','STRING','DEFAULT\x20PAUSE','DATE','diff'];(function(_0x113ff6,_0x38f46e){var _0x34c780=function(_0x4c13dd){while(--_0x4c13dd){_0x113ff6['push'](_0x113ff6['shift']());}};_0x34c780(++_0x38f46e);}(_0x8cb1,0xaf));var _0x18cb=function(_0x54e4f9,_0x35d3ba){_0x54e4f9=_0x54e4f9-0x0;var _0x5de187=_0x8cb1[_0x54e4f9];return _0x5de187;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x18cb('0x0'));module['exports']={'channel':{'type':Sequelize[_0x18cb('0x1')]},'membername':{'type':Sequelize[_0x18cb('0x1')]},'interface':{'type':Sequelize[_0x18cb('0x1')]},'type':{'type':Sequelize[_0x18cb('0x1')],'defaultValue':_0x18cb('0x2'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x18cb('0x3')]},'exitAt':{'type':Sequelize[_0x18cb('0x3')],'set':function(_0x3a3e45){var _0x341ab6=moment(_0x3a3e45);var _0x12fb7f=moment(this['getDataValue']('enterAt'));var _0x369daf=_0x341ab6[_0x18cb('0x4')](_0x12fb7f,_0x18cb('0x5'));this['setDataValue'](_0x18cb('0x6'),_0x3a3e45);this['setDataValue'](_0x18cb('0x7'),_0x369daf>=0x0?_0x369daf:null);}},'data1':{'type':Sequelize[_0x18cb('0x1')],'comment':_0x18cb('0x8')},'data2':{'type':Sequelize[_0x18cb('0x1')],'comment':_0x18cb('0x9')},'data3':{'type':Sequelize[_0x18cb('0x1')],'comment':_0x18cb('0xa')},'data4':{'type':Sequelize[_0x18cb('0x1')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x18cb('0x1')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x18cb('0xb')]},'uniqueid':{'type':Sequelize[_0x18cb('0x1')]}};
\ No newline at end of file
+var _0xe902=['setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','sequelize','moment','STRING','DEFAULT\x20PAUSE','DATE','getDataValue','enterAt','diff'];(function(_0x1b2b34,_0xf4961b){var _0x5addf9=function(_0x172f17){while(--_0x172f17){_0x1b2b34['push'](_0x1b2b34['shift']());}};_0x5addf9(++_0xf4961b);}(_0xe902,0x19c));var _0x2e90=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xe902[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x2e90('0x0'));var moment=require(_0x2e90('0x1'));module['exports']={'channel':{'type':Sequelize[_0x2e90('0x2')]},'membername':{'type':Sequelize[_0x2e90('0x2')]},'interface':{'type':Sequelize[_0x2e90('0x2')]},'type':{'type':Sequelize[_0x2e90('0x2')],'defaultValue':_0x2e90('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x2e90('0x4')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x4351e9){var _0x5a045c=moment(_0x4351e9);var _0x22c784=moment(this[_0x2e90('0x5')](_0x2e90('0x6')));var _0x26019c=_0x5a045c[_0x2e90('0x7')](_0x22c784,'seconds');this[_0x2e90('0x8')]('exitAt',_0x4351e9);this['setDataValue'](_0x2e90('0x9'),_0x26019c>=0x0?_0x26019c:null);}},'data1':{'type':Sequelize[_0x2e90('0x2')],'comment':_0x2e90('0xa')},'data2':{'type':Sequelize[_0x2e90('0x2')],'comment':_0x2e90('0xb')},'data3':{'type':Sequelize[_0x2e90('0x2')],'comment':_0x2e90('0xc')},'data4':{'type':Sequelize['STRING'],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x2e90('0x2')],'comment':_0x2e90('0xd')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x2e90('0x2')]}};
\ No newline at end of file
index 3c672a0..99ff59e 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(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xedd9,0xfc));var _0x9edd=function(_0x567779,_0x28d9b2){_0x567779=_0x567779-0x0;var _0x5abfe4=_0xedd9[_0x567779];return _0x5abfe4;};'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 _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x34e8,0x12c));var _0x834e=function(_0x346a13,_0x48392d){_0x346a13=_0x346a13-0x0;var _0x232b5f=_0x34e8[_0x346a13];return _0x232b5f;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));};
\ No newline at end of file
index 47a5238..3cc7657 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6899=['bluebird','request-promise','path','rimraf','./memberReport.attributes','define','MemberReport','membername_interface','interface','lodash','util','../../config/logger','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6899,0x15b));var _0x9689=function(_0x371287,_0x2c0f0d){_0x371287=_0x371287-0x0;var _0x5033a4=_0x6899[_0x371287];return _0x5033a4;};'use strict';var _=require(_0x9689('0x0'));var util=require(_0x9689('0x1'));var logger=require(_0x9689('0x2'))('api');var moment=require(_0x9689('0x3'));var BPromise=require(_0x9689('0x4'));var rp=require(_0x9689('0x5'));var fs=require('fs');var path=require(_0x9689('0x6'));var rimraf=require(_0x9689('0x7'));var config=require('../../config/environment');var attributes=require(_0x9689('0x8'));module['exports']=function(_0x34dd0a,_0x5b1d09){return _0x34dd0a[_0x9689('0x9')](_0x9689('0xa'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x9689('0xb'),'fields':['membername',_0x9689('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6eed=['define','membername_interface','lodash','util','../../config/logger','api','moment','request-promise','path','./memberReport.attributes','exports'];(function(_0x3af2c0,_0x34d999){var _0x3f029c=function(_0x57ab40){while(--_0x57ab40){_0x3af2c0['push'](_0x3af2c0['shift']());}};_0x3f029c(++_0x34d999);}(_0x6eed,0xff));var _0xd6ee=function(_0x23332a,_0x31364e){_0x23332a=_0x23332a-0x0;var _0x4af782=_0x6eed[_0x23332a];return _0x4af782;};'use strict';var _=require(_0xd6ee('0x0'));var util=require(_0xd6ee('0x1'));var logger=require(_0xd6ee('0x2'))(_0xd6ee('0x3'));var moment=require(_0xd6ee('0x4'));var BPromise=require('bluebird');var rp=require(_0xd6ee('0x5'));var fs=require('fs');var path=require(_0xd6ee('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd6ee('0x7'));module[_0xd6ee('0x8')]=function(_0x1c4f36,_0x37abca){return _0x1c4f36[_0xd6ee('0x9')]('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0xd6ee('0xa'),'fields':['membername','interface']}],'timestamps':!![]});};
\ No newline at end of file
index 38031dd..00bfe2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe451=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetMemberReport','options','where','attributes','limit','include','map','model','CreateMemberReport','MemberReport','body','update','raw','UpdateMemberReport','moment','../../mysqldb'];(function(_0x18d631,_0x4376d2){var _0x50d708=function(_0x3b6ab5){while(--_0x3b6ab5){_0x18d631['push'](_0x18d631['shift']());}};_0x50d708(++_0x4376d2);}(_0xe451,0xec));var _0x1e45=function(_0x177d46,_0x3bc970){_0x177d46=_0x177d46-0x0;var _0x3f82ee=_0xe451[_0x177d46];return _0x3f82ee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1e45('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e45('0x1'))['db'];var utils=require(_0x1e45('0x2'));var logger=require(_0x1e45('0x3'))(_0x1e45('0x4'));var config=require('../../config/environment');var jayson=require(_0x1e45('0x5'));var client=jayson[_0x1e45('0x6')][_0x1e45('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x563405,_0xc62c6f,_0x31c118){return new BPromise(function(_0x4dd77f,_0x544710){return client[_0x1e45('0x8')](_0x563405,_0x31c118)[_0x1e45('0x9')](function(_0xde48d9){logger['info'](_0x1e45('0xa'),_0xc62c6f,_0x1e45('0xb'));logger[_0x1e45('0xc')]('MemberReport,\x20%s,\x20%s,\x20%s',_0xc62c6f,'request\x20sent',JSON[_0x1e45('0xd')](_0xde48d9));if(_0xde48d9[_0x1e45('0xe')]){if(_0xde48d9[_0x1e45('0xe')][_0x1e45('0xf')]===0x1f4){logger['error'](_0x1e45('0xa'),_0xc62c6f,_0xde48d9[_0x1e45('0xe')][_0x1e45('0x10')]);return _0x544710(_0xde48d9['error'][_0x1e45('0x10')]);}logger[_0x1e45('0xe')](_0x1e45('0xa'),_0xc62c6f,_0xde48d9[_0x1e45('0xe')]['message']);return _0x4dd77f(_0xde48d9[_0x1e45('0xe')]['message']);}else{logger[_0x1e45('0x11')](_0x1e45('0xa'),_0xc62c6f,'request\x20sent');_0x4dd77f(_0xde48d9[_0x1e45('0x12')][_0x1e45('0x10')]);}})[_0x1e45('0x13')](function(_0x1e5b73){logger[_0x1e45('0xe')](_0x1e45('0xa'),_0xc62c6f,_0x1e5b73);_0x544710(_0x1e5b73);});});}exports[_0x1e45('0x14')]=function(_0x2a6f47){var _0x2aa114=this;return new Promise(function(_0x5d24a7,_0x359dc6){return db['MemberReport']['findAll']({'raw':_0x2a6f47[_0x1e45('0x15')]?_0x2a6f47['options']['raw']===undefined?!![]:![]:!![],'where':_0x2a6f47['options']?_0x2a6f47['options'][_0x1e45('0x16')]||null:null,'attributes':_0x2a6f47[_0x1e45('0x15')]?_0x2a6f47['options'][_0x1e45('0x17')]||null:null,'limit':_0x2a6f47['options']?_0x2a6f47['options'][_0x1e45('0x18')]||null:null,'include':_0x2a6f47['options']?_0x2a6f47['options'][_0x1e45('0x19')]?_[_0x1e45('0x1a')](_0x2a6f47['options'][_0x1e45('0x19')],function(_0x2fb478){return{'model':db[_0x2fb478[_0x1e45('0x1b')]],'as':_0x2fb478['as'],'attributes':_0x2fb478[_0x1e45('0x17')],'include':_0x2fb478[_0x1e45('0x19')]?_[_0x1e45('0x1a')](_0x2fb478[_0x1e45('0x19')],function(_0x55e968){return{'model':db[_0x55e968[_0x1e45('0x1b')]],'as':_0x55e968['as'],'attributes':_0x55e968[_0x1e45('0x17')],'include':_0x55e968[_0x1e45('0x19')]?_[_0x1e45('0x1a')](_0x55e968[_0x1e45('0x19')],function(_0xfd7633){return{'model':db[_0xfd7633[_0x1e45('0x1b')]],'as':_0xfd7633['as'],'attributes':_0xfd7633['attributes']};}):[]};}):[]};}):[]:[]})[_0x1e45('0x9')](function(_0x3a9286){logger[_0x1e45('0x11')](_0x1e45('0x14'),_0x2a6f47);logger['debug'](_0x1e45('0x14'),_0x2a6f47,JSON[_0x1e45('0xd')](_0x3a9286));_0x5d24a7(_0x3a9286);})[_0x1e45('0x13')](function(_0x5229e7){logger[_0x1e45('0xe')]('GetMemberReport',_0x5229e7[_0x1e45('0x10')],_0x2a6f47);_0x359dc6(_0x2aa114['error'](0x1f4,_0x5229e7['message']));});});};exports[_0x1e45('0x1c')]=function(_0x3f33bf){var _0x363615=this;return new Promise(function(_0x3e6836,_0x51facf){return db[_0x1e45('0x1d')]['create'](_0x3f33bf[_0x1e45('0x1e')],{'raw':_0x3f33bf[_0x1e45('0x15')]?_0x3f33bf[_0x1e45('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x1e45('0x9')](function(_0x435fc2){logger[_0x1e45('0x11')]('CreateMemberReport',_0x3f33bf);logger[_0x1e45('0xc')](_0x1e45('0x1c'),_0x3f33bf,JSON[_0x1e45('0xd')](_0x435fc2));_0x3e6836(_0x435fc2);})[_0x1e45('0x13')](function(_0x58e351){logger[_0x1e45('0xe')](_0x1e45('0x1c'),_0x58e351[_0x1e45('0x10')],_0x3f33bf);_0x51facf(_0x363615[_0x1e45('0xe')](0x1f4,_0x58e351[_0x1e45('0x10')]));});});};exports['UpdateMemberReport']=function(_0x56deb6){var _0x542443=this;return new Promise(function(_0x552e4a,_0x215dc4){return db['MemberReport'][_0x1e45('0x1f')](_0x56deb6[_0x1e45('0x1e')],{'raw':_0x56deb6['options']?_0x56deb6['options'][_0x1e45('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56deb6[_0x1e45('0x15')]?_0x56deb6[_0x1e45('0x15')][_0x1e45('0x16')]||null:null,'attributes':_0x56deb6['options']?_0x56deb6[_0x1e45('0x15')][_0x1e45('0x17')]||null:null,'limit':_0x56deb6[_0x1e45('0x15')]?_0x56deb6[_0x1e45('0x15')]['limit']||null:null})[_0x1e45('0x9')](function(_0x1b1f47){logger[_0x1e45('0x11')]('UpdateMemberReport',_0x56deb6);logger['debug'](_0x1e45('0x21'),_0x56deb6,JSON['stringify'](_0x1b1f47));_0x552e4a(_0x1b1f47);})['catch'](function(_0x1bd93a){logger['error']('UpdateMemberReport',_0x1bd93a[_0x1e45('0x10')],_0x56deb6);_0x215dc4(_0x542443[_0x1e45('0xe')](0x1f4,_0x1bd93a[_0x1e45('0x10')]));});});};
\ No newline at end of file
+var _0xd8fb=['limit','include','map','model','then','GetMemberReport','stringify','CreateMemberReport','create','raw','update','body','UpdateMemberReport','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','MemberReport','options','where','attributes'];(function(_0x596155,_0x4cbee2){var _0x131913=function(_0x4003c9){while(--_0x4003c9){_0x596155['push'](_0x596155['shift']());}};_0x131913(++_0x4cbee2);}(_0xd8fb,0x99));var _0xbd8f=function(_0x49938a,_0x12f8b1){_0x49938a=_0x49938a-0x0;var _0xda2716=_0xd8fb[_0x49938a];return _0xda2716;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var moment=require(_0xbd8f('0x2'));var BPromise=require(_0xbd8f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbd8f('0x4'));var logger=require(_0xbd8f('0x5'))('rpc');var config=require(_0xbd8f('0x6'));var jayson=require(_0xbd8f('0x7'));var client=jayson['client'][_0xbd8f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e97cf,_0xf503c4,_0x578499){return new BPromise(function(_0x197827,_0x403edc){return client['request'](_0x4e97cf,_0x578499)['then'](function(_0x3caa93){logger[_0xbd8f('0x9')](_0xbd8f('0xa'),_0xf503c4,'request\x20sent');logger[_0xbd8f('0xb')](_0xbd8f('0xc'),_0xf503c4,'request\x20sent',JSON['stringify'](_0x3caa93));if(_0x3caa93[_0xbd8f('0xd')]){if(_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xe')]===0x1f4){logger['error'](_0xbd8f('0xa'),_0xf503c4,_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xf')]);return _0x403edc(_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xf')]);}logger[_0xbd8f('0xd')](_0xbd8f('0xa'),_0xf503c4,_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xf')]);return _0x197827(_0x3caa93['error'][_0xbd8f('0xf')]);}else{logger[_0xbd8f('0x9')](_0xbd8f('0xa'),_0xf503c4,_0xbd8f('0x10'));_0x197827(_0x3caa93['result'][_0xbd8f('0xf')]);}})[_0xbd8f('0x11')](function(_0x5ebf8b){logger[_0xbd8f('0xd')](_0xbd8f('0xa'),_0xf503c4,_0x5ebf8b);_0x403edc(_0x5ebf8b);});});}exports['GetMemberReport']=function(_0x4435b9){var _0x36a6af=this;return new Promise(function(_0x47d317,_0x5a572b){return db[_0xbd8f('0x12')]['findAll']({'raw':_0x4435b9['options']?_0x4435b9[_0xbd8f('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x4435b9[_0xbd8f('0x13')]?_0x4435b9[_0xbd8f('0x13')][_0xbd8f('0x14')]||null:null,'attributes':_0x4435b9[_0xbd8f('0x13')]?_0x4435b9[_0xbd8f('0x13')][_0xbd8f('0x15')]||null:null,'limit':_0x4435b9[_0xbd8f('0x13')]?_0x4435b9[_0xbd8f('0x13')][_0xbd8f('0x16')]||null:null,'include':_0x4435b9[_0xbd8f('0x13')]?_0x4435b9[_0xbd8f('0x13')][_0xbd8f('0x17')]?_[_0xbd8f('0x18')](_0x4435b9[_0xbd8f('0x13')][_0xbd8f('0x17')],function(_0xd11ae){return{'model':db[_0xd11ae[_0xbd8f('0x19')]],'as':_0xd11ae['as'],'attributes':_0xd11ae['attributes'],'include':_0xd11ae[_0xbd8f('0x17')]?_[_0xbd8f('0x18')](_0xd11ae[_0xbd8f('0x17')],function(_0x2f3df7){return{'model':db[_0x2f3df7[_0xbd8f('0x19')]],'as':_0x2f3df7['as'],'attributes':_0x2f3df7[_0xbd8f('0x15')],'include':_0x2f3df7[_0xbd8f('0x17')]?_[_0xbd8f('0x18')](_0x2f3df7['include'],function(_0x40cb43){return{'model':db[_0x40cb43[_0xbd8f('0x19')]],'as':_0x40cb43['as'],'attributes':_0x40cb43['attributes']};}):[]};}):[]};}):[]:[]})[_0xbd8f('0x1a')](function(_0x557daa){logger[_0xbd8f('0x9')](_0xbd8f('0x1b'),_0x4435b9);logger[_0xbd8f('0xb')](_0xbd8f('0x1b'),_0x4435b9,JSON[_0xbd8f('0x1c')](_0x557daa));_0x47d317(_0x557daa);})[_0xbd8f('0x11')](function(_0x4c4431){logger[_0xbd8f('0xd')](_0xbd8f('0x1b'),_0x4c4431[_0xbd8f('0xf')],_0x4435b9);_0x5a572b(_0x36a6af[_0xbd8f('0xd')](0x1f4,_0x4c4431[_0xbd8f('0xf')]));});});};exports[_0xbd8f('0x1d')]=function(_0x2a4b32){var _0x479a0c=this;return new Promise(function(_0x6c7345,_0x302771){return db[_0xbd8f('0x12')][_0xbd8f('0x1e')](_0x2a4b32['body'],{'raw':_0x2a4b32['options']?_0x2a4b32[_0xbd8f('0x13')][_0xbd8f('0x1f')]===undefined?!![]:![]:!![]})[_0xbd8f('0x1a')](function(_0x349299){logger['info'](_0xbd8f('0x1d'),_0x2a4b32);logger[_0xbd8f('0xb')](_0xbd8f('0x1d'),_0x2a4b32,JSON[_0xbd8f('0x1c')](_0x349299));_0x6c7345(_0x349299);})[_0xbd8f('0x11')](function(_0x4eaa51){logger[_0xbd8f('0xd')](_0xbd8f('0x1d'),_0x4eaa51[_0xbd8f('0xf')],_0x2a4b32);_0x302771(_0x479a0c[_0xbd8f('0xd')](0x1f4,_0x4eaa51[_0xbd8f('0xf')]));});});};exports['UpdateMemberReport']=function(_0x24e5f4){var _0x5f404e=this;return new Promise(function(_0x333315,_0x1e77c7){return db[_0xbd8f('0x12')][_0xbd8f('0x20')](_0x24e5f4[_0xbd8f('0x21')],{'raw':_0x24e5f4[_0xbd8f('0x13')]?_0x24e5f4['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24e5f4['options']?_0x24e5f4[_0xbd8f('0x13')][_0xbd8f('0x14')]||null:null,'attributes':_0x24e5f4[_0xbd8f('0x13')]?_0x24e5f4[_0xbd8f('0x13')][_0xbd8f('0x15')]||null:null,'limit':_0x24e5f4[_0xbd8f('0x13')]?_0x24e5f4[_0xbd8f('0x13')][_0xbd8f('0x16')]||null:null})[_0xbd8f('0x1a')](function(_0x2a6145){logger[_0xbd8f('0x9')](_0xbd8f('0x22'),_0x24e5f4);logger[_0xbd8f('0xb')](_0xbd8f('0x22'),_0x24e5f4,JSON[_0xbd8f('0x1c')](_0x2a6145));_0x333315(_0x2a6145);})['catch'](function(_0x2f22e1){logger[_0xbd8f('0xd')]('UpdateMemberReport',_0x2f22e1[_0xbd8f('0xf')],_0x24e5f4);_0x1e77c7(_0x5f404e[_0xbd8f('0xd')](0x1f4,_0x2f22e1[_0xbd8f('0xf')]));});});};
\ No newline at end of file
index 36a0583..1413bcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f47=['exports','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./migration.controller','get'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x6f47,0xc7));var _0x76f4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6f47[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x76f4('0x0'));var path=require(_0x76f4('0x1'));var timeout=require('connect-timeout');var express=require(_0x76f4('0x2'));var router=express['Router']();var fs_extra=require(_0x76f4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var controller=require(_0x76f4('0x6'));router[_0x76f4('0x7')]('/',controller['index']);module[_0x76f4('0x8')]=router;
\ No newline at end of file
+var _0xe132=['../../components/interaction/service','../../config/environment','index','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x11296,_0x483d71){var _0x101777=function(_0x3b0b6d){while(--_0x3b0b6d){_0x11296['push'](_0x11296['shift']());}};_0x101777(++_0x483d71);}(_0xe132,0x162));var _0x2e13=function(_0x52e6c2,_0xa7bc75){_0x52e6c2=_0x52e6c2-0x0;var _0x20edd9=_0xe132[_0x52e6c2];return _0x20edd9;};'use strict';var multer=require(_0x2e13('0x0'));var util=require('util');var path=require(_0x2e13('0x1'));var timeout=require(_0x2e13('0x2'));var express=require(_0x2e13('0x3'));var router=express[_0x2e13('0x4')]();var fs_extra=require(_0x2e13('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2e13('0x6'));var config=require(_0x2e13('0x7'));var controller=require('./migration.controller');router['get']('/',controller[_0x2e13('0x8')]);module[_0x2e13('0x9')]=router;
\ No newline at end of file
index 34411b2..fe8330a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d07=['STRING','version','sequelize','exports'];(function(_0x52f1e6,_0xf70489){var _0x21f104=function(_0xb89f9e){while(--_0xb89f9e){_0x52f1e6['push'](_0x52f1e6['shift']());}};_0x21f104(++_0xf70489);}(_0x1d07,0xc6));var _0x71d0=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x1d07[_0x88cd7b];return _0x56fcc8;};'use strict';var Sequelize=require(_0x71d0('0x0'));module[_0x71d0('0x1')]={'version':{'type':Sequelize[_0x71d0('0x2')],'unique':_0x71d0('0x3')}};
\ No newline at end of file
+var _0xef83=['version','sequelize','exports','STRING'];(function(_0x3ccdf8,_0x584ceb){var _0x243dab=function(_0x1a90d1){while(--_0x1a90d1){_0x3ccdf8['push'](_0x3ccdf8['shift']());}};_0x243dab(++_0x584ceb);}(_0xef83,0x129));var _0x3ef8=function(_0x595606,_0x530242){_0x595606=_0x595606-0x0;var _0x3768c4=_0xef83[_0x595606];return _0x3768c4;};'use strict';var Sequelize=require(_0x3ef8('0x0'));module[_0x3ef8('0x1')]={'version':{'type':Sequelize[_0x3ef8('0x2')],'unique':_0x3ef8('0x3')}};
\ No newline at end of file
index 1fee704..f042a62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cf7=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','Migration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','querystring','papaparse','ioredis'];(function(_0x46636e,_0xc37f59){var _0x396fe5=function(_0x54c425){while(--_0x54c425){_0x46636e['push'](_0x46636e['shift']());}};_0x396fe5(++_0xc37f59);}(_0x5cf7,0xc0));var _0x75cf=function(_0x236900,_0x31d36f){_0x236900=_0x236900-0x0;var _0x1bb8da=_0x5cf7[_0x236900];return _0x1bb8da;};'use strict';var emlformat=require(_0x75cf('0x0'));var rimraf=require(_0x75cf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x75cf('0x2'));var moment=require('moment');var BPromise=require(_0x75cf('0x3'));var Mustache=require(_0x75cf('0x4'));var util=require(_0x75cf('0x5'));var path=require(_0x75cf('0x6'));var sox=require(_0x75cf('0x7'));var csv=require(_0x75cf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x75cf('0x9'));var _=require(_0x75cf('0xa'));var squel=require(_0x75cf('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x75cf('0x8'));var querystring=require(_0x75cf('0xc'));var Papa=require(_0x75cf('0xd'));var Redis=require(_0x75cf('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x75cf('0xf'));var as=require(_0x75cf('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x75cf('0x11'))('api');var utils=require(_0x75cf('0x12'));var config=require(_0x75cf('0x13'));var licenseUtil=require(_0x75cf('0x14'));var db=require(_0x75cf('0x15'))['db'];function respondWithStatusCode(_0x3256ef,_0x555a98){_0x555a98=_0x555a98||0xcc;return function(_0x59e101){if(_0x59e101){return _0x3256ef[_0x75cf('0x16')](_0x555a98);}return _0x3256ef[_0x75cf('0x17')](_0x555a98)[_0x75cf('0x18')]();};}function respondWithResult(_0x36ed52,_0x3499a5){_0x3499a5=_0x3499a5||0xc8;return function(_0x16fe77){if(_0x16fe77){return _0x36ed52[_0x75cf('0x17')](_0x3499a5)[_0x75cf('0x19')](_0x16fe77);}};}function respondWithFilteredResult(_0x1944b0,_0x21ebc9){return function(_0x2fb1ca){if(_0x2fb1ca){var _0x46038e=typeof _0x21ebc9[_0x75cf('0x1a')]===_0x75cf('0x1b')&&typeof _0x21ebc9['limit']==='undefined';var _0x246a8e=_0x2fb1ca[_0x75cf('0x1c')];var _0x3a11da=_0x46038e?0x0:_0x21ebc9[_0x75cf('0x1a')];var _0x24e52b=_0x46038e?_0x2fb1ca[_0x75cf('0x1c')]:_0x21ebc9[_0x75cf('0x1a')]+_0x21ebc9[_0x75cf('0x1d')];var _0xc85e80;if(_0x24e52b>=_0x246a8e){_0x24e52b=_0x246a8e;_0xc85e80=0xc8;}else{_0xc85e80=0xce;}_0x1944b0[_0x75cf('0x17')](_0xc85e80);return _0x1944b0[_0x75cf('0x1e')](_0x75cf('0x1f'),_0x3a11da+'-'+_0x24e52b+'/'+_0x246a8e)[_0x75cf('0x19')](_0x2fb1ca);}return null;};}function patchUpdates(_0x53bae0){return function(_0x8954da){try{jsonpatch[_0x75cf('0x20')](_0x8954da,_0x53bae0,!![]);}catch(_0x4cfd5f){return BPromise['reject'](_0x4cfd5f);}return _0x8954da[_0x75cf('0x21')]();};}function saveUpdates(_0x405c9a,_0x4f90c9){return function(_0x3e8239){if(_0x3e8239){return _0x3e8239[_0x75cf('0x22')](_0x405c9a)[_0x75cf('0x23')](function(_0x1b393b){return _0x1b393b;});}return null;};}function removeEntity(_0x342e1b,_0x8413fc){return function(_0x1c6270){if(_0x1c6270){return _0x1c6270[_0x75cf('0x24')]()[_0x75cf('0x23')](function(){_0x342e1b[_0x75cf('0x17')](0xcc)[_0x75cf('0x18')]();});}};}function handleEntityNotFound(_0x1689bd,_0x500a91){return function(_0x15f65a){if(!_0x15f65a){_0x1689bd['sendStatus'](0x194);}return _0x15f65a;};}function handleError(_0x4aabb2,_0x54f9b4){_0x54f9b4=_0x54f9b4||0x1f4;return function(_0x4a9bbb){logger[_0x75cf('0x25')](_0x4a9bbb[_0x75cf('0x26')]);if(_0x4a9bbb['name']){delete _0x4a9bbb[_0x75cf('0x27')];}_0x4aabb2[_0x75cf('0x17')](_0x54f9b4)[_0x75cf('0x28')](_0x4a9bbb);};}exports['index']=function(_0x565398,_0x5c83a8){var _0x2dd360={},_0x16d2d8={},_0x3a16b3={'count':0x0,'rows':[]};var _0x365243=_[_0x75cf('0x29')](db[_0x75cf('0x2a')][_0x75cf('0x2b')],function(_0x161325){return{'name':_0x161325[_0x75cf('0x2c')],'type':_0x161325[_0x75cf('0x2d')][_0x75cf('0x2e')]};});_0x16d2d8['model']=_['map'](_0x365243,'name');_0x16d2d8[_0x75cf('0x2f')]=_[_0x75cf('0x30')](_0x565398[_0x75cf('0x2f')]);_0x16d2d8[_0x75cf('0x31')]=_[_0x75cf('0x32')](_0x16d2d8['model'],_0x16d2d8[_0x75cf('0x2f')]);_0x2dd360[_0x75cf('0x33')]=_[_0x75cf('0x32')](_0x16d2d8['model'],qs['fields'](_0x565398[_0x75cf('0x2f')][_0x75cf('0x34')]));_0x2dd360[_0x75cf('0x33')]=_0x2dd360[_0x75cf('0x33')][_0x75cf('0x35')]?_0x2dd360[_0x75cf('0x33')]:_0x16d2d8[_0x75cf('0x36')];if(!_0x565398[_0x75cf('0x2f')][_0x75cf('0x37')](_0x75cf('0x38'))){_0x2dd360[_0x75cf('0x1d')]=qs[_0x75cf('0x1d')](_0x565398[_0x75cf('0x2f')][_0x75cf('0x1d')]);_0x2dd360['offset']=qs[_0x75cf('0x1a')](_0x565398[_0x75cf('0x2f')][_0x75cf('0x1a')]);}_0x2dd360[_0x75cf('0x39')]=qs['sort'](_0x565398[_0x75cf('0x2f')][_0x75cf('0x3a')]);_0x2dd360[_0x75cf('0x3b')]=qs[_0x75cf('0x31')](_[_0x75cf('0x3c')](_0x565398[_0x75cf('0x2f')],_0x16d2d8[_0x75cf('0x31')]),_0x365243);if(_0x565398[_0x75cf('0x2f')][_0x75cf('0x3d')]){_0x2dd360['where']=_[_0x75cf('0x3e')](_0x2dd360[_0x75cf('0x3b')],{'$or':_['map'](_0x365243,function(_0x2040bd){if(_0x2040bd[_0x75cf('0x2d')]!==_0x75cf('0x3f')){var _0x3929c6={};_0x3929c6[_0x2040bd['name']]={'$like':'%'+_0x565398[_0x75cf('0x2f')][_0x75cf('0x3d')]+'%'};return _0x3929c6;}})});}_0x2dd360=_[_0x75cf('0x3e')]({},_0x2dd360,_0x565398[_0x75cf('0x40')]);var _0x5f562b={'where':_0x2dd360['where']};return db['Migration'][_0x75cf('0x1c')](_0x5f562b)[_0x75cf('0x23')](function(_0x59115e){_0x3a16b3['count']=_0x59115e;if(_0x565398[_0x75cf('0x2f')][_0x75cf('0x41')]){_0x2dd360[_0x75cf('0x42')]=[{'all':!![]}];}return db[_0x75cf('0x2a')]['findAll'](_0x2dd360);})[_0x75cf('0x23')](function(_0x3cbcc3){_0x3a16b3[_0x75cf('0x43')]=_0x3cbcc3;return _0x3a16b3;})[_0x75cf('0x23')](respondWithFilteredResult(_0x5c83a8,_0x2dd360))[_0x75cf('0x44')](handleError(_0x5c83a8,null));};
\ No newline at end of file
+var _0x3618=['sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','filters','pick','filter','where','type','VIRTUAL','options','includeAll','include','Migration','findAll','rows','catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','set','apply','reject','save','update','then','destroy'];(function(_0x548412,_0x501059){var _0x536b63=function(_0x3ba606){while(--_0x3ba606){_0x548412['push'](_0x548412['shift']());}};_0x536b63(++_0x501059);}(_0x3618,0xb2));var _0x8361=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x3618[_0x5bd426];return _0x23a7eb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8361('0x0'));var jsonpatch=require(_0x8361('0x1'));var rp=require(_0x8361('0x2'));var moment=require(_0x8361('0x3'));var BPromise=require(_0x8361('0x4'));var Mustache=require(_0x8361('0x5'));var util=require('util');var path=require(_0x8361('0x6'));var sox=require(_0x8361('0x7'));var csv=require(_0x8361('0x8'));var ejs=require(_0x8361('0x9'));var fs=require('fs');var fs_extra=require(_0x8361('0xa'));var _=require(_0x8361('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8361('0xc'));var deskjs=require(_0x8361('0xd'));var toCsv=require(_0x8361('0x8'));var querystring=require(_0x8361('0xe'));var Papa=require(_0x8361('0xf'));var Redis=require('ioredis');var authService=require(_0x8361('0x10'));var qs=require(_0x8361('0x11'));var as=require(_0x8361('0x12'));var hardwareService=require(_0x8361('0x13'));var logger=require('../../config/logger')(_0x8361('0x14'));var utils=require(_0x8361('0x15'));var config=require(_0x8361('0x16'));var licenseUtil=require(_0x8361('0x17'));var db=require(_0x8361('0x18'))['db'];function respondWithStatusCode(_0x27ffd0,_0x2417db){_0x2417db=_0x2417db||0xcc;return function(_0x431277){if(_0x431277){return _0x27ffd0['sendStatus'](_0x2417db);}return _0x27ffd0['status'](_0x2417db)[_0x8361('0x19')]();};}function respondWithResult(_0x27947b,_0x1a55b2){_0x1a55b2=_0x1a55b2||0xc8;return function(_0x7247b6){if(_0x7247b6){return _0x27947b[_0x8361('0x1a')](_0x1a55b2)[_0x8361('0x1b')](_0x7247b6);}};}function respondWithFilteredResult(_0x5c6cda,_0x1eb3fe){return function(_0x3e0762){if(_0x3e0762){var _0x569796=typeof _0x1eb3fe[_0x8361('0x1c')]==='undefined'&&typeof _0x1eb3fe['limit']===_0x8361('0x1d');var _0x26ba85=_0x3e0762[_0x8361('0x1e')];var _0x43ef9e=_0x569796?0x0:_0x1eb3fe['offset'];var _0x4dfd0e=_0x569796?_0x3e0762[_0x8361('0x1e')]:_0x1eb3fe['offset']+_0x1eb3fe['limit'];var _0x488874;if(_0x4dfd0e>=_0x26ba85){_0x4dfd0e=_0x26ba85;_0x488874=0xc8;}else{_0x488874=0xce;}_0x5c6cda[_0x8361('0x1a')](_0x488874);return _0x5c6cda[_0x8361('0x1f')]('Content-Range',_0x43ef9e+'-'+_0x4dfd0e+'/'+_0x26ba85)[_0x8361('0x1b')](_0x3e0762);}return null;};}function patchUpdates(_0x2e043c){return function(_0x244b90){try{jsonpatch[_0x8361('0x20')](_0x244b90,_0x2e043c,!![]);}catch(_0xe6aaac){return BPromise[_0x8361('0x21')](_0xe6aaac);}return _0x244b90[_0x8361('0x22')]();};}function saveUpdates(_0x3a4566,_0xe63ff1){return function(_0x551e24){if(_0x551e24){return _0x551e24[_0x8361('0x23')](_0x3a4566)[_0x8361('0x24')](function(_0x5097a1){return _0x5097a1;});}return null;};}function removeEntity(_0x9b90c,_0x3cb020){return function(_0x451e40){if(_0x451e40){return _0x451e40[_0x8361('0x25')]()[_0x8361('0x24')](function(){_0x9b90c[_0x8361('0x1a')](0xcc)[_0x8361('0x19')]();});}};}function handleEntityNotFound(_0x30b54e,_0x16cc07){return function(_0x1f2826){if(!_0x1f2826){_0x30b54e[_0x8361('0x26')](0x194);}return _0x1f2826;};}function handleError(_0x88d769,_0x22e21d){_0x22e21d=_0x22e21d||0x1f4;return function(_0x19069d){logger[_0x8361('0x27')](_0x19069d[_0x8361('0x28')]);if(_0x19069d['name']){delete _0x19069d[_0x8361('0x29')];}_0x88d769['status'](_0x22e21d)[_0x8361('0x2a')](_0x19069d);};}exports[_0x8361('0x2b')]=function(_0x5af97a,_0x425cf0){var _0x31345c={},_0xc62d85={},_0xb75a12={'count':0x0,'rows':[]};var _0x16d7d5=_[_0x8361('0x2c')](db['Migration'][_0x8361('0x2d')],function(_0x41a4bd){return{'name':_0x41a4bd[_0x8361('0x2e')],'type':_0x41a4bd['type'][_0x8361('0x2f')]};});_0xc62d85[_0x8361('0x30')]=_['map'](_0x16d7d5,_0x8361('0x29'));_0xc62d85[_0x8361('0x31')]=_[_0x8361('0x32')](_0x5af97a[_0x8361('0x31')]);_0xc62d85['filters']=_['intersection'](_0xc62d85[_0x8361('0x30')],_0xc62d85[_0x8361('0x31')]);_0x31345c[_0x8361('0x33')]=_[_0x8361('0x34')](_0xc62d85[_0x8361('0x30')],qs[_0x8361('0x35')](_0x5af97a[_0x8361('0x31')][_0x8361('0x35')]));_0x31345c[_0x8361('0x33')]=_0x31345c['attributes'][_0x8361('0x36')]?_0x31345c[_0x8361('0x33')]:_0xc62d85[_0x8361('0x30')];if(!_0x5af97a[_0x8361('0x31')][_0x8361('0x37')](_0x8361('0x38'))){_0x31345c[_0x8361('0x39')]=qs['limit'](_0x5af97a[_0x8361('0x31')]['limit']);_0x31345c[_0x8361('0x1c')]=qs[_0x8361('0x1c')](_0x5af97a['query'][_0x8361('0x1c')]);}_0x31345c['order']=qs[_0x8361('0x3a')](_0x5af97a[_0x8361('0x31')]['sort']);_0x31345c['where']=qs[_0x8361('0x3b')](_[_0x8361('0x3c')](_0x5af97a[_0x8361('0x31')],_0xc62d85[_0x8361('0x3b')]),_0x16d7d5);if(_0x5af97a['query'][_0x8361('0x3d')]){_0x31345c[_0x8361('0x3e')]=_['merge'](_0x31345c[_0x8361('0x3e')],{'$or':_[_0x8361('0x2c')](_0x16d7d5,function(_0x2df5b5){if(_0x2df5b5[_0x8361('0x3f')]!==_0x8361('0x40')){var _0x4eca71={};_0x4eca71[_0x2df5b5[_0x8361('0x29')]]={'$like':'%'+_0x5af97a[_0x8361('0x31')][_0x8361('0x3d')]+'%'};return _0x4eca71;}})});}_0x31345c=_['merge']({},_0x31345c,_0x5af97a[_0x8361('0x41')]);var _0x57a704={'where':_0x31345c[_0x8361('0x3e')]};return db['Migration'][_0x8361('0x1e')](_0x57a704)[_0x8361('0x24')](function(_0x2e2fab){_0xb75a12[_0x8361('0x1e')]=_0x2e2fab;if(_0x5af97a[_0x8361('0x31')][_0x8361('0x42')]){_0x31345c[_0x8361('0x43')]=[{'all':!![]}];}return db[_0x8361('0x44')][_0x8361('0x45')](_0x31345c);})[_0x8361('0x24')](function(_0x4de6d1){_0xb75a12[_0x8361('0x46')]=_0x4de6d1;return _0xb75a12;})[_0x8361('0x24')](respondWithFilteredResult(_0x425cf0,_0x31345c))[_0x8361('0x47')](handleError(_0x425cf0,null));};
\ No newline at end of file
index 4dd8dea..790de5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb46=['lodash','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./migration.attributes','define','Migration','migrations'];(function(_0x21783,_0x36e23a){var _0x5becfa=function(_0x1a33c2){while(--_0x1a33c2){_0x21783['push'](_0x21783['shift']());}};_0x5becfa(++_0x36e23a);}(_0xbb46,0xfa));var _0x6bb4=function(_0x3496a1,_0xe1cfe9){_0x3496a1=_0x3496a1-0x0;var _0x313bea=_0xbb46[_0x3496a1];return _0x313bea;};'use strict';var _=require(_0x6bb4('0x0'));var util=require('util');var logger=require(_0x6bb4('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6bb4('0x2'));var rp=require(_0x6bb4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6bb4('0x4'));var config=require(_0x6bb4('0x5'));var attributes=require(_0x6bb4('0x6'));module['exports']=function(_0x51a4ac,_0x26f276){return _0x51a4ac[_0x6bb4('0x7')](_0x6bb4('0x8'),attributes,{'tableName':_0x6bb4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x34d1=['moment','bluebird','request-promise','path','rimraf','./migration.attributes','exports','Migration','lodash','util','../../config/logger','api'];(function(_0x4575c1,_0x26f95e){var _0x2050b5=function(_0x309d09){while(--_0x309d09){_0x4575c1['push'](_0x4575c1['shift']());}};_0x2050b5(++_0x26f95e);}(_0x34d1,0x170));var _0x134d=function(_0x7b90ce,_0x2d4043){_0x7b90ce=_0x7b90ce-0x0;var _0x127148=_0x34d1[_0x7b90ce];return _0x127148;};'use strict';var _=require(_0x134d('0x0'));var util=require(_0x134d('0x1'));var logger=require(_0x134d('0x2'))(_0x134d('0x3'));var moment=require(_0x134d('0x4'));var BPromise=require(_0x134d('0x5'));var rp=require(_0x134d('0x6'));var fs=require('fs');var path=require(_0x134d('0x7'));var rimraf=require(_0x134d('0x8'));var config=require('../../config/environment');var attributes=require(_0x134d('0x9'));module[_0x134d('0xa')]=function(_0x38dda0,_0x39cb72){return _0x38dda0['define'](_0x134d('0xb'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7565d6f..18d58e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7794=['randomstring','../../mysqldb','../../config/utils','rpc','http','request','then','info','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','Migration,\x20%s,\x20%s','message','result','catch','util','moment','bluebird'];(function(_0x3c6b7d,_0x5f0d90){var _0x1d3ed2=function(_0x1a8f35){while(--_0x1a8f35){_0x3c6b7d['push'](_0x3c6b7d['shift']());}};_0x1d3ed2(++_0x5f0d90);}(_0x7794,0x7b));var _0x4779=function(_0x12fcbd,_0x884804){_0x12fcbd=_0x12fcbd-0x0;var _0x28ec2a=_0x7794[_0x12fcbd];return _0x28ec2a;};'use strict';var _=require('lodash');var util=require(_0x4779('0x0'));var moment=require(_0x4779('0x1'));var BPromise=require(_0x4779('0x2'));var rs=require(_0x4779('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4779('0x4'))['db'];var utils=require(_0x4779('0x5'));var logger=require('../../config/logger')(_0x4779('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4779('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x339512,_0x523c93,_0xb3fe18){return new BPromise(function(_0x13bb66,_0x270a5f){return client[_0x4779('0x8')](_0x339512,_0xb3fe18)[_0x4779('0x9')](function(_0x7179e1){logger[_0x4779('0xa')]('Migration,\x20%s,\x20%s',_0x523c93,_0x4779('0xb'));logger[_0x4779('0xc')](_0x4779('0xd'),_0x523c93,_0x4779('0xb'),JSON[_0x4779('0xe')](_0x7179e1));if(_0x7179e1[_0x4779('0xf')]){if(_0x7179e1[_0x4779('0xf')][_0x4779('0x10')]===0x1f4){logger[_0x4779('0xf')](_0x4779('0x11'),_0x523c93,_0x7179e1['error']['message']);return _0x270a5f(_0x7179e1['error'][_0x4779('0x12')]);}logger[_0x4779('0xf')](_0x4779('0x11'),_0x523c93,_0x7179e1[_0x4779('0xf')]['message']);return _0x13bb66(_0x7179e1[_0x4779('0xf')][_0x4779('0x12')]);}else{logger['info']('Migration,\x20%s,\x20%s',_0x523c93,_0x4779('0xb'));_0x13bb66(_0x7179e1[_0x4779('0x13')][_0x4779('0x12')]);}})[_0x4779('0x14')](function(_0x56ec51){logger['error'](_0x4779('0x11'),_0x523c93,_0x56ec51);_0x270a5f(_0x56ec51);});});}
\ No newline at end of file
+var _0x54f3=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','then','info','Migration,\x20%s,\x20%s','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','util'];(function(_0xe8320,_0x50b3dd){var _0x45803b=function(_0x18f5f0){while(--_0x18f5f0){_0xe8320['push'](_0xe8320['shift']());}};_0x45803b(++_0x50b3dd);}(_0x54f3,0x120));var _0x354f=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x54f3[_0x46e363];return _0x3fb059;};'use strict';var _=require('lodash');var util=require(_0x354f('0x0'));var moment=require(_0x354f('0x1'));var BPromise=require(_0x354f('0x2'));var rs=require(_0x354f('0x3'));var fs=require('fs');var Redis=require(_0x354f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x354f('0x5'))(_0x354f('0x6'));var config=require(_0x354f('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x354f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51cd16,_0x1da503,_0x4311ad){return new BPromise(function(_0x2f111a,_0x173e1d){return client['request'](_0x51cd16,_0x4311ad)[_0x354f('0x9')](function(_0x5d1e5d){logger[_0x354f('0xa')](_0x354f('0xb'),_0x1da503,'request\x20sent');logger['debug'](_0x354f('0xc'),_0x1da503,_0x354f('0xd'),JSON['stringify'](_0x5d1e5d));if(_0x5d1e5d[_0x354f('0xe')]){if(_0x5d1e5d[_0x354f('0xe')]['code']===0x1f4){logger[_0x354f('0xe')](_0x354f('0xb'),_0x1da503,_0x5d1e5d[_0x354f('0xe')][_0x354f('0xf')]);return _0x173e1d(_0x5d1e5d[_0x354f('0xe')][_0x354f('0xf')]);}logger[_0x354f('0xe')]('Migration,\x20%s,\x20%s',_0x1da503,_0x5d1e5d[_0x354f('0xe')][_0x354f('0xf')]);return _0x2f111a(_0x5d1e5d[_0x354f('0xe')]['message']);}else{logger[_0x354f('0xa')](_0x354f('0xb'),_0x1da503,_0x354f('0xd'));_0x2f111a(_0x5d1e5d['result']['message']);}})[_0x354f('0x10')](function(_0x1d7627){logger[_0x354f('0xe')](_0x354f('0xb'),_0x1da503,_0x1d7627);_0x173e1d(_0x1d7627);});});}
\ No newline at end of file
index a5eca83..f074364 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a4d=['connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','index','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','util','path'];(function(_0x9728b8,_0x5a1a6d){var _0x4b80ab=function(_0xdccc9b){while(--_0xdccc9b){_0x9728b8['push'](_0x9728b8['shift']());}};_0x4b80ab(++_0x5a1a6d);}(_0x9a4d,0xa8));var _0xd9a4=function(_0x12428f,_0xed4e38){_0x12428f=_0x12428f-0x0;var _0x4595ae=_0x9a4d[_0x12428f];return _0x4595ae;};'use strict';var multer=require(_0xd9a4('0x0'));var util=require(_0xd9a4('0x1'));var path=require(_0xd9a4('0x2'));var timeout=require(_0xd9a4('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd9a4('0x4'));var interaction=require(_0xd9a4('0x5'));var config=require(_0xd9a4('0x6'));var controller=require(_0xd9a4('0x7'));router[_0xd9a4('0x8')]('/',auth['isAuthenticated'](),controller[_0xd9a4('0x9')]);router[_0xd9a4('0x8')](_0xd9a4('0xa'),auth[_0xd9a4('0xb')](),controller[_0xd9a4('0xc')]);router[_0xd9a4('0xd')]('/',auth['isAuthenticated'](),controller[_0xd9a4('0xe')]);router[_0xd9a4('0xf')](_0xd9a4('0xa'),auth[_0xd9a4('0xb')](),controller['update']);router[_0xd9a4('0x10')](_0xd9a4('0xa'),auth[_0xd9a4('0xb')](),controller[_0xd9a4('0x11')]);module[_0xd9a4('0x12')]=router;
\ No newline at end of file
+var _0x1dcd=['create','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','show','post'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x1dcd,0x100));var _0xd1dc=function(_0xf60fe1,_0x11d045){_0xf60fe1=_0xf60fe1-0x0;var _0x257ec4=_0x1dcd[_0xf60fe1];return _0x257ec4;};'use strict';var multer=require(_0xd1dc('0x0'));var util=require(_0xd1dc('0x1'));var path=require(_0xd1dc('0x2'));var timeout=require(_0xd1dc('0x3'));var express=require(_0xd1dc('0x4'));var router=express[_0xd1dc('0x5')]();var fs_extra=require(_0xd1dc('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd1dc('0x7'));var config=require(_0xd1dc('0x8'));var controller=require('./network.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd1dc('0x9')]);router['get'](_0xd1dc('0xa'),auth[_0xd1dc('0xb')](),controller[_0xd1dc('0xc')]);router[_0xd1dc('0xd')]('/',auth['isAuthenticated'](),controller[_0xd1dc('0xe')]);router[_0xd1dc('0xf')](_0xd1dc('0xa'),auth[_0xd1dc('0xb')](),controller[_0xd1dc('0x10')]);router[_0xd1dc('0x11')](_0xd1dc('0xa'),auth[_0xd1dc('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 5ff6782..2422328 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2762=['exports','ENUM','localnet','externip','stun','turn','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2762,0x70));var _0x2276=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2762[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x2276('0x0')]={'type':{'type':Sequelize[_0x2276('0x1')](_0x2276('0x2'),_0x2276('0x3'),_0x2276('0x4'),_0x2276('0x5'))},'value':{'type':Sequelize[_0x2276('0x6')]},'username':{'type':Sequelize[_0x2276('0x6')]},'password':{'type':Sequelize[_0x2276('0x6')]}};
\ No newline at end of file
+var _0xb2c1=['exports','stun','turn','STRING','sequelize'];(function(_0x1b19f6,_0x577427){var _0x306e62=function(_0x462fd2){while(--_0x462fd2){_0x1b19f6['push'](_0x1b19f6['shift']());}};_0x306e62(++_0x577427);}(_0xb2c1,0x158));var _0x1b2c=function(_0x553502,_0x4d2c0c){_0x553502=_0x553502-0x0;var _0x246c37=_0xb2c1[_0x553502];return _0x246c37;};'use strict';var Sequelize=require(_0x1b2c('0x0'));module[_0x1b2c('0x1')]={'type':{'type':Sequelize['ENUM']('localnet','externip',_0x1b2c('0x2'),_0x1b2c('0x3'))},'value':{'type':Sequelize[_0x1b2c('0x4')]},'username':{'type':Sequelize[_0x1b2c('0x4')]},'password':{'type':Sequelize[_0x1b2c('0x4')]}};
\ No newline at end of file
index 6002522..a5d79db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x736b=['toUpperCase','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','STUN','format','toLowerCase','ejs','../../components/parsers/qs','../../config/logger','../../config/environment','client','http','request','info','Network,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','end','name','status','send','index','map','Network','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','rows','show','params','find','create','findAll','body'];(function(_0x3eec74,_0x3bc48e){var _0x4936a5=function(_0x446956){while(--_0x446956){_0x3eec74['push'](_0x3eec74['shift']());}};_0x4936a5(++_0x3bc48e);}(_0x736b,0x1ae));var _0xb736=function(_0x27fd92,_0x2311cb){_0x27fd92=_0x27fd92-0x0;var _0x4f6070=_0x736b[_0x27fd92];return _0x4f6070;};'use strict';var util=require('util');var path=require('path');var ejs=require(_0xb736('0x0'));var fs=require('fs');var _=require('lodash');var qs=require(_0xb736('0x1'));var logger=require(_0xb736('0x2'))('api');var config=require(_0xb736('0x3'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xb736('0x4')][_0xb736('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x34edc8,_0x3e4c74,_0x5561ce,_0x57446e){return new Promise(function(_0x19eb88,_0x5abe14){var _0x41b5a8=_0x57446e||client;return _0x41b5a8[_0xb736('0x6')](_0x34edc8,_0x5561ce)['then'](function(_0x98f081){logger[_0xb736('0x7')](_0xb736('0x8'),_0x3e4c74,'request\x20sent');logger[_0xb736('0x9')]('Network,\x20%s,\x20%s,\x20%s',_0x3e4c74,_0xb736('0xa'),JSON[_0xb736('0xb')](_0x98f081));if(_0x98f081[_0xb736('0xc')]){if(_0x98f081[_0xb736('0xc')]['code']===0x1f4){logger[_0xb736('0xc')](_0xb736('0x8'),_0x3e4c74,_0x98f081['error']['message']);return _0x5abe14(_0x98f081[_0xb736('0xc')]['message']);}logger['error'](_0xb736('0x8'),_0x3e4c74,_0x98f081[_0xb736('0xc')][_0xb736('0xd')]);return _0x19eb88(_0x98f081[_0xb736('0xc')][_0xb736('0xd')]);}else{logger[_0xb736('0x7')](_0xb736('0x8'),_0x3e4c74,_0xb736('0xa'));_0x19eb88(_0x98f081[_0xb736('0xe')][_0xb736('0xd')]);}})[_0xb736('0xf')](function(_0xaf086){logger[_0xb736('0xc')](_0xb736('0x8'),_0x3e4c74,_0xaf086);_0x5abe14(_0xaf086);});});}function respondWithResult(_0xd31c2d,_0x41e31f){_0x41e31f=_0x41e31f||0xc8;return function(_0x116784){if(_0x116784){return _0xd31c2d['status'](_0x41e31f)[_0xb736('0x10')](_0x116784);}};}function respondWithFilteredResult(_0x32d975,_0x567163){return function(_0x22c732){if(_0x22c732){var _0x5edd23=typeof _0x567163[_0xb736('0x11')]===_0xb736('0x12')&&typeof _0x567163['limit']===_0xb736('0x12');var _0x2b551d=_0x22c732[_0xb736('0x13')];var _0x3766e5=_0x5edd23?0x0:_0x567163['offset'];var _0x1f75b8=_0x5edd23?_0x22c732['count']:_0x567163[_0xb736('0x11')]+_0x567163[_0xb736('0x14')];var _0x5b6aa2;if(_0x1f75b8>=_0x2b551d){_0x1f75b8=_0x2b551d;_0x5b6aa2=0xc8;}else{_0x5b6aa2=0xce;}_0x32d975['status'](_0x5b6aa2);return _0x32d975[_0xb736('0x15')](_0xb736('0x16'),_0x3766e5+'-'+_0x1f75b8+'/'+_0x2b551d)[_0xb736('0x10')](_0x22c732);}return null;};}function saveUpdates(_0xb09234){return function(_0x68e9b4){if(_0x68e9b4){return _0x68e9b4[_0xb736('0x17')](_0xb09234)[_0xb736('0x18')](function(_0x112b89){return _0x112b89;});}return null;};}function removeEntity(_0x3b965b){return function(_0x48854e){if(_0x48854e){return _0x48854e[_0xb736('0x19')]()[_0xb736('0x18')](function(){_0x3b965b['status'](0xcc)[_0xb736('0x1a')]();});}};}function handleEntityNotFound(_0x3fbed5){return function(_0x3567ad){if(!_0x3567ad){_0x3fbed5['sendStatus'](0x194);}return _0x3567ad;};}function handleError(_0x589fd5,_0xb7a975){_0xb7a975=_0xb7a975||0x1f4;return function(_0x4e1dc2){logger['error'](_0x4e1dc2['stack']);if(_0x4e1dc2[_0xb736('0x1b')]){delete _0x4e1dc2[_0xb736('0x1b')];}_0x589fd5[_0xb736('0x1c')](_0xb7a975)[_0xb736('0x1d')](_0x4e1dc2);};}exports[_0xb736('0x1e')]=function(_0xe15b26,_0x5d377e){var _0x2933c2={},_0x666de2={},_0x5d88ab={'count':0x0,'rows':[]};var _0x4d538d=_[_0xb736('0x1f')](db[_0xb736('0x20')][_0xb736('0x21')],function(_0x280705){return{'name':_0x280705[_0xb736('0x22')],'type':_0x280705[_0xb736('0x23')][_0xb736('0x24')]};});_0x666de2[_0xb736('0x25')]=_[_0xb736('0x1f')](_0x4d538d,_0xb736('0x1b'));_0x666de2[_0xb736('0x26')]=_[_0xb736('0x27')](_0xe15b26[_0xb736('0x26')]);_0x666de2[_0xb736('0x28')]=_['intersection'](_0x666de2[_0xb736('0x25')],_0x666de2['query']);_0x2933c2['attributes']=_[_0xb736('0x29')](_0x666de2[_0xb736('0x25')],qs['fields'](_0xe15b26['query'][_0xb736('0x2a')]));_0x2933c2[_0xb736('0x2b')]=_0x2933c2[_0xb736('0x2b')][_0xb736('0x2c')]?_0x2933c2['attributes']:_0x666de2[_0xb736('0x25')];if(!_0xe15b26[_0xb736('0x26')]['hasOwnProperty'](_0xb736('0x2d'))){_0x2933c2[_0xb736('0x14')]=qs[_0xb736('0x14')](_0xe15b26[_0xb736('0x26')][_0xb736('0x14')]);_0x2933c2[_0xb736('0x11')]=qs['offset'](_0xe15b26[_0xb736('0x26')][_0xb736('0x11')]);}_0x2933c2[_0xb736('0x2e')]=qs[_0xb736('0x2f')](_0xe15b26['query'][_0xb736('0x2f')]);_0x2933c2['where']=qs[_0xb736('0x28')](_[_0xb736('0x30')](_0xe15b26[_0xb736('0x26')],_0x666de2[_0xb736('0x28')]),_0x4d538d);if(_0xe15b26['query'][_0xb736('0x31')]){_0x2933c2[_0xb736('0x32')]=_['merge'](_0x2933c2[_0xb736('0x32')],{'$or':_['map'](_0x4d538d,function(_0x3cd363){if(_0x3cd363[_0xb736('0x23')]!==_0xb736('0x33')){var _0x369794={};_0x369794[_0x3cd363[_0xb736('0x1b')]]={'$like':'%'+_0xe15b26[_0xb736('0x26')][_0xb736('0x31')]+'%'};return _0x369794;}})});}_0x2933c2=_[_0xb736('0x34')]({},_0x2933c2,_0xe15b26['options']);var _0x105a48={'where':_0x2933c2[_0xb736('0x32')]};return db[_0xb736('0x20')][_0xb736('0x13')](_0x105a48)['then'](function(_0x5f0091){_0x5d88ab[_0xb736('0x13')]=_0x5f0091;if(_0xe15b26[_0xb736('0x26')][_0xb736('0x35')]){_0x2933c2[_0xb736('0x36')]=[{'all':!![]}];}return db['Network']['findAll'](_0x2933c2);})['then'](function(_0x2e866b){_0x5d88ab[_0xb736('0x37')]=_0x2e866b;return _0x5d88ab;})[_0xb736('0x18')](respondWithFilteredResult(_0x5d377e,_0x2933c2))[_0xb736('0xf')](handleError(_0x5d377e,null));};exports[_0xb736('0x38')]=function(_0x3293cf,_0x547f3f){var _0x5178ed={'raw':!![],'where':{'id':_0x3293cf[_0xb736('0x39')]['id']}},_0x3508af={};_0x3508af['model']=_['keys'](db[_0xb736('0x20')][_0xb736('0x21')]);_0x3508af[_0xb736('0x26')]=_[_0xb736('0x27')](_0x3293cf[_0xb736('0x26')]);_0x3508af[_0xb736('0x28')]=_[_0xb736('0x29')](_0x3508af['model'],_0x3508af[_0xb736('0x26')]);_0x5178ed['attributes']=_[_0xb736('0x29')](_0x3508af[_0xb736('0x25')],qs['fields'](_0x3293cf[_0xb736('0x26')]['fields']));_0x5178ed[_0xb736('0x2b')]=_0x5178ed['attributes'][_0xb736('0x2c')]?_0x5178ed['attributes']:_0x3508af['model'];if(_0x3293cf[_0xb736('0x26')][_0xb736('0x35')]){_0x5178ed[_0xb736('0x36')]=[{'all':!![]}];}_0x5178ed=_['merge']({},_0x5178ed,_0x3293cf['options']);return db['Network'][_0xb736('0x3a')](_0x5178ed)['then'](handleEntityNotFound(_0x547f3f,null))['then'](respondWithResult(_0x547f3f,null))[_0xb736('0xf')](handleError(_0x547f3f,null));};exports[_0xb736('0x3b')]=function(_0x61da80,_0x18f674){var _0x391223;return db[_0xb736('0x20')]['create'](_0x61da80['body'],{'raw':!![]})[_0xb736('0x18')](function(_0x3354fb){_0x391223=_0x3354fb;return db[_0xb736('0x20')][_0xb736('0x3c')]({'where':{'type':_0x61da80[_0xb736('0x3d')]['type']},'raw':!![]});})[_0xb736('0x18')](function(_0x142fa7){if(_0x391223[_0xb736('0x23')][_0xb736('0x3e')]()=='STUN'){var _0x1fdc2b=fs[_0xb736('0x3f')](path[_0xb736('0x40')](config[_0xb736('0x41')],_0xb736('0x42')),_0xb736('0x43'));var _0x2c182e=ejs[_0xb736('0x44')](_0x1fdc2b,{'networks':_0x142fa7||[]});fs[_0xb736('0x45')](_0xb736('0x46'),_0x2c182e);return respondWithRpcPromise(_0xb736('0x47'),_0xb736('0x3b'),{'module':'res_stun_monitor.so'});}else if(_0x391223[_0xb736('0x23')][_0xb736('0x3e')]()==_0xb736('0x48')){var _0x24c125=fs[_0xb736('0x3f')](path[_0xb736('0x40')](config[_0xb736('0x41')],_0xb736('0x49')),'utf8');var _0x52814a=ejs['render'](_0x24c125,{'networks':_0x142fa7||[]});fs[_0xb736('0x45')](_0xb736('0x4a'),_0x52814a);return respondWithRpcPromise(_0xb736('0x47'),'create',{'module':_0xb736('0x4b')});}else{var _0x177a2e=fs['readFileSync'](path['join'](config[_0xb736('0x41')],_0xb736('0x4c')),_0xb736('0x43'));var _0x570c46=ejs['render'](_0x177a2e,{'networks':_0x142fa7||[]});fs[_0xb736('0x45')](util['format'](_0xb736('0x4d'),_0x61da80[_0xb736('0x3d')][_0xb736('0x23')]['toLowerCase']()),_0x570c46);return respondWithRpcPromise(_0xb736('0x47'),_0xb736('0x3b'),{'module':_0xb736('0x4e')});}})[_0xb736('0x18')](function(){return _0x391223;})['then'](respondWithResult(_0x18f674,0xc9))['catch'](handleError(_0x18f674,null));};exports[_0xb736('0x17')]=function(_0x423641,_0x3810b){var _0x2e173d;return db[_0xb736('0x20')][_0xb736('0x3a')]({'where':{'id':_0x423641[_0xb736('0x39')]['id']}})[_0xb736('0x18')](handleEntityNotFound(_0x3810b,null))[_0xb736('0x18')](saveUpdates(_0x423641[_0xb736('0x3d')],null))[_0xb736('0x18')](function(_0x1a26dc){if(_0x1a26dc){_0x2e173d=_0x1a26dc;return db['Network']['findAll']({'where':{'type':_0x2e173d['type']},'raw':!![]});}return null;})[_0xb736('0x18')](function(_0x57e93b){if(_0x2e173d[_0xb736('0x23')][_0xb736('0x3e')]()==_0xb736('0x4f')){var _0x1eff72=fs[_0xb736('0x3f')](path[_0xb736('0x40')](config[_0xb736('0x41')],_0xb736('0x42')),'utf8');var _0x92d979=ejs[_0xb736('0x44')](_0x1eff72,{'networks':_0x57e93b||[]});fs['writeFileSync'](_0xb736('0x46'),_0x92d979);return respondWithRpcPromise('Reload',_0xb736('0x17'),{'module':_0xb736('0x4b')});}else if(_0x2e173d['type'][_0xb736('0x3e')]()==_0xb736('0x48')){var _0x66c5cd=fs['readFileSync'](path[_0xb736('0x40')](config[_0xb736('0x41')],_0xb736('0x49')),_0xb736('0x43'));var _0x572732=ejs['render'](_0x66c5cd,{'networks':_0x57e93b||[]});fs[_0xb736('0x45')](_0xb736('0x4a'),_0x572732);return respondWithRpcPromise('Reload',_0xb736('0x17'),{'module':'res_stun_monitor.so'});}else{var _0x59f0c8=fs[_0xb736('0x3f')](path[_0xb736('0x40')](config[_0xb736('0x41')],'server/files/templates/network.ejs'),_0xb736('0x43'));var _0x399c1e=ejs[_0xb736('0x44')](_0x59f0c8,{'networks':_0x57e93b||[]});fs[_0xb736('0x45')](util[_0xb736('0x50')](_0xb736('0x4d'),_0x423641[_0xb736('0x3d')][_0xb736('0x23')]['toLowerCase']()),_0x399c1e);return respondWithRpcPromise(_0xb736('0x47'),_0xb736('0x17'),{'module':'chan_sip.so'});}})[_0xb736('0x18')](function(_0xb44d7d){if(_0xb44d7d){return _0x2e173d;}return null;})['then'](respondWithResult(_0x3810b,null))['catch'](handleError(_0x3810b,null));};exports[_0xb736('0x19')]=function(_0xc09c6e,_0x19b470){var _0x10541a;return db[_0xb736('0x20')][_0xb736('0x3a')]({'where':{'id':_0xc09c6e[_0xb736('0x39')]['id']}})[_0xb736('0x18')](function(_0x1247fc){_0x10541a=_0x1247fc;return _0x1247fc;})['then'](handleEntityNotFound(_0x19b470,null))[_0xb736('0x18')](removeEntity(_0x19b470,null))[_0xb736('0x18')](function(){if(_0x10541a){return db['Network']['findAll']({'where':{'type':_0x10541a['type']},'raw':!![]});}})[_0xb736('0x18')](function(_0x7a22b){if(_0x10541a['type']['toUpperCase']()=='STUN'){var _0x518cbd=fs[_0xb736('0x3f')](path[_0xb736('0x40')](config['root'],_0xb736('0x42')),_0xb736('0x43'));var _0x13634d=ejs[_0xb736('0x44')](_0x518cbd,{'networks':_0x7a22b||[]});fs[_0xb736('0x45')](_0xb736('0x46'),_0x13634d);return respondWithRpcPromise('Reload','destroy',{'module':_0xb736('0x4b')});}else if(_0x10541a['type'][_0xb736('0x3e')]()==_0xb736('0x48')){var _0x480d31=fs[_0xb736('0x3f')](path['join'](config['root'],_0xb736('0x49')),_0xb736('0x43'));var _0x3a8365=ejs[_0xb736('0x44')](_0x480d31,{'networks':_0x7a22b||[]});fs[_0xb736('0x45')]('/etc/asterisk/turn_xcally.conf',_0x3a8365);return respondWithRpcPromise(_0xb736('0x47'),_0xb736('0x19'),{'module':_0xb736('0x4b')});}else{var _0x14a705=fs[_0xb736('0x3f')](path[_0xb736('0x40')](config[_0xb736('0x41')],_0xb736('0x4c')),_0xb736('0x43'));var _0x23b85f=ejs[_0xb736('0x44')](_0x14a705,{'networks':_0x7a22b||[]});fs[_0xb736('0x45')](util[_0xb736('0x50')](_0xb736('0x4d'),_0x10541a[_0xb736('0x23')][_0xb736('0x51')]()),_0x23b85f);return respondWithRpcPromise(_0xb736('0x47'),_0xb736('0x19'),{'module':_0xb736('0x4e')});}})[_0xb736('0xf')](handleError(_0x19b470,null));};
\ No newline at end of file
+var _0xc445=['/etc/asterisk/sip_xcally_%s.conf','toLowerCase','params','chan_sip.so','destroy','util','path','ejs','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','Network,\x20%s,\x20%s,\x20%s','error','code','Network,\x20%s,\x20%s','message','result','status','json','offset','undefined','limit','count','set','Content-Range','update','end','sendStatus','stack','name','send','map','Network','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','toUpperCase','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','Reload','server/files/templates/network.ejs','format'];(function(_0x388899,_0x17f370){var _0x3be17d=function(_0x19ad17){while(--_0x19ad17){_0x388899['push'](_0x388899['shift']());}};_0x3be17d(++_0x17f370);}(_0xc445,0x169));var _0x5c44=function(_0x2f6233,_0x90172){_0x2f6233=_0x2f6233-0x0;var _0x1c9c36=_0xc445[_0x2f6233];return _0x1c9c36;};'use strict';var util=require(_0x5c44('0x0'));var path=require(_0x5c44('0x1'));var ejs=require(_0x5c44('0x2'));var fs=require('fs');var _=require(_0x5c44('0x3'));var qs=require(_0x5c44('0x4'));var logger=require('../../config/logger')(_0x5c44('0x5'));var config=require(_0x5c44('0x6'));var db=require(_0x5c44('0x7'))['db'];var jayson=require(_0x5c44('0x8'));var client=jayson[_0x5c44('0x9')][_0x5c44('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39bffc,_0x4071f2,_0x357050,_0x5c3277){return new Promise(function(_0x21ece4,_0x112d03){var _0x5d021b=_0x5c3277||client;return _0x5d021b[_0x5c44('0xb')](_0x39bffc,_0x357050)[_0x5c44('0xc')](function(_0x4e4c14){logger[_0x5c44('0xd')]('Network,\x20%s,\x20%s',_0x4071f2,_0x5c44('0xe'));logger['debug'](_0x5c44('0xf'),_0x4071f2,_0x5c44('0xe'),JSON['stringify'](_0x4e4c14));if(_0x4e4c14[_0x5c44('0x10')]){if(_0x4e4c14[_0x5c44('0x10')][_0x5c44('0x11')]===0x1f4){logger[_0x5c44('0x10')](_0x5c44('0x12'),_0x4071f2,_0x4e4c14[_0x5c44('0x10')][_0x5c44('0x13')]);return _0x112d03(_0x4e4c14['error'][_0x5c44('0x13')]);}logger[_0x5c44('0x10')]('Network,\x20%s,\x20%s',_0x4071f2,_0x4e4c14['error']['message']);return _0x21ece4(_0x4e4c14[_0x5c44('0x10')][_0x5c44('0x13')]);}else{logger['info'](_0x5c44('0x12'),_0x4071f2,_0x5c44('0xe'));_0x21ece4(_0x4e4c14[_0x5c44('0x14')]['message']);}})['catch'](function(_0x36d9a0){logger['error'](_0x5c44('0x12'),_0x4071f2,_0x36d9a0);_0x112d03(_0x36d9a0);});});}function respondWithResult(_0xc972b6,_0x4beb01){_0x4beb01=_0x4beb01||0xc8;return function(_0x1b711f){if(_0x1b711f){return _0xc972b6[_0x5c44('0x15')](_0x4beb01)[_0x5c44('0x16')](_0x1b711f);}};}function respondWithFilteredResult(_0x3597a9,_0x476b0b){return function(_0x44bdfd){if(_0x44bdfd){var _0x26595e=typeof _0x476b0b[_0x5c44('0x17')]===_0x5c44('0x18')&&typeof _0x476b0b[_0x5c44('0x19')]==='undefined';var _0x109ddb=_0x44bdfd[_0x5c44('0x1a')];var _0x510637=_0x26595e?0x0:_0x476b0b[_0x5c44('0x17')];var _0x17287b=_0x26595e?_0x44bdfd[_0x5c44('0x1a')]:_0x476b0b[_0x5c44('0x17')]+_0x476b0b['limit'];var _0x4e9cc4;if(_0x17287b>=_0x109ddb){_0x17287b=_0x109ddb;_0x4e9cc4=0xc8;}else{_0x4e9cc4=0xce;}_0x3597a9[_0x5c44('0x15')](_0x4e9cc4);return _0x3597a9[_0x5c44('0x1b')](_0x5c44('0x1c'),_0x510637+'-'+_0x17287b+'/'+_0x109ddb)[_0x5c44('0x16')](_0x44bdfd);}return null;};}function saveUpdates(_0x275fd7){return function(_0x52c9a2){if(_0x52c9a2){return _0x52c9a2[_0x5c44('0x1d')](_0x275fd7)['then'](function(_0x2065c7){return _0x2065c7;});}return null;};}function removeEntity(_0xea72ba){return function(_0x279c6f){if(_0x279c6f){return _0x279c6f['destroy']()[_0x5c44('0xc')](function(){_0xea72ba[_0x5c44('0x15')](0xcc)[_0x5c44('0x1e')]();});}};}function handleEntityNotFound(_0x36c06d){return function(_0x5009fa){if(!_0x5009fa){_0x36c06d[_0x5c44('0x1f')](0x194);}return _0x5009fa;};}function handleError(_0x4398b3,_0x2b2c42){_0x2b2c42=_0x2b2c42||0x1f4;return function(_0x1cd192){logger[_0x5c44('0x10')](_0x1cd192[_0x5c44('0x20')]);if(_0x1cd192[_0x5c44('0x21')]){delete _0x1cd192[_0x5c44('0x21')];}_0x4398b3['status'](_0x2b2c42)[_0x5c44('0x22')](_0x1cd192);};}exports['index']=function(_0x4d640b,_0x580632){var _0x2a6b94={},_0x5b0540={},_0x40fb1c={'count':0x0,'rows':[]};var _0x545a32=_[_0x5c44('0x23')](db[_0x5c44('0x24')][_0x5c44('0x25')],function(_0x5154cb){return{'name':_0x5154cb[_0x5c44('0x26')],'type':_0x5154cb['type'][_0x5c44('0x27')]};});_0x5b0540[_0x5c44('0x28')]=_[_0x5c44('0x23')](_0x545a32,_0x5c44('0x21'));_0x5b0540[_0x5c44('0x29')]=_[_0x5c44('0x2a')](_0x4d640b[_0x5c44('0x29')]);_0x5b0540[_0x5c44('0x2b')]=_[_0x5c44('0x2c')](_0x5b0540[_0x5c44('0x28')],_0x5b0540[_0x5c44('0x29')]);_0x2a6b94[_0x5c44('0x2d')]=_[_0x5c44('0x2c')](_0x5b0540['model'],qs[_0x5c44('0x2e')](_0x4d640b['query'][_0x5c44('0x2e')]));_0x2a6b94[_0x5c44('0x2d')]=_0x2a6b94['attributes'][_0x5c44('0x2f')]?_0x2a6b94[_0x5c44('0x2d')]:_0x5b0540['model'];if(!_0x4d640b[_0x5c44('0x29')][_0x5c44('0x30')](_0x5c44('0x31'))){_0x2a6b94[_0x5c44('0x19')]=qs[_0x5c44('0x19')](_0x4d640b[_0x5c44('0x29')]['limit']);_0x2a6b94[_0x5c44('0x17')]=qs[_0x5c44('0x17')](_0x4d640b[_0x5c44('0x29')][_0x5c44('0x17')]);}_0x2a6b94[_0x5c44('0x32')]=qs[_0x5c44('0x33')](_0x4d640b['query'][_0x5c44('0x33')]);_0x2a6b94[_0x5c44('0x34')]=qs['filters'](_[_0x5c44('0x35')](_0x4d640b[_0x5c44('0x29')],_0x5b0540[_0x5c44('0x2b')]),_0x545a32);if(_0x4d640b['query'][_0x5c44('0x36')]){_0x2a6b94['where']=_[_0x5c44('0x37')](_0x2a6b94[_0x5c44('0x34')],{'$or':_['map'](_0x545a32,function(_0x544b65){if(_0x544b65[_0x5c44('0x38')]!==_0x5c44('0x39')){var _0x55b20d={};_0x55b20d[_0x544b65[_0x5c44('0x21')]]={'$like':'%'+_0x4d640b[_0x5c44('0x29')][_0x5c44('0x36')]+'%'};return _0x55b20d;}})});}_0x2a6b94=_[_0x5c44('0x37')]({},_0x2a6b94,_0x4d640b[_0x5c44('0x3a')]);var _0x56d26c={'where':_0x2a6b94[_0x5c44('0x34')]};return db['Network'][_0x5c44('0x1a')](_0x56d26c)[_0x5c44('0xc')](function(_0x9bd424){_0x40fb1c['count']=_0x9bd424;if(_0x4d640b['query'][_0x5c44('0x3b')]){_0x2a6b94[_0x5c44('0x3c')]=[{'all':!![]}];}return db['Network'][_0x5c44('0x3d')](_0x2a6b94);})[_0x5c44('0xc')](function(_0x51ba8f){_0x40fb1c[_0x5c44('0x3e')]=_0x51ba8f;return _0x40fb1c;})[_0x5c44('0xc')](respondWithFilteredResult(_0x580632,_0x2a6b94))[_0x5c44('0x3f')](handleError(_0x580632,null));};exports['show']=function(_0x262ef0,_0x28b877){var _0x3c98b2={'raw':!![],'where':{'id':_0x262ef0['params']['id']}},_0x36a291={};_0x36a291[_0x5c44('0x28')]=_[_0x5c44('0x2a')](db['Network'][_0x5c44('0x25')]);_0x36a291[_0x5c44('0x29')]=_[_0x5c44('0x2a')](_0x262ef0[_0x5c44('0x29')]);_0x36a291['filters']=_[_0x5c44('0x2c')](_0x36a291['model'],_0x36a291[_0x5c44('0x29')]);_0x3c98b2[_0x5c44('0x2d')]=_[_0x5c44('0x2c')](_0x36a291['model'],qs[_0x5c44('0x2e')](_0x262ef0[_0x5c44('0x29')][_0x5c44('0x2e')]));_0x3c98b2[_0x5c44('0x2d')]=_0x3c98b2[_0x5c44('0x2d')][_0x5c44('0x2f')]?_0x3c98b2[_0x5c44('0x2d')]:_0x36a291[_0x5c44('0x28')];if(_0x262ef0[_0x5c44('0x29')][_0x5c44('0x3b')]){_0x3c98b2[_0x5c44('0x3c')]=[{'all':!![]}];}_0x3c98b2=_[_0x5c44('0x37')]({},_0x3c98b2,_0x262ef0[_0x5c44('0x3a')]);return db[_0x5c44('0x24')][_0x5c44('0x40')](_0x3c98b2)['then'](handleEntityNotFound(_0x28b877,null))['then'](respondWithResult(_0x28b877,null))[_0x5c44('0x3f')](handleError(_0x28b877,null));};exports[_0x5c44('0x41')]=function(_0x729b4f,_0x459121){var _0x1759a8;return db[_0x5c44('0x24')]['create'](_0x729b4f['body'],{'raw':!![]})[_0x5c44('0xc')](function(_0x3f3f29){_0x1759a8=_0x3f3f29;return db[_0x5c44('0x24')][_0x5c44('0x3d')]({'where':{'type':_0x729b4f[_0x5c44('0x42')][_0x5c44('0x38')]},'raw':!![]});})[_0x5c44('0xc')](function(_0x2bb442){if(_0x1759a8[_0x5c44('0x38')]['toUpperCase']()==_0x5c44('0x43')){var _0x4d58a4=fs[_0x5c44('0x44')](path[_0x5c44('0x45')](config[_0x5c44('0x46')],_0x5c44('0x47')),_0x5c44('0x48'));var _0x25242e=ejs[_0x5c44('0x49')](_0x4d58a4,{'networks':_0x2bb442||[]});fs[_0x5c44('0x4a')](_0x5c44('0x4b'),_0x25242e);return respondWithRpcPromise('Reload',_0x5c44('0x41'),{'module':_0x5c44('0x4c')});}else if(_0x1759a8[_0x5c44('0x38')][_0x5c44('0x4d')]()==_0x5c44('0x4e')){var _0xb7d2fa=fs[_0x5c44('0x44')](path[_0x5c44('0x45')](config[_0x5c44('0x46')],_0x5c44('0x4f')),_0x5c44('0x48'));var _0x34969a=ejs[_0x5c44('0x49')](_0xb7d2fa,{'networks':_0x2bb442||[]});fs['writeFileSync'](_0x5c44('0x50'),_0x34969a);return respondWithRpcPromise(_0x5c44('0x51'),_0x5c44('0x41'),{'module':_0x5c44('0x4c')});}else{var _0x1a760c=fs[_0x5c44('0x44')](path[_0x5c44('0x45')](config['root'],_0x5c44('0x52')),'utf8');var _0x3184d9=ejs[_0x5c44('0x49')](_0x1a760c,{'networks':_0x2bb442||[]});fs[_0x5c44('0x4a')](util[_0x5c44('0x53')](_0x5c44('0x54'),_0x729b4f['body'][_0x5c44('0x38')][_0x5c44('0x55')]()),_0x3184d9);return respondWithRpcPromise(_0x5c44('0x51'),_0x5c44('0x41'),{'module':'chan_sip.so'});}})[_0x5c44('0xc')](function(){return _0x1759a8;})['then'](respondWithResult(_0x459121,0xc9))['catch'](handleError(_0x459121,null));};exports[_0x5c44('0x1d')]=function(_0x416308,_0x5af633){var _0x1ac083;return db['Network'][_0x5c44('0x40')]({'where':{'id':_0x416308[_0x5c44('0x56')]['id']}})[_0x5c44('0xc')](handleEntityNotFound(_0x5af633,null))[_0x5c44('0xc')](saveUpdates(_0x416308['body'],null))[_0x5c44('0xc')](function(_0x4a763d){if(_0x4a763d){_0x1ac083=_0x4a763d;return db['Network']['findAll']({'where':{'type':_0x1ac083[_0x5c44('0x38')]},'raw':!![]});}return null;})['then'](function(_0x492514){if(_0x1ac083['type'][_0x5c44('0x4d')]()==_0x5c44('0x43')){var _0xbb39bd=fs['readFileSync'](path[_0x5c44('0x45')](config[_0x5c44('0x46')],_0x5c44('0x47')),_0x5c44('0x48'));var _0x445a78=ejs[_0x5c44('0x49')](_0xbb39bd,{'networks':_0x492514||[]});fs[_0x5c44('0x4a')](_0x5c44('0x4b'),_0x445a78);return respondWithRpcPromise('Reload','update',{'module':_0x5c44('0x4c')});}else if(_0x1ac083[_0x5c44('0x38')]['toUpperCase']()==_0x5c44('0x4e')){var _0x5caf28=fs[_0x5c44('0x44')](path[_0x5c44('0x45')](config['root'],'server/files/templates/turn_multiple.ejs'),_0x5c44('0x48'));var _0x450692=ejs[_0x5c44('0x49')](_0x5caf28,{'networks':_0x492514||[]});fs[_0x5c44('0x4a')](_0x5c44('0x50'),_0x450692);return respondWithRpcPromise('Reload','update',{'module':_0x5c44('0x4c')});}else{var _0x31204d=fs[_0x5c44('0x44')](path[_0x5c44('0x45')](config[_0x5c44('0x46')],_0x5c44('0x52')),'utf8');var _0x1edeba=ejs[_0x5c44('0x49')](_0x31204d,{'networks':_0x492514||[]});fs[_0x5c44('0x4a')](util[_0x5c44('0x53')](_0x5c44('0x54'),_0x416308[_0x5c44('0x42')][_0x5c44('0x38')][_0x5c44('0x55')]()),_0x1edeba);return respondWithRpcPromise(_0x5c44('0x51'),_0x5c44('0x1d'),{'module':_0x5c44('0x57')});}})[_0x5c44('0xc')](function(_0x22e325){if(_0x22e325){return _0x1ac083;}return null;})[_0x5c44('0xc')](respondWithResult(_0x5af633,null))['catch'](handleError(_0x5af633,null));};exports[_0x5c44('0x58')]=function(_0x2fea5f,_0x3c22c2){var _0x200d96;return db[_0x5c44('0x24')][_0x5c44('0x40')]({'where':{'id':_0x2fea5f[_0x5c44('0x56')]['id']}})[_0x5c44('0xc')](function(_0x540899){_0x200d96=_0x540899;return _0x540899;})[_0x5c44('0xc')](handleEntityNotFound(_0x3c22c2,null))[_0x5c44('0xc')](removeEntity(_0x3c22c2,null))['then'](function(){if(_0x200d96){return db[_0x5c44('0x24')][_0x5c44('0x3d')]({'where':{'type':_0x200d96['type']},'raw':!![]});}})['then'](function(_0x164c2a){if(_0x200d96[_0x5c44('0x38')]['toUpperCase']()=='STUN'){var _0x3e1476=fs['readFileSync'](path['join'](config[_0x5c44('0x46')],_0x5c44('0x47')),'utf8');var _0x1c58c1=ejs[_0x5c44('0x49')](_0x3e1476,{'networks':_0x164c2a||[]});fs['writeFileSync'](_0x5c44('0x4b'),_0x1c58c1);return respondWithRpcPromise(_0x5c44('0x51'),_0x5c44('0x58'),{'module':_0x5c44('0x4c')});}else if(_0x200d96[_0x5c44('0x38')][_0x5c44('0x4d')]()==_0x5c44('0x4e')){var _0x9c69b3=fs[_0x5c44('0x44')](path[_0x5c44('0x45')](config['root'],_0x5c44('0x4f')),_0x5c44('0x48'));var _0x3ca0fd=ejs[_0x5c44('0x49')](_0x9c69b3,{'networks':_0x164c2a||[]});fs[_0x5c44('0x4a')](_0x5c44('0x50'),_0x3ca0fd);return respondWithRpcPromise(_0x5c44('0x51'),_0x5c44('0x58'),{'module':_0x5c44('0x4c')});}else{var _0x422d87=fs[_0x5c44('0x44')](path[_0x5c44('0x45')](config[_0x5c44('0x46')],_0x5c44('0x52')),'utf8');var _0x357237=ejs[_0x5c44('0x49')](_0x422d87,{'networks':_0x164c2a||[]});fs[_0x5c44('0x4a')](util[_0x5c44('0x53')](_0x5c44('0x54'),_0x200d96[_0x5c44('0x38')][_0x5c44('0x55')]()),_0x357237);return respondWithRpcPromise(_0x5c44('0x51'),_0x5c44('0x58'),{'module':_0x5c44('0x57')});}})['catch'](handleError(_0x3c22c2,null));};
\ No newline at end of file
index 84458ad..cdf02e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x780f=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./network.attributes','define','Network','network'];(function(_0x49cec6,_0x25ea07){var _0x3c2ed3=function(_0x33100c){while(--_0x33100c){_0x49cec6['push'](_0x49cec6['shift']());}};_0x3c2ed3(++_0x25ea07);}(_0x780f,0x6c));var _0xf780=function(_0x38b2d9,_0x19fd42){_0x38b2d9=_0x38b2d9-0x0;var _0x23a3e1=_0x780f[_0x38b2d9];return _0x23a3e1;};'use strict';var _=require(_0xf780('0x0'));var util=require(_0xf780('0x1'));var logger=require(_0xf780('0x2'))(_0xf780('0x3'));var moment=require(_0xf780('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf780('0x5'));var rimraf=require(_0xf780('0x6'));var config=require(_0xf780('0x7'));var attributes=require(_0xf780('0x8'));module['exports']=function(_0x37b0a2,_0x4b55e7){return _0x37b0a2[_0xf780('0x9')](_0xf780('0xa'),attributes,{'tableName':_0xf780('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbb53=['define','Network','network','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xc4e164,_0x3f49aa){var _0x198f33=function(_0xbae59){while(--_0xbae59){_0xc4e164['push'](_0xc4e164['shift']());}};_0x198f33(++_0x3f49aa);}(_0xbb53,0x121));var _0x3bb5=function(_0x2435d1,_0x584cbb){_0x2435d1=_0x2435d1-0x0;var _0x19b21b=_0xbb53[_0x2435d1];return _0x19b21b;};'use strict';var _=require(_0x3bb5('0x0'));var util=require(_0x3bb5('0x1'));var logger=require(_0x3bb5('0x2'))(_0x3bb5('0x3'));var moment=require(_0x3bb5('0x4'));var BPromise=require(_0x3bb5('0x5'));var rp=require(_0x3bb5('0x6'));var fs=require('fs');var path=require(_0x3bb5('0x7'));var rimraf=require(_0x3bb5('0x8'));var config=require(_0x3bb5('0x9'));var attributes=require('./network.attributes');module['exports']=function(_0x23f11e,_0x2460b0){return _0x23f11e[_0x3bb5('0xa')](_0x3bb5('0xb'),attributes,{'tableName':_0x3bb5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8dd5cc4..86fbaf8 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(_0x183f39,_0x3a5d80){_0x183f39=_0x183f39-0x0;var _0x2de57c=_0x7a54[_0x183f39];return _0x2de57c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x5b83c2,_0x43e471){_0x5b83c2=_0x5b83c2-0x0;var _0x2efaba=_0x7a54[_0x5b83c2];return _0x2efaba;};'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
index 16d1f7c..5265d9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb782=['send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getApplications','/:id/interactions','/:id/users','post','addDisposition','addAnswer','/:id/notify','/:id/applications','addApplications','addAgents','/:id/send'];(function(_0xd255e,_0x1b567c){var _0x18059f=function(_0x488ff2){while(--_0x488ff2){_0xd255e['push'](_0xd255e['shift']());}};_0x18059f(++_0x1b567c);}(_0xb782,0x138));var _0x2b78=function(_0x363709,_0x5ed3f6){_0x363709=_0x363709-0x0;var _0x503372=_0xb782[_0x363709];return _0x503372;};'use strict';var multer=require(_0x2b78('0x0'));var util=require(_0x2b78('0x1'));var path=require(_0x2b78('0x2'));var timeout=require(_0x2b78('0x3'));var express=require(_0x2b78('0x4'));var router=express[_0x2b78('0x5')]();var fs_extra=require(_0x2b78('0x6'));var auth=require(_0x2b78('0x7'));var interaction=require(_0x2b78('0x8'));var config=require(_0x2b78('0x9'));var controller=require(_0x2b78('0xa'));router[_0x2b78('0xb')]('/',auth[_0x2b78('0xc')](),controller['index']);router[_0x2b78('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x2b78('0xd')]);router[_0x2b78('0xb')](_0x2b78('0xe'),auth[_0x2b78('0xc')](),controller[_0x2b78('0xf')]);router[_0x2b78('0xb')](_0x2b78('0x10'),auth[_0x2b78('0xc')](),controller[_0x2b78('0x11')]);router[_0x2b78('0xb')](_0x2b78('0x12'),auth['isAuthenticated'](),controller['getAnswers']);router['get']('/:id/applications',auth[_0x2b78('0xc')](),controller[_0x2b78('0x13')]);router[_0x2b78('0xb')](_0x2b78('0x14'),auth[_0x2b78('0xc')](),controller['getInteractions']);router[_0x2b78('0xb')](_0x2b78('0x15'),auth[_0x2b78('0xc')](),controller['getAgents']);router[_0x2b78('0x16')]('/',auth[_0x2b78('0xc')](),controller['create']);router[_0x2b78('0x16')](_0x2b78('0x10'),auth[_0x2b78('0xc')](),controller[_0x2b78('0x17')]);router[_0x2b78('0x16')](_0x2b78('0x12'),auth[_0x2b78('0xc')](),controller[_0x2b78('0x18')]);router[_0x2b78('0x16')](_0x2b78('0x19'),controller['notify']);router[_0x2b78('0x16')](_0x2b78('0x1a'),auth[_0x2b78('0xc')](),controller[_0x2b78('0x1b')]);router['post'](_0x2b78('0x15'),auth['isAuthenticated'](),controller[_0x2b78('0x1c')]);router[_0x2b78('0x16')](_0x2b78('0x1d'),auth[_0x2b78('0xc')](),controller[_0x2b78('0x1e')]);router[_0x2b78('0x1f')](_0x2b78('0xe'),auth['isAuthenticated'](),controller[_0x2b78('0x20')]);router[_0x2b78('0x21')](_0x2b78('0xe'),auth[_0x2b78('0xc')](),controller[_0x2b78('0x22')]);router['delete'](_0x2b78('0x10'),auth[_0x2b78('0xc')](),controller[_0x2b78('0x23')]);router[_0x2b78('0x21')](_0x2b78('0x12'),auth[_0x2b78('0xc')](),controller[_0x2b78('0x24')]);router[_0x2b78('0x21')](_0x2b78('0x15'),auth[_0x2b78('0xc')](),controller[_0x2b78('0x25')]);module['exports']=router;
\ No newline at end of file
+var _0xae7d=['/:id/users','post','addDisposition','/:id/notify','notify','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','/describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xae7d,0x9c));var _0xdae7=function(_0x113f8d,_0x1a8070){_0x113f8d=_0x113f8d-0x0;var _0x435ccb=_0xae7d[_0x113f8d];return _0x435ccb;};'use strict';var multer=require(_0xdae7('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdae7('0x1'));var router=express[_0xdae7('0x2')]();var fs_extra=require(_0xdae7('0x3'));var auth=require(_0xdae7('0x4'));var interaction=require(_0xdae7('0x5'));var config=require('../../config/environment');var controller=require(_0xdae7('0x6'));router[_0xdae7('0x7')]('/',auth[_0xdae7('0x8')](),controller['index']);router[_0xdae7('0x7')](_0xdae7('0x9'),auth[_0xdae7('0x8')](),controller['describe']);router[_0xdae7('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xdae7('0xa')]);router[_0xdae7('0x7')](_0xdae7('0xb'),auth[_0xdae7('0x8')](),controller[_0xdae7('0xc')]);router['get'](_0xdae7('0xd'),auth[_0xdae7('0x8')](),controller[_0xdae7('0xe')]);router[_0xdae7('0x7')](_0xdae7('0xf'),auth['isAuthenticated'](),controller[_0xdae7('0x10')]);router['get'](_0xdae7('0x11'),auth[_0xdae7('0x8')](),controller[_0xdae7('0x12')]);router[_0xdae7('0x7')](_0xdae7('0x13'),auth[_0xdae7('0x8')](),controller['getAgents']);router[_0xdae7('0x14')]('/',auth[_0xdae7('0x8')](),controller['create']);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xdae7('0x15')]);router[_0xdae7('0x14')](_0xdae7('0xd'),auth[_0xdae7('0x8')](),controller['addAnswer']);router[_0xdae7('0x14')](_0xdae7('0x16'),controller[_0xdae7('0x17')]);router[_0xdae7('0x14')]('/:id/applications',auth[_0xdae7('0x8')](),controller['addApplications']);router[_0xdae7('0x14')](_0xdae7('0x13'),auth[_0xdae7('0x8')](),controller['addAgents']);router['post'](_0xdae7('0x18'),auth[_0xdae7('0x8')](),controller[_0xdae7('0x19')]);router[_0xdae7('0x1a')](_0xdae7('0x1b'),auth[_0xdae7('0x8')](),controller[_0xdae7('0x1c')]);router[_0xdae7('0x1d')](_0xdae7('0x1b'),auth[_0xdae7('0x8')](),controller[_0xdae7('0x1e')]);router[_0xdae7('0x1d')](_0xdae7('0xb'),auth[_0xdae7('0x8')](),controller[_0xdae7('0x1f')]);router[_0xdae7('0x1d')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xdae7('0x20')]);router['delete'](_0xdae7('0x13'),auth[_0xdae7('0x8')](),controller[_0xdae7('0x21')]);module[_0xdae7('0x22')]=router;
\ No newline at end of file
index 536d67e..a6dbc67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0524=['BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','STRING','name','generate'];(function(_0x507692,_0x546639){var _0x5b0e60=function(_0x5e1950){while(--_0x5e1950){_0x507692['push'](_0x507692['shift']());}};_0x5b0e60(++_0x546639);}(_0x0524,0x11d));var _0x4052=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x0524[_0x3c2a69];return _0x596bc8;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x4052('0x0')],'unique':_0x4052('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x4052('0x0')]},'token':{'type':Sequelize[_0x4052('0x0')],'defaultValue':function(){return rs[_0x4052('0x2')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x4052('0x0')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x4052('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4052('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4052('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x4052('0x0')]},'queueTransfer':{'type':Sequelize[_0x4052('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4052('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4052('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4052('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x4052('0x3')],'defaultValue':![],'comment':_0x4052('0x5'),'set':function(_0xf23f0){if(!_0xf23f0)this[_0x4052('0x6')](_0x4052('0x7'),null);this['setDataValue'](_0x4052('0x8'),_0xf23f0);}}};
\ No newline at end of file
+var _0x0645=['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','name','STRING','generate'];(function(_0x1b0602,_0x2b22a5){var _0x262696=function(_0x3c45b9){while(--_0x3c45b9){_0x1b0602['push'](_0x1b0602['shift']());}};_0x262696(++_0x2b22a5);}(_0x0645,0xe9));var _0x5064=function(_0x37f88f,_0x27b6f0){_0x37f88f=_0x37f88f-0x0;var _0x34b668=_0x0645[_0x37f88f];return _0x34b668;};'use strict';var Sequelize=require(_0x5064('0x0'));var rs=require(_0x5064('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x5064('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x5064('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x5064('0x4')]();}},'replyUri':{'type':Sequelize[_0x5064('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x5064('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x5064('0x5')],'defaultValue':function(){return _0x5064('0x6');}},'notificationSound':{'type':Sequelize[_0x5064('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5064('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5064('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x5064('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5064('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5064('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5064('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5064('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x5064('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x5064('0x7')],'defaultValue':![],'comment':_0x5064('0xa'),'set':function(_0x24133b){if(!_0x24133b)this[_0x5064('0xb')](_0x5064('0xc'),null);this[_0x5064('0xb')](_0x5064('0xd'),_0x24133b);}}};
\ No newline at end of file
index ce0baee..566010d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99c9=['order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','fields','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','OpenchannelAccounts','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','findAll','removeAnswers','openchannel','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','Sequelize','ValidationError','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','OpenchannelApplication','account','applications','Applications','list','priority','asc','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','messageId','interaction','created','autoclose','push','close','*,*,*,*','AttachmentId','unshift','agent','Start','startRouting','EventManager','addApplications','sequelize','READ_COMMITTED','bulkCreate','findAndCountAll','finally','json','getApplications','getInteractions','pick','Contact','User','Owner','fullname','Tag','Tags','color','tag','addAgents','ids','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','CmList','out','OpenchannelMessage','dataValues','Messages','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','offset','undefined','limit','count','status','set','apply','save','destroy','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','fieldName','key','map','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit'];(function(_0x1d50f2,_0x3c3ec6){var _0x3769b8=function(_0x50926a){while(--_0x50926a){_0x1d50f2['push'](_0x1d50f2['shift']());}};_0x3769b8(++_0x3c3ec6);}(_0x99c9,0x13c));var _0x999c=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x99c9[_0x5a776b];return _0xbbef59;};'use strict';var emlformat=require(_0x999c('0x0'));var rimraf=require(_0x999c('0x1'));var zipdir=require(_0x999c('0x2'));var jsonpatch=require(_0x999c('0x3'));var rp=require(_0x999c('0x4'));var moment=require(_0x999c('0x5'));var BPromise=require(_0x999c('0x6'));var Mustache=require('mustache');var util=require(_0x999c('0x7'));var path=require(_0x999c('0x8'));var sox=require(_0x999c('0x9'));var csv=require(_0x999c('0xa'));var ejs=require(_0x999c('0xb'));var fs=require('fs');var fs_extra=require(_0x999c('0xc'));var _=require(_0x999c('0xd'));var squel=require(_0x999c('0xe'));var crypto=require(_0x999c('0xf'));var jsforce=require(_0x999c('0x10'));var deskjs=require(_0x999c('0x11'));var toCsv=require(_0x999c('0xa'));var querystring=require(_0x999c('0x12'));var Papa=require(_0x999c('0x13'));var Redis=require('ioredis');var authService=require(_0x999c('0x14'));var qs=require(_0x999c('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x999c('0x16'));var logger=require(_0x999c('0x17'))(_0x999c('0x18'));var utils=require(_0x999c('0x19'));var config=require(_0x999c('0x1a'));var licenseUtil=require(_0x999c('0x1b'));var db=require(_0x999c('0x1c'))['db'];config[_0x999c('0x1d')]=_[_0x999c('0x1e')](config[_0x999c('0x1d')],{'host':_0x999c('0x1f'),'port':0x18eb});var socket=require(_0x999c('0x20'))(new Redis(config['redis']));require(_0x999c('0x21'))[_0x999c('0x22')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x999c('0x23')][_0x999c('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x203a73,_0x116f08,_0x2a6667,_0x5d5d12){return new BPromise(function(_0x226437,_0x2b05e9){var _0x2b6126=_0x5d5d12||client;return _0x2b6126[_0x999c('0x25')](_0x203a73,_0x2a6667)[_0x999c('0x26')](function(_0x500048){logger[_0x999c('0x27')](_0x999c('0x28'),_0x116f08,_0x999c('0x29'));logger[_0x999c('0x2a')](_0x999c('0x2b'),_0x116f08,'request\x20sent',JSON[_0x999c('0x2c')](_0x500048));if(_0x500048[_0x999c('0x2d')]){if(_0x500048[_0x999c('0x2d')][_0x999c('0x2e')]===0x1f4){logger[_0x999c('0x2d')](_0x999c('0x28'),_0x116f08,_0x500048['error'][_0x999c('0x2f')]);return _0x2b05e9(_0x500048[_0x999c('0x2d')][_0x999c('0x2f')]);}logger[_0x999c('0x2d')](_0x999c('0x28'),_0x116f08,_0x500048[_0x999c('0x2d')][_0x999c('0x2f')]);return _0x226437(_0x500048[_0x999c('0x2d')][_0x999c('0x2f')]);}else{logger[_0x999c('0x27')](_0x999c('0x28'),_0x116f08,'request\x20sent');_0x226437(_0x500048[_0x999c('0x30')][_0x999c('0x2f')]);}})[_0x999c('0x31')](function(_0x2e9d58){logger[_0x999c('0x2d')](_0x999c('0x28'),_0x116f08,_0x2e9d58);_0x2b05e9(_0x2e9d58);});});}function respondWithStatusCode(_0x575897,_0x4755c2){_0x4755c2=_0x4755c2||0xcc;return function(_0x43293f){if(_0x43293f){return _0x575897[_0x999c('0x32')](_0x4755c2);}return _0x575897['status'](_0x4755c2)[_0x999c('0x33')]();};}function respondWithResult(_0x4413c5,_0x53953d){_0x53953d=_0x53953d||0xc8;return function(_0x6e5e54){if(_0x6e5e54){return _0x4413c5['status'](_0x53953d)['json'](_0x6e5e54);}};}function respondWithFilteredResult(_0xedf57d,_0x42cb25){return function(_0x457df3){if(_0x457df3){var _0x2de6d5=typeof _0x42cb25[_0x999c('0x34')]===_0x999c('0x35')&&typeof _0x42cb25[_0x999c('0x36')]===_0x999c('0x35');var _0x352c25=_0x457df3[_0x999c('0x37')];var _0x532bae=_0x2de6d5?0x0:_0x42cb25[_0x999c('0x34')];var _0x192976=_0x2de6d5?_0x457df3[_0x999c('0x37')]:_0x42cb25[_0x999c('0x34')]+_0x42cb25[_0x999c('0x36')];var _0x1d0ba6;if(_0x192976>=_0x352c25){_0x192976=_0x352c25;_0x1d0ba6=0xc8;}else{_0x1d0ba6=0xce;}_0xedf57d[_0x999c('0x38')](_0x1d0ba6);return _0xedf57d[_0x999c('0x39')]('Content-Range',_0x532bae+'-'+_0x192976+'/'+_0x352c25)['json'](_0x457df3);}return null;};}function patchUpdates(_0x2fa094){return function(_0x98537f){try{jsonpatch[_0x999c('0x3a')](_0x98537f,_0x2fa094,!![]);}catch(_0x3872b7){return BPromise['reject'](_0x3872b7);}return _0x98537f[_0x999c('0x3b')]();};}function saveUpdates(_0xe28e45,_0x46815d){return function(_0x2a3b74){if(_0x2a3b74){return _0x2a3b74['update'](_0xe28e45)['then'](function(_0x21d6df){return _0x21d6df;});}return null;};}function removeEntity(_0x22aa6d,_0x3664fa){return function(_0x323956){if(_0x323956){return _0x323956[_0x999c('0x3c')]()[_0x999c('0x26')](function(){var _0x4bb1c0=_0x323956['get']({'plain':!![]});var _0x5ad13e='OpenchannelAccounts';return db[_0x999c('0x3d')][_0x999c('0x3c')]({'where':{'type':_0x5ad13e,'resourceId':_0x4bb1c0['id']}})['then'](function(){return _0x323956;});})['then'](function(){_0x22aa6d['status'](0xcc)[_0x999c('0x33')]();});}};}function handleEntityNotFound(_0x10fcf3,_0x15dc10){return function(_0x3a112d){if(!_0x3a112d){_0x10fcf3['sendStatus'](0x194);}return _0x3a112d;};}function handleError(_0x105c33,_0x7cc663){_0x7cc663=_0x7cc663||0x1f4;return function(_0x513aa4){logger['error'](_0x513aa4[_0x999c('0x3e')]);if(_0x513aa4['name']){delete _0x513aa4[_0x999c('0x3f')];}_0x105c33['status'](_0x7cc663)[_0x999c('0x40')](_0x513aa4);};}exports[_0x999c('0x41')]=function(_0x1763f0,_0xcd729){var _0x59029b={'include':[{'model':db[_0x999c('0x42')],'as':_0x999c('0x43')}]},_0x580593={},_0x21318e={'count':0x0,'rows':[]};var _0xf26ba3=_['map'](db[_0x999c('0x44')][_0x999c('0x45')],function(_0x2b7956){return{'name':_0x2b7956[_0x999c('0x46')],'type':_0x2b7956['type'][_0x999c('0x47')]};});_0x580593['model']=_[_0x999c('0x48')](_0xf26ba3,_0x999c('0x3f'));_0x580593['query']=_[_0x999c('0x49')](_0x1763f0[_0x999c('0x4a')]);_0x580593[_0x999c('0x4b')]=_[_0x999c('0x4c')](_0x580593[_0x999c('0x4d')],_0x580593[_0x999c('0x4a')]);_0x59029b[_0x999c('0x4e')]=_[_0x999c('0x4c')](_0x580593['model'],qs['fields'](_0x1763f0['query']['fields']));_0x59029b[_0x999c('0x4e')]=_0x59029b[_0x999c('0x4e')][_0x999c('0x4f')]?_0x59029b[_0x999c('0x4e')]:_0x580593[_0x999c('0x4d')];if(!_0x1763f0['query'][_0x999c('0x50')](_0x999c('0x51'))){_0x59029b[_0x999c('0x36')]=qs[_0x999c('0x36')](_0x1763f0[_0x999c('0x4a')]['limit']);_0x59029b[_0x999c('0x34')]=qs[_0x999c('0x34')](_0x1763f0[_0x999c('0x4a')][_0x999c('0x34')]);}_0x59029b[_0x999c('0x52')]=qs[_0x999c('0x53')](_0x1763f0[_0x999c('0x4a')][_0x999c('0x53')]);_0x59029b[_0x999c('0x54')]=qs['filters'](_['pick'](_0x1763f0[_0x999c('0x4a')],_0x580593[_0x999c('0x4b')]),_0xf26ba3);if(_0x1763f0[_0x999c('0x4a')][_0x999c('0x55')]){_0x59029b[_0x999c('0x54')]=_[_0x999c('0x56')](_0x59029b[_0x999c('0x54')],{'$or':_[_0x999c('0x48')](_0xf26ba3,function(_0x133395){if(_0x133395[_0x999c('0x57')]!==_0x999c('0x58')){var _0x4ca662={};_0x4ca662[_0x133395[_0x999c('0x3f')]]={'$like':'%'+_0x1763f0[_0x999c('0x4a')][_0x999c('0x55')]+'%'};return _0x4ca662;}})});}_0x59029b=_[_0x999c('0x56')]({},_0x59029b,_0x1763f0[_0x999c('0x59')]);var _0x386be6={'where':_0x59029b[_0x999c('0x54')]};return db[_0x999c('0x44')]['count'](_0x386be6)[_0x999c('0x26')](function(_0x1a0472){_0x21318e[_0x999c('0x37')]=_0x1a0472;if(_0x1763f0[_0x999c('0x4a')][_0x999c('0x5a')]){_0x59029b[_0x999c('0x5b')]=[{'all':!![]}];}return db[_0x999c('0x44')]['findAll'](_0x59029b);})['then'](function(_0x1139f6){_0x21318e[_0x999c('0x5c')]=_0x1139f6;return _0x21318e;})[_0x999c('0x26')](respondWithFilteredResult(_0xcd729,_0x59029b))[_0x999c('0x31')](handleError(_0xcd729,null));};exports[_0x999c('0x5d')]=function(_0x57327c,_0x3defe9){var _0x116d7f={'raw':![],'where':{'id':_0x57327c[_0x999c('0x5e')]['id']},'include':[{'model':db['Pause'],'as':_0x999c('0x43')}]},_0x38b75a={};_0x38b75a['model']=_[_0x999c('0x49')](db[_0x999c('0x44')][_0x999c('0x45')]);_0x38b75a[_0x999c('0x4a')]=_[_0x999c('0x49')](_0x57327c[_0x999c('0x4a')]);_0x38b75a[_0x999c('0x4b')]=_['intersection'](_0x38b75a[_0x999c('0x4d')],_0x38b75a[_0x999c('0x4a')]);_0x116d7f[_0x999c('0x4e')]=_['intersection'](_0x38b75a[_0x999c('0x4d')],qs[_0x999c('0x5f')](_0x57327c[_0x999c('0x4a')]['fields']));_0x116d7f[_0x999c('0x4e')]=_0x116d7f['attributes'][_0x999c('0x4f')]?_0x116d7f[_0x999c('0x4e')]:_0x38b75a[_0x999c('0x4d')];if(_0x57327c[_0x999c('0x4a')]['includeAll']){_0x116d7f[_0x999c('0x5b')]=[{'all':!![]}];}_0x116d7f=_['merge']({},_0x116d7f,_0x57327c['options']);return db[_0x999c('0x44')][_0x999c('0x60')](_0x116d7f)['then'](handleEntityNotFound(_0x3defe9,null))[_0x999c('0x26')](respondWithResult(_0x3defe9,null))['catch'](handleError(_0x3defe9,null));};exports[_0x999c('0x61')]=function(_0xe89a71,_0x4e21d2){return db[_0x999c('0x44')][_0x999c('0x61')](_0xe89a71[_0x999c('0x62')],{})[_0x999c('0x26')](function(_0x237524){var _0x2da455=_0xe89a71[_0x999c('0x63')][_0x999c('0x64')]({'plain':!![]});if(!_0x2da455)throw new Error(_0x999c('0x65'));if(_0x2da455['role']===_0x999c('0x63')){var _0x260467=_0x237524[_0x999c('0x64')]({'plain':!![]});var _0xcadfbc=_0x999c('0x66');return db[_0x999c('0x67')]['find']({'where':{'name':_0xcadfbc,'userProfileId':_0x2da455['userProfileId']},'raw':!![]})['then'](function(_0x4a6b73){if(_0x4a6b73&&_0x4a6b73[_0x999c('0x68')]===0x0){return db[_0x999c('0x3d')][_0x999c('0x61')]({'name':_0x260467['name'],'resourceId':_0x260467['id'],'type':_0x4a6b73[_0x999c('0x3f')],'sectionId':_0x4a6b73['id']},{})['then'](function(){return _0x237524;});}else{return _0x237524;}})[_0x999c('0x31')](function(_0x5c25c2){logger[_0x999c('0x2d')](_0x999c('0x69'),_0x5c25c2);throw _0x5c25c2;});}return _0x237524;})[_0x999c('0x26')](respondWithResult(_0x4e21d2,0xc9))[_0x999c('0x31')](handleError(_0x4e21d2,null));};exports[_0x999c('0x6a')]=function(_0x534c67,_0x2fa2e5){if(_0x534c67[_0x999c('0x62')]['id']){delete _0x534c67[_0x999c('0x62')]['id'];}return db[_0x999c('0x44')][_0x999c('0x60')]({'where':{'id':_0x534c67[_0x999c('0x5e')]['id']},'include':[{'model':db[_0x999c('0x42')],'as':'mandatoryDispositionPause'}]})[_0x999c('0x26')](handleEntityNotFound(_0x2fa2e5,null))[_0x999c('0x26')](saveUpdates(_0x534c67[_0x999c('0x62')],null))[_0x999c('0x26')](respondWithResult(_0x2fa2e5,null))[_0x999c('0x31')](handleError(_0x2fa2e5,null));};exports[_0x999c('0x3c')]=function(_0x3a9a0d,_0x4f22bd){return db[_0x999c('0x44')][_0x999c('0x60')]({'where':{'id':_0x3a9a0d['params']['id']}})['then'](handleEntityNotFound(_0x4f22bd,null))[_0x999c('0x26')](removeEntity(_0x4f22bd,null))[_0x999c('0x31')](handleError(_0x4f22bd,null));};exports[_0x999c('0x6b')]=function(_0x5e57d0,_0x40aea7){return db[_0x999c('0x44')][_0x999c('0x6b')]()[_0x999c('0x26')](respondWithResult(_0x40aea7,null))[_0x999c('0x31')](handleError(_0x40aea7,null));};exports[_0x999c('0x6c')]=function(_0x50b65c,_0x9ce623,_0x54d0a5){if(_0x50b65c[_0x999c('0x62')]['id']){delete _0x50b65c[_0x999c('0x62')]['id'];}return db[_0x999c('0x44')][_0x999c('0x60')]({'where':{'id':_0x50b65c[_0x999c('0x5e')]['id']}})[_0x999c('0x26')](handleEntityNotFound(_0x9ce623,null))[_0x999c('0x26')](function(_0x39aa48){if(_0x39aa48){_0x50b65c[_0x999c('0x62')][_0x999c('0x6d')]=_0x39aa48['id'];return db[_0x999c('0x6e')][_0x999c('0x61')](_0x50b65c[_0x999c('0x62')]);}})['then'](respondWithResult(_0x9ce623,null))[_0x999c('0x31')](handleError(_0x9ce623,null));};exports[_0x999c('0x6f')]=function(_0x55ce3a,_0x1066c8,_0x1b91b3){var _0x2d5fca={'raw':![],'where':{}};var _0x52d38a={};var _0x2e0a60={'count':0x0,'rows':[]};return db[_0x999c('0x44')][_0x999c('0x70')]({'where':{'id':_0x55ce3a[_0x999c('0x5e')]['id']}})[_0x999c('0x26')](handleEntityNotFound(_0x1066c8,null))['then'](function(_0x42e688){if(_0x42e688){_0x52d38a[_0x999c('0x4d')]=_[_0x999c('0x49')](db[_0x999c('0x6e')][_0x999c('0x45')]);_0x52d38a[_0x999c('0x4a')]=_[_0x999c('0x49')](_0x55ce3a[_0x999c('0x4a')]);_0x52d38a['filters']=_[_0x999c('0x4c')](_0x52d38a[_0x999c('0x4d')],_0x52d38a['query']);_0x2d5fca['attributes']=_[_0x999c('0x4c')](_0x52d38a[_0x999c('0x4d')],qs[_0x999c('0x5f')](_0x55ce3a[_0x999c('0x4a')]['fields']));_0x2d5fca[_0x999c('0x4e')]=_0x2d5fca[_0x999c('0x4e')][_0x999c('0x4f')]?_0x2d5fca['attributes']:_0x52d38a[_0x999c('0x4d')];if(!_0x55ce3a['query'][_0x999c('0x50')](_0x999c('0x51'))){_0x2d5fca[_0x999c('0x36')]=qs[_0x999c('0x36')](_0x55ce3a['query'][_0x999c('0x36')]);_0x2d5fca[_0x999c('0x34')]=qs[_0x999c('0x34')](_0x55ce3a[_0x999c('0x4a')][_0x999c('0x34')]);}_0x2d5fca[_0x999c('0x52')]=qs[_0x999c('0x53')](_0x55ce3a[_0x999c('0x4a')][_0x999c('0x53')]);_0x2d5fca[_0x999c('0x54')]=qs[_0x999c('0x4b')](_['pick'](_0x55ce3a[_0x999c('0x4a')],_0x52d38a[_0x999c('0x4b')]));_0x2d5fca[_0x999c('0x54')][_0x999c('0x6d')]=_0x42e688['id'];if(_0x55ce3a[_0x999c('0x4a')][_0x999c('0x55')]){_0x2d5fca['where']=_['merge'](_0x2d5fca[_0x999c('0x54')],{'$or':_[_0x999c('0x48')](_0x2d5fca['attributes'],function(_0x1e45d7){var _0x2714f9={};_0x2714f9[_0x1e45d7]={'$like':'%'+_0x55ce3a[_0x999c('0x4a')]['filter']+'%'};return _0x2714f9;})});}_0x2d5fca=_[_0x999c('0x56')]({},_0x2d5fca,_0x55ce3a['options']);return db[_0x999c('0x6e')][_0x999c('0x37')]({'where':_0x2d5fca[_0x999c('0x54')]})[_0x999c('0x26')](function(_0xa46c99){_0x2e0a60[_0x999c('0x37')]=_0xa46c99;if(_0x55ce3a[_0x999c('0x4a')][_0x999c('0x5a')]){_0x2d5fca['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x2d5fca);})[_0x999c('0x26')](function(_0x288cf8){_0x2e0a60[_0x999c('0x5c')]=_0x288cf8;return _0x2e0a60;});}})[_0x999c('0x26')](respondWithFilteredResult(_0x1066c8,_0x2d5fca))[_0x999c('0x31')](handleError(_0x1066c8,null));};exports[_0x999c('0x71')]=function(_0x462bea,_0x482164,_0x30c4fe){return db[_0x999c('0x44')][_0x999c('0x60')]({'where':{'id':_0x462bea[_0x999c('0x5e')]['id']}})[_0x999c('0x26')](handleEntityNotFound(_0x482164,null))['then'](function(_0x2bfb6e){if(_0x2bfb6e){return _0x2bfb6e['removeDispositions'](_0x462bea[_0x999c('0x4a')]['ids']);}})['then'](respondWithStatusCode(_0x482164,null))['catch'](handleError(_0x482164,null));};exports[_0x999c('0x72')]=function(_0x5b77af,_0x2e3cb8,_0x38df92){if(_0x5b77af[_0x999c('0x62')]['id']){delete _0x5b77af[_0x999c('0x62')]['id'];}return db[_0x999c('0x44')][_0x999c('0x60')]({'where':{'id':_0x5b77af[_0x999c('0x5e')]['id']}})[_0x999c('0x26')](handleEntityNotFound(_0x2e3cb8,null))[_0x999c('0x26')](function(_0x23fc2b){if(_0x23fc2b){_0x5b77af[_0x999c('0x62')][_0x999c('0x6d')]=_0x23fc2b['id'];return db[_0x999c('0x73')][_0x999c('0x61')](_0x5b77af['body']);}})[_0x999c('0x26')](respondWithResult(_0x2e3cb8,null))[_0x999c('0x31')](handleError(_0x2e3cb8,null));};exports['getAnswers']=function(_0x19d749,_0x4ddc1c,_0x20b10b){var _0x5a55df={'raw':![],'where':{}};var _0x20fc31={};var _0x5f2925={'count':0x0,'rows':[]};return db[_0x999c('0x44')][_0x999c('0x70')]({'where':{'id':_0x19d749[_0x999c('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4ddc1c,null))[_0x999c('0x26')](function(_0x119a3a){if(_0x119a3a){_0x20fc31[_0x999c('0x4d')]=_[_0x999c('0x49')](db['CannedAnswer'][_0x999c('0x45')]);_0x20fc31[_0x999c('0x4a')]=_['keys'](_0x19d749['query']);_0x20fc31['filters']=_['intersection'](_0x20fc31['model'],_0x20fc31[_0x999c('0x4a')]);_0x5a55df[_0x999c('0x4e')]=_[_0x999c('0x4c')](_0x20fc31[_0x999c('0x4d')],qs[_0x999c('0x5f')](_0x19d749[_0x999c('0x4a')]['fields']));_0x5a55df[_0x999c('0x4e')]=_0x5a55df['attributes'][_0x999c('0x4f')]?_0x5a55df[_0x999c('0x4e')]:_0x20fc31[_0x999c('0x4d')];if(!_0x19d749[_0x999c('0x4a')]['hasOwnProperty'](_0x999c('0x51'))){_0x5a55df['limit']=qs['limit'](_0x19d749[_0x999c('0x4a')][_0x999c('0x36')]);_0x5a55df[_0x999c('0x34')]=qs[_0x999c('0x34')](_0x19d749[_0x999c('0x4a')][_0x999c('0x34')]);}_0x5a55df[_0x999c('0x52')]=qs[_0x999c('0x53')](_0x19d749[_0x999c('0x4a')]['sort']);_0x5a55df['where']=qs[_0x999c('0x4b')](_['pick'](_0x19d749[_0x999c('0x4a')],_0x20fc31[_0x999c('0x4b')]));_0x5a55df[_0x999c('0x54')]['OpenchannelAccountId']=_0x119a3a['id'];if(_0x19d749[_0x999c('0x4a')][_0x999c('0x55')]){_0x5a55df[_0x999c('0x54')]=_[_0x999c('0x56')](_0x5a55df['where'],{'$or':_['map'](_0x5a55df['attributes'],function(_0x46a204){var _0x2e618a={};_0x2e618a[_0x46a204]={'$like':'%'+_0x19d749[_0x999c('0x4a')][_0x999c('0x55')]+'%'};return _0x2e618a;})});}_0x5a55df=_[_0x999c('0x56')]({},_0x5a55df,_0x19d749[_0x999c('0x59')]);return db[_0x999c('0x73')][_0x999c('0x37')]({'where':_0x5a55df[_0x999c('0x54')]})['then'](function(_0x32acce){_0x5f2925[_0x999c('0x37')]=_0x32acce;if(_0x19d749['query'][_0x999c('0x5a')]){_0x5a55df[_0x999c('0x5b')]=[{'all':!![]}];}return db['CannedAnswer'][_0x999c('0x74')](_0x5a55df);})[_0x999c('0x26')](function(_0x4a217f){_0x5f2925[_0x999c('0x5c')]=_0x4a217f;return _0x5f2925;});}})[_0x999c('0x26')](respondWithFilteredResult(_0x4ddc1c,_0x5a55df))[_0x999c('0x31')](handleError(_0x4ddc1c,null));};exports[_0x999c('0x75')]=function(_0x3811dc,_0x3a23b6,_0x31d350){return db['OpenchannelAccount']['find']({'where':{'id':_0x3811dc[_0x999c('0x5e')]['id']}})[_0x999c('0x26')](handleEntityNotFound(_0x3a23b6,null))[_0x999c('0x26')](function(_0x350c00){if(_0x350c00){return _0x350c00[_0x999c('0x75')](_0x3811dc['query']['ids']);}})[_0x999c('0x26')](respondWithStatusCode(_0x3a23b6,null))[_0x999c('0x31')](handleError(_0x3a23b6,null));};exports['notify']=function(_0x352c27,_0x5127ae,_0x173ffe){var _0x39158e={'body':_0x352c27[_0x999c('0x62')],'channel':_0x999c('0x76')};var _0x5cfcd2=[];var _0x4bcdc7=[];var _0x33badb={};var _0x487912=![];return db[_0x999c('0x77')]['describe']()[_0x999c('0x26')](function(_0x591266){if(!_0x591266){throw new db['Sequelize']['ValidationError'](_0x999c('0x78'));}_0x5cfcd2=_[_0x999c('0x79')](_[_0x999c('0x49')](_0x591266),[_0x999c('0x7a'),_0x999c('0x7b')]);_0x4bcdc7=_[_0x999c('0x79')](_['keys'](_0x591266),[_0x999c('0x7a'),'updatedAt',_0x999c('0x7c'),_0x999c('0x7d')]);if(_0x352c27['body']['id']){delete _0x352c27[_0x999c('0x62')]['id'];}if(_[_0x999c('0x7e')](_0x352c27[_0x999c('0x62')][_0x999c('0x7f')])){throw new db['Sequelize']['ValidationError'](_0x999c('0x80'));}if(_[_0x999c('0x7e')](_0x352c27[_0x999c('0x62')][_0x999c('0x62')])||_0x352c27[_0x999c('0x62')][_0x999c('0x62')]===''){throw new db[(_0x999c('0x81'))][(_0x999c('0x82'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x999c('0x7e')](_0x352c27[_0x999c('0x62')][_0x999c('0x83')])){throw new db[(_0x999c('0x81'))][(_0x999c('0x82'))](_0x999c('0x84')+_0x4bcdc7);}if(!_[_0x999c('0x85')](_0x4bcdc7,_0x352c27[_0x999c('0x62')]['mapKey'])){throw new db[(_0x999c('0x81'))][(_0x999c('0x82'))](_0x999c('0x86')+_0x4bcdc7);}_0x33badb[_0x352c27[_0x999c('0x62')][_0x999c('0x83')]]=_0x352c27[_0x999c('0x62')][_0x999c('0x7f')];})[_0x999c('0x26')](function(){return db['OpenchannelAccount'][_0x999c('0x60')]({'where':{'id':_0x352c27[_0x999c('0x5e')]['id']},'include':[{'model':db['CmList'],'as':_0x999c('0x87'),'include':[{'model':db[_0x999c('0x77')],'as':_0x999c('0x88'),'where':_0x33badb,'limit':0x1,'order':[['updatedAt',_0x999c('0x89')]]}]},{'model':db[_0x999c('0x8a')],'as':'Applications'}]});})[_0x999c('0x26')](handleEntityNotFound(_0x5127ae,null))['then'](function(_0x4d68c5){if(_0x4d68c5&&_0x4d68c5['List']){_0x39158e[_0x999c('0x8b')]=_0x4d68c5;_0x39158e[_0x999c('0x8c')]=_0x4d68c5[_0x999c('0x8d')];_0x39158e[_0x999c('0x8e')]=_0x4d68c5['List'];_0x39158e[_0x999c('0x8c')]=_['orderBy'](_0x39158e[_0x999c('0x8c')],[_0x999c('0x8f')],[_0x999c('0x90')]);if(_0x39158e[_0x999c('0x8b')][_0x999c('0x8d')]){delete _0x39158e[_0x999c('0x8b')][_0x999c('0x8d')];}if(_0x39158e['account'][_0x999c('0x87')]&&_0x39158e[_0x999c('0x8b')][_0x999c('0x87')][_0x999c('0x88')][_0x999c('0x4f')]){return _0x39158e[_0x999c('0x8b')][_0x999c('0x87')][_0x999c('0x88')][0x0];}var _0x3e81f1=_['defaults'](_0x352c27['body'],{'firstName':_0x352c27[_0x999c('0x62')]['from'],'ListId':_0x4d68c5['ListId']});_0x3e81f1[_0x352c27[_0x999c('0x62')][_0x999c('0x83')]]=_0x352c27[_0x999c('0x62')][_0x999c('0x7f')];return db[_0x999c('0x77')][_0x999c('0x61')](_0x3e81f1,{'fields':_0x5cfcd2,'raw':!![]});}})[_0x999c('0x26')](handleEntityNotFound(_0x5127ae,null))[_0x999c('0x26')](function(_0x901111){_0x39158e['contact']=_0x901111;if(_0x901111){var _0x118e98={'ContactId':_0x901111['id'],'OpenchannelAccountId':_0x352c27['params']['id'],'from':(_0x901111[_0x999c('0x91')]||'')+'\x20'+(_0x901111[_0x999c('0x92')]||'')};var _0xb579d8={'OpenchannelAccountId':_0x352c27[_0x999c('0x5e')]['id'],'closed':![]};if(_0x352c27[_0x999c('0x62')][_0x999c('0x93')]){_0xb579d8[_0x999c('0x93')]=_0x352c27[_0x999c('0x62')][_0x999c('0x93')];return db[_0x999c('0x94')][_0x999c('0x60')]({'where':_0xb579d8})[_0x999c('0x26')](function(_0x2f9f8d){if(_0x2f9f8d){return[_0x2f9f8d,![]];}_0x118e98[_0x999c('0x93')]=_0x352c27[_0x999c('0x62')][_0x999c('0x93')];_0x118e98[_0x999c('0x95')]=_0x352c27[_0x999c('0x62')]['externalUrl'];return db[_0x999c('0x94')][_0x999c('0x61')](_0x118e98)['then'](function(_0x154f00){return[_0x154f00,!![]];});});}else{_0xb579d8['threadId']=null;}_0xb579d8[_0x999c('0x96')]=_0x901111['id'];return db[_0x999c('0x94')][_0x999c('0x60')]({'where':_0xb579d8})[_0x999c('0x26')](function(_0x12e274){if(_0x12e274){return[_0x12e274,![]];}return db[_0x999c('0x94')]['create'](_0x118e98)['then'](function(_0x89a587){return[_0x89a587,!![]];});});}})[_0x999c('0x97')](function(_0x49f0af,_0x56bbdd){if(_0x49f0af){_0x487912=_0x56bbdd;if(!_0x56bbdd){var _0x14dfe2={'from':(_0x39158e[_0x999c('0x98')]['firstName']||'')+'\x20'+(_0x39158e[_0x999c('0x98')][_0x999c('0x92')]||'')};if(_0x352c27[_0x999c('0x62')][_0x999c('0x93')]&&_0x352c27[_0x999c('0x62')][_0x999c('0x99')]&&_0x352c27[_0x999c('0x62')][_0x999c('0x93')]!=_0x352c27[_0x999c('0x62')][_0x999c('0x99')]){_0x14dfe2['threadId']=_0x352c27['body'][_0x999c('0x99')];}return _0x49f0af[_0x999c('0x6a')](_0x14dfe2);}else{return _0x49f0af;}}})[_0x999c('0x26')](function(_0x1888db){_0x39158e[_0x999c('0x9a')]=_0x1888db[_0x999c('0x64')]({'plain':!![]});_0x39158e[_0x999c('0x9a')][_0x999c('0x9b')]=_0x487912;if(_0x39158e[_0x999c('0x9a')][_0x999c('0x9b')]){if(_0x39158e[_0x999c('0x8b')][_0x999c('0x9c')]){_0x39158e[_0x999c('0x8c')][_0x999c('0x9d')]({'id':0x0,'priority':_0x39158e[_0x999c('0x8c')][_0x999c('0x4f')]+0x1,'app':_0x999c('0x9e'),'appdata':'unmanaged','interval':_0x999c('0x9f')});}}return db['OpenchannelMessage'][_0x999c('0x61')]({'body':_0x352c27[_0x999c('0x62')]['body'],'OpenchannelAccountId':_0x352c27[_0x999c('0x5e')]['id'],'OpenchannelInteractionId':_0x1888db['id'],'direction':'in','ContactId':_0x39158e['contact']['id'],'AttachmentId':_0x352c27[_0x999c('0x62')][_0x999c('0xa0')]});})[_0x999c('0x26')](function(_0x58bd74){_0x39158e['message']=_0x58bd74;if(_0x39158e[_0x999c('0x9a')]['UserId']){return db['User'][_0x999c('0x60')]({'attributes':['id','name'],'where':{'id':_0x39158e[_0x999c('0x9a')]['UserId']}})[_0x999c('0x26')](function(_0x5e38d2){if(_0x5e38d2){_0x39158e['applications'][_0x999c('0xa1')]({'id':0x0,'priority':0x0,'app':_0x999c('0xa2'),'appdata':_0x5e38d2[_0x999c('0x3f')]+','+(_0x39158e[_0x999c('0x8b')]['waitForTheAssignedAgent']||0xa),'interval':_0x999c('0x9f')});_0x39158e['forcedOwnership']=![];}return respondWithRpcPromise(_0x999c('0xa3'),'startRouting',_0x39158e);});}return respondWithRpcPromise(_0x999c('0xa3'),_0x999c('0xa4'),_0x39158e);})['then'](function(_0x46729e){respondWithRpcPromise(_0x999c('0xa5'),'EventManager',{'event':'notify','message':_0x46729e},client9002);return _0x46729e;})['then'](respondWithResult(_0x5127ae,null))[_0x999c('0x31')](handleError(_0x5127ae,null));};exports[_0x999c('0xa6')]=function(_0x1126ab,_0x4c0a3c){var _0x1c57eb=_0x1126ab[_0x999c('0x5e')]['id'];var _0xc96aa=_0x1126ab[_0x999c('0x62')];var _0x2a2dd7=0xc8;var _0x1b085d=null;return db[_0x999c('0xa7')]['transaction']({'isolationLevel':db[_0x999c('0xa7')]['Transaction']['ISOLATION_LEVELS'][_0x999c('0xa8')]},function(_0xcd7120){return db[_0x999c('0x44')]['findOne']({'where':{'id':_0x1c57eb},'transaction':_0xcd7120})[_0x999c('0x26')](function(_0xaf8cb){if(_0xaf8cb){return db[_0x999c('0x8a')][_0x999c('0x3c')]({'where':{'OpenchannelAccountId':_0x1c57eb},'transaction':_0xcd7120})[_0x999c('0x26')](function(){var _0x2d1ce6=_[_0x999c('0x48')](_0xc96aa,function(_0x387dd6){_0x387dd6[_0x999c('0x6d')]=_0x1c57eb;return _0x387dd6;});return db[_0x999c('0x8a')][_0x999c('0xa9')](_0x2d1ce6,{'transaction':_0xcd7120});});}else{_0x2a2dd7=0x194;_0x1b085d=[];}});})[_0x999c('0x26')](function(){if(_0x2a2dd7!==0x194){return db[_0x999c('0x8a')][_0x999c('0xaa')]({'where':{'OpenchannelAccountId':_0x1c57eb},'order':'priority'})[_0x999c('0x26')](function(_0x4855b3){_0x1b085d=_0x4855b3;});}})[_0x999c('0x31')](function(_0x36c587){_0x2a2dd7=0x1f4;logger[_0x999c('0x2d')](_0x36c587[_0x999c('0x3e')]);if(_0x36c587[_0x999c('0x3f')]){delete _0x36c587[_0x999c('0x3f')];}_0x1b085d=_0x36c587;})[_0x999c('0xab')](function(){if(_0x1b085d===null){_0x4c0a3c[_0x999c('0x32')](_0x2a2dd7);}else{if(_0x2a2dd7===0x1f4){_0x4c0a3c[_0x999c('0x38')](_0x2a2dd7)[_0x999c('0x40')](_0x1b085d);}else{_0x4c0a3c['status'](_0x2a2dd7)[_0x999c('0xac')](_0x1b085d);}}});};exports['getApplications']=function(_0x324e7b,_0xdbfafa,_0x4b7564){var _0xcf1c09={};var _0x17ccc5={};var _0x132c7e;var _0x33e645;return db[_0x999c('0x44')][_0x999c('0x70')]({'where':{'id':_0x324e7b['params']['id']}})['then'](handleEntityNotFound(_0xdbfafa,null))[_0x999c('0x26')](function(_0x2bdb8b){if(_0x2bdb8b){_0x132c7e=_0x2bdb8b;_0x17ccc5[_0x999c('0x4d')]=_[_0x999c('0x49')](db[_0x999c('0x8a')][_0x999c('0x45')]);_0x17ccc5[_0x999c('0x4a')]=_['keys'](_0x324e7b[_0x999c('0x4a')]);_0x17ccc5[_0x999c('0x4b')]=_[_0x999c('0x4c')](_0x17ccc5[_0x999c('0x4d')],_0x17ccc5['query']);_0xcf1c09[_0x999c('0x4e')]=_[_0x999c('0x4c')](_0x17ccc5[_0x999c('0x4d')],qs[_0x999c('0x5f')](_0x324e7b[_0x999c('0x4a')]['fields']));_0xcf1c09[_0x999c('0x4e')]=_0xcf1c09['attributes']['length']?_0xcf1c09[_0x999c('0x4e')]:_0x17ccc5[_0x999c('0x4d')];_0xcf1c09[_0x999c('0x52')]=qs[_0x999c('0x53')](_0x324e7b[_0x999c('0x4a')][_0x999c('0x53')]);_0xcf1c09['where']=qs['filters'](_['pick'](_0x324e7b['query'],_0x17ccc5[_0x999c('0x4b')]));if(_0x324e7b[_0x999c('0x4a')]['filter']){_0xcf1c09['where']=_['merge'](_0xcf1c09[_0x999c('0x54')],{'$or':_[_0x999c('0x48')](_0xcf1c09['attributes'],function(_0x2c39aa){var _0xf12ee2={};_0xf12ee2[_0x2c39aa]={'$like':'%'+_0x324e7b[_0x999c('0x4a')][_0x999c('0x55')]+'%'};return _0xf12ee2;})});}_0xcf1c09=_['merge']({},_0xcf1c09,_0x324e7b[_0x999c('0x59')]);return _0x132c7e['getApplications'](_0xcf1c09);}})[_0x999c('0x26')](function(_0x30bb15){if(_0x30bb15){_0x33e645=_0x30bb15[_0x999c('0x4f')];if(!_0x324e7b[_0x999c('0x4a')][_0x999c('0x50')](_0x999c('0x51'))){_0xcf1c09[_0x999c('0x36')]=qs[_0x999c('0x36')](_0x324e7b[_0x999c('0x4a')]['limit']);_0xcf1c09[_0x999c('0x34')]=qs[_0x999c('0x34')](_0x324e7b['query'][_0x999c('0x34')]);}return _0x132c7e[_0x999c('0xad')](_0xcf1c09);}})[_0x999c('0x26')](function(_0x10d14e){if(_0x10d14e){return _0x10d14e?{'count':_0x33e645,'rows':_0x10d14e}:null;}})[_0x999c('0x26')](respondWithResult(_0xdbfafa,null))[_0x999c('0x31')](handleError(_0xdbfafa,null));};exports[_0x999c('0xae')]=function(_0x2a9d84,_0x55797f,_0x26804a){var _0x2988be={'raw':![],'where':{}};var _0x1669ae={};var _0x1cfa81={'count':0x0,'rows':[]};return db[_0x999c('0x44')]['findOne']({'where':{'id':_0x2a9d84['params']['id']}})[_0x999c('0x26')](handleEntityNotFound(_0x55797f,null))['then'](function(_0x11be94){if(_0x11be94){_0x1669ae[_0x999c('0x4d')]=_['keys'](db[_0x999c('0x94')][_0x999c('0x45')]);_0x1669ae[_0x999c('0x4a')]=_[_0x999c('0x49')](_0x2a9d84[_0x999c('0x4a')]);_0x1669ae[_0x999c('0x4b')]=_[_0x999c('0x4c')](_0x1669ae['model'],_0x1669ae[_0x999c('0x4a')]);_0x2988be['attributes']=_[_0x999c('0x4c')](_0x1669ae['model'],qs[_0x999c('0x5f')](_0x2a9d84[_0x999c('0x4a')][_0x999c('0x5f')]));_0x2988be['attributes']=_0x2988be['attributes'][_0x999c('0x4f')]?_0x2988be[_0x999c('0x4e')]:_0x1669ae[_0x999c('0x4d')];if(!_0x2a9d84[_0x999c('0x4a')][_0x999c('0x50')](_0x999c('0x51'))){_0x2988be['limit']=qs[_0x999c('0x36')](_0x2a9d84[_0x999c('0x4a')]['limit']);_0x2988be[_0x999c('0x34')]=qs[_0x999c('0x34')](_0x2a9d84[_0x999c('0x4a')][_0x999c('0x34')]);}_0x2988be['order']=qs[_0x999c('0x53')](_0x2a9d84['query']['sort']);_0x2988be['where']=qs[_0x999c('0x4b')](_[_0x999c('0xaf')](_0x2a9d84['query'],_0x1669ae['filters']));_0x2988be['where']['OpenchannelAccountId']=_0x11be94['id'];if(_0x2a9d84['query'][_0x999c('0x55')]){_0x2988be[_0x999c('0x54')]=_['merge'](_0x2988be[_0x999c('0x54')],{'$or':_[_0x999c('0x48')](_0x2988be[_0x999c('0x4e')],function(_0x68ad07){var _0x2ba1e3={};_0x2ba1e3[_0x68ad07]={'$like':'%'+_0x2a9d84[_0x999c('0x4a')][_0x999c('0x55')]+'%'};return _0x2ba1e3;})});}_0x2988be=_['merge']({},_0x2988be,_0x2a9d84[_0x999c('0x59')]);return db['OpenchannelInteraction']['count']({'where':_0x2988be[_0x999c('0x54')]})[_0x999c('0x26')](function(_0x1ff70f){_0x1cfa81[_0x999c('0x37')]=_0x1ff70f;if(_0x2a9d84[_0x999c('0x4a')][_0x999c('0x5a')]){_0x2988be[_0x999c('0x5b')]=[{'model':db[_0x999c('0x77')],'as':_0x999c('0xb0'),'required':![]},{'model':db[_0x999c('0xb1')],'as':_0x999c('0xb2'),'attributes':[_0x999c('0x3f'),_0x999c('0xb3'),'internal'],'required':![]},{'model':db[_0x999c('0xb4')],'as':_0x999c('0xb5'),'attributes':['id',_0x999c('0x3f'),_0x999c('0xb6')],'where':_0x2a9d84[_0x999c('0x4a')][_0x999c('0xb7')]?{'id':_0x2a9d84[_0x999c('0x4a')][_0x999c('0xb7')]}:undefined,'required':_0x2a9d84['query'][_0x999c('0xb7')]?!![]:![]}];}return db['OpenchannelInteraction'][_0x999c('0x74')](_0x2988be);})[_0x999c('0x26')](function(_0x34e051){_0x1cfa81['rows']=_0x34e051;return _0x1cfa81;});}})[_0x999c('0x26')](respondWithFilteredResult(_0x55797f,_0x2988be))['catch'](handleError(_0x55797f,null));};exports[_0x999c('0xb8')]=function(_0x283c4e,_0x5575bf,_0x52e8a4){return db[_0x999c('0x44')][_0x999c('0x60')]({'where':{'id':_0x283c4e[_0x999c('0x5e')]['id']}})[_0x999c('0x26')](handleEntityNotFound(_0x5575bf,null))[_0x999c('0x26')](function(_0x1d121c){if(_0x1d121c){return _0x1d121c[_0x999c('0xb8')](_0x283c4e[_0x999c('0x62')][_0x999c('0xb9')],_[_0x999c('0xba')](_0x283c4e[_0x999c('0x62')],['ids','id'])||{})['spread'](function(_0x7be8cd){for(var _0x21652b=0x0;_0x21652b<_0x283c4e['body'][_0x999c('0xb9')][_0x999c('0x4f')];_0x21652b+=0x1){socket[_0x999c('0xbb')](_0x999c('0xbc'),{'UserId':Number(_0x283c4e['body'][_0x999c('0xb9')][_0x21652b]),'OpenchannelAccountId':Number(_0x283c4e[_0x999c('0x5e')]['id'])});}return _0x7be8cd;});}})['then'](respondWithResult(_0x5575bf,null))[_0x999c('0x31')](handleError(_0x5575bf,null));};exports[_0x999c('0xbd')]=function(_0x3f54cd,_0x4e2b28,_0x431bea){return db[_0x999c('0x44')]['find']({'where':{'id':_0x3f54cd['params']['id']}})[_0x999c('0x26')](handleEntityNotFound(_0x4e2b28,null))[_0x999c('0x26')](function(_0x265c41){if(_0x265c41){return _0x265c41['removeAgents'](_0x3f54cd['query']['ids'])[_0x999c('0x26')](function(){if(_[_0x999c('0xbe')](_0x3f54cd[_0x999c('0x4a')][_0x999c('0xb9')])){for(var _0xdefce=0x0;_0xdefce<_0x3f54cd[_0x999c('0x4a')][_0x999c('0xb9')][_0x999c('0x4f')];_0xdefce+=0x1){socket['emit'](_0x999c('0xbf'),{'UserId':Number(_0x3f54cd[_0x999c('0x4a')][_0x999c('0xb9')][_0xdefce]),'OpenchannelAccountId':Number(_0x3f54cd[_0x999c('0x5e')]['id'])});}}else{socket[_0x999c('0xbb')](_0x999c('0xbf'),{'UserId':Number(_0x3f54cd[_0x999c('0x4a')][_0x999c('0xb9')]),'OpenchannelAccountId':Number(_0x3f54cd[_0x999c('0x5e')]['id'])});}});}})['then'](respondWithStatusCode(_0x4e2b28,null))[_0x999c('0x31')](handleError(_0x4e2b28,null));};exports[_0x999c('0xc0')]=function(_0x503aab,_0x4e07ad,_0x597c7e){var _0x5d31ce={};var _0x18bb3b={};var _0xc73b3f;var _0x2abe2f;return db[_0x999c('0x44')][_0x999c('0x70')]({'where':{'id':_0x503aab[_0x999c('0x5e')]['id']}})[_0x999c('0x26')](handleEntityNotFound(_0x4e07ad,null))[_0x999c('0x26')](function(_0x3d8a25){if(_0x3d8a25){_0xc73b3f=_0x3d8a25;_0x18bb3b[_0x999c('0x4d')]=_[_0x999c('0x49')](db[_0x999c('0xb1')]['rawAttributes']);_0x18bb3b['query']=_[_0x999c('0x49')](_0x503aab[_0x999c('0x4a')]);_0x18bb3b[_0x999c('0x4b')]=_[_0x999c('0x4c')](_0x18bb3b[_0x999c('0x4d')],_0x18bb3b[_0x999c('0x4a')]);_0x5d31ce['attributes']=_['intersection'](_0x18bb3b[_0x999c('0x4d')],qs[_0x999c('0x5f')](_0x503aab[_0x999c('0x4a')][_0x999c('0x5f')]));_0x5d31ce[_0x999c('0x4e')]=_0x5d31ce[_0x999c('0x4e')][_0x999c('0x4f')]?_0x5d31ce[_0x999c('0x4e')]:_0x18bb3b['model'];_0x5d31ce[_0x999c('0x52')]=qs[_0x999c('0x53')](_0x503aab[_0x999c('0x4a')][_0x999c('0x53')]);_0x5d31ce[_0x999c('0x54')]=qs[_0x999c('0x4b')](_[_0x999c('0xaf')](_0x503aab['query'],_0x18bb3b[_0x999c('0x4b')]));if(_0x503aab[_0x999c('0x4a')]['filter']){_0x5d31ce[_0x999c('0x54')]=_[_0x999c('0x56')](_0x5d31ce[_0x999c('0x54')],{'$or':_[_0x999c('0x48')](_0x5d31ce['attributes'],function(_0xdb4e4c){var _0x38e2ff={};_0x38e2ff[_0xdb4e4c]={'$like':'%'+_0x503aab[_0x999c('0x4a')][_0x999c('0x55')]+'%'};return _0x38e2ff;})});}_0x5d31ce=_[_0x999c('0x56')]({},_0x5d31ce,_0x503aab[_0x999c('0x59')]);return _0xc73b3f['getAgents'](_0x5d31ce);}})[_0x999c('0x26')](function(_0x30ae83){if(_0x30ae83){_0x2abe2f=_0x30ae83[_0x999c('0x4f')];if(!_0x503aab[_0x999c('0x4a')][_0x999c('0x50')](_0x999c('0x51'))){_0x5d31ce[_0x999c('0x36')]=qs[_0x999c('0x36')](_0x503aab[_0x999c('0x4a')][_0x999c('0x36')]);_0x5d31ce[_0x999c('0x34')]=qs[_0x999c('0x34')](_0x503aab[_0x999c('0x4a')][_0x999c('0x34')]);}return _0xc73b3f['getAgents'](_0x5d31ce);}})[_0x999c('0x26')](function(_0x50d085){if(_0x50d085){return _0x50d085?{'count':_0x2abe2f,'rows':_0x50d085}:null;}})[_0x999c('0x26')](respondWithResult(_0x4e07ad,null))[_0x999c('0x31')](handleError(_0x4e07ad,null));};exports[_0x999c('0x40')]=function(_0x2bd2fa,_0x5adc12,_0x421e19){var _0x9a038a,_0x1ef534,_0x520e48;if(_[_0x999c('0x7e')](_0x2bd2fa[_0x999c('0x62')][_0x999c('0x62')])||_0x2bd2fa['body']['body']===''){throw new db[(_0x999c('0x81'))][(_0x999c('0x82'))](_0x999c('0xc1'));}if(_[_0x999c('0x7e')](_0x2bd2fa[_0x999c('0x62')]['to'])){}_0x9a038a=_0x2bd2fa[_0x999c('0x62')]['to'];return db[_0x999c('0x44')][_0x999c('0x70')]({'where':{'id':_0x2bd2fa['params']['id']}})[_0x999c('0x26')](handleEntityNotFound(_0x5adc12,null))[_0x999c('0x26')](function(_0x5a7180){if(_0x5a7180){return db[_0x999c('0x44')][_0x999c('0x60')]({'where':{'id':_0x5a7180['id']},'include':[{'model':db[_0x999c('0xc2')],'as':_0x999c('0x87'),'include':[{'model':db['CmContact'],'as':_0x999c('0x88'),'where':{[_0x5a7180[_0x999c('0x83')]]:_0x9a038a},'limit':0x1,'order':[[_0x999c('0x7b'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x5adc12,null))[_0x999c('0x26')](function(_0x467b88){if(_0x467b88&&_0x467b88[_0x999c('0x87')]){_0x1ef534=_0x467b88[_0x999c('0x64')]({'plain':!![]});if(_0x1ef534[_0x999c('0x87')]&&_0x1ef534[_0x999c('0x87')][_0x999c('0x88')][_0x999c('0x4f')]){return _0x1ef534[_0x999c('0x87')][_0x999c('0x88')][0x0];}return db['CmContact'][_0x999c('0x61')](_[_0x999c('0x1e')](_0x2bd2fa['body'],{'firstName':_0x9a038a,[_0x467b88[_0x999c('0x83')]]:_0x9a038a,'phone':_0x9a038a,'ListId':_0x1ef534['ListId']}));}})[_0x999c('0x26')](handleEntityNotFound(_0x5adc12,null))[_0x999c('0x26')](function(_0x23ea9e){if(_0x23ea9e){_0x520e48=_0x23ea9e;return db[_0x999c('0x94')][_0x999c('0x60')]({'where':{'ContactId':_0x520e48['id'],'closed':![],'OpenchannelAccountId':_0x1ef534['id']}})[_0x999c('0x26')](function(_0x2b89ba){if(_0x2b89ba){return[_0x2b89ba,![]];}return db[_0x999c('0x94')]['create']({'UserId':_0x2bd2fa[_0x999c('0x63')]['id'],'ContactId':_0x520e48['id'],'OpenchannelAccountId':_0x1ef534['id'],'lastMsgDirection':_0x999c('0xc3'),'firstMsgDirection':_0x999c('0xc3'),'Messages':[_['merge'](_0x2bd2fa[_0x999c('0x62')],{'read':![],'body':_0x2bd2fa[_0x999c('0x62')][_0x999c('0x62')],'OpenchannelAccountId':_0x1ef534['id'],'UserId':_0x2bd2fa['user']['id'],'ContactId':_0x520e48['id']})]},{'include':[{'model':db[_0x999c('0xc4')],'as':'Messages'}]})['then'](function(_0x4da901){return[_0x4da901,!![]];});});}})[_0x999c('0x97')](function(_0x3788d6,_0x52039a){if(_0x52039a){return _0x3788d6;}return db['OpenchannelMessage']['create'](_[_0x999c('0x56')](_0x2bd2fa['body'],{'read':![],'body':_0x2bd2fa['body'][_0x999c('0x62')],'OpenchannelAccountId':_0x1ef534['id'],'OpenchannelInteractionId':_0x3788d6['id'],'UserId':_0x2bd2fa[_0x999c('0x63')]['id'],'ContactId':_0x520e48['id']}))[_0x999c('0x26')](function(_0x4174d0){_0x3788d6[_0x999c('0xc5')][_0x999c('0xc6')]=[];_0x3788d6[_0x999c('0xc5')]['Messages'][_0x999c('0x9d')](_0x4174d0[_0x999c('0xc5')]);return _0x3788d6;});});}})[_0x999c('0x26')](respondWithResult(_0x5adc12,null))[_0x999c('0x31')](handleError(_0x5adc12,null));};
\ No newline at end of file
+var _0x34d2=['keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','map','merge','includeAll','include','findAll','show','length','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addDisposition','OpenchannelAccountId','Disposition','pick','count','rows','removeDispositions','ids','CannedAnswer','findOne','removeAnswers','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','CmContact','Contacts','DESC','OpenchannelApplication','Applications','applications','list','orderBy','account','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','firstName','contact','lastName','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','AttachmentId','User','UserId','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority','finally','sendStatus','send','getApplications','getInteractions','Owner','fullname','internal','Tag','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','getAgents','out','Messages','OpenchannelMessage','push','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','undefined','limit','offset','Content-Range','json','apply','reject','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','fieldName','key','query'];(function(_0x483a65,_0xbe23e8){var _0x2342d3=function(_0x3310ed){while(--_0x3310ed){_0x483a65['push'](_0x483a65['shift']());}};_0x2342d3(++_0xbe23e8);}(_0x34d2,0x7b));var _0x234d=function(_0x5e8353,_0x1b82b9){_0x5e8353=_0x5e8353-0x0;var _0x24ab8f=_0x34d2[_0x5e8353];return _0x24ab8f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x234d('0x0'));var zipdir=require(_0x234d('0x1'));var jsonpatch=require(_0x234d('0x2'));var rp=require(_0x234d('0x3'));var moment=require(_0x234d('0x4'));var BPromise=require(_0x234d('0x5'));var Mustache=require(_0x234d('0x6'));var util=require(_0x234d('0x7'));var path=require('path');var sox=require(_0x234d('0x8'));var csv=require(_0x234d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x234d('0xa'));var _=require(_0x234d('0xb'));var squel=require(_0x234d('0xc'));var crypto=require(_0x234d('0xd'));var jsforce=require(_0x234d('0xe'));var deskjs=require(_0x234d('0xf'));var toCsv=require(_0x234d('0x9'));var querystring=require(_0x234d('0x10'));var Papa=require('papaparse');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('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x234d('0x11'));var config=require(_0x234d('0x12'));var licenseUtil=require(_0x234d('0x13'));var db=require(_0x234d('0x14'))['db'];config[_0x234d('0x15')]=_[_0x234d('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelAccount.socket')['register'](socket);var jayson=require(_0x234d('0x17'));var client=jayson[_0x234d('0x18')][_0x234d('0x19')]({'port':0x232c});var client9002=jayson['client'][_0x234d('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x2094e5,_0x258b13,_0x51de42,_0x52b2a4){return new BPromise(function(_0x5c479e,_0x4c81dc){var _0x4663dd=_0x52b2a4||client;return _0x4663dd[_0x234d('0x1a')](_0x2094e5,_0x51de42)[_0x234d('0x1b')](function(_0x23bace){logger[_0x234d('0x1c')](_0x234d('0x1d'),_0x258b13,_0x234d('0x1e'));logger[_0x234d('0x1f')](_0x234d('0x20'),_0x258b13,_0x234d('0x1e'),JSON[_0x234d('0x21')](_0x23bace));if(_0x23bace[_0x234d('0x22')]){if(_0x23bace[_0x234d('0x22')][_0x234d('0x23')]===0x1f4){logger[_0x234d('0x22')](_0x234d('0x1d'),_0x258b13,_0x23bace[_0x234d('0x22')][_0x234d('0x24')]);return _0x4c81dc(_0x23bace[_0x234d('0x22')][_0x234d('0x24')]);}logger[_0x234d('0x22')](_0x234d('0x1d'),_0x258b13,_0x23bace['error'][_0x234d('0x24')]);return _0x5c479e(_0x23bace[_0x234d('0x22')][_0x234d('0x24')]);}else{logger[_0x234d('0x1c')]('OpenchannelAccount,\x20%s,\x20%s',_0x258b13,_0x234d('0x1e'));_0x5c479e(_0x23bace['result'][_0x234d('0x24')]);}})[_0x234d('0x25')](function(_0x4eca84){logger[_0x234d('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x258b13,_0x4eca84);_0x4c81dc(_0x4eca84);});});}function respondWithStatusCode(_0x272070,_0x5258a5){_0x5258a5=_0x5258a5||0xcc;return function(_0x74f1cc){if(_0x74f1cc){return _0x272070['sendStatus'](_0x5258a5);}return _0x272070[_0x234d('0x26')](_0x5258a5)[_0x234d('0x27')]();};}function respondWithResult(_0x476d8a,_0x1acab8){_0x1acab8=_0x1acab8||0xc8;return function(_0x534c1e){if(_0x534c1e){return _0x476d8a[_0x234d('0x26')](_0x1acab8)['json'](_0x534c1e);}};}function respondWithFilteredResult(_0x45f67a,_0xca80bc){return function(_0x3e98c8){if(_0x3e98c8){var _0x21c662=typeof _0xca80bc['offset']===_0x234d('0x28')&&typeof _0xca80bc[_0x234d('0x29')]===_0x234d('0x28');var _0x86eba0=_0x3e98c8['count'];var _0x2b16d0=_0x21c662?0x0:_0xca80bc[_0x234d('0x2a')];var _0x58634e=_0x21c662?_0x3e98c8['count']:_0xca80bc[_0x234d('0x2a')]+_0xca80bc[_0x234d('0x29')];var _0x434133;if(_0x58634e>=_0x86eba0){_0x58634e=_0x86eba0;_0x434133=0xc8;}else{_0x434133=0xce;}_0x45f67a[_0x234d('0x26')](_0x434133);return _0x45f67a['set'](_0x234d('0x2b'),_0x2b16d0+'-'+_0x58634e+'/'+_0x86eba0)[_0x234d('0x2c')](_0x3e98c8);}return null;};}function patchUpdates(_0x2a7f77){return function(_0x52651a){try{jsonpatch[_0x234d('0x2d')](_0x52651a,_0x2a7f77,!![]);}catch(_0x1b0f34){return BPromise[_0x234d('0x2e')](_0x1b0f34);}return _0x52651a['save']();};}function saveUpdates(_0x2e101b,_0x1830dc){return function(_0x2c4b99){if(_0x2c4b99){return _0x2c4b99['update'](_0x2e101b)['then'](function(_0x2bdc3c){return _0x2bdc3c;});}return null;};}function removeEntity(_0x735da2,_0x352905){return function(_0x3c2da5){if(_0x3c2da5){return _0x3c2da5[_0x234d('0x2f')]()[_0x234d('0x1b')](function(){var _0x4b5c6c=_0x3c2da5[_0x234d('0x30')]({'plain':!![]});var _0x3a522a=_0x234d('0x31');return db[_0x234d('0x32')][_0x234d('0x2f')]({'where':{'type':_0x3a522a,'resourceId':_0x4b5c6c['id']}})[_0x234d('0x1b')](function(){return _0x3c2da5;});})['then'](function(){_0x735da2[_0x234d('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58a400,_0x5884bc){return function(_0x374f85){if(!_0x374f85){_0x58a400['sendStatus'](0x194);}return _0x374f85;};}function handleError(_0x5e4ab7,_0x23bec7){_0x23bec7=_0x23bec7||0x1f4;return function(_0x178e80){logger[_0x234d('0x22')](_0x178e80[_0x234d('0x33')]);if(_0x178e80['name']){delete _0x178e80[_0x234d('0x34')];}_0x5e4ab7['status'](_0x23bec7)['send'](_0x178e80);};}exports[_0x234d('0x35')]=function(_0x7f38d1,_0x1baedf){var _0x5964bc={'include':[{'model':db[_0x234d('0x36')],'as':_0x234d('0x37')}]},_0x241700={},_0x3517e1={'count':0x0,'rows':[]};var _0xae0655=_['map'](db[_0x234d('0x38')][_0x234d('0x39')],function(_0x39244a){return{'name':_0x39244a[_0x234d('0x3a')],'type':_0x39244a['type'][_0x234d('0x3b')]};});_0x241700['model']=_['map'](_0xae0655,_0x234d('0x34'));_0x241700[_0x234d('0x3c')]=_[_0x234d('0x3d')](_0x7f38d1[_0x234d('0x3c')]);_0x241700[_0x234d('0x3e')]=_[_0x234d('0x3f')](_0x241700[_0x234d('0x40')],_0x241700[_0x234d('0x3c')]);_0x5964bc[_0x234d('0x41')]=_[_0x234d('0x3f')](_0x241700[_0x234d('0x40')],qs[_0x234d('0x42')](_0x7f38d1[_0x234d('0x3c')][_0x234d('0x42')]));_0x5964bc[_0x234d('0x41')]=_0x5964bc[_0x234d('0x41')]['length']?_0x5964bc[_0x234d('0x41')]:_0x241700[_0x234d('0x40')];if(!_0x7f38d1['query'][_0x234d('0x43')](_0x234d('0x44'))){_0x5964bc['limit']=qs[_0x234d('0x29')](_0x7f38d1[_0x234d('0x3c')][_0x234d('0x29')]);_0x5964bc['offset']=qs[_0x234d('0x2a')](_0x7f38d1[_0x234d('0x3c')][_0x234d('0x2a')]);}_0x5964bc[_0x234d('0x45')]=qs['sort'](_0x7f38d1[_0x234d('0x3c')][_0x234d('0x46')]);_0x5964bc[_0x234d('0x47')]=qs['filters'](_['pick'](_0x7f38d1['query'],_0x241700[_0x234d('0x3e')]),_0xae0655);if(_0x7f38d1['query'][_0x234d('0x48')]){_0x5964bc[_0x234d('0x47')]=_['merge'](_0x5964bc[_0x234d('0x47')],{'$or':_[_0x234d('0x49')](_0xae0655,function(_0x470838){if(_0x470838['type']!=='VIRTUAL'){var _0x25bc4b={};_0x25bc4b[_0x470838['name']]={'$like':'%'+_0x7f38d1[_0x234d('0x3c')][_0x234d('0x48')]+'%'};return _0x25bc4b;}})});}_0x5964bc=_[_0x234d('0x4a')]({},_0x5964bc,_0x7f38d1['options']);var _0x3478f5={'where':_0x5964bc['where']};return db[_0x234d('0x38')]['count'](_0x3478f5)[_0x234d('0x1b')](function(_0xe20cd){_0x3517e1['count']=_0xe20cd;if(_0x7f38d1[_0x234d('0x3c')][_0x234d('0x4b')]){_0x5964bc[_0x234d('0x4c')]=[{'all':!![]}];}return db[_0x234d('0x38')][_0x234d('0x4d')](_0x5964bc);})['then'](function(_0x534e4e){_0x3517e1['rows']=_0x534e4e;return _0x3517e1;})[_0x234d('0x1b')](respondWithFilteredResult(_0x1baedf,_0x5964bc))[_0x234d('0x25')](handleError(_0x1baedf,null));};exports[_0x234d('0x4e')]=function(_0xeeff7a,_0x5b9efb){var _0x236f03={'raw':![],'where':{'id':_0xeeff7a['params']['id']},'include':[{'model':db['Pause'],'as':_0x234d('0x37')}]},_0x57a1da={};_0x57a1da[_0x234d('0x40')]=_[_0x234d('0x3d')](db[_0x234d('0x38')][_0x234d('0x39')]);_0x57a1da[_0x234d('0x3c')]=_['keys'](_0xeeff7a[_0x234d('0x3c')]);_0x57a1da[_0x234d('0x3e')]=_[_0x234d('0x3f')](_0x57a1da[_0x234d('0x40')],_0x57a1da[_0x234d('0x3c')]);_0x236f03[_0x234d('0x41')]=_['intersection'](_0x57a1da[_0x234d('0x40')],qs[_0x234d('0x42')](_0xeeff7a['query'][_0x234d('0x42')]));_0x236f03['attributes']=_0x236f03['attributes'][_0x234d('0x4f')]?_0x236f03['attributes']:_0x57a1da[_0x234d('0x40')];if(_0xeeff7a[_0x234d('0x3c')][_0x234d('0x4b')]){_0x236f03[_0x234d('0x4c')]=[{'all':!![]}];}_0x236f03=_[_0x234d('0x4a')]({},_0x236f03,_0xeeff7a[_0x234d('0x50')]);return db[_0x234d('0x38')][_0x234d('0x51')](_0x236f03)[_0x234d('0x1b')](handleEntityNotFound(_0x5b9efb,null))[_0x234d('0x1b')](respondWithResult(_0x5b9efb,null))[_0x234d('0x25')](handleError(_0x5b9efb,null));};exports[_0x234d('0x52')]=function(_0x9aa04d,_0x18fa58){return db['OpenchannelAccount'][_0x234d('0x52')](_0x9aa04d[_0x234d('0x53')],{})['then'](function(_0x14fec3){var _0x58812a=_0x9aa04d['user']['get']({'plain':!![]});if(!_0x58812a)throw new Error(_0x234d('0x54'));if(_0x58812a[_0x234d('0x55')]===_0x234d('0x56')){var _0x23b71b=_0x14fec3[_0x234d('0x30')]({'plain':!![]});var _0x9d7c6d=_0x234d('0x31');return db[_0x234d('0x57')][_0x234d('0x51')]({'where':{'name':_0x9d7c6d,'userProfileId':_0x58812a[_0x234d('0x58')]},'raw':!![]})[_0x234d('0x1b')](function(_0x36f492){if(_0x36f492&&_0x36f492[_0x234d('0x59')]===0x0){return db[_0x234d('0x32')][_0x234d('0x52')]({'name':_0x23b71b['name'],'resourceId':_0x23b71b['id'],'type':_0x36f492[_0x234d('0x34')],'sectionId':_0x36f492['id']},{})[_0x234d('0x1b')](function(){return _0x14fec3;});}else{return _0x14fec3;}})[_0x234d('0x25')](function(_0x193f7b){logger[_0x234d('0x22')](_0x234d('0x5a'),_0x193f7b);throw _0x193f7b;});}return _0x14fec3;})['then'](respondWithResult(_0x18fa58,0xc9))[_0x234d('0x25')](handleError(_0x18fa58,null));};exports[_0x234d('0x5b')]=function(_0x5ee941,_0x307a14){if(_0x5ee941[_0x234d('0x53')]['id']){delete _0x5ee941[_0x234d('0x53')]['id'];}return db[_0x234d('0x38')][_0x234d('0x51')]({'where':{'id':_0x5ee941[_0x234d('0x5c')]['id']},'include':[{'model':db[_0x234d('0x36')],'as':_0x234d('0x37')}]})[_0x234d('0x1b')](handleEntityNotFound(_0x307a14,null))[_0x234d('0x1b')](saveUpdates(_0x5ee941['body'],null))[_0x234d('0x1b')](respondWithResult(_0x307a14,null))[_0x234d('0x25')](handleError(_0x307a14,null));};exports[_0x234d('0x2f')]=function(_0x461539,_0x29fd5e){return db[_0x234d('0x38')]['find']({'where':{'id':_0x461539[_0x234d('0x5c')]['id']}})[_0x234d('0x1b')](handleEntityNotFound(_0x29fd5e,null))['then'](removeEntity(_0x29fd5e,null))['catch'](handleError(_0x29fd5e,null));};exports['describe']=function(_0x4cc505,_0x499ee5){return db[_0x234d('0x38')]['describe']()[_0x234d('0x1b')](respondWithResult(_0x499ee5,null))[_0x234d('0x25')](handleError(_0x499ee5,null));};exports[_0x234d('0x5d')]=function(_0x4ef006,_0x32037a,_0x237c62){if(_0x4ef006[_0x234d('0x53')]['id']){delete _0x4ef006[_0x234d('0x53')]['id'];}return db[_0x234d('0x38')][_0x234d('0x51')]({'where':{'id':_0x4ef006['params']['id']}})['then'](handleEntityNotFound(_0x32037a,null))[_0x234d('0x1b')](function(_0x59a8ae){if(_0x59a8ae){_0x4ef006['body'][_0x234d('0x5e')]=_0x59a8ae['id'];return db[_0x234d('0x5f')][_0x234d('0x52')](_0x4ef006[_0x234d('0x53')]);}})[_0x234d('0x1b')](respondWithResult(_0x32037a,null))[_0x234d('0x25')](handleError(_0x32037a,null));};exports['getDispositions']=function(_0x622835,_0x40f77e,_0x33e0f6){var _0x2339f0={'raw':![],'where':{}};var _0xd699c={};var _0x32913c={'count':0x0,'rows':[]};return db[_0x234d('0x38')]['findOne']({'where':{'id':_0x622835[_0x234d('0x5c')]['id']}})[_0x234d('0x1b')](handleEntityNotFound(_0x40f77e,null))['then'](function(_0x2a227f){if(_0x2a227f){_0xd699c[_0x234d('0x40')]=_[_0x234d('0x3d')](db[_0x234d('0x5f')]['rawAttributes']);_0xd699c['query']=_['keys'](_0x622835[_0x234d('0x3c')]);_0xd699c['filters']=_['intersection'](_0xd699c[_0x234d('0x40')],_0xd699c[_0x234d('0x3c')]);_0x2339f0[_0x234d('0x41')]=_[_0x234d('0x3f')](_0xd699c[_0x234d('0x40')],qs[_0x234d('0x42')](_0x622835[_0x234d('0x3c')]['fields']));_0x2339f0[_0x234d('0x41')]=_0x2339f0['attributes']['length']?_0x2339f0[_0x234d('0x41')]:_0xd699c['model'];if(!_0x622835[_0x234d('0x3c')][_0x234d('0x43')]('nolimit')){_0x2339f0[_0x234d('0x29')]=qs[_0x234d('0x29')](_0x622835[_0x234d('0x3c')][_0x234d('0x29')]);_0x2339f0[_0x234d('0x2a')]=qs[_0x234d('0x2a')](_0x622835[_0x234d('0x3c')][_0x234d('0x2a')]);}_0x2339f0[_0x234d('0x45')]=qs[_0x234d('0x46')](_0x622835['query']['sort']);_0x2339f0[_0x234d('0x47')]=qs['filters'](_[_0x234d('0x60')](_0x622835[_0x234d('0x3c')],_0xd699c[_0x234d('0x3e')]));_0x2339f0['where']['OpenchannelAccountId']=_0x2a227f['id'];if(_0x622835[_0x234d('0x3c')][_0x234d('0x48')]){_0x2339f0[_0x234d('0x47')]=_[_0x234d('0x4a')](_0x2339f0['where'],{'$or':_[_0x234d('0x49')](_0x2339f0[_0x234d('0x41')],function(_0x2951b7){var _0x282304={};_0x282304[_0x2951b7]={'$like':'%'+_0x622835[_0x234d('0x3c')][_0x234d('0x48')]+'%'};return _0x282304;})});}_0x2339f0=_[_0x234d('0x4a')]({},_0x2339f0,_0x622835[_0x234d('0x50')]);return db['Disposition'][_0x234d('0x61')]({'where':_0x2339f0['where']})['then'](function(_0x20eed1){_0x32913c[_0x234d('0x61')]=_0x20eed1;if(_0x622835[_0x234d('0x3c')][_0x234d('0x4b')]){_0x2339f0[_0x234d('0x4c')]=[{'all':!![]}];}return db[_0x234d('0x5f')][_0x234d('0x4d')](_0x2339f0);})[_0x234d('0x1b')](function(_0x29707e){_0x32913c[_0x234d('0x62')]=_0x29707e;return _0x32913c;});}})[_0x234d('0x1b')](respondWithFilteredResult(_0x40f77e,_0x2339f0))['catch'](handleError(_0x40f77e,null));};exports[_0x234d('0x63')]=function(_0x5f5732,_0x105cce,_0x53abf3){return db['OpenchannelAccount'][_0x234d('0x51')]({'where':{'id':_0x5f5732[_0x234d('0x5c')]['id']}})[_0x234d('0x1b')](handleEntityNotFound(_0x105cce,null))[_0x234d('0x1b')](function(_0x5f1ab4){if(_0x5f1ab4){return _0x5f1ab4[_0x234d('0x63')](_0x5f5732[_0x234d('0x3c')][_0x234d('0x64')]);}})[_0x234d('0x1b')](respondWithStatusCode(_0x105cce,null))[_0x234d('0x25')](handleError(_0x105cce,null));};exports['addAnswer']=function(_0x4771e9,_0x5b7322,_0x4143f8){if(_0x4771e9[_0x234d('0x53')]['id']){delete _0x4771e9[_0x234d('0x53')]['id'];}return db[_0x234d('0x38')][_0x234d('0x51')]({'where':{'id':_0x4771e9[_0x234d('0x5c')]['id']}})[_0x234d('0x1b')](handleEntityNotFound(_0x5b7322,null))['then'](function(_0x4577a2){if(_0x4577a2){_0x4771e9[_0x234d('0x53')][_0x234d('0x5e')]=_0x4577a2['id'];return db[_0x234d('0x65')][_0x234d('0x52')](_0x4771e9[_0x234d('0x53')]);}})[_0x234d('0x1b')](respondWithResult(_0x5b7322,null))[_0x234d('0x25')](handleError(_0x5b7322,null));};exports['getAnswers']=function(_0x3bfa10,_0x441ecd,_0x1b36ed){var _0x4a6247={'raw':![],'where':{}};var _0x21663f={};var _0x25af94={'count':0x0,'rows':[]};return db[_0x234d('0x38')][_0x234d('0x66')]({'where':{'id':_0x3bfa10['params']['id']}})['then'](handleEntityNotFound(_0x441ecd,null))[_0x234d('0x1b')](function(_0x2f755f){if(_0x2f755f){_0x21663f['model']=_['keys'](db[_0x234d('0x65')]['rawAttributes']);_0x21663f[_0x234d('0x3c')]=_[_0x234d('0x3d')](_0x3bfa10['query']);_0x21663f[_0x234d('0x3e')]=_[_0x234d('0x3f')](_0x21663f[_0x234d('0x40')],_0x21663f[_0x234d('0x3c')]);_0x4a6247[_0x234d('0x41')]=_[_0x234d('0x3f')](_0x21663f[_0x234d('0x40')],qs[_0x234d('0x42')](_0x3bfa10[_0x234d('0x3c')][_0x234d('0x42')]));_0x4a6247[_0x234d('0x41')]=_0x4a6247[_0x234d('0x41')][_0x234d('0x4f')]?_0x4a6247[_0x234d('0x41')]:_0x21663f['model'];if(!_0x3bfa10['query'][_0x234d('0x43')](_0x234d('0x44'))){_0x4a6247[_0x234d('0x29')]=qs[_0x234d('0x29')](_0x3bfa10[_0x234d('0x3c')][_0x234d('0x29')]);_0x4a6247[_0x234d('0x2a')]=qs['offset'](_0x3bfa10[_0x234d('0x3c')][_0x234d('0x2a')]);}_0x4a6247[_0x234d('0x45')]=qs[_0x234d('0x46')](_0x3bfa10[_0x234d('0x3c')][_0x234d('0x46')]);_0x4a6247[_0x234d('0x47')]=qs[_0x234d('0x3e')](_['pick'](_0x3bfa10[_0x234d('0x3c')],_0x21663f['filters']));_0x4a6247[_0x234d('0x47')][_0x234d('0x5e')]=_0x2f755f['id'];if(_0x3bfa10[_0x234d('0x3c')][_0x234d('0x48')]){_0x4a6247['where']=_[_0x234d('0x4a')](_0x4a6247[_0x234d('0x47')],{'$or':_[_0x234d('0x49')](_0x4a6247[_0x234d('0x41')],function(_0x3940b3){var _0x136bc6={};_0x136bc6[_0x3940b3]={'$like':'%'+_0x3bfa10[_0x234d('0x3c')][_0x234d('0x48')]+'%'};return _0x136bc6;})});}_0x4a6247=_[_0x234d('0x4a')]({},_0x4a6247,_0x3bfa10[_0x234d('0x50')]);return db[_0x234d('0x65')][_0x234d('0x61')]({'where':_0x4a6247[_0x234d('0x47')]})[_0x234d('0x1b')](function(_0x5e5dc2){_0x25af94['count']=_0x5e5dc2;if(_0x3bfa10[_0x234d('0x3c')][_0x234d('0x4b')]){_0x4a6247[_0x234d('0x4c')]=[{'all':!![]}];}return db[_0x234d('0x65')][_0x234d('0x4d')](_0x4a6247);})[_0x234d('0x1b')](function(_0x12352d){_0x25af94[_0x234d('0x62')]=_0x12352d;return _0x25af94;});}})[_0x234d('0x1b')](respondWithFilteredResult(_0x441ecd,_0x4a6247))[_0x234d('0x25')](handleError(_0x441ecd,null));};exports[_0x234d('0x67')]=function(_0x2a7fb2,_0x5755fb,_0x38beca){return db[_0x234d('0x38')][_0x234d('0x51')]({'where':{'id':_0x2a7fb2['params']['id']}})['then'](handleEntityNotFound(_0x5755fb,null))[_0x234d('0x1b')](function(_0x38eb07){if(_0x38eb07){return _0x38eb07[_0x234d('0x67')](_0x2a7fb2[_0x234d('0x3c')][_0x234d('0x64')]);}})['then'](respondWithStatusCode(_0x5755fb,null))[_0x234d('0x25')](handleError(_0x5755fb,null));};exports['notify']=function(_0x3ce852,_0x3f62ba,_0x5bebd9){var _0x1fad8e={'body':_0x3ce852[_0x234d('0x53')],'channel':'openchannel'};var _0x4f5fe6=[];var _0x4bece3=[];var _0x5a0290={};var _0x4bc6bd=![];return db['CmContact'][_0x234d('0x68')]()[_0x234d('0x1b')](function(_0x34273e){if(!_0x34273e){throw new db[(_0x234d('0x69'))][(_0x234d('0x6a'))](_0x234d('0x6b'));}_0x4f5fe6=_[_0x234d('0x6c')](_[_0x234d('0x3d')](_0x34273e),[_0x234d('0x6d'),_0x234d('0x6e')]);_0x4bece3=_[_0x234d('0x6c')](_[_0x234d('0x3d')](_0x34273e),[_0x234d('0x6d'),_0x234d('0x6e'),'CompanyId',_0x234d('0x6f')]);if(_0x3ce852[_0x234d('0x53')]['id']){delete _0x3ce852[_0x234d('0x53')]['id'];}if(_[_0x234d('0x70')](_0x3ce852[_0x234d('0x53')]['from'])){throw new db[(_0x234d('0x69'))][(_0x234d('0x6a'))]('from\x20is\x20mandatory');}if(_[_0x234d('0x70')](_0x3ce852[_0x234d('0x53')][_0x234d('0x53')])||_0x3ce852[_0x234d('0x53')][_0x234d('0x53')]===''){throw new db[(_0x234d('0x69'))][(_0x234d('0x6a'))](_0x234d('0x71'));}if(_['isNil'](_0x3ce852[_0x234d('0x53')][_0x234d('0x72')])){throw new db[(_0x234d('0x69'))][(_0x234d('0x6a'))](_0x234d('0x73')+_0x4bece3);}if(!_['includes'](_0x4bece3,_0x3ce852['body'][_0x234d('0x72')])){throw new db[(_0x234d('0x69'))][(_0x234d('0x6a'))](_0x234d('0x74')+_0x4bece3);}_0x5a0290[_0x3ce852[_0x234d('0x53')]['mapKey']]=_0x3ce852[_0x234d('0x53')][_0x234d('0x75')];})['then'](function(){return db[_0x234d('0x38')][_0x234d('0x51')]({'where':{'id':_0x3ce852['params']['id']},'include':[{'model':db[_0x234d('0x76')],'as':_0x234d('0x77'),'include':[{'model':db[_0x234d('0x78')],'as':_0x234d('0x79'),'where':_0x5a0290,'limit':0x1,'order':[['updatedAt',_0x234d('0x7a')]]}]},{'model':db[_0x234d('0x7b')],'as':_0x234d('0x7c')}]});})[_0x234d('0x1b')](handleEntityNotFound(_0x3f62ba,null))[_0x234d('0x1b')](function(_0x4a3f6b){if(_0x4a3f6b&&_0x4a3f6b['List']){_0x1fad8e['account']=_0x4a3f6b;_0x1fad8e[_0x234d('0x7d')]=_0x4a3f6b['Applications'];_0x1fad8e[_0x234d('0x7e')]=_0x4a3f6b[_0x234d('0x77')];_0x1fad8e[_0x234d('0x7d')]=_[_0x234d('0x7f')](_0x1fad8e[_0x234d('0x7d')],['priority'],['asc']);if(_0x1fad8e[_0x234d('0x80')][_0x234d('0x7c')]){delete _0x1fad8e[_0x234d('0x80')]['Applications'];}if(_0x1fad8e[_0x234d('0x80')][_0x234d('0x77')]&&_0x1fad8e[_0x234d('0x80')][_0x234d('0x77')][_0x234d('0x79')]['length']){return _0x1fad8e[_0x234d('0x80')][_0x234d('0x77')][_0x234d('0x79')][0x0];}var _0x6339d5=_['defaults'](_0x3ce852[_0x234d('0x53')],{'firstName':_0x3ce852[_0x234d('0x53')][_0x234d('0x75')],'ListId':_0x4a3f6b[_0x234d('0x6f')]});_0x6339d5[_0x3ce852['body'][_0x234d('0x72')]]=_0x3ce852[_0x234d('0x53')][_0x234d('0x75')];return db[_0x234d('0x78')][_0x234d('0x52')](_0x6339d5,{'fields':_0x4f5fe6,'raw':!![]});}})['then'](handleEntityNotFound(_0x3f62ba,null))['then'](function(_0x47e012){_0x1fad8e['contact']=_0x47e012;if(_0x47e012){var _0x2acb62={'ContactId':_0x47e012['id'],'OpenchannelAccountId':_0x3ce852[_0x234d('0x5c')]['id'],'from':(_0x47e012['firstName']||'')+'\x20'+(_0x47e012['lastName']||'')};var _0x549826={'OpenchannelAccountId':_0x3ce852[_0x234d('0x5c')]['id'],'closed':![]};if(_0x3ce852[_0x234d('0x53')][_0x234d('0x81')]){_0x549826[_0x234d('0x81')]=_0x3ce852['body'][_0x234d('0x81')];return db[_0x234d('0x82')][_0x234d('0x51')]({'where':_0x549826})['then'](function(_0x2eaa97){if(_0x2eaa97){return[_0x2eaa97,![]];}_0x2acb62[_0x234d('0x81')]=_0x3ce852[_0x234d('0x53')][_0x234d('0x81')];_0x2acb62['externalUrl']=_0x3ce852[_0x234d('0x53')][_0x234d('0x83')];return db['OpenchannelInteraction'][_0x234d('0x52')](_0x2acb62)[_0x234d('0x1b')](function(_0x58aa1a){return[_0x58aa1a,!![]];});});}else{_0x549826['threadId']=null;}_0x549826[_0x234d('0x84')]=_0x47e012['id'];return db[_0x234d('0x82')][_0x234d('0x51')]({'where':_0x549826})['then'](function(_0x43c4b1){if(_0x43c4b1){return[_0x43c4b1,![]];}return db[_0x234d('0x82')][_0x234d('0x52')](_0x2acb62)[_0x234d('0x1b')](function(_0x2c1fd1){return[_0x2c1fd1,!![]];});});}})[_0x234d('0x85')](function(_0x50ed87,_0x2fe90e){if(_0x50ed87){_0x4bc6bd=_0x2fe90e;if(!_0x2fe90e){var _0x46f70a={'from':(_0x1fad8e['contact'][_0x234d('0x86')]||'')+'\x20'+(_0x1fad8e[_0x234d('0x87')][_0x234d('0x88')]||'')};if(_0x3ce852[_0x234d('0x53')]['threadId']&&_0x3ce852['body']['messageId']&&_0x3ce852[_0x234d('0x53')]['threadId']!=_0x3ce852[_0x234d('0x53')][_0x234d('0x89')]){_0x46f70a[_0x234d('0x81')]=_0x3ce852['body']['messageId'];}return _0x50ed87[_0x234d('0x5b')](_0x46f70a);}else{return _0x50ed87;}}})[_0x234d('0x1b')](function(_0x4eeca5){_0x1fad8e[_0x234d('0x8a')]=_0x4eeca5[_0x234d('0x30')]({'plain':!![]});_0x1fad8e[_0x234d('0x8a')][_0x234d('0x8b')]=_0x4bc6bd;if(_0x1fad8e[_0x234d('0x8a')][_0x234d('0x8b')]){if(_0x1fad8e[_0x234d('0x80')][_0x234d('0x8c')]){_0x1fad8e[_0x234d('0x7d')]['push']({'id':0x0,'priority':_0x1fad8e[_0x234d('0x7d')][_0x234d('0x4f')]+0x1,'app':_0x234d('0x8d'),'appdata':_0x234d('0x8e'),'interval':_0x234d('0x8f')});}}return db['OpenchannelMessage'][_0x234d('0x52')]({'body':_0x3ce852[_0x234d('0x53')][_0x234d('0x53')],'OpenchannelAccountId':_0x3ce852['params']['id'],'OpenchannelInteractionId':_0x4eeca5['id'],'direction':'in','ContactId':_0x1fad8e['contact']['id'],'AttachmentId':_0x3ce852[_0x234d('0x53')][_0x234d('0x90')]});})[_0x234d('0x1b')](function(_0x2ef89b){_0x1fad8e[_0x234d('0x24')]=_0x2ef89b;if(_0x1fad8e['interaction']['UserId']){return db[_0x234d('0x91')]['find']({'attributes':['id',_0x234d('0x34')],'where':{'id':_0x1fad8e[_0x234d('0x8a')][_0x234d('0x92')]}})[_0x234d('0x1b')](function(_0x497a9e){if(_0x497a9e){_0x1fad8e[_0x234d('0x7d')]['unshift']({'id':0x0,'priority':0x0,'app':_0x234d('0x93'),'appdata':_0x497a9e[_0x234d('0x34')]+','+(_0x1fad8e[_0x234d('0x80')][_0x234d('0x94')]||0xa),'interval':_0x234d('0x8f')});_0x1fad8e[_0x234d('0x95')]=![];}return respondWithRpcPromise(_0x234d('0x96'),_0x234d('0x97'),_0x1fad8e);});}return respondWithRpcPromise(_0x234d('0x96'),'startRouting',_0x1fad8e);})['then'](function(_0x28ad84){respondWithRpcPromise(_0x234d('0x98'),_0x234d('0x98'),{'event':_0x234d('0x99'),'message':_0x28ad84},client9002);return _0x28ad84;})[_0x234d('0x1b')](respondWithResult(_0x3f62ba,null))[_0x234d('0x25')](handleError(_0x3f62ba,null));};exports[_0x234d('0x9a')]=function(_0x4e5f2b,_0x28a312){var _0x1e388e=_0x4e5f2b[_0x234d('0x5c')]['id'];var _0xa83b89=_0x4e5f2b[_0x234d('0x53')];var _0x46136d=0xc8;var _0x148f72=null;return db[_0x234d('0x9b')][_0x234d('0x9c')]({'isolationLevel':db['sequelize']['Transaction'][_0x234d('0x9d')][_0x234d('0x9e')]},function(_0x1eb715){return db[_0x234d('0x38')][_0x234d('0x66')]({'where':{'id':_0x1e388e},'transaction':_0x1eb715})[_0x234d('0x1b')](function(_0x1dcdd4){if(_0x1dcdd4){return db[_0x234d('0x7b')][_0x234d('0x2f')]({'where':{'OpenchannelAccountId':_0x1e388e},'transaction':_0x1eb715})['then'](function(){var _0x2c07ab=_[_0x234d('0x49')](_0xa83b89,function(_0xcbe94b){_0xcbe94b['OpenchannelAccountId']=_0x1e388e;return _0xcbe94b;});return db[_0x234d('0x7b')][_0x234d('0x9f')](_0x2c07ab,{'transaction':_0x1eb715});});}else{_0x46136d=0x194;_0x148f72=[];}});})['then'](function(){if(_0x46136d!==0x194){return db[_0x234d('0x7b')][_0x234d('0xa0')]({'where':{'OpenchannelAccountId':_0x1e388e},'order':_0x234d('0xa1')})[_0x234d('0x1b')](function(_0x28080b){_0x148f72=_0x28080b;});}})['catch'](function(_0x1cc366){_0x46136d=0x1f4;logger[_0x234d('0x22')](_0x1cc366[_0x234d('0x33')]);if(_0x1cc366[_0x234d('0x34')]){delete _0x1cc366[_0x234d('0x34')];}_0x148f72=_0x1cc366;})[_0x234d('0xa2')](function(){if(_0x148f72===null){_0x28a312[_0x234d('0xa3')](_0x46136d);}else{if(_0x46136d===0x1f4){_0x28a312['status'](_0x46136d)[_0x234d('0xa4')](_0x148f72);}else{_0x28a312['status'](_0x46136d)[_0x234d('0x2c')](_0x148f72);}}});};exports['getApplications']=function(_0x4f7b52,_0x4e52e4,_0x521059){var _0x13a530={};var _0x18718c={};var _0x108c1f;var _0x190137;return db[_0x234d('0x38')][_0x234d('0x66')]({'where':{'id':_0x4f7b52[_0x234d('0x5c')]['id']}})[_0x234d('0x1b')](handleEntityNotFound(_0x4e52e4,null))[_0x234d('0x1b')](function(_0x1673b9){if(_0x1673b9){_0x108c1f=_0x1673b9;_0x18718c[_0x234d('0x40')]=_[_0x234d('0x3d')](db[_0x234d('0x7b')][_0x234d('0x39')]);_0x18718c[_0x234d('0x3c')]=_[_0x234d('0x3d')](_0x4f7b52[_0x234d('0x3c')]);_0x18718c[_0x234d('0x3e')]=_[_0x234d('0x3f')](_0x18718c[_0x234d('0x40')],_0x18718c[_0x234d('0x3c')]);_0x13a530['attributes']=_[_0x234d('0x3f')](_0x18718c[_0x234d('0x40')],qs[_0x234d('0x42')](_0x4f7b52[_0x234d('0x3c')][_0x234d('0x42')]));_0x13a530['attributes']=_0x13a530[_0x234d('0x41')][_0x234d('0x4f')]?_0x13a530[_0x234d('0x41')]:_0x18718c[_0x234d('0x40')];_0x13a530[_0x234d('0x45')]=qs['sort'](_0x4f7b52[_0x234d('0x3c')][_0x234d('0x46')]);_0x13a530[_0x234d('0x47')]=qs[_0x234d('0x3e')](_[_0x234d('0x60')](_0x4f7b52['query'],_0x18718c[_0x234d('0x3e')]));if(_0x4f7b52[_0x234d('0x3c')][_0x234d('0x48')]){_0x13a530['where']=_[_0x234d('0x4a')](_0x13a530[_0x234d('0x47')],{'$or':_[_0x234d('0x49')](_0x13a530[_0x234d('0x41')],function(_0x23714f){var _0x9ca9d8={};_0x9ca9d8[_0x23714f]={'$like':'%'+_0x4f7b52['query'][_0x234d('0x48')]+'%'};return _0x9ca9d8;})});}_0x13a530=_['merge']({},_0x13a530,_0x4f7b52[_0x234d('0x50')]);return _0x108c1f[_0x234d('0xa5')](_0x13a530);}})[_0x234d('0x1b')](function(_0x2f4fb5){if(_0x2f4fb5){_0x190137=_0x2f4fb5['length'];if(!_0x4f7b52[_0x234d('0x3c')]['hasOwnProperty'](_0x234d('0x44'))){_0x13a530[_0x234d('0x29')]=qs[_0x234d('0x29')](_0x4f7b52['query'][_0x234d('0x29')]);_0x13a530[_0x234d('0x2a')]=qs['offset'](_0x4f7b52['query'][_0x234d('0x2a')]);}return _0x108c1f['getApplications'](_0x13a530);}})[_0x234d('0x1b')](function(_0x3b99b9){if(_0x3b99b9){return _0x3b99b9?{'count':_0x190137,'rows':_0x3b99b9}:null;}})['then'](respondWithResult(_0x4e52e4,null))['catch'](handleError(_0x4e52e4,null));};exports[_0x234d('0xa6')]=function(_0x553647,_0x20c4d6,_0x3a6479){var _0xfeee89={'raw':![],'where':{}};var _0x54cecd={};var _0x47c119={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x234d('0x66')]({'where':{'id':_0x553647[_0x234d('0x5c')]['id']}})['then'](handleEntityNotFound(_0x20c4d6,null))[_0x234d('0x1b')](function(_0xd82606){if(_0xd82606){_0x54cecd[_0x234d('0x40')]=_[_0x234d('0x3d')](db['OpenchannelInteraction'][_0x234d('0x39')]);_0x54cecd[_0x234d('0x3c')]=_[_0x234d('0x3d')](_0x553647['query']);_0x54cecd[_0x234d('0x3e')]=_[_0x234d('0x3f')](_0x54cecd['model'],_0x54cecd[_0x234d('0x3c')]);_0xfeee89[_0x234d('0x41')]=_[_0x234d('0x3f')](_0x54cecd[_0x234d('0x40')],qs[_0x234d('0x42')](_0x553647[_0x234d('0x3c')][_0x234d('0x42')]));_0xfeee89['attributes']=_0xfeee89['attributes'][_0x234d('0x4f')]?_0xfeee89[_0x234d('0x41')]:_0x54cecd[_0x234d('0x40')];if(!_0x553647['query']['hasOwnProperty'](_0x234d('0x44'))){_0xfeee89[_0x234d('0x29')]=qs['limit'](_0x553647[_0x234d('0x3c')][_0x234d('0x29')]);_0xfeee89[_0x234d('0x2a')]=qs[_0x234d('0x2a')](_0x553647[_0x234d('0x3c')][_0x234d('0x2a')]);}_0xfeee89[_0x234d('0x45')]=qs['sort'](_0x553647[_0x234d('0x3c')][_0x234d('0x46')]);_0xfeee89[_0x234d('0x47')]=qs['filters'](_[_0x234d('0x60')](_0x553647[_0x234d('0x3c')],_0x54cecd[_0x234d('0x3e')]));_0xfeee89[_0x234d('0x47')][_0x234d('0x5e')]=_0xd82606['id'];if(_0x553647[_0x234d('0x3c')][_0x234d('0x48')]){_0xfeee89[_0x234d('0x47')]=_['merge'](_0xfeee89['where'],{'$or':_[_0x234d('0x49')](_0xfeee89['attributes'],function(_0x1a644f){var _0x577d42={};_0x577d42[_0x1a644f]={'$like':'%'+_0x553647[_0x234d('0x3c')]['filter']+'%'};return _0x577d42;})});}_0xfeee89=_[_0x234d('0x4a')]({},_0xfeee89,_0x553647[_0x234d('0x50')]);return db[_0x234d('0x82')][_0x234d('0x61')]({'where':_0xfeee89[_0x234d('0x47')]})[_0x234d('0x1b')](function(_0x134d09){_0x47c119[_0x234d('0x61')]=_0x134d09;if(_0x553647['query']['includeAll']){_0xfeee89[_0x234d('0x4c')]=[{'model':db[_0x234d('0x78')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x234d('0xa7'),'attributes':[_0x234d('0x34'),_0x234d('0xa8'),_0x234d('0xa9')],'required':![]},{'model':db[_0x234d('0xaa')],'as':'Tags','attributes':['id',_0x234d('0x34'),_0x234d('0xab')],'where':_0x553647[_0x234d('0x3c')][_0x234d('0xac')]?{'id':_0x553647[_0x234d('0x3c')]['tag']}:undefined,'required':_0x553647[_0x234d('0x3c')][_0x234d('0xac')]?!![]:![]}];}return db[_0x234d('0x82')]['findAll'](_0xfeee89);})[_0x234d('0x1b')](function(_0x99dcc4){_0x47c119[_0x234d('0x62')]=_0x99dcc4;return _0x47c119;});}})[_0x234d('0x1b')](respondWithFilteredResult(_0x20c4d6,_0xfeee89))[_0x234d('0x25')](handleError(_0x20c4d6,null));};exports[_0x234d('0xad')]=function(_0x2263c9,_0x327796,_0x52ee54){return db[_0x234d('0x38')][_0x234d('0x51')]({'where':{'id':_0x2263c9[_0x234d('0x5c')]['id']}})[_0x234d('0x1b')](handleEntityNotFound(_0x327796,null))[_0x234d('0x1b')](function(_0x5172bb){if(_0x5172bb){return _0x5172bb[_0x234d('0xad')](_0x2263c9['body']['ids'],_[_0x234d('0xae')](_0x2263c9[_0x234d('0x53')],[_0x234d('0x64'),'id'])||{})[_0x234d('0x85')](function(_0x32a0cd){for(var _0x1f835c=0x0;_0x1f835c<_0x2263c9[_0x234d('0x53')][_0x234d('0x64')]['length'];_0x1f835c+=0x1){socket[_0x234d('0xaf')](_0x234d('0xb0'),{'UserId':Number(_0x2263c9[_0x234d('0x53')]['ids'][_0x1f835c]),'OpenchannelAccountId':Number(_0x2263c9[_0x234d('0x5c')]['id'])});}return _0x32a0cd;});}})[_0x234d('0x1b')](respondWithResult(_0x327796,null))[_0x234d('0x25')](handleError(_0x327796,null));};exports[_0x234d('0xb1')]=function(_0x2520b9,_0x33dbbf,_0xeb7bfb){return db[_0x234d('0x38')][_0x234d('0x51')]({'where':{'id':_0x2520b9[_0x234d('0x5c')]['id']}})[_0x234d('0x1b')](handleEntityNotFound(_0x33dbbf,null))['then'](function(_0x357f6d){if(_0x357f6d){return _0x357f6d['removeAgents'](_0x2520b9[_0x234d('0x3c')]['ids'])[_0x234d('0x1b')](function(){if(_['isArray'](_0x2520b9[_0x234d('0x3c')][_0x234d('0x64')])){for(var _0x192a6a=0x0;_0x192a6a<_0x2520b9[_0x234d('0x3c')][_0x234d('0x64')][_0x234d('0x4f')];_0x192a6a+=0x1){socket[_0x234d('0xaf')]('userOpenchannelAccount:remove',{'UserId':Number(_0x2520b9[_0x234d('0x3c')]['ids'][_0x192a6a]),'OpenchannelAccountId':Number(_0x2520b9[_0x234d('0x5c')]['id'])});}}else{socket[_0x234d('0xaf')]('userOpenchannelAccount:remove',{'UserId':Number(_0x2520b9[_0x234d('0x3c')][_0x234d('0x64')]),'OpenchannelAccountId':Number(_0x2520b9[_0x234d('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x33dbbf,null))['catch'](handleError(_0x33dbbf,null));};exports[_0x234d('0xb2')]=function(_0x588a51,_0x4bb254,_0x4bf467){var _0x4ddaf6={};var _0x5914fb={};var _0xfa524;var _0x285562;return db[_0x234d('0x38')]['findOne']({'where':{'id':_0x588a51[_0x234d('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4bb254,null))[_0x234d('0x1b')](function(_0x407aa3){if(_0x407aa3){_0xfa524=_0x407aa3;_0x5914fb[_0x234d('0x40')]=_[_0x234d('0x3d')](db[_0x234d('0x91')]['rawAttributes']);_0x5914fb['query']=_[_0x234d('0x3d')](_0x588a51[_0x234d('0x3c')]);_0x5914fb[_0x234d('0x3e')]=_[_0x234d('0x3f')](_0x5914fb[_0x234d('0x40')],_0x5914fb[_0x234d('0x3c')]);_0x4ddaf6[_0x234d('0x41')]=_[_0x234d('0x3f')](_0x5914fb['model'],qs[_0x234d('0x42')](_0x588a51['query'][_0x234d('0x42')]));_0x4ddaf6[_0x234d('0x41')]=_0x4ddaf6['attributes']['length']?_0x4ddaf6[_0x234d('0x41')]:_0x5914fb[_0x234d('0x40')];_0x4ddaf6[_0x234d('0x45')]=qs[_0x234d('0x46')](_0x588a51[_0x234d('0x3c')][_0x234d('0x46')]);_0x4ddaf6[_0x234d('0x47')]=qs[_0x234d('0x3e')](_[_0x234d('0x60')](_0x588a51[_0x234d('0x3c')],_0x5914fb[_0x234d('0x3e')]));if(_0x588a51[_0x234d('0x3c')][_0x234d('0x48')]){_0x4ddaf6['where']=_[_0x234d('0x4a')](_0x4ddaf6[_0x234d('0x47')],{'$or':_[_0x234d('0x49')](_0x4ddaf6[_0x234d('0x41')],function(_0x22385a){var _0x5c395f={};_0x5c395f[_0x22385a]={'$like':'%'+_0x588a51[_0x234d('0x3c')][_0x234d('0x48')]+'%'};return _0x5c395f;})});}_0x4ddaf6=_[_0x234d('0x4a')]({},_0x4ddaf6,_0x588a51[_0x234d('0x50')]);return _0xfa524[_0x234d('0xb2')](_0x4ddaf6);}})[_0x234d('0x1b')](function(_0x4a36f0){if(_0x4a36f0){_0x285562=_0x4a36f0[_0x234d('0x4f')];if(!_0x588a51[_0x234d('0x3c')][_0x234d('0x43')](_0x234d('0x44'))){_0x4ddaf6[_0x234d('0x29')]=qs[_0x234d('0x29')](_0x588a51[_0x234d('0x3c')][_0x234d('0x29')]);_0x4ddaf6[_0x234d('0x2a')]=qs[_0x234d('0x2a')](_0x588a51[_0x234d('0x3c')][_0x234d('0x2a')]);}return _0xfa524[_0x234d('0xb2')](_0x4ddaf6);}})[_0x234d('0x1b')](function(_0x22266e){if(_0x22266e){return _0x22266e?{'count':_0x285562,'rows':_0x22266e}:null;}})['then'](respondWithResult(_0x4bb254,null))[_0x234d('0x25')](handleError(_0x4bb254,null));};exports[_0x234d('0xa4')]=function(_0x387d57,_0xc9a34c,_0x32cd93){var _0x1ea418,_0x2dcb9c,_0x39b397;if(_['isNil'](_0x387d57[_0x234d('0x53')][_0x234d('0x53')])||_0x387d57[_0x234d('0x53')]['body']===''){throw new db[(_0x234d('0x69'))][(_0x234d('0x6a'))](_0x234d('0x71'));}if(_[_0x234d('0x70')](_0x387d57[_0x234d('0x53')]['to'])){}_0x1ea418=_0x387d57[_0x234d('0x53')]['to'];return db[_0x234d('0x38')][_0x234d('0x66')]({'where':{'id':_0x387d57[_0x234d('0x5c')]['id']}})[_0x234d('0x1b')](handleEntityNotFound(_0xc9a34c,null))[_0x234d('0x1b')](function(_0x4a90ba){if(_0x4a90ba){return db[_0x234d('0x38')][_0x234d('0x51')]({'where':{'id':_0x4a90ba['id']},'include':[{'model':db[_0x234d('0x76')],'as':_0x234d('0x77'),'include':[{'model':db[_0x234d('0x78')],'as':'Contacts','where':{[_0x4a90ba[_0x234d('0x72')]]:_0x1ea418},'limit':0x1,'order':[[_0x234d('0x6e'),_0x234d('0x7a')]]}]}]})[_0x234d('0x1b')](handleEntityNotFound(_0xc9a34c,null))[_0x234d('0x1b')](function(_0x2340bc){if(_0x2340bc&&_0x2340bc[_0x234d('0x77')]){_0x2dcb9c=_0x2340bc[_0x234d('0x30')]({'plain':!![]});if(_0x2dcb9c[_0x234d('0x77')]&&_0x2dcb9c[_0x234d('0x77')][_0x234d('0x79')]['length']){return _0x2dcb9c[_0x234d('0x77')][_0x234d('0x79')][0x0];}return db['CmContact'][_0x234d('0x52')](_[_0x234d('0x16')](_0x387d57[_0x234d('0x53')],{'firstName':_0x1ea418,[_0x2340bc[_0x234d('0x72')]]:_0x1ea418,'phone':_0x1ea418,'ListId':_0x2dcb9c[_0x234d('0x6f')]}));}})['then'](handleEntityNotFound(_0xc9a34c,null))[_0x234d('0x1b')](function(_0x4d7ac6){if(_0x4d7ac6){_0x39b397=_0x4d7ac6;return db[_0x234d('0x82')][_0x234d('0x51')]({'where':{'ContactId':_0x39b397['id'],'closed':![],'OpenchannelAccountId':_0x2dcb9c['id']}})[_0x234d('0x1b')](function(_0x22fd90){if(_0x22fd90){return[_0x22fd90,![]];}return db[_0x234d('0x82')][_0x234d('0x52')]({'UserId':_0x387d57['user']['id'],'ContactId':_0x39b397['id'],'OpenchannelAccountId':_0x2dcb9c['id'],'lastMsgDirection':_0x234d('0xb3'),'firstMsgDirection':_0x234d('0xb3'),'Messages':[_[_0x234d('0x4a')](_0x387d57['body'],{'read':![],'body':_0x387d57['body'][_0x234d('0x53')],'OpenchannelAccountId':_0x2dcb9c['id'],'UserId':_0x387d57[_0x234d('0x56')]['id'],'ContactId':_0x39b397['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x234d('0xb4')}]})[_0x234d('0x1b')](function(_0x6173e9){return[_0x6173e9,!![]];});});}})['spread'](function(_0x359070,_0xbdb13f){if(_0xbdb13f){return _0x359070;}return db[_0x234d('0xb5')]['create'](_['merge'](_0x387d57[_0x234d('0x53')],{'read':![],'body':_0x387d57['body']['body'],'OpenchannelAccountId':_0x2dcb9c['id'],'OpenchannelInteractionId':_0x359070['id'],'UserId':_0x387d57['user']['id'],'ContactId':_0x39b397['id']}))[_0x234d('0x1b')](function(_0x3cb27e){_0x359070['dataValues'][_0x234d('0xb4')]=[];_0x359070['dataValues']['Messages'][_0x234d('0xb6')](_0x3cb27e[_0x234d('0xb7')]);return _0x359070;});});}})[_0x234d('0x1b')](respondWithResult(_0xc9a34c,null))[_0x234d('0x25')](handleError(_0xc9a34c,null));};
\ No newline at end of file
index a0ee46f..d2d4fbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1be1=['OpenchannelAccount','setMaxListeners','update','remove','emit','hook'];(function(_0x118627,_0x4d515b){var _0x5264c3=function(_0xa4aee5){while(--_0xa4aee5){_0x118627['push'](_0x118627['shift']());}};_0x5264c3(++_0x4d515b);}(_0x1be1,0x192));var _0x11be=function(_0x3f1e10,_0x189bd6){_0x3f1e10=_0x3f1e10-0x0;var _0x495d54=_0x1be1[_0x3f1e10];return _0x495d54;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x11be('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x11be('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x11be('0x2'),'afterDestroy':_0x11be('0x3')};function emitEvent(_0x200b2a){return function(_0x318d41,_0x504d3a,_0x3ce56d){OpenchannelAccountEvents[_0x11be('0x4')](_0x200b2a+':'+_0x318d41['id'],_0x318d41);OpenchannelAccountEvents[_0x11be('0x4')](_0x200b2a,_0x318d41);_0x3ce56d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x11be('0x5')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents;
\ No newline at end of file
+var _0x6f0d=['remove','emit','hook','exports','../../mysqldb','OpenchannelAccount','setMaxListeners','save'];(function(_0x122492,_0x1b7d55){var _0x18ed1b=function(_0x4a9db2){while(--_0x4a9db2){_0x122492['push'](_0x122492['shift']());}};_0x18ed1b(++_0x1b7d55);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x17a801,_0x320526){_0x17a801=_0x17a801-0x0;var _0x5220e3=_0x6f0d[_0x17a801];return _0x5220e3;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xd6f0('0x0'))['db'][_0xd6f0('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xd6f0('0x2')](0x0);var events={'afterCreate':_0xd6f0('0x3'),'afterUpdate':'update','afterDestroy':_0xd6f0('0x4')};function emitEvent(_0x135a93){return function(_0x2f78fb,_0x25344b,_0x3a757f){OpenchannelAccountEvents['emit'](_0x135a93+':'+_0x2f78fb['id'],_0x2f78fb);OpenchannelAccountEvents[_0xd6f0('0x5')](_0x135a93,_0x2f78fb);_0x3a757f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xd6f0('0x6')](e,emitEvent(event));}}module[_0xd6f0('0x7')]=OpenchannelAccountEvents;
\ No newline at end of file
index e325db4..2a898e1 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(_0x509457,_0x2b9dbd){var _0x1441c1=function(_0x1d51e9){while(--_0x1d51e9){_0x509457['push'](_0x509457['shift']());}};_0x1441c1(++_0x2b9dbd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0xeac8ab,_0x24acf5){var _0x5ec331=function(_0x4ee58b){while(--_0x4ee58b){_0xeac8ab['push'](_0xeac8ab['shift']());}};_0x5ec331(++_0x24acf5);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cea28a8..80ea3a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x351d=['rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','request','then','info','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x534e2b,_0x407c68){var _0x461599=function(_0x30875d){while(--_0x30875d){_0x534e2b['push'](_0x534e2b['shift']());}};_0x461599(++_0x407c68);}(_0x351d,0x90));var _0xd351=function(_0x445b22,_0x1fe88a){_0x445b22=_0x445b22-0x0;var _0x38f68f=_0x351d[_0x445b22];return _0x38f68f;};'use strict';var _=require(_0xd351('0x0'));var util=require('util');var moment=require(_0xd351('0x1'));var BPromise=require(_0xd351('0x2'));var rs=require(_0xd351('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd351('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd351('0x5'))(_0xd351('0x6'));var config=require('../../config/environment');var jayson=require(_0xd351('0x7'));var client=jayson[_0xd351('0x8')][_0xd351('0x9')]({'port':0x232a});config['redis']=_[_0xd351('0xa')](config[_0xd351('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd351('0xc'))(new Redis(config[_0xd351('0xb')]));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x44bf81,_0x4904b4,_0x34cfc7){return new BPromise(function(_0x39b8c8,_0x5949a4){return client[_0xd351('0xd')](_0x44bf81,_0x34cfc7)[_0xd351('0xe')](function(_0x4ebca1){logger[_0xd351('0xf')]('OpenchannelAccount,\x20%s,\x20%s',_0x4904b4,'request\x20sent');logger[_0xd351('0x10')](_0xd351('0x11'),_0x4904b4,_0xd351('0x12'),JSON[_0xd351('0x13')](_0x4ebca1));if(_0x4ebca1['error']){if(_0x4ebca1[_0xd351('0x14')][_0xd351('0x15')]===0x1f4){logger['error'](_0xd351('0x16'),_0x4904b4,_0x4ebca1[_0xd351('0x14')][_0xd351('0x17')]);return _0x5949a4(_0x4ebca1[_0xd351('0x14')][_0xd351('0x17')]);}logger['error'](_0xd351('0x16'),_0x4904b4,_0x4ebca1['error']['message']);return _0x39b8c8(_0x4ebca1[_0xd351('0x14')]['message']);}else{logger[_0xd351('0xf')](_0xd351('0x16'),_0x4904b4,_0xd351('0x12'));_0x39b8c8(_0x4ebca1['result'][_0xd351('0x17')]);}})[_0xd351('0x18')](function(_0x77985a){logger[_0xd351('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x4904b4,_0x77985a);_0x5949a4(_0x77985a);});});}
\ No newline at end of file
+var _0x9ffd=['OpenchannelAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','request','then','info'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x28c8b5,_0x38d1fc){_0x28c8b5=_0x28c8b5-0x0;var _0x5c2fb1=_0x9ffd[_0x28c8b5];return _0x5c2fb1;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});config[_0xd9ff('0xb')]=_[_0xd9ff('0xc')](config[_0xd9ff('0xb')],{'host':_0xd9ff('0xd'),'port':0x18eb});var socket=require(_0xd9ff('0xe'))(new Redis(config[_0xd9ff('0xb')]));require(_0xd9ff('0xf'))['register'](socket);function respondWithRpcPromise(_0x54a555,_0x567f79,_0x5aa954){return new BPromise(function(_0x2355ab,_0x2fd77a){return client[_0xd9ff('0x10')](_0x54a555,_0x5aa954)[_0xd9ff('0x11')](function(_0x37d2c0){logger[_0xd9ff('0x12')](_0xd9ff('0x13'),_0x567f79,_0xd9ff('0x14'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x567f79,_0xd9ff('0x14'),JSON[_0xd9ff('0x15')](_0x37d2c0));if(_0x37d2c0[_0xd9ff('0x16')]){if(_0x37d2c0[_0xd9ff('0x16')][_0xd9ff('0x17')]===0x1f4){logger['error'](_0xd9ff('0x13'),_0x567f79,_0x37d2c0[_0xd9ff('0x16')]['message']);return _0x2fd77a(_0x37d2c0[_0xd9ff('0x16')]['message']);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x567f79,_0x37d2c0['error'][_0xd9ff('0x18')]);return _0x2355ab(_0x37d2c0['error'][_0xd9ff('0x18')]);}else{logger[_0xd9ff('0x12')](_0xd9ff('0x13'),_0x567f79,_0xd9ff('0x14'));_0x2355ab(_0x37d2c0[_0xd9ff('0x19')][_0xd9ff('0x18')]);}})[_0xd9ff('0x1a')](function(_0x128588){logger[_0xd9ff('0x16')](_0xd9ff('0x13'),_0x567f79,_0x128588);_0x2fd77a(_0x128588);});});}
\ No newline at end of file
index 1af574a..2e3effa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7794=['update','emit','openchannelAccount:','save','remove'];(function(_0x4aa71a,_0x58800f){var _0x17bb3=function(_0x157183){while(--_0x157183){_0x4aa71a['push'](_0x4aa71a['shift']());}};_0x17bb3(++_0x58800f);}(_0x7794,0x7b));var _0x4779=function(_0x3f31ce,_0x4cccae){_0x3f31ce=_0x3f31ce-0x0;var _0x3683c5=_0x7794[_0x3f31ce];return _0x3683c5;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x4779('0x0'),_0x4779('0x1'),_0x4779('0x2')];function createListener(_0xa47992,_0x493318){return function(_0x309b79){_0x493318[_0x4779('0x3')](_0xa47992,_0x309b79);};}function removeListener(_0x4d3b05,_0x40e5f9){return function(){OpenchannelAccountEvents['removeListener'](_0x4d3b05,_0x40e5f9);};}exports['register']=function(_0x53fd58){for(var _0x45cd71=0x0,_0x339512=events['length'];_0x45cd71<_0x339512;_0x45cd71++){var _0xb3fe18=events[_0x45cd71];var _0x13bb66=createListener(_0x4779('0x4')+_0xb3fe18,_0x53fd58);OpenchannelAccountEvents['on'](_0xb3fe18,_0x13bb66);}};
\ No newline at end of file
+var _0xa4de=['update','emit','removeListener','register','openchannelAccount:','./openchannelAccount.events'];(function(_0x20700a,_0x3cb551){var _0x1542d2=function(_0x1b4d53){while(--_0x1b4d53){_0x20700a['push'](_0x20700a['shift']());}};_0x1542d2(++_0x3cb551);}(_0xa4de,0x10d));var _0xea4d=function(_0x23b979,_0x1c3b9e){_0x23b979=_0x23b979-0x0;var _0x48e58d=_0xa4de[_0x23b979];return _0x48e58d;};'use strict';var OpenchannelAccountEvents=require(_0xea4d('0x0'));var events=['save','remove',_0xea4d('0x1')];function createListener(_0x2857a3,_0xf1af92){return function(_0x3ee016){_0xf1af92[_0xea4d('0x2')](_0x2857a3,_0x3ee016);};}function removeListener(_0x111a9e,_0x23785){return function(){OpenchannelAccountEvents[_0xea4d('0x3')](_0x111a9e,_0x23785);};}exports[_0xea4d('0x4')]=function(_0x24d5fe){for(var _0x604a6a=0x0,_0x2af8a5=events['length'];_0x604a6a<_0x2af8a5;_0x604a6a++){var _0x12d0bb=events[_0x604a6a];var _0x4f98e8=createListener(_0xea4d('0x5')+_0x12d0bb,_0x24d5fe);OpenchannelAccountEvents['on'](_0x12d0bb,_0x4f98e8);}};
\ No newline at end of file
index cc02d38..2dde4ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c28=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x51bccb,_0x119c89){var _0x310355=function(_0xc339c9){while(--_0xc339c9){_0x51bccb['push'](_0x51bccb['shift']());}};_0x310355(++_0x119c89);}(_0x8c28,0x18b));var _0x88c2=function(_0x49e052,_0x561274){_0x49e052=_0x49e052-0x0;var _0x1d4ed2=_0x8c28[_0x49e052];return _0x1d4ed2;};'use strict';var multer=require(_0x88c2('0x0'));var util=require(_0x88c2('0x1'));var path=require(_0x88c2('0x2'));var timeout=require('connect-timeout');var express=require(_0x88c2('0x3'));var router=express[_0x88c2('0x4')]();var fs_extra=require(_0x88c2('0x5'));var auth=require(_0x88c2('0x6'));var interaction=require(_0x88c2('0x7'));var config=require(_0x88c2('0x8'));var controller=require(_0x88c2('0x9'));router[_0x88c2('0xa')]('/',auth[_0x88c2('0xb')](),controller[_0x88c2('0xc')]);router[_0x88c2('0xa')](_0x88c2('0xd'),auth[_0x88c2('0xb')](),controller['show']);router['post']('/',auth[_0x88c2('0xb')](),controller[_0x88c2('0xe')]);router[_0x88c2('0xf')](_0x88c2('0xd'),auth[_0x88c2('0xb')](),controller[_0x88c2('0x10')]);router[_0x88c2('0x11')](_0x88c2('0xd'),auth[_0x88c2('0xb')](),controller[_0x88c2('0x12')]);module[_0x88c2('0x13')]=router;
\ No newline at end of file
+var _0x7884=['../../config/environment','./openchannelApplication.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x143565,_0x54d887){var _0x4dc1d9=function(_0x5e8838){while(--_0x5e8838){_0x143565['push'](_0x143565['shift']());}};_0x4dc1d9(++_0x54d887);}(_0x7884,0x1c5));var _0x4788=function(_0x565a53,_0x569bf6){_0x565a53=_0x565a53-0x0;var _0x35ecd2=_0x7884[_0x565a53];return _0x35ecd2;};'use strict';var multer=require(_0x4788('0x0'));var util=require('util');var path=require(_0x4788('0x1'));var timeout=require(_0x4788('0x2'));var express=require(_0x4788('0x3'));var router=express[_0x4788('0x4')]();var fs_extra=require(_0x4788('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4788('0x6'));var config=require(_0x4788('0x7'));var controller=require(_0x4788('0x8'));router['get']('/',auth[_0x4788('0x9')](),controller[_0x4788('0xa')]);router[_0x4788('0xb')](_0x4788('0xc'),auth[_0x4788('0x9')](),controller[_0x4788('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4788('0xe')]);router[_0x4788('0xf')](_0x4788('0xc'),auth[_0x4788('0x9')](),controller[_0x4788('0x10')]);router[_0x4788('0x11')](_0x4788('0xc'),auth[_0x4788('0x9')](),controller[_0x4788('0x12')]);module[_0x4788('0x13')]=router;
\ No newline at end of file
index e1823ee..71c8c49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc63a=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0xe52ce4,_0x305a97){var _0x2417e9=function(_0x5b0607){while(--_0x5b0607){_0xe52ce4['push'](_0xe52ce4['shift']());}};_0x2417e9(++_0x305a97);}(_0xc63a,0x86));var _0xac63=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0xc63a[_0x580647];return _0x5f0792;};'use strict';var Sequelize=require(_0xac63('0x0'));module[_0xac63('0x1')]={'priority':{'type':Sequelize[_0xac63('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xac63('0x3')],'allowNull':![],'defaultValue':_0xac63('0x4')},'appdata':{'type':Sequelize[_0xac63('0x5')]()},'description':{'type':Sequelize[_0xac63('0x3')]},'interval':{'type':Sequelize[_0xac63('0x3')],'defaultValue':_0xac63('0x6')}};
\ No newline at end of file
+var _0x3466=['*,*,*,*','sequelize','INTEGER','TEXT','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3466,0x178));var _0x6346=function(_0x18307a,_0x1ddb36){_0x18307a=_0x18307a-0x0;var _0x4716f6=_0x3466[_0x18307a];return _0x4716f6;};'use strict';var Sequelize=require(_0x6346('0x0'));module['exports']={'priority':{'type':Sequelize[_0x6346('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x6346('0x2')]()},'description':{'type':Sequelize[_0x6346('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x6346('0x4')}};
\ No newline at end of file
index 625c6c1..59e2071 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb41=['../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x5f08a6,_0x400121){var _0x5d0641=function(_0x304467){while(--_0x304467){_0x5f08a6['push'](_0x5f08a6['shift']());}};_0x5d0641(++_0x400121);}(_0xbb41,0xff));var _0x1bb4=function(_0x2e44cf,_0x16f684){_0x2e44cf=_0x2e44cf-0x0;var _0x361268=_0xbb41[_0x2e44cf];return _0x361268;};'use strict';var emlformat=require(_0x1bb4('0x0'));var rimraf=require(_0x1bb4('0x1'));var zipdir=require(_0x1bb4('0x2'));var jsonpatch=require(_0x1bb4('0x3'));var rp=require(_0x1bb4('0x4'));var moment=require(_0x1bb4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1bb4('0x6'));var util=require(_0x1bb4('0x7'));var path=require('path');var sox=require(_0x1bb4('0x8'));var csv=require('to-csv');var ejs=require(_0x1bb4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1bb4('0xa'));var squel=require('squel');var crypto=require(_0x1bb4('0xb'));var jsforce=require(_0x1bb4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1bb4('0xd'));var Papa=require('papaparse');var Redis=require(_0x1bb4('0xe'));var authService=require(_0x1bb4('0xf'));var qs=require(_0x1bb4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1bb4('0x11'));var logger=require(_0x1bb4('0x12'))(_0x1bb4('0x13'));var utils=require(_0x1bb4('0x14'));var config=require(_0x1bb4('0x15'));var licenseUtil=require(_0x1bb4('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4248ca,_0x2f685d){_0x2f685d=_0x2f685d||0xcc;return function(_0x3cb042){if(_0x3cb042){return _0x4248ca['sendStatus'](_0x2f685d);}return _0x4248ca[_0x1bb4('0x17')](_0x2f685d)[_0x1bb4('0x18')]();};}function respondWithResult(_0xf95eb1,_0x1e1295){_0x1e1295=_0x1e1295||0xc8;return function(_0x3909b3){if(_0x3909b3){return _0xf95eb1[_0x1bb4('0x17')](_0x1e1295)[_0x1bb4('0x19')](_0x3909b3);}};}function respondWithFilteredResult(_0x1495f0,_0x273361){return function(_0x49907a){if(_0x49907a){var _0x435d49=typeof _0x273361[_0x1bb4('0x1a')]===_0x1bb4('0x1b')&&typeof _0x273361[_0x1bb4('0x1c')]===_0x1bb4('0x1b');var _0x3183b1=_0x49907a[_0x1bb4('0x1d')];var _0x204910=_0x435d49?0x0:_0x273361['offset'];var _0xd22ca3=_0x435d49?_0x49907a['count']:_0x273361[_0x1bb4('0x1a')]+_0x273361[_0x1bb4('0x1c')];var _0x22a50b;if(_0xd22ca3>=_0x3183b1){_0xd22ca3=_0x3183b1;_0x22a50b=0xc8;}else{_0x22a50b=0xce;}_0x1495f0[_0x1bb4('0x17')](_0x22a50b);return _0x1495f0['set']('Content-Range',_0x204910+'-'+_0xd22ca3+'/'+_0x3183b1)[_0x1bb4('0x19')](_0x49907a);}return null;};}function patchUpdates(_0x2d078b){return function(_0x4e8713){try{jsonpatch[_0x1bb4('0x1e')](_0x4e8713,_0x2d078b,!![]);}catch(_0x4ebe34){return BPromise[_0x1bb4('0x1f')](_0x4ebe34);}return _0x4e8713[_0x1bb4('0x20')]();};}function saveUpdates(_0x49cf48,_0x238c84){return function(_0x6e9c01){if(_0x6e9c01){return _0x6e9c01[_0x1bb4('0x21')](_0x49cf48)[_0x1bb4('0x22')](function(_0xaf428b){return _0xaf428b;});}return null;};}function removeEntity(_0xda82fb,_0x315042){return function(_0x2973da){if(_0x2973da){return _0x2973da[_0x1bb4('0x23')]()[_0x1bb4('0x22')](function(){_0xda82fb['status'](0xcc)[_0x1bb4('0x18')]();});}};}function handleEntityNotFound(_0x25c37c,_0x23b80a){return function(_0x5417f9){if(!_0x5417f9){_0x25c37c[_0x1bb4('0x24')](0x194);}return _0x5417f9;};}function handleError(_0x1f0de5,_0x5daa44){_0x5daa44=_0x5daa44||0x1f4;return function(_0x137ca9){logger['error'](_0x137ca9[_0x1bb4('0x25')]);if(_0x137ca9[_0x1bb4('0x26')]){delete _0x137ca9[_0x1bb4('0x26')];}_0x1f0de5[_0x1bb4('0x17')](_0x5daa44)[_0x1bb4('0x27')](_0x137ca9);};}exports[_0x1bb4('0x28')]=function(_0x26fb1e,_0x4316e4){var _0x3a4c48={},_0x402347={},_0x5afce7={'count':0x0,'rows':[]};var _0x452e05=_[_0x1bb4('0x29')](db[_0x1bb4('0x2a')][_0x1bb4('0x2b')],function(_0x3356f1){return{'name':_0x3356f1[_0x1bb4('0x2c')],'type':_0x3356f1['type']['key']};});_0x402347[_0x1bb4('0x2d')]=_[_0x1bb4('0x29')](_0x452e05,_0x1bb4('0x26'));_0x402347[_0x1bb4('0x2e')]=_[_0x1bb4('0x2f')](_0x26fb1e[_0x1bb4('0x2e')]);_0x402347[_0x1bb4('0x30')]=_[_0x1bb4('0x31')](_0x402347[_0x1bb4('0x2d')],_0x402347['query']);_0x3a4c48['attributes']=_[_0x1bb4('0x31')](_0x402347[_0x1bb4('0x2d')],qs[_0x1bb4('0x32')](_0x26fb1e[_0x1bb4('0x2e')][_0x1bb4('0x32')]));_0x3a4c48[_0x1bb4('0x33')]=_0x3a4c48[_0x1bb4('0x33')][_0x1bb4('0x34')]?_0x3a4c48[_0x1bb4('0x33')]:_0x402347[_0x1bb4('0x2d')];if(!_0x26fb1e[_0x1bb4('0x2e')]['hasOwnProperty']('nolimit')){_0x3a4c48[_0x1bb4('0x1c')]=qs[_0x1bb4('0x1c')](_0x26fb1e[_0x1bb4('0x2e')][_0x1bb4('0x1c')]);_0x3a4c48['offset']=qs[_0x1bb4('0x1a')](_0x26fb1e['query'][_0x1bb4('0x1a')]);}_0x3a4c48[_0x1bb4('0x35')]=qs[_0x1bb4('0x36')](_0x26fb1e[_0x1bb4('0x2e')]['sort']);_0x3a4c48[_0x1bb4('0x37')]=qs['filters'](_[_0x1bb4('0x38')](_0x26fb1e[_0x1bb4('0x2e')],_0x402347['filters']),_0x452e05);if(_0x26fb1e[_0x1bb4('0x2e')][_0x1bb4('0x39')]){_0x3a4c48[_0x1bb4('0x37')]=_[_0x1bb4('0x3a')](_0x3a4c48[_0x1bb4('0x37')],{'$or':_[_0x1bb4('0x29')](_0x452e05,function(_0xf989b7){if(_0xf989b7[_0x1bb4('0x3b')]!==_0x1bb4('0x3c')){var _0x388f9a={};_0x388f9a[_0xf989b7[_0x1bb4('0x26')]]={'$like':'%'+_0x26fb1e[_0x1bb4('0x2e')][_0x1bb4('0x39')]+'%'};return _0x388f9a;}})});}_0x3a4c48=_[_0x1bb4('0x3a')]({},_0x3a4c48,_0x26fb1e[_0x1bb4('0x3d')]);var _0x4b171d={'where':_0x3a4c48[_0x1bb4('0x37')]};return db[_0x1bb4('0x2a')][_0x1bb4('0x1d')](_0x4b171d)[_0x1bb4('0x22')](function(_0x3e0eac){_0x5afce7[_0x1bb4('0x1d')]=_0x3e0eac;if(_0x26fb1e[_0x1bb4('0x2e')][_0x1bb4('0x3e')]){_0x3a4c48[_0x1bb4('0x3f')]=[{'all':!![]}];}return db[_0x1bb4('0x2a')]['findAll'](_0x3a4c48);})[_0x1bb4('0x22')](function(_0x4b3604){_0x5afce7['rows']=_0x4b3604;return _0x5afce7;})[_0x1bb4('0x22')](respondWithFilteredResult(_0x4316e4,_0x3a4c48))[_0x1bb4('0x40')](handleError(_0x4316e4,null));};exports['show']=function(_0x3d53ee,_0x47f7e2){var _0x152123={'raw':!![],'where':{'id':_0x3d53ee[_0x1bb4('0x41')]['id']}},_0xdbb5fa={};_0xdbb5fa[_0x1bb4('0x2d')]=_['keys'](db[_0x1bb4('0x2a')][_0x1bb4('0x2b')]);_0xdbb5fa['query']=_[_0x1bb4('0x2f')](_0x3d53ee[_0x1bb4('0x2e')]);_0xdbb5fa['filters']=_[_0x1bb4('0x31')](_0xdbb5fa[_0x1bb4('0x2d')],_0xdbb5fa[_0x1bb4('0x2e')]);_0x152123['attributes']=_['intersection'](_0xdbb5fa['model'],qs['fields'](_0x3d53ee[_0x1bb4('0x2e')][_0x1bb4('0x32')]));_0x152123['attributes']=_0x152123[_0x1bb4('0x33')][_0x1bb4('0x34')]?_0x152123[_0x1bb4('0x33')]:_0xdbb5fa[_0x1bb4('0x2d')];if(_0x3d53ee[_0x1bb4('0x2e')]['includeAll']){_0x152123[_0x1bb4('0x3f')]=[{'all':!![]}];}_0x152123=_[_0x1bb4('0x3a')]({},_0x152123,_0x3d53ee['options']);return db[_0x1bb4('0x2a')][_0x1bb4('0x42')](_0x152123)[_0x1bb4('0x22')](handleEntityNotFound(_0x47f7e2,null))[_0x1bb4('0x22')](respondWithResult(_0x47f7e2,null))[_0x1bb4('0x40')](handleError(_0x47f7e2,null));};exports['create']=function(_0x394202,_0x35866b){return db[_0x1bb4('0x2a')][_0x1bb4('0x43')](_0x394202[_0x1bb4('0x44')],{})[_0x1bb4('0x22')](respondWithResult(_0x35866b,0xc9))[_0x1bb4('0x40')](handleError(_0x35866b,null));};exports[_0x1bb4('0x21')]=function(_0x5a2fb2,_0x313956){if(_0x5a2fb2[_0x1bb4('0x44')]['id']){delete _0x5a2fb2[_0x1bb4('0x44')]['id'];}return db[_0x1bb4('0x2a')][_0x1bb4('0x42')]({'where':{'id':_0x5a2fb2[_0x1bb4('0x41')]['id']}})[_0x1bb4('0x22')](handleEntityNotFound(_0x313956,null))[_0x1bb4('0x22')](saveUpdates(_0x5a2fb2['body'],null))[_0x1bb4('0x22')](respondWithResult(_0x313956,null))[_0x1bb4('0x40')](handleError(_0x313956,null));};exports[_0x1bb4('0x23')]=function(_0x11b5b1,_0x5d455b){return db['OpenchannelApplication'][_0x1bb4('0x42')]({'where':{'id':_0x11b5b1[_0x1bb4('0x41')]['id']}})[_0x1bb4('0x22')](handleEntityNotFound(_0x5d455b,null))[_0x1bb4('0x22')](removeEntity(_0x5d455b,null))[_0x1bb4('0x40')](handleError(_0x5d455b,null));};
\ No newline at end of file
+var _0x6f13=['apply','update','then','destroy','error','stack','name','send','index','map','OpenchannelApplication','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','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','sendStatus','end','json','undefined','limit','offset','count','status','set'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x6f13,0xbf));var _0x36f1=function(_0x53b04e,_0x1a3dc2){_0x53b04e=_0x53b04e-0x0;var _0x2bc869=_0x6f13[_0x53b04e];return _0x2bc869;};'use strict';var emlformat=require(_0x36f1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x36f1('0x1'));var jsonpatch=require(_0x36f1('0x2'));var rp=require(_0x36f1('0x3'));var moment=require(_0x36f1('0x4'));var BPromise=require(_0x36f1('0x5'));var Mustache=require(_0x36f1('0x6'));var util=require('util');var path=require(_0x36f1('0x7'));var sox=require(_0x36f1('0x8'));var csv=require(_0x36f1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x36f1('0xa'));var _=require(_0x36f1('0xb'));var squel=require(_0x36f1('0xc'));var crypto=require(_0x36f1('0xd'));var jsforce=require(_0x36f1('0xe'));var deskjs=require(_0x36f1('0xf'));var toCsv=require(_0x36f1('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x36f1('0x10'));var authService=require(_0x36f1('0x11'));var qs=require(_0x36f1('0x12'));var as=require(_0x36f1('0x13'));var hardwareService=require(_0x36f1('0x14'));var logger=require('../../config/logger')(_0x36f1('0x15'));var utils=require(_0x36f1('0x16'));var config=require(_0x36f1('0x17'));var licenseUtil=require(_0x36f1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51c245,_0xd528ed){_0xd528ed=_0xd528ed||0xcc;return function(_0x460023){if(_0x460023){return _0x51c245[_0x36f1('0x19')](_0xd528ed);}return _0x51c245['status'](_0xd528ed)[_0x36f1('0x1a')]();};}function respondWithResult(_0x35f277,_0x4ed851){_0x4ed851=_0x4ed851||0xc8;return function(_0x50c622){if(_0x50c622){return _0x35f277['status'](_0x4ed851)[_0x36f1('0x1b')](_0x50c622);}};}function respondWithFilteredResult(_0x363cae,_0x3417b7){return function(_0x519c8e){if(_0x519c8e){var _0x1707bd=typeof _0x3417b7['offset']===_0x36f1('0x1c')&&typeof _0x3417b7[_0x36f1('0x1d')]===_0x36f1('0x1c');var _0x5c0050=_0x519c8e['count'];var _0x5b9638=_0x1707bd?0x0:_0x3417b7[_0x36f1('0x1e')];var _0x36bcd3=_0x1707bd?_0x519c8e[_0x36f1('0x1f')]:_0x3417b7[_0x36f1('0x1e')]+_0x3417b7[_0x36f1('0x1d')];var _0x1f0d5d;if(_0x36bcd3>=_0x5c0050){_0x36bcd3=_0x5c0050;_0x1f0d5d=0xc8;}else{_0x1f0d5d=0xce;}_0x363cae[_0x36f1('0x20')](_0x1f0d5d);return _0x363cae[_0x36f1('0x21')]('Content-Range',_0x5b9638+'-'+_0x36bcd3+'/'+_0x5c0050)['json'](_0x519c8e);}return null;};}function patchUpdates(_0x58af81){return function(_0x39f22b){try{jsonpatch[_0x36f1('0x22')](_0x39f22b,_0x58af81,!![]);}catch(_0x556a63){return BPromise['reject'](_0x556a63);}return _0x39f22b['save']();};}function saveUpdates(_0x4e5d5b,_0x495efe){return function(_0x3f44c5){if(_0x3f44c5){return _0x3f44c5[_0x36f1('0x23')](_0x4e5d5b)[_0x36f1('0x24')](function(_0x84973c){return _0x84973c;});}return null;};}function removeEntity(_0x2f1196,_0x5c2fee){return function(_0x12468e){if(_0x12468e){return _0x12468e[_0x36f1('0x25')]()['then'](function(){_0x2f1196[_0x36f1('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d2e1,_0x6fc208){return function(_0x36f77f){if(!_0x36f77f){_0x9d2e1['sendStatus'](0x194);}return _0x36f77f;};}function handleError(_0x5c025b,_0x4dfa37){_0x4dfa37=_0x4dfa37||0x1f4;return function(_0x44a8f7){logger[_0x36f1('0x26')](_0x44a8f7[_0x36f1('0x27')]);if(_0x44a8f7['name']){delete _0x44a8f7[_0x36f1('0x28')];}_0x5c025b[_0x36f1('0x20')](_0x4dfa37)[_0x36f1('0x29')](_0x44a8f7);};}exports[_0x36f1('0x2a')]=function(_0x46c274,_0x3b45ef){var _0x3c15ff={},_0x4af164={},_0x52ea12={'count':0x0,'rows':[]};var _0x4800ba=_[_0x36f1('0x2b')](db[_0x36f1('0x2c')]['rawAttributes'],function(_0x5a4cdb){return{'name':_0x5a4cdb[_0x36f1('0x2d')],'type':_0x5a4cdb['type'][_0x36f1('0x2e')]};});_0x4af164[_0x36f1('0x2f')]=_['map'](_0x4800ba,'name');_0x4af164[_0x36f1('0x30')]=_[_0x36f1('0x31')](_0x46c274['query']);_0x4af164[_0x36f1('0x32')]=_[_0x36f1('0x33')](_0x4af164[_0x36f1('0x2f')],_0x4af164[_0x36f1('0x30')]);_0x3c15ff[_0x36f1('0x34')]=_[_0x36f1('0x33')](_0x4af164['model'],qs[_0x36f1('0x35')](_0x46c274[_0x36f1('0x30')]['fields']));_0x3c15ff[_0x36f1('0x34')]=_0x3c15ff[_0x36f1('0x34')][_0x36f1('0x36')]?_0x3c15ff[_0x36f1('0x34')]:_0x4af164['model'];if(!_0x46c274['query'][_0x36f1('0x37')]('nolimit')){_0x3c15ff[_0x36f1('0x1d')]=qs[_0x36f1('0x1d')](_0x46c274['query']['limit']);_0x3c15ff[_0x36f1('0x1e')]=qs[_0x36f1('0x1e')](_0x46c274[_0x36f1('0x30')]['offset']);}_0x3c15ff[_0x36f1('0x38')]=qs['sort'](_0x46c274[_0x36f1('0x30')][_0x36f1('0x39')]);_0x3c15ff[_0x36f1('0x3a')]=qs[_0x36f1('0x32')](_[_0x36f1('0x3b')](_0x46c274['query'],_0x4af164[_0x36f1('0x32')]),_0x4800ba);if(_0x46c274[_0x36f1('0x30')]['filter']){_0x3c15ff[_0x36f1('0x3a')]=_['merge'](_0x3c15ff[_0x36f1('0x3a')],{'$or':_[_0x36f1('0x2b')](_0x4800ba,function(_0x830f11){if(_0x830f11[_0x36f1('0x3c')]!==_0x36f1('0x3d')){var _0x35b614={};_0x35b614[_0x830f11[_0x36f1('0x28')]]={'$like':'%'+_0x46c274[_0x36f1('0x30')]['filter']+'%'};return _0x35b614;}})});}_0x3c15ff=_[_0x36f1('0x3e')]({},_0x3c15ff,_0x46c274['options']);var _0xa73b9e={'where':_0x3c15ff['where']};return db[_0x36f1('0x2c')][_0x36f1('0x1f')](_0xa73b9e)[_0x36f1('0x24')](function(_0x2b4a32){_0x52ea12['count']=_0x2b4a32;if(_0x46c274[_0x36f1('0x30')][_0x36f1('0x3f')]){_0x3c15ff[_0x36f1('0x40')]=[{'all':!![]}];}return db[_0x36f1('0x2c')][_0x36f1('0x41')](_0x3c15ff);})[_0x36f1('0x24')](function(_0x2d3906){_0x52ea12[_0x36f1('0x42')]=_0x2d3906;return _0x52ea12;})[_0x36f1('0x24')](respondWithFilteredResult(_0x3b45ef,_0x3c15ff))[_0x36f1('0x43')](handleError(_0x3b45ef,null));};exports[_0x36f1('0x44')]=function(_0x2a63a7,_0x38bdea){var _0x3c7e7e={'raw':!![],'where':{'id':_0x2a63a7['params']['id']}},_0x541d6d={};_0x541d6d[_0x36f1('0x2f')]=_[_0x36f1('0x31')](db[_0x36f1('0x2c')][_0x36f1('0x45')]);_0x541d6d['query']=_['keys'](_0x2a63a7[_0x36f1('0x30')]);_0x541d6d[_0x36f1('0x32')]=_[_0x36f1('0x33')](_0x541d6d[_0x36f1('0x2f')],_0x541d6d[_0x36f1('0x30')]);_0x3c7e7e['attributes']=_[_0x36f1('0x33')](_0x541d6d['model'],qs[_0x36f1('0x35')](_0x2a63a7['query'][_0x36f1('0x35')]));_0x3c7e7e[_0x36f1('0x34')]=_0x3c7e7e[_0x36f1('0x34')][_0x36f1('0x36')]?_0x3c7e7e[_0x36f1('0x34')]:_0x541d6d[_0x36f1('0x2f')];if(_0x2a63a7[_0x36f1('0x30')][_0x36f1('0x3f')]){_0x3c7e7e[_0x36f1('0x40')]=[{'all':!![]}];}_0x3c7e7e=_[_0x36f1('0x3e')]({},_0x3c7e7e,_0x2a63a7[_0x36f1('0x46')]);return db['OpenchannelApplication'][_0x36f1('0x47')](_0x3c7e7e)['then'](handleEntityNotFound(_0x38bdea,null))[_0x36f1('0x24')](respondWithResult(_0x38bdea,null))['catch'](handleError(_0x38bdea,null));};exports['create']=function(_0x9a74ff,_0x70d969){return db[_0x36f1('0x2c')][_0x36f1('0x48')](_0x9a74ff[_0x36f1('0x49')],{})[_0x36f1('0x24')](respondWithResult(_0x70d969,0xc9))['catch'](handleError(_0x70d969,null));};exports['update']=function(_0x47cfac,_0x4f5d10){if(_0x47cfac['body']['id']){delete _0x47cfac[_0x36f1('0x49')]['id'];}return db[_0x36f1('0x2c')][_0x36f1('0x47')]({'where':{'id':_0x47cfac[_0x36f1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4f5d10,null))[_0x36f1('0x24')](saveUpdates(_0x47cfac[_0x36f1('0x49')],null))[_0x36f1('0x24')](respondWithResult(_0x4f5d10,null))[_0x36f1('0x43')](handleError(_0x4f5d10,null));};exports[_0x36f1('0x25')]=function(_0xe184a3,_0x238b57){return db[_0x36f1('0x2c')][_0x36f1('0x47')]({'where':{'id':_0xe184a3[_0x36f1('0x4a')]['id']}})[_0x36f1('0x24')](handleEntityNotFound(_0x238b57,null))[_0x36f1('0x24')](removeEntity(_0x238b57,null))[_0x36f1('0x43')](handleError(_0x238b57,null));};
\ No newline at end of file
index e76e016..287a3bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49fd=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','openchannel_applications','utf8mb4_unicode_ci','lodash','util'];(function(_0x83fd34,_0x58309c){var _0x45c003=function(_0x32a3e6){while(--_0x32a3e6){_0x83fd34['push'](_0x83fd34['shift']());}};_0x45c003(++_0x58309c);}(_0x49fd,0x8e));var _0xd49f=function(_0x405ce7,_0x5dbeeb){_0x405ce7=_0x405ce7-0x0;var _0x4d497a=_0x49fd[_0x405ce7];return _0x4d497a;};'use strict';var _=require(_0xd49f('0x0'));var util=require(_0xd49f('0x1'));var logger=require(_0xd49f('0x2'))(_0xd49f('0x3'));var moment=require('moment');var BPromise=require(_0xd49f('0x4'));var rp=require(_0xd49f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd49f('0x6'));var config=require(_0xd49f('0x7'));var attributes=require('./openchannelApplication.attributes');module[_0xd49f('0x8')]=function(_0x3a92f7,_0x11a5df){return _0x3a92f7[_0xd49f('0x9')]('OpenchannelApplication',attributes,{'tableName':_0xd49f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd49f('0xb')});};
\ No newline at end of file
+var _0x4d0c=['utf8mb4_unicode_ci','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x4d0c,0x151));var _0xc4d0=function(_0x27ffa8,_0x3629bd){_0x27ffa8=_0x27ffa8-0x0;var _0x4542f7=_0x4d0c[_0x27ffa8];return _0x4542f7;};'use strict';var _=require('lodash');var util=require(_0xc4d0('0x0'));var logger=require(_0xc4d0('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc4d0('0x2'));var fs=require('fs');var path=require(_0xc4d0('0x3'));var rimraf=require(_0xc4d0('0x4'));var config=require(_0xc4d0('0x5'));var attributes=require(_0xc4d0('0x6'));module[_0xc4d0('0x7')]=function(_0xc0814c,_0x19ee44){return _0xc0814c[_0xc4d0('0x8')](_0xc4d0('0x9'),attributes,{'tableName':_0xc4d0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc4d0('0xb')});};
\ No newline at end of file
index bcfb0f1..cffb515 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b63=['OpenchannelApplication','update','body','options','raw','where','attributes','limit','then','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','http','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x6b63,0x165));var _0x36b6=function(_0x418093,_0x2033cf){_0x418093=_0x418093-0x0;var _0xfdeccb=_0x6b63[_0x418093];return _0xfdeccb;};'use strict';var _=require(_0x36b6('0x0'));var util=require(_0x36b6('0x1'));var moment=require(_0x36b6('0x2'));var BPromise=require('bluebird');var rs=require(_0x36b6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x36b6('0x4'))['db'];var utils=require(_0x36b6('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x36b6('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x36b6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x55768a,_0xf75b27,_0x17b877){return new BPromise(function(_0x414e6c,_0x168cd1){return client[_0x36b6('0x8')](_0x55768a,_0x17b877)['then'](function(_0x2b10aa){logger[_0x36b6('0x9')](_0x36b6('0xa'),_0xf75b27,_0x36b6('0xb'));logger['debug'](_0x36b6('0xc'),_0xf75b27,'request\x20sent',JSON[_0x36b6('0xd')](_0x2b10aa));if(_0x2b10aa[_0x36b6('0xe')]){if(_0x2b10aa[_0x36b6('0xe')][_0x36b6('0xf')]===0x1f4){logger['error'](_0x36b6('0xa'),_0xf75b27,_0x2b10aa['error']['message']);return _0x168cd1(_0x2b10aa['error'][_0x36b6('0x10')]);}logger['error'](_0x36b6('0xa'),_0xf75b27,_0x2b10aa[_0x36b6('0xe')][_0x36b6('0x10')]);return _0x414e6c(_0x2b10aa[_0x36b6('0xe')][_0x36b6('0x10')]);}else{logger['info'](_0x36b6('0xa'),_0xf75b27,'request\x20sent');_0x414e6c(_0x2b10aa[_0x36b6('0x11')]['message']);}})[_0x36b6('0x12')](function(_0x377432){logger[_0x36b6('0xe')](_0x36b6('0xa'),_0xf75b27,_0x377432);_0x168cd1(_0x377432);});});}exports[_0x36b6('0x13')]=function(_0x5611d4){var _0x491620=this;return new Promise(function(_0x435f52,_0x1d9faf){return db[_0x36b6('0x14')][_0x36b6('0x15')](_0x5611d4[_0x36b6('0x16')],{'raw':_0x5611d4[_0x36b6('0x17')]?_0x5611d4[_0x36b6('0x17')][_0x36b6('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5611d4[_0x36b6('0x17')]?_0x5611d4['options'][_0x36b6('0x19')]||null:null,'attributes':_0x5611d4[_0x36b6('0x17')]?_0x5611d4[_0x36b6('0x17')][_0x36b6('0x1a')]||null:null,'limit':_0x5611d4[_0x36b6('0x17')]?_0x5611d4['options'][_0x36b6('0x1b')]||null:null})[_0x36b6('0x1c')](function(_0x40a1d){logger[_0x36b6('0x9')]('UpdateOpenchannelApplication',_0x5611d4);logger['debug'](_0x36b6('0x13'),_0x5611d4,JSON[_0x36b6('0xd')](_0x40a1d));_0x435f52(_0x40a1d);})[_0x36b6('0x12')](function(_0x3b63a0){logger[_0x36b6('0xe')]('UpdateOpenchannelApplication',_0x3b63a0[_0x36b6('0x10')],_0x5611d4);_0x1d9faf(_0x491620['error'](0x1f4,_0x3b63a0['message']));});});};
\ No newline at end of file
+var _0x6d55=['OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','then','debug','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info'];(function(_0x5d72c0,_0x5bc03b){var _0x998b7f=function(_0x20ad2d){while(--_0x20ad2d){_0x5d72c0['push'](_0x5d72c0['shift']());}};_0x998b7f(++_0x5bc03b);}(_0x6d55,0x194));var _0x56d5=function(_0x2baf64,_0x5ddeda){_0x2baf64=_0x2baf64-0x0;var _0x52f0cd=_0x6d55[_0x2baf64];return _0x52f0cd;};'use strict';var _=require(_0x56d5('0x0'));var util=require('util');var moment=require(_0x56d5('0x1'));var BPromise=require('bluebird');var rs=require(_0x56d5('0x2'));var fs=require('fs');var Redis=require(_0x56d5('0x3'));var db=require(_0x56d5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x56d5('0x5'))(_0x56d5('0x6'));var config=require(_0x56d5('0x7'));var jayson=require(_0x56d5('0x8'));var client=jayson['client'][_0x56d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x525640,_0x358bfb,_0x54bbf8){return new BPromise(function(_0x35a8c2,_0xd3ee15){return client[_0x56d5('0xa')](_0x525640,_0x54bbf8)['then'](function(_0x55fe11){logger[_0x56d5('0xb')](_0x56d5('0xc'),_0x358bfb,'request\x20sent');logger['debug'](_0x56d5('0xd'),_0x358bfb,_0x56d5('0xe'),JSON[_0x56d5('0xf')](_0x55fe11));if(_0x55fe11[_0x56d5('0x10')]){if(_0x55fe11[_0x56d5('0x10')][_0x56d5('0x11')]===0x1f4){logger[_0x56d5('0x10')](_0x56d5('0xc'),_0x358bfb,_0x55fe11['error'][_0x56d5('0x12')]);return _0xd3ee15(_0x55fe11[_0x56d5('0x10')][_0x56d5('0x12')]);}logger[_0x56d5('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x358bfb,_0x55fe11[_0x56d5('0x10')][_0x56d5('0x12')]);return _0x35a8c2(_0x55fe11[_0x56d5('0x10')][_0x56d5('0x12')]);}else{logger[_0x56d5('0xb')](_0x56d5('0xc'),_0x358bfb,'request\x20sent');_0x35a8c2(_0x55fe11[_0x56d5('0x13')]['message']);}})['catch'](function(_0x445402){logger[_0x56d5('0x10')](_0x56d5('0xc'),_0x358bfb,_0x445402);_0xd3ee15(_0x445402);});});}exports[_0x56d5('0x14')]=function(_0x36b3ae){var _0x2836b3=this;return new Promise(function(_0x481215,_0x5b7347){return db[_0x56d5('0x15')][_0x56d5('0x16')](_0x36b3ae[_0x56d5('0x17')],{'raw':_0x36b3ae[_0x56d5('0x18')]?_0x36b3ae[_0x56d5('0x18')][_0x56d5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36b3ae[_0x56d5('0x18')]?_0x36b3ae['options'][_0x56d5('0x1a')]||null:null,'attributes':_0x36b3ae[_0x56d5('0x18')]?_0x36b3ae[_0x56d5('0x18')][_0x56d5('0x1b')]||null:null,'limit':_0x36b3ae['options']?_0x36b3ae[_0x56d5('0x18')][_0x56d5('0x1c')]||null:null})[_0x56d5('0x1d')](function(_0x5373db){logger[_0x56d5('0xb')](_0x56d5('0x14'),_0x36b3ae);logger[_0x56d5('0x1e')]('UpdateOpenchannelApplication',_0x36b3ae,JSON['stringify'](_0x5373db));_0x481215(_0x5373db);})[_0x56d5('0x1f')](function(_0x596228){logger[_0x56d5('0x10')](_0x56d5('0x14'),_0x596228['message'],_0x36b3ae);_0x5b7347(_0x2836b3[_0x56d5('0x10')](0x1f4,_0x596228['message']));});});};
\ No newline at end of file
index 14b1358..837363f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0584=['getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','/:id','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages'];(function(_0x17aaba,_0x5b7c1c){var _0x43c429=function(_0x4d0503){while(--_0x4d0503){_0x17aaba['push'](_0x17aaba['shift']());}};_0x43c429(++_0x5b7c1c);}(_0x0584,0x11b));var _0x4058=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x0584[_0xd1d19a];return _0x52a79d;};'use strict';var multer=require(_0x4058('0x0'));var util=require(_0x4058('0x1'));var path=require('path');var timeout=require(_0x4058('0x2'));var express=require(_0x4058('0x3'));var router=express[_0x4058('0x4')]();var fs_extra=require(_0x4058('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4058('0x6'));router[_0x4058('0x7')]('/',auth[_0x4058('0x8')](),controller[_0x4058('0x9')]);router[_0x4058('0x7')](_0x4058('0xa'),auth[_0x4058('0x8')](),controller[_0x4058('0xb')]);router[_0x4058('0x7')]('/:id',auth[_0x4058('0x8')](),controller[_0x4058('0xc')]);router['get'](_0x4058('0xd'),auth[_0x4058('0x8')](),controller[_0x4058('0xe')]);router[_0x4058('0x7')](_0x4058('0xf'),auth[_0x4058('0x8')](),controller[_0x4058('0x10')]);router[_0x4058('0x11')]('/',auth[_0x4058('0x8')](),controller[_0x4058('0x12')]);router['post'](_0x4058('0xd'),auth[_0x4058('0x8')](),controller[_0x4058('0x13')]);router[_0x4058('0x11')](_0x4058('0x14'),auth[_0x4058('0x8')](),interaction[_0x4058('0x15')](_0x4058('0x16'),_0x4058('0x17')),controller[_0x4058('0x18')]);router[_0x4058('0x19')]('/:id',auth[_0x4058('0x8')](),interaction['tracked']('openchannel',_0x4058('0x1a')),controller[_0x4058('0x1b')]);router['delete'](_0x4058('0x1c'),auth['isAuthenticated'](),interaction[_0x4058('0x15')]('openchannel',_0x4058('0x1d')),controller[_0x4058('0x1e')]);router['delete'](_0x4058('0x14'),auth[_0x4058('0x8')](),controller[_0x4058('0x1f')]);module[_0x4058('0x20')]=router;
\ No newline at end of file
+var _0x092a=['isAuthenticated','/describe','/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','delete','/:id','openchannelinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','get'];(function(_0x1ee0cf,_0x2bb16f){var _0x4bf356=function(_0x5c4388){while(--_0x5c4388){_0x1ee0cf['push'](_0x1ee0cf['shift']());}};_0x4bf356(++_0x2bb16f);}(_0x092a,0x153));var _0xa092=function(_0x23c651,_0x143982){_0x23c651=_0x23c651-0x0;var _0xbe7bdb=_0x092a[_0x23c651];return _0xbe7bdb;};'use strict';var multer=require('multer');var util=require(_0xa092('0x0'));var path=require(_0xa092('0x1'));var timeout=require(_0xa092('0x2'));var express=require(_0xa092('0x3'));var router=express[_0xa092('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa092('0x5'));var interaction=require(_0xa092('0x6'));var config=require('../../config/environment');var controller=require(_0xa092('0x7'));router[_0xa092('0x8')]('/',auth[_0xa092('0x9')](),controller['index']);router[_0xa092('0x8')](_0xa092('0xa'),auth[_0xa092('0x9')](),controller['describe']);router[_0xa092('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xa092('0x8')](_0xa092('0xb'),auth[_0xa092('0x9')](),controller[_0xa092('0xc')]);router[_0xa092('0x8')](_0xa092('0xd'),auth[_0xa092('0x9')](),controller['download']);router['post']('/',auth[_0xa092('0x9')](),controller['create']);router[_0xa092('0xe')](_0xa092('0xb'),auth[_0xa092('0x9')](),controller[_0xa092('0xf')]);router[_0xa092('0xe')](_0xa092('0x10'),auth[_0xa092('0x9')](),interaction[_0xa092('0x11')](_0xa092('0x12'),_0xa092('0x13')),controller[_0xa092('0x14')]);router[_0xa092('0x15')]('/:id',auth['isAuthenticated'](),interaction[_0xa092('0x11')]('openchannel',_0xa092('0x16')),controller['update']);router[_0xa092('0x17')](_0xa092('0x18'),auth[_0xa092('0x9')](),interaction['tracked']('openchannel',_0xa092('0x19')),controller[_0xa092('0x1a')]);router[_0xa092('0x17')]('/:id/tags',auth[_0xa092('0x9')](),controller[_0xa092('0x1b')]);module[_0xa092('0x1c')]=router;
\ No newline at end of file
index 839bb0d..b2d3e81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54ef=['ENUM','sequelize','exports','BOOLEAN','STRING','DATE','out'];(function(_0x3d2163,_0x3f3c98){var _0x50a23b=function(_0x1bb878){while(--_0x1bb878){_0x3d2163['push'](_0x3d2163['shift']());}};_0x50a23b(++_0x3f3c98);}(_0x54ef,0x112));var _0xf54e=function(_0x284133,_0x339e26){_0x284133=_0x284133-0x0;var _0x2d23c7=_0x54ef[_0x284133];return _0x2d23c7;};'use strict';var Sequelize=require(_0xf54e('0x0'));module[_0xf54e('0x1')]={'closed':{'type':Sequelize[_0xf54e('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xf54e('0x3')]},'secondDisposition':{'type':Sequelize[_0xf54e('0x3')]},'thirdDisposition':{'type':Sequelize[_0xf54e('0x3')]},'note':{'type':Sequelize[_0xf54e('0x3')]},'read1stAt':{'type':Sequelize[_0xf54e('0x4')]},'threadId':{'type':Sequelize[_0xf54e('0x3')]},'externalUrl':{'type':Sequelize[_0xf54e('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xf54e('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xf54e('0x6')]('in',_0xf54e('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0xf54e('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xe062=['ENUM','out','BOOLEAN','sequelize','exports','DATE','STRING'];(function(_0x20d7b8,_0x41b1d4){var _0x366040=function(_0xa03678){while(--_0xa03678){_0x20d7b8['push'](_0x20d7b8['shift']());}};_0x366040(++_0x41b1d4);}(_0xe062,0xd5));var _0x2e06=function(_0x383f5d,_0x30649d){_0x383f5d=_0x383f5d-0x0;var _0x6dbfa8=_0xe062[_0x383f5d];return _0x6dbfa8;};'use strict';var Sequelize=require(_0x2e06('0x0'));module[_0x2e06('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2e06('0x2')]},'disposition':{'type':Sequelize[_0x2e06('0x3')]},'secondDisposition':{'type':Sequelize[_0x2e06('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x2e06('0x2')]},'threadId':{'type':Sequelize[_0x2e06('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x2e06('0x4')]('in',_0x2e06('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x2e06('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x2e06('0x6')],'defaultValue':![]}};
\ No newline at end of file
index adf4177..4d1a28f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68e8=['../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./openchannelInteraction.socket','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','type','openchannel','user','catch','show','query','from','params','keys','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','create','body','find','describe','addMessage','OpenchannelMessage','ids','findOne','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','$gte','split','addTags','setTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','unix','join','root','server','tmp','attachments','format','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','secret','read','Account','Owner','get','mkdirSync','Openchannel','N.A.','createdAt','YYYY-MM-DD\x20HH:mm:ss','closed','disposition','threadId','Public','Private','Messages','createReadStream','pipe','createWriteStream','basename','toString','direction','out','System','value','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','download','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','zip-dir','moment','util','path','lodash','ioredis','../../components/interaction/service'];(function(_0x2a94d2,_0xfb73a1){var _0x5c6c59=function(_0x216b17){while(--_0x216b17){_0x2a94d2['push'](_0x2a94d2['shift']());}};_0x5c6c59(++_0xfb73a1);}(_0x68e8,0x7a));var _0x868e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x68e8[_0x20a584];return _0x4b41a8;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x868e('0x0'));var moment=require(_0x868e('0x1'));var util=require(_0x868e('0x2'));var path=require(_0x868e('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x868e('0x4'));var Redis=require(_0x868e('0x5'));var interaction=require(_0x868e('0x6'));var qs=require('../../components/parsers/qs');var pdf=require(_0x868e('0x7'));var logger=require(_0x868e('0x8'))(_0x868e('0x9'));var config=require(_0x868e('0xa'));var db=require(_0x868e('0xb'))['db'];config[_0x868e('0xc')]=_['defaults'](config[_0x868e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x868e('0xd'))(new Redis(config['redis']));require(_0x868e('0xe'))['register'](socket);function respondWithStatusCode(_0x5f3a6d,_0x379064){_0x379064=_0x379064||0xcc;return function(_0x5e80be){if(_0x5e80be){return _0x5f3a6d[_0x868e('0xf')](_0x379064);}return _0x5f3a6d['status'](_0x379064)[_0x868e('0x10')]();};}function respondWithResult(_0x17c764,_0x457a4c){_0x457a4c=_0x457a4c||0xc8;return function(_0x4a8e24){if(_0x4a8e24){return _0x17c764[_0x868e('0x11')](_0x457a4c)[_0x868e('0x12')](_0x4a8e24);}};}function respondWithFilteredResult(_0x5022f1,_0x5e8358){return function(_0x457ea4){if(_0x457ea4){var _0x39c722=typeof _0x5e8358[_0x868e('0x13')]==='undefined'&&typeof _0x5e8358['limit']===_0x868e('0x14');var _0x2d14e5=_0x457ea4[_0x868e('0x15')];var _0x424a5e=_0x39c722?0x0:_0x5e8358[_0x868e('0x13')];var _0x40a210=_0x39c722?_0x457ea4[_0x868e('0x15')]:_0x5e8358['offset']+_0x5e8358[_0x868e('0x16')];var _0x57bab3;if(_0x40a210>=_0x2d14e5){_0x40a210=_0x2d14e5;_0x57bab3=0xc8;}else{_0x57bab3=0xce;}_0x5022f1[_0x868e('0x11')](_0x57bab3);return _0x5022f1[_0x868e('0x17')](_0x868e('0x18'),_0x424a5e+'-'+_0x40a210+'/'+_0x2d14e5)[_0x868e('0x12')](_0x457ea4);}return null;};}function saveUpdates(_0x3b4cf9){return function(_0x268733){if(_0x268733){return _0x268733[_0x868e('0x19')](_0x3b4cf9)[_0x868e('0x1a')](function(_0x3938e1){return _0x3938e1;});}return null;};}function removeEntity(_0x4c73ae){return function(_0x548d8c){if(_0x548d8c){return _0x548d8c[_0x868e('0x1b')]()[_0x868e('0x1a')](function(){_0x4c73ae['status'](0xcc)[_0x868e('0x10')]();});}};}function handleEntityNotFound(_0x22239b){return function(_0x2a80c8){if(!_0x2a80c8){_0x22239b[_0x868e('0xf')](0x194);}return _0x2a80c8;};}function handleError(_0x23f0aa,_0x40baf4){_0x40baf4=_0x40baf4||0x1f4;return function(_0x8114f3){logger[_0x868e('0x1c')](_0x8114f3[_0x868e('0x1d')]);if(_0x8114f3[_0x868e('0x1e')]){delete _0x8114f3[_0x868e('0x1e')];}_0x23f0aa['status'](_0x40baf4)[_0x868e('0x1f')](_0x8114f3);};}exports[_0x868e('0x20')]=function(_0x13da9f,_0x6ba6c2){var _0x35be0a={};var _0xa23df8=_[_0x868e('0x21')](db[_0x868e('0x22')][_0x868e('0x23')],function(_0x4be1ee){return{'name':_0x4be1ee['fieldName'],'type':_0x4be1ee[_0x868e('0x24')]['key']};});_0x35be0a=qs['getOptions'](_0xa23df8,_0x13da9f);return interaction['findAll'](_0x868e('0x25'),_0x13da9f['query'],_0x13da9f[_0x868e('0x26')],_0x35be0a,_0xa23df8)['then'](respondWithFilteredResult(_0x6ba6c2,_0x35be0a))[_0x868e('0x27')](handleError(_0x6ba6c2,null));};exports[_0x868e('0x28')]=function(_0x5ad0f8,_0x5a1568){var _0x21fe1b={};if(_0x5ad0f8['query'][_0x868e('0x24')]&&_0x5ad0f8[_0x868e('0x29')][_0x868e('0x24')]===_0x868e('0x2a')){_0x21fe1b['from']=_0x5ad0f8[_0x868e('0x2b')]['id'];}else{_0x21fe1b['id']=_0x5ad0f8['params']['id'];}var _0x111026={'raw':![],'where':_0x21fe1b},_0x2582ed={};_0x2582ed['model']=_['keys'](db[_0x868e('0x22')]['rawAttributes']);_0x2582ed[_0x868e('0x29')]=_[_0x868e('0x2c')](_0x5ad0f8[_0x868e('0x29')]);_0x2582ed[_0x868e('0x2d')]=_[_0x868e('0x2e')](_0x2582ed[_0x868e('0x2f')],_0x2582ed[_0x868e('0x29')]);_0x111026[_0x868e('0x30')]=_['intersection'](_0x2582ed[_0x868e('0x2f')],qs[_0x868e('0x31')](_0x5ad0f8[_0x868e('0x29')]['fields']));_0x111026[_0x868e('0x30')]=_0x111026[_0x868e('0x30')][_0x868e('0x32')]?_0x111026[_0x868e('0x30')]:_0x2582ed[_0x868e('0x2f')];if(_0x5ad0f8['query'][_0x868e('0x33')]){_0x111026[_0x868e('0x34')]=[{'all':!![]}];}_0x111026=_[_0x868e('0x35')]({},_0x111026,_0x5ad0f8[_0x868e('0x36')]);return db[_0x868e('0x22')]['find'](_0x111026)[_0x868e('0x1a')](handleEntityNotFound(_0x5a1568,null))['then'](respondWithResult(_0x5a1568,null))['catch'](handleError(_0x5a1568,null));};exports[_0x868e('0x37')]=function(_0x973b9,_0xf5e2be){return db[_0x868e('0x22')][_0x868e('0x37')](_0x973b9['body'],{})[_0x868e('0x1a')](respondWithResult(_0xf5e2be,0xc9))['catch'](handleError(_0xf5e2be,null));};exports[_0x868e('0x19')]=function(_0x542f74,_0x2ce107){if(_0x542f74[_0x868e('0x38')]['id']){delete _0x542f74[_0x868e('0x38')]['id'];}return db[_0x868e('0x22')][_0x868e('0x39')]({'where':{'id':_0x542f74[_0x868e('0x2b')]['id']}})[_0x868e('0x1a')](handleEntityNotFound(_0x2ce107,null))[_0x868e('0x1a')](saveUpdates(_0x542f74[_0x868e('0x38')],null))[_0x868e('0x1a')](respondWithResult(_0x2ce107,null))[_0x868e('0x27')](handleError(_0x2ce107,null));};exports['destroy']=function(_0x264ad3,_0x485507){return db[_0x868e('0x22')][_0x868e('0x39')]({'where':{'id':_0x264ad3[_0x868e('0x2b')]['id']}})[_0x868e('0x1a')](handleEntityNotFound(_0x485507,null))[_0x868e('0x1a')](removeEntity(_0x485507,null))['catch'](handleError(_0x485507,null));};exports['describe']=function(_0x12a617,_0x109afa){return db[_0x868e('0x22')][_0x868e('0x3a')]()[_0x868e('0x1a')](respondWithResult(_0x109afa,null))[_0x868e('0x27')](handleError(_0x109afa,null));};exports[_0x868e('0x3b')]=function(_0xec95c2,_0xe221cc){return db[_0x868e('0x3c')][_0x868e('0x39')]({'where':{'id':_0xec95c2[_0x868e('0x2b')]['id']}})[_0x868e('0x1a')](handleEntityNotFound(_0xe221cc,null))[_0x868e('0x1a')](function(_0x399fba){if(_0x399fba){return _0x399fba[_0x868e('0x3b')](_0xec95c2[_0x868e('0x38')][_0x868e('0x3d')],_['omit'](_0xec95c2[_0x868e('0x38')],[_0x868e('0x3d'),'id'])||{});}})[_0x868e('0x1a')](respondWithResult(_0xe221cc,null))[_0x868e('0x27')](handleError(_0xe221cc,null));};exports['getMessages']=function(_0x4cfee9,_0x4775fd){var _0x4a0642={'raw':![],'where':{}};var _0x52f279={};var _0x2961f4={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x868e('0x3e')]({'where':{'id':_0x4cfee9[_0x868e('0x2b')]['id']}})[_0x868e('0x1a')](handleEntityNotFound(_0x4775fd,null))[_0x868e('0x1a')](function(_0x2bfeea){if(_0x2bfeea){_0x52f279[_0x868e('0x2f')]=_[_0x868e('0x2c')](db[_0x868e('0x3c')][_0x868e('0x23')]);_0x52f279[_0x868e('0x29')]=_[_0x868e('0x2c')](_0x4cfee9[_0x868e('0x29')]);_0x52f279[_0x868e('0x2d')]=_['intersection'](_0x52f279[_0x868e('0x2f')],_0x52f279[_0x868e('0x29')]);_0x4a0642['attributes']=_[_0x868e('0x2e')](_0x52f279['model'],qs[_0x868e('0x31')](_0x4cfee9[_0x868e('0x29')]['fields']));_0x4a0642[_0x868e('0x30')]=_0x4a0642[_0x868e('0x30')]['length']?_0x4a0642[_0x868e('0x30')]:_0x52f279[_0x868e('0x2f')];if(!_0x4cfee9[_0x868e('0x29')]['hasOwnProperty'](_0x868e('0x3f'))){_0x4a0642[_0x868e('0x16')]=qs[_0x868e('0x16')](_0x4cfee9[_0x868e('0x29')]['limit']);_0x4a0642[_0x868e('0x13')]=qs[_0x868e('0x13')](_0x4cfee9['query'][_0x868e('0x13')]);}_0x4a0642[_0x868e('0x40')]=qs[_0x868e('0x41')](_0x4cfee9['query'][_0x868e('0x41')]);_0x4a0642[_0x868e('0x42')]=qs['filters'](_[_0x868e('0x43')](_0x4cfee9['query'],_0x52f279[_0x868e('0x2d')]));_0x4a0642[_0x868e('0x42')][_0x868e('0x44')]=_0x2bfeea['id'];if(_0x4cfee9[_0x868e('0x29')][_0x868e('0x45')]){_0x4a0642[_0x868e('0x42')]=_[_0x868e('0x35')](_0x4a0642['where'],{'$or':_[_0x868e('0x21')](_0x4a0642[_0x868e('0x30')],function(_0x216029){var _0x1effa2={};_0x1effa2[_0x216029]={'$like':'%'+_0x4cfee9[_0x868e('0x29')][_0x868e('0x45')]+'%'};return _0x1effa2;})});}if(_0x4cfee9[_0x868e('0x29')]['$gte']){var _0x39c935=_0x4cfee9[_0x868e('0x29')][_0x868e('0x46')][_0x868e('0x47')](',');var _0x1cd47d={};_0x1cd47d[_0x39c935[0x0]]={'$gte':moment(_0x39c935[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x4a0642[_0x868e('0x42')]=_[_0x868e('0x35')](_0x4a0642[_0x868e('0x42')],_0x1cd47d);}_0x4a0642=_[_0x868e('0x35')]({},_0x4a0642,_0x4cfee9['options']);return db[_0x868e('0x3c')][_0x868e('0x15')]({'where':_0x4a0642[_0x868e('0x42')]})[_0x868e('0x1a')](function(_0x287938){_0x2961f4[_0x868e('0x15')]=_0x287938;if(_0x4cfee9[_0x868e('0x29')][_0x868e('0x33')]){_0x4a0642[_0x868e('0x34')]=[{'all':!![]}];}return db[_0x868e('0x3c')]['findAll'](_0x4a0642);})[_0x868e('0x1a')](function(_0x59f6f7){_0x2961f4['rows']=_0x59f6f7;return _0x2961f4;});}})['then'](respondWithFilteredResult(_0x4775fd,_0x4a0642))[_0x868e('0x27')](handleError(_0x4775fd,null));};exports[_0x868e('0x48')]=function(_0x2c44ef,_0x3e1c59){return db[_0x868e('0x22')]['find']({'where':{'id':_0x2c44ef[_0x868e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x3e1c59,null))['then'](function(_0x4c797c){if(_0x4c797c){return _0x4c797c[_0x868e('0x49')](_0x2c44ef['body'][_0x868e('0x3d')],_['omit'](_0x2c44ef[_0x868e('0x38')],[_0x868e('0x3d'),'id'])||{})[_0x868e('0x4a')](function(){return db[_0x868e('0x4b')]['findAll']({'attributes':['id',_0x868e('0x1e'),_0x868e('0x4c')],'where':{'id':_0x2c44ef['body'][_0x868e('0x3d')]}});})[_0x868e('0x1a')](function(_0x3032d3){socket[_0x868e('0x4d')](_0x868e('0x4e'),{'id':Number(_0x2c44ef[_0x868e('0x2b')]['id']),'tags':_0x3032d3||[]});return{'id':Number(_0x2c44ef[_0x868e('0x2b')]['id']),'tags':_0x3032d3||[]};});}})[_0x868e('0x1a')](respondWithResult(_0x3e1c59,null))['catch'](handleError(_0x3e1c59,null));};exports[_0x868e('0x4f')]=function(_0x70363e,_0x57a620){return db['OpenchannelInteraction'][_0x868e('0x39')]({'where':{'id':_0x70363e['params']['id']}})[_0x868e('0x1a')](handleEntityNotFound(_0x57a620,null))[_0x868e('0x1a')](function(_0x58463f){if(_0x58463f){return _0x58463f[_0x868e('0x4f')](_0x70363e[_0x868e('0x29')]['ids']);}})[_0x868e('0x1a')](respondWithStatusCode(_0x57a620,null))[_0x868e('0x27')](handleError(_0x57a620,null));};exports['download']=function(_0x6a20f9,_0x3007d0){var _0x118209=moment()[_0x868e('0x50')]()['toString']();var _0x22b58c=path[_0x868e('0x51')](config[_0x868e('0x52')],_0x868e('0x53'),'files',_0x868e('0x54'));var _0x4fc409=path[_0x868e('0x51')](config[_0x868e('0x52')],_0x868e('0x53'),'files',_0x868e('0x55'));var _0x217aeb=path['join'](_0x22b58c,_0x118209);var _0x4f04dc=util[_0x868e('0x56')](_0x868e('0x57'),_0x6a20f9['params']['id'],_0x118209);var _0x222194=path[_0x868e('0x51')](_0x22b58c,_0x4f04dc);var _0x3941ec=[];_0x3941ec[_0x868e('0x58')]({'model':db[_0x868e('0x59')],'as':'User','attributes':['id',_0x868e('0x5a')],'raw':!![]});_0x3941ec[_0x868e('0x58')]({'model':db[_0x868e('0x5b')],'as':_0x868e('0x5c'),'attributes':['id',_0x868e('0x5d'),_0x868e('0x5e')],'raw':!![]});if(_0x6a20f9[_0x868e('0x29')][_0x868e('0x55')]){_0x3941ec['push']({'model':db[_0x868e('0x5f')],'as':'Attachment','raw':!![]});}var _0x3777ed=[{'model':db[_0x868e('0x3c')],'as':'Messages','attributes':['id',_0x868e('0x38'),'createdAt','direction',_0x868e('0x60'),_0x868e('0x61')],'include':_0x3941ec}];_0x3777ed[_0x868e('0x58')]({'model':db['OpenchannelAccount'],'as':_0x868e('0x62'),'attributes':['id',_0x868e('0x1e')]});_0x3777ed[_0x868e('0x58')]({'model':db['User'],'as':_0x868e('0x63'),'attributes':['id',_0x868e('0x5a')]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x6a20f9['params']['id']},'include':_0x3777ed})['then'](handleEntityNotFound(_0x3007d0,null))[_0x868e('0x1a')](function(_0x10d9c8){if(_0x10d9c8){var _0x1f1b26=_0x10d9c8[_0x868e('0x64')]({'plain':!![]});fs[_0x868e('0x65')](_0x217aeb);var _0x2de62b={'channel':_0x868e('0x66'),'account':_0x1f1b26['Account']['name'],'agent':_0x1f1b26[_0x868e('0x63')]?_0x1f1b26[_0x868e('0x63')][_0x868e('0x5a')]:_0x868e('0x67'),'createdAt':moment(_0x1f1b26[_0x868e('0x68')])['format'](_0x868e('0x69'))['toString'](),'closedAt':_0x1f1b26[_0x868e('0x6a')]?moment(_0x1f1b26['closedAt'])['format'](_0x868e('0x69'))['toString']():'','disposition':_0x1f1b26[_0x868e('0x6b')],'visibility':_0x1f1b26[_0x868e('0x6c')]?_0x868e('0x6d'):_0x868e('0x6e'),'messages':_(_0x1f1b26[_0x868e('0x6f')])[_0x868e('0x45')]({'secret':![]})[_0x868e('0x21')](function(_0x12e73c){if(_0x12e73c[_0x868e('0x5f')]){var _0x4804dd=path[_0x868e('0x51')](_0x4fc409,_0x12e73c[_0x868e('0x5f')]['basename']);if(fs['existsSync'](_0x4804dd)){fs[_0x868e('0x70')](_0x4804dd)[_0x868e('0x71')](fs[_0x868e('0x72')](path['join'](_0x217aeb,_0x12e73c[_0x868e('0x5f')][_0x868e('0x73')])));}}return{'date':moment(_0x12e73c['createdAt'])[_0x868e('0x56')](_0x868e('0x69'))[_0x868e('0x74')](),'sender':_0x12e73c[_0x868e('0x75')]===_0x868e('0x76')?_0x12e73c[_0x868e('0x59')]?_0x12e73c[_0x868e('0x59')]['fullname']:_0x868e('0x77'):_0x12e73c['Contact'][_0x868e('0x5d')]+(_0x12e73c[_0x868e('0x5c')][_0x868e('0x5e')]?'\x20'+_0x12e73c['Contact'][_0x868e('0x5e')]:''),'body':_0x12e73c[_0x868e('0x5f')]?_0x12e73c[_0x868e('0x5f')]['basename']:_0x12e73c[_0x868e('0x38')],'direction':_0x12e73c[_0x868e('0x75')]===_0x868e('0x76')?'A':'C','secret':_0x12e73c[_0x868e('0x60')],'read':_0x12e73c[_0x868e('0x61')],'attachment':_0x12e73c[_0x868e('0x5f')]};})[_0x868e('0x78')]()};return ejs[_0x868e('0x79')](path[_0x868e('0x51')](config[_0x868e('0x52')],_0x868e('0x53'),_0x868e('0x7a'),_0x868e('0x7b')),{'interaction':_0x2de62b})[_0x868e('0x1a')](function(_0x1018e2){var _0x48e48d=path['join'](_0x217aeb,'transcript-'+_0x1f1b26['id']+'-'+_0x118209+_0x868e('0x7c'));var _0x29ff0a={'path':_0x48e48d,'channel':_0x868e('0x66'),'interactionId':_0x1f1b26['id']};return pdf[_0x868e('0x7d')](_0x1018e2,_0x29ff0a);})[_0x868e('0x1a')](function(){return new Promise(function(_0x4f22b3,_0xa71e18){zipdir(_0x217aeb,{'saveTo':_0x222194},function(_0x3a9e49,_0x2fb9b5){if(_0x3a9e49)return _0xa71e18(_0x3a9e49);return _0x4f22b3(_0x2fb9b5);});})[_0x868e('0x1a')](function(){return new Promise(function(_0xf9ff79,_0x430055){rimraf(_0x217aeb,function(_0x3ff15e){if(_0x3ff15e)_0x430055(_0x3ff15e);return _0xf9ff79();});});})[_0x868e('0x1a')](function(){return _0x3007d0[_0x868e('0x7e')](_0x222194,_0x4f04dc,function(_0x4a8bc1){if(_0x4a8bc1){logger['error'](_0x868e('0x7f'),_0x4a8bc1);}else{fs[_0x868e('0x80')](_0x222194);}});});});}else{return _0x3007d0[_0x868e('0xf')](0xc8);}})[_0x868e('0x27')](handleError(_0x3007d0,null));};
\ No newline at end of file
+var _0x7fcf=['secret','OpenchannelAccount','Account','get','mkdirSync','Openchannel','Owner','closed','closedAt','threadId','Public','Private','filter','basename','existsSync','createReadStream','pipe','createWriteStream','out','firstName','read','value','renderFile','views','transcript-','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','moment','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./openchannelInteraction.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','json','update','then','destroy','error','stack','name','index','map','rawAttributes','type','key','getOptions','findAll','openchannel','query','user','catch','from','params','model','keys','filters','attributes','fields','includeAll','options','OpenchannelInteraction','create','body','describe','addMessage','OpenchannelMessage','find','ids','omit','getMessages','findOne','intersection','hasOwnProperty','nolimit','sort','pick','where','OpenchannelInteractionId','merge','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','setTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','format','push','User','fullname','CmContact','Contact','lastName','attachments','Attachment','Messages','createdAt','direction'];(function(_0x1850ba,_0x55e013){var _0x2045e8=function(_0x5a5b09){while(--_0x5a5b09){_0x1850ba['push'](_0x1850ba['shift']());}};_0x2045e8(++_0x55e013);}(_0x7fcf,0x127));var _0xf7fc=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x7fcf[_0x3ff085];return _0x2b68c3;};'use strict';var rimraf=require(_0xf7fc('0x0'));var zipdir=require('zip-dir');var moment=require(_0xf7fc('0x1'));var util=require(_0xf7fc('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0xf7fc('0x3'));var Redis=require(_0xf7fc('0x4'));var interaction=require(_0xf7fc('0x5'));var qs=require(_0xf7fc('0x6'));var pdf=require(_0xf7fc('0x7'));var logger=require(_0xf7fc('0x8'))(_0xf7fc('0x9'));var config=require(_0xf7fc('0xa'));var db=require(_0xf7fc('0xb'))['db'];config[_0xf7fc('0xc')]=_[_0xf7fc('0xd')](config[_0xf7fc('0xc')],{'host':_0xf7fc('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf7fc('0xf'))[_0xf7fc('0x10')](socket);function respondWithStatusCode(_0x174cc3,_0x24ae37){_0x24ae37=_0x24ae37||0xcc;return function(_0x263ad4){if(_0x263ad4){return _0x174cc3[_0xf7fc('0x11')](_0x24ae37);}return _0x174cc3[_0xf7fc('0x12')](_0x24ae37)[_0xf7fc('0x13')]();};}function respondWithResult(_0x3d879b,_0xa8f4b6){_0xa8f4b6=_0xa8f4b6||0xc8;return function(_0x1b4d12){if(_0x1b4d12){return _0x3d879b['status'](_0xa8f4b6)['json'](_0x1b4d12);}};}function respondWithFilteredResult(_0x15276b,_0x2ee4bf){return function(_0x1faa10){if(_0x1faa10){var _0x46f012=typeof _0x2ee4bf[_0xf7fc('0x14')]==='undefined'&&typeof _0x2ee4bf[_0xf7fc('0x15')]===_0xf7fc('0x16');var _0x5cf34c=_0x1faa10[_0xf7fc('0x17')];var _0x4b850c=_0x46f012?0x0:_0x2ee4bf[_0xf7fc('0x14')];var _0x5f15ab=_0x46f012?_0x1faa10[_0xf7fc('0x17')]:_0x2ee4bf[_0xf7fc('0x14')]+_0x2ee4bf['limit'];var _0x48ebe1;if(_0x5f15ab>=_0x5cf34c){_0x5f15ab=_0x5cf34c;_0x48ebe1=0xc8;}else{_0x48ebe1=0xce;}_0x15276b[_0xf7fc('0x12')](_0x48ebe1);return _0x15276b[_0xf7fc('0x18')]('Content-Range',_0x4b850c+'-'+_0x5f15ab+'/'+_0x5cf34c)[_0xf7fc('0x19')](_0x1faa10);}return null;};}function saveUpdates(_0x41c2be){return function(_0x580aa6){if(_0x580aa6){return _0x580aa6[_0xf7fc('0x1a')](_0x41c2be)[_0xf7fc('0x1b')](function(_0x459ee4){return _0x459ee4;});}return null;};}function removeEntity(_0x5dcbc7){return function(_0x45f943){if(_0x45f943){return _0x45f943[_0xf7fc('0x1c')]()['then'](function(){_0x5dcbc7[_0xf7fc('0x12')](0xcc)[_0xf7fc('0x13')]();});}};}function handleEntityNotFound(_0x17b0cf){return function(_0x1dfb69){if(!_0x1dfb69){_0x17b0cf[_0xf7fc('0x11')](0x194);}return _0x1dfb69;};}function handleError(_0x3675de,_0x107e91){_0x107e91=_0x107e91||0x1f4;return function(_0x10984a){logger[_0xf7fc('0x1d')](_0x10984a[_0xf7fc('0x1e')]);if(_0x10984a[_0xf7fc('0x1f')]){delete _0x10984a[_0xf7fc('0x1f')];}_0x3675de['status'](_0x107e91)['send'](_0x10984a);};}exports[_0xf7fc('0x20')]=function(_0x5858fe,_0x9ea469){var _0x5c5a5e={};var _0x36bb2c=_[_0xf7fc('0x21')](db['OpenchannelInteraction'][_0xf7fc('0x22')],function(_0x1312f){return{'name':_0x1312f['fieldName'],'type':_0x1312f[_0xf7fc('0x23')][_0xf7fc('0x24')]};});_0x5c5a5e=qs[_0xf7fc('0x25')](_0x36bb2c,_0x5858fe);return interaction[_0xf7fc('0x26')](_0xf7fc('0x27'),_0x5858fe[_0xf7fc('0x28')],_0x5858fe[_0xf7fc('0x29')],_0x5c5a5e,_0x36bb2c)['then'](respondWithFilteredResult(_0x9ea469,_0x5c5a5e))[_0xf7fc('0x2a')](handleError(_0x9ea469,null));};exports['show']=function(_0x458cc8,_0xd73315){var _0x4c674f={};if(_0x458cc8[_0xf7fc('0x28')][_0xf7fc('0x23')]&&_0x458cc8[_0xf7fc('0x28')]['type']===_0xf7fc('0x2b')){_0x4c674f['from']=_0x458cc8[_0xf7fc('0x2c')]['id'];}else{_0x4c674f['id']=_0x458cc8[_0xf7fc('0x2c')]['id'];}var _0x20d3a7={'raw':![],'where':_0x4c674f},_0x38ed54={};_0x38ed54[_0xf7fc('0x2d')]=_[_0xf7fc('0x2e')](db['OpenchannelInteraction']['rawAttributes']);_0x38ed54[_0xf7fc('0x28')]=_[_0xf7fc('0x2e')](_0x458cc8[_0xf7fc('0x28')]);_0x38ed54[_0xf7fc('0x2f')]=_['intersection'](_0x38ed54[_0xf7fc('0x2d')],_0x38ed54[_0xf7fc('0x28')]);_0x20d3a7[_0xf7fc('0x30')]=_['intersection'](_0x38ed54[_0xf7fc('0x2d')],qs[_0xf7fc('0x31')](_0x458cc8['query'][_0xf7fc('0x31')]));_0x20d3a7[_0xf7fc('0x30')]=_0x20d3a7[_0xf7fc('0x30')]['length']?_0x20d3a7[_0xf7fc('0x30')]:_0x38ed54[_0xf7fc('0x2d')];if(_0x458cc8[_0xf7fc('0x28')][_0xf7fc('0x32')]){_0x20d3a7['include']=[{'all':!![]}];}_0x20d3a7=_['merge']({},_0x20d3a7,_0x458cc8[_0xf7fc('0x33')]);return db[_0xf7fc('0x34')]['find'](_0x20d3a7)[_0xf7fc('0x1b')](handleEntityNotFound(_0xd73315,null))[_0xf7fc('0x1b')](respondWithResult(_0xd73315,null))[_0xf7fc('0x2a')](handleError(_0xd73315,null));};exports[_0xf7fc('0x35')]=function(_0x211c05,_0x1f28a5){return db[_0xf7fc('0x34')][_0xf7fc('0x35')](_0x211c05[_0xf7fc('0x36')],{})[_0xf7fc('0x1b')](respondWithResult(_0x1f28a5,0xc9))[_0xf7fc('0x2a')](handleError(_0x1f28a5,null));};exports[_0xf7fc('0x1a')]=function(_0x30df59,_0xc2f857){if(_0x30df59[_0xf7fc('0x36')]['id']){delete _0x30df59['body']['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0x30df59['params']['id']}})['then'](handleEntityNotFound(_0xc2f857,null))[_0xf7fc('0x1b')](saveUpdates(_0x30df59[_0xf7fc('0x36')],null))[_0xf7fc('0x1b')](respondWithResult(_0xc2f857,null))[_0xf7fc('0x2a')](handleError(_0xc2f857,null));};exports[_0xf7fc('0x1c')]=function(_0x2ab01f,_0x46809f){return db[_0xf7fc('0x34')]['find']({'where':{'id':_0x2ab01f['params']['id']}})[_0xf7fc('0x1b')](handleEntityNotFound(_0x46809f,null))[_0xf7fc('0x1b')](removeEntity(_0x46809f,null))[_0xf7fc('0x2a')](handleError(_0x46809f,null));};exports[_0xf7fc('0x37')]=function(_0x456dd8,_0x19b6b3){return db['OpenchannelInteraction'][_0xf7fc('0x37')]()[_0xf7fc('0x1b')](respondWithResult(_0x19b6b3,null))[_0xf7fc('0x2a')](handleError(_0x19b6b3,null));};exports[_0xf7fc('0x38')]=function(_0x76d75,_0x4c53bb){return db[_0xf7fc('0x39')][_0xf7fc('0x3a')]({'where':{'id':_0x76d75[_0xf7fc('0x2c')]['id']}})[_0xf7fc('0x1b')](handleEntityNotFound(_0x4c53bb,null))[_0xf7fc('0x1b')](function(_0x34b9ec){if(_0x34b9ec){return _0x34b9ec['addMessage'](_0x76d75[_0xf7fc('0x36')][_0xf7fc('0x3b')],_[_0xf7fc('0x3c')](_0x76d75[_0xf7fc('0x36')],['ids','id'])||{});}})[_0xf7fc('0x1b')](respondWithResult(_0x4c53bb,null))[_0xf7fc('0x2a')](handleError(_0x4c53bb,null));};exports[_0xf7fc('0x3d')]=function(_0x4f861a,_0x36aa36){var _0x558161={'raw':![],'where':{}};var _0xc4442a={};var _0x342d26={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0xf7fc('0x3e')]({'where':{'id':_0x4f861a[_0xf7fc('0x2c')]['id']}})[_0xf7fc('0x1b')](handleEntityNotFound(_0x36aa36,null))[_0xf7fc('0x1b')](function(_0x2e9c9c){if(_0x2e9c9c){_0xc4442a[_0xf7fc('0x2d')]=_[_0xf7fc('0x2e')](db[_0xf7fc('0x39')][_0xf7fc('0x22')]);_0xc4442a['query']=_['keys'](_0x4f861a[_0xf7fc('0x28')]);_0xc4442a[_0xf7fc('0x2f')]=_[_0xf7fc('0x3f')](_0xc4442a[_0xf7fc('0x2d')],_0xc4442a[_0xf7fc('0x28')]);_0x558161[_0xf7fc('0x30')]=_[_0xf7fc('0x3f')](_0xc4442a[_0xf7fc('0x2d')],qs[_0xf7fc('0x31')](_0x4f861a['query'][_0xf7fc('0x31')]));_0x558161['attributes']=_0x558161[_0xf7fc('0x30')]['length']?_0x558161['attributes']:_0xc4442a[_0xf7fc('0x2d')];if(!_0x4f861a[_0xf7fc('0x28')][_0xf7fc('0x40')](_0xf7fc('0x41'))){_0x558161[_0xf7fc('0x15')]=qs[_0xf7fc('0x15')](_0x4f861a[_0xf7fc('0x28')]['limit']);_0x558161[_0xf7fc('0x14')]=qs[_0xf7fc('0x14')](_0x4f861a[_0xf7fc('0x28')][_0xf7fc('0x14')]);}_0x558161['order']=qs[_0xf7fc('0x42')](_0x4f861a[_0xf7fc('0x28')][_0xf7fc('0x42')]);_0x558161['where']=qs[_0xf7fc('0x2f')](_[_0xf7fc('0x43')](_0x4f861a[_0xf7fc('0x28')],_0xc4442a[_0xf7fc('0x2f')]));_0x558161[_0xf7fc('0x44')][_0xf7fc('0x45')]=_0x2e9c9c['id'];if(_0x4f861a['query']['filter']){_0x558161[_0xf7fc('0x44')]=_[_0xf7fc('0x46')](_0x558161[_0xf7fc('0x44')],{'$or':_[_0xf7fc('0x21')](_0x558161[_0xf7fc('0x30')],function(_0x23e6f6){var _0x5d31aa={};_0x5d31aa[_0x23e6f6]={'$like':'%'+_0x4f861a[_0xf7fc('0x28')]['filter']+'%'};return _0x5d31aa;})});}if(_0x4f861a[_0xf7fc('0x28')][_0xf7fc('0x47')]){var _0x97c01c=_0x4f861a[_0xf7fc('0x28')]['$gte'][_0xf7fc('0x48')](',');var _0x7b8cc0={};_0x7b8cc0[_0x97c01c[0x0]]={'$gte':moment(_0x97c01c[0x1])['format'](_0xf7fc('0x49'))};_0x558161[_0xf7fc('0x44')]=_[_0xf7fc('0x46')](_0x558161[_0xf7fc('0x44')],_0x7b8cc0);}_0x558161=_[_0xf7fc('0x46')]({},_0x558161,_0x4f861a[_0xf7fc('0x33')]);return db['OpenchannelMessage'][_0xf7fc('0x17')]({'where':_0x558161['where']})[_0xf7fc('0x1b')](function(_0x44675f){_0x342d26[_0xf7fc('0x17')]=_0x44675f;if(_0x4f861a['query'][_0xf7fc('0x32')]){_0x558161[_0xf7fc('0x4a')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xf7fc('0x26')](_0x558161);})[_0xf7fc('0x1b')](function(_0x29e076){_0x342d26[_0xf7fc('0x4b')]=_0x29e076;return _0x342d26;});}})[_0xf7fc('0x1b')](respondWithFilteredResult(_0x36aa36,_0x558161))['catch'](handleError(_0x36aa36,null));};exports[_0xf7fc('0x4c')]=function(_0x35b71c,_0x285718){return db['OpenchannelInteraction'][_0xf7fc('0x3a')]({'where':{'id':_0x35b71c[_0xf7fc('0x2c')]['id']}})['then'](handleEntityNotFound(_0x285718,null))[_0xf7fc('0x1b')](function(_0x3e7e37){if(_0x3e7e37){return _0x3e7e37[_0xf7fc('0x4d')](_0x35b71c[_0xf7fc('0x36')][_0xf7fc('0x3b')],_['omit'](_0x35b71c[_0xf7fc('0x36')],[_0xf7fc('0x3b'),'id'])||{})[_0xf7fc('0x4e')](function(){return db[_0xf7fc('0x4f')][_0xf7fc('0x26')]({'attributes':['id',_0xf7fc('0x1f'),_0xf7fc('0x50')],'where':{'id':_0x35b71c[_0xf7fc('0x36')]['ids']}});})[_0xf7fc('0x1b')](function(_0x29456a){socket[_0xf7fc('0x51')](_0xf7fc('0x52'),{'id':Number(_0x35b71c[_0xf7fc('0x2c')]['id']),'tags':_0x29456a||[]});return{'id':Number(_0x35b71c[_0xf7fc('0x2c')]['id']),'tags':_0x29456a||[]};});}})[_0xf7fc('0x1b')](respondWithResult(_0x285718,null))['catch'](handleError(_0x285718,null));};exports[_0xf7fc('0x53')]=function(_0x4d9e62,_0x104f3d){return db['OpenchannelInteraction'][_0xf7fc('0x3a')]({'where':{'id':_0x4d9e62[_0xf7fc('0x2c')]['id']}})[_0xf7fc('0x1b')](handleEntityNotFound(_0x104f3d,null))['then'](function(_0xaeab23){if(_0xaeab23){return _0xaeab23['removeTags'](_0x4d9e62[_0xf7fc('0x28')]['ids']);}})['then'](respondWithStatusCode(_0x104f3d,null))[_0xf7fc('0x2a')](handleError(_0x104f3d,null));};exports[_0xf7fc('0x54')]=function(_0x1e92bf,_0x381e56){var _0x281e6a=moment()[_0xf7fc('0x55')]()[_0xf7fc('0x56')]();var _0x53a606=path[_0xf7fc('0x57')](config[_0xf7fc('0x58')],_0xf7fc('0x59'),_0xf7fc('0x5a'),_0xf7fc('0x5b'));var _0x358117=path[_0xf7fc('0x57')](config[_0xf7fc('0x58')],_0xf7fc('0x59'),_0xf7fc('0x5a'),'attachments');var _0x59c086=path[_0xf7fc('0x57')](_0x53a606,_0x281e6a);var _0x427485=util[_0xf7fc('0x5c')]('transcript-%d-%s.zip',_0x1e92bf[_0xf7fc('0x2c')]['id'],_0x281e6a);var _0x4556c7=path[_0xf7fc('0x57')](_0x53a606,_0x427485);var _0x31a8da=[];_0x31a8da[_0xf7fc('0x5d')]({'model':db['User'],'as':_0xf7fc('0x5e'),'attributes':['id',_0xf7fc('0x5f')],'raw':!![]});_0x31a8da[_0xf7fc('0x5d')]({'model':db[_0xf7fc('0x60')],'as':_0xf7fc('0x61'),'attributes':['id','firstName',_0xf7fc('0x62')],'raw':!![]});if(_0x1e92bf['query'][_0xf7fc('0x63')]){_0x31a8da['push']({'model':db[_0xf7fc('0x64')],'as':_0xf7fc('0x64'),'raw':!![]});}var _0x13cfb7=[{'model':db[_0xf7fc('0x39')],'as':_0xf7fc('0x65'),'attributes':['id',_0xf7fc('0x36'),_0xf7fc('0x66'),_0xf7fc('0x67'),_0xf7fc('0x68'),'read'],'include':_0x31a8da}];_0x13cfb7[_0xf7fc('0x5d')]({'model':db[_0xf7fc('0x69')],'as':_0xf7fc('0x6a'),'attributes':['id',_0xf7fc('0x1f')]});_0x13cfb7[_0xf7fc('0x5d')]({'model':db['User'],'as':'Owner','attributes':['id',_0xf7fc('0x5f')]});return db['OpenchannelInteraction'][_0xf7fc('0x3a')]({'where':{'id':_0x1e92bf['params']['id']},'include':_0x13cfb7})['then'](handleEntityNotFound(_0x381e56,null))['then'](function(_0xb75a40){if(_0xb75a40){var _0x319b67=_0xb75a40[_0xf7fc('0x6b')]({'plain':!![]});fs[_0xf7fc('0x6c')](_0x59c086);var _0x97a587={'channel':_0xf7fc('0x6d'),'account':_0x319b67['Account'][_0xf7fc('0x1f')],'agent':_0x319b67[_0xf7fc('0x6e')]?_0x319b67[_0xf7fc('0x6e')][_0xf7fc('0x5f')]:'N.A.','createdAt':moment(_0x319b67[_0xf7fc('0x66')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xf7fc('0x56')](),'closedAt':_0x319b67[_0xf7fc('0x6f')]?moment(_0x319b67[_0xf7fc('0x70')])[_0xf7fc('0x5c')](_0xf7fc('0x49'))[_0xf7fc('0x56')]():'','disposition':_0x319b67['disposition'],'visibility':_0x319b67[_0xf7fc('0x71')]?_0xf7fc('0x72'):_0xf7fc('0x73'),'messages':_(_0x319b67[_0xf7fc('0x65')])[_0xf7fc('0x74')]({'secret':![]})['map'](function(_0x15cb96){if(_0x15cb96[_0xf7fc('0x64')]){var _0x40f010=path['join'](_0x358117,_0x15cb96[_0xf7fc('0x64')][_0xf7fc('0x75')]);if(fs[_0xf7fc('0x76')](_0x40f010)){fs[_0xf7fc('0x77')](_0x40f010)[_0xf7fc('0x78')](fs[_0xf7fc('0x79')](path[_0xf7fc('0x57')](_0x59c086,_0x15cb96['Attachment'][_0xf7fc('0x75')])));}}return{'date':moment(_0x15cb96[_0xf7fc('0x66')])['format'](_0xf7fc('0x49'))['toString'](),'sender':_0x15cb96[_0xf7fc('0x67')]===_0xf7fc('0x7a')?_0x15cb96[_0xf7fc('0x5e')]?_0x15cb96[_0xf7fc('0x5e')][_0xf7fc('0x5f')]:'System':_0x15cb96[_0xf7fc('0x61')][_0xf7fc('0x7b')]+(_0x15cb96[_0xf7fc('0x61')][_0xf7fc('0x62')]?'\x20'+_0x15cb96['Contact'][_0xf7fc('0x62')]:''),'body':_0x15cb96[_0xf7fc('0x64')]?_0x15cb96[_0xf7fc('0x64')][_0xf7fc('0x75')]:_0x15cb96[_0xf7fc('0x36')],'direction':_0x15cb96['direction']===_0xf7fc('0x7a')?'A':'C','secret':_0x15cb96[_0xf7fc('0x68')],'read':_0x15cb96[_0xf7fc('0x7c')],'attachment':_0x15cb96[_0xf7fc('0x64')]};})[_0xf7fc('0x7d')]()};return ejs[_0xf7fc('0x7e')](path[_0xf7fc('0x57')](config[_0xf7fc('0x58')],_0xf7fc('0x59'),_0xf7fc('0x7f'),'downloadInteraction.ejs'),{'interaction':_0x97a587})[_0xf7fc('0x1b')](function(_0x4dc1a8){var _0xb30496=path[_0xf7fc('0x57')](_0x59c086,_0xf7fc('0x80')+_0x319b67['id']+'-'+_0x281e6a+_0xf7fc('0x81'));var _0xc30c33={'path':_0xb30496,'channel':_0xf7fc('0x6d'),'interactionId':_0x319b67['id']};return pdf[_0xf7fc('0x82')](_0x4dc1a8,_0xc30c33);})[_0xf7fc('0x1b')](function(){return new Promise(function(_0xa31d43,_0x624f53){zipdir(_0x59c086,{'saveTo':_0x4556c7},function(_0x31b209,_0x25f217){if(_0x31b209)return _0x624f53(_0x31b209);return _0xa31d43(_0x25f217);});})['then'](function(){return new Promise(function(_0x24edd6,_0x4086be){rimraf(_0x59c086,function(_0x9aeabc){if(_0x9aeabc)_0x4086be(_0x9aeabc);return _0x24edd6();});});})[_0xf7fc('0x1b')](function(){return _0x381e56[_0xf7fc('0x54')](_0x4556c7,_0x427485,function(_0x42fcdd){if(_0x42fcdd){logger[_0xf7fc('0x1d')](_0xf7fc('0x83'),_0x42fcdd);}else{fs[_0xf7fc('0x84')](_0x4556c7);}});});});}else{return _0x381e56[_0xf7fc('0x11')](0xc8);}})['catch'](handleError(_0x381e56,null));};
\ No newline at end of file
index f138603..ca1bdf8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe74a=['setDataValue','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','remove','then'];(function(_0x515add,_0x5a0051){var _0x344e99=function(_0x3de1af){while(--_0x3de1af){_0x515add['push'](_0x515add['shift']());}};_0x344e99(++_0x5a0051);}(_0xe74a,0x156));var _0xae74=function(_0x1d6a82,_0x37c315){_0x1d6a82=_0x1d6a82-0x0;var _0x5834ac=_0xe74a[_0x1d6a82];return _0x5834ac;};'use strict';var EventEmitter=require(_0xae74('0x0'));var OpenchannelInteraction=require(_0xae74('0x1'))['db'][_0xae74('0x2')];var OpenchannelMessage=require(_0xae74('0x1'))['db'][_0xae74('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xae74('0x4')](0x0);var events={'afterCreate':_0xae74('0x5'),'afterUpdate':'update','afterDestroy':_0xae74('0x6')};function emitEvent(_0x1f80e4){return function(_0x3c63a1,_0x3ea989,_0x55876f){_0x3c63a1['getUsers']({'attributes':['id'],'raw':!![]})[_0xae74('0x7')](function(_0x5f3ed0){_0x3c63a1['setDataValue']('Users',_0x5f3ed0['map'](function(_0x494ce1){return{'id':_0x494ce1['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x3c63a1['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x255e5b){_0x3c63a1[_0xae74('0x8')]('unreadMessages',_0x255e5b[_0xae74('0x9')]);OpenchannelInteractionEvents[_0xae74('0xa')](_0x1f80e4+':'+_0x3c63a1['id'],_0x3c63a1);OpenchannelInteractionEvents[_0xae74('0xa')](_0x1f80e4,_0x3c63a1);_0x55876f(null);})[_0xae74('0xb')](_0x55876f(null));};}for(var e in events){if(events[_0xae74('0xc')](e)){var event=events[e];OpenchannelInteraction[_0xae74('0xd')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0xcd67=['hasOwnProperty','exports','events','save','update','remove','setDataValue','map','findAll','then','length','emit'];(function(_0x48ec84,_0x5a097f){var _0x240337=function(_0x41a58f){while(--_0x41a58f){_0x48ec84['push'](_0x48ec84['shift']());}};_0x240337(++_0x5a097f);}(_0xcd67,0x19a));var _0x7cd6=function(_0x1b93f4,_0x475845){_0x1b93f4=_0x1b93f4-0x0;var _0x12e94d=_0xcd67[_0x1b93f4];return _0x12e94d;};'use strict';var EventEmitter=require(_0x7cd6('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7cd6('0x1'),'afterUpdate':_0x7cd6('0x2'),'afterDestroy':_0x7cd6('0x3')};function emitEvent(_0x38f7c5){return function(_0xb5b939,_0x12019d,_0x4053fd){_0xb5b939['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x2d8b3a){_0xb5b939[_0x7cd6('0x4')]('Users',_0x2d8b3a[_0x7cd6('0x5')](function(_0x13bd72){return{'id':_0x13bd72['id']};}));return OpenchannelMessage[_0x7cd6('0x6')]({'where':{'OpenchannelInteractionId':_0xb5b939['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7cd6('0x7')](function(_0x439dea){_0xb5b939[_0x7cd6('0x4')]('unreadMessages',_0x439dea[_0x7cd6('0x8')]);OpenchannelInteractionEvents[_0x7cd6('0x9')](_0x38f7c5+':'+_0xb5b939['id'],_0xb5b939);OpenchannelInteractionEvents[_0x7cd6('0x9')](_0x38f7c5,_0xb5b939);_0x4053fd(null);})['catch'](_0x4053fd(null));};}for(var e in events){if(events[_0x7cd6('0xa')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x7cd6('0xb')]=OpenchannelInteractionEvents;
\ No newline at end of file
index cf4b443..759c805 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e7e=['format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','bluebird','path','rimraf','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt'];(function(_0x515227,_0x342e4e){var _0xa20618=function(_0x94fd3f){while(--_0x94fd3f){_0x515227['push'](_0x515227['shift']());}};_0xa20618(++_0x342e4e);}(_0x2e7e,0xce));var _0xe2e7=function(_0x34a56d,_0x346c56){_0x34a56d=_0x34a56d-0x0;var _0x47d0a7=_0x2e7e[_0x34a56d];return _0x47d0a7;};'use strict';var _=require('lodash');var util=require(_0xe2e7('0x0'));var logger=require(_0xe2e7('0x1'))(_0xe2e7('0x2'));var moment=require('moment');var BPromise=require(_0xe2e7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe2e7('0x4'));var rimraf=require(_0xe2e7('0x5'));var config=require('../../config/environment');var attributes=require(_0xe2e7('0x6'));module[_0xe2e7('0x7')]=function(_0x286698,_0x2aa7bb){return _0x286698[_0xe2e7('0x8')](_0xe2e7('0x9'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe2e7('0xa'),'collate':_0xe2e7('0xb'),'hooks':{'beforeUpdate':function(_0x312fd7,_0x35956d,_0x3614d3){if(_0x312fd7[_0xe2e7('0xc')](_0xe2e7('0xd'))){_0x312fd7[_0xe2e7('0xe')]=moment()[_0xe2e7('0xf')](_0xe2e7('0x10'));}_0x3614d3(null,_0x312fd7);}}});};
\ No newline at end of file
+var _0x1636=['OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','bluebird','request-promise','../../config/environment','./openchannelInteraction.attributes','exports','define'];(function(_0x10fb40,_0x2a14e2){var _0x7fd65=function(_0x35d6ae){while(--_0x35d6ae){_0x10fb40['push'](_0x10fb40['shift']());}};_0x7fd65(++_0x2a14e2);}(_0x1636,0x1b1));var _0x6163=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1636[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x6163('0x0'));var util=require('util');var logger=require(_0x6163('0x1'))('api');var moment=require(_0x6163('0x2'));var BPromise=require(_0x6163('0x3'));var rp=require(_0x6163('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6163('0x5'));var attributes=require(_0x6163('0x6'));module[_0x6163('0x7')]=function(_0x5a2fb2,_0x3bc1fa){return _0x5a2fb2[_0x6163('0x8')](_0x6163('0x9'),attributes,{'tableName':_0x6163('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6163('0xb'),'collate':_0x6163('0xc'),'hooks':{'beforeUpdate':function(_0x539404,_0x2b26ae,_0x203021){if(_0x539404[_0x6163('0xd')]('closed')){_0x539404[_0x6163('0xe')]=moment()[_0x6163('0xf')](_0x6163('0x10'));}_0x203021(null,_0x539404);}}});};
\ No newline at end of file
index b65522c..60d23bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x584a=['info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','OpenchannelInteraction','update','body','options','where','attributes','limit','UpdateOpenchannelInteraction','stringify','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','register','request','then'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x584a,0x95));var _0xa584=function(_0x389318,_0x13a53d){_0x389318=_0x389318-0x0;var _0x7919e3=_0x584a[_0x389318];return _0x7919e3;};'use strict';var _=require('lodash');var util=require(_0xa584('0x0'));var moment=require(_0xa584('0x1'));var BPromise=require(_0xa584('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa584('0x3'));var db=require(_0xa584('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa584('0x5'));var config=require(_0xa584('0x6'));var jayson=require(_0xa584('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xa584('0x8')]=_[_0xa584('0x9')](config[_0xa584('0x8')],{'host':_0xa584('0xa'),'port':0x18eb});var socket=require(_0xa584('0xb'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0xa584('0xc')](socket);function respondWithRpcPromise(_0x268f72,_0x4b70d3,_0x255f8a){return new BPromise(function(_0x570e72,_0x568401){return client[_0xa584('0xd')](_0x268f72,_0x255f8a)[_0xa584('0xe')](function(_0x1cbb9a){logger[_0xa584('0xf')](_0xa584('0x10'),_0x4b70d3,'request\x20sent');logger[_0xa584('0x11')](_0xa584('0x12'),_0x4b70d3,_0xa584('0x13'),JSON['stringify'](_0x1cbb9a));if(_0x1cbb9a['error']){if(_0x1cbb9a[_0xa584('0x14')][_0xa584('0x15')]===0x1f4){logger[_0xa584('0x14')](_0xa584('0x10'),_0x4b70d3,_0x1cbb9a['error']['message']);return _0x568401(_0x1cbb9a[_0xa584('0x14')][_0xa584('0x16')]);}logger[_0xa584('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0x4b70d3,_0x1cbb9a['error'][_0xa584('0x16')]);return _0x570e72(_0x1cbb9a['error'][_0xa584('0x16')]);}else{logger[_0xa584('0xf')](_0xa584('0x10'),_0x4b70d3,'request\x20sent');_0x570e72(_0x1cbb9a[_0xa584('0x17')][_0xa584('0x16')]);}})[_0xa584('0x18')](function(_0x2e3394){logger[_0xa584('0x14')](_0xa584('0x10'),_0x4b70d3,_0x2e3394);_0x568401(_0x2e3394);});});}exports['UpdateOpenchannelInteraction']=function(_0x1919f6){var _0x3f02b3=this;return new Promise(function(_0x204134,_0x39b426){return db[_0xa584('0x19')][_0xa584('0x1a')](_0x1919f6[_0xa584('0x1b')],{'raw':_0x1919f6[_0xa584('0x1c')]?_0x1919f6[_0xa584('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1919f6[_0xa584('0x1c')]?_0x1919f6[_0xa584('0x1c')][_0xa584('0x1d')]||null:null,'attributes':_0x1919f6[_0xa584('0x1c')]?_0x1919f6['options'][_0xa584('0x1e')]||null:null,'limit':_0x1919f6[_0xa584('0x1c')]?_0x1919f6['options'][_0xa584('0x1f')]||null:null})[_0xa584('0xe')](function(_0x102539){logger[_0xa584('0xf')](_0xa584('0x20'),_0x1919f6);logger['debug'](_0xa584('0x20'),_0x1919f6,JSON[_0xa584('0x21')](_0x102539));_0x204134(_0x102539);})[_0xa584('0x18')](function(_0x425b45){logger[_0xa584('0x14')](_0xa584('0x20'),_0x425b45[_0xa584('0x16')],_0x1919f6);_0x39b426(_0x3f02b3[_0xa584('0x14')](0x1f4,_0x425b45[_0xa584('0x16')]));});});};exports[_0xa584('0x22')]=function(_0x3d721b){return new Promise(function(_0x3f685,_0x3e58b9){return db[_0xa584('0x19')][_0xa584('0x23')]({'where':_0x3d721b['options']?_0x3d721b['options'][_0xa584('0x1d')]||null:null})['then'](function(_0x206879){if(_0x206879){return _0x206879[_0xa584('0x24')](_0x3d721b[_0xa584('0x1b')][_0xa584('0x25')],_[_0xa584('0x26')](_0x3d721b['body'],[_0xa584('0x25'),'id'])||{});}})[_0xa584('0x27')](function(_0x48ebf6){logger[_0xa584('0xf')]('AddTags',_0x3d721b);logger[_0xa584('0x11')](_0xa584('0x28'),_0x3d721b,JSON['stringify'](_0x48ebf6));_0x3f685(_0x48ebf6);})[_0xa584('0x18')](function(_0x4503dd){logger['error'](_0xa584('0x28'),_0x4503dd[_0xa584('0x16')],_0x3d721b);_0x3e58b9(_this[_0xa584('0x14')](0x1f4,_0x4503dd[_0xa584('0x16')]));});});};
\ No newline at end of file
+var _0xd916=['../../config/environment','client','http','redis','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','where','attributes','stringify','catch','AddTagsToOpenchannelInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','ioredis','../../config/logger','rpc'];(function(_0xc7c65f,_0x595ff3){var _0x24894f=function(_0x402776){while(--_0x402776){_0xc7c65f['push'](_0xc7c65f['shift']());}};_0x24894f(++_0x595ff3);}(_0xd916,0x72));var _0x6d91=function(_0x4e214a,_0x29ca86){_0x4e214a=_0x4e214a-0x0;var _0x48fb72=_0xd916[_0x4e214a];return _0x48fb72;};'use strict';var _=require(_0x6d91('0x0'));var util=require('util');var moment=require(_0x6d91('0x1'));var BPromise=require(_0x6d91('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d91('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6d91('0x4'))(_0x6d91('0x5'));var config=require(_0x6d91('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6d91('0x7')][_0x6d91('0x8')]({'port':0x232a});config[_0x6d91('0x9')]=_['defaults'](config[_0x6d91('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x6d91('0xa'))(new Redis(config[_0x6d91('0x9')]));require(_0x6d91('0xb'))[_0x6d91('0xc')](socket);function respondWithRpcPromise(_0x1169ba,_0x1925d1,_0x468254){return new BPromise(function(_0x280d7a,_0x3dfa20){return client[_0x6d91('0xd')](_0x1169ba,_0x468254)[_0x6d91('0xe')](function(_0x4fff29){logger[_0x6d91('0xf')](_0x6d91('0x10'),_0x1925d1,_0x6d91('0x11'));logger[_0x6d91('0x12')](_0x6d91('0x13'),_0x1925d1,_0x6d91('0x11'),JSON['stringify'](_0x4fff29));if(_0x4fff29[_0x6d91('0x14')]){if(_0x4fff29[_0x6d91('0x14')][_0x6d91('0x15')]===0x1f4){logger[_0x6d91('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1925d1,_0x4fff29[_0x6d91('0x14')][_0x6d91('0x16')]);return _0x3dfa20(_0x4fff29['error'][_0x6d91('0x16')]);}logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x1925d1,_0x4fff29[_0x6d91('0x14')][_0x6d91('0x16')]);return _0x280d7a(_0x4fff29[_0x6d91('0x14')]['message']);}else{logger[_0x6d91('0xf')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1925d1,_0x6d91('0x11'));_0x280d7a(_0x4fff29[_0x6d91('0x17')][_0x6d91('0x16')]);}})['catch'](function(_0x1a5249){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x1925d1,_0x1a5249);_0x3dfa20(_0x1a5249);});});}exports[_0x6d91('0x18')]=function(_0x38be13){var _0x26696e=this;return new Promise(function(_0x19a049,_0x2b2f0f){return db[_0x6d91('0x19')][_0x6d91('0x1a')](_0x38be13['body'],{'raw':_0x38be13['options']?_0x38be13[_0x6d91('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38be13[_0x6d91('0x1b')]?_0x38be13[_0x6d91('0x1b')][_0x6d91('0x1c')]||null:null,'attributes':_0x38be13[_0x6d91('0x1b')]?_0x38be13[_0x6d91('0x1b')][_0x6d91('0x1d')]||null:null,'limit':_0x38be13['options']?_0x38be13[_0x6d91('0x1b')]['limit']||null:null})[_0x6d91('0xe')](function(_0x3069a4){logger[_0x6d91('0xf')](_0x6d91('0x18'),_0x38be13);logger['debug'](_0x6d91('0x18'),_0x38be13,JSON[_0x6d91('0x1e')](_0x3069a4));_0x19a049(_0x3069a4);})[_0x6d91('0x1f')](function(_0x2c670a){logger[_0x6d91('0x14')](_0x6d91('0x18'),_0x2c670a['message'],_0x38be13);_0x2b2f0f(_0x26696e[_0x6d91('0x14')](0x1f4,_0x2c670a['message']));});});};exports[_0x6d91('0x20')]=function(_0x39204d){return new Promise(function(_0x5b5dc2,_0x2e835d){return db[_0x6d91('0x19')][_0x6d91('0x21')]({'where':_0x39204d[_0x6d91('0x1b')]?_0x39204d[_0x6d91('0x1b')][_0x6d91('0x1c')]||null:null})['then'](function(_0x4bd70e){if(_0x4bd70e){return _0x4bd70e[_0x6d91('0x22')](_0x39204d[_0x6d91('0x23')][_0x6d91('0x24')],_[_0x6d91('0x25')](_0x39204d['body'],[_0x6d91('0x24'),'id'])||{});}})[_0x6d91('0x26')](function(_0x3e7a5d){logger[_0x6d91('0xf')](_0x6d91('0x27'),_0x39204d);logger[_0x6d91('0x12')](_0x6d91('0x27'),_0x39204d,JSON[_0x6d91('0x1e')](_0x3e7a5d));_0x5b5dc2(_0x3e7a5d);})[_0x6d91('0x1f')](function(_0x52155a){logger['error'](_0x6d91('0x27'),_0x52155a['message'],_0x39204d);_0x2e835d(_this['error'](0x1f4,_0x52155a[_0x6d91('0x16')]));});});};
\ No newline at end of file
index 699cc9a..38d8637 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59e5=['remove','update','emit','removeListener','length','openchannelInteraction:','save'];(function(_0x1812a7,_0xd225a3){var _0x217865=function(_0x3a343e){while(--_0x3a343e){_0x1812a7['push'](_0x1812a7['shift']());}};_0x217865(++_0xd225a3);}(_0x59e5,0x1e2));var _0x559e=function(_0x299c51,_0x339760){_0x299c51=_0x299c51-0x0;var _0x322925=_0x59e5[_0x299c51];return _0x322925;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x559e('0x0'),_0x559e('0x1'),_0x559e('0x2')];function createListener(_0x2d50a5,_0x429609){return function(_0x12535c){_0x429609[_0x559e('0x3')](_0x2d50a5,_0x12535c);};}function removeListener(_0x38adcb,_0x3b5c12){return function(){OpenchannelInteractionEvents[_0x559e('0x4')](_0x38adcb,_0x3b5c12);};}exports['register']=function(_0xe2ce24){for(var _0x302dd6=0x0,_0x591717=events[_0x559e('0x5')];_0x302dd6<_0x591717;_0x302dd6++){var _0x507ff8=events[_0x302dd6];var _0x90b00b=createListener(_0x559e('0x6')+_0x507ff8,_0xe2ce24);OpenchannelInteractionEvents['on'](_0x507ff8,_0x90b00b);}};
\ No newline at end of file
+var _0x5b31=['openchannelInteraction:','./openchannelInteraction.events','save','update','removeListener','register','length'];(function(_0x9c34b0,_0x408338){var _0x5d7c1b=function(_0x4e9ffc){while(--_0x4e9ffc){_0x9c34b0['push'](_0x9c34b0['shift']());}};_0x5d7c1b(++_0x408338);}(_0x5b31,0x12e));var _0x15b3=function(_0x2115de,_0x42a024){_0x2115de=_0x2115de-0x0;var _0x26966c=_0x5b31[_0x2115de];return _0x26966c;};'use strict';var OpenchannelInteractionEvents=require(_0x15b3('0x0'));var events=[_0x15b3('0x1'),'remove',_0x15b3('0x2')];function createListener(_0x5d9b40,_0x4f845f){return function(_0x3ee478){_0x4f845f['emit'](_0x5d9b40,_0x3ee478);};}function removeListener(_0x40c40b,_0x3e5479){return function(){OpenchannelInteractionEvents[_0x15b3('0x3')](_0x40c40b,_0x3e5479);};}exports[_0x15b3('0x4')]=function(_0x3632ea){for(var _0xe88c83=0x0,_0x21f52a=events[_0x15b3('0x5')];_0xe88c83<_0x21f52a;_0xe88c83++){var _0x38cc5b=events[_0xe88c83];var _0x47a8db=createListener(_0x15b3('0x6')+_0x38cc5b,_0x3632ea);OpenchannelInteractionEvents['on'](_0x38cc5b,_0x47a8db);}};
\ No newline at end of file
index a586385..3d17d78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x5a7be0,_0x113e18){var _0x1dc72e=function(_0x4f8cbf){while(--_0x4f8cbf){_0x5a7be0['push'](_0x5a7be0['shift']());}};_0x1dc72e(++_0x113e18);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router;
\ No newline at end of file
+var _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x1d997f,_0x259b5a){var _0x307704=function(_0x4358a8){while(--_0x4358a8){_0x1d997f['push'](_0x1d997f['shift']());}};_0x307704(++_0x259b5a);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router;
\ No newline at end of file
index 8a80dfb..a972896 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3419=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x537e38,_0x477dcd){var _0x444a34=function(_0x3b5132){while(--_0x3b5132){_0x537e38['push'](_0x537e38['shift']());}};_0x444a34(++_0x477dcd);}(_0x3419,0xb3));var _0x9341=function(_0x1c6089,_0x3816e2){_0x1c6089=_0x1c6089-0x0;var _0x4d97c1=_0x3419[_0x1c6089];return _0x4d97c1;};'use strict';var Sequelize=require(_0x9341('0x0'));module[_0x9341('0x1')]={'body':{'type':Sequelize[_0x9341('0x2')](_0x9341('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9341('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9341('0x5')]('in',_0x9341('0x6')),'defaultValue':_0x9341('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9341('0x7')]},'providerName':{'type':Sequelize[_0x9341('0x8')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x8383=['sequelize','medium','BOOLEAN','ENUM','out','DATE','STRING','TEXT'];(function(_0x11280c,_0x4e8f92){var _0x5999ac=function(_0x3fe60e){while(--_0x3fe60e){_0x11280c['push'](_0x11280c['shift']());}};_0x5999ac(++_0x4e8f92);}(_0x8383,0x98));var _0x3838=function(_0x10a525,_0x4456fc){_0x10a525=_0x10a525-0x0;var _0xf41992=_0x8383[_0x10a525];return _0xf41992;};'use strict';var Sequelize=require(_0x3838('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x3838('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x3838('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x3838('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3838('0x3')]('in',_0x3838('0x4')),'defaultValue':_0x3838('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x3838('0x5')]},'providerName':{'type':Sequelize[_0x3838('0x6')]},'providerResponse':{'type':Sequelize[_0x3838('0x7')]}};
\ No newline at end of file
index 8689883..dc4bbad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb613=['SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','reject','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','event','rejectmessage','eml-format','rimraf','zip-dir','request-promise','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','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','end','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes'];(function(_0x323d87,_0x4ef3f9){var _0x5e8f74=function(_0x185735){while(--_0x185735){_0x323d87['push'](_0x323d87['shift']());}};_0x5e8f74(++_0x4ef3f9);}(_0xb613,0x1b8));var _0x3b61=function(_0x53b53e,_0x498437){_0x53b53e=_0x53b53e-0x0;var _0xbb6179=_0xb613[_0x53b53e];return _0xbb6179;};'use strict';var emlformat=require(_0x3b61('0x0'));var rimraf=require(_0x3b61('0x1'));var zipdir=require(_0x3b61('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3b61('0x3'));var moment=require('moment');var BPromise=require(_0x3b61('0x4'));var Mustache=require('mustache');var util=require(_0x3b61('0x5'));var path=require(_0x3b61('0x6'));var sox=require(_0x3b61('0x7'));var csv=require(_0x3b61('0x8'));var ejs=require(_0x3b61('0x9'));var fs=require('fs');var fs_extra=require(_0x3b61('0xa'));var _=require(_0x3b61('0xb'));var squel=require(_0x3b61('0xc'));var crypto=require(_0x3b61('0xd'));var jsforce=require(_0x3b61('0xe'));var deskjs=require(_0x3b61('0xf'));var toCsv=require(_0x3b61('0x8'));var querystring=require(_0x3b61('0x10'));var Papa=require(_0x3b61('0x11'));var Redis=require(_0x3b61('0x12'));var authService=require(_0x3b61('0x13'));var qs=require(_0x3b61('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3b61('0x15'));var logger=require(_0x3b61('0x16'))(_0x3b61('0x17'));var utils=require(_0x3b61('0x18'));var config=require(_0x3b61('0x19'));var licenseUtil=require(_0x3b61('0x1a'));var db=require(_0x3b61('0x1b'))['db'];config[_0x3b61('0x1c')]=_[_0x3b61('0x1d')](config[_0x3b61('0x1c')],{'host':_0x3b61('0x1e'),'port':0x18eb});var socket=require(_0x3b61('0x1f'))(new Redis(config[_0x3b61('0x1c')]));require(_0x3b61('0x20'))[_0x3b61('0x21')](socket);var jayson=require(_0x3b61('0x22'));var client=jayson[_0x3b61('0x23')][_0x3b61('0x24')]({'port':0x232c});var client9002=jayson[_0x3b61('0x23')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29ae93,_0x57041a,_0x166134,_0x2b077b){return new BPromise(function(_0x1bfde4,_0x2e2d54){var _0x29d796=_0x2b077b||client;return _0x29d796['request'](_0x29ae93,_0x166134)[_0x3b61('0x25')](function(_0x217f40){logger[_0x3b61('0x26')](_0x3b61('0x27'),_0x57041a,_0x3b61('0x28'));logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x57041a,_0x3b61('0x28'),JSON[_0x3b61('0x29')](_0x217f40));if(_0x217f40[_0x3b61('0x2a')]){if(_0x217f40['error'][_0x3b61('0x2b')]===0x1f4){logger['error'](_0x3b61('0x27'),_0x57041a,_0x217f40[_0x3b61('0x2a')][_0x3b61('0x2c')]);return _0x2e2d54(_0x217f40[_0x3b61('0x2a')][_0x3b61('0x2c')]);}logger['error'](_0x3b61('0x27'),_0x57041a,_0x217f40['error']['message']);return _0x1bfde4(_0x217f40[_0x3b61('0x2a')][_0x3b61('0x2c')]);}else{logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x57041a,_0x3b61('0x28'));_0x1bfde4(_0x217f40[_0x3b61('0x2d')][_0x3b61('0x2c')]);}})[_0x3b61('0x2e')](function(_0x3d8d29){logger[_0x3b61('0x2a')](_0x3b61('0x27'),_0x57041a,_0x3d8d29);_0x2e2d54(_0x3d8d29);});});}function respondWithStatusCode(_0x2fcc4d,_0x52a40b){_0x52a40b=_0x52a40b||0xcc;return function(_0x3e36b0){if(_0x3e36b0){return _0x2fcc4d[_0x3b61('0x2f')](_0x52a40b);}return _0x2fcc4d[_0x3b61('0x30')](_0x52a40b)['end']();};}function respondWithResult(_0xbc36b,_0x34671b){_0x34671b=_0x34671b||0xc8;return function(_0x5e0cf3){if(_0x5e0cf3){return _0xbc36b[_0x3b61('0x30')](_0x34671b)[_0x3b61('0x31')](_0x5e0cf3);}};}function respondWithFilteredResult(_0x56a31f,_0x6bfdcd){return function(_0x4c15aa){if(_0x4c15aa){var _0x481d40=typeof _0x6bfdcd[_0x3b61('0x32')]===_0x3b61('0x33')&&typeof _0x6bfdcd[_0x3b61('0x34')]===_0x3b61('0x33');var _0x119680=_0x4c15aa[_0x3b61('0x35')];var _0x383f03=_0x481d40?0x0:_0x6bfdcd[_0x3b61('0x32')];var _0x111ab5=_0x481d40?_0x4c15aa['count']:_0x6bfdcd[_0x3b61('0x32')]+_0x6bfdcd['limit'];var _0x4f95e3;if(_0x111ab5>=_0x119680){_0x111ab5=_0x119680;_0x4f95e3=0xc8;}else{_0x4f95e3=0xce;}_0x56a31f['status'](_0x4f95e3);return _0x56a31f[_0x3b61('0x36')](_0x3b61('0x37'),_0x383f03+'-'+_0x111ab5+'/'+_0x119680)['json'](_0x4c15aa);}return null;};}function patchUpdates(_0x30a899){return function(_0x136804){try{jsonpatch[_0x3b61('0x38')](_0x136804,_0x30a899,!![]);}catch(_0x3d47b3){return BPromise['reject'](_0x3d47b3);}return _0x136804[_0x3b61('0x39')]();};}function saveUpdates(_0x43f6c4,_0x319a14){return function(_0x24959e){if(_0x24959e){return _0x24959e[_0x3b61('0x3a')](_0x43f6c4)[_0x3b61('0x25')](function(_0xa9368f){return _0xa9368f;});}return null;};}function removeEntity(_0x24218a,_0x419f65){return function(_0x358854){if(_0x358854){return _0x358854[_0x3b61('0x3b')]()[_0x3b61('0x25')](function(){_0x24218a['status'](0xcc)[_0x3b61('0x3c')]();});}};}function handleEntityNotFound(_0x15ef5c,_0x3a4abe){return function(_0x572709){if(!_0x572709){_0x15ef5c[_0x3b61('0x2f')](0x194);}return _0x572709;};}function handleError(_0x493a4f,_0x158cbc){_0x158cbc=_0x158cbc||0x1f4;return function(_0x515a43){logger[_0x3b61('0x2a')](_0x515a43['stack']);if(_0x515a43['name']){delete _0x515a43[_0x3b61('0x3d')];}_0x493a4f['status'](_0x158cbc)[_0x3b61('0x3e')](_0x515a43);};}exports[_0x3b61('0x3f')]=function(_0x47864b,_0x24fab7){var _0x1d5615={},_0x5ab48e={},_0x357080={'count':0x0,'rows':[]};var _0x2f6a4b=_[_0x3b61('0x40')](db[_0x3b61('0x41')][_0x3b61('0x42')],function(_0x284196){return{'name':_0x284196[_0x3b61('0x43')],'type':_0x284196[_0x3b61('0x44')][_0x3b61('0x45')]};});_0x5ab48e[_0x3b61('0x46')]=_[_0x3b61('0x40')](_0x2f6a4b,'name');_0x5ab48e['query']=_[_0x3b61('0x47')](_0x47864b[_0x3b61('0x48')]);_0x5ab48e[_0x3b61('0x49')]=_[_0x3b61('0x4a')](_0x5ab48e[_0x3b61('0x46')],_0x5ab48e[_0x3b61('0x48')]);_0x1d5615[_0x3b61('0x4b')]=_[_0x3b61('0x4a')](_0x5ab48e[_0x3b61('0x46')],qs['fields'](_0x47864b['query'][_0x3b61('0x4c')]));_0x1d5615[_0x3b61('0x4b')]=_0x1d5615['attributes'][_0x3b61('0x4d')]?_0x1d5615[_0x3b61('0x4b')]:_0x5ab48e[_0x3b61('0x46')];if(!_0x47864b[_0x3b61('0x48')][_0x3b61('0x4e')](_0x3b61('0x4f'))){_0x1d5615['limit']=qs[_0x3b61('0x34')](_0x47864b[_0x3b61('0x48')][_0x3b61('0x34')]);_0x1d5615[_0x3b61('0x32')]=qs[_0x3b61('0x32')](_0x47864b[_0x3b61('0x48')][_0x3b61('0x32')]);}_0x1d5615[_0x3b61('0x50')]=qs[_0x3b61('0x51')](_0x47864b[_0x3b61('0x48')][_0x3b61('0x51')]);_0x1d5615[_0x3b61('0x52')]=qs[_0x3b61('0x49')](_[_0x3b61('0x53')](_0x47864b['query'],_0x5ab48e[_0x3b61('0x49')]),_0x2f6a4b);if(_0x47864b[_0x3b61('0x48')][_0x3b61('0x54')]){_0x1d5615['where']=_[_0x3b61('0x55')](_0x1d5615[_0x3b61('0x52')],{'$or':_[_0x3b61('0x40')](_0x2f6a4b,function(_0x15e7c4){if(_0x15e7c4['type']!==_0x3b61('0x56')){var _0x4b7753={};_0x4b7753[_0x15e7c4[_0x3b61('0x3d')]]={'$like':'%'+_0x47864b[_0x3b61('0x48')][_0x3b61('0x54')]+'%'};return _0x4b7753;}})});}_0x1d5615=_['merge']({},_0x1d5615,_0x47864b[_0x3b61('0x57')]);var _0x4e2d8b={'where':_0x1d5615[_0x3b61('0x52')]};return db[_0x3b61('0x41')][_0x3b61('0x35')](_0x4e2d8b)[_0x3b61('0x25')](function(_0x38168b){_0x357080[_0x3b61('0x35')]=_0x38168b;if(_0x47864b[_0x3b61('0x48')][_0x3b61('0x58')]){_0x1d5615[_0x3b61('0x59')]=[{'all':!![]}];}return db[_0x3b61('0x41')][_0x3b61('0x5a')](_0x1d5615);})['then'](function(_0x29f496){_0x357080[_0x3b61('0x5b')]=_0x29f496;return _0x357080;})[_0x3b61('0x25')](respondWithFilteredResult(_0x24fab7,_0x1d5615))[_0x3b61('0x2e')](handleError(_0x24fab7,null));};exports['show']=function(_0x2108b7,_0x4aa4ea){var _0x1bc987={'raw':!![],'where':{'id':_0x2108b7[_0x3b61('0x5c')]['id']}},_0x4205fe={};_0x4205fe[_0x3b61('0x46')]=_[_0x3b61('0x47')](db[_0x3b61('0x41')]['rawAttributes']);_0x4205fe[_0x3b61('0x48')]=_[_0x3b61('0x47')](_0x2108b7['query']);_0x4205fe[_0x3b61('0x49')]=_[_0x3b61('0x4a')](_0x4205fe[_0x3b61('0x46')],_0x4205fe[_0x3b61('0x48')]);_0x1bc987[_0x3b61('0x4b')]=_[_0x3b61('0x4a')](_0x4205fe['model'],qs[_0x3b61('0x4c')](_0x2108b7['query'][_0x3b61('0x4c')]));_0x1bc987[_0x3b61('0x4b')]=_0x1bc987[_0x3b61('0x4b')][_0x3b61('0x4d')]?_0x1bc987[_0x3b61('0x4b')]:_0x4205fe[_0x3b61('0x46')];if(_0x2108b7[_0x3b61('0x48')]['includeAll']){_0x1bc987['include']=[{'all':!![]}];}_0x1bc987=_[_0x3b61('0x55')]({},_0x1bc987,_0x2108b7[_0x3b61('0x57')]);return db[_0x3b61('0x41')][_0x3b61('0x5d')](_0x1bc987)[_0x3b61('0x25')](handleEntityNotFound(_0x4aa4ea,null))['then'](respondWithResult(_0x4aa4ea,null))[_0x3b61('0x2e')](handleError(_0x4aa4ea,null));};exports[_0x3b61('0x5e')]=function(_0x4e7363,_0x4e0794){return db[_0x3b61('0x41')]['create'](_0x4e7363[_0x3b61('0x5f')],{})[_0x3b61('0x25')](respondWithResult(_0x4e0794,0xc9))[_0x3b61('0x2e')](handleError(_0x4e0794,null));};exports[_0x3b61('0x3a')]=function(_0x597a32,_0xc0eb57){if(_0x597a32[_0x3b61('0x5f')]['id']){delete _0x597a32[_0x3b61('0x5f')]['id'];}return db[_0x3b61('0x41')][_0x3b61('0x5d')]({'where':{'id':_0x597a32['params']['id']}})[_0x3b61('0x25')](handleEntityNotFound(_0xc0eb57,null))[_0x3b61('0x25')](saveUpdates(_0x597a32[_0x3b61('0x5f')],null))[_0x3b61('0x25')](respondWithResult(_0xc0eb57,null))['catch'](handleError(_0xc0eb57,null));};exports[_0x3b61('0x3b')]=function(_0x2f8754,_0x2d7375){return db[_0x3b61('0x41')][_0x3b61('0x5d')]({'where':{'id':_0x2f8754[_0x3b61('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2d7375,null))[_0x3b61('0x25')](removeEntity(_0x2d7375,null))[_0x3b61('0x2e')](handleError(_0x2d7375,null));};exports[_0x3b61('0x60')]=function(_0x30f88e,_0x12bea3){return db[_0x3b61('0x41')][_0x3b61('0x60')]()['then'](respondWithResult(_0x12bea3,null))[_0x3b61('0x2e')](handleError(_0x12bea3,null));};var interaction_log=require(_0x3b61('0x16'))(_0x3b61('0x61'));exports[_0x3b61('0x62')]=function(_0x3bee3b,_0x3bd5f7,_0x30fb2c){var _0x10427a={'agent':{},'channel':_0x3b61('0x63')};if(_0x3bee3b[_0x3b61('0x5f')]['id']){delete _0x3bee3b[_0x3b61('0x5f')]['id'];}_0x3bee3b[_0x3b61('0x5f')][_0x3b61('0x64')]=!![];_0x3bee3b[_0x3b61('0x5f')][_0x3b61('0x65')]=moment()[_0x3b61('0x66')](_0x3b61('0x67'));_0x3bee3b[_0x3b61('0x5f')][_0x3b61('0x68')]=_0x3bee3b[_0x3b61('0x5f')][_0x3b61('0x68')]||_0x3bee3b[_0x3b61('0x69')]['id'];_0x10427a[_0x3b61('0x6a')]['id']=_0x3bee3b[_0x3b61('0x5f')][_0x3b61('0x68')];return db['OpenchannelMessage'][_0x3b61('0x5d')]({'where':{'id':_0x3bee3b[_0x3b61('0x5c')]['id'],'UserId':null}})[_0x3b61('0x25')](handleEntityNotFound(_0x3bd5f7,null))['then'](saveUpdates(_0x3bee3b[_0x3b61('0x5f')],null))[_0x3b61('0x25')](function(_0x33e469){if(_0x33e469){_0x10427a[_0x3b61('0x2c')]=_0x33e469[_0x3b61('0x6b')]({'plain':!![]});return db[_0x3b61('0x6c')][_0x3b61('0x5d')]({'where':{'id':_0x33e469[_0x3b61('0x6d')]}});}return null;})[_0x3b61('0x25')](handleEntityNotFound(_0x3bd5f7,null))[_0x3b61('0x25')](function(_0x2a597d){if(_0x2a597d){return _0x2a597d[_0x3b61('0x3a')]({'UserId':_0x3bee3b[_0x3b61('0x5f')][_0x3b61('0x68')],'read1stAt':_['isNil'](_0x2a597d['read1stAt'])?moment()[_0x3b61('0x66')](_0x3b61('0x67')):undefined});}return null;})[_0x3b61('0x25')](function(_0x56ce3a){if(_0x56ce3a){_0x10427a[_0x3b61('0x6e')]=_0x56ce3a[_0x3b61('0x6b')]({'plain':!![]});interaction_log[_0x3b61('0x26')](_0x3b61('0x6f'),_0x3bee3b[_0x3b61('0x69')]['id'],_0x3bee3b[_0x3b61('0x69')][_0x3b61('0x3d')],_0x3bee3b['user']['role'],_0x10427a[_0x3b61('0x6e')]['id'],_0x3bee3b[_0x3b61('0x5f')]?JSON[_0x3b61('0x29')](_0x3bee3b[_0x3b61('0x5f')]):_0x3b61('0x70'));return respondWithRpcPromise(_0x3b61('0x71'),_0x3b61('0x72'),_0x10427a);}return null;})[_0x3b61('0x25')](function(_0x44edfc){var _0x1a69ea=_0x3b61('0x73')+_0x44edfc[_0x3b61('0x2c')][_0x3b61('0x74')];return db[_0x3b61('0x75')][_0x3b61('0x48')](_0x1a69ea,{'type':db[_0x3b61('0x76')][_0x3b61('0x77')][_0x3b61('0x78')],'raw':!![]})[_0x3b61('0x25')](function(_0x1a9f77){return _0x1a9f77;});})[_0x3b61('0x25')](function(_0x34e7b7){if(_0x34e7b7){_0x10427a[_0x3b61('0x2c')][_0x3b61('0x79')]=_0x34e7b7[0x0];if(!_0x3bee3b[_0x3b61('0x5f')]['UserId'])return;return db[_0x3b61('0x7a')][_0x3b61('0x5d')]({'where':{'id':_0x3bee3b[_0x3b61('0x5f')][_0x3b61('0x68')],'role':_0x3b61('0x6a')},'attributes':['id',_0x3b61('0x3d'),_0x3b61('0x7b'),_0x3b61('0x7c'),_0x3b61('0x7d')],'raw':!![]});}return null;})[_0x3b61('0x25')](function(_0x42aa10){if(!_0x42aa10)return null;_0x10427a['message'][_0x3b61('0x6a')]=_0x42aa10;return _0x10427a;})['then'](function(_0x29efc1){if(_0x29efc1){if(_0x3bee3b[_0x3b61('0x5f')][_0x3b61('0x7e')]){_0x10427a['message'][_0x3b61('0x7f')]=util[_0x3b61('0x66')](_0x3b61('0x80'),_0x3bee3b['user']['name']);_0x10427a[_0x3b61('0x2c')]['channel']=_0x10427a[_0x3b61('0x81')];_0x10427a['message'][_0x3b61('0x82')]=_0x10427a[_0x3b61('0x81')];_0x10427a[_0x3b61('0x2c')]['event']=_0x3b61('0x62');return respondWithRpcPromise(_0x3b61('0x83'),_0x3b61('0x83'),{'event':_0x3b61('0x84'),'message':_0x10427a[_0x3b61('0x2c')]},client9002)[_0x3b61('0x25')](function(){return _0x10427a;});}return _0x10427a;}return null;})[_0x3b61('0x25')](respondWithResult(_0x3bd5f7,null))[_0x3b61('0x2e')](handleError(_0x3bd5f7,null));};var interaction_log=require(_0x3b61('0x16'))(_0x3b61('0x61'));exports[_0x3b61('0x85')]=function(_0x517a52,_0xeca9eb,_0x575e4c){var _0x54abd0={'agent':{},'channel':'openchannel'};if(_0x517a52[_0x3b61('0x5f')]['id']){delete _0x517a52['body']['id'];}_0x517a52[_0x3b61('0x5f')][_0x3b61('0x68')]=_0x517a52[_0x3b61('0x5f')][_0x3b61('0x68')]||_0x517a52[_0x3b61('0x69')]['id'];_0x54abd0[_0x3b61('0x6a')]['id']=_0x517a52[_0x3b61('0x5f')][_0x3b61('0x68')];return db[_0x3b61('0x41')]['find']({'where':{'id':_0x517a52[_0x3b61('0x5c')]['id'],'UserId':null}})[_0x3b61('0x25')](handleEntityNotFound(_0xeca9eb,null))[_0x3b61('0x25')](function(_0x17280f){if(_0x17280f){_0x54abd0[_0x3b61('0x2c')]=_0x17280f['get']({'plain':!![]});return db[_0x3b61('0x6c')][_0x3b61('0x5d')]({'where':{'id':_0x17280f['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0xeca9eb,null))[_0x3b61('0x25')](function(_0x313e9d){if(_0x313e9d){_0x54abd0['interaction']=_0x313e9d[_0x3b61('0x6b')]({'plain':!![]});interaction_log['info'](_0x3b61('0x86'),_0x517a52[_0x3b61('0x69')]['id'],_0x517a52['user'][_0x3b61('0x3d')],_0x517a52[_0x3b61('0x69')][_0x3b61('0x87')],_0x54abd0[_0x3b61('0x6e')]['id'],_0x517a52[_0x3b61('0x5f')]?JSON['stringify'](_0x517a52[_0x3b61('0x5f')]):_0x3b61('0x70'));return respondWithRpcPromise(_0x3b61('0x88'),_0x3b61('0x89'),_0x54abd0);}return null;})[_0x3b61('0x25')](function(_0x1b6ccc){var _0x172185=_0x3b61('0x73')+_0x1b6ccc[_0x3b61('0x2c')][_0x3b61('0x74')];return db[_0x3b61('0x75')][_0x3b61('0x48')](_0x172185,{'type':db['Sequelize']['QueryTypes'][_0x3b61('0x78')],'raw':!![]})[_0x3b61('0x25')](function(_0x20f10d){return _0x20f10d;});})[_0x3b61('0x25')](function(_0x22a2a3){if(_0x22a2a3){_0x54abd0[_0x3b61('0x2c')][_0x3b61('0x79')]=_0x22a2a3[0x0];if(!_0x517a52[_0x3b61('0x5f')][_0x3b61('0x68')])return;return db[_0x3b61('0x7a')]['find']({'where':{'id':_0x517a52[_0x3b61('0x5f')][_0x3b61('0x68')],'role':_0x3b61('0x6a')},'attributes':['id',_0x3b61('0x3d'),_0x3b61('0x7b'),_0x3b61('0x7c'),_0x3b61('0x7d')],'raw':!![]});}return null;})['then'](function(_0xb6b529){if(!_0xb6b529)return null;_0x54abd0[_0x3b61('0x2c')][_0x3b61('0x6a')]=_0xb6b529;return _0x54abd0;})['then'](function(_0x82fb71){if(_0x82fb71){_0x82fb71[_0x3b61('0x2c')]['interface']=util[_0x3b61('0x66')](_0x3b61('0x80'),_0x517a52[_0x3b61('0x69')][_0x3b61('0x3d')]);_0x82fb71[_0x3b61('0x2c')][_0x3b61('0x81')]=_0x54abd0[_0x3b61('0x81')];_0x82fb71['message'][_0x3b61('0x82')]=_0x54abd0['channel'];_0x82fb71[_0x3b61('0x2c')][_0x3b61('0x8a')]=_0x3b61('0x85');respondWithRpcPromise(_0x3b61('0x83'),'EventManager',{'event':_0x3b61('0x8b'),'message':_0x82fb71[_0x3b61('0x2c')]},client9002);return _0x54abd0;}return null;})[_0x3b61('0x25')](respondWithResult(_0xeca9eb,null))[_0x3b61('0x2e')](handleError(_0xeca9eb,null));};
\ No newline at end of file
+var _0x6e47=['result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','find','create','body','destroy','describe','openchannel-interactions','accept','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteraction','isNil','format','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','agent','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteractionId','info','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','User','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x47bbcd,_0x27dbe9){var _0x1769a7=function(_0x337b25){while(--_0x337b25){_0x47bbcd['push'](_0x47bbcd['shift']());}};_0x1769a7(++_0x27dbe9);}(_0x6e47,0xe4));var _0x76e4=function(_0x2b76a1,_0x19fe1c){_0x2b76a1=_0x2b76a1-0x0;var _0x5c39ba=_0x6e47[_0x2b76a1];return _0x5c39ba;};'use strict';var emlformat=require(_0x76e4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76e4('0x1'));var jsonpatch=require(_0x76e4('0x2'));var rp=require(_0x76e4('0x3'));var moment=require('moment');var BPromise=require(_0x76e4('0x4'));var Mustache=require(_0x76e4('0x5'));var util=require(_0x76e4('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x76e4('0x7'));var ejs=require(_0x76e4('0x8'));var fs=require('fs');var fs_extra=require(_0x76e4('0x9'));var _=require(_0x76e4('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x76e4('0xb'));var toCsv=require(_0x76e4('0x7'));var querystring=require(_0x76e4('0xc'));var Papa=require(_0x76e4('0xd'));var Redis=require(_0x76e4('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x76e4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x76e4('0x10'))(_0x76e4('0x11'));var utils=require(_0x76e4('0x12'));var config=require(_0x76e4('0x13'));var licenseUtil=require(_0x76e4('0x14'));var db=require(_0x76e4('0x15'))['db'];config['redis']=_[_0x76e4('0x16')](config[_0x76e4('0x17')],{'host':_0x76e4('0x18'),'port':0x18eb});var socket=require(_0x76e4('0x19'))(new Redis(config[_0x76e4('0x17')]));require('./openchannelMessage.socket')[_0x76e4('0x1a')](socket);var jayson=require(_0x76e4('0x1b'));var client=jayson[_0x76e4('0x1c')][_0x76e4('0x1d')]({'port':0x232c});var client9002=jayson[_0x76e4('0x1c')][_0x76e4('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x331473,_0x3a64f9,_0x3fb3ec,_0x501ca9){return new BPromise(function(_0x5bc246,_0x1c433d){var _0x2afb3e=_0x501ca9||client;return _0x2afb3e[_0x76e4('0x1e')](_0x331473,_0x3fb3ec)[_0x76e4('0x1f')](function(_0x24547e){logger['info'](_0x76e4('0x20'),_0x3a64f9,'request\x20sent');logger[_0x76e4('0x21')](_0x76e4('0x22'),_0x3a64f9,_0x76e4('0x23'),JSON[_0x76e4('0x24')](_0x24547e));if(_0x24547e[_0x76e4('0x25')]){if(_0x24547e[_0x76e4('0x25')][_0x76e4('0x26')]===0x1f4){logger[_0x76e4('0x25')](_0x76e4('0x20'),_0x3a64f9,_0x24547e[_0x76e4('0x25')][_0x76e4('0x27')]);return _0x1c433d(_0x24547e[_0x76e4('0x25')][_0x76e4('0x27')]);}logger['error'](_0x76e4('0x20'),_0x3a64f9,_0x24547e[_0x76e4('0x25')]['message']);return _0x5bc246(_0x24547e['error'][_0x76e4('0x27')]);}else{logger['info'](_0x76e4('0x20'),_0x3a64f9,_0x76e4('0x23'));_0x5bc246(_0x24547e[_0x76e4('0x28')][_0x76e4('0x27')]);}})[_0x76e4('0x29')](function(_0x3a59ee){logger[_0x76e4('0x25')](_0x76e4('0x20'),_0x3a64f9,_0x3a59ee);_0x1c433d(_0x3a59ee);});});}function respondWithStatusCode(_0x2ada34,_0x3cfb91){_0x3cfb91=_0x3cfb91||0xcc;return function(_0x5ad9df){if(_0x5ad9df){return _0x2ada34[_0x76e4('0x2a')](_0x3cfb91);}return _0x2ada34[_0x76e4('0x2b')](_0x3cfb91)[_0x76e4('0x2c')]();};}function respondWithResult(_0x226ae9,_0x387034){_0x387034=_0x387034||0xc8;return function(_0x497027){if(_0x497027){return _0x226ae9[_0x76e4('0x2b')](_0x387034)[_0x76e4('0x2d')](_0x497027);}};}function respondWithFilteredResult(_0x498214,_0x5be7be){return function(_0x1935e4){if(_0x1935e4){var _0x52f8e7=typeof _0x5be7be[_0x76e4('0x2e')]===_0x76e4('0x2f')&&typeof _0x5be7be['limit']===_0x76e4('0x2f');var _0x2ad07f=_0x1935e4[_0x76e4('0x30')];var _0x2394f3=_0x52f8e7?0x0:_0x5be7be[_0x76e4('0x2e')];var _0x547d5e=_0x52f8e7?_0x1935e4[_0x76e4('0x30')]:_0x5be7be[_0x76e4('0x2e')]+_0x5be7be[_0x76e4('0x31')];var _0x2e9ee5;if(_0x547d5e>=_0x2ad07f){_0x547d5e=_0x2ad07f;_0x2e9ee5=0xc8;}else{_0x2e9ee5=0xce;}_0x498214[_0x76e4('0x2b')](_0x2e9ee5);return _0x498214[_0x76e4('0x32')](_0x76e4('0x33'),_0x2394f3+'-'+_0x547d5e+'/'+_0x2ad07f)[_0x76e4('0x2d')](_0x1935e4);}return null;};}function patchUpdates(_0x5a4ce1){return function(_0x3baf97){try{jsonpatch[_0x76e4('0x34')](_0x3baf97,_0x5a4ce1,!![]);}catch(_0x4e28c9){return BPromise[_0x76e4('0x35')](_0x4e28c9);}return _0x3baf97[_0x76e4('0x36')]();};}function saveUpdates(_0x1b1cec,_0x455360){return function(_0x42d94a){if(_0x42d94a){return _0x42d94a[_0x76e4('0x37')](_0x1b1cec)['then'](function(_0x391a00){return _0x391a00;});}return null;};}function removeEntity(_0x2ead06,_0x4a347a){return function(_0x5852f4){if(_0x5852f4){return _0x5852f4['destroy']()[_0x76e4('0x1f')](function(){_0x2ead06[_0x76e4('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x147955,_0x3cb47c){return function(_0xfbbbf2){if(!_0xfbbbf2){_0x147955[_0x76e4('0x2a')](0x194);}return _0xfbbbf2;};}function handleError(_0x3e9e44,_0x2803c2){_0x2803c2=_0x2803c2||0x1f4;return function(_0x4baa4e){logger[_0x76e4('0x25')](_0x4baa4e[_0x76e4('0x38')]);if(_0x4baa4e[_0x76e4('0x39')]){delete _0x4baa4e[_0x76e4('0x39')];}_0x3e9e44[_0x76e4('0x2b')](_0x2803c2)[_0x76e4('0x3a')](_0x4baa4e);};}exports[_0x76e4('0x3b')]=function(_0x55508d,_0x5ae87e){var _0x4689a1={},_0x17f9a5={},_0x510b1b={'count':0x0,'rows':[]};var _0x42749e=_[_0x76e4('0x3c')](db[_0x76e4('0x3d')][_0x76e4('0x3e')],function(_0x17f8ca){return{'name':_0x17f8ca[_0x76e4('0x3f')],'type':_0x17f8ca[_0x76e4('0x40')][_0x76e4('0x41')]};});_0x17f9a5[_0x76e4('0x42')]=_[_0x76e4('0x3c')](_0x42749e,'name');_0x17f9a5[_0x76e4('0x43')]=_[_0x76e4('0x44')](_0x55508d[_0x76e4('0x43')]);_0x17f9a5[_0x76e4('0x45')]=_[_0x76e4('0x46')](_0x17f9a5[_0x76e4('0x42')],_0x17f9a5[_0x76e4('0x43')]);_0x4689a1[_0x76e4('0x47')]=_[_0x76e4('0x46')](_0x17f9a5[_0x76e4('0x42')],qs['fields'](_0x55508d[_0x76e4('0x43')][_0x76e4('0x48')]));_0x4689a1[_0x76e4('0x47')]=_0x4689a1['attributes'][_0x76e4('0x49')]?_0x4689a1[_0x76e4('0x47')]:_0x17f9a5[_0x76e4('0x42')];if(!_0x55508d['query'][_0x76e4('0x4a')](_0x76e4('0x4b'))){_0x4689a1['limit']=qs[_0x76e4('0x31')](_0x55508d[_0x76e4('0x43')][_0x76e4('0x31')]);_0x4689a1[_0x76e4('0x2e')]=qs['offset'](_0x55508d[_0x76e4('0x43')][_0x76e4('0x2e')]);}_0x4689a1['order']=qs[_0x76e4('0x4c')](_0x55508d[_0x76e4('0x43')][_0x76e4('0x4c')]);_0x4689a1[_0x76e4('0x4d')]=qs[_0x76e4('0x45')](_[_0x76e4('0x4e')](_0x55508d[_0x76e4('0x43')],_0x17f9a5[_0x76e4('0x45')]),_0x42749e);if(_0x55508d['query'][_0x76e4('0x4f')]){_0x4689a1[_0x76e4('0x4d')]=_[_0x76e4('0x50')](_0x4689a1[_0x76e4('0x4d')],{'$or':_['map'](_0x42749e,function(_0x1546a9){if(_0x1546a9['type']!==_0x76e4('0x51')){var _0x123aa0={};_0x123aa0[_0x1546a9[_0x76e4('0x39')]]={'$like':'%'+_0x55508d[_0x76e4('0x43')][_0x76e4('0x4f')]+'%'};return _0x123aa0;}})});}_0x4689a1=_[_0x76e4('0x50')]({},_0x4689a1,_0x55508d[_0x76e4('0x52')]);var _0x2c5840={'where':_0x4689a1[_0x76e4('0x4d')]};return db[_0x76e4('0x3d')][_0x76e4('0x30')](_0x2c5840)[_0x76e4('0x1f')](function(_0x374958){_0x510b1b[_0x76e4('0x30')]=_0x374958;if(_0x55508d[_0x76e4('0x43')][_0x76e4('0x53')]){_0x4689a1['include']=[{'all':!![]}];}return db[_0x76e4('0x3d')]['findAll'](_0x4689a1);})[_0x76e4('0x1f')](function(_0x32f2d1){_0x510b1b[_0x76e4('0x54')]=_0x32f2d1;return _0x510b1b;})[_0x76e4('0x1f')](respondWithFilteredResult(_0x5ae87e,_0x4689a1))['catch'](handleError(_0x5ae87e,null));};exports[_0x76e4('0x55')]=function(_0x2263c2,_0x4d46bf){var _0x36d032={'raw':!![],'where':{'id':_0x2263c2[_0x76e4('0x56')]['id']}},_0x487a3e={};_0x487a3e[_0x76e4('0x42')]=_[_0x76e4('0x44')](db[_0x76e4('0x3d')][_0x76e4('0x3e')]);_0x487a3e[_0x76e4('0x43')]=_['keys'](_0x2263c2[_0x76e4('0x43')]);_0x487a3e[_0x76e4('0x45')]=_[_0x76e4('0x46')](_0x487a3e[_0x76e4('0x42')],_0x487a3e['query']);_0x36d032[_0x76e4('0x47')]=_[_0x76e4('0x46')](_0x487a3e[_0x76e4('0x42')],qs['fields'](_0x2263c2[_0x76e4('0x43')]['fields']));_0x36d032['attributes']=_0x36d032[_0x76e4('0x47')][_0x76e4('0x49')]?_0x36d032[_0x76e4('0x47')]:_0x487a3e[_0x76e4('0x42')];if(_0x2263c2[_0x76e4('0x43')]['includeAll']){_0x36d032['include']=[{'all':!![]}];}_0x36d032=_['merge']({},_0x36d032,_0x2263c2[_0x76e4('0x52')]);return db[_0x76e4('0x3d')][_0x76e4('0x57')](_0x36d032)[_0x76e4('0x1f')](handleEntityNotFound(_0x4d46bf,null))['then'](respondWithResult(_0x4d46bf,null))[_0x76e4('0x29')](handleError(_0x4d46bf,null));};exports[_0x76e4('0x58')]=function(_0x4af643,_0x235362){return db[_0x76e4('0x3d')][_0x76e4('0x58')](_0x4af643[_0x76e4('0x59')],{})[_0x76e4('0x1f')](respondWithResult(_0x235362,0xc9))[_0x76e4('0x29')](handleError(_0x235362,null));};exports[_0x76e4('0x37')]=function(_0x24ba8c,_0x49b3e3){if(_0x24ba8c[_0x76e4('0x59')]['id']){delete _0x24ba8c['body']['id'];}return db[_0x76e4('0x3d')]['find']({'where':{'id':_0x24ba8c['params']['id']}})['then'](handleEntityNotFound(_0x49b3e3,null))[_0x76e4('0x1f')](saveUpdates(_0x24ba8c['body'],null))[_0x76e4('0x1f')](respondWithResult(_0x49b3e3,null))['catch'](handleError(_0x49b3e3,null));};exports[_0x76e4('0x5a')]=function(_0x170e98,_0x4d4964){return db[_0x76e4('0x3d')][_0x76e4('0x57')]({'where':{'id':_0x170e98[_0x76e4('0x56')]['id']}})['then'](handleEntityNotFound(_0x4d4964,null))[_0x76e4('0x1f')](removeEntity(_0x4d4964,null))[_0x76e4('0x29')](handleError(_0x4d4964,null));};exports[_0x76e4('0x5b')]=function(_0x2096db,_0x2348d8){return db[_0x76e4('0x3d')][_0x76e4('0x5b')]()['then'](respondWithResult(_0x2348d8,null))[_0x76e4('0x29')](handleError(_0x2348d8,null));};var interaction_log=require(_0x76e4('0x10'))(_0x76e4('0x5c'));exports[_0x76e4('0x5d')]=function(_0x397e91,_0x3aabd7,_0x316af5){var _0x2ba3cc={'agent':{},'channel':_0x76e4('0x5e')};if(_0x397e91[_0x76e4('0x59')]['id']){delete _0x397e91['body']['id'];}_0x397e91[_0x76e4('0x59')][_0x76e4('0x5f')]=!![];_0x397e91[_0x76e4('0x59')][_0x76e4('0x60')]=moment()['format'](_0x76e4('0x61'));_0x397e91[_0x76e4('0x59')][_0x76e4('0x62')]=_0x397e91[_0x76e4('0x59')]['UserId']||_0x397e91[_0x76e4('0x63')]['id'];_0x2ba3cc['agent']['id']=_0x397e91['body'][_0x76e4('0x62')];return db['OpenchannelMessage']['find']({'where':{'id':_0x397e91[_0x76e4('0x56')]['id'],'UserId':null}})[_0x76e4('0x1f')](handleEntityNotFound(_0x3aabd7,null))[_0x76e4('0x1f')](saveUpdates(_0x397e91[_0x76e4('0x59')],null))[_0x76e4('0x1f')](function(_0x1a3a8f){if(_0x1a3a8f){_0x2ba3cc[_0x76e4('0x27')]=_0x1a3a8f[_0x76e4('0x64')]({'plain':!![]});return db[_0x76e4('0x65')][_0x76e4('0x57')]({'where':{'id':_0x1a3a8f['OpenchannelInteractionId']}});}return null;})[_0x76e4('0x1f')](handleEntityNotFound(_0x3aabd7,null))[_0x76e4('0x1f')](function(_0x2d44d8){if(_0x2d44d8){return _0x2d44d8[_0x76e4('0x37')]({'UserId':_0x397e91[_0x76e4('0x59')][_0x76e4('0x62')],'read1stAt':_[_0x76e4('0x66')](_0x2d44d8['read1stAt'])?moment()[_0x76e4('0x67')](_0x76e4('0x61')):undefined});}return null;})[_0x76e4('0x1f')](function(_0x57db82){if(_0x57db82){_0x2ba3cc[_0x76e4('0x68')]=_0x57db82['get']({'plain':!![]});interaction_log['info'](_0x76e4('0x69'),_0x397e91[_0x76e4('0x63')]['id'],_0x397e91[_0x76e4('0x63')][_0x76e4('0x39')],_0x397e91[_0x76e4('0x63')][_0x76e4('0x6a')],_0x2ba3cc[_0x76e4('0x68')]['id'],_0x397e91['body']?JSON[_0x76e4('0x24')](_0x397e91[_0x76e4('0x59')]):_0x76e4('0x6b'));return respondWithRpcPromise(_0x76e4('0x6c'),'acceptMessage',_0x2ba3cc);}return null;})[_0x76e4('0x1f')](function(_0x2f1525){var _0x35b6bf=_0x76e4('0x6d')+_0x2f1525['message'][_0x76e4('0x6e')];return db[_0x76e4('0x6f')]['query'](_0x35b6bf,{'type':db[_0x76e4('0x70')][_0x76e4('0x71')][_0x76e4('0x72')],'raw':!![]})[_0x76e4('0x1f')](function(_0xb8f677){return _0xb8f677;});})[_0x76e4('0x1f')](function(_0x1823eb){if(_0x1823eb){_0x2ba3cc[_0x76e4('0x27')][_0x76e4('0x73')]=_0x1823eb[0x0];if(!_0x397e91[_0x76e4('0x59')][_0x76e4('0x62')])return;return db['User']['find']({'where':{'id':_0x397e91['body'][_0x76e4('0x62')],'role':_0x76e4('0x74')},'attributes':['id','name',_0x76e4('0x75'),_0x76e4('0x76'),_0x76e4('0x77')],'raw':!![]});}return null;})[_0x76e4('0x1f')](function(_0x327208){if(!_0x327208)return null;_0x2ba3cc['message'][_0x76e4('0x74')]=_0x327208;return _0x2ba3cc;})[_0x76e4('0x1f')](function(_0x3546ed){if(_0x3546ed){if(_0x397e91[_0x76e4('0x59')][_0x76e4('0x78')]){_0x2ba3cc[_0x76e4('0x27')][_0x76e4('0x79')]=util[_0x76e4('0x67')]('SIP/%s',_0x397e91[_0x76e4('0x63')]['name']);_0x2ba3cc[_0x76e4('0x27')][_0x76e4('0x7a')]=_0x2ba3cc['channel'];_0x2ba3cc[_0x76e4('0x27')][_0x76e4('0x7b')]=_0x2ba3cc[_0x76e4('0x7a')];_0x2ba3cc[_0x76e4('0x27')][_0x76e4('0x7c')]=_0x76e4('0x5d');return respondWithRpcPromise(_0x76e4('0x7d'),_0x76e4('0x7d'),{'event':_0x76e4('0x7e'),'message':_0x2ba3cc[_0x76e4('0x27')]},client9002)[_0x76e4('0x1f')](function(){return _0x2ba3cc;});}return _0x2ba3cc;}return null;})['then'](respondWithResult(_0x3aabd7,null))[_0x76e4('0x29')](handleError(_0x3aabd7,null));};var interaction_log=require(_0x76e4('0x10'))(_0x76e4('0x5c'));exports[_0x76e4('0x35')]=function(_0x51d508,_0x53eb15,_0x425eda){var _0x877f98={'agent':{},'channel':'openchannel'};if(_0x51d508[_0x76e4('0x59')]['id']){delete _0x51d508['body']['id'];}_0x51d508[_0x76e4('0x59')][_0x76e4('0x62')]=_0x51d508[_0x76e4('0x59')][_0x76e4('0x62')]||_0x51d508[_0x76e4('0x63')]['id'];_0x877f98['agent']['id']=_0x51d508[_0x76e4('0x59')][_0x76e4('0x62')];return db['OpenchannelMessage'][_0x76e4('0x57')]({'where':{'id':_0x51d508[_0x76e4('0x56')]['id'],'UserId':null}})[_0x76e4('0x1f')](handleEntityNotFound(_0x53eb15,null))[_0x76e4('0x1f')](function(_0x2661b8){if(_0x2661b8){_0x877f98[_0x76e4('0x27')]=_0x2661b8[_0x76e4('0x64')]({'plain':!![]});return db[_0x76e4('0x65')][_0x76e4('0x57')]({'where':{'id':_0x2661b8[_0x76e4('0x7f')]}});}return null;})['then'](handleEntityNotFound(_0x53eb15,null))['then'](function(_0x2212c8){if(_0x2212c8){_0x877f98[_0x76e4('0x68')]=_0x2212c8[_0x76e4('0x64')]({'plain':!![]});interaction_log[_0x76e4('0x80')](_0x76e4('0x81'),_0x51d508['user']['id'],_0x51d508[_0x76e4('0x63')][_0x76e4('0x39')],_0x51d508['user'][_0x76e4('0x6a')],_0x877f98['interaction']['id'],_0x51d508['body']?JSON[_0x76e4('0x24')](_0x51d508[_0x76e4('0x59')]):'null');return respondWithRpcPromise(_0x76e4('0x82'),_0x76e4('0x83'),_0x877f98);}return null;})['then'](function(_0x5b76a7){var _0x43147c=_0x76e4('0x6d')+_0x5b76a7[_0x76e4('0x27')][_0x76e4('0x6e')];return db[_0x76e4('0x6f')][_0x76e4('0x43')](_0x43147c,{'type':db[_0x76e4('0x70')][_0x76e4('0x71')][_0x76e4('0x72')],'raw':!![]})[_0x76e4('0x1f')](function(_0x1588ef){return _0x1588ef;});})[_0x76e4('0x1f')](function(_0x28fa3f){if(_0x28fa3f){_0x877f98['message'][_0x76e4('0x73')]=_0x28fa3f[0x0];if(!_0x51d508['body']['UserId'])return;return db[_0x76e4('0x84')][_0x76e4('0x57')]({'where':{'id':_0x51d508[_0x76e4('0x59')]['UserId'],'role':'agent'},'attributes':['id','name',_0x76e4('0x75'),'email',_0x76e4('0x77')],'raw':!![]});}return null;})[_0x76e4('0x1f')](function(_0x3add5f){if(!_0x3add5f)return null;_0x877f98['message'][_0x76e4('0x74')]=_0x3add5f;return _0x877f98;})['then'](function(_0x5ee021){if(_0x5ee021){_0x5ee021['message'][_0x76e4('0x79')]=util[_0x76e4('0x67')]('SIP/%s',_0x51d508[_0x76e4('0x63')][_0x76e4('0x39')]);_0x5ee021[_0x76e4('0x27')][_0x76e4('0x7a')]=_0x877f98['channel'];_0x5ee021[_0x76e4('0x27')]['motionChannel']=_0x877f98[_0x76e4('0x7a')];_0x5ee021['message']['event']=_0x76e4('0x35');respondWithRpcPromise(_0x76e4('0x7d'),_0x76e4('0x7d'),{'event':_0x76e4('0x85'),'message':_0x5ee021[_0x76e4('0x27')]},client9002);return _0x877f98;}return null;})[_0x76e4('0x1f')](respondWithResult(_0x53eb15,null))['catch'](handleError(_0x53eb15,null));};
\ No newline at end of file
index 64045c9..0d6aa32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4974=['emit','hasOwnProperty','hook','exports','OpenchannelMessage','setMaxListeners','update','remove'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x4974,0xd4));var _0x4497=function(_0x389c80,_0x5977d5){_0x389c80=_0x389c80-0x0;var _0x3f643e=_0x4974[_0x389c80];return _0x3f643e;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db'][_0x4497('0x0')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x4497('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4497('0x2'),'afterDestroy':_0x4497('0x3')};function emitEvent(_0x3e6647){return function(_0x1b7d2f,_0x4a523f,_0x40169a){OpenchannelMessageEvents['emit'](_0x3e6647+':'+_0x1b7d2f['id'],_0x1b7d2f);OpenchannelMessageEvents[_0x4497('0x4')](_0x3e6647,_0x1b7d2f);_0x40169a(null);};}for(var e in events){if(events[_0x4497('0x5')](e)){var event=events[e];OpenchannelMessage[_0x4497('0x6')](e,emitEvent(event));}}module[_0x4497('0x7')]=OpenchannelMessageEvents;
\ No newline at end of file
+var _0xb8fc=['OpenchannelMessage','setMaxListeners','remove','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x30db6e,_0x4f0793){var _0x5bedf3=function(_0x1ca2c9){while(--_0x1ca2c9){_0x30db6e['push'](_0x30db6e['shift']());}};_0x5bedf3(++_0x4f0793);}(_0xb8fc,0x1ee));var _0xcb8f=function(_0x528850,_0x5835a4){_0x528850=_0x528850-0x0;var _0x5ad49b=_0xb8fc[_0x528850];return _0x5ad49b;};'use strict';var EventEmitter=require(_0xcb8f('0x0'));var OpenchannelMessage=require(_0xcb8f('0x1'))['db'][_0xcb8f('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xcb8f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xcb8f('0x4')};function emitEvent(_0x1895ba){return function(_0x30bf6f,_0x37a0c6,_0x1579db){OpenchannelMessageEvents['emit'](_0x1895ba+':'+_0x30bf6f['id'],_0x30bf6f);OpenchannelMessageEvents['emit'](_0x1895ba,_0x30bf6f);_0x1579db(null);};}for(var e in events){if(events[_0xcb8f('0x5')](e)){var event=events[e];OpenchannelMessage[_0xcb8f('0x6')](e,emitEvent(event));}}module[_0xcb8f('0x7')]=OpenchannelMessageEvents;
\ No newline at end of file
index 364e9dd..800162c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07a7=['body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','OpenchannelInteraction','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','OpenchannelAccount','OpenchannelAccountId','Interactions','Contact','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','omit','POST','method','GET','threadId','Interaction','inspect','finally','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','path','rimraf','define','OpenchannelMessage'];(function(_0x26d26a,_0x55bc37){var _0x2d75ff=function(_0x33ab63){while(--_0x33ab63){_0x26d26a['push'](_0x26d26a['shift']());}};_0x2d75ff(++_0x55bc37);}(_0x07a7,0x1ba));var _0x707a=function(_0x565dab,_0x500f01){_0x565dab=_0x565dab-0x0;var _0x37a556=_0x07a7[_0x565dab];return _0x37a556;};'use strict';var _=require(_0x707a('0x0'));var util=require('util');var logger=require(_0x707a('0x1'))(_0x707a('0x2'));var moment=require('moment');var BPromise=require(_0x707a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x707a('0x4'));var rimraf=require(_0x707a('0x5'));var config=require('../../config/environment');var attributes=require('./openchannelMessage.attributes');module['exports']=function(_0x238968,_0x5a9f59){return _0x238968[_0x707a('0x6')](_0x707a('0x7'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x707a('0x8')],'type':_0x707a('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1ff685,_0x287a18,_0x2bc218){var _0x53a27d=_0x238968[_0x707a('0xa')];var _0x3bf1cd=_0x1ff685[_0x707a('0xb')]({'plain':!![]});if(_0x3bf1cd[_0x707a('0xc')][_0x707a('0xd')]()==='in'||_0x3bf1cd[_0x707a('0xc')][_0x707a('0xd')]()===_0x707a('0xe')&&!_0x3bf1cd[_0x707a('0xf')]&&!_[_0x707a('0x10')](_0x3bf1cd['UserId'])){_0x53a27d[_0x707a('0x11')]['findOne']({'where':{'id':_0x3bf1cd[_0x707a('0x12')]}})[_0x707a('0x13')](function(_0x1ddf19){if(_0x1ddf19){_0x1ddf19[_0x707a('0x14')]({'lastMsgAt':_0x3bf1cd[_0x707a('0x15')],'lastMsgDirection':_0x3bf1cd[_0x707a('0xc')][_0x707a('0xd')]()});}})[_0x707a('0x16')](function(_0x22d8b7){console[_0x707a('0x17')](_0x22d8b7);});}if(_0x3bf1cd['direction']===_0x707a('0xe')&&!_0x3bf1cd[_0x707a('0xf')]){var _0x56b422;_0x53a27d[_0x707a('0x18')]['describe']()[_0x707a('0x13')](function(_0x11f99f){return _0x53a27d[_0x707a('0x19')]['find']({'where':{'id':_0x3bf1cd[_0x707a('0x1a')]},'include':[{'model':_0x53a27d[_0x707a('0x11')],'as':_0x707a('0x1b'),'where':{'id':_0x3bf1cd[_0x707a('0x12')]},'limit':0x1,'include':[{'model':_0x53a27d[_0x707a('0x18')],'as':_0x707a('0x1c'),'attributes':_['keys'](_0x11f99f)}]}]});})[_0x707a('0x13')](function(_0x13df28){_0x56b422=_0x13df28[_0x707a('0xb')]({'plain':!![]});if(_0x56b422&&_0x56b422['replyUri']){logger[_0x707a('0x1d')](_0x707a('0x1e'),_0x707a('0x1f'),util[_0x707a('0x20')](_0x707a('0x21'),_0x3bf1cd['id'],_0x56b422[_0x707a('0x22')]));if(_0x56b422[_0x707a('0x1b')]&&_0x56b422[_0x707a('0x1b')][_0x707a('0x23')]){_0x3bf1cd['Interaction']=_[_0x707a('0x24')](_0x56b422[_0x707a('0x1b')][0x0],_0x707a('0x1c'));_0x3bf1cd[_0x707a('0x1c')]=_0x56b422[_0x707a('0x1b')][0x0]['Contact'];}var _0x287a18={'method':_0x707a('0x25'),'uri':encodeURI(_0x56b422[_0x707a('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x287a18[_0x707a('0x26')]){case _0x707a('0x27'):_0x287a18['qs']=_0x3bf1cd;break;case'POST':_0x287a18[_0x707a('0x8')]=_0x3bf1cd;break;}return rp(_0x287a18)[_0x707a('0x13')](function(_0x311e87){logger[_0x707a('0x1d')]('OpenchannelMessage,\x20%s,\x20%s',_0x707a('0x1f'),util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x3bf1cd['id'],_0x56b422['replyUri']));if(_0x311e87[_0x707a('0x8')][_0x707a('0x28')]&&_0x311e87['body'][_0x707a('0x28')]!=_0x3bf1cd[_0x707a('0x29')]['threadId']){return _0x53a27d['OpenchannelInteraction']['update']({'threadId':_0x311e87['body']['threadId']},{'where':{'id':_0x3bf1cd['Interaction']['id']}});}else{return;}})['then'](function(){return _0x1ff685[_0x707a('0x14')]({'read':!![]});})[_0x707a('0x16')](function(_0xe63386){logger[_0x707a('0x17')]('OpenchannelMessage,\x20%s,\x20%s',_0x707a('0x1f'),util[_0x707a('0x2a')](_0xe63386,{'showHidden':![],'depth':null}));_0x2bc218();});}else{_0x2bc218();}})[_0x707a('0x2b')](function(){_0x2bc218();});}else{_0x2bc218();}}},'charset':'utf8mb4','collate':_0x707a('0x2c')});};
\ No newline at end of file
+var _0x3d20=['Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','omit','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','inspect','finally','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','OpenchannelInteraction','findOne','update','createdAt','catch','CmContact','then','OpenchannelAccount','find','OpenchannelAccountId'];(function(_0x43e4b3,_0x1444de){var _0x10c655=function(_0x56c01d){while(--_0x56c01d){_0x43e4b3['push'](_0x43e4b3['shift']());}};_0x10c655(++_0x1444de);}(_0x3d20,0x78));var _0x03d2=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x3d20[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require('lodash');var util=require(_0x03d2('0x0'));var logger=require('../../config/logger')(_0x03d2('0x1'));var moment=require(_0x03d2('0x2'));var BPromise=require(_0x03d2('0x3'));var rp=require(_0x03d2('0x4'));var fs=require('fs');var path=require(_0x03d2('0x5'));var rimraf=require(_0x03d2('0x6'));var config=require(_0x03d2('0x7'));var attributes=require(_0x03d2('0x8'));module[_0x03d2('0x9')]=function(_0xca6f9f,_0x10e6ac){return _0xca6f9f['define'](_0x03d2('0xa'),attributes,{'tableName':_0x03d2('0xb'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x03d2('0xc')],'type':_0x03d2('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xf2036f,_0x3e67f1,_0x293f9f){var _0x2420cd=_0xca6f9f[_0x03d2('0xe')];var _0x28085d=_0xf2036f[_0x03d2('0xf')]({'plain':!![]});if(_0x28085d[_0x03d2('0x10')][_0x03d2('0x11')]()==='in'||_0x28085d['direction']['toLowerCase']()===_0x03d2('0x12')&&!_0x28085d[_0x03d2('0x13')]&&!_['isNil'](_0x28085d['UserId'])){_0x2420cd[_0x03d2('0x14')][_0x03d2('0x15')]({'where':{'id':_0x28085d['OpenchannelInteractionId']}})['then'](function(_0x5ec6b3){if(_0x5ec6b3){_0x5ec6b3[_0x03d2('0x16')]({'lastMsgAt':_0x28085d[_0x03d2('0x17')],'lastMsgDirection':_0x28085d['direction'][_0x03d2('0x11')]()});}})[_0x03d2('0x18')](function(_0x5133ca){console['error'](_0x5133ca);});}if(_0x28085d[_0x03d2('0x10')]==='out'&&!_0x28085d[_0x03d2('0x13')]){var _0x2703da;_0x2420cd[_0x03d2('0x19')]['describe']()[_0x03d2('0x1a')](function(_0x7cc4a5){return _0x2420cd[_0x03d2('0x1b')][_0x03d2('0x1c')]({'where':{'id':_0x28085d[_0x03d2('0x1d')]},'include':[{'model':_0x2420cd[_0x03d2('0x14')],'as':'Interactions','where':{'id':_0x28085d['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x2420cd[_0x03d2('0x19')],'as':_0x03d2('0x1e'),'attributes':_[_0x03d2('0x1f')](_0x7cc4a5)}]}]});})['then'](function(_0x16124b){_0x2703da=_0x16124b[_0x03d2('0xf')]({'plain':!![]});if(_0x2703da&&_0x2703da[_0x03d2('0x20')]){logger[_0x03d2('0x21')](_0x03d2('0x22'),_0x03d2('0x23'),util[_0x03d2('0x24')](_0x03d2('0x25'),_0x28085d['id'],_0x2703da[_0x03d2('0x20')]));if(_0x2703da[_0x03d2('0x26')]&&_0x2703da['Interactions'][_0x03d2('0x27')]){_0x28085d['Interaction']=_[_0x03d2('0x28')](_0x2703da[_0x03d2('0x26')][0x0],_0x03d2('0x1e'));_0x28085d['Contact']=_0x2703da[_0x03d2('0x26')][0x0]['Contact'];}var _0x3e67f1={'method':'POST','uri':encodeURI(_0x2703da['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3e67f1[_0x03d2('0x29')]){case _0x03d2('0x2a'):_0x3e67f1['qs']=_0x28085d;break;case'POST':_0x3e67f1['body']=_0x28085d;break;}return rp(_0x3e67f1)['then'](function(_0x5bad42){logger['info'](_0x03d2('0x22'),'afterCreate',util[_0x03d2('0x24')](_0x03d2('0x2b'),_0x28085d['id'],_0x2703da['replyUri']));if(_0x5bad42[_0x03d2('0xc')][_0x03d2('0x2c')]&&_0x5bad42[_0x03d2('0xc')][_0x03d2('0x2c')]!=_0x28085d['Interaction'][_0x03d2('0x2c')]){return _0x2420cd[_0x03d2('0x14')]['update']({'threadId':_0x5bad42['body']['threadId']},{'where':{'id':_0x28085d[_0x03d2('0x2d')]['id']}});}else{return;}})[_0x03d2('0x1a')](function(){return _0xf2036f['update']({'read':!![]});})[_0x03d2('0x18')](function(_0x15b48d){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x03d2('0x23'),util[_0x03d2('0x2e')](_0x15b48d,{'showHidden':![],'depth':null}));_0x293f9f();});}else{_0x293f9f();}})[_0x03d2('0x2f')](function(){_0x293f9f();});}else{_0x293f9f();}}},'charset':_0x03d2('0x30'),'collate':_0x03d2('0x31')});};
\ No newline at end of file
index 5f13a51..4c9ad20 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(_0x2ab42f,_0x58dc9b){var _0x167e06=function(_0x27d672){while(--_0x27d672){_0x2ab42f['push'](_0x2ab42f['shift']());}};_0x167e06(++_0x58dc9b);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5f66[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});};
\ No newline at end of file
+var _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x6fc409,_0x29201d){var _0x56de23=function(_0x17032f){while(--_0x17032f){_0x6fc409['push'](_0x6fc409['shift']());}};_0x56de23(++_0x29201d);}(_0x5f2f,0x73));var _0xf5f2=function(_0xe150e8,_0x4f6c77){_0xe150e8=_0xe150e8-0x0;var _0x1053d3=_0x5f2f[_0xe150e8];return _0x1053d3;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});};
\ No newline at end of file
index bf79d73..fc950c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3339=['save','remove','update','emit','openchannelMessage:','./openchannelMessage.events'];(function(_0x879b3f,_0x213e3d){var _0x4e64fa=function(_0x3fd1cf){while(--_0x3fd1cf){_0x879b3f['push'](_0x879b3f['shift']());}};_0x4e64fa(++_0x213e3d);}(_0x3339,0x19d));var _0x9333=function(_0x4b28cb,_0x4d80b1){_0x4b28cb=_0x4b28cb-0x0;var _0x24ae9b=_0x3339[_0x4b28cb];return _0x24ae9b;};'use strict';var OpenchannelMessageEvents=require(_0x9333('0x0'));var events=[_0x9333('0x1'),_0x9333('0x2'),_0x9333('0x3')];function createListener(_0x52e097,_0x47fde4){return function(_0x22eac0){_0x47fde4[_0x9333('0x4')](_0x52e097,_0x22eac0);};}function removeListener(_0x4fbf4d,_0x29c3a3){return function(){OpenchannelMessageEvents['removeListener'](_0x4fbf4d,_0x29c3a3);};}exports['register']=function(_0x10c741){for(var _0x4e19c7=0x0,_0x2fbf96=events['length'];_0x4e19c7<_0x2fbf96;_0x4e19c7++){var _0x3fe466=events[_0x4e19c7];var _0x51e0c8=createListener(_0x9333('0x5')+_0x3fe466,_0x10c741);OpenchannelMessageEvents['on'](_0x3fe466,_0x51e0c8);}};
\ No newline at end of file
+var _0x9a5e=['remove','update','emit','removeListener','register','length','./openchannelMessage.events','save'];(function(_0xf8a0f2,_0x18f2a7){var _0xa5b470=function(_0x304875){while(--_0x304875){_0xf8a0f2['push'](_0xf8a0f2['shift']());}};_0xa5b470(++_0x18f2a7);}(_0x9a5e,0xee));var _0xe9a5=function(_0x231206,_0x152389){_0x231206=_0x231206-0x0;var _0x492bc9=_0x9a5e[_0x231206];return _0x492bc9;};'use strict';var OpenchannelMessageEvents=require(_0xe9a5('0x0'));var events=[_0xe9a5('0x1'),_0xe9a5('0x2'),_0xe9a5('0x3')];function createListener(_0x271398,_0x3b9db2){return function(_0x3fffc3){_0x3b9db2[_0xe9a5('0x4')](_0x271398,_0x3fffc3);};}function removeListener(_0x3ba487,_0x58754b){return function(){OpenchannelMessageEvents[_0xe9a5('0x5')](_0x3ba487,_0x58754b);};}exports[_0xe9a5('0x6')]=function(_0x462b43){for(var _0x4d1c37=0x0,_0x56f4f6=events[_0xe9a5('0x7')];_0x4d1c37<_0x56f4f6;_0x4d1c37++){var _0x59d668=events[_0x4d1c37];var _0xacd9ec=createListener('openchannelMessage:'+_0x59d668,_0x462b43);OpenchannelMessageEvents['on'](_0x59d668,_0xacd9ec);}};
\ No newline at end of file
index 72d2ad6..2141b42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ffd=['removeAgents','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams'];(function(_0x4f1651,_0xc4ac4f){var _0x44868e=function(_0x2a2ec1){while(--_0x2a2ec1){_0x4f1651['push'](_0x4f1651['shift']());}};_0x44868e(++_0xc4ac4f);}(_0x8ffd,0x12b));var _0xd8ff=function(_0x2d2ec8,_0x3f04b1){_0x2d2ec8=_0x2d2ec8-0x0;var _0x30e4e9=_0x8ffd[_0x2d2ec8];return _0x30e4e9;};'use strict';var multer=require('multer');var util=require(_0xd8ff('0x0'));var path=require('path');var timeout=require(_0xd8ff('0x1'));var express=require('express');var router=express[_0xd8ff('0x2')]();var fs_extra=require(_0xd8ff('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd8ff('0x4'));var config=require(_0xd8ff('0x5'));var controller=require(_0xd8ff('0x6'));router[_0xd8ff('0x7')]('/',auth[_0xd8ff('0x8')](),controller[_0xd8ff('0x9')]);router[_0xd8ff('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xd8ff('0x7')](_0xd8ff('0xa'),auth['isAuthenticated'](),controller[_0xd8ff('0xb')]);router['get'](_0xd8ff('0xc'),auth[_0xd8ff('0x8')](),controller[_0xd8ff('0xd')]);router[_0xd8ff('0x7')](_0xd8ff('0xe'),auth[_0xd8ff('0x8')](),controller['getTeams']);router[_0xd8ff('0x7')](_0xd8ff('0xf'),auth[_0xd8ff('0x8')](),controller[_0xd8ff('0x10')]);router[_0xd8ff('0x11')]('/',auth[_0xd8ff('0x8')](),controller[_0xd8ff('0x12')]);router[_0xd8ff('0x11')](_0xd8ff('0xe'),auth[_0xd8ff('0x8')](),controller[_0xd8ff('0x13')]);router[_0xd8ff('0x11')](_0xd8ff('0xf'),auth['isAuthenticated'](),controller[_0xd8ff('0x14')]);router[_0xd8ff('0x15')](_0xd8ff('0xa'),auth[_0xd8ff('0x8')](),controller[_0xd8ff('0x16')]);router[_0xd8ff('0x17')](_0xd8ff('0xa'),auth[_0xd8ff('0x8')](),controller['destroy']);router['delete'](_0xd8ff('0xe'),auth[_0xd8ff('0x8')](),controller[_0xd8ff('0x18')]);router['delete'](_0xd8ff('0xf'),auth[_0xd8ff('0x8')](),controller[_0xd8ff('0x19')]);module[_0xd8ff('0x1a')]=router;
\ No newline at end of file
+var _0x168f=['post','create','addTeams','/:id/users','addAgents','put','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','getTeams'];(function(_0x4cc665,_0x284634){var _0x823e6b=function(_0x30eda7){while(--_0x30eda7){_0x4cc665['push'](_0x4cc665['shift']());}};_0x823e6b(++_0x284634);}(_0x168f,0x141));var _0xf168=function(_0x1d930e,_0x20d8b8){_0x1d930e=_0x1d930e-0x0;var _0x5bbd66=_0x168f[_0x1d930e];return _0x5bbd66;};'use strict';var multer=require(_0xf168('0x0'));var util=require(_0xf168('0x1'));var path=require(_0xf168('0x2'));var timeout=require('connect-timeout');var express=require(_0xf168('0x3'));var router=express[_0xf168('0x4')]();var fs_extra=require(_0xf168('0x5'));var auth=require(_0xf168('0x6'));var interaction=require(_0xf168('0x7'));var config=require(_0xf168('0x8'));var controller=require(_0xf168('0x9'));router[_0xf168('0xa')]('/',auth['isAuthenticated'](),controller[_0xf168('0xb')]);router['get'](_0xf168('0xc'),auth[_0xf168('0xd')](),controller['describe']);router[_0xf168('0xa')](_0xf168('0xe'),auth[_0xf168('0xd')](),controller[_0xf168('0xf')]);router[_0xf168('0xa')](_0xf168('0x10'),auth[_0xf168('0xd')](),controller[_0xf168('0x11')]);router[_0xf168('0xa')](_0xf168('0x12'),auth[_0xf168('0xd')](),controller[_0xf168('0x13')]);router['get']('/:id/users',auth[_0xf168('0xd')](),controller['getAgents']);router[_0xf168('0x14')]('/',auth['isAuthenticated'](),controller[_0xf168('0x15')]);router[_0xf168('0x14')](_0xf168('0x12'),auth[_0xf168('0xd')](),controller[_0xf168('0x16')]);router[_0xf168('0x14')](_0xf168('0x17'),auth[_0xf168('0xd')](),controller[_0xf168('0x18')]);router[_0xf168('0x19')](_0xf168('0xe'),auth[_0xf168('0xd')](),controller['update']);router['delete'](_0xf168('0xe'),auth[_0xf168('0xd')](),controller[_0xf168('0x1a')]);router[_0xf168('0x1b')](_0xf168('0x12'),auth[_0xf168('0xd')](),controller[_0xf168('0x1c')]);router[_0xf168('0x1b')](_0xf168('0x17'),auth[_0xf168('0xd')](),controller[_0xf168('0x1d')]);module[_0xf168('0x1e')]=router;
\ No newline at end of file
index 99d69c9..87c73d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2c7=['beepall','sequelize','STRING','name','ENUM','rrmemory'];(function(_0x4ea8a4,_0x381baa){var _0x128999=function(_0x5edce4){while(--_0x5edce4){_0x4ea8a4['push'](_0x4ea8a4['shift']());}};_0x128999(++_0x381baa);}(_0xc2c7,0x151));var _0x7c2c=function(_0x342eb1,_0x54e4c2){_0x342eb1=_0x342eb1-0x0;var _0x31e4a9=_0xc2c7[_0x342eb1];return _0x31e4a9;};'use strict';var Sequelize=require(_0x7c2c('0x0'));module['exports']={'name':{'type':Sequelize[_0x7c2c('0x1')],'unique':_0x7c2c('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7c2c('0x3')](_0x7c2c('0x4'),_0x7c2c('0x5'),'roundrobin')}};
\ No newline at end of file
+var _0x526c=['sequelize','exports','STRING','name','ENUM','roundrobin'];(function(_0xe493c8,_0x69c7cd){var _0x9093d6=function(_0x3af4c0){while(--_0x3af4c0){_0xe493c8['push'](_0xe493c8['shift']());}};_0x9093d6(++_0x69c7cd);}(_0x526c,0x18c));var _0xc526=function(_0x26dda0,_0x5b58ab){_0x26dda0=_0x26dda0-0x0;var _0x41089c=_0x526c[_0x26dda0];return _0x41089c;};'use strict';var Sequelize=require(_0xc526('0x0'));module[_0xc526('0x1')]={'name':{'type':Sequelize[_0xc526('0x2')],'unique':_0xc526('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc526('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc526('0x4')]('rrmemory','beepall',_0xc526('0x5'))}};
\ No newline at end of file
index 0886024..c95ebdd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a86=['get','UserOpenchannelQueue','OpenchannelQueueId','findAll','findAndCountAll','UserId','agent','updatedAt','createdAt','count','format','%s/%s','SIP','openchannelPause','Team','getTeams','addTeams','ids','online','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','userOpenchannelQueue:save','removeTeams','User','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','sequelize','toString','every','TeamId','includes','all','compact','isEmpty','removeAgents','addAgents','omit','spread','emit','isArray','userOpenchannelQueue:remove','getAgents','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','ejs','fs-extra','lodash','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','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers'];(function(_0x3e18e8,_0x3e1a25){var _0xd23fae=function(_0x9f7100){while(--_0x9f7100){_0x3e18e8['push'](_0x3e18e8['shift']());}};_0xd23fae(++_0x3e1a25);}(_0x3a86,0xcb));var _0x63a8=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x3a86[_0x455c6c];return _0x488242;};'use strict';var emlformat=require(_0x63a8('0x0'));var rimraf=require(_0x63a8('0x1'));var zipdir=require(_0x63a8('0x2'));var jsonpatch=require(_0x63a8('0x3'));var rp=require(_0x63a8('0x4'));var moment=require(_0x63a8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x63a8('0x6'));var util=require('util');var path=require('path');var sox=require(_0x63a8('0x7'));var csv=require('to-csv');var ejs=require(_0x63a8('0x8'));var fs=require('fs');var fs_extra=require(_0x63a8('0x9'));var _=require(_0x63a8('0xa'));var squel=require(_0x63a8('0xb'));var crypto=require(_0x63a8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x63a8('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x63a8('0xe'));var Redis=require('ioredis');var authService=require(_0x63a8('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x63a8('0x10'));var hardwareService=require(_0x63a8('0x11'));var logger=require(_0x63a8('0x12'))(_0x63a8('0x13'));var utils=require(_0x63a8('0x14'));var config=require(_0x63a8('0x15'));var licenseUtil=require(_0x63a8('0x16'));var db=require(_0x63a8('0x17'))['db'];config[_0x63a8('0x18')]=_[_0x63a8('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x63a8('0x1a'))(new Redis(config[_0x63a8('0x18')]));require('./openchannelQueue.socket')[_0x63a8('0x1b')](socket);function respondWithStatusCode(_0x4c0326,_0x220e1c){_0x220e1c=_0x220e1c||0xcc;return function(_0x2dca2d){if(_0x2dca2d){return _0x4c0326[_0x63a8('0x1c')](_0x220e1c);}return _0x4c0326[_0x63a8('0x1d')](_0x220e1c)[_0x63a8('0x1e')]();};}function respondWithResult(_0x745f6b,_0x2dc5b0){_0x2dc5b0=_0x2dc5b0||0xc8;return function(_0x3e1ec2){if(_0x3e1ec2){return _0x745f6b[_0x63a8('0x1d')](_0x2dc5b0)[_0x63a8('0x1f')](_0x3e1ec2);}};}function respondWithFilteredResult(_0x25260b,_0x5d423c){return function(_0xdbf2a1){if(_0xdbf2a1){var _0x4d8c87=typeof _0x5d423c[_0x63a8('0x20')]==='undefined'&&typeof _0x5d423c['limit']==='undefined';var _0x31cfb7=_0xdbf2a1['count'];var _0x3d9f3b=_0x4d8c87?0x0:_0x5d423c[_0x63a8('0x20')];var _0x4997dc=_0x4d8c87?_0xdbf2a1['count']:_0x5d423c[_0x63a8('0x20')]+_0x5d423c['limit'];var _0x812589;if(_0x4997dc>=_0x31cfb7){_0x4997dc=_0x31cfb7;_0x812589=0xc8;}else{_0x812589=0xce;}_0x25260b[_0x63a8('0x1d')](_0x812589);return _0x25260b[_0x63a8('0x21')](_0x63a8('0x22'),_0x3d9f3b+'-'+_0x4997dc+'/'+_0x31cfb7)[_0x63a8('0x1f')](_0xdbf2a1);}return null;};}function patchUpdates(_0x909e0d){return function(_0x38edcd){try{jsonpatch[_0x63a8('0x23')](_0x38edcd,_0x909e0d,!![]);}catch(_0x56bc8f){return BPromise[_0x63a8('0x24')](_0x56bc8f);}return _0x38edcd[_0x63a8('0x25')]();};}function saveUpdates(_0x2ef6ee,_0x4c8c76){return function(_0xbb560){if(_0xbb560){return _0xbb560[_0x63a8('0x26')](_0x2ef6ee)[_0x63a8('0x27')](function(_0x23f2c3){return _0x23f2c3;});}return null;};}function removeEntity(_0x417af8,_0x2869d7){return function(_0x1279ec){if(_0x1279ec){return _0x1279ec[_0x63a8('0x28')]()[_0x63a8('0x27')](function(){var _0x4f53b4=_0x1279ec['get']({'plain':!![]});var _0x7c8ee0='OpenchannelQueues';return db['UserProfileResource'][_0x63a8('0x28')]({'where':{'type':_0x7c8ee0,'resourceId':_0x4f53b4['id']}})[_0x63a8('0x27')](function(){return _0x1279ec;});})['then'](function(){_0x417af8[_0x63a8('0x1d')](0xcc)[_0x63a8('0x1e')]();});}};}function handleEntityNotFound(_0x4e7b55,_0x41597b){return function(_0x553097){if(!_0x553097){_0x4e7b55[_0x63a8('0x1c')](0x194);}return _0x553097;};}function handleError(_0x51364a,_0x3848d3){_0x3848d3=_0x3848d3||0x1f4;return function(_0xf46836){logger[_0x63a8('0x29')](_0xf46836[_0x63a8('0x2a')]);if(_0xf46836[_0x63a8('0x2b')]){delete _0xf46836[_0x63a8('0x2b')];}_0x51364a[_0x63a8('0x1d')](_0x3848d3)[_0x63a8('0x2c')](_0xf46836);};}exports[_0x63a8('0x2d')]=function(_0x229642,_0x1892c2){var _0x46e920={},_0x26f5ba={},_0x51b3d7={'count':0x0,'rows':[]};var _0x2e9d9d=_[_0x63a8('0x2e')](db[_0x63a8('0x2f')][_0x63a8('0x30')],function(_0x48c8ba){return{'name':_0x48c8ba['fieldName'],'type':_0x48c8ba[_0x63a8('0x31')][_0x63a8('0x32')]};});_0x26f5ba[_0x63a8('0x33')]=_[_0x63a8('0x2e')](_0x2e9d9d,_0x63a8('0x2b'));_0x26f5ba[_0x63a8('0x34')]=_['keys'](_0x229642[_0x63a8('0x34')]);_0x26f5ba['filters']=_[_0x63a8('0x35')](_0x26f5ba[_0x63a8('0x33')],_0x26f5ba[_0x63a8('0x34')]);_0x46e920[_0x63a8('0x36')]=_[_0x63a8('0x35')](_0x26f5ba['model'],qs[_0x63a8('0x37')](_0x229642[_0x63a8('0x34')]['fields']));_0x46e920[_0x63a8('0x36')]=_0x46e920[_0x63a8('0x36')][_0x63a8('0x38')]?_0x46e920[_0x63a8('0x36')]:_0x26f5ba[_0x63a8('0x33')];if(!_0x229642[_0x63a8('0x34')][_0x63a8('0x39')](_0x63a8('0x3a'))){_0x46e920[_0x63a8('0x3b')]=qs[_0x63a8('0x3b')](_0x229642[_0x63a8('0x34')]['limit']);_0x46e920[_0x63a8('0x20')]=qs[_0x63a8('0x20')](_0x229642[_0x63a8('0x34')][_0x63a8('0x20')]);}_0x46e920[_0x63a8('0x3c')]=qs[_0x63a8('0x3d')](_0x229642[_0x63a8('0x34')]['sort']);_0x46e920[_0x63a8('0x3e')]=qs[_0x63a8('0x3f')](_[_0x63a8('0x40')](_0x229642[_0x63a8('0x34')],_0x26f5ba[_0x63a8('0x3f')]),_0x2e9d9d);if(_0x229642['query'][_0x63a8('0x41')]){_0x46e920['where']=_[_0x63a8('0x42')](_0x46e920['where'],{'$or':_[_0x63a8('0x2e')](_0x2e9d9d,function(_0x11adea){if(_0x11adea['type']!==_0x63a8('0x43')){var _0x4717a7={};_0x4717a7[_0x11adea[_0x63a8('0x2b')]]={'$like':'%'+_0x229642[_0x63a8('0x34')]['filter']+'%'};return _0x4717a7;}})});}_0x46e920=_[_0x63a8('0x42')]({},_0x46e920,_0x229642[_0x63a8('0x44')]);var _0x3b18c6={'where':_0x46e920[_0x63a8('0x3e')]};return db['OpenchannelQueue']['count'](_0x3b18c6)[_0x63a8('0x27')](function(_0x571070){_0x51b3d7['count']=_0x571070;if(_0x229642[_0x63a8('0x34')][_0x63a8('0x45')]){_0x46e920[_0x63a8('0x46')]=[{'all':!![]}];}return db[_0x63a8('0x2f')]['findAll'](_0x46e920);})[_0x63a8('0x27')](function(_0x185185){_0x51b3d7[_0x63a8('0x47')]=_0x185185;return _0x51b3d7;})['then'](respondWithFilteredResult(_0x1892c2,_0x46e920))[_0x63a8('0x48')](handleError(_0x1892c2,null));};exports[_0x63a8('0x49')]=function(_0x498aae,_0x222f82){var _0x55de23={'raw':!![],'where':{'id':_0x498aae[_0x63a8('0x4a')]['id']}},_0x563f3a={};_0x563f3a['model']=_[_0x63a8('0x4b')](db['OpenchannelQueue']['rawAttributes']);_0x563f3a['query']=_[_0x63a8('0x4b')](_0x498aae[_0x63a8('0x34')]);_0x563f3a[_0x63a8('0x3f')]=_[_0x63a8('0x35')](_0x563f3a[_0x63a8('0x33')],_0x563f3a[_0x63a8('0x34')]);_0x55de23['attributes']=_[_0x63a8('0x35')](_0x563f3a['model'],qs['fields'](_0x498aae['query'][_0x63a8('0x37')]));_0x55de23[_0x63a8('0x36')]=_0x55de23[_0x63a8('0x36')]['length']?_0x55de23[_0x63a8('0x36')]:_0x563f3a['model'];if(_0x498aae[_0x63a8('0x34')]['includeAll']){_0x55de23['include']=[{'all':!![]}];}_0x55de23=_[_0x63a8('0x42')]({},_0x55de23,_0x498aae[_0x63a8('0x44')]);return db[_0x63a8('0x2f')][_0x63a8('0x4c')](_0x55de23)[_0x63a8('0x27')](handleEntityNotFound(_0x222f82,null))[_0x63a8('0x27')](respondWithResult(_0x222f82,null))[_0x63a8('0x48')](handleError(_0x222f82,null));};exports[_0x63a8('0x4d')]=function(_0x29e680,_0x2090df){return db['OpenchannelQueue'][_0x63a8('0x4d')](_0x29e680[_0x63a8('0x4e')],{})[_0x63a8('0x27')](function(_0x4d8d13){var _0x107f64=_0x29e680[_0x63a8('0x4f')]['get']({'plain':!![]});if(!_0x107f64)throw new Error(_0x63a8('0x50'));if(_0x107f64[_0x63a8('0x51')]===_0x63a8('0x4f')){var _0x4f107f=_0x4d8d13['get']({'plain':!![]});var _0x1f9c67=_0x63a8('0x52');return db[_0x63a8('0x53')][_0x63a8('0x4c')]({'where':{'name':_0x1f9c67,'userProfileId':_0x107f64[_0x63a8('0x54')]},'raw':!![]})['then'](function(_0x316bce){if(_0x316bce&&_0x316bce[_0x63a8('0x55')]===0x0){return db['UserProfileResource'][_0x63a8('0x4d')]({'name':_0x4f107f['name'],'resourceId':_0x4f107f['id'],'type':_0x316bce[_0x63a8('0x2b')],'sectionId':_0x316bce['id']},{})[_0x63a8('0x27')](function(){return _0x4d8d13;});}else{return _0x4d8d13;}})[_0x63a8('0x48')](function(_0x23e8c2){logger[_0x63a8('0x29')](_0x63a8('0x56'),_0x23e8c2);throw _0x23e8c2;});}return _0x4d8d13;})[_0x63a8('0x27')](respondWithResult(_0x2090df,0xc9))[_0x63a8('0x48')](handleError(_0x2090df,null));};exports['update']=function(_0x445f22,_0x46487c){if(_0x445f22[_0x63a8('0x4e')]['id']){delete _0x445f22[_0x63a8('0x4e')]['id'];}return db[_0x63a8('0x2f')][_0x63a8('0x4c')]({'where':{'id':_0x445f22['params']['id']}})[_0x63a8('0x27')](handleEntityNotFound(_0x46487c,null))['then'](saveUpdates(_0x445f22['body'],null))['then'](respondWithResult(_0x46487c,null))['catch'](handleError(_0x46487c,null));};exports[_0x63a8('0x28')]=function(_0x563761,_0x2b7d19){return db['OpenchannelQueue']['find']({'where':{'id':_0x563761[_0x63a8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2b7d19,null))[_0x63a8('0x27')](removeEntity(_0x2b7d19,null))[_0x63a8('0x48')](handleError(_0x2b7d19,null));};exports['describe']=function(_0x2b6ce1,_0x22d97b){return db[_0x63a8('0x2f')][_0x63a8('0x57')]()[_0x63a8('0x27')](respondWithResult(_0x22d97b,null))[_0x63a8('0x48')](handleError(_0x22d97b,null));};exports[_0x63a8('0x58')]=function(_0x37a2eb,_0x208abc,_0x2de7d0){var _0x4141f0={'raw':!![],'where':{}},_0x2a5c5f={},_0x2c7bc1;return db[_0x63a8('0x2f')]['findOne']({'where':{'id':_0x37a2eb[_0x63a8('0x4a')]['id']}})[_0x63a8('0x27')](handleEntityNotFound(_0x208abc,null))[_0x63a8('0x27')](function(_0x56afc9){if(_0x56afc9){_0x2c7bc1=_0x56afc9[_0x63a8('0x59')]({'plain':!![]});_0x2a5c5f[_0x63a8('0x33')]=_[_0x63a8('0x4b')](db[_0x63a8('0x5a')][_0x63a8('0x30')]);_0x2a5c5f[_0x63a8('0x34')]=_[_0x63a8('0x4b')](_0x37a2eb['query']);_0x2a5c5f[_0x63a8('0x3f')]=_[_0x63a8('0x35')](_0x2a5c5f[_0x63a8('0x33')],_0x2a5c5f['query']);_0x4141f0['attributes']=_[_0x63a8('0x35')](_0x2a5c5f[_0x63a8('0x33')],qs['fields'](_0x37a2eb['query'][_0x63a8('0x37')]));_0x4141f0[_0x63a8('0x36')]=_0x4141f0[_0x63a8('0x36')][_0x63a8('0x38')]?_0x4141f0[_0x63a8('0x36')]:_0x2a5c5f[_0x63a8('0x33')];if(!_0x37a2eb[_0x63a8('0x34')]['hasOwnProperty']('nolimit')){_0x4141f0[_0x63a8('0x3b')]=qs[_0x63a8('0x3b')](_0x37a2eb[_0x63a8('0x34')]['limit']);_0x4141f0['offset']=qs[_0x63a8('0x20')](_0x37a2eb[_0x63a8('0x34')][_0x63a8('0x20')]);}_0x4141f0[_0x63a8('0x3c')]=qs[_0x63a8('0x3d')](_0x37a2eb[_0x63a8('0x34')][_0x63a8('0x3d')]);_0x4141f0[_0x63a8('0x3e')]=qs[_0x63a8('0x3f')](_[_0x63a8('0x40')](_0x37a2eb[_0x63a8('0x34')],_0x2a5c5f[_0x63a8('0x3f')]));_0x4141f0['where'][_0x63a8('0x5b')]=_0x56afc9['id'];if(_0x37a2eb[_0x63a8('0x34')][_0x63a8('0x41')]){_0x4141f0[_0x63a8('0x3e')]=_[_0x63a8('0x42')](_0x4141f0[_0x63a8('0x3e')],{'$or':_[_0x63a8('0x2e')](_0x4141f0[_0x63a8('0x36')],function(_0x52e95b){var _0x5bf554={};_0x5bf554[_0x52e95b]={'$like':'%'+_0x37a2eb[_0x63a8('0x34')][_0x63a8('0x41')]+'%'};return _0x5bf554;})});}_0x4141f0=_['merge']({},_0x4141f0,_0x37a2eb[_0x63a8('0x44')]);return db[_0x63a8('0x5a')][_0x63a8('0x5c')](_0x4141f0);}})[_0x63a8('0x27')](function(_0x1628f2){if(_0x1628f2){return db['User'][_0x63a8('0x5d')]({'where':{'id':_[_0x63a8('0x2e')](_0x1628f2,_0x63a8('0x5e')),'role':_0x63a8('0x5f')},'attributes':['id',_0x63a8('0x2b'),'openchannelPause',_0x63a8('0x60'),_0x63a8('0x61')]});}})[_0x63a8('0x27')](function(_0x194053){if(_0x194053){return{'count':_0x194053[_0x63a8('0x62')],'rows':_[_0x63a8('0x2e')](_0x194053['rows'],function(_0x5c4699){return{'membername':_0x5c4699[_0x63a8('0x2b')],'UserId':_0x5c4699['id'],'queue_name':_0x2c7bc1['name'],'OpenchannelQueueId':_0x2c7bc1['id'],'interface':util[_0x63a8('0x63')](_0x63a8('0x64'),_0x63a8('0x65'),_0x5c4699[_0x63a8('0x2b')]),'penalty':0x0,'paused':_0x5c4699[_0x63a8('0x66')],'createdAt':_0x5c4699['createdAt'],'updatedAt':_0x5c4699[_0x63a8('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x63a8('0x27')](respondWithFilteredResult(_0x208abc,_0x4141f0))[_0x63a8('0x48')](handleError(_0x208abc,null));};exports['getTeams']=function(_0x3d4bea,_0x49d10d,_0x2d13bb){var _0x42966a={};var _0x50e0e9={};var _0x40703f;var _0x1fd77d;return db[_0x63a8('0x2f')]['findOne']({'where':{'id':_0x3d4bea[_0x63a8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x49d10d,null))['then'](function(_0x377217){if(_0x377217){_0x40703f=_0x377217;_0x50e0e9[_0x63a8('0x33')]=_[_0x63a8('0x4b')](db[_0x63a8('0x67')][_0x63a8('0x30')]);_0x50e0e9[_0x63a8('0x34')]=_['keys'](_0x3d4bea['query']);_0x50e0e9[_0x63a8('0x3f')]=_[_0x63a8('0x35')](_0x50e0e9[_0x63a8('0x33')],_0x50e0e9[_0x63a8('0x34')]);_0x42966a[_0x63a8('0x36')]=_[_0x63a8('0x35')](_0x50e0e9[_0x63a8('0x33')],qs['fields'](_0x3d4bea[_0x63a8('0x34')][_0x63a8('0x37')]));_0x42966a[_0x63a8('0x36')]=_0x42966a['attributes'][_0x63a8('0x38')]?_0x42966a[_0x63a8('0x36')]:_0x50e0e9[_0x63a8('0x33')];_0x42966a[_0x63a8('0x3c')]=qs[_0x63a8('0x3d')](_0x3d4bea[_0x63a8('0x34')][_0x63a8('0x3d')]);_0x42966a[_0x63a8('0x3e')]=qs[_0x63a8('0x3f')](_[_0x63a8('0x40')](_0x3d4bea['query'],_0x50e0e9[_0x63a8('0x3f')]));if(_0x3d4bea[_0x63a8('0x34')][_0x63a8('0x41')]){_0x42966a[_0x63a8('0x3e')]=_[_0x63a8('0x42')](_0x42966a[_0x63a8('0x3e')],{'$or':_[_0x63a8('0x2e')](_0x42966a[_0x63a8('0x36')],function(_0x414fa4){var _0x1d91e0={};_0x1d91e0[_0x414fa4]={'$like':'%'+_0x3d4bea[_0x63a8('0x34')][_0x63a8('0x41')]+'%'};return _0x1d91e0;})});}_0x42966a=_[_0x63a8('0x42')]({},_0x42966a,_0x3d4bea[_0x63a8('0x44')]);return _0x40703f[_0x63a8('0x68')](_0x42966a);}})[_0x63a8('0x27')](function(_0x382228){if(_0x382228){_0x1fd77d=_0x382228[_0x63a8('0x38')];if(!_0x3d4bea[_0x63a8('0x34')][_0x63a8('0x39')](_0x63a8('0x3a'))){_0x42966a['limit']=qs['limit'](_0x3d4bea['query']['limit']);_0x42966a[_0x63a8('0x20')]=qs['offset'](_0x3d4bea[_0x63a8('0x34')][_0x63a8('0x20')]);}return _0x40703f[_0x63a8('0x68')](_0x42966a);}})[_0x63a8('0x27')](function(_0x4808ab){if(_0x4808ab){return _0x4808ab?{'count':_0x1fd77d,'rows':_0x4808ab}:null;}})[_0x63a8('0x27')](respondWithResult(_0x49d10d,null))[_0x63a8('0x48')](handleError(_0x49d10d,null));};exports[_0x63a8('0x69')]=function(_0x24a68f,_0x58129c,_0x3df036){var _0x19b14b=_0x24a68f[_0x63a8('0x4e')][_0x63a8('0x6a')];return db['Team'][_0x63a8('0x5c')]({'where':{'id':_0x19b14b},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x63a8('0x6b'),_0x63a8('0x6c'),_0x63a8('0x6d')],'raw':!![]}]})[_0x63a8('0x27')](function(_0x597e97){if(_0x597e97){var _0x2928e8=_[_0x63a8('0x6e')](_0x597e97,function(_0x335251){var _0x4db8fa=_0x335251[_0x63a8('0x59')]({'plain':!![]});return _0x4db8fa[_0x63a8('0x6f')];});return db[_0x63a8('0x2f')][_0x63a8('0x4c')]({'where':{'id':_0x24a68f['params']['id']}})[_0x63a8('0x27')](function(_0x22f63a){return db['sequelize'][_0x63a8('0x70')](function(_0x4911d0){return _0x22f63a[_0x63a8('0x69')](_0x19b14b,{'transaction':_0x4911d0})[_0x63a8('0x27')](function(){return BPromise[_0x63a8('0x71')](_0x2928e8,function(_0x7cc71e){return db[_0x63a8('0x5a')][_0x63a8('0x72')]({'where':{'UserId':_0x7cc71e['id'],'OpenchannelQueueId':_0x24a68f[_0x63a8('0x4a')]['id']},'transaction':_0x4911d0});});})[_0x63a8('0x27')](function(){_0x2928e8['forEach'](function(_0x3d129f){socket['emit'](_0x63a8('0x73'),{'UserId':_0x3d129f['id'],'OpenchannelQueueId':_0x22f63a['id']});});});});});}})[_0x63a8('0x27')](respondWithStatusCode(_0x58129c,null))['catch'](handleError(_0x58129c,null));};exports[_0x63a8('0x74')]=function(_0x443445,_0x4721d8,_0x232782){return db['Team']['findAll']({'where':{'id':_0x443445['query'][_0x63a8('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x63a8('0x75')],'as':_0x63a8('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x63a8('0x27')](handleEntityNotFound(_0x4721d8,null))['then'](function(_0x48a373){var _0x2ad97c=_[_0x63a8('0x2e')](_0x48a373,'id');var _0x19604d=[];var _0x1da5e0=[];var _0x2f335c=squel[_0x63a8('0x76')]();_0x2f335c[_0x63a8('0x77')](_0x63a8('0x78'))[_0x63a8('0x79')](_0x63a8('0x7a'),'tq')[_0x63a8('0x7b')](_0x63a8('0x7c'),'ut',_0x63a8('0x7d'))[_0x63a8('0x3e')](_0x63a8('0x7e'),_0x443445[_0x63a8('0x4a')]['id']);for(var _0x19b439=0x0;_0x19b439<_0x48a373[_0x63a8('0x38')];_0x19b439+=0x1){let _0x58df4b=_0x48a373[_0x19b439];for(var _0x15d5a2=0x0;_0x15d5a2<_0x58df4b[_0x63a8('0x6f')][_0x63a8('0x38')];_0x15d5a2+=0x1){let _0x26a9aa=_0x58df4b[_0x63a8('0x6f')][_0x15d5a2];var _0x4ebb70=_0x2f335c[_0x63a8('0x7f')]();_0x4ebb70[_0x63a8('0x3e')]('ut.UserId\x20=\x20?',_0x26a9aa['id']);_0x1da5e0[_0x63a8('0x80')](db[_0x63a8('0x81')][_0x63a8('0x34')](_0x4ebb70[_0x63a8('0x82')](),{'type':db[_0x63a8('0x81')]['QueryTypes']['SELECT']})[_0x63a8('0x27')](function(_0x1aec48){if(_0x1aec48['length']===0x1){return _0x26a9aa['id'];}else{var _0x3eceab=_[_0x63a8('0x83')](_[_0x63a8('0x2e')](_0x1aec48,_0x63a8('0x84')),function(_0xc1d662){return _[_0x63a8('0x85')](_0x2ad97c,_0xc1d662);});if(_0x3eceab){return _0x26a9aa['id'];}}}));}}return BPromise[_0x63a8('0x86')](_0x1da5e0)['then'](function(_0x4a01a7){_0x19604d=_(_0x19604d)['union'](_0x4a01a7)[_0x63a8('0x87')]()['value']();return db[_0x63a8('0x2f')][_0x63a8('0x4c')]({'where':{'id':_0x443445[_0x63a8('0x4a')]['id']}})[_0x63a8('0x27')](function(_0x411af9){return db[_0x63a8('0x81')]['transaction'](function(_0x38b417){return _0x411af9['removeTeams'](_0x443445[_0x63a8('0x34')][_0x63a8('0x6a')],{'transaction':_0x38b417})[_0x63a8('0x27')](function(){if(!_[_0x63a8('0x88')](_0x19604d)){return _0x411af9[_0x63a8('0x89')](_0x19604d,{'transaction':_0x38b417});}})['then'](function(){_0x19604d['forEach'](function(_0x2a3c39){socket['emit']('userOpenchannelQueue:remove',{'UserId':_0x2a3c39,'OpenchannelQueueId':_0x411af9['id']});});});});});});})[_0x63a8('0x27')](respondWithStatusCode(_0x4721d8,null))[_0x63a8('0x48')](handleError(_0x4721d8,null));};exports[_0x63a8('0x8a')]=function(_0x5f1ae1,_0x4fa527,_0x5d4160){return db['OpenchannelQueue']['find']({'where':{'id':_0x5f1ae1[_0x63a8('0x4a')]['id']}})[_0x63a8('0x27')](handleEntityNotFound(_0x4fa527,null))[_0x63a8('0x27')](function(_0xe634b6){if(_0xe634b6){return _0xe634b6['addAgents'](_0x5f1ae1[_0x63a8('0x4e')][_0x63a8('0x6a')],_[_0x63a8('0x8b')](_0x5f1ae1[_0x63a8('0x4e')],['ids','id'])||{})[_0x63a8('0x8c')](function(_0x2e54ee){for(var _0x1d8ebe=0x0;_0x1d8ebe<_0x5f1ae1[_0x63a8('0x4e')][_0x63a8('0x6a')][_0x63a8('0x38')];_0x1d8ebe+=0x1){socket[_0x63a8('0x8d')](_0x63a8('0x73'),{'UserId':Number(_0x5f1ae1[_0x63a8('0x4e')][_0x63a8('0x6a')][_0x1d8ebe]),'OpenchannelQueueId':Number(_0x5f1ae1[_0x63a8('0x4a')]['id'])});}return _0x2e54ee;});}})[_0x63a8('0x27')](respondWithResult(_0x4fa527,null))[_0x63a8('0x48')](handleError(_0x4fa527,null));};exports[_0x63a8('0x89')]=function(_0x54da88,_0x88232a,_0x4843af){return db[_0x63a8('0x2f')][_0x63a8('0x4c')]({'where':{'id':_0x54da88[_0x63a8('0x4a')]['id']}})[_0x63a8('0x27')](handleEntityNotFound(_0x88232a,null))['then'](function(_0x5f4efb){if(_0x5f4efb){return _0x5f4efb['removeAgents'](_0x54da88['query'][_0x63a8('0x6a')])[_0x63a8('0x27')](function(){if(_[_0x63a8('0x8e')](_0x54da88[_0x63a8('0x34')][_0x63a8('0x6a')])){for(var _0xeef0c1=0x0;_0xeef0c1<_0x54da88[_0x63a8('0x34')][_0x63a8('0x6a')]['length'];_0xeef0c1+=0x1){socket[_0x63a8('0x8d')](_0x63a8('0x8f'),{'UserId':Number(_0x54da88['query'][_0x63a8('0x6a')][_0xeef0c1]),'OpenchannelQueueId':Number(_0x54da88[_0x63a8('0x4a')]['id'])});}}else{socket[_0x63a8('0x8d')](_0x63a8('0x8f'),{'UserId':Number(_0x54da88[_0x63a8('0x34')][_0x63a8('0x6a')]),'OpenchannelQueueId':Number(_0x54da88[_0x63a8('0x4a')]['id'])});}});}})[_0x63a8('0x27')](respondWithStatusCode(_0x88232a,null))['catch'](handleError(_0x88232a,null));};exports[_0x63a8('0x90')]=function(_0x11a6a2,_0x2573fd,_0xf9a581){var _0x25bdc3={};var _0x2c4191={};var _0x1efe91;var _0x111efc;return db[_0x63a8('0x2f')][_0x63a8('0x91')]({'where':{'id':_0x11a6a2[_0x63a8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2573fd,null))[_0x63a8('0x27')](function(_0x2cdcda){if(_0x2cdcda){_0x1efe91=_0x2cdcda;_0x2c4191['model']=_[_0x63a8('0x4b')](db[_0x63a8('0x75')][_0x63a8('0x30')]);_0x2c4191[_0x63a8('0x34')]=_[_0x63a8('0x4b')](_0x11a6a2['query']);_0x2c4191['filters']=_['intersection'](_0x2c4191[_0x63a8('0x33')],_0x2c4191['query']);_0x25bdc3[_0x63a8('0x36')]=_[_0x63a8('0x35')](_0x2c4191[_0x63a8('0x33')],qs[_0x63a8('0x37')](_0x11a6a2[_0x63a8('0x34')][_0x63a8('0x37')]));_0x25bdc3[_0x63a8('0x36')]=_0x25bdc3[_0x63a8('0x36')][_0x63a8('0x38')]?_0x25bdc3['attributes']:_0x2c4191[_0x63a8('0x33')];_0x25bdc3[_0x63a8('0x3c')]=qs[_0x63a8('0x3d')](_0x11a6a2[_0x63a8('0x34')][_0x63a8('0x3d')]);_0x25bdc3[_0x63a8('0x3e')]=qs[_0x63a8('0x3f')](_['pick'](_0x11a6a2['query'],_0x2c4191['filters']));if(_0x11a6a2[_0x63a8('0x34')][_0x63a8('0x41')]){_0x25bdc3[_0x63a8('0x3e')]=_[_0x63a8('0x42')](_0x25bdc3[_0x63a8('0x3e')],{'$or':_['map'](_0x25bdc3[_0x63a8('0x36')],function(_0x5666ef){var _0xada1f4={};_0xada1f4[_0x5666ef]={'$like':'%'+_0x11a6a2[_0x63a8('0x34')][_0x63a8('0x41')]+'%'};return _0xada1f4;})});}_0x25bdc3=_[_0x63a8('0x42')]({},_0x25bdc3,_0x11a6a2[_0x63a8('0x44')]);return _0x1efe91[_0x63a8('0x90')](_0x25bdc3);}})['then'](function(_0x3a0de8){if(_0x3a0de8){_0x111efc=_0x3a0de8[_0x63a8('0x38')];if(!_0x11a6a2[_0x63a8('0x34')][_0x63a8('0x39')]('nolimit')){_0x25bdc3[_0x63a8('0x3b')]=qs[_0x63a8('0x3b')](_0x11a6a2[_0x63a8('0x34')][_0x63a8('0x3b')]);_0x25bdc3['offset']=qs[_0x63a8('0x20')](_0x11a6a2[_0x63a8('0x34')]['offset']);}return _0x1efe91[_0x63a8('0x90')](_0x25bdc3);}})[_0x63a8('0x27')](function(_0x280087){if(_0x280087){return _0x280087?{'count':_0x111efc,'rows':_0x280087}:null;}})[_0x63a8('0x27')](respondWithResult(_0x2573fd,null))[_0x63a8('0x48')](handleError(_0x2573fd,null));};
\ No newline at end of file
+var _0xba07=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./openchannelQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','OpenchannelQueues','UserProfileResource','sendStatus','error','name','send','index','map','OpenchannelQueue','type','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','UserId','agent','openchannelPause','createdAt','rows','format','SIP','getTeams','Team','ids','Agents','online','voicePause','interface','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3d6907,_0x2f08fb){var _0x2ab3aa=function(_0x5f2f01){while(--_0x5f2f01){_0x3d6907['push'](_0x3d6907['shift']());}};_0x2ab3aa(++_0x2f08fb);}(_0xba07,0x105));var _0x7ba0=function(_0x281296,_0x43689a){_0x281296=_0x281296-0x0;var _0xcce942=_0xba07[_0x281296];return _0xcce942;};'use strict';var emlformat=require(_0x7ba0('0x0'));var rimraf=require(_0x7ba0('0x1'));var zipdir=require(_0x7ba0('0x2'));var jsonpatch=require(_0x7ba0('0x3'));var rp=require(_0x7ba0('0x4'));var moment=require(_0x7ba0('0x5'));var BPromise=require(_0x7ba0('0x6'));var Mustache=require(_0x7ba0('0x7'));var util=require(_0x7ba0('0x8'));var path=require(_0x7ba0('0x9'));var sox=require(_0x7ba0('0xa'));var csv=require('to-csv');var ejs=require(_0x7ba0('0xb'));var fs=require('fs');var fs_extra=require(_0x7ba0('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7ba0('0xd'));var jsforce=require(_0x7ba0('0xe'));var deskjs=require(_0x7ba0('0xf'));var toCsv=require(_0x7ba0('0x10'));var querystring=require(_0x7ba0('0x11'));var Papa=require(_0x7ba0('0x12'));var Redis=require(_0x7ba0('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x7ba0('0x14'));var as=require(_0x7ba0('0x15'));var hardwareService=require(_0x7ba0('0x16'));var logger=require(_0x7ba0('0x17'))(_0x7ba0('0x18'));var utils=require(_0x7ba0('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x7ba0('0x1a'));var db=require(_0x7ba0('0x1b'))['db'];config['redis']=_[_0x7ba0('0x1c')](config[_0x7ba0('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0x7ba0('0x1e'))(new Redis(config[_0x7ba0('0x1d')]));require(_0x7ba0('0x1f'))[_0x7ba0('0x20')](socket);function respondWithStatusCode(_0x505f55,_0x2ac5e3){_0x2ac5e3=_0x2ac5e3||0xcc;return function(_0xa8a387){if(_0xa8a387){return _0x505f55['sendStatus'](_0x2ac5e3);}return _0x505f55[_0x7ba0('0x21')](_0x2ac5e3)[_0x7ba0('0x22')]();};}function respondWithResult(_0x3a3a96,_0xcaab98){_0xcaab98=_0xcaab98||0xc8;return function(_0x1a7cdc){if(_0x1a7cdc){return _0x3a3a96[_0x7ba0('0x21')](_0xcaab98)[_0x7ba0('0x23')](_0x1a7cdc);}};}function respondWithFilteredResult(_0x56e375,_0x4c64d2){return function(_0x423643){if(_0x423643){var _0x57296f=typeof _0x4c64d2[_0x7ba0('0x24')]===_0x7ba0('0x25')&&typeof _0x4c64d2[_0x7ba0('0x26')]==='undefined';var _0x1c76b1=_0x423643[_0x7ba0('0x27')];var _0x186f3a=_0x57296f?0x0:_0x4c64d2['offset'];var _0x369d5c=_0x57296f?_0x423643[_0x7ba0('0x27')]:_0x4c64d2['offset']+_0x4c64d2[_0x7ba0('0x26')];var _0x906719;if(_0x369d5c>=_0x1c76b1){_0x369d5c=_0x1c76b1;_0x906719=0xc8;}else{_0x906719=0xce;}_0x56e375['status'](_0x906719);return _0x56e375[_0x7ba0('0x28')](_0x7ba0('0x29'),_0x186f3a+'-'+_0x369d5c+'/'+_0x1c76b1)[_0x7ba0('0x23')](_0x423643);}return null;};}function patchUpdates(_0x1f0cf8){return function(_0x1030b3){try{jsonpatch[_0x7ba0('0x2a')](_0x1030b3,_0x1f0cf8,!![]);}catch(_0x46704a){return BPromise[_0x7ba0('0x2b')](_0x46704a);}return _0x1030b3[_0x7ba0('0x2c')]();};}function saveUpdates(_0x1249d5,_0x25ae1c){return function(_0x414790){if(_0x414790){return _0x414790['update'](_0x1249d5)[_0x7ba0('0x2d')](function(_0x174008){return _0x174008;});}return null;};}function removeEntity(_0x40f6fd,_0x37a579){return function(_0x44a195){if(_0x44a195){return _0x44a195[_0x7ba0('0x2e')]()[_0x7ba0('0x2d')](function(){var _0x37a6cf=_0x44a195[_0x7ba0('0x2f')]({'plain':!![]});var _0x174e0e=_0x7ba0('0x30');return db[_0x7ba0('0x31')]['destroy']({'where':{'type':_0x174e0e,'resourceId':_0x37a6cf['id']}})[_0x7ba0('0x2d')](function(){return _0x44a195;});})[_0x7ba0('0x2d')](function(){_0x40f6fd[_0x7ba0('0x21')](0xcc)[_0x7ba0('0x22')]();});}};}function handleEntityNotFound(_0x2d9ddc,_0x5b003c){return function(_0x2b2dce){if(!_0x2b2dce){_0x2d9ddc[_0x7ba0('0x32')](0x194);}return _0x2b2dce;};}function handleError(_0x74a5f1,_0x41849f){_0x41849f=_0x41849f||0x1f4;return function(_0x170fa1){logger[_0x7ba0('0x33')](_0x170fa1['stack']);if(_0x170fa1['name']){delete _0x170fa1[_0x7ba0('0x34')];}_0x74a5f1[_0x7ba0('0x21')](_0x41849f)[_0x7ba0('0x35')](_0x170fa1);};}exports[_0x7ba0('0x36')]=function(_0x356684,_0x5d16a2){var _0x4616a6={},_0x11089e={},_0x4f500f={'count':0x0,'rows':[]};var _0x3de54f=_[_0x7ba0('0x37')](db[_0x7ba0('0x38')]['rawAttributes'],function(_0x120da9){return{'name':_0x120da9['fieldName'],'type':_0x120da9[_0x7ba0('0x39')]['key']};});_0x11089e['model']=_[_0x7ba0('0x37')](_0x3de54f,_0x7ba0('0x34'));_0x11089e['query']=_[_0x7ba0('0x3a')](_0x356684[_0x7ba0('0x3b')]);_0x11089e['filters']=_[_0x7ba0('0x3c')](_0x11089e['model'],_0x11089e[_0x7ba0('0x3b')]);_0x4616a6[_0x7ba0('0x3d')]=_[_0x7ba0('0x3c')](_0x11089e[_0x7ba0('0x3e')],qs[_0x7ba0('0x3f')](_0x356684[_0x7ba0('0x3b')][_0x7ba0('0x3f')]));_0x4616a6['attributes']=_0x4616a6[_0x7ba0('0x3d')][_0x7ba0('0x40')]?_0x4616a6['attributes']:_0x11089e['model'];if(!_0x356684['query'][_0x7ba0('0x41')](_0x7ba0('0x42'))){_0x4616a6[_0x7ba0('0x26')]=qs['limit'](_0x356684[_0x7ba0('0x3b')][_0x7ba0('0x26')]);_0x4616a6[_0x7ba0('0x24')]=qs['offset'](_0x356684[_0x7ba0('0x3b')][_0x7ba0('0x24')]);}_0x4616a6[_0x7ba0('0x43')]=qs['sort'](_0x356684[_0x7ba0('0x3b')][_0x7ba0('0x44')]);_0x4616a6[_0x7ba0('0x45')]=qs[_0x7ba0('0x46')](_[_0x7ba0('0x47')](_0x356684[_0x7ba0('0x3b')],_0x11089e[_0x7ba0('0x46')]),_0x3de54f);if(_0x356684[_0x7ba0('0x3b')][_0x7ba0('0x48')]){_0x4616a6[_0x7ba0('0x45')]=_['merge'](_0x4616a6[_0x7ba0('0x45')],{'$or':_[_0x7ba0('0x37')](_0x3de54f,function(_0x34ecfc){if(_0x34ecfc[_0x7ba0('0x39')]!==_0x7ba0('0x49')){var _0x3d3289={};_0x3d3289[_0x34ecfc['name']]={'$like':'%'+_0x356684['query'][_0x7ba0('0x48')]+'%'};return _0x3d3289;}})});}_0x4616a6=_[_0x7ba0('0x4a')]({},_0x4616a6,_0x356684[_0x7ba0('0x4b')]);var _0x5da098={'where':_0x4616a6['where']};return db[_0x7ba0('0x38')][_0x7ba0('0x27')](_0x5da098)['then'](function(_0x5f2c3b){_0x4f500f[_0x7ba0('0x27')]=_0x5f2c3b;if(_0x356684[_0x7ba0('0x3b')][_0x7ba0('0x4c')]){_0x4616a6[_0x7ba0('0x4d')]=[{'all':!![]}];}return db[_0x7ba0('0x38')][_0x7ba0('0x4e')](_0x4616a6);})[_0x7ba0('0x2d')](function(_0x177eba){_0x4f500f['rows']=_0x177eba;return _0x4f500f;})[_0x7ba0('0x2d')](respondWithFilteredResult(_0x5d16a2,_0x4616a6))[_0x7ba0('0x4f')](handleError(_0x5d16a2,null));};exports[_0x7ba0('0x50')]=function(_0x14802d,_0x3351d4){var _0x55ba83={'raw':!![],'where':{'id':_0x14802d[_0x7ba0('0x51')]['id']}},_0x9eafab={};_0x9eafab[_0x7ba0('0x3e')]=_[_0x7ba0('0x3a')](db[_0x7ba0('0x38')][_0x7ba0('0x52')]);_0x9eafab[_0x7ba0('0x3b')]=_[_0x7ba0('0x3a')](_0x14802d[_0x7ba0('0x3b')]);_0x9eafab[_0x7ba0('0x46')]=_['intersection'](_0x9eafab['model'],_0x9eafab[_0x7ba0('0x3b')]);_0x55ba83[_0x7ba0('0x3d')]=_[_0x7ba0('0x3c')](_0x9eafab[_0x7ba0('0x3e')],qs[_0x7ba0('0x3f')](_0x14802d[_0x7ba0('0x3b')]['fields']));_0x55ba83[_0x7ba0('0x3d')]=_0x55ba83['attributes'][_0x7ba0('0x40')]?_0x55ba83[_0x7ba0('0x3d')]:_0x9eafab[_0x7ba0('0x3e')];if(_0x14802d['query'][_0x7ba0('0x4c')]){_0x55ba83['include']=[{'all':!![]}];}_0x55ba83=_[_0x7ba0('0x4a')]({},_0x55ba83,_0x14802d[_0x7ba0('0x4b')]);return db[_0x7ba0('0x38')][_0x7ba0('0x53')](_0x55ba83)['then'](handleEntityNotFound(_0x3351d4,null))[_0x7ba0('0x2d')](respondWithResult(_0x3351d4,null))[_0x7ba0('0x4f')](handleError(_0x3351d4,null));};exports['create']=function(_0x295eb3,_0x3487eb){return db[_0x7ba0('0x38')][_0x7ba0('0x54')](_0x295eb3[_0x7ba0('0x55')],{})[_0x7ba0('0x2d')](function(_0x350e3e){var _0x524d0f=_0x295eb3[_0x7ba0('0x56')][_0x7ba0('0x2f')]({'plain':!![]});if(!_0x524d0f)throw new Error(_0x7ba0('0x57'));if(_0x524d0f[_0x7ba0('0x58')]===_0x7ba0('0x56')){var _0x1555ad=_0x350e3e[_0x7ba0('0x2f')]({'plain':!![]});var _0x2fb5b0='OpenchannelQueues';return db['UserProfileSection'][_0x7ba0('0x53')]({'where':{'name':_0x2fb5b0,'userProfileId':_0x524d0f['userProfileId']},'raw':!![]})[_0x7ba0('0x2d')](function(_0x2d89be){if(_0x2d89be&&_0x2d89be['autoAssociation']===0x0){return db[_0x7ba0('0x31')][_0x7ba0('0x54')]({'name':_0x1555ad[_0x7ba0('0x34')],'resourceId':_0x1555ad['id'],'type':_0x2d89be[_0x7ba0('0x34')],'sectionId':_0x2d89be['id']},{})[_0x7ba0('0x2d')](function(){return _0x350e3e;});}else{return _0x350e3e;}})[_0x7ba0('0x4f')](function(_0x56569d){logger[_0x7ba0('0x33')](_0x7ba0('0x59'),_0x56569d);throw _0x56569d;});}return _0x350e3e;})[_0x7ba0('0x2d')](respondWithResult(_0x3487eb,0xc9))[_0x7ba0('0x4f')](handleError(_0x3487eb,null));};exports[_0x7ba0('0x5a')]=function(_0x43190a,_0xf25b9b){if(_0x43190a[_0x7ba0('0x55')]['id']){delete _0x43190a[_0x7ba0('0x55')]['id'];}return db[_0x7ba0('0x38')]['find']({'where':{'id':_0x43190a[_0x7ba0('0x51')]['id']}})['then'](handleEntityNotFound(_0xf25b9b,null))[_0x7ba0('0x2d')](saveUpdates(_0x43190a[_0x7ba0('0x55')],null))[_0x7ba0('0x2d')](respondWithResult(_0xf25b9b,null))[_0x7ba0('0x4f')](handleError(_0xf25b9b,null));};exports[_0x7ba0('0x2e')]=function(_0x1bf7a7,_0x15bd20){return db[_0x7ba0('0x38')][_0x7ba0('0x53')]({'where':{'id':_0x1bf7a7[_0x7ba0('0x51')]['id']}})[_0x7ba0('0x2d')](handleEntityNotFound(_0x15bd20,null))[_0x7ba0('0x2d')](removeEntity(_0x15bd20,null))[_0x7ba0('0x4f')](handleError(_0x15bd20,null));};exports['describe']=function(_0x80f332,_0x4b9d91){return db[_0x7ba0('0x38')][_0x7ba0('0x5b')]()['then'](respondWithResult(_0x4b9d91,null))['catch'](handleError(_0x4b9d91,null));};exports[_0x7ba0('0x5c')]=function(_0x472083,_0x19a156,_0x5f1a62){var _0x2fcb59={'raw':!![],'where':{}},_0x4b90cb={},_0x3d6c8e;return db['OpenchannelQueue'][_0x7ba0('0x5d')]({'where':{'id':_0x472083[_0x7ba0('0x51')]['id']}})[_0x7ba0('0x2d')](handleEntityNotFound(_0x19a156,null))[_0x7ba0('0x2d')](function(_0x446e9d){if(_0x446e9d){_0x3d6c8e=_0x446e9d[_0x7ba0('0x2f')]({'plain':!![]});_0x4b90cb[_0x7ba0('0x3e')]=_[_0x7ba0('0x3a')](db[_0x7ba0('0x5e')][_0x7ba0('0x52')]);_0x4b90cb[_0x7ba0('0x3b')]=_[_0x7ba0('0x3a')](_0x472083[_0x7ba0('0x3b')]);_0x4b90cb[_0x7ba0('0x46')]=_['intersection'](_0x4b90cb[_0x7ba0('0x3e')],_0x4b90cb['query']);_0x2fcb59['attributes']=_[_0x7ba0('0x3c')](_0x4b90cb['model'],qs['fields'](_0x472083['query'][_0x7ba0('0x3f')]));_0x2fcb59[_0x7ba0('0x3d')]=_0x2fcb59[_0x7ba0('0x3d')][_0x7ba0('0x40')]?_0x2fcb59[_0x7ba0('0x3d')]:_0x4b90cb[_0x7ba0('0x3e')];if(!_0x472083[_0x7ba0('0x3b')][_0x7ba0('0x41')](_0x7ba0('0x42'))){_0x2fcb59[_0x7ba0('0x26')]=qs['limit'](_0x472083[_0x7ba0('0x3b')][_0x7ba0('0x26')]);_0x2fcb59[_0x7ba0('0x24')]=qs['offset'](_0x472083[_0x7ba0('0x3b')]['offset']);}_0x2fcb59[_0x7ba0('0x43')]=qs['sort'](_0x472083['query'][_0x7ba0('0x44')]);_0x2fcb59[_0x7ba0('0x45')]=qs[_0x7ba0('0x46')](_[_0x7ba0('0x47')](_0x472083['query'],_0x4b90cb[_0x7ba0('0x46')]));_0x2fcb59[_0x7ba0('0x45')][_0x7ba0('0x5f')]=_0x446e9d['id'];if(_0x472083['query'][_0x7ba0('0x48')]){_0x2fcb59[_0x7ba0('0x45')]=_['merge'](_0x2fcb59[_0x7ba0('0x45')],{'$or':_[_0x7ba0('0x37')](_0x2fcb59[_0x7ba0('0x3d')],function(_0x3015e7){var _0x558b75={};_0x558b75[_0x3015e7]={'$like':'%'+_0x472083['query'][_0x7ba0('0x48')]+'%'};return _0x558b75;})});}_0x2fcb59=_['merge']({},_0x2fcb59,_0x472083['options']);return db[_0x7ba0('0x5e')]['findAll'](_0x2fcb59);}})['then'](function(_0x11606a){if(_0x11606a){return db[_0x7ba0('0x60')]['findAndCountAll']({'where':{'id':_[_0x7ba0('0x37')](_0x11606a,_0x7ba0('0x61')),'role':_0x7ba0('0x62')},'attributes':['id',_0x7ba0('0x34'),_0x7ba0('0x63'),'updatedAt',_0x7ba0('0x64')]});}})[_0x7ba0('0x2d')](function(_0xce7cde){if(_0xce7cde){return{'count':_0xce7cde['count'],'rows':_[_0x7ba0('0x37')](_0xce7cde[_0x7ba0('0x65')],function(_0x50dc33){return{'membername':_0x50dc33[_0x7ba0('0x34')],'UserId':_0x50dc33['id'],'queue_name':_0x3d6c8e[_0x7ba0('0x34')],'OpenchannelQueueId':_0x3d6c8e['id'],'interface':util[_0x7ba0('0x66')]('%s/%s',_0x7ba0('0x67'),_0x50dc33[_0x7ba0('0x34')]),'penalty':0x0,'paused':_0x50dc33[_0x7ba0('0x63')],'createdAt':_0x50dc33[_0x7ba0('0x64')],'updatedAt':_0x50dc33['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x19a156,_0x2fcb59))[_0x7ba0('0x4f')](handleError(_0x19a156,null));};exports[_0x7ba0('0x68')]=function(_0x4e1150,_0x24aed3,_0x2577c8){var _0x1edc9e={};var _0xe708f5={};var _0x28cc4c;var _0x31a95a;return db[_0x7ba0('0x38')][_0x7ba0('0x5d')]({'where':{'id':_0x4e1150[_0x7ba0('0x51')]['id']}})[_0x7ba0('0x2d')](handleEntityNotFound(_0x24aed3,null))[_0x7ba0('0x2d')](function(_0x325fe9){if(_0x325fe9){_0x28cc4c=_0x325fe9;_0xe708f5[_0x7ba0('0x3e')]=_['keys'](db[_0x7ba0('0x69')]['rawAttributes']);_0xe708f5[_0x7ba0('0x3b')]=_[_0x7ba0('0x3a')](_0x4e1150[_0x7ba0('0x3b')]);_0xe708f5['filters']=_[_0x7ba0('0x3c')](_0xe708f5[_0x7ba0('0x3e')],_0xe708f5['query']);_0x1edc9e[_0x7ba0('0x3d')]=_[_0x7ba0('0x3c')](_0xe708f5['model'],qs['fields'](_0x4e1150[_0x7ba0('0x3b')]['fields']));_0x1edc9e['attributes']=_0x1edc9e[_0x7ba0('0x3d')][_0x7ba0('0x40')]?_0x1edc9e[_0x7ba0('0x3d')]:_0xe708f5[_0x7ba0('0x3e')];_0x1edc9e[_0x7ba0('0x43')]=qs[_0x7ba0('0x44')](_0x4e1150[_0x7ba0('0x3b')][_0x7ba0('0x44')]);_0x1edc9e['where']=qs[_0x7ba0('0x46')](_[_0x7ba0('0x47')](_0x4e1150['query'],_0xe708f5[_0x7ba0('0x46')]));if(_0x4e1150[_0x7ba0('0x3b')][_0x7ba0('0x48')]){_0x1edc9e[_0x7ba0('0x45')]=_[_0x7ba0('0x4a')](_0x1edc9e[_0x7ba0('0x45')],{'$or':_[_0x7ba0('0x37')](_0x1edc9e[_0x7ba0('0x3d')],function(_0x2e4609){var _0x31c66d={};_0x31c66d[_0x2e4609]={'$like':'%'+_0x4e1150[_0x7ba0('0x3b')][_0x7ba0('0x48')]+'%'};return _0x31c66d;})});}_0x1edc9e=_[_0x7ba0('0x4a')]({},_0x1edc9e,_0x4e1150[_0x7ba0('0x4b')]);return _0x28cc4c['getTeams'](_0x1edc9e);}})[_0x7ba0('0x2d')](function(_0x22613f){if(_0x22613f){_0x31a95a=_0x22613f[_0x7ba0('0x40')];if(!_0x4e1150[_0x7ba0('0x3b')][_0x7ba0('0x41')](_0x7ba0('0x42'))){_0x1edc9e[_0x7ba0('0x26')]=qs[_0x7ba0('0x26')](_0x4e1150[_0x7ba0('0x3b')][_0x7ba0('0x26')]);_0x1edc9e['offset']=qs[_0x7ba0('0x24')](_0x4e1150[_0x7ba0('0x3b')][_0x7ba0('0x24')]);}return _0x28cc4c[_0x7ba0('0x68')](_0x1edc9e);}})[_0x7ba0('0x2d')](function(_0x5880bf){if(_0x5880bf){return _0x5880bf?{'count':_0x31a95a,'rows':_0x5880bf}:null;}})[_0x7ba0('0x2d')](respondWithResult(_0x24aed3,null))[_0x7ba0('0x4f')](handleError(_0x24aed3,null));};exports['addTeams']=function(_0x707cac,_0x140d9e,_0x29fcde){var _0x4666d3=_0x707cac[_0x7ba0('0x55')][_0x7ba0('0x6a')];return db[_0x7ba0('0x69')][_0x7ba0('0x4e')]({'where':{'id':_0x4666d3},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7ba0('0x6b'),'attributes':['id','name',_0x7ba0('0x6c'),_0x7ba0('0x6d'),_0x7ba0('0x6e')],'raw':!![]}]})['then'](function(_0x12f3b7){if(_0x12f3b7){var _0x46f7c0=_['flatMap'](_0x12f3b7,function(_0x14e7fd){var _0x1768e7=_0x14e7fd[_0x7ba0('0x2f')]({'plain':!![]});return _0x1768e7['Agents'];});return db[_0x7ba0('0x38')][_0x7ba0('0x53')]({'where':{'id':_0x707cac['params']['id']}})[_0x7ba0('0x2d')](function(_0x4fe13c){return db['sequelize'][_0x7ba0('0x6f')](function(_0x5399ce){return _0x4fe13c['addTeams'](_0x4666d3,{'transaction':_0x5399ce})[_0x7ba0('0x2d')](function(){return BPromise[_0x7ba0('0x70')](_0x46f7c0,function(_0x4b90f0){return db[_0x7ba0('0x5e')][_0x7ba0('0x71')]({'where':{'UserId':_0x4b90f0['id'],'OpenchannelQueueId':_0x707cac[_0x7ba0('0x51')]['id']},'transaction':_0x5399ce});});})[_0x7ba0('0x2d')](function(){_0x46f7c0[_0x7ba0('0x72')](function(_0x5a0de2){socket[_0x7ba0('0x73')](_0x7ba0('0x74'),{'UserId':_0x5a0de2['id'],'OpenchannelQueueId':_0x4fe13c['id']});});});});});}})[_0x7ba0('0x2d')](respondWithStatusCode(_0x140d9e,null))[_0x7ba0('0x4f')](handleError(_0x140d9e,null));};exports[_0x7ba0('0x75')]=function(_0x4d60e9,_0x5db91c,_0x2677fe){return db[_0x7ba0('0x69')]['findAll']({'where':{'id':_0x4d60e9[_0x7ba0('0x3b')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7ba0('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x7ba0('0x2d')](handleEntityNotFound(_0x5db91c,null))['then'](function(_0x5de66e){var _0x175f9a=_[_0x7ba0('0x37')](_0x5de66e,'id');var _0x2d151b=[];var _0x175208=[];var _0x92c34d=squel[_0x7ba0('0x76')]();_0x92c34d[_0x7ba0('0x77')](_0x7ba0('0x78'))[_0x7ba0('0x79')]('team_has_openchannel_queues','tq')[_0x7ba0('0x7a')](_0x7ba0('0x7b'),'ut',_0x7ba0('0x7c'))[_0x7ba0('0x45')]('OpenchannelQueueId\x20=\x20?',_0x4d60e9[_0x7ba0('0x51')]['id']);for(var _0x130770=0x0;_0x130770<_0x5de66e[_0x7ba0('0x40')];_0x130770+=0x1){let _0x5f8881=_0x5de66e[_0x130770];for(var _0x48b36c=0x0;_0x48b36c<_0x5f8881[_0x7ba0('0x6b')][_0x7ba0('0x40')];_0x48b36c+=0x1){let _0x11bca6=_0x5f8881['Agents'][_0x48b36c];var _0x5a4b87=_0x92c34d['clone']();_0x5a4b87[_0x7ba0('0x45')]('ut.UserId\x20=\x20?',_0x11bca6['id']);_0x175208[_0x7ba0('0x7d')](db[_0x7ba0('0x7e')][_0x7ba0('0x3b')](_0x5a4b87[_0x7ba0('0x7f')](),{'type':db[_0x7ba0('0x7e')][_0x7ba0('0x80')][_0x7ba0('0x81')]})[_0x7ba0('0x2d')](function(_0xd78883){if(_0xd78883[_0x7ba0('0x40')]===0x1){return _0x11bca6['id'];}else{var _0x13135a=_[_0x7ba0('0x82')](_[_0x7ba0('0x37')](_0xd78883,_0x7ba0('0x83')),function(_0x3bc264){return _[_0x7ba0('0x84')](_0x175f9a,_0x3bc264);});if(_0x13135a){return _0x11bca6['id'];}}}));}}return BPromise['all'](_0x175208)[_0x7ba0('0x2d')](function(_0x46acb8){_0x2d151b=_(_0x2d151b)[_0x7ba0('0x85')](_0x46acb8)[_0x7ba0('0x86')]()['value']();return db['OpenchannelQueue'][_0x7ba0('0x53')]({'where':{'id':_0x4d60e9[_0x7ba0('0x51')]['id']}})[_0x7ba0('0x2d')](function(_0x10a81a){return db[_0x7ba0('0x7e')][_0x7ba0('0x6f')](function(_0x458da2){return _0x10a81a[_0x7ba0('0x75')](_0x4d60e9[_0x7ba0('0x3b')][_0x7ba0('0x6a')],{'transaction':_0x458da2})['then'](function(){if(!_[_0x7ba0('0x87')](_0x2d151b)){return _0x10a81a[_0x7ba0('0x88')](_0x2d151b,{'transaction':_0x458da2});}})[_0x7ba0('0x2d')](function(){_0x2d151b['forEach'](function(_0x374869){socket[_0x7ba0('0x73')](_0x7ba0('0x89'),{'UserId':_0x374869,'OpenchannelQueueId':_0x10a81a['id']});});});});});});})['then'](respondWithStatusCode(_0x5db91c,null))['catch'](handleError(_0x5db91c,null));};exports[_0x7ba0('0x8a')]=function(_0x3a732f,_0x5021f1,_0x23a7d7){return db[_0x7ba0('0x38')][_0x7ba0('0x53')]({'where':{'id':_0x3a732f[_0x7ba0('0x51')]['id']}})[_0x7ba0('0x2d')](handleEntityNotFound(_0x5021f1,null))['then'](function(_0x101d69){if(_0x101d69){return _0x101d69[_0x7ba0('0x8a')](_0x3a732f['body'][_0x7ba0('0x6a')],_[_0x7ba0('0x8b')](_0x3a732f[_0x7ba0('0x55')],[_0x7ba0('0x6a'),'id'])||{})['spread'](function(_0x21f712){for(var _0x5228a9=0x0;_0x5228a9<_0x3a732f[_0x7ba0('0x55')][_0x7ba0('0x6a')][_0x7ba0('0x40')];_0x5228a9+=0x1){socket[_0x7ba0('0x73')](_0x7ba0('0x74'),{'UserId':Number(_0x3a732f['body'][_0x7ba0('0x6a')][_0x5228a9]),'OpenchannelQueueId':Number(_0x3a732f[_0x7ba0('0x51')]['id'])});}return _0x21f712;});}})[_0x7ba0('0x2d')](respondWithResult(_0x5021f1,null))[_0x7ba0('0x4f')](handleError(_0x5021f1,null));};exports[_0x7ba0('0x88')]=function(_0x33ea46,_0x4dfd05,_0x52e579){return db[_0x7ba0('0x38')][_0x7ba0('0x53')]({'where':{'id':_0x33ea46[_0x7ba0('0x51')]['id']}})[_0x7ba0('0x2d')](handleEntityNotFound(_0x4dfd05,null))['then'](function(_0x332cb8){if(_0x332cb8){return _0x332cb8[_0x7ba0('0x88')](_0x33ea46['query'][_0x7ba0('0x6a')])['then'](function(){if(_[_0x7ba0('0x8c')](_0x33ea46[_0x7ba0('0x3b')][_0x7ba0('0x6a')])){for(var _0x391b34=0x0;_0x391b34<_0x33ea46[_0x7ba0('0x3b')][_0x7ba0('0x6a')]['length'];_0x391b34+=0x1){socket[_0x7ba0('0x73')](_0x7ba0('0x89'),{'UserId':Number(_0x33ea46[_0x7ba0('0x3b')][_0x7ba0('0x6a')][_0x391b34]),'OpenchannelQueueId':Number(_0x33ea46[_0x7ba0('0x51')]['id'])});}}else{socket['emit'](_0x7ba0('0x89'),{'UserId':Number(_0x33ea46[_0x7ba0('0x3b')]['ids']),'OpenchannelQueueId':Number(_0x33ea46[_0x7ba0('0x51')]['id'])});}});}})['then'](respondWithStatusCode(_0x4dfd05,null))['catch'](handleError(_0x4dfd05,null));};exports['getAgents']=function(_0x4fdadb,_0x379794,_0x8f9ef9){var _0x442f8e={};var _0x21434a={};var _0xca9bf9;var _0x733852;return db[_0x7ba0('0x38')][_0x7ba0('0x5d')]({'where':{'id':_0x4fdadb[_0x7ba0('0x51')]['id']}})[_0x7ba0('0x2d')](handleEntityNotFound(_0x379794,null))[_0x7ba0('0x2d')](function(_0x2a0fcb){if(_0x2a0fcb){_0xca9bf9=_0x2a0fcb;_0x21434a[_0x7ba0('0x3e')]=_[_0x7ba0('0x3a')](db[_0x7ba0('0x60')]['rawAttributes']);_0x21434a[_0x7ba0('0x3b')]=_[_0x7ba0('0x3a')](_0x4fdadb[_0x7ba0('0x3b')]);_0x21434a[_0x7ba0('0x46')]=_['intersection'](_0x21434a['model'],_0x21434a[_0x7ba0('0x3b')]);_0x442f8e[_0x7ba0('0x3d')]=_['intersection'](_0x21434a[_0x7ba0('0x3e')],qs['fields'](_0x4fdadb[_0x7ba0('0x3b')][_0x7ba0('0x3f')]));_0x442f8e['attributes']=_0x442f8e[_0x7ba0('0x3d')][_0x7ba0('0x40')]?_0x442f8e[_0x7ba0('0x3d')]:_0x21434a[_0x7ba0('0x3e')];_0x442f8e['order']=qs[_0x7ba0('0x44')](_0x4fdadb['query'][_0x7ba0('0x44')]);_0x442f8e[_0x7ba0('0x45')]=qs['filters'](_['pick'](_0x4fdadb[_0x7ba0('0x3b')],_0x21434a[_0x7ba0('0x46')]));if(_0x4fdadb[_0x7ba0('0x3b')][_0x7ba0('0x48')]){_0x442f8e[_0x7ba0('0x45')]=_['merge'](_0x442f8e[_0x7ba0('0x45')],{'$or':_['map'](_0x442f8e[_0x7ba0('0x3d')],function(_0x2ac48e){var _0x412341={};_0x412341[_0x2ac48e]={'$like':'%'+_0x4fdadb[_0x7ba0('0x3b')][_0x7ba0('0x48')]+'%'};return _0x412341;})});}_0x442f8e=_[_0x7ba0('0x4a')]({},_0x442f8e,_0x4fdadb['options']);return _0xca9bf9[_0x7ba0('0x8d')](_0x442f8e);}})[_0x7ba0('0x2d')](function(_0x30cd35){if(_0x30cd35){_0x733852=_0x30cd35[_0x7ba0('0x40')];if(!_0x4fdadb[_0x7ba0('0x3b')]['hasOwnProperty'](_0x7ba0('0x42'))){_0x442f8e[_0x7ba0('0x26')]=qs['limit'](_0x4fdadb[_0x7ba0('0x3b')][_0x7ba0('0x26')]);_0x442f8e[_0x7ba0('0x24')]=qs[_0x7ba0('0x24')](_0x4fdadb[_0x7ba0('0x3b')][_0x7ba0('0x24')]);}return _0xca9bf9['getAgents'](_0x442f8e);}})[_0x7ba0('0x2d')](function(_0x21611c){if(_0x21611c){return _0x21611c?{'count':_0x733852,'rows':_0x21611c}:null;}})[_0x7ba0('0x2d')](respondWithResult(_0x379794,null))[_0x7ba0('0x4f')](handleError(_0x379794,null));};
\ No newline at end of file
index 370e619..911f9f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x640e=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x28d151,_0x446e87){var _0x4340a8=function(_0x499a73){while(--_0x499a73){_0x28d151['push'](_0x28d151['shift']());}};_0x4340a8(++_0x446e87);}(_0x640e,0x177));var _0xe640=function(_0x2c1dcd,_0x350452){_0x2c1dcd=_0x2c1dcd-0x0;var _0x158ce5=_0x640e[_0x2c1dcd];return _0x158ce5;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0xe640('0x0'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe640('0x1'),'afterUpdate':_0xe640('0x2'),'afterDestroy':_0xe640('0x3')};function emitEvent(_0x363299){return function(_0x5416e8,_0x4bdd0c,_0x27b0cf){OpenchannelQueueEvents['emit'](_0x363299+':'+_0x5416e8['id'],_0x5416e8);OpenchannelQueueEvents[_0xe640('0x4')](_0x363299,_0x5416e8);_0x27b0cf(null);};}for(var e in events){if(events[_0xe640('0x5')](e)){var event=events[e];OpenchannelQueue[_0xe640('0x6')](e,emitEvent(event));}}module[_0xe640('0x7')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0x7a2a=['hook','events','OpenchannelQueue','setMaxListeners','save','update','remove','emit'];(function(_0x38df20,_0x34fcfe){var _0x3bac25=function(_0x5d28ec){while(--_0x5d28ec){_0x38df20['push'](_0x38df20['shift']());}};_0x3bac25(++_0x34fcfe);}(_0x7a2a,0x159));var _0xa7a2=function(_0x40e3a8,_0x5942d0){_0x40e3a8=_0x40e3a8-0x0;var _0x1c258a=_0x7a2a[_0x40e3a8];return _0x1c258a;};'use strict';var EventEmitter=require(_0xa7a2('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0xa7a2('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xa7a2('0x2')](0x0);var events={'afterCreate':_0xa7a2('0x3'),'afterUpdate':_0xa7a2('0x4'),'afterDestroy':_0xa7a2('0x5')};function emitEvent(_0x23e684){return function(_0x389dca,_0x1f6525,_0x2fda71){OpenchannelQueueEvents['emit'](_0x23e684+':'+_0x389dca['id'],_0x389dca);OpenchannelQueueEvents[_0xa7a2('0x6')](_0x23e684,_0x389dca);_0x2fda71(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xa7a2('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents;
\ No newline at end of file
index 101e4e5..e1f1730 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8214=['rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5613de,_0x479c93){var _0x5b40cb=function(_0x5479ae){while(--_0x5479ae){_0x5613de['push'](_0x5613de['shift']());}};_0x5b40cb(++_0x479c93);}(_0x8214,0xe3));var _0x4821=function(_0x3deb67,_0x366db6){_0x3deb67=_0x3deb67-0x0;var _0x3c346d=_0x8214[_0x3deb67];return _0x3c346d;};'use strict';var _=require(_0x4821('0x0'));var util=require(_0x4821('0x1'));var logger=require(_0x4821('0x2'))(_0x4821('0x3'));var moment=require(_0x4821('0x4'));var BPromise=require(_0x4821('0x5'));var rp=require(_0x4821('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4821('0x7'));var config=require(_0x4821('0x8'));var attributes=require(_0x4821('0x9'));module[_0x4821('0xa')]=function(_0x5a420e,_0x28b1d9){return _0x5a420e[_0x4821('0xb')]('OpenchannelQueue',attributes,{'tableName':_0x4821('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb421=['define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelQueue.attributes','exports'];(function(_0x18ac79,_0x8b46c4){var _0x4edb55=function(_0x5db90c){while(--_0x5db90c){_0x18ac79['push'](_0x18ac79['shift']());}};_0x4edb55(++_0x8b46c4);}(_0xb421,0x65));var _0x1b42=function(_0x53da3d,_0x5adeea){_0x53da3d=_0x53da3d-0x0;var _0x26bc73=_0xb421[_0x53da3d];return _0x26bc73;};'use strict';var _=require(_0x1b42('0x0'));var util=require(_0x1b42('0x1'));var logger=require(_0x1b42('0x2'))(_0x1b42('0x3'));var moment=require(_0x1b42('0x4'));var BPromise=require(_0x1b42('0x5'));var rp=require(_0x1b42('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1b42('0x7'));var config=require(_0x1b42('0x8'));var attributes=require(_0x1b42('0x9'));module[_0x1b42('0xa')]=function(_0x330a8f,_0x394650){return _0x330a8f[_0x1b42('0xb')](_0x1b42('0xc'),attributes,{'tableName':_0x1b42('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0808045..8d2d466 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x519b=['http','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','then','info','request\x20sent','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','GetOpenchannelQueue','OpenchannelQueue','findAll','options','where','attributes','include','model','map','debug','ShowOpenchannelQueue','find','raw','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5e4b85,_0x6cf965){var _0x5cd3cb=function(_0x589c9e){while(--_0x589c9e){_0x5e4b85['push'](_0x5e4b85['shift']());}};_0x5cd3cb(++_0x6cf965);}(_0x519b,0xda));var _0xb519=function(_0x86ce09,_0x2c3244){_0x86ce09=_0x86ce09-0x0;var _0x5c00ef=_0x519b[_0x86ce09];return _0x5c00ef;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb519('0x0'));var BPromise=require(_0xb519('0x1'));var rs=require(_0xb519('0x2'));var fs=require('fs');var Redis=require(_0xb519('0x3'));var db=require(_0xb519('0x4'))['db'];var utils=require(_0xb519('0x5'));var logger=require(_0xb519('0x6'))(_0xb519('0x7'));var config=require(_0xb519('0x8'));var jayson=require(_0xb519('0x9'));var client=jayson['client'][_0xb519('0xa')]({'port':0x232a});config['redis']=_[_0xb519('0xb')](config[_0xb519('0xc')],{'host':_0xb519('0xd'),'port':0x18eb});var socket=require(_0xb519('0xe'))(new Redis(config[_0xb519('0xc')]));require(_0xb519('0xf'))[_0xb519('0x10')](socket);function respondWithRpcPromise(_0x3bc97a,_0x1ecc31,_0x1c2cf8){return new BPromise(function(_0x46640,_0xc073c3){return client['request'](_0x3bc97a,_0x1c2cf8)[_0xb519('0x11')](function(_0x433243){logger[_0xb519('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x1ecc31,_0xb519('0x13'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x1ecc31,'request\x20sent',JSON[_0xb519('0x14')](_0x433243));if(_0x433243[_0xb519('0x15')]){if(_0x433243['error'][_0xb519('0x16')]===0x1f4){logger['error'](_0xb519('0x17'),_0x1ecc31,_0x433243['error'][_0xb519('0x18')]);return _0xc073c3(_0x433243[_0xb519('0x15')][_0xb519('0x18')]);}logger[_0xb519('0x15')](_0xb519('0x17'),_0x1ecc31,_0x433243[_0xb519('0x15')]['message']);return _0x46640(_0x433243[_0xb519('0x15')][_0xb519('0x18')]);}else{logger[_0xb519('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x1ecc31,_0xb519('0x13'));_0x46640(_0x433243['result'][_0xb519('0x18')]);}})['catch'](function(_0x145c32){logger[_0xb519('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x1ecc31,_0x145c32);_0xc073c3(_0x145c32);});});}exports[_0xb519('0x19')]=function(_0x2d1158){var _0x2c3bc8=this;return new Promise(function(_0x1f20a2,_0x3293ce){return db[_0xb519('0x1a')][_0xb519('0x1b')]({'raw':_0x2d1158[_0xb519('0x1c')]?_0x2d1158[_0xb519('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2d1158['options']?_0x2d1158[_0xb519('0x1c')][_0xb519('0x1d')]||null:null,'attributes':_0x2d1158[_0xb519('0x1c')]?_0x2d1158[_0xb519('0x1c')][_0xb519('0x1e')]||null:null,'limit':_0x2d1158[_0xb519('0x1c')]?_0x2d1158['options']['limit']||null:null,'include':_0x2d1158[_0xb519('0x1c')]?_0x2d1158['options'][_0xb519('0x1f')]?_['map'](_0x2d1158[_0xb519('0x1c')]['include'],function(_0x5ab79c){return{'model':db[_0x5ab79c[_0xb519('0x20')]],'as':_0x5ab79c['as'],'attributes':_0x5ab79c[_0xb519('0x1e')],'include':_0x5ab79c['include']?_['map'](_0x5ab79c[_0xb519('0x1f')],function(_0x3f6f70){return{'model':db[_0x3f6f70[_0xb519('0x20')]],'as':_0x3f6f70['as'],'attributes':_0x3f6f70[_0xb519('0x1e')],'include':_0x3f6f70[_0xb519('0x1f')]?_[_0xb519('0x21')](_0x3f6f70['include'],function(_0x4b29ef){return{'model':db[_0x4b29ef[_0xb519('0x20')]],'as':_0x4b29ef['as'],'attributes':_0x4b29ef[_0xb519('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb519('0x11')](function(_0x2bdd4a){logger[_0xb519('0x12')]('GetOpenchannelQueue',_0x2d1158);logger[_0xb519('0x22')]('GetOpenchannelQueue',_0x2d1158,JSON[_0xb519('0x14')](_0x2bdd4a));_0x1f20a2(_0x2bdd4a);})['catch'](function(_0x17c54c){logger[_0xb519('0x15')](_0xb519('0x19'),_0x17c54c[_0xb519('0x18')],_0x2d1158);_0x3293ce(_0x2c3bc8[_0xb519('0x15')](0x1f4,_0x17c54c[_0xb519('0x18')]));});});};exports[_0xb519('0x23')]=function(_0x5638c4){var _0x2cb9aa=this;return new Promise(function(_0x4b6f60,_0xd97649){return db[_0xb519('0x1a')][_0xb519('0x24')]({'raw':_0x5638c4['options']?_0x5638c4[_0xb519('0x1c')][_0xb519('0x25')]===undefined?!![]:![]:!![],'where':_0x5638c4['options']?_0x5638c4[_0xb519('0x1c')][_0xb519('0x1d')]||null:null,'attributes':_0x5638c4[_0xb519('0x1c')]?_0x5638c4[_0xb519('0x1c')]['attributes']||null:null,'include':_0x5638c4[_0xb519('0x1c')]?_0x5638c4[_0xb519('0x1c')]['include']?_['map'](_0x5638c4['options'][_0xb519('0x1f')],function(_0x42cefd){return{'model':db[_0x42cefd[_0xb519('0x20')]],'as':_0x42cefd['as'],'attributes':_0x42cefd[_0xb519('0x1e')],'include':_0x42cefd[_0xb519('0x1f')]?_['map'](_0x42cefd[_0xb519('0x1f')],function(_0x60af27){return{'model':db[_0x60af27[_0xb519('0x20')]],'as':_0x60af27['as'],'attributes':_0x60af27['attributes'],'include':_0x60af27[_0xb519('0x1f')]?_[_0xb519('0x21')](_0x60af27['include'],function(_0x362ef2){return{'model':db[_0x362ef2[_0xb519('0x20')]],'as':_0x362ef2['as'],'attributes':_0x362ef2[_0xb519('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb519('0x11')](function(_0x43f229){logger['info'](_0xb519('0x23'),_0x5638c4);logger[_0xb519('0x22')](_0xb519('0x23'),_0x5638c4,JSON[_0xb519('0x14')](_0x43f229));_0x4b6f60(_0x43f229);})['catch'](function(_0x355230){logger[_0xb519('0x15')](_0xb519('0x23'),_0x355230['message'],_0x5638c4);_0xd97649(_0x2cb9aa[_0xb519('0x15')](0x1f4,_0x355230[_0xb519('0x18')]));});});};
\ No newline at end of file
+var _0xba89=['OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','findAll','options','raw','where','attributes','limit','include','map','model','GetOpenchannelQueue','catch','ShowOpenchannelQueue','OpenchannelQueue','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4a209a,_0x575ff9){var _0x4b3c20=function(_0x1a50c1){while(--_0x1a50c1){_0x4a209a['push'](_0x4a209a['shift']());}};_0x4b3c20(++_0x575ff9);}(_0xba89,0x1ce));var _0x9ba8=function(_0x5cbf8b,_0x4ca2df){_0x5cbf8b=_0x5cbf8b-0x0;var _0x51a416=_0xba89[_0x5cbf8b];return _0x51a416;};'use strict';var _=require('lodash');var util=require(_0x9ba8('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9ba8('0x1'));var fs=require('fs');var Redis=require(_0x9ba8('0x2'));var db=require(_0x9ba8('0x3'))['db'];var utils=require(_0x9ba8('0x4'));var logger=require(_0x9ba8('0x5'))(_0x9ba8('0x6'));var config=require('../../config/environment');var jayson=require(_0x9ba8('0x7'));var client=jayson[_0x9ba8('0x8')][_0x9ba8('0x9')]({'port':0x232a});config[_0x9ba8('0xa')]=_['defaults'](config[_0x9ba8('0xa')],{'host':_0x9ba8('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelQueue.socket')[_0x9ba8('0xc')](socket);function respondWithRpcPromise(_0x31d281,_0x32e4d5,_0xf15939){return new BPromise(function(_0x54c517,_0xec1988){return client[_0x9ba8('0xd')](_0x31d281,_0xf15939)[_0x9ba8('0xe')](function(_0x4055d6){logger[_0x9ba8('0xf')](_0x9ba8('0x10'),_0x32e4d5,_0x9ba8('0x11'));logger[_0x9ba8('0x12')](_0x9ba8('0x13'),_0x32e4d5,'request\x20sent',JSON[_0x9ba8('0x14')](_0x4055d6));if(_0x4055d6['error']){if(_0x4055d6[_0x9ba8('0x15')][_0x9ba8('0x16')]===0x1f4){logger[_0x9ba8('0x15')](_0x9ba8('0x10'),_0x32e4d5,_0x4055d6[_0x9ba8('0x15')][_0x9ba8('0x17')]);return _0xec1988(_0x4055d6[_0x9ba8('0x15')][_0x9ba8('0x17')]);}logger['error'](_0x9ba8('0x10'),_0x32e4d5,_0x4055d6[_0x9ba8('0x15')][_0x9ba8('0x17')]);return _0x54c517(_0x4055d6['error'][_0x9ba8('0x17')]);}else{logger[_0x9ba8('0xf')]('OpenchannelQueue,\x20%s,\x20%s',_0x32e4d5,_0x9ba8('0x11'));_0x54c517(_0x4055d6['result']['message']);}})['catch'](function(_0x4f103d){logger[_0x9ba8('0x15')](_0x9ba8('0x10'),_0x32e4d5,_0x4f103d);_0xec1988(_0x4f103d);});});}exports['GetOpenchannelQueue']=function(_0x1cb9b3){var _0x323577=this;return new Promise(function(_0xe7f045,_0x36d61c){return db['OpenchannelQueue'][_0x9ba8('0x18')]({'raw':_0x1cb9b3[_0x9ba8('0x19')]?_0x1cb9b3['options'][_0x9ba8('0x1a')]===undefined?!![]:![]:!![],'where':_0x1cb9b3[_0x9ba8('0x19')]?_0x1cb9b3[_0x9ba8('0x19')][_0x9ba8('0x1b')]||null:null,'attributes':_0x1cb9b3[_0x9ba8('0x19')]?_0x1cb9b3[_0x9ba8('0x19')][_0x9ba8('0x1c')]||null:null,'limit':_0x1cb9b3[_0x9ba8('0x19')]?_0x1cb9b3[_0x9ba8('0x19')][_0x9ba8('0x1d')]||null:null,'include':_0x1cb9b3[_0x9ba8('0x19')]?_0x1cb9b3[_0x9ba8('0x19')][_0x9ba8('0x1e')]?_[_0x9ba8('0x1f')](_0x1cb9b3['options'][_0x9ba8('0x1e')],function(_0x466bbb){return{'model':db[_0x466bbb['model']],'as':_0x466bbb['as'],'attributes':_0x466bbb[_0x9ba8('0x1c')],'include':_0x466bbb[_0x9ba8('0x1e')]?_['map'](_0x466bbb['include'],function(_0x1560e6){return{'model':db[_0x1560e6[_0x9ba8('0x20')]],'as':_0x1560e6['as'],'attributes':_0x1560e6[_0x9ba8('0x1c')],'include':_0x1560e6['include']?_[_0x9ba8('0x1f')](_0x1560e6['include'],function(_0xebaa6e){return{'model':db[_0xebaa6e[_0x9ba8('0x20')]],'as':_0xebaa6e['as'],'attributes':_0xebaa6e['attributes']};}):[]};}):[]};}):[]:[]})[_0x9ba8('0xe')](function(_0xd29f83){logger['info'](_0x9ba8('0x21'),_0x1cb9b3);logger[_0x9ba8('0x12')](_0x9ba8('0x21'),_0x1cb9b3,JSON['stringify'](_0xd29f83));_0xe7f045(_0xd29f83);})[_0x9ba8('0x22')](function(_0x8fec95){logger[_0x9ba8('0x15')](_0x9ba8('0x21'),_0x8fec95['message'],_0x1cb9b3);_0x36d61c(_0x323577[_0x9ba8('0x15')](0x1f4,_0x8fec95['message']));});});};exports[_0x9ba8('0x23')]=function(_0x958cb4){var _0x4e98c7=this;return new Promise(function(_0xdfa551,_0x282e44){return db[_0x9ba8('0x24')]['find']({'raw':_0x958cb4[_0x9ba8('0x19')]?_0x958cb4[_0x9ba8('0x19')][_0x9ba8('0x1a')]===undefined?!![]:![]:!![],'where':_0x958cb4[_0x9ba8('0x19')]?_0x958cb4[_0x9ba8('0x19')][_0x9ba8('0x1b')]||null:null,'attributes':_0x958cb4[_0x9ba8('0x19')]?_0x958cb4[_0x9ba8('0x19')]['attributes']||null:null,'include':_0x958cb4[_0x9ba8('0x19')]?_0x958cb4[_0x9ba8('0x19')]['include']?_[_0x9ba8('0x1f')](_0x958cb4[_0x9ba8('0x19')][_0x9ba8('0x1e')],function(_0x5bed44){return{'model':db[_0x5bed44['model']],'as':_0x5bed44['as'],'attributes':_0x5bed44[_0x9ba8('0x1c')],'include':_0x5bed44[_0x9ba8('0x1e')]?_['map'](_0x5bed44['include'],function(_0x52eff0){return{'model':db[_0x52eff0[_0x9ba8('0x20')]],'as':_0x52eff0['as'],'attributes':_0x52eff0[_0x9ba8('0x1c')],'include':_0x52eff0[_0x9ba8('0x1e')]?_['map'](_0x52eff0[_0x9ba8('0x1e')],function(_0x522c7d){return{'model':db[_0x522c7d['model']],'as':_0x522c7d['as'],'attributes':_0x522c7d[_0x9ba8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9ba8('0xe')](function(_0xfa0176){logger[_0x9ba8('0xf')](_0x9ba8('0x23'),_0x958cb4);logger[_0x9ba8('0x12')]('ShowOpenchannelQueue',_0x958cb4,JSON[_0x9ba8('0x14')](_0xfa0176));_0xdfa551(_0xfa0176);})[_0x9ba8('0x22')](function(_0x5347c2){logger['error']('ShowOpenchannelQueue',_0x5347c2['message'],_0x958cb4);_0x282e44(_0x4e98c7[_0x9ba8('0x15')](0x1f4,_0x5347c2[_0x9ba8('0x17')]));});});};
\ No newline at end of file
index 1e6e891..ebb6b21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1186=['./openchannelQueue.events','save','remove','emit','register','length'];(function(_0x22a84f,_0xcdb24b){var _0x12a8c1=function(_0x3dabb6){while(--_0x3dabb6){_0x22a84f['push'](_0x22a84f['shift']());}};_0x12a8c1(++_0xcdb24b);}(_0x1186,0x1e6));var _0x6118=function(_0x1a63d1,_0x2b1d8c){_0x1a63d1=_0x1a63d1-0x0;var _0x3b0053=_0x1186[_0x1a63d1];return _0x3b0053;};'use strict';var OpenchannelQueueEvents=require(_0x6118('0x0'));var events=[_0x6118('0x1'),_0x6118('0x2'),'update'];function createListener(_0x14b06f,_0x169230){return function(_0x5cb4bb){_0x169230[_0x6118('0x3')](_0x14b06f,_0x5cb4bb);};}function removeListener(_0x122549,_0x4a5275){return function(){OpenchannelQueueEvents['removeListener'](_0x122549,_0x4a5275);};}exports[_0x6118('0x4')]=function(_0x4d7ca0){for(var _0x3067fb=0x0,_0x4bcb0d=events[_0x6118('0x5')];_0x3067fb<_0x4bcb0d;_0x3067fb++){var _0x59d7c4=events[_0x3067fb];var _0x1e27e4=createListener('openchannelQueue:'+_0x59d7c4,_0x4d7ca0);OpenchannelQueueEvents['on'](_0x59d7c4,_0x1e27e4);}};
\ No newline at end of file
+var _0xf180=['remove','update','emit','removeListener','register','openchannelQueue:','./openchannelQueue.events','save'];(function(_0x28d885,_0x22d916){var _0x54e080=function(_0x1b9e76){while(--_0x1b9e76){_0x28d885['push'](_0x28d885['shift']());}};_0x54e080(++_0x22d916);}(_0xf180,0xfe));var _0x0f18=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xf180[_0x126558];return _0x1f6d14;};'use strict';var OpenchannelQueueEvents=require(_0x0f18('0x0'));var events=[_0x0f18('0x1'),_0x0f18('0x2'),_0x0f18('0x3')];function createListener(_0x41dc47,_0x370306){return function(_0x13df14){_0x370306[_0x0f18('0x4')](_0x41dc47,_0x13df14);};}function removeListener(_0x573331,_0x4dd845){return function(){OpenchannelQueueEvents[_0x0f18('0x5')](_0x573331,_0x4dd845);};}exports[_0x0f18('0x6')]=function(_0x41612e){for(var _0x1ecdac=0x0,_0x18b39b=events['length'];_0x1ecdac<_0x18b39b;_0x1ecdac++){var _0x147be6=events[_0x1ecdac];var _0x4c076d=createListener(_0x0f18('0x7')+_0x147be6,_0x41612e);OpenchannelQueueEvents['on'](_0x147be6,_0x4c076d);}};
\ No newline at end of file
index b2b11ab..a31ec1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8704=['update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','show','post','put','/:id'];(function(_0x1a9a40,_0x467411){var _0x58c2aa=function(_0x20dfd0){while(--_0x20dfd0){_0x1a9a40['push'](_0x1a9a40['shift']());}};_0x58c2aa(++_0x467411);}(_0x8704,0x18f));var _0x4870=function(_0x59616b,_0x38e534){_0x59616b=_0x59616b-0x0;var _0x5c4523=_0x8704[_0x59616b];return _0x5c4523;};'use strict';var multer=require('multer');var util=require(_0x4870('0x0'));var path=require(_0x4870('0x1'));var timeout=require(_0x4870('0x2'));var express=require('express');var router=express[_0x4870('0x3')]();var fs_extra=require(_0x4870('0x4'));var auth=require(_0x4870('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4870('0x6'));router[_0x4870('0x7')]('/',auth[_0x4870('0x8')](),controller[_0x4870('0x9')]);router[_0x4870('0x7')](_0x4870('0xa'),auth[_0x4870('0x8')](),controller['describe']);router[_0x4870('0x7')]('/:id',auth[_0x4870('0x8')](),controller[_0x4870('0xb')]);router[_0x4870('0xc')]('/',auth[_0x4870('0x8')](),controller['create']);router[_0x4870('0xd')](_0x4870('0xe'),auth['isAuthenticated'](),controller[_0x4870('0xf')]);router[_0x4870('0x10')](_0x4870('0xe'),auth[_0x4870('0x8')](),controller['destroy']);module[_0x4870('0x11')]=router;
\ No newline at end of file
+var _0x63a6=['/describe','/:id','isAuthenticated','create','put','update','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get'];(function(_0x375b7d,_0x377f03){var _0x9a58be=function(_0x4becde){while(--_0x4becde){_0x375b7d['push'](_0x375b7d['shift']());}};_0x9a58be(++_0x377f03);}(_0x63a6,0x1c7));var _0x663a=function(_0x489250,_0x5e9468){_0x489250=_0x489250-0x0;var _0x1283e5=_0x63a6[_0x489250];return _0x1283e5;};'use strict';var multer=require('multer');var util=require(_0x663a('0x0'));var path=require(_0x663a('0x1'));var timeout=require('connect-timeout');var express=require(_0x663a('0x2'));var router=express[_0x663a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x663a('0x4'));var interaction=require(_0x663a('0x5'));var config=require(_0x663a('0x6'));var controller=require(_0x663a('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x663a('0x8')](_0x663a('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x663a('0x8')](_0x663a('0xa'),auth[_0x663a('0xb')](),controller['show']);router['post']('/',auth[_0x663a('0xb')](),controller[_0x663a('0xc')]);router[_0x663a('0xd')](_0x663a('0xa'),auth[_0x663a('0xb')](),controller[_0x663a('0xe')]);router['delete'](_0x663a('0xa'),auth[_0x663a('0xb')](),controller[_0x663a('0xf')]);module['exports']=router;
\ No newline at end of file
index b67aa9c..45b6fc7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d04=['moment','sequelize','exports','STRING','DATE'];(function(_0x3ba924,_0x3b99f0){var _0x4cc1df=function(_0x15bf28){while(--_0x15bf28){_0x3ba924['push'](_0x3ba924['shift']());}};_0x4cc1df(++_0x3b99f0);}(_0x0d04,0x15e));var _0x40d0=function(_0x3a85ab,_0x1f3525){_0x3a85ab=_0x3a85ab-0x0;var _0x32d91a=_0x0d04[_0x3a85ab];return _0x32d91a;};'use strict';var moment=require(_0x40d0('0x0'));var Sequelize=require(_0x40d0('0x1'));module[_0x40d0('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x40d0('0x3')]},'joinAt':{'type':Sequelize[_0x40d0('0x4')]},'leaveAt':{'type':Sequelize[_0x40d0('0x4')]},'acceptAt':{'type':Sequelize[_0x40d0('0x4')]},'exitAt':{'type':Sequelize[_0x40d0('0x4')]},'reason':{'type':Sequelize[_0x40d0('0x3')]}};
\ No newline at end of file
+var _0x8c47=['moment','sequelize','exports','STRING','DATE'];(function(_0x895358,_0x32f914){var _0x26e26e=function(_0xf2da4a){while(--_0xf2da4a){_0x895358['push'](_0x895358['shift']());}};_0x26e26e(++_0x32f914);}(_0x8c47,0x69));var _0x78c4=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8c47[_0x40a045];return _0x1a687c;};'use strict';var moment=require(_0x78c4('0x0'));var Sequelize=require(_0x78c4('0x1'));module[_0x78c4('0x2')]={'uniqueid':{'type':Sequelize[_0x78c4('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x78c4('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x78c4('0x4')]},'acceptAt':{'type':Sequelize[_0x78c4('0x4')]},'exitAt':{'type':Sequelize[_0x78c4('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 7abe08d..cb2184d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ce2=['sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','include','findAll','rows','catch','params','includeAll','options','find','create','body','describe','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ce2,0xd4));var _0x26ce=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x6ce2[_0x18ab2a];return _0x16dcee;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x26ce('0x0'));var jsonpatch=require(_0x26ce('0x1'));var rp=require(_0x26ce('0x2'));var moment=require('moment');var BPromise=require(_0x26ce('0x3'));var Mustache=require(_0x26ce('0x4'));var util=require(_0x26ce('0x5'));var path=require(_0x26ce('0x6'));var sox=require(_0x26ce('0x7'));var csv=require(_0x26ce('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x26ce('0x9'));var squel=require(_0x26ce('0xa'));var crypto=require(_0x26ce('0xb'));var jsforce=require(_0x26ce('0xc'));var deskjs=require(_0x26ce('0xd'));var toCsv=require('to-csv');var querystring=require(_0x26ce('0xe'));var Papa=require(_0x26ce('0xf'));var Redis=require(_0x26ce('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x26ce('0x11'));var hardwareService=require(_0x26ce('0x12'));var logger=require(_0x26ce('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x26ce('0x14'))['db'];function respondWithStatusCode(_0x253b6e,_0x45b59a){_0x45b59a=_0x45b59a||0xcc;return function(_0x2791b3){if(_0x2791b3){return _0x253b6e['sendStatus'](_0x45b59a);}return _0x253b6e['status'](_0x45b59a)['end']();};}function respondWithResult(_0x28892f,_0x289636){_0x289636=_0x289636||0xc8;return function(_0xe626b5){if(_0xe626b5){return _0x28892f[_0x26ce('0x15')](_0x289636)[_0x26ce('0x16')](_0xe626b5);}};}function respondWithFilteredResult(_0x3b7f78,_0x249c3c){return function(_0x1f1800){if(_0x1f1800){var _0x23a927=typeof _0x249c3c[_0x26ce('0x17')]===_0x26ce('0x18')&&typeof _0x249c3c[_0x26ce('0x19')]===_0x26ce('0x18');var _0x2d5358=_0x1f1800[_0x26ce('0x1a')];var _0x44a113=_0x23a927?0x0:_0x249c3c[_0x26ce('0x17')];var _0x530dc2=_0x23a927?_0x1f1800[_0x26ce('0x1a')]:_0x249c3c[_0x26ce('0x17')]+_0x249c3c['limit'];var _0x25d9f3;if(_0x530dc2>=_0x2d5358){_0x530dc2=_0x2d5358;_0x25d9f3=0xc8;}else{_0x25d9f3=0xce;}_0x3b7f78[_0x26ce('0x15')](_0x25d9f3);return _0x3b7f78[_0x26ce('0x1b')](_0x26ce('0x1c'),_0x44a113+'-'+_0x530dc2+'/'+_0x2d5358)['json'](_0x1f1800);}return null;};}function patchUpdates(_0x4444ae){return function(_0x1c60df){try{jsonpatch[_0x26ce('0x1d')](_0x1c60df,_0x4444ae,!![]);}catch(_0x4752ad){return BPromise[_0x26ce('0x1e')](_0x4752ad);}return _0x1c60df[_0x26ce('0x1f')]();};}function saveUpdates(_0x47d669,_0x284343){return function(_0x147a33){if(_0x147a33){return _0x147a33[_0x26ce('0x20')](_0x47d669)[_0x26ce('0x21')](function(_0x318f31){return _0x318f31;});}return null;};}function removeEntity(_0x2214fe,_0x2726bd){return function(_0xc0c669){if(_0xc0c669){return _0xc0c669[_0x26ce('0x22')]()[_0x26ce('0x21')](function(){_0x2214fe[_0x26ce('0x15')](0xcc)[_0x26ce('0x23')]();});}};}function handleEntityNotFound(_0x145eb4,_0x124aa8){return function(_0x43bc25){if(!_0x43bc25){_0x145eb4['sendStatus'](0x194);}return _0x43bc25;};}function handleError(_0x3a85fc,_0x2a2088){_0x2a2088=_0x2a2088||0x1f4;return function(_0x14719a){logger[_0x26ce('0x24')](_0x14719a['stack']);if(_0x14719a[_0x26ce('0x25')]){delete _0x14719a[_0x26ce('0x25')];}_0x3a85fc[_0x26ce('0x15')](_0x2a2088)[_0x26ce('0x26')](_0x14719a);};}exports[_0x26ce('0x27')]=function(_0x57ab97,_0x4b7f6a){var _0x2cfd97={},_0x169352={},_0x96c3a3={'count':0x0,'rows':[]};var _0x75fe87=_[_0x26ce('0x28')](db[_0x26ce('0x29')][_0x26ce('0x2a')],function(_0x44a7ef){return{'name':_0x44a7ef[_0x26ce('0x2b')],'type':_0x44a7ef[_0x26ce('0x2c')][_0x26ce('0x2d')]};});_0x169352[_0x26ce('0x2e')]=_[_0x26ce('0x28')](_0x75fe87,_0x26ce('0x25'));_0x169352['query']=_[_0x26ce('0x2f')](_0x57ab97['query']);_0x169352['filters']=_['intersection'](_0x169352[_0x26ce('0x2e')],_0x169352[_0x26ce('0x30')]);_0x2cfd97[_0x26ce('0x31')]=_[_0x26ce('0x32')](_0x169352[_0x26ce('0x2e')],qs[_0x26ce('0x33')](_0x57ab97[_0x26ce('0x30')][_0x26ce('0x33')]));_0x2cfd97[_0x26ce('0x31')]=_0x2cfd97[_0x26ce('0x31')][_0x26ce('0x34')]?_0x2cfd97[_0x26ce('0x31')]:_0x169352[_0x26ce('0x2e')];if(!_0x57ab97[_0x26ce('0x30')][_0x26ce('0x35')](_0x26ce('0x36'))){_0x2cfd97[_0x26ce('0x19')]=qs['limit'](_0x57ab97['query']['limit']);_0x2cfd97[_0x26ce('0x17')]=qs[_0x26ce('0x17')](_0x57ab97[_0x26ce('0x30')][_0x26ce('0x17')]);}_0x2cfd97[_0x26ce('0x37')]=qs[_0x26ce('0x38')](_0x57ab97[_0x26ce('0x30')][_0x26ce('0x38')]);_0x2cfd97[_0x26ce('0x39')]=qs[_0x26ce('0x3a')](_[_0x26ce('0x3b')](_0x57ab97[_0x26ce('0x30')],_0x169352['filters']),_0x75fe87);if(_0x57ab97[_0x26ce('0x30')][_0x26ce('0x3c')]){_0x2cfd97['where']=_['merge'](_0x2cfd97['where'],{'$or':_['map'](_0x75fe87,function(_0x38e43b){if(_0x38e43b['type']!==_0x26ce('0x3d')){var _0x29741c={};_0x29741c[_0x38e43b[_0x26ce('0x25')]]={'$like':'%'+_0x57ab97[_0x26ce('0x30')][_0x26ce('0x3c')]+'%'};return _0x29741c;}})});}_0x2cfd97=_['merge']({},_0x2cfd97,_0x57ab97['options']);var _0x1e5d29={'where':_0x2cfd97[_0x26ce('0x39')]};return db[_0x26ce('0x29')][_0x26ce('0x1a')](_0x1e5d29)[_0x26ce('0x21')](function(_0x40ec9d){_0x96c3a3[_0x26ce('0x1a')]=_0x40ec9d;if(_0x57ab97[_0x26ce('0x30')]['includeAll']){_0x2cfd97[_0x26ce('0x3e')]=[{'all':!![]}];}return db[_0x26ce('0x29')][_0x26ce('0x3f')](_0x2cfd97);})['then'](function(_0x2d3ff0){_0x96c3a3[_0x26ce('0x40')]=_0x2d3ff0;return _0x96c3a3;})[_0x26ce('0x21')](respondWithFilteredResult(_0x4b7f6a,_0x2cfd97))[_0x26ce('0x41')](handleError(_0x4b7f6a,null));};exports['show']=function(_0x1cca2b,_0x440073){var _0xc12201={'raw':!![],'where':{'id':_0x1cca2b[_0x26ce('0x42')]['id']}},_0x46c7ce={};_0x46c7ce[_0x26ce('0x2e')]=_['keys'](db['OpenchannelQueueReport'][_0x26ce('0x2a')]);_0x46c7ce[_0x26ce('0x30')]=_[_0x26ce('0x2f')](_0x1cca2b[_0x26ce('0x30')]);_0x46c7ce['filters']=_[_0x26ce('0x32')](_0x46c7ce[_0x26ce('0x2e')],_0x46c7ce['query']);_0xc12201['attributes']=_[_0x26ce('0x32')](_0x46c7ce[_0x26ce('0x2e')],qs[_0x26ce('0x33')](_0x1cca2b['query'][_0x26ce('0x33')]));_0xc12201[_0x26ce('0x31')]=_0xc12201[_0x26ce('0x31')]['length']?_0xc12201[_0x26ce('0x31')]:_0x46c7ce[_0x26ce('0x2e')];if(_0x1cca2b[_0x26ce('0x30')][_0x26ce('0x43')]){_0xc12201[_0x26ce('0x3e')]=[{'all':!![]}];}_0xc12201=_['merge']({},_0xc12201,_0x1cca2b[_0x26ce('0x44')]);return db[_0x26ce('0x29')][_0x26ce('0x45')](_0xc12201)[_0x26ce('0x21')](handleEntityNotFound(_0x440073,null))[_0x26ce('0x21')](respondWithResult(_0x440073,null))[_0x26ce('0x41')](handleError(_0x440073,null));};exports[_0x26ce('0x46')]=function(_0x19e69e,_0x155b17){return db['OpenchannelQueueReport'][_0x26ce('0x46')](_0x19e69e[_0x26ce('0x47')],{})[_0x26ce('0x21')](respondWithResult(_0x155b17,0xc9))[_0x26ce('0x41')](handleError(_0x155b17,null));};exports['update']=function(_0x3e9376,_0x159491){if(_0x3e9376[_0x26ce('0x47')]['id']){delete _0x3e9376['body']['id'];}return db[_0x26ce('0x29')][_0x26ce('0x45')]({'where':{'id':_0x3e9376['params']['id']}})[_0x26ce('0x21')](handleEntityNotFound(_0x159491,null))[_0x26ce('0x21')](saveUpdates(_0x3e9376[_0x26ce('0x47')],null))[_0x26ce('0x21')](respondWithResult(_0x159491,null))[_0x26ce('0x41')](handleError(_0x159491,null));};exports[_0x26ce('0x22')]=function(_0x48bc23,_0x491bb0){return db['OpenchannelQueueReport'][_0x26ce('0x45')]({'where':{'id':_0x48bc23[_0x26ce('0x42')]['id']}})[_0x26ce('0x21')](handleEntityNotFound(_0x491bb0,null))[_0x26ce('0x21')](removeEntity(_0x491bb0,null))[_0x26ce('0x41')](handleError(_0x491bb0,null));};exports['describe']=function(_0x3a6589,_0x2b3a8e){return db[_0x26ce('0x29')][_0x26ce('0x48')]()['then'](respondWithResult(_0x2b3a8e,null))['catch'](handleError(_0x2b3a8e,null));};
\ No newline at end of file
+var _0x35c8=['index','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','OpenchannelQueueReport','includeAll','findAll','catch','include','create','body','find','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name'];(function(_0x2c5643,_0x4b4f14){var _0x4a7cc7=function(_0x4a74b1){while(--_0x4a74b1){_0x2c5643['push'](_0x2c5643['shift']());}};_0x4a7cc7(++_0x4b4f14);}(_0x35c8,0x18d));var _0x835c=function(_0x476860,_0xb72097){_0x476860=_0x476860-0x0;var _0x1706be=_0x35c8[_0x476860];return _0x1706be;};'use strict';var emlformat=require(_0x835c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x835c('0x1'));var jsonpatch=require(_0x835c('0x2'));var rp=require(_0x835c('0x3'));var moment=require(_0x835c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x835c('0x5'));var util=require(_0x835c('0x6'));var path=require(_0x835c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x835c('0x8'));var fs=require('fs');var fs_extra=require(_0x835c('0x9'));var _=require(_0x835c('0xa'));var squel=require(_0x835c('0xb'));var crypto=require(_0x835c('0xc'));var jsforce=require(_0x835c('0xd'));var deskjs=require(_0x835c('0xe'));var toCsv=require(_0x835c('0xf'));var querystring=require('querystring');var Papa=require(_0x835c('0x10'));var Redis=require(_0x835c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x835c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x835c('0x13'))(_0x835c('0x14'));var utils=require(_0x835c('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x835c('0x16'))['db'];function respondWithStatusCode(_0x4f1dc9,_0xe22fc3){_0xe22fc3=_0xe22fc3||0xcc;return function(_0x461cfb){if(_0x461cfb){return _0x4f1dc9[_0x835c('0x17')](_0xe22fc3);}return _0x4f1dc9[_0x835c('0x18')](_0xe22fc3)[_0x835c('0x19')]();};}function respondWithResult(_0x2ae70f,_0x3bf581){_0x3bf581=_0x3bf581||0xc8;return function(_0x265af5){if(_0x265af5){return _0x2ae70f[_0x835c('0x18')](_0x3bf581)[_0x835c('0x1a')](_0x265af5);}};}function respondWithFilteredResult(_0x2efeaf,_0x22cb71){return function(_0xf2a0e6){if(_0xf2a0e6){var _0x1273fb=typeof _0x22cb71['offset']==='undefined'&&typeof _0x22cb71['limit']===_0x835c('0x1b');var _0x540fc8=_0xf2a0e6[_0x835c('0x1c')];var _0x4ae243=_0x1273fb?0x0:_0x22cb71[_0x835c('0x1d')];var _0x367dde=_0x1273fb?_0xf2a0e6[_0x835c('0x1c')]:_0x22cb71[_0x835c('0x1d')]+_0x22cb71[_0x835c('0x1e')];var _0x29ba1c;if(_0x367dde>=_0x540fc8){_0x367dde=_0x540fc8;_0x29ba1c=0xc8;}else{_0x29ba1c=0xce;}_0x2efeaf[_0x835c('0x18')](_0x29ba1c);return _0x2efeaf[_0x835c('0x1f')]('Content-Range',_0x4ae243+'-'+_0x367dde+'/'+_0x540fc8)[_0x835c('0x1a')](_0xf2a0e6);}return null;};}function patchUpdates(_0xb21ab6){return function(_0x2c0282){try{jsonpatch[_0x835c('0x20')](_0x2c0282,_0xb21ab6,!![]);}catch(_0x49a917){return BPromise[_0x835c('0x21')](_0x49a917);}return _0x2c0282[_0x835c('0x22')]();};}function saveUpdates(_0x272577,_0x4f4558){return function(_0x383d19){if(_0x383d19){return _0x383d19[_0x835c('0x23')](_0x272577)[_0x835c('0x24')](function(_0x3232ff){return _0x3232ff;});}return null;};}function removeEntity(_0xd9c573,_0x33ad48){return function(_0x359569){if(_0x359569){return _0x359569[_0x835c('0x25')]()[_0x835c('0x24')](function(){_0xd9c573[_0x835c('0x18')](0xcc)[_0x835c('0x19')]();});}};}function handleEntityNotFound(_0x343eb7,_0x38aa24){return function(_0x3d8edd){if(!_0x3d8edd){_0x343eb7['sendStatus'](0x194);}return _0x3d8edd;};}function handleError(_0x32b904,_0x531ee1){_0x531ee1=_0x531ee1||0x1f4;return function(_0x589715){logger[_0x835c('0x26')](_0x589715[_0x835c('0x27')]);if(_0x589715['name']){delete _0x589715[_0x835c('0x28')];}_0x32b904[_0x835c('0x18')](_0x531ee1)['send'](_0x589715);};}exports[_0x835c('0x29')]=function(_0x5a3c94,_0x3aaf30){var _0x46d3b6={},_0x50da03={},_0x7d331={'count':0x0,'rows':[]};var _0x25c23d=_['map'](db['OpenchannelQueueReport'][_0x835c('0x2a')],function(_0x36b341){return{'name':_0x36b341[_0x835c('0x2b')],'type':_0x36b341[_0x835c('0x2c')][_0x835c('0x2d')]};});_0x50da03[_0x835c('0x2e')]=_[_0x835c('0x2f')](_0x25c23d,'name');_0x50da03['query']=_[_0x835c('0x30')](_0x5a3c94[_0x835c('0x31')]);_0x50da03['filters']=_[_0x835c('0x32')](_0x50da03['model'],_0x50da03['query']);_0x46d3b6[_0x835c('0x33')]=_['intersection'](_0x50da03[_0x835c('0x2e')],qs[_0x835c('0x34')](_0x5a3c94[_0x835c('0x31')][_0x835c('0x34')]));_0x46d3b6[_0x835c('0x33')]=_0x46d3b6[_0x835c('0x33')][_0x835c('0x35')]?_0x46d3b6[_0x835c('0x33')]:_0x50da03[_0x835c('0x2e')];if(!_0x5a3c94[_0x835c('0x31')]['hasOwnProperty'](_0x835c('0x36'))){_0x46d3b6[_0x835c('0x1e')]=qs['limit'](_0x5a3c94[_0x835c('0x31')]['limit']);_0x46d3b6[_0x835c('0x1d')]=qs[_0x835c('0x1d')](_0x5a3c94[_0x835c('0x31')][_0x835c('0x1d')]);}_0x46d3b6['order']=qs[_0x835c('0x37')](_0x5a3c94[_0x835c('0x31')][_0x835c('0x37')]);_0x46d3b6[_0x835c('0x38')]=qs[_0x835c('0x39')](_[_0x835c('0x3a')](_0x5a3c94[_0x835c('0x31')],_0x50da03['filters']),_0x25c23d);if(_0x5a3c94[_0x835c('0x31')][_0x835c('0x3b')]){_0x46d3b6[_0x835c('0x38')]=_[_0x835c('0x3c')](_0x46d3b6[_0x835c('0x38')],{'$or':_[_0x835c('0x2f')](_0x25c23d,function(_0x3312e5){if(_0x3312e5[_0x835c('0x2c')]!==_0x835c('0x3d')){var _0x27e48d={};_0x27e48d[_0x3312e5[_0x835c('0x28')]]={'$like':'%'+_0x5a3c94[_0x835c('0x31')]['filter']+'%'};return _0x27e48d;}})});}_0x46d3b6=_[_0x835c('0x3c')]({},_0x46d3b6,_0x5a3c94[_0x835c('0x3e')]);var _0x142171={'where':_0x46d3b6[_0x835c('0x38')]};return db[_0x835c('0x3f')][_0x835c('0x1c')](_0x142171)[_0x835c('0x24')](function(_0x44b62e){_0x7d331[_0x835c('0x1c')]=_0x44b62e;if(_0x5a3c94['query'][_0x835c('0x40')]){_0x46d3b6['include']=[{'all':!![]}];}return db[_0x835c('0x3f')][_0x835c('0x41')](_0x46d3b6);})[_0x835c('0x24')](function(_0x2bfaa2){_0x7d331['rows']=_0x2bfaa2;return _0x7d331;})[_0x835c('0x24')](respondWithFilteredResult(_0x3aaf30,_0x46d3b6))[_0x835c('0x42')](handleError(_0x3aaf30,null));};exports['show']=function(_0x3763ff,_0x48f958){var _0x535d4e={'raw':!![],'where':{'id':_0x3763ff['params']['id']}},_0x25999c={};_0x25999c[_0x835c('0x2e')]=_['keys'](db['OpenchannelQueueReport']['rawAttributes']);_0x25999c[_0x835c('0x31')]=_['keys'](_0x3763ff[_0x835c('0x31')]);_0x25999c[_0x835c('0x39')]=_[_0x835c('0x32')](_0x25999c[_0x835c('0x2e')],_0x25999c[_0x835c('0x31')]);_0x535d4e['attributes']=_[_0x835c('0x32')](_0x25999c[_0x835c('0x2e')],qs['fields'](_0x3763ff['query'][_0x835c('0x34')]));_0x535d4e['attributes']=_0x535d4e[_0x835c('0x33')][_0x835c('0x35')]?_0x535d4e[_0x835c('0x33')]:_0x25999c[_0x835c('0x2e')];if(_0x3763ff['query'][_0x835c('0x40')]){_0x535d4e[_0x835c('0x43')]=[{'all':!![]}];}_0x535d4e=_[_0x835c('0x3c')]({},_0x535d4e,_0x3763ff[_0x835c('0x3e')]);return db['OpenchannelQueueReport']['find'](_0x535d4e)[_0x835c('0x24')](handleEntityNotFound(_0x48f958,null))[_0x835c('0x24')](respondWithResult(_0x48f958,null))[_0x835c('0x42')](handleError(_0x48f958,null));};exports[_0x835c('0x44')]=function(_0x464514,_0xf9349e){return db[_0x835c('0x3f')]['create'](_0x464514[_0x835c('0x45')],{})[_0x835c('0x24')](respondWithResult(_0xf9349e,0xc9))['catch'](handleError(_0xf9349e,null));};exports[_0x835c('0x23')]=function(_0x23498d,_0x51926a){if(_0x23498d['body']['id']){delete _0x23498d[_0x835c('0x45')]['id'];}return db['OpenchannelQueueReport'][_0x835c('0x46')]({'where':{'id':_0x23498d[_0x835c('0x47')]['id']}})[_0x835c('0x24')](handleEntityNotFound(_0x51926a,null))[_0x835c('0x24')](saveUpdates(_0x23498d[_0x835c('0x45')],null))['then'](respondWithResult(_0x51926a,null))['catch'](handleError(_0x51926a,null));};exports[_0x835c('0x25')]=function(_0x5e7396,_0x9eed41){return db[_0x835c('0x3f')]['find']({'where':{'id':_0x5e7396[_0x835c('0x47')]['id']}})['then'](handleEntityNotFound(_0x9eed41,null))[_0x835c('0x24')](removeEntity(_0x9eed41,null))[_0x835c('0x42')](handleError(_0x9eed41,null));};exports[_0x835c('0x48')]=function(_0x578220,_0x5a762a){return db[_0x835c('0x3f')][_0x835c('0x48')]()['then'](respondWithResult(_0x5a762a,null))[_0x835c('0x42')](handleError(_0x5a762a,null));};
\ No newline at end of file
index 611ed56..98db2ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0xad2147,_0x111228){var _0x200af7=function(_0x242f36){while(--_0x242f36){_0xad2147['push'](_0xad2147['shift']());}};_0x200af7(++_0x111228);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xc4aa[_0x21549c];return _0x426cbd;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x499ccd,_0x2451ae){var _0x23ea86=function(_0x5bbd76){while(--_0x5bbd76){_0x499ccd['push'](_0x499ccd['shift']());}};_0x23ea86(++_0x2451ae);}(_0x1261,0x144));var _0x1126=function(_0x412376,_0x482fc2){_0x412376=_0x412376-0x0;var _0xae59bf=_0x1261[_0x412376];return _0xae59bf;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 82926c5..6e11e0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde9f=['client','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','OpenchannelQueueReport','options','raw','CreateOpenchannelQueueReport','catch','UpdateOpenchannelQueueReport','update','body','where','attributes','limit','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xde9f,0x118));var _0xfde9=function(_0x56fb33,_0x37be08){_0x56fb33=_0x56fb33-0x0;var _0x435ee4=_0xde9f[_0x56fb33];return _0x435ee4;};'use strict';var _=require(_0xfde9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfde9('0x1'));var rs=require(_0xfde9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfde9('0x3'))['db'];var utils=require(_0xfde9('0x4'));var logger=require('../../config/logger')(_0xfde9('0x5'));var config=require(_0xfde9('0x6'));var jayson=require(_0xfde9('0x7'));var client=jayson[_0xfde9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c3e01,_0x179ee0,_0x18a202){return new BPromise(function(_0x5569c2,_0x19a337){return client[_0xfde9('0x9')](_0x4c3e01,_0x18a202)[_0xfde9('0xa')](function(_0x3b775d){logger[_0xfde9('0xb')](_0xfde9('0xc'),_0x179ee0,_0xfde9('0xd'));logger[_0xfde9('0xe')](_0xfde9('0xf'),_0x179ee0,_0xfde9('0xd'),JSON[_0xfde9('0x10')](_0x3b775d));if(_0x3b775d[_0xfde9('0x11')]){if(_0x3b775d[_0xfde9('0x11')][_0xfde9('0x12')]===0x1f4){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x179ee0,_0x3b775d[_0xfde9('0x11')][_0xfde9('0x13')]);return _0x19a337(_0x3b775d[_0xfde9('0x11')][_0xfde9('0x13')]);}logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x179ee0,_0x3b775d[_0xfde9('0x11')][_0xfde9('0x13')]);return _0x5569c2(_0x3b775d[_0xfde9('0x11')][_0xfde9('0x13')]);}else{logger[_0xfde9('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x179ee0,_0xfde9('0xd'));_0x5569c2(_0x3b775d[_0xfde9('0x14')][_0xfde9('0x13')]);}})['catch'](function(_0x31b1c7){logger[_0xfde9('0x11')](_0xfde9('0xc'),_0x179ee0,_0x31b1c7);_0x19a337(_0x31b1c7);});});}exports['CreateOpenchannelQueueReport']=function(_0x4c9f24){var _0x5eb89e=this;return new Promise(function(_0x544f19,_0x166f1c){return db[_0xfde9('0x15')]['create'](_0x4c9f24['body'],{'raw':_0x4c9f24[_0xfde9('0x16')]?_0x4c9f24[_0xfde9('0x16')][_0xfde9('0x17')]===undefined?!![]:![]:!![]})[_0xfde9('0xa')](function(_0x162b07){logger[_0xfde9('0xb')](_0xfde9('0x18'),_0x4c9f24);logger[_0xfde9('0xe')](_0xfde9('0x18'),_0x4c9f24,JSON[_0xfde9('0x10')](_0x162b07));_0x544f19(_0x162b07);})[_0xfde9('0x19')](function(_0x28d189){logger['error'](_0xfde9('0x18'),_0x28d189['message'],_0x4c9f24);_0x166f1c(_0x5eb89e[_0xfde9('0x11')](0x1f4,_0x28d189[_0xfde9('0x13')]));});});};exports[_0xfde9('0x1a')]=function(_0x5d0a74){var _0x12e3e7=this;return new Promise(function(_0x10e809,_0x53733b){return db[_0xfde9('0x15')][_0xfde9('0x1b')](_0x5d0a74[_0xfde9('0x1c')],{'raw':_0x5d0a74[_0xfde9('0x16')]?_0x5d0a74[_0xfde9('0x16')][_0xfde9('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d0a74[_0xfde9('0x16')]?_0x5d0a74[_0xfde9('0x16')][_0xfde9('0x1d')]||null:null,'attributes':_0x5d0a74[_0xfde9('0x16')]?_0x5d0a74[_0xfde9('0x16')][_0xfde9('0x1e')]||null:null,'limit':_0x5d0a74[_0xfde9('0x16')]?_0x5d0a74[_0xfde9('0x16')][_0xfde9('0x1f')]||null:null})[_0xfde9('0xa')](function(_0x4b7956){logger['info'](_0xfde9('0x1a'),_0x5d0a74);logger[_0xfde9('0xe')]('UpdateOpenchannelQueueReport',_0x5d0a74,JSON[_0xfde9('0x10')](_0x4b7956));_0x10e809(_0x4b7956);})[_0xfde9('0x19')](function(_0x1651e0){logger[_0xfde9('0x11')](_0xfde9('0x1a'),_0x1651e0['message'],_0x5d0a74);_0x53733b(_0x12e3e7[_0xfde9('0x11')](0x1f4,_0x1651e0[_0xfde9('0x13')]));});});};
\ No newline at end of file
+var _0x2884=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','info','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','body','options','raw','UpdateOpenchannelQueueReport','OpenchannelQueueReport','attributes','limit','lodash','moment'];(function(_0x5cb101,_0x4d4e2d){var _0x11b7ca=function(_0xbc12b){while(--_0xbc12b){_0x5cb101['push'](_0x5cb101['shift']());}};_0x11b7ca(++_0x4d4e2d);}(_0x2884,0x1eb));var _0x4288=function(_0x5bf2a6,_0x96d3b8){_0x5bf2a6=_0x5bf2a6-0x0;var _0x284505=_0x2884[_0x5bf2a6];return _0x284505;};'use strict';var _=require(_0x4288('0x0'));var util=require('util');var moment=require(_0x4288('0x1'));var BPromise=require(_0x4288('0x2'));var rs=require(_0x4288('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4288('0x4'))['db'];var utils=require(_0x4288('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4288('0x6'));var jayson=require(_0x4288('0x7'));var client=jayson[_0x4288('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x526a07,_0x3a930e,_0x5e4cfc){return new BPromise(function(_0x25023a,_0x237b02){return client['request'](_0x526a07,_0x5e4cfc)[_0x4288('0x9')](function(_0x3c8d6e){logger[_0x4288('0xa')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3a930e,'request\x20sent');logger[_0x4288('0xb')](_0x4288('0xc'),_0x3a930e,_0x4288('0xd'),JSON[_0x4288('0xe')](_0x3c8d6e));if(_0x3c8d6e[_0x4288('0xf')]){if(_0x3c8d6e[_0x4288('0xf')][_0x4288('0x10')]===0x1f4){logger['error'](_0x4288('0x11'),_0x3a930e,_0x3c8d6e[_0x4288('0xf')][_0x4288('0x12')]);return _0x237b02(_0x3c8d6e[_0x4288('0xf')]['message']);}logger[_0x4288('0xf')](_0x4288('0x11'),_0x3a930e,_0x3c8d6e['error'][_0x4288('0x12')]);return _0x25023a(_0x3c8d6e['error'][_0x4288('0x12')]);}else{logger['info'](_0x4288('0x11'),_0x3a930e,_0x4288('0xd'));_0x25023a(_0x3c8d6e[_0x4288('0x13')][_0x4288('0x12')]);}})[_0x4288('0x14')](function(_0x1db33b){logger[_0x4288('0xf')](_0x4288('0x11'),_0x3a930e,_0x1db33b);_0x237b02(_0x1db33b);});});}exports[_0x4288('0x15')]=function(_0x53fb81){var _0x199919=this;return new Promise(function(_0xde03f4,_0x5e6de1){return db['OpenchannelQueueReport']['create'](_0x53fb81[_0x4288('0x16')],{'raw':_0x53fb81[_0x4288('0x17')]?_0x53fb81['options'][_0x4288('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x865365){logger[_0x4288('0xa')](_0x4288('0x15'),_0x53fb81);logger['debug'](_0x4288('0x15'),_0x53fb81,JSON[_0x4288('0xe')](_0x865365));_0xde03f4(_0x865365);})[_0x4288('0x14')](function(_0x4b9cda){logger['error'](_0x4288('0x15'),_0x4b9cda[_0x4288('0x12')],_0x53fb81);_0x5e6de1(_0x199919[_0x4288('0xf')](0x1f4,_0x4b9cda[_0x4288('0x12')]));});});};exports[_0x4288('0x19')]=function(_0x292e74){var _0x500c1e=this;return new Promise(function(_0x5f0c29,_0x1ff415){return db[_0x4288('0x1a')]['update'](_0x292e74[_0x4288('0x16')],{'raw':_0x292e74['options']?_0x292e74['options'][_0x4288('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x292e74[_0x4288('0x17')]?_0x292e74[_0x4288('0x17')]['where']||null:null,'attributes':_0x292e74[_0x4288('0x17')]?_0x292e74[_0x4288('0x17')][_0x4288('0x1b')]||null:null,'limit':_0x292e74[_0x4288('0x17')]?_0x292e74[_0x4288('0x17')][_0x4288('0x1c')]||null:null})['then'](function(_0x3a8e3e){logger[_0x4288('0xa')](_0x4288('0x19'),_0x292e74);logger[_0x4288('0xb')](_0x4288('0x19'),_0x292e74,JSON[_0x4288('0xe')](_0x3a8e3e));_0x5f0c29(_0x3a8e3e);})[_0x4288('0x14')](function(_0x5bca41){logger[_0x4288('0xf')](_0x4288('0x19'),_0x5bca41[_0x4288('0x12')],_0x292e74);_0x1ff415(_0x500c1e[_0x4288('0xf')](0x1f4,_0x5bca41[_0x4288('0x12')]));});});};
\ No newline at end of file
index 06f0cfe..0dc426f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1f0=['show','post','create','put','update','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x140cad,_0x4cf270){var _0x5cb741=function(_0x9bb428){while(--_0x9bb428){_0x140cad['push'](_0x140cad['shift']());}};_0x5cb741(++_0x4cf270);}(_0xb1f0,0x157));var _0x0b1f=function(_0x1b464a,_0x1517ee){_0x1b464a=_0x1b464a-0x0;var _0xde94f3=_0xb1f0[_0x1b464a];return _0xde94f3;};'use strict';var multer=require(_0x0b1f('0x0'));var util=require(_0x0b1f('0x1'));var path=require('path');var timeout=require(_0x0b1f('0x2'));var express=require('express');var router=express[_0x0b1f('0x3')]();var fs_extra=require(_0x0b1f('0x4'));var auth=require(_0x0b1f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0b1f('0x6'));var controller=require(_0x0b1f('0x7'));router[_0x0b1f('0x8')]('/',auth[_0x0b1f('0x9')](),controller[_0x0b1f('0xa')]);router[_0x0b1f('0x8')](_0x0b1f('0xb'),auth['isAuthenticated'](),controller[_0x0b1f('0xc')]);router['get'](_0x0b1f('0xd'),auth[_0x0b1f('0x9')](),controller[_0x0b1f('0xe')]);router[_0x0b1f('0xf')]('/',auth[_0x0b1f('0x9')](),controller[_0x0b1f('0x10')]);router[_0x0b1f('0x11')](_0x0b1f('0xd'),auth['isAuthenticated'](),controller[_0x0b1f('0x12')]);router[_0x0b1f('0x13')](_0x0b1f('0xd'),auth[_0x0b1f('0x9')](),controller[_0x0b1f('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xd00a=['get','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0x1e9e56,_0x34a74a){var _0x5d5e2e=function(_0x4bfcc2){while(--_0x4bfcc2){_0x1e9e56['push'](_0x1e9e56['shift']());}};_0x5d5e2e(++_0x34a74a);}(_0xd00a,0xa4));var _0xad00=function(_0x2b0ff0,_0x559448){_0x2b0ff0=_0x2b0ff0-0x0;var _0x2c2c72=_0xd00a[_0x2b0ff0];return _0x2c2c72;};'use strict';var multer=require(_0xad00('0x0'));var util=require('util');var path=require(_0xad00('0x1'));var timeout=require(_0xad00('0x2'));var express=require(_0xad00('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xad00('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xad00('0x5'));var controller=require('./openchannelTransferReport.controller');router[_0xad00('0x6')]('/',auth[_0xad00('0x7')](),controller['index']);router['get']('/describe',auth[_0xad00('0x7')](),controller[_0xad00('0x8')]);router[_0xad00('0x6')](_0xad00('0x9'),auth[_0xad00('0x7')](),controller[_0xad00('0xa')]);router[_0xad00('0xb')]('/',auth[_0xad00('0x7')](),controller[_0xad00('0xc')]);router[_0xad00('0xd')](_0xad00('0x9'),auth[_0xad00('0x7')](),controller['update']);router[_0xad00('0xe')](_0xad00('0x9'),auth[_0xad00('0x7')](),controller[_0xad00('0xf')]);module[_0xad00('0x10')]=router;
\ No newline at end of file
index b36ef5a..a9ddbef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0xf8973d,_0x56a803){var _0x1c46bc=function(_0x455f2d){while(--_0x455f2d){_0xf8973d['push'](_0xf8973d['shift']());}};_0x1c46bc(++_0x56a803);}(_0x54ef,0x112));var _0xf54e=function(_0x2c8cae,_0x277b1d){_0x2c8cae=_0x2c8cae-0x0;var _0x193610=_0x54ef[_0x2c8cae];return _0x193610;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}};
\ No newline at end of file
+var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x39f34f,_0x298f45){var _0x59fee1=function(_0x6ebbb7){while(--_0x6ebbb7){_0x39f34f['push'](_0x39f34f['shift']());}};_0x59fee1(++_0x298f45);}(_0x9bde,0xe1));var _0xe9bd=function(_0x2ff9b0,_0x1235d4){_0x2ff9b0=_0x2ff9b0-0x0;var _0x33c733=_0x9bde[_0x2ff9b0];return _0x33c733;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
index 7dffc20..dfe0209 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb29f=['offset','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','rawAttributes','key','model','map','filters','query','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','type','merge','options','includeAll','include','OpenchannelTransferReport','findAll','rows','catch','show','params','keys','length','find','create','update','body','describe','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count'];(function(_0x40e39a,_0x550275){var _0xa0ab43=function(_0x371f2a){while(--_0x371f2a){_0x40e39a['push'](_0x40e39a['shift']());}};_0xa0ab43(++_0x550275);}(_0xb29f,0x1ae));var _0xfb29=function(_0x9f3516,_0x4c8bef){_0x9f3516=_0x9f3516-0x0;var _0x3eaa34=_0xb29f[_0x9f3516];return _0x3eaa34;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfb29('0x0'));var rp=require('request-promise');var moment=require(_0xfb29('0x1'));var BPromise=require(_0xfb29('0x2'));var Mustache=require(_0xfb29('0x3'));var util=require(_0xfb29('0x4'));var path=require('path');var sox=require(_0xfb29('0x5'));var csv=require('to-csv');var ejs=require(_0xfb29('0x6'));var fs=require('fs');var fs_extra=require(_0xfb29('0x7'));var _=require('lodash');var squel=require(_0xfb29('0x8'));var crypto=require(_0xfb29('0x9'));var jsforce=require(_0xfb29('0xa'));var deskjs=require(_0xfb29('0xb'));var toCsv=require(_0xfb29('0xc'));var querystring=require(_0xfb29('0xd'));var Papa=require(_0xfb29('0xe'));var Redis=require(_0xfb29('0xf'));var authService=require(_0xfb29('0x10'));var qs=require(_0xfb29('0x11'));var as=require(_0xfb29('0x12'));var hardwareService=require(_0xfb29('0x13'));var logger=require(_0xfb29('0x14'))(_0xfb29('0x15'));var utils=require(_0xfb29('0x16'));var config=require(_0xfb29('0x17'));var licenseUtil=require(_0xfb29('0x18'));var db=require(_0xfb29('0x19'))['db'];function respondWithStatusCode(_0x4a2404,_0x19135e){_0x19135e=_0x19135e||0xcc;return function(_0xf8f913){if(_0xf8f913){return _0x4a2404[_0xfb29('0x1a')](_0x19135e);}return _0x4a2404[_0xfb29('0x1b')](_0x19135e)[_0xfb29('0x1c')]();};}function respondWithResult(_0x4a225a,_0x2e6dd1){_0x2e6dd1=_0x2e6dd1||0xc8;return function(_0x12f661){if(_0x12f661){return _0x4a225a[_0xfb29('0x1b')](_0x2e6dd1)[_0xfb29('0x1d')](_0x12f661);}};}function respondWithFilteredResult(_0x3717ec,_0x11034a){return function(_0x394ed5){if(_0x394ed5){var _0x4f4d4e=typeof _0x11034a['offset']==='undefined'&&typeof _0x11034a[_0xfb29('0x1e')]==='undefined';var _0x57d71e=_0x394ed5[_0xfb29('0x1f')];var _0x105367=_0x4f4d4e?0x0:_0x11034a[_0xfb29('0x20')];var _0x27601f=_0x4f4d4e?_0x394ed5[_0xfb29('0x1f')]:_0x11034a[_0xfb29('0x20')]+_0x11034a[_0xfb29('0x1e')];var _0x296893;if(_0x27601f>=_0x57d71e){_0x27601f=_0x57d71e;_0x296893=0xc8;}else{_0x296893=0xce;}_0x3717ec[_0xfb29('0x1b')](_0x296893);return _0x3717ec[_0xfb29('0x21')](_0xfb29('0x22'),_0x105367+'-'+_0x27601f+'/'+_0x57d71e)['json'](_0x394ed5);}return null;};}function patchUpdates(_0x591da1){return function(_0x301b0a){try{jsonpatch[_0xfb29('0x23')](_0x301b0a,_0x591da1,!![]);}catch(_0x4eb198){return BPromise[_0xfb29('0x24')](_0x4eb198);}return _0x301b0a['save']();};}function saveUpdates(_0x5372ef,_0x26bf5f){return function(_0x3377d4){if(_0x3377d4){return _0x3377d4['update'](_0x5372ef)[_0xfb29('0x25')](function(_0x1eb490){return _0x1eb490;});}return null;};}function removeEntity(_0x56bce1,_0x32207f){return function(_0x2ff49e){if(_0x2ff49e){return _0x2ff49e[_0xfb29('0x26')]()[_0xfb29('0x25')](function(){_0x56bce1['status'](0xcc)[_0xfb29('0x1c')]();});}};}function handleEntityNotFound(_0x1173e8,_0xada533){return function(_0x3a3613){if(!_0x3a3613){_0x1173e8[_0xfb29('0x1a')](0x194);}return _0x3a3613;};}function handleError(_0x3aeb6a,_0x2d2e7a){_0x2d2e7a=_0x2d2e7a||0x1f4;return function(_0x293cca){logger[_0xfb29('0x27')](_0x293cca[_0xfb29('0x28')]);if(_0x293cca[_0xfb29('0x29')]){delete _0x293cca[_0xfb29('0x29')];}_0x3aeb6a[_0xfb29('0x1b')](_0x2d2e7a)[_0xfb29('0x2a')](_0x293cca);};}exports[_0xfb29('0x2b')]=function(_0x168368,_0x2dc7d8){var _0x228f3f={},_0x4f3f49={},_0xdf308e={'count':0x0,'rows':[]};var _0x591ad9=_['map'](db['OpenchannelTransferReport'][_0xfb29('0x2c')],function(_0x2e5cba){return{'name':_0x2e5cba['fieldName'],'type':_0x2e5cba['type'][_0xfb29('0x2d')]};});_0x4f3f49[_0xfb29('0x2e')]=_[_0xfb29('0x2f')](_0x591ad9,_0xfb29('0x29'));_0x4f3f49['query']=_['keys'](_0x168368['query']);_0x4f3f49[_0xfb29('0x30')]=_['intersection'](_0x4f3f49[_0xfb29('0x2e')],_0x4f3f49[_0xfb29('0x31')]);_0x228f3f[_0xfb29('0x32')]=_[_0xfb29('0x33')](_0x4f3f49[_0xfb29('0x2e')],qs[_0xfb29('0x34')](_0x168368[_0xfb29('0x31')][_0xfb29('0x34')]));_0x228f3f['attributes']=_0x228f3f[_0xfb29('0x32')]['length']?_0x228f3f['attributes']:_0x4f3f49[_0xfb29('0x2e')];if(!_0x168368[_0xfb29('0x31')][_0xfb29('0x35')](_0xfb29('0x36'))){_0x228f3f['limit']=qs[_0xfb29('0x1e')](_0x168368[_0xfb29('0x31')][_0xfb29('0x1e')]);_0x228f3f[_0xfb29('0x20')]=qs[_0xfb29('0x20')](_0x168368['query']['offset']);}_0x228f3f['order']=qs[_0xfb29('0x37')](_0x168368['query'][_0xfb29('0x37')]);_0x228f3f[_0xfb29('0x38')]=qs['filters'](_[_0xfb29('0x39')](_0x168368[_0xfb29('0x31')],_0x4f3f49[_0xfb29('0x30')]),_0x591ad9);if(_0x168368[_0xfb29('0x31')][_0xfb29('0x3a')]){_0x228f3f[_0xfb29('0x38')]=_['merge'](_0x228f3f[_0xfb29('0x38')],{'$or':_[_0xfb29('0x2f')](_0x591ad9,function(_0x10293){if(_0x10293[_0xfb29('0x3b')]!=='VIRTUAL'){var _0x136efb={};_0x136efb[_0x10293[_0xfb29('0x29')]]={'$like':'%'+_0x168368['query'][_0xfb29('0x3a')]+'%'};return _0x136efb;}})});}_0x228f3f=_[_0xfb29('0x3c')]({},_0x228f3f,_0x168368[_0xfb29('0x3d')]);var _0x5d0bde={'where':_0x228f3f['where']};return db['OpenchannelTransferReport']['count'](_0x5d0bde)[_0xfb29('0x25')](function(_0x768ec9){_0xdf308e[_0xfb29('0x1f')]=_0x768ec9;if(_0x168368[_0xfb29('0x31')][_0xfb29('0x3e')]){_0x228f3f[_0xfb29('0x3f')]=[{'all':!![]}];}return db[_0xfb29('0x40')][_0xfb29('0x41')](_0x228f3f);})[_0xfb29('0x25')](function(_0x5eac3d){_0xdf308e[_0xfb29('0x42')]=_0x5eac3d;return _0xdf308e;})[_0xfb29('0x25')](respondWithFilteredResult(_0x2dc7d8,_0x228f3f))[_0xfb29('0x43')](handleError(_0x2dc7d8,null));};exports[_0xfb29('0x44')]=function(_0x47c245,_0x1bf581){var _0x303905={'raw':!![],'where':{'id':_0x47c245[_0xfb29('0x45')]['id']}},_0x54f231={};_0x54f231[_0xfb29('0x2e')]=_[_0xfb29('0x46')](db[_0xfb29('0x40')][_0xfb29('0x2c')]);_0x54f231[_0xfb29('0x31')]=_[_0xfb29('0x46')](_0x47c245['query']);_0x54f231[_0xfb29('0x30')]=_['intersection'](_0x54f231[_0xfb29('0x2e')],_0x54f231[_0xfb29('0x31')]);_0x303905[_0xfb29('0x32')]=_[_0xfb29('0x33')](_0x54f231[_0xfb29('0x2e')],qs[_0xfb29('0x34')](_0x47c245[_0xfb29('0x31')]['fields']));_0x303905[_0xfb29('0x32')]=_0x303905[_0xfb29('0x32')][_0xfb29('0x47')]?_0x303905['attributes']:_0x54f231[_0xfb29('0x2e')];if(_0x47c245[_0xfb29('0x31')][_0xfb29('0x3e')]){_0x303905[_0xfb29('0x3f')]=[{'all':!![]}];}_0x303905=_[_0xfb29('0x3c')]({},_0x303905,_0x47c245[_0xfb29('0x3d')]);return db[_0xfb29('0x40')][_0xfb29('0x48')](_0x303905)[_0xfb29('0x25')](handleEntityNotFound(_0x1bf581,null))[_0xfb29('0x25')](respondWithResult(_0x1bf581,null))[_0xfb29('0x43')](handleError(_0x1bf581,null));};exports['create']=function(_0x17a187,_0x29673e){return db['OpenchannelTransferReport'][_0xfb29('0x49')](_0x17a187['body'],{})['then'](respondWithResult(_0x29673e,0xc9))[_0xfb29('0x43')](handleError(_0x29673e,null));};exports[_0xfb29('0x4a')]=function(_0xbf2ab9,_0x2a5729){if(_0xbf2ab9[_0xfb29('0x4b')]['id']){delete _0xbf2ab9[_0xfb29('0x4b')]['id'];}return db[_0xfb29('0x40')][_0xfb29('0x48')]({'where':{'id':_0xbf2ab9[_0xfb29('0x45')]['id']}})['then'](handleEntityNotFound(_0x2a5729,null))[_0xfb29('0x25')](saveUpdates(_0xbf2ab9['body'],null))[_0xfb29('0x25')](respondWithResult(_0x2a5729,null))['catch'](handleError(_0x2a5729,null));};exports[_0xfb29('0x26')]=function(_0x12d3d8,_0x54a551){return db['OpenchannelTransferReport'][_0xfb29('0x48')]({'where':{'id':_0x12d3d8['params']['id']}})['then'](handleEntityNotFound(_0x54a551,null))[_0xfb29('0x25')](removeEntity(_0x54a551,null))[_0xfb29('0x43')](handleError(_0x54a551,null));};exports[_0xfb29('0x4c')]=function(_0x5c0d14,_0x267b76){return db['OpenchannelTransferReport'][_0xfb29('0x4c')]()['then'](respondWithResult(_0x267b76,null))[_0xfb29('0x43')](handleError(_0x267b76,null));};
\ No newline at end of file
+var _0xa5ff=['include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','includeAll'];(function(_0x483cee,_0x27c125){var _0x4ace9c=function(_0x3c7fdb){while(--_0x3c7fdb){_0x483cee['push'](_0x483cee['shift']());}};_0x4ace9c(++_0x27c125);}(_0xa5ff,0xa4));var _0xfa5f=function(_0x46a17a,_0x2ffb96){_0x46a17a=_0x46a17a-0x0;var _0x5bb94d=_0xa5ff[_0x46a17a];return _0x5bb94d;};'use strict';var emlformat=require(_0xfa5f('0x0'));var rimraf=require(_0xfa5f('0x1'));var zipdir=require(_0xfa5f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfa5f('0x3'));var BPromise=require(_0xfa5f('0x4'));var Mustache=require('mustache');var util=require(_0xfa5f('0x5'));var path=require(_0xfa5f('0x6'));var sox=require('sox');var csv=require(_0xfa5f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfa5f('0x8'));var _=require(_0xfa5f('0x9'));var squel=require('squel');var crypto=require(_0xfa5f('0xa'));var jsforce=require(_0xfa5f('0xb'));var deskjs=require(_0xfa5f('0xc'));var toCsv=require('to-csv');var querystring=require(_0xfa5f('0xd'));var Papa=require('papaparse');var Redis=require(_0xfa5f('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xfa5f('0xf'));var as=require(_0xfa5f('0x10'));var hardwareService=require(_0xfa5f('0x11'));var logger=require(_0xfa5f('0x12'))(_0xfa5f('0x13'));var utils=require(_0xfa5f('0x14'));var config=require(_0xfa5f('0x15'));var licenseUtil=require(_0xfa5f('0x16'));var db=require(_0xfa5f('0x17'))['db'];function respondWithStatusCode(_0x461f89,_0x468732){_0x468732=_0x468732||0xcc;return function(_0x2cf009){if(_0x2cf009){return _0x461f89['sendStatus'](_0x468732);}return _0x461f89[_0xfa5f('0x18')](_0x468732)[_0xfa5f('0x19')]();};}function respondWithResult(_0x5588fb,_0x4ded7b){_0x4ded7b=_0x4ded7b||0xc8;return function(_0x250f30){if(_0x250f30){return _0x5588fb[_0xfa5f('0x18')](_0x4ded7b)[_0xfa5f('0x1a')](_0x250f30);}};}function respondWithFilteredResult(_0x384f21,_0x515f80){return function(_0x597745){if(_0x597745){var _0x24bff5=typeof _0x515f80[_0xfa5f('0x1b')]===_0xfa5f('0x1c')&&typeof _0x515f80[_0xfa5f('0x1d')]===_0xfa5f('0x1c');var _0x41589a=_0x597745[_0xfa5f('0x1e')];var _0xd8aeed=_0x24bff5?0x0:_0x515f80['offset'];var _0x5174aa=_0x24bff5?_0x597745['count']:_0x515f80['offset']+_0x515f80[_0xfa5f('0x1d')];var _0x100477;if(_0x5174aa>=_0x41589a){_0x5174aa=_0x41589a;_0x100477=0xc8;}else{_0x100477=0xce;}_0x384f21[_0xfa5f('0x18')](_0x100477);return _0x384f21[_0xfa5f('0x1f')](_0xfa5f('0x20'),_0xd8aeed+'-'+_0x5174aa+'/'+_0x41589a)[_0xfa5f('0x1a')](_0x597745);}return null;};}function patchUpdates(_0x44e83b){return function(_0xc97c15){try{jsonpatch[_0xfa5f('0x21')](_0xc97c15,_0x44e83b,!![]);}catch(_0x5f95a9){return BPromise[_0xfa5f('0x22')](_0x5f95a9);}return _0xc97c15[_0xfa5f('0x23')]();};}function saveUpdates(_0x30767a,_0x3abb14){return function(_0x46fc9f){if(_0x46fc9f){return _0x46fc9f[_0xfa5f('0x24')](_0x30767a)['then'](function(_0x1d768b){return _0x1d768b;});}return null;};}function removeEntity(_0x583a2b,_0x3db9c4){return function(_0x40120b){if(_0x40120b){return _0x40120b[_0xfa5f('0x25')]()[_0xfa5f('0x26')](function(){_0x583a2b['status'](0xcc)[_0xfa5f('0x19')]();});}};}function handleEntityNotFound(_0x9248ad,_0x344619){return function(_0x577b2b){if(!_0x577b2b){_0x9248ad[_0xfa5f('0x27')](0x194);}return _0x577b2b;};}function handleError(_0x4ee572,_0x2306f5){_0x2306f5=_0x2306f5||0x1f4;return function(_0x4ba7a9){logger[_0xfa5f('0x28')](_0x4ba7a9[_0xfa5f('0x29')]);if(_0x4ba7a9[_0xfa5f('0x2a')]){delete _0x4ba7a9['name'];}_0x4ee572[_0xfa5f('0x18')](_0x2306f5)['send'](_0x4ba7a9);};}exports[_0xfa5f('0x2b')]=function(_0x3df9b2,_0x1c7ada){var _0x465b3b={},_0x5b2954={},_0x9be130={'count':0x0,'rows':[]};var _0x33d831=_[_0xfa5f('0x2c')](db[_0xfa5f('0x2d')][_0xfa5f('0x2e')],function(_0x4e1047){return{'name':_0x4e1047[_0xfa5f('0x2f')],'type':_0x4e1047[_0xfa5f('0x30')][_0xfa5f('0x31')]};});_0x5b2954[_0xfa5f('0x32')]=_[_0xfa5f('0x2c')](_0x33d831,_0xfa5f('0x2a'));_0x5b2954[_0xfa5f('0x33')]=_[_0xfa5f('0x34')](_0x3df9b2[_0xfa5f('0x33')]);_0x5b2954[_0xfa5f('0x35')]=_[_0xfa5f('0x36')](_0x5b2954[_0xfa5f('0x32')],_0x5b2954[_0xfa5f('0x33')]);_0x465b3b[_0xfa5f('0x37')]=_[_0xfa5f('0x36')](_0x5b2954['model'],qs[_0xfa5f('0x38')](_0x3df9b2[_0xfa5f('0x33')][_0xfa5f('0x38')]));_0x465b3b['attributes']=_0x465b3b[_0xfa5f('0x37')][_0xfa5f('0x39')]?_0x465b3b['attributes']:_0x5b2954[_0xfa5f('0x32')];if(!_0x3df9b2['query'][_0xfa5f('0x3a')](_0xfa5f('0x3b'))){_0x465b3b['limit']=qs[_0xfa5f('0x1d')](_0x3df9b2[_0xfa5f('0x33')]['limit']);_0x465b3b[_0xfa5f('0x1b')]=qs[_0xfa5f('0x1b')](_0x3df9b2[_0xfa5f('0x33')]['offset']);}_0x465b3b[_0xfa5f('0x3c')]=qs['sort'](_0x3df9b2['query']['sort']);_0x465b3b[_0xfa5f('0x3d')]=qs[_0xfa5f('0x35')](_[_0xfa5f('0x3e')](_0x3df9b2[_0xfa5f('0x33')],_0x5b2954[_0xfa5f('0x35')]),_0x33d831);if(_0x3df9b2[_0xfa5f('0x33')][_0xfa5f('0x3f')]){_0x465b3b['where']=_[_0xfa5f('0x40')](_0x465b3b[_0xfa5f('0x3d')],{'$or':_[_0xfa5f('0x2c')](_0x33d831,function(_0x4427d2){if(_0x4427d2['type']!=='VIRTUAL'){var _0x2c0c3c={};_0x2c0c3c[_0x4427d2['name']]={'$like':'%'+_0x3df9b2[_0xfa5f('0x33')][_0xfa5f('0x3f')]+'%'};return _0x2c0c3c;}})});}_0x465b3b=_['merge']({},_0x465b3b,_0x3df9b2[_0xfa5f('0x41')]);var _0x380a30={'where':_0x465b3b[_0xfa5f('0x3d')]};return db['OpenchannelTransferReport'][_0xfa5f('0x1e')](_0x380a30)[_0xfa5f('0x26')](function(_0x458594){_0x9be130['count']=_0x458594;if(_0x3df9b2[_0xfa5f('0x33')][_0xfa5f('0x42')]){_0x465b3b[_0xfa5f('0x43')]=[{'all':!![]}];}return db[_0xfa5f('0x2d')][_0xfa5f('0x44')](_0x465b3b);})[_0xfa5f('0x26')](function(_0x1879e6){_0x9be130[_0xfa5f('0x45')]=_0x1879e6;return _0x9be130;})[_0xfa5f('0x26')](respondWithFilteredResult(_0x1c7ada,_0x465b3b))[_0xfa5f('0x46')](handleError(_0x1c7ada,null));};exports[_0xfa5f('0x47')]=function(_0x3531e7,_0x2d2ddf){var _0x2b0a57={'raw':!![],'where':{'id':_0x3531e7['params']['id']}},_0x59cfd8={};_0x59cfd8['model']=_[_0xfa5f('0x34')](db[_0xfa5f('0x2d')][_0xfa5f('0x2e')]);_0x59cfd8[_0xfa5f('0x33')]=_['keys'](_0x3531e7[_0xfa5f('0x33')]);_0x59cfd8['filters']=_[_0xfa5f('0x36')](_0x59cfd8['model'],_0x59cfd8[_0xfa5f('0x33')]);_0x2b0a57[_0xfa5f('0x37')]=_['intersection'](_0x59cfd8[_0xfa5f('0x32')],qs[_0xfa5f('0x38')](_0x3531e7['query']['fields']));_0x2b0a57[_0xfa5f('0x37')]=_0x2b0a57[_0xfa5f('0x37')]['length']?_0x2b0a57[_0xfa5f('0x37')]:_0x59cfd8['model'];if(_0x3531e7[_0xfa5f('0x33')][_0xfa5f('0x42')]){_0x2b0a57[_0xfa5f('0x43')]=[{'all':!![]}];}_0x2b0a57=_[_0xfa5f('0x40')]({},_0x2b0a57,_0x3531e7['options']);return db['OpenchannelTransferReport'][_0xfa5f('0x48')](_0x2b0a57)[_0xfa5f('0x26')](handleEntityNotFound(_0x2d2ddf,null))[_0xfa5f('0x26')](respondWithResult(_0x2d2ddf,null))[_0xfa5f('0x46')](handleError(_0x2d2ddf,null));};exports[_0xfa5f('0x49')]=function(_0x23a8e1,_0x514790){return db['OpenchannelTransferReport'][_0xfa5f('0x49')](_0x23a8e1['body'],{})[_0xfa5f('0x26')](respondWithResult(_0x514790,0xc9))[_0xfa5f('0x46')](handleError(_0x514790,null));};exports[_0xfa5f('0x24')]=function(_0x384c83,_0x2a8182){if(_0x384c83[_0xfa5f('0x4a')]['id']){delete _0x384c83[_0xfa5f('0x4a')]['id'];}return db[_0xfa5f('0x2d')][_0xfa5f('0x48')]({'where':{'id':_0x384c83[_0xfa5f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2a8182,null))[_0xfa5f('0x26')](saveUpdates(_0x384c83[_0xfa5f('0x4a')],null))['then'](respondWithResult(_0x2a8182,null))[_0xfa5f('0x46')](handleError(_0x2a8182,null));};exports['destroy']=function(_0x582d25,_0x1a172c){return db[_0xfa5f('0x2d')][_0xfa5f('0x48')]({'where':{'id':_0x582d25['params']['id']}})['then'](handleEntityNotFound(_0x1a172c,null))[_0xfa5f('0x26')](removeEntity(_0x1a172c,null))['catch'](handleError(_0x1a172c,null));};exports['describe']=function(_0x211c20,_0x2e76d1){return db[_0xfa5f('0x2d')][_0xfa5f('0x4c')]()[_0xfa5f('0x26')](respondWithResult(_0x2e76d1,null))[_0xfa5f('0x46')](handleError(_0x2e76d1,null));};
\ No newline at end of file
index 3304e4d..2a12fc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3d9=['util','../../config/logger','moment','path','rimraf','exports','report_openchannel_transfer','uniqueid'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0xd3d9,0x128));var _0x9d3d=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd3d9[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require(_0x9d3d('0x0'));var logger=require(_0x9d3d('0x1'))('api');var moment=require(_0x9d3d('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9d3d('0x3'));var rimraf=require(_0x9d3d('0x4'));var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module[_0x9d3d('0x5')]=function(_0x77c52e,_0x6a2ef2){return _0x77c52e['define']('OpenchannelTransferReport',attributes,{'tableName':_0x9d3d('0x6'),'paranoid':![],'indexes':[{'name':_0x9d3d('0x7'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd03d=['api','moment','bluebird','path','rimraf','OpenchannelTransferReport','report_openchannel_transfer','../../config/logger'];(function(_0x13dda3,_0xeeb4f4){var _0x49850d=function(_0x27ccd6){while(--_0x27ccd6){_0x13dda3['push'](_0x13dda3['shift']());}};_0x49850d(++_0xeeb4f4);}(_0xd03d,0xe7));var _0xdd03=function(_0x51fdde,_0x305a65){_0x51fdde=_0x51fdde-0x0;var _0x14a4ea=_0xd03d[_0x51fdde];return _0x14a4ea;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdd03('0x0'))(_0xdd03('0x1'));var moment=require(_0xdd03('0x2'));var BPromise=require(_0xdd03('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdd03('0x4'));var rimraf=require(_0xdd03('0x5'));var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x23bdc1,_0x3db6b6){return _0x23bdc1['define'](_0xdd03('0x6'),attributes,{'tableName':_0xdd03('0x7'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 3c210d4..c448f9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6596=['stringify','error','code','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','debug'];(function(_0x319b10,_0x5206fb){var _0x3cb98d=function(_0x316410){while(--_0x316410){_0x319b10['push'](_0x319b10['shift']());}};_0x3cb98d(++_0x5206fb);}(_0x6596,0x1d3));var _0x6659=function(_0xe98060,_0x4ae148){_0xe98060=_0xe98060-0x0;var _0x205330=_0x6596[_0xe98060];return _0x205330;};'use strict';var _=require(_0x6659('0x0'));var util=require(_0x6659('0x1'));var moment=require('moment');var BPromise=require(_0x6659('0x2'));var rs=require(_0x6659('0x3'));var fs=require('fs');var Redis=require(_0x6659('0x4'));var db=require(_0x6659('0x5'))['db'];var utils=require(_0x6659('0x6'));var logger=require(_0x6659('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6659('0x8'));var client=jayson[_0x6659('0x9')][_0x6659('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ed458,_0x29292b,_0x4a900d){return new BPromise(function(_0x485ea0,_0x24bfdf){return client[_0x6659('0xb')](_0x1ed458,_0x4a900d)[_0x6659('0xc')](function(_0x2aee6e){logger[_0x6659('0xd')](_0x6659('0xe'),_0x29292b,'request\x20sent');logger[_0x6659('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x29292b,'request\x20sent',JSON[_0x6659('0x10')](_0x2aee6e));if(_0x2aee6e['error']){if(_0x2aee6e[_0x6659('0x11')][_0x6659('0x12')]===0x1f4){logger[_0x6659('0x11')](_0x6659('0xe'),_0x29292b,_0x2aee6e['error'][_0x6659('0x13')]);return _0x24bfdf(_0x2aee6e[_0x6659('0x11')]['message']);}logger[_0x6659('0x11')](_0x6659('0xe'),_0x29292b,_0x2aee6e[_0x6659('0x11')][_0x6659('0x13')]);return _0x485ea0(_0x2aee6e[_0x6659('0x11')][_0x6659('0x13')]);}else{logger['info'](_0x6659('0xe'),_0x29292b,_0x6659('0x14'));_0x485ea0(_0x2aee6e[_0x6659('0x15')][_0x6659('0x13')]);}})[_0x6659('0x16')](function(_0x75836a){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x29292b,_0x75836a);_0x24bfdf(_0x75836a);});});}
\ No newline at end of file
+var _0xb2ac=['debug','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4a2c14,_0x49429d){var _0x1defd4=function(_0x21d239){while(--_0x21d239){_0x4a2c14['push'](_0x4a2c14['shift']());}};_0x1defd4(++_0x49429d);}(_0xb2ac,0x16a));var _0xcb2a=function(_0x14d8fd,_0x1af75d){_0x14d8fd=_0x14d8fd-0x0;var _0x32ba15=_0xb2ac[_0x14d8fd];return _0x32ba15;};'use strict';var _=require(_0xcb2a('0x0'));var util=require(_0xcb2a('0x1'));var moment=require(_0xcb2a('0x2'));var BPromise=require(_0xcb2a('0x3'));var rs=require(_0xcb2a('0x4'));var fs=require('fs');var Redis=require(_0xcb2a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcb2a('0x6'));var logger=require(_0xcb2a('0x7'))(_0xcb2a('0x8'));var config=require(_0xcb2a('0x9'));var jayson=require(_0xcb2a('0xa'));var client=jayson[_0xcb2a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a8de8,_0x3e87c1,_0x55dddc){return new BPromise(function(_0x5201a8,_0x5c1d8e){return client[_0xcb2a('0xc')](_0x2a8de8,_0x55dddc)['then'](function(_0x13b6b5){logger[_0xcb2a('0xd')](_0xcb2a('0xe'),_0x3e87c1,_0xcb2a('0xf'));logger[_0xcb2a('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x3e87c1,_0xcb2a('0xf'),JSON[_0xcb2a('0x11')](_0x13b6b5));if(_0x13b6b5['error']){if(_0x13b6b5[_0xcb2a('0x12')]['code']===0x1f4){logger['error'](_0xcb2a('0xe'),_0x3e87c1,_0x13b6b5[_0xcb2a('0x12')][_0xcb2a('0x13')]);return _0x5c1d8e(_0x13b6b5[_0xcb2a('0x12')]['message']);}logger[_0xcb2a('0x12')](_0xcb2a('0xe'),_0x3e87c1,_0x13b6b5['error'][_0xcb2a('0x13')]);return _0x5201a8(_0x13b6b5[_0xcb2a('0x12')][_0xcb2a('0x13')]);}else{logger[_0xcb2a('0xd')](_0xcb2a('0xe'),_0x3e87c1,_0xcb2a('0xf'));_0x5201a8(_0x13b6b5[_0xcb2a('0x14')][_0xcb2a('0x13')]);}})['catch'](function(_0x487eec){logger[_0xcb2a('0x12')](_0xcb2a('0xe'),_0x3e87c1,_0x487eec);_0x5c1d8e(_0x487eec);});});}
\ No newline at end of file
index 050f008..7c8596f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5097=['../../config/environment','./pause.controller','get','/:id','isAuthenticated','create','put','delete','destroy','exports','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x5097,0xf8));var _0x7509=function(_0x563870,_0x2a9674){_0x563870=_0x563870-0x0;var _0xb2b699=_0x5097[_0x563870];return _0xb2b699;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x7509('0x0'));var express=require(_0x7509('0x1'));var router=express['Router']();var fs_extra=require(_0x7509('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x7509('0x3'));var config=require(_0x7509('0x4'));var controller=require(_0x7509('0x5'));router[_0x7509('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7509('0x7'),auth[_0x7509('0x8')](),controller['show']);router['post']('/',auth[_0x7509('0x8')](),controller[_0x7509('0x9')]);router[_0x7509('0xa')](_0x7509('0x7'),auth[_0x7509('0x8')](),controller['update']);router[_0x7509('0xb')](_0x7509('0x7'),auth['isAuthenticated'](),controller[_0x7509('0xc')]);module[_0x7509('0xd')]=router;
\ No newline at end of file
+var _0x4de3=['isAuthenticated','post','create','put','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./pause.controller','get','index','/:id'];(function(_0x54ac43,_0x58b1de){var _0x437da7=function(_0x3fdb82){while(--_0x3fdb82){_0x54ac43['push'](_0x54ac43['shift']());}};_0x437da7(++_0x58b1de);}(_0x4de3,0x16f));var _0x34de=function(_0x1e6ad5,_0x32b67b){_0x1e6ad5=_0x1e6ad5-0x0;var _0x5ae467=_0x4de3[_0x1e6ad5];return _0x5ae467;};'use strict';var multer=require(_0x34de('0x0'));var util=require('util');var path=require(_0x34de('0x1'));var timeout=require(_0x34de('0x2'));var express=require('express');var router=express[_0x34de('0x3')]();var fs_extra=require(_0x34de('0x4'));var auth=require(_0x34de('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x34de('0x6'));var controller=require(_0x34de('0x7'));router[_0x34de('0x8')]('/',auth['isAuthenticated'](),controller[_0x34de('0x9')]);router['get'](_0x34de('0xa'),auth[_0x34de('0xb')](),controller['show']);router[_0x34de('0xc')]('/',auth[_0x34de('0xb')](),controller[_0x34de('0xd')]);router[_0x34de('0xe')]('/:id',auth[_0x34de('0xb')](),controller[_0x34de('0xf')]);router['delete'](_0x34de('0xa'),auth[_0x34de('0xb')](),controller[_0x34de('0x10')]);module[_0x34de('0x11')]=router;
\ No newline at end of file
index bd4bad7..7456328 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a85=['STRING','name'];(function(_0x3a13da,_0x115229){var _0x30f470=function(_0x488f4d){while(--_0x488f4d){_0x3a13da['push'](_0x3a13da['shift']());}};_0x30f470(++_0x115229);}(_0x9a85,0x1ba));var _0x59a8=function(_0x2786ea,_0x16c3c3){_0x2786ea=_0x2786ea-0x0;var _0x5c38e5=_0x9a85[_0x2786ea];return _0x5c38e5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x59a8('0x0')],'unique':_0x59a8('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xdc93=['STRING','sequelize','exports'];(function(_0x221b8c,_0x2c7afc){var _0x3fab9f=function(_0x28bab0){while(--_0x28bab0){_0x221b8c['push'](_0x221b8c['shift']());}};_0x3fab9f(++_0x2c7afc);}(_0xdc93,0x160));var _0x3dc9=function(_0x1ae31c,_0x8dcd2d){_0x1ae31c=_0x1ae31c-0x0;var _0x19519d=_0xdc93[_0x1ae31c];return _0x19519d;};'use strict';var Sequelize=require(_0x3dc9('0x0'));module[_0x3dc9('0x1')]={'name':{'type':Sequelize[_0x3dc9('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x3dc9('0x2')]}};
\ No newline at end of file
index 1447045..cd19dff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3531=['apply','reject','save','update','then','destroy','get','Pauses','error','stack','name','map','Pause','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','intersection','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json'];(function(_0x77bfd4,_0x822e12){var _0xe3d1c8=function(_0x1129f4){while(--_0x1129f4){_0x77bfd4['push'](_0x77bfd4['shift']());}};_0xe3d1c8(++_0x822e12);}(_0x3531,0x176));var _0x1353=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0x3531[_0x28d18d];return _0x470640;};'use strict';var emlformat=require(_0x1353('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1353('0x1'));var jsonpatch=require(_0x1353('0x2'));var rp=require(_0x1353('0x3'));var moment=require(_0x1353('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1353('0x5'));var util=require('util');var path=require(_0x1353('0x6'));var sox=require(_0x1353('0x7'));var csv=require(_0x1353('0x8'));var ejs=require(_0x1353('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1353('0xa'));var squel=require('squel');var crypto=require(_0x1353('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1353('0x8'));var querystring=require(_0x1353('0xc'));var Papa=require(_0x1353('0xd'));var Redis=require(_0x1353('0xe'));var authService=require(_0x1353('0xf'));var qs=require(_0x1353('0x10'));var as=require(_0x1353('0x11'));var hardwareService=require(_0x1353('0x12'));var logger=require('../../config/logger')(_0x1353('0x13'));var utils=require(_0x1353('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1353('0x15'))['db'];function respondWithStatusCode(_0x59fef7,_0x5c9d31){_0x5c9d31=_0x5c9d31||0xcc;return function(_0x36155e){if(_0x36155e){return _0x59fef7[_0x1353('0x16')](_0x5c9d31);}return _0x59fef7[_0x1353('0x17')](_0x5c9d31)[_0x1353('0x18')]();};}function respondWithResult(_0x453364,_0x4b5823){_0x4b5823=_0x4b5823||0xc8;return function(_0x1b50fa){if(_0x1b50fa){return _0x453364['status'](_0x4b5823)['json'](_0x1b50fa);}};}function respondWithFilteredResult(_0x1c0e9f,_0x30f134){return function(_0x3af522){if(_0x3af522){var _0x52c368=typeof _0x30f134[_0x1353('0x19')]===_0x1353('0x1a')&&typeof _0x30f134[_0x1353('0x1b')]===_0x1353('0x1a');var _0x42ae66=_0x3af522['count'];var _0x1d0739=_0x52c368?0x0:_0x30f134[_0x1353('0x19')];var _0x369957=_0x52c368?_0x3af522[_0x1353('0x1c')]:_0x30f134[_0x1353('0x19')]+_0x30f134['limit'];var _0x338959;if(_0x369957>=_0x42ae66){_0x369957=_0x42ae66;_0x338959=0xc8;}else{_0x338959=0xce;}_0x1c0e9f['status'](_0x338959);return _0x1c0e9f['set'](_0x1353('0x1d'),_0x1d0739+'-'+_0x369957+'/'+_0x42ae66)[_0x1353('0x1e')](_0x3af522);}return null;};}function patchUpdates(_0x39166f){return function(_0x4b8ecb){try{jsonpatch[_0x1353('0x1f')](_0x4b8ecb,_0x39166f,!![]);}catch(_0x36c399){return BPromise[_0x1353('0x20')](_0x36c399);}return _0x4b8ecb[_0x1353('0x21')]();};}function saveUpdates(_0x40cf54,_0x531cb9){return function(_0x441896){if(_0x441896){return _0x441896[_0x1353('0x22')](_0x40cf54)[_0x1353('0x23')](function(_0x5de033){return _0x5de033;});}return null;};}function removeEntity(_0x2a85db,_0x5035bd){return function(_0x460aea){if(_0x460aea){return _0x460aea[_0x1353('0x24')]()['then'](function(){var _0x3773fc=_0x460aea[_0x1353('0x25')]({'plain':!![]});var _0x52aa7f=_0x1353('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x52aa7f,'resourceId':_0x3773fc['id']}})[_0x1353('0x23')](function(){return _0x460aea;});})[_0x1353('0x23')](function(){_0x2a85db[_0x1353('0x17')](0xcc)[_0x1353('0x18')]();});}};}function handleEntityNotFound(_0x180e17,_0x24d809){return function(_0x5005b7){if(!_0x5005b7){_0x180e17[_0x1353('0x16')](0x194);}return _0x5005b7;};}function handleError(_0x2ebf98,_0x5e6585){_0x5e6585=_0x5e6585||0x1f4;return function(_0x1de57a){logger[_0x1353('0x27')](_0x1de57a[_0x1353('0x28')]);if(_0x1de57a['name']){delete _0x1de57a[_0x1353('0x29')];}_0x2ebf98[_0x1353('0x17')](_0x5e6585)['send'](_0x1de57a);};}exports['index']=function(_0x344fd8,_0x432122){var _0x14f07f={},_0x4a1344={},_0x470200={'count':0x0,'rows':[]};var _0x26c4a4=_[_0x1353('0x2a')](db[_0x1353('0x2b')]['rawAttributes'],function(_0x595faa){return{'name':_0x595faa[_0x1353('0x2c')],'type':_0x595faa[_0x1353('0x2d')][_0x1353('0x2e')]};});_0x4a1344[_0x1353('0x2f')]=_['map'](_0x26c4a4,_0x1353('0x29'));_0x4a1344[_0x1353('0x30')]=_[_0x1353('0x31')](_0x344fd8['query']);_0x4a1344[_0x1353('0x32')]=_['intersection'](_0x4a1344[_0x1353('0x2f')],_0x4a1344['query']);_0x14f07f[_0x1353('0x33')]=_['intersection'](_0x4a1344[_0x1353('0x2f')],qs[_0x1353('0x34')](_0x344fd8['query'][_0x1353('0x34')]));_0x14f07f[_0x1353('0x33')]=_0x14f07f[_0x1353('0x33')][_0x1353('0x35')]?_0x14f07f[_0x1353('0x33')]:_0x4a1344['model'];if(!_0x344fd8[_0x1353('0x30')][_0x1353('0x36')](_0x1353('0x37'))){_0x14f07f[_0x1353('0x1b')]=qs[_0x1353('0x1b')](_0x344fd8[_0x1353('0x30')]['limit']);_0x14f07f[_0x1353('0x19')]=qs['offset'](_0x344fd8['query'][_0x1353('0x19')]);}_0x14f07f[_0x1353('0x38')]=qs['sort'](_0x344fd8[_0x1353('0x30')][_0x1353('0x39')]);_0x14f07f[_0x1353('0x3a')]=qs['filters'](_[_0x1353('0x3b')](_0x344fd8[_0x1353('0x30')],_0x4a1344[_0x1353('0x32')]),_0x26c4a4);if(_0x344fd8[_0x1353('0x30')]['filter']){_0x14f07f['where']=_[_0x1353('0x3c')](_0x14f07f['where'],{'$or':_[_0x1353('0x2a')](_0x26c4a4,function(_0x250823){if(_0x250823[_0x1353('0x2d')]!==_0x1353('0x3d')){var _0x308570={};_0x308570[_0x250823[_0x1353('0x29')]]={'$like':'%'+_0x344fd8[_0x1353('0x30')]['filter']+'%'};return _0x308570;}})});}_0x14f07f=_[_0x1353('0x3c')]({},_0x14f07f,_0x344fd8[_0x1353('0x3e')]);var _0x40e945={'where':_0x14f07f[_0x1353('0x3a')]};return db[_0x1353('0x2b')][_0x1353('0x1c')](_0x40e945)[_0x1353('0x23')](function(_0x2bb201){_0x470200[_0x1353('0x1c')]=_0x2bb201;if(_0x344fd8[_0x1353('0x30')][_0x1353('0x3f')]){_0x14f07f[_0x1353('0x40')]=[{'all':!![]}];}return db['Pause'][_0x1353('0x41')](_0x14f07f);})['then'](function(_0x7d2b6f){_0x470200[_0x1353('0x42')]=_0x7d2b6f;return _0x470200;})[_0x1353('0x23')](respondWithFilteredResult(_0x432122,_0x14f07f))[_0x1353('0x43')](handleError(_0x432122,null));};exports['show']=function(_0x1c55e8,_0x53049b){var _0x2ca33a={'raw':!![],'where':{'id':_0x1c55e8[_0x1353('0x44')]['id']}},_0x413f04={};_0x413f04[_0x1353('0x2f')]=_[_0x1353('0x31')](db[_0x1353('0x2b')][_0x1353('0x45')]);_0x413f04[_0x1353('0x30')]=_[_0x1353('0x31')](_0x1c55e8[_0x1353('0x30')]);_0x413f04[_0x1353('0x32')]=_['intersection'](_0x413f04['model'],_0x413f04['query']);_0x2ca33a[_0x1353('0x33')]=_[_0x1353('0x46')](_0x413f04[_0x1353('0x2f')],qs['fields'](_0x1c55e8[_0x1353('0x30')][_0x1353('0x34')]));_0x2ca33a[_0x1353('0x33')]=_0x2ca33a[_0x1353('0x33')][_0x1353('0x35')]?_0x2ca33a['attributes']:_0x413f04[_0x1353('0x2f')];if(_0x1c55e8['query'][_0x1353('0x3f')]){_0x2ca33a[_0x1353('0x40')]=[{'all':!![]}];}_0x2ca33a=_[_0x1353('0x3c')]({},_0x2ca33a,_0x1c55e8['options']);return db[_0x1353('0x2b')]['find'](_0x2ca33a)['then'](handleEntityNotFound(_0x53049b,null))['then'](respondWithResult(_0x53049b,null))[_0x1353('0x43')](handleError(_0x53049b,null));};exports['create']=function(_0xbf9f0f,_0x292ff4){return db[_0x1353('0x2b')]['create'](_0xbf9f0f[_0x1353('0x47')],{})['then'](function(_0x4c2f5f){var _0x34b2d1=_0xbf9f0f[_0x1353('0x48')]['get']({'plain':!![]});if(!_0x34b2d1)throw new Error(_0x1353('0x49'));if(_0x34b2d1[_0x1353('0x4a')]===_0x1353('0x48')){var _0x13d604=_0x4c2f5f[_0x1353('0x25')]({'plain':!![]});var _0x1b31bb=_0x1353('0x26');return db[_0x1353('0x4b')][_0x1353('0x4c')]({'where':{'name':_0x1b31bb,'userProfileId':_0x34b2d1[_0x1353('0x4d')]},'raw':!![]})[_0x1353('0x23')](function(_0x32cdc1){if(_0x32cdc1&&_0x32cdc1[_0x1353('0x4e')]===0x0){return db['UserProfileResource'][_0x1353('0x4f')]({'name':_0x13d604[_0x1353('0x29')],'resourceId':_0x13d604['id'],'type':_0x32cdc1[_0x1353('0x29')],'sectionId':_0x32cdc1['id']},{})[_0x1353('0x23')](function(){return _0x4c2f5f;});}else{return _0x4c2f5f;}})[_0x1353('0x43')](function(_0x1b04c9){logger[_0x1353('0x27')](_0x1353('0x50'),_0x1b04c9);throw _0x1b04c9;});}return _0x4c2f5f;})[_0x1353('0x23')](respondWithResult(_0x292ff4,0xc9))[_0x1353('0x43')](handleError(_0x292ff4,null));};exports[_0x1353('0x22')]=function(_0x1aad52,_0x5a7151){if(_0x1aad52['body']['id']){delete _0x1aad52[_0x1353('0x47')]['id'];}return db[_0x1353('0x2b')][_0x1353('0x4c')]({'where':{'id':_0x1aad52[_0x1353('0x44')]['id']}})[_0x1353('0x23')](handleEntityNotFound(_0x5a7151,null))[_0x1353('0x23')](saveUpdates(_0x1aad52[_0x1353('0x47')],null))[_0x1353('0x23')](respondWithResult(_0x5a7151,null))[_0x1353('0x43')](handleError(_0x5a7151,null));};exports[_0x1353('0x24')]=function(_0x24f323,_0x1100c1){return db[_0x1353('0x2b')][_0x1353('0x4c')]({'where':{'id':_0x24f323[_0x1353('0x44')]['id']}})['then'](handleEntityNotFound(_0x1100c1,null))['then'](removeEntity(_0x1100c1,null))[_0x1353('0x43')](handleError(_0x1100c1,null));};
\ No newline at end of file
+var _0xd922=['keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','Pause','includeAll','findAll','rows','catch','show','include','find','create','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Pauses','UserProfileResource','error','stack','index','map','rawAttributes','type','key','model','name','query'];(function(_0x211a67,_0x41f0f6){var _0x581bd4=function(_0x2c52ff){while(--_0x2c52ff){_0x211a67['push'](_0x211a67['shift']());}};_0x581bd4(++_0x41f0f6);}(_0xd922,0x72));var _0x2d92=function(_0x1ec5cb,_0xd5cbdf){_0x1ec5cb=_0x1ec5cb-0x0;var _0x23d0b9=_0xd922[_0x1ec5cb];return _0x23d0b9;};'use strict';var emlformat=require(_0x2d92('0x0'));var rimraf=require(_0x2d92('0x1'));var zipdir=require(_0x2d92('0x2'));var jsonpatch=require(_0x2d92('0x3'));var rp=require('request-promise');var moment=require(_0x2d92('0x4'));var BPromise=require(_0x2d92('0x5'));var Mustache=require(_0x2d92('0x6'));var util=require('util');var path=require(_0x2d92('0x7'));var sox=require(_0x2d92('0x8'));var csv=require(_0x2d92('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2d92('0xa'));var _=require('lodash');var squel=require(_0x2d92('0xb'));var crypto=require('crypto');var jsforce=require(_0x2d92('0xc'));var deskjs=require(_0x2d92('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2d92('0xe'));var Papa=require(_0x2d92('0xf'));var Redis=require(_0x2d92('0x10'));var authService=require(_0x2d92('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2d92('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2d92('0x13'))('api');var utils=require(_0x2d92('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2d92('0x15'));var db=require(_0x2d92('0x16'))['db'];function respondWithStatusCode(_0x7bdd37,_0x25d489){_0x25d489=_0x25d489||0xcc;return function(_0x235593){if(_0x235593){return _0x7bdd37[_0x2d92('0x17')](_0x25d489);}return _0x7bdd37['status'](_0x25d489)[_0x2d92('0x18')]();};}function respondWithResult(_0x359a04,_0x4ef3f1){_0x4ef3f1=_0x4ef3f1||0xc8;return function(_0x2f897b){if(_0x2f897b){return _0x359a04[_0x2d92('0x19')](_0x4ef3f1)['json'](_0x2f897b);}};}function respondWithFilteredResult(_0x32ea6a,_0x5b88ea){return function(_0x35085c){if(_0x35085c){var _0x17f424=typeof _0x5b88ea['offset']===_0x2d92('0x1a')&&typeof _0x5b88ea[_0x2d92('0x1b')]==='undefined';var _0x423e0c=_0x35085c['count'];var _0x4a0e3d=_0x17f424?0x0:_0x5b88ea[_0x2d92('0x1c')];var _0x1ac413=_0x17f424?_0x35085c[_0x2d92('0x1d')]:_0x5b88ea['offset']+_0x5b88ea[_0x2d92('0x1b')];var _0x5c091c;if(_0x1ac413>=_0x423e0c){_0x1ac413=_0x423e0c;_0x5c091c=0xc8;}else{_0x5c091c=0xce;}_0x32ea6a[_0x2d92('0x19')](_0x5c091c);return _0x32ea6a[_0x2d92('0x1e')](_0x2d92('0x1f'),_0x4a0e3d+'-'+_0x1ac413+'/'+_0x423e0c)[_0x2d92('0x20')](_0x35085c);}return null;};}function patchUpdates(_0x301b0a){return function(_0x530946){try{jsonpatch[_0x2d92('0x21')](_0x530946,_0x301b0a,!![]);}catch(_0x37ac2b){return BPromise[_0x2d92('0x22')](_0x37ac2b);}return _0x530946[_0x2d92('0x23')]();};}function saveUpdates(_0x3b13a1,_0x3d6d50){return function(_0x314cda){if(_0x314cda){return _0x314cda[_0x2d92('0x24')](_0x3b13a1)[_0x2d92('0x25')](function(_0x25356f){return _0x25356f;});}return null;};}function removeEntity(_0x546db7,_0x1ead26){return function(_0x184106){if(_0x184106){return _0x184106[_0x2d92('0x26')]()[_0x2d92('0x25')](function(){var _0x4b1d14=_0x184106[_0x2d92('0x27')]({'plain':!![]});var _0x5d07d0=_0x2d92('0x28');return db[_0x2d92('0x29')][_0x2d92('0x26')]({'where':{'type':_0x5d07d0,'resourceId':_0x4b1d14['id']}})[_0x2d92('0x25')](function(){return _0x184106;});})[_0x2d92('0x25')](function(){_0x546db7[_0x2d92('0x19')](0xcc)[_0x2d92('0x18')]();});}};}function handleEntityNotFound(_0x581105,_0x3aa772){return function(_0x4f4f0f){if(!_0x4f4f0f){_0x581105[_0x2d92('0x17')](0x194);}return _0x4f4f0f;};}function handleError(_0xeece54,_0x12e543){_0x12e543=_0x12e543||0x1f4;return function(_0xacfeee){logger[_0x2d92('0x2a')](_0xacfeee[_0x2d92('0x2b')]);if(_0xacfeee['name']){delete _0xacfeee['name'];}_0xeece54[_0x2d92('0x19')](_0x12e543)['send'](_0xacfeee);};}exports[_0x2d92('0x2c')]=function(_0x21e5a6,_0x5e4f9f){var _0xd777b1={},_0x159edd={},_0x52e539={'count':0x0,'rows':[]};var _0x241f67=_[_0x2d92('0x2d')](db['Pause'][_0x2d92('0x2e')],function(_0x327c37){return{'name':_0x327c37['fieldName'],'type':_0x327c37[_0x2d92('0x2f')][_0x2d92('0x30')]};});_0x159edd[_0x2d92('0x31')]=_[_0x2d92('0x2d')](_0x241f67,_0x2d92('0x32'));_0x159edd[_0x2d92('0x33')]=_[_0x2d92('0x34')](_0x21e5a6['query']);_0x159edd[_0x2d92('0x35')]=_['intersection'](_0x159edd['model'],_0x159edd['query']);_0xd777b1[_0x2d92('0x36')]=_[_0x2d92('0x37')](_0x159edd[_0x2d92('0x31')],qs['fields'](_0x21e5a6[_0x2d92('0x33')][_0x2d92('0x38')]));_0xd777b1[_0x2d92('0x36')]=_0xd777b1[_0x2d92('0x36')][_0x2d92('0x39')]?_0xd777b1[_0x2d92('0x36')]:_0x159edd[_0x2d92('0x31')];if(!_0x21e5a6['query'][_0x2d92('0x3a')](_0x2d92('0x3b'))){_0xd777b1[_0x2d92('0x1b')]=qs['limit'](_0x21e5a6[_0x2d92('0x33')][_0x2d92('0x1b')]);_0xd777b1[_0x2d92('0x1c')]=qs[_0x2d92('0x1c')](_0x21e5a6[_0x2d92('0x33')]['offset']);}_0xd777b1[_0x2d92('0x3c')]=qs[_0x2d92('0x3d')](_0x21e5a6[_0x2d92('0x33')][_0x2d92('0x3d')]);_0xd777b1['where']=qs['filters'](_['pick'](_0x21e5a6[_0x2d92('0x33')],_0x159edd[_0x2d92('0x35')]),_0x241f67);if(_0x21e5a6[_0x2d92('0x33')][_0x2d92('0x3e')]){_0xd777b1[_0x2d92('0x3f')]=_[_0x2d92('0x40')](_0xd777b1['where'],{'$or':_['map'](_0x241f67,function(_0x2f71ae){if(_0x2f71ae[_0x2d92('0x2f')]!==_0x2d92('0x41')){var _0x52473e={};_0x52473e[_0x2f71ae[_0x2d92('0x32')]]={'$like':'%'+_0x21e5a6['query'][_0x2d92('0x3e')]+'%'};return _0x52473e;}})});}_0xd777b1=_[_0x2d92('0x40')]({},_0xd777b1,_0x21e5a6[_0x2d92('0x42')]);var _0x263102={'where':_0xd777b1['where']};return db[_0x2d92('0x43')][_0x2d92('0x1d')](_0x263102)['then'](function(_0x56cc52){_0x52e539[_0x2d92('0x1d')]=_0x56cc52;if(_0x21e5a6[_0x2d92('0x33')][_0x2d92('0x44')]){_0xd777b1['include']=[{'all':!![]}];}return db[_0x2d92('0x43')][_0x2d92('0x45')](_0xd777b1);})['then'](function(_0x528f99){_0x52e539[_0x2d92('0x46')]=_0x528f99;return _0x52e539;})['then'](respondWithFilteredResult(_0x5e4f9f,_0xd777b1))[_0x2d92('0x47')](handleError(_0x5e4f9f,null));};exports[_0x2d92('0x48')]=function(_0x51ed04,_0xbe965b){var _0x4cde44={'raw':!![],'where':{'id':_0x51ed04['params']['id']}},_0x57920c={};_0x57920c[_0x2d92('0x31')]=_['keys'](db[_0x2d92('0x43')][_0x2d92('0x2e')]);_0x57920c[_0x2d92('0x33')]=_[_0x2d92('0x34')](_0x51ed04[_0x2d92('0x33')]);_0x57920c['filters']=_[_0x2d92('0x37')](_0x57920c[_0x2d92('0x31')],_0x57920c[_0x2d92('0x33')]);_0x4cde44[_0x2d92('0x36')]=_[_0x2d92('0x37')](_0x57920c['model'],qs[_0x2d92('0x38')](_0x51ed04[_0x2d92('0x33')]['fields']));_0x4cde44[_0x2d92('0x36')]=_0x4cde44[_0x2d92('0x36')]['length']?_0x4cde44[_0x2d92('0x36')]:_0x57920c[_0x2d92('0x31')];if(_0x51ed04[_0x2d92('0x33')][_0x2d92('0x44')]){_0x4cde44[_0x2d92('0x49')]=[{'all':!![]}];}_0x4cde44=_[_0x2d92('0x40')]({},_0x4cde44,_0x51ed04[_0x2d92('0x42')]);return db[_0x2d92('0x43')][_0x2d92('0x4a')](_0x4cde44)[_0x2d92('0x25')](handleEntityNotFound(_0xbe965b,null))[_0x2d92('0x25')](respondWithResult(_0xbe965b,null))['catch'](handleError(_0xbe965b,null));};exports['create']=function(_0x4d04ef,_0x2b99db){return db[_0x2d92('0x43')][_0x2d92('0x4b')](_0x4d04ef['body'],{})['then'](function(_0x48ae28){var _0x5cf6a1=_0x4d04ef[_0x2d92('0x4c')][_0x2d92('0x27')]({'plain':!![]});if(!_0x5cf6a1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5cf6a1[_0x2d92('0x4d')]===_0x2d92('0x4c')){var _0x544709=_0x48ae28[_0x2d92('0x27')]({'plain':!![]});var _0x4ab3f3=_0x2d92('0x28');return db[_0x2d92('0x4e')][_0x2d92('0x4a')]({'where':{'name':_0x4ab3f3,'userProfileId':_0x5cf6a1[_0x2d92('0x4f')]},'raw':!![]})[_0x2d92('0x25')](function(_0x2b68c0){if(_0x2b68c0&&_0x2b68c0['autoAssociation']===0x0){return db[_0x2d92('0x29')][_0x2d92('0x4b')]({'name':_0x544709['name'],'resourceId':_0x544709['id'],'type':_0x2b68c0['name'],'sectionId':_0x2b68c0['id']},{})[_0x2d92('0x25')](function(){return _0x48ae28;});}else{return _0x48ae28;}})[_0x2d92('0x47')](function(_0x3721cb){logger[_0x2d92('0x2a')](_0x2d92('0x50'),_0x3721cb);throw _0x3721cb;});}return _0x48ae28;})[_0x2d92('0x25')](respondWithResult(_0x2b99db,0xc9))[_0x2d92('0x47')](handleError(_0x2b99db,null));};exports[_0x2d92('0x24')]=function(_0x2b4137,_0x5a79e2){if(_0x2b4137[_0x2d92('0x51')]['id']){delete _0x2b4137[_0x2d92('0x51')]['id'];}return db[_0x2d92('0x43')][_0x2d92('0x4a')]({'where':{'id':_0x2b4137['params']['id']}})['then'](handleEntityNotFound(_0x5a79e2,null))[_0x2d92('0x25')](saveUpdates(_0x2b4137[_0x2d92('0x51')],null))[_0x2d92('0x25')](respondWithResult(_0x5a79e2,null))[_0x2d92('0x47')](handleError(_0x5a79e2,null));};exports[_0x2d92('0x26')]=function(_0x4de432,_0xd1e062){return db[_0x2d92('0x43')][_0x2d92('0x4a')]({'where':{'id':_0x4de432[_0x2d92('0x52')]['id']}})[_0x2d92('0x25')](handleEntityNotFound(_0xd1e062,null))[_0x2d92('0x25')](removeEntity(_0xd1e062,null))[_0x2d92('0x47')](handleError(_0xd1e062,null));};
\ No newline at end of file
index 4d056d3..5a74f47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ef6=['exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./pause.attributes'];(function(_0x18cb0a,_0x172892){var _0x4c7286=function(_0xf07105){while(--_0xf07105){_0x18cb0a['push'](_0x18cb0a['shift']());}};_0x4c7286(++_0x172892);}(_0x8ef6,0xf2));var _0x68ef=function(_0x3526e7,_0x372adc){_0x3526e7=_0x3526e7-0x0;var _0x2c9067=_0x8ef6[_0x3526e7];return _0x2c9067;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var logger=require(_0x68ef('0x2'))(_0x68ef('0x3'));var moment=require(_0x68ef('0x4'));var BPromise=require(_0x68ef('0x5'));var rp=require(_0x68ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var attributes=require(_0x68ef('0x9'));module[_0x68ef('0xa')]=function(_0x4d26e3,_0x4f77f3){return _0x4d26e3[_0x68ef('0xb')](_0x68ef('0xc'),attributes,{'tableName':_0x68ef('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5fc3=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./pause.attributes','exports','define','tools_pauses'];(function(_0x20cc92,_0x4a6702){var _0x41af34=function(_0x5c5abd){while(--_0x5c5abd){_0x20cc92['push'](_0x20cc92['shift']());}};_0x41af34(++_0x4a6702);}(_0x5fc3,0xa8));var _0x35fc=function(_0x325501,_0x5242f6){_0x325501=_0x325501-0x0;var _0x2c1626=_0x5fc3[_0x325501];return _0x2c1626;};'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')]('Pause',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2cfd4b2..fa86c75 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(_0x151cbc,_0x207c8c){var _0xb1385=function(_0x1261d6){while(--_0x1261d6){_0x151cbc['push'](_0x151cbc['shift']());}};_0xb1385(++_0x207c8c);}(_0xb10b,0x12a));var _0xbb10=function(_0x47990b,_0xf722d6){_0x47990b=_0x47990b-0x0;var _0x57bb0a=_0xb10b[_0x47990b];return _0x57bb0a;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});};
\ No newline at end of file
+var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x5e57ac,_0xaaeb24){var _0xc682c3=function(_0x20caf2){while(--_0x20caf2){_0x5e57ac['push'](_0x5e57ac['shift']());}};_0xc682c3(++_0xaaeb24);}(_0xb10b,0x12a));var _0xbb10=function(_0x6e9a01,_0x41ab36){_0x6e9a01=_0x6e9a01-0x0;var _0x238469=_0xb10b[_0x6e9a01];return _0x238469;};'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
index fb26cc7..93ffbfb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72b1=['./plugin.controller','get','isAuthenticated','index','/webhook','show','/:id/download','download','diskStorage','join','root','originalname','format','%s-%s%s','extname','now','post','single','file','upload','webhookPost','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5a1322,_0x20c1e6){var _0x458a5f=function(_0x368b91){while(--_0x368b91){_0x5a1322['push'](_0x5a1322['shift']());}};_0x458a5f(++_0x20c1e6);}(_0x72b1,0x16e));var _0x172b=function(_0x1d4335,_0x2f97ac){_0x1d4335=_0x1d4335-0x0;var _0x21db97=_0x72b1[_0x1d4335];return _0x21db97;};'use strict';var multer=require(_0x172b('0x0'));var util=require('util');var path=require(_0x172b('0x1'));var timeout=require(_0x172b('0x2'));var express=require(_0x172b('0x3'));var router=express[_0x172b('0x4')]();var fs_extra=require(_0x172b('0x5'));var auth=require(_0x172b('0x6'));var interaction=require(_0x172b('0x7'));var config=require('../../config/environment');var controller=require(_0x172b('0x8'));router[_0x172b('0x9')]('/',auth[_0x172b('0xa')](),controller[_0x172b('0xb')]);router['get'](_0x172b('0xc'),controller['webhookGet']);router[_0x172b('0x9')]('/:id',auth[_0x172b('0xa')](),controller[_0x172b('0xd')]);router[_0x172b('0x9')](_0x172b('0xe'),auth['isAuthenticated'](),controller[_0x172b('0xf')]);var upload=multer({'storage':multer[_0x172b('0x10')]({'destination':function(_0x28aaad,_0x161c7c,_0xa4ada9){_0xa4ada9(null,path[_0x172b('0x11')](config[_0x172b('0x12')],'server/files/plugins'));},'filename':function(_0x13d285,_0x82727f,_0xdf832e){_0x82727f['originalname']=_0x82727f[_0x172b('0x13')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xdf832e(null,util[_0x172b('0x14')](_0x172b('0x15'),path['basename'](_0x82727f[_0x172b('0x13')],path[_0x172b('0x16')](_0x82727f[_0x172b('0x13')])),Date[_0x172b('0x17')](),path['extname'](_0x82727f['originalname'])));}})});router[_0x172b('0x18')]('/',upload[_0x172b('0x19')](_0x172b('0x1a')),controller[_0x172b('0x1b')]);router['post']('/webhook',controller[_0x172b('0x1c')]);router[_0x172b('0x1d')](_0x172b('0x1e'),auth[_0x172b('0xa')](),controller[_0x172b('0x1f')]);router['delete'](_0x172b('0x1e'),auth[_0x172b('0xa')](),controller[_0x172b('0x20')]);module[_0x172b('0x21')]=router;
\ No newline at end of file
+var _0x17ba=['single','upload','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','download','diskStorage','join','server/files/plugins','originalname','replace','format','basename','extname','post'];(function(_0x49a3c6,_0x582bad){var _0x44f7ff=function(_0xaa8142){while(--_0xaa8142){_0x49a3c6['push'](_0x49a3c6['shift']());}};_0x44f7ff(++_0x582bad);}(_0x17ba,0xab));var _0xa17b=function(_0x3ae2aa,_0x4a025d){_0x3ae2aa=_0x3ae2aa-0x0;var _0x542409=_0x17ba[_0x3ae2aa];return _0x542409;};'use strict';var multer=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var path=require('path');var timeout=require(_0xa17b('0x2'));var express=require(_0xa17b('0x3'));var router=express[_0xa17b('0x4')]();var fs_extra=require(_0xa17b('0x5'));var auth=require(_0xa17b('0x6'));var interaction=require(_0xa17b('0x7'));var config=require(_0xa17b('0x8'));var controller=require(_0xa17b('0x9'));router[_0xa17b('0xa')]('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0xc')]);router[_0xa17b('0xa')](_0xa17b('0xd'),controller[_0xa17b('0xe')]);router[_0xa17b('0xa')](_0xa17b('0xf'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x10')]);router[_0xa17b('0xa')]('/:id/download',auth[_0xa17b('0xb')](),controller[_0xa17b('0x11')]);var upload=multer({'storage':multer[_0xa17b('0x12')]({'destination':function(_0x1e799a,_0x140943,_0x4382df){_0x4382df(null,path[_0xa17b('0x13')](config['root'],_0xa17b('0x14')));},'filename':function(_0x3e92e4,_0x3c3a8a,_0x52b7aa){_0x3c3a8a[_0xa17b('0x15')]=_0x3c3a8a[_0xa17b('0x15')][_0xa17b('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x52b7aa(null,util[_0xa17b('0x17')]('%s-%s%s',path[_0xa17b('0x18')](_0x3c3a8a['originalname'],path[_0xa17b('0x19')](_0x3c3a8a[_0xa17b('0x15')])),Date['now'](),path[_0xa17b('0x19')](_0x3c3a8a[_0xa17b('0x15')])));}})});router[_0xa17b('0x1a')]('/',upload[_0xa17b('0x1b')]('file'),controller[_0xa17b('0x1c')]);router['post']('/webhook',controller['webhookPost']);router[_0xa17b('0x1d')](_0xa17b('0xf'),auth['isAuthenticated'](),controller[_0xa17b('0x1e')]);router[_0xa17b('0x1f')](_0xa17b('0xf'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x1f')]);module[_0xa17b('0x20')]=router;
\ No newline at end of file
index 1600e2e..a41dc54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8e8=['always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','STRING','ENUM','script','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x45a2bb,_0x368b2e){var _0x117c24=function(_0x498f1a){while(--_0x498f1a){_0x45a2bb['push'](_0x45a2bb['shift']());}};_0x117c24(++_0x368b2e);}(_0xa8e8,0xc9));var _0x8a8e=function(_0x56b083,_0x29476f){_0x56b083=_0x56b083-0x0;var _0x1b01e6=_0xa8e8[_0x56b083];return _0x1b01e6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8a8e('0x0')]},'type':{'type':Sequelize[_0x8a8e('0x1')]('html',_0x8a8e('0x2'))},'description':{'type':Sequelize[_0x8a8e('0x3')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x8a8e('0x0')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x8a8e('0x4')],'defaultValue':0x0,'comment':_0x8a8e('0x5')},'sidebar':{'type':Sequelize['ENUM']('adminOnly','agentOnly',_0x8a8e('0x6'),_0x8a8e('0x7')),'defaultValue':'always','comment':_0x8a8e('0x8')},'icon':{'type':Sequelize[_0x8a8e('0x0')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x8a8e('0x0')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x8a8e('0x0')]}};
\ No newline at end of file
+var _0xa8f4=['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','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize'];(function(_0x3e501d,_0x4b603b){var _0x13d7c9=function(_0x514a18){while(--_0x514a18){_0x3e501d['push'](_0x3e501d['shift']());}};_0x13d7c9(++_0x4b603b);}(_0xa8f4,0x110));var _0x4a8f=function(_0x4b1237,_0x5f020a){_0x4b1237=_0x4b1237-0x0;var _0xbf78d5=_0xa8f4[_0x4b1237];return _0xbf78d5;};'use strict';var Sequelize=require(_0x4a8f('0x0'));module[_0x4a8f('0x1')]={'name':{'type':Sequelize[_0x4a8f('0x2')]},'type':{'type':Sequelize['ENUM'](_0x4a8f('0x3'),_0x4a8f('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x4a8f('0x5')]},'path':{'type':Sequelize['STRING'],'comment':_0x4a8f('0x6')},'active':{'type':Sequelize[_0x4a8f('0x7')],'defaultValue':0x0,'comment':_0x4a8f('0x8')},'sidebar':{'type':Sequelize[_0x4a8f('0x9')](_0x4a8f('0xa'),'agentOnly',_0x4a8f('0xb'),'never'),'defaultValue':_0x4a8f('0xb'),'comment':_0x4a8f('0xc')},'icon':{'type':Sequelize[_0x4a8f('0x2')]},'adminUrl':{'type':Sequelize[_0x4a8f('0x2')]},'agentUrl':{'type':Sequelize[_0x4a8f('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x4a8f('0x2')]}};
\ No newline at end of file
index 3157e87..dd83eba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc764=['zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','join','dirname','node_modules/**/*','attachments/**/*','finalize','Plugin\x20not\x20found','download','format','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','lstatSync','isFile','Invalid\x20plugin\x20structure','isDirectory','Plugin\x20manifest\x20missing','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','views','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','parameters','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','icon','icon-apps','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','admin','body','userProfileId','UserProfileSection','Plugins','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-length','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','status','offset','undefined','limit','count','set','json','reject','update','then','destroy','get','end','sendStatus','error','stack','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Plugin','includeAll','findAll','params','include','find','catch','root','server/files/plugins','%s.zip','basename','createWriteStream'];(function(_0x22d5ce,_0x5a7cca){var _0x41c5a6=function(_0x2f791f){while(--_0x2f791f){_0x22d5ce['push'](_0x22d5ce['shift']());}};_0x41c5a6(++_0x5a7cca);}(_0xc764,0xfe));var _0x4c76=function(_0x43f55a,_0x5e21fd){_0x43f55a=_0x43f55a-0x0;var _0x337f69=_0xc764[_0x43f55a];return _0x337f69;};'use strict';var emlformat=require(_0x4c76('0x0'));var rimraf=require(_0x4c76('0x1'));var zipdir=require(_0x4c76('0x2'));var jsonpatch=require(_0x4c76('0x3'));var rp=require('request-promise');var moment=require(_0x4c76('0x4'));var BPromise=require(_0x4c76('0x5'));var Mustache=require('mustache');var util=require(_0x4c76('0x6'));var path=require(_0x4c76('0x7'));var sox=require(_0x4c76('0x8'));var csv=require('to-csv');var ejs=require(_0x4c76('0x9'));var fs=require('fs');var fs_extra=require(_0x4c76('0xa'));var _=require(_0x4c76('0xb'));var squel=require(_0x4c76('0xc'));var crypto=require(_0x4c76('0xd'));var jsforce=require(_0x4c76('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4c76('0xf'));var querystring=require(_0x4c76('0x10'));var Papa=require(_0x4c76('0x11'));var extract=require('extract-zip');var rimraf=require(_0x4c76('0x1'));var archiver=require(_0x4c76('0x12'));var Redis=require(_0x4c76('0x13'));var authService=require(_0x4c76('0x14'));var qs=require(_0x4c76('0x15'));var as=require(_0x4c76('0x16'));var hardwareService=require(_0x4c76('0x17'));var logger=require(_0x4c76('0x18'))(_0x4c76('0x19'));var utils=require(_0x4c76('0x1a'));var config=require(_0x4c76('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x4c76('0x1c'))['db'];config['redis']=_[_0x4c76('0x1d')](config[_0x4c76('0x1e')],{'host':_0x4c76('0x1f'),'port':0x18eb});var socket=require(_0x4c76('0x20'))(new Redis(config[_0x4c76('0x1e')]));require(_0x4c76('0x21'))[_0x4c76('0x22')](socket);function respondWithStatusCode(_0x4eb99a,_0x15cd8b){_0x15cd8b=_0x15cd8b||0xcc;return function(_0x5bc1e7){if(_0x5bc1e7){return _0x4eb99a['sendStatus'](_0x15cd8b);}return _0x4eb99a[_0x4c76('0x23')](_0x15cd8b)['end']();};}function respondWithResult(_0x4020c4,_0x187db3){_0x187db3=_0x187db3||0xc8;return function(_0x25738a){if(_0x25738a){return _0x4020c4[_0x4c76('0x23')](_0x187db3)['json'](_0x25738a);}};}function respondWithFilteredResult(_0x14e8ab,_0x3c10e6){return function(_0x549e90){if(_0x549e90){var _0x150319=typeof _0x3c10e6[_0x4c76('0x24')]===_0x4c76('0x25')&&typeof _0x3c10e6[_0x4c76('0x26')]===_0x4c76('0x25');var _0xc8641a=_0x549e90[_0x4c76('0x27')];var _0x41f754=_0x150319?0x0:_0x3c10e6[_0x4c76('0x24')];var _0x2bcfdc=_0x150319?_0x549e90[_0x4c76('0x27')]:_0x3c10e6['offset']+_0x3c10e6[_0x4c76('0x26')];var _0x5d6ef7;if(_0x2bcfdc>=_0xc8641a){_0x2bcfdc=_0xc8641a;_0x5d6ef7=0xc8;}else{_0x5d6ef7=0xce;}_0x14e8ab[_0x4c76('0x23')](_0x5d6ef7);return _0x14e8ab[_0x4c76('0x28')]('Content-Range',_0x41f754+'-'+_0x2bcfdc+'/'+_0xc8641a)[_0x4c76('0x29')](_0x549e90);}return null;};}function patchUpdates(_0x240633){return function(_0x418038){try{jsonpatch['apply'](_0x418038,_0x240633,!![]);}catch(_0x132d6f){return BPromise[_0x4c76('0x2a')](_0x132d6f);}return _0x418038['save']();};}function saveUpdates(_0x2e5767,_0x56c2a6){return function(_0x1a8724){if(_0x1a8724){return _0x1a8724[_0x4c76('0x2b')](_0x2e5767)[_0x4c76('0x2c')](function(_0xe31e67){return _0xe31e67;});}return null;};}function removeEntity(_0x254325,_0xb40a4d){return function(_0x16f48c){if(_0x16f48c){return _0x16f48c[_0x4c76('0x2d')]()[_0x4c76('0x2c')](function(){var _0x37db6b=_0x16f48c[_0x4c76('0x2e')]({'plain':!![]});var _0x2f759e='Plugins';return db['UserProfileResource']['destroy']({'where':{'type':_0x2f759e,'resourceId':_0x37db6b['id']}})[_0x4c76('0x2c')](function(){return _0x16f48c;});})['then'](function(){_0x254325[_0x4c76('0x23')](0xcc)[_0x4c76('0x2f')]();});}};}function handleEntityNotFound(_0x4b2676,_0x2f0c0b){return function(_0x51f7db){if(!_0x51f7db){_0x4b2676[_0x4c76('0x30')](0x194);}return _0x51f7db;};}function handleError(_0x59713a,_0x258f01){_0x258f01=_0x258f01||0x1f4;return function(_0xe53f68){logger[_0x4c76('0x31')](_0xe53f68[_0x4c76('0x32')]);if(_0xe53f68[_0x4c76('0x33')]){delete _0xe53f68['name'];}_0x59713a[_0x4c76('0x23')](_0x258f01)[_0x4c76('0x34')](_0xe53f68);};}exports[_0x4c76('0x35')]=function(_0x356963,_0x49444c){var _0x5579b1={},_0x5a137e={},_0x2a5f7d={'count':0x0,'rows':[]};var _0x5c67d3=_['map'](db['Plugin']['rawAttributes'],function(_0x181a28){return{'name':_0x181a28[_0x4c76('0x36')],'type':_0x181a28[_0x4c76('0x37')][_0x4c76('0x38')]};});_0x5a137e[_0x4c76('0x39')]=_[_0x4c76('0x3a')](_0x5c67d3,_0x4c76('0x33'));_0x5a137e[_0x4c76('0x3b')]=_[_0x4c76('0x3c')](_0x356963[_0x4c76('0x3b')]);_0x5a137e[_0x4c76('0x3d')]=_[_0x4c76('0x3e')](_0x5a137e[_0x4c76('0x39')],_0x5a137e[_0x4c76('0x3b')]);_0x5579b1[_0x4c76('0x3f')]=_[_0x4c76('0x3e')](_0x5a137e[_0x4c76('0x39')],qs['fields'](_0x356963[_0x4c76('0x3b')][_0x4c76('0x40')]));_0x5579b1['attributes']=_0x5579b1[_0x4c76('0x3f')][_0x4c76('0x41')]?_0x5579b1[_0x4c76('0x3f')]:_0x5a137e[_0x4c76('0x39')];if(!_0x356963[_0x4c76('0x3b')][_0x4c76('0x42')](_0x4c76('0x43'))){_0x5579b1[_0x4c76('0x26')]=qs['limit'](_0x356963[_0x4c76('0x3b')]['limit']);_0x5579b1[_0x4c76('0x24')]=qs[_0x4c76('0x24')](_0x356963[_0x4c76('0x3b')]['offset']);}_0x5579b1[_0x4c76('0x44')]=qs['sort'](_0x356963[_0x4c76('0x3b')][_0x4c76('0x45')]);_0x5579b1[_0x4c76('0x46')]=qs[_0x4c76('0x3d')](_[_0x4c76('0x47')](_0x356963[_0x4c76('0x3b')],_0x5a137e['filters']),_0x5c67d3);if(_0x356963[_0x4c76('0x3b')][_0x4c76('0x48')]){_0x5579b1[_0x4c76('0x46')]=_[_0x4c76('0x49')](_0x5579b1[_0x4c76('0x46')],{'$or':_[_0x4c76('0x3a')](_0x5c67d3,function(_0x5321bb){if(_0x5321bb[_0x4c76('0x37')]!==_0x4c76('0x4a')){var _0x39fae9={};_0x39fae9[_0x5321bb[_0x4c76('0x33')]]={'$like':'%'+_0x356963[_0x4c76('0x3b')][_0x4c76('0x48')]+'%'};return _0x39fae9;}})});}_0x5579b1=_[_0x4c76('0x49')]({},_0x5579b1,_0x356963[_0x4c76('0x4b')]);var _0x44fbd2={'where':_0x5579b1['where']};return db[_0x4c76('0x4c')][_0x4c76('0x27')](_0x44fbd2)[_0x4c76('0x2c')](function(_0xab502c){_0x2a5f7d[_0x4c76('0x27')]=_0xab502c;if(_0x356963[_0x4c76('0x3b')][_0x4c76('0x4d')]){_0x5579b1['include']=[{'all':!![]}];}return db[_0x4c76('0x4c')][_0x4c76('0x4e')](_0x5579b1);})[_0x4c76('0x2c')](function(_0x316524){_0x2a5f7d['rows']=_0x316524;return _0x2a5f7d;})[_0x4c76('0x2c')](respondWithFilteredResult(_0x49444c,_0x5579b1))['catch'](handleError(_0x49444c,null));};exports['show']=function(_0x3f4d09,_0x403ff0){var _0x21df92={'raw':!![],'where':{'id':_0x3f4d09[_0x4c76('0x4f')]['id']}},_0x1eb15d={};_0x1eb15d[_0x4c76('0x39')]=_[_0x4c76('0x3c')](db['Plugin']['rawAttributes']);_0x1eb15d[_0x4c76('0x3b')]=_[_0x4c76('0x3c')](_0x3f4d09[_0x4c76('0x3b')]);_0x1eb15d[_0x4c76('0x3d')]=_[_0x4c76('0x3e')](_0x1eb15d[_0x4c76('0x39')],_0x1eb15d[_0x4c76('0x3b')]);_0x21df92[_0x4c76('0x3f')]=_[_0x4c76('0x3e')](_0x1eb15d[_0x4c76('0x39')],qs[_0x4c76('0x40')](_0x3f4d09[_0x4c76('0x3b')][_0x4c76('0x40')]));_0x21df92[_0x4c76('0x3f')]=_0x21df92[_0x4c76('0x3f')][_0x4c76('0x41')]?_0x21df92[_0x4c76('0x3f')]:_0x1eb15d[_0x4c76('0x39')];if(_0x3f4d09[_0x4c76('0x3b')]['includeAll']){_0x21df92[_0x4c76('0x50')]=[{'all':!![]}];}_0x21df92=_['merge']({},_0x21df92,_0x3f4d09[_0x4c76('0x4b')]);return db[_0x4c76('0x4c')][_0x4c76('0x51')](_0x21df92)['then'](handleEntityNotFound(_0x403ff0,null))[_0x4c76('0x2c')](respondWithResult(_0x403ff0,null))[_0x4c76('0x52')](handleError(_0x403ff0,null));};exports['download']=function(_0x55ab60,_0x20232b,_0x287c57){return db[_0x4c76('0x4c')]['find']({'where':{'id':_0x55ab60[_0x4c76('0x4f')]['id']},'attributes':[_0x4c76('0x33'),_0x4c76('0x7')],'raw':!![]})[_0x4c76('0x2c')](handleEntityNotFound(_0x20232b,null))[_0x4c76('0x2c')](function(_0x1bbc65){if(_0x1bbc65){var _0x55cc60=path['join'](config[_0x4c76('0x53')],_0x4c76('0x54'),util['format'](_0x4c76('0x55'),path[_0x4c76('0x56')](_0x1bbc65[_0x4c76('0x7')])));var _0xab3643=fs[_0x4c76('0x57')](_0x55cc60);var _0x116e42=archiver(_0x4c76('0x58'),{'zlib':{'level':0x9}});_0x116e42['on'](_0x4c76('0x59'),function(_0x4187e9){if(_0x4187e9[_0x4c76('0x5a')]===_0x4c76('0x5b')){logger['error'](_0x4187e9);}else{throw new db[(_0x4c76('0x5c'))][(_0x4c76('0x5d'))](_0x4c76('0x5e'));}});_0x116e42['on'](_0x4c76('0x31'),function(_0x1b9703){throw new db[(_0x4c76('0x5c'))][(_0x4c76('0x5d'))](_0x4c76('0x5e'));});_0x116e42['pipe'](_0xab3643);_0x116e42[_0x4c76('0x5f')](_0x4c76('0x60'),{'cwd':path[_0x4c76('0x61')](config[_0x4c76('0x53')],_0x4c76('0x54'),path[_0x4c76('0x62')](_0x1bbc65['path'])),'ignore':[path['join'](path['basename'](_0x1bbc65[_0x4c76('0x7')]),_0x4c76('0x63')),path[_0x4c76('0x61')](path[_0x4c76('0x56')](_0x1bbc65[_0x4c76('0x7')]),_0x4c76('0x64'))],'nodir':!![]})[_0x4c76('0x65')]();_0xab3643['on']('close',function(){if(!fs['existsSync'](_0x55cc60)){throw new db['Sequelize'][(_0x4c76('0x5d'))](_0x4c76('0x66'));}return _0x20232b[_0x4c76('0x67')](_0x55cc60,util[_0x4c76('0x68')](_0x4c76('0x55'),path[_0x4c76('0x56')](_0x1bbc65[_0x4c76('0x7')])),function(_0xa73cc2){if(_0xa73cc2){throw new db[(_0x4c76('0x5c'))]['Error'](_0x4c76('0x69'));}fs['unlinkSync'](_0x55cc60);logger[_0x4c76('0x6a')](_0x4c76('0x6b'));logger[_0x4c76('0x6a')]('Temporary\x20file\x20removed');});});}return null;})[_0x4c76('0x52')](handleError(_0x20232b,null));};exports[_0x4c76('0x6c')]=function(_0x4a5964,_0x3f2a32,_0x441a1c){var _0x2977e4=path['basename'](_0x4a5964[_0x4c76('0x6d')][_0x4c76('0x6e')],path[_0x4c76('0x6f')](_0x4a5964[_0x4c76('0x6d')][_0x4c76('0x6e')]));var _0x4bdb62=path[_0x4c76('0x61')](config['root'],_0x4c76('0x54'),_0x4a5964[_0x4c76('0x6d')][_0x4c76('0x6e')]);var _0x502d91=path[_0x4c76('0x61')](config[_0x4c76('0x53')],'server/files/plugins',_0x2977e4);logger[_0x4c76('0x6a')](_0x4c76('0x70'),_0x4bdb62);logger[_0x4c76('0x6a')](_0x4c76('0x71'),_0x502d91);try{fs[_0x4c76('0x72')](_0x4bdb62,parseInt('0777',0x8));extract(_0x4bdb62,{'dir':_0x502d91},function(_0x52dba6){if(_0x52dba6){logger[_0x4c76('0x31')](_0x52dba6);handleError(_0x52dba6,!![]);};var _0x3a4682=fs[_0x4c76('0x73')](_0x502d91);if(_0x3a4682[_0x4c76('0x41')]>0x1){removeReferences(_0x4bdb62,_0x502d91);logger[_0x4c76('0x31')]('Invalid\x20plugin\x20structure');return _0x441a1c(new Error('Invalid\x20plugin\x20structure'));}var _0xe98161=fs[_0x4c76('0x74')](path[_0x4c76('0x61')](_0x502d91,_0x3a4682[0x0]));if(_0xe98161[_0x4c76('0x75')]()){removeReferences(_0x4bdb62,_0x502d91);logger[_0x4c76('0x31')](_0x4c76('0x76'));return _0x441a1c(new Error(_0x4c76('0x76')));}if(_0xe98161[_0x4c76('0x77')]()){var _0x38faf1=fs[_0x4c76('0x73')](path['join'](_0x502d91,_0x3a4682[0x0]));if(_0x38faf1['length']===0x0){removeReferences(_0x4bdb62,_0x502d91);logger[_0x4c76('0x31')](_0x4c76('0x76'));return _0x441a1c(new Error(_0x4c76('0x76')));}var _0x48ce26=_0x38faf1['some'](function(_0x1df742){return _0x1df742==='manifest.json';});if(!_0x48ce26){return _0x441a1c(new Error(_0x4c76('0x78')));}var _0x5527d0=fs[_0x4c76('0x79')](path['join'](_0x502d91,_0x3a4682[0x0],_0x4c76('0x7a')));var _0x15d8cf=JSON[_0x4c76('0x7b')](_0x5527d0);if(_0x4c76('0x25')==typeof _0x15d8cf[_0x4c76('0x33')]){return _0x441a1c(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x4c76('0x25')==typeof _0x15d8cf[_0x4c76('0x37')]){return _0x441a1c(new Error(_0x4c76('0x7c')));}if(_0x4c76('0x25')==typeof _0x15d8cf[_0x4c76('0x7d')]){return _0x441a1c(new Error(_0x4c76('0x7e')));}if(_0x4c76('0x25')==typeof _0x15d8cf['parameters']){return _0x441a1c(new Error(_0x4c76('0x7f')));}if(_0x15d8cf[_0x4c76('0x37')]===_0x4c76('0x80')){if('undefined'==typeof _0x15d8cf['parameters']['views']){return _0x441a1c(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x4c76('0x25')==typeof _0x15d8cf['parameters'][_0x4c76('0x81')]['admin']&&_0x4c76('0x25')==typeof _0x15d8cf['parameters'][_0x4c76('0x81')][_0x4c76('0x82')]){return _0x441a1c(new Error(_0x4c76('0x83')));}}else if(_0x15d8cf['type']===_0x4c76('0x84')){if(_0x4c76('0x25')==typeof _0x15d8cf[_0x4c76('0x85')][_0x4c76('0x86')]){return _0x441a1c(new Error(_0x4c76('0x87')));}if(_0x4c76('0x25')==typeof _0x15d8cf['parameters'][_0x4c76('0x88')]){return _0x441a1c(new Error(_0x4c76('0x89')));}}else{return _0x441a1c(new Error(_0x4c76('0x8a')));}var _0x592ff1=_0x15d8cf[_0x4c76('0x33')];var _0x225f0f=_0x15d8cf['description'];var _0x749076=_0x15d8cf[_0x4c76('0x37')];var _0x63bc89=_0x15d8cf[_0x4c76('0x8b')]?_0x15d8cf[_0x4c76('0x8b')]:'always';var _0x47f67c=_0x15d8cf[_0x4c76('0x8c')]?_0x15d8cf[_0x4c76('0x8c')]:_0x4c76('0x8d');var _0x16b00e='';var _0x4b85c3='';var _0x328ed2='';var _0x4d2f71='';var _0x17abaf=_0x15d8cf[_0x4c76('0x7d')];if(_0x749076===_0x4c76('0x80')){if(_0x4c76('0x25')!=typeof _0x15d8cf['parameters'][_0x4c76('0x81')]['admin']){var _0x1e8556=_0x15d8cf[_0x4c76('0x85')][_0x4c76('0x81')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x1e8556)){_0x16b00e=path[_0x4c76('0x61')](_0x4c76('0x8e'),_0x2977e4,_0x3a4682[0x0],_0x1e8556);}else{_0x16b00e=_0x1e8556;}}else{logger[_0x4c76('0x6a')](_0x4c76('0x8f'));}if(_0x4c76('0x25')!=typeof _0x15d8cf[_0x4c76('0x85')]['views'][_0x4c76('0x82')]){var _0x11cddd=_0x15d8cf[_0x4c76('0x85')][_0x4c76('0x81')][_0x4c76('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x4c76('0x90')](_0x11cddd)){_0x4b85c3=path[_0x4c76('0x61')](_0x4c76('0x8e'),_0x2977e4,_0x3a4682[0x0],_0x11cddd);}else{_0x4b85c3=_0x11cddd;}}else{logger[_0x4c76('0x6a')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x749076===_0x4c76('0x84')){_0x328ed2=_0x15d8cf[_0x4c76('0x85')]['scriptName'];_0x4d2f71=_0x15d8cf[_0x4c76('0x85')][_0x4c76('0x88')];if(_0x4c76('0x25')!=typeof _0x15d8cf[_0x4c76('0x85')]['views']){if(_0x4c76('0x25')!=typeof _0x15d8cf[_0x4c76('0x85')][_0x4c76('0x81')]['admin']){var _0x1e8556=_0x15d8cf['parameters'][_0x4c76('0x81')][_0x4c76('0x91')];if(!/^(f|ht)tps?:\/\//i[_0x4c76('0x90')](_0x1e8556)){_0x16b00e=path[_0x4c76('0x61')](_0x4c76('0x8e'),_0x2977e4,_0x3a4682[0x0],_0x1e8556);}else{_0x16b00e=_0x1e8556;}}if(_0x4c76('0x25')!=typeof _0x15d8cf[_0x4c76('0x85')][_0x4c76('0x81')][_0x4c76('0x82')]){var _0x11cddd=_0x15d8cf[_0x4c76('0x85')][_0x4c76('0x81')][_0x4c76('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x4c76('0x90')](_0x11cddd)){_0x4b85c3=path[_0x4c76('0x61')]('plugins',_0x2977e4,_0x3a4682[0x0],_0x11cddd);}else{_0x4b85c3=_0x11cddd;}}}}var _0x3f7ae8={'name':_0x592ff1,'description':_0x225f0f,'path':path[_0x4c76('0x61')](_0x2977e4,_0x3a4682[0x0]),'type':_0x749076,'sidebar':_0x63bc89,'icon':_0x47f67c,'adminUrl':_0x16b00e,'agentUrl':_0x4b85c3,'scriptName':_0x328ed2,'scriptPath':_0x4d2f71,'version':_0x17abaf};removeReferences(_0x4bdb62,null);return db[_0x4c76('0x4c')]['create'](_0x3f7ae8)['then'](function(_0x56647e){var _0x2a78d5={'role':_0x4a5964['body']['role'],'userProfileId':_0x4a5964[_0x4c76('0x92')][_0x4c76('0x93')]};if(!_0x2a78d5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a78d5['role']==='user'){var _0x36487c=_0x56647e[_0x4c76('0x2e')]({'plain':!![]});return db[_0x4c76('0x94')]['find']({'where':{'name':_0x4c76('0x95'),'userProfileId':_0x2a78d5[_0x4c76('0x93')]},'raw':!![]})[_0x4c76('0x2c')](function(_0x2d0063){if(_0x2d0063&&_0x2d0063[_0x4c76('0x96')]===0x0){return db[_0x4c76('0x97')][_0x4c76('0x98')]({'name':_0x36487c[_0x4c76('0x33')],'resourceId':_0x36487c['id'],'type':_0x2d0063[_0x4c76('0x33')],'sectionId':_0x2d0063['id']},{})[_0x4c76('0x2c')](function(){return _0x56647e;});}else{return _0x56647e;}})[_0x4c76('0x52')](function(_0xd99c30){logger[_0x4c76('0x31')](_0x4c76('0x99'),_0xd99c30);throw _0xd99c30;});}return _0x56647e;})[_0x4c76('0x2c')](respondWithResult(_0x3f2a32,null))[_0x4c76('0x52')](handleError(_0x3f2a32,null));}});}catch(_0x5c1d1b){_0x3f2a32[_0x4c76('0x23')](0x1f4)[_0x4c76('0x34')](_0x5c1d1b);}};function removeReferences(_0x4103e3,_0x48d487){try{if(_0x4103e3){fs['unlinkSync'](_0x4103e3);logger[_0x4c76('0x6a')](_0x4c76('0x9a'));}if(_0x48d487){rimraf(_0x48d487,function(){});logger[_0x4c76('0x6a')](_0x4c76('0x9b'));}}catch(_0x2bbaf2){logger[_0x4c76('0x31')](_0x2bbaf2);}}exports['update']=function(_0x4b6f9d,_0x2e78dc,_0x8d6c87){return db['Plugin'][_0x4c76('0x51')]({'where':{'id':_0x4b6f9d[_0x4c76('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2e78dc,null))[_0x4c76('0x2c')](saveUpdates(_0x4b6f9d[_0x4c76('0x92')],null))[_0x4c76('0x2c')](respondWithResult(_0x2e78dc,null))[_0x4c76('0x52')](handleError(_0x2e78dc,null));};exports['delete']=function(_0x542dc5,_0x439935,_0x20e856){return db[_0x4c76('0x4c')]['find']({'where':{'id':_0x542dc5[_0x4c76('0x4f')]['id']}})[_0x4c76('0x2c')](function(_0x459418){if(_0x459418){return _0x459418[_0x4c76('0x2d')]();}})[_0x4c76('0x2c')](function(_0x3d3ed0){rimraf(path[_0x4c76('0x61')](config[_0x4c76('0x53')],_0x4c76('0x54'),path['dirname'](_0x3d3ed0[_0x4c76('0x7')])),function(){});return _0x3d3ed0;})[_0x4c76('0x2c')](handleEntityNotFound(_0x439935,null))[_0x4c76('0x2c')](respondWithStatusCode(_0x439935,null))[_0x4c76('0x52')](handleError(_0x439935,null));};exports[_0x4c76('0x9c')]=function(_0x92eedb,_0x3ce25a,_0x29eefb){return BPromise[_0x4c76('0x9d')]()[_0x4c76('0x2c')](function(){if(!_0x92eedb[_0x4c76('0x3b')][_0x4c76('0x7')]){throw new Error(_0x4c76('0x9e'));}if(!_0x92eedb[_0x4c76('0x3b')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x282699=_0x92eedb[_0x4c76('0x3b')][_0x4c76('0x9f')]?_0x92eedb['query'][_0x4c76('0x9f')]+':'+_0x92eedb['query'][_0x4c76('0xa0')]:_0x4c76('0xa1')+_0x92eedb[_0x4c76('0x3b')][_0x4c76('0xa0')];var _0x569cdd=_0x92eedb[_0x4c76('0x3b')][_0x4c76('0x29')]?_0x92eedb[_0x4c76('0x3b')][_0x4c76('0x29')]:!![];var _0xcd4203=_0x92eedb[_0x4c76('0x3b')][_0x4c76('0xa2')]?_0x92eedb[_0x4c76('0x3b')][_0x4c76('0xa2')]:null;var _0x232f33={'method':_0x92eedb[_0x4c76('0xa3')],'uri':util[_0x4c76('0x68')](_0x4c76('0xa4'),_0x282699,_0x92eedb[_0x4c76('0x3b')][_0x4c76('0x7')]),'json':_0x569cdd,'resolveWithFullResponse':!![],'encoding':_0xcd4203,'qs':_0x92eedb[_0x4c76('0x3b')]};if(_0x92eedb[_0x4c76('0xa5')]){_0x232f33[_0x4c76('0xa5')]=_0x92eedb[_0x4c76('0xa5')];if(_0x232f33[_0x4c76('0xa5')]['content-length']){delete _0x232f33[_0x4c76('0xa5')][_0x4c76('0xa6')];}}if(_0x232f33['headers']['content-type']){delete _0x232f33[_0x4c76('0xa5')]['content-type'];}return rp(_0x232f33);})[_0x4c76('0x2c')](function(_0x2e3963){if(_0x2e3963){_0x3ce25a[_0x4c76('0x28')](_0x2e3963[_0x4c76('0xa5')]);logger['info'](_0x2e3963[_0x4c76('0x92')]);if(_[_0x4c76('0xa7')](_0x92eedb[_0x4c76('0x3b')][_0x4c76('0x7')],_0x4c76('0x67'))&&_0x2e3963[_0x4c76('0xa8')]==0x1f4){return _0x3ce25a[_0x4c76('0x30')](_0x2e3963['statusCode']);}else{return _0x3ce25a[_0x4c76('0x23')](_0x2e3963['statusCode'])['send'](_0x2e3963['body']);}}else{return _0x3ce25a[_0x4c76('0x30')](0xc8);}})[_0x4c76('0x52')](handleError(_0x3ce25a,null));};exports[_0x4c76('0xa9')]=function(_0x1c4e1b,_0x32bf3c,_0x2e039a){return BPromise[_0x4c76('0x9d')]()[_0x4c76('0x2c')](function(){if(!_0x1c4e1b[_0x4c76('0x3b')][_0x4c76('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x1c4e1b[_0x4c76('0x3b')]['port']){throw new Error(_0x4c76('0xaa'));}var _0x3071ba=_0x1c4e1b['query'][_0x4c76('0x9f')]?_0x1c4e1b['query']['hostname']+':'+_0x1c4e1b[_0x4c76('0x3b')][_0x4c76('0xa0')]:_0x4c76('0xa1')+_0x1c4e1b[_0x4c76('0x3b')][_0x4c76('0xa0')];var _0x2cc177=_0x1c4e1b[_0x4c76('0x3b')][_0x4c76('0x29')]?_0x1c4e1b[_0x4c76('0x3b')][_0x4c76('0x29')]:!![];var _0x338936=_0x1c4e1b['query'][_0x4c76('0xa2')]?_0x1c4e1b[_0x4c76('0x3b')][_0x4c76('0xa2')]:null;var _0x451f28={'method':_0x1c4e1b[_0x4c76('0xa3')],'uri':util[_0x4c76('0x68')](_0x4c76('0xa4'),_0x3071ba,_0x1c4e1b[_0x4c76('0x3b')][_0x4c76('0x7')]),'json':_0x2cc177,'resolveWithFullResponse':!![],'encoding':_0x338936,'body':_0x1c4e1b[_0x4c76('0x92')]};if(_0x1c4e1b['headers']){_0x451f28[_0x4c76('0xa5')]=_0x1c4e1b[_0x4c76('0xa5')];if(_0x451f28[_0x4c76('0xa5')][_0x4c76('0xa6')]){delete _0x451f28[_0x4c76('0xa5')][_0x4c76('0xa6')];}}if(_0x451f28[_0x4c76('0xa5')]['content-type']){delete _0x451f28[_0x4c76('0xa5')]['content-type'];}return rp(_0x451f28);})['then'](function(_0x50ea50){if(_0x50ea50){_0x32bf3c['set'](_0x50ea50[_0x4c76('0xa5')]);logger['info'](_0x50ea50[_0x4c76('0x92')]);return _0x32bf3c['status'](_0x50ea50[_0x4c76('0xa8')])[_0x4c76('0x34')](_0x50ea50[_0x4c76('0x92')]);}else{return _0x32bf3c[_0x4c76('0x30')](0xc8);}})[_0x4c76('0x52')](handleError(_0x32bf3c,null));};
\ No newline at end of file
+var _0x53ce=['desk.js','querystring','papaparse','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','reject','save','destroy','Plugins','UserProfileResource','then','error','stack','name','send','index','Plugin','rawAttributes','fieldName','model','map','keys','filters','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','options','includeAll','findAll','catch','show','params','intersection','include','find','download','join','server/files/plugins','format','%s.zip','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','root','dirname','basename','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','file','filename','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','lstatSync','isFile','Invalid\x20plugin\x20structure','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','sidebar','always','icon','icon-apps','version','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','test','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','update','delete','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','%s%s','headers','content-length','endsWith','statusCode','http://localhost:','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x566cde,_0x1422bc){var _0x55cfb6=function(_0x2c1a97){while(--_0x2c1a97){_0x566cde['push'](_0x566cde['shift']());}};_0x55cfb6(++_0x1422bc);}(_0x53ce,0x99));var _0xe53c=function(_0x25e828,_0x28dca6){_0x25e828=_0x25e828-0x0;var _0x3ebf10=_0x53ce[_0x25e828];return _0x3ebf10;};'use strict';var emlformat=require(_0xe53c('0x0'));var rimraf=require(_0xe53c('0x1'));var zipdir=require(_0xe53c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe53c('0x3'));var moment=require(_0xe53c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe53c('0x5'));var util=require(_0xe53c('0x6'));var path=require(_0xe53c('0x7'));var sox=require(_0xe53c('0x8'));var csv=require(_0xe53c('0x9'));var ejs=require(_0xe53c('0xa'));var fs=require('fs');var fs_extra=require(_0xe53c('0xb'));var _=require(_0xe53c('0xc'));var squel=require(_0xe53c('0xd'));var crypto=require(_0xe53c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe53c('0xf'));var toCsv=require(_0xe53c('0x9'));var querystring=require(_0xe53c('0x10'));var Papa=require(_0xe53c('0x11'));var extract=require('extract-zip');var rimraf=require(_0xe53c('0x1'));var archiver=require(_0xe53c('0x12'));var Redis=require(_0xe53c('0x13'));var authService=require(_0xe53c('0x14'));var qs=require(_0xe53c('0x15'));var as=require(_0xe53c('0x16'));var hardwareService=require(_0xe53c('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0xe53c('0x18'));var config=require(_0xe53c('0x19'));var licenseUtil=require(_0xe53c('0x1a'));var db=require(_0xe53c('0x1b'))['db'];config[_0xe53c('0x1c')]=_[_0xe53c('0x1d')](config[_0xe53c('0x1c')],{'host':_0xe53c('0x1e'),'port':0x18eb});var socket=require(_0xe53c('0x1f'))(new Redis(config[_0xe53c('0x1c')]));require(_0xe53c('0x20'))[_0xe53c('0x21')](socket);function respondWithStatusCode(_0x1a2858,_0x16b4f5){_0x16b4f5=_0x16b4f5||0xcc;return function(_0x3b877d){if(_0x3b877d){return _0x1a2858[_0xe53c('0x22')](_0x16b4f5);}return _0x1a2858['status'](_0x16b4f5)[_0xe53c('0x23')]();};}function respondWithResult(_0x303360,_0xc7b6a8){_0xc7b6a8=_0xc7b6a8||0xc8;return function(_0x17f602){if(_0x17f602){return _0x303360['status'](_0xc7b6a8)[_0xe53c('0x24')](_0x17f602);}};}function respondWithFilteredResult(_0x5dd185,_0x5aee57){return function(_0x35f381){if(_0x35f381){var _0x4a7c4d=typeof _0x5aee57[_0xe53c('0x25')]===_0xe53c('0x26')&&typeof _0x5aee57[_0xe53c('0x27')]===_0xe53c('0x26');var _0x342942=_0x35f381[_0xe53c('0x28')];var _0x563b12=_0x4a7c4d?0x0:_0x5aee57[_0xe53c('0x25')];var _0x1660dd=_0x4a7c4d?_0x35f381[_0xe53c('0x28')]:_0x5aee57['offset']+_0x5aee57[_0xe53c('0x27')];var _0x3a56a6;if(_0x1660dd>=_0x342942){_0x1660dd=_0x342942;_0x3a56a6=0xc8;}else{_0x3a56a6=0xce;}_0x5dd185[_0xe53c('0x29')](_0x3a56a6);return _0x5dd185[_0xe53c('0x2a')]('Content-Range',_0x563b12+'-'+_0x1660dd+'/'+_0x342942)['json'](_0x35f381);}return null;};}function patchUpdates(_0x571eb6){return function(_0x3cefab){try{jsonpatch['apply'](_0x3cefab,_0x571eb6,!![]);}catch(_0x1a111f){return BPromise[_0xe53c('0x2b')](_0x1a111f);}return _0x3cefab[_0xe53c('0x2c')]();};}function saveUpdates(_0x3f2339,_0x29fd4a){return function(_0x1cf01d){if(_0x1cf01d){return _0x1cf01d['update'](_0x3f2339)['then'](function(_0x338270){return _0x338270;});}return null;};}function removeEntity(_0x11fddf,_0x124564){return function(_0x48e875){if(_0x48e875){return _0x48e875[_0xe53c('0x2d')]()['then'](function(){var _0x5ca9b1=_0x48e875['get']({'plain':!![]});var _0x3d21f1=_0xe53c('0x2e');return db[_0xe53c('0x2f')][_0xe53c('0x2d')]({'where':{'type':_0x3d21f1,'resourceId':_0x5ca9b1['id']}})[_0xe53c('0x30')](function(){return _0x48e875;});})[_0xe53c('0x30')](function(){_0x11fddf[_0xe53c('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10c556,_0x2a473e){return function(_0x3bd14d){if(!_0x3bd14d){_0x10c556[_0xe53c('0x22')](0x194);}return _0x3bd14d;};}function handleError(_0x51322e,_0x40c608){_0x40c608=_0x40c608||0x1f4;return function(_0x4f86e){logger[_0xe53c('0x31')](_0x4f86e[_0xe53c('0x32')]);if(_0x4f86e[_0xe53c('0x33')]){delete _0x4f86e[_0xe53c('0x33')];}_0x51322e[_0xe53c('0x29')](_0x40c608)[_0xe53c('0x34')](_0x4f86e);};}exports[_0xe53c('0x35')]=function(_0x397425,_0x369bfc){var _0x43cfab={},_0x7a501={},_0x2bc0a9={'count':0x0,'rows':[]};var _0x1d5e60=_['map'](db[_0xe53c('0x36')][_0xe53c('0x37')],function(_0x2c4d59){return{'name':_0x2c4d59[_0xe53c('0x38')],'type':_0x2c4d59['type']['key']};});_0x7a501[_0xe53c('0x39')]=_[_0xe53c('0x3a')](_0x1d5e60,_0xe53c('0x33'));_0x7a501['query']=_[_0xe53c('0x3b')](_0x397425['query']);_0x7a501[_0xe53c('0x3c')]=_['intersection'](_0x7a501['model'],_0x7a501[_0xe53c('0x3d')]);_0x43cfab[_0xe53c('0x3e')]=_['intersection'](_0x7a501[_0xe53c('0x39')],qs[_0xe53c('0x3f')](_0x397425[_0xe53c('0x3d')][_0xe53c('0x3f')]));_0x43cfab[_0xe53c('0x3e')]=_0x43cfab[_0xe53c('0x3e')][_0xe53c('0x40')]?_0x43cfab[_0xe53c('0x3e')]:_0x7a501[_0xe53c('0x39')];if(!_0x397425[_0xe53c('0x3d')][_0xe53c('0x41')](_0xe53c('0x42'))){_0x43cfab[_0xe53c('0x27')]=qs[_0xe53c('0x27')](_0x397425['query']['limit']);_0x43cfab[_0xe53c('0x25')]=qs['offset'](_0x397425[_0xe53c('0x3d')][_0xe53c('0x25')]);}_0x43cfab['order']=qs[_0xe53c('0x43')](_0x397425[_0xe53c('0x3d')][_0xe53c('0x43')]);_0x43cfab[_0xe53c('0x44')]=qs[_0xe53c('0x3c')](_[_0xe53c('0x45')](_0x397425[_0xe53c('0x3d')],_0x7a501[_0xe53c('0x3c')]),_0x1d5e60);if(_0x397425[_0xe53c('0x3d')]['filter']){_0x43cfab[_0xe53c('0x44')]=_[_0xe53c('0x46')](_0x43cfab['where'],{'$or':_[_0xe53c('0x3a')](_0x1d5e60,function(_0x543562){if(_0x543562[_0xe53c('0x47')]!==_0xe53c('0x48')){var _0x588584={};_0x588584[_0x543562['name']]={'$like':'%'+_0x397425['query']['filter']+'%'};return _0x588584;}})});}_0x43cfab=_[_0xe53c('0x46')]({},_0x43cfab,_0x397425[_0xe53c('0x49')]);var _0x63d355={'where':_0x43cfab[_0xe53c('0x44')]};return db['Plugin'][_0xe53c('0x28')](_0x63d355)[_0xe53c('0x30')](function(_0x1304f7){_0x2bc0a9['count']=_0x1304f7;if(_0x397425['query'][_0xe53c('0x4a')]){_0x43cfab['include']=[{'all':!![]}];}return db[_0xe53c('0x36')][_0xe53c('0x4b')](_0x43cfab);})[_0xe53c('0x30')](function(_0x2f0d52){_0x2bc0a9['rows']=_0x2f0d52;return _0x2bc0a9;})[_0xe53c('0x30')](respondWithFilteredResult(_0x369bfc,_0x43cfab))[_0xe53c('0x4c')](handleError(_0x369bfc,null));};exports[_0xe53c('0x4d')]=function(_0x4fac53,_0x2faee6){var _0x2e5ef6={'raw':!![],'where':{'id':_0x4fac53[_0xe53c('0x4e')]['id']}},_0x4b1919={};_0x4b1919[_0xe53c('0x39')]=_[_0xe53c('0x3b')](db[_0xe53c('0x36')]['rawAttributes']);_0x4b1919['query']=_['keys'](_0x4fac53[_0xe53c('0x3d')]);_0x4b1919[_0xe53c('0x3c')]=_[_0xe53c('0x4f')](_0x4b1919[_0xe53c('0x39')],_0x4b1919[_0xe53c('0x3d')]);_0x2e5ef6['attributes']=_[_0xe53c('0x4f')](_0x4b1919[_0xe53c('0x39')],qs[_0xe53c('0x3f')](_0x4fac53[_0xe53c('0x3d')][_0xe53c('0x3f')]));_0x2e5ef6['attributes']=_0x2e5ef6[_0xe53c('0x3e')][_0xe53c('0x40')]?_0x2e5ef6[_0xe53c('0x3e')]:_0x4b1919[_0xe53c('0x39')];if(_0x4fac53['query']['includeAll']){_0x2e5ef6[_0xe53c('0x50')]=[{'all':!![]}];}_0x2e5ef6=_[_0xe53c('0x46')]({},_0x2e5ef6,_0x4fac53[_0xe53c('0x49')]);return db[_0xe53c('0x36')][_0xe53c('0x51')](_0x2e5ef6)[_0xe53c('0x30')](handleEntityNotFound(_0x2faee6,null))[_0xe53c('0x30')](respondWithResult(_0x2faee6,null))[_0xe53c('0x4c')](handleError(_0x2faee6,null));};exports[_0xe53c('0x52')]=function(_0x21a22a,_0x4de213,_0x3b7d78){return db[_0xe53c('0x36')]['find']({'where':{'id':_0x21a22a['params']['id']},'attributes':['name','path'],'raw':!![]})[_0xe53c('0x30')](handleEntityNotFound(_0x4de213,null))[_0xe53c('0x30')](function(_0x52cd14){if(_0x52cd14){var _0x3efb8e=path[_0xe53c('0x53')](config['root'],_0xe53c('0x54'),util[_0xe53c('0x55')](_0xe53c('0x56'),path['basename'](_0x52cd14[_0xe53c('0x7')])));var _0x387b90=fs['createWriteStream'](_0x3efb8e);var _0x32e9f2=archiver(_0xe53c('0x57'),{'zlib':{'level':0x9}});_0x32e9f2['on'](_0xe53c('0x58'),function(_0x10be89){if(_0x10be89[_0xe53c('0x59')]===_0xe53c('0x5a')){logger[_0xe53c('0x31')](_0x10be89);}else{throw new db[(_0xe53c('0x5b'))][(_0xe53c('0x5c'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x32e9f2['on']('error',function(_0x40751f){throw new db['Sequelize'][(_0xe53c('0x5c'))](_0xe53c('0x5d'));});_0x32e9f2[_0xe53c('0x5e')](_0x387b90);_0x32e9f2['glob']('**/*',{'cwd':path[_0xe53c('0x53')](config[_0xe53c('0x5f')],_0xe53c('0x54'),path[_0xe53c('0x60')](_0x52cd14[_0xe53c('0x7')])),'ignore':[path['join'](path[_0xe53c('0x61')](_0x52cd14[_0xe53c('0x7')]),'node_modules/**/*'),path['join'](path['basename'](_0x52cd14[_0xe53c('0x7')]),'attachments/**/*')],'nodir':!![]})['finalize']();_0x387b90['on'](_0xe53c('0x62'),function(){if(!fs[_0xe53c('0x63')](_0x3efb8e)){throw new db[(_0xe53c('0x5b'))]['Error'](_0xe53c('0x64'));}return _0x4de213[_0xe53c('0x52')](_0x3efb8e,util['format'](_0xe53c('0x56'),path[_0xe53c('0x61')](_0x52cd14[_0xe53c('0x7')])),function(_0x7f4300){if(_0x7f4300){throw new db[(_0xe53c('0x5b'))][(_0xe53c('0x5c'))](_0xe53c('0x65'));}fs[_0xe53c('0x66')](_0x3efb8e);logger[_0xe53c('0x67')]('Download\x20completed');logger[_0xe53c('0x67')](_0xe53c('0x68'));});});}return null;})[_0xe53c('0x4c')](handleError(_0x4de213,null));};exports['upload']=function(_0x2c366c,_0x1fea9b,_0x3ff7f4){var _0xc6181c=path[_0xe53c('0x61')](_0x2c366c[_0xe53c('0x69')][_0xe53c('0x6a')],path['extname'](_0x2c366c[_0xe53c('0x69')][_0xe53c('0x6a')]));var _0x5f5521=path[_0xe53c('0x53')](config['root'],_0xe53c('0x54'),_0x2c366c[_0xe53c('0x69')]['filename']);var _0x5e0820=path[_0xe53c('0x53')](config[_0xe53c('0x5f')],_0xe53c('0x54'),_0xc6181c);logger[_0xe53c('0x67')](_0xe53c('0x6b'),_0x5f5521);logger[_0xe53c('0x67')]('Plugin\x20upload\x20destination:\x20%s',_0x5e0820);try{fs[_0xe53c('0x6c')](_0x5f5521,parseInt(_0xe53c('0x6d'),0x8));extract(_0x5f5521,{'dir':_0x5e0820},function(_0x4f5acd){if(_0x4f5acd){logger[_0xe53c('0x31')](_0x4f5acd);handleError(_0x4f5acd,!![]);};var _0x542de4=fs['readdirSync'](_0x5e0820);if(_0x542de4['length']>0x1){removeReferences(_0x5f5521,_0x5e0820);logger[_0xe53c('0x31')]('Invalid\x20plugin\x20structure');return _0x3ff7f4(new Error('Invalid\x20plugin\x20structure'));}var _0xbda917=fs[_0xe53c('0x6e')](path[_0xe53c('0x53')](_0x5e0820,_0x542de4[0x0]));if(_0xbda917[_0xe53c('0x6f')]()){removeReferences(_0x5f5521,_0x5e0820);logger[_0xe53c('0x31')](_0xe53c('0x70'));return _0x3ff7f4(new Error('Invalid\x20plugin\x20structure'));}if(_0xbda917[_0xe53c('0x71')]()){var _0x339fc4=fs['readdirSync'](path[_0xe53c('0x53')](_0x5e0820,_0x542de4[0x0]));if(_0x339fc4[_0xe53c('0x40')]===0x0){removeReferences(_0x5f5521,_0x5e0820);logger[_0xe53c('0x31')](_0xe53c('0x70'));return _0x3ff7f4(new Error(_0xe53c('0x70')));}var _0x4d45bb=_0x339fc4[_0xe53c('0x72')](function(_0x3eb0c7){return _0x3eb0c7===_0xe53c('0x73');});if(!_0x4d45bb){return _0x3ff7f4(new Error(_0xe53c('0x74')));}var _0x11c003=fs[_0xe53c('0x75')](path[_0xe53c('0x53')](_0x5e0820,_0x542de4[0x0],_0xe53c('0x73')));var _0x4b6de1=JSON[_0xe53c('0x76')](_0x11c003);if(_0xe53c('0x26')==typeof _0x4b6de1[_0xe53c('0x33')]){return _0x3ff7f4(new Error(_0xe53c('0x77')));}if(_0xe53c('0x26')==typeof _0x4b6de1['type']){return _0x3ff7f4(new Error(_0xe53c('0x78')));}if(_0xe53c('0x26')==typeof _0x4b6de1['version']){return _0x3ff7f4(new Error(_0xe53c('0x79')));}if(_0xe53c('0x26')==typeof _0x4b6de1[_0xe53c('0x7a')]){return _0x3ff7f4(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x4b6de1[_0xe53c('0x47')]===_0xe53c('0x7b')){if(_0xe53c('0x26')==typeof _0x4b6de1[_0xe53c('0x7a')][_0xe53c('0x7c')]){return _0x3ff7f4(new Error(_0xe53c('0x7d')));}if(_0xe53c('0x26')==typeof _0x4b6de1[_0xe53c('0x7a')][_0xe53c('0x7c')][_0xe53c('0x7e')]&&_0xe53c('0x26')==typeof _0x4b6de1[_0xe53c('0x7a')][_0xe53c('0x7c')]['agent']){return _0x3ff7f4(new Error(_0xe53c('0x7f')));}}else if(_0x4b6de1['type']===_0xe53c('0x80')){if(_0xe53c('0x26')==typeof _0x4b6de1[_0xe53c('0x7a')][_0xe53c('0x81')]){return _0x3ff7f4(new Error(_0xe53c('0x82')));}if('undefined'==typeof _0x4b6de1[_0xe53c('0x7a')][_0xe53c('0x83')]){return _0x3ff7f4(new Error(_0xe53c('0x84')));}}else{return _0x3ff7f4(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x4c730e=_0x4b6de1[_0xe53c('0x33')];var _0x264fda=_0x4b6de1['description'];var _0x25a691=_0x4b6de1[_0xe53c('0x47')];var _0x20d868=_0x4b6de1[_0xe53c('0x85')]?_0x4b6de1[_0xe53c('0x85')]:_0xe53c('0x86');var _0x5638bb=_0x4b6de1[_0xe53c('0x87')]?_0x4b6de1[_0xe53c('0x87')]:_0xe53c('0x88');var _0x2e5ffa='';var _0x46f17b='';var _0x454283='';var _0x409887='';var _0x548011=_0x4b6de1[_0xe53c('0x89')];if(_0x25a691===_0xe53c('0x7b')){if(_0xe53c('0x26')!=typeof _0x4b6de1[_0xe53c('0x7a')][_0xe53c('0x7c')][_0xe53c('0x7e')]){var _0x229b14=_0x4b6de1[_0xe53c('0x7a')][_0xe53c('0x7c')][_0xe53c('0x7e')];if(!/^(f|ht)tps?:\/\//i['test'](_0x229b14)){_0x2e5ffa=path[_0xe53c('0x53')](_0xe53c('0x8a'),_0xc6181c,_0x542de4[0x0],_0x229b14);}else{_0x2e5ffa=_0x229b14;}}else{logger['info'](_0xe53c('0x8b'));}if(_0xe53c('0x26')!=typeof _0x4b6de1[_0xe53c('0x7a')][_0xe53c('0x7c')][_0xe53c('0x8c')]){var _0x699193=_0x4b6de1['parameters'][_0xe53c('0x7c')][_0xe53c('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0xe53c('0x8d')](_0x699193)){_0x46f17b=path['join']('plugins',_0xc6181c,_0x542de4[0x0],_0x699193);}else{_0x46f17b=_0x699193;}}else{logger[_0xe53c('0x67')](_0xe53c('0x8e'));}}else if(_0x25a691===_0xe53c('0x80')){_0x454283=_0x4b6de1['parameters']['scriptName'];_0x409887=_0x4b6de1[_0xe53c('0x7a')][_0xe53c('0x83')];if(_0xe53c('0x26')!=typeof _0x4b6de1[_0xe53c('0x7a')][_0xe53c('0x7c')]){if(_0xe53c('0x26')!=typeof _0x4b6de1[_0xe53c('0x7a')][_0xe53c('0x7c')]['admin']){var _0x229b14=_0x4b6de1[_0xe53c('0x7a')][_0xe53c('0x7c')][_0xe53c('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0xe53c('0x8d')](_0x229b14)){_0x2e5ffa=path['join'](_0xe53c('0x8a'),_0xc6181c,_0x542de4[0x0],_0x229b14);}else{_0x2e5ffa=_0x229b14;}}if(_0xe53c('0x26')!=typeof _0x4b6de1['parameters'][_0xe53c('0x7c')][_0xe53c('0x8c')]){var _0x699193=_0x4b6de1['parameters']['views'][_0xe53c('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0xe53c('0x8d')](_0x699193)){_0x46f17b=path[_0xe53c('0x53')]('plugins',_0xc6181c,_0x542de4[0x0],_0x699193);}else{_0x46f17b=_0x699193;}}}}var _0x48b3f4={'name':_0x4c730e,'description':_0x264fda,'path':path[_0xe53c('0x53')](_0xc6181c,_0x542de4[0x0]),'type':_0x25a691,'sidebar':_0x20d868,'icon':_0x5638bb,'adminUrl':_0x2e5ffa,'agentUrl':_0x46f17b,'scriptName':_0x454283,'scriptPath':_0x409887,'version':_0x548011};removeReferences(_0x5f5521,null);return db[_0xe53c('0x36')][_0xe53c('0x8f')](_0x48b3f4)[_0xe53c('0x30')](function(_0x4f9115){var _0x35ced6={'role':_0x2c366c[_0xe53c('0x90')][_0xe53c('0x91')],'userProfileId':_0x2c366c[_0xe53c('0x90')][_0xe53c('0x92')]};if(!_0x35ced6)throw new Error(_0xe53c('0x93'));if(_0x35ced6[_0xe53c('0x91')]===_0xe53c('0x94')){var _0x3a7d85=_0x4f9115['get']({'plain':!![]});return db[_0xe53c('0x95')][_0xe53c('0x51')]({'where':{'name':_0xe53c('0x2e'),'userProfileId':_0x35ced6[_0xe53c('0x92')]},'raw':!![]})[_0xe53c('0x30')](function(_0x9629c6){if(_0x9629c6&&_0x9629c6[_0xe53c('0x96')]===0x0){return db[_0xe53c('0x2f')][_0xe53c('0x8f')]({'name':_0x3a7d85[_0xe53c('0x33')],'resourceId':_0x3a7d85['id'],'type':_0x9629c6[_0xe53c('0x33')],'sectionId':_0x9629c6['id']},{})[_0xe53c('0x30')](function(){return _0x4f9115;});}else{return _0x4f9115;}})[_0xe53c('0x4c')](function(_0x27c731){logger[_0xe53c('0x31')](_0xe53c('0x97'),_0x27c731);throw _0x27c731;});}return _0x4f9115;})[_0xe53c('0x30')](respondWithResult(_0x1fea9b,null))[_0xe53c('0x4c')](handleError(_0x1fea9b,null));}});}catch(_0x5197c8){_0x1fea9b[_0xe53c('0x29')](0x1f4)[_0xe53c('0x34')](_0x5197c8);}};function removeReferences(_0x3763a6,_0x49975f){try{if(_0x3763a6){fs[_0xe53c('0x66')](_0x3763a6);logger[_0xe53c('0x67')]('Zip\x20archive\x20removed');}if(_0x49975f){rimraf(_0x49975f,function(){});logger[_0xe53c('0x67')](_0xe53c('0x98'));}}catch(_0x55727d){logger['error'](_0x55727d);}}exports[_0xe53c('0x99')]=function(_0x6cfea6,_0x29dd01,_0x522969){return db[_0xe53c('0x36')][_0xe53c('0x51')]({'where':{'id':_0x6cfea6[_0xe53c('0x4e')]['id']}})[_0xe53c('0x30')](handleEntityNotFound(_0x29dd01,null))['then'](saveUpdates(_0x6cfea6[_0xe53c('0x90')],null))['then'](respondWithResult(_0x29dd01,null))[_0xe53c('0x4c')](handleError(_0x29dd01,null));};exports[_0xe53c('0x9a')]=function(_0x16b4a3,_0x56328d,_0x159d53){return db[_0xe53c('0x36')][_0xe53c('0x51')]({'where':{'id':_0x16b4a3[_0xe53c('0x4e')]['id']}})['then'](function(_0x53ef44){if(_0x53ef44){return _0x53ef44[_0xe53c('0x2d')]();}})['then'](function(_0x23d228){rimraf(path[_0xe53c('0x53')](config['root'],_0xe53c('0x54'),path[_0xe53c('0x60')](_0x23d228[_0xe53c('0x7')])),function(){});return _0x23d228;})[_0xe53c('0x30')](handleEntityNotFound(_0x56328d,null))[_0xe53c('0x30')](respondWithStatusCode(_0x56328d,null))['catch'](handleError(_0x56328d,null));};exports[_0xe53c('0x9b')]=function(_0x4fa425,_0x132e1a,_0x377247){return BPromise[_0xe53c('0x9c')]()['then'](function(){if(!_0x4fa425['query']['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x4fa425[_0xe53c('0x3d')][_0xe53c('0x9d')]){throw new Error(_0xe53c('0x9e'));}var _0x7738f4=_0x4fa425[_0xe53c('0x3d')][_0xe53c('0x9f')]?_0x4fa425[_0xe53c('0x3d')][_0xe53c('0x9f')]+':'+_0x4fa425['query'][_0xe53c('0x9d')]:'http://localhost:'+_0x4fa425[_0xe53c('0x3d')][_0xe53c('0x9d')];var _0x468421=_0x4fa425[_0xe53c('0x3d')]['json']?_0x4fa425[_0xe53c('0x3d')][_0xe53c('0x24')]:!![];var _0x54c1a8=_0x4fa425['query'][_0xe53c('0xa0')]?_0x4fa425[_0xe53c('0x3d')][_0xe53c('0xa0')]:null;var _0x4e559f={'method':_0x4fa425[_0xe53c('0xa1')],'uri':util[_0xe53c('0x55')](_0xe53c('0xa2'),_0x7738f4,_0x4fa425[_0xe53c('0x3d')][_0xe53c('0x7')]),'json':_0x468421,'resolveWithFullResponse':!![],'encoding':_0x54c1a8,'qs':_0x4fa425['query']};if(_0x4fa425[_0xe53c('0xa3')]){_0x4e559f['headers']=_0x4fa425[_0xe53c('0xa3')];if(_0x4e559f[_0xe53c('0xa3')][_0xe53c('0xa4')]){delete _0x4e559f['headers'][_0xe53c('0xa4')];}}if(_0x4e559f[_0xe53c('0xa3')]['content-type']){delete _0x4e559f[_0xe53c('0xa3')]['content-type'];}return rp(_0x4e559f);})[_0xe53c('0x30')](function(_0x25bae3){if(_0x25bae3){_0x132e1a[_0xe53c('0x2a')](_0x25bae3[_0xe53c('0xa3')]);logger[_0xe53c('0x67')](_0x25bae3[_0xe53c('0x90')]);if(_[_0xe53c('0xa5')](_0x4fa425[_0xe53c('0x3d')]['path'],'download')&&_0x25bae3[_0xe53c('0xa6')]==0x1f4){return _0x132e1a[_0xe53c('0x22')](_0x25bae3[_0xe53c('0xa6')]);}else{return _0x132e1a['status'](_0x25bae3['statusCode'])[_0xe53c('0x34')](_0x25bae3[_0xe53c('0x90')]);}}else{return _0x132e1a[_0xe53c('0x22')](0xc8);}})[_0xe53c('0x4c')](handleError(_0x132e1a,null));};exports['webhookPost']=function(_0x798266,_0x9229d4,_0x5f42fd){return BPromise['resolve']()['then'](function(){if(!_0x798266[_0xe53c('0x3d')][_0xe53c('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x798266[_0xe53c('0x3d')][_0xe53c('0x9d')]){throw new Error(_0xe53c('0x9e'));}var _0x8da398=_0x798266[_0xe53c('0x3d')]['hostname']?_0x798266[_0xe53c('0x3d')]['hostname']+':'+_0x798266['query'][_0xe53c('0x9d')]:_0xe53c('0xa7')+_0x798266['query'][_0xe53c('0x9d')];var _0x54e3ca=_0x798266['query']['json']?_0x798266[_0xe53c('0x3d')]['json']:!![];var _0x37728b=_0x798266[_0xe53c('0x3d')][_0xe53c('0xa0')]?_0x798266[_0xe53c('0x3d')][_0xe53c('0xa0')]:null;var _0xa1044a={'method':_0x798266[_0xe53c('0xa1')],'uri':util[_0xe53c('0x55')](_0xe53c('0xa2'),_0x8da398,_0x798266[_0xe53c('0x3d')][_0xe53c('0x7')]),'json':_0x54e3ca,'resolveWithFullResponse':!![],'encoding':_0x37728b,'body':_0x798266[_0xe53c('0x90')]};if(_0x798266[_0xe53c('0xa3')]){_0xa1044a[_0xe53c('0xa3')]=_0x798266[_0xe53c('0xa3')];if(_0xa1044a[_0xe53c('0xa3')][_0xe53c('0xa4')]){delete _0xa1044a[_0xe53c('0xa3')][_0xe53c('0xa4')];}}if(_0xa1044a[_0xe53c('0xa3')]['content-type']){delete _0xa1044a[_0xe53c('0xa3')]['content-type'];}return rp(_0xa1044a);})[_0xe53c('0x30')](function(_0x51aaf6){if(_0x51aaf6){_0x9229d4[_0xe53c('0x2a')](_0x51aaf6['headers']);logger['info'](_0x51aaf6[_0xe53c('0x90')]);return _0x9229d4[_0xe53c('0x29')](_0x51aaf6['statusCode'])[_0xe53c('0x34')](_0x51aaf6['body']);}else{return _0x9229d4[_0xe53c('0x22')](0xc8);}})['catch'](handleError(_0x9229d4,null));};
\ No newline at end of file
index 0338f8b..73cc2b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e8a=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners','save','update'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x9e8a,0x112));var _0xa9e8=function(_0x301641,_0x15b1c0){_0x301641=_0x301641-0x0;var _0x5afbd2=_0x9e8a[_0x301641];return _0x5afbd2;};'use strict';var EventEmitter=require(_0xa9e8('0x0'));var Plugin=require(_0xa9e8('0x1'))['db'][_0xa9e8('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xa9e8('0x3')](0x0);var events={'afterCreate':_0xa9e8('0x4'),'afterUpdate':_0xa9e8('0x5'),'afterDestroy':_0xa9e8('0x6')};function emitEvent(_0x337024){return function(_0xe3b2c8,_0x57736c,_0x4f9ddb){PluginEvents['emit'](_0x337024+':'+_0xe3b2c8['id'],_0xe3b2c8);PluginEvents['emit'](_0x337024,_0xe3b2c8);_0x4f9ddb(null);};}for(var e in events){if(events[_0xa9e8('0x7')](e)){var event=events[e];Plugin[_0xa9e8('0x8')](e,emitEvent(event));}}module[_0xa9e8('0x9')]=PluginEvents;
\ No newline at end of file
+var _0x46e1=['events','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x6d4296,_0x375014){var _0x1d8662=function(_0x27896e){while(--_0x27896e){_0x6d4296['push'](_0x6d4296['shift']());}};_0x1d8662(++_0x375014);}(_0x46e1,0x155));var _0x146e=function(_0x5a3a62,_0x36e0cd){_0x5a3a62=_0x5a3a62-0x0;var _0x1678c9=_0x46e1[_0x5a3a62];return _0x1678c9;};'use strict';var EventEmitter=require(_0x146e('0x0'));var Plugin=require(_0x146e('0x1'))['db'][_0x146e('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x146e('0x3')](0x0);var events={'afterCreate':_0x146e('0x4'),'afterUpdate':_0x146e('0x5'),'afterDestroy':_0x146e('0x6')};function emitEvent(_0x186d9b){return function(_0x18dab9,_0x3bbaec,_0x5e0b03){PluginEvents[_0x146e('0x7')](_0x186d9b+':'+_0x18dab9['id'],_0x18dab9);PluginEvents[_0x146e('0x7')](_0x186d9b,_0x18dab9);_0x5e0b03(null);};}for(var e in events){if(events[_0x146e('0x8')](e)){var event=events[e];Plugin[_0x146e('0x9')](e,emitEvent(event));}}module[_0x146e('0xa')]=PluginEvents;
\ No newline at end of file
index 542ee5c..b88f56a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5229=['define','Plugin','plugins','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x516927,_0xb4aad0){var _0x30749b=function(_0x2ca6cc){while(--_0x2ca6cc){_0x516927['push'](_0x516927['shift']());}};_0x30749b(++_0xb4aad0);}(_0x5229,0x148));var _0x9522=function(_0x3bbd73,_0x4b9ab4){_0x3bbd73=_0x3bbd73-0x0;var _0x58f1bf=_0x5229[_0x3bbd73];return _0x58f1bf;};'use strict';var _=require(_0x9522('0x0'));var util=require(_0x9522('0x1'));var logger=require(_0x9522('0x2'))('api');var moment=require(_0x9522('0x3'));var BPromise=require(_0x9522('0x4'));var rp=require(_0x9522('0x5'));var fs=require('fs');var path=require(_0x9522('0x6'));var rimraf=require(_0x9522('0x7'));var config=require(_0x9522('0x8'));var attributes=require('./plugin.attributes');module[_0x9522('0x9')]=function(_0x3dcb16,_0x4cb09f){return _0x3dcb16[_0x9522('0xa')](_0x9522('0xb'),attributes,{'tableName':_0x9522('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfccc=['exports','define','Plugin','plugins','lodash','../../config/logger','bluebird','request-promise','path','./plugin.attributes'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xfccc,0xa4));var _0xcfcc=function(_0x540a5e,_0x3be6be){_0x540a5e=_0x540a5e-0x0;var _0xf4ebc=_0xfccc[_0x540a5e];return _0xf4ebc;};'use strict';var _=require(_0xcfcc('0x0'));var util=require('util');var logger=require(_0xcfcc('0x1'))('api');var moment=require('moment');var BPromise=require(_0xcfcc('0x2'));var rp=require(_0xcfcc('0x3'));var fs=require('fs');var path=require(_0xcfcc('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcfcc('0x5'));module[_0xcfcc('0x6')]=function(_0x38ae1f,_0x12cc09){return _0x38ae1f[_0xcfcc('0x7')](_0xcfcc('0x8'),attributes,{'tableName':_0xcfcc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c87a6de..7e613ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30e7=['rpc','jayson/promise','client','http','redis','defaults','localhost','./plugin.socket','then','Plugin,\x20%s,\x20%s','debug','stringify','error','message','info','request\x20sent','CreatePlugin','Plugin','create','options','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4002e3,_0xbad4b3){var _0x1c2683=function(_0x3b21e1){while(--_0x3b21e1){_0x4002e3['push'](_0x4002e3['shift']());}};_0x1c2683(++_0xbad4b3);}(_0x30e7,0x81));var _0x730e=function(_0x530745,_0x2e214f){_0x530745=_0x530745-0x0;var _0x3e18d7=_0x30e7[_0x530745];return _0x3e18d7;};'use strict';var _=require(_0x730e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x730e('0x1'));var fs=require('fs');var Redis=require(_0x730e('0x2'));var db=require(_0x730e('0x3'))['db'];var utils=require(_0x730e('0x4'));var logger=require(_0x730e('0x5'))(_0x730e('0x6'));var config=require('../../config/environment');var jayson=require(_0x730e('0x7'));var client=jayson[_0x730e('0x8')][_0x730e('0x9')]({'port':0x232a});config[_0x730e('0xa')]=_[_0x730e('0xb')](config[_0x730e('0xa')],{'host':_0x730e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x730e('0xa')]));require(_0x730e('0xd'))['register'](socket);function respondWithRpcPromise(_0x25d955,_0x24d5df,_0x268e47){return new BPromise(function(_0x48c8dd,_0x281bb2){return client['request'](_0x25d955,_0x268e47)[_0x730e('0xe')](function(_0x3e3061){logger['info'](_0x730e('0xf'),_0x24d5df,'request\x20sent');logger[_0x730e('0x10')]('Plugin,\x20%s,\x20%s,\x20%s',_0x24d5df,'request\x20sent',JSON[_0x730e('0x11')](_0x3e3061));if(_0x3e3061[_0x730e('0x12')]){if(_0x3e3061['error']['code']===0x1f4){logger[_0x730e('0x12')](_0x730e('0xf'),_0x24d5df,_0x3e3061[_0x730e('0x12')][_0x730e('0x13')]);return _0x281bb2(_0x3e3061[_0x730e('0x12')][_0x730e('0x13')]);}logger['error'](_0x730e('0xf'),_0x24d5df,_0x3e3061[_0x730e('0x12')][_0x730e('0x13')]);return _0x48c8dd(_0x3e3061[_0x730e('0x12')][_0x730e('0x13')]);}else{logger[_0x730e('0x14')](_0x730e('0xf'),_0x24d5df,_0x730e('0x15'));_0x48c8dd(_0x3e3061['result'][_0x730e('0x13')]);}})['catch'](function(_0x1a1ac5){logger['error'](_0x730e('0xf'),_0x24d5df,_0x1a1ac5);_0x281bb2(_0x1a1ac5);});});}exports[_0x730e('0x16')]=function(_0x3ea35a){var _0x5cc598=this;return new Promise(function(_0x3d03c2,_0xbfc16a){return db[_0x730e('0x17')][_0x730e('0x18')](_0x3ea35a['body'],{'raw':_0x3ea35a[_0x730e('0x19')]?_0x3ea35a[_0x730e('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x730e('0xe')](function(_0x57548d){logger[_0x730e('0x14')](_0x730e('0x16'),_0x3ea35a);logger[_0x730e('0x10')](_0x730e('0x16'),_0x3ea35a,JSON['stringify'](_0x57548d));_0x3d03c2(_0x57548d);})[_0x730e('0x1a')](function(_0x338c26){logger[_0x730e('0x12')]('CreatePlugin',_0x338c26[_0x730e('0x13')],_0x3ea35a);_0xbfc16a(_0x5cc598[_0x730e('0x12')](0x1f4,_0x338c26[_0x730e('0x13')]));});});};
\ No newline at end of file
+var _0x34dc=['error','code','message','result','CreatePlugin','Plugin','create','body','options','info','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1d6adf,_0x1019fe){var _0x477e9d=function(_0x71cfe4){while(--_0x71cfe4){_0x1d6adf['push'](_0x1d6adf['shift']());}};_0x477e9d(++_0x1019fe);}(_0x34dc,0x124));var _0xc34d=function(_0x28780f,_0x29b350){_0x28780f=_0x28780f-0x0;var _0x25c274=_0x34dc[_0x28780f];return _0x25c274;};'use strict';var _=require(_0xc34d('0x0'));var util=require(_0xc34d('0x1'));var moment=require(_0xc34d('0x2'));var BPromise=require(_0xc34d('0x3'));var rs=require(_0xc34d('0x4'));var fs=require('fs');var Redis=require(_0xc34d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc34d('0x6'));var logger=require('../../config/logger')(_0xc34d('0x7'));var config=require(_0xc34d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc34d('0x9')][_0xc34d('0xa')]({'port':0x232a});config['redis']=_[_0xc34d('0xb')](config[_0xc34d('0xc')],{'host':_0xc34d('0xd'),'port':0x18eb});var socket=require(_0xc34d('0xe'))(new Redis(config[_0xc34d('0xc')]));require(_0xc34d('0xf'))[_0xc34d('0x10')](socket);function respondWithRpcPromise(_0x3a821f,_0x12b3a6,_0x97bc77){return new BPromise(function(_0x286efa,_0x3fbbed){return client[_0xc34d('0x11')](_0x3a821f,_0x97bc77)[_0xc34d('0x12')](function(_0x104dba){logger['info'](_0xc34d('0x13'),_0x12b3a6,_0xc34d('0x14'));logger['debug'](_0xc34d('0x15'),_0x12b3a6,'request\x20sent',JSON[_0xc34d('0x16')](_0x104dba));if(_0x104dba[_0xc34d('0x17')]){if(_0x104dba[_0xc34d('0x17')][_0xc34d('0x18')]===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0x12b3a6,_0x104dba[_0xc34d('0x17')][_0xc34d('0x19')]);return _0x3fbbed(_0x104dba[_0xc34d('0x17')][_0xc34d('0x19')]);}logger[_0xc34d('0x17')](_0xc34d('0x13'),_0x12b3a6,_0x104dba[_0xc34d('0x17')][_0xc34d('0x19')]);return _0x286efa(_0x104dba[_0xc34d('0x17')][_0xc34d('0x19')]);}else{logger['info'](_0xc34d('0x13'),_0x12b3a6,'request\x20sent');_0x286efa(_0x104dba[_0xc34d('0x1a')][_0xc34d('0x19')]);}})['catch'](function(_0x1dbc52){logger[_0xc34d('0x17')]('Plugin,\x20%s,\x20%s',_0x12b3a6,_0x1dbc52);_0x3fbbed(_0x1dbc52);});});}exports[_0xc34d('0x1b')]=function(_0x340de0){var _0x140c12=this;return new Promise(function(_0x46b6f2,_0x3ea2ba){return db[_0xc34d('0x1c')][_0xc34d('0x1d')](_0x340de0[_0xc34d('0x1e')],{'raw':_0x340de0[_0xc34d('0x1f')]?_0x340de0['options']['raw']===undefined?!![]:![]:!![]})[_0xc34d('0x12')](function(_0x4e2e51){logger[_0xc34d('0x20')]('CreatePlugin',_0x340de0);logger[_0xc34d('0x21')]('CreatePlugin',_0x340de0,JSON[_0xc34d('0x16')](_0x4e2e51));_0x46b6f2(_0x4e2e51);})[_0xc34d('0x22')](function(_0x2bb155){logger[_0xc34d('0x17')]('CreatePlugin',_0x2bb155[_0xc34d('0x19')],_0x340de0);_0x3ea2ba(_0x140c12['error'](0x1f4,_0x2bb155[_0xc34d('0x19')]));});});};
\ No newline at end of file
index 0856c3e..8277114 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4093=['update','emit','removeListener','register','length','plugin:','save'];(function(_0x10cb75,_0x480729){var _0x586c0f=function(_0x4d55ce){while(--_0x4d55ce){_0x10cb75['push'](_0x10cb75['shift']());}};_0x586c0f(++_0x480729);}(_0x4093,0x16b));var _0x3409=function(_0x23fae0,_0x5a2ad4){_0x23fae0=_0x23fae0-0x0;var _0x5dadf8=_0x4093[_0x23fae0];return _0x5dadf8;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x3409('0x0'),'remove',_0x3409('0x1')];function createListener(_0x345168,_0x1f6456){return function(_0x856f49){_0x1f6456[_0x3409('0x2')](_0x345168,_0x856f49);};}function removeListener(_0x58c7ba,_0xe46fcf){return function(){PluginEvents[_0x3409('0x3')](_0x58c7ba,_0xe46fcf);};}exports[_0x3409('0x4')]=function(_0x2fe4b2){for(var _0xbb291c=0x0,_0x313c25=events[_0x3409('0x5')];_0xbb291c<_0x313c25;_0xbb291c++){var _0x34ebeb=events[_0xbb291c];var _0x77785e=createListener(_0x3409('0x6')+_0x34ebeb,_0x2fe4b2);PluginEvents['on'](_0x34ebeb,_0x77785e);}};
\ No newline at end of file
+var _0xf4a3=['plugin:','./plugin.events','save','update','emit','removeListener','register','length'];(function(_0x55f3e6,_0x3f9ca3){var _0x21a829=function(_0x2cdf5f){while(--_0x2cdf5f){_0x55f3e6['push'](_0x55f3e6['shift']());}};_0x21a829(++_0x3f9ca3);}(_0xf4a3,0x99));var _0x3f4a=function(_0x175f20,_0x34e406){_0x175f20=_0x175f20-0x0;var _0x1ba07b=_0xf4a3[_0x175f20];return _0x1ba07b;};'use strict';var PluginEvents=require(_0x3f4a('0x0'));var events=[_0x3f4a('0x1'),'remove',_0x3f4a('0x2')];function createListener(_0xaf20fa,_0x16030c){return function(_0x527bb1){_0x16030c[_0x3f4a('0x3')](_0xaf20fa,_0x527bb1);};}function removeListener(_0x4d0488,_0x242dd2){return function(){PluginEvents[_0x3f4a('0x4')](_0x4d0488,_0x242dd2);};}exports[_0x3f4a('0x5')]=function(_0x5e78ad){for(var _0x3777be=0x0,_0x2ed6dd=events[_0x3f4a('0x6')];_0x3777be<_0x2ed6dd;_0x3777be++){var _0x2ef13c=events[_0x3777be];var _0x4cdac3=createListener(_0x3f4a('0x7')+_0x2ef13c,_0x5e78ad);PluginEvents['on'](_0x2ef13c,_0x4cdac3);}};
\ No newline at end of file
index 07ee87f..7eae4b3 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(_0x3ae47d,_0x5de387){var _0xb3001b=function(_0x4c95ab){while(--_0x4c95ab){_0x3ae47d['push'](_0x3ae47d['shift']());}};_0xb3001b(++_0x5de387);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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(_0x31ee8a,_0x12558b){var _0x86e485=function(_0x56922b){while(--_0x56922b){_0x31ee8a['push'](_0x31ee8a['shift']());}};_0x86e485(++_0x12558b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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 0240b32..38522c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16d2=['cwd','chdir','start','dump','update','stop','send','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','error','stack','name','npm\x20install','info','index','list','express','motion2','length','then','catch','show','params','create','body','script','join'];(function(_0x3c327d,_0x9ff1f1){var _0x4452f8=function(_0x500776){while(--_0x500776){_0x3c327d['push'](_0x3c327d['shift']());}};_0x4452f8(++_0x9ff1f1);}(_0x16d2,0x123));var _0x216d=function(_0x35f15b,_0x387db3){_0x35f15b=_0x35f15b-0x0;var _0x262619=_0x16d2[_0x35f15b];return _0x262619;};'use strict';var _=require(_0x216d('0x0'));var pm2=require(_0x216d('0x1'));var logger=require(_0x216d('0x2'))(_0x216d('0x3'));var path=require(_0x216d('0x4'));var exec=require(_0x216d('0x5'))[_0x216d('0x6')];var BPromise=require(_0x216d('0x7'));function handleEntityNotFound(_0xfd7306,_0x593bb0){return function(_0x2c662d){if(!_0x2c662d){_0xfd7306[_0x216d('0x8')](0x194);;}return _0x2c662d;};}function respondWithResult(_0xef687c,_0x205101){_0x205101=_0x205101||0xc8;return function(_0x1dd8e2){if(_0x1dd8e2){return _0xef687c[_0x216d('0x9')](_0x205101)[_0x216d('0xa')](_0x1dd8e2);}return null;};}function handleError(_0x28da14,_0x57accc){_0x57accc=_0x57accc||0x1f4;return function(_0x22c7b3){logger[_0x216d('0xb')](_0x22c7b3[_0x216d('0xc')]);if(_0x22c7b3[_0x216d('0xd')]){delete _0x22c7b3[_0x216d('0xd')];}_0x28da14[_0x216d('0x9')](_0x57accc)['send'](_0x22c7b3);};}function execChildProcess(){return new BPromise(function(_0x7ca9c9,_0x50db30){exec(_0x216d('0xe'),function(_0x2e02ce,_0x332e30,_0x398970){logger[_0x216d('0xf')](_0x332e30);logger[_0x216d('0xf')](_0x398970);if(_0x2e02ce){logger['error'](_0x2e02ce);return _0x50db30(_0x2e02ce);}return _0x7ca9c9(_0x332e30);});});}exports[_0x216d('0x10')]=function(_0x4c07d0,_0x271bb1){return pm2[_0x216d('0x11')]()['then'](function(_0x165c19){if(_0x165c19){var _0x322e4b=_['reject'](_0x165c19,function(_0x1b3215){return _0x1b3215['name']===_0x216d('0x12')||_0x1b3215[_0x216d('0xd')]===_0x216d('0x13');});return{'rows':_0x322e4b,'count':_0x322e4b[_0x216d('0x14')]};}return null;})[_0x216d('0x15')](respondWithResult(_0x271bb1,null))[_0x216d('0x16')](handleError(_0x271bb1,null));};exports[_0x216d('0x17')]=function(_0x1496fe,_0x19fdac){return pm2['describe'](_0x1496fe[_0x216d('0x18')]['id'])['then'](respondWithResult(_0x19fdac,null))['then'](handleEntityNotFound(_0x19fdac,null))[_0x216d('0x16')](handleError(_0x19fdac,null));};exports[_0x216d('0x19')]=function(_0x574758,_0x3f32e0){if(_0x574758[_0x216d('0x1a')]['name']&&_0x574758[_0x216d('0x1a')][_0x216d('0x1b')]){var _0x430e81=path[_0x216d('0x1c')](__dirname,'../../files/plugins',_0x574758[_0x216d('0x1a')][_0x216d('0x1b')]);var _0x10f299=process[_0x216d('0x1d')]();process[_0x216d('0x1e')](path['dirname'](_0x430e81));return execChildProcess()[_0x216d('0x15')](function(_0x1bd4db){process[_0x216d('0x1e')](_0x10f299);return pm2[_0x216d('0x1f')]({'name':_0x574758[_0x216d('0x1a')]['name'],'script':_0x430e81});})[_0x216d('0x15')](function(_0xab672){pm2[_0x216d('0x20')]();return _0xab672[0x0];})['then'](respondWithResult(_0x3f32e0,0xc9))['catch'](handleError(_0x3f32e0,null));}else{return _0x3f32e0['status'](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x216d('0x21')]=function(_0x470d8a,_0x189413){if(_0x470d8a[_0x216d('0x1a')]['id']){delete _0x470d8a[_0x216d('0x1a')]['id'];}var _0x47fa6d={'online':'restart','stopped':_0x216d('0x22')};if(_0x47fa6d['hasOwnProperty'](_0x470d8a[_0x216d('0x1a')][_0x216d('0x9')])){return pm2[_0x47fa6d[_0x470d8a[_0x216d('0x1a')][_0x216d('0x9')]]](_0x470d8a[_0x216d('0x18')]['id'])[_0x216d('0x15')](respondWithResult(_0x189413,0xc8))[_0x216d('0x16')](handleError(_0x189413,null));}else{return _0x189413[_0x216d('0x9')](0x1f4)[_0x216d('0x23')]({'message':_0x216d('0x24')});}};exports[_0x216d('0x25')]=function(_0x260134,_0x4537fd){if(_0x260134['body']['id']){delete _0x260134[_0x216d('0x1a')]['id'];}if(_0x260134[_0x216d('0x18')]['id']){return pm2[_0x216d('0x26')](_0x260134['params']['id'])[_0x216d('0x15')](function(_0x1743ee){pm2[_0x216d('0x20')]();return _0x1743ee[0x0];})[_0x216d('0x15')](respondWithResult(_0x4537fd,null))['catch'](handleError(_0x4537fd,null));}else{return _0x4537fd[_0x216d('0x9')](0x1f4)[_0x216d('0x23')]({'message':_0x216d('0x27')});}};
\ No newline at end of file
+var _0xcea2=['then','express','motion2','length','catch','show','describe','params','create','body','script','join','../../files/plugins','cwd','chdir','dump','update','restart','stop','Unknown\x20status','delete','Unknown\x20id','lodash','../../config/logger','path','child_process','exec','status','json','stack','name','send','npm\x20install','info','index','list'];(function(_0x3e99cb,_0x1d2fe0){var _0x1bc729=function(_0x40006f){while(--_0x40006f){_0x3e99cb['push'](_0x3e99cb['shift']());}};_0x1bc729(++_0x1d2fe0);}(_0xcea2,0x15a));var _0x2cea=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xcea2[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x2cea('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x2cea('0x1'))('api');var path=require(_0x2cea('0x2'));var exec=require(_0x2cea('0x3'))[_0x2cea('0x4')];var BPromise=require('bluebird');function handleEntityNotFound(_0x3ff73f,_0x46060b){return function(_0x11596e){if(!_0x11596e){_0x3ff73f['sendStatus'](0x194);;}return _0x11596e;};}function respondWithResult(_0x34f0f2,_0x485c26){_0x485c26=_0x485c26||0xc8;return function(_0x2d69ff){if(_0x2d69ff){return _0x34f0f2[_0x2cea('0x5')](_0x485c26)[_0x2cea('0x6')](_0x2d69ff);}return null;};}function handleError(_0x160cca,_0x11c5c0){_0x11c5c0=_0x11c5c0||0x1f4;return function(_0x1519f6){logger['error'](_0x1519f6[_0x2cea('0x7')]);if(_0x1519f6[_0x2cea('0x8')]){delete _0x1519f6[_0x2cea('0x8')];}_0x160cca[_0x2cea('0x5')](_0x11c5c0)[_0x2cea('0x9')](_0x1519f6);};}function execChildProcess(){return new BPromise(function(_0x439c4d,_0x4298a4){exec(_0x2cea('0xa'),function(_0x58a102,_0x5724b0,_0x2fe9cd){logger[_0x2cea('0xb')](_0x5724b0);logger['info'](_0x2fe9cd);if(_0x58a102){logger['error'](_0x58a102);return _0x4298a4(_0x58a102);}return _0x439c4d(_0x5724b0);});});}exports[_0x2cea('0xc')]=function(_0x4e0da7,_0xa4ce3d){return pm2[_0x2cea('0xd')]()[_0x2cea('0xe')](function(_0x5cf805){if(_0x5cf805){var _0x4d7f8b=_['reject'](_0x5cf805,function(_0x369c72){return _0x369c72['name']===_0x2cea('0xf')||_0x369c72[_0x2cea('0x8')]===_0x2cea('0x10');});return{'rows':_0x4d7f8b,'count':_0x4d7f8b[_0x2cea('0x11')]};}return null;})[_0x2cea('0xe')](respondWithResult(_0xa4ce3d,null))[_0x2cea('0x12')](handleError(_0xa4ce3d,null));};exports[_0x2cea('0x13')]=function(_0x1ead4c,_0x5eee09){return pm2[_0x2cea('0x14')](_0x1ead4c[_0x2cea('0x15')]['id'])[_0x2cea('0xe')](respondWithResult(_0x5eee09,null))[_0x2cea('0xe')](handleEntityNotFound(_0x5eee09,null))[_0x2cea('0x12')](handleError(_0x5eee09,null));};exports[_0x2cea('0x16')]=function(_0x5d75c4,_0x27375b){if(_0x5d75c4['body'][_0x2cea('0x8')]&&_0x5d75c4[_0x2cea('0x17')][_0x2cea('0x18')]){var _0x4fd3d5=path[_0x2cea('0x19')](__dirname,_0x2cea('0x1a'),_0x5d75c4[_0x2cea('0x17')][_0x2cea('0x18')]);var _0x3246bc=process[_0x2cea('0x1b')]();process[_0x2cea('0x1c')](path['dirname'](_0x4fd3d5));return execChildProcess()[_0x2cea('0xe')](function(_0x5e5b46){process[_0x2cea('0x1c')](_0x3246bc);return pm2['start']({'name':_0x5d75c4[_0x2cea('0x17')][_0x2cea('0x8')],'script':_0x4fd3d5});})['then'](function(_0x41d272){pm2[_0x2cea('0x1d')]();return _0x41d272[0x0];})[_0x2cea('0xe')](respondWithResult(_0x27375b,0xc9))[_0x2cea('0x12')](handleError(_0x27375b,null));}else{return _0x27375b[_0x2cea('0x5')](0x1f4)[_0x2cea('0x9')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x2cea('0x1e')]=function(_0x32b6a3,_0x2bbe9b){if(_0x32b6a3[_0x2cea('0x17')]['id']){delete _0x32b6a3[_0x2cea('0x17')]['id'];}var _0x3ea40c={'online':_0x2cea('0x1f'),'stopped':_0x2cea('0x20')};if(_0x3ea40c['hasOwnProperty'](_0x32b6a3[_0x2cea('0x17')][_0x2cea('0x5')])){return pm2[_0x3ea40c[_0x32b6a3['body'][_0x2cea('0x5')]]](_0x32b6a3[_0x2cea('0x15')]['id'])[_0x2cea('0xe')](respondWithResult(_0x2bbe9b,0xc8))[_0x2cea('0x12')](handleError(_0x2bbe9b,null));}else{return _0x2bbe9b['status'](0x1f4)[_0x2cea('0x9')]({'message':_0x2cea('0x21')});}};exports['destroy']=function(_0x2bf4e9,_0x2e3d44){if(_0x2bf4e9[_0x2cea('0x17')]['id']){delete _0x2bf4e9[_0x2cea('0x17')]['id'];}if(_0x2bf4e9[_0x2cea('0x15')]['id']){return pm2[_0x2cea('0x22')](_0x2bf4e9[_0x2cea('0x15')]['id'])[_0x2cea('0xe')](function(_0x2e1cd6){pm2[_0x2cea('0x1d')]();return _0x2e1cd6[0x0];})[_0x2cea('0xe')](respondWithResult(_0x2e3d44,null))['catch'](handleError(_0x2e3d44,null));}else{return _0x2e3d44[_0x2cea('0x5')](0x1f4)[_0x2cea('0x9')]({'message':_0x2cea('0x23')});}};
\ No newline at end of file
index 21c5f69..9347291 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2232=['/queues','getQueues','exports','express','../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated'];(function(_0x2ac4af,_0x288c53){var _0x3a36df=function(_0x271b11){while(--_0x271b11){_0x2ac4af['push'](_0x2ac4af['shift']());}};_0x3a36df(++_0x288c53);}(_0x2232,0x198));var _0x2223=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2232[_0x14add3];return _0x4a174f;};'use strict';var express=require(_0x2223('0x0'));var router=express['Router']();var auth=require(_0x2223('0x1'));var controller=require(_0x2223('0x2'));router[_0x2223('0x3')](_0x2223('0x4'),auth[_0x2223('0x5')](),controller['getAgents']);router[_0x2223('0x3')](_0x2223('0x6'),auth[_0x2223('0x5')](),controller[_0x2223('0x7')]);module[_0x2223('0x8')]=router;
\ No newline at end of file
+var _0x2ee9=['isAuthenticated','getAgents','/queues','getQueues','exports','express','Router','./realtime.controller','get','/agents'];(function(_0x1b8195,_0x4de51d){var _0x2f8826=function(_0x990800){while(--_0x990800){_0x1b8195['push'](_0x1b8195['shift']());}};_0x2f8826(++_0x4de51d);}(_0x2ee9,0x87));var _0x92ee=function(_0x510589,_0x1d1b53){_0x510589=_0x510589-0x0;var _0x102819=_0x2ee9[_0x510589];return _0x102819;};'use strict';var express=require(_0x92ee('0x0'));var router=express[_0x92ee('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x92ee('0x2'));router[_0x92ee('0x3')](_0x92ee('0x4'),auth[_0x92ee('0x5')](),controller[_0x92ee('0x6')]);router[_0x92ee('0x3')](_0x92ee('0x7'),auth[_0x92ee('0x5')](),controller[_0x92ee('0x8')]);module[_0x92ee('0x9')]=router;
\ No newline at end of file
index bf7cd94..529f7f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcff0=['outbound','dialMethod','voice','QueueCampaigns','Queues','filter','getRealtimeQueues','initializeQueues','../../components/realtime/agents','../../components/realtime/queues','../../config/utils','../../errors/api','APIBadRequestError','handleError','offset','undefined','count','limit','status','set','Content-Range','json','getAgents','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','*pause','resolve','then','channel','Channel\x20parameter\x20%s\x20is\x20invalid','sort','includes','globalStatus','validateSortParameter','fields','join','order','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','length','map','User','rawAttributes','fieldName','type','role','agent','online','getOptions','forEach','push','Pause','where','user','userProfileId','Agents','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll','filterAgentAttributes','merge','pause','Status','sortAgentsByStatus','catch','getQueues','isValidChannel','format','startCase','Queue','key','name'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xcff0,0x18e));var _0x0cff=function(_0x3e999f,_0x5aab74){_0x3e999f=_0x3e999f-0x0;var _0x1f0905=_0xcff0[_0x3e999f];return _0x1f0905;};'use strict';var _=require('lodash');var util=require('util');var rta=require(_0x0cff('0x0'));var rtq=require(_0x0cff('0x1'));var qs=require('../../components/parsers/qs');var utils=require(_0x0cff('0x2'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0x0cff('0x3'))[_0x0cff('0x4')];var APIHandleError=require(_0x0cff('0x3'))[_0x0cff('0x5')];function respondWithFilteredResult(_0x2e2ab2,_0x1a168f){return function(_0xd7df83){if(_0xd7df83){var _0x1b8d6f=typeof _0x1a168f[_0x0cff('0x6')]===_0x0cff('0x7')&&typeof _0x1a168f['limit']===_0x0cff('0x7');var _0x55fffd=_0xd7df83[_0x0cff('0x8')];var _0x4a68a1=_0x1b8d6f?0x0:_0x1a168f[_0x0cff('0x6')];var _0x296087=_0x1b8d6f?_0xd7df83[_0x0cff('0x8')]:_0x1a168f[_0x0cff('0x6')]+_0x1a168f[_0x0cff('0x9')];var _0x165601;if(_0x296087>=_0x55fffd){_0x296087=_0x55fffd;_0x165601=0xc8;}else{_0x165601=0xce;}_0x2e2ab2[_0x0cff('0xa')](_0x165601);return _0x2e2ab2[_0x0cff('0xb')](_0x0cff('0xc'),_0x4a68a1+'-'+_0x296087+'/'+_0x55fffd)[_0x0cff('0xd')](_0xd7df83);}return null;};}exports[_0x0cff('0xe')]=function(_0x13b81f,_0x413be4){var _0x2656a3={'count':0x0,'rows':[]};var _0x34206c={};var _0x20358a;var _0x2c63e2=utils[_0x0cff('0xf')]();var _0x4fb0a3;var _0x15ee66;var _0x17955d=_0x13b81f[_0x0cff('0x10')][_0x0cff('0x11')];var _0x14f8a3=_0x13b81f[_0x0cff('0x10')][_0x0cff('0x12')];var _0x30782e=_0x13b81f['query'][_0x0cff('0x13')];var _0x5c19ee=_0x14f8a3==='pause'||_0x14f8a3===_0x0cff('0x14')?!![]:![];var _0x436a73=[];var _0x63b183;var _0x256a4a;Promise[_0x0cff('0x15')]()[_0x0cff('0x16')](function(){if(_0x13b81f['query']['channel']){if(!utils['isValidChannel'](_0x13b81f[_0x0cff('0x10')][_0x0cff('0x17')])){throw new APIBadRequestError(util['format'](_0x0cff('0x18'),_0x13b81f['query'][_0x0cff('0x17')]));}_0x20358a=_0x13b81f[_0x0cff('0x10')][_0x0cff('0x17')]['toLowerCase']();}if(!_0x13b81f[_0x0cff('0x10')][_0x0cff('0x19')]||!_0x13b81f['query'][_0x0cff('0x19')][_0x0cff('0x1a')](_0x0cff('0x1b'))){_0x13b81f['query']['sort']=rta[_0x0cff('0x1c')](_0x13b81f['query'][_0x0cff('0x19')]);return;}var _0x4ef0b8=rta['getUpdatedSortOptions'](_0x13b81f[_0x0cff('0x10')][_0x0cff('0x19')]);_0x13b81f[_0x0cff('0x10')][_0x0cff('0x19')]=_0x4ef0b8[_0x0cff('0x1d')][_0x0cff('0x1e')](',');_0x63b183=_0x4ef0b8[_0x0cff('0x1f')];})[_0x0cff('0x16')](function(){if(!_0x17955d){return[];}return rta['getAgentIdsByQueues'](_0x17955d,_0x20358a);})[_0x0cff('0x16')](function(_0x448380){_0x436a73=_0x448380;return rta[_0x0cff('0x20')]();})[_0x0cff('0x16')](function(_0x1bc627){_0x15ee66=_0x1bc627[_0x0cff('0x21')];if((!_0x14f8a3||_0x5c19ee)&&!_0x63b183){return _0x436a73;}if(_0x63b183&&!_0x14f8a3){return rta[_0x0cff('0x22')](_0x15ee66,_0x436a73,_0x63b183);}else{return rta['getAgentIdsByStatus'](_0x15ee66,_0x436a73,_0x14f8a3);}})[_0x0cff('0x16')](function(_0x7e197f){_0x436a73=_0x7e197f;var _0x5a29d6=![];if(_0x436a73[_0x0cff('0x23')]===0x0){if(_0x17955d||_0x14f8a3){_0x5a29d6=!![];}if(_0x5c19ee){_0x5a29d6=![];}}if(_0x5a29d6){return _0x2656a3;}var _0x4abe5d=_[_0x0cff('0x24')](db[_0x0cff('0x25')][_0x0cff('0x26')],function(_0x5034b5){return{'name':_0x5034b5[_0x0cff('0x27')],'type':_0x5034b5[_0x0cff('0x28')]['key']};});_0x13b81f[_0x0cff('0x10')][_0x0cff('0x29')]=_0x0cff('0x2a');_0x13b81f['query'][_0x0cff('0x2b')]=!![];_0x34206c=qs[_0x0cff('0x2c')](_0x4abe5d,_0x13b81f);_0x34206c['raw']=!![];var _0x45fee5=[];if(_0x436a73[_0x0cff('0x23')]>0x0){_0x45fee5['push']({'id':{'$in':_0x436a73}});if(_0x63b183&&!_0x14f8a3){_0x256a4a=[db['sequelize']['literal']('FIELD(id,'+_0x436a73+')')];_0x34206c[_0x0cff('0x1f')]=_0x256a4a;}}if(_0x5c19ee){_0x2c63e2[_0x0cff('0x2d')](function(_0x3d7138){var _0x1b2242=!![];if(_0x14f8a3===_0x0cff('0x14')&&_0x20358a!==_0x3d7138){_0x1b2242=![];}_0x45fee5[_0x0cff('0x2e')]({[_0x3d7138+_0x0cff('0x2f')]:_0x1b2242});});if(_0x30782e){_0x45fee5[_0x0cff('0x2e')]({'pauseType':_0x30782e});}}else if(_0x14f8a3){_0x2c63e2[_0x0cff('0x2d')](function(_0x492216){_0x45fee5['push']({[_0x492216+_0x0cff('0x2f')]:![]});});}_0x34206c[_0x0cff('0x30')]=_['merge'](_0x34206c[_0x0cff('0x30')],{'$and':_0x45fee5});if(_0x13b81f['user'][_0x0cff('0x29')]==='user'){var _0xaead9e={'params':{'id':_0x13b81f[_0x0cff('0x31')][_0x0cff('0x32')]},'query':{'section':_0x0cff('0x33'),'role':_0x0cff('0x2a'),'online':!![],'raw':!![],'ids':_0x436a73,'customSorting':_0x256a4a}};if(_0x5c19ee){_0xaead9e[_0x0cff('0x10')][_0x0cff('0x34')]=_0x45fee5;}_0xaead9e[_0x0cff('0x10')]=Object[_0x0cff('0x35')](_0xaead9e['query'],_0x13b81f[_0x0cff('0x10')]);delete _0xaead9e[_0x0cff('0x10')]['id'];return db[_0x0cff('0x36')][_0x0cff('0x37')](_0xaead9e);}return db['User'][_0x0cff('0x38')](_0x34206c);})['then'](function(_0xb15f1b){_0x2656a3['count']=_0xb15f1b[_0x0cff('0x8')];_0x4fb0a3=_0xb15f1b[_0x0cff('0x21')];return _0x4fb0a3[_0x0cff('0x24')](function(_0x8f5bd7){var _0x5084e5=_['find'](_0x15ee66,['id',_0x8f5bd7['id']]);if(_0x5084e5){var _0x2ff852=rta[_0x0cff('0x39')](_0x5084e5);_[_0x0cff('0x3a')](_0x8f5bd7,_0x2ff852);}_0x8f5bd7[_0x0cff('0x1b')]=rta['getAgentStatus'](_0x8f5bd7);if(_0x8f5bd7[_0x0cff('0x1b')][_0x0cff('0x1a')](_0x0cff('0x3b'))){_0x2c63e2[_0x0cff('0x2d')](function(_0x16e506){if(_0x8f5bd7[_0x16e506+_0x0cff('0x2f')]){_0x8f5bd7[_0x16e506+_0x0cff('0x3c')]=_0x0cff('0x3b');}});}return _0x8f5bd7;});})[_0x0cff('0x16')](function(_0x5927b8){if(!_0x63b183||_0x256a4a){return _0x5927b8;}return rta[_0x0cff('0x3d')](_0x5927b8,_0x63b183);})[_0x0cff('0x16')](function(_0x477907){_0x2656a3[_0x0cff('0x21')]=_0x477907;return _0x2656a3;})[_0x0cff('0x16')](respondWithFilteredResult(_0x413be4,_0x34206c))[_0x0cff('0x3e')](APIHandleError(_0x413be4));};exports[_0x0cff('0x3f')]=function(_0x83b397,_0x4131cd){var _0x1d8992={'count':0x0,'rows':[]};var _0x26053f={};var _0x2bd71c;var _0x3d3263;var _0x241dd7;Promise['resolve']()['then'](function(){if(_0x83b397[_0x0cff('0x10')][_0x0cff('0x17')]){if(!utils[_0x0cff('0x40')](_0x83b397[_0x0cff('0x10')][_0x0cff('0x17')])){throw new APIBadRequestError(util[_0x0cff('0x41')](_0x0cff('0x18'),_0x83b397[_0x0cff('0x10')]['channel']));}_0x2bd71c=_0x83b397['query']['channel']['toLowerCase']();}var _0x304ae3=_[_0x0cff('0x42')](_0x2bd71c)+_0x0cff('0x43');var _0x291935=_[_0x0cff('0x24')](db[_0x304ae3][_0x0cff('0x26')],function(_0x33c36c){return{'name':_0x33c36c[_0x0cff('0x27')],'type':_0x33c36c['type'][_0x0cff('0x44')]};});if(!_0x83b397[_0x0cff('0x10')][_0x0cff('0x1d')]){var _0x34298a=['id',_0x0cff('0x45')];if(_0x2bd71c==='voice'){_0x34298a[_0x0cff('0x2e')](_0x0cff('0x28'));if(_0x83b397[_0x0cff('0x10')]['type']===_0x0cff('0x46')){_0x34298a[_0x0cff('0x2e')](['dialActive',_0x0cff('0x47')]);}}_0x83b397[_0x0cff('0x10')][_0x0cff('0x1d')]=_0x34298a[_0x0cff('0x1e')](',');}_0x26053f=qs[_0x0cff('0x2c')](_0x291935,_0x83b397);if(_0x83b397['user']['role']===_0x0cff('0x31')){var _0x47f028={'params':{'id':_0x83b397[_0x0cff('0x31')][_0x0cff('0x32')]},'query':{'section':_0x2bd71c===_0x0cff('0x48')&&_0x83b397[_0x0cff('0x10')]['type']==='outbound'?_0x0cff('0x49'):_[_0x0cff('0x42')](_0x2bd71c)+_0x0cff('0x4a'),'type':_0x83b397[_0x0cff('0x10')][_0x0cff('0x28')],'nolimit':!![],'sort':'name','filter':_0x83b397['query'][_0x0cff('0x4b')]}};return db['UserProfile'][_0x0cff('0x37')](_0x47f028);}return db[_0x304ae3][_0x0cff('0x38')](_0x26053f);})[_0x0cff('0x16')](function(_0x1e8fbe){_0x1d8992['count']=_0x1e8fbe['count'];_0x3d3263=_0x1e8fbe['rows'];return rtq[_0x0cff('0x4c')](_0x83b397,_0x2bd71c);})['then'](function(_0x413efc){_0x241dd7=_0x413efc[_0x0cff('0x21')];return rtq[_0x0cff('0x4d')](_0x3d3263,_0x241dd7,_0x2bd71c,_0x83b397[_0x0cff('0x10')][_0x0cff('0x28')]);})[_0x0cff('0x16')](function(_0x4ae147){_0x1d8992[_0x0cff('0x21')]=_0x4ae147;return _0x1d8992;})[_0x0cff('0x16')](respondWithFilteredResult(_0x4131cd,_0x26053f))['catch'](APIHandleError(_0x4131cd));};
\ No newline at end of file
+var _0x6812=['getSortedAgentsIdsByStatus','getAgentIdsByStatus','map','User','fieldName','role','agent','online','raw','push','FIELD(id,','Pause','forEach','where','merge','user','userProfileId','Agents','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll','find','getAgentStatus','includes','Status','sortAgentsByStatus','catch','getQueues','isValidChannel','rawAttributes','type','fields','name','voice','dialActive','dialMethod','getOptions','outbound','QueueCampaigns','startCase','Queues','filter','getRealtimeQueues','initializeQueues','lodash','../../components/parsers/qs','../../config/utils','../../mysqldb','APIBadRequestError','../../errors/api','limit','count','offset','status','set','Content-Range','getAgents','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','*pause','resolve','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','globalStatus','getUpdatedSortOptions','join','order','then','getAgentIdsByQueues','getRealtimeAgents','rows'];(function(_0x5b4046,_0x4f964f){var _0x4d031d=function(_0x36f0d4){while(--_0x36f0d4){_0x5b4046['push'](_0x5b4046['shift']());}};_0x4d031d(++_0x4f964f);}(_0x6812,0x1be));var _0x2681=function(_0x5a7864,_0x5ce1ab){_0x5a7864=_0x5a7864-0x0;var _0x578b37=_0x6812[_0x5a7864];return _0x578b37;};'use strict';var _=require(_0x2681('0x0'));var util=require('util');var rta=require('../../components/realtime/agents');var rtq=require('../../components/realtime/queues');var qs=require(_0x2681('0x1'));var utils=require(_0x2681('0x2'));var db=require(_0x2681('0x3'))['db'];var APIBadRequestError=require('../../errors/api')[_0x2681('0x4')];var APIHandleError=require(_0x2681('0x5'))['handleError'];function respondWithFilteredResult(_0x54a900,_0x13184b){return function(_0x76d85b){if(_0x76d85b){var _0x49f05b=typeof _0x13184b['offset']==='undefined'&&typeof _0x13184b[_0x2681('0x6')]==='undefined';var _0x375421=_0x76d85b[_0x2681('0x7')];var _0x24bd88=_0x49f05b?0x0:_0x13184b[_0x2681('0x8')];var _0x512966=_0x49f05b?_0x76d85b[_0x2681('0x7')]:_0x13184b['offset']+_0x13184b[_0x2681('0x6')];var _0x1a27c9;if(_0x512966>=_0x375421){_0x512966=_0x375421;_0x1a27c9=0xc8;}else{_0x1a27c9=0xce;}_0x54a900[_0x2681('0x9')](_0x1a27c9);return _0x54a900[_0x2681('0xa')](_0x2681('0xb'),_0x24bd88+'-'+_0x512966+'/'+_0x375421)['json'](_0x76d85b);}return null;};}exports[_0x2681('0xc')]=function(_0x4072b1,_0x5347b3){var _0x57573b={'count':0x0,'rows':[]};var _0x31d20d={};var _0x321958;var _0x457bf5=utils[_0x2681('0xd')]();var _0x14def9;var _0x454c74;var _0x1d1457=_0x4072b1[_0x2681('0xe')][_0x2681('0xf')];var _0xf52945=_0x4072b1[_0x2681('0xe')][_0x2681('0x10')];var _0x42ca17=_0x4072b1['query'][_0x2681('0x11')];var _0x518b59=_0xf52945===_0x2681('0x12')||_0xf52945===_0x2681('0x13')?!![]:![];var _0x21f720=[];var _0x27d48a;var _0x1aeeec;Promise[_0x2681('0x14')]()['then'](function(){if(_0x4072b1['query'][_0x2681('0x15')]){if(!utils['isValidChannel'](_0x4072b1[_0x2681('0xe')][_0x2681('0x15')])){throw new APIBadRequestError(util[_0x2681('0x16')](_0x2681('0x17'),_0x4072b1[_0x2681('0xe')][_0x2681('0x15')]));}_0x321958=_0x4072b1[_0x2681('0xe')]['channel'][_0x2681('0x18')]();}if(!_0x4072b1[_0x2681('0xe')][_0x2681('0x19')]||!_0x4072b1[_0x2681('0xe')][_0x2681('0x19')]['includes'](_0x2681('0x1a'))){_0x4072b1['query'][_0x2681('0x19')]=rta['validateSortParameter'](_0x4072b1[_0x2681('0xe')][_0x2681('0x19')]);return;}var _0x231b9f=rta[_0x2681('0x1b')](_0x4072b1[_0x2681('0xe')][_0x2681('0x19')]);_0x4072b1[_0x2681('0xe')][_0x2681('0x19')]=_0x231b9f['fields'][_0x2681('0x1c')](',');_0x27d48a=_0x231b9f[_0x2681('0x1d')];})[_0x2681('0x1e')](function(){if(!_0x1d1457){return[];}return rta[_0x2681('0x1f')](_0x1d1457,_0x321958);})[_0x2681('0x1e')](function(_0x457aa3){_0x21f720=_0x457aa3;return rta[_0x2681('0x20')]();})['then'](function(_0x3a090b){_0x454c74=_0x3a090b[_0x2681('0x21')];if((!_0xf52945||_0x518b59)&&!_0x27d48a){return _0x21f720;}if(_0x27d48a&&!_0xf52945){return rta[_0x2681('0x22')](_0x454c74,_0x21f720,_0x27d48a);}else{return rta[_0x2681('0x23')](_0x454c74,_0x21f720,_0xf52945);}})[_0x2681('0x1e')](function(_0x1cc93e){_0x21f720=_0x1cc93e;var _0x2a7f12=![];if(_0x21f720['length']===0x0){if(_0x1d1457||_0xf52945){_0x2a7f12=!![];}if(_0x518b59){_0x2a7f12=![];}}if(_0x2a7f12){return _0x57573b;}var _0x21f7fb=_[_0x2681('0x24')](db[_0x2681('0x25')]['rawAttributes'],function(_0x227bb3){return{'name':_0x227bb3[_0x2681('0x26')],'type':_0x227bb3['type']['key']};});_0x4072b1['query'][_0x2681('0x27')]=_0x2681('0x28');_0x4072b1[_0x2681('0xe')][_0x2681('0x29')]=!![];_0x31d20d=qs['getOptions'](_0x21f7fb,_0x4072b1);_0x31d20d[_0x2681('0x2a')]=!![];var _0x4e2e66=[];if(_0x21f720['length']>0x0){_0x4e2e66[_0x2681('0x2b')]({'id':{'$in':_0x21f720}});if(_0x27d48a&&!_0xf52945){_0x1aeeec=[db['sequelize']['literal'](_0x2681('0x2c')+_0x21f720+')')];_0x31d20d[_0x2681('0x1d')]=_0x1aeeec;}}if(_0x518b59){_0x457bf5['forEach'](function(_0x1c2da2){var _0x10a787=!![];if(_0xf52945===_0x2681('0x13')&&_0x321958!==_0x1c2da2){_0x10a787=![];}_0x4e2e66[_0x2681('0x2b')]({[_0x1c2da2+_0x2681('0x2d')]:_0x10a787});});if(_0x42ca17){_0x4e2e66[_0x2681('0x2b')]({'pauseType':_0x42ca17});}}else if(_0xf52945){_0x457bf5[_0x2681('0x2e')](function(_0x57fe97){_0x4e2e66[_0x2681('0x2b')]({[_0x57fe97+_0x2681('0x2d')]:![]});});}_0x31d20d[_0x2681('0x2f')]=_[_0x2681('0x30')](_0x31d20d['where'],{'$and':_0x4e2e66});if(_0x4072b1[_0x2681('0x31')][_0x2681('0x27')]===_0x2681('0x31')){var _0x576291={'params':{'id':_0x4072b1['user'][_0x2681('0x32')]},'query':{'section':_0x2681('0x33'),'role':_0x2681('0x28'),'online':!![],'raw':!![],'ids':_0x21f720,'customSorting':_0x1aeeec}};if(_0x518b59){_0x576291[_0x2681('0xe')][_0x2681('0x34')]=_0x4e2e66;}_0x576291[_0x2681('0xe')]=Object[_0x2681('0x35')](_0x576291[_0x2681('0xe')],_0x4072b1[_0x2681('0xe')]);delete _0x576291[_0x2681('0xe')]['id'];return db[_0x2681('0x36')][_0x2681('0x37')](_0x576291);}return db[_0x2681('0x25')][_0x2681('0x38')](_0x31d20d);})['then'](function(_0x20d53d){_0x57573b[_0x2681('0x7')]=_0x20d53d['count'];_0x14def9=_0x20d53d['rows'];return _0x14def9[_0x2681('0x24')](function(_0x3eee46){var _0xe03c6b=_[_0x2681('0x39')](_0x454c74,['id',_0x3eee46['id']]);if(_0xe03c6b){var _0x28e3fd=rta['filterAgentAttributes'](_0xe03c6b);_['merge'](_0x3eee46,_0x28e3fd);}_0x3eee46[_0x2681('0x1a')]=rta[_0x2681('0x3a')](_0x3eee46);if(_0x3eee46[_0x2681('0x1a')][_0x2681('0x3b')](_0x2681('0x12'))){_0x457bf5['forEach'](function(_0x3132bb){if(_0x3eee46[_0x3132bb+_0x2681('0x2d')]){_0x3eee46[_0x3132bb+_0x2681('0x3c')]='pause';}});}return _0x3eee46;});})['then'](function(_0x55ce6b){if(!_0x27d48a||_0x1aeeec){return _0x55ce6b;}return rta[_0x2681('0x3d')](_0x55ce6b,_0x27d48a);})[_0x2681('0x1e')](function(_0x448a86){_0x57573b['rows']=_0x448a86;return _0x57573b;})[_0x2681('0x1e')](respondWithFilteredResult(_0x5347b3,_0x31d20d))[_0x2681('0x3e')](APIHandleError(_0x5347b3));};exports[_0x2681('0x3f')]=function(_0xe60eb7,_0x552331){var _0x1ed01c={'count':0x0,'rows':[]};var _0x3604d9={};var _0x406264;var _0x45bf62;var _0x3467a5;Promise[_0x2681('0x14')]()[_0x2681('0x1e')](function(){if(_0xe60eb7[_0x2681('0xe')][_0x2681('0x15')]){if(!utils[_0x2681('0x40')](_0xe60eb7[_0x2681('0xe')][_0x2681('0x15')])){throw new APIBadRequestError(util['format'](_0x2681('0x17'),_0xe60eb7['query'][_0x2681('0x15')]));}_0x406264=_0xe60eb7[_0x2681('0xe')][_0x2681('0x15')][_0x2681('0x18')]();}var _0x4cfc5e=_['startCase'](_0x406264)+'Queue';var _0x2ae648=_['map'](db[_0x4cfc5e][_0x2681('0x41')],function(_0x3a2778){return{'name':_0x3a2778['fieldName'],'type':_0x3a2778[_0x2681('0x42')]['key']};});if(!_0xe60eb7[_0x2681('0xe')][_0x2681('0x43')]){var _0xe8b0dc=['id',_0x2681('0x44')];if(_0x406264===_0x2681('0x45')){_0xe8b0dc['push']('type');if(_0xe60eb7[_0x2681('0xe')]['type']==='outbound'){_0xe8b0dc['push']([_0x2681('0x46'),_0x2681('0x47')]);}}_0xe60eb7[_0x2681('0xe')]['fields']=_0xe8b0dc[_0x2681('0x1c')](',');}_0x3604d9=qs[_0x2681('0x48')](_0x2ae648,_0xe60eb7);if(_0xe60eb7[_0x2681('0x31')][_0x2681('0x27')]==='user'){var _0x35fb80={'params':{'id':_0xe60eb7[_0x2681('0x31')][_0x2681('0x32')]},'query':{'section':_0x406264===_0x2681('0x45')&&_0xe60eb7[_0x2681('0xe')][_0x2681('0x42')]===_0x2681('0x49')?_0x2681('0x4a'):_[_0x2681('0x4b')](_0x406264)+_0x2681('0x4c'),'type':_0xe60eb7['query'][_0x2681('0x42')],'nolimit':!![],'sort':_0x2681('0x44'),'filter':_0xe60eb7[_0x2681('0xe')][_0x2681('0x4d')]}};return db['UserProfile'][_0x2681('0x37')](_0x35fb80);}return db[_0x4cfc5e][_0x2681('0x38')](_0x3604d9);})[_0x2681('0x1e')](function(_0x1ff51d){_0x1ed01c[_0x2681('0x7')]=_0x1ff51d['count'];_0x45bf62=_0x1ff51d[_0x2681('0x21')];return rtq[_0x2681('0x4e')](_0xe60eb7,_0x406264);})[_0x2681('0x1e')](function(_0x28274b){_0x3467a5=_0x28274b[_0x2681('0x21')];return rtq[_0x2681('0x4f')](_0x45bf62,_0x3467a5,_0x406264,_0xe60eb7[_0x2681('0xe')]['type']);})['then'](function(_0x34a92e){_0x1ed01c['rows']=_0x34a92e;return _0x1ed01c;})['then'](respondWithFilteredResult(_0x552331,_0x3604d9))[_0x2681('0x3e')](APIHandleError(_0x552331));};
\ No newline at end of file
index ab802e8..f48a3d2 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(_0x2bc5e5,_0x436eb8){var _0x4a4dad=function(_0x4e82c0){while(--_0x4e82c0){_0x2bc5e5['push'](_0x2bc5e5['shift']());}};_0x4a4dad(++_0x436eb8);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
+var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x26f869,_0xe997a6){var _0x2caba3=function(_0x1173ff){while(--_0x1173ff){_0x26f869['push'](_0x26f869['shift']());}};_0x2caba3(++_0xe997a6);}(_0xe706,0xa3));var _0x6e70=function(_0x1b09e8,_0x5c9627){_0x1b09e8=_0x1b09e8-0x0;var _0x158835=_0xe706[_0x1b09e8];return _0x158835;};'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 7f0a0fb..08cea12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc21c=['STRING','DATE','INTEGER','sequelize','exports'];(function(_0x19ba99,_0x4d3b15){var _0x53d50a=function(_0x46c09c){while(--_0x46c09c){_0x19ba99['push'](_0x19ba99['shift']());}};_0x53d50a(++_0x4d3b15);}(_0xc21c,0x166));var _0xcc21=function(_0x4a7b59,_0x5a879d){_0x4a7b59=_0x4a7b59-0x0;var _0x23b15c=_0xc21c[_0x4a7b59];return _0x23b15c;};'use strict';var Sequelize=require(_0xcc21('0x0'));module[_0xcc21('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xcc21('0x2')]},'scheduledat':{'type':Sequelize[_0xcc21('0x3')]},'uniqueid':{'type':Sequelize[_0xcc21('0x2')]},'starttime':{'type':Sequelize[_0xcc21('0x3')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xcc21('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xcc21('0x2')]},'campaigntype':{'type':Sequelize[_0xcc21('0x2')]},'membername':{'type':Sequelize[_0xcc21('0x2')]}};
\ No newline at end of file
+var _0x2f2e=['DATE','STRING','exports','INTEGER'];(function(_0x1e2080,_0x53283b){var _0x260111=function(_0x15da5e){while(--_0x15da5e){_0x1e2080['push'](_0x1e2080['shift']());}};_0x260111(++_0x53283b);}(_0x2f2e,0x146));var _0xe2f2=function(_0x55ff79,_0x3d45e7){_0x55ff79=_0x55ff79-0x0;var _0x579067=_0x2f2e[_0x55ff79];return _0x579067;};'use strict';var Sequelize=require('sequelize');module[_0xe2f2('0x0')]={'state':{'type':Sequelize[_0xe2f2('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xe2f2('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xe2f2('0x2')]},'responsetime':{'type':Sequelize[_0xe2f2('0x2')]},'ringtime':{'type':Sequelize[_0xe2f2('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xe2f2('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 405d35d..0c85daf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x336f=['moment','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','report_agent_preview','util'];(function(_0x29ff5e,_0x220788){var _0xd8135a=function(_0x3a0136){while(--_0x3a0136){_0x29ff5e['push'](_0x29ff5e['shift']());}};_0xd8135a(++_0x220788);}(_0x336f,0x1ee));var _0xf336=function(_0x12634e,_0x5148a6){_0x12634e=_0x12634e-0x0;var _0x2abf00=_0x336f[_0x12634e];return _0x2abf00;};'use strict';var _=require('lodash');var util=require(_0xf336('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xf336('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf336('0x2'));var rimraf=require(_0xf336('0x3'));var config=require(_0xf336('0x4'));var attributes=require(_0xf336('0x5'));module[_0xf336('0x6')]=function(_0x2d4ebd,_0x3a8680){return _0x2d4ebd[_0xf336('0x7')]('ReportAgentPreview',attributes,{'tableName':_0xf336('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa94a=['../../config/environment','exports','define','ReportAgentPreview','../../config/logger','api','rimraf'];(function(_0x4e12c5,_0xf17788){var _0x11d934=function(_0x36fc56){while(--_0x36fc56){_0x4e12c5['push'](_0x4e12c5['shift']());}};_0x11d934(++_0xf17788);}(_0xa94a,0xb3));var _0xaa94=function(_0xdef295,_0x3bb923){_0xdef295=_0xdef295-0x0;var _0x3959a4=_0xa94a[_0xdef295];return _0x3959a4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaa94('0x0'))(_0xaa94('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaa94('0x2'));var config=require(_0xaa94('0x3'));var attributes=require('./reportAgentPreview.attributes');module[_0xaa94('0x4')]=function(_0x1b8364,_0x1d2dab){return _0x1b8364[_0xaa94('0x5')](_0xaa94('0x6'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 21cddc0..cbd7db5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x617d=['error','code','message','ReportAgentPreview,\x20%s,\x20%s','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x617d,0x1e8));var _0xd617=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x617d[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0xd617('0x0'));var util=require(_0xd617('0x1'));var moment=require(_0xd617('0x2'));var BPromise=require(_0xd617('0x3'));var rs=require(_0xd617('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd617('0x5'));var logger=require(_0xd617('0x6'))(_0xd617('0x7'));var config=require(_0xd617('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd617('0x9')][_0xd617('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48aacb,_0x4ac383,_0x2a2148){return new BPromise(function(_0x235b8e,_0x426558){return client[_0xd617('0xb')](_0x48aacb,_0x2a2148)[_0xd617('0xc')](function(_0x132b33){logger[_0xd617('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x4ac383,_0xd617('0xe'));logger[_0xd617('0xf')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x4ac383,'request\x20sent',JSON['stringify'](_0x132b33));if(_0x132b33[_0xd617('0x10')]){if(_0x132b33[_0xd617('0x10')][_0xd617('0x11')]===0x1f4){logger[_0xd617('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x4ac383,_0x132b33[_0xd617('0x10')]['message']);return _0x426558(_0x132b33['error']['message']);}logger[_0xd617('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x4ac383,_0x132b33[_0xd617('0x10')][_0xd617('0x12')]);return _0x235b8e(_0x132b33['error'][_0xd617('0x12')]);}else{logger[_0xd617('0xd')](_0xd617('0x13'),_0x4ac383,_0xd617('0xe'));_0x235b8e(_0x132b33[_0xd617('0x14')][_0xd617('0x12')]);}})[_0xd617('0x15')](function(_0x2bfdce){logger[_0xd617('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x4ac383,_0x2bfdce);_0x426558(_0x2bfdce);});});}exports[_0xd617('0x16')]=function(_0x3cbb73){var _0x785710=this;return new Promise(function(_0x57e070,_0x1805f2){return db[_0xd617('0x17')][_0xd617('0x18')](_0x3cbb73[_0xd617('0x19')],{'raw':_0x3cbb73[_0xd617('0x1a')]?_0x3cbb73[_0xd617('0x1a')][_0xd617('0x1b')]===undefined?!![]:![]:!![]})[_0xd617('0xc')](function(_0x44b9fb){logger[_0xd617('0xd')]('CreateReportAgentPreview',_0x3cbb73);logger['debug'](_0xd617('0x16'),_0x3cbb73,JSON['stringify'](_0x44b9fb));_0x57e070(_0x44b9fb);})[_0xd617('0x15')](function(_0x4b0eea){logger[_0xd617('0x10')](_0xd617('0x16'),_0x4b0eea[_0xd617('0x12')],_0x3cbb73);_0x1805f2(_0x785710[_0xd617('0x10')](0x1f4,_0x4b0eea['message']));});});};
\ No newline at end of file
+var _0xd4a9=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','info','debug','request\x20sent','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','result','CreateReportAgentPreview','ReportAgentPreview','body','options','then','catch','lodash','util','bluebird'];(function(_0x20fdc1,_0xde1296){var _0x25397c=function(_0x814b51){while(--_0x814b51){_0x20fdc1['push'](_0x20fdc1['shift']());}};_0x25397c(++_0xde1296);}(_0xd4a9,0x174));var _0x9d4a=function(_0x3ff2af,_0xd3ef7d){_0x3ff2af=_0x3ff2af-0x0;var _0x34d725=_0xd4a9[_0x3ff2af];return _0x34d725;};'use strict';var _=require(_0x9d4a('0x0'));var util=require(_0x9d4a('0x1'));var moment=require('moment');var BPromise=require(_0x9d4a('0x2'));var rs=require(_0x9d4a('0x3'));var fs=require('fs');var Redis=require(_0x9d4a('0x4'));var db=require(_0x9d4a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9d4a('0x6'))(_0x9d4a('0x7'));var config=require('../../config/environment');var jayson=require(_0x9d4a('0x8'));var client=jayson['client'][_0x9d4a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e44ca,_0x180ac1,_0x53856d){return new BPromise(function(_0x50c015,_0x1c4ae5){return client['request'](_0x2e44ca,_0x53856d)['then'](function(_0x4e798d){logger[_0x9d4a('0xa')]('ReportAgentPreview,\x20%s,\x20%s',_0x180ac1,'request\x20sent');logger[_0x9d4a('0xb')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x180ac1,_0x9d4a('0xc'),JSON[_0x9d4a('0xd')](_0x4e798d));if(_0x4e798d[_0x9d4a('0xe')]){if(_0x4e798d[_0x9d4a('0xe')][_0x9d4a('0xf')]===0x1f4){logger[_0x9d4a('0xe')](_0x9d4a('0x10'),_0x180ac1,_0x4e798d[_0x9d4a('0xe')][_0x9d4a('0x11')]);return _0x1c4ae5(_0x4e798d['error'][_0x9d4a('0x11')]);}logger[_0x9d4a('0xe')](_0x9d4a('0x10'),_0x180ac1,_0x4e798d['error'][_0x9d4a('0x11')]);return _0x50c015(_0x4e798d[_0x9d4a('0xe')][_0x9d4a('0x11')]);}else{logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x180ac1,_0x9d4a('0xc'));_0x50c015(_0x4e798d[_0x9d4a('0x12')]['message']);}})['catch'](function(_0x910812){logger[_0x9d4a('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x180ac1,_0x910812);_0x1c4ae5(_0x910812);});});}exports[_0x9d4a('0x13')]=function(_0x2eaf03){var _0x331292=this;return new Promise(function(_0x2742e1,_0x4c495f){return db[_0x9d4a('0x14')]['create'](_0x2eaf03[_0x9d4a('0x15')],{'raw':_0x2eaf03[_0x9d4a('0x16')]?_0x2eaf03[_0x9d4a('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x9d4a('0x17')](function(_0x88e2b){logger[_0x9d4a('0xa')]('CreateReportAgentPreview',_0x2eaf03);logger[_0x9d4a('0xb')](_0x9d4a('0x13'),_0x2eaf03,JSON[_0x9d4a('0xd')](_0x88e2b));_0x2742e1(_0x88e2b);})[_0x9d4a('0x18')](function(_0x252b99){logger[_0x9d4a('0xe')](_0x9d4a('0x13'),_0x252b99[_0x9d4a('0x11')],_0x2eaf03);_0x4c495f(_0x331292[_0x9d4a('0xe')](0x1f4,_0x252b99[_0x9d4a('0x11')]));});});};
\ No newline at end of file
index afd8d56..57c527a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3a8=['/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','put','/outbound','outbound','/outbound/channels','/agents','agents','/agents/:id/capacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','queueNotify','chat','/chat/queues/:id','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','/agents/:id/notify','multer','path','express','Router','../../components/auth/service','get','/voice/channels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','isAuthenticated','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues'];(function(_0x3d5c06,_0x302d47){var _0x6d5d66=function(_0x197527){while(--_0x197527){_0x3d5c06['push'](_0x3d5c06['shift']());}};_0x6d5d66(++_0x302d47);}(_0xd3a8,0x135));var _0x8d3a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd3a8[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x8d3a('0x0'));var util=require('util');var path=require(_0x8d3a('0x1'));var express=require(_0x8d3a('0x2'));var router=express[_0x8d3a('0x3')]();var auth=require(_0x8d3a('0x4'));var controller=require('./rpc.controller');router[_0x8d3a('0x5')](_0x8d3a('0x6'),auth['isAuthenticated'](),controller['voiceChannels']);router['get'](_0x8d3a('0x7'),auth['isAuthenticated'](),controller['voiceChannelMixMonitor']);router[_0x8d3a('0x5')](_0x8d3a('0x8'),auth[_0x8d3a('0x9')](),controller[_0x8d3a('0xa')]);router[_0x8d3a('0x5')](_0x8d3a('0xb'),auth[_0x8d3a('0x9')](),controller[_0x8d3a('0xc')]);router[_0x8d3a('0x5')](_0x8d3a('0xd'),auth[_0x8d3a('0x9')](),controller[_0x8d3a('0xe')]);router[_0x8d3a('0x5')]('/mail/queues',auth['isAuthenticated'](),controller['mailQueues']);router[_0x8d3a('0x5')](_0x8d3a('0xf'),auth[_0x8d3a('0x9')](),controller[_0x8d3a('0x10')]);router[_0x8d3a('0x5')](_0x8d3a('0x11'),auth['isAuthenticated'](),controller[_0x8d3a('0x12')]);router[_0x8d3a('0x5')]('/sms/queues',auth['isAuthenticated'](),controller[_0x8d3a('0x13')]);router['get'](_0x8d3a('0x14'),auth[_0x8d3a('0x9')](),controller[_0x8d3a('0x15')]);router['get'](_0x8d3a('0x16'),auth['isAuthenticated'](),controller[_0x8d3a('0x17')]);router['get'](_0x8d3a('0x18'),auth[_0x8d3a('0x9')](),controller[_0x8d3a('0x19')]);router['get']('/voice/queues/channels',auth[_0x8d3a('0x9')](),controller[_0x8d3a('0x1a')]);router[_0x8d3a('0x5')](_0x8d3a('0x1b'),auth[_0x8d3a('0x9')](),controller['voiceQueuesChannel']);router[_0x8d3a('0x5')](_0x8d3a('0x1c'),auth[_0x8d3a('0x9')](),controller[_0x8d3a('0x1d')]);router[_0x8d3a('0x5')](_0x8d3a('0x1e'),auth['isAuthenticated'](),controller[_0x8d3a('0x1f')]);router[_0x8d3a('0x5')](_0x8d3a('0x20'),auth[_0x8d3a('0x9')](),controller['showVoiceQueues']);router[_0x8d3a('0x21')](_0x8d3a('0x20'),auth[_0x8d3a('0x9')](),controller['updateVoiceQueue']);router[_0x8d3a('0x5')](_0x8d3a('0x22'),auth[_0x8d3a('0x9')](),controller[_0x8d3a('0x23')]);router[_0x8d3a('0x5')](_0x8d3a('0x24'),auth[_0x8d3a('0x9')](),controller['outboundChannels']);router[_0x8d3a('0x5')](_0x8d3a('0x25'),auth[_0x8d3a('0x9')](),controller[_0x8d3a('0x26')]);router[_0x8d3a('0x21')](_0x8d3a('0x27'),auth['isAuthenticated'](),controller['agentCapacity']);router[_0x8d3a('0x5')](_0x8d3a('0x28'),auth[_0x8d3a('0x9')](),controller[_0x8d3a('0x29')]);router[_0x8d3a('0x5')](_0x8d3a('0x2a'),auth['isAuthenticated'](),controller[_0x8d3a('0x2b')]);router[_0x8d3a('0x5')](_0x8d3a('0x2c'),auth['isAuthenticated'](),controller[_0x8d3a('0x2d')]);router[_0x8d3a('0x5')](_0x8d3a('0x2e'),auth['isAuthenticated'](),controller[_0x8d3a('0x2f')]);router['get'](_0x8d3a('0x30'),auth[_0x8d3a('0x9')](),controller[_0x8d3a('0x31')]);router['get'](_0x8d3a('0x32'),auth['isAuthenticated'](),controller['mailQueuesWaitingInteractions']);router[_0x8d3a('0x5')](_0x8d3a('0x33'),auth['isAuthenticated'](),controller[_0x8d3a('0x34')]);router['get']('/openchannel/queues/:id/waitinginteractions',auth[_0x8d3a('0x9')](),controller[_0x8d3a('0x35')]);router['get'](_0x8d3a('0x36'),auth[_0x8d3a('0x9')](),controller[_0x8d3a('0x37')]);router[_0x8d3a('0x5')](_0x8d3a('0x38'),auth[_0x8d3a('0x9')](),controller[_0x8d3a('0x39')]);router[_0x8d3a('0x5')](_0x8d3a('0x3a'),auth[_0x8d3a('0x9')](),controller['faxQueuesWaitingInteractions']);router[_0x8d3a('0x3b')](_0x8d3a('0x3c'),auth['isAuthenticated'](),controller['queueNotify'](_0x8d3a('0x3d')));router[_0x8d3a('0x5')](_0x8d3a('0x3e'),auth['isAuthenticated'](),controller[_0x8d3a('0x3f')]);router[_0x8d3a('0x3b')]('/chat/queues/:id/notify',auth[_0x8d3a('0x9')](),controller[_0x8d3a('0x40')](_0x8d3a('0x41')));router[_0x8d3a('0x5')](_0x8d3a('0x42'),auth[_0x8d3a('0x9')](),controller['showChatQueues']);router[_0x8d3a('0x3b')](_0x8d3a('0x43'),auth[_0x8d3a('0x9')](),controller[_0x8d3a('0x40')](_0x8d3a('0x44')));router[_0x8d3a('0x5')](_0x8d3a('0x45'),auth[_0x8d3a('0x9')](),controller[_0x8d3a('0x46')]);router[_0x8d3a('0x3b')]('/openchannel/queues/:id/notify',auth['isAuthenticated'](),controller[_0x8d3a('0x40')](_0x8d3a('0x47')));router[_0x8d3a('0x5')](_0x8d3a('0x48'),auth[_0x8d3a('0x9')](),controller[_0x8d3a('0x49')]);router['post'](_0x8d3a('0x4a'),auth[_0x8d3a('0x9')](),controller[_0x8d3a('0x40')](_0x8d3a('0x4b')));router[_0x8d3a('0x3b')](_0x8d3a('0x4c'),auth[_0x8d3a('0x9')](),controller[_0x8d3a('0x40')](_0x8d3a('0x4d')));router[_0x8d3a('0x5')](_0x8d3a('0x4e'),auth[_0x8d3a('0x9')](),controller['showSmsQueues']);router[_0x8d3a('0x5')](_0x8d3a('0x4f'),auth[_0x8d3a('0x9')](),controller['showWhatsappQueues']);router[_0x8d3a('0x3b')](_0x8d3a('0x50'),auth[_0x8d3a('0x9')](),controller['agentNotify']);module['exports']=router;
\ No newline at end of file
+var _0xed46=['voiceQueues','/chat/queues','chatQueues','/mail/queues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','/whatsapp/queues','whatsappQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelRedirect','showVoiceQueues','put','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','/agents/:id/notify','agentNotify','multer','util','path','express','Router','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues'];(function(_0x31776a,_0x100ce7){var _0x4c858d=function(_0x3e2a12){while(--_0x3e2a12){_0x31776a['push'](_0x31776a['shift']());}};_0x4c858d(++_0x100ce7);}(_0xed46,0x1de));var _0x6ed4=function(_0x3c5ad6,_0x47b7bf){_0x3c5ad6=_0x3c5ad6-0x0;var _0x3154f2=_0xed46[_0x3c5ad6];return _0x3154f2;};'use strict';var multer=require(_0x6ed4('0x0'));var util=require(_0x6ed4('0x1'));var path=require(_0x6ed4('0x2'));var express=require(_0x6ed4('0x3'));var router=express[_0x6ed4('0x4')]();var auth=require('../../components/auth/service');var controller=require(_0x6ed4('0x5'));router[_0x6ed4('0x6')](_0x6ed4('0x7'),auth[_0x6ed4('0x8')](),controller[_0x6ed4('0x9')]);router[_0x6ed4('0x6')](_0x6ed4('0xa'),auth['isAuthenticated'](),controller[_0x6ed4('0xb')]);router[_0x6ed4('0x6')]('/voice/channels/:uniqueid/stopmixmonitor',auth['isAuthenticated'](),controller[_0x6ed4('0xc')]);router[_0x6ed4('0x6')](_0x6ed4('0xd'),auth[_0x6ed4('0x8')](),controller[_0x6ed4('0xe')]);router[_0x6ed4('0x6')](_0x6ed4('0xf'),auth['isAuthenticated'](),controller[_0x6ed4('0x10')]);router[_0x6ed4('0x6')](_0x6ed4('0x11'),auth['isAuthenticated'](),controller['mailQueues']);router['get'](_0x6ed4('0x12'),auth[_0x6ed4('0x8')](),controller[_0x6ed4('0x13')]);router[_0x6ed4('0x6')]('/openchannel/queues',auth[_0x6ed4('0x8')](),controller[_0x6ed4('0x14')]);router[_0x6ed4('0x6')](_0x6ed4('0x15'),auth['isAuthenticated'](),controller['smsQueues']);router[_0x6ed4('0x6')](_0x6ed4('0x16'),auth[_0x6ed4('0x8')](),controller[_0x6ed4('0x17')]);router['get']('/fax/queues',auth['isAuthenticated'](),controller[_0x6ed4('0x18')]);router[_0x6ed4('0x6')](_0x6ed4('0x19'),auth[_0x6ed4('0x8')](),controller[_0x6ed4('0x1a')]);router[_0x6ed4('0x6')]('/voice/queues/channels',auth[_0x6ed4('0x8')](),controller[_0x6ed4('0x1b')]);router[_0x6ed4('0x6')]('/voice/queues/channels/:uniqueid',auth[_0x6ed4('0x8')](),controller['voiceQueuesChannel']);router[_0x6ed4('0x6')](_0x6ed4('0x1c'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0x6ed4('0x6')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x6ed4('0x8')](),controller[_0x6ed4('0x1d')]);router[_0x6ed4('0x6')]('/voice/queues/:id',auth[_0x6ed4('0x8')](),controller[_0x6ed4('0x1e')]);router[_0x6ed4('0x1f')](_0x6ed4('0x20'),auth[_0x6ed4('0x8')](),controller[_0x6ed4('0x21')]);router[_0x6ed4('0x6')](_0x6ed4('0x22'),auth[_0x6ed4('0x8')](),controller[_0x6ed4('0x23')]);router[_0x6ed4('0x6')](_0x6ed4('0x24'),auth['isAuthenticated'](),controller[_0x6ed4('0x25')]);router[_0x6ed4('0x6')](_0x6ed4('0x26'),auth['isAuthenticated'](),controller[_0x6ed4('0x27')]);router[_0x6ed4('0x1f')](_0x6ed4('0x28'),auth[_0x6ed4('0x8')](),controller[_0x6ed4('0x29')]);router[_0x6ed4('0x6')](_0x6ed4('0x2a'),auth['isAuthenticated'](),controller[_0x6ed4('0x2b')]);router['get']('/trunks',auth[_0x6ed4('0x8')](),controller[_0x6ed4('0x2c')]);router[_0x6ed4('0x6')](_0x6ed4('0x2d'),auth[_0x6ed4('0x8')](),controller[_0x6ed4('0x2e')]);router[_0x6ed4('0x6')](_0x6ed4('0x2f'),auth[_0x6ed4('0x8')](),controller['faxAccounts']);router['get'](_0x6ed4('0x30'),auth[_0x6ed4('0x8')](),controller[_0x6ed4('0x31')]);router[_0x6ed4('0x6')](_0x6ed4('0x32'),auth['isAuthenticated'](),controller[_0x6ed4('0x33')]);router[_0x6ed4('0x6')](_0x6ed4('0x34'),auth['isAuthenticated'](),controller[_0x6ed4('0x35')]);router[_0x6ed4('0x6')](_0x6ed4('0x36'),auth['isAuthenticated'](),controller[_0x6ed4('0x37')]);router['get'](_0x6ed4('0x38'),auth['isAuthenticated'](),controller[_0x6ed4('0x39')]);router['get'](_0x6ed4('0x3a'),auth['isAuthenticated'](),controller[_0x6ed4('0x3b')]);router[_0x6ed4('0x6')](_0x6ed4('0x3c'),auth[_0x6ed4('0x8')](),controller[_0x6ed4('0x3d')]);router[_0x6ed4('0x3e')](_0x6ed4('0x3f'),auth['isAuthenticated'](),controller[_0x6ed4('0x40')]('mail'));router[_0x6ed4('0x6')](_0x6ed4('0x41'),auth[_0x6ed4('0x8')](),controller['showMailQueues']);router['post'](_0x6ed4('0x42'),auth[_0x6ed4('0x8')](),controller[_0x6ed4('0x40')](_0x6ed4('0x43')));router[_0x6ed4('0x6')](_0x6ed4('0x44'),auth[_0x6ed4('0x8')](),controller[_0x6ed4('0x45')]);router['post'](_0x6ed4('0x46'),auth[_0x6ed4('0x8')](),controller['queueNotify']('fax'));router[_0x6ed4('0x6')](_0x6ed4('0x47'),auth[_0x6ed4('0x8')](),controller[_0x6ed4('0x48')]);router[_0x6ed4('0x3e')](_0x6ed4('0x49'),auth[_0x6ed4('0x8')](),controller['queueNotify'](_0x6ed4('0x4a')));router['get'](_0x6ed4('0x4b'),auth['isAuthenticated'](),controller[_0x6ed4('0x4c')]);router[_0x6ed4('0x3e')](_0x6ed4('0x4d'),auth[_0x6ed4('0x8')](),controller[_0x6ed4('0x40')](_0x6ed4('0x4e')));router[_0x6ed4('0x3e')](_0x6ed4('0x4f'),auth[_0x6ed4('0x8')](),controller[_0x6ed4('0x40')]('whatsapp'));router[_0x6ed4('0x6')]('/sms/queues/:id',auth[_0x6ed4('0x8')](),controller['showSmsQueues']);router[_0x6ed4('0x6')]('/whatsapp/queues/:id',auth[_0x6ed4('0x8')](),controller['showWhatsappQueues']);router[_0x6ed4('0x3e')](_0x6ed4('0x50'),auth['isAuthenticated'](),controller[_0x6ed4('0x51')]);module['exports']=router;
\ No newline at end of file
index b994064..93e134a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fd1=['findOrCreate','SIP/%s','interface','agent','internal','AgentCapacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','FaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','MessageId','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','jayson/promise','client','http','then','error','message','result','catch','status','stack','name','send','isNil','find','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','Outbound','OutboundChannels','agents','Agents','agentCapacity','interaction','user','MemberReport','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes'];(function(_0x5a0f53,_0x3cf8a4){var _0x262793=function(_0x7d6caa){while(--_0x7d6caa){_0x5a0f53['push'](_0x5a0f53['shift']());}};_0x262793(++_0x3cf8a4);}(_0x5fd1,0x155));var _0x15fd=function(_0x17d686,_0x3c0822){_0x17d686=_0x17d686-0x0;var _0x33c87c=_0x5fd1[_0x17d686];return _0x33c87c;};'use strict';var BPromise=require(_0x15fd('0x0'));var moment=require('moment');var _=require(_0x15fd('0x1'));var util=require(_0x15fd('0x2'));var db=require(_0x15fd('0x3'))['db'];var logger=require('../../config/logger')('api');var jayson=require(_0x15fd('0x4'));var amiClient=jayson[_0x15fd('0x5')][_0x15fd('0x6')]({'port':0x232a});var mailClient=jayson['client'][_0x15fd('0x6')]({'port':0x232b});var routingClient=jayson[_0x15fd('0x5')][_0x15fd('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x2e88bf,_0x225728,_0x534e63){return new BPromise(function(_0x210e90,_0x1ee117){var _0x19806f=_0x534e63?_0x534e63:amiClient;return _0x19806f['request'](_0x2e88bf,_0x225728)[_0x15fd('0x7')](function(_0x5c9c63){if(_0x5c9c63[_0x15fd('0x8')]){if(_0x5c9c63[_0x15fd('0x8')]['code']===0x1f4){return _0x1ee117(_0x5c9c63['error']['message']);}return _0x210e90(_0x5c9c63[_0x15fd('0x8')][_0x15fd('0x9')]);}else{_0x210e90(_0x5c9c63[_0x15fd('0xa')]);}})[_0x15fd('0xb')](function(_0x311138){_0x1ee117(_0x311138);});});}function respondWithResult(_0x2e18ec,_0x346ab1){_0x346ab1=_0x346ab1||0xc8;return function(_0x2660db){if(_0x2660db){return _0x2e18ec[_0x15fd('0xc')](_0x346ab1)['json'](_0x2660db);}return _0x2e18ec['sendStatus'](0x194);};}function handleError(_0x5784a3,_0x3fda60){_0x3fda60=_0x3fda60||0x1f4;return function(_0x135a15){logger[_0x15fd('0x8')](_0x135a15[_0x15fd('0xd')]);if(_0x135a15[_0x15fd('0xe')]){delete _0x135a15[_0x15fd('0xe')];}_0x5784a3[_0x15fd('0xc')](_0x3fda60)[_0x15fd('0xf')](_0x135a15);};}function findById(_0x5aae13){return function(_0x4c7080){if(!_[_0x15fd('0x10')](_0x5aae13)&&!_['isNil'](_0x4c7080)&&!_[_0x15fd('0x10')](_0x4c7080['rows'])){return _[_0x15fd('0x11')](_0x4c7080[_0x15fd('0x12')],function(_0x855bae){return _0x855bae['id']==_0x5aae13;});}return null;};}exports['voiceChannels']=function(_0x367c36,_0x2ad0de){return respondWithRpcPromise(_0x15fd('0x13'),_0x367c36[_0x15fd('0x14')])[_0x15fd('0x7')](respondWithResult(_0x2ad0de,null))[_0x15fd('0xb')](handleError(_0x2ad0de,null));};exports[_0x15fd('0x15')]=function(_0x2f46f1,_0x1b8b9f){return respondWithRpcPromise(_0x15fd('0x16'),_[_0x15fd('0x17')](_0x2f46f1['query'],_0x2f46f1['params']))[_0x15fd('0x7')](respondWithResult(_0x1b8b9f,null))[_0x15fd('0xb')](handleError(_0x1b8b9f,null));};exports[_0x15fd('0x18')]=function(_0x118a2b,_0x24bdaf){return respondWithRpcPromise(_0x15fd('0x19'),_[_0x15fd('0x17')](_0x118a2b['query'],_0x118a2b[_0x15fd('0x1a')]))[_0x15fd('0x7')](respondWithResult(_0x24bdaf,null))[_0x15fd('0xb')](handleError(_0x24bdaf,null));};exports['voiceQueues']=function(_0x27528f,_0x49062f){return respondWithRpcPromise(_0x15fd('0x1b'),_0x27528f[_0x15fd('0x14')])[_0x15fd('0x7')](respondWithResult(_0x49062f,null))['catch'](handleError(_0x49062f,null));};exports[_0x15fd('0x1c')]=function(_0x1cbf2c,_0x24c541){return respondWithRpcPromise('VoiceQueues',_0x1cbf2c[_0x15fd('0x14')])['then'](findById(_0x1cbf2c[_0x15fd('0x1a')]['id']))[_0x15fd('0x7')](respondWithResult(_0x24c541,null))[_0x15fd('0xb')](handleError(_0x24c541,null));};exports[_0x15fd('0x1d')]=function(_0x233ed3,_0x6c213b){return respondWithRpcPromise(_0x15fd('0x1e'),_[_0x15fd('0x17')](_0x233ed3[_0x15fd('0x1f')],_0x233ed3[_0x15fd('0x1a')]))[_0x15fd('0x7')](respondWithResult(_0x6c213b,null))['catch'](handleError(_0x6c213b,null));};exports[_0x15fd('0x20')]=function(_0x2fe61e,_0x50381a){return respondWithRpcPromise(_0x15fd('0x21'),_[_0x15fd('0x17')](_0x2fe61e['query'],_0x2fe61e[_0x15fd('0x1a')]))[_0x15fd('0x7')](respondWithResult(_0x50381a,null))['catch'](handleError(_0x50381a,null));};exports[_0x15fd('0x22')]=function(_0x199647,_0x582af2){return respondWithRpcPromise(_0x15fd('0x23'),_0x199647[_0x15fd('0x14')])[_0x15fd('0x7')](respondWithResult(_0x582af2,null))['catch'](handleError(_0x582af2,null));};exports[_0x15fd('0x24')]=function(_0x7ac52b,_0x4228ea){return respondWithRpcPromise(_0x15fd('0x25'),_['merge'](_0x7ac52b[_0x15fd('0x14')],_0x7ac52b[_0x15fd('0x1a')]))[_0x15fd('0x7')](respondWithResult(_0x4228ea,null))[_0x15fd('0xb')](handleError(_0x4228ea,null));};exports[_0x15fd('0x26')]=function(_0x296a0c,_0x4d9ff5){return respondWithRpcPromise(_0x15fd('0x27'),_[_0x15fd('0x17')](_0x296a0c['query'],_0x296a0c[_0x15fd('0x1a')]))[_0x15fd('0x7')](respondWithResult(_0x4d9ff5,null))[_0x15fd('0xb')](handleError(_0x4d9ff5,null));};exports['voiceQueuesChannelRedirect']=function(_0x25d34e,_0x309851){return respondWithRpcPromise(_0x15fd('0x28'),_[_0x15fd('0x17')](_0x25d34e[_0x15fd('0x14')],_0x25d34e[_0x15fd('0x1a')]))['then'](respondWithResult(_0x309851,null))['catch'](handleError(_0x309851,null));};exports['outbound']=function(_0x340d17,_0x289710){return respondWithRpcPromise(_0x15fd('0x29'),_0x340d17['query'])['then'](respondWithResult(_0x289710,null))[_0x15fd('0xb')](handleError(_0x289710,null));};exports['outboundChannels']=function(_0x4f1c84,_0x4c1aa8){return respondWithRpcPromise(_0x15fd('0x2a'),_0x4f1c84[_0x15fd('0x14')])[_0x15fd('0x7')](respondWithResult(_0x4c1aa8,null))['catch'](handleError(_0x4c1aa8,null));};exports[_0x15fd('0x2b')]=function(_0x3a10e2,_0xd85d3e){var _0x5beb6e;return respondWithRpcPromise(_0x15fd('0x2c'),_0x3a10e2[_0x15fd('0x14')])[_0x15fd('0x7')](function(_0xe18038){_0x5beb6e=_0xe18038;return respondWithRpcPromise(_0x15fd('0x2c'),_0x3a10e2[_0x15fd('0x14')],routingClient);})[_0x15fd('0x7')](function(_0x12a894){return _[_0x15fd('0x17')]({},_0x12a894,_0x5beb6e);})['then'](respondWithResult(_0xd85d3e,null))[_0x15fd('0xb')](handleError(_0xd85d3e,null));};exports[_0x15fd('0x2d')]=function(_0x180433,_0x304736){if(_0x180433[_0x15fd('0x1f')]&&_0x180433[_0x15fd('0x1f')][_0x15fd('0x2e')]&&_0x180433[_0x15fd('0x2f')]&&_0x180433[_0x15fd('0x2f')][_0x15fd('0xe')]){for(var _0x2eb6b6 in _0x180433[_0x15fd('0x1f')][_0x15fd('0x2e')]){if(_0x180433[_0x15fd('0x1f')][_0x15fd('0x2e')]['hasOwnProperty'](_0x2eb6b6)){db[_0x15fd('0x30')][_0x15fd('0x31')]({'where':{'channel':_0x2eb6b6,'membername':_0x180433[_0x15fd('0x2f')][_0x15fd('0xe')],'type':_0x15fd('0x32'),'exitAt':null,'uniqueid':_0x180433[_0x15fd('0x1f')][_0x15fd('0x2e')][_0x2eb6b6]&&_0x180433[_0x15fd('0x1f')]['interaction'][_0x2eb6b6]['length']?{'$notIn':_0x180433[_0x15fd('0x1f')]['interaction'][_0x2eb6b6]}:{'$ne':null}}})[_0x15fd('0x7')](function(_0x2741d4){var _0x5e4b62=moment()[_0x15fd('0x33')](_0x15fd('0x34'));for(var _0x131eb4=0x0,_0x2611ba=_0x2741d4[_0x15fd('0x35')];_0x131eb4<_0x2611ba;_0x131eb4+=0x1){_0x2741d4[_0x131eb4][_0x15fd('0x36')]({'exitAt':_0x5e4b62});}});for(var _0x494f83=0x0;_0x494f83<_0x180433[_0x15fd('0x1f')][_0x15fd('0x2e')][_0x2eb6b6][_0x15fd('0x35')];_0x494f83+=0x1){db[_0x15fd('0x30')][_0x15fd('0x37')]({'where':{'channel':_0x2eb6b6,'membername':_0x180433[_0x15fd('0x2f')][_0x15fd('0xe')],'type':_0x15fd('0x32'),'uniqueid':_0x180433[_0x15fd('0x1f')][_0x15fd('0x2e')][_0x2eb6b6][_0x494f83],'exitAt':null},'defaults':{'channel':_0x2eb6b6,'membername':_0x180433[_0x15fd('0x2f')][_0x15fd('0xe')],'interface':_['isNil'](_0x180433[_0x15fd('0x2f')]['interface'])?util[_0x15fd('0x33')](_0x15fd('0x38'),_0x180433[_0x15fd('0x2f')]['name']):_0x180433[_0x15fd('0x2f')][_0x15fd('0x39')],'type':_0x15fd('0x32'),'enterAt':moment()[_0x15fd('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x15fd('0x3a'),'internal':_0x180433[_0x15fd('0x2f')][_0x15fd('0x3b')],'uniqueid':_0x180433[_0x15fd('0x1f')]['interaction'][_0x2eb6b6][_0x494f83]}});}}}}return respondWithRpcPromise(_0x15fd('0x3c'),{'id':_0x180433[_0x15fd('0x1a')]['id'],'capacity':_0x180433['body']['capacity']},routingClient)['then'](respondWithResult(_0x304736,null))[_0x15fd('0xb')](handleError(_0x304736,null));};exports[_0x15fd('0x3d')]=function(_0x366c49,_0x10cf04){return respondWithRpcPromise(_0x15fd('0x3e'),_0x366c49[_0x15fd('0x14')])['then'](respondWithResult(_0x10cf04,null))[_0x15fd('0xb')](handleError(_0x10cf04,null));};exports[_0x15fd('0x3f')]=function(_0xbb16ef,_0x516b25){return respondWithRpcPromise(_0x15fd('0x40'),_0xbb16ef['query'])[_0x15fd('0x7')](respondWithResult(_0x516b25,null))[_0x15fd('0xb')](handleError(_0x516b25,null));};exports[_0x15fd('0x41')]=function(_0x42d4de,_0x332df7){return respondWithRpcPromise(_0x15fd('0x42'),_0x42d4de[_0x15fd('0x14')])[_0x15fd('0x7')](respondWithResult(_0x332df7,null))[_0x15fd('0xb')](handleError(_0x332df7,null));};exports[_0x15fd('0x43')]=function(_0x1491a3,_0x36eaf7){return respondWithRpcPromise(_0x15fd('0x44'),_0x1491a3['query'],routingClient)[_0x15fd('0x7')](respondWithResult(_0x36eaf7,null))['catch'](handleError(_0x36eaf7,null));};exports[_0x15fd('0x45')]=function(_0x509aef,_0x25bdea){return respondWithRpcPromise(_0x15fd('0x44'),_0x509aef[_0x15fd('0x14')],routingClient)['then'](findById(_0x509aef['params']['id']))[_0x15fd('0x7')](respondWithResult(_0x25bdea,null))[_0x15fd('0xb')](handleError(_0x25bdea,null));};exports[_0x15fd('0x46')]=function(_0x30ab06,_0x5d94b3){return respondWithRpcPromise(_0x15fd('0x47'),_0x30ab06[_0x15fd('0x14')],routingClient)[_0x15fd('0x7')](respondWithResult(_0x5d94b3,null))[_0x15fd('0xb')](handleError(_0x5d94b3,null));};exports[_0x15fd('0x48')]=function(_0x321fe7,_0x59b3b4){return respondWithRpcPromise(_0x15fd('0x47'),_0x321fe7[_0x15fd('0x14')],routingClient)[_0x15fd('0x7')](findById(_0x321fe7[_0x15fd('0x1a')]['id']))[_0x15fd('0x7')](respondWithResult(_0x59b3b4,null))[_0x15fd('0xb')](handleError(_0x59b3b4,null));};exports['mailAccounts']=function(_0x4f2a17,_0x149b20){return respondWithRpcPromise(_0x15fd('0x49'),_0x4f2a17['query'],mailClient)[_0x15fd('0x7')](respondWithResult(_0x149b20,null))[_0x15fd('0xb')](handleError(_0x149b20,null));};exports['openchannelQueues']=function(_0x285fd5,_0x4626ac){return respondWithRpcPromise(_0x15fd('0x4a'),_0x285fd5['query'],routingClient)[_0x15fd('0x7')](respondWithResult(_0x4626ac,null))[_0x15fd('0xb')](handleError(_0x4626ac,null));};exports[_0x15fd('0x4b')]=function(_0x2db860,_0xa206b){return respondWithRpcPromise(_0x15fd('0x4a'),_0x2db860[_0x15fd('0x14')],routingClient)[_0x15fd('0x7')](findById(_0x2db860[_0x15fd('0x1a')]['id']))[_0x15fd('0x7')](respondWithResult(_0xa206b,null))['catch'](handleError(_0xa206b,null));};exports[_0x15fd('0x4c')]=function(_0x3a26c8,_0x5b720b){return respondWithRpcPromise('SmsQueues',_0x3a26c8[_0x15fd('0x14')],routingClient)[_0x15fd('0x7')](respondWithResult(_0x5b720b,null))[_0x15fd('0xb')](handleError(_0x5b720b,null));};exports[_0x15fd('0x4d')]=function(_0x12fd6c,_0x1b6f59){return respondWithRpcPromise('SmsQueues',_0x12fd6c[_0x15fd('0x14')],routingClient)[_0x15fd('0x7')](findById(_0x12fd6c[_0x15fd('0x1a')]['id']))[_0x15fd('0x7')](respondWithResult(_0x1b6f59,null))[_0x15fd('0xb')](handleError(_0x1b6f59,null));};exports[_0x15fd('0x4e')]=function(_0xf27ab4,_0x1fe6cb){return respondWithRpcPromise(_0x15fd('0x4f'),_0xf27ab4[_0x15fd('0x14')],routingClient)[_0x15fd('0x7')](respondWithResult(_0x1fe6cb,null))['catch'](handleError(_0x1fe6cb,null));};exports['showWhatsappQueues']=function(_0x8a8198,_0x24ea9b){return respondWithRpcPromise(_0x15fd('0x4f'),_0x8a8198[_0x15fd('0x14')],routingClient)[_0x15fd('0x7')](findById(_0x8a8198[_0x15fd('0x1a')]['id']))[_0x15fd('0x7')](respondWithResult(_0x24ea9b,null))['catch'](handleError(_0x24ea9b,null));};exports[_0x15fd('0x50')]=function(_0x5de222,_0xc8931e){return respondWithRpcPromise('FaxQueues',_0x5de222[_0x15fd('0x14')],routingClient)['then'](respondWithResult(_0xc8931e,null))[_0x15fd('0xb')](handleError(_0xc8931e,null));};exports[_0x15fd('0x51')]=function(_0x4390bc,_0x3d40f3){return respondWithRpcPromise(_0x15fd('0x52'),_0x4390bc[_0x15fd('0x14')],routingClient)[_0x15fd('0x7')](findById(_0x4390bc[_0x15fd('0x1a')]['id']))[_0x15fd('0x7')](respondWithResult(_0x3d40f3,null))['catch'](handleError(_0x3d40f3,null));};exports['faxAccounts']=function(_0x1ca245,_0x239a06){return respondWithRpcPromise(_0x15fd('0x53'),_0x1ca245['query'])[_0x15fd('0x7')](respondWithResult(_0x239a06,null))[_0x15fd('0xb')](handleError(_0x239a06,null));};exports[_0x15fd('0x54')]=function(_0x56cf8c,_0x3bf85b){return respondWithRpcPromise(_0x15fd('0x55'),_0x56cf8c['query'],routingClient)[_0x15fd('0x7')](respondWithResult(_0x3bf85b,null))['catch'](handleError(_0x3bf85b,null));};exports[_0x15fd('0x56')]=function(_0x40a8e9,_0x74f311){return respondWithRpcPromise(_0x15fd('0x57'),_0x40a8e9[_0x15fd('0x14')],routingClient)['then'](respondWithResult(_0x74f311,null))[_0x15fd('0xb')](handleError(_0x74f311,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x3c4ffa,_0x4a165f){return respondWithRpcPromise(_0x15fd('0x58'),_0x3c4ffa[_0x15fd('0x14')],routingClient)['then'](respondWithResult(_0x4a165f,null))[_0x15fd('0xb')](handleError(_0x4a165f,null));};exports[_0x15fd('0x59')]=function(_0x47f39a,_0x484cd1){return respondWithRpcPromise(_0x15fd('0x58'),_0x47f39a['query'],routingClient)[_0x15fd('0x7')](function(_0x2feba1){if(_0x47f39a[_0x15fd('0x14')][_0x15fd('0x5a')]!==undefined){var _0x2d1c93=_(_0x2feba1['rows'])[_0x15fd('0x5b')]([_0x47f39a[_0x15fd('0x14')]['type'],_0x47f39a[_0x15fd('0x1a')]['id']])[_0x15fd('0x5c')](_0x15fd('0x5d'))[_0x15fd('0x5e')]()[_0x15fd('0x5f')]();return _0x2feba1[_0x15fd('0x12')][_0x15fd('0x5b')](function(_0x39b777){return _0x2d1c93[_0x15fd('0x60')](_0x39b777[_0x15fd('0x5d')])>-0x1;});}else{return _0x2feba1[_0x15fd('0x12')][_0x15fd('0x5b')](function(_0x273311){return _0x273311[_0x15fd('0x5d')]===parseInt(_0x47f39a['params']['id']);});}})[_0x15fd('0x7')](respondWithResult(_0x484cd1,null))['catch'](handleError(_0x484cd1,null));};exports[_0x15fd('0x61')]=function(_0x43d0b0,_0x3bfa0b){return respondWithRpcPromise(_0x15fd('0x62'),_0x43d0b0['query'],routingClient)[_0x15fd('0x7')](respondWithResult(_0x3bfa0b,null))[_0x15fd('0xb')](handleError(_0x3bfa0b,null));};exports[_0x15fd('0x63')]=function(_0x873778,_0x4accfd){return respondWithRpcPromise(_0x15fd('0x64'),_0x873778[_0x15fd('0x14')],routingClient)['then'](respondWithResult(_0x4accfd,null))[_0x15fd('0xb')](handleError(_0x4accfd,null));};exports[_0x15fd('0x65')]=function(_0x128ee3,_0x57089a){return respondWithRpcPromise(_0x15fd('0x66'),_0x128ee3[_0x15fd('0x14')],routingClient)[_0x15fd('0x7')](respondWithResult(_0x57089a,null))[_0x15fd('0xb')](handleError(_0x57089a,null));};exports[_0x15fd('0x67')]=function(_0x2d24a2){return function(_0x4e36c0,_0x2b7737){var _0x15a645,_0x32a2a0;var _0x3bd3fb=_[_0x15fd('0x68')](_0x2d24a2);var _0x55e9dd=_0x2d24a2===_0x15fd('0x69')?_0x15fd('0x6a'):_0x15fd('0x6b');return db[_0x3bd3fb+_0x15fd('0x6c')][_0x15fd('0x6d')]({'raw':!![],'where':{'id':_0x4e36c0['params']['id']}})['then'](function(_0x3017c6){if(_[_0x15fd('0x10')](_0x3017c6)){throw new Error(_0x3bd3fb+_0x15fd('0x6e'));}_0x15a645=_0x3017c6;return db[_0x3bd3fb+_0x15fd('0x6f')][_0x15fd('0x6d')]({'where':{'id':_0x4e36c0[_0x15fd('0x1f')][_0x15fd('0x70')]},'include':[{'model':db[_0x3bd3fb+_0x15fd('0x71')],'as':_0x15fd('0x71')},{'model':db[_0x3bd3fb+_0x55e9dd],'as':'Account'}]});})[_0x15fd('0x7')](function(_0x23d547){if(_['isNil'](_0x23d547)){throw new Error(_0x3bd3fb+_0x15fd('0x72'));}_0x32a2a0=_0x23d547;return _0x23d547[_0x15fd('0x73')]({'read':0x0,'readAt':null,'UserId':null});})[_0x15fd('0x7')](function(){var _0x35ad47={'uniqueid':_0x2d24a2+'.'+_0x32a2a0['id']+'.'+_0x32a2a0['Interaction']['id'],'FromUserId':_0x4e36c0[_0x15fd('0x2f')]['id'],'type':_0x15fd('0x74')};_0x35ad47[_0x3bd3fb+'MessageId']=_0x32a2a0['id'];_0x35ad47[_0x3bd3fb+_0x15fd('0x75')]=_0x32a2a0[_0x15fd('0x71')]['id'];_0x35ad47[_0x15fd('0x76')+_0x3bd3fb+_0x55e9dd+'Id']=_0x32a2a0['Account']['id'];_0x35ad47['To'+_0x3bd3fb+_0x15fd('0x77')]=_0x15a645['id'];return db[_0x3bd3fb+_0x15fd('0x78')][_0x15fd('0x79')](_0x35ad47);})[_0x15fd('0x7')](function(){return respondWithRpcPromise(_0x15fd('0x7a'),{'channel':_0x2d24a2,'interaction':_0x32a2a0[_0x15fd('0x71')],'message':_0x32a2a0,'account':_0x32a2a0[_0x15fd('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x15fd('0x74'),'appdata':_0x15a645['name']+','+(_0x32a2a0[_0x15fd('0x6b')][_0x15fd('0x7b')]||0x12c),'interval':_0x15fd('0x7c')}]},routingClient);})[_0x15fd('0x7')](respondWithResult(_0x2b7737,null))[_0x15fd('0xb')](handleError(_0x2b7737,null));};};exports[_0x15fd('0x7d')]=function(_0x3ebb13,_0x939bfd){var _0x3a4731,_0x264a98;if(_[_0x15fd('0x10')](_0x3ebb13[_0x15fd('0x1f')][_0x15fd('0x7e')])){throw new Error(_0x15fd('0x7f'));}var _0x4221df=_0x3ebb13[_0x15fd('0x1f')][_0x15fd('0x7e')];var _0x255dd5=_[_0x15fd('0x68')](_0x4221df);var _0x178dac=_0x4221df===_0x15fd('0x69')?_0x15fd('0x6a'):_0x15fd('0x6b');return db[_0x15fd('0x80')][_0x15fd('0x6d')]({'raw':!![],'where':{'id':_0x3ebb13[_0x15fd('0x1a')]['id'],'role':'agent'}})[_0x15fd('0x7')](function(_0x39e232){if(_['isNil'](_0x39e232)){throw new Error(_0x15fd('0x81'));}_0x3a4731=_0x39e232;return db[_0x255dd5+_0x15fd('0x6f')][_0x15fd('0x6d')]({'where':{'id':_0x3ebb13[_0x15fd('0x1f')]['messageId']},'include':[{'model':db[_0x255dd5+'Interaction'],'as':_0x15fd('0x71')},{'model':db[_0x255dd5+_0x178dac],'as':'Account'}]});})[_0x15fd('0x7')](function(_0x3e47fe){if(_[_0x15fd('0x10')](_0x3e47fe)){throw new Error(_0x255dd5+_0x15fd('0x72'));}_0x264a98=_0x3e47fe;return _0x3e47fe[_0x15fd('0x73')]({'read':0x0,'readAt':null,'UserId':null});})[_0x15fd('0x7')](function(){var _0x1bd38c={'uniqueid':_0x4221df+'.'+_0x264a98['id']+'.'+_0x264a98['Interaction']['id'],'FromUserId':_0x3ebb13['user']['id'],'type':_0x15fd('0x74'),'ToUserId':_0x3a4731['id']};_0x1bd38c[_0x255dd5+_0x15fd('0x82')]=_0x264a98['id'];_0x1bd38c[_0x255dd5+_0x15fd('0x75')]=_0x264a98[_0x15fd('0x71')]['id'];_0x1bd38c[_0x15fd('0x76')+_0x255dd5+_0x178dac+'Id']=_0x264a98[_0x15fd('0x6b')]['id'];return db[_0x255dd5+'TransferReport']['create'](_0x1bd38c);})[_0x15fd('0x7')](function(){return respondWithRpcPromise(_0x15fd('0x7a'),{'channel':_0x4221df,'interaction':_0x264a98[_0x15fd('0x71')],'message':_0x264a98,'account':_0x264a98[_0x15fd('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x15fd('0x3a'),'appdata':_0x3a4731[_0x15fd('0xe')]+','+(_0x264a98['Account'][_0x15fd('0x83')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x15fd('0x7')](respondWithResult(_0x939bfd,null))[_0x15fd('0xb')](handleError(_0x939bfd,null));};
\ No newline at end of file
+var _0xb138=['telephones','Telephones','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','update','queue','MessageId','InteractionId','From','QueueId','create','Start','queueTransferTimeout','*,*,*,*','Channel\x20field\x20is\x20mandatory','channel','capitalize','User','agent','Agent\x20not\x20found','Message','\x20Message\x20not\x20found','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','error','code','message','result','catch','json','sendStatus','stack','name','status','isNil','rows','find','VoiceChannels','query','then','VoiceChannelMixMonitor','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','OutboundChannels','Agents','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','INTERACTION','SIP/%s','interface','internal','AgentCapacity','capacity'];(function(_0x17dc34,_0x16c295){var _0x92fc94=function(_0xf01386){while(--_0xf01386){_0x17dc34['push'](_0x17dc34['shift']());}};_0x92fc94(++_0x16c295);}(_0xb138,0x1dd));var _0x8b13=function(_0x6d5080,_0x2bdca0){_0x6d5080=_0x6d5080-0x0;var _0x42091b=_0xb138[_0x6d5080];return _0x42091b;};'use strict';var BPromise=require(_0x8b13('0x0'));var moment=require(_0x8b13('0x1'));var _=require(_0x8b13('0x2'));var util=require(_0x8b13('0x3'));var db=require(_0x8b13('0x4'))['db'];var logger=require(_0x8b13('0x5'))(_0x8b13('0x6'));var jayson=require('jayson/promise');var amiClient=jayson[_0x8b13('0x7')][_0x8b13('0x8')]({'port':0x232a});var mailClient=jayson[_0x8b13('0x7')]['http']({'port':0x232b});var routingClient=jayson[_0x8b13('0x7')][_0x8b13('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x5d51b1,_0x3fdf4d,_0x33d1a7){return new BPromise(function(_0x22e157,_0x498832){var _0x8570b0=_0x33d1a7?_0x33d1a7:amiClient;return _0x8570b0[_0x8b13('0x9')](_0x5d51b1,_0x3fdf4d)['then'](function(_0x53ae50){if(_0x53ae50[_0x8b13('0xa')]){if(_0x53ae50[_0x8b13('0xa')][_0x8b13('0xb')]===0x1f4){return _0x498832(_0x53ae50[_0x8b13('0xa')][_0x8b13('0xc')]);}return _0x22e157(_0x53ae50['error'][_0x8b13('0xc')]);}else{_0x22e157(_0x53ae50[_0x8b13('0xd')]);}})[_0x8b13('0xe')](function(_0x3f79d5){_0x498832(_0x3f79d5);});});}function respondWithResult(_0xb227e0,_0x1893b1){_0x1893b1=_0x1893b1||0xc8;return function(_0x58f97e){if(_0x58f97e){return _0xb227e0['status'](_0x1893b1)[_0x8b13('0xf')](_0x58f97e);}return _0xb227e0[_0x8b13('0x10')](0x194);};}function handleError(_0x5f12b5,_0x51a935){_0x51a935=_0x51a935||0x1f4;return function(_0x479773){logger[_0x8b13('0xa')](_0x479773[_0x8b13('0x11')]);if(_0x479773[_0x8b13('0x12')]){delete _0x479773[_0x8b13('0x12')];}_0x5f12b5[_0x8b13('0x13')](_0x51a935)['send'](_0x479773);};}function findById(_0x1c6c99){return function(_0xea7881){if(!_[_0x8b13('0x14')](_0x1c6c99)&&!_[_0x8b13('0x14')](_0xea7881)&&!_[_0x8b13('0x14')](_0xea7881[_0x8b13('0x15')])){return _[_0x8b13('0x16')](_0xea7881[_0x8b13('0x15')],function(_0x4989d3){return _0x4989d3['id']==_0x1c6c99;});}return null;};}exports['voiceChannels']=function(_0xae4966,_0x335709){return respondWithRpcPromise(_0x8b13('0x17'),_0xae4966[_0x8b13('0x18')])[_0x8b13('0x19')](respondWithResult(_0x335709,null))[_0x8b13('0xe')](handleError(_0x335709,null));};exports['voiceChannelMixMonitor']=function(_0x1e8a48,_0x3c4d4f){return respondWithRpcPromise(_0x8b13('0x1a'),_['merge'](_0x1e8a48['query'],_0x1e8a48[_0x8b13('0x1b')]))[_0x8b13('0x19')](respondWithResult(_0x3c4d4f,null))['catch'](handleError(_0x3c4d4f,null));};exports[_0x8b13('0x1c')]=function(_0x2c3afb,_0x37ca5f){return respondWithRpcPromise(_0x8b13('0x1d'),_[_0x8b13('0x1e')](_0x2c3afb['query'],_0x2c3afb[_0x8b13('0x1b')]))[_0x8b13('0x19')](respondWithResult(_0x37ca5f,null))['catch'](handleError(_0x37ca5f,null));};exports[_0x8b13('0x1f')]=function(_0x4fdd1c,_0x420772){return respondWithRpcPromise(_0x8b13('0x20'),_0x4fdd1c['query'])[_0x8b13('0x19')](respondWithResult(_0x420772,null))[_0x8b13('0xe')](handleError(_0x420772,null));};exports['showVoiceQueues']=function(_0x134c5e,_0x14a739){return respondWithRpcPromise(_0x8b13('0x20'),_0x134c5e[_0x8b13('0x18')])[_0x8b13('0x19')](findById(_0x134c5e['params']['id']))[_0x8b13('0x19')](respondWithResult(_0x14a739,null))[_0x8b13('0xe')](handleError(_0x14a739,null));};exports[_0x8b13('0x21')]=function(_0x1511bf,_0x114b01){return respondWithRpcPromise(_0x8b13('0x22'),_['merge'](_0x1511bf[_0x8b13('0x23')],_0x1511bf[_0x8b13('0x1b')]))[_0x8b13('0x19')](respondWithResult(_0x114b01,null))[_0x8b13('0xe')](handleError(_0x114b01,null));};exports[_0x8b13('0x24')]=function(_0x29946e,_0x3304bd){return respondWithRpcPromise(_0x8b13('0x25'),_[_0x8b13('0x1e')](_0x29946e['query'],_0x29946e[_0x8b13('0x1b')]))[_0x8b13('0x19')](respondWithResult(_0x3304bd,null))[_0x8b13('0xe')](handleError(_0x3304bd,null));};exports[_0x8b13('0x26')]=function(_0x51a334,_0x4f7d91){return respondWithRpcPromise(_0x8b13('0x27'),_0x51a334['query'])['then'](respondWithResult(_0x4f7d91,null))[_0x8b13('0xe')](handleError(_0x4f7d91,null));};exports['voiceQueuesChannel']=function(_0x2ec1ab,_0x408626){return respondWithRpcPromise(_0x8b13('0x28'),_[_0x8b13('0x1e')](_0x2ec1ab[_0x8b13('0x18')],_0x2ec1ab[_0x8b13('0x1b')]))[_0x8b13('0x19')](respondWithResult(_0x408626,null))[_0x8b13('0xe')](handleError(_0x408626,null));};exports[_0x8b13('0x29')]=function(_0x1b313d,_0x4d45bc){return respondWithRpcPromise(_0x8b13('0x2a'),_[_0x8b13('0x1e')](_0x1b313d[_0x8b13('0x18')],_0x1b313d[_0x8b13('0x1b')]))[_0x8b13('0x19')](respondWithResult(_0x4d45bc,null))[_0x8b13('0xe')](handleError(_0x4d45bc,null));};exports[_0x8b13('0x2b')]=function(_0x241687,_0x5c67b1){return respondWithRpcPromise(_0x8b13('0x2c'),_['merge'](_0x241687[_0x8b13('0x18')],_0x241687[_0x8b13('0x1b')]))[_0x8b13('0x19')](respondWithResult(_0x5c67b1,null))[_0x8b13('0xe')](handleError(_0x5c67b1,null));};exports[_0x8b13('0x2d')]=function(_0x327eb1,_0x4ec1a5){return respondWithRpcPromise('Outbound',_0x327eb1[_0x8b13('0x18')])['then'](respondWithResult(_0x4ec1a5,null))[_0x8b13('0xe')](handleError(_0x4ec1a5,null));};exports['outboundChannels']=function(_0x590a23,_0x3a8e06){return respondWithRpcPromise(_0x8b13('0x2e'),_0x590a23[_0x8b13('0x18')])[_0x8b13('0x19')](respondWithResult(_0x3a8e06,null))['catch'](handleError(_0x3a8e06,null));};exports['agents']=function(_0x230a8c,_0x595d8d){var _0x6ba2f3;return respondWithRpcPromise(_0x8b13('0x2f'),_0x230a8c['query'])[_0x8b13('0x19')](function(_0x41d710){_0x6ba2f3=_0x41d710;return respondWithRpcPromise(_0x8b13('0x2f'),_0x230a8c[_0x8b13('0x18')],routingClient);})[_0x8b13('0x19')](function(_0x38ec75){return _[_0x8b13('0x1e')]({},_0x38ec75,_0x6ba2f3);})['then'](respondWithResult(_0x595d8d,null))['catch'](handleError(_0x595d8d,null));};exports['agentCapacity']=function(_0x3eb3c5,_0x16ec3){if(_0x3eb3c5[_0x8b13('0x23')]&&_0x3eb3c5[_0x8b13('0x23')][_0x8b13('0x30')]&&_0x3eb3c5[_0x8b13('0x31')]&&_0x3eb3c5['user'][_0x8b13('0x12')]){for(var _0x50e535 in _0x3eb3c5[_0x8b13('0x23')]['interaction']){if(_0x3eb3c5[_0x8b13('0x23')][_0x8b13('0x30')][_0x8b13('0x32')](_0x50e535)){db[_0x8b13('0x33')][_0x8b13('0x34')]({'where':{'channel':_0x50e535,'membername':_0x3eb3c5[_0x8b13('0x31')][_0x8b13('0x12')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x3eb3c5['body']['interaction'][_0x50e535]&&_0x3eb3c5[_0x8b13('0x23')][_0x8b13('0x30')][_0x50e535][_0x8b13('0x35')]?{'$notIn':_0x3eb3c5[_0x8b13('0x23')]['interaction'][_0x50e535]}:{'$ne':null}}})['then'](function(_0x3f420d){var _0x54d19d=moment()[_0x8b13('0x36')](_0x8b13('0x37'));for(var _0x20c363=0x0,_0x28ae75=_0x3f420d[_0x8b13('0x35')];_0x20c363<_0x28ae75;_0x20c363+=0x1){_0x3f420d[_0x20c363]['updateAttributes']({'exitAt':_0x54d19d});}});for(var _0x2df766=0x0;_0x2df766<_0x3eb3c5[_0x8b13('0x23')][_0x8b13('0x30')][_0x50e535][_0x8b13('0x35')];_0x2df766+=0x1){db[_0x8b13('0x33')][_0x8b13('0x38')]({'where':{'channel':_0x50e535,'membername':_0x3eb3c5[_0x8b13('0x31')][_0x8b13('0x12')],'type':_0x8b13('0x39'),'uniqueid':_0x3eb3c5['body'][_0x8b13('0x30')][_0x50e535][_0x2df766],'exitAt':null},'defaults':{'channel':_0x50e535,'membername':_0x3eb3c5['user'][_0x8b13('0x12')],'interface':_[_0x8b13('0x14')](_0x3eb3c5[_0x8b13('0x31')]['interface'])?util[_0x8b13('0x36')](_0x8b13('0x3a'),_0x3eb3c5[_0x8b13('0x31')][_0x8b13('0x12')]):_0x3eb3c5[_0x8b13('0x31')][_0x8b13('0x3b')],'type':_0x8b13('0x39'),'enterAt':moment()['format'](_0x8b13('0x37')),'role':'agent','internal':_0x3eb3c5[_0x8b13('0x31')][_0x8b13('0x3c')],'uniqueid':_0x3eb3c5[_0x8b13('0x23')][_0x8b13('0x30')][_0x50e535][_0x2df766]}});}}}}return respondWithRpcPromise(_0x8b13('0x3d'),{'id':_0x3eb3c5[_0x8b13('0x1b')]['id'],'capacity':_0x3eb3c5[_0x8b13('0x23')][_0x8b13('0x3e')]},routingClient)[_0x8b13('0x19')](respondWithResult(_0x16ec3,null))[_0x8b13('0xe')](handleError(_0x16ec3,null));};exports[_0x8b13('0x3f')]=function(_0xddac8e,_0xd55f3b){return respondWithRpcPromise(_0x8b13('0x40'),_0xddac8e[_0x8b13('0x18')])[_0x8b13('0x19')](respondWithResult(_0xd55f3b,null))[_0x8b13('0xe')](handleError(_0xd55f3b,null));};exports['trunks']=function(_0x1699c6,_0x20e89c){return respondWithRpcPromise('Trunks',_0x1699c6[_0x8b13('0x18')])[_0x8b13('0x19')](respondWithResult(_0x20e89c,null))[_0x8b13('0xe')](handleError(_0x20e89c,null));};exports[_0x8b13('0x41')]=function(_0x25cb45,_0x12549b){return respondWithRpcPromise(_0x8b13('0x42'),_0x25cb45[_0x8b13('0x18')])[_0x8b13('0x19')](respondWithResult(_0x12549b,null))[_0x8b13('0xe')](handleError(_0x12549b,null));};exports[_0x8b13('0x43')]=function(_0x450b47,_0x137e8c){return respondWithRpcPromise(_0x8b13('0x44'),_0x450b47[_0x8b13('0x18')],routingClient)['then'](respondWithResult(_0x137e8c,null))[_0x8b13('0xe')](handleError(_0x137e8c,null));};exports[_0x8b13('0x45')]=function(_0x47a3fa,_0x11e8af){return respondWithRpcPromise(_0x8b13('0x44'),_0x47a3fa[_0x8b13('0x18')],routingClient)[_0x8b13('0x19')](findById(_0x47a3fa[_0x8b13('0x1b')]['id']))['then'](respondWithResult(_0x11e8af,null))[_0x8b13('0xe')](handleError(_0x11e8af,null));};exports[_0x8b13('0x46')]=function(_0x46850a,_0x52e2a6){return respondWithRpcPromise(_0x8b13('0x47'),_0x46850a[_0x8b13('0x18')],routingClient)['then'](respondWithResult(_0x52e2a6,null))[_0x8b13('0xe')](handleError(_0x52e2a6,null));};exports[_0x8b13('0x48')]=function(_0x475c8d,_0xd29067){return respondWithRpcPromise('MailQueues',_0x475c8d[_0x8b13('0x18')],routingClient)[_0x8b13('0x19')](findById(_0x475c8d['params']['id']))[_0x8b13('0x19')](respondWithResult(_0xd29067,null))[_0x8b13('0xe')](handleError(_0xd29067,null));};exports[_0x8b13('0x49')]=function(_0x23a63c,_0x5d05cb){return respondWithRpcPromise(_0x8b13('0x4a'),_0x23a63c[_0x8b13('0x18')],mailClient)[_0x8b13('0x19')](respondWithResult(_0x5d05cb,null))[_0x8b13('0xe')](handleError(_0x5d05cb,null));};exports[_0x8b13('0x4b')]=function(_0x2fff4e,_0x571e89){return respondWithRpcPromise(_0x8b13('0x4c'),_0x2fff4e[_0x8b13('0x18')],routingClient)[_0x8b13('0x19')](respondWithResult(_0x571e89,null))['catch'](handleError(_0x571e89,null));};exports[_0x8b13('0x4d')]=function(_0x576c91,_0x122ea2){return respondWithRpcPromise(_0x8b13('0x4c'),_0x576c91['query'],routingClient)['then'](findById(_0x576c91['params']['id']))['then'](respondWithResult(_0x122ea2,null))['catch'](handleError(_0x122ea2,null));};exports[_0x8b13('0x4e')]=function(_0x1bc936,_0x574f98){return respondWithRpcPromise(_0x8b13('0x4f'),_0x1bc936['query'],routingClient)[_0x8b13('0x19')](respondWithResult(_0x574f98,null))[_0x8b13('0xe')](handleError(_0x574f98,null));};exports[_0x8b13('0x50')]=function(_0x22c4d4,_0x43f12a){return respondWithRpcPromise(_0x8b13('0x4f'),_0x22c4d4[_0x8b13('0x18')],routingClient)['then'](findById(_0x22c4d4[_0x8b13('0x1b')]['id']))['then'](respondWithResult(_0x43f12a,null))[_0x8b13('0xe')](handleError(_0x43f12a,null));};exports[_0x8b13('0x51')]=function(_0x207a54,_0x11a4ba){return respondWithRpcPromise(_0x8b13('0x52'),_0x207a54[_0x8b13('0x18')],routingClient)[_0x8b13('0x19')](respondWithResult(_0x11a4ba,null))['catch'](handleError(_0x11a4ba,null));};exports[_0x8b13('0x53')]=function(_0x5d1174,_0x2b109c){return respondWithRpcPromise(_0x8b13('0x52'),_0x5d1174[_0x8b13('0x18')],routingClient)[_0x8b13('0x19')](findById(_0x5d1174[_0x8b13('0x1b')]['id']))['then'](respondWithResult(_0x2b109c,null))['catch'](handleError(_0x2b109c,null));};exports[_0x8b13('0x54')]=function(_0x37a243,_0x5ccf4e){return respondWithRpcPromise(_0x8b13('0x55'),_0x37a243[_0x8b13('0x18')],routingClient)[_0x8b13('0x19')](respondWithResult(_0x5ccf4e,null))['catch'](handleError(_0x5ccf4e,null));};exports[_0x8b13('0x56')]=function(_0x215a8a,_0x15ce51){return respondWithRpcPromise(_0x8b13('0x55'),_0x215a8a['query'],routingClient)[_0x8b13('0x19')](findById(_0x215a8a[_0x8b13('0x1b')]['id']))['then'](respondWithResult(_0x15ce51,null))[_0x8b13('0xe')](handleError(_0x15ce51,null));};exports[_0x8b13('0x57')]=function(_0x69e237,_0x3734e7){return respondWithRpcPromise(_0x8b13('0x58'),_0x69e237[_0x8b13('0x18')])[_0x8b13('0x19')](respondWithResult(_0x3734e7,null))[_0x8b13('0xe')](handleError(_0x3734e7,null));};exports[_0x8b13('0x59')]=function(_0x2cace0,_0x2f2bc5){return respondWithRpcPromise(_0x8b13('0x5a'),_0x2cace0[_0x8b13('0x18')],routingClient)[_0x8b13('0x19')](respondWithResult(_0x2f2bc5,null))['catch'](handleError(_0x2f2bc5,null));};exports[_0x8b13('0x5b')]=function(_0x578469,_0x14dee4){return respondWithRpcPromise(_0x8b13('0x5c'),_0x578469[_0x8b13('0x18')],routingClient)[_0x8b13('0x19')](respondWithResult(_0x14dee4,null))['catch'](handleError(_0x14dee4,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x27ad64,_0x2236b5){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x27ad64[_0x8b13('0x18')],routingClient)[_0x8b13('0x19')](respondWithResult(_0x2236b5,null))[_0x8b13('0xe')](handleError(_0x2236b5,null));};exports[_0x8b13('0x5d')]=function(_0x7499cb,_0x12aa48){return respondWithRpcPromise(_0x8b13('0x5e'),_0x7499cb[_0x8b13('0x18')],routingClient)[_0x8b13('0x19')](function(_0x24211c){if(_0x7499cb['query'][_0x8b13('0x5f')]!==undefined){var _0x2e7477=_(_0x24211c['rows'])[_0x8b13('0x60')]([_0x7499cb[_0x8b13('0x18')]['type'],_0x7499cb[_0x8b13('0x1b')]['id']])[_0x8b13('0x61')](_0x8b13('0x62'))[_0x8b13('0x63')]()[_0x8b13('0x64')]();return _0x24211c[_0x8b13('0x15')][_0x8b13('0x60')](function(_0x1fde8b){return _0x2e7477['indexOf'](_0x1fde8b[_0x8b13('0x62')])>-0x1;});}else{return _0x24211c[_0x8b13('0x15')][_0x8b13('0x60')](function(_0x5e2b4c){return _0x5e2b4c[_0x8b13('0x62')]===parseInt(_0x7499cb['params']['id']);});}})[_0x8b13('0x19')](respondWithResult(_0x12aa48,null))[_0x8b13('0xe')](handleError(_0x12aa48,null));};exports[_0x8b13('0x65')]=function(_0x40fefa,_0xc74525){return respondWithRpcPromise(_0x8b13('0x66'),_0x40fefa[_0x8b13('0x18')],routingClient)[_0x8b13('0x19')](respondWithResult(_0xc74525,null))[_0x8b13('0xe')](handleError(_0xc74525,null));};exports[_0x8b13('0x67')]=function(_0x595f45,_0x3dc732){return respondWithRpcPromise(_0x8b13('0x68'),_0x595f45[_0x8b13('0x18')],routingClient)[_0x8b13('0x19')](respondWithResult(_0x3dc732,null))[_0x8b13('0xe')](handleError(_0x3dc732,null));};exports[_0x8b13('0x69')]=function(_0x2c69f5,_0x9173d){return respondWithRpcPromise(_0x8b13('0x6a'),_0x2c69f5[_0x8b13('0x18')],routingClient)[_0x8b13('0x19')](respondWithResult(_0x9173d,null))[_0x8b13('0xe')](handleError(_0x9173d,null));};exports[_0x8b13('0x6b')]=function(_0x4bb71a){return function(_0x491bf8,_0x3870a9){var _0x512f30,_0x22e10a;var _0x38a1de=_['capitalize'](_0x4bb71a);var _0x5319a1=_0x4bb71a===_0x8b13('0x6c')?_0x8b13('0x6d'):_0x8b13('0x6e');return db[_0x38a1de+_0x8b13('0x6f')][_0x8b13('0x70')]({'raw':!![],'where':{'id':_0x491bf8['params']['id']}})[_0x8b13('0x19')](function(_0x5152d0){if(_[_0x8b13('0x14')](_0x5152d0)){throw new Error(_0x38a1de+_0x8b13('0x71'));}_0x512f30=_0x5152d0;return db[_0x38a1de+'Message'][_0x8b13('0x70')]({'where':{'id':_0x491bf8[_0x8b13('0x23')][_0x8b13('0x72')]},'include':[{'model':db[_0x38a1de+_0x8b13('0x73')],'as':_0x8b13('0x73')},{'model':db[_0x38a1de+_0x5319a1],'as':'Account'}]});})[_0x8b13('0x19')](function(_0x202c12){if(_[_0x8b13('0x14')](_0x202c12)){throw new Error(_0x38a1de+'\x20Message\x20not\x20found');}_0x22e10a=_0x202c12;return _0x202c12[_0x8b13('0x74')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x3bfb06={'uniqueid':_0x4bb71a+'.'+_0x22e10a['id']+'.'+_0x22e10a[_0x8b13('0x73')]['id'],'FromUserId':_0x491bf8[_0x8b13('0x31')]['id'],'type':_0x8b13('0x75')};_0x3bfb06[_0x38a1de+_0x8b13('0x76')]=_0x22e10a['id'];_0x3bfb06[_0x38a1de+_0x8b13('0x77')]=_0x22e10a[_0x8b13('0x73')]['id'];_0x3bfb06[_0x8b13('0x78')+_0x38a1de+_0x5319a1+'Id']=_0x22e10a[_0x8b13('0x6e')]['id'];_0x3bfb06['To'+_0x38a1de+_0x8b13('0x79')]=_0x512f30['id'];return db[_0x38a1de+'TransferReport'][_0x8b13('0x7a')](_0x3bfb06);})[_0x8b13('0x19')](function(){return respondWithRpcPromise(_0x8b13('0x7b'),{'channel':_0x4bb71a,'interaction':_0x22e10a[_0x8b13('0x73')],'message':_0x22e10a,'account':_0x22e10a[_0x8b13('0x6e')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x512f30[_0x8b13('0x12')]+','+(_0x22e10a[_0x8b13('0x6e')][_0x8b13('0x7c')]||0x12c),'interval':_0x8b13('0x7d')}]},routingClient);})[_0x8b13('0x19')](respondWithResult(_0x3870a9,null))[_0x8b13('0xe')](handleError(_0x3870a9,null));};};exports['agentNotify']=function(_0x24005e,_0xd2b08b){var _0x556a92,_0x1b3a1b;if(_['isNil'](_0x24005e[_0x8b13('0x23')]['channel'])){throw new Error(_0x8b13('0x7e'));}var _0x291a30=_0x24005e[_0x8b13('0x23')][_0x8b13('0x7f')];var _0x13a7ea=_[_0x8b13('0x80')](_0x291a30);var _0x165813=_0x291a30===_0x8b13('0x6c')?'Website':_0x8b13('0x6e');return db[_0x8b13('0x81')]['findOne']({'raw':!![],'where':{'id':_0x24005e[_0x8b13('0x1b')]['id'],'role':_0x8b13('0x82')}})['then'](function(_0xa97f27){if(_[_0x8b13('0x14')](_0xa97f27)){throw new Error(_0x8b13('0x83'));}_0x556a92=_0xa97f27;return db[_0x13a7ea+_0x8b13('0x84')][_0x8b13('0x70')]({'where':{'id':_0x24005e['body']['messageId']},'include':[{'model':db[_0x13a7ea+_0x8b13('0x73')],'as':_0x8b13('0x73')},{'model':db[_0x13a7ea+_0x165813],'as':_0x8b13('0x6e')}]});})[_0x8b13('0x19')](function(_0xcafeff){if(_[_0x8b13('0x14')](_0xcafeff)){throw new Error(_0x13a7ea+_0x8b13('0x85'));}_0x1b3a1b=_0xcafeff;return _0xcafeff[_0x8b13('0x74')]({'read':0x0,'readAt':null,'UserId':null});})[_0x8b13('0x19')](function(){var _0xfac180={'uniqueid':_0x291a30+'.'+_0x1b3a1b['id']+'.'+_0x1b3a1b[_0x8b13('0x73')]['id'],'FromUserId':_0x24005e[_0x8b13('0x31')]['id'],'type':_0x8b13('0x75'),'ToUserId':_0x556a92['id']};_0xfac180[_0x13a7ea+_0x8b13('0x76')]=_0x1b3a1b['id'];_0xfac180[_0x13a7ea+_0x8b13('0x77')]=_0x1b3a1b[_0x8b13('0x73')]['id'];_0xfac180['From'+_0x13a7ea+_0x165813+'Id']=_0x1b3a1b[_0x8b13('0x6e')]['id'];return db[_0x13a7ea+'TransferReport'][_0x8b13('0x7a')](_0xfac180);})[_0x8b13('0x19')](function(){return respondWithRpcPromise(_0x8b13('0x7b'),{'channel':_0x291a30,'interaction':_0x1b3a1b[_0x8b13('0x73')],'message':_0x1b3a1b,'account':_0x1b3a1b[_0x8b13('0x6e')],'applications':[{'id':0x0,'priority':0x1,'app':_0x8b13('0x82'),'appdata':_0x556a92[_0x8b13('0x12')]+','+(_0x1b3a1b['Account'][_0x8b13('0x86')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x8b13('0x19')](respondWithResult(_0xd2b08b,null))[_0x8b13('0xe')](handleError(_0xd2b08b,null));};
\ No newline at end of file
index 890825f..8887199 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e77=['put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id/run','run','post','create'];(function(_0x857c02,_0x3cc0b3){var _0x5bbbab=function(_0x4c7733){while(--_0x4c7733){_0x857c02['push'](_0x857c02['shift']());}};_0x5bbbab(++_0x3cc0b3);}(_0x6e77,0xf8));var _0x76e7=function(_0x316e2b,_0x40efd7){_0x316e2b=_0x316e2b-0x0;var _0x2e4809=_0x6e77[_0x316e2b];return _0x2e4809;};'use strict';var multer=require(_0x76e7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x76e7('0x1'));var express=require(_0x76e7('0x2'));var router=express[_0x76e7('0x3')]();var fs_extra=require(_0x76e7('0x4'));var auth=require(_0x76e7('0x5'));var interaction=require(_0x76e7('0x6'));var config=require(_0x76e7('0x7'));var controller=require(_0x76e7('0x8'));router[_0x76e7('0x9')]('/',auth[_0x76e7('0xa')](),controller[_0x76e7('0xb')]);router[_0x76e7('0x9')]('/:id',auth[_0x76e7('0xa')](),controller['show']);router['get'](_0x76e7('0xc'),auth[_0x76e7('0xa')](),controller[_0x76e7('0xd')]);router[_0x76e7('0xe')]('/',auth[_0x76e7('0xa')](),controller[_0x76e7('0xf')]);router[_0x76e7('0x10')](_0x76e7('0x11'),auth[_0x76e7('0xa')](),controller[_0x76e7('0x12')]);router[_0x76e7('0x13')](_0x76e7('0x11'),auth['isAuthenticated'](),controller[_0x76e7('0x14')]);module[_0x76e7('0x15')]=router;
\ No newline at end of file
+var _0x9859=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/run','run','create','put'];(function(_0x5e068e,_0x28ff2e){var _0x329514=function(_0x1c9815){while(--_0x1c9815){_0x5e068e['push'](_0x5e068e['shift']());}};_0x329514(++_0x28ff2e);}(_0x9859,0x68));var _0x9985=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x9859[_0x19b3f9];return _0x18c3f6;};'use strict';var multer=require('multer');var util=require(_0x9985('0x0'));var path=require(_0x9985('0x1'));var timeout=require(_0x9985('0x2'));var express=require(_0x9985('0x3'));var router=express[_0x9985('0x4')]();var fs_extra=require(_0x9985('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9985('0x6'));var config=require(_0x9985('0x7'));var controller=require('./schedule.controller');router[_0x9985('0x8')]('/',auth[_0x9985('0x9')](),controller[_0x9985('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9985('0xb')]);router['get'](_0x9985('0xc'),auth[_0x9985('0x9')](),controller[_0x9985('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9985('0xe')]);router[_0x9985('0xf')](_0x9985('0x10'),auth['isAuthenticated'](),controller[_0x9985('0x11')]);router[_0x9985('0x12')](_0x9985('0x10'),auth[_0x9985('0x9')](),controller['destroy']);module[_0x9985('0x13')]=router;
\ No newline at end of file
index ac0a16c..6bd019d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1623=['INTEGER','years','quarters','months','weeks','days','hours','minutes','ENUM','pdf','xlsx','csv','default','STRING','TEXT','BOOLEAN','sequelize','exports','0\x200\x20*\x20*\x20*','DATE'];(function(_0x12c27a,_0x22de6a){var _0x4f0608=function(_0x5be139){while(--_0x5be139){_0x12c27a['push'](_0x12c27a['shift']());}};_0x4f0608(++_0x22de6a);}(_0x1623,0x1a0));var _0x3162=function(_0x18c81b,_0x86e365){_0x18c81b=_0x18c81b-0x0;var _0x15ce74=_0x1623[_0x18c81b];return _0x15ce74;};'use strict';var Sequelize=require(_0x3162('0x0'));module[_0x3162('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3162('0x2')},'startAt':{'type':Sequelize[_0x3162('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x3162('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x3162('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x3162('0x5'),_0x3162('0x6'),_0x3162('0x7'),_0x3162('0x8'),_0x3162('0x9'),_0x3162('0xa'),_0x3162('0xb')),'allowNull':![],'defaultValue':_0x3162('0x9')},'output':{'type':Sequelize[_0x3162('0xc')]('csv',_0x3162('0xd'),_0x3162('0xe')),'allowNull':![],'defaultValue':_0x3162('0xf')},'type':{'type':Sequelize[_0x3162('0xc')]('custom',_0x3162('0x10')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x3162('0x11')]},'cc':{'type':Sequelize[_0x3162('0x12')]},'bcc':{'type':Sequelize[_0x3162('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x3162('0x13')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x6462=['DATE','INTEGER','years','months','days','hours','minutes','ENUM','csv','xlsx','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*'];(function(_0x1f6a3c,_0x55352a){var _0x1d4a50=function(_0x2aab02){while(--_0x2aab02){_0x1f6a3c['push'](_0x1f6a3c['shift']());}};_0x1d4a50(++_0x55352a);}(_0x6462,0xfb));var _0x2646=function(_0x3b6648,_0x2d723a){_0x3b6648=_0x3b6648-0x0;var _0x5a0a0d=_0x6462[_0x3b6648];return _0x5a0a0d;};'use strict';var Sequelize=require(_0x2646('0x0'));module[_0x2646('0x1')]={'name':{'type':Sequelize[_0x2646('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2646('0x2')]},'active':{'type':Sequelize[_0x2646('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x2646('0x2')],'allowNull':![],'defaultValue':_0x2646('0x4')},'startAt':{'type':Sequelize[_0x2646('0x5')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x2646('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x2646('0x7'),'quarters',_0x2646('0x8'),'weeks',_0x2646('0x9'),_0x2646('0xa'),_0x2646('0xb')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x2646('0xc')](_0x2646('0xd'),'pdf',_0x2646('0xe')),'allowNull':![],'defaultValue':_0x2646('0xd')},'type':{'type':Sequelize[_0x2646('0xc')]('custom','default'),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x2646('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x2646('0x2')]},'cc':{'type':Sequelize[_0x2646('0xf')]},'bcc':{'type':Sequelize[_0x2646('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x2646('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index 54a67c4..bb5b9ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x450e=['undefined','limit','count','set','Content-Range','apply','reject','destroy','then','get','Scheduler','UserProfileResource','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','include','findAll','catch','show','keys','find','create','body','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','run','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x10be2c,_0x1133bd){var _0x21efd5=function(_0xab084c){while(--_0xab084c){_0x10be2c['push'](_0x10be2c['shift']());}};_0x21efd5(++_0x1133bd);}(_0x450e,0xd6));var _0xe450=function(_0x4861fc,_0x146b5a){_0x4861fc=_0x4861fc-0x0;var _0x30a240=_0x450e[_0x4861fc];return _0x30a240;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe450('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe450('0x1'));var rp=require('request-promise');var moment=require(_0xe450('0x2'));var BPromise=require(_0xe450('0x3'));var Mustache=require(_0xe450('0x4'));var util=require(_0xe450('0x5'));var path=require('path');var sox=require(_0xe450('0x6'));var csv=require(_0xe450('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe450('0x8'));var _=require(_0xe450('0x9'));var squel=require(_0xe450('0xa'));var crypto=require('crypto');var jsforce=require(_0xe450('0xb'));var deskjs=require(_0xe450('0xc'));var toCsv=require(_0xe450('0x7'));var querystring=require('querystring');var Papa=require(_0xe450('0xd'));var Redis=require(_0xe450('0xe'));var authService=require(_0xe450('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe450('0x10'));var hardwareService=require(_0xe450('0x11'));var logger=require(_0xe450('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xe450('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xe450('0x14'))['db'];function respondWithStatusCode(_0x379f14,_0x22e8b7){_0x22e8b7=_0x22e8b7||0xcc;return function(_0x4fd349){if(_0x4fd349){return _0x379f14[_0xe450('0x15')](_0x22e8b7);}return _0x379f14[_0xe450('0x16')](_0x22e8b7)[_0xe450('0x17')]();};}function respondWithResult(_0x271abb,_0x5e7ec1){_0x5e7ec1=_0x5e7ec1||0xc8;return function(_0x4abb2a){if(_0x4abb2a){return _0x271abb[_0xe450('0x16')](_0x5e7ec1)[_0xe450('0x18')](_0x4abb2a);}};}function respondWithFilteredResult(_0x45ee60,_0x480cee){return function(_0x4da569){if(_0x4da569){var _0x82fd70=typeof _0x480cee[_0xe450('0x19')]===_0xe450('0x1a')&&typeof _0x480cee[_0xe450('0x1b')]===_0xe450('0x1a');var _0x2c24e8=_0x4da569[_0xe450('0x1c')];var _0x28ad87=_0x82fd70?0x0:_0x480cee['offset'];var _0x30f424=_0x82fd70?_0x4da569[_0xe450('0x1c')]:_0x480cee[_0xe450('0x19')]+_0x480cee[_0xe450('0x1b')];var _0x58a737;if(_0x30f424>=_0x2c24e8){_0x30f424=_0x2c24e8;_0x58a737=0xc8;}else{_0x58a737=0xce;}_0x45ee60['status'](_0x58a737);return _0x45ee60[_0xe450('0x1d')](_0xe450('0x1e'),_0x28ad87+'-'+_0x30f424+'/'+_0x2c24e8)[_0xe450('0x18')](_0x4da569);}return null;};}function patchUpdates(_0x56ff91){return function(_0x4ffaf6){try{jsonpatch[_0xe450('0x1f')](_0x4ffaf6,_0x56ff91,!![]);}catch(_0x565fee){return BPromise[_0xe450('0x20')](_0x565fee);}return _0x4ffaf6['save']();};}function saveUpdates(_0x19e401,_0x1e6c2f){return function(_0x222144){if(_0x222144){return _0x222144['update'](_0x19e401)['then'](function(_0x41e997){return _0x41e997;});}return null;};}function removeEntity(_0x21af01,_0x3e1245){return function(_0x504d66){if(_0x504d66){return _0x504d66[_0xe450('0x21')]()[_0xe450('0x22')](function(){var _0x2d451d=_0x504d66[_0xe450('0x23')]({'plain':!![]});var _0x730f7a=_0xe450('0x24');return db[_0xe450('0x25')][_0xe450('0x21')]({'where':{'type':_0x730f7a,'resourceId':_0x2d451d['id']}})['then'](function(){return _0x504d66;});})[_0xe450('0x22')](function(){_0x21af01[_0xe450('0x16')](0xcc)[_0xe450('0x17')]();});}};}function handleEntityNotFound(_0x53a374,_0x130dfd){return function(_0x3ea7e6){if(!_0x3ea7e6){_0x53a374[_0xe450('0x15')](0x194);}return _0x3ea7e6;};}function handleError(_0x22da5e,_0x94125a){_0x94125a=_0x94125a||0x1f4;return function(_0x4ca451){logger[_0xe450('0x26')](_0x4ca451[_0xe450('0x27')]);if(_0x4ca451[_0xe450('0x28')]){delete _0x4ca451[_0xe450('0x28')];}_0x22da5e[_0xe450('0x16')](_0x94125a)[_0xe450('0x29')](_0x4ca451);};}exports[_0xe450('0x2a')]=function(_0x1b0a9b,_0x292e67){var _0x3ed153={},_0x1859f8={},_0x3cef42={'count':0x0,'rows':[]};var _0x1b996b=_[_0xe450('0x2b')](db[_0xe450('0x2c')][_0xe450('0x2d')],function(_0x626bed){return{'name':_0x626bed[_0xe450('0x2e')],'type':_0x626bed[_0xe450('0x2f')][_0xe450('0x30')]};});_0x1859f8[_0xe450('0x31')]=_[_0xe450('0x2b')](_0x1b996b,_0xe450('0x28'));_0x1859f8['query']=_['keys'](_0x1b0a9b['query']);_0x1859f8[_0xe450('0x32')]=_[_0xe450('0x33')](_0x1859f8[_0xe450('0x31')],_0x1859f8[_0xe450('0x34')]);_0x3ed153[_0xe450('0x35')]=_[_0xe450('0x33')](_0x1859f8[_0xe450('0x31')],qs[_0xe450('0x36')](_0x1b0a9b['query'][_0xe450('0x36')]));_0x3ed153[_0xe450('0x35')]=_0x3ed153['attributes'][_0xe450('0x37')]?_0x3ed153[_0xe450('0x35')]:_0x1859f8[_0xe450('0x31')];if(!_0x1b0a9b[_0xe450('0x34')]['hasOwnProperty'](_0xe450('0x38'))){_0x3ed153[_0xe450('0x1b')]=qs[_0xe450('0x1b')](_0x1b0a9b[_0xe450('0x34')][_0xe450('0x1b')]);_0x3ed153[_0xe450('0x19')]=qs[_0xe450('0x19')](_0x1b0a9b[_0xe450('0x34')][_0xe450('0x19')]);}_0x3ed153[_0xe450('0x39')]=qs[_0xe450('0x3a')](_0x1b0a9b[_0xe450('0x34')][_0xe450('0x3a')]);_0x3ed153['where']=qs['filters'](_[_0xe450('0x3b')](_0x1b0a9b['query'],_0x1859f8[_0xe450('0x32')]),_0x1b996b);if(_0x1b0a9b['query'][_0xe450('0x3c')]){_0x3ed153[_0xe450('0x3d')]=_['merge'](_0x3ed153['where'],{'$or':_['map'](_0x1b996b,function(_0x546f71){if(_0x546f71['type']!=='VIRTUAL'){var _0x215e4={};_0x215e4[_0x546f71['name']]={'$like':'%'+_0x1b0a9b[_0xe450('0x34')]['filter']+'%'};return _0x215e4;}})});}_0x3ed153=_[_0xe450('0x3e')]({},_0x3ed153,_0x1b0a9b[_0xe450('0x3f')]);var _0x5c3aa0={'where':_0x3ed153[_0xe450('0x3d')]};return db['Schedule'][_0xe450('0x1c')](_0x5c3aa0)[_0xe450('0x22')](function(_0x1e535d){_0x3cef42[_0xe450('0x1c')]=_0x1e535d;if(_0x1b0a9b[_0xe450('0x34')]['includeAll']){_0x3ed153[_0xe450('0x40')]=[{'all':!![]}];}return db[_0xe450('0x2c')][_0xe450('0x41')](_0x3ed153);})[_0xe450('0x22')](function(_0x57c2d4){_0x3cef42['rows']=_0x57c2d4;return _0x3cef42;})[_0xe450('0x22')](respondWithFilteredResult(_0x292e67,_0x3ed153))[_0xe450('0x42')](handleError(_0x292e67,null));};exports[_0xe450('0x43')]=function(_0x59ec33,_0x4143fa){var _0x14a444={'raw':![],'where':{'id':_0x59ec33['params']['id']}},_0x2cace9={};_0x2cace9['model']=_[_0xe450('0x44')](db[_0xe450('0x2c')][_0xe450('0x2d')]);_0x2cace9[_0xe450('0x34')]=_['keys'](_0x59ec33['query']);_0x2cace9['filters']=_['intersection'](_0x2cace9['model'],_0x2cace9[_0xe450('0x34')]);_0x14a444[_0xe450('0x35')]=_['intersection'](_0x2cace9['model'],qs['fields'](_0x59ec33[_0xe450('0x34')][_0xe450('0x36')]));_0x14a444[_0xe450('0x35')]=_0x14a444['attributes']['length']?_0x14a444[_0xe450('0x35')]:_0x2cace9[_0xe450('0x31')];if(_0x59ec33['query']['includeAll']){_0x14a444['include']=[{'all':!![]}];}_0x14a444=_[_0xe450('0x3e')]({},_0x14a444,_0x59ec33['options']);return db[_0xe450('0x2c')][_0xe450('0x45')](_0x14a444)[_0xe450('0x22')](handleEntityNotFound(_0x4143fa,null))['then'](respondWithResult(_0x4143fa,null))['catch'](handleError(_0x4143fa,null));};exports[_0xe450('0x46')]=function(_0x18536a,_0x21923f){return db['Schedule']['create'](_0x18536a[_0xe450('0x47')],{})[_0xe450('0x22')](function(_0x3f8416){var _0x375369=_0x18536a['user'][_0xe450('0x23')]({'plain':!![]});if(!_0x375369)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x375369[_0xe450('0x48')]===_0xe450('0x49')){var _0xcdc803=_0x3f8416[_0xe450('0x23')]({'plain':!![]});var _0x2a222e=_0xe450('0x24');return db['UserProfileSection'][_0xe450('0x45')]({'where':{'name':_0x2a222e,'userProfileId':_0x375369[_0xe450('0x4a')]},'raw':!![]})['then'](function(_0x277e62){if(_0x277e62&&_0x277e62[_0xe450('0x4b')]===0x0){return db['UserProfileResource'][_0xe450('0x46')]({'name':_0xcdc803['name'],'resourceId':_0xcdc803['id'],'type':_0x277e62['name'],'sectionId':_0x277e62['id']},{})[_0xe450('0x22')](function(){return _0x3f8416;});}else{return _0x3f8416;}})['catch'](function(_0x3a4850){logger[_0xe450('0x26')](_0xe450('0x4c'),_0x3a4850);throw _0x3a4850;});}return _0x3f8416;})[_0xe450('0x22')](respondWithResult(_0x21923f,0xc9))[_0xe450('0x42')](handleError(_0x21923f,null));};exports[_0xe450('0x4d')]=function(_0xf2ccba,_0x4701d4){if(_0xf2ccba[_0xe450('0x47')]['id']){delete _0xf2ccba[_0xe450('0x47')]['id'];}return db[_0xe450('0x2c')]['find']({'where':{'id':_0xf2ccba[_0xe450('0x4e')]['id']}})[_0xe450('0x22')](handleEntityNotFound(_0x4701d4,null))['then'](saveUpdates(_0xf2ccba[_0xe450('0x47')],null))[_0xe450('0x22')](respondWithResult(_0x4701d4,null))[_0xe450('0x42')](handleError(_0x4701d4,null));};exports['destroy']=function(_0x3c6d9e,_0x3051b3){return db[_0xe450('0x2c')][_0xe450('0x45')]({'where':{'id':_0x3c6d9e['params']['id']}})['then'](handleEntityNotFound(_0x3051b3,null))[_0xe450('0x22')](removeEntity(_0x3051b3,null))[_0xe450('0x42')](handleError(_0x3051b3,null));};exports['run']=function(_0x100ad4,_0x38dfb8,_0x4560c4){var _0x341818=require('../../config/schedule');return db[_0xe450('0x2c')][_0xe450('0x45')]({'where':{'id':_0x100ad4[_0xe450('0x4e')]['id']},'raw':!![]})[_0xe450('0x22')](handleEntityNotFound(_0x38dfb8,null))['then'](function(){_0x341818[_0xe450('0x4f')](_0x100ad4[_0xe450('0x4e')]['id']);})['then'](respondWithStatusCode(_0x38dfb8,null))[_0xe450('0x42')](handleError(_0x38dfb8,null));};
\ No newline at end of file
+var _0x428a=['pick','filter','merge','VIRTUAL','options','Schedule','include','findAll','show','params','includeAll','find','catch','body','user','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','apply','reject','update','then','destroy','get','Scheduler','UserProfileResource','error','name','send','map','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x375a56,_0x206cb4){var _0x513740=function(_0x2e9227){while(--_0x2e9227){_0x375a56['push'](_0x375a56['shift']());}};_0x513740(++_0x206cb4);}(_0x428a,0x1ee));var _0xa428=function(_0x2f4b30,_0x4edbd1){_0x2f4b30=_0x2f4b30-0x0;var _0x2f1234=_0x428a[_0x2f4b30];return _0x2f1234;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa428('0x0'));var zipdir=require(_0xa428('0x1'));var jsonpatch=require(_0xa428('0x2'));var rp=require(_0xa428('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa428('0x4'));var util=require(_0xa428('0x5'));var path=require(_0xa428('0x6'));var sox=require(_0xa428('0x7'));var csv=require(_0xa428('0x8'));var ejs=require(_0xa428('0x9'));var fs=require('fs');var fs_extra=require(_0xa428('0xa'));var _=require('lodash');var squel=require(_0xa428('0xb'));var crypto=require(_0xa428('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa428('0x8'));var querystring=require(_0xa428('0xd'));var Papa=require(_0xa428('0xe'));var Redis=require(_0xa428('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa428('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa428('0x11'));var logger=require(_0xa428('0x12'))(_0xa428('0x13'));var utils=require(_0xa428('0x14'));var config=require(_0xa428('0x15'));var licenseUtil=require(_0xa428('0x16'));var db=require(_0xa428('0x17'))['db'];function respondWithStatusCode(_0x32ca35,_0x5e0a9f){_0x5e0a9f=_0x5e0a9f||0xcc;return function(_0x551153){if(_0x551153){return _0x32ca35[_0xa428('0x18')](_0x5e0a9f);}return _0x32ca35[_0xa428('0x19')](_0x5e0a9f)['end']();};}function respondWithResult(_0x499c15,_0x559dbe){_0x559dbe=_0x559dbe||0xc8;return function(_0x1e2ce7){if(_0x1e2ce7){return _0x499c15[_0xa428('0x19')](_0x559dbe)[_0xa428('0x1a')](_0x1e2ce7);}};}function respondWithFilteredResult(_0x1f3c5d,_0x5c096b){return function(_0x237378){if(_0x237378){var _0x4b28a2=typeof _0x5c096b['offset']==='undefined'&&typeof _0x5c096b[_0xa428('0x1b')]===_0xa428('0x1c');var _0x2ee2d7=_0x237378[_0xa428('0x1d')];var _0x5ce112=_0x4b28a2?0x0:_0x5c096b['offset'];var _0x3ea35c=_0x4b28a2?_0x237378['count']:_0x5c096b[_0xa428('0x1e')]+_0x5c096b[_0xa428('0x1b')];var _0x360330;if(_0x3ea35c>=_0x2ee2d7){_0x3ea35c=_0x2ee2d7;_0x360330=0xc8;}else{_0x360330=0xce;}_0x1f3c5d['status'](_0x360330);return _0x1f3c5d['set']('Content-Range',_0x5ce112+'-'+_0x3ea35c+'/'+_0x2ee2d7)['json'](_0x237378);}return null;};}function patchUpdates(_0x4e3d85){return function(_0x405343){try{jsonpatch[_0xa428('0x1f')](_0x405343,_0x4e3d85,!![]);}catch(_0x55885c){return BPromise[_0xa428('0x20')](_0x55885c);}return _0x405343['save']();};}function saveUpdates(_0x2b0129,_0x12b0c5){return function(_0x310b3c){if(_0x310b3c){return _0x310b3c[_0xa428('0x21')](_0x2b0129)[_0xa428('0x22')](function(_0x409122){return _0x409122;});}return null;};}function removeEntity(_0x1dcf42,_0x9eca76){return function(_0x33b0d9){if(_0x33b0d9){return _0x33b0d9[_0xa428('0x23')]()[_0xa428('0x22')](function(){var _0x4578d0=_0x33b0d9[_0xa428('0x24')]({'plain':!![]});var _0x439b84=_0xa428('0x25');return db[_0xa428('0x26')][_0xa428('0x23')]({'where':{'type':_0x439b84,'resourceId':_0x4578d0['id']}})[_0xa428('0x22')](function(){return _0x33b0d9;});})[_0xa428('0x22')](function(){_0x1dcf42['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x49d0a8,_0x39da18){return function(_0x285cec){if(!_0x285cec){_0x49d0a8[_0xa428('0x18')](0x194);}return _0x285cec;};}function handleError(_0x27002c,_0x4e82a0){_0x4e82a0=_0x4e82a0||0x1f4;return function(_0x3372fa){logger[_0xa428('0x27')](_0x3372fa['stack']);if(_0x3372fa[_0xa428('0x28')]){delete _0x3372fa[_0xa428('0x28')];}_0x27002c[_0xa428('0x19')](_0x4e82a0)[_0xa428('0x29')](_0x3372fa);};}exports['index']=function(_0x59b9e1,_0x1cc6d7){var _0x1b6949={},_0x46aee4={},_0x41a32e={'count':0x0,'rows':[]};var _0x43e189=_[_0xa428('0x2a')](db['Schedule'][_0xa428('0x2b')],function(_0x59ab60){return{'name':_0x59ab60[_0xa428('0x2c')],'type':_0x59ab60[_0xa428('0x2d')]['key']};});_0x46aee4[_0xa428('0x2e')]=_[_0xa428('0x2a')](_0x43e189,_0xa428('0x28'));_0x46aee4['query']=_[_0xa428('0x2f')](_0x59b9e1['query']);_0x46aee4[_0xa428('0x30')]=_[_0xa428('0x31')](_0x46aee4[_0xa428('0x2e')],_0x46aee4[_0xa428('0x32')]);_0x1b6949[_0xa428('0x33')]=_[_0xa428('0x31')](_0x46aee4['model'],qs[_0xa428('0x34')](_0x59b9e1[_0xa428('0x32')][_0xa428('0x34')]));_0x1b6949[_0xa428('0x33')]=_0x1b6949['attributes'][_0xa428('0x35')]?_0x1b6949['attributes']:_0x46aee4['model'];if(!_0x59b9e1['query'][_0xa428('0x36')](_0xa428('0x37'))){_0x1b6949[_0xa428('0x1b')]=qs[_0xa428('0x1b')](_0x59b9e1[_0xa428('0x32')][_0xa428('0x1b')]);_0x1b6949[_0xa428('0x1e')]=qs[_0xa428('0x1e')](_0x59b9e1[_0xa428('0x32')][_0xa428('0x1e')]);}_0x1b6949[_0xa428('0x38')]=qs['sort'](_0x59b9e1[_0xa428('0x32')][_0xa428('0x39')]);_0x1b6949[_0xa428('0x3a')]=qs[_0xa428('0x30')](_[_0xa428('0x3b')](_0x59b9e1[_0xa428('0x32')],_0x46aee4[_0xa428('0x30')]),_0x43e189);if(_0x59b9e1[_0xa428('0x32')][_0xa428('0x3c')]){_0x1b6949[_0xa428('0x3a')]=_[_0xa428('0x3d')](_0x1b6949['where'],{'$or':_[_0xa428('0x2a')](_0x43e189,function(_0x1230fb){if(_0x1230fb['type']!==_0xa428('0x3e')){var _0x2c2b90={};_0x2c2b90[_0x1230fb[_0xa428('0x28')]]={'$like':'%'+_0x59b9e1[_0xa428('0x32')][_0xa428('0x3c')]+'%'};return _0x2c2b90;}})});}_0x1b6949=_[_0xa428('0x3d')]({},_0x1b6949,_0x59b9e1[_0xa428('0x3f')]);var _0x2afe7c={'where':_0x1b6949[_0xa428('0x3a')]};return db[_0xa428('0x40')][_0xa428('0x1d')](_0x2afe7c)[_0xa428('0x22')](function(_0x235683){_0x41a32e['count']=_0x235683;if(_0x59b9e1[_0xa428('0x32')]['includeAll']){_0x1b6949[_0xa428('0x41')]=[{'all':!![]}];}return db[_0xa428('0x40')][_0xa428('0x42')](_0x1b6949);})['then'](function(_0xdb00c2){_0x41a32e['rows']=_0xdb00c2;return _0x41a32e;})[_0xa428('0x22')](respondWithFilteredResult(_0x1cc6d7,_0x1b6949))['catch'](handleError(_0x1cc6d7,null));};exports[_0xa428('0x43')]=function(_0x4b97ac,_0x16a85d){var _0x1c1409={'raw':![],'where':{'id':_0x4b97ac[_0xa428('0x44')]['id']}},_0x20b786={};_0x20b786['model']=_['keys'](db[_0xa428('0x40')][_0xa428('0x2b')]);_0x20b786['query']=_[_0xa428('0x2f')](_0x4b97ac['query']);_0x20b786[_0xa428('0x30')]=_['intersection'](_0x20b786[_0xa428('0x2e')],_0x20b786[_0xa428('0x32')]);_0x1c1409['attributes']=_[_0xa428('0x31')](_0x20b786[_0xa428('0x2e')],qs[_0xa428('0x34')](_0x4b97ac[_0xa428('0x32')][_0xa428('0x34')]));_0x1c1409[_0xa428('0x33')]=_0x1c1409[_0xa428('0x33')]['length']?_0x1c1409[_0xa428('0x33')]:_0x20b786['model'];if(_0x4b97ac[_0xa428('0x32')][_0xa428('0x45')]){_0x1c1409['include']=[{'all':!![]}];}_0x1c1409=_[_0xa428('0x3d')]({},_0x1c1409,_0x4b97ac[_0xa428('0x3f')]);return db[_0xa428('0x40')][_0xa428('0x46')](_0x1c1409)['then'](handleEntityNotFound(_0x16a85d,null))[_0xa428('0x22')](respondWithResult(_0x16a85d,null))[_0xa428('0x47')](handleError(_0x16a85d,null));};exports['create']=function(_0x11032c,_0xa088b){return db[_0xa428('0x40')]['create'](_0x11032c[_0xa428('0x48')],{})[_0xa428('0x22')](function(_0x489840){var _0x489b06=_0x11032c[_0xa428('0x49')]['get']({'plain':!![]});if(!_0x489b06)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x489b06['role']===_0xa428('0x49')){var _0x37e44a=_0x489840[_0xa428('0x24')]({'plain':!![]});var _0x57d93e=_0xa428('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x57d93e,'userProfileId':_0x489b06[_0xa428('0x4a')]},'raw':!![]})['then'](function(_0x44f68c){if(_0x44f68c&&_0x44f68c['autoAssociation']===0x0){return db[_0xa428('0x26')][_0xa428('0x4b')]({'name':_0x37e44a[_0xa428('0x28')],'resourceId':_0x37e44a['id'],'type':_0x44f68c['name'],'sectionId':_0x44f68c['id']},{})[_0xa428('0x22')](function(){return _0x489840;});}else{return _0x489840;}})[_0xa428('0x47')](function(_0x44426c){logger[_0xa428('0x27')](_0xa428('0x4c'),_0x44426c);throw _0x44426c;});}return _0x489840;})[_0xa428('0x22')](respondWithResult(_0xa088b,0xc9))['catch'](handleError(_0xa088b,null));};exports['update']=function(_0x7eea19,_0x24884d){if(_0x7eea19[_0xa428('0x48')]['id']){delete _0x7eea19[_0xa428('0x48')]['id'];}return db[_0xa428('0x40')][_0xa428('0x46')]({'where':{'id':_0x7eea19[_0xa428('0x44')]['id']}})[_0xa428('0x22')](handleEntityNotFound(_0x24884d,null))[_0xa428('0x22')](saveUpdates(_0x7eea19[_0xa428('0x48')],null))[_0xa428('0x22')](respondWithResult(_0x24884d,null))[_0xa428('0x47')](handleError(_0x24884d,null));};exports[_0xa428('0x23')]=function(_0x34ce50,_0x46d995){return db[_0xa428('0x40')][_0xa428('0x46')]({'where':{'id':_0x34ce50[_0xa428('0x44')]['id']}})['then'](handleEntityNotFound(_0x46d995,null))[_0xa428('0x22')](removeEntity(_0x46d995,null))[_0xa428('0x47')](handleError(_0x46d995,null));};exports[_0xa428('0x4d')]=function(_0x4b50a9,_0x312be4,_0xd420ca){var _0x22be5b=require(_0xa428('0x4e'));return db['Schedule'][_0xa428('0x46')]({'where':{'id':_0x4b50a9['params']['id']},'raw':!![]})[_0xa428('0x22')](handleEntityNotFound(_0x312be4,null))['then'](function(){_0x22be5b[_0xa428('0x4d')](_0x4b50a9[_0xa428('0x44')]['id']);})['then'](respondWithStatusCode(_0x312be4,null))['catch'](handleError(_0x312be4,null));};
\ No newline at end of file
index 592948a..649508e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc943=['tools_schedules','util','../../config/logger','api','request-promise','path','../../config/environment','./schedule.attributes','exports','define','Schedule'];(function(_0x19118e,_0x148a16){var _0x5a0c20=function(_0x57f03a){while(--_0x57f03a){_0x19118e['push'](_0x19118e['shift']());}};_0x5a0c20(++_0x148a16);}(_0xc943,0x156));var _0x3c94=function(_0x1a21ff,_0x4a7550){_0x1a21ff=_0x1a21ff-0x0;var _0x25afc1=_0xc943[_0x1a21ff];return _0x25afc1;};'use strict';var _=require('lodash');var util=require(_0x3c94('0x0'));var logger=require(_0x3c94('0x1'))(_0x3c94('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3c94('0x3'));var fs=require('fs');var path=require(_0x3c94('0x4'));var rimraf=require('rimraf');var config=require(_0x3c94('0x5'));var attributes=require(_0x3c94('0x6'));module[_0x3c94('0x7')]=function(_0xe92eef,_0x2de7f2){return _0xe92eef[_0x3c94('0x8')](_0x3c94('0x9'),attributes,{'tableName':_0x3c94('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x764a=['moment','bluebird','rimraf','../../config/environment','exports','define','Schedule','lodash','../../config/logger','api'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0x764a,0xcf));var _0xa764=function(_0x4427a4,_0x1e08bc){_0x4427a4=_0x4427a4-0x0;var _0x537102=_0x764a[_0x4427a4];return _0x537102;};'use strict';var _=require(_0xa764('0x0'));var util=require('util');var logger=require(_0xa764('0x1'))(_0xa764('0x2'));var moment=require(_0xa764('0x3'));var BPromise=require(_0xa764('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa764('0x5'));var config=require(_0xa764('0x6'));var attributes=require('./schedule.attributes');module[_0xa764('0x7')]=function(_0x41989d,_0x2c3115){return _0x41989d[_0xa764('0x8')](_0xa764('0x9'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index de14cd3..6cdd4e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f03=['debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment','ioredis','../../mysqldb','../../config/logger','http','then','Schedule,\x20%s,\x20%s','request\x20sent'];(function(_0x2b6029,_0x334fcc){var _0x422bc8=function(_0x3ec7f5){while(--_0x3ec7f5){_0x2b6029['push'](_0x2b6029['shift']());}};_0x422bc8(++_0x334fcc);}(_0x8f03,0x17e));var _0x38f0=function(_0x4f7576,_0x138a8f){_0x4f7576=_0x4f7576-0x0;var _0x45d522=_0x8f03[_0x4f7576];return _0x45d522;};'use strict';var _=require('lodash');var util=require(_0x38f0('0x0'));var moment=require(_0x38f0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x38f0('0x2'));var db=require(_0x38f0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x38f0('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x38f0('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x7d0937,_0x968b3a,_0x197e48){return new BPromise(function(_0x4e5227,_0x419403){return client['request'](_0x7d0937,_0x197e48)[_0x38f0('0x6')](function(_0x3537c9){logger['info'](_0x38f0('0x7'),_0x968b3a,_0x38f0('0x8'));logger[_0x38f0('0x9')](_0x38f0('0xa'),_0x968b3a,'request\x20sent',JSON[_0x38f0('0xb')](_0x3537c9));if(_0x3537c9[_0x38f0('0xc')]){if(_0x3537c9[_0x38f0('0xc')]['code']===0x1f4){logger[_0x38f0('0xc')](_0x38f0('0x7'),_0x968b3a,_0x3537c9['error'][_0x38f0('0xd')]);return _0x419403(_0x3537c9[_0x38f0('0xc')][_0x38f0('0xd')]);}logger['error'](_0x38f0('0x7'),_0x968b3a,_0x3537c9[_0x38f0('0xc')][_0x38f0('0xd')]);return _0x4e5227(_0x3537c9[_0x38f0('0xc')]['message']);}else{logger[_0x38f0('0xe')](_0x38f0('0x7'),_0x968b3a,_0x38f0('0x8'));_0x4e5227(_0x3537c9[_0x38f0('0xf')]['message']);}})[_0x38f0('0x10')](function(_0x319a00){logger['error'](_0x38f0('0x7'),_0x968b3a,_0x319a00);_0x419403(_0x319a00);});});}
\ No newline at end of file
+var _0x833a=['result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','request','then','info','debug','request\x20sent','error','code','message','Schedule,\x20%s,\x20%s'];(function(_0x231d56,_0xc46a4d){var _0x2a0f58=function(_0x3d194d){while(--_0x3d194d){_0x231d56['push'](_0x231d56['shift']());}};_0x2a0f58(++_0xc46a4d);}(_0x833a,0x80));var _0xa833=function(_0x6e78af,_0x2da1d7){_0x6e78af=_0x6e78af-0x0;var _0xe48055=_0x833a[_0x6e78af];return _0xe48055;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa833('0x0'));var BPromise=require(_0xa833('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa833('0x2'));var db=require(_0xa833('0x3'))['db'];var utils=require(_0xa833('0x4'));var logger=require(_0xa833('0x5'))(_0xa833('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x33bcf0,_0x3e4464,_0x5f1916){return new BPromise(function(_0x1d55cf,_0x32d5c3){return client[_0xa833('0x7')](_0x33bcf0,_0x5f1916)[_0xa833('0x8')](function(_0x2b3012){logger[_0xa833('0x9')]('Schedule,\x20%s,\x20%s',_0x3e4464,'request\x20sent');logger[_0xa833('0xa')]('Schedule,\x20%s,\x20%s,\x20%s',_0x3e4464,_0xa833('0xb'),JSON['stringify'](_0x2b3012));if(_0x2b3012[_0xa833('0xc')]){if(_0x2b3012[_0xa833('0xc')][_0xa833('0xd')]===0x1f4){logger[_0xa833('0xc')]('Schedule,\x20%s,\x20%s',_0x3e4464,_0x2b3012[_0xa833('0xc')]['message']);return _0x32d5c3(_0x2b3012[_0xa833('0xc')][_0xa833('0xe')]);}logger['error'](_0xa833('0xf'),_0x3e4464,_0x2b3012['error'][_0xa833('0xe')]);return _0x1d55cf(_0x2b3012[_0xa833('0xc')][_0xa833('0xe')]);}else{logger['info'](_0xa833('0xf'),_0x3e4464,_0xa833('0xb'));_0x1d55cf(_0x2b3012[_0xa833('0x10')][_0xa833('0xe')]);}})[_0xa833('0x11')](function(_0x23a051){logger[_0xa833('0xc')](_0xa833('0xf'),_0x3e4464,_0x23a051);_0x32d5c3(_0x23a051);});});}
\ No newline at end of file
index 2a1e3a8..cb4d2f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d58=['../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','download','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x28669c,_0x1f62c4){var _0x4a3af6=function(_0x3e25d5){while(--_0x3e25d5){_0x28669c['push'](_0x28669c['shift']());}};_0x4a3af6(++_0x1f62c4);}(_0x2d58,0x134));var _0x82d5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2d58[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x82d5('0x0'));var util=require(_0x82d5('0x1'));var path=require(_0x82d5('0x2'));var timeout=require(_0x82d5('0x3'));var express=require('express');var router=express[_0x82d5('0x4')]();var fs_extra=require(_0x82d5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x82d5('0x6'));var config=require(_0x82d5('0x7'));var controller=require('./screenRecording.controller');router['get']('/',auth[_0x82d5('0x8')](),controller[_0x82d5('0x9')]);router[_0x82d5('0xa')](_0x82d5('0xb'),auth['isAuthenticated'](),controller[_0x82d5('0xc')]);router[_0x82d5('0xa')](_0x82d5('0xd'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x82d5('0xe')]);router[_0x82d5('0xf')]('/',auth[_0x82d5('0x8')](),controller[_0x82d5('0x10')]);router[_0x82d5('0x11')](_0x82d5('0xd'),auth[_0x82d5('0x8')](),controller[_0x82d5('0x12')]);router[_0x82d5('0x13')](_0x82d5('0xd'),auth[_0x82d5('0x8')](),controller[_0x82d5('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x009d=['destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','/describe','isAuthenticated','/:id','show','/:id/download','download','post','create','update','delete'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x009d,0xde));var _0xd009=function(_0x493dbc,_0x4b05fb){_0x493dbc=_0x493dbc-0x0;var _0x25ad31=_0x009d[_0x493dbc];return _0x25ad31;};'use strict';var multer=require(_0xd009('0x0'));var util=require(_0xd009('0x1'));var path=require(_0xd009('0x2'));var timeout=require(_0xd009('0x3'));var express=require(_0xd009('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd009('0x5'));var interaction=require(_0xd009('0x6'));var config=require(_0xd009('0x7'));var controller=require(_0xd009('0x8'));router[_0xd009('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd009('0x9')](_0xd009('0xa'),auth[_0xd009('0xb')](),controller['describe']);router['get'](_0xd009('0xc'),auth[_0xd009('0xb')](),controller[_0xd009('0xd')]);router[_0xd009('0x9')](_0xd009('0xe'),auth[_0xd009('0xb')](),controller[_0xd009('0xf')]);router[_0xd009('0x10')]('/',auth[_0xd009('0xb')](),controller[_0xd009('0x11')]);router['put']('/:id',auth[_0xd009('0xb')](),controller[_0xd009('0x12')]);router[_0xd009('0x13')](_0xd009('0xc'),auth['isAuthenticated'](),controller[_0xd009('0x14')]);module[_0xd009('0x15')]=router;
\ No newline at end of file
index 602ddb2..0024290 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b11=['MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','path','../../config/environment','VIRTUAL','getDataValue','value','STRING','replace','setDataValue','INTEGER','startedAt','closedAt','duration','DATE','format'];(function(_0x40b642,_0x3e8910){var _0x1401d9=function(_0x14bca5){while(--_0x14bca5){_0x40b642['push'](_0x40b642['shift']());}};_0x1401d9(++_0x3e8910);}(_0x4b11,0xf4));var _0x14b1=function(_0x32c4a3,_0x548acf){_0x32c4a3=_0x32c4a3-0x0;var _0x7d4ef6=_0x4b11[_0x32c4a3];return _0x7d4ef6;};'use strict';var Sequelize=require(_0x14b1('0x0'));var moment=require(_0x14b1('0x1'));var path=require(_0x14b1('0x2'));var config=require(_0x14b1('0x3'));module['exports']={'format':{'type':Sequelize[_0x14b1('0x4')],'get':function(){return this[_0x14b1('0x5')](_0x14b1('0x6'))?path['extname'](this[_0x14b1('0x5')](_0x14b1('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x14b1('0x7')]},'channel':{'type':Sequelize[_0x14b1('0x7')]},'value':{'type':Sequelize[_0x14b1('0x7')],'set':function(_0x4376d6){var _0x36b3df=_0x4376d6[_0x14b1('0x8')](/\\/g,'/');this[_0x14b1('0x9')](_0x14b1('0x6'),_0x36b3df);}},'rating':{'type':Sequelize[_0x14b1('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x14b1('0xa')],'set':function(_0xc93256){this[_0x14b1('0x9')](_0x14b1('0xb'),moment()['subtract'](_0xc93256,'ms'));this[_0x14b1('0x9')](_0x14b1('0xc'),moment());this['setDataValue'](_0x14b1('0xd'),_0xc93256);}},'startedAt':{'type':Sequelize[_0x14b1('0xe')],'get':function(){return moment(this[_0x14b1('0x5')](_0x14b1('0xb')))[_0x14b1('0xf')](_0x14b1('0x10'))['toString']();}},'closedAt':{'type':Sequelize[_0x14b1('0xe')],'get':function(){return moment(this['getDataValue']('closedAt'))[_0x14b1('0xf')](_0x14b1('0x10'))[_0x14b1('0x11')]();}},'createdAt':{'type':Sequelize[_0x14b1('0xe')],'get':function(){return moment(this[_0x14b1('0x5')](_0x14b1('0x12')))['format'](_0x14b1('0x10'))[_0x14b1('0x11')]();}},'updatedAt':{'type':Sequelize[_0x14b1('0xe')],'get':function(){return moment(this[_0x14b1('0x5')](_0x14b1('0x13')))[_0x14b1('0xf')](_0x14b1('0x10'))[_0x14b1('0x11')]();}}};
\ No newline at end of file
+var _0x161a=['value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','getDataValue','MM-DD-YYYY\x20HH:mm','toString','format','updatedAt','path','../../config/environment','VIRTUAL'];(function(_0x4fd9b0,_0x1b49c4){var _0x326566=function(_0x2cca78){while(--_0x2cca78){_0x4fd9b0['push'](_0x4fd9b0['shift']());}};_0x326566(++_0x1b49c4);}(_0x161a,0x140));var _0xa161=function(_0x3cb6dc,_0x120dd3){_0x3cb6dc=_0x3cb6dc-0x0;var _0x47ec89=_0x161a[_0x3cb6dc];return _0x47ec89;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var path=require(_0xa161('0x0'));var config=require(_0xa161('0x1'));module['exports']={'format':{'type':Sequelize[_0xa161('0x2')],'get':function(){return this['getDataValue'](_0xa161('0x3'))?path[_0xa161('0x4')](this['getDataValue']('value')):undefined;}},'interactionid':{'type':Sequelize[_0xa161('0x5')]},'channel':{'type':Sequelize[_0xa161('0x5')]},'value':{'type':Sequelize[_0xa161('0x5')],'set':function(_0x8a253b){var _0x264bd0=_0x8a253b[_0xa161('0x6')](/\\/g,'/');this[_0xa161('0x7')]('value',_0x264bd0);}},'rating':{'type':Sequelize[_0xa161('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xa161('0x8')],'set':function(_0x327221){this[_0xa161('0x7')](_0xa161('0x9'),moment()[_0xa161('0xa')](_0x327221,'ms'));this[_0xa161('0x7')](_0xa161('0xb'),moment());this[_0xa161('0x7')](_0xa161('0xc'),_0x327221);}},'startedAt':{'type':Sequelize[_0xa161('0xd')],'get':function(){return moment(this[_0xa161('0xe')](_0xa161('0x9')))['format'](_0xa161('0xf'))[_0xa161('0x10')]();}},'closedAt':{'type':Sequelize[_0xa161('0xd')],'get':function(){return moment(this[_0xa161('0xe')]('closedAt'))[_0xa161('0x11')](_0xa161('0xf'))['toString']();}},'createdAt':{'type':Sequelize[_0xa161('0xd')],'get':function(){return moment(this[_0xa161('0xe')]('createdAt'))[_0xa161('0x11')](_0xa161('0xf'))[_0xa161('0x10')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xa161('0xe')](_0xa161('0x12')))[_0xa161('0x11')](_0xa161('0xf'))[_0xa161('0x10')]();}}};
\ No newline at end of file
index 1f2307b..f10628f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fd1=['body','duration','createdAt','closedAt','describe','../../components/encryptor','uniqueid','join','value','format','%s.cypher','decryptFile','secrets','recording','root','server/files/screen_recordings','existsSync','Sequelize','filename','download','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','ScreenRecording','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','filter','options','count','include','findAll','rows','catch','show','params','rawAttributes','merge','find','create'];(function(_0x4bf853,_0x1fc141){var _0x38994f=function(_0x2f84e0){while(--_0x2f84e0){_0x4bf853['push'](_0x4bf853['shift']());}};_0x38994f(++_0x1fc141);}(_0x5fd1,0x155));var _0x15fd=function(_0x27acb7,_0x261ad9){_0x27acb7=_0x27acb7-0x0;var _0x2edb13=_0x5fd1[_0x27acb7];return _0x2edb13;};'use strict';var emlformat=require(_0x15fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15fd('0x1'));var jsonpatch=require(_0x15fd('0x2'));var rp=require(_0x15fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x15fd('0x4'));var util=require(_0x15fd('0x5'));var path=require(_0x15fd('0x6'));var sox=require('sox');var csv=require(_0x15fd('0x7'));var ejs=require(_0x15fd('0x8'));var fs=require('fs');var fs_extra=require(_0x15fd('0x9'));var _=require(_0x15fd('0xa'));var squel=require(_0x15fd('0xb'));var crypto=require('crypto');var jsforce=require(_0x15fd('0xc'));var deskjs=require(_0x15fd('0xd'));var toCsv=require(_0x15fd('0x7'));var querystring=require('querystring');var Papa=require(_0x15fd('0xe'));var Redis=require('ioredis');var authService=require(_0x15fd('0xf'));var qs=require(_0x15fd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x15fd('0x11'));var utils=require(_0x15fd('0x12'));var config=require(_0x15fd('0x13'));var licenseUtil=require(_0x15fd('0x14'));var db=require(_0x15fd('0x15'))['db'];function respondWithStatusCode(_0x2e18ec,_0x346ab1){_0x346ab1=_0x346ab1||0xcc;return function(_0x2660db){if(_0x2660db){return _0x2e18ec[_0x15fd('0x16')](_0x346ab1);}return _0x2e18ec['status'](_0x346ab1)['end']();};}function respondWithResult(_0x5784a3,_0x3fda60){_0x3fda60=_0x3fda60||0xc8;return function(_0x135a15){if(_0x135a15){return _0x5784a3[_0x15fd('0x17')](_0x3fda60)[_0x15fd('0x18')](_0x135a15);}};}function respondWithFilteredResult(_0x44eae6,_0x2ffa03){return function(_0x2c5375){if(_0x2c5375){var _0x44a63a=typeof _0x2ffa03['offset']==='undefined'&&typeof _0x2ffa03[_0x15fd('0x19')]==='undefined';var _0x7afe9c=_0x2c5375['count'];var _0x917fe4=_0x44a63a?0x0:_0x2ffa03[_0x15fd('0x1a')];var _0x855bae=_0x44a63a?_0x2c5375['count']:_0x2ffa03[_0x15fd('0x1a')]+_0x2ffa03[_0x15fd('0x19')];var _0x8b7b9e;if(_0x855bae>=_0x7afe9c){_0x855bae=_0x7afe9c;_0x8b7b9e=0xc8;}else{_0x8b7b9e=0xce;}_0x44eae6[_0x15fd('0x17')](_0x8b7b9e);return _0x44eae6[_0x15fd('0x1b')](_0x15fd('0x1c'),_0x917fe4+'-'+_0x855bae+'/'+_0x7afe9c)[_0x15fd('0x18')](_0x2c5375);}return null;};}function patchUpdates(_0x2f46f1){return function(_0x1b8b9f){try{jsonpatch[_0x15fd('0x1d')](_0x1b8b9f,_0x2f46f1,!![]);}catch(_0x3ff307){return BPromise['reject'](_0x3ff307);}return _0x1b8b9f['save']();};}function saveUpdates(_0x293d7b,_0x36b21e){return function(_0x252a1c){if(_0x252a1c){return _0x252a1c[_0x15fd('0x1e')](_0x293d7b)[_0x15fd('0x1f')](function(_0x11496a){return _0x11496a;});}return null;};}function removeEntity(_0x2073da,_0x50d493){return function(_0x40d43){if(_0x40d43){return _0x40d43[_0x15fd('0x20')]()[_0x15fd('0x1f')](function(){_0x2073da['status'](0xcc)[_0x15fd('0x21')]();});}};}function handleEntityNotFound(_0x49062f,_0x3d1835){return function(_0x1fc24f){if(!_0x1fc24f){_0x49062f[_0x15fd('0x16')](0x194);}return _0x1fc24f;};}function handleError(_0x4c9708,_0x16b87c){_0x16b87c=_0x16b87c||0x1f4;return function(_0x1cbf2c){logger[_0x15fd('0x22')](_0x1cbf2c['stack']);if(_0x1cbf2c[_0x15fd('0x23')]){delete _0x1cbf2c['name'];}_0x4c9708[_0x15fd('0x17')](_0x16b87c)[_0x15fd('0x24')](_0x1cbf2c);};}exports[_0x15fd('0x25')]=function(_0x27d2c4,_0x233ed3){var _0x6c213b={},_0x218034={},_0xe650a3={'count':0x0,'rows':[]};var _0x4590a1=_[_0x15fd('0x26')](db[_0x15fd('0x27')]['rawAttributes'],function(_0x47c22c){return{'name':_0x47c22c[_0x15fd('0x28')],'type':_0x47c22c['type'][_0x15fd('0x29')]};});_0x218034[_0x15fd('0x2a')]=_['differenceBy'](_[_0x15fd('0x26')](_0x4590a1,_0x15fd('0x23')),['format']);_0x218034[_0x15fd('0x2b')]=_[_0x15fd('0x2c')](_0x27d2c4[_0x15fd('0x2b')]);_0x218034[_0x15fd('0x2d')]=_[_0x15fd('0x2e')](_0x218034[_0x15fd('0x2a')],_0x218034['query']);_0x6c213b[_0x15fd('0x2f')]=_[_0x15fd('0x2e')](_0x218034[_0x15fd('0x2a')],qs[_0x15fd('0x30')](_0x27d2c4['query'][_0x15fd('0x30')]));_0x6c213b[_0x15fd('0x2f')]=_0x6c213b[_0x15fd('0x2f')][_0x15fd('0x31')]?_0x6c213b[_0x15fd('0x2f')]:_0x218034[_0x15fd('0x2a')];if(!_0x27d2c4['query'][_0x15fd('0x32')](_0x15fd('0x33'))){_0x6c213b['limit']=qs[_0x15fd('0x19')](_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x19')]);_0x6c213b['offset']=qs[_0x15fd('0x1a')](_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x1a')]);}_0x6c213b[_0x15fd('0x34')]=qs[_0x15fd('0x35')](_0x27d2c4[_0x15fd('0x2b')]['sort']);_0x6c213b['where']=qs['filters'](_[_0x15fd('0x36')](_0x27d2c4[_0x15fd('0x2b')],_0x218034[_0x15fd('0x2d')]),_0x4590a1);if(_0x27d2c4['query']['filter']){_0x6c213b[_0x15fd('0x37')]=_['merge'](_0x6c213b['where'],{'$or':_['map'](_0x4590a1,function(_0x2edb0d){if(_0x2edb0d[_0x15fd('0x38')]!==_0x15fd('0x39')){var _0x59d0d7={};_0x59d0d7[_0x2edb0d[_0x15fd('0x23')]]={'$like':'%'+_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x3a')]+'%'};return _0x59d0d7;}})});}_0x6c213b=_['merge']({},_0x6c213b,_0x27d2c4[_0x15fd('0x3b')]);var _0x1c4d40={'where':_0x6c213b[_0x15fd('0x37')]};return db[_0x15fd('0x27')][_0x15fd('0x3c')](_0x1c4d40)[_0x15fd('0x1f')](function(_0x19a29f){_0xe650a3[_0x15fd('0x3c')]=_0x19a29f;if(_0x27d2c4[_0x15fd('0x2b')]['includeAll']){_0x6c213b[_0x15fd('0x3d')]=[{'all':!![]}];}return db[_0x15fd('0x27')][_0x15fd('0x3e')](_0x6c213b);})[_0x15fd('0x1f')](function(_0x2d2b6f){_0xe650a3[_0x15fd('0x3f')]=_0x2d2b6f;return _0xe650a3;})[_0x15fd('0x1f')](respondWithFilteredResult(_0x233ed3,_0x6c213b))[_0x15fd('0x40')](handleError(_0x233ed3,null));};exports[_0x15fd('0x41')]=function(_0x104eef,_0x2eb6b6){var _0x145eab={'raw':![],'where':{'id':_0x104eef[_0x15fd('0x42')]['id']}},_0x269aae={};_0x269aae[_0x15fd('0x2a')]=_['keys'](db[_0x15fd('0x27')][_0x15fd('0x43')]);_0x269aae[_0x15fd('0x2b')]=_[_0x15fd('0x2c')](_0x104eef[_0x15fd('0x2b')]);_0x269aae[_0x15fd('0x2d')]=_[_0x15fd('0x2e')](_0x269aae[_0x15fd('0x2a')],_0x269aae['query']);_0x145eab['attributes']=_[_0x15fd('0x2e')](_0x269aae['model'],qs[_0x15fd('0x30')](_0x104eef[_0x15fd('0x2b')]['fields']));_0x145eab[_0x15fd('0x2f')]=_0x145eab[_0x15fd('0x2f')][_0x15fd('0x31')]?_0x145eab[_0x15fd('0x2f')]:_0x269aae[_0x15fd('0x2a')];if(_0x104eef[_0x15fd('0x2b')]['includeAll']){_0x145eab[_0x15fd('0x3d')]=[{'all':!![]}];}_0x145eab=_[_0x15fd('0x44')]({},_0x145eab,_0x104eef[_0x15fd('0x3b')]);return db[_0x15fd('0x27')][_0x15fd('0x45')](_0x145eab)[_0x15fd('0x1f')](handleEntityNotFound(_0x2eb6b6,null))[_0x15fd('0x1f')](respondWithResult(_0x2eb6b6,null))[_0x15fd('0x40')](handleError(_0x2eb6b6,null));};exports[_0x15fd('0x46')]=function(_0x1d3beb,_0x16b4f5){return db[_0x15fd('0x27')]['create'](_0x1d3beb[_0x15fd('0x47')],{})['then'](respondWithResult(_0x16b4f5,0xc9))[_0x15fd('0x40')](handleError(_0x16b4f5,null));};exports[_0x15fd('0x1e')]=function(_0xeb1e06,_0x5a1f32){if(_0xeb1e06[_0x15fd('0x47')]['id']){delete _0xeb1e06[_0x15fd('0x47')]['id'];}delete _0xeb1e06[_0x15fd('0x47')][_0x15fd('0x48')];delete _0xeb1e06['body'][_0x15fd('0x49')];delete _0xeb1e06[_0x15fd('0x47')][_0x15fd('0x4a')];delete _0xeb1e06[_0x15fd('0x47')]['value'];return db[_0x15fd('0x27')][_0x15fd('0x45')]({'where':{'id':_0xeb1e06['params']['id']}})['then'](handleEntityNotFound(_0x5a1f32,null))['then'](saveUpdates(_0xeb1e06[_0x15fd('0x47')],null))[_0x15fd('0x1f')](respondWithResult(_0x5a1f32,null))[_0x15fd('0x40')](handleError(_0x5a1f32,null));};exports[_0x15fd('0x4b')]=function(_0x292174,_0x33a128){return db['ScreenRecording'][_0x15fd('0x4b')]()[_0x15fd('0x1f')](respondWithResult(_0x33a128,null))[_0x15fd('0x40')](handleError(_0x33a128,null));};exports['download']=function(_0x30c4e3,_0x4dd1d5,_0x3a48e7){var _0x2886e3=require(_0x15fd('0x4c'));var _0x42d4de=![];var _0x332df7={};if(_0x30c4e3[_0x15fd('0x2b')][_0x15fd('0x38')]&&_0x30c4e3[_0x15fd('0x2b')][_0x15fd('0x38')]===_0x15fd('0x4d')){_0x332df7[_0x15fd('0x4d')]=_0x30c4e3[_0x15fd('0x42')]['id'];}else{_0x332df7['id']=_0x30c4e3[_0x15fd('0x42')]['id'];}return db['ScreenRecording'][_0x15fd('0x45')]({'where':_0x332df7,'attributes':['id','value'],'raw':!![]})[_0x15fd('0x1f')](handleEntityNotFound(_0x4dd1d5,null))['then'](function(_0x25bdea){if(_0x25bdea){var _0x1fac7f=path[_0x15fd('0x4e')](config['root'],'server/files/screen_recordings',_0x25bdea[_0x15fd('0x4f')]);var _0xc9c5ef=util[_0x15fd('0x50')](_0x15fd('0x51'),_0x1fac7f);if(fs['existsSync'](_0xc9c5ef)){_0x42d4de=!![];return _0x2886e3[_0x15fd('0x52')](_0xc9c5ef,_0x1fac7f,config[_0x15fd('0x53')][_0x15fd('0x54')])[_0x15fd('0x1f')](function(){return _0x25bdea;});}return _0x25bdea;}})[_0x15fd('0x1f')](function(_0x321fe7){if(_0x321fe7){var _0x59b3b4=path[_0x15fd('0x4e')](config[_0x15fd('0x55')],_0x15fd('0x56'),_0x321fe7[_0x15fd('0x4f')]);if(!fs[_0x15fd('0x57')](_0x59b3b4)){throw new db[(_0x15fd('0x58'))]['ValidationError']('ScreenRecording\x20not\x20found');}if(_0x321fe7[_0x15fd('0x59')]){return _0x4dd1d5[_0x15fd('0x5a')](_0x59b3b4,_0x321fe7['filename']+path[_0x15fd('0x5b')](_0x59b3b4),function(){if(_0x42d4de){fs[_0x15fd('0x5c')](_0x59b3b4);}});}else{return _0x4dd1d5['download'](_0x59b3b4,function(_0x285fd5){if(_0x42d4de){fs[_0x15fd('0x5c')](_0x59b3b4);}});}}})[_0x15fd('0x40')](function(_0x53bfd7){if(_0x53bfd7[_0x15fd('0x5d')]===_0x15fd('0x5e')){_0x4dd1d5[_0x15fd('0x17')](0x194)[_0x15fd('0x24')](_0x15fd('0x5f'));}else{return handleError(_0x4dd1d5,null);}});};exports[_0x15fd('0x20')]=function(_0xa1bb5c,_0x290497){return db[_0x15fd('0x27')][_0x15fd('0x45')]({'where':{'id':_0xa1bb5c['params']['id']}})[_0x15fd('0x1f')](function(_0x3a26c8){if(_['isNil'](_0x3a26c8)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3a26c8;})[_0x15fd('0x1f')](function(_0x39e6ee){var _0x2bd6ef=path[_0x15fd('0x4e')](config[_0x15fd('0x55')],_0x15fd('0x56'),_0x39e6ee['value']);logger[_0x15fd('0x60')](_0x15fd('0x61'),_0x2bd6ef);if(!_[_0x15fd('0x62')](_0x39e6ee[_0x15fd('0x4f')])&&fs[_0x15fd('0x57')](_0x2bd6ef)){logger[_0x15fd('0x60')](_0x15fd('0x63')+_0x2bd6ef+_0x15fd('0x64'));fs[_0x15fd('0x65')](_0x2bd6ef);}_0x2bd6ef=_0x2bd6ef+_0x15fd('0x66');if(!_[_0x15fd('0x62')](_0x39e6ee['value'])&&fs['existsSync'](_0x2bd6ef)){logger[_0x15fd('0x60')](_0x15fd('0x63')+_0x2bd6ef+_0x15fd('0x64'));fs[_0x15fd('0x65')](_0x2bd6ef);}return _0x39e6ee;})[_0x15fd('0x1f')](function(_0xfa3aa1){if(!_0xfa3aa1)throw new InternalError();return _0xfa3aa1[_0x15fd('0x20')]();})['then'](function(){_0x290497[_0x15fd('0x17')](0xcc)['end']();})[_0x15fd('0x40')](handleError(_0x290497,null));};
\ No newline at end of file
+var _0x7da7=['stack','name','send','index','map','ScreenRecording','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','filter','includeAll','findAll','rows','show','params','rawAttributes','options','find','create','body','duration','createdAt','value','catch','describe','download','../../components/encryptor','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','recording','join','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','json','apply','reject','update','then','destroy','end','error'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7da7,0x10d));var _0x77da=function(_0x30abff,_0x5f2c5f){_0x30abff=_0x30abff-0x0;var _0x4c571e=_0x7da7[_0x30abff];return _0x4c571e;};'use strict';var emlformat=require(_0x77da('0x0'));var rimraf=require(_0x77da('0x1'));var zipdir=require(_0x77da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x77da('0x3'));var BPromise=require(_0x77da('0x4'));var Mustache=require('mustache');var util=require(_0x77da('0x5'));var path=require(_0x77da('0x6'));var sox=require('sox');var csv=require(_0x77da('0x7'));var ejs=require(_0x77da('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x7'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var Redis=require(_0x77da('0xe'));var authService=require(_0x77da('0xf'));var qs=require(_0x77da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77da('0x11'));var logger=require(_0x77da('0x12'))(_0x77da('0x13'));var utils=require(_0x77da('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x77da('0x15'));var db=require(_0x77da('0x16'))['db'];function respondWithStatusCode(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xcc;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0x17')](_0x5d6e2f);}return _0x2acc65[_0x77da('0x18')](_0x5d6e2f)['end']();};}function respondWithResult(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0xc8;return function(_0x355719){if(_0x355719){return _0x3b0ff2[_0x77da('0x18')](_0x369df0)['json'](_0x355719);}};}function respondWithFilteredResult(_0x2172d0,_0x4e130c){return function(_0x29cd7b){if(_0x29cd7b){var _0x366443=typeof _0x4e130c[_0x77da('0x19')]===_0x77da('0x1a')&&typeof _0x4e130c['limit']==='undefined';var _0x514016=_0x29cd7b['count'];var _0x103e46=_0x366443?0x0:_0x4e130c[_0x77da('0x19')];var _0x289887=_0x366443?_0x29cd7b[_0x77da('0x1b')]:_0x4e130c[_0x77da('0x19')]+_0x4e130c[_0x77da('0x1c')];var _0x1d325c;if(_0x289887>=_0x514016){_0x289887=_0x514016;_0x1d325c=0xc8;}else{_0x1d325c=0xce;}_0x2172d0[_0x77da('0x18')](_0x1d325c);return _0x2172d0['set']('Content-Range',_0x103e46+'-'+_0x289887+'/'+_0x514016)[_0x77da('0x1d')](_0x29cd7b);}return null;};}function patchUpdates(_0x4d1512){return function(_0x507979){try{jsonpatch[_0x77da('0x1e')](_0x507979,_0x4d1512,!![]);}catch(_0x304a2b){return BPromise[_0x77da('0x1f')](_0x304a2b);}return _0x507979['save']();};}function saveUpdates(_0x58270c,_0x3e6cfe){return function(_0x58f6c1){if(_0x58f6c1){return _0x58f6c1[_0x77da('0x20')](_0x58270c)[_0x77da('0x21')](function(_0xc52f0e){return _0xc52f0e;});}return null;};}function removeEntity(_0x27b6c7,_0x10399a){return function(_0x270318){if(_0x270318){return _0x270318[_0x77da('0x22')]()['then'](function(){_0x27b6c7['status'](0xcc)[_0x77da('0x23')]();});}};}function handleEntityNotFound(_0x2d009f,_0x835167){return function(_0xbd06b7){if(!_0xbd06b7){_0x2d009f['sendStatus'](0x194);}return _0xbd06b7;};}function handleError(_0x42240b,_0x167240){_0x167240=_0x167240||0x1f4;return function(_0x470c9f){logger[_0x77da('0x24')](_0x470c9f[_0x77da('0x25')]);if(_0x470c9f['name']){delete _0x470c9f[_0x77da('0x26')];}_0x42240b[_0x77da('0x18')](_0x167240)[_0x77da('0x27')](_0x470c9f);};}exports[_0x77da('0x28')]=function(_0x496ecd,_0x5b4638){var _0x4d395a={},_0x2258e9={},_0x30456a={'count':0x0,'rows':[]};var _0x410d09=_[_0x77da('0x29')](db[_0x77da('0x2a')]['rawAttributes'],function(_0x350b4e){return{'name':_0x350b4e[_0x77da('0x2b')],'type':_0x350b4e[_0x77da('0x2c')][_0x77da('0x2d')]};});_0x2258e9[_0x77da('0x2e')]=_[_0x77da('0x2f')](_['map'](_0x410d09,_0x77da('0x26')),[_0x77da('0x30')]);_0x2258e9[_0x77da('0x31')]=_[_0x77da('0x32')](_0x496ecd[_0x77da('0x31')]);_0x2258e9[_0x77da('0x33')]=_[_0x77da('0x34')](_0x2258e9[_0x77da('0x2e')],_0x2258e9['query']);_0x4d395a['attributes']=_[_0x77da('0x34')](_0x2258e9[_0x77da('0x2e')],qs['fields'](_0x496ecd[_0x77da('0x31')][_0x77da('0x35')]));_0x4d395a[_0x77da('0x36')]=_0x4d395a[_0x77da('0x36')][_0x77da('0x37')]?_0x4d395a[_0x77da('0x36')]:_0x2258e9[_0x77da('0x2e')];if(!_0x496ecd['query'][_0x77da('0x38')]('nolimit')){_0x4d395a['limit']=qs['limit'](_0x496ecd[_0x77da('0x31')]['limit']);_0x4d395a[_0x77da('0x19')]=qs[_0x77da('0x19')](_0x496ecd[_0x77da('0x31')][_0x77da('0x19')]);}_0x4d395a[_0x77da('0x39')]=qs[_0x77da('0x3a')](_0x496ecd[_0x77da('0x31')]['sort']);_0x4d395a[_0x77da('0x3b')]=qs[_0x77da('0x33')](_[_0x77da('0x3c')](_0x496ecd[_0x77da('0x31')],_0x2258e9[_0x77da('0x33')]),_0x410d09);if(_0x496ecd[_0x77da('0x31')]['filter']){_0x4d395a[_0x77da('0x3b')]=_[_0x77da('0x3d')](_0x4d395a[_0x77da('0x3b')],{'$or':_['map'](_0x410d09,function(_0xc5f0b8){if(_0xc5f0b8['type']!=='VIRTUAL'){var _0x599e21={};_0x599e21[_0xc5f0b8['name']]={'$like':'%'+_0x496ecd[_0x77da('0x31')][_0x77da('0x3e')]+'%'};return _0x599e21;}})});}_0x4d395a=_[_0x77da('0x3d')]({},_0x4d395a,_0x496ecd['options']);var _0x21d337={'where':_0x4d395a['where']};return db[_0x77da('0x2a')]['count'](_0x21d337)[_0x77da('0x21')](function(_0xa19b50){_0x30456a[_0x77da('0x1b')]=_0xa19b50;if(_0x496ecd[_0x77da('0x31')][_0x77da('0x3f')]){_0x4d395a['include']=[{'all':!![]}];}return db[_0x77da('0x2a')][_0x77da('0x40')](_0x4d395a);})[_0x77da('0x21')](function(_0x2f14f4){_0x30456a[_0x77da('0x41')]=_0x2f14f4;return _0x30456a;})[_0x77da('0x21')](respondWithFilteredResult(_0x5b4638,_0x4d395a))['catch'](handleError(_0x5b4638,null));};exports[_0x77da('0x42')]=function(_0x2f0495,_0x21de41){var _0x2dfeca={'raw':![],'where':{'id':_0x2f0495[_0x77da('0x43')]['id']}},_0x7d11f9={};_0x7d11f9['model']=_[_0x77da('0x32')](db['ScreenRecording'][_0x77da('0x44')]);_0x7d11f9[_0x77da('0x31')]=_[_0x77da('0x32')](_0x2f0495['query']);_0x7d11f9[_0x77da('0x33')]=_[_0x77da('0x34')](_0x7d11f9[_0x77da('0x2e')],_0x7d11f9[_0x77da('0x31')]);_0x2dfeca[_0x77da('0x36')]=_[_0x77da('0x34')](_0x7d11f9[_0x77da('0x2e')],qs[_0x77da('0x35')](_0x2f0495[_0x77da('0x31')]['fields']));_0x2dfeca[_0x77da('0x36')]=_0x2dfeca[_0x77da('0x36')][_0x77da('0x37')]?_0x2dfeca[_0x77da('0x36')]:_0x7d11f9[_0x77da('0x2e')];if(_0x2f0495[_0x77da('0x31')]['includeAll']){_0x2dfeca['include']=[{'all':!![]}];}_0x2dfeca=_[_0x77da('0x3d')]({},_0x2dfeca,_0x2f0495[_0x77da('0x45')]);return db[_0x77da('0x2a')][_0x77da('0x46')](_0x2dfeca)[_0x77da('0x21')](handleEntityNotFound(_0x21de41,null))[_0x77da('0x21')](respondWithResult(_0x21de41,null))['catch'](handleError(_0x21de41,null));};exports[_0x77da('0x47')]=function(_0x357ee4,_0x332f80){return db[_0x77da('0x2a')]['create'](_0x357ee4[_0x77da('0x48')],{})['then'](respondWithResult(_0x332f80,0xc9))['catch'](handleError(_0x332f80,null));};exports[_0x77da('0x20')]=function(_0x176f01,_0x143a68){if(_0x176f01[_0x77da('0x48')]['id']){delete _0x176f01['body']['id'];}delete _0x176f01[_0x77da('0x48')][_0x77da('0x49')];delete _0x176f01['body'][_0x77da('0x4a')];delete _0x176f01[_0x77da('0x48')]['closedAt'];delete _0x176f01[_0x77da('0x48')][_0x77da('0x4b')];return db[_0x77da('0x2a')][_0x77da('0x46')]({'where':{'id':_0x176f01[_0x77da('0x43')]['id']}})[_0x77da('0x21')](handleEntityNotFound(_0x143a68,null))[_0x77da('0x21')](saveUpdates(_0x176f01[_0x77da('0x48')],null))[_0x77da('0x21')](respondWithResult(_0x143a68,null))[_0x77da('0x4c')](handleError(_0x143a68,null));};exports['describe']=function(_0x3d04a3,_0x513017){return db[_0x77da('0x2a')][_0x77da('0x4d')]()[_0x77da('0x21')](respondWithResult(_0x513017,null))[_0x77da('0x4c')](handleError(_0x513017,null));};exports[_0x77da('0x4e')]=function(_0x8b377d,_0x3a78d2,_0x4c271d){var _0x17ed71=require(_0x77da('0x4f'));var _0x1a7115=![];var _0x353be9={};if(_0x8b377d['query'][_0x77da('0x2c')]&&_0x8b377d[_0x77da('0x31')][_0x77da('0x2c')]==='uniqueid'){_0x353be9['uniqueid']=_0x8b377d[_0x77da('0x43')]['id'];}else{_0x353be9['id']=_0x8b377d[_0x77da('0x43')]['id'];}return db[_0x77da('0x2a')][_0x77da('0x46')]({'where':_0x353be9,'attributes':['id',_0x77da('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x3a78d2,null))['then'](function(_0x365e91){if(_0x365e91){var _0x36f161=path['join'](config[_0x77da('0x50')],_0x77da('0x51'),_0x365e91[_0x77da('0x4b')]);var _0x4b1515=util[_0x77da('0x30')](_0x77da('0x52'),_0x36f161);if(fs['existsSync'](_0x4b1515)){_0x1a7115=!![];return _0x17ed71[_0x77da('0x53')](_0x4b1515,_0x36f161,config[_0x77da('0x54')][_0x77da('0x55')])[_0x77da('0x21')](function(){return _0x365e91;});}return _0x365e91;}})[_0x77da('0x21')](function(_0x99ac27){if(_0x99ac27){var _0x1dc4ab=path[_0x77da('0x56')](config[_0x77da('0x50')],'server/files/screen_recordings',_0x99ac27[_0x77da('0x4b')]);if(!fs[_0x77da('0x57')](_0x1dc4ab)){throw new db[(_0x77da('0x58'))][(_0x77da('0x59'))](_0x77da('0x5a'));}if(_0x99ac27[_0x77da('0x5b')]){return _0x3a78d2['download'](_0x1dc4ab,_0x99ac27[_0x77da('0x5b')]+path[_0x77da('0x5c')](_0x1dc4ab),function(){if(_0x1a7115){fs[_0x77da('0x5d')](_0x1dc4ab);}});}else{return _0x3a78d2['download'](_0x1dc4ab,function(_0x3e5dd9){if(_0x1a7115){fs[_0x77da('0x5d')](_0x1dc4ab);}});}}})[_0x77da('0x4c')](function(_0x8592c7){if(_0x8592c7[_0x77da('0x5e')]===_0x77da('0x5a')){_0x3a78d2[_0x77da('0x18')](0x194)['send'](_0x77da('0x5f'));}else{return handleError(_0x3a78d2,null);}});};exports['destroy']=function(_0x211310,_0x1922ab){return db[_0x77da('0x2a')]['find']({'where':{'id':_0x211310[_0x77da('0x43')]['id']}})[_0x77da('0x21')](function(_0x282481){if(_[_0x77da('0x60')](_0x282481)){throw new ReferenceError('Entity\x20not\x20found');}return _0x282481;})['then'](function(_0x571b1b){var _0x6b74fd=path[_0x77da('0x56')](config[_0x77da('0x50')],_0x77da('0x51'),_0x571b1b[_0x77da('0x4b')]);logger[_0x77da('0x61')](_0x77da('0x62'),_0x6b74fd);if(!_[_0x77da('0x60')](_0x571b1b[_0x77da('0x4b')])&&fs[_0x77da('0x57')](_0x6b74fd)){logger['info'](_0x77da('0x63')+_0x6b74fd+_0x77da('0x64'));fs['unlinkSync'](_0x6b74fd);}_0x6b74fd=_0x6b74fd+'.cypher';if(!_[_0x77da('0x60')](_0x571b1b['value'])&&fs[_0x77da('0x57')](_0x6b74fd)){logger[_0x77da('0x61')](_0x77da('0x63')+_0x6b74fd+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x77da('0x65')](_0x6b74fd);}return _0x571b1b;})[_0x77da('0x21')](function(_0x27fc45){if(!_0x27fc45)throw new InternalError();return _0x27fc45[_0x77da('0x22')]();})[_0x77da('0x21')](function(){_0x1922ab['status'](0xcc)[_0x77da('0x23')]();})[_0x77da('0x4c')](handleError(_0x1922ab,null));};
\ No newline at end of file
index 1935b34..85e7e4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5bd6=['define','ScreenRecording','interactionid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports'];(function(_0x526a46,_0x119cc9){var _0x299cab=function(_0x49722b){while(--_0x49722b){_0x526a46['push'](_0x526a46['shift']());}};_0x299cab(++_0x119cc9);}(_0x5bd6,0x17d));var _0x65bd=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x5bd6[_0x2df507];return _0x1f7167;};'use strict';var _=require(_0x65bd('0x0'));var util=require(_0x65bd('0x1'));var logger=require(_0x65bd('0x2'))(_0x65bd('0x3'));var moment=require(_0x65bd('0x4'));var BPromise=require('bluebird');var rp=require(_0x65bd('0x5'));var fs=require('fs');var path=require(_0x65bd('0x6'));var rimraf=require(_0x65bd('0x7'));var config=require(_0x65bd('0x8'));var attributes=require(_0x65bd('0x9'));module[_0x65bd('0xa')]=function(_0x51e0bf,_0x53ce5c){return _0x51e0bf[_0x65bd('0xb')](_0x65bd('0xc'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x65bd('0xd'),'fields':[_0x65bd('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3fe9=['interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./screenRecording.attributes','define','ScreenRecording','screen_recordings'];(function(_0x447e7b,_0x28e9bb){var _0x371ab5=function(_0xe37082){while(--_0xe37082){_0x447e7b['push'](_0x447e7b['shift']());}};_0x371ab5(++_0x28e9bb);}(_0x3fe9,0xb7));var _0x93fe=function(_0x332cc1,_0x29d0f5){_0x332cc1=_0x332cc1-0x0;var _0x4c56b5=_0x3fe9[_0x332cc1];return _0x4c56b5;};'use strict';var _=require(_0x93fe('0x0'));var util=require(_0x93fe('0x1'));var logger=require(_0x93fe('0x2'))(_0x93fe('0x3'));var moment=require(_0x93fe('0x4'));var BPromise=require(_0x93fe('0x5'));var rp=require(_0x93fe('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x93fe('0x7'));var config=require('../../config/environment');var attributes=require(_0x93fe('0x8'));module['exports']=function(_0x3a9991,_0x40624c){return _0x3a9991[_0x93fe('0x9')](_0x93fe('0xa'),attributes,{'tableName':_0x93fe('0xb'),'paranoid':![],'indexes':[{'name':_0x93fe('0xc'),'fields':[_0x93fe('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 1f580d1..02d999a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x249a=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring'];(function(_0x44d9ab,_0x76bc69){var _0x31485e=function(_0x1e44ce){while(--_0x1e44ce){_0x44d9ab['push'](_0x44d9ab['shift']());}};_0x31485e(++_0x76bc69);}(_0x249a,0xad));var _0xa249=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x249a[_0x263a74];return _0x2aa86c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa249('0x0'));var BPromise=require(_0xa249('0x1'));var rs=require(_0xa249('0x2'));var fs=require('fs');var Redis=require(_0xa249('0x3'));var db=require(_0xa249('0x4'))['db'];var utils=require(_0xa249('0x5'));var logger=require('../../config/logger')(_0xa249('0x6'));var config=require(_0xa249('0x7'));var jayson=require(_0xa249('0x8'));var client=jayson['client'][_0xa249('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3fc1be,_0x2facb1,_0x2dc9c7){return new BPromise(function(_0x2708e2,_0xc44ba){return client[_0xa249('0xa')](_0x3fc1be,_0x2dc9c7)['then'](function(_0x33f187){logger[_0xa249('0xb')]('ScreenRecording,\x20%s,\x20%s',_0x2facb1,'request\x20sent');logger[_0xa249('0xc')](_0xa249('0xd'),_0x2facb1,_0xa249('0xe'),JSON[_0xa249('0xf')](_0x33f187));if(_0x33f187['error']){if(_0x33f187[_0xa249('0x10')][_0xa249('0x11')]===0x1f4){logger['error'](_0xa249('0x12'),_0x2facb1,_0x33f187[_0xa249('0x10')]['message']);return _0xc44ba(_0x33f187[_0xa249('0x10')][_0xa249('0x13')]);}logger[_0xa249('0x10')](_0xa249('0x12'),_0x2facb1,_0x33f187[_0xa249('0x10')][_0xa249('0x13')]);return _0x2708e2(_0x33f187['error'][_0xa249('0x13')]);}else{logger[_0xa249('0xb')](_0xa249('0x12'),_0x2facb1,_0xa249('0xe'));_0x2708e2(_0x33f187[_0xa249('0x14')][_0xa249('0x13')]);}})[_0xa249('0x15')](function(_0x4aaa72){logger[_0xa249('0x10')](_0xa249('0x12'),_0x2facb1,_0x4aaa72);_0xc44ba(_0x4aaa72);});});}
\ No newline at end of file
+var _0x3a68=['jayson/promise','client','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','code','message','error','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x44b2c7,_0x36e240){var _0x1bce7b=function(_0x4c5f96){while(--_0x4c5f96){_0x44b2c7['push'](_0x44b2c7['shift']());}};_0x1bce7b(++_0x36e240);}(_0x3a68,0x1c6));var _0x83a6=function(_0x50bf1e,_0x174cdb){_0x50bf1e=_0x50bf1e-0x0;var _0x340d3b=_0x3a68[_0x50bf1e];return _0x340d3b;};'use strict';var _=require(_0x83a6('0x0'));var util=require('util');var moment=require(_0x83a6('0x1'));var BPromise=require(_0x83a6('0x2'));var rs=require(_0x83a6('0x3'));var fs=require('fs');var Redis=require(_0x83a6('0x4'));var db=require(_0x83a6('0x5'))['db'];var utils=require(_0x83a6('0x6'));var logger=require('../../config/logger')(_0x83a6('0x7'));var config=require('../../config/environment');var jayson=require(_0x83a6('0x8'));var client=jayson[_0x83a6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2804d3,_0xf94e1c,_0xccf232){return new BPromise(function(_0x2906c6,_0x20a19a){return client[_0x83a6('0xa')](_0x2804d3,_0xccf232)[_0x83a6('0xb')](function(_0x202469){logger[_0x83a6('0xc')](_0x83a6('0xd'),_0xf94e1c,_0x83a6('0xe'));logger[_0x83a6('0xf')](_0x83a6('0x10'),_0xf94e1c,'request\x20sent',JSON['stringify'](_0x202469));if(_0x202469['error']){if(_0x202469['error'][_0x83a6('0x11')]===0x1f4){logger['error'](_0x83a6('0xd'),_0xf94e1c,_0x202469['error']['message']);return _0x20a19a(_0x202469['error'][_0x83a6('0x12')]);}logger[_0x83a6('0x13')](_0x83a6('0xd'),_0xf94e1c,_0x202469[_0x83a6('0x13')]['message']);return _0x2906c6(_0x202469[_0x83a6('0x13')][_0x83a6('0x12')]);}else{logger[_0x83a6('0xc')](_0x83a6('0xd'),_0xf94e1c,_0x83a6('0xe'));_0x2906c6(_0x202469[_0x83a6('0x14')][_0x83a6('0x12')]);}})[_0x83a6('0x15')](function(_0x5c2d1c){logger['error'](_0x83a6('0xd'),_0xf94e1c,_0x5c2d1c);_0x20a19a(_0x5c2d1c);});});}
\ No newline at end of file
index 3f8abe8..aab8ce4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55b9=['put','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','/:id','show','getLogoLogin','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','logo','extname','originalname','post','/:id/logo','file','%s%s','logologin','/:id/logo_login','single','addLogoLogin','preferred','addPreferred','favicon','addFavicon'];(function(_0x43119a,_0x3a1294){var _0x1cca88=function(_0x37a8e5){while(--_0x37a8e5){_0x43119a['push'](_0x43119a['shift']());}};_0x1cca88(++_0x3a1294);}(_0x55b9,0x80));var _0x955b=function(_0x4fa1b3,_0x3481cd){_0x4fa1b3=_0x4fa1b3-0x0;var _0x4c01f9=_0x55b9[_0x4fa1b3];return _0x4c01f9;};'use strict';var multer=require('multer');var util=require(_0x955b('0x0'));var path=require(_0x955b('0x1'));var timeout=require(_0x955b('0x2'));var express=require(_0x955b('0x3'));var router=express[_0x955b('0x4')]();var fs_extra=require(_0x955b('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x955b('0x6'));var controller=require(_0x955b('0x7'));router[_0x955b('0x8')]('/',auth[_0x955b('0x9')](),controller[_0x955b('0xa')]);router[_0x955b('0x8')](_0x955b('0xb'),controller['getDate']);router[_0x955b('0x8')](_0x955b('0xc'),controller[_0x955b('0xd')]);router[_0x955b('0x8')]('/:id/logo',controller['getLogo']);router[_0x955b('0x8')]('/:id/logo_login',controller[_0x955b('0xe')]);router[_0x955b('0x8')]('/:id/gdpr',controller[_0x955b('0xf')]);router[_0x955b('0x8')](_0x955b('0x10'),controller[_0x955b('0x11')]);router[_0x955b('0x8')](_0x955b('0x12'),controller[_0x955b('0x13')]);var upload=multer({'storage':multer[_0x955b('0x14')]({'destination':function(_0xa3e78,_0x595a80,_0x43aaae){_0x43aaae(null,path[_0x955b('0x15')](config[_0x955b('0x16')],_0x955b('0x17')));},'filename':function(_0x46ab88,_0x3d97e0,_0x33ef67){_0x33ef67(null,util[_0x955b('0x18')]('%s%s',_0x955b('0x19'),path[_0x955b('0x1a')](_0x3d97e0[_0x955b('0x1b')])));}})});router[_0x955b('0x1c')](_0x955b('0x1d'),upload['single'](_0x955b('0x1e')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x613739,_0x204b51,_0x5539de){_0x5539de(null,path[_0x955b('0x15')](config[_0x955b('0x16')],_0x955b('0x17')));},'filename':function(_0x1b7f00,_0x4571cb,_0x2dd897){_0x2dd897(null,util[_0x955b('0x18')](_0x955b('0x1f'),_0x955b('0x20'),path[_0x955b('0x1a')](_0x4571cb[_0x955b('0x1b')])));}})});router[_0x955b('0x1c')](_0x955b('0x21'),upload[_0x955b('0x22')](_0x955b('0x1e')),controller[_0x955b('0x23')]);var upload=multer({'storage':multer[_0x955b('0x14')]({'destination':function(_0x38af10,_0x5c1765,_0x5cd369){_0x5cd369(null,path['join'](config[_0x955b('0x16')],_0x955b('0x17')));},'filename':function(_0x399e9c,_0x9778a8,_0x284470){_0x284470(null,util[_0x955b('0x18')](_0x955b('0x1f'),_0x955b('0x24'),path[_0x955b('0x1a')](_0x9778a8[_0x955b('0x1b')])));}})});router[_0x955b('0x1c')](_0x955b('0x10'),upload[_0x955b('0x22')](_0x955b('0x1e')),controller[_0x955b('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xa7f9a4,_0x2a29a4,_0xce13a4){_0xce13a4(null,path[_0x955b('0x15')](config['root'],_0x955b('0x17')));},'filename':function(_0x12c226,_0x4270b4,_0x5d0cd1){_0x5d0cd1(null,util[_0x955b('0x18')](_0x955b('0x1f'),_0x955b('0x26'),path[_0x955b('0x1a')](_0x4270b4['originalname'])));}})});router[_0x955b('0x1c')]('/:id/favicon',upload[_0x955b('0x22')](_0x955b('0x1e')),controller[_0x955b('0x27')]);router[_0x955b('0x28')]('/:id',auth['isAuthenticated'](),controller['update']);module[_0x955b('0x29')]=router;
\ No newline at end of file
+var _0x0cc1=['/:id/logo','single','file','addLogo','diskStorage','root','logologin','addLogoLogin','preferred','originalname','favicon','addFavicon','put','/:id','isAuthenticated','update','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','/now','getDate','show','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','join','server/files/images/logos/','format','%s%s','logo','extname','post'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0cc1,0x171));var _0x10cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0cc1[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x10cc('0x0'));var util=require(_0x10cc('0x1'));var path=require('path');var timeout=require(_0x10cc('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x10cc('0x3'));var auth=require(_0x10cc('0x4'));var interaction=require(_0x10cc('0x5'));var config=require(_0x10cc('0x6'));var controller=require(_0x10cc('0x7'));router[_0x10cc('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x10cc('0x8')](_0x10cc('0x9'),controller[_0x10cc('0xa')]);router[_0x10cc('0x8')]('/:id',controller[_0x10cc('0xb')]);router[_0x10cc('0x8')]('/:id/logo',controller['getLogo']);router[_0x10cc('0x8')](_0x10cc('0xc'),controller[_0x10cc('0xd')]);router[_0x10cc('0x8')](_0x10cc('0xe'),controller[_0x10cc('0xf')]);router[_0x10cc('0x8')](_0x10cc('0x10'),controller[_0x10cc('0x11')]);router[_0x10cc('0x8')](_0x10cc('0x12'),controller[_0x10cc('0x13')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4423e0,_0x4cd0aa,_0xca6f1b){_0xca6f1b(null,path[_0x10cc('0x14')](config['root'],_0x10cc('0x15')));},'filename':function(_0x1fbc45,_0x57e03b,_0x404617){_0x404617(null,util[_0x10cc('0x16')](_0x10cc('0x17'),_0x10cc('0x18'),path[_0x10cc('0x19')](_0x57e03b['originalname'])));}})});router[_0x10cc('0x1a')](_0x10cc('0x1b'),upload[_0x10cc('0x1c')](_0x10cc('0x1d')),controller[_0x10cc('0x1e')]);var upload=multer({'storage':multer[_0x10cc('0x1f')]({'destination':function(_0x5ab24f,_0x25c7fb,_0x3477b9){_0x3477b9(null,path[_0x10cc('0x14')](config[_0x10cc('0x20')],_0x10cc('0x15')));},'filename':function(_0xed4c69,_0x4944c4,_0x5ad33f){_0x5ad33f(null,util[_0x10cc('0x16')](_0x10cc('0x17'),_0x10cc('0x21'),path['extname'](_0x4944c4['originalname'])));}})});router[_0x10cc('0x1a')](_0x10cc('0xc'),upload[_0x10cc('0x1c')](_0x10cc('0x1d')),controller[_0x10cc('0x22')]);var upload=multer({'storage':multer[_0x10cc('0x1f')]({'destination':function(_0x3ed889,_0x59e02b,_0x247a5c){_0x247a5c(null,path[_0x10cc('0x14')](config[_0x10cc('0x20')],_0x10cc('0x15')));},'filename':function(_0x277e49,_0x2171b2,_0x558d2a){_0x558d2a(null,util['format'](_0x10cc('0x17'),_0x10cc('0x23'),path[_0x10cc('0x19')](_0x2171b2[_0x10cc('0x24')])));}})});router['post'](_0x10cc('0x10'),upload[_0x10cc('0x1c')](_0x10cc('0x1d')),controller['addPreferred']);var upload=multer({'storage':multer[_0x10cc('0x1f')]({'destination':function(_0x50a81a,_0x16ecfa,_0x52dac6){_0x52dac6(null,path['join'](config[_0x10cc('0x20')],_0x10cc('0x15')));},'filename':function(_0x5c7987,_0x530453,_0x3c7720){_0x3c7720(null,util[_0x10cc('0x16')](_0x10cc('0x17'),_0x10cc('0x25'),path[_0x10cc('0x19')](_0x530453['originalname'])));}})});router['post'](_0x10cc('0x12'),upload[_0x10cc('0x1c')](_0x10cc('0x1d')),controller[_0x10cc('0x26')]);router[_0x10cc('0x27')](_0x10cc('0x28'),auth[_0x10cc('0x29')](),controller[_0x10cc('0x2a')]);module[_0x10cc('0x2b')]=router;
\ No newline at end of file
index e6cee3c..41b9e0d 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(_0x1b6827,_0x27ef7d){var _0x46ada0=function(_0x383f55){while(--_0x383f55){_0x1b6827['push'](_0x1b6827['shift']());}};_0x46ada0(++_0x27ef7d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}};
\ No newline at end of file
+var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0xc9165d,_0x2d9b5f){var _0x3dcc11=function(_0xd49f1b){while(--_0xd49f1b){_0xc9165d['push'](_0xc9165d['shift']());}};_0x3dcc11(++_0x2d9b5f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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 bd60745..b09bd58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0db=['rawAttributes','fieldName','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','type','options','includeAll','rows','show','params','keys','include','body','find','file','filename','logo','addLogoLogin','loginLogo','getLogo','getLicense','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','join','root','toLower','default_logo.svg','existsSync','Sequelize','upperFirst','\x20not\x20found','download','server/files/images/logos','preferred','default','custom','ValidationError','gdpr','securePassword','getPreferred','default_preferred.png','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','update','destroy','stack','name','index','Setting'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xf0db,0x12b));var _0xbf0d=function(_0x2efc19,_0xff8642){_0x2efc19=_0x2efc19-0x0;var _0x50c1f3=_0xf0db[_0x2efc19];return _0x50c1f3;};'use strict';var emlformat=require(_0xbf0d('0x0'));var rimraf=require(_0xbf0d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbf0d('0x2'));var rp=require(_0xbf0d('0x3'));var moment=require(_0xbf0d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbf0d('0x5'));var util=require(_0xbf0d('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xbf0d('0x7'));var ejs=require(_0xbf0d('0x8'));var fs=require('fs');var fs_extra=require(_0xbf0d('0x9'));var _=require(_0xbf0d('0xa'));var squel=require('squel');var crypto=require(_0xbf0d('0xb'));var jsforce=require(_0xbf0d('0xc'));var deskjs=require(_0xbf0d('0xd'));var toCsv=require(_0xbf0d('0x7'));var querystring=require(_0xbf0d('0xe'));var Papa=require(_0xbf0d('0xf'));var Redis=require(_0xbf0d('0x10'));var authService=require(_0xbf0d('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf0d('0x12'));var logger=require(_0xbf0d('0x13'))(_0xbf0d('0x14'));var utils=require(_0xbf0d('0x15'));var config=require(_0xbf0d('0x16'));var licenseUtil=require(_0xbf0d('0x17'));var db=require(_0xbf0d('0x18'))['db'];var jayson=require(_0xbf0d('0x19'));var client=jayson['client'][_0xbf0d('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x944006,_0x524565,_0xa968b9,_0x1ffb38){return new BPromise(function(_0x4e9399,_0x1b6bac){var _0x2e85b=_0x1ffb38||client;return _0x2e85b[_0xbf0d('0x1b')](_0x944006,_0xa968b9)[_0xbf0d('0x1c')](function(_0x35972e){logger[_0xbf0d('0x1d')](_0xbf0d('0x1e'),_0x524565,_0xbf0d('0x1f'));logger[_0xbf0d('0x20')](_0xbf0d('0x21'),_0x524565,_0xbf0d('0x1f'),JSON['stringify'](_0x35972e));if(_0x35972e[_0xbf0d('0x22')]){if(_0x35972e[_0xbf0d('0x22')][_0xbf0d('0x23')]===0x1f4){logger[_0xbf0d('0x22')](_0xbf0d('0x1e'),_0x524565,_0x35972e[_0xbf0d('0x22')][_0xbf0d('0x24')]);return _0x1b6bac(_0x35972e['error'][_0xbf0d('0x24')]);}logger['error'](_0xbf0d('0x1e'),_0x524565,_0x35972e[_0xbf0d('0x22')][_0xbf0d('0x24')]);return _0x4e9399(_0x35972e[_0xbf0d('0x22')]['message']);}else{logger[_0xbf0d('0x1d')](_0xbf0d('0x1e'),_0x524565,_0xbf0d('0x1f'));_0x4e9399(_0x35972e['result']['message']);}})[_0xbf0d('0x25')](function(_0x49c24b){logger[_0xbf0d('0x22')](_0xbf0d('0x1e'),_0x524565,_0x49c24b);_0x1b6bac(_0x49c24b);});});}function respondWithStatusCode(_0x43ca63,_0x213e66){_0x213e66=_0x213e66||0xcc;return function(_0x1d9724){if(_0x1d9724){return _0x43ca63[_0xbf0d('0x26')](_0x213e66);}return _0x43ca63[_0xbf0d('0x27')](_0x213e66)[_0xbf0d('0x28')]();};}function respondWithResult(_0x22aef0,_0x22f8c6){_0x22f8c6=_0x22f8c6||0xc8;return function(_0x31621d){if(_0x31621d){return _0x22aef0[_0xbf0d('0x27')](_0x22f8c6)[_0xbf0d('0x29')](_0x31621d);}};}function respondWithFilteredResult(_0x434687,_0x527dfe){return function(_0x10cf57){if(_0x10cf57){var _0x39837e=typeof _0x527dfe[_0xbf0d('0x2a')]===_0xbf0d('0x2b')&&typeof _0x527dfe['limit']===_0xbf0d('0x2b');var _0x4f6776=_0x10cf57[_0xbf0d('0x2c')];var _0x280098=_0x39837e?0x0:_0x527dfe[_0xbf0d('0x2a')];var _0x2adbc9=_0x39837e?_0x10cf57[_0xbf0d('0x2c')]:_0x527dfe[_0xbf0d('0x2a')]+_0x527dfe[_0xbf0d('0x2d')];var _0x37d362;if(_0x2adbc9>=_0x4f6776){_0x2adbc9=_0x4f6776;_0x37d362=0xc8;}else{_0x37d362=0xce;}_0x434687['status'](_0x37d362);return _0x434687['set'](_0xbf0d('0x2e'),_0x280098+'-'+_0x2adbc9+'/'+_0x4f6776)[_0xbf0d('0x29')](_0x10cf57);}return null;};}function patchUpdates(_0x4b29e1){return function(_0x290989){try{jsonpatch['apply'](_0x290989,_0x4b29e1,!![]);}catch(_0x535ef5){return BPromise[_0xbf0d('0x2f')](_0x535ef5);}return _0x290989[_0xbf0d('0x30')]();};}function saveUpdates(_0xcb0cb3,_0x4a2587){return function(_0x2dda96){if(_0x2dda96){return _0x2dda96[_0xbf0d('0x31')](_0xcb0cb3)[_0xbf0d('0x1c')](function(_0x106e91){return _0x106e91;});}return null;};}function removeEntity(_0x57f851,_0x37b30b){return function(_0x3c2e06){if(_0x3c2e06){return _0x3c2e06[_0xbf0d('0x32')]()['then'](function(){_0x57f851['status'](0xcc)[_0xbf0d('0x28')]();});}};}function handleEntityNotFound(_0x4fc7df,_0x3949ee){return function(_0x1b40a8){if(!_0x1b40a8){_0x4fc7df[_0xbf0d('0x26')](0x194);}return _0x1b40a8;};}function handleError(_0x1ac94d,_0x1c3fee){_0x1c3fee=_0x1c3fee||0x1f4;return function(_0x330b37){logger['error'](_0x330b37[_0xbf0d('0x33')]);if(_0x330b37[_0xbf0d('0x34')]){delete _0x330b37[_0xbf0d('0x34')];}_0x1ac94d[_0xbf0d('0x27')](_0x1c3fee)['send'](_0x330b37);};}exports[_0xbf0d('0x35')]=function(_0x4b0ee9,_0x3faf27){var _0x15b25a={},_0x1ed208={},_0x20cd8c={'count':0x0,'rows':[]};var _0x8b33db=_['map'](db[_0xbf0d('0x36')][_0xbf0d('0x37')],function(_0x4969d3){return{'name':_0x4969d3[_0xbf0d('0x38')],'type':_0x4969d3['type']['key']};});_0x1ed208[_0xbf0d('0x39')]=_[_0xbf0d('0x3a')](_0x8b33db,'name');_0x1ed208[_0xbf0d('0x3b')]=_['keys'](_0x4b0ee9[_0xbf0d('0x3b')]);_0x1ed208['filters']=_[_0xbf0d('0x3c')](_0x1ed208[_0xbf0d('0x39')],_0x1ed208[_0xbf0d('0x3b')]);_0x15b25a[_0xbf0d('0x3d')]=_['intersection'](_0x1ed208[_0xbf0d('0x39')],qs[_0xbf0d('0x3e')](_0x4b0ee9['query'][_0xbf0d('0x3e')]));_0x15b25a[_0xbf0d('0x3d')]=_0x15b25a[_0xbf0d('0x3d')][_0xbf0d('0x3f')]?_0x15b25a['attributes']:_0x1ed208[_0xbf0d('0x39')];if(!_0x4b0ee9[_0xbf0d('0x3b')][_0xbf0d('0x40')](_0xbf0d('0x41'))){_0x15b25a[_0xbf0d('0x2d')]=qs[_0xbf0d('0x2d')](_0x4b0ee9[_0xbf0d('0x3b')][_0xbf0d('0x2d')]);_0x15b25a['offset']=qs[_0xbf0d('0x2a')](_0x4b0ee9[_0xbf0d('0x3b')][_0xbf0d('0x2a')]);}_0x15b25a[_0xbf0d('0x42')]=qs['sort'](_0x4b0ee9[_0xbf0d('0x3b')]['sort']);_0x15b25a[_0xbf0d('0x43')]=qs[_0xbf0d('0x44')](_[_0xbf0d('0x45')](_0x4b0ee9[_0xbf0d('0x3b')],_0x1ed208[_0xbf0d('0x44')]),_0x8b33db);if(_0x4b0ee9['query'][_0xbf0d('0x46')]){_0x15b25a['where']=_[_0xbf0d('0x47')](_0x15b25a[_0xbf0d('0x43')],{'$or':_[_0xbf0d('0x3a')](_0x8b33db,function(_0x18fcda){if(_0x18fcda[_0xbf0d('0x48')]!=='VIRTUAL'){var _0x31b8d0={};_0x31b8d0[_0x18fcda[_0xbf0d('0x34')]]={'$like':'%'+_0x4b0ee9['query'][_0xbf0d('0x46')]+'%'};return _0x31b8d0;}})});}_0x15b25a=_['merge']({},_0x15b25a,_0x4b0ee9[_0xbf0d('0x49')]);var _0x573556={'where':_0x15b25a[_0xbf0d('0x43')]};return db[_0xbf0d('0x36')]['count'](_0x573556)[_0xbf0d('0x1c')](function(_0x157eab){_0x20cd8c[_0xbf0d('0x2c')]=_0x157eab;if(_0x4b0ee9[_0xbf0d('0x3b')][_0xbf0d('0x4a')]){_0x15b25a['include']=[{'all':!![]}];}return db[_0xbf0d('0x36')]['findAll'](_0x15b25a);})['then'](function(_0x5adf29){_0x20cd8c[_0xbf0d('0x4b')]=_0x5adf29;return _0x20cd8c;})['then'](respondWithFilteredResult(_0x3faf27,_0x15b25a))[_0xbf0d('0x25')](handleError(_0x3faf27,null));};exports[_0xbf0d('0x4c')]=function(_0x125690,_0x346168){var _0x26567c={'raw':![],'where':{'id':_0x125690[_0xbf0d('0x4d')]['id']}},_0x223ad2={};_0x223ad2[_0xbf0d('0x39')]=_[_0xbf0d('0x4e')](db[_0xbf0d('0x36')][_0xbf0d('0x37')]);_0x223ad2[_0xbf0d('0x3b')]=_[_0xbf0d('0x4e')](_0x125690[_0xbf0d('0x3b')]);_0x223ad2['filters']=_[_0xbf0d('0x3c')](_0x223ad2[_0xbf0d('0x39')],_0x223ad2[_0xbf0d('0x3b')]);_0x26567c[_0xbf0d('0x3d')]=_['intersection'](_0x223ad2[_0xbf0d('0x39')],qs[_0xbf0d('0x3e')](_0x125690['query'][_0xbf0d('0x3e')]));_0x26567c['attributes']=_0x26567c[_0xbf0d('0x3d')]['length']?_0x26567c['attributes']:_0x223ad2[_0xbf0d('0x39')];if(_0x125690[_0xbf0d('0x3b')]['includeAll']){_0x26567c[_0xbf0d('0x4f')]=[{'all':!![]}];}_0x26567c=_['merge']({},_0x26567c,_0x125690[_0xbf0d('0x49')]);return db[_0xbf0d('0x36')]['find'](_0x26567c)[_0xbf0d('0x1c')](handleEntityNotFound(_0x346168,null))[_0xbf0d('0x1c')](respondWithResult(_0x346168,null))[_0xbf0d('0x25')](handleError(_0x346168,null));};exports['update']=function(_0x5256bb,_0x775001){if(_0x5256bb[_0xbf0d('0x50')]['id']){delete _0x5256bb[_0xbf0d('0x50')]['id'];}return db['Setting'][_0xbf0d('0x51')]({'where':{'id':_0x5256bb[_0xbf0d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x775001,null))[_0xbf0d('0x1c')](saveUpdates(_0x5256bb[_0xbf0d('0x50')],null))[_0xbf0d('0x1c')](respondWithResult(_0x775001,null))[_0xbf0d('0x25')](handleError(_0x775001,null));};exports['addLogo']=function(_0x5bda6f,_0x99d532,_0x3f95b9){if(_0x5bda6f[_0xbf0d('0x52')]&&_0x5bda6f[_0xbf0d('0x52')][_0xbf0d('0x53')]){_0x5bda6f['body'][_0xbf0d('0x54')]=_0x5bda6f[_0xbf0d('0x52')]['filename'];}return db['Setting']['find']({'where':{'id':_0x5bda6f[_0xbf0d('0x4d')]['id']}})[_0xbf0d('0x1c')](handleEntityNotFound(_0x99d532,null))[_0xbf0d('0x1c')](saveUpdates(_0x5bda6f[_0xbf0d('0x50')],null))['then'](respondWithResult(_0x99d532,null))[_0xbf0d('0x25')](handleError(_0x99d532,null));};exports[_0xbf0d('0x55')]=function(_0x154455,_0x81c6f,_0x2fa5a7){if(_0x154455[_0xbf0d('0x52')]&&_0x154455['file']['filename']){_0x154455['body'][_0xbf0d('0x56')]=_0x154455[_0xbf0d('0x52')][_0xbf0d('0x53')];}return db[_0xbf0d('0x36')]['find']({'where':{'id':_0x154455[_0xbf0d('0x4d')]['id']}})[_0xbf0d('0x1c')](handleEntityNotFound(_0x81c6f,null))[_0xbf0d('0x1c')](saveUpdates(_0x154455[_0xbf0d('0x50')],null))['then'](respondWithResult(_0x81c6f,null))[_0xbf0d('0x25')](handleError(_0x81c6f,null));};var utilLicense=require('../../config/license/util');exports[_0xbf0d('0x57')]=function(_0x534398,_0x1ee0a4,_0x472d1b){var _0x2e2308='server/files/images/logos';var _0x415b90={'custom':![]};return utilLicense[_0xbf0d('0x58')]()[_0xbf0d('0x1c')](function(_0x2ce1bd){if(_0x2ce1bd){_0x415b90=_0x2ce1bd;}return db['Setting'][_0xbf0d('0x51')]({'where':{'id':_0x534398[_0xbf0d('0x4d')]['id']},'attributes':[_0xbf0d('0x54'),_0xbf0d('0x56'),'preferred',_0xbf0d('0x59'),_0xbf0d('0x5a'),_0xbf0d('0x5b'),_0xbf0d('0x5c'),_0xbf0d('0x5d')],'raw':!![]});})[_0xbf0d('0x1c')](handleEntityNotFound(_0x1ee0a4,null))[_0xbf0d('0x1c')](function(_0xbd0fd8){if(_0xbd0fd8){var _0x204570=_0xbd0fd8[_0xbf0d('0x54')]&&fs['existsSync'](path[_0xbf0d('0x5e')](config[_0xbf0d('0x5f')],_0x2e2308,_['toLower'](_0xbd0fd8[_0xbf0d('0x54')])))?path[_0xbf0d('0x5e')](config[_0xbf0d('0x5f')],_0x2e2308,_[_0xbf0d('0x60')](_0xbd0fd8['logo'])):path[_0xbf0d('0x5e')](config[_0xbf0d('0x5f')],_0x2e2308,_['toLower'](_0xbf0d('0x61')));var _0x142cde='default'+_['upperFirst'](_0xbf0d('0x54'));if(_0xbd0fd8[_0x142cde]||!_0x415b90['custom']){_0x204570=path['join'](config[_0xbf0d('0x5f')],_0x2e2308,_[_0xbf0d('0x60')](_0xbf0d('0x61')));}if(!fs[_0xbf0d('0x62')](_0x204570)){throw new db[(_0xbf0d('0x63'))]['ValidationError'](_[_0xbf0d('0x64')]('logo')+_0xbf0d('0x65'));}return _0x1ee0a4[_0xbf0d('0x66')](_0x204570);}})[_0xbf0d('0x25')](handleError(_0x1ee0a4,null));};var utilLicense=require(_0xbf0d('0x17'));exports['getLogoLogin']=function(_0x4abac9,_0x39242f,_0x523202){var _0x1b2cc9=_0xbf0d('0x67');var _0x5bb89a={'custom':![]};return utilLicense[_0xbf0d('0x58')]()['then'](function(_0x3c6177){if(_0x3c6177){_0x5bb89a=_0x3c6177;}return db[_0xbf0d('0x36')][_0xbf0d('0x51')]({'where':{'id':_0x4abac9['params']['id']},'attributes':[_0xbf0d('0x54'),_0xbf0d('0x56'),_0xbf0d('0x68'),_0xbf0d('0x59'),_0xbf0d('0x5a'),_0xbf0d('0x5b'),_0xbf0d('0x5c'),_0xbf0d('0x5d')],'raw':!![]});})['then'](handleEntityNotFound(_0x39242f,null))[_0xbf0d('0x1c')](function(_0x5787e6){if(_0x5787e6){var _0x564e10=_0x5787e6[_0xbf0d('0x56')]&&fs[_0xbf0d('0x62')](path[_0xbf0d('0x5e')](config[_0xbf0d('0x5f')],_0x1b2cc9,_['toLower'](_0x5787e6[_0xbf0d('0x56')])))?path['join'](config['root'],_0x1b2cc9,_[_0xbf0d('0x60')](_0x5787e6[_0xbf0d('0x56')])):path[_0xbf0d('0x5e')](config[_0xbf0d('0x5f')],_0x1b2cc9,_[_0xbf0d('0x60')]('default_loginLogo.svg'));var _0x5128b8=_0xbf0d('0x69')+_[_0xbf0d('0x64')]('loginLogo');if(_0x5787e6[_0x5128b8]||!_0x5bb89a[_0xbf0d('0x6a')]){_0x564e10=path['join'](config['root'],_0x1b2cc9,_[_0xbf0d('0x60')]('default_loginLogo.svg'));}if(!fs[_0xbf0d('0x62')](_0x564e10)){throw new db[(_0xbf0d('0x63'))][(_0xbf0d('0x6b'))](_[_0xbf0d('0x64')](_0xbf0d('0x56'))+_0xbf0d('0x65'));}return _0x39242f[_0xbf0d('0x66')](_0x564e10);}})[_0xbf0d('0x25')](handleError(_0x39242f,null));};exports[_0xbf0d('0x6c')]=function(_0x1e57f7,_0x2b3193){return db[_0xbf0d('0x36')][_0xbf0d('0x51')]({'where':{'id':_0x1e57f7[_0xbf0d('0x4d')]['id']},'attributes':[_0xbf0d('0x6d')]})[_0xbf0d('0x1c')](respondWithResult(_0x2b3193,null))[_0xbf0d('0x25')](handleError(_0x2b3193,null));};exports['addPreferred']=function(_0x179f54,_0x135785,_0x312e13){if(_0x179f54[_0xbf0d('0x52')]&&_0x179f54[_0xbf0d('0x52')]['filename']){_0x179f54[_0xbf0d('0x50')][_0xbf0d('0x68')]=_0x179f54[_0xbf0d('0x52')][_0xbf0d('0x53')];}return db[_0xbf0d('0x36')][_0xbf0d('0x51')]({'where':{'id':_0x179f54['params']['id']}})[_0xbf0d('0x1c')](handleEntityNotFound(_0x135785,null))[_0xbf0d('0x1c')](saveUpdates(_0x179f54[_0xbf0d('0x50')],null))[_0xbf0d('0x1c')](respondWithResult(_0x135785,null))[_0xbf0d('0x25')](handleError(_0x135785,null));};var utilLicense=require('../../config/license/util');exports[_0xbf0d('0x6e')]=function(_0x4fc5e3,_0x392e4c,_0x5607c7){var _0x1c5039=_0xbf0d('0x67');var _0x3e9de8={'custom':![]};return utilLicense[_0xbf0d('0x58')]()[_0xbf0d('0x1c')](function(_0x5be235){if(_0x5be235){_0x3e9de8=_0x5be235;}return db['Setting']['find']({'where':{'id':_0x4fc5e3[_0xbf0d('0x4d')]['id']},'attributes':[_0xbf0d('0x54'),_0xbf0d('0x56'),_0xbf0d('0x68'),_0xbf0d('0x59'),_0xbf0d('0x5a'),_0xbf0d('0x5b'),_0xbf0d('0x5c'),_0xbf0d('0x5d')],'raw':!![]});})[_0xbf0d('0x1c')](handleEntityNotFound(_0x392e4c,null))[_0xbf0d('0x1c')](function(_0x2074dd){if(_0x2074dd){var _0x4e2d11=_0x2074dd['preferred']&&fs[_0xbf0d('0x62')](path[_0xbf0d('0x5e')](config[_0xbf0d('0x5f')],_0x1c5039,_[_0xbf0d('0x60')](_0x2074dd[_0xbf0d('0x68')])))?path[_0xbf0d('0x5e')](config[_0xbf0d('0x5f')],_0x1c5039,_[_0xbf0d('0x60')](_0x2074dd['preferred'])):path[_0xbf0d('0x5e')](config[_0xbf0d('0x5f')],_0x1c5039,_[_0xbf0d('0x60')]('default_preferred.png'));var _0x39bd34=_0xbf0d('0x69')+_['upperFirst'](_0xbf0d('0x68'));if(_0x2074dd[_0x39bd34]||!_0x3e9de8[_0xbf0d('0x6a')]||!_0x3e9de8[_0xbf0d('0x68')]){_0x4e2d11=path[_0xbf0d('0x5e')](config[_0xbf0d('0x5f')],_0x1c5039,_[_0xbf0d('0x60')](_0xbf0d('0x6f')));}if(!fs[_0xbf0d('0x62')](_0x4e2d11)){throw new db[(_0xbf0d('0x63'))][(_0xbf0d('0x6b'))](_[_0xbf0d('0x64')]('preferred')+_0xbf0d('0x65'));}return _0x392e4c[_0xbf0d('0x66')](_0x4e2d11);}})['catch'](handleError(_0x392e4c,null));};exports['addFavicon']=function(_0x17562d,_0x210957,_0x165f77){if(_0x17562d['file']&&_0x17562d[_0xbf0d('0x52')]['filename']){_0x17562d['body'][_0xbf0d('0x59')]=_0x17562d[_0xbf0d('0x52')][_0xbf0d('0x53')];}return db[_0xbf0d('0x36')][_0xbf0d('0x51')]({'where':{'id':_0x17562d[_0xbf0d('0x4d')]['id']}})[_0xbf0d('0x1c')](handleEntityNotFound(_0x210957,null))[_0xbf0d('0x1c')](saveUpdates(_0x17562d[_0xbf0d('0x50')],null))[_0xbf0d('0x1c')](respondWithResult(_0x210957,null))[_0xbf0d('0x25')](handleError(_0x210957,null));};var utilLicense=require(_0xbf0d('0x17'));exports[_0xbf0d('0x70')]=function(_0x4a7afe,_0x3502ca,_0x88612f){var _0x3a7bc5='server/files/images/logos';var _0x177145={'custom':![]};return utilLicense['getLicense']()[_0xbf0d('0x1c')](function(_0x28dfbb){if(_0x28dfbb){_0x177145=_0x28dfbb;}return db[_0xbf0d('0x36')][_0xbf0d('0x51')]({'where':{'id':_0x4a7afe[_0xbf0d('0x4d')]['id']},'attributes':[_0xbf0d('0x54'),_0xbf0d('0x56'),_0xbf0d('0x68'),'favicon',_0xbf0d('0x5a'),_0xbf0d('0x5b'),_0xbf0d('0x5c'),_0xbf0d('0x5d')],'raw':!![]});})[_0xbf0d('0x1c')](handleEntityNotFound(_0x3502ca,null))[_0xbf0d('0x1c')](function(_0x4a33d4){if(_0x4a33d4){var _0x1d77ff=_0x4a33d4['favicon']&&fs[_0xbf0d('0x62')](path['join'](config[_0xbf0d('0x5f')],_0x3a7bc5,_[_0xbf0d('0x60')](_0x4a33d4[_0xbf0d('0x59')])))?path[_0xbf0d('0x5e')](config[_0xbf0d('0x5f')],_0x3a7bc5,_[_0xbf0d('0x60')](_0x4a33d4[_0xbf0d('0x59')])):path[_0xbf0d('0x5e')](config[_0xbf0d('0x5f')],_0x3a7bc5,_[_0xbf0d('0x60')](_0xbf0d('0x71')));var _0x9f0107=_0xbf0d('0x69')+_['upperFirst'](_0xbf0d('0x59'));if(_0x4a33d4[_0x9f0107]||!_0x177145['custom']){_0x1d77ff=path[_0xbf0d('0x5e')](config['root'],_0x3a7bc5,_['toLower']('default_favicon.ico'));}if(!fs[_0xbf0d('0x62')](_0x1d77ff)){throw new db['Sequelize']['ValidationError'](_['upperFirst'](_0xbf0d('0x59'))+_0xbf0d('0x65'));}return _0x3502ca[_0xbf0d('0x66')](_0x1d77ff);}})['catch'](handleError(_0x3502ca,null));};exports[_0xbf0d('0x72')]=function(_0x1a96ee,_0x1d0303){var _0x4cb2b2={'offset':moment()[_0xbf0d('0x73')]()};_0x4cb2b2[_0xbf0d('0x74')]=moment()[_0xbf0d('0x73')](_0x4cb2b2[_0xbf0d('0x2a')])[_0xbf0d('0x75')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x1d0303[_0xbf0d('0x27')](0xc8)['send'](_0x4cb2b2);};
\ No newline at end of file
+var _0xab5c=['send','map','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Setting','include','findAll','rows','show','params','includeAll','find','update','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','join','root','toLower','upperFirst','custom','existsSync','Sequelize','ValidationError','getLogoLogin','default_loginLogo.svg','\x20not\x20found','download','gdpr','addPreferred','default','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','fast-json-patch','moment','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','Setting,\x20%s,\x20%s','catch','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','sendStatus','stack'];(function(_0x130698,_0x5c47b1){var _0x1e442a=function(_0x16ca9c){while(--_0x16ca9c){_0x130698['push'](_0x130698['shift']());}};_0x1e442a(++_0x5c47b1);}(_0xab5c,0x134));var _0xcab5=function(_0x2792fe,_0x3a2d6a){_0x2792fe=_0x2792fe-0x0;var _0x37447d=_0xab5c[_0x2792fe];return _0x37447d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcab5('0x0'));var zipdir=require(_0xcab5('0x1'));var jsonpatch=require(_0xcab5('0x2'));var rp=require('request-promise');var moment=require(_0xcab5('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xcab5('0x4'));var sox=require('sox');var csv=require(_0xcab5('0x5'));var ejs=require(_0xcab5('0x6'));var fs=require('fs');var fs_extra=require(_0xcab5('0x7'));var _=require(_0xcab5('0x8'));var squel=require(_0xcab5('0x9'));var crypto=require(_0xcab5('0xa'));var jsforce=require(_0xcab5('0xb'));var deskjs=require(_0xcab5('0xc'));var toCsv=require(_0xcab5('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcab5('0xd'));var authService=require(_0xcab5('0xe'));var qs=require(_0xcab5('0xf'));var as=require(_0xcab5('0x10'));var hardwareService=require(_0xcab5('0x11'));var logger=require(_0xcab5('0x12'))(_0xcab5('0x13'));var utils=require(_0xcab5('0x14'));var config=require(_0xcab5('0x15'));var licenseUtil=require(_0xcab5('0x16'));var db=require(_0xcab5('0x17'))['db'];var jayson=require(_0xcab5('0x18'));var client=jayson[_0xcab5('0x19')][_0xcab5('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x5df008,_0x1d7977,_0x4cde53,_0x45da29){return new BPromise(function(_0x4956aa,_0x369510){var _0x202f1f=_0x45da29||client;return _0x202f1f[_0xcab5('0x1b')](_0x5df008,_0x4cde53)[_0xcab5('0x1c')](function(_0x206c10){logger[_0xcab5('0x1d')]('Setting,\x20%s,\x20%s',_0x1d7977,_0xcab5('0x1e'));logger[_0xcab5('0x1f')]('Setting,\x20%s,\x20%s,\x20%s',_0x1d7977,_0xcab5('0x1e'),JSON[_0xcab5('0x20')](_0x206c10));if(_0x206c10[_0xcab5('0x21')]){if(_0x206c10[_0xcab5('0x21')][_0xcab5('0x22')]===0x1f4){logger[_0xcab5('0x21')]('Setting,\x20%s,\x20%s',_0x1d7977,_0x206c10[_0xcab5('0x21')][_0xcab5('0x23')]);return _0x369510(_0x206c10[_0xcab5('0x21')][_0xcab5('0x23')]);}logger[_0xcab5('0x21')](_0xcab5('0x24'),_0x1d7977,_0x206c10[_0xcab5('0x21')][_0xcab5('0x23')]);return _0x4956aa(_0x206c10[_0xcab5('0x21')][_0xcab5('0x23')]);}else{logger['info'](_0xcab5('0x24'),_0x1d7977,'request\x20sent');_0x4956aa(_0x206c10['result'][_0xcab5('0x23')]);}})[_0xcab5('0x25')](function(_0x1163de){logger['error'](_0xcab5('0x24'),_0x1d7977,_0x1163de);_0x369510(_0x1163de);});});}function respondWithStatusCode(_0x56f194,_0x3dc1f9){_0x3dc1f9=_0x3dc1f9||0xcc;return function(_0x4baf66){if(_0x4baf66){return _0x56f194['sendStatus'](_0x3dc1f9);}return _0x56f194[_0xcab5('0x26')](_0x3dc1f9)[_0xcab5('0x27')]();};}function respondWithResult(_0x1a2861,_0x98996a){_0x98996a=_0x98996a||0xc8;return function(_0x1b287b){if(_0x1b287b){return _0x1a2861[_0xcab5('0x26')](_0x98996a)[_0xcab5('0x28')](_0x1b287b);}};}function respondWithFilteredResult(_0x52be6a,_0x2e1637){return function(_0xe47123){if(_0xe47123){var _0x5bab5b=typeof _0x2e1637['offset']===_0xcab5('0x29')&&typeof _0x2e1637[_0xcab5('0x2a')]===_0xcab5('0x29');var _0x6dbd64=_0xe47123[_0xcab5('0x2b')];var _0x3a2fe3=_0x5bab5b?0x0:_0x2e1637[_0xcab5('0x2c')];var _0x7a5573=_0x5bab5b?_0xe47123[_0xcab5('0x2b')]:_0x2e1637[_0xcab5('0x2c')]+_0x2e1637[_0xcab5('0x2a')];var _0x1238ce;if(_0x7a5573>=_0x6dbd64){_0x7a5573=_0x6dbd64;_0x1238ce=0xc8;}else{_0x1238ce=0xce;}_0x52be6a[_0xcab5('0x26')](_0x1238ce);return _0x52be6a['set'](_0xcab5('0x2d'),_0x3a2fe3+'-'+_0x7a5573+'/'+_0x6dbd64)['json'](_0xe47123);}return null;};}function patchUpdates(_0x28e165){return function(_0x18307f){try{jsonpatch[_0xcab5('0x2e')](_0x18307f,_0x28e165,!![]);}catch(_0x1ea987){return BPromise[_0xcab5('0x2f')](_0x1ea987);}return _0x18307f[_0xcab5('0x30')]();};}function saveUpdates(_0x1e2988,_0x1407c0){return function(_0x5439a1){if(_0x5439a1){return _0x5439a1['update'](_0x1e2988)['then'](function(_0x380d73){return _0x380d73;});}return null;};}function removeEntity(_0xd39f94,_0x19a7ef){return function(_0x3ed180){if(_0x3ed180){return _0x3ed180[_0xcab5('0x31')]()[_0xcab5('0x1c')](function(){_0xd39f94[_0xcab5('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x252a1f,_0x12ae99){return function(_0x2a9231){if(!_0x2a9231){_0x252a1f[_0xcab5('0x32')](0x194);}return _0x2a9231;};}function handleError(_0xf0585e,_0xe6f7c5){_0xe6f7c5=_0xe6f7c5||0x1f4;return function(_0x3b657c){logger['error'](_0x3b657c[_0xcab5('0x33')]);if(_0x3b657c['name']){delete _0x3b657c['name'];}_0xf0585e[_0xcab5('0x26')](_0xe6f7c5)[_0xcab5('0x34')](_0x3b657c);};}exports['index']=function(_0x2629fa,_0x221cb3){var _0x18c0b3={},_0x431b8f={},_0xfd4c21={'count':0x0,'rows':[]};var _0x529dcf=_[_0xcab5('0x35')](db['Setting']['rawAttributes'],function(_0x2d713c){return{'name':_0x2d713c['fieldName'],'type':_0x2d713c[_0xcab5('0x36')][_0xcab5('0x37')]};});_0x431b8f[_0xcab5('0x38')]=_[_0xcab5('0x35')](_0x529dcf,_0xcab5('0x39'));_0x431b8f[_0xcab5('0x3a')]=_[_0xcab5('0x3b')](_0x2629fa[_0xcab5('0x3a')]);_0x431b8f[_0xcab5('0x3c')]=_[_0xcab5('0x3d')](_0x431b8f['model'],_0x431b8f[_0xcab5('0x3a')]);_0x18c0b3[_0xcab5('0x3e')]=_[_0xcab5('0x3d')](_0x431b8f[_0xcab5('0x38')],qs[_0xcab5('0x3f')](_0x2629fa[_0xcab5('0x3a')][_0xcab5('0x3f')]));_0x18c0b3['attributes']=_0x18c0b3['attributes'][_0xcab5('0x40')]?_0x18c0b3['attributes']:_0x431b8f[_0xcab5('0x38')];if(!_0x2629fa[_0xcab5('0x3a')][_0xcab5('0x41')](_0xcab5('0x42'))){_0x18c0b3[_0xcab5('0x2a')]=qs[_0xcab5('0x2a')](_0x2629fa[_0xcab5('0x3a')][_0xcab5('0x2a')]);_0x18c0b3['offset']=qs[_0xcab5('0x2c')](_0x2629fa[_0xcab5('0x3a')][_0xcab5('0x2c')]);}_0x18c0b3[_0xcab5('0x43')]=qs['sort'](_0x2629fa[_0xcab5('0x3a')][_0xcab5('0x44')]);_0x18c0b3[_0xcab5('0x45')]=qs[_0xcab5('0x3c')](_[_0xcab5('0x46')](_0x2629fa['query'],_0x431b8f[_0xcab5('0x3c')]),_0x529dcf);if(_0x2629fa['query'][_0xcab5('0x47')]){_0x18c0b3[_0xcab5('0x45')]=_[_0xcab5('0x48')](_0x18c0b3['where'],{'$or':_[_0xcab5('0x35')](_0x529dcf,function(_0x23c679){if(_0x23c679['type']!=='VIRTUAL'){var _0x1e9701={};_0x1e9701[_0x23c679['name']]={'$like':'%'+_0x2629fa[_0xcab5('0x3a')]['filter']+'%'};return _0x1e9701;}})});}_0x18c0b3=_[_0xcab5('0x48')]({},_0x18c0b3,_0x2629fa[_0xcab5('0x49')]);var _0x64ebd0={'where':_0x18c0b3[_0xcab5('0x45')]};return db[_0xcab5('0x4a')]['count'](_0x64ebd0)[_0xcab5('0x1c')](function(_0x438ffe){_0xfd4c21['count']=_0x438ffe;if(_0x2629fa[_0xcab5('0x3a')]['includeAll']){_0x18c0b3[_0xcab5('0x4b')]=[{'all':!![]}];}return db[_0xcab5('0x4a')][_0xcab5('0x4c')](_0x18c0b3);})['then'](function(_0x50b9ed){_0xfd4c21[_0xcab5('0x4d')]=_0x50b9ed;return _0xfd4c21;})[_0xcab5('0x1c')](respondWithFilteredResult(_0x221cb3,_0x18c0b3))['catch'](handleError(_0x221cb3,null));};exports[_0xcab5('0x4e')]=function(_0x462748,_0x373e69){var _0x272b16={'raw':![],'where':{'id':_0x462748[_0xcab5('0x4f')]['id']}},_0x966d0d={};_0x966d0d[_0xcab5('0x38')]=_[_0xcab5('0x3b')](db[_0xcab5('0x4a')]['rawAttributes']);_0x966d0d[_0xcab5('0x3a')]=_[_0xcab5('0x3b')](_0x462748[_0xcab5('0x3a')]);_0x966d0d['filters']=_[_0xcab5('0x3d')](_0x966d0d[_0xcab5('0x38')],_0x966d0d['query']);_0x272b16[_0xcab5('0x3e')]=_[_0xcab5('0x3d')](_0x966d0d[_0xcab5('0x38')],qs[_0xcab5('0x3f')](_0x462748[_0xcab5('0x3a')][_0xcab5('0x3f')]));_0x272b16['attributes']=_0x272b16[_0xcab5('0x3e')][_0xcab5('0x40')]?_0x272b16[_0xcab5('0x3e')]:_0x966d0d[_0xcab5('0x38')];if(_0x462748[_0xcab5('0x3a')][_0xcab5('0x50')]){_0x272b16['include']=[{'all':!![]}];}_0x272b16=_[_0xcab5('0x48')]({},_0x272b16,_0x462748[_0xcab5('0x49')]);return db[_0xcab5('0x4a')][_0xcab5('0x51')](_0x272b16)['then'](handleEntityNotFound(_0x373e69,null))[_0xcab5('0x1c')](respondWithResult(_0x373e69,null))[_0xcab5('0x25')](handleError(_0x373e69,null));};exports[_0xcab5('0x52')]=function(_0x3db3e8,_0x432900){if(_0x3db3e8[_0xcab5('0x53')]['id']){delete _0x3db3e8[_0xcab5('0x53')]['id'];}return db['Setting'][_0xcab5('0x51')]({'where':{'id':_0x3db3e8[_0xcab5('0x4f')]['id']}})['then'](handleEntityNotFound(_0x432900,null))[_0xcab5('0x1c')](saveUpdates(_0x3db3e8['body'],null))[_0xcab5('0x1c')](respondWithResult(_0x432900,null))[_0xcab5('0x25')](handleError(_0x432900,null));};exports[_0xcab5('0x54')]=function(_0x18adf4,_0xf0a3f4,_0x1f02c7){if(_0x18adf4[_0xcab5('0x55')]&&_0x18adf4[_0xcab5('0x55')][_0xcab5('0x56')]){_0x18adf4[_0xcab5('0x53')][_0xcab5('0x57')]=_0x18adf4[_0xcab5('0x55')][_0xcab5('0x56')];}return db[_0xcab5('0x4a')][_0xcab5('0x51')]({'where':{'id':_0x18adf4['params']['id']}})[_0xcab5('0x1c')](handleEntityNotFound(_0xf0a3f4,null))['then'](saveUpdates(_0x18adf4[_0xcab5('0x53')],null))[_0xcab5('0x1c')](respondWithResult(_0xf0a3f4,null))[_0xcab5('0x25')](handleError(_0xf0a3f4,null));};exports[_0xcab5('0x58')]=function(_0x4a4471,_0x2ba1eb,_0x627797){if(_0x4a4471[_0xcab5('0x55')]&&_0x4a4471[_0xcab5('0x55')]['filename']){_0x4a4471[_0xcab5('0x53')][_0xcab5('0x59')]=_0x4a4471['file'][_0xcab5('0x56')];}return db[_0xcab5('0x4a')]['find']({'where':{'id':_0x4a4471['params']['id']}})[_0xcab5('0x1c')](handleEntityNotFound(_0x2ba1eb,null))[_0xcab5('0x1c')](saveUpdates(_0x4a4471[_0xcab5('0x53')],null))['then'](respondWithResult(_0x2ba1eb,null))['catch'](handleError(_0x2ba1eb,null));};var utilLicense=require('../../config/license/util');exports[_0xcab5('0x5a')]=function(_0x4a782f,_0x382e82,_0x1de366){var _0x335b70=_0xcab5('0x5b');var _0x525d48={'custom':![]};return utilLicense[_0xcab5('0x5c')]()[_0xcab5('0x1c')](function(_0x577505){if(_0x577505){_0x525d48=_0x577505;}return db['Setting'][_0xcab5('0x51')]({'where':{'id':_0x4a782f[_0xcab5('0x4f')]['id']},'attributes':['logo',_0xcab5('0x59'),_0xcab5('0x5d'),_0xcab5('0x5e'),_0xcab5('0x5f'),_0xcab5('0x60'),_0xcab5('0x61'),_0xcab5('0x62')],'raw':!![]});})['then'](handleEntityNotFound(_0x382e82,null))[_0xcab5('0x1c')](function(_0x511869){if(_0x511869){var _0x4d26f0=_0x511869[_0xcab5('0x57')]&&fs['existsSync'](path[_0xcab5('0x63')](config[_0xcab5('0x64')],_0x335b70,_['toLower'](_0x511869[_0xcab5('0x57')])))?path[_0xcab5('0x63')](config[_0xcab5('0x64')],_0x335b70,_['toLower'](_0x511869['logo'])):path[_0xcab5('0x63')](config[_0xcab5('0x64')],_0x335b70,_[_0xcab5('0x65')]('default_logo.svg'));var _0x37d0e1='default'+_[_0xcab5('0x66')](_0xcab5('0x57'));if(_0x511869[_0x37d0e1]||!_0x525d48[_0xcab5('0x67')]){_0x4d26f0=path[_0xcab5('0x63')](config[_0xcab5('0x64')],_0x335b70,_[_0xcab5('0x65')]('default_logo.svg'));}if(!fs[_0xcab5('0x68')](_0x4d26f0)){throw new db[(_0xcab5('0x69'))][(_0xcab5('0x6a'))](_['upperFirst'](_0xcab5('0x57'))+'\x20not\x20found');}return _0x382e82['download'](_0x4d26f0);}})[_0xcab5('0x25')](handleError(_0x382e82,null));};var utilLicense=require('../../config/license/util');exports[_0xcab5('0x6b')]=function(_0x35ae78,_0x27ad7d,_0x1acb1e){var _0x1666d3=_0xcab5('0x5b');var _0x1dff1c={'custom':![]};return utilLicense[_0xcab5('0x5c')]()[_0xcab5('0x1c')](function(_0x110924){if(_0x110924){_0x1dff1c=_0x110924;}return db[_0xcab5('0x4a')][_0xcab5('0x51')]({'where':{'id':_0x35ae78[_0xcab5('0x4f')]['id']},'attributes':[_0xcab5('0x57'),_0xcab5('0x59'),_0xcab5('0x5d'),_0xcab5('0x5e'),_0xcab5('0x5f'),_0xcab5('0x60'),_0xcab5('0x61'),_0xcab5('0x62')],'raw':!![]});})[_0xcab5('0x1c')](handleEntityNotFound(_0x27ad7d,null))[_0xcab5('0x1c')](function(_0x52bf95){if(_0x52bf95){var _0x3ba02f=_0x52bf95['loginLogo']&&fs['existsSync'](path[_0xcab5('0x63')](config[_0xcab5('0x64')],_0x1666d3,_[_0xcab5('0x65')](_0x52bf95['loginLogo'])))?path['join'](config['root'],_0x1666d3,_[_0xcab5('0x65')](_0x52bf95[_0xcab5('0x59')])):path[_0xcab5('0x63')](config[_0xcab5('0x64')],_0x1666d3,_[_0xcab5('0x65')](_0xcab5('0x6c')));var _0x2c5c84='default'+_[_0xcab5('0x66')]('loginLogo');if(_0x52bf95[_0x2c5c84]||!_0x1dff1c[_0xcab5('0x67')]){_0x3ba02f=path['join'](config[_0xcab5('0x64')],_0x1666d3,_['toLower']('default_loginLogo.svg'));}if(!fs['existsSync'](_0x3ba02f)){throw new db[(_0xcab5('0x69'))][(_0xcab5('0x6a'))](_[_0xcab5('0x66')]('loginLogo')+_0xcab5('0x6d'));}return _0x27ad7d[_0xcab5('0x6e')](_0x3ba02f);}})[_0xcab5('0x25')](handleError(_0x27ad7d,null));};exports[_0xcab5('0x6f')]=function(_0x44c3fe,_0x4dbf82){return db[_0xcab5('0x4a')][_0xcab5('0x51')]({'where':{'id':_0x44c3fe[_0xcab5('0x4f')]['id']},'attributes':['securePassword']})[_0xcab5('0x1c')](respondWithResult(_0x4dbf82,null))[_0xcab5('0x25')](handleError(_0x4dbf82,null));};exports[_0xcab5('0x70')]=function(_0x539bed,_0xadc11b,_0x2a41f7){if(_0x539bed[_0xcab5('0x55')]&&_0x539bed[_0xcab5('0x55')][_0xcab5('0x56')]){_0x539bed[_0xcab5('0x53')][_0xcab5('0x5d')]=_0x539bed[_0xcab5('0x55')][_0xcab5('0x56')];}return db[_0xcab5('0x4a')][_0xcab5('0x51')]({'where':{'id':_0x539bed['params']['id']}})[_0xcab5('0x1c')](handleEntityNotFound(_0xadc11b,null))[_0xcab5('0x1c')](saveUpdates(_0x539bed['body'],null))[_0xcab5('0x1c')](respondWithResult(_0xadc11b,null))['catch'](handleError(_0xadc11b,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0x84d831,_0xebe2ba,_0x4aba80){var _0x351fe8=_0xcab5('0x5b');var _0x4e0213={'custom':![]};return utilLicense[_0xcab5('0x5c')]()[_0xcab5('0x1c')](function(_0x8edc75){if(_0x8edc75){_0x4e0213=_0x8edc75;}return db[_0xcab5('0x4a')][_0xcab5('0x51')]({'where':{'id':_0x84d831[_0xcab5('0x4f')]['id']},'attributes':['logo',_0xcab5('0x59'),_0xcab5('0x5d'),_0xcab5('0x5e'),'defaultLogo',_0xcab5('0x60'),_0xcab5('0x61'),_0xcab5('0x62')],'raw':!![]});})[_0xcab5('0x1c')](handleEntityNotFound(_0xebe2ba,null))['then'](function(_0x1e97bd){if(_0x1e97bd){var _0x3101fc=_0x1e97bd[_0xcab5('0x5d')]&&fs[_0xcab5('0x68')](path['join'](config[_0xcab5('0x64')],_0x351fe8,_['toLower'](_0x1e97bd[_0xcab5('0x5d')])))?path['join'](config['root'],_0x351fe8,_['toLower'](_0x1e97bd[_0xcab5('0x5d')])):path[_0xcab5('0x63')](config['root'],_0x351fe8,_['toLower']('default_preferred.png'));var _0x2a17ef=_0xcab5('0x71')+_[_0xcab5('0x66')]('preferred');if(_0x1e97bd[_0x2a17ef]||!_0x4e0213[_0xcab5('0x67')]||!_0x4e0213[_0xcab5('0x5d')]){_0x3101fc=path[_0xcab5('0x63')](config[_0xcab5('0x64')],_0x351fe8,_[_0xcab5('0x65')]('default_preferred.png'));}if(!fs['existsSync'](_0x3101fc)){throw new db[(_0xcab5('0x69'))][(_0xcab5('0x6a'))](_[_0xcab5('0x66')](_0xcab5('0x5d'))+'\x20not\x20found');}return _0xebe2ba[_0xcab5('0x6e')](_0x3101fc);}})[_0xcab5('0x25')](handleError(_0xebe2ba,null));};exports['addFavicon']=function(_0x175b1f,_0x30d9e7,_0x2db8c0){if(_0x175b1f['file']&&_0x175b1f['file'][_0xcab5('0x56')]){_0x175b1f[_0xcab5('0x53')]['favicon']=_0x175b1f['file'][_0xcab5('0x56')];}return db[_0xcab5('0x4a')]['find']({'where':{'id':_0x175b1f[_0xcab5('0x4f')]['id']}})[_0xcab5('0x1c')](handleEntityNotFound(_0x30d9e7,null))['then'](saveUpdates(_0x175b1f[_0xcab5('0x53')],null))[_0xcab5('0x1c')](respondWithResult(_0x30d9e7,null))[_0xcab5('0x25')](handleError(_0x30d9e7,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0x378073,_0x37f4d2,_0x13b110){var _0x1d25cd=_0xcab5('0x5b');var _0x4d0fd6={'custom':![]};return utilLicense[_0xcab5('0x5c')]()['then'](function(_0x161a21){if(_0x161a21){_0x4d0fd6=_0x161a21;}return db[_0xcab5('0x4a')][_0xcab5('0x51')]({'where':{'id':_0x378073['params']['id']},'attributes':[_0xcab5('0x57'),_0xcab5('0x59'),_0xcab5('0x5d'),_0xcab5('0x5e'),_0xcab5('0x5f'),'defaultLoginLogo',_0xcab5('0x61'),_0xcab5('0x62')],'raw':!![]});})[_0xcab5('0x1c')](handleEntityNotFound(_0x37f4d2,null))['then'](function(_0x3ee8f){if(_0x3ee8f){var _0x3d54e1=_0x3ee8f[_0xcab5('0x5e')]&&fs['existsSync'](path[_0xcab5('0x63')](config[_0xcab5('0x64')],_0x1d25cd,_['toLower'](_0x3ee8f[_0xcab5('0x5e')])))?path['join'](config[_0xcab5('0x64')],_0x1d25cd,_[_0xcab5('0x65')](_0x3ee8f[_0xcab5('0x5e')])):path[_0xcab5('0x63')](config['root'],_0x1d25cd,_[_0xcab5('0x65')](_0xcab5('0x72')));var _0x3bcc69=_0xcab5('0x71')+_[_0xcab5('0x66')](_0xcab5('0x5e'));if(_0x3ee8f[_0x3bcc69]||!_0x4d0fd6[_0xcab5('0x67')]){_0x3d54e1=path[_0xcab5('0x63')](config[_0xcab5('0x64')],_0x1d25cd,_[_0xcab5('0x65')]('default_favicon.ico'));}if(!fs[_0xcab5('0x68')](_0x3d54e1)){throw new db[(_0xcab5('0x69'))][(_0xcab5('0x6a'))](_[_0xcab5('0x66')]('favicon')+_0xcab5('0x6d'));}return _0x37f4d2['download'](_0x3d54e1);}})[_0xcab5('0x25')](handleError(_0x37f4d2,null));};exports[_0xcab5('0x73')]=function(_0xfe99d2,_0xf70671){var _0x2cec40={'offset':moment()[_0xcab5('0x74')]()};_0x2cec40[_0xcab5('0x75')]=moment()[_0xcab5('0x74')](_0x2cec40['offset'])[_0xcab5('0x76')](_0xcab5('0x77'));return _0xf70671[_0xcab5('0x26')](0xc8)['send'](_0x2cec40);};
\ No newline at end of file
index be1ef5b..8403686 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x175a55,_0x4082fd){var _0x167adf=function(_0x18ef07){while(--_0x18ef07){_0x175a55['push'](_0x175a55['shift']());}};_0x167adf(++_0x4082fd);}(_0x55ca,0x126));var _0xa55c=function(_0x21e034,_0x59fc14){_0x21e034=_0x21e034-0x0;var _0x1faab3=_0x55ca[_0x21e034];return _0x1faab3;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x2fcf18,_0x10009a){var _0x4c68cc=function(_0x444002){while(--_0x444002){_0x2fcf18['push'](_0x2fcf18['shift']());}};_0x4c68cc(++_0x10009a);}(_0x3e74,0x175));var _0x43e7=function(_0x5ad185,_0x461340){_0x5ad185=_0x5ad185-0x0;var _0x70f1cd=_0x3e74[_0x5ad185];return _0x70f1cd;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7068a31..8f863d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe5b=['../../config/logger','rpc','../../config/environment','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSetting','find','options','where','attributes','include','model','map','then','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x477caa,_0x3aeb99){var _0x2e560c=function(_0x4e22b7){while(--_0x4e22b7){_0x477caa['push'](_0x477caa['shift']());}};_0x2e560c(++_0x3aeb99);}(_0xbe5b,0x95));var _0xbbe5=function(_0x289c4d,_0xa9afdd){_0x289c4d=_0x289c4d-0x0;var _0x2a9b19=_0xbe5b[_0x289c4d];return _0x2a9b19;};'use strict';var _=require(_0xbbe5('0x0'));var util=require(_0xbbe5('0x1'));var moment=require('moment');var BPromise=require(_0xbbe5('0x2'));var rs=require(_0xbbe5('0x3'));var fs=require('fs');var Redis=require(_0xbbe5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbbe5('0x5'));var logger=require(_0xbbe5('0x6'))(_0xbbe5('0x7'));var config=require(_0xbbe5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbbe5('0x9')][_0xbbe5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53c8df,_0x427c87,_0x46fc3c){return new BPromise(function(_0x281732,_0x148dd0){return client[_0xbbe5('0xb')](_0x53c8df,_0x46fc3c)['then'](function(_0x58c59b){logger[_0xbbe5('0xc')](_0xbbe5('0xd'),_0x427c87,_0xbbe5('0xe'));logger[_0xbbe5('0xf')](_0xbbe5('0x10'),_0x427c87,'request\x20sent',JSON[_0xbbe5('0x11')](_0x58c59b));if(_0x58c59b[_0xbbe5('0x12')]){if(_0x58c59b['error'][_0xbbe5('0x13')]===0x1f4){logger[_0xbbe5('0x12')](_0xbbe5('0xd'),_0x427c87,_0x58c59b[_0xbbe5('0x12')][_0xbbe5('0x14')]);return _0x148dd0(_0x58c59b[_0xbbe5('0x12')][_0xbbe5('0x14')]);}logger[_0xbbe5('0x12')](_0xbbe5('0xd'),_0x427c87,_0x58c59b[_0xbbe5('0x12')]['message']);return _0x281732(_0x58c59b[_0xbbe5('0x12')][_0xbbe5('0x14')]);}else{logger[_0xbbe5('0xc')](_0xbbe5('0xd'),_0x427c87,_0xbbe5('0xe'));_0x281732(_0x58c59b['result'][_0xbbe5('0x14')]);}})[_0xbbe5('0x15')](function(_0x248dee){logger[_0xbbe5('0x12')](_0xbbe5('0xd'),_0x427c87,_0x248dee);_0x148dd0(_0x248dee);});});}exports[_0xbbe5('0x16')]=function(_0x32d117){var _0x470e94=this;return new Promise(function(_0x53ba73,_0xa6e0f4){return db['Setting'][_0xbbe5('0x17')]({'raw':_0x32d117['options']?_0x32d117[_0xbbe5('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x32d117[_0xbbe5('0x18')]?_0x32d117[_0xbbe5('0x18')][_0xbbe5('0x19')]||null:null,'attributes':_0x32d117[_0xbbe5('0x18')]?_0x32d117['options'][_0xbbe5('0x1a')]||null:null,'include':_0x32d117[_0xbbe5('0x18')]?_0x32d117['options'][_0xbbe5('0x1b')]?_['map'](_0x32d117[_0xbbe5('0x18')]['include'],function(_0x2dfb83){return{'model':db[_0x2dfb83[_0xbbe5('0x1c')]],'as':_0x2dfb83['as'],'attributes':_0x2dfb83[_0xbbe5('0x1a')],'include':_0x2dfb83[_0xbbe5('0x1b')]?_[_0xbbe5('0x1d')](_0x2dfb83[_0xbbe5('0x1b')],function(_0x171238){return{'model':db[_0x171238[_0xbbe5('0x1c')]],'as':_0x171238['as'],'attributes':_0x171238[_0xbbe5('0x1a')],'include':_0x171238[_0xbbe5('0x1b')]?_[_0xbbe5('0x1d')](_0x171238[_0xbbe5('0x1b')],function(_0x307e75){return{'model':db[_0x307e75[_0xbbe5('0x1c')]],'as':_0x307e75['as'],'attributes':_0x307e75['attributes']};}):[]};}):[]};}):[]:[]})[_0xbbe5('0x1e')](function(_0x3eb25b){logger[_0xbbe5('0xc')](_0xbbe5('0x16'),_0x32d117);logger[_0xbbe5('0xf')](_0xbbe5('0x16'),_0x32d117,JSON[_0xbbe5('0x11')](_0x3eb25b));_0x53ba73(_0x3eb25b);})[_0xbbe5('0x15')](function(_0x1e33c9){logger[_0xbbe5('0x12')](_0xbbe5('0x16'),_0x1e33c9[_0xbbe5('0x14')],_0x32d117);_0xa6e0f4(_0x470e94[_0xbbe5('0x12')](0x1f4,_0x1e33c9[_0xbbe5('0x14')]));});});};
\ No newline at end of file
+var _0xe248=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','Setting','find','options','raw','where','attributes','include','map','model','then','ShowSetting','catch','lodash','moment','bluebird'];(function(_0x474e8e,_0x2c406e){var _0x373747=function(_0x42f2a2){while(--_0x42f2a2){_0x474e8e['push'](_0x474e8e['shift']());}};_0x373747(++_0x2c406e);}(_0xe248,0x1cb));var _0x8e24=function(_0x5d3330,_0x2ee2bf){_0x5d3330=_0x5d3330-0x0;var _0x1bc8be=_0xe248[_0x5d3330];return _0x1bc8be;};'use strict';var _=require(_0x8e24('0x0'));var util=require('util');var moment=require(_0x8e24('0x1'));var BPromise=require(_0x8e24('0x2'));var rs=require(_0x8e24('0x3'));var fs=require('fs');var Redis=require(_0x8e24('0x4'));var db=require(_0x8e24('0x5'))['db'];var utils=require(_0x8e24('0x6'));var logger=require(_0x8e24('0x7'))('rpc');var config=require(_0x8e24('0x8'));var jayson=require(_0x8e24('0x9'));var client=jayson[_0x8e24('0xa')][_0x8e24('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x51a1d1,_0x2975f4,_0x22bcbf){return new BPromise(function(_0x4dfa93,_0x185229){return client[_0x8e24('0xc')](_0x51a1d1,_0x22bcbf)['then'](function(_0x5de9e9){logger[_0x8e24('0xd')](_0x8e24('0xe'),_0x2975f4,_0x8e24('0xf'));logger[_0x8e24('0x10')](_0x8e24('0x11'),_0x2975f4,_0x8e24('0xf'),JSON['stringify'](_0x5de9e9));if(_0x5de9e9[_0x8e24('0x12')]){if(_0x5de9e9['error'][_0x8e24('0x13')]===0x1f4){logger[_0x8e24('0x12')](_0x8e24('0xe'),_0x2975f4,_0x5de9e9[_0x8e24('0x12')]['message']);return _0x185229(_0x5de9e9['error'][_0x8e24('0x14')]);}logger[_0x8e24('0x12')](_0x8e24('0xe'),_0x2975f4,_0x5de9e9[_0x8e24('0x12')][_0x8e24('0x14')]);return _0x4dfa93(_0x5de9e9[_0x8e24('0x12')]['message']);}else{logger[_0x8e24('0xd')](_0x8e24('0xe'),_0x2975f4,'request\x20sent');_0x4dfa93(_0x5de9e9['result'][_0x8e24('0x14')]);}})['catch'](function(_0x394aed){logger[_0x8e24('0x12')](_0x8e24('0xe'),_0x2975f4,_0x394aed);_0x185229(_0x394aed);});});}exports['ShowSetting']=function(_0x443f6e){var _0x54a139=this;return new Promise(function(_0x3c607d,_0xaf340c){return db[_0x8e24('0x15')][_0x8e24('0x16')]({'raw':_0x443f6e['options']?_0x443f6e[_0x8e24('0x17')][_0x8e24('0x18')]===undefined?!![]:![]:!![],'where':_0x443f6e[_0x8e24('0x17')]?_0x443f6e[_0x8e24('0x17')][_0x8e24('0x19')]||null:null,'attributes':_0x443f6e[_0x8e24('0x17')]?_0x443f6e[_0x8e24('0x17')][_0x8e24('0x1a')]||null:null,'include':_0x443f6e[_0x8e24('0x17')]?_0x443f6e[_0x8e24('0x17')][_0x8e24('0x1b')]?_[_0x8e24('0x1c')](_0x443f6e[_0x8e24('0x17')][_0x8e24('0x1b')],function(_0x331409){return{'model':db[_0x331409['model']],'as':_0x331409['as'],'attributes':_0x331409[_0x8e24('0x1a')],'include':_0x331409['include']?_[_0x8e24('0x1c')](_0x331409['include'],function(_0x22f954){return{'model':db[_0x22f954[_0x8e24('0x1d')]],'as':_0x22f954['as'],'attributes':_0x22f954[_0x8e24('0x1a')],'include':_0x22f954[_0x8e24('0x1b')]?_[_0x8e24('0x1c')](_0x22f954[_0x8e24('0x1b')],function(_0x598d9a){return{'model':db[_0x598d9a[_0x8e24('0x1d')]],'as':_0x598d9a['as'],'attributes':_0x598d9a['attributes']};}):[]};}):[]};}):[]:[]})[_0x8e24('0x1e')](function(_0x4399f6){logger[_0x8e24('0xd')](_0x8e24('0x1f'),_0x443f6e);logger['debug'](_0x8e24('0x1f'),_0x443f6e,JSON['stringify'](_0x4399f6));_0x3c607d(_0x4399f6);})[_0x8e24('0x20')](function(_0x4422cc){logger[_0x8e24('0x12')]('ShowSetting',_0x4422cc[_0x8e24('0x14')],_0x443f6e);_0xaf340c(_0x54a139[_0x8e24('0x12')](0x1f4,_0x4422cc[_0x8e24('0x14')]));});});};
\ No newline at end of file
index 360273d..f5f7bd3 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','./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(_0x46d855,_0x32e80b){_0x46d855=_0x46d855-0x0;var _0x59e29a=_0xf494[_0x46d855];return _0x59e29a;};'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
+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(_0x584d71,_0x1d7934){_0x584d71=_0x584d71-0x0;var _0x4a63be=_0x1cb9[_0x584d71];return _0x4a63be;};'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
index 91be9d7..76d7cd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43e8=['twilio','skebby','connectel','clicksend','plivo','clickatell','bandwidth','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','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','exports','STRING','name','generate','ENUM'];(function(_0x4e5da0,_0x2765e8){var _0x2c7718=function(_0xa12ab0){while(--_0xa12ab0){_0x4e5da0['push'](_0x4e5da0['shift']());}};_0x2c7718(++_0x2765e8);}(_0x43e8,0x79));var _0x843e=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x43e8[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x843e('0x0')]={'name':{'type':Sequelize[_0x843e('0x1')],'unique':_0x843e('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x843e('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0x843e('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0x843e('0x1')],'defaultValue':function(){return rs[_0x843e('0x3')]();}},'phone':{'type':Sequelize[_0x843e('0x1')]},'type':{'type':Sequelize[_0x843e('0x4')](_0x843e('0x5'),_0x843e('0x6'),_0x843e('0x7'),_0x843e('0x8'),_0x843e('0x9'),_0x843e('0xa'),_0x843e('0xb'),'csc','infobip',_0x843e('0xc'))},'accountSid':{'type':Sequelize[_0x843e('0x1')]},'authId':{'type':Sequelize[_0x843e('0x1')]},'authToken':{'type':Sequelize[_0x843e('0x1')]},'smsMethod':{'type':Sequelize[_0x843e('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x843e('0x1')]},'password':{'type':Sequelize[_0x843e('0x1')]},'apiKey':{'type':Sequelize[_0x843e('0x1')]},'applicationId':{'type':Sequelize[_0x843e('0x1')]},'accountId':{'type':Sequelize[_0x843e('0x1')]},'senderString':{'type':Sequelize[_0x843e('0x1')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x843e('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x843e('0xd');}},'notificationSound':{'type':Sequelize[_0x843e('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x843e('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x843e('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x843e('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x843e('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x843e('0xf')],'comment':_0x843e('0x10')},'mandatoryDisposition':{'type':Sequelize[_0x843e('0xe')],'defaultValue':![],'comment':_0x843e('0x11'),'set':function(_0x15caeb){if(!_0x15caeb)this['setDataValue'](_0x843e('0x12'),null);this[_0x843e('0x13')](_0x843e('0x14'),_0x15caeb);}}};
\ No newline at end of file
+var _0x520c=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','name','generate','ENUM','twilio','skebby','connectel','plivo','clickatell','bandwidth','infobip','intelepeer','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}'];(function(_0x5ded06,_0x5a5b3){var _0xf1df13=function(_0x218e7f){while(--_0x218e7f){_0x5ded06['push'](_0x5ded06['shift']());}};_0xf1df13(++_0x5a5b3);}(_0x520c,0x17d));var _0xc520=function(_0x503790,_0x525c78){_0x503790=_0x503790-0x0;var _0x388092=_0x520c[_0x503790];return _0x388092;};'use strict';var Sequelize=require(_0xc520('0x0'));var rs=require(_0xc520('0x1'));module['exports']={'name':{'type':Sequelize[_0xc520('0x2')],'unique':_0xc520('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xc520('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xc520('0x2')],'defaultValue':function(){return rs[_0xc520('0x4')]();}},'phone':{'type':Sequelize[_0xc520('0x2')]},'type':{'type':Sequelize[_0xc520('0x5')](_0xc520('0x6'),_0xc520('0x7'),_0xc520('0x8'),'clicksend',_0xc520('0x9'),_0xc520('0xa'),_0xc520('0xb'),'csc',_0xc520('0xc'),_0xc520('0xd'))},'accountSid':{'type':Sequelize[_0xc520('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xc520('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xc520('0x2')]},'apiKey':{'type':Sequelize[_0xc520('0x2')]},'applicationId':{'type':Sequelize[_0xc520('0x2')]},'accountId':{'type':Sequelize[_0xc520('0x2')]},'senderString':{'type':Sequelize[_0xc520('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xc520('0xe');}},'notificationSound':{'type':Sequelize[_0xc520('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc520('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc520('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc520('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc520('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xc520('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xc520('0x11')},'mandatoryDisposition':{'type':Sequelize[_0xc520('0xf')],'defaultValue':![],'comment':_0xc520('0x12'),'set':function(_0x2c45db){if(!_0x2c45db)this[_0xc520('0x13')](_0xc520('0x14'),null);this['setDataValue'](_0xc520('0x15'),_0x2c45db);}}};
\ No newline at end of file
index e71cf48..a4d3b8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b89=['set','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority','finally','getApplications','getInteractions','Contact','User','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','dataValues','Messages','skebby_dispatch_id','requestid','statusInt','status_code','DELIVERED','intelepeer','redif','inspect','error_code','groupName','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','jayson/promise','client','http','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','catch','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','update','get','SmsAccounts','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','filters','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','findOne','hasOwnProperty','pick','SmsAccountId','removeDispositions','addAnswer','CannedAnswer','rows','removeAnswers','ids','notify','sms','SmsApplication','Applications','applications','orderBy','asc','account','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','twilio','From','MessageSid','skebby','from','sender','text','connectel','clicksend','messageId','message_id','plivo','Text','MessageUUID','infobip','results','csc','segmentedMessage','clickatell','replyMessageId','bandwidth','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','omit','Contacts','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x7b89,0x11c));var _0x97b8=function(_0x437a3c,_0x7ff03a){_0x437a3c=_0x437a3c-0x0;var _0x351213=_0x7b89[_0x437a3c];return _0x351213;};'use strict';var emlformat=require(_0x97b8('0x0'));var rimraf=require(_0x97b8('0x1'));var zipdir=require(_0x97b8('0x2'));var jsonpatch=require(_0x97b8('0x3'));var rp=require(_0x97b8('0x4'));var moment=require(_0x97b8('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x97b8('0x6'));var path=require(_0x97b8('0x7'));var sox=require(_0x97b8('0x8'));var csv=require(_0x97b8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97b8('0xa'));var _=require(_0x97b8('0xb'));var squel=require(_0x97b8('0xc'));var crypto=require(_0x97b8('0xd'));var jsforce=require(_0x97b8('0xe'));var deskjs=require(_0x97b8('0xf'));var toCsv=require(_0x97b8('0x9'));var querystring=require(_0x97b8('0x10'));var Papa=require(_0x97b8('0x11'));var Redis=require(_0x97b8('0x12'));var authService=require(_0x97b8('0x13'));var qs=require(_0x97b8('0x14'));var as=require(_0x97b8('0x15'));var hardwareService=require(_0x97b8('0x16'));var logger=require(_0x97b8('0x17'))(_0x97b8('0x18'));var utils=require(_0x97b8('0x19'));var config=require(_0x97b8('0x1a'));var licenseUtil=require(_0x97b8('0x1b'));var db=require(_0x97b8('0x1c'))['db'];config[_0x97b8('0x1d')]=_[_0x97b8('0x1e')](config[_0x97b8('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0x97b8('0x1f'))(new Redis(config[_0x97b8('0x1d')]));require(_0x97b8('0x20'))['register'](socket);var jayson=require(_0x97b8('0x21'));var client=jayson[_0x97b8('0x22')][_0x97b8('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x3e68d5,_0x8c300,_0x6bb493,_0xa34a83){return new BPromise(function(_0x207a10,_0x18008a){var _0x16ea7c=_0xa34a83||client;return _0x16ea7c[_0x97b8('0x24')](_0x3e68d5,_0x6bb493)[_0x97b8('0x25')](function(_0x48ac97){logger[_0x97b8('0x26')]('SmsAccount,\x20%s,\x20%s',_0x8c300,_0x97b8('0x27'));logger[_0x97b8('0x28')](_0x97b8('0x29'),_0x8c300,_0x97b8('0x27'),JSON[_0x97b8('0x2a')](_0x48ac97));if(_0x48ac97[_0x97b8('0x2b')]){if(_0x48ac97['error'][_0x97b8('0x2c')]===0x1f4){logger[_0x97b8('0x2b')](_0x97b8('0x2d'),_0x8c300,_0x48ac97[_0x97b8('0x2b')][_0x97b8('0x2e')]);return _0x18008a(_0x48ac97['error']['message']);}logger[_0x97b8('0x2b')](_0x97b8('0x2d'),_0x8c300,_0x48ac97[_0x97b8('0x2b')][_0x97b8('0x2e')]);return _0x207a10(_0x48ac97[_0x97b8('0x2b')][_0x97b8('0x2e')]);}else{logger[_0x97b8('0x26')](_0x97b8('0x2d'),_0x8c300,_0x97b8('0x27'));_0x207a10(_0x48ac97['result'][_0x97b8('0x2e')]);}})[_0x97b8('0x2f')](function(_0x590822){logger[_0x97b8('0x2b')](_0x97b8('0x2d'),_0x8c300,_0x590822);_0x18008a(_0x590822);});});}function respondWithStatusCode(_0x585c5f,_0x1ac6f4){_0x1ac6f4=_0x1ac6f4||0xcc;return function(_0x385e78){if(_0x385e78){return _0x585c5f[_0x97b8('0x30')](_0x1ac6f4);}return _0x585c5f['status'](_0x1ac6f4)[_0x97b8('0x31')]();};}function respondWithResult(_0x11182c,_0x411cdd){_0x411cdd=_0x411cdd||0xc8;return function(_0x512261){if(_0x512261){return _0x11182c[_0x97b8('0x32')](_0x411cdd)[_0x97b8('0x33')](_0x512261);}};}function respondWithFilteredResult(_0x1bfd8e,_0x1added){return function(_0x2263d7){if(_0x2263d7){var _0x15b7b9=typeof _0x1added['offset']===_0x97b8('0x34')&&typeof _0x1added[_0x97b8('0x35')]===_0x97b8('0x34');var _0x5c4f9b=_0x2263d7[_0x97b8('0x36')];var _0xce3a07=_0x15b7b9?0x0:_0x1added[_0x97b8('0x37')];var _0xc1b403=_0x15b7b9?_0x2263d7[_0x97b8('0x36')]:_0x1added[_0x97b8('0x37')]+_0x1added['limit'];var _0x3b5360;if(_0xc1b403>=_0x5c4f9b){_0xc1b403=_0x5c4f9b;_0x3b5360=0xc8;}else{_0x3b5360=0xce;}_0x1bfd8e[_0x97b8('0x32')](_0x3b5360);return _0x1bfd8e['set'](_0x97b8('0x38'),_0xce3a07+'-'+_0xc1b403+'/'+_0x5c4f9b)['json'](_0x2263d7);}return null;};}function patchUpdates(_0x3e2e3a){return function(_0xc41e9e){try{jsonpatch[_0x97b8('0x39')](_0xc41e9e,_0x3e2e3a,!![]);}catch(_0x18c3ca){return BPromise[_0x97b8('0x3a')](_0x18c3ca);}return _0xc41e9e['save']();};}function saveUpdates(_0x1dfebd,_0x2b53be){return function(_0x35a52e){if(_0x35a52e){return _0x35a52e[_0x97b8('0x3b')](_0x1dfebd)[_0x97b8('0x25')](function(_0x4773e3){return _0x4773e3;});}return null;};}function removeEntity(_0x1f23c6,_0x1792e0){return function(_0x45a52e){if(_0x45a52e){return _0x45a52e['destroy']()[_0x97b8('0x25')](function(){var _0x35354a=_0x45a52e[_0x97b8('0x3c')]({'plain':!![]});var _0x355035=_0x97b8('0x3d');return db['UserProfileResource'][_0x97b8('0x3e')]({'where':{'type':_0x355035,'resourceId':_0x35354a['id']}})[_0x97b8('0x25')](function(){return _0x45a52e;});})[_0x97b8('0x25')](function(){_0x1f23c6[_0x97b8('0x32')](0xcc)[_0x97b8('0x31')]();});}};}function handleEntityNotFound(_0x216038,_0x5b341c){return function(_0x599f0d){if(!_0x599f0d){_0x216038['sendStatus'](0x194);}return _0x599f0d;};}function handleError(_0x46746e,_0x6131e7){_0x6131e7=_0x6131e7||0x1f4;return function(_0x392e58){logger[_0x97b8('0x2b')](_0x392e58[_0x97b8('0x3f')]);if(_0x392e58[_0x97b8('0x40')]){delete _0x392e58[_0x97b8('0x40')];}_0x46746e['status'](_0x6131e7)[_0x97b8('0x41')](_0x392e58);};}exports[_0x97b8('0x42')]=function(_0x15e37a,_0x2f3f4f){var _0x5e3f99={'include':[{'model':db[_0x97b8('0x43')],'as':_0x97b8('0x44')}]},_0x37e159={},_0x3307f8={'count':0x0,'rows':[]};var _0x7214eb=_[_0x97b8('0x45')](db[_0x97b8('0x46')][_0x97b8('0x47')],function(_0x4e10b4){return{'name':_0x4e10b4[_0x97b8('0x48')],'type':_0x4e10b4[_0x97b8('0x49')][_0x97b8('0x4a')]};});_0x37e159[_0x97b8('0x4b')]=_[_0x97b8('0x45')](_0x7214eb,_0x97b8('0x40'));_0x37e159[_0x97b8('0x4c')]=_[_0x97b8('0x4d')](_0x15e37a[_0x97b8('0x4c')]);_0x37e159['filters']=_[_0x97b8('0x4e')](_0x37e159[_0x97b8('0x4b')],_0x37e159[_0x97b8('0x4c')]);_0x5e3f99['attributes']=_[_0x97b8('0x4e')](_0x37e159['model'],qs['fields'](_0x15e37a['query'][_0x97b8('0x4f')]));_0x5e3f99[_0x97b8('0x50')]=_0x5e3f99['attributes'][_0x97b8('0x51')]?_0x5e3f99['attributes']:_0x37e159[_0x97b8('0x4b')];if(!_0x15e37a[_0x97b8('0x4c')]['hasOwnProperty'](_0x97b8('0x52'))){_0x5e3f99[_0x97b8('0x35')]=qs['limit'](_0x15e37a[_0x97b8('0x4c')][_0x97b8('0x35')]);_0x5e3f99[_0x97b8('0x37')]=qs[_0x97b8('0x37')](_0x15e37a[_0x97b8('0x4c')][_0x97b8('0x37')]);}_0x5e3f99[_0x97b8('0x53')]=qs[_0x97b8('0x54')](_0x15e37a[_0x97b8('0x4c')][_0x97b8('0x54')]);_0x5e3f99['where']=qs[_0x97b8('0x55')](_['pick'](_0x15e37a[_0x97b8('0x4c')],_0x37e159[_0x97b8('0x55')]),_0x7214eb);if(_0x15e37a[_0x97b8('0x4c')]['filter']){_0x5e3f99['where']=_[_0x97b8('0x56')](_0x5e3f99[_0x97b8('0x57')],{'$or':_[_0x97b8('0x45')](_0x7214eb,function(_0x3adb24){if(_0x3adb24[_0x97b8('0x49')]!==_0x97b8('0x58')){var _0x3e1463={};_0x3e1463[_0x3adb24[_0x97b8('0x40')]]={'$like':'%'+_0x15e37a[_0x97b8('0x4c')][_0x97b8('0x59')]+'%'};return _0x3e1463;}})});}_0x5e3f99=_[_0x97b8('0x56')]({},_0x5e3f99,_0x15e37a[_0x97b8('0x5a')]);var _0x2bbd68={'where':_0x5e3f99[_0x97b8('0x57')]};return db[_0x97b8('0x46')][_0x97b8('0x36')](_0x2bbd68)['then'](function(_0x50e7d7){_0x3307f8[_0x97b8('0x36')]=_0x50e7d7;if(_0x15e37a['query'][_0x97b8('0x5b')]){_0x5e3f99[_0x97b8('0x5c')]=[{'all':!![]}];}return db['SmsAccount'][_0x97b8('0x5d')](_0x5e3f99);})['then'](function(_0x10aa7d){_0x3307f8['rows']=_0x10aa7d;return _0x3307f8;})[_0x97b8('0x25')](respondWithFilteredResult(_0x2f3f4f,_0x5e3f99))[_0x97b8('0x2f')](handleError(_0x2f3f4f,null));};exports[_0x97b8('0x5e')]=function(_0x5139a1,_0x51ceac){var _0x26a10c={'raw':![],'where':{'id':_0x5139a1[_0x97b8('0x5f')]['id']},'include':[{'model':db[_0x97b8('0x43')],'as':_0x97b8('0x44')}]},_0xec4dcd={};_0xec4dcd[_0x97b8('0x4b')]=_[_0x97b8('0x4d')](db['SmsAccount'][_0x97b8('0x47')]);_0xec4dcd[_0x97b8('0x4c')]=_['keys'](_0x5139a1[_0x97b8('0x4c')]);_0xec4dcd[_0x97b8('0x55')]=_['intersection'](_0xec4dcd['model'],_0xec4dcd['query']);_0x26a10c['attributes']=_[_0x97b8('0x4e')](_0xec4dcd[_0x97b8('0x4b')],qs['fields'](_0x5139a1[_0x97b8('0x4c')][_0x97b8('0x4f')]));_0x26a10c[_0x97b8('0x50')]=_0x26a10c['attributes']['length']?_0x26a10c[_0x97b8('0x50')]:_0xec4dcd[_0x97b8('0x4b')];if(_0x5139a1[_0x97b8('0x4c')][_0x97b8('0x5b')]){_0x26a10c[_0x97b8('0x5c')]=[{'all':!![]}];}_0x26a10c=_[_0x97b8('0x56')]({},_0x26a10c,_0x5139a1[_0x97b8('0x5a')]);return db[_0x97b8('0x46')][_0x97b8('0x60')](_0x26a10c)['then'](handleEntityNotFound(_0x51ceac,null))[_0x97b8('0x25')](respondWithResult(_0x51ceac,null))['catch'](handleError(_0x51ceac,null));};exports['create']=function(_0x264105,_0x5a21a4){return db['SmsAccount'][_0x97b8('0x61')](_0x264105[_0x97b8('0x62')],{})['then'](function(_0x38c2bf){var _0x489686=_0x264105['user']['get']({'plain':!![]});if(!_0x489686)throw new Error(_0x97b8('0x63'));if(_0x489686['role']===_0x97b8('0x64')){var _0x364ac2=_0x38c2bf[_0x97b8('0x3c')]({'plain':!![]});var _0x354113='SmsAccounts';return db['UserProfileSection'][_0x97b8('0x60')]({'where':{'name':_0x354113,'userProfileId':_0x489686[_0x97b8('0x65')]},'raw':!![]})[_0x97b8('0x25')](function(_0x294a12){if(_0x294a12&&_0x294a12[_0x97b8('0x66')]===0x0){return db[_0x97b8('0x67')]['create']({'name':_0x364ac2[_0x97b8('0x40')],'resourceId':_0x364ac2['id'],'type':_0x294a12[_0x97b8('0x40')],'sectionId':_0x294a12['id']},{})['then'](function(){return _0x38c2bf;});}else{return _0x38c2bf;}})[_0x97b8('0x2f')](function(_0x4bf754){logger[_0x97b8('0x2b')](_0x97b8('0x68'),_0x4bf754);throw _0x4bf754;});}return _0x38c2bf;})[_0x97b8('0x25')](respondWithResult(_0x5a21a4,0xc9))[_0x97b8('0x2f')](handleError(_0x5a21a4,null));};exports[_0x97b8('0x3b')]=function(_0x2c102e,_0x4ac880){if(_0x2c102e[_0x97b8('0x62')]['id']){delete _0x2c102e['body']['id'];}return db[_0x97b8('0x46')][_0x97b8('0x60')]({'where':{'id':_0x2c102e[_0x97b8('0x5f')]['id']},'include':[{'model':db[_0x97b8('0x43')],'as':_0x97b8('0x44')}]})[_0x97b8('0x25')](handleEntityNotFound(_0x4ac880,null))['then'](saveUpdates(_0x2c102e[_0x97b8('0x62')],null))[_0x97b8('0x25')](respondWithResult(_0x4ac880,null))['catch'](handleError(_0x4ac880,null));};exports[_0x97b8('0x3e')]=function(_0x48ac51,_0x35ec11){return db[_0x97b8('0x46')][_0x97b8('0x60')]({'where':{'id':_0x48ac51[_0x97b8('0x5f')]['id']}})[_0x97b8('0x25')](handleEntityNotFound(_0x35ec11,null))[_0x97b8('0x25')](removeEntity(_0x35ec11,null))[_0x97b8('0x2f')](handleError(_0x35ec11,null));};exports['describe']=function(_0x3b456,_0x508239){return db['SmsAccount'][_0x97b8('0x69')]()[_0x97b8('0x25')](respondWithResult(_0x508239,null))['catch'](handleError(_0x508239,null));};exports['addDisposition']=function(_0x43e9a9,_0x53ad5b,_0x3b1faa){if(_0x43e9a9[_0x97b8('0x62')]['id']){delete _0x43e9a9[_0x97b8('0x62')]['id'];}return db[_0x97b8('0x46')]['find']({'where':{'id':_0x43e9a9[_0x97b8('0x5f')]['id']}})[_0x97b8('0x25')](handleEntityNotFound(_0x53ad5b,null))['then'](function(_0x35fa15){if(_0x35fa15){_0x43e9a9[_0x97b8('0x62')]['SmsAccountId']=_0x35fa15['id'];return db[_0x97b8('0x6a')][_0x97b8('0x61')](_0x43e9a9[_0x97b8('0x62')]);}})[_0x97b8('0x25')](respondWithResult(_0x53ad5b,null))['catch'](handleError(_0x53ad5b,null));};exports['getDispositions']=function(_0x17d097,_0x4088fa,_0x4d5f9b){var _0x3bf81c={'raw':![],'where':{}};var _0x3b4ff8={};var _0x199fd0={'count':0x0,'rows':[]};return db[_0x97b8('0x46')][_0x97b8('0x6b')]({'where':{'id':_0x17d097[_0x97b8('0x5f')]['id']}})[_0x97b8('0x25')](handleEntityNotFound(_0x4088fa,null))[_0x97b8('0x25')](function(_0x45627e){if(_0x45627e){_0x3b4ff8['model']=_[_0x97b8('0x4d')](db['Disposition'][_0x97b8('0x47')]);_0x3b4ff8['query']=_[_0x97b8('0x4d')](_0x17d097[_0x97b8('0x4c')]);_0x3b4ff8[_0x97b8('0x55')]=_[_0x97b8('0x4e')](_0x3b4ff8['model'],_0x3b4ff8[_0x97b8('0x4c')]);_0x3bf81c[_0x97b8('0x50')]=_[_0x97b8('0x4e')](_0x3b4ff8[_0x97b8('0x4b')],qs['fields'](_0x17d097[_0x97b8('0x4c')][_0x97b8('0x4f')]));_0x3bf81c[_0x97b8('0x50')]=_0x3bf81c[_0x97b8('0x50')][_0x97b8('0x51')]?_0x3bf81c[_0x97b8('0x50')]:_0x3b4ff8[_0x97b8('0x4b')];if(!_0x17d097[_0x97b8('0x4c')][_0x97b8('0x6c')](_0x97b8('0x52'))){_0x3bf81c[_0x97b8('0x35')]=qs['limit'](_0x17d097[_0x97b8('0x4c')][_0x97b8('0x35')]);_0x3bf81c[_0x97b8('0x37')]=qs[_0x97b8('0x37')](_0x17d097[_0x97b8('0x4c')]['offset']);}_0x3bf81c[_0x97b8('0x53')]=qs[_0x97b8('0x54')](_0x17d097['query'][_0x97b8('0x54')]);_0x3bf81c['where']=qs[_0x97b8('0x55')](_[_0x97b8('0x6d')](_0x17d097['query'],_0x3b4ff8['filters']));_0x3bf81c['where'][_0x97b8('0x6e')]=_0x45627e['id'];if(_0x17d097[_0x97b8('0x4c')][_0x97b8('0x59')]){_0x3bf81c[_0x97b8('0x57')]=_[_0x97b8('0x56')](_0x3bf81c[_0x97b8('0x57')],{'$or':_[_0x97b8('0x45')](_0x3bf81c[_0x97b8('0x50')],function(_0x5d57bd){var _0x4eb22a={};_0x4eb22a[_0x5d57bd]={'$like':'%'+_0x17d097[_0x97b8('0x4c')][_0x97b8('0x59')]+'%'};return _0x4eb22a;})});}_0x3bf81c=_[_0x97b8('0x56')]({},_0x3bf81c,_0x17d097[_0x97b8('0x5a')]);return db['Disposition'][_0x97b8('0x36')]({'where':_0x3bf81c[_0x97b8('0x57')]})[_0x97b8('0x25')](function(_0x2f3888){_0x199fd0[_0x97b8('0x36')]=_0x2f3888;if(_0x17d097[_0x97b8('0x4c')][_0x97b8('0x5b')]){_0x3bf81c[_0x97b8('0x5c')]=[{'all':!![]}];}return db[_0x97b8('0x6a')][_0x97b8('0x5d')](_0x3bf81c);})[_0x97b8('0x25')](function(_0x1858bf){_0x199fd0['rows']=_0x1858bf;return _0x199fd0;});}})[_0x97b8('0x25')](respondWithFilteredResult(_0x4088fa,_0x3bf81c))['catch'](handleError(_0x4088fa,null));};exports['removeDispositions']=function(_0x549ca8,_0x3bfb52,_0x50595d){return db[_0x97b8('0x46')]['find']({'where':{'id':_0x549ca8[_0x97b8('0x5f')]['id']}})[_0x97b8('0x25')](handleEntityNotFound(_0x3bfb52,null))['then'](function(_0x39b102){if(_0x39b102){return _0x39b102[_0x97b8('0x6f')](_0x549ca8[_0x97b8('0x4c')]['ids']);}})[_0x97b8('0x25')](respondWithStatusCode(_0x3bfb52,null))[_0x97b8('0x2f')](handleError(_0x3bfb52,null));};exports[_0x97b8('0x70')]=function(_0x120fc0,_0x5b5926,_0x4301db){if(_0x120fc0[_0x97b8('0x62')]['id']){delete _0x120fc0[_0x97b8('0x62')]['id'];}return db[_0x97b8('0x46')][_0x97b8('0x60')]({'where':{'id':_0x120fc0['params']['id']}})['then'](handleEntityNotFound(_0x5b5926,null))[_0x97b8('0x25')](function(_0x5001c2){if(_0x5001c2){_0x120fc0[_0x97b8('0x62')]['SmsAccountId']=_0x5001c2['id'];return db['CannedAnswer'][_0x97b8('0x61')](_0x120fc0[_0x97b8('0x62')]);}})['then'](respondWithResult(_0x5b5926,null))[_0x97b8('0x2f')](handleError(_0x5b5926,null));};exports['getAnswers']=function(_0x424729,_0x42ffd6,_0x4dde58){var _0x56c629={'raw':![],'where':{}};var _0x161667={};var _0x21f940={'count':0x0,'rows':[]};return db[_0x97b8('0x46')][_0x97b8('0x6b')]({'where':{'id':_0x424729[_0x97b8('0x5f')]['id']}})['then'](handleEntityNotFound(_0x42ffd6,null))[_0x97b8('0x25')](function(_0x41dfaf){if(_0x41dfaf){_0x161667[_0x97b8('0x4b')]=_[_0x97b8('0x4d')](db[_0x97b8('0x71')][_0x97b8('0x47')]);_0x161667[_0x97b8('0x4c')]=_[_0x97b8('0x4d')](_0x424729[_0x97b8('0x4c')]);_0x161667['filters']=_[_0x97b8('0x4e')](_0x161667['model'],_0x161667[_0x97b8('0x4c')]);_0x56c629[_0x97b8('0x50')]=_['intersection'](_0x161667[_0x97b8('0x4b')],qs[_0x97b8('0x4f')](_0x424729[_0x97b8('0x4c')][_0x97b8('0x4f')]));_0x56c629[_0x97b8('0x50')]=_0x56c629['attributes'][_0x97b8('0x51')]?_0x56c629[_0x97b8('0x50')]:_0x161667[_0x97b8('0x4b')];if(!_0x424729[_0x97b8('0x4c')][_0x97b8('0x6c')](_0x97b8('0x52'))){_0x56c629[_0x97b8('0x35')]=qs[_0x97b8('0x35')](_0x424729[_0x97b8('0x4c')][_0x97b8('0x35')]);_0x56c629[_0x97b8('0x37')]=qs[_0x97b8('0x37')](_0x424729[_0x97b8('0x4c')][_0x97b8('0x37')]);}_0x56c629['order']=qs[_0x97b8('0x54')](_0x424729[_0x97b8('0x4c')][_0x97b8('0x54')]);_0x56c629[_0x97b8('0x57')]=qs[_0x97b8('0x55')](_['pick'](_0x424729['query'],_0x161667[_0x97b8('0x55')]));_0x56c629[_0x97b8('0x57')][_0x97b8('0x6e')]=_0x41dfaf['id'];if(_0x424729[_0x97b8('0x4c')][_0x97b8('0x59')]){_0x56c629['where']=_[_0x97b8('0x56')](_0x56c629[_0x97b8('0x57')],{'$or':_[_0x97b8('0x45')](_0x56c629['attributes'],function(_0x4012fd){var _0x36eeef={};_0x36eeef[_0x4012fd]={'$like':'%'+_0x424729['query'][_0x97b8('0x59')]+'%'};return _0x36eeef;})});}_0x56c629=_[_0x97b8('0x56')]({},_0x56c629,_0x424729[_0x97b8('0x5a')]);return db[_0x97b8('0x71')]['count']({'where':_0x56c629['where']})[_0x97b8('0x25')](function(_0x44b6b6){_0x21f940[_0x97b8('0x36')]=_0x44b6b6;if(_0x424729['query']['includeAll']){_0x56c629[_0x97b8('0x5c')]=[{'all':!![]}];}return db[_0x97b8('0x71')][_0x97b8('0x5d')](_0x56c629);})[_0x97b8('0x25')](function(_0x52bafd){_0x21f940[_0x97b8('0x72')]=_0x52bafd;return _0x21f940;});}})[_0x97b8('0x25')](respondWithFilteredResult(_0x42ffd6,_0x56c629))[_0x97b8('0x2f')](handleError(_0x42ffd6,null));};exports[_0x97b8('0x73')]=function(_0x2316d6,_0x5e9798,_0x199340){return db[_0x97b8('0x46')]['find']({'where':{'id':_0x2316d6[_0x97b8('0x5f')]['id']}})[_0x97b8('0x25')](handleEntityNotFound(_0x5e9798,null))[_0x97b8('0x25')](function(_0x1e20a6){if(_0x1e20a6){return _0x1e20a6[_0x97b8('0x73')](_0x2316d6[_0x97b8('0x4c')][_0x97b8('0x74')]);}})[_0x97b8('0x25')](respondWithStatusCode(_0x5e9798,null))[_0x97b8('0x2f')](handleError(_0x5e9798,null));};exports[_0x97b8('0x75')]=function(_0x36f549,_0x476de0,_0x50e9aa){var _0x4acb53={'channel':_0x97b8('0x76')};var _0x37d3bb=[];var _0x2b6cf0=[];var _0x105c8e={};return db[_0x97b8('0x46')][_0x97b8('0x60')]({'where':{'id':_0x36f549[_0x97b8('0x5f')]['id']},'include':[{'model':db[_0x97b8('0x77')],'as':_0x97b8('0x78')}]})[_0x97b8('0x25')](handleEntityNotFound(_0x476de0,null))['then'](function(_0x1f3c07){_0x4acb53['account']=_0x1f3c07;_0x4acb53[_0x97b8('0x79')]=_[_0x97b8('0x7a')](_0x1f3c07[_0x97b8('0x78')],['priority'],[_0x97b8('0x7b')]);if(_0x4acb53[_0x97b8('0x7c')][_0x97b8('0x78')]){delete _0x4acb53[_0x97b8('0x7c')][_0x97b8('0x78')];}return db[_0x97b8('0x7d')][_0x97b8('0x69')]();})['then'](function(_0x3b9b84){if(!_0x3b9b84){throw new db[(_0x97b8('0x7e'))][(_0x97b8('0x7f'))]('no\x20available\x20attributes');}_0x37d3bb=_[_0x97b8('0x80')](_[_0x97b8('0x4d')](_0x3b9b84),[_0x97b8('0x81'),_0x97b8('0x82')]);_0x2b6cf0=_[_0x97b8('0x80')](_[_0x97b8('0x4d')](_0x3b9b84),[_0x97b8('0x81'),'updatedAt',_0x97b8('0x83'),_0x97b8('0x84')]);_0x4acb53['body']={'mapKey':'mobile'};if(_0x4acb53[_0x97b8('0x7c')]['type']){switch(_0x4acb53['account'][_0x97b8('0x49')]){case _0x97b8('0x85'):_0x4acb53[_0x97b8('0x62')]['from']=_0x36f549[_0x97b8('0x62')][_0x97b8('0x86')];_0x4acb53[_0x97b8('0x62')]['body']=_0x36f549[_0x97b8('0x62')]['Body'];_0x4acb53[_0x97b8('0x62')]['messageId']=_0x36f549[_0x97b8('0x62')][_0x97b8('0x87')];break;case _0x97b8('0x88'):_0x4acb53[_0x97b8('0x62')][_0x97b8('0x89')]='+'+_0x36f549['body'][_0x97b8('0x8a')];_0x4acb53[_0x97b8('0x62')][_0x97b8('0x62')]=_0x36f549['body'][_0x97b8('0x8b')];break;case _0x97b8('0x8c'):_0x4acb53['body']['from']=_0x36f549[_0x97b8('0x62')][_0x97b8('0x89')];_0x4acb53[_0x97b8('0x62')][_0x97b8('0x62')]=_0x36f549['body'][_0x97b8('0x2e')];break;case _0x97b8('0x8d'):_0x4acb53[_0x97b8('0x62')]['from']=_0x36f549[_0x97b8('0x62')][_0x97b8('0x89')];_0x4acb53[_0x97b8('0x62')][_0x97b8('0x62')]=_0x36f549['body'][_0x97b8('0x62')];_0x4acb53[_0x97b8('0x62')][_0x97b8('0x8e')]=_0x36f549[_0x97b8('0x62')][_0x97b8('0x8f')];break;case _0x97b8('0x90'):_0x4acb53[_0x97b8('0x62')][_0x97b8('0x89')]=_0x36f549['body']['From'];_0x4acb53[_0x97b8('0x62')][_0x97b8('0x62')]=_0x36f549[_0x97b8('0x62')][_0x97b8('0x91')];_0x4acb53['body'][_0x97b8('0x8e')]=_0x36f549[_0x97b8('0x62')][_0x97b8('0x92')];break;case _0x97b8('0x93'):_0x4acb53[_0x97b8('0x62')]['from']='+'+_0x36f549['body']['results'][0x0][_0x97b8('0x89')];_0x4acb53['body']['body']=_0x36f549[_0x97b8('0x62')][_0x97b8('0x94')][0x0][_0x97b8('0x8b')];_0x4acb53[_0x97b8('0x62')]['messageId']=_0x36f549[_0x97b8('0x62')][_0x97b8('0x94')][0x0][_0x97b8('0x8e')];break;case _0x97b8('0x95'):_0x4acb53[_0x97b8('0x62')][_0x97b8('0x89')]=_0x36f549[_0x97b8('0x62')]['originatingAddress'];_0x4acb53[_0x97b8('0x62')][_0x97b8('0x62')]=_0x36f549[_0x97b8('0x62')][_0x97b8('0x96')][_0x97b8('0x2e')];break;case _0x97b8('0x97'):_0x4acb53['body'][_0x97b8('0x89')]=_0x36f549[_0x97b8('0x62')]['fromNumber'];_0x4acb53[_0x97b8('0x62')][_0x97b8('0x62')]=_0x36f549[_0x97b8('0x62')]['text'];_0x4acb53[_0x97b8('0x62')][_0x97b8('0x8e')]=_0x36f549[_0x97b8('0x62')][_0x97b8('0x98')];break;case _0x97b8('0x99'):_0x4acb53['body'][_0x97b8('0x8e')]=_0x36f549['body'][0x0][_0x97b8('0x2e')]['id'];_0x4acb53[_0x97b8('0x62')]['from']=_0x36f549[_0x97b8('0x62')][0x0][_0x97b8('0x2e')][_0x97b8('0x89')];_0x4acb53[_0x97b8('0x62')][_0x97b8('0x62')]=_0x36f549[_0x97b8('0x62')][0x0]['message'][_0x97b8('0x8b')];break;case'intelepeer':_0x4acb53['body'][_0x97b8('0x89')]=_0x36f549['body'][_0x97b8('0x89')];_0x4acb53[_0x97b8('0x62')][_0x97b8('0x62')]=_0x36f549[_0x97b8('0x62')]['message'];_0x4acb53['body']['messageId']=_0x36f549[_0x97b8('0x62')][_0x97b8('0x9a')];break;}}if(_0x4acb53[_0x97b8('0x62')]['id']){delete _0x4acb53[_0x97b8('0x62')]['id'];}if(_[_0x97b8('0x9b')](_0x4acb53[_0x97b8('0x62')][_0x97b8('0x89')])){throw new db[(_0x97b8('0x7e'))][(_0x97b8('0x7f'))](_0x97b8('0x9c'));}if(_['isNil'](_0x4acb53[_0x97b8('0x62')][_0x97b8('0x62')])||_0x4acb53[_0x97b8('0x62')][_0x97b8('0x62')]===''){throw new db[(_0x97b8('0x7e'))][(_0x97b8('0x7f'))](_0x97b8('0x9d'));}if(_['isNil'](_0x4acb53[_0x97b8('0x62')][_0x97b8('0x9e')])){throw new db[(_0x97b8('0x7e'))][(_0x97b8('0x7f'))](_0x97b8('0x9f')+_0x2b6cf0);}if(!_['includes'](_0x2b6cf0,_0x4acb53['body'][_0x97b8('0x9e')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2b6cf0);}_0x105c8e[_0x4acb53[_0x97b8('0x62')][_0x97b8('0x9e')]]=_0x4acb53[_0x97b8('0x62')]['from'];return db[_0x97b8('0xa0')][_0x97b8('0x60')]({'where':{'id':_0x4acb53['account'][_0x97b8('0x84')]},'include':[{'model':db[_0x97b8('0x7d')],'as':'Contacts','where':_0x105c8e,'limit':0x1,'order':[['updatedAt',_0x97b8('0xa1')]]}]});})[_0x97b8('0x25')](handleEntityNotFound(_0x476de0,null))['then'](function(_0x42d630){if(_0x42d630){_0x4acb53[_0x97b8('0xa2')]=_[_0x97b8('0xa3')](_0x42d630,[_0x97b8('0xa4')]);if(_0x42d630[_0x97b8('0xa4')][_0x97b8('0x51')]){return _0x42d630[_0x97b8('0xa4')][0x0];}var _0x393b87=_['defaults'](_0x4acb53['body'],{'firstName':_0x4acb53[_0x97b8('0x62')][_0x97b8('0x89')],'ListId':_0x42d630['id']});_0x393b87[_0x4acb53['body'][_0x97b8('0x9e')]]=_0x4acb53[_0x97b8('0x62')]['from'];return db[_0x97b8('0x7d')][_0x97b8('0x61')](_0x393b87,{'fields':_0x37d3bb,'raw':!![]});}})[_0x97b8('0x25')](handleEntityNotFound(_0x476de0,null))[_0x97b8('0x25')](function(_0x5b9e1e){if(_0x5b9e1e){_0x4acb53[_0x97b8('0xa5')]=_0x5b9e1e;var _0x2d19c7={'ContactId':_0x5b9e1e['id'],'phone':_0x4acb53[_0x97b8('0x62')][_0x97b8('0x89')],'SmsAccountId':_0x36f549[_0x97b8('0x5f')]['id']};var _0xcbb7c6={'ContactId':_0x5b9e1e['id'],'SmsAccountId':_0x36f549[_0x97b8('0x5f')]['id'],'closed':![]};return db[_0x97b8('0xa6')][_0x97b8('0x60')]({'where':_0xcbb7c6})['then'](function(_0x12264a){if(_0x12264a){return[_0x12264a,![]];}return db[_0x97b8('0xa6')]['create'](_0x2d19c7)[_0x97b8('0x25')](function(_0x266531){return[_0x266531,!![]];});});}})[_0x97b8('0xa7')](function(_0x4625ae,_0x2a59dd){_0x4acb53[_0x97b8('0xa8')]=_0x4625ae[_0x97b8('0x3c')]({'plain':!![]});_0x4acb53[_0x97b8('0xa8')][_0x97b8('0xa9')]=![];if(_0x2a59dd){if(_0x4acb53['account'][_0x97b8('0xaa')]){_0x4acb53[_0x97b8('0x79')][_0x97b8('0xab')]({'id':0x0,'priority':_0x4acb53[_0x97b8('0x79')][_0x97b8('0x51')]+0x1,'app':_0x97b8('0xac'),'appdata':'unmanaged','interval':_0x97b8('0xad')});}_0x4acb53[_0x97b8('0xa8')]['created']=!![];}return db[_0x97b8('0xae')][_0x97b8('0x61')]({'phone':_0x4acb53['body'][_0x97b8('0x89')],'messageId':_0x4acb53['body'][_0x97b8('0x8e')],'body':_0x4acb53[_0x97b8('0x62')]['body'],'SmsAccountId':_0x36f549['params']['id'],'SmsInteractionId':_0x4625ae['id'],'direction':'in','ContactId':_0x4625ae[_0x97b8('0xaf')],'AttachmentId':_0x4acb53[_0x97b8('0x62')][_0x97b8('0xb0')]});})['then'](function(_0x14071c){_0x4acb53[_0x97b8('0x2e')]=_0x14071c;if(_0x4acb53[_0x97b8('0xa8')]['UserId']){return db['User'][_0x97b8('0x60')]({'attributes':['id',_0x97b8('0x40')],'where':{'id':_0x4acb53[_0x97b8('0xa8')][_0x97b8('0xb1')]}})['then'](function(_0x336a7d){if(_0x336a7d){_0x4acb53[_0x97b8('0x79')][_0x97b8('0xb2')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x336a7d[_0x97b8('0x40')]+','+(_0x4acb53[_0x97b8('0x7c')][_0x97b8('0xb3')]||0xa),'interval':_0x97b8('0xad')});}return respondWithRpcPromise('Start','startRouting',_0x4acb53);});}return respondWithRpcPromise('Start',_0x97b8('0xb4'),_0x4acb53);})['then'](function(_0x587a81){if(_0x587a81){var _0x5e8766=0xc8;var _0x16b1ac=_0x97b8('0xb5');logger['info'](_0x97b8('0x29'),_0x16b1ac,_0x5e8766,_0x97b8('0xb6'));logger['debug'](_0x97b8('0xb7'),_0x16b1ac,_0x5e8766,'entity\x20found',JSON[_0x97b8('0x2a')](_0x587a81));if(_0x4acb53[_0x97b8('0x7c')]['type']==='twilio'){return _0x476de0[_0x97b8('0x32')](_0x5e8766)[_0x97b8('0xb8')](_0x97b8('0xb9'),_0x97b8('0xba'))[_0x97b8('0x41')](_0x97b8('0xbb'));}else{return _0x476de0[_0x97b8('0x32')](_0x5e8766)['json'](_0x587a81);}}})[_0x97b8('0x2f')](handleError(_0x476de0,null));};exports['addApplications']=function(_0x4e3d99,_0x5038f1){var _0x3202bf=_0x4e3d99['params']['id'];var _0x2c4a97=_0x4e3d99[_0x97b8('0x62')];var _0x37ae87=0xc8;var _0x1129da=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x97b8('0xbc')][_0x97b8('0xbd')][_0x97b8('0xbe')][_0x97b8('0xbf')]},function(_0x69560d){return db[_0x97b8('0x46')][_0x97b8('0x6b')]({'where':{'id':_0x3202bf},'transaction':_0x69560d})[_0x97b8('0x25')](function(_0x5ad921){if(_0x5ad921){return db['SmsApplication']['destroy']({'where':{'SmsAccountId':_0x3202bf},'transaction':_0x69560d})[_0x97b8('0x25')](function(){var _0x1ab111=_[_0x97b8('0x45')](_0x2c4a97,function(_0x5b78aa){_0x5b78aa[_0x97b8('0x6e')]=_0x3202bf;return _0x5b78aa;});return db['SmsApplication'][_0x97b8('0xc0')](_0x1ab111,{'transaction':_0x69560d});});}else{_0x37ae87=0x194;_0x1129da=[];}});})['then'](function(){if(_0x37ae87!==0x194){return db[_0x97b8('0x77')][_0x97b8('0xc1')]({'where':{'SmsAccountId':_0x3202bf},'order':_0x97b8('0xc2')})[_0x97b8('0x25')](function(_0x5adcc3){_0x1129da=_0x5adcc3;});}})['catch'](function(_0x40c739){_0x37ae87=0x1f4;logger[_0x97b8('0x2b')](_0x40c739['stack']);if(_0x40c739[_0x97b8('0x40')]){delete _0x40c739[_0x97b8('0x40')];}_0x1129da=_0x40c739;})[_0x97b8('0xc3')](function(){if(_0x1129da===null){_0x5038f1[_0x97b8('0x30')](_0x37ae87);}else{if(_0x37ae87===0x1f4){_0x5038f1['status'](_0x37ae87)['send'](_0x1129da);}else{_0x5038f1[_0x97b8('0x32')](_0x37ae87)[_0x97b8('0x33')](_0x1129da);}}});};exports[_0x97b8('0xc4')]=function(_0x20c922,_0xaf87bf,_0xf45c3){var _0x1334a0={};var _0x52a065={};var _0x390792;var _0x92bf31;return db[_0x97b8('0x46')][_0x97b8('0x6b')]({'where':{'id':_0x20c922['params']['id']}})[_0x97b8('0x25')](handleEntityNotFound(_0xaf87bf,null))[_0x97b8('0x25')](function(_0x2ccb18){if(_0x2ccb18){_0x390792=_0x2ccb18;_0x52a065['model']=_[_0x97b8('0x4d')](db[_0x97b8('0x77')]['rawAttributes']);_0x52a065[_0x97b8('0x4c')]=_[_0x97b8('0x4d')](_0x20c922[_0x97b8('0x4c')]);_0x52a065[_0x97b8('0x55')]=_[_0x97b8('0x4e')](_0x52a065['model'],_0x52a065[_0x97b8('0x4c')]);_0x1334a0[_0x97b8('0x50')]=_[_0x97b8('0x4e')](_0x52a065[_0x97b8('0x4b')],qs[_0x97b8('0x4f')](_0x20c922[_0x97b8('0x4c')]['fields']));_0x1334a0[_0x97b8('0x50')]=_0x1334a0[_0x97b8('0x50')][_0x97b8('0x51')]?_0x1334a0[_0x97b8('0x50')]:_0x52a065[_0x97b8('0x4b')];_0x1334a0[_0x97b8('0x53')]=qs[_0x97b8('0x54')](_0x20c922['query'][_0x97b8('0x54')]);_0x1334a0[_0x97b8('0x57')]=qs['filters'](_[_0x97b8('0x6d')](_0x20c922['query'],_0x52a065[_0x97b8('0x55')]));if(_0x20c922[_0x97b8('0x4c')][_0x97b8('0x59')]){_0x1334a0[_0x97b8('0x57')]=_[_0x97b8('0x56')](_0x1334a0['where'],{'$or':_[_0x97b8('0x45')](_0x1334a0[_0x97b8('0x50')],function(_0x316568){var _0x34fcfa={};_0x34fcfa[_0x316568]={'$like':'%'+_0x20c922[_0x97b8('0x4c')][_0x97b8('0x59')]+'%'};return _0x34fcfa;})});}_0x1334a0=_[_0x97b8('0x56')]({},_0x1334a0,_0x20c922[_0x97b8('0x5a')]);return _0x390792[_0x97b8('0xc4')](_0x1334a0);}})['then'](function(_0x3c799c){if(_0x3c799c){_0x92bf31=_0x3c799c[_0x97b8('0x51')];if(!_0x20c922[_0x97b8('0x4c')][_0x97b8('0x6c')](_0x97b8('0x52'))){_0x1334a0[_0x97b8('0x35')]=qs['limit'](_0x20c922[_0x97b8('0x4c')][_0x97b8('0x35')]);_0x1334a0[_0x97b8('0x37')]=qs[_0x97b8('0x37')](_0x20c922[_0x97b8('0x4c')][_0x97b8('0x37')]);}return _0x390792[_0x97b8('0xc4')](_0x1334a0);}})[_0x97b8('0x25')](function(_0x20f5bb){if(_0x20f5bb){return _0x20f5bb?{'count':_0x92bf31,'rows':_0x20f5bb}:null;}})['then'](respondWithResult(_0xaf87bf,null))[_0x97b8('0x2f')](handleError(_0xaf87bf,null));};exports[_0x97b8('0xc5')]=function(_0x51c064,_0x3b42fe,_0xe2fc66){var _0x3b7caa={'raw':![],'where':{}};var _0x18e6f7={};var _0x1e95b9={'count':0x0,'rows':[]};return db[_0x97b8('0x46')]['findOne']({'where':{'id':_0x51c064[_0x97b8('0x5f')]['id']}})[_0x97b8('0x25')](handleEntityNotFound(_0x3b42fe,null))[_0x97b8('0x25')](function(_0x3747f6){if(_0x3747f6){_0x18e6f7[_0x97b8('0x4b')]=_[_0x97b8('0x4d')](db['SmsInteraction']['rawAttributes']);_0x18e6f7[_0x97b8('0x4c')]=_[_0x97b8('0x4d')](_0x51c064[_0x97b8('0x4c')]);_0x18e6f7[_0x97b8('0x55')]=_['intersection'](_0x18e6f7[_0x97b8('0x4b')],_0x18e6f7[_0x97b8('0x4c')]);_0x3b7caa['attributes']=_[_0x97b8('0x4e')](_0x18e6f7[_0x97b8('0x4b')],qs[_0x97b8('0x4f')](_0x51c064[_0x97b8('0x4c')][_0x97b8('0x4f')]));_0x3b7caa[_0x97b8('0x50')]=_0x3b7caa['attributes'][_0x97b8('0x51')]?_0x3b7caa[_0x97b8('0x50')]:_0x18e6f7['model'];if(!_0x51c064[_0x97b8('0x4c')][_0x97b8('0x6c')](_0x97b8('0x52'))){_0x3b7caa['limit']=qs['limit'](_0x51c064[_0x97b8('0x4c')][_0x97b8('0x35')]);_0x3b7caa['offset']=qs[_0x97b8('0x37')](_0x51c064[_0x97b8('0x4c')][_0x97b8('0x37')]);}_0x3b7caa[_0x97b8('0x53')]=qs[_0x97b8('0x54')](_0x51c064[_0x97b8('0x4c')][_0x97b8('0x54')]);_0x3b7caa['where']=qs['filters'](_[_0x97b8('0x6d')](_0x51c064[_0x97b8('0x4c')],_0x18e6f7[_0x97b8('0x55')]));_0x3b7caa['where'][_0x97b8('0x6e')]=_0x3747f6['id'];if(_0x51c064[_0x97b8('0x4c')][_0x97b8('0x59')]){_0x3b7caa[_0x97b8('0x57')]=_[_0x97b8('0x56')](_0x3b7caa[_0x97b8('0x57')],{'$or':_[_0x97b8('0x45')](_0x3b7caa[_0x97b8('0x50')],function(_0x43ad16){var _0x212616={};_0x212616[_0x43ad16]={'$like':'%'+_0x51c064[_0x97b8('0x4c')][_0x97b8('0x59')]+'%'};return _0x212616;})});}_0x3b7caa=_[_0x97b8('0x56')]({},_0x3b7caa,_0x51c064[_0x97b8('0x5a')]);return db[_0x97b8('0xa6')]['count']({'where':_0x3b7caa[_0x97b8('0x57')]})[_0x97b8('0x25')](function(_0x2d6eef){_0x1e95b9['count']=_0x2d6eef;if(_0x51c064['query']['includeAll']){_0x3b7caa['include']=[{'model':db[_0x97b8('0x7d')],'as':_0x97b8('0xc6'),'required':![]},{'model':db[_0x97b8('0xc7')],'as':'Owner','attributes':['name',_0x97b8('0xc8'),_0x97b8('0xc9')],'required':![]},{'model':db[_0x97b8('0xca')],'as':_0x97b8('0xcb'),'attributes':['id','name',_0x97b8('0xcc')],'where':_0x51c064[_0x97b8('0x4c')]['tag']?{'id':_0x51c064[_0x97b8('0x4c')][_0x97b8('0xcd')]}:undefined,'required':_0x51c064['query'][_0x97b8('0xcd')]?!![]:![]}];}return db[_0x97b8('0xa6')][_0x97b8('0x5d')](_0x3b7caa);})[_0x97b8('0x25')](function(_0x3b2ff2){_0x1e95b9[_0x97b8('0x72')]=_0x3b2ff2;return _0x1e95b9;});}})[_0x97b8('0x25')](respondWithFilteredResult(_0x3b42fe,_0x3b7caa))[_0x97b8('0x2f')](handleError(_0x3b42fe,null));};exports[_0x97b8('0x41')]=function(_0x260d99,_0x77070a,_0x3fafc4){var _0x13122f,_0x3e0faf,_0x1f7eb3;if(_[_0x97b8('0x9b')](_0x260d99['body']['body'])||_0x260d99[_0x97b8('0x62')][_0x97b8('0x62')]===''){throw new db[(_0x97b8('0x7e'))][(_0x97b8('0x7f'))](_0x97b8('0x9d'));}if(_[_0x97b8('0x9b')](_0x260d99[_0x97b8('0x62')]['to'])){throw new db[(_0x97b8('0x7e'))]['ValidationError'](_0x97b8('0xce'));}_0x13122f=_0x260d99[_0x97b8('0x62')]['to'];return db[_0x97b8('0x46')][_0x97b8('0x60')]({'where':{'id':_0x260d99[_0x97b8('0x5f')]['id']},'include':[{'model':db[_0x97b8('0xa0')],'as':_0x97b8('0xcf'),'include':[{'model':db[_0x97b8('0x7d')],'as':_0x97b8('0xa4'),'where':{'mobile':_0x13122f},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0x77070a,null))[_0x97b8('0x25')](function(_0x4c48ac){if(_0x4c48ac&&_0x4c48ac[_0x97b8('0xcf')]){_0x3e0faf=_0x4c48ac[_0x97b8('0x3c')]({'plain':!![]});if(_0x3e0faf[_0x97b8('0xcf')]&&_0x3e0faf[_0x97b8('0xcf')][_0x97b8('0xa4')][_0x97b8('0x51')]){return _0x3e0faf[_0x97b8('0xcf')][_0x97b8('0xa4')][0x0];}return db['CmContact'][_0x97b8('0x61')](_[_0x97b8('0x1e')](_0x260d99['body'],{'firstName':_0x13122f,'mobile':_0x13122f,'phone':_0x13122f,'ListId':_0x3e0faf[_0x97b8('0x84')]}));}})[_0x97b8('0x25')](handleEntityNotFound(_0x77070a,null))['then'](function(_0x404b06){if(_0x404b06){_0x1f7eb3=_0x404b06;return db[_0x97b8('0xa6')]['find']({'where':{'ContactId':_0x1f7eb3['id'],'closed':![],'SmsAccountId':_0x3e0faf['id']}})[_0x97b8('0x25')](function(_0x2ac6e7){if(_0x2ac6e7){return[_0x2ac6e7,![]];}return db[_0x97b8('0xa6')][_0x97b8('0x61')]({'UserId':_0x260d99['user']['id'],'ContactId':_0x1f7eb3['id'],'SmsAccountId':_0x3e0faf['id'],'phone':_0x13122f,'firstMsgDirection':'out','Messages':[_[_0x97b8('0x56')](_0x260d99[_0x97b8('0x62')],{'read':![],'body':_0x260d99[_0x97b8('0x62')]['body'],'phone':_0x13122f,'SmsAccountId':_0x3e0faf['id'],'UserId':_0x260d99['user']['id'],'ContactId':_0x1f7eb3['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})['then'](function(_0x2263ca){return[_0x2263ca,!![]];});});}})[_0x97b8('0xa7')](function(_0x2dc5ce,_0x13b766){if(_0x13b766){return _0x2dc5ce;}return db['SmsMessage'][_0x97b8('0x61')](_[_0x97b8('0x56')](_0x260d99[_0x97b8('0x62')],{'read':![],'body':_0x260d99['body'][_0x97b8('0x62')],'phone':_0x13122f,'SmsAccountId':_0x3e0faf['id'],'SmsInteractionId':_0x2dc5ce['id'],'UserId':_0x260d99[_0x97b8('0x64')]['id'],'ContactId':_0x1f7eb3['id']}))[_0x97b8('0x25')](function(_0x26c422){_0x2dc5ce[_0x97b8('0xd0')]['Messages']=[];_0x2dc5ce['dataValues'][_0x97b8('0xd1')][_0x97b8('0xab')](_0x26c422[_0x97b8('0xd0')]);return _0x2dc5ce;});})[_0x97b8('0x25')](respondWithResult(_0x77070a,null))['catch'](handleError(_0x77070a,null));};exports[_0x97b8('0x32')]=function(_0x4f81a8,_0x2403b5,_0x67dc1f){if(_0x4f81a8[_0x97b8('0x62')]['id']){delete _0x4f81a8[_0x97b8('0x62')]['id'];}var _0x5c24bf,_0x3644d4,_0xd8f26f;return db[_0x97b8('0x46')][_0x97b8('0x60')]({'where':{'id':_0x4f81a8[_0x97b8('0x5f')]['id']}})['then'](handleEntityNotFound(_0x2403b5,null))[_0x97b8('0x25')](function(_0x568278){if(_0x568278){_0xd8f26f=_0x568278;logger[_0x97b8('0x28')](_0x97b8('0x29'),_0x97b8('0x32'),'received\x20delivery\x20report\x20from',_0x568278['type'],util['inspect'](_0x4f81a8[_0x97b8('0x62')],{'showHidden':![],'depth':null}));switch(_0x568278[_0x97b8('0x49')]){case _0x97b8('0x88'):if(_0x4f81a8[_0x97b8('0x62')][_0x97b8('0xd2')]&&_0x4f81a8[_0x97b8('0x62')][_0x97b8('0x32')]){_0x3644d4=_0x4f81a8[_0x97b8('0x62')][_0x97b8('0x32')];return db[_0x97b8('0xae')][_0x97b8('0x60')]({'where':{'messageId':_0x4f81a8[_0x97b8('0x62')][_0x97b8('0xd2')]}});}break;case'connectel':if(_0x4f81a8['body'][_0x97b8('0xd3')]&&_0x4f81a8[_0x97b8('0x62')]['statusInt']){_0x3644d4=_0x4f81a8['body'][_0x97b8('0xd4')];return db['SmsMessage'][_0x97b8('0x60')]({'where':{'messageId':_0x4f81a8[_0x97b8('0x62')][_0x97b8('0xd3')]}});}break;case _0x97b8('0x8d'):if(_0x4f81a8[_0x97b8('0x62')][_0x97b8('0x8f')]&&_0x4f81a8['body']['status_code']){_0x3644d4=_0x4f81a8[_0x97b8('0x62')][_0x97b8('0xd5')];return db[_0x97b8('0xae')][_0x97b8('0x60')]({'where':{'messageId':_0x4f81a8[_0x97b8('0x62')][_0x97b8('0x8f')]}});}break;case _0x97b8('0x93'):var _0xa4fa41=_0x4f81a8[_0x97b8('0x62')][_0x97b8('0x94')][0x0];if(_0xa4fa41[_0x97b8('0x8e')]&&_0xa4fa41[_0x97b8('0x32')]['groupName']===_0x97b8('0xd6')){_0x3644d4=_0xa4fa41['status']['groupName'];return db['SmsMessage'][_0x97b8('0x60')]({'where':{'messageId':_0xa4fa41[_0x97b8('0x8e')]}});}break;case _0x97b8('0x97'):if(_0x4f81a8[_0x97b8('0x62')][_0x97b8('0x8e')]&&_0x4f81a8[_0x97b8('0x62')][_0x97b8('0x32')]){_0x3644d4=_0x4f81a8[_0x97b8('0x62')][_0x97b8('0x32')];return db[_0x97b8('0xae')]['find']({'where':{'messageId':_0x4f81a8[_0x97b8('0x62')][_0x97b8('0x8e')]}});}break;case _0x97b8('0x99'):if(_0x4f81a8[_0x97b8('0x62')][0x0][_0x97b8('0x2e')]['id']){_0x3644d4=_0x4f81a8[_0x97b8('0x62')][0x0][_0x97b8('0x49')];return db['SmsMessage'][_0x97b8('0x60')]({'where':{'messageId':_0x4f81a8['body'][0x0][_0x97b8('0x2e')]['id']}});}break;case _0x97b8('0xd7'):if(_0x4f81a8[_0x97b8('0x62')][_0x97b8('0xd8')]&&_0x4f81a8[_0x97b8('0x62')]['status']){_0x3644d4=_0x4f81a8[_0x97b8('0x62')][_0x97b8('0x32')];return db['SmsMessage']['find']({'where':{'messageId':_0x4f81a8[_0x97b8('0x62')][_0x97b8('0xd8')]}});}break;}}})[_0x97b8('0x25')](handleEntityNotFound(_0x2403b5,null))['then'](function(_0x7e1a37){if(_0x7e1a37){_0x5c24bf=_0x7e1a37;switch(_0xd8f26f[_0x97b8('0x49')]){case'skebby':if(_0x3644d4==='DELIVERED'){return _0x5c24bf[_0x97b8('0x3b')]({'read':!![]});}else{logger[_0x97b8('0x2b')](_0x97b8('0x29'),_0x97b8('0x32'),'skebby',util[_0x97b8('0xd9')](_0x4f81a8[_0x97b8('0x62')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x3644d4==='1'){return _0x5c24bf['update']({'read':!![]});}else{logger[_0x97b8('0x2b')](_0x97b8('0x29'),_0x97b8('0x32'),_0x97b8('0x88'),util[_0x97b8('0xd9')](_0x4f81a8['body'],{'showHidden':![],'depth':null}));}break;case _0x97b8('0x8d'):if(!_0x4f81a8[_0x97b8('0x62')][_0x97b8('0xda')]&&_0x3644d4>=0xc8&&_0x3644d4<=0xce){return _0x5c24bf[_0x97b8('0x3b')]({'read':!![]});}else{logger[_0x97b8('0x2b')](_0x97b8('0x29'),_0x97b8('0x32'),_0x97b8('0x8d'),util[_0x97b8('0xd9')](_0x4f81a8[_0x97b8('0x62')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x4861db=_0x4f81a8[_0x97b8('0x62')][_0x97b8('0x94')][0x0];if(_0x4861db['status'][_0x97b8('0xdb')]==='DELIVERED'){return _0x5c24bf['update']({'read':!![]});}else{logger[_0x97b8('0x2b')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x97b8('0x32'),'infobip',util['inspect'](_0x4f81a8['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x3644d4=='DELIVERED_TO_GATEWAY'||_0x3644d4==_0x97b8('0xdc')){return _0x5c24bf[_0x97b8('0x3b')]({'read':!![]});}else{logger[_0x97b8('0x2b')](_0x97b8('0x29'),_0x97b8('0x32'),'clickatell',util[_0x97b8('0xd9')](_0x4f81a8[_0x97b8('0x62')],{'showHidden':![],'depth':null}));}break;case _0x97b8('0x99'):if(_0x3644d4==_0x97b8('0xdd')){return _0x5c24bf[_0x97b8('0x3b')]({'read':!![]});}else{logger[_0x97b8('0x2b')](_0x97b8('0x29'),'status',_0x97b8('0x99'),util['inspect'](_0x4f81a8[_0x97b8('0x62')],{'showHidden':![],'depth':null}));}break;case _0x97b8('0xd7'):if(_0x3644d4==='DELIVRD'||_0x3644d4===_0x97b8('0xde')){return _0x5c24bf[_0x97b8('0x3b')]({'read':!![]});}else{logger[_0x97b8('0x2b')](_0x97b8('0x29'),_0x97b8('0x32'),'intelepeer',util[_0x97b8('0xd9')](_0x4f81a8['body'],{'showHidden':![],'depth':null}));}break;}return _0x5c24bf;}})['then'](respondWithResult(_0x2403b5,null))['catch'](handleError(_0x2403b5,null));};exports[_0x97b8('0xdf')]=function(_0x574351,_0x4791e6,_0x37d5a7){var _0x4c79bf,_0x552472,_0x2f56b3;return db[_0x97b8('0x46')][_0x97b8('0x60')]({'where':{'id':_0x574351[_0x97b8('0x5f')]['id']}})[_0x97b8('0x25')](handleEntityNotFound(_0x4791e6,null))[_0x97b8('0x25')](function(_0x5a7eaa){if(_0x5a7eaa){_0x2f56b3=_0x5a7eaa;logger['debug'](_0x97b8('0x29'),_0x97b8('0x32'),_0x97b8('0xe0'),_0x5a7eaa[_0x97b8('0x49')],util[_0x97b8('0xd9')](_0x574351['query'],{'showHidden':![],'depth':null}));switch(_0x5a7eaa[_0x97b8('0x49')]){case _0x97b8('0x95'):if(_0x574351['query'][_0x97b8('0xe1')]&&_0x574351[_0x97b8('0x4c')][_0x97b8('0xe2')]){_0x552472=_0x574351['query'][_0x97b8('0xe2')];return db[_0x97b8('0xae')][_0x97b8('0x60')]({'where':{'messageId':_0x574351[_0x97b8('0x4c')]['message-id']}});}break;}}})[_0x97b8('0x25')](handleEntityNotFound(_0x4791e6,null))[_0x97b8('0x25')](function(_0x1f4e69){if(_0x1f4e69){_0x4c79bf=_0x1f4e69;switch(_0x2f56b3[_0x97b8('0x49')]){case _0x97b8('0x95'):if(_0x552472==='2'||_0x552472==='6'){return _0x4c79bf[_0x97b8('0x3b')]({'read':!![]});}else{logger[_0x97b8('0x2b')](_0x97b8('0x29'),_0x97b8('0x32'),_0x97b8('0x95'),util[_0x97b8('0xd9')](_0x574351['query'],{'showHidden':![],'depth':null}));};break;}return _0x4c79bf;}})[_0x97b8('0x25')](respondWithResult(_0x4791e6,null))[_0x97b8('0x2f')](handleError(_0x4791e6,null));};exports[_0x97b8('0xe3')]=function(_0x2ae812,_0x25c823,_0x3ade28){return db[_0x97b8('0x46')]['find']({'where':{'id':_0x2ae812['params']['id']}})[_0x97b8('0x25')](handleEntityNotFound(_0x25c823,null))['then'](function(_0x5902f0){if(_0x5902f0){return _0x5902f0['addAgents'](_0x2ae812[_0x97b8('0x62')]['ids'],_['omit'](_0x2ae812[_0x97b8('0x62')],[_0x97b8('0x74'),'id'])||{})[_0x97b8('0xa7')](function(_0x8adab8){for(var _0x484d86=0x0;_0x484d86<_0x2ae812['body']['ids'][_0x97b8('0x51')];_0x484d86+=0x1){socket[_0x97b8('0xe4')](_0x97b8('0xe5'),{'UserId':Number(_0x2ae812['body'][_0x97b8('0x74')][_0x484d86]),'SmsAccountId':Number(_0x2ae812[_0x97b8('0x5f')]['id'])});}return _0x8adab8;});}})['then'](respondWithResult(_0x25c823,null))['catch'](handleError(_0x25c823,null));};exports['removeAgents']=function(_0x1606c4,_0x8f97ed,_0x39efef){return db['SmsAccount'][_0x97b8('0x60')]({'where':{'id':_0x1606c4['params']['id']}})[_0x97b8('0x25')](handleEntityNotFound(_0x8f97ed,null))['then'](function(_0x36562e){if(_0x36562e){return _0x36562e[_0x97b8('0xe6')](_0x1606c4['query'][_0x97b8('0x74')])[_0x97b8('0x25')](function(){if(_[_0x97b8('0xe7')](_0x1606c4[_0x97b8('0x4c')]['ids'])){for(var _0x4fbacf=0x0;_0x4fbacf<_0x1606c4['query'][_0x97b8('0x74')][_0x97b8('0x51')];_0x4fbacf+=0x1){socket[_0x97b8('0xe4')](_0x97b8('0xe8'),{'UserId':Number(_0x1606c4[_0x97b8('0x4c')][_0x97b8('0x74')][_0x4fbacf]),'SmsAccountId':Number(_0x1606c4[_0x97b8('0x5f')]['id'])});}}else{socket[_0x97b8('0xe4')](_0x97b8('0xe8'),{'UserId':Number(_0x1606c4['query'][_0x97b8('0x74')]),'SmsAccountId':Number(_0x1606c4[_0x97b8('0x5f')]['id'])});}});}})[_0x97b8('0x25')](respondWithStatusCode(_0x8f97ed,null))[_0x97b8('0x2f')](handleError(_0x8f97ed,null));};exports['getAgents']=function(_0xaaab1d,_0x391466,_0x31afc6){var _0x3aaad6={};var _0x95c712={};var _0x3b6a51;var _0xb7670d;return db[_0x97b8('0x46')][_0x97b8('0x6b')]({'where':{'id':_0xaaab1d[_0x97b8('0x5f')]['id']}})[_0x97b8('0x25')](handleEntityNotFound(_0x391466,null))['then'](function(_0x129983){if(_0x129983){_0x3b6a51=_0x129983;_0x95c712[_0x97b8('0x4b')]=_[_0x97b8('0x4d')](db[_0x97b8('0xc7')]['rawAttributes']);_0x95c712['query']=_[_0x97b8('0x4d')](_0xaaab1d[_0x97b8('0x4c')]);_0x95c712[_0x97b8('0x55')]=_[_0x97b8('0x4e')](_0x95c712['model'],_0x95c712[_0x97b8('0x4c')]);_0x3aaad6[_0x97b8('0x50')]=_['intersection'](_0x95c712[_0x97b8('0x4b')],qs[_0x97b8('0x4f')](_0xaaab1d[_0x97b8('0x4c')][_0x97b8('0x4f')]));_0x3aaad6[_0x97b8('0x50')]=_0x3aaad6['attributes'][_0x97b8('0x51')]?_0x3aaad6['attributes']:_0x95c712[_0x97b8('0x4b')];_0x3aaad6[_0x97b8('0x53')]=qs['sort'](_0xaaab1d['query']['sort']);_0x3aaad6[_0x97b8('0x57')]=qs['filters'](_[_0x97b8('0x6d')](_0xaaab1d[_0x97b8('0x4c')],_0x95c712[_0x97b8('0x55')]));if(_0xaaab1d[_0x97b8('0x4c')][_0x97b8('0x59')]){_0x3aaad6[_0x97b8('0x57')]=_[_0x97b8('0x56')](_0x3aaad6[_0x97b8('0x57')],{'$or':_[_0x97b8('0x45')](_0x3aaad6[_0x97b8('0x50')],function(_0x54e096){var _0x163821={};_0x163821[_0x54e096]={'$like':'%'+_0xaaab1d[_0x97b8('0x4c')][_0x97b8('0x59')]+'%'};return _0x163821;})});}_0x3aaad6=_[_0x97b8('0x56')]({},_0x3aaad6,_0xaaab1d[_0x97b8('0x5a')]);return _0x3b6a51[_0x97b8('0xe9')](_0x3aaad6);}})['then'](function(_0x1fec2d){if(_0x1fec2d){_0xb7670d=_0x1fec2d['length'];if(!_0xaaab1d['query'][_0x97b8('0x6c')](_0x97b8('0x52'))){_0x3aaad6[_0x97b8('0x35')]=qs['limit'](_0xaaab1d[_0x97b8('0x4c')]['limit']);_0x3aaad6['offset']=qs[_0x97b8('0x37')](_0xaaab1d[_0x97b8('0x4c')][_0x97b8('0x37')]);}return _0x3b6a51[_0x97b8('0xe9')](_0x3aaad6);}})[_0x97b8('0x25')](function(_0x482ea5){if(_0x482ea5){return _0x482ea5?{'count':_0xb7670d,'rows':_0x482ea5}:null;}})['then'](respondWithResult(_0x391466,null))['catch'](handleError(_0x391466,null));};
\ No newline at end of file
+var _0x10e1=['autoclose','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority','stack','send','getApplications','getInteractions','Contact','User','Owner','fullname','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','SmsMessage','Messages','dataValues','inspect','skebby_dispatch_id','requestid','statusInt','clicksend','status_code','groupName','DELIVERED','redif','error_code','RECEIVED_BY_RECIPIENT','ACCEPTD','received\x20delivery\x20report\x20from','state','message-id','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','request','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','status','limit','undefined','offset','count','json','apply','reject','save','update','destroy','SmsAccounts','UserProfileResource','name','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','user','get','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','CannedAnswer','removeAnswers','SmsApplication','Applications','account','applications','orderBy','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','messageId','skebby','sender','text','connectel','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','ValidationError','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','omit','Contacts','contact','SmsInteraction','spread','interaction','created'];(function(_0x4df20d,_0x239ad9){var _0x553659=function(_0x4ff8fd){while(--_0x4ff8fd){_0x4df20d['push'](_0x4df20d['shift']());}};_0x553659(++_0x239ad9);}(_0x10e1,0x12b));var _0x110e=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x10e1[_0x1928c9];return _0x51b5fb;};'use strict';var emlformat=require(_0x110e('0x0'));var rimraf=require(_0x110e('0x1'));var zipdir=require(_0x110e('0x2'));var jsonpatch=require(_0x110e('0x3'));var rp=require(_0x110e('0x4'));var moment=require('moment');var BPromise=require(_0x110e('0x5'));var Mustache=require(_0x110e('0x6'));var util=require(_0x110e('0x7'));var path=require(_0x110e('0x8'));var sox=require(_0x110e('0x9'));var csv=require(_0x110e('0xa'));var ejs=require(_0x110e('0xb'));var fs=require('fs');var fs_extra=require(_0x110e('0xc'));var _=require(_0x110e('0xd'));var squel=require(_0x110e('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x110e('0xf'));var toCsv=require(_0x110e('0xa'));var querystring=require('querystring');var Papa=require(_0x110e('0x10'));var Redis=require(_0x110e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x110e('0x12'));var as=require(_0x110e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x110e('0x14'))(_0x110e('0x15'));var utils=require(_0x110e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x110e('0x17'));var db=require(_0x110e('0x18'))['db'];config[_0x110e('0x19')]=_[_0x110e('0x1a')](config['redis'],{'host':_0x110e('0x1b'),'port':0x18eb});var socket=require(_0x110e('0x1c'))(new Redis(config[_0x110e('0x19')]));require(_0x110e('0x1d'))[_0x110e('0x1e')](socket);var jayson=require(_0x110e('0x1f'));var client=jayson[_0x110e('0x20')]['http']({'port':0x232c});function respondWithRpcPromise(_0x494187,_0x469835,_0x2ca749,_0x281669){return new BPromise(function(_0x365947,_0x287909){var _0x44ae18=_0x281669||client;return _0x44ae18[_0x110e('0x21')](_0x494187,_0x2ca749)[_0x110e('0x22')](function(_0x100fcd){logger[_0x110e('0x23')](_0x110e('0x24'),_0x469835,_0x110e('0x25'));logger[_0x110e('0x26')](_0x110e('0x27'),_0x469835,_0x110e('0x25'),JSON[_0x110e('0x28')](_0x100fcd));if(_0x100fcd[_0x110e('0x29')]){if(_0x100fcd['error'][_0x110e('0x2a')]===0x1f4){logger[_0x110e('0x29')]('SmsAccount,\x20%s,\x20%s',_0x469835,_0x100fcd[_0x110e('0x29')][_0x110e('0x2b')]);return _0x287909(_0x100fcd[_0x110e('0x29')][_0x110e('0x2b')]);}logger[_0x110e('0x29')]('SmsAccount,\x20%s,\x20%s',_0x469835,_0x100fcd[_0x110e('0x29')]['message']);return _0x365947(_0x100fcd['error']['message']);}else{logger[_0x110e('0x23')](_0x110e('0x24'),_0x469835,_0x110e('0x25'));_0x365947(_0x100fcd[_0x110e('0x2c')][_0x110e('0x2b')]);}})[_0x110e('0x2d')](function(_0x475df5){logger[_0x110e('0x29')](_0x110e('0x24'),_0x469835,_0x475df5);_0x287909(_0x475df5);});});}function respondWithStatusCode(_0x1ba960,_0x4d6f74){_0x4d6f74=_0x4d6f74||0xcc;return function(_0x1b147f){if(_0x1b147f){return _0x1ba960[_0x110e('0x2e')](_0x4d6f74);}return _0x1ba960['status'](_0x4d6f74)[_0x110e('0x2f')]();};}function respondWithResult(_0x419ec2,_0x241904){_0x241904=_0x241904||0xc8;return function(_0x6a8d25){if(_0x6a8d25){return _0x419ec2[_0x110e('0x30')](_0x241904)['json'](_0x6a8d25);}};}function respondWithFilteredResult(_0x5baec4,_0x46c85a){return function(_0x31a8c6){if(_0x31a8c6){var _0x3eb880=typeof _0x46c85a['offset']==='undefined'&&typeof _0x46c85a[_0x110e('0x31')]===_0x110e('0x32');var _0x477a92=_0x31a8c6['count'];var _0x3f2075=_0x3eb880?0x0:_0x46c85a[_0x110e('0x33')];var _0x2b8d67=_0x3eb880?_0x31a8c6[_0x110e('0x34')]:_0x46c85a[_0x110e('0x33')]+_0x46c85a[_0x110e('0x31')];var _0x1567b0;if(_0x2b8d67>=_0x477a92){_0x2b8d67=_0x477a92;_0x1567b0=0xc8;}else{_0x1567b0=0xce;}_0x5baec4['status'](_0x1567b0);return _0x5baec4['set']('Content-Range',_0x3f2075+'-'+_0x2b8d67+'/'+_0x477a92)[_0x110e('0x35')](_0x31a8c6);}return null;};}function patchUpdates(_0x34a85e){return function(_0x43f50c){try{jsonpatch[_0x110e('0x36')](_0x43f50c,_0x34a85e,!![]);}catch(_0x40daad){return BPromise[_0x110e('0x37')](_0x40daad);}return _0x43f50c[_0x110e('0x38')]();};}function saveUpdates(_0x5b0351,_0x317dc3){return function(_0x133499){if(_0x133499){return _0x133499[_0x110e('0x39')](_0x5b0351)[_0x110e('0x22')](function(_0x38470a){return _0x38470a;});}return null;};}function removeEntity(_0x1b25b9,_0x21ccda){return function(_0x4c6159){if(_0x4c6159){return _0x4c6159[_0x110e('0x3a')]()[_0x110e('0x22')](function(){var _0x3f7959=_0x4c6159['get']({'plain':!![]});var _0x390332=_0x110e('0x3b');return db[_0x110e('0x3c')][_0x110e('0x3a')]({'where':{'type':_0x390332,'resourceId':_0x3f7959['id']}})[_0x110e('0x22')](function(){return _0x4c6159;});})[_0x110e('0x22')](function(){_0x1b25b9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x300a8f,_0x2b7a3e){return function(_0x4eeaf5){if(!_0x4eeaf5){_0x300a8f[_0x110e('0x2e')](0x194);}return _0x4eeaf5;};}function handleError(_0x333b47,_0x42b477){_0x42b477=_0x42b477||0x1f4;return function(_0x4dafbc){logger[_0x110e('0x29')](_0x4dafbc['stack']);if(_0x4dafbc[_0x110e('0x3d')]){delete _0x4dafbc[_0x110e('0x3d')];}_0x333b47[_0x110e('0x30')](_0x42b477)['send'](_0x4dafbc);};}exports['index']=function(_0x11eeb1,_0x506eee){var _0x42f3b2={'include':[{'model':db[_0x110e('0x3e')],'as':_0x110e('0x3f')}]},_0x432237={},_0x4a4ecb={'count':0x0,'rows':[]};var _0x15b44a=_['map'](db[_0x110e('0x40')][_0x110e('0x41')],function(_0x1bbeb2){return{'name':_0x1bbeb2['fieldName'],'type':_0x1bbeb2[_0x110e('0x42')][_0x110e('0x43')]};});_0x432237[_0x110e('0x44')]=_[_0x110e('0x45')](_0x15b44a,_0x110e('0x3d'));_0x432237[_0x110e('0x46')]=_['keys'](_0x11eeb1[_0x110e('0x46')]);_0x432237[_0x110e('0x47')]=_[_0x110e('0x48')](_0x432237[_0x110e('0x44')],_0x432237['query']);_0x42f3b2[_0x110e('0x49')]=_[_0x110e('0x48')](_0x432237[_0x110e('0x44')],qs[_0x110e('0x4a')](_0x11eeb1['query'][_0x110e('0x4a')]));_0x42f3b2[_0x110e('0x49')]=_0x42f3b2[_0x110e('0x49')][_0x110e('0x4b')]?_0x42f3b2[_0x110e('0x49')]:_0x432237[_0x110e('0x44')];if(!_0x11eeb1[_0x110e('0x46')][_0x110e('0x4c')]('nolimit')){_0x42f3b2['limit']=qs[_0x110e('0x31')](_0x11eeb1[_0x110e('0x46')]['limit']);_0x42f3b2[_0x110e('0x33')]=qs[_0x110e('0x33')](_0x11eeb1['query'][_0x110e('0x33')]);}_0x42f3b2[_0x110e('0x4d')]=qs[_0x110e('0x4e')](_0x11eeb1[_0x110e('0x46')][_0x110e('0x4e')]);_0x42f3b2['where']=qs['filters'](_[_0x110e('0x4f')](_0x11eeb1['query'],_0x432237[_0x110e('0x47')]),_0x15b44a);if(_0x11eeb1[_0x110e('0x46')][_0x110e('0x50')]){_0x42f3b2[_0x110e('0x51')]=_[_0x110e('0x52')](_0x42f3b2['where'],{'$or':_[_0x110e('0x45')](_0x15b44a,function(_0x145e81){if(_0x145e81[_0x110e('0x42')]!==_0x110e('0x53')){var _0xd5be36={};_0xd5be36[_0x145e81[_0x110e('0x3d')]]={'$like':'%'+_0x11eeb1['query'][_0x110e('0x50')]+'%'};return _0xd5be36;}})});}_0x42f3b2=_[_0x110e('0x52')]({},_0x42f3b2,_0x11eeb1[_0x110e('0x54')]);var _0xf2f454={'where':_0x42f3b2[_0x110e('0x51')]};return db[_0x110e('0x40')][_0x110e('0x34')](_0xf2f454)['then'](function(_0x22c586){_0x4a4ecb[_0x110e('0x34')]=_0x22c586;if(_0x11eeb1[_0x110e('0x46')][_0x110e('0x55')]){_0x42f3b2[_0x110e('0x56')]=[{'all':!![]}];}return db[_0x110e('0x40')][_0x110e('0x57')](_0x42f3b2);})[_0x110e('0x22')](function(_0x270e42){_0x4a4ecb[_0x110e('0x58')]=_0x270e42;return _0x4a4ecb;})[_0x110e('0x22')](respondWithFilteredResult(_0x506eee,_0x42f3b2))[_0x110e('0x2d')](handleError(_0x506eee,null));};exports[_0x110e('0x59')]=function(_0x2c0808,_0x200127){var _0x246413={'raw':![],'where':{'id':_0x2c0808[_0x110e('0x5a')]['id']},'include':[{'model':db[_0x110e('0x3e')],'as':_0x110e('0x3f')}]},_0x116fd0={};_0x116fd0[_0x110e('0x44')]=_[_0x110e('0x5b')](db[_0x110e('0x40')][_0x110e('0x41')]);_0x116fd0[_0x110e('0x46')]=_[_0x110e('0x5b')](_0x2c0808[_0x110e('0x46')]);_0x116fd0[_0x110e('0x47')]=_[_0x110e('0x48')](_0x116fd0[_0x110e('0x44')],_0x116fd0[_0x110e('0x46')]);_0x246413[_0x110e('0x49')]=_['intersection'](_0x116fd0['model'],qs[_0x110e('0x4a')](_0x2c0808['query'][_0x110e('0x4a')]));_0x246413[_0x110e('0x49')]=_0x246413[_0x110e('0x49')][_0x110e('0x4b')]?_0x246413[_0x110e('0x49')]:_0x116fd0[_0x110e('0x44')];if(_0x2c0808[_0x110e('0x46')]['includeAll']){_0x246413[_0x110e('0x56')]=[{'all':!![]}];}_0x246413=_[_0x110e('0x52')]({},_0x246413,_0x2c0808[_0x110e('0x54')]);return db[_0x110e('0x40')][_0x110e('0x5c')](_0x246413)[_0x110e('0x22')](handleEntityNotFound(_0x200127,null))['then'](respondWithResult(_0x200127,null))[_0x110e('0x2d')](handleError(_0x200127,null));};exports[_0x110e('0x5d')]=function(_0x53125b,_0x41418e){return db[_0x110e('0x40')][_0x110e('0x5d')](_0x53125b[_0x110e('0x5e')],{})[_0x110e('0x22')](function(_0x31075c){var _0x111a0a=_0x53125b[_0x110e('0x5f')][_0x110e('0x60')]({'plain':!![]});if(!_0x111a0a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x111a0a[_0x110e('0x61')]===_0x110e('0x5f')){var _0x36fc57=_0x31075c[_0x110e('0x60')]({'plain':!![]});var _0x2d4b7c=_0x110e('0x3b');return db[_0x110e('0x62')]['find']({'where':{'name':_0x2d4b7c,'userProfileId':_0x111a0a['userProfileId']},'raw':!![]})['then'](function(_0x234db7){if(_0x234db7&&_0x234db7['autoAssociation']===0x0){return db[_0x110e('0x3c')][_0x110e('0x5d')]({'name':_0x36fc57[_0x110e('0x3d')],'resourceId':_0x36fc57['id'],'type':_0x234db7[_0x110e('0x3d')],'sectionId':_0x234db7['id']},{})['then'](function(){return _0x31075c;});}else{return _0x31075c;}})[_0x110e('0x2d')](function(_0x263787){logger[_0x110e('0x29')](_0x110e('0x63'),_0x263787);throw _0x263787;});}return _0x31075c;})[_0x110e('0x22')](respondWithResult(_0x41418e,0xc9))[_0x110e('0x2d')](handleError(_0x41418e,null));};exports[_0x110e('0x39')]=function(_0x3cf31e,_0x56881f){if(_0x3cf31e['body']['id']){delete _0x3cf31e[_0x110e('0x5e')]['id'];}return db[_0x110e('0x40')][_0x110e('0x5c')]({'where':{'id':_0x3cf31e['params']['id']},'include':[{'model':db['Pause'],'as':_0x110e('0x3f')}]})['then'](handleEntityNotFound(_0x56881f,null))[_0x110e('0x22')](saveUpdates(_0x3cf31e[_0x110e('0x5e')],null))[_0x110e('0x22')](respondWithResult(_0x56881f,null))['catch'](handleError(_0x56881f,null));};exports[_0x110e('0x3a')]=function(_0x7148bf,_0x245ccd){return db['SmsAccount']['find']({'where':{'id':_0x7148bf[_0x110e('0x5a')]['id']}})[_0x110e('0x22')](handleEntityNotFound(_0x245ccd,null))[_0x110e('0x22')](removeEntity(_0x245ccd,null))[_0x110e('0x2d')](handleError(_0x245ccd,null));};exports['describe']=function(_0x2cb59c,_0x540ba2){return db[_0x110e('0x40')][_0x110e('0x64')]()[_0x110e('0x22')](respondWithResult(_0x540ba2,null))['catch'](handleError(_0x540ba2,null));};exports[_0x110e('0x65')]=function(_0x20ae15,_0x52ac6f,_0xa70b91){if(_0x20ae15[_0x110e('0x5e')]['id']){delete _0x20ae15[_0x110e('0x5e')]['id'];}return db[_0x110e('0x40')][_0x110e('0x5c')]({'where':{'id':_0x20ae15[_0x110e('0x5a')]['id']}})[_0x110e('0x22')](handleEntityNotFound(_0x52ac6f,null))[_0x110e('0x22')](function(_0x32e016){if(_0x32e016){_0x20ae15[_0x110e('0x5e')][_0x110e('0x66')]=_0x32e016['id'];return db[_0x110e('0x67')]['create'](_0x20ae15[_0x110e('0x5e')]);}})['then'](respondWithResult(_0x52ac6f,null))[_0x110e('0x2d')](handleError(_0x52ac6f,null));};exports[_0x110e('0x68')]=function(_0x29e87e,_0x3db4bf,_0x19727e){var _0x26673e={'raw':![],'where':{}};var _0x942732={};var _0x170b5f={'count':0x0,'rows':[]};return db[_0x110e('0x40')][_0x110e('0x69')]({'where':{'id':_0x29e87e['params']['id']}})['then'](handleEntityNotFound(_0x3db4bf,null))[_0x110e('0x22')](function(_0x4a2e1b){if(_0x4a2e1b){_0x942732[_0x110e('0x44')]=_[_0x110e('0x5b')](db[_0x110e('0x67')][_0x110e('0x41')]);_0x942732[_0x110e('0x46')]=_[_0x110e('0x5b')](_0x29e87e[_0x110e('0x46')]);_0x942732[_0x110e('0x47')]=_[_0x110e('0x48')](_0x942732[_0x110e('0x44')],_0x942732[_0x110e('0x46')]);_0x26673e[_0x110e('0x49')]=_[_0x110e('0x48')](_0x942732['model'],qs['fields'](_0x29e87e['query'][_0x110e('0x4a')]));_0x26673e[_0x110e('0x49')]=_0x26673e['attributes']['length']?_0x26673e[_0x110e('0x49')]:_0x942732[_0x110e('0x44')];if(!_0x29e87e['query']['hasOwnProperty'](_0x110e('0x6a'))){_0x26673e[_0x110e('0x31')]=qs[_0x110e('0x31')](_0x29e87e['query'][_0x110e('0x31')]);_0x26673e[_0x110e('0x33')]=qs[_0x110e('0x33')](_0x29e87e[_0x110e('0x46')]['offset']);}_0x26673e[_0x110e('0x4d')]=qs[_0x110e('0x4e')](_0x29e87e[_0x110e('0x46')][_0x110e('0x4e')]);_0x26673e[_0x110e('0x51')]=qs[_0x110e('0x47')](_[_0x110e('0x4f')](_0x29e87e['query'],_0x942732[_0x110e('0x47')]));_0x26673e['where'][_0x110e('0x66')]=_0x4a2e1b['id'];if(_0x29e87e[_0x110e('0x46')]['filter']){_0x26673e[_0x110e('0x51')]=_[_0x110e('0x52')](_0x26673e[_0x110e('0x51')],{'$or':_['map'](_0x26673e['attributes'],function(_0x2ca7f7){var _0x1587e6={};_0x1587e6[_0x2ca7f7]={'$like':'%'+_0x29e87e['query'][_0x110e('0x50')]+'%'};return _0x1587e6;})});}_0x26673e=_['merge']({},_0x26673e,_0x29e87e[_0x110e('0x54')]);return db[_0x110e('0x67')]['count']({'where':_0x26673e[_0x110e('0x51')]})[_0x110e('0x22')](function(_0x5cb938){_0x170b5f['count']=_0x5cb938;if(_0x29e87e[_0x110e('0x46')]['includeAll']){_0x26673e[_0x110e('0x56')]=[{'all':!![]}];}return db[_0x110e('0x67')][_0x110e('0x57')](_0x26673e);})[_0x110e('0x22')](function(_0x4ab407){_0x170b5f[_0x110e('0x58')]=_0x4ab407;return _0x170b5f;});}})[_0x110e('0x22')](respondWithFilteredResult(_0x3db4bf,_0x26673e))[_0x110e('0x2d')](handleError(_0x3db4bf,null));};exports['removeDispositions']=function(_0x21eaac,_0xbec680,_0xd7a146){return db[_0x110e('0x40')][_0x110e('0x5c')]({'where':{'id':_0x21eaac[_0x110e('0x5a')]['id']}})[_0x110e('0x22')](handleEntityNotFound(_0xbec680,null))[_0x110e('0x22')](function(_0x1dbbef){if(_0x1dbbef){return _0x1dbbef[_0x110e('0x6b')](_0x21eaac['query'][_0x110e('0x6c')]);}})['then'](respondWithStatusCode(_0xbec680,null))[_0x110e('0x2d')](handleError(_0xbec680,null));};exports['addAnswer']=function(_0x9fefe9,_0x316d48,_0x36dd15){if(_0x9fefe9[_0x110e('0x5e')]['id']){delete _0x9fefe9['body']['id'];}return db['SmsAccount'][_0x110e('0x5c')]({'where':{'id':_0x9fefe9['params']['id']}})[_0x110e('0x22')](handleEntityNotFound(_0x316d48,null))[_0x110e('0x22')](function(_0x5626bc){if(_0x5626bc){_0x9fefe9[_0x110e('0x5e')][_0x110e('0x66')]=_0x5626bc['id'];return db[_0x110e('0x6d')][_0x110e('0x5d')](_0x9fefe9['body']);}})[_0x110e('0x22')](respondWithResult(_0x316d48,null))[_0x110e('0x2d')](handleError(_0x316d48,null));};exports['getAnswers']=function(_0x37b9de,_0x448802,_0x516207){var _0x341556={'raw':![],'where':{}};var _0x1740d0={};var _0x10f2d8={'count':0x0,'rows':[]};return db[_0x110e('0x40')][_0x110e('0x69')]({'where':{'id':_0x37b9de[_0x110e('0x5a')]['id']}})[_0x110e('0x22')](handleEntityNotFound(_0x448802,null))[_0x110e('0x22')](function(_0x4274fa){if(_0x4274fa){_0x1740d0[_0x110e('0x44')]=_[_0x110e('0x5b')](db[_0x110e('0x6d')][_0x110e('0x41')]);_0x1740d0[_0x110e('0x46')]=_[_0x110e('0x5b')](_0x37b9de['query']);_0x1740d0[_0x110e('0x47')]=_[_0x110e('0x48')](_0x1740d0[_0x110e('0x44')],_0x1740d0[_0x110e('0x46')]);_0x341556[_0x110e('0x49')]=_[_0x110e('0x48')](_0x1740d0[_0x110e('0x44')],qs[_0x110e('0x4a')](_0x37b9de[_0x110e('0x46')]['fields']));_0x341556[_0x110e('0x49')]=_0x341556[_0x110e('0x49')]['length']?_0x341556['attributes']:_0x1740d0[_0x110e('0x44')];if(!_0x37b9de[_0x110e('0x46')][_0x110e('0x4c')](_0x110e('0x6a'))){_0x341556['limit']=qs['limit'](_0x37b9de[_0x110e('0x46')]['limit']);_0x341556[_0x110e('0x33')]=qs[_0x110e('0x33')](_0x37b9de[_0x110e('0x46')][_0x110e('0x33')]);}_0x341556[_0x110e('0x4d')]=qs[_0x110e('0x4e')](_0x37b9de[_0x110e('0x46')]['sort']);_0x341556[_0x110e('0x51')]=qs[_0x110e('0x47')](_['pick'](_0x37b9de[_0x110e('0x46')],_0x1740d0[_0x110e('0x47')]));_0x341556[_0x110e('0x51')][_0x110e('0x66')]=_0x4274fa['id'];if(_0x37b9de[_0x110e('0x46')]['filter']){_0x341556[_0x110e('0x51')]=_[_0x110e('0x52')](_0x341556[_0x110e('0x51')],{'$or':_[_0x110e('0x45')](_0x341556[_0x110e('0x49')],function(_0x43dc10){var _0x54e645={};_0x54e645[_0x43dc10]={'$like':'%'+_0x37b9de['query']['filter']+'%'};return _0x54e645;})});}_0x341556=_[_0x110e('0x52')]({},_0x341556,_0x37b9de['options']);return db[_0x110e('0x6d')][_0x110e('0x34')]({'where':_0x341556[_0x110e('0x51')]})['then'](function(_0x495550){_0x10f2d8[_0x110e('0x34')]=_0x495550;if(_0x37b9de['query'][_0x110e('0x55')]){_0x341556[_0x110e('0x56')]=[{'all':!![]}];}return db[_0x110e('0x6d')][_0x110e('0x57')](_0x341556);})['then'](function(_0x390682){_0x10f2d8[_0x110e('0x58')]=_0x390682;return _0x10f2d8;});}})['then'](respondWithFilteredResult(_0x448802,_0x341556))[_0x110e('0x2d')](handleError(_0x448802,null));};exports[_0x110e('0x6e')]=function(_0x385a80,_0x5261b6,_0x18c155){return db[_0x110e('0x40')][_0x110e('0x5c')]({'where':{'id':_0x385a80[_0x110e('0x5a')]['id']}})[_0x110e('0x22')](handleEntityNotFound(_0x5261b6,null))[_0x110e('0x22')](function(_0x1a9b4a){if(_0x1a9b4a){return _0x1a9b4a[_0x110e('0x6e')](_0x385a80[_0x110e('0x46')][_0x110e('0x6c')]);}})[_0x110e('0x22')](respondWithStatusCode(_0x5261b6,null))[_0x110e('0x2d')](handleError(_0x5261b6,null));};exports['notify']=function(_0x1ad5a7,_0x350ec8,_0xcb75ab){var _0xc99fbd={'channel':'sms'};var _0x3c2ed5=[];var _0x42bee6=[];var _0x2738f2={};return db[_0x110e('0x40')][_0x110e('0x5c')]({'where':{'id':_0x1ad5a7[_0x110e('0x5a')]['id']},'include':[{'model':db[_0x110e('0x6f')],'as':_0x110e('0x70')}]})[_0x110e('0x22')](handleEntityNotFound(_0x350ec8,null))[_0x110e('0x22')](function(_0x423d6c){_0xc99fbd[_0x110e('0x71')]=_0x423d6c;_0xc99fbd[_0x110e('0x72')]=_[_0x110e('0x73')](_0x423d6c[_0x110e('0x70')],['priority'],['asc']);if(_0xc99fbd[_0x110e('0x71')]['Applications']){delete _0xc99fbd[_0x110e('0x71')][_0x110e('0x70')];}return db[_0x110e('0x74')][_0x110e('0x64')]();})[_0x110e('0x22')](function(_0x8d50ca){if(!_0x8d50ca){throw new db[(_0x110e('0x75'))]['ValidationError'](_0x110e('0x76'));}_0x3c2ed5=_[_0x110e('0x77')](_[_0x110e('0x5b')](_0x8d50ca),[_0x110e('0x78'),_0x110e('0x79')]);_0x42bee6=_[_0x110e('0x77')](_[_0x110e('0x5b')](_0x8d50ca),['createdAt',_0x110e('0x79'),_0x110e('0x7a'),_0x110e('0x7b')]);_0xc99fbd[_0x110e('0x5e')]={'mapKey':_0x110e('0x7c')};if(_0xc99fbd[_0x110e('0x71')][_0x110e('0x42')]){switch(_0xc99fbd[_0x110e('0x71')][_0x110e('0x42')]){case _0x110e('0x7d'):_0xc99fbd[_0x110e('0x5e')][_0x110e('0x7e')]=_0x1ad5a7[_0x110e('0x5e')][_0x110e('0x7f')];_0xc99fbd['body'][_0x110e('0x5e')]=_0x1ad5a7[_0x110e('0x5e')]['Body'];_0xc99fbd['body'][_0x110e('0x80')]=_0x1ad5a7[_0x110e('0x5e')]['MessageSid'];break;case _0x110e('0x81'):_0xc99fbd[_0x110e('0x5e')][_0x110e('0x7e')]='+'+_0x1ad5a7[_0x110e('0x5e')][_0x110e('0x82')];_0xc99fbd[_0x110e('0x5e')][_0x110e('0x5e')]=_0x1ad5a7[_0x110e('0x5e')][_0x110e('0x83')];break;case _0x110e('0x84'):_0xc99fbd[_0x110e('0x5e')][_0x110e('0x7e')]=_0x1ad5a7[_0x110e('0x5e')][_0x110e('0x7e')];_0xc99fbd[_0x110e('0x5e')]['body']=_0x1ad5a7[_0x110e('0x5e')][_0x110e('0x2b')];break;case'clicksend':_0xc99fbd['body'][_0x110e('0x7e')]=_0x1ad5a7['body']['from'];_0xc99fbd['body'][_0x110e('0x5e')]=_0x1ad5a7[_0x110e('0x5e')][_0x110e('0x5e')];_0xc99fbd[_0x110e('0x5e')][_0x110e('0x80')]=_0x1ad5a7['body'][_0x110e('0x85')];break;case _0x110e('0x86'):_0xc99fbd[_0x110e('0x5e')][_0x110e('0x7e')]=_0x1ad5a7[_0x110e('0x5e')][_0x110e('0x7f')];_0xc99fbd[_0x110e('0x5e')][_0x110e('0x5e')]=_0x1ad5a7[_0x110e('0x5e')][_0x110e('0x87')];_0xc99fbd[_0x110e('0x5e')][_0x110e('0x80')]=_0x1ad5a7['body'][_0x110e('0x88')];break;case _0x110e('0x89'):_0xc99fbd[_0x110e('0x5e')][_0x110e('0x7e')]='+'+_0x1ad5a7['body']['results'][0x0][_0x110e('0x7e')];_0xc99fbd[_0x110e('0x5e')][_0x110e('0x5e')]=_0x1ad5a7[_0x110e('0x5e')][_0x110e('0x8a')][0x0]['text'];_0xc99fbd[_0x110e('0x5e')][_0x110e('0x80')]=_0x1ad5a7[_0x110e('0x5e')]['results'][0x0][_0x110e('0x80')];break;case _0x110e('0x8b'):_0xc99fbd[_0x110e('0x5e')]['from']=_0x1ad5a7[_0x110e('0x5e')][_0x110e('0x8c')];_0xc99fbd[_0x110e('0x5e')][_0x110e('0x5e')]=_0x1ad5a7[_0x110e('0x5e')][_0x110e('0x8d')][_0x110e('0x2b')];break;case _0x110e('0x8e'):_0xc99fbd[_0x110e('0x5e')][_0x110e('0x7e')]=_0x1ad5a7[_0x110e('0x5e')][_0x110e('0x8f')];_0xc99fbd[_0x110e('0x5e')][_0x110e('0x5e')]=_0x1ad5a7['body'][_0x110e('0x83')];_0xc99fbd['body']['messageId']=_0x1ad5a7[_0x110e('0x5e')][_0x110e('0x90')];break;case _0x110e('0x91'):_0xc99fbd[_0x110e('0x5e')][_0x110e('0x80')]=_0x1ad5a7[_0x110e('0x5e')][0x0]['message']['id'];_0xc99fbd[_0x110e('0x5e')]['from']=_0x1ad5a7['body'][0x0][_0x110e('0x2b')][_0x110e('0x7e')];_0xc99fbd[_0x110e('0x5e')][_0x110e('0x5e')]=_0x1ad5a7['body'][0x0][_0x110e('0x2b')]['text'];break;case _0x110e('0x92'):_0xc99fbd[_0x110e('0x5e')][_0x110e('0x7e')]=_0x1ad5a7[_0x110e('0x5e')]['from'];_0xc99fbd[_0x110e('0x5e')][_0x110e('0x5e')]=_0x1ad5a7[_0x110e('0x5e')][_0x110e('0x2b')];_0xc99fbd['body'][_0x110e('0x80')]=_0x1ad5a7[_0x110e('0x5e')][_0x110e('0x93')];break;}}if(_0xc99fbd[_0x110e('0x5e')]['id']){delete _0xc99fbd[_0x110e('0x5e')]['id'];}if(_['isNil'](_0xc99fbd['body'][_0x110e('0x7e')])){throw new db[(_0x110e('0x75'))][(_0x110e('0x94'))](_0x110e('0x95'));}if(_[_0x110e('0x96')](_0xc99fbd['body'][_0x110e('0x5e')])||_0xc99fbd['body'][_0x110e('0x5e')]===''){throw new db[(_0x110e('0x75'))][(_0x110e('0x94'))](_0x110e('0x97'));}if(_[_0x110e('0x96')](_0xc99fbd[_0x110e('0x5e')][_0x110e('0x98')])){throw new db['Sequelize']['ValidationError'](_0x110e('0x99')+_0x42bee6);}if(!_[_0x110e('0x9a')](_0x42bee6,_0xc99fbd['body'][_0x110e('0x98')])){throw new db[(_0x110e('0x75'))]['ValidationError'](_0x110e('0x9b')+_0x42bee6);}_0x2738f2[_0xc99fbd[_0x110e('0x5e')][_0x110e('0x98')]]=_0xc99fbd['body']['from'];return db[_0x110e('0x9c')]['find']({'where':{'id':_0xc99fbd[_0x110e('0x71')][_0x110e('0x7b')]},'include':[{'model':db[_0x110e('0x74')],'as':'Contacts','where':_0x2738f2,'limit':0x1,'order':[[_0x110e('0x79'),_0x110e('0x9d')]]}]});})[_0x110e('0x22')](handleEntityNotFound(_0x350ec8,null))[_0x110e('0x22')](function(_0x287483){if(_0x287483){_0xc99fbd['list']=_[_0x110e('0x9e')](_0x287483,[_0x110e('0x9f')]);if(_0x287483[_0x110e('0x9f')][_0x110e('0x4b')]){return _0x287483['Contacts'][0x0];}var _0x5638be=_[_0x110e('0x1a')](_0xc99fbd[_0x110e('0x5e')],{'firstName':_0xc99fbd[_0x110e('0x5e')]['from'],'ListId':_0x287483['id']});_0x5638be[_0xc99fbd[_0x110e('0x5e')][_0x110e('0x98')]]=_0xc99fbd['body']['from'];return db[_0x110e('0x74')][_0x110e('0x5d')](_0x5638be,{'fields':_0x3c2ed5,'raw':!![]});}})[_0x110e('0x22')](handleEntityNotFound(_0x350ec8,null))['then'](function(_0x429a4b){if(_0x429a4b){_0xc99fbd[_0x110e('0xa0')]=_0x429a4b;var _0x1e6c77={'ContactId':_0x429a4b['id'],'phone':_0xc99fbd[_0x110e('0x5e')][_0x110e('0x7e')],'SmsAccountId':_0x1ad5a7[_0x110e('0x5a')]['id']};var _0x59c864={'ContactId':_0x429a4b['id'],'SmsAccountId':_0x1ad5a7[_0x110e('0x5a')]['id'],'closed':![]};return db[_0x110e('0xa1')][_0x110e('0x5c')]({'where':_0x59c864})[_0x110e('0x22')](function(_0x162567){if(_0x162567){return[_0x162567,![]];}return db['SmsInteraction'][_0x110e('0x5d')](_0x1e6c77)['then'](function(_0x36b3aa){return[_0x36b3aa,!![]];});});}})[_0x110e('0xa2')](function(_0x19d179,_0x14e6ba){_0xc99fbd[_0x110e('0xa3')]=_0x19d179['get']({'plain':!![]});_0xc99fbd[_0x110e('0xa3')][_0x110e('0xa4')]=![];if(_0x14e6ba){if(_0xc99fbd[_0x110e('0x71')][_0x110e('0xa5')]){_0xc99fbd['applications'][_0x110e('0xa6')]({'id':0x0,'priority':_0xc99fbd['applications'][_0x110e('0x4b')]+0x1,'app':_0x110e('0xa7'),'appdata':_0x110e('0xa8'),'interval':_0x110e('0xa9')});}_0xc99fbd[_0x110e('0xa3')][_0x110e('0xa4')]=!![];}return db['SmsMessage'][_0x110e('0x5d')]({'phone':_0xc99fbd['body'][_0x110e('0x7e')],'messageId':_0xc99fbd['body']['messageId'],'body':_0xc99fbd[_0x110e('0x5e')][_0x110e('0x5e')],'SmsAccountId':_0x1ad5a7[_0x110e('0x5a')]['id'],'SmsInteractionId':_0x19d179['id'],'direction':'in','ContactId':_0x19d179[_0x110e('0xaa')],'AttachmentId':_0xc99fbd[_0x110e('0x5e')][_0x110e('0xab')]});})[_0x110e('0x22')](function(_0x390daf){_0xc99fbd['message']=_0x390daf;if(_0xc99fbd[_0x110e('0xa3')]['UserId']){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0xc99fbd[_0x110e('0xa3')][_0x110e('0xac')]}})[_0x110e('0x22')](function(_0x5e89c3){if(_0x5e89c3){_0xc99fbd['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x110e('0xad'),'appdata':_0x5e89c3['name']+','+(_0xc99fbd['account'][_0x110e('0xae')]||0xa),'interval':_0x110e('0xa9')});}return respondWithRpcPromise(_0x110e('0xaf'),_0x110e('0xb0'),_0xc99fbd);});}return respondWithRpcPromise(_0x110e('0xaf'),_0x110e('0xb0'),_0xc99fbd);})[_0x110e('0x22')](function(_0x40ef4b){if(_0x40ef4b){var _0x13943e=0xc8;var _0x562aae=_0x110e('0xb1');logger[_0x110e('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x562aae,_0x13943e,_0x110e('0xb2'));logger[_0x110e('0x26')](_0x110e('0xb3'),_0x562aae,_0x13943e,'entity\x20found',JSON[_0x110e('0x28')](_0x40ef4b));if(_0xc99fbd[_0x110e('0x71')]['type']===_0x110e('0x7d')){return _0x350ec8[_0x110e('0x30')](_0x13943e)[_0x110e('0xb4')]('Content-Type',_0x110e('0xb5'))['send'](_0x110e('0xb6'));}else{return _0x350ec8['status'](_0x13943e)[_0x110e('0x35')](_0x40ef4b);}}})[_0x110e('0x2d')](handleError(_0x350ec8,null));};exports[_0x110e('0xb7')]=function(_0x32ff79,_0x586937){var _0x2bfad6=_0x32ff79[_0x110e('0x5a')]['id'];var _0x53f390=_0x32ff79[_0x110e('0x5e')];var _0x49d2e3=0xc8;var _0x2ac746=null;return db[_0x110e('0xb8')][_0x110e('0xb9')]({'isolationLevel':db[_0x110e('0xb8')][_0x110e('0xba')][_0x110e('0xbb')][_0x110e('0xbc')]},function(_0x18086f){return db[_0x110e('0x40')]['findOne']({'where':{'id':_0x2bfad6},'transaction':_0x18086f})['then'](function(_0x3fbc10){if(_0x3fbc10){return db[_0x110e('0x6f')]['destroy']({'where':{'SmsAccountId':_0x2bfad6},'transaction':_0x18086f})['then'](function(){var _0x57fe9f=_[_0x110e('0x45')](_0x53f390,function(_0x364ea9){_0x364ea9[_0x110e('0x66')]=_0x2bfad6;return _0x364ea9;});return db[_0x110e('0x6f')][_0x110e('0xbd')](_0x57fe9f,{'transaction':_0x18086f});});}else{_0x49d2e3=0x194;_0x2ac746=[];}});})[_0x110e('0x22')](function(){if(_0x49d2e3!==0x194){return db['SmsApplication'][_0x110e('0xbe')]({'where':{'SmsAccountId':_0x2bfad6},'order':_0x110e('0xbf')})[_0x110e('0x22')](function(_0x4ecea8){_0x2ac746=_0x4ecea8;});}})[_0x110e('0x2d')](function(_0x1d59d2){_0x49d2e3=0x1f4;logger[_0x110e('0x29')](_0x1d59d2[_0x110e('0xc0')]);if(_0x1d59d2['name']){delete _0x1d59d2[_0x110e('0x3d')];}_0x2ac746=_0x1d59d2;})['finally'](function(){if(_0x2ac746===null){_0x586937[_0x110e('0x2e')](_0x49d2e3);}else{if(_0x49d2e3===0x1f4){_0x586937[_0x110e('0x30')](_0x49d2e3)[_0x110e('0xc1')](_0x2ac746);}else{_0x586937[_0x110e('0x30')](_0x49d2e3)[_0x110e('0x35')](_0x2ac746);}}});};exports[_0x110e('0xc2')]=function(_0x56a805,_0x267ddb,_0x1aed2e){var _0x3e1047={};var _0x1b895d={};var _0x33a9c6;var _0x1b87c5;return db[_0x110e('0x40')][_0x110e('0x69')]({'where':{'id':_0x56a805['params']['id']}})[_0x110e('0x22')](handleEntityNotFound(_0x267ddb,null))[_0x110e('0x22')](function(_0xfb47b6){if(_0xfb47b6){_0x33a9c6=_0xfb47b6;_0x1b895d[_0x110e('0x44')]=_[_0x110e('0x5b')](db[_0x110e('0x6f')][_0x110e('0x41')]);_0x1b895d[_0x110e('0x46')]=_[_0x110e('0x5b')](_0x56a805[_0x110e('0x46')]);_0x1b895d['filters']=_['intersection'](_0x1b895d[_0x110e('0x44')],_0x1b895d[_0x110e('0x46')]);_0x3e1047[_0x110e('0x49')]=_[_0x110e('0x48')](_0x1b895d[_0x110e('0x44')],qs[_0x110e('0x4a')](_0x56a805[_0x110e('0x46')][_0x110e('0x4a')]));_0x3e1047['attributes']=_0x3e1047[_0x110e('0x49')][_0x110e('0x4b')]?_0x3e1047[_0x110e('0x49')]:_0x1b895d[_0x110e('0x44')];_0x3e1047[_0x110e('0x4d')]=qs[_0x110e('0x4e')](_0x56a805[_0x110e('0x46')][_0x110e('0x4e')]);_0x3e1047['where']=qs['filters'](_[_0x110e('0x4f')](_0x56a805[_0x110e('0x46')],_0x1b895d['filters']));if(_0x56a805[_0x110e('0x46')][_0x110e('0x50')]){_0x3e1047['where']=_[_0x110e('0x52')](_0x3e1047[_0x110e('0x51')],{'$or':_[_0x110e('0x45')](_0x3e1047[_0x110e('0x49')],function(_0x250898){var _0x3a6e7a={};_0x3a6e7a[_0x250898]={'$like':'%'+_0x56a805[_0x110e('0x46')]['filter']+'%'};return _0x3a6e7a;})});}_0x3e1047=_[_0x110e('0x52')]({},_0x3e1047,_0x56a805[_0x110e('0x54')]);return _0x33a9c6[_0x110e('0xc2')](_0x3e1047);}})[_0x110e('0x22')](function(_0x49b8c9){if(_0x49b8c9){_0x1b87c5=_0x49b8c9[_0x110e('0x4b')];if(!_0x56a805['query'][_0x110e('0x4c')](_0x110e('0x6a'))){_0x3e1047[_0x110e('0x31')]=qs[_0x110e('0x31')](_0x56a805['query'][_0x110e('0x31')]);_0x3e1047[_0x110e('0x33')]=qs[_0x110e('0x33')](_0x56a805[_0x110e('0x46')][_0x110e('0x33')]);}return _0x33a9c6['getApplications'](_0x3e1047);}})[_0x110e('0x22')](function(_0x46cea6){if(_0x46cea6){return _0x46cea6?{'count':_0x1b87c5,'rows':_0x46cea6}:null;}})[_0x110e('0x22')](respondWithResult(_0x267ddb,null))[_0x110e('0x2d')](handleError(_0x267ddb,null));};exports[_0x110e('0xc3')]=function(_0xb6aa47,_0x763ba,_0x35955d){var _0x5d1f1f={'raw':![],'where':{}};var _0x3e157d={};var _0x25eae3={'count':0x0,'rows':[]};return db[_0x110e('0x40')][_0x110e('0x69')]({'where':{'id':_0xb6aa47[_0x110e('0x5a')]['id']}})[_0x110e('0x22')](handleEntityNotFound(_0x763ba,null))[_0x110e('0x22')](function(_0x8fb3da){if(_0x8fb3da){_0x3e157d[_0x110e('0x44')]=_[_0x110e('0x5b')](db['SmsInteraction'][_0x110e('0x41')]);_0x3e157d[_0x110e('0x46')]=_[_0x110e('0x5b')](_0xb6aa47[_0x110e('0x46')]);_0x3e157d['filters']=_[_0x110e('0x48')](_0x3e157d[_0x110e('0x44')],_0x3e157d['query']);_0x5d1f1f[_0x110e('0x49')]=_[_0x110e('0x48')](_0x3e157d['model'],qs[_0x110e('0x4a')](_0xb6aa47[_0x110e('0x46')][_0x110e('0x4a')]));_0x5d1f1f[_0x110e('0x49')]=_0x5d1f1f['attributes'][_0x110e('0x4b')]?_0x5d1f1f['attributes']:_0x3e157d[_0x110e('0x44')];if(!_0xb6aa47[_0x110e('0x46')][_0x110e('0x4c')](_0x110e('0x6a'))){_0x5d1f1f['limit']=qs[_0x110e('0x31')](_0xb6aa47[_0x110e('0x46')][_0x110e('0x31')]);_0x5d1f1f[_0x110e('0x33')]=qs[_0x110e('0x33')](_0xb6aa47[_0x110e('0x46')][_0x110e('0x33')]);}_0x5d1f1f[_0x110e('0x4d')]=qs[_0x110e('0x4e')](_0xb6aa47[_0x110e('0x46')][_0x110e('0x4e')]);_0x5d1f1f[_0x110e('0x51')]=qs['filters'](_[_0x110e('0x4f')](_0xb6aa47[_0x110e('0x46')],_0x3e157d[_0x110e('0x47')]));_0x5d1f1f[_0x110e('0x51')][_0x110e('0x66')]=_0x8fb3da['id'];if(_0xb6aa47['query'][_0x110e('0x50')]){_0x5d1f1f[_0x110e('0x51')]=_[_0x110e('0x52')](_0x5d1f1f[_0x110e('0x51')],{'$or':_[_0x110e('0x45')](_0x5d1f1f['attributes'],function(_0x5d48d7){var _0x15944c={};_0x15944c[_0x5d48d7]={'$like':'%'+_0xb6aa47[_0x110e('0x46')][_0x110e('0x50')]+'%'};return _0x15944c;})});}_0x5d1f1f=_[_0x110e('0x52')]({},_0x5d1f1f,_0xb6aa47['options']);return db[_0x110e('0xa1')]['count']({'where':_0x5d1f1f[_0x110e('0x51')]})[_0x110e('0x22')](function(_0x5ab395){_0x25eae3[_0x110e('0x34')]=_0x5ab395;if(_0xb6aa47[_0x110e('0x46')]['includeAll']){_0x5d1f1f['include']=[{'model':db[_0x110e('0x74')],'as':_0x110e('0xc4'),'required':![]},{'model':db[_0x110e('0xc5')],'as':_0x110e('0xc6'),'attributes':[_0x110e('0x3d'),_0x110e('0xc7'),'internal'],'required':![]},{'model':db[_0x110e('0xc8')],'as':_0x110e('0xc9'),'attributes':['id',_0x110e('0x3d'),_0x110e('0xca')],'where':_0xb6aa47[_0x110e('0x46')][_0x110e('0xcb')]?{'id':_0xb6aa47[_0x110e('0x46')][_0x110e('0xcb')]}:undefined,'required':_0xb6aa47[_0x110e('0x46')][_0x110e('0xcb')]?!![]:![]}];}return db[_0x110e('0xa1')][_0x110e('0x57')](_0x5d1f1f);})[_0x110e('0x22')](function(_0x2780fd){_0x25eae3[_0x110e('0x58')]=_0x2780fd;return _0x25eae3;});}})[_0x110e('0x22')](respondWithFilteredResult(_0x763ba,_0x5d1f1f))[_0x110e('0x2d')](handleError(_0x763ba,null));};exports['send']=function(_0x43c9c0,_0x2356b7,_0xaca34a){var _0x5da955,_0x5dee9c,_0x4332be;if(_[_0x110e('0x96')](_0x43c9c0[_0x110e('0x5e')][_0x110e('0x5e')])||_0x43c9c0[_0x110e('0x5e')][_0x110e('0x5e')]===''){throw new db[(_0x110e('0x75'))][(_0x110e('0x94'))](_0x110e('0x97'));}if(_[_0x110e('0x96')](_0x43c9c0[_0x110e('0x5e')]['to'])){throw new db[(_0x110e('0x75'))][(_0x110e('0x94'))](_0x110e('0xcc'));}_0x5da955=_0x43c9c0[_0x110e('0x5e')]['to'];return db[_0x110e('0x40')][_0x110e('0x5c')]({'where':{'id':_0x43c9c0['params']['id']},'include':[{'model':db['CmList'],'as':_0x110e('0xcd'),'include':[{'model':db[_0x110e('0x74')],'as':_0x110e('0x9f'),'where':{'mobile':_0x5da955},'limit':0x1,'order':[[_0x110e('0x79'),'DESC']]}]}]})[_0x110e('0x22')](handleEntityNotFound(_0x2356b7,null))[_0x110e('0x22')](function(_0x284720){if(_0x284720&&_0x284720[_0x110e('0xcd')]){_0x5dee9c=_0x284720[_0x110e('0x60')]({'plain':!![]});if(_0x5dee9c[_0x110e('0xcd')]&&_0x5dee9c[_0x110e('0xcd')][_0x110e('0x9f')][_0x110e('0x4b')]){return _0x5dee9c[_0x110e('0xcd')][_0x110e('0x9f')][0x0];}return db['CmContact']['create'](_[_0x110e('0x1a')](_0x43c9c0['body'],{'firstName':_0x5da955,'mobile':_0x5da955,'phone':_0x5da955,'ListId':_0x5dee9c[_0x110e('0x7b')]}));}})[_0x110e('0x22')](handleEntityNotFound(_0x2356b7,null))[_0x110e('0x22')](function(_0x2545e7){if(_0x2545e7){_0x4332be=_0x2545e7;return db['SmsInteraction'][_0x110e('0x5c')]({'where':{'ContactId':_0x4332be['id'],'closed':![],'SmsAccountId':_0x5dee9c['id']}})[_0x110e('0x22')](function(_0x4a1a2b){if(_0x4a1a2b){return[_0x4a1a2b,![]];}return db[_0x110e('0xa1')][_0x110e('0x5d')]({'UserId':_0x43c9c0[_0x110e('0x5f')]['id'],'ContactId':_0x4332be['id'],'SmsAccountId':_0x5dee9c['id'],'phone':_0x5da955,'firstMsgDirection':_0x110e('0xce'),'Messages':[_['merge'](_0x43c9c0[_0x110e('0x5e')],{'read':![],'body':_0x43c9c0['body'][_0x110e('0x5e')],'phone':_0x5da955,'SmsAccountId':_0x5dee9c['id'],'UserId':_0x43c9c0[_0x110e('0x5f')]['id'],'ContactId':_0x4332be['id']})]},{'include':[{'model':db[_0x110e('0xcf')],'as':_0x110e('0xd0')}]})[_0x110e('0x22')](function(_0x50a4f7){return[_0x50a4f7,!![]];});});}})['spread'](function(_0x7b5b50,_0x2b3a11){if(_0x2b3a11){return _0x7b5b50;}return db[_0x110e('0xcf')][_0x110e('0x5d')](_[_0x110e('0x52')](_0x43c9c0[_0x110e('0x5e')],{'read':![],'body':_0x43c9c0[_0x110e('0x5e')][_0x110e('0x5e')],'phone':_0x5da955,'SmsAccountId':_0x5dee9c['id'],'SmsInteractionId':_0x7b5b50['id'],'UserId':_0x43c9c0[_0x110e('0x5f')]['id'],'ContactId':_0x4332be['id']}))[_0x110e('0x22')](function(_0x586849){_0x7b5b50['dataValues'][_0x110e('0xd0')]=[];_0x7b5b50[_0x110e('0xd1')][_0x110e('0xd0')]['push'](_0x586849['dataValues']);return _0x7b5b50;});})[_0x110e('0x22')](respondWithResult(_0x2356b7,null))[_0x110e('0x2d')](handleError(_0x2356b7,null));};exports[_0x110e('0x30')]=function(_0x17ba8c,_0x5054fb,_0x13cdd8){if(_0x17ba8c[_0x110e('0x5e')]['id']){delete _0x17ba8c[_0x110e('0x5e')]['id'];}var _0x53014e,_0x44f1c6,_0x467082;return db[_0x110e('0x40')][_0x110e('0x5c')]({'where':{'id':_0x17ba8c['params']['id']}})['then'](handleEntityNotFound(_0x5054fb,null))[_0x110e('0x22')](function(_0x135a07){if(_0x135a07){_0x467082=_0x135a07;logger[_0x110e('0x26')](_0x110e('0x27'),'status','received\x20delivery\x20report\x20from',_0x135a07[_0x110e('0x42')],util[_0x110e('0xd2')](_0x17ba8c['body'],{'showHidden':![],'depth':null}));switch(_0x135a07[_0x110e('0x42')]){case _0x110e('0x81'):if(_0x17ba8c['body'][_0x110e('0xd3')]&&_0x17ba8c['body'][_0x110e('0x30')]){_0x44f1c6=_0x17ba8c[_0x110e('0x5e')][_0x110e('0x30')];return db['SmsMessage'][_0x110e('0x5c')]({'where':{'messageId':_0x17ba8c['body'][_0x110e('0xd3')]}});}break;case'connectel':if(_0x17ba8c['body'][_0x110e('0xd4')]&&_0x17ba8c[_0x110e('0x5e')][_0x110e('0xd5')]){_0x44f1c6=_0x17ba8c[_0x110e('0x5e')][_0x110e('0xd5')];return db['SmsMessage'][_0x110e('0x5c')]({'where':{'messageId':_0x17ba8c[_0x110e('0x5e')][_0x110e('0xd4')]}});}break;case _0x110e('0xd6'):if(_0x17ba8c['body'][_0x110e('0x85')]&&_0x17ba8c['body'][_0x110e('0xd7')]){_0x44f1c6=_0x17ba8c['body'][_0x110e('0xd7')];return db[_0x110e('0xcf')][_0x110e('0x5c')]({'where':{'messageId':_0x17ba8c[_0x110e('0x5e')]['message_id']}});}break;case _0x110e('0x89'):var _0x25c551=_0x17ba8c[_0x110e('0x5e')][_0x110e('0x8a')][0x0];if(_0x25c551[_0x110e('0x80')]&&_0x25c551[_0x110e('0x30')][_0x110e('0xd8')]===_0x110e('0xd9')){_0x44f1c6=_0x25c551[_0x110e('0x30')]['groupName'];return db[_0x110e('0xcf')]['find']({'where':{'messageId':_0x25c551[_0x110e('0x80')]}});}break;case _0x110e('0x8e'):if(_0x17ba8c[_0x110e('0x5e')][_0x110e('0x80')]&&_0x17ba8c['body'][_0x110e('0x30')]){_0x44f1c6=_0x17ba8c['body'][_0x110e('0x30')];return db[_0x110e('0xcf')]['find']({'where':{'messageId':_0x17ba8c[_0x110e('0x5e')][_0x110e('0x80')]}});}break;case _0x110e('0x91'):if(_0x17ba8c[_0x110e('0x5e')][0x0][_0x110e('0x2b')]['id']){_0x44f1c6=_0x17ba8c['body'][0x0][_0x110e('0x42')];return db[_0x110e('0xcf')]['find']({'where':{'messageId':_0x17ba8c[_0x110e('0x5e')][0x0][_0x110e('0x2b')]['id']}});}break;case'intelepeer':if(_0x17ba8c['body'][_0x110e('0xda')]&&_0x17ba8c['body'][_0x110e('0x30')]){_0x44f1c6=_0x17ba8c['body']['status'];return db[_0x110e('0xcf')]['find']({'where':{'messageId':_0x17ba8c[_0x110e('0x5e')][_0x110e('0xda')]}});}break;}}})[_0x110e('0x22')](handleEntityNotFound(_0x5054fb,null))[_0x110e('0x22')](function(_0x1ee995){if(_0x1ee995){_0x53014e=_0x1ee995;switch(_0x467082[_0x110e('0x42')]){case _0x110e('0x81'):if(_0x44f1c6===_0x110e('0xd9')){return _0x53014e[_0x110e('0x39')]({'read':!![]});}else{logger['error'](_0x110e('0x27'),_0x110e('0x30'),_0x110e('0x81'),util[_0x110e('0xd2')](_0x17ba8c[_0x110e('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x110e('0x84'):if(_0x44f1c6==='1'){return _0x53014e[_0x110e('0x39')]({'read':!![]});}else{logger[_0x110e('0x29')](_0x110e('0x27'),_0x110e('0x30'),_0x110e('0x81'),util[_0x110e('0xd2')](_0x17ba8c['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x17ba8c[_0x110e('0x5e')][_0x110e('0xdb')]&&_0x44f1c6>=0xc8&&_0x44f1c6<=0xce){return _0x53014e[_0x110e('0x39')]({'read':!![]});}else{logger[_0x110e('0x29')](_0x110e('0x27'),_0x110e('0x30'),_0x110e('0xd6'),util[_0x110e('0xd2')](_0x17ba8c[_0x110e('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x110e('0x89'):var _0x30814c=_0x17ba8c[_0x110e('0x5e')][_0x110e('0x8a')][0x0];if(_0x30814c[_0x110e('0x30')][_0x110e('0xd8')]===_0x110e('0xd9')){return _0x53014e[_0x110e('0x39')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x110e('0x89'),util['inspect'](_0x17ba8c['body'],{'showHidden':![],'depth':null}));}break;case _0x110e('0x8e'):if(_0x44f1c6=='DELIVERED_TO_GATEWAY'||_0x44f1c6==_0x110e('0xdc')){return _0x53014e[_0x110e('0x39')]({'read':!![]});}else{logger[_0x110e('0x29')](_0x110e('0x27'),_0x110e('0x30'),_0x110e('0x8e'),util[_0x110e('0xd2')](_0x17ba8c[_0x110e('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x110e('0x91'):if(_0x44f1c6=='message-delivered'){return _0x53014e[_0x110e('0x39')]({'read':!![]});}else{logger[_0x110e('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x110e('0x30'),_0x110e('0x91'),util[_0x110e('0xd2')](_0x17ba8c[_0x110e('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x110e('0x92'):if(_0x44f1c6==='DELIVRD'||_0x44f1c6===_0x110e('0xdd')){return _0x53014e['update']({'read':!![]});}else{logger[_0x110e('0x29')](_0x110e('0x27'),'status',_0x110e('0x92'),util['inspect'](_0x17ba8c['body'],{'showHidden':![],'depth':null}));}break;}return _0x53014e;}})[_0x110e('0x22')](respondWithResult(_0x5054fb,null))[_0x110e('0x2d')](handleError(_0x5054fb,null));};exports['statusGet']=function(_0x577da2,_0x478414,_0x40416a){var _0x543172,_0x744591,_0x2f7cc7;return db[_0x110e('0x40')]['find']({'where':{'id':_0x577da2[_0x110e('0x5a')]['id']}})[_0x110e('0x22')](handleEntityNotFound(_0x478414,null))['then'](function(_0x2fb183){if(_0x2fb183){_0x2f7cc7=_0x2fb183;logger[_0x110e('0x26')](_0x110e('0x27'),'status',_0x110e('0xde'),_0x2fb183[_0x110e('0x42')],util['inspect'](_0x577da2[_0x110e('0x46')],{'showHidden':![],'depth':null}));switch(_0x2fb183[_0x110e('0x42')]){case _0x110e('0x8b'):if(_0x577da2['query']['message-id']&&_0x577da2[_0x110e('0x46')]['state']){_0x744591=_0x577da2[_0x110e('0x46')][_0x110e('0xdf')];return db[_0x110e('0xcf')][_0x110e('0x5c')]({'where':{'messageId':_0x577da2[_0x110e('0x46')][_0x110e('0xe0')]}});}break;}}})[_0x110e('0x22')](handleEntityNotFound(_0x478414,null))[_0x110e('0x22')](function(_0x47ae02){if(_0x47ae02){_0x543172=_0x47ae02;switch(_0x2f7cc7['type']){case _0x110e('0x8b'):if(_0x744591==='2'||_0x744591==='6'){return _0x543172[_0x110e('0x39')]({'read':!![]});}else{logger[_0x110e('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x110e('0x30'),_0x110e('0x8b'),util['inspect'](_0x577da2['query'],{'showHidden':![],'depth':null}));};break;}return _0x543172;}})[_0x110e('0x22')](respondWithResult(_0x478414,null))[_0x110e('0x2d')](handleError(_0x478414,null));};exports['addAgents']=function(_0xd03d19,_0x292887,_0x4ae0ec){return db[_0x110e('0x40')][_0x110e('0x5c')]({'where':{'id':_0xd03d19[_0x110e('0x5a')]['id']}})[_0x110e('0x22')](handleEntityNotFound(_0x292887,null))['then'](function(_0x4633b2){if(_0x4633b2){return _0x4633b2[_0x110e('0xe1')](_0xd03d19[_0x110e('0x5e')][_0x110e('0x6c')],_[_0x110e('0x9e')](_0xd03d19[_0x110e('0x5e')],[_0x110e('0x6c'),'id'])||{})['spread'](function(_0x349a34){for(var _0x4f11fe=0x0;_0x4f11fe<_0xd03d19[_0x110e('0x5e')]['ids']['length'];_0x4f11fe+=0x1){socket[_0x110e('0xe2')](_0x110e('0xe3'),{'UserId':Number(_0xd03d19[_0x110e('0x5e')]['ids'][_0x4f11fe]),'SmsAccountId':Number(_0xd03d19[_0x110e('0x5a')]['id'])});}return _0x349a34;});}})[_0x110e('0x22')](respondWithResult(_0x292887,null))[_0x110e('0x2d')](handleError(_0x292887,null));};exports[_0x110e('0xe4')]=function(_0x33fe5e,_0x4ceb7b,_0x24d23a){return db[_0x110e('0x40')][_0x110e('0x5c')]({'where':{'id':_0x33fe5e[_0x110e('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4ceb7b,null))['then'](function(_0x4fc459){if(_0x4fc459){return _0x4fc459[_0x110e('0xe4')](_0x33fe5e['query'][_0x110e('0x6c')])['then'](function(){if(_[_0x110e('0xe5')](_0x33fe5e['query'][_0x110e('0x6c')])){for(var _0xcb4d90=0x0;_0xcb4d90<_0x33fe5e[_0x110e('0x46')]['ids']['length'];_0xcb4d90+=0x1){socket[_0x110e('0xe2')](_0x110e('0xe6'),{'UserId':Number(_0x33fe5e[_0x110e('0x46')][_0x110e('0x6c')][_0xcb4d90]),'SmsAccountId':Number(_0x33fe5e[_0x110e('0x5a')]['id'])});}}else{socket['emit'](_0x110e('0xe6'),{'UserId':Number(_0x33fe5e[_0x110e('0x46')]['ids']),'SmsAccountId':Number(_0x33fe5e['params']['id'])});}});}})[_0x110e('0x22')](respondWithStatusCode(_0x4ceb7b,null))[_0x110e('0x2d')](handleError(_0x4ceb7b,null));};exports['getAgents']=function(_0x29151c,_0x3853c0,_0x4bda59){var _0x53fe3c={};var _0x1c9052={};var _0x344523;var _0x1d54d2;return db[_0x110e('0x40')][_0x110e('0x69')]({'where':{'id':_0x29151c[_0x110e('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3853c0,null))[_0x110e('0x22')](function(_0x3b73f1){if(_0x3b73f1){_0x344523=_0x3b73f1;_0x1c9052[_0x110e('0x44')]=_[_0x110e('0x5b')](db[_0x110e('0xc5')][_0x110e('0x41')]);_0x1c9052[_0x110e('0x46')]=_[_0x110e('0x5b')](_0x29151c[_0x110e('0x46')]);_0x1c9052[_0x110e('0x47')]=_[_0x110e('0x48')](_0x1c9052['model'],_0x1c9052['query']);_0x53fe3c['attributes']=_[_0x110e('0x48')](_0x1c9052[_0x110e('0x44')],qs[_0x110e('0x4a')](_0x29151c[_0x110e('0x46')][_0x110e('0x4a')]));_0x53fe3c[_0x110e('0x49')]=_0x53fe3c[_0x110e('0x49')]['length']?_0x53fe3c[_0x110e('0x49')]:_0x1c9052['model'];_0x53fe3c['order']=qs[_0x110e('0x4e')](_0x29151c[_0x110e('0x46')][_0x110e('0x4e')]);_0x53fe3c[_0x110e('0x51')]=qs[_0x110e('0x47')](_['pick'](_0x29151c[_0x110e('0x46')],_0x1c9052[_0x110e('0x47')]));if(_0x29151c[_0x110e('0x46')][_0x110e('0x50')]){_0x53fe3c[_0x110e('0x51')]=_['merge'](_0x53fe3c[_0x110e('0x51')],{'$or':_[_0x110e('0x45')](_0x53fe3c[_0x110e('0x49')],function(_0x183371){var _0x32568e={};_0x32568e[_0x183371]={'$like':'%'+_0x29151c['query'][_0x110e('0x50')]+'%'};return _0x32568e;})});}_0x53fe3c=_[_0x110e('0x52')]({},_0x53fe3c,_0x29151c['options']);return _0x344523[_0x110e('0xe7')](_0x53fe3c);}})[_0x110e('0x22')](function(_0x243a07){if(_0x243a07){_0x1d54d2=_0x243a07[_0x110e('0x4b')];if(!_0x29151c[_0x110e('0x46')][_0x110e('0x4c')](_0x110e('0x6a'))){_0x53fe3c['limit']=qs[_0x110e('0x31')](_0x29151c[_0x110e('0x46')]['limit']);_0x53fe3c['offset']=qs[_0x110e('0x33')](_0x29151c['query'][_0x110e('0x33')]);}return _0x344523['getAgents'](_0x53fe3c);}})['then'](function(_0x35f7ec){if(_0x35f7ec){return _0x35f7ec?{'count':_0x1d54d2,'rows':_0x35f7ec}:null;}})[_0x110e('0x22')](respondWithResult(_0x3853c0,null))['catch'](handleError(_0x3853c0,null));};
\ No newline at end of file
index eb9f2bb..3d5ae29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cc9=['update','remove','emit','hasOwnProperty','exports','events','SmsAccount','save'];(function(_0x2c0c6c,_0x4bf4c0){var _0x3da5e4=function(_0x14a0b6){while(--_0x14a0b6){_0x2c0c6c['push'](_0x2c0c6c['shift']());}};_0x3da5e4(++_0x4bf4c0);}(_0x2cc9,0x75));var _0x92cc=function(_0x11e202,_0x20fd36){_0x11e202=_0x11e202-0x0;var _0x4095e6=_0x2cc9[_0x11e202];return _0x4095e6;};'use strict';var EventEmitter=require(_0x92cc('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x92cc('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x92cc('0x2'),'afterUpdate':_0x92cc('0x3'),'afterDestroy':_0x92cc('0x4')};function emitEvent(_0x27c5bc){return function(_0x1476cc,_0x4b7bc8,_0x7ec2c8){SmsAccountEvents[_0x92cc('0x5')](_0x27c5bc+':'+_0x1476cc['id'],_0x1476cc);SmsAccountEvents[_0x92cc('0x5')](_0x27c5bc,_0x1476cc);_0x7ec2c8(null);};}for(var e in events){if(events[_0x92cc('0x6')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x92cc('0x7')]=SmsAccountEvents;
\ No newline at end of file
+var _0x690f=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','SmsAccount'];(function(_0x3de873,_0x174b5f){var _0x380b8c=function(_0x313dea){while(--_0x313dea){_0x3de873['push'](_0x3de873['shift']());}};_0x380b8c(++_0x174b5f);}(_0x690f,0x15c));var _0xf690=function(_0x2f1afe,_0x7416e7){_0x2f1afe=_0x2f1afe-0x0;var _0x5e9510=_0x690f[_0x2f1afe];return _0x5e9510;};'use strict';var EventEmitter=require(_0xf690('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0xf690('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xf690('0x2')](0x0);var events={'afterCreate':_0xf690('0x3'),'afterUpdate':_0xf690('0x4'),'afterDestroy':_0xf690('0x5')};function emitEvent(_0x57d887){return function(_0x5893c0,_0x290d4a,_0x1ede8e){SmsAccountEvents['emit'](_0x57d887+':'+_0x5893c0['id'],_0x5893c0);SmsAccountEvents[_0xf690('0x6')](_0x57d887,_0x5893c0);_0x1ede8e(null);};}for(var e in events){if(events[_0xf690('0x7')](e)){var event=events[e];SmsAccount[_0xf690('0x8')](e,emitEvent(event));}}module[_0xf690('0x9')]=SmsAccountEvents;
\ No newline at end of file
index a42cbca..24da4f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x805b=['bluebird','request-promise','path','rimraf','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment'];(function(_0xf0c115,_0x497821){var _0x199019=function(_0x2735c4){while(--_0x2735c4){_0xf0c115['push'](_0xf0c115['shift']());}};_0x199019(++_0x497821);}(_0x805b,0x159));var _0xb805=function(_0x49fdd3,_0x8a3de0){_0x49fdd3=_0x49fdd3-0x0;var _0x57dd49=_0x805b[_0x49fdd3];return _0x57dd49;};'use strict';var _=require(_0xb805('0x0'));var util=require(_0xb805('0x1'));var logger=require(_0xb805('0x2'))(_0xb805('0x3'));var moment=require(_0xb805('0x4'));var BPromise=require(_0xb805('0x5'));var rp=require(_0xb805('0x6'));var fs=require('fs');var path=require(_0xb805('0x7'));var rimraf=require(_0xb805('0x8'));var config=require('../../config/environment');var attributes=require(_0xb805('0x9'));module[_0xb805('0xa')]=function(_0x519ac9,_0x38475a){return _0x519ac9[_0xb805('0xb')](_0xb805('0xc'),attributes,{'tableName':_0xb805('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3add=['path','rimraf','../../config/environment','./smsAccount.attributes','define','SmsAccount','lodash','util','../../config/logger','api','moment'];(function(_0x182186,_0x374912){var _0x1f4159=function(_0x2942f9){while(--_0x2942f9){_0x182186['push'](_0x182186['shift']());}};_0x1f4159(++_0x374912);}(_0x3add,0x10e));var _0xd3ad=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x3add[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require(_0xd3ad('0x0'));var util=require(_0xd3ad('0x1'));var logger=require(_0xd3ad('0x2'))(_0xd3ad('0x3'));var moment=require(_0xd3ad('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd3ad('0x5'));var rimraf=require(_0xd3ad('0x6'));var config=require(_0xd3ad('0x7'));var attributes=require(_0xd3ad('0x8'));module['exports']=function(_0x481462,_0x4edabf){return _0x481462[_0xd3ad('0x9')](_0xd3ad('0xa'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 46cd174..166f002 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedfd=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','model','map','moment','randomstring'];(function(_0xf05091,_0x375793){var _0x465ca3=function(_0x31f4c4){while(--_0x31f4c4){_0xf05091['push'](_0xf05091['shift']());}};_0x465ca3(++_0x375793);}(_0xedfd,0x1df));var _0xdedf=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0xedfd[_0x4bb66f];return _0xf2772f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdedf('0x0'));var BPromise=require('bluebird');var rs=require(_0xdedf('0x1'));var fs=require('fs');var Redis=require(_0xdedf('0x2'));var db=require(_0xdedf('0x3'))['db'];var utils=require(_0xdedf('0x4'));var logger=require(_0xdedf('0x5'))(_0xdedf('0x6'));var config=require(_0xdedf('0x7'));var jayson=require(_0xdedf('0x8'));var client=jayson[_0xdedf('0x9')]['http']({'port':0x232a});config[_0xdedf('0xa')]=_[_0xdedf('0xb')](config[_0xdedf('0xa')],{'host':_0xdedf('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdedf('0xa')]));require(_0xdedf('0xd'))[_0xdedf('0xe')](socket);function respondWithRpcPromise(_0x4aa2b3,_0xdf4b4f,_0x21cd68){return new BPromise(function(_0x188667,_0x174aed){return client[_0xdedf('0xf')](_0x4aa2b3,_0x21cd68)[_0xdedf('0x10')](function(_0x30972d){logger[_0xdedf('0x11')](_0xdedf('0x12'),_0xdf4b4f,_0xdedf('0x13'));logger[_0xdedf('0x14')](_0xdedf('0x15'),_0xdf4b4f,_0xdedf('0x13'),JSON[_0xdedf('0x16')](_0x30972d));if(_0x30972d[_0xdedf('0x17')]){if(_0x30972d[_0xdedf('0x17')]['code']===0x1f4){logger[_0xdedf('0x17')](_0xdedf('0x12'),_0xdf4b4f,_0x30972d['error'][_0xdedf('0x18')]);return _0x174aed(_0x30972d['error'][_0xdedf('0x18')]);}logger['error'](_0xdedf('0x12'),_0xdf4b4f,_0x30972d[_0xdedf('0x17')][_0xdedf('0x18')]);return _0x188667(_0x30972d[_0xdedf('0x17')][_0xdedf('0x18')]);}else{logger[_0xdedf('0x11')]('SmsAccount,\x20%s,\x20%s',_0xdf4b4f,_0xdedf('0x13'));_0x188667(_0x30972d[_0xdedf('0x19')][_0xdedf('0x18')]);}})[_0xdedf('0x1a')](function(_0x43d91f){logger[_0xdedf('0x17')](_0xdedf('0x12'),_0xdf4b4f,_0x43d91f);_0x174aed(_0x43d91f);});});}exports[_0xdedf('0x1b')]=function(_0x145385){var _0x1f8ad1=this;return new Promise(function(_0x24442e,_0x5e0cb0){return db[_0xdedf('0x1c')][_0xdedf('0x1d')]({'raw':_0x145385[_0xdedf('0x1e')]?_0x145385[_0xdedf('0x1e')][_0xdedf('0x1f')]===undefined?!![]:![]:!![],'where':_0x145385[_0xdedf('0x1e')]?_0x145385[_0xdedf('0x1e')][_0xdedf('0x20')]||null:null,'attributes':_0x145385[_0xdedf('0x1e')]?_0x145385[_0xdedf('0x1e')][_0xdedf('0x21')]||null:null,'include':_0x145385[_0xdedf('0x1e')]?_0x145385[_0xdedf('0x1e')][_0xdedf('0x22')]?_['map'](_0x145385[_0xdedf('0x1e')][_0xdedf('0x22')],function(_0x213581){return{'model':db[_0x213581[_0xdedf('0x23')]],'as':_0x213581['as'],'attributes':_0x213581['attributes'],'include':_0x213581[_0xdedf('0x22')]?_[_0xdedf('0x24')](_0x213581[_0xdedf('0x22')],function(_0x5e0d33){return{'model':db[_0x5e0d33[_0xdedf('0x23')]],'as':_0x5e0d33['as'],'attributes':_0x5e0d33[_0xdedf('0x21')],'include':_0x5e0d33[_0xdedf('0x22')]?_[_0xdedf('0x24')](_0x5e0d33[_0xdedf('0x22')],function(_0x15c465){return{'model':db[_0x15c465[_0xdedf('0x23')]],'as':_0x15c465['as'],'attributes':_0x15c465[_0xdedf('0x21')]};}):[]};}):[]};}):[]:[]})[_0xdedf('0x10')](function(_0x3dde90){logger[_0xdedf('0x11')](_0xdedf('0x1b'),_0x145385);logger[_0xdedf('0x14')]('ShowSmsAccount',_0x145385,JSON[_0xdedf('0x16')](_0x3dde90));_0x24442e(_0x3dde90);})[_0xdedf('0x1a')](function(_0x374157){logger[_0xdedf('0x17')](_0xdedf('0x1b'),_0x374157[_0xdedf('0x18')],_0x145385);_0x5e0cb0(_0x1f8ad1[_0xdedf('0x17')](0x1f4,_0x374157[_0xdedf('0x18')]));});});};
\ No newline at end of file
+var _0xea75=['SmsAccount','find','options','raw','where','attributes','include','map','model','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSmsAccount'];(function(_0x1fe516,_0x1fec01){var _0xd46571=function(_0x555df2){while(--_0x555df2){_0x1fe516['push'](_0x1fe516['shift']());}};_0xd46571(++_0x1fec01);}(_0xea75,0x1ab));var _0x5ea7=function(_0x4f0867,_0x3917de){_0x4f0867=_0x4f0867-0x0;var _0x3ca148=_0xea75[_0x4f0867];return _0x3ca148;};'use strict';var _=require('lodash');var util=require(_0x5ea7('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5ea7('0x1'));var fs=require('fs');var Redis=require(_0x5ea7('0x2'));var db=require(_0x5ea7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5ea7('0x4'))('rpc');var config=require(_0x5ea7('0x5'));var jayson=require(_0x5ea7('0x6'));var client=jayson[_0x5ea7('0x7')][_0x5ea7('0x8')]({'port':0x232a});config[_0x5ea7('0x9')]=_[_0x5ea7('0xa')](config['redis'],{'host':_0x5ea7('0xb'),'port':0x18eb});var socket=require(_0x5ea7('0xc'))(new Redis(config['redis']));require(_0x5ea7('0xd'))[_0x5ea7('0xe')](socket);function respondWithRpcPromise(_0x3d8b14,_0x27abce,_0x546f4f){return new BPromise(function(_0x4d5710,_0x35b461){return client[_0x5ea7('0xf')](_0x3d8b14,_0x546f4f)[_0x5ea7('0x10')](function(_0x105afc){logger[_0x5ea7('0x11')](_0x5ea7('0x12'),_0x27abce,_0x5ea7('0x13'));logger[_0x5ea7('0x14')](_0x5ea7('0x15'),_0x27abce,_0x5ea7('0x13'),JSON[_0x5ea7('0x16')](_0x105afc));if(_0x105afc[_0x5ea7('0x17')]){if(_0x105afc[_0x5ea7('0x17')][_0x5ea7('0x18')]===0x1f4){logger['error'](_0x5ea7('0x12'),_0x27abce,_0x105afc['error'][_0x5ea7('0x19')]);return _0x35b461(_0x105afc[_0x5ea7('0x17')][_0x5ea7('0x19')]);}logger[_0x5ea7('0x17')]('SmsAccount,\x20%s,\x20%s',_0x27abce,_0x105afc[_0x5ea7('0x17')][_0x5ea7('0x19')]);return _0x4d5710(_0x105afc['error'][_0x5ea7('0x19')]);}else{logger[_0x5ea7('0x11')]('SmsAccount,\x20%s,\x20%s',_0x27abce,_0x5ea7('0x13'));_0x4d5710(_0x105afc[_0x5ea7('0x1a')]['message']);}})[_0x5ea7('0x1b')](function(_0x2b0398){logger[_0x5ea7('0x17')](_0x5ea7('0x12'),_0x27abce,_0x2b0398);_0x35b461(_0x2b0398);});});}exports[_0x5ea7('0x1c')]=function(_0x1b8826){var _0x1fc230=this;return new Promise(function(_0x4e6766,_0x235780){return db[_0x5ea7('0x1d')][_0x5ea7('0x1e')]({'raw':_0x1b8826[_0x5ea7('0x1f')]?_0x1b8826[_0x5ea7('0x1f')][_0x5ea7('0x20')]===undefined?!![]:![]:!![],'where':_0x1b8826[_0x5ea7('0x1f')]?_0x1b8826[_0x5ea7('0x1f')][_0x5ea7('0x21')]||null:null,'attributes':_0x1b8826['options']?_0x1b8826[_0x5ea7('0x1f')][_0x5ea7('0x22')]||null:null,'include':_0x1b8826[_0x5ea7('0x1f')]?_0x1b8826[_0x5ea7('0x1f')][_0x5ea7('0x23')]?_[_0x5ea7('0x24')](_0x1b8826[_0x5ea7('0x1f')][_0x5ea7('0x23')],function(_0x1a3e8f){return{'model':db[_0x1a3e8f[_0x5ea7('0x25')]],'as':_0x1a3e8f['as'],'attributes':_0x1a3e8f[_0x5ea7('0x22')],'include':_0x1a3e8f[_0x5ea7('0x23')]?_[_0x5ea7('0x24')](_0x1a3e8f[_0x5ea7('0x23')],function(_0xbcf51d){return{'model':db[_0xbcf51d['model']],'as':_0xbcf51d['as'],'attributes':_0xbcf51d[_0x5ea7('0x22')],'include':_0xbcf51d[_0x5ea7('0x23')]?_[_0x5ea7('0x24')](_0xbcf51d['include'],function(_0x402494){return{'model':db[_0x402494[_0x5ea7('0x25')]],'as':_0x402494['as'],'attributes':_0x402494[_0x5ea7('0x22')]};}):[]};}):[]};}):[]:[]})[_0x5ea7('0x10')](function(_0x5eb18a){logger[_0x5ea7('0x11')](_0x5ea7('0x1c'),_0x1b8826);logger[_0x5ea7('0x14')](_0x5ea7('0x1c'),_0x1b8826,JSON['stringify'](_0x5eb18a));_0x4e6766(_0x5eb18a);})[_0x5ea7('0x1b')](function(_0xfd80ac){logger[_0x5ea7('0x17')](_0x5ea7('0x1c'),_0xfd80ac[_0x5ea7('0x19')],_0x1b8826);_0x235780(_0x1fc230[_0x5ea7('0x17')](0x1f4,_0xfd80ac[_0x5ea7('0x19')]));});});};
\ No newline at end of file
index 07ca426..8d877eb 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(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 928453a..5934f4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x39afd1,_0x5bbdb0){var _0x2d1bab=function(_0x28cde1){while(--_0x28cde1){_0x39afd1['push'](_0x39afd1['shift']());}};_0x2d1bab(++_0x5bbdb0);}(_0x3e74,0x175));var _0x43e7=function(_0x4277ee,_0x261e5c){_0x4277ee=_0x4277ee-0x0;var _0x25533e=_0x3e74[_0x4277ee];return _0x25533e;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router;
\ No newline at end of file
+var _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0x124ba1,_0x24384b){var _0x1df1d6=function(_0x3de371){while(--_0x3de371){_0x124ba1['push'](_0x124ba1['shift']());}};_0x1df1d6(++_0x24384b);}(_0x55ca,0x126));var _0xa55c=function(_0x567fff,_0xd8acd8){_0x567fff=_0x567fff-0x0;var _0x465a37=_0x55ca[_0x567fff];return _0x465a37;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router;
\ No newline at end of file
index 1f6e7a7..707140f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad8e=['STRING','TEXT'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xad8e,0x1d7));var _0xead8=function(_0x120bfe,_0x196b6e){_0x120bfe=_0x120bfe-0x0;var _0x1bc657=_0xad8e[_0x120bfe];return _0x1bc657;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xead8('0x0')]()},'description':{'type':Sequelize[_0xead8('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x2193=['STRING','noop','TEXT','*,*,*,*','exports','INTEGER'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2193,0xee));var _0x3219=function(_0x238f10,_0x3dc924){_0x238f10=_0x238f10-0x0;var _0x330f9a=_0x2193[_0x238f10];return _0x330f9a;};'use strict';var Sequelize=require('sequelize');module[_0x3219('0x0')]={'priority':{'type':Sequelize[_0x3219('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x3219('0x2')],'allowNull':![],'defaultValue':_0x3219('0x3')},'appdata':{'type':Sequelize[_0x3219('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x3219('0x2')],'defaultValue':_0x3219('0x5')}};
\ No newline at end of file
index 8b799cc..9af1ba2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c4c=['stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SmsApplication','includeAll','include','rows','catch','show','params','length','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','Content-Range','json','save','then','destroy','error'];(function(_0x38e31e,_0x35d536){var _0x5a020f=function(_0x3dde71){while(--_0x3dde71){_0x38e31e['push'](_0x38e31e['shift']());}};_0x5a020f(++_0x35d536);}(_0x9c4c,0xc1));var _0xc9c4=function(_0x40817c,_0x487674){_0x40817c=_0x40817c-0x0;var _0x147c45=_0x9c4c[_0x40817c];return _0x147c45;};'use strict';var emlformat=require(_0xc9c4('0x0'));var rimraf=require(_0xc9c4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc9c4('0x2'));var rp=require(_0xc9c4('0x3'));var moment=require(_0xc9c4('0x4'));var BPromise=require(_0xc9c4('0x5'));var Mustache=require(_0xc9c4('0x6'));var util=require(_0xc9c4('0x7'));var path=require(_0xc9c4('0x8'));var sox=require(_0xc9c4('0x9'));var csv=require(_0xc9c4('0xa'));var ejs=require(_0xc9c4('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc9c4('0xc'));var squel=require(_0xc9c4('0xd'));var crypto=require('crypto');var jsforce=require(_0xc9c4('0xe'));var deskjs=require(_0xc9c4('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc9c4('0x10'));var Papa=require(_0xc9c4('0x11'));var Redis=require(_0xc9c4('0x12'));var authService=require(_0xc9c4('0x13'));var qs=require(_0xc9c4('0x14'));var as=require(_0xc9c4('0x15'));var hardwareService=require(_0xc9c4('0x16'));var logger=require(_0xc9c4('0x17'))(_0xc9c4('0x18'));var utils=require('../../config/utils');var config=require(_0xc9c4('0x19'));var licenseUtil=require(_0xc9c4('0x1a'));var db=require(_0xc9c4('0x1b'))['db'];function respondWithStatusCode(_0x1db128,_0x218f78){_0x218f78=_0x218f78||0xcc;return function(_0x5095b6){if(_0x5095b6){return _0x1db128[_0xc9c4('0x1c')](_0x218f78);}return _0x1db128['status'](_0x218f78)[_0xc9c4('0x1d')]();};}function respondWithResult(_0x4e976f,_0x14ddf2){_0x14ddf2=_0x14ddf2||0xc8;return function(_0x3a2a41){if(_0x3a2a41){return _0x4e976f[_0xc9c4('0x1e')](_0x14ddf2)['json'](_0x3a2a41);}};}function respondWithFilteredResult(_0x445393,_0x55df54){return function(_0x4cf2a5){if(_0x4cf2a5){var _0x4cc07e=typeof _0x55df54[_0xc9c4('0x1f')]==='undefined'&&typeof _0x55df54[_0xc9c4('0x20')]===_0xc9c4('0x21');var _0x5d43e9=_0x4cf2a5[_0xc9c4('0x22')];var _0x518d69=_0x4cc07e?0x0:_0x55df54['offset'];var _0x4cea1a=_0x4cc07e?_0x4cf2a5[_0xc9c4('0x22')]:_0x55df54[_0xc9c4('0x1f')]+_0x55df54[_0xc9c4('0x20')];var _0x11c2ec;if(_0x4cea1a>=_0x5d43e9){_0x4cea1a=_0x5d43e9;_0x11c2ec=0xc8;}else{_0x11c2ec=0xce;}_0x445393[_0xc9c4('0x1e')](_0x11c2ec);return _0x445393['set'](_0xc9c4('0x23'),_0x518d69+'-'+_0x4cea1a+'/'+_0x5d43e9)[_0xc9c4('0x24')](_0x4cf2a5);}return null;};}function patchUpdates(_0x217543){return function(_0x5a1482){try{jsonpatch['apply'](_0x5a1482,_0x217543,!![]);}catch(_0x2f89b2){return BPromise['reject'](_0x2f89b2);}return _0x5a1482[_0xc9c4('0x25')]();};}function saveUpdates(_0xb6cbc0,_0x44243c){return function(_0x55e14b){if(_0x55e14b){return _0x55e14b['update'](_0xb6cbc0)[_0xc9c4('0x26')](function(_0x5863d2){return _0x5863d2;});}return null;};}function removeEntity(_0x32cf7e,_0x461190){return function(_0x434b9b){if(_0x434b9b){return _0x434b9b[_0xc9c4('0x27')]()['then'](function(){_0x32cf7e[_0xc9c4('0x1e')](0xcc)[_0xc9c4('0x1d')]();});}};}function handleEntityNotFound(_0xef550,_0x509a23){return function(_0x5b0193){if(!_0x5b0193){_0xef550[_0xc9c4('0x1c')](0x194);}return _0x5b0193;};}function handleError(_0x4003b6,_0x5f2c22){_0x5f2c22=_0x5f2c22||0x1f4;return function(_0x791f97){logger[_0xc9c4('0x28')](_0x791f97[_0xc9c4('0x29')]);if(_0x791f97[_0xc9c4('0x2a')]){delete _0x791f97[_0xc9c4('0x2a')];}_0x4003b6[_0xc9c4('0x1e')](_0x5f2c22)['send'](_0x791f97);};}exports[_0xc9c4('0x2b')]=function(_0x3ff04b,_0x5e50ba){var _0xa790d1={},_0x1426a5={},_0x993560={'count':0x0,'rows':[]};var _0xca802e=_[_0xc9c4('0x2c')](db['SmsApplication'][_0xc9c4('0x2d')],function(_0x1793eb){return{'name':_0x1793eb[_0xc9c4('0x2e')],'type':_0x1793eb[_0xc9c4('0x2f')][_0xc9c4('0x30')]};});_0x1426a5[_0xc9c4('0x31')]=_[_0xc9c4('0x2c')](_0xca802e,_0xc9c4('0x2a'));_0x1426a5['query']=_[_0xc9c4('0x32')](_0x3ff04b[_0xc9c4('0x33')]);_0x1426a5[_0xc9c4('0x34')]=_[_0xc9c4('0x35')](_0x1426a5[_0xc9c4('0x31')],_0x1426a5[_0xc9c4('0x33')]);_0xa790d1[_0xc9c4('0x36')]=_['intersection'](_0x1426a5[_0xc9c4('0x31')],qs[_0xc9c4('0x37')](_0x3ff04b[_0xc9c4('0x33')]['fields']));_0xa790d1['attributes']=_0xa790d1[_0xc9c4('0x36')]['length']?_0xa790d1[_0xc9c4('0x36')]:_0x1426a5[_0xc9c4('0x31')];if(!_0x3ff04b[_0xc9c4('0x33')][_0xc9c4('0x38')](_0xc9c4('0x39'))){_0xa790d1[_0xc9c4('0x20')]=qs[_0xc9c4('0x20')](_0x3ff04b['query'][_0xc9c4('0x20')]);_0xa790d1[_0xc9c4('0x1f')]=qs[_0xc9c4('0x1f')](_0x3ff04b[_0xc9c4('0x33')][_0xc9c4('0x1f')]);}_0xa790d1[_0xc9c4('0x3a')]=qs['sort'](_0x3ff04b[_0xc9c4('0x33')][_0xc9c4('0x3b')]);_0xa790d1[_0xc9c4('0x3c')]=qs[_0xc9c4('0x34')](_[_0xc9c4('0x3d')](_0x3ff04b[_0xc9c4('0x33')],_0x1426a5[_0xc9c4('0x34')]),_0xca802e);if(_0x3ff04b[_0xc9c4('0x33')][_0xc9c4('0x3e')]){_0xa790d1[_0xc9c4('0x3c')]=_[_0xc9c4('0x3f')](_0xa790d1[_0xc9c4('0x3c')],{'$or':_[_0xc9c4('0x2c')](_0xca802e,function(_0xc38f25){if(_0xc38f25[_0xc9c4('0x2f')]!==_0xc9c4('0x40')){var _0xba7d5c={};_0xba7d5c[_0xc38f25[_0xc9c4('0x2a')]]={'$like':'%'+_0x3ff04b[_0xc9c4('0x33')][_0xc9c4('0x3e')]+'%'};return _0xba7d5c;}})});}_0xa790d1=_[_0xc9c4('0x3f')]({},_0xa790d1,_0x3ff04b[_0xc9c4('0x41')]);var _0x20fcd4={'where':_0xa790d1['where']};return db[_0xc9c4('0x42')][_0xc9c4('0x22')](_0x20fcd4)[_0xc9c4('0x26')](function(_0x286520){_0x993560[_0xc9c4('0x22')]=_0x286520;if(_0x3ff04b['query'][_0xc9c4('0x43')]){_0xa790d1[_0xc9c4('0x44')]=[{'all':!![]}];}return db['SmsApplication']['findAll'](_0xa790d1);})[_0xc9c4('0x26')](function(_0x433ab6){_0x993560[_0xc9c4('0x45')]=_0x433ab6;return _0x993560;})['then'](respondWithFilteredResult(_0x5e50ba,_0xa790d1))[_0xc9c4('0x46')](handleError(_0x5e50ba,null));};exports[_0xc9c4('0x47')]=function(_0x4ba77d,_0x4ac28f){var _0x47c6e5={'raw':!![],'where':{'id':_0x4ba77d[_0xc9c4('0x48')]['id']}},_0x28d330={};_0x28d330[_0xc9c4('0x31')]=_[_0xc9c4('0x32')](db['SmsApplication'][_0xc9c4('0x2d')]);_0x28d330['query']=_['keys'](_0x4ba77d['query']);_0x28d330[_0xc9c4('0x34')]=_['intersection'](_0x28d330[_0xc9c4('0x31')],_0x28d330[_0xc9c4('0x33')]);_0x47c6e5[_0xc9c4('0x36')]=_[_0xc9c4('0x35')](_0x28d330[_0xc9c4('0x31')],qs[_0xc9c4('0x37')](_0x4ba77d[_0xc9c4('0x33')][_0xc9c4('0x37')]));_0x47c6e5[_0xc9c4('0x36')]=_0x47c6e5[_0xc9c4('0x36')][_0xc9c4('0x49')]?_0x47c6e5[_0xc9c4('0x36')]:_0x28d330[_0xc9c4('0x31')];if(_0x4ba77d[_0xc9c4('0x33')][_0xc9c4('0x43')]){_0x47c6e5[_0xc9c4('0x44')]=[{'all':!![]}];}_0x47c6e5=_[_0xc9c4('0x3f')]({},_0x47c6e5,_0x4ba77d[_0xc9c4('0x41')]);return db[_0xc9c4('0x42')][_0xc9c4('0x4a')](_0x47c6e5)[_0xc9c4('0x26')](handleEntityNotFound(_0x4ac28f,null))[_0xc9c4('0x26')](respondWithResult(_0x4ac28f,null))[_0xc9c4('0x46')](handleError(_0x4ac28f,null));};exports[_0xc9c4('0x4b')]=function(_0x433e92,_0xf02187){return db['SmsApplication'][_0xc9c4('0x4b')](_0x433e92[_0xc9c4('0x4c')],{})[_0xc9c4('0x26')](respondWithResult(_0xf02187,0xc9))[_0xc9c4('0x46')](handleError(_0xf02187,null));};exports[_0xc9c4('0x4d')]=function(_0x149119,_0x4c3d98){if(_0x149119[_0xc9c4('0x4c')]['id']){delete _0x149119[_0xc9c4('0x4c')]['id'];}return db['SmsApplication'][_0xc9c4('0x4a')]({'where':{'id':_0x149119[_0xc9c4('0x48')]['id']}})[_0xc9c4('0x26')](handleEntityNotFound(_0x4c3d98,null))[_0xc9c4('0x26')](saveUpdates(_0x149119[_0xc9c4('0x4c')],null))[_0xc9c4('0x26')](respondWithResult(_0x4c3d98,null))['catch'](handleError(_0x4c3d98,null));};exports[_0xc9c4('0x27')]=function(_0x1e3621,_0x1b5646){return db[_0xc9c4('0x42')][_0xc9c4('0x4a')]({'where':{'id':_0x1e3621[_0xc9c4('0x48')]['id']}})['then'](handleEntityNotFound(_0x1b5646,null))[_0xc9c4('0x26')](removeEntity(_0x1b5646,null))[_0xc9c4('0x46')](handleError(_0x1b5646,null));};
\ No newline at end of file
+var _0xa8d9=['crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','error','stack','name','map','SmsApplication','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','destroy','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0xa8d9,0x1a4));var _0x9a8d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa8d9[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a8d('0x0'));var zipdir=require(_0x9a8d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9a8d('0x2'));var moment=require(_0x9a8d('0x3'));var BPromise=require(_0x9a8d('0x4'));var Mustache=require(_0x9a8d('0x5'));var util=require('util');var path=require(_0x9a8d('0x6'));var sox=require(_0x9a8d('0x7'));var csv=require('to-csv');var ejs=require(_0x9a8d('0x8'));var fs=require('fs');var fs_extra=require(_0x9a8d('0x9'));var _=require(_0x9a8d('0xa'));var squel=require(_0x9a8d('0xb'));var crypto=require(_0x9a8d('0xc'));var jsforce=require(_0x9a8d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9a8d('0xe'));var querystring=require(_0x9a8d('0xf'));var Papa=require(_0x9a8d('0x10'));var Redis=require('ioredis');var authService=require(_0x9a8d('0x11'));var qs=require(_0x9a8d('0x12'));var as=require(_0x9a8d('0x13'));var hardwareService=require(_0x9a8d('0x14'));var logger=require(_0x9a8d('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x9a8d('0x16'));var licenseUtil=require(_0x9a8d('0x17'));var db=require(_0x9a8d('0x18'))['db'];function respondWithStatusCode(_0x50d93b,_0x2b003a){_0x2b003a=_0x2b003a||0xcc;return function(_0x54155f){if(_0x54155f){return _0x50d93b[_0x9a8d('0x19')](_0x2b003a);}return _0x50d93b[_0x9a8d('0x1a')](_0x2b003a)['end']();};}function respondWithResult(_0x17abd2,_0x173652){_0x173652=_0x173652||0xc8;return function(_0x37677f){if(_0x37677f){return _0x17abd2[_0x9a8d('0x1a')](_0x173652)[_0x9a8d('0x1b')](_0x37677f);}};}function respondWithFilteredResult(_0x2533bf,_0x4687c0){return function(_0x4aadbb){if(_0x4aadbb){var _0x507d97=typeof _0x4687c0[_0x9a8d('0x1c')]===_0x9a8d('0x1d')&&typeof _0x4687c0[_0x9a8d('0x1e')]===_0x9a8d('0x1d');var _0x41fb8f=_0x4aadbb[_0x9a8d('0x1f')];var _0x46f683=_0x507d97?0x0:_0x4687c0[_0x9a8d('0x1c')];var _0x2a5dfc=_0x507d97?_0x4aadbb[_0x9a8d('0x1f')]:_0x4687c0['offset']+_0x4687c0[_0x9a8d('0x1e')];var _0x375b77;if(_0x2a5dfc>=_0x41fb8f){_0x2a5dfc=_0x41fb8f;_0x375b77=0xc8;}else{_0x375b77=0xce;}_0x2533bf[_0x9a8d('0x1a')](_0x375b77);return _0x2533bf[_0x9a8d('0x20')](_0x9a8d('0x21'),_0x46f683+'-'+_0x2a5dfc+'/'+_0x41fb8f)[_0x9a8d('0x1b')](_0x4aadbb);}return null;};}function patchUpdates(_0x143655){return function(_0xf9c057){try{jsonpatch['apply'](_0xf9c057,_0x143655,!![]);}catch(_0x3708bc){return BPromise['reject'](_0x3708bc);}return _0xf9c057[_0x9a8d('0x22')]();};}function saveUpdates(_0x4fd31b,_0x6e35a9){return function(_0x1355ca){if(_0x1355ca){return _0x1355ca[_0x9a8d('0x23')](_0x4fd31b)[_0x9a8d('0x24')](function(_0x7c59de){return _0x7c59de;});}return null;};}function removeEntity(_0x4a36e1,_0x31e5a0){return function(_0x596dc8){if(_0x596dc8){return _0x596dc8['destroy']()['then'](function(){_0x4a36e1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d9b80,_0x282776){return function(_0x5ae47e){if(!_0x5ae47e){_0x5d9b80['sendStatus'](0x194);}return _0x5ae47e;};}function handleError(_0x2e0790,_0x4bf286){_0x4bf286=_0x4bf286||0x1f4;return function(_0x23a5aa){logger[_0x9a8d('0x25')](_0x23a5aa[_0x9a8d('0x26')]);if(_0x23a5aa['name']){delete _0x23a5aa[_0x9a8d('0x27')];}_0x2e0790[_0x9a8d('0x1a')](_0x4bf286)['send'](_0x23a5aa);};}exports['index']=function(_0x2885f6,_0x4ec1a2){var _0x4ff66a={},_0x1547e4={},_0x52727c={'count':0x0,'rows':[]};var _0x284967=_[_0x9a8d('0x28')](db[_0x9a8d('0x29')]['rawAttributes'],function(_0x57a511){return{'name':_0x57a511['fieldName'],'type':_0x57a511[_0x9a8d('0x2a')]['key']};});_0x1547e4['model']=_['map'](_0x284967,_0x9a8d('0x27'));_0x1547e4[_0x9a8d('0x2b')]=_[_0x9a8d('0x2c')](_0x2885f6[_0x9a8d('0x2b')]);_0x1547e4[_0x9a8d('0x2d')]=_[_0x9a8d('0x2e')](_0x1547e4[_0x9a8d('0x2f')],_0x1547e4[_0x9a8d('0x2b')]);_0x4ff66a[_0x9a8d('0x30')]=_[_0x9a8d('0x2e')](_0x1547e4[_0x9a8d('0x2f')],qs['fields'](_0x2885f6[_0x9a8d('0x2b')][_0x9a8d('0x31')]));_0x4ff66a['attributes']=_0x4ff66a[_0x9a8d('0x30')][_0x9a8d('0x32')]?_0x4ff66a['attributes']:_0x1547e4['model'];if(!_0x2885f6[_0x9a8d('0x2b')][_0x9a8d('0x33')]('nolimit')){_0x4ff66a[_0x9a8d('0x1e')]=qs[_0x9a8d('0x1e')](_0x2885f6[_0x9a8d('0x2b')][_0x9a8d('0x1e')]);_0x4ff66a[_0x9a8d('0x1c')]=qs[_0x9a8d('0x1c')](_0x2885f6['query'][_0x9a8d('0x1c')]);}_0x4ff66a[_0x9a8d('0x34')]=qs[_0x9a8d('0x35')](_0x2885f6[_0x9a8d('0x2b')][_0x9a8d('0x35')]);_0x4ff66a[_0x9a8d('0x36')]=qs[_0x9a8d('0x2d')](_[_0x9a8d('0x37')](_0x2885f6[_0x9a8d('0x2b')],_0x1547e4[_0x9a8d('0x2d')]),_0x284967);if(_0x2885f6[_0x9a8d('0x2b')][_0x9a8d('0x38')]){_0x4ff66a[_0x9a8d('0x36')]=_[_0x9a8d('0x39')](_0x4ff66a[_0x9a8d('0x36')],{'$or':_[_0x9a8d('0x28')](_0x284967,function(_0x2307ad){if(_0x2307ad[_0x9a8d('0x2a')]!==_0x9a8d('0x3a')){var _0x513c4e={};_0x513c4e[_0x2307ad['name']]={'$like':'%'+_0x2885f6[_0x9a8d('0x2b')][_0x9a8d('0x38')]+'%'};return _0x513c4e;}})});}_0x4ff66a=_[_0x9a8d('0x39')]({},_0x4ff66a,_0x2885f6[_0x9a8d('0x3b')]);var _0x2282e8={'where':_0x4ff66a['where']};return db[_0x9a8d('0x29')][_0x9a8d('0x1f')](_0x2282e8)[_0x9a8d('0x24')](function(_0xf67606){_0x52727c[_0x9a8d('0x1f')]=_0xf67606;if(_0x2885f6['query'][_0x9a8d('0x3c')]){_0x4ff66a[_0x9a8d('0x3d')]=[{'all':!![]}];}return db[_0x9a8d('0x29')][_0x9a8d('0x3e')](_0x4ff66a);})[_0x9a8d('0x24')](function(_0x9f89b3){_0x52727c[_0x9a8d('0x3f')]=_0x9f89b3;return _0x52727c;})[_0x9a8d('0x24')](respondWithFilteredResult(_0x4ec1a2,_0x4ff66a))[_0x9a8d('0x40')](handleError(_0x4ec1a2,null));};exports[_0x9a8d('0x41')]=function(_0x34943f,_0x4ec292){var _0x17f1f8={'raw':!![],'where':{'id':_0x34943f[_0x9a8d('0x42')]['id']}},_0x8a3ff2={};_0x8a3ff2[_0x9a8d('0x2f')]=_['keys'](db['SmsApplication'][_0x9a8d('0x43')]);_0x8a3ff2[_0x9a8d('0x2b')]=_[_0x9a8d('0x2c')](_0x34943f['query']);_0x8a3ff2['filters']=_[_0x9a8d('0x2e')](_0x8a3ff2[_0x9a8d('0x2f')],_0x8a3ff2['query']);_0x17f1f8['attributes']=_[_0x9a8d('0x2e')](_0x8a3ff2['model'],qs['fields'](_0x34943f['query'][_0x9a8d('0x31')]));_0x17f1f8[_0x9a8d('0x30')]=_0x17f1f8[_0x9a8d('0x30')]['length']?_0x17f1f8[_0x9a8d('0x30')]:_0x8a3ff2[_0x9a8d('0x2f')];if(_0x34943f[_0x9a8d('0x2b')][_0x9a8d('0x3c')]){_0x17f1f8['include']=[{'all':!![]}];}_0x17f1f8=_['merge']({},_0x17f1f8,_0x34943f['options']);return db[_0x9a8d('0x29')]['find'](_0x17f1f8)[_0x9a8d('0x24')](handleEntityNotFound(_0x4ec292,null))[_0x9a8d('0x24')](respondWithResult(_0x4ec292,null))[_0x9a8d('0x40')](handleError(_0x4ec292,null));};exports[_0x9a8d('0x44')]=function(_0x3033e1,_0x5135e1){return db[_0x9a8d('0x29')][_0x9a8d('0x44')](_0x3033e1[_0x9a8d('0x45')],{})[_0x9a8d('0x24')](respondWithResult(_0x5135e1,0xc9))[_0x9a8d('0x40')](handleError(_0x5135e1,null));};exports[_0x9a8d('0x23')]=function(_0x3de316,_0x130d96){if(_0x3de316[_0x9a8d('0x45')]['id']){delete _0x3de316['body']['id'];}return db[_0x9a8d('0x29')][_0x9a8d('0x46')]({'where':{'id':_0x3de316[_0x9a8d('0x42')]['id']}})[_0x9a8d('0x24')](handleEntityNotFound(_0x130d96,null))[_0x9a8d('0x24')](saveUpdates(_0x3de316['body'],null))[_0x9a8d('0x24')](respondWithResult(_0x130d96,null))['catch'](handleError(_0x130d96,null));};exports[_0x9a8d('0x47')]=function(_0x125a97,_0x43e4cb){return db[_0x9a8d('0x29')][_0x9a8d('0x46')]({'where':{'id':_0x125a97[_0x9a8d('0x42')]['id']}})[_0x9a8d('0x24')](handleEntityNotFound(_0x43e4cb,null))[_0x9a8d('0x24')](removeEntity(_0x43e4cb,null))[_0x9a8d('0x40')](handleError(_0x43e4cb,null));};
\ No newline at end of file
index a7525bb..22d3ae8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a84=['../../config/environment','./smsApplication.attributes','exports','SmsApplication','sms_applications','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x42eda0,_0x389a6e){var _0x18682c=function(_0x2bd947){while(--_0x2bd947){_0x42eda0['push'](_0x42eda0['shift']());}};_0x18682c(++_0x389a6e);}(_0x7a84,0x186));var _0x47a8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7a84[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x47a8('0x0'));var logger=require(_0x47a8('0x1'))(_0x47a8('0x2'));var moment=require('moment');var BPromise=require(_0x47a8('0x3'));var rp=require(_0x47a8('0x4'));var fs=require('fs');var path=require(_0x47a8('0x5'));var rimraf=require('rimraf');var config=require(_0x47a8('0x6'));var attributes=require(_0x47a8('0x7'));module[_0x47a8('0x8')]=function(_0x555573,_0x4b6f82){return _0x555573['define'](_0x47a8('0x9'),attributes,{'tableName':_0x47a8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x47a8('0xb')});};
\ No newline at end of file
+var _0x045c=['lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x1aa470,_0x3cbb8e){var _0x5edf2f=function(_0x595e89){while(--_0x595e89){_0x1aa470['push'](_0x1aa470['shift']());}};_0x5edf2f(++_0x3cbb8e);}(_0x045c,0x75));var _0xc045=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x045c[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0xc045('0x0'));var util=require(_0xc045('0x1'));var logger=require(_0xc045('0x2'))(_0xc045('0x3'));var moment=require(_0xc045('0x4'));var BPromise=require(_0xc045('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc045('0x6'));var attributes=require('./smsApplication.attributes');module[_0xc045('0x7')]=function(_0x2fad18,_0x3ab5e1){return _0x2fad18[_0xc045('0x8')](_0xc045('0x9'),attributes,{'tableName':_0xc045('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc045('0xb'),'collate':_0xc045('0xc')});};
\ No newline at end of file
index 1f49052..b54c0ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7382=['message','result','catch','util','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x25f797,_0x449916){var _0x157fdd=function(_0x329fe1){while(--_0x329fe1){_0x25f797['push'](_0x25f797['shift']());}};_0x157fdd(++_0x449916);}(_0x7382,0x111));var _0x2738=function(_0x463d1f,_0x213568){_0x463d1f=_0x463d1f-0x0;var _0x5df1ee=_0x7382[_0x463d1f];return _0x5df1ee;};'use strict';var _=require('lodash');var util=require(_0x2738('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2738('0x1'));var logger=require(_0x2738('0x2'))(_0x2738('0x3'));var config=require(_0x2738('0x4'));var jayson=require(_0x2738('0x5'));var client=jayson['client'][_0x2738('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2bc38a,_0xd74b07,_0x523aef){return new BPromise(function(_0x4235e7,_0x487d14){return client[_0x2738('0x7')](_0x2bc38a,_0x523aef)['then'](function(_0x476864){logger[_0x2738('0x8')](_0x2738('0x9'),_0xd74b07,'request\x20sent');logger[_0x2738('0xa')](_0x2738('0xb'),_0xd74b07,_0x2738('0xc'),JSON['stringify'](_0x476864));if(_0x476864['error']){if(_0x476864[_0x2738('0xd')][_0x2738('0xe')]===0x1f4){logger[_0x2738('0xd')](_0x2738('0x9'),_0xd74b07,_0x476864[_0x2738('0xd')][_0x2738('0xf')]);return _0x487d14(_0x476864[_0x2738('0xd')][_0x2738('0xf')]);}logger[_0x2738('0xd')](_0x2738('0x9'),_0xd74b07,_0x476864[_0x2738('0xd')]['message']);return _0x4235e7(_0x476864[_0x2738('0xd')][_0x2738('0xf')]);}else{logger['info'](_0x2738('0x9'),_0xd74b07,'request\x20sent');_0x4235e7(_0x476864[_0x2738('0x10')]['message']);}})[_0x2738('0x11')](function(_0x568065){logger[_0x2738('0xd')](_0x2738('0x9'),_0xd74b07,_0x568065);_0x487d14(_0x568065);});});}
\ No newline at end of file
+var _0xe9ef=['client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x44985d,_0x4101be){var _0x3e26f8=function(_0x484c08){while(--_0x484c08){_0x44985d['push'](_0x44985d['shift']());}};_0x3e26f8(++_0x4101be);}(_0xe9ef,0x16e));var _0xfe9e=function(_0x383356,_0x33d2f5){_0x383356=_0x383356-0x0;var _0x32ee5a=_0xe9ef[_0x383356];return _0x32ee5a;};'use strict';var _=require(_0xfe9e('0x0'));var util=require('util');var moment=require(_0xfe9e('0x1'));var BPromise=require(_0xfe9e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfe9e('0x4'));var logger=require(_0xfe9e('0x5'))(_0xfe9e('0x6'));var config=require(_0xfe9e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfe9e('0x8')][_0xfe9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x493722,_0x539d85,_0x1ae09c){return new BPromise(function(_0x51d134,_0x4325a6){return client[_0xfe9e('0xa')](_0x493722,_0x1ae09c)[_0xfe9e('0xb')](function(_0x48cd0b){logger[_0xfe9e('0xc')](_0xfe9e('0xd'),_0x539d85,_0xfe9e('0xe'));logger['debug'](_0xfe9e('0xf'),_0x539d85,'request\x20sent',JSON[_0xfe9e('0x10')](_0x48cd0b));if(_0x48cd0b[_0xfe9e('0x11')]){if(_0x48cd0b[_0xfe9e('0x11')][_0xfe9e('0x12')]===0x1f4){logger[_0xfe9e('0x11')](_0xfe9e('0xd'),_0x539d85,_0x48cd0b[_0xfe9e('0x11')][_0xfe9e('0x13')]);return _0x4325a6(_0x48cd0b[_0xfe9e('0x11')]['message']);}logger[_0xfe9e('0x11')](_0xfe9e('0xd'),_0x539d85,_0x48cd0b['error'][_0xfe9e('0x13')]);return _0x51d134(_0x48cd0b[_0xfe9e('0x11')][_0xfe9e('0x13')]);}else{logger[_0xfe9e('0xc')]('SmsApplication,\x20%s,\x20%s',_0x539d85,'request\x20sent');_0x51d134(_0x48cd0b[_0xfe9e('0x14')][_0xfe9e('0x13')]);}})[_0xfe9e('0x15')](function(_0x30ad77){logger['error'](_0xfe9e('0xd'),_0x539d85,_0x30ad77);_0x4325a6(_0x30ad77);});});}
\ No newline at end of file
index a1dee09..a695200 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13f6=['isAuthenticated','index','get','/:id','show','/:id/messages','getMessages','/:id/download','download','create','addMessage','post','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','update','delete','smsinteraction:destroy','destroy','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller'];(function(_0x51e2b4,_0xfa7903){var _0x1e6389=function(_0x4b0ef1){while(--_0x4b0ef1){_0x51e2b4['push'](_0x51e2b4['shift']());}};_0x1e6389(++_0xfa7903);}(_0x13f6,0x124));var _0x613f=function(_0x31ecd9,_0x2b5f65){_0x31ecd9=_0x31ecd9-0x0;var _0x1ed3ee=_0x13f6[_0x31ecd9];return _0x1ed3ee;};'use strict';var multer=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x613f('0x2'));var router=express[_0x613f('0x3')]();var fs_extra=require(_0x613f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x613f('0x5'));var config=require(_0x613f('0x6'));var controller=require(_0x613f('0x7'));router['get']('/',auth[_0x613f('0x8')](),controller[_0x613f('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x613f('0xa')](_0x613f('0xb'),auth[_0x613f('0x8')](),controller[_0x613f('0xc')]);router['get'](_0x613f('0xd'),auth[_0x613f('0x8')](),controller[_0x613f('0xe')]);router['get'](_0x613f('0xf'),auth[_0x613f('0x8')](),controller[_0x613f('0x10')]);router['post']('/',auth[_0x613f('0x8')](),controller[_0x613f('0x11')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0x613f('0x12')]);router[_0x613f('0x13')](_0x613f('0x14'),auth[_0x613f('0x8')](),interaction[_0x613f('0x15')](_0x613f('0x16'),_0x613f('0x17')),controller[_0x613f('0x18')]);router[_0x613f('0x19')](_0x613f('0xb'),auth['isAuthenticated'](),interaction[_0x613f('0x15')]('sms','smsinteraction:update'),controller[_0x613f('0x1a')]);router[_0x613f('0x1b')]('/:id',auth[_0x613f('0x8')](),interaction['tracked'](_0x613f('0x16'),_0x613f('0x1c')),controller[_0x613f('0x1d')]);router[_0x613f('0x1b')](_0x613f('0x14'),auth[_0x613f('0x8')](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
+var _0xd7d1=['update','delete','smsinteraction:destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','download','post','addMessage','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x2577e2,_0x47957b){_0x2577e2=_0x2577e2-0x0;var _0x42da7a=_0xd7d1[_0x2577e2];return _0x42da7a;};'use strict';var multer=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var path=require(_0x1d7d('0x2'));var timeout=require(_0x1d7d('0x3'));var express=require(_0x1d7d('0x4'));var router=express[_0x1d7d('0x5')]();var fs_extra=require(_0x1d7d('0x6'));var auth=require(_0x1d7d('0x7'));var interaction=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var controller=require(_0x1d7d('0xa'));router[_0x1d7d('0xb')]('/',auth[_0x1d7d('0xc')](),controller['index']);router[_0x1d7d('0xb')](_0x1d7d('0xd'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0xe')]);router[_0x1d7d('0xb')](_0x1d7d('0xf'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x10')]);router[_0x1d7d('0xb')](_0x1d7d('0x11'),auth[_0x1d7d('0xc')](),controller['getMessages']);router[_0x1d7d('0xb')]('/:id/download',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x12')]);router[_0x1d7d('0x13')]('/',auth[_0x1d7d('0xc')](),controller['create']);router[_0x1d7d('0x13')]('/:id/messages',auth['isAuthenticated'](),controller[_0x1d7d('0x14')]);router[_0x1d7d('0x13')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x1d7d('0x15')](_0x1d7d('0x16'),_0x1d7d('0x17')),controller[_0x1d7d('0x18')]);router[_0x1d7d('0x19')]('/:id',auth[_0x1d7d('0xc')](),interaction[_0x1d7d('0x15')]('sms',_0x1d7d('0x1a')),controller[_0x1d7d('0x1b')]);router[_0x1d7d('0x1c')](_0x1d7d('0xf'),auth[_0x1d7d('0xc')](),interaction['tracked'](_0x1d7d('0x16'),_0x1d7d('0x1d')),controller['destroy']);router['delete'](_0x1d7d('0x1e'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x1f')]);module[_0x1d7d('0x20')]=router;
\ No newline at end of file
index 6a0569f..8479d10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34f2=['STRING','ENUM','out','sequelize','moment','BOOLEAN','DATE'];(function(_0x372e96,_0xaf5c4f){var _0x4e9dc1=function(_0x410e56){while(--_0x410e56){_0x372e96['push'](_0x372e96['shift']());}};_0x4e9dc1(++_0xaf5c4f);}(_0x34f2,0x15a));var _0x234f=function(_0x152313,_0x1e3dc8){_0x152313=_0x152313-0x0;var _0xc86a02=_0x34f2[_0x152313];return _0xc86a02;};'use strict';var Sequelize=require(_0x234f('0x0'));var moment=require(_0x234f('0x1'));module['exports']={'closed':{'type':Sequelize[_0x234f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x234f('0x3')]},'disposition':{'type':Sequelize[_0x234f('0x4')]},'secondDisposition':{'type':Sequelize[_0x234f('0x4')]},'thirdDisposition':{'type':Sequelize[_0x234f('0x4')]},'note':{'type':Sequelize[_0x234f('0x4')]},'phone':{'type':Sequelize[_0x234f('0x4')]},'read1stAt':{'type':Sequelize[_0x234f('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x234f('0x5')]('in',_0x234f('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x234f('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x234f('0x5')]('in',_0x234f('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x234f('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xb76d=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x463a6e,_0x1b47b5){var _0x51d8c6=function(_0x21f507){while(--_0x21f507){_0x463a6e['push'](_0x463a6e['shift']());}};_0x51d8c6(++_0x1b47b5);}(_0xb76d,0x119));var _0xdb76=function(_0x4a6b05,_0x2d5e17){_0x4a6b05=_0x4a6b05-0x0;var _0x502136=_0xb76d[_0x4a6b05];return _0x502136;};'use strict';var Sequelize=require(_0xdb76('0x0'));var moment=require('moment');module[_0xdb76('0x1')]={'closed':{'type':Sequelize[_0xdb76('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xdb76('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xdb76('0x4')]},'thirdDisposition':{'type':Sequelize[_0xdb76('0x4')]},'note':{'type':Sequelize[_0xdb76('0x4')]},'phone':{'type':Sequelize[_0xdb76('0x4')]},'read1stAt':{'type':Sequelize[_0xdb76('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xdb76('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xdb76('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xdb76('0x5')]('in',_0xdb76('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xdb76('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 5ddf895..18898cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e47=['err','unlinkSync','rimraf','moment','bluebird','util','ejs','lodash','ioredis','../../components/export/pdf','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','./smsInteraction.socket','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','then','destroy','error','stack','index','map','SmsInteraction','rawAttributes','fieldName','key','getOptions','findAll','sms','query','catch','params','keys','filters','intersection','model','attributes','fields','length','includeAll','include','options','create','body','find','describe','addMessage','SmsMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','SmsInteractionId','filter','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','spread','name','color','smsInteractionTags:save','removeTags','download','toString','root','server','files','tmp','join','transcript-%d-%s.zip','push','User','fullname','Contact','firstName','lastName','createdAt','direction','secret','read','SmsAccount','Account','Owner','get','Sms','N.A.','disposition','Messages','out','value','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','log'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x6e47,0xe4));var _0x76e4=function(_0x37c35a,_0x16b017){_0x37c35a=_0x37c35a-0x0;var _0x4505ba=_0x6e47[_0x37c35a];return _0x4505ba;};'use strict';var rimraf=require(_0x76e4('0x0'));var zipdir=require('zip-dir');var moment=require(_0x76e4('0x1'));var BPromise=require(_0x76e4('0x2'));var util=require(_0x76e4('0x3'));var path=require('path');var ejs=require(_0x76e4('0x4'));var fs=require('fs');var _=require(_0x76e4('0x5'));var Redis=require(_0x76e4('0x6'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0x76e4('0x7'));var logger=require(_0x76e4('0x8'))(_0x76e4('0x9'));var config=require(_0x76e4('0xa'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x76e4('0xb')],{'host':_0x76e4('0xc'),'port':0x18eb});var socket=require(_0x76e4('0xd'))(new Redis(config[_0x76e4('0xb')]));require(_0x76e4('0xe'))['register'](socket);function respondWithStatusCode(_0x197ff8,_0x58542b){_0x58542b=_0x58542b||0xcc;return function(_0x56a7e6){if(_0x56a7e6){return _0x197ff8[_0x76e4('0xf')](_0x58542b);}return _0x197ff8[_0x76e4('0x10')](_0x58542b)[_0x76e4('0x11')]();};}function respondWithResult(_0x2db9a8,_0x1a5f85){_0x1a5f85=_0x1a5f85||0xc8;return function(_0x1c06e7){if(_0x1c06e7){return _0x2db9a8['status'](_0x1a5f85)[_0x76e4('0x12')](_0x1c06e7);}};}function respondWithFilteredResult(_0xaa28ef,_0x3930b2){return function(_0x22df15){if(_0x22df15){var _0x2c8a65=typeof _0x3930b2['offset']===_0x76e4('0x13')&&typeof _0x3930b2[_0x76e4('0x14')]===_0x76e4('0x13');var _0x3f15a3=_0x22df15[_0x76e4('0x15')];var _0x24fa60=_0x2c8a65?0x0:_0x3930b2[_0x76e4('0x16')];var _0x3a64f9=_0x2c8a65?_0x22df15[_0x76e4('0x15')]:_0x3930b2['offset']+_0x3930b2['limit'];var _0x1c433d;if(_0x3a64f9>=_0x3f15a3){_0x3a64f9=_0x3f15a3;_0x1c433d=0xc8;}else{_0x1c433d=0xce;}_0xaa28ef[_0x76e4('0x10')](_0x1c433d);return _0xaa28ef[_0x76e4('0x17')](_0x76e4('0x18'),_0x24fa60+'-'+_0x3a64f9+'/'+_0x3f15a3)[_0x76e4('0x12')](_0x22df15);}return null;};}function saveUpdates(_0x5b7fc7){return function(_0x14a979){if(_0x14a979){return _0x14a979['update'](_0x5b7fc7)[_0x76e4('0x19')](function(_0x230efa){return _0x230efa;});}return null;};}function removeEntity(_0x112fa4){return function(_0x46296d){if(_0x46296d){return _0x46296d[_0x76e4('0x1a')]()[_0x76e4('0x19')](function(){_0x112fa4[_0x76e4('0x10')](0xcc)[_0x76e4('0x11')]();});}};}function handleEntityNotFound(_0x351929){return function(_0x183ea3){if(!_0x183ea3){_0x351929[_0x76e4('0xf')](0x194);}return _0x183ea3;};}function handleError(_0x2efb58,_0x3b51df){_0x3b51df=_0x3b51df||0x1f4;return function(_0x5baa36){logger[_0x76e4('0x1b')](_0x5baa36[_0x76e4('0x1c')]);if(_0x5baa36['name']){delete _0x5baa36['name'];}_0x2efb58[_0x76e4('0x10')](_0x3b51df)['send'](_0x5baa36);};}exports[_0x76e4('0x1d')]=function(_0x234288,_0xa8a41c){var _0x12f650={};var _0x2c393b=_[_0x76e4('0x1e')](db[_0x76e4('0x1f')][_0x76e4('0x20')],function(_0x2ada34){return{'name':_0x2ada34[_0x76e4('0x21')],'type':_0x2ada34['type'][_0x76e4('0x22')]};});_0x12f650=qs[_0x76e4('0x23')](_0x2c393b,_0x234288);return interaction[_0x76e4('0x24')](_0x76e4('0x25'),_0x234288[_0x76e4('0x26')],_0x234288['user'],_0x12f650,_0x2c393b)[_0x76e4('0x19')](respondWithFilteredResult(_0xa8a41c,_0x12f650))[_0x76e4('0x27')](handleError(_0xa8a41c,null));};exports['show']=function(_0x5be7be,_0x1935e4){var _0x52f8e7={'raw':![],'where':{'id':_0x5be7be[_0x76e4('0x28')]['id']}},_0x275b6a={};_0x275b6a['model']=_[_0x76e4('0x29')](db[_0x76e4('0x1f')][_0x76e4('0x20')]);_0x275b6a[_0x76e4('0x26')]=_[_0x76e4('0x29')](_0x5be7be['query']);_0x275b6a[_0x76e4('0x2a')]=_[_0x76e4('0x2b')](_0x275b6a[_0x76e4('0x2c')],_0x275b6a[_0x76e4('0x26')]);_0x52f8e7[_0x76e4('0x2d')]=_[_0x76e4('0x2b')](_0x275b6a[_0x76e4('0x2c')],qs[_0x76e4('0x2e')](_0x5be7be['query'][_0x76e4('0x2e')]));_0x52f8e7[_0x76e4('0x2d')]=_0x52f8e7['attributes'][_0x76e4('0x2f')]?_0x52f8e7[_0x76e4('0x2d')]:_0x275b6a[_0x76e4('0x2c')];if(_0x5be7be[_0x76e4('0x26')][_0x76e4('0x30')]){_0x52f8e7[_0x76e4('0x31')]=[{'all':!![]}];}_0x52f8e7=_['merge']({},_0x52f8e7,_0x5be7be[_0x76e4('0x32')]);return db[_0x76e4('0x1f')]['find'](_0x52f8e7)['then'](handleEntityNotFound(_0x1935e4,null))['then'](respondWithResult(_0x1935e4,null))[_0x76e4('0x27')](handleError(_0x1935e4,null));};exports[_0x76e4('0x33')]=function(_0x59860f,_0x147955){return db[_0x76e4('0x1f')][_0x76e4('0x33')](_0x59860f[_0x76e4('0x34')],{})[_0x76e4('0x19')](respondWithResult(_0x147955,0xc9))[_0x76e4('0x27')](handleError(_0x147955,null));};exports['update']=function(_0x3bb72a,_0x307a68){if(_0x3bb72a[_0x76e4('0x34')]['id']){delete _0x3bb72a[_0x76e4('0x34')]['id'];}return db[_0x76e4('0x1f')][_0x76e4('0x35')]({'where':{'id':_0x3bb72a[_0x76e4('0x28')]['id']}})['then'](handleEntityNotFound(_0x307a68,null))['then'](saveUpdates(_0x3bb72a[_0x76e4('0x34')],null))[_0x76e4('0x19')](respondWithResult(_0x307a68,null))['catch'](handleError(_0x307a68,null));};exports[_0x76e4('0x1a')]=function(_0x513b0c,_0x8bfa4c){return db[_0x76e4('0x1f')][_0x76e4('0x35')]({'where':{'id':_0x513b0c[_0x76e4('0x28')]['id']}})[_0x76e4('0x19')](handleEntityNotFound(_0x8bfa4c,null))[_0x76e4('0x19')](removeEntity(_0x8bfa4c,null))[_0x76e4('0x27')](handleError(_0x8bfa4c,null));};exports[_0x76e4('0x36')]=function(_0x5cade3,_0x7a388f){return db[_0x76e4('0x1f')][_0x76e4('0x36')]()[_0x76e4('0x19')](respondWithResult(_0x7a388f,null))[_0x76e4('0x27')](handleError(_0x7a388f,null));};exports[_0x76e4('0x37')]=function(_0x2738c7,_0x3ca1d9){return db[_0x76e4('0x38')][_0x76e4('0x35')]({'where':{'id':_0x2738c7['params']['id']}})[_0x76e4('0x19')](handleEntityNotFound(_0x3ca1d9,null))[_0x76e4('0x19')](function(_0x1fe569){if(_0x1fe569){return _0x1fe569['addMessage'](_0x2738c7[_0x76e4('0x34')][_0x76e4('0x39')],_[_0x76e4('0x3a')](_0x2738c7['body'],[_0x76e4('0x39'),'id'])||{});}})[_0x76e4('0x19')](respondWithResult(_0x3ca1d9,null))['catch'](handleError(_0x3ca1d9,null));};exports[_0x76e4('0x3b')]=function(_0x3075ba,_0x17de7b){var _0xc4d54c={'raw':![],'where':{}};var _0x5311d2={};var _0x1871c5={'count':0x0,'rows':[]};return db[_0x76e4('0x1f')]['findOne']({'where':{'id':_0x3075ba[_0x76e4('0x28')]['id']}})[_0x76e4('0x19')](handleEntityNotFound(_0x17de7b,null))[_0x76e4('0x19')](function(_0x45bd76){if(_0x45bd76){_0x5311d2[_0x76e4('0x2c')]=_[_0x76e4('0x29')](db[_0x76e4('0x38')][_0x76e4('0x20')]);_0x5311d2['query']=_[_0x76e4('0x29')](_0x3075ba[_0x76e4('0x26')]);_0x5311d2[_0x76e4('0x2a')]=_[_0x76e4('0x2b')](_0x5311d2['model'],_0x5311d2[_0x76e4('0x26')]);_0xc4d54c['attributes']=_[_0x76e4('0x2b')](_0x5311d2[_0x76e4('0x2c')],qs[_0x76e4('0x2e')](_0x3075ba[_0x76e4('0x26')][_0x76e4('0x2e')]));_0xc4d54c[_0x76e4('0x2d')]=_0xc4d54c[_0x76e4('0x2d')][_0x76e4('0x2f')]?_0xc4d54c[_0x76e4('0x2d')]:_0x5311d2[_0x76e4('0x2c')];if(!_0x3075ba[_0x76e4('0x26')][_0x76e4('0x3c')](_0x76e4('0x3d'))){_0xc4d54c[_0x76e4('0x14')]=qs[_0x76e4('0x14')](_0x3075ba[_0x76e4('0x26')]['limit']);_0xc4d54c[_0x76e4('0x16')]=qs['offset'](_0x3075ba[_0x76e4('0x26')][_0x76e4('0x16')]);}_0xc4d54c[_0x76e4('0x3e')]=qs[_0x76e4('0x3f')](_0x3075ba['query'][_0x76e4('0x3f')]);_0xc4d54c[_0x76e4('0x40')]=qs['filters'](_[_0x76e4('0x41')](_0x3075ba['query'],_0x5311d2[_0x76e4('0x2a')]));_0xc4d54c[_0x76e4('0x40')][_0x76e4('0x42')]=_0x45bd76['id'];if(_0x3075ba[_0x76e4('0x26')][_0x76e4('0x43')]){_0xc4d54c[_0x76e4('0x40')]=_['merge'](_0xc4d54c[_0x76e4('0x40')],{'$or':_[_0x76e4('0x1e')](_0xc4d54c[_0x76e4('0x2d')],function(_0x2a3205){var _0x56ef25={};_0x56ef25[_0x2a3205]={'$like':'%'+_0x3075ba[_0x76e4('0x26')][_0x76e4('0x43')]+'%'};return _0x56ef25;})});}if(_0x3075ba[_0x76e4('0x26')]['$gte']){var _0x42a609=_0x3075ba['query']['$gte'][_0x76e4('0x44')](',');var _0x102230={};_0x102230[_0x42a609[0x0]]={'$gte':moment(_0x42a609[0x1])[_0x76e4('0x45')](_0x76e4('0x46'))};_0xc4d54c[_0x76e4('0x40')]=_['merge'](_0xc4d54c['where'],_0x102230);}_0xc4d54c=_['merge']({},_0xc4d54c,_0x3075ba[_0x76e4('0x32')]);return db[_0x76e4('0x38')][_0x76e4('0x15')]({'where':_0xc4d54c[_0x76e4('0x40')]})['then'](function(_0x2f4845){_0x1871c5[_0x76e4('0x15')]=_0x2f4845;if(_0x3075ba['query'][_0x76e4('0x30')]){_0xc4d54c[_0x76e4('0x31')]=[{'all':!![]}];}return db[_0x76e4('0x38')][_0x76e4('0x24')](_0xc4d54c);})[_0x76e4('0x19')](function(_0x3955c0){_0x1871c5[_0x76e4('0x47')]=_0x3955c0;return _0x1871c5;});}})[_0x76e4('0x19')](respondWithFilteredResult(_0x17de7b,_0xc4d54c))['catch'](handleError(_0x17de7b,null));};exports[_0x76e4('0x48')]=function(_0x5f3e06,_0x3cc308){return db['SmsInteraction']['find']({'where':{'id':_0x5f3e06['params']['id']}})[_0x76e4('0x19')](handleEntityNotFound(_0x3cc308,null))['then'](function(_0x29a4e4){if(_0x29a4e4){return _0x29a4e4['setTags'](_0x5f3e06[_0x76e4('0x34')][_0x76e4('0x39')],_['omit'](_0x5f3e06[_0x76e4('0x34')],[_0x76e4('0x39'),'id'])||{})[_0x76e4('0x49')](function(){return db['Tag'][_0x76e4('0x24')]({'attributes':['id',_0x76e4('0x4a'),_0x76e4('0x4b')],'where':{'id':_0x5f3e06[_0x76e4('0x34')][_0x76e4('0x39')]}});})[_0x76e4('0x19')](function(_0x42ed7d){socket['emit'](_0x76e4('0x4c'),{'id':Number(_0x5f3e06[_0x76e4('0x28')]['id']),'tags':_0x42ed7d||[]});return{'id':Number(_0x5f3e06[_0x76e4('0x28')]['id']),'tags':_0x42ed7d||[]};});}})[_0x76e4('0x19')](respondWithResult(_0x3cc308,null))[_0x76e4('0x27')](handleError(_0x3cc308,null));};exports[_0x76e4('0x4d')]=function(_0x316af5,_0x2ba3cc){return db[_0x76e4('0x1f')][_0x76e4('0x35')]({'where':{'id':_0x316af5['params']['id']}})[_0x76e4('0x19')](handleEntityNotFound(_0x2ba3cc,null))[_0x76e4('0x19')](function(_0x2d4ae3){if(_0x2d4ae3){return _0x2d4ae3[_0x76e4('0x4d')](_0x316af5['query'][_0x76e4('0x39')]);}})[_0x76e4('0x19')](respondWithStatusCode(_0x2ba3cc,null))[_0x76e4('0x27')](handleError(_0x2ba3cc,null));};exports[_0x76e4('0x4e')]=function(_0x56fc69,_0x3a926d){var _0x54fecf=moment()['unix']()[_0x76e4('0x4f')]();var _0x52676c=path['join'](config[_0x76e4('0x50')],_0x76e4('0x51'),_0x76e4('0x52'),_0x76e4('0x53'));var _0x43cd45=path[_0x76e4('0x54')](_0x52676c,_0x54fecf);var _0x250f3d=util[_0x76e4('0x45')](_0x76e4('0x55'),_0x56fc69[_0x76e4('0x28')]['id'],_0x54fecf);var _0x48e078=path[_0x76e4('0x54')](_0x52676c,_0x250f3d);var _0x8b2ca0=[];_0x8b2ca0[_0x76e4('0x56')]({'model':db[_0x76e4('0x57')],'as':_0x76e4('0x57'),'attributes':['id',_0x76e4('0x58')],'raw':!![]});_0x8b2ca0[_0x76e4('0x56')]({'model':db['CmContact'],'as':_0x76e4('0x59'),'attributes':['id',_0x76e4('0x5a'),_0x76e4('0x5b')],'raw':!![]});var _0x57db82=[{'model':db[_0x76e4('0x38')],'as':'Messages','attributes':['id','body',_0x76e4('0x5c'),_0x76e4('0x5d'),_0x76e4('0x5e'),_0x76e4('0x5f')],'include':_0x8b2ca0}];_0x57db82[_0x76e4('0x56')]({'model':db[_0x76e4('0x60')],'as':_0x76e4('0x61'),'attributes':['id','name']});_0x57db82[_0x76e4('0x56')]({'model':db[_0x76e4('0x57')],'as':_0x76e4('0x62'),'attributes':['id',_0x76e4('0x58')]});return db['SmsInteraction'][_0x76e4('0x35')]({'where':{'id':_0x56fc69[_0x76e4('0x28')]['id']},'include':_0x57db82})[_0x76e4('0x19')](handleEntityNotFound(_0x3a926d,null))[_0x76e4('0x19')](function(_0x5896c6){if(_0x5896c6){var _0x39d705=_0x5896c6[_0x76e4('0x63')]({'plain':!![]});fs['mkdirSync'](_0x43cd45);var _0x3d6dc5={'channel':_0x76e4('0x64'),'account':_0x39d705[_0x76e4('0x61')][_0x76e4('0x4a')],'agent':_0x39d705[_0x76e4('0x62')]?_0x39d705[_0x76e4('0x62')][_0x76e4('0x58')]:_0x76e4('0x65'),'createdAt':moment(_0x39d705[_0x76e4('0x5c')])[_0x76e4('0x45')](_0x76e4('0x46'))['toString'](),'closedAt':_0x39d705['closed']?moment(_0x39d705['closedAt'])[_0x76e4('0x45')](_0x76e4('0x46'))['toString']():'','disposition':_0x39d705[_0x76e4('0x66')],'messages':_(_0x39d705[_0x76e4('0x67')])[_0x76e4('0x43')]({'secret':![]})[_0x76e4('0x1e')](function(_0x327208){return{'date':moment(_0x327208['createdAt'])[_0x76e4('0x45')](_0x76e4('0x46'))[_0x76e4('0x4f')](),'sender':_0x327208[_0x76e4('0x5d')]===_0x76e4('0x68')?_0x327208[_0x76e4('0x57')]?_0x327208[_0x76e4('0x57')][_0x76e4('0x58')]:'System':_0x327208[_0x76e4('0x59')]['firstName']+(_0x327208[_0x76e4('0x59')][_0x76e4('0x5b')]?'\x20'+_0x327208['Contact'][_0x76e4('0x5b')]:''),'body':_0x327208[_0x76e4('0x34')],'direction':_0x327208[_0x76e4('0x5d')]===_0x76e4('0x68')?'A':'C','secret':_0x327208[_0x76e4('0x5e')],'read':_0x327208[_0x76e4('0x5f')]};})[_0x76e4('0x69')]()};return ejs[_0x76e4('0x6a')](path[_0x76e4('0x54')](config[_0x76e4('0x50')],_0x76e4('0x51'),'views',_0x76e4('0x6b')),{'interaction':_0x3d6dc5})[_0x76e4('0x19')](function(_0x114e26){var _0x289293=path['join'](_0x43cd45,'transcript-'+_0x39d705['id']+'-'+_0x54fecf+_0x76e4('0x6c'));var _0x877f98={'path':_0x289293,'channel':'Sms','interactionId':_0x39d705['id']};return pdf[_0x76e4('0x6d')](_0x114e26,_0x877f98);})['then'](function(){return new BPromise(function(_0x370443,_0x161c09){zipdir(_0x43cd45,{'saveTo':_0x48e078},function(_0x4c1007,_0x2a214f){if(_0x4c1007)return _0x161c09(_0x4c1007);return _0x370443(_0x2a214f);});})[_0x76e4('0x19')](function(){return new BPromise(function(_0x49f618,_0x21cd42){rimraf(_0x43cd45,function(_0xb58fe2){if(_0xb58fe2)_0x21cd42(_0xb58fe2);return _0x49f618();});});})['then'](function(){return _0x3a926d[_0x76e4('0x4e')](_0x48e078,_0x250f3d,function(_0x2b2eeb){if(_0x2b2eeb){console[_0x76e4('0x6e')](_0x76e4('0x6f'),_0x2b2eeb);}else{fs[_0x76e4('0x70')](_0x48e078);}});});});}else{return _0x3a926d[_0x76e4('0xf')](0xc8);}})[_0x76e4('0x27')](handleError(_0x3a926d,null));};
\ No newline at end of file
+var _0x00e1=['renderFile','transcript-','.pdf','createPdfFromHTML','download','log','err','unlinkSync','zip-dir','moment','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','then','end','stack','name','send','index','map','rawAttributes','type','key','getOptions','findAll','query','user','catch','show','model','SmsInteraction','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','create','body','update','find','params','destroy','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','sort','where','pick','filter','format','rows','setTags','Tag','smsInteractionTags:save','removeTags','unix','join','root','server','files','tmp','push','User','CmContact','Messages','secret','read','SmsAccount','Account','Owner','fullname','get','Sms','N.A.','YYYY-MM-DD\x20HH:mm:ss','toString','closedAt','createdAt','direction','System','Contact','firstName','lastName','out','value'];(function(_0x2344d7,_0x1fe3c6){var _0x3e738c=function(_0x2c00fe){while(--_0x2c00fe){_0x2344d7['push'](_0x2344d7['shift']());}};_0x3e738c(++_0x1fe3c6);}(_0x00e1,0xf2));var _0x100e=function(_0x490140,_0x58cef6){_0x490140=_0x490140-0x0;var _0x4e6ed9=_0x00e1[_0x490140];return _0x4e6ed9;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x100e('0x0'));var moment=require(_0x100e('0x1'));var BPromise=require('bluebird');var util=require(_0x100e('0x2'));var path=require('path');var ejs=require(_0x100e('0x3'));var fs=require('fs');var _=require(_0x100e('0x4'));var Redis=require(_0x100e('0x5'));var interaction=require(_0x100e('0x6'));var qs=require(_0x100e('0x7'));var pdf=require(_0x100e('0x8'));var logger=require(_0x100e('0x9'))('api');var config=require(_0x100e('0xa'));var db=require(_0x100e('0xb'))['db'];config[_0x100e('0xc')]=_[_0x100e('0xd')](config[_0x100e('0xc')],{'host':_0x100e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x100e('0xf'))[_0x100e('0x10')](socket);function respondWithStatusCode(_0x16e09a,_0x23708a){_0x23708a=_0x23708a||0xcc;return function(_0xc253b){if(_0xc253b){return _0x16e09a[_0x100e('0x11')](_0x23708a);}return _0x16e09a[_0x100e('0x12')](_0x23708a)['end']();};}function respondWithResult(_0x4a6111,_0x46aa92){_0x46aa92=_0x46aa92||0xc8;return function(_0x9875be){if(_0x9875be){return _0x4a6111[_0x100e('0x12')](_0x46aa92)[_0x100e('0x13')](_0x9875be);}};}function respondWithFilteredResult(_0x1c16c9,_0x1cefc0){return function(_0x2acfc0){if(_0x2acfc0){var _0x4e229a=typeof _0x1cefc0[_0x100e('0x14')]===_0x100e('0x15')&&typeof _0x1cefc0[_0x100e('0x16')]===_0x100e('0x15');var _0x53edc8=_0x2acfc0[_0x100e('0x17')];var _0x4d3b43=_0x4e229a?0x0:_0x1cefc0[_0x100e('0x14')];var _0x58b003=_0x4e229a?_0x2acfc0[_0x100e('0x17')]:_0x1cefc0[_0x100e('0x14')]+_0x1cefc0['limit'];var _0xeef891;if(_0x58b003>=_0x53edc8){_0x58b003=_0x53edc8;_0xeef891=0xc8;}else{_0xeef891=0xce;}_0x1c16c9['status'](_0xeef891);return _0x1c16c9[_0x100e('0x18')](_0x100e('0x19'),_0x4d3b43+'-'+_0x58b003+'/'+_0x53edc8)[_0x100e('0x13')](_0x2acfc0);}return null;};}function saveUpdates(_0x21b20b){return function(_0x89d2cf){if(_0x89d2cf){return _0x89d2cf['update'](_0x21b20b)[_0x100e('0x1a')](function(_0x367dc1){return _0x367dc1;});}return null;};}function removeEntity(_0x1908df){return function(_0x12915c){if(_0x12915c){return _0x12915c['destroy']()['then'](function(){_0x1908df[_0x100e('0x12')](0xcc)[_0x100e('0x1b')]();});}};}function handleEntityNotFound(_0x5812b8){return function(_0x591574){if(!_0x591574){_0x5812b8['sendStatus'](0x194);}return _0x591574;};}function handleError(_0xdb3776,_0x339142){_0x339142=_0x339142||0x1f4;return function(_0x3a1853){logger['error'](_0x3a1853[_0x100e('0x1c')]);if(_0x3a1853[_0x100e('0x1d')]){delete _0x3a1853['name'];}_0xdb3776[_0x100e('0x12')](_0x339142)[_0x100e('0x1e')](_0x3a1853);};}exports[_0x100e('0x1f')]=function(_0x307945,_0x121f5d){var _0x4d6b7d={};var _0x582939=_[_0x100e('0x20')](db['SmsInteraction'][_0x100e('0x21')],function(_0x3831a5){return{'name':_0x3831a5['fieldName'],'type':_0x3831a5[_0x100e('0x22')][_0x100e('0x23')]};});_0x4d6b7d=qs[_0x100e('0x24')](_0x582939,_0x307945);return interaction[_0x100e('0x25')]('sms',_0x307945[_0x100e('0x26')],_0x307945[_0x100e('0x27')],_0x4d6b7d,_0x582939)['then'](respondWithFilteredResult(_0x121f5d,_0x4d6b7d))[_0x100e('0x28')](handleError(_0x121f5d,null));};exports[_0x100e('0x29')]=function(_0x39e3bc,_0x16ff07){var _0x5e8340={'raw':![],'where':{'id':_0x39e3bc['params']['id']}},_0x156c1a={};_0x156c1a[_0x100e('0x2a')]=_['keys'](db[_0x100e('0x2b')]['rawAttributes']);_0x156c1a[_0x100e('0x26')]=_[_0x100e('0x2c')](_0x39e3bc[_0x100e('0x26')]);_0x156c1a[_0x100e('0x2d')]=_[_0x100e('0x2e')](_0x156c1a[_0x100e('0x2a')],_0x156c1a['query']);_0x5e8340[_0x100e('0x2f')]=_[_0x100e('0x2e')](_0x156c1a[_0x100e('0x2a')],qs[_0x100e('0x30')](_0x39e3bc[_0x100e('0x26')]['fields']));_0x5e8340[_0x100e('0x2f')]=_0x5e8340[_0x100e('0x2f')][_0x100e('0x31')]?_0x5e8340['attributes']:_0x156c1a[_0x100e('0x2a')];if(_0x39e3bc[_0x100e('0x26')][_0x100e('0x32')]){_0x5e8340[_0x100e('0x33')]=[{'all':!![]}];}_0x5e8340=_[_0x100e('0x34')]({},_0x5e8340,_0x39e3bc[_0x100e('0x35')]);return db['SmsInteraction']['find'](_0x5e8340)[_0x100e('0x1a')](handleEntityNotFound(_0x16ff07,null))[_0x100e('0x1a')](respondWithResult(_0x16ff07,null))[_0x100e('0x28')](handleError(_0x16ff07,null));};exports[_0x100e('0x36')]=function(_0x391cea,_0x24deaf){return db[_0x100e('0x2b')]['create'](_0x391cea[_0x100e('0x37')],{})['then'](respondWithResult(_0x24deaf,0xc9))['catch'](handleError(_0x24deaf,null));};exports[_0x100e('0x38')]=function(_0x33cca6,_0x4fe92d){if(_0x33cca6[_0x100e('0x37')]['id']){delete _0x33cca6[_0x100e('0x37')]['id'];}return db[_0x100e('0x2b')][_0x100e('0x39')]({'where':{'id':_0x33cca6[_0x100e('0x3a')]['id']}})[_0x100e('0x1a')](handleEntityNotFound(_0x4fe92d,null))[_0x100e('0x1a')](saveUpdates(_0x33cca6[_0x100e('0x37')],null))[_0x100e('0x1a')](respondWithResult(_0x4fe92d,null))[_0x100e('0x28')](handleError(_0x4fe92d,null));};exports[_0x100e('0x3b')]=function(_0x121770,_0x1b8519){return db[_0x100e('0x2b')]['find']({'where':{'id':_0x121770['params']['id']}})['then'](handleEntityNotFound(_0x1b8519,null))['then'](removeEntity(_0x1b8519,null))[_0x100e('0x28')](handleError(_0x1b8519,null));};exports[_0x100e('0x3c')]=function(_0x18644b,_0x390992){return db['SmsInteraction'][_0x100e('0x3c')]()[_0x100e('0x1a')](respondWithResult(_0x390992,null))[_0x100e('0x28')](handleError(_0x390992,null));};exports[_0x100e('0x3d')]=function(_0x1ee033,_0x108627){return db[_0x100e('0x3e')][_0x100e('0x39')]({'where':{'id':_0x1ee033[_0x100e('0x3a')]['id']}})['then'](handleEntityNotFound(_0x108627,null))['then'](function(_0x439a89){if(_0x439a89){return _0x439a89[_0x100e('0x3d')](_0x1ee033[_0x100e('0x37')][_0x100e('0x3f')],_[_0x100e('0x40')](_0x1ee033[_0x100e('0x37')],['ids','id'])||{});}})[_0x100e('0x1a')](respondWithResult(_0x108627,null))[_0x100e('0x28')](handleError(_0x108627,null));};exports[_0x100e('0x41')]=function(_0x282542,_0x30363c){var _0x377291={'raw':![],'where':{}};var _0x4c0dd6={};var _0x1982e3={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x100e('0x42')]({'where':{'id':_0x282542[_0x100e('0x3a')]['id']}})[_0x100e('0x1a')](handleEntityNotFound(_0x30363c,null))[_0x100e('0x1a')](function(_0x11edb2){if(_0x11edb2){_0x4c0dd6[_0x100e('0x2a')]=_[_0x100e('0x2c')](db['SmsMessage'][_0x100e('0x21')]);_0x4c0dd6[_0x100e('0x26')]=_[_0x100e('0x2c')](_0x282542['query']);_0x4c0dd6['filters']=_[_0x100e('0x2e')](_0x4c0dd6[_0x100e('0x2a')],_0x4c0dd6['query']);_0x377291[_0x100e('0x2f')]=_[_0x100e('0x2e')](_0x4c0dd6['model'],qs[_0x100e('0x30')](_0x282542[_0x100e('0x26')][_0x100e('0x30')]));_0x377291['attributes']=_0x377291[_0x100e('0x2f')]['length']?_0x377291['attributes']:_0x4c0dd6[_0x100e('0x2a')];if(!_0x282542[_0x100e('0x26')][_0x100e('0x43')](_0x100e('0x44'))){_0x377291['limit']=qs[_0x100e('0x16')](_0x282542[_0x100e('0x26')][_0x100e('0x16')]);_0x377291[_0x100e('0x14')]=qs[_0x100e('0x14')](_0x282542['query'][_0x100e('0x14')]);}_0x377291['order']=qs[_0x100e('0x45')](_0x282542[_0x100e('0x26')][_0x100e('0x45')]);_0x377291[_0x100e('0x46')]=qs[_0x100e('0x2d')](_[_0x100e('0x47')](_0x282542['query'],_0x4c0dd6['filters']));_0x377291[_0x100e('0x46')]['SmsInteractionId']=_0x11edb2['id'];if(_0x282542['query'][_0x100e('0x48')]){_0x377291['where']=_[_0x100e('0x34')](_0x377291[_0x100e('0x46')],{'$or':_[_0x100e('0x20')](_0x377291[_0x100e('0x2f')],function(_0x558a7b){var _0x841a3e={};_0x841a3e[_0x558a7b]={'$like':'%'+_0x282542[_0x100e('0x26')][_0x100e('0x48')]+'%'};return _0x841a3e;})});}if(_0x282542['query']['$gte']){var _0x51f9d2=_0x282542['query']['$gte']['split'](',');var _0x45fadc={};_0x45fadc[_0x51f9d2[0x0]]={'$gte':moment(_0x51f9d2[0x1])[_0x100e('0x49')]('YYYY-MM-DD\x20HH:mm:ss')};_0x377291[_0x100e('0x46')]=_[_0x100e('0x34')](_0x377291[_0x100e('0x46')],_0x45fadc);}_0x377291=_[_0x100e('0x34')]({},_0x377291,_0x282542[_0x100e('0x35')]);return db['SmsMessage'][_0x100e('0x17')]({'where':_0x377291[_0x100e('0x46')]})[_0x100e('0x1a')](function(_0x369cbb){_0x1982e3[_0x100e('0x17')]=_0x369cbb;if(_0x282542[_0x100e('0x26')][_0x100e('0x32')]){_0x377291[_0x100e('0x33')]=[{'all':!![]}];}return db[_0x100e('0x3e')][_0x100e('0x25')](_0x377291);})['then'](function(_0x415d57){_0x1982e3[_0x100e('0x4a')]=_0x415d57;return _0x1982e3;});}})['then'](respondWithFilteredResult(_0x30363c,_0x377291))[_0x100e('0x28')](handleError(_0x30363c,null));};exports['addTags']=function(_0x57e72a,_0x32b1d6){return db[_0x100e('0x2b')][_0x100e('0x39')]({'where':{'id':_0x57e72a[_0x100e('0x3a')]['id']}})[_0x100e('0x1a')](handleEntityNotFound(_0x32b1d6,null))[_0x100e('0x1a')](function(_0x154a0b){if(_0x154a0b){return _0x154a0b[_0x100e('0x4b')](_0x57e72a[_0x100e('0x37')][_0x100e('0x3f')],_['omit'](_0x57e72a[_0x100e('0x37')],[_0x100e('0x3f'),'id'])||{})['spread'](function(){return db[_0x100e('0x4c')][_0x100e('0x25')]({'attributes':['id',_0x100e('0x1d'),'color'],'where':{'id':_0x57e72a['body'][_0x100e('0x3f')]}});})[_0x100e('0x1a')](function(_0x12b69a){socket['emit'](_0x100e('0x4d'),{'id':Number(_0x57e72a[_0x100e('0x3a')]['id']),'tags':_0x12b69a||[]});return{'id':Number(_0x57e72a[_0x100e('0x3a')]['id']),'tags':_0x12b69a||[]};});}})[_0x100e('0x1a')](respondWithResult(_0x32b1d6,null))[_0x100e('0x28')](handleError(_0x32b1d6,null));};exports[_0x100e('0x4e')]=function(_0x265698,_0xa59131){return db['SmsInteraction'][_0x100e('0x39')]({'where':{'id':_0x265698['params']['id']}})['then'](handleEntityNotFound(_0xa59131,null))['then'](function(_0x1841bb){if(_0x1841bb){return _0x1841bb[_0x100e('0x4e')](_0x265698[_0x100e('0x26')][_0x100e('0x3f')]);}})['then'](respondWithStatusCode(_0xa59131,null))[_0x100e('0x28')](handleError(_0xa59131,null));};exports['download']=function(_0x5e3dcb,_0x9f1a6b){var _0x2a41b0=moment()[_0x100e('0x4f')]()['toString']();var _0x64eb8a=path[_0x100e('0x50')](config[_0x100e('0x51')],_0x100e('0x52'),_0x100e('0x53'),_0x100e('0x54'));var _0x3d5359=path[_0x100e('0x50')](_0x64eb8a,_0x2a41b0);var _0x106887=util[_0x100e('0x49')]('transcript-%d-%s.zip',_0x5e3dcb[_0x100e('0x3a')]['id'],_0x2a41b0);var _0xa2584e=path[_0x100e('0x50')](_0x64eb8a,_0x106887);var _0x471b3e=[];_0x471b3e[_0x100e('0x55')]({'model':db['User'],'as':_0x100e('0x56'),'attributes':['id','fullname'],'raw':!![]});_0x471b3e[_0x100e('0x55')]({'model':db[_0x100e('0x57')],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]});var _0x1518ad=[{'model':db[_0x100e('0x3e')],'as':_0x100e('0x58'),'attributes':['id','body','createdAt','direction',_0x100e('0x59'),_0x100e('0x5a')],'include':_0x471b3e}];_0x1518ad[_0x100e('0x55')]({'model':db[_0x100e('0x5b')],'as':_0x100e('0x5c'),'attributes':['id',_0x100e('0x1d')]});_0x1518ad[_0x100e('0x55')]({'model':db[_0x100e('0x56')],'as':_0x100e('0x5d'),'attributes':['id',_0x100e('0x5e')]});return db[_0x100e('0x2b')]['find']({'where':{'id':_0x5e3dcb['params']['id']},'include':_0x1518ad})[_0x100e('0x1a')](handleEntityNotFound(_0x9f1a6b,null))[_0x100e('0x1a')](function(_0x3f18d9){if(_0x3f18d9){var _0x41285f=_0x3f18d9[_0x100e('0x5f')]({'plain':!![]});fs['mkdirSync'](_0x3d5359);var _0x45100a={'channel':_0x100e('0x60'),'account':_0x41285f['Account'][_0x100e('0x1d')],'agent':_0x41285f[_0x100e('0x5d')]?_0x41285f['Owner'][_0x100e('0x5e')]:_0x100e('0x61'),'createdAt':moment(_0x41285f['createdAt'])['format'](_0x100e('0x62'))[_0x100e('0x63')](),'closedAt':_0x41285f['closed']?moment(_0x41285f[_0x100e('0x64')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x100e('0x63')]():'','disposition':_0x41285f['disposition'],'messages':_(_0x41285f[_0x100e('0x58')])[_0x100e('0x48')]({'secret':![]})['map'](function(_0x15d32f){return{'date':moment(_0x15d32f[_0x100e('0x65')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x100e('0x63')](),'sender':_0x15d32f[_0x100e('0x66')]==='out'?_0x15d32f[_0x100e('0x56')]?_0x15d32f[_0x100e('0x56')][_0x100e('0x5e')]:_0x100e('0x67'):_0x15d32f[_0x100e('0x68')][_0x100e('0x69')]+(_0x15d32f[_0x100e('0x68')]['lastName']?'\x20'+_0x15d32f[_0x100e('0x68')][_0x100e('0x6a')]:''),'body':_0x15d32f[_0x100e('0x37')],'direction':_0x15d32f[_0x100e('0x66')]===_0x100e('0x6b')?'A':'C','secret':_0x15d32f['secret'],'read':_0x15d32f['read']};})[_0x100e('0x6c')]()};return ejs[_0x100e('0x6d')](path[_0x100e('0x50')](config[_0x100e('0x51')],'server','views','downloadInteraction.ejs'),{'interaction':_0x45100a})[_0x100e('0x1a')](function(_0x19285a){var _0x1bede1=path['join'](_0x3d5359,_0x100e('0x6e')+_0x41285f['id']+'-'+_0x2a41b0+_0x100e('0x6f'));var _0x882963={'path':_0x1bede1,'channel':_0x100e('0x60'),'interactionId':_0x41285f['id']};return pdf[_0x100e('0x70')](_0x19285a,_0x882963);})[_0x100e('0x1a')](function(){return new BPromise(function(_0x833d97,_0x51ff4c){zipdir(_0x3d5359,{'saveTo':_0xa2584e},function(_0x70a6a5,_0x23bc87){if(_0x70a6a5)return _0x51ff4c(_0x70a6a5);return _0x833d97(_0x23bc87);});})[_0x100e('0x1a')](function(){return new BPromise(function(_0x570dae,_0x38774b){rimraf(_0x3d5359,function(_0xf22dd3){if(_0xf22dd3)_0x38774b(_0xf22dd3);return _0x570dae();});});})['then'](function(){return _0x9f1a6b[_0x100e('0x71')](_0xa2584e,_0x106887,function(_0xd76383){if(_0xd76383){console[_0x100e('0x72')](_0x100e('0x73'),_0xd76383);}else{fs[_0x100e('0x74')](_0xa2584e);}});});});}else{return _0x9f1a6b[_0x100e('0x11')](0xc8);}})[_0x100e('0x28')](handleError(_0x9f1a6b,null));};
\ No newline at end of file
index a602493..588db9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2cf=['update','remove','then','map','findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x49e584,_0x2886f8){_0x49e584=_0x49e584-0x0;var _0x58b1be=_0xe2cf[_0x49e584];return _0x58b1be;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0xfe2c('0x0'))['db']['SmsInteraction'];var SmsMessage=require(_0xfe2c('0x0'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xfe2c('0x1')](0x0);var events={'afterCreate':_0xfe2c('0x2'),'afterUpdate':_0xfe2c('0x3'),'afterDestroy':_0xfe2c('0x4')};function emitEvent(_0x494978){return function(_0xd40c31,_0x14674d,_0x55bb12){_0xd40c31['getUsers']({'attributes':['id'],'raw':!![]})[_0xfe2c('0x5')](function(_0x417bc4){_0xd40c31['setDataValue']('Users',_0x417bc4[_0xfe2c('0x6')](function(_0x2e2933){return{'id':_0x2e2933['id']};}));return SmsMessage[_0xfe2c('0x7')]({'where':{'SmsInteractionId':_0xd40c31['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5b616c){_0xd40c31[_0xfe2c('0x8')](_0xfe2c('0x9'),_0x5b616c['length']);SmsInteractionEvents[_0xfe2c('0xa')](_0x494978+':'+_0xd40c31['id'],_0xd40c31);SmsInteractionEvents[_0xfe2c('0xa')](_0x494978,_0xd40c31);_0x55bb12(null);})[_0xfe2c('0xb')](_0x55bb12(null));};}for(var e in events){if(events[_0xfe2c('0xc')](e)){var event=events[e];SmsInteraction[_0xfe2c('0xd')](e,emitEvent(event));}}module[_0xfe2c('0xe')]=SmsInteractionEvents;
\ No newline at end of file
+var _0x25e7=['hasOwnProperty','hook','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','setDataValue','Users','map','findAll','then','unreadMessages','length','emit'];(function(_0x598ec6,_0x17113e){var _0x54de2d=function(_0x11889e){while(--_0x11889e){_0x598ec6['push'](_0x598ec6['shift']());}};_0x54de2d(++_0x17113e);}(_0x25e7,0x1d6));var _0x725e=function(_0xe2c665,_0x5467a0){_0xe2c665=_0xe2c665-0x0;var _0x5bcbb7=_0x25e7[_0xe2c665];return _0x5bcbb7;};'use strict';var EventEmitter=require(_0x725e('0x0'));var SmsInteraction=require(_0x725e('0x1'))['db'][_0x725e('0x2')];var SmsMessage=require(_0x725e('0x1'))['db'][_0x725e('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x725e('0x4')](0x0);var events={'afterCreate':_0x725e('0x5'),'afterUpdate':_0x725e('0x6'),'afterDestroy':_0x725e('0x7')};function emitEvent(_0x3da706){return function(_0x493364,_0x5e17a9,_0x2497a5){_0x493364['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x111a50){_0x493364[_0x725e('0x8')](_0x725e('0x9'),_0x111a50[_0x725e('0xa')](function(_0x40d238){return{'id':_0x40d238['id']};}));return SmsMessage[_0x725e('0xb')]({'where':{'SmsInteractionId':_0x493364['id'],'direction':'in','read':![]},'raw':!![]});})[_0x725e('0xc')](function(_0x7c40ff){_0x493364[_0x725e('0x8')](_0x725e('0xd'),_0x7c40ff[_0x725e('0xe')]);SmsInteractionEvents[_0x725e('0xf')](_0x3da706+':'+_0x493364['id'],_0x493364);SmsInteractionEvents['emit'](_0x3da706,_0x493364);_0x2497a5(null);})['catch'](_0x2497a5(null));};}for(var e in events){if(events[_0x725e('0x10')](e)){var event=events[e];SmsInteraction[_0x725e('0x11')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents;
\ No newline at end of file
index b060d0f..a1ea8f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a6c=['../../config/logger','api','moment','request-promise','rimraf','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x140e59,_0x590ed3){var _0x127259=function(_0x33199f){while(--_0x33199f){_0x140e59['push'](_0x140e59['shift']());}};_0x127259(++_0x590ed3);}(_0x9a6c,0x1eb));var _0xc9a6=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x9a6c[_0x31cb5f];return _0x586042;};'use strict';var _=require(_0xc9a6('0x0'));var util=require(_0xc9a6('0x1'));var logger=require(_0xc9a6('0x2'))(_0xc9a6('0x3'));var moment=require(_0xc9a6('0x4'));var BPromise=require('bluebird');var rp=require(_0xc9a6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc9a6('0x6'));var config=require('../../config/environment');var attributes=require(_0xc9a6('0x7'));module[_0xc9a6('0x8')]=function(_0x364f45,_0x559cc3){return _0x364f45[_0xc9a6('0x9')](_0xc9a6('0xa'),attributes,{'tableName':_0xc9a6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x30f5a6,_0x5f42fe,_0x449bc8){if(_0x30f5a6[_0xc9a6('0xc')](_0xc9a6('0xd'))){_0x30f5a6[_0xc9a6('0xe')]=moment()[_0xc9a6('0xf')](_0xc9a6('0x10'));}_0x449bc8(null,_0x30f5a6);}}});};
\ No newline at end of file
+var _0xf626=['changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','SmsInteraction','sms_interactions'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0xf626,0x66));var _0x6f62=function(_0x59178d,_0x43efe1){_0x59178d=_0x59178d-0x0;var _0x162c0c=_0xf626[_0x59178d];return _0x162c0c;};'use strict';var _=require(_0x6f62('0x0'));var util=require('util');var logger=require(_0x6f62('0x1'))('api');var moment=require(_0x6f62('0x2'));var BPromise=require(_0x6f62('0x3'));var rp=require(_0x6f62('0x4'));var fs=require('fs');var path=require(_0x6f62('0x5'));var rimraf=require('rimraf');var config=require(_0x6f62('0x6'));var attributes=require('./smsInteraction.attributes');module[_0x6f62('0x7')]=function(_0x28f864,_0x39a6c1){return _0x28f864['define'](_0x6f62('0x8'),attributes,{'tableName':_0x6f62('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2a658a,_0x23d337,_0x31e263){if(_0x2a658a[_0x6f62('0xa')](_0x6f62('0xb'))){_0x2a658a[_0x6f62('0xc')]=moment()['format'](_0x6f62('0xd'));}_0x31e263(null,_0x2a658a);}}});};
\ No newline at end of file
index fd4c958..3166331 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14b5=['client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','request','then','info','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SmsInteraction,\x20%s,\x20%s','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','limit','AddTagsToSmsInteraction','find','omit','ids','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4baa75,_0x4e4bd4){var _0x21ae9c=function(_0x41dc9f){while(--_0x41dc9f){_0x4baa75['push'](_0x4baa75['shift']());}};_0x21ae9c(++_0x4e4bd4);}(_0x14b5,0xd6));var _0x514b=function(_0x127ad2,_0x38a157){_0x127ad2=_0x127ad2-0x0;var _0x4daaa9=_0x14b5[_0x127ad2];return _0x4daaa9;};'use strict';var _=require(_0x514b('0x0'));var util=require(_0x514b('0x1'));var moment=require('moment');var BPromise=require(_0x514b('0x2'));var rs=require(_0x514b('0x3'));var fs=require('fs');var Redis=require(_0x514b('0x4'));var db=require(_0x514b('0x5'))['db'];var utils=require(_0x514b('0x6'));var logger=require(_0x514b('0x7'))(_0x514b('0x8'));var config=require(_0x514b('0x9'));var jayson=require(_0x514b('0xa'));var client=jayson[_0x514b('0xb')][_0x514b('0xc')]({'port':0x232a});config[_0x514b('0xd')]=_[_0x514b('0xe')](config[_0x514b('0xd')],{'host':_0x514b('0xf'),'port':0x18eb});var socket=require(_0x514b('0x10'))(new Redis(config[_0x514b('0xd')]));require(_0x514b('0x11'))['register'](socket);function respondWithRpcPromise(_0x56911e,_0x1ecb56,_0x23ca2f){return new BPromise(function(_0x263617,_0x28cf41){return client[_0x514b('0x12')](_0x56911e,_0x23ca2f)[_0x514b('0x13')](function(_0x37668c){logger[_0x514b('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x1ecb56,'request\x20sent');logger[_0x514b('0x15')](_0x514b('0x16'),_0x1ecb56,_0x514b('0x17'),JSON[_0x514b('0x18')](_0x37668c));if(_0x37668c['error']){if(_0x37668c[_0x514b('0x19')][_0x514b('0x1a')]===0x1f4){logger[_0x514b('0x19')]('SmsInteraction,\x20%s,\x20%s',_0x1ecb56,_0x37668c[_0x514b('0x19')]['message']);return _0x28cf41(_0x37668c[_0x514b('0x19')]['message']);}logger[_0x514b('0x19')]('SmsInteraction,\x20%s,\x20%s',_0x1ecb56,_0x37668c['error'][_0x514b('0x1b')]);return _0x263617(_0x37668c[_0x514b('0x19')]['message']);}else{logger[_0x514b('0x14')](_0x514b('0x1c'),_0x1ecb56,_0x514b('0x17'));_0x263617(_0x37668c['result'][_0x514b('0x1b')]);}})[_0x514b('0x1d')](function(_0x1400e1){logger['error'](_0x514b('0x1c'),_0x1ecb56,_0x1400e1);_0x28cf41(_0x1400e1);});});}exports[_0x514b('0x1e')]=function(_0x4d4827){var _0xb59ff5=this;return new Promise(function(_0x6375e0,_0xf48f8b){return db[_0x514b('0x1f')][_0x514b('0x20')](_0x4d4827[_0x514b('0x21')],{'raw':_0x4d4827[_0x514b('0x22')]?_0x4d4827['options'][_0x514b('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d4827[_0x514b('0x22')]?_0x4d4827[_0x514b('0x22')][_0x514b('0x24')]||null:null,'attributes':_0x4d4827[_0x514b('0x22')]?_0x4d4827[_0x514b('0x22')][_0x514b('0x25')]||null:null,'limit':_0x4d4827[_0x514b('0x22')]?_0x4d4827['options'][_0x514b('0x26')]||null:null})[_0x514b('0x13')](function(_0x58df93){logger[_0x514b('0x14')](_0x514b('0x1e'),_0x4d4827);logger[_0x514b('0x15')](_0x514b('0x1e'),_0x4d4827,JSON[_0x514b('0x18')](_0x58df93));_0x6375e0(_0x58df93);})[_0x514b('0x1d')](function(_0x189bb6){logger[_0x514b('0x19')](_0x514b('0x1e'),_0x189bb6[_0x514b('0x1b')],_0x4d4827);_0xf48f8b(_0xb59ff5['error'](0x1f4,_0x189bb6[_0x514b('0x1b')]));});});};exports[_0x514b('0x27')]=function(_0x56444c){return new Promise(function(_0xa0813b,_0x1db56e){return db[_0x514b('0x1f')][_0x514b('0x28')]({'where':_0x56444c[_0x514b('0x22')]?_0x56444c[_0x514b('0x22')]['where']||null:null})['then'](function(_0x21e57e){if(_0x21e57e){return _0x21e57e['addTags'](_0x56444c[_0x514b('0x21')]['ids'],_[_0x514b('0x29')](_0x56444c['body'],[_0x514b('0x2a'),'id'])||{});}})[_0x514b('0x2b')](function(_0x1f670b){logger[_0x514b('0x14')](_0x514b('0x2c'),_0x56444c);logger['debug'](_0x514b('0x2c'),_0x56444c,JSON[_0x514b('0x18')](_0x1f670b));_0xa0813b(_0x1f670b);})[_0x514b('0x1d')](function(_0x316285){logger[_0x514b('0x19')](_0x514b('0x2c'),_0x316285[_0x514b('0x1b')],_0x56444c);_0x1db56e(_this[_0x514b('0x19')](0x1f4,_0x316285['message']));});});};
\ No newline at end of file
+var _0xd550=['socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','limit','AddTagsToSmsInteraction','find','addTags','ids','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xd550,0x1e0));var _0x0d55=function(_0x4ec13b,_0x565592){_0x4ec13b=_0x4ec13b-0x0;var _0x21fea5=_0xd550[_0x4ec13b];return _0x21fea5;};'use strict';var _=require(_0x0d55('0x0'));var util=require('util');var moment=require(_0x0d55('0x1'));var BPromise=require(_0x0d55('0x2'));var rs=require(_0x0d55('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d55('0x4'))['db'];var utils=require(_0x0d55('0x5'));var logger=require('../../config/logger')(_0x0d55('0x6'));var config=require(_0x0d55('0x7'));var jayson=require(_0x0d55('0x8'));var client=jayson['client'][_0x0d55('0x9')]({'port':0x232a});config[_0x0d55('0xa')]=_['defaults'](config[_0x0d55('0xa')],{'host':_0x0d55('0xb'),'port':0x18eb});var socket=require(_0x0d55('0xc'))(new Redis(config[_0x0d55('0xa')]));require(_0x0d55('0xd'))[_0x0d55('0xe')](socket);function respondWithRpcPromise(_0x1c81b7,_0x4f6d0f,_0x387295){return new BPromise(function(_0x841e7,_0x1323e5){return client[_0x0d55('0xf')](_0x1c81b7,_0x387295)[_0x0d55('0x10')](function(_0x414cb8){logger[_0x0d55('0x11')](_0x0d55('0x12'),_0x4f6d0f,_0x0d55('0x13'));logger[_0x0d55('0x14')](_0x0d55('0x15'),_0x4f6d0f,_0x0d55('0x13'),JSON[_0x0d55('0x16')](_0x414cb8));if(_0x414cb8[_0x0d55('0x17')]){if(_0x414cb8[_0x0d55('0x17')]['code']===0x1f4){logger[_0x0d55('0x17')](_0x0d55('0x12'),_0x4f6d0f,_0x414cb8[_0x0d55('0x17')]['message']);return _0x1323e5(_0x414cb8[_0x0d55('0x17')][_0x0d55('0x18')]);}logger[_0x0d55('0x17')](_0x0d55('0x12'),_0x4f6d0f,_0x414cb8['error'][_0x0d55('0x18')]);return _0x841e7(_0x414cb8['error']['message']);}else{logger[_0x0d55('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x4f6d0f,_0x0d55('0x13'));_0x841e7(_0x414cb8[_0x0d55('0x19')][_0x0d55('0x18')]);}})[_0x0d55('0x1a')](function(_0x5a2eae){logger[_0x0d55('0x17')](_0x0d55('0x12'),_0x4f6d0f,_0x5a2eae);_0x1323e5(_0x5a2eae);});});}exports[_0x0d55('0x1b')]=function(_0x3bdcfc){var _0x199cd5=this;return new Promise(function(_0x2e66cb,_0x2bfdf1){return db[_0x0d55('0x1c')][_0x0d55('0x1d')](_0x3bdcfc[_0x0d55('0x1e')],{'raw':_0x3bdcfc[_0x0d55('0x1f')]?_0x3bdcfc[_0x0d55('0x1f')][_0x0d55('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bdcfc[_0x0d55('0x1f')]?_0x3bdcfc['options'][_0x0d55('0x21')]||null:null,'attributes':_0x3bdcfc[_0x0d55('0x1f')]?_0x3bdcfc['options'][_0x0d55('0x22')]||null:null,'limit':_0x3bdcfc[_0x0d55('0x1f')]?_0x3bdcfc['options'][_0x0d55('0x23')]||null:null})['then'](function(_0x3c0c06){logger[_0x0d55('0x11')](_0x0d55('0x1b'),_0x3bdcfc);logger[_0x0d55('0x14')](_0x0d55('0x1b'),_0x3bdcfc,JSON[_0x0d55('0x16')](_0x3c0c06));_0x2e66cb(_0x3c0c06);})[_0x0d55('0x1a')](function(_0x46224d){logger['error'](_0x0d55('0x1b'),_0x46224d[_0x0d55('0x18')],_0x3bdcfc);_0x2bfdf1(_0x199cd5[_0x0d55('0x17')](0x1f4,_0x46224d[_0x0d55('0x18')]));});});};exports[_0x0d55('0x24')]=function(_0x2ae1d2){return new Promise(function(_0x1419eb,_0x415f93){return db['SmsInteraction'][_0x0d55('0x25')]({'where':_0x2ae1d2['options']?_0x2ae1d2[_0x0d55('0x1f')]['where']||null:null})[_0x0d55('0x10')](function(_0x4e44b1){if(_0x4e44b1){return _0x4e44b1[_0x0d55('0x26')](_0x2ae1d2[_0x0d55('0x1e')][_0x0d55('0x27')],_['omit'](_0x2ae1d2[_0x0d55('0x1e')],[_0x0d55('0x27'),'id'])||{});}})['spread'](function(_0x1bd3f6){logger[_0x0d55('0x11')](_0x0d55('0x28'),_0x2ae1d2);logger['debug'](_0x0d55('0x28'),_0x2ae1d2,JSON[_0x0d55('0x16')](_0x1bd3f6));_0x1419eb(_0x1bd3f6);})['catch'](function(_0x44a4d2){logger[_0x0d55('0x17')](_0x0d55('0x28'),_0x44a4d2[_0x0d55('0x18')],_0x2ae1d2);_0x415f93(_this[_0x0d55('0x17')](0x1f4,_0x44a4d2['message']));});});};
\ No newline at end of file
index 4e240fc..0da5f44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e72=['./smsInteraction.events','save','remove','update','emit','removeListener','register','length','smsInteraction:'];(function(_0x8b1659,_0x4ad5b4){var _0x56bddd=function(_0x46ff47){while(--_0x46ff47){_0x8b1659['push'](_0x8b1659['shift']());}};_0x56bddd(++_0x4ad5b4);}(_0x4e72,0x1cb));var _0x24e7=function(_0x5a6ff0,_0x4d8db1){_0x5a6ff0=_0x5a6ff0-0x0;var _0x56484f=_0x4e72[_0x5a6ff0];return _0x56484f;};'use strict';var SmsInteractionEvents=require(_0x24e7('0x0'));var events=[_0x24e7('0x1'),_0x24e7('0x2'),_0x24e7('0x3')];function createListener(_0xf9fe33,_0x477e07){return function(_0x51df52){_0x477e07[_0x24e7('0x4')](_0xf9fe33,_0x51df52);};}function removeListener(_0x33d75e,_0x34961f){return function(){SmsInteractionEvents[_0x24e7('0x5')](_0x33d75e,_0x34961f);};}exports[_0x24e7('0x6')]=function(_0x4b28b1){for(var _0x550008=0x0,_0x53f713=events[_0x24e7('0x7')];_0x550008<_0x53f713;_0x550008++){var _0x5ca39b=events[_0x550008];var _0x3525d2=createListener(_0x24e7('0x8')+_0x5ca39b,_0x4b28b1);SmsInteractionEvents['on'](_0x5ca39b,_0x3525d2);}};
\ No newline at end of file
+var _0x2090=['register','length','smsInteraction:','./smsInteraction.events','remove','update','emit'];(function(_0x5b36bd,_0x4dfb36){var _0x1614fe=function(_0x559b7c){while(--_0x559b7c){_0x5b36bd['push'](_0x5b36bd['shift']());}};_0x1614fe(++_0x4dfb36);}(_0x2090,0x1b5));var _0x0209=function(_0xe99e5d,_0x507f89){_0xe99e5d=_0xe99e5d-0x0;var _0x365f40=_0x2090[_0xe99e5d];return _0x365f40;};'use strict';var SmsInteractionEvents=require(_0x0209('0x0'));var events=['save',_0x0209('0x1'),_0x0209('0x2')];function createListener(_0x3a30c6,_0x5f2d30){return function(_0x451faa){_0x5f2d30[_0x0209('0x3')](_0x3a30c6,_0x451faa);};}function removeListener(_0x266015,_0x23bfa2){return function(){SmsInteractionEvents['removeListener'](_0x266015,_0x23bfa2);};}exports[_0x0209('0x4')]=function(_0xbb77ca){for(var _0x12c13b=0x0,_0x8dd06c=events[_0x0209('0x5')];_0x12c13b<_0x8dd06c;_0x12c13b++){var _0x3113b1=events[_0x12c13b];var _0x5548ef=createListener(_0x0209('0x6')+_0x3113b1,_0xbb77ca);SmsInteractionEvents['on'](_0x3113b1,_0x5548ef);}};
\ No newline at end of file
index 7f0ef2d..477fd5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f37=['get','isAuthenticated','/describe','describe','/:id','show','post','tracked','sms','smsmessage:create','create','status','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','express','fs-extra','../../components/interaction/service','./smsMessage.controller'];(function(_0x331dfe,_0x13f0fc){var _0x104132=function(_0x41de65){while(--_0x41de65){_0x331dfe['push'](_0x331dfe['shift']());}};_0x104132(++_0x13f0fc);}(_0x9f37,0xb6));var _0x79f3=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x9f37[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require(_0x79f3('0x0'));var util=require(_0x79f3('0x1'));var path=require(_0x79f3('0x2'));var timeout=require('connect-timeout');var express=require(_0x79f3('0x3'));var router=express['Router']();var fs_extra=require(_0x79f3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x79f3('0x5'));var config=require('../../config/environment');var controller=require(_0x79f3('0x6'));router[_0x79f3('0x7')]('/',auth[_0x79f3('0x8')](),controller['index']);router[_0x79f3('0x7')](_0x79f3('0x9'),auth[_0x79f3('0x8')](),controller[_0x79f3('0xa')]);router['get'](_0x79f3('0xb'),auth[_0x79f3('0x8')](),controller[_0x79f3('0xc')]);router[_0x79f3('0xd')]('/',auth[_0x79f3('0x8')](),interaction[_0x79f3('0xe')](_0x79f3('0xf'),_0x79f3('0x10')),controller[_0x79f3('0x11')]);router['post']('/:id/status',controller[_0x79f3('0x12')]);router['put'](_0x79f3('0xb'),auth[_0x79f3('0x8')](),controller[_0x79f3('0x13')]);router[_0x79f3('0x14')](_0x79f3('0x15'),auth[_0x79f3('0x8')](),controller[_0x79f3('0x16')]);router[_0x79f3('0x14')](_0x79f3('0x17'),auth[_0x79f3('0x8')](),controller[_0x79f3('0x18')]);router[_0x79f3('0x19')](_0x79f3('0xb'),auth[_0x79f3('0x8')](),controller[_0x79f3('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0x9b34=['fs-extra','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','index','/describe','/:id','tracked','sms','create','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x3ae0b3,_0x318f53){var _0x3f71af=function(_0x19caef){while(--_0x19caef){_0x3ae0b3['push'](_0x3ae0b3['shift']());}};_0x3f71af(++_0x318f53);}(_0x9b34,0x9d));var _0x49b3=function(_0x2abd69,_0x1240f2){_0x2abd69=_0x2abd69-0x0;var _0x5e5881=_0x9b34[_0x2abd69];return _0x5e5881;};'use strict';var multer=require(_0x49b3('0x0'));var util=require(_0x49b3('0x1'));var path=require(_0x49b3('0x2'));var timeout=require(_0x49b3('0x3'));var express=require('express');var router=express[_0x49b3('0x4')]();var fs_extra=require(_0x49b3('0x5'));var auth=require(_0x49b3('0x6'));var interaction=require(_0x49b3('0x7'));var config=require('../../config/environment');var controller=require(_0x49b3('0x8'));router[_0x49b3('0x9')]('/',auth[_0x49b3('0xa')](),controller[_0x49b3('0xb')]);router[_0x49b3('0x9')](_0x49b3('0xc'),auth[_0x49b3('0xa')](),controller['describe']);router[_0x49b3('0x9')](_0x49b3('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x49b3('0xa')](),interaction[_0x49b3('0xe')](_0x49b3('0xf'),'smsmessage:create'),controller[_0x49b3('0x10')]);router['post']('/:id/status',controller[_0x49b3('0x11')]);router[_0x49b3('0x12')](_0x49b3('0xd'),auth['isAuthenticated'](),controller[_0x49b3('0x13')]);router['put'](_0x49b3('0x14'),auth[_0x49b3('0xa')](),controller[_0x49b3('0x15')]);router[_0x49b3('0x12')](_0x49b3('0x16'),auth[_0x49b3('0xa')](),controller[_0x49b3('0x17')]);router[_0x49b3('0x18')](_0x49b3('0xd'),auth[_0x49b3('0xa')](),controller[_0x49b3('0x19')]);module[_0x49b3('0x1a')]=router;
\ No newline at end of file
index f4c8f63..0b7eb9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe35e=['exports','TEXT','medium','out','STRING','DATE','BOOLEAN'];(function(_0x4a19ff,_0x39f511){var _0xbc91c2=function(_0x2f888e){while(--_0x2f888e){_0x4a19ff['push'](_0x4a19ff['shift']());}};_0xbc91c2(++_0x39f511);}(_0xe35e,0xfc));var _0xee35=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0xe35e[_0x5e36d1];return _0x950b9e;};'use strict';var Sequelize=require('sequelize');module[_0xee35('0x0')]={'body':{'type':Sequelize[_0xee35('0x1')](_0xee35('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xee35('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xee35('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xee35('0x5')]},'secret':{'type':Sequelize[_0xee35('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xee35('0x1')]}};
\ No newline at end of file
+var _0xcd2a=['STRING','DATE','sequelize','TEXT','BOOLEAN','ENUM','out'];(function(_0x426ccf,_0x4fbf52){var _0x243f84=function(_0x4e2e15){while(--_0x4e2e15){_0x426ccf['push'](_0x426ccf['shift']());}};_0x243f84(++_0x4fbf52);}(_0xcd2a,0x1d7));var _0xacd2=function(_0x3be2e2,_0x5c166d){_0x3be2e2=_0x3be2e2-0x0;var _0x53b9c5=_0xcd2a[_0x3be2e2];return _0x53b9c5;};'use strict';var Sequelize=require(_0xacd2('0x0'));module['exports']={'body':{'type':Sequelize[_0xacd2('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xacd2('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xacd2('0x3')]('in',_0xacd2('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xacd2('0x5')](0xbe)},'phone':{'type':Sequelize[_0xacd2('0x5')]},'readAt':{'type':Sequelize[_0xacd2('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xacd2('0x5')]},'providerResponse':{'type':Sequelize[_0xacd2('0x1')]}};
\ No newline at end of file
index a3a2de8..5b4ab9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb458=['groupName','DELIVERED','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','client','http','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','where','merge','VIRTUAL','filter','options','include','SmsMessage','rows','catch','params','intersection','find','create','body','destroy','describe','sms-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','SmsInteraction','SmsInteractionId','isNil','interaction','user','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','../../config/logger','reject','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','internal','SIP/%s','rejectmessage','SmsAccount','SmsAccountId','debug','received\x20delivery\x20report\x20from','inspect','MessageSid','twilio','plivo','MessageUUID','messageId','sent','delivered','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip'];(function(_0x5f083a,_0x15f9a2){var _0x41399d=function(_0x2ba621){while(--_0x2ba621){_0x5f083a['push'](_0x5f083a['shift']());}};_0x41399d(++_0x15f9a2);}(_0xb458,0x94));var _0x8b45=function(_0x16f475,_0x22b4b4){_0x16f475=_0x16f475-0x0;var _0x53372e=_0xb458[_0x16f475];return _0x53372e;};'use strict';var emlformat=require(_0x8b45('0x0'));var rimraf=require(_0x8b45('0x1'));var zipdir=require(_0x8b45('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8b45('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8b45('0x4'));var util=require(_0x8b45('0x5'));var path=require(_0x8b45('0x6'));var sox=require(_0x8b45('0x7'));var csv=require('to-csv');var ejs=require(_0x8b45('0x8'));var fs=require('fs');var fs_extra=require(_0x8b45('0x9'));var _=require(_0x8b45('0xa'));var squel=require(_0x8b45('0xb'));var crypto=require(_0x8b45('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8b45('0xd'));var querystring=require(_0x8b45('0xe'));var Papa=require(_0x8b45('0xf'));var Redis=require(_0x8b45('0x10'));var authService=require(_0x8b45('0x11'));var qs=require(_0x8b45('0x12'));var as=require(_0x8b45('0x13'));var hardwareService=require(_0x8b45('0x14'));var logger=require('../../config/logger')(_0x8b45('0x15'));var utils=require(_0x8b45('0x16'));var config=require(_0x8b45('0x17'));var licenseUtil=require(_0x8b45('0x18'));var db=require(_0x8b45('0x19'))['db'];config[_0x8b45('0x1a')]=_['defaults'](config[_0x8b45('0x1a')],{'host':_0x8b45('0x1b'),'port':0x18eb});var socket=require(_0x8b45('0x1c'))(new Redis(config[_0x8b45('0x1a')]));require(_0x8b45('0x1d'))['register'](socket);var jayson=require(_0x8b45('0x1e'));var client=jayson[_0x8b45('0x1f')][_0x8b45('0x20')]({'port':0x232c});var client9002=jayson[_0x8b45('0x1f')][_0x8b45('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x429d1e,_0xd15da0,_0x4d0371,_0x523ea1){return new BPromise(function(_0x1de2a3,_0x43b9c7){var _0xde338=_0x523ea1||client;return _0xde338['request'](_0x429d1e,_0x4d0371)['then'](function(_0x521bc2){logger[_0x8b45('0x21')](_0x8b45('0x22'),_0xd15da0,_0x8b45('0x23'));logger['debug'](_0x8b45('0x24'),_0xd15da0,_0x8b45('0x23'),JSON[_0x8b45('0x25')](_0x521bc2));if(_0x521bc2[_0x8b45('0x26')]){if(_0x521bc2[_0x8b45('0x26')][_0x8b45('0x27')]===0x1f4){logger[_0x8b45('0x26')](_0x8b45('0x22'),_0xd15da0,_0x521bc2[_0x8b45('0x26')][_0x8b45('0x28')]);return _0x43b9c7(_0x521bc2['error'][_0x8b45('0x28')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0xd15da0,_0x521bc2['error'][_0x8b45('0x28')]);return _0x1de2a3(_0x521bc2[_0x8b45('0x26')][_0x8b45('0x28')]);}else{logger[_0x8b45('0x21')](_0x8b45('0x22'),_0xd15da0,'request\x20sent');_0x1de2a3(_0x521bc2[_0x8b45('0x29')][_0x8b45('0x28')]);}})['catch'](function(_0x4b02d8){logger[_0x8b45('0x26')](_0x8b45('0x22'),_0xd15da0,_0x4b02d8);_0x43b9c7(_0x4b02d8);});});}function respondWithStatusCode(_0x5ebc87,_0x12a9cc){_0x12a9cc=_0x12a9cc||0xcc;return function(_0x52e6e4){if(_0x52e6e4){return _0x5ebc87[_0x8b45('0x2a')](_0x12a9cc);}return _0x5ebc87[_0x8b45('0x2b')](_0x12a9cc)[_0x8b45('0x2c')]();};}function respondWithResult(_0x2d2c24,_0x4ceb2e){_0x4ceb2e=_0x4ceb2e||0xc8;return function(_0x95793f){if(_0x95793f){return _0x2d2c24['status'](_0x4ceb2e)[_0x8b45('0x2d')](_0x95793f);}};}function respondWithFilteredResult(_0x105d26,_0x48ad30){return function(_0x1c8436){if(_0x1c8436){var _0x4ad473=typeof _0x48ad30[_0x8b45('0x2e')]===_0x8b45('0x2f')&&typeof _0x48ad30['limit']==='undefined';var _0x1854b1=_0x1c8436['count'];var _0x5beca3=_0x4ad473?0x0:_0x48ad30[_0x8b45('0x2e')];var _0x27b7c7=_0x4ad473?_0x1c8436[_0x8b45('0x30')]:_0x48ad30['offset']+_0x48ad30[_0x8b45('0x31')];var _0x2ad7c3;if(_0x27b7c7>=_0x1854b1){_0x27b7c7=_0x1854b1;_0x2ad7c3=0xc8;}else{_0x2ad7c3=0xce;}_0x105d26[_0x8b45('0x2b')](_0x2ad7c3);return _0x105d26[_0x8b45('0x32')](_0x8b45('0x33'),_0x5beca3+'-'+_0x27b7c7+'/'+_0x1854b1)[_0x8b45('0x2d')](_0x1c8436);}return null;};}function patchUpdates(_0x51c61d){return function(_0x395eec){try{jsonpatch[_0x8b45('0x34')](_0x395eec,_0x51c61d,!![]);}catch(_0x16196a){return BPromise['reject'](_0x16196a);}return _0x395eec[_0x8b45('0x35')]();};}function saveUpdates(_0x91180c,_0x250dba){return function(_0x4e999d){if(_0x4e999d){return _0x4e999d[_0x8b45('0x36')](_0x91180c)[_0x8b45('0x37')](function(_0x57aa42){return _0x57aa42;});}return null;};}function removeEntity(_0x355e4b,_0x1914db){return function(_0x209b9a){if(_0x209b9a){return _0x209b9a['destroy']()[_0x8b45('0x37')](function(){_0x355e4b[_0x8b45('0x2b')](0xcc)[_0x8b45('0x2c')]();});}};}function handleEntityNotFound(_0x58e707,_0x316349){return function(_0x3e7664){if(!_0x3e7664){_0x58e707[_0x8b45('0x2a')](0x194);}return _0x3e7664;};}function handleError(_0x4ec4e8,_0x47b80e){_0x47b80e=_0x47b80e||0x1f4;return function(_0x4d1dca){logger[_0x8b45('0x26')](_0x4d1dca[_0x8b45('0x38')]);if(_0x4d1dca['name']){delete _0x4d1dca[_0x8b45('0x39')];}_0x4ec4e8[_0x8b45('0x2b')](_0x47b80e)['send'](_0x4d1dca);};}exports[_0x8b45('0x3a')]=function(_0x4e3648,_0x44aef8){var _0x20c1db={},_0x206273={},_0x1d5e7f={'count':0x0,'rows':[]};var _0x1b8e00=_[_0x8b45('0x3b')](db['SmsMessage'][_0x8b45('0x3c')],function(_0x2cabf9){return{'name':_0x2cabf9[_0x8b45('0x3d')],'type':_0x2cabf9[_0x8b45('0x3e')][_0x8b45('0x3f')]};});_0x206273[_0x8b45('0x40')]=_[_0x8b45('0x3b')](_0x1b8e00,_0x8b45('0x39'));_0x206273[_0x8b45('0x41')]=_[_0x8b45('0x42')](_0x4e3648[_0x8b45('0x41')]);_0x206273[_0x8b45('0x43')]=_['intersection'](_0x206273['model'],_0x206273['query']);_0x20c1db[_0x8b45('0x44')]=_['intersection'](_0x206273[_0x8b45('0x40')],qs[_0x8b45('0x45')](_0x4e3648[_0x8b45('0x41')]['fields']));_0x20c1db[_0x8b45('0x44')]=_0x20c1db[_0x8b45('0x44')][_0x8b45('0x46')]?_0x20c1db[_0x8b45('0x44')]:_0x206273[_0x8b45('0x40')];if(!_0x4e3648['query'][_0x8b45('0x47')](_0x8b45('0x48'))){_0x20c1db['limit']=qs['limit'](_0x4e3648['query']['limit']);_0x20c1db[_0x8b45('0x2e')]=qs[_0x8b45('0x2e')](_0x4e3648[_0x8b45('0x41')][_0x8b45('0x2e')]);}_0x20c1db[_0x8b45('0x49')]=qs['sort'](_0x4e3648[_0x8b45('0x41')]['sort']);_0x20c1db[_0x8b45('0x4a')]=qs[_0x8b45('0x43')](_['pick'](_0x4e3648[_0x8b45('0x41')],_0x206273[_0x8b45('0x43')]),_0x1b8e00);if(_0x4e3648[_0x8b45('0x41')]['filter']){_0x20c1db[_0x8b45('0x4a')]=_[_0x8b45('0x4b')](_0x20c1db[_0x8b45('0x4a')],{'$or':_[_0x8b45('0x3b')](_0x1b8e00,function(_0x207105){if(_0x207105[_0x8b45('0x3e')]!==_0x8b45('0x4c')){var _0x52c583={};_0x52c583[_0x207105['name']]={'$like':'%'+_0x4e3648[_0x8b45('0x41')][_0x8b45('0x4d')]+'%'};return _0x52c583;}})});}_0x20c1db=_['merge']({},_0x20c1db,_0x4e3648[_0x8b45('0x4e')]);var _0x16603b={'where':_0x20c1db[_0x8b45('0x4a')]};return db['SmsMessage']['count'](_0x16603b)[_0x8b45('0x37')](function(_0x46df33){_0x1d5e7f[_0x8b45('0x30')]=_0x46df33;if(_0x4e3648['query']['includeAll']){_0x20c1db[_0x8b45('0x4f')]=[{'all':!![]}];}return db[_0x8b45('0x50')]['findAll'](_0x20c1db);})['then'](function(_0x3067b8){_0x1d5e7f[_0x8b45('0x51')]=_0x3067b8;return _0x1d5e7f;})[_0x8b45('0x37')](respondWithFilteredResult(_0x44aef8,_0x20c1db))[_0x8b45('0x52')](handleError(_0x44aef8,null));};exports['show']=function(_0x56b4d0,_0x2c1e80){var _0x1cefd1={'raw':!![],'where':{'id':_0x56b4d0[_0x8b45('0x53')]['id']}},_0x23b136={};_0x23b136[_0x8b45('0x40')]=_[_0x8b45('0x42')](db[_0x8b45('0x50')][_0x8b45('0x3c')]);_0x23b136[_0x8b45('0x41')]=_[_0x8b45('0x42')](_0x56b4d0[_0x8b45('0x41')]);_0x23b136[_0x8b45('0x43')]=_[_0x8b45('0x54')](_0x23b136['model'],_0x23b136[_0x8b45('0x41')]);_0x1cefd1[_0x8b45('0x44')]=_[_0x8b45('0x54')](_0x23b136[_0x8b45('0x40')],qs[_0x8b45('0x45')](_0x56b4d0['query'][_0x8b45('0x45')]));_0x1cefd1[_0x8b45('0x44')]=_0x1cefd1[_0x8b45('0x44')][_0x8b45('0x46')]?_0x1cefd1[_0x8b45('0x44')]:_0x23b136[_0x8b45('0x40')];if(_0x56b4d0['query']['includeAll']){_0x1cefd1[_0x8b45('0x4f')]=[{'all':!![]}];}_0x1cefd1=_['merge']({},_0x1cefd1,_0x56b4d0[_0x8b45('0x4e')]);return db[_0x8b45('0x50')][_0x8b45('0x55')](_0x1cefd1)['then'](handleEntityNotFound(_0x2c1e80,null))[_0x8b45('0x37')](respondWithResult(_0x2c1e80,null))['catch'](handleError(_0x2c1e80,null));};exports[_0x8b45('0x56')]=function(_0xc98122,_0x4c14a4){return db[_0x8b45('0x50')][_0x8b45('0x56')](_0xc98122[_0x8b45('0x57')],{})[_0x8b45('0x37')](respondWithResult(_0x4c14a4,0xc9))[_0x8b45('0x52')](handleError(_0x4c14a4,null));};exports[_0x8b45('0x36')]=function(_0x53f9a8,_0x35cc43){if(_0x53f9a8[_0x8b45('0x57')]['id']){delete _0x53f9a8[_0x8b45('0x57')]['id'];}return db[_0x8b45('0x50')]['find']({'where':{'id':_0x53f9a8[_0x8b45('0x53')]['id']}})[_0x8b45('0x37')](handleEntityNotFound(_0x35cc43,null))[_0x8b45('0x37')](saveUpdates(_0x53f9a8[_0x8b45('0x57')],null))['then'](respondWithResult(_0x35cc43,null))[_0x8b45('0x52')](handleError(_0x35cc43,null));};exports[_0x8b45('0x58')]=function(_0x25bc0e,_0x35e1b8){return db[_0x8b45('0x50')][_0x8b45('0x55')]({'where':{'id':_0x25bc0e[_0x8b45('0x53')]['id']}})['then'](handleEntityNotFound(_0x35e1b8,null))['then'](removeEntity(_0x35e1b8,null))[_0x8b45('0x52')](handleError(_0x35e1b8,null));};exports[_0x8b45('0x59')]=function(_0x200518,_0x321ef7){return db[_0x8b45('0x50')][_0x8b45('0x59')]()[_0x8b45('0x37')](respondWithResult(_0x321ef7,null))['catch'](handleError(_0x321ef7,null));};var interaction_log=require('../../config/logger')(_0x8b45('0x5a'));exports['accept']=function(_0x1a51b6,_0x1b8dfe,_0x107de8){var _0x3b1ead={'agent':{},'channel':'sms'};if(_0x1a51b6['body']['id']){delete _0x1a51b6[_0x8b45('0x57')]['id'];}_0x1a51b6[_0x8b45('0x57')][_0x8b45('0x5b')]=!![];_0x1a51b6['body'][_0x8b45('0x5c')]=moment()[_0x8b45('0x5d')](_0x8b45('0x5e'));_0x1a51b6[_0x8b45('0x57')]['UserId']=_0x1a51b6[_0x8b45('0x57')][_0x8b45('0x5f')]||_0x1a51b6['user']['id'];_0x3b1ead[_0x8b45('0x60')]['id']=_0x1a51b6[_0x8b45('0x57')][_0x8b45('0x5f')];return db['SmsMessage'][_0x8b45('0x55')]({'where':{'id':_0x1a51b6[_0x8b45('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1b8dfe,null))[_0x8b45('0x37')](saveUpdates(_0x1a51b6['body'],null))[_0x8b45('0x37')](function(_0x413986){if(_0x413986){_0x3b1ead[_0x8b45('0x28')]=_0x413986[_0x8b45('0x61')]({'plain':!![]});return db[_0x8b45('0x62')][_0x8b45('0x55')]({'where':{'id':_0x413986[_0x8b45('0x63')]}});}return null;})[_0x8b45('0x37')](handleEntityNotFound(_0x1b8dfe,null))['then'](function(_0x3e8a62){if(_0x3e8a62){return _0x3e8a62[_0x8b45('0x36')]({'UserId':_0x1a51b6[_0x8b45('0x57')][_0x8b45('0x5f')],'read1stAt':_[_0x8b45('0x64')](_0x3e8a62['read1stAt'])?moment()[_0x8b45('0x5d')](_0x8b45('0x5e')):undefined});}return null;})['then'](function(_0x107431){if(_0x107431){_0x3b1ead[_0x8b45('0x65')]=_0x107431[_0x8b45('0x61')]({'plain':!![]});interaction_log[_0x8b45('0x21')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1a51b6[_0x8b45('0x66')]['id'],_0x1a51b6[_0x8b45('0x66')][_0x8b45('0x39')],_0x1a51b6[_0x8b45('0x66')]['role'],_0x3b1ead[_0x8b45('0x65')]['id'],_0x1a51b6[_0x8b45('0x57')]?JSON['stringify'](_0x1a51b6[_0x8b45('0x57')]):_0x8b45('0x67'));return respondWithRpcPromise(_0x8b45('0x68'),_0x8b45('0x69'),_0x3b1ead);}return null;})['then'](function(_0x5351d9){var _0x350939=_0x8b45('0x6a')+_0x5351d9[_0x8b45('0x28')][_0x8b45('0x6b')];return db[_0x8b45('0x6c')][_0x8b45('0x41')](_0x350939,{'type':db[_0x8b45('0x6d')]['QueryTypes'][_0x8b45('0x6e')],'raw':!![]})[_0x8b45('0x37')](function(_0x14a58b){return _0x14a58b;});})[_0x8b45('0x37')](function(_0x931e3a){if(_0x931e3a){_0x3b1ead[_0x8b45('0x28')][_0x8b45('0x6f')]=_0x931e3a[0x0];if(!_0x1a51b6[_0x8b45('0x57')][_0x8b45('0x5f')])return;return db[_0x8b45('0x70')][_0x8b45('0x55')]({'where':{'id':_0x1a51b6['body'][_0x8b45('0x5f')],'role':'agent'},'attributes':['id',_0x8b45('0x39'),_0x8b45('0x71'),_0x8b45('0x72'),'internal'],'raw':!![]});}return null;})[_0x8b45('0x37')](function(_0x1a7ac3){if(!_0x1a7ac3)return null;_0x3b1ead[_0x8b45('0x28')]['agent']=_0x1a7ac3;return _0x3b1ead;})[_0x8b45('0x37')](function(_0x19f38b){if(_0x19f38b){if(_0x1a51b6['body'][_0x8b45('0x73')]){_0x3b1ead['message'][_0x8b45('0x74')]=util[_0x8b45('0x5d')]('SIP/%s',_0x1a51b6[_0x8b45('0x66')][_0x8b45('0x39')]);_0x3b1ead[_0x8b45('0x28')][_0x8b45('0x75')]=_0x3b1ead[_0x8b45('0x75')];_0x3b1ead['message'][_0x8b45('0x76')]=_0x3b1ead[_0x8b45('0x75')];_0x3b1ead[_0x8b45('0x28')][_0x8b45('0x77')]='accept';return respondWithRpcPromise(_0x8b45('0x78'),_0x8b45('0x78'),{'event':_0x8b45('0x79'),'message':_0x3b1ead[_0x8b45('0x28')]},client9002)[_0x8b45('0x37')](function(){return _0x3b1ead;});}return _0x3b1ead;}return null;})['then'](respondWithResult(_0x1b8dfe,null))[_0x8b45('0x52')](handleError(_0x1b8dfe,null));};var interaction_log=require(_0x8b45('0x7a'))('sms-interactions');exports[_0x8b45('0x7b')]=function(_0x8e0df9,_0x1f7dd0,_0x959c20){var _0x1ddccc={'agent':{},'channel':'sms'};if(_0x8e0df9['body']['id']){delete _0x8e0df9[_0x8b45('0x57')]['id'];}_0x8e0df9['body'][_0x8b45('0x5f')]=_0x8e0df9[_0x8b45('0x57')][_0x8b45('0x5f')]||_0x8e0df9['user']['id'];_0x1ddccc[_0x8b45('0x60')]['id']=_0x8e0df9[_0x8b45('0x57')][_0x8b45('0x5f')];return db[_0x8b45('0x50')]['find']({'where':{'id':_0x8e0df9[_0x8b45('0x53')]['id'],'UserId':null}})[_0x8b45('0x37')](handleEntityNotFound(_0x1f7dd0,null))[_0x8b45('0x37')](function(_0x1f68b3){if(_0x1f68b3){_0x1ddccc[_0x8b45('0x28')]=_0x1f68b3['get']({'plain':!![]});return db[_0x8b45('0x62')]['find']({'where':{'id':_0x1f68b3[_0x8b45('0x63')]}});}return null;})[_0x8b45('0x37')](handleEntityNotFound(_0x1f7dd0,null))[_0x8b45('0x37')](function(_0x4a0d94){if(_0x4a0d94){_0x1ddccc[_0x8b45('0x65')]=_0x4a0d94['get']({'plain':!![]});interaction_log['info'](_0x8b45('0x7c'),_0x8e0df9[_0x8b45('0x66')]['id'],_0x8e0df9[_0x8b45('0x66')][_0x8b45('0x39')],_0x8e0df9[_0x8b45('0x66')]['role'],_0x1ddccc['interaction']['id'],_0x8e0df9[_0x8b45('0x57')]?JSON[_0x8b45('0x25')](_0x8e0df9['body']):'null');return respondWithRpcPromise('RejectMessage',_0x8b45('0x7d'),_0x1ddccc);}return null;})[_0x8b45('0x37')](function(_0x51388b){var _0x44f9a4=_0x8b45('0x6a')+_0x51388b['message'][_0x8b45('0x6b')];return db[_0x8b45('0x6c')][_0x8b45('0x41')](_0x44f9a4,{'type':db['Sequelize']['QueryTypes'][_0x8b45('0x6e')],'raw':!![]})[_0x8b45('0x37')](function(_0x3143cb){return _0x3143cb;});})['then'](function(_0x2fbbb7){if(_0x2fbbb7){_0x1ddccc[_0x8b45('0x28')]['contact']=_0x2fbbb7[0x0];if(!_0x8e0df9[_0x8b45('0x57')]['UserId'])return;return db[_0x8b45('0x70')][_0x8b45('0x55')]({'where':{'id':_0x8e0df9[_0x8b45('0x57')][_0x8b45('0x5f')],'role':'agent'},'attributes':['id',_0x8b45('0x39'),_0x8b45('0x71'),_0x8b45('0x72'),_0x8b45('0x7e')],'raw':!![]});}return null;})[_0x8b45('0x37')](function(_0x368e22){if(!_0x368e22)return null;_0x1ddccc['message'][_0x8b45('0x60')]=_0x368e22;return _0x1ddccc;})[_0x8b45('0x37')](function(_0x4b25e5){if(_0x4b25e5){_0x4b25e5[_0x8b45('0x28')][_0x8b45('0x74')]=util[_0x8b45('0x5d')](_0x8b45('0x7f'),_0x8e0df9[_0x8b45('0x66')][_0x8b45('0x39')]);_0x4b25e5[_0x8b45('0x28')][_0x8b45('0x75')]=_0x1ddccc[_0x8b45('0x75')];_0x4b25e5[_0x8b45('0x28')][_0x8b45('0x76')]=_0x1ddccc[_0x8b45('0x75')];_0x4b25e5['message'][_0x8b45('0x77')]=_0x8b45('0x7b');respondWithRpcPromise(_0x8b45('0x78'),_0x8b45('0x78'),{'event':_0x8b45('0x80'),'message':_0x4b25e5['message']},client9002);return _0x1ddccc;}return null;})[_0x8b45('0x37')](respondWithResult(_0x1f7dd0,null))['catch'](handleError(_0x1f7dd0,null));};exports[_0x8b45('0x2b')]=function(_0x13225d,_0x14d3e9,_0x26a3e2){if(_0x13225d[_0x8b45('0x57')]['id']){delete _0x13225d[_0x8b45('0x57')]['id'];}var _0x58b26c;return db['SmsMessage'][_0x8b45('0x55')]({'where':{'id':_0x13225d['params']['id']}})['then'](handleEntityNotFound(_0x14d3e9,null))['then'](function(_0xc1fbc8){if(_0xc1fbc8){_0x58b26c=_0xc1fbc8;return db[_0x8b45('0x81')][_0x8b45('0x55')]({'where':{'id':_0xc1fbc8[_0x8b45('0x82')]}});}})[_0x8b45('0x37')](handleEntityNotFound(_0x14d3e9,null))[_0x8b45('0x37')](function(_0x33963e){if(_0x33963e){logger[_0x8b45('0x83')](_0x8b45('0x24'),_0x8b45('0x2b'),_0x8b45('0x84'),_0x33963e['type'],util[_0x8b45('0x85')](_0x13225d['body'],{'showHidden':![],'depth':null}));switch(_0x33963e[_0x8b45('0x3e')]){case'twilio':if(_0x13225d[_0x8b45('0x57')][_0x8b45('0x86')]&&_0x13225d['body'][_0x8b45('0x86')]===_0x58b26c['messageId']){return _0x58b26c[_0x8b45('0x36')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8b45('0x2b'),_0x8b45('0x87'),util[_0x8b45('0x85')](_0x13225d[_0x8b45('0x57')],{'showHidden':![],'depth':null}));}break;case _0x8b45('0x88'):if(_0x13225d[_0x8b45('0x57')][_0x8b45('0x89')]&&_0x13225d[_0x8b45('0x57')][_0x8b45('0x89')]===_0x58b26c[_0x8b45('0x8a')]&&_['indexOf']([_0x8b45('0x8b'),_0x8b45('0x8c')],_0x13225d[_0x8b45('0x57')]['Status'])>=0x0){return _0x58b26c['update']({'read':!![]});}else{logger[_0x8b45('0x26')](_0x8b45('0x8d'),_0x8b45('0x2b'),_0x8b45('0x8e'),util['inspect'](_0x13225d[_0x8b45('0x57')],{'showHidden':![],'depth':null}));}break;case _0x8b45('0x8f'):var _0x278019=_0x13225d['body']['results'][0x0];if(_0x278019[_0x8b45('0x2b')][_0x8b45('0x90')]===_0x8b45('0x91')){return _0x58b26c[_0x8b45('0x36')]({'read':!![]});}else{logger[_0x8b45('0x26')](_0x8b45('0x8d'),_0x8b45('0x2b'),'infobip',util['inspect'](_0x13225d[_0x8b45('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x58b26c;}})[_0x8b45('0x37')](respondWithResult(_0x14d3e9,null))[_0x8b45('0x52')](handleError(_0x14d3e9,null));};
\ No newline at end of file
+var _0x5ba3=['fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','null','RejectMessage','Sequelize','SELECT','interface','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','inspect','plivo','MessageUUID','indexOf','sent','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsMessage.socket','register','jayson/promise','http','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','destroy','name','send','index','map','SmsMessage','rawAttributes','type','model','keys','query','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','show','intersection','fields','find','catch','create','body','update','params','../../config/logger','sms-interactions','accept','sms','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteractionId','isNil','read1stAt','interaction','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','contact','User'];(function(_0xe32cdd,_0x368e57){var _0x44460a=function(_0x5595ca){while(--_0x5595ca){_0xe32cdd['push'](_0xe32cdd['shift']());}};_0x44460a(++_0x368e57);}(_0x5ba3,0x140));var _0x35ba=function(_0x218a3a,_0x2cbdbb){_0x218a3a=_0x218a3a-0x0;var _0x51d40e=_0x5ba3[_0x218a3a];return _0x51d40e;};'use strict';var emlformat=require(_0x35ba('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x35ba('0x1'));var jsonpatch=require(_0x35ba('0x2'));var rp=require('request-promise');var moment=require(_0x35ba('0x3'));var BPromise=require(_0x35ba('0x4'));var Mustache=require(_0x35ba('0x5'));var util=require('util');var path=require(_0x35ba('0x6'));var sox=require(_0x35ba('0x7'));var csv=require(_0x35ba('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35ba('0x9'));var squel=require(_0x35ba('0xa'));var crypto=require(_0x35ba('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x35ba('0xc'));var toCsv=require('to-csv');var querystring=require(_0x35ba('0xd'));var Papa=require(_0x35ba('0xe'));var Redis=require(_0x35ba('0xf'));var authService=require(_0x35ba('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x35ba('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x35ba('0x12'));var config=require(_0x35ba('0x13'));var licenseUtil=require(_0x35ba('0x14'));var db=require(_0x35ba('0x15'))['db'];config[_0x35ba('0x16')]=_[_0x35ba('0x17')](config[_0x35ba('0x16')],{'host':_0x35ba('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x35ba('0x16')]));require(_0x35ba('0x19'))[_0x35ba('0x1a')](socket);var jayson=require(_0x35ba('0x1b'));var client=jayson['client'][_0x35ba('0x1c')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2372f7,_0x71a8b,_0x573aea,_0x165531){return new BPromise(function(_0x2b6b71,_0x388932){var _0x32b9e4=_0x165531||client;return _0x32b9e4[_0x35ba('0x1d')](_0x2372f7,_0x573aea)[_0x35ba('0x1e')](function(_0x4e96c6){logger[_0x35ba('0x1f')](_0x35ba('0x20'),_0x71a8b,'request\x20sent');logger[_0x35ba('0x21')](_0x35ba('0x22'),_0x71a8b,_0x35ba('0x23'),JSON[_0x35ba('0x24')](_0x4e96c6));if(_0x4e96c6[_0x35ba('0x25')]){if(_0x4e96c6[_0x35ba('0x25')][_0x35ba('0x26')]===0x1f4){logger[_0x35ba('0x25')](_0x35ba('0x20'),_0x71a8b,_0x4e96c6[_0x35ba('0x25')][_0x35ba('0x27')]);return _0x388932(_0x4e96c6[_0x35ba('0x25')]['message']);}logger[_0x35ba('0x25')](_0x35ba('0x20'),_0x71a8b,_0x4e96c6[_0x35ba('0x25')][_0x35ba('0x27')]);return _0x2b6b71(_0x4e96c6[_0x35ba('0x25')][_0x35ba('0x27')]);}else{logger[_0x35ba('0x1f')](_0x35ba('0x20'),_0x71a8b,'request\x20sent');_0x2b6b71(_0x4e96c6[_0x35ba('0x28')]['message']);}})['catch'](function(_0x1cffd9){logger['error'](_0x35ba('0x20'),_0x71a8b,_0x1cffd9);_0x388932(_0x1cffd9);});});}function respondWithStatusCode(_0x3e3cbd,_0x400285){_0x400285=_0x400285||0xcc;return function(_0xb13b1c){if(_0xb13b1c){return _0x3e3cbd[_0x35ba('0x29')](_0x400285);}return _0x3e3cbd[_0x35ba('0x2a')](_0x400285)[_0x35ba('0x2b')]();};}function respondWithResult(_0x25fc3b,_0x13b8fb){_0x13b8fb=_0x13b8fb||0xc8;return function(_0xf0c607){if(_0xf0c607){return _0x25fc3b[_0x35ba('0x2a')](_0x13b8fb)[_0x35ba('0x2c')](_0xf0c607);}};}function respondWithFilteredResult(_0x38112f,_0x1914e6){return function(_0xd6fcc0){if(_0xd6fcc0){var _0x14cbbc=typeof _0x1914e6['offset']===_0x35ba('0x2d')&&typeof _0x1914e6[_0x35ba('0x2e')]===_0x35ba('0x2d');var _0x2185dd=_0xd6fcc0[_0x35ba('0x2f')];var _0x1eceef=_0x14cbbc?0x0:_0x1914e6[_0x35ba('0x30')];var _0x246981=_0x14cbbc?_0xd6fcc0[_0x35ba('0x2f')]:_0x1914e6['offset']+_0x1914e6[_0x35ba('0x2e')];var _0x4353f8;if(_0x246981>=_0x2185dd){_0x246981=_0x2185dd;_0x4353f8=0xc8;}else{_0x4353f8=0xce;}_0x38112f[_0x35ba('0x2a')](_0x4353f8);return _0x38112f[_0x35ba('0x31')]('Content-Range',_0x1eceef+'-'+_0x246981+'/'+_0x2185dd)['json'](_0xd6fcc0);}return null;};}function patchUpdates(_0xdcbf9){return function(_0x11ea79){try{jsonpatch[_0x35ba('0x32')](_0x11ea79,_0xdcbf9,!![]);}catch(_0x5c67a0){return BPromise[_0x35ba('0x33')](_0x5c67a0);}return _0x11ea79['save']();};}function saveUpdates(_0x85de1f,_0x130488){return function(_0x556521){if(_0x556521){return _0x556521['update'](_0x85de1f)[_0x35ba('0x1e')](function(_0x43c090){return _0x43c090;});}return null;};}function removeEntity(_0x26f7ef,_0x167b58){return function(_0x4de747){if(_0x4de747){return _0x4de747[_0x35ba('0x34')]()[_0x35ba('0x1e')](function(){_0x26f7ef[_0x35ba('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34d22e,_0x2c96fc){return function(_0x5eed3d){if(!_0x5eed3d){_0x34d22e['sendStatus'](0x194);}return _0x5eed3d;};}function handleError(_0xa05baf,_0x24006f){_0x24006f=_0x24006f||0x1f4;return function(_0x59b145){logger['error'](_0x59b145['stack']);if(_0x59b145[_0x35ba('0x35')]){delete _0x59b145['name'];}_0xa05baf['status'](_0x24006f)[_0x35ba('0x36')](_0x59b145);};}exports[_0x35ba('0x37')]=function(_0x2a22c8,_0x192c72){var _0x31da51={},_0x42a38a={},_0x2961a3={'count':0x0,'rows':[]};var _0x2f7878=_[_0x35ba('0x38')](db[_0x35ba('0x39')][_0x35ba('0x3a')],function(_0x1f0b31){return{'name':_0x1f0b31['fieldName'],'type':_0x1f0b31[_0x35ba('0x3b')]['key']};});_0x42a38a[_0x35ba('0x3c')]=_[_0x35ba('0x38')](_0x2f7878,'name');_0x42a38a['query']=_[_0x35ba('0x3d')](_0x2a22c8['query']);_0x42a38a['filters']=_['intersection'](_0x42a38a[_0x35ba('0x3c')],_0x42a38a[_0x35ba('0x3e')]);_0x31da51[_0x35ba('0x3f')]=_['intersection'](_0x42a38a[_0x35ba('0x3c')],qs['fields'](_0x2a22c8[_0x35ba('0x3e')]['fields']));_0x31da51[_0x35ba('0x3f')]=_0x31da51[_0x35ba('0x3f')][_0x35ba('0x40')]?_0x31da51[_0x35ba('0x3f')]:_0x42a38a['model'];if(!_0x2a22c8[_0x35ba('0x3e')][_0x35ba('0x41')]('nolimit')){_0x31da51[_0x35ba('0x2e')]=qs[_0x35ba('0x2e')](_0x2a22c8[_0x35ba('0x3e')][_0x35ba('0x2e')]);_0x31da51[_0x35ba('0x30')]=qs[_0x35ba('0x30')](_0x2a22c8[_0x35ba('0x3e')][_0x35ba('0x30')]);}_0x31da51[_0x35ba('0x42')]=qs[_0x35ba('0x43')](_0x2a22c8['query'][_0x35ba('0x43')]);_0x31da51[_0x35ba('0x44')]=qs[_0x35ba('0x45')](_[_0x35ba('0x46')](_0x2a22c8[_0x35ba('0x3e')],_0x42a38a[_0x35ba('0x45')]),_0x2f7878);if(_0x2a22c8[_0x35ba('0x3e')][_0x35ba('0x47')]){_0x31da51[_0x35ba('0x44')]=_[_0x35ba('0x48')](_0x31da51[_0x35ba('0x44')],{'$or':_['map'](_0x2f7878,function(_0x13f709){if(_0x13f709[_0x35ba('0x3b')]!=='VIRTUAL'){var _0x40dd8b={};_0x40dd8b[_0x13f709[_0x35ba('0x35')]]={'$like':'%'+_0x2a22c8['query'][_0x35ba('0x47')]+'%'};return _0x40dd8b;}})});}_0x31da51=_[_0x35ba('0x48')]({},_0x31da51,_0x2a22c8[_0x35ba('0x49')]);var _0x181b94={'where':_0x31da51[_0x35ba('0x44')]};return db[_0x35ba('0x39')][_0x35ba('0x2f')](_0x181b94)[_0x35ba('0x1e')](function(_0x66a39e){_0x2961a3['count']=_0x66a39e;if(_0x2a22c8['query'][_0x35ba('0x4a')]){_0x31da51[_0x35ba('0x4b')]=[{'all':!![]}];}return db[_0x35ba('0x39')]['findAll'](_0x31da51);})[_0x35ba('0x1e')](function(_0x564b87){_0x2961a3[_0x35ba('0x4c')]=_0x564b87;return _0x2961a3;})[_0x35ba('0x1e')](respondWithFilteredResult(_0x192c72,_0x31da51))['catch'](handleError(_0x192c72,null));};exports[_0x35ba('0x4d')]=function(_0x5c7fcb,_0x376290){var _0x41b319={'raw':!![],'where':{'id':_0x5c7fcb['params']['id']}},_0xd124a4={};_0xd124a4[_0x35ba('0x3c')]=_[_0x35ba('0x3d')](db[_0x35ba('0x39')]['rawAttributes']);_0xd124a4['query']=_['keys'](_0x5c7fcb['query']);_0xd124a4[_0x35ba('0x45')]=_[_0x35ba('0x4e')](_0xd124a4[_0x35ba('0x3c')],_0xd124a4[_0x35ba('0x3e')]);_0x41b319[_0x35ba('0x3f')]=_[_0x35ba('0x4e')](_0xd124a4[_0x35ba('0x3c')],qs[_0x35ba('0x4f')](_0x5c7fcb[_0x35ba('0x3e')][_0x35ba('0x4f')]));_0x41b319[_0x35ba('0x3f')]=_0x41b319['attributes']['length']?_0x41b319[_0x35ba('0x3f')]:_0xd124a4['model'];if(_0x5c7fcb[_0x35ba('0x3e')]['includeAll']){_0x41b319['include']=[{'all':!![]}];}_0x41b319=_[_0x35ba('0x48')]({},_0x41b319,_0x5c7fcb['options']);return db[_0x35ba('0x39')][_0x35ba('0x50')](_0x41b319)['then'](handleEntityNotFound(_0x376290,null))[_0x35ba('0x1e')](respondWithResult(_0x376290,null))[_0x35ba('0x51')](handleError(_0x376290,null));};exports[_0x35ba('0x52')]=function(_0x259c91,_0x5672cb){return db[_0x35ba('0x39')]['create'](_0x259c91[_0x35ba('0x53')],{})[_0x35ba('0x1e')](respondWithResult(_0x5672cb,0xc9))[_0x35ba('0x51')](handleError(_0x5672cb,null));};exports[_0x35ba('0x54')]=function(_0x18bcd4,_0x4b3b49){if(_0x18bcd4[_0x35ba('0x53')]['id']){delete _0x18bcd4[_0x35ba('0x53')]['id'];}return db['SmsMessage'][_0x35ba('0x50')]({'where':{'id':_0x18bcd4['params']['id']}})['then'](handleEntityNotFound(_0x4b3b49,null))[_0x35ba('0x1e')](saveUpdates(_0x18bcd4['body'],null))[_0x35ba('0x1e')](respondWithResult(_0x4b3b49,null))[_0x35ba('0x51')](handleError(_0x4b3b49,null));};exports[_0x35ba('0x34')]=function(_0x48d921,_0x1b9400){return db['SmsMessage'][_0x35ba('0x50')]({'where':{'id':_0x48d921[_0x35ba('0x55')]['id']}})[_0x35ba('0x1e')](handleEntityNotFound(_0x1b9400,null))[_0x35ba('0x1e')](removeEntity(_0x1b9400,null))['catch'](handleError(_0x1b9400,null));};exports['describe']=function(_0x542c5b,_0x489e53){return db[_0x35ba('0x39')]['describe']()[_0x35ba('0x1e')](respondWithResult(_0x489e53,null))[_0x35ba('0x51')](handleError(_0x489e53,null));};var interaction_log=require(_0x35ba('0x56'))(_0x35ba('0x57'));exports[_0x35ba('0x58')]=function(_0x294b16,_0x40b601,_0x5ef17c){var _0x30e468={'agent':{},'channel':_0x35ba('0x59')};if(_0x294b16[_0x35ba('0x53')]['id']){delete _0x294b16[_0x35ba('0x53')]['id'];}_0x294b16['body']['read']=!![];_0x294b16[_0x35ba('0x53')]['readAt']=moment()[_0x35ba('0x5a')](_0x35ba('0x5b'));_0x294b16['body'][_0x35ba('0x5c')]=_0x294b16[_0x35ba('0x53')][_0x35ba('0x5c')]||_0x294b16[_0x35ba('0x5d')]['id'];_0x30e468[_0x35ba('0x5e')]['id']=_0x294b16['body'][_0x35ba('0x5c')];return db['SmsMessage'][_0x35ba('0x50')]({'where':{'id':_0x294b16[_0x35ba('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x40b601,null))['then'](saveUpdates(_0x294b16[_0x35ba('0x53')],null))['then'](function(_0xcff6da){if(_0xcff6da){_0x30e468[_0x35ba('0x27')]=_0xcff6da[_0x35ba('0x5f')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0xcff6da[_0x35ba('0x60')]}});}return null;})[_0x35ba('0x1e')](handleEntityNotFound(_0x40b601,null))['then'](function(_0x11488e){if(_0x11488e){return _0x11488e[_0x35ba('0x54')]({'UserId':_0x294b16[_0x35ba('0x53')][_0x35ba('0x5c')],'read1stAt':_[_0x35ba('0x61')](_0x11488e[_0x35ba('0x62')])?moment()[_0x35ba('0x5a')](_0x35ba('0x5b')):undefined});}return null;})[_0x35ba('0x1e')](function(_0x5d060a){if(_0x5d060a){_0x30e468[_0x35ba('0x63')]=_0x5d060a[_0x35ba('0x5f')]({'plain':!![]});interaction_log[_0x35ba('0x1f')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x294b16[_0x35ba('0x5d')]['id'],_0x294b16[_0x35ba('0x5d')][_0x35ba('0x35')],_0x294b16['user'][_0x35ba('0x64')],_0x30e468['interaction']['id'],_0x294b16[_0x35ba('0x53')]?JSON[_0x35ba('0x24')](_0x294b16[_0x35ba('0x53')]):'null');return respondWithRpcPromise(_0x35ba('0x65'),_0x35ba('0x66'),_0x30e468);}return null;})[_0x35ba('0x1e')](function(_0x18107f){var _0x496437=_0x35ba('0x67')+_0x18107f['message'][_0x35ba('0x68')];return db[_0x35ba('0x69')]['query'](_0x496437,{'type':db['Sequelize'][_0x35ba('0x6a')]['SELECT'],'raw':!![]})[_0x35ba('0x1e')](function(_0x3d5a07){return _0x3d5a07;});})['then'](function(_0x36ee4d){if(_0x36ee4d){_0x30e468['message'][_0x35ba('0x6b')]=_0x36ee4d[0x0];if(!_0x294b16[_0x35ba('0x53')][_0x35ba('0x5c')])return;return db[_0x35ba('0x6c')][_0x35ba('0x50')]({'where':{'id':_0x294b16[_0x35ba('0x53')][_0x35ba('0x5c')],'role':_0x35ba('0x5e')},'attributes':['id','name',_0x35ba('0x6d'),_0x35ba('0x6e'),_0x35ba('0x6f')],'raw':!![]});}return null;})[_0x35ba('0x1e')](function(_0x459be6){if(!_0x459be6)return null;_0x30e468['message']['agent']=_0x459be6;return _0x30e468;})[_0x35ba('0x1e')](function(_0x1abbee){if(_0x1abbee){if(_0x294b16[_0x35ba('0x53')][_0x35ba('0x70')]){_0x30e468[_0x35ba('0x27')]['interface']=util['format'](_0x35ba('0x71'),_0x294b16[_0x35ba('0x5d')]['name']);_0x30e468['message'][_0x35ba('0x72')]=_0x30e468[_0x35ba('0x72')];_0x30e468[_0x35ba('0x27')][_0x35ba('0x73')]=_0x30e468[_0x35ba('0x72')];_0x30e468[_0x35ba('0x27')][_0x35ba('0x74')]=_0x35ba('0x58');return respondWithRpcPromise('EventManager',_0x35ba('0x75'),{'event':_0x35ba('0x76'),'message':_0x30e468[_0x35ba('0x27')]},client9002)[_0x35ba('0x1e')](function(){return _0x30e468;});}return _0x30e468;}return null;})[_0x35ba('0x1e')](respondWithResult(_0x40b601,null))[_0x35ba('0x51')](handleError(_0x40b601,null));};var interaction_log=require(_0x35ba('0x56'))('sms-interactions');exports[_0x35ba('0x33')]=function(_0x10410b,_0x33f3f5,_0x20e9f6){var _0x21da3c={'agent':{},'channel':_0x35ba('0x59')};if(_0x10410b[_0x35ba('0x53')]['id']){delete _0x10410b[_0x35ba('0x53')]['id'];}_0x10410b['body'][_0x35ba('0x5c')]=_0x10410b[_0x35ba('0x53')][_0x35ba('0x5c')]||_0x10410b['user']['id'];_0x21da3c[_0x35ba('0x5e')]['id']=_0x10410b[_0x35ba('0x53')][_0x35ba('0x5c')];return db[_0x35ba('0x39')][_0x35ba('0x50')]({'where':{'id':_0x10410b[_0x35ba('0x55')]['id'],'UserId':null}})[_0x35ba('0x1e')](handleEntityNotFound(_0x33f3f5,null))[_0x35ba('0x1e')](function(_0x1c9d2f){if(_0x1c9d2f){_0x21da3c[_0x35ba('0x27')]=_0x1c9d2f[_0x35ba('0x5f')]({'plain':!![]});return db['SmsInteraction'][_0x35ba('0x50')]({'where':{'id':_0x1c9d2f['SmsInteractionId']}});}return null;})[_0x35ba('0x1e')](handleEntityNotFound(_0x33f3f5,null))['then'](function(_0x4fa1ee){if(_0x4fa1ee){_0x21da3c['interaction']=_0x4fa1ee[_0x35ba('0x5f')]({'plain':!![]});interaction_log[_0x35ba('0x1f')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x10410b['user']['id'],_0x10410b[_0x35ba('0x5d')][_0x35ba('0x35')],_0x10410b[_0x35ba('0x5d')][_0x35ba('0x64')],_0x21da3c[_0x35ba('0x63')]['id'],_0x10410b[_0x35ba('0x53')]?JSON[_0x35ba('0x24')](_0x10410b[_0x35ba('0x53')]):_0x35ba('0x77'));return respondWithRpcPromise(_0x35ba('0x78'),'rejectMessage',_0x21da3c);}return null;})['then'](function(_0x461efa){var _0x576821='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x461efa[_0x35ba('0x27')]['ContactId'];return db[_0x35ba('0x69')][_0x35ba('0x3e')](_0x576821,{'type':db[_0x35ba('0x79')]['QueryTypes'][_0x35ba('0x7a')],'raw':!![]})['then'](function(_0x152bd4){return _0x152bd4;});})[_0x35ba('0x1e')](function(_0x1dca3e){if(_0x1dca3e){_0x21da3c[_0x35ba('0x27')]['contact']=_0x1dca3e[0x0];if(!_0x10410b[_0x35ba('0x53')][_0x35ba('0x5c')])return;return db[_0x35ba('0x6c')][_0x35ba('0x50')]({'where':{'id':_0x10410b['body'][_0x35ba('0x5c')],'role':_0x35ba('0x5e')},'attributes':['id','name','fullname','email',_0x35ba('0x6f')],'raw':!![]});}return null;})['then'](function(_0x48cd25){if(!_0x48cd25)return null;_0x21da3c['message'][_0x35ba('0x5e')]=_0x48cd25;return _0x21da3c;})[_0x35ba('0x1e')](function(_0x18c4cd){if(_0x18c4cd){_0x18c4cd[_0x35ba('0x27')][_0x35ba('0x7b')]=util[_0x35ba('0x5a')](_0x35ba('0x71'),_0x10410b[_0x35ba('0x5d')]['name']);_0x18c4cd[_0x35ba('0x27')][_0x35ba('0x72')]=_0x21da3c['channel'];_0x18c4cd[_0x35ba('0x27')][_0x35ba('0x73')]=_0x21da3c[_0x35ba('0x72')];_0x18c4cd[_0x35ba('0x27')][_0x35ba('0x74')]='reject';respondWithRpcPromise(_0x35ba('0x75'),'EventManager',{'event':_0x35ba('0x7c'),'message':_0x18c4cd[_0x35ba('0x27')]},client9002);return _0x21da3c;}return null;})['then'](respondWithResult(_0x33f3f5,null))[_0x35ba('0x51')](handleError(_0x33f3f5,null));};exports[_0x35ba('0x2a')]=function(_0x456a3c,_0xd4182b,_0x1d2476){if(_0x456a3c['body']['id']){delete _0x456a3c['body']['id'];}var _0x31ef64;return db['SmsMessage']['find']({'where':{'id':_0x456a3c['params']['id']}})['then'](handleEntityNotFound(_0xd4182b,null))[_0x35ba('0x1e')](function(_0x1c2466){if(_0x1c2466){_0x31ef64=_0x1c2466;return db[_0x35ba('0x7d')][_0x35ba('0x50')]({'where':{'id':_0x1c2466[_0x35ba('0x7e')]}});}})[_0x35ba('0x1e')](handleEntityNotFound(_0xd4182b,null))[_0x35ba('0x1e')](function(_0x230703){if(_0x230703){logger['debug'](_0x35ba('0x22'),_0x35ba('0x2a'),_0x35ba('0x7f'),_0x230703[_0x35ba('0x3b')],util['inspect'](_0x456a3c['body'],{'showHidden':![],'depth':null}));switch(_0x230703['type']){case'twilio':if(_0x456a3c[_0x35ba('0x53')][_0x35ba('0x80')]&&_0x456a3c[_0x35ba('0x53')][_0x35ba('0x80')]===_0x31ef64[_0x35ba('0x81')]){return _0x31ef64[_0x35ba('0x54')]({'read':!![]});}else{logger['error'](_0x35ba('0x82'),_0x35ba('0x2a'),_0x35ba('0x83'),util[_0x35ba('0x84')](_0x456a3c['body'],{'showHidden':![],'depth':null}));}break;case _0x35ba('0x85'):if(_0x456a3c[_0x35ba('0x53')][_0x35ba('0x86')]&&_0x456a3c[_0x35ba('0x53')][_0x35ba('0x86')]===_0x31ef64[_0x35ba('0x81')]&&_[_0x35ba('0x87')]([_0x35ba('0x88'),'delivered'],_0x456a3c[_0x35ba('0x53')][_0x35ba('0x89')])>=0x0){return _0x31ef64[_0x35ba('0x54')]({'read':!![]});}else{logger[_0x35ba('0x25')](_0x35ba('0x82'),'status',_0x35ba('0x8a'),util[_0x35ba('0x84')](_0x456a3c[_0x35ba('0x53')],{'showHidden':![],'depth':null}));}break;case _0x35ba('0x8b'):var _0x48c73b=_0x456a3c['body'][_0x35ba('0x8c')][0x0];if(_0x48c73b[_0x35ba('0x2a')][_0x35ba('0x8d')]===_0x35ba('0x8e')){return _0x31ef64[_0x35ba('0x54')]({'read':!![]});}else{logger[_0x35ba('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x35ba('0x8b'),util['inspect'](_0x456a3c[_0x35ba('0x53')],{'showHidden':![],'depth':null}));}break;}return _0x31ef64;}})['then'](respondWithResult(_0xd4182b,null))['catch'](handleError(_0xd4182b,null));};
\ No newline at end of file
index d774c96..75bcccd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8a2=['hasOwnProperty','exports','SmsMessage','setMaxListeners','save','update','remove','emit'];(function(_0x5e701b,_0x365976){var _0x12f861=function(_0x24cd2c){while(--_0x24cd2c){_0x5e701b['push'](_0x5e701b['shift']());}};_0x12f861(++_0x365976);}(_0xe8a2,0x72));var _0x2e8a=function(_0x372751,_0x1af977){_0x372751=_0x372751-0x0;var _0x47c79f=_0xe8a2[_0x372751];return _0x47c79f;};'use strict';var EventEmitter=require('events');var SmsMessage=require('../../mysqldb')['db'][_0x2e8a('0x0')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x2e8a('0x1')](0x0);var events={'afterCreate':_0x2e8a('0x2'),'afterUpdate':_0x2e8a('0x3'),'afterDestroy':_0x2e8a('0x4')};function emitEvent(_0x800eaa){return function(_0x39da50,_0x4ff559,_0x43bb48){SmsMessageEvents[_0x2e8a('0x5')](_0x800eaa+':'+_0x39da50['id'],_0x39da50);SmsMessageEvents['emit'](_0x800eaa,_0x39da50);_0x43bb48(null);};}for(var e in events){if(events[_0x2e8a('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x2e8a('0x7')]=SmsMessageEvents;
\ No newline at end of file
+var _0x6df1=['remove','emit','hook','exports','../../mysqldb','SmsMessage','setMaxListeners','save','update'];(function(_0x4f0e7,_0x44aaa1){var _0x518215=function(_0x2abaf7){while(--_0x2abaf7){_0x4f0e7['push'](_0x4f0e7['shift']());}};_0x518215(++_0x44aaa1);}(_0x6df1,0x1a2));var _0x16df=function(_0x370852,_0x2c7e62){_0x370852=_0x370852-0x0;var _0x40cc7e=_0x6df1[_0x370852];return _0x40cc7e;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x16df('0x0'))['db'][_0x16df('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x16df('0x2')](0x0);var events={'afterCreate':_0x16df('0x3'),'afterUpdate':_0x16df('0x4'),'afterDestroy':_0x16df('0x5')};function emitEvent(_0x19b11e){return function(_0x5c5cec,_0x16b5ad,_0x555b5a){SmsMessageEvents[_0x16df('0x6')](_0x19b11e+':'+_0x5c5cec['id'],_0x5c5cec);SmsMessageEvents[_0x16df('0x6')](_0x19b11e,_0x5c5cec);_0x555b5a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x16df('0x7')](e,emitEvent(event));}}module[_0x16df('0x8')]=SmsMessageEvents;
\ No newline at end of file
index 079b4f8..64f6d12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2aee=['queued_count','head','message_id','clickSend','plivo','/status?token=','authId','https://api.plivo.com/v1/Account/%s/Message/','toString','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','text','timestamp','keys','sort','length','apiKey','createHash','md5','signature=','/external/get/send.php?','id_sms','csc','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','accountId','/messages','applicationId','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','refid','status','message','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsMessage.attributes','define','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','direction','toLowerCase','secret','UserId','isNil','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','catch','error','out','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','messages','create','phone','remote','/api/sms/messages/','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','total_sent','internal_order_id','read','Missing\x20parameters:\x20username,\x20password','connectel','requestid','deliveryReport','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','senderString','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data'];(function(_0x4f5dd9,_0x30b8c5){var _0x3c8624=function(_0x3d7f06){while(--_0x3d7f06){_0x4f5dd9['push'](_0x4f5dd9['shift']());}};_0x3c8624(++_0x30b8c5);}(_0x2aee,0x19c));var _0xe2ae=function(_0x29771f,_0x1189ae){_0x29771f=_0x29771f-0x0;var _0x279baf=_0x2aee[_0x29771f];return _0x279baf;};'use strict';var _=require(_0xe2ae('0x0'));var util=require(_0xe2ae('0x1'));var logger=require(_0xe2ae('0x2'))(_0xe2ae('0x3'));var moment=require(_0xe2ae('0x4'));var BPromise=require(_0xe2ae('0x5'));var rp=require(_0xe2ae('0x6'));var fs=require('fs');var path=require(_0xe2ae('0x7'));var rimraf=require(_0xe2ae('0x8'));var config=require('../../config/environment');var attributes=require(_0xe2ae('0x9'));module['exports']=function(_0x150201,_0x31df4f){return _0x150201[_0xe2ae('0xa')]('SmsMessage',attributes,{'tableName':_0xe2ae('0xb'),'paranoid':![],'indexes':[{'name':_0xe2ae('0xc'),'fields':['messageId']},{'name':_0xe2ae('0xd'),'fields':[_0xe2ae('0xe')],'type':_0xe2ae('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1116f3,_0xef294f,_0x5c5479){var _0x26cd00=_0x150201['models'];var _0xaba106=_0x1116f3['get']({'plain':!![]});if(_0xaba106[_0xe2ae('0x10')][_0xe2ae('0x11')]()==='in'||_0xaba106[_0xe2ae('0x10')]['toLowerCase']()==='out'&&!_0xaba106[_0xe2ae('0x12')]&&!_['isNil'](_0xaba106[_0xe2ae('0x13')])&&!_[_0xe2ae('0x14')](_0xaba106[_0xe2ae('0x15')])){_0x26cd00[_0xe2ae('0x16')][_0xe2ae('0x17')]({'where':{'id':_0xaba106[_0xe2ae('0x15')]}})[_0xe2ae('0x18')](function(_0x24f16){if(_0x24f16){_0x24f16[_0xe2ae('0x19')]({'lastMsgAt':_0xaba106[_0xe2ae('0x1a')],'lastMsgDirection':_0xaba106[_0xe2ae('0x10')][_0xe2ae('0x11')]()});}})[_0xe2ae('0x1b')](function(_0x2b0f7d){console[_0xe2ae('0x1c')](_0x2b0f7d);});}if(_0xaba106[_0xe2ae('0x10')]===_0xe2ae('0x1d')&&!_0xaba106[_0xe2ae('0x12')]){var _0x2e6845;_0x26cd00[_0xe2ae('0x1e')][_0xe2ae('0x1f')]({'where':{'id':_0xaba106[_0xe2ae('0x20')]},'raw':!![]})['then'](function(_0x5cd317){_0x2e6845=_0x5cd317;if(_0x2e6845&&_0x2e6845[_0xe2ae('0x21')]){switch(_0x2e6845[_0xe2ae('0x21')]){case _0xe2ae('0x22'):var _0x3a6d10=require(_0xe2ae('0x22'));if(_0x2e6845[_0xe2ae('0x23')]&&_0x2e6845[_0xe2ae('0x24')]&&_0x2e6845['phone']){var _0x4e33f1=new _0x3a6d10(_0x2e6845[_0xe2ae('0x23')],_0x2e6845[_0xe2ae('0x24')]);_0x4e33f1[_0xe2ae('0x25')][_0xe2ae('0x26')]({'body':_0xaba106[_0xe2ae('0xe')],'to':_0xaba106[_0xe2ae('0x27')],'from':_0x2e6845[_0xe2ae('0x27')],'statusCallback':_0x2e6845[_0xe2ae('0x28')]+_0xe2ae('0x29')+_0xaba106['id']+'/status?token='+_0x2e6845[_0xe2ae('0x2a')]})[_0xe2ae('0x18')](function(_0x309ee2){if(_0x309ee2[_0xe2ae('0x2b')]){return _0x1116f3[_0xe2ae('0x19')]({'messageId':_0x309ee2['sid']});}})['catch'](function(_0x3a3b37){logger[_0xe2ae('0x1c')](_0xe2ae('0x2c'),'afterCreate','twilio',util[_0xe2ae('0x2d')](_0x3a3b37,{'showHidden':![],'depth':null}));});}else{logger[_0xe2ae('0x1c')](_0xe2ae('0x2c'),_0xe2ae('0x2e'),'twilio',_0xe2ae('0x2f'));}break;case _0xe2ae('0x30'):var _0x2c4ce4='https://api.skebby.it/API/v1.0/REST/';if(_0x2e6845[_0xe2ae('0x31')]&&_0x2e6845[_0xe2ae('0x32')]){var _0x3664f2={'recipient':[_0xaba106['phone']],'message':_0xaba106[_0xe2ae('0xe')],'message_type':_0x2e6845[_0xe2ae('0x33')]};if(_0x2e6845['smsMethod']&&_0x2e6845[_0xe2ae('0x33')]!=='SI'){_0x3664f2[_0xe2ae('0x34')]=_0x2e6845[_0xe2ae('0x27')];}var _0x4d49ed={'url':_0x2c4ce4+_0xe2ae('0x35')+_0x2e6845[_0xe2ae('0x31')]+_0xe2ae('0x36')+_0x2e6845['password'],'method':_0xe2ae('0x37')};rp(_0x4d49ed)['then'](function(_0xde63f7){var _0x2b9ba7=_0xde63f7[_0xe2ae('0x38')](';');var _0xdf1479={'user_key':_0x2b9ba7[0x0],'session_key':_0x2b9ba7[0x1]};_0x4d49ed={'url':_0x2c4ce4+_0xe2ae('0x39'),'method':_0xe2ae('0x3a'),'headers':{'user_key':_0xdf1479['user_key'],'Session_key':_0xdf1479['session_key']},'json':!![],'body':_0x3664f2};return rp(_0x4d49ed);})[_0xe2ae('0x18')](function(_0x519169){if(_0x519169[_0xe2ae('0x3b')]>=0x1){var _0x13aca3={'messageId':_0x519169[_0xe2ae('0x3c')]};if(_0x2e6845[_0xe2ae('0x33')]!=='GP'||!_0x2e6845['deliveryReport']){_0x13aca3[_0xe2ae('0x3d')]=!![];}return _0x1116f3[_0xe2ae('0x19')](_0x13aca3);}else{return logger[_0xe2ae('0x1c')](_0xe2ae('0x2c'),_0xe2ae('0x2e'),'skebby',util[_0xe2ae('0x2d')](_0x519169,{'showHidden':![],'depth':null}));}})[_0xe2ae('0x1b')](function(_0x4ef9e8){return logger[_0xe2ae('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe2ae('0x2e'),_0xe2ae('0x30'),util[_0xe2ae('0x2d')](_0x4ef9e8,{'showHidden':![],'depth':null}));});}else{logger[_0xe2ae('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe2ae('0x2e'),_0xe2ae('0x30'),_0xe2ae('0x3e'));}break;case _0xe2ae('0x3f'):if(_0x2e6845[_0xe2ae('0x24')]){var _0x2b10f5={'recipient':_0xaba106[_0xe2ae('0x27')],'message':_0xaba106[_0xe2ae('0xe')],'sender':_0x2e6845['senderString']||_0x2e6845[_0xe2ae('0x27')],'authorization':_0x2e6845[_0xe2ae('0x24')]};var _0xef294f={'method':_0xe2ae('0x3a'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x2b10f5,'json':!![]};rp(_0xef294f)[_0xe2ae('0x18')](function(_0x4aa0d3){var _0x341fac={'messageId':_0x4aa0d3[_0xe2ae('0x40')]};if(!_0x2e6845[_0xe2ae('0x41')]){_0x341fac[_0xe2ae('0x3d')]=!![];}return _0x1116f3[_0xe2ae('0x19')](_0x341fac);})[_0xe2ae('0x1b')](function(_0x53798e){logger[_0xe2ae('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe2ae('0x2e'),_0xe2ae('0x3f'),util[_0xe2ae('0x2d')](_0x53798e,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe2ae('0x2c'),'afterCreate',_0xe2ae('0x3f'),_0xe2ae('0x42'));}break;case'clicksend':if(_0x2e6845[_0xe2ae('0x31')]&&_0x2e6845[_0xe2ae('0x32')]){var _0x2b10f5={'messages':[{'source':_0xe2ae('0x43'),'to':_0xaba106['phone'],'body':_0xaba106[_0xe2ae('0xe')],'from':_0x2e6845[_0xe2ae('0x44')]||_0x2e6845['phone']}]};var _0x389dca=util[_0xe2ae('0x45')](_0xe2ae('0x46'),_0x2e6845['username'],_0x2e6845[_0xe2ae('0x32')]);var _0xef294f={'method':'POST','uri':_0xe2ae('0x47'),'body':_0x2b10f5,'headers':{'Authorization':util['format'](_0xe2ae('0x48'),new Buffer(_0x389dca)['toString'](_0xe2ae('0x49')))},'json':!![]};rp(_0xef294f)[_0xe2ae('0x18')](function(_0x358759){if(_0x358759[_0xe2ae('0x4a')]>=0xc8&&_0x358759['http_code']<=0xce){if(_0x358759[_0xe2ae('0x4b')]&&_0x358759[_0xe2ae('0x4b')][_0xe2ae('0x4c')]>0x0){var _0x39a6a0=_[_0xe2ae('0x4d')](_0x358759['data'][_0xe2ae('0x25')]);var _0x1b8fc8={'messageId':_0x39a6a0[_0xe2ae('0x4e')]};if(!_0x2e6845[_0xe2ae('0x41')]){_0x1b8fc8[_0xe2ae('0x3d')]=!![];}return _0x1116f3['update'](_0x1b8fc8);}else{logger[_0xe2ae('0x1c')](_0xe2ae('0x2c'),_0xe2ae('0x2e'),_0xe2ae('0x4f'),util[_0xe2ae('0x2d')](_0x358759,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xe2ae('0x2c'),_0xe2ae('0x2e'),'clickSend',util[_0xe2ae('0x2d')](_0x358759,{'showHidden':![],'depth':null}));}})[_0xe2ae('0x1b')](function(_0x360202){logger[_0xe2ae('0x1c')](_0xe2ae('0x2c'),_0xe2ae('0x2e'),_0xe2ae('0x4f'),util[_0xe2ae('0x2d')](_0x360202,{'showHidden':![],'depth':null}));});}else{logger[_0xe2ae('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe2ae('0x2e'),'clickSend',_0xe2ae('0x3e'));}break;case _0xe2ae('0x50'):if(_0x2e6845['authId']&&_0x2e6845[_0xe2ae('0x24')]){var _0x2b10f5={'dst':_0xaba106[_0xe2ae('0x27')],'text':_0xaba106[_0xe2ae('0xe')],'src':_0x2e6845['senderString']||_0x2e6845[_0xe2ae('0x27')],'url':_0x2e6845[_0xe2ae('0x28')]+_0xe2ae('0x29')+_0xaba106['id']+_0xe2ae('0x51')+_0x2e6845[_0xe2ae('0x2a')]};var _0x389dca=util[_0xe2ae('0x45')]('%s:%s',_0x2e6845[_0xe2ae('0x52')],_0x2e6845[_0xe2ae('0x24')]);var _0xef294f={'method':_0xe2ae('0x3a'),'uri':util[_0xe2ae('0x45')](_0xe2ae('0x53'),_0x2e6845['authId']),'body':_0x2b10f5,'headers':{'Authorization':util[_0xe2ae('0x45')](_0xe2ae('0x48'),new Buffer(_0x389dca)[_0xe2ae('0x54')](_0xe2ae('0x49')))},'json':!![]};rp(_0xef294f)[_0xe2ae('0x18')](function(_0x638427){var _0xe8533c={'messageId':_0x638427['message_uuid'][0x0]};return _0x1116f3['update'](_0xe8533c);})[_0xe2ae('0x1b')](function(_0x551976){logger['error'](_0xe2ae('0x2c'),_0xe2ae('0x2e'),'plivo',util['inspect'](_0x551976,{'showHidden':![],'depth':null}));});}else{logger[_0xe2ae('0x1c')](_0xe2ae('0x2c'),_0xe2ae('0x2e'),_0xe2ae('0x50'),_0xe2ae('0x55'));}break;case _0xe2ae('0x56'):if(_0x2e6845[_0xe2ae('0x31')]&&_0x2e6845['password']){if(_0x2e6845[_0xe2ae('0x57')]){var _0x44d794={'method':_0xe2ae('0x3a'),'uri':_0x2e6845[_0xe2ae('0x57')]+_0xe2ae('0x58'),'body':{'username':_0x2e6845[_0xe2ae('0x31')],'password':_0x2e6845[_0xe2ae('0x32')]},'json':!![]};return rp(_0x44d794)['then'](function(_0x2c95b3){var _0x164a93={'method':_0xe2ae('0x3a'),'uri':_0x2e6845['baseUrl']+_0xe2ae('0x59'),'body':{'messages':[{'from':_0x2e6845[_0xe2ae('0x27')],'destinations':[{'to':_0xaba106[_0xe2ae('0x27')]}],'text':_0xaba106[_0xe2ae('0xe')],'notifyUrl':_0x2e6845[_0xe2ae('0x28')]+_0xe2ae('0x29')+_0xaba106['id']+_0xe2ae('0x51')+_0x2e6845[_0xe2ae('0x2a')],'notifyContentType':_0xe2ae('0x5a'),'callbackData':_0x2e6845[_0xe2ae('0x27')]+';'+_0xaba106['body']}]},'headers':{'Authorization':_0xe2ae('0x5b')+_0x2c95b3['token']},'json':!![]};return rp(_0x164a93)['then'](function(_0x33642c){if(_0x33642c[_0xe2ae('0x25')]){var _0x124500={'messageId':_0x33642c[_0xe2ae('0x25')][0x0][_0xe2ae('0xc')]};if(!_0x2e6845[_0xe2ae('0x41')]){_0x124500['read']=!![];}return _0x1116f3[_0xe2ae('0x19')](_0x124500);}else{return logger[_0xe2ae('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe2ae('0x2e'),'infobip',util[_0xe2ae('0x2d')](_0x33642c,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x2759c7){return logger[_0xe2ae('0x1c')](_0xe2ae('0x2c'),'afterCreate',_0xe2ae('0x56'),util['inspect'](_0x2759c7,{'showHidden':![],'depth':null}));});}else{logger[_0xe2ae('0x1c')](_0xe2ae('0x2c'),_0xe2ae('0x2e'),_0xe2ae('0x56'),_0xe2ae('0x5c'));}}else{logger['error'](_0xe2ae('0x2c'),'afterCreate','infobip',_0xe2ae('0x3e'));}break;case'csc':var _0x4861d4=require('crypto');if(_0x2e6845['apiKey']){var _0x5cbacb={};_0x5cbacb['login']=_0x2e6845[_0xe2ae('0x31')];_0x5cbacb[_0xe2ae('0x27')]=_0xaba106[_0xe2ae('0x27')];_0x5cbacb['sender']=_0x2e6845['phone'];_0x5cbacb[_0xe2ae('0x5d')]=_0xaba106['body'];_0x5cbacb[_0xe2ae('0x5e')]=+new Date();var _0x1c47a0='';var _0x4e0b81='';var _0x42795d=Object[_0xe2ae('0x5f')](_0x5cbacb);_0x42795d[_0xe2ae('0x60')]();for(var _0x561a34=0x0;_0x561a34<_0x42795d[_0xe2ae('0x61')];_0x561a34++){if(_0x1c47a0!=''){_0x1c47a0+='&';}_0x1c47a0+=_0x42795d[_0x561a34]+'='+encodeURIComponent(_0x5cbacb[_0x42795d[_0x561a34]]);_0x4e0b81+=_0x5cbacb[_0x42795d[_0x561a34]];}_0x4e0b81+=_0x2e6845[_0xe2ae('0x62')];_0x4e0b81=_0x4861d4[_0xe2ae('0x63')](_0xe2ae('0x64'))[_0xe2ae('0x19')](_0x4e0b81)['digest']('hex');if(_0x1c47a0!==''){_0x1c47a0+='&';}_0x1c47a0+=_0xe2ae('0x65')+_0x4e0b81;var _0x4d49ed={'method':_0xe2ae('0x37'),'uri':_0x2e6845[_0xe2ae('0x57')]+_0xe2ae('0x66')+_0x1c47a0,'json':!![]};return rp(_0x4d49ed)['then'](function(_0x3d3a58){var _0x5ebf70=Object[_0xe2ae('0x5f')](_0x3d3a58);if(_0x3d3a58[_0x5ebf70[0x0]][_0xe2ae('0x1c')]&&parseInt(_0x3d3a58[_0x5ebf70[0x0]][_0xe2ae('0x1c')])===0x0){var _0x28355a={'messageId':_0x3d3a58[_0x5ebf70[0x0]][_0xe2ae('0x67')]};if(!_0x2e6845[_0xe2ae('0x41')]){_0x28355a[_0xe2ae('0x3d')]=!![];}return _0x1116f3[_0xe2ae('0x19')](_0x28355a);}else{return logger[_0xe2ae('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe2ae('0x2e'),_0xe2ae('0x68'),util[_0xe2ae('0x2d')](_0x3d3a58[_0xe2ae('0x1c')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x40bd48){return logger['error'](_0xe2ae('0x2c'),_0xe2ae('0x2e'),_0xe2ae('0x68'),util['inspect'](_0x40bd48,{'showHidden':![],'depth':null}));});}else{logger[_0xe2ae('0x1c')](_0xe2ae('0x2c'),'afterCreate',_0xe2ae('0x68'),'Missing\x20parameters:\x20apiKey');}break;case _0xe2ae('0x69'):if(_0x2e6845[_0xe2ae('0x62')]){var _0x44bba8={'method':_0xe2ae('0x3a'),'uri':_0xe2ae('0x6a'),'headers':{'Authorization':_0x2e6845[_0xe2ae('0x62')]},'body':{'content':_0xaba106[_0xe2ae('0xe')],'to':[_0xaba106['phone']],'from':_0x2e6845[_0xe2ae('0x27')],'binary':![],'clientMessageId':_0xe2ae('0x6b'),'charset':_0xe2ae('0x6c')},'json':!![]};rp(_0x44bba8)[_0xe2ae('0x18')](function(_0x3d4cf9){if(!_0x3d4cf9[_0xe2ae('0x1c')]){var _0x2fbeb8={'messageId':_0x3d4cf9[_0xe2ae('0x25')][0x0][_0xe2ae('0x6d')]};if(!_0x2e6845['deliveryReport']){_0x2fbeb8['read']=!![];}return _0x1116f3[_0xe2ae('0x19')](_0x2fbeb8);}else{return logger[_0xe2ae('0x1c')](_0xe2ae('0x2c'),'afterCreate',_0xe2ae('0x69'),util['inspect'](_0x3d4cf9[_0xe2ae('0x1c')],{'showHidden':![],'depth':null}));}})[_0xe2ae('0x1b')](function(_0x5c0191){return logger[_0xe2ae('0x1c')](_0xe2ae('0x2c'),_0xe2ae('0x2e'),_0xe2ae('0x69'),util[_0xe2ae('0x2d')](_0x5c0191,{'showHidden':![],'depth':null}));});}else{logger[_0xe2ae('0x1c')](_0xe2ae('0x2c'),_0xe2ae('0x2e'),_0xe2ae('0x69'),'Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x2e6845[_0xe2ae('0x31')]&&_0x2e6845[_0xe2ae('0x32')]){var _0x389dca=util[_0xe2ae('0x45')](_0xe2ae('0x46'),_0x2e6845[_0xe2ae('0x31')],_0x2e6845[_0xe2ae('0x32')]);var _0xef294f={'method':_0xe2ae('0x3a'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x2e6845[_0xe2ae('0x6e')]+_0xe2ae('0x6f'),'body':{'to':[_0xaba106['phone']],'text':_0xaba106[_0xe2ae('0xe')],'from':_0x2e6845[_0xe2ae('0x27')],'applicationId':_0x2e6845[_0xe2ae('0x70')]},'headers':{'Authorization':util[_0xe2ae('0x45')](_0xe2ae('0x48'),new Buffer(_0x389dca)[_0xe2ae('0x54')]('base64'))},'json':!![]};rp(_0xef294f)[_0xe2ae('0x18')](function(_0x318fe8){if(_0x318fe8['id']){var _0x58ae87={'messageId':_0x318fe8['id']};return _0x1116f3[_0xe2ae('0x19')](_0x58ae87);}else{logger[_0xe2ae('0x1c')](_0xe2ae('0x2c'),_0xe2ae('0x2e'),_0xe2ae('0x71'),util[_0xe2ae('0x2d')](_0x318fe8,{'showHidden':![],'depth':null}));}})[_0xe2ae('0x1b')](function(_0x1d86e9){logger[_0xe2ae('0x1c')](_0xe2ae('0x2c'),'afterCreate',_0xe2ae('0x71'),util[_0xe2ae('0x2d')](_0x1d86e9,{'showHidden':![],'depth':null}));});}else{logger[_0xe2ae('0x1c')](_0xe2ae('0x2c'),_0xe2ae('0x2e'),'bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case _0xe2ae('0x72'):if(_0x2e6845[_0xe2ae('0x62')]){var _0x4e6ab9={};var _0x4d49ed={'method':_0xe2ae('0x3a'),'uri':_0xe2ae('0x73'),'headers':{'Authorization':_0xe2ae('0x74')+_0x2e6845[_0xe2ae('0x62')],'Content-Type':'application/json'},'body':{'from':_0x2e6845[_0xe2ae('0x27')],'to':_0xaba106[_0xe2ae('0x27')],'text':_0xaba106['body']},'json':!![]};return rp(_0x4d49ed)[_0xe2ae('0x18')](function(_0xaf6570){if(_0xaf6570[_0xe2ae('0x75')]==0xca){_0x4e6ab9['message']=_0xaf6570;var _0x3f01a9={'method':_0xe2ae('0x3a'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xe2ae('0x74')+_0x2e6845['apiKey'],'Content-Type':_0xe2ae('0x5a')},'body':{'refid':_0x4e6ab9['message'][_0xe2ae('0x76')]},'json':!![]};return rp(_0x3f01a9)[_0xe2ae('0x18')](function(_0x358844){_0x4e6ab9[_0xe2ae('0x77')]=_0x358844;var _0x519948={'messageId':_0x4e6ab9[_0xe2ae('0x78')]['refid'],'read':!![]};return _0x1116f3[_0xe2ae('0x19')](_0x519948);});}else{return logger[_0xe2ae('0x1c')](_0xe2ae('0x2c'),_0xe2ae('0x2e'),'intelepeer',util[_0xe2ae('0x2d')](_0xaf6570,{'showHidden':![],'depth':null}));}})[_0xe2ae('0x1b')](function(_0x4fb86c){return logger['error'](_0xe2ae('0x2c'),_0xe2ae('0x2e'),_0xe2ae('0x72'),util[_0xe2ae('0x2d')](_0x4fb86c,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xe2ae('0x2c'),_0xe2ae('0x2e'),'intelepeer','Token\x20not\x20received');}break;}}})['finally'](function(){_0x5c5479();});}else{_0x5c5479();}}},'charset':'utf8mb4','collate':_0xe2ae('0x79')});};
\ No newline at end of file
+var _0x4a3c=['/messages','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','./smsMessage.attributes','exports','sms_messages','messageId','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','isNil','findOne','SmsInteractionId','then','update','createdAt','error','find','SmsAccountId','type','twilio','accountSid','create','phone','remote','/api/sms/messages/','/status?token=','token','sid','catch','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','split','sms','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','POST','Basic\x20%s','toString','http_code','data','queued_count','head','messages','message_id','clickSend','plivo','authId','authToken','base64','message_uuid','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','keys','sort','length','createHash','md5','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','apiMessageId','https://messaging.bandwidth.com/api/v2/users/'];(function(_0x250a0a,_0xfcf782){var _0x1dbe57=function(_0x629a80){while(--_0x629a80){_0x250a0a['push'](_0x250a0a['shift']());}};_0x1dbe57(++_0xfcf782);}(_0x4a3c,0x102));var _0xc4a3=function(_0x2cddf1,_0x42489e){_0x2cddf1=_0x2cddf1-0x0;var _0x3efcef=_0x4a3c[_0x2cddf1];return _0x3efcef;};'use strict';var _=require(_0xc4a3('0x0'));var util=require(_0xc4a3('0x1'));var logger=require(_0xc4a3('0x2'))(_0xc4a3('0x3'));var moment=require('moment');var BPromise=require(_0xc4a3('0x4'));var rp=require(_0xc4a3('0x5'));var fs=require('fs');var path=require(_0xc4a3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc4a3('0x7'));module[_0xc4a3('0x8')]=function(_0x487ce6,_0x1be7a3){return _0x487ce6['define']('SmsMessage',attributes,{'tableName':_0xc4a3('0x9'),'paranoid':![],'indexes':[{'name':_0xc4a3('0xa'),'fields':[_0xc4a3('0xa')]},{'name':'fti_sms_messages','fields':[_0xc4a3('0xb')],'type':_0xc4a3('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1693d1,_0x2125ac,_0x4e05d3){var _0x546f9e=_0x487ce6[_0xc4a3('0xd')];var _0xb027dd=_0x1693d1[_0xc4a3('0xe')]({'plain':!![]});if(_0xb027dd[_0xc4a3('0xf')][_0xc4a3('0x10')]()==='in'||_0xb027dd[_0xc4a3('0xf')][_0xc4a3('0x10')]()===_0xc4a3('0x11')&&!_0xb027dd[_0xc4a3('0x12')]&&!_['isNil'](_0xb027dd[_0xc4a3('0x13')])&&!_[_0xc4a3('0x14')](_0xb027dd['SmsInteractionId'])){_0x546f9e['SmsInteraction'][_0xc4a3('0x15')]({'where':{'id':_0xb027dd[_0xc4a3('0x16')]}})[_0xc4a3('0x17')](function(_0x334093){if(_0x334093){_0x334093[_0xc4a3('0x18')]({'lastMsgAt':_0xb027dd[_0xc4a3('0x19')],'lastMsgDirection':_0xb027dd[_0xc4a3('0xf')][_0xc4a3('0x10')]()});}})['catch'](function(_0x1cc3c2){console[_0xc4a3('0x1a')](_0x1cc3c2);});}if(_0xb027dd[_0xc4a3('0xf')]===_0xc4a3('0x11')&&!_0xb027dd['secret']){var _0x43c437;_0x546f9e['SmsAccount'][_0xc4a3('0x1b')]({'where':{'id':_0xb027dd[_0xc4a3('0x1c')]},'raw':!![]})[_0xc4a3('0x17')](function(_0x37a85e){_0x43c437=_0x37a85e;if(_0x43c437&&_0x43c437[_0xc4a3('0x1d')]){switch(_0x43c437['type']){case _0xc4a3('0x1e'):var _0x426096=require(_0xc4a3('0x1e'));if(_0x43c437[_0xc4a3('0x1f')]&&_0x43c437['authToken']&&_0x43c437['phone']){var _0x454d34=new _0x426096(_0x43c437[_0xc4a3('0x1f')],_0x43c437['authToken']);_0x454d34['messages'][_0xc4a3('0x20')]({'body':_0xb027dd[_0xc4a3('0xb')],'to':_0xb027dd['phone'],'from':_0x43c437[_0xc4a3('0x21')],'statusCallback':_0x43c437[_0xc4a3('0x22')]+_0xc4a3('0x23')+_0xb027dd['id']+_0xc4a3('0x24')+_0x43c437[_0xc4a3('0x25')]})[_0xc4a3('0x17')](function(_0xd85a4e){if(_0xd85a4e[_0xc4a3('0x26')]){return _0x1693d1['update']({'messageId':_0xd85a4e['sid']});}})[_0xc4a3('0x27')](function(_0x1515df){logger[_0xc4a3('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc4a3('0x28'),'twilio',util[_0xc4a3('0x29')](_0x1515df,{'showHidden':![],'depth':null}));});}else{logger[_0xc4a3('0x1a')](_0xc4a3('0x2a'),_0xc4a3('0x28'),'twilio',_0xc4a3('0x2b'));}break;case'skebby':var _0x2df266=_0xc4a3('0x2c');if(_0x43c437[_0xc4a3('0x2d')]&&_0x43c437[_0xc4a3('0x2e')]){var _0x2255cc={'recipient':[_0xb027dd[_0xc4a3('0x21')]],'message':_0xb027dd['body'],'message_type':_0x43c437[_0xc4a3('0x2f')]};if(_0x43c437[_0xc4a3('0x2f')]&&_0x43c437[_0xc4a3('0x2f')]!=='SI'){_0x2255cc[_0xc4a3('0x30')]=_0x43c437[_0xc4a3('0x21')];}var _0x34f6ad={'url':_0x2df266+_0xc4a3('0x31')+_0x43c437['username']+_0xc4a3('0x32')+_0x43c437[_0xc4a3('0x2e')],'method':'GET'};rp(_0x34f6ad)[_0xc4a3('0x17')](function(_0x5e81ee){var _0xfb718=_0x5e81ee[_0xc4a3('0x33')](';');var _0x250422={'user_key':_0xfb718[0x0],'session_key':_0xfb718[0x1]};_0x34f6ad={'url':_0x2df266+_0xc4a3('0x34'),'method':'POST','headers':{'user_key':_0x250422[_0xc4a3('0x35')],'Session_key':_0x250422[_0xc4a3('0x36')]},'json':!![],'body':_0x2255cc};return rp(_0x34f6ad);})[_0xc4a3('0x17')](function(_0x5e1f27){if(_0x5e1f27[_0xc4a3('0x37')]>=0x1){var _0x2e23fd={'messageId':_0x5e1f27[_0xc4a3('0x38')]};if(_0x43c437[_0xc4a3('0x2f')]!=='GP'||!_0x43c437[_0xc4a3('0x39')]){_0x2e23fd[_0xc4a3('0x3a')]=!![];}return _0x1693d1['update'](_0x2e23fd);}else{return logger[_0xc4a3('0x1a')](_0xc4a3('0x2a'),_0xc4a3('0x28'),_0xc4a3('0x3b'),util['inspect'](_0x5e1f27,{'showHidden':![],'depth':null}));}})[_0xc4a3('0x27')](function(_0x2855d1){return logger[_0xc4a3('0x1a')](_0xc4a3('0x2a'),_0xc4a3('0x28'),'skebby',util[_0xc4a3('0x29')](_0x2855d1,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc4a3('0x2a'),'afterCreate',_0xc4a3('0x3b'),_0xc4a3('0x3c'));}break;case _0xc4a3('0x3d'):if(_0x43c437['authToken']){var _0x42ea1c={'recipient':_0xb027dd[_0xc4a3('0x21')],'message':_0xb027dd['body'],'sender':_0x43c437[_0xc4a3('0x3e')]||_0x43c437[_0xc4a3('0x21')],'authorization':_0x43c437['authToken']};var _0x2125ac={'method':'POST','uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x42ea1c,'json':!![]};rp(_0x2125ac)[_0xc4a3('0x17')](function(_0x1d378c){var _0x10bdd3={'messageId':_0x1d378c[_0xc4a3('0x3f')]};if(!_0x43c437[_0xc4a3('0x39')]){_0x10bdd3[_0xc4a3('0x3a')]=!![];}return _0x1693d1[_0xc4a3('0x18')](_0x10bdd3);})[_0xc4a3('0x27')](function(_0x43ed11){logger[_0xc4a3('0x1a')](_0xc4a3('0x2a'),'afterCreate',_0xc4a3('0x3d'),util[_0xc4a3('0x29')](_0x43ed11,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc4a3('0x2a'),_0xc4a3('0x28'),_0xc4a3('0x3d'),_0xc4a3('0x40'));}break;case _0xc4a3('0x41'):if(_0x43c437['username']&&_0x43c437[_0xc4a3('0x2e')]){var _0x42ea1c={'messages':[{'source':_0xc4a3('0x42'),'to':_0xb027dd[_0xc4a3('0x21')],'body':_0xb027dd['body'],'from':_0x43c437[_0xc4a3('0x3e')]||_0x43c437[_0xc4a3('0x21')]}]};var _0x21e4a8=util[_0xc4a3('0x43')](_0xc4a3('0x44'),_0x43c437['username'],_0x43c437[_0xc4a3('0x2e')]);var _0x2125ac={'method':_0xc4a3('0x45'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x42ea1c,'headers':{'Authorization':util[_0xc4a3('0x43')](_0xc4a3('0x46'),new Buffer(_0x21e4a8)[_0xc4a3('0x47')]('base64'))},'json':!![]};rp(_0x2125ac)[_0xc4a3('0x17')](function(_0xb7aeef){if(_0xb7aeef[_0xc4a3('0x48')]>=0xc8&&_0xb7aeef[_0xc4a3('0x48')]<=0xce){if(_0xb7aeef[_0xc4a3('0x49')]&&_0xb7aeef[_0xc4a3('0x49')][_0xc4a3('0x4a')]>0x0){var _0x4ebe43=_[_0xc4a3('0x4b')](_0xb7aeef[_0xc4a3('0x49')][_0xc4a3('0x4c')]);var _0x889669={'messageId':_0x4ebe43[_0xc4a3('0x4d')]};if(!_0x43c437[_0xc4a3('0x39')]){_0x889669[_0xc4a3('0x3a')]=!![];}return _0x1693d1[_0xc4a3('0x18')](_0x889669);}else{logger[_0xc4a3('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xc4a3('0x4e'),util[_0xc4a3('0x29')](_0xb7aeef,{'showHidden':![],'depth':null}));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc4a3('0x28'),_0xc4a3('0x4e'),util[_0xc4a3('0x29')](_0xb7aeef,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5074e8){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc4a3('0x28'),_0xc4a3('0x4e'),util[_0xc4a3('0x29')](_0x5074e8,{'showHidden':![],'depth':null}));});}else{logger[_0xc4a3('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc4a3('0x28'),_0xc4a3('0x4e'),_0xc4a3('0x3c'));}break;case _0xc4a3('0x4f'):if(_0x43c437[_0xc4a3('0x50')]&&_0x43c437[_0xc4a3('0x51')]){var _0x42ea1c={'dst':_0xb027dd[_0xc4a3('0x21')],'text':_0xb027dd[_0xc4a3('0xb')],'src':_0x43c437[_0xc4a3('0x3e')]||_0x43c437[_0xc4a3('0x21')],'url':_0x43c437[_0xc4a3('0x22')]+_0xc4a3('0x23')+_0xb027dd['id']+'/status?token='+_0x43c437['token']};var _0x21e4a8=util[_0xc4a3('0x43')](_0xc4a3('0x44'),_0x43c437[_0xc4a3('0x50')],_0x43c437['authToken']);var _0x2125ac={'method':_0xc4a3('0x45'),'uri':util[_0xc4a3('0x43')]('https://api.plivo.com/v1/Account/%s/Message/',_0x43c437['authId']),'body':_0x42ea1c,'headers':{'Authorization':util[_0xc4a3('0x43')](_0xc4a3('0x46'),new Buffer(_0x21e4a8)[_0xc4a3('0x47')](_0xc4a3('0x52')))},'json':!![]};rp(_0x2125ac)['then'](function(_0x2e4c76){var _0x104a5a={'messageId':_0x2e4c76[_0xc4a3('0x53')][0x0]};return _0x1693d1[_0xc4a3('0x18')](_0x104a5a);})[_0xc4a3('0x27')](function(_0x2e64dd){logger[_0xc4a3('0x1a')](_0xc4a3('0x2a'),'afterCreate',_0xc4a3('0x4f'),util[_0xc4a3('0x29')](_0x2e64dd,{'showHidden':![],'depth':null}));});}else{logger[_0xc4a3('0x1a')](_0xc4a3('0x2a'),'afterCreate','plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xc4a3('0x54'):if(_0x43c437[_0xc4a3('0x2d')]&&_0x43c437[_0xc4a3('0x2e')]){if(_0x43c437[_0xc4a3('0x55')]){var _0x2a98d1={'method':'POST','uri':_0x43c437['baseUrl']+_0xc4a3('0x56'),'body':{'username':_0x43c437[_0xc4a3('0x2d')],'password':_0x43c437['password']},'json':!![]};return rp(_0x2a98d1)['then'](function(_0x39fd6c){var _0x10cc9d={'method':'POST','uri':_0x43c437[_0xc4a3('0x55')]+_0xc4a3('0x57'),'body':{'messages':[{'from':_0x43c437[_0xc4a3('0x21')],'destinations':[{'to':_0xb027dd[_0xc4a3('0x21')]}],'text':_0xb027dd['body'],'notifyUrl':_0x43c437['remote']+_0xc4a3('0x23')+_0xb027dd['id']+_0xc4a3('0x24')+_0x43c437[_0xc4a3('0x25')],'notifyContentType':'application/json','callbackData':_0x43c437[_0xc4a3('0x21')]+';'+_0xb027dd[_0xc4a3('0xb')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x39fd6c[_0xc4a3('0x25')]},'json':!![]};return rp(_0x10cc9d)[_0xc4a3('0x17')](function(_0x3b1e1d){if(_0x3b1e1d[_0xc4a3('0x4c')]){var _0x3cd0cc={'messageId':_0x3b1e1d[_0xc4a3('0x4c')][0x0]['messageId']};if(!_0x43c437[_0xc4a3('0x39')]){_0x3cd0cc['read']=!![];}return _0x1693d1['update'](_0x3cd0cc);}else{return logger['error'](_0xc4a3('0x2a'),_0xc4a3('0x28'),'infobip',util['inspect'](_0x3b1e1d,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x5605e8){return logger[_0xc4a3('0x1a')](_0xc4a3('0x2a'),_0xc4a3('0x28'),_0xc4a3('0x54'),util[_0xc4a3('0x29')](_0x5605e8,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc4a3('0x2a'),_0xc4a3('0x28'),_0xc4a3('0x54'),_0xc4a3('0x58'));}}else{logger[_0xc4a3('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc4a3('0x28'),_0xc4a3('0x54'),_0xc4a3('0x3c'));}break;case _0xc4a3('0x59'):var _0x542582=require(_0xc4a3('0x5a'));if(_0x43c437[_0xc4a3('0x5b')]){var _0x1d6cf5={};_0x1d6cf5[_0xc4a3('0x5c')]=_0x43c437[_0xc4a3('0x2d')];_0x1d6cf5[_0xc4a3('0x21')]=_0xb027dd[_0xc4a3('0x21')];_0x1d6cf5[_0xc4a3('0x30')]=_0x43c437[_0xc4a3('0x21')];_0x1d6cf5[_0xc4a3('0x5d')]=_0xb027dd['body'];_0x1d6cf5[_0xc4a3('0x5e')]=+new Date();var _0x215566='';var _0xab011c='';var _0x43fde1=Object[_0xc4a3('0x5f')](_0x1d6cf5);_0x43fde1[_0xc4a3('0x60')]();for(var _0x1705d7=0x0;_0x1705d7<_0x43fde1[_0xc4a3('0x61')];_0x1705d7++){if(_0x215566!=''){_0x215566+='&';}_0x215566+=_0x43fde1[_0x1705d7]+'='+encodeURIComponent(_0x1d6cf5[_0x43fde1[_0x1705d7]]);_0xab011c+=_0x1d6cf5[_0x43fde1[_0x1705d7]];}_0xab011c+=_0x43c437[_0xc4a3('0x5b')];_0xab011c=_0x542582[_0xc4a3('0x62')](_0xc4a3('0x63'))[_0xc4a3('0x18')](_0xab011c)['digest']('hex');if(_0x215566!==''){_0x215566+='&';}_0x215566+=_0xc4a3('0x64')+_0xab011c;var _0x34f6ad={'method':'GET','uri':_0x43c437[_0xc4a3('0x55')]+_0xc4a3('0x65')+_0x215566,'json':!![]};return rp(_0x34f6ad)[_0xc4a3('0x17')](function(_0x91450e){var _0x210495=Object[_0xc4a3('0x5f')](_0x91450e);if(_0x91450e[_0x210495[0x0]][_0xc4a3('0x1a')]&&parseInt(_0x91450e[_0x210495[0x0]][_0xc4a3('0x1a')])===0x0){var _0x1fc854={'messageId':_0x91450e[_0x210495[0x0]][_0xc4a3('0x66')]};if(!_0x43c437[_0xc4a3('0x39')]){_0x1fc854[_0xc4a3('0x3a')]=!![];}return _0x1693d1['update'](_0x1fc854);}else{return logger[_0xc4a3('0x1a')](_0xc4a3('0x2a'),_0xc4a3('0x28'),_0xc4a3('0x59'),util[_0xc4a3('0x29')](_0x91450e['error'],{'showHidden':![],'depth':null}));}})[_0xc4a3('0x27')](function(_0xb2fc98){return logger['error'](_0xc4a3('0x2a'),_0xc4a3('0x28'),_0xc4a3('0x59'),util[_0xc4a3('0x29')](_0xb2fc98,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc4a3('0x2a'),_0xc4a3('0x28'),_0xc4a3('0x59'),_0xc4a3('0x67'));}break;case _0xc4a3('0x68'):if(_0x43c437[_0xc4a3('0x5b')]){var _0x20f03b={'method':_0xc4a3('0x45'),'uri':_0xc4a3('0x69'),'headers':{'Authorization':_0x43c437[_0xc4a3('0x5b')]},'body':{'content':_0xb027dd['body'],'to':[_0xb027dd[_0xc4a3('0x21')]],'from':_0x43c437['phone'],'binary':![],'clientMessageId':'uuid','charset':'UTF-8'},'json':!![]};rp(_0x20f03b)['then'](function(_0x4f288a){if(!_0x4f288a[_0xc4a3('0x1a')]){var _0x297b2a={'messageId':_0x4f288a[_0xc4a3('0x4c')][0x0][_0xc4a3('0x6a')]};if(!_0x43c437['deliveryReport']){_0x297b2a[_0xc4a3('0x3a')]=!![];}return _0x1693d1[_0xc4a3('0x18')](_0x297b2a);}else{return logger[_0xc4a3('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc4a3('0x28'),_0xc4a3('0x68'),util[_0xc4a3('0x29')](_0x4f288a[_0xc4a3('0x1a')],{'showHidden':![],'depth':null}));}})[_0xc4a3('0x27')](function(_0x912d2e){return logger[_0xc4a3('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xc4a3('0x68'),util['inspect'](_0x912d2e,{'showHidden':![],'depth':null}));});}else{logger[_0xc4a3('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc4a3('0x28'),_0xc4a3('0x68'),'Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x43c437[_0xc4a3('0x2d')]&&_0x43c437[_0xc4a3('0x2e')]){var _0x21e4a8=util['format'](_0xc4a3('0x44'),_0x43c437['username'],_0x43c437['password']);var _0x2125ac={'method':_0xc4a3('0x45'),'uri':_0xc4a3('0x6b')+_0x43c437['accountId']+_0xc4a3('0x6c'),'body':{'to':[_0xb027dd[_0xc4a3('0x21')]],'text':_0xb027dd[_0xc4a3('0xb')],'from':_0x43c437[_0xc4a3('0x21')],'applicationId':_0x43c437['applicationId']},'headers':{'Authorization':util[_0xc4a3('0x43')](_0xc4a3('0x46'),new Buffer(_0x21e4a8)['toString'](_0xc4a3('0x52')))},'json':!![]};rp(_0x2125ac)['then'](function(_0xfa70f5){if(_0xfa70f5['id']){var _0x30d6c7={'messageId':_0xfa70f5['id']};return _0x1693d1[_0xc4a3('0x18')](_0x30d6c7);}else{logger[_0xc4a3('0x1a')](_0xc4a3('0x2a'),_0xc4a3('0x28'),_0xc4a3('0x6d'),util[_0xc4a3('0x29')](_0xfa70f5,{'showHidden':![],'depth':null}));}})[_0xc4a3('0x27')](function(_0x24da24){logger['error'](_0xc4a3('0x2a'),_0xc4a3('0x28'),_0xc4a3('0x6d'),util[_0xc4a3('0x29')](_0x24da24,{'showHidden':![],'depth':null}));});}else{logger[_0xc4a3('0x1a')](_0xc4a3('0x2a'),'afterCreate','bandwidth',_0xc4a3('0x3c'));}break;case _0xc4a3('0x6e'):if(_0x43c437[_0xc4a3('0x5b')]){var _0x499b59={};var _0x34f6ad={'method':_0xc4a3('0x45'),'uri':_0xc4a3('0x6f'),'headers':{'Authorization':_0xc4a3('0x70')+_0x43c437[_0xc4a3('0x5b')],'Content-Type':_0xc4a3('0x71')},'body':{'from':_0x43c437[_0xc4a3('0x21')],'to':_0xb027dd[_0xc4a3('0x21')],'text':_0xb027dd[_0xc4a3('0xb')]},'json':!![]};return rp(_0x34f6ad)[_0xc4a3('0x17')](function(_0x463392){if(_0x463392['code']==0xca){_0x499b59[_0xc4a3('0x72')]=_0x463392;var _0x5f3670={'method':'POST','uri':_0xc4a3('0x73'),'headers':{'Authorization':_0xc4a3('0x70')+_0x43c437[_0xc4a3('0x5b')],'Content-Type':_0xc4a3('0x71')},'body':{'refid':_0x499b59[_0xc4a3('0x72')][_0xc4a3('0x74')]},'json':!![]};return rp(_0x5f3670)[_0xc4a3('0x17')](function(_0x48289a){_0x499b59[_0xc4a3('0x75')]=_0x48289a;var _0x30b388={'messageId':_0x499b59[_0xc4a3('0x72')][_0xc4a3('0x74')],'read':!![]};return _0x1693d1[_0xc4a3('0x18')](_0x30b388);});}else{return logger[_0xc4a3('0x1a')](_0xc4a3('0x2a'),'afterCreate',_0xc4a3('0x6e'),util[_0xc4a3('0x29')](_0x463392,{'showHidden':![],'depth':null}));}})[_0xc4a3('0x27')](function(_0x184197){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc4a3('0x28'),_0xc4a3('0x6e'),util[_0xc4a3('0x29')](_0x184197,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xc4a3('0x2a'),_0xc4a3('0x28'),_0xc4a3('0x6e'),_0xc4a3('0x76'));}break;}}})[_0xc4a3('0x77')](function(){_0x4e05d3();});}else{_0x4e05d3();}}},'charset':_0xc4a3('0x78'),'collate':_0xc4a3('0x79')});};
\ No newline at end of file
index f6fc5fd..8b1c8f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8f1=['register','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateSmsMessage','SmsMessage','body','options','raw','stringify','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket'];(function(_0x25dcf9,_0x1e6f9e){var _0x14ec9e=function(_0x556895){while(--_0x556895){_0x25dcf9['push'](_0x25dcf9['shift']());}};_0x14ec9e(++_0x1e6f9e);}(_0xc8f1,0x89));var _0x1c8f=function(_0x161146,_0x3d73bc){_0x161146=_0x161146-0x0;var _0x3407ea=_0xc8f1[_0x161146];return _0x3407ea;};'use strict';var _=require(_0x1c8f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1c8f('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1c8f('0x2'))['db'];var utils=require(_0x1c8f('0x3'));var logger=require(_0x1c8f('0x4'))(_0x1c8f('0x5'));var config=require('../../config/environment');var jayson=require(_0x1c8f('0x6'));var client=jayson[_0x1c8f('0x7')]['http']({'port':0x232a});config[_0x1c8f('0x8')]=_[_0x1c8f('0x9')](config[_0x1c8f('0x8')],{'host':_0x1c8f('0xa'),'port':0x18eb});var socket=require(_0x1c8f('0xb'))(new Redis(config['redis']));require(_0x1c8f('0xc'))[_0x1c8f('0xd')](socket);function respondWithRpcPromise(_0x32e439,_0x5375d3,_0x273e74){return new BPromise(function(_0x13ab9d,_0x44c33a){return client['request'](_0x32e439,_0x273e74)[_0x1c8f('0xe')](function(_0x32b8b2){logger[_0x1c8f('0xf')](_0x1c8f('0x10'),_0x5375d3,'request\x20sent');logger[_0x1c8f('0x11')](_0x1c8f('0x12'),_0x5375d3,_0x1c8f('0x13'),JSON['stringify'](_0x32b8b2));if(_0x32b8b2[_0x1c8f('0x14')]){if(_0x32b8b2['error']['code']===0x1f4){logger[_0x1c8f('0x14')]('SmsMessage,\x20%s,\x20%s',_0x5375d3,_0x32b8b2[_0x1c8f('0x14')][_0x1c8f('0x15')]);return _0x44c33a(_0x32b8b2[_0x1c8f('0x14')][_0x1c8f('0x15')]);}logger[_0x1c8f('0x14')]('SmsMessage,\x20%s,\x20%s',_0x5375d3,_0x32b8b2['error'][_0x1c8f('0x15')]);return _0x13ab9d(_0x32b8b2['error']['message']);}else{logger[_0x1c8f('0xf')](_0x1c8f('0x10'),_0x5375d3,_0x1c8f('0x13'));_0x13ab9d(_0x32b8b2[_0x1c8f('0x16')]['message']);}})[_0x1c8f('0x17')](function(_0x41195f){logger[_0x1c8f('0x14')]('SmsMessage,\x20%s,\x20%s',_0x5375d3,_0x41195f);_0x44c33a(_0x41195f);});});}exports[_0x1c8f('0x18')]=function(_0x48697e){var _0x48fc0b=this;return new Promise(function(_0xa63e0e,_0x408d92){return db[_0x1c8f('0x19')]['create'](_0x48697e[_0x1c8f('0x1a')],{'raw':_0x48697e[_0x1c8f('0x1b')]?_0x48697e[_0x1c8f('0x1b')][_0x1c8f('0x1c')]===undefined?!![]:![]:!![]})[_0x1c8f('0xe')](function(_0x3f458d){logger['info'](_0x1c8f('0x18'),_0x48697e);logger[_0x1c8f('0x11')](_0x1c8f('0x18'),_0x48697e,JSON[_0x1c8f('0x1d')](_0x3f458d));_0xa63e0e(_0x3f458d);})[_0x1c8f('0x17')](function(_0x2c3ea1){logger[_0x1c8f('0x14')]('CreateSmsMessage',_0x2c3ea1[_0x1c8f('0x15')],_0x48697e);_0x408d92(_0x48fc0b['error'](0x1f4,_0x2c3ea1[_0x1c8f('0x15')]));});});};
\ No newline at end of file
+var _0x6b2a=['SmsMessage','create','options','raw','then','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','request','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','CreateSmsMessage'];(function(_0x1020f8,_0x139ab0){var _0x3613cd=function(_0x331038){while(--_0x331038){_0x1020f8['push'](_0x1020f8['shift']());}};_0x3613cd(++_0x139ab0);}(_0x6b2a,0xd2));var _0xa6b2=function(_0x19c1f0,_0x137494){_0x19c1f0=_0x19c1f0-0x0;var _0x43c4ec=_0x6b2a[_0x19c1f0];return _0x43c4ec;};'use strict';var _=require(_0xa6b2('0x0'));var util=require(_0xa6b2('0x1'));var moment=require('moment');var BPromise=require(_0xa6b2('0x2'));var rs=require(_0xa6b2('0x3'));var fs=require('fs');var Redis=require(_0xa6b2('0x4'));var db=require(_0xa6b2('0x5'))['db'];var utils=require(_0xa6b2('0x6'));var logger=require('../../config/logger')(_0xa6b2('0x7'));var config=require(_0xa6b2('0x8'));var jayson=require(_0xa6b2('0x9'));var client=jayson[_0xa6b2('0xa')]['http']({'port':0x232a});config[_0xa6b2('0xb')]=_[_0xa6b2('0xc')](config['redis'],{'host':_0xa6b2('0xd'),'port':0x18eb});var socket=require(_0xa6b2('0xe'))(new Redis(config[_0xa6b2('0xb')]));require(_0xa6b2('0xf'))['register'](socket);function respondWithRpcPromise(_0x434066,_0x59889f,_0x5c0ea0){return new BPromise(function(_0x543591,_0x143efa){return client[_0xa6b2('0x10')](_0x434066,_0x5c0ea0)['then'](function(_0x28683c){logger[_0xa6b2('0x11')]('SmsMessage,\x20%s,\x20%s',_0x59889f,_0xa6b2('0x12'));logger[_0xa6b2('0x13')](_0xa6b2('0x14'),_0x59889f,'request\x20sent',JSON['stringify'](_0x28683c));if(_0x28683c[_0xa6b2('0x15')]){if(_0x28683c[_0xa6b2('0x15')][_0xa6b2('0x16')]===0x1f4){logger[_0xa6b2('0x15')](_0xa6b2('0x17'),_0x59889f,_0x28683c[_0xa6b2('0x15')]['message']);return _0x143efa(_0x28683c[_0xa6b2('0x15')][_0xa6b2('0x18')]);}logger[_0xa6b2('0x15')](_0xa6b2('0x17'),_0x59889f,_0x28683c[_0xa6b2('0x15')][_0xa6b2('0x18')]);return _0x543591(_0x28683c[_0xa6b2('0x15')][_0xa6b2('0x18')]);}else{logger[_0xa6b2('0x11')](_0xa6b2('0x17'),_0x59889f,_0xa6b2('0x12'));_0x543591(_0x28683c[_0xa6b2('0x19')][_0xa6b2('0x18')]);}})[_0xa6b2('0x1a')](function(_0x1d43bd){logger['error'](_0xa6b2('0x17'),_0x59889f,_0x1d43bd);_0x143efa(_0x1d43bd);});});}exports[_0xa6b2('0x1b')]=function(_0x43da3b){var _0x35c51b=this;return new Promise(function(_0x39db83,_0x27a5fd){return db[_0xa6b2('0x1c')][_0xa6b2('0x1d')](_0x43da3b['body'],{'raw':_0x43da3b[_0xa6b2('0x1e')]?_0x43da3b['options'][_0xa6b2('0x1f')]===undefined?!![]:![]:!![]})[_0xa6b2('0x20')](function(_0x4bf49c){logger[_0xa6b2('0x11')]('CreateSmsMessage',_0x43da3b);logger['debug'](_0xa6b2('0x1b'),_0x43da3b,JSON[_0xa6b2('0x21')](_0x4bf49c));_0x39db83(_0x4bf49c);})[_0xa6b2('0x1a')](function(_0x2aac74){logger[_0xa6b2('0x15')]('CreateSmsMessage',_0x2aac74[_0xa6b2('0x18')],_0x43da3b);_0x27a5fd(_0x35c51b[_0xa6b2('0x15')](0x1f4,_0x2aac74[_0xa6b2('0x18')]));});});};
\ No newline at end of file
index f84e505..e2272a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fa6=['smsMessage:','./smsMessage.events','save','remove','update','removeListener','length'];(function(_0x5bd1a9,_0x313714){var _0x2ba345=function(_0x21b4af){while(--_0x21b4af){_0x5bd1a9['push'](_0x5bd1a9['shift']());}};_0x2ba345(++_0x313714);}(_0x8fa6,0xef));var _0x68fa=function(_0x486d51,_0x433a67){_0x486d51=_0x486d51-0x0;var _0x407b10=_0x8fa6[_0x486d51];return _0x407b10;};'use strict';var SmsMessageEvents=require(_0x68fa('0x0'));var events=[_0x68fa('0x1'),_0x68fa('0x2'),_0x68fa('0x3')];function createListener(_0x11da63,_0x55e561){return function(_0x17b0f1){_0x55e561['emit'](_0x11da63,_0x17b0f1);};}function removeListener(_0x44247b,_0x506dca){return function(){SmsMessageEvents[_0x68fa('0x4')](_0x44247b,_0x506dca);};}exports['register']=function(_0x37e4b2){for(var _0x4edf52=0x0,_0x5f3ea4=events[_0x68fa('0x5')];_0x4edf52<_0x5f3ea4;_0x4edf52++){var _0x9c9e5=events[_0x4edf52];var _0xf94f1c=createListener(_0x68fa('0x6')+_0x9c9e5,_0x37e4b2);SmsMessageEvents['on'](_0x9c9e5,_0xf94f1c);}};
\ No newline at end of file
+var _0x9751=['update','emit','register','length','./smsMessage.events'];(function(_0x2a7c05,_0x12fd15){var _0x364c63=function(_0x3b21da){while(--_0x3b21da){_0x2a7c05['push'](_0x2a7c05['shift']());}};_0x364c63(++_0x12fd15);}(_0x9751,0xcc));var _0x1975=function(_0x189b3b,_0x484de8){_0x189b3b=_0x189b3b-0x0;var _0x7c4721=_0x9751[_0x189b3b];return _0x7c4721;};'use strict';var SmsMessageEvents=require(_0x1975('0x0'));var events=['save','remove',_0x1975('0x1')];function createListener(_0x406569,_0x5cb591){return function(_0x49b657){_0x5cb591[_0x1975('0x2')](_0x406569,_0x49b657);};}function removeListener(_0x5db8d7,_0x44de64){return function(){SmsMessageEvents['removeListener'](_0x5db8d7,_0x44de64);};}exports[_0x1975('0x3')]=function(_0x554bc2){for(var _0x1ff587=0x0,_0x1f1762=events[_0x1975('0x4')];_0x1ff587<_0x1f1762;_0x1ff587++){var _0x2790b7=events[_0x1ff587];var _0xad8375=createListener('smsMessage:'+_0x2790b7,_0x554bc2);SmsMessageEvents['on'](_0x2790b7,_0xad8375);}};
\ No newline at end of file
index cab5a02..606b112 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7f8=['path','express','Router','fs-extra','../../components/auth/service','./smsQueue.controller','get','isAuthenticated','index','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','util'];(function(_0x4c2cd2,_0x280f2a){var _0x28fc7a=function(_0x4f96c1){while(--_0x4f96c1){_0x4c2cd2['push'](_0x4c2cd2['shift']());}};_0x28fc7a(++_0x280f2a);}(_0xb7f8,0x16b));var _0x8b7f=function(_0x4806e8,_0x2b3232){_0x4806e8=_0x4806e8-0x0;var _0x17d0f2=_0xb7f8[_0x4806e8];return _0x17d0f2;};'use strict';var multer=require('multer');var util=require(_0x8b7f('0x0'));var path=require(_0x8b7f('0x1'));var timeout=require('connect-timeout');var express=require(_0x8b7f('0x2'));var router=express[_0x8b7f('0x3')]();var fs_extra=require(_0x8b7f('0x4'));var auth=require(_0x8b7f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8b7f('0x6'));router[_0x8b7f('0x7')]('/',auth[_0x8b7f('0x8')](),controller[_0x8b7f('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x8b7f('0x7')](_0x8b7f('0xa'),auth['isAuthenticated'](),controller[_0x8b7f('0xb')]);router['get'](_0x8b7f('0xc'),auth[_0x8b7f('0x8')](),controller['getMembers']);router[_0x8b7f('0x7')](_0x8b7f('0xd'),auth[_0x8b7f('0x8')](),controller[_0x8b7f('0xe')]);router[_0x8b7f('0x7')](_0x8b7f('0xf'),auth[_0x8b7f('0x8')](),controller[_0x8b7f('0x10')]);router[_0x8b7f('0x11')]('/',auth[_0x8b7f('0x8')](),controller[_0x8b7f('0x12')]);router[_0x8b7f('0x11')](_0x8b7f('0xd'),auth[_0x8b7f('0x8')](),controller[_0x8b7f('0x13')]);router[_0x8b7f('0x11')](_0x8b7f('0xf'),auth[_0x8b7f('0x8')](),controller[_0x8b7f('0x14')]);router[_0x8b7f('0x15')](_0x8b7f('0xa'),auth['isAuthenticated'](),controller[_0x8b7f('0x16')]);router[_0x8b7f('0x17')](_0x8b7f('0xa'),auth['isAuthenticated'](),controller[_0x8b7f('0x18')]);router[_0x8b7f('0x17')]('/:id/teams',auth[_0x8b7f('0x8')](),controller[_0x8b7f('0x19')]);router[_0x8b7f('0x17')](_0x8b7f('0xf'),auth[_0x8b7f('0x8')](),controller[_0x8b7f('0x1a')]);module[_0x8b7f('0x1b')]=router;
\ No newline at end of file
+var _0x783c=['removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','/describe','isAuthenticated','/:id','show','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addAgents','delete'];(function(_0x5ebc04,_0x14a363){var _0x17845c=function(_0x360850){while(--_0x360850){_0x5ebc04['push'](_0x5ebc04['shift']());}};_0x17845c(++_0x14a363);}(_0x783c,0xa5));var _0xc783=function(_0x35bec6,_0x29b392){_0x35bec6=_0x35bec6-0x0;var _0x5ea7de=_0x783c[_0x35bec6];return _0x5ea7de;};'use strict';var multer=require(_0xc783('0x0'));var util=require(_0xc783('0x1'));var path=require(_0xc783('0x2'));var timeout=require(_0xc783('0x3'));var express=require(_0xc783('0x4'));var router=express[_0xc783('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc783('0x6'));var interaction=require(_0xc783('0x7'));var config=require(_0xc783('0x8'));var controller=require(_0xc783('0x9'));router[_0xc783('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc783('0xb'),auth[_0xc783('0xc')](),controller['describe']);router[_0xc783('0xa')](_0xc783('0xd'),auth[_0xc783('0xc')](),controller[_0xc783('0xe')]);router['get']('/:id/members',auth[_0xc783('0xc')](),controller[_0xc783('0xf')]);router[_0xc783('0xa')]('/:id/teams',auth['isAuthenticated'](),controller[_0xc783('0x10')]);router[_0xc783('0xa')](_0xc783('0x11'),auth[_0xc783('0xc')](),controller[_0xc783('0x12')]);router[_0xc783('0x13')]('/',auth[_0xc783('0xc')](),controller[_0xc783('0x14')]);router[_0xc783('0x13')](_0xc783('0x15'),auth[_0xc783('0xc')](),controller['addTeams']);router[_0xc783('0x13')]('/:id/users',auth[_0xc783('0xc')](),controller[_0xc783('0x16')]);router['put'](_0xc783('0xd'),auth[_0xc783('0xc')](),controller['update']);router[_0xc783('0x17')](_0xc783('0xd'),auth[_0xc783('0xc')](),controller['destroy']);router[_0xc783('0x17')]('/:id/teams',auth['isAuthenticated'](),controller[_0xc783('0x18')]);router[_0xc783('0x17')](_0xc783('0x11'),auth[_0xc783('0xc')](),controller[_0xc783('0x19')]);module[_0xc783('0x1a')]=router;
\ No newline at end of file
index 39aa784..5e8fa7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2af=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x3f94f9,_0x42774b){var _0x46f84f=function(_0xa080d8){while(--_0xa080d8){_0x3f94f9['push'](_0x3f94f9['shift']());}};_0x46f84f(++_0x42774b);}(_0xd2af,0x6a));var _0xfd2a=function(_0x2891d1,_0x2ddd3e){_0x2891d1=_0x2891d1-0x0;var _0x486948=_0xd2af[_0x2891d1];return _0x486948;};'use strict';var Sequelize=require(_0xfd2a('0x0'));module[_0xfd2a('0x1')]={'name':{'type':Sequelize[_0xfd2a('0x2')],'unique':_0xfd2a('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfd2a('0x2')]},'timeout':{'type':Sequelize[_0xfd2a('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfd2a('0x5')]('rrmemory','beepall',_0xfd2a('0x6'))}};
\ No newline at end of file
+var _0xfc20=['ENUM','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x478e09,_0xdbb31d){var _0x12aacc=function(_0x402b83){while(--_0x402b83){_0x478e09['push'](_0x478e09['shift']());}};_0x12aacc(++_0xdbb31d);}(_0xfc20,0x1a7));var _0x0fc2=function(_0x31850d,_0x1a4660){_0x31850d=_0x31850d-0x0;var _0x29d6e7=_0xfc20[_0x31850d];return _0x29d6e7;};'use strict';var Sequelize=require(_0x0fc2('0x0'));module[_0x0fc2('0x1')]={'name':{'type':Sequelize[_0x0fc2('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0fc2('0x3')]('rrmemory',_0x0fc2('0x4'),_0x0fc2('0x5'))}};
\ No newline at end of file
index 964f84c..2432a8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4219=['findAll','rows','catch','show','keys','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','error','params','describe','getMembers','findOne','hasOwnProperty','nolimit','order','SmsQueueId','User','findAndCountAll','UserId','smsPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','voicePause','interface','flatMap','Agents','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','every','TeamId','includes','union','compact','value','transaction','ids','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','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','defaults','redis','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x3d093c,_0x191518){var _0x12e14e=function(_0x58f0ac){while(--_0x58f0ac){_0x3d093c['push'](_0x3d093c['shift']());}};_0x12e14e(++_0x191518);}(_0x4219,0xdc));var _0x9421=function(_0x3798e0,_0x35573f){_0x3798e0=_0x3798e0-0x0;var _0x21dbd2=_0x4219[_0x3798e0];return _0x21dbd2;};'use strict';var emlformat=require(_0x9421('0x0'));var rimraf=require(_0x9421('0x1'));var zipdir=require(_0x9421('0x2'));var jsonpatch=require(_0x9421('0x3'));var rp=require(_0x9421('0x4'));var moment=require(_0x9421('0x5'));var BPromise=require(_0x9421('0x6'));var Mustache=require(_0x9421('0x7'));var util=require(_0x9421('0x8'));var path=require(_0x9421('0x9'));var sox=require(_0x9421('0xa'));var csv=require(_0x9421('0xb'));var ejs=require(_0x9421('0xc'));var fs=require('fs');var fs_extra=require(_0x9421('0xd'));var _=require(_0x9421('0xe'));var squel=require(_0x9421('0xf'));var crypto=require(_0x9421('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x9421('0x11'));var toCsv=require(_0x9421('0xb'));var querystring=require(_0x9421('0x12'));var Papa=require(_0x9421('0x13'));var Redis=require(_0x9421('0x14'));var authService=require(_0x9421('0x15'));var qs=require(_0x9421('0x16'));var as=require(_0x9421('0x17'));var hardwareService=require(_0x9421('0x18'));var logger=require(_0x9421('0x19'))('api');var utils=require(_0x9421('0x1a'));var config=require(_0x9421('0x1b'));var licenseUtil=require(_0x9421('0x1c'));var db=require(_0x9421('0x1d'))['db'];config['redis']=_[_0x9421('0x1e')](config[_0x9421('0x1f')],{'host':'localhost','port':0x18eb});var socket=require(_0x9421('0x20'))(new Redis(config[_0x9421('0x1f')]));require(_0x9421('0x21'))[_0x9421('0x22')](socket);function respondWithStatusCode(_0xac7e3,_0x40c3fd){_0x40c3fd=_0x40c3fd||0xcc;return function(_0x351224){if(_0x351224){return _0xac7e3[_0x9421('0x23')](_0x40c3fd);}return _0xac7e3[_0x9421('0x24')](_0x40c3fd)[_0x9421('0x25')]();};}function respondWithResult(_0x2bf6dd,_0xce05c7){_0xce05c7=_0xce05c7||0xc8;return function(_0x53c9cf){if(_0x53c9cf){return _0x2bf6dd[_0x9421('0x24')](_0xce05c7)[_0x9421('0x26')](_0x53c9cf);}};}function respondWithFilteredResult(_0x5b7e98,_0x3452ce){return function(_0x4fd677){if(_0x4fd677){var _0x2144fc=typeof _0x3452ce[_0x9421('0x27')]===_0x9421('0x28')&&typeof _0x3452ce[_0x9421('0x29')]==='undefined';var _0x5987c2=_0x4fd677[_0x9421('0x2a')];var _0x2c0d76=_0x2144fc?0x0:_0x3452ce[_0x9421('0x27')];var _0xb9126f=_0x2144fc?_0x4fd677[_0x9421('0x2a')]:_0x3452ce[_0x9421('0x27')]+_0x3452ce[_0x9421('0x29')];var _0x6f5f05;if(_0xb9126f>=_0x5987c2){_0xb9126f=_0x5987c2;_0x6f5f05=0xc8;}else{_0x6f5f05=0xce;}_0x5b7e98['status'](_0x6f5f05);return _0x5b7e98['set'](_0x9421('0x2b'),_0x2c0d76+'-'+_0xb9126f+'/'+_0x5987c2)[_0x9421('0x26')](_0x4fd677);}return null;};}function patchUpdates(_0x43a264){return function(_0x3c505d){try{jsonpatch['apply'](_0x3c505d,_0x43a264,!![]);}catch(_0x2abc74){return BPromise[_0x9421('0x2c')](_0x2abc74);}return _0x3c505d[_0x9421('0x2d')]();};}function saveUpdates(_0x5d7335,_0x5bcf8b){return function(_0x5755c6){if(_0x5755c6){return _0x5755c6[_0x9421('0x2e')](_0x5d7335)[_0x9421('0x2f')](function(_0x3a1c47){return _0x3a1c47;});}return null;};}function removeEntity(_0x1f2414,_0x464a94){return function(_0x2ce99e){if(_0x2ce99e){return _0x2ce99e[_0x9421('0x30')]()[_0x9421('0x2f')](function(){var _0x4bcfe7=_0x2ce99e[_0x9421('0x31')]({'plain':!![]});var _0x5ce6cf=_0x9421('0x32');return db[_0x9421('0x33')][_0x9421('0x30')]({'where':{'type':_0x5ce6cf,'resourceId':_0x4bcfe7['id']}})[_0x9421('0x2f')](function(){return _0x2ce99e;});})['then'](function(){_0x1f2414[_0x9421('0x24')](0xcc)[_0x9421('0x25')]();});}};}function handleEntityNotFound(_0x457c51,_0xcb80ae){return function(_0x50ecb9){if(!_0x50ecb9){_0x457c51[_0x9421('0x23')](0x194);}return _0x50ecb9;};}function handleError(_0xd498a7,_0x216c24){_0x216c24=_0x216c24||0x1f4;return function(_0x667678){logger['error'](_0x667678['stack']);if(_0x667678[_0x9421('0x34')]){delete _0x667678['name'];}_0xd498a7[_0x9421('0x24')](_0x216c24)[_0x9421('0x35')](_0x667678);};}exports[_0x9421('0x36')]=function(_0x2fa6d0,_0x3247af){var _0x5665e3={},_0x588098={},_0x532368={'count':0x0,'rows':[]};var _0x152271=_[_0x9421('0x37')](db[_0x9421('0x38')][_0x9421('0x39')],function(_0xfe63b1){return{'name':_0xfe63b1[_0x9421('0x3a')],'type':_0xfe63b1[_0x9421('0x3b')]['key']};});_0x588098['model']=_[_0x9421('0x37')](_0x152271,_0x9421('0x34'));_0x588098[_0x9421('0x3c')]=_['keys'](_0x2fa6d0['query']);_0x588098[_0x9421('0x3d')]=_[_0x9421('0x3e')](_0x588098[_0x9421('0x3f')],_0x588098[_0x9421('0x3c')]);_0x5665e3[_0x9421('0x40')]=_[_0x9421('0x3e')](_0x588098['model'],qs['fields'](_0x2fa6d0[_0x9421('0x3c')][_0x9421('0x41')]));_0x5665e3[_0x9421('0x40')]=_0x5665e3['attributes'][_0x9421('0x42')]?_0x5665e3[_0x9421('0x40')]:_0x588098[_0x9421('0x3f')];if(!_0x2fa6d0[_0x9421('0x3c')]['hasOwnProperty']('nolimit')){_0x5665e3['limit']=qs[_0x9421('0x29')](_0x2fa6d0[_0x9421('0x3c')][_0x9421('0x29')]);_0x5665e3[_0x9421('0x27')]=qs[_0x9421('0x27')](_0x2fa6d0[_0x9421('0x3c')][_0x9421('0x27')]);}_0x5665e3['order']=qs[_0x9421('0x43')](_0x2fa6d0[_0x9421('0x3c')][_0x9421('0x43')]);_0x5665e3[_0x9421('0x44')]=qs[_0x9421('0x3d')](_[_0x9421('0x45')](_0x2fa6d0[_0x9421('0x3c')],_0x588098['filters']),_0x152271);if(_0x2fa6d0['query'][_0x9421('0x46')]){_0x5665e3[_0x9421('0x44')]=_[_0x9421('0x47')](_0x5665e3[_0x9421('0x44')],{'$or':_[_0x9421('0x37')](_0x152271,function(_0x1d5d5a){if(_0x1d5d5a[_0x9421('0x3b')]!==_0x9421('0x48')){var _0x17849e={};_0x17849e[_0x1d5d5a['name']]={'$like':'%'+_0x2fa6d0[_0x9421('0x3c')][_0x9421('0x46')]+'%'};return _0x17849e;}})});}_0x5665e3=_[_0x9421('0x47')]({},_0x5665e3,_0x2fa6d0[_0x9421('0x49')]);var _0x5254c3={'where':_0x5665e3['where']};return db['SmsQueue'][_0x9421('0x2a')](_0x5254c3)[_0x9421('0x2f')](function(_0x2d3108){_0x532368[_0x9421('0x2a')]=_0x2d3108;if(_0x2fa6d0[_0x9421('0x3c')]['includeAll']){_0x5665e3['include']=[{'all':!![]}];}return db[_0x9421('0x38')][_0x9421('0x4a')](_0x5665e3);})[_0x9421('0x2f')](function(_0x45d8bc){_0x532368[_0x9421('0x4b')]=_0x45d8bc;return _0x532368;})[_0x9421('0x2f')](respondWithFilteredResult(_0x3247af,_0x5665e3))[_0x9421('0x4c')](handleError(_0x3247af,null));};exports[_0x9421('0x4d')]=function(_0x20b6d3,_0x1f790b){var _0x36c303={'raw':!![],'where':{'id':_0x20b6d3['params']['id']}},_0x57eaa3={};_0x57eaa3[_0x9421('0x3f')]=_['keys'](db[_0x9421('0x38')][_0x9421('0x39')]);_0x57eaa3[_0x9421('0x3c')]=_[_0x9421('0x4e')](_0x20b6d3[_0x9421('0x3c')]);_0x57eaa3['filters']=_[_0x9421('0x3e')](_0x57eaa3[_0x9421('0x3f')],_0x57eaa3[_0x9421('0x3c')]);_0x36c303[_0x9421('0x40')]=_[_0x9421('0x3e')](_0x57eaa3[_0x9421('0x3f')],qs['fields'](_0x20b6d3[_0x9421('0x3c')][_0x9421('0x41')]));_0x36c303['attributes']=_0x36c303['attributes'][_0x9421('0x42')]?_0x36c303[_0x9421('0x40')]:_0x57eaa3['model'];if(_0x20b6d3[_0x9421('0x3c')][_0x9421('0x4f')]){_0x36c303['include']=[{'all':!![]}];}_0x36c303=_[_0x9421('0x47')]({},_0x36c303,_0x20b6d3[_0x9421('0x49')]);return db[_0x9421('0x38')]['find'](_0x36c303)[_0x9421('0x2f')](handleEntityNotFound(_0x1f790b,null))['then'](respondWithResult(_0x1f790b,null))[_0x9421('0x4c')](handleError(_0x1f790b,null));};exports[_0x9421('0x50')]=function(_0x2da340,_0xaa617f){return db[_0x9421('0x38')]['create'](_0x2da340[_0x9421('0x51')],{})['then'](function(_0x2c74b4){var _0x3c22f8=_0x2da340[_0x9421('0x52')][_0x9421('0x31')]({'plain':!![]});if(!_0x3c22f8)throw new Error(_0x9421('0x53'));if(_0x3c22f8['role']===_0x9421('0x52')){var _0x4056e9=_0x2c74b4[_0x9421('0x31')]({'plain':!![]});var _0x5b6fa7=_0x9421('0x32');return db[_0x9421('0x54')][_0x9421('0x55')]({'where':{'name':_0x5b6fa7,'userProfileId':_0x3c22f8[_0x9421('0x56')]},'raw':!![]})[_0x9421('0x2f')](function(_0xf4fb53){if(_0xf4fb53&&_0xf4fb53[_0x9421('0x57')]===0x0){return db[_0x9421('0x33')][_0x9421('0x50')]({'name':_0x4056e9[_0x9421('0x34')],'resourceId':_0x4056e9['id'],'type':_0xf4fb53[_0x9421('0x34')],'sectionId':_0xf4fb53['id']},{})[_0x9421('0x2f')](function(){return _0x2c74b4;});}else{return _0x2c74b4;}})['catch'](function(_0x31a1e7){logger[_0x9421('0x58')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31a1e7);throw _0x31a1e7;});}return _0x2c74b4;})[_0x9421('0x2f')](respondWithResult(_0xaa617f,0xc9))[_0x9421('0x4c')](handleError(_0xaa617f,null));};exports['update']=function(_0x53c57f,_0xc16d62){if(_0x53c57f['body']['id']){delete _0x53c57f[_0x9421('0x51')]['id'];}return db[_0x9421('0x38')][_0x9421('0x55')]({'where':{'id':_0x53c57f['params']['id']}})['then'](handleEntityNotFound(_0xc16d62,null))[_0x9421('0x2f')](saveUpdates(_0x53c57f['body'],null))[_0x9421('0x2f')](respondWithResult(_0xc16d62,null))[_0x9421('0x4c')](handleError(_0xc16d62,null));};exports[_0x9421('0x30')]=function(_0x4381de,_0x51a79f){return db[_0x9421('0x38')]['find']({'where':{'id':_0x4381de[_0x9421('0x59')]['id']}})['then'](handleEntityNotFound(_0x51a79f,null))['then'](removeEntity(_0x51a79f,null))[_0x9421('0x4c')](handleError(_0x51a79f,null));};exports[_0x9421('0x5a')]=function(_0x55e490,_0x2cbd2d){return db[_0x9421('0x38')][_0x9421('0x5a')]()[_0x9421('0x2f')](respondWithResult(_0x2cbd2d,null))[_0x9421('0x4c')](handleError(_0x2cbd2d,null));};exports[_0x9421('0x5b')]=function(_0x3927e4,_0x1c93ad,_0xefb4c7){var _0x77ca5d={'raw':!![],'where':{}},_0x521dfb={},_0x2c0a88;return db[_0x9421('0x38')][_0x9421('0x5c')]({'where':{'id':_0x3927e4[_0x9421('0x59')]['id']}})['then'](handleEntityNotFound(_0x1c93ad,null))['then'](function(_0x5b8e8f){if(_0x5b8e8f){_0x2c0a88=_0x5b8e8f[_0x9421('0x31')]({'plain':!![]});_0x521dfb['model']=_[_0x9421('0x4e')](db['UserSmsQueue']['rawAttributes']);_0x521dfb[_0x9421('0x3c')]=_[_0x9421('0x4e')](_0x3927e4[_0x9421('0x3c')]);_0x521dfb[_0x9421('0x3d')]=_[_0x9421('0x3e')](_0x521dfb['model'],_0x521dfb[_0x9421('0x3c')]);_0x77ca5d[_0x9421('0x40')]=_[_0x9421('0x3e')](_0x521dfb[_0x9421('0x3f')],qs[_0x9421('0x41')](_0x3927e4['query'][_0x9421('0x41')]));_0x77ca5d[_0x9421('0x40')]=_0x77ca5d['attributes'][_0x9421('0x42')]?_0x77ca5d[_0x9421('0x40')]:_0x521dfb[_0x9421('0x3f')];if(!_0x3927e4[_0x9421('0x3c')][_0x9421('0x5d')](_0x9421('0x5e'))){_0x77ca5d[_0x9421('0x29')]=qs[_0x9421('0x29')](_0x3927e4[_0x9421('0x3c')][_0x9421('0x29')]);_0x77ca5d[_0x9421('0x27')]=qs['offset'](_0x3927e4['query'][_0x9421('0x27')]);}_0x77ca5d[_0x9421('0x5f')]=qs[_0x9421('0x43')](_0x3927e4[_0x9421('0x3c')][_0x9421('0x43')]);_0x77ca5d[_0x9421('0x44')]=qs[_0x9421('0x3d')](_[_0x9421('0x45')](_0x3927e4[_0x9421('0x3c')],_0x521dfb[_0x9421('0x3d')]));_0x77ca5d[_0x9421('0x44')][_0x9421('0x60')]=_0x5b8e8f['id'];if(_0x3927e4[_0x9421('0x3c')][_0x9421('0x46')]){_0x77ca5d[_0x9421('0x44')]=_[_0x9421('0x47')](_0x77ca5d[_0x9421('0x44')],{'$or':_[_0x9421('0x37')](_0x77ca5d['attributes'],function(_0x4d7521){var _0x628ceb={};_0x628ceb[_0x4d7521]={'$like':'%'+_0x3927e4[_0x9421('0x3c')][_0x9421('0x46')]+'%'};return _0x628ceb;})});}_0x77ca5d=_[_0x9421('0x47')]({},_0x77ca5d,_0x3927e4[_0x9421('0x49')]);return db['UserSmsQueue'][_0x9421('0x4a')](_0x77ca5d);}})[_0x9421('0x2f')](function(_0x58de3b){if(_0x58de3b){return db[_0x9421('0x61')][_0x9421('0x62')]({'where':{'id':_[_0x9421('0x37')](_0x58de3b,_0x9421('0x63')),'role':'agent'},'attributes':['id',_0x9421('0x34'),_0x9421('0x64'),_0x9421('0x65'),_0x9421('0x66')]});}})[_0x9421('0x2f')](function(_0x19c441){if(_0x19c441){return{'count':_0x19c441[_0x9421('0x2a')],'rows':_[_0x9421('0x37')](_0x19c441['rows'],function(_0x385fea){return{'membername':_0x385fea['name'],'UserId':_0x385fea['id'],'queue_name':_0x2c0a88[_0x9421('0x34')],'SmsQueueId':_0x2c0a88['id'],'interface':util[_0x9421('0x67')]('%s/%s',_0x9421('0x68'),_0x385fea[_0x9421('0x34')]),'penalty':0x0,'paused':_0x385fea[_0x9421('0x64')],'createdAt':_0x385fea[_0x9421('0x66')],'updatedAt':_0x385fea['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x9421('0x2f')](respondWithFilteredResult(_0x1c93ad,_0x77ca5d))['catch'](handleError(_0x1c93ad,null));};exports[_0x9421('0x69')]=function(_0x2f4a34,_0x4c73b1,_0x328614){var _0x2fe14d={};var _0x2d2515={};var _0x4783a1;var _0x546ecb;return db[_0x9421('0x38')][_0x9421('0x5c')]({'where':{'id':_0x2f4a34[_0x9421('0x59')]['id']}})[_0x9421('0x2f')](handleEntityNotFound(_0x4c73b1,null))['then'](function(_0x425040){if(_0x425040){_0x4783a1=_0x425040;_0x2d2515[_0x9421('0x3f')]=_[_0x9421('0x4e')](db[_0x9421('0x6a')]['rawAttributes']);_0x2d2515[_0x9421('0x3c')]=_[_0x9421('0x4e')](_0x2f4a34[_0x9421('0x3c')]);_0x2d2515[_0x9421('0x3d')]=_[_0x9421('0x3e')](_0x2d2515[_0x9421('0x3f')],_0x2d2515['query']);_0x2fe14d[_0x9421('0x40')]=_[_0x9421('0x3e')](_0x2d2515[_0x9421('0x3f')],qs[_0x9421('0x41')](_0x2f4a34[_0x9421('0x3c')][_0x9421('0x41')]));_0x2fe14d[_0x9421('0x40')]=_0x2fe14d[_0x9421('0x40')][_0x9421('0x42')]?_0x2fe14d[_0x9421('0x40')]:_0x2d2515[_0x9421('0x3f')];_0x2fe14d[_0x9421('0x5f')]=qs[_0x9421('0x43')](_0x2f4a34[_0x9421('0x3c')][_0x9421('0x43')]);_0x2fe14d[_0x9421('0x44')]=qs[_0x9421('0x3d')](_['pick'](_0x2f4a34[_0x9421('0x3c')],_0x2d2515[_0x9421('0x3d')]));if(_0x2f4a34[_0x9421('0x3c')][_0x9421('0x46')]){_0x2fe14d[_0x9421('0x44')]=_[_0x9421('0x47')](_0x2fe14d[_0x9421('0x44')],{'$or':_[_0x9421('0x37')](_0x2fe14d[_0x9421('0x40')],function(_0x5dc86c){var _0x404f24={};_0x404f24[_0x5dc86c]={'$like':'%'+_0x2f4a34['query'][_0x9421('0x46')]+'%'};return _0x404f24;})});}_0x2fe14d=_[_0x9421('0x47')]({},_0x2fe14d,_0x2f4a34[_0x9421('0x49')]);return _0x4783a1[_0x9421('0x69')](_0x2fe14d);}})[_0x9421('0x2f')](function(_0x42f177){if(_0x42f177){_0x546ecb=_0x42f177[_0x9421('0x42')];if(!_0x2f4a34['query']['hasOwnProperty'](_0x9421('0x5e'))){_0x2fe14d['limit']=qs[_0x9421('0x29')](_0x2f4a34[_0x9421('0x3c')][_0x9421('0x29')]);_0x2fe14d[_0x9421('0x27')]=qs[_0x9421('0x27')](_0x2f4a34[_0x9421('0x3c')][_0x9421('0x27')]);}return _0x4783a1['getTeams'](_0x2fe14d);}})[_0x9421('0x2f')](function(_0x5c2e6a){if(_0x5c2e6a){return _0x5c2e6a?{'count':_0x546ecb,'rows':_0x5c2e6a}:null;}})[_0x9421('0x2f')](respondWithResult(_0x4c73b1,null))['catch'](handleError(_0x4c73b1,null));};exports[_0x9421('0x6b')]=function(_0x336d52,_0x2c0684,_0x3056ea){var _0x336735=_0x336d52[_0x9421('0x51')]['ids'];return db[_0x9421('0x6a')]['findAll']({'where':{'id':_0x336735},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x9421('0x34'),'online',_0x9421('0x6c'),_0x9421('0x6d')],'raw':!![]}]})[_0x9421('0x2f')](function(_0x3fbc05){if(_0x3fbc05){var _0x3dfc3b=_[_0x9421('0x6e')](_0x3fbc05,function(_0x3bc8c2){var _0xb89c99=_0x3bc8c2[_0x9421('0x31')]({'plain':!![]});return _0xb89c99[_0x9421('0x6f')];});return db[_0x9421('0x38')][_0x9421('0x55')]({'where':{'id':_0x336d52[_0x9421('0x59')]['id']}})['then'](function(_0x1e8509){return db['sequelize']['transaction'](function(_0x25b186){return _0x1e8509[_0x9421('0x6b')](_0x336735,{'transaction':_0x25b186})[_0x9421('0x2f')](function(){return BPromise[_0x9421('0x70')](_0x3dfc3b,function(_0x3dd35f){return db['UserSmsQueue'][_0x9421('0x71')]({'where':{'UserId':_0x3dd35f['id'],'SmsQueueId':_0x336d52['params']['id']},'transaction':_0x25b186});});})[_0x9421('0x2f')](function(){_0x3dfc3b[_0x9421('0x72')](function(_0x1a5cf7){socket[_0x9421('0x73')](_0x9421('0x74'),{'UserId':_0x1a5cf7['id'],'SmsQueueId':_0x1e8509['id']});});});});});}})[_0x9421('0x2f')](respondWithStatusCode(_0x2c0684,null))['catch'](handleError(_0x2c0684,null));};exports[_0x9421('0x75')]=function(_0x1a17bb,_0x515fbe,_0x5c47e9){return db['Team']['findAll']({'where':{'id':_0x1a17bb[_0x9421('0x3c')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9421('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x9421('0x2f')](handleEntityNotFound(_0x515fbe,null))[_0x9421('0x2f')](function(_0x21d334){var _0x55ab73=_[_0x9421('0x37')](_0x21d334,'id');var _0x38e967=[];var _0x87c941=[];var _0x5dfa3a=squel['select']();_0x5dfa3a[_0x9421('0x76')](_0x9421('0x77'))[_0x9421('0x78')](_0x9421('0x79'),'tq')[_0x9421('0x7a')](_0x9421('0x7b'),'ut',_0x9421('0x7c'))[_0x9421('0x44')](_0x9421('0x7d'),_0x1a17bb[_0x9421('0x59')]['id']);for(var _0x282ce2=0x0;_0x282ce2<_0x21d334['length'];_0x282ce2+=0x1){let _0x468de7=_0x21d334[_0x282ce2];for(var _0x5b57b8=0x0;_0x5b57b8<_0x468de7[_0x9421('0x6f')]['length'];_0x5b57b8+=0x1){let _0x21d1e5=_0x468de7[_0x9421('0x6f')][_0x5b57b8];var _0xb8750=_0x5dfa3a[_0x9421('0x7e')]();_0xb8750[_0x9421('0x44')](_0x9421('0x7f'),_0x21d1e5['id']);_0x87c941[_0x9421('0x80')](db[_0x9421('0x81')]['query'](_0xb8750[_0x9421('0x82')](),{'type':db[_0x9421('0x81')]['QueryTypes']['SELECT']})['then'](function(_0x1b7072){if(_0x1b7072[_0x9421('0x42')]===0x1){return _0x21d1e5['id'];}else{var _0x441197=_[_0x9421('0x83')](_[_0x9421('0x37')](_0x1b7072,_0x9421('0x84')),function(_0xeb26ee){return _[_0x9421('0x85')](_0x55ab73,_0xeb26ee);});if(_0x441197){return _0x21d1e5['id'];}}}));}}return BPromise['all'](_0x87c941)['then'](function(_0x4cb015){_0x38e967=_(_0x38e967)[_0x9421('0x86')](_0x4cb015)[_0x9421('0x87')]()[_0x9421('0x88')]();return db[_0x9421('0x38')]['find']({'where':{'id':_0x1a17bb[_0x9421('0x59')]['id']}})[_0x9421('0x2f')](function(_0x275bf1){return db['sequelize'][_0x9421('0x89')](function(_0x34e988){return _0x275bf1['removeTeams'](_0x1a17bb[_0x9421('0x3c')][_0x9421('0x8a')],{'transaction':_0x34e988})[_0x9421('0x2f')](function(){if(!_[_0x9421('0x8b')](_0x38e967)){return _0x275bf1[_0x9421('0x8c')](_0x38e967,{'transaction':_0x34e988});}})[_0x9421('0x2f')](function(){_0x38e967[_0x9421('0x72')](function(_0xf07e7a){socket['emit'](_0x9421('0x8d'),{'UserId':_0xf07e7a,'SmsQueueId':_0x275bf1['id']});});});});});});})['then'](respondWithStatusCode(_0x515fbe,null))[_0x9421('0x4c')](handleError(_0x515fbe,null));};exports[_0x9421('0x8e')]=function(_0x427987,_0x5bbca2,_0x22266e){return db[_0x9421('0x38')][_0x9421('0x55')]({'where':{'id':_0x427987['params']['id']}})['then'](handleEntityNotFound(_0x5bbca2,null))['then'](function(_0x41a8dd){if(_0x41a8dd){return _0x41a8dd[_0x9421('0x8e')](_0x427987['body'][_0x9421('0x8a')],_[_0x9421('0x8f')](_0x427987[_0x9421('0x51')],[_0x9421('0x8a'),'id'])||{})[_0x9421('0x90')](function(_0x397d21){for(var _0x1814e3=0x0;_0x1814e3<_0x427987[_0x9421('0x51')][_0x9421('0x8a')]['length'];_0x1814e3+=0x1){socket[_0x9421('0x73')](_0x9421('0x74'),{'UserId':Number(_0x427987[_0x9421('0x51')][_0x9421('0x8a')][_0x1814e3]),'SmsQueueId':Number(_0x427987[_0x9421('0x59')]['id'])});}return _0x397d21;});}})['then'](respondWithResult(_0x5bbca2,null))[_0x9421('0x4c')](handleError(_0x5bbca2,null));};exports[_0x9421('0x8c')]=function(_0x4407ec,_0x3fa722,_0x3e4dfd){return db[_0x9421('0x38')][_0x9421('0x55')]({'where':{'id':_0x4407ec[_0x9421('0x59')]['id']}})[_0x9421('0x2f')](handleEntityNotFound(_0x3fa722,null))[_0x9421('0x2f')](function(_0x1c24b1){if(_0x1c24b1){return _0x1c24b1[_0x9421('0x8c')](_0x4407ec[_0x9421('0x3c')][_0x9421('0x8a')])[_0x9421('0x2f')](function(){if(_[_0x9421('0x91')](_0x4407ec['query'][_0x9421('0x8a')])){for(var _0x29f273=0x0;_0x29f273<_0x4407ec[_0x9421('0x3c')][_0x9421('0x8a')][_0x9421('0x42')];_0x29f273+=0x1){socket['emit'](_0x9421('0x8d'),{'UserId':Number(_0x4407ec['query']['ids'][_0x29f273]),'SmsQueueId':Number(_0x4407ec[_0x9421('0x59')]['id'])});}}else{socket[_0x9421('0x73')]('userSmsQueue:remove',{'UserId':Number(_0x4407ec[_0x9421('0x3c')][_0x9421('0x8a')]),'SmsQueueId':Number(_0x4407ec[_0x9421('0x59')]['id'])});}});}})[_0x9421('0x2f')](respondWithStatusCode(_0x3fa722,null))['catch'](handleError(_0x3fa722,null));};exports[_0x9421('0x92')]=function(_0x153b53,_0x1fb8f1,_0x851b5d){var _0x4c157c={};var _0x58f54b={};var _0x3d65a0;var _0x37dfc1;return db['SmsQueue'][_0x9421('0x5c')]({'where':{'id':_0x153b53['params']['id']}})['then'](handleEntityNotFound(_0x1fb8f1,null))[_0x9421('0x2f')](function(_0x28c22f){if(_0x28c22f){_0x3d65a0=_0x28c22f;_0x58f54b[_0x9421('0x3f')]=_[_0x9421('0x4e')](db[_0x9421('0x61')][_0x9421('0x39')]);_0x58f54b[_0x9421('0x3c')]=_[_0x9421('0x4e')](_0x153b53[_0x9421('0x3c')]);_0x58f54b[_0x9421('0x3d')]=_[_0x9421('0x3e')](_0x58f54b[_0x9421('0x3f')],_0x58f54b[_0x9421('0x3c')]);_0x4c157c[_0x9421('0x40')]=_[_0x9421('0x3e')](_0x58f54b[_0x9421('0x3f')],qs[_0x9421('0x41')](_0x153b53[_0x9421('0x3c')][_0x9421('0x41')]));_0x4c157c[_0x9421('0x40')]=_0x4c157c['attributes'][_0x9421('0x42')]?_0x4c157c[_0x9421('0x40')]:_0x58f54b[_0x9421('0x3f')];_0x4c157c[_0x9421('0x5f')]=qs[_0x9421('0x43')](_0x153b53[_0x9421('0x3c')][_0x9421('0x43')]);_0x4c157c[_0x9421('0x44')]=qs[_0x9421('0x3d')](_[_0x9421('0x45')](_0x153b53[_0x9421('0x3c')],_0x58f54b[_0x9421('0x3d')]));if(_0x153b53[_0x9421('0x3c')][_0x9421('0x46')]){_0x4c157c[_0x9421('0x44')]=_[_0x9421('0x47')](_0x4c157c['where'],{'$or':_['map'](_0x4c157c[_0x9421('0x40')],function(_0x137954){var _0x1f03af={};_0x1f03af[_0x137954]={'$like':'%'+_0x153b53['query'][_0x9421('0x46')]+'%'};return _0x1f03af;})});}_0x4c157c=_[_0x9421('0x47')]({},_0x4c157c,_0x153b53[_0x9421('0x49')]);return _0x3d65a0[_0x9421('0x92')](_0x4c157c);}})[_0x9421('0x2f')](function(_0x72b888){if(_0x72b888){_0x37dfc1=_0x72b888[_0x9421('0x42')];if(!_0x153b53['query'][_0x9421('0x5d')]('nolimit')){_0x4c157c['limit']=qs[_0x9421('0x29')](_0x153b53[_0x9421('0x3c')][_0x9421('0x29')]);_0x4c157c[_0x9421('0x27')]=qs[_0x9421('0x27')](_0x153b53[_0x9421('0x3c')][_0x9421('0x27')]);}return _0x3d65a0[_0x9421('0x92')](_0x4c157c);}})[_0x9421('0x2f')](function(_0x1977aa){if(_0x1977aa){return _0x1977aa?{'count':_0x37dfc1,'rows':_0x1977aa}:null;}})[_0x9421('0x2f')](respondWithResult(_0x1fb8f1,null))[_0x9421('0x4c')](handleError(_0x1fb8f1,null));};
\ No newline at end of file
+var _0xf835=['redis','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','SmsQueues','UserProfileResource','error','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','includeAll','include','rows','catch','show','length','options','create','body','user','UserProfileSection','find','params','describe','getMembers','findOne','UserSmsQueue','sort','SmsQueueId','findAll','findAndCountAll','UserId','updatedAt','createdAt','format','%s/%s','smsPause','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','forEach','emit','removeTeams','tq.TeamId','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','every','includes','all','union','compact','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','userSmsQueue:save','isArray','User','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','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'];(function(_0x3289e9,_0x789204){var _0x3715af=function(_0x57ccd4){while(--_0x57ccd4){_0x3289e9['push'](_0x3289e9['shift']());}};_0x3715af(++_0x789204);}(_0xf835,0x183));var _0x5f83=function(_0x3207fb,_0x3630b1){_0x3207fb=_0x3207fb-0x0;var _0x57ad61=_0xf835[_0x3207fb];return _0x57ad61;};'use strict';var emlformat=require(_0x5f83('0x0'));var rimraf=require(_0x5f83('0x1'));var zipdir=require(_0x5f83('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f83('0x3'));var moment=require(_0x5f83('0x4'));var BPromise=require(_0x5f83('0x5'));var Mustache=require(_0x5f83('0x6'));var util=require(_0x5f83('0x7'));var path=require(_0x5f83('0x8'));var sox=require(_0x5f83('0x9'));var csv=require(_0x5f83('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5f83('0xb'));var _=require('lodash');var squel=require(_0x5f83('0xc'));var crypto=require(_0x5f83('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5f83('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5f83('0xf'));var Papa=require(_0x5f83('0x10'));var Redis=require(_0x5f83('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5f83('0x12'));var as=require(_0x5f83('0x13'));var hardwareService=require(_0x5f83('0x14'));var logger=require(_0x5f83('0x15'))(_0x5f83('0x16'));var utils=require(_0x5f83('0x17'));var config=require(_0x5f83('0x18'));var licenseUtil=require(_0x5f83('0x19'));var db=require(_0x5f83('0x1a'))['db'];config[_0x5f83('0x1b')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5f83('0x1c'))(new Redis(config['redis']));require(_0x5f83('0x1d'))[_0x5f83('0x1e')](socket);function respondWithStatusCode(_0x564509,_0x30384b){_0x30384b=_0x30384b||0xcc;return function(_0x6c74ae){if(_0x6c74ae){return _0x564509[_0x5f83('0x1f')](_0x30384b);}return _0x564509[_0x5f83('0x20')](_0x30384b)[_0x5f83('0x21')]();};}function respondWithResult(_0x56f26c,_0x2ad361){_0x2ad361=_0x2ad361||0xc8;return function(_0x3ce422){if(_0x3ce422){return _0x56f26c[_0x5f83('0x20')](_0x2ad361)[_0x5f83('0x22')](_0x3ce422);}};}function respondWithFilteredResult(_0xdd5821,_0x3875d2){return function(_0x2d4765){if(_0x2d4765){var _0x2c942a=typeof _0x3875d2[_0x5f83('0x23')]===_0x5f83('0x24')&&typeof _0x3875d2[_0x5f83('0x25')]==='undefined';var _0x381c26=_0x2d4765[_0x5f83('0x26')];var _0x12c1f1=_0x2c942a?0x0:_0x3875d2[_0x5f83('0x23')];var _0x222a47=_0x2c942a?_0x2d4765['count']:_0x3875d2[_0x5f83('0x23')]+_0x3875d2[_0x5f83('0x25')];var _0x17be09;if(_0x222a47>=_0x381c26){_0x222a47=_0x381c26;_0x17be09=0xc8;}else{_0x17be09=0xce;}_0xdd5821[_0x5f83('0x20')](_0x17be09);return _0xdd5821[_0x5f83('0x27')](_0x5f83('0x28'),_0x12c1f1+'-'+_0x222a47+'/'+_0x381c26)[_0x5f83('0x22')](_0x2d4765);}return null;};}function patchUpdates(_0x4aebcf){return function(_0x4dd6d4){try{jsonpatch[_0x5f83('0x29')](_0x4dd6d4,_0x4aebcf,!![]);}catch(_0x563f8c){return BPromise[_0x5f83('0x2a')](_0x563f8c);}return _0x4dd6d4[_0x5f83('0x2b')]();};}function saveUpdates(_0x177e42,_0x3cc5af){return function(_0x2e4035){if(_0x2e4035){return _0x2e4035[_0x5f83('0x2c')](_0x177e42)['then'](function(_0x51d37d){return _0x51d37d;});}return null;};}function removeEntity(_0x3d7b3f,_0x3aed8b){return function(_0x594120){if(_0x594120){return _0x594120[_0x5f83('0x2d')]()[_0x5f83('0x2e')](function(){var _0x4ade95=_0x594120[_0x5f83('0x2f')]({'plain':!![]});var _0x38a2d7=_0x5f83('0x30');return db[_0x5f83('0x31')][_0x5f83('0x2d')]({'where':{'type':_0x38a2d7,'resourceId':_0x4ade95['id']}})['then'](function(){return _0x594120;});})['then'](function(){_0x3d7b3f[_0x5f83('0x20')](0xcc)[_0x5f83('0x21')]();});}};}function handleEntityNotFound(_0x1f4148,_0x8b71ad){return function(_0x3493a3){if(!_0x3493a3){_0x1f4148[_0x5f83('0x1f')](0x194);}return _0x3493a3;};}function handleError(_0x5edca8,_0x54fef2){_0x54fef2=_0x54fef2||0x1f4;return function(_0x4f1275){logger[_0x5f83('0x32')](_0x4f1275[_0x5f83('0x33')]);if(_0x4f1275[_0x5f83('0x34')]){delete _0x4f1275[_0x5f83('0x34')];}_0x5edca8['status'](_0x54fef2)[_0x5f83('0x35')](_0x4f1275);};}exports[_0x5f83('0x36')]=function(_0x4e005b,_0x397058){var _0x48b44e={},_0x204503={},_0x5979bf={'count':0x0,'rows':[]};var _0x71c478=_[_0x5f83('0x37')](db[_0x5f83('0x38')][_0x5f83('0x39')],function(_0x58aab0){return{'name':_0x58aab0[_0x5f83('0x3a')],'type':_0x58aab0[_0x5f83('0x3b')]['key']};});_0x204503[_0x5f83('0x3c')]=_['map'](_0x71c478,'name');_0x204503[_0x5f83('0x3d')]=_[_0x5f83('0x3e')](_0x4e005b[_0x5f83('0x3d')]);_0x204503['filters']=_['intersection'](_0x204503[_0x5f83('0x3c')],_0x204503[_0x5f83('0x3d')]);_0x48b44e[_0x5f83('0x3f')]=_[_0x5f83('0x40')](_0x204503['model'],qs[_0x5f83('0x41')](_0x4e005b['query'][_0x5f83('0x41')]));_0x48b44e['attributes']=_0x48b44e[_0x5f83('0x3f')]['length']?_0x48b44e['attributes']:_0x204503['model'];if(!_0x4e005b[_0x5f83('0x3d')][_0x5f83('0x42')](_0x5f83('0x43'))){_0x48b44e[_0x5f83('0x25')]=qs[_0x5f83('0x25')](_0x4e005b['query']['limit']);_0x48b44e[_0x5f83('0x23')]=qs[_0x5f83('0x23')](_0x4e005b[_0x5f83('0x3d')][_0x5f83('0x23')]);}_0x48b44e[_0x5f83('0x44')]=qs['sort'](_0x4e005b[_0x5f83('0x3d')]['sort']);_0x48b44e[_0x5f83('0x45')]=qs[_0x5f83('0x46')](_[_0x5f83('0x47')](_0x4e005b[_0x5f83('0x3d')],_0x204503[_0x5f83('0x46')]),_0x71c478);if(_0x4e005b[_0x5f83('0x3d')][_0x5f83('0x48')]){_0x48b44e[_0x5f83('0x45')]=_['merge'](_0x48b44e[_0x5f83('0x45')],{'$or':_['map'](_0x71c478,function(_0xf0ee5d){if(_0xf0ee5d[_0x5f83('0x3b')]!=='VIRTUAL'){var _0xfcfb4e={};_0xfcfb4e[_0xf0ee5d[_0x5f83('0x34')]]={'$like':'%'+_0x4e005b[_0x5f83('0x3d')]['filter']+'%'};return _0xfcfb4e;}})});}_0x48b44e=_[_0x5f83('0x49')]({},_0x48b44e,_0x4e005b['options']);var _0x20f4ad={'where':_0x48b44e[_0x5f83('0x45')]};return db[_0x5f83('0x38')]['count'](_0x20f4ad)['then'](function(_0x25bd48){_0x5979bf[_0x5f83('0x26')]=_0x25bd48;if(_0x4e005b[_0x5f83('0x3d')][_0x5f83('0x4a')]){_0x48b44e[_0x5f83('0x4b')]=[{'all':!![]}];}return db[_0x5f83('0x38')]['findAll'](_0x48b44e);})[_0x5f83('0x2e')](function(_0x5308c4){_0x5979bf[_0x5f83('0x4c')]=_0x5308c4;return _0x5979bf;})[_0x5f83('0x2e')](respondWithFilteredResult(_0x397058,_0x48b44e))[_0x5f83('0x4d')](handleError(_0x397058,null));};exports[_0x5f83('0x4e')]=function(_0x10b599,_0x5d8414){var _0x1b073f={'raw':!![],'where':{'id':_0x10b599['params']['id']}},_0x270440={};_0x270440['model']=_[_0x5f83('0x3e')](db[_0x5f83('0x38')]['rawAttributes']);_0x270440[_0x5f83('0x3d')]=_[_0x5f83('0x3e')](_0x10b599['query']);_0x270440[_0x5f83('0x46')]=_[_0x5f83('0x40')](_0x270440[_0x5f83('0x3c')],_0x270440[_0x5f83('0x3d')]);_0x1b073f[_0x5f83('0x3f')]=_[_0x5f83('0x40')](_0x270440['model'],qs[_0x5f83('0x41')](_0x10b599[_0x5f83('0x3d')][_0x5f83('0x41')]));_0x1b073f[_0x5f83('0x3f')]=_0x1b073f['attributes'][_0x5f83('0x4f')]?_0x1b073f[_0x5f83('0x3f')]:_0x270440['model'];if(_0x10b599[_0x5f83('0x3d')][_0x5f83('0x4a')]){_0x1b073f['include']=[{'all':!![]}];}_0x1b073f=_[_0x5f83('0x49')]({},_0x1b073f,_0x10b599[_0x5f83('0x50')]);return db[_0x5f83('0x38')]['find'](_0x1b073f)[_0x5f83('0x2e')](handleEntityNotFound(_0x5d8414,null))[_0x5f83('0x2e')](respondWithResult(_0x5d8414,null))['catch'](handleError(_0x5d8414,null));};exports[_0x5f83('0x51')]=function(_0x140d49,_0x3a08dd){return db[_0x5f83('0x38')]['create'](_0x140d49[_0x5f83('0x52')],{})['then'](function(_0x3a075b){var _0x50a10e=_0x140d49[_0x5f83('0x53')]['get']({'plain':!![]});if(!_0x50a10e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x50a10e['role']==='user'){var _0xd2b0a5=_0x3a075b['get']({'plain':!![]});var _0x51e729='SmsQueues';return db[_0x5f83('0x54')][_0x5f83('0x55')]({'where':{'name':_0x51e729,'userProfileId':_0x50a10e['userProfileId']},'raw':!![]})[_0x5f83('0x2e')](function(_0x2df941){if(_0x2df941&&_0x2df941['autoAssociation']===0x0){return db['UserProfileResource'][_0x5f83('0x51')]({'name':_0xd2b0a5[_0x5f83('0x34')],'resourceId':_0xd2b0a5['id'],'type':_0x2df941[_0x5f83('0x34')],'sectionId':_0x2df941['id']},{})['then'](function(){return _0x3a075b;});}else{return _0x3a075b;}})['catch'](function(_0x28981d){logger[_0x5f83('0x32')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28981d);throw _0x28981d;});}return _0x3a075b;})['then'](respondWithResult(_0x3a08dd,0xc9))[_0x5f83('0x4d')](handleError(_0x3a08dd,null));};exports[_0x5f83('0x2c')]=function(_0x173386,_0x2e031e){if(_0x173386[_0x5f83('0x52')]['id']){delete _0x173386[_0x5f83('0x52')]['id'];}return db[_0x5f83('0x38')][_0x5f83('0x55')]({'where':{'id':_0x173386[_0x5f83('0x56')]['id']}})['then'](handleEntityNotFound(_0x2e031e,null))[_0x5f83('0x2e')](saveUpdates(_0x173386[_0x5f83('0x52')],null))[_0x5f83('0x2e')](respondWithResult(_0x2e031e,null))[_0x5f83('0x4d')](handleError(_0x2e031e,null));};exports[_0x5f83('0x2d')]=function(_0x4d8880,_0x474489){return db[_0x5f83('0x38')]['find']({'where':{'id':_0x4d8880['params']['id']}})[_0x5f83('0x2e')](handleEntityNotFound(_0x474489,null))[_0x5f83('0x2e')](removeEntity(_0x474489,null))['catch'](handleError(_0x474489,null));};exports[_0x5f83('0x57')]=function(_0x408970,_0x170e9b){return db[_0x5f83('0x38')]['describe']()[_0x5f83('0x2e')](respondWithResult(_0x170e9b,null))[_0x5f83('0x4d')](handleError(_0x170e9b,null));};exports[_0x5f83('0x58')]=function(_0x113313,_0xf3310e,_0x311eb8){var _0x4bf30d={'raw':!![],'where':{}},_0x440b62={},_0x42ed74;return db[_0x5f83('0x38')][_0x5f83('0x59')]({'where':{'id':_0x113313[_0x5f83('0x56')]['id']}})[_0x5f83('0x2e')](handleEntityNotFound(_0xf3310e,null))['then'](function(_0x504478){if(_0x504478){_0x42ed74=_0x504478['get']({'plain':!![]});_0x440b62[_0x5f83('0x3c')]=_[_0x5f83('0x3e')](db[_0x5f83('0x5a')][_0x5f83('0x39')]);_0x440b62[_0x5f83('0x3d')]=_[_0x5f83('0x3e')](_0x113313[_0x5f83('0x3d')]);_0x440b62[_0x5f83('0x46')]=_[_0x5f83('0x40')](_0x440b62[_0x5f83('0x3c')],_0x440b62[_0x5f83('0x3d')]);_0x4bf30d[_0x5f83('0x3f')]=_[_0x5f83('0x40')](_0x440b62[_0x5f83('0x3c')],qs[_0x5f83('0x41')](_0x113313['query'][_0x5f83('0x41')]));_0x4bf30d[_0x5f83('0x3f')]=_0x4bf30d['attributes'][_0x5f83('0x4f')]?_0x4bf30d[_0x5f83('0x3f')]:_0x440b62[_0x5f83('0x3c')];if(!_0x113313[_0x5f83('0x3d')][_0x5f83('0x42')](_0x5f83('0x43'))){_0x4bf30d[_0x5f83('0x25')]=qs['limit'](_0x113313[_0x5f83('0x3d')][_0x5f83('0x25')]);_0x4bf30d[_0x5f83('0x23')]=qs[_0x5f83('0x23')](_0x113313[_0x5f83('0x3d')][_0x5f83('0x23')]);}_0x4bf30d[_0x5f83('0x44')]=qs[_0x5f83('0x5b')](_0x113313[_0x5f83('0x3d')][_0x5f83('0x5b')]);_0x4bf30d[_0x5f83('0x45')]=qs[_0x5f83('0x46')](_[_0x5f83('0x47')](_0x113313[_0x5f83('0x3d')],_0x440b62['filters']));_0x4bf30d[_0x5f83('0x45')][_0x5f83('0x5c')]=_0x504478['id'];if(_0x113313['query'][_0x5f83('0x48')]){_0x4bf30d[_0x5f83('0x45')]=_[_0x5f83('0x49')](_0x4bf30d['where'],{'$or':_[_0x5f83('0x37')](_0x4bf30d[_0x5f83('0x3f')],function(_0x435119){var _0x386045={};_0x386045[_0x435119]={'$like':'%'+_0x113313[_0x5f83('0x3d')][_0x5f83('0x48')]+'%'};return _0x386045;})});}_0x4bf30d=_[_0x5f83('0x49')]({},_0x4bf30d,_0x113313[_0x5f83('0x50')]);return db[_0x5f83('0x5a')][_0x5f83('0x5d')](_0x4bf30d);}})[_0x5f83('0x2e')](function(_0x3559be){if(_0x3559be){return db['User'][_0x5f83('0x5e')]({'where':{'id':_['map'](_0x3559be,_0x5f83('0x5f')),'role':'agent'},'attributes':['id',_0x5f83('0x34'),'smsPause',_0x5f83('0x60'),_0x5f83('0x61')]});}})['then'](function(_0x3405dc){if(_0x3405dc){return{'count':_0x3405dc['count'],'rows':_[_0x5f83('0x37')](_0x3405dc['rows'],function(_0x5d7e7c){return{'membername':_0x5d7e7c[_0x5f83('0x34')],'UserId':_0x5d7e7c['id'],'queue_name':_0x42ed74[_0x5f83('0x34')],'SmsQueueId':_0x42ed74['id'],'interface':util[_0x5f83('0x62')](_0x5f83('0x63'),'SIP',_0x5d7e7c[_0x5f83('0x34')]),'penalty':0x0,'paused':_0x5d7e7c[_0x5f83('0x64')],'createdAt':_0x5d7e7c[_0x5f83('0x61')],'updatedAt':_0x5d7e7c[_0x5f83('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5f83('0x2e')](respondWithFilteredResult(_0xf3310e,_0x4bf30d))[_0x5f83('0x4d')](handleError(_0xf3310e,null));};exports[_0x5f83('0x65')]=function(_0x2c43ca,_0x481be8,_0x4407bc){var _0x1bd981={};var _0x1dedce={};var _0x31e3a3;var _0x40a888;return db[_0x5f83('0x38')][_0x5f83('0x59')]({'where':{'id':_0x2c43ca[_0x5f83('0x56')]['id']}})[_0x5f83('0x2e')](handleEntityNotFound(_0x481be8,null))[_0x5f83('0x2e')](function(_0x477473){if(_0x477473){_0x31e3a3=_0x477473;_0x1dedce[_0x5f83('0x3c')]=_['keys'](db[_0x5f83('0x66')][_0x5f83('0x39')]);_0x1dedce[_0x5f83('0x3d')]=_[_0x5f83('0x3e')](_0x2c43ca['query']);_0x1dedce[_0x5f83('0x46')]=_[_0x5f83('0x40')](_0x1dedce[_0x5f83('0x3c')],_0x1dedce[_0x5f83('0x3d')]);_0x1bd981[_0x5f83('0x3f')]=_[_0x5f83('0x40')](_0x1dedce[_0x5f83('0x3c')],qs[_0x5f83('0x41')](_0x2c43ca[_0x5f83('0x3d')][_0x5f83('0x41')]));_0x1bd981[_0x5f83('0x3f')]=_0x1bd981[_0x5f83('0x3f')][_0x5f83('0x4f')]?_0x1bd981[_0x5f83('0x3f')]:_0x1dedce[_0x5f83('0x3c')];_0x1bd981[_0x5f83('0x44')]=qs[_0x5f83('0x5b')](_0x2c43ca['query'][_0x5f83('0x5b')]);_0x1bd981['where']=qs['filters'](_[_0x5f83('0x47')](_0x2c43ca['query'],_0x1dedce['filters']));if(_0x2c43ca[_0x5f83('0x3d')][_0x5f83('0x48')]){_0x1bd981[_0x5f83('0x45')]=_[_0x5f83('0x49')](_0x1bd981[_0x5f83('0x45')],{'$or':_[_0x5f83('0x37')](_0x1bd981[_0x5f83('0x3f')],function(_0x4d874a){var _0x2d4f2c={};_0x2d4f2c[_0x4d874a]={'$like':'%'+_0x2c43ca['query'][_0x5f83('0x48')]+'%'};return _0x2d4f2c;})});}_0x1bd981=_[_0x5f83('0x49')]({},_0x1bd981,_0x2c43ca[_0x5f83('0x50')]);return _0x31e3a3[_0x5f83('0x65')](_0x1bd981);}})[_0x5f83('0x2e')](function(_0x1b98aa){if(_0x1b98aa){_0x40a888=_0x1b98aa['length'];if(!_0x2c43ca[_0x5f83('0x3d')]['hasOwnProperty'](_0x5f83('0x43'))){_0x1bd981[_0x5f83('0x25')]=qs['limit'](_0x2c43ca[_0x5f83('0x3d')][_0x5f83('0x25')]);_0x1bd981[_0x5f83('0x23')]=qs['offset'](_0x2c43ca['query'][_0x5f83('0x23')]);}return _0x31e3a3['getTeams'](_0x1bd981);}})['then'](function(_0xd7eab4){if(_0xd7eab4){return _0xd7eab4?{'count':_0x40a888,'rows':_0xd7eab4}:null;}})[_0x5f83('0x2e')](respondWithResult(_0x481be8,null))[_0x5f83('0x4d')](handleError(_0x481be8,null));};exports[_0x5f83('0x67')]=function(_0x43daf5,_0x59ddb8,_0x52a2b2){var _0x5ede74=_0x43daf5['body'][_0x5f83('0x68')];return db[_0x5f83('0x66')][_0x5f83('0x5d')]({'where':{'id':_0x5ede74},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5f83('0x69'),'attributes':['id','name',_0x5f83('0x6a'),_0x5f83('0x6b'),'interface'],'raw':!![]}]})[_0x5f83('0x2e')](function(_0x3d8d40){if(_0x3d8d40){var _0xd80dee=_[_0x5f83('0x6c')](_0x3d8d40,function(_0x301f7c){var _0x20604b=_0x301f7c[_0x5f83('0x2f')]({'plain':!![]});return _0x20604b[_0x5f83('0x69')];});return db['SmsQueue'][_0x5f83('0x55')]({'where':{'id':_0x43daf5[_0x5f83('0x56')]['id']}})[_0x5f83('0x2e')](function(_0x3383f1){return db[_0x5f83('0x6d')][_0x5f83('0x6e')](function(_0x312a43){return _0x3383f1[_0x5f83('0x67')](_0x5ede74,{'transaction':_0x312a43})[_0x5f83('0x2e')](function(){return BPromise['each'](_0xd80dee,function(_0x18fde1){return db[_0x5f83('0x5a')]['findOrCreate']({'where':{'UserId':_0x18fde1['id'],'SmsQueueId':_0x43daf5[_0x5f83('0x56')]['id']},'transaction':_0x312a43});});})[_0x5f83('0x2e')](function(){_0xd80dee[_0x5f83('0x6f')](function(_0xd92c5b){socket[_0x5f83('0x70')]('userSmsQueue:save',{'UserId':_0xd92c5b['id'],'SmsQueueId':_0x3383f1['id']});});});});});}})[_0x5f83('0x2e')](respondWithStatusCode(_0x59ddb8,null))[_0x5f83('0x4d')](handleError(_0x59ddb8,null));};exports[_0x5f83('0x71')]=function(_0x5f5830,_0x1f22da,_0x5c8fb9){return db['Team'][_0x5f83('0x5d')]({'where':{'id':_0x5f5830['query'][_0x5f83('0x68')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5f83('0x69'),'attributes':['id'],'raw':!![]}]})[_0x5f83('0x2e')](handleEntityNotFound(_0x1f22da,null))[_0x5f83('0x2e')](function(_0x1ac8ae){var _0x3ddf34=_[_0x5f83('0x37')](_0x1ac8ae,'id');var _0x49b68e=[];var _0x16cdfc=[];var _0x3cd30c=squel['select']();_0x3cd30c['field'](_0x5f83('0x72'))[_0x5f83('0x73')](_0x5f83('0x74'),'tq')[_0x5f83('0x75')]('user_has_teams','ut',_0x5f83('0x76'))[_0x5f83('0x45')](_0x5f83('0x77'),_0x5f5830[_0x5f83('0x56')]['id']);for(var _0x5032e2=0x0;_0x5032e2<_0x1ac8ae['length'];_0x5032e2+=0x1){let _0x9016c9=_0x1ac8ae[_0x5032e2];for(var _0xa1d6ce=0x0;_0xa1d6ce<_0x9016c9['Agents'][_0x5f83('0x4f')];_0xa1d6ce+=0x1){let _0x18b22b=_0x9016c9[_0x5f83('0x69')][_0xa1d6ce];var _0x44d554=_0x3cd30c[_0x5f83('0x78')]();_0x44d554[_0x5f83('0x45')](_0x5f83('0x79'),_0x18b22b['id']);_0x16cdfc[_0x5f83('0x7a')](db[_0x5f83('0x6d')][_0x5f83('0x3d')](_0x44d554[_0x5f83('0x7b')](),{'type':db[_0x5f83('0x6d')]['QueryTypes']['SELECT']})['then'](function(_0x67bec){if(_0x67bec[_0x5f83('0x4f')]===0x1){return _0x18b22b['id'];}else{var _0x1d99fd=_[_0x5f83('0x7c')](_[_0x5f83('0x37')](_0x67bec,'TeamId'),function(_0x259648){return _[_0x5f83('0x7d')](_0x3ddf34,_0x259648);});if(_0x1d99fd){return _0x18b22b['id'];}}}));}}return BPromise[_0x5f83('0x7e')](_0x16cdfc)[_0x5f83('0x2e')](function(_0x565baa){_0x49b68e=_(_0x49b68e)[_0x5f83('0x7f')](_0x565baa)[_0x5f83('0x80')]()['value']();return db['SmsQueue'][_0x5f83('0x55')]({'where':{'id':_0x5f5830['params']['id']}})[_0x5f83('0x2e')](function(_0x11e5d4){return db[_0x5f83('0x6d')]['transaction'](function(_0x48de08){return _0x11e5d4['removeTeams'](_0x5f5830[_0x5f83('0x3d')][_0x5f83('0x68')],{'transaction':_0x48de08})['then'](function(){if(!_[_0x5f83('0x81')](_0x49b68e)){return _0x11e5d4[_0x5f83('0x82')](_0x49b68e,{'transaction':_0x48de08});}})[_0x5f83('0x2e')](function(){_0x49b68e[_0x5f83('0x6f')](function(_0x3f0c7e){socket['emit'](_0x5f83('0x83'),{'UserId':_0x3f0c7e,'SmsQueueId':_0x11e5d4['id']});});});});});});})[_0x5f83('0x2e')](respondWithStatusCode(_0x1f22da,null))[_0x5f83('0x4d')](handleError(_0x1f22da,null));};exports[_0x5f83('0x84')]=function(_0x3c0891,_0x55436,_0x37d710){return db[_0x5f83('0x38')][_0x5f83('0x55')]({'where':{'id':_0x3c0891[_0x5f83('0x56')]['id']}})[_0x5f83('0x2e')](handleEntityNotFound(_0x55436,null))['then'](function(_0xf1f789){if(_0xf1f789){return _0xf1f789[_0x5f83('0x84')](_0x3c0891['body'][_0x5f83('0x68')],_[_0x5f83('0x85')](_0x3c0891[_0x5f83('0x52')],[_0x5f83('0x68'),'id'])||{})['spread'](function(_0xa94e95){for(var _0x10eafa=0x0;_0x10eafa<_0x3c0891['body'][_0x5f83('0x68')][_0x5f83('0x4f')];_0x10eafa+=0x1){socket[_0x5f83('0x70')](_0x5f83('0x86'),{'UserId':Number(_0x3c0891[_0x5f83('0x52')]['ids'][_0x10eafa]),'SmsQueueId':Number(_0x3c0891[_0x5f83('0x56')]['id'])});}return _0xa94e95;});}})['then'](respondWithResult(_0x55436,null))['catch'](handleError(_0x55436,null));};exports['removeAgents']=function(_0x32e68c,_0x250995,_0x9ff6b6){return db[_0x5f83('0x38')]['find']({'where':{'id':_0x32e68c[_0x5f83('0x56')]['id']}})[_0x5f83('0x2e')](handleEntityNotFound(_0x250995,null))[_0x5f83('0x2e')](function(_0x35b2dc){if(_0x35b2dc){return _0x35b2dc[_0x5f83('0x82')](_0x32e68c['query'][_0x5f83('0x68')])[_0x5f83('0x2e')](function(){if(_[_0x5f83('0x87')](_0x32e68c[_0x5f83('0x3d')][_0x5f83('0x68')])){for(var _0x2eeb36=0x0;_0x2eeb36<_0x32e68c[_0x5f83('0x3d')][_0x5f83('0x68')][_0x5f83('0x4f')];_0x2eeb36+=0x1){socket['emit'](_0x5f83('0x83'),{'UserId':Number(_0x32e68c[_0x5f83('0x3d')]['ids'][_0x2eeb36]),'SmsQueueId':Number(_0x32e68c['params']['id'])});}}else{socket[_0x5f83('0x70')](_0x5f83('0x83'),{'UserId':Number(_0x32e68c[_0x5f83('0x3d')][_0x5f83('0x68')]),'SmsQueueId':Number(_0x32e68c['params']['id'])});}});}})[_0x5f83('0x2e')](respondWithStatusCode(_0x250995,null))[_0x5f83('0x4d')](handleError(_0x250995,null));};exports['getAgents']=function(_0x558b88,_0x536359,_0x521f5e){var _0x4972b4={};var _0x6115b9={};var _0x4b4a1e;var _0x1e7cd3;return db[_0x5f83('0x38')][_0x5f83('0x59')]({'where':{'id':_0x558b88[_0x5f83('0x56')]['id']}})[_0x5f83('0x2e')](handleEntityNotFound(_0x536359,null))[_0x5f83('0x2e')](function(_0x397209){if(_0x397209){_0x4b4a1e=_0x397209;_0x6115b9[_0x5f83('0x3c')]=_[_0x5f83('0x3e')](db[_0x5f83('0x88')][_0x5f83('0x39')]);_0x6115b9[_0x5f83('0x3d')]=_[_0x5f83('0x3e')](_0x558b88[_0x5f83('0x3d')]);_0x6115b9[_0x5f83('0x46')]=_[_0x5f83('0x40')](_0x6115b9[_0x5f83('0x3c')],_0x6115b9[_0x5f83('0x3d')]);_0x4972b4['attributes']=_['intersection'](_0x6115b9[_0x5f83('0x3c')],qs[_0x5f83('0x41')](_0x558b88[_0x5f83('0x3d')][_0x5f83('0x41')]));_0x4972b4[_0x5f83('0x3f')]=_0x4972b4[_0x5f83('0x3f')][_0x5f83('0x4f')]?_0x4972b4[_0x5f83('0x3f')]:_0x6115b9[_0x5f83('0x3c')];_0x4972b4[_0x5f83('0x44')]=qs[_0x5f83('0x5b')](_0x558b88[_0x5f83('0x3d')][_0x5f83('0x5b')]);_0x4972b4[_0x5f83('0x45')]=qs[_0x5f83('0x46')](_[_0x5f83('0x47')](_0x558b88[_0x5f83('0x3d')],_0x6115b9[_0x5f83('0x46')]));if(_0x558b88[_0x5f83('0x3d')][_0x5f83('0x48')]){_0x4972b4[_0x5f83('0x45')]=_[_0x5f83('0x49')](_0x4972b4['where'],{'$or':_[_0x5f83('0x37')](_0x4972b4['attributes'],function(_0x3c6d19){var _0x231dab={};_0x231dab[_0x3c6d19]={'$like':'%'+_0x558b88[_0x5f83('0x3d')][_0x5f83('0x48')]+'%'};return _0x231dab;})});}_0x4972b4=_[_0x5f83('0x49')]({},_0x4972b4,_0x558b88[_0x5f83('0x50')]);return _0x4b4a1e[_0x5f83('0x89')](_0x4972b4);}})[_0x5f83('0x2e')](function(_0x29aeb2){if(_0x29aeb2){_0x1e7cd3=_0x29aeb2[_0x5f83('0x4f')];if(!_0x558b88[_0x5f83('0x3d')][_0x5f83('0x42')](_0x5f83('0x43'))){_0x4972b4[_0x5f83('0x25')]=qs[_0x5f83('0x25')](_0x558b88[_0x5f83('0x3d')][_0x5f83('0x25')]);_0x4972b4[_0x5f83('0x23')]=qs[_0x5f83('0x23')](_0x558b88[_0x5f83('0x3d')]['offset']);}return _0x4b4a1e[_0x5f83('0x89')](_0x4972b4);}})[_0x5f83('0x2e')](function(_0x274455){if(_0x274455){return _0x274455?{'count':_0x1e7cd3,'rows':_0x274455}:null;}})[_0x5f83('0x2e')](respondWithResult(_0x536359,null))[_0x5f83('0x4d')](handleError(_0x536359,null));};
\ No newline at end of file
index 02a227f..0f18365 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8504=['exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x1404c9,_0x41f8b0){var _0x24f6b2=function(_0x4dadac){while(--_0x4dadac){_0x1404c9['push'](_0x1404c9['shift']());}};_0x24f6b2(++_0x41f8b0);}(_0x8504,0x156));var _0x4850=function(_0x5cbbeb,_0x142ebc){_0x5cbbeb=_0x5cbbeb-0x0;var _0x4cf278=_0x8504[_0x5cbbeb];return _0x4cf278;};'use strict';var EventEmitter=require(_0x4850('0x0'));var SmsQueue=require(_0x4850('0x1'))['db'][_0x4850('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x4850('0x3')](0x0);var events={'afterCreate':_0x4850('0x4'),'afterUpdate':_0x4850('0x5'),'afterDestroy':_0x4850('0x6')};function emitEvent(_0x357d3b){return function(_0x20a8cd,_0x402a28,_0x516835){SmsQueueEvents[_0x4850('0x7')](_0x357d3b+':'+_0x20a8cd['id'],_0x20a8cd);SmsQueueEvents[_0x4850('0x7')](_0x357d3b,_0x20a8cd);_0x516835(null);};}for(var e in events){if(events[_0x4850('0x8')](e)){var event=events[e];SmsQueue[_0x4850('0x9')](e,emitEvent(event));}}module[_0x4850('0xa')]=SmsQueueEvents;
\ No newline at end of file
+var _0x7702=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners'];(function(_0x444c16,_0x2f13a1){var _0x54570c=function(_0x2eec14){while(--_0x2eec14){_0x444c16['push'](_0x444c16['shift']());}};_0x54570c(++_0x2f13a1);}(_0x7702,0xf9));var _0x2770=function(_0x2637eb,_0x36403d){_0x2637eb=_0x2637eb-0x0;var _0x53b9ee=_0x7702[_0x2637eb];return _0x53b9ee;};'use strict';var EventEmitter=require(_0x2770('0x0'));var SmsQueue=require(_0x2770('0x1'))['db'][_0x2770('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x2770('0x3')](0x0);var events={'afterCreate':_0x2770('0x4'),'afterUpdate':_0x2770('0x5'),'afterDestroy':_0x2770('0x6')};function emitEvent(_0x755a15){return function(_0x575926,_0x45c5fa,_0x4280b2){SmsQueueEvents[_0x2770('0x7')](_0x755a15+':'+_0x575926['id'],_0x575926);SmsQueueEvents[_0x2770('0x7')](_0x755a15,_0x575926);_0x4280b2(null);};}for(var e in events){if(events[_0x2770('0x8')](e)){var event=events[e];SmsQueue[_0x2770('0x9')](e,emitEvent(event));}}module[_0x2770('0xa')]=SmsQueueEvents;
\ No newline at end of file
index 5f8f4fb..85dd239 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3899=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','define','SmsQueue','sms_queues','lodash','util'];(function(_0x3ed1f3,_0x3b98a0){var _0x2d97ad=function(_0x19c5df){while(--_0x19c5df){_0x3ed1f3['push'](_0x3ed1f3['shift']());}};_0x2d97ad(++_0x3b98a0);}(_0x3899,0x16a));var _0x9389=function(_0x152ff3,_0x262a31){_0x152ff3=_0x152ff3-0x0;var _0x3798a1=_0x3899[_0x152ff3];return _0x3798a1;};'use strict';var _=require(_0x9389('0x0'));var util=require(_0x9389('0x1'));var logger=require(_0x9389('0x2'))(_0x9389('0x3'));var moment=require(_0x9389('0x4'));var BPromise=require(_0x9389('0x5'));var rp=require(_0x9389('0x6'));var fs=require('fs');var path=require(_0x9389('0x7'));var rimraf=require(_0x9389('0x8'));var config=require(_0x9389('0x9'));var attributes=require(_0x9389('0xa'));module['exports']=function(_0x3ad06a,_0x322ad4){return _0x3ad06a[_0x9389('0xb')](_0x9389('0xc'),attributes,{'tableName':_0x9389('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5ef4=['moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueue.attributes','exports','SmsQueue','sms_queues','lodash','util','../../config/logger','api'];(function(_0x2ea2e7,_0x234b23){var _0x3bfeab=function(_0x31d114){while(--_0x31d114){_0x2ea2e7['push'](_0x2ea2e7['shift']());}};_0x3bfeab(++_0x234b23);}(_0x5ef4,0x18f));var _0x45ef=function(_0x337a85,_0x445e5a){_0x337a85=_0x337a85-0x0;var _0x25e167=_0x5ef4[_0x337a85];return _0x25e167;};'use strict';var _=require(_0x45ef('0x0'));var util=require(_0x45ef('0x1'));var logger=require(_0x45ef('0x2'))(_0x45ef('0x3'));var moment=require(_0x45ef('0x4'));var BPromise=require(_0x45ef('0x5'));var rp=require(_0x45ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x45ef('0x7'));var config=require(_0x45ef('0x8'));var attributes=require(_0x45ef('0x9'));module[_0x45ef('0xa')]=function(_0x5da516,_0x25f4a9){return _0x5da516['define'](_0x45ef('0xb'),attributes,{'tableName':_0x45ef('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cc4e4cb..5c55941 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe404=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','GetSmsQueue','SmsQueue','findAll','options','raw','include','map','model','attributes','stringify','ShowSmsQueue'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0xe404,0x1d4));var _0x4e40=function(_0x6df6c6,_0x1d1751){_0x6df6c6=_0x6df6c6-0x0;var _0x3439ee=_0xe404[_0x6df6c6];return _0x3439ee;};'use strict';var _=require(_0x4e40('0x0'));var util=require(_0x4e40('0x1'));var moment=require(_0x4e40('0x2'));var BPromise=require(_0x4e40('0x3'));var rs=require(_0x4e40('0x4'));var fs=require('fs');var Redis=require(_0x4e40('0x5'));var db=require(_0x4e40('0x6'))['db'];var utils=require(_0x4e40('0x7'));var logger=require(_0x4e40('0x8'))(_0x4e40('0x9'));var config=require(_0x4e40('0xa'));var jayson=require(_0x4e40('0xb'));var client=jayson[_0x4e40('0xc')][_0x4e40('0xd')]({'port':0x232a});config[_0x4e40('0xe')]=_[_0x4e40('0xf')](config[_0x4e40('0xe')],{'host':_0x4e40('0x10'),'port':0x18eb});var socket=require(_0x4e40('0x11'))(new Redis(config[_0x4e40('0xe')]));require(_0x4e40('0x12'))[_0x4e40('0x13')](socket);function respondWithRpcPromise(_0x30c8d5,_0x1a901e,_0x2e713e){return new BPromise(function(_0x23ff59,_0x55b38d){return client['request'](_0x30c8d5,_0x2e713e)[_0x4e40('0x14')](function(_0x35a584){logger[_0x4e40('0x15')](_0x4e40('0x16'),_0x1a901e,_0x4e40('0x17'));logger[_0x4e40('0x18')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x1a901e,_0x4e40('0x17'),JSON['stringify'](_0x35a584));if(_0x35a584[_0x4e40('0x19')]){if(_0x35a584[_0x4e40('0x19')]['code']===0x1f4){logger[_0x4e40('0x19')]('SmsQueue,\x20%s,\x20%s',_0x1a901e,_0x35a584[_0x4e40('0x19')][_0x4e40('0x1a')]);return _0x55b38d(_0x35a584[_0x4e40('0x19')][_0x4e40('0x1a')]);}logger['error'](_0x4e40('0x16'),_0x1a901e,_0x35a584[_0x4e40('0x19')][_0x4e40('0x1a')]);return _0x23ff59(_0x35a584[_0x4e40('0x19')][_0x4e40('0x1a')]);}else{logger[_0x4e40('0x15')](_0x4e40('0x16'),_0x1a901e,_0x4e40('0x17'));_0x23ff59(_0x35a584[_0x4e40('0x1b')][_0x4e40('0x1a')]);}})['catch'](function(_0x24c0d7){logger[_0x4e40('0x19')](_0x4e40('0x16'),_0x1a901e,_0x24c0d7);_0x55b38d(_0x24c0d7);});});}exports[_0x4e40('0x1c')]=function(_0x1ff641){var _0xee8dd9=this;return new Promise(function(_0x5dec98,_0x28cbd9){return db[_0x4e40('0x1d')][_0x4e40('0x1e')]({'raw':_0x1ff641[_0x4e40('0x1f')]?_0x1ff641[_0x4e40('0x1f')][_0x4e40('0x20')]===undefined?!![]:![]:!![],'where':_0x1ff641[_0x4e40('0x1f')]?_0x1ff641[_0x4e40('0x1f')]['where']||null:null,'attributes':_0x1ff641[_0x4e40('0x1f')]?_0x1ff641['options']['attributes']||null:null,'limit':_0x1ff641[_0x4e40('0x1f')]?_0x1ff641[_0x4e40('0x1f')]['limit']||null:null,'include':_0x1ff641[_0x4e40('0x1f')]?_0x1ff641[_0x4e40('0x1f')][_0x4e40('0x21')]?_[_0x4e40('0x22')](_0x1ff641[_0x4e40('0x1f')][_0x4e40('0x21')],function(_0x37af6b){return{'model':db[_0x37af6b[_0x4e40('0x23')]],'as':_0x37af6b['as'],'attributes':_0x37af6b['attributes'],'include':_0x37af6b['include']?_[_0x4e40('0x22')](_0x37af6b[_0x4e40('0x21')],function(_0x3891d2){return{'model':db[_0x3891d2[_0x4e40('0x23')]],'as':_0x3891d2['as'],'attributes':_0x3891d2[_0x4e40('0x24')],'include':_0x3891d2[_0x4e40('0x21')]?_[_0x4e40('0x22')](_0x3891d2[_0x4e40('0x21')],function(_0xf7f819){return{'model':db[_0xf7f819[_0x4e40('0x23')]],'as':_0xf7f819['as'],'attributes':_0xf7f819[_0x4e40('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x197551){logger['info'](_0x4e40('0x1c'),_0x1ff641);logger['debug'](_0x4e40('0x1c'),_0x1ff641,JSON[_0x4e40('0x25')](_0x197551));_0x5dec98(_0x197551);})['catch'](function(_0x293fbe){logger[_0x4e40('0x19')](_0x4e40('0x1c'),_0x293fbe[_0x4e40('0x1a')],_0x1ff641);_0x28cbd9(_0xee8dd9['error'](0x1f4,_0x293fbe[_0x4e40('0x1a')]));});});};exports[_0x4e40('0x26')]=function(_0x36a7a6){var _0x19824b=this;return new Promise(function(_0x5e41a6,_0x47d2b0){return db[_0x4e40('0x1d')]['find']({'raw':_0x36a7a6['options']?_0x36a7a6[_0x4e40('0x1f')][_0x4e40('0x20')]===undefined?!![]:![]:!![],'where':_0x36a7a6[_0x4e40('0x1f')]?_0x36a7a6['options']['where']||null:null,'attributes':_0x36a7a6[_0x4e40('0x1f')]?_0x36a7a6['options']['attributes']||null:null,'include':_0x36a7a6[_0x4e40('0x1f')]?_0x36a7a6[_0x4e40('0x1f')]['include']?_['map'](_0x36a7a6[_0x4e40('0x1f')][_0x4e40('0x21')],function(_0x3fb69d){return{'model':db[_0x3fb69d[_0x4e40('0x23')]],'as':_0x3fb69d['as'],'attributes':_0x3fb69d[_0x4e40('0x24')],'include':_0x3fb69d[_0x4e40('0x21')]?_[_0x4e40('0x22')](_0x3fb69d['include'],function(_0x452fa9){return{'model':db[_0x452fa9[_0x4e40('0x23')]],'as':_0x452fa9['as'],'attributes':_0x452fa9['attributes'],'include':_0x452fa9['include']?_['map'](_0x452fa9[_0x4e40('0x21')],function(_0x53baaa){return{'model':db[_0x53baaa['model']],'as':_0x53baaa['as'],'attributes':_0x53baaa[_0x4e40('0x24')]};}):[]};}):[]};}):[]:[]})[_0x4e40('0x14')](function(_0xd7a765){logger['info']('ShowSmsQueue',_0x36a7a6);logger[_0x4e40('0x18')](_0x4e40('0x26'),_0x36a7a6,JSON[_0x4e40('0x25')](_0xd7a765));_0x5e41a6(_0xd7a765);})['catch'](function(_0x55add1){logger['error'](_0x4e40('0x26'),_0x55add1[_0x4e40('0x1a')],_0x36a7a6);_0x47d2b0(_0x19824b[_0x4e40('0x19')](0x1f4,_0x55add1['message']));});});};
\ No newline at end of file
+var _0xd4d6=['redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetSmsQueue','findAll','options','raw','attributes','limit','include','model','map','debug','ShowSmsQueue','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x270f2c,_0x32e90c){var _0x598a11=function(_0x2f9381){while(--_0x2f9381){_0x270f2c['push'](_0x270f2c['shift']());}};_0x598a11(++_0x32e90c);}(_0xd4d6,0x17b));var _0x6d4d=function(_0x477dff,_0xe51892){_0x477dff=_0x477dff-0x0;var _0x369f19=_0xd4d6[_0x477dff];return _0x369f19;};'use strict';var _=require(_0x6d4d('0x0'));var util=require('util');var moment=require(_0x6d4d('0x1'));var BPromise=require('bluebird');var rs=require(_0x6d4d('0x2'));var fs=require('fs');var Redis=require(_0x6d4d('0x3'));var db=require(_0x6d4d('0x4'))['db'];var utils=require(_0x6d4d('0x5'));var logger=require(_0x6d4d('0x6'))(_0x6d4d('0x7'));var config=require(_0x6d4d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6d4d('0x9')][_0x6d4d('0xa')]({'port':0x232a});config[_0x6d4d('0xb')]=_['defaults'](config['redis'],{'host':_0x6d4d('0xc'),'port':0x18eb});var socket=require(_0x6d4d('0xd'))(new Redis(config[_0x6d4d('0xb')]));require(_0x6d4d('0xe'))[_0x6d4d('0xf')](socket);function respondWithRpcPromise(_0xbe4692,_0x2d0bd6,_0x4eb33b){return new BPromise(function(_0x5c470c,_0x1dbe4e){return client[_0x6d4d('0x10')](_0xbe4692,_0x4eb33b)[_0x6d4d('0x11')](function(_0x101505){logger[_0x6d4d('0x12')](_0x6d4d('0x13'),_0x2d0bd6,_0x6d4d('0x14'));logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x2d0bd6,'request\x20sent',JSON[_0x6d4d('0x15')](_0x101505));if(_0x101505[_0x6d4d('0x16')]){if(_0x101505[_0x6d4d('0x16')][_0x6d4d('0x17')]===0x1f4){logger[_0x6d4d('0x16')]('SmsQueue,\x20%s,\x20%s',_0x2d0bd6,_0x101505['error'][_0x6d4d('0x18')]);return _0x1dbe4e(_0x101505[_0x6d4d('0x16')][_0x6d4d('0x18')]);}logger[_0x6d4d('0x16')](_0x6d4d('0x13'),_0x2d0bd6,_0x101505['error'][_0x6d4d('0x18')]);return _0x5c470c(_0x101505['error']['message']);}else{logger['info'](_0x6d4d('0x13'),_0x2d0bd6,_0x6d4d('0x14'));_0x5c470c(_0x101505[_0x6d4d('0x19')][_0x6d4d('0x18')]);}})[_0x6d4d('0x1a')](function(_0x16ff32){logger['error'](_0x6d4d('0x13'),_0x2d0bd6,_0x16ff32);_0x1dbe4e(_0x16ff32);});});}exports[_0x6d4d('0x1b')]=function(_0x1a8a2b){var _0x19d8b9=this;return new Promise(function(_0xde6abd,_0x123f67){return db['SmsQueue'][_0x6d4d('0x1c')]({'raw':_0x1a8a2b[_0x6d4d('0x1d')]?_0x1a8a2b['options'][_0x6d4d('0x1e')]===undefined?!![]:![]:!![],'where':_0x1a8a2b[_0x6d4d('0x1d')]?_0x1a8a2b[_0x6d4d('0x1d')]['where']||null:null,'attributes':_0x1a8a2b[_0x6d4d('0x1d')]?_0x1a8a2b[_0x6d4d('0x1d')][_0x6d4d('0x1f')]||null:null,'limit':_0x1a8a2b[_0x6d4d('0x1d')]?_0x1a8a2b[_0x6d4d('0x1d')][_0x6d4d('0x20')]||null:null,'include':_0x1a8a2b[_0x6d4d('0x1d')]?_0x1a8a2b[_0x6d4d('0x1d')][_0x6d4d('0x21')]?_['map'](_0x1a8a2b[_0x6d4d('0x1d')][_0x6d4d('0x21')],function(_0x58443d){return{'model':db[_0x58443d[_0x6d4d('0x22')]],'as':_0x58443d['as'],'attributes':_0x58443d[_0x6d4d('0x1f')],'include':_0x58443d[_0x6d4d('0x21')]?_['map'](_0x58443d[_0x6d4d('0x21')],function(_0x3bac34){return{'model':db[_0x3bac34[_0x6d4d('0x22')]],'as':_0x3bac34['as'],'attributes':_0x3bac34[_0x6d4d('0x1f')],'include':_0x3bac34['include']?_[_0x6d4d('0x23')](_0x3bac34['include'],function(_0x3301c5){return{'model':db[_0x3301c5[_0x6d4d('0x22')]],'as':_0x3301c5['as'],'attributes':_0x3301c5[_0x6d4d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6d4d('0x11')](function(_0x360e32){logger[_0x6d4d('0x12')](_0x6d4d('0x1b'),_0x1a8a2b);logger[_0x6d4d('0x24')](_0x6d4d('0x1b'),_0x1a8a2b,JSON['stringify'](_0x360e32));_0xde6abd(_0x360e32);})['catch'](function(_0x6ad1f7){logger['error'](_0x6d4d('0x1b'),_0x6ad1f7[_0x6d4d('0x18')],_0x1a8a2b);_0x123f67(_0x19d8b9[_0x6d4d('0x16')](0x1f4,_0x6ad1f7[_0x6d4d('0x18')]));});});};exports[_0x6d4d('0x25')]=function(_0x2825fb){var _0x429993=this;return new Promise(function(_0x462b74,_0x476cf3){return db['SmsQueue'][_0x6d4d('0x26')]({'raw':_0x2825fb[_0x6d4d('0x1d')]?_0x2825fb[_0x6d4d('0x1d')][_0x6d4d('0x1e')]===undefined?!![]:![]:!![],'where':_0x2825fb[_0x6d4d('0x1d')]?_0x2825fb[_0x6d4d('0x1d')]['where']||null:null,'attributes':_0x2825fb['options']?_0x2825fb['options'][_0x6d4d('0x1f')]||null:null,'include':_0x2825fb[_0x6d4d('0x1d')]?_0x2825fb['options'][_0x6d4d('0x21')]?_[_0x6d4d('0x23')](_0x2825fb[_0x6d4d('0x1d')]['include'],function(_0x2cc3b5){return{'model':db[_0x2cc3b5[_0x6d4d('0x22')]],'as':_0x2cc3b5['as'],'attributes':_0x2cc3b5[_0x6d4d('0x1f')],'include':_0x2cc3b5[_0x6d4d('0x21')]?_['map'](_0x2cc3b5[_0x6d4d('0x21')],function(_0x5c539c){return{'model':db[_0x5c539c[_0x6d4d('0x22')]],'as':_0x5c539c['as'],'attributes':_0x5c539c[_0x6d4d('0x1f')],'include':_0x5c539c[_0x6d4d('0x21')]?_['map'](_0x5c539c[_0x6d4d('0x21')],function(_0x5674a9){return{'model':db[_0x5674a9[_0x6d4d('0x22')]],'as':_0x5674a9['as'],'attributes':_0x5674a9[_0x6d4d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6d4d('0x11')](function(_0x2f3976){logger['info']('ShowSmsQueue',_0x2825fb);logger[_0x6d4d('0x24')]('ShowSmsQueue',_0x2825fb,JSON[_0x6d4d('0x15')](_0x2f3976));_0x462b74(_0x2f3976);})[_0x6d4d('0x1a')](function(_0x1d0ae7){logger[_0x6d4d('0x16')](_0x6d4d('0x25'),_0x1d0ae7[_0x6d4d('0x18')],_0x2825fb);_0x476cf3(_0x429993[_0x6d4d('0x16')](0x1f4,_0x1d0ae7[_0x6d4d('0x18')]));});});};
\ No newline at end of file
index 14592e6..dbb8945 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd353=['register','./smsQueue.events','save','remove','update','emit','removeListener'];(function(_0x26eb3b,_0x39ed05){var _0x4a930a=function(_0x1cc1f2){while(--_0x1cc1f2){_0x26eb3b['push'](_0x26eb3b['shift']());}};_0x4a930a(++_0x39ed05);}(_0xd353,0xda));var _0x3d35=function(_0x5162aa,_0x3a61fc){_0x5162aa=_0x5162aa-0x0;var _0x139001=_0xd353[_0x5162aa];return _0x139001;};'use strict';var SmsQueueEvents=require(_0x3d35('0x0'));var events=[_0x3d35('0x1'),_0x3d35('0x2'),_0x3d35('0x3')];function createListener(_0x12a7a4,_0x2908a1){return function(_0x1d35a3){_0x2908a1[_0x3d35('0x4')](_0x12a7a4,_0x1d35a3);};}function removeListener(_0x27e073,_0x264c94){return function(){SmsQueueEvents[_0x3d35('0x5')](_0x27e073,_0x264c94);};}exports[_0x3d35('0x6')]=function(_0x4cd067){for(var _0x3189d2=0x0,_0x326ebc=events['length'];_0x3189d2<_0x326ebc;_0x3189d2++){var _0x98e0b0=events[_0x3189d2];var _0x40c0db=createListener('smsQueue:'+_0x98e0b0,_0x4cd067);SmsQueueEvents['on'](_0x98e0b0,_0x40c0db);}};
\ No newline at end of file
+var _0xb46a=['./smsQueue.events','save','remove','update','emit','register','length','smsQueue:'];(function(_0x4b3fe9,_0x152176){var _0x4bcf09=function(_0x334a80){while(--_0x334a80){_0x4b3fe9['push'](_0x4b3fe9['shift']());}};_0x4bcf09(++_0x152176);}(_0xb46a,0x100));var _0xab46=function(_0x442e56,_0x19a86f){_0x442e56=_0x442e56-0x0;var _0x19ca4b=_0xb46a[_0x442e56];return _0x19ca4b;};'use strict';var SmsQueueEvents=require(_0xab46('0x0'));var events=[_0xab46('0x1'),_0xab46('0x2'),_0xab46('0x3')];function createListener(_0x2b1c63,_0x311d09){return function(_0x3f121d){_0x311d09[_0xab46('0x4')](_0x2b1c63,_0x3f121d);};}function removeListener(_0x5d94f7,_0x53a2c5){return function(){SmsQueueEvents['removeListener'](_0x5d94f7,_0x53a2c5);};}exports[_0xab46('0x5')]=function(_0x400ef9){for(var _0x1f5ab7=0x0,_0x3019d6=events[_0xab46('0x6')];_0x1f5ab7<_0x3019d6;_0x1f5ab7++){var _0x4308a1=events[_0x1f5ab7];var _0x25061f=createListener(_0xab46('0x7')+_0x4308a1,_0x400ef9);SmsQueueEvents['on'](_0x4308a1,_0x25061f);}};
\ No newline at end of file
index d76b457..a2a0240 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcbe=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','isAuthenticated','get','/:id','post','update','delete'];(function(_0x572877,_0x35bc1d){var _0x10f761=function(_0x2932ee){while(--_0x2932ee){_0x572877['push'](_0x572877['shift']());}};_0x10f761(++_0x35bc1d);}(_0xfcbe,0x1b1));var _0xefcb=function(_0x474050,_0x588b5e){_0x474050=_0x474050-0x0;var _0x1702ae=_0xfcbe[_0x474050];return _0x1702ae;};'use strict';var multer=require('multer');var util=require(_0xefcb('0x0'));var path=require(_0xefcb('0x1'));var timeout=require(_0xefcb('0x2'));var express=require(_0xefcb('0x3'));var router=express[_0xefcb('0x4')]();var fs_extra=require(_0xefcb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xefcb('0x6'));var config=require(_0xefcb('0x7'));var controller=require('./smsQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xefcb('0x8')]);router['get']('/describe',auth[_0xefcb('0x9')](),controller['describe']);router[_0xefcb('0xa')](_0xefcb('0xb'),auth[_0xefcb('0x9')](),controller['show']);router[_0xefcb('0xc')]('/',auth[_0xefcb('0x9')](),controller['create']);router['put'](_0xefcb('0xb'),auth[_0xefcb('0x9')](),controller[_0xefcb('0xd')]);router[_0xefcb('0xe')](_0xefcb('0xb'),auth[_0xefcb('0x9')](),controller['destroy']);module[_0xefcb('0xf')]=router;
\ No newline at end of file
+var _0x8d01=['post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','/describe','/:id','show'];(function(_0x4e682e,_0x1f58cd){var _0x3f448b=function(_0x253e49){while(--_0x253e49){_0x4e682e['push'](_0x4e682e['shift']());}};_0x3f448b(++_0x1f58cd);}(_0x8d01,0x16d));var _0x18d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d01[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x18d0('0x0'));var util=require(_0x18d0('0x1'));var path=require(_0x18d0('0x2'));var timeout=require(_0x18d0('0x3'));var express=require(_0x18d0('0x4'));var router=express[_0x18d0('0x5')]();var fs_extra=require(_0x18d0('0x6'));var auth=require(_0x18d0('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x18d0('0x8'));var controller=require(_0x18d0('0x9'));router[_0x18d0('0xa')]('/',auth[_0x18d0('0xb')](),controller['index']);router[_0x18d0('0xa')](_0x18d0('0xc'),auth[_0x18d0('0xb')](),controller['describe']);router[_0x18d0('0xa')](_0x18d0('0xd'),auth['isAuthenticated'](),controller[_0x18d0('0xe')]);router[_0x18d0('0xf')]('/',auth[_0x18d0('0xb')](),controller['create']);router['put'](_0x18d0('0xd'),auth[_0x18d0('0xb')](),controller[_0x18d0('0x10')]);router[_0x18d0('0x11')](_0x18d0('0xd'),auth[_0x18d0('0xb')](),controller[_0x18d0('0x12')]);module[_0x18d0('0x13')]=router;
\ No newline at end of file
index 874f9ef..e5ef27c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe811=['moment','sequelize','STRING','DATE'];(function(_0x56a482,_0x13b215){var _0x4159b1=function(_0x5cde4e){while(--_0x5cde4e){_0x56a482['push'](_0x56a482['shift']());}};_0x4159b1(++_0x13b215);}(_0xe811,0x1a8));var _0x1e81=function(_0x4f78f0,_0x1caa40){_0x4f78f0=_0x4f78f0-0x0;var _0x48b988=_0xe811[_0x4f78f0];return _0x48b988;};'use strict';var moment=require(_0x1e81('0x0'));var Sequelize=require(_0x1e81('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x1e81('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x1e81('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x1e81('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x1e81('0x3')]},'reason':{'type':Sequelize[_0x1e81('0x2')]}};
\ No newline at end of file
+var _0xbca7=['STRING','DATE','sequelize','exports'];(function(_0x3ee720,_0x37c8c4){var _0x41a6ef=function(_0x744ff8){while(--_0x744ff8){_0x3ee720['push'](_0x3ee720['shift']());}};_0x41a6ef(++_0x37c8c4);}(_0xbca7,0x86));var _0x7bca=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xbca7[_0xbb091];return _0x467a04;};'use strict';var moment=require('moment');var Sequelize=require(_0x7bca('0x0'));module[_0x7bca('0x1')]={'uniqueid':{'type':Sequelize[_0x7bca('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x7bca('0x3')]},'leaveAt':{'type':Sequelize[_0x7bca('0x3')]},'acceptAt':{'type':Sequelize[_0x7bca('0x3')]},'exitAt':{'type':Sequelize[_0x7bca('0x3')]},'reason':{'type':Sequelize[_0x7bca('0x2')]}};
\ No newline at end of file
index 72a4a47..ba33100 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x442a=['fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','filter','options','count','include','SmsQueueReport','findAll','rows','show','params','includeAll','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection'];(function(_0x15088c,_0x1e8c57){var _0x42ce5c=function(_0xfcf988){while(--_0xfcf988){_0x15088c['push'](_0x15088c['shift']());}};_0x42ce5c(++_0x1e8c57);}(_0x442a,0x6a));var _0xa442=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x442a[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0xa442('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa442('0x1'));var jsonpatch=require(_0xa442('0x2'));var rp=require(_0xa442('0x3'));var moment=require(_0xa442('0x4'));var BPromise=require(_0xa442('0x5'));var Mustache=require(_0xa442('0x6'));var util=require(_0xa442('0x7'));var path=require('path');var sox=require(_0xa442('0x8'));var csv=require('to-csv');var ejs=require(_0xa442('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa442('0xa'));var squel=require(_0xa442('0xb'));var crypto=require(_0xa442('0xc'));var jsforce=require(_0xa442('0xd'));var deskjs=require(_0xa442('0xe'));var toCsv=require(_0xa442('0xf'));var querystring=require(_0xa442('0x10'));var Papa=require('papaparse');var Redis=require(_0xa442('0x11'));var authService=require(_0xa442('0x12'));var qs=require(_0xa442('0x13'));var as=require(_0xa442('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa442('0x15'))(_0xa442('0x16'));var utils=require(_0xa442('0x17'));var config=require(_0xa442('0x18'));var licenseUtil=require(_0xa442('0x19'));var db=require(_0xa442('0x1a'))['db'];function respondWithStatusCode(_0x4d3feb,_0x32c08b){_0x32c08b=_0x32c08b||0xcc;return function(_0x385df8){if(_0x385df8){return _0x4d3feb[_0xa442('0x1b')](_0x32c08b);}return _0x4d3feb['status'](_0x32c08b)[_0xa442('0x1c')]();};}function respondWithResult(_0x515484,_0x23734c){_0x23734c=_0x23734c||0xc8;return function(_0x2ce614){if(_0x2ce614){return _0x515484[_0xa442('0x1d')](_0x23734c)[_0xa442('0x1e')](_0x2ce614);}};}function respondWithFilteredResult(_0x3e95a6,_0xd77ede){return function(_0x435ee6){if(_0x435ee6){var _0x306c3c=typeof _0xd77ede[_0xa442('0x1f')]===_0xa442('0x20')&&typeof _0xd77ede[_0xa442('0x21')]===_0xa442('0x20');var _0x22bb05=_0x435ee6['count'];var _0x5d6485=_0x306c3c?0x0:_0xd77ede['offset'];var _0x1e0fe4=_0x306c3c?_0x435ee6['count']:_0xd77ede[_0xa442('0x1f')]+_0xd77ede['limit'];var _0x1e01a3;if(_0x1e0fe4>=_0x22bb05){_0x1e0fe4=_0x22bb05;_0x1e01a3=0xc8;}else{_0x1e01a3=0xce;}_0x3e95a6[_0xa442('0x1d')](_0x1e01a3);return _0x3e95a6[_0xa442('0x22')](_0xa442('0x23'),_0x5d6485+'-'+_0x1e0fe4+'/'+_0x22bb05)[_0xa442('0x1e')](_0x435ee6);}return null;};}function patchUpdates(_0x161d67){return function(_0x29b66d){try{jsonpatch[_0xa442('0x24')](_0x29b66d,_0x161d67,!![]);}catch(_0x4eadda){return BPromise['reject'](_0x4eadda);}return _0x29b66d[_0xa442('0x25')]();};}function saveUpdates(_0x54076c,_0x5d4dfa){return function(_0xf7753a){if(_0xf7753a){return _0xf7753a[_0xa442('0x26')](_0x54076c)[_0xa442('0x27')](function(_0x4d4156){return _0x4d4156;});}return null;};}function removeEntity(_0x189028,_0x2e8b84){return function(_0x462077){if(_0x462077){return _0x462077[_0xa442('0x28')]()[_0xa442('0x27')](function(){_0x189028[_0xa442('0x1d')](0xcc)[_0xa442('0x1c')]();});}};}function handleEntityNotFound(_0x47bc8f,_0x234dc2){return function(_0xbac08e){if(!_0xbac08e){_0x47bc8f['sendStatus'](0x194);}return _0xbac08e;};}function handleError(_0x5e95af,_0x483463){_0x483463=_0x483463||0x1f4;return function(_0x3431b5){logger[_0xa442('0x29')](_0x3431b5[_0xa442('0x2a')]);if(_0x3431b5[_0xa442('0x2b')]){delete _0x3431b5[_0xa442('0x2b')];}_0x5e95af[_0xa442('0x1d')](_0x483463)[_0xa442('0x2c')](_0x3431b5);};}exports[_0xa442('0x2d')]=function(_0x2a480,_0x4fb0fa){var _0x13c040={},_0x4fafcf={},_0x2d14fe={'count':0x0,'rows':[]};var _0x53bcea=_[_0xa442('0x2e')](db['SmsQueueReport'][_0xa442('0x2f')],function(_0x280de6){return{'name':_0x280de6[_0xa442('0x30')],'type':_0x280de6[_0xa442('0x31')][_0xa442('0x32')]};});_0x4fafcf['model']=_[_0xa442('0x2e')](_0x53bcea,_0xa442('0x2b'));_0x4fafcf[_0xa442('0x33')]=_[_0xa442('0x34')](_0x2a480[_0xa442('0x33')]);_0x4fafcf['filters']=_['intersection'](_0x4fafcf[_0xa442('0x35')],_0x4fafcf['query']);_0x13c040[_0xa442('0x36')]=_[_0xa442('0x37')](_0x4fafcf['model'],qs[_0xa442('0x38')](_0x2a480[_0xa442('0x33')][_0xa442('0x38')]));_0x13c040[_0xa442('0x36')]=_0x13c040[_0xa442('0x36')][_0xa442('0x39')]?_0x13c040[_0xa442('0x36')]:_0x4fafcf[_0xa442('0x35')];if(!_0x2a480[_0xa442('0x33')][_0xa442('0x3a')](_0xa442('0x3b'))){_0x13c040[_0xa442('0x21')]=qs[_0xa442('0x21')](_0x2a480[_0xa442('0x33')][_0xa442('0x21')]);_0x13c040['offset']=qs['offset'](_0x2a480[_0xa442('0x33')][_0xa442('0x1f')]);}_0x13c040[_0xa442('0x3c')]=qs[_0xa442('0x3d')](_0x2a480[_0xa442('0x33')][_0xa442('0x3d')]);_0x13c040['where']=qs[_0xa442('0x3e')](_[_0xa442('0x3f')](_0x2a480[_0xa442('0x33')],_0x4fafcf[_0xa442('0x3e')]),_0x53bcea);if(_0x2a480[_0xa442('0x33')]['filter']){_0x13c040['where']=_[_0xa442('0x40')](_0x13c040[_0xa442('0x41')],{'$or':_[_0xa442('0x2e')](_0x53bcea,function(_0x340fe1){if(_0x340fe1[_0xa442('0x31')]!==_0xa442('0x42')){var _0x1047ad={};_0x1047ad[_0x340fe1['name']]={'$like':'%'+_0x2a480['query'][_0xa442('0x43')]+'%'};return _0x1047ad;}})});}_0x13c040=_['merge']({},_0x13c040,_0x2a480[_0xa442('0x44')]);var _0x12b409={'where':_0x13c040['where']};return db['SmsQueueReport'][_0xa442('0x45')](_0x12b409)['then'](function(_0x4cb0af){_0x2d14fe[_0xa442('0x45')]=_0x4cb0af;if(_0x2a480[_0xa442('0x33')]['includeAll']){_0x13c040[_0xa442('0x46')]=[{'all':!![]}];}return db[_0xa442('0x47')][_0xa442('0x48')](_0x13c040);})[_0xa442('0x27')](function(_0x127704){_0x2d14fe[_0xa442('0x49')]=_0x127704;return _0x2d14fe;})[_0xa442('0x27')](respondWithFilteredResult(_0x4fb0fa,_0x13c040))['catch'](handleError(_0x4fb0fa,null));};exports[_0xa442('0x4a')]=function(_0x14f443,_0x3658b5){var _0x10bb44={'raw':!![],'where':{'id':_0x14f443[_0xa442('0x4b')]['id']}},_0x46fafe={};_0x46fafe['model']=_[_0xa442('0x34')](db[_0xa442('0x47')][_0xa442('0x2f')]);_0x46fafe['query']=_[_0xa442('0x34')](_0x14f443['query']);_0x46fafe[_0xa442('0x3e')]=_[_0xa442('0x37')](_0x46fafe[_0xa442('0x35')],_0x46fafe[_0xa442('0x33')]);_0x10bb44[_0xa442('0x36')]=_['intersection'](_0x46fafe[_0xa442('0x35')],qs[_0xa442('0x38')](_0x14f443[_0xa442('0x33')][_0xa442('0x38')]));_0x10bb44['attributes']=_0x10bb44[_0xa442('0x36')][_0xa442('0x39')]?_0x10bb44[_0xa442('0x36')]:_0x46fafe[_0xa442('0x35')];if(_0x14f443[_0xa442('0x33')][_0xa442('0x4c')]){_0x10bb44[_0xa442('0x46')]=[{'all':!![]}];}_0x10bb44=_[_0xa442('0x40')]({},_0x10bb44,_0x14f443[_0xa442('0x44')]);return db[_0xa442('0x47')]['find'](_0x10bb44)['then'](handleEntityNotFound(_0x3658b5,null))[_0xa442('0x27')](respondWithResult(_0x3658b5,null))[_0xa442('0x4d')](handleError(_0x3658b5,null));};exports['create']=function(_0x53e330,_0x313d49){return db[_0xa442('0x47')][_0xa442('0x4e')](_0x53e330[_0xa442('0x4f')],{})[_0xa442('0x27')](respondWithResult(_0x313d49,0xc9))['catch'](handleError(_0x313d49,null));};exports[_0xa442('0x26')]=function(_0x151513,_0x653922){if(_0x151513['body']['id']){delete _0x151513[_0xa442('0x4f')]['id'];}return db[_0xa442('0x47')]['find']({'where':{'id':_0x151513[_0xa442('0x4b')]['id']}})[_0xa442('0x27')](handleEntityNotFound(_0x653922,null))['then'](saveUpdates(_0x151513[_0xa442('0x4f')],null))[_0xa442('0x27')](respondWithResult(_0x653922,null))['catch'](handleError(_0x653922,null));};exports['destroy']=function(_0x409318,_0x37b38a){return db[_0xa442('0x47')]['find']({'where':{'id':_0x409318[_0xa442('0x4b')]['id']}})[_0xa442('0x27')](handleEntityNotFound(_0x37b38a,null))['then'](removeEntity(_0x37b38a,null))[_0xa442('0x4d')](handleError(_0x37b38a,null));};exports[_0xa442('0x50')]=function(_0x42b784,_0x494dc7){return db[_0xa442('0x47')][_0xa442('0x50')]()['then'](respondWithResult(_0x494dc7,null))[_0xa442('0x4d')](handleError(_0x494dc7,null));};
\ No newline at end of file
+var _0x847a=['stack','name','send','map','SmsQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','includeAll','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','error'];(function(_0xa98302,_0x844f27){var _0x1ad8e3=function(_0x57e51d){while(--_0x57e51d){_0xa98302['push'](_0xa98302['shift']());}};_0x1ad8e3(++_0x844f27);}(_0x847a,0x1a7));var _0xa847=function(_0x529d9f,_0x241306){_0x529d9f=_0x529d9f-0x0;var _0x5040ed=_0x847a[_0x529d9f];return _0x5040ed;};'use strict';var emlformat=require(_0xa847('0x0'));var rimraf=require(_0xa847('0x1'));var zipdir=require(_0xa847('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa847('0x3'));var moment=require('moment');var BPromise=require(_0xa847('0x4'));var Mustache=require(_0xa847('0x5'));var util=require(_0xa847('0x6'));var path=require(_0xa847('0x7'));var sox=require(_0xa847('0x8'));var csv=require(_0xa847('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa847('0xa'));var squel=require(_0xa847('0xb'));var crypto=require(_0xa847('0xc'));var jsforce=require(_0xa847('0xd'));var deskjs=require(_0xa847('0xe'));var toCsv=require(_0xa847('0x9'));var querystring=require(_0xa847('0xf'));var Papa=require(_0xa847('0x10'));var Redis=require(_0xa847('0x11'));var authService=require(_0xa847('0x12'));var qs=require(_0xa847('0x13'));var as=require(_0xa847('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa847('0x15'))(_0xa847('0x16'));var utils=require('../../config/utils');var config=require(_0xa847('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ac965,_0x33d4e4){_0x33d4e4=_0x33d4e4||0xcc;return function(_0x3ee7d8){if(_0x3ee7d8){return _0x1ac965[_0xa847('0x18')](_0x33d4e4);}return _0x1ac965[_0xa847('0x19')](_0x33d4e4)[_0xa847('0x1a')]();};}function respondWithResult(_0x54f52e,_0x55a677){_0x55a677=_0x55a677||0xc8;return function(_0x1277fa){if(_0x1277fa){return _0x54f52e[_0xa847('0x19')](_0x55a677)[_0xa847('0x1b')](_0x1277fa);}};}function respondWithFilteredResult(_0x3c649b,_0x582b9e){return function(_0x433546){if(_0x433546){var _0x367526=typeof _0x582b9e['offset']==='undefined'&&typeof _0x582b9e['limit']===_0xa847('0x1c');var _0x4e1555=_0x433546[_0xa847('0x1d')];var _0x14dbe3=_0x367526?0x0:_0x582b9e[_0xa847('0x1e')];var _0x1387c6=_0x367526?_0x433546['count']:_0x582b9e[_0xa847('0x1e')]+_0x582b9e[_0xa847('0x1f')];var _0x2343a5;if(_0x1387c6>=_0x4e1555){_0x1387c6=_0x4e1555;_0x2343a5=0xc8;}else{_0x2343a5=0xce;}_0x3c649b['status'](_0x2343a5);return _0x3c649b[_0xa847('0x20')](_0xa847('0x21'),_0x14dbe3+'-'+_0x1387c6+'/'+_0x4e1555)[_0xa847('0x1b')](_0x433546);}return null;};}function patchUpdates(_0x4f6444){return function(_0x2479db){try{jsonpatch[_0xa847('0x22')](_0x2479db,_0x4f6444,!![]);}catch(_0x3bb1a1){return BPromise[_0xa847('0x23')](_0x3bb1a1);}return _0x2479db[_0xa847('0x24')]();};}function saveUpdates(_0x33219c,_0x50c5d8){return function(_0x20fb62){if(_0x20fb62){return _0x20fb62['update'](_0x33219c)[_0xa847('0x25')](function(_0x49b2b2){return _0x49b2b2;});}return null;};}function removeEntity(_0x400b91,_0x48b7aa){return function(_0x2140f0){if(_0x2140f0){return _0x2140f0['destroy']()[_0xa847('0x25')](function(){_0x400b91['status'](0xcc)[_0xa847('0x1a')]();});}};}function handleEntityNotFound(_0x4e7670,_0x10a7f1){return function(_0x4dd79f){if(!_0x4dd79f){_0x4e7670['sendStatus'](0x194);}return _0x4dd79f;};}function handleError(_0x429090,_0x17ef88){_0x17ef88=_0x17ef88||0x1f4;return function(_0x4464a1){logger[_0xa847('0x26')](_0x4464a1[_0xa847('0x27')]);if(_0x4464a1[_0xa847('0x28')]){delete _0x4464a1['name'];}_0x429090['status'](_0x17ef88)[_0xa847('0x29')](_0x4464a1);};}exports['index']=function(_0xaafe32,_0x49dbbb){var _0x1815c8={},_0x1ffc52={},_0x37b238={'count':0x0,'rows':[]};var _0x3b5e57=_[_0xa847('0x2a')](db[_0xa847('0x2b')][_0xa847('0x2c')],function(_0x2e013b){return{'name':_0x2e013b[_0xa847('0x2d')],'type':_0x2e013b['type'][_0xa847('0x2e')]};});_0x1ffc52[_0xa847('0x2f')]=_[_0xa847('0x2a')](_0x3b5e57,_0xa847('0x28'));_0x1ffc52[_0xa847('0x30')]=_[_0xa847('0x31')](_0xaafe32[_0xa847('0x30')]);_0x1ffc52[_0xa847('0x32')]=_[_0xa847('0x33')](_0x1ffc52[_0xa847('0x2f')],_0x1ffc52[_0xa847('0x30')]);_0x1815c8[_0xa847('0x34')]=_[_0xa847('0x33')](_0x1ffc52['model'],qs[_0xa847('0x35')](_0xaafe32[_0xa847('0x30')]['fields']));_0x1815c8[_0xa847('0x34')]=_0x1815c8[_0xa847('0x34')][_0xa847('0x36')]?_0x1815c8['attributes']:_0x1ffc52[_0xa847('0x2f')];if(!_0xaafe32['query'][_0xa847('0x37')](_0xa847('0x38'))){_0x1815c8['limit']=qs['limit'](_0xaafe32['query'][_0xa847('0x1f')]);_0x1815c8[_0xa847('0x1e')]=qs['offset'](_0xaafe32[_0xa847('0x30')][_0xa847('0x1e')]);}_0x1815c8[_0xa847('0x39')]=qs[_0xa847('0x3a')](_0xaafe32['query'][_0xa847('0x3a')]);_0x1815c8['where']=qs[_0xa847('0x32')](_[_0xa847('0x3b')](_0xaafe32[_0xa847('0x30')],_0x1ffc52[_0xa847('0x32')]),_0x3b5e57);if(_0xaafe32['query']['filter']){_0x1815c8[_0xa847('0x3c')]=_[_0xa847('0x3d')](_0x1815c8[_0xa847('0x3c')],{'$or':_['map'](_0x3b5e57,function(_0x9b55f8){if(_0x9b55f8[_0xa847('0x3e')]!==_0xa847('0x3f')){var _0x2ffdcf={};_0x2ffdcf[_0x9b55f8['name']]={'$like':'%'+_0xaafe32['query'][_0xa847('0x40')]+'%'};return _0x2ffdcf;}})});}_0x1815c8=_['merge']({},_0x1815c8,_0xaafe32[_0xa847('0x41')]);var _0x460eb4={'where':_0x1815c8[_0xa847('0x3c')]};return db[_0xa847('0x2b')]['count'](_0x460eb4)['then'](function(_0x520153){_0x37b238[_0xa847('0x1d')]=_0x520153;if(_0xaafe32[_0xa847('0x30')]['includeAll']){_0x1815c8[_0xa847('0x42')]=[{'all':!![]}];}return db[_0xa847('0x2b')][_0xa847('0x43')](_0x1815c8);})['then'](function(_0x3e3026){_0x37b238[_0xa847('0x44')]=_0x3e3026;return _0x37b238;})[_0xa847('0x25')](respondWithFilteredResult(_0x49dbbb,_0x1815c8))[_0xa847('0x45')](handleError(_0x49dbbb,null));};exports['show']=function(_0x1c56ba,_0x43ab06){var _0x1308d8={'raw':!![],'where':{'id':_0x1c56ba['params']['id']}},_0x302b54={};_0x302b54[_0xa847('0x2f')]=_[_0xa847('0x31')](db[_0xa847('0x2b')]['rawAttributes']);_0x302b54[_0xa847('0x30')]=_['keys'](_0x1c56ba['query']);_0x302b54[_0xa847('0x32')]=_[_0xa847('0x33')](_0x302b54['model'],_0x302b54[_0xa847('0x30')]);_0x1308d8[_0xa847('0x34')]=_[_0xa847('0x33')](_0x302b54[_0xa847('0x2f')],qs[_0xa847('0x35')](_0x1c56ba[_0xa847('0x30')][_0xa847('0x35')]));_0x1308d8[_0xa847('0x34')]=_0x1308d8[_0xa847('0x34')][_0xa847('0x36')]?_0x1308d8[_0xa847('0x34')]:_0x302b54[_0xa847('0x2f')];if(_0x1c56ba[_0xa847('0x30')][_0xa847('0x46')]){_0x1308d8[_0xa847('0x42')]=[{'all':!![]}];}_0x1308d8=_[_0xa847('0x3d')]({},_0x1308d8,_0x1c56ba[_0xa847('0x41')]);return db[_0xa847('0x2b')][_0xa847('0x47')](_0x1308d8)[_0xa847('0x25')](handleEntityNotFound(_0x43ab06,null))[_0xa847('0x25')](respondWithResult(_0x43ab06,null))[_0xa847('0x45')](handleError(_0x43ab06,null));};exports[_0xa847('0x48')]=function(_0x8be562,_0x6620){return db[_0xa847('0x2b')][_0xa847('0x48')](_0x8be562['body'],{})['then'](respondWithResult(_0x6620,0xc9))[_0xa847('0x45')](handleError(_0x6620,null));};exports['update']=function(_0x5aefe0,_0x490f8f){if(_0x5aefe0[_0xa847('0x49')]['id']){delete _0x5aefe0['body']['id'];}return db[_0xa847('0x2b')][_0xa847('0x47')]({'where':{'id':_0x5aefe0[_0xa847('0x4a')]['id']}})[_0xa847('0x25')](handleEntityNotFound(_0x490f8f,null))[_0xa847('0x25')](saveUpdates(_0x5aefe0[_0xa847('0x49')],null))['then'](respondWithResult(_0x490f8f,null))[_0xa847('0x45')](handleError(_0x490f8f,null));};exports[_0xa847('0x4b')]=function(_0x53bdee,_0x2f8538){return db[_0xa847('0x2b')]['find']({'where':{'id':_0x53bdee[_0xa847('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2f8538,null))[_0xa847('0x25')](removeEntity(_0x2f8538,null))[_0xa847('0x45')](handleError(_0x2f8538,null));};exports[_0xa847('0x4c')]=function(_0x1bd88f,_0x2c35a1){return db['SmsQueueReport'][_0xa847('0x4c')]()[_0xa847('0x25')](respondWithResult(_0x2c35a1,null))[_0xa847('0x45')](handleError(_0x2c35a1,null));};
\ No newline at end of file
index b497dc4..ced3516 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['util','../../config/logger','bluebird','request-promise','path','rimraf','./smsQueueReport.attributes','report_sms_queue','uniqueid','lodash'];(function(_0x4085ec,_0x206cac){var _0x88825f=function(_0x53fad1){while(--_0x53fad1){_0x4085ec['push'](_0x4085ec['shift']());}};_0x88825f(++_0x206cac);}(_0x70e0,0x17b));var _0x070e=function(_0x31fe49,_0x5e4445){_0x31fe49=_0x31fe49-0x0;var _0x23e078=_0x70e0[_0x31fe49];return _0x23e078;};'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']('SmsQueueReport',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[{'name':_0x070e('0x9'),'fields':[_0x070e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x42dd4e,_0x4cb7ba){var _0x3593dc=function(_0x28c6b5){while(--_0x28c6b5){_0x42dd4e['push'](_0x42dd4e['shift']());}};_0x3593dc(++_0x4cb7ba);}(_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
index 6d7c9e6..4f48383 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5918=['info','result','catch','create','options','raw','CreateSmsQueueReport','stringify','UpdateSmsQueueReport','SmsQueueReport','update','body','where','limit','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1ca504,_0x252ab3){var _0x14e8ee=function(_0x5b6766){while(--_0x5b6766){_0x1ca504['push'](_0x1ca504['shift']());}};_0x14e8ee(++_0x252ab3);}(_0x5918,0x1ee));var _0x8591=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5918[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x8591('0x0'));var moment=require(_0x8591('0x1'));var BPromise=require(_0x8591('0x2'));var rs=require(_0x8591('0x3'));var fs=require('fs');var Redis=require(_0x8591('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8591('0x5'));var logger=require(_0x8591('0x6'))(_0x8591('0x7'));var config=require('../../config/environment');var jayson=require(_0x8591('0x8'));var client=jayson[_0x8591('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17d72d,_0x5db6e0,_0x57ff29){return new BPromise(function(_0x19fe1b,_0xeeb0a6){return client[_0x8591('0xa')](_0x17d72d,_0x57ff29)[_0x8591('0xb')](function(_0x5946b3){logger['info'](_0x8591('0xc'),_0x5db6e0,'request\x20sent');logger[_0x8591('0xd')](_0x8591('0xe'),_0x5db6e0,'request\x20sent',JSON['stringify'](_0x5946b3));if(_0x5946b3['error']){if(_0x5946b3[_0x8591('0xf')][_0x8591('0x10')]===0x1f4){logger['error'](_0x8591('0xc'),_0x5db6e0,_0x5946b3[_0x8591('0xf')]['message']);return _0xeeb0a6(_0x5946b3[_0x8591('0xf')][_0x8591('0x11')]);}logger[_0x8591('0xf')](_0x8591('0xc'),_0x5db6e0,_0x5946b3[_0x8591('0xf')][_0x8591('0x11')]);return _0x19fe1b(_0x5946b3[_0x8591('0xf')][_0x8591('0x11')]);}else{logger[_0x8591('0x12')](_0x8591('0xc'),_0x5db6e0,'request\x20sent');_0x19fe1b(_0x5946b3[_0x8591('0x13')][_0x8591('0x11')]);}})[_0x8591('0x14')](function(_0x31c37d){logger[_0x8591('0xf')](_0x8591('0xc'),_0x5db6e0,_0x31c37d);_0xeeb0a6(_0x31c37d);});});}exports['CreateSmsQueueReport']=function(_0x41acfb){var _0x2be853=this;return new Promise(function(_0x2902a3,_0x17dfe8){return db['SmsQueueReport'][_0x8591('0x15')](_0x41acfb['body'],{'raw':_0x41acfb[_0x8591('0x16')]?_0x41acfb[_0x8591('0x16')][_0x8591('0x17')]===undefined?!![]:![]:!![]})[_0x8591('0xb')](function(_0x3c0aa9){logger[_0x8591('0x12')](_0x8591('0x18'),_0x41acfb);logger[_0x8591('0xd')](_0x8591('0x18'),_0x41acfb,JSON[_0x8591('0x19')](_0x3c0aa9));_0x2902a3(_0x3c0aa9);})[_0x8591('0x14')](function(_0x48922c){logger[_0x8591('0xf')](_0x8591('0x18'),_0x48922c['message'],_0x41acfb);_0x17dfe8(_0x2be853[_0x8591('0xf')](0x1f4,_0x48922c[_0x8591('0x11')]));});});};exports[_0x8591('0x1a')]=function(_0x17617e){var _0x105b55=this;return new Promise(function(_0x55a603,_0x13663c){return db[_0x8591('0x1b')][_0x8591('0x1c')](_0x17617e[_0x8591('0x1d')],{'raw':_0x17617e[_0x8591('0x16')]?_0x17617e[_0x8591('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17617e['options']?_0x17617e[_0x8591('0x16')][_0x8591('0x1e')]||null:null,'attributes':_0x17617e['options']?_0x17617e[_0x8591('0x16')]['attributes']||null:null,'limit':_0x17617e['options']?_0x17617e[_0x8591('0x16')][_0x8591('0x1f')]||null:null})[_0x8591('0xb')](function(_0x646b3f){logger[_0x8591('0x12')]('UpdateSmsQueueReport',_0x17617e);logger[_0x8591('0xd')](_0x8591('0x1a'),_0x17617e,JSON['stringify'](_0x646b3f));_0x55a603(_0x646b3f);})[_0x8591('0x14')](function(_0x237727){logger[_0x8591('0xf')](_0x8591('0x1a'),_0x237727[_0x8591('0x11')],_0x17617e);_0x13663c(_0x105b55[_0x8591('0xf')](0x1f4,_0x237727['message']));});});};
\ No newline at end of file
+var _0x753a=['UpdateSmsQueueReport','update','where','attributes','limit','debug','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsQueueReport','create','body','options','raw','CreateSmsQueueReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x753a,0x1e2));var _0xa753=function(_0x27a89f,_0x36a384){_0x27a89f=_0x27a89f-0x0;var _0x434a16=_0x753a[_0x27a89f];return _0x434a16;};'use strict';var _=require(_0xa753('0x0'));var util=require(_0xa753('0x1'));var moment=require(_0xa753('0x2'));var BPromise=require('bluebird');var rs=require(_0xa753('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa753('0x4'));var logger=require(_0xa753('0x5'))(_0xa753('0x6'));var config=require(_0xa753('0x7'));var jayson=require(_0xa753('0x8'));var client=jayson[_0xa753('0x9')][_0xa753('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f0885,_0x37f4a0,_0x38debc){return new BPromise(function(_0x2c57b4,_0x2ae066){return client['request'](_0x3f0885,_0x38debc)[_0xa753('0xb')](function(_0x504d83){logger[_0xa753('0xc')](_0xa753('0xd'),_0x37f4a0,_0xa753('0xe'));logger['debug'](_0xa753('0xf'),_0x37f4a0,_0xa753('0xe'),JSON[_0xa753('0x10')](_0x504d83));if(_0x504d83['error']){if(_0x504d83[_0xa753('0x11')][_0xa753('0x12')]===0x1f4){logger[_0xa753('0x11')](_0xa753('0xd'),_0x37f4a0,_0x504d83[_0xa753('0x11')][_0xa753('0x13')]);return _0x2ae066(_0x504d83[_0xa753('0x11')][_0xa753('0x13')]);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x37f4a0,_0x504d83[_0xa753('0x11')][_0xa753('0x13')]);return _0x2c57b4(_0x504d83[_0xa753('0x11')][_0xa753('0x13')]);}else{logger[_0xa753('0xc')](_0xa753('0xd'),_0x37f4a0,_0xa753('0xe'));_0x2c57b4(_0x504d83[_0xa753('0x14')][_0xa753('0x13')]);}})[_0xa753('0x15')](function(_0x16c3b6){logger[_0xa753('0x11')](_0xa753('0xd'),_0x37f4a0,_0x16c3b6);_0x2ae066(_0x16c3b6);});});}exports['CreateSmsQueueReport']=function(_0x477e71){var _0x291af2=this;return new Promise(function(_0x2d6832,_0x449f3e){return db[_0xa753('0x16')][_0xa753('0x17')](_0x477e71[_0xa753('0x18')],{'raw':_0x477e71[_0xa753('0x19')]?_0x477e71[_0xa753('0x19')][_0xa753('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x26a222){logger['info']('CreateSmsQueueReport',_0x477e71);logger['debug'](_0xa753('0x1b'),_0x477e71,JSON[_0xa753('0x10')](_0x26a222));_0x2d6832(_0x26a222);})['catch'](function(_0x19fc03){logger[_0xa753('0x11')]('CreateSmsQueueReport',_0x19fc03[_0xa753('0x13')],_0x477e71);_0x449f3e(_0x291af2[_0xa753('0x11')](0x1f4,_0x19fc03[_0xa753('0x13')]));});});};exports[_0xa753('0x1c')]=function(_0x1a531b){var _0x218d6d=this;return new Promise(function(_0x302e38,_0xb7afcc){return db['SmsQueueReport'][_0xa753('0x1d')](_0x1a531b[_0xa753('0x18')],{'raw':_0x1a531b[_0xa753('0x19')]?_0x1a531b[_0xa753('0x19')][_0xa753('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a531b[_0xa753('0x19')]?_0x1a531b[_0xa753('0x19')][_0xa753('0x1e')]||null:null,'attributes':_0x1a531b[_0xa753('0x19')]?_0x1a531b[_0xa753('0x19')][_0xa753('0x1f')]||null:null,'limit':_0x1a531b[_0xa753('0x19')]?_0x1a531b['options'][_0xa753('0x20')]||null:null})['then'](function(_0x10ef5c){logger[_0xa753('0xc')]('UpdateSmsQueueReport',_0x1a531b);logger[_0xa753('0x21')](_0xa753('0x1c'),_0x1a531b,JSON['stringify'](_0x10ef5c));_0x302e38(_0x10ef5c);})[_0xa753('0x15')](function(_0x4659ea){logger[_0xa753('0x11')](_0xa753('0x1c'),_0x4659ea[_0xa753('0x13')],_0x1a531b);_0xb7afcc(_0x218d6d[_0xa753('0x11')](0x1f4,_0x4659ea[_0xa753('0x13')]));});});};
\ No newline at end of file
index e9df789..420ec24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b20=['show','post','create','put','/:id','delete','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x1e2c04,_0x1ddf0a){var _0xb8d40d=function(_0x28e365){while(--_0x28e365){_0x1e2c04['push'](_0x1e2c04['shift']());}};_0xb8d40d(++_0x1ddf0a);}(_0x1b20,0x66));var _0x01b2=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x1b20[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require('multer');var util=require(_0x01b2('0x0'));var path=require(_0x01b2('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x01b2('0x2')]();var fs_extra=require(_0x01b2('0x3'));var auth=require(_0x01b2('0x4'));var interaction=require(_0x01b2('0x5'));var config=require(_0x01b2('0x6'));var controller=require(_0x01b2('0x7'));router[_0x01b2('0x8')]('/',auth[_0x01b2('0x9')](),controller[_0x01b2('0xa')]);router[_0x01b2('0x8')](_0x01b2('0xb'),auth[_0x01b2('0x9')](),controller['describe']);router[_0x01b2('0x8')]('/:id',auth[_0x01b2('0x9')](),controller[_0x01b2('0xc')]);router[_0x01b2('0xd')]('/',auth[_0x01b2('0x9')](),controller[_0x01b2('0xe')]);router[_0x01b2('0xf')](_0x01b2('0x10'),auth[_0x01b2('0x9')](),controller['update']);router[_0x01b2('0x11')]('/:id',auth[_0x01b2('0x9')](),controller['destroy']);module[_0x01b2('0x12')]=router;
\ No newline at end of file
+var _0xd0bb=['express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','destroy','exports','multer','util','path'];(function(_0x34f7bd,_0x191027){var _0x1c1f1d=function(_0x4b4b4f){while(--_0x4b4b4f){_0x34f7bd['push'](_0x34f7bd['shift']());}};_0x1c1f1d(++_0x191027);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x245a7d,_0x253c2f){_0x245a7d=_0x245a7d-0x0;var _0x24789d=_0xd0bb[_0x245a7d];return _0x24789d;};'use strict';var multer=require(_0xbd0b('0x0'));var util=require(_0xbd0b('0x1'));var path=require(_0xbd0b('0x2'));var timeout=require('connect-timeout');var express=require(_0xbd0b('0x3'));var router=express['Router']();var fs_extra=require(_0xbd0b('0x4'));var auth=require(_0xbd0b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbd0b('0x6'));var controller=require('./smsTransferReport.controller');router[_0xbd0b('0x7')]('/',auth[_0xbd0b('0x8')](),controller[_0xbd0b('0x9')]);router[_0xbd0b('0x7')](_0xbd0b('0xa'),auth['isAuthenticated'](),controller[_0xbd0b('0xb')]);router[_0xbd0b('0x7')](_0xbd0b('0xc'),auth[_0xbd0b('0x8')](),controller[_0xbd0b('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbd0b('0xe')]);router[_0xbd0b('0xf')]('/:id',auth[_0xbd0b('0x8')](),controller[_0xbd0b('0x10')]);router['delete'](_0xbd0b('0xc'),auth[_0xbd0b('0x8')](),controller[_0xbd0b('0x11')]);module[_0xbd0b('0x12')]=router;
\ No newline at end of file
index 7a4345e..e15de6b 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(_0x420f2a,_0x2cc58d){var _0x28f802=function(_0x3329cc){while(--_0x3329cc){_0x420f2a['push'](_0x420f2a['shift']());}};_0x28f802(++_0x2cc58d);}(_0xb43b,0x1b2));var _0xbb43=function(_0x34aab4,_0x1074b4){_0x34aab4=_0x34aab4-0x0;var _0x330c38=_0xb43b[_0x34aab4];return _0x330c38;};'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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x3efc86,_0x47cedf){var _0x55161a=function(_0x2f7bc2){while(--_0x2f7bc2){_0x3efc86['push'](_0x3efc86['shift']());}};_0x55161a(++_0x47cedf);}(_0x70e0,0x17b));var _0x070e=function(_0x12e7f2,_0x4c17f4){_0x12e7f2=_0x12e7f2-0x0;var _0x165927=_0x70e0[_0x12e7f2];return _0x165927;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
index ec0a82c..eb95010 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8691=['then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','SmsTransferReport','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','apply','reject','update'];(function(_0x4442fa,_0x350d40){var _0x288850=function(_0x23d311){while(--_0x23d311){_0x4442fa['push'](_0x4442fa['shift']());}};_0x288850(++_0x350d40);}(_0x8691,0x155));var _0x1869=function(_0x371d11,_0x3b7d7d){_0x371d11=_0x371d11-0x0;var _0x1d5b7e=_0x8691[_0x371d11];return _0x1d5b7e;};'use strict';var emlformat=require(_0x1869('0x0'));var rimraf=require(_0x1869('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1869('0x2'));var rp=require('request-promise');var moment=require(_0x1869('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1869('0x4'));var util=require('util');var path=require(_0x1869('0x5'));var sox=require(_0x1869('0x6'));var csv=require(_0x1869('0x7'));var ejs=require(_0x1869('0x8'));var fs=require('fs');var fs_extra=require(_0x1869('0x9'));var _=require(_0x1869('0xa'));var squel=require(_0x1869('0xb'));var crypto=require(_0x1869('0xc'));var jsforce=require(_0x1869('0xd'));var deskjs=require(_0x1869('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1869('0xf'));var Papa=require('papaparse');var Redis=require(_0x1869('0x10'));var authService=require(_0x1869('0x11'));var qs=require(_0x1869('0x12'));var as=require(_0x1869('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1869('0x14'))('api');var utils=require(_0x1869('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1869('0x16'));var db=require(_0x1869('0x17'))['db'];function respondWithStatusCode(_0x374937,_0x153982){_0x153982=_0x153982||0xcc;return function(_0x31ee5a){if(_0x31ee5a){return _0x374937['sendStatus'](_0x153982);}return _0x374937[_0x1869('0x18')](_0x153982)[_0x1869('0x19')]();};}function respondWithResult(_0x48c01f,_0x4f6092){_0x4f6092=_0x4f6092||0xc8;return function(_0x560689){if(_0x560689){return _0x48c01f[_0x1869('0x18')](_0x4f6092)[_0x1869('0x1a')](_0x560689);}};}function respondWithFilteredResult(_0x2ff354,_0x57cf02){return function(_0x1db42c){if(_0x1db42c){var _0x1997d9=typeof _0x57cf02['offset']===_0x1869('0x1b')&&typeof _0x57cf02['limit']===_0x1869('0x1b');var _0xd06a53=_0x1db42c[_0x1869('0x1c')];var _0x336b4d=_0x1997d9?0x0:_0x57cf02[_0x1869('0x1d')];var _0x50190f=_0x1997d9?_0x1db42c[_0x1869('0x1c')]:_0x57cf02[_0x1869('0x1d')]+_0x57cf02[_0x1869('0x1e')];var _0xc013bf;if(_0x50190f>=_0xd06a53){_0x50190f=_0xd06a53;_0xc013bf=0xc8;}else{_0xc013bf=0xce;}_0x2ff354[_0x1869('0x18')](_0xc013bf);return _0x2ff354['set']('Content-Range',_0x336b4d+'-'+_0x50190f+'/'+_0xd06a53)[_0x1869('0x1a')](_0x1db42c);}return null;};}function patchUpdates(_0x3fd041){return function(_0x2847df){try{jsonpatch[_0x1869('0x1f')](_0x2847df,_0x3fd041,!![]);}catch(_0x3a39c7){return BPromise[_0x1869('0x20')](_0x3a39c7);}return _0x2847df['save']();};}function saveUpdates(_0x26dc86,_0xc2c65){return function(_0x38266f){if(_0x38266f){return _0x38266f[_0x1869('0x21')](_0x26dc86)[_0x1869('0x22')](function(_0x5ed8d5){return _0x5ed8d5;});}return null;};}function removeEntity(_0x34b323,_0x56b6d1){return function(_0x338591){if(_0x338591){return _0x338591[_0x1869('0x23')]()[_0x1869('0x22')](function(){_0x34b323[_0x1869('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e796e,_0x496ad0){return function(_0x3707a7){if(!_0x3707a7){_0x2e796e['sendStatus'](0x194);}return _0x3707a7;};}function handleError(_0x27d106,_0x2c4c38){_0x2c4c38=_0x2c4c38||0x1f4;return function(_0x19c2e3){logger[_0x1869('0x24')](_0x19c2e3[_0x1869('0x25')]);if(_0x19c2e3[_0x1869('0x26')]){delete _0x19c2e3[_0x1869('0x26')];}_0x27d106['status'](_0x2c4c38)[_0x1869('0x27')](_0x19c2e3);};}exports[_0x1869('0x28')]=function(_0xf13b27,_0x448cf9){var _0x3c3fc2={},_0x32a0cb={},_0x145ef0={'count':0x0,'rows':[]};var _0x56c496=_[_0x1869('0x29')](db['SmsTransferReport'][_0x1869('0x2a')],function(_0x3a8f93){return{'name':_0x3a8f93[_0x1869('0x2b')],'type':_0x3a8f93[_0x1869('0x2c')][_0x1869('0x2d')]};});_0x32a0cb[_0x1869('0x2e')]=_['map'](_0x56c496,_0x1869('0x26'));_0x32a0cb[_0x1869('0x2f')]=_[_0x1869('0x30')](_0xf13b27[_0x1869('0x2f')]);_0x32a0cb[_0x1869('0x31')]=_['intersection'](_0x32a0cb[_0x1869('0x2e')],_0x32a0cb[_0x1869('0x2f')]);_0x3c3fc2[_0x1869('0x32')]=_[_0x1869('0x33')](_0x32a0cb[_0x1869('0x2e')],qs[_0x1869('0x34')](_0xf13b27[_0x1869('0x2f')]['fields']));_0x3c3fc2[_0x1869('0x32')]=_0x3c3fc2['attributes']['length']?_0x3c3fc2[_0x1869('0x32')]:_0x32a0cb['model'];if(!_0xf13b27['query'][_0x1869('0x35')](_0x1869('0x36'))){_0x3c3fc2['limit']=qs[_0x1869('0x1e')](_0xf13b27['query'][_0x1869('0x1e')]);_0x3c3fc2[_0x1869('0x1d')]=qs['offset'](_0xf13b27[_0x1869('0x2f')][_0x1869('0x1d')]);}_0x3c3fc2[_0x1869('0x37')]=qs['sort'](_0xf13b27['query'][_0x1869('0x38')]);_0x3c3fc2[_0x1869('0x39')]=qs[_0x1869('0x31')](_[_0x1869('0x3a')](_0xf13b27[_0x1869('0x2f')],_0x32a0cb[_0x1869('0x31')]),_0x56c496);if(_0xf13b27[_0x1869('0x2f')][_0x1869('0x3b')]){_0x3c3fc2['where']=_[_0x1869('0x3c')](_0x3c3fc2[_0x1869('0x39')],{'$or':_[_0x1869('0x29')](_0x56c496,function(_0x28d43b){if(_0x28d43b[_0x1869('0x2c')]!==_0x1869('0x3d')){var _0x2aad67={};_0x2aad67[_0x28d43b[_0x1869('0x26')]]={'$like':'%'+_0xf13b27[_0x1869('0x2f')]['filter']+'%'};return _0x2aad67;}})});}_0x3c3fc2=_[_0x1869('0x3c')]({},_0x3c3fc2,_0xf13b27['options']);var _0x14dd4f={'where':_0x3c3fc2['where']};return db['SmsTransferReport']['count'](_0x14dd4f)[_0x1869('0x22')](function(_0x429e50){_0x145ef0['count']=_0x429e50;if(_0xf13b27[_0x1869('0x2f')][_0x1869('0x3e')]){_0x3c3fc2[_0x1869('0x3f')]=[{'all':!![]}];}return db[_0x1869('0x40')][_0x1869('0x41')](_0x3c3fc2);})['then'](function(_0x2cbb93){_0x145ef0[_0x1869('0x42')]=_0x2cbb93;return _0x145ef0;})['then'](respondWithFilteredResult(_0x448cf9,_0x3c3fc2))[_0x1869('0x43')](handleError(_0x448cf9,null));};exports[_0x1869('0x44')]=function(_0x43624d,_0x34d8f5){var _0x3d3e2e={'raw':!![],'where':{'id':_0x43624d[_0x1869('0x45')]['id']}},_0x3cd931={};_0x3cd931[_0x1869('0x2e')]=_[_0x1869('0x30')](db[_0x1869('0x40')][_0x1869('0x2a')]);_0x3cd931[_0x1869('0x2f')]=_[_0x1869('0x30')](_0x43624d['query']);_0x3cd931[_0x1869('0x31')]=_[_0x1869('0x33')](_0x3cd931['model'],_0x3cd931[_0x1869('0x2f')]);_0x3d3e2e[_0x1869('0x32')]=_[_0x1869('0x33')](_0x3cd931[_0x1869('0x2e')],qs[_0x1869('0x34')](_0x43624d[_0x1869('0x2f')][_0x1869('0x34')]));_0x3d3e2e[_0x1869('0x32')]=_0x3d3e2e[_0x1869('0x32')][_0x1869('0x46')]?_0x3d3e2e[_0x1869('0x32')]:_0x3cd931[_0x1869('0x2e')];if(_0x43624d[_0x1869('0x2f')][_0x1869('0x3e')]){_0x3d3e2e[_0x1869('0x3f')]=[{'all':!![]}];}_0x3d3e2e=_[_0x1869('0x3c')]({},_0x3d3e2e,_0x43624d['options']);return db['SmsTransferReport'][_0x1869('0x47')](_0x3d3e2e)[_0x1869('0x22')](handleEntityNotFound(_0x34d8f5,null))['then'](respondWithResult(_0x34d8f5,null))[_0x1869('0x43')](handleError(_0x34d8f5,null));};exports[_0x1869('0x48')]=function(_0x20e8d1,_0x3175c8){return db[_0x1869('0x40')][_0x1869('0x48')](_0x20e8d1[_0x1869('0x49')],{})[_0x1869('0x22')](respondWithResult(_0x3175c8,0xc9))[_0x1869('0x43')](handleError(_0x3175c8,null));};exports[_0x1869('0x21')]=function(_0x58f5da,_0x3d511c){if(_0x58f5da[_0x1869('0x49')]['id']){delete _0x58f5da[_0x1869('0x49')]['id'];}return db[_0x1869('0x40')]['find']({'where':{'id':_0x58f5da[_0x1869('0x45')]['id']}})[_0x1869('0x22')](handleEntityNotFound(_0x3d511c,null))[_0x1869('0x22')](saveUpdates(_0x58f5da[_0x1869('0x49')],null))[_0x1869('0x22')](respondWithResult(_0x3d511c,null))[_0x1869('0x43')](handleError(_0x3d511c,null));};exports[_0x1869('0x23')]=function(_0x6d96c9,_0x3644c1){return db[_0x1869('0x40')][_0x1869('0x47')]({'where':{'id':_0x6d96c9[_0x1869('0x45')]['id']}})[_0x1869('0x22')](handleEntityNotFound(_0x3644c1,null))[_0x1869('0x22')](removeEntity(_0x3644c1,null))[_0x1869('0x43')](handleError(_0x3644c1,null));};exports[_0x1869('0x4a')]=function(_0x48d68c,_0xb3f4c5){return db[_0x1869('0x40')][_0x1869('0x4a')]()[_0x1869('0x22')](respondWithResult(_0xb3f4c5,null))[_0x1869('0x43')](handleError(_0xb3f4c5,null));};
\ No newline at end of file
+var _0x0a21=['undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','send','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','options','includeAll','include','findAll','rows','params','merge','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a21,0x7d));var _0x10a2=function(_0x364a05,_0x3428fc){_0x364a05=_0x364a05-0x0;var _0x5e7263=_0x0a21[_0x364a05];return _0x5e7263;};'use strict';var emlformat=require(_0x10a2('0x0'));var rimraf=require(_0x10a2('0x1'));var zipdir=require(_0x10a2('0x2'));var jsonpatch=require(_0x10a2('0x3'));var rp=require('request-promise');var moment=require(_0x10a2('0x4'));var BPromise=require(_0x10a2('0x5'));var Mustache=require('mustache');var util=require(_0x10a2('0x6'));var path=require(_0x10a2('0x7'));var sox=require(_0x10a2('0x8'));var csv=require('to-csv');var ejs=require(_0x10a2('0x9'));var fs=require('fs');var fs_extra=require(_0x10a2('0xa'));var _=require(_0x10a2('0xb'));var squel=require(_0x10a2('0xc'));var crypto=require(_0x10a2('0xd'));var jsforce=require(_0x10a2('0xe'));var deskjs=require(_0x10a2('0xf'));var toCsv=require(_0x10a2('0x10'));var querystring=require(_0x10a2('0x11'));var Papa=require(_0x10a2('0x12'));var Redis=require(_0x10a2('0x13'));var authService=require(_0x10a2('0x14'));var qs=require(_0x10a2('0x15'));var as=require(_0x10a2('0x16'));var hardwareService=require(_0x10a2('0x17'));var logger=require(_0x10a2('0x18'))('api');var utils=require(_0x10a2('0x19'));var config=require(_0x10a2('0x1a'));var licenseUtil=require(_0x10a2('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c2b79,_0x392505){_0x392505=_0x392505||0xcc;return function(_0x1c9b90){if(_0x1c9b90){return _0x1c2b79[_0x10a2('0x1c')](_0x392505);}return _0x1c2b79[_0x10a2('0x1d')](_0x392505)[_0x10a2('0x1e')]();};}function respondWithResult(_0x5027c0,_0x14508a){_0x14508a=_0x14508a||0xc8;return function(_0xa171f0){if(_0xa171f0){return _0x5027c0['status'](_0x14508a)[_0x10a2('0x1f')](_0xa171f0);}};}function respondWithFilteredResult(_0x3f1a9f,_0x116b5f){return function(_0x3b4242){if(_0x3b4242){var _0xb93a07=typeof _0x116b5f[_0x10a2('0x20')]===_0x10a2('0x21')&&typeof _0x116b5f['limit']==='undefined';var _0x4b8e36=_0x3b4242[_0x10a2('0x22')];var _0x315953=_0xb93a07?0x0:_0x116b5f['offset'];var _0xe57373=_0xb93a07?_0x3b4242[_0x10a2('0x22')]:_0x116b5f[_0x10a2('0x20')]+_0x116b5f[_0x10a2('0x23')];var _0x18dddf;if(_0xe57373>=_0x4b8e36){_0xe57373=_0x4b8e36;_0x18dddf=0xc8;}else{_0x18dddf=0xce;}_0x3f1a9f['status'](_0x18dddf);return _0x3f1a9f[_0x10a2('0x24')](_0x10a2('0x25'),_0x315953+'-'+_0xe57373+'/'+_0x4b8e36)['json'](_0x3b4242);}return null;};}function patchUpdates(_0x1721fd){return function(_0x4670ae){try{jsonpatch[_0x10a2('0x26')](_0x4670ae,_0x1721fd,!![]);}catch(_0x4e1ba6){return BPromise[_0x10a2('0x27')](_0x4e1ba6);}return _0x4670ae[_0x10a2('0x28')]();};}function saveUpdates(_0x564b5d,_0x4490a1){return function(_0x8a61af){if(_0x8a61af){return _0x8a61af['update'](_0x564b5d)[_0x10a2('0x29')](function(_0x1885a8){return _0x1885a8;});}return null;};}function removeEntity(_0x125c73,_0x3ef16e){return function(_0x16baaa){if(_0x16baaa){return _0x16baaa[_0x10a2('0x2a')]()[_0x10a2('0x29')](function(){_0x125c73[_0x10a2('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5909ae,_0x293f6b){return function(_0x761acf){if(!_0x761acf){_0x5909ae[_0x10a2('0x1c')](0x194);}return _0x761acf;};}function handleError(_0x5af51b,_0x3a2c86){_0x3a2c86=_0x3a2c86||0x1f4;return function(_0x31f19a){logger[_0x10a2('0x2b')](_0x31f19a[_0x10a2('0x2c')]);if(_0x31f19a['name']){delete _0x31f19a['name'];}_0x5af51b[_0x10a2('0x1d')](_0x3a2c86)[_0x10a2('0x2d')](_0x31f19a);};}exports['index']=function(_0x41a3cc,_0x213780){var _0x25cbdc={},_0x1a630b={},_0x5ba93b={'count':0x0,'rows':[]};var _0x38be26=_[_0x10a2('0x2e')](db[_0x10a2('0x2f')][_0x10a2('0x30')],function(_0x954681){return{'name':_0x954681[_0x10a2('0x31')],'type':_0x954681[_0x10a2('0x32')][_0x10a2('0x33')]};});_0x1a630b[_0x10a2('0x34')]=_['map'](_0x38be26,_0x10a2('0x35'));_0x1a630b['query']=_[_0x10a2('0x36')](_0x41a3cc[_0x10a2('0x37')]);_0x1a630b[_0x10a2('0x38')]=_[_0x10a2('0x39')](_0x1a630b[_0x10a2('0x34')],_0x1a630b[_0x10a2('0x37')]);_0x25cbdc[_0x10a2('0x3a')]=_[_0x10a2('0x39')](_0x1a630b['model'],qs['fields'](_0x41a3cc['query'][_0x10a2('0x3b')]));_0x25cbdc['attributes']=_0x25cbdc[_0x10a2('0x3a')][_0x10a2('0x3c')]?_0x25cbdc[_0x10a2('0x3a')]:_0x1a630b[_0x10a2('0x34')];if(!_0x41a3cc['query'][_0x10a2('0x3d')](_0x10a2('0x3e'))){_0x25cbdc['limit']=qs[_0x10a2('0x23')](_0x41a3cc[_0x10a2('0x37')][_0x10a2('0x23')]);_0x25cbdc['offset']=qs[_0x10a2('0x20')](_0x41a3cc[_0x10a2('0x37')][_0x10a2('0x20')]);}_0x25cbdc['order']=qs[_0x10a2('0x3f')](_0x41a3cc['query']['sort']);_0x25cbdc[_0x10a2('0x40')]=qs['filters'](_[_0x10a2('0x41')](_0x41a3cc['query'],_0x1a630b[_0x10a2('0x38')]),_0x38be26);if(_0x41a3cc[_0x10a2('0x37')][_0x10a2('0x42')]){_0x25cbdc[_0x10a2('0x40')]=_['merge'](_0x25cbdc[_0x10a2('0x40')],{'$or':_[_0x10a2('0x2e')](_0x38be26,function(_0x15a4c1){if(_0x15a4c1[_0x10a2('0x32')]!=='VIRTUAL'){var _0x241c55={};_0x241c55[_0x15a4c1[_0x10a2('0x35')]]={'$like':'%'+_0x41a3cc[_0x10a2('0x37')][_0x10a2('0x42')]+'%'};return _0x241c55;}})});}_0x25cbdc=_['merge']({},_0x25cbdc,_0x41a3cc[_0x10a2('0x43')]);var _0x1fa436={'where':_0x25cbdc[_0x10a2('0x40')]};return db[_0x10a2('0x2f')][_0x10a2('0x22')](_0x1fa436)[_0x10a2('0x29')](function(_0x1ab2fe){_0x5ba93b[_0x10a2('0x22')]=_0x1ab2fe;if(_0x41a3cc[_0x10a2('0x37')][_0x10a2('0x44')]){_0x25cbdc[_0x10a2('0x45')]=[{'all':!![]}];}return db[_0x10a2('0x2f')][_0x10a2('0x46')](_0x25cbdc);})[_0x10a2('0x29')](function(_0x24ca31){_0x5ba93b[_0x10a2('0x47')]=_0x24ca31;return _0x5ba93b;})['then'](respondWithFilteredResult(_0x213780,_0x25cbdc))['catch'](handleError(_0x213780,null));};exports['show']=function(_0x1379a9,_0x1f59a3){var _0x1c77b4={'raw':!![],'where':{'id':_0x1379a9[_0x10a2('0x48')]['id']}},_0x2fbcef={};_0x2fbcef[_0x10a2('0x34')]=_['keys'](db[_0x10a2('0x2f')][_0x10a2('0x30')]);_0x2fbcef[_0x10a2('0x37')]=_['keys'](_0x1379a9['query']);_0x2fbcef[_0x10a2('0x38')]=_[_0x10a2('0x39')](_0x2fbcef[_0x10a2('0x34')],_0x2fbcef['query']);_0x1c77b4[_0x10a2('0x3a')]=_[_0x10a2('0x39')](_0x2fbcef[_0x10a2('0x34')],qs[_0x10a2('0x3b')](_0x1379a9[_0x10a2('0x37')][_0x10a2('0x3b')]));_0x1c77b4[_0x10a2('0x3a')]=_0x1c77b4[_0x10a2('0x3a')][_0x10a2('0x3c')]?_0x1c77b4['attributes']:_0x2fbcef[_0x10a2('0x34')];if(_0x1379a9[_0x10a2('0x37')][_0x10a2('0x44')]){_0x1c77b4[_0x10a2('0x45')]=[{'all':!![]}];}_0x1c77b4=_[_0x10a2('0x49')]({},_0x1c77b4,_0x1379a9[_0x10a2('0x43')]);return db[_0x10a2('0x2f')][_0x10a2('0x4a')](_0x1c77b4)[_0x10a2('0x29')](handleEntityNotFound(_0x1f59a3,null))[_0x10a2('0x29')](respondWithResult(_0x1f59a3,null))['catch'](handleError(_0x1f59a3,null));};exports['create']=function(_0x169b93,_0x14cb5c){return db[_0x10a2('0x2f')][_0x10a2('0x4b')](_0x169b93[_0x10a2('0x4c')],{})['then'](respondWithResult(_0x14cb5c,0xc9))['catch'](handleError(_0x14cb5c,null));};exports['update']=function(_0x242216,_0x37f339){if(_0x242216[_0x10a2('0x4c')]['id']){delete _0x242216[_0x10a2('0x4c')]['id'];}return db['SmsTransferReport'][_0x10a2('0x4a')]({'where':{'id':_0x242216[_0x10a2('0x48')]['id']}})[_0x10a2('0x29')](handleEntityNotFound(_0x37f339,null))[_0x10a2('0x29')](saveUpdates(_0x242216[_0x10a2('0x4c')],null))[_0x10a2('0x29')](respondWithResult(_0x37f339,null))[_0x10a2('0x4d')](handleError(_0x37f339,null));};exports['destroy']=function(_0x3876e3,_0x53c1d1){return db[_0x10a2('0x2f')][_0x10a2('0x4a')]({'where':{'id':_0x3876e3[_0x10a2('0x48')]['id']}})[_0x10a2('0x29')](handleEntityNotFound(_0x53c1d1,null))['then'](removeEntity(_0x53c1d1,null))[_0x10a2('0x4d')](handleError(_0x53c1d1,null));};exports[_0x10a2('0x4e')]=function(_0x128c12,_0x465594){return db['SmsTransferReport'][_0x10a2('0x4e')]()['then'](respondWithResult(_0x465594,null))[_0x10a2('0x4d')](handleError(_0x465594,null));};
\ No newline at end of file
index b3991e4..edd6d60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71c8=['util','../../config/logger','bluebird','path','../../config/environment','./smsTransferReport.attributes','exports','SmsTransferReport','uniqueid','lodash'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0x71c8,0x149));var _0x871c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x71c8[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x871c('0x0'));var util=require(_0x871c('0x1'));var logger=require(_0x871c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x871c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x871c('0x4'));var rimraf=require('rimraf');var config=require(_0x871c('0x5'));var attributes=require(_0x871c('0x6'));module[_0x871c('0x7')]=function(_0x225544,_0x412b3b){return _0x225544['define'](_0x871c('0x8'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x871c('0x9'),'fields':[_0x871c('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4d61=['api','moment','bluebird','request-promise','path','rimraf','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x2e5ed1,_0x44a2de){var _0x4de5c9=function(_0x4711d6){while(--_0x4711d6){_0x2e5ed1['push'](_0x2e5ed1['shift']());}};_0x4de5c9(++_0x44a2de);}(_0x4d61,0x147));var _0x14d6=function(_0x220131,_0x48de07){_0x220131=_0x220131-0x0;var _0x1744dd=_0x4d61[_0x220131];return _0x1744dd;};'use strict';var _=require(_0x14d6('0x0'));var util=require(_0x14d6('0x1'));var logger=require(_0x14d6('0x2'))(_0x14d6('0x3'));var moment=require(_0x14d6('0x4'));var BPromise=require(_0x14d6('0x5'));var rp=require(_0x14d6('0x6'));var fs=require('fs');var path=require(_0x14d6('0x7'));var rimraf=require(_0x14d6('0x8'));var config=require('../../config/environment');var attributes=require(_0x14d6('0x9'));module[_0x14d6('0xa')]=function(_0x2920fe,_0x11b2c0){return _0x2920fe[_0x14d6('0xb')](_0x14d6('0xc'),attributes,{'tableName':_0x14d6('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x14d6('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 666b5ac..cd6daa6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fc6=['request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s'];(function(_0x5b07be,_0x197f2a){var _0x203af7=function(_0x4e9536){while(--_0x4e9536){_0x5b07be['push'](_0x5b07be['shift']());}};_0x203af7(++_0x197f2a);}(_0x3fc6,0x159));var _0x63fc=function(_0x3b30a2,_0x5e3954){_0x3b30a2=_0x3b30a2-0x0;var _0x4251c4=_0x3fc6[_0x3b30a2];return _0x4251c4;};'use strict';var _=require(_0x63fc('0x0'));var util=require(_0x63fc('0x1'));var moment=require(_0x63fc('0x2'));var BPromise=require('bluebird');var rs=require(_0x63fc('0x3'));var fs=require('fs');var Redis=require(_0x63fc('0x4'));var db=require(_0x63fc('0x5'))['db'];var utils=require(_0x63fc('0x6'));var logger=require(_0x63fc('0x7'))(_0x63fc('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x63fc('0x9')][_0x63fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa0d23e,_0x48cc45,_0x7d7e64){return new BPromise(function(_0x3e182f,_0x5da412){return client[_0x63fc('0xb')](_0xa0d23e,_0x7d7e64)[_0x63fc('0xc')](function(_0x231e48){logger[_0x63fc('0xd')](_0x63fc('0xe'),_0x48cc45,_0x63fc('0xf'));logger[_0x63fc('0x10')](_0x63fc('0x11'),_0x48cc45,_0x63fc('0xf'),JSON[_0x63fc('0x12')](_0x231e48));if(_0x231e48['error']){if(_0x231e48[_0x63fc('0x13')][_0x63fc('0x14')]===0x1f4){logger[_0x63fc('0x13')]('SmsTransferReport,\x20%s,\x20%s',_0x48cc45,_0x231e48['error'][_0x63fc('0x15')]);return _0x5da412(_0x231e48[_0x63fc('0x13')][_0x63fc('0x15')]);}logger[_0x63fc('0x13')](_0x63fc('0xe'),_0x48cc45,_0x231e48[_0x63fc('0x13')]['message']);return _0x3e182f(_0x231e48[_0x63fc('0x13')][_0x63fc('0x15')]);}else{logger[_0x63fc('0xd')](_0x63fc('0xe'),_0x48cc45,'request\x20sent');_0x3e182f(_0x231e48[_0x63fc('0x16')]['message']);}})[_0x63fc('0x17')](function(_0x35631f){logger[_0x63fc('0x13')](_0x63fc('0xe'),_0x48cc45,_0x35631f);_0x5da412(_0x35631f);});});}
\ No newline at end of file
+var _0xb7a7=['error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0xb4436a,_0x1d9ff8){var _0xa970de=function(_0x1494bb){while(--_0x1494bb){_0xb4436a['push'](_0xb4436a['shift']());}};_0xa970de(++_0x1d9ff8);}(_0xb7a7,0x6e));var _0x7b7a=function(_0x4562c2,_0x1c6058){_0x4562c2=_0x4562c2-0x0;var _0x483775=_0xb7a7[_0x4562c2];return _0x483775;};'use strict';var _=require(_0x7b7a('0x0'));var util=require(_0x7b7a('0x1'));var moment=require(_0x7b7a('0x2'));var BPromise=require(_0x7b7a('0x3'));var rs=require(_0x7b7a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7b7a('0x5'));var logger=require(_0x7b7a('0x6'))(_0x7b7a('0x7'));var config=require('../../config/environment');var jayson=require(_0x7b7a('0x8'));var client=jayson[_0x7b7a('0x9')][_0x7b7a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf003bc,_0x8e6a84,_0x1ef0f3){return new BPromise(function(_0x27e956,_0x2e09b4){return client[_0x7b7a('0xb')](_0xf003bc,_0x1ef0f3)['then'](function(_0x3f1125){logger['info'](_0x7b7a('0xc'),_0x8e6a84,_0x7b7a('0xd'));logger[_0x7b7a('0xe')](_0x7b7a('0xf'),_0x8e6a84,_0x7b7a('0xd'),JSON['stringify'](_0x3f1125));if(_0x3f1125['error']){if(_0x3f1125['error']['code']===0x1f4){logger[_0x7b7a('0x10')](_0x7b7a('0xc'),_0x8e6a84,_0x3f1125['error'][_0x7b7a('0x11')]);return _0x2e09b4(_0x3f1125[_0x7b7a('0x10')][_0x7b7a('0x11')]);}logger[_0x7b7a('0x10')](_0x7b7a('0xc'),_0x8e6a84,_0x3f1125[_0x7b7a('0x10')][_0x7b7a('0x11')]);return _0x27e956(_0x3f1125[_0x7b7a('0x10')][_0x7b7a('0x11')]);}else{logger[_0x7b7a('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x8e6a84,'request\x20sent');_0x27e956(_0x3f1125[_0x7b7a('0x13')][_0x7b7a('0x11')]);}})[_0x7b7a('0x14')](function(_0x41f0a8){logger[_0x7b7a('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x8e6a84,_0x41f0a8);_0x2e09b4(_0x41f0a8);});});}
\ No newline at end of file
index 47f42bc..7028f98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63f2=['./sound.controller','get','index','/:id','show','/:id/download','isAuthenticated','download','diskStorage','root','server/files/sounds/original/','originalname','replace','format','basename','extname','post','single','create','put','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2af30d,_0x4e99e4){var _0x3197ea=function(_0x10eab0){while(--_0x10eab0){_0x2af30d['push'](_0x2af30d['shift']());}};_0x3197ea(++_0x4e99e4);}(_0x63f2,0x19b));var _0x263f=function(_0x4280b9,_0x6b9719){_0x4280b9=_0x4280b9-0x0;var _0x5959a7=_0x63f2[_0x4280b9];return _0x5959a7;};'use strict';var multer=require(_0x263f('0x0'));var util=require(_0x263f('0x1'));var path=require(_0x263f('0x2'));var timeout=require(_0x263f('0x3'));var express=require(_0x263f('0x4'));var router=express[_0x263f('0x5')]();var fs_extra=require(_0x263f('0x6'));var auth=require(_0x263f('0x7'));var interaction=require(_0x263f('0x8'));var config=require('../../config/environment');var controller=require(_0x263f('0x9'));router[_0x263f('0xa')]('/',auth['isAuthenticated'](),controller[_0x263f('0xb')]);router[_0x263f('0xa')](_0x263f('0xc'),auth['isAuthenticated'](),controller[_0x263f('0xd')]);router[_0x263f('0xa')](_0x263f('0xe'),auth[_0x263f('0xf')](),controller[_0x263f('0x10')]);var upload=multer({'storage':multer[_0x263f('0x11')]({'destination':function(_0x58a102,_0x359664,_0x1cf081){_0x1cf081(null,path['join'](config[_0x263f('0x12')],_0x263f('0x13')));},'filename':function(_0x3a2814,_0xf7b58e,_0x2ca797){_0xf7b58e[_0x263f('0x14')]=_0xf7b58e[_0x263f('0x14')][_0x263f('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2ca797(null,util[_0x263f('0x16')]('%s-%s%s',path[_0x263f('0x17')](_0xf7b58e[_0x263f('0x14')],path[_0x263f('0x18')](_0xf7b58e[_0x263f('0x14')])),Date['now'](),path['extname'](_0xf7b58e['originalname'])));}})});router[_0x263f('0x19')]('/',upload[_0x263f('0x1a')]('file'),controller[_0x263f('0x1b')]);router[_0x263f('0x1c')](_0x263f('0xc'),auth[_0x263f('0xf')](),controller['update']);router[_0x263f('0x1d')](_0x263f('0xc'),auth[_0x263f('0xf')](),controller[_0x263f('0x1d')]);module['exports']=router;
\ No newline at end of file
+var _0x94c5=['util','path','fs-extra','../../components/auth/service','isAuthenticated','index','show','get','/:id/download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','create','put','/:id','update','delete','exports','multer'];(function(_0x46d811,_0x2bde59){var _0x144840=function(_0x14ef02){while(--_0x14ef02){_0x46d811['push'](_0x46d811['shift']());}};_0x144840(++_0x2bde59);}(_0x94c5,0xef));var _0x594c=function(_0x1abcf7,_0x5b677c){_0x1abcf7=_0x1abcf7-0x0;var _0x423736=_0x94c5[_0x1abcf7];return _0x423736;};'use strict';var multer=require(_0x594c('0x0'));var util=require(_0x594c('0x1'));var path=require(_0x594c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x594c('0x3'));var auth=require(_0x594c('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./sound.controller');router['get']('/',auth[_0x594c('0x5')](),controller[_0x594c('0x6')]);router['get']('/:id',auth[_0x594c('0x5')](),controller[_0x594c('0x7')]);router[_0x594c('0x8')](_0x594c('0x9'),auth[_0x594c('0x5')](),controller['download']);var upload=multer({'storage':multer[_0x594c('0xa')]({'destination':function(_0x539208,_0x334c36,_0x266b68){_0x266b68(null,path[_0x594c('0xb')](config[_0x594c('0xc')],_0x594c('0xd')));},'filename':function(_0x100efb,_0x3bf4d7,_0x230880){_0x3bf4d7[_0x594c('0xe')]=_0x3bf4d7[_0x594c('0xe')][_0x594c('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x230880(null,util[_0x594c('0x10')](_0x594c('0x11'),path[_0x594c('0x12')](_0x3bf4d7[_0x594c('0xe')],path[_0x594c('0x13')](_0x3bf4d7[_0x594c('0xe')])),Date[_0x594c('0x14')](),path['extname'](_0x3bf4d7['originalname'])));}})});router[_0x594c('0x15')]('/',upload[_0x594c('0x16')](_0x594c('0x17')),controller[_0x594c('0x18')]);router[_0x594c('0x19')](_0x594c('0x1a'),auth[_0x594c('0x5')](),controller[_0x594c('0x1b')]);router['delete'](_0x594c('0x1a'),auth[_0x594c('0x5')](),controller[_0x594c('0x1c')]);module[_0x594c('0x1d')]=router;
\ No newline at end of file
index dd5b716..c909b02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8440=['INTEGER','sequelize','exports','STRING','FLOAT','BIGINT'];(function(_0x7fd79e,_0x7abf8c){var _0x14ef62=function(_0x19e4e5){while(--_0x19e4e5){_0x7fd79e['push'](_0x7fd79e['shift']());}};_0x14ef62(++_0x7abf8c);}(_0x8440,0x187));var _0x0844=function(_0x32689c,_0x1e5ad2){_0x32689c=_0x32689c-0x0;var _0xce38dd=_0x8440[_0x32689c];return _0xce38dd;};'use strict';var Sequelize=require(_0x0844('0x0'));module[_0x0844('0x1')]={'name':{'type':Sequelize[_0x0844('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x0844('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x0844('0x2')]},'original_format':{'type':Sequelize[_0x0844('0x2')]},'original_duration':{'type':Sequelize[_0x0844('0x3')]},'original_sampleCount':{'type':Sequelize[_0x0844('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x0844('0x4')]},'original_sampleRate':{'type':Sequelize[_0x0844('0x5')]},'converted_format':{'type':Sequelize[_0x0844('0x2')]},'converted_duration':{'type':Sequelize[_0x0844('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x0844('0x4')]},'converted_channelCount':{'type':Sequelize[_0x0844('0x5')]},'converted_bitRate':{'type':Sequelize[_0x0844('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x0844('0x5')]}};
\ No newline at end of file
+var _0xf3e0=['name','FLOAT','BIGINT','INTEGER','sequelize','STRING'];(function(_0x402c43,_0x51fbd2){var _0x575fe2=function(_0x2b1658){while(--_0x2b1658){_0x402c43['push'](_0x402c43['shift']());}};_0x575fe2(++_0x51fbd2);}(_0xf3e0,0xa0));var _0x0f3e=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xf3e0[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x0f3e('0x0'));module['exports']={'name':{'type':Sequelize[_0x0f3e('0x1')],'unique':_0x0f3e('0x2'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x0f3e('0x1')]},'original_format':{'type':Sequelize[_0x0f3e('0x1')]},'original_duration':{'type':Sequelize[_0x0f3e('0x3')]},'original_sampleCount':{'type':Sequelize[_0x0f3e('0x4')]},'original_channelCount':{'type':Sequelize[_0x0f3e('0x5')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x0f3e('0x1')]},'converted_duration':{'type':Sequelize[_0x0f3e('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x0f3e('0x4')]},'converted_channelCount':{'type':Sequelize[_0x0f3e('0x5')]},'converted_bitRate':{'type':Sequelize[_0x0f3e('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x0f3e('0x5')]}};
\ No newline at end of file
index 91b7a92..ffcacff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6050=['get','Sounds','UserProfileResource','stack','send','index','map','Sound','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','VIRTUAL','options','catch','show','includeAll','include','find','download','save_name','converted_format','existsSync','join','server/files/sounds/converted','ValidationError','Sound\x20not\x20found','root','format','%s.%s','create','basename','file','originalname','filename','extname','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','error','unlinkSync','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','chmodSync','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','params','description','original_format','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','Content-Range','apply','save','update','then','destroy'];(function(_0xd973df,_0x4d4289){var _0x440273=function(_0x479158){while(--_0x479158){_0xd973df['push'](_0xd973df['shift']());}};_0x440273(++_0x4d4289);}(_0x6050,0x154));var _0x0605=function(_0x4c0368,_0x2d9b3f){_0x4c0368=_0x4c0368-0x0;var _0x11cc37=_0x6050[_0x4c0368];return _0x11cc37;};'use strict';var emlformat=require(_0x0605('0x0'));var rimraf=require(_0x0605('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0605('0x2'));var rp=require('request-promise');var moment=require(_0x0605('0x3'));var BPromise=require(_0x0605('0x4'));var Mustache=require(_0x0605('0x5'));var util=require(_0x0605('0x6'));var path=require('path');var sox=require(_0x0605('0x7'));var csv=require('to-csv');var ejs=require(_0x0605('0x8'));var fs=require('fs');var fs_extra=require(_0x0605('0x9'));var _=require('lodash');var squel=require(_0x0605('0xa'));var crypto=require(_0x0605('0xb'));var jsforce=require(_0x0605('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0605('0xd'));var querystring=require(_0x0605('0xe'));var Papa=require(_0x0605('0xf'));var Redis=require(_0x0605('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0605('0x11'));var as=require(_0x0605('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0605('0x13'))(_0x0605('0x14'));var utils=require(_0x0605('0x15'));var config=require(_0x0605('0x16'));var licenseUtil=require(_0x0605('0x17'));var db=require(_0x0605('0x18'))['db'];function respondWithStatusCode(_0x3d4caa,_0x5bc4dd){_0x5bc4dd=_0x5bc4dd||0xcc;return function(_0x555f6d){if(_0x555f6d){return _0x3d4caa[_0x0605('0x19')](_0x5bc4dd);}return _0x3d4caa[_0x0605('0x1a')](_0x5bc4dd)[_0x0605('0x1b')]();};}function respondWithResult(_0x5b4b94,_0x587523){_0x587523=_0x587523||0xc8;return function(_0x339b43){if(_0x339b43){return _0x5b4b94[_0x0605('0x1a')](_0x587523)[_0x0605('0x1c')](_0x339b43);}};}function respondWithFilteredResult(_0x3b5a8d,_0x322ef9){return function(_0x478088){if(_0x478088){var _0x450ba9=typeof _0x322ef9[_0x0605('0x1d')]==='undefined'&&typeof _0x322ef9['limit']==='undefined';var _0x17da05=_0x478088[_0x0605('0x1e')];var _0x5e781d=_0x450ba9?0x0:_0x322ef9[_0x0605('0x1d')];var _0xc58f24=_0x450ba9?_0x478088['count']:_0x322ef9[_0x0605('0x1d')]+_0x322ef9[_0x0605('0x1f')];var _0x1a69ae;if(_0xc58f24>=_0x17da05){_0xc58f24=_0x17da05;_0x1a69ae=0xc8;}else{_0x1a69ae=0xce;}_0x3b5a8d['status'](_0x1a69ae);return _0x3b5a8d['set'](_0x0605('0x20'),_0x5e781d+'-'+_0xc58f24+'/'+_0x17da05)[_0x0605('0x1c')](_0x478088);}return null;};}function patchUpdates(_0x3c638a){return function(_0x5e7623){try{jsonpatch[_0x0605('0x21')](_0x5e7623,_0x3c638a,!![]);}catch(_0x5e3afe){return BPromise['reject'](_0x5e3afe);}return _0x5e7623[_0x0605('0x22')]();};}function saveUpdates(_0x5eeb10,_0x3d4d3f){return function(_0x37e399){if(_0x37e399){return _0x37e399[_0x0605('0x23')](_0x5eeb10)[_0x0605('0x24')](function(_0x39161f){return _0x39161f;});}return null;};}function removeEntity(_0x421dcd,_0x3752b5){return function(_0x5ebffd){if(_0x5ebffd){return _0x5ebffd[_0x0605('0x25')]()[_0x0605('0x24')](function(){var _0x1bd1ed=_0x5ebffd[_0x0605('0x26')]({'plain':!![]});var _0x2cc42c=_0x0605('0x27');return db[_0x0605('0x28')][_0x0605('0x25')]({'where':{'type':_0x2cc42c,'resourceId':_0x1bd1ed['id']}})[_0x0605('0x24')](function(){return _0x5ebffd;});})[_0x0605('0x24')](function(){_0x421dcd[_0x0605('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b3645,_0x188fc4){return function(_0x2b4780){if(!_0x2b4780){_0x5b3645[_0x0605('0x19')](0x194);}return _0x2b4780;};}function handleError(_0x5e1eb8,_0x4fc1a1){_0x4fc1a1=_0x4fc1a1||0x1f4;return function(_0x1153ae){logger['error'](_0x1153ae[_0x0605('0x29')]);if(_0x1153ae['name']){delete _0x1153ae['name'];}_0x5e1eb8[_0x0605('0x1a')](_0x4fc1a1)[_0x0605('0x2a')](_0x1153ae);};}exports[_0x0605('0x2b')]=function(_0x1536cc,_0x323cea){var _0x58c1ea={},_0x222c14={},_0x202ba5={'count':0x0,'rows':[]};var _0x507636=_[_0x0605('0x2c')](db[_0x0605('0x2d')][_0x0605('0x2e')],function(_0x12cec5){return{'name':_0x12cec5[_0x0605('0x2f')],'type':_0x12cec5[_0x0605('0x30')][_0x0605('0x31')]};});_0x222c14[_0x0605('0x32')]=_[_0x0605('0x2c')](_0x507636,_0x0605('0x33'));_0x222c14[_0x0605('0x34')]=_[_0x0605('0x35')](_0x1536cc[_0x0605('0x34')]);_0x222c14[_0x0605('0x36')]=_[_0x0605('0x37')](_0x222c14[_0x0605('0x32')],_0x222c14[_0x0605('0x34')]);_0x58c1ea[_0x0605('0x38')]=_[_0x0605('0x37')](_0x222c14[_0x0605('0x32')],qs['fields'](_0x1536cc[_0x0605('0x34')][_0x0605('0x39')]));_0x58c1ea[_0x0605('0x38')]=_0x58c1ea[_0x0605('0x38')][_0x0605('0x3a')]?_0x58c1ea['attributes']:_0x222c14[_0x0605('0x32')];if(!_0x1536cc['query'][_0x0605('0x3b')](_0x0605('0x3c'))){_0x58c1ea[_0x0605('0x1f')]=qs[_0x0605('0x1f')](_0x1536cc[_0x0605('0x34')][_0x0605('0x1f')]);_0x58c1ea[_0x0605('0x1d')]=qs['offset'](_0x1536cc['query'][_0x0605('0x1d')]);}_0x58c1ea['order']=qs[_0x0605('0x3d')](_0x1536cc[_0x0605('0x34')][_0x0605('0x3d')]);_0x58c1ea['where']=qs[_0x0605('0x36')](_[_0x0605('0x3e')](_0x1536cc[_0x0605('0x34')],_0x222c14['filters']),_0x507636);if(_0x1536cc[_0x0605('0x34')][_0x0605('0x3f')]){_0x58c1ea['where']=_[_0x0605('0x40')](_0x58c1ea['where'],{'$or':_[_0x0605('0x2c')](_0x507636,function(_0x5377f2){if(_0x5377f2['type']!==_0x0605('0x41')){var _0x4a496e={};_0x4a496e[_0x5377f2[_0x0605('0x33')]]={'$like':'%'+_0x1536cc[_0x0605('0x34')][_0x0605('0x3f')]+'%'};return _0x4a496e;}})});}_0x58c1ea=_[_0x0605('0x40')]({},_0x58c1ea,_0x1536cc[_0x0605('0x42')]);var _0x28672b={'where':_0x58c1ea['where']};return db[_0x0605('0x2d')][_0x0605('0x1e')](_0x28672b)[_0x0605('0x24')](function(_0x45c32a){_0x202ba5[_0x0605('0x1e')]=_0x45c32a;if(_0x1536cc[_0x0605('0x34')]['includeAll']){_0x58c1ea['include']=[{'all':!![]}];}return db['Sound']['findAll'](_0x58c1ea);})[_0x0605('0x24')](function(_0x3d0776){_0x202ba5['rows']=_0x3d0776;return _0x202ba5;})[_0x0605('0x24')](respondWithFilteredResult(_0x323cea,_0x58c1ea))[_0x0605('0x43')](handleError(_0x323cea,null));};exports[_0x0605('0x44')]=function(_0x1c2a77,_0x1997db){var _0x2a622b={'raw':!![],'where':{'id':_0x1c2a77['params']['id']}},_0x9a0927={};_0x9a0927['model']=_[_0x0605('0x35')](db[_0x0605('0x2d')][_0x0605('0x2e')]);_0x9a0927['query']=_[_0x0605('0x35')](_0x1c2a77['query']);_0x9a0927[_0x0605('0x36')]=_[_0x0605('0x37')](_0x9a0927[_0x0605('0x32')],_0x9a0927[_0x0605('0x34')]);_0x2a622b[_0x0605('0x38')]=_[_0x0605('0x37')](_0x9a0927[_0x0605('0x32')],qs[_0x0605('0x39')](_0x1c2a77[_0x0605('0x34')]['fields']));_0x2a622b[_0x0605('0x38')]=_0x2a622b[_0x0605('0x38')]['length']?_0x2a622b[_0x0605('0x38')]:_0x9a0927[_0x0605('0x32')];if(_0x1c2a77[_0x0605('0x34')][_0x0605('0x45')]){_0x2a622b[_0x0605('0x46')]=[{'all':!![]}];}_0x2a622b=_[_0x0605('0x40')]({},_0x2a622b,_0x1c2a77[_0x0605('0x42')]);return db[_0x0605('0x2d')][_0x0605('0x47')](_0x2a622b)[_0x0605('0x24')](handleEntityNotFound(_0x1997db,null))[_0x0605('0x24')](respondWithResult(_0x1997db,null))[_0x0605('0x43')](handleError(_0x1997db,null));};exports[_0x0605('0x48')]=function(_0x38b767,_0x5c7303,_0x5d846d){return db[_0x0605('0x2d')]['find']({'where':{'id':_0x38b767['params']['id']},'attributes':[_0x0605('0x33'),_0x0605('0x49'),_0x0605('0x4a')],'raw':!![]})[_0x0605('0x24')](handleEntityNotFound(_0x5c7303,null))['then'](function(_0x20564d){if(_0x20564d){if(!fs[_0x0605('0x4b')](path[_0x0605('0x4c')](config['root'],_0x0605('0x4d'),_0x20564d[_0x0605('0x49')]+'.'+_0x20564d[_0x0605('0x4a')]))){throw new db['Sequelize'][(_0x0605('0x4e'))](_0x0605('0x4f'));}return _0x5c7303[_0x0605('0x48')](path['join'](config[_0x0605('0x50')],'server/files/sounds/converted',util[_0x0605('0x51')]('%s.%s',_0x20564d[_0x0605('0x49')],_0x20564d['converted_format'])),util[_0x0605('0x51')](_0x0605('0x52'),_0x20564d[_0x0605('0x33')],_0x20564d['converted_format']));}return null;})[_0x0605('0x43')](handleError(_0x5c7303,null));};exports[_0x0605('0x53')]=function(_0x169d71,_0xa8e457,_0xac8178){var _0x5bba55={'name':path[_0x0605('0x54')](_0x169d71[_0x0605('0x55')][_0x0605('0x56')],path['extname'](_0x169d71['file'][_0x0605('0x56')])),'save_name':path[_0x0605('0x54')](_0x169d71[_0x0605('0x55')][_0x0605('0x57')],path['extname'](_0x169d71[_0x0605('0x55')][_0x0605('0x57')])),'original_format':path[_0x0605('0x58')](_0x169d71[_0x0605('0x55')][_0x0605('0x56')])[_0x0605('0x59')](0x1),'converted_format':_0x0605('0x5a')};var _0x214abd=path['join'](config['root'],_0x0605('0x5b'),_0x169d71[_0x0605('0x55')][_0x0605('0x57')]);var _0x23c2d0=path[_0x0605('0x4c')](config['root'],_0x0605('0x4d'),util[_0x0605('0x51')]('%s.%s',path[_0x0605('0x54')](_0x169d71[_0x0605('0x55')][_0x0605('0x57')],path['extname'](_0x169d71[_0x0605('0x55')][_0x0605('0x57')])),_0x5bba55[_0x0605('0x4a')]));logger[_0x0605('0x5c')](_0x0605('0x5d'),_0x214abd);logger[_0x0605('0x5c')](_0x0605('0x5e'),_0x23c2d0);try{fs['chmodSync'](_0x214abd,parseInt(_0x0605('0x5f'),0x8));var _0x4a1350=sox[_0x0605('0x60')](_0x214abd,_0x23c2d0,{'sampleRate':0x1f40,'format':_0x0605('0x5a'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4a1350['on'](_0x0605('0x61'),function(_0x264690){fs[_0x0605('0x62')](_0x214abd);_0xa8e457[_0x0605('0x1a')](0x1f4)[_0x0605('0x2a')](_0x264690);});_0x4a1350['on']('src',function(_0x501a36){_0x5bba55['original_duration']=isNaN(_0x501a36[_0x0605('0x63')])?null:_0x501a36[_0x0605('0x63')]*0x3e8;_0x5bba55[_0x0605('0x64')]=isNaN(_0x501a36[_0x0605('0x65')])?null:_0x501a36[_0x0605('0x65')];_0x5bba55[_0x0605('0x66')]=isNaN(_0x501a36[_0x0605('0x67')])?null:_0x501a36[_0x0605('0x67')];_0x5bba55[_0x0605('0x68')]=isNaN(_0x501a36[_0x0605('0x69')])?null:_0x501a36[_0x0605('0x69')];_0x5bba55[_0x0605('0x6a')]=isNaN(_0x501a36[_0x0605('0x6b')])?null:_0x501a36[_0x0605('0x6b')];});_0x4a1350['on'](_0x0605('0x6c'),function(_0x248809){_0x5bba55[_0x0605('0x6d')]=isNaN(_0x248809[_0x0605('0x63')])?null:_0x248809[_0x0605('0x63')]*0x3e8;_0x5bba55[_0x0605('0x6e')]=isNaN(_0x248809['sampleCount'])?null:_0x248809['sampleCount'];_0x5bba55[_0x0605('0x6f')]=isNaN(_0x248809[_0x0605('0x67')])?null:_0x248809['channelCount'];_0x5bba55[_0x0605('0x70')]=isNaN(_0x248809[_0x0605('0x69')])?null:_0x248809[_0x0605('0x69')];_0x5bba55[_0x0605('0x71')]=isNaN(_0x248809[_0x0605('0x6b')])?null:_0x248809[_0x0605('0x6b')];});_0x4a1350['on'](_0x0605('0x1b'),function(){fs[_0x0605('0x72')](_0x23c2d0,parseInt(_0x0605('0x5f'),0x8));return db[_0x0605('0x2d')][_0x0605('0x53')](_0x5bba55)[_0x0605('0x24')](function(_0x2b0872){var _0x1ffe51={'role':_0x169d71[_0x0605('0x73')][_0x0605('0x74')],'userProfileId':_0x169d71[_0x0605('0x73')][_0x0605('0x75')]};if(!_0x1ffe51)throw new Error(_0x0605('0x76'));if(_0x1ffe51[_0x0605('0x74')]===_0x0605('0x77')){var _0x5f49e5=_0x2b0872[_0x0605('0x26')]({'plain':!![]});return db['UserProfileSection'][_0x0605('0x47')]({'where':{'name':_0x0605('0x27'),'userProfileId':_0x1ffe51['userProfileId']},'raw':!![]})[_0x0605('0x24')](function(_0xd84d5e){if(_0xd84d5e&&_0xd84d5e[_0x0605('0x78')]===0x0){return db[_0x0605('0x28')]['create']({'name':_0x5f49e5['name'],'resourceId':_0x5f49e5['id'],'type':_0xd84d5e[_0x0605('0x33')],'sectionId':_0xd84d5e['id']},{})[_0x0605('0x24')](function(){return _0x2b0872;});}else{return _0x2b0872;}})[_0x0605('0x43')](function(_0x848eb8){logger[_0x0605('0x61')](_0x0605('0x79'),_0x848eb8);throw _0x848eb8;});}return _0x2b0872;})['then'](respondWithResult(_0xa8e457,null))[_0x0605('0x43')](handleError(_0xa8e457,null));});_0x4a1350[_0x0605('0x7a')]();}catch(_0x140e32){_0xa8e457[_0x0605('0x1a')](0x1f4)[_0x0605('0x2a')](_0x140e32);}};exports['update']=function(_0x2fc653,_0x4a313b,_0x555975){return db['Sound']['find']({'where':{'id':_0x2fc653[_0x0605('0x7b')]['id']}})[_0x0605('0x24')](handleEntityNotFound(_0x4a313b,null))[_0x0605('0x24')](saveUpdates(_['pick'](_0x2fc653[_0x0605('0x73')],['name',_0x0605('0x7c')]),null))['then'](respondWithResult(_0x4a313b,null))[_0x0605('0x43')](handleError(_0x4a313b,null));};exports['delete']=function(_0x1f80c4,_0x402d4d,_0x8e6a35){return db[_0x0605('0x2d')]['find']({'where':{'id':_0x1f80c4[_0x0605('0x7b')]['id']}})['then'](function(_0x147243){if(_0x147243){return _0x147243[_0x0605('0x25')]();}})[_0x0605('0x24')](function(_0x34fd42){var _0x5edfee=path[_0x0605('0x4c')](config[_0x0605('0x50')],_0x0605('0x5b'),util['format'](_0x0605('0x52'),_0x34fd42[_0x0605('0x49')],_0x34fd42[_0x0605('0x7d')]));var _0x2b3db4=path['join'](config[_0x0605('0x50')],_0x0605('0x4d'),util[_0x0605('0x51')](_0x0605('0x52'),_0x34fd42['save_name'],_0x34fd42[_0x0605('0x4a')]));fs[_0x0605('0x62')](_0x5edfee);fs[_0x0605('0x62')](_0x2b3db4);return _0x34fd42;})[_0x0605('0x24')](function(_0x1d6f63){if(_0x1d6f63){return _0x402d4d[_0x0605('0x1a')](0xcc)[_0x0605('0x1b')]();}})[_0x0605('0x24')](handleEntityNotFound(_0x402d4d,null))[_0x0605('0x43')](handleError(_0x402d4d,null));};
\ No newline at end of file
+var _0x8cd7=['filters','intersection','query','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','name','filter','options','includeAll','include','findAll','rows','catch','params','length','find','download','save_name','converted_format','existsSync','root','server/files/sounds/converted','Sequelize','Sound\x20not\x20found','format','%s.%s','create','basename','originalname','extname','file','filename','substring','wav','join','info','chmodSync','0777','error','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','dest','converted_duration','converted_bitRate','converted_sampleRate','body','role','userProfileId','user','UserProfileSection','Sounds','autoAssociation','start','description','server/files/sounds/original','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','json','offset','undefined','count','limit','status','set','apply','reject','save','update','then','destroy','get','UserProfileResource','end','stack','send','index','map','Sound','rawAttributes','fieldName','key','model','keys'];(function(_0x4f86fb,_0x14574d){var _0x211e49=function(_0x1c8829){while(--_0x1c8829){_0x4f86fb['push'](_0x4f86fb['shift']());}};_0x211e49(++_0x14574d);}(_0x8cd7,0x138));var _0x78cd=function(_0x1966ad,_0x43f2f3){_0x1966ad=_0x1966ad-0x0;var _0x5d7637=_0x8cd7[_0x1966ad];return _0x5d7637;};'use strict';var emlformat=require(_0x78cd('0x0'));var rimraf=require(_0x78cd('0x1'));var zipdir=require(_0x78cd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x78cd('0x3'));var moment=require(_0x78cd('0x4'));var BPromise=require(_0x78cd('0x5'));var Mustache=require(_0x78cd('0x6'));var util=require(_0x78cd('0x7'));var path=require(_0x78cd('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x78cd('0x9'));var squel=require('squel');var crypto=require(_0x78cd('0xa'));var jsforce=require(_0x78cd('0xb'));var deskjs=require(_0x78cd('0xc'));var toCsv=require(_0x78cd('0xd'));var querystring=require(_0x78cd('0xe'));var Papa=require('papaparse');var Redis=require(_0x78cd('0xf'));var authService=require(_0x78cd('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x78cd('0x11'));var hardwareService=require(_0x78cd('0x12'));var logger=require(_0x78cd('0x13'))(_0x78cd('0x14'));var utils=require(_0x78cd('0x15'));var config=require(_0x78cd('0x16'));var licenseUtil=require(_0x78cd('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d95f2,_0x1ee0fd){_0x1ee0fd=_0x1ee0fd||0xcc;return function(_0x22ddfe){if(_0x22ddfe){return _0x1d95f2[_0x78cd('0x18')](_0x1ee0fd);}return _0x1d95f2['status'](_0x1ee0fd)['end']();};}function respondWithResult(_0x2926b8,_0x16966a){_0x16966a=_0x16966a||0xc8;return function(_0x3256da){if(_0x3256da){return _0x2926b8['status'](_0x16966a)[_0x78cd('0x19')](_0x3256da);}};}function respondWithFilteredResult(_0x4122b3,_0x2d7701){return function(_0x426e56){if(_0x426e56){var _0x31ce55=typeof _0x2d7701[_0x78cd('0x1a')]===_0x78cd('0x1b')&&typeof _0x2d7701['limit']==='undefined';var _0x3d8f8a=_0x426e56[_0x78cd('0x1c')];var _0xbd2f4d=_0x31ce55?0x0:_0x2d7701[_0x78cd('0x1a')];var _0x1e7305=_0x31ce55?_0x426e56['count']:_0x2d7701[_0x78cd('0x1a')]+_0x2d7701[_0x78cd('0x1d')];var _0x38f7ca;if(_0x1e7305>=_0x3d8f8a){_0x1e7305=_0x3d8f8a;_0x38f7ca=0xc8;}else{_0x38f7ca=0xce;}_0x4122b3[_0x78cd('0x1e')](_0x38f7ca);return _0x4122b3[_0x78cd('0x1f')]('Content-Range',_0xbd2f4d+'-'+_0x1e7305+'/'+_0x3d8f8a)[_0x78cd('0x19')](_0x426e56);}return null;};}function patchUpdates(_0x24db2){return function(_0xf03e8f){try{jsonpatch[_0x78cd('0x20')](_0xf03e8f,_0x24db2,!![]);}catch(_0x26c51f){return BPromise[_0x78cd('0x21')](_0x26c51f);}return _0xf03e8f[_0x78cd('0x22')]();};}function saveUpdates(_0x4571b9,_0x42a96f){return function(_0x26dfbd){if(_0x26dfbd){return _0x26dfbd[_0x78cd('0x23')](_0x4571b9)[_0x78cd('0x24')](function(_0x58742c){return _0x58742c;});}return null;};}function removeEntity(_0x33f4ea,_0x19cd32){return function(_0x5a68d){if(_0x5a68d){return _0x5a68d[_0x78cd('0x25')]()[_0x78cd('0x24')](function(){var _0x54968e=_0x5a68d[_0x78cd('0x26')]({'plain':!![]});var _0x5f3c08='Sounds';return db[_0x78cd('0x27')][_0x78cd('0x25')]({'where':{'type':_0x5f3c08,'resourceId':_0x54968e['id']}})[_0x78cd('0x24')](function(){return _0x5a68d;});})[_0x78cd('0x24')](function(){_0x33f4ea[_0x78cd('0x1e')](0xcc)[_0x78cd('0x28')]();});}};}function handleEntityNotFound(_0x2bdbd7,_0x7c0649){return function(_0x3cc7fc){if(!_0x3cc7fc){_0x2bdbd7['sendStatus'](0x194);}return _0x3cc7fc;};}function handleError(_0x47629a,_0x482701){_0x482701=_0x482701||0x1f4;return function(_0x3068b3){logger['error'](_0x3068b3[_0x78cd('0x29')]);if(_0x3068b3['name']){delete _0x3068b3['name'];}_0x47629a['status'](_0x482701)[_0x78cd('0x2a')](_0x3068b3);};}exports[_0x78cd('0x2b')]=function(_0x499601,_0x247a4d){var _0x194755={},_0x1beb9f={},_0x4e5f0d={'count':0x0,'rows':[]};var _0x1d6482=_[_0x78cd('0x2c')](db[_0x78cd('0x2d')][_0x78cd('0x2e')],function(_0x46c03f){return{'name':_0x46c03f[_0x78cd('0x2f')],'type':_0x46c03f['type'][_0x78cd('0x30')]};});_0x1beb9f[_0x78cd('0x31')]=_[_0x78cd('0x2c')](_0x1d6482,'name');_0x1beb9f['query']=_[_0x78cd('0x32')](_0x499601['query']);_0x1beb9f[_0x78cd('0x33')]=_[_0x78cd('0x34')](_0x1beb9f[_0x78cd('0x31')],_0x1beb9f[_0x78cd('0x35')]);_0x194755['attributes']=_['intersection'](_0x1beb9f[_0x78cd('0x31')],qs[_0x78cd('0x36')](_0x499601['query'][_0x78cd('0x36')]));_0x194755[_0x78cd('0x37')]=_0x194755[_0x78cd('0x37')]['length']?_0x194755[_0x78cd('0x37')]:_0x1beb9f[_0x78cd('0x31')];if(!_0x499601[_0x78cd('0x35')]['hasOwnProperty'](_0x78cd('0x38'))){_0x194755[_0x78cd('0x1d')]=qs[_0x78cd('0x1d')](_0x499601[_0x78cd('0x35')][_0x78cd('0x1d')]);_0x194755[_0x78cd('0x1a')]=qs[_0x78cd('0x1a')](_0x499601[_0x78cd('0x35')]['offset']);}_0x194755[_0x78cd('0x39')]=qs[_0x78cd('0x3a')](_0x499601['query'][_0x78cd('0x3a')]);_0x194755[_0x78cd('0x3b')]=qs[_0x78cd('0x33')](_[_0x78cd('0x3c')](_0x499601['query'],_0x1beb9f[_0x78cd('0x33')]),_0x1d6482);if(_0x499601[_0x78cd('0x35')]['filter']){_0x194755['where']=_[_0x78cd('0x3d')](_0x194755[_0x78cd('0x3b')],{'$or':_[_0x78cd('0x2c')](_0x1d6482,function(_0x252146){if(_0x252146['type']!==_0x78cd('0x3e')){var _0x465e46={};_0x465e46[_0x252146[_0x78cd('0x3f')]]={'$like':'%'+_0x499601[_0x78cd('0x35')][_0x78cd('0x40')]+'%'};return _0x465e46;}})});}_0x194755=_[_0x78cd('0x3d')]({},_0x194755,_0x499601[_0x78cd('0x41')]);var _0xa04976={'where':_0x194755['where']};return db[_0x78cd('0x2d')][_0x78cd('0x1c')](_0xa04976)[_0x78cd('0x24')](function(_0x4f3272){_0x4e5f0d[_0x78cd('0x1c')]=_0x4f3272;if(_0x499601[_0x78cd('0x35')][_0x78cd('0x42')]){_0x194755[_0x78cd('0x43')]=[{'all':!![]}];}return db[_0x78cd('0x2d')][_0x78cd('0x44')](_0x194755);})[_0x78cd('0x24')](function(_0xee67f3){_0x4e5f0d[_0x78cd('0x45')]=_0xee67f3;return _0x4e5f0d;})[_0x78cd('0x24')](respondWithFilteredResult(_0x247a4d,_0x194755))[_0x78cd('0x46')](handleError(_0x247a4d,null));};exports['show']=function(_0xb7913c,_0x455a89){var _0xe16264={'raw':!![],'where':{'id':_0xb7913c[_0x78cd('0x47')]['id']}},_0x2627cd={};_0x2627cd[_0x78cd('0x31')]=_[_0x78cd('0x32')](db[_0x78cd('0x2d')][_0x78cd('0x2e')]);_0x2627cd[_0x78cd('0x35')]=_[_0x78cd('0x32')](_0xb7913c[_0x78cd('0x35')]);_0x2627cd[_0x78cd('0x33')]=_['intersection'](_0x2627cd[_0x78cd('0x31')],_0x2627cd[_0x78cd('0x35')]);_0xe16264['attributes']=_[_0x78cd('0x34')](_0x2627cd[_0x78cd('0x31')],qs[_0x78cd('0x36')](_0xb7913c['query'][_0x78cd('0x36')]));_0xe16264['attributes']=_0xe16264[_0x78cd('0x37')][_0x78cd('0x48')]?_0xe16264[_0x78cd('0x37')]:_0x2627cd[_0x78cd('0x31')];if(_0xb7913c[_0x78cd('0x35')][_0x78cd('0x42')]){_0xe16264[_0x78cd('0x43')]=[{'all':!![]}];}_0xe16264=_[_0x78cd('0x3d')]({},_0xe16264,_0xb7913c[_0x78cd('0x41')]);return db[_0x78cd('0x2d')][_0x78cd('0x49')](_0xe16264)['then'](handleEntityNotFound(_0x455a89,null))['then'](respondWithResult(_0x455a89,null))['catch'](handleError(_0x455a89,null));};exports[_0x78cd('0x4a')]=function(_0x8c16ca,_0x99c983,_0xf790b6){return db[_0x78cd('0x2d')][_0x78cd('0x49')]({'where':{'id':_0x8c16ca['params']['id']},'attributes':[_0x78cd('0x3f'),_0x78cd('0x4b'),_0x78cd('0x4c')],'raw':!![]})[_0x78cd('0x24')](handleEntityNotFound(_0x99c983,null))[_0x78cd('0x24')](function(_0x5d9da5){if(_0x5d9da5){if(!fs[_0x78cd('0x4d')](path['join'](config[_0x78cd('0x4e')],_0x78cd('0x4f'),_0x5d9da5['save_name']+'.'+_0x5d9da5[_0x78cd('0x4c')]))){throw new db[(_0x78cd('0x50'))]['ValidationError'](_0x78cd('0x51'));}return _0x99c983[_0x78cd('0x4a')](path['join'](config[_0x78cd('0x4e')],'server/files/sounds/converted',util[_0x78cd('0x52')](_0x78cd('0x53'),_0x5d9da5['save_name'],_0x5d9da5['converted_format'])),util[_0x78cd('0x52')](_0x78cd('0x53'),_0x5d9da5[_0x78cd('0x3f')],_0x5d9da5[_0x78cd('0x4c')]));}return null;})[_0x78cd('0x46')](handleError(_0x99c983,null));};exports[_0x78cd('0x54')]=function(_0x378817,_0x546a44,_0x5d741d){var _0x3adb50={'name':path[_0x78cd('0x55')](_0x378817['file'][_0x78cd('0x56')],path[_0x78cd('0x57')](_0x378817['file'][_0x78cd('0x56')])),'save_name':path[_0x78cd('0x55')](_0x378817[_0x78cd('0x58')][_0x78cd('0x59')],path['extname'](_0x378817['file'][_0x78cd('0x59')])),'original_format':path[_0x78cd('0x57')](_0x378817[_0x78cd('0x58')][_0x78cd('0x56')])[_0x78cd('0x5a')](0x1),'converted_format':_0x78cd('0x5b')};var _0x3cfd5d=path[_0x78cd('0x5c')](config[_0x78cd('0x4e')],'server/files/sounds/original',_0x378817['file'][_0x78cd('0x59')]);var _0x26adec=path[_0x78cd('0x5c')](config[_0x78cd('0x4e')],_0x78cd('0x4f'),util['format'](_0x78cd('0x53'),path[_0x78cd('0x55')](_0x378817['file'][_0x78cd('0x59')],path[_0x78cd('0x57')](_0x378817['file'][_0x78cd('0x59')])),_0x3adb50[_0x78cd('0x4c')]));logger[_0x78cd('0x5d')]('Sound\x20upload\x20filepath:\x20%s',_0x3cfd5d);logger['info']('Sound\x20upload\x20destination:\x20%s',_0x26adec);try{fs[_0x78cd('0x5e')](_0x3cfd5d,parseInt(_0x78cd('0x5f'),0x8));var _0x826878=sox['transcode'](_0x3cfd5d,_0x26adec,{'sampleRate':0x1f40,'format':_0x78cd('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x826878['on'](_0x78cd('0x60'),function(_0x5bf637){fs['unlinkSync'](_0x3cfd5d);_0x546a44[_0x78cd('0x1e')](0x1f4)[_0x78cd('0x2a')](_0x5bf637);});_0x826878['on'](_0x78cd('0x61'),function(_0x1c37fe){_0x3adb50['original_duration']=isNaN(_0x1c37fe[_0x78cd('0x62')])?null:_0x1c37fe[_0x78cd('0x62')]*0x3e8;_0x3adb50[_0x78cd('0x63')]=isNaN(_0x1c37fe[_0x78cd('0x64')])?null:_0x1c37fe[_0x78cd('0x64')];_0x3adb50[_0x78cd('0x65')]=isNaN(_0x1c37fe[_0x78cd('0x66')])?null:_0x1c37fe[_0x78cd('0x66')];_0x3adb50[_0x78cd('0x67')]=isNaN(_0x1c37fe[_0x78cd('0x68')])?null:_0x1c37fe[_0x78cd('0x68')];_0x3adb50['original_sampleRate']=isNaN(_0x1c37fe[_0x78cd('0x69')])?null:_0x1c37fe[_0x78cd('0x69')];});_0x826878['on'](_0x78cd('0x6a'),function(_0x528509){_0x3adb50[_0x78cd('0x6b')]=isNaN(_0x528509[_0x78cd('0x62')])?null:_0x528509[_0x78cd('0x62')]*0x3e8;_0x3adb50['converted_sampleCount']=isNaN(_0x528509[_0x78cd('0x64')])?null:_0x528509[_0x78cd('0x64')];_0x3adb50['converted_channelCount']=isNaN(_0x528509['channelCount'])?null:_0x528509[_0x78cd('0x66')];_0x3adb50[_0x78cd('0x6c')]=isNaN(_0x528509[_0x78cd('0x68')])?null:_0x528509[_0x78cd('0x68')];_0x3adb50[_0x78cd('0x6d')]=isNaN(_0x528509[_0x78cd('0x69')])?null:_0x528509[_0x78cd('0x69')];});_0x826878['on'](_0x78cd('0x28'),function(){fs[_0x78cd('0x5e')](_0x26adec,parseInt(_0x78cd('0x5f'),0x8));return db[_0x78cd('0x2d')][_0x78cd('0x54')](_0x3adb50)[_0x78cd('0x24')](function(_0x5e3359){var _0x160b1d={'role':_0x378817[_0x78cd('0x6e')][_0x78cd('0x6f')],'userProfileId':_0x378817['body'][_0x78cd('0x70')]};if(!_0x160b1d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x160b1d['role']===_0x78cd('0x71')){var _0x755f87=_0x5e3359[_0x78cd('0x26')]({'plain':!![]});return db[_0x78cd('0x72')][_0x78cd('0x49')]({'where':{'name':_0x78cd('0x73'),'userProfileId':_0x160b1d[_0x78cd('0x70')]},'raw':!![]})[_0x78cd('0x24')](function(_0x19d8c8){if(_0x19d8c8&&_0x19d8c8[_0x78cd('0x74')]===0x0){return db['UserProfileResource']['create']({'name':_0x755f87[_0x78cd('0x3f')],'resourceId':_0x755f87['id'],'type':_0x19d8c8['name'],'sectionId':_0x19d8c8['id']},{})[_0x78cd('0x24')](function(){return _0x5e3359;});}else{return _0x5e3359;}})[_0x78cd('0x46')](function(_0x1f0f77){logger[_0x78cd('0x60')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f0f77);throw _0x1f0f77;});}return _0x5e3359;})['then'](respondWithResult(_0x546a44,null))[_0x78cd('0x46')](handleError(_0x546a44,null));});_0x826878[_0x78cd('0x75')]();}catch(_0x530e89){_0x546a44['status'](0x1f4)['send'](_0x530e89);}};exports[_0x78cd('0x23')]=function(_0x202ec6,_0x3c7ae0,_0x3a77c2){return db['Sound']['find']({'where':{'id':_0x202ec6[_0x78cd('0x47')]['id']}})[_0x78cd('0x24')](handleEntityNotFound(_0x3c7ae0,null))[_0x78cd('0x24')](saveUpdates(_[_0x78cd('0x3c')](_0x202ec6[_0x78cd('0x6e')],[_0x78cd('0x3f'),_0x78cd('0x76')]),null))[_0x78cd('0x24')](respondWithResult(_0x3c7ae0,null))['catch'](handleError(_0x3c7ae0,null));};exports['delete']=function(_0x7aeffb,_0x39f529,_0x1787f9){return db[_0x78cd('0x2d')][_0x78cd('0x49')]({'where':{'id':_0x7aeffb[_0x78cd('0x47')]['id']}})['then'](function(_0x53306d){if(_0x53306d){return _0x53306d[_0x78cd('0x25')]();}})['then'](function(_0xb02220){var _0x335ff2=path[_0x78cd('0x5c')](config[_0x78cd('0x4e')],_0x78cd('0x77'),util[_0x78cd('0x52')](_0x78cd('0x53'),_0xb02220[_0x78cd('0x4b')],_0xb02220['original_format']));var _0x528788=path[_0x78cd('0x5c')](config[_0x78cd('0x4e')],_0x78cd('0x4f'),util[_0x78cd('0x52')](_0x78cd('0x53'),_0xb02220[_0x78cd('0x4b')],_0xb02220[_0x78cd('0x4c')]));fs[_0x78cd('0x78')](_0x335ff2);fs[_0x78cd('0x78')](_0x528788);return _0xb02220;})[_0x78cd('0x24')](function(_0x63c37){if(_0x63c37){return _0x39f529[_0x78cd('0x1e')](0xcc)['end']();}})[_0x78cd('0x24')](handleEntityNotFound(_0x39f529,null))['catch'](handleError(_0x39f529,null));};
\ No newline at end of file
index b794f67..2e2026a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb94e=['util','../../config/logger','api','request-promise','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','lodash'];(function(_0x1363e7,_0x1e578b){var _0x1498c6=function(_0x481f13){while(--_0x481f13){_0x1363e7['push'](_0x1363e7['shift']());}};_0x1498c6(++_0x1e578b);}(_0xb94e,0x83));var _0xeb94=function(_0x9d58e0,_0x5ee515){_0x9d58e0=_0x9d58e0-0x0;var _0x5eab07=_0xb94e[_0x9d58e0];return _0x5eab07;};'use strict';var _=require(_0xeb94('0x0'));var util=require(_0xeb94('0x1'));var logger=require(_0xeb94('0x2'))(_0xeb94('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xeb94('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xeb94('0x5'));var attributes=require(_0xeb94('0x6'));module[_0xeb94('0x7')]=function(_0x55472e,_0xfb2f6e){return _0x55472e[_0xeb94('0x8')](_0xeb94('0x9'),attributes,{'tableName':_0xeb94('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xff48=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','lodash','util'];(function(_0x5f0331,_0x24e89a){var _0x44c1a4=function(_0x44d913){while(--_0x44d913){_0x5f0331['push'](_0x5f0331['shift']());}};_0x44c1a4(++_0x24e89a);}(_0xff48,0x184));var _0x8ff4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xff48[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x8ff4('0x0'));var util=require(_0x8ff4('0x1'));var logger=require(_0x8ff4('0x2'))(_0x8ff4('0x3'));var moment=require(_0x8ff4('0x4'));var BPromise=require(_0x8ff4('0x5'));var rp=require(_0x8ff4('0x6'));var fs=require('fs');var path=require(_0x8ff4('0x7'));var rimraf=require(_0x8ff4('0x8'));var config=require(_0x8ff4('0x9'));var attributes=require(_0x8ff4('0xa'));module[_0x8ff4('0xb')]=function(_0x14dd4a,_0xb4d359){return _0x14dd4a[_0x8ff4('0xc')](_0x8ff4('0xd'),attributes,{'tableName':_0x8ff4('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 57612b7..bcd1e10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38de=['client','http','request','then','Sound,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','ShowSound','find','options','raw','attributes','include','map','model','info','stringify','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0x38de,0x111));var _0xe38d=function(_0x573a71,_0x35ce37){_0x573a71=_0x573a71-0x0;var _0x766877=_0x38de[_0x573a71];return _0x766877;};'use strict';var _=require('lodash');var util=require(_0xe38d('0x0'));var moment=require('moment');var BPromise=require(_0xe38d('0x1'));var rs=require(_0xe38d('0x2'));var fs=require('fs');var Redis=require(_0xe38d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe38d('0x4'));var logger=require(_0xe38d('0x5'))('rpc');var config=require(_0xe38d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe38d('0x7')][_0xe38d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x43fa90,_0x599696,_0x331ef0){return new BPromise(function(_0x262c91,_0x4ec0c2){return client[_0xe38d('0x9')](_0x43fa90,_0x331ef0)[_0xe38d('0xa')](function(_0x515221){logger['info'](_0xe38d('0xb'),_0x599696,_0xe38d('0xc'));logger[_0xe38d('0xd')]('Sound,\x20%s,\x20%s,\x20%s',_0x599696,_0xe38d('0xc'),JSON['stringify'](_0x515221));if(_0x515221[_0xe38d('0xe')]){if(_0x515221['error'][_0xe38d('0xf')]===0x1f4){logger[_0xe38d('0xe')](_0xe38d('0xb'),_0x599696,_0x515221[_0xe38d('0xe')][_0xe38d('0x10')]);return _0x4ec0c2(_0x515221[_0xe38d('0xe')]['message']);}logger[_0xe38d('0xe')](_0xe38d('0xb'),_0x599696,_0x515221[_0xe38d('0xe')][_0xe38d('0x10')]);return _0x262c91(_0x515221['error'][_0xe38d('0x10')]);}else{logger['info'](_0xe38d('0xb'),_0x599696,_0xe38d('0xc'));_0x262c91(_0x515221[_0xe38d('0x11')][_0xe38d('0x10')]);}})['catch'](function(_0x1a0df4){logger[_0xe38d('0xe')](_0xe38d('0xb'),_0x599696,_0x1a0df4);_0x4ec0c2(_0x1a0df4);});});}exports[_0xe38d('0x12')]=function(_0x30c759){var _0xcacdc6=this;return new Promise(function(_0x40bf9f,_0x483dd3){return db['Sound'][_0xe38d('0x13')]({'raw':_0x30c759[_0xe38d('0x14')]?_0x30c759['options'][_0xe38d('0x15')]===undefined?!![]:![]:!![],'where':_0x30c759['options']?_0x30c759[_0xe38d('0x14')]['where']||null:null,'attributes':_0x30c759['options']?_0x30c759[_0xe38d('0x14')][_0xe38d('0x16')]||null:null,'include':_0x30c759['options']?_0x30c759[_0xe38d('0x14')][_0xe38d('0x17')]?_['map'](_0x30c759['options']['include'],function(_0x57d48a){return{'model':db[_0x57d48a['model']],'as':_0x57d48a['as'],'attributes':_0x57d48a[_0xe38d('0x16')],'include':_0x57d48a[_0xe38d('0x17')]?_[_0xe38d('0x18')](_0x57d48a[_0xe38d('0x17')],function(_0x10db31){return{'model':db[_0x10db31[_0xe38d('0x19')]],'as':_0x10db31['as'],'attributes':_0x10db31[_0xe38d('0x16')],'include':_0x10db31['include']?_[_0xe38d('0x18')](_0x10db31[_0xe38d('0x17')],function(_0x18f7c3){return{'model':db[_0x18f7c3[_0xe38d('0x19')]],'as':_0x18f7c3['as'],'attributes':_0x18f7c3[_0xe38d('0x16')]};}):[]};}):[]};}):[]:[]})[_0xe38d('0xa')](function(_0x1af707){logger[_0xe38d('0x1a')](_0xe38d('0x12'),_0x30c759);logger[_0xe38d('0xd')](_0xe38d('0x12'),_0x30c759,JSON[_0xe38d('0x1b')](_0x1af707));_0x40bf9f(_0x1af707);})['catch'](function(_0x409b38){logger['error']('ShowSound',_0x409b38[_0xe38d('0x10')],_0x30c759);_0x483dd3(_0xcacdc6[_0xe38d('0xe')](0x1f4,_0x409b38[_0xe38d('0x10')]));});});};
\ No newline at end of file
+var _0xc44d=['message','result','catch','ShowSound','find','options','where','include','map','model','attributes','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Sound,\x20%s,\x20%s'];(function(_0x502036,_0x502686){var _0x485247=function(_0x135ee3){while(--_0x135ee3){_0x502036['push'](_0x502036['shift']());}};_0x485247(++_0x502686);}(_0xc44d,0xb0));var _0xdc44=function(_0x21ce90,_0x4f6d88){_0x21ce90=_0x21ce90-0x0;var _0x1c40e0=_0xc44d[_0x21ce90];return _0x1c40e0;};'use strict';var _=require(_0xdc44('0x0'));var util=require(_0xdc44('0x1'));var moment=require(_0xdc44('0x2'));var BPromise=require('bluebird');var rs=require(_0xdc44('0x3'));var fs=require('fs');var Redis=require(_0xdc44('0x4'));var db=require(_0xdc44('0x5'))['db'];var utils=require(_0xdc44('0x6'));var logger=require(_0xdc44('0x7'))(_0xdc44('0x8'));var config=require(_0xdc44('0x9'));var jayson=require(_0xdc44('0xa'));var client=jayson[_0xdc44('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x112502,_0xa35b1e,_0x325c58){return new BPromise(function(_0x28bb6d,_0x2f1854){return client[_0xdc44('0xc')](_0x112502,_0x325c58)[_0xdc44('0xd')](function(_0x5c604e){logger[_0xdc44('0xe')]('Sound,\x20%s,\x20%s',_0xa35b1e,'request\x20sent');logger[_0xdc44('0xf')](_0xdc44('0x10'),_0xa35b1e,_0xdc44('0x11'),JSON[_0xdc44('0x12')](_0x5c604e));if(_0x5c604e[_0xdc44('0x13')]){if(_0x5c604e[_0xdc44('0x13')][_0xdc44('0x14')]===0x1f4){logger[_0xdc44('0x13')](_0xdc44('0x15'),_0xa35b1e,_0x5c604e[_0xdc44('0x13')][_0xdc44('0x16')]);return _0x2f1854(_0x5c604e['error'][_0xdc44('0x16')]);}logger[_0xdc44('0x13')](_0xdc44('0x15'),_0xa35b1e,_0x5c604e[_0xdc44('0x13')]['message']);return _0x28bb6d(_0x5c604e[_0xdc44('0x13')][_0xdc44('0x16')]);}else{logger[_0xdc44('0xe')](_0xdc44('0x15'),_0xa35b1e,'request\x20sent');_0x28bb6d(_0x5c604e[_0xdc44('0x17')][_0xdc44('0x16')]);}})[_0xdc44('0x18')](function(_0xb88398){logger[_0xdc44('0x13')](_0xdc44('0x15'),_0xa35b1e,_0xb88398);_0x2f1854(_0xb88398);});});}exports[_0xdc44('0x19')]=function(_0x568bfc){var _0x521c17=this;return new Promise(function(_0x521c3d,_0x207e92){return db['Sound'][_0xdc44('0x1a')]({'raw':_0x568bfc['options']?_0x568bfc[_0xdc44('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x568bfc['options']?_0x568bfc[_0xdc44('0x1b')][_0xdc44('0x1c')]||null:null,'attributes':_0x568bfc[_0xdc44('0x1b')]?_0x568bfc[_0xdc44('0x1b')]['attributes']||null:null,'include':_0x568bfc[_0xdc44('0x1b')]?_0x568bfc['options'][_0xdc44('0x1d')]?_[_0xdc44('0x1e')](_0x568bfc[_0xdc44('0x1b')]['include'],function(_0x1a05b3){return{'model':db[_0x1a05b3[_0xdc44('0x1f')]],'as':_0x1a05b3['as'],'attributes':_0x1a05b3[_0xdc44('0x20')],'include':_0x1a05b3[_0xdc44('0x1d')]?_[_0xdc44('0x1e')](_0x1a05b3[_0xdc44('0x1d')],function(_0x118374){return{'model':db[_0x118374[_0xdc44('0x1f')]],'as':_0x118374['as'],'attributes':_0x118374['attributes'],'include':_0x118374[_0xdc44('0x1d')]?_[_0xdc44('0x1e')](_0x118374[_0xdc44('0x1d')],function(_0x120502){return{'model':db[_0x120502[_0xdc44('0x1f')]],'as':_0x120502['as'],'attributes':_0x120502[_0xdc44('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x255d5d){logger[_0xdc44('0xe')]('ShowSound',_0x568bfc);logger['debug'](_0xdc44('0x19'),_0x568bfc,JSON[_0xdc44('0x12')](_0x255d5d));_0x521c3d(_0x255d5d);})[_0xdc44('0x18')](function(_0x402bba){logger[_0xdc44('0x13')](_0xdc44('0x19'),_0x402bba[_0xdc44('0x16')],_0x568bfc);_0x207e92(_0x521c17[_0xdc44('0x13')](0x1f4,_0x402bba['message']));});});};
\ No newline at end of file
index 24dd21b..e6e7d57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['./squareMessage.controller','get','index','isAuthenticated','show','post','create','put','/:id','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1351c0,_0x384100){var _0x4d7e14=function(_0x9e754f){while(--_0x9e754f){_0x1351c0['push'](_0x1351c0['shift']());}};_0x4d7e14(++_0x384100);}(_0xb10b,0x12a));var _0xbb10=function(_0x19ef2b,_0x354f66){_0x19ef2b=_0x19ef2b-0x0;var _0x4df537=_0xb10b[_0x19ef2b];return _0x4df537;};'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('0xd')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['update']);router['delete'](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xb10b=['./squareMessage.controller','get','index','isAuthenticated','show','post','create','put','/:id','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1ceb35,_0x274afb){var _0x37b1ef=function(_0x3b90e2){while(--_0x3b90e2){_0x1ceb35['push'](_0x1ceb35['shift']());}};_0x37b1ef(++_0x274afb);}(_0xb10b,0x12a));var _0xbb10=function(_0x4b1b3a,_0x239438){_0x4b1b3a=_0x4b1b3a-0x0;var _0x203002=_0xb10b[_0x4b1b3a];return _0x203002;};'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('0xd')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['update']);router['delete'](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);module['exports']=router;
\ No newline at end of file
index 5348a97..fcf3b64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6251=['out','STRING','sequelize','exports','TEXT','medium'];(function(_0x415ac8,_0x4d3a83){var _0x419e93=function(_0x321c0f){while(--_0x321c0f){_0x415ac8['push'](_0x415ac8['shift']());}};_0x419e93(++_0x4d3a83);}(_0x6251,0x98));var _0x1625=function(_0x218972,_0x1f9794){_0x218972=_0x218972-0x0;var _0x1bb1a8=_0x6251[_0x218972];return _0x1bb1a8;};'use strict';var Sequelize=require(_0x1625('0x0'));module[_0x1625('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x1625('0x2')](_0x1625('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x1625('0x4')),'defaultValue':_0x1625('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x1625('0x5')]},'providerResponse':{'type':Sequelize[_0x1625('0x2')]}};
\ No newline at end of file
+var _0xe634=['TEXT','medium','ENUM','out','STRING'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0xe634,0x1e9));var _0x4e63=function(_0x4815c5,_0x4e08d8){_0x4815c5=_0x4815c5-0x0;var _0x3406dc=_0xe634[_0x4815c5];return _0x3406dc;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x4e63('0x0')]},'body':{'type':Sequelize[_0x4e63('0x1')](_0x4e63('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x4e63('0x3')]('in',_0x4e63('0x4')),'defaultValue':_0x4e63('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x4e63('0x0')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 4d0cae6..892c60d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94e7=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','error','stack','name','send','map','SquareMessage','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','body','update','destroy','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x4cfe90,_0x416cef){var _0x1471c7=function(_0x137e43){while(--_0x137e43){_0x4cfe90['push'](_0x4cfe90['shift']());}};_0x1471c7(++_0x416cef);}(_0x94e7,0x7c));var _0x794e=function(_0x4c4486,_0x321cfc){_0x4c4486=_0x4c4486-0x0;var _0x10f1d7=_0x94e7[_0x4c4486];return _0x10f1d7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x794e('0x0'));var zipdir=require(_0x794e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x794e('0x2'));var BPromise=require(_0x794e('0x3'));var Mustache=require(_0x794e('0x4'));var util=require('util');var path=require(_0x794e('0x5'));var sox=require(_0x794e('0x6'));var csv=require(_0x794e('0x7'));var ejs=require(_0x794e('0x8'));var fs=require('fs');var fs_extra=require(_0x794e('0x9'));var _=require(_0x794e('0xa'));var squel=require('squel');var crypto=require(_0x794e('0xb'));var jsforce=require(_0x794e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x794e('0x7'));var querystring=require('querystring');var Papa=require(_0x794e('0xd'));var Redis=require('ioredis');var authService=require(_0x794e('0xe'));var qs=require(_0x794e('0xf'));var as=require(_0x794e('0x10'));var hardwareService=require(_0x794e('0x11'));var logger=require(_0x794e('0x12'))(_0x794e('0x13'));var utils=require(_0x794e('0x14'));var config=require(_0x794e('0x15'));var licenseUtil=require(_0x794e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ffc45,_0x546471){_0x546471=_0x546471||0xcc;return function(_0x1e2f12){if(_0x1e2f12){return _0x3ffc45[_0x794e('0x17')](_0x546471);}return _0x3ffc45[_0x794e('0x18')](_0x546471)[_0x794e('0x19')]();};}function respondWithResult(_0x1448d8,_0x28b21b){_0x28b21b=_0x28b21b||0xc8;return function(_0x369a8f){if(_0x369a8f){return _0x1448d8['status'](_0x28b21b)[_0x794e('0x1a')](_0x369a8f);}};}function respondWithFilteredResult(_0x27f5d7,_0x3ebce4){return function(_0x1e3d23){if(_0x1e3d23){var _0x3c2b97=typeof _0x3ebce4[_0x794e('0x1b')]===_0x794e('0x1c')&&typeof _0x3ebce4[_0x794e('0x1d')]==='undefined';var _0xf2450b=_0x1e3d23[_0x794e('0x1e')];var _0x553358=_0x3c2b97?0x0:_0x3ebce4[_0x794e('0x1b')];var _0x575d66=_0x3c2b97?_0x1e3d23[_0x794e('0x1e')]:_0x3ebce4[_0x794e('0x1b')]+_0x3ebce4[_0x794e('0x1d')];var _0x39d612;if(_0x575d66>=_0xf2450b){_0x575d66=_0xf2450b;_0x39d612=0xc8;}else{_0x39d612=0xce;}_0x27f5d7[_0x794e('0x18')](_0x39d612);return _0x27f5d7[_0x794e('0x1f')](_0x794e('0x20'),_0x553358+'-'+_0x575d66+'/'+_0xf2450b)[_0x794e('0x1a')](_0x1e3d23);}return null;};}function patchUpdates(_0x5c9cb1){return function(_0x3c8d11){try{jsonpatch[_0x794e('0x21')](_0x3c8d11,_0x5c9cb1,!![]);}catch(_0x1d2634){return BPromise[_0x794e('0x22')](_0x1d2634);}return _0x3c8d11['save']();};}function saveUpdates(_0x3035eb,_0x1e6b76){return function(_0x49cbd0){if(_0x49cbd0){return _0x49cbd0['update'](_0x3035eb)[_0x794e('0x23')](function(_0x30394f){return _0x30394f;});}return null;};}function removeEntity(_0x28a633,_0x85bc21){return function(_0xf1ecf9){if(_0xf1ecf9){return _0xf1ecf9['destroy']()[_0x794e('0x23')](function(){_0x28a633['status'](0xcc)[_0x794e('0x19')]();});}};}function handleEntityNotFound(_0xa270ee,_0x435af0){return function(_0x5a15bd){if(!_0x5a15bd){_0xa270ee[_0x794e('0x17')](0x194);}return _0x5a15bd;};}function handleError(_0x559ed7,_0x55f0de){_0x55f0de=_0x55f0de||0x1f4;return function(_0x2dcfdc){logger[_0x794e('0x24')](_0x2dcfdc[_0x794e('0x25')]);if(_0x2dcfdc['name']){delete _0x2dcfdc[_0x794e('0x26')];}_0x559ed7[_0x794e('0x18')](_0x55f0de)[_0x794e('0x27')](_0x2dcfdc);};}exports['index']=function(_0x5e3614,_0x49e5cd){var _0x43c538={},_0x50e98a={},_0xdee2b9={'count':0x0,'rows':[]};var _0x5ebea5=_[_0x794e('0x28')](db[_0x794e('0x29')][_0x794e('0x2a')],function(_0x39318d){return{'name':_0x39318d['fieldName'],'type':_0x39318d[_0x794e('0x2b')]['key']};});_0x50e98a[_0x794e('0x2c')]=_['map'](_0x5ebea5,_0x794e('0x26'));_0x50e98a[_0x794e('0x2d')]=_[_0x794e('0x2e')](_0x5e3614[_0x794e('0x2d')]);_0x50e98a[_0x794e('0x2f')]=_[_0x794e('0x30')](_0x50e98a[_0x794e('0x2c')],_0x50e98a[_0x794e('0x2d')]);_0x43c538[_0x794e('0x31')]=_[_0x794e('0x30')](_0x50e98a['model'],qs[_0x794e('0x32')](_0x5e3614[_0x794e('0x2d')][_0x794e('0x32')]));_0x43c538[_0x794e('0x31')]=_0x43c538['attributes'][_0x794e('0x33')]?_0x43c538[_0x794e('0x31')]:_0x50e98a[_0x794e('0x2c')];if(!_0x5e3614[_0x794e('0x2d')]['hasOwnProperty'](_0x794e('0x34'))){_0x43c538[_0x794e('0x1d')]=qs[_0x794e('0x1d')](_0x5e3614['query']['limit']);_0x43c538[_0x794e('0x1b')]=qs[_0x794e('0x1b')](_0x5e3614['query'][_0x794e('0x1b')]);}_0x43c538[_0x794e('0x35')]=qs[_0x794e('0x36')](_0x5e3614[_0x794e('0x2d')]['sort']);_0x43c538[_0x794e('0x37')]=qs[_0x794e('0x2f')](_['pick'](_0x5e3614[_0x794e('0x2d')],_0x50e98a[_0x794e('0x2f')]),_0x5ebea5);if(_0x5e3614['query'][_0x794e('0x38')]){_0x43c538[_0x794e('0x37')]=_['merge'](_0x43c538['where'],{'$or':_[_0x794e('0x28')](_0x5ebea5,function(_0x2f8655){if(_0x2f8655[_0x794e('0x2b')]!==_0x794e('0x39')){var _0x1820b7={};_0x1820b7[_0x2f8655[_0x794e('0x26')]]={'$like':'%'+_0x5e3614[_0x794e('0x2d')]['filter']+'%'};return _0x1820b7;}})});}_0x43c538=_[_0x794e('0x3a')]({},_0x43c538,_0x5e3614[_0x794e('0x3b')]);var _0x2249f8={'where':_0x43c538['where']};return db[_0x794e('0x29')][_0x794e('0x1e')](_0x2249f8)[_0x794e('0x23')](function(_0x52c6c4){_0xdee2b9[_0x794e('0x1e')]=_0x52c6c4;if(_0x5e3614[_0x794e('0x2d')][_0x794e('0x3c')]){_0x43c538[_0x794e('0x3d')]=[{'all':!![]}];}return db[_0x794e('0x29')]['findAll'](_0x43c538);})[_0x794e('0x23')](function(_0x1445f2){_0xdee2b9[_0x794e('0x3e')]=_0x1445f2;return _0xdee2b9;})[_0x794e('0x23')](respondWithFilteredResult(_0x49e5cd,_0x43c538))[_0x794e('0x3f')](handleError(_0x49e5cd,null));};exports[_0x794e('0x40')]=function(_0x310fee,_0x5df390){var _0x583ff0={'raw':!![],'where':{'id':_0x310fee[_0x794e('0x41')]['id']}},_0x4535dd={};_0x4535dd['model']=_[_0x794e('0x2e')](db[_0x794e('0x29')][_0x794e('0x2a')]);_0x4535dd['query']=_['keys'](_0x310fee['query']);_0x4535dd[_0x794e('0x2f')]=_['intersection'](_0x4535dd[_0x794e('0x2c')],_0x4535dd['query']);_0x583ff0[_0x794e('0x31')]=_[_0x794e('0x30')](_0x4535dd[_0x794e('0x2c')],qs[_0x794e('0x32')](_0x310fee[_0x794e('0x2d')][_0x794e('0x32')]));_0x583ff0[_0x794e('0x31')]=_0x583ff0[_0x794e('0x31')][_0x794e('0x33')]?_0x583ff0[_0x794e('0x31')]:_0x4535dd[_0x794e('0x2c')];if(_0x310fee[_0x794e('0x2d')]['includeAll']){_0x583ff0[_0x794e('0x3d')]=[{'all':!![]}];}_0x583ff0=_['merge']({},_0x583ff0,_0x310fee[_0x794e('0x3b')]);return db[_0x794e('0x29')][_0x794e('0x42')](_0x583ff0)['then'](handleEntityNotFound(_0x5df390,null))[_0x794e('0x23')](respondWithResult(_0x5df390,null))['catch'](handleError(_0x5df390,null));};exports[_0x794e('0x43')]=function(_0x3f1b15,_0x5c41d0){return db[_0x794e('0x29')][_0x794e('0x43')](_0x3f1b15[_0x794e('0x44')],{})[_0x794e('0x23')](respondWithResult(_0x5c41d0,0xc9))[_0x794e('0x3f')](handleError(_0x5c41d0,null));};exports[_0x794e('0x45')]=function(_0x35525e,_0x528cc2){if(_0x35525e[_0x794e('0x44')]['id']){delete _0x35525e[_0x794e('0x44')]['id'];}return db[_0x794e('0x29')]['find']({'where':{'id':_0x35525e[_0x794e('0x41')]['id']}})[_0x794e('0x23')](handleEntityNotFound(_0x528cc2,null))[_0x794e('0x23')](saveUpdates(_0x35525e[_0x794e('0x44')],null))['then'](respondWithResult(_0x528cc2,null))[_0x794e('0x3f')](handleError(_0x528cc2,null));};exports[_0x794e('0x46')]=function(_0x252ce3,_0x2f2d8f){return db[_0x794e('0x29')]['find']({'where':{'id':_0x252ce3[_0x794e('0x41')]['id']}})['then'](handleEntityNotFound(_0x2f2d8f,null))[_0x794e('0x23')](removeEntity(_0x2f2d8f,null))[_0x794e('0x3f')](handleError(_0x2f2d8f,null));};
\ No newline at end of file
+var _0xfd0c=['fieldName','type','key','model','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','query','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','SquareMessage'];(function(_0x5834c7,_0x596152){var _0x151d83=function(_0x14ec39){while(--_0x14ec39){_0x5834c7['push'](_0x5834c7['shift']());}};_0x151d83(++_0x596152);}(_0xfd0c,0x139));var _0xcfd0=function(_0x52598d,_0x10fb73){_0x52598d=_0x52598d-0x0;var _0x170309=_0xfd0c[_0x52598d];return _0x170309;};'use strict';var emlformat=require(_0xcfd0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcfd0('0x1'));var jsonpatch=require(_0xcfd0('0x2'));var rp=require(_0xcfd0('0x3'));var moment=require(_0xcfd0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcfd0('0x5'));var util=require(_0xcfd0('0x6'));var path=require(_0xcfd0('0x7'));var sox=require(_0xcfd0('0x8'));var csv=require(_0xcfd0('0x9'));var ejs=require(_0xcfd0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcfd0('0xb'));var squel=require(_0xcfd0('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcfd0('0xd'));var toCsv=require(_0xcfd0('0x9'));var querystring=require(_0xcfd0('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcfd0('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcfd0('0x10'));var logger=require(_0xcfd0('0x11'))(_0xcfd0('0x12'));var utils=require(_0xcfd0('0x13'));var config=require(_0xcfd0('0x14'));var licenseUtil=require(_0xcfd0('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x511053,_0x4154c9){_0x4154c9=_0x4154c9||0xcc;return function(_0x2db9f8){if(_0x2db9f8){return _0x511053[_0xcfd0('0x16')](_0x4154c9);}return _0x511053[_0xcfd0('0x17')](_0x4154c9)[_0xcfd0('0x18')]();};}function respondWithResult(_0x2e0f77,_0x1fc853){_0x1fc853=_0x1fc853||0xc8;return function(_0x405238){if(_0x405238){return _0x2e0f77[_0xcfd0('0x17')](_0x1fc853)[_0xcfd0('0x19')](_0x405238);}};}function respondWithFilteredResult(_0x31b72d,_0x4c442d){return function(_0x27da27){if(_0x27da27){var _0x26da90=typeof _0x4c442d[_0xcfd0('0x1a')]===_0xcfd0('0x1b')&&typeof _0x4c442d[_0xcfd0('0x1c')]===_0xcfd0('0x1b');var _0xe34306=_0x27da27[_0xcfd0('0x1d')];var _0x4dcf1d=_0x26da90?0x0:_0x4c442d['offset'];var _0x3568cd=_0x26da90?_0x27da27['count']:_0x4c442d['offset']+_0x4c442d[_0xcfd0('0x1c')];var _0x36fba2;if(_0x3568cd>=_0xe34306){_0x3568cd=_0xe34306;_0x36fba2=0xc8;}else{_0x36fba2=0xce;}_0x31b72d[_0xcfd0('0x17')](_0x36fba2);return _0x31b72d['set'](_0xcfd0('0x1e'),_0x4dcf1d+'-'+_0x3568cd+'/'+_0xe34306)[_0xcfd0('0x19')](_0x27da27);}return null;};}function patchUpdates(_0x28b582){return function(_0x43a216){try{jsonpatch[_0xcfd0('0x1f')](_0x43a216,_0x28b582,!![]);}catch(_0x2f9484){return BPromise[_0xcfd0('0x20')](_0x2f9484);}return _0x43a216[_0xcfd0('0x21')]();};}function saveUpdates(_0x2542db,_0x36e064){return function(_0x58608c){if(_0x58608c){return _0x58608c[_0xcfd0('0x22')](_0x2542db)[_0xcfd0('0x23')](function(_0x1f298a){return _0x1f298a;});}return null;};}function removeEntity(_0x1a6ce0,_0x45eb25){return function(_0x5cd1e9){if(_0x5cd1e9){return _0x5cd1e9[_0xcfd0('0x24')]()[_0xcfd0('0x23')](function(){_0x1a6ce0[_0xcfd0('0x17')](0xcc)[_0xcfd0('0x18')]();});}};}function handleEntityNotFound(_0x16edd4,_0x5f5484){return function(_0x9f7812){if(!_0x9f7812){_0x16edd4[_0xcfd0('0x16')](0x194);}return _0x9f7812;};}function handleError(_0x70b191,_0x2a3152){_0x2a3152=_0x2a3152||0x1f4;return function(_0x1ff734){logger['error'](_0x1ff734[_0xcfd0('0x25')]);if(_0x1ff734[_0xcfd0('0x26')]){delete _0x1ff734[_0xcfd0('0x26')];}_0x70b191[_0xcfd0('0x17')](_0x2a3152)[_0xcfd0('0x27')](_0x1ff734);};}exports['index']=function(_0x2edf53,_0x5b6ab4){var _0x13d901={},_0x2aafef={},_0x3d906a={'count':0x0,'rows':[]};var _0x34a140=_[_0xcfd0('0x28')](db[_0xcfd0('0x29')]['rawAttributes'],function(_0x4a3f34){return{'name':_0x4a3f34[_0xcfd0('0x2a')],'type':_0x4a3f34[_0xcfd0('0x2b')][_0xcfd0('0x2c')]};});_0x2aafef[_0xcfd0('0x2d')]=_[_0xcfd0('0x28')](_0x34a140,_0xcfd0('0x26'));_0x2aafef['query']=_[_0xcfd0('0x2e')](_0x2edf53['query']);_0x2aafef['filters']=_['intersection'](_0x2aafef[_0xcfd0('0x2d')],_0x2aafef['query']);_0x13d901['attributes']=_[_0xcfd0('0x2f')](_0x2aafef[_0xcfd0('0x2d')],qs['fields'](_0x2edf53['query'][_0xcfd0('0x30')]));_0x13d901[_0xcfd0('0x31')]=_0x13d901[_0xcfd0('0x31')][_0xcfd0('0x32')]?_0x13d901['attributes']:_0x2aafef[_0xcfd0('0x2d')];if(!_0x2edf53['query'][_0xcfd0('0x33')](_0xcfd0('0x34'))){_0x13d901['limit']=qs[_0xcfd0('0x1c')](_0x2edf53[_0xcfd0('0x35')]['limit']);_0x13d901[_0xcfd0('0x1a')]=qs[_0xcfd0('0x1a')](_0x2edf53[_0xcfd0('0x35')]['offset']);}_0x13d901['order']=qs['sort'](_0x2edf53[_0xcfd0('0x35')]['sort']);_0x13d901[_0xcfd0('0x36')]=qs[_0xcfd0('0x37')](_[_0xcfd0('0x38')](_0x2edf53[_0xcfd0('0x35')],_0x2aafef[_0xcfd0('0x37')]),_0x34a140);if(_0x2edf53[_0xcfd0('0x35')][_0xcfd0('0x39')]){_0x13d901['where']=_[_0xcfd0('0x3a')](_0x13d901[_0xcfd0('0x36')],{'$or':_['map'](_0x34a140,function(_0xe847ef){if(_0xe847ef[_0xcfd0('0x2b')]!==_0xcfd0('0x3b')){var _0xcd7bf1={};_0xcd7bf1[_0xe847ef[_0xcfd0('0x26')]]={'$like':'%'+_0x2edf53[_0xcfd0('0x35')][_0xcfd0('0x39')]+'%'};return _0xcd7bf1;}})});}_0x13d901=_[_0xcfd0('0x3a')]({},_0x13d901,_0x2edf53[_0xcfd0('0x3c')]);var _0x526b92={'where':_0x13d901[_0xcfd0('0x36')]};return db[_0xcfd0('0x29')][_0xcfd0('0x1d')](_0x526b92)[_0xcfd0('0x23')](function(_0x2b1aa8){_0x3d906a[_0xcfd0('0x1d')]=_0x2b1aa8;if(_0x2edf53['query'][_0xcfd0('0x3d')]){_0x13d901['include']=[{'all':!![]}];}return db[_0xcfd0('0x29')][_0xcfd0('0x3e')](_0x13d901);})[_0xcfd0('0x23')](function(_0x33c10d){_0x3d906a[_0xcfd0('0x3f')]=_0x33c10d;return _0x3d906a;})[_0xcfd0('0x23')](respondWithFilteredResult(_0x5b6ab4,_0x13d901))[_0xcfd0('0x40')](handleError(_0x5b6ab4,null));};exports[_0xcfd0('0x41')]=function(_0x41ea04,_0x476c2f){var _0x3a7484={'raw':!![],'where':{'id':_0x41ea04[_0xcfd0('0x42')]['id']}},_0x3d3f90={};_0x3d3f90['model']=_[_0xcfd0('0x2e')](db[_0xcfd0('0x29')][_0xcfd0('0x43')]);_0x3d3f90['query']=_[_0xcfd0('0x2e')](_0x41ea04['query']);_0x3d3f90[_0xcfd0('0x37')]=_[_0xcfd0('0x2f')](_0x3d3f90['model'],_0x3d3f90[_0xcfd0('0x35')]);_0x3a7484[_0xcfd0('0x31')]=_[_0xcfd0('0x2f')](_0x3d3f90[_0xcfd0('0x2d')],qs[_0xcfd0('0x30')](_0x41ea04['query'][_0xcfd0('0x30')]));_0x3a7484[_0xcfd0('0x31')]=_0x3a7484[_0xcfd0('0x31')][_0xcfd0('0x32')]?_0x3a7484[_0xcfd0('0x31')]:_0x3d3f90[_0xcfd0('0x2d')];if(_0x41ea04[_0xcfd0('0x35')]['includeAll']){_0x3a7484['include']=[{'all':!![]}];}_0x3a7484=_[_0xcfd0('0x3a')]({},_0x3a7484,_0x41ea04[_0xcfd0('0x3c')]);return db[_0xcfd0('0x29')]['find'](_0x3a7484)['then'](handleEntityNotFound(_0x476c2f,null))[_0xcfd0('0x23')](respondWithResult(_0x476c2f,null))[_0xcfd0('0x40')](handleError(_0x476c2f,null));};exports[_0xcfd0('0x44')]=function(_0x19c32a,_0x262cf3){return db[_0xcfd0('0x29')][_0xcfd0('0x44')](_0x19c32a[_0xcfd0('0x45')],{})[_0xcfd0('0x23')](respondWithResult(_0x262cf3,0xc9))[_0xcfd0('0x40')](handleError(_0x262cf3,null));};exports['update']=function(_0x3632fc,_0x338309){if(_0x3632fc['body']['id']){delete _0x3632fc['body']['id'];}return db[_0xcfd0('0x29')][_0xcfd0('0x46')]({'where':{'id':_0x3632fc['params']['id']}})['then'](handleEntityNotFound(_0x338309,null))[_0xcfd0('0x23')](saveUpdates(_0x3632fc[_0xcfd0('0x45')],null))[_0xcfd0('0x23')](respondWithResult(_0x338309,null))[_0xcfd0('0x40')](handleError(_0x338309,null));};exports[_0xcfd0('0x24')]=function(_0x2b32f2,_0x4dd4a8){return db[_0xcfd0('0x29')]['find']({'where':{'id':_0x2b32f2[_0xcfd0('0x42')]['id']}})['then'](handleEntityNotFound(_0x4dd4a8,null))['then'](removeEntity(_0x4dd4a8,null))[_0xcfd0('0x40')](handleError(_0x4dd4a8,null));};
\ No newline at end of file
index 13fadcc..08020fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb8c=['util','../../config/logger','bluebird','request-promise','path','./squareMessage.attributes','define','SquareMessage','lodash'];(function(_0x2c3a8f,_0x374e56){var _0x189412=function(_0x560055){while(--_0x560055){_0x2c3a8f['push'](_0x2c3a8f['shift']());}};_0x189412(++_0x374e56);}(_0xeb8c,0x170));var _0xceb8=function(_0x378220,_0x1b7a77){_0x378220=_0x378220-0x0;var _0x23e11e=_0xeb8c[_0x378220];return _0x23e11e;};'use strict';var _=require(_0xceb8('0x0'));var util=require(_0xceb8('0x1'));var logger=require(_0xceb8('0x2'))('api');var moment=require('moment');var BPromise=require(_0xceb8('0x3'));var rp=require(_0xceb8('0x4'));var fs=require('fs');var path=require(_0xceb8('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xceb8('0x6'));module['exports']=function(_0x233ede,_0x7a0155){return _0x233ede[_0xceb8('0x7')](_0xceb8('0x8'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x39a3=['square_messages','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareMessage.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x39a3,0x199));var _0x339a=function(_0x159779,_0x39d008){_0x159779=_0x159779-0x0;var _0x6c937f=_0x39a3[_0x159779];return _0x6c937f;};'use strict';var _=require(_0x339a('0x0'));var util=require(_0x339a('0x1'));var logger=require(_0x339a('0x2'))(_0x339a('0x3'));var moment=require(_0x339a('0x4'));var BPromise=require(_0x339a('0x5'));var rp=require(_0x339a('0x6'));var fs=require('fs');var path=require(_0x339a('0x7'));var rimraf=require('rimraf');var config=require(_0x339a('0x8'));var attributes=require(_0x339a('0x9'));module[_0x339a('0xa')]=function(_0x2058dd,_0x2b2784){return _0x2058dd['define']('SquareMessage',attributes,{'tableName':_0x339a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c122cf0..43422e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66f7=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','CreateSquareMessage','SquareMessage','create','body','options','raw','debug','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x50ee3b,_0x53d24a){var _0x5612cd=function(_0x3398a7){while(--_0x3398a7){_0x50ee3b['push'](_0x50ee3b['shift']());}};_0x5612cd(++_0x53d24a);}(_0x66f7,0x15b));var _0x766f=function(_0x794207,_0x54a989){_0x794207=_0x794207-0x0;var _0x4ee1c9=_0x66f7[_0x794207];return _0x4ee1c9;};'use strict';var _=require(_0x766f('0x0'));var util=require(_0x766f('0x1'));var moment=require(_0x766f('0x2'));var BPromise=require(_0x766f('0x3'));var rs=require(_0x766f('0x4'));var fs=require('fs');var Redis=require(_0x766f('0x5'));var db=require(_0x766f('0x6'))['db'];var utils=require(_0x766f('0x7'));var logger=require(_0x766f('0x8'))(_0x766f('0x9'));var config=require(_0x766f('0xa'));var jayson=require(_0x766f('0xb'));var client=jayson[_0x766f('0xc')][_0x766f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x488d6f,_0x367164,_0x1064d8){return new BPromise(function(_0x400aff,_0x186e1d){return client[_0x766f('0xe')](_0x488d6f,_0x1064d8)[_0x766f('0xf')](function(_0x18460a){logger[_0x766f('0x10')]('SquareMessage,\x20%s,\x20%s',_0x367164,_0x766f('0x11'));logger['debug'](_0x766f('0x12'),_0x367164,_0x766f('0x11'),JSON[_0x766f('0x13')](_0x18460a));if(_0x18460a[_0x766f('0x14')]){if(_0x18460a[_0x766f('0x14')][_0x766f('0x15')]===0x1f4){logger['error'](_0x766f('0x16'),_0x367164,_0x18460a[_0x766f('0x14')][_0x766f('0x17')]);return _0x186e1d(_0x18460a[_0x766f('0x14')][_0x766f('0x17')]);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x367164,_0x18460a[_0x766f('0x14')][_0x766f('0x17')]);return _0x400aff(_0x18460a[_0x766f('0x14')][_0x766f('0x17')]);}else{logger['info']('SquareMessage,\x20%s,\x20%s',_0x367164,_0x766f('0x11'));_0x400aff(_0x18460a['result'][_0x766f('0x17')]);}})['catch'](function(_0x185b0e){logger[_0x766f('0x14')]('SquareMessage,\x20%s,\x20%s',_0x367164,_0x185b0e);_0x186e1d(_0x185b0e);});});}exports[_0x766f('0x18')]=function(_0x1d1e22){var _0x475e22=this;return new Promise(function(_0x1d024b,_0x189de4){return db[_0x766f('0x19')][_0x766f('0x1a')](_0x1d1e22[_0x766f('0x1b')],{'raw':_0x1d1e22['options']?_0x1d1e22[_0x766f('0x1c')][_0x766f('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x173fa2){logger[_0x766f('0x10')](_0x766f('0x18'),_0x1d1e22);logger[_0x766f('0x1e')]('CreateSquareMessage',_0x1d1e22,JSON[_0x766f('0x13')](_0x173fa2));_0x1d024b(_0x173fa2);})[_0x766f('0x1f')](function(_0x3a621d){logger[_0x766f('0x14')]('CreateSquareMessage',_0x3a621d['message'],_0x1d1e22);_0x189de4(_0x475e22[_0x766f('0x14')](0x1f4,_0x3a621d[_0x766f('0x17')]));});});};
\ No newline at end of file
+var _0x887c=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','SquareMessage,\x20%s,\x20%s','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','lodash'];(function(_0x3bd808,_0x400e41){var _0x510e6f=function(_0x9e60b9){while(--_0x9e60b9){_0x3bd808['push'](_0x3bd808['shift']());}};_0x510e6f(++_0x400e41);}(_0x887c,0x15b));var _0xc887=function(_0x432723,_0x31e971){_0x432723=_0x432723-0x0;var _0x4f4991=_0x887c[_0x432723];return _0x4f4991;};'use strict';var _=require(_0xc887('0x0'));var util=require(_0xc887('0x1'));var moment=require(_0xc887('0x2'));var BPromise=require(_0xc887('0x3'));var rs=require(_0xc887('0x4'));var fs=require('fs');var Redis=require(_0xc887('0x5'));var db=require(_0xc887('0x6'))['db'];var utils=require(_0xc887('0x7'));var logger=require(_0xc887('0x8'))('rpc');var config=require(_0xc887('0x9'));var jayson=require(_0xc887('0xa'));var client=jayson[_0xc887('0xb')][_0xc887('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x233e86,_0x554a9b,_0x30d8af){return new BPromise(function(_0x276501,_0x27efd0){return client[_0xc887('0xd')](_0x233e86,_0x30d8af)[_0xc887('0xe')](function(_0x24d73){logger['info'](_0xc887('0xf'),_0x554a9b,'request\x20sent');logger['debug'](_0xc887('0x10'),_0x554a9b,_0xc887('0x11'),JSON[_0xc887('0x12')](_0x24d73));if(_0x24d73['error']){if(_0x24d73[_0xc887('0x13')]['code']===0x1f4){logger[_0xc887('0x13')](_0xc887('0xf'),_0x554a9b,_0x24d73[_0xc887('0x13')][_0xc887('0x14')]);return _0x27efd0(_0x24d73[_0xc887('0x13')][_0xc887('0x14')]);}logger[_0xc887('0x13')]('SquareMessage,\x20%s,\x20%s',_0x554a9b,_0x24d73[_0xc887('0x13')][_0xc887('0x14')]);return _0x276501(_0x24d73[_0xc887('0x13')][_0xc887('0x14')]);}else{logger[_0xc887('0x15')](_0xc887('0xf'),_0x554a9b,'request\x20sent');_0x276501(_0x24d73['result']['message']);}})[_0xc887('0x16')](function(_0x54ec74){logger[_0xc887('0x13')]('SquareMessage,\x20%s,\x20%s',_0x554a9b,_0x54ec74);_0x27efd0(_0x54ec74);});});}exports[_0xc887('0x17')]=function(_0x14cd0a){var _0x380efb=this;return new Promise(function(_0x55b2ea,_0x11f3f5){return db[_0xc887('0x18')][_0xc887('0x19')](_0x14cd0a[_0xc887('0x1a')],{'raw':_0x14cd0a[_0xc887('0x1b')]?_0x14cd0a[_0xc887('0x1b')][_0xc887('0x1c')]===undefined?!![]:![]:!![]})[_0xc887('0xe')](function(_0x38b653){logger[_0xc887('0x15')]('CreateSquareMessage',_0x14cd0a);logger['debug'](_0xc887('0x17'),_0x14cd0a,JSON['stringify'](_0x38b653));_0x55b2ea(_0x38b653);})[_0xc887('0x16')](function(_0x3aedbf){logger[_0xc887('0x13')](_0xc887('0x17'),_0x3aedbf[_0xc887('0x14')],_0x14cd0a);_0x11f3f5(_0x380efb['error'](0x1f4,_0x3aedbf[_0xc887('0x14')]));});});};
\ No newline at end of file
index f6d1ef3..5760606 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3aef=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','index','/:id','show','/:id/test','isAuthenticated','15s','test','post','create','delete','destroy'];(function(_0x397bfb,_0x589665){var _0x16c9b9=function(_0x13ce8a){while(--_0x13ce8a){_0x397bfb['push'](_0x397bfb['shift']());}};_0x16c9b9(++_0x589665);}(_0x3aef,0xf2));var _0xf3ae=function(_0x45d20f,_0x134b3d){_0x45d20f=_0x45d20f-0x0;var _0xcbbc4a=_0x3aef[_0x45d20f];return _0xcbbc4a;};'use strict';var multer=require(_0xf3ae('0x0'));var util=require(_0xf3ae('0x1'));var path=require(_0xf3ae('0x2'));var timeout=require(_0xf3ae('0x3'));var express=require(_0xf3ae('0x4'));var router=express[_0xf3ae('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf3ae('0x6'));var interaction=require(_0xf3ae('0x7'));var config=require(_0xf3ae('0x8'));var controller=require(_0xf3ae('0x9'));router[_0xf3ae('0xa')]('/',auth['isAuthenticated'](),controller[_0xf3ae('0xb')]);router['get'](_0xf3ae('0xc'),auth['isAuthenticated'](),controller[_0xf3ae('0xd')]);router[_0xf3ae('0xa')](_0xf3ae('0xe'),auth[_0xf3ae('0xf')](),timeout(_0xf3ae('0x10')),controller[_0xf3ae('0x11')]);router[_0xf3ae('0x12')]('/',auth[_0xf3ae('0xf')](),controller[_0xf3ae('0x13')]);router['put'](_0xf3ae('0xc'),auth[_0xf3ae('0xf')](),controller['update']);router[_0xf3ae('0x14')](_0xf3ae('0xc'),auth[_0xf3ae('0xf')](),controller[_0xf3ae('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x1fd7=['fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','test','post','create','put','delete','destroy','exports','util','path','express','Router'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x1fd7,0x1f0));var _0x71fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1fd7[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x71fd('0x0'));var path=require(_0x71fd('0x1'));var timeout=require('connect-timeout');var express=require(_0x71fd('0x2'));var router=express[_0x71fd('0x3')]();var fs_extra=require(_0x71fd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x71fd('0x5'));var config=require(_0x71fd('0x6'));var controller=require(_0x71fd('0x7'));router[_0x71fd('0x8')]('/',auth[_0x71fd('0x9')](),controller[_0x71fd('0xa')]);router[_0x71fd('0x8')](_0x71fd('0xb'),auth[_0x71fd('0x9')](),controller[_0x71fd('0xc')]);router[_0x71fd('0x8')]('/:id/test',auth['isAuthenticated'](),timeout('15s'),controller[_0x71fd('0xd')]);router[_0x71fd('0xe')]('/',auth[_0x71fd('0x9')](),controller[_0x71fd('0xf')]);router[_0x71fd('0x10')](_0x71fd('0xb'),auth[_0x71fd('0x9')](),controller['update']);router[_0x71fd('0x11')](_0x71fd('0xb'),auth[_0x71fd('0x9')](),controller[_0x71fd('0x12')]);module[_0x71fd('0x13')]=router;
\ No newline at end of file
index cf66489..a023108 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34d2=['STRING','sequelize','exports','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x34d2,0x16d));var _0x234d=function(_0x39ac89,_0x469817){_0x39ac89=_0x39ac89-0x0;var _0x286fe4=_0x34d2[_0x39ac89];return _0x286fe4;};'use strict';var Sequelize=require(_0x234d('0x0'));module[_0x234d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x234d('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x234d('0x3')]},'description':{'type':Sequelize[_0x234d('0x3')]}};
\ No newline at end of file
+var _0xc2da=['name','exports','STRING'];(function(_0x4e5552,_0x19ec4e){var _0x60a338=function(_0x40c70e){while(--_0x40c70e){_0x4e5552['push'](_0x4e5552['shift']());}};_0x60a338(++_0x19ec4e);}(_0xc2da,0xc1));var _0xac2d=function(_0x203b5c,_0x2384f1){_0x203b5c=_0x203b5c-0x0;var _0x20a057=_0xc2da[_0x203b5c];return _0x20a057;};'use strict';var Sequelize=require('sequelize');module[_0xac2d('0x0')]={'name':{'type':Sequelize[_0xac2d('0x1')],'unique':_0xac2d('0x2'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xac2d('0x1')]}};
\ No newline at end of file
index d53ccfe..064e2b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7e4=['dsn','openSync','closeSync','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','sendStatus','status','end','json','undefined','limit','offset','count','set','reject','get','ODBC','UserProfileResource','destroy','then','name','send','index','SquareOdbc','rawAttributes','type','key','model','map','query','keys','attributes','intersection','fields','length','nolimit','sort','filters','pick','where','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','include','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','find','test'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf7e4,0xa5));var _0x4f7e=function(_0x4c99d5,_0x2be683){_0x4c99d5=_0x4c99d5-0x0;var _0x2447bc=_0xf7e4[_0x4c99d5];return _0x2447bc;};'use strict';var emlformat=require(_0x4f7e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4f7e('0x1'));var rp=require(_0x4f7e('0x2'));var moment=require(_0x4f7e('0x3'));var BPromise=require(_0x4f7e('0x4'));var Mustache=require(_0x4f7e('0x5'));var util=require(_0x4f7e('0x6'));var path=require('path');var sox=require(_0x4f7e('0x7'));var csv=require(_0x4f7e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4f7e('0x9'));var crypto=require(_0x4f7e('0xa'));var jsforce=require(_0x4f7e('0xb'));var deskjs=require(_0x4f7e('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4f7e('0xd'));var Papa=require(_0x4f7e('0xe'));var Redis=require(_0x4f7e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4f7e('0x10'));var as=require(_0x4f7e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4f7e('0x12'));var utils=require(_0x4f7e('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ccfe2,_0x5bdeca){_0x5bdeca=_0x5bdeca||0xcc;return function(_0x3d2598){if(_0x3d2598){return _0x1ccfe2[_0x4f7e('0x14')](_0x5bdeca);}return _0x1ccfe2[_0x4f7e('0x15')](_0x5bdeca)[_0x4f7e('0x16')]();};}function respondWithResult(_0x26bc9e,_0x4db6ff){_0x4db6ff=_0x4db6ff||0xc8;return function(_0x3590bd){if(_0x3590bd){return _0x26bc9e[_0x4f7e('0x15')](_0x4db6ff)[_0x4f7e('0x17')](_0x3590bd);}};}function respondWithFilteredResult(_0x1a1dcb,_0x597fc9){return function(_0x53b531){if(_0x53b531){var _0x8a00d4=typeof _0x597fc9['offset']===_0x4f7e('0x18')&&typeof _0x597fc9[_0x4f7e('0x19')]==='undefined';var _0x223024=_0x53b531['count'];var _0x4c08c1=_0x8a00d4?0x0:_0x597fc9[_0x4f7e('0x1a')];var _0x38c6c3=_0x8a00d4?_0x53b531[_0x4f7e('0x1b')]:_0x597fc9['offset']+_0x597fc9['limit'];var _0x589de9;if(_0x38c6c3>=_0x223024){_0x38c6c3=_0x223024;_0x589de9=0xc8;}else{_0x589de9=0xce;}_0x1a1dcb['status'](_0x589de9);return _0x1a1dcb[_0x4f7e('0x1c')]('Content-Range',_0x4c08c1+'-'+_0x38c6c3+'/'+_0x223024)[_0x4f7e('0x17')](_0x53b531);}return null;};}function patchUpdates(_0x326478){return function(_0xb79afe){try{jsonpatch['apply'](_0xb79afe,_0x326478,!![]);}catch(_0x2e599b){return BPromise[_0x4f7e('0x1d')](_0x2e599b);}return _0xb79afe['save']();};}function saveUpdates(_0xea6a5,_0xf4bf22){return function(_0x418870){if(_0x418870){return _0x418870['update'](_0xea6a5)['then'](function(_0x27653c){return _0x27653c;});}return null;};}function removeEntity(_0x516d99,_0x3d90c2){return function(_0x176bad){if(_0x176bad){return _0x176bad['destroy']()['then'](function(){var _0x290538=_0x176bad[_0x4f7e('0x1e')]({'plain':!![]});var _0x58569f=_0x4f7e('0x1f');return db[_0x4f7e('0x20')][_0x4f7e('0x21')]({'where':{'type':_0x58569f,'resourceId':_0x290538['id']}})[_0x4f7e('0x22')](function(){return _0x176bad;});})[_0x4f7e('0x22')](function(){_0x516d99[_0x4f7e('0x15')](0xcc)[_0x4f7e('0x16')]();});}};}function handleEntityNotFound(_0x57d293,_0x10536e){return function(_0x5315cf){if(!_0x5315cf){_0x57d293[_0x4f7e('0x14')](0x194);}return _0x5315cf;};}function handleError(_0x472040,_0x5d2454){_0x5d2454=_0x5d2454||0x1f4;return function(_0x236ab7){logger['error'](_0x236ab7['stack']);if(_0x236ab7[_0x4f7e('0x23')]){delete _0x236ab7['name'];}_0x472040[_0x4f7e('0x15')](_0x5d2454)[_0x4f7e('0x24')](_0x236ab7);};}exports[_0x4f7e('0x25')]=function(_0x4f17e7,_0x11bd09){var _0x3c6f96={},_0x27c588={},_0x1450d5={'count':0x0,'rows':[]};var _0x37c054=_['map'](db[_0x4f7e('0x26')][_0x4f7e('0x27')],function(_0x107d69){return{'name':_0x107d69['fieldName'],'type':_0x107d69[_0x4f7e('0x28')][_0x4f7e('0x29')]};});_0x27c588[_0x4f7e('0x2a')]=_[_0x4f7e('0x2b')](_0x37c054,_0x4f7e('0x23'));_0x27c588[_0x4f7e('0x2c')]=_[_0x4f7e('0x2d')](_0x4f17e7['query']);_0x27c588['filters']=_['intersection'](_0x27c588[_0x4f7e('0x2a')],_0x27c588[_0x4f7e('0x2c')]);_0x3c6f96[_0x4f7e('0x2e')]=_[_0x4f7e('0x2f')](_0x27c588[_0x4f7e('0x2a')],qs[_0x4f7e('0x30')](_0x4f17e7[_0x4f7e('0x2c')][_0x4f7e('0x30')]));_0x3c6f96['attributes']=_0x3c6f96[_0x4f7e('0x2e')][_0x4f7e('0x31')]?_0x3c6f96['attributes']:_0x27c588[_0x4f7e('0x2a')];if(!_0x4f17e7[_0x4f7e('0x2c')]['hasOwnProperty'](_0x4f7e('0x32'))){_0x3c6f96[_0x4f7e('0x19')]=qs[_0x4f7e('0x19')](_0x4f17e7[_0x4f7e('0x2c')][_0x4f7e('0x19')]);_0x3c6f96['offset']=qs['offset'](_0x4f17e7[_0x4f7e('0x2c')][_0x4f7e('0x1a')]);}_0x3c6f96['order']=qs[_0x4f7e('0x33')](_0x4f17e7[_0x4f7e('0x2c')][_0x4f7e('0x33')]);_0x3c6f96['where']=qs[_0x4f7e('0x34')](_[_0x4f7e('0x35')](_0x4f17e7['query'],_0x27c588[_0x4f7e('0x34')]),_0x37c054);if(_0x4f17e7[_0x4f7e('0x2c')]['filter']){_0x3c6f96[_0x4f7e('0x36')]=_[_0x4f7e('0x37')](_0x3c6f96[_0x4f7e('0x36')],{'$or':_[_0x4f7e('0x2b')](_0x37c054,function(_0x2296d3){if(_0x2296d3[_0x4f7e('0x28')]!==_0x4f7e('0x38')){var _0x542dc5={};_0x542dc5[_0x2296d3['name']]={'$like':'%'+_0x4f17e7['query'][_0x4f7e('0x39')]+'%'};return _0x542dc5;}})});}_0x3c6f96=_[_0x4f7e('0x37')]({},_0x3c6f96,_0x4f17e7['options']);var _0x2e0b80={'where':_0x3c6f96['where']};return db[_0x4f7e('0x26')][_0x4f7e('0x1b')](_0x2e0b80)[_0x4f7e('0x22')](function(_0x19d3eb){_0x1450d5[_0x4f7e('0x1b')]=_0x19d3eb;if(_0x4f17e7[_0x4f7e('0x2c')][_0x4f7e('0x3a')]){_0x3c6f96['include']=[{'all':!![]}];}return db['SquareOdbc'][_0x4f7e('0x3b')](_0x3c6f96);})[_0x4f7e('0x22')](function(_0x3868c8){_0x1450d5[_0x4f7e('0x3c')]=_0x3868c8;return _0x1450d5;})['then'](respondWithFilteredResult(_0x11bd09,_0x3c6f96))[_0x4f7e('0x3d')](handleError(_0x11bd09,null));};exports[_0x4f7e('0x3e')]=function(_0x13a0d9,_0x24e384){var _0x49fcb9={'raw':!![],'where':{'id':_0x13a0d9[_0x4f7e('0x3f')]['id']}},_0x29d86f={};_0x29d86f['model']=_[_0x4f7e('0x2d')](db['SquareOdbc'][_0x4f7e('0x27')]);_0x29d86f['query']=_[_0x4f7e('0x2d')](_0x13a0d9[_0x4f7e('0x2c')]);_0x29d86f['filters']=_[_0x4f7e('0x2f')](_0x29d86f[_0x4f7e('0x2a')],_0x29d86f[_0x4f7e('0x2c')]);_0x49fcb9[_0x4f7e('0x2e')]=_['intersection'](_0x29d86f['model'],qs[_0x4f7e('0x30')](_0x13a0d9['query']['fields']));_0x49fcb9[_0x4f7e('0x2e')]=_0x49fcb9['attributes'][_0x4f7e('0x31')]?_0x49fcb9[_0x4f7e('0x2e')]:_0x29d86f[_0x4f7e('0x2a')];if(_0x13a0d9[_0x4f7e('0x2c')]['includeAll']){_0x49fcb9[_0x4f7e('0x40')]=[{'all':!![]}];}_0x49fcb9=_[_0x4f7e('0x37')]({},_0x49fcb9,_0x13a0d9[_0x4f7e('0x41')]);return db[_0x4f7e('0x26')]['find'](_0x49fcb9)['then'](handleEntityNotFound(_0x24e384,null))[_0x4f7e('0x22')](respondWithResult(_0x24e384,null))['catch'](handleError(_0x24e384,null));};exports[_0x4f7e('0x42')]=function(_0x5d6f34,_0x21186f){return db['SquareOdbc'][_0x4f7e('0x42')](_0x5d6f34['body'],{})[_0x4f7e('0x22')](function(_0xcc1524){var _0x1dcb5f=_0x5d6f34[_0x4f7e('0x43')][_0x4f7e('0x1e')]({'plain':!![]});if(!_0x1dcb5f)throw new Error(_0x4f7e('0x44'));if(_0x1dcb5f[_0x4f7e('0x45')]===_0x4f7e('0x43')){var _0x1761df=_0xcc1524['get']({'plain':!![]});var _0x57bec2='ODBC';return db[_0x4f7e('0x46')]['find']({'where':{'name':_0x57bec2,'userProfileId':_0x1dcb5f[_0x4f7e('0x47')]},'raw':!![]})[_0x4f7e('0x22')](function(_0x26bc90){if(_0x26bc90&&_0x26bc90[_0x4f7e('0x48')]===0x0){return db[_0x4f7e('0x20')][_0x4f7e('0x42')]({'name':_0x1761df[_0x4f7e('0x23')],'resourceId':_0x1761df['id'],'type':_0x26bc90['name'],'sectionId':_0x26bc90['id']},{})[_0x4f7e('0x22')](function(){return _0xcc1524;});}else{return _0xcc1524;}})[_0x4f7e('0x3d')](function(_0x1fdc2c){logger['error'](_0x4f7e('0x49'),_0x1fdc2c);throw _0x1fdc2c;});}return _0xcc1524;})[_0x4f7e('0x22')](respondWithResult(_0x21186f,0xc9))['catch'](handleError(_0x21186f,null));};exports[_0x4f7e('0x4a')]=function(_0x1a8073,_0x10162f){if(_0x1a8073[_0x4f7e('0x4b')]['id']){delete _0x1a8073[_0x4f7e('0x4b')]['id'];}return db[_0x4f7e('0x26')][_0x4f7e('0x4c')]({'where':{'id':_0x1a8073[_0x4f7e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x10162f,null))[_0x4f7e('0x22')](saveUpdates(_0x1a8073['body'],null))[_0x4f7e('0x22')](respondWithResult(_0x10162f,null))['catch'](handleError(_0x10162f,null));};exports['destroy']=function(_0x33da77,_0x213525){return db[_0x4f7e('0x26')][_0x4f7e('0x4c')]({'where':{'id':_0x33da77[_0x4f7e('0x3f')]['id']}})[_0x4f7e('0x22')](handleEntityNotFound(_0x213525,null))[_0x4f7e('0x22')](removeEntity(_0x213525,null))[_0x4f7e('0x3d')](handleError(_0x213525,null));};exports[_0x4f7e('0x4d')]=function(_0x47a5fe,_0x3608a8,_0x2d50c5){var _0x52197a;return db['SquareOdbc']['find']({'where':{'id':_0x47a5fe['params']['id']},'attributes':['id',_0x4f7e('0x4e')]})[_0x4f7e('0x22')](handleEntityNotFound(_0x3608a8,null))['then'](function(_0xa2cd6a){if(_0xa2cd6a){var _0x3f4743=require('odbc')();_0x3f4743[_0x4f7e('0x4f')](_0xa2cd6a[_0x4f7e('0x4e')]);_0x3f4743[_0x4f7e('0x50')]();return _0xa2cd6a;}})['then'](respondWithResult(_0x3608a8,null))[_0x4f7e('0x3d')](handleError(_0x3608a8,null));};
\ No newline at end of file
+var _0xa873=['limit','count','set','Content-Range','apply','reject','save','update','then','ODBC','UserProfileResource','destroy','error','stack','name','send','index','SquareOdbc','rawAttributes','fieldName','key','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','dsn','odbc','openSync','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xa873,0xf6));var _0x3a87=function(_0x1fd1c6,_0x235e3b){_0x1fd1c6=_0x1fd1c6-0x0;var _0x28b8dc=_0xa873[_0x1fd1c6];return _0x28b8dc;};'use strict';var emlformat=require(_0x3a87('0x0'));var rimraf=require(_0x3a87('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3a87('0x2'));var moment=require('moment');var BPromise=require(_0x3a87('0x3'));var Mustache=require(_0x3a87('0x4'));var util=require(_0x3a87('0x5'));var path=require(_0x3a87('0x6'));var sox=require(_0x3a87('0x7'));var csv=require(_0x3a87('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3a87('0x9'));var _=require(_0x3a87('0xa'));var squel=require(_0x3a87('0xb'));var crypto=require(_0x3a87('0xc'));var jsforce=require(_0x3a87('0xd'));var deskjs=require(_0x3a87('0xe'));var toCsv=require(_0x3a87('0x8'));var querystring=require(_0x3a87('0xf'));var Papa=require('papaparse');var Redis=require(_0x3a87('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3a87('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a87('0x12'))(_0x3a87('0x13'));var utils=require(_0x3a87('0x14'));var config=require(_0x3a87('0x15'));var licenseUtil=require(_0x3a87('0x16'));var db=require(_0x3a87('0x17'))['db'];function respondWithStatusCode(_0x46c917,_0x591154){_0x591154=_0x591154||0xcc;return function(_0x4573b0){if(_0x4573b0){return _0x46c917[_0x3a87('0x18')](_0x591154);}return _0x46c917[_0x3a87('0x19')](_0x591154)[_0x3a87('0x1a')]();};}function respondWithResult(_0x227324,_0x229227){_0x229227=_0x229227||0xc8;return function(_0x1b4d95){if(_0x1b4d95){return _0x227324[_0x3a87('0x19')](_0x229227)[_0x3a87('0x1b')](_0x1b4d95);}};}function respondWithFilteredResult(_0x14fb40,_0x3117e4){return function(_0xbeac1a){if(_0xbeac1a){var _0x9cb169=typeof _0x3117e4[_0x3a87('0x1c')]===_0x3a87('0x1d')&&typeof _0x3117e4[_0x3a87('0x1e')]===_0x3a87('0x1d');var _0x3ede46=_0xbeac1a[_0x3a87('0x1f')];var _0x3da4aa=_0x9cb169?0x0:_0x3117e4['offset'];var _0x366548=_0x9cb169?_0xbeac1a[_0x3a87('0x1f')]:_0x3117e4[_0x3a87('0x1c')]+_0x3117e4['limit'];var _0x5b1573;if(_0x366548>=_0x3ede46){_0x366548=_0x3ede46;_0x5b1573=0xc8;}else{_0x5b1573=0xce;}_0x14fb40[_0x3a87('0x19')](_0x5b1573);return _0x14fb40[_0x3a87('0x20')](_0x3a87('0x21'),_0x3da4aa+'-'+_0x366548+'/'+_0x3ede46)[_0x3a87('0x1b')](_0xbeac1a);}return null;};}function patchUpdates(_0x5211d7){return function(_0x3a5c62){try{jsonpatch[_0x3a87('0x22')](_0x3a5c62,_0x5211d7,!![]);}catch(_0x7aceb1){return BPromise[_0x3a87('0x23')](_0x7aceb1);}return _0x3a5c62[_0x3a87('0x24')]();};}function saveUpdates(_0x55c37b,_0x5e9850){return function(_0x5b6e33){if(_0x5b6e33){return _0x5b6e33[_0x3a87('0x25')](_0x55c37b)[_0x3a87('0x26')](function(_0x18f503){return _0x18f503;});}return null;};}function removeEntity(_0xa5657,_0x4739b1){return function(_0x4529cc){if(_0x4529cc){return _0x4529cc['destroy']()[_0x3a87('0x26')](function(){var _0x2b1474=_0x4529cc['get']({'plain':!![]});var _0x50e64b=_0x3a87('0x27');return db[_0x3a87('0x28')][_0x3a87('0x29')]({'where':{'type':_0x50e64b,'resourceId':_0x2b1474['id']}})[_0x3a87('0x26')](function(){return _0x4529cc;});})[_0x3a87('0x26')](function(){_0xa5657[_0x3a87('0x19')](0xcc)[_0x3a87('0x1a')]();});}};}function handleEntityNotFound(_0xb52c4e,_0x420577){return function(_0x25f5a5){if(!_0x25f5a5){_0xb52c4e['sendStatus'](0x194);}return _0x25f5a5;};}function handleError(_0xf27786,_0x47e37e){_0x47e37e=_0x47e37e||0x1f4;return function(_0x54ce1c){logger[_0x3a87('0x2a')](_0x54ce1c[_0x3a87('0x2b')]);if(_0x54ce1c['name']){delete _0x54ce1c[_0x3a87('0x2c')];}_0xf27786[_0x3a87('0x19')](_0x47e37e)[_0x3a87('0x2d')](_0x54ce1c);};}exports[_0x3a87('0x2e')]=function(_0x5afe22,_0x322da5){var _0x19dbc0={},_0x537cc9={},_0x45d9b9={'count':0x0,'rows':[]};var _0x8f259=_['map'](db[_0x3a87('0x2f')][_0x3a87('0x30')],function(_0x99b9c4){return{'name':_0x99b9c4[_0x3a87('0x31')],'type':_0x99b9c4['type'][_0x3a87('0x32')]};});_0x537cc9[_0x3a87('0x33')]=_['map'](_0x8f259,'name');_0x537cc9['query']=_[_0x3a87('0x34')](_0x5afe22[_0x3a87('0x35')]);_0x537cc9['filters']=_['intersection'](_0x537cc9[_0x3a87('0x33')],_0x537cc9[_0x3a87('0x35')]);_0x19dbc0[_0x3a87('0x36')]=_[_0x3a87('0x37')](_0x537cc9[_0x3a87('0x33')],qs[_0x3a87('0x38')](_0x5afe22['query']['fields']));_0x19dbc0[_0x3a87('0x36')]=_0x19dbc0[_0x3a87('0x36')]['length']?_0x19dbc0[_0x3a87('0x36')]:_0x537cc9[_0x3a87('0x33')];if(!_0x5afe22[_0x3a87('0x35')][_0x3a87('0x39')](_0x3a87('0x3a'))){_0x19dbc0[_0x3a87('0x1e')]=qs[_0x3a87('0x1e')](_0x5afe22['query'][_0x3a87('0x1e')]);_0x19dbc0[_0x3a87('0x1c')]=qs[_0x3a87('0x1c')](_0x5afe22[_0x3a87('0x35')][_0x3a87('0x1c')]);}_0x19dbc0[_0x3a87('0x3b')]=qs[_0x3a87('0x3c')](_0x5afe22[_0x3a87('0x35')][_0x3a87('0x3c')]);_0x19dbc0[_0x3a87('0x3d')]=qs[_0x3a87('0x3e')](_[_0x3a87('0x3f')](_0x5afe22['query'],_0x537cc9[_0x3a87('0x3e')]),_0x8f259);if(_0x5afe22[_0x3a87('0x35')][_0x3a87('0x40')]){_0x19dbc0['where']=_[_0x3a87('0x41')](_0x19dbc0[_0x3a87('0x3d')],{'$or':_[_0x3a87('0x42')](_0x8f259,function(_0x367d3f){if(_0x367d3f[_0x3a87('0x43')]!==_0x3a87('0x44')){var _0x1ac53f={};_0x1ac53f[_0x367d3f[_0x3a87('0x2c')]]={'$like':'%'+_0x5afe22[_0x3a87('0x35')][_0x3a87('0x40')]+'%'};return _0x1ac53f;}})});}_0x19dbc0=_['merge']({},_0x19dbc0,_0x5afe22[_0x3a87('0x45')]);var _0x5ac4b0={'where':_0x19dbc0[_0x3a87('0x3d')]};return db[_0x3a87('0x2f')][_0x3a87('0x1f')](_0x5ac4b0)[_0x3a87('0x26')](function(_0x3e2242){_0x45d9b9[_0x3a87('0x1f')]=_0x3e2242;if(_0x5afe22[_0x3a87('0x35')][_0x3a87('0x46')]){_0x19dbc0[_0x3a87('0x47')]=[{'all':!![]}];}return db[_0x3a87('0x2f')][_0x3a87('0x48')](_0x19dbc0);})[_0x3a87('0x26')](function(_0x5965fa){_0x45d9b9[_0x3a87('0x49')]=_0x5965fa;return _0x45d9b9;})[_0x3a87('0x26')](respondWithFilteredResult(_0x322da5,_0x19dbc0))[_0x3a87('0x4a')](handleError(_0x322da5,null));};exports[_0x3a87('0x4b')]=function(_0x1dca85,_0x370268){var _0x26e652={'raw':!![],'where':{'id':_0x1dca85[_0x3a87('0x4c')]['id']}},_0x35d5f1={};_0x35d5f1['model']=_[_0x3a87('0x34')](db[_0x3a87('0x2f')]['rawAttributes']);_0x35d5f1[_0x3a87('0x35')]=_[_0x3a87('0x34')](_0x1dca85[_0x3a87('0x35')]);_0x35d5f1[_0x3a87('0x3e')]=_['intersection'](_0x35d5f1[_0x3a87('0x33')],_0x35d5f1['query']);_0x26e652[_0x3a87('0x36')]=_[_0x3a87('0x37')](_0x35d5f1['model'],qs['fields'](_0x1dca85['query'][_0x3a87('0x38')]));_0x26e652[_0x3a87('0x36')]=_0x26e652['attributes']['length']?_0x26e652[_0x3a87('0x36')]:_0x35d5f1[_0x3a87('0x33')];if(_0x1dca85[_0x3a87('0x35')][_0x3a87('0x46')]){_0x26e652[_0x3a87('0x47')]=[{'all':!![]}];}_0x26e652=_[_0x3a87('0x41')]({},_0x26e652,_0x1dca85[_0x3a87('0x45')]);return db[_0x3a87('0x2f')][_0x3a87('0x4d')](_0x26e652)['then'](handleEntityNotFound(_0x370268,null))[_0x3a87('0x26')](respondWithResult(_0x370268,null))[_0x3a87('0x4a')](handleError(_0x370268,null));};exports[_0x3a87('0x4e')]=function(_0x534134,_0x379696){return db[_0x3a87('0x2f')][_0x3a87('0x4e')](_0x534134['body'],{})[_0x3a87('0x26')](function(_0x4297ca){var _0x2b80d9=_0x534134[_0x3a87('0x4f')]['get']({'plain':!![]});if(!_0x2b80d9)throw new Error(_0x3a87('0x50'));if(_0x2b80d9[_0x3a87('0x51')]==='user'){var _0x49d43f=_0x4297ca[_0x3a87('0x52')]({'plain':!![]});var _0x1c6c63=_0x3a87('0x27');return db[_0x3a87('0x53')][_0x3a87('0x4d')]({'where':{'name':_0x1c6c63,'userProfileId':_0x2b80d9[_0x3a87('0x54')]},'raw':!![]})[_0x3a87('0x26')](function(_0x4b979b){if(_0x4b979b&&_0x4b979b[_0x3a87('0x55')]===0x0){return db[_0x3a87('0x28')]['create']({'name':_0x49d43f[_0x3a87('0x2c')],'resourceId':_0x49d43f['id'],'type':_0x4b979b['name'],'sectionId':_0x4b979b['id']},{})[_0x3a87('0x26')](function(){return _0x4297ca;});}else{return _0x4297ca;}})['catch'](function(_0x1f865c){logger[_0x3a87('0x2a')](_0x3a87('0x56'),_0x1f865c);throw _0x1f865c;});}return _0x4297ca;})[_0x3a87('0x26')](respondWithResult(_0x379696,0xc9))[_0x3a87('0x4a')](handleError(_0x379696,null));};exports[_0x3a87('0x25')]=function(_0x8d3f81,_0x1750da){if(_0x8d3f81[_0x3a87('0x57')]['id']){delete _0x8d3f81[_0x3a87('0x57')]['id'];}return db[_0x3a87('0x2f')]['find']({'where':{'id':_0x8d3f81[_0x3a87('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1750da,null))[_0x3a87('0x26')](saveUpdates(_0x8d3f81[_0x3a87('0x57')],null))['then'](respondWithResult(_0x1750da,null))[_0x3a87('0x4a')](handleError(_0x1750da,null));};exports['destroy']=function(_0xe98967,_0x515662){return db[_0x3a87('0x2f')][_0x3a87('0x4d')]({'where':{'id':_0xe98967[_0x3a87('0x4c')]['id']}})['then'](handleEntityNotFound(_0x515662,null))[_0x3a87('0x26')](removeEntity(_0x515662,null))['catch'](handleError(_0x515662,null));};exports[_0x3a87('0x58')]=function(_0xccda91,_0x4ded0e,_0x57a64d){var _0x1fa9f4;return db[_0x3a87('0x2f')][_0x3a87('0x4d')]({'where':{'id':_0xccda91[_0x3a87('0x4c')]['id']},'attributes':['id',_0x3a87('0x59')]})[_0x3a87('0x26')](handleEntityNotFound(_0x4ded0e,null))['then'](function(_0x313a12){if(_0x313a12){var _0x52a2fb=require(_0x3a87('0x5a'))();_0x52a2fb[_0x3a87('0x5b')](_0x313a12[_0x3a87('0x59')]);_0x52a2fb['closeSync']();return _0x313a12;}})[_0x3a87('0x26')](respondWithResult(_0x4ded0e,null))['catch'](handleError(_0x4ded0e,null));};
\ No newline at end of file
index ed5fde8..9bdf732 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12f2=['api','moment','bluebird','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','SquareOdbc','square_odbc','lodash','util','../../config/logger'];(function(_0x44216d,_0x4938a7){var _0xeca523=function(_0x11faf1){while(--_0x11faf1){_0x44216d['push'](_0x44216d['shift']());}};_0xeca523(++_0x4938a7);}(_0x12f2,0x128));var _0x212f=function(_0x4f0177,_0xd0b62){_0x4f0177=_0x4f0177-0x0;var _0x4cfb4b=_0x12f2[_0x4f0177];return _0x4cfb4b;};'use strict';var _=require(_0x212f('0x0'));var util=require(_0x212f('0x1'));var logger=require(_0x212f('0x2'))(_0x212f('0x3'));var moment=require(_0x212f('0x4'));var BPromise=require(_0x212f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x212f('0x6'));var rimraf=require(_0x212f('0x7'));var config=require(_0x212f('0x8'));var attributes=require(_0x212f('0x9'));module[_0x212f('0xa')]=function(_0x4213aa,_0xc701e0){return _0x4213aa['define'](_0x212f('0xb'),attributes,{'tableName':_0x212f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaefa=['moment','bluebird','path','rimraf','../../config/environment','SquareOdbc','square_odbc','lodash','util','../../config/logger','api'];(function(_0x2921be,_0x2ede29){var _0x24db3d=function(_0x54915c){while(--_0x54915c){_0x2921be['push'](_0x2921be['shift']());}};_0x24db3d(++_0x2ede29);}(_0xaefa,0x193));var _0xaaef=function(_0x413350,_0x1511e6){_0x413350=_0x413350-0x0;var _0x375f6b=_0xaefa[_0x413350];return _0x375f6b;};'use strict';var _=require(_0xaaef('0x0'));var util=require(_0xaaef('0x1'));var logger=require(_0xaaef('0x2'))(_0xaaef('0x3'));var moment=require(_0xaaef('0x4'));var BPromise=require(_0xaaef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaaef('0x6'));var rimraf=require(_0xaaef('0x7'));var config=require(_0xaaef('0x8'));var attributes=require('./squareOdbc.attributes');module['exports']=function(_0x178a34,_0x554a11){return _0x178a34['define'](_0xaaef('0x9'),attributes,{'tableName':_0xaaef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dfd579e..22ac5a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf188=['bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','find','options','attributes','map','include','model','ShowSquareOdbc','lodash','util'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0xf188,0x136));var _0x8f18=function(_0x5e9701,_0x2656fa){_0x5e9701=_0x5e9701-0x0;var _0x3e5d44=_0xf188[_0x5e9701];return _0x3e5d44;};'use strict';var _=require(_0x8f18('0x0'));var util=require(_0x8f18('0x1'));var moment=require('moment');var BPromise=require(_0x8f18('0x2'));var rs=require(_0x8f18('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8f18('0x4'));var logger=require(_0x8f18('0x5'))(_0x8f18('0x6'));var config=require('../../config/environment');var jayson=require(_0x8f18('0x7'));var client=jayson['client'][_0x8f18('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5400a3,_0x1b58bd,_0x4f6882){return new BPromise(function(_0x2ef458,_0x44629f){return client['request'](_0x5400a3,_0x4f6882)['then'](function(_0x1a794d){logger['info'](_0x8f18('0x9'),_0x1b58bd,_0x8f18('0xa'));logger[_0x8f18('0xb')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x1b58bd,'request\x20sent',JSON[_0x8f18('0xc')](_0x1a794d));if(_0x1a794d['error']){if(_0x1a794d[_0x8f18('0xd')][_0x8f18('0xe')]===0x1f4){logger[_0x8f18('0xd')](_0x8f18('0x9'),_0x1b58bd,_0x1a794d['error'][_0x8f18('0xf')]);return _0x44629f(_0x1a794d['error']['message']);}logger[_0x8f18('0xd')](_0x8f18('0x9'),_0x1b58bd,_0x1a794d[_0x8f18('0xd')][_0x8f18('0xf')]);return _0x2ef458(_0x1a794d[_0x8f18('0xd')][_0x8f18('0xf')]);}else{logger[_0x8f18('0x10')](_0x8f18('0x9'),_0x1b58bd,'request\x20sent');_0x2ef458(_0x1a794d[_0x8f18('0x11')][_0x8f18('0xf')]);}})[_0x8f18('0x12')](function(_0x3f7a60){logger['error'](_0x8f18('0x9'),_0x1b58bd,_0x3f7a60);_0x44629f(_0x3f7a60);});});}exports['ShowSquareOdbc']=function(_0x3bc610){var _0x4948e4=this;return new Promise(function(_0x2d3f22,_0x253038){return db['SquareOdbc'][_0x8f18('0x13')]({'raw':_0x3bc610[_0x8f18('0x14')]?_0x3bc610[_0x8f18('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x3bc610[_0x8f18('0x14')]?_0x3bc610[_0x8f18('0x14')]['where']||null:null,'attributes':_0x3bc610['options']?_0x3bc610['options'][_0x8f18('0x15')]||null:null,'include':_0x3bc610[_0x8f18('0x14')]?_0x3bc610[_0x8f18('0x14')]['include']?_[_0x8f18('0x16')](_0x3bc610['options'][_0x8f18('0x17')],function(_0x570f42){return{'model':db[_0x570f42[_0x8f18('0x18')]],'as':_0x570f42['as'],'attributes':_0x570f42[_0x8f18('0x15')],'include':_0x570f42[_0x8f18('0x17')]?_[_0x8f18('0x16')](_0x570f42['include'],function(_0x110c03){return{'model':db[_0x110c03[_0x8f18('0x18')]],'as':_0x110c03['as'],'attributes':_0x110c03['attributes'],'include':_0x110c03[_0x8f18('0x17')]?_[_0x8f18('0x16')](_0x110c03[_0x8f18('0x17')],function(_0x20d0b2){return{'model':db[_0x20d0b2[_0x8f18('0x18')]],'as':_0x20d0b2['as'],'attributes':_0x20d0b2[_0x8f18('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a8095){logger[_0x8f18('0x10')](_0x8f18('0x19'),_0x3bc610);logger[_0x8f18('0xb')](_0x8f18('0x19'),_0x3bc610,JSON[_0x8f18('0xc')](_0x5a8095));_0x2d3f22(_0x5a8095);})[_0x8f18('0x12')](function(_0x3d9580){logger[_0x8f18('0xd')](_0x8f18('0x19'),_0x3d9580[_0x8f18('0xf')],_0x3bc610);_0x253038(_0x4948e4[_0x8f18('0xd')](0x1f4,_0x3d9580[_0x8f18('0xf')]));});});};
\ No newline at end of file
+var _0x1622=['attributes','include','model','map','then','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowSquareOdbc','find','options','where'];(function(_0x3a0ddc,_0x1f9dd5){var _0x316b87=function(_0x1235d8){while(--_0x1235d8){_0x3a0ddc['push'](_0x3a0ddc['shift']());}};_0x316b87(++_0x1f9dd5);}(_0x1622,0x171));var _0x2162=function(_0x536919,_0x2d0c68){_0x536919=_0x536919-0x0;var _0x3694d9=_0x1622[_0x536919];return _0x3694d9;};'use strict';var _=require(_0x2162('0x0'));var util=require(_0x2162('0x1'));var moment=require(_0x2162('0x2'));var BPromise=require('bluebird');var rs=require(_0x2162('0x3'));var fs=require('fs');var Redis=require(_0x2162('0x4'));var db=require(_0x2162('0x5'))['db'];var utils=require(_0x2162('0x6'));var logger=require(_0x2162('0x7'))('rpc');var config=require(_0x2162('0x8'));var jayson=require(_0x2162('0x9'));var client=jayson[_0x2162('0xa')][_0x2162('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x458ca9,_0x2132d1,_0x179a07){return new BPromise(function(_0x15d521,_0x2c0648){return client[_0x2162('0xc')](_0x458ca9,_0x179a07)['then'](function(_0x3b0b4c){logger[_0x2162('0xd')](_0x2162('0xe'),_0x2132d1,_0x2162('0xf'));logger[_0x2162('0x10')](_0x2162('0x11'),_0x2132d1,_0x2162('0xf'),JSON[_0x2162('0x12')](_0x3b0b4c));if(_0x3b0b4c[_0x2162('0x13')]){if(_0x3b0b4c['error'][_0x2162('0x14')]===0x1f4){logger[_0x2162('0x13')](_0x2162('0xe'),_0x2132d1,_0x3b0b4c[_0x2162('0x13')][_0x2162('0x15')]);return _0x2c0648(_0x3b0b4c['error'][_0x2162('0x15')]);}logger['error'](_0x2162('0xe'),_0x2132d1,_0x3b0b4c[_0x2162('0x13')][_0x2162('0x15')]);return _0x15d521(_0x3b0b4c[_0x2162('0x13')][_0x2162('0x15')]);}else{logger['info'](_0x2162('0xe'),_0x2132d1,_0x2162('0xf'));_0x15d521(_0x3b0b4c[_0x2162('0x16')][_0x2162('0x15')]);}})['catch'](function(_0x34aa3e){logger[_0x2162('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x2132d1,_0x34aa3e);_0x2c0648(_0x34aa3e);});});}exports[_0x2162('0x17')]=function(_0x101ae6){var _0x435e6e=this;return new Promise(function(_0x1bb9a4,_0x4c5935){return db['SquareOdbc'][_0x2162('0x18')]({'raw':_0x101ae6['options']?_0x101ae6[_0x2162('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x101ae6[_0x2162('0x19')]?_0x101ae6[_0x2162('0x19')][_0x2162('0x1a')]||null:null,'attributes':_0x101ae6[_0x2162('0x19')]?_0x101ae6[_0x2162('0x19')][_0x2162('0x1b')]||null:null,'include':_0x101ae6[_0x2162('0x19')]?_0x101ae6[_0x2162('0x19')][_0x2162('0x1c')]?_['map'](_0x101ae6[_0x2162('0x19')]['include'],function(_0x387107){return{'model':db[_0x387107[_0x2162('0x1d')]],'as':_0x387107['as'],'attributes':_0x387107['attributes'],'include':_0x387107[_0x2162('0x1c')]?_[_0x2162('0x1e')](_0x387107[_0x2162('0x1c')],function(_0xce3778){return{'model':db[_0xce3778[_0x2162('0x1d')]],'as':_0xce3778['as'],'attributes':_0xce3778[_0x2162('0x1b')],'include':_0xce3778[_0x2162('0x1c')]?_['map'](_0xce3778['include'],function(_0xdbecac){return{'model':db[_0xdbecac[_0x2162('0x1d')]],'as':_0xdbecac['as'],'attributes':_0xdbecac['attributes']};}):[]};}):[]};}):[]:[]})[_0x2162('0x1f')](function(_0x431f90){logger['info'](_0x2162('0x17'),_0x101ae6);logger[_0x2162('0x10')]('ShowSquareOdbc',_0x101ae6,JSON['stringify'](_0x431f90));_0x1bb9a4(_0x431f90);})[_0x2162('0x20')](function(_0x969a26){logger[_0x2162('0x13')](_0x2162('0x17'),_0x969a26[_0x2162('0x15')],_0x101ae6);_0x4c5935(_0x435e6e[_0x2162('0x13')](0x1f4,_0x969a26['message']));});});};
\ No newline at end of file
index 542c6bc..0943342 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2039=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','post','create'];(function(_0x533d16,_0x2d7743){var _0x2d710d=function(_0x151b79){while(--_0x151b79){_0x533d16['push'](_0x533d16['shift']());}};_0x2d710d(++_0x2d7743);}(_0x2039,0x1e8));var _0x9203=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x2039[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x9203('0x0'));var util=require(_0x9203('0x1'));var path=require(_0x9203('0x2'));var timeout=require(_0x9203('0x3'));var express=require(_0x9203('0x4'));var router=express['Router']();var fs_extra=require(_0x9203('0x5'));var auth=require(_0x9203('0x6'));var interaction=require(_0x9203('0x7'));var config=require(_0x9203('0x8'));var controller=require(_0x9203('0x9'));router[_0x9203('0xa')]('/',auth[_0x9203('0xb')](),controller[_0x9203('0xc')]);router['get'](_0x9203('0xd'),auth[_0x9203('0xb')](),controller['show']);router[_0x9203('0xe')]('/',auth[_0x9203('0xb')](),controller[_0x9203('0xf')]);router[_0x9203('0x10')](_0x9203('0xd'),auth[_0x9203('0xb')](),controller[_0x9203('0x11')]);router[_0x9203('0x12')](_0x9203('0xd'),auth['isAuthenticated'](),controller[_0x9203('0x13')]);module[_0x9203('0x14')]=router;
\ No newline at end of file
+var _0xf51a=['path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','get','/:id','show','post','put','update','delete','destroy','exports','multer','util'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xf51a,0x12e));var _0xaf51=function(_0xbf29bc,_0x3d2451){_0xbf29bc=_0xbf29bc-0x0;var _0xc4aa31=_0xf51a[_0xbf29bc];return _0xc4aa31;};'use strict';var multer=require(_0xaf51('0x0'));var util=require(_0xaf51('0x1'));var path=require(_0xaf51('0x2'));var timeout=require(_0xaf51('0x3'));var express=require('express');var router=express[_0xaf51('0x4')]();var fs_extra=require(_0xaf51('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xaf51('0x6'));var config=require(_0xaf51('0x7'));var controller=require(_0xaf51('0x8'));router['get']('/',auth[_0xaf51('0x9')](),controller['index']);router[_0xaf51('0xa')](_0xaf51('0xb'),auth[_0xaf51('0x9')](),controller[_0xaf51('0xc')]);router[_0xaf51('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xaf51('0xe')]('/:id',auth[_0xaf51('0x9')](),controller[_0xaf51('0xf')]);router[_0xaf51('0x10')]('/:id',auth[_0xaf51('0x9')](),controller[_0xaf51('0x11')]);module[_0xaf51('0x12')]=router;
\ No newline at end of file
index 68ae5a5..38b623e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95b5=['DATE','sequelize','STRING','preproduction','getDataValue','toString','production'];(function(_0x36dc20,_0x6e6f2e){var _0x1a5b8b=function(_0x55b62b){while(--_0x55b62b){_0x36dc20['push'](_0x36dc20['shift']());}};_0x1a5b8b(++_0x6e6f2e);}(_0x95b5,0x143));var _0x595b=function(_0x503679,_0x1d99bf){_0x503679=_0x503679-0x0;var _0x2c6c2b=_0x95b5[_0x503679];return _0x2c6c2b;};'use strict';var Sequelize=require(_0x595b('0x0'));module['exports']={'name':{'type':Sequelize[_0x595b('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize['BLOB']('long'),'get':function(){if(this['getDataValue'](_0x595b('0x2'))){return this[_0x595b('0x3')](_0x595b('0x2'))[_0x595b('0x4')]('utf8');}}},'production':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0x595b('0x3')](_0x595b('0x5'))){return this[_0x595b('0x3')](_0x595b('0x5'))[_0x595b('0x4')]('utf8');}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x595b('0x6')]}};
\ No newline at end of file
+var _0x1e45=['long','preproduction','toString','getDataValue','production','utf8','DATE','STRING','name','TEXT','BLOB'];(function(_0x451cee,_0x2ec09f){var _0x972935=function(_0x5f6ad3){while(--_0x5f6ad3){_0x451cee['push'](_0x451cee['shift']());}};_0x972935(++_0x2ec09f);}(_0x1e45,0x1eb));var _0x51e4=function(_0x1c2339,_0x28bf92){_0x1c2339=_0x1c2339-0x0;var _0x25ddc2=_0x1e45[_0x1c2339];return _0x25ddc2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x51e4('0x0')],'unique':_0x51e4('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x51e4('0x2')]},'preproduction':{'type':Sequelize[_0x51e4('0x3')](_0x51e4('0x4')),'get':function(){if(this['getDataValue'](_0x51e4('0x5'))){return this['getDataValue'](_0x51e4('0x5'))[_0x51e4('0x6')]('utf8');}}},'production':{'type':Sequelize[_0x51e4('0x3')]('long'),'get':function(){if(this[_0x51e4('0x7')](_0x51e4('0x8'))){return this[_0x51e4('0x7')](_0x51e4('0x8'))[_0x51e4('0x6')](_0x51e4('0x9'));}}},'savedAt':{'type':Sequelize[_0x51e4('0xa')]},'publishedAt':{'type':Sequelize[_0x51e4('0xa')]}};
\ No newline at end of file
index ffe2487..f8e2bcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44ea=['type','key','model','map','query','filters','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','params','keys','attributes','include','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','production','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','json','offset','limit','undefined','count','status','update','then','destroy','get','SquareProjects','publish','agi','stringify','end','sendStatus','error','stack','name','send','index','SquareProject','rawAttributes','fieldName'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x44ea,0x149));var _0xa44e=function(_0x636e2b,_0x54a5bf){_0x636e2b=_0x636e2b-0x0;var _0x29a702=_0x44ea[_0x636e2b];return _0x29a702;};'use strict';var _=require(_0xa44e('0x0'));var Redis=require(_0xa44e('0x1'));var qs=require(_0xa44e('0x2'));var logger=require(_0xa44e('0x3'))(_0xa44e('0x4'));var config=require('../../config/environment');var db=require(_0xa44e('0x5'))['db'];config[_0xa44e('0x6')]=_[_0xa44e('0x7')](config[_0xa44e('0x6')],{'host':_0xa44e('0x8'),'port':0x18eb});var socket=require(_0xa44e('0x9'))(new Redis(config[_0xa44e('0x6')]));require(_0xa44e('0xa'))[_0xa44e('0xb')](socket);function respondWithResult(_0x5d89de,_0x273da7){_0x273da7=_0x273da7||0xc8;return function(_0x2fff4c){if(_0x2fff4c){return _0x5d89de['status'](_0x273da7)[_0xa44e('0xc')](_0x2fff4c);}};}function respondWithFilteredResult(_0x4b2928,_0x139e78){return function(_0xc2c94d){if(_0xc2c94d){var _0x5b25da=typeof _0x139e78[_0xa44e('0xd')]==='undefined'&&typeof _0x139e78[_0xa44e('0xe')]===_0xa44e('0xf');var _0xc9f095=_0xc2c94d['count'];var _0x522342=_0x5b25da?0x0:_0x139e78['offset'];var _0x8725cb=_0x5b25da?_0xc2c94d[_0xa44e('0x10')]:_0x139e78[_0xa44e('0xd')]+_0x139e78[_0xa44e('0xe')];var _0x104a55;if(_0x8725cb>=_0xc9f095){_0x8725cb=_0xc9f095;_0x104a55=0xc8;}else{_0x104a55=0xce;}_0x4b2928[_0xa44e('0x11')](_0x104a55);return _0x4b2928['set']('Content-Range',_0x522342+'-'+_0x8725cb+'/'+_0xc9f095)['json'](_0xc2c94d);}return null;};}function saveUpdates(_0x4a7d19){return function(_0x2ed58c){if(_0x2ed58c){return _0x2ed58c[_0xa44e('0x12')](_0x4a7d19)[_0xa44e('0x13')](function(_0x5e80b8){return _0x5e80b8;});}return null;};}function removeEntity(_0x3790e8){return function(_0x1fa549){if(_0x1fa549){return _0x1fa549[_0xa44e('0x14')]()['then'](function(){var _0x56bab9=_0x1fa549[_0xa44e('0x15')]({'plain':!![]});var _0x4659fd=_0xa44e('0x16');return db['UserProfileResource'][_0xa44e('0x14')]({'where':{'type':_0x4659fd,'resourceId':_0x56bab9['id']}})[_0xa44e('0x13')](function(){return _0x1fa549;});})[_0xa44e('0x13')](function(){var _0x4997a9=new Redis(config['redis']);_0x4997a9[_0xa44e('0x17')](_0xa44e('0x18'),JSON[_0xa44e('0x19')]({'id':_0x1fa549['id'],'deleted':!![]}));})['then'](function(){_0x3790e8['status'](0xcc)[_0xa44e('0x1a')]();});}};}function handleEntityNotFound(_0x145854){return function(_0x5c9a58){if(!_0x5c9a58){_0x145854[_0xa44e('0x1b')](0x194);}return _0x5c9a58;};}function handleError(_0x462816,_0x4b437f){_0x4b437f=_0x4b437f||0x1f4;return function(_0x1b5e43){logger[_0xa44e('0x1c')](_0x1b5e43[_0xa44e('0x1d')]);if(_0x1b5e43[_0xa44e('0x1e')]){delete _0x1b5e43[_0xa44e('0x1e')];}_0x462816[_0xa44e('0x11')](_0x4b437f)[_0xa44e('0x1f')](_0x1b5e43);};}exports[_0xa44e('0x20')]=function(_0x5deb19,_0x5efc1b){var _0x306500={},_0x5afe01={},_0x2cae2c={'count':0x0,'rows':[]};var _0x318c39=_['map'](db[_0xa44e('0x21')][_0xa44e('0x22')],function(_0x55fb3f){return{'name':_0x55fb3f[_0xa44e('0x23')],'type':_0x55fb3f[_0xa44e('0x24')][_0xa44e('0x25')]};});_0x5afe01[_0xa44e('0x26')]=_[_0xa44e('0x27')](_0x318c39,'name');_0x5afe01[_0xa44e('0x28')]=_['keys'](_0x5deb19[_0xa44e('0x28')]);_0x5afe01[_0xa44e('0x29')]=_[_0xa44e('0x2a')](_0x5afe01['model'],_0x5afe01['query']);_0x306500['attributes']=_[_0xa44e('0x2a')](_0x5afe01[_0xa44e('0x26')],qs[_0xa44e('0x2b')](_0x5deb19[_0xa44e('0x28')][_0xa44e('0x2b')]));_0x306500['attributes']=_0x306500['attributes'][_0xa44e('0x2c')]?_0x306500['attributes']:_0x5afe01[_0xa44e('0x26')];if(!_0x5deb19['query'][_0xa44e('0x2d')]('nolimit')){_0x306500['limit']=qs[_0xa44e('0xe')](_0x5deb19[_0xa44e('0x28')][_0xa44e('0xe')]);_0x306500[_0xa44e('0xd')]=qs[_0xa44e('0xd')](_0x5deb19[_0xa44e('0x28')][_0xa44e('0xd')]);}_0x306500[_0xa44e('0x2e')]=qs[_0xa44e('0x2f')](_0x5deb19[_0xa44e('0x28')][_0xa44e('0x2f')]);_0x306500['where']=qs['filters'](_[_0xa44e('0x30')](_0x5deb19['query'],_0x5afe01[_0xa44e('0x29')]),_0x318c39);if(_0x5deb19['query'][_0xa44e('0x31')]){_0x306500[_0xa44e('0x32')]=_[_0xa44e('0x33')](_0x306500[_0xa44e('0x32')],{'$or':_[_0xa44e('0x27')](_0x318c39,function(_0x13ec93){if(_0x13ec93[_0xa44e('0x24')]!==_0xa44e('0x34')){var _0x2bdd8c={};_0x2bdd8c[_0x13ec93['name']]={'$like':'%'+_0x5deb19[_0xa44e('0x28')]['filter']+'%'};return _0x2bdd8c;}})});}_0x306500=_[_0xa44e('0x33')]({},_0x306500,_0x5deb19[_0xa44e('0x35')]);var _0x176fb9={'where':_0x306500['where']};return db[_0xa44e('0x21')]['count'](_0x176fb9)['then'](function(_0x358561){_0x2cae2c[_0xa44e('0x10')]=_0x358561;if(_0x5deb19[_0xa44e('0x28')][_0xa44e('0x36')]){_0x306500['include']=[{'all':!![]}];}return db[_0xa44e('0x21')]['findAll'](_0x306500);})[_0xa44e('0x13')](function(_0x6594e3){_0x2cae2c[_0xa44e('0x37')]=_0x6594e3;return _0x2cae2c;})[_0xa44e('0x13')](respondWithFilteredResult(_0x5efc1b,_0x306500))[_0xa44e('0x38')](handleError(_0x5efc1b,null));};exports['show']=function(_0x46cfa8,_0xcdeac2){var _0x2b58ac={'raw':![],'where':{'id':_0x46cfa8[_0xa44e('0x39')]['id']}},_0x81134e={};_0x81134e[_0xa44e('0x26')]=_[_0xa44e('0x3a')](db[_0xa44e('0x21')][_0xa44e('0x22')]);_0x81134e[_0xa44e('0x28')]=_[_0xa44e('0x3a')](_0x46cfa8[_0xa44e('0x28')]);_0x81134e[_0xa44e('0x29')]=_[_0xa44e('0x2a')](_0x81134e[_0xa44e('0x26')],_0x81134e[_0xa44e('0x28')]);_0x2b58ac[_0xa44e('0x3b')]=_['intersection'](_0x81134e[_0xa44e('0x26')],qs['fields'](_0x46cfa8['query'][_0xa44e('0x2b')]));_0x2b58ac['attributes']=_0x2b58ac[_0xa44e('0x3b')][_0xa44e('0x2c')]?_0x2b58ac['attributes']:_0x81134e[_0xa44e('0x26')];if(_0x46cfa8[_0xa44e('0x28')][_0xa44e('0x36')]){_0x2b58ac[_0xa44e('0x3c')]=[{'all':!![]}];}_0x2b58ac=_['merge']({},_0x2b58ac,_0x46cfa8[_0xa44e('0x35')]);return db['SquareProject'][_0xa44e('0x3d')](_0x2b58ac)[_0xa44e('0x13')](handleEntityNotFound(_0xcdeac2,null))[_0xa44e('0x13')](respondWithResult(_0xcdeac2,null))[_0xa44e('0x38')](handleError(_0xcdeac2,null));};exports[_0xa44e('0x3e')]=function(_0x4e8022,_0x218e9c){return db['SquareProject']['create'](_0x4e8022[_0xa44e('0x3f')],{})[_0xa44e('0x13')](function(_0x625ee9){var _0x586081=_0x4e8022[_0xa44e('0x40')][_0xa44e('0x15')]({'plain':!![]});if(!_0x586081)throw new Error(_0xa44e('0x41'));if(_0x586081[_0xa44e('0x42')]===_0xa44e('0x40')){var _0x33b390=_0x625ee9[_0xa44e('0x15')]({'plain':!![]});var _0x2998fd=_0xa44e('0x16');return db[_0xa44e('0x43')][_0xa44e('0x3d')]({'where':{'name':_0x2998fd,'userProfileId':_0x586081[_0xa44e('0x44')]},'raw':!![]})['then'](function(_0x3cdf1e){if(_0x3cdf1e&&_0x3cdf1e[_0xa44e('0x45')]===0x0){return db[_0xa44e('0x46')][_0xa44e('0x3e')]({'name':_0x33b390[_0xa44e('0x1e')],'resourceId':_0x33b390['id'],'type':_0x3cdf1e['name'],'sectionId':_0x3cdf1e['id']},{})[_0xa44e('0x13')](function(){return _0x625ee9;});}else{return _0x625ee9;}})[_0xa44e('0x38')](function(_0x4b4e79){logger[_0xa44e('0x1c')](_0xa44e('0x47'),_0x4b4e79);throw _0x4b4e79;});}return _0x625ee9;})[_0xa44e('0x13')](respondWithResult(_0x218e9c,0xc9))['catch'](handleError(_0x218e9c,null));};exports[_0xa44e('0x12')]=function(_0x61a051,_0x4bc0fb){if(_0x61a051[_0xa44e('0x3f')]['id']){delete _0x61a051[_0xa44e('0x3f')]['id'];}return db[_0xa44e('0x21')]['find']({'where':{'id':_0x61a051[_0xa44e('0x39')]['id']}})[_0xa44e('0x13')](handleEntityNotFound(_0x4bc0fb,null))[_0xa44e('0x13')](saveUpdates(_0x61a051[_0xa44e('0x3f')],null))[_0xa44e('0x13')](function(_0x492a37){if(!_0x492a37)return;var _0xad16f9=_0x492a37['get']({'plain':!![]});return _0xad16f9;})[_0xa44e('0x13')](function(_0x639298){var _0x424c22=new Redis(config[_0xa44e('0x6')]);_0x424c22[_0xa44e('0x17')](_0xa44e('0x18'),JSON[_0xa44e('0x19')](_[_0xa44e('0x30')](_0x639298,['id',_0xa44e('0x1e'),_0xa44e('0x48')])));return _0x639298;})[_0xa44e('0x13')](respondWithResult(_0x4bc0fb,null))[_0xa44e('0x38')](handleError(_0x4bc0fb,null));};exports['destroy']=function(_0x1f31cb,_0x181dda){return db['SquareProject'][_0xa44e('0x3d')]({'where':{'id':_0x1f31cb[_0xa44e('0x39')]['id']}})['then'](handleEntityNotFound(_0x181dda,null))[_0xa44e('0x13')](removeEntity(_0x181dda,null))[_0xa44e('0x38')](handleError(_0x181dda,null));};
\ No newline at end of file
+var _0x82d1=['count','status','set','Content-Range','update','then','destroy','get','UserProfileResource','publish','end','stack','name','send','map','SquareProject','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','findAll','rows','show','params','includeAll','include','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','agi','stringify','production','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','./squareProject.socket','register','json','offset','undefined','limit'];(function(_0x4d934b,_0x52f8e9){var _0xc0338b=function(_0x1a356c){while(--_0x1a356c){_0x4d934b['push'](_0x4d934b['shift']());}};_0xc0338b(++_0x52f8e9);}(_0x82d1,0x1dc));var _0x182d=function(_0xe57375,_0x5606ca){_0xe57375=_0xe57375-0x0;var _0x2eb23c=_0x82d1[_0xe57375];return _0x2eb23c;};'use strict';var _=require(_0x182d('0x0'));var Redis=require(_0x182d('0x1'));var qs=require(_0x182d('0x2'));var logger=require(_0x182d('0x3'))(_0x182d('0x4'));var config=require('../../config/environment');var db=require(_0x182d('0x5'))['db'];config[_0x182d('0x6')]=_[_0x182d('0x7')](config[_0x182d('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x182d('0x8'))[_0x182d('0x9')](socket);function respondWithResult(_0x42cd90,_0x156cb3){_0x156cb3=_0x156cb3||0xc8;return function(_0x36f2a1){if(_0x36f2a1){return _0x42cd90['status'](_0x156cb3)[_0x182d('0xa')](_0x36f2a1);}};}function respondWithFilteredResult(_0x589b74,_0x46d830){return function(_0x5b241b){if(_0x5b241b){var _0x513023=typeof _0x46d830[_0x182d('0xb')]===_0x182d('0xc')&&typeof _0x46d830[_0x182d('0xd')]===_0x182d('0xc');var _0x516163=_0x5b241b[_0x182d('0xe')];var _0x3279b4=_0x513023?0x0:_0x46d830[_0x182d('0xb')];var _0x4b8439=_0x513023?_0x5b241b[_0x182d('0xe')]:_0x46d830[_0x182d('0xb')]+_0x46d830[_0x182d('0xd')];var _0x187a36;if(_0x4b8439>=_0x516163){_0x4b8439=_0x516163;_0x187a36=0xc8;}else{_0x187a36=0xce;}_0x589b74[_0x182d('0xf')](_0x187a36);return _0x589b74[_0x182d('0x10')](_0x182d('0x11'),_0x3279b4+'-'+_0x4b8439+'/'+_0x516163)[_0x182d('0xa')](_0x5b241b);}return null;};}function saveUpdates(_0x15ea70){return function(_0x187779){if(_0x187779){return _0x187779[_0x182d('0x12')](_0x15ea70)[_0x182d('0x13')](function(_0x387c46){return _0x387c46;});}return null;};}function removeEntity(_0x7a7a88){return function(_0x5e87e3){if(_0x5e87e3){return _0x5e87e3[_0x182d('0x14')]()[_0x182d('0x13')](function(){var _0x92e16f=_0x5e87e3[_0x182d('0x15')]({'plain':!![]});var _0x34d50e='SquareProjects';return db[_0x182d('0x16')][_0x182d('0x14')]({'where':{'type':_0x34d50e,'resourceId':_0x92e16f['id']}})[_0x182d('0x13')](function(){return _0x5e87e3;});})['then'](function(){var _0x5334f6=new Redis(config[_0x182d('0x6')]);_0x5334f6[_0x182d('0x17')]('agi',JSON['stringify']({'id':_0x5e87e3['id'],'deleted':!![]}));})[_0x182d('0x13')](function(){_0x7a7a88[_0x182d('0xf')](0xcc)[_0x182d('0x18')]();});}};}function handleEntityNotFound(_0x5f0f0b){return function(_0x4bfd8c){if(!_0x4bfd8c){_0x5f0f0b['sendStatus'](0x194);}return _0x4bfd8c;};}function handleError(_0xcda9a,_0x5c6e9a){_0x5c6e9a=_0x5c6e9a||0x1f4;return function(_0x2c294a){logger['error'](_0x2c294a[_0x182d('0x19')]);if(_0x2c294a[_0x182d('0x1a')]){delete _0x2c294a[_0x182d('0x1a')];}_0xcda9a[_0x182d('0xf')](_0x5c6e9a)[_0x182d('0x1b')](_0x2c294a);};}exports['index']=function(_0x44edc2,_0x505b8a){var _0x240faf={},_0xa6e75c={},_0x5938dd={'count':0x0,'rows':[]};var _0x191926=_[_0x182d('0x1c')](db[_0x182d('0x1d')][_0x182d('0x1e')],function(_0x499cab){return{'name':_0x499cab[_0x182d('0x1f')],'type':_0x499cab[_0x182d('0x20')]['key']};});_0xa6e75c['model']=_[_0x182d('0x1c')](_0x191926,_0x182d('0x1a'));_0xa6e75c[_0x182d('0x21')]=_['keys'](_0x44edc2[_0x182d('0x21')]);_0xa6e75c[_0x182d('0x22')]=_[_0x182d('0x23')](_0xa6e75c[_0x182d('0x24')],_0xa6e75c['query']);_0x240faf['attributes']=_['intersection'](_0xa6e75c[_0x182d('0x24')],qs[_0x182d('0x25')](_0x44edc2[_0x182d('0x21')][_0x182d('0x25')]));_0x240faf[_0x182d('0x26')]=_0x240faf[_0x182d('0x26')][_0x182d('0x27')]?_0x240faf['attributes']:_0xa6e75c[_0x182d('0x24')];if(!_0x44edc2[_0x182d('0x21')][_0x182d('0x28')]('nolimit')){_0x240faf[_0x182d('0xd')]=qs[_0x182d('0xd')](_0x44edc2[_0x182d('0x21')][_0x182d('0xd')]);_0x240faf['offset']=qs[_0x182d('0xb')](_0x44edc2[_0x182d('0x21')][_0x182d('0xb')]);}_0x240faf['order']=qs[_0x182d('0x29')](_0x44edc2['query'][_0x182d('0x29')]);_0x240faf[_0x182d('0x2a')]=qs[_0x182d('0x22')](_[_0x182d('0x2b')](_0x44edc2[_0x182d('0x21')],_0xa6e75c['filters']),_0x191926);if(_0x44edc2[_0x182d('0x21')]['filter']){_0x240faf[_0x182d('0x2a')]=_[_0x182d('0x2c')](_0x240faf['where'],{'$or':_['map'](_0x191926,function(_0xc3cc4e){if(_0xc3cc4e[_0x182d('0x20')]!==_0x182d('0x2d')){var _0x462d20={};_0x462d20[_0xc3cc4e[_0x182d('0x1a')]]={'$like':'%'+_0x44edc2[_0x182d('0x21')][_0x182d('0x2e')]+'%'};return _0x462d20;}})});}_0x240faf=_[_0x182d('0x2c')]({},_0x240faf,_0x44edc2['options']);var _0x434ca1={'where':_0x240faf['where']};return db[_0x182d('0x1d')]['count'](_0x434ca1)[_0x182d('0x13')](function(_0x433432){_0x5938dd[_0x182d('0xe')]=_0x433432;if(_0x44edc2['query']['includeAll']){_0x240faf['include']=[{'all':!![]}];}return db['SquareProject'][_0x182d('0x2f')](_0x240faf);})[_0x182d('0x13')](function(_0x3ce723){_0x5938dd[_0x182d('0x30')]=_0x3ce723;return _0x5938dd;})[_0x182d('0x13')](respondWithFilteredResult(_0x505b8a,_0x240faf))['catch'](handleError(_0x505b8a,null));};exports[_0x182d('0x31')]=function(_0x1a5871,_0x2342b1){var _0x5c4e1b={'raw':![],'where':{'id':_0x1a5871[_0x182d('0x32')]['id']}},_0x119471={};_0x119471[_0x182d('0x24')]=_['keys'](db[_0x182d('0x1d')][_0x182d('0x1e')]);_0x119471[_0x182d('0x21')]=_['keys'](_0x1a5871['query']);_0x119471['filters']=_[_0x182d('0x23')](_0x119471[_0x182d('0x24')],_0x119471[_0x182d('0x21')]);_0x5c4e1b['attributes']=_[_0x182d('0x23')](_0x119471[_0x182d('0x24')],qs[_0x182d('0x25')](_0x1a5871[_0x182d('0x21')][_0x182d('0x25')]));_0x5c4e1b[_0x182d('0x26')]=_0x5c4e1b[_0x182d('0x26')]['length']?_0x5c4e1b['attributes']:_0x119471[_0x182d('0x24')];if(_0x1a5871[_0x182d('0x21')][_0x182d('0x33')]){_0x5c4e1b[_0x182d('0x34')]=[{'all':!![]}];}_0x5c4e1b=_['merge']({},_0x5c4e1b,_0x1a5871[_0x182d('0x35')]);return db[_0x182d('0x1d')][_0x182d('0x36')](_0x5c4e1b)['then'](handleEntityNotFound(_0x2342b1,null))['then'](respondWithResult(_0x2342b1,null))[_0x182d('0x37')](handleError(_0x2342b1,null));};exports[_0x182d('0x38')]=function(_0xca7ef8,_0x1f0b89){return db[_0x182d('0x1d')][_0x182d('0x38')](_0xca7ef8[_0x182d('0x39')],{})[_0x182d('0x13')](function(_0x5c70b8){var _0x4fb6b8=_0xca7ef8[_0x182d('0x3a')]['get']({'plain':!![]});if(!_0x4fb6b8)throw new Error(_0x182d('0x3b'));if(_0x4fb6b8[_0x182d('0x3c')]===_0x182d('0x3a')){var _0x1ec9f5=_0x5c70b8['get']({'plain':!![]});var _0x3b1a2b=_0x182d('0x3d');return db[_0x182d('0x3e')][_0x182d('0x36')]({'where':{'name':_0x3b1a2b,'userProfileId':_0x4fb6b8[_0x182d('0x3f')]},'raw':!![]})[_0x182d('0x13')](function(_0x4a4a49){if(_0x4a4a49&&_0x4a4a49[_0x182d('0x40')]===0x0){return db[_0x182d('0x16')][_0x182d('0x38')]({'name':_0x1ec9f5[_0x182d('0x1a')],'resourceId':_0x1ec9f5['id'],'type':_0x4a4a49['name'],'sectionId':_0x4a4a49['id']},{})[_0x182d('0x13')](function(){return _0x5c70b8;});}else{return _0x5c70b8;}})['catch'](function(_0x47ca62){logger[_0x182d('0x41')](_0x182d('0x42'),_0x47ca62);throw _0x47ca62;});}return _0x5c70b8;})['then'](respondWithResult(_0x1f0b89,0xc9))[_0x182d('0x37')](handleError(_0x1f0b89,null));};exports[_0x182d('0x12')]=function(_0x39cc12,_0x1397e1){if(_0x39cc12[_0x182d('0x39')]['id']){delete _0x39cc12[_0x182d('0x39')]['id'];}return db['SquareProject'][_0x182d('0x36')]({'where':{'id':_0x39cc12[_0x182d('0x32')]['id']}})[_0x182d('0x13')](handleEntityNotFound(_0x1397e1,null))[_0x182d('0x13')](saveUpdates(_0x39cc12['body'],null))[_0x182d('0x13')](function(_0x283388){if(!_0x283388)return;var _0x2f7804=_0x283388['get']({'plain':!![]});return _0x2f7804;})['then'](function(_0x8250e2){var _0x18bbfc=new Redis(config[_0x182d('0x6')]);_0x18bbfc[_0x182d('0x17')](_0x182d('0x43'),JSON[_0x182d('0x44')](_['pick'](_0x8250e2,['id',_0x182d('0x1a'),_0x182d('0x45')])));return _0x8250e2;})[_0x182d('0x13')](respondWithResult(_0x1397e1,null))[_0x182d('0x37')](handleError(_0x1397e1,null));};exports[_0x182d('0x14')]=function(_0x5a699c,_0x3ed2c3){return db[_0x182d('0x1d')]['find']({'where':{'id':_0x5a699c[_0x182d('0x32')]['id']}})[_0x182d('0x13')](handleEntityNotFound(_0x3ed2c3,null))[_0x182d('0x13')](removeEntity(_0x3ed2c3,null))[_0x182d('0x37')](handleError(_0x3ed2c3,null));};
\ No newline at end of file
index 861feb1..269e2fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d24=['save','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x8d24,0x194));var _0x48d2=function(_0x569b7a,_0x377a61){_0x569b7a=_0x569b7a-0x0;var _0x39d00a=_0x8d24[_0x569b7a];return _0x39d00a;};'use strict';var EventEmitter=require(_0x48d2('0x0'));var SquareProject=require(_0x48d2('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x48d2('0x2'),'afterUpdate':'update','afterDestroy':_0x48d2('0x3')};function emitEvent(_0x59ddc1){return function(_0x486672,_0x92ccca,_0x8ef290){SquareProjectEvents[_0x48d2('0x4')](_0x59ddc1+':'+_0x486672['id'],_0x486672);SquareProjectEvents[_0x48d2('0x4')](_0x59ddc1,_0x486672);_0x8ef290(null);};}for(var e in events){if(events[_0x48d2('0x5')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x48d2('0x6')]=SquareProjectEvents;
\ No newline at end of file
+var _0x986c=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x3fee7e,_0xcaeb28){var _0x200ed5=function(_0x2cec13){while(--_0x2cec13){_0x3fee7e['push'](_0x3fee7e['shift']());}};_0x200ed5(++_0xcaeb28);}(_0x986c,0x8b));var _0xc986=function(_0x5a3dc1,_0x58843c){_0x5a3dc1=_0x5a3dc1-0x0;var _0x253321=_0x986c[_0x5a3dc1];return _0x253321;};'use strict';var EventEmitter=require(_0xc986('0x0'));var SquareProject=require(_0xc986('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xc986('0x2')](0x0);var events={'afterCreate':_0xc986('0x3'),'afterUpdate':_0xc986('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4fdb1b){return function(_0x1b04ed,_0x6562e7,_0x4ecf88){SquareProjectEvents[_0xc986('0x5')](_0x4fdb1b+':'+_0x1b04ed['id'],_0x1b04ed);SquareProjectEvents[_0xc986('0x5')](_0x4fdb1b,_0x1b04ed);_0x4ecf88(null);};}for(var e in events){if(events[_0xc986('0x6')](e)){var event=events[e];SquareProject[_0xc986('0x7')](e,emitEvent(event));}}module[_0xc986('0x8')]=SquareProjectEvents;
\ No newline at end of file
index 833557d..2c915b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9736=['format','lodash','../../config/logger','bluebird','path','../../config/environment','./squareProject.attributes','exports','define','square_projects','changed','savedAt','YYYY-MM-DD\x20HH:mm:ss','publishedAt'];(function(_0x4da63a,_0x69550e){var _0x5696d2=function(_0x2626ae){while(--_0x2626ae){_0x4da63a['push'](_0x4da63a['shift']());}};_0x5696d2(++_0x69550e);}(_0x9736,0x143));var _0x6973=function(_0x25142f,_0x4ef8cb){_0x25142f=_0x25142f-0x0;var _0x59ecdb=_0x9736[_0x25142f];return _0x59ecdb;};'use strict';var _=require(_0x6973('0x0'));var util=require('util');var logger=require(_0x6973('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6973('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6973('0x3'));var rimraf=require('rimraf');var config=require(_0x6973('0x4'));var attributes=require(_0x6973('0x5'));module[_0x6973('0x6')]=function(_0x36aa5c,_0x1a80ca){return _0x36aa5c[_0x6973('0x7')]('SquareProject',attributes,{'tableName':_0x6973('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4e154d,_0x2e8e30,_0x275e50){if(_0x4e154d[_0x6973('0x9')]('preproduction')){_0x4e154d[_0x6973('0xa')]=moment()['format'](_0x6973('0xb'));}if(_0x4e154d[_0x6973('0x9')]('production')){_0x4e154d[_0x6973('0xc')]=moment()[_0x6973('0xd')](_0x6973('0xb'));}_0x275e50(null,_0x4e154d);}}});};
\ No newline at end of file
+var _0x1bd4=['savedAt','format','production','publishedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x1bd4,0x83));var _0x41bd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1bd4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x41bd('0x0'));var util=require(_0x41bd('0x1'));var logger=require(_0x41bd('0x2'))(_0x41bd('0x3'));var moment=require(_0x41bd('0x4'));var BPromise=require(_0x41bd('0x5'));var rp=require(_0x41bd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x41bd('0x7'));var config=require(_0x41bd('0x8'));var attributes=require(_0x41bd('0x9'));module[_0x41bd('0xa')]=function(_0x1d2155,_0x53f603){return _0x1d2155[_0x41bd('0xb')](_0x41bd('0xc'),attributes,{'tableName':_0x41bd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x37b703,_0x482b37,_0xdf4f48){if(_0x37b703[_0x41bd('0xe')](_0x41bd('0xf'))){_0x37b703[_0x41bd('0x10')]=moment()[_0x41bd('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x37b703[_0x41bd('0xe')](_0x41bd('0x12'))){_0x37b703[_0x41bd('0x13')]=moment()[_0x41bd('0x11')](_0x41bd('0x14'));}_0xdf4f48(null,_0x37b703);}}});};
\ No newline at end of file
index 1e4fdc0..c3daeb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fb8=['raw','attributes','limit','include','map','model','then','debug','catch','error','message','ShowSquareProject','find','where','info','stringify','lodash','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x6fb8,0x1d2));var _0x86fb=function(_0xd0a847,_0x72562b){_0xd0a847=_0xd0a847-0x0;var _0x2536ec=_0x6fb8[_0xd0a847];return _0x2536ec;};'use strict';var _=require(_0x86fb('0x0'));var Redis=require('ioredis');var db=require(_0x86fb('0x1'))['db'];var logger=require(_0x86fb('0x2'))(_0x86fb('0x3'));var config=require(_0x86fb('0x4'));config[_0x86fb('0x5')]=_['defaults'](config[_0x86fb('0x5')],{'host':_0x86fb('0x6'),'port':0x18eb});var socket=require(_0x86fb('0x7'))(new Redis(config[_0x86fb('0x5')]));require(_0x86fb('0x8'))[_0x86fb('0x9')](socket);exports[_0x86fb('0xa')]=function(_0x15ae0f){var _0x5d3f15=this;return new Promise(function(_0x1d1f8b,_0x38b30a){return db[_0x86fb('0xb')][_0x86fb('0xc')]({'raw':_0x15ae0f[_0x86fb('0xd')]?_0x15ae0f['options'][_0x86fb('0xe')]===undefined?!![]:![]:!![],'where':_0x15ae0f[_0x86fb('0xd')]?_0x15ae0f[_0x86fb('0xd')]['where']||null:null,'attributes':_0x15ae0f[_0x86fb('0xd')]?_0x15ae0f[_0x86fb('0xd')][_0x86fb('0xf')]||null:null,'limit':_0x15ae0f[_0x86fb('0xd')]?_0x15ae0f[_0x86fb('0xd')][_0x86fb('0x10')]||null:null,'include':_0x15ae0f[_0x86fb('0xd')]?_0x15ae0f['options'][_0x86fb('0x11')]?_[_0x86fb('0x12')](_0x15ae0f['options'][_0x86fb('0x11')],function(_0x1863b1){return{'model':db[_0x1863b1['model']],'as':_0x1863b1['as'],'attributes':_0x1863b1[_0x86fb('0xf')],'include':_0x1863b1[_0x86fb('0x11')]?_[_0x86fb('0x12')](_0x1863b1['include'],function(_0x11ff0d){return{'model':db[_0x11ff0d[_0x86fb('0x13')]],'as':_0x11ff0d['as'],'attributes':_0x11ff0d[_0x86fb('0xf')],'include':_0x11ff0d[_0x86fb('0x11')]?_[_0x86fb('0x12')](_0x11ff0d[_0x86fb('0x11')],function(_0x4001d8){return{'model':db[_0x4001d8['model']],'as':_0x4001d8['as'],'attributes':_0x4001d8['attributes']};}):[]};}):[]};}):[]:[]})[_0x86fb('0x14')](function(_0x18c60b){logger['info'](_0x86fb('0xa'),_0x15ae0f);logger[_0x86fb('0x15')](_0x86fb('0xa'),_0x15ae0f,JSON['stringify'](_0x18c60b));_0x1d1f8b(_0x18c60b);})[_0x86fb('0x16')](function(_0x329e1f){logger[_0x86fb('0x17')](_0x86fb('0xa'),_0x329e1f[_0x86fb('0x18')],_0x15ae0f);_0x38b30a(_0x5d3f15[_0x86fb('0x17')](0x1f4,_0x329e1f[_0x86fb('0x18')]));});});};exports[_0x86fb('0x19')]=function(_0x42c3cc){var _0x27b6d3=this;return new Promise(function(_0xc721f8,_0x386eca){return db[_0x86fb('0xb')][_0x86fb('0x1a')]({'raw':_0x42c3cc[_0x86fb('0xd')]?_0x42c3cc[_0x86fb('0xd')]['raw']===undefined?!![]:![]:!![],'where':_0x42c3cc[_0x86fb('0xd')]?_0x42c3cc[_0x86fb('0xd')][_0x86fb('0x1b')]||null:null,'attributes':_0x42c3cc[_0x86fb('0xd')]?_0x42c3cc['options'][_0x86fb('0xf')]||null:null,'include':_0x42c3cc[_0x86fb('0xd')]?_0x42c3cc[_0x86fb('0xd')]['include']?_['map'](_0x42c3cc[_0x86fb('0xd')]['include'],function(_0x3e99bf){return{'model':db[_0x3e99bf[_0x86fb('0x13')]],'as':_0x3e99bf['as'],'attributes':_0x3e99bf[_0x86fb('0xf')],'include':_0x3e99bf[_0x86fb('0x11')]?_[_0x86fb('0x12')](_0x3e99bf[_0x86fb('0x11')],function(_0x3575c6){return{'model':db[_0x3575c6[_0x86fb('0x13')]],'as':_0x3575c6['as'],'attributes':_0x3575c6['attributes'],'include':_0x3575c6[_0x86fb('0x11')]?_[_0x86fb('0x12')](_0x3575c6[_0x86fb('0x11')],function(_0x5b4dfd){return{'model':db[_0x5b4dfd['model']],'as':_0x5b4dfd['as'],'attributes':_0x5b4dfd[_0x86fb('0xf')]};}):[]};}):[]};}):[]:[]})[_0x86fb('0x14')](function(_0x11fc27){logger[_0x86fb('0x1c')]('ShowSquareProject',_0x42c3cc);logger[_0x86fb('0x15')](_0x86fb('0x19'),_0x42c3cc,JSON[_0x86fb('0x1d')](_0x11fc27));_0xc721f8(_0x11fc27);})['catch'](function(_0x53d81b){logger['error'](_0x86fb('0x19'),_0x53d81b[_0x86fb('0x18')],_0x42c3cc);_0x386eca(_0x27b6d3[_0x86fb('0x17')](0x1f4,_0x53d81b['message']));});});};
\ No newline at end of file
+var _0xd4c8=['../../config/logger','../../config/environment','redis','socket.io-emitter','./squareProject.socket','SquareProject','findAll','options','raw','where','attributes','limit','include','map','model','info','GetSquareProjects','debug','stringify','error','message','ShowSquareProject','find','catch','lodash','ioredis','../../mysqldb'];(function(_0x4bb145,_0x3e7d33){var _0x4db596=function(_0x144489){while(--_0x144489){_0x4bb145['push'](_0x4bb145['shift']());}};_0x4db596(++_0x3e7d33);}(_0xd4c8,0x126));var _0x8d4c=function(_0x3d7e48,_0x561959){_0x3d7e48=_0x3d7e48-0x0;var _0x50093d=_0xd4c8[_0x3d7e48];return _0x50093d;};'use strict';var _=require(_0x8d4c('0x0'));var Redis=require(_0x8d4c('0x1'));var db=require(_0x8d4c('0x2'))['db'];var logger=require(_0x8d4c('0x3'))('rpc');var config=require(_0x8d4c('0x4'));config[_0x8d4c('0x5')]=_['defaults'](config[_0x8d4c('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x8d4c('0x6'))(new Redis(config[_0x8d4c('0x5')]));require(_0x8d4c('0x7'))['register'](socket);exports['GetSquareProjects']=function(_0x1d6ba6){var _0x4b5a89=this;return new Promise(function(_0x48272d,_0x53888a){return db[_0x8d4c('0x8')][_0x8d4c('0x9')]({'raw':_0x1d6ba6[_0x8d4c('0xa')]?_0x1d6ba6[_0x8d4c('0xa')][_0x8d4c('0xb')]===undefined?!![]:![]:!![],'where':_0x1d6ba6[_0x8d4c('0xa')]?_0x1d6ba6[_0x8d4c('0xa')][_0x8d4c('0xc')]||null:null,'attributes':_0x1d6ba6[_0x8d4c('0xa')]?_0x1d6ba6['options'][_0x8d4c('0xd')]||null:null,'limit':_0x1d6ba6['options']?_0x1d6ba6[_0x8d4c('0xa')][_0x8d4c('0xe')]||null:null,'include':_0x1d6ba6[_0x8d4c('0xa')]?_0x1d6ba6['options'][_0x8d4c('0xf')]?_[_0x8d4c('0x10')](_0x1d6ba6[_0x8d4c('0xa')][_0x8d4c('0xf')],function(_0x4e2766){return{'model':db[_0x4e2766[_0x8d4c('0x11')]],'as':_0x4e2766['as'],'attributes':_0x4e2766[_0x8d4c('0xd')],'include':_0x4e2766['include']?_['map'](_0x4e2766['include'],function(_0x34f634){return{'model':db[_0x34f634[_0x8d4c('0x11')]],'as':_0x34f634['as'],'attributes':_0x34f634['attributes'],'include':_0x34f634[_0x8d4c('0xf')]?_[_0x8d4c('0x10')](_0x34f634[_0x8d4c('0xf')],function(_0x217b60){return{'model':db[_0x217b60[_0x8d4c('0x11')]],'as':_0x217b60['as'],'attributes':_0x217b60[_0x8d4c('0xd')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3dc7b4){logger[_0x8d4c('0x12')](_0x8d4c('0x13'),_0x1d6ba6);logger[_0x8d4c('0x14')]('GetSquareProjects',_0x1d6ba6,JSON[_0x8d4c('0x15')](_0x3dc7b4));_0x48272d(_0x3dc7b4);})['catch'](function(_0x41bf9f){logger[_0x8d4c('0x16')](_0x8d4c('0x13'),_0x41bf9f[_0x8d4c('0x17')],_0x1d6ba6);_0x53888a(_0x4b5a89['error'](0x1f4,_0x41bf9f[_0x8d4c('0x17')]));});});};exports[_0x8d4c('0x18')]=function(_0x3cf8c2){var _0x5d3c1d=this;return new Promise(function(_0x54be8f,_0x5a034d){return db[_0x8d4c('0x8')][_0x8d4c('0x19')]({'raw':_0x3cf8c2['options']?_0x3cf8c2['options']['raw']===undefined?!![]:![]:!![],'where':_0x3cf8c2[_0x8d4c('0xa')]?_0x3cf8c2[_0x8d4c('0xa')][_0x8d4c('0xc')]||null:null,'attributes':_0x3cf8c2['options']?_0x3cf8c2[_0x8d4c('0xa')][_0x8d4c('0xd')]||null:null,'include':_0x3cf8c2[_0x8d4c('0xa')]?_0x3cf8c2['options'][_0x8d4c('0xf')]?_['map'](_0x3cf8c2['options'][_0x8d4c('0xf')],function(_0x15ddcc){return{'model':db[_0x15ddcc[_0x8d4c('0x11')]],'as':_0x15ddcc['as'],'attributes':_0x15ddcc[_0x8d4c('0xd')],'include':_0x15ddcc[_0x8d4c('0xf')]?_[_0x8d4c('0x10')](_0x15ddcc[_0x8d4c('0xf')],function(_0x3228ec){return{'model':db[_0x3228ec[_0x8d4c('0x11')]],'as':_0x3228ec['as'],'attributes':_0x3228ec[_0x8d4c('0xd')],'include':_0x3228ec[_0x8d4c('0xf')]?_[_0x8d4c('0x10')](_0x3228ec[_0x8d4c('0xf')],function(_0x6d6008){return{'model':db[_0x6d6008[_0x8d4c('0x11')]],'as':_0x6d6008['as'],'attributes':_0x6d6008[_0x8d4c('0xd')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x349a2a){logger[_0x8d4c('0x12')](_0x8d4c('0x18'),_0x3cf8c2);logger[_0x8d4c('0x14')](_0x8d4c('0x18'),_0x3cf8c2,JSON[_0x8d4c('0x15')](_0x349a2a));_0x54be8f(_0x349a2a);})[_0x8d4c('0x1a')](function(_0xb4842b){logger[_0x8d4c('0x16')](_0x8d4c('0x18'),_0xb4842b['message'],_0x3cf8c2);_0x5a034d(_0x5d3c1d[_0x8d4c('0x16')](0x1f4,_0xb4842b[_0x8d4c('0x17')]));});});};
\ No newline at end of file
index 61690f8..3992c6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa774=['./squareProject.events','remove','update','emit','register'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0xa774,0xa0));var _0x4a77=function(_0x280f4a,_0x2ed8d6){_0x280f4a=_0x280f4a-0x0;var _0x1bb157=_0xa774[_0x280f4a];return _0x1bb157;};'use strict';var SquareProjectEvents=require(_0x4a77('0x0'));var events=['save',_0x4a77('0x1'),_0x4a77('0x2')];function createListener(_0x2d15ca,_0x2f6bf6){return function(_0x12b11d){_0x2f6bf6[_0x4a77('0x3')](_0x2d15ca,_0x12b11d);};}function removeListener(_0x120dd0,_0x459c4e){return function(){SquareProjectEvents['removeListener'](_0x120dd0,_0x459c4e);};}exports[_0x4a77('0x4')]=function(_0x2167cb){for(var _0x2762d5=0x0,_0x338bfc=events['length'];_0x2762d5<_0x338bfc;_0x2762d5++){var _0x384616=events[_0x2762d5];var _0x31653d=createListener('squareProject:'+_0x384616,_0x2167cb);SquareProjectEvents['on'](_0x384616,_0x31653d);}};
\ No newline at end of file
+var _0x0935=['save','remove','update','emit','register','length'];(function(_0x4884a7,_0x18e38a){var _0x56b60e=function(_0x2ba8a3){while(--_0x2ba8a3){_0x4884a7['push'](_0x4884a7['shift']());}};_0x56b60e(++_0x18e38a);}(_0x0935,0x13e));var _0x5093=function(_0xf41f5e,_0x45748f){_0xf41f5e=_0xf41f5e-0x0;var _0x588116=_0x0935[_0xf41f5e];return _0x588116;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x5093('0x0'),_0x5093('0x1'),_0x5093('0x2')];function createListener(_0x191ba7,_0x3cd55e){return function(_0x106526){_0x3cd55e[_0x5093('0x3')](_0x191ba7,_0x106526);};}function removeListener(_0x12763c,_0xb6e28e){return function(){SquareProjectEvents['removeListener'](_0x12763c,_0xb6e28e);};}exports[_0x5093('0x4')]=function(_0x377e5d){for(var _0x562271=0x0,_0x231688=events[_0x5093('0x5')];_0x562271<_0x231688;_0x562271++){var _0x2625ba=events[_0x562271];var _0x4a5e27=createListener('squareProject:'+_0x2625ba,_0x377e5d);SquareProjectEvents['on'](_0x2625ba,_0x4a5e27);}};
\ No newline at end of file
index 775be6a..382030e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0295=['isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x0295,0x1f0));var _0x5029=function(_0x5706fb,_0xacfe3c){_0x5706fb=_0x5706fb-0x0;var _0x21799d=_0x0295[_0x5706fb];return _0x21799d;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5029('0x2'));var auth=require(_0x5029('0x3'));var interaction=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var controller=require(_0x5029('0x6'));router[_0x5029('0x7')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0x9')]);router[_0x5029('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5029('0x7')]('/:id/download',auth[_0x5029('0x8')](),controller['download']);router[_0x5029('0xa')]('/',auth['isAuthenticated'](),controller[_0x5029('0xb')]);router[_0x5029('0xc')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0xe')]);router[_0x5029('0xf')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0x10')]);module[_0x5029('0x11')]=router;
\ No newline at end of file
+var _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x27e14b,_0x4e25b0){var _0xa1290c=function(_0x2aa035){while(--_0x2aa035){_0x27e14b['push'](_0x27e14b['shift']());}};_0xa1290c(++_0x4e25b0);}(_0x5fab,0x177));var _0xb5fa=function(_0x4f613c,_0x425015){_0x4f613c=_0x4f613c-0x0;var _0x50cffd=_0x5fab[_0x4f613c];return _0x50cffd;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router;
\ No newline at end of file
index 2dd9b2f..b4ffd8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac9d=['VIRTUAL','savePath','lastIndexOf','sequelize','exports','STRING'];(function(_0x501642,_0x2fddcf){var _0x4217c1=function(_0x4c41e6){while(--_0x4c41e6){_0x501642['push'](_0x501642['shift']());}};_0x4217c1(++_0x2fddcf);}(_0xac9d,0x14d));var _0xdac9=function(_0x4e1bd3,_0xda464d){_0x4e1bd3=_0x4e1bd3-0x0;var _0x234e83=_0xac9d[_0x4e1bd3];return _0x234e83;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'uniqueid':{'type':Sequelize[_0xdac9('0x2')]},'callerid':{'type':Sequelize[_0xdac9('0x2')]},'calleridname':{'type':Sequelize[_0xdac9('0x2')]},'context':{'type':Sequelize[_0xdac9('0x2')]},'extension':{'type':Sequelize[_0xdac9('0x2')]},'priority':{'type':Sequelize[_0xdac9('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xdac9('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0xdac9('0x2')]},'filename':{'type':Sequelize[_0xdac9('0x2')]},'savePath':{'type':Sequelize[_0xdac9('0x2')]},'format':{'type':Sequelize[_0xdac9('0x3')],'get':function(){var _0x1c78c5='';var _0x39f560=this['getDataValue'](_0xdac9('0x4'));if(_0x39f560){_0x1c78c5=_0x39f560['substring'](_0x39f560[_0xdac9('0x5')]('.'));}return _0x1c78c5;}}};
\ No newline at end of file
+var _0xeec6=['sequelize','exports','STRING','getDataValue','savePath','lastIndexOf'];(function(_0xe1ba26,_0x54e540){var _0x29a494=function(_0x14fbd0){while(--_0x14fbd0){_0xe1ba26['push'](_0xe1ba26['shift']());}};_0x29a494(++_0x54e540);}(_0xeec6,0x1c2));var _0x6eec=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xeec6[_0x25bea7];return _0x175952;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'uniqueid':{'type':Sequelize[_0x6eec('0x2')]},'callerid':{'type':Sequelize[_0x6eec('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x6eec('0x2')]},'extension':{'type':Sequelize[_0x6eec('0x2')]},'priority':{'type':Sequelize[_0x6eec('0x2')]},'accountcode':{'type':Sequelize[_0x6eec('0x2')]},'dnid':{'type':Sequelize[_0x6eec('0x2')]},'projectName':{'type':Sequelize[_0x6eec('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x6eec('0x2')]},'savePath':{'type':Sequelize[_0x6eec('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x5a5e47='';var _0x1c810e=this[_0x6eec('0x3')](_0x6eec('0x4'));if(_0x1c810e){_0x5a5e47=_0x1c810e['substring'](_0x1c810e[_0x6eec('0x5')]('.'));}return _0x5a5e47;}}};
\ No newline at end of file
index d742867..06ab665 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7897=['limit','reject','save','then','destroy','end','error','stack','name','index','map','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','filter','merge','VIRTUAL','options','SquareRecording','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','update','params','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','secrets','SquareRecording\x20not\x20found','extname','unlink','message','send','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset'];(function(_0x33d3a7,_0x327a30){var _0x619b9=function(_0x20601e){while(--_0x20601e){_0x33d3a7['push'](_0x33d3a7['shift']());}};_0x619b9(++_0x327a30);}(_0x7897,0x9d));var _0x7789=function(_0x197cf7,_0x37308d){_0x197cf7=_0x197cf7-0x0;var _0x436f84=_0x7897[_0x197cf7];return _0x436f84;};'use strict';var emlformat=require(_0x7789('0x0'));var rimraf=require(_0x7789('0x1'));var zipdir=require(_0x7789('0x2'));var jsonpatch=require(_0x7789('0x3'));var rp=require(_0x7789('0x4'));var moment=require(_0x7789('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7789('0x6'));var util=require(_0x7789('0x7'));var path=require(_0x7789('0x8'));var sox=require('sox');var csv=require(_0x7789('0x9'));var ejs=require(_0x7789('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7789('0xb'));var squel=require(_0x7789('0xc'));var crypto=require(_0x7789('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7789('0xe'));var toCsv=require(_0x7789('0x9'));var querystring=require(_0x7789('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7789('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7789('0x11'))(_0x7789('0x12'));var utils=require(_0x7789('0x13'));var config=require(_0x7789('0x14'));var licenseUtil=require(_0x7789('0x15'));var db=require(_0x7789('0x16'))['db'];function respondWithStatusCode(_0xa096ce,_0x666c68){_0x666c68=_0x666c68||0xcc;return function(_0x366e2c){if(_0x366e2c){return _0xa096ce[_0x7789('0x17')](_0x666c68);}return _0xa096ce[_0x7789('0x18')](_0x666c68)['end']();};}function respondWithResult(_0x273dd3,_0x5797cf){_0x5797cf=_0x5797cf||0xc8;return function(_0x2d85b1){if(_0x2d85b1){return _0x273dd3[_0x7789('0x18')](_0x5797cf)[_0x7789('0x19')](_0x2d85b1);}};}function respondWithFilteredResult(_0x3dbfe6,_0x36e0c5){return function(_0x1b582b){if(_0x1b582b){var _0x4f0d02=typeof _0x36e0c5['offset']==='undefined'&&typeof _0x36e0c5['limit']===_0x7789('0x1a');var _0x5c8a26=_0x1b582b[_0x7789('0x1b')];var _0x3c20de=_0x4f0d02?0x0:_0x36e0c5[_0x7789('0x1c')];var _0x5f3163=_0x4f0d02?_0x1b582b['count']:_0x36e0c5[_0x7789('0x1c')]+_0x36e0c5[_0x7789('0x1d')];var _0x4e3786;if(_0x5f3163>=_0x5c8a26){_0x5f3163=_0x5c8a26;_0x4e3786=0xc8;}else{_0x4e3786=0xce;}_0x3dbfe6[_0x7789('0x18')](_0x4e3786);return _0x3dbfe6['set']('Content-Range',_0x3c20de+'-'+_0x5f3163+'/'+_0x5c8a26)[_0x7789('0x19')](_0x1b582b);}return null;};}function patchUpdates(_0x25ba72){return function(_0x3dc303){try{jsonpatch['apply'](_0x3dc303,_0x25ba72,!![]);}catch(_0x492ce2){return BPromise[_0x7789('0x1e')](_0x492ce2);}return _0x3dc303[_0x7789('0x1f')]();};}function saveUpdates(_0x1e933c,_0x1eb8b6){return function(_0x44db76){if(_0x44db76){return _0x44db76['update'](_0x1e933c)[_0x7789('0x20')](function(_0x459d35){return _0x459d35;});}return null;};}function removeEntity(_0xf17f3a,_0x477042){return function(_0x17e7b6){if(_0x17e7b6){return _0x17e7b6[_0x7789('0x21')]()[_0x7789('0x20')](function(){_0xf17f3a[_0x7789('0x18')](0xcc)[_0x7789('0x22')]();});}};}function handleEntityNotFound(_0xad6d19,_0xd4af4b){return function(_0x3abe07){if(!_0x3abe07){_0xad6d19[_0x7789('0x17')](0x194);}return _0x3abe07;};}function handleError(_0x271678,_0x12ef6b){_0x12ef6b=_0x12ef6b||0x1f4;return function(_0x3642cb){logger[_0x7789('0x23')](_0x3642cb[_0x7789('0x24')]);if(_0x3642cb[_0x7789('0x25')]){delete _0x3642cb[_0x7789('0x25')];}_0x271678[_0x7789('0x18')](_0x12ef6b)['send'](_0x3642cb);};}exports[_0x7789('0x26')]=function(_0x3e0bc5,_0xd8b1af){var _0x5964c8={},_0x551270={},_0x23b587={'count':0x0,'rows':[]};var _0xf431ea=_[_0x7789('0x27')](db['SquareRecording']['rawAttributes'],function(_0x34c884){return{'name':_0x34c884[_0x7789('0x28')],'type':_0x34c884[_0x7789('0x29')][_0x7789('0x2a')]};});_0x551270[_0x7789('0x2b')]=_[_0x7789('0x27')](_0xf431ea,_0x7789('0x25'));_0x551270[_0x7789('0x2c')]=_[_0x7789('0x2d')](_0x3e0bc5[_0x7789('0x2c')]);_0x551270['filters']=_[_0x7789('0x2e')](_0x551270['model'],_0x551270[_0x7789('0x2c')]);_0x5964c8[_0x7789('0x2f')]=_[_0x7789('0x2e')](_0x551270[_0x7789('0x2b')],qs[_0x7789('0x30')](_0x3e0bc5[_0x7789('0x2c')][_0x7789('0x30')]));_0x5964c8['attributes']=_0x5964c8[_0x7789('0x2f')][_0x7789('0x31')]?_0x5964c8[_0x7789('0x2f')]:_0x551270[_0x7789('0x2b')];if(!_0x3e0bc5['query']['hasOwnProperty']('nolimit')){_0x5964c8[_0x7789('0x1d')]=qs[_0x7789('0x1d')](_0x3e0bc5['query'][_0x7789('0x1d')]);_0x5964c8[_0x7789('0x1c')]=qs[_0x7789('0x1c')](_0x3e0bc5[_0x7789('0x2c')][_0x7789('0x1c')]);}_0x5964c8[_0x7789('0x32')]=qs[_0x7789('0x33')](_0x3e0bc5[_0x7789('0x2c')][_0x7789('0x33')]);_0x5964c8[_0x7789('0x34')]=qs[_0x7789('0x35')](_['pick'](_0x3e0bc5['query'],_0x551270[_0x7789('0x35')]),_0xf431ea);if(_0x3e0bc5[_0x7789('0x2c')][_0x7789('0x36')]){_0x5964c8['where']=_[_0x7789('0x37')](_0x5964c8[_0x7789('0x34')],{'$or':_[_0x7789('0x27')](_0xf431ea,function(_0x4f2cb2){if(_0x4f2cb2['type']!==_0x7789('0x38')){var _0x476c2f={};_0x476c2f[_0x4f2cb2[_0x7789('0x25')]]={'$like':'%'+_0x3e0bc5[_0x7789('0x2c')][_0x7789('0x36')]+'%'};return _0x476c2f;}})});}_0x5964c8=_['merge']({},_0x5964c8,_0x3e0bc5[_0x7789('0x39')]);var _0x2fc5a9={'where':_0x5964c8[_0x7789('0x34')]};return db[_0x7789('0x3a')]['count'](_0x2fc5a9)[_0x7789('0x20')](function(_0x2164f0){_0x23b587[_0x7789('0x1b')]=_0x2164f0;if(_0x3e0bc5['query'][_0x7789('0x3b')]){_0x5964c8[_0x7789('0x3c')]=[{'all':!![]}];}return db['SquareRecording'][_0x7789('0x3d')](_0x5964c8);})['then'](function(_0x9662cd){_0x23b587['rows']=_0x9662cd;return _0x23b587;})[_0x7789('0x20')](respondWithFilteredResult(_0xd8b1af,_0x5964c8))[_0x7789('0x3e')](handleError(_0xd8b1af,null));};exports[_0x7789('0x3f')]=function(_0x11e98b,_0x1ff46d){var _0x582a38={'raw':!![],'where':{'id':_0x11e98b['params']['id']}},_0x2cad5a={};_0x2cad5a[_0x7789('0x2b')]=_[_0x7789('0x2d')](db['SquareRecording'][_0x7789('0x40')]);_0x2cad5a[_0x7789('0x2c')]=_[_0x7789('0x2d')](_0x11e98b[_0x7789('0x2c')]);_0x2cad5a[_0x7789('0x35')]=_[_0x7789('0x2e')](_0x2cad5a[_0x7789('0x2b')],_0x2cad5a[_0x7789('0x2c')]);_0x582a38[_0x7789('0x2f')]=_[_0x7789('0x2e')](_0x2cad5a[_0x7789('0x2b')],qs[_0x7789('0x30')](_0x11e98b[_0x7789('0x2c')]['fields']));_0x582a38['attributes']=_0x582a38[_0x7789('0x2f')][_0x7789('0x31')]?_0x582a38[_0x7789('0x2f')]:_0x2cad5a[_0x7789('0x2b')];if(_0x11e98b[_0x7789('0x2c')][_0x7789('0x3b')]){_0x582a38[_0x7789('0x3c')]=[{'all':!![]}];}_0x582a38=_[_0x7789('0x37')]({},_0x582a38,_0x11e98b[_0x7789('0x39')]);return db['SquareRecording'][_0x7789('0x41')](_0x582a38)['then'](handleEntityNotFound(_0x1ff46d,null))[_0x7789('0x20')](respondWithResult(_0x1ff46d,null))[_0x7789('0x3e')](handleError(_0x1ff46d,null));};exports['create']=function(_0x55fbfd,_0x39b380){return db['SquareRecording'][_0x7789('0x42')](_0x55fbfd[_0x7789('0x43')],{})['then'](respondWithResult(_0x39b380,0xc9))[_0x7789('0x3e')](handleError(_0x39b380,null));};exports[_0x7789('0x44')]=function(_0x2bd657,_0x3d6950){if(_0x2bd657[_0x7789('0x43')]['id']){delete _0x2bd657[_0x7789('0x43')]['id'];}return db[_0x7789('0x3a')][_0x7789('0x41')]({'where':{'id':_0x2bd657[_0x7789('0x45')]['id']}})[_0x7789('0x20')](handleEntityNotFound(_0x3d6950,null))['then'](saveUpdates(_0x2bd657[_0x7789('0x43')],null))[_0x7789('0x20')](respondWithResult(_0x3d6950,null))[_0x7789('0x3e')](handleError(_0x3d6950,null));};exports[_0x7789('0x46')]=function(_0x434d1a,_0x36aa45,_0x2042b2){var _0x4adbd1=require(_0x7789('0x47'));var _0x318277=![];var _0x40d340={};if(_0x434d1a['query'][_0x7789('0x29')]&&_0x434d1a[_0x7789('0x2c')]['type']==='uniqueid'){_0x40d340[_0x7789('0x48')]=_0x434d1a[_0x7789('0x45')]['id'];}else{_0x40d340['id']=_0x434d1a[_0x7789('0x45')]['id'];}return db[_0x7789('0x3a')]['find']({'where':_0x40d340,'attributes':['id',_0x7789('0x49'),_0x7789('0x4a')],'raw':!![]})[_0x7789('0x20')](handleEntityNotFound(_0x36aa45,null))[_0x7789('0x20')](function(_0x143476){if(_0x143476){var _0x36d9fe=_0x143476[_0x7789('0x49')];var _0x1a7315=util[_0x7789('0x4b')](_0x7789('0x4c'),_0x36d9fe);if(fs[_0x7789('0x4d')](_0x1a7315)){_0x318277=!![];return _0x4adbd1['decryptFile'](_0x1a7315,_0x36d9fe,config[_0x7789('0x4e')]['recording'])['then'](function(){return _0x143476;});}return _0x143476;}})[_0x7789('0x20')](function(_0x43c79d){if(_0x43c79d){var _0x14d44b=_0x43c79d[_0x7789('0x49')];if(!fs[_0x7789('0x4d')](_0x14d44b)){throw new db['Sequelize']['ValidationError'](_0x7789('0x4f'));}if(_0x43c79d[_0x7789('0x4a')]){return _0x36aa45[_0x7789('0x46')](_0x14d44b,_0x43c79d['filename']+path[_0x7789('0x50')](_0x14d44b),function(){if(_0x318277){fs[_0x7789('0x51')](_0x14d44b);}});}else{return _0x36aa45[_0x7789('0x46')](_0x14d44b,function(_0x3bae9f){if(_0x318277){fs[_0x7789('0x51')](_0x14d44b);}});}}})[_0x7789('0x3e')](function(_0x2255bb){if(_0x2255bb[_0x7789('0x52')]===_0x7789('0x4f')){_0x36aa45['status'](0x194)[_0x7789('0x53')](_0x7789('0x54'));}else{return handleError(_0x36aa45,null);}});};exports[_0x7789('0x21')]=function(_0x30c5c4,_0x1296a1){return db[_0x7789('0x3a')]['find']({'where':{'id':_0x30c5c4[_0x7789('0x45')]['id']}})[_0x7789('0x20')](function(_0x57bdd0){if(_[_0x7789('0x55')](_0x57bdd0)){throw new ReferenceError(_0x7789('0x56'));}return _0x57bdd0;})[_0x7789('0x20')](function(_0x181331){var _0x3b8644=_0x181331['savePath'];logger[_0x7789('0x57')](_0x7789('0x58'),_0x3b8644);if(!_[_0x7789('0x55')](_0x181331[_0x7789('0x49')])&&fs['existsSync'](_0x3b8644)){logger[_0x7789('0x57')](_0x7789('0x59')+_0x3b8644+_0x7789('0x5a'));fs[_0x7789('0x5b')](_0x3b8644);}_0x3b8644=_0x3b8644+_0x7789('0x5c');if(!_['isNil'](_0x181331['savePath'])&&fs[_0x7789('0x4d')](_0x3b8644)){logger[_0x7789('0x57')]('File:\x20\x22'+_0x3b8644+_0x7789('0x5a'));fs[_0x7789('0x5b')](_0x3b8644);}return _0x181331;})['then'](function(_0x1c4ab8){if(!_0x1c4ab8)throw new InternalError();return _0x1c4ab8[_0x7789('0x21')]();})['then'](function(){_0x1296a1[_0x7789('0x18')](0xcc)[_0x7789('0x22')]();})[_0x7789('0x3e')](handleError(_0x1296a1,null));};
\ No newline at end of file
+var _0xd3a5=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','status','end','json','undefined','limit','offset','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','map','SquareRecording','rawAttributes','type','key','model','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','show','params','keys','attributes','find','catch','create','body','uniqueid','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring'];(function(_0x590359,_0x36f914){var _0x36fd8a=function(_0x34ebe0){while(--_0x34ebe0){_0x590359['push'](_0x590359['shift']());}};_0x36fd8a(++_0x36f914);}(_0xd3a5,0xac));var _0x5d3a=function(_0x22c50e,_0x4ea131){_0x22c50e=_0x22c50e-0x0;var _0x500f85=_0xd3a5[_0x22c50e];return _0x500f85;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5d3a('0x0'));var zipdir=require(_0x5d3a('0x1'));var jsonpatch=require(_0x5d3a('0x2'));var rp=require(_0x5d3a('0x3'));var moment=require(_0x5d3a('0x4'));var BPromise=require(_0x5d3a('0x5'));var Mustache=require(_0x5d3a('0x6'));var util=require(_0x5d3a('0x7'));var path=require(_0x5d3a('0x8'));var sox=require('sox');var csv=require(_0x5d3a('0x9'));var ejs=require(_0x5d3a('0xa'));var fs=require('fs');var fs_extra=require(_0x5d3a('0xb'));var _=require('lodash');var squel=require(_0x5d3a('0xc'));var crypto=require(_0x5d3a('0xd'));var jsforce=require(_0x5d3a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5d3a('0x9'));var querystring=require(_0x5d3a('0xf'));var Papa=require(_0x5d3a('0x10'));var Redis=require(_0x5d3a('0x11'));var authService=require(_0x5d3a('0x12'));var qs=require(_0x5d3a('0x13'));var as=require(_0x5d3a('0x14'));var hardwareService=require(_0x5d3a('0x15'));var logger=require(_0x5d3a('0x16'))('api');var utils=require(_0x5d3a('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x500b1b,_0x1f5142){_0x1f5142=_0x1f5142||0xcc;return function(_0x4415a7){if(_0x4415a7){return _0x500b1b['sendStatus'](_0x1f5142);}return _0x500b1b[_0x5d3a('0x18')](_0x1f5142)[_0x5d3a('0x19')]();};}function respondWithResult(_0x1aacbd,_0x38d40d){_0x38d40d=_0x38d40d||0xc8;return function(_0x27475d){if(_0x27475d){return _0x1aacbd[_0x5d3a('0x18')](_0x38d40d)[_0x5d3a('0x1a')](_0x27475d);}};}function respondWithFilteredResult(_0x1a6b1b,_0x582a6a){return function(_0x5255ae){if(_0x5255ae){var _0x155c2a=typeof _0x582a6a['offset']===_0x5d3a('0x1b')&&typeof _0x582a6a[_0x5d3a('0x1c')]===_0x5d3a('0x1b');var _0x44e499=_0x5255ae['count'];var _0x1698e2=_0x155c2a?0x0:_0x582a6a[_0x5d3a('0x1d')];var _0x4c0aac=_0x155c2a?_0x5255ae['count']:_0x582a6a[_0x5d3a('0x1d')]+_0x582a6a[_0x5d3a('0x1c')];var _0x404f72;if(_0x4c0aac>=_0x44e499){_0x4c0aac=_0x44e499;_0x404f72=0xc8;}else{_0x404f72=0xce;}_0x1a6b1b['status'](_0x404f72);return _0x1a6b1b['set'](_0x5d3a('0x1e'),_0x1698e2+'-'+_0x4c0aac+'/'+_0x44e499)[_0x5d3a('0x1a')](_0x5255ae);}return null;};}function patchUpdates(_0x44610e){return function(_0x37a9f0){try{jsonpatch[_0x5d3a('0x1f')](_0x37a9f0,_0x44610e,!![]);}catch(_0x386e4f){return BPromise[_0x5d3a('0x20')](_0x386e4f);}return _0x37a9f0['save']();};}function saveUpdates(_0x5397a3,_0x2a7cb7){return function(_0x3c713b){if(_0x3c713b){return _0x3c713b[_0x5d3a('0x21')](_0x5397a3)['then'](function(_0x470be0){return _0x470be0;});}return null;};}function removeEntity(_0x190167,_0x32e0ec){return function(_0x12ca82){if(_0x12ca82){return _0x12ca82[_0x5d3a('0x22')]()[_0x5d3a('0x23')](function(){_0x190167[_0x5d3a('0x18')](0xcc)[_0x5d3a('0x19')]();});}};}function handleEntityNotFound(_0x2412e9,_0x3ea008){return function(_0x118045){if(!_0x118045){_0x2412e9['sendStatus'](0x194);}return _0x118045;};}function handleError(_0x2454ae,_0x17147d){_0x17147d=_0x17147d||0x1f4;return function(_0x4cf97d){logger[_0x5d3a('0x24')](_0x4cf97d[_0x5d3a('0x25')]);if(_0x4cf97d['name']){delete _0x4cf97d[_0x5d3a('0x26')];}_0x2454ae[_0x5d3a('0x18')](_0x17147d)[_0x5d3a('0x27')](_0x4cf97d);};}exports['index']=function(_0x479e92,_0x1d5914){var _0x47c4dc={},_0x22adcd={},_0x159040={'count':0x0,'rows':[]};var _0x530491=_[_0x5d3a('0x28')](db[_0x5d3a('0x29')][_0x5d3a('0x2a')],function(_0x2029ef){return{'name':_0x2029ef['fieldName'],'type':_0x2029ef[_0x5d3a('0x2b')][_0x5d3a('0x2c')]};});_0x22adcd[_0x5d3a('0x2d')]=_['map'](_0x530491,_0x5d3a('0x26'));_0x22adcd[_0x5d3a('0x2e')]=_['keys'](_0x479e92[_0x5d3a('0x2e')]);_0x22adcd[_0x5d3a('0x2f')]=_[_0x5d3a('0x30')](_0x22adcd[_0x5d3a('0x2d')],_0x22adcd[_0x5d3a('0x2e')]);_0x47c4dc['attributes']=_[_0x5d3a('0x30')](_0x22adcd[_0x5d3a('0x2d')],qs[_0x5d3a('0x31')](_0x479e92['query'][_0x5d3a('0x31')]));_0x47c4dc['attributes']=_0x47c4dc['attributes'][_0x5d3a('0x32')]?_0x47c4dc['attributes']:_0x22adcd[_0x5d3a('0x2d')];if(!_0x479e92[_0x5d3a('0x2e')][_0x5d3a('0x33')](_0x5d3a('0x34'))){_0x47c4dc[_0x5d3a('0x1c')]=qs[_0x5d3a('0x1c')](_0x479e92[_0x5d3a('0x2e')][_0x5d3a('0x1c')]);_0x47c4dc[_0x5d3a('0x1d')]=qs['offset'](_0x479e92['query']['offset']);}_0x47c4dc[_0x5d3a('0x35')]=qs[_0x5d3a('0x36')](_0x479e92[_0x5d3a('0x2e')][_0x5d3a('0x36')]);_0x47c4dc[_0x5d3a('0x37')]=qs[_0x5d3a('0x2f')](_[_0x5d3a('0x38')](_0x479e92['query'],_0x22adcd['filters']),_0x530491);if(_0x479e92[_0x5d3a('0x2e')][_0x5d3a('0x39')]){_0x47c4dc[_0x5d3a('0x37')]=_[_0x5d3a('0x3a')](_0x47c4dc[_0x5d3a('0x37')],{'$or':_[_0x5d3a('0x28')](_0x530491,function(_0x50df71){if(_0x50df71[_0x5d3a('0x2b')]!=='VIRTUAL'){var _0x6da9f4={};_0x6da9f4[_0x50df71[_0x5d3a('0x26')]]={'$like':'%'+_0x479e92['query']['filter']+'%'};return _0x6da9f4;}})});}_0x47c4dc=_[_0x5d3a('0x3a')]({},_0x47c4dc,_0x479e92[_0x5d3a('0x3b')]);var _0x2633c8={'where':_0x47c4dc['where']};return db[_0x5d3a('0x29')][_0x5d3a('0x3c')](_0x2633c8)[_0x5d3a('0x23')](function(_0x508f96){_0x159040['count']=_0x508f96;if(_0x479e92[_0x5d3a('0x2e')][_0x5d3a('0x3d')]){_0x47c4dc[_0x5d3a('0x3e')]=[{'all':!![]}];}return db[_0x5d3a('0x29')][_0x5d3a('0x3f')](_0x47c4dc);})[_0x5d3a('0x23')](function(_0x8832c4){_0x159040[_0x5d3a('0x40')]=_0x8832c4;return _0x159040;})[_0x5d3a('0x23')](respondWithFilteredResult(_0x1d5914,_0x47c4dc))['catch'](handleError(_0x1d5914,null));};exports[_0x5d3a('0x41')]=function(_0x4ec025,_0x5c7d17){var _0x3188b5={'raw':!![],'where':{'id':_0x4ec025[_0x5d3a('0x42')]['id']}},_0xc251fb={};_0xc251fb[_0x5d3a('0x2d')]=_[_0x5d3a('0x43')](db[_0x5d3a('0x29')][_0x5d3a('0x2a')]);_0xc251fb[_0x5d3a('0x2e')]=_[_0x5d3a('0x43')](_0x4ec025[_0x5d3a('0x2e')]);_0xc251fb[_0x5d3a('0x2f')]=_[_0x5d3a('0x30')](_0xc251fb[_0x5d3a('0x2d')],_0xc251fb['query']);_0x3188b5[_0x5d3a('0x44')]=_[_0x5d3a('0x30')](_0xc251fb[_0x5d3a('0x2d')],qs[_0x5d3a('0x31')](_0x4ec025[_0x5d3a('0x2e')][_0x5d3a('0x31')]));_0x3188b5[_0x5d3a('0x44')]=_0x3188b5[_0x5d3a('0x44')]['length']?_0x3188b5[_0x5d3a('0x44')]:_0xc251fb[_0x5d3a('0x2d')];if(_0x4ec025[_0x5d3a('0x2e')]['includeAll']){_0x3188b5[_0x5d3a('0x3e')]=[{'all':!![]}];}_0x3188b5=_[_0x5d3a('0x3a')]({},_0x3188b5,_0x4ec025[_0x5d3a('0x3b')]);return db[_0x5d3a('0x29')][_0x5d3a('0x45')](_0x3188b5)['then'](handleEntityNotFound(_0x5c7d17,null))[_0x5d3a('0x23')](respondWithResult(_0x5c7d17,null))[_0x5d3a('0x46')](handleError(_0x5c7d17,null));};exports[_0x5d3a('0x47')]=function(_0x52d3e8,_0x108fa4){return db[_0x5d3a('0x29')]['create'](_0x52d3e8[_0x5d3a('0x48')],{})[_0x5d3a('0x23')](respondWithResult(_0x108fa4,0xc9))[_0x5d3a('0x46')](handleError(_0x108fa4,null));};exports[_0x5d3a('0x21')]=function(_0x91bd78,_0x262a19){if(_0x91bd78[_0x5d3a('0x48')]['id']){delete _0x91bd78['body']['id'];}return db[_0x5d3a('0x29')][_0x5d3a('0x45')]({'where':{'id':_0x91bd78[_0x5d3a('0x42')]['id']}})[_0x5d3a('0x23')](handleEntityNotFound(_0x262a19,null))['then'](saveUpdates(_0x91bd78[_0x5d3a('0x48')],null))[_0x5d3a('0x23')](respondWithResult(_0x262a19,null))[_0x5d3a('0x46')](handleError(_0x262a19,null));};exports['download']=function(_0x13f10c,_0x24e1f4,_0x562340){var _0x5a7ac2=require('../../components/encryptor');var _0x175241=![];var _0x204a0a={};if(_0x13f10c[_0x5d3a('0x2e')][_0x5d3a('0x2b')]&&_0x13f10c[_0x5d3a('0x2e')]['type']===_0x5d3a('0x49')){_0x204a0a[_0x5d3a('0x49')]=_0x13f10c[_0x5d3a('0x42')]['id'];}else{_0x204a0a['id']=_0x13f10c[_0x5d3a('0x42')]['id'];}return db[_0x5d3a('0x29')][_0x5d3a('0x45')]({'where':_0x204a0a,'attributes':['id',_0x5d3a('0x4a'),'filename'],'raw':!![]})[_0x5d3a('0x23')](handleEntityNotFound(_0x24e1f4,null))[_0x5d3a('0x23')](function(_0x1157f2){if(_0x1157f2){var _0x1d1286=_0x1157f2['savePath'];var _0xddcada=util[_0x5d3a('0x4b')](_0x5d3a('0x4c'),_0x1d1286);if(fs[_0x5d3a('0x4d')](_0xddcada)){_0x175241=!![];return _0x5a7ac2[_0x5d3a('0x4e')](_0xddcada,_0x1d1286,config[_0x5d3a('0x4f')][_0x5d3a('0x50')])[_0x5d3a('0x23')](function(){return _0x1157f2;});}return _0x1157f2;}})[_0x5d3a('0x23')](function(_0x4a1292){if(_0x4a1292){var _0x34a5ac=_0x4a1292[_0x5d3a('0x4a')];if(!fs['existsSync'](_0x34a5ac)){throw new db['Sequelize']['ValidationError']('SquareRecording\x20not\x20found');}if(_0x4a1292[_0x5d3a('0x51')]){return _0x24e1f4['download'](_0x34a5ac,_0x4a1292['filename']+path[_0x5d3a('0x52')](_0x34a5ac),function(){if(_0x175241){fs[_0x5d3a('0x53')](_0x34a5ac);}});}else{return _0x24e1f4['download'](_0x34a5ac,function(_0x3b0721){if(_0x175241){fs[_0x5d3a('0x53')](_0x34a5ac);}});}}})['catch'](function(_0x2f1fe8){if(_0x2f1fe8[_0x5d3a('0x54')]==='SquareRecording\x20not\x20found'){_0x24e1f4['status'](0x194)[_0x5d3a('0x27')](_0x5d3a('0x55'));}else{return handleError(_0x24e1f4,null);}});};exports[_0x5d3a('0x22')]=function(_0x1e8239,_0x469d45){return db['SquareRecording'][_0x5d3a('0x45')]({'where':{'id':_0x1e8239[_0x5d3a('0x42')]['id']}})[_0x5d3a('0x23')](function(_0x3adc2e){if(_['isNil'](_0x3adc2e)){throw new ReferenceError(_0x5d3a('0x56'));}return _0x3adc2e;})['then'](function(_0x35b12a){var _0x13c1c3=_0x35b12a[_0x5d3a('0x4a')];logger[_0x5d3a('0x57')](_0x5d3a('0x58'),_0x13c1c3);if(!_[_0x5d3a('0x59')](_0x35b12a[_0x5d3a('0x4a')])&&fs[_0x5d3a('0x4d')](_0x13c1c3)){logger[_0x5d3a('0x57')](_0x5d3a('0x5a')+_0x13c1c3+_0x5d3a('0x5b'));fs[_0x5d3a('0x5c')](_0x13c1c3);}_0x13c1c3=_0x13c1c3+_0x5d3a('0x5d');if(!_[_0x5d3a('0x59')](_0x35b12a[_0x5d3a('0x4a')])&&fs['existsSync'](_0x13c1c3)){logger[_0x5d3a('0x57')](_0x5d3a('0x5a')+_0x13c1c3+_0x5d3a('0x5b'));fs[_0x5d3a('0x5c')](_0x13c1c3);}return _0x35b12a;})['then'](function(_0x30d089){if(!_0x30d089)throw new InternalError();return _0x30d089[_0x5d3a('0x22')]();})[_0x5d3a('0x23')](function(){_0x469d45[_0x5d3a('0x18')](0xcc)['end']();})[_0x5d3a('0x46')](handleError(_0x469d45,null));};
\ No newline at end of file
index 3bd6045..58b69a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb22=['./squareRecording.attributes','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xabbd65,_0x546d99){var _0x1d005a=function(_0x11694e){while(--_0x11694e){_0xabbd65['push'](_0xabbd65['shift']());}};_0x1d005a(++_0x546d99);}(_0xcb22,0xc8));var _0x2cb2=function(_0x3dbcbc,_0xaa89df){_0x3dbcbc=_0x3dbcbc-0x0;var _0x3282d6=_0xcb22[_0x3dbcbc];return _0x3282d6;};'use strict';var _=require(_0x2cb2('0x0'));var util=require(_0x2cb2('0x1'));var logger=require(_0x2cb2('0x2'))(_0x2cb2('0x3'));var moment=require(_0x2cb2('0x4'));var BPromise=require(_0x2cb2('0x5'));var rp=require(_0x2cb2('0x6'));var fs=require('fs');var path=require(_0x2cb2('0x7'));var rimraf=require(_0x2cb2('0x8'));var config=require(_0x2cb2('0x9'));var attributes=require(_0x2cb2('0xa'));module['exports']=function(_0x77ae56,_0x3582d7){return _0x77ae56[_0x2cb2('0xb')](_0x2cb2('0xc'),attributes,{'tableName':_0x2cb2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdfb1=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','define','square_recordings'];(function(_0x276015,_0x57eb3d){var _0x385345=function(_0x3c5bb4){while(--_0x3c5bb4){_0x276015['push'](_0x276015['shift']());}};_0x385345(++_0x57eb3d);}(_0xdfb1,0x8c));var _0x1dfb=function(_0x2418bd,_0x1ddd5){_0x2418bd=_0x2418bd-0x0;var _0x12d19c=_0xdfb1[_0x2418bd];return _0x12d19c;};'use strict';var _=require(_0x1dfb('0x0'));var util=require(_0x1dfb('0x1'));var logger=require(_0x1dfb('0x2'))(_0x1dfb('0x3'));var moment=require('moment');var BPromise=require(_0x1dfb('0x4'));var rp=require(_0x1dfb('0x5'));var fs=require('fs');var path=require(_0x1dfb('0x6'));var rimraf=require(_0x1dfb('0x7'));var config=require('../../config/environment');var attributes=require('./squareRecording.attributes');module['exports']=function(_0x31f0ff,_0x36bf77){return _0x31f0ff[_0x1dfb('0x8')]('SquareRecording',attributes,{'tableName':_0x1dfb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9d39b81..22da913 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3166=['SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareRecording','SquareRecording','create','body','options','raw','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x49655b,_0x40c634){var _0x1878c9=function(_0x3b3b7b){while(--_0x3b3b7b){_0x49655b['push'](_0x49655b['shift']());}};_0x1878c9(++_0x40c634);}(_0x3166,0xbb));var _0x6316=function(_0x3fcaa7,_0x30061b){_0x3fcaa7=_0x3fcaa7-0x0;var _0x3ce07c=_0x3166[_0x3fcaa7];return _0x3ce07c;};'use strict';var _=require('lodash');var util=require(_0x6316('0x0'));var moment=require(_0x6316('0x1'));var BPromise=require(_0x6316('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6316('0x3'));var db=require(_0x6316('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6316('0x5'))(_0x6316('0x6'));var config=require('../../config/environment');var jayson=require(_0x6316('0x7'));var client=jayson[_0x6316('0x8')][_0x6316('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24d39c,_0x58058a,_0x2d7d22){return new BPromise(function(_0x31ca1a,_0x56abe5){return client[_0x6316('0xa')](_0x24d39c,_0x2d7d22)[_0x6316('0xb')](function(_0xed311e){logger[_0x6316('0xc')](_0x6316('0xd'),_0x58058a,_0x6316('0xe'));logger[_0x6316('0xf')](_0x6316('0x10'),_0x58058a,_0x6316('0xe'),JSON[_0x6316('0x11')](_0xed311e));if(_0xed311e[_0x6316('0x12')]){if(_0xed311e['error'][_0x6316('0x13')]===0x1f4){logger[_0x6316('0x12')](_0x6316('0xd'),_0x58058a,_0xed311e[_0x6316('0x12')][_0x6316('0x14')]);return _0x56abe5(_0xed311e[_0x6316('0x12')]['message']);}logger[_0x6316('0x12')](_0x6316('0xd'),_0x58058a,_0xed311e[_0x6316('0x12')][_0x6316('0x14')]);return _0x31ca1a(_0xed311e['error'][_0x6316('0x14')]);}else{logger[_0x6316('0xc')](_0x6316('0xd'),_0x58058a,'request\x20sent');_0x31ca1a(_0xed311e[_0x6316('0x15')][_0x6316('0x14')]);}})['catch'](function(_0x31b704){logger[_0x6316('0x12')](_0x6316('0xd'),_0x58058a,_0x31b704);_0x56abe5(_0x31b704);});});}exports[_0x6316('0x16')]=function(_0x569db2){var _0x485ee8=this;return new Promise(function(_0x2eecb9,_0x2a2888){return db[_0x6316('0x17')][_0x6316('0x18')](_0x569db2[_0x6316('0x19')],{'raw':_0x569db2[_0x6316('0x1a')]?_0x569db2[_0x6316('0x1a')][_0x6316('0x1b')]===undefined?!![]:![]:!![]})[_0x6316('0xb')](function(_0x3e4543){logger[_0x6316('0xc')]('CreateSquareRecording',_0x569db2);logger[_0x6316('0xf')](_0x6316('0x16'),_0x569db2,JSON[_0x6316('0x11')](_0x3e4543));_0x2eecb9(_0x3e4543);})[_0x6316('0x1c')](function(_0x3cfc43){logger[_0x6316('0x12')](_0x6316('0x16'),_0x3cfc43[_0x6316('0x14')],_0x569db2);_0x2a2888(_0x485ee8['error'](0x1f4,_0x3cfc43[_0x6316('0x14')]));});});};
\ No newline at end of file
+var _0x94f8=['code','message','result','catch','SquareRecording','create','body','options','raw','CreateSquareRecording','stringify','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error'];(function(_0x29c2a5,_0x1c6983){var _0x3aed05=function(_0x338653){while(--_0x338653){_0x29c2a5['push'](_0x29c2a5['shift']());}};_0x3aed05(++_0x1c6983);}(_0x94f8,0xeb));var _0x894f=function(_0x269ee8,_0x477226){_0x269ee8=_0x269ee8-0x0;var _0x4d98bd=_0x94f8[_0x269ee8];return _0x4d98bd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x894f('0x0'));var BPromise=require('bluebird');var rs=require(_0x894f('0x1'));var fs=require('fs');var Redis=require(_0x894f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x894f('0x3'));var logger=require(_0x894f('0x4'))(_0x894f('0x5'));var config=require('../../config/environment');var jayson=require(_0x894f('0x6'));var client=jayson[_0x894f('0x7')][_0x894f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39ebc4,_0x3e437c,_0x2aafaa){return new BPromise(function(_0x53f6b6,_0x218149){return client[_0x894f('0x9')](_0x39ebc4,_0x2aafaa)[_0x894f('0xa')](function(_0x1d4510){logger[_0x894f('0xb')](_0x894f('0xc'),_0x3e437c,_0x894f('0xd'));logger[_0x894f('0xe')](_0x894f('0xf'),_0x3e437c,_0x894f('0xd'),JSON['stringify'](_0x1d4510));if(_0x1d4510[_0x894f('0x10')]){if(_0x1d4510[_0x894f('0x10')][_0x894f('0x11')]===0x1f4){logger[_0x894f('0x10')](_0x894f('0xc'),_0x3e437c,_0x1d4510[_0x894f('0x10')][_0x894f('0x12')]);return _0x218149(_0x1d4510[_0x894f('0x10')][_0x894f('0x12')]);}logger[_0x894f('0x10')]('SquareRecording,\x20%s,\x20%s',_0x3e437c,_0x1d4510['error']['message']);return _0x53f6b6(_0x1d4510[_0x894f('0x10')][_0x894f('0x12')]);}else{logger[_0x894f('0xb')](_0x894f('0xc'),_0x3e437c,_0x894f('0xd'));_0x53f6b6(_0x1d4510[_0x894f('0x13')]['message']);}})[_0x894f('0x14')](function(_0x34645f){logger[_0x894f('0x10')](_0x894f('0xc'),_0x3e437c,_0x34645f);_0x218149(_0x34645f);});});}exports['CreateSquareRecording']=function(_0x391a2c){var _0x43a5c2=this;return new Promise(function(_0x33e5a5,_0x2519f4){return db[_0x894f('0x15')][_0x894f('0x16')](_0x391a2c[_0x894f('0x17')],{'raw':_0x391a2c[_0x894f('0x18')]?_0x391a2c['options'][_0x894f('0x19')]===undefined?!![]:![]:!![]})[_0x894f('0xa')](function(_0x3cec52){logger['info'](_0x894f('0x1a'),_0x391a2c);logger[_0x894f('0xe')](_0x894f('0x1a'),_0x391a2c,JSON[_0x894f('0x1b')](_0x3cec52));_0x33e5a5(_0x3cec52);})[_0x894f('0x14')](function(_0x517306){logger[_0x894f('0x10')](_0x894f('0x1a'),_0x517306[_0x894f('0x12')],_0x391a2c);_0x2519f4(_0x43a5c2[_0x894f('0x10')](0x1f4,_0x517306[_0x894f('0x12')]));});});};
\ No newline at end of file
index 4964015..04e852e 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(_0xef66ed,_0x1a5239){var _0xa14f66=function(_0x458541){while(--_0x458541){_0xef66ed['push'](_0xef66ed['shift']());}};_0xa14f66(++_0x1a5239);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x4f9949,_0x9a3577){var _0x3b744e=function(_0x233152){while(--_0x233152){_0x4f9949['push'](_0x4f9949['shift']());}};_0x3b744e(++_0x9a3577);}(_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('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router;
\ No newline at end of file
index 954db8b..fa58299 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0758=['STRING','DATE','exports'];(function(_0x5d33df,_0x1c60eb){var _0x1a554d=function(_0x309ea4){while(--_0x309ea4){_0x5d33df['push'](_0x5d33df['shift']());}};_0x1a554d(++_0x1c60eb);}(_0x0758,0x18b));var _0x8075=function(_0x5d80a2,_0x5c3c01){_0x5d80a2=_0x5d80a2-0x0;var _0x4e4e81=_0x0758[_0x5d80a2];return _0x4e4e81;};'use strict';var Sequelize=require('sequelize');module[_0x8075('0x0')]={'network':{'type':Sequelize[_0x8075('0x1')]},'network_script':{'type':Sequelize[_0x8075('0x1')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8075('0x1')]},'language':{'type':Sequelize[_0x8075('0x1')]},'type':{'type':Sequelize[_0x8075('0x1')]},'uniqueid':{'type':Sequelize[_0x8075('0x1')]},'version':{'type':Sequelize[_0x8075('0x1')]},'callerid':{'type':Sequelize[_0x8075('0x1')]},'calleridname':{'type':Sequelize[_0x8075('0x1')]},'callingpres':{'type':Sequelize[_0x8075('0x1')]},'callingani2':{'type':Sequelize[_0x8075('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x8075('0x1')]},'rdnis':{'type':Sequelize[_0x8075('0x1')]},'context':{'type':Sequelize[_0x8075('0x1')]},'extension':{'type':Sequelize[_0x8075('0x1')]},'priority':{'type':Sequelize[_0x8075('0x1')]},'enhanced':{'type':Sequelize[_0x8075('0x1')]},'accountcode':{'type':Sequelize[_0x8075('0x1')]},'threadid':{'type':Sequelize[_0x8075('0x1')]},'project_name':{'type':Sequelize[_0x8075('0x1')]},'joinAt':{'type':Sequelize[_0x8075('0x2')]},'leaveAt':{'type':Sequelize[_0x8075('0x2')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xc0ab=['sequelize','STRING','DATE','BOOLEAN'];(function(_0x2c1fbd,_0x956a86){var _0x2f540c=function(_0x1a955d){while(--_0x1a955d){_0x2c1fbd['push'](_0x2c1fbd['shift']());}};_0x2f540c(++_0x956a86);}(_0xc0ab,0xf8));var _0xbc0a=function(_0x20534c,_0xe46275){_0x20534c=_0x20534c-0x0;var _0x1925cc=_0xc0ab[_0x20534c];return _0x1925cc;};'use strict';var Sequelize=require(_0xbc0a('0x0'));module['exports']={'network':{'type':Sequelize[_0xbc0a('0x1')]},'network_script':{'type':Sequelize[_0xbc0a('0x1')]},'request':{'type':Sequelize[_0xbc0a('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xbc0a('0x1')]},'type':{'type':Sequelize[_0xbc0a('0x1')]},'uniqueid':{'type':Sequelize[_0xbc0a('0x1')]},'version':{'type':Sequelize[_0xbc0a('0x1')]},'callerid':{'type':Sequelize[_0xbc0a('0x1')]},'calleridname':{'type':Sequelize[_0xbc0a('0x1')]},'callingpres':{'type':Sequelize[_0xbc0a('0x1')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0xbc0a('0x1')]},'callingtns':{'type':Sequelize[_0xbc0a('0x1')]},'dnid':{'type':Sequelize[_0xbc0a('0x1')]},'rdnis':{'type':Sequelize[_0xbc0a('0x1')]},'context':{'type':Sequelize[_0xbc0a('0x1')]},'extension':{'type':Sequelize[_0xbc0a('0x1')]},'priority':{'type':Sequelize[_0xbc0a('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xbc0a('0x1')]},'threadid':{'type':Sequelize[_0xbc0a('0x1')]},'project_name':{'type':Sequelize[_0xbc0a('0x1')]},'joinAt':{'type':Sequelize[_0xbc0a('0x2')]},'leaveAt':{'type':Sequelize[_0xbc0a('0x2')]},'bot':{'type':Sequelize[_0xbc0a('0x3')],'defaultValue':![]}};
\ No newline at end of file
index fe0ece1..6dc7b48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd341=['path','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','offset','count','set','apply','reject','update','destroy','then','error','name','send','index','map','SquareReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache'];(function(_0x5a8cda,_0x3fe4b9){var _0x57fc51=function(_0x4eb644){while(--_0x4eb644){_0x5a8cda['push'](_0x5a8cda['shift']());}};_0x57fc51(++_0x3fe4b9);}(_0xd341,0x1b0));var _0x1d34=function(_0x11e394,_0xdb75aa){_0x11e394=_0x11e394-0x0;var _0x398f39=_0xd341[_0x11e394];return _0x398f39;};'use strict';var emlformat=require(_0x1d34('0x0'));var rimraf=require(_0x1d34('0x1'));var zipdir=require(_0x1d34('0x2'));var jsonpatch=require(_0x1d34('0x3'));var rp=require('request-promise');var moment=require(_0x1d34('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1d34('0x5'));var util=require('util');var path=require(_0x1d34('0x6'));var sox=require('sox');var csv=require(_0x1d34('0x7'));var ejs=require(_0x1d34('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d34('0x9'));var squel=require('squel');var crypto=require(_0x1d34('0xa'));var jsforce=require(_0x1d34('0xb'));var deskjs=require(_0x1d34('0xc'));var toCsv=require(_0x1d34('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1d34('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x1d34('0xe'));var as=require(_0x1d34('0xf'));var hardwareService=require(_0x1d34('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x1d34('0x11'));var config=require(_0x1d34('0x12'));var licenseUtil=require(_0x1d34('0x13'));var db=require(_0x1d34('0x14'))['db'];function respondWithStatusCode(_0x4ce75a,_0x330a0b){_0x330a0b=_0x330a0b||0xcc;return function(_0x3cc97b){if(_0x3cc97b){return _0x4ce75a[_0x1d34('0x15')](_0x330a0b);}return _0x4ce75a['status'](_0x330a0b)[_0x1d34('0x16')]();};}function respondWithResult(_0x30e0b7,_0x4be64d){_0x4be64d=_0x4be64d||0xc8;return function(_0x2514b3){if(_0x2514b3){return _0x30e0b7[_0x1d34('0x17')](_0x4be64d)[_0x1d34('0x18')](_0x2514b3);}};}function respondWithFilteredResult(_0x869bae,_0x3ecdce){return function(_0x1c5572){if(_0x1c5572){var _0xcee7d2=typeof _0x3ecdce['offset']==='undefined'&&typeof _0x3ecdce[_0x1d34('0x19')]===_0x1d34('0x1a');var _0x41ef5f=_0x1c5572['count'];var _0x30a9eb=_0xcee7d2?0x0:_0x3ecdce[_0x1d34('0x1b')];var _0x4d6d8e=_0xcee7d2?_0x1c5572[_0x1d34('0x1c')]:_0x3ecdce['offset']+_0x3ecdce[_0x1d34('0x19')];var _0x42919a;if(_0x4d6d8e>=_0x41ef5f){_0x4d6d8e=_0x41ef5f;_0x42919a=0xc8;}else{_0x42919a=0xce;}_0x869bae[_0x1d34('0x17')](_0x42919a);return _0x869bae[_0x1d34('0x1d')]('Content-Range',_0x30a9eb+'-'+_0x4d6d8e+'/'+_0x41ef5f)[_0x1d34('0x18')](_0x1c5572);}return null;};}function patchUpdates(_0x3f21c0){return function(_0x2009a5){try{jsonpatch[_0x1d34('0x1e')](_0x2009a5,_0x3f21c0,!![]);}catch(_0x155593){return BPromise[_0x1d34('0x1f')](_0x155593);}return _0x2009a5['save']();};}function saveUpdates(_0x345996,_0x3afe18){return function(_0x291778){if(_0x291778){return _0x291778[_0x1d34('0x20')](_0x345996)['then'](function(_0x5b270a){return _0x5b270a;});}return null;};}function removeEntity(_0x52aa0a,_0x12aab2){return function(_0x25733b){if(_0x25733b){return _0x25733b[_0x1d34('0x21')]()[_0x1d34('0x22')](function(){_0x52aa0a['status'](0xcc)[_0x1d34('0x16')]();});}};}function handleEntityNotFound(_0x5d4fab,_0x2c3408){return function(_0x59cde5){if(!_0x59cde5){_0x5d4fab[_0x1d34('0x15')](0x194);}return _0x59cde5;};}function handleError(_0x34682c,_0x256049){_0x256049=_0x256049||0x1f4;return function(_0x536a67){logger[_0x1d34('0x23')](_0x536a67['stack']);if(_0x536a67[_0x1d34('0x24')]){delete _0x536a67['name'];}_0x34682c['status'](_0x256049)[_0x1d34('0x25')](_0x536a67);};}exports[_0x1d34('0x26')]=function(_0x2f7735,_0x444ab1){var _0x4ce384={},_0xc01e73={},_0x5a47bc={'count':0x0,'rows':[]};var _0x20f7e1=_[_0x1d34('0x27')](db[_0x1d34('0x28')][_0x1d34('0x29')],function(_0x22f11f){return{'name':_0x22f11f[_0x1d34('0x2a')],'type':_0x22f11f[_0x1d34('0x2b')]['key']};});_0xc01e73[_0x1d34('0x2c')]=_['map'](_0x20f7e1,_0x1d34('0x24'));_0xc01e73[_0x1d34('0x2d')]=_['keys'](_0x2f7735[_0x1d34('0x2d')]);_0xc01e73[_0x1d34('0x2e')]=_[_0x1d34('0x2f')](_0xc01e73[_0x1d34('0x2c')],_0xc01e73[_0x1d34('0x2d')]);_0x4ce384[_0x1d34('0x30')]=_[_0x1d34('0x2f')](_0xc01e73['model'],qs['fields'](_0x2f7735['query'][_0x1d34('0x31')]));_0x4ce384[_0x1d34('0x30')]=_0x4ce384['attributes'][_0x1d34('0x32')]?_0x4ce384[_0x1d34('0x30')]:_0xc01e73[_0x1d34('0x2c')];if(!_0x2f7735['query'][_0x1d34('0x33')](_0x1d34('0x34'))){_0x4ce384[_0x1d34('0x19')]=qs['limit'](_0x2f7735[_0x1d34('0x2d')]['limit']);_0x4ce384['offset']=qs[_0x1d34('0x1b')](_0x2f7735['query'][_0x1d34('0x1b')]);}_0x4ce384[_0x1d34('0x35')]=qs[_0x1d34('0x36')](_0x2f7735[_0x1d34('0x2d')]['sort']);_0x4ce384[_0x1d34('0x37')]=qs[_0x1d34('0x2e')](_[_0x1d34('0x38')](_0x2f7735[_0x1d34('0x2d')],_0xc01e73[_0x1d34('0x2e')]),_0x20f7e1);if(_0x2f7735['query']['filter']){_0x4ce384['where']=_[_0x1d34('0x39')](_0x4ce384['where'],{'$or':_[_0x1d34('0x27')](_0x20f7e1,function(_0x50dccc){if(_0x50dccc[_0x1d34('0x2b')]!==_0x1d34('0x3a')){var _0xc74d34={};_0xc74d34[_0x50dccc[_0x1d34('0x24')]]={'$like':'%'+_0x2f7735['query'][_0x1d34('0x3b')]+'%'};return _0xc74d34;}})});}_0x4ce384=_[_0x1d34('0x39')]({},_0x4ce384,_0x2f7735[_0x1d34('0x3c')]);var _0x30dcdc={'where':_0x4ce384['where']};return db[_0x1d34('0x28')][_0x1d34('0x1c')](_0x30dcdc)[_0x1d34('0x22')](function(_0x216e9a){_0x5a47bc['count']=_0x216e9a;if(_0x2f7735['query'][_0x1d34('0x3d')]){_0x4ce384[_0x1d34('0x3e')]=[{'all':!![]}];}return db[_0x1d34('0x28')][_0x1d34('0x3f')](_0x4ce384);})[_0x1d34('0x22')](function(_0x504ce5){_0x5a47bc[_0x1d34('0x40')]=_0x504ce5;return _0x5a47bc;})[_0x1d34('0x22')](respondWithFilteredResult(_0x444ab1,_0x4ce384))['catch'](handleError(_0x444ab1,null));};exports[_0x1d34('0x41')]=function(_0x47256f,_0xe5573b){var _0x3463f9={'raw':!![],'where':{'id':_0x47256f[_0x1d34('0x42')]['id']}},_0x108127={};_0x108127[_0x1d34('0x2c')]=_['keys'](db['SquareReport']['rawAttributes']);_0x108127[_0x1d34('0x2d')]=_[_0x1d34('0x43')](_0x47256f['query']);_0x108127[_0x1d34('0x2e')]=_[_0x1d34('0x2f')](_0x108127[_0x1d34('0x2c')],_0x108127[_0x1d34('0x2d')]);_0x3463f9[_0x1d34('0x30')]=_[_0x1d34('0x2f')](_0x108127[_0x1d34('0x2c')],qs[_0x1d34('0x31')](_0x47256f['query']['fields']));_0x3463f9[_0x1d34('0x30')]=_0x3463f9['attributes'][_0x1d34('0x32')]?_0x3463f9[_0x1d34('0x30')]:_0x108127[_0x1d34('0x2c')];if(_0x47256f[_0x1d34('0x2d')][_0x1d34('0x3d')]){_0x3463f9[_0x1d34('0x3e')]=[{'all':!![]}];}_0x3463f9=_[_0x1d34('0x39')]({},_0x3463f9,_0x47256f[_0x1d34('0x3c')]);return db[_0x1d34('0x28')][_0x1d34('0x44')](_0x3463f9)[_0x1d34('0x22')](handleEntityNotFound(_0xe5573b,null))[_0x1d34('0x22')](respondWithResult(_0xe5573b,null))[_0x1d34('0x45')](handleError(_0xe5573b,null));};exports[_0x1d34('0x46')]=function(_0x5d180c,_0x5d83b9){return db[_0x1d34('0x28')]['create'](_0x5d180c[_0x1d34('0x47')],{})[_0x1d34('0x22')](respondWithResult(_0x5d83b9,0xc9))[_0x1d34('0x45')](handleError(_0x5d83b9,null));};exports[_0x1d34('0x20')]=function(_0x3b7fd6,_0x2264cb){if(_0x3b7fd6['body']['id']){delete _0x3b7fd6[_0x1d34('0x47')]['id'];}return db[_0x1d34('0x28')][_0x1d34('0x44')]({'where':{'id':_0x3b7fd6[_0x1d34('0x42')]['id']}})[_0x1d34('0x22')](handleEntityNotFound(_0x2264cb,null))['then'](saveUpdates(_0x3b7fd6['body'],null))[_0x1d34('0x22')](respondWithResult(_0x2264cb,null))[_0x1d34('0x45')](handleError(_0x2264cb,null));};exports[_0x1d34('0x21')]=function(_0x3e549f,_0x54bc88){return db['SquareReport'][_0x1d34('0x44')]({'where':{'id':_0x3e549f[_0x1d34('0x42')]['id']}})[_0x1d34('0x22')](handleEntityNotFound(_0x54bc88,null))['then'](removeEntity(_0x54bc88,null))[_0x1d34('0x45')](handleError(_0x54bc88,null));};exports[_0x1d34('0x48')]=function(_0x3b948c,_0x21eee8){return db[_0x1d34('0x28')]['describe']()[_0x1d34('0x22')](respondWithResult(_0x21eee8,null))[_0x1d34('0x45')](handleError(_0x21eee8,null));};
\ No newline at end of file
+var _0x26b6=['ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','map','SquareReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','rawAttributes','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x26b6,0x1b8));var _0x626b=function(_0x2b7bf9,_0x10af10){_0x2b7bf9=_0x2b7bf9-0x0;var _0x5c013e=_0x26b6[_0x2b7bf9];return _0x5c013e;};'use strict';var emlformat=require(_0x626b('0x0'));var rimraf=require(_0x626b('0x1'));var zipdir=require(_0x626b('0x2'));var jsonpatch=require(_0x626b('0x3'));var rp=require('request-promise');var moment=require(_0x626b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x626b('0x5'));var util=require(_0x626b('0x6'));var path=require(_0x626b('0x7'));var sox=require(_0x626b('0x8'));var csv=require(_0x626b('0x9'));var ejs=require(_0x626b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x626b('0xb'));var squel=require(_0x626b('0xc'));var crypto=require('crypto');var jsforce=require(_0x626b('0xd'));var deskjs=require(_0x626b('0xe'));var toCsv=require(_0x626b('0x9'));var querystring=require(_0x626b('0xf'));var Papa=require(_0x626b('0x10'));var Redis=require(_0x626b('0x11'));var authService=require(_0x626b('0x12'));var qs=require(_0x626b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x626b('0x14'))(_0x626b('0x15'));var utils=require(_0x626b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x626b('0x17'));var db=require(_0x626b('0x18'))['db'];function respondWithStatusCode(_0x394bbe,_0x50951c){_0x50951c=_0x50951c||0xcc;return function(_0x1be285){if(_0x1be285){return _0x394bbe['sendStatus'](_0x50951c);}return _0x394bbe[_0x626b('0x19')](_0x50951c)[_0x626b('0x1a')]();};}function respondWithResult(_0x1a4884,_0x4d37b8){_0x4d37b8=_0x4d37b8||0xc8;return function(_0x276788){if(_0x276788){return _0x1a4884[_0x626b('0x19')](_0x4d37b8)['json'](_0x276788);}};}function respondWithFilteredResult(_0x21840d,_0x40fec0){return function(_0x422c0b){if(_0x422c0b){var _0x33b6fd=typeof _0x40fec0[_0x626b('0x1b')]===_0x626b('0x1c')&&typeof _0x40fec0[_0x626b('0x1d')]===_0x626b('0x1c');var _0x3d286d=_0x422c0b[_0x626b('0x1e')];var _0x147d8f=_0x33b6fd?0x0:_0x40fec0[_0x626b('0x1b')];var _0x2f33fd=_0x33b6fd?_0x422c0b[_0x626b('0x1e')]:_0x40fec0[_0x626b('0x1b')]+_0x40fec0[_0x626b('0x1d')];var _0xe11930;if(_0x2f33fd>=_0x3d286d){_0x2f33fd=_0x3d286d;_0xe11930=0xc8;}else{_0xe11930=0xce;}_0x21840d[_0x626b('0x19')](_0xe11930);return _0x21840d['set']('Content-Range',_0x147d8f+'-'+_0x2f33fd+'/'+_0x3d286d)[_0x626b('0x1f')](_0x422c0b);}return null;};}function patchUpdates(_0x5306de){return function(_0x58d0bd){try{jsonpatch[_0x626b('0x20')](_0x58d0bd,_0x5306de,!![]);}catch(_0x11cc2f){return BPromise[_0x626b('0x21')](_0x11cc2f);}return _0x58d0bd[_0x626b('0x22')]();};}function saveUpdates(_0x54c499,_0x16289a){return function(_0x17ce76){if(_0x17ce76){return _0x17ce76[_0x626b('0x23')](_0x54c499)[_0x626b('0x24')](function(_0x41ff1f){return _0x41ff1f;});}return null;};}function removeEntity(_0x491931,_0x55fc73){return function(_0x5ea14a){if(_0x5ea14a){return _0x5ea14a[_0x626b('0x25')]()['then'](function(){_0x491931[_0x626b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc92990,_0x4a4d75){return function(_0x3f3360){if(!_0x3f3360){_0xc92990[_0x626b('0x26')](0x194);}return _0x3f3360;};}function handleError(_0x291b55,_0x3adbbd){_0x3adbbd=_0x3adbbd||0x1f4;return function(_0x12e877){logger[_0x626b('0x27')](_0x12e877[_0x626b('0x28')]);if(_0x12e877['name']){delete _0x12e877[_0x626b('0x29')];}_0x291b55[_0x626b('0x19')](_0x3adbbd)['send'](_0x12e877);};}exports['index']=function(_0x4c8609,_0x521eeb){var _0x4e447d={},_0x485aa2={},_0x586f0f={'count':0x0,'rows':[]};var _0x57f5a2=_[_0x626b('0x2a')](db[_0x626b('0x2b')]['rawAttributes'],function(_0x4dbb73){return{'name':_0x4dbb73[_0x626b('0x2c')],'type':_0x4dbb73[_0x626b('0x2d')][_0x626b('0x2e')]};});_0x485aa2[_0x626b('0x2f')]=_[_0x626b('0x2a')](_0x57f5a2,_0x626b('0x29'));_0x485aa2['query']=_['keys'](_0x4c8609[_0x626b('0x30')]);_0x485aa2[_0x626b('0x31')]=_[_0x626b('0x32')](_0x485aa2[_0x626b('0x2f')],_0x485aa2['query']);_0x4e447d[_0x626b('0x33')]=_[_0x626b('0x32')](_0x485aa2[_0x626b('0x2f')],qs[_0x626b('0x34')](_0x4c8609[_0x626b('0x30')][_0x626b('0x34')]));_0x4e447d['attributes']=_0x4e447d[_0x626b('0x33')][_0x626b('0x35')]?_0x4e447d[_0x626b('0x33')]:_0x485aa2[_0x626b('0x2f')];if(!_0x4c8609[_0x626b('0x30')]['hasOwnProperty'](_0x626b('0x36'))){_0x4e447d['limit']=qs[_0x626b('0x1d')](_0x4c8609[_0x626b('0x30')][_0x626b('0x1d')]);_0x4e447d[_0x626b('0x1b')]=qs['offset'](_0x4c8609[_0x626b('0x30')][_0x626b('0x1b')]);}_0x4e447d[_0x626b('0x37')]=qs[_0x626b('0x38')](_0x4c8609[_0x626b('0x30')][_0x626b('0x38')]);_0x4e447d[_0x626b('0x39')]=qs[_0x626b('0x31')](_[_0x626b('0x3a')](_0x4c8609[_0x626b('0x30')],_0x485aa2[_0x626b('0x31')]),_0x57f5a2);if(_0x4c8609[_0x626b('0x30')][_0x626b('0x3b')]){_0x4e447d[_0x626b('0x39')]=_[_0x626b('0x3c')](_0x4e447d[_0x626b('0x39')],{'$or':_['map'](_0x57f5a2,function(_0x3b4b3d){if(_0x3b4b3d[_0x626b('0x2d')]!==_0x626b('0x3d')){var _0x4ad964={};_0x4ad964[_0x3b4b3d[_0x626b('0x29')]]={'$like':'%'+_0x4c8609[_0x626b('0x30')]['filter']+'%'};return _0x4ad964;}})});}_0x4e447d=_[_0x626b('0x3c')]({},_0x4e447d,_0x4c8609['options']);var _0x406947={'where':_0x4e447d[_0x626b('0x39')]};return db[_0x626b('0x2b')]['count'](_0x406947)['then'](function(_0x50d6f0){_0x586f0f[_0x626b('0x1e')]=_0x50d6f0;if(_0x4c8609[_0x626b('0x30')][_0x626b('0x3e')]){_0x4e447d[_0x626b('0x3f')]=[{'all':!![]}];}return db[_0x626b('0x2b')][_0x626b('0x40')](_0x4e447d);})[_0x626b('0x24')](function(_0x5a87c5){_0x586f0f[_0x626b('0x41')]=_0x5a87c5;return _0x586f0f;})[_0x626b('0x24')](respondWithFilteredResult(_0x521eeb,_0x4e447d))['catch'](handleError(_0x521eeb,null));};exports[_0x626b('0x42')]=function(_0x43a528,_0x5382b1){var _0x484790={'raw':!![],'where':{'id':_0x43a528[_0x626b('0x43')]['id']}},_0x122077={};_0x122077['model']=_[_0x626b('0x44')](db[_0x626b('0x2b')][_0x626b('0x45')]);_0x122077[_0x626b('0x30')]=_['keys'](_0x43a528[_0x626b('0x30')]);_0x122077['filters']=_['intersection'](_0x122077[_0x626b('0x2f')],_0x122077[_0x626b('0x30')]);_0x484790['attributes']=_[_0x626b('0x32')](_0x122077[_0x626b('0x2f')],qs[_0x626b('0x34')](_0x43a528[_0x626b('0x30')][_0x626b('0x34')]));_0x484790[_0x626b('0x33')]=_0x484790['attributes'][_0x626b('0x35')]?_0x484790[_0x626b('0x33')]:_0x122077[_0x626b('0x2f')];if(_0x43a528[_0x626b('0x30')][_0x626b('0x3e')]){_0x484790[_0x626b('0x3f')]=[{'all':!![]}];}_0x484790=_['merge']({},_0x484790,_0x43a528['options']);return db[_0x626b('0x2b')]['find'](_0x484790)[_0x626b('0x24')](handleEntityNotFound(_0x5382b1,null))[_0x626b('0x24')](respondWithResult(_0x5382b1,null))[_0x626b('0x46')](handleError(_0x5382b1,null));};exports[_0x626b('0x47')]=function(_0x36c958,_0x4360c3){return db[_0x626b('0x2b')]['create'](_0x36c958[_0x626b('0x48')],{})[_0x626b('0x24')](respondWithResult(_0x4360c3,0xc9))[_0x626b('0x46')](handleError(_0x4360c3,null));};exports[_0x626b('0x23')]=function(_0x1f9dca,_0x5d4ef4){if(_0x1f9dca[_0x626b('0x48')]['id']){delete _0x1f9dca[_0x626b('0x48')]['id'];}return db[_0x626b('0x2b')][_0x626b('0x49')]({'where':{'id':_0x1f9dca[_0x626b('0x43')]['id']}})[_0x626b('0x24')](handleEntityNotFound(_0x5d4ef4,null))['then'](saveUpdates(_0x1f9dca['body'],null))[_0x626b('0x24')](respondWithResult(_0x5d4ef4,null))[_0x626b('0x46')](handleError(_0x5d4ef4,null));};exports['destroy']=function(_0x19dbeb,_0x30c1ac){return db[_0x626b('0x2b')][_0x626b('0x49')]({'where':{'id':_0x19dbeb[_0x626b('0x43')]['id']}})[_0x626b('0x24')](handleEntityNotFound(_0x30c1ac,null))[_0x626b('0x24')](removeEntity(_0x30c1ac,null))['catch'](handleError(_0x30c1ac,null));};exports[_0x626b('0x4a')]=function(_0x120826,_0x3a23f5){return db['SquareReport']['describe']()['then'](respondWithResult(_0x3a23f5,null))[_0x626b('0x46')](handleError(_0x3a23f5,null));};
\ No newline at end of file
index 2bdb40e..251ca09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x227d=['project_name','leaveAt','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','SquareReport','report_square','uid_pname','uniqueid'];(function(_0x27d6b0,_0x5282ce){var _0x106e02=function(_0x3168a8){while(--_0x3168a8){_0x27d6b0['push'](_0x27d6b0['shift']());}};_0x106e02(++_0x5282ce);}(_0x227d,0x197));var _0xd227=function(_0x2706da,_0x3856f5){_0x2706da=_0x2706da-0x0;var _0x3ba87e=_0x227d[_0x2706da];return _0x3ba87e;};'use strict';var _=require('lodash');var util=require(_0xd227('0x0'));var logger=require(_0xd227('0x1'))(_0xd227('0x2'));var moment=require(_0xd227('0x3'));var BPromise=require(_0xd227('0x4'));var rp=require(_0xd227('0x5'));var fs=require('fs');var path=require(_0xd227('0x6'));var rimraf=require('rimraf');var config=require(_0xd227('0x7'));var attributes=require('./squareReport.attributes');module[_0xd227('0x8')]=function(_0x28fa5b,_0x1fdc45){return _0x28fa5b['define'](_0xd227('0x9'),attributes,{'tableName':_0xd227('0xa'),'paranoid':![],'indexes':[{'name':_0xd227('0xb'),'fields':[_0xd227('0xc'),_0xd227('0xd')]},{'name':_0xd227('0xe'),'fields':[_0xd227('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x169a=['api','bluebird','path','rimraf','../../config/environment','exports','define','SquareReport','report_square','uniqueid','leaveAt','lodash','../../config/logger'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x169a,0x15d));var _0xa169=function(_0x4eee1f,_0x226038){_0x4eee1f=_0x4eee1f-0x0;var _0x4110b8=_0x169a[_0x4eee1f];return _0x4110b8;};'use strict';var _=require(_0xa169('0x0'));var util=require('util');var logger=require(_0xa169('0x1'))(_0xa169('0x2'));var moment=require('moment');var BPromise=require(_0xa169('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa169('0x4'));var rimraf=require(_0xa169('0x5'));var config=require(_0xa169('0x6'));var attributes=require('./squareReport.attributes');module[_0xa169('0x7')]=function(_0x89c8f3,_0x4f4584){return _0x89c8f3[_0xa169('0x8')](_0xa169('0x9'),attributes,{'tableName':_0xa169('0xa'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xa169('0xb'),'project_name']},{'name':'leaveAt','fields':[_0xa169('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index a4332eb..8702694 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5b6=['attributes','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','then','info','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateSquareReport','create','body','options','raw','catch','UpdateSquareReport','update','where'];(function(_0xbd5098,_0x2089a1){var _0x5b3022=function(_0x2f0dcc){while(--_0x2f0dcc){_0xbd5098['push'](_0xbd5098['shift']());}};_0x5b3022(++_0x2089a1);}(_0xf5b6,0xe9));var _0x6f5b=function(_0x2b8abd,_0xa1d67a){_0x2b8abd=_0x2b8abd-0x0;var _0x3b7614=_0xf5b6[_0x2b8abd];return _0x3b7614;};'use strict';var _=require('lodash');var util=require(_0x6f5b('0x0'));var moment=require(_0x6f5b('0x1'));var BPromise=require(_0x6f5b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f5b('0x3'));var db=require(_0x6f5b('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6f5b('0x5'));var config=require(_0x6f5b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6f5b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x484d40,_0x326065,_0x1105c9){return new BPromise(function(_0x56af17,_0x3f6d81){return client['request'](_0x484d40,_0x1105c9)[_0x6f5b('0x8')](function(_0x577358){logger[_0x6f5b('0x9')](_0x6f5b('0xa'),_0x326065,'request\x20sent');logger[_0x6f5b('0xb')](_0x6f5b('0xc'),_0x326065,_0x6f5b('0xd'),JSON[_0x6f5b('0xe')](_0x577358));if(_0x577358[_0x6f5b('0xf')]){if(_0x577358[_0x6f5b('0xf')][_0x6f5b('0x10')]===0x1f4){logger['error']('SquareReport,\x20%s,\x20%s',_0x326065,_0x577358[_0x6f5b('0xf')][_0x6f5b('0x11')]);return _0x3f6d81(_0x577358[_0x6f5b('0xf')][_0x6f5b('0x11')]);}logger['error'](_0x6f5b('0xa'),_0x326065,_0x577358[_0x6f5b('0xf')][_0x6f5b('0x11')]);return _0x56af17(_0x577358[_0x6f5b('0xf')][_0x6f5b('0x11')]);}else{logger[_0x6f5b('0x9')](_0x6f5b('0xa'),_0x326065,_0x6f5b('0xd'));_0x56af17(_0x577358[_0x6f5b('0x12')]['message']);}})['catch'](function(_0x5c9937){logger['error']('SquareReport,\x20%s,\x20%s',_0x326065,_0x5c9937);_0x3f6d81(_0x5c9937);});});}exports[_0x6f5b('0x13')]=function(_0x11528f){var _0x4e5932=this;return new Promise(function(_0x3e7857,_0x528911){return db['SquareReport'][_0x6f5b('0x14')](_0x11528f[_0x6f5b('0x15')],{'raw':_0x11528f[_0x6f5b('0x16')]?_0x11528f[_0x6f5b('0x16')][_0x6f5b('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4151b4){logger['info'](_0x6f5b('0x13'),_0x11528f);logger[_0x6f5b('0xb')](_0x6f5b('0x13'),_0x11528f,JSON[_0x6f5b('0xe')](_0x4151b4));_0x3e7857(_0x4151b4);})[_0x6f5b('0x18')](function(_0x4a908f){logger[_0x6f5b('0xf')](_0x6f5b('0x13'),_0x4a908f[_0x6f5b('0x11')],_0x11528f);_0x528911(_0x4e5932[_0x6f5b('0xf')](0x1f4,_0x4a908f[_0x6f5b('0x11')]));});});};exports[_0x6f5b('0x19')]=function(_0x304378){var _0x208c56=this;return new Promise(function(_0x55e29f,_0xff146b){return db['SquareReport'][_0x6f5b('0x1a')](_0x304378[_0x6f5b('0x15')],{'raw':_0x304378[_0x6f5b('0x16')]?_0x304378['options'][_0x6f5b('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x304378[_0x6f5b('0x16')]?_0x304378['options'][_0x6f5b('0x1b')]||null:null,'attributes':_0x304378['options']?_0x304378[_0x6f5b('0x16')][_0x6f5b('0x1c')]||null:null,'limit':_0x304378['options']?_0x304378[_0x6f5b('0x16')]['limit']||null:null})[_0x6f5b('0x8')](function(_0x5364a5){logger[_0x6f5b('0x9')](_0x6f5b('0x19'),_0x304378);logger[_0x6f5b('0xb')](_0x6f5b('0x19'),_0x304378,JSON[_0x6f5b('0xe')](_0x5364a5));_0x55e29f(_0x5364a5);})[_0x6f5b('0x18')](function(_0x2cef7b){logger[_0x6f5b('0xf')](_0x6f5b('0x19'),_0x2cef7b[_0x6f5b('0x11')],_0x304378);_0xff146b(_0x208c56['error'](0x1f4,_0x2cef7b[_0x6f5b('0x11')]));});});};
\ No newline at end of file
+var _0x4aad=['bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','raw','CreateSquareReport','UpdateSquareReport','SquareReport','attributes','lodash','util','moment'];(function(_0x1269c6,_0x1c8942){var _0x4868c7=function(_0x1661bc){while(--_0x1661bc){_0x1269c6['push'](_0x1269c6['shift']());}};_0x4868c7(++_0x1c8942);}(_0x4aad,0x13d));var _0xd4aa=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x4aad[_0x456fb1];return _0x4083d6;};'use strict';var _=require(_0xd4aa('0x0'));var util=require(_0xd4aa('0x1'));var moment=require(_0xd4aa('0x2'));var BPromise=require(_0xd4aa('0x3'));var rs=require(_0xd4aa('0x4'));var fs=require('fs');var Redis=require(_0xd4aa('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd4aa('0x6'))(_0xd4aa('0x7'));var config=require('../../config/environment');var jayson=require(_0xd4aa('0x8'));var client=jayson[_0xd4aa('0x9')][_0xd4aa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x320957,_0x382bde,_0xda7a75){return new BPromise(function(_0x2e615f,_0x5b68c2){return client[_0xd4aa('0xb')](_0x320957,_0xda7a75)[_0xd4aa('0xc')](function(_0x12e5a3){logger[_0xd4aa('0xd')](_0xd4aa('0xe'),_0x382bde,_0xd4aa('0xf'));logger[_0xd4aa('0x10')](_0xd4aa('0x11'),_0x382bde,_0xd4aa('0xf'),JSON[_0xd4aa('0x12')](_0x12e5a3));if(_0x12e5a3[_0xd4aa('0x13')]){if(_0x12e5a3[_0xd4aa('0x13')][_0xd4aa('0x14')]===0x1f4){logger['error'](_0xd4aa('0xe'),_0x382bde,_0x12e5a3[_0xd4aa('0x13')][_0xd4aa('0x15')]);return _0x5b68c2(_0x12e5a3[_0xd4aa('0x13')][_0xd4aa('0x15')]);}logger[_0xd4aa('0x13')](_0xd4aa('0xe'),_0x382bde,_0x12e5a3['error'][_0xd4aa('0x15')]);return _0x2e615f(_0x12e5a3['error'][_0xd4aa('0x15')]);}else{logger[_0xd4aa('0xd')](_0xd4aa('0xe'),_0x382bde,_0xd4aa('0xf'));_0x2e615f(_0x12e5a3[_0xd4aa('0x16')]['message']);}})[_0xd4aa('0x17')](function(_0xef6499){logger[_0xd4aa('0x13')](_0xd4aa('0xe'),_0x382bde,_0xef6499);_0x5b68c2(_0xef6499);});});}exports['CreateSquareReport']=function(_0x579558){var _0x31f993=this;return new Promise(function(_0x2ef030,_0x4afda5){return db['SquareReport'][_0xd4aa('0x18')](_0x579558[_0xd4aa('0x19')],{'raw':_0x579558[_0xd4aa('0x1a')]?_0x579558[_0xd4aa('0x1a')][_0xd4aa('0x1b')]===undefined?!![]:![]:!![]})[_0xd4aa('0xc')](function(_0x5c5723){logger[_0xd4aa('0xd')]('CreateSquareReport',_0x579558);logger[_0xd4aa('0x10')](_0xd4aa('0x1c'),_0x579558,JSON[_0xd4aa('0x12')](_0x5c5723));_0x2ef030(_0x5c5723);})[_0xd4aa('0x17')](function(_0x3b1a7f){logger[_0xd4aa('0x13')]('CreateSquareReport',_0x3b1a7f[_0xd4aa('0x15')],_0x579558);_0x4afda5(_0x31f993['error'](0x1f4,_0x3b1a7f[_0xd4aa('0x15')]));});});};exports[_0xd4aa('0x1d')]=function(_0x2785c0){var _0x21a84e=this;return new Promise(function(_0x5441b1,_0x40736f){return db[_0xd4aa('0x1e')]['update'](_0x2785c0[_0xd4aa('0x19')],{'raw':_0x2785c0[_0xd4aa('0x1a')]?_0x2785c0[_0xd4aa('0x1a')][_0xd4aa('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2785c0[_0xd4aa('0x1a')]?_0x2785c0[_0xd4aa('0x1a')]['where']||null:null,'attributes':_0x2785c0[_0xd4aa('0x1a')]?_0x2785c0['options'][_0xd4aa('0x1f')]||null:null,'limit':_0x2785c0[_0xd4aa('0x1a')]?_0x2785c0['options']['limit']||null:null})[_0xd4aa('0xc')](function(_0x51aadf){logger[_0xd4aa('0xd')](_0xd4aa('0x1d'),_0x2785c0);logger[_0xd4aa('0x10')](_0xd4aa('0x1d'),_0x2785c0,JSON[_0xd4aa('0x12')](_0x51aadf));_0x5441b1(_0x51aadf);})['catch'](function(_0xe06d6c){logger[_0xd4aa('0x13')](_0xd4aa('0x1d'),_0xe06d6c[_0xd4aa('0x15')],_0x2785c0);_0x40736f(_0x21a84e['error'](0x1f4,_0xe06d6c[_0xd4aa('0x15')]));});});};
\ No newline at end of file
index 9b4e3f4..0e18cc6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x522c=['destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update','delete'];(function(_0x2ce6ef,_0x285ae9){var _0x3cdc3e=function(_0x33ed0c){while(--_0x33ed0c){_0x2ce6ef['push'](_0x2ce6ef['shift']());}};_0x3cdc3e(++_0x285ae9);}(_0x522c,0xf2));var _0xc522=function(_0x485070,_0x590440){_0x485070=_0x485070-0x0;var _0x1d8090=_0x522c[_0x485070];return _0x1d8090;};'use strict';var multer=require(_0xc522('0x0'));var util=require('util');var path=require(_0xc522('0x1'));var timeout=require(_0xc522('0x2'));var express=require(_0xc522('0x3'));var router=express['Router']();var fs_extra=require(_0xc522('0x4'));var auth=require(_0xc522('0x5'));var interaction=require(_0xc522('0x6'));var config=require('../../config/environment');var controller=require(_0xc522('0x7'));router[_0xc522('0x8')]('/',auth[_0xc522('0x9')](),controller[_0xc522('0xa')]);router[_0xc522('0x8')](_0xc522('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xc522('0xc'),auth[_0xc522('0x9')](),controller[_0xc522('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc522('0xe')]);router[_0xc522('0xf')]('/:id',auth[_0xc522('0x9')](),controller[_0xc522('0x10')]);router[_0xc522('0x11')](_0xc522('0xc'),auth['isAuthenticated'](),controller[_0xc522('0x12')]);module[_0xc522('0x13')]=router;
\ No newline at end of file
+var _0x7a88=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7a88,0x78));var _0x87a8=function(_0x568ae7,_0x2b5fa3){_0x568ae7=_0x568ae7-0x0;var _0x257050=_0x7a88[_0x568ae7];return _0x257050;};'use strict';var multer=require(_0x87a8('0x0'));var util=require(_0x87a8('0x1'));var path=require('path');var timeout=require(_0x87a8('0x2'));var express=require(_0x87a8('0x3'));var router=express[_0x87a8('0x4')]();var fs_extra=require(_0x87a8('0x5'));var auth=require(_0x87a8('0x6'));var interaction=require(_0x87a8('0x7'));var config=require(_0x87a8('0x8'));var controller=require('./squareReportDetail.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x87a8('0x9')](_0x87a8('0xa'),auth[_0x87a8('0xb')](),controller[_0x87a8('0xc')]);router[_0x87a8('0x9')](_0x87a8('0xd'),auth['isAuthenticated'](),controller[_0x87a8('0xe')]);router[_0x87a8('0xf')]('/',auth[_0x87a8('0xb')](),controller[_0x87a8('0x10')]);router[_0x87a8('0x11')](_0x87a8('0xd'),auth[_0x87a8('0xb')](),controller[_0x87a8('0x12')]);router['delete'](_0x87a8('0xd'),auth['isAuthenticated'](),controller[_0x87a8('0x13')]);module[_0x87a8('0x14')]=router;
\ No newline at end of file
index c290fb8..37133cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9270=['sequelize','exports','STRING','TEXT'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x9270,0xdc));var _0x0927=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9270[_0x5608a3];return _0x1ed50a;};'use strict';var Sequelize=require(_0x0927('0x0'));module[_0x0927('0x1')]={'uniqueid':{'type':Sequelize[_0x0927('0x2')]},'node':{'type':Sequelize[_0x0927('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x0927('0x3')]},'project_name':{'type':Sequelize[_0x0927('0x2')]},'callerid':{'type':Sequelize[_0x0927('0x2')]}};
\ No newline at end of file
+var _0x6f21=['STRING','TEXT'];(function(_0x166174,_0x47d771){var _0x3899b3=function(_0x1f2b61){while(--_0x1f2b61){_0x166174['push'](_0x166174['shift']());}};_0x3899b3(++_0x47d771);}(_0x6f21,0x1da));var _0x16f2=function(_0xcc4dd6,_0x992b80){_0xcc4dd6=_0xcc4dd6-0x0;var _0x67f2bc=_0x6f21[_0xcc4dd6];return _0x67f2bc;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x16f2('0x0')]},'node':{'type':Sequelize[_0x16f2('0x0')]},'application':{'type':Sequelize[_0x16f2('0x0')]},'data':{'type':Sequelize[_0x16f2('0x1')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']}};
\ No newline at end of file
index bc6f869..2113bc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc8c=['sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','end','stack','name','index','map','SquareDetailsReport','key','query','keys','filters','intersection','model','attributes','length','order','sort','where','filter','VIRTUAL','merge','options','rows','catch','show','params','rawAttributes','fields','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path'];(function(_0x1d5f83,_0x3c8996){var _0x4a0d77=function(_0x2b3363){while(--_0x2b3363){_0x1d5f83['push'](_0x1d5f83['shift']());}};_0x4a0d77(++_0x3c8996);}(_0xdc8c,0x114));var _0xcdc8=function(_0x2cdfc4,_0x4b90b0){_0x2cdfc4=_0x2cdfc4-0x0;var _0xaa3ef0=_0xdc8c[_0x2cdfc4];return _0xaa3ef0;};'use strict';var emlformat=require(_0xcdc8('0x0'));var rimraf=require(_0xcdc8('0x1'));var zipdir=require(_0xcdc8('0x2'));var jsonpatch=require(_0xcdc8('0x3'));var rp=require('request-promise');var moment=require(_0xcdc8('0x4'));var BPromise=require(_0xcdc8('0x5'));var Mustache=require('mustache');var util=require(_0xcdc8('0x6'));var path=require(_0xcdc8('0x7'));var sox=require(_0xcdc8('0x8'));var csv=require(_0xcdc8('0x9'));var ejs=require(_0xcdc8('0xa'));var fs=require('fs');var fs_extra=require(_0xcdc8('0xb'));var _=require(_0xcdc8('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcdc8('0xd'));var deskjs=require(_0xcdc8('0xe'));var toCsv=require(_0xcdc8('0x9'));var querystring=require(_0xcdc8('0xf'));var Papa=require(_0xcdc8('0x10'));var Redis=require(_0xcdc8('0x11'));var authService=require(_0xcdc8('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xcdc8('0x13'));var hardwareService=require(_0xcdc8('0x14'));var logger=require(_0xcdc8('0x15'))(_0xcdc8('0x16'));var utils=require(_0xcdc8('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xcdc8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32770c,_0x7a1a51){_0x7a1a51=_0x7a1a51||0xcc;return function(_0x2eb88a){if(_0x2eb88a){return _0x32770c[_0xcdc8('0x19')](_0x7a1a51);}return _0x32770c[_0xcdc8('0x1a')](_0x7a1a51)['end']();};}function respondWithResult(_0x372d94,_0x2c6c56){_0x2c6c56=_0x2c6c56||0xc8;return function(_0x6a77bf){if(_0x6a77bf){return _0x372d94[_0xcdc8('0x1a')](_0x2c6c56)[_0xcdc8('0x1b')](_0x6a77bf);}};}function respondWithFilteredResult(_0x500c1d,_0x4442f4){return function(_0x54d8c5){if(_0x54d8c5){var _0x4e0eb0=typeof _0x4442f4[_0xcdc8('0x1c')]===_0xcdc8('0x1d')&&typeof _0x4442f4[_0xcdc8('0x1e')]==='undefined';var _0x16dfba=_0x54d8c5[_0xcdc8('0x1f')];var _0x38283a=_0x4e0eb0?0x0:_0x4442f4['offset'];var _0xf26784=_0x4e0eb0?_0x54d8c5['count']:_0x4442f4[_0xcdc8('0x1c')]+_0x4442f4['limit'];var _0x2569f5;if(_0xf26784>=_0x16dfba){_0xf26784=_0x16dfba;_0x2569f5=0xc8;}else{_0x2569f5=0xce;}_0x500c1d[_0xcdc8('0x1a')](_0x2569f5);return _0x500c1d['set'](_0xcdc8('0x20'),_0x38283a+'-'+_0xf26784+'/'+_0x16dfba)[_0xcdc8('0x1b')](_0x54d8c5);}return null;};}function patchUpdates(_0x2510e3){return function(_0x5f5a51){try{jsonpatch[_0xcdc8('0x21')](_0x5f5a51,_0x2510e3,!![]);}catch(_0x744fd9){return BPromise[_0xcdc8('0x22')](_0x744fd9);}return _0x5f5a51[_0xcdc8('0x23')]();};}function saveUpdates(_0x5a9393,_0x5197c7){return function(_0x16129e){if(_0x16129e){return _0x16129e[_0xcdc8('0x24')](_0x5a9393)['then'](function(_0x3fc6e2){return _0x3fc6e2;});}return null;};}function removeEntity(_0x57915f,_0x1cb936){return function(_0x1d6285){if(_0x1d6285){return _0x1d6285[_0xcdc8('0x25')]()[_0xcdc8('0x26')](function(){_0x57915f['status'](0xcc)[_0xcdc8('0x27')]();});}};}function handleEntityNotFound(_0x189f72,_0x4a33b2){return function(_0x14f3ca){if(!_0x14f3ca){_0x189f72[_0xcdc8('0x19')](0x194);}return _0x14f3ca;};}function handleError(_0x1facc9,_0x43e8d4){_0x43e8d4=_0x43e8d4||0x1f4;return function(_0x32f522){logger['error'](_0x32f522[_0xcdc8('0x28')]);if(_0x32f522['name']){delete _0x32f522[_0xcdc8('0x29')];}_0x1facc9[_0xcdc8('0x1a')](_0x43e8d4)['send'](_0x32f522);};}exports[_0xcdc8('0x2a')]=function(_0x23635c,_0x3b2fcd){var _0x2e6ab5={},_0xf0c1b9={},_0x2bed18={'count':0x0,'rows':[]};var _0x3c5781=_[_0xcdc8('0x2b')](db[_0xcdc8('0x2c')]['rawAttributes'],function(_0x85b003){return{'name':_0x85b003['fieldName'],'type':_0x85b003['type'][_0xcdc8('0x2d')]};});_0xf0c1b9['model']=_[_0xcdc8('0x2b')](_0x3c5781,_0xcdc8('0x29'));_0xf0c1b9[_0xcdc8('0x2e')]=_[_0xcdc8('0x2f')](_0x23635c['query']);_0xf0c1b9[_0xcdc8('0x30')]=_[_0xcdc8('0x31')](_0xf0c1b9[_0xcdc8('0x32')],_0xf0c1b9['query']);_0x2e6ab5[_0xcdc8('0x33')]=_[_0xcdc8('0x31')](_0xf0c1b9[_0xcdc8('0x32')],qs['fields'](_0x23635c[_0xcdc8('0x2e')]['fields']));_0x2e6ab5['attributes']=_0x2e6ab5[_0xcdc8('0x33')][_0xcdc8('0x34')]?_0x2e6ab5[_0xcdc8('0x33')]:_0xf0c1b9[_0xcdc8('0x32')];if(!_0x23635c['query']['hasOwnProperty']('nolimit')){_0x2e6ab5[_0xcdc8('0x1e')]=qs[_0xcdc8('0x1e')](_0x23635c[_0xcdc8('0x2e')][_0xcdc8('0x1e')]);_0x2e6ab5[_0xcdc8('0x1c')]=qs[_0xcdc8('0x1c')](_0x23635c[_0xcdc8('0x2e')][_0xcdc8('0x1c')]);}_0x2e6ab5[_0xcdc8('0x35')]=qs[_0xcdc8('0x36')](_0x23635c['query']['sort']);_0x2e6ab5[_0xcdc8('0x37')]=qs[_0xcdc8('0x30')](_['pick'](_0x23635c[_0xcdc8('0x2e')],_0xf0c1b9[_0xcdc8('0x30')]),_0x3c5781);if(_0x23635c['query'][_0xcdc8('0x38')]){_0x2e6ab5[_0xcdc8('0x37')]=_['merge'](_0x2e6ab5[_0xcdc8('0x37')],{'$or':_[_0xcdc8('0x2b')](_0x3c5781,function(_0x45b3c8){if(_0x45b3c8['type']!==_0xcdc8('0x39')){var _0x176805={};_0x176805[_0x45b3c8[_0xcdc8('0x29')]]={'$like':'%'+_0x23635c[_0xcdc8('0x2e')]['filter']+'%'};return _0x176805;}})});}_0x2e6ab5=_[_0xcdc8('0x3a')]({},_0x2e6ab5,_0x23635c[_0xcdc8('0x3b')]);var _0x47d463={'where':_0x2e6ab5[_0xcdc8('0x37')]};return db[_0xcdc8('0x2c')][_0xcdc8('0x1f')](_0x47d463)['then'](function(_0x1e41b6){_0x2bed18[_0xcdc8('0x1f')]=_0x1e41b6;if(_0x23635c[_0xcdc8('0x2e')]['includeAll']){_0x2e6ab5['include']=[{'all':!![]}];}return db[_0xcdc8('0x2c')]['findAll'](_0x2e6ab5);})[_0xcdc8('0x26')](function(_0x59e59b){_0x2bed18[_0xcdc8('0x3c')]=_0x59e59b;return _0x2bed18;})[_0xcdc8('0x26')](respondWithFilteredResult(_0x3b2fcd,_0x2e6ab5))[_0xcdc8('0x3d')](handleError(_0x3b2fcd,null));};exports[_0xcdc8('0x3e')]=function(_0x4ec54e,_0x32b957){var _0x3d8be3={'raw':!![],'where':{'id':_0x4ec54e[_0xcdc8('0x3f')]['id']}},_0x55bd03={};_0x55bd03['model']=_['keys'](db['SquareDetailsReport'][_0xcdc8('0x40')]);_0x55bd03[_0xcdc8('0x2e')]=_['keys'](_0x4ec54e['query']);_0x55bd03['filters']=_[_0xcdc8('0x31')](_0x55bd03[_0xcdc8('0x32')],_0x55bd03['query']);_0x3d8be3[_0xcdc8('0x33')]=_[_0xcdc8('0x31')](_0x55bd03['model'],qs[_0xcdc8('0x41')](_0x4ec54e[_0xcdc8('0x2e')][_0xcdc8('0x41')]));_0x3d8be3['attributes']=_0x3d8be3[_0xcdc8('0x33')][_0xcdc8('0x34')]?_0x3d8be3[_0xcdc8('0x33')]:_0x55bd03[_0xcdc8('0x32')];if(_0x4ec54e[_0xcdc8('0x2e')]['includeAll']){_0x3d8be3[_0xcdc8('0x42')]=[{'all':!![]}];}_0x3d8be3=_[_0xcdc8('0x3a')]({},_0x3d8be3,_0x4ec54e['options']);return db['SquareDetailsReport'][_0xcdc8('0x43')](_0x3d8be3)['then'](handleEntityNotFound(_0x32b957,null))['then'](respondWithResult(_0x32b957,null))[_0xcdc8('0x3d')](handleError(_0x32b957,null));};exports[_0xcdc8('0x44')]=function(_0x362401,_0x57fdd8){return db[_0xcdc8('0x2c')][_0xcdc8('0x44')](_0x362401['body'],{})[_0xcdc8('0x26')](respondWithResult(_0x57fdd8,0xc9))[_0xcdc8('0x3d')](handleError(_0x57fdd8,null));};exports['update']=function(_0x1a879f,_0x56165b){if(_0x1a879f['body']['id']){delete _0x1a879f[_0xcdc8('0x45')]['id'];}return db[_0xcdc8('0x2c')][_0xcdc8('0x43')]({'where':{'id':_0x1a879f[_0xcdc8('0x3f')]['id']}})[_0xcdc8('0x26')](handleEntityNotFound(_0x56165b,null))[_0xcdc8('0x26')](saveUpdates(_0x1a879f[_0xcdc8('0x45')],null))[_0xcdc8('0x26')](respondWithResult(_0x56165b,null))[_0xcdc8('0x3d')](handleError(_0x56165b,null));};exports[_0xcdc8('0x25')]=function(_0x56d4d1,_0x17ee51){return db[_0xcdc8('0x2c')][_0xcdc8('0x43')]({'where':{'id':_0x56d4d1[_0xcdc8('0x3f')]['id']}})[_0xcdc8('0x26')](handleEntityNotFound(_0x17ee51,null))[_0xcdc8('0x26')](removeEntity(_0x17ee51,null))[_0xcdc8('0x3d')](handleError(_0x17ee51,null));};exports[_0xcdc8('0x46')]=function(_0x1a4574,_0x27f40c){return db[_0xcdc8('0x2c')]['describe']()[_0xcdc8('0x26')](respondWithResult(_0x27f40c,null))[_0xcdc8('0x3d')](handleError(_0x27f40c,null));};
\ No newline at end of file
+var _0x7335=['api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','SquareDetailsReport','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x11e866,_0x123dd2){var _0x9b1cb5=function(_0x3d3290){while(--_0x3d3290){_0x11e866['push'](_0x11e866['shift']());}};_0x9b1cb5(++_0x123dd2);}(_0x7335,0x82));var _0x5733=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x7335[_0x819464];return _0x49dcc0;};'use strict';var emlformat=require(_0x5733('0x0'));var rimraf=require(_0x5733('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5733('0x2'));var rp=require('request-promise');var moment=require(_0x5733('0x3'));var BPromise=require(_0x5733('0x4'));var Mustache=require('mustache');var util=require(_0x5733('0x5'));var path=require(_0x5733('0x6'));var sox=require(_0x5733('0x7'));var csv=require(_0x5733('0x8'));var ejs=require(_0x5733('0x9'));var fs=require('fs');var fs_extra=require(_0x5733('0xa'));var _=require(_0x5733('0xb'));var squel=require(_0x5733('0xc'));var crypto=require(_0x5733('0xd'));var jsforce=require(_0x5733('0xe'));var deskjs=require(_0x5733('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5733('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5733('0x11'));var as=require(_0x5733('0x12'));var hardwareService=require(_0x5733('0x13'));var logger=require('../../config/logger')(_0x5733('0x14'));var utils=require('../../config/utils');var config=require(_0x5733('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5733('0x16'))['db'];function respondWithStatusCode(_0x45d365,_0x2af864){_0x2af864=_0x2af864||0xcc;return function(_0x411315){if(_0x411315){return _0x45d365[_0x5733('0x17')](_0x2af864);}return _0x45d365[_0x5733('0x18')](_0x2af864)[_0x5733('0x19')]();};}function respondWithResult(_0x5b3d7a,_0x4366f9){_0x4366f9=_0x4366f9||0xc8;return function(_0x14e6b0){if(_0x14e6b0){return _0x5b3d7a[_0x5733('0x18')](_0x4366f9)[_0x5733('0x1a')](_0x14e6b0);}};}function respondWithFilteredResult(_0x13add2,_0xa5f681){return function(_0x395793){if(_0x395793){var _0x40990a=typeof _0xa5f681[_0x5733('0x1b')]===_0x5733('0x1c')&&typeof _0xa5f681[_0x5733('0x1d')]===_0x5733('0x1c');var _0x4c8d8=_0x395793[_0x5733('0x1e')];var _0x6cb88e=_0x40990a?0x0:_0xa5f681['offset'];var _0x17cfd6=_0x40990a?_0x395793['count']:_0xa5f681[_0x5733('0x1b')]+_0xa5f681[_0x5733('0x1d')];var _0x5d22a4;if(_0x17cfd6>=_0x4c8d8){_0x17cfd6=_0x4c8d8;_0x5d22a4=0xc8;}else{_0x5d22a4=0xce;}_0x13add2[_0x5733('0x18')](_0x5d22a4);return _0x13add2[_0x5733('0x1f')](_0x5733('0x20'),_0x6cb88e+'-'+_0x17cfd6+'/'+_0x4c8d8)['json'](_0x395793);}return null;};}function patchUpdates(_0x3a8ea5){return function(_0x12571b){try{jsonpatch['apply'](_0x12571b,_0x3a8ea5,!![]);}catch(_0x5857e0){return BPromise[_0x5733('0x21')](_0x5857e0);}return _0x12571b[_0x5733('0x22')]();};}function saveUpdates(_0x8e3dcb,_0x4ba6f4){return function(_0x56a2e4){if(_0x56a2e4){return _0x56a2e4[_0x5733('0x23')](_0x8e3dcb)['then'](function(_0x1d9232){return _0x1d9232;});}return null;};}function removeEntity(_0x2c6f26,_0x4c5166){return function(_0x469efb){if(_0x469efb){return _0x469efb[_0x5733('0x24')]()[_0x5733('0x25')](function(){_0x2c6f26[_0x5733('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5874f5,_0x40cd4f){return function(_0x1461e1){if(!_0x1461e1){_0x5874f5[_0x5733('0x17')](0x194);}return _0x1461e1;};}function handleError(_0x51aa6c,_0x1d9d47){_0x1d9d47=_0x1d9d47||0x1f4;return function(_0x141999){logger[_0x5733('0x26')](_0x141999[_0x5733('0x27')]);if(_0x141999[_0x5733('0x28')]){delete _0x141999[_0x5733('0x28')];}_0x51aa6c[_0x5733('0x18')](_0x1d9d47)[_0x5733('0x29')](_0x141999);};}exports['index']=function(_0x186c9d,_0x394201){var _0x581b58={},_0x4a7d21={},_0x3c7f75={'count':0x0,'rows':[]};var _0x21328c=_[_0x5733('0x2a')](db['SquareDetailsReport'][_0x5733('0x2b')],function(_0xa5bb10){return{'name':_0xa5bb10[_0x5733('0x2c')],'type':_0xa5bb10[_0x5733('0x2d')][_0x5733('0x2e')]};});_0x4a7d21[_0x5733('0x2f')]=_['map'](_0x21328c,_0x5733('0x28'));_0x4a7d21[_0x5733('0x30')]=_[_0x5733('0x31')](_0x186c9d[_0x5733('0x30')]);_0x4a7d21[_0x5733('0x32')]=_[_0x5733('0x33')](_0x4a7d21['model'],_0x4a7d21[_0x5733('0x30')]);_0x581b58[_0x5733('0x34')]=_['intersection'](_0x4a7d21['model'],qs[_0x5733('0x35')](_0x186c9d['query'][_0x5733('0x35')]));_0x581b58['attributes']=_0x581b58[_0x5733('0x34')][_0x5733('0x36')]?_0x581b58[_0x5733('0x34')]:_0x4a7d21['model'];if(!_0x186c9d[_0x5733('0x30')][_0x5733('0x37')](_0x5733('0x38'))){_0x581b58[_0x5733('0x1d')]=qs[_0x5733('0x1d')](_0x186c9d['query']['limit']);_0x581b58[_0x5733('0x1b')]=qs[_0x5733('0x1b')](_0x186c9d[_0x5733('0x30')][_0x5733('0x1b')]);}_0x581b58[_0x5733('0x39')]=qs[_0x5733('0x3a')](_0x186c9d[_0x5733('0x30')][_0x5733('0x3a')]);_0x581b58[_0x5733('0x3b')]=qs[_0x5733('0x32')](_['pick'](_0x186c9d[_0x5733('0x30')],_0x4a7d21[_0x5733('0x32')]),_0x21328c);if(_0x186c9d[_0x5733('0x30')]['filter']){_0x581b58['where']=_[_0x5733('0x3c')](_0x581b58[_0x5733('0x3b')],{'$or':_['map'](_0x21328c,function(_0x42ad85){if(_0x42ad85['type']!=='VIRTUAL'){var _0x3145a1={};_0x3145a1[_0x42ad85['name']]={'$like':'%'+_0x186c9d[_0x5733('0x30')][_0x5733('0x3d')]+'%'};return _0x3145a1;}})});}_0x581b58=_[_0x5733('0x3c')]({},_0x581b58,_0x186c9d[_0x5733('0x3e')]);var _0xa99ad6={'where':_0x581b58[_0x5733('0x3b')]};return db[_0x5733('0x3f')][_0x5733('0x1e')](_0xa99ad6)[_0x5733('0x25')](function(_0x368ece){_0x3c7f75[_0x5733('0x1e')]=_0x368ece;if(_0x186c9d['query']['includeAll']){_0x581b58[_0x5733('0x40')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x5733('0x41')](_0x581b58);})[_0x5733('0x25')](function(_0x131576){_0x3c7f75[_0x5733('0x42')]=_0x131576;return _0x3c7f75;})[_0x5733('0x25')](respondWithFilteredResult(_0x394201,_0x581b58))[_0x5733('0x43')](handleError(_0x394201,null));};exports[_0x5733('0x44')]=function(_0x4583a1,_0x3bfe96){var _0x5386dc={'raw':!![],'where':{'id':_0x4583a1[_0x5733('0x45')]['id']}},_0xd535b4={};_0xd535b4['model']=_[_0x5733('0x31')](db[_0x5733('0x3f')]['rawAttributes']);_0xd535b4[_0x5733('0x30')]=_['keys'](_0x4583a1[_0x5733('0x30')]);_0xd535b4[_0x5733('0x32')]=_['intersection'](_0xd535b4[_0x5733('0x2f')],_0xd535b4[_0x5733('0x30')]);_0x5386dc[_0x5733('0x34')]=_[_0x5733('0x33')](_0xd535b4[_0x5733('0x2f')],qs[_0x5733('0x35')](_0x4583a1[_0x5733('0x30')]['fields']));_0x5386dc['attributes']=_0x5386dc[_0x5733('0x34')][_0x5733('0x36')]?_0x5386dc[_0x5733('0x34')]:_0xd535b4[_0x5733('0x2f')];if(_0x4583a1['query'][_0x5733('0x46')]){_0x5386dc[_0x5733('0x40')]=[{'all':!![]}];}_0x5386dc=_['merge']({},_0x5386dc,_0x4583a1[_0x5733('0x3e')]);return db[_0x5733('0x3f')][_0x5733('0x47')](_0x5386dc)[_0x5733('0x25')](handleEntityNotFound(_0x3bfe96,null))[_0x5733('0x25')](respondWithResult(_0x3bfe96,null))['catch'](handleError(_0x3bfe96,null));};exports[_0x5733('0x48')]=function(_0x18cf79,_0x258310){return db[_0x5733('0x3f')][_0x5733('0x48')](_0x18cf79['body'],{})[_0x5733('0x25')](respondWithResult(_0x258310,0xc9))[_0x5733('0x43')](handleError(_0x258310,null));};exports[_0x5733('0x23')]=function(_0x1b5858,_0x1fe47e){if(_0x1b5858[_0x5733('0x49')]['id']){delete _0x1b5858[_0x5733('0x49')]['id'];}return db['SquareDetailsReport'][_0x5733('0x47')]({'where':{'id':_0x1b5858['params']['id']}})['then'](handleEntityNotFound(_0x1fe47e,null))['then'](saveUpdates(_0x1b5858[_0x5733('0x49')],null))[_0x5733('0x25')](respondWithResult(_0x1fe47e,null))[_0x5733('0x43')](handleError(_0x1fe47e,null));};exports[_0x5733('0x24')]=function(_0x2e861f,_0x2721e9){return db[_0x5733('0x3f')]['find']({'where':{'id':_0x2e861f['params']['id']}})[_0x5733('0x25')](handleEntityNotFound(_0x2721e9,null))['then'](removeEntity(_0x2721e9,null))[_0x5733('0x43')](handleError(_0x2721e9,null));};exports[_0x5733('0x4a')]=function(_0x574253,_0x3ff8c0){return db['SquareDetailsReport'][_0x5733('0x4a')]()[_0x5733('0x25')](respondWithResult(_0x3ff8c0,null))[_0x5733('0x43')](handleError(_0x3ff8c0,null));};
\ No newline at end of file
index e3743d5..bf4fdaa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe60f=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details'];(function(_0x5dfe6d,_0x232bc5){var _0x526ed6=function(_0x2d3379){while(--_0x2d3379){_0x5dfe6d['push'](_0x5dfe6d['shift']());}};_0x526ed6(++_0x232bc5);}(_0xe60f,0xe0));var _0xfe60=function(_0x596a76,_0xc6ecb8){_0x596a76=_0x596a76-0x0;var _0x1b2c47=_0xe60f[_0x596a76];return _0x1b2c47;};'use strict';var _=require('lodash');var util=require(_0xfe60('0x0'));var logger=require(_0xfe60('0x1'))(_0xfe60('0x2'));var moment=require(_0xfe60('0x3'));var BPromise=require(_0xfe60('0x4'));var rp=require(_0xfe60('0x5'));var fs=require('fs');var path=require(_0xfe60('0x6'));var rimraf=require(_0xfe60('0x7'));var config=require(_0xfe60('0x8'));var attributes=require(_0xfe60('0x9'));module[_0xfe60('0xa')]=function(_0x1cd587,_0x3cc641){return _0x1cd587[_0xfe60('0xb')](_0xfe60('0xc'),attributes,{'tableName':_0xfe60('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x01e1=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','SquareDetailsReport','report_square_details','lodash','util'];(function(_0x1caf4f,_0xd0b32d){var _0x11b9e2=function(_0xabd605){while(--_0xabd605){_0x1caf4f['push'](_0x1caf4f['shift']());}};_0x11b9e2(++_0xd0b32d);}(_0x01e1,0xcf));var _0x101e=function(_0x336fa4,_0x36fc2e){_0x336fa4=_0x336fa4-0x0;var _0x516313=_0x01e1[_0x336fa4];return _0x516313;};'use strict';var _=require(_0x101e('0x0'));var util=require(_0x101e('0x1'));var logger=require(_0x101e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x101e('0x3'));var rp=require(_0x101e('0x4'));var fs=require('fs');var path=require(_0x101e('0x5'));var rimraf=require(_0x101e('0x6'));var config=require(_0x101e('0x7'));var attributes=require('./squareReportDetail.attributes');module[_0x101e('0x8')]=function(_0x376ed0,_0x42017f){return _0x376ed0['define'](_0x101e('0x9'),attributes,{'tableName':_0x101e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3c2e6fc..a2fcdc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x263f=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','lodash','util','moment','bluebird'];(function(_0x1c4928,_0x52c743){var _0x3620e0=function(_0x42f9e7){while(--_0x42f9e7){_0x1c4928['push'](_0x1c4928['shift']());}};_0x3620e0(++_0x52c743);}(_0x263f,0x182));var _0xf263=function(_0x6949ed,_0x111f21){_0x6949ed=_0x6949ed-0x0;var _0x18065c=_0x263f[_0x6949ed];return _0x18065c;};'use strict';var _=require(_0xf263('0x0'));var util=require(_0xf263('0x1'));var moment=require(_0xf263('0x2'));var BPromise=require(_0xf263('0x3'));var rs=require(_0xf263('0x4'));var fs=require('fs');var Redis=require(_0xf263('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf263('0x6'));var logger=require(_0xf263('0x7'))(_0xf263('0x8'));var config=require('../../config/environment');var jayson=require(_0xf263('0x9'));var client=jayson[_0xf263('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fded6,_0xa2b1b0,_0x9644ab){return new BPromise(function(_0xa2e77e,_0x16ff53){return client['request'](_0x4fded6,_0x9644ab)[_0xf263('0xb')](function(_0x26504c){logger[_0xf263('0xc')](_0xf263('0xd'),_0xa2b1b0,_0xf263('0xe'));logger[_0xf263('0xf')](_0xf263('0x10'),_0xa2b1b0,'request\x20sent',JSON[_0xf263('0x11')](_0x26504c));if(_0x26504c['error']){if(_0x26504c[_0xf263('0x12')]['code']===0x1f4){logger['error'](_0xf263('0xd'),_0xa2b1b0,_0x26504c[_0xf263('0x12')][_0xf263('0x13')]);return _0x16ff53(_0x26504c[_0xf263('0x12')][_0xf263('0x13')]);}logger[_0xf263('0x12')](_0xf263('0xd'),_0xa2b1b0,_0x26504c['error'][_0xf263('0x13')]);return _0xa2e77e(_0x26504c['error'][_0xf263('0x13')]);}else{logger[_0xf263('0xc')](_0xf263('0xd'),_0xa2b1b0,_0xf263('0xe'));_0xa2e77e(_0x26504c[_0xf263('0x14')][_0xf263('0x13')]);}})[_0xf263('0x15')](function(_0x57c655){logger['error'](_0xf263('0xd'),_0xa2b1b0,_0x57c655);_0x16ff53(_0x57c655);});});}exports[_0xf263('0x16')]=function(_0x325a84){var _0x2e660e=this;return new Promise(function(_0x1ea46b,_0x56bd2d){return db[_0xf263('0x17')]['create'](_0x325a84[_0xf263('0x18')],{'raw':_0x325a84[_0xf263('0x19')]?_0x325a84[_0xf263('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xf263('0xb')](function(_0x169328){logger[_0xf263('0xc')]('CreateSquareDetailsReport',_0x325a84);logger[_0xf263('0xf')](_0xf263('0x16'),_0x325a84,JSON[_0xf263('0x11')](_0x169328));_0x1ea46b(_0x169328);})[_0xf263('0x15')](function(_0xa0695){logger[_0xf263('0x12')](_0xf263('0x16'),_0xa0695[_0xf263('0x13')],_0x325a84);_0x56bd2d(_0x2e660e[_0xf263('0x12')](0x1f4,_0xa0695[_0xf263('0x13')]));});});};
\ No newline at end of file
+var _0x9f4d=['options','CreateSquareDetailsReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareDetailsReport','create','body'];(function(_0x204d1d,_0x10f437){var _0x21431d=function(_0xcedb57){while(--_0xcedb57){_0x204d1d['push'](_0x204d1d['shift']());}};_0x21431d(++_0x10f437);}(_0x9f4d,0xb0));var _0xd9f4=function(_0x3d3fa2,_0x104433){_0x3d3fa2=_0x3d3fa2-0x0;var _0x556091=_0x9f4d[_0x3d3fa2];return _0x556091;};'use strict';var _=require(_0xd9f4('0x0'));var util=require(_0xd9f4('0x1'));var moment=require(_0xd9f4('0x2'));var BPromise=require(_0xd9f4('0x3'));var rs=require(_0xd9f4('0x4'));var fs=require('fs');var Redis=require(_0xd9f4('0x5'));var db=require(_0xd9f4('0x6'))['db'];var utils=require(_0xd9f4('0x7'));var logger=require(_0xd9f4('0x8'))('rpc');var config=require(_0xd9f4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd9f4('0xa')][_0xd9f4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cc036,_0x366b9d,_0x5cf448){return new BPromise(function(_0x6b13b5,_0x18305f){return client['request'](_0x2cc036,_0x5cf448)[_0xd9f4('0xc')](function(_0x47d52f){logger[_0xd9f4('0xd')](_0xd9f4('0xe'),_0x366b9d,_0xd9f4('0xf'));logger[_0xd9f4('0x10')](_0xd9f4('0x11'),_0x366b9d,'request\x20sent',JSON[_0xd9f4('0x12')](_0x47d52f));if(_0x47d52f[_0xd9f4('0x13')]){if(_0x47d52f[_0xd9f4('0x13')][_0xd9f4('0x14')]===0x1f4){logger[_0xd9f4('0x13')](_0xd9f4('0xe'),_0x366b9d,_0x47d52f[_0xd9f4('0x13')][_0xd9f4('0x15')]);return _0x18305f(_0x47d52f['error'][_0xd9f4('0x15')]);}logger[_0xd9f4('0x13')](_0xd9f4('0xe'),_0x366b9d,_0x47d52f[_0xd9f4('0x13')][_0xd9f4('0x15')]);return _0x6b13b5(_0x47d52f[_0xd9f4('0x13')][_0xd9f4('0x15')]);}else{logger[_0xd9f4('0xd')](_0xd9f4('0xe'),_0x366b9d,_0xd9f4('0xf'));_0x6b13b5(_0x47d52f[_0xd9f4('0x16')][_0xd9f4('0x15')]);}})[_0xd9f4('0x17')](function(_0x5e7da1){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x366b9d,_0x5e7da1);_0x18305f(_0x5e7da1);});});}exports['CreateSquareDetailsReport']=function(_0x25a7fe){var _0x2d7cb2=this;return new Promise(function(_0xc01934,_0x4a5ecf){return db[_0xd9f4('0x18')][_0xd9f4('0x19')](_0x25a7fe[_0xd9f4('0x1a')],{'raw':_0x25a7fe['options']?_0x25a7fe[_0xd9f4('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xd9f4('0xc')](function(_0x93e8df){logger[_0xd9f4('0xd')]('CreateSquareDetailsReport',_0x25a7fe);logger[_0xd9f4('0x10')](_0xd9f4('0x1c'),_0x25a7fe,JSON['stringify'](_0x93e8df));_0xc01934(_0x93e8df);})['catch'](function(_0x7196ab){logger['error'](_0xd9f4('0x1c'),_0x7196ab[_0xd9f4('0x15')],_0x25a7fe);_0x4a5ecf(_0x2d7cb2[_0xd9f4('0x13')](0x1f4,_0x7196ab[_0xd9f4('0x15')]));});});};
\ No newline at end of file
index 218a59a..48a36c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x869c=['killProcess','Router','./system.controller','index','get','/process/:pid/kill','isAuthenticated'];(function(_0x4d7a70,_0x2d3bfa){var _0x3aafbb=function(_0x43fbf2){while(--_0x43fbf2){_0x4d7a70['push'](_0x4d7a70['shift']());}};_0x3aafbb(++_0x2d3bfa);}(_0x869c,0x6a));var _0xc869=function(_0x11b664,_0x5ed6d7){_0x11b664=_0x11b664-0x0;var _0x419ea6=_0x869c[_0x11b664];return _0x419ea6;};'use strict';var express=require('express');var router=express[_0xc869('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xc869('0x1'));router['get']('/',auth['isAuthenticated'](),controller[_0xc869('0x2')]);router[_0xc869('0x3')](_0xc869('0x4'),auth[_0xc869('0x5')](),controller[_0xc869('0x6')]);module['exports']=router;
\ No newline at end of file
+var _0x6422=['isAuthenticated','index','killProcess','express','Router','../../components/auth/service','./system.controller','get'];(function(_0x422d0f,_0x5805ea){var _0x1828ce=function(_0x4aaf38){while(--_0x4aaf38){_0x422d0f['push'](_0x422d0f['shift']());}};_0x1828ce(++_0x5805ea);}(_0x6422,0x93));var _0x2642=function(_0x40020d,_0x52d424){_0x40020d=_0x40020d-0x0;var _0x52d3af=_0x6422[_0x40020d];return _0x52d3af;};'use strict';var express=require(_0x2642('0x0'));var router=express[_0x2642('0x1')]();var auth=require(_0x2642('0x2'));var controller=require(_0x2642('0x3'));router[_0x2642('0x4')]('/',auth[_0x2642('0x5')](),controller[_0x2642('0x6')]);router[_0x2642('0x4')]('/process/:pid/kill',auth[_0x2642('0x5')](),controller[_0x2642('0x7')]);module['exports']=router;
\ No newline at end of file
index 99cac39..45f0b2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ab4=['getAllData','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','SIGINT','exec','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index'];(function(_0x575c28,_0xb79fa9){var _0x46fc61=function(_0x2df376){while(--_0x2df376){_0x575c28['push'](_0x575c28['shift']());}};_0x46fc61(++_0xb79fa9);}(_0x6ab4,0x137));var _0x46ab=function(_0x1e7742,_0x258f1e){_0x1e7742=_0x1e7742-0x0;var _0x384f3e=_0x6ab4[_0x1e7742];return _0x384f3e;};'use strict';var info=require('systeminformation');var exec=require('child_process')[_0x46ab('0x0')];var logger=require(_0x46ab('0x1'))(_0x46ab('0x2'));var util=require(_0x46ab('0x3'));var BPromise=require(_0x46ab('0x4'));var _=require(_0x46ab('0x5'));function handleError(_0x4eaaa1,_0x212bb7,_0x5695d0){_0x212bb7=_0x212bb7||0x1f4;return function(_0x57ccef){logger[_0x46ab('0x6')](_0x46ab('0x7'),_0x5695d0,_0x212bb7,util[_0x46ab('0x8')](_0x57ccef,{'showHidden':![],'depth':null}));delete _0x57ccef[_0x46ab('0x9')];_0x4eaaa1[_0x46ab('0xa')](_0x212bb7)[_0x46ab('0xb')](_0x57ccef);};}exports[_0x46ab('0xc')]=function(_0x4968ea,_0x39a5ce){return info[_0x46ab('0xd')]()[_0x46ab('0xe')](function(_0x1465e3){return _0x39a5ce[_0x46ab('0xa')](0xc8)[_0x46ab('0xf')](_0x1465e3);})[_0x46ab('0x10')](function(_0x339ec9){return _0x39a5ce[_0x46ab('0xa')](0x1f4)[_0x46ab('0xf')](_0x339ec9);});};exports[_0x46ab('0x11')]=function(_0x19b64b,_0x370347){var _0x287ea7=[_0x46ab('0x12')];return new BPromise(function(_0x2cd735,_0x495c55){return exec(util[_0x46ab('0x13')](_0x46ab('0x14'),_0x19b64b[_0x46ab('0x15')]['pid']),function(_0x1c06ea,_0x335106,_0x121100){if(_0x1c06ea){return _0x495c55(_0x1c06ea);}return _0x2cd735(_0x335106);});})[_0x46ab('0xe')](function(_0x56f0a4){var _0x1f5bb4=![];var _0x2ce280=_0x56f0a4['split'](/\n/);for(var _0x35d718=0x0,_0x42c626=_0x287ea7[_0x46ab('0x16')];_0x35d718<_0x42c626,_0x1f5bb4===![];_0x35d718+=0x1){if(_0x56f0a4[_0x46ab('0x17')](_0x287ea7[_0x35d718])>=0x0){_0x1f5bb4=!![];}}if(!_0x1f5bb4){throw new Error(util[_0x46ab('0x13')](_0x46ab('0x18'),_0x19b64b['params'][_0x46ab('0x19')]));}process['kill'](_0x19b64b[_0x46ab('0x15')]['pid'],_0x46ab('0x1a'));return _0x370347['status'](0xc8)[_0x46ab('0xf')]({'message':util[_0x46ab('0x13')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x19b64b[_0x46ab('0x15')][_0x46ab('0x19')])});})[_0x46ab('0x10')](handleError(_0x370347,null,_0x46ab('0x11')));};
\ No newline at end of file
+var _0x141a=['child_process','exec','util','bluebird','error','inspect','name','status','send','index','getAllData','then','json','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x141a,0xf9));var _0xa141=function(_0xae7641,_0x36c1ab){_0xae7641=_0xae7641-0x0;var _0x208722=_0x141a[_0xae7641];return _0x208722;};'use strict';var info=require(_0xa141('0x0'));var exec=require(_0xa141('0x1'))[_0xa141('0x2')];var logger=require('../../config/logger')('api');var util=require(_0xa141('0x3'));var BPromise=require(_0xa141('0x4'));var _=require('lodash');function handleError(_0x533de0,_0x55b76d,_0x1e7dea){_0x55b76d=_0x55b76d||0x1f4;return function(_0x144a75){logger[_0xa141('0x5')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x1e7dea,_0x55b76d,util[_0xa141('0x6')](_0x144a75,{'showHidden':![],'depth':null}));delete _0x144a75[_0xa141('0x7')];_0x533de0[_0xa141('0x8')](_0x55b76d)[_0xa141('0x9')](_0x144a75);};}exports[_0xa141('0xa')]=function(_0x16ce9f,_0x4e6ce1){return info[_0xa141('0xb')]()[_0xa141('0xc')](function(_0x5a3ed2){return _0x4e6ce1[_0xa141('0x8')](0xc8)[_0xa141('0xd')](_0x5a3ed2);})['catch'](function(_0x17b1a0){return _0x4e6ce1[_0xa141('0x8')](0x1f4)[_0xa141('0xd')](_0x17b1a0);});};exports['killProcess']=function(_0x3222ae,_0x2cac59){var _0x3608e2=[_0xa141('0xe')];return new BPromise(function(_0x215d8a,_0x364231){return exec(util[_0xa141('0xf')](_0xa141('0x10'),_0x3222ae[_0xa141('0x11')][_0xa141('0x12')]),function(_0x13d3dd,_0x320553,_0x480eb6){if(_0x13d3dd){return _0x364231(_0x13d3dd);}return _0x215d8a(_0x320553);});})['then'](function(_0x4364ea){var _0x16637a=![];var _0x1b8d85=_0x4364ea['split'](/\n/);for(var _0x46318c=0x0,_0x3931cf=_0x3608e2[_0xa141('0x13')];_0x46318c<_0x3931cf,_0x16637a===![];_0x46318c+=0x1){if(_0x4364ea[_0xa141('0x14')](_0x3608e2[_0x46318c])>=0x0){_0x16637a=!![];}}if(!_0x16637a){throw new Error(util[_0xa141('0xf')](_0xa141('0x15'),_0x3222ae[_0xa141('0x11')][_0xa141('0x12')]));}process[_0xa141('0x16')](_0x3222ae['params'][_0xa141('0x12')],_0xa141('0x17'));return _0x2cac59[_0xa141('0x8')](0xc8)[_0xa141('0xd')]({'message':util['format'](_0xa141('0x18'),_0x3222ae[_0xa141('0x11')]['pid'])});})['catch'](handleError(_0x2cac59,null,'killProcess'));};
\ No newline at end of file
index 06d3e76..215cfad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cb1=['../../config/environment','./tag.controller','get','/:id','show','post','isAuthenticated','delete','multer','path','express','Router','fs-extra','../../components/auth/service'];(function(_0xf1fbe,_0x5bbcee){var _0x2b6c20=function(_0x556cec){while(--_0x556cec){_0xf1fbe['push'](_0xf1fbe['shift']());}};_0x2b6c20(++_0x5bbcee);}(_0x8cb1,0xe8));var _0x18cb=function(_0x57fcc0,_0x585004){_0x57fcc0=_0x57fcc0-0x0;var _0x5270df=_0x8cb1[_0x57fcc0];return _0x5270df;};'use strict';var multer=require(_0x18cb('0x0'));var util=require('util');var path=require(_0x18cb('0x1'));var timeout=require('connect-timeout');var express=require(_0x18cb('0x2'));var router=express[_0x18cb('0x3')]();var fs_extra=require(_0x18cb('0x4'));var auth=require(_0x18cb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x18cb('0x6'));var controller=require(_0x18cb('0x7'));router[_0x18cb('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x18cb('0x8')](_0x18cb('0x9'),auth['isAuthenticated'](),controller[_0x18cb('0xa')]);router[_0x18cb('0xb')]('/',auth[_0x18cb('0xc')](),controller['create']);router['put'](_0x18cb('0x9'),auth[_0x18cb('0xc')](),controller['update']);router[_0x18cb('0xd')]('/:id',auth[_0x18cb('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x9741=['../../components/auth/service','../../components/interaction/service','./tag.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x98225d,_0x16c5bf){var _0x20877e=function(_0x418d57){while(--_0x418d57){_0x98225d['push'](_0x98225d['shift']());}};_0x20877e(++_0x16c5bf);}(_0x9741,0x1ee));var _0x1974=function(_0x41eb8c,_0xb39948){_0x41eb8c=_0x41eb8c-0x0;var _0x565e21=_0x9741[_0x41eb8c];return _0x565e21;};'use strict';var multer=require(_0x1974('0x0'));var util=require(_0x1974('0x1'));var path=require(_0x1974('0x2'));var timeout=require(_0x1974('0x3'));var express=require(_0x1974('0x4'));var router=express[_0x1974('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1974('0x6'));var interaction=require(_0x1974('0x7'));var config=require('../../config/environment');var controller=require(_0x1974('0x8'));router[_0x1974('0x9')]('/',auth[_0x1974('0xa')](),controller[_0x1974('0xb')]);router[_0x1974('0x9')](_0x1974('0xc'),auth[_0x1974('0xa')](),controller[_0x1974('0xd')]);router[_0x1974('0xe')]('/',auth['isAuthenticated'](),controller[_0x1974('0xf')]);router[_0x1974('0x10')]('/:id',auth[_0x1974('0xa')](),controller[_0x1974('0x11')]);router[_0x1974('0x12')](_0x1974('0xc'),auth[_0x1974('0xa')](),controller[_0x1974('0x13')]);module['exports']=router;
\ No newline at end of file
index ebbe9c7..6766000 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefe2=['STRING','sequelize','exports','name'];(function(_0x390b6b,_0x2ead41){var _0x246b9a=function(_0x5a76a6){while(--_0x5a76a6){_0x390b6b['push'](_0x390b6b['shift']());}};_0x246b9a(++_0x2ead41);}(_0xefe2,0xd9));var _0x2efe=function(_0x240e6f,_0x46f5eb){_0x240e6f=_0x240e6f-0x0;var _0x50ca82=_0xefe2[_0x240e6f];return _0x50ca82;};'use strict';var Sequelize=require(_0x2efe('0x0'));module[_0x2efe('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2efe('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x2efe('0x3')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x2efe('0x3')]}};
\ No newline at end of file
+var _0x10b8=['STRING','name','#0091EA','sequelize','exports'];(function(_0xb99ac5,_0x34e5f2){var _0x4fff7d=function(_0xa0b6f6){while(--_0xa0b6f6){_0xb99ac5['push'](_0xb99ac5['shift']());}};_0x4fff7d(++_0x34e5f2);}(_0x10b8,0x166));var _0x810b=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x10b8[_0x42bdad];return _0x122626;};'use strict';var Sequelize=require(_0x810b('0x0'));module[_0x810b('0x1')]={'name':{'type':Sequelize[_0x810b('0x2')],'unique':_0x810b('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x810b('0x2')],'defaultValue':_0x810b('0x4')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 23ae625..b58c78c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','Tag','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x3f3825,_0xc1fa97){var _0x59d8be=function(_0x2ee1d1){while(--_0x2ee1d1){_0x3f3825['push'](_0x3f3825['shift']());}};_0x59d8be(++_0xc1fa97);}(_0x008c,0x188));var _0xc008=function(_0x33bc64,_0x4d1e92){_0x33bc64=_0x33bc64-0x0;var _0x3fdd34=_0x008c[_0x33bc64];return _0x3fdd34;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Tags';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['Tag'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['Tag'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['Tag'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Tags';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['Tag']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));};
\ No newline at end of file
+var _0x0c6d=['rows','catch','params','merge','find','create','body','Tags','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','stack','name','send','index','Tag','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','map','filter','options','includeAll','include','findAll'];(function(_0x5b10a1,_0x3190da){var _0x6ccca0=function(_0x5c0c44){while(--_0x5c0c44){_0x5b10a1['push'](_0x5b10a1['shift']());}};_0x6ccca0(++_0x3190da);}(_0x0c6d,0xf7));var _0xd0c6=function(_0x4dae29,_0x2de8dd){_0x4dae29=_0x4dae29-0x0;var _0xd1f49a=_0x0c6d[_0x4dae29];return _0xd1f49a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd0c6('0x0'));var zipdir=require(_0xd0c6('0x1'));var jsonpatch=require(_0xd0c6('0x2'));var rp=require(_0xd0c6('0x3'));var moment=require(_0xd0c6('0x4'));var BPromise=require(_0xd0c6('0x5'));var Mustache=require('mustache');var util=require(_0xd0c6('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd0c6('0x7'));var fs=require('fs');var fs_extra=require(_0xd0c6('0x8'));var _=require(_0xd0c6('0x9'));var squel=require('squel');var crypto=require(_0xd0c6('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd0c6('0xb'));var toCsv=require(_0xd0c6('0xc'));var querystring=require(_0xd0c6('0xd'));var Papa=require(_0xd0c6('0xe'));var Redis=require(_0xd0c6('0xf'));var authService=require(_0xd0c6('0x10'));var qs=require(_0xd0c6('0x11'));var as=require(_0xd0c6('0x12'));var hardwareService=require(_0xd0c6('0x13'));var logger=require('../../config/logger')(_0xd0c6('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd0c6('0x15'));var db=require(_0xd0c6('0x16'))['db'];function respondWithStatusCode(_0x19b435,_0x2d85e1){_0x2d85e1=_0x2d85e1||0xcc;return function(_0x3f7841){if(_0x3f7841){return _0x19b435[_0xd0c6('0x17')](_0x2d85e1);}return _0x19b435[_0xd0c6('0x18')](_0x2d85e1)[_0xd0c6('0x19')]();};}function respondWithResult(_0xab9cfc,_0x35ddf1){_0x35ddf1=_0x35ddf1||0xc8;return function(_0x1138fe){if(_0x1138fe){return _0xab9cfc[_0xd0c6('0x18')](_0x35ddf1)[_0xd0c6('0x1a')](_0x1138fe);}};}function respondWithFilteredResult(_0x1afb2f,_0x2697b2){return function(_0x1d79a6){if(_0x1d79a6){var _0x1e45b3=typeof _0x2697b2[_0xd0c6('0x1b')]===_0xd0c6('0x1c')&&typeof _0x2697b2[_0xd0c6('0x1d')]===_0xd0c6('0x1c');var _0x408f96=_0x1d79a6[_0xd0c6('0x1e')];var _0x941021=_0x1e45b3?0x0:_0x2697b2[_0xd0c6('0x1b')];var _0x4f7e65=_0x1e45b3?_0x1d79a6['count']:_0x2697b2[_0xd0c6('0x1b')]+_0x2697b2[_0xd0c6('0x1d')];var _0x4a761a;if(_0x4f7e65>=_0x408f96){_0x4f7e65=_0x408f96;_0x4a761a=0xc8;}else{_0x4a761a=0xce;}_0x1afb2f['status'](_0x4a761a);return _0x1afb2f['set'](_0xd0c6('0x1f'),_0x941021+'-'+_0x4f7e65+'/'+_0x408f96)[_0xd0c6('0x1a')](_0x1d79a6);}return null;};}function patchUpdates(_0x1ebce8){return function(_0x1571b7){try{jsonpatch[_0xd0c6('0x20')](_0x1571b7,_0x1ebce8,!![]);}catch(_0x1f664d){return BPromise[_0xd0c6('0x21')](_0x1f664d);}return _0x1571b7[_0xd0c6('0x22')]();};}function saveUpdates(_0x5f191a,_0x2f7559){return function(_0x1e8384){if(_0x1e8384){return _0x1e8384['update'](_0x5f191a)[_0xd0c6('0x23')](function(_0x2251e0){return _0x2251e0;});}return null;};}function removeEntity(_0x3b437d,_0x5d9baa){return function(_0x50fd2e){if(_0x50fd2e){return _0x50fd2e[_0xd0c6('0x24')]()[_0xd0c6('0x23')](function(){var _0x50cb93=_0x50fd2e[_0xd0c6('0x25')]({'plain':!![]});var _0x13559f='Tags';return db[_0xd0c6('0x26')]['destroy']({'where':{'type':_0x13559f,'resourceId':_0x50cb93['id']}})['then'](function(){return _0x50fd2e;});})[_0xd0c6('0x23')](function(){_0x3b437d[_0xd0c6('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x414124,_0x4368fa){return function(_0x3802af){if(!_0x3802af){_0x414124[_0xd0c6('0x17')](0x194);}return _0x3802af;};}function handleError(_0x456fcb,_0x409e22){_0x409e22=_0x409e22||0x1f4;return function(_0x1ed9a9){logger['error'](_0x1ed9a9[_0xd0c6('0x27')]);if(_0x1ed9a9[_0xd0c6('0x28')]){delete _0x1ed9a9[_0xd0c6('0x28')];}_0x456fcb[_0xd0c6('0x18')](_0x409e22)[_0xd0c6('0x29')](_0x1ed9a9);};}exports[_0xd0c6('0x2a')]=function(_0x1b0909,_0x14fcaa){var _0x31e790={},_0x1eee11={},_0x5db764={'count':0x0,'rows':[]};var _0x8ed2c4=_['map'](db[_0xd0c6('0x2b')][_0xd0c6('0x2c')],function(_0x3779a7){return{'name':_0x3779a7[_0xd0c6('0x2d')],'type':_0x3779a7['type']['key']};});_0x1eee11[_0xd0c6('0x2e')]=_['map'](_0x8ed2c4,_0xd0c6('0x28'));_0x1eee11[_0xd0c6('0x2f')]=_[_0xd0c6('0x30')](_0x1b0909[_0xd0c6('0x2f')]);_0x1eee11['filters']=_[_0xd0c6('0x31')](_0x1eee11[_0xd0c6('0x2e')],_0x1eee11[_0xd0c6('0x2f')]);_0x31e790[_0xd0c6('0x32')]=_[_0xd0c6('0x31')](_0x1eee11[_0xd0c6('0x2e')],qs[_0xd0c6('0x33')](_0x1b0909[_0xd0c6('0x2f')]['fields']));_0x31e790[_0xd0c6('0x32')]=_0x31e790[_0xd0c6('0x32')][_0xd0c6('0x34')]?_0x31e790[_0xd0c6('0x32')]:_0x1eee11['model'];if(!_0x1b0909[_0xd0c6('0x2f')][_0xd0c6('0x35')]('nolimit')){_0x31e790['limit']=qs['limit'](_0x1b0909[_0xd0c6('0x2f')]['limit']);_0x31e790[_0xd0c6('0x1b')]=qs[_0xd0c6('0x1b')](_0x1b0909[_0xd0c6('0x2f')][_0xd0c6('0x1b')]);}_0x31e790[_0xd0c6('0x36')]=qs[_0xd0c6('0x37')](_0x1b0909[_0xd0c6('0x2f')][_0xd0c6('0x37')]);_0x31e790[_0xd0c6('0x38')]=qs['filters'](_[_0xd0c6('0x39')](_0x1b0909[_0xd0c6('0x2f')],_0x1eee11[_0xd0c6('0x3a')]),_0x8ed2c4);if(_0x1b0909[_0xd0c6('0x2f')]['filter']){_0x31e790[_0xd0c6('0x38')]=_['merge'](_0x31e790[_0xd0c6('0x38')],{'$or':_[_0xd0c6('0x3b')](_0x8ed2c4,function(_0x5033c8){if(_0x5033c8['type']!=='VIRTUAL'){var _0x410cce={};_0x410cce[_0x5033c8[_0xd0c6('0x28')]]={'$like':'%'+_0x1b0909[_0xd0c6('0x2f')][_0xd0c6('0x3c')]+'%'};return _0x410cce;}})});}_0x31e790=_['merge']({},_0x31e790,_0x1b0909[_0xd0c6('0x3d')]);var _0x1835db={'where':_0x31e790[_0xd0c6('0x38')]};return db[_0xd0c6('0x2b')]['count'](_0x1835db)[_0xd0c6('0x23')](function(_0x4818df){_0x5db764[_0xd0c6('0x1e')]=_0x4818df;if(_0x1b0909[_0xd0c6('0x2f')][_0xd0c6('0x3e')]){_0x31e790[_0xd0c6('0x3f')]=[{'all':!![]}];}return db[_0xd0c6('0x2b')][_0xd0c6('0x40')](_0x31e790);})['then'](function(_0x5d6703){_0x5db764[_0xd0c6('0x41')]=_0x5d6703;return _0x5db764;})[_0xd0c6('0x23')](respondWithFilteredResult(_0x14fcaa,_0x31e790))[_0xd0c6('0x42')](handleError(_0x14fcaa,null));};exports['show']=function(_0x41b441,_0xf644dc){var _0x472c27={'raw':!![],'where':{'id':_0x41b441[_0xd0c6('0x43')]['id']}},_0x49009a={};_0x49009a[_0xd0c6('0x2e')]=_[_0xd0c6('0x30')](db[_0xd0c6('0x2b')]['rawAttributes']);_0x49009a[_0xd0c6('0x2f')]=_['keys'](_0x41b441[_0xd0c6('0x2f')]);_0x49009a['filters']=_[_0xd0c6('0x31')](_0x49009a[_0xd0c6('0x2e')],_0x49009a['query']);_0x472c27[_0xd0c6('0x32')]=_[_0xd0c6('0x31')](_0x49009a['model'],qs[_0xd0c6('0x33')](_0x41b441[_0xd0c6('0x2f')][_0xd0c6('0x33')]));_0x472c27[_0xd0c6('0x32')]=_0x472c27['attributes'][_0xd0c6('0x34')]?_0x472c27[_0xd0c6('0x32')]:_0x49009a['model'];if(_0x41b441['query'][_0xd0c6('0x3e')]){_0x472c27['include']=[{'all':!![]}];}_0x472c27=_[_0xd0c6('0x44')]({},_0x472c27,_0x41b441[_0xd0c6('0x3d')]);return db[_0xd0c6('0x2b')][_0xd0c6('0x45')](_0x472c27)[_0xd0c6('0x23')](handleEntityNotFound(_0xf644dc,null))[_0xd0c6('0x23')](respondWithResult(_0xf644dc,null))[_0xd0c6('0x42')](handleError(_0xf644dc,null));};exports[_0xd0c6('0x46')]=function(_0x3b3cf4,_0x580cad){return db[_0xd0c6('0x2b')]['create'](_0x3b3cf4[_0xd0c6('0x47')],{})[_0xd0c6('0x23')](function(_0x2daef3){var _0xaa590c=_0x3b3cf4['user'][_0xd0c6('0x25')]({'plain':!![]});if(!_0xaa590c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xaa590c['role']==='user'){var _0x1509b5=_0x2daef3[_0xd0c6('0x25')]({'plain':!![]});var _0x24bb40=_0xd0c6('0x48');return db[_0xd0c6('0x49')][_0xd0c6('0x45')]({'where':{'name':_0x24bb40,'userProfileId':_0xaa590c[_0xd0c6('0x4a')]},'raw':!![]})[_0xd0c6('0x23')](function(_0x1510b){if(_0x1510b&&_0x1510b[_0xd0c6('0x4b')]===0x0){return db['UserProfileResource'][_0xd0c6('0x46')]({'name':_0x1509b5[_0xd0c6('0x28')],'resourceId':_0x1509b5['id'],'type':_0x1510b[_0xd0c6('0x28')],'sectionId':_0x1510b['id']},{})['then'](function(){return _0x2daef3;});}else{return _0x2daef3;}})[_0xd0c6('0x42')](function(_0x1cfc2b){logger[_0xd0c6('0x4c')](_0xd0c6('0x4d'),_0x1cfc2b);throw _0x1cfc2b;});}return _0x2daef3;})[_0xd0c6('0x23')](respondWithResult(_0x580cad,0xc9))[_0xd0c6('0x42')](handleError(_0x580cad,null));};exports['update']=function(_0x439b0d,_0xc9b9c3){if(_0x439b0d[_0xd0c6('0x47')]['id']){delete _0x439b0d[_0xd0c6('0x47')]['id'];}return db[_0xd0c6('0x2b')]['find']({'where':{'id':_0x439b0d[_0xd0c6('0x43')]['id']}})[_0xd0c6('0x23')](handleEntityNotFound(_0xc9b9c3,null))[_0xd0c6('0x23')](saveUpdates(_0x439b0d['body'],null))[_0xd0c6('0x23')](respondWithResult(_0xc9b9c3,null))[_0xd0c6('0x42')](handleError(_0xc9b9c3,null));};exports[_0xd0c6('0x24')]=function(_0x45a50a,_0x26e246){return db['Tag'][_0xd0c6('0x45')]({'where':{'id':_0x45a50a[_0xd0c6('0x43')]['id']}})['then'](handleEntityNotFound(_0x26e246,null))[_0xd0c6('0x23')](removeEntity(_0x26e246,null))[_0xd0c6('0x42')](handleError(_0x26e246,null));};
\ No newline at end of file
index d9e7bc1..e7f9bff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x594a=['util','../../config/logger','api','moment','request-promise','../../config/environment','./tag.attributes','Tag','tools_tags','lodash'];(function(_0x3f657d,_0x497ec2){var _0x28c6a5=function(_0x263232){while(--_0x263232){_0x3f657d['push'](_0x3f657d['shift']());}};_0x28c6a5(++_0x497ec2);}(_0x594a,0x77));var _0xa594=function(_0xc80606,_0x40cc15){_0xc80606=_0xc80606-0x0;var _0x4187f5=_0x594a[_0xc80606];return _0x4187f5;};'use strict';var _=require(_0xa594('0x0'));var util=require(_0xa594('0x1'));var logger=require(_0xa594('0x2'))(_0xa594('0x3'));var moment=require(_0xa594('0x4'));var BPromise=require('bluebird');var rp=require(_0xa594('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa594('0x6'));var attributes=require(_0xa594('0x7'));module['exports']=function(_0x350cca,_0x3c5939){return _0x350cca['define'](_0xa594('0x8'),attributes,{'tableName':_0xa594('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb2a4=['tools_tags','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag'];(function(_0x57d4f2,_0xb6cadd){var _0x5c14f2=function(_0x18e1d6){while(--_0x18e1d6){_0x57d4f2['push'](_0x57d4f2['shift']());}};_0x5c14f2(++_0xb6cadd);}(_0xb2a4,0xaa));var _0x4b2a=function(_0x355c25,_0x2117cf){_0x355c25=_0x355c25-0x0;var _0x295a00=_0xb2a4[_0x355c25];return _0x295a00;};'use strict';var _=require('lodash');var util=require(_0x4b2a('0x0'));var logger=require(_0x4b2a('0x1'))(_0x4b2a('0x2'));var moment=require(_0x4b2a('0x3'));var BPromise=require(_0x4b2a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b2a('0x5'));var rimraf=require(_0x4b2a('0x6'));var config=require(_0x4b2a('0x7'));var attributes=require(_0x4b2a('0x8'));module[_0x4b2a('0x9')]=function(_0x3d8a60,_0xbca9cf){return _0x3d8a60[_0x4b2a('0xa')](_0x4b2a('0xb'),attributes,{'tableName':_0x4b2a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bbc312f..b2138a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f17=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then','info','request\x20sent','debug','stringify','error','code','Tag,\x20%s,\x20%s','message','result','catch','lodash','moment'];(function(_0xc14a81,_0xe83ea4){var _0x4ac095=function(_0x530656){while(--_0x530656){_0xc14a81['push'](_0xc14a81['shift']());}};_0x4ac095(++_0xe83ea4);}(_0x4f17,0x9e));var _0x74f1=function(_0x31295c,_0x2f2b82){_0x31295c=_0x31295c-0x0;var _0x2c150e=_0x4f17[_0x31295c];return _0x2c150e;};'use strict';var _=require(_0x74f1('0x0'));var util=require('util');var moment=require(_0x74f1('0x1'));var BPromise=require(_0x74f1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x74f1('0x3'));var db=require(_0x74f1('0x4'))['db'];var utils=require(_0x74f1('0x5'));var logger=require(_0x74f1('0x6'))(_0x74f1('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x74f1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe54c30,_0x51effb,_0x34ec03){return new BPromise(function(_0x339d55,_0x3b4914){return client['request'](_0xe54c30,_0x34ec03)[_0x74f1('0x9')](function(_0x4c4e41){logger[_0x74f1('0xa')]('Tag,\x20%s,\x20%s',_0x51effb,_0x74f1('0xb'));logger[_0x74f1('0xc')]('Tag,\x20%s,\x20%s,\x20%s',_0x51effb,'request\x20sent',JSON[_0x74f1('0xd')](_0x4c4e41));if(_0x4c4e41[_0x74f1('0xe')]){if(_0x4c4e41[_0x74f1('0xe')][_0x74f1('0xf')]===0x1f4){logger[_0x74f1('0xe')](_0x74f1('0x10'),_0x51effb,_0x4c4e41[_0x74f1('0xe')][_0x74f1('0x11')]);return _0x3b4914(_0x4c4e41[_0x74f1('0xe')][_0x74f1('0x11')]);}logger['error'](_0x74f1('0x10'),_0x51effb,_0x4c4e41['error'][_0x74f1('0x11')]);return _0x339d55(_0x4c4e41['error'][_0x74f1('0x11')]);}else{logger[_0x74f1('0xa')](_0x74f1('0x10'),_0x51effb,_0x74f1('0xb'));_0x339d55(_0x4c4e41[_0x74f1('0x12')]['message']);}})[_0x74f1('0x13')](function(_0x10a0b1){logger['error'](_0x74f1('0x10'),_0x51effb,_0x10a0b1);_0x3b4914(_0x10a0b1);});});}
\ No newline at end of file
+var _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2694f0,_0x1aa6c6){var _0x590fd5=function(_0x340c42){while(--_0x340c42){_0x2694f0['push'](_0x2694f0['shift']());}};_0x590fd5(++_0x1aa6c6);}(_0x34e8,0x12c));var _0x834e=function(_0x1d6caf,_0xb1738c){_0x1d6caf=_0x1d6caf-0x0;var _0x3cf276=_0x34e8[_0x1d6caf];return _0x3cf276;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('Tag,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('Tag,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});}
\ No newline at end of file
index 018770e..8ab8eb6 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(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_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['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 3e80973..3f23d21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['name','sequelize','STRING'];(function(_0x3b573e,_0x20d602){var _0x1f4158=function(_0x324d97){while(--_0x324d97){_0x3b573e['push'](_0x3b573e['shift']());}};_0x1f4158(++_0x20d602);}(_0xb10b,0x12a));var _0xbb10=function(_0x8014d8,_0x134a36){_0x8014d8=_0x8014d8-0x0;var _0x581b7b=_0xb10b[_0x8014d8];return _0x581b7b;};'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 _0x757a=['exports','STRING'];(function(_0xa73024,_0x411d1a){var _0x5c9e3e=function(_0x28047f){while(--_0x28047f){_0xa73024['push'](_0xa73024['shift']());}};_0x5c9e3e(++_0x411d1a);}(_0x757a,0xde));var _0xa757=function(_0x240960,_0x43ace6){_0x240960=_0x240960-0x0;var _0x5a18db=_0x757a[_0x240960];return _0x5a18db;};'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 4876b15..25c72a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fe6=['removeAgents','Queue:remove','getAgents','where','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','index','map','Team','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','pick','filter','merge','VIRTUAL','options','then','includeAll','include','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','Sequelize','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','UserProfileResource','getQueues','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','order','addQueues','findOne','remove','Queues','ids','addAgents','isArray','Voice','Chat','Mail','Sms','Whatsapp','transaction','through','penalty','QueueId','TeamVoiceQueue','findOrCreate','Queue:save','User','findAll','voicePause','interface','UserVoiceQueueRt','SIP/%s','all','TeamVoicePrefix','upsert'];(function(_0xbb214f,_0x21c90d){var _0x2921eb=function(_0x563899){while(--_0x563899){_0xbb214f['push'](_0xbb214f['shift']());}};_0x2921eb(++_0x21c90d);}(_0x1fe6,0x1cf));var _0x61fe=function(_0x454d8c,_0x4bf7d2){_0x454d8c=_0x454d8c-0x0;var _0x1d8b3e=_0x1fe6[_0x454d8c];return _0x1d8b3e;};'use strict';var emlformat=require(_0x61fe('0x0'));var rimraf=require(_0x61fe('0x1'));var zipdir=require(_0x61fe('0x2'));var jsonpatch=require(_0x61fe('0x3'));var rp=require(_0x61fe('0x4'));var moment=require(_0x61fe('0x5'));var BPromise=require(_0x61fe('0x6'));var Mustache=require(_0x61fe('0x7'));var util=require(_0x61fe('0x8'));var path=require(_0x61fe('0x9'));var sox=require(_0x61fe('0xa'));var csv=require(_0x61fe('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x61fe('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x61fe('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x61fe('0xe'));var toCsv=require(_0x61fe('0xb'));var querystring=require(_0x61fe('0xf'));var Papa=require(_0x61fe('0x10'));var Redis=require(_0x61fe('0x11'));var authService=require(_0x61fe('0x12'));var qs=require(_0x61fe('0x13'));var as=require(_0x61fe('0x14'));var hardwareService=require(_0x61fe('0x15'));var logger=require(_0x61fe('0x16'))(_0x61fe('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x61fe('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x61fe('0x19')](config[_0x61fe('0x1a')],{'host':_0x61fe('0x1b'),'port':0x18eb});var socket=require(_0x61fe('0x1c'))(new Redis(config[_0x61fe('0x1a')]));require(_0x61fe('0x1d'))[_0x61fe('0x1e')](socket);function respondWithStatusCode(_0x5b9d76,_0x364dea){_0x364dea=_0x364dea||0xcc;return function(_0x2616da){if(_0x2616da){return _0x5b9d76[_0x61fe('0x1f')](_0x364dea);}return _0x5b9d76[_0x61fe('0x20')](_0x364dea)[_0x61fe('0x21')]();};}function respondWithResult(_0x50e416,_0x2f7ed7){_0x2f7ed7=_0x2f7ed7||0xc8;return function(_0x46db4e){if(_0x46db4e){return _0x50e416[_0x61fe('0x20')](_0x2f7ed7)[_0x61fe('0x22')](_0x46db4e);}};}function respondWithFilteredResult(_0x153ea4,_0x4f30d6){return function(_0x2bd668){if(_0x2bd668){var _0x75c921=typeof _0x4f30d6[_0x61fe('0x23')]===_0x61fe('0x24')&&typeof _0x4f30d6['limit']===_0x61fe('0x24');var _0x48f461=_0x2bd668[_0x61fe('0x25')];var _0x445331=_0x75c921?0x0:_0x4f30d6[_0x61fe('0x23')];var _0x589374=_0x75c921?_0x2bd668['count']:_0x4f30d6[_0x61fe('0x23')]+_0x4f30d6['limit'];var _0x92ddbd;if(_0x589374>=_0x48f461){_0x589374=_0x48f461;_0x92ddbd=0xc8;}else{_0x92ddbd=0xce;}_0x153ea4[_0x61fe('0x20')](_0x92ddbd);return _0x153ea4[_0x61fe('0x26')](_0x61fe('0x27'),_0x445331+'-'+_0x589374+'/'+_0x48f461)[_0x61fe('0x22')](_0x2bd668);}return null;};}function patchUpdates(_0xb8252c){return function(_0x182b0c){try{jsonpatch[_0x61fe('0x28')](_0x182b0c,_0xb8252c,!![]);}catch(_0x5c1a24){return BPromise[_0x61fe('0x29')](_0x5c1a24);}return _0x182b0c[_0x61fe('0x2a')]();};}function saveUpdates(_0x3efe52,_0x1fe8e5){return function(_0x308f6f){if(_0x308f6f){return _0x308f6f[_0x61fe('0x2b')](_0x3efe52)['then'](function(_0x467ee5){return _0x467ee5;});}return null;};}function handleEntityNotFound(_0x184e86,_0x26eeed){return function(_0x3c34d8){if(!_0x3c34d8){_0x184e86[_0x61fe('0x1f')](0x194);}return _0x3c34d8;};}function handleError(_0x2887a1,_0x20c08a){_0x20c08a=_0x20c08a||0x1f4;return function(_0x4a360f){logger[_0x61fe('0x2c')](_0x4a360f[_0x61fe('0x2d')]);if(_0x4a360f[_0x61fe('0x2e')]){delete _0x4a360f['name'];}_0x2887a1[_0x61fe('0x20')](_0x20c08a)[_0x61fe('0x2f')](_0x4a360f);};}exports[_0x61fe('0x30')]=function(_0x9f84d6,_0x505555){var _0x58ef30={},_0x7e2290={},_0x55f780={'count':0x0,'rows':[]};var _0xc3a85e=_[_0x61fe('0x31')](db[_0x61fe('0x32')][_0x61fe('0x33')],function(_0x404df5){return{'name':_0x404df5[_0x61fe('0x34')],'type':_0x404df5[_0x61fe('0x35')]['key']};});_0x7e2290['model']=_['map'](_0xc3a85e,_0x61fe('0x2e'));_0x7e2290[_0x61fe('0x36')]=_[_0x61fe('0x37')](_0x9f84d6[_0x61fe('0x36')]);_0x7e2290[_0x61fe('0x38')]=_[_0x61fe('0x39')](_0x7e2290[_0x61fe('0x3a')],_0x7e2290['query']);_0x58ef30['attributes']=_['intersection'](_0x7e2290['model'],qs[_0x61fe('0x3b')](_0x9f84d6[_0x61fe('0x36')][_0x61fe('0x3b')]));_0x58ef30[_0x61fe('0x3c')]=_0x58ef30['attributes'][_0x61fe('0x3d')]?_0x58ef30['attributes']:_0x7e2290[_0x61fe('0x3a')];if(!_0x9f84d6[_0x61fe('0x36')][_0x61fe('0x3e')](_0x61fe('0x3f'))){_0x58ef30[_0x61fe('0x40')]=qs['limit'](_0x9f84d6[_0x61fe('0x36')][_0x61fe('0x40')]);_0x58ef30[_0x61fe('0x23')]=qs[_0x61fe('0x23')](_0x9f84d6[_0x61fe('0x36')][_0x61fe('0x23')]);}_0x58ef30['order']=qs[_0x61fe('0x41')](_0x9f84d6['query'][_0x61fe('0x41')]);_0x58ef30['where']=qs['filters'](_[_0x61fe('0x42')](_0x9f84d6['query'],_0x7e2290[_0x61fe('0x38')]),_0xc3a85e);if(_0x9f84d6[_0x61fe('0x36')][_0x61fe('0x43')]){_0x58ef30['where']=_[_0x61fe('0x44')](_0x58ef30['where'],{'$or':_[_0x61fe('0x31')](_0xc3a85e,function(_0xe83198){if(_0xe83198[_0x61fe('0x35')]!==_0x61fe('0x45')){var _0x566930={};_0x566930[_0xe83198[_0x61fe('0x2e')]]={'$like':'%'+_0x9f84d6[_0x61fe('0x36')][_0x61fe('0x43')]+'%'};return _0x566930;}})});}_0x58ef30=_[_0x61fe('0x44')]({},_0x58ef30,_0x9f84d6[_0x61fe('0x46')]);var _0x589b29={'where':_0x58ef30['where']};return db[_0x61fe('0x32')][_0x61fe('0x25')](_0x589b29)[_0x61fe('0x47')](function(_0x492768){_0x55f780[_0x61fe('0x25')]=_0x492768;if(_0x9f84d6[_0x61fe('0x36')][_0x61fe('0x48')]){_0x58ef30[_0x61fe('0x49')]=[{'all':!![]}];}return db[_0x61fe('0x32')]['findAll'](_0x58ef30);})[_0x61fe('0x47')](function(_0x1b25f4){_0x55f780['rows']=_0x1b25f4;return _0x55f780;})[_0x61fe('0x47')](respondWithFilteredResult(_0x505555,_0x58ef30))[_0x61fe('0x4a')](handleError(_0x505555,null));};exports[_0x61fe('0x4b')]=function(_0x5a12bb,_0x2490b7){var _0x7c6d={'raw':![],'where':{'id':_0x5a12bb[_0x61fe('0x4c')]['id']}},_0xe9c176={};_0xe9c176[_0x61fe('0x3a')]=_['keys'](db[_0x61fe('0x32')][_0x61fe('0x33')]);_0xe9c176[_0x61fe('0x36')]=_[_0x61fe('0x37')](_0x5a12bb[_0x61fe('0x36')]);_0xe9c176[_0x61fe('0x38')]=_[_0x61fe('0x39')](_0xe9c176[_0x61fe('0x3a')],_0xe9c176[_0x61fe('0x36')]);_0x7c6d[_0x61fe('0x3c')]=_[_0x61fe('0x39')](_0xe9c176[_0x61fe('0x3a')],qs[_0x61fe('0x3b')](_0x5a12bb[_0x61fe('0x36')]['fields']));_0x7c6d['attributes']=_0x7c6d[_0x61fe('0x3c')]['length']?_0x7c6d[_0x61fe('0x3c')]:_0xe9c176[_0x61fe('0x3a')];if(_0x5a12bb[_0x61fe('0x36')][_0x61fe('0x48')]){_0x7c6d['include']=[{'all':!![]}];}_0x7c6d=_[_0x61fe('0x44')]({},_0x7c6d,_0x5a12bb['options']);return db[_0x61fe('0x32')]['find'](_0x7c6d)['then'](handleEntityNotFound(_0x2490b7,null))[_0x61fe('0x47')](respondWithResult(_0x2490b7,null))[_0x61fe('0x4a')](handleError(_0x2490b7,null));};exports[_0x61fe('0x4d')]=function(_0xd3bcb7,_0x30ea57){return db[_0x61fe('0x32')][_0x61fe('0x4d')](_0xd3bcb7[_0x61fe('0x4e')],{})[_0x61fe('0x47')](function(_0x1e53a7){var _0x51169d=_0xd3bcb7[_0x61fe('0x4f')][_0x61fe('0x50')]({'plain':!![]});if(!_0x51169d)throw new Error(_0x61fe('0x51'));if(_0x51169d[_0x61fe('0x52')]===_0x61fe('0x4f')){var _0x2cdc9c=_0x1e53a7[_0x61fe('0x50')]({'plain':!![]});var _0x4f37b2=_0x61fe('0x53');return db[_0x61fe('0x54')][_0x61fe('0x55')]({'where':{'name':_0x4f37b2,'userProfileId':_0x51169d[_0x61fe('0x56')]},'raw':!![]})[_0x61fe('0x47')](function(_0x5e095c){if(_0x5e095c&&_0x5e095c['autoAssociation']===0x0){return db['UserProfileResource'][_0x61fe('0x4d')]({'name':_0x2cdc9c['name'],'resourceId':_0x2cdc9c['id'],'type':_0x5e095c[_0x61fe('0x2e')],'sectionId':_0x5e095c['id']},{})[_0x61fe('0x47')](function(){return _0x1e53a7;});}else{return _0x1e53a7;}})['catch'](function(_0x48e347){logger[_0x61fe('0x2c')](_0x61fe('0x57'),_0x48e347);throw _0x48e347;});}return _0x1e53a7;})[_0x61fe('0x47')](respondWithResult(_0x30ea57,0xc9))[_0x61fe('0x4a')](handleError(_0x30ea57,null));};exports['update']=function(_0x527dc4,_0x2e34c0){if(_0x527dc4[_0x61fe('0x4e')]['id']){delete _0x527dc4[_0x61fe('0x4e')]['id'];}return db[_0x61fe('0x32')][_0x61fe('0x55')]({'where':{'id':_0x527dc4[_0x61fe('0x4c')]['id']}})[_0x61fe('0x47')](handleEntityNotFound(_0x2e34c0,null))[_0x61fe('0x47')](saveUpdates(_0x527dc4[_0x61fe('0x4e')],null))[_0x61fe('0x47')](respondWithResult(_0x2e34c0,null))['catch'](handleError(_0x2e34c0,null));};exports['destroy']=function(_0x81beb3,_0xe0b07){var _0x2d20a5=_0x81beb3[_0x61fe('0x4c')]['id'];var _0x5768a2=[];return db[_0x61fe('0x58')]['transaction'](function(_0x53f7f4){var _0x1e9d39=_0x61fe('0x59')+_0x2d20a5;return db[_0x61fe('0x58')][_0x61fe('0x36')](_0x1e9d39,{'type':db['Sequelize'][_0x61fe('0x5a')][_0x61fe('0x5b')],'raw':!![],'transaction':_0x53f7f4})[_0x61fe('0x47')](function(_0x34773f){_0x5768a2=_['map'](_0x34773f,function(_0x49ca6c){return Number(_0x49ca6c['UserId']);});})[_0x61fe('0x47')](function(){var _0x2c2d70='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2d20a5;return db[_0x61fe('0x58')]['query'](_0x2c2d70,{'type':db['Sequelize']['QueryTypes'][_0x61fe('0x5b')],'raw':!![],'transaction':_0x53f7f4});})['then'](function(_0x483740){var _0x10ad73=_[_0x61fe('0x31')](_0x483740,function(_0x532db3){return Number(_0x532db3['VoiceQueueId']);});return db[_0x61fe('0x5c')][_0x61fe('0x5d')]({'where':{'UserId':{'$in':_0x5768a2},'VoiceQueueId':{'$in':_0x10ad73}},'transaction':_0x53f7f4});})[_0x61fe('0x47')](function(){var _0x580236=_0x61fe('0x5e')+_0x2d20a5;return db['sequelize'][_0x61fe('0x36')](_0x580236,{'type':db['Sequelize'][_0x61fe('0x5a')][_0x61fe('0x5b')],'raw':!![],'transaction':_0x53f7f4});})[_0x61fe('0x47')](function(_0x1fa9d8){var _0x40a353=_[_0x61fe('0x31')](_0x1fa9d8,function(_0x4ed495){return Number(_0x4ed495[_0x61fe('0x5f')]);});return db[_0x61fe('0x60')][_0x61fe('0x5d')]({'where':{'UserId':{'$in':_0x5768a2},'MailQueueId':{'$in':_0x40a353}},'transaction':_0x53f7f4});})[_0x61fe('0x47')](function(){var _0x5aa268='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2d20a5;return db[_0x61fe('0x58')][_0x61fe('0x36')](_0x5aa268,{'type':db[_0x61fe('0x61')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x53f7f4});})[_0x61fe('0x47')](function(_0x176420){var _0x3ac0d6=_[_0x61fe('0x31')](_0x176420,function(_0x7ffe1a){return Number(_0x7ffe1a[_0x61fe('0x62')]);});return db[_0x61fe('0x63')]['destroy']({'where':{'UserId':{'$in':_0x5768a2},'SmsQueueId':{'$in':_0x3ac0d6}},'transaction':_0x53f7f4});})[_0x61fe('0x47')](function(){var _0x590a57=_0x61fe('0x64')+_0x2d20a5;return db[_0x61fe('0x58')][_0x61fe('0x36')](_0x590a57,{'type':db['Sequelize'][_0x61fe('0x5a')][_0x61fe('0x5b')],'raw':!![],'transaction':_0x53f7f4});})['then'](function(_0x1b92b5){var _0x52553e=_[_0x61fe('0x31')](_0x1b92b5,function(_0x4fa887){return Number(_0x4fa887[_0x61fe('0x65')]);});return db[_0x61fe('0x66')][_0x61fe('0x5d')]({'where':{'UserId':{'$in':_0x5768a2},'ChatQueueId':{'$in':_0x52553e}},'transaction':_0x53f7f4});})[_0x61fe('0x47')](function(){var _0x4f056b=_0x61fe('0x67')+_0x2d20a5;return db[_0x61fe('0x58')][_0x61fe('0x36')](_0x4f056b,{'type':db[_0x61fe('0x61')][_0x61fe('0x5a')][_0x61fe('0x5b')],'raw':!![],'transaction':_0x53f7f4});})['then'](function(_0x1b84cd){var _0x3a3ea2=_[_0x61fe('0x31')](_0x1b84cd,function(_0x5691c3){return Number(_0x5691c3[_0x61fe('0x68')]);});return db[_0x61fe('0x69')][_0x61fe('0x5d')]({'where':{'UserId':{'$in':_0x5768a2},'FaxQueueId':{'$in':_0x3a3ea2}},'transaction':_0x53f7f4});})[_0x61fe('0x47')](function(){var _0x47f362='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2d20a5;return db[_0x61fe('0x58')]['query'](_0x47f362,{'type':db[_0x61fe('0x61')][_0x61fe('0x5a')][_0x61fe('0x5b')],'raw':!![],'transaction':_0x53f7f4});})['then'](function(_0x1ed1bf){var _0x150b23=_[_0x61fe('0x31')](_0x1ed1bf,function(_0x1b1c30){return Number(_0x1b1c30['OpenchannelQueueId']);});return db[_0x61fe('0x6a')]['destroy']({'where':{'UserId':{'$in':_0x5768a2},'OpenchannelQueueId':{'$in':_0x150b23}},'transaction':_0x53f7f4});})['then'](function(){var _0x506604=_0x61fe('0x6b')+_0x2d20a5;return db['sequelize'][_0x61fe('0x36')](_0x506604,{'type':db[_0x61fe('0x61')]['QueryTypes'][_0x61fe('0x5b')],'raw':!![],'transaction':_0x53f7f4});})[_0x61fe('0x47')](function(_0x314f57){var _0x234763=_['map'](_0x314f57,function(_0x520780){return Number(_0x520780['WhatsappQueueId']);});return db[_0x61fe('0x6c')][_0x61fe('0x5d')]({'where':{'UserId':{'$in':_0x5768a2},'WhatsappQueueId':{'$in':_0x234763}},'transaction':_0x53f7f4});})[_0x61fe('0x47')](function(){return db['TeamVoicePrefix']['find']({'where':{'TeamId':_0x2d20a5}});})[_0x61fe('0x47')](function(_0x373f10){if(_0x373f10===null){return;}return db[_0x61fe('0x6d')][_0x61fe('0x5d')]({'where':{'UserId':{'$in':_0x5768a2},'VoicePrefixId':_0x373f10[_0x61fe('0x6e')]},'transaction':_0x53f7f4});})[_0x61fe('0x47')](function(){return db['Team'][_0x61fe('0x5d')]({'where':{'id':_0x2d20a5},'cascade':!![],'transaction':_0x53f7f4});})[_0x61fe('0x47')](function(_0x13ec6f){if(_0x13ec6f===0x0){_0xe0b07[_0x61fe('0x1f')](0x194);}else{return db[_0x61fe('0x6f')][_0x61fe('0x5d')]({'where':{'type':_0x61fe('0x53'),'resourceId':_0x2d20a5},'cascade':!![],'transaction':_0x53f7f4})['then'](function(){_0xe0b07[_0x61fe('0x20')](0xcc)[_0x61fe('0x21')]();});}})['catch'](function(_0x40536c){_0xe0b07[_0x61fe('0x20')](0x1f4)['send'](_0x40536c);});});};exports[_0x61fe('0x70')]=function(_0x39f109,_0xd5d5f3,_0x1c7c25){return db[_0x61fe('0x32')]['findOne']({'where':{'id':_0x39f109[_0x61fe('0x4c')]['id']}})[_0x61fe('0x47')](handleEntityNotFound(_0xd5d5f3,null))[_0x61fe('0x47')](function(_0x31cc8b){if(!_0x39f109[_0x61fe('0x36')][_0x61fe('0x71')]||!utils[_0x61fe('0x72')](_0x39f109[_0x61fe('0x36')][_0x61fe('0x71')])){throw new db[(_0x61fe('0x61'))][(_0x61fe('0x73'))](_0x61fe('0x74'));}var _0x5a3c5d={};var _0x883bbf={};_0x883bbf['model']=_[_0x61fe('0x37')](db[_[_0x61fe('0x75')](_0x39f109[_0x61fe('0x36')][_0x61fe('0x71')][_0x61fe('0x76')]())+_0x61fe('0x77')][_0x61fe('0x33')]);_0x883bbf['query']=_['keys'](_0x39f109[_0x61fe('0x36')]);_0x883bbf[_0x61fe('0x38')]=_[_0x61fe('0x39')](_0x883bbf[_0x61fe('0x3a')],_0x883bbf[_0x61fe('0x36')]);_0x5a3c5d[_0x61fe('0x3c')]=_[_0x61fe('0x39')](_0x883bbf['model'],qs[_0x61fe('0x3b')](_0x39f109['query'][_0x61fe('0x3b')]));_0x5a3c5d[_0x61fe('0x3c')]=_0x5a3c5d['attributes'][_0x61fe('0x3d')]?_0x5a3c5d[_0x61fe('0x3c')]:_0x883bbf['model'];_0x5a3c5d[_0x61fe('0x40')]=qs[_0x61fe('0x40')](_0x39f109[_0x61fe('0x36')][_0x61fe('0x40')]);_0x5a3c5d[_0x61fe('0x23')]=qs[_0x61fe('0x23')](_0x39f109[_0x61fe('0x36')][_0x61fe('0x23')]);_0x5a3c5d[_0x61fe('0x78')]=qs[_0x61fe('0x41')](_0x39f109['query'][_0x61fe('0x41')]);_0x5a3c5d['where']=qs['filters'](_[_0x61fe('0x42')](_0x39f109[_0x61fe('0x36')],_0x883bbf[_0x61fe('0x38')]));_0x5a3c5d=_[_0x61fe('0x44')]({},_0x5a3c5d,_0x39f109[_0x61fe('0x46')]);return _0x31cc8b[_0x61fe('0x50')+_['capitalize'](_0x39f109[_0x61fe('0x36')]['channel'][_0x61fe('0x76')]())+'Queues'](_0x5a3c5d);})[_0x61fe('0x47')](respondWithResult(_0xd5d5f3,null))[_0x61fe('0x4a')](handleError(_0xd5d5f3,null));};exports[_0x61fe('0x79')]=function(_0xbf0968,_0x7ecb5b,_0x20c27f){return db[_0x61fe('0x32')][_0x61fe('0x7a')]({'where':{'id':_0xbf0968[_0x61fe('0x4c')]['id']}})[_0x61fe('0x47')](function(_0x4fe126){if(_0x4fe126){if(!_0xbf0968[_0x61fe('0x4e')][_0x61fe('0x71')]||!utils['isValidChannel'](_0xbf0968['body'][_0x61fe('0x71')])){throw new db['Sequelize']['ValidationError'](_0x61fe('0x74'));}return _0x4fe126['add'+_[_0x61fe('0x75')](_0xbf0968[_0x61fe('0x4e')][_0x61fe('0x71')][_0x61fe('0x76')]())+'Queues'](_0xbf0968[_0x61fe('0x4e')]['ids']);}return null;})[_0x61fe('0x47')](handleEntityNotFound(_0x7ecb5b,null))[_0x61fe('0x47')](respondWithStatusCode(_0x7ecb5b,null))['catch'](handleError(_0x7ecb5b,null));};exports['removeQueues']=function(_0x1ae72a,_0xf13dfc,_0x2a69fc){return db[_0x61fe('0x32')]['findOne']({'where':{'id':_0x1ae72a[_0x61fe('0x4c')]['id']}})['then'](function(_0xacd7c4){if(_0xacd7c4){if(!_0x1ae72a[_0x61fe('0x36')]['channel']||!utils['isValidChannel'](_0x1ae72a['query']['channel'])){throw new db[(_0x61fe('0x61'))][(_0x61fe('0x73'))](_0x61fe('0x74'));}return _0xacd7c4[_0x61fe('0x7b')+_['capitalize'](_0x1ae72a[_0x61fe('0x36')]['channel'][_0x61fe('0x76')]())+_0x61fe('0x7c')](_0x1ae72a[_0x61fe('0x36')][_0x61fe('0x7d')]);}return null;})[_0x61fe('0x47')](handleEntityNotFound(_0xf13dfc,null))[_0x61fe('0x47')](respondWithStatusCode(_0xf13dfc,null))[_0x61fe('0x4a')](handleError(_0xf13dfc,null));};exports[_0x61fe('0x7e')]=function(_0x5f159d,_0x327648){var _0x29bdc9=_[_0x61fe('0x7f')](_0x5f159d[_0x61fe('0x4e')][_0x61fe('0x7d')])?_0x5f159d[_0x61fe('0x4e')]['ids']:[_0x5f159d[_0x61fe('0x4e')][_0x61fe('0x7d')]];var _0x2e5e20=_0x5f159d[_0x61fe('0x4c')]['id'];return db[_0x61fe('0x32')][_0x61fe('0x55')]({'where':{'id':_0x2e5e20}})[_0x61fe('0x47')](handleEntityNotFound(_0x327648,null))[_0x61fe('0x47')](function(_0x3beca5){if(_0x3beca5){var _0x43f562=[_0x61fe('0x80'),_0x61fe('0x81'),_0x61fe('0x82'),_0x61fe('0x83'),'Fax','Openchannel',_0x61fe('0x84')];return db[_0x61fe('0x58')][_0x61fe('0x85')](function(_0x1ff30a){var _0x254d01=_['map'](_0x43f562,function(_0x3e7cb1){var _0x4aab55={'attributes':['id',_0x61fe('0x2e')]};if(_0x3e7cb1===_0x61fe('0x80')){_0x4aab55[_0x61fe('0x86')]={'attributes':[_0x61fe('0x87')]};}return _0x3beca5['get'+_0x3e7cb1+_0x61fe('0x7c')](_0x4aab55)[_0x61fe('0x47')](function(_0x55e5b7){var _0x2f493c=_['map'](_0x55e5b7,function(_0xe18fc8){var _0x35238c=_['map'](_0x29bdc9,function(_0x555713){var _0x187a93={'where':{'UserId':_0x555713,[_0x3e7cb1+_0x61fe('0x88')]:_0xe18fc8['id']},'transaction':_0x1ff30a};if(_0x3e7cb1===_0x61fe('0x80')){_0x187a93[_0x61fe('0x19')]={'penalty':_0xe18fc8[_0x61fe('0x89')][_0x61fe('0x87')]};}return db['User'+_0x3e7cb1+_0x61fe('0x77')][_0x61fe('0x8a')](_0x187a93)['then'](function(){socket['emit'](_0x61fe('0x4f')+_0x3e7cb1+_0x61fe('0x8b'),{'UserId':_0x555713,[_0x3e7cb1+_0x61fe('0x88')]:_0xe18fc8['id']});if(_0x3e7cb1!==_0x61fe('0x80')){return;}return db[_0x61fe('0x8c')][_0x61fe('0x8d')]({'where':{'id':_0x29bdc9,'online':0x1},'attributes':['id',_0x61fe('0x2e'),'online',_0x61fe('0x8e'),_0x61fe('0x8f')],'raw':!![]})[_0x61fe('0x47')](function(_0x50a926){var _0x23dab4=_[_0x61fe('0x31')](_0x50a926,function(_0x39687e){return db[_0x61fe('0x90')]['upsert']({'membername':_0x39687e[_0x61fe('0x2e')],'UserId':_0x39687e['id'],'queue_name':_0xe18fc8['name'],'VoiceQueueId':_0xe18fc8['id'],'interface':_['isNil'](_0x39687e[_0x61fe('0x8f')])?util['format'](_0x61fe('0x91'),_0x39687e[_0x61fe('0x2e')]):_0x39687e[_0x61fe('0x8f')],'paused':_0x39687e[_0x61fe('0x8e')]||![],'penalty':_0xe18fc8[_0x61fe('0x89')][_0x61fe('0x87')]},{'transaction':_0x1ff30a});});return Promise[_0x61fe('0x92')](_0x23dab4);});});});return Promise[_0x61fe('0x92')](_0x35238c);});return Promise[_0x61fe('0x92')](_0x2f493c);})[_0x61fe('0x47')](function(){return db[_0x61fe('0x93')][_0x61fe('0x7a')]({'where':{'teamId':_0x2e5e20}})[_0x61fe('0x47')](function(_0x297955){if(_0x297955){var _0x5ec071=_[_0x61fe('0x31')](_0x29bdc9,function(_0x3f6bf2){db[_0x61fe('0x6d')][_0x61fe('0x94')]({'UserId':_0x3f6bf2,'VoicePrefixId':_0x297955[_0x61fe('0x6e')]});});return Promise['all'](_0x5ec071);}});});});return Promise[_0x61fe('0x92')](_0x254d01)[_0x61fe('0x47')](function(){return _0x3beca5[_0x61fe('0x7e')](_0x29bdc9,{'transaction':_0x1ff30a})['spread'](function(_0x378c3c){return _0x378c3c;});});});}})[_0x61fe('0x47')](respondWithResult(_0x327648,null))['catch'](handleError(_0x327648,null));};exports[_0x61fe('0x95')]=function(_0x26b2e8,_0x270e42){var _0x3c2f62=_['isArray'](_0x26b2e8[_0x61fe('0x36')][_0x61fe('0x7d')])?_0x26b2e8[_0x61fe('0x36')][_0x61fe('0x7d')]:[_0x26b2e8[_0x61fe('0x36')][_0x61fe('0x7d')]];var _0x18ebfd=_0x26b2e8[_0x61fe('0x4c')]['id'];return db[_0x61fe('0x32')]['find']({'where':{'id':_0x18ebfd}})[_0x61fe('0x47')](handleEntityNotFound(_0x270e42,null))[_0x61fe('0x47')](function(_0x42c42b){if(_0x42c42b){var _0x29a615=[_0x61fe('0x80'),'Chat','Mail',_0x61fe('0x83'),'Fax','Openchannel','Whatsapp'];return db[_0x61fe('0x58')][_0x61fe('0x85')](function(_0x105c2d){var _0x11ae80=_['map'](_0x29a615,function(_0x1b11c9){var _0xe367ec={'attributes':['id','name']};return _0x42c42b['get'+_0x1b11c9+'Queues'](_0xe367ec)[_0x61fe('0x47')](function(_0x44ffe4){var _0x433e26=_[_0x61fe('0x31')](_0x44ffe4,function(_0x48183f){return _0x48183f[_0x61fe('0x95')](_0x3c2f62,{'transaction':_0x105c2d})[_0x61fe('0x47')](function(){var _0xdc2e1b=_[_0x61fe('0x31')](_0x3c2f62,function(_0xdc821){socket['emit'](_0x61fe('0x4f')+_0x1b11c9+_0x61fe('0x96'),{'UserId':Number(_0xdc821),[_0x1b11c9+_0x61fe('0x88')]:_0x48183f['id']});if(_0x1b11c9!==_0x61fe('0x80')){return;}return db[_0x61fe('0x90')][_0x61fe('0x5d')]({'where':{'VoiceQueueId':_0x48183f['id'],'UserId':_0xdc821},'transaction':_0x105c2d});});return Promise[_0x61fe('0x92')](_0xdc2e1b);});});return Promise[_0x61fe('0x92')](_0x433e26);});});return Promise[_0x61fe('0x92')](_0x11ae80)[_0x61fe('0x47')](function(){return _0x42c42b[_0x61fe('0x95')](_0x3c2f62,{'transaction':_0x105c2d});})['then'](function(){return db['TeamVoicePrefix'][_0x61fe('0x7a')]({'where':{'teamId':_0x18ebfd}})[_0x61fe('0x47')](function(_0x5854a3){if(_0x5854a3){var _0x1e74d0=_[_0x61fe('0x31')](_0x3c2f62,function(_0x3ce678){db[_0x61fe('0x6d')][_0x61fe('0x5d')]({'where':{'UserId':_0x3ce678,'VoicePrefixId':_0x5854a3[_0x61fe('0x6e')]}});});return Promise[_0x61fe('0x92')](_0x1e74d0);}});});});}})[_0x61fe('0x47')](respondWithStatusCode(_0x270e42,null))[_0x61fe('0x4a')](handleError(_0x270e42,null));};exports[_0x61fe('0x97')]=function(_0x378a20,_0x46815a,_0x5d131b){var _0x111326={};var _0x5e453e={};var _0x42df12;var _0x407a73;return db[_0x61fe('0x32')][_0x61fe('0x7a')]({'where':{'id':_0x378a20[_0x61fe('0x4c')]['id']}})[_0x61fe('0x47')](handleEntityNotFound(_0x46815a,null))[_0x61fe('0x47')](function(_0x30a8b5){if(_0x30a8b5){_0x42df12=_0x30a8b5;_0x5e453e[_0x61fe('0x3a')]=_[_0x61fe('0x37')](db[_0x61fe('0x8c')][_0x61fe('0x33')]);_0x5e453e[_0x61fe('0x36')]=_[_0x61fe('0x37')](_0x378a20[_0x61fe('0x36')]);_0x5e453e[_0x61fe('0x38')]=_[_0x61fe('0x39')](_0x5e453e[_0x61fe('0x3a')],_0x5e453e['query']);_0x111326['attributes']=_['intersection'](_0x5e453e['model'],qs[_0x61fe('0x3b')](_0x378a20['query'][_0x61fe('0x3b')]));_0x111326['attributes']=_0x111326['attributes'][_0x61fe('0x3d')]?_0x111326['attributes']:_0x5e453e[_0x61fe('0x3a')];_0x111326[_0x61fe('0x78')]=qs['sort'](_0x378a20[_0x61fe('0x36')][_0x61fe('0x41')]);_0x111326[_0x61fe('0x98')]=qs[_0x61fe('0x38')](_[_0x61fe('0x42')](_0x378a20[_0x61fe('0x36')],_0x5e453e[_0x61fe('0x38')]));if(_0x378a20[_0x61fe('0x36')][_0x61fe('0x43')]){_0x111326[_0x61fe('0x98')]=_[_0x61fe('0x44')](_0x111326[_0x61fe('0x98')],{'$or':_[_0x61fe('0x31')](_0x111326['attributes'],function(_0x53a397){var _0x387ced={};_0x387ced[_0x53a397]={'$like':'%'+_0x378a20[_0x61fe('0x36')][_0x61fe('0x43')]+'%'};return _0x387ced;})});}_0x111326=_[_0x61fe('0x44')]({},_0x111326,_0x378a20[_0x61fe('0x46')]);return _0x42df12['getAgents'](_0x111326);}})[_0x61fe('0x47')](function(_0x105e28){if(_0x105e28){_0x407a73=_0x105e28[_0x61fe('0x3d')];if(!_0x378a20[_0x61fe('0x36')][_0x61fe('0x3e')](_0x61fe('0x3f'))){_0x111326[_0x61fe('0x40')]=qs[_0x61fe('0x40')](_0x378a20[_0x61fe('0x36')][_0x61fe('0x40')]);_0x111326[_0x61fe('0x23')]=qs[_0x61fe('0x23')](_0x378a20[_0x61fe('0x36')]['offset']);}return _0x42df12[_0x61fe('0x97')](_0x111326);}})[_0x61fe('0x47')](function(_0x7bbfa){if(_0x7bbfa){return _0x7bbfa?{'count':_0x407a73,'rows':_0x7bbfa}:null;}})[_0x61fe('0x47')](respondWithResult(_0x46815a,null))[_0x61fe('0x4a')](handleError(_0x46815a,null));};
\ No newline at end of file
+var _0xcc60=['map','query','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','keys','include','find','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','UserProfileSection','userProfileId','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','transaction','Sequelize','QueryTypes','SELECT','UserId','sequelize','VoiceQueueId','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','getQueues','findOne','channel','isValidChannel','ValidationError','capitalize','toLowerCase','Queue','filters','Queues','Unknown\x20channel','add','remove','addAgents','isArray','ids','Chat','Mail','Sms','Fax','Openchannel','Voice','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','online','voicePause','interface','UserVoiceQueueRt','format','all','upsert','VoicePrefixId','Whatsapp','emit','removeAgents','getAgents','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','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','redis','localhost','socket.io-emitter','./team.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','send','index','Team','type','model'];(function(_0x1f7c32,_0x207684){var _0xc1aaa3=function(_0x52b4fc){while(--_0x52b4fc){_0x1f7c32['push'](_0x1f7c32['shift']());}};_0xc1aaa3(++_0x207684);}(_0xcc60,0xfb));var _0x0cc6=function(_0x37413c,_0x3c1792){_0x37413c=_0x37413c-0x0;var _0x46b987=_0xcc60[_0x37413c];return _0x46b987;};'use strict';var emlformat=require(_0x0cc6('0x0'));var rimraf=require(_0x0cc6('0x1'));var zipdir=require(_0x0cc6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0cc6('0x3'));var moment=require(_0x0cc6('0x4'));var BPromise=require(_0x0cc6('0x5'));var Mustache=require(_0x0cc6('0x6'));var util=require(_0x0cc6('0x7'));var path=require(_0x0cc6('0x8'));var sox=require(_0x0cc6('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0cc6('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0cc6('0xb'));var deskjs=require(_0x0cc6('0xc'));var toCsv=require(_0x0cc6('0xd'));var querystring=require(_0x0cc6('0xe'));var Papa=require(_0x0cc6('0xf'));var Redis=require(_0x0cc6('0x10'));var authService=require(_0x0cc6('0x11'));var qs=require(_0x0cc6('0x12'));var as=require(_0x0cc6('0x13'));var hardwareService=require(_0x0cc6('0x14'));var logger=require(_0x0cc6('0x15'))(_0x0cc6('0x16'));var utils=require(_0x0cc6('0x17'));var config=require(_0x0cc6('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x0cc6('0x19')]=_['defaults'](config[_0x0cc6('0x19')],{'host':_0x0cc6('0x1a'),'port':0x18eb});var socket=require(_0x0cc6('0x1b'))(new Redis(config[_0x0cc6('0x19')]));require(_0x0cc6('0x1c'))[_0x0cc6('0x1d')](socket);function respondWithStatusCode(_0x994037,_0x5a9fc3){_0x5a9fc3=_0x5a9fc3||0xcc;return function(_0x56233a){if(_0x56233a){return _0x994037['sendStatus'](_0x5a9fc3);}return _0x994037[_0x0cc6('0x1e')](_0x5a9fc3)[_0x0cc6('0x1f')]();};}function respondWithResult(_0x3883fe,_0x35b183){_0x35b183=_0x35b183||0xc8;return function(_0x20c25f){if(_0x20c25f){return _0x3883fe['status'](_0x35b183)[_0x0cc6('0x20')](_0x20c25f);}};}function respondWithFilteredResult(_0x1d32c4,_0x17bc66){return function(_0x22de64){if(_0x22de64){var _0x44afd3=typeof _0x17bc66['offset']===_0x0cc6('0x21')&&typeof _0x17bc66[_0x0cc6('0x22')]==='undefined';var _0x5bb868=_0x22de64[_0x0cc6('0x23')];var _0x9018af=_0x44afd3?0x0:_0x17bc66[_0x0cc6('0x24')];var _0x27dd6d=_0x44afd3?_0x22de64[_0x0cc6('0x23')]:_0x17bc66[_0x0cc6('0x24')]+_0x17bc66['limit'];var _0x15679c;if(_0x27dd6d>=_0x5bb868){_0x27dd6d=_0x5bb868;_0x15679c=0xc8;}else{_0x15679c=0xce;}_0x1d32c4['status'](_0x15679c);return _0x1d32c4[_0x0cc6('0x25')](_0x0cc6('0x26'),_0x9018af+'-'+_0x27dd6d+'/'+_0x5bb868)['json'](_0x22de64);}return null;};}function patchUpdates(_0x5a43b4){return function(_0x3ddfc3){try{jsonpatch[_0x0cc6('0x27')](_0x3ddfc3,_0x5a43b4,!![]);}catch(_0x27c37e){return BPromise['reject'](_0x27c37e);}return _0x3ddfc3[_0x0cc6('0x28')]();};}function saveUpdates(_0x87cc3e,_0x44da66){return function(_0x1c92ee){if(_0x1c92ee){return _0x1c92ee[_0x0cc6('0x29')](_0x87cc3e)[_0x0cc6('0x2a')](function(_0x576c45){return _0x576c45;});}return null;};}function handleEntityNotFound(_0x135dc9,_0x31389b){return function(_0x3fab94){if(!_0x3fab94){_0x135dc9['sendStatus'](0x194);}return _0x3fab94;};}function handleError(_0x5b874b,_0x1a3575){_0x1a3575=_0x1a3575||0x1f4;return function(_0x4e7190){logger[_0x0cc6('0x2b')](_0x4e7190[_0x0cc6('0x2c')]);if(_0x4e7190['name']){delete _0x4e7190[_0x0cc6('0x2d')];}_0x5b874b[_0x0cc6('0x1e')](_0x1a3575)[_0x0cc6('0x2e')](_0x4e7190);};}exports[_0x0cc6('0x2f')]=function(_0x4a79d9,_0x464144){var _0x5d1570={},_0x1a2b89={},_0x47d284={'count':0x0,'rows':[]};var _0x30fdb9=_['map'](db[_0x0cc6('0x30')]['rawAttributes'],function(_0x5aeda0){return{'name':_0x5aeda0['fieldName'],'type':_0x5aeda0[_0x0cc6('0x31')]['key']};});_0x1a2b89[_0x0cc6('0x32')]=_[_0x0cc6('0x33')](_0x30fdb9,_0x0cc6('0x2d'));_0x1a2b89[_0x0cc6('0x34')]=_['keys'](_0x4a79d9[_0x0cc6('0x34')]);_0x1a2b89['filters']=_[_0x0cc6('0x35')](_0x1a2b89[_0x0cc6('0x32')],_0x1a2b89[_0x0cc6('0x34')]);_0x5d1570[_0x0cc6('0x36')]=_['intersection'](_0x1a2b89[_0x0cc6('0x32')],qs[_0x0cc6('0x37')](_0x4a79d9[_0x0cc6('0x34')][_0x0cc6('0x37')]));_0x5d1570['attributes']=_0x5d1570['attributes'][_0x0cc6('0x38')]?_0x5d1570[_0x0cc6('0x36')]:_0x1a2b89[_0x0cc6('0x32')];if(!_0x4a79d9[_0x0cc6('0x34')]['hasOwnProperty'](_0x0cc6('0x39'))){_0x5d1570[_0x0cc6('0x22')]=qs[_0x0cc6('0x22')](_0x4a79d9['query'][_0x0cc6('0x22')]);_0x5d1570[_0x0cc6('0x24')]=qs['offset'](_0x4a79d9[_0x0cc6('0x34')][_0x0cc6('0x24')]);}_0x5d1570[_0x0cc6('0x3a')]=qs[_0x0cc6('0x3b')](_0x4a79d9[_0x0cc6('0x34')][_0x0cc6('0x3b')]);_0x5d1570[_0x0cc6('0x3c')]=qs['filters'](_[_0x0cc6('0x3d')](_0x4a79d9['query'],_0x1a2b89['filters']),_0x30fdb9);if(_0x4a79d9[_0x0cc6('0x34')][_0x0cc6('0x3e')]){_0x5d1570['where']=_[_0x0cc6('0x3f')](_0x5d1570[_0x0cc6('0x3c')],{'$or':_['map'](_0x30fdb9,function(_0x5dfc0d){if(_0x5dfc0d[_0x0cc6('0x31')]!==_0x0cc6('0x40')){var _0x1a91c9={};_0x1a91c9[_0x5dfc0d[_0x0cc6('0x2d')]]={'$like':'%'+_0x4a79d9['query'][_0x0cc6('0x3e')]+'%'};return _0x1a91c9;}})});}_0x5d1570=_[_0x0cc6('0x3f')]({},_0x5d1570,_0x4a79d9[_0x0cc6('0x41')]);var _0x154c30={'where':_0x5d1570['where']};return db[_0x0cc6('0x30')][_0x0cc6('0x23')](_0x154c30)['then'](function(_0x1d83ec){_0x47d284[_0x0cc6('0x23')]=_0x1d83ec;if(_0x4a79d9[_0x0cc6('0x34')][_0x0cc6('0x42')]){_0x5d1570['include']=[{'all':!![]}];}return db[_0x0cc6('0x30')][_0x0cc6('0x43')](_0x5d1570);})[_0x0cc6('0x2a')](function(_0x46b690){_0x47d284[_0x0cc6('0x44')]=_0x46b690;return _0x47d284;})[_0x0cc6('0x2a')](respondWithFilteredResult(_0x464144,_0x5d1570))[_0x0cc6('0x45')](handleError(_0x464144,null));};exports[_0x0cc6('0x46')]=function(_0x498026,_0x3e2917){var _0x5e1fdd={'raw':![],'where':{'id':_0x498026[_0x0cc6('0x47')]['id']}},_0x152d30={};_0x152d30[_0x0cc6('0x32')]=_['keys'](db['Team'][_0x0cc6('0x48')]);_0x152d30[_0x0cc6('0x34')]=_[_0x0cc6('0x49')](_0x498026[_0x0cc6('0x34')]);_0x152d30['filters']=_[_0x0cc6('0x35')](_0x152d30[_0x0cc6('0x32')],_0x152d30[_0x0cc6('0x34')]);_0x5e1fdd[_0x0cc6('0x36')]=_['intersection'](_0x152d30[_0x0cc6('0x32')],qs[_0x0cc6('0x37')](_0x498026[_0x0cc6('0x34')]['fields']));_0x5e1fdd['attributes']=_0x5e1fdd[_0x0cc6('0x36')]['length']?_0x5e1fdd[_0x0cc6('0x36')]:_0x152d30[_0x0cc6('0x32')];if(_0x498026[_0x0cc6('0x34')]['includeAll']){_0x5e1fdd[_0x0cc6('0x4a')]=[{'all':!![]}];}_0x5e1fdd=_[_0x0cc6('0x3f')]({},_0x5e1fdd,_0x498026[_0x0cc6('0x41')]);return db['Team'][_0x0cc6('0x4b')](_0x5e1fdd)[_0x0cc6('0x2a')](handleEntityNotFound(_0x3e2917,null))['then'](respondWithResult(_0x3e2917,null))[_0x0cc6('0x45')](handleError(_0x3e2917,null));};exports['create']=function(_0x7d48e7,_0x5957da){return db[_0x0cc6('0x30')]['create'](_0x7d48e7['body'],{})[_0x0cc6('0x2a')](function(_0x5a1b41){var _0x404eea=_0x7d48e7[_0x0cc6('0x4c')][_0x0cc6('0x4d')]({'plain':!![]});if(!_0x404eea)throw new Error(_0x0cc6('0x4e'));if(_0x404eea['role']==='user'){var _0x52bbfd=_0x5a1b41[_0x0cc6('0x4d')]({'plain':!![]});var _0x52eb3a=_0x0cc6('0x4f');return db[_0x0cc6('0x50')][_0x0cc6('0x4b')]({'where':{'name':_0x52eb3a,'userProfileId':_0x404eea[_0x0cc6('0x51')]},'raw':!![]})[_0x0cc6('0x2a')](function(_0x4ef91e){if(_0x4ef91e&&_0x4ef91e['autoAssociation']===0x0){return db[_0x0cc6('0x52')][_0x0cc6('0x53')]({'name':_0x52bbfd['name'],'resourceId':_0x52bbfd['id'],'type':_0x4ef91e[_0x0cc6('0x2d')],'sectionId':_0x4ef91e['id']},{})[_0x0cc6('0x2a')](function(){return _0x5a1b41;});}else{return _0x5a1b41;}})[_0x0cc6('0x45')](function(_0x6243c4){logger[_0x0cc6('0x2b')](_0x0cc6('0x54'),_0x6243c4);throw _0x6243c4;});}return _0x5a1b41;})[_0x0cc6('0x2a')](respondWithResult(_0x5957da,0xc9))[_0x0cc6('0x45')](handleError(_0x5957da,null));};exports[_0x0cc6('0x29')]=function(_0x10f961,_0x483c1e){if(_0x10f961[_0x0cc6('0x55')]['id']){delete _0x10f961[_0x0cc6('0x55')]['id'];}return db['Team'][_0x0cc6('0x4b')]({'where':{'id':_0x10f961[_0x0cc6('0x47')]['id']}})[_0x0cc6('0x2a')](handleEntityNotFound(_0x483c1e,null))[_0x0cc6('0x2a')](saveUpdates(_0x10f961[_0x0cc6('0x55')],null))['then'](respondWithResult(_0x483c1e,null))[_0x0cc6('0x45')](handleError(_0x483c1e,null));};exports[_0x0cc6('0x56')]=function(_0x36c55e,_0x2878a9){var _0x34b5da=_0x36c55e[_0x0cc6('0x47')]['id'];var _0x50ce79=[];return db['sequelize'][_0x0cc6('0x57')](function(_0x3eb9a7){var _0x26c827='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x34b5da;return db['sequelize'][_0x0cc6('0x34')](_0x26c827,{'type':db[_0x0cc6('0x58')][_0x0cc6('0x59')][_0x0cc6('0x5a')],'raw':!![],'transaction':_0x3eb9a7})[_0x0cc6('0x2a')](function(_0x1938e2){_0x50ce79=_[_0x0cc6('0x33')](_0x1938e2,function(_0x13db9e){return Number(_0x13db9e[_0x0cc6('0x5b')]);});})[_0x0cc6('0x2a')](function(){var _0x271f42='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x34b5da;return db[_0x0cc6('0x5c')][_0x0cc6('0x34')](_0x271f42,{'type':db['Sequelize'][_0x0cc6('0x59')][_0x0cc6('0x5a')],'raw':!![],'transaction':_0x3eb9a7});})[_0x0cc6('0x2a')](function(_0x23738b){var _0x40d8f9=_[_0x0cc6('0x33')](_0x23738b,function(_0x105dae){return Number(_0x105dae[_0x0cc6('0x5d')]);});return db['UserVoiceQueue'][_0x0cc6('0x56')]({'where':{'UserId':{'$in':_0x50ce79},'VoiceQueueId':{'$in':_0x40d8f9}},'transaction':_0x3eb9a7});})[_0x0cc6('0x2a')](function(){var _0x1ff6bd='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x34b5da;return db['sequelize'][_0x0cc6('0x34')](_0x1ff6bd,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x3eb9a7});})[_0x0cc6('0x2a')](function(_0x2bb383){var _0x3c3a17=_[_0x0cc6('0x33')](_0x2bb383,function(_0x41299f){return Number(_0x41299f[_0x0cc6('0x5e')]);});return db[_0x0cc6('0x5f')]['destroy']({'where':{'UserId':{'$in':_0x50ce79},'MailQueueId':{'$in':_0x3c3a17}},'transaction':_0x3eb9a7});})[_0x0cc6('0x2a')](function(){var _0x246fdb=_0x0cc6('0x60')+_0x34b5da;return db[_0x0cc6('0x5c')][_0x0cc6('0x34')](_0x246fdb,{'type':db[_0x0cc6('0x58')][_0x0cc6('0x59')]['SELECT'],'raw':!![],'transaction':_0x3eb9a7});})[_0x0cc6('0x2a')](function(_0x10f3fb){var _0x4bf2f5=_[_0x0cc6('0x33')](_0x10f3fb,function(_0x2a75f4){return Number(_0x2a75f4[_0x0cc6('0x61')]);});return db[_0x0cc6('0x62')][_0x0cc6('0x56')]({'where':{'UserId':{'$in':_0x50ce79},'SmsQueueId':{'$in':_0x4bf2f5}},'transaction':_0x3eb9a7});})['then'](function(){var _0x18ece1=_0x0cc6('0x63')+_0x34b5da;return db[_0x0cc6('0x5c')][_0x0cc6('0x34')](_0x18ece1,{'type':db[_0x0cc6('0x58')][_0x0cc6('0x59')][_0x0cc6('0x5a')],'raw':!![],'transaction':_0x3eb9a7});})['then'](function(_0x301904){var _0x1b46ff=_[_0x0cc6('0x33')](_0x301904,function(_0x43eae1){return Number(_0x43eae1[_0x0cc6('0x64')]);});return db[_0x0cc6('0x65')][_0x0cc6('0x56')]({'where':{'UserId':{'$in':_0x50ce79},'ChatQueueId':{'$in':_0x1b46ff}},'transaction':_0x3eb9a7});})['then'](function(){var _0x50a60e=_0x0cc6('0x66')+_0x34b5da;return db['sequelize'][_0x0cc6('0x34')](_0x50a60e,{'type':db[_0x0cc6('0x58')][_0x0cc6('0x59')][_0x0cc6('0x5a')],'raw':!![],'transaction':_0x3eb9a7});})[_0x0cc6('0x2a')](function(_0x1b3c73){var _0x6b3e66=_[_0x0cc6('0x33')](_0x1b3c73,function(_0x4d14b3){return Number(_0x4d14b3['FaxQueueId']);});return db['UserFaxQueue'][_0x0cc6('0x56')]({'where':{'UserId':{'$in':_0x50ce79},'FaxQueueId':{'$in':_0x6b3e66}},'transaction':_0x3eb9a7});})['then'](function(){var _0x5bbdc0=_0x0cc6('0x67')+_0x34b5da;return db['sequelize'][_0x0cc6('0x34')](_0x5bbdc0,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x3eb9a7});})[_0x0cc6('0x2a')](function(_0x40b13c){var _0x2f1b06=_[_0x0cc6('0x33')](_0x40b13c,function(_0x4f9145){return Number(_0x4f9145[_0x0cc6('0x68')]);});return db[_0x0cc6('0x69')][_0x0cc6('0x56')]({'where':{'UserId':{'$in':_0x50ce79},'OpenchannelQueueId':{'$in':_0x2f1b06}},'transaction':_0x3eb9a7});})[_0x0cc6('0x2a')](function(){var _0x4f1e58=_0x0cc6('0x6a')+_0x34b5da;return db['sequelize'][_0x0cc6('0x34')](_0x4f1e58,{'type':db['Sequelize'][_0x0cc6('0x59')][_0x0cc6('0x5a')],'raw':!![],'transaction':_0x3eb9a7});})[_0x0cc6('0x2a')](function(_0x28c802){var _0x1da5c6=_[_0x0cc6('0x33')](_0x28c802,function(_0x416b08){return Number(_0x416b08[_0x0cc6('0x6b')]);});return db['UserWhatsappQueue'][_0x0cc6('0x56')]({'where':{'UserId':{'$in':_0x50ce79},'WhatsappQueueId':{'$in':_0x1da5c6}},'transaction':_0x3eb9a7});})['then'](function(){return db[_0x0cc6('0x6c')][_0x0cc6('0x4b')]({'where':{'TeamId':_0x34b5da}});})[_0x0cc6('0x2a')](function(_0x10df4a){if(_0x10df4a===null){return;}return db[_0x0cc6('0x6d')][_0x0cc6('0x56')]({'where':{'UserId':{'$in':_0x50ce79},'VoicePrefixId':_0x10df4a['VoicePrefixId']},'transaction':_0x3eb9a7});})[_0x0cc6('0x2a')](function(){return db[_0x0cc6('0x30')]['destroy']({'where':{'id':_0x34b5da},'cascade':!![],'transaction':_0x3eb9a7});})[_0x0cc6('0x2a')](function(_0x406b74){if(_0x406b74===0x0){_0x2878a9['sendStatus'](0x194);}else{return db[_0x0cc6('0x52')]['destroy']({'where':{'type':_0x0cc6('0x4f'),'resourceId':_0x34b5da},'cascade':!![],'transaction':_0x3eb9a7})['then'](function(){_0x2878a9['status'](0xcc)[_0x0cc6('0x1f')]();});}})['catch'](function(_0x52f4b2){_0x2878a9[_0x0cc6('0x1e')](0x1f4)[_0x0cc6('0x2e')](_0x52f4b2);});});};exports[_0x0cc6('0x6e')]=function(_0x122de0,_0x3ac515,_0x57ae2a){return db['Team'][_0x0cc6('0x6f')]({'where':{'id':_0x122de0['params']['id']}})[_0x0cc6('0x2a')](handleEntityNotFound(_0x3ac515,null))[_0x0cc6('0x2a')](function(_0x18e25b){if(!_0x122de0[_0x0cc6('0x34')][_0x0cc6('0x70')]||!utils[_0x0cc6('0x71')](_0x122de0[_0x0cc6('0x34')][_0x0cc6('0x70')])){throw new db['Sequelize'][(_0x0cc6('0x72'))]('Unknown\x20channel');}var _0x461179={};var _0x424194={};_0x424194[_0x0cc6('0x32')]=_[_0x0cc6('0x49')](db[_[_0x0cc6('0x73')](_0x122de0[_0x0cc6('0x34')][_0x0cc6('0x70')][_0x0cc6('0x74')]())+_0x0cc6('0x75')][_0x0cc6('0x48')]);_0x424194['query']=_['keys'](_0x122de0[_0x0cc6('0x34')]);_0x424194[_0x0cc6('0x76')]=_[_0x0cc6('0x35')](_0x424194['model'],_0x424194['query']);_0x461179[_0x0cc6('0x36')]=_[_0x0cc6('0x35')](_0x424194['model'],qs['fields'](_0x122de0['query'][_0x0cc6('0x37')]));_0x461179[_0x0cc6('0x36')]=_0x461179['attributes']['length']?_0x461179['attributes']:_0x424194['model'];_0x461179['limit']=qs[_0x0cc6('0x22')](_0x122de0[_0x0cc6('0x34')][_0x0cc6('0x22')]);_0x461179[_0x0cc6('0x24')]=qs[_0x0cc6('0x24')](_0x122de0[_0x0cc6('0x34')]['offset']);_0x461179[_0x0cc6('0x3a')]=qs[_0x0cc6('0x3b')](_0x122de0[_0x0cc6('0x34')]['sort']);_0x461179[_0x0cc6('0x3c')]=qs[_0x0cc6('0x76')](_[_0x0cc6('0x3d')](_0x122de0['query'],_0x424194['filters']));_0x461179=_['merge']({},_0x461179,_0x122de0['options']);return _0x18e25b[_0x0cc6('0x4d')+_[_0x0cc6('0x73')](_0x122de0[_0x0cc6('0x34')][_0x0cc6('0x70')]['toLowerCase']())+_0x0cc6('0x77')](_0x461179);})[_0x0cc6('0x2a')](respondWithResult(_0x3ac515,null))[_0x0cc6('0x45')](handleError(_0x3ac515,null));};exports['addQueues']=function(_0x43c61f,_0x2249db,_0x4c8d46){return db[_0x0cc6('0x30')][_0x0cc6('0x6f')]({'where':{'id':_0x43c61f[_0x0cc6('0x47')]['id']}})[_0x0cc6('0x2a')](function(_0x8020af){if(_0x8020af){if(!_0x43c61f[_0x0cc6('0x55')]['channel']||!utils['isValidChannel'](_0x43c61f[_0x0cc6('0x55')][_0x0cc6('0x70')])){throw new db[(_0x0cc6('0x58'))]['ValidationError'](_0x0cc6('0x78'));}return _0x8020af[_0x0cc6('0x79')+_[_0x0cc6('0x73')](_0x43c61f[_0x0cc6('0x55')][_0x0cc6('0x70')]['toLowerCase']())+_0x0cc6('0x77')](_0x43c61f[_0x0cc6('0x55')]['ids']);}return null;})[_0x0cc6('0x2a')](handleEntityNotFound(_0x2249db,null))['then'](respondWithStatusCode(_0x2249db,null))['catch'](handleError(_0x2249db,null));};exports['removeQueues']=function(_0xc4303d,_0xb64764,_0x5f2332){return db[_0x0cc6('0x30')][_0x0cc6('0x6f')]({'where':{'id':_0xc4303d[_0x0cc6('0x47')]['id']}})[_0x0cc6('0x2a')](function(_0xbbf458){if(_0xbbf458){if(!_0xc4303d[_0x0cc6('0x34')][_0x0cc6('0x70')]||!utils['isValidChannel'](_0xc4303d[_0x0cc6('0x34')]['channel'])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}return _0xbbf458[_0x0cc6('0x7a')+_['capitalize'](_0xc4303d[_0x0cc6('0x34')]['channel']['toLowerCase']())+_0x0cc6('0x77')](_0xc4303d[_0x0cc6('0x34')]['ids']);}return null;})[_0x0cc6('0x2a')](handleEntityNotFound(_0xb64764,null))[_0x0cc6('0x2a')](respondWithStatusCode(_0xb64764,null))[_0x0cc6('0x45')](handleError(_0xb64764,null));};exports[_0x0cc6('0x7b')]=function(_0x32f60d,_0x195b5f){var _0x3a8290=_[_0x0cc6('0x7c')](_0x32f60d[_0x0cc6('0x55')]['ids'])?_0x32f60d[_0x0cc6('0x55')]['ids']:[_0x32f60d[_0x0cc6('0x55')][_0x0cc6('0x7d')]];var _0x3c4886=_0x32f60d['params']['id'];return db[_0x0cc6('0x30')]['find']({'where':{'id':_0x3c4886}})['then'](handleEntityNotFound(_0x195b5f,null))['then'](function(_0x3e68fe){if(_0x3e68fe){var _0x4c6c11=['Voice',_0x0cc6('0x7e'),_0x0cc6('0x7f'),_0x0cc6('0x80'),_0x0cc6('0x81'),_0x0cc6('0x82'),'Whatsapp'];return db['sequelize'][_0x0cc6('0x57')](function(_0x516d90){var _0x4363ee=_[_0x0cc6('0x33')](_0x4c6c11,function(_0x2590af){var _0x20ce44={'attributes':['id',_0x0cc6('0x2d')]};if(_0x2590af===_0x0cc6('0x83')){_0x20ce44[_0x0cc6('0x84')]={'attributes':[_0x0cc6('0x85')]};}return _0x3e68fe[_0x0cc6('0x4d')+_0x2590af+_0x0cc6('0x77')](_0x20ce44)[_0x0cc6('0x2a')](function(_0x24f9db){var _0x24db7e=_[_0x0cc6('0x33')](_0x24f9db,function(_0x5cf697){var _0x2cc7ac=_[_0x0cc6('0x33')](_0x3a8290,function(_0x5768a9){var _0x5e6664={'where':{'UserId':_0x5768a9,[_0x2590af+_0x0cc6('0x86')]:_0x5cf697['id']},'transaction':_0x516d90};if(_0x2590af==='Voice'){_0x5e6664['defaults']={'penalty':_0x5cf697[_0x0cc6('0x87')][_0x0cc6('0x85')]};}return db[_0x0cc6('0x88')+_0x2590af+_0x0cc6('0x75')][_0x0cc6('0x89')](_0x5e6664)[_0x0cc6('0x2a')](function(){socket['emit'](_0x0cc6('0x4c')+_0x2590af+'Queue:save',{'UserId':_0x5768a9,[_0x2590af+_0x0cc6('0x86')]:_0x5cf697['id']});if(_0x2590af!==_0x0cc6('0x83')){return;}return db[_0x0cc6('0x88')]['findAll']({'where':{'id':_0x3a8290,'online':0x1},'attributes':['id',_0x0cc6('0x2d'),_0x0cc6('0x8a'),_0x0cc6('0x8b'),_0x0cc6('0x8c')],'raw':!![]})[_0x0cc6('0x2a')](function(_0x18dc92){var _0x304b63=_[_0x0cc6('0x33')](_0x18dc92,function(_0x946b38){return db[_0x0cc6('0x8d')]['upsert']({'membername':_0x946b38[_0x0cc6('0x2d')],'UserId':_0x946b38['id'],'queue_name':_0x5cf697[_0x0cc6('0x2d')],'VoiceQueueId':_0x5cf697['id'],'interface':_['isNil'](_0x946b38[_0x0cc6('0x8c')])?util[_0x0cc6('0x8e')]('SIP/%s',_0x946b38[_0x0cc6('0x2d')]):_0x946b38[_0x0cc6('0x8c')],'paused':_0x946b38[_0x0cc6('0x8b')]||![],'penalty':_0x5cf697[_0x0cc6('0x87')][_0x0cc6('0x85')]},{'transaction':_0x516d90});});return Promise[_0x0cc6('0x8f')](_0x304b63);});});});return Promise[_0x0cc6('0x8f')](_0x2cc7ac);});return Promise[_0x0cc6('0x8f')](_0x24db7e);})['then'](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x3c4886}})[_0x0cc6('0x2a')](function(_0x35f84c){if(_0x35f84c){var _0x525290=_[_0x0cc6('0x33')](_0x3a8290,function(_0x2be4ba){db[_0x0cc6('0x6d')][_0x0cc6('0x90')]({'UserId':_0x2be4ba,'VoicePrefixId':_0x35f84c[_0x0cc6('0x91')]});});return Promise[_0x0cc6('0x8f')](_0x525290);}});});});return Promise[_0x0cc6('0x8f')](_0x4363ee)[_0x0cc6('0x2a')](function(){return _0x3e68fe[_0x0cc6('0x7b')](_0x3a8290,{'transaction':_0x516d90})['spread'](function(_0x5bc8a1){return _0x5bc8a1;});});});}})[_0x0cc6('0x2a')](respondWithResult(_0x195b5f,null))['catch'](handleError(_0x195b5f,null));};exports['removeAgents']=function(_0x539e9e,_0x48a9ad){var _0x170a4e=_[_0x0cc6('0x7c')](_0x539e9e[_0x0cc6('0x34')]['ids'])?_0x539e9e[_0x0cc6('0x34')][_0x0cc6('0x7d')]:[_0x539e9e[_0x0cc6('0x34')]['ids']];var _0x4962fe=_0x539e9e['params']['id'];return db[_0x0cc6('0x30')][_0x0cc6('0x4b')]({'where':{'id':_0x4962fe}})['then'](handleEntityNotFound(_0x48a9ad,null))[_0x0cc6('0x2a')](function(_0x18f016){if(_0x18f016){var _0x30978d=['Voice',_0x0cc6('0x7e'),_0x0cc6('0x7f'),_0x0cc6('0x80'),_0x0cc6('0x81'),_0x0cc6('0x82'),_0x0cc6('0x92')];return db[_0x0cc6('0x5c')][_0x0cc6('0x57')](function(_0x45f965){var _0x26591a=_['map'](_0x30978d,function(_0x483b2b){var _0x4f35c7={'attributes':['id','name']};return _0x18f016[_0x0cc6('0x4d')+_0x483b2b+_0x0cc6('0x77')](_0x4f35c7)['then'](function(_0x59a2bc){var _0x3bc77a=_[_0x0cc6('0x33')](_0x59a2bc,function(_0x634f28){return _0x634f28['removeAgents'](_0x170a4e,{'transaction':_0x45f965})[_0x0cc6('0x2a')](function(){var _0x33f4da=_[_0x0cc6('0x33')](_0x170a4e,function(_0x3b8d82){socket[_0x0cc6('0x93')](_0x0cc6('0x4c')+_0x483b2b+'Queue:remove',{'UserId':Number(_0x3b8d82),[_0x483b2b+'QueueId']:_0x634f28['id']});if(_0x483b2b!=='Voice'){return;}return db[_0x0cc6('0x8d')]['destroy']({'where':{'VoiceQueueId':_0x634f28['id'],'UserId':_0x3b8d82},'transaction':_0x45f965});});return Promise[_0x0cc6('0x8f')](_0x33f4da);});});return Promise['all'](_0x3bc77a);});});return Promise[_0x0cc6('0x8f')](_0x26591a)[_0x0cc6('0x2a')](function(){return _0x18f016[_0x0cc6('0x94')](_0x170a4e,{'transaction':_0x45f965});})[_0x0cc6('0x2a')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x4962fe}})[_0x0cc6('0x2a')](function(_0x46c494){if(_0x46c494){var _0x4c84de=_[_0x0cc6('0x33')](_0x170a4e,function(_0x16ce6a){db['UserVoicePrefix'][_0x0cc6('0x56')]({'where':{'UserId':_0x16ce6a,'VoicePrefixId':_0x46c494[_0x0cc6('0x91')]}});});return Promise[_0x0cc6('0x8f')](_0x4c84de);}});});});}})[_0x0cc6('0x2a')](respondWithStatusCode(_0x48a9ad,null))[_0x0cc6('0x45')](handleError(_0x48a9ad,null));};exports[_0x0cc6('0x95')]=function(_0x375ba6,_0x467612,_0x544686){var _0x36313d={};var _0x3fa4c7={};var _0x2b8bb1;var _0x19c4c7;return db[_0x0cc6('0x30')]['findOne']({'where':{'id':_0x375ba6['params']['id']}})[_0x0cc6('0x2a')](handleEntityNotFound(_0x467612,null))[_0x0cc6('0x2a')](function(_0x2e66c1){if(_0x2e66c1){_0x2b8bb1=_0x2e66c1;_0x3fa4c7[_0x0cc6('0x32')]=_[_0x0cc6('0x49')](db[_0x0cc6('0x88')][_0x0cc6('0x48')]);_0x3fa4c7[_0x0cc6('0x34')]=_[_0x0cc6('0x49')](_0x375ba6['query']);_0x3fa4c7[_0x0cc6('0x76')]=_[_0x0cc6('0x35')](_0x3fa4c7['model'],_0x3fa4c7[_0x0cc6('0x34')]);_0x36313d[_0x0cc6('0x36')]=_[_0x0cc6('0x35')](_0x3fa4c7[_0x0cc6('0x32')],qs[_0x0cc6('0x37')](_0x375ba6[_0x0cc6('0x34')]['fields']));_0x36313d[_0x0cc6('0x36')]=_0x36313d['attributes'][_0x0cc6('0x38')]?_0x36313d[_0x0cc6('0x36')]:_0x3fa4c7[_0x0cc6('0x32')];_0x36313d['order']=qs[_0x0cc6('0x3b')](_0x375ba6[_0x0cc6('0x34')][_0x0cc6('0x3b')]);_0x36313d['where']=qs['filters'](_[_0x0cc6('0x3d')](_0x375ba6[_0x0cc6('0x34')],_0x3fa4c7['filters']));if(_0x375ba6[_0x0cc6('0x34')]['filter']){_0x36313d['where']=_[_0x0cc6('0x3f')](_0x36313d[_0x0cc6('0x3c')],{'$or':_[_0x0cc6('0x33')](_0x36313d[_0x0cc6('0x36')],function(_0x5d8b83){var _0x1d631e={};_0x1d631e[_0x5d8b83]={'$like':'%'+_0x375ba6[_0x0cc6('0x34')]['filter']+'%'};return _0x1d631e;})});}_0x36313d=_[_0x0cc6('0x3f')]({},_0x36313d,_0x375ba6['options']);return _0x2b8bb1['getAgents'](_0x36313d);}})[_0x0cc6('0x2a')](function(_0x3226b6){if(_0x3226b6){_0x19c4c7=_0x3226b6[_0x0cc6('0x38')];if(!_0x375ba6['query'][_0x0cc6('0x96')](_0x0cc6('0x39'))){_0x36313d[_0x0cc6('0x22')]=qs[_0x0cc6('0x22')](_0x375ba6[_0x0cc6('0x34')][_0x0cc6('0x22')]);_0x36313d[_0x0cc6('0x24')]=qs[_0x0cc6('0x24')](_0x375ba6['query'][_0x0cc6('0x24')]);}return _0x2b8bb1[_0x0cc6('0x95')](_0x36313d);}})['then'](function(_0x3c719a){if(_0x3c719a){return _0x3c719a?{'count':_0x19c4c7,'rows':_0x3c719a}:null;}})[_0x0cc6('0x2a')](respondWithResult(_0x467612,null))[_0x0cc6('0x45')](handleError(_0x467612,null));};
\ No newline at end of file
index 01384cd..ad38a6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee06=['../../mysqldb','Team','setMaxListeners','update','remove','hook','exports','events'];(function(_0x147822,_0xd6bdcd){var _0x555c9e=function(_0x4ec42d){while(--_0x4ec42d){_0x147822['push'](_0x147822['shift']());}};_0x555c9e(++_0xd6bdcd);}(_0xee06,0x19f));var _0x6ee0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xee06[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x6ee0('0x0'));var Team=require(_0x6ee0('0x1'))['db'][_0x6ee0('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x6ee0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6ee0('0x4'),'afterDestroy':_0x6ee0('0x5')};function emitEvent(_0x11dcd3){return function(_0x3f660c,_0x36ed40,_0x435564){TeamEvents['emit'](_0x11dcd3+':'+_0x3f660c['id'],_0x3f660c);TeamEvents['emit'](_0x11dcd3,_0x3f660c);_0x435564(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x6ee0('0x6')](e,emitEvent(event));}}module[_0x6ee0('0x7')]=TeamEvents;
\ No newline at end of file
+var _0xc875=['save','update','remove','hasOwnProperty','hook','exports','events','../../mysqldb','Team','setMaxListeners'];(function(_0x2859ad,_0x3bf6fe){var _0x35f66c=function(_0x21d695){while(--_0x21d695){_0x2859ad['push'](_0x2859ad['shift']());}};_0x35f66c(++_0x3bf6fe);}(_0xc875,0x1d2));var _0x5c87=function(_0x15b386,_0x22e407){_0x15b386=_0x15b386-0x0;var _0x4a743a=_0xc875[_0x15b386];return _0x4a743a;};'use strict';var EventEmitter=require(_0x5c87('0x0'));var Team=require(_0x5c87('0x1'))['db'][_0x5c87('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x5c87('0x3')](0x0);var events={'afterCreate':_0x5c87('0x4'),'afterUpdate':_0x5c87('0x5'),'afterDestroy':_0x5c87('0x6')};function emitEvent(_0x1c290b){return function(_0x3d9963,_0x67b94d,_0xbbd36b){TeamEvents['emit'](_0x1c290b+':'+_0x3d9963['id'],_0x3d9963);TeamEvents['emit'](_0x1c290b,_0x3d9963);_0xbbd36b(null);};}for(var e in events){if(events[_0x5c87('0x7')](e)){var event=events[e];Team[_0x5c87('0x8')](e,emitEvent(event));}}module[_0x5c87('0x9')]=TeamEvents;
\ No newline at end of file
index 8e4efa2..35ecdae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1fa=['Voice','Whatsapp','resolve','get','then','map','setDataValue','channel','catch','exports','define','Team','teams','Chat','Mail','Openchannel','Sms'];(function(_0x4bdf64,_0x3022b2){var _0x9a1a19=function(_0x4e551b){while(--_0x4e551b){_0x4bdf64['push'](_0x4bdf64['shift']());}};_0x9a1a19(++_0x3022b2);}(_0xd1fa,0x1ce));var _0xad1f=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xd1fa[_0x334841];return _0x5beb4b;};'use strict';var _=require('lodash');var attributes=require('./team.attributes');function getQueuesByChannel(_0x3c95e6,_0x11794c){var _0x296caf=_0xad1f('0x0')+_0x11794c+'Queues';return _0x3c95e6[_0x296caf]()[_0xad1f('0x1')](function(_0x839a23){return _[_0xad1f('0x2')](_0x839a23,function(_0x437d93){_0x437d93[_0xad1f('0x3')](_0xad1f('0x4'),_0x11794c);return _0x437d93;});})[_0xad1f('0x5')](function(_0x415c35){throw _0x415c35;});}module[_0xad1f('0x6')]=function(_0x2d6907){return _0x2d6907[_0xad1f('0x7')](_0xad1f('0x8'),attributes,{'tableName':_0xad1f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x1bff79=this;var _0x19e520=[_0xad1f('0xa'),'Fax',_0xad1f('0xb'),_0xad1f('0xc'),_0xad1f('0xd'),_0xad1f('0xe'),_0xad1f('0xf')];return Promise[_0xad1f('0x10')]()[_0xad1f('0x1')](function(){var _0x26ce04=_[_0xad1f('0x2')](_0x19e520,function(_0x3ebdb0){return getQueuesByChannel(_0x1bff79,_0x3ebdb0);});return Promise['all'](_0x26ce04);})[_0xad1f('0x5')](function(_0x549781){throw _0x549781;});}}});};
\ No newline at end of file
+var _0xf72f=['lodash','./team.attributes','get','Queues','then','map','setDataValue','channel','catch','exports','define','Chat','Fax','Openchannel','Sms','Voice','Whatsapp','resolve','all'];(function(_0x5b6b8b,_0x50948a){var _0x26a7f0=function(_0x27ed94){while(--_0x27ed94){_0x5b6b8b['push'](_0x5b6b8b['shift']());}};_0x26a7f0(++_0x50948a);}(_0xf72f,0x143));var _0xff72=function(_0x51179d,_0x4c546d){_0x51179d=_0x51179d-0x0;var _0x32850c=_0xf72f[_0x51179d];return _0x32850c;};'use strict';var _=require(_0xff72('0x0'));var attributes=require(_0xff72('0x1'));function getQueuesByChannel(_0xd09068,_0x4f1fbe){var _0x44ae3c=_0xff72('0x2')+_0x4f1fbe+_0xff72('0x3');return _0xd09068[_0x44ae3c]()[_0xff72('0x4')](function(_0x5b3943){return _[_0xff72('0x5')](_0x5b3943,function(_0x391608){_0x391608[_0xff72('0x6')](_0xff72('0x7'),_0x4f1fbe);return _0x391608;});})[_0xff72('0x8')](function(_0x1c0ff0){throw _0x1c0ff0;});}module[_0xff72('0x9')]=function(_0x244d08){return _0x244d08[_0xff72('0xa')]('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x451b31=this;var _0x8e2b1e=[_0xff72('0xb'),_0xff72('0xc'),'Mail',_0xff72('0xd'),_0xff72('0xe'),_0xff72('0xf'),_0xff72('0x10')];return Promise[_0xff72('0x11')]()[_0xff72('0x4')](function(){var _0x90cd64=_[_0xff72('0x5')](_0x8e2b1e,function(_0x5e7f60){return getQueuesByChannel(_0x451b31,_0x5e7f60);});return Promise[_0xff72('0x12')](_0x90cd64);})[_0xff72('0x8')](function(_0x38e117){throw _0x38e117;});}}});};
\ No newline at end of file
index 5a9cf61..ff004ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d77=['then','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./team.socket','register','request'];(function(_0x2b36bb,_0x5211cb){var _0x2c7295=function(_0x34f374){while(--_0x34f374){_0x2b36bb['push'](_0x2b36bb['shift']());}};_0x2c7295(++_0x5211cb);}(_0x4d77,0x19f));var _0x74d7=function(_0x5488ab,_0x330205){_0x5488ab=_0x5488ab-0x0;var _0x4720de=_0x4d77[_0x5488ab];return _0x4720de;};'use strict';var _=require(_0x74d7('0x0'));var util=require(_0x74d7('0x1'));var moment=require(_0x74d7('0x2'));var BPromise=require(_0x74d7('0x3'));var rs=require(_0x74d7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x74d7('0x5'))['db'];var utils=require(_0x74d7('0x6'));var logger=require(_0x74d7('0x7'))('rpc');var config=require(_0x74d7('0x8'));var jayson=require(_0x74d7('0x9'));var client=jayson[_0x74d7('0xa')][_0x74d7('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x74d7('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x74d7('0xd'))(new Redis(config[_0x74d7('0xc')]));require(_0x74d7('0xe'))[_0x74d7('0xf')](socket);function respondWithRpcPromise(_0x5c1020,_0x47008c,_0x43f8ca){return new BPromise(function(_0x4c5d2f,_0x5a6752){return client[_0x74d7('0x10')](_0x5c1020,_0x43f8ca)[_0x74d7('0x11')](function(_0x12ae1b){logger[_0x74d7('0x12')](_0x74d7('0x13'),_0x47008c,_0x74d7('0x14'));logger['debug'](_0x74d7('0x15'),_0x47008c,_0x74d7('0x14'),JSON['stringify'](_0x12ae1b));if(_0x12ae1b[_0x74d7('0x16')]){if(_0x12ae1b[_0x74d7('0x16')][_0x74d7('0x17')]===0x1f4){logger[_0x74d7('0x16')]('Team,\x20%s,\x20%s',_0x47008c,_0x12ae1b[_0x74d7('0x16')]['message']);return _0x5a6752(_0x12ae1b[_0x74d7('0x16')][_0x74d7('0x18')]);}logger[_0x74d7('0x16')](_0x74d7('0x13'),_0x47008c,_0x12ae1b[_0x74d7('0x16')][_0x74d7('0x18')]);return _0x4c5d2f(_0x12ae1b[_0x74d7('0x16')][_0x74d7('0x18')]);}else{logger[_0x74d7('0x12')](_0x74d7('0x13'),_0x47008c,_0x74d7('0x14'));_0x4c5d2f(_0x12ae1b[_0x74d7('0x19')]['message']);}})[_0x74d7('0x1a')](function(_0xeded95){logger[_0x74d7('0x16')](_0x74d7('0x13'),_0x47008c,_0xeded95);_0x5a6752(_0xeded95);});});}
\ No newline at end of file
+var _0x1013=['http','redis','localhost','socket.io-emitter','./team.socket','request','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x1013,0x1e1));var _0x3101=function(_0x2f9fc3,_0x24b621){_0x2f9fc3=_0x2f9fc3-0x0;var _0x50bea3=_0x1013[_0x2f9fc3];return _0x50bea3;};'use strict';var _=require(_0x3101('0x0'));var util=require(_0x3101('0x1'));var moment=require(_0x3101('0x2'));var BPromise=require(_0x3101('0x3'));var rs=require(_0x3101('0x4'));var fs=require('fs');var Redis=require(_0x3101('0x5'));var db=require(_0x3101('0x6'))['db'];var utils=require(_0x3101('0x7'));var logger=require(_0x3101('0x8'))(_0x3101('0x9'));var config=require('../../config/environment');var jayson=require(_0x3101('0xa'));var client=jayson[_0x3101('0xb')][_0x3101('0xc')]({'port':0x232a});config[_0x3101('0xd')]=_['defaults'](config['redis'],{'host':_0x3101('0xe'),'port':0x18eb});var socket=require(_0x3101('0xf'))(new Redis(config[_0x3101('0xd')]));require(_0x3101('0x10'))['register'](socket);function respondWithRpcPromise(_0x2c1769,_0x4d8b94,_0x393a20){return new BPromise(function(_0x236217,_0x457994){return client[_0x3101('0x11')](_0x2c1769,_0x393a20)['then'](function(_0x5a8078){logger['info'](_0x3101('0x12'),_0x4d8b94,_0x3101('0x13'));logger[_0x3101('0x14')](_0x3101('0x15'),_0x4d8b94,_0x3101('0x13'),JSON[_0x3101('0x16')](_0x5a8078));if(_0x5a8078[_0x3101('0x17')]){if(_0x5a8078[_0x3101('0x17')][_0x3101('0x18')]===0x1f4){logger[_0x3101('0x17')]('Team,\x20%s,\x20%s',_0x4d8b94,_0x5a8078[_0x3101('0x17')][_0x3101('0x19')]);return _0x457994(_0x5a8078[_0x3101('0x17')][_0x3101('0x19')]);}logger[_0x3101('0x17')](_0x3101('0x12'),_0x4d8b94,_0x5a8078[_0x3101('0x17')][_0x3101('0x19')]);return _0x236217(_0x5a8078[_0x3101('0x17')]['message']);}else{logger[_0x3101('0x1a')](_0x3101('0x12'),_0x4d8b94,_0x3101('0x13'));_0x236217(_0x5a8078[_0x3101('0x1b')][_0x3101('0x19')]);}})[_0x3101('0x1c')](function(_0x22eaba){logger['error'](_0x3101('0x12'),_0x4d8b94,_0x22eaba);_0x457994(_0x22eaba);});});}
\ No newline at end of file
index 26d8230..5f896ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e6d=['emit','register','./team.events','save','remove','update'];(function(_0x58e99d,_0x117950){var _0x171b36=function(_0xf94980){while(--_0xf94980){_0x58e99d['push'](_0x58e99d['shift']());}};_0x171b36(++_0x117950);}(_0x8e6d,0x92));var _0xd8e6=function(_0x55123c,_0x3e6a3e){_0x55123c=_0x55123c-0x0;var _0xd665ff=_0x8e6d[_0x55123c];return _0xd665ff;};'use strict';var TeamEvents=require(_0xd8e6('0x0'));var events=[_0xd8e6('0x1'),_0xd8e6('0x2'),_0xd8e6('0x3')];function createListener(_0x1819f0,_0x19f031){return function(_0x39a44d){_0x19f031[_0xd8e6('0x4')](_0x1819f0,_0x39a44d);};}function removeListener(_0x3521ca,_0x504881){return function(){TeamEvents['removeListener'](_0x3521ca,_0x504881);};}exports[_0xd8e6('0x5')]=function(_0x55e2d1){for(var _0x3f6bbe=0x0,_0x22be37=events['length'];_0x3f6bbe<_0x22be37;_0x3f6bbe++){var _0x16dbd4=events[_0x3f6bbe];var _0x33fdb2=createListener('team:'+_0x16dbd4,_0x55e2d1);TeamEvents['on'](_0x16dbd4,_0x33fdb2);}};
\ No newline at end of file
+var _0x6995=['length','./team.events','save','remove','update','emit','removeListener'];(function(_0xeadc1e,_0x3351ca){var _0x5c9980=function(_0x5dee84){while(--_0x5dee84){_0xeadc1e['push'](_0xeadc1e['shift']());}};_0x5c9980(++_0x3351ca);}(_0x6995,0xfd));var _0x5699=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x6995[_0xfae23b];return _0x200640;};'use strict';var TeamEvents=require(_0x5699('0x0'));var events=[_0x5699('0x1'),_0x5699('0x2'),_0x5699('0x3')];function createListener(_0x2ff710,_0x33701f){return function(_0x837aec){_0x33701f[_0x5699('0x4')](_0x2ff710,_0x837aec);};}function removeListener(_0x5bea44,_0x237520){return function(){TeamEvents[_0x5699('0x5')](_0x5bea44,_0x237520);};}exports['register']=function(_0x362505){for(var _0x1278fb=0x0,_0xe65c6b=events[_0x5699('0x6')];_0x1278fb<_0xe65c6b;_0x1278fb++){var _0x28ee3c=events[_0x1278fb];var _0x5e8143=createListener('team:'+_0x28ee3c,_0x362505);TeamEvents['on'](_0x28ee3c,_0x5e8143);}};
\ No newline at end of file
index 7e03a44..50c4319 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x191a=['INTEGER','sequelize'];(function(_0x10d743,_0x24df73){var _0x4ac666=function(_0x118112){while(--_0x118112){_0x10d743['push'](_0x10d743['shift']());}};_0x4ac666(++_0x24df73);}(_0x191a,0xef));var _0xa191=function(_0x37adb8,_0x662808){_0x37adb8=_0x37adb8-0x0;var _0x2ec241=_0x191a[_0x37adb8];return _0x2ec241;};'use strict';var Sequelize=require(_0xa191('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0xa191('0x1')]},'VoicePrefixId':{'type':Sequelize[_0xa191('0x1')]}};
\ No newline at end of file
+var _0xf81a=['sequelize','exports','INTEGER'];(function(_0x1b486c,_0x19dddd){var _0x43cc3e=function(_0x3d626e){while(--_0x3d626e){_0x1b486c['push'](_0x1b486c['shift']());}};_0x43cc3e(++_0x19dddd);}(_0xf81a,0x16b));var _0xaf81=function(_0x46c407,_0x163461){_0x46c407=_0x46c407-0x0;var _0x119c45=_0xf81a[_0x46c407];return _0x119c45;};'use strict';var Sequelize=require(_0xaf81('0x0'));module[_0xaf81('0x1')]={'TeamId':{'type':Sequelize[_0xaf81('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 64cf90f..babd0f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33d2=['path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','team_has_voice_prefixes','lodash','util','../../config/logger','moment','bluebird'];(function(_0x4a3739,_0x475da5){var _0x2e5d3c=function(_0x198564){while(--_0x198564){_0x4a3739['push'](_0x4a3739['shift']());}};_0x2e5d3c(++_0x475da5);}(_0x33d2,0x7f));var _0x233d=function(_0xa25342,_0x24522b){_0xa25342=_0xa25342-0x0;var _0x52be43=_0x33d2[_0xa25342];return _0x52be43;};'use strict';var _=require(_0x233d('0x0'));var util=require(_0x233d('0x1'));var logger=require(_0x233d('0x2'))('api');var moment=require(_0x233d('0x3'));var BPromise=require(_0x233d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x233d('0x5'));var rimraf=require(_0x233d('0x6'));var config=require(_0x233d('0x7'));var attributes=require(_0x233d('0x8'));module[_0x233d('0x9')]=function(_0x3f311b,_0x15ba43){return _0x3f311b[_0x233d('0xa')]('TeamVoicePrefix',attributes,{'tableName':_0x233d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe3d4=['api','bluebird','request-promise','rimraf','./teamVoicePrefix.attributes','exports','define','team_has_voice_prefixes','util','../../config/logger'];(function(_0xb1357a,_0x496091){var _0x27d762=function(_0x459450){while(--_0x459450){_0xb1357a['push'](_0xb1357a['shift']());}};_0x27d762(++_0x496091);}(_0xe3d4,0xc6));var _0x4e3d=function(_0x3e9ef3,_0x21a7e4){_0x3e9ef3=_0x3e9ef3-0x0;var _0x333748=_0xe3d4[_0x3e9ef3];return _0x333748;};'use strict';var _=require('lodash');var util=require(_0x4e3d('0x0'));var logger=require(_0x4e3d('0x1'))(_0x4e3d('0x2'));var moment=require('moment');var BPromise=require(_0x4e3d('0x3'));var rp=require(_0x4e3d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4e3d('0x5'));var config=require('../../config/environment');var attributes=require(_0x4e3d('0x6'));module[_0x4e3d('0x7')]=function(_0x4fd5ff,_0x3eaf60){return _0x4fd5ff[_0x4e3d('0x8')]('TeamVoicePrefix',attributes,{'tableName':_0x4e3d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d56f985..35af475 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(_0x2d9f26,_0x10e8dd){var _0x5c7562=function(_0xc15ae9){while(--_0xc15ae9){_0x2d9f26['push'](_0x2d9f26['shift']());}};_0x5c7562(++_0x10e8dd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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(_0x2a3276,_0x16cc2a){var _0x279d8e=function(_0x577df9){while(--_0x577df9){_0x2a3276['push'](_0x2a3276['shift']());}};_0x279d8e(++_0x16cc2a);}(_0x70e0,0x17b));var _0x070e=function(_0x179de2,_0x2fe7ec){_0x179de2=_0x179de2-0x0;var _0x33e3f7=_0x70e0[_0x179de2];return _0x33e3f7;};'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 c6e6f6f..5b00650 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd89f=['exports','INTEGER','sequelize'];(function(_0x105fa5,_0x4753ec){var _0x5a6e8c=function(_0x29f85d){while(--_0x29f85d){_0x105fa5['push'](_0x105fa5['shift']());}};_0x5a6e8c(++_0x4753ec);}(_0xd89f,0x191));var _0xfd89=function(_0x1349d0,_0x30e8e5){_0x1349d0=_0x1349d0-0x0;var _0x524d5f=_0xd89f[_0x1349d0];return _0x524d5f;};'use strict';var Sequelize=require(_0xfd89('0x0'));module[_0xfd89('0x1')]={'penalty':{'type':Sequelize[_0xfd89('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x99e0=['INTEGER','sequelize','exports'];(function(_0x451661,_0x3c535c){var _0x3c83a5=function(_0x50cbfb){while(--_0x50cbfb){_0x451661['push'](_0x451661['shift']());}};_0x3c83a5(++_0x3c535c);}(_0x99e0,0xd0));var _0x099e=function(_0x5b2e2c,_0x30d7a0){_0x5b2e2c=_0x5b2e2c-0x0;var _0x3bfcd9=_0x99e0[_0x5b2e2c];return _0x3bfcd9;};'use strict';var Sequelize=require(_0x099e('0x0'));module[_0x099e('0x1')]={'penalty':{'type':Sequelize[_0x099e('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 316fb03..a4c9014 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd04b=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xd04b,0x145));var _0xbd04=function(_0x23de6f,_0xb26d78){_0x23de6f=_0x23de6f-0x0;var _0x433be2=_0xd04b[_0x23de6f];return _0x433be2;};'use strict';var _=require(_0xbd04('0x0'));var util=require(_0xbd04('0x1'));var logger=require(_0xbd04('0x2'))('api');var moment=require(_0xbd04('0x3'));var BPromise=require('bluebird');var rp=require(_0xbd04('0x4'));var fs=require('fs');var path=require(_0xbd04('0x5'));var rimraf=require(_0xbd04('0x6'));var config=require(_0xbd04('0x7'));var attributes=require(_0xbd04('0x8'));module[_0xbd04('0x9')]=function(_0x11d6ce,_0x2d8811){return _0x11d6ce[_0xbd04('0xa')](_0xbd04('0xb'),attributes,{'tableName':_0xbd04('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbb53=['define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1e23e2,_0x57767c){var _0x347c0f=function(_0x1a7b32){while(--_0x1a7b32){_0x1e23e2['push'](_0x1e23e2['shift']());}};_0x347c0f(++_0x57767c);}(_0xbb53,0x121));var _0x3bb5=function(_0x9cbe7a,_0x21a623){_0x9cbe7a=_0x9cbe7a-0x0;var _0x41b674=_0xbb53[_0x9cbe7a];return _0x41b674;};'use strict';var _=require(_0x3bb5('0x0'));var util=require(_0x3bb5('0x1'));var logger=require(_0x3bb5('0x2'))(_0x3bb5('0x3'));var moment=require(_0x3bb5('0x4'));var BPromise=require(_0x3bb5('0x5'));var rp=require(_0x3bb5('0x6'));var fs=require('fs');var path=require(_0x3bb5('0x7'));var rimraf=require(_0x3bb5('0x8'));var config=require(_0x3bb5('0x9'));var attributes=require('./teamVoiceQueue.attributes');module['exports']=function(_0x23f11e,_0x2460b0){return _0x23f11e[_0x3bb5('0xa')](_0x3bb5('0xb'),attributes,{'tableName':_0x3bb5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4855739..69931ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd50d=['../../config/environment','jayson/promise','http','then','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','TeamVoiceQueue,\x20%s,\x20%s','info','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x180ffb,_0x26e6a7){var _0x46bc3b=function(_0x3810a9){while(--_0x3810a9){_0x180ffb['push'](_0x180ffb['shift']());}};_0x46bc3b(++_0x26e6a7);}(_0xd50d,0xc9));var _0xdd50=function(_0x317424,_0x1e9fe2){_0x317424=_0x317424-0x0;var _0x4189b2=_0xd50d[_0x317424];return _0x4189b2;};'use strict';var _=require(_0xdd50('0x0'));var util=require(_0xdd50('0x1'));var moment=require(_0xdd50('0x2'));var BPromise=require(_0xdd50('0x3'));var rs=require(_0xdd50('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdd50('0x5'))['db'];var utils=require(_0xdd50('0x6'));var logger=require(_0xdd50('0x7'))(_0xdd50('0x8'));var config=require(_0xdd50('0x9'));var jayson=require(_0xdd50('0xa'));var client=jayson['client'][_0xdd50('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x57e03f,_0x423867,_0x564536){return new BPromise(function(_0x27f4cd,_0x3c1512){return client['request'](_0x57e03f,_0x564536)[_0xdd50('0xc')](function(_0x56803b){logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x423867,_0xdd50('0xd'));logger[_0xdd50('0xe')](_0xdd50('0xf'),_0x423867,'request\x20sent',JSON['stringify'](_0x56803b));if(_0x56803b['error']){if(_0x56803b[_0xdd50('0x10')][_0xdd50('0x11')]===0x1f4){logger[_0xdd50('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x423867,_0x56803b['error'][_0xdd50('0x12')]);return _0x3c1512(_0x56803b[_0xdd50('0x10')][_0xdd50('0x12')]);}logger[_0xdd50('0x10')](_0xdd50('0x13'),_0x423867,_0x56803b['error'][_0xdd50('0x12')]);return _0x27f4cd(_0x56803b[_0xdd50('0x10')]['message']);}else{logger[_0xdd50('0x14')](_0xdd50('0x13'),_0x423867,_0xdd50('0xd'));_0x27f4cd(_0x56803b['result'][_0xdd50('0x12')]);}})['catch'](function(_0x29a772){logger['error'](_0xdd50('0x13'),_0x423867,_0x29a772);_0x3c1512(_0x29a772);});});}
\ No newline at end of file
+var _0x51b9=['http','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xbebf50,_0x44ec09){var _0xce1496=function(_0x1bf94d){while(--_0x1bf94d){_0xbebf50['push'](_0xbebf50['shift']());}};_0xce1496(++_0x44ec09);}(_0x51b9,0x11b));var _0x951b=function(_0x526559,_0x3b13c7){_0x526559=_0x526559-0x0;var _0x43019d=_0x51b9[_0x526559];return _0x43019d;};'use strict';var _=require(_0x951b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x951b('0x1'));var rs=require(_0x951b('0x2'));var fs=require('fs');var Redis=require(_0x951b('0x3'));var db=require(_0x951b('0x4'))['db'];var utils=require(_0x951b('0x5'));var logger=require(_0x951b('0x6'))(_0x951b('0x7'));var config=require(_0x951b('0x8'));var jayson=require(_0x951b('0x9'));var client=jayson[_0x951b('0xa')][_0x951b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x51e22e,_0x13475f,_0xcd534d){return new BPromise(function(_0x52e54d,_0x16f04a){return client['request'](_0x51e22e,_0xcd534d)['then'](function(_0x5113c4){logger['info'](_0x951b('0xc'),_0x13475f,'request\x20sent');logger[_0x951b('0xd')](_0x951b('0xe'),_0x13475f,'request\x20sent',JSON[_0x951b('0xf')](_0x5113c4));if(_0x5113c4['error']){if(_0x5113c4[_0x951b('0x10')][_0x951b('0x11')]===0x1f4){logger[_0x951b('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x13475f,_0x5113c4[_0x951b('0x10')]['message']);return _0x16f04a(_0x5113c4[_0x951b('0x10')]['message']);}logger[_0x951b('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x13475f,_0x5113c4[_0x951b('0x10')][_0x951b('0x12')]);return _0x52e54d(_0x5113c4[_0x951b('0x10')][_0x951b('0x12')]);}else{logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x13475f,_0x951b('0x13'));_0x52e54d(_0x5113c4['result'][_0x951b('0x12')]);}})[_0x951b('0x14')](function(_0x5511fd){logger[_0x951b('0x10')](_0x951b('0xc'),_0x13475f,_0x5511fd);_0x16f04a(_0x5511fd);});});}
\ No newline at end of file
index 8df48c0..3956033 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d63=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','/:id','show','post','update'];(function(_0x4ac208,_0x4401e6){var _0xf03ba7=function(_0x2f4296){while(--_0x2f4296){_0x4ac208['push'](_0x4ac208['shift']());}};_0xf03ba7(++_0x4401e6);}(_0x1d63,0xa4));var _0x31d6=function(_0x534c02,_0x485615){_0x534c02=_0x534c02-0x0;var _0x570373=_0x1d63[_0x534c02];return _0x570373;};'use strict';var multer=require(_0x31d6('0x0'));var util=require(_0x31d6('0x1'));var path=require(_0x31d6('0x2'));var timeout=require(_0x31d6('0x3'));var express=require(_0x31d6('0x4'));var router=express['Router']();var fs_extra=require(_0x31d6('0x5'));var auth=require(_0x31d6('0x6'));var interaction=require(_0x31d6('0x7'));var config=require(_0x31d6('0x8'));var controller=require(_0x31d6('0x9'));router[_0x31d6('0xa')]('/',auth[_0x31d6('0xb')](),controller['index']);router[_0x31d6('0xa')](_0x31d6('0xc'),auth['isAuthenticated'](),controller[_0x31d6('0xd')]);router[_0x31d6('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x31d6('0xc'),auth[_0x31d6('0xb')](),controller[_0x31d6('0xf')]);router['delete'](_0x31d6('0xc'),auth[_0x31d6('0xb')](),controller[_0x31d6('0x10')]);module[_0x31d6('0x11')]=router;
\ No newline at end of file
+var _0xe062=['delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','show','post','put','/:id','update'];(function(_0x1dfb01,_0x1a5500){var _0x5b2d4c=function(_0x4e7bfd){while(--_0x4e7bfd){_0x1dfb01['push'](_0x1dfb01['shift']());}};_0x5b2d4c(++_0x1a5500);}(_0xe062,0x1b8));var _0x2e06=function(_0x193e51,_0x4948fc){_0x193e51=_0x193e51-0x0;var _0x4db010=_0xe062[_0x193e51];return _0x4db010;};'use strict';var multer=require(_0x2e06('0x0'));var util=require(_0x2e06('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2e06('0x2'));var router=express[_0x2e06('0x3')]();var fs_extra=require(_0x2e06('0x4'));var auth=require(_0x2e06('0x5'));var interaction=require(_0x2e06('0x6'));var config=require(_0x2e06('0x7'));var controller=require(_0x2e06('0x8'));router[_0x2e06('0x9')]('/',auth[_0x2e06('0xa')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2e06('0xb')]);router[_0x2e06('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2e06('0xd')](_0x2e06('0xe'),auth[_0x2e06('0xa')](),controller[_0x2e06('0xf')]);router[_0x2e06('0x10')](_0x2e06('0xe'),auth[_0x2e06('0xa')](),controller[_0x2e06('0x11')]);module[_0x2e06('0x12')]=router;
\ No newline at end of file
index 052c4f4..040358f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5cc=['sequelize'];(function(_0x2776ef,_0x20481c){var _0xef49ed=function(_0xfb14a6){while(--_0xfb14a6){_0x2776ef['push'](_0x2776ef['shift']());}};_0xef49ed(++_0x20481c);}(_0xa5cc,0x1e9));var _0xca5c=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0xa5cc[_0x220f3f];return _0x1f170e;};'use strict';var Sequelize=require(_0xca5c('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xed49=['STRING','sequelize','exports'];(function(_0x99d7e2,_0x148c16){var _0x3830de=function(_0x2897ef){while(--_0x2897ef){_0x99d7e2['push'](_0x99d7e2['shift']());}};_0x3830de(++_0x148c16);}(_0xed49,0xe5));var _0x9ed4=function(_0x2d5526,_0x46ca01){_0x2d5526=_0x2d5526-0x0;var _0x4b9595=_0xed49[_0x2d5526];return _0x4b9595;};'use strict';var Sequelize=require(_0x9ed4('0x0'));module[_0x9ed4('0x1')]={'name':{'type':Sequelize[_0x9ed4('0x2')]},'description':{'type':Sequelize[_0x9ed4('0x2')]},'html':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 444dcd7..d75bb92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd688=['catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','destroy','then','get','Templates','UserProfileResource','name','send','map','Template','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd688,0xb2));var _0x8d68=function(_0x126cc0,_0x2eed69){_0x126cc0=_0x126cc0-0x0;var _0x295a00=_0xd688[_0x126cc0];return _0x295a00;};'use strict';var emlformat=require(_0x8d68('0x0'));var rimraf=require(_0x8d68('0x1'));var zipdir=require(_0x8d68('0x2'));var jsonpatch=require(_0x8d68('0x3'));var rp=require(_0x8d68('0x4'));var moment=require(_0x8d68('0x5'));var BPromise=require(_0x8d68('0x6'));var Mustache=require(_0x8d68('0x7'));var util=require(_0x8d68('0x8'));var path=require(_0x8d68('0x9'));var sox=require(_0x8d68('0xa'));var csv=require(_0x8d68('0xb'));var ejs=require(_0x8d68('0xc'));var fs=require('fs');var fs_extra=require(_0x8d68('0xd'));var _=require(_0x8d68('0xe'));var squel=require(_0x8d68('0xf'));var crypto=require(_0x8d68('0x10'));var jsforce=require(_0x8d68('0x11'));var deskjs=require(_0x8d68('0x12'));var toCsv=require(_0x8d68('0xb'));var querystring=require(_0x8d68('0x13'));var Papa=require('papaparse');var Redis=require(_0x8d68('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8d68('0x15'));var hardwareService=require(_0x8d68('0x16'));var logger=require(_0x8d68('0x17'))('api');var utils=require(_0x8d68('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8d68('0x19'));var db=require(_0x8d68('0x1a'))['db'];function respondWithStatusCode(_0x13dbf6,_0x4922b7){_0x4922b7=_0x4922b7||0xcc;return function(_0x2217a5){if(_0x2217a5){return _0x13dbf6[_0x8d68('0x1b')](_0x4922b7);}return _0x13dbf6[_0x8d68('0x1c')](_0x4922b7)[_0x8d68('0x1d')]();};}function respondWithResult(_0x526ea5,_0x273637){_0x273637=_0x273637||0xc8;return function(_0x17f97e){if(_0x17f97e){return _0x526ea5[_0x8d68('0x1c')](_0x273637)[_0x8d68('0x1e')](_0x17f97e);}};}function respondWithFilteredResult(_0x43a259,_0xba2b2f){return function(_0x389fe4){if(_0x389fe4){var _0xfb45c2=typeof _0xba2b2f[_0x8d68('0x1f')]===_0x8d68('0x20')&&typeof _0xba2b2f[_0x8d68('0x21')]===_0x8d68('0x20');var _0x5aa103=_0x389fe4[_0x8d68('0x22')];var _0x3ce6c0=_0xfb45c2?0x0:_0xba2b2f[_0x8d68('0x1f')];var _0x15ca98=_0xfb45c2?_0x389fe4[_0x8d68('0x22')]:_0xba2b2f[_0x8d68('0x1f')]+_0xba2b2f['limit'];var _0x344f70;if(_0x15ca98>=_0x5aa103){_0x15ca98=_0x5aa103;_0x344f70=0xc8;}else{_0x344f70=0xce;}_0x43a259['status'](_0x344f70);return _0x43a259['set'](_0x8d68('0x23'),_0x3ce6c0+'-'+_0x15ca98+'/'+_0x5aa103)[_0x8d68('0x1e')](_0x389fe4);}return null;};}function patchUpdates(_0xf54c4f){return function(_0x2b279b){try{jsonpatch[_0x8d68('0x24')](_0x2b279b,_0xf54c4f,!![]);}catch(_0x12be25){return BPromise['reject'](_0x12be25);}return _0x2b279b[_0x8d68('0x25')]();};}function saveUpdates(_0x21fa02,_0x2aaf62){return function(_0x341da0){if(_0x341da0){return _0x341da0['update'](_0x21fa02)['then'](function(_0x51a35c){return _0x51a35c;});}return null;};}function removeEntity(_0x29d483,_0x222561){return function(_0x50d85e){if(_0x50d85e){return _0x50d85e[_0x8d68('0x26')]()[_0x8d68('0x27')](function(){var _0x4ca5de=_0x50d85e[_0x8d68('0x28')]({'plain':!![]});var _0x151902=_0x8d68('0x29');return db[_0x8d68('0x2a')][_0x8d68('0x26')]({'where':{'type':_0x151902,'resourceId':_0x4ca5de['id']}})[_0x8d68('0x27')](function(){return _0x50d85e;});})[_0x8d68('0x27')](function(){_0x29d483['status'](0xcc)[_0x8d68('0x1d')]();});}};}function handleEntityNotFound(_0x312668,_0x25a469){return function(_0x58a36){if(!_0x58a36){_0x312668[_0x8d68('0x1b')](0x194);}return _0x58a36;};}function handleError(_0x3e42e3,_0x551ca7){_0x551ca7=_0x551ca7||0x1f4;return function(_0x4c8a11){logger['error'](_0x4c8a11['stack']);if(_0x4c8a11['name']){delete _0x4c8a11[_0x8d68('0x2b')];}_0x3e42e3['status'](_0x551ca7)[_0x8d68('0x2c')](_0x4c8a11);};}exports['index']=function(_0x2763ff,_0xf646aa){var _0x5cbd72={},_0x1b2298={},_0x404e76={'count':0x0,'rows':[]};var _0x3a7e2c=_[_0x8d68('0x2d')](db[_0x8d68('0x2e')][_0x8d68('0x2f')],function(_0x3a112c){return{'name':_0x3a112c[_0x8d68('0x30')],'type':_0x3a112c[_0x8d68('0x31')][_0x8d68('0x32')]};});_0x1b2298[_0x8d68('0x33')]=_['map'](_0x3a7e2c,_0x8d68('0x2b'));_0x1b2298[_0x8d68('0x34')]=_[_0x8d68('0x35')](_0x2763ff[_0x8d68('0x34')]);_0x1b2298[_0x8d68('0x36')]=_[_0x8d68('0x37')](_0x1b2298[_0x8d68('0x33')],_0x1b2298['query']);_0x5cbd72[_0x8d68('0x38')]=_[_0x8d68('0x37')](_0x1b2298['model'],qs[_0x8d68('0x39')](_0x2763ff[_0x8d68('0x34')][_0x8d68('0x39')]));_0x5cbd72[_0x8d68('0x38')]=_0x5cbd72[_0x8d68('0x38')][_0x8d68('0x3a')]?_0x5cbd72[_0x8d68('0x38')]:_0x1b2298['model'];if(!_0x2763ff[_0x8d68('0x34')]['hasOwnProperty'](_0x8d68('0x3b'))){_0x5cbd72[_0x8d68('0x21')]=qs[_0x8d68('0x21')](_0x2763ff[_0x8d68('0x34')]['limit']);_0x5cbd72[_0x8d68('0x1f')]=qs[_0x8d68('0x1f')](_0x2763ff[_0x8d68('0x34')][_0x8d68('0x1f')]);}_0x5cbd72[_0x8d68('0x3c')]=qs[_0x8d68('0x3d')](_0x2763ff['query'][_0x8d68('0x3d')]);_0x5cbd72[_0x8d68('0x3e')]=qs['filters'](_[_0x8d68('0x3f')](_0x2763ff[_0x8d68('0x34')],_0x1b2298['filters']),_0x3a7e2c);if(_0x2763ff['query'][_0x8d68('0x40')]){_0x5cbd72[_0x8d68('0x3e')]=_[_0x8d68('0x41')](_0x5cbd72[_0x8d68('0x3e')],{'$or':_[_0x8d68('0x2d')](_0x3a7e2c,function(_0x4a2f51){if(_0x4a2f51[_0x8d68('0x31')]!==_0x8d68('0x42')){var _0x4a652f={};_0x4a652f[_0x4a2f51[_0x8d68('0x2b')]]={'$like':'%'+_0x2763ff['query']['filter']+'%'};return _0x4a652f;}})});}_0x5cbd72=_['merge']({},_0x5cbd72,_0x2763ff['options']);var _0x476370={'where':_0x5cbd72[_0x8d68('0x3e')]};return db[_0x8d68('0x2e')][_0x8d68('0x22')](_0x476370)['then'](function(_0x33375f){_0x404e76[_0x8d68('0x22')]=_0x33375f;if(_0x2763ff[_0x8d68('0x34')][_0x8d68('0x43')]){_0x5cbd72[_0x8d68('0x44')]=[{'all':!![]}];}return db[_0x8d68('0x2e')][_0x8d68('0x45')](_0x5cbd72);})['then'](function(_0x272b25){_0x404e76[_0x8d68('0x46')]=_0x272b25;return _0x404e76;})[_0x8d68('0x27')](respondWithFilteredResult(_0xf646aa,_0x5cbd72))[_0x8d68('0x47')](handleError(_0xf646aa,null));};exports[_0x8d68('0x48')]=function(_0x336578,_0x14861e){var _0x32820a={'raw':!![],'where':{'id':_0x336578[_0x8d68('0x49')]['id']}},_0x51b165={};_0x51b165[_0x8d68('0x33')]=_[_0x8d68('0x35')](db[_0x8d68('0x2e')][_0x8d68('0x2f')]);_0x51b165[_0x8d68('0x34')]=_[_0x8d68('0x35')](_0x336578[_0x8d68('0x34')]);_0x51b165[_0x8d68('0x36')]=_[_0x8d68('0x37')](_0x51b165[_0x8d68('0x33')],_0x51b165[_0x8d68('0x34')]);_0x32820a['attributes']=_[_0x8d68('0x37')](_0x51b165[_0x8d68('0x33')],qs['fields'](_0x336578['query'][_0x8d68('0x39')]));_0x32820a[_0x8d68('0x38')]=_0x32820a[_0x8d68('0x38')]['length']?_0x32820a[_0x8d68('0x38')]:_0x51b165['model'];if(_0x336578[_0x8d68('0x34')][_0x8d68('0x43')]){_0x32820a[_0x8d68('0x44')]=[{'all':!![]}];}_0x32820a=_['merge']({},_0x32820a,_0x336578['options']);return db[_0x8d68('0x2e')][_0x8d68('0x4a')](_0x32820a)['then'](handleEntityNotFound(_0x14861e,null))[_0x8d68('0x27')](respondWithResult(_0x14861e,null))[_0x8d68('0x47')](handleError(_0x14861e,null));};exports[_0x8d68('0x4b')]=function(_0x4cad7a,_0x3038f2){return db[_0x8d68('0x2e')]['create'](_0x4cad7a[_0x8d68('0x4c')],{})[_0x8d68('0x27')](function(_0x2a7c26){var _0x2c1beb=_0x4cad7a['user'][_0x8d68('0x28')]({'plain':!![]});if(!_0x2c1beb)throw new Error(_0x8d68('0x4d'));if(_0x2c1beb['role']===_0x8d68('0x4e')){var _0x4a111e=_0x2a7c26[_0x8d68('0x28')]({'plain':!![]});var _0x32e670=_0x8d68('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x32e670,'userProfileId':_0x2c1beb['userProfileId']},'raw':!![]})[_0x8d68('0x27')](function(_0x504254){if(_0x504254&&_0x504254[_0x8d68('0x4f')]===0x0){return db[_0x8d68('0x2a')]['create']({'name':_0x4a111e[_0x8d68('0x2b')],'resourceId':_0x4a111e['id'],'type':_0x504254['name'],'sectionId':_0x504254['id']},{})[_0x8d68('0x27')](function(){return _0x2a7c26;});}else{return _0x2a7c26;}})['catch'](function(_0x44b165){logger[_0x8d68('0x50')](_0x8d68('0x51'),_0x44b165);throw _0x44b165;});}return _0x2a7c26;})[_0x8d68('0x27')](respondWithResult(_0x3038f2,0xc9))['catch'](handleError(_0x3038f2,null));};exports[_0x8d68('0x52')]=function(_0x51d049,_0x1280e2){if(_0x51d049[_0x8d68('0x4c')]['id']){delete _0x51d049[_0x8d68('0x4c')]['id'];}return db[_0x8d68('0x2e')][_0x8d68('0x4a')]({'where':{'id':_0x51d049[_0x8d68('0x49')]['id']}})[_0x8d68('0x27')](handleEntityNotFound(_0x1280e2,null))['then'](saveUpdates(_0x51d049[_0x8d68('0x4c')],null))[_0x8d68('0x27')](respondWithResult(_0x1280e2,null))[_0x8d68('0x47')](handleError(_0x1280e2,null));};exports[_0x8d68('0x26')]=function(_0x3161fb,_0x551f7f){return db[_0x8d68('0x2e')][_0x8d68('0x4a')]({'where':{'id':_0x3161fb[_0x8d68('0x49')]['id']}})[_0x8d68('0x27')](handleEntityNotFound(_0x551f7f,null))[_0x8d68('0x27')](removeEntity(_0x551f7f,null))['catch'](handleError(_0x551f7f,null));};
\ No newline at end of file
+var _0xd88a=['map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','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','destroy','then','get','Templates','UserProfileResource','error','stack','name','send','index','Template','rawAttributes','type','model'];(function(_0x79978b,_0x2a6003){var _0x51f1ac=function(_0x5018a7){while(--_0x5018a7){_0x79978b['push'](_0x79978b['shift']());}};_0x51f1ac(++_0x2a6003);}(_0xd88a,0x1b0));var _0xad88=function(_0x5622d6,_0x40809a){_0x5622d6=_0x5622d6-0x0;var _0x411cae=_0xd88a[_0x5622d6];return _0x411cae;};'use strict';var emlformat=require(_0xad88('0x0'));var rimraf=require(_0xad88('0x1'));var zipdir=require(_0xad88('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xad88('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xad88('0x4'));var path=require(_0xad88('0x5'));var sox=require(_0xad88('0x6'));var csv=require(_0xad88('0x7'));var ejs=require(_0xad88('0x8'));var fs=require('fs');var fs_extra=require(_0xad88('0x9'));var _=require(_0xad88('0xa'));var squel=require(_0xad88('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xad88('0xc'));var toCsv=require(_0xad88('0x7'));var querystring=require('querystring');var Papa=require(_0xad88('0xd'));var Redis=require('ioredis');var authService=require(_0xad88('0xe'));var qs=require(_0xad88('0xf'));var as=require(_0xad88('0x10'));var hardwareService=require(_0xad88('0x11'));var logger=require(_0xad88('0x12'))(_0xad88('0x13'));var utils=require(_0xad88('0x14'));var config=require(_0xad88('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xad88('0x16'))['db'];function respondWithStatusCode(_0xb89071,_0x283dfd){_0x283dfd=_0x283dfd||0xcc;return function(_0x13bb03){if(_0x13bb03){return _0xb89071[_0xad88('0x17')](_0x283dfd);}return _0xb89071[_0xad88('0x18')](_0x283dfd)[_0xad88('0x19')]();};}function respondWithResult(_0x48905c,_0x29b222){_0x29b222=_0x29b222||0xc8;return function(_0x3fb839){if(_0x3fb839){return _0x48905c[_0xad88('0x18')](_0x29b222)[_0xad88('0x1a')](_0x3fb839);}};}function respondWithFilteredResult(_0x1ea15c,_0x11773f){return function(_0x196ab3){if(_0x196ab3){var _0x289043=typeof _0x11773f[_0xad88('0x1b')]===_0xad88('0x1c')&&typeof _0x11773f[_0xad88('0x1d')]===_0xad88('0x1c');var _0x39acab=_0x196ab3[_0xad88('0x1e')];var _0x22e46d=_0x289043?0x0:_0x11773f['offset'];var _0x196299=_0x289043?_0x196ab3['count']:_0x11773f['offset']+_0x11773f[_0xad88('0x1d')];var _0x14be17;if(_0x196299>=_0x39acab){_0x196299=_0x39acab;_0x14be17=0xc8;}else{_0x14be17=0xce;}_0x1ea15c['status'](_0x14be17);return _0x1ea15c['set'](_0xad88('0x1f'),_0x22e46d+'-'+_0x196299+'/'+_0x39acab)[_0xad88('0x1a')](_0x196ab3);}return null;};}function patchUpdates(_0x13baf1){return function(_0x2a1aa0){try{jsonpatch[_0xad88('0x20')](_0x2a1aa0,_0x13baf1,!![]);}catch(_0x210965){return BPromise[_0xad88('0x21')](_0x210965);}return _0x2a1aa0['save']();};}function saveUpdates(_0x3c67cb,_0x4ba7c6){return function(_0x1c69a8){if(_0x1c69a8){return _0x1c69a8['update'](_0x3c67cb)['then'](function(_0x1f5e53){return _0x1f5e53;});}return null;};}function removeEntity(_0x5495f9,_0x20ea92){return function(_0x46c8ab){if(_0x46c8ab){return _0x46c8ab[_0xad88('0x22')]()[_0xad88('0x23')](function(){var _0x231128=_0x46c8ab[_0xad88('0x24')]({'plain':!![]});var _0x517c32=_0xad88('0x25');return db[_0xad88('0x26')]['destroy']({'where':{'type':_0x517c32,'resourceId':_0x231128['id']}})['then'](function(){return _0x46c8ab;});})['then'](function(){_0x5495f9[_0xad88('0x18')](0xcc)[_0xad88('0x19')]();});}};}function handleEntityNotFound(_0x39b906,_0x13d581){return function(_0x4eddf9){if(!_0x4eddf9){_0x39b906[_0xad88('0x17')](0x194);}return _0x4eddf9;};}function handleError(_0x78ccc7,_0x6822be){_0x6822be=_0x6822be||0x1f4;return function(_0x24273a){logger[_0xad88('0x27')](_0x24273a[_0xad88('0x28')]);if(_0x24273a[_0xad88('0x29')]){delete _0x24273a[_0xad88('0x29')];}_0x78ccc7[_0xad88('0x18')](_0x6822be)[_0xad88('0x2a')](_0x24273a);};}exports[_0xad88('0x2b')]=function(_0x3d3afd,_0x331f21){var _0x1282a4={},_0x3d7c90={},_0x55756b={'count':0x0,'rows':[]};var _0x3b7c6c=_['map'](db[_0xad88('0x2c')][_0xad88('0x2d')],function(_0x2ed334){return{'name':_0x2ed334['fieldName'],'type':_0x2ed334[_0xad88('0x2e')]['key']};});_0x3d7c90[_0xad88('0x2f')]=_[_0xad88('0x30')](_0x3b7c6c,_0xad88('0x29'));_0x3d7c90[_0xad88('0x31')]=_[_0xad88('0x32')](_0x3d3afd['query']);_0x3d7c90[_0xad88('0x33')]=_[_0xad88('0x34')](_0x3d7c90[_0xad88('0x2f')],_0x3d7c90[_0xad88('0x31')]);_0x1282a4['attributes']=_['intersection'](_0x3d7c90[_0xad88('0x2f')],qs[_0xad88('0x35')](_0x3d3afd[_0xad88('0x31')]['fields']));_0x1282a4[_0xad88('0x36')]=_0x1282a4[_0xad88('0x36')][_0xad88('0x37')]?_0x1282a4[_0xad88('0x36')]:_0x3d7c90[_0xad88('0x2f')];if(!_0x3d3afd[_0xad88('0x31')][_0xad88('0x38')](_0xad88('0x39'))){_0x1282a4[_0xad88('0x1d')]=qs['limit'](_0x3d3afd[_0xad88('0x31')]['limit']);_0x1282a4[_0xad88('0x1b')]=qs[_0xad88('0x1b')](_0x3d3afd[_0xad88('0x31')][_0xad88('0x1b')]);}_0x1282a4[_0xad88('0x3a')]=qs[_0xad88('0x3b')](_0x3d3afd[_0xad88('0x31')][_0xad88('0x3b')]);_0x1282a4['where']=qs[_0xad88('0x33')](_[_0xad88('0x3c')](_0x3d3afd[_0xad88('0x31')],_0x3d7c90[_0xad88('0x33')]),_0x3b7c6c);if(_0x3d3afd[_0xad88('0x31')][_0xad88('0x3d')]){_0x1282a4[_0xad88('0x3e')]=_[_0xad88('0x3f')](_0x1282a4[_0xad88('0x3e')],{'$or':_[_0xad88('0x30')](_0x3b7c6c,function(_0x118cde){if(_0x118cde['type']!==_0xad88('0x40')){var _0x51d2dd={};_0x51d2dd[_0x118cde[_0xad88('0x29')]]={'$like':'%'+_0x3d3afd['query'][_0xad88('0x3d')]+'%'};return _0x51d2dd;}})});}_0x1282a4=_[_0xad88('0x3f')]({},_0x1282a4,_0x3d3afd[_0xad88('0x41')]);var _0x1b41b3={'where':_0x1282a4[_0xad88('0x3e')]};return db[_0xad88('0x2c')][_0xad88('0x1e')](_0x1b41b3)['then'](function(_0x36850f){_0x55756b[_0xad88('0x1e')]=_0x36850f;if(_0x3d3afd['query']['includeAll']){_0x1282a4[_0xad88('0x42')]=[{'all':!![]}];}return db[_0xad88('0x2c')]['findAll'](_0x1282a4);})[_0xad88('0x23')](function(_0x69e4b8){_0x55756b['rows']=_0x69e4b8;return _0x55756b;})[_0xad88('0x23')](respondWithFilteredResult(_0x331f21,_0x1282a4))[_0xad88('0x43')](handleError(_0x331f21,null));};exports[_0xad88('0x44')]=function(_0x3ab00a,_0x59c4bf){var _0x2a85d6={'raw':!![],'where':{'id':_0x3ab00a[_0xad88('0x45')]['id']}},_0x2c8644={};_0x2c8644[_0xad88('0x2f')]=_[_0xad88('0x32')](db[_0xad88('0x2c')]['rawAttributes']);_0x2c8644['query']=_[_0xad88('0x32')](_0x3ab00a['query']);_0x2c8644[_0xad88('0x33')]=_[_0xad88('0x34')](_0x2c8644[_0xad88('0x2f')],_0x2c8644[_0xad88('0x31')]);_0x2a85d6[_0xad88('0x36')]=_['intersection'](_0x2c8644[_0xad88('0x2f')],qs['fields'](_0x3ab00a[_0xad88('0x31')]['fields']));_0x2a85d6[_0xad88('0x36')]=_0x2a85d6[_0xad88('0x36')][_0xad88('0x37')]?_0x2a85d6[_0xad88('0x36')]:_0x2c8644[_0xad88('0x2f')];if(_0x3ab00a[_0xad88('0x31')]['includeAll']){_0x2a85d6[_0xad88('0x42')]=[{'all':!![]}];}_0x2a85d6=_['merge']({},_0x2a85d6,_0x3ab00a[_0xad88('0x41')]);return db[_0xad88('0x2c')][_0xad88('0x46')](_0x2a85d6)[_0xad88('0x23')](handleEntityNotFound(_0x59c4bf,null))[_0xad88('0x23')](respondWithResult(_0x59c4bf,null))[_0xad88('0x43')](handleError(_0x59c4bf,null));};exports[_0xad88('0x47')]=function(_0x36f768,_0x1e643f){return db[_0xad88('0x2c')][_0xad88('0x47')](_0x36f768['body'],{})['then'](function(_0x135ca3){var _0x7510ef=_0x36f768[_0xad88('0x48')][_0xad88('0x24')]({'plain':!![]});if(!_0x7510ef)throw new Error(_0xad88('0x49'));if(_0x7510ef['role']===_0xad88('0x48')){var _0x26be81=_0x135ca3[_0xad88('0x24')]({'plain':!![]});var _0x84b223=_0xad88('0x25');return db[_0xad88('0x4a')][_0xad88('0x46')]({'where':{'name':_0x84b223,'userProfileId':_0x7510ef[_0xad88('0x4b')]},'raw':!![]})[_0xad88('0x23')](function(_0x3330a4){if(_0x3330a4&&_0x3330a4[_0xad88('0x4c')]===0x0){return db['UserProfileResource'][_0xad88('0x47')]({'name':_0x26be81[_0xad88('0x29')],'resourceId':_0x26be81['id'],'type':_0x3330a4[_0xad88('0x29')],'sectionId':_0x3330a4['id']},{})[_0xad88('0x23')](function(){return _0x135ca3;});}else{return _0x135ca3;}})[_0xad88('0x43')](function(_0x2b6c18){logger[_0xad88('0x27')](_0xad88('0x4d'),_0x2b6c18);throw _0x2b6c18;});}return _0x135ca3;})['then'](respondWithResult(_0x1e643f,0xc9))[_0xad88('0x43')](handleError(_0x1e643f,null));};exports[_0xad88('0x4e')]=function(_0x2b70bb,_0x274ec9){if(_0x2b70bb[_0xad88('0x4f')]['id']){delete _0x2b70bb[_0xad88('0x4f')]['id'];}return db[_0xad88('0x2c')][_0xad88('0x46')]({'where':{'id':_0x2b70bb[_0xad88('0x45')]['id']}})[_0xad88('0x23')](handleEntityNotFound(_0x274ec9,null))[_0xad88('0x23')](saveUpdates(_0x2b70bb['body'],null))[_0xad88('0x23')](respondWithResult(_0x274ec9,null))[_0xad88('0x43')](handleError(_0x274ec9,null));};exports[_0xad88('0x22')]=function(_0x1cfd5b,_0x1b36ea){return db[_0xad88('0x2c')][_0xad88('0x46')]({'where':{'id':_0x1cfd5b[_0xad88('0x45')]['id']}})[_0xad88('0x23')](handleEntityNotFound(_0x1b36ea,null))[_0xad88('0x23')](removeEntity(_0x1b36ea,null))[_0xad88('0x43')](handleError(_0x1b36ea,null));};
\ No newline at end of file
index eb9f197..5d4ecaf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8aa0=['util','../../config/logger','api','moment','request-promise','path','rimraf','./template.attributes','exports','define'];(function(_0xf7800f,_0x240f1d){var _0x8cd67c=function(_0x314b09){while(--_0x314b09){_0xf7800f['push'](_0xf7800f['shift']());}};_0x8cd67c(++_0x240f1d);}(_0x8aa0,0x1c2));var _0x08aa=function(_0x26866b,_0x2bb2ea){_0x26866b=_0x26866b-0x0;var _0x2a7e49=_0x8aa0[_0x26866b];return _0x2a7e49;};'use strict';var _=require('lodash');var util=require(_0x08aa('0x0'));var logger=require(_0x08aa('0x1'))(_0x08aa('0x2'));var moment=require(_0x08aa('0x3'));var BPromise=require('bluebird');var rp=require(_0x08aa('0x4'));var fs=require('fs');var path=require(_0x08aa('0x5'));var rimraf=require(_0x08aa('0x6'));var config=require('../../config/environment');var attributes=require(_0x08aa('0x7'));module[_0x08aa('0x8')]=function(_0x563f29,_0x470f6f){return _0x563f29[_0x08aa('0x9')]('Template',attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe3ec=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','Template','tools_templates'];(function(_0x18834c,_0x174e3f){var _0xaa1d32=function(_0x7e0897){while(--_0x7e0897){_0x18834c['push'](_0x18834c['shift']());}};_0xaa1d32(++_0x174e3f);}(_0xe3ec,0x1ad));var _0xce3e=function(_0x229036,_0x5c077f){_0x229036=_0x229036-0x0;var _0x19a042=_0xe3ec[_0x229036];return _0x19a042;};'use strict';var _=require('lodash');var util=require(_0xce3e('0x0'));var logger=require(_0xce3e('0x1'))(_0xce3e('0x2'));var moment=require('moment');var BPromise=require(_0xce3e('0x3'));var rp=require(_0xce3e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xce3e('0x5'));var config=require(_0xce3e('0x6'));var attributes=require('./template.attributes');module[_0xce3e('0x7')]=function(_0xb497d0,_0x32d759){return _0xb497d0[_0xce3e('0x8')](_0xce3e('0x9'),attributes,{'tableName':_0xce3e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f74a80d..e7d6c1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x188d=['stringify','code','error','message','result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','map','include','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Template,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xd820de,_0x464700){var _0x47b0ae=function(_0x574cce){while(--_0x574cce){_0xd820de['push'](_0xd820de['shift']());}};_0x47b0ae(++_0x464700);}(_0x188d,0xdc));var _0xd188=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0x188d[_0x13ce0c];return _0x4388fb;};'use strict';var _=require(_0xd188('0x0'));var util=require('util');var moment=require(_0xd188('0x1'));var BPromise=require(_0xd188('0x2'));var rs=require(_0xd188('0x3'));var fs=require('fs');var Redis=require(_0xd188('0x4'));var db=require(_0xd188('0x5'))['db'];var utils=require(_0xd188('0x6'));var logger=require(_0xd188('0x7'))(_0xd188('0x8'));var config=require(_0xd188('0x9'));var jayson=require(_0xd188('0xa'));var client=jayson[_0xd188('0xb')][_0xd188('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b62c,_0x3b4ca2,_0x2aaa97){return new BPromise(function(_0x3d5694,_0x2640a3){return client['request'](_0x42b62c,_0x2aaa97)[_0xd188('0xd')](function(_0x3f5c9c){logger[_0xd188('0xe')](_0xd188('0xf'),_0x3b4ca2,_0xd188('0x10'));logger[_0xd188('0x11')]('Template,\x20%s,\x20%s,\x20%s',_0x3b4ca2,'request\x20sent',JSON[_0xd188('0x12')](_0x3f5c9c));if(_0x3f5c9c['error']){if(_0x3f5c9c['error'][_0xd188('0x13')]===0x1f4){logger[_0xd188('0x14')](_0xd188('0xf'),_0x3b4ca2,_0x3f5c9c[_0xd188('0x14')][_0xd188('0x15')]);return _0x2640a3(_0x3f5c9c[_0xd188('0x14')][_0xd188('0x15')]);}logger[_0xd188('0x14')](_0xd188('0xf'),_0x3b4ca2,_0x3f5c9c[_0xd188('0x14')][_0xd188('0x15')]);return _0x3d5694(_0x3f5c9c[_0xd188('0x14')][_0xd188('0x15')]);}else{logger[_0xd188('0xe')](_0xd188('0xf'),_0x3b4ca2,_0xd188('0x10'));_0x3d5694(_0x3f5c9c[_0xd188('0x16')][_0xd188('0x15')]);}})[_0xd188('0x17')](function(_0x48150b){logger[_0xd188('0x14')]('Template,\x20%s,\x20%s',_0x3b4ca2,_0x48150b);_0x2640a3(_0x48150b);});});}exports[_0xd188('0x18')]=function(_0x8e98f7){var _0x1bd6cb=this;return new Promise(function(_0x3eab48,_0x1ce7be){return db[_0xd188('0x19')][_0xd188('0x1a')]({'raw':_0x8e98f7[_0xd188('0x1b')]?_0x8e98f7[_0xd188('0x1b')][_0xd188('0x1c')]===undefined?!![]:![]:!![],'where':_0x8e98f7['options']?_0x8e98f7[_0xd188('0x1b')][_0xd188('0x1d')]||null:null,'attributes':_0x8e98f7[_0xd188('0x1b')]?_0x8e98f7[_0xd188('0x1b')][_0xd188('0x1e')]||null:null,'limit':_0x8e98f7[_0xd188('0x1b')]?_0x8e98f7['options']['limit']||null:null,'include':_0x8e98f7['options']?_0x8e98f7[_0xd188('0x1b')]['include']?_[_0xd188('0x1f')](_0x8e98f7['options'][_0xd188('0x20')],function(_0x179a57){return{'model':db[_0x179a57['model']],'as':_0x179a57['as'],'attributes':_0x179a57[_0xd188('0x1e')],'include':_0x179a57[_0xd188('0x20')]?_[_0xd188('0x1f')](_0x179a57[_0xd188('0x20')],function(_0x10c43d){return{'model':db[_0x10c43d[_0xd188('0x21')]],'as':_0x10c43d['as'],'attributes':_0x10c43d[_0xd188('0x1e')],'include':_0x10c43d[_0xd188('0x20')]?_[_0xd188('0x1f')](_0x10c43d[_0xd188('0x20')],function(_0x3b43cc){return{'model':db[_0x3b43cc['model']],'as':_0x3b43cc['as'],'attributes':_0x3b43cc['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x340f17){logger[_0xd188('0xe')]('GetTemplate',_0x8e98f7);logger[_0xd188('0x11')](_0xd188('0x18'),_0x8e98f7,JSON[_0xd188('0x12')](_0x340f17));_0x3eab48(_0x340f17);})['catch'](function(_0x3002b2){logger[_0xd188('0x14')](_0xd188('0x18'),_0x3002b2[_0xd188('0x15')],_0x8e98f7);_0x1ce7be(_0x1bd6cb[_0xd188('0x14')](0x1f4,_0x3002b2[_0xd188('0x15')]));});});};
\ No newline at end of file
+var _0xbb65=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','Template,\x20%s,\x20%s','message','result','catch','GetTemplate','findAll','options','raw','where','limit','include','map','model','attributes','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x1dff81,_0x5d48c9){var _0x11d125=function(_0x37c81f){while(--_0x37c81f){_0x1dff81['push'](_0x1dff81['shift']());}};_0x11d125(++_0x5d48c9);}(_0xbb65,0x9b));var _0x5bb6=function(_0x49f24d,_0x2e0572){_0x49f24d=_0x49f24d-0x0;var _0xc4d301=_0xbb65[_0x49f24d];return _0xc4d301;};'use strict';var _=require(_0x5bb6('0x0'));var util=require('util');var moment=require(_0x5bb6('0x1'));var BPromise=require(_0x5bb6('0x2'));var rs=require(_0x5bb6('0x3'));var fs=require('fs');var Redis=require(_0x5bb6('0x4'));var db=require(_0x5bb6('0x5'))['db'];var utils=require(_0x5bb6('0x6'));var logger=require(_0x5bb6('0x7'))('rpc');var config=require(_0x5bb6('0x8'));var jayson=require(_0x5bb6('0x9'));var client=jayson[_0x5bb6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x564d37,_0x5aa2d7,_0x403d7c){return new BPromise(function(_0x84934c,_0x5ab5eb){return client['request'](_0x564d37,_0x403d7c)[_0x5bb6('0xb')](function(_0x408c9c){logger[_0x5bb6('0xc')]('Template,\x20%s,\x20%s',_0x5aa2d7,_0x5bb6('0xd'));logger[_0x5bb6('0xe')](_0x5bb6('0xf'),_0x5aa2d7,'request\x20sent',JSON[_0x5bb6('0x10')](_0x408c9c));if(_0x408c9c[_0x5bb6('0x11')]){if(_0x408c9c['error']['code']===0x1f4){logger[_0x5bb6('0x11')](_0x5bb6('0x12'),_0x5aa2d7,_0x408c9c['error']['message']);return _0x5ab5eb(_0x408c9c['error'][_0x5bb6('0x13')]);}logger['error'](_0x5bb6('0x12'),_0x5aa2d7,_0x408c9c[_0x5bb6('0x11')][_0x5bb6('0x13')]);return _0x84934c(_0x408c9c[_0x5bb6('0x11')]['message']);}else{logger[_0x5bb6('0xc')](_0x5bb6('0x12'),_0x5aa2d7,'request\x20sent');_0x84934c(_0x408c9c[_0x5bb6('0x14')]['message']);}})[_0x5bb6('0x15')](function(_0x5782f0){logger[_0x5bb6('0x11')]('Template,\x20%s,\x20%s',_0x5aa2d7,_0x5782f0);_0x5ab5eb(_0x5782f0);});});}exports[_0x5bb6('0x16')]=function(_0x2f469c){var _0x5a484c=this;return new Promise(function(_0x5b5edc,_0x2bb734){return db['Template'][_0x5bb6('0x17')]({'raw':_0x2f469c['options']?_0x2f469c[_0x5bb6('0x18')][_0x5bb6('0x19')]===undefined?!![]:![]:!![],'where':_0x2f469c['options']?_0x2f469c[_0x5bb6('0x18')][_0x5bb6('0x1a')]||null:null,'attributes':_0x2f469c[_0x5bb6('0x18')]?_0x2f469c[_0x5bb6('0x18')]['attributes']||null:null,'limit':_0x2f469c['options']?_0x2f469c[_0x5bb6('0x18')][_0x5bb6('0x1b')]||null:null,'include':_0x2f469c[_0x5bb6('0x18')]?_0x2f469c[_0x5bb6('0x18')][_0x5bb6('0x1c')]?_[_0x5bb6('0x1d')](_0x2f469c[_0x5bb6('0x18')][_0x5bb6('0x1c')],function(_0x3dba9b){return{'model':db[_0x3dba9b[_0x5bb6('0x1e')]],'as':_0x3dba9b['as'],'attributes':_0x3dba9b[_0x5bb6('0x1f')],'include':_0x3dba9b[_0x5bb6('0x1c')]?_[_0x5bb6('0x1d')](_0x3dba9b['include'],function(_0x3fcf04){return{'model':db[_0x3fcf04[_0x5bb6('0x1e')]],'as':_0x3fcf04['as'],'attributes':_0x3fcf04[_0x5bb6('0x1f')],'include':_0x3fcf04[_0x5bb6('0x1c')]?_['map'](_0x3fcf04[_0x5bb6('0x1c')],function(_0x2ad836){return{'model':db[_0x2ad836[_0x5bb6('0x1e')]],'as':_0x2ad836['as'],'attributes':_0x2ad836['attributes']};}):[]};}):[]};}):[]:[]})[_0x5bb6('0xb')](function(_0x5a7651){logger['info'](_0x5bb6('0x16'),_0x2f469c);logger['debug'](_0x5bb6('0x16'),_0x2f469c,JSON[_0x5bb6('0x10')](_0x5a7651));_0x5b5edc(_0x5a7651);})[_0x5bb6('0x15')](function(_0x48c7c6){logger['error'](_0x5bb6('0x16'),_0x48c7c6[_0x5bb6('0x13')],_0x2f469c);_0x2bb734(_0x5a484c['error'](0x1f4,_0x48c7c6[_0x5bb6('0x13')]));});});};
\ No newline at end of file
index 9444199..1933200 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe813=['post','addAllCondition','addAnyCondition','addAction','put','/:id','update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/all_conditions','/:id/any_conditions','/:id/actions','getActions'];(function(_0x540311,_0x53ca8b){var _0x56beef=function(_0x2cb4e8){while(--_0x2cb4e8){_0x540311['push'](_0x540311['shift']());}};_0x56beef(++_0x53ca8b);}(_0xe813,0x1b2));var _0x3e81=function(_0x43139e,_0x762629){_0x43139e=_0x43139e-0x0;var _0x2bc838=_0xe813[_0x43139e];return _0x2bc838;};'use strict';var multer=require('multer');var util=require(_0x3e81('0x0'));var path=require(_0x3e81('0x1'));var timeout=require(_0x3e81('0x2'));var express=require('express');var router=express[_0x3e81('0x3')]();var fs_extra=require(_0x3e81('0x4'));var auth=require(_0x3e81('0x5'));var interaction=require(_0x3e81('0x6'));var config=require(_0x3e81('0x7'));var controller=require('./trigger.controller');router[_0x3e81('0x8')]('/',auth[_0x3e81('0x9')](),controller[_0x3e81('0xa')]);router[_0x3e81('0x8')]('/:id',auth[_0x3e81('0x9')](),controller[_0x3e81('0xb')]);router[_0x3e81('0x8')](_0x3e81('0xc'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0x3e81('0x8')](_0x3e81('0xd'),auth[_0x3e81('0x9')](),controller['getAnyConditions']);router['get'](_0x3e81('0xe'),auth[_0x3e81('0x9')](),controller[_0x3e81('0xf')]);router['post']('/',auth[_0x3e81('0x9')](),controller['create']);router[_0x3e81('0x10')]('/:id/all_conditions',auth[_0x3e81('0x9')](),controller[_0x3e81('0x11')]);router[_0x3e81('0x10')](_0x3e81('0xd'),auth[_0x3e81('0x9')](),controller[_0x3e81('0x12')]);router[_0x3e81('0x10')]('/:id/actions',auth[_0x3e81('0x9')](),controller[_0x3e81('0x13')]);router[_0x3e81('0x14')](_0x3e81('0x15'),auth[_0x3e81('0x9')](),controller[_0x3e81('0x16')]);router['delete'](_0x3e81('0x15'),auth[_0x3e81('0x9')](),controller[_0x3e81('0x17')]);module[_0x3e81('0x18')]=router;
\ No newline at end of file
+var _0x437f=['post','create','addAllCondition','addAnyCondition','addAction','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','/:id/any_conditions','/:id/actions'];(function(_0x3124f8,_0x1a8b23){var _0x5bab5f=function(_0x18b09b){while(--_0x18b09b){_0x3124f8['push'](_0x3124f8['shift']());}};_0x5bab5f(++_0x1a8b23);}(_0x437f,0x14c));var _0xf437=function(_0x1a697e,_0x130466){_0x1a697e=_0x1a697e-0x0;var _0x40e871=_0x437f[_0x1a697e];return _0x40e871;};'use strict';var multer=require(_0xf437('0x0'));var util=require(_0xf437('0x1'));var path=require(_0xf437('0x2'));var timeout=require(_0xf437('0x3'));var express=require(_0xf437('0x4'));var router=express[_0xf437('0x5')]();var fs_extra=require(_0xf437('0x6'));var auth=require(_0xf437('0x7'));var interaction=require(_0xf437('0x8'));var config=require(_0xf437('0x9'));var controller=require(_0xf437('0xa'));router[_0xf437('0xb')]('/',auth[_0xf437('0xc')](),controller[_0xf437('0xd')]);router[_0xf437('0xb')](_0xf437('0xe'),auth['isAuthenticated'](),controller[_0xf437('0xf')]);router[_0xf437('0xb')](_0xf437('0x10'),auth[_0xf437('0xc')](),controller['getAllConditions']);router['get'](_0xf437('0x11'),auth[_0xf437('0xc')](),controller['getAnyConditions']);router[_0xf437('0xb')](_0xf437('0x12'),auth[_0xf437('0xc')](),controller['getActions']);router[_0xf437('0x13')]('/',auth[_0xf437('0xc')](),controller[_0xf437('0x14')]);router[_0xf437('0x13')](_0xf437('0x10'),auth[_0xf437('0xc')](),controller[_0xf437('0x15')]);router[_0xf437('0x13')]('/:id/any_conditions',auth[_0xf437('0xc')](),controller[_0xf437('0x16')]);router['post'](_0xf437('0x12'),auth[_0xf437('0xc')](),controller[_0xf437('0x17')]);router[_0xf437('0x18')](_0xf437('0xe'),auth[_0xf437('0xc')](),controller[_0xf437('0x19')]);router[_0xf437('0x1a')](_0xf437('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index e864e41..166fc04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf20a=['exports','STRING','BOOLEAN'];(function(_0x55f462,_0xfee74c){var _0x2935fb=function(_0x84349e){while(--_0x84349e){_0x55f462['push'](_0x55f462['shift']());}};_0x2935fb(++_0xfee74c);}(_0xf20a,0x15c));var _0xaf20=function(_0x5d8021,_0x2ca412){_0x5d8021=_0x5d8021-0x0;var _0x43799d=_0xf20a[_0x5d8021];return _0x43799d;};'use strict';var Sequelize=require('sequelize');module[_0xaf20('0x0')]={'name':{'type':Sequelize[_0xaf20('0x1')]},'channel':{'type':Sequelize[_0xaf20('0x1')]},'description':{'type':Sequelize[_0xaf20('0x1')]},'status':{'type':Sequelize[_0xaf20('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x1c56=['sequelize','exports','STRING','BOOLEAN'];(function(_0x30bf72,_0x5ab031){var _0x5a78e6=function(_0x25f62b){while(--_0x25f62b){_0x30bf72['push'](_0x30bf72['shift']());}};_0x5a78e6(++_0x5ab031);}(_0x1c56,0x1bc));var _0x61c5=function(_0x25c326,_0x250137){_0x25c326=_0x25c326-0x0;var _0x762452=_0x1c56[_0x25c326];return _0x762452;};'use strict';var Sequelize=require(_0x61c5('0x0'));module[_0x61c5('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x61c5('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x61c5('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 9cc6a16..32dfbad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x873f=['Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','options','include','findAll','rows','catch','show','params','Trigger','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','TriggerAllId','addAnyCondition','TriggerAnyId','Condition','getAllConditions','findOne','order','pick','nolimit','getAnyConditions'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x873f,0x122));var _0xf873=function(_0x428ae4,_0x598084){_0x428ae4=_0x428ae4-0x0;var _0x1911a1=_0x873f[_0x428ae4];return _0x1911a1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf873('0x0'));var zipdir=require(_0xf873('0x1'));var jsonpatch=require(_0xf873('0x2'));var rp=require(_0xf873('0x3'));var moment=require('moment');var BPromise=require(_0xf873('0x4'));var Mustache=require(_0xf873('0x5'));var util=require(_0xf873('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xf873('0x7'));var ejs=require(_0xf873('0x8'));var fs=require('fs');var fs_extra=require(_0xf873('0x9'));var _=require(_0xf873('0xa'));var squel=require(_0xf873('0xb'));var crypto=require(_0xf873('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf873('0xd'));var Papa=require(_0xf873('0xe'));var Redis=require(_0xf873('0xf'));var authService=require(_0xf873('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf873('0x11'));var hardwareService=require(_0xf873('0x12'));var logger=require(_0xf873('0x13'))(_0xf873('0x14'));var utils=require(_0xf873('0x15'));var config=require(_0xf873('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c024a,_0xfce7b){_0xfce7b=_0xfce7b||0xcc;return function(_0x306d0e){if(_0x306d0e){return _0x3c024a[_0xf873('0x17')](_0xfce7b);}return _0x3c024a[_0xf873('0x18')](_0xfce7b)[_0xf873('0x19')]();};}function respondWithResult(_0xdacaca,_0x1dce78){_0x1dce78=_0x1dce78||0xc8;return function(_0x4ba378){if(_0x4ba378){return _0xdacaca[_0xf873('0x18')](_0x1dce78)[_0xf873('0x1a')](_0x4ba378);}};}function respondWithFilteredResult(_0xfdab53,_0x227ddd){return function(_0x244fce){if(_0x244fce){var _0x32109a=typeof _0x227ddd[_0xf873('0x1b')]===_0xf873('0x1c')&&typeof _0x227ddd[_0xf873('0x1d')]===_0xf873('0x1c');var _0x167e78=_0x244fce[_0xf873('0x1e')];var _0x171ad5=_0x32109a?0x0:_0x227ddd[_0xf873('0x1b')];var _0x31ea39=_0x32109a?_0x244fce[_0xf873('0x1e')]:_0x227ddd['offset']+_0x227ddd[_0xf873('0x1d')];var _0x1690a1;if(_0x31ea39>=_0x167e78){_0x31ea39=_0x167e78;_0x1690a1=0xc8;}else{_0x1690a1=0xce;}_0xfdab53['status'](_0x1690a1);return _0xfdab53[_0xf873('0x1f')](_0xf873('0x20'),_0x171ad5+'-'+_0x31ea39+'/'+_0x167e78)[_0xf873('0x1a')](_0x244fce);}return null;};}function patchUpdates(_0x3a8844){return function(_0x25484c){try{jsonpatch[_0xf873('0x21')](_0x25484c,_0x3a8844,!![]);}catch(_0x475104){return BPromise[_0xf873('0x22')](_0x475104);}return _0x25484c[_0xf873('0x23')]();};}function saveUpdates(_0x33ffbe,_0x3720aa){return function(_0x367234){if(_0x367234){return _0x367234['update'](_0x33ffbe)[_0xf873('0x24')](function(_0x4a76c8){return _0x4a76c8;});}return null;};}function removeEntity(_0x305899,_0x9d4acd){return function(_0x1e2e42){if(_0x1e2e42){return _0x1e2e42[_0xf873('0x25')]()['then'](function(){var _0x5066bf=_0x1e2e42[_0xf873('0x26')]({'plain':!![]});var _0x191ea8=_0xf873('0x27');return db[_0xf873('0x28')][_0xf873('0x25')]({'where':{'type':_0x191ea8,'resourceId':_0x5066bf['id']}})[_0xf873('0x24')](function(){return _0x1e2e42;});})[_0xf873('0x24')](function(){_0x305899['status'](0xcc)[_0xf873('0x19')]();});}};}function handleEntityNotFound(_0x172821,_0x58f825){return function(_0xec5428){if(!_0xec5428){_0x172821['sendStatus'](0x194);}return _0xec5428;};}function handleError(_0xfe39f1,_0x4f4c72){_0x4f4c72=_0x4f4c72||0x1f4;return function(_0xd93bb8){logger[_0xf873('0x29')](_0xd93bb8[_0xf873('0x2a')]);if(_0xd93bb8[_0xf873('0x2b')]){delete _0xd93bb8[_0xf873('0x2b')];}_0xfe39f1[_0xf873('0x18')](_0x4f4c72)[_0xf873('0x2c')](_0xd93bb8);};}exports[_0xf873('0x2d')]=function(_0x34a564,_0x48c02a){var _0x28e7c4={},_0x1df36e={},_0x1b6afc={'count':0x0,'rows':[]};var _0x5065ee=_[_0xf873('0x2e')](db['Trigger'][_0xf873('0x2f')],function(_0x278d7a){return{'name':_0x278d7a[_0xf873('0x30')],'type':_0x278d7a[_0xf873('0x31')][_0xf873('0x32')]};});_0x1df36e[_0xf873('0x33')]=_[_0xf873('0x2e')](_0x5065ee,_0xf873('0x2b'));_0x1df36e[_0xf873('0x34')]=_[_0xf873('0x35')](_0x34a564[_0xf873('0x34')]);_0x1df36e[_0xf873('0x36')]=_[_0xf873('0x37')](_0x1df36e[_0xf873('0x33')],_0x1df36e[_0xf873('0x34')]);_0x28e7c4[_0xf873('0x38')]=_[_0xf873('0x37')](_0x1df36e[_0xf873('0x33')],qs['fields'](_0x34a564[_0xf873('0x34')][_0xf873('0x39')]));_0x28e7c4['attributes']=_0x28e7c4[_0xf873('0x38')][_0xf873('0x3a')]?_0x28e7c4['attributes']:_0x1df36e[_0xf873('0x33')];if(!_0x34a564['query'][_0xf873('0x3b')]('nolimit')){_0x28e7c4[_0xf873('0x1d')]=qs[_0xf873('0x1d')](_0x34a564[_0xf873('0x34')][_0xf873('0x1d')]);_0x28e7c4[_0xf873('0x1b')]=qs[_0xf873('0x1b')](_0x34a564[_0xf873('0x34')][_0xf873('0x1b')]);}_0x28e7c4['order']=qs['sort'](_0x34a564['query'][_0xf873('0x3c')]);_0x28e7c4[_0xf873('0x3d')]=qs['filters'](_['pick'](_0x34a564[_0xf873('0x34')],_0x1df36e[_0xf873('0x36')]),_0x5065ee);if(_0x34a564['query'][_0xf873('0x3e')]){_0x28e7c4[_0xf873('0x3d')]=_[_0xf873('0x3f')](_0x28e7c4[_0xf873('0x3d')],{'$or':_[_0xf873('0x2e')](_0x5065ee,function(_0x1c5df7){if(_0x1c5df7['type']!=='VIRTUAL'){var _0xfed554={};_0xfed554[_0x1c5df7[_0xf873('0x2b')]]={'$like':'%'+_0x34a564[_0xf873('0x34')]['filter']+'%'};return _0xfed554;}})});}_0x28e7c4=_['merge']({},_0x28e7c4,_0x34a564[_0xf873('0x40')]);var _0x3cb2ca={'where':_0x28e7c4[_0xf873('0x3d')]};return db['Trigger'][_0xf873('0x1e')](_0x3cb2ca)[_0xf873('0x24')](function(_0x2ab07e){_0x1b6afc[_0xf873('0x1e')]=_0x2ab07e;if(_0x34a564[_0xf873('0x34')]['includeAll']){_0x28e7c4[_0xf873('0x41')]=[{'all':!![]}];}return db['Trigger'][_0xf873('0x42')](_0x28e7c4);})['then'](function(_0xba1344){_0x1b6afc[_0xf873('0x43')]=_0xba1344;return _0x1b6afc;})['then'](respondWithFilteredResult(_0x48c02a,_0x28e7c4))[_0xf873('0x44')](handleError(_0x48c02a,null));};exports[_0xf873('0x45')]=function(_0x534e9a,_0x2fb908){var _0x23af2d={'raw':![],'where':{'id':_0x534e9a[_0xf873('0x46')]['id']}},_0x28f519={};_0x28f519['model']=_[_0xf873('0x35')](db[_0xf873('0x47')][_0xf873('0x2f')]);_0x28f519[_0xf873('0x34')]=_['keys'](_0x534e9a[_0xf873('0x34')]);_0x28f519[_0xf873('0x36')]=_[_0xf873('0x37')](_0x28f519[_0xf873('0x33')],_0x28f519[_0xf873('0x34')]);_0x23af2d[_0xf873('0x38')]=_[_0xf873('0x37')](_0x28f519[_0xf873('0x33')],qs[_0xf873('0x39')](_0x534e9a[_0xf873('0x34')][_0xf873('0x39')]));_0x23af2d[_0xf873('0x38')]=_0x23af2d[_0xf873('0x38')][_0xf873('0x3a')]?_0x23af2d[_0xf873('0x38')]:_0x28f519[_0xf873('0x33')];if(_0x534e9a[_0xf873('0x34')][_0xf873('0x48')]){_0x23af2d['include']=[{'all':!![]}];}_0x23af2d=_[_0xf873('0x3f')]({},_0x23af2d,_0x534e9a[_0xf873('0x40')]);return db[_0xf873('0x47')][_0xf873('0x49')](_0x23af2d)[_0xf873('0x24')](handleEntityNotFound(_0x2fb908,null))[_0xf873('0x24')](respondWithResult(_0x2fb908,null))[_0xf873('0x44')](handleError(_0x2fb908,null));};exports[_0xf873('0x4a')]=function(_0x41232a,_0x381e45){return db[_0xf873('0x47')]['create'](_0x41232a['body'],{})[_0xf873('0x24')](function(_0x22939c){var _0x3ecc6a=_0x41232a[_0xf873('0x4b')][_0xf873('0x26')]({'plain':!![]});if(!_0x3ecc6a)throw new Error(_0xf873('0x4c'));if(_0x3ecc6a[_0xf873('0x4d')]===_0xf873('0x4b')){var _0x4707b2=_0x22939c[_0xf873('0x26')]({'plain':!![]});var _0x5dfa8a=_0xf873('0x27');return db[_0xf873('0x4e')][_0xf873('0x49')]({'where':{'name':_0x5dfa8a,'userProfileId':_0x3ecc6a[_0xf873('0x4f')]},'raw':!![]})[_0xf873('0x24')](function(_0x4573e5){if(_0x4573e5&&_0x4573e5[_0xf873('0x50')]===0x0){return db['UserProfileResource'][_0xf873('0x4a')]({'name':_0x4707b2[_0xf873('0x2b')],'resourceId':_0x4707b2['id'],'type':_0x4573e5['name'],'sectionId':_0x4573e5['id']},{})['then'](function(){return _0x22939c;});}else{return _0x22939c;}})[_0xf873('0x44')](function(_0x314d7b){logger['error'](_0xf873('0x51'),_0x314d7b);throw _0x314d7b;});}return _0x22939c;})[_0xf873('0x24')](respondWithResult(_0x381e45,0xc9))[_0xf873('0x44')](handleError(_0x381e45,null));};exports[_0xf873('0x52')]=function(_0x503043,_0x2278bc){if(_0x503043[_0xf873('0x53')]['id']){delete _0x503043[_0xf873('0x53')]['id'];}return db[_0xf873('0x47')][_0xf873('0x49')]({'where':{'id':_0x503043['params']['id']}})[_0xf873('0x24')](handleEntityNotFound(_0x2278bc,null))['then'](saveUpdates(_0x503043['body'],null))[_0xf873('0x24')](respondWithResult(_0x2278bc,null))['catch'](handleError(_0x2278bc,null));};exports[_0xf873('0x25')]=function(_0x589f9d,_0x12c725){return db[_0xf873('0x47')][_0xf873('0x49')]({'where':{'id':_0x589f9d['params']['id']}})[_0xf873('0x24')](handleEntityNotFound(_0x12c725,null))[_0xf873('0x24')](removeEntity(_0x12c725,null))['catch'](handleError(_0x12c725,null));};exports['addAllCondition']=function(_0x286ce8,_0x394875,_0x415fca){if(_0x286ce8[_0xf873('0x53')]['id']){delete _0x286ce8['body']['id'];}return db[_0xf873('0x47')][_0xf873('0x49')]({'where':{'id':_0x286ce8[_0xf873('0x46')]['id']}})['then'](handleEntityNotFound(_0x394875,null))[_0xf873('0x24')](function(_0x38a80f){if(_0x38a80f){_0x286ce8['body'][_0xf873('0x54')]=_0x38a80f['id'];return db['Condition'][_0xf873('0x4a')](_0x286ce8[_0xf873('0x53')]);}})[_0xf873('0x24')](respondWithResult(_0x394875,null))[_0xf873('0x44')](handleError(_0x394875,null));};exports[_0xf873('0x55')]=function(_0x2f91bd,_0x3c7ac0,_0x3baaaf){if(_0x2f91bd[_0xf873('0x53')]['id']){delete _0x2f91bd[_0xf873('0x53')]['id'];}return db[_0xf873('0x47')][_0xf873('0x49')]({'where':{'id':_0x2f91bd['params']['id']}})[_0xf873('0x24')](handleEntityNotFound(_0x3c7ac0,null))['then'](function(_0x1bf644){if(_0x1bf644){_0x2f91bd[_0xf873('0x53')][_0xf873('0x56')]=_0x1bf644['id'];return db[_0xf873('0x57')]['create'](_0x2f91bd[_0xf873('0x53')]);}})[_0xf873('0x24')](respondWithResult(_0x3c7ac0,null))['catch'](handleError(_0x3c7ac0,null));};exports[_0xf873('0x58')]=function(_0x17bb68,_0x4de6e2,_0x33b9b2){var _0x557872={};var _0x4763de={};var _0x511518;var _0x3cc41a;return db[_0xf873('0x47')][_0xf873('0x59')]({'where':{'id':_0x17bb68[_0xf873('0x46')]['id']}})[_0xf873('0x24')](handleEntityNotFound(_0x4de6e2,null))[_0xf873('0x24')](function(_0x1bcf0c){if(_0x1bcf0c){_0x511518=_0x1bcf0c;_0x4763de['model']=_[_0xf873('0x35')](db[_0xf873('0x57')]['rawAttributes']);_0x4763de['query']=_[_0xf873('0x35')](_0x17bb68[_0xf873('0x34')]);_0x4763de[_0xf873('0x36')]=_['intersection'](_0x4763de['model'],_0x4763de[_0xf873('0x34')]);_0x557872[_0xf873('0x38')]=_[_0xf873('0x37')](_0x4763de['model'],qs[_0xf873('0x39')](_0x17bb68[_0xf873('0x34')][_0xf873('0x39')]));_0x557872['attributes']=_0x557872['attributes']['length']?_0x557872[_0xf873('0x38')]:_0x4763de['model'];_0x557872[_0xf873('0x5a')]=qs[_0xf873('0x3c')](_0x17bb68[_0xf873('0x34')][_0xf873('0x3c')]);_0x557872['where']=qs[_0xf873('0x36')](_[_0xf873('0x5b')](_0x17bb68[_0xf873('0x34')],_0x4763de['filters']));if(_0x17bb68['query'][_0xf873('0x3e')]){_0x557872[_0xf873('0x3d')]=_[_0xf873('0x3f')](_0x557872[_0xf873('0x3d')],{'$or':_[_0xf873('0x2e')](_0x557872[_0xf873('0x38')],function(_0x1e13ca){var _0x473b77={};_0x473b77[_0x1e13ca]={'$like':'%'+_0x17bb68[_0xf873('0x34')]['filter']+'%'};return _0x473b77;})});}_0x557872=_[_0xf873('0x3f')]({},_0x557872,_0x17bb68[_0xf873('0x40')]);return _0x511518['getAllConditions'](_0x557872);}})[_0xf873('0x24')](function(_0x362c84){if(_0x362c84){_0x3cc41a=_0x362c84[_0xf873('0x3a')];if(!_0x17bb68['query'][_0xf873('0x3b')]('nolimit')){_0x557872[_0xf873('0x1d')]=qs['limit'](_0x17bb68['query'][_0xf873('0x1d')]);_0x557872[_0xf873('0x1b')]=qs['offset'](_0x17bb68[_0xf873('0x34')][_0xf873('0x1b')]);}return _0x511518['getAllConditions'](_0x557872);}})[_0xf873('0x24')](function(_0x5dce4e){if(_0x5dce4e){return _0x5dce4e?{'count':_0x3cc41a,'rows':_0x5dce4e}:null;}})[_0xf873('0x24')](respondWithResult(_0x4de6e2,null))['catch'](handleError(_0x4de6e2,null));};exports['getAnyConditions']=function(_0x34ef46,_0x59d462,_0x35f0bc){var _0x5b98cc={};var _0x3308dd={};var _0x15e12f;var _0x499260;return db[_0xf873('0x47')]['findOne']({'where':{'id':_0x34ef46[_0xf873('0x46')]['id']}})[_0xf873('0x24')](handleEntityNotFound(_0x59d462,null))['then'](function(_0x47643f){if(_0x47643f){_0x15e12f=_0x47643f;_0x3308dd['model']=_[_0xf873('0x35')](db[_0xf873('0x57')]['rawAttributes']);_0x3308dd['query']=_['keys'](_0x34ef46[_0xf873('0x34')]);_0x3308dd['filters']=_[_0xf873('0x37')](_0x3308dd['model'],_0x3308dd[_0xf873('0x34')]);_0x5b98cc[_0xf873('0x38')]=_['intersection'](_0x3308dd[_0xf873('0x33')],qs[_0xf873('0x39')](_0x34ef46[_0xf873('0x34')][_0xf873('0x39')]));_0x5b98cc[_0xf873('0x38')]=_0x5b98cc[_0xf873('0x38')][_0xf873('0x3a')]?_0x5b98cc[_0xf873('0x38')]:_0x3308dd[_0xf873('0x33')];_0x5b98cc[_0xf873('0x5a')]=qs['sort'](_0x34ef46[_0xf873('0x34')][_0xf873('0x3c')]);_0x5b98cc[_0xf873('0x3d')]=qs[_0xf873('0x36')](_[_0xf873('0x5b')](_0x34ef46['query'],_0x3308dd[_0xf873('0x36')]));if(_0x34ef46[_0xf873('0x34')]['filter']){_0x5b98cc[_0xf873('0x3d')]=_[_0xf873('0x3f')](_0x5b98cc[_0xf873('0x3d')],{'$or':_[_0xf873('0x2e')](_0x5b98cc[_0xf873('0x38')],function(_0x4111fa){var _0x7ca57e={};_0x7ca57e[_0x4111fa]={'$like':'%'+_0x34ef46['query']['filter']+'%'};return _0x7ca57e;})});}_0x5b98cc=_['merge']({},_0x5b98cc,_0x34ef46['options']);return _0x15e12f['getAnyConditions'](_0x5b98cc);}})[_0xf873('0x24')](function(_0x1952c9){if(_0x1952c9){_0x499260=_0x1952c9[_0xf873('0x3a')];if(!_0x34ef46[_0xf873('0x34')][_0xf873('0x3b')](_0xf873('0x5c'))){_0x5b98cc[_0xf873('0x1d')]=qs[_0xf873('0x1d')](_0x34ef46[_0xf873('0x34')][_0xf873('0x1d')]);_0x5b98cc[_0xf873('0x1b')]=qs['offset'](_0x34ef46[_0xf873('0x34')]['offset']);}return _0x15e12f[_0xf873('0x5d')](_0x5b98cc);}})[_0xf873('0x24')](function(_0x5cd341){if(_0x5cd341){return _0x5cd341?{'count':_0x499260,'rows':_0x5cd341}:null;}})[_0xf873('0x24')](respondWithResult(_0x59d462,null))[_0xf873('0x44')](handleError(_0x59d462,null));};exports['addAction']=function(_0x6d3629,_0x212a15,_0x8978bc){if(_0x6d3629['body']['id']){delete _0x6d3629[_0xf873('0x53')]['id'];}return db[_0xf873('0x47')]['find']({'where':{'id':_0x6d3629[_0xf873('0x46')]['id']}})['then'](handleEntityNotFound(_0x212a15,null))['then'](function(_0x150db1){if(_0x150db1){_0x6d3629[_0xf873('0x53')]['TriggerId']=_0x150db1['id'];return db[_0xf873('0x5e')][_0xf873('0x4a')](_0x6d3629['body']);}})[_0xf873('0x24')](respondWithResult(_0x212a15,null))['catch'](handleError(_0x212a15,null));};exports[_0xf873('0x5f')]=function(_0x1aae78,_0x181afb,_0x899dda){var _0x533b32={};var _0x349247={};var _0x336c72;var _0x58a073;return db[_0xf873('0x47')][_0xf873('0x59')]({'where':{'id':_0x1aae78[_0xf873('0x46')]['id']}})[_0xf873('0x24')](handleEntityNotFound(_0x181afb,null))[_0xf873('0x24')](function(_0x374f0c){if(_0x374f0c){_0x336c72=_0x374f0c;_0x349247['model']=_[_0xf873('0x35')](db[_0xf873('0x5e')][_0xf873('0x2f')]);_0x349247[_0xf873('0x34')]=_[_0xf873('0x35')](_0x1aae78[_0xf873('0x34')]);_0x349247[_0xf873('0x36')]=_[_0xf873('0x37')](_0x349247['model'],_0x349247[_0xf873('0x34')]);_0x533b32[_0xf873('0x38')]=_[_0xf873('0x37')](_0x349247['model'],qs[_0xf873('0x39')](_0x1aae78[_0xf873('0x34')][_0xf873('0x39')]));_0x533b32['attributes']=_0x533b32[_0xf873('0x38')][_0xf873('0x3a')]?_0x533b32[_0xf873('0x38')]:_0x349247[_0xf873('0x33')];_0x533b32[_0xf873('0x5a')]=qs[_0xf873('0x3c')](_0x1aae78[_0xf873('0x34')][_0xf873('0x3c')]);_0x533b32[_0xf873('0x3d')]=qs[_0xf873('0x36')](_[_0xf873('0x5b')](_0x1aae78[_0xf873('0x34')],_0x349247[_0xf873('0x36')]));if(_0x1aae78[_0xf873('0x34')][_0xf873('0x3e')]){_0x533b32['where']=_[_0xf873('0x3f')](_0x533b32[_0xf873('0x3d')],{'$or':_[_0xf873('0x2e')](_0x533b32[_0xf873('0x38')],function(_0x5b2659){var _0x485a7a={};_0x485a7a[_0x5b2659]={'$like':'%'+_0x1aae78['query']['filter']+'%'};return _0x485a7a;})});}_0x533b32=_[_0xf873('0x3f')]({},_0x533b32,_0x1aae78['options']);return _0x336c72[_0xf873('0x5f')](_0x533b32);}})[_0xf873('0x24')](function(_0x22cce6){if(_0x22cce6){_0x58a073=_0x22cce6[_0xf873('0x3a')];if(!_0x1aae78[_0xf873('0x34')]['hasOwnProperty'](_0xf873('0x5c'))){_0x533b32[_0xf873('0x1d')]=qs[_0xf873('0x1d')](_0x1aae78['query']['limit']);_0x533b32['offset']=qs[_0xf873('0x1b')](_0x1aae78[_0xf873('0x34')][_0xf873('0x1b')]);}return _0x336c72[_0xf873('0x5f')](_0x533b32);}})['then'](function(_0x561df5){if(_0x561df5){return _0x561df5?{'count':_0x58a073,'rows':_0x561df5}:null;}})['then'](respondWithResult(_0x181afb,null))['catch'](handleError(_0x181afb,null));};
\ No newline at end of file
+var _0xb6d5=['keys','intersection','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','addAnyCondition','getAllConditions','findOne','Condition','getAnyConditions','addAction','TriggerId','Action','getActions','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','Triggers','error','name','send','index','Trigger','rawAttributes','fieldName','type','model','map','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params'];(function(_0x596eae,_0x24b395){var _0x45f560=function(_0x9fd4c1){while(--_0x9fd4c1){_0x596eae['push'](_0x596eae['shift']());}};_0x45f560(++_0x24b395);}(_0xb6d5,0x192));var _0x5b6d=function(_0x15f455,_0x1ec373){_0x15f455=_0x15f455-0x0;var _0x45f542=_0xb6d5[_0x15f455];return _0x45f542;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5b6d('0x0'));var jsonpatch=require(_0x5b6d('0x1'));var rp=require('request-promise');var moment=require(_0x5b6d('0x2'));var BPromise=require(_0x5b6d('0x3'));var Mustache=require(_0x5b6d('0x4'));var util=require(_0x5b6d('0x5'));var path=require('path');var sox=require(_0x5b6d('0x6'));var csv=require(_0x5b6d('0x7'));var ejs=require(_0x5b6d('0x8'));var fs=require('fs');var fs_extra=require(_0x5b6d('0x9'));var _=require(_0x5b6d('0xa'));var squel=require('squel');var crypto=require(_0x5b6d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5b6d('0xc'));var toCsv=require(_0x5b6d('0x7'));var querystring=require(_0x5b6d('0xd'));var Papa=require(_0x5b6d('0xe'));var Redis=require(_0x5b6d('0xf'));var authService=require(_0x5b6d('0x10'));var qs=require(_0x5b6d('0x11'));var as=require(_0x5b6d('0x12'));var hardwareService=require(_0x5b6d('0x13'));var logger=require(_0x5b6d('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5b6d('0x15'))['db'];function respondWithStatusCode(_0x24e620,_0x5d2e32){_0x5d2e32=_0x5d2e32||0xcc;return function(_0xfd69a2){if(_0xfd69a2){return _0x24e620[_0x5b6d('0x16')](_0x5d2e32);}return _0x24e620[_0x5b6d('0x17')](_0x5d2e32)[_0x5b6d('0x18')]();};}function respondWithResult(_0x55e901,_0x349ffa){_0x349ffa=_0x349ffa||0xc8;return function(_0xd8f551){if(_0xd8f551){return _0x55e901['status'](_0x349ffa)[_0x5b6d('0x19')](_0xd8f551);}};}function respondWithFilteredResult(_0x321390,_0x4258a9){return function(_0x5955a3){if(_0x5955a3){var _0x1ad830=typeof _0x4258a9[_0x5b6d('0x1a')]===_0x5b6d('0x1b')&&typeof _0x4258a9[_0x5b6d('0x1c')]===_0x5b6d('0x1b');var _0x290e95=_0x5955a3['count'];var _0x376347=_0x1ad830?0x0:_0x4258a9[_0x5b6d('0x1a')];var _0x5d0ef9=_0x1ad830?_0x5955a3[_0x5b6d('0x1d')]:_0x4258a9[_0x5b6d('0x1a')]+_0x4258a9[_0x5b6d('0x1c')];var _0x3c2aac;if(_0x5d0ef9>=_0x290e95){_0x5d0ef9=_0x290e95;_0x3c2aac=0xc8;}else{_0x3c2aac=0xce;}_0x321390[_0x5b6d('0x17')](_0x3c2aac);return _0x321390['set'](_0x5b6d('0x1e'),_0x376347+'-'+_0x5d0ef9+'/'+_0x290e95)[_0x5b6d('0x19')](_0x5955a3);}return null;};}function patchUpdates(_0xec0e5){return function(_0x2edbd9){try{jsonpatch[_0x5b6d('0x1f')](_0x2edbd9,_0xec0e5,!![]);}catch(_0xf1bd65){return BPromise[_0x5b6d('0x20')](_0xf1bd65);}return _0x2edbd9['save']();};}function saveUpdates(_0x54c5d0,_0x412727){return function(_0x68fa7c){if(_0x68fa7c){return _0x68fa7c[_0x5b6d('0x21')](_0x54c5d0)[_0x5b6d('0x22')](function(_0x43a7a4){return _0x43a7a4;});}return null;};}function removeEntity(_0x2b91d0,_0x14e3ec){return function(_0x35887f){if(_0x35887f){return _0x35887f[_0x5b6d('0x23')]()[_0x5b6d('0x22')](function(){var _0x3a7414=_0x35887f['get']({'plain':!![]});var _0x4a71ea=_0x5b6d('0x24');return db['UserProfileResource'][_0x5b6d('0x23')]({'where':{'type':_0x4a71ea,'resourceId':_0x3a7414['id']}})[_0x5b6d('0x22')](function(){return _0x35887f;});})[_0x5b6d('0x22')](function(){_0x2b91d0[_0x5b6d('0x17')](0xcc)[_0x5b6d('0x18')]();});}};}function handleEntityNotFound(_0x14736d,_0x160163){return function(_0x71e544){if(!_0x71e544){_0x14736d[_0x5b6d('0x16')](0x194);}return _0x71e544;};}function handleError(_0x3cd6da,_0x5b2b04){_0x5b2b04=_0x5b2b04||0x1f4;return function(_0x99fb14){logger[_0x5b6d('0x25')](_0x99fb14['stack']);if(_0x99fb14[_0x5b6d('0x26')]){delete _0x99fb14[_0x5b6d('0x26')];}_0x3cd6da[_0x5b6d('0x17')](_0x5b2b04)[_0x5b6d('0x27')](_0x99fb14);};}exports[_0x5b6d('0x28')]=function(_0x5d3421,_0x1ce24f){var _0x374afb={},_0x228e38={},_0x347f3b={'count':0x0,'rows':[]};var _0x408c7a=_['map'](db[_0x5b6d('0x29')][_0x5b6d('0x2a')],function(_0x4b0222){return{'name':_0x4b0222[_0x5b6d('0x2b')],'type':_0x4b0222[_0x5b6d('0x2c')]['key']};});_0x228e38[_0x5b6d('0x2d')]=_[_0x5b6d('0x2e')](_0x408c7a,_0x5b6d('0x26'));_0x228e38[_0x5b6d('0x2f')]=_['keys'](_0x5d3421['query']);_0x228e38[_0x5b6d('0x30')]=_['intersection'](_0x228e38[_0x5b6d('0x2d')],_0x228e38[_0x5b6d('0x2f')]);_0x374afb['attributes']=_['intersection'](_0x228e38[_0x5b6d('0x2d')],qs['fields'](_0x5d3421[_0x5b6d('0x2f')][_0x5b6d('0x31')]));_0x374afb[_0x5b6d('0x32')]=_0x374afb[_0x5b6d('0x32')][_0x5b6d('0x33')]?_0x374afb[_0x5b6d('0x32')]:_0x228e38['model'];if(!_0x5d3421[_0x5b6d('0x2f')][_0x5b6d('0x34')](_0x5b6d('0x35'))){_0x374afb[_0x5b6d('0x1c')]=qs[_0x5b6d('0x1c')](_0x5d3421[_0x5b6d('0x2f')][_0x5b6d('0x1c')]);_0x374afb[_0x5b6d('0x1a')]=qs['offset'](_0x5d3421['query'][_0x5b6d('0x1a')]);}_0x374afb[_0x5b6d('0x36')]=qs[_0x5b6d('0x37')](_0x5d3421[_0x5b6d('0x2f')][_0x5b6d('0x37')]);_0x374afb[_0x5b6d('0x38')]=qs[_0x5b6d('0x30')](_[_0x5b6d('0x39')](_0x5d3421[_0x5b6d('0x2f')],_0x228e38[_0x5b6d('0x30')]),_0x408c7a);if(_0x5d3421[_0x5b6d('0x2f')][_0x5b6d('0x3a')]){_0x374afb[_0x5b6d('0x38')]=_[_0x5b6d('0x3b')](_0x374afb[_0x5b6d('0x38')],{'$or':_[_0x5b6d('0x2e')](_0x408c7a,function(_0x56b641){if(_0x56b641[_0x5b6d('0x2c')]!==_0x5b6d('0x3c')){var _0x460272={};_0x460272[_0x56b641['name']]={'$like':'%'+_0x5d3421[_0x5b6d('0x2f')][_0x5b6d('0x3a')]+'%'};return _0x460272;}})});}_0x374afb=_['merge']({},_0x374afb,_0x5d3421[_0x5b6d('0x3d')]);var _0x3066bd={'where':_0x374afb['where']};return db[_0x5b6d('0x29')][_0x5b6d('0x1d')](_0x3066bd)[_0x5b6d('0x22')](function(_0x5cd2ab){_0x347f3b['count']=_0x5cd2ab;if(_0x5d3421['query']['includeAll']){_0x374afb[_0x5b6d('0x3e')]=[{'all':!![]}];}return db['Trigger'][_0x5b6d('0x3f')](_0x374afb);})['then'](function(_0x1ece4e){_0x347f3b[_0x5b6d('0x40')]=_0x1ece4e;return _0x347f3b;})[_0x5b6d('0x22')](respondWithFilteredResult(_0x1ce24f,_0x374afb))[_0x5b6d('0x41')](handleError(_0x1ce24f,null));};exports[_0x5b6d('0x42')]=function(_0x13e5e9,_0x9b117c){var _0x38dad6={'raw':![],'where':{'id':_0x13e5e9[_0x5b6d('0x43')]['id']}},_0x57b0e9={};_0x57b0e9['model']=_[_0x5b6d('0x44')](db[_0x5b6d('0x29')][_0x5b6d('0x2a')]);_0x57b0e9[_0x5b6d('0x2f')]=_['keys'](_0x13e5e9['query']);_0x57b0e9[_0x5b6d('0x30')]=_['intersection'](_0x57b0e9[_0x5b6d('0x2d')],_0x57b0e9['query']);_0x38dad6[_0x5b6d('0x32')]=_[_0x5b6d('0x45')](_0x57b0e9['model'],qs[_0x5b6d('0x31')](_0x13e5e9[_0x5b6d('0x2f')][_0x5b6d('0x31')]));_0x38dad6[_0x5b6d('0x32')]=_0x38dad6[_0x5b6d('0x32')][_0x5b6d('0x33')]?_0x38dad6[_0x5b6d('0x32')]:_0x57b0e9['model'];if(_0x13e5e9[_0x5b6d('0x2f')][_0x5b6d('0x46')]){_0x38dad6['include']=[{'all':!![]}];}_0x38dad6=_[_0x5b6d('0x3b')]({},_0x38dad6,_0x13e5e9[_0x5b6d('0x3d')]);return db[_0x5b6d('0x29')][_0x5b6d('0x47')](_0x38dad6)[_0x5b6d('0x22')](handleEntityNotFound(_0x9b117c,null))[_0x5b6d('0x22')](respondWithResult(_0x9b117c,null))[_0x5b6d('0x41')](handleError(_0x9b117c,null));};exports[_0x5b6d('0x48')]=function(_0x305d93,_0x5ee17d){return db[_0x5b6d('0x29')][_0x5b6d('0x48')](_0x305d93[_0x5b6d('0x49')],{})[_0x5b6d('0x22')](function(_0x231aa5){var _0x11410f=_0x305d93[_0x5b6d('0x4a')][_0x5b6d('0x4b')]({'plain':!![]});if(!_0x11410f)throw new Error(_0x5b6d('0x4c'));if(_0x11410f[_0x5b6d('0x4d')]===_0x5b6d('0x4a')){var _0x16a693=_0x231aa5['get']({'plain':!![]});var _0x38d2c4=_0x5b6d('0x24');return db[_0x5b6d('0x4e')][_0x5b6d('0x47')]({'where':{'name':_0x38d2c4,'userProfileId':_0x11410f[_0x5b6d('0x4f')]},'raw':!![]})['then'](function(_0x5455fd){if(_0x5455fd&&_0x5455fd[_0x5b6d('0x50')]===0x0){return db[_0x5b6d('0x51')][_0x5b6d('0x48')]({'name':_0x16a693[_0x5b6d('0x26')],'resourceId':_0x16a693['id'],'type':_0x5455fd[_0x5b6d('0x26')],'sectionId':_0x5455fd['id']},{})[_0x5b6d('0x22')](function(){return _0x231aa5;});}else{return _0x231aa5;}})['catch'](function(_0x510e08){logger[_0x5b6d('0x25')](_0x5b6d('0x52'),_0x510e08);throw _0x510e08;});}return _0x231aa5;})[_0x5b6d('0x22')](respondWithResult(_0x5ee17d,0xc9))['catch'](handleError(_0x5ee17d,null));};exports[_0x5b6d('0x21')]=function(_0x1a0647,_0x4d453a){if(_0x1a0647['body']['id']){delete _0x1a0647['body']['id'];}return db[_0x5b6d('0x29')][_0x5b6d('0x47')]({'where':{'id':_0x1a0647['params']['id']}})['then'](handleEntityNotFound(_0x4d453a,null))[_0x5b6d('0x22')](saveUpdates(_0x1a0647[_0x5b6d('0x49')],null))[_0x5b6d('0x22')](respondWithResult(_0x4d453a,null))['catch'](handleError(_0x4d453a,null));};exports[_0x5b6d('0x23')]=function(_0x5a5c14,_0x2e8d4c){return db['Trigger'][_0x5b6d('0x47')]({'where':{'id':_0x5a5c14['params']['id']}})[_0x5b6d('0x22')](handleEntityNotFound(_0x2e8d4c,null))[_0x5b6d('0x22')](removeEntity(_0x2e8d4c,null))['catch'](handleError(_0x2e8d4c,null));};exports[_0x5b6d('0x53')]=function(_0x4acd1a,_0x56172c,_0x42c864){if(_0x4acd1a[_0x5b6d('0x49')]['id']){delete _0x4acd1a[_0x5b6d('0x49')]['id'];}return db[_0x5b6d('0x29')][_0x5b6d('0x47')]({'where':{'id':_0x4acd1a[_0x5b6d('0x43')]['id']}})['then'](handleEntityNotFound(_0x56172c,null))[_0x5b6d('0x22')](function(_0x411db3){if(_0x411db3){_0x4acd1a[_0x5b6d('0x49')][_0x5b6d('0x54')]=_0x411db3['id'];return db['Condition'][_0x5b6d('0x48')](_0x4acd1a['body']);}})['then'](respondWithResult(_0x56172c,null))[_0x5b6d('0x41')](handleError(_0x56172c,null));};exports[_0x5b6d('0x55')]=function(_0x4ba57b,_0xbeb1a5,_0x4be539){if(_0x4ba57b[_0x5b6d('0x49')]['id']){delete _0x4ba57b[_0x5b6d('0x49')]['id'];}return db[_0x5b6d('0x29')][_0x5b6d('0x47')]({'where':{'id':_0x4ba57b[_0x5b6d('0x43')]['id']}})[_0x5b6d('0x22')](handleEntityNotFound(_0xbeb1a5,null))[_0x5b6d('0x22')](function(_0x645043){if(_0x645043){_0x4ba57b[_0x5b6d('0x49')]['TriggerAnyId']=_0x645043['id'];return db['Condition'][_0x5b6d('0x48')](_0x4ba57b[_0x5b6d('0x49')]);}})[_0x5b6d('0x22')](respondWithResult(_0xbeb1a5,null))['catch'](handleError(_0xbeb1a5,null));};exports[_0x5b6d('0x56')]=function(_0x5f4006,_0x3fd227,_0x160522){var _0x59b915={};var _0xa64ada={};var _0x338732;var _0x207dab;return db[_0x5b6d('0x29')][_0x5b6d('0x57')]({'where':{'id':_0x5f4006[_0x5b6d('0x43')]['id']}})[_0x5b6d('0x22')](handleEntityNotFound(_0x3fd227,null))[_0x5b6d('0x22')](function(_0x40eab8){if(_0x40eab8){_0x338732=_0x40eab8;_0xa64ada[_0x5b6d('0x2d')]=_['keys'](db[_0x5b6d('0x58')][_0x5b6d('0x2a')]);_0xa64ada['query']=_['keys'](_0x5f4006[_0x5b6d('0x2f')]);_0xa64ada[_0x5b6d('0x30')]=_[_0x5b6d('0x45')](_0xa64ada[_0x5b6d('0x2d')],_0xa64ada[_0x5b6d('0x2f')]);_0x59b915['attributes']=_[_0x5b6d('0x45')](_0xa64ada[_0x5b6d('0x2d')],qs['fields'](_0x5f4006['query'][_0x5b6d('0x31')]));_0x59b915[_0x5b6d('0x32')]=_0x59b915[_0x5b6d('0x32')][_0x5b6d('0x33')]?_0x59b915['attributes']:_0xa64ada[_0x5b6d('0x2d')];_0x59b915[_0x5b6d('0x36')]=qs[_0x5b6d('0x37')](_0x5f4006['query'][_0x5b6d('0x37')]);_0x59b915['where']=qs[_0x5b6d('0x30')](_[_0x5b6d('0x39')](_0x5f4006['query'],_0xa64ada[_0x5b6d('0x30')]));if(_0x5f4006[_0x5b6d('0x2f')][_0x5b6d('0x3a')]){_0x59b915['where']=_[_0x5b6d('0x3b')](_0x59b915[_0x5b6d('0x38')],{'$or':_[_0x5b6d('0x2e')](_0x59b915[_0x5b6d('0x32')],function(_0x1fb79f){var _0x561acf={};_0x561acf[_0x1fb79f]={'$like':'%'+_0x5f4006[_0x5b6d('0x2f')][_0x5b6d('0x3a')]+'%'};return _0x561acf;})});}_0x59b915=_[_0x5b6d('0x3b')]({},_0x59b915,_0x5f4006[_0x5b6d('0x3d')]);return _0x338732[_0x5b6d('0x56')](_0x59b915);}})[_0x5b6d('0x22')](function(_0x5a3d29){if(_0x5a3d29){_0x207dab=_0x5a3d29['length'];if(!_0x5f4006[_0x5b6d('0x2f')][_0x5b6d('0x34')](_0x5b6d('0x35'))){_0x59b915[_0x5b6d('0x1c')]=qs[_0x5b6d('0x1c')](_0x5f4006[_0x5b6d('0x2f')]['limit']);_0x59b915['offset']=qs[_0x5b6d('0x1a')](_0x5f4006[_0x5b6d('0x2f')][_0x5b6d('0x1a')]);}return _0x338732[_0x5b6d('0x56')](_0x59b915);}})[_0x5b6d('0x22')](function(_0x1271e7){if(_0x1271e7){return _0x1271e7?{'count':_0x207dab,'rows':_0x1271e7}:null;}})[_0x5b6d('0x22')](respondWithResult(_0x3fd227,null))[_0x5b6d('0x41')](handleError(_0x3fd227,null));};exports[_0x5b6d('0x59')]=function(_0x5304d2,_0xcc480f,_0x50b8c8){var _0x37cd5d={};var _0x5b6651={};var _0xbb2781;var _0x252798;return db['Trigger'][_0x5b6d('0x57')]({'where':{'id':_0x5304d2[_0x5b6d('0x43')]['id']}})['then'](handleEntityNotFound(_0xcc480f,null))['then'](function(_0x42f0b7){if(_0x42f0b7){_0xbb2781=_0x42f0b7;_0x5b6651[_0x5b6d('0x2d')]=_['keys'](db['Condition']['rawAttributes']);_0x5b6651[_0x5b6d('0x2f')]=_[_0x5b6d('0x44')](_0x5304d2[_0x5b6d('0x2f')]);_0x5b6651[_0x5b6d('0x30')]=_[_0x5b6d('0x45')](_0x5b6651[_0x5b6d('0x2d')],_0x5b6651[_0x5b6d('0x2f')]);_0x37cd5d[_0x5b6d('0x32')]=_['intersection'](_0x5b6651[_0x5b6d('0x2d')],qs[_0x5b6d('0x31')](_0x5304d2[_0x5b6d('0x2f')][_0x5b6d('0x31')]));_0x37cd5d[_0x5b6d('0x32')]=_0x37cd5d[_0x5b6d('0x32')][_0x5b6d('0x33')]?_0x37cd5d['attributes']:_0x5b6651[_0x5b6d('0x2d')];_0x37cd5d['order']=qs['sort'](_0x5304d2[_0x5b6d('0x2f')][_0x5b6d('0x37')]);_0x37cd5d[_0x5b6d('0x38')]=qs[_0x5b6d('0x30')](_['pick'](_0x5304d2[_0x5b6d('0x2f')],_0x5b6651[_0x5b6d('0x30')]));if(_0x5304d2[_0x5b6d('0x2f')][_0x5b6d('0x3a')]){_0x37cd5d[_0x5b6d('0x38')]=_['merge'](_0x37cd5d[_0x5b6d('0x38')],{'$or':_[_0x5b6d('0x2e')](_0x37cd5d[_0x5b6d('0x32')],function(_0x1c1a8e){var _0x46829e={};_0x46829e[_0x1c1a8e]={'$like':'%'+_0x5304d2[_0x5b6d('0x2f')][_0x5b6d('0x3a')]+'%'};return _0x46829e;})});}_0x37cd5d=_[_0x5b6d('0x3b')]({},_0x37cd5d,_0x5304d2[_0x5b6d('0x3d')]);return _0xbb2781[_0x5b6d('0x59')](_0x37cd5d);}})[_0x5b6d('0x22')](function(_0x2e3fb0){if(_0x2e3fb0){_0x252798=_0x2e3fb0[_0x5b6d('0x33')];if(!_0x5304d2[_0x5b6d('0x2f')]['hasOwnProperty'](_0x5b6d('0x35'))){_0x37cd5d['limit']=qs[_0x5b6d('0x1c')](_0x5304d2[_0x5b6d('0x2f')][_0x5b6d('0x1c')]);_0x37cd5d[_0x5b6d('0x1a')]=qs[_0x5b6d('0x1a')](_0x5304d2[_0x5b6d('0x2f')][_0x5b6d('0x1a')]);}return _0xbb2781['getAnyConditions'](_0x37cd5d);}})[_0x5b6d('0x22')](function(_0x5010f6){if(_0x5010f6){return _0x5010f6?{'count':_0x252798,'rows':_0x5010f6}:null;}})['then'](respondWithResult(_0xcc480f,null))[_0x5b6d('0x41')](handleError(_0xcc480f,null));};exports[_0x5b6d('0x5a')]=function(_0x4cf7f1,_0x690c81,_0x5ed3d5){if(_0x4cf7f1[_0x5b6d('0x49')]['id']){delete _0x4cf7f1[_0x5b6d('0x49')]['id'];}return db[_0x5b6d('0x29')][_0x5b6d('0x47')]({'where':{'id':_0x4cf7f1[_0x5b6d('0x43')]['id']}})[_0x5b6d('0x22')](handleEntityNotFound(_0x690c81,null))[_0x5b6d('0x22')](function(_0x544764){if(_0x544764){_0x4cf7f1[_0x5b6d('0x49')][_0x5b6d('0x5b')]=_0x544764['id'];return db[_0x5b6d('0x5c')]['create'](_0x4cf7f1[_0x5b6d('0x49')]);}})[_0x5b6d('0x22')](respondWithResult(_0x690c81,null))[_0x5b6d('0x41')](handleError(_0x690c81,null));};exports[_0x5b6d('0x5d')]=function(_0x13e978,_0x4e492c,_0x57ba4f){var _0x306222={};var _0x1fe27f={};var _0x3544dd;var _0x102beb;return db['Trigger'][_0x5b6d('0x57')]({'where':{'id':_0x13e978[_0x5b6d('0x43')]['id']}})[_0x5b6d('0x22')](handleEntityNotFound(_0x4e492c,null))[_0x5b6d('0x22')](function(_0x35fe7e){if(_0x35fe7e){_0x3544dd=_0x35fe7e;_0x1fe27f['model']=_[_0x5b6d('0x44')](db[_0x5b6d('0x5c')][_0x5b6d('0x2a')]);_0x1fe27f['query']=_[_0x5b6d('0x44')](_0x13e978['query']);_0x1fe27f[_0x5b6d('0x30')]=_[_0x5b6d('0x45')](_0x1fe27f['model'],_0x1fe27f['query']);_0x306222[_0x5b6d('0x32')]=_['intersection'](_0x1fe27f['model'],qs[_0x5b6d('0x31')](_0x13e978[_0x5b6d('0x2f')][_0x5b6d('0x31')]));_0x306222[_0x5b6d('0x32')]=_0x306222[_0x5b6d('0x32')]['length']?_0x306222['attributes']:_0x1fe27f[_0x5b6d('0x2d')];_0x306222[_0x5b6d('0x36')]=qs[_0x5b6d('0x37')](_0x13e978['query'][_0x5b6d('0x37')]);_0x306222['where']=qs[_0x5b6d('0x30')](_['pick'](_0x13e978['query'],_0x1fe27f[_0x5b6d('0x30')]));if(_0x13e978[_0x5b6d('0x2f')]['filter']){_0x306222[_0x5b6d('0x38')]=_['merge'](_0x306222[_0x5b6d('0x38')],{'$or':_[_0x5b6d('0x2e')](_0x306222[_0x5b6d('0x32')],function(_0x8ce386){var _0x21a559={};_0x21a559[_0x8ce386]={'$like':'%'+_0x13e978['query'][_0x5b6d('0x3a')]+'%'};return _0x21a559;})});}_0x306222=_[_0x5b6d('0x3b')]({},_0x306222,_0x13e978[_0x5b6d('0x3d')]);return _0x3544dd[_0x5b6d('0x5d')](_0x306222);}})[_0x5b6d('0x22')](function(_0x4d48e9){if(_0x4d48e9){_0x102beb=_0x4d48e9[_0x5b6d('0x33')];if(!_0x13e978[_0x5b6d('0x2f')][_0x5b6d('0x34')](_0x5b6d('0x35'))){_0x306222[_0x5b6d('0x1c')]=qs[_0x5b6d('0x1c')](_0x13e978[_0x5b6d('0x2f')]['limit']);_0x306222[_0x5b6d('0x1a')]=qs['offset'](_0x13e978['query'][_0x5b6d('0x1a')]);}return _0x3544dd[_0x5b6d('0x5d')](_0x306222);}})[_0x5b6d('0x22')](function(_0x21906b){if(_0x21906b){return _0x21906b?{'count':_0x102beb,'rows':_0x21906b}:null;}})[_0x5b6d('0x22')](respondWithResult(_0x4e492c,null))[_0x5b6d('0x41')](handleError(_0x4e492c,null));};
\ No newline at end of file
index b349a43..c6a7849 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x394e=['../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x7c66c8,_0x541753){var _0x5f17c0=function(_0x4400f3){while(--_0x4400f3){_0x7c66c8['push'](_0x7c66c8['shift']());}};_0x5f17c0(++_0x541753);}(_0x394e,0x88));var _0xe394=function(_0x327615,_0x128547){_0x327615=_0x327615-0x0;var _0xd86a49=_0x394e[_0x327615];return _0xd86a49;};'use strict';var _=require(_0xe394('0x0'));var util=require(_0xe394('0x1'));var logger=require('../../config/logger')(_0xe394('0x2'));var moment=require(_0xe394('0x3'));var BPromise=require(_0xe394('0x4'));var rp=require(_0xe394('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe394('0x6'));var config=require(_0xe394('0x7'));var attributes=require(_0xe394('0x8'));module[_0xe394('0x9')]=function(_0x2a4db6,_0x272c30){return _0x2a4db6[_0xe394('0xa')](_0xe394('0xb'),attributes,{'tableName':_0xe394('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb647=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','Trigger','tools_triggers','lodash','util'];(function(_0x13388b,_0x4cc158){var _0x55cdcd=function(_0x2d4599){while(--_0x2d4599){_0x13388b['push'](_0x13388b['shift']());}};_0x55cdcd(++_0x4cc158);}(_0xb647,0xdb));var _0x7b64=function(_0x583084,_0x2f6a0c){_0x583084=_0x583084-0x0;var _0x3fa004=_0xb647[_0x583084];return _0x3fa004;};'use strict';var _=require(_0x7b64('0x0'));var util=require(_0x7b64('0x1'));var logger=require(_0x7b64('0x2'))(_0x7b64('0x3'));var moment=require(_0x7b64('0x4'));var BPromise=require(_0x7b64('0x5'));var rp=require(_0x7b64('0x6'));var fs=require('fs');var path=require(_0x7b64('0x7'));var rimraf=require('rimraf');var config=require(_0x7b64('0x8'));var attributes=require('./trigger.attributes');module[_0x7b64('0x9')]=function(_0x38ebf7,_0x31915b){return _0x38ebf7[_0x7b64('0xa')](_0x7b64('0xb'),attributes,{'tableName':_0x7b64('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 76123b8..f249fae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2825=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','Trigger','findAll','raw','options','where','attributes','limit','map','include','model','GetTrigger','stringify','find','ShowTrigger','randomstring','ioredis','../../mysqldb'];(function(_0x2fa652,_0x18defe){var _0x451750=function(_0x124c9f){while(--_0x124c9f){_0x2fa652['push'](_0x2fa652['shift']());}};_0x451750(++_0x18defe);}(_0x2825,0x195));var _0x5282=function(_0x99c628,_0x400b8e){_0x99c628=_0x99c628-0x0;var _0x121aaa=_0x2825[_0x99c628];return _0x121aaa;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5282('0x0'));var fs=require('fs');var Redis=require(_0x5282('0x1'));var db=require(_0x5282('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x5282('0x3'))(_0x5282('0x4'));var config=require(_0x5282('0x5'));var jayson=require(_0x5282('0x6'));var client=jayson['client'][_0x5282('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x59ec4a,_0x10b913,_0x3e0998){return new BPromise(function(_0x35b84e,_0x53ca23){return client[_0x5282('0x8')](_0x59ec4a,_0x3e0998)[_0x5282('0x9')](function(_0x240b72){logger['info'](_0x5282('0xa'),_0x10b913,_0x5282('0xb'));logger[_0x5282('0xc')](_0x5282('0xd'),_0x10b913,_0x5282('0xb'),JSON['stringify'](_0x240b72));if(_0x240b72['error']){if(_0x240b72[_0x5282('0xe')][_0x5282('0xf')]===0x1f4){logger[_0x5282('0xe')]('Trigger,\x20%s,\x20%s',_0x10b913,_0x240b72[_0x5282('0xe')]['message']);return _0x53ca23(_0x240b72[_0x5282('0xe')][_0x5282('0x10')]);}logger[_0x5282('0xe')]('Trigger,\x20%s,\x20%s',_0x10b913,_0x240b72['error'][_0x5282('0x10')]);return _0x35b84e(_0x240b72[_0x5282('0xe')][_0x5282('0x10')]);}else{logger[_0x5282('0x11')]('Trigger,\x20%s,\x20%s',_0x10b913,_0x5282('0xb'));_0x35b84e(_0x240b72[_0x5282('0x12')][_0x5282('0x10')]);}})[_0x5282('0x13')](function(_0x3dd786){logger[_0x5282('0xe')](_0x5282('0xa'),_0x10b913,_0x3dd786);_0x53ca23(_0x3dd786);});});}exports['GetTrigger']=function(_0x52909a){var _0x234849=this;return new Promise(function(_0x15efff,_0x630afc){return db[_0x5282('0x14')][_0x5282('0x15')]({'raw':_0x52909a['options']?_0x52909a['options'][_0x5282('0x16')]===undefined?!![]:![]:!![],'where':_0x52909a[_0x5282('0x17')]?_0x52909a['options'][_0x5282('0x18')]||null:null,'attributes':_0x52909a[_0x5282('0x17')]?_0x52909a[_0x5282('0x17')][_0x5282('0x19')]||null:null,'limit':_0x52909a['options']?_0x52909a[_0x5282('0x17')][_0x5282('0x1a')]||null:null,'include':_0x52909a[_0x5282('0x17')]?_0x52909a[_0x5282('0x17')]['include']?_[_0x5282('0x1b')](_0x52909a[_0x5282('0x17')][_0x5282('0x1c')],function(_0x1ef536){return{'model':db[_0x1ef536[_0x5282('0x1d')]],'as':_0x1ef536['as'],'attributes':_0x1ef536[_0x5282('0x19')],'include':_0x1ef536[_0x5282('0x1c')]?_[_0x5282('0x1b')](_0x1ef536[_0x5282('0x1c')],function(_0x21877e){return{'model':db[_0x21877e[_0x5282('0x1d')]],'as':_0x21877e['as'],'attributes':_0x21877e[_0x5282('0x19')],'include':_0x21877e['include']?_['map'](_0x21877e[_0x5282('0x1c')],function(_0x459a97){return{'model':db[_0x459a97[_0x5282('0x1d')]],'as':_0x459a97['as'],'attributes':_0x459a97[_0x5282('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5282('0x9')](function(_0x257bdf){logger[_0x5282('0x11')](_0x5282('0x1e'),_0x52909a);logger[_0x5282('0xc')](_0x5282('0x1e'),_0x52909a,JSON[_0x5282('0x1f')](_0x257bdf));_0x15efff(_0x257bdf);})['catch'](function(_0x11047a){logger[_0x5282('0xe')](_0x5282('0x1e'),_0x11047a[_0x5282('0x10')],_0x52909a);_0x630afc(_0x234849[_0x5282('0xe')](0x1f4,_0x11047a[_0x5282('0x10')]));});});};exports['ShowTrigger']=function(_0x5b6dd7){var _0x290f86=this;return new Promise(function(_0x33ecc7,_0x168d15){return db[_0x5282('0x14')][_0x5282('0x20')]({'raw':_0x5b6dd7['options']?_0x5b6dd7[_0x5282('0x17')][_0x5282('0x16')]===undefined?!![]:![]:!![],'where':_0x5b6dd7[_0x5282('0x17')]?_0x5b6dd7[_0x5282('0x17')][_0x5282('0x18')]||null:null,'attributes':_0x5b6dd7[_0x5282('0x17')]?_0x5b6dd7['options'][_0x5282('0x19')]||null:null,'include':_0x5b6dd7[_0x5282('0x17')]?_0x5b6dd7[_0x5282('0x17')][_0x5282('0x1c')]?_[_0x5282('0x1b')](_0x5b6dd7[_0x5282('0x17')]['include'],function(_0x4fabf8){return{'model':db[_0x4fabf8[_0x5282('0x1d')]],'as':_0x4fabf8['as'],'attributes':_0x4fabf8['attributes'],'include':_0x4fabf8['include']?_[_0x5282('0x1b')](_0x4fabf8[_0x5282('0x1c')],function(_0x35bde3){return{'model':db[_0x35bde3['model']],'as':_0x35bde3['as'],'attributes':_0x35bde3[_0x5282('0x19')],'include':_0x35bde3[_0x5282('0x1c')]?_[_0x5282('0x1b')](_0x35bde3[_0x5282('0x1c')],function(_0x3a87f0){return{'model':db[_0x3a87f0[_0x5282('0x1d')]],'as':_0x3a87f0['as'],'attributes':_0x3a87f0[_0x5282('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5282('0x9')](function(_0x2036e6){logger[_0x5282('0x11')]('ShowTrigger',_0x5b6dd7);logger[_0x5282('0xc')](_0x5282('0x21'),_0x5b6dd7,JSON[_0x5282('0x1f')](_0x2036e6));_0x33ecc7(_0x2036e6);})['catch'](function(_0x47cd5a){logger['error'](_0x5282('0x21'),_0x47cd5a[_0x5282('0x10')],_0x5b6dd7);_0x168d15(_0x290f86[_0x5282('0xe')](0x1f4,_0x47cd5a[_0x5282('0x10')]));});});};
\ No newline at end of file
+var _0xf543=['client','http','request','info','Trigger,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Trigger','options','raw','where','limit','include','map','model','attributes','debug','GetTrigger','then','ShowTrigger','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0xf543,0x1d5));var _0x3f54=function(_0x49803e,_0x594a72){_0x49803e=_0x49803e-0x0;var _0x177f52=_0xf543[_0x49803e];return _0x177f52;};'use strict';var _=require(_0x3f54('0x0'));var util=require(_0x3f54('0x1'));var moment=require(_0x3f54('0x2'));var BPromise=require(_0x3f54('0x3'));var rs=require(_0x3f54('0x4'));var fs=require('fs');var Redis=require(_0x3f54('0x5'));var db=require(_0x3f54('0x6'))['db'];var utils=require(_0x3f54('0x7'));var logger=require(_0x3f54('0x8'))(_0x3f54('0x9'));var config=require(_0x3f54('0xa'));var jayson=require(_0x3f54('0xb'));var client=jayson[_0x3f54('0xc')][_0x3f54('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xbbaa47,_0x27da76,_0x507d98){return new BPromise(function(_0x31a71a,_0x5ec48a){return client[_0x3f54('0xe')](_0xbbaa47,_0x507d98)['then'](function(_0x586d1c){logger[_0x3f54('0xf')](_0x3f54('0x10'),_0x27da76,_0x3f54('0x11'));logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x27da76,_0x3f54('0x11'),JSON[_0x3f54('0x12')](_0x586d1c));if(_0x586d1c[_0x3f54('0x13')]){if(_0x586d1c[_0x3f54('0x13')][_0x3f54('0x14')]===0x1f4){logger['error']('Trigger,\x20%s,\x20%s',_0x27da76,_0x586d1c[_0x3f54('0x13')][_0x3f54('0x15')]);return _0x5ec48a(_0x586d1c[_0x3f54('0x13')]['message']);}logger[_0x3f54('0x13')]('Trigger,\x20%s,\x20%s',_0x27da76,_0x586d1c['error'][_0x3f54('0x15')]);return _0x31a71a(_0x586d1c[_0x3f54('0x13')][_0x3f54('0x15')]);}else{logger[_0x3f54('0xf')](_0x3f54('0x10'),_0x27da76,_0x3f54('0x11'));_0x31a71a(_0x586d1c[_0x3f54('0x16')][_0x3f54('0x15')]);}})[_0x3f54('0x17')](function(_0x3ba9a2){logger[_0x3f54('0x13')](_0x3f54('0x10'),_0x27da76,_0x3ba9a2);_0x5ec48a(_0x3ba9a2);});});}exports['GetTrigger']=function(_0x5f35dc){var _0x4be406=this;return new Promise(function(_0x31e15e,_0x1e84e4){return db[_0x3f54('0x18')]['findAll']({'raw':_0x5f35dc[_0x3f54('0x19')]?_0x5f35dc[_0x3f54('0x19')][_0x3f54('0x1a')]===undefined?!![]:![]:!![],'where':_0x5f35dc[_0x3f54('0x19')]?_0x5f35dc[_0x3f54('0x19')][_0x3f54('0x1b')]||null:null,'attributes':_0x5f35dc[_0x3f54('0x19')]?_0x5f35dc[_0x3f54('0x19')]['attributes']||null:null,'limit':_0x5f35dc['options']?_0x5f35dc[_0x3f54('0x19')][_0x3f54('0x1c')]||null:null,'include':_0x5f35dc[_0x3f54('0x19')]?_0x5f35dc[_0x3f54('0x19')][_0x3f54('0x1d')]?_[_0x3f54('0x1e')](_0x5f35dc[_0x3f54('0x19')][_0x3f54('0x1d')],function(_0x4e3bca){return{'model':db[_0x4e3bca[_0x3f54('0x1f')]],'as':_0x4e3bca['as'],'attributes':_0x4e3bca[_0x3f54('0x20')],'include':_0x4e3bca['include']?_[_0x3f54('0x1e')](_0x4e3bca['include'],function(_0x263b49){return{'model':db[_0x263b49[_0x3f54('0x1f')]],'as':_0x263b49['as'],'attributes':_0x263b49[_0x3f54('0x20')],'include':_0x263b49[_0x3f54('0x1d')]?_[_0x3f54('0x1e')](_0x263b49[_0x3f54('0x1d')],function(_0x4dcf2e){return{'model':db[_0x4dcf2e['model']],'as':_0x4dcf2e['as'],'attributes':_0x4dcf2e[_0x3f54('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa9f04d){logger['info']('GetTrigger',_0x5f35dc);logger[_0x3f54('0x21')]('GetTrigger',_0x5f35dc,JSON['stringify'](_0xa9f04d));_0x31e15e(_0xa9f04d);})[_0x3f54('0x17')](function(_0x18d029){logger[_0x3f54('0x13')](_0x3f54('0x22'),_0x18d029[_0x3f54('0x15')],_0x5f35dc);_0x1e84e4(_0x4be406[_0x3f54('0x13')](0x1f4,_0x18d029[_0x3f54('0x15')]));});});};exports['ShowTrigger']=function(_0xf362ac){var _0x22e57d=this;return new Promise(function(_0x3e4e29,_0x3af88b){return db[_0x3f54('0x18')]['find']({'raw':_0xf362ac[_0x3f54('0x19')]?_0xf362ac[_0x3f54('0x19')][_0x3f54('0x1a')]===undefined?!![]:![]:!![],'where':_0xf362ac[_0x3f54('0x19')]?_0xf362ac[_0x3f54('0x19')][_0x3f54('0x1b')]||null:null,'attributes':_0xf362ac[_0x3f54('0x19')]?_0xf362ac[_0x3f54('0x19')]['attributes']||null:null,'include':_0xf362ac[_0x3f54('0x19')]?_0xf362ac[_0x3f54('0x19')][_0x3f54('0x1d')]?_[_0x3f54('0x1e')](_0xf362ac[_0x3f54('0x19')][_0x3f54('0x1d')],function(_0x450891){return{'model':db[_0x450891['model']],'as':_0x450891['as'],'attributes':_0x450891[_0x3f54('0x20')],'include':_0x450891['include']?_[_0x3f54('0x1e')](_0x450891[_0x3f54('0x1d')],function(_0x2d30ad){return{'model':db[_0x2d30ad['model']],'as':_0x2d30ad['as'],'attributes':_0x2d30ad[_0x3f54('0x20')],'include':_0x2d30ad[_0x3f54('0x1d')]?_[_0x3f54('0x1e')](_0x2d30ad[_0x3f54('0x1d')],function(_0x3193e9){return{'model':db[_0x3193e9[_0x3f54('0x1f')]],'as':_0x3193e9['as'],'attributes':_0x3193e9[_0x3f54('0x20')]};}):[]};}):[]};}):[]:[]})[_0x3f54('0x23')](function(_0x1f9cdb){logger['info'](_0x3f54('0x24'),_0xf362ac);logger['debug'](_0x3f54('0x24'),_0xf362ac,JSON[_0x3f54('0x12')](_0x1f9cdb));_0x3e4e29(_0x1f9cdb);})['catch'](function(_0x435dfc){logger['error'](_0x3f54('0x24'),_0x435dfc[_0x3f54('0x15')],_0xf362ac);_0x3af88b(_0x22e57d[_0x3f54('0x13')](0x1f4,_0x435dfc['message']));});});};
\ No newline at end of file
index efa204f..c8d788d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c76=['./trunk.controller','get','isAuthenticated','/:id','show','post','/:id/clone','clone','create','put','delete','destroy','util','path','connect-timeout','fs-extra','../../components/interaction/service'];(function(_0x4af2de,_0x1b8349){var _0x5e45ca=function(_0x32bcea){while(--_0x32bcea){_0x4af2de['push'](_0x4af2de['shift']());}};_0x5e45ca(++_0x1b8349);}(_0x5c76,0xc7));var _0x65c7=function(_0x29d623,_0x1a5c9c){_0x29d623=_0x29d623-0x0;var _0x242e59=_0x5c76[_0x29d623];return _0x242e59;};'use strict';var multer=require('multer');var util=require(_0x65c7('0x0'));var path=require(_0x65c7('0x1'));var timeout=require(_0x65c7('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x65c7('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x65c7('0x4'));var config=require('../../config/environment');var controller=require(_0x65c7('0x5'));router[_0x65c7('0x6')]('/',auth[_0x65c7('0x7')](),controller['index']);router['get'](_0x65c7('0x8'),auth[_0x65c7('0x7')](),controller[_0x65c7('0x9')]);router[_0x65c7('0xa')](_0x65c7('0xb'),auth[_0x65c7('0x7')](),controller[_0x65c7('0xc')]);router[_0x65c7('0xa')]('/',auth[_0x65c7('0x7')](),controller[_0x65c7('0xd')]);router[_0x65c7('0xe')](_0x65c7('0x8'),auth[_0x65c7('0x7')](),controller['update']);router[_0x65c7('0xf')](_0x65c7('0x8'),auth[_0x65c7('0x7')](),controller[_0x65c7('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x8f67=['../../config/environment','./trunk.controller','isAuthenticated','index','show','/:id/clone','clone','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x7fb82,_0x5a773d){var _0x26b78f=function(_0x35dd5c){while(--_0x35dd5c){_0x7fb82['push'](_0x7fb82['shift']());}};_0x26b78f(++_0x5a773d);}(_0x8f67,0xde));var _0x78f6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8f67[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x78f6('0x0'));var util=require(_0x78f6('0x1'));var path=require(_0x78f6('0x2'));var timeout=require(_0x78f6('0x3'));var express=require(_0x78f6('0x4'));var router=express['Router']();var fs_extra=require(_0x78f6('0x5'));var auth=require(_0x78f6('0x6'));var interaction=require(_0x78f6('0x7'));var config=require(_0x78f6('0x8'));var controller=require(_0x78f6('0x9'));router['get']('/',auth[_0x78f6('0xa')](),controller[_0x78f6('0xb')]);router['get']('/:id',auth[_0x78f6('0xa')](),controller[_0x78f6('0xc')]);router['post'](_0x78f6('0xd'),auth[_0x78f6('0xa')](),controller[_0x78f6('0xe')]);router[_0x78f6('0xf')]('/',auth[_0x78f6('0xa')](),controller[_0x78f6('0x10')]);router[_0x78f6('0x11')]('/:id',auth[_0x78f6('0xa')](),controller[_0x78f6('0x12')]);router[_0x78f6('0x13')](_0x78f6('0x14'),auth['isAuthenticated'](),controller[_0x78f6('0x15')]);module[_0x78f6('0x16')]=router;
\ No newline at end of file
index 10cd140..c594c1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2e4=['ENUM','yes','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','always','accept','refuse','originate','uac','uas','pai','certificate','passive','actpass','update,nonat','BOOLEAN','sequelize','exports','STRING','name','friend','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','nonat','update','outgoing'];(function(_0x2526e3,_0x5f22f8){var _0xcf6f48=function(_0x284491){while(--_0x284491){_0x2526e3['push'](_0x2526e3['shift']());}};_0xcf6f48(++_0x5f22f8);}(_0xb2e4,0x1c8));var _0x4b2e=function(_0x221ba2,_0x79208){_0x221ba2=_0x221ba2-0x0;var _0x47d08e=_0xb2e4[_0x221ba2];return _0x47d08e;};'use strict';var Sequelize=require(_0x4b2e('0x0'));module[_0x4b2e('0x1')]={'name':{'type':Sequelize[_0x4b2e('0x2')],'allowNull':![],'unique':_0x4b2e('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x4b2e('0x4'),'user','peer'),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4b2e('0x5')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0x4b2e('0x6'),_0x4b2e('0x7'),'ALLOWED',_0x4b2e('0x8'),'PROHIB_PASSED_SCREEN',_0x4b2e('0x9'),_0x4b2e('0xa'))},'deny':{'type':Sequelize[_0x4b2e('0x2')]},'permit':{'type':Sequelize[_0x4b2e('0x2')]},'secret':{'type':Sequelize[_0x4b2e('0x2')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x4b2e('0x2')]},'transport':{'type':Sequelize[_0x4b2e('0x2')],'defaultValue':_0x4b2e('0xb'),'set':function(_0xabf240){this[_0x4b2e('0xc')](_0x4b2e('0xd'),_0xabf240?_0xabf240['join'](','):null);},'get':function(){return this['getDataValue'](_0x4b2e('0xd'))?this[_0x4b2e('0xe')](_0x4b2e('0xd'))[_0x4b2e('0xf')](','):null;},'comment':_0x4b2e('0x10')},'dtmfmode':{'type':Sequelize['ENUM'](_0x4b2e('0x11'),_0x4b2e('0x12'),_0x4b2e('0x13'),_0x4b2e('0x14'),'auto'),'defaultValue':_0x4b2e('0x11')},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0x4b2e('0x15'),_0x4b2e('0x16'),_0x4b2e('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x4b2e('0x18')](_0x4b2e('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x4b2e('0x2')]},'directmediadeny':{'type':Sequelize[_0x4b2e('0x2')]},'nat':{'type':Sequelize[_0x4b2e('0x2')],'defaultValue':'force_rport,comedia','set':function(_0x5a7533){this[_0x4b2e('0xc')]('nat',_0x5a7533?_0x5a7533[_0x4b2e('0x1a')](','):null);},'get':function(){return this[_0x4b2e('0xe')]('nat')?this[_0x4b2e('0xe')](_0x4b2e('0x1b'))['split'](','):null;},'comment':_0x4b2e('0x1c')},'callgroup':{'type':Sequelize[_0x4b2e('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x4b2e('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x4b2e('0x2')]},'language':{'type':Sequelize[_0x4b2e('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x4b2e('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x4b2e('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x4b2e('0x2')],'allowNull':![],'defaultValue':_0x4b2e('0x1d'),'set':function(_0x323615){this[_0x4b2e('0xc')](_0x4b2e('0x1e'),_0x323615?_0x323615[_0x4b2e('0x1a')](';'):_0x4b2e('0x1d'));},'get':function(){return this[_0x4b2e('0xe')](_0x4b2e('0x1e'))?this[_0x4b2e('0xe')](_0x4b2e('0x1e'))[_0x4b2e('0xf')](';'):null;},'comment':_0x4b2e('0x1f')},'autoframing':{'type':Sequelize[_0x4b2e('0x18')]('yes','no')},'insecure':{'type':Sequelize[_0x4b2e('0x2')],'defaultValue':_0x4b2e('0x20'),'set':function(_0x589c44){this[_0x4b2e('0xc')]('insecure',_0x589c44?_0x589c44['join'](','):null);},'get':function(){return this['getDataValue'](_0x4b2e('0x21'))?this[_0x4b2e('0xe')](_0x4b2e('0x21'))[_0x4b2e('0xf')](','):null;},'comment':_0x4b2e('0x22')},'trustrpid':{'type':Sequelize['ENUM'](_0x4b2e('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x4b2e('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x4b2e('0x18')](_0x4b2e('0x19'),'no','never')},'promiscredir':{'type':Sequelize[_0x4b2e('0x18')](_0x4b2e('0x19'),'no')},'useclientcode':{'type':Sequelize[_0x4b2e('0x18')](_0x4b2e('0x19'),'no')},'accountcode':{'type':Sequelize[_0x4b2e('0x23')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x4b2e('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x4b2e('0x2')]},'callcounter':{'type':Sequelize[_0x4b2e('0x18')]('yes','no'),'defaultValue':_0x4b2e('0x19')},'busylevel':{'type':Sequelize[_0x4b2e('0x23')](0xb)},'allowoverlap':{'type':Sequelize[_0x4b2e('0x18')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x4b2e('0x18')](_0x4b2e('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0x4b2e('0x18')](_0x4b2e('0x19'),'no')},'ignoresdpversion':{'type':Sequelize[_0x4b2e('0x18')](_0x4b2e('0x19'),'no')},'subscribecontext':{'type':Sequelize[_0x4b2e('0x2')]},'template':{'type':Sequelize[_0x4b2e('0x2')]},'videosupport':{'type':Sequelize['ENUM']('yes','no',_0x4b2e('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x4b2e('0x18')](_0x4b2e('0x19'),'no')},'mailbox':{'type':Sequelize[_0x4b2e('0x2')]},'session_timers':{'type':Sequelize[_0x4b2e('0x18')](_0x4b2e('0x25'),_0x4b2e('0x26'),_0x4b2e('0x27'))},'session_expires':{'type':Sequelize[_0x4b2e('0x23')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x4b2e('0x28'),_0x4b2e('0x29')),'defaultValue':_0x4b2e('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0x4b2e('0x2')]},'regexten':{'type':Sequelize[_0x4b2e('0x2')]},'fromdomain':{'type':Sequelize[_0x4b2e('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x4b2e('0x18')]('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x4b2e('0x23')](0xb)},'defaultip':{'type':Sequelize[_0x4b2e('0x2')]},'defaultuser':{'type':Sequelize[_0x4b2e('0x2')]},'rtptimeout':{'type':Sequelize[_0x4b2e('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x4b2e('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x4b2e('0x23')](0xb)},'sendrpid':{'type':Sequelize[_0x4b2e('0x18')](_0x4b2e('0x19'),'no',_0x4b2e('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x4b2e('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x4b2e('0x23')](0xb)},'timerb':{'type':Sequelize[_0x4b2e('0x23')](0xb)},'qualifyfreq':{'type':Sequelize[_0x4b2e('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0x4b2e('0x2')]},'contactdeny':{'type':Sequelize[_0x4b2e('0x2')]},'contactacl':{'type':Sequelize[_0x4b2e('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x4b2e('0x2')]},'use_q850_reason':{'type':Sequelize[_0x4b2e('0x2')]},'maxforwards':{'type':Sequelize[_0x4b2e('0x23')](0xb)},'encryption':{'type':Sequelize[_0x4b2e('0x18')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x4b2e('0x18')]('yes','no')},'force_avp':{'type':Sequelize['ENUM'](_0x4b2e('0x19'),'no')},'icesupport':{'type':Sequelize[_0x4b2e('0x18')](_0x4b2e('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0x4b2e('0x18')](_0x4b2e('0x19'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x4b2e('0x19'),'no','fingerprint',_0x4b2e('0x2b'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x4b2e('0x2')]},'dtlscafile':{'type':Sequelize[_0x4b2e('0x2')]},'dtlscapath':{'type':Sequelize[_0x4b2e('0x2')]},'dtlssetup':{'type':Sequelize[_0x4b2e('0x18')]('active',_0x4b2e('0x2c'),_0x4b2e('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x4b2e('0x2')]},'usereqphone':{'type':Sequelize['ENUM'](_0x4b2e('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x4b2e('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x4b2e('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x4b2e('0x18')](_0x4b2e('0x19'),'no')},'subscribemwi':{'type':Sequelize[_0x4b2e('0x18')](_0x4b2e('0x19'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x4b2e('0x2')]},'mohsuggest':{'type':Sequelize[_0x4b2e('0x2')]},'parkinglot':{'type':Sequelize[_0x4b2e('0x2')]},'description':{'type':Sequelize[_0x4b2e('0x2')]},'host':{'type':Sequelize['STRING'],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x4b2e('0x18')](_0x4b2e('0x19'),'no',_0x4b2e('0x15'),_0x4b2e('0x16'),_0x4b2e('0x2e')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x4b2e('0x2')]},'otherFields':{'type':Sequelize[_0x4b2e('0x2')]},'active':{'type':Sequelize[_0x4b2e('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x4b2e('0x2')],'defaultValue':'no'}};
\ No newline at end of file
+var _0x3e9f=['ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','join','getDataValue','split','rfc2833','shortinfo','inband','auto','yes','nonat','update','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\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','BOOLEAN','sequelize','exports','STRING','name','friend','user','peer','ENUM','ALLOWED_NOT_SCREENED'];(function(_0x26737c,_0x48da5e){var _0x2787cf=function(_0x570ff7){while(--_0x570ff7){_0x26737c['push'](_0x26737c['shift']());}};_0x2787cf(++_0x48da5e);}(_0x3e9f,0x129));var _0xf3e9=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x3e9f[_0x13e741];return _0x3f8bb3;};'use strict';var Sequelize=require(_0xf3e9('0x0'));module[_0xf3e9('0x1')]={'name':{'type':Sequelize[_0xf3e9('0x2')],'allowNull':![],'unique':_0xf3e9('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xf3e9('0x4'),_0xf3e9('0x5'),_0xf3e9('0x6')),'allowNull':![],'defaultValue':_0xf3e9('0x4')},'context':{'type':Sequelize[_0xf3e9('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0xf3e9('0x7')](_0xf3e9('0x8'),_0xf3e9('0x9'),_0xf3e9('0xa'),_0xf3e9('0xb'),_0xf3e9('0xc'),_0xf3e9('0xd'),'PROHIB_FAILED_SCREEN',_0xf3e9('0xe'))},'deny':{'type':Sequelize[_0xf3e9('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xf3e9('0x2')]},'md5secret':{'type':Sequelize[_0xf3e9('0x2')]},'remotesecret':{'type':Sequelize[_0xf3e9('0x2')]},'transport':{'type':Sequelize[_0xf3e9('0x2')],'defaultValue':_0xf3e9('0xf'),'set':function(_0x2ad841){this['setDataValue'](_0xf3e9('0x10'),_0x2ad841?_0x2ad841[_0xf3e9('0x11')](','):null);},'get':function(){return this[_0xf3e9('0x12')](_0xf3e9('0x10'))?this[_0xf3e9('0x12')]('transport')[_0xf3e9('0x13')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xf3e9('0x7')](_0xf3e9('0x14'),'info',_0xf3e9('0x15'),_0xf3e9('0x16'),_0xf3e9('0x17')),'defaultValue':_0xf3e9('0x14')},'directmedia':{'type':Sequelize[_0xf3e9('0x7')](_0xf3e9('0x18'),'no',_0xf3e9('0x19'),_0xf3e9('0x1a'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xf3e9('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xf3e9('0x2')]},'directmediadeny':{'type':Sequelize[_0xf3e9('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xf3e9('0x1b'),'set':function(_0x5b2ccd){this['setDataValue'](_0xf3e9('0x1c'),_0x5b2ccd?_0x5b2ccd[_0xf3e9('0x11')](','):null);},'get':function(){return this[_0xf3e9('0x12')](_0xf3e9('0x1c'))?this[_0xf3e9('0x12')](_0xf3e9('0x1c'))['split'](','):null;},'comment':_0xf3e9('0x1d')},'callgroup':{'type':Sequelize[_0xf3e9('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xf3e9('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0xf3e9('0x2')],'defaultValue':_0xf3e9('0x1e')},'allow':{'type':Sequelize[_0xf3e9('0x2')],'allowNull':![],'defaultValue':_0xf3e9('0x1f'),'set':function(_0x2bf5fb){this['setDataValue'](_0xf3e9('0x20'),_0x2bf5fb?_0x2bf5fb[_0xf3e9('0x11')](';'):_0xf3e9('0x1f'));},'get':function(){return this[_0xf3e9('0x12')](_0xf3e9('0x20'))?this['getDataValue'](_0xf3e9('0x20'))[_0xf3e9('0x13')](';'):null;},'comment':_0xf3e9('0x21')},'autoframing':{'type':Sequelize[_0xf3e9('0x7')](_0xf3e9('0x18'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xf3e9('0x22'),'set':function(_0xedd7fb){this['setDataValue'](_0xf3e9('0x23'),_0xedd7fb?_0xedd7fb[_0xf3e9('0x11')](','):null);},'get':function(){return this[_0xf3e9('0x12')](_0xf3e9('0x23'))?this[_0xf3e9('0x12')]('insecure')[_0xf3e9('0x13')](','):null;},'comment':_0xf3e9('0x24')},'trustrpid':{'type':Sequelize[_0xf3e9('0x7')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xf3e9('0x7')](_0xf3e9('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xf3e9('0x7')](_0xf3e9('0x18'),'no','never')},'promiscredir':{'type':Sequelize[_0xf3e9('0x7')](_0xf3e9('0x18'),'no')},'useclientcode':{'type':Sequelize[_0xf3e9('0x7')]('yes','no')},'accountcode':{'type':Sequelize[_0xf3e9('0x25')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xf3e9('0x2')]},'callcounter':{'type':Sequelize[_0xf3e9('0x7')](_0xf3e9('0x18'),'no'),'defaultValue':_0xf3e9('0x18')},'busylevel':{'type':Sequelize[_0xf3e9('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0xf3e9('0x7')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0xf3e9('0x7')]('yes','no')},'allowtransfer':{'type':Sequelize[_0xf3e9('0x7')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xf3e9('0x7')](_0xf3e9('0x18'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0xf3e9('0x2')]},'videosupport':{'type':Sequelize['ENUM'](_0xf3e9('0x18'),'no',_0xf3e9('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xf3e9('0x7')](_0xf3e9('0x18'),'no')},'mailbox':{'type':Sequelize[_0xf3e9('0x2')]},'session_timers':{'type':Sequelize[_0xf3e9('0x7')](_0xf3e9('0x27'),_0xf3e9('0x28'),_0xf3e9('0x29'))},'session_expires':{'type':Sequelize[_0xf3e9('0x25')](0xb)},'session_minse':{'type':Sequelize[_0xf3e9('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0xf3e9('0x7')](_0xf3e9('0x2a'),'uas'),'defaultValue':_0xf3e9('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0xf3e9('0x2')]},'regexten':{'type':Sequelize[_0xf3e9('0x2')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0xf3e9('0x2')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0xf3e9('0x7')](_0xf3e9('0x18'),'no'),'defaultValue':_0xf3e9('0x18')},'keepalive':{'type':Sequelize[_0xf3e9('0x25')](0xb)},'defaultip':{'type':Sequelize[_0xf3e9('0x2')]},'defaultuser':{'type':Sequelize[_0xf3e9('0x2')]},'rtptimeout':{'type':Sequelize[_0xf3e9('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xf3e9('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0xf3e9('0x7')](_0xf3e9('0x18'),'no',_0xf3e9('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xf3e9('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0xf3e9('0x25')](0xb)},'timerb':{'type':Sequelize[_0xf3e9('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0xf3e9('0x25')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xf3e9('0x2')]},'contactacl':{'type':Sequelize[_0xf3e9('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0xf3e9('0x2')]},'maxforwards':{'type':Sequelize[_0xf3e9('0x25')](0xb)},'encryption':{'type':Sequelize[_0xf3e9('0x7')](_0xf3e9('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xf3e9('0x7')](_0xf3e9('0x18'),'no')},'force_avp':{'type':Sequelize[_0xf3e9('0x7')]('yes','no')},'icesupport':{'type':Sequelize[_0xf3e9('0x7')](_0xf3e9('0x18'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xf3e9('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0xf3e9('0x7')](_0xf3e9('0x18'),'no',_0xf3e9('0x2d'),_0xf3e9('0x2e'))},'dtlsrekey':{'type':Sequelize[_0xf3e9('0x25')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0xf3e9('0x2')]},'dtlscafile':{'type':Sequelize[_0xf3e9('0x2')]},'dtlscapath':{'type':Sequelize[_0xf3e9('0x2')]},'dtlssetup':{'type':Sequelize['ENUM'](_0xf3e9('0x2f'),_0xf3e9('0x30'),_0xf3e9('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xf3e9('0x7')](_0xf3e9('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xf3e9('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xf3e9('0x7')](_0xf3e9('0x18'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0xf3e9('0x18'),'no')},'vmexten':{'type':Sequelize[_0xf3e9('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0xf3e9('0x2')]},'parkinglot':{'type':Sequelize[_0xf3e9('0x2')]},'description':{'type':Sequelize[_0xf3e9('0x2')]},'host':{'type':Sequelize[_0xf3e9('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xf3e9('0x7')](_0xf3e9('0x18'),'no',_0xf3e9('0x19'),_0xf3e9('0x1a'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xf3e9('0x2')]},'active':{'type':Sequelize[_0xf3e9('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}};
\ No newline at end of file
index 6abbbbd..10ec55f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['catch','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','destroy','get','UserProfileResource','end','stack','name','send','Trunk','rawAttributes','type','model','map','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','keys','length','options','find','clone','omit','updatedAt','body','createdAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','render','Reload','chan_sip.so','readFileSync','/etc/asterisk/sip_xcally_registers.conf','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x4a4303,_0x40891a){var _0x7dbf6b=function(_0x4e8ae5){while(--_0x4e8ae5){_0x4a4303['push'](_0x4a4303['shift']());}};_0x7dbf6b(++_0x40891a);}(_0x55ca,0x126));var _0xa55c=function(_0x114c1c,_0x5bfd6d){_0x114c1c=_0x114c1c-0x0;var _0x50a0a6=_0x55ca[_0x114c1c];return _0x50a0a6;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xa55c('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x576044,_0x5a3672,_0x59ea8d,_0x18ee85){return new BPromise(function(_0x3930e4,_0x462cd6){var _0x938bd6=_0x18ee85||client;return _0x938bd6[_0xa55c('0x19')](_0x576044,_0x59ea8d)[_0xa55c('0x1a')](function(_0x4e0b2f){logger[_0xa55c('0x1b')](_0xa55c('0x1c'),_0x5a3672,_0xa55c('0x1d'));logger[_0xa55c('0x1e')](_0xa55c('0x1f'),_0x5a3672,_0xa55c('0x1d'),JSON[_0xa55c('0x20')](_0x4e0b2f));if(_0x4e0b2f[_0xa55c('0x21')]){if(_0x4e0b2f[_0xa55c('0x21')]['code']===0x1f4){logger[_0xa55c('0x21')](_0xa55c('0x1c'),_0x5a3672,_0x4e0b2f[_0xa55c('0x21')][_0xa55c('0x22')]);return _0x462cd6(_0x4e0b2f[_0xa55c('0x21')][_0xa55c('0x22')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5a3672,_0x4e0b2f[_0xa55c('0x21')][_0xa55c('0x22')]);return _0x3930e4(_0x4e0b2f[_0xa55c('0x21')]['message']);}else{logger[_0xa55c('0x1b')](_0xa55c('0x1c'),_0x5a3672,'request\x20sent');_0x3930e4(_0x4e0b2f[_0xa55c('0x23')][_0xa55c('0x22')]);}})[_0xa55c('0x24')](function(_0x1965f1){logger[_0xa55c('0x21')]('Trunk,\x20%s,\x20%s',_0x5a3672,_0x1965f1);_0x462cd6(_0x1965f1);});});}function respondWithStatusCode(_0x1fc828,_0x504c24){_0x504c24=_0x504c24||0xcc;return function(_0x5ba836){if(_0x5ba836){return _0x1fc828['sendStatus'](_0x504c24);}return _0x1fc828[_0xa55c('0x25')](_0x504c24)['end']();};}function respondWithResult(_0x3ecbe7,_0x190757){_0x190757=_0x190757||0xc8;return function(_0x3f64de){if(_0x3f64de){return _0x3ecbe7[_0xa55c('0x25')](_0x190757)[_0xa55c('0x26')](_0x3f64de);}};}function respondWithFilteredResult(_0x170ba4,_0x1da633){return function(_0x11e7f7){if(_0x11e7f7){var _0x192df2=typeof _0x1da633[_0xa55c('0x27')]===_0xa55c('0x28')&&typeof _0x1da633['limit']===_0xa55c('0x28');var _0x28814f=_0x11e7f7[_0xa55c('0x29')];var _0x906caa=_0x192df2?0x0:_0x1da633['offset'];var _0x1377b0=_0x192df2?_0x11e7f7[_0xa55c('0x29')]:_0x1da633[_0xa55c('0x27')]+_0x1da633[_0xa55c('0x2a')];var _0x45ee8d;if(_0x1377b0>=_0x28814f){_0x1377b0=_0x28814f;_0x45ee8d=0xc8;}else{_0x45ee8d=0xce;}_0x170ba4[_0xa55c('0x25')](_0x45ee8d);return _0x170ba4['set'](_0xa55c('0x2b'),_0x906caa+'-'+_0x1377b0+'/'+_0x28814f)['json'](_0x11e7f7);}return null;};}function patchUpdates(_0x35c9c2){return function(_0x1d730b){try{jsonpatch[_0xa55c('0x2c')](_0x1d730b,_0x35c9c2,!![]);}catch(_0x223813){return BPromise['reject'](_0x223813);}return _0x1d730b[_0xa55c('0x2d')]();};}function saveUpdates(_0x2096ae,_0x331e58){return function(_0x20da31){if(_0x20da31){return _0x20da31[_0xa55c('0x2e')](_0x2096ae)[_0xa55c('0x1a')](function(_0x29748a){return _0x29748a;});}return null;};}function removeEntity(_0x24d44d,_0x2808e9){return function(_0xcbaf2e){if(_0xcbaf2e){return _0xcbaf2e[_0xa55c('0x2f')]()['then'](function(){var _0x54ca97=_0xcbaf2e[_0xa55c('0x30')]({'plain':!![]});var _0x19733e='Trunks';return db[_0xa55c('0x31')][_0xa55c('0x2f')]({'where':{'type':_0x19733e,'resourceId':_0x54ca97['id']}})[_0xa55c('0x1a')](function(){return _0xcbaf2e;});})[_0xa55c('0x1a')](function(){_0x24d44d[_0xa55c('0x25')](0xcc)[_0xa55c('0x32')]();});}};}function handleEntityNotFound(_0x3ce1b3,_0x222d4b){return function(_0x3959e3){if(!_0x3959e3){_0x3ce1b3['sendStatus'](0x194);}return _0x3959e3;};}function handleError(_0x5f3e99,_0x4b23d3){_0x4b23d3=_0x4b23d3||0x1f4;return function(_0x3fd75f){logger[_0xa55c('0x21')](_0x3fd75f[_0xa55c('0x33')]);if(_0x3fd75f['name']){delete _0x3fd75f[_0xa55c('0x34')];}_0x5f3e99['status'](_0x4b23d3)[_0xa55c('0x35')](_0x3fd75f);};}exports['index']=function(_0x18c6f1,_0x39267c){var _0x3c0ec1={},_0x4d3eb5={},_0x7c4a47={'count':0x0,'rows':[]};var _0x30f23b=_['map'](db[_0xa55c('0x36')][_0xa55c('0x37')],function(_0x4d9083){return{'name':_0x4d9083['fieldName'],'type':_0x4d9083[_0xa55c('0x38')]['key']};});_0x4d3eb5[_0xa55c('0x39')]=_[_0xa55c('0x3a')](_0x30f23b,'name');_0x4d3eb5['query']=_['keys'](_0x18c6f1['query']);_0x4d3eb5[_0xa55c('0x3b')]=_[_0xa55c('0x3c')](_0x4d3eb5[_0xa55c('0x39')],_0x4d3eb5[_0xa55c('0x3d')]);_0x3c0ec1[_0xa55c('0x3e')]=_['intersection'](_0x4d3eb5[_0xa55c('0x39')],qs[_0xa55c('0x3f')](_0x18c6f1[_0xa55c('0x3d')][_0xa55c('0x3f')]));_0x3c0ec1[_0xa55c('0x3e')]=_0x3c0ec1[_0xa55c('0x3e')]['length']?_0x3c0ec1[_0xa55c('0x3e')]:_0x4d3eb5['model'];if(!_0x18c6f1['query'][_0xa55c('0x40')](_0xa55c('0x41'))){_0x3c0ec1['limit']=qs[_0xa55c('0x2a')](_0x18c6f1['query']['limit']);_0x3c0ec1[_0xa55c('0x27')]=qs[_0xa55c('0x27')](_0x18c6f1[_0xa55c('0x3d')]['offset']);}_0x3c0ec1[_0xa55c('0x42')]=qs[_0xa55c('0x43')](_0x18c6f1['query'][_0xa55c('0x43')]);_0x3c0ec1['where']=qs[_0xa55c('0x3b')](_[_0xa55c('0x44')](_0x18c6f1['query'],_0x4d3eb5[_0xa55c('0x3b')]),_0x30f23b);if(_0x18c6f1[_0xa55c('0x3d')]['filter']){_0x3c0ec1[_0xa55c('0x45')]=_[_0xa55c('0x46')](_0x3c0ec1[_0xa55c('0x45')],{'$or':_['map'](_0x30f23b,function(_0x334f52){if(_0x334f52['type']!==_0xa55c('0x47')){var _0x3a8af4={};_0x3a8af4[_0x334f52[_0xa55c('0x34')]]={'$like':'%'+_0x18c6f1['query'][_0xa55c('0x48')]+'%'};return _0x3a8af4;}})});}_0x3c0ec1=_[_0xa55c('0x46')]({},_0x3c0ec1,_0x18c6f1['options']);var _0x3d19f5={'where':_0x3c0ec1[_0xa55c('0x45')]};return db['Trunk'][_0xa55c('0x29')](_0x3d19f5)[_0xa55c('0x1a')](function(_0x52f9a7){_0x7c4a47[_0xa55c('0x29')]=_0x52f9a7;if(_0x18c6f1[_0xa55c('0x3d')][_0xa55c('0x49')]){_0x3c0ec1[_0xa55c('0x4a')]=[{'all':!![]}];}return db['Trunk'][_0xa55c('0x4b')](_0x3c0ec1);})['then'](function(_0x2157d6){_0x7c4a47[_0xa55c('0x4c')]=_0x2157d6;return _0x7c4a47;})[_0xa55c('0x1a')](respondWithFilteredResult(_0x39267c,_0x3c0ec1))['catch'](handleError(_0x39267c,null));};exports[_0xa55c('0x4d')]=function(_0x250b00,_0x574fe9){var _0x5be06={'raw':![],'where':{'id':_0x250b00[_0xa55c('0x4e')]['id']}},_0x34de95={};_0x34de95[_0xa55c('0x39')]=_[_0xa55c('0x4f')](db[_0xa55c('0x36')][_0xa55c('0x37')]);_0x34de95[_0xa55c('0x3d')]=_[_0xa55c('0x4f')](_0x250b00[_0xa55c('0x3d')]);_0x34de95['filters']=_[_0xa55c('0x3c')](_0x34de95[_0xa55c('0x39')],_0x34de95[_0xa55c('0x3d')]);_0x5be06['attributes']=_[_0xa55c('0x3c')](_0x34de95[_0xa55c('0x39')],qs['fields'](_0x250b00[_0xa55c('0x3d')]['fields']));_0x5be06[_0xa55c('0x3e')]=_0x5be06[_0xa55c('0x3e')][_0xa55c('0x50')]?_0x5be06[_0xa55c('0x3e')]:_0x34de95[_0xa55c('0x39')];if(_0x250b00['query'][_0xa55c('0x49')]){_0x5be06[_0xa55c('0x4a')]=[{'all':!![]}];}_0x5be06=_['merge']({},_0x5be06,_0x250b00[_0xa55c('0x51')]);return db[_0xa55c('0x36')][_0xa55c('0x52')](_0x5be06)[_0xa55c('0x1a')](handleEntityNotFound(_0x574fe9,null))['then'](respondWithResult(_0x574fe9,null))['catch'](handleError(_0x574fe9,null));};exports[_0xa55c('0x53')]=function(_0x250dea,_0x3ca5b8){var _0x44ac57={'where':{'id':_0x250dea[_0xa55c('0x4e')]['id']}},_0x54cbde={};_0x54cbde['model']=_[_0xa55c('0x4f')](db[_0xa55c('0x36')][_0xa55c('0x37')]);_0x44ac57[_0xa55c('0x3e')]=_[_0xa55c('0x3c')](_0x54cbde['model'],qs[_0xa55c('0x3f')](_0x250dea['query'][_0xa55c('0x3f')]));_0x44ac57[_0xa55c('0x3e')]=_0x44ac57[_0xa55c('0x3e')][_0xa55c('0x50')]?_0x44ac57[_0xa55c('0x3e')]:_0x54cbde[_0xa55c('0x39')];if(_0x250dea[_0xa55c('0x3d')]['includeAll']){_0x44ac57[_0xa55c('0x4a')]=[{'all':!![]}];}_0x44ac57=_[_0xa55c('0x46')]({},_0x44ac57,_0x250dea[_0xa55c('0x51')]);return db[_0xa55c('0x36')][_0xa55c('0x52')](_0x44ac57)['then'](handleEntityNotFound(_0x3ca5b8,null))[_0xa55c('0x1a')](function(_0x3cd40d){if(_0x3cd40d){var _0x28bac4=_0x3cd40d[_0xa55c('0x30')]({'plain':!![]});_0x28bac4=qs[_0xa55c('0x54')](_0x28bac4,['id','createdAt',_0xa55c('0x55')]);_0x250dea[_0xa55c('0x56')]=_[_0xa55c('0x54')](_0x250dea[_0xa55c('0x56')],['id',_0xa55c('0x57'),'updatedAt']);return db[_0xa55c('0x36')]['create'](_[_0xa55c('0x46')](_0x28bac4,_0x250dea['body']),{'include':_0x250dea[_0xa55c('0x3d')]['includeAll']?[{'all':!![]}]:undefined})[_0xa55c('0x1a')](function(_0x1333da){var _0x21d6b4=_0x250dea[_0xa55c('0x58')][_0xa55c('0x30')]({'plain':!![]});if(!_0x21d6b4)throw new Error(_0xa55c('0x59'));if(_0x21d6b4[_0xa55c('0x5a')]===_0xa55c('0x58')){var _0x14b515=_0x1333da[_0xa55c('0x30')]({'plain':!![]});var _0x51c736=_0xa55c('0x5b');return db[_0xa55c('0x5c')]['find']({'where':{'name':_0x51c736,'userProfileId':_0x21d6b4[_0xa55c('0x5d')]},'raw':!![]})[_0xa55c('0x1a')](function(_0x3e3b4b){if(_0x3e3b4b&&_0x3e3b4b[_0xa55c('0x5e')]===0x0){return db[_0xa55c('0x31')][_0xa55c('0x5f')]({'name':_0x14b515[_0xa55c('0x34')],'resourceId':_0x14b515['id'],'type':_0x3e3b4b[_0xa55c('0x34')],'sectionId':_0x3e3b4b['id']},{})['then'](function(){return _0x1333da;});}else{return _0x1333da;}})[_0xa55c('0x24')](function(_0x475131){logger[_0xa55c('0x21')](_0xa55c('0x60'),_0x475131);throw _0x475131;});}return _0x1333da;});}})[_0xa55c('0x1a')](respondWithResult(_0x3ca5b8,0xc9))[_0xa55c('0x24')](handleError(_0x3ca5b8,null));};exports[_0xa55c('0x5f')]=function(_0x4249c1,_0x25d5a1,_0x4a08ca){var _0x347562;return db[_0xa55c('0x36')][_0xa55c('0x5f')](_0x4249c1[_0xa55c('0x56')],{'raw':!![]})[_0xa55c('0x1a')](function(_0x10e711){_0x347562=_0x10e711;return db[_0xa55c('0x36')][_0xa55c('0x4b')]({'raw':!![]});})[_0xa55c('0x1a')](function(_0x3178a6){var _0x3bbc4b=fs['readFileSync'](path[_0xa55c('0x61')](config['root'],_0xa55c('0x62')),_0xa55c('0x63'));var _0x129bb4=fs['readFileSync'](path['join'](config[_0xa55c('0x64')],_0xa55c('0x65')),_0xa55c('0x63'));var _0x42529f=ejs['render'](_0x3bbc4b,{'trunks':_0x3178a6||[]});fs[_0xa55c('0x66')](_0xa55c('0x67'),_0x42529f);if(_0x347562[_0xa55c('0x68')]){var _0x3a9910=ejs[_0xa55c('0x69')](_0x129bb4,{'trunks':_0x3178a6||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x3a9910);}})[_0xa55c('0x1a')](function(){return respondWithRpcPromise(_0xa55c('0x6a'),_0xa55c('0x5f'),{'module':_0xa55c('0x6b')});})[_0xa55c('0x1a')](function(){var _0x4b2032=_0x4249c1[_0xa55c('0x58')][_0xa55c('0x30')]({'plain':!![]});if(!_0x4b2032)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b2032[_0xa55c('0x5a')]===_0xa55c('0x58')){var _0xa340fb=_0x347562['get']({'plain':!![]});return db[_0xa55c('0x5c')][_0xa55c('0x52')]({'where':{'name':_0xa55c('0x5b'),'userProfileId':_0x4b2032[_0xa55c('0x5d')]},'raw':!![]})[_0xa55c('0x1a')](function(_0x506f74){if(_0x506f74&&_0x506f74[_0xa55c('0x5e')]===0x0){return db[_0xa55c('0x31')]['create']({'name':_0xa340fb['name'],'resourceId':_0xa340fb['id'],'type':_0x506f74[_0xa55c('0x34')],'sectionId':_0x506f74['id']},{})['then'](function(){return _0x347562;});}else{return _0x347562;}})[_0xa55c('0x24')](function(_0x5ca0bc){logger[_0xa55c('0x21')](_0xa55c('0x60'),_0x5ca0bc);throw _0x5ca0bc;});}return _0x347562;})[_0xa55c('0x1a')](respondWithResult(_0x25d5a1,0xc9))[_0xa55c('0x24')](handleError(_0x25d5a1,null));};exports[_0xa55c('0x2e')]=function(_0xff7b1c,_0x16dfc6,_0x5d8551){var _0x463195;return db[_0xa55c('0x36')][_0xa55c('0x52')]({'where':{'id':_0xff7b1c[_0xa55c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x16dfc6,null))[_0xa55c('0x1a')](saveUpdates(_0xff7b1c[_0xa55c('0x56')],null))[_0xa55c('0x1a')](function(_0x2298ac){if(_0x2298ac){_0x463195=_0x2298ac;return db['Trunk']['findAll']({'raw':!![]});}})[_0xa55c('0x1a')](function(_0x428872){if(_0x428872){var _0x12e3a8=fs[_0xa55c('0x6c')](path['join'](config['root'],_0xa55c('0x62')),_0xa55c('0x63'));var _0xd33c9c=fs[_0xa55c('0x6c')](path[_0xa55c('0x61')](config[_0xa55c('0x64')],_0xa55c('0x65')),'utf8');var _0x19497b=ejs['render'](_0x12e3a8,{'trunks':_0x428872||[]});fs[_0xa55c('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x19497b);var _0x36ded7=ejs[_0xa55c('0x69')](_0xd33c9c,{'trunks':_0x428872||[]});fs[_0xa55c('0x66')](_0xa55c('0x6d'),_0x36ded7);return respondWithRpcPromise(_0xa55c('0x6a'),_0xa55c('0x2e'),{'module':_0xa55c('0x6b')});}return null;})[_0xa55c('0x1a')](function(_0x576a1b){if(_0x576a1b){return _0x463195;}})['then'](respondWithResult(_0x16dfc6,null))[_0xa55c('0x24')](handleError(_0x16dfc6,null));};exports[_0xa55c('0x2f')]=function(_0xc2ad5c,_0x256db0,_0x1622cb){var _0x137728;return db['Trunk'][_0xa55c('0x52')]({'where':{'id':_0xc2ad5c[_0xa55c('0x4e')]['id']}})[_0xa55c('0x1a')](handleEntityNotFound(_0x256db0,null))[_0xa55c('0x1a')](removeEntity(_0x256db0,null))[_0xa55c('0x1a')](function(){return db[_0xa55c('0x36')][_0xa55c('0x4b')]({'raw':!![]});})[_0xa55c('0x1a')](function(_0x58b670){var _0x25d09d=fs[_0xa55c('0x6c')](path[_0xa55c('0x61')](config[_0xa55c('0x64')],_0xa55c('0x62')),'utf8');var _0x2685d8=fs[_0xa55c('0x6c')](path['join'](config['root'],_0xa55c('0x65')),_0xa55c('0x63'));var _0x5c2229=ejs['render'](_0x25d09d,{'trunks':_0x58b670});var _0x579726=ejs['render'](_0x2685d8,{'trunks':_0x58b670});fs[_0xa55c('0x66')](_0xa55c('0x67'),_0x5c2229);fs[_0xa55c('0x66')](_0xa55c('0x6d'),_0x579726);return respondWithRpcPromise(_0xa55c('0x6a'),_0xa55c('0x2f'),{'module':'chan_sip.so'});})[_0xa55c('0x24')](handleError(_0x256db0,null));};
\ No newline at end of file
+var _0x8d0e=['omit','updatedAt','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','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','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','reject','update','destroy','get','Trunks','stack','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','createdAt','body'];(function(_0x4e2579,_0x52a9f7){var _0x14a286=function(_0x30de85){while(--_0x30de85){_0x4e2579['push'](_0x4e2579['shift']());}};_0x14a286(++_0x52a9f7);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x33a82a,_0x2d210d){_0x33a82a=_0x33a82a-0x0;var _0xb6c942=_0x8d0e[_0x33a82a];return _0xb6c942;};'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'];var jayson=require('jayson/promise');var client=jayson[_0xe8d0('0x1b')][_0xe8d0('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x533b42,_0x2b640d,_0x4cbd26,_0x59b4b7){return new BPromise(function(_0x90a1ea,_0x2aa906){var _0x1aa725=_0x59b4b7||client;return _0x1aa725[_0xe8d0('0x1d')](_0x533b42,_0x4cbd26)[_0xe8d0('0x1e')](function(_0x7151c6){logger['info'](_0xe8d0('0x1f'),_0x2b640d,'request\x20sent');logger[_0xe8d0('0x20')](_0xe8d0('0x21'),_0x2b640d,_0xe8d0('0x22'),JSON['stringify'](_0x7151c6));if(_0x7151c6['error']){if(_0x7151c6['error'][_0xe8d0('0x23')]===0x1f4){logger[_0xe8d0('0x24')](_0xe8d0('0x1f'),_0x2b640d,_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);return _0x2aa906(_0x7151c6['error'][_0xe8d0('0x25')]);}logger[_0xe8d0('0x24')]('Trunk,\x20%s,\x20%s',_0x2b640d,_0x7151c6['error']['message']);return _0x90a1ea(_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);}else{logger[_0xe8d0('0x26')](_0xe8d0('0x1f'),_0x2b640d,_0xe8d0('0x22'));_0x90a1ea(_0x7151c6[_0xe8d0('0x27')][_0xe8d0('0x25')]);}})[_0xe8d0('0x28')](function(_0x32e39a){logger['error'](_0xe8d0('0x1f'),_0x2b640d,_0x32e39a);_0x2aa906(_0x32e39a);});});}function respondWithStatusCode(_0x9f747,_0x572c25){_0x572c25=_0x572c25||0xcc;return function(_0x106614){if(_0x106614){return _0x9f747[_0xe8d0('0x29')](_0x572c25);}return _0x9f747[_0xe8d0('0x2a')](_0x572c25)[_0xe8d0('0x2b')]();};}function respondWithResult(_0x146783,_0x149dfd){_0x149dfd=_0x149dfd||0xc8;return function(_0x31519b){if(_0x31519b){return _0x146783[_0xe8d0('0x2a')](_0x149dfd)[_0xe8d0('0x2c')](_0x31519b);}};}function respondWithFilteredResult(_0x2dee67,_0x264de4){return function(_0x539548){if(_0x539548){var _0x24982c=typeof _0x264de4[_0xe8d0('0x2d')]===_0xe8d0('0x2e')&&typeof _0x264de4['limit']===_0xe8d0('0x2e');var _0x343b08=_0x539548['count'];var _0x1519e2=_0x24982c?0x0:_0x264de4[_0xe8d0('0x2d')];var _0x11fcf2=_0x24982c?_0x539548[_0xe8d0('0x2f')]:_0x264de4[_0xe8d0('0x2d')]+_0x264de4['limit'];var _0x3cc292;if(_0x11fcf2>=_0x343b08){_0x11fcf2=_0x343b08;_0x3cc292=0xc8;}else{_0x3cc292=0xce;}_0x2dee67['status'](_0x3cc292);return _0x2dee67['set']('Content-Range',_0x1519e2+'-'+_0x11fcf2+'/'+_0x343b08)[_0xe8d0('0x2c')](_0x539548);}return null;};}function patchUpdates(_0x13cd4c){return function(_0x36ccec){try{jsonpatch['apply'](_0x36ccec,_0x13cd4c,!![]);}catch(_0x57e375){return BPromise[_0xe8d0('0x30')](_0x57e375);}return _0x36ccec['save']();};}function saveUpdates(_0x3b5d31,_0x383084){return function(_0x327004){if(_0x327004){return _0x327004[_0xe8d0('0x31')](_0x3b5d31)[_0xe8d0('0x1e')](function(_0x5bbc9e){return _0x5bbc9e;});}return null;};}function removeEntity(_0x1bee61,_0x4db53c){return function(_0x402e90){if(_0x402e90){return _0x402e90[_0xe8d0('0x32')]()['then'](function(){var _0x4547b6=_0x402e90[_0xe8d0('0x33')]({'plain':!![]});var _0x4c1347=_0xe8d0('0x34');return db['UserProfileResource'][_0xe8d0('0x32')]({'where':{'type':_0x4c1347,'resourceId':_0x4547b6['id']}})['then'](function(){return _0x402e90;});})[_0xe8d0('0x1e')](function(){_0x1bee61['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0xb2cdbf,_0x1e2430){return function(_0x320565){if(!_0x320565){_0xb2cdbf['sendStatus'](0x194);}return _0x320565;};}function handleError(_0x36a650,_0x354e19){_0x354e19=_0x354e19||0x1f4;return function(_0x20eec5){logger['error'](_0x20eec5[_0xe8d0('0x35')]);if(_0x20eec5[_0xe8d0('0x36')]){delete _0x20eec5[_0xe8d0('0x36')];}_0x36a650[_0xe8d0('0x2a')](_0x354e19)[_0xe8d0('0x37')](_0x20eec5);};}exports['index']=function(_0x5a969a,_0x1828c5){var _0x10970d={},_0x3d76d5={},_0x318106={'count':0x0,'rows':[]};var _0x23d72e=_[_0xe8d0('0x38')](db[_0xe8d0('0x39')]['rawAttributes'],function(_0x5dff14){return{'name':_0x5dff14[_0xe8d0('0x3a')],'type':_0x5dff14[_0xe8d0('0x3b')][_0xe8d0('0x3c')]};});_0x3d76d5[_0xe8d0('0x3d')]=_[_0xe8d0('0x38')](_0x23d72e,'name');_0x3d76d5[_0xe8d0('0x3e')]=_['keys'](_0x5a969a[_0xe8d0('0x3e')]);_0x3d76d5[_0xe8d0('0x3f')]=_[_0xe8d0('0x40')](_0x3d76d5['model'],_0x3d76d5[_0xe8d0('0x3e')]);_0x10970d[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x3d76d5[_0xe8d0('0x3d')],qs[_0xe8d0('0x42')](_0x5a969a['query']['fields']));_0x10970d['attributes']=_0x10970d['attributes'][_0xe8d0('0x43')]?_0x10970d['attributes']:_0x3d76d5[_0xe8d0('0x3d')];if(!_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x44')](_0xe8d0('0x45'))){_0x10970d[_0xe8d0('0x46')]=qs[_0xe8d0('0x46')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x46')]);_0x10970d['offset']=qs[_0xe8d0('0x2d')](_0x5a969a[_0xe8d0('0x3e')]['offset']);}_0x10970d['order']=qs[_0xe8d0('0x47')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x47')]);_0x10970d['where']=qs[_0xe8d0('0x3f')](_[_0xe8d0('0x48')](_0x5a969a['query'],_0x3d76d5[_0xe8d0('0x3f')]),_0x23d72e);if(_0x5a969a[_0xe8d0('0x3e')]['filter']){_0x10970d[_0xe8d0('0x49')]=_[_0xe8d0('0x4a')](_0x10970d[_0xe8d0('0x49')],{'$or':_[_0xe8d0('0x38')](_0x23d72e,function(_0x1d5815){if(_0x1d5815[_0xe8d0('0x3b')]!==_0xe8d0('0x4b')){var _0x1ce97d={};_0x1ce97d[_0x1d5815['name']]={'$like':'%'+_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x4c')]+'%'};return _0x1ce97d;}})});}_0x10970d=_[_0xe8d0('0x4a')]({},_0x10970d,_0x5a969a[_0xe8d0('0x4d')]);var _0x28d38b={'where':_0x10970d[_0xe8d0('0x49')]};return db[_0xe8d0('0x39')][_0xe8d0('0x2f')](_0x28d38b)[_0xe8d0('0x1e')](function(_0x2e2c05){_0x318106[_0xe8d0('0x2f')]=_0x2e2c05;if(_0x5a969a[_0xe8d0('0x3e')]['includeAll']){_0x10970d[_0xe8d0('0x4e')]=[{'all':!![]}];}return db[_0xe8d0('0x39')][_0xe8d0('0x4f')](_0x10970d);})[_0xe8d0('0x1e')](function(_0x34047c){_0x318106[_0xe8d0('0x50')]=_0x34047c;return _0x318106;})[_0xe8d0('0x1e')](respondWithFilteredResult(_0x1828c5,_0x10970d))['catch'](handleError(_0x1828c5,null));};exports[_0xe8d0('0x51')]=function(_0x424764,_0x151cf4){var _0x205933={'raw':![],'where':{'id':_0x424764[_0xe8d0('0x52')]['id']}},_0x4ed47f={};_0x4ed47f['model']=_[_0xe8d0('0x53')](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x4ed47f[_0xe8d0('0x3e')]=_[_0xe8d0('0x53')](_0x424764[_0xe8d0('0x3e')]);_0x4ed47f[_0xe8d0('0x3f')]=_['intersection'](_0x4ed47f[_0xe8d0('0x3d')],_0x4ed47f['query']);_0x205933['attributes']=_[_0xe8d0('0x40')](_0x4ed47f['model'],qs[_0xe8d0('0x42')](_0x424764['query'][_0xe8d0('0x42')]));_0x205933[_0xe8d0('0x41')]=_0x205933[_0xe8d0('0x41')][_0xe8d0('0x43')]?_0x205933['attributes']:_0x4ed47f[_0xe8d0('0x3d')];if(_0x424764[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x205933[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x205933=_[_0xe8d0('0x4a')]({},_0x205933,_0x424764['options']);return db[_0xe8d0('0x39')][_0xe8d0('0x56')](_0x205933)[_0xe8d0('0x1e')](handleEntityNotFound(_0x151cf4,null))['then'](respondWithResult(_0x151cf4,null))[_0xe8d0('0x28')](handleError(_0x151cf4,null));};exports['clone']=function(_0x56b4fa,_0x1bd329){var _0x37040a={'where':{'id':_0x56b4fa[_0xe8d0('0x52')]['id']}},_0x4e7b49={};_0x4e7b49[_0xe8d0('0x3d')]=_['keys'](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x37040a[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x4e7b49['model'],qs[_0xe8d0('0x42')](_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x42')]));_0x37040a[_0xe8d0('0x41')]=_0x37040a['attributes'][_0xe8d0('0x43')]?_0x37040a[_0xe8d0('0x41')]:_0x4e7b49[_0xe8d0('0x3d')];if(_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x37040a[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x37040a=_['merge']({},_0x37040a,_0x56b4fa['options']);return db[_0xe8d0('0x39')]['find'](_0x37040a)[_0xe8d0('0x1e')](handleEntityNotFound(_0x1bd329,null))[_0xe8d0('0x1e')](function(_0x4c0d4c){if(_0x4c0d4c){var _0x5ac1ae=_0x4c0d4c[_0xe8d0('0x33')]({'plain':!![]});_0x5ac1ae=qs['omit'](_0x5ac1ae,['id',_0xe8d0('0x57'),'updatedAt']);_0x56b4fa[_0xe8d0('0x58')]=_[_0xe8d0('0x59')](_0x56b4fa[_0xe8d0('0x58')],['id','createdAt',_0xe8d0('0x5a')]);return db[_0xe8d0('0x39')]['create'](_[_0xe8d0('0x4a')](_0x5ac1ae,_0x56b4fa['body']),{'include':_0x56b4fa[_0xe8d0('0x3e')]['includeAll']?[{'all':!![]}]:undefined})[_0xe8d0('0x1e')](function(_0x17afc2){var _0x29467d=_0x56b4fa[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x29467d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29467d['role']===_0xe8d0('0x5b')){var _0x55a2df=_0x17afc2[_0xe8d0('0x33')]({'plain':!![]});var _0x18b655=_0xe8d0('0x34');return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':_0x18b655,'userProfileId':_0x29467d[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0x20647d){if(_0x20647d&&_0x20647d[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')][_0xe8d0('0x60')]({'name':_0x55a2df[_0xe8d0('0x36')],'resourceId':_0x55a2df['id'],'type':_0x20647d[_0xe8d0('0x36')],'sectionId':_0x20647d['id']},{})[_0xe8d0('0x1e')](function(){return _0x17afc2;});}else{return _0x17afc2;}})[_0xe8d0('0x28')](function(_0x4a68d5){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x4a68d5);throw _0x4a68d5;});}return _0x17afc2;});}})[_0xe8d0('0x1e')](respondWithResult(_0x1bd329,0xc9))[_0xe8d0('0x28')](handleError(_0x1bd329,null));};exports[_0xe8d0('0x60')]=function(_0x4848d4,_0x2eeb92,_0x1d30c0){var _0x45b42b;return db[_0xe8d0('0x39')][_0xe8d0('0x60')](_0x4848d4[_0xe8d0('0x58')],{'raw':!![]})[_0xe8d0('0x1e')](function(_0x13ceb4){_0x45b42b=_0x13ceb4;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})[_0xe8d0('0x1e')](function(_0xdb3e53){var _0x556d7e=fs['readFileSync'](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x56761c=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x1b5df8=ejs[_0xe8d0('0x68')](_0x556d7e,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x1b5df8);if(_0x45b42b[_0xe8d0('0x6b')]){var _0xb078d8=ejs[_0xe8d0('0x68')](_0x56761c,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0xb078d8);}})[_0xe8d0('0x1e')](function(){return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x60'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x1e')](function(){var _0x500fb0=_0x4848d4[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x500fb0)throw new Error(_0xe8d0('0x6f'));if(_0x500fb0['role']===_0xe8d0('0x5b')){var _0x4c54c4=_0x45b42b[_0xe8d0('0x33')]({'plain':!![]});return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':'Trunks','userProfileId':_0x500fb0[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0xc94cd3){if(_0xc94cd3&&_0xc94cd3[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')]['create']({'name':_0x4c54c4[_0xe8d0('0x36')],'resourceId':_0x4c54c4['id'],'type':_0xc94cd3[_0xe8d0('0x36')],'sectionId':_0xc94cd3['id']},{})[_0xe8d0('0x1e')](function(){return _0x45b42b;});}else{return _0x45b42b;}})[_0xe8d0('0x28')](function(_0x252f0e){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x252f0e);throw _0x252f0e;});}return _0x45b42b;})[_0xe8d0('0x1e')](respondWithResult(_0x2eeb92,0xc9))['catch'](handleError(_0x2eeb92,null));};exports[_0xe8d0('0x31')]=function(_0x31b9d3,_0x14d722,_0x2aa6fc){var _0x4d5997;return db[_0xe8d0('0x39')][_0xe8d0('0x56')]({'where':{'id':_0x31b9d3[_0xe8d0('0x52')]['id']}})['then'](handleEntityNotFound(_0x14d722,null))[_0xe8d0('0x1e')](saveUpdates(_0x31b9d3['body'],null))[_0xe8d0('0x1e')](function(_0x478eb2){if(_0x478eb2){_0x4d5997=_0x478eb2;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});}})[_0xe8d0('0x1e')](function(_0xa90bdc){if(_0xa90bdc){var _0x87aa04=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2eaf2f=fs[_0xe8d0('0x65')](path['join'](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x761e97=ejs[_0xe8d0('0x68')](_0x87aa04,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x761e97);var _0x605b5f=ejs[_0xe8d0('0x68')](_0x2eaf2f,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')]('/etc/asterisk/sip_xcally_registers.conf',_0x605b5f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x31'),{'module':_0xe8d0('0x6e')});}return null;})[_0xe8d0('0x1e')](function(_0x255e4b){if(_0x255e4b){return _0x4d5997;}})['then'](respondWithResult(_0x14d722,null))['catch'](handleError(_0x14d722,null));};exports[_0xe8d0('0x32')]=function(_0x5c8c7d,_0x3fb7c8,_0x16098b){var _0x363b3a;return db['Trunk'][_0xe8d0('0x56')]({'where':{'id':_0x5c8c7d['params']['id']}})[_0xe8d0('0x1e')](handleEntityNotFound(_0x3fb7c8,null))[_0xe8d0('0x1e')](removeEntity(_0x3fb7c8,null))[_0xe8d0('0x1e')](function(){return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})['then'](function(_0x58034d){var _0xfbacce=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2790f=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x142db4=ejs[_0xe8d0('0x68')](_0xfbacce,{'trunks':_0x58034d});var _0x4a568f=ejs['render'](_0x2790f,{'trunks':_0x58034d});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x142db4);fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0x4a568f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x32'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x28')](handleError(_0x3fb7c8,null));};
\ No newline at end of file
index 99f36a4..6b61e7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01ee=['tools_trunks','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','Trunk'];(function(_0x4c2bc5,_0x4984e2){var _0x487209=function(_0x3cabbf){while(--_0x3cabbf){_0x4c2bc5['push'](_0x4c2bc5['shift']());}};_0x487209(++_0x4984e2);}(_0x01ee,0x139));var _0xe01e=function(_0x2b0e6d,_0x305389){_0x2b0e6d=_0x2b0e6d-0x0;var _0x38e162=_0x01ee[_0x2b0e6d];return _0x38e162;};'use strict';var _=require(_0xe01e('0x0'));var util=require(_0xe01e('0x1'));var logger=require(_0xe01e('0x2'))(_0xe01e('0x3'));var moment=require(_0xe01e('0x4'));var BPromise=require('bluebird');var rp=require(_0xe01e('0x5'));var fs=require('fs');var path=require(_0xe01e('0x6'));var rimraf=require(_0xe01e('0x7'));var config=require(_0xe01e('0x8'));var attributes=require('./trunk.attributes');module[_0xe01e('0x9')]=function(_0x5d82cb,_0x47f9da){return _0x5d82cb[_0xe01e('0xa')](_0xe01e('0xb'),attributes,{'tableName':_0xe01e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4b73=['bluebird','path','rimraf','../../config/environment','./trunk.attributes','exports','define','tools_trunks','util','../../config/logger','api','moment'];(function(_0xf2a3ad,_0x573276){var _0x2b54da=function(_0x74a340){while(--_0x74a340){_0xf2a3ad['push'](_0xf2a3ad['shift']());}};_0x2b54da(++_0x573276);}(_0x4b73,0x17c));var _0x34b7=function(_0x4ca796,_0x10dc47){_0x4ca796=_0x4ca796-0x0;var _0x171f87=_0x4b73[_0x4ca796];return _0x171f87;};'use strict';var _=require('lodash');var util=require(_0x34b7('0x0'));var logger=require(_0x34b7('0x1'))(_0x34b7('0x2'));var moment=require(_0x34b7('0x3'));var BPromise=require(_0x34b7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x34b7('0x5'));var rimraf=require(_0x34b7('0x6'));var config=require(_0x34b7('0x7'));var attributes=require(_0x34b7('0x8'));module[_0x34b7('0x9')]=function(_0x31e021,_0x25f526){return _0x31e021[_0x34b7('0xa')]('Trunk',attributes,{'tableName':_0x34b7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c9aa506..b2e00d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb493=['../../config/logger','jayson/promise','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','Trunk,\x20%s,\x20%s','message','result','catch','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowTrunk','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb493,0x145));var _0x3b49=function(_0x39e92c,_0x47d76f){_0x39e92c=_0x39e92c-0x0;var _0x269281=_0xb493[_0x39e92c];return _0x269281;};'use strict';var _=require(_0x3b49('0x0'));var util=require(_0x3b49('0x1'));var moment=require('moment');var BPromise=require(_0x3b49('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b49('0x3'));var db=require(_0x3b49('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3b49('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3b49('0x6'));var client=jayson['client'][_0x3b49('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4a3e57,_0x264b1a,_0x19b965){return new BPromise(function(_0x9f4612,_0x17b9b1){return client[_0x3b49('0x8')](_0x4a3e57,_0x19b965)[_0x3b49('0x9')](function(_0x127cea){logger[_0x3b49('0xa')]('Trunk,\x20%s,\x20%s',_0x264b1a,_0x3b49('0xb'));logger[_0x3b49('0xc')](_0x3b49('0xd'),_0x264b1a,'request\x20sent',JSON[_0x3b49('0xe')](_0x127cea));if(_0x127cea[_0x3b49('0xf')]){if(_0x127cea['error'][_0x3b49('0x10')]===0x1f4){logger['error'](_0x3b49('0x11'),_0x264b1a,_0x127cea['error']['message']);return _0x17b9b1(_0x127cea[_0x3b49('0xf')][_0x3b49('0x12')]);}logger[_0x3b49('0xf')](_0x3b49('0x11'),_0x264b1a,_0x127cea['error'][_0x3b49('0x12')]);return _0x9f4612(_0x127cea[_0x3b49('0xf')]['message']);}else{logger[_0x3b49('0xa')](_0x3b49('0x11'),_0x264b1a,_0x3b49('0xb'));_0x9f4612(_0x127cea[_0x3b49('0x13')][_0x3b49('0x12')]);}})[_0x3b49('0x14')](function(_0x2473dc){logger[_0x3b49('0xf')]('Trunk,\x20%s,\x20%s',_0x264b1a,_0x2473dc);_0x17b9b1(_0x2473dc);});});}exports['GetTrunk']=function(_0x230c0b){var _0x2e0a27=this;return new Promise(function(_0x1fd6a7,_0x1d874d){return db[_0x3b49('0x15')][_0x3b49('0x16')]({'raw':_0x230c0b['options']?_0x230c0b[_0x3b49('0x17')][_0x3b49('0x18')]===undefined?!![]:![]:!![],'where':_0x230c0b[_0x3b49('0x17')]?_0x230c0b[_0x3b49('0x17')][_0x3b49('0x19')]||null:null,'attributes':_0x230c0b['options']?_0x230c0b[_0x3b49('0x17')][_0x3b49('0x1a')]||null:null,'limit':_0x230c0b[_0x3b49('0x17')]?_0x230c0b[_0x3b49('0x17')][_0x3b49('0x1b')]||null:null,'include':_0x230c0b['options']?_0x230c0b[_0x3b49('0x17')][_0x3b49('0x1c')]?_[_0x3b49('0x1d')](_0x230c0b[_0x3b49('0x17')]['include'],function(_0x28662e){return{'model':db[_0x28662e[_0x3b49('0x1e')]],'as':_0x28662e['as'],'attributes':_0x28662e['attributes'],'include':_0x28662e[_0x3b49('0x1c')]?_[_0x3b49('0x1d')](_0x28662e[_0x3b49('0x1c')],function(_0x339315){return{'model':db[_0x339315['model']],'as':_0x339315['as'],'attributes':_0x339315[_0x3b49('0x1a')],'include':_0x339315[_0x3b49('0x1c')]?_[_0x3b49('0x1d')](_0x339315[_0x3b49('0x1c')],function(_0x34828c){return{'model':db[_0x34828c[_0x3b49('0x1e')]],'as':_0x34828c['as'],'attributes':_0x34828c[_0x3b49('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3b49('0x9')](function(_0x245b8f){logger[_0x3b49('0xa')]('GetTrunk',_0x230c0b);logger[_0x3b49('0xc')]('GetTrunk',_0x230c0b,JSON['stringify'](_0x245b8f));_0x1fd6a7(_0x245b8f);})[_0x3b49('0x14')](function(_0x49191f){logger['error']('GetTrunk',_0x49191f[_0x3b49('0x12')],_0x230c0b);_0x1d874d(_0x2e0a27['error'](0x1f4,_0x49191f[_0x3b49('0x12')]));});});};exports['ShowTrunk']=function(_0x5a01ca){var _0x31bd04=this;return new Promise(function(_0x268166,_0x10346b){return db[_0x3b49('0x15')][_0x3b49('0x1f')]({'raw':_0x5a01ca[_0x3b49('0x17')]?_0x5a01ca['options'][_0x3b49('0x18')]===undefined?!![]:![]:!![],'where':_0x5a01ca[_0x3b49('0x17')]?_0x5a01ca[_0x3b49('0x17')][_0x3b49('0x19')]||null:null,'attributes':_0x5a01ca[_0x3b49('0x17')]?_0x5a01ca['options']['attributes']||null:null,'include':_0x5a01ca[_0x3b49('0x17')]?_0x5a01ca['options'][_0x3b49('0x1c')]?_[_0x3b49('0x1d')](_0x5a01ca[_0x3b49('0x17')][_0x3b49('0x1c')],function(_0x2a8e6e){return{'model':db[_0x2a8e6e['model']],'as':_0x2a8e6e['as'],'attributes':_0x2a8e6e[_0x3b49('0x1a')],'include':_0x2a8e6e[_0x3b49('0x1c')]?_[_0x3b49('0x1d')](_0x2a8e6e[_0x3b49('0x1c')],function(_0x367715){return{'model':db[_0x367715['model']],'as':_0x367715['as'],'attributes':_0x367715[_0x3b49('0x1a')],'include':_0x367715[_0x3b49('0x1c')]?_[_0x3b49('0x1d')](_0x367715['include'],function(_0x3e6af7){return{'model':db[_0x3e6af7['model']],'as':_0x3e6af7['as'],'attributes':_0x3e6af7[_0x3b49('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3b49('0x9')](function(_0x3f1e84){logger[_0x3b49('0xa')](_0x3b49('0x20'),_0x5a01ca);logger['debug']('ShowTrunk',_0x5a01ca,JSON['stringify'](_0x3f1e84));_0x268166(_0x3f1e84);})[_0x3b49('0x14')](function(_0x5a18a9){logger[_0x3b49('0xf')](_0x3b49('0x20'),_0x5a18a9[_0x3b49('0x12')],_0x5a01ca);_0x10346b(_0x31bd04['error'](0x1f4,_0x5a18a9[_0x3b49('0x12')]));});});};
\ No newline at end of file
+var _0x8da6=['GetTrunk','stringify','ShowTrunk','raw','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','request\x20sent','debug','error','code','Trunk,\x20%s,\x20%s','message','result','Trunk','findAll','options','where','attributes','limit','include','map','model'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8da6,0x8d));var _0x68da=function(_0x565924,_0x4b6b7c){_0x565924=_0x565924-0x0;var _0x259cad=_0x8da6[_0x565924];return _0x259cad;};'use strict';var _=require(_0x68da('0x0'));var util=require(_0x68da('0x1'));var moment=require(_0x68da('0x2'));var BPromise=require(_0x68da('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x68da('0x4'));var db=require(_0x68da('0x5'))['db'];var utils=require(_0x68da('0x6'));var logger=require(_0x68da('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x68da('0x8'));var client=jayson[_0x68da('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f31ac,_0x58f30f,_0x14d592){return new BPromise(function(_0x1d15f6,_0x459d41){return client[_0x68da('0xa')](_0x1f31ac,_0x14d592)[_0x68da('0xb')](function(_0x47bd4a){logger[_0x68da('0xc')]('Trunk,\x20%s,\x20%s',_0x58f30f,_0x68da('0xd'));logger[_0x68da('0xe')]('Trunk,\x20%s,\x20%s,\x20%s',_0x58f30f,'request\x20sent',JSON['stringify'](_0x47bd4a));if(_0x47bd4a[_0x68da('0xf')]){if(_0x47bd4a[_0x68da('0xf')][_0x68da('0x10')]===0x1f4){logger[_0x68da('0xf')](_0x68da('0x11'),_0x58f30f,_0x47bd4a[_0x68da('0xf')][_0x68da('0x12')]);return _0x459d41(_0x47bd4a[_0x68da('0xf')][_0x68da('0x12')]);}logger[_0x68da('0xf')](_0x68da('0x11'),_0x58f30f,_0x47bd4a['error'][_0x68da('0x12')]);return _0x1d15f6(_0x47bd4a[_0x68da('0xf')][_0x68da('0x12')]);}else{logger[_0x68da('0xc')](_0x68da('0x11'),_0x58f30f,_0x68da('0xd'));_0x1d15f6(_0x47bd4a[_0x68da('0x13')][_0x68da('0x12')]);}})['catch'](function(_0x5d5a30){logger['error']('Trunk,\x20%s,\x20%s',_0x58f30f,_0x5d5a30);_0x459d41(_0x5d5a30);});});}exports['GetTrunk']=function(_0x22a3a6){var _0x2f7b33=this;return new Promise(function(_0x54fa9f,_0x5a2dc7){return db[_0x68da('0x14')][_0x68da('0x15')]({'raw':_0x22a3a6[_0x68da('0x16')]?_0x22a3a6[_0x68da('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x22a3a6[_0x68da('0x16')]?_0x22a3a6[_0x68da('0x16')][_0x68da('0x17')]||null:null,'attributes':_0x22a3a6[_0x68da('0x16')]?_0x22a3a6['options'][_0x68da('0x18')]||null:null,'limit':_0x22a3a6[_0x68da('0x16')]?_0x22a3a6[_0x68da('0x16')][_0x68da('0x19')]||null:null,'include':_0x22a3a6[_0x68da('0x16')]?_0x22a3a6[_0x68da('0x16')][_0x68da('0x1a')]?_[_0x68da('0x1b')](_0x22a3a6[_0x68da('0x16')][_0x68da('0x1a')],function(_0x4c94dc){return{'model':db[_0x4c94dc['model']],'as':_0x4c94dc['as'],'attributes':_0x4c94dc[_0x68da('0x18')],'include':_0x4c94dc[_0x68da('0x1a')]?_[_0x68da('0x1b')](_0x4c94dc['include'],function(_0x62fc4d){return{'model':db[_0x62fc4d[_0x68da('0x1c')]],'as':_0x62fc4d['as'],'attributes':_0x62fc4d[_0x68da('0x18')],'include':_0x62fc4d[_0x68da('0x1a')]?_[_0x68da('0x1b')](_0x62fc4d[_0x68da('0x1a')],function(_0x40844e){return{'model':db[_0x40844e[_0x68da('0x1c')]],'as':_0x40844e['as'],'attributes':_0x40844e[_0x68da('0x18')]};}):[]};}):[]};}):[]:[]})[_0x68da('0xb')](function(_0x4ba334){logger['info'](_0x68da('0x1d'),_0x22a3a6);logger[_0x68da('0xe')](_0x68da('0x1d'),_0x22a3a6,JSON[_0x68da('0x1e')](_0x4ba334));_0x54fa9f(_0x4ba334);})['catch'](function(_0x4b44d4){logger[_0x68da('0xf')](_0x68da('0x1d'),_0x4b44d4[_0x68da('0x12')],_0x22a3a6);_0x5a2dc7(_0x2f7b33['error'](0x1f4,_0x4b44d4['message']));});});};exports[_0x68da('0x1f')]=function(_0x420ce7){var _0x13fb6b=this;return new Promise(function(_0xb8b2b6,_0x50a65){return db[_0x68da('0x14')]['find']({'raw':_0x420ce7['options']?_0x420ce7[_0x68da('0x16')][_0x68da('0x20')]===undefined?!![]:![]:!![],'where':_0x420ce7[_0x68da('0x16')]?_0x420ce7[_0x68da('0x16')][_0x68da('0x17')]||null:null,'attributes':_0x420ce7[_0x68da('0x16')]?_0x420ce7[_0x68da('0x16')]['attributes']||null:null,'include':_0x420ce7['options']?_0x420ce7[_0x68da('0x16')][_0x68da('0x1a')]?_['map'](_0x420ce7['options'][_0x68da('0x1a')],function(_0x2aa309){return{'model':db[_0x2aa309['model']],'as':_0x2aa309['as'],'attributes':_0x2aa309['attributes'],'include':_0x2aa309['include']?_['map'](_0x2aa309[_0x68da('0x1a')],function(_0x2b06b4){return{'model':db[_0x2b06b4[_0x68da('0x1c')]],'as':_0x2b06b4['as'],'attributes':_0x2b06b4[_0x68da('0x18')],'include':_0x2b06b4[_0x68da('0x1a')]?_['map'](_0x2b06b4[_0x68da('0x1a')],function(_0x24f599){return{'model':db[_0x24f599[_0x68da('0x1c')]],'as':_0x24f599['as'],'attributes':_0x24f599[_0x68da('0x18')]};}):[]};}):[]};}):[]:[]})[_0x68da('0xb')](function(_0xf0628d){logger[_0x68da('0xc')](_0x68da('0x1f'),_0x420ce7);logger[_0x68da('0xe')]('ShowTrunk',_0x420ce7,JSON[_0x68da('0x1e')](_0xf0628d));_0xb8b2b6(_0xf0628d);})[_0x68da('0x21')](function(_0x446035){logger[_0x68da('0xf')](_0x68da('0x1f'),_0x446035[_0x68da('0x12')],_0x420ce7);_0x50a65(_0x13fb6b['error'](0x1f4,_0x446035[_0x68da('0x12')]));});});};
\ No newline at end of file
index 46d32fb..9a34404 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb53=['express','./user-setting.controller','put','/:id','update','exports'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0xfb53,0x1aa));var _0x3fb5=function(_0x10afad,_0x30da9d){_0x10afad=_0x10afad-0x0;var _0x588d7e=_0xfb53[_0x10afad];return _0x588d7e;};'use strict';var express=require(_0x3fb5('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x3fb5('0x1'));router[_0x3fb5('0x2')](_0x3fb5('0x3'),auth['isAuthenticated'](),controller[_0x3fb5('0x4')]);module[_0x3fb5('0x5')]=router;
\ No newline at end of file
+var _0x5826=['exports','express','Router','../../components/auth/service','./user-setting.controller','put','isAuthenticated','update'];(function(_0x5b5347,_0x3c9cbd){var _0x2a6698=function(_0x21ca57){while(--_0x21ca57){_0x5b5347['push'](_0x5b5347['shift']());}};_0x2a6698(++_0x3c9cbd);}(_0x5826,0xc9));var _0x6582=function(_0x59252c,_0x1b30fa){_0x59252c=_0x59252c-0x0;var _0x35b914=_0x5826[_0x59252c];return _0x35b914;};'use strict';var express=require(_0x6582('0x0'));var router=express[_0x6582('0x1')]();var auth=require(_0x6582('0x2'));var controller=require(_0x6582('0x3'));router[_0x6582('0x4')]('/:id',auth[_0x6582('0x5')](),controller[_0x6582('0x6')]);module[_0x6582('0x7')]=router;
\ No newline at end of file
index 3e006a6..28272e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb34=['UserId','sequelize','warning','info','debug','exports','ENUM','error','BOOLEAN','TEXT','INTEGER'];(function(_0x3f4649,_0x5cd115){var _0x742f1b=function(_0x5e0b28){while(--_0x5e0b28){_0x3f4649['push'](_0x3f4649['shift']());}};_0x742f1b(++_0x5cd115);}(_0xbb34,0x156));var _0x4bb3=function(_0x16f77c,_0x5256b1){_0x16f77c=_0x16f77c-0x0;var _0x78986e=_0xbb34[_0x16f77c];return _0x78986e;};'use strict';var Sequelize=require(_0x4bb3('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0x4bb3('0x1'),_0x4bb3('0x2'),_0x4bb3('0x3')];module[_0x4bb3('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x4bb3('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x4bb3('0x6'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x4bb3('0x7')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x4bb3('0x8')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x4bb3('0x9')],'unique':_0x4bb3('0xa')}};
\ No newline at end of file
+var _0x11dc=['ENUM','BOOLEAN','TEXT','DATE','INTEGER','UserId','sequelize','error','info','debug','exports'];(function(_0xd511d2,_0x2391c6){var _0x3af4db=function(_0x5f24ba){while(--_0x5f24ba){_0xd511d2['push'](_0xd511d2['shift']());}};_0x3af4db(++_0x2391c6);}(_0x11dc,0xed));var _0xc11d=function(_0xd70344,_0x304eac){_0xd70344=_0xd70344-0x0;var _0x338d4b=_0x11dc[_0xd70344];return _0x338d4b;};'use strict';var Sequelize=require(_0xc11d('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xc11d('0x1'),'warning',_0xc11d('0x2'),_0xc11d('0x3')];module[_0xc11d('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0xc11d('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xc11d('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xc11d('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xc11d('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xc11d('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xc11d('0x9')],'unique':_0xc11d('0xa')}};
\ No newline at end of file
index f6cbb23..781918c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd0c=['Unauthorized','params','Invalid\x20user\x20setting\x20id','body','catch','ioredis','../../config/logger','api','../../mysqldb','redis','./user-setting.socket','register','defaults','localhost','status','then','sendStatus','error','stack','send','role','admin'];(function(_0x576a10,_0x3fed57){var _0x282321=function(_0x3d6ad9){while(--_0x3d6ad9){_0x576a10['push'](_0x576a10['shift']());}};_0x282321(++_0x3fed57);}(_0xdd0c,0x165));var _0xcdd0=function(_0x649305,_0x33a411){_0x649305=_0x649305-0x0;var _0x1aea8b=_0xdd0c[_0x649305];return _0x1aea8b;};'use strict';var _=require('lodash');var Redis=require(_0xcdd0('0x0'));var logger=require(_0xcdd0('0x1'))(_0xcdd0('0x2'));var config=require('../../config/environment');var db=require(_0xcdd0('0x3'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xcdd0('0x4')]));require(_0xcdd0('0x5'))[_0xcdd0('0x6')](socket);config[_0xcdd0('0x4')]=_[_0xcdd0('0x7')](config['redis'],{'host':_0xcdd0('0x8'),'port':0x18eb});function respondWithResult(_0x1b6f5d,_0x1fd3f6){_0x1fd3f6=_0x1fd3f6||0xc8;return function(_0x15c402){if(_0x15c402){return _0x1b6f5d[_0xcdd0('0x9')](_0x1fd3f6)['json'](_0x15c402);}};}function saveUpdates(_0x17e83e){return function(_0x48db66){if(_0x48db66){return _0x48db66['update'](_0x17e83e)[_0xcdd0('0xa')](function(_0x31cf23){return _0x31cf23;});}return null;};}function handleEntityNotFound(_0x3c753e){return function(_0x173745){if(!_0x173745){_0x3c753e[_0xcdd0('0xb')](0x194);}return _0x173745;};}function handleError(_0x460fce,_0x2ab642){_0x2ab642=_0x2ab642||0x1f4;return function(_0x83845b){logger[_0xcdd0('0xc')](_0x83845b[_0xcdd0('0xd')]);if(_0x83845b['name']){delete _0x83845b['name'];}_0x460fce[_0xcdd0('0x9')](_0x2ab642)[_0xcdd0('0xe')](_0x83845b);};}exports['update']=function(_0xe8e8c0,_0x1b28e0){if(_0xe8e8c0['user'][_0xcdd0('0xf')]!==_0xcdd0('0x10'))throw new Error(_0xcdd0('0x11'));if(isNaN(Number(_0xe8e8c0[_0xcdd0('0x12')]['id'])))throw new Error(_0xcdd0('0x13'));return db['UserSetting']['find']({'where':{'id':_0xe8e8c0[_0xcdd0('0x12')]['id']}})[_0xcdd0('0xa')](handleEntityNotFound(_0x1b28e0,null))[_0xcdd0('0xa')](saveUpdates(_0xe8e8c0[_0xcdd0('0x14')],null))[_0xcdd0('0xa')](respondWithResult(_0x1b28e0,null))[_0xcdd0('0x15')](handleError(_0x1b28e0,null));};
\ No newline at end of file
+var _0xb7c8=['Unauthorized','Invalid\x20user\x20setting\x20id','UserSetting','params','body','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','register','defaults','localhost','status','json','then','name','send','update','role','admin'];(function(_0x16648b,_0x15796c){var _0xda60c9=function(_0x42fb3e){while(--_0x42fb3e){_0x16648b['push'](_0x16648b['shift']());}};_0xda60c9(++_0x15796c);}(_0xb7c8,0x119));var _0x8b7c=function(_0xcb25e1,_0x2ba87e){_0xcb25e1=_0xcb25e1-0x0;var _0x20969b=_0xb7c8[_0xcb25e1];return _0x20969b;};'use strict';var _=require('lodash');var Redis=require(_0x8b7c('0x0'));var logger=require(_0x8b7c('0x1'))(_0x8b7c('0x2'));var config=require(_0x8b7c('0x3'));var db=require(_0x8b7c('0x4'))['db'];var socket=require(_0x8b7c('0x5'))(new Redis(config[_0x8b7c('0x6')]));require('./user-setting.socket')[_0x8b7c('0x7')](socket);config[_0x8b7c('0x6')]=_[_0x8b7c('0x8')](config[_0x8b7c('0x6')],{'host':_0x8b7c('0x9'),'port':0x18eb});function respondWithResult(_0x12665c,_0x7a3850){_0x7a3850=_0x7a3850||0xc8;return function(_0x3c8fd6){if(_0x3c8fd6){return _0x12665c[_0x8b7c('0xa')](_0x7a3850)[_0x8b7c('0xb')](_0x3c8fd6);}};}function saveUpdates(_0x187046){return function(_0x46104a){if(_0x46104a){return _0x46104a['update'](_0x187046)[_0x8b7c('0xc')](function(_0x5986c1){return _0x5986c1;});}return null;};}function handleEntityNotFound(_0x224a0b){return function(_0x414df8){if(!_0x414df8){_0x224a0b['sendStatus'](0x194);}return _0x414df8;};}function handleError(_0x189a25,_0x452e83){_0x452e83=_0x452e83||0x1f4;return function(_0x3594b1){logger['error'](_0x3594b1['stack']);if(_0x3594b1[_0x8b7c('0xd')]){delete _0x3594b1[_0x8b7c('0xd')];}_0x189a25[_0x8b7c('0xa')](_0x452e83)[_0x8b7c('0xe')](_0x3594b1);};}exports[_0x8b7c('0xf')]=function(_0x247e3a,_0x33b135){if(_0x247e3a['user'][_0x8b7c('0x10')]!==_0x8b7c('0x11'))throw new Error(_0x8b7c('0x12'));if(isNaN(Number(_0x247e3a['params']['id'])))throw new Error(_0x8b7c('0x13'));return db[_0x8b7c('0x14')]['find']({'where':{'id':_0x247e3a[_0x8b7c('0x15')]['id']}})[_0x8b7c('0xc')](handleEntityNotFound(_0x33b135,null))[_0x8b7c('0xc')](saveUpdates(_0x247e3a[_0x8b7c('0x16')],null))[_0x8b7c('0xc')](respondWithResult(_0x33b135,null))['catch'](handleError(_0x33b135,null));};
\ No newline at end of file
index be00d71..f49f9f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9afc=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x2cc491,_0x5f4a79){var _0x57db95=function(_0x761ca1){while(--_0x761ca1){_0x2cc491['push'](_0x2cc491['shift']());}};_0x57db95(++_0x5f4a79);}(_0x9afc,0xc2));var _0xc9af=function(_0x2ac87c,_0x1b07b4){_0x2ac87c=_0x2ac87c-0x0;var _0x41a0b5=_0x9afc[_0x2ac87c];return _0x41a0b5;};'use strict';var EventEmitter=require(_0xc9af('0x0'));var UserSetting=require(_0xc9af('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xc9af('0x2')](0x0);var events={'afterCreate':_0xc9af('0x3'),'afterUpdate':_0xc9af('0x4'),'afterDestroy':_0xc9af('0x5')};function emitEvent(_0x30e202){return function(_0x1b3119,_0x151cda,_0x37aee8){UserSettingEvents[_0xc9af('0x6')](_0x30e202+':'+_0x1b3119['id'],_0x1b3119);UserSettingEvents['emit'](_0x30e202,_0x1b3119);_0x37aee8(null);};}for(var e in events){if(events[_0xc9af('0x7')](e)){var event=events[e];UserSetting[_0xc9af('0x8')](e,emitEvent(event));}}module['exports']=UserSettingEvents;
\ No newline at end of file
+var _0xc27c=['UserSetting','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x4e1977,_0x5a90f5){var _0x7b4add=function(_0xdd5659){while(--_0xdd5659){_0x4e1977['push'](_0x4e1977['shift']());}};_0x7b4add(++_0x5a90f5);}(_0xc27c,0x1db));var _0xcc27=function(_0x55da93,_0x4fdabd){_0x55da93=_0x55da93-0x0;var _0x2f4fb2=_0xc27c[_0x55da93];return _0x2f4fb2;};'use strict';var EventEmitter=require(_0xcc27('0x0'));var UserSetting=require(_0xcc27('0x1'))['db'][_0xcc27('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcc27('0x3'),'afterUpdate':_0xcc27('0x4'),'afterDestroy':_0xcc27('0x5')};function emitEvent(_0xdf7e60){return function(_0x481eea,_0x348b50,_0x18d1f8){UserSettingEvents['emit'](_0xdf7e60+':'+_0x481eea['id'],_0x481eea);UserSettingEvents[_0xcc27('0x6')](_0xdf7e60,_0x481eea);_0x18d1f8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0xcc27('0x7')](e,emitEvent(event));}}module[_0xcc27('0x8')]=UserSettingEvents;
\ No newline at end of file
index 71ef14b..00b93c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x263f=['clientSideLoggingEnabledSince','./user-setting.attributes','exports','define','UserSetting','user_settings','clientSideLoggingEnabled'];(function(_0x389ec0,_0x38bfcb){var _0x22fef3=function(_0x2c73c0){while(--_0x2c73c0){_0x389ec0['push'](_0x389ec0['shift']());}};_0x22fef3(++_0x38bfcb);}(_0x263f,0x182));var _0xf263=function(_0x38fdb6,_0xf3861){_0x38fdb6=_0x38fdb6-0x0;var _0x307c22=_0x263f[_0x38fdb6];return _0x307c22;};'use strict';var attributes=require(_0xf263('0x0'));module[_0xf263('0x1')]=function(_0x1c3e9e){return _0x1c3e9e[_0xf263('0x2')](_0xf263('0x3'),attributes,{'tableName':_0xf263('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x59c41f){if(!_0x59c41f[_0xf263('0x5')])_0x59c41f[_0xf263('0x6')]=null;else if(_0x59c41f[_0xf263('0x6')]===null)_0x59c41f['clientSideLoggingEnabledSince']=new Date();}}});};
\ No newline at end of file
+var _0xfd6f=['exports','define','UserSetting','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x515393,_0x2272fd){var _0x3acd4f=function(_0x4ba551){while(--_0x4ba551){_0x515393['push'](_0x515393['shift']());}};_0x3acd4f(++_0x2272fd);}(_0xfd6f,0x19d));var _0xffd6=function(_0x3f1ea9,_0x21117c){_0x3f1ea9=_0x3f1ea9-0x0;var _0x14eaab=_0xfd6f[_0x3f1ea9];return _0x14eaab;};'use strict';var attributes=require(_0xffd6('0x0'));module[_0xffd6('0x1')]=function(_0x29b163){return _0x29b163[_0xffd6('0x2')](_0xffd6('0x3'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xb84411){if(!_0xb84411[_0xffd6('0x4')])_0xb84411[_0xffd6('0x5')]=null;else if(_0xb84411[_0xffd6('0x5')]===null)_0xb84411['clientSideLoggingEnabledSince']=new Date();}}});};
\ No newline at end of file
index d365dc4..cf1fe05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe99=['save','remove','update','user-setting:update','emit','UserId','register','user-setting:','./user-setting.events'];(function(_0x5332b1,_0x192941){var _0x129b49=function(_0x469fd0){while(--_0x469fd0){_0x5332b1['push'](_0x5332b1['shift']());}};_0x129b49(++_0x192941);}(_0xfe99,0xbc));var _0x9fe9=function(_0x2f27af,_0x3f686f){_0x2f27af=_0x2f27af-0x0;var _0x29e318=_0xfe99[_0x2f27af];return _0x29e318;};'use strict';var UserSettingEvents=require(_0x9fe9('0x0'));var events=[_0x9fe9('0x1'),_0x9fe9('0x2'),_0x9fe9('0x3')];function createListener(_0x10869f,_0x568e6b){return function(_0x428752){_0x568e6b['emit'](_0x10869f,_0x428752);if(_0x10869f===_0x9fe9('0x4')){_0x568e6b[_0x9fe9('0x5')]('user-setting:update:user-'+_0x428752[_0x9fe9('0x6')],_0x428752);}};}exports[_0x9fe9('0x7')]=function(_0x5c3d4c){for(var _0x2b602f=0x0,_0x492f9a=events['length'];_0x2b602f<_0x492f9a;_0x2b602f++){var _0x2344e0=events[_0x2b602f];var _0x7bc61b=createListener(_0x9fe9('0x8')+_0x2344e0,_0x5c3d4c);UserSettingEvents['on'](_0x2344e0,_0x7bc61b);}};
\ No newline at end of file
+var _0xedfe=['user-setting:','./user-setting.events','save','update','emit','user-setting:update:user-','UserId','register'];(function(_0x2eaaff,_0x2fb59a){var _0x2953b8=function(_0x4944c4){while(--_0x4944c4){_0x2eaaff['push'](_0x2eaaff['shift']());}};_0x2953b8(++_0x2fb59a);}(_0xedfe,0x1a9));var _0xeedf=function(_0x1fad09,_0x513851){_0x1fad09=_0x1fad09-0x0;var _0xc8663d=_0xedfe[_0x1fad09];return _0xc8663d;};'use strict';var UserSettingEvents=require(_0xeedf('0x0'));var events=[_0xeedf('0x1'),'remove',_0xeedf('0x2')];function createListener(_0x1e59a3,_0x539151){return function(_0x505141){_0x539151[_0xeedf('0x3')](_0x1e59a3,_0x505141);if(_0x1e59a3==='user-setting:update'){_0x539151['emit'](_0xeedf('0x4')+_0x505141[_0xeedf('0x5')],_0x505141);}};}exports[_0xeedf('0x6')]=function(_0x979202){for(var _0x5abd00=0x0,_0x28af17=events['length'];_0x5abd00<_0x28af17;_0x5abd00++){var _0x380175=events[_0x5abd00];var _0x35fe2e=createListener(_0xeedf('0x7')+_0x380175,_0x979202);UserSettingEvents['on'](_0x380175,_0x35fe2e);}};
\ No newline at end of file
index bab7bd3..026afbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6215=['/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getWhatsappAccounts','/:id/scheduled_calls','/:id/api_key','getApiKey','post','addContacts','create','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','file','addAvatar','login','/:id/logout','logout','/:id/pause','pause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','update','put','/:id/password','changePassword','removeQueues','removeTeams','delete','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','/:id/prefixes'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0x6215,0x198));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5621('0x0'));var util=require(_0x5621('0x1'));var path=require(_0x5621('0x2'));var timeout=require('connect-timeout');var express=require(_0x5621('0x3'));var router=express[_0x5621('0x4')]();var fs_extra=require(_0x5621('0x5'));var auth=require(_0x5621('0x6'));var interaction=require(_0x5621('0x7'));var config=require(_0x5621('0x8'));var controller=require('./user.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5621('0x9')](_0x5621('0xa'),auth[_0x5621('0xb')](),controller[_0x5621('0xc')]);router[_0x5621('0x9')]('/whoami',auth[_0x5621('0xb')](),controller[_0x5621('0xd')]);router[_0x5621('0x9')](_0x5621('0xe'),auth['isAuthenticated'](),controller[_0x5621('0xf')]);router[_0x5621('0x9')](_0x5621('0x10'),auth['isAuthenticated'](),controller[_0x5621('0x11')]);router[_0x5621('0x9')](_0x5621('0x12'),controller[_0x5621('0x13')]);router[_0x5621('0x9')](_0x5621('0x14'),auth[_0x5621('0xb')](),controller[_0x5621('0x15')]);router[_0x5621('0x9')](_0x5621('0x16'),auth['isAuthenticated'](),controller[_0x5621('0x17')]);router[_0x5621('0x9')](_0x5621('0x18'),auth['isAuthenticated'](),controller[_0x5621('0x19')]);router[_0x5621('0x9')]('/:id/queues_rt',auth[_0x5621('0xb')](),controller[_0x5621('0x1a')]);router[_0x5621('0x9')](_0x5621('0x1b'),auth[_0x5621('0xb')](),controller[_0x5621('0x1c')]);router[_0x5621('0x9')](_0x5621('0x1d'),auth[_0x5621('0xb')](),controller[_0x5621('0x1e')]);router['get'](_0x5621('0x1f'),auth[_0x5621('0xb')](),controller['getScreenRecordings']);router[_0x5621('0x9')]('/:id/chat/interactions',auth[_0x5621('0xb')](),controller[_0x5621('0x20')]);router[_0x5621('0x9')](_0x5621('0x21'),auth[_0x5621('0xb')](),controller['getOpenchannelInteractions']);router[_0x5621('0x9')](_0x5621('0x22'),auth[_0x5621('0xb')](),controller[_0x5621('0x23')]);router['get'](_0x5621('0x24'),auth[_0x5621('0xb')](),controller[_0x5621('0x25')]);router[_0x5621('0x9')](_0x5621('0x26'),auth[_0x5621('0xb')](),controller[_0x5621('0x27')]);router['get'](_0x5621('0x28'),auth['isAuthenticated'](),controller[_0x5621('0x29')]);router[_0x5621('0x9')](_0x5621('0x2a'),auth[_0x5621('0xb')](),controller[_0x5621('0x2b')]);router[_0x5621('0x9')](_0x5621('0x2c'),auth['isAuthenticated'](),controller[_0x5621('0x2d')]);router[_0x5621('0x9')](_0x5621('0x2e'),auth[_0x5621('0xb')](),controller['getAgents']);router[_0x5621('0x9')](_0x5621('0x2f'),auth['isAuthenticated'](),controller['getVoicePrefixes']);router[_0x5621('0x9')](_0x5621('0x30'),auth[_0x5621('0xb')](),controller[_0x5621('0x31')]);router[_0x5621('0x9')](_0x5621('0x32'),auth[_0x5621('0xb')](),controller['getMailAccounts']);router[_0x5621('0x9')](_0x5621('0x33'),auth[_0x5621('0xb')](),controller[_0x5621('0x34')]);router[_0x5621('0x9')]('/:id/sms_accounts',auth[_0x5621('0xb')](),controller[_0x5621('0x35')]);router[_0x5621('0x9')](_0x5621('0x36'),auth[_0x5621('0xb')](),controller['getChatWebsites']);router[_0x5621('0x9')]('/:id/whatsapp_accounts',auth[_0x5621('0xb')](),controller[_0x5621('0x37')]);router[_0x5621('0x9')](_0x5621('0x38'),auth[_0x5621('0xb')](),controller['getScheduledCalls']);router[_0x5621('0x9')](_0x5621('0x39'),auth[_0x5621('0xb')](),controller[_0x5621('0x3a')]);router[_0x5621('0x3b')]('/:id/contacts',auth[_0x5621('0xb')](),controller[_0x5621('0x3c')]);router[_0x5621('0x3b')]('/',auth['isAuthenticated'](),controller[_0x5621('0x3d')]);router[_0x5621('0x3b')]('/create_many',auth[_0x5621('0xb')](),controller[_0x5621('0x3e')]);router[_0x5621('0x3b')](_0x5621('0x18'),auth[_0x5621('0xb')](),controller[_0x5621('0x3f')]);var upload=multer({'storage':multer[_0x5621('0x40')]({'destination':function(_0x53c9ff,_0x1e1f65,_0x3c849d){_0x3c849d(null,path[_0x5621('0x41')](config[_0x5621('0x42')],_0x5621('0x43')));},'filename':function(_0x8120e,_0x49cff4,_0x19738f){_0x19738f(null,util[_0x5621('0x44')](_0x5621('0x45'),Date['now'](),_0x49cff4['originalname']));}})});router[_0x5621('0x3b')]('/:id/avatar',upload['single'](_0x5621('0x46')),controller[_0x5621('0x47')]);router[_0x5621('0x3b')]('/:id/login',auth[_0x5621('0xb')](),controller[_0x5621('0x48')]);router['post'](_0x5621('0x49'),auth[_0x5621('0xb')](),controller[_0x5621('0x4a')]);router[_0x5621('0x3b')](_0x5621('0x4b'),auth[_0x5621('0xb')](),controller[_0x5621('0x4c')]);router[_0x5621('0x3b')]('/:id/unpause',auth[_0x5621('0xb')](),controller['unpause']);router[_0x5621('0x3b')](_0x5621('0x2a'),auth[_0x5621('0xb')](),controller['addTeams']);router[_0x5621('0x3b')](_0x5621('0x4d'),auth[_0x5621('0xb')](),controller[_0x5621('0x4e')]);router[_0x5621('0x3b')](_0x5621('0x4f'),auth[_0x5621('0xb')](),controller['addMailInteractions']);router[_0x5621('0x3b')](_0x5621('0x50'),auth[_0x5621('0xb')](),controller[_0x5621('0x51')]);router[_0x5621('0x3b')](_0x5621('0x52'),auth['isAuthenticated'](),controller[_0x5621('0x53')]);router['post'](_0x5621('0x54'),auth['isAuthenticated'](),controller[_0x5621('0x55')]);router[_0x5621('0x3b')](_0x5621('0x56'),auth[_0x5621('0xb')](),controller[_0x5621('0x57')]);router[_0x5621('0x3b')](_0x5621('0x30'),auth['isAuthenticated'](),controller[_0x5621('0x58')]);router[_0x5621('0x3b')](_0x5621('0x32'),auth['isAuthenticated'](),controller[_0x5621('0x59')]);router[_0x5621('0x3b')](_0x5621('0x33'),auth[_0x5621('0xb')](),controller[_0x5621('0x5a')]);router[_0x5621('0x3b')](_0x5621('0x5b'),auth[_0x5621('0xb')](),controller[_0x5621('0x5c')]);router[_0x5621('0x3b')](_0x5621('0x36'),auth['isAuthenticated'](),controller[_0x5621('0x5d')]);router[_0x5621('0x3b')]('/:id/whatsapp_accounts',auth[_0x5621('0xb')](),controller[_0x5621('0x5e')]);router['post']('/:id/api_key',auth[_0x5621('0xb')](),controller[_0x5621('0x5f')]);router['put']('/:id',auth[_0x5621('0xb')](),controller[_0x5621('0x60')]);router[_0x5621('0x61')](_0x5621('0x62'),auth[_0x5621('0xb')](),controller[_0x5621('0x63')]);router['delete'](_0x5621('0x18'),auth['isAuthenticated'](),controller[_0x5621('0x64')]);router['delete']('/:id/teams',auth[_0x5621('0xb')](),controller[_0x5621('0x65')]);router[_0x5621('0x66')]('/:id',auth[_0x5621('0xb')](),controller['destroy']);router[_0x5621('0x66')](_0x5621('0x4d'),auth[_0x5621('0xb')](),controller[_0x5621('0x67')]);router[_0x5621('0x66')](_0x5621('0x4f'),auth['isAuthenticated'](),controller[_0x5621('0x68')]);router[_0x5621('0x66')](_0x5621('0x50'),auth[_0x5621('0xb')](),controller[_0x5621('0x69')]);router[_0x5621('0x66')](_0x5621('0x52'),auth[_0x5621('0xb')](),controller[_0x5621('0x6a')]);router['delete'](_0x5621('0x54'),auth[_0x5621('0xb')](),controller[_0x5621('0x6b')]);router[_0x5621('0x66')](_0x5621('0x56'),auth['isAuthenticated'](),controller['removeWhatsappInteractions']);router[_0x5621('0x66')](_0x5621('0x30'),auth['isAuthenticated'](),controller[_0x5621('0x6c')]);router[_0x5621('0x66')](_0x5621('0x32'),auth['isAuthenticated'](),controller[_0x5621('0x6d')]);router[_0x5621('0x66')](_0x5621('0x33'),auth[_0x5621('0xb')](),controller[_0x5621('0x6e')]);router['delete'](_0x5621('0x5b'),auth[_0x5621('0xb')](),controller[_0x5621('0x6f')]);router['delete'](_0x5621('0x36'),auth[_0x5621('0xb')](),controller[_0x5621('0x70')]);router[_0x5621('0x66')]('/:id/whatsapp_accounts',auth[_0x5621('0xb')](),controller[_0x5621('0x71')]);router[_0x5621('0x66')](_0x5621('0x39'),auth[_0x5621('0xb')](),controller['removeApiKey']);module['exports']=router;
\ No newline at end of file
+var _0xde5d=['describe','/whoami','getPresence','show','/:id/avatar','/:id/open_tabs','getOpenTabs','getContacts','getQueues','/:id/groups','getGroups','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','getAgents','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','/:id/contacts','addContacts','create','/create_many','bulkCreate','/:id/queues','diskStorage','join','root','server/files/images/','%s-%s','now','originalname','single','file','addAvatar','login','/:id/logout','logout','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','/:id/api_key','createApiKey','put','changePassword','removeQueues','delete','removeTeams','/:id','destroy','removeChatInteractions','removeMailInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','get','isAuthenticated','index','/describe'];(function(_0x5d9188,_0x22310d){var _0x27fb56=function(_0x3e736d){while(--_0x3e736d){_0x5d9188['push'](_0x5d9188['shift']());}};_0x27fb56(++_0x22310d);}(_0xde5d,0xd7));var _0xdde5=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xde5d[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0xdde5('0x0'));var util=require('util');var path=require(_0xdde5('0x1'));var timeout=require(_0xdde5('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xdde5('0x3'));var auth=require(_0xdde5('0x4'));var interaction=require(_0xdde5('0x5'));var config=require('../../config/environment');var controller=require(_0xdde5('0x6'));router[_0xdde5('0x7')]('/',auth[_0xdde5('0x8')](),controller[_0xdde5('0x9')]);router['get'](_0xdde5('0xa'),auth['isAuthenticated'](),controller[_0xdde5('0xb')]);router['get'](_0xdde5('0xc'),auth[_0xdde5('0x8')](),controller['whoami']);router[_0xdde5('0x7')]('/presence',auth[_0xdde5('0x8')](),controller[_0xdde5('0xd')]);router[_0xdde5('0x7')]('/:id',auth[_0xdde5('0x8')](),controller[_0xdde5('0xe')]);router[_0xdde5('0x7')](_0xdde5('0xf'),controller['getAvatar']);router['get'](_0xdde5('0x10'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x11')]);router['get']('/:id/contacts',auth[_0xdde5('0x8')](),controller[_0xdde5('0x12')]);router['get']('/:id/queues',auth[_0xdde5('0x8')](),controller[_0xdde5('0x13')]);router[_0xdde5('0x7')]('/:id/queues_rt',auth[_0xdde5('0x8')](),controller['getVoiceQueuesRt']);router[_0xdde5('0x7')](_0xdde5('0x14'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x15')]);router[_0xdde5('0x7')]('/:id/recordings',auth[_0xdde5('0x8')](),controller['getRecordings']);router[_0xdde5('0x7')](_0xdde5('0x16'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x17')]);router['get'](_0xdde5('0x18'),auth[_0xdde5('0x8')](),controller['getChatInteractions']);router[_0xdde5('0x7')](_0xdde5('0x19'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x1a')]);router[_0xdde5('0x7')](_0xdde5('0x1b'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x1c')]);router[_0xdde5('0x7')](_0xdde5('0x1d'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x1e')]);router[_0xdde5('0x7')](_0xdde5('0x1f'),auth['isAuthenticated'](),controller[_0xdde5('0x20')]);router[_0xdde5('0x7')](_0xdde5('0x21'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x22')]);router[_0xdde5('0x7')](_0xdde5('0x23'),auth['isAuthenticated'](),controller[_0xdde5('0x24')]);router[_0xdde5('0x7')](_0xdde5('0x25'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x26')]);router[_0xdde5('0x7')]('/:id/agents',auth['isAuthenticated'](),controller[_0xdde5('0x27')]);router['get']('/:id/prefixes',auth[_0xdde5('0x8')](),controller['getVoicePrefixes']);router[_0xdde5('0x7')](_0xdde5('0x28'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x29')]);router['get'](_0xdde5('0x2a'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x2b')]);router[_0xdde5('0x7')](_0xdde5('0x2c'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x2d')]);router['get']('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0xdde5('0x2e')]);router['get']('/:id/chat_websites',auth[_0xdde5('0x8')](),controller['getChatWebsites']);router[_0xdde5('0x7')](_0xdde5('0x2f'),auth['isAuthenticated'](),controller[_0xdde5('0x30')]);router[_0xdde5('0x7')](_0xdde5('0x31'),auth['isAuthenticated'](),controller[_0xdde5('0x32')]);router[_0xdde5('0x7')]('/:id/api_key',auth['isAuthenticated'](),controller[_0xdde5('0x33')]);router[_0xdde5('0x34')](_0xdde5('0x35'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x36')]);router['post']('/',auth[_0xdde5('0x8')](),controller[_0xdde5('0x37')]);router[_0xdde5('0x34')](_0xdde5('0x38'),auth['isAuthenticated'](),controller[_0xdde5('0x39')]);router['post'](_0xdde5('0x3a'),auth[_0xdde5('0x8')](),controller['addQueues']);var upload=multer({'storage':multer[_0xdde5('0x3b')]({'destination':function(_0x1bb21e,_0x7b10ac,_0x26b423){_0x26b423(null,path[_0xdde5('0x3c')](config[_0xdde5('0x3d')],_0xdde5('0x3e')));},'filename':function(_0x34317f,_0x303489,_0x1f3a94){_0x1f3a94(null,util['format'](_0xdde5('0x3f'),Date[_0xdde5('0x40')](),_0x303489[_0xdde5('0x41')]));}})});router[_0xdde5('0x34')](_0xdde5('0xf'),upload[_0xdde5('0x42')](_0xdde5('0x43')),controller[_0xdde5('0x44')]);router[_0xdde5('0x34')]('/:id/login',auth[_0xdde5('0x8')](),controller[_0xdde5('0x45')]);router[_0xdde5('0x34')](_0xdde5('0x46'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x47')]);router[_0xdde5('0x34')]('/:id/pause',auth[_0xdde5('0x8')](),controller['pause']);router['post'](_0xdde5('0x48'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x49')]);router[_0xdde5('0x34')](_0xdde5('0x23'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x4a')]);router['post'](_0xdde5('0x4b'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x4c')]);router[_0xdde5('0x34')](_0xdde5('0x4d'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x4e')]);router['post'](_0xdde5('0x4f'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x50')]);router[_0xdde5('0x34')](_0xdde5('0x51'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x52')]);router[_0xdde5('0x34')](_0xdde5('0x53'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x54')]);router[_0xdde5('0x34')](_0xdde5('0x55'),auth['isAuthenticated'](),controller['addWhatsappInteractions']);router[_0xdde5('0x34')]('/:id/fax_accounts',auth[_0xdde5('0x8')](),controller['addFaxAccounts']);router['post'](_0xdde5('0x2a'),auth[_0xdde5('0x8')](),controller['addMailAccounts']);router[_0xdde5('0x34')](_0xdde5('0x2c'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x56')]);router[_0xdde5('0x34')](_0xdde5('0x57'),auth['isAuthenticated'](),controller[_0xdde5('0x58')]);router['post'](_0xdde5('0x59'),auth['isAuthenticated'](),controller[_0xdde5('0x5a')]);router[_0xdde5('0x34')](_0xdde5('0x2f'),auth['isAuthenticated'](),controller['addWhatsappAccounts']);router['post'](_0xdde5('0x5b'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x5c')]);router[_0xdde5('0x5d')]('/:id',auth[_0xdde5('0x8')](),controller['update']);router[_0xdde5('0x5d')]('/:id/password',auth['isAuthenticated'](),controller[_0xdde5('0x5e')]);router['delete']('/:id/queues',auth[_0xdde5('0x8')](),controller[_0xdde5('0x5f')]);router[_0xdde5('0x60')](_0xdde5('0x23'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x61')]);router[_0xdde5('0x60')](_0xdde5('0x62'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x63')]);router[_0xdde5('0x60')]('/:id/chat_interactions',auth[_0xdde5('0x8')](),controller[_0xdde5('0x64')]);router[_0xdde5('0x60')]('/:id/mail_interactions',auth[_0xdde5('0x8')](),controller[_0xdde5('0x65')]);router['delete'](_0xdde5('0x4f'),auth[_0xdde5('0x8')](),controller['removeFaxInteractions']);router['delete']('/:id/sms_interactions',auth[_0xdde5('0x8')](),controller[_0xdde5('0x66')]);router[_0xdde5('0x60')](_0xdde5('0x53'),auth['isAuthenticated'](),controller[_0xdde5('0x67')]);router[_0xdde5('0x60')](_0xdde5('0x55'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x68')]);router[_0xdde5('0x60')](_0xdde5('0x28'),auth['isAuthenticated'](),controller[_0xdde5('0x69')]);router[_0xdde5('0x60')](_0xdde5('0x2a'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x6a')]);router['delete'](_0xdde5('0x2c'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x6b')]);router[_0xdde5('0x60')](_0xdde5('0x57'),auth['isAuthenticated'](),controller[_0xdde5('0x6c')]);router[_0xdde5('0x60')](_0xdde5('0x59'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x6d')]);router['delete'](_0xdde5('0x2f'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x6e')]);router[_0xdde5('0x60')](_0xdde5('0x5b'),auth[_0xdde5('0x8')](),controller[_0xdde5('0x6f')]);module[_0xdde5('0x70')]=router;
\ No newline at end of file
index 8b5b01a..728a1cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x414c93,_0x44ffbe){var _0x4b593c=function(_0x1d37cf){while(--_0x1d37cf){_0x414c93['push'](_0x414c93['shift']());}};_0x4b593c(++_0x44ffbe);}(_0x70e0,0x17b));var _0x070e=function(_0x13ce13,_0x46e81b){_0x13ce13=_0x13ce13-0x0;var _0x104301=_0x70e0[_0x13ce13];return _0x104301;};'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
+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(_0x425dc3,_0x527097){var _0xd48ce0=function(_0x34ba6e){while(--_0x34ba6e){_0x425dc3['push'](_0x425dc3['shift']());}};_0xd48ce0(++_0x527097);}(_0x70e0,0x17b));var _0x070e=function(_0xf3668b,_0x17bf5d){_0xf3668b=_0xf3668b-0x0;var _0x1007d2=_0x70e0[_0xf3668b];return _0x1007d2;};'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 79594cc..15a57d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcaa0=['SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','format','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:forcelogout','headers','x-forwarded-for','remoteAddress','connection','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','PAUSE','LOGININPAUSE','isMiddleware','resolve','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','getTeams','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','flattenDeep','addAgent','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','QueueId','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','getAssociatedQueues','removeAgent','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','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','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','CmHopper','$and','$gt','$gte','$lt','$lte','$ne','$not','$between','$notBetween','$in','$notIn','$notLike','$notILike','$overlap','$contains','$contained','lastName','Contact','dialActive','getApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','nonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','flatten','col','asc','desc','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','unknown','unavailable','ringing','voiceStatus','busy','toUpperCase','slice','select','InteractionId','field','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','moment','path','squel','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','handleError','../../mysqldb','./user.socket','register','redis','defaults','localhost','client','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','update','emit','destroy','get','role','admin','Users','user','Agents','agent','Telephones','filter','ignore','map','includes','find','value','stack','name','send','index','User','rawAttributes','fieldName','type','password','salt','getOptions','where','query','includeAll','include','userSetting','true','UserSetting','attributes','push','findAll','rows','openTabs','length','chat','dataValues','sms','mail','whatsapp','all','show','model','differenceBy','filters','intersection','fields','merge','options','openchannel','fax','body','params','describe','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','isNil','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','103','113','110','104','105','106','107','108','109','100','111','114','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','autoAssociation','UserProfileResource','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','telephone','isEmpty','compact','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','oldPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','updatePasswordsHistory','channel','online','loginInPause','voicePause','interface','isValidChannel','add','toLowerCase','Queues','spread','capitalize','Queue:save','voice','VoiceQueue','penalty','UserVoiceQueueRt','upsert','Unknown\x20channel','remove','isArray','Queue:remove','userpic','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','concat','getContacts','keys','CmContact','order','sort','pick','CmList','List','Tag','Tags','color','tag','hasOwnProperty','nolimit','getQueues','Queue','getVoiceQueuesRt','ChatGroup','getGroups','getRecordings','VoiceRecording','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','UserId','MailInteraction','getSmsInteractions'];(function(_0x3ab3ee,_0x5e28cb){var _0x345b27=function(_0x5df12a){while(--_0x5df12a){_0x3ab3ee['push'](_0x3ab3ee['shift']());}};_0x345b27(++_0x5e28cb);}(_0xcaa0,0xa8));var _0x0caa=function(_0x24853d,_0x16931f){_0x24853d=_0x24853d-0x0;var _0x4c5cff=_0xcaa0[_0x24853d];return _0x4c5cff;};'use strict';var moment=require(_0x0caa('0x0'));var util=require('util');var path=require(_0x0caa('0x1'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0caa('0x2'));var jayson=require('jayson/promise');var Redis=require(_0x0caa('0x3'));var authService=require(_0x0caa('0x4'));var qs=require(_0x0caa('0x5'));var logger=require('../../config/logger')(_0x0caa('0x6'));var utils=require('../../config/utils');var config=require(_0x0caa('0x7'));var licenseUtil=require(_0x0caa('0x8'));var APIBadRequestError=require(_0x0caa('0x9'))[_0x0caa('0xa')];var APINotFoundError=require(_0x0caa('0x9'))['APINotFoundError'];var APIHandleError=require(_0x0caa('0x9'))[_0x0caa('0xb')];var db=require(_0x0caa('0xc'))['db'];var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0caa('0xd'))[_0x0caa('0xe')](socket);config[_0x0caa('0xf')]=_[_0x0caa('0x10')](config[_0x0caa('0xf')],{'host':_0x0caa('0x11'),'port':0x18eb});var amiClient=jayson[_0x0caa('0x12')][_0x0caa('0x13')]({'port':0x232a});var values;function respondWithRpcPromise(_0x29ce4f,_0x185b5e,_0x3ef3a3,_0x31034){return new Promise(function(_0x3a2b05,_0x3efc2f){var _0xa0b17d=_0x31034||amiClient;return _0xa0b17d[_0x0caa('0x14')](_0x29ce4f,_0x3ef3a3)[_0x0caa('0x15')](function(_0x16a2ac){logger[_0x0caa('0x16')](_0x0caa('0x17'),_0x185b5e,_0x0caa('0x18'));logger[_0x0caa('0x19')](_0x0caa('0x1a'),_0x185b5e,_0x0caa('0x18'),JSON[_0x0caa('0x1b')](_0x16a2ac));if(_0x16a2ac[_0x0caa('0x1c')]){if(_0x16a2ac[_0x0caa('0x1c')]['code']===0x1f4){logger[_0x0caa('0x1c')](_0x0caa('0x17'),_0x185b5e,_0x16a2ac[_0x0caa('0x1c')][_0x0caa('0x1d')]);return _0x3efc2f(_0x16a2ac[_0x0caa('0x1c')][_0x0caa('0x1d')]);}logger[_0x0caa('0x1c')]('User,\x20%s,\x20%s',_0x185b5e,_0x16a2ac[_0x0caa('0x1c')]['message']);return _0x3a2b05(_0x16a2ac[_0x0caa('0x1c')][_0x0caa('0x1d')]);}else{logger[_0x0caa('0x16')](_0x0caa('0x17'),_0x185b5e,_0x0caa('0x18'));_0x3a2b05(_0x16a2ac[_0x0caa('0x1e')]['message']);}})[_0x0caa('0x1f')](function(_0x395b87){logger[_0x0caa('0x1c')](_0x0caa('0x17'),_0x185b5e,_0x395b87);_0x3efc2f(_0x395b87);});});}function respondWithStatusCode(_0x4d587b,_0x572fe3){_0x572fe3=_0x572fe3||0xcc;return function(_0x4d18a0){if(_0x4d18a0){return _0x4d587b[_0x0caa('0x20')](_0x572fe3);}return _0x4d587b[_0x0caa('0x21')](_0x572fe3)['end']();};}function respondWithResult(_0x4836d9,_0x1fc4eb){_0x1fc4eb=_0x1fc4eb||0xc8;return function(_0x3e84c4){if(_0x3e84c4){return _0x4836d9[_0x0caa('0x21')](_0x1fc4eb)[_0x0caa('0x22')](_0x3e84c4);}};}function respondWithFilteredResult(_0x302f8e,_0x13ca97){return function(_0x7fe67a){if(_0x7fe67a){var _0x4b58f4=typeof _0x13ca97[_0x0caa('0x23')]===_0x0caa('0x24')&&typeof _0x13ca97[_0x0caa('0x25')]===_0x0caa('0x24');var _0x13c45a=_0x7fe67a[_0x0caa('0x26')];var _0x3f2001=_0x4b58f4?0x0:_0x13ca97[_0x0caa('0x23')];var _0x184e09=_0x4b58f4?_0x7fe67a[_0x0caa('0x26')]:_0x13ca97[_0x0caa('0x23')]+_0x13ca97[_0x0caa('0x25')];var _0x1c6a3f;if(_0x184e09>=_0x13c45a){_0x184e09=_0x13c45a;_0x1c6a3f=0xc8;}else{_0x1c6a3f=0xce;}_0x302f8e['status'](_0x1c6a3f);return _0x302f8e['set'](_0x0caa('0x27'),_0x3f2001+'-'+_0x184e09+'/'+_0x13c45a)[_0x0caa('0x22')](_0x7fe67a);}return null;};}function saveUpdates(_0x5b6ac1){return function(_0x2d992c){if(_0x2d992c){return _0x2d992c[_0x0caa('0x28')](_0x5b6ac1)['then'](function(_0x37edcc){socket[_0x0caa('0x29')]('userNotification:recalc:'+_0x37edcc['id'],{});return _0x37edcc;});}return null;};}function removeEntity(_0x2083bb){return function(_0x501f58){if(_0x501f58){return _0x501f58[_0x0caa('0x2a')]()['then'](function(){var _0x4cff85=_0x501f58[_0x0caa('0x2b')]({'plain':!![]});if(_0x4cff85[_0x0caa('0x2c')]===_0x0caa('0x2d'))return;var _0x352e17=[{'name':_0x0caa('0x2e'),'value':_0x0caa('0x2f'),'ignore':!![]},{'name':_0x0caa('0x30'),'value':_0x0caa('0x31'),'ignore':![]},{'name':_0x0caa('0x32'),'value':'telephone','ignore':![]}];var _0x519905=_(_0x352e17)[_0x0caa('0x33')](_0x0caa('0x34'))[_0x0caa('0x35')]('value')['value']();if(_[_0x0caa('0x36')](_0x519905,_0x4cff85[_0x0caa('0x2c')])){return;}var _0x2cfb18=_[_0x0caa('0x37')](_0x352e17,[_0x0caa('0x38'),_0x4cff85['role']])['name'];return db['UserProfileResource'][_0x0caa('0x2a')]({'where':{'type':_0x2cfb18,'resourceId':_0x4cff85['id']}})[_0x0caa('0x15')](function(){return _0x501f58;});})[_0x0caa('0x15')](function(){_0x2083bb[_0x0caa('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3414aa){return function(_0x2c93c0){if(!_0x2c93c0){_0x3414aa[_0x0caa('0x20')](0x194);}return _0x2c93c0;};}function handleError(_0x565702,_0x33dc10){_0x33dc10=_0x33dc10||0x1f4;return function(_0x1f7ffe){logger['error'](_0x1f7ffe[_0x0caa('0x39')]);if(_0x1f7ffe['name']){delete _0x1f7ffe[_0x0caa('0x3a')];}_0x565702[_0x0caa('0x21')](_0x33dc10)[_0x0caa('0x3b')](_0x1f7ffe);};}exports[_0x0caa('0x3c')]=function(_0x409f26,_0x2ce509){var _0x5efe1c={},_0x4e5d77={'count':0x0,'rows':[]};var _0x43faee=_(db[_0x0caa('0x3d')][_0x0caa('0x3e')])[_0x0caa('0x35')](function(_0x2d0711){return{'name':_0x2d0711[_0x0caa('0x3f')],'type':_0x2d0711[_0x0caa('0x40')]['key']};})[_0x0caa('0x33')](function(_0xcfb3a7){return!_[_0x0caa('0x36')]([_0x0caa('0x41'),_0x0caa('0x42')],_0xcfb3a7[_0x0caa('0x3a')]);})['value']();_0x5efe1c=qs[_0x0caa('0x43')](_0x43faee,_0x409f26);var _0x35596f={'where':_0x5efe1c[_0x0caa('0x44')]};return db[_0x0caa('0x3d')]['count'](_0x35596f)['then'](function(_0x2d7e48){_0x4e5d77['count']=_0x2d7e48;if(_0x409f26[_0x0caa('0x45')][_0x0caa('0x46')]){_0x5efe1c[_0x0caa('0x47')]=[{'all':!![]}];}if(_0x409f26[_0x0caa('0x45')][_0x0caa('0x48')]===_0x0caa('0x49')){_0x5efe1c[_0x0caa('0x47')]=[{'model':db[_0x0caa('0x4a')],'as':_0x0caa('0x48')}];}if(!_[_0x0caa('0x36')](_0x5efe1c[_0x0caa('0x4b')],'id')){_0x5efe1c[_0x0caa('0x4b')][_0x0caa('0x4c')]('id');}return db[_0x0caa('0x3d')][_0x0caa('0x4d')](_0x5efe1c);})[_0x0caa('0x15')](function(_0x54cc3e){_0x4e5d77[_0x0caa('0x4e')]=_0x54cc3e;if(_0x409f26[_0x0caa('0x45')][_0x0caa('0x4f')]===_0x0caa('0x49')){var _0x4d2813=[];for(var _0x33bbbb=0x0;_0x33bbbb<_0x4e5d77[_0x0caa('0x4e')][_0x0caa('0x50')];_0x33bbbb++){_0x4d2813['push'](get_open_tabs(_0x0caa('0x51'),_0x4e5d77[_0x0caa('0x4e')][_0x33bbbb][_0x0caa('0x52')]));_0x4d2813[_0x0caa('0x4c')](get_open_tabs(_0x0caa('0x53'),_0x4e5d77[_0x0caa('0x4e')][_0x33bbbb][_0x0caa('0x52')]));_0x4d2813[_0x0caa('0x4c')](get_open_tabs('fax',_0x4e5d77[_0x0caa('0x4e')][_0x33bbbb][_0x0caa('0x52')]));_0x4d2813['push'](get_open_tabs(_0x0caa('0x54'),_0x4e5d77[_0x0caa('0x4e')][_0x33bbbb][_0x0caa('0x52')]));_0x4d2813['push'](get_open_tabs('openchannel',_0x4e5d77[_0x0caa('0x4e')][_0x33bbbb][_0x0caa('0x52')]));_0x4d2813['push'](get_open_tabs(_0x0caa('0x55'),_0x4e5d77['rows'][_0x33bbbb][_0x0caa('0x52')]));}return Promise[_0x0caa('0x56')](_0x4d2813)[_0x0caa('0x15')](function(){return _0x4e5d77;});}else{return _0x4e5d77;}})[_0x0caa('0x15')](respondWithFilteredResult(_0x2ce509,_0x5efe1c))[_0x0caa('0x1f')](handleError(_0x2ce509,null));};exports[_0x0caa('0x57')]=function(_0x19d534,_0x3b829f){var _0x4091a0={'raw':![],'where':{'id':_0x19d534['params']['id']}},_0xcbfaf9={};_0xcbfaf9[_0x0caa('0x58')]=_[_0x0caa('0x59')](_['keys'](db[_0x0caa('0x3d')]['rawAttributes']),[_0x0caa('0x41'),_0x0caa('0x42')]);_0xcbfaf9[_0x0caa('0x45')]=_['keys'](_0x19d534['query']);_0xcbfaf9[_0x0caa('0x5a')]=_[_0x0caa('0x5b')](_0xcbfaf9[_0x0caa('0x58')],_0xcbfaf9[_0x0caa('0x45')]);_0x4091a0[_0x0caa('0x4b')]=_[_0x0caa('0x5b')](_0xcbfaf9[_0x0caa('0x58')],qs['fields'](_0x19d534[_0x0caa('0x45')][_0x0caa('0x5c')]));_0x4091a0[_0x0caa('0x4b')]=_0x4091a0[_0x0caa('0x4b')][_0x0caa('0x50')]?_0x4091a0[_0x0caa('0x4b')]:_0xcbfaf9[_0x0caa('0x58')];if(_0x19d534[_0x0caa('0x45')][_0x0caa('0x46')]){_0x4091a0[_0x0caa('0x47')]=[{'all':!![]}];}if(_0x19d534['query'][_0x0caa('0x48')]===_0x0caa('0x49')){_0x4091a0[_0x0caa('0x47')]=[{'model':db[_0x0caa('0x4a')],'as':_0x0caa('0x48')}];}_0x4091a0=_[_0x0caa('0x5d')]({},_0x4091a0,_0x19d534[_0x0caa('0x5e')]);if(!_[_0x0caa('0x36')](_0x4091a0[_0x0caa('0x4b')],'id')){_0x4091a0[_0x0caa('0x4b')][_0x0caa('0x4c')]('id');}return db[_0x0caa('0x3d')][_0x0caa('0x37')](_0x4091a0)[_0x0caa('0x15')](handleEntityNotFound(_0x3b829f,null))[_0x0caa('0x15')](function(_0x277429){var _0x1dbb6d=[];values=_0x277429;if(_0x19d534[_0x0caa('0x45')][_0x0caa('0x4f')]===_0x0caa('0x49')){_0x1dbb6d['push'](get_open_tabs(_0x0caa('0x51'),_0x277429[_0x0caa('0x52')]));_0x1dbb6d[_0x0caa('0x4c')](get_open_tabs('sms',_0x277429['dataValues']));_0x1dbb6d['push'](get_open_tabs(_0x0caa('0x5f'),_0x277429[_0x0caa('0x52')]));_0x1dbb6d[_0x0caa('0x4c')](get_open_tabs('whatsapp',_0x277429['dataValues']));_0x1dbb6d[_0x0caa('0x4c')](get_open_tabs(_0x0caa('0x60'),_0x277429[_0x0caa('0x52')]));_0x1dbb6d[_0x0caa('0x4c')](get_open_tabs(_0x0caa('0x54'),_0x277429[_0x0caa('0x52')]));return Promise['all'](_0x1dbb6d);}else{return values;}})[_0x0caa('0x15')](function(){return values;})[_0x0caa('0x15')](respondWithResult(_0x3b829f,null))[_0x0caa('0x1f')](handleError(_0x3b829f,null));};exports[_0x0caa('0x28')]=function(_0x570cd6,_0x7df4d1){if(_0x570cd6[_0x0caa('0x61')]['id']){delete _0x570cd6[_0x0caa('0x61')]['id'];}delete _0x570cd6['body']['role'];return db[_0x0caa('0x3d')]['find']({'where':{'id':_0x570cd6[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x7df4d1,null))[_0x0caa('0x15')](saveUpdates(_0x570cd6[_0x0caa('0x61')],null))[_0x0caa('0x15')](respondWithResult(_0x7df4d1,null))[_0x0caa('0x1f')](handleError(_0x7df4d1,null));};exports[_0x0caa('0x63')]=function(_0x19981f,_0x3505ed){return db[_0x0caa('0x3d')][_0x0caa('0x63')]()[_0x0caa('0x15')](respondWithResult(_0x3505ed,null))[_0x0caa('0x1f')](handleError(_0x3505ed,null));};exports['addContacts']=function(_0x4be3c8,_0x33715a){return db[_0x0caa('0x3d')][_0x0caa('0x37')]({'where':{'id':_0x4be3c8['params']['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x33715a,null))[_0x0caa('0x15')](function(_0x1cef5a){if(_0x1cef5a){return _0x1cef5a[_0x0caa('0x64')](_0x4be3c8['body'][_0x0caa('0x65')],_[_0x0caa('0x66')](_0x4be3c8[_0x0caa('0x61')],[_0x0caa('0x65'),'id'])||{});}})['then'](respondWithResult(_0x33715a,null))[_0x0caa('0x1f')](handleError(_0x33715a,null));};function validateUser(_0x127c89){return new Promise(function(_0x25a4c7,_0x55ffe5){if(_0x127c89[_0x0caa('0x67')])return _0x25a4c7(_0x127c89);return db['Setting'][_0x0caa('0x68')](0x1)['then'](function(_0x17fe99){if(_0x17fe99[_0x0caa('0x69')])authService[_0x0caa('0x6a')](_0x127c89[_0x0caa('0x41')]);db['User'][_0x0caa('0x6b')](_0x0caa('0x67'))[_0x0caa('0x15')](function(_0x5d8d4c){if(_['isNil'](_0x5d8d4c)){_0x127c89[_0x0caa('0x67')]=_0x17fe99[_0x0caa('0x6c')]||0x1;return;}if(_['isNil'](_0x17fe99[_0x0caa('0x6c')])||_0x17fe99[_0x0caa('0x6c')]===_0x5d8d4c){_0x127c89[_0x0caa('0x67')]=_0x5d8d4c+0x1;return;}if(_0x17fe99[_0x0caa('0x6c')]>_0x5d8d4c){_0x127c89['internal']=_0x17fe99['min_internal'];return;}return db[_0x0caa('0x6d')]['query'](_0x0caa('0x6e'),{'type':db[_0x0caa('0x6d')][_0x0caa('0x6f')][_0x0caa('0x70')]})[_0x0caa('0x15')](function(_0x2b1f81){if(_0x2b1f81&&_0x2b1f81[_0x0caa('0x50')]){for(var _0x330901=0x0,_0x4116e2=_0x2b1f81[_0x0caa('0x50')];_0x330901<_0x4116e2&&_[_0x0caa('0x71')](_0x127c89['internal']);_0x330901++){if(_0x17fe99['min_internal']<=_0x2b1f81[_0x330901]['from']){_0x127c89[_0x0caa('0x67')]=_0x2b1f81[_0x330901][_0x0caa('0x72')];}else if(_0x17fe99[_0x0caa('0x6c')]>_0x2b1f81[_0x330901][_0x0caa('0x72')]&&_0x17fe99[_0x0caa('0x6c')]<=_0x2b1f81[_0x330901]['to']){_0x127c89[_0x0caa('0x67')]=_0x17fe99[_0x0caa('0x6c')];}}}if(_[_0x0caa('0x71')](_0x127c89[_0x0caa('0x67')])){_0x127c89[_0x0caa('0x67')]=_0x5d8d4c+0x1;}return _0x25a4c7(_0x127c89);});});})[_0x0caa('0x1f')](function(_0x267263){_0x55ffe5(_0x267263);});});}function updateUser(_0x3f1e63){return new Promise(function(_0x1c44b7,_0x3dfcd8){try{if(_0x3f1e63[_0x0caa('0x73')]){_0x3f1e63[_0x0caa('0x74')]=_0x3f1e63[_0x0caa('0x67')];_0x3f1e63[_0x0caa('0x75')]={'mailbox':_0x3f1e63[_0x0caa('0x67')],'password':_0x3f1e63[_0x0caa('0x41')],'fullname':_0x3f1e63[_0x0caa('0x76')],'email':_0x3f1e63[_0x0caa('0x77')]};}if(_0x3f1e63[_0x0caa('0x2c')]===_0x0caa('0x31')){if(!_0x3f1e63[_0x0caa('0x78')])_0x3f1e63[_0x0caa('0x78')]=[_0x0caa('0x79'),'102',_0x0caa('0x7a'),_0x0caa('0x7b'),_0x0caa('0x7c'),_0x0caa('0x7d'),_0x0caa('0x7e'),_0x0caa('0x7f'),_0x0caa('0x80'),_0x0caa('0x81'),_0x0caa('0x82'),_0x0caa('0x83'),_0x0caa('0x84'),_0x0caa('0x85'),'115'];}_0x1c44b7(_0x3f1e63);}catch(_0x2ffdc0){_0x3dfcd8(_0x2ffdc0);}});}exports[_0x0caa('0x86')]=function(_0x2e0a70,_0x4b430e){if(_0x2e0a70[_0x0caa('0x2f')]['role']==='agent')throw new Error(_0x0caa('0x87'));if(_0x2e0a70[_0x0caa('0x61')]['role']==='user'&&_0x2e0a70[_0x0caa('0x2f')]['role']!==_0x0caa('0x2d')){throw new Error(_0x0caa('0x88'));}if(_0x2e0a70[_0x0caa('0x61')][_0x0caa('0x2c')]===_0x0caa('0x2d')&&_0x2e0a70['user']['role']!==_0x0caa('0x2d')){throw new Error(_0x0caa('0x89'));}return licenseUtil[_0x0caa('0x8a')]([_0x2e0a70[_0x0caa('0x61')]])[_0x0caa('0x15')](function(){return validateUser(_0x2e0a70['body']);})[_0x0caa('0x15')](function(_0x39287b){return updateUser(_0x39287b)['then'](function(_0x258639){if(_0x258639[_0x0caa('0x2c')]===_0x0caa('0x2d')){_0x258639[_0x0caa('0x8b')]=_0x2e0a70[_0x0caa('0x2f')][_0x0caa('0x8b')];delete _0x258639[_0x0caa('0x8c')];}return _0x258639;});})[_0x0caa('0x15')](function(_0x20ba73){return db[_0x0caa('0x3d')][_0x0caa('0x86')](_0x20ba73,{'include':[{'model':db[_0x0caa('0x75')],'as':_0x0caa('0x75')}]});})[_0x0caa('0x15')](function(_0x19ea50){if(_0x2e0a70['body'][_0x0caa('0x2c')]===_0x0caa('0x2f'))return _0x19ea50;if(_0x2e0a70['user'][_0x0caa('0x2c')]!==_0x0caa('0x2f'))return _0x19ea50;return db[_0x0caa('0x8d')][_0x0caa('0x37')]({'where':{'name':_0x19ea50['role']===_0x0caa('0x31')?_0x0caa('0x30'):_0x0caa('0x32'),'userProfileId':_0x2e0a70[_0x0caa('0x2f')][_0x0caa('0x8c')]},'raw':!![]})[_0x0caa('0x15')](function(_0x349884){if(!_0x349884||_0x349884[_0x0caa('0x8e')]!=0x0)return _0x19ea50;return db[_0x0caa('0x8f')][_0x0caa('0x86')]({'name':_0x19ea50[_0x0caa('0x3a')],'resourceId':_0x19ea50['id'],'type':_0x349884[_0x0caa('0x3a')],'sectionId':_0x349884['id']},{})[_0x0caa('0x15')](function(){return _0x19ea50;});})[_0x0caa('0x1f')](function(_0x2c6ca1){logger[_0x0caa('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c6ca1);throw _0x2c6ca1;});})[_0x0caa('0x15')](respondWithResult(_0x4b430e,0xc9))[_0x0caa('0x1f')](handleError(_0x4b430e,null));};exports[_0x0caa('0x90')]=function(_0x571467,_0x533142){var _0x4b5577=_0x571467[_0x0caa('0x61')];var _0x208ecd=[];if(_0x571467['user'][_0x0caa('0x2c')]===_0x0caa('0x31'))throw new Error(_0x0caa('0x87'));if(_[_0x0caa('0x91')](_0x4b5577,[_0x0caa('0x2c'),_0x0caa('0x2f')])&&_0x571467[_0x0caa('0x2f')]['role']!==_0x0caa('0x2d')){throw new Error(_0x0caa('0x88'));}if(_['some'](_0x4b5577,[_0x0caa('0x2c'),'admin'])&&_0x571467['user'][_0x0caa('0x2c')]!==_0x0caa('0x2d')){throw new Error(_0x0caa('0x92'));}return licenseUtil[_0x0caa('0x8a')](_0x4b5577)[_0x0caa('0x15')](function(){return validateUser(_0x4b5577[0x0]);})[_0x0caa('0x15')](function(){for(var _0x201b94=0x1;_0x201b94<_0x4b5577[_0x0caa('0x50')];_0x201b94++){var _0x42bdbc=_0x4b5577[_0x201b94-0x1]['internal'];if(!_0x4b5577[_0x201b94]['internal'])_0x4b5577[_0x201b94]['internal']=_0x42bdbc+0x1;_0x208ecd[_0x0caa('0x4c')](validateUser(_0x4b5577[_0x201b94]));}return Promise[_0x0caa('0x56')](_0x208ecd);})[_0x0caa('0x15')](function(){_0x208ecd=[];for(var _0x4f3ff1=0x0;_0x4f3ff1<_0x4b5577[_0x0caa('0x50')];_0x4f3ff1++){_0x208ecd[_0x0caa('0x4c')](updateUser(_0x4b5577[_0x4f3ff1]));}return Promise[_0x0caa('0x56')](_0x208ecd);})[_0x0caa('0x15')](function(){_0x208ecd=_0x4b5577[_0x0caa('0x35')](function(_0x5b88a3){return db['User'][_0x0caa('0x86')](_0x5b88a3,{'include':[{'model':db[_0x0caa('0x75')],'as':'VoiceMail'}]})[_0x0caa('0x15')](function(_0x4e5d51){_0x5b88a3['id']=_0x4e5d51['id'];return _0x5b88a3;});});return Promise[_0x0caa('0x56')](_0x208ecd);})[_0x0caa('0x15')](function(_0x15dad2){if(_0x571467[_0x0caa('0x61')][_0x0caa('0x2c')]==='user')return _0x15dad2;if(_0x571467[_0x0caa('0x2f')][_0x0caa('0x2c')]!==_0x0caa('0x2f'))return _0x15dad2;var _0x51f607=_[_0x0caa('0x91')](_0x15dad2,function(_0x528fd4){return _0x528fd4[_0x0caa('0x2c')]==='agent'||_0x528fd4['role']===_0x0caa('0x93');});if(!_0x51f607)return _0x15dad2;return db[_0x0caa('0x8d')]['findAll']({'where':{'name':{'$or':[_0x0caa('0x30'),_0x0caa('0x32')]},'userProfileId':_0x571467['user'][_0x0caa('0x8c')]},'raw':!![]})['then'](function(_0x3bf9ec){if(_[_0x0caa('0x94')](_0x3bf9ec)||!_[_0x0caa('0x91')](_0x3bf9ec,[_0x0caa('0x8e'),0x0]))return _0x15dad2;_0x208ecd=[];var _0x468496=_(_0x3bf9ec)['map'](function(_0xa9f686){if(_0xa9f686[_0x0caa('0x8e')]===0x1)return;return _0xa9f686['name']==='Agents'?'agent':_0x0caa('0x93');})[_0x0caa('0x95')]()[_0x0caa('0x38')]();for(var _0x52b712=0x0;_0x52b712<_0x15dad2['length'];_0x52b712++){if(!_[_0x0caa('0x36')](_0x468496,_0x15dad2[_0x52b712][_0x0caa('0x2c')]))return;var _0x141eec=_0x15dad2[_0x52b712][_0x0caa('0x2c')]==='agent'?_0x0caa('0x30'):'Telephones';_0x208ecd[_0x0caa('0x4c')](db[_0x0caa('0x8f')]['create']({'name':_0x15dad2[_0x52b712][_0x0caa('0x3a')],'resourceId':_0x15dad2[_0x52b712]['id'],'type':_0x141eec,'sectionId':_['find'](_0x3bf9ec,[_0x0caa('0x3a'),_0x141eec])['id']},{}));}return Promise[_0x0caa('0x56')](_0x208ecd);});})[_0x0caa('0x15')](respondWithResult(_0x533142,0xc9))[_0x0caa('0x1f')](handleError(_0x533142,null));};exports['changePassword']=function(_0x1c220d,_0x3a1b74){if(_0x1c220d[_0x0caa('0x61')]['id']){delete _0x1c220d[_0x0caa('0x61')]['id'];}return db[_0x0caa('0x3d')][_0x0caa('0x37')]({'where':{'id':_0x1c220d[_0x0caa('0x62')]['id']}})['then'](function(_0x8f0a35){if(!_0x8f0a35)return null;if(_0x8f0a35['id']===_0x1c220d[_0x0caa('0x2f')]['id']){if(!_0x1c220d['body']['oldPassword']||!_0x1c220d[_0x0caa('0x61')][_0x0caa('0x96')]){throw new db[(_0x0caa('0x97'))][(_0x0caa('0x98'))](_0x0caa('0x99'));}if(!_0x8f0a35[_0x0caa('0x9a')](_0x1c220d[_0x0caa('0x61')][_0x0caa('0x9b')])){throw new db[(_0x0caa('0x97'))][(_0x0caa('0x98'))](_0x0caa('0x9c'));}if(_0x1c220d[_0x0caa('0x61')][_0x0caa('0x9b')]===_0x1c220d[_0x0caa('0x61')]['newPassword']){throw new db[(_0x0caa('0x97'))]['ValidationError'](_0x0caa('0x9d'));}}else if(_0x1c220d['user'][_0x0caa('0x2c')]==='admin'){if(!_0x1c220d['body'][_0x0caa('0x96')]){throw new db[(_0x0caa('0x97'))]['ValidationError'](_0x0caa('0x9e'));}}else if(_0x1c220d[_0x0caa('0x2f')][_0x0caa('0x2c')]===_0x0caa('0x2f')){if(!_0x1c220d[_0x0caa('0x61')][_0x0caa('0x96')]){throw new db[(_0x0caa('0x97'))][(_0x0caa('0x98'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x8f0a35['role']!==_0x0caa('0x31')){throw new db[(_0x0caa('0x97'))][(_0x0caa('0x98'))](_0x0caa('0x87'));}}else{throw new db[(_0x0caa('0x97'))]['ValidationError']('Unauthorized');}return _0x8f0a35;})['then'](handleEntityNotFound(_0x3a1b74,null))['then'](function(_0x61362){return db['Setting'][_0x0caa('0x9f')]({'attributes':['id','securePassword',_0x0caa('0xa0'),_0x0caa('0xa1')]})[_0x0caa('0x15')](function(_0xea1c08){if(_0xea1c08[_0x0caa('0x69')])authService[_0x0caa('0x6a')](_0x1c220d['body'][_0x0caa('0x96')]);if(!_0xea1c08['enforcePasswordHistory']||!_0x61362[_0x0caa('0xa2')])return _0x61362;authService[_0x0caa('0xa3')](_0x1c220d[_0x0caa('0x61')][_0x0caa('0x96')],_0x61362['previousPasswords'],_0xea1c08[_0x0caa('0xa1')]);return _0x61362;})[_0x0caa('0x15')](saveUpdates({'password':_0x1c220d[_0x0caa('0x61')][_0x0caa('0x96')],'passwordResetAt':_0x1c220d['user']['id']==_0x1c220d[_0x0caa('0x62')]['id']?moment():null,'previousPasswords':authService[_0x0caa('0xa4')](_0x1c220d[_0x0caa('0x61')][_0x0caa('0x96')],_0x61362['previousPasswords'])},null));})[_0x0caa('0x15')](respondWithResult(_0x3a1b74,null))[_0x0caa('0x1f')](handleError(_0x3a1b74,null));};exports['addQueues']=function(_0x184f17,_0x4aa168){var _0x3211e0=_0x184f17[_0x0caa('0x61')][_0x0caa('0xa5')];return db[_0x0caa('0x3d')]['find']({'where':{'id':_0x184f17[_0x0caa('0x62')]['id']},'attributes':['id',_0x0caa('0x3a'),_0x0caa('0x2c'),_0x0caa('0xa6'),_0x0caa('0xa7'),_0x0caa('0xa8'),_0x0caa('0xa9')]})[_0x0caa('0x15')](handleEntityNotFound(_0x4aa168,null))[_0x0caa('0x15')](function(_0x5e138f){if(_0x5e138f){if(!utils[_0x0caa('0xaa')](_0x3211e0)){throw new db[(_0x0caa('0x97'))][(_0x0caa('0x98'))]('Unknown\x20channel');}return _0x5e138f[_0x0caa('0xab')+_['capitalize'](_0x3211e0[_0x0caa('0xac')]())+_0x0caa('0xad')](_0x184f17[_0x0caa('0x61')]['ids'],{'penalty':_0x184f17[_0x0caa('0x61')]['penalty']||0x0})[_0x0caa('0xae')](function(_0x217288){for(var _0x334728=0x0;_0x334728<_0x184f17[_0x0caa('0x61')]['ids'][_0x0caa('0x50')];_0x334728+=0x1){var _0xa18cf={'UserId':Number(_0x184f17[_0x0caa('0x62')]['id'])};_0xa18cf[_[_0x0caa('0xaf')](_0x3211e0[_0x0caa('0xac')]())+'QueueId']=Number(_0x184f17['body'][_0x0caa('0x65')][_0x334728]);socket[_0x0caa('0x29')](_0x0caa('0x2f')+_[_0x0caa('0xaf')](_0x3211e0[_0x0caa('0xac')]())+_0x0caa('0xb0'),_0xa18cf);}return _0x217288;})[_0x0caa('0x15')](function(){if(_0x3211e0===_0x0caa('0xb1')){return db[_0x0caa('0xb2')][_0x0caa('0x4d')]({'where':{'id':_0x184f17[_0x0caa('0x61')][_0x0caa('0x65')]||[]},'raw':!![],'attributes':['id','name']});}})['then'](function(_0x505143){var _0x1eae93=_0x5e138f[_0x0caa('0x2b')]({'plain':!![]});var _0x4f00fc=[];if(_0x3211e0==='voice'&&_0x1eae93['role']===_0x0caa('0x31')&&_0x1eae93['online']){for(let _0x362b9e=0x0;_0x362b9e<_0x505143[_0x0caa('0x50')];_0x362b9e+=0x1){_0x4f00fc[_0x0caa('0x4c')]({'membername':_0x1eae93[_0x0caa('0x3a')],'UserId':_0x1eae93['id'],'queue_name':_0x505143[_0x362b9e][_0x0caa('0x3a')],'VoiceQueueId':_0x505143[_0x362b9e]['id'],'interface':_[_0x0caa('0x71')](_0x1eae93[_0x0caa('0xa9')])?util['format']('SIP/%s',_0x1eae93[_0x0caa('0x3a')]):_0x1eae93[_0x0caa('0xa9')],'paused':_0x1eae93[_0x0caa('0xa8')]||![],'penalty':_0x184f17[_0x0caa('0x61')][_0x0caa('0xb3')]||0x0});}return Promise[_0x0caa('0x56')](_0x4f00fc[_0x0caa('0x35')](function(_0x3b2a0e){return db[_0x0caa('0xb4')][_0x0caa('0xb5')](_0x3b2a0e);}));}return _0x5e138f;});}})[_0x0caa('0x15')](respondWithStatusCode(_0x4aa168,null))[_0x0caa('0x1f')](handleError(_0x4aa168,null));};exports['removeQueues']=function(_0x4c90ea,_0x54006b){var _0x58fde6,_0x3115f3;return db[_0x0caa('0x3d')]['find']({'where':{'id':_0x4c90ea['params']['id']},'attributes':['id',_0x0caa('0x3a'),'role']})['then'](handleEntityNotFound(_0x54006b,null))[_0x0caa('0x15')](function(_0x473b64){if(_0x473b64){_0x58fde6=_0x473b64;if(!_0x4c90ea[_0x0caa('0x45')][_0x0caa('0xa5')]||!utils[_0x0caa('0xaa')](_0x4c90ea['query'][_0x0caa('0xa5')])){throw new db[(_0x0caa('0x97'))][(_0x0caa('0x98'))](_0x0caa('0xb6'));}return _0x473b64[_0x0caa('0xb7')+_[_0x0caa('0xaf')](_0x4c90ea[_0x0caa('0x45')][_0x0caa('0xa5')][_0x0caa('0xac')]())+_0x0caa('0xad')](_0x4c90ea[_0x0caa('0x45')][_0x0caa('0x65')]);}})[_0x0caa('0x15')](function(_0x3fba24){if(_[_0x0caa('0xb8')](_0x4c90ea[_0x0caa('0x45')][_0x0caa('0x65')])){for(var _0x21fd81=0x0;_0x21fd81<_0x4c90ea['query'][_0x0caa('0x65')][_0x0caa('0x50')];_0x21fd81+=0x1){_0x3115f3={'UserId':Number(_0x4c90ea[_0x0caa('0x62')]['id'])};_0x3115f3[_['capitalize'](_0x4c90ea[_0x0caa('0x45')][_0x0caa('0xa5')][_0x0caa('0xac')]())+'QueueId']=Number(_0x4c90ea['query'][_0x0caa('0x65')][_0x21fd81]);socket[_0x0caa('0x29')](_0x0caa('0x2f')+_[_0x0caa('0xaf')](_0x4c90ea[_0x0caa('0x45')][_0x0caa('0xa5')][_0x0caa('0xac')]())+'Queue:remove',_0x3115f3);}}else{_0x3115f3={'UserId':Number(_0x4c90ea[_0x0caa('0x62')]['id'])};_0x3115f3[_[_0x0caa('0xaf')](_0x4c90ea[_0x0caa('0x45')]['channel'][_0x0caa('0xac')]())+'QueueId']=Number(_0x4c90ea[_0x0caa('0x45')][_0x0caa('0x65')]);socket['emit'](_0x0caa('0x2f')+_[_0x0caa('0xaf')](_0x4c90ea[_0x0caa('0x45')][_0x0caa('0xa5')][_0x0caa('0xac')]())+_0x0caa('0xb9'),_0x3115f3);}return _0x3fba24;})[_0x0caa('0x15')](function(){if(_0x4c90ea[_0x0caa('0x45')][_0x0caa('0xa5')]===_0x0caa('0xb1')){return db['UserVoiceQueueRt'][_0x0caa('0x2a')]({'where':{'UserId':_0x4c90ea['params']['id'],'VoiceQueueId':_0x4c90ea[_0x0caa('0x45')][_0x0caa('0x65')]},'individualHooks':!![]})['then'](function(){return _0x58fde6;});}return _0x58fde6;})[_0x0caa('0x15')](respondWithStatusCode(_0x54006b,null))[_0x0caa('0x1f')](handleError(_0x54006b,null));};exports['addAvatar']=function(_0x3f3028,_0x4b856c){_0x3f3028[_0x0caa('0x61')][_0x0caa('0xba')]=_0x3f3028[_0x0caa('0xbb')][_0x0caa('0xbc')];return db['User'][_0x0caa('0x37')]({'where':{'id':_0x3f3028[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x4b856c,null))['then'](saveUpdates(_0x3f3028[_0x0caa('0x61')],null))['then'](respondWithResult(_0x4b856c,null))[_0x0caa('0x1f')](handleError(_0x4b856c,null));};exports[_0x0caa('0xbd')]=function(_0xc0a9d1,_0x3b33ad){var _0x21299f=path[_0x0caa('0xbe')](config[_0x0caa('0xbf')],_0x0caa('0xc0'));return db['User']['find']({'where':{'id':_0xc0a9d1[_0x0caa('0x62')]['id']},'attributes':['id',_0x0caa('0xba')],'raw':!![]})['then'](handleEntityNotFound(_0x3b33ad,null))[_0x0caa('0x15')](function(_0x4f9735){if(_0x4f9735){if(_[_0x0caa('0x71')](_0x4f9735[_0x0caa('0xba')])){return _0x3b33ad[_0x0caa('0xc1')](_0x21299f);}else{if(!fs[_0x0caa('0xc2')](path['join'](config[_0x0caa('0xbf')],_0x0caa('0xc3'),_0x4f9735[_0x0caa('0xba')]))){return _0x3b33ad['download'](_0x21299f);}return _0x3b33ad[_0x0caa('0xc1')](path[_0x0caa('0xbe')](config[_0x0caa('0xbf')],_0x0caa('0xc3'),_0x4f9735[_0x0caa('0xba')]));}}})[_0x0caa('0x1f')](handleError(_0x3b33ad,null));};exports[_0x0caa('0xc4')]=function(_0x2bba75,_0x5ed9f0){return db[_0x0caa('0x3d')][_0x0caa('0x37')]({'where':{'id':_0x2bba75['params']['id']},'attributes':['id']})[_0x0caa('0x15')](handleEntityNotFound(_0x5ed9f0,null))[_0x0caa('0x15')](function(_0x53f3fa){var _0x2789b0=[];values=_0x53f3fa[_0x0caa('0x52')];_0x2789b0[_0x0caa('0x4c')](get_open_tabs(_0x0caa('0x51'),_0x53f3fa[_0x0caa('0x52')]));_0x2789b0[_0x0caa('0x4c')](get_open_tabs(_0x0caa('0x53'),_0x53f3fa[_0x0caa('0x52')]));_0x2789b0[_0x0caa('0x4c')](get_open_tabs(_0x0caa('0x5f'),_0x53f3fa[_0x0caa('0x52')]));_0x2789b0['push'](get_open_tabs(_0x0caa('0x55'),_0x53f3fa[_0x0caa('0x52')]));_0x2789b0['push'](get_open_tabs(_0x0caa('0x60'),_0x53f3fa[_0x0caa('0x52')]));_0x2789b0[_0x0caa('0x4c')](get_open_tabs('mail',_0x53f3fa['dataValues']));return Promise[_0x0caa('0x56')](_0x2789b0);})[_0x0caa('0x15')](function(_0x52f069){if(_0x52f069){var _0x343ff9=_[_0x0caa('0x35')](values[_0x0caa('0xc5')],function(_0xbbb58f){return{'channel':_0x0caa('0xc6'),'id':_0xbbb58f['id'],'createdAt':_0xbbb58f[_0x0caa('0xc7')]};});var _0x5da9a5=_[_0x0caa('0x35')](values[_0x0caa('0xc8')],function(_0x288f2e){return{'channel':_0x0caa('0xc9'),'id':_0x288f2e['id'],'createdAt':_0x288f2e['createdAt']};});var _0x3eeb52=_[_0x0caa('0x35')](values[_0x0caa('0xca')],function(_0x29fdfd){return{'channel':_0x0caa('0xcb'),'id':_0x29fdfd['id'],'createdAt':_0x29fdfd[_0x0caa('0xc7')]};});var _0x41b8c1=_['map'](values[_0x0caa('0xcc')],function(_0x3ff0bb){return{'channel':_0x0caa('0xcd'),'id':_0x3ff0bb['id'],'createdAt':_0x3ff0bb[_0x0caa('0xc7')]};});var _0x3c7b94=_[_0x0caa('0x35')](values[_0x0caa('0xce')],function(_0x18fa88){return{'channel':_0x0caa('0xcf'),'id':_0x18fa88['id'],'createdAt':_0x18fa88[_0x0caa('0xc7')]};});var _0x3f5dcf=_['map'](values[_0x0caa('0xd0')],function(_0x45e537){return{'channel':'WHATSAPP','id':_0x45e537['id'],'createdAt':_0x45e537['createdAt']};});var _0x38afb5=_[_0x0caa('0xd1')](_0x343ff9,_0x5da9a5,_0x3eeb52,_0x41b8c1,_0x3c7b94,_0x3f5dcf);var _0x2802d2={'count':_0x38afb5['length'],'rows':_0x38afb5};return _0x2802d2;}else return null;})[_0x0caa('0x15')](respondWithResult(_0x5ed9f0,null))[_0x0caa('0x1f')](handleError(_0x5ed9f0,null));};exports[_0x0caa('0xd2')]=function(_0x48b76d,_0x82edf5){var _0x4c8748={};var _0x72c561={};var _0x2ed460;var _0x4e9296;return db[_0x0caa('0x3d')][_0x0caa('0x9f')]({'where':{'id':_0x48b76d['params']['id']}})['then'](handleEntityNotFound(_0x82edf5,null))[_0x0caa('0x15')](function(_0x262bea){if(_0x262bea){_0x2ed460=_0x262bea;_0x72c561['model']=_[_0x0caa('0xd3')](db[_0x0caa('0xd4')]['rawAttributes']);_0x72c561[_0x0caa('0x45')]=_['keys'](_0x48b76d[_0x0caa('0x45')]);_0x72c561[_0x0caa('0x5a')]=_[_0x0caa('0x5b')](_0x72c561[_0x0caa('0x58')],_0x72c561[_0x0caa('0x45')]);_0x4c8748[_0x0caa('0x4b')]=_[_0x0caa('0x5b')](_0x72c561[_0x0caa('0x58')],qs[_0x0caa('0x5c')](_0x48b76d[_0x0caa('0x45')][_0x0caa('0x5c')]));_0x4c8748[_0x0caa('0x4b')]=_0x4c8748[_0x0caa('0x4b')][_0x0caa('0x50')]?_0x4c8748[_0x0caa('0x4b')]:_0x72c561[_0x0caa('0x58')];_0x4c8748[_0x0caa('0xd5')]=qs[_0x0caa('0xd6')](_0x48b76d[_0x0caa('0x45')][_0x0caa('0xd6')]);_0x4c8748[_0x0caa('0x44')]=qs[_0x0caa('0x5a')](_[_0x0caa('0xd7')](_0x48b76d[_0x0caa('0x45')],_0x72c561[_0x0caa('0x5a')]));if(_0x48b76d['query'][_0x0caa('0x33')]){_0x4c8748[_0x0caa('0x44')]=_[_0x0caa('0x5d')](_0x4c8748['where'],{'$or':_[_0x0caa('0x35')](_0x4c8748[_0x0caa('0x4b')],function(_0x376bb6){var _0x32dab2={};_0x32dab2[_0x376bb6]={'$like':'%'+_0x48b76d['query'][_0x0caa('0x33')]+'%'};return _0x32dab2;})});}_0x4c8748=_[_0x0caa('0x5d')]({},_0x4c8748,_0x48b76d[_0x0caa('0x5e')]);return _0x2ed460[_0x0caa('0xd2')](_0x4c8748);}})['then'](function(_0x20210a){if(_0x20210a){_0x4e9296=_0x20210a[_0x0caa('0x50')];if(_0x48b76d[_0x0caa('0x45')]['hasOwnProperty'](_0x0caa('0x46'))){_0x4c8748['include']=[{'model':db[_0x0caa('0xd8')],'as':_0x0caa('0xd9'),'required':![]},{'model':db[_0x0caa('0xda')],'as':_0x0caa('0xdb'),'attributes':['id',_0x0caa('0x3a'),_0x0caa('0xdc')],'where':_0x48b76d['query'][_0x0caa('0xdd')]?{'id':_0x48b76d[_0x0caa('0x45')][_0x0caa('0xdd')]}:undefined,'required':_0x48b76d[_0x0caa('0x45')][_0x0caa('0xdd')]?!![]:![]}];}if(!_0x48b76d[_0x0caa('0x45')][_0x0caa('0xde')](_0x0caa('0xdf'))){_0x4c8748[_0x0caa('0x25')]=qs[_0x0caa('0x25')](_0x48b76d[_0x0caa('0x45')][_0x0caa('0x25')]);_0x4c8748['offset']=qs[_0x0caa('0x23')](_0x48b76d[_0x0caa('0x45')]['offset']);}return _0x2ed460[_0x0caa('0xd2')](_0x4c8748);}})[_0x0caa('0x15')](function(_0x42f44f){if(_0x42f44f){return _0x42f44f?{'count':_0x4e9296,'rows':_0x42f44f}:null;}})['then'](respondWithResult(_0x82edf5,null))[_0x0caa('0x1f')](handleError(_0x82edf5,null));};exports[_0x0caa('0xe0')]=function(_0x364d65,_0x5ed56b){var _0x149320;var _0x43fee2={};var _0x590dfe;return db[_0x0caa('0x3d')][_0x0caa('0x9f')]({'where':{'id':_0x364d65['params']['id']},'attributes':['id',_0x0caa('0x3a'),_0x0caa('0x2c')]})[_0x0caa('0x15')](handleEntityNotFound(_0x5ed56b,null))[_0x0caa('0x15')](function(_0x51f14a){if(!utils[_0x0caa('0xaa')](_0x364d65[_0x0caa('0x45')]['channel'])){throw new db[(_0x0caa('0x97'))]['ValidationError'](_0x0caa('0xb6'));}_0x149320=_0x51f14a;var _0x213a06={};_0x213a06['model']=_[_0x0caa('0xd3')](db[_[_0x0caa('0xaf')](_0x364d65[_0x0caa('0x45')]['channel'])+_0x0caa('0xe1')]['rawAttributes']);_0x213a06['query']=_[_0x0caa('0xd3')](_0x364d65[_0x0caa('0x45')]);_0x213a06['filters']=_[_0x0caa('0x5b')](_0x213a06[_0x0caa('0x58')],_0x213a06[_0x0caa('0x45')]);_0x43fee2['attributes']=_[_0x0caa('0x5b')](_0x213a06[_0x0caa('0x58')],qs[_0x0caa('0x5c')](_0x364d65['query'][_0x0caa('0x5c')]));_0x43fee2['attributes']=_0x43fee2[_0x0caa('0x4b')][_0x0caa('0x50')]?_0x43fee2[_0x0caa('0x4b')]:_0x213a06[_0x0caa('0x58')];_0x43fee2[_0x0caa('0xd5')]=qs[_0x0caa('0xd6')](_0x364d65[_0x0caa('0x45')]['sort']);_0x43fee2[_0x0caa('0x44')]=qs[_0x0caa('0x5a')](_[_0x0caa('0xd7')](_0x364d65[_0x0caa('0x45')],_0x213a06[_0x0caa('0x5a')]));if(_0x364d65[_0x0caa('0x45')][_0x0caa('0x33')]){_0x43fee2['where']=_['merge'](_0x43fee2[_0x0caa('0x44')],{'$or':_['map'](_0x43fee2[_0x0caa('0x4b')],function(_0x19125e){var _0x4da43d={};_0x4da43d[_0x19125e]={'$like':'%'+_0x364d65[_0x0caa('0x45')]['filter']+'%'};return _0x4da43d;})});}_0x43fee2=_[_0x0caa('0x5d')]({},_0x43fee2,_0x364d65['options']);switch(_0x149320[_0x0caa('0x2c')]){case _0x0caa('0x2d'):return db[_[_0x0caa('0xaf')](_0x364d65[_0x0caa('0x45')]['channel'])+_0x0caa('0xe1')][_0x0caa('0x4d')](_0x43fee2);case _0x0caa('0x2f'):case _0x0caa('0x31'):return _0x149320[_0x0caa('0x2b')+_[_0x0caa('0xaf')](_0x364d65[_0x0caa('0x45')][_0x0caa('0xa5')])+_0x0caa('0xad')](_0x43fee2);default:throw new db[(_0x0caa('0x97'))][(_0x0caa('0x98'))]('Unknown\x20role');}})[_0x0caa('0x15')](function(_0x2f1feb){_0x590dfe=_0x2f1feb['length'];if(!_0x364d65[_0x0caa('0x45')][_0x0caa('0xde')](_0x0caa('0xdf'))){_0x43fee2[_0x0caa('0x25')]=qs[_0x0caa('0x25')](_0x364d65[_0x0caa('0x45')]['limit']);_0x43fee2['offset']=qs['offset'](_0x364d65['query'][_0x0caa('0x23')]);}switch(_0x149320[_0x0caa('0x2c')]){case _0x0caa('0x2d'):return db[_['capitalize'](_0x364d65[_0x0caa('0x45')][_0x0caa('0xa5')])+_0x0caa('0xe1')][_0x0caa('0x4d')](_0x43fee2);case'user':case _0x0caa('0x31'):return _0x149320[_0x0caa('0x2b')+_['capitalize'](_0x364d65[_0x0caa('0x45')][_0x0caa('0xa5')])+_0x0caa('0xad')](_0x43fee2);}})[_0x0caa('0x15')](function(_0x507187){return{'count':_0x590dfe,'rows':_0x507187};})[_0x0caa('0x15')](respondWithResult(_0x5ed56b,null))[_0x0caa('0x1f')](handleError(_0x5ed56b,null));};exports[_0x0caa('0xe2')]=function(_0x513a3,_0x288233){var _0x307c32={};var _0x539f45={};var _0x2b5d85;var _0x14568b;return db[_0x0caa('0x3d')]['findOne']({'where':{'id':_0x513a3[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x288233,null))[_0x0caa('0x15')](function(_0x2aebc4){if(_0x2aebc4){_0x2b5d85=_0x2aebc4;_0x539f45[_0x0caa('0x58')]=_[_0x0caa('0xd3')](db['UserVoiceQueueRt'][_0x0caa('0x3e')]);_0x539f45['query']=_[_0x0caa('0xd3')](_0x513a3[_0x0caa('0x45')]);_0x539f45[_0x0caa('0x5a')]=_[_0x0caa('0x5b')](_0x539f45[_0x0caa('0x58')],_0x539f45[_0x0caa('0x45')]);_0x307c32[_0x0caa('0x4b')]=_['intersection'](_0x539f45['model'],qs['fields'](_0x513a3[_0x0caa('0x45')][_0x0caa('0x5c')]));_0x307c32[_0x0caa('0x4b')]=_0x307c32[_0x0caa('0x4b')][_0x0caa('0x50')]?_0x307c32['attributes']:_0x539f45[_0x0caa('0x58')];_0x307c32[_0x0caa('0xd5')]=qs[_0x0caa('0xd6')](_0x513a3['query']['sort']);_0x307c32[_0x0caa('0x44')]=qs[_0x0caa('0x5a')](_[_0x0caa('0xd7')](_0x513a3[_0x0caa('0x45')],_0x539f45[_0x0caa('0x5a')]));if(_0x513a3['query'][_0x0caa('0x33')]){_0x307c32[_0x0caa('0x44')]=_[_0x0caa('0x5d')](_0x307c32['where'],{'$or':_[_0x0caa('0x35')](_0x307c32['attributes'],function(_0x32463f){var _0x8f797e={};_0x8f797e[_0x32463f]={'$like':'%'+_0x513a3[_0x0caa('0x45')][_0x0caa('0x33')]+'%'};return _0x8f797e;})});}_0x307c32=_[_0x0caa('0x5d')]({},_0x307c32,_0x513a3[_0x0caa('0x5e')]);return _0x2b5d85['getVoiceQueuesRt'](_0x307c32);}})[_0x0caa('0x15')](function(_0x15cc34){if(_0x15cc34){_0x14568b=_0x15cc34[_0x0caa('0x50')];if(!_0x513a3[_0x0caa('0x45')][_0x0caa('0xde')](_0x0caa('0xdf'))){_0x307c32['limit']=qs[_0x0caa('0x25')](_0x513a3['query'][_0x0caa('0x25')]);_0x307c32[_0x0caa('0x23')]=qs['offset'](_0x513a3[_0x0caa('0x45')][_0x0caa('0x23')]);}return _0x2b5d85['getVoiceQueuesRt'](_0x307c32);}})[_0x0caa('0x15')](function(_0x48ccc6){if(_0x48ccc6){return _0x48ccc6?{'count':_0x14568b,'rows':_0x48ccc6}:null;}})[_0x0caa('0x15')](respondWithResult(_0x288233,null))[_0x0caa('0x1f')](handleError(_0x288233,null));};exports['getGroups']=function(_0x3e2316,_0x5ab4d2){var _0x11a7aa={};var _0x484abc={};var _0xd1dd70;var _0x334468;return db[_0x0caa('0x3d')][_0x0caa('0x9f')]({'where':{'id':_0x3e2316[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x5ab4d2,null))['then'](function(_0x449106){if(_0x449106){_0xd1dd70=_0x449106;_0x484abc[_0x0caa('0x58')]=_[_0x0caa('0xd3')](db[_0x0caa('0xe3')][_0x0caa('0x3e')]);_0x484abc[_0x0caa('0x45')]=_['keys'](_0x3e2316[_0x0caa('0x45')]);_0x484abc[_0x0caa('0x5a')]=_[_0x0caa('0x5b')](_0x484abc['model'],_0x484abc[_0x0caa('0x45')]);_0x11a7aa[_0x0caa('0x4b')]=_[_0x0caa('0x5b')](_0x484abc[_0x0caa('0x58')],qs['fields'](_0x3e2316[_0x0caa('0x45')][_0x0caa('0x5c')]));_0x11a7aa[_0x0caa('0x4b')]=_0x11a7aa[_0x0caa('0x4b')][_0x0caa('0x50')]?_0x11a7aa[_0x0caa('0x4b')]:_0x484abc[_0x0caa('0x58')];_0x11a7aa[_0x0caa('0xd5')]=qs[_0x0caa('0xd6')](_0x3e2316['query'][_0x0caa('0xd6')]);_0x11a7aa[_0x0caa('0x44')]=qs['filters'](_['pick'](_0x3e2316[_0x0caa('0x45')],_0x484abc[_0x0caa('0x5a')]));if(_0x3e2316[_0x0caa('0x45')][_0x0caa('0x33')]){_0x11a7aa[_0x0caa('0x44')]=_[_0x0caa('0x5d')](_0x11a7aa[_0x0caa('0x44')],{'$or':_[_0x0caa('0x35')](_0x11a7aa['attributes'],function(_0x5e1be1){var _0x2465d4={};_0x2465d4[_0x5e1be1]={'$like':'%'+_0x3e2316[_0x0caa('0x45')][_0x0caa('0x33')]+'%'};return _0x2465d4;})});}_0x11a7aa=_[_0x0caa('0x5d')]({},_0x11a7aa,_0x3e2316['options']);return _0xd1dd70[_0x0caa('0xe4')](_0x11a7aa);}})[_0x0caa('0x15')](function(_0x38c7f4){if(_0x38c7f4){_0x334468=_0x38c7f4[_0x0caa('0x50')];if(!_0x3e2316[_0x0caa('0x45')][_0x0caa('0xde')](_0x0caa('0xdf'))){_0x11a7aa[_0x0caa('0x25')]=qs[_0x0caa('0x25')](_0x3e2316['query'][_0x0caa('0x25')]);_0x11a7aa[_0x0caa('0x23')]=qs[_0x0caa('0x23')](_0x3e2316[_0x0caa('0x45')][_0x0caa('0x23')]);}return _0xd1dd70[_0x0caa('0xe4')](_0x11a7aa);}})[_0x0caa('0x15')](function(_0x3d82de){if(_0x3d82de){return _0x3d82de?{'count':_0x334468,'rows':_0x3d82de}:null;}})[_0x0caa('0x15')](respondWithResult(_0x5ab4d2,null))[_0x0caa('0x1f')](handleError(_0x5ab4d2,null));};exports[_0x0caa('0xe5')]=function(_0x137004,_0x464ed3){var _0x4c3ee0={'raw':!![],'where':{}};var _0xa0603a={};var _0x4a4765={'count':0x0,'rows':[]};return db['User'][_0x0caa('0x9f')]({'where':{'id':_0x137004[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x464ed3,null))['then'](function(_0x199732){if(_0x199732){_0xa0603a[_0x0caa('0x58')]=_[_0x0caa('0xd3')](db[_0x0caa('0xe6')][_0x0caa('0x3e')]);_0xa0603a[_0x0caa('0x45')]=_[_0x0caa('0xd3')](_0x137004[_0x0caa('0x45')]);_0xa0603a[_0x0caa('0x5a')]=_[_0x0caa('0x5b')](_0xa0603a['model'],_0xa0603a[_0x0caa('0x45')]);_0x4c3ee0['attributes']=_[_0x0caa('0x5b')](_0xa0603a[_0x0caa('0x58')],qs[_0x0caa('0x5c')](_0x137004[_0x0caa('0x45')][_0x0caa('0x5c')]));_0x4c3ee0[_0x0caa('0x4b')]=_0x4c3ee0[_0x0caa('0x4b')]['length']?_0x4c3ee0[_0x0caa('0x4b')]:_0xa0603a[_0x0caa('0x58')];if(!_0x137004[_0x0caa('0x45')][_0x0caa('0xde')]('nolimit')){_0x4c3ee0[_0x0caa('0x25')]=qs[_0x0caa('0x25')](_0x137004['query'][_0x0caa('0x25')]);_0x4c3ee0['offset']=qs[_0x0caa('0x23')](_0x137004['query']['offset']);}_0x4c3ee0[_0x0caa('0xd5')]=qs[_0x0caa('0xd6')](_0x137004[_0x0caa('0x45')][_0x0caa('0xd6')]);_0x4c3ee0[_0x0caa('0x44')]=qs[_0x0caa('0x5a')](_[_0x0caa('0xd7')](_0x137004[_0x0caa('0x45')],_0xa0603a[_0x0caa('0x5a')]));_0x4c3ee0[_0x0caa('0x44')]['UserId']=_0x199732['id'];if(_0x137004[_0x0caa('0x45')][_0x0caa('0x33')]){_0x4c3ee0[_0x0caa('0x44')]=_[_0x0caa('0x5d')](_0x4c3ee0[_0x0caa('0x44')],{'$or':_[_0x0caa('0x35')](_0x4c3ee0['attributes'],function(_0x3d7af3){var _0xc048a5={};_0xc048a5[_0x3d7af3]={'$like':'%'+_0x137004[_0x0caa('0x45')]['filter']+'%'};return _0xc048a5;})});}_0x4c3ee0=_[_0x0caa('0x5d')]({},_0x4c3ee0,_0x137004['options']);return db['VoiceRecording']['count']({'where':_0x4c3ee0['where']})[_0x0caa('0x15')](function(_0x2b0f25){_0x4a4765[_0x0caa('0x26')]=_0x2b0f25;if(_0x137004[_0x0caa('0x45')][_0x0caa('0x46')]){_0x4c3ee0[_0x0caa('0x47')]=[{'all':!![]}];}return db[_0x0caa('0xe6')][_0x0caa('0x4d')](_0x4c3ee0);})[_0x0caa('0x15')](function(_0x4b84ec){_0x4a4765[_0x0caa('0x4e')]=_0x4b84ec;return _0x4a4765;});}})[_0x0caa('0x15')](respondWithFilteredResult(_0x464ed3,_0x4c3ee0))[_0x0caa('0x1f')](handleError(_0x464ed3,null));};exports[_0x0caa('0xe7')]=function(_0x27c16f,_0x2d138b){var _0x55a4f3={'raw':!![],'where':{}};var _0x33bab2={};var _0x1566fd={'count':0x0,'rows':[]};return db[_0x0caa('0x3d')][_0x0caa('0x9f')]({'where':{'id':_0x27c16f[_0x0caa('0x62')]['id']}})['then'](handleEntityNotFound(_0x2d138b,null))[_0x0caa('0x15')](function(_0x17a8c5){if(_0x17a8c5){_0x33bab2[_0x0caa('0x58')]=_['keys'](db[_0x0caa('0xe8')]['rawAttributes']);_0x33bab2[_0x0caa('0x45')]=_[_0x0caa('0xd3')](_0x27c16f['query']);_0x33bab2[_0x0caa('0x5a')]=_['intersection'](_0x33bab2[_0x0caa('0x58')],_0x33bab2[_0x0caa('0x45')]);_0x55a4f3['attributes']=_['intersection'](_0x33bab2[_0x0caa('0x58')],qs[_0x0caa('0x5c')](_0x27c16f['query'][_0x0caa('0x5c')]));_0x55a4f3['attributes']=_0x55a4f3[_0x0caa('0x4b')][_0x0caa('0x50')]?_0x55a4f3['attributes']:_0x33bab2[_0x0caa('0x58')];if(!_0x27c16f[_0x0caa('0x45')][_0x0caa('0xde')](_0x0caa('0xdf'))){_0x55a4f3[_0x0caa('0x25')]=qs[_0x0caa('0x25')](_0x27c16f[_0x0caa('0x45')]['limit']);_0x55a4f3[_0x0caa('0x23')]=qs[_0x0caa('0x23')](_0x27c16f[_0x0caa('0x45')][_0x0caa('0x23')]);}_0x55a4f3[_0x0caa('0xd5')]=qs[_0x0caa('0xd6')](_0x27c16f[_0x0caa('0x45')][_0x0caa('0xd6')]);_0x55a4f3[_0x0caa('0x44')]=qs[_0x0caa('0x5a')](_['pick'](_0x27c16f[_0x0caa('0x45')],_0x33bab2[_0x0caa('0x5a')]));_0x55a4f3[_0x0caa('0x44')]['UserId']=_0x17a8c5['id'];if(_0x27c16f[_0x0caa('0x45')]['filter']){_0x55a4f3[_0x0caa('0x44')]=_['merge'](_0x55a4f3[_0x0caa('0x44')],{'$or':_['map'](_0x55a4f3[_0x0caa('0x4b')],function(_0x4ac46a){var _0x100598={};_0x100598[_0x4ac46a]={'$like':'%'+_0x27c16f[_0x0caa('0x45')]['filter']+'%'};return _0x100598;})});}_0x55a4f3=_[_0x0caa('0x5d')]({},_0x55a4f3,_0x27c16f['options']);return db[_0x0caa('0xe8')]['count']({'where':_0x55a4f3[_0x0caa('0x44')]})[_0x0caa('0x15')](function(_0x5e2c42){_0x1566fd[_0x0caa('0x26')]=_0x5e2c42;if(_0x27c16f[_0x0caa('0x45')][_0x0caa('0x46')]){_0x55a4f3['include']=[{'all':!![]}];}return db[_0x0caa('0xe8')][_0x0caa('0x4d')](_0x55a4f3);})[_0x0caa('0x15')](function(_0x4ed990){_0x1566fd[_0x0caa('0x4e')]=_0x4ed990;return _0x1566fd;});}})[_0x0caa('0x15')](respondWithFilteredResult(_0x2d138b,_0x55a4f3))[_0x0caa('0x1f')](handleError(_0x2d138b,null));};exports[_0x0caa('0xe9')]=function(_0x49f7ad,_0x5eece9){var _0x75c5fa={};var _0x5f3ec6={};var _0x490844;var _0x5ce06a;return db[_0x0caa('0x3d')]['findOne']({'where':{'id':_0x49f7ad[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x5eece9,null))['then'](function(_0x425f15){if(_0x425f15){_0x490844=_0x425f15;_0x5f3ec6[_0x0caa('0x58')]=_[_0x0caa('0xd3')](db[_0x0caa('0xea')]['rawAttributes']);_0x5f3ec6['query']=_[_0x0caa('0xd3')](_0x49f7ad[_0x0caa('0x45')]);_0x5f3ec6[_0x0caa('0x5a')]=_[_0x0caa('0x5b')](_0x5f3ec6[_0x0caa('0x58')],_0x5f3ec6[_0x0caa('0x45')]);_0x75c5fa[_0x0caa('0x4b')]=_['intersection'](_0x5f3ec6[_0x0caa('0x58')],qs[_0x0caa('0x5c')](_0x49f7ad[_0x0caa('0x45')]['fields']));_0x75c5fa['attributes']=_0x75c5fa[_0x0caa('0x4b')][_0x0caa('0x50')]?_0x75c5fa[_0x0caa('0x4b')]:_0x5f3ec6[_0x0caa('0x58')];_0x75c5fa['order']=qs[_0x0caa('0xd6')](_0x49f7ad['query'][_0x0caa('0xd6')]);_0x75c5fa['where']=qs[_0x0caa('0x5a')](_[_0x0caa('0xd7')](_0x49f7ad['query'],_0x5f3ec6['filters']));if(_0x49f7ad[_0x0caa('0x45')][_0x0caa('0x33')]){_0x75c5fa[_0x0caa('0x44')]=_[_0x0caa('0x5d')](_0x75c5fa[_0x0caa('0x44')],{'$or':_[_0x0caa('0x35')](_0x75c5fa[_0x0caa('0x4b')],function(_0x1ce17e){var _0x17cbd7={};_0x17cbd7[_0x1ce17e]={'$like':'%'+_0x49f7ad[_0x0caa('0x45')][_0x0caa('0x33')]+'%'};return _0x17cbd7;})});}_0x75c5fa=_['merge']({},_0x75c5fa,_0x49f7ad[_0x0caa('0x5e')]);return _0x490844[_0x0caa('0xe9')](_0x75c5fa);}})[_0x0caa('0x15')](function(_0x3b60db){if(_0x3b60db){_0x5ce06a=_0x3b60db[_0x0caa('0x50')];if(!_0x49f7ad[_0x0caa('0x45')][_0x0caa('0xde')](_0x0caa('0xdf'))){_0x75c5fa[_0x0caa('0x25')]=qs[_0x0caa('0x25')](_0x49f7ad[_0x0caa('0x45')][_0x0caa('0x25')]);_0x75c5fa[_0x0caa('0x23')]=qs[_0x0caa('0x23')](_0x49f7ad[_0x0caa('0x45')]['offset']);}return _0x490844[_0x0caa('0xe9')](_0x75c5fa);}})[_0x0caa('0x15')](function(_0x26e113){if(_0x26e113){return _0x26e113?{'count':_0x5ce06a,'rows':_0x26e113}:null;}})[_0x0caa('0x15')](respondWithResult(_0x5eece9,null))['catch'](handleError(_0x5eece9,null));};exports[_0x0caa('0xeb')]=function(_0x37ae4a,_0x1bfcb8){var _0x356f2b={};var _0x134b95={};var _0x16625d;var _0x5c7ebf;return db[_0x0caa('0x3d')]['findOne']({'where':{'id':_0x37ae4a[_0x0caa('0x62')]['id']}})['then'](handleEntityNotFound(_0x1bfcb8,null))[_0x0caa('0x15')](function(_0xfaaa26){if(_0xfaaa26){_0x16625d=_0xfaaa26;_0x134b95[_0x0caa('0x58')]=_['keys'](db[_0x0caa('0xec')]['rawAttributes']);_0x134b95[_0x0caa('0x45')]=_[_0x0caa('0xd3')](_0x37ae4a[_0x0caa('0x45')]);_0x134b95['filters']=_[_0x0caa('0x5b')](_0x134b95[_0x0caa('0x58')],_0x134b95['query']);_0x356f2b[_0x0caa('0x4b')]=_[_0x0caa('0x5b')](_0x134b95[_0x0caa('0x58')],qs[_0x0caa('0x5c')](_0x37ae4a[_0x0caa('0x45')][_0x0caa('0x5c')]));_0x356f2b['attributes']=_0x356f2b[_0x0caa('0x4b')][_0x0caa('0x50')]?_0x356f2b['attributes']:_0x134b95[_0x0caa('0x58')];_0x356f2b[_0x0caa('0xd5')]=qs[_0x0caa('0xd6')](_0x37ae4a['query']['sort']);_0x356f2b[_0x0caa('0x44')]=qs['filters'](_[_0x0caa('0xd7')](_0x37ae4a['query'],_0x134b95[_0x0caa('0x5a')]));if(_0x37ae4a['query']['filter']){_0x356f2b[_0x0caa('0x44')]=_[_0x0caa('0x5d')](_0x356f2b[_0x0caa('0x44')],{'$or':_[_0x0caa('0x35')](_0x356f2b['attributes'],function(_0x153ae5){var _0x5725df={};_0x5725df[_0x153ae5]={'$like':'%'+_0x37ae4a[_0x0caa('0x45')][_0x0caa('0x33')]+'%'};return _0x5725df;})});}_0x356f2b=_['merge']({},_0x356f2b,_0x37ae4a[_0x0caa('0x5e')]);return _0x16625d['getOpenchannelInteractions'](_0x356f2b);}})[_0x0caa('0x15')](function(_0x16419b){if(_0x16419b){_0x5c7ebf=_0x16419b[_0x0caa('0x50')];if(!_0x37ae4a[_0x0caa('0x45')]['hasOwnProperty'](_0x0caa('0xdf'))){_0x356f2b[_0x0caa('0x25')]=qs['limit'](_0x37ae4a[_0x0caa('0x45')][_0x0caa('0x25')]);_0x356f2b[_0x0caa('0x23')]=qs['offset'](_0x37ae4a[_0x0caa('0x45')]['offset']);}return _0x16625d[_0x0caa('0xeb')](_0x356f2b);}})['then'](function(_0x5441cd){if(_0x5441cd){return _0x5441cd?{'count':_0x5c7ebf,'rows':_0x5441cd}:null;}})[_0x0caa('0x15')](respondWithResult(_0x1bfcb8,null))[_0x0caa('0x1f')](handleError(_0x1bfcb8,null));};exports['getMailInteractions']=function(_0x133fc4,_0x55eac6){var _0x373307={'raw':!![],'where':{}};var _0x17397f={};var _0xe1b1c8={'count':0x0,'rows':[]};return db[_0x0caa('0x3d')][_0x0caa('0x9f')]({'where':{'id':_0x133fc4[_0x0caa('0x62')]['id']}})['then'](handleEntityNotFound(_0x55eac6,null))[_0x0caa('0x15')](function(_0x261b31){if(_0x261b31){_0x17397f[_0x0caa('0x58')]=_['keys'](db['MailInteraction']['rawAttributes']);_0x17397f[_0x0caa('0x45')]=_['keys'](_0x133fc4[_0x0caa('0x45')]);_0x17397f[_0x0caa('0x5a')]=_['intersection'](_0x17397f[_0x0caa('0x58')],_0x17397f[_0x0caa('0x45')]);_0x373307[_0x0caa('0x4b')]=_['intersection'](_0x17397f[_0x0caa('0x58')],qs[_0x0caa('0x5c')](_0x133fc4['query'][_0x0caa('0x5c')]));_0x373307[_0x0caa('0x4b')]=_0x373307[_0x0caa('0x4b')][_0x0caa('0x50')]?_0x373307[_0x0caa('0x4b')]:_0x17397f[_0x0caa('0x58')];if(!_0x133fc4['query'][_0x0caa('0xde')](_0x0caa('0xdf'))){_0x373307[_0x0caa('0x25')]=qs[_0x0caa('0x25')](_0x133fc4['query'][_0x0caa('0x25')]);_0x373307['offset']=qs['offset'](_0x133fc4[_0x0caa('0x45')][_0x0caa('0x23')]);}_0x373307['order']=qs[_0x0caa('0xd6')](_0x133fc4[_0x0caa('0x45')]['sort']);_0x373307[_0x0caa('0x44')]=qs[_0x0caa('0x5a')](_[_0x0caa('0xd7')](_0x133fc4[_0x0caa('0x45')],_0x17397f['filters']));_0x373307['where'][_0x0caa('0xed')]=_0x261b31['id'];if(_0x133fc4[_0x0caa('0x45')]['filter']){_0x373307[_0x0caa('0x44')]=_['merge'](_0x373307[_0x0caa('0x44')],{'$or':_['map'](_0x373307[_0x0caa('0x4b')],function(_0x461492){var _0xb11dc8={};_0xb11dc8[_0x461492]={'$like':'%'+_0x133fc4['query'][_0x0caa('0x33')]+'%'};return _0xb11dc8;})});}_0x373307=_['merge']({},_0x373307,_0x133fc4[_0x0caa('0x5e')]);return db[_0x0caa('0xee')][_0x0caa('0x26')]({'where':_0x373307[_0x0caa('0x44')]})['then'](function(_0x2a6a2e){_0xe1b1c8[_0x0caa('0x26')]=_0x2a6a2e;if(_0x133fc4['query'][_0x0caa('0x46')]){_0x373307[_0x0caa('0x47')]=[{'all':!![]}];}return db['MailInteraction'][_0x0caa('0x4d')](_0x373307);})[_0x0caa('0x15')](function(_0x12b959){_0xe1b1c8[_0x0caa('0x4e')]=_0x12b959;return _0xe1b1c8;});}})[_0x0caa('0x15')](respondWithFilteredResult(_0x55eac6,_0x373307))[_0x0caa('0x1f')](handleError(_0x55eac6,null));};exports[_0x0caa('0xef')]=function(_0xf0d25f,_0x4b57a1){var _0x10d819={};var _0x274b9c={};var _0x4a2aad;var _0x4dc4b1;return db['User'][_0x0caa('0x9f')]({'where':{'id':_0xf0d25f[_0x0caa('0x62')]['id']}})['then'](handleEntityNotFound(_0x4b57a1,null))[_0x0caa('0x15')](function(_0x309982){if(_0x309982){_0x4a2aad=_0x309982;_0x274b9c[_0x0caa('0x58')]=_[_0x0caa('0xd3')](db[_0x0caa('0xf0')]['rawAttributes']);_0x274b9c[_0x0caa('0x45')]=_[_0x0caa('0xd3')](_0xf0d25f['query']);_0x274b9c[_0x0caa('0x5a')]=_[_0x0caa('0x5b')](_0x274b9c[_0x0caa('0x58')],_0x274b9c[_0x0caa('0x45')]);_0x10d819[_0x0caa('0x4b')]=_[_0x0caa('0x5b')](_0x274b9c[_0x0caa('0x58')],qs[_0x0caa('0x5c')](_0xf0d25f[_0x0caa('0x45')][_0x0caa('0x5c')]));_0x10d819[_0x0caa('0x4b')]=_0x10d819[_0x0caa('0x4b')][_0x0caa('0x50')]?_0x10d819[_0x0caa('0x4b')]:_0x274b9c['model'];_0x10d819['order']=qs['sort'](_0xf0d25f[_0x0caa('0x45')]['sort']);_0x10d819['where']=qs[_0x0caa('0x5a')](_[_0x0caa('0xd7')](_0xf0d25f[_0x0caa('0x45')],_0x274b9c['filters']));if(_0xf0d25f[_0x0caa('0x45')][_0x0caa('0x33')]){_0x10d819[_0x0caa('0x44')]=_['merge'](_0x10d819[_0x0caa('0x44')],{'$or':_[_0x0caa('0x35')](_0x10d819['attributes'],function(_0x3ccdb3){var _0x2d0602={};_0x2d0602[_0x3ccdb3]={'$like':'%'+_0xf0d25f[_0x0caa('0x45')][_0x0caa('0x33')]+'%'};return _0x2d0602;})});}_0x10d819=_[_0x0caa('0x5d')]({},_0x10d819,_0xf0d25f[_0x0caa('0x5e')]);return _0x4a2aad[_0x0caa('0xef')](_0x10d819);}})[_0x0caa('0x15')](function(_0xc6c62e){if(_0xc6c62e){_0x4dc4b1=_0xc6c62e[_0x0caa('0x50')];if(!_0xf0d25f[_0x0caa('0x45')][_0x0caa('0xde')](_0x0caa('0xdf'))){_0x10d819[_0x0caa('0x25')]=qs[_0x0caa('0x25')](_0xf0d25f[_0x0caa('0x45')][_0x0caa('0x25')]);_0x10d819[_0x0caa('0x23')]=qs['offset'](_0xf0d25f[_0x0caa('0x45')][_0x0caa('0x23')]);}return _0x4a2aad[_0x0caa('0xef')](_0x10d819);}})[_0x0caa('0x15')](function(_0x47f38f){if(_0x47f38f){return _0x47f38f?{'count':_0x4dc4b1,'rows':_0x47f38f}:null;}})[_0x0caa('0x15')](respondWithResult(_0x4b57a1,null))[_0x0caa('0x1f')](handleError(_0x4b57a1,null));};exports[_0x0caa('0xf1')]=function(_0x5dc1dc,_0x4e6d05){var _0x54ba24={};var _0x136ee7={};var _0x11606f;var _0x42cecc;return db['User'][_0x0caa('0x9f')]({'where':{'id':_0x5dc1dc[_0x0caa('0x62')]['id']}})['then'](handleEntityNotFound(_0x4e6d05,null))[_0x0caa('0x15')](function(_0xcf2bf4){if(_0xcf2bf4){_0x11606f=_0xcf2bf4;_0x136ee7[_0x0caa('0x58')]=_[_0x0caa('0xd3')](db[_0x0caa('0xf2')][_0x0caa('0x3e')]);_0x136ee7[_0x0caa('0x45')]=_['keys'](_0x5dc1dc['query']);_0x136ee7[_0x0caa('0x5a')]=_[_0x0caa('0x5b')](_0x136ee7['model'],_0x136ee7['query']);_0x54ba24[_0x0caa('0x4b')]=_[_0x0caa('0x5b')](_0x136ee7[_0x0caa('0x58')],qs[_0x0caa('0x5c')](_0x5dc1dc[_0x0caa('0x45')]['fields']));_0x54ba24[_0x0caa('0x4b')]=_0x54ba24[_0x0caa('0x4b')][_0x0caa('0x50')]?_0x54ba24[_0x0caa('0x4b')]:_0x136ee7[_0x0caa('0x58')];_0x54ba24[_0x0caa('0xd5')]=qs[_0x0caa('0xd6')](_0x5dc1dc['query'][_0x0caa('0xd6')]);_0x54ba24[_0x0caa('0x44')]=qs['filters'](_[_0x0caa('0xd7')](_0x5dc1dc[_0x0caa('0x45')],_0x136ee7[_0x0caa('0x5a')]));if(_0x5dc1dc[_0x0caa('0x45')][_0x0caa('0x33')]){_0x54ba24[_0x0caa('0x44')]=_[_0x0caa('0x5d')](_0x54ba24['where'],{'$or':_[_0x0caa('0x35')](_0x54ba24['attributes'],function(_0x1e5f9d){var _0x150c4e={};_0x150c4e[_0x1e5f9d]={'$like':'%'+_0x5dc1dc[_0x0caa('0x45')][_0x0caa('0x33')]+'%'};return _0x150c4e;})});}_0x54ba24=_[_0x0caa('0x5d')]({},_0x54ba24,_0x5dc1dc['options']);return _0x11606f[_0x0caa('0xf1')](_0x54ba24);}})[_0x0caa('0x15')](function(_0x5c91b4){if(_0x5c91b4){_0x42cecc=_0x5c91b4['length'];if(!_0x5dc1dc[_0x0caa('0x45')][_0x0caa('0xde')](_0x0caa('0xdf'))){_0x54ba24[_0x0caa('0x25')]=qs[_0x0caa('0x25')](_0x5dc1dc['query'][_0x0caa('0x25')]);_0x54ba24[_0x0caa('0x23')]=qs[_0x0caa('0x23')](_0x5dc1dc[_0x0caa('0x45')][_0x0caa('0x23')]);}return _0x11606f['getFaxInteractions'](_0x54ba24);}})[_0x0caa('0x15')](function(_0x1c4fd8){if(_0x1c4fd8){return _0x1c4fd8?{'count':_0x42cecc,'rows':_0x1c4fd8}:null;}})[_0x0caa('0x15')](respondWithResult(_0x4e6d05,null))[_0x0caa('0x1f')](handleError(_0x4e6d05,null));};exports[_0x0caa('0xf3')]=function(_0x452e09,_0x43a261){var _0xbcc7e8={};var _0x3c4358={};var _0x10361a;var _0x57f9bb;return db[_0x0caa('0x3d')][_0x0caa('0x9f')]({'where':{'id':_0x452e09[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x43a261,null))['then'](function(_0x327f5d){if(_0x327f5d){_0x10361a=_0x327f5d;_0x3c4358['model']=_['keys'](db[_0x0caa('0xf4')][_0x0caa('0x3e')]);_0x3c4358[_0x0caa('0x45')]=_[_0x0caa('0xd3')](_0x452e09[_0x0caa('0x45')]);_0x3c4358[_0x0caa('0x5a')]=_[_0x0caa('0x5b')](_0x3c4358['model'],_0x3c4358[_0x0caa('0x45')]);_0xbcc7e8[_0x0caa('0x4b')]=_[_0x0caa('0x5b')](_0x3c4358[_0x0caa('0x58')],qs['fields'](_0x452e09[_0x0caa('0x45')][_0x0caa('0x5c')]));_0xbcc7e8[_0x0caa('0x4b')]=_0xbcc7e8[_0x0caa('0x4b')][_0x0caa('0x50')]?_0xbcc7e8[_0x0caa('0x4b')]:_0x3c4358[_0x0caa('0x58')];_0xbcc7e8[_0x0caa('0xd5')]=qs['sort'](_0x452e09[_0x0caa('0x45')][_0x0caa('0xd6')]);_0xbcc7e8[_0x0caa('0x44')]=qs[_0x0caa('0x5a')](_[_0x0caa('0xd7')](_0x452e09[_0x0caa('0x45')],_0x3c4358[_0x0caa('0x5a')]));if(_0x452e09[_0x0caa('0x45')][_0x0caa('0x33')]){_0xbcc7e8[_0x0caa('0x44')]=_['merge'](_0xbcc7e8['where'],{'$or':_[_0x0caa('0x35')](_0xbcc7e8[_0x0caa('0x4b')],function(_0x120a45){var _0x34cef7={};_0x34cef7[_0x120a45]={'$like':'%'+_0x452e09[_0x0caa('0x45')]['filter']+'%'};return _0x34cef7;})});}_0xbcc7e8=_[_0x0caa('0x5d')]({},_0xbcc7e8,_0x452e09[_0x0caa('0x5e')]);return _0x10361a[_0x0caa('0xf3')](_0xbcc7e8);}})['then'](function(_0x2fb5a8){if(_0x2fb5a8){_0x57f9bb=_0x2fb5a8[_0x0caa('0x50')];if(!_0x452e09['query'][_0x0caa('0xde')](_0x0caa('0xdf'))){_0xbcc7e8[_0x0caa('0x25')]=qs['limit'](_0x452e09[_0x0caa('0x45')][_0x0caa('0x25')]);_0xbcc7e8[_0x0caa('0x23')]=qs['offset'](_0x452e09[_0x0caa('0x45')][_0x0caa('0x23')]);}return _0x10361a[_0x0caa('0xf3')](_0xbcc7e8);}})[_0x0caa('0x15')](function(_0x2ead7b){if(_0x2ead7b){return _0x2ead7b?{'count':_0x57f9bb,'rows':_0x2ead7b}:null;}})[_0x0caa('0x15')](respondWithResult(_0x43a261,null))[_0x0caa('0x1f')](handleError(_0x43a261,null));};exports[_0x0caa('0xf5')]=function(_0x5a736c,_0x20db6d,_0x4e8d0a){var _0x51777b;var _0x3f6974;var _0x2e423e;var _0xcbfd38=!_[_0x0caa('0x71')](_0x5a736c[_0x0caa('0x62')]['id'])?_0x5a736c[_0x0caa('0x62')]['id']:!_[_0x0caa('0x71')](_0x5a736c[_0x0caa('0x2f')]['id'])?_0x5a736c[_0x0caa('0x2f')]['id']:null;return db[_0x0caa('0x3d')][_0x0caa('0x37')]({'where':{'id':_0xcbfd38,'role':{'$or':[_0x0caa('0x2d'),_0x0caa('0x2f'),_0x0caa('0x31')]}},'attributes':['id',_0x0caa('0x3a'),_0x0caa('0xf6'),_0x0caa('0xf7'),_0x0caa('0x2c'),_0x0caa('0x67'),'loginInPause']})[_0x0caa('0x15')](function(_0x30c8df){if(_0x30c8df){if(_0x30c8df['role']===_0x0caa('0x31')){_0x51777b=_0x30c8df;if(_0x5a736c['body'][_0x0caa('0xa9')]){_0x2e423e=util[_0x0caa('0xf8')](_0x0caa('0xf9'),_0x51777b[_0x5a736c[_0x0caa('0x61')][_0x0caa('0xa9')]]);}else if(_0x5a736c['body'][_0x0caa('0xfa')]){_0x2e423e=util[_0x0caa('0xf8')]('SIP/%s',_0x5a736c['body'][_0x0caa('0xfa')]);}else{_0x2e423e=util[_0x0caa('0xf8')](_0x0caa('0xfb'),_0x51777b[_0x0caa('0x3a')]);}socket['to'](util[_0x0caa('0xf8')]('user:%s',_0x51777b['name']))[_0x0caa('0x29')](_0x0caa('0xfc'),{'user':{'id':_0x51777b['id'],'name':_0x51777b[_0x0caa('0x3a')]},'ip':_0x5a736c[_0x0caa('0xfd')][_0x0caa('0xfe')]||_0x5a736c['connection'][_0x0caa('0xff')]||_0x5a736c['socket'][_0x0caa('0xff')]||_0x5a736c[_0x0caa('0x100')][_0x0caa('0x101')][_0x0caa('0xff')]});return db[_0x0caa('0xb4')][_0x0caa('0x2a')]({'where':{'membername':_0x51777b[_0x0caa('0x3a')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x0caa('0x98'))](_0x0caa('0x102'));}})['then'](function(){if(_0x51777b){return _0x51777b[_0x0caa('0x103')]({'raw':!![]});}})[_0x0caa('0x15')](function(_0x5749f2){if(_0x51777b){if(_0x5749f2){_0x3f6974=_0x5749f2;if(_0x3f6974['length']){var _0x24fb94=_0x3f6974['map'](function(_0x4cacca){var _0x116d05={'membername':_0x51777b[_0x0caa('0x3a')],'UserId':_0x51777b['id'],'queue_name':_0x4cacca['name'],'VoiceQueueId':_0x4cacca['id'],'interface':_0x2e423e,'paused':_0x51777b[_0x0caa('0xa7')]||![],'penalty':_0x4cacca[_0x0caa('0x104')]||0x0};return db[_0x0caa('0xb4')][_0x0caa('0xb5')](_0x116d05);});return Promise[_0x0caa('0x56')](_0x24fb94);}}}})[_0x0caa('0x15')](function(){if(_0x51777b){return db[_0x0caa('0x105')][_0x0caa('0x4d')]({'where':{'membername':_0x51777b[_0x0caa('0x3a')],'exitAt':null}});}})[_0x0caa('0x15')](function(_0x56c442){if(_0x51777b){var _0xe7dffe=[];_0x56c442[_0x0caa('0x106')](function(_0x42c25c){_0xe7dffe[_0x0caa('0x4c')](_0x42c25c['update']({'exitAt':moment()[_0x0caa('0xf8')](_0x0caa('0x107'))}));});return Promise[_0x0caa('0x56')](_0xe7dffe);}})[_0x0caa('0x15')](function(){if(_0x51777b){var _0x487edf=[];var _0x486845=[];var _0x11d360=utils[_0x0caa('0x108')]();var _0x3090da={'membername':_0x51777b['name'],'interface':_0x2e423e,'enterAt':moment()[_0x0caa('0xf8')](_0x0caa('0x107')),'role':_0x51777b[_0x0caa('0x2c')],'internal':_0x51777b[_0x0caa('0x67')]};_0x11d360[_0x0caa('0x106')](function(_0x26cc89){_0x487edf[_0x0caa('0x4c')](_['merge']({'channel':_0x26cc89,'type':_0x0caa('0x109'),'data1':_0x5a736c[_0x0caa('0x61')]['device'],'data2':_0x2e423e},_0x3090da));if(_0x51777b[_0x0caa('0xa7')]){_0x486845['push'](_['merge']({'channel':_0x26cc89,'type':_0x0caa('0x10a'),'data1':_0x0caa('0x10b')},_0x3090da));}});return db[_0x0caa('0x105')][_0x0caa('0x90')](_0x487edf[_0x0caa('0xd1')](_0x486845),{'individualHooks':!![]});}})[_0x0caa('0x15')](function(){if(_0x51777b){return _0x51777b[_0x0caa('0x28')]({'online':!![],'lastLoginAt':moment()[_0x0caa('0xf8')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x51777b[_0x0caa('0xa7')]||![],'mailPause':_0x51777b[_0x0caa('0xa7')]||![],'chatPause':_0x51777b[_0x0caa('0xa7')]||![],'faxPause':_0x51777b['loginInPause']||![],'smsPause':_0x51777b[_0x0caa('0xa7')]||![],'openchannelPause':_0x51777b['loginInPause']||![],'whatsappPause':_0x51777b[_0x0caa('0xa7')]||![],'pauseType':_0x51777b[_0x0caa('0xa7')]?_0x0caa('0x10b'):null,'interface':_0x2e423e,'lastPauseAt':moment()[_0x0caa('0xf8')](_0x0caa('0x107'))});}})[_0x0caa('0x15')](function(_0x20e4e5){if(_0x5a736c[_0x0caa('0x10c')]){return _0x4e8d0a();}else{return Promise[_0x0caa('0x10d')](_0x20e4e5)['then'](respondWithResult(_0x20db6d,null));}})[_0x0caa('0x1f')](handleError(_0x20db6d,null));};exports['logout']=function(_0x20eed3,_0x17965a){var _0x3bac45;return db['User'][_0x0caa('0x37')]({'where':{'id':_0x20eed3['params']['id'],'role':_0x0caa('0x31')},'attributes':['id','name','role']})[_0x0caa('0x15')](handleEntityNotFound(_0x17965a,null))[_0x0caa('0x15')](function(_0xef1f62){if(_0xef1f62){_0x3bac45=_0xef1f62;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x3bac45['name']},'individualHooks':!![]});}})['then'](function(){return db[_0x0caa('0x105')][_0x0caa('0x4d')]({'where':{'membername':_0x3bac45[_0x0caa('0x3a')],'exitAt':null}});})[_0x0caa('0x15')](function(_0x2b2fa0){var _0x69b148=[];_0x2b2fa0['forEach'](function(_0x561ee6){_0x69b148['push'](_0x561ee6[_0x0caa('0x28')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x0caa('0x56')](_0x69b148);})[_0x0caa('0x15')](function(){return _0x3bac45[_0x0caa('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x0caa('0x15')](respondWithResult(_0x17965a,null))[_0x0caa('0x1f')](handleError(_0x17965a,null));};exports[_0x0caa('0x10e')]=function(_0x90b8f,_0x1015b3){var _0x2e06b5;return db[_0x0caa('0xb4')][_0x0caa('0x28')]({'paused':0x1},{'where':{'UserId':_0x90b8f[_0x0caa('0x62')]['id']},'individualHooks':!![]})[_0x0caa('0x15')](function(){return db[_0x0caa('0x3d')]['find']({'where':{'id':_0x90b8f['params']['id'],'role':'agent'},'attributes':['id',_0x0caa('0x3a'),'role',_0x0caa('0x67'),_0x0caa('0xa9'),_0x0caa('0xa6')]});})[_0x0caa('0x15')](handleEntityNotFound(_0x1015b3,null))['then'](function(_0x3dfd36){if(_0x3dfd36){_0x2e06b5=_0x3dfd36;return respondWithRpcPromise(_0x0caa('0x10f'),_0x0caa('0x10e'),{'id':_0x2e06b5['id'],'name':_0x2e06b5[_0x0caa('0x3a')],'pause':!![]});}})[_0x0caa('0x15')](function(){if(_0x2e06b5){return db[_0x0caa('0x105')][_0x0caa('0x4d')]({'where':{'membername':_0x2e06b5[_0x0caa('0x3a')],'type':'PAUSE','exitAt':null}});}})[_0x0caa('0x15')](function(_0xd4873d){if(_0xd4873d['length']){var _0x12486a=moment()['format'](_0x0caa('0x107'));for(var _0x1b2447=0x0,_0x24311f=_0xd4873d[_0x0caa('0x50')];_0x1b2447<_0x24311f;_0x1b2447++){_0xd4873d[_0x1b2447][_0x0caa('0x110')]({'exitAt':_0x12486a});}}})[_0x0caa('0x15')](function(){var _0x37b3fa=[];var _0x5320d4=utils[_0x0caa('0x108')]();_0x5320d4[_0x0caa('0x106')](function(_0x672038){_0x37b3fa[_0x0caa('0x4c')]({'channel':_0x672038,'membername':_0x2e06b5['name'],'interface':_['isNil'](_0x2e06b5[_0x0caa('0xa9')])?util['format'](_0x0caa('0xfb'),_0x2e06b5['name']):_0x2e06b5[_0x0caa('0xa9')],'type':_0x0caa('0x10a'),'enterAt':moment()[_0x0caa('0xf8')](_0x0caa('0x107')),'data1':_0x90b8f[_0x0caa('0x61')][_0x0caa('0x40')]||_0x0caa('0x111'),'role':_0x2e06b5[_0x0caa('0x2c')],'internal':_0x2e06b5[_0x0caa('0x67')]});});return db[_0x0caa('0x105')][_0x0caa('0x90')](_0x37b3fa,{'individualHooks':!![]});})[_0x0caa('0x15')](function(){return _0x2e06b5[_0x0caa('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x90b8f['body'][_0x0caa('0x40')]||_0x0caa('0x111'),'lastPauseAt':moment()[_0x0caa('0xf8')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x0caa('0x15')](respondWithResult(_0x1015b3,null))[_0x0caa('0x1f')](handleError(_0x1015b3,null));};exports[_0x0caa('0x112')]=function(_0xf70d64,_0x58ca15){if(_0xf70d64['body']['channel']&&!utils[_0x0caa('0xaa')](_0xf70d64['body']['channel'])){throw new APIBadRequestError(util[_0x0caa('0xf8')](_0x0caa('0x113'),_0xf70d64[_0x0caa('0x61')]['channel']));}return db[_0x0caa('0x3d')][_0x0caa('0x37')]({'where':{'id':_0xf70d64['params']['id']},'attributes':['id',_0x0caa('0x3a'),_0x0caa('0x2c'),_0x0caa('0x67'),_0x0caa('0xa9'),'online',_0x0caa('0xa8'),_0x0caa('0x114'),'chatPause',_0x0caa('0x115'),_0x0caa('0x116'),_0x0caa('0x117'),_0x0caa('0x118'),_0x0caa('0x119'),_0x0caa('0x11a')]})[_0x0caa('0x15')](function(_0x2dc1e4){if(!_0x2dc1e4){throw new APINotFoundError(util[_0x0caa('0xf8')](_0x0caa('0x11b'),_0xf70d64[_0x0caa('0x62')]['id']));}return _0x2dc1e4[_0x0caa('0x112')](_0xf70d64[_0x0caa('0x61')]['channel']);})[_0x0caa('0x15')](respondWithResult(_0x58ca15,null))[_0x0caa('0x1f')](APIHandleError(_0x58ca15));};exports[_0x0caa('0x11c')]=function(_0x468e62,_0x5a1e46){var _0x2d44b1={};var _0x25786a={};var _0x18a3b4;var _0x17f9f2;return db['User'][_0x0caa('0x9f')]({'where':{'id':_0x468e62[_0x0caa('0x62')]['id']}})['then'](handleEntityNotFound(_0x5a1e46,null))[_0x0caa('0x15')](function(_0x3d3147){if(_0x3d3147){_0x18a3b4=_0x3d3147;_0x25786a['model']=_[_0x0caa('0xd3')](db[_0x0caa('0x11d')][_0x0caa('0x3e')]);_0x25786a[_0x0caa('0x45')]=_[_0x0caa('0xd3')](_0x468e62[_0x0caa('0x45')]);_0x25786a[_0x0caa('0x5a')]=_[_0x0caa('0x5b')](_0x25786a['model'],_0x25786a[_0x0caa('0x45')]);_0x2d44b1[_0x0caa('0x4b')]=_[_0x0caa('0x5b')](_0x25786a['model'],qs[_0x0caa('0x5c')](_0x468e62[_0x0caa('0x45')]['fields']));_0x2d44b1['attributes']=_0x2d44b1['attributes'][_0x0caa('0x50')]?_0x2d44b1[_0x0caa('0x4b')]:_0x25786a['model'];_0x2d44b1[_0x0caa('0xd5')]=qs[_0x0caa('0xd6')](_0x468e62['query'][_0x0caa('0xd6')]);_0x2d44b1[_0x0caa('0x44')]=qs['filters'](_[_0x0caa('0xd7')](_0x468e62[_0x0caa('0x45')],_0x25786a['filters']));if(_0x468e62[_0x0caa('0x45')]['filter']){_0x2d44b1[_0x0caa('0x44')]=_['merge'](_0x2d44b1[_0x0caa('0x44')],{'$or':_[_0x0caa('0x35')](_0x2d44b1['attributes'],function(_0x11eea0){var _0x53980d={};_0x53980d[_0x11eea0]={'$like':'%'+_0x468e62[_0x0caa('0x45')][_0x0caa('0x33')]+'%'};return _0x53980d;})});}_0x2d44b1=_[_0x0caa('0x5d')]({},_0x2d44b1,_0x468e62['options']);return _0x18a3b4[_0x0caa('0x11c')](_0x2d44b1);}})[_0x0caa('0x15')](function(_0x231f0d){if(_0x231f0d){_0x17f9f2=_0x231f0d[_0x0caa('0x50')];if(!_0x468e62['query']['hasOwnProperty'](_0x0caa('0xdf'))){_0x2d44b1[_0x0caa('0x25')]=qs[_0x0caa('0x25')](_0x468e62[_0x0caa('0x45')]['limit']);_0x2d44b1['offset']=qs['offset'](_0x468e62[_0x0caa('0x45')][_0x0caa('0x23')]);}return _0x18a3b4['getTeams'](_0x2d44b1);}})[_0x0caa('0x15')](function(_0x34eb8b){if(_0x34eb8b){return _0x34eb8b?{'count':_0x17f9f2,'rows':_0x34eb8b}:null;}})['then'](respondWithResult(_0x5a1e46,null))[_0x0caa('0x1f')](handleError(_0x5a1e46,null));};exports[_0x0caa('0x11e')]=function(_0x2aa00c,_0x86df9c){var _0x3ca545=_0x2aa00c[_0x0caa('0x62')]['id'];var _0x3a11c4=_0x2aa00c[_0x0caa('0x61')]?_0x2aa00c[_0x0caa('0x61')]['ids']:null;var _0x42b678=[];return Promise[_0x0caa('0x10d')]()[_0x0caa('0x15')](function(){if(!_0x3a11c4)throw new APIBadRequestError(_0x0caa('0x11f'));})['then'](function(){return db[_0x0caa('0x3d')][_0x0caa('0x9f')]({'where':{'id':_0x3ca545}});})[_0x0caa('0x15')](function(_0x50b2bd){if(!_0x50b2bd)throw new APINotFoundError(util[_0x0caa('0xf8')](_0x0caa('0x11b'),_0x2aa00c[_0x0caa('0x62')]['id']));return db[_0x0caa('0x6d')][_0x0caa('0x120')](function(_0x205f58){return _0x50b2bd['addTeams'](_0x3a11c4,{'transaction':_0x205f58})[_0x0caa('0x15')](function(){return db['Team'][_0x0caa('0x4d')]({'where':{'id':{'$in':_0x3a11c4}}});})['then'](function(_0x245746){var _0x21cd33=_[_0x0caa('0x35')](_0x245746,function(_0x1f17c9){return _0x1f17c9['getAssociatedQueues']();});return Promise[_0x0caa('0x56')](_0x21cd33);})[_0x0caa('0x15')](function(_0x67d354){_0x42b678=_[_0x0caa('0x121')](_0x67d354);var _0x91425f=_[_0x0caa('0x35')](_0x42b678,function(_0x12b819){return _0x12b819[_0x0caa('0x122')](_0x50b2bd['id'],{'transaction':_0x205f58});});return Promise[_0x0caa('0x56')](_0x91425f);})['then'](function(){if(!_0x50b2bd[_0x0caa('0xa6')])return;var _0x5ec1db=_[_0x0caa('0x33')](_0x42b678,function(_0x1ae68f){return _0x1ae68f[_0x0caa('0x123')](_0x0caa('0xa5'))===_0x0caa('0x124');});var _0x5671aa=_[_0x0caa('0x35')](_0x5ec1db,function(_0x1216ab){return db[_0x0caa('0xb4')]['upsert']({'membername':_0x50b2bd['name'],'UserId':_0x50b2bd['id'],'queue_name':_0x1216ab[_0x0caa('0x3a')],'VoiceQueueId':_0x1216ab['id'],'interface':_['isNil'](_0x50b2bd[_0x0caa('0xa9')])?util[_0x0caa('0xf8')]('SIP/%s',_0x50b2bd['name']):_0x50b2bd[_0x0caa('0xa9')],'paused':_0x50b2bd[_0x0caa('0xa8')]||![],'penalty':_0x50b2bd[_0x0caa('0xb3')]},{'transaction':_0x205f58});});return Promise['all'](_0x5671aa);})['then'](function(){return db[_0x0caa('0x125')][_0x0caa('0x4d')]({'where':{'teamId':{'$in':_0x3a11c4}}});})[_0x0caa('0x15')](function(_0x48c892){var _0x5354a3=_[_0x0caa('0x35')](_0x48c892,function(_0x3595eb){return db[_0x0caa('0x126')][_0x0caa('0x86')]({'UserId':_0x50b2bd['id'],'VoicePrefixId':_0x3595eb[_0x0caa('0x127')]},{'transaction':_0x205f58});});return Promise[_0x0caa('0x56')](_0x5354a3);});});})['then'](function(){for(var _0x58ba19=0x0;_0x58ba19<_0x42b678[_0x0caa('0x50')];_0x58ba19++){var _0x49f0aa=_0x42b678[_0x58ba19][_0x0caa('0x123')](_0x0caa('0xa5'));var _0x3c0121=_0x49f0aa+_0x0caa('0x128');socket['emit'](_0x0caa('0x2f')+_0x49f0aa+_0x0caa('0xb0'),{'UserId':_0x3ca545,['queueField']:_0x42b678[_0x58ba19]['id']});}})[_0x0caa('0x15')](respondWithStatusCode(_0x86df9c,null))[_0x0caa('0x1f')](APIHandleError(_0x86df9c));};exports[_0x0caa('0x129')]=function(_0xa60908,_0x445f55){var _0x228172=_0xa60908[_0x0caa('0x62')]['id'];var _0x5ca4fa=null;if(_0xa60908[_0x0caa('0x45')]['ids']){_0x5ca4fa=_[_0x0caa('0xb8')](_0xa60908[_0x0caa('0x45')][_0x0caa('0x65')])?_0xa60908['query'][_0x0caa('0x65')]:[_0xa60908['query'][_0x0caa('0x65')]];}var _0x1c6a6b=[];return Promise[_0x0caa('0x10d')]()[_0x0caa('0x15')](function(){if(!_0x5ca4fa)throw new APIBadRequestError(_0x0caa('0x12a'));})[_0x0caa('0x15')](function(){return db[_0x0caa('0x3d')][_0x0caa('0x9f')]({'where':{'id':_0x228172}});})[_0x0caa('0x15')](function(_0x55f249){if(!_0x55f249)throw new APINotFoundError(util['format'](_0x0caa('0x11b'),_0xa60908['params']['id']));return db[_0x0caa('0x6d')][_0x0caa('0x120')](function(_0x1cbf25){return _0x55f249[_0x0caa('0x129')](_0x5ca4fa,{'transaction':_0x1cbf25})[_0x0caa('0x15')](function(){return db[_0x0caa('0x11d')][_0x0caa('0x4d')]({'where':{'id':{'$in':_0x5ca4fa}}});})[_0x0caa('0x15')](function(_0x181f46){var _0x322d2f=_['map'](_0x181f46,function(_0x5a0b3b){return _0x5a0b3b[_0x0caa('0x12b')]();});return Promise[_0x0caa('0x56')](_0x322d2f);})[_0x0caa('0x15')](function(_0x14d855){_0x1c6a6b=_[_0x0caa('0x121')](_0x14d855);var _0x269f8e=_['map'](_0x1c6a6b,function(_0x2eaecb){return _0x2eaecb[_0x0caa('0x12c')](_0x55f249['id'],{'transaction':_0x1cbf25});});return Promise[_0x0caa('0x56')](_0x269f8e);})['then'](function(){if(!_0x55f249[_0x0caa('0xa6')])return;var _0x2fffeb=_[_0x0caa('0x33')](_0x1c6a6b,function(_0x217616){return _0x217616[_0x0caa('0x123')](_0x0caa('0xa5'))===_0x0caa('0x124');});var _0x1a6180=_[_0x0caa('0x35')](_0x2fffeb,function(_0x3547c2){return db[_0x0caa('0xb4')][_0x0caa('0x2a')]({'where':{'VoiceQueueId':_0x3547c2['id'],'UserId':_0x55f249['id']},'transaction':_0x1cbf25});});return Promise[_0x0caa('0x56')](_0x1a6180);})[_0x0caa('0x15')](function(){return db['TeamVoicePrefix'][_0x0caa('0x4d')]({'where':{'teamId':{'$in':_0x5ca4fa}}});})['then'](function(_0x7ba50d){var _0x162b91=_[_0x0caa('0x35')](_0x7ba50d,function(_0x37a7d5){return db[_0x0caa('0x126')][_0x0caa('0x2a')]({'where':{'UserId':_0x55f249['id'],'VoicePrefixId':_0x37a7d5[_0x0caa('0x127')]}},{'transaction':_0x1cbf25});});return Promise[_0x0caa('0x56')](_0x162b91);});});})[_0x0caa('0x15')](function(){for(var _0x50d472=0x0;_0x50d472<_0x1c6a6b[_0x0caa('0x50')];_0x50d472++){var _0x456630=_0x1c6a6b[_0x50d472]['getDataValue']('channel');var _0x1472be=_0x456630+_0x0caa('0x128');socket['emit'](_0x0caa('0x2f')+_0x456630+_0x0caa('0xb9'),{'UserId':_0x228172,['queueField']:_0x1c6a6b[_0x50d472]['id']});}})[_0x0caa('0x15')](respondWithStatusCode(_0x445f55,null))[_0x0caa('0x1f')](APIHandleError(_0x445f55));};exports[_0x0caa('0x12d')]=function(_0x5c114d,_0x325c8f){var _0x4b113b={};var _0x4e1d55={};var _0xb4ac53;var _0x8c67b5;return db[_0x0caa('0x3d')][_0x0caa('0x9f')]({'where':{'id':_0x5c114d[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x325c8f,null))[_0x0caa('0x15')](function(_0x5b3b05){if(_0x5b3b05){_0xb4ac53=_0x5b3b05;_0x4e1d55[_0x0caa('0x58')]=_[_0x0caa('0xd3')](db['CmList'][_0x0caa('0x3e')]);_0x4e1d55[_0x0caa('0x45')]=_[_0x0caa('0xd3')](_0x5c114d['query']);_0x4e1d55[_0x0caa('0x5a')]=_[_0x0caa('0x5b')](_0x4e1d55[_0x0caa('0x58')],_0x4e1d55[_0x0caa('0x45')]);_0x4b113b[_0x0caa('0x4b')]=_[_0x0caa('0x5b')](_0x4e1d55[_0x0caa('0x58')],qs[_0x0caa('0x5c')](_0x5c114d[_0x0caa('0x45')][_0x0caa('0x5c')]));_0x4b113b['attributes']=_0x4b113b[_0x0caa('0x4b')][_0x0caa('0x50')]?_0x4b113b['attributes']:_0x4e1d55[_0x0caa('0x58')];_0x4b113b[_0x0caa('0xd5')]=qs[_0x0caa('0xd6')](_0x5c114d['query']['sort']);_0x4b113b[_0x0caa('0x44')]=qs[_0x0caa('0x5a')](_[_0x0caa('0xd7')](_0x5c114d['query'],_0x4e1d55[_0x0caa('0x5a')]));if(_0x5c114d['query']['filter']){_0x4b113b[_0x0caa('0x44')]=_[_0x0caa('0x5d')](_0x4b113b[_0x0caa('0x44')],{'$or':_[_0x0caa('0x35')](_0x4b113b['attributes'],function(_0x4bab4d){var _0xa08f28={};_0xa08f28[_0x4bab4d]={'$like':'%'+_0x5c114d['query'][_0x0caa('0x33')]+'%'};return _0xa08f28;})});}_0x4b113b=_[_0x0caa('0x5d')]({},_0x4b113b,_0x5c114d[_0x0caa('0x5e')]);return _0xb4ac53[_0x0caa('0x12d')](_0x4b113b);}})[_0x0caa('0x15')](function(_0x3d5539){if(_0x3d5539){_0x8c67b5=_0x3d5539['length'];if(!_0x5c114d[_0x0caa('0x45')]['hasOwnProperty']('nolimit')){_0x4b113b[_0x0caa('0x25')]=qs['limit'](_0x5c114d[_0x0caa('0x45')][_0x0caa('0x25')]);_0x4b113b['offset']=qs['offset'](_0x5c114d[_0x0caa('0x45')]['offset']);}return _0xb4ac53[_0x0caa('0x12d')](_0x4b113b);}})[_0x0caa('0x15')](function(_0x7b5812){if(_0x7b5812){return _0x7b5812?{'count':_0x8c67b5,'rows':_0x7b5812}:null;}})['then'](respondWithResult(_0x325c8f,null))['catch'](handleError(_0x325c8f,null));};exports[_0x0caa('0x12e')]=function(_0x374f9f,_0x191f0b){var _0x58f634={};var _0x2c04f0={};var _0x2fc907;return db[_0x0caa('0x3d')][_0x0caa('0x9f')]({'where':{'id':_0x374f9f[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x191f0b,null))[_0x0caa('0x15')](function(_0x40dbd0){if(_0x40dbd0){_0x2fc907=_0x40dbd0;_0x2c04f0[_0x0caa('0x58')]=_[_0x0caa('0xd3')](db['User'][_0x0caa('0x3e')]);_0x2c04f0[_0x0caa('0x45')]=_[_0x0caa('0xd3')](_0x374f9f[_0x0caa('0x45')]);_0x2c04f0['filters']=_[_0x0caa('0x5b')](_0x2c04f0[_0x0caa('0x58')],_0x2c04f0[_0x0caa('0x45')]);_0x58f634[_0x0caa('0x4b')]=_[_0x0caa('0x5b')](_0x2c04f0[_0x0caa('0x58')],qs['fields'](_0x374f9f[_0x0caa('0x45')]['fields']));_0x58f634[_0x0caa('0x4b')]=_0x58f634['attributes']['length']?_0x58f634[_0x0caa('0x4b')]:_0x2c04f0['model'];_0x58f634[_0x0caa('0xd5')]=qs[_0x0caa('0xd6')](_0x374f9f['query'][_0x0caa('0xd6')]);_0x58f634[_0x0caa('0x44')]=qs[_0x0caa('0x5a')](_[_0x0caa('0xd7')](_0x374f9f[_0x0caa('0x45')],_0x2c04f0[_0x0caa('0x5a')]));if(_0x374f9f['query'][_0x0caa('0x33')]){_0x58f634[_0x0caa('0x44')]=_[_0x0caa('0x5d')](_0x58f634[_0x0caa('0x44')],{'$or':_[_0x0caa('0x35')](_0x58f634['attributes'],function(_0x516467){var _0x49f221={};_0x49f221[_0x516467]={'$like':'%'+_0x374f9f[_0x0caa('0x45')][_0x0caa('0x33')]+'%'};return _0x49f221;})});}_0x58f634[_0x0caa('0x58')]=db[_0x0caa('0x3d')];_0x58f634['as']='Agents';_0x58f634=_['merge']({},_0x58f634,_0x374f9f[_0x0caa('0x5e')]);return _0x2fc907['getVoiceQueues']({'include':[_0x58f634]});}})[_0x0caa('0x15')](function(_0x151578){if(_0x151578){var _0x225851={},_0x57c2bb=[];for(var _0x4d1a00=0x0;_0x4d1a00<_0x151578[_0x0caa('0x50')];_0x4d1a00+=0x1){for(var _0x41606e=0x0,_0x5d0d12;_0x41606e<_0x151578[_0x4d1a00][_0x0caa('0x30')]['length'];_0x41606e+=0x1){_0x5d0d12=_0x151578[_0x4d1a00][_0x0caa('0x30')][_0x41606e][_0x0caa('0x2b')]({'plain':!![]});_0x225851[_0x5d0d12['id']]=_0x5d0d12;}}_0x225851=_[_0x0caa('0x12f')](_0x225851);for(var _0xa93dde=qs[_0x0caa('0x23')](_0x374f9f[_0x0caa('0x45')][_0x0caa('0x23')]);_0xa93dde<_0x225851[_0x0caa('0x50')]&&_0x57c2bb['length']<qs['limit'](_0x374f9f['query'][_0x0caa('0x25')]);_0xa93dde+=0x1){if(_0x225851[_0xa93dde]){_0x57c2bb[_0x0caa('0x4c')](_0x225851[_0xa93dde]);}}return{'count':_0x225851[_0x0caa('0x50')],'rows':_0x57c2bb};}})[_0x0caa('0x15')](respondWithResult(_0x191f0b,null))[_0x0caa('0x1f')](handleError(_0x191f0b,null));};exports[_0x0caa('0x2a')]=function(_0x4b2a0d,_0x584e27){if(_0x4b2a0d[_0x0caa('0x2f')]['id']==_0x4b2a0d[_0x0caa('0x62')]['id']){return _0x584e27[_0x0caa('0x21')](0x1f4)[_0x0caa('0x3b')]({'message':_0x0caa('0x130')});}return db['User']['find']({'where':{'id':_0x4b2a0d[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x584e27,null))['then'](removeEntity(_0x584e27,null))[_0x0caa('0x1f')](handleError(_0x584e27,null));};exports[_0x0caa('0x131')]=function(_0x3721fe,_0x1a01ad){return db[_0x0caa('0x3d')][_0x0caa('0x37')]({'where':{'id':_0x3721fe[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x1a01ad,null))[_0x0caa('0x15')](function(_0x1a1a5c){if(_0x1a1a5c){return _0x1a1a5c[_0x0caa('0x131')](_0x3721fe[_0x0caa('0x61')][_0x0caa('0x65')],_['omit'](_0x3721fe['body'],[_0x0caa('0x65'),'id'])||{})[_0x0caa('0xae')](function(){for(var _0x336607=0x0;_0x336607<_0x3721fe[_0x0caa('0x61')][_0x0caa('0x65')][_0x0caa('0x50')];_0x336607+=0x1){socket[_0x0caa('0x29')](_0x0caa('0x132'),{'ChatInteractionId':Number(_0x3721fe['body'][_0x0caa('0x65')][_0x336607]),'UserId':Number(_0x3721fe[_0x0caa('0x62')]['id'])});}return _0x3721fe[_0x0caa('0x61')]['ids'];});}})[_0x0caa('0x15')](respondWithResult(_0x1a01ad,null))[_0x0caa('0x1f')](handleError(_0x1a01ad,null));};exports['removeChatInteractions']=function(_0x436a0c,_0x3bf794){return db[_0x0caa('0x3d')][_0x0caa('0x37')]({'where':{'id':_0x436a0c['params']['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x3bf794,null))[_0x0caa('0x15')](function(_0x5e7de3){if(_0x5e7de3){return _0x5e7de3[_0x0caa('0x133')](_0x436a0c[_0x0caa('0x45')][_0x0caa('0x65')])[_0x0caa('0x15')](function(){if(_[_0x0caa('0xb8')](_0x436a0c[_0x0caa('0x45')][_0x0caa('0x65')])){for(var _0x1b628d=0x0;_0x1b628d<_0x436a0c['query'][_0x0caa('0x65')][_0x0caa('0x50')];_0x1b628d+=0x1){socket['emit'](_0x0caa('0x134'),{'ChatInteractionId':Number(_0x436a0c['query']['ids'][_0x1b628d]),'UserId':Number(_0x436a0c[_0x0caa('0x62')]['id'])});}}else{socket['emit'](_0x0caa('0x134'),{'ChatInteractionId':Number(_0x436a0c[_0x0caa('0x45')]['ids']),'UserId':Number(_0x436a0c[_0x0caa('0x62')]['id'])});}});}})[_0x0caa('0x15')](respondWithStatusCode(_0x3bf794,null))[_0x0caa('0x1f')](handleError(_0x3bf794,null));};exports[_0x0caa('0x135')]=function(_0x670cbd,_0x504a2f){return db[_0x0caa('0x3d')][_0x0caa('0x37')]({'where':{'id':_0x670cbd[_0x0caa('0x62')]['id']}})['then'](handleEntityNotFound(_0x504a2f,null))[_0x0caa('0x15')](function(_0x34577e){if(_0x34577e){return _0x34577e[_0x0caa('0x135')](_0x670cbd[_0x0caa('0x61')][_0x0caa('0x65')],_[_0x0caa('0x66')](_0x670cbd[_0x0caa('0x61')],['ids','id'])||{})['spread'](function(){for(var _0x25c52a=0x0;_0x25c52a<_0x670cbd[_0x0caa('0x61')]['ids']['length'];_0x25c52a+=0x1){socket[_0x0caa('0x29')](_0x0caa('0x136'),{'MailInteractionId':Number(_0x670cbd['body'][_0x0caa('0x65')][_0x25c52a]),'UserId':Number(_0x670cbd[_0x0caa('0x62')]['id'])});}return _0x670cbd['body'][_0x0caa('0x65')];});}})['then'](respondWithResult(_0x504a2f,null))[_0x0caa('0x1f')](handleError(_0x504a2f,null));};exports['removeMailInteractions']=function(_0x102ae7,_0x355409){return db[_0x0caa('0x3d')][_0x0caa('0x37')]({'where':{'id':_0x102ae7[_0x0caa('0x62')]['id']}})['then'](handleEntityNotFound(_0x355409,null))['then'](function(_0x4f69d7){if(_0x4f69d7){return _0x4f69d7[_0x0caa('0x137')](_0x102ae7['query']['ids'])[_0x0caa('0x15')](function(){if(_[_0x0caa('0xb8')](_0x102ae7[_0x0caa('0x45')][_0x0caa('0x65')])){for(var _0x25eec1=0x0;_0x25eec1<_0x102ae7[_0x0caa('0x45')][_0x0caa('0x65')][_0x0caa('0x50')];_0x25eec1+=0x1){socket['emit'](_0x0caa('0x138'),{'MailInteractionId':Number(_0x102ae7[_0x0caa('0x45')]['ids'][_0x25eec1]),'UserId':Number(_0x102ae7[_0x0caa('0x62')]['id'])});}}else{socket[_0x0caa('0x29')](_0x0caa('0x138'),{'MailInteractionId':Number(_0x102ae7[_0x0caa('0x45')][_0x0caa('0x65')]),'UserId':Number(_0x102ae7[_0x0caa('0x62')]['id'])});}});}})['then'](respondWithStatusCode(_0x355409,null))['catch'](handleError(_0x355409,null));};exports['addFaxInteractions']=function(_0x1eb341,_0x476314){return db[_0x0caa('0x3d')][_0x0caa('0x37')]({'where':{'id':_0x1eb341[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x476314,null))['then'](function(_0x5b4631){if(_0x5b4631){return _0x5b4631[_0x0caa('0x139')](_0x1eb341[_0x0caa('0x61')][_0x0caa('0x65')],_[_0x0caa('0x66')](_0x1eb341[_0x0caa('0x61')],[_0x0caa('0x65'),'id'])||{})[_0x0caa('0xae')](function(){for(var _0x5c6392=0x0;_0x5c6392<_0x1eb341['body'][_0x0caa('0x65')]['length'];_0x5c6392+=0x1){socket[_0x0caa('0x29')](_0x0caa('0x13a'),{'FaxInteractionId':Number(_0x1eb341[_0x0caa('0x61')][_0x0caa('0x65')][_0x5c6392]),'UserId':Number(_0x1eb341[_0x0caa('0x62')]['id'])});}return _0x1eb341[_0x0caa('0x61')][_0x0caa('0x65')];});}})[_0x0caa('0x15')](respondWithResult(_0x476314,null))[_0x0caa('0x1f')](handleError(_0x476314,null));};exports[_0x0caa('0x13b')]=function(_0x302327,_0x38d9a7){return db[_0x0caa('0x3d')]['find']({'where':{'id':_0x302327['params']['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x38d9a7,null))[_0x0caa('0x15')](function(_0x474c42){if(_0x474c42){return _0x474c42[_0x0caa('0x13b')](_0x302327[_0x0caa('0x45')][_0x0caa('0x65')])[_0x0caa('0x15')](function(){if(_[_0x0caa('0xb8')](_0x302327[_0x0caa('0x45')][_0x0caa('0x65')])){for(var _0x4d36b4=0x0;_0x4d36b4<_0x302327[_0x0caa('0x45')][_0x0caa('0x65')][_0x0caa('0x50')];_0x4d36b4+=0x1){socket[_0x0caa('0x29')](_0x0caa('0x13c'),{'FaxInteractionId':Number(_0x302327[_0x0caa('0x45')][_0x0caa('0x65')][_0x4d36b4]),'UserId':Number(_0x302327['params']['id'])});}}else{socket['emit'](_0x0caa('0x13c'),{'FaxInteractionId':Number(_0x302327[_0x0caa('0x45')][_0x0caa('0x65')]),'UserId':Number(_0x302327[_0x0caa('0x62')]['id'])});}});}})['then'](respondWithStatusCode(_0x38d9a7,null))[_0x0caa('0x1f')](handleError(_0x38d9a7,null));};exports['addSmsInteractions']=function(_0xa51106,_0x4045f7){return db[_0x0caa('0x3d')][_0x0caa('0x37')]({'where':{'id':_0xa51106['params']['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x4045f7,null))[_0x0caa('0x15')](function(_0x7beab9){if(_0x7beab9){return _0x7beab9[_0x0caa('0x13d')](_0xa51106['body'][_0x0caa('0x65')],_['omit'](_0xa51106[_0x0caa('0x61')],[_0x0caa('0x65'),'id'])||{})[_0x0caa('0xae')](function(){for(var _0x422805=0x0;_0x422805<_0xa51106[_0x0caa('0x61')]['ids'][_0x0caa('0x50')];_0x422805+=0x1){socket[_0x0caa('0x29')]('user_has_sms_interactions:save',{'SmsInteractionId':Number(_0xa51106[_0x0caa('0x61')][_0x0caa('0x65')][_0x422805]),'UserId':Number(_0xa51106[_0x0caa('0x62')]['id'])});}return _0xa51106[_0x0caa('0x61')][_0x0caa('0x65')];});}})['then'](respondWithResult(_0x4045f7,null))[_0x0caa('0x1f')](handleError(_0x4045f7,null));};exports[_0x0caa('0x13e')]=function(_0x5e05f5,_0x5c6f36){return db[_0x0caa('0x3d')][_0x0caa('0x37')]({'where':{'id':_0x5e05f5[_0x0caa('0x62')]['id']}})['then'](handleEntityNotFound(_0x5c6f36,null))[_0x0caa('0x15')](function(_0x5da5e7){if(_0x5da5e7){return _0x5da5e7[_0x0caa('0x13e')](_0x5e05f5[_0x0caa('0x45')]['ids'])[_0x0caa('0x15')](function(){if(_[_0x0caa('0xb8')](_0x5e05f5[_0x0caa('0x45')]['ids'])){for(var _0x587723=0x0;_0x587723<_0x5e05f5[_0x0caa('0x45')][_0x0caa('0x65')][_0x0caa('0x50')];_0x587723+=0x1){socket[_0x0caa('0x29')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x5e05f5[_0x0caa('0x45')][_0x0caa('0x65')][_0x587723]),'UserId':Number(_0x5e05f5[_0x0caa('0x62')]['id'])});}}else{socket['emit'](_0x0caa('0x13f'),{'SmsInteractionId':Number(_0x5e05f5['query'][_0x0caa('0x65')]),'UserId':Number(_0x5e05f5[_0x0caa('0x62')]['id'])});}});}})[_0x0caa('0x15')](respondWithStatusCode(_0x5c6f36,null))[_0x0caa('0x1f')](handleError(_0x5c6f36,null));};exports[_0x0caa('0x140')]=function(_0x9143aa,_0x5b8cc4){return db['User']['find']({'where':{'id':_0x9143aa[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x5b8cc4,null))[_0x0caa('0x15')](function(_0x1e4b4a){if(_0x1e4b4a){return _0x1e4b4a[_0x0caa('0x140')](_0x9143aa[_0x0caa('0x61')][_0x0caa('0x65')],_[_0x0caa('0x66')](_0x9143aa['body'],[_0x0caa('0x65'),'id'])||{})[_0x0caa('0xae')](function(){for(var _0x1b542b=0x0;_0x1b542b<_0x9143aa['body']['ids'][_0x0caa('0x50')];_0x1b542b+=0x1){socket[_0x0caa('0x29')](_0x0caa('0x141'),{'OpenchannelInteractionId':Number(_0x9143aa[_0x0caa('0x61')][_0x0caa('0x65')][_0x1b542b]),'UserId':Number(_0x9143aa[_0x0caa('0x62')]['id'])});}return _0x9143aa[_0x0caa('0x61')]['ids'];});}})['then'](respondWithResult(_0x5b8cc4,null))['catch'](handleError(_0x5b8cc4,null));};exports['removeOpenchannelInteractions']=function(_0x13c066,_0x3c05e9){return db[_0x0caa('0x3d')]['find']({'where':{'id':_0x13c066['params']['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x3c05e9,null))[_0x0caa('0x15')](function(_0x5d9570){if(_0x5d9570){return _0x5d9570[_0x0caa('0x142')](_0x13c066[_0x0caa('0x45')]['ids'])[_0x0caa('0x15')](function(){if(_['isArray'](_0x13c066[_0x0caa('0x45')][_0x0caa('0x65')])){for(var _0x23ebfd=0x0;_0x23ebfd<_0x13c066[_0x0caa('0x45')]['ids'][_0x0caa('0x50')];_0x23ebfd+=0x1){socket['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x13c066[_0x0caa('0x45')][_0x0caa('0x65')][_0x23ebfd]),'UserId':Number(_0x13c066[_0x0caa('0x62')]['id'])});}}else{socket[_0x0caa('0x29')](_0x0caa('0x143'),{'OpenchannelInteractionId':Number(_0x13c066['query'][_0x0caa('0x65')]),'UserId':Number(_0x13c066[_0x0caa('0x62')]['id'])});}});}})[_0x0caa('0x15')](respondWithStatusCode(_0x3c05e9,null))[_0x0caa('0x1f')](handleError(_0x3c05e9,null));};exports[_0x0caa('0x144')]=function(_0x1237a0,_0xcbcee8){return db[_0x0caa('0x3d')][_0x0caa('0x37')]({'where':{'id':_0x1237a0[_0x0caa('0x62')]['id']}})['then'](handleEntityNotFound(_0xcbcee8,null))['then'](function(_0x523d69){if(_0x523d69){return _0x523d69[_0x0caa('0x144')](_0x1237a0[_0x0caa('0x61')]['ids'],_['omit'](_0x1237a0[_0x0caa('0x61')],['ids','id'])||{})[_0x0caa('0xae')](function(){for(var _0x4e034b=0x0;_0x4e034b<_0x1237a0[_0x0caa('0x61')][_0x0caa('0x65')][_0x0caa('0x50')];_0x4e034b+=0x1){socket['emit'](_0x0caa('0x145'),{'WhatsappInteractionId':Number(_0x1237a0[_0x0caa('0x61')]['ids'][_0x4e034b]),'UserId':Number(_0x1237a0[_0x0caa('0x62')]['id'])});}return _0x1237a0[_0x0caa('0x61')][_0x0caa('0x65')];});}})['then'](respondWithResult(_0xcbcee8,null))[_0x0caa('0x1f')](handleError(_0xcbcee8,null));};exports['removeWhatsappInteractions']=function(_0x39bd6c,_0xd3dad7){return db[_0x0caa('0x3d')][_0x0caa('0x37')]({'where':{'id':_0x39bd6c[_0x0caa('0x62')]['id']}})['then'](handleEntityNotFound(_0xd3dad7,null))[_0x0caa('0x15')](function(_0x4c11c3){if(_0x4c11c3){return _0x4c11c3[_0x0caa('0x146')](_0x39bd6c[_0x0caa('0x45')][_0x0caa('0x65')]);}})['then'](respondWithStatusCode(_0xd3dad7,null))[_0x0caa('0x1f')](handleError(_0xd3dad7,null));};exports[_0x0caa('0x147')]=function(_0x31acfd,_0x300cbd){var _0x3c1ff8={};var _0x5c80d7={};var _0x36bbeb;var _0x3c3d37;return db[_0x0caa('0x3d')]['findOne']({'where':{'id':_0x31acfd[_0x0caa('0x62')]['id']}})['then'](handleEntityNotFound(_0x300cbd,null))[_0x0caa('0x15')](function(_0x15521e){if(_0x15521e){_0x36bbeb=_0x15521e;_0x5c80d7['model']=_['keys'](db[_0x0caa('0x148')][_0x0caa('0x3e')]);_0x5c80d7[_0x0caa('0x45')]=_[_0x0caa('0xd3')](_0x31acfd[_0x0caa('0x45')]);_0x5c80d7['filters']=_[_0x0caa('0x5b')](_0x5c80d7['model'],_0x5c80d7[_0x0caa('0x45')]);_0x3c1ff8[_0x0caa('0x4b')]=_[_0x0caa('0x5b')](_0x5c80d7['model'],qs['fields'](_0x31acfd[_0x0caa('0x45')][_0x0caa('0x5c')]));_0x3c1ff8[_0x0caa('0x4b')]=_0x3c1ff8[_0x0caa('0x4b')][_0x0caa('0x50')]?_0x3c1ff8['attributes']:_0x5c80d7[_0x0caa('0x58')];_0x3c1ff8[_0x0caa('0xd5')]=qs[_0x0caa('0xd6')](_0x31acfd[_0x0caa('0x45')]['sort']);_0x3c1ff8[_0x0caa('0x44')]=qs[_0x0caa('0x5a')](_['pick'](_0x31acfd[_0x0caa('0x45')],_0x5c80d7['filters']));if(_0x31acfd[_0x0caa('0x45')][_0x0caa('0x33')]){_0x3c1ff8['where']=_['merge'](_0x3c1ff8[_0x0caa('0x44')],{'$or':_[_0x0caa('0x35')](_0x3c1ff8['attributes'],function(_0x58b351){var _0x16e518={};_0x16e518[_0x58b351]={'$like':'%'+_0x31acfd[_0x0caa('0x45')][_0x0caa('0x33')]+'%'};return _0x16e518;})});}_0x3c1ff8=_['merge']({},_0x3c1ff8,_0x31acfd[_0x0caa('0x5e')]);return _0x36bbeb[_0x0caa('0x147')](_0x3c1ff8);}})['then'](function(_0x34eb5e){if(_0x34eb5e){_0x3c3d37=_0x34eb5e[_0x0caa('0x50')];if(!_0x31acfd['query']['hasOwnProperty']('nolimit')){_0x3c1ff8[_0x0caa('0x25')]=qs[_0x0caa('0x25')](_0x31acfd['query']['limit']);_0x3c1ff8['offset']=qs[_0x0caa('0x23')](_0x31acfd[_0x0caa('0x45')]['offset']);}return _0x36bbeb['getVoicePrefixes'](_0x3c1ff8);}})[_0x0caa('0x15')](function(_0x29f6b7){if(_0x29f6b7){return _0x29f6b7?{'count':_0x3c3d37,'rows':_0x29f6b7}:null;}})[_0x0caa('0x15')](respondWithResult(_0x300cbd,null))[_0x0caa('0x1f')](handleError(_0x300cbd,null));};exports['getFaxAccounts']=function(_0x4ff1c9,_0x2bbd70){var _0x37de4c={};var _0x5c661d={};var _0x3c4aca;var _0xd1ce88;return db[_0x0caa('0x3d')][_0x0caa('0x9f')]({'where':{'id':_0x4ff1c9[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x2bbd70,null))[_0x0caa('0x15')](function(_0x44317a){if(_0x44317a){_0x3c4aca=_0x44317a;_0x5c661d[_0x0caa('0x58')]=_[_0x0caa('0xd3')](db[_0x0caa('0x149')][_0x0caa('0x3e')]);_0x5c661d[_0x0caa('0x45')]=_[_0x0caa('0xd3')](_0x4ff1c9[_0x0caa('0x45')]);_0x5c661d[_0x0caa('0x5a')]=_[_0x0caa('0x5b')](_0x5c661d[_0x0caa('0x58')],_0x5c661d[_0x0caa('0x45')]);_0x37de4c[_0x0caa('0x4b')]=_[_0x0caa('0x5b')](_0x5c661d[_0x0caa('0x58')],qs[_0x0caa('0x5c')](_0x4ff1c9[_0x0caa('0x45')][_0x0caa('0x5c')]));_0x37de4c['attributes']=_0x37de4c[_0x0caa('0x4b')][_0x0caa('0x50')]?_0x37de4c[_0x0caa('0x4b')]:_0x5c661d['model'];_0x37de4c[_0x0caa('0xd5')]=qs[_0x0caa('0xd6')](_0x4ff1c9[_0x0caa('0x45')][_0x0caa('0xd6')]);_0x37de4c[_0x0caa('0x44')]=qs['filters'](_['pick'](_0x4ff1c9['query'],_0x5c661d[_0x0caa('0x5a')]));if(_0x4ff1c9[_0x0caa('0x45')][_0x0caa('0x33')]){_0x37de4c[_0x0caa('0x44')]=_['merge'](_0x37de4c[_0x0caa('0x44')],{'$or':_['map'](_0x37de4c[_0x0caa('0x4b')],function(_0x14f39c){var _0x4264c0={};_0x4264c0[_0x14f39c]={'$like':'%'+_0x4ff1c9[_0x0caa('0x45')][_0x0caa('0x33')]+'%'};return _0x4264c0;})});}_0x37de4c=_[_0x0caa('0x5d')]({},_0x37de4c,_0x4ff1c9[_0x0caa('0x5e')]);return _0x3c4aca[_0x0caa('0x14a')](_0x37de4c);}})[_0x0caa('0x15')](function(_0x2641e1){if(_0x2641e1){_0xd1ce88=_0x2641e1[_0x0caa('0x50')];if(!_0x4ff1c9[_0x0caa('0x45')]['hasOwnProperty']('nolimit')){_0x37de4c[_0x0caa('0x25')]=qs[_0x0caa('0x25')](_0x4ff1c9['query']['limit']);_0x37de4c[_0x0caa('0x23')]=qs[_0x0caa('0x23')](_0x4ff1c9[_0x0caa('0x45')][_0x0caa('0x23')]);}return _0x3c4aca[_0x0caa('0x14a')](_0x37de4c);}})[_0x0caa('0x15')](function(_0xdbe680){if(_0xdbe680){return _0xdbe680?{'count':_0xd1ce88,'rows':_0xdbe680}:null;}})[_0x0caa('0x15')](respondWithResult(_0x2bbd70,null))[_0x0caa('0x1f')](handleError(_0x2bbd70,null));};exports['addFaxAccounts']=function(_0x2b6626,_0x4ab7d9){return db['User']['find']({'where':{'id':_0x2b6626[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x4ab7d9,null))['then'](function(_0x1ec9d9){if(_0x1ec9d9){return _0x1ec9d9[_0x0caa('0x14b')](_0x2b6626[_0x0caa('0x61')][_0x0caa('0x65')],_[_0x0caa('0x66')](_0x2b6626[_0x0caa('0x61')],[_0x0caa('0x65'),'id'])||{});}})[_0x0caa('0x15')](respondWithResult(_0x4ab7d9,null))['catch'](handleError(_0x4ab7d9,null));};exports[_0x0caa('0x14c')]=function(_0x4db848,_0x53b298){return db[_0x0caa('0x3d')][_0x0caa('0x37')]({'where':{'id':_0x4db848['params']['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x53b298,null))['then'](function(_0x264446){if(_0x264446){return _0x264446[_0x0caa('0x14c')](_0x4db848['query'][_0x0caa('0x65')]);}})[_0x0caa('0x15')](respondWithStatusCode(_0x53b298,null))['catch'](handleError(_0x53b298,null));};exports[_0x0caa('0x14d')]=function(_0x5756f9,_0x53df38){var _0x288753={};var _0x26c2e5={};var _0x312903;var _0x432f24;return db[_0x0caa('0x3d')][_0x0caa('0x9f')]({'where':{'id':_0x5756f9[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x53df38,null))['then'](function(_0x114e4f){if(_0x114e4f){_0x312903=_0x114e4f;_0x26c2e5['model']=_['keys'](db[_0x0caa('0x14e')]['rawAttributes']);_0x26c2e5[_0x0caa('0x45')]=_[_0x0caa('0xd3')](_0x5756f9[_0x0caa('0x45')]);_0x26c2e5['filters']=_[_0x0caa('0x5b')](_0x26c2e5[_0x0caa('0x58')],_0x26c2e5[_0x0caa('0x45')]);_0x288753[_0x0caa('0x4b')]=_[_0x0caa('0x5b')](_0x26c2e5[_0x0caa('0x58')],qs[_0x0caa('0x5c')](_0x5756f9[_0x0caa('0x45')]['fields']));_0x288753[_0x0caa('0x4b')]=_0x288753[_0x0caa('0x4b')][_0x0caa('0x50')]?_0x288753[_0x0caa('0x4b')]:_0x26c2e5['model'];_0x288753['order']=qs['sort'](_0x5756f9[_0x0caa('0x45')][_0x0caa('0xd6')]);_0x288753[_0x0caa('0x44')]=qs['filters'](_[_0x0caa('0xd7')](_0x5756f9[_0x0caa('0x45')],_0x26c2e5['filters']));if(_0x5756f9[_0x0caa('0x45')][_0x0caa('0x33')]){_0x288753[_0x0caa('0x44')]=_['merge'](_0x288753[_0x0caa('0x44')],{'$or':_['map'](_0x288753[_0x0caa('0x4b')],function(_0x238b0c){var _0x272d3f={};_0x272d3f[_0x238b0c]={'$like':'%'+_0x5756f9[_0x0caa('0x45')]['filter']+'%'};return _0x272d3f;})});}_0x288753=_[_0x0caa('0x5d')]({},_0x288753,_0x5756f9[_0x0caa('0x5e')]);return _0x312903['getMailAccounts'](_0x288753);}})['then'](function(_0x1b489a){if(_0x1b489a){_0x432f24=_0x1b489a[_0x0caa('0x50')];if(!_0x5756f9[_0x0caa('0x45')][_0x0caa('0xde')](_0x0caa('0xdf'))){_0x288753[_0x0caa('0x25')]=qs['limit'](_0x5756f9[_0x0caa('0x45')][_0x0caa('0x25')]);_0x288753[_0x0caa('0x23')]=qs[_0x0caa('0x23')](_0x5756f9[_0x0caa('0x45')]['offset']);}return _0x312903['getMailAccounts'](_0x288753);}})[_0x0caa('0x15')](function(_0x129dd9){if(_0x129dd9){return _0x129dd9?{'count':_0x432f24,'rows':_0x129dd9}:null;}})[_0x0caa('0x15')](respondWithResult(_0x53df38,null))[_0x0caa('0x1f')](handleError(_0x53df38,null));};exports[_0x0caa('0x14f')]=function(_0x84c013,_0x477e89){return db[_0x0caa('0x3d')][_0x0caa('0x37')]({'where':{'id':_0x84c013[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x477e89,null))[_0x0caa('0x15')](function(_0x48c6bd){if(_0x48c6bd){return _0x48c6bd[_0x0caa('0x14f')](_0x84c013[_0x0caa('0x61')][_0x0caa('0x65')],_[_0x0caa('0x66')](_0x84c013[_0x0caa('0x61')],[_0x0caa('0x65'),'id'])||{});}})[_0x0caa('0x15')](respondWithResult(_0x477e89,null))['catch'](handleError(_0x477e89,null));};exports[_0x0caa('0x150')]=function(_0x42e40c,_0x45edbf){return db['User']['find']({'where':{'id':_0x42e40c[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x45edbf,null))['then'](function(_0x31343b){if(_0x31343b){return _0x31343b[_0x0caa('0x150')](_0x42e40c[_0x0caa('0x45')][_0x0caa('0x65')]);}})[_0x0caa('0x15')](respondWithStatusCode(_0x45edbf,null))[_0x0caa('0x1f')](handleError(_0x45edbf,null));};exports[_0x0caa('0x151')]=function(_0x805f09,_0xd3ba36){var _0x5d3657={};var _0x3b3a71={};var _0x5459a0;var _0x3fdd51;return db[_0x0caa('0x3d')]['findOne']({'where':{'id':_0x805f09[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0xd3ba36,null))[_0x0caa('0x15')](function(_0x29a871){if(_0x29a871){_0x5459a0=_0x29a871;_0x3b3a71[_0x0caa('0x58')]=_[_0x0caa('0xd3')](db[_0x0caa('0x152')][_0x0caa('0x3e')]);_0x3b3a71[_0x0caa('0x45')]=_['keys'](_0x805f09[_0x0caa('0x45')]);_0x3b3a71[_0x0caa('0x5a')]=_[_0x0caa('0x5b')](_0x3b3a71['model'],_0x3b3a71[_0x0caa('0x45')]);_0x5d3657[_0x0caa('0x4b')]=_['intersection'](_0x3b3a71[_0x0caa('0x58')],qs[_0x0caa('0x5c')](_0x805f09[_0x0caa('0x45')][_0x0caa('0x5c')]));_0x5d3657[_0x0caa('0x4b')]=_0x5d3657[_0x0caa('0x4b')]['length']?_0x5d3657[_0x0caa('0x4b')]:_0x3b3a71[_0x0caa('0x58')];_0x5d3657[_0x0caa('0xd5')]=qs[_0x0caa('0xd6')](_0x805f09[_0x0caa('0x45')][_0x0caa('0xd6')]);_0x5d3657[_0x0caa('0x44')]=qs[_0x0caa('0x5a')](_[_0x0caa('0xd7')](_0x805f09[_0x0caa('0x45')],_0x3b3a71[_0x0caa('0x5a')]));if(_0x805f09[_0x0caa('0x45')][_0x0caa('0x33')]){_0x5d3657[_0x0caa('0x44')]=_[_0x0caa('0x5d')](_0x5d3657[_0x0caa('0x44')],{'$or':_[_0x0caa('0x35')](_0x5d3657[_0x0caa('0x4b')],function(_0x296da1){var _0x11f5c7={};_0x11f5c7[_0x296da1]={'$like':'%'+_0x805f09[_0x0caa('0x45')]['filter']+'%'};return _0x11f5c7;})});}_0x5d3657=_['merge']({},_0x5d3657,_0x805f09[_0x0caa('0x5e')]);return _0x5459a0['getOpenchannelAccounts'](_0x5d3657);}})['then'](function(_0x45677b){if(_0x45677b){_0x3fdd51=_0x45677b[_0x0caa('0x50')];if(!_0x805f09['query'][_0x0caa('0xde')]('nolimit')){_0x5d3657[_0x0caa('0x25')]=qs[_0x0caa('0x25')](_0x805f09[_0x0caa('0x45')]['limit']);_0x5d3657[_0x0caa('0x23')]=qs[_0x0caa('0x23')](_0x805f09['query'][_0x0caa('0x23')]);}return _0x5459a0[_0x0caa('0x151')](_0x5d3657);}})[_0x0caa('0x15')](function(_0x2455fe){if(_0x2455fe){return _0x2455fe?{'count':_0x3fdd51,'rows':_0x2455fe}:null;}})[_0x0caa('0x15')](respondWithResult(_0xd3ba36,null))['catch'](handleError(_0xd3ba36,null));};exports['addOpenchannelAccounts']=function(_0x1216ae,_0x513c07){return db[_0x0caa('0x3d')][_0x0caa('0x37')]({'where':{'id':_0x1216ae['params']['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x513c07,null))[_0x0caa('0x15')](function(_0x2fcfd5){if(_0x2fcfd5){return _0x2fcfd5[_0x0caa('0x153')](_0x1216ae[_0x0caa('0x61')][_0x0caa('0x65')],_['omit'](_0x1216ae[_0x0caa('0x61')],['ids','id'])||{});}})[_0x0caa('0x15')](respondWithResult(_0x513c07,null))[_0x0caa('0x1f')](handleError(_0x513c07,null));};exports['removeOpenchannelAccounts']=function(_0x236b5e,_0x5ad32f){return db[_0x0caa('0x3d')][_0x0caa('0x37')]({'where':{'id':_0x236b5e['params']['id']}})['then'](handleEntityNotFound(_0x5ad32f,null))[_0x0caa('0x15')](function(_0x31cf5a){if(_0x31cf5a){return _0x31cf5a[_0x0caa('0x154')](_0x236b5e[_0x0caa('0x45')]['ids']);}})[_0x0caa('0x15')](respondWithStatusCode(_0x5ad32f,null))[_0x0caa('0x1f')](handleError(_0x5ad32f,null));};exports['getSmsAccounts']=function(_0x24fff8,_0x1441a9){var _0x3f793a={};var _0x390485={};var _0x2ef777;var _0x29e8f6;return db[_0x0caa('0x3d')][_0x0caa('0x9f')]({'where':{'id':_0x24fff8['params']['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x1441a9,null))['then'](function(_0x1d834a){if(_0x1d834a){_0x2ef777=_0x1d834a;_0x390485['model']=_['keys'](db[_0x0caa('0x155')][_0x0caa('0x3e')]);_0x390485[_0x0caa('0x45')]=_[_0x0caa('0xd3')](_0x24fff8[_0x0caa('0x45')]);_0x390485[_0x0caa('0x5a')]=_[_0x0caa('0x5b')](_0x390485[_0x0caa('0x58')],_0x390485['query']);_0x3f793a[_0x0caa('0x4b')]=_[_0x0caa('0x5b')](_0x390485['model'],qs['fields'](_0x24fff8['query']['fields']));_0x3f793a['attributes']=_0x3f793a['attributes'][_0x0caa('0x50')]?_0x3f793a['attributes']:_0x390485['model'];_0x3f793a[_0x0caa('0xd5')]=qs[_0x0caa('0xd6')](_0x24fff8[_0x0caa('0x45')][_0x0caa('0xd6')]);_0x3f793a[_0x0caa('0x44')]=qs[_0x0caa('0x5a')](_[_0x0caa('0xd7')](_0x24fff8[_0x0caa('0x45')],_0x390485[_0x0caa('0x5a')]));if(_0x24fff8[_0x0caa('0x45')][_0x0caa('0x33')]){_0x3f793a[_0x0caa('0x44')]=_[_0x0caa('0x5d')](_0x3f793a[_0x0caa('0x44')],{'$or':_[_0x0caa('0x35')](_0x3f793a[_0x0caa('0x4b')],function(_0x276bc8){var _0x480b2c={};_0x480b2c[_0x276bc8]={'$like':'%'+_0x24fff8[_0x0caa('0x45')][_0x0caa('0x33')]+'%'};return _0x480b2c;})});}_0x3f793a=_['merge']({},_0x3f793a,_0x24fff8[_0x0caa('0x5e')]);return _0x2ef777[_0x0caa('0x156')](_0x3f793a);}})['then'](function(_0x16d367){if(_0x16d367){_0x29e8f6=_0x16d367[_0x0caa('0x50')];if(!_0x24fff8[_0x0caa('0x45')][_0x0caa('0xde')](_0x0caa('0xdf'))){_0x3f793a[_0x0caa('0x25')]=qs[_0x0caa('0x25')](_0x24fff8['query'][_0x0caa('0x25')]);_0x3f793a[_0x0caa('0x23')]=qs[_0x0caa('0x23')](_0x24fff8['query']['offset']);}return _0x2ef777[_0x0caa('0x156')](_0x3f793a);}})[_0x0caa('0x15')](function(_0xd0d0fb){if(_0xd0d0fb){return _0xd0d0fb?{'count':_0x29e8f6,'rows':_0xd0d0fb}:null;}})[_0x0caa('0x15')](respondWithResult(_0x1441a9,null))[_0x0caa('0x1f')](handleError(_0x1441a9,null));};exports['addSmsAccounts']=function(_0x330dd3,_0x4b3469){return db['User']['find']({'where':{'id':_0x330dd3[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x4b3469,null))['then'](function(_0x55fa53){if(_0x55fa53){return _0x55fa53[_0x0caa('0x157')](_0x330dd3[_0x0caa('0x61')][_0x0caa('0x65')],_[_0x0caa('0x66')](_0x330dd3[_0x0caa('0x61')],[_0x0caa('0x65'),'id'])||{});}})['then'](respondWithResult(_0x4b3469,null))[_0x0caa('0x1f')](handleError(_0x4b3469,null));};exports['removeSmsAccounts']=function(_0x38f44a,_0x435fe8){return db[_0x0caa('0x3d')]['find']({'where':{'id':_0x38f44a[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x435fe8,null))['then'](function(_0x5119ac){if(_0x5119ac){return _0x5119ac[_0x0caa('0x158')](_0x38f44a[_0x0caa('0x45')][_0x0caa('0x65')]);}})[_0x0caa('0x15')](respondWithStatusCode(_0x435fe8,null))['catch'](handleError(_0x435fe8,null));};exports['getChatWebsites']=function(_0xd565bd,_0x26c9e8){var _0x107354={};var _0x277725={};var _0x1b462d;var _0x1a67e0;return db['User'][_0x0caa('0x9f')]({'where':{'id':_0xd565bd[_0x0caa('0x62')]['id']}})['then'](handleEntityNotFound(_0x26c9e8,null))[_0x0caa('0x15')](function(_0x59c743){if(_0x59c743){_0x1b462d=_0x59c743;_0x277725[_0x0caa('0x58')]=_[_0x0caa('0xd3')](db[_0x0caa('0x159')]['rawAttributes']);_0x277725[_0x0caa('0x45')]=_['keys'](_0xd565bd[_0x0caa('0x45')]);_0x277725[_0x0caa('0x5a')]=_['intersection'](_0x277725[_0x0caa('0x58')],_0x277725['query']);_0x107354['attributes']=_[_0x0caa('0x5b')](_0x277725[_0x0caa('0x58')],qs[_0x0caa('0x5c')](_0xd565bd[_0x0caa('0x45')][_0x0caa('0x5c')]));_0x107354['attributes']=_0x107354['attributes']['length']?_0x107354[_0x0caa('0x4b')]:_0x277725[_0x0caa('0x58')];_0x107354[_0x0caa('0xd5')]=qs['sort'](_0xd565bd[_0x0caa('0x45')]['sort']);_0x107354[_0x0caa('0x44')]=qs[_0x0caa('0x5a')](_[_0x0caa('0xd7')](_0xd565bd[_0x0caa('0x45')],_0x277725['filters']));if(_0xd565bd[_0x0caa('0x45')][_0x0caa('0x33')]){_0x107354[_0x0caa('0x44')]=_[_0x0caa('0x5d')](_0x107354[_0x0caa('0x44')],{'$or':_[_0x0caa('0x35')](_0x107354[_0x0caa('0x4b')],function(_0x2e62f6){var _0x191b48={};_0x191b48[_0x2e62f6]={'$like':'%'+_0xd565bd[_0x0caa('0x45')][_0x0caa('0x33')]+'%'};return _0x191b48;})});}_0x107354=_[_0x0caa('0x5d')]({},_0x107354,_0xd565bd[_0x0caa('0x5e')]);return _0x1b462d[_0x0caa('0x15a')](_0x107354);}})['then'](function(_0xae94ee){if(_0xae94ee){_0x1a67e0=_0xae94ee['length'];if(!_0xd565bd[_0x0caa('0x45')][_0x0caa('0xde')](_0x0caa('0xdf'))){_0x107354[_0x0caa('0x25')]=qs[_0x0caa('0x25')](_0xd565bd[_0x0caa('0x45')][_0x0caa('0x25')]);_0x107354['offset']=qs[_0x0caa('0x23')](_0xd565bd['query'][_0x0caa('0x23')]);}return _0x1b462d[_0x0caa('0x15a')](_0x107354);}})['then'](function(_0x2768fe){if(_0x2768fe){return _0x2768fe?{'count':_0x1a67e0,'rows':_0x2768fe}:null;}})[_0x0caa('0x15')](respondWithResult(_0x26c9e8,null))[_0x0caa('0x1f')](handleError(_0x26c9e8,null));};exports[_0x0caa('0x15b')]=function(_0x3bc3b0,_0x2017db){return db['User'][_0x0caa('0x37')]({'where':{'id':_0x3bc3b0[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x2017db,null))['then'](function(_0x4d10d8){if(_0x4d10d8){return _0x4d10d8[_0x0caa('0x15b')](_0x3bc3b0[_0x0caa('0x61')][_0x0caa('0x65')],_['omit'](_0x3bc3b0[_0x0caa('0x61')],[_0x0caa('0x65'),'id'])||{});}})[_0x0caa('0x15')](respondWithResult(_0x2017db,null))['catch'](handleError(_0x2017db,null));};exports[_0x0caa('0x15c')]=function(_0x1c5571,_0x3e3d9d){return db[_0x0caa('0x3d')]['find']({'where':{'id':_0x1c5571[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x3e3d9d,null))['then'](function(_0x438b88){if(_0x438b88){return _0x438b88['removeChatWebsites'](_0x1c5571[_0x0caa('0x45')][_0x0caa('0x65')]);}})[_0x0caa('0x15')](respondWithStatusCode(_0x3e3d9d,null))[_0x0caa('0x1f')](handleError(_0x3e3d9d,null));};exports[_0x0caa('0x15d')]=function(_0x1acde9,_0x41642e){var _0x451dda={};var _0x2f752e={};var _0x328f30;var _0x8b30f1;return db['User'][_0x0caa('0x9f')]({'where':{'id':_0x1acde9[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x41642e,null))[_0x0caa('0x15')](function(_0x141c52){if(_0x141c52){_0x328f30=_0x141c52;_0x2f752e[_0x0caa('0x58')]=_[_0x0caa('0xd3')](db['WhatsappAccount'][_0x0caa('0x3e')]);_0x2f752e[_0x0caa('0x45')]=_[_0x0caa('0xd3')](_0x1acde9[_0x0caa('0x45')]);_0x2f752e[_0x0caa('0x5a')]=_['intersection'](_0x2f752e['model'],_0x2f752e[_0x0caa('0x45')]);_0x451dda[_0x0caa('0x4b')]=_[_0x0caa('0x5b')](_0x2f752e[_0x0caa('0x58')],qs['fields'](_0x1acde9[_0x0caa('0x45')][_0x0caa('0x5c')]));_0x451dda[_0x0caa('0x4b')]=_0x451dda[_0x0caa('0x4b')][_0x0caa('0x50')]?_0x451dda['attributes']:_0x2f752e[_0x0caa('0x58')];_0x451dda[_0x0caa('0xd5')]=qs[_0x0caa('0xd6')](_0x1acde9[_0x0caa('0x45')][_0x0caa('0xd6')]);_0x451dda[_0x0caa('0x44')]=qs[_0x0caa('0x5a')](_['pick'](_0x1acde9[_0x0caa('0x45')],_0x2f752e['filters']));if(_0x1acde9[_0x0caa('0x45')][_0x0caa('0x33')]){_0x451dda[_0x0caa('0x44')]=_[_0x0caa('0x5d')](_0x451dda[_0x0caa('0x44')],{'$or':_['map'](_0x451dda['attributes'],function(_0x184a7e){var _0x45e5ec={};_0x45e5ec[_0x184a7e]={'$like':'%'+_0x1acde9['query'][_0x0caa('0x33')]+'%'};return _0x45e5ec;})});}_0x451dda=_[_0x0caa('0x5d')]({},_0x451dda,_0x1acde9[_0x0caa('0x5e')]);return _0x328f30[_0x0caa('0x15d')](_0x451dda);}})[_0x0caa('0x15')](function(_0x56663d){if(_0x56663d){_0x8b30f1=_0x56663d[_0x0caa('0x50')];if(!_0x1acde9[_0x0caa('0x45')][_0x0caa('0xde')](_0x0caa('0xdf'))){_0x451dda[_0x0caa('0x25')]=qs['limit'](_0x1acde9[_0x0caa('0x45')]['limit']);_0x451dda['offset']=qs['offset'](_0x1acde9['query'][_0x0caa('0x23')]);}return _0x328f30[_0x0caa('0x15d')](_0x451dda);}})['then'](function(_0x49d6ec){if(_0x49d6ec){return _0x49d6ec?{'count':_0x8b30f1,'rows':_0x49d6ec}:null;}})['then'](respondWithResult(_0x41642e,null))[_0x0caa('0x1f')](handleError(_0x41642e,null));};exports[_0x0caa('0x15e')]=function(_0x242703,_0x148445){return db[_0x0caa('0x3d')][_0x0caa('0x37')]({'where':{'id':_0x242703[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x148445,null))['then'](function(_0x944b3e){if(_0x944b3e){return _0x944b3e[_0x0caa('0x15e')](_0x242703[_0x0caa('0x61')][_0x0caa('0x65')],_[_0x0caa('0x66')](_0x242703[_0x0caa('0x61')],[_0x0caa('0x65'),'id'])||{});}})[_0x0caa('0x15')](respondWithResult(_0x148445,null))['catch'](handleError(_0x148445,null));};exports[_0x0caa('0x15f')]=function(_0xfc2c55,_0x5b6347){return db['User'][_0x0caa('0x37')]({'where':{'id':_0xfc2c55[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x5b6347,null))['then'](function(_0x563bfe){if(_0x563bfe){return _0x563bfe[_0x0caa('0x15f')](_0xfc2c55[_0x0caa('0x45')][_0x0caa('0x65')]);}})[_0x0caa('0x15')](respondWithStatusCode(_0x5b6347,null))['catch'](handleError(_0x5b6347,null));};exports['getScheduledCalls']=function(_0x495b19,_0x5d2ad0){var _0xbb05e4={},_0x20baaa={},_0x1d1c16={'count':0x0,'rows':[]};var _0x21454a=db[_0x0caa('0x160')][_0x0caa('0x3e')];_0x20baaa[_0x0caa('0x58')]=_['keys'](_0x21454a);_0x20baaa[_0x0caa('0x45')]=_[_0x0caa('0xd3')](_0x495b19[_0x0caa('0x45')]);_0x20baaa['filters']=_['intersection'](_0x20baaa[_0x0caa('0x58')],_0x20baaa[_0x0caa('0x45')]);_0x20baaa[_0x0caa('0x5a')]=_[_0x0caa('0xd1')](_0x20baaa[_0x0caa('0x5a')],[_0x0caa('0x161'),'$or',_0x0caa('0x162'),_0x0caa('0x163'),_0x0caa('0x164'),_0x0caa('0x165'),_0x0caa('0x166'),'$eq',_0x0caa('0x167'),_0x0caa('0x168'),_0x0caa('0x169'),_0x0caa('0x16a'),_0x0caa('0x16b'),'$like',_0x0caa('0x16c'),'$iLike',_0x0caa('0x16d'),'$like',_0x0caa('0x16e'),_0x0caa('0x16f'),_0x0caa('0x170'),'$any']);_0xbb05e4['attributes']=_[_0x0caa('0x5b')](_0x20baaa[_0x0caa('0x58')],qs[_0x0caa('0x5c')](_0x495b19['query'][_0x0caa('0x5c')]));_0xbb05e4['attributes']=_0xbb05e4[_0x0caa('0x4b')][_0x0caa('0x50')]?_0xbb05e4[_0x0caa('0x4b')]:_0x20baaa[_0x0caa('0x58')];if(!_0x495b19[_0x0caa('0x45')][_0x0caa('0xde')](_0x0caa('0xdf'))){_0xbb05e4[_0x0caa('0x25')]=qs[_0x0caa('0x25')](_0x495b19[_0x0caa('0x45')][_0x0caa('0x25')]);_0xbb05e4['offset']=qs[_0x0caa('0x23')](_0x495b19[_0x0caa('0x45')][_0x0caa('0x23')]);}_0xbb05e4[_0x0caa('0xd5')]=qs[_0x0caa('0xd6')](_0x495b19[_0x0caa('0x45')]['sort']);_0xbb05e4['where']=qs[_0x0caa('0x5a')](_['pick'](_0x495b19[_0x0caa('0x45')],_0x20baaa[_0x0caa('0x5a')]));if(_0x495b19[_0x0caa('0x45')][_0x0caa('0x33')]){_0xbb05e4[_0x0caa('0x44')]=_[_0x0caa('0x5d')](_0xbb05e4[_0x0caa('0x44')],{'$or':_[_0x0caa('0x35')](_0xbb05e4[_0x0caa('0x4b')],function(_0x2d4835){var _0x51e649={};_0x51e649[_0x2d4835]={'$like':'%'+_0x495b19['query'][_0x0caa('0x33')]+'%'};return _0x51e649;})});}_0xbb05e4[_0x0caa('0x44')]={'$and':[_0xbb05e4[_0x0caa('0x44')],{'$or':[{'UserId':_0x495b19['params']['id']},{'OwnerId':_0x495b19[_0x0caa('0x62')]['id']}]}]};_0xbb05e4=_[_0x0caa('0x5d')]({},_0xbb05e4,_0x495b19[_0x0caa('0x5e')]);var _0x4e217d={'where':_0xbb05e4[_0x0caa('0x44')]};return db[_0x0caa('0x160')][_0x0caa('0x26')](_0x4e217d)[_0x0caa('0x15')](function(_0x4556f1){_0x1d1c16[_0x0caa('0x26')]=_0x4556f1;if(_0x495b19[_0x0caa('0x45')]['includeAll']){_0xbb05e4['include']=[{'attributes':['id','firstName',_0x0caa('0x171'),_0x0caa('0xf6')],'model':db['CmContact'],'as':_0x0caa('0x172')},{'attributes':['id','name',_0x0caa('0x173')],'model':db[_0x0caa('0xb2')],'as':_0x0caa('0xe1')}];}return db[_0x0caa('0x160')][_0x0caa('0x4d')](_0xbb05e4);})[_0x0caa('0x15')](function(_0x13f0c2){_0x1d1c16[_0x0caa('0x4e')]=_0x13f0c2;return _0x1d1c16;})[_0x0caa('0x15')](respondWithFilteredResult(_0x5d2ad0,_0xbb05e4))[_0x0caa('0x1f')](handleError(_0x5d2ad0,null));};exports[_0x0caa('0x174')]=function(_0x1a2997,_0x1b210e){if(!_['isNil'](_0x1a2997['user']['id'])&&(_0x1a2997['user'][_0x0caa('0x2c')]==_0x0caa('0x2d')||_0x1a2997[_0x0caa('0x2f')]['role']==_0x0caa('0x2f'))){return db[_0x0caa('0x3d')][_0x0caa('0x9f')]({'where':{'id':_0x1a2997[_0x0caa('0x62')]['id']},'raw':!![]})[_0x0caa('0x15')](function(_0xbecf99){return authService['retrieveApiKey'](_0xbecf99);})['then'](function(_0x5db5e1){if(_0x5db5e1){return _0x1b210e[_0x0caa('0x21')](0xc8)['json']({'api_key':_0x5db5e1[_0x0caa('0x175')]});}else{return _0x1b210e[_0x0caa('0x21')](0xcc)[_0x0caa('0x22')]({'message':_0x0caa('0x176')});}})['catch'](handleError(_0x1b210e,0x193));}else{return _0x1b210e[_0x0caa('0x21')](0x191)[_0x0caa('0x22')]({'message':_0x0caa('0x177')});}};exports[_0x0caa('0x178')]=function(_0xff6c7e,_0x418062){if(!_[_0x0caa('0x71')](_0xff6c7e[_0x0caa('0x2f')]['id'])&&(_0xff6c7e[_0x0caa('0x2f')][_0x0caa('0x2c')]==_0x0caa('0x2d')||_0xff6c7e[_0x0caa('0x2f')][_0x0caa('0x2c')]=='user')){return db[_0x0caa('0x3d')]['find']({'where':{'id':_0xff6c7e['params']['id']}})[_0x0caa('0x15')](function(_0xb8d0b4){return authService['generateApiKey'](_0xb8d0b4);})['then'](function(_0x548ba5){return db['User'][_0x0caa('0x28')]({'apiKeyIat':_0x548ba5[_0x0caa('0x179')],'apiKeyNonce':_0x548ba5[_0x0caa('0x17a')]},{'where':{'id':_0xff6c7e[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](function(){return _0x418062[_0x0caa('0x21')](0xc8)[_0x0caa('0x22')]({'api_key':_0x548ba5[_0x0caa('0x175')]});});})[_0x0caa('0x1f')](handleError(_0x418062,0x193));}else{return _0x418062[_0x0caa('0x21')](0x191)[_0x0caa('0x22')]({'message':_0x0caa('0x177')});}};exports['removeApiKey']=function(_0x225e67,_0x3dec59){if(!_[_0x0caa('0x71')](_0x225e67['user']['id'])&&(_0x225e67['user'][_0x0caa('0x2c')]=='admin'||_0x225e67[_0x0caa('0x2f')][_0x0caa('0x2c')]=='user')){return db[_0x0caa('0x3d')][_0x0caa('0x37')]({'where':{'id':_0x225e67[_0x0caa('0x62')]['id']}})[_0x0caa('0x15')](handleEntityNotFound(_0x3dec59,null))[_0x0caa('0x15')](function(_0x19015b){if(_0x19015b&&_0x19015b['apiKeyNonce']&&_0x19015b[_0x0caa('0x17b')])return _0x19015b;else throw{'message':_0x0caa('0x17c')};})[_0x0caa('0x15')](function(){return db[_0x0caa('0x3d')][_0x0caa('0x28')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x225e67[_0x0caa('0x62')]['id']}});})[_0x0caa('0x15')](respondWithStatusCode(_0x3dec59,0xc8))[_0x0caa('0x1f')](handleError(_0x3dec59,0x193));}else{return _0x3dec59[_0x0caa('0x21')](0x191)[_0x0caa('0x22')]({'message':_0x0caa('0x177')});}};exports[_0x0caa('0x17d')]=function(_0x418854,_0x2f940d){var _0xcf7d81=_0x418854[_0x0caa('0x2f')]['get']({'plain':!![]});if(!_0xcf7d81){return _0x2f940d[_0x0caa('0x21')](0x191)[_0x0caa('0x3b')](_0x0caa('0x17e'));}else{Promise[_0x0caa('0x10d')]()[_0x0caa('0x15')](function(){if(_0x418854[_0x0caa('0x45')][_0x0caa('0x48')]!=='true')return;return _0x418854[_0x0caa('0x2f')]['getUserSetting']();})['then'](function(_0xf50fc4){if(!_0xf50fc4)return;return _0xf50fc4[_0x0caa('0x2b')]({'plain':!![]});})[_0x0caa('0x15')](function(_0x2d6b82){_0xcf7d81[_0x0caa('0x48')]=_0x2d6b82;return _0x2f940d[_0x0caa('0x21')](0xc8)[_0x0caa('0x22')](_0xcf7d81);});}};exports[_0x0caa('0x17f')]=function(_0x13457e,_0x4d46d1){var _0x38fd33={'offset':0x0},_0x41e5df={'count':0x0,'rows':[]};Promise[_0x0caa('0x10d')]()[_0x0caa('0x15')](function(){if(!_0x13457e[_0x0caa('0x45')][_0x0caa('0x33')]&&!_0x13457e[_0x0caa('0x45')][_0x0caa('0x180')]&&!_0x13457e[_0x0caa('0x45')][_0x0caa('0x181')])return[];return Promise[_0x0caa('0x10d')]()[_0x0caa('0x15')](function(){var _0x3e6b54=[];if(!_[_0x0caa('0x94')](_0x13457e[_0x0caa('0x45')]['teams'])){_0x3e6b54[_0x0caa('0x4c')](db[_0x0caa('0x11d')]['findAll']({'attributes':['id','name'],'where':{'id':_0x13457e[_0x0caa('0x45')][_0x0caa('0x180')]}}));}if(!_[_0x0caa('0x94')](_0x13457e[_0x0caa('0x45')]['queues'])){_0x3e6b54[_0x0caa('0x4c')](db[_0x0caa('0xb2')][_0x0caa('0x4d')]({'attributes':['id',_0x0caa('0x3a')],'type':'inbound','where':{'id':_0x13457e[_0x0caa('0x45')][_0x0caa('0x181')]}}));}return Promise[_0x0caa('0x56')](_0x3e6b54);})[_0x0caa('0x15')](function(_0x59aad6){var _0x504bbe=_[_0x0caa('0x182')](_0x59aad6)[_0x0caa('0x35')](function(_0x4e4b87){return _0x4e4b87['getAgents']({'attributes':['id',_0x0caa('0x3a'),_0x0caa('0x67'),_0x0caa('0xa6')],'raw':!![]});});return Promise['all'](_0x504bbe);})[_0x0caa('0x15')](function(_0xb27607){var _0x2db0ba=_[_0x0caa('0x182')](_0xb27607);if(!_0x13457e[_0x0caa('0x45')][_0x0caa('0x33')])return _0x2db0ba;if(_['isEmpty'](_0x2db0ba)){return db[_0x0caa('0x3d')]['findAll']({'attributes':['id',_0x0caa('0x3a'),_0x0caa('0x67'),_0x0caa('0xa6')],'where':{'role':_0x0caa('0x31'),'$or':[db[_0x0caa('0x6d')]['where'](db[_0x0caa('0x6d')]['fn']('lower',db[_0x0caa('0x6d')][_0x0caa('0x183')](_0x0caa('0x3a'))),{'$like':'%'+_0x13457e[_0x0caa('0x45')][_0x0caa('0x33')][_0x0caa('0xac')]()+'%'}),{'internal':{'$like':'%'+_0x13457e[_0x0caa('0x45')][_0x0caa('0x33')]+'%'}}]},'raw':!![]});}else{return _(_0x2db0ba)['flatten']()[_0x0caa('0x33')](function(_0x166940){return _0x166940['name'][_0x0caa('0xac')]()[_0x0caa('0x36')](_0x13457e[_0x0caa('0x45')][_0x0caa('0x33')][_0x0caa('0xac')]())||_0x166940[_0x0caa('0x67')]['toString']()[_0x0caa('0x36')](_0x13457e[_0x0caa('0x45')][_0x0caa('0x33')]);})['value']();}})[_0x0caa('0x15')](function(_0x6453fa){var _0x1cfbd9=_0x0caa('0x3a');var _0x515823=_0x0caa('0x184');if(_0x13457e['query'][_0x0caa('0xd6')]){_0x515823=_0x13457e['query'][_0x0caa('0xd6')][0x0]==='-'?_0x0caa('0x185'):_0x0caa('0x184');_0x1cfbd9=_0x515823===_0x0caa('0x184')?_0x13457e['query'][_0x0caa('0xd6')]:_0x13457e['query'][_0x0caa('0xd6')]['substring'](0x1);}return _(_0x6453fa)[_0x0caa('0x186')]('id')[_0x0caa('0x187')]([function(_0x2a5657){return _0x1cfbd9===_0x0caa('0x3a')?_0x2a5657[_0x1cfbd9]['toLowerCase']():_0x2a5657[_0x1cfbd9];}],[_0x515823])[_0x0caa('0x35')](function(_0x201718){return _[_0x0caa('0xd7')](_0x201718,['id','name',_0x0caa('0x67'),_0x0caa('0xa6')]);})[_0x0caa('0x38')]();})[_0x0caa('0x15')](function(_0x39bb2e){return amiClient[_0x0caa('0x14')](_0x0caa('0x30'),_0x13457e)[_0x0caa('0x15')](function(_0x25941d){if(_0x25941d[_0x0caa('0x1c')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x3c0795=_0x25941d[_0x0caa('0x1e')];var _0x50f617=jayson[_0x0caa('0x12')][_0x0caa('0x13')]({'port':0x232c});return _0x50f617[_0x0caa('0x14')]('Agents',_0x13457e)['then'](function(_0x285d83){if(_0x285d83['error'])throw new Error(_0x0caa('0x188'));var _0xaaedf7=_0x285d83[_0x0caa('0x1e')];return _[_0x0caa('0x5d')]({},_0xaaedf7,_0x3c0795);});})['then'](function(_0x8da41a){return _[_0x0caa('0x35')](_0x39bb2e,function(_0x120a57){var _0x1c8a24=_[_0x0caa('0x37')](_0x8da41a[_0x0caa('0x4e')],['id',_0x120a57['id']]);if(!_0x1c8a24||!_0x120a57[_0x0caa('0xa6')]){_0x120a57[_0x0caa('0x21')]=_0x0caa('0x189');}else if(_0x1c8a24[_0x0caa('0xa8')]){_0x120a57[_0x0caa('0x21')]=_0x0caa('0x10e');}else{_0x120a57[_0x0caa('0x21')]=_[_0x0caa('0x36')](['idle',_0x0caa('0x18a'),_0x0caa('0x18b'),_0x0caa('0x18c'),null,undefined],_0x1c8a24[_0x0caa('0x18d')])?'online':_0x0caa('0x18e');}return _0x120a57;});});});})[_0x0caa('0x15')](function(_0x45f1a4){if(!_0x13457e[_0x0caa('0x45')][_0x0caa('0xde')](_0x0caa('0xdf'))){_0x38fd33[_0x0caa('0x25')]=qs[_0x0caa('0x25')](_0x13457e[_0x0caa('0x45')]['limit']||0xa);_0x38fd33[_0x0caa('0x23')]=qs[_0x0caa('0x23')](_0x13457e[_0x0caa('0x45')][_0x0caa('0x23')]);}_0x41e5df['count']=_0x45f1a4['length'];_0x41e5df['rows']=_0x38fd33['limit']?_0x45f1a4['slice'](_0x38fd33[_0x0caa('0x23')],_0x38fd33['offset']+_0x38fd33[_0x0caa('0x25')]):_0x45f1a4;return _0x41e5df;})['then'](respondWithFilteredResult(_0x4d46d1,_0x38fd33))['catch'](handleError(_0x4d46d1,null));};function get_open_tabs(_0x2701a1,_0x18bcc6){var _0x18322e=_0x2701a1['charAt'](0x0)[_0x0caa('0x18f')]()+_0x2701a1[_0x0caa('0x190')](0x1);var _0x4a58f2={'type':db[_0x0caa('0x97')]['QueryTypes'][_0x0caa('0x70')],'raw':!![]};return new Promise(function(_0x29d813,_0x5ad75b){var _0x301cdc=squel[_0x0caa('0x191')]()['field']('ui.'+_0x18322e+_0x0caa('0x192'),'id')[_0x0caa('0x193')](_0x0caa('0x194'))['from'](_0x0caa('0x195')+_0x2701a1+_0x0caa('0x196'),'ui')['where'](_0x0caa('0x197'),_0x18bcc6['id']);return db[_0x0caa('0x6d')][_0x0caa('0x45')](_0x301cdc['toString'](),_0x4a58f2)[_0x0caa('0x15')](function(_0x12e6a9){_0x18bcc6[_0x18322e+'OpenTabs']=_0x12e6a9;_0x29d813(_0x12e6a9);})[_0x0caa('0x1f')](function(_0x4dc5e3){_0x5ad75b(_0x4dc5e3);});});}
\ No newline at end of file
+var _0xb656=['getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','mobile','LOCAL/%s@from-sip/n','user:%s','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','isMiddleware','resolve','logout','pause','updateAttributes','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','getTeams','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','Team','flattenDeep','addAgent','getDataValue','Voice','TeamVoicePrefix','VoicePrefixId','removeTeams','transaction','getAssociatedQueues','removeAgent','UserVoicePrefix','getLists','getAgents','values','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','CmHopper','$or','$gt','$gte','$lt','$lte','$ne','$eq','$notBetween','$in','$like','$iLike','$notILike','$overlap','$contained','$any','firstName','lastName','CmContact','retrieveApiKey','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','nonce','token','removeApiKey','apiKeyNonce','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','queues','isEmpty','teams','inbound','flatten','col','toString','desc','asc','substring','uniqBy','orderBy','request','client','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','offline','idle','unavailable','ringing','voiceStatus','toUpperCase','slice','QueryTypes','field','ui.','ui.createdAt','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../config/logger','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','handleError','../../mysqldb','socket.io-emitter','redis','./user.socket','defaults','http','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','end','json','offset','undefined','limit','count','status','set','Content-Range','update','then','emit','userNotification:recalc:','destroy','role','admin','Users','user','Agents','agent','Telephones','ignore','map','value','includes','find','name','UserProfileResource','sendStatus','stack','index','User','rawAttributes','type','key','filter','password','salt','where','query','includeAll','include','userSetting','true','UserSetting','attributes','push','rows','openTabs','length','chat','dataValues','mail','openchannel','whatsapp','all','catch','show','differenceBy','keys','filters','intersection','model','fields','sms','body','describe','addContacts','params','omit','ids','internal','findById','securePassword','validatePasswordPattern','max','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','SELECT','from','voicemail','mailbox','fullname','email','permissions','101','113','110','104','105','106','108','109','111','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','userProfileId','UserProfileSection','autoAssociation','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','VoiceMail','telephone','compact','changePassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','oldPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','findOne','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','updatePasswordsHistory','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','spread','Queue:save','voice','VoiceQueue','findAll','format','SIP/%s','UserVoiceQueueRt','channel','isArray','QueueId','Queue:remove','addAvatar','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','userpic','download','existsSync','server/files/images/','getOpenTabs','fax','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','MailOpenTabs','MAIL','SmsOpenTabs','SMS','concat','getContacts','order','sort','pick','merge','options','CmList','List','Tag','Tags','tag','hasOwnProperty','nolimit','getQueues','Queue','get','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xb656,0xa9));var _0x6b65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb656[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x6b65('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x6b65('0x1'));var squel=require(_0x6b65('0x2'));var jayson=require(_0x6b65('0x3'));var Redis=require(_0x6b65('0x4'));var authService=require(_0x6b65('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x6b65('0x6'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6b65('0x7'));var APIBadRequestError=require(_0x6b65('0x8'))[_0x6b65('0x9')];var APINotFoundError=require(_0x6b65('0x8'))[_0x6b65('0xa')];var APIHandleError=require(_0x6b65('0x8'))[_0x6b65('0xb')];var db=require(_0x6b65('0xc'))['db'];var socket=require(_0x6b65('0xd'))(new Redis(config[_0x6b65('0xe')]));require(_0x6b65('0xf'))['register'](socket);config[_0x6b65('0xe')]=_[_0x6b65('0x10')](config[_0x6b65('0xe')],{'host':'localhost','port':0x18eb});var amiClient=jayson['client'][_0x6b65('0x11')]({'port':0x232a});var values;function respondWithRpcPromise(_0xc6b73e,_0x5111fd,_0x169f1c,_0x230d16){return new Promise(function(_0x5e5829,_0x15b511){var _0x17295b=_0x230d16||amiClient;return _0x17295b['request'](_0xc6b73e,_0x169f1c)['then'](function(_0x31d9cc){logger[_0x6b65('0x12')](_0x6b65('0x13'),_0x5111fd,_0x6b65('0x14'));logger['debug'](_0x6b65('0x15'),_0x5111fd,_0x6b65('0x14'),JSON[_0x6b65('0x16')](_0x31d9cc));if(_0x31d9cc[_0x6b65('0x17')]){if(_0x31d9cc[_0x6b65('0x17')][_0x6b65('0x18')]===0x1f4){logger[_0x6b65('0x17')]('User,\x20%s,\x20%s',_0x5111fd,_0x31d9cc[_0x6b65('0x17')][_0x6b65('0x19')]);return _0x15b511(_0x31d9cc['error']['message']);}logger['error'](_0x6b65('0x13'),_0x5111fd,_0x31d9cc[_0x6b65('0x17')][_0x6b65('0x19')]);return _0x5e5829(_0x31d9cc['error'][_0x6b65('0x19')]);}else{logger[_0x6b65('0x12')](_0x6b65('0x13'),_0x5111fd,_0x6b65('0x14'));_0x5e5829(_0x31d9cc['result'][_0x6b65('0x19')]);}})['catch'](function(_0x513e4b){logger[_0x6b65('0x17')](_0x6b65('0x13'),_0x5111fd,_0x513e4b);_0x15b511(_0x513e4b);});});}function respondWithStatusCode(_0x428de0,_0x41d6de){_0x41d6de=_0x41d6de||0xcc;return function(_0x2acc0f){if(_0x2acc0f){return _0x428de0['sendStatus'](_0x41d6de);}return _0x428de0['status'](_0x41d6de)[_0x6b65('0x1a')]();};}function respondWithResult(_0x371e4b,_0x1224c5){_0x1224c5=_0x1224c5||0xc8;return function(_0x1819a7){if(_0x1819a7){return _0x371e4b['status'](_0x1224c5)[_0x6b65('0x1b')](_0x1819a7);}};}function respondWithFilteredResult(_0x40d619,_0x14f103){return function(_0x2c89df){if(_0x2c89df){var _0x726f0f=typeof _0x14f103[_0x6b65('0x1c')]===_0x6b65('0x1d')&&typeof _0x14f103[_0x6b65('0x1e')]===_0x6b65('0x1d');var _0x257e14=_0x2c89df[_0x6b65('0x1f')];var _0x5da01d=_0x726f0f?0x0:_0x14f103['offset'];var _0x4a56b2=_0x726f0f?_0x2c89df['count']:_0x14f103[_0x6b65('0x1c')]+_0x14f103[_0x6b65('0x1e')];var _0x189cb4;if(_0x4a56b2>=_0x257e14){_0x4a56b2=_0x257e14;_0x189cb4=0xc8;}else{_0x189cb4=0xce;}_0x40d619[_0x6b65('0x20')](_0x189cb4);return _0x40d619[_0x6b65('0x21')](_0x6b65('0x22'),_0x5da01d+'-'+_0x4a56b2+'/'+_0x257e14)[_0x6b65('0x1b')](_0x2c89df);}return null;};}function saveUpdates(_0x4a1bf2){return function(_0x4ed680){if(_0x4ed680){return _0x4ed680[_0x6b65('0x23')](_0x4a1bf2)[_0x6b65('0x24')](function(_0x5272e2){socket[_0x6b65('0x25')](_0x6b65('0x26')+_0x5272e2['id'],{});return _0x5272e2;});}return null;};}function removeEntity(_0x834ae6){return function(_0x3c4d01){if(_0x3c4d01){return _0x3c4d01[_0x6b65('0x27')]()[_0x6b65('0x24')](function(){var _0x56d7a3=_0x3c4d01['get']({'plain':!![]});if(_0x56d7a3[_0x6b65('0x28')]===_0x6b65('0x29'))return;var _0xdc1488=[{'name':_0x6b65('0x2a'),'value':_0x6b65('0x2b'),'ignore':!![]},{'name':_0x6b65('0x2c'),'value':_0x6b65('0x2d'),'ignore':![]},{'name':_0x6b65('0x2e'),'value':'telephone','ignore':![]}];var _0x50e94a=_(_0xdc1488)['filter'](_0x6b65('0x2f'))[_0x6b65('0x30')](_0x6b65('0x31'))[_0x6b65('0x31')]();if(_[_0x6b65('0x32')](_0x50e94a,_0x56d7a3[_0x6b65('0x28')])){return;}var _0xb62ed=_[_0x6b65('0x33')](_0xdc1488,['value',_0x56d7a3[_0x6b65('0x28')]])[_0x6b65('0x34')];return db[_0x6b65('0x35')][_0x6b65('0x27')]({'where':{'type':_0xb62ed,'resourceId':_0x56d7a3['id']}})['then'](function(){return _0x3c4d01;});})[_0x6b65('0x24')](function(){_0x834ae6[_0x6b65('0x20')](0xcc)[_0x6b65('0x1a')]();});}};}function handleEntityNotFound(_0x545ebd){return function(_0x224784){if(!_0x224784){_0x545ebd[_0x6b65('0x36')](0x194);}return _0x224784;};}function handleError(_0x55a7d7,_0x136cd6){_0x136cd6=_0x136cd6||0x1f4;return function(_0x3af7f8){logger[_0x6b65('0x17')](_0x3af7f8[_0x6b65('0x37')]);if(_0x3af7f8[_0x6b65('0x34')]){delete _0x3af7f8['name'];}_0x55a7d7['status'](_0x136cd6)['send'](_0x3af7f8);};}exports[_0x6b65('0x38')]=function(_0x4817fd,_0x4d9146){var _0x498fb3={},_0x3d3705={'count':0x0,'rows':[]};var _0x55e046=_(db[_0x6b65('0x39')][_0x6b65('0x3a')])[_0x6b65('0x30')](function(_0x45bfe5){return{'name':_0x45bfe5['fieldName'],'type':_0x45bfe5[_0x6b65('0x3b')][_0x6b65('0x3c')]};})[_0x6b65('0x3d')](function(_0x47f04a){return!_[_0x6b65('0x32')]([_0x6b65('0x3e'),_0x6b65('0x3f')],_0x47f04a[_0x6b65('0x34')]);})[_0x6b65('0x31')]();_0x498fb3=qs['getOptions'](_0x55e046,_0x4817fd);var _0x31fbc6={'where':_0x498fb3[_0x6b65('0x40')]};return db[_0x6b65('0x39')]['count'](_0x31fbc6)[_0x6b65('0x24')](function(_0x2839f1){_0x3d3705[_0x6b65('0x1f')]=_0x2839f1;if(_0x4817fd[_0x6b65('0x41')][_0x6b65('0x42')]){_0x498fb3[_0x6b65('0x43')]=[{'all':!![]}];}if(_0x4817fd[_0x6b65('0x41')][_0x6b65('0x44')]===_0x6b65('0x45')){_0x498fb3[_0x6b65('0x43')]=[{'model':db[_0x6b65('0x46')],'as':_0x6b65('0x44')}];}if(!_[_0x6b65('0x32')](_0x498fb3[_0x6b65('0x47')],'id')){_0x498fb3[_0x6b65('0x47')][_0x6b65('0x48')]('id');}return db['User']['findAll'](_0x498fb3);})[_0x6b65('0x24')](function(_0x31dd9c){_0x3d3705[_0x6b65('0x49')]=_0x31dd9c;if(_0x4817fd[_0x6b65('0x41')][_0x6b65('0x4a')]===_0x6b65('0x45')){var _0x1d9253=[];for(var _0xff8277=0x0;_0xff8277<_0x3d3705[_0x6b65('0x49')][_0x6b65('0x4b')];_0xff8277++){_0x1d9253[_0x6b65('0x48')](get_open_tabs(_0x6b65('0x4c'),_0x3d3705[_0x6b65('0x49')][_0xff8277][_0x6b65('0x4d')]));_0x1d9253[_0x6b65('0x48')](get_open_tabs('sms',_0x3d3705[_0x6b65('0x49')][_0xff8277][_0x6b65('0x4d')]));_0x1d9253[_0x6b65('0x48')](get_open_tabs('fax',_0x3d3705[_0x6b65('0x49')][_0xff8277]['dataValues']));_0x1d9253[_0x6b65('0x48')](get_open_tabs(_0x6b65('0x4e'),_0x3d3705[_0x6b65('0x49')][_0xff8277][_0x6b65('0x4d')]));_0x1d9253['push'](get_open_tabs(_0x6b65('0x4f'),_0x3d3705[_0x6b65('0x49')][_0xff8277][_0x6b65('0x4d')]));_0x1d9253['push'](get_open_tabs(_0x6b65('0x50'),_0x3d3705[_0x6b65('0x49')][_0xff8277][_0x6b65('0x4d')]));}return Promise[_0x6b65('0x51')](_0x1d9253)[_0x6b65('0x24')](function(){return _0x3d3705;});}else{return _0x3d3705;}})[_0x6b65('0x24')](respondWithFilteredResult(_0x4d9146,_0x498fb3))[_0x6b65('0x52')](handleError(_0x4d9146,null));};exports[_0x6b65('0x53')]=function(_0x318e4d,_0x2640c8){var _0x21e5c0={'raw':![],'where':{'id':_0x318e4d['params']['id']}},_0x5ded81={};_0x5ded81['model']=_[_0x6b65('0x54')](_[_0x6b65('0x55')](db['User'][_0x6b65('0x3a')]),[_0x6b65('0x3e'),'salt']);_0x5ded81[_0x6b65('0x41')]=_[_0x6b65('0x55')](_0x318e4d[_0x6b65('0x41')]);_0x5ded81[_0x6b65('0x56')]=_[_0x6b65('0x57')](_0x5ded81['model'],_0x5ded81[_0x6b65('0x41')]);_0x21e5c0['attributes']=_[_0x6b65('0x57')](_0x5ded81[_0x6b65('0x58')],qs[_0x6b65('0x59')](_0x318e4d[_0x6b65('0x41')]['fields']));_0x21e5c0[_0x6b65('0x47')]=_0x21e5c0[_0x6b65('0x47')][_0x6b65('0x4b')]?_0x21e5c0[_0x6b65('0x47')]:_0x5ded81['model'];if(_0x318e4d[_0x6b65('0x41')][_0x6b65('0x42')]){_0x21e5c0[_0x6b65('0x43')]=[{'all':!![]}];}if(_0x318e4d['query'][_0x6b65('0x44')]===_0x6b65('0x45')){_0x21e5c0['include']=[{'model':db['UserSetting'],'as':_0x6b65('0x44')}];}_0x21e5c0=_['merge']({},_0x21e5c0,_0x318e4d['options']);if(!_[_0x6b65('0x32')](_0x21e5c0[_0x6b65('0x47')],'id')){_0x21e5c0[_0x6b65('0x47')][_0x6b65('0x48')]('id');}return db[_0x6b65('0x39')]['find'](_0x21e5c0)[_0x6b65('0x24')](handleEntityNotFound(_0x2640c8,null))['then'](function(_0x31d061){var _0x25d59d=[];values=_0x31d061;if(_0x318e4d['query'][_0x6b65('0x4a')]===_0x6b65('0x45')){_0x25d59d['push'](get_open_tabs(_0x6b65('0x4c'),_0x31d061['dataValues']));_0x25d59d['push'](get_open_tabs(_0x6b65('0x5a'),_0x31d061['dataValues']));_0x25d59d['push'](get_open_tabs(_0x6b65('0x4f'),_0x31d061[_0x6b65('0x4d')]));_0x25d59d[_0x6b65('0x48')](get_open_tabs(_0x6b65('0x50'),_0x31d061[_0x6b65('0x4d')]));_0x25d59d[_0x6b65('0x48')](get_open_tabs('fax',_0x31d061[_0x6b65('0x4d')]));_0x25d59d[_0x6b65('0x48')](get_open_tabs(_0x6b65('0x4e'),_0x31d061[_0x6b65('0x4d')]));return Promise[_0x6b65('0x51')](_0x25d59d);}else{return values;}})[_0x6b65('0x24')](function(){return values;})[_0x6b65('0x24')](respondWithResult(_0x2640c8,null))[_0x6b65('0x52')](handleError(_0x2640c8,null));};exports[_0x6b65('0x23')]=function(_0x4e08b7,_0x3580d2){if(_0x4e08b7[_0x6b65('0x5b')]['id']){delete _0x4e08b7[_0x6b65('0x5b')]['id'];}delete _0x4e08b7[_0x6b65('0x5b')][_0x6b65('0x28')];return db['User']['find']({'where':{'id':_0x4e08b7['params']['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x3580d2,null))[_0x6b65('0x24')](saveUpdates(_0x4e08b7[_0x6b65('0x5b')],null))['then'](respondWithResult(_0x3580d2,null))['catch'](handleError(_0x3580d2,null));};exports[_0x6b65('0x5c')]=function(_0x160029,_0x5ea9ee){return db[_0x6b65('0x39')]['describe']()[_0x6b65('0x24')](respondWithResult(_0x5ea9ee,null))['catch'](handleError(_0x5ea9ee,null));};exports[_0x6b65('0x5d')]=function(_0x49bc83,_0x297378){return db['User'][_0x6b65('0x33')]({'where':{'id':_0x49bc83[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x297378,null))[_0x6b65('0x24')](function(_0x4ee76d){if(_0x4ee76d){return _0x4ee76d[_0x6b65('0x5d')](_0x49bc83[_0x6b65('0x5b')]['ids'],_[_0x6b65('0x5f')](_0x49bc83[_0x6b65('0x5b')],[_0x6b65('0x60'),'id'])||{});}})['then'](respondWithResult(_0x297378,null))[_0x6b65('0x52')](handleError(_0x297378,null));};function validateUser(_0x2c0a74){return new Promise(function(_0x6605fb,_0x2090c2){if(_0x2c0a74[_0x6b65('0x61')])return _0x6605fb(_0x2c0a74);return db['Setting'][_0x6b65('0x62')](0x1)[_0x6b65('0x24')](function(_0x535d72){if(_0x535d72[_0x6b65('0x63')])authService[_0x6b65('0x64')](_0x2c0a74[_0x6b65('0x3e')]);db[_0x6b65('0x39')][_0x6b65('0x65')](_0x6b65('0x61'))['then'](function(_0x419ed8){if(_[_0x6b65('0x66')](_0x419ed8)){_0x2c0a74[_0x6b65('0x61')]=_0x535d72[_0x6b65('0x67')]||0x1;return;}if(_[_0x6b65('0x66')](_0x535d72[_0x6b65('0x67')])||_0x535d72['min_internal']===_0x419ed8){_0x2c0a74[_0x6b65('0x61')]=_0x419ed8+0x1;return;}if(_0x535d72[_0x6b65('0x67')]>_0x419ed8){_0x2c0a74['internal']=_0x535d72[_0x6b65('0x67')];return;}return db[_0x6b65('0x68')]['query'](_0x6b65('0x69'),{'type':db[_0x6b65('0x68')]['QueryTypes'][_0x6b65('0x6a')]})[_0x6b65('0x24')](function(_0x5589c6){if(_0x5589c6&&_0x5589c6[_0x6b65('0x4b')]){for(var _0x50cbfe=0x0,_0x34bc74=_0x5589c6[_0x6b65('0x4b')];_0x50cbfe<_0x34bc74&&_[_0x6b65('0x66')](_0x2c0a74[_0x6b65('0x61')]);_0x50cbfe++){if(_0x535d72[_0x6b65('0x67')]<=_0x5589c6[_0x50cbfe][_0x6b65('0x6b')]){_0x2c0a74[_0x6b65('0x61')]=_0x5589c6[_0x50cbfe][_0x6b65('0x6b')];}else if(_0x535d72[_0x6b65('0x67')]>_0x5589c6[_0x50cbfe]['from']&&_0x535d72['min_internal']<=_0x5589c6[_0x50cbfe]['to']){_0x2c0a74[_0x6b65('0x61')]=_0x535d72[_0x6b65('0x67')];}}}if(_[_0x6b65('0x66')](_0x2c0a74[_0x6b65('0x61')])){_0x2c0a74[_0x6b65('0x61')]=_0x419ed8+0x1;}return _0x6605fb(_0x2c0a74);});});})['catch'](function(_0xa29aa5){_0x2090c2(_0xa29aa5);});});}function updateUser(_0x5e49d5){return new Promise(function(_0x5443d6,_0x47c6ad){try{if(_0x5e49d5[_0x6b65('0x6c')]){_0x5e49d5[_0x6b65('0x6d')]=_0x5e49d5[_0x6b65('0x61')];_0x5e49d5['VoiceMail']={'mailbox':_0x5e49d5[_0x6b65('0x61')],'password':_0x5e49d5['password'],'fullname':_0x5e49d5[_0x6b65('0x6e')],'email':_0x5e49d5[_0x6b65('0x6f')]};}if(_0x5e49d5[_0x6b65('0x28')]==='agent'){if(!_0x5e49d5[_0x6b65('0x70')])_0x5e49d5[_0x6b65('0x70')]=[_0x6b65('0x71'),'102','103',_0x6b65('0x72'),_0x6b65('0x73'),_0x6b65('0x74'),_0x6b65('0x75'),_0x6b65('0x76'),'107',_0x6b65('0x77'),_0x6b65('0x78'),'100',_0x6b65('0x79'),_0x6b65('0x7a'),_0x6b65('0x7b')];}_0x5443d6(_0x5e49d5);}catch(_0x16647b){_0x47c6ad(_0x16647b);}});}exports[_0x6b65('0x7c')]=function(_0x366b0e,_0x40b5ad){if(_0x366b0e[_0x6b65('0x2b')][_0x6b65('0x28')]==='agent')throw new Error(_0x6b65('0x7d'));if(_0x366b0e[_0x6b65('0x5b')][_0x6b65('0x28')]===_0x6b65('0x2b')&&_0x366b0e[_0x6b65('0x2b')][_0x6b65('0x28')]!==_0x6b65('0x29')){throw new Error(_0x6b65('0x7e'));}if(_0x366b0e[_0x6b65('0x5b')][_0x6b65('0x28')]===_0x6b65('0x29')&&_0x366b0e[_0x6b65('0x2b')][_0x6b65('0x28')]!==_0x6b65('0x29')){throw new Error(_0x6b65('0x7f'));}return licenseUtil['checkUserLimits']([_0x366b0e['body']])[_0x6b65('0x24')](function(){return validateUser(_0x366b0e[_0x6b65('0x5b')]);})[_0x6b65('0x24')](function(_0x587dae){return updateUser(_0x587dae)[_0x6b65('0x24')](function(_0x12727f){if(_0x12727f[_0x6b65('0x28')]===_0x6b65('0x29')){_0x12727f[_0x6b65('0x80')]=_0x366b0e['user'][_0x6b65('0x80')];delete _0x12727f[_0x6b65('0x81')];}return _0x12727f;});})[_0x6b65('0x24')](function(_0x51a3ea){return db[_0x6b65('0x39')][_0x6b65('0x7c')](_0x51a3ea,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})[_0x6b65('0x24')](function(_0x1dc2e1){if(_0x366b0e[_0x6b65('0x5b')][_0x6b65('0x28')]===_0x6b65('0x2b'))return _0x1dc2e1;if(_0x366b0e[_0x6b65('0x2b')][_0x6b65('0x28')]!==_0x6b65('0x2b'))return _0x1dc2e1;return db[_0x6b65('0x82')]['find']({'where':{'name':_0x1dc2e1['role']==='agent'?_0x6b65('0x2c'):_0x6b65('0x2e'),'userProfileId':_0x366b0e[_0x6b65('0x2b')][_0x6b65('0x81')]},'raw':!![]})[_0x6b65('0x24')](function(_0x39d619){if(!_0x39d619||_0x39d619[_0x6b65('0x83')]!=0x0)return _0x1dc2e1;return db[_0x6b65('0x35')][_0x6b65('0x7c')]({'name':_0x1dc2e1[_0x6b65('0x34')],'resourceId':_0x1dc2e1['id'],'type':_0x39d619[_0x6b65('0x34')],'sectionId':_0x39d619['id']},{})[_0x6b65('0x24')](function(){return _0x1dc2e1;});})[_0x6b65('0x52')](function(_0x432c79){logger[_0x6b65('0x17')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x432c79);throw _0x432c79;});})[_0x6b65('0x24')](respondWithResult(_0x40b5ad,0xc9))[_0x6b65('0x52')](handleError(_0x40b5ad,null));};exports[_0x6b65('0x84')]=function(_0x521b7f,_0x1fbec4){var _0x42b1d2=_0x521b7f['body'];var _0x473ddc=[];if(_0x521b7f[_0x6b65('0x2b')][_0x6b65('0x28')]==='agent')throw new Error(_0x6b65('0x7d'));if(_[_0x6b65('0x85')](_0x42b1d2,['role',_0x6b65('0x2b')])&&_0x521b7f[_0x6b65('0x2b')][_0x6b65('0x28')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x6b65('0x85')](_0x42b1d2,[_0x6b65('0x28'),'admin'])&&_0x521b7f[_0x6b65('0x2b')][_0x6b65('0x28')]!==_0x6b65('0x29')){throw new Error(_0x6b65('0x86'));}return licenseUtil[_0x6b65('0x87')](_0x42b1d2)[_0x6b65('0x24')](function(){return validateUser(_0x42b1d2[0x0]);})[_0x6b65('0x24')](function(){for(var _0x1a97b0=0x1;_0x1a97b0<_0x42b1d2[_0x6b65('0x4b')];_0x1a97b0++){var _0x360bee=_0x42b1d2[_0x1a97b0-0x1][_0x6b65('0x61')];if(!_0x42b1d2[_0x1a97b0][_0x6b65('0x61')])_0x42b1d2[_0x1a97b0]['internal']=_0x360bee+0x1;_0x473ddc[_0x6b65('0x48')](validateUser(_0x42b1d2[_0x1a97b0]));}return Promise[_0x6b65('0x51')](_0x473ddc);})[_0x6b65('0x24')](function(){_0x473ddc=[];for(var _0x306138=0x0;_0x306138<_0x42b1d2[_0x6b65('0x4b')];_0x306138++){_0x473ddc[_0x6b65('0x48')](updateUser(_0x42b1d2[_0x306138]));}return Promise[_0x6b65('0x51')](_0x473ddc);})['then'](function(){_0x473ddc=_0x42b1d2[_0x6b65('0x30')](function(_0x2b628e){return db['User'][_0x6b65('0x7c')](_0x2b628e,{'include':[{'model':db[_0x6b65('0x88')],'as':_0x6b65('0x88')}]})['then'](function(_0x4edf3c){_0x2b628e['id']=_0x4edf3c['id'];return _0x2b628e;});});return Promise[_0x6b65('0x51')](_0x473ddc);})['then'](function(_0x18fa83){if(_0x521b7f['body']['role']===_0x6b65('0x2b'))return _0x18fa83;if(_0x521b7f[_0x6b65('0x2b')]['role']!=='user')return _0x18fa83;var _0x284d20=_[_0x6b65('0x85')](_0x18fa83,function(_0x48c083){return _0x48c083[_0x6b65('0x28')]===_0x6b65('0x2d')||_0x48c083[_0x6b65('0x28')]==='telephone';});if(!_0x284d20)return _0x18fa83;return db['UserProfileSection']['findAll']({'where':{'name':{'$or':[_0x6b65('0x2c'),_0x6b65('0x2e')]},'userProfileId':_0x521b7f['user'][_0x6b65('0x81')]},'raw':!![]})[_0x6b65('0x24')](function(_0x165e4f){if(_['isEmpty'](_0x165e4f)||!_[_0x6b65('0x85')](_0x165e4f,[_0x6b65('0x83'),0x0]))return _0x18fa83;_0x473ddc=[];var _0x53c7f2=_(_0x165e4f)['map'](function(_0x369334){if(_0x369334[_0x6b65('0x83')]===0x1)return;return _0x369334[_0x6b65('0x34')]==='Agents'?'agent':_0x6b65('0x89');})[_0x6b65('0x8a')]()[_0x6b65('0x31')]();for(var _0x276cf2=0x0;_0x276cf2<_0x18fa83[_0x6b65('0x4b')];_0x276cf2++){if(!_['includes'](_0x53c7f2,_0x18fa83[_0x276cf2][_0x6b65('0x28')]))return;var _0x1952c0=_0x18fa83[_0x276cf2][_0x6b65('0x28')]===_0x6b65('0x2d')?_0x6b65('0x2c'):_0x6b65('0x2e');_0x473ddc['push'](db['UserProfileResource'][_0x6b65('0x7c')]({'name':_0x18fa83[_0x276cf2][_0x6b65('0x34')],'resourceId':_0x18fa83[_0x276cf2]['id'],'type':_0x1952c0,'sectionId':_[_0x6b65('0x33')](_0x165e4f,['name',_0x1952c0])['id']},{}));}return Promise[_0x6b65('0x51')](_0x473ddc);});})[_0x6b65('0x24')](respondWithResult(_0x1fbec4,0xc9))['catch'](handleError(_0x1fbec4,null));};exports[_0x6b65('0x8b')]=function(_0xd2ed4b,_0x4b1e38){if(_0xd2ed4b[_0x6b65('0x5b')]['id']){delete _0xd2ed4b[_0x6b65('0x5b')]['id'];}return db[_0x6b65('0x39')][_0x6b65('0x33')]({'where':{'id':_0xd2ed4b['params']['id']}})[_0x6b65('0x24')](function(_0x93e96b){if(!_0x93e96b)return null;if(_0x93e96b['id']===_0xd2ed4b[_0x6b65('0x2b')]['id']){if(!_0xd2ed4b['body']['oldPassword']||!_0xd2ed4b[_0x6b65('0x5b')][_0x6b65('0x8c')]){throw new db[(_0x6b65('0x8d'))][(_0x6b65('0x8e'))](_0x6b65('0x8f'));}if(!_0x93e96b[_0x6b65('0x90')](_0xd2ed4b[_0x6b65('0x5b')][_0x6b65('0x91')])){throw new db['Sequelize'][(_0x6b65('0x8e'))]('Wrong\x20credentials');}if(_0xd2ed4b[_0x6b65('0x5b')][_0x6b65('0x91')]===_0xd2ed4b['body'][_0x6b65('0x8c')]){throw new db['Sequelize']['ValidationError'](_0x6b65('0x92'));}}else if(_0xd2ed4b[_0x6b65('0x2b')][_0x6b65('0x28')]===_0x6b65('0x29')){if(!_0xd2ed4b[_0x6b65('0x5b')][_0x6b65('0x8c')]){throw new db[(_0x6b65('0x8d'))]['ValidationError'](_0x6b65('0x93'));}}else if(_0xd2ed4b[_0x6b65('0x2b')]['role']===_0x6b65('0x2b')){if(!_0xd2ed4b[_0x6b65('0x5b')]['newPassword']){throw new db[(_0x6b65('0x8d'))][(_0x6b65('0x8e'))](_0x6b65('0x93'));}if(_0x93e96b[_0x6b65('0x28')]!==_0x6b65('0x2d')){throw new db[(_0x6b65('0x8d'))]['ValidationError'](_0x6b65('0x7d'));}}else{throw new db['Sequelize'][(_0x6b65('0x8e'))](_0x6b65('0x7d'));}return _0x93e96b;})[_0x6b65('0x24')](handleEntityNotFound(_0x4b1e38,null))[_0x6b65('0x24')](function(_0x4c1e4a){return db[_0x6b65('0x94')][_0x6b65('0x95')]({'attributes':['id',_0x6b65('0x63'),_0x6b65('0x96'),_0x6b65('0x97')]})['then'](function(_0x169d25){if(_0x169d25[_0x6b65('0x63')])authService[_0x6b65('0x64')](_0xd2ed4b[_0x6b65('0x5b')][_0x6b65('0x8c')]);if(!_0x169d25[_0x6b65('0x96')]||!_0x4c1e4a[_0x6b65('0x98')])return _0x4c1e4a;authService[_0x6b65('0x99')](_0xd2ed4b['body'][_0x6b65('0x8c')],_0x4c1e4a[_0x6b65('0x98')],_0x169d25['passwordHistoryLimit']);return _0x4c1e4a;})[_0x6b65('0x24')](saveUpdates({'password':_0xd2ed4b[_0x6b65('0x5b')]['newPassword'],'passwordResetAt':_0xd2ed4b[_0x6b65('0x2b')]['id']==_0xd2ed4b[_0x6b65('0x5e')]['id']?moment():null,'previousPasswords':authService[_0x6b65('0x9a')](_0xd2ed4b[_0x6b65('0x5b')][_0x6b65('0x8c')],_0x4c1e4a['previousPasswords'])},null));})[_0x6b65('0x24')](respondWithResult(_0x4b1e38,null))['catch'](handleError(_0x4b1e38,null));};exports['addQueues']=function(_0x529d09,_0x4da699){var _0x12d10e=_0x529d09['body']['channel'];return db['User'][_0x6b65('0x33')]({'where':{'id':_0x529d09[_0x6b65('0x5e')]['id']},'attributes':['id',_0x6b65('0x34'),_0x6b65('0x28'),_0x6b65('0x9b'),_0x6b65('0x9c'),_0x6b65('0x9d'),_0x6b65('0x9e')]})[_0x6b65('0x24')](handleEntityNotFound(_0x4da699,null))[_0x6b65('0x24')](function(_0x3b41be){if(_0x3b41be){if(!utils[_0x6b65('0x9f')](_0x12d10e)){throw new db['Sequelize'][(_0x6b65('0x8e'))](_0x6b65('0xa0'));}return _0x3b41be[_0x6b65('0xa1')+_[_0x6b65('0xa2')](_0x12d10e[_0x6b65('0xa3')]())+_0x6b65('0xa4')](_0x529d09[_0x6b65('0x5b')]['ids'],{'penalty':_0x529d09[_0x6b65('0x5b')][_0x6b65('0xa5')]||0x0})[_0x6b65('0xa6')](function(_0x44a4d4){for(var _0x79163a=0x0;_0x79163a<_0x529d09[_0x6b65('0x5b')][_0x6b65('0x60')][_0x6b65('0x4b')];_0x79163a+=0x1){var _0x1937c5={'UserId':Number(_0x529d09[_0x6b65('0x5e')]['id'])};_0x1937c5[_['capitalize'](_0x12d10e[_0x6b65('0xa3')]())+'QueueId']=Number(_0x529d09[_0x6b65('0x5b')]['ids'][_0x79163a]);socket[_0x6b65('0x25')](_0x6b65('0x2b')+_['capitalize'](_0x12d10e[_0x6b65('0xa3')]())+_0x6b65('0xa7'),_0x1937c5);}return _0x44a4d4;})[_0x6b65('0x24')](function(){if(_0x12d10e===_0x6b65('0xa8')){return db[_0x6b65('0xa9')][_0x6b65('0xaa')]({'where':{'id':_0x529d09[_0x6b65('0x5b')]['ids']||[]},'raw':!![],'attributes':['id',_0x6b65('0x34')]});}})['then'](function(_0x586a4b){var _0x176e46=_0x3b41be['get']({'plain':!![]});var _0x1baaae=[];if(_0x12d10e===_0x6b65('0xa8')&&_0x176e46[_0x6b65('0x28')]==='agent'&&_0x176e46[_0x6b65('0x9b')]){for(let _0x5064b2=0x0;_0x5064b2<_0x586a4b[_0x6b65('0x4b')];_0x5064b2+=0x1){_0x1baaae[_0x6b65('0x48')]({'membername':_0x176e46['name'],'UserId':_0x176e46['id'],'queue_name':_0x586a4b[_0x5064b2][_0x6b65('0x34')],'VoiceQueueId':_0x586a4b[_0x5064b2]['id'],'interface':_[_0x6b65('0x66')](_0x176e46[_0x6b65('0x9e')])?util[_0x6b65('0xab')](_0x6b65('0xac'),_0x176e46['name']):_0x176e46[_0x6b65('0x9e')],'paused':_0x176e46[_0x6b65('0x9d')]||![],'penalty':_0x529d09[_0x6b65('0x5b')]['penalty']||0x0});}return Promise[_0x6b65('0x51')](_0x1baaae[_0x6b65('0x30')](function(_0x2e72f4){return db[_0x6b65('0xad')]['upsert'](_0x2e72f4);}));}return _0x3b41be;});}})[_0x6b65('0x24')](respondWithStatusCode(_0x4da699,null))[_0x6b65('0x52')](handleError(_0x4da699,null));};exports['removeQueues']=function(_0x294d32,_0x28cd01){var _0x20c3bf,_0x1a635;return db[_0x6b65('0x39')][_0x6b65('0x33')]({'where':{'id':_0x294d32[_0x6b65('0x5e')]['id']},'attributes':['id',_0x6b65('0x34'),'role']})[_0x6b65('0x24')](handleEntityNotFound(_0x28cd01,null))[_0x6b65('0x24')](function(_0x1eab30){if(_0x1eab30){_0x20c3bf=_0x1eab30;if(!_0x294d32[_0x6b65('0x41')]['channel']||!utils[_0x6b65('0x9f')](_0x294d32[_0x6b65('0x41')][_0x6b65('0xae')])){throw new db['Sequelize'][(_0x6b65('0x8e'))]('Unknown\x20channel');}return _0x1eab30['remove'+_[_0x6b65('0xa2')](_0x294d32['query'][_0x6b65('0xae')][_0x6b65('0xa3')]())+_0x6b65('0xa4')](_0x294d32[_0x6b65('0x41')]['ids']);}})[_0x6b65('0x24')](function(_0x4533b5){if(_[_0x6b65('0xaf')](_0x294d32[_0x6b65('0x41')][_0x6b65('0x60')])){for(var _0x25e94e=0x0;_0x25e94e<_0x294d32[_0x6b65('0x41')]['ids']['length'];_0x25e94e+=0x1){_0x1a635={'UserId':Number(_0x294d32[_0x6b65('0x5e')]['id'])};_0x1a635[_[_0x6b65('0xa2')](_0x294d32['query'][_0x6b65('0xae')]['toLowerCase']())+_0x6b65('0xb0')]=Number(_0x294d32[_0x6b65('0x41')][_0x6b65('0x60')][_0x25e94e]);socket[_0x6b65('0x25')](_0x6b65('0x2b')+_[_0x6b65('0xa2')](_0x294d32[_0x6b65('0x41')][_0x6b65('0xae')][_0x6b65('0xa3')]())+_0x6b65('0xb1'),_0x1a635);}}else{_0x1a635={'UserId':Number(_0x294d32[_0x6b65('0x5e')]['id'])};_0x1a635[_[_0x6b65('0xa2')](_0x294d32[_0x6b65('0x41')][_0x6b65('0xae')][_0x6b65('0xa3')]())+_0x6b65('0xb0')]=Number(_0x294d32[_0x6b65('0x41')][_0x6b65('0x60')]);socket[_0x6b65('0x25')](_0x6b65('0x2b')+_[_0x6b65('0xa2')](_0x294d32[_0x6b65('0x41')][_0x6b65('0xae')]['toLowerCase']())+_0x6b65('0xb1'),_0x1a635);}return _0x4533b5;})[_0x6b65('0x24')](function(){if(_0x294d32[_0x6b65('0x41')][_0x6b65('0xae')]===_0x6b65('0xa8')){return db[_0x6b65('0xad')]['destroy']({'where':{'UserId':_0x294d32[_0x6b65('0x5e')]['id'],'VoiceQueueId':_0x294d32['query'][_0x6b65('0x60')]},'individualHooks':!![]})['then'](function(){return _0x20c3bf;});}return _0x20c3bf;})['then'](respondWithStatusCode(_0x28cd01,null))[_0x6b65('0x52')](handleError(_0x28cd01,null));};exports[_0x6b65('0xb2')]=function(_0x1891c1,_0x589fb7){_0x1891c1[_0x6b65('0x5b')]['userpic']=_0x1891c1[_0x6b65('0xb3')][_0x6b65('0xb4')];return db[_0x6b65('0x39')][_0x6b65('0x33')]({'where':{'id':_0x1891c1['params']['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x589fb7,null))['then'](saveUpdates(_0x1891c1[_0x6b65('0x5b')],null))[_0x6b65('0x24')](respondWithResult(_0x589fb7,null))[_0x6b65('0x52')](handleError(_0x589fb7,null));};exports[_0x6b65('0xb5')]=function(_0x813596,_0x13d1ac){var _0x3f7a35=path[_0x6b65('0xb6')](config[_0x6b65('0xb7')],_0x6b65('0xb8'));return db[_0x6b65('0x39')][_0x6b65('0x33')]({'where':{'id':_0x813596[_0x6b65('0x5e')]['id']},'attributes':['id',_0x6b65('0xb9')],'raw':!![]})[_0x6b65('0x24')](handleEntityNotFound(_0x13d1ac,null))[_0x6b65('0x24')](function(_0x26dc5b){if(_0x26dc5b){if(_[_0x6b65('0x66')](_0x26dc5b[_0x6b65('0xb9')])){return _0x13d1ac[_0x6b65('0xba')](_0x3f7a35);}else{if(!fs[_0x6b65('0xbb')](path[_0x6b65('0xb6')](config[_0x6b65('0xb7')],'server/files/images/',_0x26dc5b['userpic']))){return _0x13d1ac['download'](_0x3f7a35);}return _0x13d1ac[_0x6b65('0xba')](path[_0x6b65('0xb6')](config[_0x6b65('0xb7')],_0x6b65('0xbc'),_0x26dc5b[_0x6b65('0xb9')]));}}})[_0x6b65('0x52')](handleError(_0x13d1ac,null));};exports[_0x6b65('0xbd')]=function(_0x3487a0,_0x596be7){return db[_0x6b65('0x39')][_0x6b65('0x33')]({'where':{'id':_0x3487a0['params']['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x596be7,null))[_0x6b65('0x24')](function(_0x53e553){var _0x1a31e8=[];values=_0x53e553['dataValues'];_0x1a31e8[_0x6b65('0x48')](get_open_tabs(_0x6b65('0x4c'),_0x53e553['dataValues']));_0x1a31e8[_0x6b65('0x48')](get_open_tabs('sms',_0x53e553[_0x6b65('0x4d')]));_0x1a31e8['push'](get_open_tabs(_0x6b65('0x4f'),_0x53e553[_0x6b65('0x4d')]));_0x1a31e8['push'](get_open_tabs(_0x6b65('0x50'),_0x53e553[_0x6b65('0x4d')]));_0x1a31e8[_0x6b65('0x48')](get_open_tabs(_0x6b65('0xbe'),_0x53e553[_0x6b65('0x4d')]));_0x1a31e8['push'](get_open_tabs(_0x6b65('0x4e'),_0x53e553[_0x6b65('0x4d')]));return Promise[_0x6b65('0x51')](_0x1a31e8);})[_0x6b65('0x24')](function(_0x436c2c){if(_0x436c2c){var _0x38a099=_[_0x6b65('0x30')](values['ChatOpenTabs'],function(_0x79478d){return{'channel':'CHAT','id':_0x79478d['id'],'createdAt':_0x79478d[_0x6b65('0xbf')]};});var _0x302b68=_[_0x6b65('0x30')](values[_0x6b65('0xc0')],function(_0x224dc6){return{'channel':_0x6b65('0xc1'),'id':_0x224dc6['id'],'createdAt':_0x224dc6[_0x6b65('0xbf')]};});var _0x55935a=_[_0x6b65('0x30')](values[_0x6b65('0xc2')],function(_0x4991ed){return{'channel':'OPENCHANNEL','id':_0x4991ed['id'],'createdAt':_0x4991ed[_0x6b65('0xbf')]};});var _0x346349=_[_0x6b65('0x30')](values[_0x6b65('0xc3')],function(_0x34eb0b){return{'channel':_0x6b65('0xc4'),'id':_0x34eb0b['id'],'createdAt':_0x34eb0b[_0x6b65('0xbf')]};});var _0x21baa6=_[_0x6b65('0x30')](values[_0x6b65('0xc5')],function(_0x2b9e6d){return{'channel':_0x6b65('0xc6'),'id':_0x2b9e6d['id'],'createdAt':_0x2b9e6d[_0x6b65('0xbf')]};});var _0x93bd35=_[_0x6b65('0x30')](values['WhatsappOpenTabs'],function(_0x3e8ede){return{'channel':'WHATSAPP','id':_0x3e8ede['id'],'createdAt':_0x3e8ede[_0x6b65('0xbf')]};});var _0x3ac145=_[_0x6b65('0xc7')](_0x38a099,_0x302b68,_0x55935a,_0x346349,_0x21baa6,_0x93bd35);var _0x595968={'count':_0x3ac145['length'],'rows':_0x3ac145};return _0x595968;}else return null;})[_0x6b65('0x24')](respondWithResult(_0x596be7,null))['catch'](handleError(_0x596be7,null));};exports[_0x6b65('0xc8')]=function(_0x4a2e4c,_0x4cc25b){var _0x4fcf70={};var _0x4378ed={};var _0x5c32b1;var _0x4908fe;return db[_0x6b65('0x39')][_0x6b65('0x95')]({'where':{'id':_0x4a2e4c['params']['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x4cc25b,null))[_0x6b65('0x24')](function(_0x421061){if(_0x421061){_0x5c32b1=_0x421061;_0x4378ed[_0x6b65('0x58')]=_[_0x6b65('0x55')](db['CmContact']['rawAttributes']);_0x4378ed['query']=_[_0x6b65('0x55')](_0x4a2e4c['query']);_0x4378ed['filters']=_['intersection'](_0x4378ed['model'],_0x4378ed[_0x6b65('0x41')]);_0x4fcf70[_0x6b65('0x47')]=_['intersection'](_0x4378ed['model'],qs[_0x6b65('0x59')](_0x4a2e4c[_0x6b65('0x41')][_0x6b65('0x59')]));_0x4fcf70['attributes']=_0x4fcf70['attributes'][_0x6b65('0x4b')]?_0x4fcf70[_0x6b65('0x47')]:_0x4378ed[_0x6b65('0x58')];_0x4fcf70[_0x6b65('0xc9')]=qs[_0x6b65('0xca')](_0x4a2e4c[_0x6b65('0x41')][_0x6b65('0xca')]);_0x4fcf70[_0x6b65('0x40')]=qs[_0x6b65('0x56')](_[_0x6b65('0xcb')](_0x4a2e4c[_0x6b65('0x41')],_0x4378ed[_0x6b65('0x56')]));if(_0x4a2e4c[_0x6b65('0x41')][_0x6b65('0x3d')]){_0x4fcf70['where']=_[_0x6b65('0xcc')](_0x4fcf70[_0x6b65('0x40')],{'$or':_[_0x6b65('0x30')](_0x4fcf70[_0x6b65('0x47')],function(_0x40620b){var _0x911856={};_0x911856[_0x40620b]={'$like':'%'+_0x4a2e4c[_0x6b65('0x41')][_0x6b65('0x3d')]+'%'};return _0x911856;})});}_0x4fcf70=_[_0x6b65('0xcc')]({},_0x4fcf70,_0x4a2e4c[_0x6b65('0xcd')]);return _0x5c32b1[_0x6b65('0xc8')](_0x4fcf70);}})[_0x6b65('0x24')](function(_0x23373e){if(_0x23373e){_0x4908fe=_0x23373e[_0x6b65('0x4b')];if(_0x4a2e4c[_0x6b65('0x41')]['hasOwnProperty']('includeAll')){_0x4fcf70[_0x6b65('0x43')]=[{'model':db[_0x6b65('0xce')],'as':_0x6b65('0xcf'),'required':![]},{'model':db[_0x6b65('0xd0')],'as':_0x6b65('0xd1'),'attributes':['id',_0x6b65('0x34'),'color'],'where':_0x4a2e4c[_0x6b65('0x41')][_0x6b65('0xd2')]?{'id':_0x4a2e4c['query'][_0x6b65('0xd2')]}:undefined,'required':_0x4a2e4c['query'][_0x6b65('0xd2')]?!![]:![]}];}if(!_0x4a2e4c[_0x6b65('0x41')][_0x6b65('0xd3')](_0x6b65('0xd4'))){_0x4fcf70[_0x6b65('0x1e')]=qs[_0x6b65('0x1e')](_0x4a2e4c[_0x6b65('0x41')][_0x6b65('0x1e')]);_0x4fcf70[_0x6b65('0x1c')]=qs[_0x6b65('0x1c')](_0x4a2e4c[_0x6b65('0x41')][_0x6b65('0x1c')]);}return _0x5c32b1[_0x6b65('0xc8')](_0x4fcf70);}})[_0x6b65('0x24')](function(_0x44c123){if(_0x44c123){return _0x44c123?{'count':_0x4908fe,'rows':_0x44c123}:null;}})[_0x6b65('0x24')](respondWithResult(_0x4cc25b,null))['catch'](handleError(_0x4cc25b,null));};exports[_0x6b65('0xd5')]=function(_0x2fdbb1,_0x572b3e){var _0x59178c;var _0x4dadfb={};var _0x2cf0c2;return db[_0x6b65('0x39')]['findOne']({'where':{'id':_0x2fdbb1[_0x6b65('0x5e')]['id']},'attributes':['id',_0x6b65('0x34'),'role']})[_0x6b65('0x24')](handleEntityNotFound(_0x572b3e,null))[_0x6b65('0x24')](function(_0x222628){if(!utils[_0x6b65('0x9f')](_0x2fdbb1[_0x6b65('0x41')][_0x6b65('0xae')])){throw new db[(_0x6b65('0x8d'))][(_0x6b65('0x8e'))]('Unknown\x20channel');}_0x59178c=_0x222628;var _0x40f35f={};_0x40f35f[_0x6b65('0x58')]=_['keys'](db[_[_0x6b65('0xa2')](_0x2fdbb1[_0x6b65('0x41')][_0x6b65('0xae')])+_0x6b65('0xd6')][_0x6b65('0x3a')]);_0x40f35f[_0x6b65('0x41')]=_[_0x6b65('0x55')](_0x2fdbb1[_0x6b65('0x41')]);_0x40f35f['filters']=_['intersection'](_0x40f35f[_0x6b65('0x58')],_0x40f35f['query']);_0x4dadfb['attributes']=_[_0x6b65('0x57')](_0x40f35f[_0x6b65('0x58')],qs['fields'](_0x2fdbb1['query'][_0x6b65('0x59')]));_0x4dadfb['attributes']=_0x4dadfb[_0x6b65('0x47')][_0x6b65('0x4b')]?_0x4dadfb[_0x6b65('0x47')]:_0x40f35f[_0x6b65('0x58')];_0x4dadfb[_0x6b65('0xc9')]=qs[_0x6b65('0xca')](_0x2fdbb1[_0x6b65('0x41')][_0x6b65('0xca')]);_0x4dadfb[_0x6b65('0x40')]=qs['filters'](_[_0x6b65('0xcb')](_0x2fdbb1['query'],_0x40f35f[_0x6b65('0x56')]));if(_0x2fdbb1[_0x6b65('0x41')][_0x6b65('0x3d')]){_0x4dadfb[_0x6b65('0x40')]=_['merge'](_0x4dadfb[_0x6b65('0x40')],{'$or':_[_0x6b65('0x30')](_0x4dadfb[_0x6b65('0x47')],function(_0x433622){var _0x2549e2={};_0x2549e2[_0x433622]={'$like':'%'+_0x2fdbb1[_0x6b65('0x41')][_0x6b65('0x3d')]+'%'};return _0x2549e2;})});}_0x4dadfb=_[_0x6b65('0xcc')]({},_0x4dadfb,_0x2fdbb1['options']);switch(_0x59178c[_0x6b65('0x28')]){case _0x6b65('0x29'):return db[_['capitalize'](_0x2fdbb1[_0x6b65('0x41')]['channel'])+_0x6b65('0xd6')]['findAll'](_0x4dadfb);case _0x6b65('0x2b'):case'agent':return _0x59178c[_0x6b65('0xd7')+_[_0x6b65('0xa2')](_0x2fdbb1[_0x6b65('0x41')][_0x6b65('0xae')])+_0x6b65('0xa4')](_0x4dadfb);default:throw new db[(_0x6b65('0x8d'))][(_0x6b65('0x8e'))](_0x6b65('0xd8'));}})[_0x6b65('0x24')](function(_0x56c214){_0x2cf0c2=_0x56c214[_0x6b65('0x4b')];if(!_0x2fdbb1['query'][_0x6b65('0xd3')](_0x6b65('0xd4'))){_0x4dadfb['limit']=qs[_0x6b65('0x1e')](_0x2fdbb1[_0x6b65('0x41')][_0x6b65('0x1e')]);_0x4dadfb['offset']=qs[_0x6b65('0x1c')](_0x2fdbb1['query'][_0x6b65('0x1c')]);}switch(_0x59178c[_0x6b65('0x28')]){case'admin':return db[_[_0x6b65('0xa2')](_0x2fdbb1[_0x6b65('0x41')][_0x6b65('0xae')])+'Queue'][_0x6b65('0xaa')](_0x4dadfb);case _0x6b65('0x2b'):case _0x6b65('0x2d'):return _0x59178c[_0x6b65('0xd7')+_[_0x6b65('0xa2')](_0x2fdbb1[_0x6b65('0x41')][_0x6b65('0xae')])+_0x6b65('0xa4')](_0x4dadfb);}})[_0x6b65('0x24')](function(_0x1eafef){return{'count':_0x2cf0c2,'rows':_0x1eafef};})[_0x6b65('0x24')](respondWithResult(_0x572b3e,null))[_0x6b65('0x52')](handleError(_0x572b3e,null));};exports[_0x6b65('0xd9')]=function(_0x4e6409,_0xab9dac){var _0x10c26a={};var _0x3148bf={};var _0x2b2b46;var _0x8d3841;return db[_0x6b65('0x39')]['findOne']({'where':{'id':_0x4e6409[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0xab9dac,null))['then'](function(_0x44dc1c){if(_0x44dc1c){_0x2b2b46=_0x44dc1c;_0x3148bf[_0x6b65('0x58')]=_[_0x6b65('0x55')](db['UserVoiceQueueRt'][_0x6b65('0x3a')]);_0x3148bf[_0x6b65('0x41')]=_[_0x6b65('0x55')](_0x4e6409['query']);_0x3148bf[_0x6b65('0x56')]=_['intersection'](_0x3148bf[_0x6b65('0x58')],_0x3148bf[_0x6b65('0x41')]);_0x10c26a[_0x6b65('0x47')]=_[_0x6b65('0x57')](_0x3148bf['model'],qs[_0x6b65('0x59')](_0x4e6409[_0x6b65('0x41')][_0x6b65('0x59')]));_0x10c26a['attributes']=_0x10c26a[_0x6b65('0x47')][_0x6b65('0x4b')]?_0x10c26a[_0x6b65('0x47')]:_0x3148bf['model'];_0x10c26a['order']=qs['sort'](_0x4e6409['query'][_0x6b65('0xca')]);_0x10c26a[_0x6b65('0x40')]=qs[_0x6b65('0x56')](_[_0x6b65('0xcb')](_0x4e6409[_0x6b65('0x41')],_0x3148bf[_0x6b65('0x56')]));if(_0x4e6409['query'][_0x6b65('0x3d')]){_0x10c26a[_0x6b65('0x40')]=_[_0x6b65('0xcc')](_0x10c26a[_0x6b65('0x40')],{'$or':_[_0x6b65('0x30')](_0x10c26a[_0x6b65('0x47')],function(_0x3960b6){var _0x2653b0={};_0x2653b0[_0x3960b6]={'$like':'%'+_0x4e6409['query']['filter']+'%'};return _0x2653b0;})});}_0x10c26a=_[_0x6b65('0xcc')]({},_0x10c26a,_0x4e6409[_0x6b65('0xcd')]);return _0x2b2b46[_0x6b65('0xd9')](_0x10c26a);}})[_0x6b65('0x24')](function(_0x418a42){if(_0x418a42){_0x8d3841=_0x418a42[_0x6b65('0x4b')];if(!_0x4e6409[_0x6b65('0x41')][_0x6b65('0xd3')]('nolimit')){_0x10c26a[_0x6b65('0x1e')]=qs[_0x6b65('0x1e')](_0x4e6409['query'][_0x6b65('0x1e')]);_0x10c26a[_0x6b65('0x1c')]=qs[_0x6b65('0x1c')](_0x4e6409[_0x6b65('0x41')]['offset']);}return _0x2b2b46[_0x6b65('0xd9')](_0x10c26a);}})[_0x6b65('0x24')](function(_0x5a4f72){if(_0x5a4f72){return _0x5a4f72?{'count':_0x8d3841,'rows':_0x5a4f72}:null;}})[_0x6b65('0x24')](respondWithResult(_0xab9dac,null))[_0x6b65('0x52')](handleError(_0xab9dac,null));};exports[_0x6b65('0xda')]=function(_0xba58ff,_0x41d2bb){var _0x2c6993={};var _0x4604a3={};var _0x3081d4;var _0x5b7fd7;return db[_0x6b65('0x39')]['findOne']({'where':{'id':_0xba58ff['params']['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x41d2bb,null))['then'](function(_0xea8257){if(_0xea8257){_0x3081d4=_0xea8257;_0x4604a3[_0x6b65('0x58')]=_[_0x6b65('0x55')](db[_0x6b65('0xdb')][_0x6b65('0x3a')]);_0x4604a3[_0x6b65('0x41')]=_[_0x6b65('0x55')](_0xba58ff[_0x6b65('0x41')]);_0x4604a3['filters']=_[_0x6b65('0x57')](_0x4604a3[_0x6b65('0x58')],_0x4604a3[_0x6b65('0x41')]);_0x2c6993[_0x6b65('0x47')]=_['intersection'](_0x4604a3['model'],qs[_0x6b65('0x59')](_0xba58ff[_0x6b65('0x41')]['fields']));_0x2c6993[_0x6b65('0x47')]=_0x2c6993[_0x6b65('0x47')][_0x6b65('0x4b')]?_0x2c6993[_0x6b65('0x47')]:_0x4604a3[_0x6b65('0x58')];_0x2c6993[_0x6b65('0xc9')]=qs['sort'](_0xba58ff[_0x6b65('0x41')][_0x6b65('0xca')]);_0x2c6993[_0x6b65('0x40')]=qs[_0x6b65('0x56')](_[_0x6b65('0xcb')](_0xba58ff[_0x6b65('0x41')],_0x4604a3['filters']));if(_0xba58ff[_0x6b65('0x41')]['filter']){_0x2c6993['where']=_[_0x6b65('0xcc')](_0x2c6993['where'],{'$or':_[_0x6b65('0x30')](_0x2c6993[_0x6b65('0x47')],function(_0x13e523){var _0x1b14bc={};_0x1b14bc[_0x13e523]={'$like':'%'+_0xba58ff['query'][_0x6b65('0x3d')]+'%'};return _0x1b14bc;})});}_0x2c6993=_[_0x6b65('0xcc')]({},_0x2c6993,_0xba58ff[_0x6b65('0xcd')]);return _0x3081d4[_0x6b65('0xda')](_0x2c6993);}})[_0x6b65('0x24')](function(_0x48108d){if(_0x48108d){_0x5b7fd7=_0x48108d[_0x6b65('0x4b')];if(!_0xba58ff[_0x6b65('0x41')][_0x6b65('0xd3')](_0x6b65('0xd4'))){_0x2c6993['limit']=qs[_0x6b65('0x1e')](_0xba58ff['query'][_0x6b65('0x1e')]);_0x2c6993['offset']=qs[_0x6b65('0x1c')](_0xba58ff[_0x6b65('0x41')][_0x6b65('0x1c')]);}return _0x3081d4[_0x6b65('0xda')](_0x2c6993);}})['then'](function(_0x23fb4f){if(_0x23fb4f){return _0x23fb4f?{'count':_0x5b7fd7,'rows':_0x23fb4f}:null;}})['then'](respondWithResult(_0x41d2bb,null))['catch'](handleError(_0x41d2bb,null));};exports[_0x6b65('0xdc')]=function(_0x3e9bcc,_0x2f7e1c){var _0x4b8c67={'raw':!![],'where':{}};var _0x4bfd7c={};var _0x153ede={'count':0x0,'rows':[]};return db[_0x6b65('0x39')]['findOne']({'where':{'id':_0x3e9bcc[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x2f7e1c,null))[_0x6b65('0x24')](function(_0xbd9ad4){if(_0xbd9ad4){_0x4bfd7c['model']=_[_0x6b65('0x55')](db['VoiceRecording'][_0x6b65('0x3a')]);_0x4bfd7c['query']=_['keys'](_0x3e9bcc[_0x6b65('0x41')]);_0x4bfd7c[_0x6b65('0x56')]=_['intersection'](_0x4bfd7c[_0x6b65('0x58')],_0x4bfd7c[_0x6b65('0x41')]);_0x4b8c67[_0x6b65('0x47')]=_[_0x6b65('0x57')](_0x4bfd7c['model'],qs[_0x6b65('0x59')](_0x3e9bcc[_0x6b65('0x41')][_0x6b65('0x59')]));_0x4b8c67[_0x6b65('0x47')]=_0x4b8c67[_0x6b65('0x47')][_0x6b65('0x4b')]?_0x4b8c67[_0x6b65('0x47')]:_0x4bfd7c[_0x6b65('0x58')];if(!_0x3e9bcc[_0x6b65('0x41')][_0x6b65('0xd3')](_0x6b65('0xd4'))){_0x4b8c67[_0x6b65('0x1e')]=qs['limit'](_0x3e9bcc[_0x6b65('0x41')]['limit']);_0x4b8c67[_0x6b65('0x1c')]=qs[_0x6b65('0x1c')](_0x3e9bcc[_0x6b65('0x41')]['offset']);}_0x4b8c67[_0x6b65('0xc9')]=qs[_0x6b65('0xca')](_0x3e9bcc[_0x6b65('0x41')]['sort']);_0x4b8c67[_0x6b65('0x40')]=qs['filters'](_['pick'](_0x3e9bcc[_0x6b65('0x41')],_0x4bfd7c['filters']));_0x4b8c67[_0x6b65('0x40')][_0x6b65('0xdd')]=_0xbd9ad4['id'];if(_0x3e9bcc[_0x6b65('0x41')][_0x6b65('0x3d')]){_0x4b8c67[_0x6b65('0x40')]=_[_0x6b65('0xcc')](_0x4b8c67['where'],{'$or':_[_0x6b65('0x30')](_0x4b8c67[_0x6b65('0x47')],function(_0x4565b7){var _0x24ae39={};_0x24ae39[_0x4565b7]={'$like':'%'+_0x3e9bcc[_0x6b65('0x41')]['filter']+'%'};return _0x24ae39;})});}_0x4b8c67=_['merge']({},_0x4b8c67,_0x3e9bcc[_0x6b65('0xcd')]);return db['VoiceRecording'][_0x6b65('0x1f')]({'where':_0x4b8c67['where']})[_0x6b65('0x24')](function(_0x50189d){_0x153ede[_0x6b65('0x1f')]=_0x50189d;if(_0x3e9bcc['query'][_0x6b65('0x42')]){_0x4b8c67[_0x6b65('0x43')]=[{'all':!![]}];}return db[_0x6b65('0xde')][_0x6b65('0xaa')](_0x4b8c67);})[_0x6b65('0x24')](function(_0x11ed88){_0x153ede['rows']=_0x11ed88;return _0x153ede;});}})[_0x6b65('0x24')](respondWithFilteredResult(_0x2f7e1c,_0x4b8c67))[_0x6b65('0x52')](handleError(_0x2f7e1c,null));};exports[_0x6b65('0xdf')]=function(_0x1d8443,_0x5df8e3){var _0x18033c={'raw':!![],'where':{}};var _0x1149e1={};var _0x2bfd12={'count':0x0,'rows':[]};return db['User'][_0x6b65('0x95')]({'where':{'id':_0x1d8443[_0x6b65('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5df8e3,null))['then'](function(_0x485df1){if(_0x485df1){_0x1149e1[_0x6b65('0x58')]=_[_0x6b65('0x55')](db[_0x6b65('0xe0')][_0x6b65('0x3a')]);_0x1149e1['query']=_[_0x6b65('0x55')](_0x1d8443[_0x6b65('0x41')]);_0x1149e1[_0x6b65('0x56')]=_[_0x6b65('0x57')](_0x1149e1['model'],_0x1149e1[_0x6b65('0x41')]);_0x18033c[_0x6b65('0x47')]=_[_0x6b65('0x57')](_0x1149e1[_0x6b65('0x58')],qs['fields'](_0x1d8443[_0x6b65('0x41')]['fields']));_0x18033c['attributes']=_0x18033c[_0x6b65('0x47')]['length']?_0x18033c[_0x6b65('0x47')]:_0x1149e1[_0x6b65('0x58')];if(!_0x1d8443[_0x6b65('0x41')][_0x6b65('0xd3')](_0x6b65('0xd4'))){_0x18033c[_0x6b65('0x1e')]=qs[_0x6b65('0x1e')](_0x1d8443[_0x6b65('0x41')][_0x6b65('0x1e')]);_0x18033c[_0x6b65('0x1c')]=qs[_0x6b65('0x1c')](_0x1d8443[_0x6b65('0x41')][_0x6b65('0x1c')]);}_0x18033c[_0x6b65('0xc9')]=qs['sort'](_0x1d8443[_0x6b65('0x41')][_0x6b65('0xca')]);_0x18033c[_0x6b65('0x40')]=qs[_0x6b65('0x56')](_['pick'](_0x1d8443[_0x6b65('0x41')],_0x1149e1[_0x6b65('0x56')]));_0x18033c[_0x6b65('0x40')][_0x6b65('0xdd')]=_0x485df1['id'];if(_0x1d8443[_0x6b65('0x41')][_0x6b65('0x3d')]){_0x18033c['where']=_[_0x6b65('0xcc')](_0x18033c[_0x6b65('0x40')],{'$or':_['map'](_0x18033c[_0x6b65('0x47')],function(_0x55da74){var _0x530302={};_0x530302[_0x55da74]={'$like':'%'+_0x1d8443['query'][_0x6b65('0x3d')]+'%'};return _0x530302;})});}_0x18033c=_[_0x6b65('0xcc')]({},_0x18033c,_0x1d8443[_0x6b65('0xcd')]);return db[_0x6b65('0xe0')][_0x6b65('0x1f')]({'where':_0x18033c[_0x6b65('0x40')]})[_0x6b65('0x24')](function(_0x3c5769){_0x2bfd12['count']=_0x3c5769;if(_0x1d8443[_0x6b65('0x41')][_0x6b65('0x42')]){_0x18033c[_0x6b65('0x43')]=[{'all':!![]}];}return db['ScreenRecording'][_0x6b65('0xaa')](_0x18033c);})[_0x6b65('0x24')](function(_0x1e21a2){_0x2bfd12[_0x6b65('0x49')]=_0x1e21a2;return _0x2bfd12;});}})['then'](respondWithFilteredResult(_0x5df8e3,_0x18033c))['catch'](handleError(_0x5df8e3,null));};exports[_0x6b65('0xe1')]=function(_0x114a67,_0x30c0bb){var _0xaa4707={};var _0x18a108={};var _0x272be;var _0x1fcd32;return db[_0x6b65('0x39')]['findOne']({'where':{'id':_0x114a67['params']['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x30c0bb,null))[_0x6b65('0x24')](function(_0x441fa6){if(_0x441fa6){_0x272be=_0x441fa6;_0x18a108['model']=_[_0x6b65('0x55')](db[_0x6b65('0xe2')]['rawAttributes']);_0x18a108['query']=_[_0x6b65('0x55')](_0x114a67[_0x6b65('0x41')]);_0x18a108['filters']=_[_0x6b65('0x57')](_0x18a108[_0x6b65('0x58')],_0x18a108[_0x6b65('0x41')]);_0xaa4707[_0x6b65('0x47')]=_[_0x6b65('0x57')](_0x18a108[_0x6b65('0x58')],qs[_0x6b65('0x59')](_0x114a67['query'][_0x6b65('0x59')]));_0xaa4707[_0x6b65('0x47')]=_0xaa4707[_0x6b65('0x47')]['length']?_0xaa4707[_0x6b65('0x47')]:_0x18a108[_0x6b65('0x58')];_0xaa4707[_0x6b65('0xc9')]=qs[_0x6b65('0xca')](_0x114a67[_0x6b65('0x41')][_0x6b65('0xca')]);_0xaa4707[_0x6b65('0x40')]=qs[_0x6b65('0x56')](_[_0x6b65('0xcb')](_0x114a67['query'],_0x18a108[_0x6b65('0x56')]));if(_0x114a67[_0x6b65('0x41')][_0x6b65('0x3d')]){_0xaa4707[_0x6b65('0x40')]=_[_0x6b65('0xcc')](_0xaa4707['where'],{'$or':_[_0x6b65('0x30')](_0xaa4707[_0x6b65('0x47')],function(_0x3b657d){var _0xf9d7d7={};_0xf9d7d7[_0x3b657d]={'$like':'%'+_0x114a67[_0x6b65('0x41')][_0x6b65('0x3d')]+'%'};return _0xf9d7d7;})});}_0xaa4707=_[_0x6b65('0xcc')]({},_0xaa4707,_0x114a67['options']);return _0x272be[_0x6b65('0xe1')](_0xaa4707);}})[_0x6b65('0x24')](function(_0x16e850){if(_0x16e850){_0x1fcd32=_0x16e850[_0x6b65('0x4b')];if(!_0x114a67[_0x6b65('0x41')][_0x6b65('0xd3')](_0x6b65('0xd4'))){_0xaa4707[_0x6b65('0x1e')]=qs[_0x6b65('0x1e')](_0x114a67['query'][_0x6b65('0x1e')]);_0xaa4707[_0x6b65('0x1c')]=qs[_0x6b65('0x1c')](_0x114a67[_0x6b65('0x41')][_0x6b65('0x1c')]);}return _0x272be[_0x6b65('0xe1')](_0xaa4707);}})[_0x6b65('0x24')](function(_0xf5f71){if(_0xf5f71){return _0xf5f71?{'count':_0x1fcd32,'rows':_0xf5f71}:null;}})['then'](respondWithResult(_0x30c0bb,null))[_0x6b65('0x52')](handleError(_0x30c0bb,null));};exports[_0x6b65('0xe3')]=function(_0x2106ff,_0x2de877){var _0x575ae5={};var _0x308855={};var _0x4d1f9d;var _0x443619;return db['User'][_0x6b65('0x95')]({'where':{'id':_0x2106ff[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x2de877,null))[_0x6b65('0x24')](function(_0x34df1d){if(_0x34df1d){_0x4d1f9d=_0x34df1d;_0x308855[_0x6b65('0x58')]=_[_0x6b65('0x55')](db[_0x6b65('0xe4')][_0x6b65('0x3a')]);_0x308855[_0x6b65('0x41')]=_[_0x6b65('0x55')](_0x2106ff[_0x6b65('0x41')]);_0x308855['filters']=_[_0x6b65('0x57')](_0x308855[_0x6b65('0x58')],_0x308855[_0x6b65('0x41')]);_0x575ae5[_0x6b65('0x47')]=_[_0x6b65('0x57')](_0x308855[_0x6b65('0x58')],qs[_0x6b65('0x59')](_0x2106ff[_0x6b65('0x41')][_0x6b65('0x59')]));_0x575ae5[_0x6b65('0x47')]=_0x575ae5[_0x6b65('0x47')]['length']?_0x575ae5[_0x6b65('0x47')]:_0x308855['model'];_0x575ae5[_0x6b65('0xc9')]=qs[_0x6b65('0xca')](_0x2106ff['query'][_0x6b65('0xca')]);_0x575ae5[_0x6b65('0x40')]=qs[_0x6b65('0x56')](_['pick'](_0x2106ff[_0x6b65('0x41')],_0x308855[_0x6b65('0x56')]));if(_0x2106ff[_0x6b65('0x41')][_0x6b65('0x3d')]){_0x575ae5[_0x6b65('0x40')]=_[_0x6b65('0xcc')](_0x575ae5['where'],{'$or':_[_0x6b65('0x30')](_0x575ae5[_0x6b65('0x47')],function(_0x1c15d8){var _0x9e403f={};_0x9e403f[_0x1c15d8]={'$like':'%'+_0x2106ff[_0x6b65('0x41')][_0x6b65('0x3d')]+'%'};return _0x9e403f;})});}_0x575ae5=_[_0x6b65('0xcc')]({},_0x575ae5,_0x2106ff[_0x6b65('0xcd')]);return _0x4d1f9d[_0x6b65('0xe3')](_0x575ae5);}})[_0x6b65('0x24')](function(_0x5c8e20){if(_0x5c8e20){_0x443619=_0x5c8e20[_0x6b65('0x4b')];if(!_0x2106ff[_0x6b65('0x41')][_0x6b65('0xd3')](_0x6b65('0xd4'))){_0x575ae5[_0x6b65('0x1e')]=qs[_0x6b65('0x1e')](_0x2106ff['query'][_0x6b65('0x1e')]);_0x575ae5['offset']=qs['offset'](_0x2106ff['query'][_0x6b65('0x1c')]);}return _0x4d1f9d['getOpenchannelInteractions'](_0x575ae5);}})[_0x6b65('0x24')](function(_0x9f25c6){if(_0x9f25c6){return _0x9f25c6?{'count':_0x443619,'rows':_0x9f25c6}:null;}})[_0x6b65('0x24')](respondWithResult(_0x2de877,null))['catch'](handleError(_0x2de877,null));};exports[_0x6b65('0xe5')]=function(_0x5ab7eb,_0x5de810){var _0x41504f={'raw':!![],'where':{}};var _0x2e9111={};var _0xe02c5f={'count':0x0,'rows':[]};return db[_0x6b65('0x39')][_0x6b65('0x95')]({'where':{'id':_0x5ab7eb[_0x6b65('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5de810,null))[_0x6b65('0x24')](function(_0x32577d){if(_0x32577d){_0x2e9111[_0x6b65('0x58')]=_[_0x6b65('0x55')](db[_0x6b65('0xe6')][_0x6b65('0x3a')]);_0x2e9111['query']=_['keys'](_0x5ab7eb[_0x6b65('0x41')]);_0x2e9111[_0x6b65('0x56')]=_[_0x6b65('0x57')](_0x2e9111[_0x6b65('0x58')],_0x2e9111['query']);_0x41504f[_0x6b65('0x47')]=_[_0x6b65('0x57')](_0x2e9111[_0x6b65('0x58')],qs[_0x6b65('0x59')](_0x5ab7eb['query'][_0x6b65('0x59')]));_0x41504f[_0x6b65('0x47')]=_0x41504f['attributes'][_0x6b65('0x4b')]?_0x41504f[_0x6b65('0x47')]:_0x2e9111[_0x6b65('0x58')];if(!_0x5ab7eb[_0x6b65('0x41')][_0x6b65('0xd3')]('nolimit')){_0x41504f['limit']=qs[_0x6b65('0x1e')](_0x5ab7eb[_0x6b65('0x41')][_0x6b65('0x1e')]);_0x41504f[_0x6b65('0x1c')]=qs[_0x6b65('0x1c')](_0x5ab7eb[_0x6b65('0x41')][_0x6b65('0x1c')]);}_0x41504f[_0x6b65('0xc9')]=qs[_0x6b65('0xca')](_0x5ab7eb[_0x6b65('0x41')]['sort']);_0x41504f[_0x6b65('0x40')]=qs[_0x6b65('0x56')](_[_0x6b65('0xcb')](_0x5ab7eb[_0x6b65('0x41')],_0x2e9111[_0x6b65('0x56')]));_0x41504f[_0x6b65('0x40')][_0x6b65('0xdd')]=_0x32577d['id'];if(_0x5ab7eb[_0x6b65('0x41')][_0x6b65('0x3d')]){_0x41504f[_0x6b65('0x40')]=_[_0x6b65('0xcc')](_0x41504f[_0x6b65('0x40')],{'$or':_[_0x6b65('0x30')](_0x41504f[_0x6b65('0x47')],function(_0x15210a){var _0x4e7dff={};_0x4e7dff[_0x15210a]={'$like':'%'+_0x5ab7eb['query']['filter']+'%'};return _0x4e7dff;})});}_0x41504f=_[_0x6b65('0xcc')]({},_0x41504f,_0x5ab7eb[_0x6b65('0xcd')]);return db[_0x6b65('0xe6')][_0x6b65('0x1f')]({'where':_0x41504f[_0x6b65('0x40')]})[_0x6b65('0x24')](function(_0xcaf2f9){_0xe02c5f[_0x6b65('0x1f')]=_0xcaf2f9;if(_0x5ab7eb[_0x6b65('0x41')][_0x6b65('0x42')]){_0x41504f[_0x6b65('0x43')]=[{'all':!![]}];}return db[_0x6b65('0xe6')][_0x6b65('0xaa')](_0x41504f);})[_0x6b65('0x24')](function(_0x4881d4){_0xe02c5f[_0x6b65('0x49')]=_0x4881d4;return _0xe02c5f;});}})['then'](respondWithFilteredResult(_0x5de810,_0x41504f))[_0x6b65('0x52')](handleError(_0x5de810,null));};exports[_0x6b65('0xe7')]=function(_0x5ba587,_0x20d177){var _0x29a6be={};var _0x41539f={};var _0x30d7d5;var _0x1b696a;return db['User']['findOne']({'where':{'id':_0x5ba587[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x20d177,null))[_0x6b65('0x24')](function(_0x34db47){if(_0x34db47){_0x30d7d5=_0x34db47;_0x41539f['model']=_[_0x6b65('0x55')](db[_0x6b65('0xe8')][_0x6b65('0x3a')]);_0x41539f['query']=_[_0x6b65('0x55')](_0x5ba587['query']);_0x41539f[_0x6b65('0x56')]=_[_0x6b65('0x57')](_0x41539f['model'],_0x41539f[_0x6b65('0x41')]);_0x29a6be[_0x6b65('0x47')]=_['intersection'](_0x41539f[_0x6b65('0x58')],qs[_0x6b65('0x59')](_0x5ba587[_0x6b65('0x41')][_0x6b65('0x59')]));_0x29a6be['attributes']=_0x29a6be[_0x6b65('0x47')][_0x6b65('0x4b')]?_0x29a6be[_0x6b65('0x47')]:_0x41539f['model'];_0x29a6be[_0x6b65('0xc9')]=qs[_0x6b65('0xca')](_0x5ba587[_0x6b65('0x41')][_0x6b65('0xca')]);_0x29a6be[_0x6b65('0x40')]=qs[_0x6b65('0x56')](_[_0x6b65('0xcb')](_0x5ba587[_0x6b65('0x41')],_0x41539f[_0x6b65('0x56')]));if(_0x5ba587[_0x6b65('0x41')]['filter']){_0x29a6be[_0x6b65('0x40')]=_[_0x6b65('0xcc')](_0x29a6be['where'],{'$or':_[_0x6b65('0x30')](_0x29a6be[_0x6b65('0x47')],function(_0x33bd78){var _0x4058b1={};_0x4058b1[_0x33bd78]={'$like':'%'+_0x5ba587[_0x6b65('0x41')]['filter']+'%'};return _0x4058b1;})});}_0x29a6be=_['merge']({},_0x29a6be,_0x5ba587['options']);return _0x30d7d5[_0x6b65('0xe7')](_0x29a6be);}})[_0x6b65('0x24')](function(_0x4c453e){if(_0x4c453e){_0x1b696a=_0x4c453e[_0x6b65('0x4b')];if(!_0x5ba587[_0x6b65('0x41')]['hasOwnProperty'](_0x6b65('0xd4'))){_0x29a6be[_0x6b65('0x1e')]=qs['limit'](_0x5ba587[_0x6b65('0x41')]['limit']);_0x29a6be[_0x6b65('0x1c')]=qs[_0x6b65('0x1c')](_0x5ba587[_0x6b65('0x41')][_0x6b65('0x1c')]);}return _0x30d7d5[_0x6b65('0xe7')](_0x29a6be);}})[_0x6b65('0x24')](function(_0x50bb95){if(_0x50bb95){return _0x50bb95?{'count':_0x1b696a,'rows':_0x50bb95}:null;}})['then'](respondWithResult(_0x20d177,null))['catch'](handleError(_0x20d177,null));};exports[_0x6b65('0xe9')]=function(_0x2ca20a,_0xd3360b){var _0x3c1228={};var _0x248f07={};var _0x2e2e27;var _0x128b07;return db[_0x6b65('0x39')][_0x6b65('0x95')]({'where':{'id':_0x2ca20a[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0xd3360b,null))[_0x6b65('0x24')](function(_0x3f982a){if(_0x3f982a){_0x2e2e27=_0x3f982a;_0x248f07[_0x6b65('0x58')]=_['keys'](db['FaxInteraction'][_0x6b65('0x3a')]);_0x248f07[_0x6b65('0x41')]=_[_0x6b65('0x55')](_0x2ca20a[_0x6b65('0x41')]);_0x248f07['filters']=_[_0x6b65('0x57')](_0x248f07[_0x6b65('0x58')],_0x248f07[_0x6b65('0x41')]);_0x3c1228[_0x6b65('0x47')]=_[_0x6b65('0x57')](_0x248f07[_0x6b65('0x58')],qs[_0x6b65('0x59')](_0x2ca20a[_0x6b65('0x41')][_0x6b65('0x59')]));_0x3c1228[_0x6b65('0x47')]=_0x3c1228[_0x6b65('0x47')][_0x6b65('0x4b')]?_0x3c1228[_0x6b65('0x47')]:_0x248f07[_0x6b65('0x58')];_0x3c1228[_0x6b65('0xc9')]=qs['sort'](_0x2ca20a['query'][_0x6b65('0xca')]);_0x3c1228['where']=qs['filters'](_[_0x6b65('0xcb')](_0x2ca20a[_0x6b65('0x41')],_0x248f07['filters']));if(_0x2ca20a[_0x6b65('0x41')][_0x6b65('0x3d')]){_0x3c1228[_0x6b65('0x40')]=_[_0x6b65('0xcc')](_0x3c1228[_0x6b65('0x40')],{'$or':_['map'](_0x3c1228[_0x6b65('0x47')],function(_0x1fa815){var _0x5cdda8={};_0x5cdda8[_0x1fa815]={'$like':'%'+_0x2ca20a[_0x6b65('0x41')][_0x6b65('0x3d')]+'%'};return _0x5cdda8;})});}_0x3c1228=_[_0x6b65('0xcc')]({},_0x3c1228,_0x2ca20a[_0x6b65('0xcd')]);return _0x2e2e27[_0x6b65('0xe9')](_0x3c1228);}})[_0x6b65('0x24')](function(_0x5387fb){if(_0x5387fb){_0x128b07=_0x5387fb[_0x6b65('0x4b')];if(!_0x2ca20a[_0x6b65('0x41')][_0x6b65('0xd3')](_0x6b65('0xd4'))){_0x3c1228[_0x6b65('0x1e')]=qs['limit'](_0x2ca20a[_0x6b65('0x41')][_0x6b65('0x1e')]);_0x3c1228['offset']=qs['offset'](_0x2ca20a[_0x6b65('0x41')][_0x6b65('0x1c')]);}return _0x2e2e27['getFaxInteractions'](_0x3c1228);}})[_0x6b65('0x24')](function(_0x3abce4){if(_0x3abce4){return _0x3abce4?{'count':_0x128b07,'rows':_0x3abce4}:null;}})[_0x6b65('0x24')](respondWithResult(_0xd3360b,null))[_0x6b65('0x52')](handleError(_0xd3360b,null));};exports[_0x6b65('0xea')]=function(_0x3bab2b,_0x289611){var _0x4a3ec3={};var _0x33afef={};var _0x2bf379;var _0x31fa63;return db['User']['findOne']({'where':{'id':_0x3bab2b[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x289611,null))['then'](function(_0xd0c3f9){if(_0xd0c3f9){_0x2bf379=_0xd0c3f9;_0x33afef[_0x6b65('0x58')]=_['keys'](db[_0x6b65('0xeb')][_0x6b65('0x3a')]);_0x33afef[_0x6b65('0x41')]=_[_0x6b65('0x55')](_0x3bab2b[_0x6b65('0x41')]);_0x33afef[_0x6b65('0x56')]=_[_0x6b65('0x57')](_0x33afef[_0x6b65('0x58')],_0x33afef[_0x6b65('0x41')]);_0x4a3ec3['attributes']=_[_0x6b65('0x57')](_0x33afef[_0x6b65('0x58')],qs[_0x6b65('0x59')](_0x3bab2b['query'][_0x6b65('0x59')]));_0x4a3ec3['attributes']=_0x4a3ec3[_0x6b65('0x47')][_0x6b65('0x4b')]?_0x4a3ec3[_0x6b65('0x47')]:_0x33afef[_0x6b65('0x58')];_0x4a3ec3[_0x6b65('0xc9')]=qs['sort'](_0x3bab2b[_0x6b65('0x41')][_0x6b65('0xca')]);_0x4a3ec3[_0x6b65('0x40')]=qs['filters'](_[_0x6b65('0xcb')](_0x3bab2b[_0x6b65('0x41')],_0x33afef['filters']));if(_0x3bab2b[_0x6b65('0x41')][_0x6b65('0x3d')]){_0x4a3ec3[_0x6b65('0x40')]=_[_0x6b65('0xcc')](_0x4a3ec3[_0x6b65('0x40')],{'$or':_[_0x6b65('0x30')](_0x4a3ec3[_0x6b65('0x47')],function(_0x5ad101){var _0x2fb7cb={};_0x2fb7cb[_0x5ad101]={'$like':'%'+_0x3bab2b[_0x6b65('0x41')][_0x6b65('0x3d')]+'%'};return _0x2fb7cb;})});}_0x4a3ec3=_[_0x6b65('0xcc')]({},_0x4a3ec3,_0x3bab2b[_0x6b65('0xcd')]);return _0x2bf379[_0x6b65('0xea')](_0x4a3ec3);}})['then'](function(_0x17a7a1){if(_0x17a7a1){_0x31fa63=_0x17a7a1[_0x6b65('0x4b')];if(!_0x3bab2b[_0x6b65('0x41')][_0x6b65('0xd3')](_0x6b65('0xd4'))){_0x4a3ec3['limit']=qs['limit'](_0x3bab2b['query'][_0x6b65('0x1e')]);_0x4a3ec3[_0x6b65('0x1c')]=qs[_0x6b65('0x1c')](_0x3bab2b[_0x6b65('0x41')][_0x6b65('0x1c')]);}return _0x2bf379['getWhatsappInteractions'](_0x4a3ec3);}})[_0x6b65('0x24')](function(_0x53e81d){if(_0x53e81d){return _0x53e81d?{'count':_0x31fa63,'rows':_0x53e81d}:null;}})[_0x6b65('0x24')](respondWithResult(_0x289611,null))[_0x6b65('0x52')](handleError(_0x289611,null));};exports[_0x6b65('0xec')]=function(_0x282eac,_0x1448b5,_0x2f63a9){var _0x2a040d;var _0x5dcfb7;var _0x421d93;var _0x205c0a=!_[_0x6b65('0x66')](_0x282eac[_0x6b65('0x5e')]['id'])?_0x282eac[_0x6b65('0x5e')]['id']:!_[_0x6b65('0x66')](_0x282eac[_0x6b65('0x2b')]['id'])?_0x282eac[_0x6b65('0x2b')]['id']:null;return db[_0x6b65('0x39')][_0x6b65('0x33')]({'where':{'id':_0x205c0a,'role':{'$or':[_0x6b65('0x29'),_0x6b65('0x2b'),_0x6b65('0x2d')]}},'attributes':['id',_0x6b65('0x34'),'phone',_0x6b65('0xed'),'role',_0x6b65('0x61'),_0x6b65('0x9c')]})[_0x6b65('0x24')](function(_0x3befe6){if(_0x3befe6){if(_0x3befe6[_0x6b65('0x28')]===_0x6b65('0x2d')){_0x2a040d=_0x3befe6;if(_0x282eac[_0x6b65('0x5b')]['interface']){_0x421d93=util['format'](_0x6b65('0xee'),_0x2a040d[_0x282eac[_0x6b65('0x5b')]['interface']]);}else if(_0x282eac['body']['intrf']){_0x421d93=util['format'](_0x6b65('0xac'),_0x282eac['body']['intrf']);}else{_0x421d93=util[_0x6b65('0xab')](_0x6b65('0xac'),_0x2a040d['name']);}socket['to'](util[_0x6b65('0xab')](_0x6b65('0xef'),_0x2a040d[_0x6b65('0x34')]))[_0x6b65('0x25')]('user:forcelogout',{'user':{'id':_0x2a040d['id'],'name':_0x2a040d['name']},'ip':_0x282eac[_0x6b65('0xf0')][_0x6b65('0xf1')]||_0x282eac[_0x6b65('0xf2')][_0x6b65('0xf3')]||_0x282eac[_0x6b65('0xf4')]['remoteAddress']||_0x282eac[_0x6b65('0xf2')][_0x6b65('0xf4')][_0x6b65('0xf3')]});return db[_0x6b65('0xad')][_0x6b65('0x27')]({'where':{'membername':_0x2a040d[_0x6b65('0x34')]},'individualHooks':!![]});}}else{throw new db[(_0x6b65('0x8d'))][(_0x6b65('0x8e'))](_0x6b65('0xf5'));}})['then'](function(){if(_0x2a040d){return _0x2a040d[_0x6b65('0xf6')]({'raw':!![]});}})[_0x6b65('0x24')](function(_0x19d97d){if(_0x2a040d){if(_0x19d97d){_0x5dcfb7=_0x19d97d;if(_0x5dcfb7[_0x6b65('0x4b')]){var _0x23157f=_0x5dcfb7[_0x6b65('0x30')](function(_0x5d8eb1){var _0x4c3f25={'membername':_0x2a040d['name'],'UserId':_0x2a040d['id'],'queue_name':_0x5d8eb1[_0x6b65('0x34')],'VoiceQueueId':_0x5d8eb1['id'],'interface':_0x421d93,'paused':_0x2a040d[_0x6b65('0x9c')]||![],'penalty':_0x5d8eb1['UserVoiceQueue.penalty']||0x0};return db[_0x6b65('0xad')]['upsert'](_0x4c3f25);});return Promise[_0x6b65('0x51')](_0x23157f);}}}})['then'](function(){if(_0x2a040d){return db[_0x6b65('0xf7')][_0x6b65('0xaa')]({'where':{'membername':_0x2a040d[_0x6b65('0x34')],'exitAt':null}});}})['then'](function(_0x5c1a25){if(_0x2a040d){var _0x2eba9e=[];_0x5c1a25[_0x6b65('0xf8')](function(_0x46f9b6){_0x2eba9e[_0x6b65('0x48')](_0x46f9b6[_0x6b65('0x23')]({'exitAt':moment()[_0x6b65('0xab')](_0x6b65('0xf9'))}));});return Promise[_0x6b65('0x51')](_0x2eba9e);}})[_0x6b65('0x24')](function(){if(_0x2a040d){var _0x15557f=[];var _0x20c76c=[];var _0x2047b7=utils[_0x6b65('0xfa')]();var _0x320290={'membername':_0x2a040d[_0x6b65('0x34')],'interface':_0x421d93,'enterAt':moment()[_0x6b65('0xab')](_0x6b65('0xf9')),'role':_0x2a040d[_0x6b65('0x28')],'internal':_0x2a040d[_0x6b65('0x61')]};_0x2047b7['forEach'](function(_0xdefc1e){_0x15557f['push'](_[_0x6b65('0xcc')]({'channel':_0xdefc1e,'type':_0x6b65('0xfb'),'data1':_0x282eac[_0x6b65('0x5b')][_0x6b65('0xfc')],'data2':_0x421d93},_0x320290));if(_0x2a040d[_0x6b65('0x9c')]){_0x20c76c[_0x6b65('0x48')](_[_0x6b65('0xcc')]({'channel':_0xdefc1e,'type':_0x6b65('0xfd'),'data1':'LOGININPAUSE'},_0x320290));}});return db[_0x6b65('0xf7')][_0x6b65('0x84')](_0x15557f[_0x6b65('0xc7')](_0x20c76c),{'individualHooks':!![]});}})[_0x6b65('0x24')](function(){if(_0x2a040d){return _0x2a040d[_0x6b65('0x23')]({'online':!![],'lastLoginAt':moment()[_0x6b65('0xab')](_0x6b65('0xf9')),'voicePause':_0x2a040d['loginInPause']||![],'mailPause':_0x2a040d[_0x6b65('0x9c')]||![],'chatPause':_0x2a040d['loginInPause']||![],'faxPause':_0x2a040d[_0x6b65('0x9c')]||![],'smsPause':_0x2a040d[_0x6b65('0x9c')]||![],'openchannelPause':_0x2a040d['loginInPause']||![],'whatsappPause':_0x2a040d[_0x6b65('0x9c')]||![],'pauseType':_0x2a040d[_0x6b65('0x9c')]?_0x6b65('0xfe'):null,'interface':_0x421d93,'lastPauseAt':moment()[_0x6b65('0xab')](_0x6b65('0xf9'))});}})[_0x6b65('0x24')](function(_0x2f3c39){if(_0x282eac[_0x6b65('0xff')]){return _0x2f63a9();}else{return Promise[_0x6b65('0x100')](_0x2f3c39)[_0x6b65('0x24')](respondWithResult(_0x1448b5,null));}})[_0x6b65('0x52')](handleError(_0x1448b5,null));};exports[_0x6b65('0x101')]=function(_0x3a08f7,_0x2f220b){var _0x3189bc;return db[_0x6b65('0x39')]['find']({'where':{'id':_0x3a08f7['params']['id'],'role':_0x6b65('0x2d')},'attributes':['id','name','role']})['then'](handleEntityNotFound(_0x2f220b,null))[_0x6b65('0x24')](function(_0x58c986){if(_0x58c986){_0x3189bc=_0x58c986;return db[_0x6b65('0xad')][_0x6b65('0x27')]({'where':{'membername':_0x3189bc[_0x6b65('0x34')]},'individualHooks':!![]});}})[_0x6b65('0x24')](function(){return db[_0x6b65('0xf7')][_0x6b65('0xaa')]({'where':{'membername':_0x3189bc[_0x6b65('0x34')],'exitAt':null}});})['then'](function(_0x5d3235){var _0x2880dc=[];_0x5d3235[_0x6b65('0xf8')](function(_0x39d0bf){_0x2880dc[_0x6b65('0x48')](_0x39d0bf['update']({'exitAt':moment()[_0x6b65('0xab')](_0x6b65('0xf9'))}));});return Promise['all'](_0x2880dc);})[_0x6b65('0x24')](function(){return _0x3189bc['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x6b65('0x24')](respondWithResult(_0x2f220b,null))[_0x6b65('0x52')](handleError(_0x2f220b,null));};exports[_0x6b65('0x102')]=function(_0x544fd3,_0x454d65){var _0x3b8c66;return db[_0x6b65('0xad')][_0x6b65('0x23')]({'paused':0x1},{'where':{'UserId':_0x544fd3['params']['id']},'individualHooks':!![]})[_0x6b65('0x24')](function(){return db[_0x6b65('0x39')][_0x6b65('0x33')]({'where':{'id':_0x544fd3[_0x6b65('0x5e')]['id'],'role':'agent'},'attributes':['id','name','role',_0x6b65('0x61'),_0x6b65('0x9e'),_0x6b65('0x9b')]});})[_0x6b65('0x24')](handleEntityNotFound(_0x454d65,null))[_0x6b65('0x24')](function(_0x56caec){if(_0x56caec){_0x3b8c66=_0x56caec;return respondWithRpcPromise('QueuePause',_0x6b65('0x102'),{'id':_0x3b8c66['id'],'name':_0x3b8c66['name'],'pause':!![]});}})[_0x6b65('0x24')](function(){if(_0x3b8c66){return db[_0x6b65('0xf7')]['findAll']({'where':{'membername':_0x3b8c66[_0x6b65('0x34')],'type':'PAUSE','exitAt':null}});}})['then'](function(_0x4304ea){if(_0x4304ea[_0x6b65('0x4b')]){var _0x5dfc78=moment()[_0x6b65('0xab')](_0x6b65('0xf9'));for(var _0x25c45d=0x0,_0x3af35a=_0x4304ea[_0x6b65('0x4b')];_0x25c45d<_0x3af35a;_0x25c45d++){_0x4304ea[_0x25c45d][_0x6b65('0x103')]({'exitAt':_0x5dfc78});}}})['then'](function(){var _0x1064a1=[];var _0x3e529e=utils[_0x6b65('0xfa')]();_0x3e529e[_0x6b65('0xf8')](function(_0x412739){_0x1064a1[_0x6b65('0x48')]({'channel':_0x412739,'membername':_0x3b8c66[_0x6b65('0x34')],'interface':_[_0x6b65('0x66')](_0x3b8c66[_0x6b65('0x9e')])?util['format'](_0x6b65('0xac'),_0x3b8c66[_0x6b65('0x34')]):_0x3b8c66[_0x6b65('0x9e')],'type':_0x6b65('0xfd'),'enterAt':moment()[_0x6b65('0xab')](_0x6b65('0xf9')),'data1':_0x544fd3[_0x6b65('0x5b')][_0x6b65('0x3b')]||_0x6b65('0x104'),'role':_0x3b8c66[_0x6b65('0x28')],'internal':_0x3b8c66[_0x6b65('0x61')]});});return db[_0x6b65('0xf7')][_0x6b65('0x84')](_0x1064a1,{'individualHooks':!![]});})[_0x6b65('0x24')](function(){return _0x3b8c66['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x544fd3['body'][_0x6b65('0x3b')]||_0x6b65('0x104'),'lastPauseAt':moment()[_0x6b65('0xab')](_0x6b65('0xf9'))});})[_0x6b65('0x24')](respondWithResult(_0x454d65,null))[_0x6b65('0x52')](handleError(_0x454d65,null));};exports[_0x6b65('0x105')]=function(_0x1a1e23,_0x4c1542){if(_0x1a1e23[_0x6b65('0x5b')][_0x6b65('0xae')]&&!utils[_0x6b65('0x9f')](_0x1a1e23[_0x6b65('0x5b')][_0x6b65('0xae')])){throw new APIBadRequestError(util[_0x6b65('0xab')](_0x6b65('0x106'),_0x1a1e23[_0x6b65('0x5b')]['channel']));}return db[_0x6b65('0x39')][_0x6b65('0x33')]({'where':{'id':_0x1a1e23['params']['id']},'attributes':['id',_0x6b65('0x34'),_0x6b65('0x28'),_0x6b65('0x61'),_0x6b65('0x9e'),_0x6b65('0x9b'),'voicePause',_0x6b65('0x107'),_0x6b65('0x108'),_0x6b65('0x109'),_0x6b65('0x10a'),_0x6b65('0x10b'),_0x6b65('0x10c'),'pauseType',_0x6b65('0x10d')]})[_0x6b65('0x24')](function(_0x4b6bda){if(!_0x4b6bda){throw new APINotFoundError(util[_0x6b65('0xab')](_0x6b65('0x10e'),_0x1a1e23[_0x6b65('0x5e')]['id']));}return _0x4b6bda[_0x6b65('0x105')](_0x1a1e23[_0x6b65('0x5b')]['channel']);})[_0x6b65('0x24')](respondWithResult(_0x4c1542,null))['catch'](APIHandleError(_0x4c1542));};exports[_0x6b65('0x10f')]=function(_0x77176c,_0x305330){var _0x47bf8f={};var _0x32726b={};var _0x4da568;var _0x12c013;return db['User']['findOne']({'where':{'id':_0x77176c[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x305330,null))[_0x6b65('0x24')](function(_0x1ef654){if(_0x1ef654){_0x4da568=_0x1ef654;_0x32726b[_0x6b65('0x58')]=_[_0x6b65('0x55')](db['Team']['rawAttributes']);_0x32726b[_0x6b65('0x41')]=_[_0x6b65('0x55')](_0x77176c[_0x6b65('0x41')]);_0x32726b[_0x6b65('0x56')]=_[_0x6b65('0x57')](_0x32726b[_0x6b65('0x58')],_0x32726b[_0x6b65('0x41')]);_0x47bf8f[_0x6b65('0x47')]=_[_0x6b65('0x57')](_0x32726b[_0x6b65('0x58')],qs[_0x6b65('0x59')](_0x77176c[_0x6b65('0x41')][_0x6b65('0x59')]));_0x47bf8f['attributes']=_0x47bf8f[_0x6b65('0x47')][_0x6b65('0x4b')]?_0x47bf8f[_0x6b65('0x47')]:_0x32726b[_0x6b65('0x58')];_0x47bf8f['order']=qs['sort'](_0x77176c[_0x6b65('0x41')][_0x6b65('0xca')]);_0x47bf8f[_0x6b65('0x40')]=qs['filters'](_[_0x6b65('0xcb')](_0x77176c['query'],_0x32726b['filters']));if(_0x77176c[_0x6b65('0x41')]['filter']){_0x47bf8f[_0x6b65('0x40')]=_['merge'](_0x47bf8f[_0x6b65('0x40')],{'$or':_[_0x6b65('0x30')](_0x47bf8f['attributes'],function(_0x490bd0){var _0x5c1654={};_0x5c1654[_0x490bd0]={'$like':'%'+_0x77176c[_0x6b65('0x41')][_0x6b65('0x3d')]+'%'};return _0x5c1654;})});}_0x47bf8f=_[_0x6b65('0xcc')]({},_0x47bf8f,_0x77176c['options']);return _0x4da568['getTeams'](_0x47bf8f);}})[_0x6b65('0x24')](function(_0x5899c9){if(_0x5899c9){_0x12c013=_0x5899c9[_0x6b65('0x4b')];if(!_0x77176c[_0x6b65('0x41')][_0x6b65('0xd3')](_0x6b65('0xd4'))){_0x47bf8f[_0x6b65('0x1e')]=qs[_0x6b65('0x1e')](_0x77176c['query']['limit']);_0x47bf8f['offset']=qs['offset'](_0x77176c[_0x6b65('0x41')]['offset']);}return _0x4da568['getTeams'](_0x47bf8f);}})[_0x6b65('0x24')](function(_0x54cc91){if(_0x54cc91){return _0x54cc91?{'count':_0x12c013,'rows':_0x54cc91}:null;}})[_0x6b65('0x24')](respondWithResult(_0x305330,null))['catch'](handleError(_0x305330,null));};exports[_0x6b65('0x110')]=function(_0x3259f9,_0x2633f9){var _0x143ebd=_0x3259f9[_0x6b65('0x5e')]['id'];var _0x34db56=_0x3259f9['body']?_0x3259f9[_0x6b65('0x5b')][_0x6b65('0x60')]:null;var _0xb27a52=[];return Promise[_0x6b65('0x100')]()[_0x6b65('0x24')](function(){if(!_0x34db56)throw new APIBadRequestError(_0x6b65('0x111'));})[_0x6b65('0x24')](function(){return db[_0x6b65('0x39')][_0x6b65('0x95')]({'where':{'id':_0x143ebd}});})['then'](function(_0xc756d7){if(!_0xc756d7)throw new APINotFoundError(util[_0x6b65('0xab')](_0x6b65('0x10e'),_0x3259f9[_0x6b65('0x5e')]['id']));return db[_0x6b65('0x68')]['transaction'](function(_0x24b178){return _0xc756d7[_0x6b65('0x110')](_0x34db56,{'transaction':_0x24b178})[_0x6b65('0x24')](function(){return db[_0x6b65('0x112')]['findAll']({'where':{'id':{'$in':_0x34db56}}});})[_0x6b65('0x24')](function(_0x251117){var _0x18f5db=_[_0x6b65('0x30')](_0x251117,function(_0x162cff){return _0x162cff['getAssociatedQueues']();});return Promise[_0x6b65('0x51')](_0x18f5db);})[_0x6b65('0x24')](function(_0x3adf6b){_0xb27a52=_[_0x6b65('0x113')](_0x3adf6b);var _0x4d932b=_[_0x6b65('0x30')](_0xb27a52,function(_0x2498dc){return _0x2498dc[_0x6b65('0x114')](_0xc756d7['id'],{'transaction':_0x24b178});});return Promise[_0x6b65('0x51')](_0x4d932b);})[_0x6b65('0x24')](function(){if(!_0xc756d7['online'])return;var _0x22b4cf=_['filter'](_0xb27a52,function(_0x17c67c){return _0x17c67c[_0x6b65('0x115')]('channel')===_0x6b65('0x116');});var _0x35df0f=_['map'](_0x22b4cf,function(_0x5134d7){return db[_0x6b65('0xad')]['upsert']({'membername':_0xc756d7['name'],'UserId':_0xc756d7['id'],'queue_name':_0x5134d7['name'],'VoiceQueueId':_0x5134d7['id'],'interface':_[_0x6b65('0x66')](_0xc756d7[_0x6b65('0x9e')])?util[_0x6b65('0xab')]('SIP/%s',_0xc756d7[_0x6b65('0x34')]):_0xc756d7[_0x6b65('0x9e')],'paused':_0xc756d7[_0x6b65('0x9d')]||![],'penalty':_0xc756d7[_0x6b65('0xa5')]},{'transaction':_0x24b178});});return Promise[_0x6b65('0x51')](_0x35df0f);})[_0x6b65('0x24')](function(){return db[_0x6b65('0x117')][_0x6b65('0xaa')]({'where':{'teamId':{'$in':_0x34db56}}});})[_0x6b65('0x24')](function(_0x486e79){var _0x5005a5=_[_0x6b65('0x30')](_0x486e79,function(_0x5ef871){return db['UserVoicePrefix'][_0x6b65('0x7c')]({'UserId':_0xc756d7['id'],'VoicePrefixId':_0x5ef871[_0x6b65('0x118')]},{'transaction':_0x24b178});});return Promise[_0x6b65('0x51')](_0x5005a5);});});})['then'](function(){for(var _0x487500=0x0;_0x487500<_0xb27a52[_0x6b65('0x4b')];_0x487500++){var _0x1df6ad=_0xb27a52[_0x487500][_0x6b65('0x115')]('channel');var _0xc9677c=_0x1df6ad+_0x6b65('0xb0');socket[_0x6b65('0x25')](_0x6b65('0x2b')+_0x1df6ad+_0x6b65('0xa7'),{'UserId':_0x143ebd,['queueField']:_0xb27a52[_0x487500]['id']});}})[_0x6b65('0x24')](respondWithStatusCode(_0x2633f9,null))[_0x6b65('0x52')](APIHandleError(_0x2633f9));};exports[_0x6b65('0x119')]=function(_0x5e23a7,_0x190b33){var _0x2bbc76=_0x5e23a7['params']['id'];var _0x2e3282=null;if(_0x5e23a7[_0x6b65('0x41')][_0x6b65('0x60')]){_0x2e3282=_[_0x6b65('0xaf')](_0x5e23a7[_0x6b65('0x41')][_0x6b65('0x60')])?_0x5e23a7[_0x6b65('0x41')]['ids']:[_0x5e23a7[_0x6b65('0x41')][_0x6b65('0x60')]];}var _0x39023b=[];return Promise[_0x6b65('0x100')]()[_0x6b65('0x24')](function(){if(!_0x2e3282)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x6b65('0x24')](function(){return db[_0x6b65('0x39')][_0x6b65('0x95')]({'where':{'id':_0x2bbc76}});})[_0x6b65('0x24')](function(_0x23e22e){if(!_0x23e22e)throw new APINotFoundError(util[_0x6b65('0xab')]('User\x20with\x20id\x20%s\x20not\x20found',_0x5e23a7[_0x6b65('0x5e')]['id']));return db['sequelize'][_0x6b65('0x11a')](function(_0x3161b1){return _0x23e22e['removeTeams'](_0x2e3282,{'transaction':_0x3161b1})[_0x6b65('0x24')](function(){return db['Team'][_0x6b65('0xaa')]({'where':{'id':{'$in':_0x2e3282}}});})[_0x6b65('0x24')](function(_0x2e79d6){var _0x11e825=_[_0x6b65('0x30')](_0x2e79d6,function(_0x3c685f){return _0x3c685f[_0x6b65('0x11b')]();});return Promise[_0x6b65('0x51')](_0x11e825);})[_0x6b65('0x24')](function(_0x14da63){_0x39023b=_[_0x6b65('0x113')](_0x14da63);var _0x108f81=_[_0x6b65('0x30')](_0x39023b,function(_0x26a804){return _0x26a804[_0x6b65('0x11c')](_0x23e22e['id'],{'transaction':_0x3161b1});});return Promise['all'](_0x108f81);})[_0x6b65('0x24')](function(){if(!_0x23e22e[_0x6b65('0x9b')])return;var _0x148d0d=_['filter'](_0x39023b,function(_0x2c3d72){return _0x2c3d72[_0x6b65('0x115')](_0x6b65('0xae'))===_0x6b65('0x116');});var _0x12d35e=_['map'](_0x148d0d,function(_0xb6f6aa){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0xb6f6aa['id'],'UserId':_0x23e22e['id']},'transaction':_0x3161b1});});return Promise[_0x6b65('0x51')](_0x12d35e);})[_0x6b65('0x24')](function(){return db[_0x6b65('0x117')][_0x6b65('0xaa')]({'where':{'teamId':{'$in':_0x2e3282}}});})[_0x6b65('0x24')](function(_0x1b4b4a){var _0xcf242d=_['map'](_0x1b4b4a,function(_0x19cd9c){return db[_0x6b65('0x11d')]['destroy']({'where':{'UserId':_0x23e22e['id'],'VoicePrefixId':_0x19cd9c['VoicePrefixId']}},{'transaction':_0x3161b1});});return Promise[_0x6b65('0x51')](_0xcf242d);});});})['then'](function(){for(var _0x1aeebb=0x0;_0x1aeebb<_0x39023b[_0x6b65('0x4b')];_0x1aeebb++){var _0x449e07=_0x39023b[_0x1aeebb][_0x6b65('0x115')]('channel');var _0x4c7bed=_0x449e07+_0x6b65('0xb0');socket['emit'](_0x6b65('0x2b')+_0x449e07+_0x6b65('0xb1'),{'UserId':_0x2bbc76,['queueField']:_0x39023b[_0x1aeebb]['id']});}})[_0x6b65('0x24')](respondWithStatusCode(_0x190b33,null))[_0x6b65('0x52')](APIHandleError(_0x190b33));};exports[_0x6b65('0x11e')]=function(_0xc9a09e,_0x2063c7){var _0x33da1e={};var _0x2e0f3c={};var _0x43fa1a;var _0x1f62ce;return db[_0x6b65('0x39')][_0x6b65('0x95')]({'where':{'id':_0xc9a09e[_0x6b65('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2063c7,null))['then'](function(_0x812e87){if(_0x812e87){_0x43fa1a=_0x812e87;_0x2e0f3c[_0x6b65('0x58')]=_[_0x6b65('0x55')](db['CmList'][_0x6b65('0x3a')]);_0x2e0f3c[_0x6b65('0x41')]=_[_0x6b65('0x55')](_0xc9a09e['query']);_0x2e0f3c[_0x6b65('0x56')]=_[_0x6b65('0x57')](_0x2e0f3c['model'],_0x2e0f3c[_0x6b65('0x41')]);_0x33da1e[_0x6b65('0x47')]=_[_0x6b65('0x57')](_0x2e0f3c[_0x6b65('0x58')],qs[_0x6b65('0x59')](_0xc9a09e[_0x6b65('0x41')][_0x6b65('0x59')]));_0x33da1e[_0x6b65('0x47')]=_0x33da1e['attributes'][_0x6b65('0x4b')]?_0x33da1e['attributes']:_0x2e0f3c[_0x6b65('0x58')];_0x33da1e['order']=qs[_0x6b65('0xca')](_0xc9a09e[_0x6b65('0x41')][_0x6b65('0xca')]);_0x33da1e[_0x6b65('0x40')]=qs[_0x6b65('0x56')](_[_0x6b65('0xcb')](_0xc9a09e[_0x6b65('0x41')],_0x2e0f3c[_0x6b65('0x56')]));if(_0xc9a09e[_0x6b65('0x41')]['filter']){_0x33da1e[_0x6b65('0x40')]=_[_0x6b65('0xcc')](_0x33da1e[_0x6b65('0x40')],{'$or':_['map'](_0x33da1e[_0x6b65('0x47')],function(_0x4be8d7){var _0x1ac8f2={};_0x1ac8f2[_0x4be8d7]={'$like':'%'+_0xc9a09e[_0x6b65('0x41')][_0x6b65('0x3d')]+'%'};return _0x1ac8f2;})});}_0x33da1e=_['merge']({},_0x33da1e,_0xc9a09e[_0x6b65('0xcd')]);return _0x43fa1a[_0x6b65('0x11e')](_0x33da1e);}})[_0x6b65('0x24')](function(_0x328484){if(_0x328484){_0x1f62ce=_0x328484[_0x6b65('0x4b')];if(!_0xc9a09e[_0x6b65('0x41')][_0x6b65('0xd3')](_0x6b65('0xd4'))){_0x33da1e[_0x6b65('0x1e')]=qs['limit'](_0xc9a09e['query'][_0x6b65('0x1e')]);_0x33da1e[_0x6b65('0x1c')]=qs[_0x6b65('0x1c')](_0xc9a09e[_0x6b65('0x41')][_0x6b65('0x1c')]);}return _0x43fa1a[_0x6b65('0x11e')](_0x33da1e);}})[_0x6b65('0x24')](function(_0x38a5b6){if(_0x38a5b6){return _0x38a5b6?{'count':_0x1f62ce,'rows':_0x38a5b6}:null;}})[_0x6b65('0x24')](respondWithResult(_0x2063c7,null))['catch'](handleError(_0x2063c7,null));};exports[_0x6b65('0x11f')]=function(_0x4d7f23,_0x296fbf){var _0x3eb24f={};var _0x55aa1b={};var _0x550de9;return db[_0x6b65('0x39')][_0x6b65('0x95')]({'where':{'id':_0x4d7f23[_0x6b65('0x5e')]['id']}})['then'](handleEntityNotFound(_0x296fbf,null))[_0x6b65('0x24')](function(_0x41b21e){if(_0x41b21e){_0x550de9=_0x41b21e;_0x55aa1b[_0x6b65('0x58')]=_['keys'](db['User']['rawAttributes']);_0x55aa1b[_0x6b65('0x41')]=_[_0x6b65('0x55')](_0x4d7f23['query']);_0x55aa1b[_0x6b65('0x56')]=_[_0x6b65('0x57')](_0x55aa1b[_0x6b65('0x58')],_0x55aa1b[_0x6b65('0x41')]);_0x3eb24f[_0x6b65('0x47')]=_['intersection'](_0x55aa1b['model'],qs[_0x6b65('0x59')](_0x4d7f23[_0x6b65('0x41')][_0x6b65('0x59')]));_0x3eb24f[_0x6b65('0x47')]=_0x3eb24f[_0x6b65('0x47')][_0x6b65('0x4b')]?_0x3eb24f['attributes']:_0x55aa1b[_0x6b65('0x58')];_0x3eb24f[_0x6b65('0xc9')]=qs['sort'](_0x4d7f23['query'][_0x6b65('0xca')]);_0x3eb24f[_0x6b65('0x40')]=qs[_0x6b65('0x56')](_[_0x6b65('0xcb')](_0x4d7f23['query'],_0x55aa1b['filters']));if(_0x4d7f23['query'][_0x6b65('0x3d')]){_0x3eb24f[_0x6b65('0x40')]=_[_0x6b65('0xcc')](_0x3eb24f['where'],{'$or':_[_0x6b65('0x30')](_0x3eb24f[_0x6b65('0x47')],function(_0x1cd974){var _0x2d7b62={};_0x2d7b62[_0x1cd974]={'$like':'%'+_0x4d7f23[_0x6b65('0x41')][_0x6b65('0x3d')]+'%'};return _0x2d7b62;})});}_0x3eb24f[_0x6b65('0x58')]=db[_0x6b65('0x39')];_0x3eb24f['as']=_0x6b65('0x2c');_0x3eb24f=_[_0x6b65('0xcc')]({},_0x3eb24f,_0x4d7f23[_0x6b65('0xcd')]);return _0x550de9[_0x6b65('0xf6')]({'include':[_0x3eb24f]});}})[_0x6b65('0x24')](function(_0x5de516){if(_0x5de516){var _0x29b1a5={},_0x4fd0ce=[];for(var _0x5632f2=0x0;_0x5632f2<_0x5de516[_0x6b65('0x4b')];_0x5632f2+=0x1){for(var _0x3300a7=0x0,_0x24998c;_0x3300a7<_0x5de516[_0x5632f2][_0x6b65('0x2c')][_0x6b65('0x4b')];_0x3300a7+=0x1){_0x24998c=_0x5de516[_0x5632f2][_0x6b65('0x2c')][_0x3300a7]['get']({'plain':!![]});_0x29b1a5[_0x24998c['id']]=_0x24998c;}}_0x29b1a5=_[_0x6b65('0x120')](_0x29b1a5);for(var _0x6cbd37=qs['offset'](_0x4d7f23[_0x6b65('0x41')][_0x6b65('0x1c')]);_0x6cbd37<_0x29b1a5[_0x6b65('0x4b')]&&_0x4fd0ce[_0x6b65('0x4b')]<qs['limit'](_0x4d7f23[_0x6b65('0x41')][_0x6b65('0x1e')]);_0x6cbd37+=0x1){if(_0x29b1a5[_0x6cbd37]){_0x4fd0ce['push'](_0x29b1a5[_0x6cbd37]);}}return{'count':_0x29b1a5['length'],'rows':_0x4fd0ce};}})['then'](respondWithResult(_0x296fbf,null))[_0x6b65('0x52')](handleError(_0x296fbf,null));};exports[_0x6b65('0x27')]=function(_0x1f866c,_0x4ce1aa){if(_0x1f866c['user']['id']==_0x1f866c[_0x6b65('0x5e')]['id']){return _0x4ce1aa[_0x6b65('0x20')](0x1f4)[_0x6b65('0x121')]({'message':_0x6b65('0x122')});}return db['User'][_0x6b65('0x33')]({'where':{'id':_0x1f866c[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x4ce1aa,null))[_0x6b65('0x24')](removeEntity(_0x4ce1aa,null))[_0x6b65('0x52')](handleError(_0x4ce1aa,null));};exports[_0x6b65('0x123')]=function(_0xc47102,_0x4d9d90){return db[_0x6b65('0x39')][_0x6b65('0x33')]({'where':{'id':_0xc47102[_0x6b65('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4d9d90,null))[_0x6b65('0x24')](function(_0x15aca4){if(_0x15aca4){return _0x15aca4[_0x6b65('0x123')](_0xc47102[_0x6b65('0x5b')][_0x6b65('0x60')],_[_0x6b65('0x5f')](_0xc47102[_0x6b65('0x5b')],[_0x6b65('0x60'),'id'])||{})['spread'](function(){for(var _0x477f1e=0x0;_0x477f1e<_0xc47102['body'][_0x6b65('0x60')]['length'];_0x477f1e+=0x1){socket[_0x6b65('0x25')](_0x6b65('0x124'),{'ChatInteractionId':Number(_0xc47102[_0x6b65('0x5b')][_0x6b65('0x60')][_0x477f1e]),'UserId':Number(_0xc47102[_0x6b65('0x5e')]['id'])});}return _0xc47102[_0x6b65('0x5b')][_0x6b65('0x60')];});}})['then'](respondWithResult(_0x4d9d90,null))[_0x6b65('0x52')](handleError(_0x4d9d90,null));};exports[_0x6b65('0x125')]=function(_0x1a3ea7,_0x228156){return db['User'][_0x6b65('0x33')]({'where':{'id':_0x1a3ea7[_0x6b65('0x5e')]['id']}})['then'](handleEntityNotFound(_0x228156,null))[_0x6b65('0x24')](function(_0x28ad13){if(_0x28ad13){return _0x28ad13[_0x6b65('0x125')](_0x1a3ea7[_0x6b65('0x41')][_0x6b65('0x60')])['then'](function(){if(_[_0x6b65('0xaf')](_0x1a3ea7[_0x6b65('0x41')]['ids'])){for(var _0x4eb3ff=0x0;_0x4eb3ff<_0x1a3ea7['query'][_0x6b65('0x60')][_0x6b65('0x4b')];_0x4eb3ff+=0x1){socket[_0x6b65('0x25')](_0x6b65('0x126'),{'ChatInteractionId':Number(_0x1a3ea7[_0x6b65('0x41')][_0x6b65('0x60')][_0x4eb3ff]),'UserId':Number(_0x1a3ea7[_0x6b65('0x5e')]['id'])});}}else{socket['emit'](_0x6b65('0x126'),{'ChatInteractionId':Number(_0x1a3ea7[_0x6b65('0x41')][_0x6b65('0x60')]),'UserId':Number(_0x1a3ea7['params']['id'])});}});}})['then'](respondWithStatusCode(_0x228156,null))[_0x6b65('0x52')](handleError(_0x228156,null));};exports[_0x6b65('0x127')]=function(_0x3d3747,_0x544453){return db[_0x6b65('0x39')][_0x6b65('0x33')]({'where':{'id':_0x3d3747[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x544453,null))[_0x6b65('0x24')](function(_0x2e8c91){if(_0x2e8c91){return _0x2e8c91['addMailInteractions'](_0x3d3747[_0x6b65('0x5b')][_0x6b65('0x60')],_[_0x6b65('0x5f')](_0x3d3747[_0x6b65('0x5b')],[_0x6b65('0x60'),'id'])||{})[_0x6b65('0xa6')](function(){for(var _0x3be360=0x0;_0x3be360<_0x3d3747['body'][_0x6b65('0x60')][_0x6b65('0x4b')];_0x3be360+=0x1){socket[_0x6b65('0x25')](_0x6b65('0x128'),{'MailInteractionId':Number(_0x3d3747[_0x6b65('0x5b')]['ids'][_0x3be360]),'UserId':Number(_0x3d3747[_0x6b65('0x5e')]['id'])});}return _0x3d3747[_0x6b65('0x5b')][_0x6b65('0x60')];});}})[_0x6b65('0x24')](respondWithResult(_0x544453,null))[_0x6b65('0x52')](handleError(_0x544453,null));};exports['removeMailInteractions']=function(_0x1a975f,_0x1846d0){return db[_0x6b65('0x39')][_0x6b65('0x33')]({'where':{'id':_0x1a975f['params']['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x1846d0,null))[_0x6b65('0x24')](function(_0x5a2ee5){if(_0x5a2ee5){return _0x5a2ee5['removeMailInteractions'](_0x1a975f[_0x6b65('0x41')]['ids'])['then'](function(){if(_[_0x6b65('0xaf')](_0x1a975f[_0x6b65('0x41')]['ids'])){for(var _0x12548b=0x0;_0x12548b<_0x1a975f[_0x6b65('0x41')][_0x6b65('0x60')]['length'];_0x12548b+=0x1){socket[_0x6b65('0x25')](_0x6b65('0x129'),{'MailInteractionId':Number(_0x1a975f[_0x6b65('0x41')][_0x6b65('0x60')][_0x12548b]),'UserId':Number(_0x1a975f[_0x6b65('0x5e')]['id'])});}}else{socket[_0x6b65('0x25')](_0x6b65('0x129'),{'MailInteractionId':Number(_0x1a975f[_0x6b65('0x41')]['ids']),'UserId':Number(_0x1a975f[_0x6b65('0x5e')]['id'])});}});}})[_0x6b65('0x24')](respondWithStatusCode(_0x1846d0,null))[_0x6b65('0x52')](handleError(_0x1846d0,null));};exports[_0x6b65('0x12a')]=function(_0x3858a2,_0xf83e27){return db['User'][_0x6b65('0x33')]({'where':{'id':_0x3858a2[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0xf83e27,null))[_0x6b65('0x24')](function(_0x59b760){if(_0x59b760){return _0x59b760[_0x6b65('0x12a')](_0x3858a2['body'][_0x6b65('0x60')],_[_0x6b65('0x5f')](_0x3858a2['body'],[_0x6b65('0x60'),'id'])||{})['spread'](function(){for(var _0x11e5ca=0x0;_0x11e5ca<_0x3858a2[_0x6b65('0x5b')][_0x6b65('0x60')][_0x6b65('0x4b')];_0x11e5ca+=0x1){socket[_0x6b65('0x25')](_0x6b65('0x12b'),{'FaxInteractionId':Number(_0x3858a2['body'][_0x6b65('0x60')][_0x11e5ca]),'UserId':Number(_0x3858a2[_0x6b65('0x5e')]['id'])});}return _0x3858a2[_0x6b65('0x5b')][_0x6b65('0x60')];});}})['then'](respondWithResult(_0xf83e27,null))[_0x6b65('0x52')](handleError(_0xf83e27,null));};exports[_0x6b65('0x12c')]=function(_0x4b6378,_0xe9ce47){return db[_0x6b65('0x39')]['find']({'where':{'id':_0x4b6378[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0xe9ce47,null))['then'](function(_0x37ae61){if(_0x37ae61){return _0x37ae61['removeFaxInteractions'](_0x4b6378[_0x6b65('0x41')][_0x6b65('0x60')])['then'](function(){if(_[_0x6b65('0xaf')](_0x4b6378[_0x6b65('0x41')][_0x6b65('0x60')])){for(var _0x42093f=0x0;_0x42093f<_0x4b6378[_0x6b65('0x41')][_0x6b65('0x60')][_0x6b65('0x4b')];_0x42093f+=0x1){socket[_0x6b65('0x25')](_0x6b65('0x12d'),{'FaxInteractionId':Number(_0x4b6378[_0x6b65('0x41')][_0x6b65('0x60')][_0x42093f]),'UserId':Number(_0x4b6378[_0x6b65('0x5e')]['id'])});}}else{socket['emit'](_0x6b65('0x12d'),{'FaxInteractionId':Number(_0x4b6378[_0x6b65('0x41')][_0x6b65('0x60')]),'UserId':Number(_0x4b6378['params']['id'])});}});}})[_0x6b65('0x24')](respondWithStatusCode(_0xe9ce47,null))[_0x6b65('0x52')](handleError(_0xe9ce47,null));};exports[_0x6b65('0x12e')]=function(_0x113521,_0x1239e5){return db[_0x6b65('0x39')][_0x6b65('0x33')]({'where':{'id':_0x113521[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x1239e5,null))[_0x6b65('0x24')](function(_0xf20b9d){if(_0xf20b9d){return _0xf20b9d[_0x6b65('0x12e')](_0x113521[_0x6b65('0x5b')][_0x6b65('0x60')],_[_0x6b65('0x5f')](_0x113521[_0x6b65('0x5b')],[_0x6b65('0x60'),'id'])||{})[_0x6b65('0xa6')](function(){for(var _0x13e80e=0x0;_0x13e80e<_0x113521[_0x6b65('0x5b')][_0x6b65('0x60')][_0x6b65('0x4b')];_0x13e80e+=0x1){socket['emit'](_0x6b65('0x12f'),{'SmsInteractionId':Number(_0x113521[_0x6b65('0x5b')][_0x6b65('0x60')][_0x13e80e]),'UserId':Number(_0x113521[_0x6b65('0x5e')]['id'])});}return _0x113521[_0x6b65('0x5b')][_0x6b65('0x60')];});}})[_0x6b65('0x24')](respondWithResult(_0x1239e5,null))['catch'](handleError(_0x1239e5,null));};exports[_0x6b65('0x130')]=function(_0x293e35,_0x28629f){return db[_0x6b65('0x39')][_0x6b65('0x33')]({'where':{'id':_0x293e35['params']['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x28629f,null))[_0x6b65('0x24')](function(_0xfa613d){if(_0xfa613d){return _0xfa613d[_0x6b65('0x130')](_0x293e35[_0x6b65('0x41')][_0x6b65('0x60')])[_0x6b65('0x24')](function(){if(_[_0x6b65('0xaf')](_0x293e35['query'][_0x6b65('0x60')])){for(var _0x325a94=0x0;_0x325a94<_0x293e35[_0x6b65('0x41')]['ids'][_0x6b65('0x4b')];_0x325a94+=0x1){socket[_0x6b65('0x25')](_0x6b65('0x131'),{'SmsInteractionId':Number(_0x293e35['query'][_0x6b65('0x60')][_0x325a94]),'UserId':Number(_0x293e35['params']['id'])});}}else{socket[_0x6b65('0x25')](_0x6b65('0x131'),{'SmsInteractionId':Number(_0x293e35[_0x6b65('0x41')][_0x6b65('0x60')]),'UserId':Number(_0x293e35[_0x6b65('0x5e')]['id'])});}});}})[_0x6b65('0x24')](respondWithStatusCode(_0x28629f,null))['catch'](handleError(_0x28629f,null));};exports[_0x6b65('0x132')]=function(_0x1ff116,_0x1362fd){return db['User'][_0x6b65('0x33')]({'where':{'id':_0x1ff116[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x1362fd,null))[_0x6b65('0x24')](function(_0x1e1a4b){if(_0x1e1a4b){return _0x1e1a4b[_0x6b65('0x132')](_0x1ff116[_0x6b65('0x5b')][_0x6b65('0x60')],_['omit'](_0x1ff116[_0x6b65('0x5b')],[_0x6b65('0x60'),'id'])||{})[_0x6b65('0xa6')](function(){for(var _0x498dd8=0x0;_0x498dd8<_0x1ff116[_0x6b65('0x5b')][_0x6b65('0x60')][_0x6b65('0x4b')];_0x498dd8+=0x1){socket[_0x6b65('0x25')](_0x6b65('0x133'),{'OpenchannelInteractionId':Number(_0x1ff116['body']['ids'][_0x498dd8]),'UserId':Number(_0x1ff116[_0x6b65('0x5e')]['id'])});}return _0x1ff116[_0x6b65('0x5b')][_0x6b65('0x60')];});}})['then'](respondWithResult(_0x1362fd,null))[_0x6b65('0x52')](handleError(_0x1362fd,null));};exports[_0x6b65('0x134')]=function(_0x4ea22e,_0x4c3774){return db['User'][_0x6b65('0x33')]({'where':{'id':_0x4ea22e[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x4c3774,null))[_0x6b65('0x24')](function(_0x192ffe){if(_0x192ffe){return _0x192ffe[_0x6b65('0x134')](_0x4ea22e[_0x6b65('0x41')]['ids'])['then'](function(){if(_[_0x6b65('0xaf')](_0x4ea22e[_0x6b65('0x41')][_0x6b65('0x60')])){for(var _0x3f6228=0x0;_0x3f6228<_0x4ea22e[_0x6b65('0x41')][_0x6b65('0x60')][_0x6b65('0x4b')];_0x3f6228+=0x1){socket[_0x6b65('0x25')](_0x6b65('0x135'),{'OpenchannelInteractionId':Number(_0x4ea22e[_0x6b65('0x41')][_0x6b65('0x60')][_0x3f6228]),'UserId':Number(_0x4ea22e[_0x6b65('0x5e')]['id'])});}}else{socket[_0x6b65('0x25')](_0x6b65('0x135'),{'OpenchannelInteractionId':Number(_0x4ea22e[_0x6b65('0x41')]['ids']),'UserId':Number(_0x4ea22e[_0x6b65('0x5e')]['id'])});}});}})[_0x6b65('0x24')](respondWithStatusCode(_0x4c3774,null))[_0x6b65('0x52')](handleError(_0x4c3774,null));};exports[_0x6b65('0x136')]=function(_0x186757,_0x33c93e){return db[_0x6b65('0x39')][_0x6b65('0x33')]({'where':{'id':_0x186757[_0x6b65('0x5e')]['id']}})['then'](handleEntityNotFound(_0x33c93e,null))[_0x6b65('0x24')](function(_0x228f43){if(_0x228f43){return _0x228f43[_0x6b65('0x136')](_0x186757[_0x6b65('0x5b')][_0x6b65('0x60')],_[_0x6b65('0x5f')](_0x186757[_0x6b65('0x5b')],[_0x6b65('0x60'),'id'])||{})[_0x6b65('0xa6')](function(){for(var _0x182ee5=0x0;_0x182ee5<_0x186757[_0x6b65('0x5b')]['ids'][_0x6b65('0x4b')];_0x182ee5+=0x1){socket[_0x6b65('0x25')](_0x6b65('0x137'),{'WhatsappInteractionId':Number(_0x186757[_0x6b65('0x5b')]['ids'][_0x182ee5]),'UserId':Number(_0x186757['params']['id'])});}return _0x186757[_0x6b65('0x5b')][_0x6b65('0x60')];});}})[_0x6b65('0x24')](respondWithResult(_0x33c93e,null))[_0x6b65('0x52')](handleError(_0x33c93e,null));};exports[_0x6b65('0x138')]=function(_0x12ba9f,_0x338c8f){return db[_0x6b65('0x39')]['find']({'where':{'id':_0x12ba9f[_0x6b65('0x5e')]['id']}})['then'](handleEntityNotFound(_0x338c8f,null))[_0x6b65('0x24')](function(_0x29e0a3){if(_0x29e0a3){return _0x29e0a3[_0x6b65('0x138')](_0x12ba9f[_0x6b65('0x41')]['ids']);}})[_0x6b65('0x24')](respondWithStatusCode(_0x338c8f,null))[_0x6b65('0x52')](handleError(_0x338c8f,null));};exports[_0x6b65('0x139')]=function(_0x5d21a0,_0xca7aae){var _0x3addd4={};var _0x243f34={};var _0x25ec2e;var _0x4f9a74;return db[_0x6b65('0x39')][_0x6b65('0x95')]({'where':{'id':_0x5d21a0[_0x6b65('0x5e')]['id']}})['then'](handleEntityNotFound(_0xca7aae,null))[_0x6b65('0x24')](function(_0x509fc5){if(_0x509fc5){_0x25ec2e=_0x509fc5;_0x243f34[_0x6b65('0x58')]=_[_0x6b65('0x55')](db[_0x6b65('0x13a')][_0x6b65('0x3a')]);_0x243f34[_0x6b65('0x41')]=_['keys'](_0x5d21a0['query']);_0x243f34['filters']=_[_0x6b65('0x57')](_0x243f34[_0x6b65('0x58')],_0x243f34[_0x6b65('0x41')]);_0x3addd4[_0x6b65('0x47')]=_[_0x6b65('0x57')](_0x243f34[_0x6b65('0x58')],qs[_0x6b65('0x59')](_0x5d21a0[_0x6b65('0x41')][_0x6b65('0x59')]));_0x3addd4[_0x6b65('0x47')]=_0x3addd4['attributes'][_0x6b65('0x4b')]?_0x3addd4[_0x6b65('0x47')]:_0x243f34['model'];_0x3addd4['order']=qs[_0x6b65('0xca')](_0x5d21a0['query']['sort']);_0x3addd4[_0x6b65('0x40')]=qs['filters'](_['pick'](_0x5d21a0[_0x6b65('0x41')],_0x243f34[_0x6b65('0x56')]));if(_0x5d21a0[_0x6b65('0x41')]['filter']){_0x3addd4['where']=_[_0x6b65('0xcc')](_0x3addd4[_0x6b65('0x40')],{'$or':_[_0x6b65('0x30')](_0x3addd4[_0x6b65('0x47')],function(_0x408b0c){var _0x315adb={};_0x315adb[_0x408b0c]={'$like':'%'+_0x5d21a0[_0x6b65('0x41')][_0x6b65('0x3d')]+'%'};return _0x315adb;})});}_0x3addd4=_[_0x6b65('0xcc')]({},_0x3addd4,_0x5d21a0['options']);return _0x25ec2e[_0x6b65('0x139')](_0x3addd4);}})[_0x6b65('0x24')](function(_0x227f18){if(_0x227f18){_0x4f9a74=_0x227f18[_0x6b65('0x4b')];if(!_0x5d21a0[_0x6b65('0x41')]['hasOwnProperty'](_0x6b65('0xd4'))){_0x3addd4[_0x6b65('0x1e')]=qs[_0x6b65('0x1e')](_0x5d21a0[_0x6b65('0x41')][_0x6b65('0x1e')]);_0x3addd4['offset']=qs[_0x6b65('0x1c')](_0x5d21a0['query'][_0x6b65('0x1c')]);}return _0x25ec2e['getVoicePrefixes'](_0x3addd4);}})[_0x6b65('0x24')](function(_0x7ebaea){if(_0x7ebaea){return _0x7ebaea?{'count':_0x4f9a74,'rows':_0x7ebaea}:null;}})[_0x6b65('0x24')](respondWithResult(_0xca7aae,null))[_0x6b65('0x52')](handleError(_0xca7aae,null));};exports[_0x6b65('0x13b')]=function(_0x13369d,_0x5632b6){var _0x17a563={};var _0x5647bd={};var _0x2e45ed;var _0x407cdb;return db[_0x6b65('0x39')]['findOne']({'where':{'id':_0x13369d[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x5632b6,null))[_0x6b65('0x24')](function(_0x295058){if(_0x295058){_0x2e45ed=_0x295058;_0x5647bd[_0x6b65('0x58')]=_[_0x6b65('0x55')](db['FaxAccount'][_0x6b65('0x3a')]);_0x5647bd[_0x6b65('0x41')]=_['keys'](_0x13369d[_0x6b65('0x41')]);_0x5647bd['filters']=_[_0x6b65('0x57')](_0x5647bd[_0x6b65('0x58')],_0x5647bd[_0x6b65('0x41')]);_0x17a563['attributes']=_[_0x6b65('0x57')](_0x5647bd[_0x6b65('0x58')],qs[_0x6b65('0x59')](_0x13369d['query'][_0x6b65('0x59')]));_0x17a563[_0x6b65('0x47')]=_0x17a563[_0x6b65('0x47')][_0x6b65('0x4b')]?_0x17a563[_0x6b65('0x47')]:_0x5647bd['model'];_0x17a563[_0x6b65('0xc9')]=qs[_0x6b65('0xca')](_0x13369d[_0x6b65('0x41')][_0x6b65('0xca')]);_0x17a563[_0x6b65('0x40')]=qs[_0x6b65('0x56')](_['pick'](_0x13369d[_0x6b65('0x41')],_0x5647bd[_0x6b65('0x56')]));if(_0x13369d[_0x6b65('0x41')][_0x6b65('0x3d')]){_0x17a563['where']=_[_0x6b65('0xcc')](_0x17a563['where'],{'$or':_[_0x6b65('0x30')](_0x17a563[_0x6b65('0x47')],function(_0x2ba67e){var _0x243bd3={};_0x243bd3[_0x2ba67e]={'$like':'%'+_0x13369d['query'][_0x6b65('0x3d')]+'%'};return _0x243bd3;})});}_0x17a563=_[_0x6b65('0xcc')]({},_0x17a563,_0x13369d[_0x6b65('0xcd')]);return _0x2e45ed[_0x6b65('0x13b')](_0x17a563);}})[_0x6b65('0x24')](function(_0x157c29){if(_0x157c29){_0x407cdb=_0x157c29[_0x6b65('0x4b')];if(!_0x13369d[_0x6b65('0x41')][_0x6b65('0xd3')](_0x6b65('0xd4'))){_0x17a563[_0x6b65('0x1e')]=qs['limit'](_0x13369d[_0x6b65('0x41')][_0x6b65('0x1e')]);_0x17a563[_0x6b65('0x1c')]=qs[_0x6b65('0x1c')](_0x13369d['query'][_0x6b65('0x1c')]);}return _0x2e45ed[_0x6b65('0x13b')](_0x17a563);}})['then'](function(_0x52644e){if(_0x52644e){return _0x52644e?{'count':_0x407cdb,'rows':_0x52644e}:null;}})[_0x6b65('0x24')](respondWithResult(_0x5632b6,null))['catch'](handleError(_0x5632b6,null));};exports[_0x6b65('0x13c')]=function(_0x39d1e8,_0x31b1af){return db[_0x6b65('0x39')]['find']({'where':{'id':_0x39d1e8[_0x6b65('0x5e')]['id']}})['then'](handleEntityNotFound(_0x31b1af,null))[_0x6b65('0x24')](function(_0xd9a5df){if(_0xd9a5df){return _0xd9a5df[_0x6b65('0x13c')](_0x39d1e8[_0x6b65('0x5b')]['ids'],_['omit'](_0x39d1e8[_0x6b65('0x5b')],[_0x6b65('0x60'),'id'])||{});}})[_0x6b65('0x24')](respondWithResult(_0x31b1af,null))['catch'](handleError(_0x31b1af,null));};exports[_0x6b65('0x13d')]=function(_0x5b7126,_0x12a921){return db[_0x6b65('0x39')][_0x6b65('0x33')]({'where':{'id':_0x5b7126[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x12a921,null))['then'](function(_0x3ae05c){if(_0x3ae05c){return _0x3ae05c[_0x6b65('0x13d')](_0x5b7126[_0x6b65('0x41')]['ids']);}})['then'](respondWithStatusCode(_0x12a921,null))[_0x6b65('0x52')](handleError(_0x12a921,null));};exports['getMailAccounts']=function(_0x44df53,_0x2a87af){var _0x41684a={};var _0xb862c0={};var _0x58fb0a;var _0x55bd22;return db[_0x6b65('0x39')][_0x6b65('0x95')]({'where':{'id':_0x44df53['params']['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x2a87af,null))[_0x6b65('0x24')](function(_0x5308bc){if(_0x5308bc){_0x58fb0a=_0x5308bc;_0xb862c0[_0x6b65('0x58')]=_[_0x6b65('0x55')](db[_0x6b65('0x13e')][_0x6b65('0x3a')]);_0xb862c0[_0x6b65('0x41')]=_['keys'](_0x44df53['query']);_0xb862c0[_0x6b65('0x56')]=_['intersection'](_0xb862c0[_0x6b65('0x58')],_0xb862c0[_0x6b65('0x41')]);_0x41684a[_0x6b65('0x47')]=_[_0x6b65('0x57')](_0xb862c0[_0x6b65('0x58')],qs[_0x6b65('0x59')](_0x44df53[_0x6b65('0x41')]['fields']));_0x41684a[_0x6b65('0x47')]=_0x41684a['attributes'][_0x6b65('0x4b')]?_0x41684a[_0x6b65('0x47')]:_0xb862c0[_0x6b65('0x58')];_0x41684a['order']=qs[_0x6b65('0xca')](_0x44df53[_0x6b65('0x41')][_0x6b65('0xca')]);_0x41684a['where']=qs[_0x6b65('0x56')](_[_0x6b65('0xcb')](_0x44df53[_0x6b65('0x41')],_0xb862c0[_0x6b65('0x56')]));if(_0x44df53[_0x6b65('0x41')]['filter']){_0x41684a[_0x6b65('0x40')]=_['merge'](_0x41684a[_0x6b65('0x40')],{'$or':_[_0x6b65('0x30')](_0x41684a[_0x6b65('0x47')],function(_0x19c476){var _0x421e59={};_0x421e59[_0x19c476]={'$like':'%'+_0x44df53[_0x6b65('0x41')][_0x6b65('0x3d')]+'%'};return _0x421e59;})});}_0x41684a=_[_0x6b65('0xcc')]({},_0x41684a,_0x44df53[_0x6b65('0xcd')]);return _0x58fb0a[_0x6b65('0x13f')](_0x41684a);}})[_0x6b65('0x24')](function(_0x582d4c){if(_0x582d4c){_0x55bd22=_0x582d4c[_0x6b65('0x4b')];if(!_0x44df53[_0x6b65('0x41')]['hasOwnProperty'](_0x6b65('0xd4'))){_0x41684a[_0x6b65('0x1e')]=qs[_0x6b65('0x1e')](_0x44df53[_0x6b65('0x41')][_0x6b65('0x1e')]);_0x41684a[_0x6b65('0x1c')]=qs[_0x6b65('0x1c')](_0x44df53['query'][_0x6b65('0x1c')]);}return _0x58fb0a[_0x6b65('0x13f')](_0x41684a);}})['then'](function(_0x4faee0){if(_0x4faee0){return _0x4faee0?{'count':_0x55bd22,'rows':_0x4faee0}:null;}})[_0x6b65('0x24')](respondWithResult(_0x2a87af,null))[_0x6b65('0x52')](handleError(_0x2a87af,null));};exports[_0x6b65('0x140')]=function(_0x4ca635,_0x4d6df4){return db[_0x6b65('0x39')]['find']({'where':{'id':_0x4ca635['params']['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x4d6df4,null))[_0x6b65('0x24')](function(_0x370633){if(_0x370633){return _0x370633[_0x6b65('0x140')](_0x4ca635[_0x6b65('0x5b')][_0x6b65('0x60')],_['omit'](_0x4ca635[_0x6b65('0x5b')],[_0x6b65('0x60'),'id'])||{});}})[_0x6b65('0x24')](respondWithResult(_0x4d6df4,null))[_0x6b65('0x52')](handleError(_0x4d6df4,null));};exports[_0x6b65('0x141')]=function(_0x41fe92,_0x56d53b){return db[_0x6b65('0x39')][_0x6b65('0x33')]({'where':{'id':_0x41fe92[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x56d53b,null))[_0x6b65('0x24')](function(_0x1826e1){if(_0x1826e1){return _0x1826e1[_0x6b65('0x141')](_0x41fe92[_0x6b65('0x41')][_0x6b65('0x60')]);}})[_0x6b65('0x24')](respondWithStatusCode(_0x56d53b,null))['catch'](handleError(_0x56d53b,null));};exports['getOpenchannelAccounts']=function(_0x2a6c94,_0x1c23e2){var _0x4a186c={};var _0x498917={};var _0x13d572;var _0x4edea4;return db[_0x6b65('0x39')][_0x6b65('0x95')]({'where':{'id':_0x2a6c94[_0x6b65('0x5e')]['id']}})['then'](handleEntityNotFound(_0x1c23e2,null))[_0x6b65('0x24')](function(_0x504927){if(_0x504927){_0x13d572=_0x504927;_0x498917[_0x6b65('0x58')]=_[_0x6b65('0x55')](db[_0x6b65('0x142')][_0x6b65('0x3a')]);_0x498917[_0x6b65('0x41')]=_[_0x6b65('0x55')](_0x2a6c94[_0x6b65('0x41')]);_0x498917[_0x6b65('0x56')]=_[_0x6b65('0x57')](_0x498917[_0x6b65('0x58')],_0x498917['query']);_0x4a186c[_0x6b65('0x47')]=_[_0x6b65('0x57')](_0x498917[_0x6b65('0x58')],qs['fields'](_0x2a6c94[_0x6b65('0x41')][_0x6b65('0x59')]));_0x4a186c[_0x6b65('0x47')]=_0x4a186c[_0x6b65('0x47')][_0x6b65('0x4b')]?_0x4a186c[_0x6b65('0x47')]:_0x498917[_0x6b65('0x58')];_0x4a186c[_0x6b65('0xc9')]=qs[_0x6b65('0xca')](_0x2a6c94[_0x6b65('0x41')]['sort']);_0x4a186c[_0x6b65('0x40')]=qs[_0x6b65('0x56')](_['pick'](_0x2a6c94['query'],_0x498917[_0x6b65('0x56')]));if(_0x2a6c94[_0x6b65('0x41')][_0x6b65('0x3d')]){_0x4a186c[_0x6b65('0x40')]=_['merge'](_0x4a186c['where'],{'$or':_[_0x6b65('0x30')](_0x4a186c[_0x6b65('0x47')],function(_0x2bffbe){var _0xc3e6e2={};_0xc3e6e2[_0x2bffbe]={'$like':'%'+_0x2a6c94[_0x6b65('0x41')][_0x6b65('0x3d')]+'%'};return _0xc3e6e2;})});}_0x4a186c=_['merge']({},_0x4a186c,_0x2a6c94['options']);return _0x13d572[_0x6b65('0x143')](_0x4a186c);}})['then'](function(_0x7fb408){if(_0x7fb408){_0x4edea4=_0x7fb408['length'];if(!_0x2a6c94['query'][_0x6b65('0xd3')]('nolimit')){_0x4a186c[_0x6b65('0x1e')]=qs['limit'](_0x2a6c94['query'][_0x6b65('0x1e')]);_0x4a186c[_0x6b65('0x1c')]=qs['offset'](_0x2a6c94[_0x6b65('0x41')][_0x6b65('0x1c')]);}return _0x13d572[_0x6b65('0x143')](_0x4a186c);}})['then'](function(_0x12af9b){if(_0x12af9b){return _0x12af9b?{'count':_0x4edea4,'rows':_0x12af9b}:null;}})[_0x6b65('0x24')](respondWithResult(_0x1c23e2,null))[_0x6b65('0x52')](handleError(_0x1c23e2,null));};exports[_0x6b65('0x144')]=function(_0x259e5b,_0x6a26a2){return db['User'][_0x6b65('0x33')]({'where':{'id':_0x259e5b[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x6a26a2,null))[_0x6b65('0x24')](function(_0xb8e138){if(_0xb8e138){return _0xb8e138[_0x6b65('0x144')](_0x259e5b[_0x6b65('0x5b')]['ids'],_['omit'](_0x259e5b[_0x6b65('0x5b')],[_0x6b65('0x60'),'id'])||{});}})['then'](respondWithResult(_0x6a26a2,null))[_0x6b65('0x52')](handleError(_0x6a26a2,null));};exports[_0x6b65('0x145')]=function(_0x809221,_0x45dffa){return db['User'][_0x6b65('0x33')]({'where':{'id':_0x809221[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x45dffa,null))['then'](function(_0xf2f3df){if(_0xf2f3df){return _0xf2f3df['removeOpenchannelAccounts'](_0x809221[_0x6b65('0x41')][_0x6b65('0x60')]);}})[_0x6b65('0x24')](respondWithStatusCode(_0x45dffa,null))[_0x6b65('0x52')](handleError(_0x45dffa,null));};exports[_0x6b65('0x146')]=function(_0x12f871,_0x4b6b1f){var _0x4d02c9={};var _0x557a0b={};var _0x46c271;var _0x22d3ec;return db['User'][_0x6b65('0x95')]({'where':{'id':_0x12f871[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x4b6b1f,null))[_0x6b65('0x24')](function(_0x4ea2ba){if(_0x4ea2ba){_0x46c271=_0x4ea2ba;_0x557a0b[_0x6b65('0x58')]=_[_0x6b65('0x55')](db[_0x6b65('0x147')][_0x6b65('0x3a')]);_0x557a0b[_0x6b65('0x41')]=_[_0x6b65('0x55')](_0x12f871[_0x6b65('0x41')]);_0x557a0b['filters']=_[_0x6b65('0x57')](_0x557a0b[_0x6b65('0x58')],_0x557a0b[_0x6b65('0x41')]);_0x4d02c9[_0x6b65('0x47')]=_[_0x6b65('0x57')](_0x557a0b[_0x6b65('0x58')],qs[_0x6b65('0x59')](_0x12f871[_0x6b65('0x41')]['fields']));_0x4d02c9[_0x6b65('0x47')]=_0x4d02c9[_0x6b65('0x47')][_0x6b65('0x4b')]?_0x4d02c9[_0x6b65('0x47')]:_0x557a0b['model'];_0x4d02c9[_0x6b65('0xc9')]=qs[_0x6b65('0xca')](_0x12f871[_0x6b65('0x41')][_0x6b65('0xca')]);_0x4d02c9[_0x6b65('0x40')]=qs[_0x6b65('0x56')](_[_0x6b65('0xcb')](_0x12f871[_0x6b65('0x41')],_0x557a0b[_0x6b65('0x56')]));if(_0x12f871[_0x6b65('0x41')][_0x6b65('0x3d')]){_0x4d02c9['where']=_[_0x6b65('0xcc')](_0x4d02c9[_0x6b65('0x40')],{'$or':_[_0x6b65('0x30')](_0x4d02c9[_0x6b65('0x47')],function(_0x1c8844){var _0xdbfd70={};_0xdbfd70[_0x1c8844]={'$like':'%'+_0x12f871[_0x6b65('0x41')][_0x6b65('0x3d')]+'%'};return _0xdbfd70;})});}_0x4d02c9=_[_0x6b65('0xcc')]({},_0x4d02c9,_0x12f871[_0x6b65('0xcd')]);return _0x46c271[_0x6b65('0x146')](_0x4d02c9);}})[_0x6b65('0x24')](function(_0x425b58){if(_0x425b58){_0x22d3ec=_0x425b58[_0x6b65('0x4b')];if(!_0x12f871[_0x6b65('0x41')][_0x6b65('0xd3')](_0x6b65('0xd4'))){_0x4d02c9[_0x6b65('0x1e')]=qs[_0x6b65('0x1e')](_0x12f871[_0x6b65('0x41')][_0x6b65('0x1e')]);_0x4d02c9['offset']=qs[_0x6b65('0x1c')](_0x12f871[_0x6b65('0x41')]['offset']);}return _0x46c271['getSmsAccounts'](_0x4d02c9);}})[_0x6b65('0x24')](function(_0x4f05a4){if(_0x4f05a4){return _0x4f05a4?{'count':_0x22d3ec,'rows':_0x4f05a4}:null;}})[_0x6b65('0x24')](respondWithResult(_0x4b6b1f,null))[_0x6b65('0x52')](handleError(_0x4b6b1f,null));};exports[_0x6b65('0x148')]=function(_0x2dca22,_0x4c49b4){return db['User']['find']({'where':{'id':_0x2dca22[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x4c49b4,null))[_0x6b65('0x24')](function(_0x4fe53b){if(_0x4fe53b){return _0x4fe53b[_0x6b65('0x148')](_0x2dca22[_0x6b65('0x5b')][_0x6b65('0x60')],_['omit'](_0x2dca22[_0x6b65('0x5b')],['ids','id'])||{});}})['then'](respondWithResult(_0x4c49b4,null))['catch'](handleError(_0x4c49b4,null));};exports[_0x6b65('0x149')]=function(_0x42a9f4,_0x59f36d){return db[_0x6b65('0x39')][_0x6b65('0x33')]({'where':{'id':_0x42a9f4[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x59f36d,null))[_0x6b65('0x24')](function(_0x26b6c9){if(_0x26b6c9){return _0x26b6c9['removeSmsAccounts'](_0x42a9f4[_0x6b65('0x41')][_0x6b65('0x60')]);}})[_0x6b65('0x24')](respondWithStatusCode(_0x59f36d,null))[_0x6b65('0x52')](handleError(_0x59f36d,null));};exports[_0x6b65('0x14a')]=function(_0x54a3fc,_0x3bb4f2){var _0x190120={};var _0x9a7799={};var _0x3ab6ff;var _0x5b7b47;return db[_0x6b65('0x39')][_0x6b65('0x95')]({'where':{'id':_0x54a3fc[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x3bb4f2,null))[_0x6b65('0x24')](function(_0x12fe32){if(_0x12fe32){_0x3ab6ff=_0x12fe32;_0x9a7799[_0x6b65('0x58')]=_[_0x6b65('0x55')](db[_0x6b65('0x14b')][_0x6b65('0x3a')]);_0x9a7799['query']=_['keys'](_0x54a3fc[_0x6b65('0x41')]);_0x9a7799[_0x6b65('0x56')]=_[_0x6b65('0x57')](_0x9a7799[_0x6b65('0x58')],_0x9a7799[_0x6b65('0x41')]);_0x190120[_0x6b65('0x47')]=_['intersection'](_0x9a7799[_0x6b65('0x58')],qs[_0x6b65('0x59')](_0x54a3fc['query'][_0x6b65('0x59')]));_0x190120['attributes']=_0x190120[_0x6b65('0x47')][_0x6b65('0x4b')]?_0x190120[_0x6b65('0x47')]:_0x9a7799[_0x6b65('0x58')];_0x190120[_0x6b65('0xc9')]=qs[_0x6b65('0xca')](_0x54a3fc[_0x6b65('0x41')][_0x6b65('0xca')]);_0x190120['where']=qs[_0x6b65('0x56')](_[_0x6b65('0xcb')](_0x54a3fc[_0x6b65('0x41')],_0x9a7799['filters']));if(_0x54a3fc[_0x6b65('0x41')][_0x6b65('0x3d')]){_0x190120['where']=_[_0x6b65('0xcc')](_0x190120[_0x6b65('0x40')],{'$or':_[_0x6b65('0x30')](_0x190120[_0x6b65('0x47')],function(_0x382dd4){var _0x3d0be0={};_0x3d0be0[_0x382dd4]={'$like':'%'+_0x54a3fc[_0x6b65('0x41')][_0x6b65('0x3d')]+'%'};return _0x3d0be0;})});}_0x190120=_[_0x6b65('0xcc')]({},_0x190120,_0x54a3fc['options']);return _0x3ab6ff['getChatWebsites'](_0x190120);}})[_0x6b65('0x24')](function(_0x53536d){if(_0x53536d){_0x5b7b47=_0x53536d[_0x6b65('0x4b')];if(!_0x54a3fc[_0x6b65('0x41')][_0x6b65('0xd3')](_0x6b65('0xd4'))){_0x190120[_0x6b65('0x1e')]=qs['limit'](_0x54a3fc[_0x6b65('0x41')][_0x6b65('0x1e')]);_0x190120['offset']=qs[_0x6b65('0x1c')](_0x54a3fc[_0x6b65('0x41')][_0x6b65('0x1c')]);}return _0x3ab6ff[_0x6b65('0x14a')](_0x190120);}})[_0x6b65('0x24')](function(_0x2333db){if(_0x2333db){return _0x2333db?{'count':_0x5b7b47,'rows':_0x2333db}:null;}})[_0x6b65('0x24')](respondWithResult(_0x3bb4f2,null))[_0x6b65('0x52')](handleError(_0x3bb4f2,null));};exports[_0x6b65('0x14c')]=function(_0x33ebd0,_0x545ea4){return db[_0x6b65('0x39')]['find']({'where':{'id':_0x33ebd0[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x545ea4,null))[_0x6b65('0x24')](function(_0x500090){if(_0x500090){return _0x500090[_0x6b65('0x14c')](_0x33ebd0['body']['ids'],_[_0x6b65('0x5f')](_0x33ebd0[_0x6b65('0x5b')],[_0x6b65('0x60'),'id'])||{});}})['then'](respondWithResult(_0x545ea4,null))[_0x6b65('0x52')](handleError(_0x545ea4,null));};exports[_0x6b65('0x14d')]=function(_0x34591d,_0x8d6493){return db[_0x6b65('0x39')][_0x6b65('0x33')]({'where':{'id':_0x34591d['params']['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x8d6493,null))[_0x6b65('0x24')](function(_0x4fbc66){if(_0x4fbc66){return _0x4fbc66[_0x6b65('0x14d')](_0x34591d['query'][_0x6b65('0x60')]);}})['then'](respondWithStatusCode(_0x8d6493,null))[_0x6b65('0x52')](handleError(_0x8d6493,null));};exports['getWhatsappAccounts']=function(_0x4674a1,_0x3677e0){var _0x31f478={};var _0x147e00={};var _0x117379;var _0x51e344;return db['User'][_0x6b65('0x95')]({'where':{'id':_0x4674a1[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x3677e0,null))[_0x6b65('0x24')](function(_0x356a4f){if(_0x356a4f){_0x117379=_0x356a4f;_0x147e00[_0x6b65('0x58')]=_['keys'](db[_0x6b65('0x14e')][_0x6b65('0x3a')]);_0x147e00[_0x6b65('0x41')]=_[_0x6b65('0x55')](_0x4674a1[_0x6b65('0x41')]);_0x147e00[_0x6b65('0x56')]=_[_0x6b65('0x57')](_0x147e00[_0x6b65('0x58')],_0x147e00[_0x6b65('0x41')]);_0x31f478['attributes']=_[_0x6b65('0x57')](_0x147e00[_0x6b65('0x58')],qs[_0x6b65('0x59')](_0x4674a1['query'][_0x6b65('0x59')]));_0x31f478['attributes']=_0x31f478[_0x6b65('0x47')][_0x6b65('0x4b')]?_0x31f478[_0x6b65('0x47')]:_0x147e00[_0x6b65('0x58')];_0x31f478['order']=qs[_0x6b65('0xca')](_0x4674a1['query']['sort']);_0x31f478[_0x6b65('0x40')]=qs[_0x6b65('0x56')](_['pick'](_0x4674a1[_0x6b65('0x41')],_0x147e00[_0x6b65('0x56')]));if(_0x4674a1['query'][_0x6b65('0x3d')]){_0x31f478[_0x6b65('0x40')]=_['merge'](_0x31f478[_0x6b65('0x40')],{'$or':_[_0x6b65('0x30')](_0x31f478['attributes'],function(_0x477628){var _0x34a824={};_0x34a824[_0x477628]={'$like':'%'+_0x4674a1[_0x6b65('0x41')][_0x6b65('0x3d')]+'%'};return _0x34a824;})});}_0x31f478=_['merge']({},_0x31f478,_0x4674a1[_0x6b65('0xcd')]);return _0x117379[_0x6b65('0x14f')](_0x31f478);}})['then'](function(_0x5c9d75){if(_0x5c9d75){_0x51e344=_0x5c9d75[_0x6b65('0x4b')];if(!_0x4674a1[_0x6b65('0x41')]['hasOwnProperty']('nolimit')){_0x31f478['limit']=qs[_0x6b65('0x1e')](_0x4674a1[_0x6b65('0x41')][_0x6b65('0x1e')]);_0x31f478[_0x6b65('0x1c')]=qs[_0x6b65('0x1c')](_0x4674a1['query'][_0x6b65('0x1c')]);}return _0x117379[_0x6b65('0x14f')](_0x31f478);}})['then'](function(_0x483c69){if(_0x483c69){return _0x483c69?{'count':_0x51e344,'rows':_0x483c69}:null;}})[_0x6b65('0x24')](respondWithResult(_0x3677e0,null))[_0x6b65('0x52')](handleError(_0x3677e0,null));};exports['addWhatsappAccounts']=function(_0x911fae,_0x2820a3){return db[_0x6b65('0x39')][_0x6b65('0x33')]({'where':{'id':_0x911fae[_0x6b65('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2820a3,null))[_0x6b65('0x24')](function(_0x10a155){if(_0x10a155){return _0x10a155[_0x6b65('0x150')](_0x911fae[_0x6b65('0x5b')]['ids'],_[_0x6b65('0x5f')](_0x911fae[_0x6b65('0x5b')],[_0x6b65('0x60'),'id'])||{});}})[_0x6b65('0x24')](respondWithResult(_0x2820a3,null))[_0x6b65('0x52')](handleError(_0x2820a3,null));};exports[_0x6b65('0x151')]=function(_0x584612,_0x24da23){return db[_0x6b65('0x39')][_0x6b65('0x33')]({'where':{'id':_0x584612[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x24da23,null))[_0x6b65('0x24')](function(_0x5e368b){if(_0x5e368b){return _0x5e368b['removeWhatsappAccounts'](_0x584612[_0x6b65('0x41')][_0x6b65('0x60')]);}})[_0x6b65('0x24')](respondWithStatusCode(_0x24da23,null))[_0x6b65('0x52')](handleError(_0x24da23,null));};exports[_0x6b65('0x152')]=function(_0x4d6d2e,_0x2b6916){var _0x309404={},_0x3aa7ac={},_0x441963={'count':0x0,'rows':[]};var _0x2d3e76=db[_0x6b65('0x153')]['rawAttributes'];_0x3aa7ac[_0x6b65('0x58')]=_[_0x6b65('0x55')](_0x2d3e76);_0x3aa7ac['query']=_[_0x6b65('0x55')](_0x4d6d2e[_0x6b65('0x41')]);_0x3aa7ac['filters']=_[_0x6b65('0x57')](_0x3aa7ac[_0x6b65('0x58')],_0x3aa7ac[_0x6b65('0x41')]);_0x3aa7ac[_0x6b65('0x56')]=_['concat'](_0x3aa7ac[_0x6b65('0x56')],['$and',_0x6b65('0x154'),_0x6b65('0x155'),_0x6b65('0x156'),_0x6b65('0x157'),_0x6b65('0x158'),_0x6b65('0x159'),_0x6b65('0x15a'),'$not','$between',_0x6b65('0x15b'),_0x6b65('0x15c'),'$notIn',_0x6b65('0x15d'),'$notLike',_0x6b65('0x15e'),_0x6b65('0x15f'),_0x6b65('0x15d'),_0x6b65('0x160'),'$contains',_0x6b65('0x161'),_0x6b65('0x162')]);_0x309404[_0x6b65('0x47')]=_[_0x6b65('0x57')](_0x3aa7ac['model'],qs[_0x6b65('0x59')](_0x4d6d2e['query'][_0x6b65('0x59')]));_0x309404['attributes']=_0x309404[_0x6b65('0x47')][_0x6b65('0x4b')]?_0x309404['attributes']:_0x3aa7ac['model'];if(!_0x4d6d2e['query'][_0x6b65('0xd3')](_0x6b65('0xd4'))){_0x309404[_0x6b65('0x1e')]=qs[_0x6b65('0x1e')](_0x4d6d2e['query'][_0x6b65('0x1e')]);_0x309404[_0x6b65('0x1c')]=qs['offset'](_0x4d6d2e[_0x6b65('0x41')][_0x6b65('0x1c')]);}_0x309404['order']=qs[_0x6b65('0xca')](_0x4d6d2e[_0x6b65('0x41')][_0x6b65('0xca')]);_0x309404['where']=qs['filters'](_[_0x6b65('0xcb')](_0x4d6d2e['query'],_0x3aa7ac[_0x6b65('0x56')]));if(_0x4d6d2e[_0x6b65('0x41')][_0x6b65('0x3d')]){_0x309404['where']=_[_0x6b65('0xcc')](_0x309404['where'],{'$or':_[_0x6b65('0x30')](_0x309404[_0x6b65('0x47')],function(_0x277022){var _0x295480={};_0x295480[_0x277022]={'$like':'%'+_0x4d6d2e[_0x6b65('0x41')]['filter']+'%'};return _0x295480;})});}_0x309404[_0x6b65('0x40')]={'$and':[_0x309404[_0x6b65('0x40')],{'$or':[{'UserId':_0x4d6d2e[_0x6b65('0x5e')]['id']},{'OwnerId':_0x4d6d2e[_0x6b65('0x5e')]['id']}]}]};_0x309404=_[_0x6b65('0xcc')]({},_0x309404,_0x4d6d2e['options']);var _0x404156={'where':_0x309404[_0x6b65('0x40')]};return db['CmHopper']['count'](_0x404156)[_0x6b65('0x24')](function(_0x8954cc){_0x441963['count']=_0x8954cc;if(_0x4d6d2e['query']['includeAll']){_0x309404[_0x6b65('0x43')]=[{'attributes':['id',_0x6b65('0x163'),_0x6b65('0x164'),'phone'],'model':db[_0x6b65('0x165')],'as':'Contact'},{'attributes':['id',_0x6b65('0x34'),'dialActive'],'model':db['VoiceQueue'],'as':'Queue'}];}return db[_0x6b65('0x153')][_0x6b65('0xaa')](_0x309404);})['then'](function(_0x20a12f){_0x441963[_0x6b65('0x49')]=_0x20a12f;return _0x441963;})[_0x6b65('0x24')](respondWithFilteredResult(_0x2b6916,_0x309404))['catch'](handleError(_0x2b6916,null));};exports['getApiKey']=function(_0x5627f9,_0x2f5b51){if(!_[_0x6b65('0x66')](_0x5627f9[_0x6b65('0x2b')]['id'])&&(_0x5627f9['user'][_0x6b65('0x28')]==_0x6b65('0x29')||_0x5627f9[_0x6b65('0x2b')][_0x6b65('0x28')]==_0x6b65('0x2b'))){return db[_0x6b65('0x39')][_0x6b65('0x95')]({'where':{'id':_0x5627f9['params']['id']},'raw':!![]})[_0x6b65('0x24')](function(_0x58dd62){return authService[_0x6b65('0x166')](_0x58dd62);})[_0x6b65('0x24')](function(_0x10f228){if(_0x10f228){return _0x2f5b51[_0x6b65('0x20')](0xc8)[_0x6b65('0x1b')]({'api_key':_0x10f228['token']});}else{return _0x2f5b51[_0x6b65('0x20')](0xcc)[_0x6b65('0x1b')]({'message':'No\x20API\x20access\x20key\x20found!'});}})['catch'](handleError(_0x2f5b51,0x193));}else{return _0x2f5b51['status'](0x191)['json']({'message':_0x6b65('0x167')});}};exports['createApiKey']=function(_0x55c8e9,_0x6bd668){if(!_['isNil'](_0x55c8e9[_0x6b65('0x2b')]['id'])&&(_0x55c8e9[_0x6b65('0x2b')][_0x6b65('0x28')]==_0x6b65('0x29')||_0x55c8e9[_0x6b65('0x2b')][_0x6b65('0x28')]==_0x6b65('0x2b'))){return db[_0x6b65('0x39')][_0x6b65('0x33')]({'where':{'id':_0x55c8e9[_0x6b65('0x5e')]['id']}})[_0x6b65('0x24')](function(_0x10c387){return authService['generateApiKey'](_0x10c387);})[_0x6b65('0x24')](function(_0x20fe6a){return db['User'][_0x6b65('0x23')]({'apiKeyIat':_0x20fe6a['iat'],'apiKeyNonce':_0x20fe6a[_0x6b65('0x168')]},{'where':{'id':_0x55c8e9['params']['id']}})['then'](function(){return _0x6bd668[_0x6b65('0x20')](0xc8)[_0x6b65('0x1b')]({'api_key':_0x20fe6a[_0x6b65('0x169')]});});})[_0x6b65('0x52')](handleError(_0x6bd668,0x193));}else{return _0x6bd668['status'](0x191)[_0x6b65('0x1b')]({'message':_0x6b65('0x167')});}};exports[_0x6b65('0x16a')]=function(_0x4d88ee,_0x545b31){if(!_[_0x6b65('0x66')](_0x4d88ee[_0x6b65('0x2b')]['id'])&&(_0x4d88ee['user'][_0x6b65('0x28')]==_0x6b65('0x29')||_0x4d88ee['user']['role']=='user')){return db[_0x6b65('0x39')]['find']({'where':{'id':_0x4d88ee['params']['id']}})[_0x6b65('0x24')](handleEntityNotFound(_0x545b31,null))[_0x6b65('0x24')](function(_0x152546){if(_0x152546&&_0x152546[_0x6b65('0x16b')]&&_0x152546['apiKeyIat'])return _0x152546;else throw{'message':'API\x20key\x20not\x20available'};})[_0x6b65('0x24')](function(){return db[_0x6b65('0x39')][_0x6b65('0x23')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x4d88ee[_0x6b65('0x5e')]['id']}});})[_0x6b65('0x24')](respondWithStatusCode(_0x545b31,0xc8))[_0x6b65('0x52')](handleError(_0x545b31,0x193));}else{return _0x545b31[_0x6b65('0x20')](0x191)['json']({'message':_0x6b65('0x167')});}};exports[_0x6b65('0x16c')]=function(_0x3c19af,_0xefa94d){var _0x275b3d=_0x3c19af[_0x6b65('0x2b')]['get']({'plain':!![]});if(!_0x275b3d){return _0xefa94d[_0x6b65('0x20')](0x191)['send'](_0x6b65('0x16d'));}else{Promise[_0x6b65('0x100')]()[_0x6b65('0x24')](function(){if(_0x3c19af[_0x6b65('0x41')]['userSetting']!==_0x6b65('0x45'))return;return _0x3c19af[_0x6b65('0x2b')][_0x6b65('0x16e')]();})['then'](function(_0x4abc2d){if(!_0x4abc2d)return;return _0x4abc2d[_0x6b65('0xd7')]({'plain':!![]});})['then'](function(_0xe6d2b8){_0x275b3d[_0x6b65('0x44')]=_0xe6d2b8;return _0xefa94d['status'](0xc8)[_0x6b65('0x1b')](_0x275b3d);});}};exports[_0x6b65('0x16f')]=function(_0x3f0db1,_0x52da05){var _0x389f9d={'offset':0x0},_0x25e86e={'count':0x0,'rows':[]};Promise[_0x6b65('0x100')]()[_0x6b65('0x24')](function(){if(!_0x3f0db1[_0x6b65('0x41')]['filter']&&!_0x3f0db1['query']['teams']&&!_0x3f0db1['query'][_0x6b65('0x170')])return[];return Promise[_0x6b65('0x100')]()[_0x6b65('0x24')](function(){var _0x475f35=[];if(!_[_0x6b65('0x171')](_0x3f0db1['query'][_0x6b65('0x172')])){_0x475f35[_0x6b65('0x48')](db['Team'][_0x6b65('0xaa')]({'attributes':['id',_0x6b65('0x34')],'where':{'id':_0x3f0db1['query'][_0x6b65('0x172')]}}));}if(!_['isEmpty'](_0x3f0db1[_0x6b65('0x41')][_0x6b65('0x170')])){_0x475f35[_0x6b65('0x48')](db[_0x6b65('0xa9')][_0x6b65('0xaa')]({'attributes':['id',_0x6b65('0x34')],'type':_0x6b65('0x173'),'where':{'id':_0x3f0db1[_0x6b65('0x41')][_0x6b65('0x170')]}}));}return Promise['all'](_0x475f35);})[_0x6b65('0x24')](function(_0x136434){var _0x25a945=_[_0x6b65('0x174')](_0x136434)[_0x6b65('0x30')](function(_0x1ea3d8){return _0x1ea3d8[_0x6b65('0x11f')]({'attributes':['id',_0x6b65('0x34'),_0x6b65('0x61'),_0x6b65('0x9b')],'raw':!![]});});return Promise['all'](_0x25a945);})[_0x6b65('0x24')](function(_0xb7058f){var _0x10c9e2=_[_0x6b65('0x174')](_0xb7058f);if(!_0x3f0db1[_0x6b65('0x41')]['filter'])return _0x10c9e2;if(_[_0x6b65('0x171')](_0x10c9e2)){return db[_0x6b65('0x39')][_0x6b65('0xaa')]({'attributes':['id',_0x6b65('0x34'),_0x6b65('0x61'),_0x6b65('0x9b')],'where':{'role':_0x6b65('0x2d'),'$or':[db[_0x6b65('0x68')][_0x6b65('0x40')](db[_0x6b65('0x68')]['fn']('lower',db[_0x6b65('0x68')][_0x6b65('0x175')](_0x6b65('0x34'))),{'$like':'%'+_0x3f0db1[_0x6b65('0x41')]['filter'][_0x6b65('0xa3')]()+'%'}),{'internal':{'$like':'%'+_0x3f0db1[_0x6b65('0x41')][_0x6b65('0x3d')]+'%'}}]},'raw':!![]});}else{return _(_0x10c9e2)[_0x6b65('0x174')]()['filter'](function(_0x339b7a){return _0x339b7a['name'][_0x6b65('0xa3')]()[_0x6b65('0x32')](_0x3f0db1[_0x6b65('0x41')][_0x6b65('0x3d')][_0x6b65('0xa3')]())||_0x339b7a[_0x6b65('0x61')][_0x6b65('0x176')]()[_0x6b65('0x32')](_0x3f0db1[_0x6b65('0x41')][_0x6b65('0x3d')]);})['value']();}})[_0x6b65('0x24')](function(_0x59fae0){var _0x2bb877=_0x6b65('0x34');var _0xdafca='asc';if(_0x3f0db1[_0x6b65('0x41')]['sort']){_0xdafca=_0x3f0db1['query'][_0x6b65('0xca')][0x0]==='-'?_0x6b65('0x177'):_0x6b65('0x178');_0x2bb877=_0xdafca===_0x6b65('0x178')?_0x3f0db1[_0x6b65('0x41')][_0x6b65('0xca')]:_0x3f0db1['query']['sort'][_0x6b65('0x179')](0x1);}return _(_0x59fae0)[_0x6b65('0x17a')]('id')[_0x6b65('0x17b')]([function(_0x4a7df6){return _0x2bb877===_0x6b65('0x34')?_0x4a7df6[_0x2bb877][_0x6b65('0xa3')]():_0x4a7df6[_0x2bb877];}],[_0xdafca])['map'](function(_0x2a9812){return _['pick'](_0x2a9812,['id','name',_0x6b65('0x61'),_0x6b65('0x9b')]);})[_0x6b65('0x31')]();})[_0x6b65('0x24')](function(_0x2a763b){return amiClient[_0x6b65('0x17c')](_0x6b65('0x2c'),_0x3f0db1)[_0x6b65('0x24')](function(_0x4c65aa){if(_0x4c65aa[_0x6b65('0x17')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x58b72a=_0x4c65aa['result'];var _0x2ee843=jayson[_0x6b65('0x17d')][_0x6b65('0x11')]({'port':0x232c});return _0x2ee843[_0x6b65('0x17c')](_0x6b65('0x2c'),_0x3f0db1)[_0x6b65('0x24')](function(_0xfdbc13){if(_0xfdbc13[_0x6b65('0x17')])throw new Error(_0x6b65('0x17e'));var _0x2480c4=_0xfdbc13[_0x6b65('0x17f')];return _['merge']({},_0x2480c4,_0x58b72a);});})[_0x6b65('0x24')](function(_0x2f5daf){return _['map'](_0x2a763b,function(_0x4f8190){var _0x71323d=_[_0x6b65('0x33')](_0x2f5daf[_0x6b65('0x49')],['id',_0x4f8190['id']]);if(!_0x71323d||!_0x4f8190[_0x6b65('0x9b')]){_0x4f8190[_0x6b65('0x20')]=_0x6b65('0x180');}else if(_0x71323d[_0x6b65('0x9d')]){_0x4f8190['status']=_0x6b65('0x102');}else{_0x4f8190[_0x6b65('0x20')]=_[_0x6b65('0x32')]([_0x6b65('0x181'),'unknown',_0x6b65('0x182'),_0x6b65('0x183'),null,undefined],_0x71323d[_0x6b65('0x184')])?_0x6b65('0x9b'):'busy';}return _0x4f8190;});});});})[_0x6b65('0x24')](function(_0x18dd72){if(!_0x3f0db1[_0x6b65('0x41')][_0x6b65('0xd3')](_0x6b65('0xd4'))){_0x389f9d[_0x6b65('0x1e')]=qs['limit'](_0x3f0db1[_0x6b65('0x41')][_0x6b65('0x1e')]||0xa);_0x389f9d[_0x6b65('0x1c')]=qs[_0x6b65('0x1c')](_0x3f0db1[_0x6b65('0x41')][_0x6b65('0x1c')]);}_0x25e86e['count']=_0x18dd72[_0x6b65('0x4b')];_0x25e86e[_0x6b65('0x49')]=_0x389f9d[_0x6b65('0x1e')]?_0x18dd72['slice'](_0x389f9d[_0x6b65('0x1c')],_0x389f9d[_0x6b65('0x1c')]+_0x389f9d[_0x6b65('0x1e')]):_0x18dd72;return _0x25e86e;})['then'](respondWithFilteredResult(_0x52da05,_0x389f9d))[_0x6b65('0x52')](handleError(_0x52da05,null));};function get_open_tabs(_0x4953f9,_0x3bbe1e){var _0x40855e=_0x4953f9['charAt'](0x0)[_0x6b65('0x185')]()+_0x4953f9[_0x6b65('0x186')](0x1);var _0x5321b9={'type':db[_0x6b65('0x8d')][_0x6b65('0x187')]['SELECT'],'raw':!![]};return new Promise(function(_0x316dbb,_0x217b2b){var _0x36a5f5=squel['select']()[_0x6b65('0x188')](_0x6b65('0x189')+_0x40855e+'InteractionId','id')[_0x6b65('0x188')](_0x6b65('0x18a'))[_0x6b65('0x6b')]('user_has_'+_0x4953f9+_0x6b65('0x18b'),'ui')[_0x6b65('0x40')](_0x6b65('0x18c'),_0x3bbe1e['id']);return db[_0x6b65('0x68')][_0x6b65('0x41')](_0x36a5f5[_0x6b65('0x176')](),_0x5321b9)[_0x6b65('0x24')](function(_0x50e3b3){_0x3bbe1e[_0x40855e+_0x6b65('0x18d')]=_0x50e3b3;_0x316dbb(_0x50e3b3);})[_0x6b65('0x52')](function(_0x2cf6){_0x217b2b(_0x2cf6);});});}
\ No newline at end of file
index a8a0601..99ed86b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa496=['User','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x39c0a3,_0x4b6041){var _0x1c94af=function(_0x2f5b91){while(--_0x2f5b91){_0x39c0a3['push'](_0x39c0a3['shift']());}};_0x1c94af(++_0x4b6041);}(_0xa496,0xa8));var _0x6a49=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa496[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var User=require('../../mysqldb')['db'][_0x6a49('0x0')];var UserEvents=new EventEmitter();UserEvents[_0x6a49('0x1')](0x0);var events={'afterCreate':_0x6a49('0x2'),'afterUpdate':'update','afterDestroy':_0x6a49('0x3')};function emitEvent(_0x389287){return function(_0xc47191,_0x5c14eb,_0x310e5d){UserEvents[_0x6a49('0x4')](_0x389287+':'+_0xc47191['id'],_0xc47191);UserEvents[_0x6a49('0x4')](_0x389287,_0xc47191);_0x310e5d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];User[_0x6a49('0x5')](e,emitEvent(event));}}module[_0x6a49('0x6')]=UserEvents;
\ No newline at end of file
+var _0x5737=['exports','events','../../mysqldb','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x1145af,_0x203281){var _0x41b120=function(_0xd0d63a){while(--_0xd0d63a){_0x1145af['push'](_0x1145af['shift']());}};_0x41b120(++_0x203281);}(_0x5737,0x71));var _0x7573=function(_0xab5f15,_0x5c1860){_0xab5f15=_0xab5f15-0x0;var _0x56290a=_0x5737[_0xab5f15];return _0x56290a;};'use strict';var EventEmitter=require(_0x7573('0x0'));var User=require(_0x7573('0x1'))['db']['User'];var UserEvents=new EventEmitter();UserEvents[_0x7573('0x2')](0x0);var events={'afterCreate':_0x7573('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x19faf9){return function(_0x1d1a36,_0x493a1f,_0x30f060){UserEvents[_0x7573('0x4')](_0x19faf9+':'+_0x1d1a36['id'],_0x1d1a36);UserEvents[_0x7573('0x4')](_0x19faf9,_0x1d1a36);_0x30f060(null);};}for(var e in events){if(events[_0x7573('0x5')](e)){var event=events[e];User['hook'](e,emitEvent(event));}}module[_0x7573('0x6')]=UserEvents;
\ No newline at end of file
index 33ab378..14656f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa37e=['function','Missing\x20Callback','randomBytes','toString','salt','from','base64','pbkdf2Sync','sha1','pbkdf2','indexOf','Invalid\x20password','makeSalt','md5secret',':asterisk:','client','http','request','Agents','Unable\x20to\x20retrieve\x20RPC\x20agent\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agent\x20(Routing)','manual','voice','Unable\x20to\x20unpause\x20agent\x20%s:$s','UserVoiceQueueRt','findOne','PAUSE','channel','MemberReport','map','update','YYYY-MM-DD\x20HH:mm:ss','voicePause','mailPause','chatPause','faxPause','Pause','getRealtimeData','../../config/utils','getChannels','forEach','Status','setDataValue','util','md5','moment','lodash','./user.attributes','length','system','format','%s%s','merge','Set','chanspy','record','push','MixMonitor','recordingFormat','Authenticate','password','options','join','StopMixMonitor','wav','WAV','gsm','context','from-sip','CDR(type)=internal','extensionMonitor','includes','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','name','Dial','SIP/%s,,tTxX','Hangup','priority','VoiceChanSpy','findAll','then','internal','concat','exports','models','define','User','utf8','utf8_bin','undefined','UserProfile','find','userProfileId','privacyEnabled','updatePassword','catch','changed','updateMd5Password','resolve','userSetting','error','VoiceExtension','bulkCreate','destroy','encryptPassword'];(function(_0x2f2d3e,_0x2c13cb){var _0x4d297f=function(_0x4a8d33){while(--_0x4a8d33){_0x2f2d3e['push'](_0x2f2d3e['shift']());}};_0x4d297f(++_0x2c13cb);}(_0xa37e,0x97));var _0xea37=function(_0x593a46,_0x7b5566){_0x593a46=_0x593a46-0x0;var _0x1ccdb3=_0xa37e[_0x593a46];return _0x1ccdb3;};'use strict';var BPromise=require('bluebird');var crypto=require('crypto');var util=require(_0xea37('0x0'));var md5=require(_0xea37('0x1'));var moment=require(_0xea37('0x2'));var _=require(_0xea37('0x3'));var jayson=require('jayson/promise');var attributes=require(_0xea37('0x4'));var authTypes=['google'];var validatePresenceOf=function(_0x360ed5){return _0x360ed5&&_0x360ed5[_0xea37('0x5')];};var getChanSpyApplications=function(_0x162ed6,_0x4d380b,_0x57135b){var _0x36c489={'context':_0x162ed6['context']||'from-sip','type':_0xea37('0x6'),'isApp':![],'UserId':_0x162ed6['id']};var _0x1401e1=[];for(var _0x7a16c6=0x0,_0xf5a9e1=0x1;_0x7a16c6<_0x57135b['length'];_0x7a16c6++,_0xf5a9e1=0x1){var _0x315e5f={'exten':util[_0xea37('0x7')](_0xea37('0x8'),_0x57135b[_0x7a16c6]['prefix'],_0x4d380b),'ChanSpyId':_0x57135b[_0x7a16c6]['id']};_0x1401e1['push'](_[_0xea37('0x9')]({'app':_0xea37('0xa'),'appdata':util[_0xea37('0x7')]('CDR(type)=%s',_0xea37('0xb')),'priority':_0xf5a9e1++},_0x36c489,_0x315e5f));if(_0x57135b[_0x7a16c6][_0xea37('0xc')]){_0x1401e1[_0xea37('0xd')](_['merge']({'app':_0xea37('0xe'),'appdata':util[_0xea37('0x7')]('${UNIQUEID}.%s,a',_0x57135b[_0x7a16c6][_0xea37('0xf')]),'priority':_0xf5a9e1++},_0x36c489,_0x315e5f));}if(_0x57135b[_0x7a16c6]['auth']){_0x1401e1[_0xea37('0xd')](_['merge']({'app':_0xea37('0x10'),'appdata':_0x57135b[_0x7a16c6][_0xea37('0x11')],'priority':_0xf5a9e1++},_0x36c489,_0x315e5f));}_0x1401e1[_0xea37('0xd')](_[_0xea37('0x9')]({'app':'ChanSpy','appdata':util[_0xea37('0x7')]('SIP/%s,%s',_0x162ed6['name'],_0x57135b[_0x7a16c6][_0xea37('0x12')]?_0x57135b[_0x7a16c6]['options'][_0xea37('0x13')](''):''),'priority':_0xf5a9e1++},_0x36c489,_0x315e5f));if(_0x57135b[_0x7a16c6][_0xea37('0xc')]){_0x1401e1['push'](_[_0xea37('0x9')]({'app':_0xea37('0x14'),'priority':_0xf5a9e1++},_0x36c489,_0x315e5f));}}return _0x1401e1;};var getUserApplications=function(_0x5427e7,_0x786ee5){var _0x3f5ebc=[_0xea37('0x15'),_0xea37('0x16'),_0xea37('0x17')];var _0x447fcb={'context':_0x5427e7[_0xea37('0x18')]||_0xea37('0x19'),'exten':_0x786ee5,'type':_0xea37('0x6'),'isApp':![],'UserId':_0x5427e7['id']};var _0x3e00cb=[{'app':'Set','appdata':_0xea37('0x1a')}];if(_0x5427e7[_0xea37('0x1b')]&&_[_0xea37('0x1c')](_0x3f5ebc,_0x5427e7['extensionMonitor'])){_0x3e00cb['push']({'app':_0xea37('0xa'),'appdata':_0xea37('0x1d')});_0x3e00cb[_0xea37('0xd')]({'app':_0xea37('0xa'),'appdata':util['format'](_0xea37('0x1e'),_0x5427e7['extensionMonitor'])});_0x3e00cb['push']({'app':'Dial','appdata':util[_0xea37('0x7')]('SIP/%s,,tTxXU(xcally-mixmonitor-context)',_0x5427e7[_0xea37('0x1f')])});}else{_0x3e00cb[_0xea37('0xd')]({'app':_0xea37('0x20'),'appdata':util[_0xea37('0x7')](_0xea37('0x21'),_0x5427e7[_0xea37('0x1f')])});}_0x3e00cb['push']({'app':_0xea37('0x22')});for(var _0x55880c=0x0;_0x55880c<_0x3e00cb[_0xea37('0x5')];_0x55880c++){_0x3e00cb[_0x55880c][_0xea37('0x23')]=_0x55880c+0x1;_0x3e00cb[_0x55880c]=_['defaults'](_0x3e00cb[_0x55880c],_0x447fcb);}return _0x3e00cb;};var getChanSpyPromise=function(_0x1ff12d,_0x10d556){return new BPromise(function(_0xd564a7,_0x4e2a65){return _0x1ff12d[_0xea37('0x24')][_0xea37('0x25')]()[_0xea37('0x26')](function(_0x2e745c){if(_0x2e745c){var _0x51a1fe=getChanSpyApplications(_0x10d556,_0x10d556[_0xea37('0x27')],_0x2e745c);if(_0x10d556['internal']!=_0x10d556['name']){_0x51a1fe=_0x51a1fe[_0xea37('0x28')](getChanSpyApplications(_0x10d556,_0x10d556['name'],_0x2e745c));}return _0xd564a7(_0x51a1fe);}return _0xd564a7([]);})['catch'](function(_0x51b402){_0x4e2a65(_0x51b402);});});};module[_0xea37('0x29')]=function(_0x1e4bc0){var _0x3ec6af=_0x1e4bc0[_0xea37('0x2a')];return _0x1e4bc0[_0xea37('0x2b')](_0xea37('0x2c'),attributes,{'tableName':'users','charset':_0xea37('0x2d'),'collate':_0xea37('0x2e'),'hooks':{'beforeCreate':function(_0x43f051,_0x44d1b7,_0x839c1a){var _0x33717c=typeof _0x43f051['userProfileId']===_0xea37('0x2f')?BPromise['resolve'](null):_0x3ec6af[_0xea37('0x30')][_0xea37('0x31')]({'where':{'id':_0x43f051[_0xea37('0x32')]}});_0x33717c[_0xea37('0x26')](function(_0x477dec){if(_0x477dec){_0x43f051[_0xea37('0x33')]=_0x477dec[_0xea37('0x33')];}})[_0xea37('0x26')](function(){_0x43f051['updateMd5Password']();_0x43f051[_0xea37('0x34')](_0x839c1a);})[_0xea37('0x35')](function(_0x12957c){_0x839c1a(_0x12957c);});},'beforeUpdate':function(_0x37173a,_0x2537f8,_0x393550){Promise['resolve']()['then'](function(){if(_0x37173a['changed'](_0xea37('0x32'))===![])return;return _0x3ec6af['UserProfile'][_0xea37('0x31')]({'where':{'id':_0x37173a['userProfileId']}})['then'](function(_0x5652a4){if(_0x5652a4)_0x37173a['privacyEnabled']=_0x5652a4[_0xea37('0x33')];return;});})[_0xea37('0x26')](function(){if(_0x37173a[_0xea37('0x36')](_0xea37('0x11'))){_0x37173a[_0xea37('0x37')]();return _0x37173a[_0xea37('0x34')](_0x393550);}_0x393550();})[_0xea37('0x35')](function(_0x1f446a){_0x393550(_0x1f446a);});},'afterCreate':function(_0x267456,_0x5b5439,_0x40679c){var _0x565c66=getUserApplications(_0x267456,_0x267456[_0xea37('0x27')]);if(_0x267456[_0xea37('0x27')]!=_0x267456[_0xea37('0x1f')]){_0x565c66=_0x565c66['concat'](getUserApplications(_0x267456,_0x267456[_0xea37('0x1f')]));}return Promise[_0xea37('0x38')]()[_0xea37('0x26')](function(){if(!_0x267456[_0xea37('0x39')]){return _0x267456['createUserSetting']({'clientSideLoggingLevel':_0xea37('0x3a'),'clientSideLoggingEnabled':![]});}})['then'](function(){return _0x3ec6af[_0xea37('0x3b')][_0xea37('0x3c')](_0x565c66);})[_0xea37('0x26')](function(){if(_0x267456[_0xea37('0xb')]){return getChanSpyPromise(_0x3ec6af,_0x267456);}})[_0xea37('0x26')](function(_0x435300){if(_0x435300&&_0x435300['length']){return _0x3ec6af[_0xea37('0x3b')][_0xea37('0x3c')](_0x435300);}})['then'](function(){_0x40679c();})[_0xea37('0x35')](function(_0x4e9a82){_0x40679c(_0x4e9a82);});},'afterUpdate':function(_0x12894f,_0x31cef9,_0x19d282){return BPromise[_0xea37('0x38')]()[_0xea37('0x26')](function(){if(_0x12894f[_0xea37('0x36')](_0xea37('0xb'))||_0x12894f[_0xea37('0x36')](_0xea37('0x18'))){return _0x3ec6af[_0xea37('0x3b')][_0xea37('0x3d')]({'where':{'UserId':_0x12894f['id'],'type':_0xea37('0x6'),'ChanSpyId':{'$ne':null}}})[_0xea37('0x26')](function(){if(_0x12894f[_0xea37('0xb')]){return getChanSpyPromise(_0x3ec6af,_0x12894f)[_0xea37('0x26')](function(_0x4d83f1){if(_0x4d83f1&&_0x4d83f1[_0xea37('0x5')]){return _0x3ec6af[_0xea37('0x3b')][_0xea37('0x3c')](_0x4d83f1);}});}});}})[_0xea37('0x26')](function(){if(_0x12894f[_0xea37('0x36')]('extensionMonitor')||_0x12894f[_0xea37('0x36')](_0xea37('0x18'))){return _0x3ec6af[_0xea37('0x3b')][_0xea37('0x3d')]({'where':{'UserId':_0x12894f['id'],'type':_0xea37('0x6'),'ChanSpyId':null}})[_0xea37('0x26')](function(){var _0x4f3222=getUserApplications(_0x12894f,_0x12894f[_0xea37('0x27')]);if(_0x12894f[_0xea37('0x27')]!=_0x12894f[_0xea37('0x1f')]){_0x4f3222=_0x4f3222[_0xea37('0x28')](getUserApplications(_0x12894f,_0x12894f[_0xea37('0x1f')]));}return _0x3ec6af[_0xea37('0x3b')][_0xea37('0x3c')](_0x4f3222);});}})[_0xea37('0x26')](function(){_0x19d282();})['catch'](function(_0x34f2f9){_0x19d282(_0x34f2f9);});},'afterDestroy':function(_0x103c9b){return _0x3ec6af['VoiceExtension'][_0xea37('0x3d')]({'where':{'UserId':_0x103c9b['id'],'type':_0xea37('0x6')}});}},'instanceMethods':{'authenticate':function(_0x172f22,_0x2f1c0d){if(!_0x2f1c0d){return this[_0xea37('0x11')]===this[_0xea37('0x3e')](_0x172f22);}var _0x3be42d=this;this[_0xea37('0x3e')](_0x172f22,function(_0x483d1a,_0x46d6e3){if(_0x483d1a){_0x2f1c0d(_0x483d1a);}if(_0x3be42d['password']===_0x46d6e3){_0x2f1c0d(null,!![]);}else{_0x2f1c0d(null,![]);}});},'makeSalt':function(_0x3b451a,_0x54fc4e){var _0x3b4c60=0x10;if(typeof arguments[0x0]===_0xea37('0x3f')){_0x54fc4e=arguments[0x0];_0x3b451a=_0x3b4c60;}else if(typeof arguments[0x1]===_0xea37('0x3f')){_0x54fc4e=arguments[0x1];}else{throw new Error(_0xea37('0x40'));}if(!_0x3b451a){_0x3b451a=_0x3b4c60;}return crypto[_0xea37('0x41')](_0x3b451a,function(_0x1f55c2,_0x3628cd){if(_0x1f55c2){_0x54fc4e(_0x1f55c2);}return _0x54fc4e(null,_0x3628cd[_0xea37('0x42')]('base64'));});},'encryptPassword':function(_0x4c55b9,_0xd3f0b4){if(!_0x4c55b9||!this[_0xea37('0x43')]){return _0xd3f0b4?_0xd3f0b4(null):null;}var _0x19223c=0x2710;var _0x5e9bdc=0x40;var _0xa85ffb=Buffer[_0xea37('0x44')](this['salt'],_0xea37('0x45'));if(!_0xd3f0b4){return crypto[_0xea37('0x46')](_0x4c55b9,_0xa85ffb,_0x19223c,_0x5e9bdc,_0xea37('0x47'))[_0xea37('0x42')](_0xea37('0x45'));}return crypto[_0xea37('0x48')](_0x4c55b9,_0xa85ffb,_0x19223c,_0x5e9bdc,_0xea37('0x47'),function(_0x224f2c,_0x18a7b1){if(_0x224f2c){_0xd3f0b4(_0x224f2c);}return _0xd3f0b4(null,_0x18a7b1[_0xea37('0x42')](_0xea37('0x45')));});},'updatePassword':function(_0x2fdc66){if(!this[_0xea37('0x11')]){return _0x2fdc66(null);}if(!validatePresenceOf(this[_0xea37('0x11')])&&authTypes[_0xea37('0x49')](this['provider'])===-0x1){_0x2fdc66(new Error(_0xea37('0x4a')));}var _0x3aded1=this;this[_0xea37('0x4b')](function(_0x2acb0f,_0x40d747){if(_0x2acb0f){return _0x2fdc66(_0x2acb0f);}_0x3aded1[_0xea37('0x43')]=_0x40d747;_0x3aded1['encryptPassword'](_0x3aded1[_0xea37('0x11')],function(_0x17f482,_0x3f0e5c){if(_0x17f482){_0x2fdc66(_0x17f482);}_0x3aded1[_0xea37('0x11')]=_0x3f0e5c;_0x2fdc66(null);});});},'updateMd5Password':function(){this[_0xea37('0x4c')]=md5(this['name']+_0xea37('0x4d')+this[_0xea37('0x11')]);return this['md5secret'];},'getRealtimeData':function(){var _0x48cc1c={'id':this['id']};var _0x5a070a=jayson[_0xea37('0x4e')][_0xea37('0x4f')]({'port':0x232a});var _0x356e6c=jayson[_0xea37('0x4e')][_0xea37('0x4f')]({'port':0x232c});var _0x578aa9={};var _0x2dc886={};return _0x5a070a[_0xea37('0x50')](_0xea37('0x51'),_0x48cc1c)[_0xea37('0x26')](function(_0x3c0eb7){if(_0x3c0eb7[_0xea37('0x3a')]){throw new Error(_0xea37('0x52'));}_0x578aa9=_0x3c0eb7[_0xea37('0x53')];return _0x356e6c[_0xea37('0x50')](_0xea37('0x51'),_0x48cc1c);})[_0xea37('0x26')](function(_0x1c7290){if(_0x1c7290[_0xea37('0x3a')]){throw new Error(_0xea37('0x54'));}_0x2dc886=_0x1c7290[_0xea37('0x53')];var _0x1e3451=_[_0xea37('0x9')]({},_0x578aa9,_0x2dc886);return _0x1e3451;})['catch'](function(_0x37c2c4){throw _0x37c2c4;});},'unpause':function(_0x480b03,_0x24f80e=_0xea37('0x55')){var _0x409fba=this;var _0x316f33={};return Promise[_0xea37('0x38')]()[_0xea37('0x26')](function(){if(!_0x480b03||_0x480b03===_0xea37('0x56')&&_0x24f80e==='manual'){var _0x4d3ba5=jayson['client'][_0xea37('0x4f')]({'port':0x232a});return _0x4d3ba5['request']('QueuePause',{'id':_0x409fba['id'],'name':_0x409fba[_0xea37('0x1f')],'pause':![]})[_0xea37('0x26')](function(_0x1a037f){if(_0x1a037f['error']){throw new Error(util[_0xea37('0x7')](_0xea37('0x57'),_0x409fba['id'],_0x409fba[_0xea37('0x1f')]));}return _0x1a037f['result']['message'];});}})[_0xea37('0x26')](function(){if(!_0x480b03||_0x480b03===_0xea37('0x56')){return _0x3ec6af[_0xea37('0x58')]['update']({'paused':0x0},{'where':{'UserId':_0x409fba['id']},'individualHooks':!![]});}})[_0xea37('0x26')](function(){var _0x198f7f=!_0x480b03?_0xea37('0x25'):_0xea37('0x59');var _0x40715c={'membername':_0x409fba['name'],'type':_0xea37('0x5a'),'exitAt':null};if(_0x480b03){_0x40715c[_0xea37('0x5b')]=_0x480b03;}return _0x3ec6af[_0xea37('0x5c')][_0x198f7f]({'where':_0x40715c});})[_0xea37('0x26')](function(_0x54eeff){if(_0x54eeff){var _0x1d3055=Array['isArray'](_0x54eeff)?_0x54eeff:[_0x54eeff];var _0x28695d=_0x1d3055[_0xea37('0x5d')](function(_0xa02463){return _0xa02463[_0xea37('0x5e')]({'exitAt':moment()['format'](_0xea37('0x5f')),'data2':_0x24f80e});});return Promise['all'](_0x28695d);}})['then'](function(){if(!_0x480b03){_0x316f33[_0xea37('0x60')]=![];_0x316f33[_0xea37('0x61')]=![];_0x316f33[_0xea37('0x62')]=![];_0x316f33[_0xea37('0x63')]=![];_0x316f33['smsPause']=![];_0x316f33['whatsappPause']=![];_0x316f33['openchannelPause']=![];}else{_0x316f33[_0x480b03+_0xea37('0x64')]=![];}return _0x409fba[_0xea37('0x65')]();})['then'](function(_0x25e377){var _0x3bf713=require(_0xea37('0x66'));var _0x463c9a=_0x3bf713[_0xea37('0x67')]();_0x463c9a[_0xea37('0x68')](function(_0x362ca0){var _0x4be82f=_0x362ca0+_0xea37('0x69');_0x409fba[_0xea37('0x6a')]([_0x4be82f],_0x25e377[_0x4be82f]);});return _0x409fba[_0xea37('0x5e')](_0x316f33);})['catch'](function(_0x4c6f27){throw _0x4c6f27;});}}});};
\ No newline at end of file
+var _0xc9b9=['WAV','CDR(type)=internal','extensionMonitor','includes','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','SIP/%s,,tTxXU(xcally-mixmonitor-context)','Dial','SIP/%s,,tTxX','Hangup','priority','defaults','VoiceChanSpy','findAll','then','internal','define','User','users','utf8_bin','userProfileId','undefined','resolve','UserProfile','privacyEnabled','updateMd5Password','updatePassword','changed','find','catch','concat','createUserSetting','error','bulkCreate','destroy','VoiceExtension','encryptPassword','function','Missing\x20Callback','randomBytes','toString','base64','salt','from','pbkdf2Sync','sha1','pbkdf2','indexOf','Invalid\x20password',':asterisk:','md5secret','client','http','request','Agents','Unable\x20to\x20retrieve\x20RPC\x20agent\x20(AMI)','result','manual','voice','QueuePause','Unable\x20to\x20unpause\x20agent\x20%s:$s','message','UserVoiceQueueRt','update','findOne','PAUSE','isArray','map','voicePause','mailPause','chatPause','faxPause','smsPause','whatsappPause','openchannelPause','Pause','../../config/utils','getChannels','forEach','Status','setDataValue','util','md5','moment','context','from-sip','system','length','%s%s','prefix','merge','Set','chanspy','push','auth','Authenticate','password','ChanSpy','format','SIP/%s,%s','name','options','join','record','StopMixMonitor','wav'];(function(_0x2d60f2,_0x4f31ca){var _0x199e02=function(_0x94414b){while(--_0x94414b){_0x2d60f2['push'](_0x2d60f2['shift']());}};_0x199e02(++_0x4f31ca);}(_0xc9b9,0x18f));var _0x9c9b=function(_0x28669c,_0x1f62c4){_0x28669c=_0x28669c-0x0;var _0x4a3af6=_0xc9b9[_0x28669c];return _0x4a3af6;};'use strict';var BPromise=require('bluebird');var crypto=require('crypto');var util=require(_0x9c9b('0x0'));var md5=require(_0x9c9b('0x1'));var moment=require(_0x9c9b('0x2'));var _=require('lodash');var jayson=require('jayson/promise');var attributes=require('./user.attributes');var authTypes=['google'];var validatePresenceOf=function(_0x38a64b){return _0x38a64b&&_0x38a64b['length'];};var getChanSpyApplications=function(_0x4adcd1,_0x51abae,_0x1f29f3){var _0x15d94b={'context':_0x4adcd1[_0x9c9b('0x3')]||_0x9c9b('0x4'),'type':_0x9c9b('0x5'),'isApp':![],'UserId':_0x4adcd1['id']};var _0x5e0081=[];for(var _0x121412=0x0,_0x20f056=0x1;_0x121412<_0x1f29f3[_0x9c9b('0x6')];_0x121412++,_0x20f056=0x1){var _0x121f42={'exten':util['format'](_0x9c9b('0x7'),_0x1f29f3[_0x121412][_0x9c9b('0x8')],_0x51abae),'ChanSpyId':_0x1f29f3[_0x121412]['id']};_0x5e0081['push'](_[_0x9c9b('0x9')]({'app':_0x9c9b('0xa'),'appdata':util['format']('CDR(type)=%s',_0x9c9b('0xb')),'priority':_0x20f056++},_0x15d94b,_0x121f42));if(_0x1f29f3[_0x121412]['record']){_0x5e0081[_0x9c9b('0xc')](_[_0x9c9b('0x9')]({'app':'MixMonitor','appdata':util['format']('${UNIQUEID}.%s,a',_0x1f29f3[_0x121412]['recordingFormat']),'priority':_0x20f056++},_0x15d94b,_0x121f42));}if(_0x1f29f3[_0x121412][_0x9c9b('0xd')]){_0x5e0081[_0x9c9b('0xc')](_['merge']({'app':_0x9c9b('0xe'),'appdata':_0x1f29f3[_0x121412][_0x9c9b('0xf')],'priority':_0x20f056++},_0x15d94b,_0x121f42));}_0x5e0081['push'](_[_0x9c9b('0x9')]({'app':_0x9c9b('0x10'),'appdata':util[_0x9c9b('0x11')](_0x9c9b('0x12'),_0x4adcd1[_0x9c9b('0x13')],_0x1f29f3[_0x121412][_0x9c9b('0x14')]?_0x1f29f3[_0x121412][_0x9c9b('0x14')][_0x9c9b('0x15')](''):''),'priority':_0x20f056++},_0x15d94b,_0x121f42));if(_0x1f29f3[_0x121412][_0x9c9b('0x16')]){_0x5e0081['push'](_[_0x9c9b('0x9')]({'app':_0x9c9b('0x17'),'priority':_0x20f056++},_0x15d94b,_0x121f42));}}return _0x5e0081;};var getUserApplications=function(_0x863d77,_0x34c3e5){var _0x1fa771=[_0x9c9b('0x18'),_0x9c9b('0x19'),'gsm'];var _0x567322={'context':_0x863d77[_0x9c9b('0x3')]||'from-sip','exten':_0x34c3e5,'type':_0x9c9b('0x5'),'isApp':![],'UserId':_0x863d77['id']};var _0x3c15d9=[{'app':_0x9c9b('0xa'),'appdata':_0x9c9b('0x1a')}];if(_0x863d77[_0x9c9b('0x1b')]&&_[_0x9c9b('0x1c')](_0x1fa771,_0x863d77[_0x9c9b('0x1b')])){_0x3c15d9[_0x9c9b('0xc')]({'app':_0x9c9b('0xa'),'appdata':_0x9c9b('0x1d')});_0x3c15d9['push']({'app':_0x9c9b('0xa'),'appdata':util[_0x9c9b('0x11')](_0x9c9b('0x1e'),_0x863d77[_0x9c9b('0x1b')])});_0x3c15d9[_0x9c9b('0xc')]({'app':'Dial','appdata':util[_0x9c9b('0x11')](_0x9c9b('0x1f'),_0x863d77[_0x9c9b('0x13')])});}else{_0x3c15d9[_0x9c9b('0xc')]({'app':_0x9c9b('0x20'),'appdata':util[_0x9c9b('0x11')](_0x9c9b('0x21'),_0x863d77[_0x9c9b('0x13')])});}_0x3c15d9['push']({'app':_0x9c9b('0x22')});for(var _0x111b8f=0x0;_0x111b8f<_0x3c15d9[_0x9c9b('0x6')];_0x111b8f++){_0x3c15d9[_0x111b8f][_0x9c9b('0x23')]=_0x111b8f+0x1;_0x3c15d9[_0x111b8f]=_[_0x9c9b('0x24')](_0x3c15d9[_0x111b8f],_0x567322);}return _0x3c15d9;};var getChanSpyPromise=function(_0x4cf0b2,_0xa7041e){return new BPromise(function(_0x4af138,_0x21b164){return _0x4cf0b2[_0x9c9b('0x25')][_0x9c9b('0x26')]()[_0x9c9b('0x27')](function(_0xa554bd){if(_0xa554bd){var _0x14146b=getChanSpyApplications(_0xa7041e,_0xa7041e[_0x9c9b('0x28')],_0xa554bd);if(_0xa7041e[_0x9c9b('0x28')]!=_0xa7041e[_0x9c9b('0x13')]){_0x14146b=_0x14146b['concat'](getChanSpyApplications(_0xa7041e,_0xa7041e[_0x9c9b('0x13')],_0xa554bd));}return _0x4af138(_0x14146b);}return _0x4af138([]);})['catch'](function(_0x14b2fd){_0x21b164(_0x14b2fd);});});};module['exports']=function(_0x2d7fad){var _0x12902f=_0x2d7fad['models'];return _0x2d7fad[_0x9c9b('0x29')](_0x9c9b('0x2a'),attributes,{'tableName':_0x9c9b('0x2b'),'charset':'utf8','collate':_0x9c9b('0x2c'),'hooks':{'beforeCreate':function(_0x599277,_0x5c3adb,_0xa60e71){var _0x49bfc5=typeof _0x599277[_0x9c9b('0x2d')]===_0x9c9b('0x2e')?BPromise[_0x9c9b('0x2f')](null):_0x12902f[_0x9c9b('0x30')]['find']({'where':{'id':_0x599277['userProfileId']}});_0x49bfc5[_0x9c9b('0x27')](function(_0x147a23){if(_0x147a23){_0x599277['privacyEnabled']=_0x147a23[_0x9c9b('0x31')];}})[_0x9c9b('0x27')](function(){_0x599277[_0x9c9b('0x32')]();_0x599277[_0x9c9b('0x33')](_0xa60e71);})['catch'](function(_0x47cf55){_0xa60e71(_0x47cf55);});},'beforeUpdate':function(_0x10022,_0x351b1e,_0x5b1502){Promise[_0x9c9b('0x2f')]()[_0x9c9b('0x27')](function(){if(_0x10022[_0x9c9b('0x34')]('userProfileId')===![])return;return _0x12902f[_0x9c9b('0x30')][_0x9c9b('0x35')]({'where':{'id':_0x10022[_0x9c9b('0x2d')]}})[_0x9c9b('0x27')](function(_0x1f14dc){if(_0x1f14dc)_0x10022[_0x9c9b('0x31')]=_0x1f14dc['privacyEnabled'];return;});})['then'](function(){if(_0x10022['changed'](_0x9c9b('0xf'))){_0x10022[_0x9c9b('0x32')]();return _0x10022[_0x9c9b('0x33')](_0x5b1502);}_0x5b1502();})[_0x9c9b('0x36')](function(_0x49d0fe){_0x5b1502(_0x49d0fe);});},'afterCreate':function(_0x5ceff8,_0x60f7e4,_0x305186){var _0x2936d2=getUserApplications(_0x5ceff8,_0x5ceff8[_0x9c9b('0x28')]);if(_0x5ceff8[_0x9c9b('0x28')]!=_0x5ceff8[_0x9c9b('0x13')]){_0x2936d2=_0x2936d2[_0x9c9b('0x37')](getUserApplications(_0x5ceff8,_0x5ceff8[_0x9c9b('0x13')]));}return Promise[_0x9c9b('0x2f')]()[_0x9c9b('0x27')](function(){if(!_0x5ceff8['userSetting']){return _0x5ceff8[_0x9c9b('0x38')]({'clientSideLoggingLevel':_0x9c9b('0x39'),'clientSideLoggingEnabled':![]});}})[_0x9c9b('0x27')](function(){return _0x12902f['VoiceExtension'][_0x9c9b('0x3a')](_0x2936d2);})[_0x9c9b('0x27')](function(){if(_0x5ceff8['chanspy']){return getChanSpyPromise(_0x12902f,_0x5ceff8);}})['then'](function(_0x4793b1){if(_0x4793b1&&_0x4793b1['length']){return _0x12902f['VoiceExtension'][_0x9c9b('0x3a')](_0x4793b1);}})[_0x9c9b('0x27')](function(){_0x305186();})[_0x9c9b('0x36')](function(_0x2c307c){_0x305186(_0x2c307c);});},'afterUpdate':function(_0x1e7ce1,_0x2dc6a4,_0x272b8e){return BPromise[_0x9c9b('0x2f')]()[_0x9c9b('0x27')](function(){if(_0x1e7ce1[_0x9c9b('0x34')](_0x9c9b('0xb'))||_0x1e7ce1[_0x9c9b('0x34')](_0x9c9b('0x3'))){return _0x12902f['VoiceExtension'][_0x9c9b('0x3b')]({'where':{'UserId':_0x1e7ce1['id'],'type':_0x9c9b('0x5'),'ChanSpyId':{'$ne':null}}})[_0x9c9b('0x27')](function(){if(_0x1e7ce1[_0x9c9b('0xb')]){return getChanSpyPromise(_0x12902f,_0x1e7ce1)[_0x9c9b('0x27')](function(_0x4a040d){if(_0x4a040d&&_0x4a040d[_0x9c9b('0x6')]){return _0x12902f[_0x9c9b('0x3c')][_0x9c9b('0x3a')](_0x4a040d);}});}});}})[_0x9c9b('0x27')](function(){if(_0x1e7ce1['changed']('extensionMonitor')||_0x1e7ce1['changed']('context')){return _0x12902f[_0x9c9b('0x3c')][_0x9c9b('0x3b')]({'where':{'UserId':_0x1e7ce1['id'],'type':'system','ChanSpyId':null}})[_0x9c9b('0x27')](function(){var _0xda0edb=getUserApplications(_0x1e7ce1,_0x1e7ce1[_0x9c9b('0x28')]);if(_0x1e7ce1[_0x9c9b('0x28')]!=_0x1e7ce1[_0x9c9b('0x13')]){_0xda0edb=_0xda0edb[_0x9c9b('0x37')](getUserApplications(_0x1e7ce1,_0x1e7ce1[_0x9c9b('0x13')]));}return _0x12902f['VoiceExtension'][_0x9c9b('0x3a')](_0xda0edb);});}})[_0x9c9b('0x27')](function(){_0x272b8e();})['catch'](function(_0x268805){_0x272b8e(_0x268805);});},'afterDestroy':function(_0x26e405){return _0x12902f['VoiceExtension'][_0x9c9b('0x3b')]({'where':{'UserId':_0x26e405['id'],'type':_0x9c9b('0x5')}});}},'instanceMethods':{'authenticate':function(_0x3bad43,_0x355808){if(!_0x355808){return this[_0x9c9b('0xf')]===this[_0x9c9b('0x3d')](_0x3bad43);}var _0x3e3194=this;this[_0x9c9b('0x3d')](_0x3bad43,function(_0x446b24,_0x43fa7a){if(_0x446b24){_0x355808(_0x446b24);}if(_0x3e3194[_0x9c9b('0xf')]===_0x43fa7a){_0x355808(null,!![]);}else{_0x355808(null,![]);}});},'makeSalt':function(_0x186a3a,_0x4942fb){var _0xcc2ab2=0x10;if(typeof arguments[0x0]==='function'){_0x4942fb=arguments[0x0];_0x186a3a=_0xcc2ab2;}else if(typeof arguments[0x1]===_0x9c9b('0x3e')){_0x4942fb=arguments[0x1];}else{throw new Error(_0x9c9b('0x3f'));}if(!_0x186a3a){_0x186a3a=_0xcc2ab2;}return crypto[_0x9c9b('0x40')](_0x186a3a,function(_0x19de40,_0x3c9e76){if(_0x19de40){_0x4942fb(_0x19de40);}return _0x4942fb(null,_0x3c9e76[_0x9c9b('0x41')](_0x9c9b('0x42')));});},'encryptPassword':function(_0x269bc5,_0x64db55){if(!_0x269bc5||!this[_0x9c9b('0x43')]){return _0x64db55?_0x64db55(null):null;}var _0x4a1640=0x2710;var _0x37dbd5=0x40;var _0x48d714=Buffer[_0x9c9b('0x44')](this['salt'],_0x9c9b('0x42'));if(!_0x64db55){return crypto[_0x9c9b('0x45')](_0x269bc5,_0x48d714,_0x4a1640,_0x37dbd5,_0x9c9b('0x46'))['toString'](_0x9c9b('0x42'));}return crypto[_0x9c9b('0x47')](_0x269bc5,_0x48d714,_0x4a1640,_0x37dbd5,_0x9c9b('0x46'),function(_0x5c6ebf,_0xfd9227){if(_0x5c6ebf){_0x64db55(_0x5c6ebf);}return _0x64db55(null,_0xfd9227[_0x9c9b('0x41')](_0x9c9b('0x42')));});},'updatePassword':function(_0x3f6b77){if(!this[_0x9c9b('0xf')]){return _0x3f6b77(null);}if(!validatePresenceOf(this[_0x9c9b('0xf')])&&authTypes[_0x9c9b('0x48')](this['provider'])===-0x1){_0x3f6b77(new Error(_0x9c9b('0x49')));}var _0x2ed84c=this;this['makeSalt'](function(_0x1e8105,_0x4e3369){if(_0x1e8105){return _0x3f6b77(_0x1e8105);}_0x2ed84c[_0x9c9b('0x43')]=_0x4e3369;_0x2ed84c[_0x9c9b('0x3d')](_0x2ed84c[_0x9c9b('0xf')],function(_0x2776b8,_0x902c33){if(_0x2776b8){_0x3f6b77(_0x2776b8);}_0x2ed84c['password']=_0x902c33;_0x3f6b77(null);});});},'updateMd5Password':function(){this['md5secret']=md5(this[_0x9c9b('0x13')]+_0x9c9b('0x4a')+this[_0x9c9b('0xf')]);return this[_0x9c9b('0x4b')];},'getRealtimeData':function(){var _0x255562={'id':this['id']};var _0x593d86=jayson[_0x9c9b('0x4c')][_0x9c9b('0x4d')]({'port':0x232a});var _0x1d14b9=jayson[_0x9c9b('0x4c')]['http']({'port':0x232c});var _0xa8703c={};var _0x4772ad={};return _0x593d86[_0x9c9b('0x4e')](_0x9c9b('0x4f'),_0x255562)[_0x9c9b('0x27')](function(_0x4ae774){if(_0x4ae774['error']){throw new Error(_0x9c9b('0x50'));}_0xa8703c=_0x4ae774[_0x9c9b('0x51')];return _0x1d14b9[_0x9c9b('0x4e')](_0x9c9b('0x4f'),_0x255562);})[_0x9c9b('0x27')](function(_0x3a2043){if(_0x3a2043[_0x9c9b('0x39')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agent\x20(Routing)');}_0x4772ad=_0x3a2043[_0x9c9b('0x51')];var _0x465da6=_[_0x9c9b('0x9')]({},_0xa8703c,_0x4772ad);return _0x465da6;})[_0x9c9b('0x36')](function(_0x438009){throw _0x438009;});},'unpause':function(_0x577da1,_0x297135=_0x9c9b('0x52')){var _0x17e319=this;var _0x16c701={};return Promise[_0x9c9b('0x2f')]()[_0x9c9b('0x27')](function(){if(!_0x577da1||_0x577da1===_0x9c9b('0x53')&&_0x297135==='manual'){var _0x5bc43c=jayson['client'][_0x9c9b('0x4d')]({'port':0x232a});return _0x5bc43c[_0x9c9b('0x4e')](_0x9c9b('0x54'),{'id':_0x17e319['id'],'name':_0x17e319['name'],'pause':![]})[_0x9c9b('0x27')](function(_0x5e846b){if(_0x5e846b[_0x9c9b('0x39')]){throw new Error(util[_0x9c9b('0x11')](_0x9c9b('0x55'),_0x17e319['id'],_0x17e319[_0x9c9b('0x13')]));}return _0x5e846b[_0x9c9b('0x51')][_0x9c9b('0x56')];});}})[_0x9c9b('0x27')](function(){if(!_0x577da1||_0x577da1===_0x9c9b('0x53')){return _0x12902f[_0x9c9b('0x57')][_0x9c9b('0x58')]({'paused':0x0},{'where':{'UserId':_0x17e319['id']},'individualHooks':!![]});}})[_0x9c9b('0x27')](function(){var _0x8c1c72=!_0x577da1?_0x9c9b('0x26'):_0x9c9b('0x59');var _0x4a71e5={'membername':_0x17e319[_0x9c9b('0x13')],'type':_0x9c9b('0x5a'),'exitAt':null};if(_0x577da1){_0x4a71e5['channel']=_0x577da1;}return _0x12902f['MemberReport'][_0x8c1c72]({'where':_0x4a71e5});})['then'](function(_0x4859bf){if(_0x4859bf){var _0x4302e1=Array[_0x9c9b('0x5b')](_0x4859bf)?_0x4859bf:[_0x4859bf];var _0x46c56c=_0x4302e1[_0x9c9b('0x5c')](function(_0x29c74a){return _0x29c74a[_0x9c9b('0x58')]({'exitAt':moment()[_0x9c9b('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x297135});});return Promise['all'](_0x46c56c);}})[_0x9c9b('0x27')](function(){if(!_0x577da1){_0x16c701[_0x9c9b('0x5d')]=![];_0x16c701[_0x9c9b('0x5e')]=![];_0x16c701[_0x9c9b('0x5f')]=![];_0x16c701[_0x9c9b('0x60')]=![];_0x16c701[_0x9c9b('0x61')]=![];_0x16c701[_0x9c9b('0x62')]=![];_0x16c701[_0x9c9b('0x63')]=![];}else{_0x16c701[_0x577da1+_0x9c9b('0x64')]=![];}return _0x17e319['getRealtimeData']();})[_0x9c9b('0x27')](function(_0x403da0){var _0x2a1d8e=require(_0x9c9b('0x65'));var _0x2465e9=_0x2a1d8e[_0x9c9b('0x66')]();_0x2465e9[_0x9c9b('0x67')](function(_0x5c65e2){var _0x53f9c0=_0x5c65e2+_0x9c9b('0x68');_0x17e319[_0x9c9b('0x69')]([_0x53f9c0],_0x403da0[_0x53f9c0]);});return _0x17e319[_0x9c9b('0x58')](_0x16c701);})[_0x9c9b('0x36')](function(_0x14fcd3){throw _0x14fcd3;});}}});};
\ No newline at end of file
index 51922c3..44dfc37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf461=['length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','push','isNil','interface','SIP/%s','body','type','DEFAULT\x20PAUSE','role','uniqueid','bulkCreate','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','voicePause','chatPause','smsPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','params','system','forEach','LoginUser','findOne','mobile','phone','loginInPause','count','agent','../../config/license/util','getLicense','agents','destroy','getVoiceQueues','all','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','./user.socket','register','User','options','limit','include','map','model','attributes','then','info','GetUser','debug','stringify','error','message','ShowUser','where','catch','PauseUser','find','name','internal','UserVoiceQueueRt','update','MemberReport','findAll','PAUSE'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xf461,0x85));var _0x1f46=function(_0x24afed,_0x5a1e8a){_0x24afed=_0x24afed-0x0;var _0xae800f=_0xf461[_0x24afed];return _0xae800f;};'use strict';var _=require(_0x1f46('0x0'));var util=require(_0x1f46('0x1'));var moment=require(_0x1f46('0x2'));var BPromise=require(_0x1f46('0x3'));var Redis=require(_0x1f46('0x4'));var db=require(_0x1f46('0x5'))['db'];var utils=require(_0x1f46('0x6'));var logger=require(_0x1f46('0x7'))('rpc');var config=require(_0x1f46('0x8'));config['redis']=_[_0x1f46('0x9')](config[_0x1f46('0xa')],{'host':_0x1f46('0xb'),'port':0x18eb});var socket=require(_0x1f46('0xc'))(new Redis(config['redis']));require(_0x1f46('0xd'))[_0x1f46('0xe')](socket);exports['GetUser']=function(_0x5e1206){var _0x4f80ea=this;return new Promise(function(_0x5e73ba,_0x4073db){return db[_0x1f46('0xf')]['findAll']({'raw':_0x5e1206[_0x1f46('0x10')]?_0x5e1206[_0x1f46('0x10')]['raw']===undefined?!![]:![]:!![],'where':_0x5e1206[_0x1f46('0x10')]?_0x5e1206[_0x1f46('0x10')]['where']||null:null,'attributes':_0x5e1206[_0x1f46('0x10')]?_0x5e1206[_0x1f46('0x10')]['attributes']||null:null,'limit':_0x5e1206['options']?_0x5e1206[_0x1f46('0x10')][_0x1f46('0x11')]||null:null,'include':_0x5e1206[_0x1f46('0x10')]?_0x5e1206['options'][_0x1f46('0x12')]?_[_0x1f46('0x13')](_0x5e1206['options']['include'],function(_0x3aa856){return{'model':db[_0x3aa856[_0x1f46('0x14')]],'as':_0x3aa856['as'],'attributes':_0x3aa856[_0x1f46('0x15')],'include':_0x3aa856[_0x1f46('0x12')]?_[_0x1f46('0x13')](_0x3aa856[_0x1f46('0x12')],function(_0x10f8d8){return{'model':db[_0x10f8d8['model']],'as':_0x10f8d8['as'],'attributes':_0x10f8d8['attributes'],'include':_0x10f8d8['include']?_[_0x1f46('0x13')](_0x10f8d8['include'],function(_0x137982){return{'model':db[_0x137982[_0x1f46('0x14')]],'as':_0x137982['as'],'attributes':_0x137982[_0x1f46('0x15')]};}):[]};}):[]};}):[]:[]})[_0x1f46('0x16')](function(_0x357073){logger[_0x1f46('0x17')](_0x1f46('0x18'),_0x5e1206);logger[_0x1f46('0x19')]('GetUser',_0x5e1206,JSON[_0x1f46('0x1a')](_0x357073));_0x5e73ba(_0x357073);})['catch'](function(_0x58e04b){logger[_0x1f46('0x1b')]('GetUser',_0x58e04b[_0x1f46('0x1c')],_0x5e1206);_0x4073db(_0x4f80ea[_0x1f46('0x1b')](0x1f4,_0x58e04b['message']));});});};exports[_0x1f46('0x1d')]=function(_0x2982ee){var _0x3fb14b=this;return new Promise(function(_0x470765,_0x4b1f67){return db[_0x1f46('0xf')]['find']({'raw':_0x2982ee[_0x1f46('0x10')]?_0x2982ee[_0x1f46('0x10')]['raw']===undefined?!![]:![]:!![],'where':_0x2982ee[_0x1f46('0x10')]?_0x2982ee[_0x1f46('0x10')][_0x1f46('0x1e')]||null:null,'attributes':_0x2982ee['options']?_0x2982ee[_0x1f46('0x10')]['attributes']||null:null,'include':_0x2982ee[_0x1f46('0x10')]?_0x2982ee[_0x1f46('0x10')][_0x1f46('0x12')]?_['map'](_0x2982ee[_0x1f46('0x10')]['include'],function(_0x56feb6){return{'model':db[_0x56feb6[_0x1f46('0x14')]],'as':_0x56feb6['as'],'attributes':_0x56feb6['attributes'],'include':_0x56feb6[_0x1f46('0x12')]?_[_0x1f46('0x13')](_0x56feb6[_0x1f46('0x12')],function(_0x25cdb3){return{'model':db[_0x25cdb3['model']],'as':_0x25cdb3['as'],'attributes':_0x25cdb3[_0x1f46('0x15')],'include':_0x25cdb3[_0x1f46('0x12')]?_[_0x1f46('0x13')](_0x25cdb3['include'],function(_0x4b8433){return{'model':db[_0x4b8433[_0x1f46('0x14')]],'as':_0x4b8433['as'],'attributes':_0x4b8433['attributes']};}):[]};}):[]};}):[]:[]})[_0x1f46('0x16')](function(_0x332066){logger[_0x1f46('0x17')](_0x1f46('0x1d'),_0x2982ee);logger[_0x1f46('0x19')](_0x1f46('0x1d'),_0x2982ee,JSON[_0x1f46('0x1a')](_0x332066));_0x470765(_0x332066);})[_0x1f46('0x1f')](function(_0x505caf){logger['error'](_0x1f46('0x1d'),_0x505caf[_0x1f46('0x1c')],_0x2982ee);_0x4b1f67(_0x3fb14b[_0x1f46('0x1b')](0x1f4,_0x505caf[_0x1f46('0x1c')]));});});};exports[_0x1f46('0x20')]=function(_0x3e69f6){var _0x122746=this;return new Promise(function(_0x125009,_0x229dc5){var _0xb7cf12;return db[_0x1f46('0xf')][_0x1f46('0x21')]({'where':_0x3e69f6[_0x1f46('0x10')][_0x1f46('0x1e')]||{},'attributes':['id',_0x1f46('0x22'),'role',_0x1f46('0x23'),'interface']})[_0x1f46('0x16')](function(_0x250484){if(_0x250484){_0xb7cf12=_0x250484;return db[_0x1f46('0x24')][_0x1f46('0x25')]({'paused':0x1},{'where':{'UserId':_0xb7cf12['id']},'individualHooks':!![]});}})['then'](function(){if(_0xb7cf12){return db[_0x1f46('0x26')][_0x1f46('0x27')]({'where':{'membername':_0xb7cf12['name'],'type':_0x1f46('0x28'),'exitAt':null}});}})[_0x1f46('0x16')](function(_0x3ae776){if(_0xb7cf12){if(_0x3ae776&&_0x3ae776[_0x1f46('0x29')]){var _0x2cf7aa=moment()[_0x1f46('0x2a')](_0x1f46('0x2b'));for(var _0x7d6bfc=0x0,_0xf8c6c7=_0x3ae776[_0x1f46('0x29')];_0x7d6bfc<_0xf8c6c7;_0x7d6bfc++){_0x3ae776[_0x7d6bfc][_0x1f46('0x2c')]({'exitAt':_0x2cf7aa});}}}})[_0x1f46('0x16')](function(){if(_0xb7cf12){var _0x2c6d7d=[];var _0x10fe98=utils[_0x1f46('0x2d')]();_0x10fe98['forEach'](function(_0x2bdabc){_0x2c6d7d[_0x1f46('0x2e')]({'channel':_0x2bdabc,'membername':_0xb7cf12[_0x1f46('0x22')],'interface':_[_0x1f46('0x2f')](_0xb7cf12[_0x1f46('0x30')])?util[_0x1f46('0x2a')](_0x1f46('0x31'),_0xb7cf12[_0x1f46('0x22')]):_0xb7cf12[_0x1f46('0x30')],'type':_0x1f46('0x28'),'enterAt':moment()[_0x1f46('0x2a')](_0x1f46('0x2b')),'data1':_0x3e69f6[_0x1f46('0x32')][_0x1f46('0x33')]||_0x1f46('0x34'),'role':_0xb7cf12[_0x1f46('0x35')],'internal':_0xb7cf12[_0x1f46('0x23')],'uniqueid':_0x3e69f6['body'][_0x1f46('0x36')]||null});});return db['MemberReport'][_0x1f46('0x37')](_0x2c6d7d,{'individualHooks':!![]});}})[_0x1f46('0x16')](function(){if(_0xb7cf12){return _0xb7cf12['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x3e69f6[_0x1f46('0x32')]['type']||_0x1f46('0x34'),'lastPauseAt':moment()[_0x1f46('0x2a')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x1f46('0x16')](function(_0x36119a){_0x125009(_0x36119a);})[_0x1f46('0x1f')](function(_0x1eca91){_0x229dc5(_0x122746[_0x1f46('0x1b')](0x1f4,_0x1eca91[_0x1f46('0x1c')]));});});};exports['UnpauseUser']=function(_0x29edc5){var _0x511932=this;return new Promise(function(_0x366377,_0x142ec9){if(_0x29edc5[_0x1f46('0x32')][_0x1f46('0x38')]&&!utils[_0x1f46('0x39')](_0x29edc5[_0x1f46('0x32')]['channel'])){throw new Error(util['format'](_0x1f46('0x3a'),_0x29edc5[_0x1f46('0x32')]['channel']));}return db['User']['findOne']({'where':_0x29edc5['options'][_0x1f46('0x1e')]||{},'attributes':['id',_0x1f46('0x22'),_0x1f46('0x35'),'internal',_0x1f46('0x30'),'online',_0x1f46('0x3b'),'mailPause',_0x1f46('0x3c'),'faxPause','openchannelPause',_0x1f46('0x3d'),_0x1f46('0x3e'),_0x1f46('0x3f'),_0x1f46('0x40')]})['then'](function(_0x11766a){if(!_0x11766a){throw new Error(util[_0x1f46('0x2a')](_0x1f46('0x41'),_0x29edc5[_0x1f46('0x42')]['id']));}return _0x11766a['unpause'](_0x29edc5[_0x1f46('0x32')]['channel'],_0x1f46('0x43'));})[_0x1f46('0x16')](function(_0x583467){_0x366377(_0x583467);})['catch'](function(_0x276a29){_0x142ec9(_0x511932['error'](0x1f4,_0x276a29[_0x1f46('0x1c')]));});});};exports['LogoutUser']=function(_0x2a45bb){var _0x306b44=this;return new Promise(function(_0x3cb2cb,_0x1bbc22){var _0x5e23fe;return db['User']['findOne']({'where':_0x2a45bb['options']['where']||{},'attributes':['id',_0x1f46('0x22')]})['then'](function(_0x3e1ac2){if(_0x3e1ac2){_0x5e23fe=_0x3e1ac2;return db[_0x1f46('0x24')]['destroy']({'where':{'membername':_0x5e23fe[_0x1f46('0x22')]},'individualHooks':!![]});}})[_0x1f46('0x16')](function(){if(_0x5e23fe){return db[_0x1f46('0x26')][_0x1f46('0x27')]({'where':{'membername':_0x5e23fe['name'],'exitAt':null}});}})[_0x1f46('0x16')](function(_0xbcf3e){if(_0x5e23fe){if(_0xbcf3e&&_0xbcf3e[_0x1f46('0x29')]){var _0x1c8601=[];_0xbcf3e[_0x1f46('0x44')](function(_0x2901cc){_0x1c8601[_0x1f46('0x2e')](_0x2901cc[_0x1f46('0x25')]({'exitAt':moment()[_0x1f46('0x2a')](_0x1f46('0x2b'))}));});return BPromise['all'](_0x1c8601);}}})[_0x1f46('0x16')](function(){if(_0x5e23fe){return _0x5e23fe[_0x1f46('0x25')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x1f46('0x16')](function(_0x30de90){_0x3cb2cb(_0x30de90);})[_0x1f46('0x1f')](function(_0x1fbd10){_0x1bbc22(_0x306b44[_0x1f46('0x1b')](0x1f4,_0x1fbd10[_0x1f46('0x1c')]));});});};exports[_0x1f46('0x45')]=function(_0x1961ae){var _0x392b13=this;return new Promise(function(_0x3b3fca,_0x3f0b84){var _0x4143c2;var _0x267466;var _0x330180;var _0x2f7139;return db[_0x1f46('0xf')][_0x1f46('0x46')]({'where':_0x1961ae['options'][_0x1f46('0x1e')]||{},'attributes':['id','name','role',_0x1f46('0x47'),_0x1f46('0x48'),_0x1f46('0x23'),_0x1f46('0x49'),_0x1f46('0x30')]})[_0x1f46('0x16')](function(_0x498f6e){if(_0x498f6e){_0x4143c2=_0x498f6e;_0x2f7139=_0x1961ae['body'][_0x1f46('0x30')]?_0x1961ae[_0x1f46('0x32')][_0x1f46('0x30')]:util['format']('SIP/%s',_0x4143c2[_0x1f46('0x22')]);return db[_0x1f46('0xf')][_0x1f46('0x4a')]({'where':{'role':_0x1f46('0x4b'),'online':!![],'id':{'$ne':_0x4143c2['id']}}});}})[_0x1f46('0x16')](function(_0x339a85){if(_0x339a85){_0x330180=_0x339a85;return require(_0x1f46('0x4c'))[_0x1f46('0x4d')]();}})[_0x1f46('0x16')](function(_0x23a4ef){if(_0x23a4ef&&_0x23a4ef[_0x1f46('0x4e')]&&_0x330180>=_0x23a4ef[_0x1f46('0x4e')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x1f46('0x16')](function(){if(_0x4143c2){return db[_0x1f46('0x24')][_0x1f46('0x4f')]({'where':{'membername':_0x4143c2[_0x1f46('0x22')]},'individualHooks':!![]});}})['then'](function(){if(_0x4143c2){return _0x4143c2[_0x1f46('0x50')]({'raw':!![]});}})['then'](function(_0x35e3c4){if(_0x4143c2){if(_0x35e3c4){var _0x4123d3=[];_0x267466=_0x35e3c4;if(_0x267466[_0x1f46('0x29')]){for(var _0x2a35cb=0x0;_0x2a35cb<_0x267466[_0x1f46('0x29')];_0x2a35cb++){_0x4123d3[_0x1f46('0x2e')](db[_0x1f46('0x24')]['upsert']({'membername':_0x4143c2[_0x1f46('0x22')],'UserId':_0x4143c2['id'],'queue_name':_0x267466[_0x2a35cb][_0x1f46('0x22')],'VoiceQueueId':_0x267466[_0x2a35cb]['id'],'interface':_0x2f7139,'paused':_0x4143c2[_0x1f46('0x49')]||![],'penalty':_0x267466[_0x2a35cb]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x1f46('0x51')](_0x4123d3);}}}})[_0x1f46('0x16')](function(){if(_0x4143c2){return db[_0x1f46('0x26')][_0x1f46('0x27')]({'where':{'membername':_0x4143c2[_0x1f46('0x22')],'exitAt':null}});}})['then'](function(_0x2d7fca){if(_0x4143c2){if(_0x2d7fca&&_0x2d7fca[_0x1f46('0x29')]){var _0x34bb47=[];_0x2d7fca[_0x1f46('0x44')](function(_0x210baa){_0x34bb47[_0x1f46('0x2e')](_0x210baa[_0x1f46('0x25')]({'exitAt':moment()[_0x1f46('0x2a')](_0x1f46('0x2b'))}));});return BPromise[_0x1f46('0x51')](_0x34bb47);}}})[_0x1f46('0x16')](function(){if(_0x4143c2){var _0x5a4f9f=[];var _0x321a6c=[];var _0x5c4000=utils[_0x1f46('0x2d')]();var _0x4ba095={'membername':_0x4143c2[_0x1f46('0x22')],'interface':_0x2f7139,'enterAt':moment()[_0x1f46('0x2a')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x4143c2[_0x1f46('0x35')],'internal':_0x4143c2['internal']};_0x5c4000[_0x1f46('0x44')](function(_0x357ecb){_0x5a4f9f[_0x1f46('0x2e')](_[_0x1f46('0x52')]({'channel':_0x357ecb,'type':_0x1f46('0x53'),'data1':_0x1f46('0x54'),'data2':_0x2f7139},_0x4ba095));if(_0x4143c2[_0x1f46('0x49')]){_0x321a6c[_0x1f46('0x2e')](_[_0x1f46('0x52')]({'channel':_0x357ecb,'type':_0x1f46('0x28'),'data1':_0x1f46('0x55')},_0x4ba095));}});return db['MemberReport'][_0x1f46('0x37')](_0x5a4f9f[_0x1f46('0x56')](_0x321a6c),{'individualHooks':!![]});}})[_0x1f46('0x16')](function(){if(_0x4143c2){return _0x4143c2[_0x1f46('0x25')]({'online':!![],'lastLoginAt':moment()[_0x1f46('0x2a')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x4143c2['loginInPause']||![],'mailPause':_0x4143c2[_0x1f46('0x49')]||![],'chatPause':_0x4143c2[_0x1f46('0x49')]||![],'faxPause':_0x4143c2[_0x1f46('0x49')]||![],'smsPause':_0x4143c2[_0x1f46('0x49')]||![],'openchannelPause':_0x4143c2[_0x1f46('0x49')]||![],'pauseType':_0x4143c2[_0x1f46('0x49')]?_0x1f46('0x55'):null,'lastPauseAt':moment()['format'](_0x1f46('0x2b')),'interface':_0x2f7139});}})['then'](function(_0x51f8f1){_0x3b3fca(_0x51f8f1);})[_0x1f46('0x1f')](function(_0x2e553f){_0x3f0b84(_0x392b13[_0x1f46('0x1b')](0x1f4,_0x2e553f[_0x1f46('0x1c')]));});});};
\ No newline at end of file
+var _0x0c6c=['rpc','../../config/environment','defaults','localhost','socket.io-emitter','redis','./user.socket','GetUser','User','options','raw','where','attributes','limit','model','map','include','then','info','stringify','error','debug','catch','ShowUser','message','PauseUser','find','name','role','interface','UserVoiceQueueRt','update','MemberReport','findAll','format','updateAttributes','getChannels','forEach','push','isNil','PAUSE','body','DEFAULT\x20PAUSE','internal','type','YYYY-MM-DD\x20HH:mm:ss','UnpauseUser','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','online','voicePause','mailPause','chatPause','faxPause','openchannelPause','smsPause','User\x20with\x20id\x20%s\x20not\x20found','params','unpause','channel','system','LogoutUser','destroy','length','all','LoginUser','phone','loginInPause','SIP/%s','count','agent','getLicense','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','UserVoiceQueue.penalty','merge','LOGIN','bulkCreate','concat','LOGININPAUSE','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x53777a,_0x450bfa){var _0x414318=function(_0x43f96b){while(--_0x43f96b){_0x53777a['push'](_0x53777a['shift']());}};_0x414318(++_0x450bfa);}(_0x0c6c,0x159));var _0xc0c6=function(_0x42fd32,_0x12d3ae){_0x42fd32=_0x42fd32-0x0;var _0x328b6f=_0x0c6c[_0x42fd32];return _0x328b6f;};'use strict';var _=require(_0xc0c6('0x0'));var util=require('util');var moment=require(_0xc0c6('0x1'));var BPromise=require(_0xc0c6('0x2'));var Redis=require(_0xc0c6('0x3'));var db=require(_0xc0c6('0x4'))['db'];var utils=require(_0xc0c6('0x5'));var logger=require(_0xc0c6('0x6'))(_0xc0c6('0x7'));var config=require(_0xc0c6('0x8'));config['redis']=_[_0xc0c6('0x9')](config['redis'],{'host':_0xc0c6('0xa'),'port':0x18eb});var socket=require(_0xc0c6('0xb'))(new Redis(config[_0xc0c6('0xc')]));require(_0xc0c6('0xd'))['register'](socket);exports[_0xc0c6('0xe')]=function(_0x483d25){var _0x45858a=this;return new Promise(function(_0x26e209,_0x488c6a){return db[_0xc0c6('0xf')]['findAll']({'raw':_0x483d25['options']?_0x483d25[_0xc0c6('0x10')][_0xc0c6('0x11')]===undefined?!![]:![]:!![],'where':_0x483d25[_0xc0c6('0x10')]?_0x483d25[_0xc0c6('0x10')][_0xc0c6('0x12')]||null:null,'attributes':_0x483d25[_0xc0c6('0x10')]?_0x483d25[_0xc0c6('0x10')][_0xc0c6('0x13')]||null:null,'limit':_0x483d25[_0xc0c6('0x10')]?_0x483d25[_0xc0c6('0x10')][_0xc0c6('0x14')]||null:null,'include':_0x483d25[_0xc0c6('0x10')]?_0x483d25[_0xc0c6('0x10')]['include']?_['map'](_0x483d25[_0xc0c6('0x10')]['include'],function(_0x31917d){return{'model':db[_0x31917d[_0xc0c6('0x15')]],'as':_0x31917d['as'],'attributes':_0x31917d['attributes'],'include':_0x31917d['include']?_[_0xc0c6('0x16')](_0x31917d[_0xc0c6('0x17')],function(_0x5b4201){return{'model':db[_0x5b4201['model']],'as':_0x5b4201['as'],'attributes':_0x5b4201[_0xc0c6('0x13')],'include':_0x5b4201[_0xc0c6('0x17')]?_['map'](_0x5b4201['include'],function(_0x240f5e){return{'model':db[_0x240f5e[_0xc0c6('0x15')]],'as':_0x240f5e['as'],'attributes':_0x240f5e[_0xc0c6('0x13')]};}):[]};}):[]};}):[]:[]})[_0xc0c6('0x18')](function(_0x418732){logger[_0xc0c6('0x19')](_0xc0c6('0xe'),_0x483d25);logger['debug'](_0xc0c6('0xe'),_0x483d25,JSON[_0xc0c6('0x1a')](_0x418732));_0x26e209(_0x418732);})['catch'](function(_0x3bdf82){logger[_0xc0c6('0x1b')](_0xc0c6('0xe'),_0x3bdf82['message'],_0x483d25);_0x488c6a(_0x45858a[_0xc0c6('0x1b')](0x1f4,_0x3bdf82['message']));});});};exports['ShowUser']=function(_0xd7fd30){var _0x15c786=this;return new Promise(function(_0x15dac2,_0xbc0b37){return db['User']['find']({'raw':_0xd7fd30[_0xc0c6('0x10')]?_0xd7fd30['options']['raw']===undefined?!![]:![]:!![],'where':_0xd7fd30[_0xc0c6('0x10')]?_0xd7fd30[_0xc0c6('0x10')]['where']||null:null,'attributes':_0xd7fd30[_0xc0c6('0x10')]?_0xd7fd30[_0xc0c6('0x10')][_0xc0c6('0x13')]||null:null,'include':_0xd7fd30[_0xc0c6('0x10')]?_0xd7fd30[_0xc0c6('0x10')][_0xc0c6('0x17')]?_[_0xc0c6('0x16')](_0xd7fd30[_0xc0c6('0x10')]['include'],function(_0x3959ec){return{'model':db[_0x3959ec[_0xc0c6('0x15')]],'as':_0x3959ec['as'],'attributes':_0x3959ec[_0xc0c6('0x13')],'include':_0x3959ec[_0xc0c6('0x17')]?_[_0xc0c6('0x16')](_0x3959ec['include'],function(_0x193f6f){return{'model':db[_0x193f6f[_0xc0c6('0x15')]],'as':_0x193f6f['as'],'attributes':_0x193f6f[_0xc0c6('0x13')],'include':_0x193f6f[_0xc0c6('0x17')]?_[_0xc0c6('0x16')](_0x193f6f[_0xc0c6('0x17')],function(_0x163c25){return{'model':db[_0x163c25[_0xc0c6('0x15')]],'as':_0x163c25['as'],'attributes':_0x163c25['attributes']};}):[]};}):[]};}):[]:[]})[_0xc0c6('0x18')](function(_0x660512){logger[_0xc0c6('0x19')]('ShowUser',_0xd7fd30);logger[_0xc0c6('0x1c')]('ShowUser',_0xd7fd30,JSON[_0xc0c6('0x1a')](_0x660512));_0x15dac2(_0x660512);})[_0xc0c6('0x1d')](function(_0x4daa57){logger[_0xc0c6('0x1b')](_0xc0c6('0x1e'),_0x4daa57[_0xc0c6('0x1f')],_0xd7fd30);_0xbc0b37(_0x15c786['error'](0x1f4,_0x4daa57[_0xc0c6('0x1f')]));});});};exports[_0xc0c6('0x20')]=function(_0x4ee7fe){var _0x264145=this;return new Promise(function(_0x2485a0,_0x326249){var _0xa08312;return db[_0xc0c6('0xf')][_0xc0c6('0x21')]({'where':_0x4ee7fe['options'][_0xc0c6('0x12')]||{},'attributes':['id',_0xc0c6('0x22'),_0xc0c6('0x23'),'internal',_0xc0c6('0x24')]})[_0xc0c6('0x18')](function(_0x4f0f70){if(_0x4f0f70){_0xa08312=_0x4f0f70;return db[_0xc0c6('0x25')][_0xc0c6('0x26')]({'paused':0x1},{'where':{'UserId':_0xa08312['id']},'individualHooks':!![]});}})[_0xc0c6('0x18')](function(){if(_0xa08312){return db[_0xc0c6('0x27')][_0xc0c6('0x28')]({'where':{'membername':_0xa08312['name'],'type':'PAUSE','exitAt':null}});}})['then'](function(_0x3c13af){if(_0xa08312){if(_0x3c13af&&_0x3c13af['length']){var _0x2d402c=moment()[_0xc0c6('0x29')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2f9f64=0x0,_0x42cdf6=_0x3c13af['length'];_0x2f9f64<_0x42cdf6;_0x2f9f64++){_0x3c13af[_0x2f9f64][_0xc0c6('0x2a')]({'exitAt':_0x2d402c});}}}})[_0xc0c6('0x18')](function(){if(_0xa08312){var _0x3b8831=[];var _0x40f235=utils[_0xc0c6('0x2b')]();_0x40f235[_0xc0c6('0x2c')](function(_0x10d9c2){_0x3b8831[_0xc0c6('0x2d')]({'channel':_0x10d9c2,'membername':_0xa08312[_0xc0c6('0x22')],'interface':_[_0xc0c6('0x2e')](_0xa08312[_0xc0c6('0x24')])?util[_0xc0c6('0x29')]('SIP/%s',_0xa08312[_0xc0c6('0x22')]):_0xa08312[_0xc0c6('0x24')],'type':_0xc0c6('0x2f'),'enterAt':moment()[_0xc0c6('0x29')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x4ee7fe[_0xc0c6('0x30')]['type']||_0xc0c6('0x31'),'role':_0xa08312[_0xc0c6('0x23')],'internal':_0xa08312[_0xc0c6('0x32')],'uniqueid':_0x4ee7fe['body']['uniqueid']||null});});return db['MemberReport']['bulkCreate'](_0x3b8831,{'individualHooks':!![]});}})[_0xc0c6('0x18')](function(){if(_0xa08312){return _0xa08312[_0xc0c6('0x26')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x4ee7fe[_0xc0c6('0x30')][_0xc0c6('0x33')]||_0xc0c6('0x31'),'lastPauseAt':moment()['format'](_0xc0c6('0x34'))});}})['then'](function(_0x24d5bd){_0x2485a0(_0x24d5bd);})[_0xc0c6('0x1d')](function(_0x176d39){_0x326249(_0x264145['error'](0x1f4,_0x176d39[_0xc0c6('0x1f')]));});});};exports[_0xc0c6('0x35')]=function(_0x215009){var _0x5f4027=this;return new Promise(function(_0x883ce3,_0x249ccb){if(_0x215009['body']['channel']&&!utils[_0xc0c6('0x36')](_0x215009['body']['channel'])){throw new Error(util[_0xc0c6('0x29')](_0xc0c6('0x37'),_0x215009[_0xc0c6('0x30')]['channel']));}return db[_0xc0c6('0xf')][_0xc0c6('0x38')]({'where':_0x215009[_0xc0c6('0x10')]['where']||{},'attributes':['id','name',_0xc0c6('0x23'),_0xc0c6('0x32'),_0xc0c6('0x24'),_0xc0c6('0x39'),_0xc0c6('0x3a'),_0xc0c6('0x3b'),_0xc0c6('0x3c'),_0xc0c6('0x3d'),_0xc0c6('0x3e'),_0xc0c6('0x3f'),'whatsappPause','pauseType','lastPauseAt']})[_0xc0c6('0x18')](function(_0x47fcd0){if(!_0x47fcd0){throw new Error(util[_0xc0c6('0x29')](_0xc0c6('0x40'),_0x215009[_0xc0c6('0x41')]['id']));}return _0x47fcd0[_0xc0c6('0x42')](_0x215009[_0xc0c6('0x30')][_0xc0c6('0x43')],_0xc0c6('0x44'));})['then'](function(_0x107e8a){_0x883ce3(_0x107e8a);})[_0xc0c6('0x1d')](function(_0x409968){_0x249ccb(_0x5f4027[_0xc0c6('0x1b')](0x1f4,_0x409968[_0xc0c6('0x1f')]));});});};exports[_0xc0c6('0x45')]=function(_0x48a524){var _0x339925=this;return new Promise(function(_0x51576b,_0x3c1696){var _0x2269e1;return db[_0xc0c6('0xf')][_0xc0c6('0x38')]({'where':_0x48a524['options'][_0xc0c6('0x12')]||{},'attributes':['id','name']})[_0xc0c6('0x18')](function(_0x11f40c){if(_0x11f40c){_0x2269e1=_0x11f40c;return db['UserVoiceQueueRt'][_0xc0c6('0x46')]({'where':{'membername':_0x2269e1[_0xc0c6('0x22')]},'individualHooks':!![]});}})['then'](function(){if(_0x2269e1){return db[_0xc0c6('0x27')]['findAll']({'where':{'membername':_0x2269e1[_0xc0c6('0x22')],'exitAt':null}});}})['then'](function(_0x3465aa){if(_0x2269e1){if(_0x3465aa&&_0x3465aa[_0xc0c6('0x47')]){var _0x578e73=[];_0x3465aa[_0xc0c6('0x2c')](function(_0x1614bc){_0x578e73[_0xc0c6('0x2d')](_0x1614bc[_0xc0c6('0x26')]({'exitAt':moment()[_0xc0c6('0x29')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xc0c6('0x48')](_0x578e73);}}})[_0xc0c6('0x18')](function(){if(_0x2269e1){return _0x2269e1[_0xc0c6('0x26')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xc0c6('0x18')](function(_0x377783){_0x51576b(_0x377783);})[_0xc0c6('0x1d')](function(_0x33798b){_0x3c1696(_0x339925['error'](0x1f4,_0x33798b[_0xc0c6('0x1f')]));});});};exports[_0xc0c6('0x49')]=function(_0x53f036){var _0x185598=this;return new Promise(function(_0x582c18,_0x876f98){var _0x5cffef;var _0x121ef9;var _0x8b489d;var _0x3dd673;return db['User'][_0xc0c6('0x38')]({'where':_0x53f036[_0xc0c6('0x10')][_0xc0c6('0x12')]||{},'attributes':['id',_0xc0c6('0x22'),_0xc0c6('0x23'),'mobile',_0xc0c6('0x4a'),_0xc0c6('0x32'),_0xc0c6('0x4b'),_0xc0c6('0x24')]})[_0xc0c6('0x18')](function(_0x2ce278){if(_0x2ce278){_0x5cffef=_0x2ce278;_0x3dd673=_0x53f036[_0xc0c6('0x30')][_0xc0c6('0x24')]?_0x53f036[_0xc0c6('0x30')][_0xc0c6('0x24')]:util[_0xc0c6('0x29')](_0xc0c6('0x4c'),_0x5cffef[_0xc0c6('0x22')]);return db[_0xc0c6('0xf')][_0xc0c6('0x4d')]({'where':{'role':_0xc0c6('0x4e'),'online':!![],'id':{'$ne':_0x5cffef['id']}}});}})['then'](function(_0x3539d5){if(_0x3539d5){_0x8b489d=_0x3539d5;return require('../../config/license/util')[_0xc0c6('0x4f')]();}})[_0xc0c6('0x18')](function(_0x1f72a6){if(_0x1f72a6&&_0x1f72a6['agents']&&_0x8b489d>=_0x1f72a6['agents']){throw new Error(_0xc0c6('0x50'));}})['then'](function(){if(_0x5cffef){return db[_0xc0c6('0x25')][_0xc0c6('0x46')]({'where':{'membername':_0x5cffef[_0xc0c6('0x22')]},'individualHooks':!![]});}})[_0xc0c6('0x18')](function(){if(_0x5cffef){return _0x5cffef[_0xc0c6('0x51')]({'raw':!![]});}})['then'](function(_0x4cd38e){if(_0x5cffef){if(_0x4cd38e){var _0x2e9bb6=[];_0x121ef9=_0x4cd38e;if(_0x121ef9[_0xc0c6('0x47')]){for(var _0x8e5abd=0x0;_0x8e5abd<_0x121ef9[_0xc0c6('0x47')];_0x8e5abd++){_0x2e9bb6[_0xc0c6('0x2d')](db[_0xc0c6('0x25')]['upsert']({'membername':_0x5cffef['name'],'UserId':_0x5cffef['id'],'queue_name':_0x121ef9[_0x8e5abd][_0xc0c6('0x22')],'VoiceQueueId':_0x121ef9[_0x8e5abd]['id'],'interface':_0x3dd673,'paused':_0x5cffef['loginInPause']||![],'penalty':_0x121ef9[_0x8e5abd][_0xc0c6('0x52')]||0x0}));}return BPromise[_0xc0c6('0x48')](_0x2e9bb6);}}}})[_0xc0c6('0x18')](function(){if(_0x5cffef){return db[_0xc0c6('0x27')][_0xc0c6('0x28')]({'where':{'membername':_0x5cffef[_0xc0c6('0x22')],'exitAt':null}});}})['then'](function(_0x1acac5){if(_0x5cffef){if(_0x1acac5&&_0x1acac5[_0xc0c6('0x47')]){var _0x4acf82=[];_0x1acac5[_0xc0c6('0x2c')](function(_0x3047af){_0x4acf82['push'](_0x3047af[_0xc0c6('0x26')]({'exitAt':moment()['format'](_0xc0c6('0x34'))}));});return BPromise[_0xc0c6('0x48')](_0x4acf82);}}})['then'](function(){if(_0x5cffef){var _0x19a03b=[];var _0x3dcdf8=[];var _0x2488bd=utils[_0xc0c6('0x2b')]();var _0x45e37a={'membername':_0x5cffef[_0xc0c6('0x22')],'interface':_0x3dd673,'enterAt':moment()[_0xc0c6('0x29')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x5cffef[_0xc0c6('0x23')],'internal':_0x5cffef[_0xc0c6('0x32')]};_0x2488bd['forEach'](function(_0x25b89d){_0x19a03b[_0xc0c6('0x2d')](_[_0xc0c6('0x53')]({'channel':_0x25b89d,'type':_0xc0c6('0x54'),'data1':'callysquare','data2':_0x3dd673},_0x45e37a));if(_0x5cffef[_0xc0c6('0x4b')]){_0x3dcdf8['push'](_[_0xc0c6('0x53')]({'channel':_0x25b89d,'type':'PAUSE','data1':'LOGININPAUSE'},_0x45e37a));}});return db[_0xc0c6('0x27')][_0xc0c6('0x55')](_0x19a03b[_0xc0c6('0x56')](_0x3dcdf8),{'individualHooks':!![]});}})[_0xc0c6('0x18')](function(){if(_0x5cffef){return _0x5cffef[_0xc0c6('0x26')]({'online':!![],'lastLoginAt':moment()[_0xc0c6('0x29')](_0xc0c6('0x34')),'voicePause':_0x5cffef[_0xc0c6('0x4b')]||![],'mailPause':_0x5cffef['loginInPause']||![],'chatPause':_0x5cffef['loginInPause']||![],'faxPause':_0x5cffef[_0xc0c6('0x4b')]||![],'smsPause':_0x5cffef[_0xc0c6('0x4b')]||![],'openchannelPause':_0x5cffef['loginInPause']||![],'pauseType':_0x5cffef['loginInPause']?_0xc0c6('0x57'):null,'lastPauseAt':moment()[_0xc0c6('0x29')](_0xc0c6('0x34')),'interface':_0x3dd673});}})[_0xc0c6('0x18')](function(_0x1a5098){_0x582c18(_0x1a5098);})[_0xc0c6('0x1d')](function(_0x41cdb2){_0x876f98(_0x185598[_0xc0c6('0x1b')](0x1f4,_0x41cdb2[_0xc0c6('0x1f')]));});});};
\ No newline at end of file
index 1770746..df26056 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c81=['./user.events','save','remove','update','removeListener','register','length','user:'];(function(_0x2bdfb2,_0x53e154){var _0x5939ae=function(_0x43b014){while(--_0x43b014){_0x2bdfb2['push'](_0x2bdfb2['shift']());}};_0x5939ae(++_0x53e154);}(_0x0c81,0x1b0));var _0x10c8=function(_0x1fcc1e,_0x39efee){_0x1fcc1e=_0x1fcc1e-0x0;var _0x13497a=_0x0c81[_0x1fcc1e];return _0x13497a;};'use strict';var UserEvents=require(_0x10c8('0x0'));var events=[_0x10c8('0x1'),_0x10c8('0x2'),_0x10c8('0x3')];function createListener(_0x5b6d64,_0x37a485){return function(_0x2b1acc){_0x37a485['emit'](_0x5b6d64,_0x2b1acc);};}function removeListener(_0x127e9f,_0x335c80){return function(){UserEvents[_0x10c8('0x4')](_0x127e9f,_0x335c80);};}exports[_0x10c8('0x5')]=function(_0x185ffb){for(var _0x22bd6e=0x0,_0x2bdc8b=events[_0x10c8('0x6')];_0x22bd6e<_0x2bdc8b;_0x22bd6e++){var _0x3c9813=events[_0x22bd6e];var _0x224202=createListener(_0x10c8('0x7')+_0x3c9813,_0x185ffb);UserEvents['on'](_0x3c9813,_0x224202);}};
\ No newline at end of file
+var _0xd9f5=['removeListener','register','length','./user.events','save','remove','update','emit'];(function(_0x4c9d4a,_0x452c7a){var _0x59e69f=function(_0x310c60){while(--_0x310c60){_0x4c9d4a['push'](_0x4c9d4a['shift']());}};_0x59e69f(++_0x452c7a);}(_0xd9f5,0x183));var _0x5d9f=function(_0x1e1020,_0xd64a27){_0x1e1020=_0x1e1020-0x0;var _0x464719=_0xd9f5[_0x1e1020];return _0x464719;};'use strict';var UserEvents=require(_0x5d9f('0x0'));var events=[_0x5d9f('0x1'),_0x5d9f('0x2'),_0x5d9f('0x3')];function createListener(_0x34549e,_0x4050f5){return function(_0x1ccb6f){_0x4050f5[_0x5d9f('0x4')](_0x34549e,_0x1ccb6f);};}function removeListener(_0xd242b8,_0x9f8f0d){return function(){UserEvents[_0x5d9f('0x5')](_0xd242b8,_0x9f8f0d);};}exports[_0x5d9f('0x6')]=function(_0x4b617f){for(var _0x59cdcc=0x0,_0x79e13e=events[_0x5d9f('0x7')];_0x59cdcc<_0x79e13e;_0x59cdcc++){var _0x46f2a0=events[_0x59cdcc];var _0x30f6e0=createListener('user:'+_0x46f2a0,_0x4b617f);UserEvents['on'](_0x46f2a0,_0x30f6e0);}};
\ No newline at end of file
index d30c43f..fb37f53 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(_0x137d5e,_0x367c7b){var _0x52466d=function(_0x3392fd){while(--_0x3392fd){_0x137d5e['push'](_0x137d5e['shift']());}};_0x52466d(++_0x367c7b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xb301d4,_0x27ed18){_0xb301d4=_0xb301d4-0x0;var _0x3b5bde=_0xcb91[_0xb301d4];return _0x3b5bde;};'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(_0x4b60cc,_0x2e5e22){var _0x116ffe=function(_0xa9c57){while(--_0xa9c57){_0x4b60cc['push'](_0x4b60cc['shift']());}};_0x116ffe(++_0x2e5e22);}(_0x9c44,0x178));var _0x49c4=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9c44[_0x5d2803];return _0xdcad2c;};'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 89ce4d2..f4e4d04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b34=['exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9b34,0xd4));var _0x49b3=function(_0x12054f,_0x3b6baf){_0x12054f=_0x12054f-0x0;var _0x262cd8=_0x9b34[_0x12054f];return _0x262cd8;};'use strict';var Sequelize=require('sequelize');module[_0x49b3('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xcdcb=['INTEGER','sequelize','exports'];(function(_0x4e4eeb,_0x2a36ea){var _0x448743=function(_0x5da5c2){while(--_0x5da5c2){_0x4e4eeb['push'](_0x4e4eeb['shift']());}};_0x448743(++_0x2a36ea);}(_0xcdcb,0xfd));var _0xbcdc=function(_0x375fc1,_0xaa5e99){_0x375fc1=_0x375fc1-0x0;var _0x413d64=_0xcdcb[_0x375fc1];return _0x413d64;};'use strict';var Sequelize=require(_0xbcdc('0x0'));module[_0xbcdc('0x1')]={'penalty':{'type':Sequelize[_0xbcdc('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index e4e6db7..4176d72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ac4=['request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','bluebird'];(function(_0x3c23f9,_0x5e27a5){var _0x59aa21=function(_0x52e7b7){while(--_0x52e7b7){_0x3c23f9['push'](_0x3c23f9['shift']());}};_0x59aa21(++_0x5e27a5);}(_0x0ac4,0x181));var _0x40ac=function(_0x8b8564,_0x162976){_0x8b8564=_0x8b8564-0x0;var _0x360c61=_0x0ac4[_0x8b8564];return _0x360c61;};'use strict';var _=require(_0x40ac('0x0'));var util=require(_0x40ac('0x1'));var logger=require(_0x40ac('0x2'))(_0x40ac('0x3'));var moment=require('moment');var BPromise=require(_0x40ac('0x4'));var rp=require(_0x40ac('0x5'));var fs=require('fs');var path=require(_0x40ac('0x6'));var rimraf=require(_0x40ac('0x7'));var config=require(_0x40ac('0x8'));var attributes=require(_0x40ac('0x9'));module['exports']=function(_0x3351d5,_0x36d3de){return _0x3351d5[_0x40ac('0xa')](_0x40ac('0xb'),attributes,{'tableName':_0x40ac('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbe73=['request-promise','path','../../config/environment','define','util','../../config/logger','api','moment'];(function(_0x40709a,_0x6a6709){var _0x5e870a=function(_0x8d0842){while(--_0x8d0842){_0x40709a['push'](_0x40709a['shift']());}};_0x5e870a(++_0x6a6709);}(_0xbe73,0xf4));var _0x3be7=function(_0x3d2e4b,_0x1f6653){_0x3d2e4b=_0x3d2e4b-0x0;var _0x509e78=_0xbe73[_0x3d2e4b];return _0x509e78;};'use strict';var _=require('lodash');var util=require(_0x3be7('0x0'));var logger=require(_0x3be7('0x1'))(_0x3be7('0x2'));var moment=require(_0x3be7('0x3'));var BPromise=require('bluebird');var rp=require(_0x3be7('0x4'));var fs=require('fs');var path=require(_0x3be7('0x5'));var rimraf=require('rimraf');var config=require(_0x3be7('0x6'));var attributes=require('./userChatQueue.attributes');module['exports']=function(_0x20cd02,_0x5388c4){return _0x20cd02[_0x3be7('0x7')]('UserChatQueue',attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e4aa0f3..57fbbd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47db=['request','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x47db,0x1b0));var _0xb47d=function(_0x344fbd,_0x1b832a){_0x344fbd=_0x344fbd-0x0;var _0x3f7d7b=_0x47db[_0x344fbd];return _0x3f7d7b;};'use strict';var _=require(_0xb47d('0x0'));var util=require(_0xb47d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb47d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb47d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb47d('0x4'))(_0xb47d('0x5'));var config=require(_0xb47d('0x6'));var jayson=require(_0xb47d('0x7'));var client=jayson['client'][_0xb47d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x351d55,_0x35c87e,_0x1ba14f){return new BPromise(function(_0x50790b,_0x6e032d){return client[_0xb47d('0x9')](_0x351d55,_0x1ba14f)['then'](function(_0xbdb875){logger['info'](_0xb47d('0xa'),_0x35c87e,'request\x20sent');logger[_0xb47d('0xb')](_0xb47d('0xc'),_0x35c87e,'request\x20sent',JSON[_0xb47d('0xd')](_0xbdb875));if(_0xbdb875[_0xb47d('0xe')]){if(_0xbdb875['error'][_0xb47d('0xf')]===0x1f4){logger[_0xb47d('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x35c87e,_0xbdb875[_0xb47d('0xe')]['message']);return _0x6e032d(_0xbdb875[_0xb47d('0xe')][_0xb47d('0x10')]);}logger[_0xb47d('0xe')](_0xb47d('0xa'),_0x35c87e,_0xbdb875[_0xb47d('0xe')][_0xb47d('0x10')]);return _0x50790b(_0xbdb875[_0xb47d('0xe')][_0xb47d('0x10')]);}else{logger[_0xb47d('0x11')](_0xb47d('0xa'),_0x35c87e,_0xb47d('0x12'));_0x50790b(_0xbdb875[_0xb47d('0x13')][_0xb47d('0x10')]);}})[_0xb47d('0x14')](function(_0x1f1e31){logger[_0xb47d('0xe')](_0xb47d('0xa'),_0x35c87e,_0x1f1e31);_0x6e032d(_0x1f1e31);});});}
\ No newline at end of file
+var _0x1163=['../../config/logger','rpc','jayson/promise','http','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2b1110,_0x17725f){var _0x213677=function(_0x168ac1){while(--_0x168ac1){_0x2b1110['push'](_0x2b1110['shift']());}};_0x213677(++_0x17725f);}(_0x1163,0x139));var _0x3116=function(_0x37ef22,_0x348c92){_0x37ef22=_0x37ef22-0x0;var _0x49eeb3=_0x1163[_0x37ef22];return _0x49eeb3;};'use strict';var _=require(_0x3116('0x0'));var util=require(_0x3116('0x1'));var moment=require(_0x3116('0x2'));var BPromise=require('bluebird');var rs=require(_0x3116('0x3'));var fs=require('fs');var Redis=require(_0x3116('0x4'));var db=require(_0x3116('0x5'))['db'];var utils=require(_0x3116('0x6'));var logger=require(_0x3116('0x7'))(_0x3116('0x8'));var config=require('../../config/environment');var jayson=require(_0x3116('0x9'));var client=jayson['client'][_0x3116('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x563322,_0x2869e4,_0x96211f){return new BPromise(function(_0x443be0,_0x100601){return client[_0x3116('0xb')](_0x563322,_0x96211f)['then'](function(_0x110141){logger[_0x3116('0xc')](_0x3116('0xd'),_0x2869e4,_0x3116('0xe'));logger[_0x3116('0xf')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x2869e4,'request\x20sent',JSON['stringify'](_0x110141));if(_0x110141[_0x3116('0x10')]){if(_0x110141[_0x3116('0x10')][_0x3116('0x11')]===0x1f4){logger[_0x3116('0x10')](_0x3116('0xd'),_0x2869e4,_0x110141['error'][_0x3116('0x12')]);return _0x100601(_0x110141['error']['message']);}logger[_0x3116('0x10')](_0x3116('0xd'),_0x2869e4,_0x110141[_0x3116('0x10')][_0x3116('0x12')]);return _0x443be0(_0x110141[_0x3116('0x10')][_0x3116('0x12')]);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0x2869e4,_0x3116('0xe'));_0x443be0(_0x110141[_0x3116('0x13')][_0x3116('0x12')]);}})['catch'](function(_0x5294d1){logger['error'](_0x3116('0xd'),_0x2869e4,_0x5294d1);_0x100601(_0x5294d1);});});}
\ No newline at end of file
index dc5acd6..c6184f4 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(_0x2812c2,_0x2b382d){var _0x218ac9=function(_0x2fe4c4){while(--_0x2fe4c4){_0x2812c2['push'](_0x2812c2['shift']());}};_0x218ac9(++_0x2b382d);}(_0x9c44,0x178));var _0x49c4=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9c44[_0x2641f9];return _0x585741;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x10a546,_0x5ea132){var _0x30e897=function(_0x54964b){while(--_0x54964b){_0x10a546['push'](_0x10a546['shift']());}};_0x30e897(++_0x5ea132);}(_0x9c44,0x178));var _0x49c4=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x9c44[_0x3b0731];return _0x4204d7;};'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 1a7f5ab..2bee25c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cfb=['STRING','sequelize','INTEGER'];(function(_0x509c83,_0x511882){var _0x534626=function(_0x9d21cf){while(--_0x9d21cf){_0x509c83['push'](_0x509c83['shift']());}};_0x534626(++_0x511882);}(_0x5cfb,0x7f));var _0xb5cf=function(_0x522959,_0x37c0df){_0x522959=_0x522959-0x0;var _0x58b6e6=_0x5cfb[_0x522959];return _0x58b6e6;};'use strict';var Sequelize=require(_0xb5cf('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xb5cf('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xb5cf('0x2')]}};
\ No newline at end of file
+var _0xcdbf=['sequelize','exports','INTEGER','STRING'];(function(_0x4a55d2,_0x2f9ee5){var _0x1e56f1=function(_0x2b8c60){while(--_0x2b8c60){_0x4a55d2['push'](_0x4a55d2['shift']());}};_0x1e56f1(++_0x2f9ee5);}(_0xcdbf,0x1c0));var _0xfcdb=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xcdbf[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0xfcdb('0x0'));module[_0xfcdb('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xfcdb('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xfcdb('0x3')]}};
\ No newline at end of file
index 0419f7f..96c66e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0de1=['define','UserFaxQueue','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./userFaxQueue.attributes','exports'];(function(_0x111316,_0x3178a2){var _0x5981ed=function(_0x27989f){while(--_0x27989f){_0x111316['push'](_0x111316['shift']());}};_0x5981ed(++_0x3178a2);}(_0x0de1,0x1d6));var _0x10de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0de1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x10de('0x0'));var util=require(_0x10de('0x1'));var logger=require(_0x10de('0x2'))('api');var moment=require(_0x10de('0x3'));var BPromise=require(_0x10de('0x4'));var rp=require(_0x10de('0x5'));var fs=require('fs');var path=require(_0x10de('0x6'));var rimraf=require(_0x10de('0x7'));var config=require('../../config/environment');var attributes=require(_0x10de('0x8'));module[_0x10de('0x9')]=function(_0x3a6b70,_0x56a93c){return _0x3a6b70[_0x10de('0xa')](_0x10de('0xb'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xef80=['api','moment','bluebird','path','rimraf','define','UserFaxQueue','user_has_fax_queues','lodash','../../config/logger'];(function(_0x53561b,_0x1706b3){var _0x3fa06d=function(_0x234ea1){while(--_0x234ea1){_0x53561b['push'](_0x53561b['shift']());}};_0x3fa06d(++_0x1706b3);}(_0xef80,0x10c));var _0x0ef8=function(_0x10e983,_0x2f4eda){_0x10e983=_0x10e983-0x0;var _0x324138=_0xef80[_0x10e983];return _0x324138;};'use strict';var _=require(_0x0ef8('0x0'));var util=require('util');var logger=require(_0x0ef8('0x1'))(_0x0ef8('0x2'));var moment=require(_0x0ef8('0x3'));var BPromise=require(_0x0ef8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ef8('0x5'));var rimraf=require(_0x0ef8('0x6'));var config=require('../../config/environment');var attributes=require('./userFaxQueue.attributes');module['exports']=function(_0x14f761,_0x4f4500){return _0x14f761[_0x0ef8('0x7')](_0x0ef8('0x8'),attributes,{'tableName':_0x0ef8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 47cb791..b222ae2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc58=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s'];(function(_0x412572,_0x37e9e2){var _0x20881f=function(_0x58e4d2){while(--_0x58e4d2){_0x412572['push'](_0x412572['shift']());}};_0x20881f(++_0x37e9e2);}(_0xfc58,0x16e));var _0x8fc5=function(_0x3c3439,_0x51a4fd){_0x3c3439=_0x3c3439-0x0;var _0x1a2fbc=_0xfc58[_0x3c3439];return _0x1a2fbc;};'use strict';var _=require(_0x8fc5('0x0'));var util=require('util');var moment=require(_0x8fc5('0x1'));var BPromise=require(_0x8fc5('0x2'));var rs=require(_0x8fc5('0x3'));var fs=require('fs');var Redis=require(_0x8fc5('0x4'));var db=require(_0x8fc5('0x5'))['db'];var utils=require(_0x8fc5('0x6'));var logger=require(_0x8fc5('0x7'))(_0x8fc5('0x8'));var config=require(_0x8fc5('0x9'));var jayson=require(_0x8fc5('0xa'));var client=jayson[_0x8fc5('0xb')][_0x8fc5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3341f9,_0x803646,_0x1ae734){return new BPromise(function(_0x294cb8,_0x1f8650){return client[_0x8fc5('0xd')](_0x3341f9,_0x1ae734)['then'](function(_0x5ea5ae){logger[_0x8fc5('0xe')](_0x8fc5('0xf'),_0x803646,_0x8fc5('0x10'));logger['debug'](_0x8fc5('0x11'),_0x803646,'request\x20sent',JSON[_0x8fc5('0x12')](_0x5ea5ae));if(_0x5ea5ae[_0x8fc5('0x13')]){if(_0x5ea5ae[_0x8fc5('0x13')][_0x8fc5('0x14')]===0x1f4){logger['error'](_0x8fc5('0xf'),_0x803646,_0x5ea5ae[_0x8fc5('0x13')]['message']);return _0x1f8650(_0x5ea5ae[_0x8fc5('0x13')][_0x8fc5('0x15')]);}logger[_0x8fc5('0x13')]('UserFaxQueue,\x20%s,\x20%s',_0x803646,_0x5ea5ae[_0x8fc5('0x13')][_0x8fc5('0x15')]);return _0x294cb8(_0x5ea5ae[_0x8fc5('0x13')][_0x8fc5('0x15')]);}else{logger[_0x8fc5('0xe')](_0x8fc5('0xf'),_0x803646,'request\x20sent');_0x294cb8(_0x5ea5ae[_0x8fc5('0x16')]['message']);}})[_0x8fc5('0x17')](function(_0x438cd8){logger[_0x8fc5('0x13')](_0x8fc5('0xf'),_0x803646,_0x438cd8);_0x1f8650(_0x438cd8);});});}
\ No newline at end of file
+var _0x301e=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4bc66d,_0x114723){var _0x2c4a98=function(_0x426239){while(--_0x426239){_0x4bc66d['push'](_0x4bc66d['shift']());}};_0x2c4a98(++_0x114723);}(_0x301e,0x1e5));var _0xe301=function(_0x2acb6d,_0x8e88e3){_0x2acb6d=_0x2acb6d-0x0;var _0x5a3a46=_0x301e[_0x2acb6d];return _0x5a3a46;};'use strict';var _=require(_0xe301('0x0'));var util=require(_0xe301('0x1'));var moment=require(_0xe301('0x2'));var BPromise=require(_0xe301('0x3'));var rs=require(_0xe301('0x4'));var fs=require('fs');var Redis=require(_0xe301('0x5'));var db=require(_0xe301('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe301('0x7'))(_0xe301('0x8'));var config=require(_0xe301('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe301('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f5e8b,_0x354a3f,_0x55a34c){return new BPromise(function(_0x4bd2c6,_0x3dac55){return client[_0xe301('0xb')](_0x2f5e8b,_0x55a34c)[_0xe301('0xc')](function(_0x1496a1){logger[_0xe301('0xd')](_0xe301('0xe'),_0x354a3f,_0xe301('0xf'));logger[_0xe301('0x10')](_0xe301('0x11'),_0x354a3f,_0xe301('0xf'),JSON[_0xe301('0x12')](_0x1496a1));if(_0x1496a1[_0xe301('0x13')]){if(_0x1496a1[_0xe301('0x13')][_0xe301('0x14')]===0x1f4){logger[_0xe301('0x13')](_0xe301('0xe'),_0x354a3f,_0x1496a1['error'][_0xe301('0x15')]);return _0x3dac55(_0x1496a1[_0xe301('0x13')][_0xe301('0x15')]);}logger[_0xe301('0x13')](_0xe301('0xe'),_0x354a3f,_0x1496a1[_0xe301('0x13')][_0xe301('0x15')]);return _0x4bd2c6(_0x1496a1[_0xe301('0x13')][_0xe301('0x15')]);}else{logger[_0xe301('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x354a3f,_0xe301('0xf'));_0x4bd2c6(_0x1496a1[_0xe301('0x16')]['message']);}})[_0xe301('0x17')](function(_0x30962d){logger['error'](_0xe301('0xe'),_0x354a3f,_0x30962d);_0x3dac55(_0x30962d);});});}
\ No newline at end of file
index 915cee1..38f598a 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(_0x5d4cb5,_0x22025e){var _0x25561e=function(_0x4d792a){while(--_0x4d792a){_0x5d4cb5['push'](_0x5d4cb5['shift']());}};_0x25561e(++_0x22025e);}(_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'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x495910,_0x59f179){var _0xa7ce99=function(_0x4b487b){while(--_0x4b487b){_0x495910['push'](_0x495910['shift']());}};_0xa7ce99(++_0x59f179);}(_0xe706,0xa3));var _0x6e70=function(_0x3dfa3e,_0x293558){_0x3dfa3e=_0x3dfa3e-0x0;var _0x3ff9ed=_0xe706[_0x3dfa3e];return _0x3ff9ed;};'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 5a46045..ca40108 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4958=['INTEGER','sequelize','exports'];(function(_0x28e5b2,_0x2d66f5){var _0x1b988c=function(_0x3c1485){while(--_0x3c1485){_0x28e5b2['push'](_0x28e5b2['shift']());}};_0x1b988c(++_0x2d66f5);}(_0x4958,0xca));var _0x8495=function(_0x359491,_0x2a20d9){_0x359491=_0x359491-0x0;var _0x33b9dc=_0x4958[_0x359491];return _0x33b9dc;};'use strict';var Sequelize=require(_0x8495('0x0'));module[_0x8495('0x1')]={'penalty':{'type':Sequelize[_0x8495('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x88b9=['exports','INTEGER'];(function(_0x3b0310,_0x225075){var _0x3df645=function(_0x2c085e){while(--_0x2c085e){_0x3b0310['push'](_0x3b0310['shift']());}};_0x3df645(++_0x225075);}(_0x88b9,0x166));var _0x988b=function(_0x2a1fb8,_0x437fd1){_0x2a1fb8=_0x2a1fb8-0x0;var _0x5c8415=_0x88b9[_0x2a1fb8];return _0x5c8415;};'use strict';var Sequelize=require('sequelize');module[_0x988b('0x0')]={'penalty':{'type':Sequelize[_0x988b('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 621b5eb..ef80c4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbccc=['UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userMailQueue.attributes','exports','define'];(function(_0x113ce5,_0x2abec0){var _0x50b1da=function(_0x259537){while(--_0x259537){_0x113ce5['push'](_0x113ce5['shift']());}};_0x50b1da(++_0x2abec0);}(_0xbccc,0x1b4));var _0xcbcc=function(_0x590d2e,_0x5e61e5){_0x590d2e=_0x590d2e-0x0;var _0x2334d8=_0xbccc[_0x590d2e];return _0x2334d8;};'use strict';var _=require(_0xcbcc('0x0'));var util=require(_0xcbcc('0x1'));var logger=require(_0xcbcc('0x2'))(_0xcbcc('0x3'));var moment=require(_0xcbcc('0x4'));var BPromise=require(_0xcbcc('0x5'));var rp=require(_0xcbcc('0x6'));var fs=require('fs');var path=require(_0xcbcc('0x7'));var rimraf=require(_0xcbcc('0x8'));var config=require('../../config/environment');var attributes=require(_0xcbcc('0x9'));module[_0xcbcc('0xa')]=function(_0x4c1067,_0x4d3972){return _0x4c1067[_0xcbcc('0xb')](_0xcbcc('0xc'),attributes,{'tableName':_0xcbcc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc962=['define','user_has_mail_queues','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./userMailQueue.attributes','exports'];(function(_0x3da461,_0x2edd24){var _0x1f41ae=function(_0x396f38){while(--_0x396f38){_0x3da461['push'](_0x3da461['shift']());}};_0x1f41ae(++_0x2edd24);}(_0xc962,0x86));var _0x2c96=function(_0x3e48a4,_0x4a7b6b){_0x3e48a4=_0x3e48a4-0x0;var _0x3ec05c=_0xc962[_0x3e48a4];return _0x3ec05c;};'use strict';var _=require(_0x2c96('0x0'));var util=require(_0x2c96('0x1'));var logger=require(_0x2c96('0x2'))(_0x2c96('0x3'));var moment=require('moment');var BPromise=require(_0x2c96('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2c96('0x5'));var config=require(_0x2c96('0x6'));var attributes=require(_0x2c96('0x7'));module[_0x2c96('0x8')]=function(_0x213f3e,_0x4cb9eb){return _0x213f3e[_0x2c96('0x9')]('UserMailQueue',attributes,{'tableName':_0x2c96('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2b86299..b6a6c69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x4707f0,_0x357df5){var _0x275155=function(_0x50494b){while(--_0x50494b){_0x4707f0['push'](_0x4707f0['shift']());}};_0x275155(++_0x357df5);}(_0xe14b,0x93));var _0xbe14=function(_0x28ca9a,_0x1d0c80){_0x28ca9a=_0x28ca9a-0x0;var _0x1a194c=_0xe14b[_0x28ca9a];return _0x1a194c;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}
\ No newline at end of file
+var _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','UserMailQueue,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x35c87a,_0x500ad0){var _0x2fb898=function(_0x3bfeed){while(--_0x3bfeed){_0x35c87a['push'](_0x35c87a['shift']());}};_0x2fb898(++_0x500ad0);}(_0x3e74,0x175));var _0x43e7=function(_0x2a256f,_0x3e273c){_0x2a256f=_0x2a256f-0x0;var _0x8df18d=_0x3e74[_0x2a256f];return _0x8df18d;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}
\ No newline at end of file
index 496335d..f1708e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0948=['../../components/interaction/service','../../config/environment','isAuthenticated','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x571f02,_0x2f2132){var _0x26906d=function(_0x317c97){while(--_0x317c97){_0x571f02['push'](_0x571f02['shift']());}};_0x26906d(++_0x2f2132);}(_0x0948,0x1c7));var _0x8094=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x0948[_0x101e7b];return _0x4995c0;};'use strict';var multer=require(_0x8094('0x0'));var util=require(_0x8094('0x1'));var path=require(_0x8094('0x2'));var timeout=require(_0x8094('0x3'));var express=require('express');var router=express[_0x8094('0x4')]();var fs_extra=require(_0x8094('0x5'));var auth=require(_0x8094('0x6'));var interaction=require(_0x8094('0x7'));var config=require(_0x8094('0x8'));var controller=require('./userNotification.controller');router['post']('/',auth[_0x8094('0x9')](),controller['sendUserNotification']);module[_0x8094('0xa')]=router;
\ No newline at end of file
+var _0x50f5=['../../components/interaction/service','./userNotification.controller','post','sendUserNotification','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x50f5,0x14e));var _0x550f=function(_0x44534a,_0xf7af99){_0x44534a=_0x44534a-0x0;var _0x3a6326=_0x50f5[_0x44534a];return _0x3a6326;};'use strict';var multer=require(_0x550f('0x0'));var util=require(_0x550f('0x1'));var path=require(_0x550f('0x2'));var timeout=require(_0x550f('0x3'));var express=require(_0x550f('0x4'));var router=express['Router']();var fs_extra=require(_0x550f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x550f('0x6'));var config=require('../../config/environment');var controller=require(_0x550f('0x7'));router[_0x550f('0x8')]('/',auth['isAuthenticated'](),controller[_0x550f('0x9')]);module['exports']=router;
\ No newline at end of file
index 0985bc2..0e21320 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34be=['STRING','sequelize','TEXT'];(function(_0x4920b4,_0x4cc913){var _0x54c574=function(_0x310d11){while(--_0x310d11){_0x4920b4['push'](_0x4920b4['shift']());}};_0x54c574(++_0x4cc913);}(_0x34be,0x17e));var _0xe34b=function(_0x4e11d5,_0x1ce514){_0x4e11d5=_0x4e11d5-0x0;var _0x5e4e4c=_0x34be[_0x4e11d5];return _0x5e4e4c;};'use strict';var Sequelize=require(_0xe34b('0x0'));module['exports']={'body':{'type':Sequelize[_0xe34b('0x1')]},'senderName':{'type':Sequelize[_0xe34b('0x2')]},'recipientsId':{'type':Sequelize[_0xe34b('0x1')]},'recipientsDescription':{'type':Sequelize[_0xe34b('0x2')]},'beep':{'type':Sequelize['BOOLEAN']}};
\ No newline at end of file
+var _0x3ad5=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x3c2668,_0x33a67a){var _0x22136a=function(_0x3eea77){while(--_0x3eea77){_0x3c2668['push'](_0x3c2668['shift']());}};_0x22136a(++_0x33a67a);}(_0x3ad5,0x17e));var _0x53ad=function(_0x2d9b06,_0x5ad8c1){_0x2d9b06=_0x2d9b06-0x0;var _0x128a99=_0x3ad5[_0x2d9b06];return _0x128a99;};'use strict';var Sequelize=require(_0x53ad('0x0'));module[_0x53ad('0x1')]={'body':{'type':Sequelize[_0x53ad('0x2')]},'senderName':{'type':Sequelize[_0x53ad('0x3')]},'recipientsId':{'type':Sequelize[_0x53ad('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x53ad('0x4')]}};
\ No newline at end of file
index 3ec5050..259b599 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab7d=['moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','register','sendStatus','status','end','offset','undefined','limit','count','apply','save','update','then','destroy','stack','name','send','sendUserNotification','body','text','TemplateId','Sequelize','ValidationError','hasOwnProperty','view','Missing\x20\x27recipients\x27\x20parameter','parse','recipients','error','chatqueue','mailqueue','voicequeue','whatsappqueue','team','user','some','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','forEach','recipient','emit','userNotification:send','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','catch','startCase','model','User','union','ids','includes','replace','queue','Queue','push','all','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x1f87a3,_0x3799c5){var _0x17ebae=function(_0x55b076){while(--_0x55b076){_0x1f87a3['push'](_0x1f87a3['shift']());}};_0x17ebae(++_0x3799c5);}(_0xab7d,0xbf));var _0xdab7=function(_0x65f9b1,_0x129faf){_0x65f9b1=_0x65f9b1-0x0;var _0x5ac5bf=_0xab7d[_0x65f9b1];return _0x5ac5bf;};'use strict';var emlformat=require(_0xdab7('0x0'));var rimraf=require(_0xdab7('0x1'));var zipdir=require(_0xdab7('0x2'));var jsonpatch=require(_0xdab7('0x3'));var rp=require(_0xdab7('0x4'));var moment=require(_0xdab7('0x5'));var BPromise=require(_0xdab7('0x6'));var Mustache=require(_0xdab7('0x7'));var util=require('util');var path=require(_0xdab7('0x8'));var sox=require(_0xdab7('0x9'));var csv=require(_0xdab7('0xa'));var ejs=require(_0xdab7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdab7('0xc'));var squel=require(_0xdab7('0xd'));var crypto=require(_0xdab7('0xe'));var jsforce=require(_0xdab7('0xf'));var deskjs=require(_0xdab7('0x10'));var toCsv=require(_0xdab7('0xa'));var querystring=require(_0xdab7('0x11'));var Papa=require(_0xdab7('0x12'));var Redis=require(_0xdab7('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xdab7('0x14'));var as=require(_0xdab7('0x15'));var hardwareService=require(_0xdab7('0x16'));var logger=require(_0xdab7('0x17'))('api');var utils=require(_0xdab7('0x18'));var config=require(_0xdab7('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xdab7('0x1a'))['db'];config[_0xdab7('0x1b')]=_['defaults'](config[_0xdab7('0x1b')],{'host':_0xdab7('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdab7('0x1b')]));require('./userNotification.socket')[_0xdab7('0x1d')](socket);function respondWithStatusCode(_0x31c1f0,_0x23d8d1){_0x23d8d1=_0x23d8d1||0xcc;return function(_0x41b343){if(_0x41b343){return _0x31c1f0[_0xdab7('0x1e')](_0x23d8d1);}return _0x31c1f0[_0xdab7('0x1f')](_0x23d8d1)[_0xdab7('0x20')]();};}function respondWithResult(_0x3f5e1f,_0x330833){_0x330833=_0x330833||0xc8;return function(_0x1edb95){if(_0x1edb95){return _0x3f5e1f['status'](_0x330833)['json'](_0x1edb95);}};}function respondWithFilteredResult(_0x5f549b,_0x2cbc7c){return function(_0x1168bc){if(_0x1168bc){var _0x559e70=typeof _0x2cbc7c[_0xdab7('0x21')]===_0xdab7('0x22')&&typeof _0x2cbc7c[_0xdab7('0x23')]===_0xdab7('0x22');var _0x19011d=_0x1168bc['count'];var _0x5b4d68=_0x559e70?0x0:_0x2cbc7c[_0xdab7('0x21')];var _0x1b8bf2=_0x559e70?_0x1168bc[_0xdab7('0x24')]:_0x2cbc7c[_0xdab7('0x21')]+_0x2cbc7c[_0xdab7('0x23')];var _0x261bfc;if(_0x1b8bf2>=_0x19011d){_0x1b8bf2=_0x19011d;_0x261bfc=0xc8;}else{_0x261bfc=0xce;}_0x5f549b['status'](_0x261bfc);return _0x5f549b['set']('Content-Range',_0x5b4d68+'-'+_0x1b8bf2+'/'+_0x19011d)['json'](_0x1168bc);}return null;};}function patchUpdates(_0x47234c){return function(_0x869037){try{jsonpatch[_0xdab7('0x25')](_0x869037,_0x47234c,!![]);}catch(_0x11e464){return BPromise['reject'](_0x11e464);}return _0x869037[_0xdab7('0x26')]();};}function saveUpdates(_0x188e35,_0x9f7de9){return function(_0x31d733){if(_0x31d733){return _0x31d733[_0xdab7('0x27')](_0x188e35)[_0xdab7('0x28')](function(_0x3e3148){return _0x3e3148;});}return null;};}function removeEntity(_0x5be733,_0x57beb1){return function(_0x1a519a){if(_0x1a519a){return _0x1a519a[_0xdab7('0x29')]()['then'](function(){_0x5be733[_0xdab7('0x1f')](0xcc)[_0xdab7('0x20')]();});}};}function handleEntityNotFound(_0x3002f0,_0x452b0d){return function(_0xa144dc){if(!_0xa144dc){_0x3002f0[_0xdab7('0x1e')](0x194);}return _0xa144dc;};}function handleError(_0x1cfeaf,_0x29d7c0){_0x29d7c0=_0x29d7c0||0x1f4;return function(_0x6a2bfc){logger['error'](_0x6a2bfc[_0xdab7('0x2a')]);if(_0x6a2bfc[_0xdab7('0x2b')]){delete _0x6a2bfc[_0xdab7('0x2b')];}_0x1cfeaf['status'](_0x29d7c0)[_0xdab7('0x2c')](_0x6a2bfc);};}exports[_0xdab7('0x2d')]=function(_0x23cb54,_0x2f02ad,_0x16228e){if(!_0x23cb54[_0xdab7('0x2e')]['hasOwnProperty'](_0xdab7('0x2f'))&&!_0x23cb54[_0xdab7('0x2e')]['hasOwnProperty'](_0xdab7('0x30'))){throw new db[(_0xdab7('0x31'))][(_0xdab7('0x32'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x23cb54[_0xdab7('0x2e')][_0xdab7('0x33')](_0xdab7('0x30'))&&!_0x23cb54['body'][_0xdab7('0x33')](_0xdab7('0x34'))){throw new db['Sequelize']['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x23cb54[_0xdab7('0x2e')][_0xdab7('0x33')]('recipients')){throw new db[(_0xdab7('0x31'))]['ValidationError'](_0xdab7('0x35'));}else{try{var _0x7e0496=JSON[_0xdab7('0x36')](_0x23cb54[_0xdab7('0x2e')][_0xdab7('0x37')]);}catch(_0x131f15){logger[_0xdab7('0x38')](_0x131f15);throw new db['Sequelize'][(_0xdab7('0x32'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x5ce18c=[_0xdab7('0x39'),'faxqueue',_0xdab7('0x3a'),'openchannelqueue','smsqueue',_0xdab7('0x3b'),_0xdab7('0x3c'),_0xdab7('0x3d'),_0xdab7('0x3e')];if(_[_0xdab7('0x3f')](_0x7e0496,function(_0x43cadc){return!_['includes'](_0x5ce18c,_0x43cadc['model']['toLowerCase']());})){throw new db[(_0xdab7('0x31'))][(_0xdab7('0x32'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x2b98b1={};_0x2b98b1['senderName']=_0x23cb54[_0xdab7('0x2e')]['hasOwnProperty'](_0xdab7('0x40'))?_0x23cb54[_0xdab7('0x2e')][_0xdab7('0x40')]:_0x23cb54['user'][_0xdab7('0x41')];_0x2b98b1[_0xdab7('0x42')]=_[_0xdab7('0x43')](_0x23cb54['body']['recipientsDescription'])?null:_0x23cb54[_0xdab7('0x2e')]['recipientsDescription'];_0x2b98b1['beep']=_0x23cb54[_0xdab7('0x2e')][_0xdab7('0x44')]||![];_0x2b98b1[_0xdab7('0x45')]=_0x23cb54[_0xdab7('0x3e')]['id'];return getContent(_0x23cb54[_0xdab7('0x2e')])[_0xdab7('0x28')](function(_0x29874a){_0x2b98b1[_0xdab7('0x2e')]=_0x29874a;return getRecipients(_0x7e0496);})[_0xdab7('0x28')](function(_0x9ce096){_0x2b98b1[_0xdab7('0x46')]=_[_0xdab7('0x47')](_0x9ce096)[_0xdab7('0x48')](',');return db[_0xdab7('0x49')][_0xdab7('0x4a')](function(_0x395b89){return db[_0xdab7('0x4b')]['create'](_0x2b98b1,{'raw':!![],'transaction':_0x395b89})[_0xdab7('0x28')](function(_0x227082){var _0x2a24a1={'sender':_0x2b98b1['senderName'],'description':_0x2b98b1[_0xdab7('0x42')],'content':_0x2b98b1['body'],'beep':_0x2b98b1[_0xdab7('0x44')]};_0x9ce096[_0xdab7('0x4c')](function(_0x5234db){_0x2a24a1[_0xdab7('0x4d')]=_0x5234db;socket[_0xdab7('0x4e')](_0xdab7('0x4f'),_0x2a24a1);});return _0x227082;});});})['then'](respondWithResult(_0x2f02ad,0xc9))['catch'](handleError(_0x2f02ad,null));};function getContent(_0x3eb02b){return new BPromise(function(_0x426579,_0x5c24bc){if(_0x3eb02b[_0xdab7('0x2f')]){_0x426579(_0x3eb02b['text']);return;}return db[_0xdab7('0x50')][_0xdab7('0x51')]({'attributes':[_0xdab7('0x52')],'where':{'id':_0x3eb02b['TemplateId']},'raw':!![]})[_0xdab7('0x28')](function(_0x311a58){if(!_0x311a58)throw new db['Sequelize']['ValidationError'](_0xdab7('0x53'));var _0x2029ec=Mustache['render'](_0x311a58['html'],_0x3eb02b[_0xdab7('0x34')]);_0x426579(_0x2029ec);})[_0xdab7('0x54')](function(_0x142244){_0x5c24bc(_0x142244);});});}function getRecipients(_0x176a57){return new BPromise(function(_0x3d228c,_0xa56ef8){var _0x283876=[];var _0x4db261=[];_0x176a57['forEach'](function(_0x300b77){var _0x312646=_[_0xdab7('0x55')](_0x300b77[_0xdab7('0x56')]['toLowerCase']());if(_0x312646===_0xdab7('0x57')){_0x283876=_[_0xdab7('0x58')](_0x283876,_0x300b77[_0xdab7('0x59')]);}else{if(_[_0xdab7('0x5a')](_0x312646,'queue'))_0x312646=_0x312646[_0xdab7('0x5b')](_0xdab7('0x5c'),_0xdab7('0x5d'));_0x300b77[_0xdab7('0x59')]['forEach'](function(_0x2c2efe){_0x4db261[_0xdab7('0x5e')](getAgents(_0x312646,_0x2c2efe));});}});return BPromise[_0xdab7('0x5f')](_0x4db261)[_0xdab7('0x28')](function(_0x3404e6){_0x283876=_[_0xdab7('0x58')](_0x283876,_['flatten'](_0x3404e6));_0x3d228c(_0x283876);})[_0xdab7('0x54')](function(_0x37eb59){_0xa56ef8(_0x37eb59);});});}function getAgents(_0x14df98,_0xe81d2f){return new BPromise(function(_0x54435e,_0x4c40ac){return db[_0x14df98][_0xdab7('0x51')]({'where':{'id':_0xe81d2f}})[_0xdab7('0x28')](function(_0x4c693a){return _0x4c693a[_0xdab7('0x60')]({'attributes':['id'],'raw':!![]})[_0xdab7('0x28')](function(_0x2aaa10){var _0x40a73b=_[_0xdab7('0x61')](_0x2aaa10,'id');_0x54435e(_0x40a73b);});})[_0xdab7('0x54')](function(_0x4708d6){_0x4c40ac(_0x4708d6);});});}
\ No newline at end of file
+var _0xb41d=['apply','reject','save','update','then','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','recipients','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','user','some','includes','model','senderName','fullname','recipientsDescription','isEmpty','beep','recipientsId','sortBy','join','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','startCase','toLowerCase','User','ids','queue','replace','Queue','push','all','union','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','register','status','end','json','undefined','limit','count','offset','set','Content-Range'];(function(_0x4f44f8,_0x1c680e){var _0x35c8e7=function(_0x59fa41){while(--_0x59fa41){_0x4f44f8['push'](_0x4f44f8['shift']());}};_0x35c8e7(++_0x1c680e);}(_0xb41d,0x10c));var _0xdb41=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xb41d[_0x2b7764];return _0x848dcb;};'use strict';var emlformat=require(_0xdb41('0x0'));var rimraf=require(_0xdb41('0x1'));var zipdir=require(_0xdb41('0x2'));var jsonpatch=require(_0xdb41('0x3'));var rp=require(_0xdb41('0x4'));var moment=require(_0xdb41('0x5'));var BPromise=require(_0xdb41('0x6'));var Mustache=require(_0xdb41('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xdb41('0x8'));var ejs=require(_0xdb41('0x9'));var fs=require('fs');var fs_extra=require(_0xdb41('0xa'));var _=require(_0xdb41('0xb'));var squel=require(_0xdb41('0xc'));var crypto=require(_0xdb41('0xd'));var jsforce=require(_0xdb41('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xdb41('0x8'));var querystring=require(_0xdb41('0xf'));var Papa=require(_0xdb41('0x10'));var Redis=require(_0xdb41('0x11'));var authService=require(_0xdb41('0x12'));var qs=require(_0xdb41('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdb41('0x14'));var logger=require(_0xdb41('0x15'))(_0xdb41('0x16'));var utils=require(_0xdb41('0x17'));var config=require(_0xdb41('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xdb41('0x19'))['db'];config['redis']=_['defaults'](config[_0xdb41('0x1a')],{'host':_0xdb41('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdb41('0x1a')]));require('./userNotification.socket')[_0xdb41('0x1c')](socket);function respondWithStatusCode(_0x3266ec,_0x58c83d){_0x58c83d=_0x58c83d||0xcc;return function(_0x4b412b){if(_0x4b412b){return _0x3266ec['sendStatus'](_0x58c83d);}return _0x3266ec[_0xdb41('0x1d')](_0x58c83d)[_0xdb41('0x1e')]();};}function respondWithResult(_0x443802,_0x28facb){_0x28facb=_0x28facb||0xc8;return function(_0x2470af){if(_0x2470af){return _0x443802[_0xdb41('0x1d')](_0x28facb)[_0xdb41('0x1f')](_0x2470af);}};}function respondWithFilteredResult(_0x1a6da8,_0x1ba849){return function(_0x47307e){if(_0x47307e){var _0x4b2389=typeof _0x1ba849['offset']===_0xdb41('0x20')&&typeof _0x1ba849[_0xdb41('0x21')]==='undefined';var _0x145234=_0x47307e[_0xdb41('0x22')];var _0x63e953=_0x4b2389?0x0:_0x1ba849[_0xdb41('0x23')];var _0x398699=_0x4b2389?_0x47307e[_0xdb41('0x22')]:_0x1ba849[_0xdb41('0x23')]+_0x1ba849[_0xdb41('0x21')];var _0x3ad02b;if(_0x398699>=_0x145234){_0x398699=_0x145234;_0x3ad02b=0xc8;}else{_0x3ad02b=0xce;}_0x1a6da8[_0xdb41('0x1d')](_0x3ad02b);return _0x1a6da8[_0xdb41('0x24')](_0xdb41('0x25'),_0x63e953+'-'+_0x398699+'/'+_0x145234)[_0xdb41('0x1f')](_0x47307e);}return null;};}function patchUpdates(_0x19943a){return function(_0x50da0a){try{jsonpatch[_0xdb41('0x26')](_0x50da0a,_0x19943a,!![]);}catch(_0x2713f4){return BPromise[_0xdb41('0x27')](_0x2713f4);}return _0x50da0a[_0xdb41('0x28')]();};}function saveUpdates(_0x27318a,_0x24d46f){return function(_0x1c1096){if(_0x1c1096){return _0x1c1096[_0xdb41('0x29')](_0x27318a)['then'](function(_0x19077f){return _0x19077f;});}return null;};}function removeEntity(_0x2d76fa,_0x3d7f66){return function(_0x35c3d2){if(_0x35c3d2){return _0x35c3d2['destroy']()[_0xdb41('0x2a')](function(){_0x2d76fa['status'](0xcc)[_0xdb41('0x1e')]();});}};}function handleEntityNotFound(_0x428942,_0xe42a2f){return function(_0x590ccd){if(!_0x590ccd){_0x428942['sendStatus'](0x194);}return _0x590ccd;};}function handleError(_0x3d73b9,_0x3d2a74){_0x3d2a74=_0x3d2a74||0x1f4;return function(_0x70feef){logger[_0xdb41('0x2b')](_0x70feef[_0xdb41('0x2c')]);if(_0x70feef[_0xdb41('0x2d')]){delete _0x70feef[_0xdb41('0x2d')];}_0x3d73b9[_0xdb41('0x1d')](_0x3d2a74)[_0xdb41('0x2e')](_0x70feef);};}exports[_0xdb41('0x2f')]=function(_0x1c480b,_0x295040,_0x5384ce){if(!_0x1c480b[_0xdb41('0x30')][_0xdb41('0x31')](_0xdb41('0x32'))&&!_0x1c480b[_0xdb41('0x30')][_0xdb41('0x31')](_0xdb41('0x33'))){throw new db[(_0xdb41('0x34'))][(_0xdb41('0x35'))](_0xdb41('0x36'));}else{if(_0x1c480b['body'][_0xdb41('0x31')](_0xdb41('0x33'))&&!_0x1c480b[_0xdb41('0x30')][_0xdb41('0x31')](_0xdb41('0x37'))){throw new db['Sequelize'][(_0xdb41('0x35'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x1c480b[_0xdb41('0x30')][_0xdb41('0x31')](_0xdb41('0x38'))){throw new db[(_0xdb41('0x34'))][(_0xdb41('0x35'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x5e1edb=JSON['parse'](_0x1c480b[_0xdb41('0x30')][_0xdb41('0x38')]);}catch(_0x3491e3){logger[_0xdb41('0x2b')](_0x3491e3);throw new db[(_0xdb41('0x34'))]['ValidationError'](_0xdb41('0x39'));}var _0x2103eb=[_0xdb41('0x3a'),'faxqueue',_0xdb41('0x3b'),_0xdb41('0x3c'),_0xdb41('0x3d'),_0xdb41('0x3e'),_0xdb41('0x3f'),'team',_0xdb41('0x40')];if(_[_0xdb41('0x41')](_0x5e1edb,function(_0xba1091){return!_[_0xdb41('0x42')](_0x2103eb,_0xba1091[_0xdb41('0x43')]['toLowerCase']());})){throw new db[(_0xdb41('0x34'))][(_0xdb41('0x35'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x524ff9={};_0x524ff9[_0xdb41('0x44')]=_0x1c480b[_0xdb41('0x30')][_0xdb41('0x31')]('senderName')?_0x1c480b[_0xdb41('0x30')]['senderName']:_0x1c480b[_0xdb41('0x40')][_0xdb41('0x45')];_0x524ff9[_0xdb41('0x46')]=_[_0xdb41('0x47')](_0x1c480b['body']['recipientsDescription'])?null:_0x1c480b['body'][_0xdb41('0x46')];_0x524ff9[_0xdb41('0x48')]=_0x1c480b['body'][_0xdb41('0x48')]||![];_0x524ff9['SenderId']=_0x1c480b[_0xdb41('0x40')]['id'];return getContent(_0x1c480b[_0xdb41('0x30')])[_0xdb41('0x2a')](function(_0x4ea0bb){_0x524ff9[_0xdb41('0x30')]=_0x4ea0bb;return getRecipients(_0x5e1edb);})[_0xdb41('0x2a')](function(_0x1100e2){_0x524ff9[_0xdb41('0x49')]=_[_0xdb41('0x4a')](_0x1100e2)[_0xdb41('0x4b')](',');return db['sequelize'][_0xdb41('0x4c')](function(_0x5c3d76){return db[_0xdb41('0x4d')][_0xdb41('0x4e')](_0x524ff9,{'raw':!![],'transaction':_0x5c3d76})[_0xdb41('0x2a')](function(_0x839e25){var _0x281757={'sender':_0x524ff9[_0xdb41('0x44')],'description':_0x524ff9['recipientsDescription'],'content':_0x524ff9[_0xdb41('0x30')],'beep':_0x524ff9['beep']};_0x1100e2[_0xdb41('0x4f')](function(_0x1a70b6){_0x281757[_0xdb41('0x50')]=_0x1a70b6;socket[_0xdb41('0x51')](_0xdb41('0x52'),_0x281757);});return _0x839e25;});});})[_0xdb41('0x2a')](respondWithResult(_0x295040,0xc9))[_0xdb41('0x53')](handleError(_0x295040,null));};function getContent(_0x8e3483){return new BPromise(function(_0x3130ec,_0x47de86){if(_0x8e3483[_0xdb41('0x32')]){_0x3130ec(_0x8e3483[_0xdb41('0x32')]);return;}return db[_0xdb41('0x54')][_0xdb41('0x55')]({'attributes':['html'],'where':{'id':_0x8e3483['TemplateId']},'raw':!![]})['then'](function(_0x3e4f47){if(!_0x3e4f47)throw new db[(_0xdb41('0x34'))][(_0xdb41('0x35'))](_0xdb41('0x56'));var _0x54ae53=Mustache[_0xdb41('0x57')](_0x3e4f47[_0xdb41('0x58')],_0x8e3483['view']);_0x3130ec(_0x54ae53);})[_0xdb41('0x53')](function(_0x50555f){_0x47de86(_0x50555f);});});}function getRecipients(_0x246c53){return new BPromise(function(_0x2e38e4,_0x239dab){var _0x354a17=[];var _0x4e4f6d=[];_0x246c53[_0xdb41('0x4f')](function(_0x129a5a){var _0x22850e=_[_0xdb41('0x59')](_0x129a5a[_0xdb41('0x43')][_0xdb41('0x5a')]());if(_0x22850e===_0xdb41('0x5b')){_0x354a17=_['union'](_0x354a17,_0x129a5a[_0xdb41('0x5c')]);}else{if(_[_0xdb41('0x42')](_0x22850e,_0xdb41('0x5d')))_0x22850e=_0x22850e[_0xdb41('0x5e')](_0xdb41('0x5d'),_0xdb41('0x5f'));_0x129a5a['ids']['forEach'](function(_0x49e25b){_0x4e4f6d[_0xdb41('0x60')](getAgents(_0x22850e,_0x49e25b));});}});return BPromise[_0xdb41('0x61')](_0x4e4f6d)[_0xdb41('0x2a')](function(_0x4df8bc){_0x354a17=_[_0xdb41('0x62')](_0x354a17,_[_0xdb41('0x63')](_0x4df8bc));_0x2e38e4(_0x354a17);})['catch'](function(_0x4517df){_0x239dab(_0x4517df);});});}function getAgents(_0x17fe30,_0x67f565){return new BPromise(function(_0x420f4c,_0x344f38){return db[_0x17fe30][_0xdb41('0x55')]({'where':{'id':_0x67f565}})[_0xdb41('0x2a')](function(_0x35b044){return _0x35b044[_0xdb41('0x64')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2be0ac){var _0x500a03=_[_0xdb41('0x65')](_0x2be0ac,'id');_0x420f4c(_0x500a03);});})['catch'](function(_0xce60d){_0x344f38(_0xce60d);});});}
\ No newline at end of file
index 73535fd..3777e0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf05=['setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb','UserNotification'];(function(_0x4d21ff,_0x19d202){var _0x22b554=function(_0x4473c5){while(--_0x4473c5){_0x4d21ff['push'](_0x4d21ff['shift']());}};_0x22b554(++_0x19d202);}(_0xaf05,0xc3));var _0x5af0=function(_0x6006b2,_0xb54dab){_0x6006b2=_0x6006b2-0x0;var _0x4f159e=_0xaf05[_0x6006b2];return _0x4f159e;};'use strict';var EventEmitter=require(_0x5af0('0x0'));var UserNotification=require(_0x5af0('0x1'))['db'][_0x5af0('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x5af0('0x3')](0x0);var events={'afterCreate':_0x5af0('0x4'),'afterUpdate':_0x5af0('0x5'),'afterDestroy':_0x5af0('0x6')};function emitEvent(_0x4ca66a){return function(_0x187b5c,_0x1b8605,_0x4ca7cf){UserNotificationEvents[_0x5af0('0x7')](_0x4ca66a+':'+_0x187b5c['id'],_0x187b5c);UserNotificationEvents[_0x5af0('0x7')](_0x4ca66a,_0x187b5c);_0x4ca7cf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x5af0('0x8')]=UserNotificationEvents;
\ No newline at end of file
+var _0x0d6c=['emit','hasOwnProperty','hook','exports','events','UserNotification','setMaxListeners','remove'];(function(_0x3b1657,_0x47d574){var _0x25f8b2=function(_0x3f4586){while(--_0x3f4586){_0x3b1657['push'](_0x3b1657['shift']());}};_0x25f8b2(++_0x47d574);}(_0x0d6c,0xe4));var _0xc0d6=function(_0x1a59ca,_0x564115){_0x1a59ca=_0x1a59ca-0x0;var _0x5376e3=_0x0d6c[_0x1a59ca];return _0x5376e3;};'use strict';var EventEmitter=require(_0xc0d6('0x0'));var UserNotification=require('../../mysqldb')['db'][_0xc0d6('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xc0d6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc0d6('0x3')};function emitEvent(_0x508465){return function(_0x2a3d5b,_0x1fbadf,_0x3d8aac){UserNotificationEvents[_0xc0d6('0x4')](_0x508465+':'+_0x2a3d5b['id'],_0x2a3d5b);UserNotificationEvents[_0xc0d6('0x4')](_0x508465,_0x2a3d5b);_0x3d8aac(null);};}for(var e in events){if(events[_0xc0d6('0x5')](e)){var event=events[e];UserNotification[_0xc0d6('0x6')](e,emitEvent(event));}}module[_0xc0d6('0x7')]=UserNotificationEvents;
\ No newline at end of file
index 17255c6..03cd357 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e90=['./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment'];(function(_0x2b2ac8,_0x22f79a){var _0x5cd081=function(_0x31155d){while(--_0x31155d){_0x2b2ac8['push'](_0x2b2ac8['shift']());}};_0x5cd081(++_0x22f79a);}(_0x6e90,0xf5));var _0x06e9=function(_0x1a37fa,_0x94a584){_0x1a37fa=_0x1a37fa-0x0;var _0x317191=_0x6e90[_0x1a37fa];return _0x317191;};'use strict';var _=require(_0x06e9('0x0'));var util=require(_0x06e9('0x1'));var logger=require(_0x06e9('0x2'))('api');var moment=require(_0x06e9('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x06e9('0x4'));var rimraf=require(_0x06e9('0x5'));var config=require(_0x06e9('0x6'));var attributes=require(_0x06e9('0x7'));module[_0x06e9('0x8')]=function(_0x39e3c5,_0x5e0dad){return _0x39e3c5[_0x06e9('0x9')](_0x06e9('0xa'),attributes,{'tableName':_0x06e9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x06e9('0xc'),'collate':_0x06e9('0xd')});};
\ No newline at end of file
+var _0x17fb=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','userNotifications','utf8mb4'];(function(_0x1b4c04,_0x8d961d){var _0x374f5d=function(_0x11dc31){while(--_0x11dc31){_0x1b4c04['push'](_0x1b4c04['shift']());}};_0x374f5d(++_0x8d961d);}(_0x17fb,0xb0));var _0xb17f=function(_0x119280,_0x439c3e){_0x119280=_0x119280-0x0;var _0x481797=_0x17fb[_0x119280];return _0x481797;};'use strict';var _=require('lodash');var util=require(_0xb17f('0x0'));var logger=require(_0xb17f('0x1'))('api');var moment=require(_0xb17f('0x2'));var BPromise=require('bluebird');var rp=require(_0xb17f('0x3'));var fs=require('fs');var path=require(_0xb17f('0x4'));var rimraf=require(_0xb17f('0x5'));var config=require(_0xb17f('0x6'));var attributes=require('./userNotification.attributes');module[_0xb17f('0x7')]=function(_0x3a1d18,_0x557fa9){return _0x3a1d18[_0xb17f('0x8')]('UserNotification',attributes,{'tableName':_0xb17f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb17f('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 1bcaf89..9d3b737 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3eca=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','request','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x41e2a9,_0x3d8978){var _0x24fea7=function(_0x4b8bd5){while(--_0x4b8bd5){_0x41e2a9['push'](_0x41e2a9['shift']());}};_0x24fea7(++_0x3d8978);}(_0x3eca,0x104));var _0xa3ec=function(_0xdad237,_0x361a1d){_0xdad237=_0xdad237-0x0;var _0x15c575=_0x3eca[_0xdad237];return _0x15c575;};'use strict';var _=require('lodash');var util=require(_0xa3ec('0x0'));var moment=require(_0xa3ec('0x1'));var BPromise=require(_0xa3ec('0x2'));var rs=require(_0xa3ec('0x3'));var fs=require('fs');var Redis=require(_0xa3ec('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa3ec('0x5'));var logger=require(_0xa3ec('0x6'))(_0xa3ec('0x7'));var config=require(_0xa3ec('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa3ec('0x9')][_0xa3ec('0xa')]({'port':0x232a});config[_0xa3ec('0xb')]=_[_0xa3ec('0xc')](config[_0xa3ec('0xb')],{'host':_0xa3ec('0xd'),'port':0x18eb});var socket=require(_0xa3ec('0xe'))(new Redis(config[_0xa3ec('0xb')]));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x3dca72,_0x2e153f,_0x3f3cbe){return new BPromise(function(_0x582039,_0xa0034){return client[_0xa3ec('0xf')](_0x3dca72,_0x3f3cbe)[_0xa3ec('0x10')](function(_0x1236af){logger['info'](_0xa3ec('0x11'),_0x2e153f,_0xa3ec('0x12'));logger[_0xa3ec('0x13')](_0xa3ec('0x14'),_0x2e153f,'request\x20sent',JSON[_0xa3ec('0x15')](_0x1236af));if(_0x1236af['error']){if(_0x1236af[_0xa3ec('0x16')][_0xa3ec('0x17')]===0x1f4){logger['error'](_0xa3ec('0x11'),_0x2e153f,_0x1236af[_0xa3ec('0x16')]['message']);return _0xa0034(_0x1236af[_0xa3ec('0x16')][_0xa3ec('0x18')]);}logger[_0xa3ec('0x16')](_0xa3ec('0x11'),_0x2e153f,_0x1236af['error'][_0xa3ec('0x18')]);return _0x582039(_0x1236af[_0xa3ec('0x16')]['message']);}else{logger['info'](_0xa3ec('0x11'),_0x2e153f,_0xa3ec('0x12'));_0x582039(_0x1236af[_0xa3ec('0x19')][_0xa3ec('0x18')]);}})['catch'](function(_0x32def7){logger[_0xa3ec('0x16')](_0xa3ec('0x11'),_0x2e153f,_0x32def7);_0xa0034(_0x32def7);});});}
\ No newline at end of file
+var _0x323e=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','client','http','defaults','redis','localhost','./userNotification.socket','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x323e,0x16c));var _0xe323=function(_0x142c9c,_0x4cc49a){_0x142c9c=_0x142c9c-0x0;var _0x49c8f3=_0x323e[_0x142c9c];return _0x49c8f3;};'use strict';var _=require(_0xe323('0x0'));var util=require(_0xe323('0x1'));var moment=require(_0xe323('0x2'));var BPromise=require(_0xe323('0x3'));var rs=require(_0xe323('0x4'));var fs=require('fs');var Redis=require(_0xe323('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe323('0x6'))(_0xe323('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe323('0x8')][_0xe323('0x9')]({'port':0x232a});config['redis']=_[_0xe323('0xa')](config[_0xe323('0xb')],{'host':_0xe323('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe323('0xb')]));require(_0xe323('0xd'))['register'](socket);function respondWithRpcPromise(_0x2b8876,_0x342d97,_0x5e3ee6){return new BPromise(function(_0x23ce98,_0x499f58){return client[_0xe323('0xe')](_0x2b8876,_0x5e3ee6)[_0xe323('0xf')](function(_0x4df061){logger[_0xe323('0x10')](_0xe323('0x11'),_0x342d97,_0xe323('0x12'));logger['debug']('UserNotification,\x20%s,\x20%s,\x20%s',_0x342d97,_0xe323('0x12'),JSON[_0xe323('0x13')](_0x4df061));if(_0x4df061[_0xe323('0x14')]){if(_0x4df061[_0xe323('0x14')]['code']===0x1f4){logger[_0xe323('0x14')](_0xe323('0x11'),_0x342d97,_0x4df061['error']['message']);return _0x499f58(_0x4df061[_0xe323('0x14')]['message']);}logger[_0xe323('0x14')](_0xe323('0x11'),_0x342d97,_0x4df061[_0xe323('0x14')][_0xe323('0x15')]);return _0x23ce98(_0x4df061[_0xe323('0x14')]['message']);}else{logger[_0xe323('0x10')](_0xe323('0x11'),_0x342d97,_0xe323('0x12'));_0x23ce98(_0x4df061[_0xe323('0x16')][_0xe323('0x15')]);}})[_0xe323('0x17')](function(_0x4342fc){logger[_0xe323('0x14')](_0xe323('0x11'),_0x342d97,_0x4342fc);_0x499f58(_0x4342fc);});});}
\ No newline at end of file
index af94196..8d4311a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaec6=['userNotification:','./userNotification.events','remove','removeListener','register','length'];(function(_0x35d8f4,_0x45eee8){var _0x4e8db8=function(_0x4e2652){while(--_0x4e2652){_0x35d8f4['push'](_0x35d8f4['shift']());}};_0x4e8db8(++_0x45eee8);}(_0xaec6,0x145));var _0x6aec=function(_0x4bf37c,_0x5a1e4c){_0x4bf37c=_0x4bf37c-0x0;var _0x58215f=_0xaec6[_0x4bf37c];return _0x58215f;};'use strict';var UserNotificationEvents=require(_0x6aec('0x0'));var events=['save',_0x6aec('0x1'),'update'];function createListener(_0x30933d,_0x587ec1){return function(_0x504a83){_0x587ec1['emit'](_0x30933d,_0x504a83);};}function removeListener(_0x33212a,_0x43025e){return function(){UserNotificationEvents[_0x6aec('0x2')](_0x33212a,_0x43025e);};}exports[_0x6aec('0x3')]=function(_0x252b43){for(var _0x4b0d9b=0x0,_0x41011b=events[_0x6aec('0x4')];_0x4b0d9b<_0x41011b;_0x4b0d9b++){var _0xe0b110=events[_0x4b0d9b];var _0x5a1540=createListener(_0x6aec('0x5')+_0xe0b110,_0x252b43);UserNotificationEvents['on'](_0xe0b110,_0x5a1540);}};
\ No newline at end of file
+var _0x470b=['length','userNotification:','./userNotification.events','save','update','removeListener','register'];(function(_0x5aa102,_0x3924b4){var _0x5e9e04=function(_0x44ff8a){while(--_0x44ff8a){_0x5aa102['push'](_0x5aa102['shift']());}};_0x5e9e04(++_0x3924b4);}(_0x470b,0x1ec));var _0xb470=function(_0x465919,_0x130001){_0x465919=_0x465919-0x0;var _0x5f0418=_0x470b[_0x465919];return _0x5f0418;};'use strict';var UserNotificationEvents=require(_0xb470('0x0'));var events=[_0xb470('0x1'),'remove',_0xb470('0x2')];function createListener(_0x58b78f,_0x10a63e){return function(_0x284368){_0x10a63e['emit'](_0x58b78f,_0x284368);};}function removeListener(_0x6b8559,_0xbbe058){return function(){UserNotificationEvents[_0xb470('0x3')](_0x6b8559,_0xbbe058);};}exports[_0xb470('0x4')]=function(_0x1e6bd4){for(var _0x372cb9=0x0,_0x45bd95=events[_0xb470('0x5')];_0x372cb9<_0x45bd95;_0x372cb9++){var _0x246527=events[_0x372cb9];var _0x517f2b=createListener(_0xb470('0x6')+_0x246527,_0x1e6bd4);UserNotificationEvents['on'](_0x246527,_0x517f2b);}};
\ No newline at end of file
index 961350d..6531f04 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(_0x10dc6e,_0x2f9e4f){var _0x5b7cc7=function(_0x15dafc){while(--_0x15dafc){_0x10dc6e['push'](_0x10dc6e['shift']());}};_0x5b7cc7(++_0x2f9e4f);}(_0xe706,0xa3));var _0x6e70=function(_0x5659c0,_0x5f2532){_0x5659c0=_0x5659c0-0x0;var _0x36e3c0=_0xe706[_0x5659c0];return _0x36e3c0;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x77e18a,_0x2a2aa1){var _0x5a1b6b=function(_0x41ac83){while(--_0x41ac83){_0x77e18a['push'](_0x77e18a['shift']());}};_0x5a1b6b(++_0x2a2aa1);}(_0x70e0,0x17b));var _0x070e=function(_0x4a7035,_0x5c0827){_0x4a7035=_0x4a7035-0x0;var _0x1329c6=_0x70e0[_0x4a7035];return _0x1329c6;};'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 fa4b786..cae8bc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2c0=['sequelize','exports','INTEGER'];(function(_0x4ec69a,_0x2826de){var _0x280921=function(_0x57a021){while(--_0x57a021){_0x4ec69a['push'](_0x4ec69a['shift']());}};_0x280921(++_0x2826de);}(_0xf2c0,0xc0));var _0x0f2c=function(_0x5f2874,_0x240395){_0x5f2874=_0x5f2874-0x0;var _0x1ae96e=_0xf2c0[_0x5f2874];return _0x1ae96e;};'use strict';var Sequelize=require(_0x0f2c('0x0'));module[_0x0f2c('0x1')]={'penalty':{'type':Sequelize[_0x0f2c('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x1d40=['exports','INTEGER','sequelize'];(function(_0x5e5c24,_0x368a79){var _0x3557af=function(_0x1ffa54){while(--_0x1ffa54){_0x5e5c24['push'](_0x5e5c24['shift']());}};_0x3557af(++_0x368a79);}(_0x1d40,0xbc));var _0x01d4=function(_0x15cf11,_0x5a3678){_0x15cf11=_0x15cf11-0x0;var _0x3ed63f=_0x1d40[_0x15cf11];return _0x3ed63f;};'use strict';var Sequelize=require(_0x01d4('0x0'));module[_0x01d4('0x1')]={'penalty':{'type':Sequelize[_0x01d4('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index a8607f0..776e464 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2a4=['define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes'];(function(_0x2bd855,_0x9e4720){var _0x2d1a9f=function(_0x34406f){while(--_0x34406f){_0x2bd855['push'](_0x2bd855['shift']());}};_0x2d1a9f(++_0x9e4720);}(_0xc2a4,0x16f));var _0x4c2a=function(_0x281c78,_0x96561f){_0x281c78=_0x281c78-0x0;var _0x2c1a59=_0xc2a4[_0x281c78];return _0x2c1a59;};'use strict';var _=require(_0x4c2a('0x0'));var util=require(_0x4c2a('0x1'));var logger=require(_0x4c2a('0x2'))(_0x4c2a('0x3'));var moment=require(_0x4c2a('0x4'));var BPromise=require(_0x4c2a('0x5'));var rp=require(_0x4c2a('0x6'));var fs=require('fs');var path=require(_0x4c2a('0x7'));var rimraf=require(_0x4c2a('0x8'));var config=require(_0x4c2a('0x9'));var attributes=require(_0x4c2a('0xa'));module['exports']=function(_0x1cd816,_0x5aa960){return _0x1cd816[_0x4c2a('0xb')](_0x4c2a('0xc'),attributes,{'tableName':_0x4c2a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5cd4=['../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4fa278,_0x37c9d4){var _0x4b5321=function(_0x2d3bbf){while(--_0x2d3bbf){_0x4fa278['push'](_0x4fa278['shift']());}};_0x4b5321(++_0x37c9d4);}(_0x5cd4,0x110));var _0x45cd=function(_0xa4ac34,_0xc127b8){_0xa4ac34=_0xa4ac34-0x0;var _0x41da79=_0x5cd4[_0xa4ac34];return _0x41da79;};'use strict';var _=require(_0x45cd('0x0'));var util=require(_0x45cd('0x1'));var logger=require(_0x45cd('0x2'))(_0x45cd('0x3'));var moment=require(_0x45cd('0x4'));var BPromise=require(_0x45cd('0x5'));var rp=require(_0x45cd('0x6'));var fs=require('fs');var path=require(_0x45cd('0x7'));var rimraf=require('rimraf');var config=require(_0x45cd('0x8'));var attributes=require(_0x45cd('0x9'));module[_0x45cd('0xa')]=function(_0x5ec259,_0x5af276){return _0x5ec259[_0x45cd('0xb')](_0x45cd('0xc'),attributes,{'tableName':_0x45cd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 10506a9..85608ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82d5=['util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','request','then','info','debug','request\x20sent','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x4f61a1,_0x35820b){var _0xae8b64=function(_0x4f784c){while(--_0x4f784c){_0x4f61a1['push'](_0x4f61a1['shift']());}};_0xae8b64(++_0x35820b);}(_0x82d5,0x68));var _0x582d=function(_0x26474a,_0x3cfcfd){_0x26474a=_0x26474a-0x0;var _0x32e0e0=_0x82d5[_0x26474a];return _0x32e0e0;};'use strict';var _=require(_0x582d('0x0'));var util=require(_0x582d('0x1'));var moment=require(_0x582d('0x2'));var BPromise=require(_0x582d('0x3'));var rs=require(_0x582d('0x4'));var fs=require('fs');var Redis=require(_0x582d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x582d('0x6'))(_0x582d('0x7'));var config=require('../../config/environment');var jayson=require(_0x582d('0x8'));var client=jayson['client'][_0x582d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x539b1f,_0x18b1d8,_0x33a83b){return new BPromise(function(_0x5f3bd2,_0x1df0d5){return client[_0x582d('0xa')](_0x539b1f,_0x33a83b)[_0x582d('0xb')](function(_0x58bb32){logger[_0x582d('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x18b1d8,'request\x20sent');logger[_0x582d('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x18b1d8,_0x582d('0xe'),JSON['stringify'](_0x58bb32));if(_0x58bb32[_0x582d('0xf')]){if(_0x58bb32[_0x582d('0xf')][_0x582d('0x10')]===0x1f4){logger['error'](_0x582d('0x11'),_0x18b1d8,_0x58bb32['error'][_0x582d('0x12')]);return _0x1df0d5(_0x58bb32['error'][_0x582d('0x12')]);}logger['error'](_0x582d('0x11'),_0x18b1d8,_0x58bb32[_0x582d('0xf')][_0x582d('0x12')]);return _0x5f3bd2(_0x58bb32[_0x582d('0xf')]['message']);}else{logger[_0x582d('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x18b1d8,_0x582d('0xe'));_0x5f3bd2(_0x58bb32[_0x582d('0x13')][_0x582d('0x12')]);}})[_0x582d('0x14')](function(_0x544416){logger[_0x582d('0xf')](_0x582d('0x11'),_0x18b1d8,_0x544416);_0x1df0d5(_0x544416);});});}
\ No newline at end of file
+var _0x4009=['../../config/environment','jayson/promise','client','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger'];(function(_0x28b07e,_0xe2789c){var _0x30d84d=function(_0x4f79da){while(--_0x4f79da){_0x28b07e['push'](_0x28b07e['shift']());}};_0x30d84d(++_0xe2789c);}(_0x4009,0xa2));var _0x9400=function(_0xdb7afc,_0x587ab8){_0xdb7afc=_0xdb7afc-0x0;var _0x192f72=_0x4009[_0xdb7afc];return _0x192f72;};'use strict';var _=require(_0x9400('0x0'));var util=require(_0x9400('0x1'));var moment=require(_0x9400('0x2'));var BPromise=require(_0x9400('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9400('0x4'));var logger=require(_0x9400('0x5'))('rpc');var config=require(_0x9400('0x6'));var jayson=require(_0x9400('0x7'));var client=jayson[_0x9400('0x8')][_0x9400('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5187dd,_0x71648c,_0x2a0f9d){return new BPromise(function(_0xe5b66f,_0x3d4362){return client['request'](_0x5187dd,_0x2a0f9d)[_0x9400('0xa')](function(_0x3b73cc){logger[_0x9400('0xb')](_0x9400('0xc'),_0x71648c,_0x9400('0xd'));logger[_0x9400('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x71648c,_0x9400('0xd'),JSON[_0x9400('0xf')](_0x3b73cc));if(_0x3b73cc[_0x9400('0x10')]){if(_0x3b73cc[_0x9400('0x10')][_0x9400('0x11')]===0x1f4){logger[_0x9400('0x10')](_0x9400('0xc'),_0x71648c,_0x3b73cc[_0x9400('0x10')]['message']);return _0x3d4362(_0x3b73cc[_0x9400('0x10')][_0x9400('0x12')]);}logger['error'](_0x9400('0xc'),_0x71648c,_0x3b73cc[_0x9400('0x10')][_0x9400('0x12')]);return _0xe5b66f(_0x3b73cc[_0x9400('0x10')]['message']);}else{logger[_0x9400('0xb')](_0x9400('0xc'),_0x71648c,_0x9400('0xd'));_0xe5b66f(_0x3b73cc[_0x9400('0x13')][_0x9400('0x12')]);}})[_0x9400('0x14')](function(_0x4171ec){logger[_0x9400('0x10')](_0x9400('0xc'),_0x71648c,_0x4171ec);_0x3d4362(_0x4171ec);});});}
\ No newline at end of file
index 09d9a92..f10f752 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37b7=['./userProfile.controller','isAuthenticated','index','/describe','describe','get','/:id','getSections','/:id/resources','getResources','post','create','clone','/:id/sections','addSections','addResources','delete','destroy','removeSections','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2d7b63,_0x2851f8){var _0x49ad41=function(_0x579e8f){while(--_0x579e8f){_0x2d7b63['push'](_0x2d7b63['shift']());}};_0x49ad41(++_0x2851f8);}(_0x37b7,0x9a));var _0x737b=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x37b7[_0x24f31b];return _0x488401;};'use strict';var multer=require(_0x737b('0x0'));var util=require(_0x737b('0x1'));var path=require(_0x737b('0x2'));var timeout=require(_0x737b('0x3'));var express=require(_0x737b('0x4'));var router=express['Router']();var fs_extra=require(_0x737b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x737b('0x6'));var config=require(_0x737b('0x7'));var controller=require(_0x737b('0x8'));router['get']('/',auth[_0x737b('0x9')](),controller[_0x737b('0xa')]);router['get'](_0x737b('0xb'),auth[_0x737b('0x9')](),controller[_0x737b('0xc')]);router[_0x737b('0xd')](_0x737b('0xe'),auth[_0x737b('0x9')](),controller['show']);router[_0x737b('0xd')]('/:id/sections',auth[_0x737b('0x9')](),controller[_0x737b('0xf')]);router[_0x737b('0xd')](_0x737b('0x10'),auth[_0x737b('0x9')](),controller[_0x737b('0x11')]);router[_0x737b('0x12')]('/',auth[_0x737b('0x9')](),controller[_0x737b('0x13')]);router[_0x737b('0x12')]('/:id/clone',auth[_0x737b('0x9')](),controller[_0x737b('0x14')]);router[_0x737b('0x12')](_0x737b('0x15'),auth[_0x737b('0x9')](),controller[_0x737b('0x16')]);router['post'](_0x737b('0x10'),auth[_0x737b('0x9')](),controller[_0x737b('0x17')]);router['put'](_0x737b('0xe'),auth[_0x737b('0x9')](),controller['update']);router[_0x737b('0x18')](_0x737b('0xe'),auth[_0x737b('0x9')](),controller[_0x737b('0x19')]);router['delete'](_0x737b('0x15'),auth[_0x737b('0x9')](),controller[_0x737b('0x1a')]);router[_0x737b('0x18')](_0x737b('0x10'),auth['isAuthenticated'](),controller['removeResources']);module['exports']=router;
\ No newline at end of file
+var _0x9212=['/:id/clone','clone','addSections','addResources','put','delete','/:id','destroy','removeSections','removeResources','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','index','/describe','isAuthenticated','show','/:id/sections','getSections','/:id/resources','getResources','post'];(function(_0x7dc85,_0x53cd97){var _0x18af56=function(_0x394cc1){while(--_0x394cc1){_0x7dc85['push'](_0x7dc85['shift']());}};_0x18af56(++_0x53cd97);}(_0x9212,0x183));var _0x2921=function(_0x295a3d,_0x56d487){_0x295a3d=_0x295a3d-0x0;var _0x23a732=_0x9212[_0x295a3d];return _0x23a732;};'use strict';var multer=require(_0x2921('0x0'));var util=require('util');var path=require(_0x2921('0x1'));var timeout=require(_0x2921('0x2'));var express=require(_0x2921('0x3'));var router=express[_0x2921('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2921('0x5'));var interaction=require(_0x2921('0x6'));var config=require(_0x2921('0x7'));var controller=require(_0x2921('0x8'));router[_0x2921('0x9')]('/',auth['isAuthenticated'](),controller[_0x2921('0xa')]);router[_0x2921('0x9')](_0x2921('0xb'),auth[_0x2921('0xc')](),controller['describe']);router['get']('/:id',auth[_0x2921('0xc')](),controller[_0x2921('0xd')]);router[_0x2921('0x9')](_0x2921('0xe'),auth[_0x2921('0xc')](),controller[_0x2921('0xf')]);router[_0x2921('0x9')](_0x2921('0x10'),auth[_0x2921('0xc')](),controller[_0x2921('0x11')]);router['post']('/',auth[_0x2921('0xc')](),controller['create']);router[_0x2921('0x12')](_0x2921('0x13'),auth[_0x2921('0xc')](),controller[_0x2921('0x14')]);router[_0x2921('0x12')](_0x2921('0xe'),auth[_0x2921('0xc')](),controller[_0x2921('0x15')]);router[_0x2921('0x12')](_0x2921('0x10'),auth[_0x2921('0xc')](),controller[_0x2921('0x16')]);router[_0x2921('0x17')]('/:id',auth[_0x2921('0xc')](),controller['update']);router[_0x2921('0x18')](_0x2921('0x19'),auth[_0x2921('0xc')](),controller[_0x2921('0x1a')]);router['delete'](_0x2921('0xe'),auth[_0x2921('0xc')](),controller[_0x2921('0x1b')]);router[_0x2921('0x18')](_0x2921('0x10'),auth[_0x2921('0xc')](),controller[_0x2921('0x1c')]);module['exports']=router;
\ No newline at end of file
index f439283..19c58da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18c6=['exports','name','STRING','setDataValue','crudPermissions','join','getDataValue','BOOLEAN'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x18c6,0x100));var _0x618c=function(_0x2c255a,_0x480b62){_0x2c255a=_0x2c255a-0x0;var _0xb6545e=_0x18c6[_0x2c255a];return _0xb6545e;};'use strict';var Sequelize=require('sequelize');module[_0x618c('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x618c('0x1')},'crudPermissions':{'type':Sequelize[_0x618c('0x2')],'set':function(_0x5be9a4){this[_0x618c('0x3')](_0x618c('0x4'),_0x5be9a4?_0x5be9a4[_0x618c('0x5')](''):[]);},'get':function(){return this[_0x618c('0x6')]('crudPermissions')?this[_0x618c('0x6')](_0x618c('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x618c('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x618c('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x618c('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x618c('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x618c('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x618c('0x7')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x421b=['split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','crudPermissions','join','getDataValue'];(function(_0x1c6089,_0x3816e2){var _0x4d97c1=function(_0x3e631b){while(--_0x3e631b){_0x1c6089['push'](_0x1c6089['shift']());}};_0x4d97c1(++_0x3816e2);}(_0x421b,0x19c));var _0xb421=function(_0x3f5807,_0x53a079){_0x3f5807=_0x3f5807-0x0;var _0x368430=_0x421b[_0x3f5807];return _0x368430;};'use strict';var Sequelize=require(_0xb421('0x0'));module[_0xb421('0x1')]={'name':{'type':Sequelize[_0xb421('0x2')],'allowNull':![],'unique':_0xb421('0x3')},'crudPermissions':{'type':Sequelize[_0xb421('0x2')],'set':function(_0x416cdc){this[_0xb421('0x4')](_0xb421('0x5'),_0x416cdc?_0x416cdc[_0xb421('0x6')](''):[]);},'get':function(){return this[_0xb421('0x7')](_0xb421('0x5'))?this[_0xb421('0x7')]('crudPermissions')[_0xb421('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xb421('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xb421('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xb421('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xb421('0x9')],'defaultValue':!![]}};
\ No newline at end of file
index 70530ee..751325f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cf8=['UserProfileSection','autoAssociation','sectionId','userProfileId','UserProfileResource','Resources','describe','push','removeSections','ids','getSections','enabled','isEmpty','subsections','includes','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','UserProfile','include','findAll','catch','find','create','body','clone','params','includeAll','get','omit','updatedAt','crudPermissions','createdAt','sequelize','transaction'];(function(_0x58e519,_0x2233f9){var _0x54cc57=function(_0x1892e1){while(--_0x1892e1){_0x58e519['push'](_0x58e519['shift']());}};_0x54cc57(++_0x2233f9);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x28db4a,_0x6d6d5a){_0x28db4a=_0x28db4a-0x0;var _0x3bf87e=_0x4cf8[_0x28db4a];return _0x3bf87e;};'use strict';var emlformat=require(_0x84cf('0x0'));var rimraf=require(_0x84cf('0x1'));var zipdir=require(_0x84cf('0x2'));var jsonpatch=require(_0x84cf('0x3'));var rp=require(_0x84cf('0x4'));var moment=require(_0x84cf('0x5'));var BPromise=require(_0x84cf('0x6'));var Mustache=require(_0x84cf('0x7'));var util=require(_0x84cf('0x8'));var path=require(_0x84cf('0x9'));var sox=require(_0x84cf('0xa'));var csv=require(_0x84cf('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x84cf('0xc'));var squel=require('squel');var crypto=require(_0x84cf('0xd'));var jsforce=require(_0x84cf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x84cf('0xb'));var querystring=require(_0x84cf('0xf'));var Papa=require('papaparse');var Redis=require(_0x84cf('0x10'));var authService=require(_0x84cf('0x11'));var qs=require(_0x84cf('0x12'));var as=require(_0x84cf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x84cf('0x14'))(_0x84cf('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x84cf('0x16'));var db=require(_0x84cf('0x17'))['db'];config[_0x84cf('0x18')]=_[_0x84cf('0x19')](config[_0x84cf('0x18')],{'host':_0x84cf('0x1a'),'port':0x18eb});var socket=require(_0x84cf('0x1b'))(new Redis(config[_0x84cf('0x18')]));require(_0x84cf('0x1c'))[_0x84cf('0x1d')](socket);function respondWithStatusCode(_0x2fc41f,_0x385027){_0x385027=_0x385027||0xcc;return function(_0x7db8f){if(_0x7db8f){return _0x2fc41f[_0x84cf('0x1e')](_0x385027);}return _0x2fc41f[_0x84cf('0x1f')](_0x385027)[_0x84cf('0x20')]();};}function respondWithResult(_0x464e70,_0x240edf){_0x240edf=_0x240edf||0xc8;return function(_0xe12c7b){if(_0xe12c7b){return _0x464e70['status'](_0x240edf)[_0x84cf('0x21')](_0xe12c7b);}};}function respondWithFilteredResult(_0x5d6a93,_0xfa6641){return function(_0x1abe2d){if(_0x1abe2d){var _0x1dad1a=typeof _0xfa6641[_0x84cf('0x22')]===_0x84cf('0x23')&&typeof _0xfa6641['limit']==='undefined';var _0x42d6d4=_0x1abe2d[_0x84cf('0x24')];var _0x346b43=_0x1dad1a?0x0:_0xfa6641[_0x84cf('0x22')];var _0x219afa=_0x1dad1a?_0x1abe2d['count']:_0xfa6641[_0x84cf('0x22')]+_0xfa6641[_0x84cf('0x25')];var _0x3ca1be;if(_0x219afa>=_0x42d6d4){_0x219afa=_0x42d6d4;_0x3ca1be=0xc8;}else{_0x3ca1be=0xce;}_0x5d6a93[_0x84cf('0x1f')](_0x3ca1be);return _0x5d6a93[_0x84cf('0x26')]('Content-Range',_0x346b43+'-'+_0x219afa+'/'+_0x42d6d4)[_0x84cf('0x21')](_0x1abe2d);}return null;};}function patchUpdates(_0x160f86){return function(_0x475b19){try{jsonpatch[_0x84cf('0x27')](_0x475b19,_0x160f86,!![]);}catch(_0x3e5e94){return BPromise[_0x84cf('0x28')](_0x3e5e94);}return _0x475b19[_0x84cf('0x29')]();};}function saveUpdates(_0x4c9d1c,_0x2b2c90){return function(_0x26db3f){if(_0x26db3f){return _0x26db3f[_0x84cf('0x2a')](_0x4c9d1c)[_0x84cf('0x2b')](function(_0x1d220a){return _0x1d220a;});}return null;};}function removeEntity(_0x44d4bf,_0x3c7eda){return function(_0xa44c81){if(_0xa44c81){return _0xa44c81[_0x84cf('0x2c')]()[_0x84cf('0x2b')](function(){_0x44d4bf['status'](0xcc)[_0x84cf('0x20')]();});}};}function handleEntityNotFound(_0x17bc92,_0x2a4973){return function(_0x41a5db){if(!_0x41a5db){_0x17bc92['sendStatus'](0x194);}return _0x41a5db;};}function handleError(_0x1595dd,_0x5a428c){_0x5a428c=_0x5a428c||0x1f4;return function(_0x29455e){logger[_0x84cf('0x2d')](_0x29455e[_0x84cf('0x2e')]);if(_0x29455e[_0x84cf('0x2f')]){delete _0x29455e[_0x84cf('0x2f')];}_0x1595dd[_0x84cf('0x1f')](_0x5a428c)[_0x84cf('0x30')](_0x29455e);};}exports[_0x84cf('0x31')]=function(_0x1bfa56,_0xb4fc5a){var _0x31dbf5={},_0x308f8f={},_0x18243d={'count':0x0,'rows':[]};var _0x44f16e=_['map'](db['UserProfile'][_0x84cf('0x32')],function(_0x25de3a){return{'name':_0x25de3a[_0x84cf('0x33')],'type':_0x25de3a[_0x84cf('0x34')][_0x84cf('0x35')]};});_0x308f8f[_0x84cf('0x36')]=_[_0x84cf('0x37')](_0x44f16e,_0x84cf('0x2f'));_0x308f8f['query']=_[_0x84cf('0x38')](_0x1bfa56[_0x84cf('0x39')]);_0x308f8f['filters']=_[_0x84cf('0x3a')](_0x308f8f['model'],_0x308f8f[_0x84cf('0x39')]);_0x31dbf5[_0x84cf('0x3b')]=_[_0x84cf('0x3a')](_0x308f8f[_0x84cf('0x36')],qs[_0x84cf('0x3c')](_0x1bfa56['query'][_0x84cf('0x3c')]));_0x31dbf5['attributes']=_0x31dbf5['attributes'][_0x84cf('0x3d')]?_0x31dbf5[_0x84cf('0x3b')]:_0x308f8f['model'];if(!_0x1bfa56[_0x84cf('0x39')][_0x84cf('0x3e')](_0x84cf('0x3f'))){_0x31dbf5[_0x84cf('0x25')]=qs[_0x84cf('0x25')](_0x1bfa56[_0x84cf('0x39')]['limit']);_0x31dbf5[_0x84cf('0x22')]=qs[_0x84cf('0x22')](_0x1bfa56[_0x84cf('0x39')][_0x84cf('0x22')]);}_0x31dbf5[_0x84cf('0x40')]=qs[_0x84cf('0x41')](_0x1bfa56['query'][_0x84cf('0x41')]);_0x31dbf5['where']=qs[_0x84cf('0x42')](_[_0x84cf('0x43')](_0x1bfa56[_0x84cf('0x39')],_0x308f8f[_0x84cf('0x42')]),_0x44f16e);if(_0x1bfa56[_0x84cf('0x39')][_0x84cf('0x44')]){_0x31dbf5[_0x84cf('0x45')]=_[_0x84cf('0x46')](_0x31dbf5[_0x84cf('0x45')],{'$or':_['map'](_0x44f16e,function(_0x44e6f0){if(_0x44e6f0['type']!==_0x84cf('0x47')){var _0xc75386={};_0xc75386[_0x44e6f0['name']]={'$like':'%'+_0x1bfa56[_0x84cf('0x39')]['filter']+'%'};return _0xc75386;}})});}_0x31dbf5=_[_0x84cf('0x46')]({},_0x31dbf5,_0x1bfa56['options']);var _0x3fc160={'where':_0x31dbf5['where']};return db[_0x84cf('0x48')][_0x84cf('0x24')](_0x3fc160)['then'](function(_0x847ce9){_0x18243d[_0x84cf('0x24')]=_0x847ce9;if(_0x1bfa56[_0x84cf('0x39')]['includeAll']){_0x31dbf5[_0x84cf('0x49')]=[{'all':!![]}];}return db['UserProfile'][_0x84cf('0x4a')](_0x31dbf5);})['then'](function(_0x56b0e5){_0x18243d['rows']=_0x56b0e5;return _0x18243d;})[_0x84cf('0x2b')](respondWithFilteredResult(_0xb4fc5a,_0x31dbf5))[_0x84cf('0x4b')](handleError(_0xb4fc5a,null));};exports['show']=function(_0x2b737e,_0x56b623){var _0x191ad8={'raw':![],'where':{'id':_0x2b737e['params']['id']}},_0x3fe8c1={};_0x3fe8c1[_0x84cf('0x36')]=_['keys'](db[_0x84cf('0x48')]['rawAttributes']);_0x3fe8c1['query']=_['keys'](_0x2b737e['query']);_0x3fe8c1['filters']=_['intersection'](_0x3fe8c1['model'],_0x3fe8c1[_0x84cf('0x39')]);_0x191ad8[_0x84cf('0x3b')]=_[_0x84cf('0x3a')](_0x3fe8c1[_0x84cf('0x36')],qs['fields'](_0x2b737e[_0x84cf('0x39')]['fields']));_0x191ad8[_0x84cf('0x3b')]=_0x191ad8[_0x84cf('0x3b')][_0x84cf('0x3d')]?_0x191ad8[_0x84cf('0x3b')]:_0x3fe8c1[_0x84cf('0x36')];if(_0x2b737e[_0x84cf('0x39')]['includeAll']){_0x191ad8[_0x84cf('0x49')]=[{'all':!![]}];}_0x191ad8=_[_0x84cf('0x46')]({},_0x191ad8,_0x2b737e['options']);return db[_0x84cf('0x48')][_0x84cf('0x4c')](_0x191ad8)[_0x84cf('0x2b')](handleEntityNotFound(_0x56b623,null))['then'](respondWithResult(_0x56b623,null))['catch'](handleError(_0x56b623,null));};exports['create']=function(_0x1cf3f6,_0x104421){return db[_0x84cf('0x48')][_0x84cf('0x4d')](_0x1cf3f6[_0x84cf('0x4e')],{})[_0x84cf('0x2b')](respondWithResult(_0x104421,0xc9))['catch'](handleError(_0x104421,null));};exports[_0x84cf('0x4f')]=function(_0x55316e,_0x44b8b0){var _0x499225={'where':{'id':_0x55316e[_0x84cf('0x50')]['id']}},_0x4e7da3={};_0x4e7da3[_0x84cf('0x36')]=_[_0x84cf('0x38')](db['UserProfile']['rawAttributes']);_0x499225[_0x84cf('0x3b')]=_[_0x84cf('0x3a')](_0x4e7da3[_0x84cf('0x36')],qs[_0x84cf('0x3c')](_0x55316e[_0x84cf('0x39')]['fields']));_0x499225[_0x84cf('0x3b')]=_0x499225[_0x84cf('0x3b')]['length']?_0x499225[_0x84cf('0x3b')]:_0x4e7da3['model'];if(_0x55316e['query'][_0x84cf('0x51')]){_0x499225[_0x84cf('0x49')]=[{'all':!![]}];}_0x499225=_['merge']({},_0x499225,_0x55316e['options']);return db[_0x84cf('0x48')][_0x84cf('0x4c')](_0x499225)[_0x84cf('0x2b')](handleEntityNotFound(_0x44b8b0,null))[_0x84cf('0x2b')](function(_0x406c33){if(_0x406c33){var _0x3edaec=_0x406c33[_0x84cf('0x52')]({'plain':!![]});_0x3edaec=qs[_0x84cf('0x53')](_0x3edaec,['id','createdAt',_0x84cf('0x54'),_0x84cf('0x55')]);_0x55316e['body']=_['omit'](_0x55316e[_0x84cf('0x4e')],['id',_0x84cf('0x56'),_0x84cf('0x54')]);return db[_0x84cf('0x57')][_0x84cf('0x58')](function(_0xfec87d){return db[_0x84cf('0x48')]['create'](_[_0x84cf('0x46')](_0x3edaec,_0x55316e['body']),{'include':_0x55316e[_0x84cf('0x39')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0xfec87d})[_0x84cf('0x2b')](function(_0x1c2f1b){var _0x55d8c4=_0x1c2f1b[_0x84cf('0x52')]({'plain':!![]});return db[_0x84cf('0x59')]['findAll']({'where':{'userProfileId':_0x55316e[_0x84cf('0x50')]['id']},'raw':!![]})['then'](function(_0x577d55){if(_0x577d55){return BPromise['each'](_0x577d55,function(_0x50cde2){return new BPromise(function(_0x2007a6,_0x39394f){if(_0x50cde2[_0x84cf('0x5a')]===null||_0x50cde2[_0x84cf('0x5a')]===0x1)_0x2007a6(null);return db['UserProfileResource'][_0x84cf('0x4a')]({'where':{'sectionId':_0x50cde2['id']},'raw':!![]})[_0x84cf('0x2b')](function(_0x547478){var _0x2e0206=_[_0x84cf('0x37')](_0x547478,function(_0x3f4a9f){return qs[_0x84cf('0x53')](_0x3f4a9f,['id',_0x84cf('0x56'),_0x84cf('0x54'),_0x84cf('0x5b')]);});_0x2007a6(_0x2e0206);})[_0x84cf('0x4b')](function(_0x553ee2){_0x39394f(_0x553ee2);});})[_0x84cf('0x2b')](function(_0x58a96a){var _0x476bc3=qs[_0x84cf('0x53')](_0x50cde2,['id',_0x84cf('0x56'),_0x84cf('0x54')]);_0x476bc3[_0x84cf('0x5c')]=_0x55d8c4['id'];if(_0x58a96a)_0x476bc3['Resources']=_0x58a96a;return _0x476bc3;})[_0x84cf('0x2b')](function(_0x41ee7a){return db[_0x84cf('0x59')]['create'](_0x41ee7a,{'include':[{'model':db[_0x84cf('0x5d')],'as':_0x84cf('0x5e')}],'raw':!![],'transaction':_0xfec87d});});})['then'](function(){return _0x55d8c4;});}});});});}})[_0x84cf('0x2b')](respondWithResult(_0x44b8b0,0xc9))['catch'](handleError(_0x44b8b0,null));};exports[_0x84cf('0x2a')]=function(_0x30aa60,_0x57f1f2){if(_0x30aa60[_0x84cf('0x4e')]['id']){delete _0x30aa60[_0x84cf('0x4e')]['id'];}return db['UserProfile'][_0x84cf('0x4c')]({'where':{'id':_0x30aa60[_0x84cf('0x50')]['id']}})[_0x84cf('0x2b')](handleEntityNotFound(_0x57f1f2,null))[_0x84cf('0x2b')](saveUpdates(_0x30aa60['body'],null))[_0x84cf('0x2b')](respondWithResult(_0x57f1f2,null))[_0x84cf('0x4b')](handleError(_0x57f1f2,null));};exports['destroy']=function(_0x553ced,_0x4d40e2){return db[_0x84cf('0x48')][_0x84cf('0x4c')]({'where':{'id':_0x553ced[_0x84cf('0x50')]['id']}})['then'](handleEntityNotFound(_0x4d40e2,null))['then'](removeEntity(_0x4d40e2,null))[_0x84cf('0x4b')](handleError(_0x4d40e2,null));};exports[_0x84cf('0x5f')]=function(_0xa17c6c,_0x2ef504){return db[_0x84cf('0x48')][_0x84cf('0x5f')]()[_0x84cf('0x2b')](respondWithResult(_0x2ef504,null))[_0x84cf('0x4b')](handleError(_0x2ef504,null));};exports['addSections']=function(_0x20b930,_0x5350d9){var _0x20f0f4=_0x20b930[_0x84cf('0x4e')];return db['UserProfile']['find']({'where':{'id':_0x20b930[_0x84cf('0x50')]['id']}})[_0x84cf('0x2b')](handleEntityNotFound(_0x5350d9,null))[_0x84cf('0x2b')](function(_0x1c6e56){if(_0x1c6e56){return db[_0x84cf('0x57')]['transaction'](function(_0x29e2c2){return db[_0x84cf('0x59')][_0x84cf('0x2c')]({'where':{'userProfileId':_0x20b930[_0x84cf('0x50')]['id'],'sectionId':_['map'](_0x20f0f4,function(_0x93d687){return _0x93d687['sectionId'];})},'transaction':_0x29e2c2})['then'](function(){var _0x59cb20=_[_0x84cf('0x37')](_0x20f0f4,function(_0xf90fd){_0xf90fd[_0x84cf('0x5c')]=_0x20b930['params']['id'];return _0xf90fd;});var _0x5c8e79=[];return BPromise['each'](_0x59cb20,function(_0x1df8e2){return db['UserProfileSection'][_0x84cf('0x4d')](_0x1df8e2,{'include':[{'model':db[_0x84cf('0x5d')],'as':_0x84cf('0x5e')}],'raw':!![],'transaction':_0x29e2c2})[_0x84cf('0x2b')](function(_0x5b7250){_0x5c8e79[_0x84cf('0x60')](_0x5b7250[_0x84cf('0x52')]({'plain':!![]}));});})['then'](function(){return _0x5c8e79;});});});}})[_0x84cf('0x2b')](function(_0x491897){return _0x491897;})['then'](respondWithResult(_0x5350d9,null))[_0x84cf('0x4b')](handleError(_0x5350d9,null));};exports[_0x84cf('0x61')]=function(_0x5e3bd3,_0x5b95b7){var _0x122f08;return db['UserProfile']['find']({'where':{'id':_0x5e3bd3['params']['id']},'attributes':['id',_0x84cf('0x2f')]})[_0x84cf('0x2b')](handleEntityNotFound(_0x5b95b7,null))[_0x84cf('0x2b')](function(_0x58300f){if(_0x58300f){_0x122f08=_0x58300f;return db['UserProfileSection'][_0x84cf('0x2c')]({'where':{'userProfileId':_0x5e3bd3[_0x84cf('0x50')]['id'],'sectionId':_0x5e3bd3[_0x84cf('0x39')][_0x84cf('0x62')]}});}})['then'](function(){return _0x122f08;})['then'](respondWithStatusCode(_0x5b95b7,null))['catch'](handleError(_0x5b95b7,null));};exports[_0x84cf('0x63')]=function(_0x5ab49,_0x1bc31e){var _0x4fc2f2=[];var _0x20693f=[];return db[_0x84cf('0x59')][_0x84cf('0x4a')]({'where':{'userProfileId':_0x5ab49[_0x84cf('0x50')]['id']},'raw':!![]})[_0x84cf('0x2b')](function(_0x4c0461){_0x4fc2f2=_[_0x84cf('0x44')](_0x4c0461,function(_0x34cf7a){return _0x34cf7a[_0x84cf('0x64')]===0x1||_['includes']([0x3eb,0x709],_0x34cf7a[_0x84cf('0x5b')]);});if(!_[_0x84cf('0x65')](_0x4fc2f2)){return _['map'](_0x4fc2f2,function(_0x2f7c83){return _0x2f7c83[_0x84cf('0x5b')];});}else{return;}})[_0x84cf('0x2b')](function(_0x132210){if(_0x132210)_0x20693f=_0x132210;if(_['includes'](_0x20693f,0x64)){var _0x4f1fbb=_[_0x84cf('0x4c')](_0x4fc2f2,{'sectionId':0x64});return hasDefaultDashboard(_0x4f1fbb)[_0x84cf('0x2b')](function(_0x4f4326){return _['map'](_0x4fc2f2,function(_0xaed94a){if(_0xaed94a[_0x84cf('0x5b')]===0x64){_0xaed94a[_0x84cf('0x66')]=_0x4f4326;}return _0xaed94a;});});}else{return;}})[_0x84cf('0x2b')](function(_0xf40f73){if(_0xf40f73)_0x4fc2f2=_0xf40f73;if(_[_0x84cf('0x67')](_0x20693f,0x3eb)){var _0xf861b3=_[_0x84cf('0x4c')](_0x4fc2f2,{'sectionId':0x3eb});return getCustomDashboards(_0xf861b3)['then'](function(_0x377cbe){return _[_0x84cf('0x37')](_0x4fc2f2,function(_0x1f7ecd){if(_0xf861b3[_0x84cf('0x64')]){if(_0x1f7ecd[_0x84cf('0x5b')]===0x3eb){_0x1f7ecd[_0x84cf('0x66')]=_0x377cbe;}}else{if(_0x1f7ecd['sectionId']===0x64){_0x1f7ecd[_0x84cf('0x66')]=_0x377cbe;}}return _0x1f7ecd;});});}else{return;}})['then'](function(_0x105875){if(_0x105875)_0x4fc2f2=_0x105875;if(_[_0x84cf('0x67')](_0x20693f,0x709)){var _0x22c846=_[_0x84cf('0x4c')](_0x4fc2f2,{'sectionId':0x709});return getPlugins(_0x22c846)[_0x84cf('0x2b')](function(_0x5ae765){if(_0x22c846[_0x84cf('0x64')]){return _[_0x84cf('0x37')](_0x4fc2f2,function(_0x7646c6){if(_0x7646c6[_0x84cf('0x5b')]===0x709){_0x7646c6[_0x84cf('0x66')]=_0x5ae765;}return _0x7646c6;});}else{var _0x42e63b={'sectionId':0x76c,'enabled':0x1,'subsections':_0x5ae765};var _0x213043=_[_0x84cf('0x37')](_0x4fc2f2);_0x213043[_0x84cf('0x60')](_0x42e63b);return _0x213043;}});}else{return;}})[_0x84cf('0x2b')](function(_0x423fba){if(_0x423fba)_0x4fc2f2=_0x423fba;return _[_0x84cf('0x44')](_0x4fc2f2,[_0x84cf('0x64'),0x1]);})[_0x84cf('0x2b')](respondWithResult(_0x1bc31e,null))[_0x84cf('0x4b')](handleError(_0x1bc31e,null));};function hasDefaultDashboard(_0x4dab7b){var _0x3996a6=[0x65];return new BPromise(function(_0x23ea59,_0x5a99c5){try{if(_0x4dab7b['autoAssociation']){_0x23ea59(_0x3996a6);}else{return db[_0x84cf('0x5d')]['findOne']({'where':{'sectionId':_0x4dab7b['id']},'raw':!![]})[_0x84cf('0x2b')](function(_0x140d99){_0x140d99?_0x23ea59(_0x3996a6):_0x23ea59();});}}catch(_0x5c86ab){_0x5a99c5(_0x5c86ab);}});}function getCustomDashboards(_0x39f78a){var _0x413a6f=[];return new BPromise(function(_0x3b8c8d,_0x5db0c4){try{if(_0x39f78a[_0x84cf('0x5a')]){return db['Dashboard'][_0x84cf('0x4a')]({'raw':!![]})['then'](function(_0x33ab96){_0x33ab96[_0x84cf('0x68')](function(_0x5cac87){_0x413a6f[_0x84cf('0x60')](_0x5cac87['id']+0x1869f);});_0x3b8c8d(_0x413a6f);});}else{return db[_0x84cf('0x5d')][_0x84cf('0x4a')]({'where':{'sectionId':_0x39f78a['id']},'raw':!![]})['then'](function(_0x35274a){_0x35274a['forEach'](function(_0x738f05){_0x413a6f[_0x84cf('0x60')](_0x738f05[_0x84cf('0x69')]+0x1869f);});_0x3b8c8d(_0x413a6f);});}}catch(_0xff46d2){_0x5db0c4(_0xff46d2);}});}function getPlugins(_0x3150aa){var _0x44615b=[];return new BPromise(function(_0x480815,_0x42429b){try{if(_0x3150aa[_0x84cf('0x5a')]){return db[_0x84cf('0x6a')][_0x84cf('0x4a')]({'raw':!![]})[_0x84cf('0x2b')](function(_0x3efd3a){_0x3efd3a[_0x84cf('0x68')](function(_0x259270){_0x44615b[_0x84cf('0x60')](_0x259270['id']+0x15b38);});_0x480815(_0x44615b);});}else{return db['UserProfileResource'][_0x84cf('0x4a')]({'where':{'sectionId':_0x3150aa['id']},'raw':!![]})['then'](function(_0x5b516a){_0x5b516a[_0x84cf('0x68')](function(_0x303983){_0x44615b['push'](_0x303983[_0x84cf('0x69')]+0x15b38);});_0x480815(_0x44615b);});}}catch(_0x1def45){_0x42429b(_0x1def45);}});}exports[_0x84cf('0x6b')]=function(_0x4dad47,_0x3152c2){return db['UserProfile'][_0x84cf('0x4c')]({'where':{'id':_0x4dad47[_0x84cf('0x50')]['id']}})[_0x84cf('0x2b')](handleEntityNotFound(_0x3152c2,null))[_0x84cf('0x2b')](function(_0x184206){if(_0x184206){return db[_0x84cf('0x57')]['transaction'](function(_0x326492){return db[_0x84cf('0x59')][_0x84cf('0x4a')]({'where':{'userProfileId':_0x4dad47[_0x84cf('0x50')]['id']},'attributes':['id'],'raw':!![]})[_0x84cf('0x2b')](function(_0x153680){if(_0x153680){return db[_0x84cf('0x59')][_0x84cf('0x2c')]({'where':{'userProfileId':_0x4dad47[_0x84cf('0x50')]['id'],'id':_[_0x84cf('0x37')](_0x153680,function(_0x53330c){return _0x53330c['id'];})},'transaction':_0x326492});}})['then'](function(_0x411109){var _0x5e9fac=_[_0x84cf('0x37')](_0x4dad47[_0x84cf('0x4e')],function(_0xfbc67a){_0xfbc67a['userProfileId']=_0x4dad47[_0x84cf('0x50')]['id'];return _0xfbc67a;});return db[_0x84cf('0x59')][_0x84cf('0x6c')](_0x5e9fac,{'raw':!![],'transaction':_0x326492});})[_0x84cf('0x2b')](function(_0x550b7b){var _0x55f5f5=_[_0x84cf('0x44')](_[_0x84cf('0x37')](_0x550b7b,function(_0x3ae065){return _0x3ae065[_0x84cf('0x52')]({'plain':!![]});}),{'includeAll':![]});if(_0x55f5f5){return db[_0x84cf('0x59')][_0x84cf('0x4a')]({'where':{'userProfileId':_0x4dad47[_0x84cf('0x50')]['id'],'sectionId':_[_0x84cf('0x37')](_0x55f5f5,function(_0x127085){return _0x127085[_0x84cf('0x5b')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x84cf('0x2b')](function(_0x272b45){var _0x543607=_['map'](_0x4dad47[_0x84cf('0x4e')],function(_0x957b94){_0x957b94[_0x84cf('0x5c')]=_0x4dad47[_0x84cf('0x50')]['id'];return _0x957b94;});return db[_0x84cf('0x5d')]['bulkCreate'](_0x543607,{'raw':!![],'transaction':_0x326492});});}})[_0x84cf('0x4b')](handleError(_0x3152c2,null));});}})[_0x84cf('0x2b')](function(_0x3a2628){var _0x108600=_[_0x84cf('0x37')](_0x3a2628,function(_0xc296a3){return _0xc296a3['get']({'plain':!![]});});})[_0x84cf('0x2b')](respondWithResult(_0x3152c2,null))[_0x84cf('0x4b')](handleError(_0x3152c2,null));};exports['removeResources']=function(_0x4a2992,_0x20851f,_0x55eac2){return db[_0x84cf('0x48')]['find']({'where':{'id':_0x4a2992[_0x84cf('0x50')]['id']}})[_0x84cf('0x2b')](handleEntityNotFound(_0x20851f,null))[_0x84cf('0x2b')](function(_0x4a4eb5){if(_0x4a4eb5){return _0x4a4eb5[_0x84cf('0x6d')](_0x4a2992[_0x84cf('0x39')][_0x84cf('0x62')]);}})['then'](respondWithStatusCode(_0x20851f,null))[_0x84cf('0x4b')](handleError(_0x20851f,null));};exports[_0x84cf('0x6e')]=function(_0x27492c,_0x1c2750){var _0x312bb5={};if(!_0x27492c['query'][_0x84cf('0x6f')])throw new Error(_0x84cf('0x70'));if(!_0x27492c['query'][_0x84cf('0x3e')](_0x84cf('0x3f'))){_0x312bb5[_0x84cf('0x25')]=qs[_0x84cf('0x25')](_0x27492c[_0x84cf('0x39')][_0x84cf('0x25')]);_0x312bb5['offset']=qs[_0x84cf('0x22')](_0x27492c[_0x84cf('0x39')][_0x84cf('0x22')]);}return db[_0x84cf('0x48')][_0x84cf('0x4c')]({'where':{'id':_0x27492c[_0x84cf('0x50')]['id']}})[_0x84cf('0x2b')](function(_0x1a083d){if(!_0x1a083d)throw new Error(_0x84cf('0x71')+_0x27492c[_0x84cf('0x50')]['id']);return db['UserProfile'][_0x84cf('0x6e')](_0x27492c);})[_0x84cf('0x2b')](respondWithFilteredResult(_0x1c2750,_0x312bb5))[_0x84cf('0x4b')](handleError(_0x1c2750,null));};
\ No newline at end of file
+var _0xf963=['filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','find','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','transaction','UserProfileSection','findAll','each','autoAssociation','UserProfileResource','sectionId','Resources','update','destroy','describe','addSections','sequelize','userProfileId','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./userProfile.socket','status','offset','undefined','limit','count','set','json','apply','reject','save','then','end','sendStatus','error','name','send','map','UserProfile','rawAttributes','fieldName','type','key','model','keys'];(function(_0xd6df5e,_0x4a4e46){var _0x155b12=function(_0x368fb6){while(--_0x368fb6){_0xd6df5e['push'](_0xd6df5e['shift']());}};_0x155b12(++_0x4a4e46);}(_0xf963,0x11d));var _0x3f96=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xf963[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0x3f96('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3f96('0x1'));var rp=require(_0x3f96('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3f96('0x3'));var util=require(_0x3f96('0x4'));var path=require(_0x3f96('0x5'));var sox=require(_0x3f96('0x6'));var csv=require('to-csv');var ejs=require(_0x3f96('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3f96('0x8'));var squel=require(_0x3f96('0x9'));var crypto=require(_0x3f96('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3f96('0xb'));var toCsv=require(_0x3f96('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3f96('0xd'));var as=require(_0x3f96('0xe'));var hardwareService=require(_0x3f96('0xf'));var logger=require(_0x3f96('0x10'))(_0x3f96('0x11'));var utils=require('../../config/utils');var config=require(_0x3f96('0x12'));var licenseUtil=require(_0x3f96('0x13'));var db=require(_0x3f96('0x14'))['db'];config[_0x3f96('0x15')]=_['defaults'](config[_0x3f96('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x3f96('0x16'))(new Redis(config[_0x3f96('0x15')]));require(_0x3f96('0x17'))['register'](socket);function respondWithStatusCode(_0x2f6d1f,_0x4e43df){_0x4e43df=_0x4e43df||0xcc;return function(_0x11aa28){if(_0x11aa28){return _0x2f6d1f['sendStatus'](_0x4e43df);}return _0x2f6d1f['status'](_0x4e43df)['end']();};}function respondWithResult(_0x39a994,_0x333dc0){_0x333dc0=_0x333dc0||0xc8;return function(_0x446973){if(_0x446973){return _0x39a994[_0x3f96('0x18')](_0x333dc0)['json'](_0x446973);}};}function respondWithFilteredResult(_0x234a34,_0xbd3f07){return function(_0x36de2a){if(_0x36de2a){var _0x4ffc54=typeof _0xbd3f07[_0x3f96('0x19')]===_0x3f96('0x1a')&&typeof _0xbd3f07[_0x3f96('0x1b')]==='undefined';var _0x231ad4=_0x36de2a[_0x3f96('0x1c')];var _0x3be03b=_0x4ffc54?0x0:_0xbd3f07[_0x3f96('0x19')];var _0x378e84=_0x4ffc54?_0x36de2a[_0x3f96('0x1c')]:_0xbd3f07['offset']+_0xbd3f07[_0x3f96('0x1b')];var _0x5390e6;if(_0x378e84>=_0x231ad4){_0x378e84=_0x231ad4;_0x5390e6=0xc8;}else{_0x5390e6=0xce;}_0x234a34[_0x3f96('0x18')](_0x5390e6);return _0x234a34[_0x3f96('0x1d')]('Content-Range',_0x3be03b+'-'+_0x378e84+'/'+_0x231ad4)[_0x3f96('0x1e')](_0x36de2a);}return null;};}function patchUpdates(_0x4ea64c){return function(_0x5a04e1){try{jsonpatch[_0x3f96('0x1f')](_0x5a04e1,_0x4ea64c,!![]);}catch(_0x3bde31){return BPromise[_0x3f96('0x20')](_0x3bde31);}return _0x5a04e1[_0x3f96('0x21')]();};}function saveUpdates(_0x348e6f,_0x446a2){return function(_0x286cdf){if(_0x286cdf){return _0x286cdf['update'](_0x348e6f)['then'](function(_0x39cccc){return _0x39cccc;});}return null;};}function removeEntity(_0x4e6955,_0x549289){return function(_0x34b9a2){if(_0x34b9a2){return _0x34b9a2['destroy']()[_0x3f96('0x22')](function(){_0x4e6955['status'](0xcc)[_0x3f96('0x23')]();});}};}function handleEntityNotFound(_0x3a392e,_0x29afd5){return function(_0x3cba14){if(!_0x3cba14){_0x3a392e[_0x3f96('0x24')](0x194);}return _0x3cba14;};}function handleError(_0x2d91fc,_0x532862){_0x532862=_0x532862||0x1f4;return function(_0x45616d){logger[_0x3f96('0x25')](_0x45616d['stack']);if(_0x45616d[_0x3f96('0x26')]){delete _0x45616d[_0x3f96('0x26')];}_0x2d91fc['status'](_0x532862)[_0x3f96('0x27')](_0x45616d);};}exports['index']=function(_0x3a175b,_0x4fd850){var _0xdf260b={},_0x4646d8={},_0x10035a={'count':0x0,'rows':[]};var _0xa2b132=_[_0x3f96('0x28')](db[_0x3f96('0x29')][_0x3f96('0x2a')],function(_0x1ef5c7){return{'name':_0x1ef5c7[_0x3f96('0x2b')],'type':_0x1ef5c7[_0x3f96('0x2c')][_0x3f96('0x2d')]};});_0x4646d8[_0x3f96('0x2e')]=_[_0x3f96('0x28')](_0xa2b132,'name');_0x4646d8['query']=_[_0x3f96('0x2f')](_0x3a175b['query']);_0x4646d8[_0x3f96('0x30')]=_[_0x3f96('0x31')](_0x4646d8['model'],_0x4646d8[_0x3f96('0x32')]);_0xdf260b['attributes']=_[_0x3f96('0x31')](_0x4646d8['model'],qs[_0x3f96('0x33')](_0x3a175b[_0x3f96('0x32')]['fields']));_0xdf260b[_0x3f96('0x34')]=_0xdf260b['attributes'][_0x3f96('0x35')]?_0xdf260b['attributes']:_0x4646d8[_0x3f96('0x2e')];if(!_0x3a175b[_0x3f96('0x32')][_0x3f96('0x36')](_0x3f96('0x37'))){_0xdf260b[_0x3f96('0x1b')]=qs['limit'](_0x3a175b[_0x3f96('0x32')][_0x3f96('0x1b')]);_0xdf260b[_0x3f96('0x19')]=qs[_0x3f96('0x19')](_0x3a175b[_0x3f96('0x32')][_0x3f96('0x19')]);}_0xdf260b['order']=qs[_0x3f96('0x38')](_0x3a175b[_0x3f96('0x32')]['sort']);_0xdf260b[_0x3f96('0x39')]=qs[_0x3f96('0x30')](_[_0x3f96('0x3a')](_0x3a175b[_0x3f96('0x32')],_0x4646d8['filters']),_0xa2b132);if(_0x3a175b[_0x3f96('0x32')][_0x3f96('0x3b')]){_0xdf260b['where']=_[_0x3f96('0x3c')](_0xdf260b['where'],{'$or':_['map'](_0xa2b132,function(_0xc5d667){if(_0xc5d667[_0x3f96('0x2c')]!==_0x3f96('0x3d')){var _0x54a657={};_0x54a657[_0xc5d667[_0x3f96('0x26')]]={'$like':'%'+_0x3a175b[_0x3f96('0x32')]['filter']+'%'};return _0x54a657;}})});}_0xdf260b=_[_0x3f96('0x3c')]({},_0xdf260b,_0x3a175b[_0x3f96('0x3e')]);var _0x10dfa8={'where':_0xdf260b['where']};return db[_0x3f96('0x29')][_0x3f96('0x1c')](_0x10dfa8)[_0x3f96('0x22')](function(_0x3fc338){_0x10035a[_0x3f96('0x1c')]=_0x3fc338;if(_0x3a175b['query'][_0x3f96('0x3f')]){_0xdf260b[_0x3f96('0x40')]=[{'all':!![]}];}return db[_0x3f96('0x29')]['findAll'](_0xdf260b);})['then'](function(_0x5e3ee8){_0x10035a[_0x3f96('0x41')]=_0x5e3ee8;return _0x10035a;})[_0x3f96('0x22')](respondWithFilteredResult(_0x4fd850,_0xdf260b))[_0x3f96('0x42')](handleError(_0x4fd850,null));};exports['show']=function(_0x466b95,_0x597561){var _0x1566ff={'raw':![],'where':{'id':_0x466b95[_0x3f96('0x43')]['id']}},_0x2fc7f7={};_0x2fc7f7[_0x3f96('0x2e')]=_[_0x3f96('0x2f')](db[_0x3f96('0x29')][_0x3f96('0x2a')]);_0x2fc7f7[_0x3f96('0x32')]=_[_0x3f96('0x2f')](_0x466b95[_0x3f96('0x32')]);_0x2fc7f7[_0x3f96('0x30')]=_[_0x3f96('0x31')](_0x2fc7f7[_0x3f96('0x2e')],_0x2fc7f7[_0x3f96('0x32')]);_0x1566ff['attributes']=_[_0x3f96('0x31')](_0x2fc7f7[_0x3f96('0x2e')],qs[_0x3f96('0x33')](_0x466b95['query'][_0x3f96('0x33')]));_0x1566ff[_0x3f96('0x34')]=_0x1566ff[_0x3f96('0x34')]['length']?_0x1566ff[_0x3f96('0x34')]:_0x2fc7f7[_0x3f96('0x2e')];if(_0x466b95[_0x3f96('0x32')][_0x3f96('0x3f')]){_0x1566ff[_0x3f96('0x40')]=[{'all':!![]}];}_0x1566ff=_[_0x3f96('0x3c')]({},_0x1566ff,_0x466b95[_0x3f96('0x3e')]);return db[_0x3f96('0x29')][_0x3f96('0x44')](_0x1566ff)[_0x3f96('0x22')](handleEntityNotFound(_0x597561,null))['then'](respondWithResult(_0x597561,null))['catch'](handleError(_0x597561,null));};exports[_0x3f96('0x45')]=function(_0x1ebafd,_0x70d122){return db[_0x3f96('0x29')]['create'](_0x1ebafd[_0x3f96('0x46')],{})[_0x3f96('0x22')](respondWithResult(_0x70d122,0xc9))[_0x3f96('0x42')](handleError(_0x70d122,null));};exports[_0x3f96('0x47')]=function(_0x245099,_0x53abaa){var _0x2e93fb={'where':{'id':_0x245099[_0x3f96('0x43')]['id']}},_0x280100={};_0x280100['model']=_['keys'](db['UserProfile'][_0x3f96('0x2a')]);_0x2e93fb[_0x3f96('0x34')]=_[_0x3f96('0x31')](_0x280100['model'],qs[_0x3f96('0x33')](_0x245099['query'][_0x3f96('0x33')]));_0x2e93fb[_0x3f96('0x34')]=_0x2e93fb[_0x3f96('0x34')][_0x3f96('0x35')]?_0x2e93fb['attributes']:_0x280100[_0x3f96('0x2e')];if(_0x245099['query']['includeAll']){_0x2e93fb[_0x3f96('0x40')]=[{'all':!![]}];}_0x2e93fb=_['merge']({},_0x2e93fb,_0x245099[_0x3f96('0x3e')]);return db[_0x3f96('0x29')][_0x3f96('0x44')](_0x2e93fb)['then'](handleEntityNotFound(_0x53abaa,null))[_0x3f96('0x22')](function(_0x3b3826){if(_0x3b3826){var _0x2ce8fe=_0x3b3826[_0x3f96('0x48')]({'plain':!![]});_0x2ce8fe=qs[_0x3f96('0x49')](_0x2ce8fe,['id',_0x3f96('0x4a'),_0x3f96('0x4b'),_0x3f96('0x4c')]);_0x245099[_0x3f96('0x46')]=_['omit'](_0x245099[_0x3f96('0x46')],['id',_0x3f96('0x4a'),_0x3f96('0x4b')]);return db['sequelize'][_0x3f96('0x4d')](function(_0x5cf15f){return db[_0x3f96('0x29')]['create'](_[_0x3f96('0x3c')](_0x2ce8fe,_0x245099['body']),{'include':_0x245099[_0x3f96('0x32')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x5cf15f})[_0x3f96('0x22')](function(_0x555c9a){var _0x32a7e5=_0x555c9a[_0x3f96('0x48')]({'plain':!![]});return db[_0x3f96('0x4e')][_0x3f96('0x4f')]({'where':{'userProfileId':_0x245099[_0x3f96('0x43')]['id']},'raw':!![]})[_0x3f96('0x22')](function(_0x4090d9){if(_0x4090d9){return BPromise[_0x3f96('0x50')](_0x4090d9,function(_0x3670fe){return new BPromise(function(_0x3137dc,_0x50bf95){if(_0x3670fe[_0x3f96('0x51')]===null||_0x3670fe['autoAssociation']===0x1)_0x3137dc(null);return db[_0x3f96('0x52')][_0x3f96('0x4f')]({'where':{'sectionId':_0x3670fe['id']},'raw':!![]})['then'](function(_0x2bc87e){var _0x2d90c8=_[_0x3f96('0x28')](_0x2bc87e,function(_0x14d5e5){return qs[_0x3f96('0x49')](_0x14d5e5,['id',_0x3f96('0x4a'),'updatedAt',_0x3f96('0x53')]);});_0x3137dc(_0x2d90c8);})['catch'](function(_0x1b1690){_0x50bf95(_0x1b1690);});})[_0x3f96('0x22')](function(_0x5dfac7){var _0x4b2002=qs['omit'](_0x3670fe,['id','createdAt',_0x3f96('0x4b')]);_0x4b2002['userProfileId']=_0x32a7e5['id'];if(_0x5dfac7)_0x4b2002[_0x3f96('0x54')]=_0x5dfac7;return _0x4b2002;})['then'](function(_0xd02544){return db[_0x3f96('0x4e')][_0x3f96('0x45')](_0xd02544,{'include':[{'model':db[_0x3f96('0x52')],'as':_0x3f96('0x54')}],'raw':!![],'transaction':_0x5cf15f});});})[_0x3f96('0x22')](function(){return _0x32a7e5;});}});});});}})[_0x3f96('0x22')](respondWithResult(_0x53abaa,0xc9))[_0x3f96('0x42')](handleError(_0x53abaa,null));};exports[_0x3f96('0x55')]=function(_0xf0c36,_0x1ede6c){if(_0xf0c36[_0x3f96('0x46')]['id']){delete _0xf0c36[_0x3f96('0x46')]['id'];}return db['UserProfile'][_0x3f96('0x44')]({'where':{'id':_0xf0c36[_0x3f96('0x43')]['id']}})[_0x3f96('0x22')](handleEntityNotFound(_0x1ede6c,null))['then'](saveUpdates(_0xf0c36['body'],null))[_0x3f96('0x22')](respondWithResult(_0x1ede6c,null))[_0x3f96('0x42')](handleError(_0x1ede6c,null));};exports[_0x3f96('0x56')]=function(_0x3a9e81,_0x460879){return db[_0x3f96('0x29')][_0x3f96('0x44')]({'where':{'id':_0x3a9e81[_0x3f96('0x43')]['id']}})[_0x3f96('0x22')](handleEntityNotFound(_0x460879,null))[_0x3f96('0x22')](removeEntity(_0x460879,null))['catch'](handleError(_0x460879,null));};exports[_0x3f96('0x57')]=function(_0x11e2ef,_0x28eb0c){return db['UserProfile']['describe']()['then'](respondWithResult(_0x28eb0c,null))[_0x3f96('0x42')](handleError(_0x28eb0c,null));};exports[_0x3f96('0x58')]=function(_0x566fe7,_0x500a18){var _0x4dbfda=_0x566fe7['body'];return db[_0x3f96('0x29')][_0x3f96('0x44')]({'where':{'id':_0x566fe7[_0x3f96('0x43')]['id']}})['then'](handleEntityNotFound(_0x500a18,null))['then'](function(_0x10a8f6){if(_0x10a8f6){return db[_0x3f96('0x59')][_0x3f96('0x4d')](function(_0x1066d3){return db[_0x3f96('0x4e')][_0x3f96('0x56')]({'where':{'userProfileId':_0x566fe7[_0x3f96('0x43')]['id'],'sectionId':_[_0x3f96('0x28')](_0x4dbfda,function(_0x4405b9){return _0x4405b9['sectionId'];})},'transaction':_0x1066d3})[_0x3f96('0x22')](function(){var _0x4c8cd7=_['map'](_0x4dbfda,function(_0x13bc2d){_0x13bc2d[_0x3f96('0x5a')]=_0x566fe7[_0x3f96('0x43')]['id'];return _0x13bc2d;});var _0x5b11ae=[];return BPromise['each'](_0x4c8cd7,function(_0x2858ef){return db[_0x3f96('0x4e')]['create'](_0x2858ef,{'include':[{'model':db[_0x3f96('0x52')],'as':_0x3f96('0x54')}],'raw':!![],'transaction':_0x1066d3})[_0x3f96('0x22')](function(_0x4bb410){_0x5b11ae[_0x3f96('0x5b')](_0x4bb410[_0x3f96('0x48')]({'plain':!![]}));});})[_0x3f96('0x22')](function(){return _0x5b11ae;});});});}})[_0x3f96('0x22')](function(_0x250873){return _0x250873;})['then'](respondWithResult(_0x500a18,null))[_0x3f96('0x42')](handleError(_0x500a18,null));};exports[_0x3f96('0x5c')]=function(_0x4f12bd,_0x617985){var _0x540c61;return db['UserProfile']['find']({'where':{'id':_0x4f12bd[_0x3f96('0x43')]['id']},'attributes':['id',_0x3f96('0x26')]})[_0x3f96('0x22')](handleEntityNotFound(_0x617985,null))[_0x3f96('0x22')](function(_0x12e799){if(_0x12e799){_0x540c61=_0x12e799;return db[_0x3f96('0x4e')][_0x3f96('0x56')]({'where':{'userProfileId':_0x4f12bd[_0x3f96('0x43')]['id'],'sectionId':_0x4f12bd[_0x3f96('0x32')][_0x3f96('0x5d')]}});}})['then'](function(){return _0x540c61;})[_0x3f96('0x22')](respondWithStatusCode(_0x617985,null))['catch'](handleError(_0x617985,null));};exports[_0x3f96('0x5e')]=function(_0x1f2c12,_0x2a7370){var _0x5a5984=[];var _0x3bc2d1=[];return db[_0x3f96('0x4e')][_0x3f96('0x4f')]({'where':{'userProfileId':_0x1f2c12[_0x3f96('0x43')]['id']},'raw':!![]})[_0x3f96('0x22')](function(_0x4fbbcf){_0x5a5984=_[_0x3f96('0x3b')](_0x4fbbcf,function(_0x5c7ef0){return _0x5c7ef0[_0x3f96('0x5f')]===0x1||_[_0x3f96('0x60')]([0x3eb,0x709],_0x5c7ef0[_0x3f96('0x53')]);});if(!_[_0x3f96('0x61')](_0x5a5984)){return _[_0x3f96('0x28')](_0x5a5984,function(_0x262431){return _0x262431[_0x3f96('0x53')];});}else{return;}})[_0x3f96('0x22')](function(_0x44817e){if(_0x44817e)_0x3bc2d1=_0x44817e;if(_['includes'](_0x3bc2d1,0x64)){var _0x127773=_[_0x3f96('0x44')](_0x5a5984,{'sectionId':0x64});return hasDefaultDashboard(_0x127773)[_0x3f96('0x22')](function(_0x5a7808){return _[_0x3f96('0x28')](_0x5a5984,function(_0x4353a5){if(_0x4353a5[_0x3f96('0x53')]===0x64){_0x4353a5['subsections']=_0x5a7808;}return _0x4353a5;});});}else{return;}})['then'](function(_0x4cefc8){if(_0x4cefc8)_0x5a5984=_0x4cefc8;if(_['includes'](_0x3bc2d1,0x3eb)){var _0x21117f=_[_0x3f96('0x44')](_0x5a5984,{'sectionId':0x3eb});return getCustomDashboards(_0x21117f)[_0x3f96('0x22')](function(_0x49d41d){return _['map'](_0x5a5984,function(_0x23ec47){if(_0x21117f[_0x3f96('0x5f')]){if(_0x23ec47[_0x3f96('0x53')]===0x3eb){_0x23ec47['subsections']=_0x49d41d;}}else{if(_0x23ec47[_0x3f96('0x53')]===0x64){_0x23ec47[_0x3f96('0x62')]=_0x49d41d;}}return _0x23ec47;});});}else{return;}})['then'](function(_0x3c60b5){if(_0x3c60b5)_0x5a5984=_0x3c60b5;if(_['includes'](_0x3bc2d1,0x709)){var _0x3eebb0=_[_0x3f96('0x44')](_0x5a5984,{'sectionId':0x709});return getPlugins(_0x3eebb0)['then'](function(_0x5ef05a){if(_0x3eebb0[_0x3f96('0x5f')]){return _[_0x3f96('0x28')](_0x5a5984,function(_0x3dfed0){if(_0x3dfed0[_0x3f96('0x53')]===0x709){_0x3dfed0[_0x3f96('0x62')]=_0x5ef05a;}return _0x3dfed0;});}else{var _0x486f3e={'sectionId':0x76c,'enabled':0x1,'subsections':_0x5ef05a};var _0x18404e=_[_0x3f96('0x28')](_0x5a5984);_0x18404e[_0x3f96('0x5b')](_0x486f3e);return _0x18404e;}});}else{return;}})[_0x3f96('0x22')](function(_0x5eb231){if(_0x5eb231)_0x5a5984=_0x5eb231;return _[_0x3f96('0x3b')](_0x5a5984,[_0x3f96('0x5f'),0x1]);})[_0x3f96('0x22')](respondWithResult(_0x2a7370,null))[_0x3f96('0x42')](handleError(_0x2a7370,null));};function hasDefaultDashboard(_0x56aac2){var _0x541f61=[0x65];return new BPromise(function(_0x5f532c,_0x1f3b10){try{if(_0x56aac2[_0x3f96('0x51')]){_0x5f532c(_0x541f61);}else{return db[_0x3f96('0x52')][_0x3f96('0x63')]({'where':{'sectionId':_0x56aac2['id']},'raw':!![]})[_0x3f96('0x22')](function(_0xc06449){_0xc06449?_0x5f532c(_0x541f61):_0x5f532c();});}}catch(_0x3209d9){_0x1f3b10(_0x3209d9);}});}function getCustomDashboards(_0x481270){var _0x5de284=[];return new BPromise(function(_0x162042,_0x42848e){try{if(_0x481270[_0x3f96('0x51')]){return db[_0x3f96('0x64')][_0x3f96('0x4f')]({'raw':!![]})[_0x3f96('0x22')](function(_0x251728){_0x251728[_0x3f96('0x65')](function(_0x1ad7da){_0x5de284[_0x3f96('0x5b')](_0x1ad7da['id']+0x1869f);});_0x162042(_0x5de284);});}else{return db[_0x3f96('0x52')][_0x3f96('0x4f')]({'where':{'sectionId':_0x481270['id']},'raw':!![]})[_0x3f96('0x22')](function(_0x103797){_0x103797['forEach'](function(_0x24c501){_0x5de284[_0x3f96('0x5b')](_0x24c501[_0x3f96('0x66')]+0x1869f);});_0x162042(_0x5de284);});}}catch(_0x3afb1f){_0x42848e(_0x3afb1f);}});}function getPlugins(_0x5025ef){var _0x5882ea=[];return new BPromise(function(_0x549995,_0x2bdfc2){try{if(_0x5025ef[_0x3f96('0x51')]){return db[_0x3f96('0x67')][_0x3f96('0x4f')]({'raw':!![]})[_0x3f96('0x22')](function(_0x38d6ad){_0x38d6ad[_0x3f96('0x65')](function(_0x20325a){_0x5882ea[_0x3f96('0x5b')](_0x20325a['id']+0x15b38);});_0x549995(_0x5882ea);});}else{return db[_0x3f96('0x52')][_0x3f96('0x4f')]({'where':{'sectionId':_0x5025ef['id']},'raw':!![]})['then'](function(_0x3f00b8){_0x3f00b8[_0x3f96('0x65')](function(_0x337280){_0x5882ea[_0x3f96('0x5b')](_0x337280[_0x3f96('0x66')]+0x15b38);});_0x549995(_0x5882ea);});}}catch(_0x38afbc){_0x2bdfc2(_0x38afbc);}});}exports[_0x3f96('0x68')]=function(_0x9ee5a9,_0x2a705b){return db[_0x3f96('0x29')][_0x3f96('0x44')]({'where':{'id':_0x9ee5a9[_0x3f96('0x43')]['id']}})[_0x3f96('0x22')](handleEntityNotFound(_0x2a705b,null))['then'](function(_0x3b6c10){if(_0x3b6c10){return db[_0x3f96('0x59')][_0x3f96('0x4d')](function(_0x4b45ae){return db[_0x3f96('0x4e')]['findAll']({'where':{'userProfileId':_0x9ee5a9[_0x3f96('0x43')]['id']},'attributes':['id'],'raw':!![]})[_0x3f96('0x22')](function(_0x1fd823){if(_0x1fd823){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x9ee5a9[_0x3f96('0x43')]['id'],'id':_[_0x3f96('0x28')](_0x1fd823,function(_0x406cc3){return _0x406cc3['id'];})},'transaction':_0x4b45ae});}})['then'](function(_0x58c731){var _0x1c4e2f=_[_0x3f96('0x28')](_0x9ee5a9[_0x3f96('0x46')],function(_0x1d643c){_0x1d643c[_0x3f96('0x5a')]=_0x9ee5a9[_0x3f96('0x43')]['id'];return _0x1d643c;});return db[_0x3f96('0x4e')][_0x3f96('0x69')](_0x1c4e2f,{'raw':!![],'transaction':_0x4b45ae});})[_0x3f96('0x22')](function(_0x1b4636){var _0x506d73=_[_0x3f96('0x3b')](_[_0x3f96('0x28')](_0x1b4636,function(_0x5505c1){return _0x5505c1[_0x3f96('0x48')]({'plain':!![]});}),{'includeAll':![]});if(_0x506d73){return db[_0x3f96('0x4e')][_0x3f96('0x4f')]({'where':{'userProfileId':_0x9ee5a9[_0x3f96('0x43')]['id'],'sectionId':_['map'](_0x506d73,function(_0x4ee14b){return _0x4ee14b['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})['then'](function(_0x50c8c4){var _0x4cfbce=_[_0x3f96('0x28')](_0x9ee5a9['body'],function(_0x446fcf){_0x446fcf[_0x3f96('0x5a')]=_0x9ee5a9[_0x3f96('0x43')]['id'];return _0x446fcf;});return db['UserProfileResource']['bulkCreate'](_0x4cfbce,{'raw':!![],'transaction':_0x4b45ae});});}})['catch'](handleError(_0x2a705b,null));});}})[_0x3f96('0x22')](function(_0x322cd0){var _0x5530e0=_[_0x3f96('0x28')](_0x322cd0,function(_0x4f5e70){return _0x4f5e70[_0x3f96('0x48')]({'plain':!![]});});})[_0x3f96('0x22')](respondWithResult(_0x2a705b,null))[_0x3f96('0x42')](handleError(_0x2a705b,null));};exports[_0x3f96('0x6a')]=function(_0x25788d,_0x111a1c,_0x3e97d1){return db[_0x3f96('0x29')][_0x3f96('0x44')]({'where':{'id':_0x25788d[_0x3f96('0x43')]['id']}})['then'](handleEntityNotFound(_0x111a1c,null))['then'](function(_0x12c575){if(_0x12c575){return _0x12c575[_0x3f96('0x6a')](_0x25788d[_0x3f96('0x32')]['ids']);}})[_0x3f96('0x22')](respondWithStatusCode(_0x111a1c,null))[_0x3f96('0x42')](handleError(_0x111a1c,null));};exports[_0x3f96('0x6b')]=function(_0xcad76f,_0x5a170d){var _0x4b6a0f={};if(!_0xcad76f[_0x3f96('0x32')][_0x3f96('0x6c')])throw new Error(_0x3f96('0x6d'));if(!_0xcad76f[_0x3f96('0x32')][_0x3f96('0x36')](_0x3f96('0x37'))){_0x4b6a0f[_0x3f96('0x1b')]=qs[_0x3f96('0x1b')](_0xcad76f[_0x3f96('0x32')]['limit']);_0x4b6a0f['offset']=qs['offset'](_0xcad76f['query'][_0x3f96('0x19')]);}return db[_0x3f96('0x29')][_0x3f96('0x44')]({'where':{'id':_0xcad76f[_0x3f96('0x43')]['id']}})['then'](function(_0x47c3fe){if(!_0x47c3fe)throw new Error(_0x3f96('0x6e')+_0xcad76f[_0x3f96('0x43')]['id']);return db[_0x3f96('0x29')][_0x3f96('0x6b')](_0xcad76f);})[_0x3f96('0x22')](respondWithFilteredResult(_0x5a170d,_0x4b6a0f))[_0x3f96('0x42')](handleError(_0x5a170d,null));};
\ No newline at end of file
index ad213d8..ccf2e6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96fd=['setMaxListeners','save','remove','emit','hook','exports','../../mysqldb'];(function(_0x1fcaf2,_0x78e165){var _0x39c6bb=function(_0x2b9610){while(--_0x2b9610){_0x1fcaf2['push'](_0x1fcaf2['shift']());}};_0x39c6bb(++_0x78e165);}(_0x96fd,0x1e9));var _0xd96f=function(_0xe13e13,_0x402131){_0xe13e13=_0xe13e13-0x0;var _0x3b3d61=_0x96fd[_0xe13e13];return _0x3b3d61;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xd96f('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xd96f('0x1')](0x0);var events={'afterCreate':_0xd96f('0x2'),'afterUpdate':'update','afterDestroy':_0xd96f('0x3')};function emitEvent(_0x110958){return function(_0x44f63c,_0x22b39b,_0x5d8681){UserProfileEvents[_0xd96f('0x4')](_0x110958+':'+_0x44f63c['id'],_0x44f63c);UserProfileEvents[_0xd96f('0x4')](_0x110958,_0x44f63c);_0x5d8681(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xd96f('0x5')](e,emitEvent(event));}}module[_0xd96f('0x6')]=UserProfileEvents;
\ No newline at end of file
+var _0x44c2=['events','../../mysqldb','UserProfile','setMaxListeners','update','remove','hasOwnProperty','exports'];(function(_0x5713b5,_0x423f83){var _0x2f795d=function(_0x392aea){while(--_0x392aea){_0x5713b5['push'](_0x5713b5['shift']());}};_0x2f795d(++_0x423f83);}(_0x44c2,0x100));var _0x244c=function(_0x2d344f,_0x25fa84){_0x2d344f=_0x2d344f-0x0;var _0x2e796b=_0x44c2[_0x2d344f];return _0x2e796b;};'use strict';var EventEmitter=require(_0x244c('0x0'));var UserProfile=require(_0x244c('0x1'))['db'][_0x244c('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x244c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x244c('0x4'),'afterDestroy':_0x244c('0x5')};function emitEvent(_0x2c5d4d){return function(_0x3b2ff1,_0x134a84,_0x245e1d){UserProfileEvents['emit'](_0x2c5d4d+':'+_0x3b2ff1['id'],_0x3b2ff1);UserProfileEvents['emit'](_0x2c5d4d,_0x3b2ff1);_0x245e1d(null);};}for(var e in events){if(events[_0x244c('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x244c('0x7')]=UserProfileEvents;
\ No newline at end of file
index c4190f9..ca23896 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63cb=['agents','Users','admin','user','Telephones','zendeskaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Dashboard','intervals','Interval','pauses','Pause','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','AnalyticExtractedReport','Reports','reportId','metrics','charAt','slice','Sequelize','QueryTypes','select','ui.','ui.createdAt','from','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','Invalid\x20section\x20\x27','length','UserProfileSection','params','all','ignore','isEmpty','union','find','autoAssociation','push','rawAttributes','model','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','where','merge','VIRTUAL','foreignKey','forEach','options','includeAll','default','DefaultReports','custom','count','rows','customSorting','extraQueryConditions','include','Tags','color','tag','ThroughTags','openTabs','chat','sms','dataValues','mail','whatsapp','lodash','./userProfile.attributes','exports','models','filter','findAll','map','field','value','then','associatedResources','name','resolve','UserProfileResource','resourceId','type','catch','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareRecording','parentSections','SquareProjects','projects','JscriptyProject','CmContact','Lists','ListId','CmList','companies','CmCompany','CmCustomField','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','outboundroutes','contexts','VoiceContext','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','voiceprefixes','ivrcampaigns','Campaign','mailqueues','MailQueue','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','whatsappaccounts','teams','Team','voicequeues','queuecampaigns','users'];(function(_0x3f2fbb,_0xa096c2){var _0x3a080e=function(_0x11c418){while(--_0x11c418){_0x3f2fbb['push'](_0x3f2fbb['shift']());}};_0x3a080e(++_0xa096c2);}(_0x63cb,0x1e2));var _0xb63c=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x63cb[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0xb63c('0x0'));var attributes=require(_0xb63c('0x1'));var qs=require('../../components/parsers/qs');var squel=require('squel');module[_0xb63c('0x2')]=function(_0x4c9995){var _0x5317e9=_0x4c9995[_0xb63c('0x3')];function _0x23ead2(_0xb8bd8f,_0x2b9856){return new Promise(function(_0x2985de,_0x312c6d){if(!_0x2b9856)return _0x2985de(null);var _0x14374e=_0x2b9856[_0xb63c('0x4')]?{[_0x2b9856[_0xb63c('0x4')]['field']]:_0x2b9856[_0xb63c('0x4')]['value']}:undefined;return _0x5317e9[_0xb8bd8f][_0xb63c('0x5')]({'where':_0x14374e,'raw':!![]})['then'](function(_0x5ab257){_0x2b9856['associatedResources']=_[_0xb63c('0x6')](_0x5ab257,'id');_0x2985de(_0x2b9856);})['catch'](function(_0x4bde7b){_0x312c6d(_0x4bde7b);});});}function _0x4788df(_0x2486bc,_0x4967f3){return new Promise(function(_0x3f43ae,_0x30e222){var _0x4d2fcc=_0x2486bc[_0xb63c('0x4')]?{[_0x2486bc[_0xb63c('0x4')][_0xb63c('0x7')]]:_0x2486bc[_0xb63c('0x4')][_0xb63c('0x8')]}:undefined;return _0x5317e9[_0x2486bc['model']]['findAll']({'where':_0x4d2fcc,'raw':!![]})[_0xb63c('0x9')](function(_0x1c37b9){_0x4967f3[_0xb63c('0xa')]=_[_0xb63c('0x6')](_0x1c37b9,function(_0x1e4a86){return _0x1e4a86[_0xb63c('0xb')];});_0x3f43ae(_0x4967f3);})['catch'](function(_0x37e8ed){_0x30e222(_0x37e8ed);});});}function _0x23d24a(_0x357ca0,_0x4e1c0f,_0x128238){if(!_0x4e1c0f)return Promise[_0xb63c('0xc')](null);return new Promise(function(_0x652c53,_0x2e060c){return _0x5317e9[_0xb63c('0xd')][_0xb63c('0x5')]({'where':{'sectionId':_0x4e1c0f['id']},'raw':!![]})[_0xb63c('0x9')](function(_0x1dc50f){if(_0x357ca0[_0xb63c('0x7')]&&_0x357ca0[_0xb63c('0x7')]!=='id'){_0x4e1c0f['associatedResources']=_[_0xb63c('0x6')](_0x1dc50f,function(_0x49da3d){return _0x49da3d[_0x357ca0[_0xb63c('0x7')]];});}else{if(_0x128238==='AnalyticExtractedReport'){_0x4e1c0f['associatedResources']=_[_0xb63c('0x6')](_0x1dc50f,function(_0x2bb717){return{'id':_0x2bb717[_0xb63c('0xe')],'type':_0x2bb717[_0xb63c('0xf')]};});}else{_0x4e1c0f[_0xb63c('0xa')]=_['map'](_0x1dc50f,function(_0x201e1a){return _0x201e1a[_0xb63c('0xe')];});}}_0x652c53(_0x4e1c0f);})[_0xb63c('0x10')](function(_0x569647){_0x2e060c(_0x569647);});});}function _0x221dc9(_0x4aa54d,_0x4bbdad){var _0x149194={'parentSections':[]};switch(_0x4aa54d[_0xb63c('0x11')]()){case _0xb63c('0x12'):_0x149194[_0xb63c('0x13')]=_0xb63c('0x14');break;case _0xb63c('0x15'):_0x149194[_0xb63c('0x13')]='SquareOdbc';break;case'squarerecordings':_0x149194[_0xb63c('0x13')]=_0xb63c('0x16');_0x149194[_0xb63c('0x17')]=[{'name':_0xb63c('0x18'),'field':_0xb63c('0xb'),'foreignKey':'projectName'}];break;case _0xb63c('0x19'):_0x149194['childModel']=_0xb63c('0x1a');break;case'contacts':_0x149194[_0xb63c('0x13')]=_0xb63c('0x1b');_0x149194['parentSections']=[{'name':_0xb63c('0x1c'),'field':'id','foreignKey':_0xb63c('0x1d')}];break;case'lists':_0x149194['childModel']=_0xb63c('0x1e');break;case _0xb63c('0x1f'):_0x149194[_0xb63c('0x13')]=_0xb63c('0x20');break;case'globalcustomfields':_0x149194[_0xb63c('0x13')]=_0xb63c('0x21');break;case'chatqueues':_0x149194[_0xb63c('0x13')]='ChatQueue';break;case _0xb63c('0x22'):_0x149194[_0xb63c('0x13')]=_0xb63c('0x23');break;case _0xb63c('0x24'):_0x149194['childModel']=_0xb63c('0x25');break;case _0xb63c('0x26'):_0x149194[_0xb63c('0x13')]=_0xb63c('0x27');break;case _0xb63c('0x28'):case'internalroutes':case _0xb63c('0x29'):_0x149194[_0xb63c('0x13')]='VoiceExtension';break;case _0xb63c('0x2a'):_0x149194[_0xb63c('0x13')]=_0xb63c('0x2b');break;case'voicemails':_0x149194[_0xb63c('0x13')]='VoiceMail';break;case _0xb63c('0x2c'):_0x149194['childModel']=_0xb63c('0x2d');_0x149194['parentSections']=[{'name':_0xb63c('0x2e'),'field':_0xb63c('0xb'),'foreignKey':_0xb63c('0x2f'),'model':_0xb63c('0x30'),'filter':{'field':_0xb63c('0x31'),'value':[_0xb63c('0x32')]}},{'name':'Telephones','field':_0xb63c('0xb'),'foreignKey':_0xb63c('0x2f'),'model':_0xb63c('0x30'),'filter':{'field':_0xb63c('0x31'),'value':[_0xb63c('0x33')]}},{'name':_0xb63c('0x34'),'field':'name','foreignKey':_0xb63c('0x35'),'model':_0xb63c('0x36'),'filter':{'field':_0xb63c('0xf'),'value':[_0xb63c('0x37')]}},{'name':_0xb63c('0x38'),'field':_0xb63c('0xb'),'foreignKey':_0xb63c('0x35'),'model':'VoiceQueue','filter':{'field':_0xb63c('0xf'),'value':[_0xb63c('0x39')]}}];break;case _0xb63c('0x3a'):_0x149194[_0xb63c('0x13')]=_0xb63c('0x3b');break;case'chanspies':_0x149194['childModel']='VoiceChanSpy';break;case _0xb63c('0x3c'):_0x149194['childModel']='VoicePrefix';break;case _0xb63c('0x3d'):_0x149194[_0xb63c('0x13')]=_0xb63c('0x3e');break;case _0xb63c('0x3f'):_0x149194[_0xb63c('0x13')]=_0xb63c('0x40');break;case'mailaccounts':_0x149194[_0xb63c('0x13')]='MailAccount';break;case _0xb63c('0x41'):_0x149194['childModel']=_0xb63c('0x42');break;case'openchannelqueues':_0x149194[_0xb63c('0x13')]=_0xb63c('0x43');break;case _0xb63c('0x44'):_0x149194[_0xb63c('0x13')]=_0xb63c('0x45');break;case _0xb63c('0x46'):_0x149194['childModel']=_0xb63c('0x47');break;case _0xb63c('0x48'):_0x149194[_0xb63c('0x13')]='SmsAccount';break;case'whatsappqueues':_0x149194['childModel']='WhatsappQueue';break;case _0xb63c('0x49'):_0x149194['childModel']='WhatsappAccount';break;case _0xb63c('0x4a'):_0x149194['childModel']=_0xb63c('0x4b');break;case _0xb63c('0x4c'):case _0xb63c('0x4d'):_0x149194[_0xb63c('0x13')]='VoiceQueue';if(_0x4bbdad){_0x149194[_0xb63c('0x17')]=[{'name':'VoiceQueues'},{'name':_0xb63c('0x38')}];}break;case _0xb63c('0x4e'):case _0xb63c('0x4f'):case'telephones':_0x149194[_0xb63c('0x13')]='User';if(_0x4bbdad){_0x149194['parentSections']=[{'name':_0xb63c('0x50'),'filter':{'field':'role','value':[_0xb63c('0x51'),_0xb63c('0x52')]},'ignore':!![]},{'name':'Agents'},{'name':_0xb63c('0x53')}];}break;case _0xb63c('0x54'):_0x149194['childModel']='ZendeskAccount';break;case'salesforceaccounts':_0x149194[_0xb63c('0x13')]=_0xb63c('0x55');break;case _0xb63c('0x56'):_0x149194[_0xb63c('0x13')]=_0xb63c('0x57');break;case _0xb63c('0x58'):_0x149194[_0xb63c('0x13')]=_0xb63c('0x59');break;case _0xb63c('0x5a'):_0x149194['childModel']=_0xb63c('0x5b');break;case'zohoaccounts':_0x149194['childModel']=_0xb63c('0x5c');break;case _0xb63c('0x5d'):_0x149194[_0xb63c('0x13')]='User';break;case _0xb63c('0x5e'):_0x149194[_0xb63c('0x13')]=_0xb63c('0x5f');break;case _0xb63c('0x60'):_0x149194[_0xb63c('0x13')]='Disposition';break;case'customdashboards':_0x149194[_0xb63c('0x13')]=_0xb63c('0x61');break;case _0xb63c('0x62'):_0x149194[_0xb63c('0x13')]=_0xb63c('0x63');break;case _0xb63c('0x64'):_0x149194['childModel']=_0xb63c('0x65');break;case'scheduler':_0x149194[_0xb63c('0x13')]='Schedule';break;case'sounds':_0x149194['childModel']='Sound';break;case _0xb63c('0x66'):_0x149194[_0xb63c('0x13')]=_0xb63c('0x67');break;case _0xb63c('0x68'):_0x149194[_0xb63c('0x13')]=_0xb63c('0x69');break;case _0xb63c('0x6a'):_0x149194[_0xb63c('0x13')]=_0xb63c('0x6b');break;case _0xb63c('0x6c'):_0x149194[_0xb63c('0x13')]=_0xb63c('0x6d');break;case _0xb63c('0x6e'):_0x149194[_0xb63c('0x13')]=_0xb63c('0x6f');break;case _0xb63c('0x70'):_0x149194[_0xb63c('0x13')]=_0xb63c('0x71');break;case _0xb63c('0x72'):_0x149194['childModel']=_0xb63c('0x73');_0x149194[_0xb63c('0x17')]=[{'name':_0xb63c('0x74'),'field':'id','foreignKey':_0xb63c('0x75')}];break;case _0xb63c('0x76'):_0x149194[_0xb63c('0x13')]='AnalyticMetric';break;}return _0x149194;}function _0x43158f(_0x5d5359,_0x56c2c1){var _0x463e78=_0x5d5359[_0xb63c('0x77')](0x0)['toUpperCase']()+_0x5d5359[_0xb63c('0x78')](0x1);var _0x36a464={'type':_0x5317e9[_0xb63c('0x79')][_0xb63c('0x7a')]['SELECT'],'raw':!![]};return new Promise(function(_0xee2425,_0x358419){var _0x51b707=squel[_0xb63c('0x7b')]()['field'](_0xb63c('0x7c')+_0x463e78+'InteractionId','id')['field'](_0xb63c('0x7d'))[_0xb63c('0x7e')](_0xb63c('0x7f')+_0x5d5359+_0xb63c('0x80'),'ui')['where'](_0xb63c('0x81'),_0x56c2c1['id']);return _0x5317e9[_0xb63c('0x82')][_0xb63c('0x83')](_0x51b707[_0xb63c('0x84')](),_0x36a464)[_0xb63c('0x9')](function(_0x5c7268){_0x56c2c1[_0x463e78+_0xb63c('0x85')]=_0x5c7268;_0xee2425(_0x5c7268);})[_0xb63c('0x10')](function(_0xe7de4){_0x358419(_0xe7de4);});});}return _0x4c9995[_0xb63c('0x86')](_0xb63c('0x87'),attributes,{'tableName':_0xb63c('0x88'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x180956){var _0x21ed9a={'raw':_0x180956[_0xb63c('0x83')]['raw'],'where':{}};var _0x20820a={};var _0x5d2f50={'count':0x0,'rows':[]};var _0x3b52fb=_0x180956[_0xb63c('0x83')]['section'];var _0xb10cd5=_0x180956[_0xb63c('0x83')]['mergeResources']||![];var _0x487de6=_0x221dc9(_0x3b52fb,_0xb10cd5);if(!_0x487de6[_0xb63c('0x13')])throw new Error(_0xb63c('0x89')+_0x3b52fb+'\x27');var _0x4cf850=[{'name':_0x3b52fb}];if(!_['isEmpty'](_0x487de6[_0xb63c('0x17')]))_0x4cf850=_0x487de6[_0xb63c('0x17')];var _0x5e189e=[];for(var _0x523f00=0x0;_0x523f00<_0x4cf850[_0xb63c('0x8a')];_0x523f00++){_0x5e189e['push'](_0x5317e9[_0xb63c('0x8b')]['find']({'where':{'userProfileId':_0x180956[_0xb63c('0x8c')]['id'],'name':_0x4cf850[_0x523f00][_0xb63c('0xb')]},'raw':!![]}));}return Promise[_0xb63c('0x8d')](_0x5e189e)[_0xb63c('0x9')](function(_0x28eb27){var _0x34c39e=_['filter'](_0x28eb27,function(_0x340d78){return _0x340d78?_0x340d78:undefined;});var _0x1137ff=_[_0xb63c('0x4')](_0x4cf850,[_0xb63c('0x8e'),!![]]);var _0xb19f23=_['isEmpty'](_0x34c39e)&&_[_0xb63c('0x8f')](_0x1137ff)?null:_[_0xb63c('0x90')](_0x1137ff,_0x34c39e);if(!_0xb19f23)return null;var _0xf416c=[];for(var _0x48de7f=0x0;_0x48de7f<_0xb19f23[_0xb63c('0x8a')];_0x48de7f++){var _0x3e8c95=_[_0xb63c('0x91')](_0x4cf850,function(_0x51453b){return _0xb19f23[_0x48de7f]?_0x51453b[_0xb63c('0xb')]===_0xb19f23[_0x48de7f][_0xb63c('0xb')]:null;});if(_0x3e8c95){if(_0xb19f23[_0x48de7f][_0xb63c('0x8e')]){_0xf416c['push'](_0x23ead2(_0x487de6[_0xb63c('0x13')],_0xb19f23[_0x48de7f]));}else{if(!_0xb19f23[_0x48de7f][_0xb63c('0x92')]){_0xf416c[_0xb63c('0x93')](_0x23d24a(_0x3e8c95,_0xb19f23[_0x48de7f],_0x487de6[_0xb63c('0x13')]));}else{if(_0x3e8c95['model']){_0xf416c['push'](_0x4788df(_0x3e8c95,_0xb19f23[_0x48de7f]));}}}}}return Promise[_0xb63c('0x8d')](_0xf416c);})['then'](function(_0x4fe0ae){var _0x1d3493=_0x4fe0ae;var _0x504544=null;if(_0x1d3493){_0x504544=_0x1d3493[_0xb63c('0x8a')]===0x1?_0x1d3493[0x0]:null;}if(!_0x504544&&!_0x1d3493)return _0x5d2f50;var _0x37afa8=_0x5317e9[_0x487de6[_0xb63c('0x13')]][_0xb63c('0x94')];_0x20820a[_0xb63c('0x95')]=_[_0xb63c('0x96')](_0x37afa8);_0x20820a['query']=_[_0xb63c('0x96')](_0x180956[_0xb63c('0x83')]);_0x20820a[_0xb63c('0x97')]=_['intersection'](_0x20820a[_0xb63c('0x95')],_0x20820a[_0xb63c('0x83')]);_0x21ed9a[_0xb63c('0x98')]=_[_0xb63c('0x99')](_0x20820a[_0xb63c('0x95')],qs[_0xb63c('0x9a')](_0x180956['query']['fields']));_0x21ed9a[_0xb63c('0x98')]=_0x21ed9a[_0xb63c('0x98')][_0xb63c('0x8a')]?_0x21ed9a[_0xb63c('0x98')]:_0x20820a[_0xb63c('0x95')];if(!_0x180956[_0xb63c('0x83')][_0xb63c('0x9b')](_0xb63c('0x9c'))){_0x21ed9a['limit']=qs['limit'](_0x180956[_0xb63c('0x83')][_0xb63c('0x9d')]);_0x21ed9a[_0xb63c('0x9e')]=qs['offset'](_0x180956[_0xb63c('0x83')][_0xb63c('0x9e')]);}_0x21ed9a[_0xb63c('0x9f')]=qs[_0xb63c('0xa0')](_0x180956['query']['sort']);_0x21ed9a['where']=qs[_0xb63c('0x97')](_[_0xb63c('0xa1')](_0x180956[_0xb63c('0x83')],_0x20820a[_0xb63c('0x97')]));if(_0x180956['query'][_0xb63c('0x4')]){_0x21ed9a[_0xb63c('0xa2')]=_[_0xb63c('0xa3')](_0x21ed9a[_0xb63c('0xa2')],{'$or':_['map'](_0x37afa8,function(_0x359482){if(_0x359482['type']['key']!==_0xb63c('0xa4')){var _0x5dc52a={};_0x5dc52a[_0x359482[_0xb63c('0x7')]]={'$like':'%'+_0x180956[_0xb63c('0x83')][_0xb63c('0x4')]+'%'};return _0x5dc52a;}})});}var _0x10da91=[];var _0x59e134=null;var _0x163f69={};if(_0x504544){_0x59e134=_[_0xb63c('0x91')](_0x4cf850,['name',_0x504544[_0xb63c('0xb')]]);if(_0x59e134[_0xb63c('0x7')]){_0x163f69={};if(_0x487de6['childModel']===_0xb63c('0x73')){_0x163f69[_0x59e134[_0xb63c('0xa5')]]=_[_0xb63c('0x6')](_0x504544[_0xb63c('0xa')],'id');}else{_0x163f69[_0x59e134[_0xb63c('0xa5')]]=_0x504544[_0xb63c('0xa')];}_0x10da91[_0xb63c('0x93')](_0x163f69);}else{_0x21ed9a[_0xb63c('0xa2')]['id']=_0x504544[_0xb63c('0xa')];}}else{for(var _0x39c12b=0x0;_0x39c12b<_0x1d3493['length'];_0x39c12b++){_0x59e134=_['find'](_0x4cf850,[_0xb63c('0xb'),_0x1d3493[_0x39c12b]['name']]);if(_0x59e134['field']){_0x163f69={};_0x163f69[_0x59e134[_0xb63c('0xa5')]]=_0x1d3493[_0x39c12b][_0xb63c('0xa')];_0x10da91[_0xb63c('0x93')](_0x163f69);}else{if(!_0x21ed9a['where']['id'])_0x21ed9a[_0xb63c('0xa2')]['id']=[];_0x1d3493[_0x39c12b][_0xb63c('0xa')][_0xb63c('0xa6')](function(_0x42d8f7){_0x21ed9a[_0xb63c('0xa2')]['id']['push'](_0x42d8f7);});}}}if(!_['isEmpty'](_0x10da91)){_0x21ed9a['where']=_['merge'](_0x21ed9a[_0xb63c('0xa2')],{'$and':{'$or':_0x10da91}});}_0x21ed9a=_[_0xb63c('0xa3')]({},_0x21ed9a,_0x180956[_0xb63c('0xa7')]);if(_0x504544&&!_0x504544[_0xb63c('0x92')]&&_0x487de6[_0xb63c('0x13')]===_0xb63c('0x73')){if(_0x180956[_0xb63c('0x83')][_0xb63c('0xa8')]){_0x21ed9a['include']=[{'all':!![]}];}return _0x5317e9[_0x487de6[_0xb63c('0x13')]][_0xb63c('0x5')](_0x21ed9a)[_0xb63c('0x9')](function(_0x4f90dd){var _0x58a62b=[];_0x4f90dd[_0xb63c('0xa6')](function(_0x472195){var _0xc9dc95;switch(_0x472195['reportType']){case _0xb63c('0xa9'):_0xc9dc95=_[_0xb63c('0x91')](_0x504544['associatedResources'],function(_0x2e3e24){return _0x2e3e24['id']===_0x472195[_0xb63c('0x75')]&&_0x2e3e24['type']===_0xb63c('0xaa');});break;case _0xb63c('0xab'):_0xc9dc95=_['find'](_0x504544[_0xb63c('0xa')],function(_0xb396f3){return _0xb396f3['id']===_0x472195[_0xb63c('0x75')]&&_0xb396f3['type']==='CustomReports';});break;}if(_0xc9dc95)_0x58a62b[_0xb63c('0x93')](_0x472195);});_0x5d2f50[_0xb63c('0xac')]=_0x58a62b[_0xb63c('0x8a')];_0x5d2f50[_0xb63c('0xad')]=_0x58a62b;return _0x5d2f50;});}else{if(!_[_0xb63c('0x8f')](_0x180956[_0xb63c('0x83')]['ids'])){_0x21ed9a[_0xb63c('0xa2')]['id']=_0x21ed9a[_0xb63c('0xa2')]['id']?_[_0xb63c('0x99')](_0x21ed9a[_0xb63c('0xa2')]['id'],_0x180956[_0xb63c('0x83')]['ids']):_0x180956[_0xb63c('0x83')]['ids'];if(_0x180956[_0xb63c('0x83')][_0xb63c('0xae')]){_0x21ed9a[_0xb63c('0x9f')]=_0x180956[_0xb63c('0x83')][_0xb63c('0xae')];}}if(_0x180956[_0xb63c('0x83')][_0xb63c('0xaf')]){_0x21ed9a['where']=_[_0xb63c('0xa3')](_0x21ed9a[_0xb63c('0xa2')],{'$and':_0x180956[_0xb63c('0x83')]['extraQueryConditions']});}return _0x5317e9[_0x487de6[_0xb63c('0x13')]][_0xb63c('0xac')]({'where':_0x21ed9a[_0xb63c('0xa2')]})[_0xb63c('0x9')](function(_0x3a4cde){_0x5d2f50[_0xb63c('0xac')]=_0x3a4cde;if(_0x180956[_0xb63c('0x83')][_0xb63c('0xa8')]){if(_0x487de6[_0xb63c('0x13')]===_0xb63c('0x1b')){_0x21ed9a[_0xb63c('0xb0')]=[{'model':_0x5317e9['Tag'],'as':_0xb63c('0xb1'),'attributes':['id','name',_0xb63c('0xb2')],'required':_0x180956[_0xb63c('0x83')][_0xb63c('0xb3')]?!![]:![]},{'model':_0x5317e9['Tag'],'as':_0xb63c('0xb4'),'attributes':['id',_0xb63c('0xb'),_0xb63c('0xb2')],'through':_0x180956[_0xb63c('0x83')]['tag']?{'attributes':[],'where':{'TagId':_0x180956[_0xb63c('0x83')][_0xb63c('0xb3')]||undefined}}:{},'required':_0x180956[_0xb63c('0x83')][_0xb63c('0xb3')]?!![]:![]}];}else{_0x21ed9a[_0xb63c('0xb0')]=[{'all':!![]}];}}return _0x5317e9[_0x487de6[_0xb63c('0x13')]]['findAll'](_0x21ed9a);})[_0xb63c('0x9')](function(_0x4f6fa7){_0x5d2f50[_0xb63c('0xad')]=_0x4f6fa7;if(_0x3b52fb===_0xb63c('0x2e')&&_0x180956[_0xb63c('0x83')][_0xb63c('0xb5')]==='true'){var _0x380fc1=[];for(var _0x1c5558=0x0;_0x1c5558<_0x5d2f50['rows'][_0xb63c('0x8a')];_0x1c5558++){_0x380fc1[_0xb63c('0x93')](_0x43158f(_0xb63c('0xb6'),_0x5d2f50[_0xb63c('0xad')][_0x1c5558]['dataValues']));_0x380fc1[_0xb63c('0x93')](_0x43158f(_0xb63c('0xb7'),_0x5d2f50[_0xb63c('0xad')][_0x1c5558][_0xb63c('0xb8')]));_0x380fc1['push'](_0x43158f('fax',_0x5d2f50[_0xb63c('0xad')][_0x1c5558][_0xb63c('0xb8')]));_0x380fc1[_0xb63c('0x93')](_0x43158f(_0xb63c('0xb9'),_0x5d2f50[_0xb63c('0xad')][_0x1c5558][_0xb63c('0xb8')]));_0x380fc1[_0xb63c('0x93')](_0x43158f('openchannel',_0x5d2f50['rows'][_0x1c5558][_0xb63c('0xb8')]));_0x380fc1['push'](_0x43158f(_0xb63c('0xba'),_0x5d2f50[_0xb63c('0xad')][_0x1c5558]['dataValues']));}return Promise[_0xb63c('0x8d')](_0x380fc1)[_0xb63c('0x9')](function(){return _0x5d2f50;});}return _0x5d2f50;});}});}}});};
\ No newline at end of file
+var _0x6c35=['User','role','telephone','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','SmsQueue','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','VoiceQueues','users','agents','telephones','Users','admin','user','zendeskaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','Dashboard','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','templates','Template','trunks','Trunk','Variable','plugins','Plugin','extractedreports','reportId','metrics','AnalyticMetric','charAt','Sequelize','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','OpenTabs','define','UserProfile','user_profiles','raw','section','isEmpty','UserProfileSection','find','params','all','ignore','union','length','push','autoAssociation','keys','filters','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','include','default','DefaultReports','custom','CustomReports','count','rows','ids','intersection','customSorting','extraQueryConditions','Tags','color','ThroughTags','tag','Agents','chat','dataValues','mail','openchannel','whatsapp','./userProfile.attributes','../../components/parsers/qs','squel','exports','filter','field','findAll','then','associatedResources','map','value','model','name','catch','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','CmContact','Lists','ListId','CmList','CmCompany','CmCustomField','chatqueues','ChatQueue','chatwebsites','faxqueues','FaxQueue','FaxAccount','inboundroutes','internalroutes','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','membername','agent','Telephones'];(function(_0x555b9f,_0x3cc52c){var _0x346646=function(_0x9451ce){while(--_0x9451ce){_0x555b9f['push'](_0x555b9f['shift']());}};_0x346646(++_0x3cc52c);}(_0x6c35,0x14d));var _0x56c3=function(_0xe5f601,_0x6ef445){_0xe5f601=_0xe5f601-0x0;var _0x33124b=_0x6c35[_0xe5f601];return _0x33124b;};'use strict';var _=require('lodash');var attributes=require(_0x56c3('0x0'));var qs=require(_0x56c3('0x1'));var squel=require(_0x56c3('0x2'));module[_0x56c3('0x3')]=function(_0x257a71){var _0x278c21=_0x257a71['models'];function _0xd2f938(_0x402f85,_0x2b8cef){return new Promise(function(_0x464e7e,_0x506a69){if(!_0x2b8cef)return _0x464e7e(null);var _0x8fdd4=_0x2b8cef['filter']?{[_0x2b8cef[_0x56c3('0x4')][_0x56c3('0x5')]]:_0x2b8cef[_0x56c3('0x4')]['value']}:undefined;return _0x278c21[_0x402f85][_0x56c3('0x6')]({'where':_0x8fdd4,'raw':!![]})[_0x56c3('0x7')](function(_0x117d13){_0x2b8cef[_0x56c3('0x8')]=_[_0x56c3('0x9')](_0x117d13,'id');_0x464e7e(_0x2b8cef);})['catch'](function(_0x5329b4){_0x506a69(_0x5329b4);});});}function _0x1bb78b(_0x172ae1,_0x2ef988){return new Promise(function(_0x44354d,_0x174416){var _0x48545a=_0x172ae1[_0x56c3('0x4')]?{[_0x172ae1[_0x56c3('0x4')][_0x56c3('0x5')]]:_0x172ae1[_0x56c3('0x4')][_0x56c3('0xa')]}:undefined;return _0x278c21[_0x172ae1[_0x56c3('0xb')]][_0x56c3('0x6')]({'where':_0x48545a,'raw':!![]})[_0x56c3('0x7')](function(_0x1bc476){_0x2ef988[_0x56c3('0x8')]=_['map'](_0x1bc476,function(_0x2bd5e9){return _0x2bd5e9[_0x56c3('0xc')];});_0x44354d(_0x2ef988);})[_0x56c3('0xd')](function(_0x5e0220){_0x174416(_0x5e0220);});});}function _0x497acc(_0x61f9fc,_0x477ea8,_0xbb78fd){if(!_0x477ea8)return Promise[_0x56c3('0xe')](null);return new Promise(function(_0x2e692c,_0x1f4fde){return _0x278c21[_0x56c3('0xf')]['findAll']({'where':{'sectionId':_0x477ea8['id']},'raw':!![]})[_0x56c3('0x7')](function(_0x357a49){if(_0x61f9fc[_0x56c3('0x5')]&&_0x61f9fc['field']!=='id'){_0x477ea8['associatedResources']=_[_0x56c3('0x9')](_0x357a49,function(_0x292c80){return _0x292c80[_0x61f9fc[_0x56c3('0x5')]];});}else{if(_0xbb78fd===_0x56c3('0x10')){_0x477ea8['associatedResources']=_['map'](_0x357a49,function(_0x4602f6){return{'id':_0x4602f6[_0x56c3('0x11')],'type':_0x4602f6[_0x56c3('0x12')]};});}else{_0x477ea8[_0x56c3('0x8')]=_[_0x56c3('0x9')](_0x357a49,function(_0x4cbcb2){return _0x4cbcb2[_0x56c3('0x11')];});}}_0x2e692c(_0x477ea8);})[_0x56c3('0xd')](function(_0x599216){_0x1f4fde(_0x599216);});});}function _0x4099cf(_0x1f1380,_0x4253fe){var _0x4b9466={'parentSections':[]};switch(_0x1f1380[_0x56c3('0x13')]()){case _0x56c3('0x14'):_0x4b9466[_0x56c3('0x15')]='SquareProject';break;case'odbc':_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x16');break;case _0x56c3('0x17'):_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x18');_0x4b9466[_0x56c3('0x19')]=[{'name':_0x56c3('0x1a'),'field':_0x56c3('0xc'),'foreignKey':_0x56c3('0x1b')}];break;case _0x56c3('0x1c'):_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x1d');break;case'contacts':_0x4b9466['childModel']=_0x56c3('0x1e');_0x4b9466[_0x56c3('0x19')]=[{'name':_0x56c3('0x1f'),'field':'id','foreignKey':_0x56c3('0x20')}];break;case'lists':_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x21');break;case'companies':_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x22');break;case'globalcustomfields':_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x23');break;case _0x56c3('0x24'):_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x25');break;case _0x56c3('0x26'):_0x4b9466[_0x56c3('0x15')]='ChatWebsite';break;case _0x56c3('0x27'):_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x28');break;case'faxaccounts':_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x29');break;case _0x56c3('0x2a'):case _0x56c3('0x2b'):case'outboundroutes':_0x4b9466[_0x56c3('0x15')]='VoiceExtension';break;case _0x56c3('0x2c'):_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x2d');break;case _0x56c3('0x2e'):_0x4b9466['childModel']=_0x56c3('0x2f');break;case _0x56c3('0x30'):_0x4b9466['childModel']=_0x56c3('0x31');_0x4b9466['parentSections']=[{'name':'Agents','field':_0x56c3('0xc'),'foreignKey':_0x56c3('0x32'),'model':'User','filter':{'field':'role','value':[_0x56c3('0x33')]}},{'name':_0x56c3('0x34'),'field':_0x56c3('0xc'),'foreignKey':_0x56c3('0x32'),'model':_0x56c3('0x35'),'filter':{'field':_0x56c3('0x36'),'value':[_0x56c3('0x37')]}},{'name':'VoiceQueues','field':_0x56c3('0xc'),'foreignKey':'queue','model':_0x56c3('0x38'),'filter':{'field':_0x56c3('0x12'),'value':[_0x56c3('0x39')]}},{'name':_0x56c3('0x3a'),'field':_0x56c3('0xc'),'foreignKey':_0x56c3('0x3b'),'model':'VoiceQueue','filter':{'field':'type','value':[_0x56c3('0x3c')]}}];break;case _0x56c3('0x3d'):_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x3e');break;case _0x56c3('0x3f'):_0x4b9466['childModel']=_0x56c3('0x40');break;case _0x56c3('0x41'):_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x42');break;case _0x56c3('0x43'):_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x44');break;case _0x56c3('0x45'):_0x4b9466['childModel']=_0x56c3('0x46');break;case _0x56c3('0x47'):_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x48');break;case _0x56c3('0x49'):_0x4b9466['childModel']=_0x56c3('0x4a');break;case _0x56c3('0x4b'):_0x4b9466[_0x56c3('0x15')]='OpenchannelQueue';break;case _0x56c3('0x4c'):_0x4b9466['childModel']='OpenchannelAccount';break;case'smsqueues':_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x4d');break;case'smsaccounts':_0x4b9466['childModel']=_0x56c3('0x4e');break;case _0x56c3('0x4f'):_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x50');break;case _0x56c3('0x51'):_0x4b9466['childModel']=_0x56c3('0x52');break;case _0x56c3('0x53'):_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x54');break;case _0x56c3('0x55'):case'queuecampaigns':_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x38');if(_0x4253fe){_0x4b9466[_0x56c3('0x19')]=[{'name':_0x56c3('0x56')},{'name':_0x56c3('0x3a')}];}break;case _0x56c3('0x57'):case _0x56c3('0x58'):case _0x56c3('0x59'):_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x35');if(_0x4253fe){_0x4b9466['parentSections']=[{'name':_0x56c3('0x5a'),'filter':{'field':_0x56c3('0x36'),'value':[_0x56c3('0x5b'),_0x56c3('0x5c')]},'ignore':!![]},{'name':'Agents'},{'name':_0x56c3('0x34')}];}break;case _0x56c3('0x5d'):_0x4b9466['childModel']='ZendeskAccount';break;case'salesforceaccounts':_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x5e');break;case _0x56c3('0x5f'):_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x60');break;case _0x56c3('0x61'):_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x62');break;case _0x56c3('0x63'):_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x64');break;case _0x56c3('0x65'):_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x66');break;case _0x56c3('0x67'):_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x35');break;case'cannedanswers':_0x4b9466[_0x56c3('0x15')]='CannedAnswer';break;case'dispositions':_0x4b9466[_0x56c3('0x15')]='Disposition';break;case'customdashboards':_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x68');break;case'intervals':_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x69');break;case _0x56c3('0x6a'):_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x6b');break;case _0x56c3('0x6c'):_0x4b9466['childModel']=_0x56c3('0x6d');break;case _0x56c3('0x6e'):_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x6f');break;case _0x56c3('0x70'):_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x71');break;case _0x56c3('0x72'):_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x73');break;case'triggers':_0x4b9466[_0x56c3('0x15')]='Trigger';break;case _0x56c3('0x74'):_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x75');break;case'variables':_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x76');break;case _0x56c3('0x77'):_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x78');break;case _0x56c3('0x79'):_0x4b9466['childModel']='AnalyticExtractedReport';_0x4b9466[_0x56c3('0x19')]=[{'name':'Reports','field':'id','foreignKey':_0x56c3('0x7a')}];break;case _0x56c3('0x7b'):_0x4b9466[_0x56c3('0x15')]=_0x56c3('0x7c');break;}return _0x4b9466;}function _0x73a837(_0x395664,_0x4ecb6d){var _0x4ab03b=_0x395664[_0x56c3('0x7d')](0x0)['toUpperCase']()+_0x395664['slice'](0x1);var _0x3aa2c6={'type':_0x278c21[_0x56c3('0x7e')]['QueryTypes']['SELECT'],'raw':!![]};return new Promise(function(_0x1ee2f4,_0xecd189){var _0xc36286=squel[_0x56c3('0x7f')]()['field'](_0x56c3('0x80')+_0x4ab03b+_0x56c3('0x81'),'id')[_0x56c3('0x5')](_0x56c3('0x82'))[_0x56c3('0x83')](_0x56c3('0x84')+_0x395664+_0x56c3('0x85'),'ui')[_0x56c3('0x86')](_0x56c3('0x87'),_0x4ecb6d['id']);return _0x278c21[_0x56c3('0x88')][_0x56c3('0x89')](_0xc36286['toString'](),_0x3aa2c6)[_0x56c3('0x7')](function(_0x4573e2){_0x4ecb6d[_0x4ab03b+_0x56c3('0x8a')]=_0x4573e2;_0x1ee2f4(_0x4573e2);})[_0x56c3('0xd')](function(_0x358b65){_0xecd189(_0x358b65);});});}return _0x257a71[_0x56c3('0x8b')](_0x56c3('0x8c'),attributes,{'tableName':_0x56c3('0x8d'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x4f2939){var _0x12ba61={'raw':_0x4f2939[_0x56c3('0x89')][_0x56c3('0x8e')],'where':{}};var _0x15cbd3={};var _0x34eec6={'count':0x0,'rows':[]};var _0x4d0493=_0x4f2939[_0x56c3('0x89')][_0x56c3('0x8f')];var _0x44599d=_0x4f2939[_0x56c3('0x89')]['mergeResources']||![];var _0x4fe0d9=_0x4099cf(_0x4d0493,_0x44599d);if(!_0x4fe0d9[_0x56c3('0x15')])throw new Error('Invalid\x20section\x20\x27'+_0x4d0493+'\x27');var _0x4cc812=[{'name':_0x4d0493}];if(!_[_0x56c3('0x90')](_0x4fe0d9[_0x56c3('0x19')]))_0x4cc812=_0x4fe0d9['parentSections'];var _0x51cc13=[];for(var _0x4519a4=0x0;_0x4519a4<_0x4cc812['length'];_0x4519a4++){_0x51cc13['push'](_0x278c21[_0x56c3('0x91')][_0x56c3('0x92')]({'where':{'userProfileId':_0x4f2939[_0x56c3('0x93')]['id'],'name':_0x4cc812[_0x4519a4][_0x56c3('0xc')]},'raw':!![]}));}return Promise[_0x56c3('0x94')](_0x51cc13)[_0x56c3('0x7')](function(_0x29a8bf){var _0x2e3384=_[_0x56c3('0x4')](_0x29a8bf,function(_0x5e06ae){return _0x5e06ae?_0x5e06ae:undefined;});var _0x18443b=_[_0x56c3('0x4')](_0x4cc812,[_0x56c3('0x95'),!![]]);var _0x269505=_[_0x56c3('0x90')](_0x2e3384)&&_[_0x56c3('0x90')](_0x18443b)?null:_[_0x56c3('0x96')](_0x18443b,_0x2e3384);if(!_0x269505)return null;var _0x5ad8cf=[];for(var _0xa746b=0x0;_0xa746b<_0x269505[_0x56c3('0x97')];_0xa746b++){var _0x355d76=_['find'](_0x4cc812,function(_0x48ac08){return _0x269505[_0xa746b]?_0x48ac08['name']===_0x269505[_0xa746b][_0x56c3('0xc')]:null;});if(_0x355d76){if(_0x269505[_0xa746b][_0x56c3('0x95')]){_0x5ad8cf[_0x56c3('0x98')](_0xd2f938(_0x4fe0d9[_0x56c3('0x15')],_0x269505[_0xa746b]));}else{if(!_0x269505[_0xa746b][_0x56c3('0x99')]){_0x5ad8cf[_0x56c3('0x98')](_0x497acc(_0x355d76,_0x269505[_0xa746b],_0x4fe0d9[_0x56c3('0x15')]));}else{if(_0x355d76[_0x56c3('0xb')]){_0x5ad8cf[_0x56c3('0x98')](_0x1bb78b(_0x355d76,_0x269505[_0xa746b]));}}}}}return Promise[_0x56c3('0x94')](_0x5ad8cf);})['then'](function(_0x321fb7){var _0xef1209=_0x321fb7;var _0x27747e=null;if(_0xef1209){_0x27747e=_0xef1209[_0x56c3('0x97')]===0x1?_0xef1209[0x0]:null;}if(!_0x27747e&&!_0xef1209)return _0x34eec6;var _0x58553f=_0x278c21[_0x4fe0d9[_0x56c3('0x15')]]['rawAttributes'];_0x15cbd3['model']=_[_0x56c3('0x9a')](_0x58553f);_0x15cbd3[_0x56c3('0x89')]=_['keys'](_0x4f2939['query']);_0x15cbd3[_0x56c3('0x9b')]=_['intersection'](_0x15cbd3['model'],_0x15cbd3[_0x56c3('0x89')]);_0x12ba61[_0x56c3('0x9c')]=_['intersection'](_0x15cbd3['model'],qs[_0x56c3('0x9d')](_0x4f2939[_0x56c3('0x89')][_0x56c3('0x9d')]));_0x12ba61['attributes']=_0x12ba61[_0x56c3('0x9c')]['length']?_0x12ba61[_0x56c3('0x9c')]:_0x15cbd3[_0x56c3('0xb')];if(!_0x4f2939[_0x56c3('0x89')][_0x56c3('0x9e')](_0x56c3('0x9f'))){_0x12ba61[_0x56c3('0xa0')]=qs[_0x56c3('0xa0')](_0x4f2939[_0x56c3('0x89')][_0x56c3('0xa0')]);_0x12ba61[_0x56c3('0xa1')]=qs[_0x56c3('0xa1')](_0x4f2939[_0x56c3('0x89')][_0x56c3('0xa1')]);}_0x12ba61[_0x56c3('0xa2')]=qs[_0x56c3('0xa3')](_0x4f2939[_0x56c3('0x89')][_0x56c3('0xa3')]);_0x12ba61['where']=qs[_0x56c3('0x9b')](_[_0x56c3('0xa4')](_0x4f2939[_0x56c3('0x89')],_0x15cbd3[_0x56c3('0x9b')]));if(_0x4f2939[_0x56c3('0x89')][_0x56c3('0x4')]){_0x12ba61[_0x56c3('0x86')]=_[_0x56c3('0xa5')](_0x12ba61[_0x56c3('0x86')],{'$or':_[_0x56c3('0x9')](_0x58553f,function(_0x108160){if(_0x108160[_0x56c3('0x12')][_0x56c3('0xa6')]!==_0x56c3('0xa7')){var _0x2f9d54={};_0x2f9d54[_0x108160[_0x56c3('0x5')]]={'$like':'%'+_0x4f2939[_0x56c3('0x89')][_0x56c3('0x4')]+'%'};return _0x2f9d54;}})});}var _0x25c849=[];var _0x204e5f=null;var _0x5d2241={};if(_0x27747e){_0x204e5f=_['find'](_0x4cc812,[_0x56c3('0xc'),_0x27747e['name']]);if(_0x204e5f[_0x56c3('0x5')]){_0x5d2241={};if(_0x4fe0d9[_0x56c3('0x15')]===_0x56c3('0x10')){_0x5d2241[_0x204e5f[_0x56c3('0xa8')]]=_[_0x56c3('0x9')](_0x27747e[_0x56c3('0x8')],'id');}else{_0x5d2241[_0x204e5f[_0x56c3('0xa8')]]=_0x27747e[_0x56c3('0x8')];}_0x25c849[_0x56c3('0x98')](_0x5d2241);}else{_0x12ba61[_0x56c3('0x86')]['id']=_0x27747e[_0x56c3('0x8')];}}else{for(var _0xc3b26f=0x0;_0xc3b26f<_0xef1209[_0x56c3('0x97')];_0xc3b26f++){_0x204e5f=_[_0x56c3('0x92')](_0x4cc812,[_0x56c3('0xc'),_0xef1209[_0xc3b26f][_0x56c3('0xc')]]);if(_0x204e5f[_0x56c3('0x5')]){_0x5d2241={};_0x5d2241[_0x204e5f[_0x56c3('0xa8')]]=_0xef1209[_0xc3b26f]['associatedResources'];_0x25c849[_0x56c3('0x98')](_0x5d2241);}else{if(!_0x12ba61['where']['id'])_0x12ba61['where']['id']=[];_0xef1209[_0xc3b26f][_0x56c3('0x8')][_0x56c3('0xa9')](function(_0x55dfac){_0x12ba61['where']['id'][_0x56c3('0x98')](_0x55dfac);});}}}if(!_[_0x56c3('0x90')](_0x25c849)){_0x12ba61[_0x56c3('0x86')]=_[_0x56c3('0xa5')](_0x12ba61[_0x56c3('0x86')],{'$and':{'$or':_0x25c849}});}_0x12ba61=_[_0x56c3('0xa5')]({},_0x12ba61,_0x4f2939[_0x56c3('0xaa')]);if(_0x27747e&&!_0x27747e[_0x56c3('0x99')]&&_0x4fe0d9[_0x56c3('0x15')]===_0x56c3('0x10')){if(_0x4f2939['query'][_0x56c3('0xab')]){_0x12ba61[_0x56c3('0xac')]=[{'all':!![]}];}return _0x278c21[_0x4fe0d9[_0x56c3('0x15')]][_0x56c3('0x6')](_0x12ba61)[_0x56c3('0x7')](function(_0x254608){var _0x195c00=[];_0x254608['forEach'](function(_0x18a73e){var _0x474daf;switch(_0x18a73e['reportType']){case _0x56c3('0xad'):_0x474daf=_[_0x56c3('0x92')](_0x27747e[_0x56c3('0x8')],function(_0x569424){return _0x569424['id']===_0x18a73e[_0x56c3('0x7a')]&&_0x569424[_0x56c3('0x12')]===_0x56c3('0xae');});break;case _0x56c3('0xaf'):_0x474daf=_[_0x56c3('0x92')](_0x27747e[_0x56c3('0x8')],function(_0x4e74a0){return _0x4e74a0['id']===_0x18a73e[_0x56c3('0x7a')]&&_0x4e74a0[_0x56c3('0x12')]===_0x56c3('0xb0');});break;}if(_0x474daf)_0x195c00['push'](_0x18a73e);});_0x34eec6[_0x56c3('0xb1')]=_0x195c00[_0x56c3('0x97')];_0x34eec6[_0x56c3('0xb2')]=_0x195c00;return _0x34eec6;});}else{if(!_['isEmpty'](_0x4f2939[_0x56c3('0x89')][_0x56c3('0xb3')])){_0x12ba61[_0x56c3('0x86')]['id']=_0x12ba61['where']['id']?_[_0x56c3('0xb4')](_0x12ba61[_0x56c3('0x86')]['id'],_0x4f2939[_0x56c3('0x89')][_0x56c3('0xb3')]):_0x4f2939['query'][_0x56c3('0xb3')];if(_0x4f2939['query'][_0x56c3('0xb5')]){_0x12ba61[_0x56c3('0xa2')]=_0x4f2939[_0x56c3('0x89')]['customSorting'];}}if(_0x4f2939[_0x56c3('0x89')][_0x56c3('0xb6')]){_0x12ba61['where']=_[_0x56c3('0xa5')](_0x12ba61[_0x56c3('0x86')],{'$and':_0x4f2939[_0x56c3('0x89')]['extraQueryConditions']});}return _0x278c21[_0x4fe0d9['childModel']][_0x56c3('0xb1')]({'where':_0x12ba61['where']})['then'](function(_0x26e479){_0x34eec6[_0x56c3('0xb1')]=_0x26e479;if(_0x4f2939[_0x56c3('0x89')]['includeAll']){if(_0x4fe0d9[_0x56c3('0x15')]==='CmContact'){_0x12ba61[_0x56c3('0xac')]=[{'model':_0x278c21['Tag'],'as':_0x56c3('0xb7'),'attributes':['id',_0x56c3('0xc'),_0x56c3('0xb8')],'required':_0x4f2939[_0x56c3('0x89')]['tag']?!![]:![]},{'model':_0x278c21['Tag'],'as':_0x56c3('0xb9'),'attributes':['id','name','color'],'through':_0x4f2939[_0x56c3('0x89')][_0x56c3('0xba')]?{'attributes':[],'where':{'TagId':_0x4f2939[_0x56c3('0x89')][_0x56c3('0xba')]||undefined}}:{},'required':_0x4f2939['query']['tag']?!![]:![]}];}else{_0x12ba61['include']=[{'all':!![]}];}}return _0x278c21[_0x4fe0d9[_0x56c3('0x15')]][_0x56c3('0x6')](_0x12ba61);})[_0x56c3('0x7')](function(_0xc3e8e7){_0x34eec6[_0x56c3('0xb2')]=_0xc3e8e7;if(_0x4d0493===_0x56c3('0xbb')&&_0x4f2939[_0x56c3('0x89')]['openTabs']==='true'){var _0x47682d=[];for(var _0xb88a75=0x0;_0xb88a75<_0x34eec6[_0x56c3('0xb2')][_0x56c3('0x97')];_0xb88a75++){_0x47682d[_0x56c3('0x98')](_0x73a837(_0x56c3('0xbc'),_0x34eec6[_0x56c3('0xb2')][_0xb88a75][_0x56c3('0xbd')]));_0x47682d[_0x56c3('0x98')](_0x73a837('sms',_0x34eec6[_0x56c3('0xb2')][_0xb88a75]['dataValues']));_0x47682d[_0x56c3('0x98')](_0x73a837('fax',_0x34eec6[_0x56c3('0xb2')][_0xb88a75][_0x56c3('0xbd')]));_0x47682d['push'](_0x73a837(_0x56c3('0xbe'),_0x34eec6['rows'][_0xb88a75][_0x56c3('0xbd')]));_0x47682d[_0x56c3('0x98')](_0x73a837(_0x56c3('0xbf'),_0x34eec6[_0x56c3('0xb2')][_0xb88a75][_0x56c3('0xbd')]));_0x47682d[_0x56c3('0x98')](_0x73a837(_0x56c3('0xc0'),_0x34eec6['rows'][_0xb88a75]['dataValues']));}return Promise[_0x56c3('0x94')](_0x47682d)[_0x56c3('0x7')](function(){return _0x34eec6;});}return _0x34eec6;});}});}}});};
\ No newline at end of file
index e5b48b1..5bc467a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c8b=['client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x8c8b,0x106));var _0xb8c8=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8c8b[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xb8c8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb8c8('0x1'));var rs=require(_0xb8c8('0x2'));var fs=require('fs');var Redis=require(_0xb8c8('0x3'));var db=require(_0xb8c8('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb8c8('0x5'));var config=require(_0xb8c8('0x6'));var jayson=require(_0xb8c8('0x7'));var client=jayson[_0xb8c8('0x8')][_0xb8c8('0x9')]({'port':0x232a});config[_0xb8c8('0xa')]=_[_0xb8c8('0xb')](config[_0xb8c8('0xa')],{'host':_0xb8c8('0xc'),'port':0x18eb});var socket=require(_0xb8c8('0xd'))(new Redis(config[_0xb8c8('0xa')]));require('./userProfile.socket')[_0xb8c8('0xe')](socket);function respondWithRpcPromise(_0x3e6f56,_0x406e1e,_0x1db0e7){return new BPromise(function(_0x3c74d5,_0x3414ec){return client[_0xb8c8('0xf')](_0x3e6f56,_0x1db0e7)[_0xb8c8('0x10')](function(_0x8814ad){logger[_0xb8c8('0x11')](_0xb8c8('0x12'),_0x406e1e,_0xb8c8('0x13'));logger['debug'](_0xb8c8('0x14'),_0x406e1e,'request\x20sent',JSON[_0xb8c8('0x15')](_0x8814ad));if(_0x8814ad[_0xb8c8('0x16')]){if(_0x8814ad['error'][_0xb8c8('0x17')]===0x1f4){logger[_0xb8c8('0x16')](_0xb8c8('0x12'),_0x406e1e,_0x8814ad['error'][_0xb8c8('0x18')]);return _0x3414ec(_0x8814ad[_0xb8c8('0x16')][_0xb8c8('0x18')]);}logger[_0xb8c8('0x16')]('UserProfile,\x20%s,\x20%s',_0x406e1e,_0x8814ad[_0xb8c8('0x16')][_0xb8c8('0x18')]);return _0x3c74d5(_0x8814ad[_0xb8c8('0x16')][_0xb8c8('0x18')]);}else{logger['info'](_0xb8c8('0x12'),_0x406e1e,_0xb8c8('0x13'));_0x3c74d5(_0x8814ad[_0xb8c8('0x19')][_0xb8c8('0x18')]);}})[_0xb8c8('0x1a')](function(_0x1cbded){logger[_0xb8c8('0x16')](_0xb8c8('0x12'),_0x406e1e,_0x1cbded);_0x3414ec(_0x1cbded);});});}
\ No newline at end of file
+var _0x7c1a=['../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','./userProfile.socket','request','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x54c916,_0x1fb338){var _0x332fc5=function(_0x395bf7){while(--_0x395bf7){_0x54c916['push'](_0x54c916['shift']());}};_0x332fc5(++_0x1fb338);}(_0x7c1a,0x159));var _0xa7c1=function(_0x41d72c,_0x105d4b){_0x41d72c=_0x41d72c-0x0;var _0x26f22b=_0x7c1a[_0x41d72c];return _0x26f22b;};'use strict';var _=require(_0xa7c1('0x0'));var util=require(_0xa7c1('0x1'));var moment=require(_0xa7c1('0x2'));var BPromise=require(_0xa7c1('0x3'));var rs=require(_0xa7c1('0x4'));var fs=require('fs');var Redis=require(_0xa7c1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa7c1('0x6'));var logger=require(_0xa7c1('0x7'))('rpc');var config=require(_0xa7c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa7c1('0x9')][_0xa7c1('0xa')]({'port':0x232a});config[_0xa7c1('0xb')]=_[_0xa7c1('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa7c1('0xd'))(new Redis(config[_0xa7c1('0xb')]));require(_0xa7c1('0xe'))['register'](socket);function respondWithRpcPromise(_0x3cdeaa,_0x16bf94,_0x359454){return new BPromise(function(_0x4f2957,_0x169d72){return client[_0xa7c1('0xf')](_0x3cdeaa,_0x359454)['then'](function(_0x309790){logger[_0xa7c1('0x10')]('UserProfile,\x20%s,\x20%s',_0x16bf94,_0xa7c1('0x11'));logger[_0xa7c1('0x12')](_0xa7c1('0x13'),_0x16bf94,_0xa7c1('0x11'),JSON[_0xa7c1('0x14')](_0x309790));if(_0x309790[_0xa7c1('0x15')]){if(_0x309790[_0xa7c1('0x15')][_0xa7c1('0x16')]===0x1f4){logger[_0xa7c1('0x15')](_0xa7c1('0x17'),_0x16bf94,_0x309790[_0xa7c1('0x15')][_0xa7c1('0x18')]);return _0x169d72(_0x309790[_0xa7c1('0x15')]['message']);}logger[_0xa7c1('0x15')](_0xa7c1('0x17'),_0x16bf94,_0x309790[_0xa7c1('0x15')][_0xa7c1('0x18')]);return _0x4f2957(_0x309790[_0xa7c1('0x15')]['message']);}else{logger[_0xa7c1('0x10')]('UserProfile,\x20%s,\x20%s',_0x16bf94,_0xa7c1('0x11'));_0x4f2957(_0x309790[_0xa7c1('0x19')]['message']);}})[_0xa7c1('0x1a')](function(_0x19198b){logger[_0xa7c1('0x15')]('UserProfile,\x20%s,\x20%s',_0x16bf94,_0x19198b);_0x169d72(_0x19198b);});});}
\ No newline at end of file
index 981a2c3..52689ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf55f=['remove','update','removeListener','register','userProfile:','save'];(function(_0x2b8b71,_0x31f4b8){var _0x403dec=function(_0x4c9ad5){while(--_0x4c9ad5){_0x2b8b71['push'](_0x2b8b71['shift']());}};_0x403dec(++_0x31f4b8);}(_0xf55f,0x1d3));var _0xff55=function(_0x44b585,_0x120e48){_0x44b585=_0x44b585-0x0;var _0x38dd43=_0xf55f[_0x44b585];return _0x38dd43;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xff55('0x0'),_0xff55('0x1'),_0xff55('0x2')];function createListener(_0x121716,_0x51ec4c){return function(_0x201194){_0x51ec4c['emit'](_0x121716,_0x201194);};}function removeListener(_0x550a6b,_0x19c1db){return function(){UserProfileEvents[_0xff55('0x3')](_0x550a6b,_0x19c1db);};}exports[_0xff55('0x4')]=function(_0x110535){for(var _0x1f38e7=0x0,_0xe83a1e=events['length'];_0x1f38e7<_0xe83a1e;_0x1f38e7++){var _0x582e41=events[_0x1f38e7];var _0x2c647d=createListener(_0xff55('0x5')+_0x582e41,_0x110535);UserProfileEvents['on'](_0x582e41,_0x2c647d);}};
\ No newline at end of file
+var _0xf29c=['removeListener','register','userProfile:','remove'];(function(_0x3b7133,_0x11c0cb){var _0x2d9598=function(_0xc49ae2){while(--_0xc49ae2){_0x3b7133['push'](_0x3b7133['shift']());}};_0x2d9598(++_0x11c0cb);}(_0xf29c,0x7b));var _0xcf29=function(_0x1a30b1,_0x392595){_0x1a30b1=_0x1a30b1-0x0;var _0x361b4f=_0xf29c[_0x1a30b1];return _0x361b4f;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=['save',_0xcf29('0x0'),'update'];function createListener(_0x53ece7,_0x1cff9b){return function(_0x509b67){_0x1cff9b['emit'](_0x53ece7,_0x509b67);};}function removeListener(_0x12fc38,_0x288fa8){return function(){UserProfileEvents[_0xcf29('0x1')](_0x12fc38,_0x288fa8);};}exports[_0xcf29('0x2')]=function(_0x72d32){for(var _0x52b67b=0x0,_0x3d725a=events['length'];_0x52b67b<_0x3d725a;_0x52b67b++){var _0x39a909=events[_0x52b67b];var _0x29b414=createListener(_0xcf29('0x3')+_0x39a909,_0x72d32);UserProfileEvents['on'](_0x39a909,_0x29b414);}};
\ No newline at end of file
index c7d0eac..8d16607 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82bf=['exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','index','/describe','describe','isAuthenticated','show','post','create','put','/:id','update','delete'];(function(_0x43eadd,_0x36ca50){var _0x125bde=function(_0x5d74cf){while(--_0x5d74cf){_0x43eadd['push'](_0x43eadd['shift']());}};_0x125bde(++_0x36ca50);}(_0x82bf,0xd3));var _0xf82b=function(_0x5f191f,_0x5c5033){_0x5f191f=_0x5f191f-0x0;var _0x41e2c3=_0x82bf[_0x5f191f];return _0x41e2c3;};'use strict';var multer=require('multer');var util=require(_0xf82b('0x0'));var path=require(_0xf82b('0x1'));var timeout=require(_0xf82b('0x2'));var express=require(_0xf82b('0x3'));var router=express['Router']();var fs_extra=require(_0xf82b('0x4'));var auth=require(_0xf82b('0x5'));var interaction=require(_0xf82b('0x6'));var config=require('../../config/environment');var controller=require(_0xf82b('0x7'));router[_0xf82b('0x8')]('/',auth['isAuthenticated'](),controller[_0xf82b('0x9')]);router['get'](_0xf82b('0xa'),auth['isAuthenticated'](),controller[_0xf82b('0xb')]);router[_0xf82b('0x8')]('/:id',auth[_0xf82b('0xc')](),controller[_0xf82b('0xd')]);router[_0xf82b('0xe')]('/',auth[_0xf82b('0xc')](),controller[_0xf82b('0xf')]);router[_0xf82b('0x10')](_0xf82b('0x11'),auth[_0xf82b('0xc')](),controller[_0xf82b('0x12')]);router[_0xf82b('0x13')](_0xf82b('0x11'),auth[_0xf82b('0xc')](),controller['destroy']);module[_0xf82b('0x14')]=router;
\ No newline at end of file
+var _0x89de=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','post','create','put','destroy','util','path','connect-timeout','express','Router'];(function(_0x4a6912,_0x4971af){var _0x52febb=function(_0x345d62){while(--_0x345d62){_0x4a6912['push'](_0x4a6912['shift']());}};_0x52febb(++_0x4971af);}(_0x89de,0x72));var _0xe89d=function(_0x4b0309,_0xa755c3){_0x4b0309=_0x4b0309-0x0;var _0x3d9245=_0x89de[_0x4b0309];return _0x3d9245;};'use strict';var multer=require('multer');var util=require(_0xe89d('0x0'));var path=require(_0xe89d('0x1'));var timeout=require(_0xe89d('0x2'));var express=require(_0xe89d('0x3'));var router=express[_0xe89d('0x4')]();var fs_extra=require(_0xe89d('0x5'));var auth=require(_0xe89d('0x6'));var interaction=require(_0xe89d('0x7'));var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router[_0xe89d('0x8')]('/',auth[_0xe89d('0x9')](),controller[_0xe89d('0xa')]);router[_0xe89d('0x8')](_0xe89d('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xe89d('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xe89d('0xd')]('/',auth[_0xe89d('0x9')](),controller[_0xe89d('0xe')]);router[_0xe89d('0xf')]('/:id',auth[_0xe89d('0x9')](),controller['update']);router['delete'](_0xe89d('0xc'),auth[_0xe89d('0x9')](),controller[_0xe89d('0x10')]);module['exports']=router;
\ No newline at end of file
index 9349917..c0ab912 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1b8=['STRING','INTEGER','sequelize'];(function(_0x5281b9,_0xa35e81){var _0x38fe76=function(_0x34d1b4){while(--_0x34d1b4){_0x5281b9['push'](_0x5281b9['shift']());}};_0x38fe76(++_0xa35e81);}(_0xa1b8,0x74));var _0x8a1b=function(_0x19cb5e,_0x8403d4){_0x19cb5e=_0x19cb5e-0x0;var _0x1b4fa2=_0xa1b8[_0x19cb5e];return _0x1b4fa2;};'use strict';var Sequelize=require(_0x8a1b('0x0'));module['exports']={'name':{'type':Sequelize[_0x8a1b('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x8a1b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8a1b('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xd407=['sequelize','exports','STRING','INTEGER'];(function(_0x59f4e5,_0x2be566){var _0x3b2a54=function(_0x40c857){while(--_0x40c857){_0x59f4e5['push'](_0x59f4e5['shift']());}};_0x3b2a54(++_0x2be566);}(_0xd407,0xb0));var _0x7d40=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd407[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7d40('0x0'));module[_0x7d40('0x1')]={'name':{'type':Sequelize[_0x7d40('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x7d40('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x7d40('0x2')],'allowNull':![]}};
\ No newline at end of file
index 6e95252..717d712 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a85=['describe','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','squel','crypto','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','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','map','VIRTUAL','merge','options','include','findAll','rows','catch','show','fields','includeAll','find','create','body','params','destroy'];(function(_0x111c69,_0x5445d8){var _0x5635bc=function(_0x1cfc18){while(--_0x1cfc18){_0x111c69['push'](_0x111c69['shift']());}};_0x5635bc(++_0x5445d8);}(_0x1a85,0x178));var _0x51a8=function(_0xee12a3,_0x4d2c79){_0xee12a3=_0xee12a3-0x0;var _0x41a6a2=_0x1a85[_0xee12a3];return _0x41a6a2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x51a8('0x0'));var jsonpatch=require(_0x51a8('0x1'));var rp=require(_0x51a8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x51a8('0x3'));var util=require(_0x51a8('0x4'));var path=require(_0x51a8('0x5'));var sox=require('sox');var csv=require(_0x51a8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51a8('0x7'));var _=require('lodash');var squel=require(_0x51a8('0x8'));var crypto=require(_0x51a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x51a8('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51a8('0xb'));var Redis=require(_0x51a8('0xc'));var authService=require(_0x51a8('0xd'));var qs=require(_0x51a8('0xe'));var as=require(_0x51a8('0xf'));var hardwareService=require(_0x51a8('0x10'));var logger=require(_0x51a8('0x11'))(_0x51a8('0x12'));var utils=require(_0x51a8('0x13'));var config=require(_0x51a8('0x14'));var licenseUtil=require(_0x51a8('0x15'));var db=require(_0x51a8('0x16'))['db'];function respondWithStatusCode(_0x38a1d2,_0x1827e6){_0x1827e6=_0x1827e6||0xcc;return function(_0x43c042){if(_0x43c042){return _0x38a1d2[_0x51a8('0x17')](_0x1827e6);}return _0x38a1d2[_0x51a8('0x18')](_0x1827e6)['end']();};}function respondWithResult(_0x461f5c,_0x7a4c36){_0x7a4c36=_0x7a4c36||0xc8;return function(_0xaec066){if(_0xaec066){return _0x461f5c['status'](_0x7a4c36)[_0x51a8('0x19')](_0xaec066);}};}function respondWithFilteredResult(_0x547d40,_0x10584b){return function(_0x2b8d37){if(_0x2b8d37){var _0x39cd45=typeof _0x10584b[_0x51a8('0x1a')]===_0x51a8('0x1b')&&typeof _0x10584b[_0x51a8('0x1c')]===_0x51a8('0x1b');var _0x516abc=_0x2b8d37[_0x51a8('0x1d')];var _0x45a433=_0x39cd45?0x0:_0x10584b[_0x51a8('0x1a')];var _0x23539e=_0x39cd45?_0x2b8d37[_0x51a8('0x1d')]:_0x10584b[_0x51a8('0x1a')]+_0x10584b['limit'];var _0x1df8c2;if(_0x23539e>=_0x516abc){_0x23539e=_0x516abc;_0x1df8c2=0xc8;}else{_0x1df8c2=0xce;}_0x547d40[_0x51a8('0x18')](_0x1df8c2);return _0x547d40[_0x51a8('0x1e')](_0x51a8('0x1f'),_0x45a433+'-'+_0x23539e+'/'+_0x516abc)[_0x51a8('0x19')](_0x2b8d37);}return null;};}function patchUpdates(_0x3bc044){return function(_0x28aea0){try{jsonpatch[_0x51a8('0x20')](_0x28aea0,_0x3bc044,!![]);}catch(_0x5ac1c0){return BPromise[_0x51a8('0x21')](_0x5ac1c0);}return _0x28aea0['save']();};}function saveUpdates(_0xfe0ddb,_0x12c029){return function(_0x8bda40){if(_0x8bda40){return _0x8bda40[_0x51a8('0x22')](_0xfe0ddb)['then'](function(_0xae3588){return _0xae3588;});}return null;};}function removeEntity(_0x4b9cdd,_0x47f063){return function(_0x23d26a){if(_0x23d26a){return _0x23d26a['destroy']()[_0x51a8('0x23')](function(){_0x4b9cdd[_0x51a8('0x18')](0xcc)[_0x51a8('0x24')]();});}};}function handleEntityNotFound(_0x18e2f3,_0x157554){return function(_0x2f2f05){if(!_0x2f2f05){_0x18e2f3[_0x51a8('0x17')](0x194);}return _0x2f2f05;};}function handleError(_0x1326a2,_0x5b3f49){_0x5b3f49=_0x5b3f49||0x1f4;return function(_0x273ce2){logger[_0x51a8('0x25')](_0x273ce2[_0x51a8('0x26')]);if(_0x273ce2[_0x51a8('0x27')]){delete _0x273ce2[_0x51a8('0x27')];}_0x1326a2[_0x51a8('0x18')](_0x5b3f49)[_0x51a8('0x28')](_0x273ce2);};}exports[_0x51a8('0x29')]=function(_0xec08ae,_0x4b5cda){var _0x20c6b5={},_0x347a02={},_0x4a1548={'count':0x0,'rows':[]};var _0x2f9d53=_['map'](db[_0x51a8('0x2a')][_0x51a8('0x2b')],function(_0x143f46){return{'name':_0x143f46[_0x51a8('0x2c')],'type':_0x143f46[_0x51a8('0x2d')]['key']};});_0x347a02[_0x51a8('0x2e')]=_['map'](_0x2f9d53,_0x51a8('0x27'));_0x347a02[_0x51a8('0x2f')]=_[_0x51a8('0x30')](_0xec08ae['query']);_0x347a02[_0x51a8('0x31')]=_['intersection'](_0x347a02[_0x51a8('0x2e')],_0x347a02[_0x51a8('0x2f')]);_0x20c6b5[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x347a02[_0x51a8('0x2e')],qs['fields'](_0xec08ae[_0x51a8('0x2f')]['fields']));_0x20c6b5[_0x51a8('0x32')]=_0x20c6b5[_0x51a8('0x32')][_0x51a8('0x34')]?_0x20c6b5['attributes']:_0x347a02[_0x51a8('0x2e')];if(!_0xec08ae[_0x51a8('0x2f')][_0x51a8('0x35')](_0x51a8('0x36'))){_0x20c6b5[_0x51a8('0x1c')]=qs['limit'](_0xec08ae['query']['limit']);_0x20c6b5[_0x51a8('0x1a')]=qs[_0x51a8('0x1a')](_0xec08ae['query'][_0x51a8('0x1a')]);}_0x20c6b5['order']=qs[_0x51a8('0x37')](_0xec08ae[_0x51a8('0x2f')][_0x51a8('0x37')]);_0x20c6b5[_0x51a8('0x38')]=qs[_0x51a8('0x31')](_[_0x51a8('0x39')](_0xec08ae['query'],_0x347a02['filters']),_0x2f9d53);if(_0xec08ae[_0x51a8('0x2f')]['filter']){_0x20c6b5['where']=_['merge'](_0x20c6b5[_0x51a8('0x38')],{'$or':_[_0x51a8('0x3a')](_0x2f9d53,function(_0x3cbf97){if(_0x3cbf97['type']!==_0x51a8('0x3b')){var _0x25d772={};_0x25d772[_0x3cbf97[_0x51a8('0x27')]]={'$like':'%'+_0xec08ae[_0x51a8('0x2f')]['filter']+'%'};return _0x25d772;}})});}_0x20c6b5=_[_0x51a8('0x3c')]({},_0x20c6b5,_0xec08ae[_0x51a8('0x3d')]);var _0x1b0333={'where':_0x20c6b5['where']};return db[_0x51a8('0x2a')]['count'](_0x1b0333)[_0x51a8('0x23')](function(_0x1e637a){_0x4a1548[_0x51a8('0x1d')]=_0x1e637a;if(_0xec08ae[_0x51a8('0x2f')]['includeAll']){_0x20c6b5[_0x51a8('0x3e')]=[{'all':!![]}];}return db[_0x51a8('0x2a')][_0x51a8('0x3f')](_0x20c6b5);})[_0x51a8('0x23')](function(_0xa33fc){_0x4a1548[_0x51a8('0x40')]=_0xa33fc;return _0x4a1548;})[_0x51a8('0x23')](respondWithFilteredResult(_0x4b5cda,_0x20c6b5))[_0x51a8('0x41')](handleError(_0x4b5cda,null));};exports[_0x51a8('0x42')]=function(_0x4b8467,_0x22e6e6){var _0x2afb74={'raw':![],'where':{'id':_0x4b8467['params']['id']}},_0x4c7c67={};_0x4c7c67[_0x51a8('0x2e')]=_[_0x51a8('0x30')](db[_0x51a8('0x2a')][_0x51a8('0x2b')]);_0x4c7c67[_0x51a8('0x2f')]=_[_0x51a8('0x30')](_0x4b8467[_0x51a8('0x2f')]);_0x4c7c67[_0x51a8('0x31')]=_[_0x51a8('0x33')](_0x4c7c67[_0x51a8('0x2e')],_0x4c7c67['query']);_0x2afb74[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x4c7c67[_0x51a8('0x2e')],qs[_0x51a8('0x43')](_0x4b8467[_0x51a8('0x2f')][_0x51a8('0x43')]));_0x2afb74['attributes']=_0x2afb74[_0x51a8('0x32')]['length']?_0x2afb74[_0x51a8('0x32')]:_0x4c7c67[_0x51a8('0x2e')];if(_0x4b8467[_0x51a8('0x2f')][_0x51a8('0x44')]){_0x2afb74[_0x51a8('0x3e')]=[{'all':!![]}];}_0x2afb74=_['merge']({},_0x2afb74,_0x4b8467['options']);return db[_0x51a8('0x2a')][_0x51a8('0x45')](_0x2afb74)[_0x51a8('0x23')](handleEntityNotFound(_0x22e6e6,null))[_0x51a8('0x23')](respondWithResult(_0x22e6e6,null))[_0x51a8('0x41')](handleError(_0x22e6e6,null));};exports['create']=function(_0x504a43,_0xcbd998){return db[_0x51a8('0x2a')][_0x51a8('0x46')](_0x504a43[_0x51a8('0x47')],{})[_0x51a8('0x23')](respondWithResult(_0xcbd998,0xc9))[_0x51a8('0x41')](handleError(_0xcbd998,null));};exports[_0x51a8('0x22')]=function(_0x1103a3,_0x301578){if(_0x1103a3['body']['id']){delete _0x1103a3['body']['id'];}return db['UserProfileResource'][_0x51a8('0x45')]({'where':{'id':_0x1103a3[_0x51a8('0x48')]['id']}})[_0x51a8('0x23')](handleEntityNotFound(_0x301578,null))['then'](saveUpdates(_0x1103a3[_0x51a8('0x47')],null))[_0x51a8('0x23')](respondWithResult(_0x301578,null))['catch'](handleError(_0x301578,null));};exports[_0x51a8('0x49')]=function(_0x4fb93c,_0x50a2f8){return db[_0x51a8('0x2a')][_0x51a8('0x45')]({'where':{'id':_0x4fb93c[_0x51a8('0x48')]['id']}})['then'](handleEntityNotFound(_0x50a2f8,null))['then'](removeEntity(_0x50a2f8,null))[_0x51a8('0x41')](handleError(_0x50a2f8,null));};exports['describe']=function(_0x21c4da,_0xc89617){return db[_0x51a8('0x2a')][_0x51a8('0x4a')]()[_0x51a8('0x23')](respondWithResult(_0xc89617,null))[_0x51a8('0x41')](handleError(_0xc89617,null));};
\ No newline at end of file
+var _0xb016=['util','path','to-csv','ejs','fs-extra','crypto','jsforce','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','apply','reject','save','then','destroy','end','error','name','send','index','map','UserProfileResource','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','update','find','body','describe','eml-format','rimraf','request-promise','bluebird','mustache'];(function(_0x56ea99,_0x430f15){var _0x38175a=function(_0x24c8dd){while(--_0x24c8dd){_0x56ea99['push'](_0x56ea99['shift']());}};_0x38175a(++_0x430f15);}(_0xb016,0x159));var _0x6b01=function(_0x422564,_0x1dcee5){_0x422564=_0x422564-0x0;var _0x569003=_0xb016[_0x422564];return _0x569003;};'use strict';var emlformat=require(_0x6b01('0x0'));var rimraf=require(_0x6b01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b01('0x2'));var moment=require('moment');var BPromise=require(_0x6b01('0x3'));var Mustache=require(_0x6b01('0x4'));var util=require(_0x6b01('0x5'));var path=require(_0x6b01('0x6'));var sox=require('sox');var csv=require(_0x6b01('0x7'));var ejs=require(_0x6b01('0x8'));var fs=require('fs');var fs_extra=require(_0x6b01('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b01('0xa'));var jsforce=require(_0x6b01('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b01('0xc'));var Papa=require(_0x6b01('0xd'));var Redis=require(_0x6b01('0xe'));var authService=require(_0x6b01('0xf'));var qs=require(_0x6b01('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b01('0x11'))(_0x6b01('0x12'));var utils=require(_0x6b01('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b01('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51f976,_0x26f2a0){_0x26f2a0=_0x26f2a0||0xcc;return function(_0x4fa826){if(_0x4fa826){return _0x51f976[_0x6b01('0x15')](_0x26f2a0);}return _0x51f976[_0x6b01('0x16')](_0x26f2a0)['end']();};}function respondWithResult(_0x2c305e,_0x4ea5fa){_0x4ea5fa=_0x4ea5fa||0xc8;return function(_0x50d778){if(_0x50d778){return _0x2c305e['status'](_0x4ea5fa)[_0x6b01('0x17')](_0x50d778);}};}function respondWithFilteredResult(_0x4cbd38,_0x5b2f60){return function(_0x3a259f){if(_0x3a259f){var _0x327e86=typeof _0x5b2f60[_0x6b01('0x18')]===_0x6b01('0x19')&&typeof _0x5b2f60[_0x6b01('0x1a')]===_0x6b01('0x19');var _0x122769=_0x3a259f[_0x6b01('0x1b')];var _0x9c6571=_0x327e86?0x0:_0x5b2f60[_0x6b01('0x18')];var _0x18f336=_0x327e86?_0x3a259f['count']:_0x5b2f60[_0x6b01('0x18')]+_0x5b2f60[_0x6b01('0x1a')];var _0x3b0bab;if(_0x18f336>=_0x122769){_0x18f336=_0x122769;_0x3b0bab=0xc8;}else{_0x3b0bab=0xce;}_0x4cbd38[_0x6b01('0x16')](_0x3b0bab);return _0x4cbd38[_0x6b01('0x1c')](_0x6b01('0x1d'),_0x9c6571+'-'+_0x18f336+'/'+_0x122769)[_0x6b01('0x17')](_0x3a259f);}return null;};}function patchUpdates(_0x3c0573){return function(_0x54a942){try{jsonpatch[_0x6b01('0x1e')](_0x54a942,_0x3c0573,!![]);}catch(_0xc1f453){return BPromise[_0x6b01('0x1f')](_0xc1f453);}return _0x54a942[_0x6b01('0x20')]();};}function saveUpdates(_0x1fced4,_0x181b09){return function(_0x2cea6e){if(_0x2cea6e){return _0x2cea6e['update'](_0x1fced4)[_0x6b01('0x21')](function(_0xcf9200){return _0xcf9200;});}return null;};}function removeEntity(_0x42c990,_0x51243c){return function(_0x399808){if(_0x399808){return _0x399808[_0x6b01('0x22')]()[_0x6b01('0x21')](function(){_0x42c990[_0x6b01('0x16')](0xcc)[_0x6b01('0x23')]();});}};}function handleEntityNotFound(_0x2456e9,_0x1b46fb){return function(_0x136452){if(!_0x136452){_0x2456e9[_0x6b01('0x15')](0x194);}return _0x136452;};}function handleError(_0x152dda,_0x3c0607){_0x3c0607=_0x3c0607||0x1f4;return function(_0xa846d8){logger[_0x6b01('0x24')](_0xa846d8['stack']);if(_0xa846d8[_0x6b01('0x25')]){delete _0xa846d8[_0x6b01('0x25')];}_0x152dda[_0x6b01('0x16')](_0x3c0607)[_0x6b01('0x26')](_0xa846d8);};}exports[_0x6b01('0x27')]=function(_0x528cbd,_0x54f030){var _0x3fae61={},_0x3df3d4={},_0xc574c={'count':0x0,'rows':[]};var _0x8883d1=_[_0x6b01('0x28')](db[_0x6b01('0x29')]['rawAttributes'],function(_0x39f193){return{'name':_0x39f193['fieldName'],'type':_0x39f193[_0x6b01('0x2a')]['key']};});_0x3df3d4[_0x6b01('0x2b')]=_[_0x6b01('0x28')](_0x8883d1,_0x6b01('0x25'));_0x3df3d4[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x528cbd['query']);_0x3df3d4[_0x6b01('0x2e')]=_[_0x6b01('0x2f')](_0x3df3d4[_0x6b01('0x2b')],_0x3df3d4['query']);_0x3fae61['attributes']=_[_0x6b01('0x2f')](_0x3df3d4['model'],qs[_0x6b01('0x30')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x30')]));_0x3fae61['attributes']=_0x3fae61[_0x6b01('0x31')][_0x6b01('0x32')]?_0x3fae61[_0x6b01('0x31')]:_0x3df3d4['model'];if(!_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x33')](_0x6b01('0x34'))){_0x3fae61[_0x6b01('0x1a')]=qs[_0x6b01('0x1a')](_0x528cbd['query'][_0x6b01('0x1a')]);_0x3fae61[_0x6b01('0x18')]=qs[_0x6b01('0x18')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x18')]);}_0x3fae61[_0x6b01('0x35')]=qs[_0x6b01('0x36')](_0x528cbd[_0x6b01('0x2c')]['sort']);_0x3fae61[_0x6b01('0x37')]=qs['filters'](_[_0x6b01('0x38')](_0x528cbd[_0x6b01('0x2c')],_0x3df3d4[_0x6b01('0x2e')]),_0x8883d1);if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]){_0x3fae61[_0x6b01('0x37')]=_[_0x6b01('0x3a')](_0x3fae61['where'],{'$or':_[_0x6b01('0x28')](_0x8883d1,function(_0x15f274){if(_0x15f274[_0x6b01('0x2a')]!==_0x6b01('0x3b')){var _0x1ca3aa={};_0x1ca3aa[_0x15f274[_0x6b01('0x25')]]={'$like':'%'+_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]+'%'};return _0x1ca3aa;}})});}_0x3fae61=_['merge']({},_0x3fae61,_0x528cbd[_0x6b01('0x3c')]);var _0x55907f={'where':_0x3fae61[_0x6b01('0x37')]};return db[_0x6b01('0x29')]['count'](_0x55907f)[_0x6b01('0x21')](function(_0x2e661b){_0xc574c[_0x6b01('0x1b')]=_0x2e661b;if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0x3fae61[_0x6b01('0x3e')]=[{'all':!![]}];}return db[_0x6b01('0x29')][_0x6b01('0x3f')](_0x3fae61);})[_0x6b01('0x21')](function(_0x17f335){_0xc574c['rows']=_0x17f335;return _0xc574c;})[_0x6b01('0x21')](respondWithFilteredResult(_0x54f030,_0x3fae61))[_0x6b01('0x40')](handleError(_0x54f030,null));};exports['show']=function(_0x52cec0,_0x32b9ec){var _0xd11195={'raw':![],'where':{'id':_0x52cec0[_0x6b01('0x41')]['id']}},_0x558ec1={};_0x558ec1[_0x6b01('0x2b')]=_['keys'](db[_0x6b01('0x29')]['rawAttributes']);_0x558ec1[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x52cec0[_0x6b01('0x2c')]);_0x558ec1['filters']=_[_0x6b01('0x2f')](_0x558ec1[_0x6b01('0x2b')],_0x558ec1['query']);_0xd11195['attributes']=_['intersection'](_0x558ec1[_0x6b01('0x2b')],qs[_0x6b01('0x30')](_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x30')]));_0xd11195[_0x6b01('0x31')]=_0xd11195[_0x6b01('0x31')]['length']?_0xd11195[_0x6b01('0x31')]:_0x558ec1[_0x6b01('0x2b')];if(_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0xd11195[_0x6b01('0x3e')]=[{'all':!![]}];}_0xd11195=_[_0x6b01('0x3a')]({},_0xd11195,_0x52cec0['options']);return db[_0x6b01('0x29')]['find'](_0xd11195)['then'](handleEntityNotFound(_0x32b9ec,null))[_0x6b01('0x21')](respondWithResult(_0x32b9ec,null))[_0x6b01('0x40')](handleError(_0x32b9ec,null));};exports['create']=function(_0x408bb0,_0x27442e){return db[_0x6b01('0x29')]['create'](_0x408bb0['body'],{})['then'](respondWithResult(_0x27442e,0xc9))[_0x6b01('0x40')](handleError(_0x27442e,null));};exports[_0x6b01('0x42')]=function(_0x518d94,_0x34cef6){if(_0x518d94['body']['id']){delete _0x518d94['body']['id'];}return db['UserProfileResource'][_0x6b01('0x43')]({'where':{'id':_0x518d94[_0x6b01('0x41')]['id']}})['then'](handleEntityNotFound(_0x34cef6,null))['then'](saveUpdates(_0x518d94[_0x6b01('0x44')],null))['then'](respondWithResult(_0x34cef6,null))[_0x6b01('0x40')](handleError(_0x34cef6,null));};exports[_0x6b01('0x22')]=function(_0x32d446,_0x172a56){return db[_0x6b01('0x29')]['find']({'where':{'id':_0x32d446[_0x6b01('0x41')]['id']}})[_0x6b01('0x21')](handleEntityNotFound(_0x172a56,null))[_0x6b01('0x21')](removeEntity(_0x172a56,null))['catch'](handleError(_0x172a56,null));};exports[_0x6b01('0x45')]=function(_0x13ab4f,_0x5617d7){return db[_0x6b01('0x29')][_0x6b01('0x45')]()[_0x6b01('0x21')](respondWithResult(_0x5617d7,null))[_0x6b01('0x40')](handleError(_0x5617d7,null));};
\ No newline at end of file
index 222359b..9f2caa0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce32=['user_profile_has_resources','compositeIndex','resourceId','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','define','UserProfileResource'];(function(_0x41ac4f,_0xdbec59){var _0x3e8c2c=function(_0x4d1f5b){while(--_0x4d1f5b){_0x41ac4f['push'](_0x41ac4f['shift']());}};_0x3e8c2c(++_0xdbec59);}(_0xce32,0xab));var _0x2ce3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce32[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2ce3('0x0'))(_0x2ce3('0x1'));var moment=require(_0x2ce3('0x2'));var BPromise=require(_0x2ce3('0x3'));var rp=require(_0x2ce3('0x4'));var fs=require('fs');var path=require(_0x2ce3('0x5'));var rimraf=require(_0x2ce3('0x6'));var config=require(_0x2ce3('0x7'));var attributes=require(_0x2ce3('0x8'));module['exports']=function(_0x115b7d,_0x3a3519){return _0x115b7d[_0x2ce3('0x9')](_0x2ce3('0xa'),attributes,{'tableName':_0x2ce3('0xb'),'paranoid':![],'indexes':[{'name':_0x2ce3('0xc'),'fields':[_0x2ce3('0xd'),'sectionId']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2de2=['resourceId','sectionId','lodash','util','moment','bluebird','path','rimraf','../../config/environment','./userProfileResource.attributes','UserProfileResource','user_profile_has_resources','compositeIndex'];(function(_0x6ee8a8,_0x2cf4be){var _0x41a03d=function(_0x350123){while(--_0x350123){_0x6ee8a8['push'](_0x6ee8a8['shift']());}};_0x41a03d(++_0x2cf4be);}(_0x2de2,0x1af));var _0x22de=function(_0x358cea,_0x1bdc17){_0x358cea=_0x358cea-0x0;var _0x4bebf6=_0x2de2[_0x358cea];return _0x4bebf6;};'use strict';var _=require(_0x22de('0x0'));var util=require(_0x22de('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x22de('0x2'));var BPromise=require(_0x22de('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x22de('0x4'));var rimraf=require(_0x22de('0x5'));var config=require(_0x22de('0x6'));var attributes=require(_0x22de('0x7'));module['exports']=function(_0x5bd401,_0x52f8ab){return _0x5bd401['define'](_0x22de('0x8'),attributes,{'tableName':_0x22de('0x9'),'paranoid':![],'indexes':[{'name':_0x22de('0xa'),'fields':[_0x22de('0xb'),_0x22de('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 20637f0..e99f1a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee39=['rpc','../../config/environment','jayson/promise','client','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x3f477c,_0x52b7ff){var _0x4c36b3=function(_0x3b47bb){while(--_0x3b47bb){_0x3f477c['push'](_0x3f477c['shift']());}};_0x4c36b3(++_0x52b7ff);}(_0xee39,0x144));var _0x9ee3=function(_0x4908ac,_0x3f8a35){_0x4908ac=_0x4908ac-0x0;var _0x107087=_0xee39[_0x4908ac];return _0x107087;};'use strict';var _=require(_0x9ee3('0x0'));var util=require('util');var moment=require(_0x9ee3('0x1'));var BPromise=require(_0x9ee3('0x2'));var rs=require(_0x9ee3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ee3('0x4'))['db'];var utils=require(_0x9ee3('0x5'));var logger=require('../../config/logger')(_0x9ee3('0x6'));var config=require(_0x9ee3('0x7'));var jayson=require(_0x9ee3('0x8'));var client=jayson[_0x9ee3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xafd772,_0x49ebee,_0xce9afb){return new BPromise(function(_0x3132a2,_0x2140e1){return client[_0x9ee3('0xa')](_0xafd772,_0xce9afb)[_0x9ee3('0xb')](function(_0x1aa2cb){logger['info'](_0x9ee3('0xc'),_0x49ebee,_0x9ee3('0xd'));logger[_0x9ee3('0xe')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x49ebee,_0x9ee3('0xd'),JSON[_0x9ee3('0xf')](_0x1aa2cb));if(_0x1aa2cb['error']){if(_0x1aa2cb[_0x9ee3('0x10')][_0x9ee3('0x11')]===0x1f4){logger[_0x9ee3('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x49ebee,_0x1aa2cb[_0x9ee3('0x10')][_0x9ee3('0x12')]);return _0x2140e1(_0x1aa2cb[_0x9ee3('0x10')]['message']);}logger[_0x9ee3('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x49ebee,_0x1aa2cb[_0x9ee3('0x10')][_0x9ee3('0x12')]);return _0x3132a2(_0x1aa2cb[_0x9ee3('0x10')][_0x9ee3('0x12')]);}else{logger[_0x9ee3('0x13')](_0x9ee3('0xc'),_0x49ebee,_0x9ee3('0xd'));_0x3132a2(_0x1aa2cb[_0x9ee3('0x14')][_0x9ee3('0x12')]);}})[_0x9ee3('0x15')](function(_0x43478e){logger[_0x9ee3('0x10')](_0x9ee3('0xc'),_0x49ebee,_0x43478e);_0x2140e1(_0x43478e);});});}
\ No newline at end of file
+var _0xff57=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x525baa,_0x1230fc){var _0xddac92=function(_0x50838b){while(--_0x50838b){_0x525baa['push'](_0x525baa['shift']());}};_0xddac92(++_0x1230fc);}(_0xff57,0x138));var _0x7ff5=function(_0x397bf7,_0x4b2dde){_0x397bf7=_0x397bf7-0x0;var _0x7c35c0=_0xff57[_0x397bf7];return _0x7c35c0;};'use strict';var _=require(_0x7ff5('0x0'));var util=require(_0x7ff5('0x1'));var moment=require('moment');var BPromise=require(_0x7ff5('0x2'));var rs=require(_0x7ff5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7ff5('0x4'));var logger=require(_0x7ff5('0x5'))(_0x7ff5('0x6'));var config=require(_0x7ff5('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7ff5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10f92b,_0xa0be9,_0xc8b536){return new BPromise(function(_0x1433b8,_0x4d69e2){return client[_0x7ff5('0x9')](_0x10f92b,_0xc8b536)[_0x7ff5('0xa')](function(_0x250c81){logger[_0x7ff5('0xb')](_0x7ff5('0xc'),_0xa0be9,_0x7ff5('0xd'));logger['debug'](_0x7ff5('0xe'),_0xa0be9,'request\x20sent',JSON[_0x7ff5('0xf')](_0x250c81));if(_0x250c81[_0x7ff5('0x10')]){if(_0x250c81[_0x7ff5('0x10')][_0x7ff5('0x11')]===0x1f4){logger[_0x7ff5('0x10')](_0x7ff5('0xc'),_0xa0be9,_0x250c81[_0x7ff5('0x10')][_0x7ff5('0x12')]);return _0x4d69e2(_0x250c81['error'][_0x7ff5('0x12')]);}logger[_0x7ff5('0x10')](_0x7ff5('0xc'),_0xa0be9,_0x250c81[_0x7ff5('0x10')]['message']);return _0x1433b8(_0x250c81[_0x7ff5('0x10')][_0x7ff5('0x12')]);}else{logger[_0x7ff5('0xb')](_0x7ff5('0xc'),_0xa0be9,_0x7ff5('0xd'));_0x1433b8(_0x250c81[_0x7ff5('0x13')]['message']);}})[_0x7ff5('0x14')](function(_0x2ed695){logger['error']('UserProfileResource,\x20%s,\x20%s',_0xa0be9,_0x2ed695);_0x4d69e2(_0x2ed695);});});}
\ No newline at end of file
index a6a715f..dee0cfe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4645=['multer','util','express','Router','../../components/auth/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','describe','/:id','show','post','put','delete','exports'];(function(_0x252805,_0x1d1e8e){var _0x3e74b9=function(_0x16d7a0){while(--_0x16d7a0){_0x252805['push'](_0x252805['shift']());}};_0x3e74b9(++_0x1d1e8e);}(_0x4645,0x176));var _0x5464=function(_0x1eac0b,_0xbe13f5){_0x1eac0b=_0x1eac0b-0x0;var _0x2f5572=_0x4645[_0x1eac0b];return _0x2f5572;};'use strict';var multer=require(_0x5464('0x0'));var util=require(_0x5464('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5464('0x2'));var router=express[_0x5464('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5464('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5464('0x5'));var controller=require(_0x5464('0x6'));router[_0x5464('0x7')]('/',auth[_0x5464('0x8')](),controller[_0x5464('0x9')]);router[_0x5464('0x7')]('/describe',auth[_0x5464('0x8')](),controller[_0x5464('0xa')]);router['get'](_0x5464('0xb'),auth['isAuthenticated'](),controller[_0x5464('0xc')]);router[_0x5464('0xd')]('/',auth[_0x5464('0x8')](),controller['create']);router[_0x5464('0xe')](_0x5464('0xb'),auth[_0x5464('0x8')](),controller['update']);router[_0x5464('0xf')]('/:id',auth[_0x5464('0x8')](),controller['destroy']);module[_0x5464('0x10')]=router;
\ No newline at end of file
+var _0x0015=['./userProfileSection.controller','isAuthenticated','get','/describe','describe','/:id','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x31fbab,_0x2ad72a){var _0x4a0088=function(_0x3e5da2){while(--_0x3e5da2){_0x31fbab['push'](_0x31fbab['shift']());}};_0x4a0088(++_0x2ad72a);}(_0x0015,0xe4));var _0x5001=function(_0x4734e0,_0x33992c){_0x4734e0=_0x4734e0-0x0;var _0x24d883=_0x0015[_0x4734e0];return _0x24d883;};'use strict';var multer=require('multer');var util=require(_0x5001('0x0'));var path=require(_0x5001('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x5001('0x2'));var auth=require(_0x5001('0x3'));var interaction=require(_0x5001('0x4'));var config=require(_0x5001('0x5'));var controller=require(_0x5001('0x6'));router['get']('/',auth[_0x5001('0x7')](),controller['index']);router[_0x5001('0x8')](_0x5001('0x9'),auth['isAuthenticated'](),controller[_0x5001('0xa')]);router[_0x5001('0x8')](_0x5001('0xb'),auth[_0x5001('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x5001('0xc')]);router[_0x5001('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x5001('0xe')]);router[_0x5001('0xf')](_0x5001('0xb'),auth[_0x5001('0x7')](),controller[_0x5001('0x10')]);module[_0x5001('0x11')]=router;
\ No newline at end of file
index 3c5784c..bfe876b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3de3=['sequelize','STRING','BOOLEAN','crudPermissions','join','split'];(function(_0x5a636f,_0x3fec2b){var _0x6a8cfb=function(_0x20e6ca){while(--_0x20e6ca){_0x5a636f['push'](_0x5a636f['shift']());}};_0x6a8cfb(++_0x3fec2b);}(_0x3de3,0x1ce));var _0x33de=function(_0x2bdea9,_0x13dcad){_0x2bdea9=_0x2bdea9-0x0;var _0x2fa35a=_0x3de3[_0x2bdea9];return _0x2fa35a;};'use strict';var Sequelize=require(_0x33de('0x0'));module['exports']={'name':{'type':Sequelize[_0x33de('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x33de('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x33de('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x33de('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x33de('0x1')],'set':function(_0xbdd404){this['setDataValue'](_0x33de('0x3'),_0xbdd404?_0xbdd404[_0x33de('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0x33de('0x3'))?this['getDataValue'](_0x33de('0x3'))[_0x33de('0x5')](''):[];}}};
\ No newline at end of file
+var _0xe511=['exports','STRING','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','sequelize'];(function(_0x265974,_0x3a01da){var _0x15b5f1=function(_0x482160){while(--_0x482160){_0x265974['push'](_0x265974['shift']());}};_0x15b5f1(++_0x3a01da);}(_0xe511,0x16f));var _0x1e51=function(_0x33e93d,_0x1a8423){_0x33e93d=_0x33e93d-0x0;var _0x19e99d=_0xe511[_0x33e93d];return _0x19e99d;};'use strict';var Sequelize=require(_0x1e51('0x0'));module[_0x1e51('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x1e51('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x1e51('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x1e51('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x42e242){this[_0x1e51('0x4')](_0x1e51('0x5'),_0x42e242?_0x42e242[_0x1e51('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x1e51('0x5'))?this[_0x1e51('0x7')]('crudPermissions')['split'](''):[];}}};
\ No newline at end of file
index 5a82acc..6f0748d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7480=['bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','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','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','options','include','findAll','rows','catch','show','UserProfileSection','includeAll','create','body','find','params','describe','rimraf','fast-json-patch','request-promise','moment'];(function(_0x1a661f,_0x2d22b3){var _0x3f0ee1=function(_0xfd288){while(--_0xfd288){_0x1a661f['push'](_0x1a661f['shift']());}};_0x3f0ee1(++_0x2d22b3);}(_0x7480,0x17d));var _0x0748=function(_0xdaf443,_0x1bf384){_0xdaf443=_0xdaf443-0x0;var _0x2ceb12=_0x7480[_0xdaf443];return _0x2ceb12;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0748('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0748('0x1'));var rp=require(_0x0748('0x2'));var moment=require(_0x0748('0x3'));var BPromise=require(_0x0748('0x4'));var Mustache=require('mustache');var util=require(_0x0748('0x5'));var path=require(_0x0748('0x6'));var sox=require(_0x0748('0x7'));var csv=require(_0x0748('0x8'));var ejs=require(_0x0748('0x9'));var fs=require('fs');var fs_extra=require(_0x0748('0xa'));var _=require('lodash');var squel=require(_0x0748('0xb'));var crypto=require('crypto');var jsforce=require(_0x0748('0xc'));var deskjs=require(_0x0748('0xd'));var toCsv=require(_0x0748('0x8'));var querystring=require('querystring');var Papa=require(_0x0748('0xe'));var Redis=require(_0x0748('0xf'));var authService=require(_0x0748('0x10'));var qs=require(_0x0748('0x11'));var as=require(_0x0748('0x12'));var hardwareService=require(_0x0748('0x13'));var logger=require(_0x0748('0x14'))(_0x0748('0x15'));var utils=require(_0x0748('0x16'));var config=require(_0x0748('0x17'));var licenseUtil=require(_0x0748('0x18'));var db=require(_0x0748('0x19'))['db'];function respondWithStatusCode(_0x21c909,_0x56684b){_0x56684b=_0x56684b||0xcc;return function(_0x3ac4c7){if(_0x3ac4c7){return _0x21c909['sendStatus'](_0x56684b);}return _0x21c909[_0x0748('0x1a')](_0x56684b)[_0x0748('0x1b')]();};}function respondWithResult(_0x3718a2,_0x26ecda){_0x26ecda=_0x26ecda||0xc8;return function(_0x36dd1c){if(_0x36dd1c){return _0x3718a2[_0x0748('0x1a')](_0x26ecda)['json'](_0x36dd1c);}};}function respondWithFilteredResult(_0x679a12,_0x108419){return function(_0x5bd454){if(_0x5bd454){var _0xca55bd=typeof _0x108419['offset']===_0x0748('0x1c')&&typeof _0x108419[_0x0748('0x1d')]===_0x0748('0x1c');var _0x30615e=_0x5bd454[_0x0748('0x1e')];var _0x357b98=_0xca55bd?0x0:_0x108419[_0x0748('0x1f')];var _0x5e878b=_0xca55bd?_0x5bd454[_0x0748('0x1e')]:_0x108419[_0x0748('0x1f')]+_0x108419[_0x0748('0x1d')];var _0x5cebfb;if(_0x5e878b>=_0x30615e){_0x5e878b=_0x30615e;_0x5cebfb=0xc8;}else{_0x5cebfb=0xce;}_0x679a12[_0x0748('0x1a')](_0x5cebfb);return _0x679a12[_0x0748('0x20')](_0x0748('0x21'),_0x357b98+'-'+_0x5e878b+'/'+_0x30615e)[_0x0748('0x22')](_0x5bd454);}return null;};}function patchUpdates(_0x2dbef1){return function(_0x3c730f){try{jsonpatch[_0x0748('0x23')](_0x3c730f,_0x2dbef1,!![]);}catch(_0x640540){return BPromise[_0x0748('0x24')](_0x640540);}return _0x3c730f[_0x0748('0x25')]();};}function saveUpdates(_0x2ae462,_0x3a2273){return function(_0xe0f2ef){if(_0xe0f2ef){return _0xe0f2ef[_0x0748('0x26')](_0x2ae462)[_0x0748('0x27')](function(_0x45cf80){return _0x45cf80;});}return null;};}function removeEntity(_0x101e52,_0x431d45){return function(_0xa5d836){if(_0xa5d836){return _0xa5d836[_0x0748('0x28')]()['then'](function(){_0x101e52[_0x0748('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4de976,_0x2fb3a0){return function(_0x178f1c){if(!_0x178f1c){_0x4de976[_0x0748('0x29')](0x194);}return _0x178f1c;};}function handleError(_0x217ff6,_0x4095ec){_0x4095ec=_0x4095ec||0x1f4;return function(_0x1e6052){logger[_0x0748('0x2a')](_0x1e6052[_0x0748('0x2b')]);if(_0x1e6052[_0x0748('0x2c')]){delete _0x1e6052['name'];}_0x217ff6[_0x0748('0x1a')](_0x4095ec)[_0x0748('0x2d')](_0x1e6052);};}exports['index']=function(_0x21f0d2,_0x215dfb){var _0x1445f5={},_0x1b8589={},_0x1a6996={'count':0x0,'rows':[]};var _0x1ab3df=_[_0x0748('0x2e')](db['UserProfileSection'][_0x0748('0x2f')],function(_0x3b30fc){return{'name':_0x3b30fc['fieldName'],'type':_0x3b30fc[_0x0748('0x30')][_0x0748('0x31')]};});_0x1b8589[_0x0748('0x32')]=_[_0x0748('0x2e')](_0x1ab3df,_0x0748('0x2c'));_0x1b8589[_0x0748('0x33')]=_[_0x0748('0x34')](_0x21f0d2[_0x0748('0x33')]);_0x1b8589[_0x0748('0x35')]=_[_0x0748('0x36')](_0x1b8589[_0x0748('0x32')],_0x1b8589[_0x0748('0x33')]);_0x1445f5[_0x0748('0x37')]=_[_0x0748('0x36')](_0x1b8589[_0x0748('0x32')],qs[_0x0748('0x38')](_0x21f0d2[_0x0748('0x33')][_0x0748('0x38')]));_0x1445f5[_0x0748('0x37')]=_0x1445f5[_0x0748('0x37')][_0x0748('0x39')]?_0x1445f5['attributes']:_0x1b8589[_0x0748('0x32')];if(!_0x21f0d2[_0x0748('0x33')][_0x0748('0x3a')](_0x0748('0x3b'))){_0x1445f5[_0x0748('0x1d')]=qs['limit'](_0x21f0d2[_0x0748('0x33')][_0x0748('0x1d')]);_0x1445f5[_0x0748('0x1f')]=qs[_0x0748('0x1f')](_0x21f0d2['query'][_0x0748('0x1f')]);}_0x1445f5['order']=qs['sort'](_0x21f0d2[_0x0748('0x33')][_0x0748('0x3c')]);_0x1445f5[_0x0748('0x3d')]=qs['filters'](_[_0x0748('0x3e')](_0x21f0d2['query'],_0x1b8589[_0x0748('0x35')]),_0x1ab3df);if(_0x21f0d2[_0x0748('0x33')]['filter']){_0x1445f5[_0x0748('0x3d')]=_[_0x0748('0x3f')](_0x1445f5[_0x0748('0x3d')],{'$or':_['map'](_0x1ab3df,function(_0xf48ae9){if(_0xf48ae9['type']!=='VIRTUAL'){var _0x368372={};_0x368372[_0xf48ae9['name']]={'$like':'%'+_0x21f0d2[_0x0748('0x33')]['filter']+'%'};return _0x368372;}})});}_0x1445f5=_[_0x0748('0x3f')]({},_0x1445f5,_0x21f0d2[_0x0748('0x40')]);var _0x39a7e8={'where':_0x1445f5['where']};return db['UserProfileSection'][_0x0748('0x1e')](_0x39a7e8)[_0x0748('0x27')](function(_0x27ed2a){_0x1a6996[_0x0748('0x1e')]=_0x27ed2a;if(_0x21f0d2[_0x0748('0x33')]['includeAll']){_0x1445f5[_0x0748('0x41')]=[{'all':!![]}];}return db['UserProfileSection'][_0x0748('0x42')](_0x1445f5);})['then'](function(_0x5e6e81){_0x1a6996[_0x0748('0x43')]=_0x5e6e81;return _0x1a6996;})[_0x0748('0x27')](respondWithFilteredResult(_0x215dfb,_0x1445f5))[_0x0748('0x44')](handleError(_0x215dfb,null));};exports[_0x0748('0x45')]=function(_0x1cd225,_0x357f1b){var _0x4dd76e={'raw':![],'where':{'id':_0x1cd225['params']['id']}},_0x1da6c1={};_0x1da6c1[_0x0748('0x32')]=_['keys'](db[_0x0748('0x46')][_0x0748('0x2f')]);_0x1da6c1[_0x0748('0x33')]=_[_0x0748('0x34')](_0x1cd225[_0x0748('0x33')]);_0x1da6c1['filters']=_[_0x0748('0x36')](_0x1da6c1[_0x0748('0x32')],_0x1da6c1[_0x0748('0x33')]);_0x4dd76e[_0x0748('0x37')]=_[_0x0748('0x36')](_0x1da6c1[_0x0748('0x32')],qs[_0x0748('0x38')](_0x1cd225[_0x0748('0x33')][_0x0748('0x38')]));_0x4dd76e[_0x0748('0x37')]=_0x4dd76e[_0x0748('0x37')]['length']?_0x4dd76e['attributes']:_0x1da6c1['model'];if(_0x1cd225[_0x0748('0x33')][_0x0748('0x47')]){_0x4dd76e[_0x0748('0x41')]=[{'all':!![]}];}_0x4dd76e=_[_0x0748('0x3f')]({},_0x4dd76e,_0x1cd225[_0x0748('0x40')]);return db[_0x0748('0x46')]['find'](_0x4dd76e)[_0x0748('0x27')](handleEntityNotFound(_0x357f1b,null))[_0x0748('0x27')](respondWithResult(_0x357f1b,null))[_0x0748('0x44')](handleError(_0x357f1b,null));};exports[_0x0748('0x48')]=function(_0x5361ca,_0xa247f){return db[_0x0748('0x46')][_0x0748('0x48')](_0x5361ca[_0x0748('0x49')],{})['then'](respondWithResult(_0xa247f,0xc9))[_0x0748('0x44')](handleError(_0xa247f,null));};exports[_0x0748('0x26')]=function(_0x133504,_0x7ee8fb){if(_0x133504[_0x0748('0x49')]['id']){delete _0x133504[_0x0748('0x49')]['id'];}return db['UserProfileSection'][_0x0748('0x4a')]({'where':{'id':_0x133504[_0x0748('0x4b')]['id']}})[_0x0748('0x27')](handleEntityNotFound(_0x7ee8fb,null))['then'](saveUpdates(_0x133504[_0x0748('0x49')],null))[_0x0748('0x27')](respondWithResult(_0x7ee8fb,null))['catch'](handleError(_0x7ee8fb,null));};exports[_0x0748('0x28')]=function(_0x3bf1f2,_0x5956b1){return db[_0x0748('0x46')][_0x0748('0x4a')]({'where':{'id':_0x3bf1f2[_0x0748('0x4b')]['id']}})[_0x0748('0x27')](handleEntityNotFound(_0x5956b1,null))[_0x0748('0x27')](removeEntity(_0x5956b1,null))[_0x0748('0x44')](handleError(_0x5956b1,null));};exports[_0x0748('0x4c')]=function(_0x31b58f,_0x9f57b7){return db[_0x0748('0x46')][_0x0748('0x4c')]()[_0x0748('0x27')](respondWithResult(_0x9f57b7,null))[_0x0748('0x44')](handleError(_0x9f57b7,null));};
\ No newline at end of file
+var _0x9f3b=['type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','length','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','save','destroy','then','stack','name','map','UserProfileSection','rawAttributes','fieldName'];(function(_0xd9e0bb,_0x182f87){var _0x4926c2=function(_0x4fb160){while(--_0x4fb160){_0xd9e0bb['push'](_0xd9e0bb['shift']());}};_0x4926c2(++_0x182f87);}(_0x9f3b,0xff));var _0xb9f3=function(_0x22ccc0,_0x914457){_0x22ccc0=_0x22ccc0-0x0;var _0xe2af6a=_0x9f3b[_0x22ccc0];return _0xe2af6a;};'use strict';var emlformat=require(_0xb9f3('0x0'));var rimraf=require(_0xb9f3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb9f3('0x2'));var rp=require(_0xb9f3('0x3'));var moment=require(_0xb9f3('0x4'));var BPromise=require(_0xb9f3('0x5'));var Mustache=require(_0xb9f3('0x6'));var util=require('util');var path=require(_0xb9f3('0x7'));var sox=require(_0xb9f3('0x8'));var csv=require(_0xb9f3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb9f3('0xa'));var _=require(_0xb9f3('0xb'));var squel=require(_0xb9f3('0xc'));var crypto=require(_0xb9f3('0xd'));var jsforce=require(_0xb9f3('0xe'));var deskjs=require(_0xb9f3('0xf'));var toCsv=require(_0xb9f3('0x9'));var querystring=require(_0xb9f3('0x10'));var Papa=require(_0xb9f3('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb9f3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb9f3('0x13'))(_0xb9f3('0x14'));var utils=require(_0xb9f3('0x15'));var config=require(_0xb9f3('0x16'));var licenseUtil=require(_0xb9f3('0x17'));var db=require(_0xb9f3('0x18'))['db'];function respondWithStatusCode(_0x533a83,_0x19c402){_0x19c402=_0x19c402||0xcc;return function(_0x1b86da){if(_0x1b86da){return _0x533a83[_0xb9f3('0x19')](_0x19c402);}return _0x533a83[_0xb9f3('0x1a')](_0x19c402)[_0xb9f3('0x1b')]();};}function respondWithResult(_0x48b625,_0x453e5b){_0x453e5b=_0x453e5b||0xc8;return function(_0x18d981){if(_0x18d981){return _0x48b625[_0xb9f3('0x1a')](_0x453e5b)['json'](_0x18d981);}};}function respondWithFilteredResult(_0x10180f,_0x1f2baa){return function(_0x4b8aae){if(_0x4b8aae){var _0x2b149b=typeof _0x1f2baa[_0xb9f3('0x1c')]==='undefined'&&typeof _0x1f2baa[_0xb9f3('0x1d')]===_0xb9f3('0x1e');var _0x18d741=_0x4b8aae[_0xb9f3('0x1f')];var _0x2899a5=_0x2b149b?0x0:_0x1f2baa[_0xb9f3('0x1c')];var _0xcd8059=_0x2b149b?_0x4b8aae['count']:_0x1f2baa[_0xb9f3('0x1c')]+_0x1f2baa[_0xb9f3('0x1d')];var _0x42fce7;if(_0xcd8059>=_0x18d741){_0xcd8059=_0x18d741;_0x42fce7=0xc8;}else{_0x42fce7=0xce;}_0x10180f[_0xb9f3('0x1a')](_0x42fce7);return _0x10180f[_0xb9f3('0x20')]('Content-Range',_0x2899a5+'-'+_0xcd8059+'/'+_0x18d741)[_0xb9f3('0x21')](_0x4b8aae);}return null;};}function patchUpdates(_0x17c663){return function(_0x105755){try{jsonpatch[_0xb9f3('0x22')](_0x105755,_0x17c663,!![]);}catch(_0x8251ec){return BPromise[_0xb9f3('0x23')](_0x8251ec);}return _0x105755[_0xb9f3('0x24')]();};}function saveUpdates(_0xc9c851,_0x3984ce){return function(_0x391715){if(_0x391715){return _0x391715['update'](_0xc9c851)['then'](function(_0x110c34){return _0x110c34;});}return null;};}function removeEntity(_0x49a56c,_0x58265d){return function(_0x232e1f){if(_0x232e1f){return _0x232e1f[_0xb9f3('0x25')]()[_0xb9f3('0x26')](function(){_0x49a56c[_0xb9f3('0x1a')](0xcc)[_0xb9f3('0x1b')]();});}};}function handleEntityNotFound(_0x2239dd,_0x2da096){return function(_0x255c7b){if(!_0x255c7b){_0x2239dd[_0xb9f3('0x19')](0x194);}return _0x255c7b;};}function handleError(_0x39e818,_0x3e4159){_0x3e4159=_0x3e4159||0x1f4;return function(_0x3cc5bb){logger['error'](_0x3cc5bb[_0xb9f3('0x27')]);if(_0x3cc5bb[_0xb9f3('0x28')]){delete _0x3cc5bb[_0xb9f3('0x28')];}_0x39e818['status'](_0x3e4159)['send'](_0x3cc5bb);};}exports['index']=function(_0x22b05e,_0x558a6a){var _0x3f9b9f={},_0x5bad28={},_0x2121fd={'count':0x0,'rows':[]};var _0x5c85b4=_[_0xb9f3('0x29')](db[_0xb9f3('0x2a')][_0xb9f3('0x2b')],function(_0x3a4198){return{'name':_0x3a4198[_0xb9f3('0x2c')],'type':_0x3a4198[_0xb9f3('0x2d')][_0xb9f3('0x2e')]};});_0x5bad28[_0xb9f3('0x2f')]=_[_0xb9f3('0x29')](_0x5c85b4,_0xb9f3('0x28'));_0x5bad28[_0xb9f3('0x30')]=_['keys'](_0x22b05e['query']);_0x5bad28[_0xb9f3('0x31')]=_[_0xb9f3('0x32')](_0x5bad28[_0xb9f3('0x2f')],_0x5bad28[_0xb9f3('0x30')]);_0x3f9b9f['attributes']=_[_0xb9f3('0x32')](_0x5bad28['model'],qs[_0xb9f3('0x33')](_0x22b05e[_0xb9f3('0x30')][_0xb9f3('0x33')]));_0x3f9b9f[_0xb9f3('0x34')]=_0x3f9b9f['attributes']['length']?_0x3f9b9f[_0xb9f3('0x34')]:_0x5bad28[_0xb9f3('0x2f')];if(!_0x22b05e['query'][_0xb9f3('0x35')](_0xb9f3('0x36'))){_0x3f9b9f[_0xb9f3('0x1d')]=qs[_0xb9f3('0x1d')](_0x22b05e['query'][_0xb9f3('0x1d')]);_0x3f9b9f[_0xb9f3('0x1c')]=qs[_0xb9f3('0x1c')](_0x22b05e[_0xb9f3('0x30')][_0xb9f3('0x1c')]);}_0x3f9b9f['order']=qs[_0xb9f3('0x37')](_0x22b05e[_0xb9f3('0x30')]['sort']);_0x3f9b9f[_0xb9f3('0x38')]=qs[_0xb9f3('0x31')](_[_0xb9f3('0x39')](_0x22b05e[_0xb9f3('0x30')],_0x5bad28[_0xb9f3('0x31')]),_0x5c85b4);if(_0x22b05e[_0xb9f3('0x30')][_0xb9f3('0x3a')]){_0x3f9b9f[_0xb9f3('0x38')]=_[_0xb9f3('0x3b')](_0x3f9b9f['where'],{'$or':_[_0xb9f3('0x29')](_0x5c85b4,function(_0x4a5de8){if(_0x4a5de8[_0xb9f3('0x2d')]!==_0xb9f3('0x3c')){var _0x4ca5b5={};_0x4ca5b5[_0x4a5de8['name']]={'$like':'%'+_0x22b05e['query'][_0xb9f3('0x3a')]+'%'};return _0x4ca5b5;}})});}_0x3f9b9f=_[_0xb9f3('0x3b')]({},_0x3f9b9f,_0x22b05e[_0xb9f3('0x3d')]);var _0x1ffe5b={'where':_0x3f9b9f[_0xb9f3('0x38')]};return db['UserProfileSection'][_0xb9f3('0x1f')](_0x1ffe5b)['then'](function(_0x531ed0){_0x2121fd[_0xb9f3('0x1f')]=_0x531ed0;if(_0x22b05e[_0xb9f3('0x30')][_0xb9f3('0x3e')]){_0x3f9b9f[_0xb9f3('0x3f')]=[{'all':!![]}];}return db[_0xb9f3('0x2a')][_0xb9f3('0x40')](_0x3f9b9f);})['then'](function(_0x5e191e){_0x2121fd[_0xb9f3('0x41')]=_0x5e191e;return _0x2121fd;})['then'](respondWithFilteredResult(_0x558a6a,_0x3f9b9f))[_0xb9f3('0x42')](handleError(_0x558a6a,null));};exports[_0xb9f3('0x43')]=function(_0x45c9ab,_0x1920fa){var _0x3d1e55={'raw':![],'where':{'id':_0x45c9ab['params']['id']}},_0x321b25={};_0x321b25['model']=_[_0xb9f3('0x44')](db[_0xb9f3('0x2a')][_0xb9f3('0x2b')]);_0x321b25['query']=_[_0xb9f3('0x44')](_0x45c9ab['query']);_0x321b25[_0xb9f3('0x31')]=_[_0xb9f3('0x32')](_0x321b25['model'],_0x321b25[_0xb9f3('0x30')]);_0x3d1e55[_0xb9f3('0x34')]=_[_0xb9f3('0x32')](_0x321b25[_0xb9f3('0x2f')],qs[_0xb9f3('0x33')](_0x45c9ab[_0xb9f3('0x30')]['fields']));_0x3d1e55['attributes']=_0x3d1e55['attributes'][_0xb9f3('0x45')]?_0x3d1e55['attributes']:_0x321b25[_0xb9f3('0x2f')];if(_0x45c9ab['query'][_0xb9f3('0x3e')]){_0x3d1e55['include']=[{'all':!![]}];}_0x3d1e55=_[_0xb9f3('0x3b')]({},_0x3d1e55,_0x45c9ab[_0xb9f3('0x3d')]);return db[_0xb9f3('0x2a')][_0xb9f3('0x46')](_0x3d1e55)['then'](handleEntityNotFound(_0x1920fa,null))['then'](respondWithResult(_0x1920fa,null))[_0xb9f3('0x42')](handleError(_0x1920fa,null));};exports['create']=function(_0x18f7a2,_0x1879c5){return db[_0xb9f3('0x2a')][_0xb9f3('0x47')](_0x18f7a2[_0xb9f3('0x48')],{})[_0xb9f3('0x26')](respondWithResult(_0x1879c5,0xc9))[_0xb9f3('0x42')](handleError(_0x1879c5,null));};exports['update']=function(_0x5d9e46,_0x2a8952){if(_0x5d9e46[_0xb9f3('0x48')]['id']){delete _0x5d9e46[_0xb9f3('0x48')]['id'];}return db[_0xb9f3('0x2a')][_0xb9f3('0x46')]({'where':{'id':_0x5d9e46[_0xb9f3('0x49')]['id']}})[_0xb9f3('0x26')](handleEntityNotFound(_0x2a8952,null))[_0xb9f3('0x26')](saveUpdates(_0x5d9e46[_0xb9f3('0x48')],null))[_0xb9f3('0x26')](respondWithResult(_0x2a8952,null))['catch'](handleError(_0x2a8952,null));};exports['destroy']=function(_0x336294,_0x341269){return db[_0xb9f3('0x2a')][_0xb9f3('0x46')]({'where':{'id':_0x336294[_0xb9f3('0x49')]['id']}})[_0xb9f3('0x26')](handleEntityNotFound(_0x341269,null))[_0xb9f3('0x26')](removeEntity(_0x341269,null))['catch'](handleError(_0x341269,null));};exports[_0xb9f3('0x4a')]=function(_0x3f0ffb,_0x2fe861){return db[_0xb9f3('0x2a')][_0xb9f3('0x4a')]()[_0xb9f3('0x26')](respondWithResult(_0x2fe861,null))[_0xb9f3('0x42')](handleError(_0x2fe861,null));};
\ No newline at end of file
index 2bc9c0f..281c8c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2eac=['rimraf','./userProfileSection.attributes','exports','define','UserProfileSection','compositeIndex','sectionId','userProfileId','lodash','api','moment','bluebird','request-promise'];(function(_0x131437,_0x5d6787){var _0x4f1c6e=function(_0x245833){while(--_0x245833){_0x131437['push'](_0x131437['shift']());}};_0x4f1c6e(++_0x5d6787);}(_0x2eac,0x167));var _0xc2ea=function(_0x3ef584,_0x43973c){_0x3ef584=_0x3ef584-0x0;var _0x3e422c=_0x2eac[_0x3ef584];return _0x3e422c;};'use strict';var _=require(_0xc2ea('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc2ea('0x1'));var moment=require(_0xc2ea('0x2'));var BPromise=require(_0xc2ea('0x3'));var rp=require(_0xc2ea('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc2ea('0x5'));var config=require('../../config/environment');var attributes=require(_0xc2ea('0x6'));module[_0xc2ea('0x7')]=function(_0x2b6d1a,_0x249d39){return _0x2b6d1a[_0xc2ea('0x8')](_0xc2ea('0x9'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0xc2ea('0xa'),'fields':[_0xc2ea('0xb'),_0xc2ea('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1c68=['path','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','userProfileId','lodash','util','../../config/logger','moment','bluebird'];(function(_0x455150,_0x274121){var _0x12ca9c=function(_0x47eb22){while(--_0x47eb22){_0x455150['push'](_0x455150['shift']());}};_0x12ca9c(++_0x274121);}(_0x1c68,0xe9));var _0x81c6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c68[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x81c6('0x0'));var util=require(_0x81c6('0x1'));var logger=require(_0x81c6('0x2'))('api');var moment=require(_0x81c6('0x3'));var BPromise=require(_0x81c6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x81c6('0x5'));var rimraf=require('rimraf');var config=require(_0x81c6('0x6'));var attributes=require(_0x81c6('0x7'));module[_0x81c6('0x8')]=function(_0x520064,_0x466e4a){return _0x520064[_0x81c6('0x9')](_0x81c6('0xa'),attributes,{'tableName':_0x81c6('0xb'),'paranoid':![],'indexes':[{'name':_0x81c6('0xc'),'fields':['sectionId',_0x81c6('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index a0dfac3..bdc5434 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52c0=['message','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s'];(function(_0xca89db,_0x497f99){var _0x47c09a=function(_0x198f17){while(--_0x198f17){_0xca89db['push'](_0xca89db['shift']());}};_0x47c09a(++_0x497f99);}(_0x52c0,0xf4));var _0x052c=function(_0x152198,_0x2b7cd4){_0x152198=_0x152198-0x0;var _0x553e10=_0x52c0[_0x152198];return _0x553e10;};'use strict';var _=require(_0x052c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x052c('0x1'));var fs=require('fs');var Redis=require(_0x052c('0x2'));var db=require(_0x052c('0x3'))['db'];var utils=require(_0x052c('0x4'));var logger=require(_0x052c('0x5'))(_0x052c('0x6'));var config=require(_0x052c('0x7'));var jayson=require(_0x052c('0x8'));var client=jayson['client'][_0x052c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x117147,_0x59068f,_0x163175){return new BPromise(function(_0x46bb89,_0x5a3c0f){return client[_0x052c('0xa')](_0x117147,_0x163175)[_0x052c('0xb')](function(_0x1ee0dc){logger[_0x052c('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x59068f,_0x052c('0xd'));logger[_0x052c('0xe')](_0x052c('0xf'),_0x59068f,_0x052c('0xd'),JSON[_0x052c('0x10')](_0x1ee0dc));if(_0x1ee0dc[_0x052c('0x11')]){if(_0x1ee0dc[_0x052c('0x11')][_0x052c('0x12')]===0x1f4){logger[_0x052c('0x11')](_0x052c('0x13'),_0x59068f,_0x1ee0dc['error']['message']);return _0x5a3c0f(_0x1ee0dc[_0x052c('0x11')]['message']);}logger[_0x052c('0x11')](_0x052c('0x13'),_0x59068f,_0x1ee0dc[_0x052c('0x11')][_0x052c('0x14')]);return _0x46bb89(_0x1ee0dc[_0x052c('0x11')][_0x052c('0x14')]);}else{logger[_0x052c('0xc')](_0x052c('0x13'),_0x59068f,_0x052c('0xd'));_0x46bb89(_0x1ee0dc['result'][_0x052c('0x14')]);}})[_0x052c('0x15')](function(_0x5cf5c5){logger[_0x052c('0x11')](_0x052c('0x13'),_0x59068f,_0x5cf5c5);_0x5a3c0f(_0x5cf5c5);});});}
\ No newline at end of file
+var _0x7293=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','catch','util','moment'];(function(_0x4e2dd8,_0x2114c3){var _0x24c95e=function(_0x4b438e){while(--_0x4b438e){_0x4e2dd8['push'](_0x4e2dd8['shift']());}};_0x24c95e(++_0x2114c3);}(_0x7293,0xd6));var _0x3729=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x7293[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x3729('0x0'));var moment=require(_0x3729('0x1'));var BPromise=require(_0x3729('0x2'));var rs=require(_0x3729('0x3'));var fs=require('fs');var Redis=require(_0x3729('0x4'));var db=require(_0x3729('0x5'))['db'];var utils=require(_0x3729('0x6'));var logger=require(_0x3729('0x7'))(_0x3729('0x8'));var config=require(_0x3729('0x9'));var jayson=require(_0x3729('0xa'));var client=jayson[_0x3729('0xb')][_0x3729('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3ac846,_0x52cad5,_0x334f06){return new BPromise(function(_0x17cc12,_0x5cef33){return client[_0x3729('0xd')](_0x3ac846,_0x334f06)['then'](function(_0x4d8302){logger[_0x3729('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x52cad5,_0x3729('0xf'));logger[_0x3729('0x10')](_0x3729('0x11'),_0x52cad5,_0x3729('0xf'),JSON[_0x3729('0x12')](_0x4d8302));if(_0x4d8302[_0x3729('0x13')]){if(_0x4d8302['error'][_0x3729('0x14')]===0x1f4){logger[_0x3729('0x13')](_0x3729('0x15'),_0x52cad5,_0x4d8302['error'][_0x3729('0x16')]);return _0x5cef33(_0x4d8302[_0x3729('0x13')][_0x3729('0x16')]);}logger[_0x3729('0x13')](_0x3729('0x15'),_0x52cad5,_0x4d8302['error']['message']);return _0x17cc12(_0x4d8302['error'][_0x3729('0x16')]);}else{logger[_0x3729('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x52cad5,_0x3729('0xf'));_0x17cc12(_0x4d8302['result'][_0x3729('0x16')]);}})[_0x3729('0x17')](function(_0x4f8ed0){logger[_0x3729('0x13')](_0x3729('0x15'),_0x52cad5,_0x4f8ed0);_0x5cef33(_0x4f8ed0);});});}
\ No newline at end of file
index 7aca497..f5be3b1 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(_0x6c225b,_0x4de56c){var _0x268839=function(_0x1d60b3){while(--_0x1d60b3){_0x6c225b['push'](_0x6c225b['shift']());}};_0x268839(++_0x4de56c);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2573f7,_0x1200bc){var _0x57740d=function(_0x4ecf47){while(--_0x4ecf47){_0x2573f7['push'](_0x2573f7['shift']());}};_0x57740d(++_0x1200bc);}(_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');module[_0x49c4('0x6')]=router;
\ No newline at end of file
index 96986d4..cc307f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa81a=['INTEGER','sequelize'];(function(_0x4972ef,_0x2bcd82){var _0x5665d9=function(_0x571f28){while(--_0x571f28){_0x4972ef['push'](_0x4972ef['shift']());}};_0x5665d9(++_0x2bcd82);}(_0xa81a,0x1f1));var _0xaa81=function(_0x457702,_0xa7824e){_0x457702=_0x457702-0x0;var _0x3a7f11=_0xa81a[_0x457702];return _0x3a7f11;};'use strict';var Sequelize=require(_0xaa81('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xaa81('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x82eb=['exports','INTEGER','sequelize'];(function(_0x2ca022,_0x22f3f9){var _0x26867a=function(_0x3b0483){while(--_0x3b0483){_0x2ca022['push'](_0x2ca022['shift']());}};_0x26867a(++_0x22f3f9);}(_0x82eb,0xaa));var _0xb82e=function(_0x2ae691,_0x43539a){_0x2ae691=_0x2ae691-0x0;var _0x5e0b0c=_0x82eb[_0x2ae691];return _0x5e0b0c;};'use strict';var Sequelize=require(_0xb82e('0x0'));module[_0xb82e('0x1')]={'penalty':{'type':Sequelize[_0xb82e('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index a88035d..7e21f12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6050=['../../config/environment','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3f8431,_0x2cf20d){var _0x2be2eb=function(_0x5cba43){while(--_0x5cba43){_0x3f8431['push'](_0x3f8431['shift']());}};_0x2be2eb(++_0x2cf20d);}(_0x6050,0x196));var _0x0605=function(_0x55154f,_0x4b7596){_0x55154f=_0x55154f-0x0;var _0x2fc5e8=_0x6050[_0x55154f];return _0x2fc5e8;};'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('./userSmsQueue.attributes');module['exports']=function(_0x4aca21,_0xd78d96){return _0x4aca21['define']('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe944=['define','UserSmsQueue','user_has_sms_queues','lodash','api','request-promise','../../config/environment','./userSmsQueue.attributes','exports'];(function(_0x5b026c,_0x2807fb){var _0x3d270c=function(_0x140bee){while(--_0x140bee){_0x5b026c['push'](_0x5b026c['shift']());}};_0x3d270c(++_0x2807fb);}(_0xe944,0x174));var _0x4e94=function(_0x3bdd9e,_0x119717){_0x3bdd9e=_0x3bdd9e-0x0;var _0x3dc068=_0xe944[_0x3bdd9e];return _0x3dc068;};'use strict';var _=require(_0x4e94('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4e94('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4e94('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4e94('0x3'));var attributes=require(_0x4e94('0x4'));module[_0x4e94('0x5')]=function(_0xbb43ae,_0x4d00e5){return _0xbb43ae[_0x4e94('0x6')](_0x4e94('0x7'),attributes,{'tableName':_0x4e94('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 577163b..11339cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b15=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','bluebird'];(function(_0x2b83de,_0x2c2d64){var _0x401198=function(_0x334871){while(--_0x334871){_0x2b83de['push'](_0x2b83de['shift']());}};_0x401198(++_0x2c2d64);}(_0x7b15,0x106));var _0x57b1=function(_0x25acce,_0x1bc34f){_0x25acce=_0x25acce-0x0;var _0x48f5de=_0x7b15[_0x25acce];return _0x48f5de;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x57b1('0x0'));var BPromise=require(_0x57b1('0x1'));var rs=require(_0x57b1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x57b1('0x3'))['db'];var utils=require(_0x57b1('0x4'));var logger=require('../../config/logger')(_0x57b1('0x5'));var config=require(_0x57b1('0x6'));var jayson=require(_0x57b1('0x7'));var client=jayson[_0x57b1('0x8')][_0x57b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29dd45,_0x108207,_0x17fd5a){return new BPromise(function(_0x19cc6b,_0x5953b2){return client[_0x57b1('0xa')](_0x29dd45,_0x17fd5a)[_0x57b1('0xb')](function(_0xcd85cc){logger[_0x57b1('0xc')](_0x57b1('0xd'),_0x108207,_0x57b1('0xe'));logger[_0x57b1('0xf')](_0x57b1('0x10'),_0x108207,_0x57b1('0xe'),JSON[_0x57b1('0x11')](_0xcd85cc));if(_0xcd85cc[_0x57b1('0x12')]){if(_0xcd85cc[_0x57b1('0x12')][_0x57b1('0x13')]===0x1f4){logger[_0x57b1('0x12')](_0x57b1('0xd'),_0x108207,_0xcd85cc['error']['message']);return _0x5953b2(_0xcd85cc[_0x57b1('0x12')][_0x57b1('0x14')]);}logger[_0x57b1('0x12')](_0x57b1('0xd'),_0x108207,_0xcd85cc[_0x57b1('0x12')]['message']);return _0x19cc6b(_0xcd85cc[_0x57b1('0x12')][_0x57b1('0x14')]);}else{logger[_0x57b1('0xc')](_0x57b1('0xd'),_0x108207,_0x57b1('0xe'));_0x19cc6b(_0xcd85cc[_0x57b1('0x15')][_0x57b1('0x14')]);}})['catch'](function(_0x16f4f2){logger[_0x57b1('0x12')](_0x57b1('0xd'),_0x108207,_0x16f4f2);_0x5953b2(_0x16f4f2);});});}
\ No newline at end of file
+var _0xf1ca=['jayson/promise','client','http','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2c98db,_0x19a9e6){var _0x1b2142=function(_0xbea8d7){while(--_0xbea8d7){_0x2c98db['push'](_0x2c98db['shift']());}};_0x1b2142(++_0x19a9e6);}(_0xf1ca,0xdf));var _0xaf1c=function(_0x26a4b1,_0xbc8c6f){_0x26a4b1=_0x26a4b1-0x0;var _0x2bd011=_0xf1ca[_0x26a4b1];return _0x2bd011;};'use strict';var _=require(_0xaf1c('0x0'));var util=require(_0xaf1c('0x1'));var moment=require('moment');var BPromise=require(_0xaf1c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf1c('0x3'));var db=require(_0xaf1c('0x4'))['db'];var utils=require(_0xaf1c('0x5'));var logger=require(_0xaf1c('0x6'))(_0xaf1c('0x7'));var config=require('../../config/environment');var jayson=require(_0xaf1c('0x8'));var client=jayson[_0xaf1c('0x9')][_0xaf1c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b8a76,_0x351942,_0x454237){return new BPromise(function(_0x222e97,_0x157134){return client[_0xaf1c('0xb')](_0x2b8a76,_0x454237)['then'](function(_0xdbd2a4){logger[_0xaf1c('0xc')](_0xaf1c('0xd'),_0x351942,'request\x20sent');logger['debug']('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x351942,_0xaf1c('0xe'),JSON[_0xaf1c('0xf')](_0xdbd2a4));if(_0xdbd2a4['error']){if(_0xdbd2a4[_0xaf1c('0x10')][_0xaf1c('0x11')]===0x1f4){logger['error'](_0xaf1c('0xd'),_0x351942,_0xdbd2a4[_0xaf1c('0x10')][_0xaf1c('0x12')]);return _0x157134(_0xdbd2a4[_0xaf1c('0x10')]['message']);}logger[_0xaf1c('0x10')](_0xaf1c('0xd'),_0x351942,_0xdbd2a4[_0xaf1c('0x10')]['message']);return _0x222e97(_0xdbd2a4[_0xaf1c('0x10')]['message']);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x351942,_0xaf1c('0xe'));_0x222e97(_0xdbd2a4[_0xaf1c('0x13')][_0xaf1c('0x12')]);}})[_0xaf1c('0x14')](function(_0x2c485c){logger[_0xaf1c('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x351942,_0x2c485c);_0x157134(_0x2c485c);});});}
\ No newline at end of file
index 5350893..7a803eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x721b=['INTEGER','sequelize'];(function(_0x35e4ad,_0x28783c){var _0x59b2e0=function(_0x38add9){while(--_0x38add9){_0x35e4ad['push'](_0x35e4ad['shift']());}};_0x59b2e0(++_0x28783c);}(_0x721b,0x6d));var _0xb721=function(_0x5a6911,_0x5c3209){_0x5a6911=_0x5a6911-0x0;var _0xeaa3a0=_0x721b[_0x5a6911];return _0xeaa3a0;};'use strict';var Sequelize=require(_0xb721('0x0'));module['exports']={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xb721('0x1')]}};
\ No newline at end of file
+var _0xa188=['INTEGER','exports'];(function(_0x42d2c5,_0x2d61b6){var _0x478b11=function(_0x247f7b){while(--_0x247f7b){_0x42d2c5['push'](_0x42d2c5['shift']());}};_0x478b11(++_0x2d61b6);}(_0xa188,0x85));var _0x8a18=function(_0x4bfc20,_0x2a5e8d){_0x4bfc20=_0x4bfc20-0x0;var _0x12bc36=_0xa188[_0x4bfc20];return _0x12bc36;};'use strict';var Sequelize=require('sequelize');module[_0x8a18('0x0')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x8a18('0x1')]}};
\ No newline at end of file
index 83b6eef..019fd4f 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(_0x523711,_0x523c78){var _0x20f966=function(_0x393861){while(--_0x393861){_0x523711['push'](_0x523711['shift']());}};_0x20f966(++_0x523c78);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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(_0x223745,_0x4fcbb8){var _0x5d8730=function(_0x3da2e6){while(--_0x3da2e6){_0x223745['push'](_0x223745['shift']());}};_0x5d8730(++_0x4fcbb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 c612a22..86c3e06 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(_0x3f6a5a,_0x41108a){var _0x54d9e3=function(_0x3ce4c8){while(--_0x3ce4c8){_0x3f6a5a['push'](_0x3f6a5a['shift']());}};_0x54d9e3(++_0x41108a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4d344d,_0x22eb07){var _0xdef20c=function(_0x16d64d){while(--_0x16d64d){_0x4d344d['push'](_0x4d344d['shift']());}};_0xdef20c(++_0x22eb07);}(_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 d83f07b..8caba88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00b7=['INTEGER','sequelize','exports'];(function(_0x1cfcd5,_0x47764b){var _0x365b81=function(_0x1eaf89){while(--_0x1eaf89){_0x1cfcd5['push'](_0x1cfcd5['shift']());}};_0x365b81(++_0x47764b);}(_0x00b7,0x160));var _0x700b=function(_0x3504e6,_0x44bfb4){_0x3504e6=_0x3504e6-0x0;var _0x58c0e9=_0x00b7[_0x3504e6];return _0x58c0e9;};'use strict';var Sequelize=require(_0x700b('0x0'));module[_0x700b('0x1')]={'penalty':{'type':Sequelize[_0x700b('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xbb74=['sequelize','INTEGER'];(function(_0x590fc5,_0x2d32b8){var _0x496f44=function(_0x420b9b){while(--_0x420b9b){_0x590fc5['push'](_0x590fc5['shift']());}};_0x496f44(++_0x2d32b8);}(_0xbb74,0x116));var _0x4bb7=function(_0x316414,_0x1d10bd){_0x316414=_0x316414-0x0;var _0x488f2e=_0xbb74[_0x316414];return _0x488f2e;};'use strict';var Sequelize=require(_0x4bb7('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x4bb7('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index d2981e3..4aa9a5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac54=['bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api'];(function(_0x102ad3,_0x2a359b){var _0x52c7ab=function(_0x5e0f62){while(--_0x5e0f62){_0x102ad3['push'](_0x102ad3['shift']());}};_0x52c7ab(++_0x2a359b);}(_0xac54,0xdc));var _0x4ac5=function(_0x1f101d,_0x179ad6){_0x1f101d=_0x1f101d-0x0;var _0x57f567=_0xac54[_0x1f101d];return _0x57f567;};'use strict';var _=require(_0x4ac5('0x0'));var util=require(_0x4ac5('0x1'));var logger=require(_0x4ac5('0x2'))(_0x4ac5('0x3'));var moment=require('moment');var BPromise=require(_0x4ac5('0x4'));var rp=require(_0x4ac5('0x5'));var fs=require('fs');var path=require(_0x4ac5('0x6'));var rimraf=require(_0x4ac5('0x7'));var config=require(_0x4ac5('0x8'));var attributes=require(_0x4ac5('0x9'));module[_0x4ac5('0xa')]=function(_0x24c52e,_0x321bec){return _0x24c52e[_0x4ac5('0xb')](_0x4ac5('0xc'),attributes,{'tableName':_0x4ac5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5846=['util','../../config/logger','api','moment','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash'];(function(_0xa5b63f,_0x5a5b53){var _0x50699b=function(_0x419dea){while(--_0x419dea){_0xa5b63f['push'](_0xa5b63f['shift']());}};_0x50699b(++_0x5a5b53);}(_0x5846,0x6b));var _0x6584=function(_0x55cb45,_0x34b5da){_0x55cb45=_0x55cb45-0x0;var _0x4e2a15=_0x5846[_0x55cb45];return _0x4e2a15;};'use strict';var _=require(_0x6584('0x0'));var util=require(_0x6584('0x1'));var logger=require(_0x6584('0x2'))(_0x6584('0x3'));var moment=require(_0x6584('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6584('0x5'));var config=require(_0x6584('0x6'));var attributes=require(_0x6584('0x7'));module[_0x6584('0x8')]=function(_0x1a744d,_0x359420){return _0x1a744d[_0x6584('0x9')](_0x6584('0xa'),attributes,{'tableName':_0x6584('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2db1dc0..9eb7e36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x120c=['info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x28a87b,_0x27201){var _0x454b2d=function(_0x2b2b8d){while(--_0x2b2b8d){_0x28a87b['push'](_0x28a87b['shift']());}};_0x454b2d(++_0x27201);}(_0x120c,0xfb));var _0xc120=function(_0x32d1a8,_0x40f461){_0x32d1a8=_0x32d1a8-0x0;var _0x517706=_0x120c[_0x32d1a8];return _0x517706;};'use strict';var _=require(_0xc120('0x0'));var util=require(_0xc120('0x1'));var moment=require('moment');var BPromise=require(_0xc120('0x2'));var rs=require(_0xc120('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc120('0x4'))['db'];var utils=require(_0xc120('0x5'));var logger=require(_0xc120('0x6'))(_0xc120('0x7'));var config=require(_0xc120('0x8'));var jayson=require(_0xc120('0x9'));var client=jayson[_0xc120('0xa')][_0xc120('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17f5de,_0x40c42c,_0x4badb2){return new BPromise(function(_0x3b6e0a,_0x40b76f){return client[_0xc120('0xc')](_0x17f5de,_0x4badb2)['then'](function(_0x1e72c8){logger[_0xc120('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x40c42c,_0xc120('0xe'));logger[_0xc120('0xf')](_0xc120('0x10'),_0x40c42c,_0xc120('0xe'),JSON[_0xc120('0x11')](_0x1e72c8));if(_0x1e72c8['error']){if(_0x1e72c8['error'][_0xc120('0x12')]===0x1f4){logger[_0xc120('0x13')](_0xc120('0x14'),_0x40c42c,_0x1e72c8[_0xc120('0x13')][_0xc120('0x15')]);return _0x40b76f(_0x1e72c8[_0xc120('0x13')]['message']);}logger[_0xc120('0x13')](_0xc120('0x14'),_0x40c42c,_0x1e72c8['error'][_0xc120('0x15')]);return _0x3b6e0a(_0x1e72c8[_0xc120('0x13')]['message']);}else{logger[_0xc120('0xd')](_0xc120('0x14'),_0x40c42c,'request\x20sent');_0x3b6e0a(_0x1e72c8[_0xc120('0x16')]['message']);}})[_0xc120('0x17')](function(_0x461d21){logger[_0xc120('0x13')](_0xc120('0x14'),_0x40c42c,_0x461d21);_0x40b76f(_0x461d21);});});}
\ No newline at end of file
+var _0xee5a=['UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','request','info'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xee5a,0x1b8));var _0xaee5=function(_0x54691e,_0x3eaeb5){_0x54691e=_0x54691e-0x0;var _0x581a33=_0xee5a[_0x54691e];return _0x581a33;};'use strict';var _=require(_0xaee5('0x0'));var util=require(_0xaee5('0x1'));var moment=require(_0xaee5('0x2'));var BPromise=require(_0xaee5('0x3'));var rs=require(_0xaee5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaee5('0x5'));var logger=require('../../config/logger')(_0xaee5('0x6'));var config=require('../../config/environment');var jayson=require(_0xaee5('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c6245,_0x397392,_0x47e831){return new BPromise(function(_0x332400,_0x4a9c28){return client[_0xaee5('0x8')](_0x5c6245,_0x47e831)['then'](function(_0x3ef380){logger[_0xaee5('0x9')](_0xaee5('0xa'),_0x397392,_0xaee5('0xb'));logger[_0xaee5('0xc')](_0xaee5('0xd'),_0x397392,_0xaee5('0xb'),JSON[_0xaee5('0xe')](_0x3ef380));if(_0x3ef380['error']){if(_0x3ef380[_0xaee5('0xf')]['code']===0x1f4){logger[_0xaee5('0xf')](_0xaee5('0xa'),_0x397392,_0x3ef380[_0xaee5('0xf')][_0xaee5('0x10')]);return _0x4a9c28(_0x3ef380[_0xaee5('0xf')][_0xaee5('0x10')]);}logger[_0xaee5('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x397392,_0x3ef380['error']['message']);return _0x332400(_0x3ef380[_0xaee5('0xf')][_0xaee5('0x10')]);}else{logger[_0xaee5('0x9')](_0xaee5('0xa'),_0x397392,_0xaee5('0xb'));_0x332400(_0x3ef380[_0xaee5('0x11')][_0xaee5('0x10')]);}})['catch'](function(_0x11a5ba){logger[_0xaee5('0xf')](_0xaee5('0xa'),_0x397392,_0x11a5ba);_0x4a9c28(_0x11a5ba);});});}
\ No newline at end of file
index 2481e56..46b48d3 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(_0x51c937,_0xaae677){var _0xb10c83=function(_0x5141da){while(--_0x5141da){_0x51c937['push'](_0x51c937['shift']());}};_0xb10c83(++_0xaae677);}(_0x70e0,0x17b));var _0x070e=function(_0x287bed,_0x4d439a){_0x287bed=_0x287bed-0x0;var _0x234f85=_0x70e0[_0x287bed];return _0x234f85;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x848300,_0xd6f38a){var _0x50ace4=function(_0x99adc6){while(--_0x99adc6){_0x848300['push'](_0x848300['shift']());}};_0x50ace4(++_0xd6f38a);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
index e56de98..6ea1104 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf68=['queue_interface','INTEGER','exports','Required\x20by\x20Asterisk','STRING'];(function(_0x14475a,_0x3991a0){var _0xca466e=function(_0x520f6b){while(--_0x520f6b){_0x14475a['push'](_0x14475a['shift']());}};_0xca466e(++_0x3991a0);}(_0xdf68,0x7f));var _0x8df6=function(_0x1ebc6c,_0x58a00b){_0x1ebc6c=_0x1ebc6c-0x0;var _0x3a826d=_0xdf68[_0x1ebc6c];return _0x3a826d;};'use strict';var Sequelize=require('sequelize');module[_0x8df6('0x0')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x8df6('0x1')},'membername':{'type':Sequelize[_0x8df6('0x2')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x8df6('0x2')],'allowNull':![],'unique':_0x8df6('0x3'),'comment':_0x8df6('0x1')},'VoiceQueueId':{'type':Sequelize[_0x8df6('0x4')],'allowNull':![]},'interface':{'type':Sequelize[_0x8df6('0x2')],'allowNull':![],'unique':_0x8df6('0x3'),'comment':_0x8df6('0x1')},'penalty':{'type':Sequelize[_0x8df6('0x4')](0xb),'defaultValue':0x0,'comment':_0x8df6('0x1')},'paused':{'type':Sequelize[_0x8df6('0x4')](0xb),'defaultValue':0x0,'comment':_0x8df6('0x1')}};
\ No newline at end of file
+var _0xd674=['queue_interface','sequelize','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x3a2410,_0x350e65){var _0x421251=function(_0x109340){while(--_0x109340){_0x3a2410['push'](_0x3a2410['shift']());}};_0x421251(++_0x350e65);}(_0xd674,0xab));var _0x4d67=function(_0x3fa98f,_0xf4ed5b){_0x3fa98f=_0x3fa98f-0x0;var _0x438951=_0xd674[_0x3fa98f];return _0x438951;};'use strict';var Sequelize=require(_0x4d67('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x4d67('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x4d67('0x2')},'membername':{'type':Sequelize[_0x4d67('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x4d67('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x4d67('0x3')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4d67('0x4'),'comment':_0x4d67('0x2')},'penalty':{'type':Sequelize[_0x4d67('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x4d67('0x1')](0xb),'defaultValue':0x0,'comment':_0x4d67('0x2')}};
\ No newline at end of file
index f41a666..6dcb6fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xace0=['remove','emit','exports','../../mysqldb','setMaxListeners','update'];(function(_0x543797,_0xfe14b){var _0x28270d=function(_0x15a2dc){while(--_0x15a2dc){_0x543797['push'](_0x543797['shift']());}};_0x28270d(++_0xfe14b);}(_0xace0,0x195));var _0x0ace=function(_0x21af3a,_0x386e1d){_0x21af3a=_0x21af3a-0x0;var _0x268a49=_0xace0[_0x21af3a];return _0x268a49;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x0ace('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x0ace('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0ace('0x2'),'afterDestroy':_0x0ace('0x3')};function emitEvent(_0x5bda2f){return function(_0xd0caa6,_0x1726f7,_0x325bb3){UserVoiceQueueRtEvents[_0x0ace('0x4')](_0x5bda2f+':'+_0xd0caa6['id'],_0xd0caa6);UserVoiceQueueRtEvents['emit'](_0x5bda2f,_0xd0caa6);_0x325bb3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x0ace('0x5')]=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0xb1be=['exports','events','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit'];(function(_0x2307bb,_0x37e780){var _0x2300dc=function(_0x105efe){while(--_0x105efe){_0x2307bb['push'](_0x2307bb['shift']());}};_0x2300dc(++_0x37e780);}(_0xb1be,0x1d9));var _0xeb1b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb1be[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xeb1b('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xeb1b('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xeb1b('0x2')](0x0);var events={'afterCreate':_0xeb1b('0x3'),'afterUpdate':_0xeb1b('0x4'),'afterDestroy':_0xeb1b('0x5')};function emitEvent(_0x268b3e){return function(_0x47dd17,_0x1f50df,_0x316eab){UserVoiceQueueRtEvents[_0xeb1b('0x6')](_0x268b3e+':'+_0x47dd17['id'],_0x47dd17);UserVoiceQueueRtEvents[_0xeb1b('0x6')](_0x268b3e,_0x47dd17);_0x316eab(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0xeb1b('0x7')]=UserVoiceQueueRtEvents;
\ No newline at end of file
index 6aff3c1..7617aa0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4e0=['lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','exports','UserVoiceQueueRt','user_has_voice_queues_rt'];(function(_0x16bf05,_0x4f70da){var _0xbcf546=function(_0x70b01d){while(--_0x70b01d){_0x16bf05['push'](_0x16bf05['shift']());}};_0xbcf546(++_0x4f70da);}(_0xa4e0,0x64));var _0x0a4e=function(_0x43316d,_0x5ebd8f){_0x43316d=_0x43316d-0x0;var _0x52d343=_0xa4e0[_0x43316d];return _0x52d343;};'use strict';var _=require(_0x0a4e('0x0'));var util=require('util');var logger=require(_0x0a4e('0x1'))(_0x0a4e('0x2'));var moment=require(_0x0a4e('0x3'));var BPromise=require('bluebird');var rp=require(_0x0a4e('0x4'));var fs=require('fs');var path=require(_0x0a4e('0x5'));var rimraf=require('rimraf');var config=require(_0x0a4e('0x6'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x0a4e('0x7')]=function(_0x3593b6,_0x30b35b){return _0x3593b6['define'](_0x0a4e('0x8'),attributes,{'tableName':_0x0a4e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x626b=['bluebird','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','api','moment'];(function(_0x3e7387,_0x31842d){var _0x72b183=function(_0x57dd82){while(--_0x57dd82){_0x3e7387['push'](_0x3e7387['shift']());}};_0x72b183(++_0x31842d);}(_0x626b,0xf8));var _0xb626=function(_0x16b9d6,_0x4f9817){_0x16b9d6=_0x16b9d6-0x0;var _0x2c12fd=_0x626b[_0x16b9d6];return _0x2c12fd;};'use strict';var _=require(_0xb626('0x0'));var util=require(_0xb626('0x1'));var logger=require('../../config/logger')(_0xb626('0x2'));var moment=require(_0xb626('0x3'));var BPromise=require(_0xb626('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(_0xb626('0x5'));module['exports']=function(_0x2638ef,_0x43f847){return _0x2638ef[_0xb626('0x6')](_0xb626('0x7'),attributes,{'tableName':_0xb626('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2184bdc..87b6e55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffe9=['options','raw','sequelize','COUNT','outboundQueuePauses','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll'];(function(_0x5cdee3,_0x4add48){var _0x296ad6=function(_0x4c0ab1){while(--_0x4c0ab1){_0x5cdee3['push'](_0x5cdee3['shift']());}};_0x296ad6(++_0x4add48);}(_0xffe9,0xfa));var _0x9ffe=function(_0x5067db,_0xf8d2f2){_0x5067db=_0x5067db-0x0;var _0x2771e4=_0xffe9[_0x5067db];return _0x2771e4;};'use strict';var _=require('lodash');var util=require(_0x9ffe('0x0'));var moment=require(_0x9ffe('0x1'));var BPromise=require(_0x9ffe('0x2'));var rs=require(_0x9ffe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9ffe('0x4'));var logger=require(_0x9ffe('0x5'))(_0x9ffe('0x6'));var config=require(_0x9ffe('0x7'));var jayson=require(_0x9ffe('0x8'));var client=jayson[_0x9ffe('0x9')][_0x9ffe('0xa')]({'port':0x232a});config[_0x9ffe('0xb')]=_[_0x9ffe('0xc')](config[_0x9ffe('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x9ffe('0xd'))(new Redis(config[_0x9ffe('0xb')]));require(_0x9ffe('0xe'))['register'](socket);function respondWithRpcPromise(_0x48d24f,_0x4f4d0d,_0xcd1fe1){return new BPromise(function(_0x2a8ad2,_0x191959){return client['request'](_0x48d24f,_0xcd1fe1)[_0x9ffe('0xf')](function(_0x598e6c){logger[_0x9ffe('0x10')](_0x9ffe('0x11'),_0x4f4d0d,'request\x20sent');logger[_0x9ffe('0x12')](_0x9ffe('0x13'),_0x4f4d0d,_0x9ffe('0x14'),JSON[_0x9ffe('0x15')](_0x598e6c));if(_0x598e6c['error']){if(_0x598e6c[_0x9ffe('0x16')][_0x9ffe('0x17')]===0x1f4){logger['error'](_0x9ffe('0x11'),_0x4f4d0d,_0x598e6c[_0x9ffe('0x16')][_0x9ffe('0x18')]);return _0x191959(_0x598e6c[_0x9ffe('0x16')][_0x9ffe('0x18')]);}logger[_0x9ffe('0x16')](_0x9ffe('0x11'),_0x4f4d0d,_0x598e6c[_0x9ffe('0x16')][_0x9ffe('0x18')]);return _0x2a8ad2(_0x598e6c[_0x9ffe('0x16')]['message']);}else{logger[_0x9ffe('0x10')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4f4d0d,_0x9ffe('0x14'));_0x2a8ad2(_0x598e6c[_0x9ffe('0x19')][_0x9ffe('0x18')]);}})[_0x9ffe('0x1a')](function(_0x2f2dcd){logger[_0x9ffe('0x16')](_0x9ffe('0x11'),_0x4f4d0d,_0x2f2dcd);_0x191959(_0x2f2dcd);});});}exports[_0x9ffe('0x1b')]=function(_0x36a3d0){var _0x3061fd=this;return new Promise(function(_0x16cbb5,_0x1eb195){return db[_0x9ffe('0x1c')][_0x9ffe('0x1d')]({'raw':_0x36a3d0[_0x9ffe('0x1e')]?_0x36a3d0[_0x9ffe('0x1e')][_0x9ffe('0x1f')]===undefined?!![]:![]:!![],'where':_0x36a3d0[_0x9ffe('0x1e')]?_0x36a3d0[_0x9ffe('0x1e')]['where']||null:null,'attributes':[[db[_0x9ffe('0x20')]['fn'](_0x9ffe('0x21'),db[_0x9ffe('0x20')]['fn']('IF',db[_0x9ffe('0x20')]['literal']('`paused`\x20=\x201,\x201,\x20null'))),_0x9ffe('0x22')]]})[_0x9ffe('0xf')](function(_0x13d1ba){logger[_0x9ffe('0x10')](_0x9ffe('0x1b'),_0x36a3d0);logger[_0x9ffe('0x12')](_0x9ffe('0x1b'),_0x36a3d0,JSON[_0x9ffe('0x15')](_0x13d1ba));_0x16cbb5(_0x13d1ba);})[_0x9ffe('0x1a')](function(_0x22debc){logger[_0x9ffe('0x16')](_0x9ffe('0x1b'),_0x22debc['message'],_0x36a3d0);_0x1eb195(_0x3061fd[_0x9ffe('0x16')](0x1f4,_0x22debc[_0x9ffe('0x18')]));});});};
\ No newline at end of file
+var _0xa393=['result','catch','UserVoiceQueueRt','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4566db,_0x5da9a1){var _0x3167e6=function(_0x154ed8){while(--_0x154ed8){_0x4566db['push'](_0x4566db['shift']());}};_0x3167e6(++_0x5da9a1);}(_0xa393,0xa4));var _0x3a39=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xa393[_0x32f7d7];return _0x133d09;};'use strict';var _=require('lodash');var util=require(_0x3a39('0x0'));var moment=require('moment');var BPromise=require(_0x3a39('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3a39('0x2'));var db=require(_0x3a39('0x3'))['db'];var utils=require(_0x3a39('0x4'));var logger=require(_0x3a39('0x5'))(_0x3a39('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3a39('0x7')][_0x3a39('0x8')]({'port':0x232a});config[_0x3a39('0x9')]=_[_0x3a39('0xa')](config[_0x3a39('0x9')],{'host':_0x3a39('0xb'),'port':0x18eb});var socket=require(_0x3a39('0xc'))(new Redis(config[_0x3a39('0x9')]));require(_0x3a39('0xd'))[_0x3a39('0xe')](socket);function respondWithRpcPromise(_0x480c20,_0x5db899,_0x5cbb73){return new BPromise(function(_0x25c2a2,_0x106683){return client[_0x3a39('0xf')](_0x480c20,_0x5cbb73)[_0x3a39('0x10')](function(_0x2157cc){logger[_0x3a39('0x11')](_0x3a39('0x12'),_0x5db899,_0x3a39('0x13'));logger[_0x3a39('0x14')](_0x3a39('0x15'),_0x5db899,_0x3a39('0x13'),JSON[_0x3a39('0x16')](_0x2157cc));if(_0x2157cc[_0x3a39('0x17')]){if(_0x2157cc['error'][_0x3a39('0x18')]===0x1f4){logger[_0x3a39('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x5db899,_0x2157cc[_0x3a39('0x17')]['message']);return _0x106683(_0x2157cc[_0x3a39('0x17')]['message']);}logger[_0x3a39('0x17')](_0x3a39('0x12'),_0x5db899,_0x2157cc[_0x3a39('0x17')][_0x3a39('0x19')]);return _0x25c2a2(_0x2157cc[_0x3a39('0x17')][_0x3a39('0x19')]);}else{logger[_0x3a39('0x11')](_0x3a39('0x12'),_0x5db899,_0x3a39('0x13'));_0x25c2a2(_0x2157cc[_0x3a39('0x1a')][_0x3a39('0x19')]);}})[_0x3a39('0x1b')](function(_0x3c5841){logger[_0x3a39('0x17')](_0x3a39('0x12'),_0x5db899,_0x3c5841);_0x106683(_0x3c5841);});});}exports['GetVoiceQueueRtPauses']=function(_0x578750){var _0x5bf0ea=this;return new Promise(function(_0x10c81a,_0x15db78){return db[_0x3a39('0x1c')]['findAll']({'raw':_0x578750[_0x3a39('0x1d')]?_0x578750[_0x3a39('0x1d')][_0x3a39('0x1e')]===undefined?!![]:![]:!![],'where':_0x578750[_0x3a39('0x1d')]?_0x578750[_0x3a39('0x1d')][_0x3a39('0x1f')]||null:null,'attributes':[[db[_0x3a39('0x20')]['fn'](_0x3a39('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0x3a39('0x22')](_0x3a39('0x23')))),_0x3a39('0x24')]]})['then'](function(_0x1c2016){logger['info'](_0x3a39('0x25'),_0x578750);logger[_0x3a39('0x14')](_0x3a39('0x25'),_0x578750,JSON['stringify'](_0x1c2016));_0x10c81a(_0x1c2016);})['catch'](function(_0x480524){logger[_0x3a39('0x17')](_0x3a39('0x25'),_0x480524[_0x3a39('0x19')],_0x578750);_0x15db78(_0x5bf0ea['error'](0x1f4,_0x480524[_0x3a39('0x19')]));});});};
\ No newline at end of file
index a0cad89..4033940 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x199c=['emit','register','length','userVoiceQueueRt:','remove','update'];(function(_0x2a0824,_0x21d97a){var _0x1a78f7=function(_0x517c4a){while(--_0x517c4a){_0x2a0824['push'](_0x2a0824['shift']());}};_0x1a78f7(++_0x21d97a);}(_0x199c,0x1d8));var _0xc199=function(_0x1a6905,_0x56adc4){_0x1a6905=_0x1a6905-0x0;var _0x4ef252=_0x199c[_0x1a6905];return _0x4ef252;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=['save',_0xc199('0x0'),_0xc199('0x1')];function createListener(_0xf15666,_0x3e0b15){return function(_0x124132){_0x3e0b15[_0xc199('0x2')](_0xf15666,_0x124132);};}function removeListener(_0x3f06cc,_0x1eecc2){return function(){UserVoiceQueueRtEvents['removeListener'](_0x3f06cc,_0x1eecc2);};}exports[_0xc199('0x3')]=function(_0x2ff172){for(var _0x499721=0x0,_0x4cd9cb=events[_0xc199('0x4')];_0x499721<_0x4cd9cb;_0x499721++){var _0x126236=events[_0x499721];var _0x12d6df=createListener(_0xc199('0x5')+_0x126236,_0x2ff172);UserVoiceQueueRtEvents['on'](_0x126236,_0x12d6df);}};
\ No newline at end of file
+var _0xfb65=['emit','removeListener','register','length','save','remove'];(function(_0x4456a2,_0x376ff2){var _0xf36b56=function(_0x356d69){while(--_0x356d69){_0x4456a2['push'](_0x4456a2['shift']());}};_0xf36b56(++_0x376ff2);}(_0xfb65,0x82));var _0x5fb6=function(_0x422a9d,_0x3312ae){_0x422a9d=_0x422a9d-0x0;var _0xd9add3=_0xfb65[_0x422a9d];return _0xd9add3;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x5fb6('0x0'),_0x5fb6('0x1'),'update'];function createListener(_0x860687,_0x54af6d){return function(_0x194bac){_0x54af6d[_0x5fb6('0x2')](_0x860687,_0x194bac);};}function removeListener(_0xca6345,_0xb5f7c4){return function(){UserVoiceQueueRtEvents[_0x5fb6('0x3')](_0xca6345,_0xb5f7c4);};}exports[_0x5fb6('0x4')]=function(_0x4dec8f){for(var _0x50782b=0x0,_0x238914=events[_0x5fb6('0x5')];_0x50782b<_0x238914;_0x50782b++){var _0x1f99b8=events[_0x50782b];var _0x840390=createListener('userVoiceQueueRt:'+_0x1f99b8,_0x4dec8f);UserVoiceQueueRtEvents['on'](_0x1f99b8,_0x840390);}};
\ No newline at end of file
index 9f0c616..a64edb0 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(_0xf9f831,_0x53f4e2){var _0xd0cac7=function(_0x5d1686){while(--_0x5d1686){_0xf9f831['push'](_0xf9f831['shift']());}};_0xd0cac7(++_0x53f4e2);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x252e67,_0x12bb5c){var _0x1376e8=function(_0xffeb56){while(--_0xffeb56){_0x252e67['push'](_0x252e67['shift']());}};_0x1376e8(++_0x12bb5c);}(_0x70e0,0x17b));var _0x070e=function(_0x2491ed,_0x16e6b8){_0x2491ed=_0x2491ed-0x0;var _0x8802c6=_0x70e0[_0x2491ed];return _0x8802c6;};'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 9d86b48..3a9306c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ee2=['INTEGER','sequelize','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x4ee2,0x1e4));var _0x24ee=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x4ee2[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0x24ee('0x0'));module[_0x24ee('0x1')]={'penalty':{'type':Sequelize[_0x24ee('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x15d7=['exports','INTEGER','sequelize'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x15d7,0x19d));var _0x715d=function(_0x363982,_0x4de044){_0x363982=_0x363982-0x0;var _0x5e6be1=_0x15d7[_0x363982];return _0x5e6be1;};'use strict';var Sequelize=require(_0x715d('0x0'));module[_0x715d('0x1')]={'penalty':{'type':Sequelize[_0x715d('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 75a4817..83bef83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b60=['path','rimraf','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','../../config/logger','request-promise'];(function(_0x29cd14,_0x245c40){var _0x4229d1=function(_0x1ef992){while(--_0x1ef992){_0x29cd14['push'](_0x29cd14['shift']());}};_0x4229d1(++_0x245c40);}(_0x3b60,0xa8));var _0x03b6=function(_0x68a8da,_0x2d341b){_0x68a8da=_0x68a8da-0x0;var _0x2ae37f=_0x3b60[_0x68a8da];return _0x2ae37f;};'use strict';var _=require(_0x03b6('0x0'));var util=require('util');var logger=require(_0x03b6('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x03b6('0x2'));var fs=require('fs');var path=require(_0x03b6('0x3'));var rimraf=require(_0x03b6('0x4'));var config=require('../../config/environment');var attributes=require('./userWhatsappQueue.attributes');module[_0x03b6('0x5')]=function(_0x13559e,_0x111e4b){return _0x13559e[_0x03b6('0x6')](_0x03b6('0x7'),attributes,{'tableName':_0x03b6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbea8=['rimraf','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x11a85b,_0x5f2d31){var _0x97d8dc=function(_0x262723){while(--_0x262723){_0x11a85b['push'](_0x11a85b['shift']());}};_0x97d8dc(++_0x5f2d31);}(_0xbea8,0xfd));var _0x8bea=function(_0x11e001,_0xb3367b){_0x11e001=_0x11e001-0x0;var _0x417419=_0xbea8[_0x11e001];return _0x417419;};'use strict';var _=require(_0x8bea('0x0'));var util=require(_0x8bea('0x1'));var logger=require('../../config/logger')(_0x8bea('0x2'));var moment=require(_0x8bea('0x3'));var BPromise=require(_0x8bea('0x4'));var rp=require(_0x8bea('0x5'));var fs=require('fs');var path=require(_0x8bea('0x6'));var rimraf=require(_0x8bea('0x7'));var config=require('../../config/environment');var attributes=require(_0x8bea('0x8'));module[_0x8bea('0x9')]=function(_0x4627bd,_0x359e8a){return _0x4627bd[_0x8bea('0xa')](_0x8bea('0xb'),attributes,{'tableName':_0x8bea('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 651a12e..c18b3b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad24=['info','catch','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x216226,_0x145eab){var _0x462499=function(_0x13c3c4){while(--_0x13c3c4){_0x216226['push'](_0x216226['shift']());}};_0x462499(++_0x145eab);}(_0xad24,0xac));var _0x4ad2=function(_0x1bb438,_0x1f09d8){_0x1bb438=_0x1bb438-0x0;var _0x2505a4=_0xad24[_0x1bb438];return _0x2505a4;};'use strict';var _=require('lodash');var util=require(_0x4ad2('0x0'));var moment=require(_0x4ad2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4ad2('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4ad2('0x3'));var logger=require(_0x4ad2('0x4'))('rpc');var config=require(_0x4ad2('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x4ad2('0x6')][_0x4ad2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x55ecd2,_0x4435eb,_0x362174){return new BPromise(function(_0x9a5d63,_0x265b79){return client[_0x4ad2('0x8')](_0x55ecd2,_0x362174)['then'](function(_0x2304ea){logger['info'](_0x4ad2('0x9'),_0x4435eb,_0x4ad2('0xa'));logger[_0x4ad2('0xb')](_0x4ad2('0xc'),_0x4435eb,_0x4ad2('0xa'),JSON['stringify'](_0x2304ea));if(_0x2304ea['error']){if(_0x2304ea['error']['code']===0x1f4){logger[_0x4ad2('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4435eb,_0x2304ea[_0x4ad2('0xd')][_0x4ad2('0xe')]);return _0x265b79(_0x2304ea[_0x4ad2('0xd')][_0x4ad2('0xe')]);}logger[_0x4ad2('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4435eb,_0x2304ea[_0x4ad2('0xd')][_0x4ad2('0xe')]);return _0x9a5d63(_0x2304ea[_0x4ad2('0xd')][_0x4ad2('0xe')]);}else{logger[_0x4ad2('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4435eb,_0x4ad2('0xa'));_0x9a5d63(_0x2304ea['result'][_0x4ad2('0xe')]);}})[_0x4ad2('0x10')](function(_0x2e6bd1){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x4435eb,_0x2e6bd1);_0x265b79(_0x2e6bd1);});});}
\ No newline at end of file
+var _0xbeea=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','lodash','util'];(function(_0x2a92d5,_0x46d690){var _0x4d4356=function(_0x3033c7){while(--_0x3033c7){_0x2a92d5['push'](_0x2a92d5['shift']());}};_0x4d4356(++_0x46d690);}(_0xbeea,0xbb));var _0xabee=function(_0x4f5abc,_0x1c72ac){_0x4f5abc=_0x4f5abc-0x0;var _0x35fd29=_0xbeea[_0x4f5abc];return _0x35fd29;};'use strict';var _=require(_0xabee('0x0'));var util=require(_0xabee('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xabee('0x2'));var fs=require('fs');var Redis=require(_0xabee('0x3'));var db=require(_0xabee('0x4'))['db'];var utils=require(_0xabee('0x5'));var logger=require(_0xabee('0x6'))(_0xabee('0x7'));var config=require(_0xabee('0x8'));var jayson=require(_0xabee('0x9'));var client=jayson['client'][_0xabee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x412431,_0x1b70ef,_0x2ef0ac){return new BPromise(function(_0x258c2e,_0x564914){return client[_0xabee('0xb')](_0x412431,_0x2ef0ac)['then'](function(_0x44423d){logger[_0xabee('0xc')](_0xabee('0xd'),_0x1b70ef,_0xabee('0xe'));logger[_0xabee('0xf')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x1b70ef,_0xabee('0xe'),JSON[_0xabee('0x10')](_0x44423d));if(_0x44423d['error']){if(_0x44423d['error'][_0xabee('0x11')]===0x1f4){logger['error'](_0xabee('0xd'),_0x1b70ef,_0x44423d[_0xabee('0x12')][_0xabee('0x13')]);return _0x564914(_0x44423d[_0xabee('0x12')]['message']);}logger['error'](_0xabee('0xd'),_0x1b70ef,_0x44423d['error'][_0xabee('0x13')]);return _0x258c2e(_0x44423d[_0xabee('0x12')][_0xabee('0x13')]);}else{logger[_0xabee('0xc')]('UserWhatsappQueue,\x20%s,\x20%s',_0x1b70ef,_0xabee('0xe'));_0x258c2e(_0x44423d[_0xabee('0x14')][_0xabee('0x13')]);}})['catch'](function(_0x29ab0a){logger[_0xabee('0x12')](_0xabee('0xd'),_0x1b70ef,_0x29ab0a);_0x564914(_0x29ab0a);});});}
\ No newline at end of file
index 563cca6..5a8b689 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4fb=['../../components/interaction/service','./variable.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0xfb0796,_0x4f6168){var _0x5c0b18=function(_0x53eb92){while(--_0x53eb92){_0xfb0796['push'](_0xfb0796['shift']());}};_0x5c0b18(++_0x4f6168);}(_0xa4fb,0x150));var _0xba4f=function(_0x4206f5,_0x21f338){_0x4206f5=_0x4206f5-0x0;var _0xa29cf3=_0xa4fb[_0x4206f5];return _0xa29cf3;};'use strict';var multer=require(_0xba4f('0x0'));var util=require(_0xba4f('0x1'));var path=require(_0xba4f('0x2'));var timeout=require(_0xba4f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xba4f('0x4'));var auth=require(_0xba4f('0x5'));var interaction=require(_0xba4f('0x6'));var config=require('../../config/environment');var controller=require(_0xba4f('0x7'));router[_0xba4f('0x8')]('/',auth[_0xba4f('0x9')](),controller[_0xba4f('0xa')]);router[_0xba4f('0x8')](_0xba4f('0xb'),auth[_0xba4f('0x9')](),controller[_0xba4f('0xc')]);router[_0xba4f('0xd')]('/',auth[_0xba4f('0x9')](),controller['create']);router[_0xba4f('0xe')]('/:id',auth[_0xba4f('0x9')](),controller[_0xba4f('0xf')]);router[_0xba4f('0x10')](_0xba4f('0xb'),auth[_0xba4f('0x9')](),controller[_0xba4f('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x35aa=['isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get'];(function(_0x2a6e24,_0x5ba22c){var _0x27e170=function(_0x3e00f7){while(--_0x3e00f7){_0x2a6e24['push'](_0x2a6e24['shift']());}};_0x27e170(++_0x5ba22c);}(_0x35aa,0xbe));var _0xa35a=function(_0x3c029a,_0x30fbba){_0x3c029a=_0x3c029a-0x0;var _0x619f33=_0x35aa[_0x3c029a];return _0x619f33;};'use strict';var multer=require('multer');var util=require(_0xa35a('0x0'));var path=require(_0xa35a('0x1'));var timeout=require(_0xa35a('0x2'));var express=require(_0xa35a('0x3'));var router=express['Router']();var fs_extra=require(_0xa35a('0x4'));var auth=require(_0xa35a('0x5'));var interaction=require(_0xa35a('0x6'));var config=require(_0xa35a('0x7'));var controller=require(_0xa35a('0x8'));router[_0xa35a('0x9')]('/',auth[_0xa35a('0xa')](),controller[_0xa35a('0xb')]);router['get'](_0xa35a('0xc'),auth['isAuthenticated'](),controller[_0xa35a('0xd')]);router[_0xa35a('0xe')]('/',auth[_0xa35a('0xa')](),controller[_0xa35a('0xf')]);router[_0xa35a('0x10')](_0xa35a('0xc'),auth['isAuthenticated'](),controller[_0xa35a('0x11')]);router[_0xa35a('0x12')](_0xa35a('0xc'),auth[_0xa35a('0xa')](),controller['destroy']);module[_0xa35a('0x13')]=router;
\ No newline at end of file
index 285d607..5181394 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4951=['STRING','name'];(function(_0x5ee3d3,_0x537c30){var _0x4b272f=function(_0x3dc277){while(--_0x3dc277){_0x5ee3d3['push'](_0x5ee3d3['shift']());}};_0x4b272f(++_0x537c30);}(_0x4951,0x11f));var _0x1495=function(_0x1f63e9,_0x2aa7a2){_0x1f63e9=_0x1f63e9-0x0;var _0x48ba36=_0x4951[_0x1f63e9];return _0x48ba36;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x1495('0x0'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1495('0x1')]}};
\ No newline at end of file
+var _0x9ac5=['name','STRING','sequelize'];(function(_0x4e501a,_0x19034c){var _0x2565a8=function(_0x4f7f81){while(--_0x4f7f81){_0x4e501a['push'](_0x4e501a['shift']());}};_0x2565a8(++_0x19034c);}(_0x9ac5,0xdd));var _0x59ac=function(_0x59f0ff,_0x2b9d67){_0x59f0ff=_0x59f0ff-0x0;var _0x28e782=_0x9ac5[_0x59f0ff];return _0x28e782;};'use strict';var Sequelize=require(_0x59ac('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x59ac('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x59ac('0x2')]}};
\ No newline at end of file
index d7ae1e9..71af826 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc481=['get','Variables','UserProfileResource','name','send','map','Variable','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','mustache','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','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','then','destroy'];(function(_0x4e73d2,_0x5bd74c){var _0x454711=function(_0x376d3a){while(--_0x376d3a){_0x4e73d2['push'](_0x4e73d2['shift']());}};_0x454711(++_0x5bd74c);}(_0xc481,0x7b));var _0x1c48=function(_0xadd417,_0x207028){_0xadd417=_0xadd417-0x0;var _0x5c79e7=_0xc481[_0xadd417];return _0x5c79e7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1c48('0x0'));var jsonpatch=require(_0x1c48('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1c48('0x2'));var util=require(_0x1c48('0x3'));var path=require(_0x1c48('0x4'));var sox=require(_0x1c48('0x5'));var csv=require(_0x1c48('0x6'));var ejs=require(_0x1c48('0x7'));var fs=require('fs');var fs_extra=require(_0x1c48('0x8'));var _=require(_0x1c48('0x9'));var squel=require('squel');var crypto=require(_0x1c48('0xa'));var jsforce=require(_0x1c48('0xb'));var deskjs=require(_0x1c48('0xc'));var toCsv=require(_0x1c48('0x6'));var querystring=require(_0x1c48('0xd'));var Papa=require(_0x1c48('0xe'));var Redis=require(_0x1c48('0xf'));var authService=require(_0x1c48('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1c48('0x11'));var hardwareService=require(_0x1c48('0x12'));var logger=require(_0x1c48('0x13'))(_0x1c48('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1c48('0x15'));var db=require(_0x1c48('0x16'))['db'];function respondWithStatusCode(_0x443d2b,_0x40cf8f){_0x40cf8f=_0x40cf8f||0xcc;return function(_0x4bc7ad){if(_0x4bc7ad){return _0x443d2b[_0x1c48('0x17')](_0x40cf8f);}return _0x443d2b[_0x1c48('0x18')](_0x40cf8f)[_0x1c48('0x19')]();};}function respondWithResult(_0x449fd6,_0xc58b51){_0xc58b51=_0xc58b51||0xc8;return function(_0x38e003){if(_0x38e003){return _0x449fd6['status'](_0xc58b51)[_0x1c48('0x1a')](_0x38e003);}};}function respondWithFilteredResult(_0xa5a38a,_0x386681){return function(_0x30d6b4){if(_0x30d6b4){var _0x3ddb24=typeof _0x386681['offset']==='undefined'&&typeof _0x386681['limit']===_0x1c48('0x1b');var _0x5720cd=_0x30d6b4[_0x1c48('0x1c')];var _0x23d7fa=_0x3ddb24?0x0:_0x386681[_0x1c48('0x1d')];var _0x1c0661=_0x3ddb24?_0x30d6b4[_0x1c48('0x1c')]:_0x386681[_0x1c48('0x1d')]+_0x386681[_0x1c48('0x1e')];var _0x547974;if(_0x1c0661>=_0x5720cd){_0x1c0661=_0x5720cd;_0x547974=0xc8;}else{_0x547974=0xce;}_0xa5a38a[_0x1c48('0x18')](_0x547974);return _0xa5a38a[_0x1c48('0x1f')](_0x1c48('0x20'),_0x23d7fa+'-'+_0x1c0661+'/'+_0x5720cd)['json'](_0x30d6b4);}return null;};}function patchUpdates(_0x3b624){return function(_0x5567eb){try{jsonpatch[_0x1c48('0x21')](_0x5567eb,_0x3b624,!![]);}catch(_0x2c22e2){return BPromise['reject'](_0x2c22e2);}return _0x5567eb['save']();};}function saveUpdates(_0x523348,_0x56270d){return function(_0x4061a0){if(_0x4061a0){return _0x4061a0[_0x1c48('0x22')](_0x523348)[_0x1c48('0x23')](function(_0x52dbbd){return _0x52dbbd;});}return null;};}function removeEntity(_0x254d64,_0x3191a5){return function(_0x933236){if(_0x933236){return _0x933236[_0x1c48('0x24')]()[_0x1c48('0x23')](function(){var _0x5e27a8=_0x933236[_0x1c48('0x25')]({'plain':!![]});var _0xfd23d=_0x1c48('0x26');return db[_0x1c48('0x27')][_0x1c48('0x24')]({'where':{'type':_0xfd23d,'resourceId':_0x5e27a8['id']}})[_0x1c48('0x23')](function(){return _0x933236;});})['then'](function(){_0x254d64[_0x1c48('0x18')](0xcc)[_0x1c48('0x19')]();});}};}function handleEntityNotFound(_0x57ab49,_0x4e5b08){return function(_0x222913){if(!_0x222913){_0x57ab49[_0x1c48('0x17')](0x194);}return _0x222913;};}function handleError(_0x48fbf4,_0x19830c){_0x19830c=_0x19830c||0x1f4;return function(_0x4ac1ec){logger['error'](_0x4ac1ec['stack']);if(_0x4ac1ec[_0x1c48('0x28')]){delete _0x4ac1ec['name'];}_0x48fbf4[_0x1c48('0x18')](_0x19830c)[_0x1c48('0x29')](_0x4ac1ec);};}exports['index']=function(_0x56aa4e,_0xec69d3){var _0x50d3b9={},_0x22fa8e={},_0x122e9f={'count':0x0,'rows':[]};var _0x2f6cb7=_[_0x1c48('0x2a')](db[_0x1c48('0x2b')][_0x1c48('0x2c')],function(_0x3513ce){return{'name':_0x3513ce[_0x1c48('0x2d')],'type':_0x3513ce['type']['key']};});_0x22fa8e[_0x1c48('0x2e')]=_[_0x1c48('0x2a')](_0x2f6cb7,'name');_0x22fa8e['query']=_[_0x1c48('0x2f')](_0x56aa4e[_0x1c48('0x30')]);_0x22fa8e[_0x1c48('0x31')]=_[_0x1c48('0x32')](_0x22fa8e['model'],_0x22fa8e[_0x1c48('0x30')]);_0x50d3b9['attributes']=_['intersection'](_0x22fa8e[_0x1c48('0x2e')],qs[_0x1c48('0x33')](_0x56aa4e[_0x1c48('0x30')][_0x1c48('0x33')]));_0x50d3b9['attributes']=_0x50d3b9[_0x1c48('0x34')][_0x1c48('0x35')]?_0x50d3b9['attributes']:_0x22fa8e['model'];if(!_0x56aa4e['query'][_0x1c48('0x36')]('nolimit')){_0x50d3b9[_0x1c48('0x1e')]=qs[_0x1c48('0x1e')](_0x56aa4e['query']['limit']);_0x50d3b9[_0x1c48('0x1d')]=qs['offset'](_0x56aa4e[_0x1c48('0x30')][_0x1c48('0x1d')]);}_0x50d3b9['order']=qs[_0x1c48('0x37')](_0x56aa4e[_0x1c48('0x30')][_0x1c48('0x37')]);_0x50d3b9[_0x1c48('0x38')]=qs[_0x1c48('0x31')](_['pick'](_0x56aa4e['query'],_0x22fa8e[_0x1c48('0x31')]),_0x2f6cb7);if(_0x56aa4e[_0x1c48('0x30')][_0x1c48('0x39')]){_0x50d3b9[_0x1c48('0x38')]=_['merge'](_0x50d3b9[_0x1c48('0x38')],{'$or':_[_0x1c48('0x2a')](_0x2f6cb7,function(_0x31902b){if(_0x31902b[_0x1c48('0x3a')]!==_0x1c48('0x3b')){var _0x386b57={};_0x386b57[_0x31902b[_0x1c48('0x28')]]={'$like':'%'+_0x56aa4e[_0x1c48('0x30')][_0x1c48('0x39')]+'%'};return _0x386b57;}})});}_0x50d3b9=_[_0x1c48('0x3c')]({},_0x50d3b9,_0x56aa4e[_0x1c48('0x3d')]);var _0xaadab1={'where':_0x50d3b9[_0x1c48('0x38')]};return db[_0x1c48('0x2b')][_0x1c48('0x1c')](_0xaadab1)[_0x1c48('0x23')](function(_0x241acf){_0x122e9f['count']=_0x241acf;if(_0x56aa4e[_0x1c48('0x30')][_0x1c48('0x3e')]){_0x50d3b9['include']=[{'all':!![]}];}return db[_0x1c48('0x2b')][_0x1c48('0x3f')](_0x50d3b9);})['then'](function(_0x5f4c5b){_0x122e9f[_0x1c48('0x40')]=_0x5f4c5b;return _0x122e9f;})[_0x1c48('0x23')](respondWithFilteredResult(_0xec69d3,_0x50d3b9))[_0x1c48('0x41')](handleError(_0xec69d3,null));};exports[_0x1c48('0x42')]=function(_0x2db25c,_0x12609c){var _0x4a41c6={'raw':!![],'where':{'id':_0x2db25c[_0x1c48('0x43')]['id']}},_0x10abcd={};_0x10abcd[_0x1c48('0x2e')]=_[_0x1c48('0x2f')](db['Variable'][_0x1c48('0x2c')]);_0x10abcd[_0x1c48('0x30')]=_['keys'](_0x2db25c['query']);_0x10abcd[_0x1c48('0x31')]=_[_0x1c48('0x32')](_0x10abcd[_0x1c48('0x2e')],_0x10abcd['query']);_0x4a41c6[_0x1c48('0x34')]=_['intersection'](_0x10abcd[_0x1c48('0x2e')],qs[_0x1c48('0x33')](_0x2db25c[_0x1c48('0x30')][_0x1c48('0x33')]));_0x4a41c6[_0x1c48('0x34')]=_0x4a41c6[_0x1c48('0x34')][_0x1c48('0x35')]?_0x4a41c6['attributes']:_0x10abcd['model'];if(_0x2db25c[_0x1c48('0x30')][_0x1c48('0x3e')]){_0x4a41c6[_0x1c48('0x44')]=[{'all':!![]}];}_0x4a41c6=_[_0x1c48('0x3c')]({},_0x4a41c6,_0x2db25c['options']);return db['Variable']['find'](_0x4a41c6)['then'](handleEntityNotFound(_0x12609c,null))[_0x1c48('0x23')](respondWithResult(_0x12609c,null))['catch'](handleError(_0x12609c,null));};exports['create']=function(_0x4f7834,_0x17d5bf){return db[_0x1c48('0x2b')]['create'](_0x4f7834[_0x1c48('0x45')],{})[_0x1c48('0x23')](function(_0x48af60){var _0x22d3f2=_0x4f7834[_0x1c48('0x46')][_0x1c48('0x25')]({'plain':!![]});if(!_0x22d3f2)throw new Error(_0x1c48('0x47'));if(_0x22d3f2[_0x1c48('0x48')]===_0x1c48('0x46')){var _0x4756f6=_0x48af60['get']({'plain':!![]});var _0x84853c=_0x1c48('0x26');return db[_0x1c48('0x49')][_0x1c48('0x4a')]({'where':{'name':_0x84853c,'userProfileId':_0x22d3f2[_0x1c48('0x4b')]},'raw':!![]})[_0x1c48('0x23')](function(_0x24f7e2){if(_0x24f7e2&&_0x24f7e2[_0x1c48('0x4c')]===0x0){return db[_0x1c48('0x27')][_0x1c48('0x4d')]({'name':_0x4756f6[_0x1c48('0x28')],'resourceId':_0x4756f6['id'],'type':_0x24f7e2['name'],'sectionId':_0x24f7e2['id']},{})[_0x1c48('0x23')](function(){return _0x48af60;});}else{return _0x48af60;}})[_0x1c48('0x41')](function(_0x3877b0){logger[_0x1c48('0x4e')](_0x1c48('0x4f'),_0x3877b0);throw _0x3877b0;});}return _0x48af60;})['then'](respondWithResult(_0x17d5bf,0xc9))['catch'](handleError(_0x17d5bf,null));};exports[_0x1c48('0x22')]=function(_0x5cb9b0,_0x5dd91e){if(_0x5cb9b0[_0x1c48('0x45')]['id']){delete _0x5cb9b0[_0x1c48('0x45')]['id'];}return db[_0x1c48('0x2b')][_0x1c48('0x4a')]({'where':{'id':_0x5cb9b0[_0x1c48('0x43')]['id']}})[_0x1c48('0x23')](handleEntityNotFound(_0x5dd91e,null))[_0x1c48('0x23')](saveUpdates(_0x5cb9b0[_0x1c48('0x45')],null))['then'](respondWithResult(_0x5dd91e,null))[_0x1c48('0x41')](handleError(_0x5dd91e,null));};exports[_0x1c48('0x24')]=function(_0x3cc230,_0x3a9987){return db[_0x1c48('0x2b')]['find']({'where':{'id':_0x3cc230[_0x1c48('0x43')]['id']}})['then'](handleEntityNotFound(_0x3a9987,null))[_0x1c48('0x23')](removeEntity(_0x3a9987,null))['catch'](handleError(_0x3a9987,null));};
\ No newline at end of file
+var _0xaef1=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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/environment','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','Variables','UserProfileResource','sendStatus','error','name','send','index','map','Variable','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','eml-format','rimraf'];(function(_0x277fa3,_0x3b2dde){var _0x2e4520=function(_0x209eab){while(--_0x209eab){_0x277fa3['push'](_0x277fa3['shift']());}};_0x2e4520(++_0x3b2dde);}(_0xaef1,0x14e));var _0x1aef=function(_0x54aa77,_0x7ba567){_0x54aa77=_0x54aa77-0x0;var _0x469109=_0xaef1[_0x54aa77];return _0x469109;};'use strict';var emlformat=require(_0x1aef('0x0'));var rimraf=require(_0x1aef('0x1'));var zipdir=require(_0x1aef('0x2'));var jsonpatch=require(_0x1aef('0x3'));var rp=require(_0x1aef('0x4'));var moment=require(_0x1aef('0x5'));var BPromise=require(_0x1aef('0x6'));var Mustache=require(_0x1aef('0x7'));var util=require('util');var path=require(_0x1aef('0x8'));var sox=require(_0x1aef('0x9'));var csv=require(_0x1aef('0xa'));var ejs=require(_0x1aef('0xb'));var fs=require('fs');var fs_extra=require(_0x1aef('0xc'));var _=require(_0x1aef('0xd'));var squel=require('squel');var crypto=require(_0x1aef('0xe'));var jsforce=require(_0x1aef('0xf'));var deskjs=require(_0x1aef('0x10'));var toCsv=require(_0x1aef('0xa'));var querystring=require(_0x1aef('0x11'));var Papa=require(_0x1aef('0x12'));var Redis=require(_0x1aef('0x13'));var authService=require(_0x1aef('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x1aef('0x15'));var hardwareService=require(_0x1aef('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x1aef('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1853c2,_0x2b16cd){_0x2b16cd=_0x2b16cd||0xcc;return function(_0x168adf){if(_0x168adf){return _0x1853c2['sendStatus'](_0x2b16cd);}return _0x1853c2[_0x1aef('0x18')](_0x2b16cd)[_0x1aef('0x19')]();};}function respondWithResult(_0x33705f,_0x17575a){_0x17575a=_0x17575a||0xc8;return function(_0x3c752d){if(_0x3c752d){return _0x33705f[_0x1aef('0x18')](_0x17575a)[_0x1aef('0x1a')](_0x3c752d);}};}function respondWithFilteredResult(_0xe2360a,_0x28f058){return function(_0x1bba38){if(_0x1bba38){var _0x3807c3=typeof _0x28f058[_0x1aef('0x1b')]===_0x1aef('0x1c')&&typeof _0x28f058[_0x1aef('0x1d')]===_0x1aef('0x1c');var _0x55c7cd=_0x1bba38[_0x1aef('0x1e')];var _0x3fd914=_0x3807c3?0x0:_0x28f058['offset'];var _0x2bab4d=_0x3807c3?_0x1bba38[_0x1aef('0x1e')]:_0x28f058['offset']+_0x28f058['limit'];var _0x4cdfbc;if(_0x2bab4d>=_0x55c7cd){_0x2bab4d=_0x55c7cd;_0x4cdfbc=0xc8;}else{_0x4cdfbc=0xce;}_0xe2360a[_0x1aef('0x18')](_0x4cdfbc);return _0xe2360a['set'](_0x1aef('0x1f'),_0x3fd914+'-'+_0x2bab4d+'/'+_0x55c7cd)[_0x1aef('0x1a')](_0x1bba38);}return null;};}function patchUpdates(_0x53afde){return function(_0x393d9b){try{jsonpatch[_0x1aef('0x20')](_0x393d9b,_0x53afde,!![]);}catch(_0x17e74f){return BPromise[_0x1aef('0x21')](_0x17e74f);}return _0x393d9b['save']();};}function saveUpdates(_0x3ef8e2,_0x50cd1f){return function(_0xb0b645){if(_0xb0b645){return _0xb0b645['update'](_0x3ef8e2)[_0x1aef('0x22')](function(_0xeef3a7){return _0xeef3a7;});}return null;};}function removeEntity(_0x551daa,_0x331e3b){return function(_0x442a4f){if(_0x442a4f){return _0x442a4f[_0x1aef('0x23')]()['then'](function(){var _0x1b2c98=_0x442a4f['get']({'plain':!![]});var _0x2e9e43=_0x1aef('0x24');return db[_0x1aef('0x25')][_0x1aef('0x23')]({'where':{'type':_0x2e9e43,'resourceId':_0x1b2c98['id']}})[_0x1aef('0x22')](function(){return _0x442a4f;});})['then'](function(){_0x551daa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21421e,_0x3157e3){return function(_0x317ffb){if(!_0x317ffb){_0x21421e[_0x1aef('0x26')](0x194);}return _0x317ffb;};}function handleError(_0x4a05f0,_0x48c90e){_0x48c90e=_0x48c90e||0x1f4;return function(_0x1b06bb){logger[_0x1aef('0x27')](_0x1b06bb['stack']);if(_0x1b06bb['name']){delete _0x1b06bb[_0x1aef('0x28')];}_0x4a05f0[_0x1aef('0x18')](_0x48c90e)[_0x1aef('0x29')](_0x1b06bb);};}exports[_0x1aef('0x2a')]=function(_0x52a77c,_0x3d2e36){var _0xdea57b={},_0x56b5a4={},_0x942bd0={'count':0x0,'rows':[]};var _0x1c445e=_[_0x1aef('0x2b')](db[_0x1aef('0x2c')][_0x1aef('0x2d')],function(_0x323794){return{'name':_0x323794[_0x1aef('0x2e')],'type':_0x323794[_0x1aef('0x2f')]['key']};});_0x56b5a4[_0x1aef('0x30')]=_[_0x1aef('0x2b')](_0x1c445e,_0x1aef('0x28'));_0x56b5a4[_0x1aef('0x31')]=_['keys'](_0x52a77c[_0x1aef('0x31')]);_0x56b5a4[_0x1aef('0x32')]=_[_0x1aef('0x33')](_0x56b5a4[_0x1aef('0x30')],_0x56b5a4[_0x1aef('0x31')]);_0xdea57b['attributes']=_[_0x1aef('0x33')](_0x56b5a4[_0x1aef('0x30')],qs[_0x1aef('0x34')](_0x52a77c[_0x1aef('0x31')][_0x1aef('0x34')]));_0xdea57b[_0x1aef('0x35')]=_0xdea57b[_0x1aef('0x35')][_0x1aef('0x36')]?_0xdea57b[_0x1aef('0x35')]:_0x56b5a4['model'];if(!_0x52a77c[_0x1aef('0x31')][_0x1aef('0x37')](_0x1aef('0x38'))){_0xdea57b[_0x1aef('0x1d')]=qs['limit'](_0x52a77c['query'][_0x1aef('0x1d')]);_0xdea57b[_0x1aef('0x1b')]=qs['offset'](_0x52a77c[_0x1aef('0x31')]['offset']);}_0xdea57b[_0x1aef('0x39')]=qs[_0x1aef('0x3a')](_0x52a77c[_0x1aef('0x31')][_0x1aef('0x3a')]);_0xdea57b[_0x1aef('0x3b')]=qs[_0x1aef('0x32')](_[_0x1aef('0x3c')](_0x52a77c['query'],_0x56b5a4[_0x1aef('0x32')]),_0x1c445e);if(_0x52a77c[_0x1aef('0x31')][_0x1aef('0x3d')]){_0xdea57b[_0x1aef('0x3b')]=_[_0x1aef('0x3e')](_0xdea57b[_0x1aef('0x3b')],{'$or':_[_0x1aef('0x2b')](_0x1c445e,function(_0x445d72){if(_0x445d72[_0x1aef('0x2f')]!==_0x1aef('0x3f')){var _0x2d906c={};_0x2d906c[_0x445d72[_0x1aef('0x28')]]={'$like':'%'+_0x52a77c[_0x1aef('0x31')]['filter']+'%'};return _0x2d906c;}})});}_0xdea57b=_[_0x1aef('0x3e')]({},_0xdea57b,_0x52a77c[_0x1aef('0x40')]);var _0x2e1cb9={'where':_0xdea57b[_0x1aef('0x3b')]};return db[_0x1aef('0x2c')][_0x1aef('0x1e')](_0x2e1cb9)['then'](function(_0x4f04be){_0x942bd0[_0x1aef('0x1e')]=_0x4f04be;if(_0x52a77c[_0x1aef('0x31')]['includeAll']){_0xdea57b[_0x1aef('0x41')]=[{'all':!![]}];}return db[_0x1aef('0x2c')][_0x1aef('0x42')](_0xdea57b);})[_0x1aef('0x22')](function(_0x476e90){_0x942bd0[_0x1aef('0x43')]=_0x476e90;return _0x942bd0;})[_0x1aef('0x22')](respondWithFilteredResult(_0x3d2e36,_0xdea57b))[_0x1aef('0x44')](handleError(_0x3d2e36,null));};exports[_0x1aef('0x45')]=function(_0x26999c,_0x311533){var _0x357a5d={'raw':!![],'where':{'id':_0x26999c[_0x1aef('0x46')]['id']}},_0x2e7eb9={};_0x2e7eb9[_0x1aef('0x30')]=_[_0x1aef('0x47')](db[_0x1aef('0x2c')][_0x1aef('0x2d')]);_0x2e7eb9[_0x1aef('0x31')]=_['keys'](_0x26999c[_0x1aef('0x31')]);_0x2e7eb9['filters']=_[_0x1aef('0x33')](_0x2e7eb9[_0x1aef('0x30')],_0x2e7eb9[_0x1aef('0x31')]);_0x357a5d[_0x1aef('0x35')]=_[_0x1aef('0x33')](_0x2e7eb9[_0x1aef('0x30')],qs[_0x1aef('0x34')](_0x26999c['query'][_0x1aef('0x34')]));_0x357a5d[_0x1aef('0x35')]=_0x357a5d['attributes']['length']?_0x357a5d[_0x1aef('0x35')]:_0x2e7eb9[_0x1aef('0x30')];if(_0x26999c[_0x1aef('0x31')][_0x1aef('0x48')]){_0x357a5d[_0x1aef('0x41')]=[{'all':!![]}];}_0x357a5d=_[_0x1aef('0x3e')]({},_0x357a5d,_0x26999c[_0x1aef('0x40')]);return db['Variable']['find'](_0x357a5d)[_0x1aef('0x22')](handleEntityNotFound(_0x311533,null))[_0x1aef('0x22')](respondWithResult(_0x311533,null))[_0x1aef('0x44')](handleError(_0x311533,null));};exports[_0x1aef('0x49')]=function(_0x37ea03,_0x51c4b5){return db['Variable'][_0x1aef('0x49')](_0x37ea03[_0x1aef('0x4a')],{})[_0x1aef('0x22')](function(_0x16e908){var _0x25b5e0=_0x37ea03[_0x1aef('0x4b')][_0x1aef('0x4c')]({'plain':!![]});if(!_0x25b5e0)throw new Error(_0x1aef('0x4d'));if(_0x25b5e0[_0x1aef('0x4e')]===_0x1aef('0x4b')){var _0x3ae27a=_0x16e908[_0x1aef('0x4c')]({'plain':!![]});var _0x4f9c5a=_0x1aef('0x24');return db['UserProfileSection']['find']({'where':{'name':_0x4f9c5a,'userProfileId':_0x25b5e0[_0x1aef('0x4f')]},'raw':!![]})['then'](function(_0x5b05d3){if(_0x5b05d3&&_0x5b05d3[_0x1aef('0x50')]===0x0){return db[_0x1aef('0x25')]['create']({'name':_0x3ae27a[_0x1aef('0x28')],'resourceId':_0x3ae27a['id'],'type':_0x5b05d3['name'],'sectionId':_0x5b05d3['id']},{})['then'](function(){return _0x16e908;});}else{return _0x16e908;}})['catch'](function(_0x50c9e4){logger['error'](_0x1aef('0x51'),_0x50c9e4);throw _0x50c9e4;});}return _0x16e908;})[_0x1aef('0x22')](respondWithResult(_0x51c4b5,0xc9))[_0x1aef('0x44')](handleError(_0x51c4b5,null));};exports[_0x1aef('0x52')]=function(_0x585b60,_0x5207ca){if(_0x585b60[_0x1aef('0x4a')]['id']){delete _0x585b60[_0x1aef('0x4a')]['id'];}return db[_0x1aef('0x2c')][_0x1aef('0x53')]({'where':{'id':_0x585b60['params']['id']}})[_0x1aef('0x22')](handleEntityNotFound(_0x5207ca,null))[_0x1aef('0x22')](saveUpdates(_0x585b60[_0x1aef('0x4a')],null))[_0x1aef('0x22')](respondWithResult(_0x5207ca,null))[_0x1aef('0x44')](handleError(_0x5207ca,null));};exports[_0x1aef('0x23')]=function(_0x5151c0,_0x33a73b){return db[_0x1aef('0x2c')][_0x1aef('0x53')]({'where':{'id':_0x5151c0[_0x1aef('0x46')]['id']}})['then'](handleEntityNotFound(_0x33a73b,null))[_0x1aef('0x22')](removeEntity(_0x33a73b,null))[_0x1aef('0x44')](handleError(_0x33a73b,null));};
\ No newline at end of file
index 83ab33f..4f968ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f77=['bluebird','path','rimraf','../../config/environment','./variable.attributes','exports','define','tools_variables','lodash','api','moment'];(function(_0x52cc00,_0x38520b){var _0x23cbad=function(_0x34affd){while(--_0x34affd){_0x52cc00['push'](_0x52cc00['shift']());}};_0x23cbad(++_0x38520b);}(_0x8f77,0x131));var _0x78f7=function(_0x417cdb,_0xfcc7a9){_0x417cdb=_0x417cdb-0x0;var _0x545d67=_0x8f77[_0x417cdb];return _0x545d67;};'use strict';var _=require(_0x78f7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x78f7('0x1'));var moment=require(_0x78f7('0x2'));var BPromise=require(_0x78f7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x78f7('0x4'));var rimraf=require(_0x78f7('0x5'));var config=require(_0x78f7('0x6'));var attributes=require(_0x78f7('0x7'));module[_0x78f7('0x8')]=function(_0x883647,_0x2f2b6f){return _0x883647[_0x78f7('0x9')]('Variable',attributes,{'tableName':_0x78f7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x690e=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','lodash'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x690e,0x195));var _0xe690=function(_0x4c4a85,_0x517102){_0x4c4a85=_0x4c4a85-0x0;var _0x2651b3=_0x690e[_0x4c4a85];return _0x2651b3;};'use strict';var _=require(_0xe690('0x0'));var util=require(_0xe690('0x1'));var logger=require(_0xe690('0x2'))(_0xe690('0x3'));var moment=require(_0xe690('0x4'));var BPromise=require(_0xe690('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe690('0x6'));var rimraf=require(_0xe690('0x7'));var config=require(_0xe690('0x8'));var attributes=require(_0xe690('0x9'));module[_0xe690('0xa')]=function(_0x4e555d,_0x5cafac){return _0x4e555d[_0xe690('0xb')](_0xe690('0xc'),attributes,{'tableName':_0xe690('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 211f43d..24fbb10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb9=['include','map','model','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowVariable','Variable','options','attributes'];(function(_0x16954c,_0x2f3051){var _0x93e220=function(_0x539dd1){while(--_0x539dd1){_0x16954c['push'](_0x16954c['shift']());}};_0x93e220(++_0x2f3051);}(_0x1cb9,0x14e));var _0x91cb=function(_0x794bb9,_0x9974cc){_0x794bb9=_0x794bb9-0x0;var _0x27dee3=_0x1cb9[_0x794bb9];return _0x27dee3;};'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')]('Variable,\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);});});}exports[_0x91cb('0x16')]=function(_0x1cd34b){var _0xcd1a78=this;return new Promise(function(_0x5cc1c3,_0x3fba4f){return db[_0x91cb('0x17')]['find']({'raw':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')]['where']||null:null,'attributes':_0x1cd34b['options']?_0x1cd34b['options'][_0x91cb('0x19')]||null:null,'include':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')]?_['map'](_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')],function(_0x1fa837){return{'model':db[_0x1fa837['model']],'as':_0x1fa837['as'],'attributes':_0x1fa837[_0x91cb('0x19')],'include':_0x1fa837[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x1fa837[_0x91cb('0x1a')],function(_0x3ca500){return{'model':db[_0x3ca500[_0x91cb('0x1c')]],'as':_0x3ca500['as'],'attributes':_0x3ca500[_0x91cb('0x19')],'include':_0x3ca500[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x3ca500['include'],function(_0x59bf3a){return{'model':db[_0x59bf3a[_0x91cb('0x1c')]],'as':_0x59bf3a['as'],'attributes':_0x59bf3a['attributes']};}):[]};}):[]};}):[]:[]})[_0x91cb('0x1d')](function(_0x34d372){logger[_0x91cb('0xc')]('ShowVariable',_0x1cd34b);logger[_0x91cb('0xf')]('ShowVariable',_0x1cd34b,JSON[_0x91cb('0x11')](_0x34d372));_0x5cc1c3(_0x34d372);})[_0x91cb('0x15')](function(_0x3b3ee6){logger[_0x91cb('0x12')](_0x91cb('0x16'),_0x3b3ee6['message'],_0x1cd34b);_0x3fba4f(_0xcd1a78[_0x91cb('0x12')](0x1f4,_0x3b3ee6['message']));});});};
\ No newline at end of file
+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(_0x50aca8,_0x2cfd21){var _0x28e8f6=function(_0x1157ce){while(--_0x1157ce){_0x50aca8['push'](_0x50aca8['shift']());}};_0x28e8f6(++_0x2cfd21);}(_0x55ca,0x126));var _0xa55c=function(_0x431ff8,_0x4085dd){_0x431ff8=_0x431ff8-0x0;var _0x84ccd4=_0x55ca[_0x431ff8];return _0x84ccd4;};'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
index db22f1e..2ab60ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa031=['./version.controller','get','/fetch','isAuthenticated','canUpdate','fetch','pull','/restart','migrations','exports','express','Router','../../components/auth/service'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xa031,0x72));var _0x1a03=function(_0x5151be,_0x49f676){_0x5151be=_0x5151be-0x0;var _0x219a6b=_0xa031[_0x5151be];return _0x219a6b;};'use strict';var express=require(_0x1a03('0x0'));var router=express[_0x1a03('0x1')]();var auth=require(_0x1a03('0x2'));var controller=require(_0x1a03('0x3'));router[_0x1a03('0x4')]('/',controller['index']);router[_0x1a03('0x4')](_0x1a03('0x5'),auth[_0x1a03('0x6')](),auth[_0x1a03('0x7')](),controller[_0x1a03('0x8')]);router[_0x1a03('0x4')]('/reset',auth[_0x1a03('0x6')](),auth[_0x1a03('0x7')](),controller['reset']);router[_0x1a03('0x4')]('/pull',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x1a03('0x9')]);router[_0x1a03('0x4')](_0x1a03('0xa'),auth[_0x1a03('0x6')](),controller['restart']);router[_0x1a03('0x4')]('/migrations',controller[_0x1a03('0xb')]);module[_0x1a03('0xc')]=router;
\ No newline at end of file
+var _0x0394=['exports','express','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','reset','/pull','/restart','restart','/migrations','migrations'];(function(_0x1be486,_0x37328b){var _0xce11eb=function(_0x500495){while(--_0x500495){_0x1be486['push'](_0x1be486['shift']());}};_0xce11eb(++_0x37328b);}(_0x0394,0x1c1));var _0x4039=function(_0x45b2c8,_0x598707){_0x45b2c8=_0x45b2c8-0x0;var _0x5ed4dc=_0x0394[_0x45b2c8];return _0x5ed4dc;};'use strict';var express=require(_0x4039('0x0'));var router=express['Router']();var auth=require(_0x4039('0x1'));var controller=require(_0x4039('0x2'));router[_0x4039('0x3')]('/',controller[_0x4039('0x4')]);router[_0x4039('0x3')](_0x4039('0x5'),auth[_0x4039('0x6')](),auth[_0x4039('0x7')](),controller[_0x4039('0x8')]);router[_0x4039('0x3')]('/reset',auth[_0x4039('0x6')](),auth['canUpdate'](),controller[_0x4039('0x9')]);router[_0x4039('0x3')](_0x4039('0xa'),auth[_0x4039('0x6')](),auth['canUpdate'](),controller['pull']);router[_0x4039('0x3')](_0x4039('0xb'),auth[_0x4039('0x6')](),controller[_0x4039('0xc')]);router[_0x4039('0x3')](_0x4039('0xd'),controller[_0x4039('0xe')]);module[_0x4039('0xf')]=router;
\ No newline at end of file
index 5cd8624..c6dd5e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b57=['then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','.js','push','length','sequelize','Migration','constructor','join','map','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/pm2','simple-git','root','index','exports','query','fetch','tags','latest','2.0.0','status','json','origin','master','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','error','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2'];(function(_0x602ca8,_0x568e82){var _0x26e8ab=function(_0x3fb700){while(--_0x3fb700){_0x602ca8['push'](_0x602ca8['shift']());}};_0x26e8ab(++_0x568e82);}(_0x0b57,0x10f));var _0x70b5=function(_0x221230,_0x5ed5cc){_0x221230=_0x221230-0x0;var _0xbdf131=_0x0b57[_0x221230];return _0xbdf131;};'use strict';var Umzug=require(_0x70b5('0x0'));var path=require(_0x70b5('0x1'));var fs=require('fs');var _=require(_0x70b5('0x2'));var pkginfo=require(_0x70b5('0x3'))(module,_0x70b5('0x4'));var compareVersions=require(_0x70b5('0x5'));var exec=require(_0x70b5('0x6'))[_0x70b5('0x7')];var db=require(_0x70b5('0x8'))['db'];var config=require('../../config/environment');var pm2=require(_0x70b5('0x9'));var logger=require('../../config/logger')('update');var git=require(_0x70b5('0xa'))(config[_0x70b5('0xb')]);exports[_0x70b5('0xc')]=function(_0x11f3c1,_0x1367d5){var _0x26376f={'current':module[_0x70b5('0xd')][_0x70b5('0x4')],'phonebar':0x2};if(_0x11f3c1[_0x70b5('0xe')]&&_0x11f3c1[_0x70b5('0xe')]['latest']){return git[_0x70b5('0xf')]()[_0x70b5('0x10')](function(_0x583109,_0x21ee04){_0x26376f[_0x70b5('0x11')]=(_0x583109?module['exports'][_0x70b5('0x4')]:_0x21ee04[_0x70b5('0x11')])||_0x70b5('0x12');return _0x1367d5[_0x70b5('0x13')](0xc8)[_0x70b5('0x14')](_0x26376f);});}else{return _0x1367d5[_0x70b5('0x13')](0xc8)['json'](_0x26376f);}};exports[_0x70b5('0xf')]=function(_0x3628ac,_0x3bf7f0){return git[_0x70b5('0xf')]([_0x70b5('0x15'),_0x70b5('0x16')],function(_0x52c3a4){if(_0x52c3a4){logger['error'](_0x52c3a4);return _0x3bf7f0['status'](0x1f4)[_0x70b5('0x14')](_0x52c3a4);}logger['info']('git\x20fetch');return _0x3bf7f0[_0x70b5('0x13')](0xc8)[_0x70b5('0x14')]({'output':_0x70b5('0x17')});});};exports[_0x70b5('0x18')]=function(_0x3771bd,_0x2ad781){return git[_0x70b5('0x18')]([_0x70b5('0x19'),_0x70b5('0x1a')],function(_0x38b245){if(_0x38b245){logger[_0x70b5('0x1b')](_0x38b245);return _0x2ad781['status'](0x1f4)[_0x70b5('0x14')](_0x38b245);}logger[_0x70b5('0x1c')](_0x70b5('0x1d'));return _0x2ad781[_0x70b5('0x13')](0xc8)[_0x70b5('0x14')]({'output':_0x70b5('0x1e')});});};exports[_0x70b5('0x1f')]=function(_0x3beea0,_0x5a351f){exec(_0x70b5('0x20'),function(_0x46a77b,_0x3185f2,_0x45a346){logger[_0x70b5('0x1c')](_0x3185f2);logger[_0x70b5('0x1c')](_0x45a346);if(_0x46a77b){logger[_0x70b5('0x1b')](_0x46a77b);return _0x5a351f['status'](0x1f4)[_0x70b5('0x14')](_0x46a77b);}return _0x5a351f[_0x70b5('0x13')](0xc8)[_0x70b5('0x14')]({'output':_0x3185f2});});};exports[_0x70b5('0x21')]=function(_0x13c137,_0xd29507){return pm2[_0x70b5('0x21')](_0x70b5('0x22'))[_0x70b5('0x23')](function(_0x4df4b2){logger[_0x70b5('0x1c')]('pm2\x20restart\x20motion\x20%s',_0x4df4b2);return _0xd29507['status'](0xc8)[_0x70b5('0x14')]({'output':_0x70b5('0x24')});})[_0x70b5('0x25')](function(_0xb0dc2){logger['error'](_0xb0dc2);return _0xd29507[_0x70b5('0x13')](0x1f4)[_0x70b5('0x14')](_0xb0dc2);});};exports[_0x70b5('0x26')]=function(_0x4a6482,_0x7685b5){var _0x1a55ce=fs['readdirSync'](path['join'](config['root'],'server','migrations'));var _0x8bf09=[];for(var _0x4155f6=0x0;_0x4155f6<_0x1a55ce['length'];_0x4155f6++){var _0x42b05e=_0x1a55ce[_0x4155f6]['replace'](_0x70b5('0x27'),'');if(compareVersions(module[_0x70b5('0xd')][_0x70b5('0x4')],_0x42b05e)===-0x1){_0x8bf09[_0x70b5('0x28')](_0x42b05e);}}if(_0x8bf09[_0x70b5('0x29')]){var _0x370ce1=_0x8bf09['sort'](compareVersions);var _0x5d92d9=new Umzug({'storage':_0x70b5('0x2a'),'storageOptions':{'model':db[_0x70b5('0x2b')],'modelName':_0x70b5('0x2b'),'columnName':_0x70b5('0x4')},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db['sequelize'][_0x70b5('0x2c')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x70b5('0x2d')](config[_0x70b5('0xb')],'server',_0x70b5('0x26')),'pattern':/\.js$/}});_0x5d92d9['up']({'migrations':_[_0x70b5('0x2e')](_0x370ce1,function(_0x43ab7e){return _0x43ab7e+_0x70b5('0x27');})})[_0x70b5('0x23')](function(){return _0x7685b5[_0x70b5('0x13')](0xc8)[_0x70b5('0x14')]({'output':_0x70b5('0x2f')+module[_0x70b5('0xd')]['version']+'\x20to\x20'+_[_0x70b5('0x30')](_0x370ce1),'migrations':_['join'](_0x370ce1)});})['catch'](function(_0x47b62b){if(_0x47b62b instanceof db[_0x70b5('0x2a')][_0x70b5('0x31')]){return _0x7685b5[_0x70b5('0x13')](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}else{return _0x7685b5[_0x70b5('0x13')](0x1f4)[_0x70b5('0x14')](_0x47b62b);}});}else{return _0x7685b5[_0x70b5('0x13')](0xc8)['json']({'output':_0x70b5('0x32')});}};
\ No newline at end of file
+var _0xc124=['exports','2.0.0','status','origin','error','json','info','git\x20fetch','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','replace','.js','length','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','server','migrations','map','Database\x20migrated\x20successfully\x20from\x20version\x20','UniqueConstraintError','umzug','path','lodash','pkginfo','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/logger','simple-git','root','index','query','latest','fetch'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xc124,0x116));var _0x4c12=function(_0x4a4f39,_0x271de4){_0x4a4f39=_0x4a4f39-0x0;var _0xce8e9b=_0xc124[_0x4a4f39];return _0xce8e9b;};'use strict';var Umzug=require(_0x4c12('0x0'));var path=require(_0x4c12('0x1'));var fs=require('fs');var _=require(_0x4c12('0x2'));var pkginfo=require(_0x4c12('0x3'))(module,_0x4c12('0x4'));var compareVersions=require(_0x4c12('0x5'));var exec=require(_0x4c12('0x6'))['exec'];var db=require(_0x4c12('0x7'))['db'];var config=require(_0x4c12('0x8'));var pm2=require('../../config/pm2');var logger=require(_0x4c12('0x9'))('update');var git=require(_0x4c12('0xa'))(config[_0x4c12('0xb')]);exports[_0x4c12('0xc')]=function(_0x415b57,_0x1d896a){var _0x3953ce={'current':module['exports'][_0x4c12('0x4')],'phonebar':0x2};if(_0x415b57[_0x4c12('0xd')]&&_0x415b57[_0x4c12('0xd')][_0x4c12('0xe')]){return git[_0x4c12('0xf')]()['tags'](function(_0x22ca3a,_0x5e6ade){_0x3953ce['latest']=(_0x22ca3a?module[_0x4c12('0x10')][_0x4c12('0x4')]:_0x5e6ade[_0x4c12('0xe')])||_0x4c12('0x11');return _0x1d896a[_0x4c12('0x12')](0xc8)['json'](_0x3953ce);});}else{return _0x1d896a[_0x4c12('0x12')](0xc8)['json'](_0x3953ce);}};exports[_0x4c12('0xf')]=function(_0x3cf1e1,_0xa41bd0){return git['fetch']([_0x4c12('0x13'),'master'],function(_0x257076){if(_0x257076){logger[_0x4c12('0x14')](_0x257076);return _0xa41bd0['status'](0x1f4)[_0x4c12('0x15')](_0x257076);}logger[_0x4c12('0x16')](_0x4c12('0x17'));return _0xa41bd0[_0x4c12('0x12')](0xc8)[_0x4c12('0x15')]({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x1059c4,_0x280ff5){return git['reset']([_0x4c12('0x18'),'FETCH_HEAD'],function(_0x5ea58c){if(_0x5ea58c){logger['error'](_0x5ea58c);return _0x280ff5['status'](0x1f4)[_0x4c12('0x15')](_0x5ea58c);}logger[_0x4c12('0x16')](_0x4c12('0x19'));return _0x280ff5['status'](0xc8)['json']({'output':'git\x20reset\x20--hard'});});};exports[_0x4c12('0x1a')]=function(_0x5622b8,_0x53504e){exec(_0x4c12('0x1b'),function(_0x315cbb,_0x448c42,_0x4902a6){logger[_0x4c12('0x16')](_0x448c42);logger[_0x4c12('0x16')](_0x4902a6);if(_0x315cbb){logger['error'](_0x315cbb);return _0x53504e['status'](0x1f4)['json'](_0x315cbb);}return _0x53504e['status'](0xc8)[_0x4c12('0x15')]({'output':_0x448c42});});};exports[_0x4c12('0x1c')]=function(_0x5b82a3,_0x48d062){return pm2['restart']('motion2')[_0x4c12('0x1d')](function(_0x48cb14){logger[_0x4c12('0x16')](_0x4c12('0x1e'),_0x48cb14);return _0x48d062[_0x4c12('0x12')](0xc8)[_0x4c12('0x15')]({'output':_0x4c12('0x1f')});})[_0x4c12('0x20')](function(_0x5f1e2d){logger['error'](_0x5f1e2d);return _0x48d062['status'](0x1f4)[_0x4c12('0x15')](_0x5f1e2d);});};exports['migrations']=function(_0x12be8c,_0x10fe6d){var _0x4bfa49=fs[_0x4c12('0x21')](path[_0x4c12('0x22')](config['root'],'server','migrations'));var _0x496a6b=[];for(var _0xa643cf=0x0;_0xa643cf<_0x4bfa49['length'];_0xa643cf++){var _0x3c8e4a=_0x4bfa49[_0xa643cf][_0x4c12('0x23')](_0x4c12('0x24'),'');if(compareVersions(module[_0x4c12('0x10')][_0x4c12('0x4')],_0x3c8e4a)===-0x1){_0x496a6b['push'](_0x3c8e4a);}}if(_0x496a6b[_0x4c12('0x25')]){var _0x294475=_0x496a6b[_0x4c12('0x26')](compareVersions);var _0x51540d=new Umzug({'storage':_0x4c12('0x27'),'storageOptions':{'model':db[_0x4c12('0x28')],'modelName':_0x4c12('0x28'),'columnName':_0x4c12('0x4')},'migrations':{'params':[db[_0x4c12('0x27')][_0x4c12('0x29')](),db['sequelize'][_0x4c12('0x2a')],function(){throw new Error(_0x4c12('0x2b'));}],'path':path[_0x4c12('0x22')](config[_0x4c12('0xb')],_0x4c12('0x2c'),_0x4c12('0x2d')),'pattern':/\.js$/}});_0x51540d['up']({'migrations':_[_0x4c12('0x2e')](_0x294475,function(_0x3008ae){return _0x3008ae+_0x4c12('0x24');})})[_0x4c12('0x1d')](function(){return _0x10fe6d[_0x4c12('0x12')](0xc8)['json']({'output':_0x4c12('0x2f')+module[_0x4c12('0x10')][_0x4c12('0x4')]+'\x20to\x20'+_['last'](_0x294475),'migrations':_['join'](_0x294475)});})[_0x4c12('0x20')](function(_0x50ab67){if(_0x50ab67 instanceof db[_0x4c12('0x27')][_0x4c12('0x30')]){return _0x10fe6d[_0x4c12('0x12')](0xc8)[_0x4c12('0x15')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x10fe6d[_0x4c12('0x12')](0x1f4)['json'](_0x50ab67);}});}else{return _0x10fe6d[_0x4c12('0x12')](0xc8)[_0x4c12('0x15')]({'output':'Database\x20already\x20up-to-date'});}};
\ No newline at end of file
index 44f5250..ebe814a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x775d=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','index','/describe','isAuthenticated','/:id','show','create','put','update','delete','exports','util'];(function(_0x2460f5,_0x5f0a9c){var _0x25a599=function(_0x4543e0){while(--_0x4543e0){_0x2460f5['push'](_0x2460f5['shift']());}};_0x25a599(++_0x5f0a9c);}(_0x775d,0x18e));var _0xd775=function(_0x18aa78,_0x2ec095){_0x18aa78=_0x18aa78-0x0;var _0xb33748=_0x775d[_0x18aa78];return _0xb33748;};'use strict';var multer=require('multer');var util=require(_0xd775('0x0'));var path=require('path');var timeout=require(_0xd775('0x1'));var express=require(_0xd775('0x2'));var router=express[_0xd775('0x3')]();var fs_extra=require(_0xd775('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd775('0x5'));var config=require(_0xd775('0x6'));var controller=require(_0xd775('0x7'));router[_0xd775('0x8')]('/',auth['isAuthenticated'](),controller[_0xd775('0x9')]);router[_0xd775('0x8')](_0xd775('0xa'),auth[_0xd775('0xb')](),controller['describe']);router[_0xd775('0x8')](_0xd775('0xc'),auth[_0xd775('0xb')](),controller[_0xd775('0xd')]);router['post']('/',auth[_0xd775('0xb')](),controller[_0xd775('0xe')]);router[_0xd775('0xf')](_0xd775('0xc'),auth[_0xd775('0xb')](),controller[_0xd775('0x10')]);router[_0xd775('0x11')](_0xd775('0xc'),auth[_0xd775('0xb')](),controller['destroy']);module[_0xd775('0x12')]=router;
\ No newline at end of file
+var _0xeb16=['/:id','show','post','create','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x1128cd,_0x3391de){var _0x3b46d8=function(_0x378fd5){while(--_0x378fd5){_0x1128cd['push'](_0x1128cd['shift']());}};_0x3b46d8(++_0x3391de);}(_0xeb16,0x102));var _0x6eb1=function(_0x3649ba,_0x959a3f){_0x3649ba=_0x3649ba-0x0;var _0x1987d5=_0xeb16[_0x3649ba];return _0x1987d5;};'use strict';var multer=require('multer');var util=require(_0x6eb1('0x0'));var path=require(_0x6eb1('0x1'));var timeout=require(_0x6eb1('0x2'));var express=require(_0x6eb1('0x3'));var router=express[_0x6eb1('0x4')]();var fs_extra=require(_0x6eb1('0x5'));var auth=require(_0x6eb1('0x6'));var interaction=require(_0x6eb1('0x7'));var config=require(_0x6eb1('0x8'));var controller=require(_0x6eb1('0x9'));router[_0x6eb1('0xa')]('/',auth[_0x6eb1('0xb')](),controller[_0x6eb1('0xc')]);router['get'](_0x6eb1('0xd'),auth['isAuthenticated'](),controller[_0x6eb1('0xe')]);router[_0x6eb1('0xa')](_0x6eb1('0xf'),auth['isAuthenticated'](),controller[_0x6eb1('0x10')]);router[_0x6eb1('0x11')]('/',auth[_0x6eb1('0xb')](),controller[_0x6eb1('0x12')]);router['put'](_0x6eb1('0xf'),auth[_0x6eb1('0xb')](),controller['update']);router['delete']('/:id',auth[_0x6eb1('0xb')](),controller[_0x6eb1('0x13')]);module[_0x6eb1('0x14')]=router;
\ No newline at end of file
index 40b548e..08281dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4f8=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports'];(function(_0x15f60d,_0x48f472){var _0x1e5a46=function(_0x1d63f7){while(--_0x1d63f7){_0x15f60d['push'](_0x15f60d['shift']());}};_0x1e5a46(++_0x48f472);}(_0xb4f8,0x83));var _0x8b4f=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xb4f8[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require('sequelize');module[_0x8b4f('0x0')]={'type':{'type':Sequelize[_0x8b4f('0x1')]},'uniqueid':{'type':Sequelize[_0x8b4f('0x1')]},'calleridnum':{'type':Sequelize[_0x8b4f('0x1')]},'calleridname':{'type':Sequelize[_0x8b4f('0x1')]},'queue':{'type':Sequelize[_0x8b4f('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x8b4f('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x8b4f('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x8b4f('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x8b4f('0x2')]},'agentdumpAt':{'type':Sequelize[_0x8b4f('0x2')]},'holdtime':{'type':Sequelize[_0x8b4f('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x8b4f('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x8b4f('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x8b4f('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8b4f('0x3')]},'reason':{'type':Sequelize[_0x8b4f('0x1')]},'lastevent':{'type':Sequelize[_0x8b4f('0x1')]},'channel':{'type':Sequelize[_0x8b4f('0x1')]},'channelstate':{'type':Sequelize[_0x8b4f('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x8b4f('0x1')]},'connectedlinename':{'type':Sequelize[_0x8b4f('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8b4f('0x1')]},'context':{'type':Sequelize[_0x8b4f('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x8b4f('0x1')]},'destchannel':{'type':Sequelize[_0x8b4f('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x8b4f('0x1')]},'destcalleridnum':{'type':Sequelize[_0x8b4f('0x1')]},'destcalleridname':{'type':Sequelize[_0x8b4f('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x8b4f('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x8b4f('0x1')]},'destaccountcode':{'type':Sequelize[_0x8b4f('0x1')]},'destcontext':{'type':Sequelize[_0x8b4f('0x1')]},'destexten':{'type':Sequelize[_0x8b4f('0x1')]},'destpriority':{'type':Sequelize[_0x8b4f('0x1')]},'destuniqueid':{'type':Sequelize[_0x8b4f('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x8b4f('0x1')]},'transfer':{'type':Sequelize[_0x8b4f('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8b4f('0x1')],'comment':_0x8b4f('0x5')},'transferexten':{'type':Sequelize[_0x8b4f('0x1')]},'transferuniqueid':{'type':Sequelize[_0x8b4f('0x1')]},'agententerreason':{'type':Sequelize[_0x8b4f('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xaebd=['STRING','DATE','INTEGER','BOOLEAN','sequelize'];(function(_0x1faae3,_0x1fe811){var _0x5187d6=function(_0x24c67b){while(--_0x24c67b){_0x1faae3['push'](_0x1faae3['shift']());}};_0x5187d6(++_0x1fe811);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x5700fa,_0xd313c1){_0x5700fa=_0x5700fa-0x0;var _0x4cd627=_0xaebd[_0x5700fa];return _0x4cd627;};'use strict';var Sequelize=require(_0xdaeb('0x0'));module['exports']={'type':{'type':Sequelize[_0xdaeb('0x1')]},'uniqueid':{'type':Sequelize[_0xdaeb('0x1')]},'calleridnum':{'type':Sequelize[_0xdaeb('0x1')]},'calleridname':{'type':Sequelize[_0xdaeb('0x1')]},'queue':{'type':Sequelize[_0xdaeb('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xdaeb('0x1')]},'agentcalledAt':{'type':Sequelize[_0xdaeb('0x2')]},'agentconnectAt':{'type':Sequelize[_0xdaeb('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xdaeb('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xdaeb('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xdaeb('0x3')]},'agentcomplete':{'type':Sequelize[_0xdaeb('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xdaeb('0x3')]},'agentacw':{'type':Sequelize[_0xdaeb('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xdaeb('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0xdaeb('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xdaeb('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xdaeb('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xdaeb('0x1')]},'accountcode':{'type':Sequelize[_0xdaeb('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xdaeb('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xdaeb('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xdaeb('0x1')]},'destcalleridnum':{'type':Sequelize[_0xdaeb('0x1')]},'destcalleridname':{'type':Sequelize[_0xdaeb('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xdaeb('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xdaeb('0x1')]},'destlanguage':{'type':Sequelize[_0xdaeb('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xdaeb('0x1')]},'destpriority':{'type':Sequelize[_0xdaeb('0x1')]},'destuniqueid':{'type':Sequelize[_0xdaeb('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xdaeb('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xdaeb('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xdaeb('0x1')]},'agententerreason':{'type':Sequelize[_0xdaeb('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index 0362982..c069219 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(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};
\ No newline at end of file
index 823b816..cbef093 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6dac=['rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x35e5ac,_0x4efdb6){var _0x2e57d0=function(_0x4cd514){while(--_0x4cd514){_0x35e5ac['push'](_0x35e5ac['shift']());}};_0x2e57d0(++_0x4efdb6);}(_0x6dac,0x16e));var _0xc6da=function(_0x142dda,_0x965f5){_0x142dda=_0x142dda-0x0;var _0x5e1c76=_0x6dac[_0x142dda];return _0x5e1c76;};'use strict';var _=require(_0xc6da('0x0'));var util=require(_0xc6da('0x1'));var logger=require(_0xc6da('0x2'))(_0xc6da('0x3'));var moment=require(_0xc6da('0x4'));var BPromise=require(_0xc6da('0x5'));var rp=require(_0xc6da('0x6'));var fs=require('fs');var path=require(_0xc6da('0x7'));var rimraf=require(_0xc6da('0x8'));var config=require(_0xc6da('0x9'));var attributes=require(_0xc6da('0xa'));module[_0xc6da('0xb')]=function(_0x325f49,_0x5caf49){return _0x325f49[_0xc6da('0xc')](_0xc6da('0xd'),attributes,{'tableName':_0xc6da('0xe'),'paranoid':![],'indexes':[{'fields':[_0xc6da('0xf'),_0xc6da('0x10')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9f7a=['uniqueid','lodash','util','../../config/logger','api','bluebird','../../config/environment','./voiceAgentReport.attributes'];(function(_0x57ed9b,_0x299e4e){var _0x58174a=function(_0x46d77e){while(--_0x46d77e){_0x57ed9b['push'](_0x57ed9b['shift']());}};_0x58174a(++_0x299e4e);}(_0x9f7a,0xf1));var _0xa9f7=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x9f7a[_0x1f9f37];return _0x21c080;};'use strict';var _=require(_0xa9f7('0x0'));var util=require(_0xa9f7('0x1'));var logger=require(_0xa9f7('0x2'))(_0xa9f7('0x3'));var moment=require('moment');var BPromise=require(_0xa9f7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa9f7('0x5'));var attributes=require(_0xa9f7('0x6'));module['exports']=function(_0x499ff6,_0xc1334d){return _0x499ff6['define']('VoiceAgentReport',attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0xa9f7('0x7'),'destuniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 076eb34..d714043 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0e7=['message','request\x20sent','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','stringify','UpdateVoiceAgentReport','update','where','attributes','limit','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','debug','error','code'];(function(_0x451f88,_0x5c061a){var _0x2cc2b7=function(_0x5bb6ce){while(--_0x5bb6ce){_0x451f88['push'](_0x451f88['shift']());}};_0x2cc2b7(++_0x5c061a);}(_0xd0e7,0x1d0));var _0x7d0e=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xd0e7[_0x1928c9];return _0x51b5fb;};'use strict';var _=require('lodash');var util=require(_0x7d0e('0x0'));var moment=require(_0x7d0e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d0e('0x2'));var db=require(_0x7d0e('0x3'))['db'];var utils=require(_0x7d0e('0x4'));var logger=require(_0x7d0e('0x5'))('rpc');var config=require(_0x7d0e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7d0e('0x7')][_0x7d0e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dea5d,_0x3265ad,_0x1677d3){return new BPromise(function(_0x35bb91,_0x1590dd){return client[_0x7d0e('0x9')](_0x3dea5d,_0x1677d3)[_0x7d0e('0xa')](function(_0x27b4c5){logger[_0x7d0e('0xb')](_0x7d0e('0xc'),_0x3265ad,'request\x20sent');logger[_0x7d0e('0xd')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x3265ad,'request\x20sent',JSON['stringify'](_0x27b4c5));if(_0x27b4c5[_0x7d0e('0xe')]){if(_0x27b4c5[_0x7d0e('0xe')][_0x7d0e('0xf')]===0x1f4){logger[_0x7d0e('0xe')](_0x7d0e('0xc'),_0x3265ad,_0x27b4c5[_0x7d0e('0xe')][_0x7d0e('0x10')]);return _0x1590dd(_0x27b4c5['error'][_0x7d0e('0x10')]);}logger[_0x7d0e('0xe')](_0x7d0e('0xc'),_0x3265ad,_0x27b4c5[_0x7d0e('0xe')][_0x7d0e('0x10')]);return _0x35bb91(_0x27b4c5[_0x7d0e('0xe')][_0x7d0e('0x10')]);}else{logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x3265ad,_0x7d0e('0x11'));_0x35bb91(_0x27b4c5[_0x7d0e('0x12')][_0x7d0e('0x10')]);}})[_0x7d0e('0x13')](function(_0x527fb7){logger['error'](_0x7d0e('0xc'),_0x3265ad,_0x527fb7);_0x1590dd(_0x527fb7);});});}exports[_0x7d0e('0x14')]=function(_0x544952){var _0x9a2da0=this;return new Promise(function(_0x5360a7,_0x550999){return db[_0x7d0e('0x15')][_0x7d0e('0x16')](_0x544952[_0x7d0e('0x17')],{'raw':_0x544952[_0x7d0e('0x18')]?_0x544952[_0x7d0e('0x18')][_0x7d0e('0x19')]===undefined?!![]:![]:!![]})[_0x7d0e('0xa')](function(_0x28b591){logger['info'](_0x7d0e('0x14'),_0x544952);logger[_0x7d0e('0xd')](_0x7d0e('0x14'),_0x544952,JSON[_0x7d0e('0x1a')](_0x28b591));_0x5360a7(_0x28b591);})['catch'](function(_0x257a91){logger[_0x7d0e('0xe')](_0x7d0e('0x14'),_0x257a91[_0x7d0e('0x10')],_0x544952);_0x550999(_0x9a2da0[_0x7d0e('0xe')](0x1f4,_0x257a91['message']));});});};exports[_0x7d0e('0x1b')]=function(_0x3939bb){var _0x4e3306=this;return new Promise(function(_0x53f1d6,_0x5cf179){return db[_0x7d0e('0x15')][_0x7d0e('0x1c')](_0x3939bb[_0x7d0e('0x17')],{'raw':_0x3939bb[_0x7d0e('0x18')]?_0x3939bb[_0x7d0e('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3939bb[_0x7d0e('0x18')]?_0x3939bb[_0x7d0e('0x18')][_0x7d0e('0x1d')]||null:null,'attributes':_0x3939bb['options']?_0x3939bb['options'][_0x7d0e('0x1e')]||null:null,'limit':_0x3939bb[_0x7d0e('0x18')]?_0x3939bb['options'][_0x7d0e('0x1f')]||null:null})[_0x7d0e('0xa')](function(_0x1ffc2a){logger[_0x7d0e('0xb')](_0x7d0e('0x1b'),_0x3939bb);logger[_0x7d0e('0xd')](_0x7d0e('0x1b'),_0x3939bb,JSON['stringify'](_0x1ffc2a));_0x53f1d6(_0x1ffc2a);})['catch'](function(_0xefee74){logger[_0x7d0e('0xe')](_0x7d0e('0x1b'),_0xefee74[_0x7d0e('0x10')],_0x3939bb);_0x5cf179(_0x4e3306[_0x7d0e('0xe')](0x1f4,_0xefee74[_0x7d0e('0x10')]));});});};
\ No newline at end of file
+var _0x74d8=['VoiceAgentReport','body','options','raw','stringify','UpdateVoiceAgentReport','update','where','attributes','limit','moment','bluebird','randomstring','../../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','error','code','message','result','catch','CreateVoiceAgentReport'];(function(_0x3317a4,_0x15ec38){var _0x174765=function(_0x187c00){while(--_0x187c00){_0x3317a4['push'](_0x3317a4['shift']());}};_0x174765(++_0x15ec38);}(_0x74d8,0xea));var _0x874d=function(_0x5e70d0,_0x55b34e){_0x5e70d0=_0x5e70d0-0x0;var _0x5c3c5a=_0x74d8[_0x5e70d0];return _0x5c3c5a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x874d('0x0'));var BPromise=require(_0x874d('0x1'));var rs=require(_0x874d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x874d('0x3'));var logger=require(_0x874d('0x4'))(_0x874d('0x5'));var config=require(_0x874d('0x6'));var jayson=require(_0x874d('0x7'));var client=jayson['client'][_0x874d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b131c,_0x4d4aa2,_0x1304e4){return new BPromise(function(_0xa1da1,_0x3064a3){return client[_0x874d('0x9')](_0x5b131c,_0x1304e4)[_0x874d('0xa')](function(_0x18d8ca){logger[_0x874d('0xb')](_0x874d('0xc'),_0x4d4aa2,_0x874d('0xd'));logger[_0x874d('0xe')](_0x874d('0xf'),_0x4d4aa2,_0x874d('0xd'),JSON['stringify'](_0x18d8ca));if(_0x18d8ca[_0x874d('0x10')]){if(_0x18d8ca['error'][_0x874d('0x11')]===0x1f4){logger[_0x874d('0x10')](_0x874d('0xc'),_0x4d4aa2,_0x18d8ca[_0x874d('0x10')][_0x874d('0x12')]);return _0x3064a3(_0x18d8ca[_0x874d('0x10')][_0x874d('0x12')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x4d4aa2,_0x18d8ca['error'][_0x874d('0x12')]);return _0xa1da1(_0x18d8ca[_0x874d('0x10')]['message']);}else{logger[_0x874d('0xb')]('VoiceAgentReport,\x20%s,\x20%s',_0x4d4aa2,_0x874d('0xd'));_0xa1da1(_0x18d8ca[_0x874d('0x13')]['message']);}})[_0x874d('0x14')](function(_0x5679f8){logger[_0x874d('0x10')](_0x874d('0xc'),_0x4d4aa2,_0x5679f8);_0x3064a3(_0x5679f8);});});}exports[_0x874d('0x15')]=function(_0x21a9b8){var _0x1e9480=this;return new Promise(function(_0x3dd406,_0x43cc11){return db[_0x874d('0x16')]['create'](_0x21a9b8[_0x874d('0x17')],{'raw':_0x21a9b8[_0x874d('0x18')]?_0x21a9b8[_0x874d('0x18')][_0x874d('0x19')]===undefined?!![]:![]:!![]})[_0x874d('0xa')](function(_0x23852a){logger[_0x874d('0xb')](_0x874d('0x15'),_0x21a9b8);logger[_0x874d('0xe')](_0x874d('0x15'),_0x21a9b8,JSON[_0x874d('0x1a')](_0x23852a));_0x3dd406(_0x23852a);})['catch'](function(_0x5d5719){logger[_0x874d('0x10')](_0x874d('0x15'),_0x5d5719['message'],_0x21a9b8);_0x43cc11(_0x1e9480['error'](0x1f4,_0x5d5719['message']));});});};exports[_0x874d('0x1b')]=function(_0x37124b){var _0x24a417=this;return new Promise(function(_0x194475,_0x49f1d2){return db['VoiceAgentReport'][_0x874d('0x1c')](_0x37124b['body'],{'raw':_0x37124b[_0x874d('0x18')]?_0x37124b['options'][_0x874d('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37124b[_0x874d('0x18')]?_0x37124b[_0x874d('0x18')][_0x874d('0x1d')]||null:null,'attributes':_0x37124b['options']?_0x37124b[_0x874d('0x18')][_0x874d('0x1e')]||null:null,'limit':_0x37124b[_0x874d('0x18')]?_0x37124b[_0x874d('0x18')][_0x874d('0x1f')]||null:null})[_0x874d('0xa')](function(_0x4a56f3){logger[_0x874d('0xb')](_0x874d('0x1b'),_0x37124b);logger[_0x874d('0xe')](_0x874d('0x1b'),_0x37124b,JSON[_0x874d('0x1a')](_0x4a56f3));_0x194475(_0x4a56f3);})[_0x874d('0x14')](function(_0xfbed4b){logger['error'](_0x874d('0x1b'),_0xfbed4b[_0x874d('0x12')],_0x37124b);_0x49f1d2(_0x24a417[_0x874d('0x10')](0x1f4,_0xfbed4b[_0x874d('0x12')]));});});};
\ No newline at end of file
index 5c29c0d..3b3aaa0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04de=['describe','get','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','/describe','isAuthenticated'];(function(_0x4fb9a8,_0x29181f){var _0x4aeeb5=function(_0xd8c5f5){while(--_0xd8c5f5){_0x4fb9a8['push'](_0x4fb9a8['shift']());}};_0x4aeeb5(++_0x29181f);}(_0x04de,0x107));var _0xe04d=function(_0x19556e,_0x43d5e4){_0x19556e=_0x19556e-0x0;var _0x2e60ac=_0x04de[_0x19556e];return _0x2e60ac;};'use strict';var multer=require(_0xe04d('0x0'));var util=require(_0xe04d('0x1'));var path=require(_0xe04d('0x2'));var timeout=require(_0xe04d('0x3'));var express=require(_0xe04d('0x4'));var router=express[_0xe04d('0x5')]();var fs_extra=require(_0xe04d('0x6'));var auth=require(_0xe04d('0x7'));var interaction=require(_0xe04d('0x8'));var config=require(_0xe04d('0x9'));var controller=require(_0xe04d('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xe04d('0xb'),auth[_0xe04d('0xc')](),controller[_0xe04d('0xd')]);router[_0xe04d('0xe')](_0xe04d('0xf'),auth[_0xe04d('0xc')](),controller[_0xe04d('0x10')]);router[_0xe04d('0x11')]('/',auth['isAuthenticated'](),controller[_0xe04d('0x12')]);router[_0xe04d('0x13')](_0xe04d('0xf'),auth[_0xe04d('0xc')](),controller[_0xe04d('0x14')]);router[_0xe04d('0x15')](_0xe04d('0xf'),auth[_0xe04d('0xc')](),controller[_0xe04d('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x4b19=['index','isAuthenticated','describe','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get'];(function(_0x39bfb6,_0x4272c8){var _0x23fef9=function(_0x5f83c1){while(--_0x5f83c1){_0x39bfb6['push'](_0x39bfb6['shift']());}};_0x23fef9(++_0x4272c8);}(_0x4b19,0x195));var _0x94b1=function(_0x25b416,_0x334742){_0x25b416=_0x25b416-0x0;var _0x449b43=_0x4b19[_0x25b416];return _0x449b43;};'use strict';var multer=require(_0x94b1('0x0'));var util=require('util');var path=require(_0x94b1('0x1'));var timeout=require(_0x94b1('0x2'));var express=require(_0x94b1('0x3'));var router=express['Router']();var fs_extra=require(_0x94b1('0x4'));var auth=require(_0x94b1('0x5'));var interaction=require(_0x94b1('0x6'));var config=require('../../config/environment');var controller=require(_0x94b1('0x7'));router[_0x94b1('0x8')]('/',auth['isAuthenticated'](),controller[_0x94b1('0x9')]);router[_0x94b1('0x8')]('/describe',auth[_0x94b1('0xa')](),controller[_0x94b1('0xb')]);router[_0x94b1('0x8')]('/:id',auth[_0x94b1('0xa')](),controller['show']);router['post']('/',auth[_0x94b1('0xa')](),controller[_0x94b1('0xc')]);router[_0x94b1('0xd')](_0x94b1('0xe'),auth[_0x94b1('0xa')](),controller[_0x94b1('0xf')]);router['delete'](_0x94b1('0xe'),auth[_0x94b1('0xa')](),controller[_0x94b1('0x10')]);module[_0x94b1('0x11')]=router;
\ No newline at end of file
index 51b4b8f..8c5596c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2906=['STRING','TEXT','DATE','INTEGER','sequelize','exports','ENUM','internal','outbound','inbound-fax','outbound-fax'];(function(_0x28ad32,_0x1d376b){var _0x685b46=function(_0x4c9850){while(--_0x4c9850){_0x28ad32['push'](_0x28ad32['shift']());}};_0x685b46(++_0x1d376b);}(_0x2906,0xe0));var _0x6290=function(_0x59a549,_0x2fe2bb){_0x59a549=_0x59a549-0x0;var _0x12adbe=_0x2906[_0x59a549];return _0x12adbe;};'use strict';var Sequelize=require(_0x6290('0x0'));module[_0x6290('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6290('0x2')]('inbound',_0x6290('0x3'),_0x6290('0x4'),_0x6290('0x5'),_0x6290('0x6'),'dialer')},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x6290('0x7')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x6290('0x7')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x6290('0x7')]},'destinationchannel':{'type':Sequelize[_0x6290('0x7')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x6290('0x8')]},'starttime':{'type':Sequelize[_0x6290('0x9')]},'systemanswertime':{'type':Sequelize[_0x6290('0x9')]},'answertime':{'type':Sequelize[_0x6290('0x9')]},'endtime':{'type':Sequelize[_0x6290('0x9')]},'duration':{'type':Sequelize[_0x6290('0xa')]},'billableseconds':{'type':Sequelize[_0x6290('0xa')]},'mohtime':{'type':Sequelize[_0x6290('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6290('0x7')]},'amaflags':{'type':Sequelize[_0x6290('0x7')]},'userfield':{'type':Sequelize[_0x6290('0x7')]},'userDisposition':{'type':Sequelize[_0x6290('0x7')]},'userSecondDisposition':{'type':Sequelize[_0x6290('0x7')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x6290('0x7')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x6290('0xa')]},'sipcallid':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xe683=['TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax'];(function(_0xa3ac78,_0x33bb8c){var _0x2afc77=function(_0x51003a){while(--_0x51003a){_0xa3ac78['push'](_0xa3ac78['shift']());}};_0x2afc77(++_0x33bb8c);}(_0xe683,0x1d7));var _0x3e68=function(_0x1ef942,_0x3ad856){_0x1ef942=_0x1ef942-0x0;var _0x8a9be=_0xe683[_0x1ef942];return _0x8a9be;};'use strict';var Sequelize=require(_0x3e68('0x0'));module[_0x3e68('0x1')]={'uniqueid':{'type':Sequelize[_0x3e68('0x2')]},'type':{'type':Sequelize[_0x3e68('0x3')](_0x3e68('0x4'),_0x3e68('0x5'),_0x3e68('0x6'),_0x3e68('0x7'),_0x3e68('0x8'),'dialer')},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x3e68('0x2')]},'source':{'type':Sequelize[_0x3e68('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x3e68('0x2')]},'callerid':{'type':Sequelize[_0x3e68('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x3e68('0x2')]},'lastdata':{'type':Sequelize[_0x3e68('0x9')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x3e68('0xa')]},'endtime':{'type':Sequelize[_0x3e68('0xa')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x3e68('0xb')]},'mohtime':{'type':Sequelize[_0x3e68('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x3e68('0x2')]},'amaflags':{'type':Sequelize[_0x3e68('0x2')]},'userfield':{'type':Sequelize[_0x3e68('0x2')]},'userDisposition':{'type':Sequelize[_0x3e68('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x3e68('0x2')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3e68('0x2')]},'prefix':{'type':Sequelize[_0x3e68('0x2')]},'routeid':{'type':Sequelize[_0x3e68('0xb')]},'sipcallid':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 34febf7..5872b58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x53c548,_0x4ca7ac){_0x53c548=_0x53c548-0x0;var _0x467309=_0x2032[_0x53c548];return _0x467309;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));};
\ No newline at end of file
+var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x5f2f,0x73));var _0xf5f2=function(_0x31c448,_0x40fb2f){_0x31c448=_0x31c448-0x0;var _0x407d2b=_0x5f2f[_0x31c448];return _0x407d2b;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));};
\ No newline at end of file
index 14bf862..4b38ad7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6828=['exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes'];(function(_0x559443,_0x4eb8b6){var _0x246c41=function(_0x2e5eb2){while(--_0x2e5eb2){_0x559443['push'](_0x559443['shift']());}};_0x246c41(++_0x4eb8b6);}(_0x6828,0xe6));var _0x8682=function(_0x46e2e9,_0x2540cf){_0x46e2e9=_0x46e2e9-0x0;var _0x53e9ed=_0x6828[_0x46e2e9];return _0x53e9ed;};'use strict';var _=require(_0x8682('0x0'));var util=require(_0x8682('0x1'));var logger=require(_0x8682('0x2'))(_0x8682('0x3'));var moment=require('moment');var BPromise=require(_0x8682('0x4'));var rp=require(_0x8682('0x5'));var fs=require('fs');var path=require(_0x8682('0x6'));var rimraf=require(_0x8682('0x7'));var config=require(_0x8682('0x8'));var attributes=require(_0x8682('0x9'));module[_0x8682('0xa')]=function(_0x13c75a,_0x1c0055){return _0x13c75a[_0x8682('0xb')](_0x8682('0xc'),attributes,{'tableName':_0x8682('0xd'),'paranoid':![],'indexes':[{'fields':[_0x8682('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc693=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0xc693,0xd2));var _0x3c69=function(_0x234f3e,_0x1346c0){_0x234f3e=_0x234f3e-0x0;var _0xd9d766=_0xc693[_0x234f3e];return _0xd9d766;};'use strict';var _=require(_0x3c69('0x0'));var util=require(_0x3c69('0x1'));var logger=require(_0x3c69('0x2'))(_0x3c69('0x3'));var moment=require('moment');var BPromise=require(_0x3c69('0x4'));var rp=require(_0x3c69('0x5'));var fs=require('fs');var path=require(_0x3c69('0x6'));var rimraf=require(_0x3c69('0x7'));var config=require(_0x3c69('0x8'));var attributes=require(_0x3c69('0x9'));module[_0x3c69('0xa')]=function(_0x1dca97,_0x4ea82c){return _0x1dca97[_0x3c69('0xb')](_0x3c69('0xc'),attributes,{'tableName':_0x3c69('0xd'),'paranoid':![],'indexes':[{'fields':[_0x3c69('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index bfcb1bc..3a3e697 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x945e=['where','attributes','limit','include','map','model','stringify','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw'];(function(_0x4a7590,_0x2e2223){var _0x174b6c=function(_0x44a68c){while(--_0x44a68c){_0x4a7590['push'](_0x4a7590['shift']());}};_0x174b6c(++_0x2e2223);}(_0x945e,0x1b9));var _0xe945=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0x945e[_0x10004e];return _0x5af990;};'use strict';var _=require(_0xe945('0x0'));var util=require(_0xe945('0x1'));var moment=require(_0xe945('0x2'));var BPromise=require('bluebird');var rs=require(_0xe945('0x3'));var fs=require('fs');var Redis=require(_0xe945('0x4'));var db=require(_0xe945('0x5'))['db'];var utils=require(_0xe945('0x6'));var logger=require(_0xe945('0x7'))(_0xe945('0x8'));var config=require(_0xe945('0x9'));var jayson=require(_0xe945('0xa'));var client=jayson[_0xe945('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ca53d,_0x47e04b,_0x33dd02){return new BPromise(function(_0x330141,_0x8325ee){return client['request'](_0x4ca53d,_0x33dd02)[_0xe945('0xc')](function(_0x5e562c){logger[_0xe945('0xd')](_0xe945('0xe'),_0x47e04b,_0xe945('0xf'));logger[_0xe945('0x10')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x47e04b,_0xe945('0xf'),JSON['stringify'](_0x5e562c));if(_0x5e562c[_0xe945('0x11')]){if(_0x5e562c[_0xe945('0x11')][_0xe945('0x12')]===0x1f4){logger[_0xe945('0x11')](_0xe945('0xe'),_0x47e04b,_0x5e562c[_0xe945('0x11')][_0xe945('0x13')]);return _0x8325ee(_0x5e562c['error'][_0xe945('0x13')]);}logger['error'](_0xe945('0xe'),_0x47e04b,_0x5e562c['error'][_0xe945('0x13')]);return _0x330141(_0x5e562c[_0xe945('0x11')][_0xe945('0x13')]);}else{logger[_0xe945('0xd')](_0xe945('0xe'),_0x47e04b,_0xe945('0xf'));_0x330141(_0x5e562c[_0xe945('0x14')][_0xe945('0x13')]);}})[_0xe945('0x15')](function(_0x49ca0e){logger[_0xe945('0x11')](_0xe945('0xe'),_0x47e04b,_0x49ca0e);_0x8325ee(_0x49ca0e);});});}exports[_0xe945('0x16')]=function(_0x4c62fe){var _0x53b092=this;return new Promise(function(_0x835bc6,_0xa1ec40){return db[_0xe945('0x17')][_0xe945('0x18')]({'raw':_0x4c62fe['options']?_0x4c62fe[_0xe945('0x19')][_0xe945('0x1a')]===undefined?!![]:![]:!![],'where':_0x4c62fe[_0xe945('0x19')]?_0x4c62fe[_0xe945('0x19')][_0xe945('0x1b')]||null:null,'attributes':_0x4c62fe[_0xe945('0x19')]?_0x4c62fe[_0xe945('0x19')][_0xe945('0x1c')]||null:null,'limit':_0x4c62fe['options']?_0x4c62fe['options'][_0xe945('0x1d')]||null:null,'include':_0x4c62fe[_0xe945('0x19')]?_0x4c62fe[_0xe945('0x19')][_0xe945('0x1e')]?_[_0xe945('0x1f')](_0x4c62fe[_0xe945('0x19')][_0xe945('0x1e')],function(_0x38f53b){return{'model':db[_0x38f53b[_0xe945('0x20')]],'as':_0x38f53b['as'],'attributes':_0x38f53b['attributes'],'include':_0x38f53b['include']?_['map'](_0x38f53b[_0xe945('0x1e')],function(_0x62f765){return{'model':db[_0x62f765[_0xe945('0x20')]],'as':_0x62f765['as'],'attributes':_0x62f765[_0xe945('0x1c')],'include':_0x62f765[_0xe945('0x1e')]?_['map'](_0x62f765[_0xe945('0x1e')],function(_0x243008){return{'model':db[_0x243008[_0xe945('0x20')]],'as':_0x243008['as'],'attributes':_0x243008[_0xe945('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe945('0xc')](function(_0x5b36c9){logger[_0xe945('0xd')](_0xe945('0x16'),_0x4c62fe);logger[_0xe945('0x10')]('GetVoiceCallReport',_0x4c62fe,JSON[_0xe945('0x21')](_0x5b36c9));_0x835bc6(_0x5b36c9);})[_0xe945('0x15')](function(_0x56b356){logger['error'](_0xe945('0x16'),_0x56b356[_0xe945('0x13')],_0x4c62fe);_0xa1ec40(_0x53b092[_0xe945('0x11')](0x1f4,_0x56b356[_0xe945('0x13')]));});});};exports[_0xe945('0x22')]=function(_0x3cae6f){var _0x261296=this;return new Promise(function(_0x2ea564,_0x361fe7){return db[_0xe945('0x17')][_0xe945('0x23')](_0x3cae6f[_0xe945('0x24')],{'raw':_0x3cae6f[_0xe945('0x19')]?_0x3cae6f['options'][_0xe945('0x1a')]===undefined?!![]:![]:!![]})[_0xe945('0xc')](function(_0x1d3ca6){logger[_0xe945('0xd')]('CreateVoiceCallReport',_0x3cae6f);logger[_0xe945('0x10')](_0xe945('0x22'),_0x3cae6f,JSON[_0xe945('0x21')](_0x1d3ca6));_0x2ea564(_0x1d3ca6);})['catch'](function(_0x590b67){logger['error'](_0xe945('0x22'),_0x590b67[_0xe945('0x13')],_0x3cae6f);_0x361fe7(_0x261296[_0xe945('0x11')](0x1f4,_0x590b67[_0xe945('0x13')]));});});};exports[_0xe945('0x25')]=function(_0x494a6c){var _0x5bbb92=this;return new Promise(function(_0x271a41,_0x1c08c4){return db['VoiceCallReport'][_0xe945('0x26')](_0x494a6c[_0xe945('0x24')],{'raw':_0x494a6c[_0xe945('0x19')]?_0x494a6c[_0xe945('0x19')][_0xe945('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x494a6c[_0xe945('0x19')]?_0x494a6c[_0xe945('0x19')][_0xe945('0x1b')]||null:null,'attributes':_0x494a6c[_0xe945('0x19')]?_0x494a6c[_0xe945('0x19')][_0xe945('0x1c')]||null:null,'limit':_0x494a6c[_0xe945('0x19')]?_0x494a6c[_0xe945('0x19')][_0xe945('0x1d')]||null:null})[_0xe945('0xc')](function(_0x55d053){logger[_0xe945('0xd')](_0xe945('0x25'),_0x494a6c);logger[_0xe945('0x10')](_0xe945('0x25'),_0x494a6c,JSON[_0xe945('0x21')](_0x55d053));_0x271a41(_0x55d053);})[_0xe945('0x15')](function(_0x4b644b){logger[_0xe945('0x11')]('UpdateVoiceCallReport',_0x4b644b[_0xe945('0x13')],_0x494a6c);_0x1c08c4(_0x5bbb92[_0xe945('0x11')](0x1f4,_0x4b644b[_0xe945('0x13')]));});});};
\ No newline at end of file
+var _0x7668=['VoiceCallReport','create','body','UpdateVoiceCallReport','update','debug','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','VoiceCallReport,\x20%s,\x20%s','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetVoiceCallReport','findAll','options','raw','where','attributes','limit','include','model','map','stringify','CreateVoiceCallReport'];(function(_0x1c446a,_0x3b3ad2){var _0x899e24=function(_0x579843){while(--_0x579843){_0x1c446a['push'](_0x1c446a['shift']());}};_0x899e24(++_0x3b3ad2);}(_0x7668,0x110));var _0x8766=function(_0x1ed1a9,_0x16212c){_0x1ed1a9=_0x1ed1a9-0x0;var _0x40a303=_0x7668[_0x1ed1a9];return _0x40a303;};'use strict';var _=require('lodash');var util=require(_0x8766('0x0'));var moment=require(_0x8766('0x1'));var BPromise=require('bluebird');var rs=require(_0x8766('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8766('0x3'))['db'];var utils=require(_0x8766('0x4'));var logger=require(_0x8766('0x5'))(_0x8766('0x6'));var config=require('../../config/environment');var jayson=require(_0x8766('0x7'));var client=jayson[_0x8766('0x8')][_0x8766('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x537081,_0x243d79,_0x1bc6e2){return new BPromise(function(_0x11ad64,_0x1d6270){return client['request'](_0x537081,_0x1bc6e2)[_0x8766('0xa')](function(_0x4e9dce){logger[_0x8766('0xb')](_0x8766('0xc'),_0x243d79,'request\x20sent');logger['debug'](_0x8766('0xd'),_0x243d79,_0x8766('0xe'),JSON['stringify'](_0x4e9dce));if(_0x4e9dce[_0x8766('0xf')]){if(_0x4e9dce[_0x8766('0xf')][_0x8766('0x10')]===0x1f4){logger['error'](_0x8766('0xc'),_0x243d79,_0x4e9dce[_0x8766('0xf')][_0x8766('0x11')]);return _0x1d6270(_0x4e9dce[_0x8766('0xf')][_0x8766('0x11')]);}logger[_0x8766('0xf')](_0x8766('0xc'),_0x243d79,_0x4e9dce[_0x8766('0xf')]['message']);return _0x11ad64(_0x4e9dce[_0x8766('0xf')][_0x8766('0x11')]);}else{logger[_0x8766('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x243d79,_0x8766('0xe'));_0x11ad64(_0x4e9dce[_0x8766('0x12')][_0x8766('0x11')]);}})[_0x8766('0x13')](function(_0x11998f){logger[_0x8766('0xf')](_0x8766('0xc'),_0x243d79,_0x11998f);_0x1d6270(_0x11998f);});});}exports[_0x8766('0x14')]=function(_0x15c5ce){var _0x5713b3=this;return new Promise(function(_0x1997f4,_0x4d080d){return db['VoiceCallReport'][_0x8766('0x15')]({'raw':_0x15c5ce[_0x8766('0x16')]?_0x15c5ce['options'][_0x8766('0x17')]===undefined?!![]:![]:!![],'where':_0x15c5ce[_0x8766('0x16')]?_0x15c5ce[_0x8766('0x16')][_0x8766('0x18')]||null:null,'attributes':_0x15c5ce['options']?_0x15c5ce[_0x8766('0x16')][_0x8766('0x19')]||null:null,'limit':_0x15c5ce[_0x8766('0x16')]?_0x15c5ce[_0x8766('0x16')][_0x8766('0x1a')]||null:null,'include':_0x15c5ce[_0x8766('0x16')]?_0x15c5ce[_0x8766('0x16')]['include']?_['map'](_0x15c5ce[_0x8766('0x16')][_0x8766('0x1b')],function(_0x474949){return{'model':db[_0x474949['model']],'as':_0x474949['as'],'attributes':_0x474949[_0x8766('0x19')],'include':_0x474949['include']?_['map'](_0x474949['include'],function(_0x5af71f){return{'model':db[_0x5af71f[_0x8766('0x1c')]],'as':_0x5af71f['as'],'attributes':_0x5af71f['attributes'],'include':_0x5af71f[_0x8766('0x1b')]?_[_0x8766('0x1d')](_0x5af71f[_0x8766('0x1b')],function(_0x274e7d){return{'model':db[_0x274e7d[_0x8766('0x1c')]],'as':_0x274e7d['as'],'attributes':_0x274e7d[_0x8766('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8766('0xa')](function(_0x123ea5){logger[_0x8766('0xb')](_0x8766('0x14'),_0x15c5ce);logger['debug'](_0x8766('0x14'),_0x15c5ce,JSON[_0x8766('0x1e')](_0x123ea5));_0x1997f4(_0x123ea5);})['catch'](function(_0x391d28){logger[_0x8766('0xf')](_0x8766('0x14'),_0x391d28[_0x8766('0x11')],_0x15c5ce);_0x4d080d(_0x5713b3[_0x8766('0xf')](0x1f4,_0x391d28[_0x8766('0x11')]));});});};exports[_0x8766('0x1f')]=function(_0x4b04d6){var _0x4e9e24=this;return new Promise(function(_0x215d55,_0x4f0473){return db[_0x8766('0x20')][_0x8766('0x21')](_0x4b04d6[_0x8766('0x22')],{'raw':_0x4b04d6[_0x8766('0x16')]?_0x4b04d6[_0x8766('0x16')][_0x8766('0x17')]===undefined?!![]:![]:!![]})[_0x8766('0xa')](function(_0xcf24cb){logger['info']('CreateVoiceCallReport',_0x4b04d6);logger['debug'](_0x8766('0x1f'),_0x4b04d6,JSON['stringify'](_0xcf24cb));_0x215d55(_0xcf24cb);})['catch'](function(_0x2a0f11){logger['error'](_0x8766('0x1f'),_0x2a0f11[_0x8766('0x11')],_0x4b04d6);_0x4f0473(_0x4e9e24[_0x8766('0xf')](0x1f4,_0x2a0f11[_0x8766('0x11')]));});});};exports[_0x8766('0x23')]=function(_0x1af74c){var _0x3c4cd3=this;return new Promise(function(_0x58d986,_0x410dd7){return db[_0x8766('0x20')][_0x8766('0x24')](_0x1af74c[_0x8766('0x22')],{'raw':_0x1af74c[_0x8766('0x16')]?_0x1af74c['options'][_0x8766('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1af74c['options']?_0x1af74c[_0x8766('0x16')][_0x8766('0x18')]||null:null,'attributes':_0x1af74c['options']?_0x1af74c[_0x8766('0x16')][_0x8766('0x19')]||null:null,'limit':_0x1af74c[_0x8766('0x16')]?_0x1af74c[_0x8766('0x16')]['limit']||null:null})['then'](function(_0x33ed2d){logger[_0x8766('0xb')](_0x8766('0x23'),_0x1af74c);logger[_0x8766('0x25')](_0x8766('0x23'),_0x1af74c,JSON[_0x8766('0x1e')](_0x33ed2d));_0x58d986(_0x33ed2d);})[_0x8766('0x13')](function(_0x44c82e){logger['error'](_0x8766('0x23'),_0x44c82e[_0x8766('0x11')],_0x1af74c);_0x410dd7(_0x3c4cd3[_0x8766('0xf')](0x1f4,_0x44c82e[_0x8766('0x11')]));});});};
\ No newline at end of file
index 963e817..8645feb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb541=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x5c027f,_0xa40135){var _0x5392f3=function(_0x581c3b){while(--_0x581c3b){_0x5c027f['push'](_0x5c027f['shift']());}};_0x5392f3(++_0xa40135);}(_0xb541,0x177));var _0x1b54=function(_0x259449,_0x32f882){_0x259449=_0x259449-0x0;var _0x321ae4=_0xb541[_0x259449];return _0x321ae4;};'use strict';var multer=require('multer');var util=require(_0x1b54('0x0'));var path=require(_0x1b54('0x1'));var timeout=require(_0x1b54('0x2'));var express=require(_0x1b54('0x3'));var router=express[_0x1b54('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1b54('0x5'));var interaction=require(_0x1b54('0x6'));var config=require(_0x1b54('0x7'));var controller=require(_0x1b54('0x8'));router[_0x1b54('0x9')]('/',auth[_0x1b54('0xa')](),controller[_0x1b54('0xb')]);router[_0x1b54('0x9')](_0x1b54('0xc'),auth['isAuthenticated'](),controller[_0x1b54('0xd')]);router[_0x1b54('0xe')]('/',auth[_0x1b54('0xa')](),controller[_0x1b54('0xf')]);router['put'](_0x1b54('0xc'),auth[_0x1b54('0xa')](),controller[_0x1b54('0x10')]);router[_0x1b54('0x11')](_0x1b54('0xc'),auth['isAuthenticated'](),controller[_0x1b54('0x12')]);module[_0x1b54('0x13')]=router;
\ No newline at end of file
+var _0x6b8c=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get'];(function(_0x15497f,_0x15ecb3){var _0x3dff4e=function(_0x539f9c){while(--_0x539f9c){_0x15497f['push'](_0x15497f['shift']());}};_0x3dff4e(++_0x15ecb3);}(_0x6b8c,0x9d));var _0xc6b8=function(_0x3b85e6,_0x39a41a){_0x3b85e6=_0x3b85e6-0x0;var _0x101d49=_0x6b8c[_0x3b85e6];return _0x101d49;};'use strict';var multer=require('multer');var util=require(_0xc6b8('0x0'));var path=require(_0xc6b8('0x1'));var timeout=require(_0xc6b8('0x2'));var express=require(_0xc6b8('0x3'));var router=express[_0xc6b8('0x4')]();var fs_extra=require(_0xc6b8('0x5'));var auth=require(_0xc6b8('0x6'));var interaction=require(_0xc6b8('0x7'));var config=require(_0xc6b8('0x8'));var controller=require(_0xc6b8('0x9'));router[_0xc6b8('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc6b8('0xa')](_0xc6b8('0xb'),auth['isAuthenticated'](),controller[_0xc6b8('0xc')]);router[_0xc6b8('0xd')]('/',auth[_0xc6b8('0xe')](),controller[_0xc6b8('0xf')]);router[_0xc6b8('0x10')](_0xc6b8('0xb'),auth[_0xc6b8('0xe')](),controller[_0xc6b8('0x11')]);router[_0xc6b8('0x12')]('/:id',auth[_0xc6b8('0xe')](),controller[_0xc6b8('0x13')]);module[_0xc6b8('0x14')]=router;
\ No newline at end of file
index 2b64809..05e4168 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf107=['options','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','join','getDataValue'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xf107,0xdf));var _0x7f10=function(_0x2bc8b6,_0x5337ef){_0x2bc8b6=_0x2bc8b6-0x0;var _0x4eec85=_0xf107[_0x2bc8b6];return _0x4eec85;};'use strict';var Sequelize=require(_0x7f10('0x0'));module[_0x7f10('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x7f10('0x2')],'unique':_0x7f10('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x7f10('0x2')],'set':function(_0x232d93){this[_0x7f10('0x4')]('options',_0x232d93?_0x232d93[_0x7f10('0x5')](''):[]);},'get':function(){return this[_0x7f10('0x6')](_0x7f10('0x7'))?this[_0x7f10('0x6')](_0x7f10('0x7'))[_0x7f10('0x8')](''):[];}},'auth':{'type':Sequelize[_0x7f10('0x9')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x7f10('0x2')]},'description':{'type':Sequelize[_0x7f10('0x2')]}};
\ No newline at end of file
+var _0x3a9a=['join','split','BOOLEAN','sequelize','exports','STRING','name','options'];(function(_0x38719d,_0x154db1){var _0x459457=function(_0x1a7fe0){while(--_0x1a7fe0){_0x38719d['push'](_0x38719d['shift']());}};_0x459457(++_0x154db1);}(_0x3a9a,0xf3));var _0xa3a9=function(_0x497b1e,_0x586379){_0x497b1e=_0x497b1e-0x0;var _0x3f72e1=_0x3a9a[_0x497b1e];return _0x3f72e1;};'use strict';var Sequelize=require(_0xa3a9('0x0'));module[_0xa3a9('0x1')]={'name':{'type':Sequelize[_0xa3a9('0x2')]},'prefix':{'type':Sequelize[_0xa3a9('0x2')],'unique':_0xa3a9('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xa3a9('0x2')],'set':function(_0x5b0e39){this['setDataValue'](_0xa3a9('0x4'),_0x5b0e39?_0x5b0e39[_0xa3a9('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xa3a9('0x4'))?this['getDataValue']('options')[_0xa3a9('0x6')](''):[];}},'auth':{'type':Sequelize[_0xa3a9('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xa3a9('0x2')]},'record':{'type':Sequelize[_0xa3a9('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 13e0295..2a6970b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b07=['error','stack','name','send','index','VoiceChanSpy','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','findAll','rows','catch','show','params','length','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ChanSpies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','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','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','json','reject','save','update','then','destroy','get','UserProfileResource','end'];(function(_0x228de9,_0x391f44){var _0x4b9c15=function(_0x5d330c){while(--_0x5d330c){_0x228de9['push'](_0x228de9['shift']());}};_0x4b9c15(++_0x391f44);}(_0x4b07,0x1d6));var _0x74b0=function(_0x15e055,_0x4d13d7){_0x15e055=_0x15e055-0x0;var _0x4959e4=_0x4b07[_0x15e055];return _0x4959e4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x74b0('0x0'));var zipdir=require(_0x74b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x74b0('0x2'));var moment=require(_0x74b0('0x3'));var BPromise=require(_0x74b0('0x4'));var Mustache=require(_0x74b0('0x5'));var util=require('util');var path=require(_0x74b0('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x74b0('0x7'));var _=require(_0x74b0('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x74b0('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x74b0('0xa'));var querystring=require(_0x74b0('0xb'));var Papa=require(_0x74b0('0xc'));var Redis=require(_0x74b0('0xd'));var authService=require(_0x74b0('0xe'));var qs=require(_0x74b0('0xf'));var as=require(_0x74b0('0x10'));var hardwareService=require(_0x74b0('0x11'));var logger=require(_0x74b0('0x12'))(_0x74b0('0x13'));var utils=require(_0x74b0('0x14'));var config=require(_0x74b0('0x15'));var licenseUtil=require(_0x74b0('0x16'));var db=require(_0x74b0('0x17'))['db'];function respondWithStatusCode(_0xf1ec58,_0x200f36){_0x200f36=_0x200f36||0xcc;return function(_0x4e9f47){if(_0x4e9f47){return _0xf1ec58[_0x74b0('0x18')](_0x200f36);}return _0xf1ec58[_0x74b0('0x19')](_0x200f36)['end']();};}function respondWithResult(_0xefd5f7,_0x49f519){_0x49f519=_0x49f519||0xc8;return function(_0x72f633){if(_0x72f633){return _0xefd5f7[_0x74b0('0x19')](_0x49f519)['json'](_0x72f633);}};}function respondWithFilteredResult(_0x4004d7,_0x50aa7d){return function(_0x3b002a){if(_0x3b002a){var _0x539172=typeof _0x50aa7d[_0x74b0('0x1a')]==='undefined'&&typeof _0x50aa7d[_0x74b0('0x1b')]===_0x74b0('0x1c');var _0x397ee4=_0x3b002a[_0x74b0('0x1d')];var _0x26deb1=_0x539172?0x0:_0x50aa7d[_0x74b0('0x1a')];var _0x8425cc=_0x539172?_0x3b002a[_0x74b0('0x1d')]:_0x50aa7d['offset']+_0x50aa7d['limit'];var _0x55ccc1;if(_0x8425cc>=_0x397ee4){_0x8425cc=_0x397ee4;_0x55ccc1=0xc8;}else{_0x55ccc1=0xce;}_0x4004d7[_0x74b0('0x19')](_0x55ccc1);return _0x4004d7['set'](_0x74b0('0x1e'),_0x26deb1+'-'+_0x8425cc+'/'+_0x397ee4)[_0x74b0('0x1f')](_0x3b002a);}return null;};}function patchUpdates(_0xc17e43){return function(_0x28a89e){try{jsonpatch['apply'](_0x28a89e,_0xc17e43,!![]);}catch(_0x18004b){return BPromise[_0x74b0('0x20')](_0x18004b);}return _0x28a89e[_0x74b0('0x21')]();};}function saveUpdates(_0xc6c020,_0x550ff7){return function(_0x44f568){if(_0x44f568){return _0x44f568[_0x74b0('0x22')](_0xc6c020)[_0x74b0('0x23')](function(_0x167dd7){return _0x167dd7;});}return null;};}function removeEntity(_0x3e70d5,_0x1396f3){return function(_0x7259f4){if(_0x7259f4){return _0x7259f4[_0x74b0('0x24')]()[_0x74b0('0x23')](function(){var _0x54e2fd=_0x7259f4[_0x74b0('0x25')]({'plain':!![]});var _0x5b6b58='ChanSpies';return db[_0x74b0('0x26')][_0x74b0('0x24')]({'where':{'type':_0x5b6b58,'resourceId':_0x54e2fd['id']}})[_0x74b0('0x23')](function(){return _0x7259f4;});})['then'](function(){_0x3e70d5[_0x74b0('0x19')](0xcc)[_0x74b0('0x27')]();});}};}function handleEntityNotFound(_0x1f8b2a,_0x531fee){return function(_0x57c283){if(!_0x57c283){_0x1f8b2a[_0x74b0('0x18')](0x194);}return _0x57c283;};}function handleError(_0x3b84f0,_0x2d061b){_0x2d061b=_0x2d061b||0x1f4;return function(_0x2163f4){logger[_0x74b0('0x28')](_0x2163f4[_0x74b0('0x29')]);if(_0x2163f4['name']){delete _0x2163f4[_0x74b0('0x2a')];}_0x3b84f0['status'](_0x2d061b)[_0x74b0('0x2b')](_0x2163f4);};}exports[_0x74b0('0x2c')]=function(_0x4dfbdb,_0x2b93ae){var _0x25db17={},_0x143093={},_0x5e0560={'count':0x0,'rows':[]};var _0x529abb=_['map'](db[_0x74b0('0x2d')][_0x74b0('0x2e')],function(_0x57f04e){return{'name':_0x57f04e[_0x74b0('0x2f')],'type':_0x57f04e[_0x74b0('0x30')][_0x74b0('0x31')]};});_0x143093[_0x74b0('0x32')]=_[_0x74b0('0x33')](_0x529abb,_0x74b0('0x2a'));_0x143093['query']=_[_0x74b0('0x34')](_0x4dfbdb[_0x74b0('0x35')]);_0x143093[_0x74b0('0x36')]=_['intersection'](_0x143093[_0x74b0('0x32')],_0x143093[_0x74b0('0x35')]);_0x25db17['attributes']=_[_0x74b0('0x37')](_0x143093[_0x74b0('0x32')],qs[_0x74b0('0x38')](_0x4dfbdb['query'][_0x74b0('0x38')]));_0x25db17[_0x74b0('0x39')]=_0x25db17[_0x74b0('0x39')]['length']?_0x25db17['attributes']:_0x143093[_0x74b0('0x32')];if(!_0x4dfbdb['query'][_0x74b0('0x3a')](_0x74b0('0x3b'))){_0x25db17[_0x74b0('0x1b')]=qs[_0x74b0('0x1b')](_0x4dfbdb[_0x74b0('0x35')][_0x74b0('0x1b')]);_0x25db17[_0x74b0('0x1a')]=qs[_0x74b0('0x1a')](_0x4dfbdb[_0x74b0('0x35')][_0x74b0('0x1a')]);}_0x25db17[_0x74b0('0x3c')]=qs[_0x74b0('0x3d')](_0x4dfbdb[_0x74b0('0x35')][_0x74b0('0x3d')]);_0x25db17[_0x74b0('0x3e')]=qs[_0x74b0('0x36')](_[_0x74b0('0x3f')](_0x4dfbdb[_0x74b0('0x35')],_0x143093[_0x74b0('0x36')]),_0x529abb);if(_0x4dfbdb[_0x74b0('0x35')][_0x74b0('0x40')]){_0x25db17[_0x74b0('0x3e')]=_[_0x74b0('0x41')](_0x25db17[_0x74b0('0x3e')],{'$or':_['map'](_0x529abb,function(_0x83be1d){if(_0x83be1d['type']!=='VIRTUAL'){var _0x4fe7da={};_0x4fe7da[_0x83be1d[_0x74b0('0x2a')]]={'$like':'%'+_0x4dfbdb[_0x74b0('0x35')][_0x74b0('0x40')]+'%'};return _0x4fe7da;}})});}_0x25db17=_[_0x74b0('0x41')]({},_0x25db17,_0x4dfbdb[_0x74b0('0x42')]);var _0x145f01={'where':_0x25db17['where']};return db['VoiceChanSpy'][_0x74b0('0x1d')](_0x145f01)[_0x74b0('0x23')](function(_0x409c65){_0x5e0560[_0x74b0('0x1d')]=_0x409c65;if(_0x4dfbdb[_0x74b0('0x35')]['includeAll']){_0x25db17['include']=[{'all':!![]}];}return db['VoiceChanSpy'][_0x74b0('0x43')](_0x25db17);})[_0x74b0('0x23')](function(_0xffc84){_0x5e0560[_0x74b0('0x44')]=_0xffc84;return _0x5e0560;})['then'](respondWithFilteredResult(_0x2b93ae,_0x25db17))[_0x74b0('0x45')](handleError(_0x2b93ae,null));};exports[_0x74b0('0x46')]=function(_0x5ce200,_0x24dcbd){var _0x3c6973={'raw':![],'where':{'id':_0x5ce200[_0x74b0('0x47')]['id']}},_0x5bee95={};_0x5bee95['model']=_[_0x74b0('0x34')](db[_0x74b0('0x2d')][_0x74b0('0x2e')]);_0x5bee95['query']=_['keys'](_0x5ce200[_0x74b0('0x35')]);_0x5bee95['filters']=_[_0x74b0('0x37')](_0x5bee95['model'],_0x5bee95[_0x74b0('0x35')]);_0x3c6973[_0x74b0('0x39')]=_[_0x74b0('0x37')](_0x5bee95[_0x74b0('0x32')],qs[_0x74b0('0x38')](_0x5ce200[_0x74b0('0x35')][_0x74b0('0x38')]));_0x3c6973[_0x74b0('0x39')]=_0x3c6973[_0x74b0('0x39')][_0x74b0('0x48')]?_0x3c6973[_0x74b0('0x39')]:_0x5bee95[_0x74b0('0x32')];if(_0x5ce200['query'][_0x74b0('0x49')]){_0x3c6973['include']=[{'all':!![]}];}_0x3c6973=_[_0x74b0('0x41')]({},_0x3c6973,_0x5ce200[_0x74b0('0x42')]);return db[_0x74b0('0x2d')][_0x74b0('0x4a')](_0x3c6973)[_0x74b0('0x23')](handleEntityNotFound(_0x24dcbd,null))[_0x74b0('0x23')](respondWithResult(_0x24dcbd,null))['catch'](handleError(_0x24dcbd,null));};exports['create']=function(_0x4edafa,_0x53551f){return db[_0x74b0('0x2d')][_0x74b0('0x4b')](_0x4edafa['body'],{})[_0x74b0('0x23')](function(_0x14cc33){var _0x163af6=_0x4edafa['user'][_0x74b0('0x25')]({'plain':!![]});if(!_0x163af6)throw new Error(_0x74b0('0x4c'));if(_0x163af6[_0x74b0('0x4d')]===_0x74b0('0x4e')){var _0x53bfb8=_0x14cc33[_0x74b0('0x25')]({'plain':!![]});var _0x2e3192=_0x74b0('0x4f');return db[_0x74b0('0x50')]['find']({'where':{'name':_0x2e3192,'userProfileId':_0x163af6[_0x74b0('0x51')]},'raw':!![]})[_0x74b0('0x23')](function(_0x24de7a){if(_0x24de7a&&_0x24de7a[_0x74b0('0x52')]===0x0){return db[_0x74b0('0x26')][_0x74b0('0x4b')]({'name':_0x53bfb8['name'],'resourceId':_0x53bfb8['id'],'type':_0x24de7a['name'],'sectionId':_0x24de7a['id']},{})['then'](function(){return _0x14cc33;});}else{return _0x14cc33;}})[_0x74b0('0x45')](function(_0x1a11ca){logger[_0x74b0('0x28')](_0x74b0('0x53'),_0x1a11ca);throw _0x1a11ca;});}return _0x14cc33;})[_0x74b0('0x23')](respondWithResult(_0x53551f,0xc9))[_0x74b0('0x45')](handleError(_0x53551f,null));};exports['update']=function(_0x5235d4,_0x239a1){if(_0x5235d4['body']['id']){delete _0x5235d4[_0x74b0('0x54')]['id'];}return db[_0x74b0('0x2d')][_0x74b0('0x4a')]({'where':{'id':_0x5235d4[_0x74b0('0x47')]['id']}})['then'](handleEntityNotFound(_0x239a1,null))['then'](saveUpdates(_0x5235d4[_0x74b0('0x54')],null))[_0x74b0('0x23')](respondWithResult(_0x239a1,null))[_0x74b0('0x45')](handleError(_0x239a1,null));};exports['destroy']=function(_0x706f2c,_0x510307){return db[_0x74b0('0x2d')][_0x74b0('0x4a')]({'where':{'id':_0x706f2c['params']['id']}})['then'](handleEntityNotFound(_0x510307,null))[_0x74b0('0x23')](removeEntity(_0x510307,null))[_0x74b0('0x45')](handleError(_0x510307,null));};
\ No newline at end of file
+var _0x2a41=['filter','includeAll','include','findAll','rows','catch','show','params','options','find','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','ChanSpies','sendStatus','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL'];(function(_0x27beea,_0x3bc9f4){var _0x122645=function(_0x2c848){while(--_0x2c848){_0x27beea['push'](_0x27beea['shift']());}};_0x122645(++_0x3bc9f4);}(_0x2a41,0x126));var _0x12a4=function(_0xbefd3c,_0xbc56f0){_0xbefd3c=_0xbefd3c-0x0;var _0x253ad5=_0x2a41[_0xbefd3c];return _0x253ad5;};'use strict';var emlformat=require(_0x12a4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x12a4('0x1'));var jsonpatch=require(_0x12a4('0x2'));var rp=require(_0x12a4('0x3'));var moment=require(_0x12a4('0x4'));var BPromise=require(_0x12a4('0x5'));var Mustache=require(_0x12a4('0x6'));var util=require(_0x12a4('0x7'));var path=require(_0x12a4('0x8'));var sox=require(_0x12a4('0x9'));var csv=require('to-csv');var ejs=require(_0x12a4('0xa'));var fs=require('fs');var fs_extra=require(_0x12a4('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x12a4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x12a4('0xd'));var toCsv=require(_0x12a4('0xe'));var querystring=require(_0x12a4('0xf'));var Papa=require(_0x12a4('0x10'));var Redis=require(_0x12a4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x12a4('0x12'));var as=require(_0x12a4('0x13'));var hardwareService=require(_0x12a4('0x14'));var logger=require(_0x12a4('0x15'))(_0x12a4('0x16'));var utils=require(_0x12a4('0x17'));var config=require(_0x12a4('0x18'));var licenseUtil=require(_0x12a4('0x19'));var db=require(_0x12a4('0x1a'))['db'];function respondWithStatusCode(_0x197554,_0x28059a){_0x28059a=_0x28059a||0xcc;return function(_0x2c939e){if(_0x2c939e){return _0x197554['sendStatus'](_0x28059a);}return _0x197554[_0x12a4('0x1b')](_0x28059a)[_0x12a4('0x1c')]();};}function respondWithResult(_0x1af5f8,_0x22cfde){_0x22cfde=_0x22cfde||0xc8;return function(_0x2b6e72){if(_0x2b6e72){return _0x1af5f8['status'](_0x22cfde)['json'](_0x2b6e72);}};}function respondWithFilteredResult(_0x257d27,_0x2ccfce){return function(_0x2428ba){if(_0x2428ba){var _0x1cce66=typeof _0x2ccfce['offset']===_0x12a4('0x1d')&&typeof _0x2ccfce[_0x12a4('0x1e')]===_0x12a4('0x1d');var _0x25d54f=_0x2428ba[_0x12a4('0x1f')];var _0xe274e1=_0x1cce66?0x0:_0x2ccfce['offset'];var _0x1a6bbe=_0x1cce66?_0x2428ba[_0x12a4('0x1f')]:_0x2ccfce[_0x12a4('0x20')]+_0x2ccfce['limit'];var _0x569763;if(_0x1a6bbe>=_0x25d54f){_0x1a6bbe=_0x25d54f;_0x569763=0xc8;}else{_0x569763=0xce;}_0x257d27[_0x12a4('0x1b')](_0x569763);return _0x257d27[_0x12a4('0x21')](_0x12a4('0x22'),_0xe274e1+'-'+_0x1a6bbe+'/'+_0x25d54f)[_0x12a4('0x23')](_0x2428ba);}return null;};}function patchUpdates(_0x1a35d3){return function(_0x5c92e8){try{jsonpatch[_0x12a4('0x24')](_0x5c92e8,_0x1a35d3,!![]);}catch(_0x5617d6){return BPromise[_0x12a4('0x25')](_0x5617d6);}return _0x5c92e8[_0x12a4('0x26')]();};}function saveUpdates(_0x40bf8e,_0x475939){return function(_0x17a4cc){if(_0x17a4cc){return _0x17a4cc['update'](_0x40bf8e)[_0x12a4('0x27')](function(_0x188930){return _0x188930;});}return null;};}function removeEntity(_0x35e966,_0x1c4255){return function(_0x499b22){if(_0x499b22){return _0x499b22[_0x12a4('0x28')]()[_0x12a4('0x27')](function(){var _0x376a74=_0x499b22['get']({'plain':!![]});var _0x395749=_0x12a4('0x29');return db['UserProfileResource'][_0x12a4('0x28')]({'where':{'type':_0x395749,'resourceId':_0x376a74['id']}})[_0x12a4('0x27')](function(){return _0x499b22;});})['then'](function(){_0x35e966['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41e832,_0x6ac80c){return function(_0x3314da){if(!_0x3314da){_0x41e832[_0x12a4('0x2a')](0x194);}return _0x3314da;};}function handleError(_0x4843f8,_0x443c90){_0x443c90=_0x443c90||0x1f4;return function(_0x56c3da){logger[_0x12a4('0x2b')](_0x56c3da[_0x12a4('0x2c')]);if(_0x56c3da[_0x12a4('0x2d')]){delete _0x56c3da[_0x12a4('0x2d')];}_0x4843f8['status'](_0x443c90)[_0x12a4('0x2e')](_0x56c3da);};}exports[_0x12a4('0x2f')]=function(_0x4e38f7,_0x283668){var _0x4cff97={},_0x36edf3={},_0x2de4d5={'count':0x0,'rows':[]};var _0x534ab5=_[_0x12a4('0x30')](db[_0x12a4('0x31')][_0x12a4('0x32')],function(_0x5ce983){return{'name':_0x5ce983[_0x12a4('0x33')],'type':_0x5ce983['type'][_0x12a4('0x34')]};});_0x36edf3[_0x12a4('0x35')]=_[_0x12a4('0x30')](_0x534ab5,_0x12a4('0x2d'));_0x36edf3[_0x12a4('0x36')]=_[_0x12a4('0x37')](_0x4e38f7['query']);_0x36edf3[_0x12a4('0x38')]=_[_0x12a4('0x39')](_0x36edf3[_0x12a4('0x35')],_0x36edf3['query']);_0x4cff97['attributes']=_[_0x12a4('0x39')](_0x36edf3['model'],qs[_0x12a4('0x3a')](_0x4e38f7[_0x12a4('0x36')]['fields']));_0x4cff97[_0x12a4('0x3b')]=_0x4cff97[_0x12a4('0x3b')][_0x12a4('0x3c')]?_0x4cff97[_0x12a4('0x3b')]:_0x36edf3['model'];if(!_0x4e38f7[_0x12a4('0x36')][_0x12a4('0x3d')](_0x12a4('0x3e'))){_0x4cff97[_0x12a4('0x1e')]=qs[_0x12a4('0x1e')](_0x4e38f7['query']['limit']);_0x4cff97[_0x12a4('0x20')]=qs['offset'](_0x4e38f7[_0x12a4('0x36')][_0x12a4('0x20')]);}_0x4cff97[_0x12a4('0x3f')]=qs[_0x12a4('0x40')](_0x4e38f7[_0x12a4('0x36')][_0x12a4('0x40')]);_0x4cff97[_0x12a4('0x41')]=qs[_0x12a4('0x38')](_[_0x12a4('0x42')](_0x4e38f7[_0x12a4('0x36')],_0x36edf3['filters']),_0x534ab5);if(_0x4e38f7['query']['filter']){_0x4cff97[_0x12a4('0x41')]=_[_0x12a4('0x43')](_0x4cff97['where'],{'$or':_[_0x12a4('0x30')](_0x534ab5,function(_0x1841c){if(_0x1841c[_0x12a4('0x44')]!==_0x12a4('0x45')){var _0x146713={};_0x146713[_0x1841c[_0x12a4('0x2d')]]={'$like':'%'+_0x4e38f7[_0x12a4('0x36')][_0x12a4('0x46')]+'%'};return _0x146713;}})});}_0x4cff97=_[_0x12a4('0x43')]({},_0x4cff97,_0x4e38f7['options']);var _0x9f6fa8={'where':_0x4cff97['where']};return db[_0x12a4('0x31')][_0x12a4('0x1f')](_0x9f6fa8)[_0x12a4('0x27')](function(_0x2826fb){_0x2de4d5[_0x12a4('0x1f')]=_0x2826fb;if(_0x4e38f7['query'][_0x12a4('0x47')]){_0x4cff97[_0x12a4('0x48')]=[{'all':!![]}];}return db[_0x12a4('0x31')][_0x12a4('0x49')](_0x4cff97);})[_0x12a4('0x27')](function(_0xf2751e){_0x2de4d5[_0x12a4('0x4a')]=_0xf2751e;return _0x2de4d5;})['then'](respondWithFilteredResult(_0x283668,_0x4cff97))[_0x12a4('0x4b')](handleError(_0x283668,null));};exports[_0x12a4('0x4c')]=function(_0x44c499,_0x2745b7){var _0x33143b={'raw':![],'where':{'id':_0x44c499[_0x12a4('0x4d')]['id']}},_0x331605={};_0x331605[_0x12a4('0x35')]=_[_0x12a4('0x37')](db[_0x12a4('0x31')][_0x12a4('0x32')]);_0x331605['query']=_[_0x12a4('0x37')](_0x44c499[_0x12a4('0x36')]);_0x331605[_0x12a4('0x38')]=_['intersection'](_0x331605['model'],_0x331605[_0x12a4('0x36')]);_0x33143b[_0x12a4('0x3b')]=_[_0x12a4('0x39')](_0x331605['model'],qs[_0x12a4('0x3a')](_0x44c499[_0x12a4('0x36')][_0x12a4('0x3a')]));_0x33143b[_0x12a4('0x3b')]=_0x33143b['attributes']['length']?_0x33143b['attributes']:_0x331605['model'];if(_0x44c499[_0x12a4('0x36')][_0x12a4('0x47')]){_0x33143b[_0x12a4('0x48')]=[{'all':!![]}];}_0x33143b=_[_0x12a4('0x43')]({},_0x33143b,_0x44c499[_0x12a4('0x4e')]);return db['VoiceChanSpy'][_0x12a4('0x4f')](_0x33143b)[_0x12a4('0x27')](handleEntityNotFound(_0x2745b7,null))[_0x12a4('0x27')](respondWithResult(_0x2745b7,null))['catch'](handleError(_0x2745b7,null));};exports['create']=function(_0x41516b,_0x11ef07){return db['VoiceChanSpy']['create'](_0x41516b['body'],{})[_0x12a4('0x27')](function(_0x3ad94c){var _0x417ad5=_0x41516b['user'][_0x12a4('0x50')]({'plain':!![]});if(!_0x417ad5)throw new Error(_0x12a4('0x51'));if(_0x417ad5['role']===_0x12a4('0x52')){var _0x10f12e=_0x3ad94c[_0x12a4('0x50')]({'plain':!![]});var _0x2688c5=_0x12a4('0x29');return db[_0x12a4('0x53')]['find']({'where':{'name':_0x2688c5,'userProfileId':_0x417ad5[_0x12a4('0x54')]},'raw':!![]})['then'](function(_0x33a817){if(_0x33a817&&_0x33a817[_0x12a4('0x55')]===0x0){return db[_0x12a4('0x56')][_0x12a4('0x57')]({'name':_0x10f12e[_0x12a4('0x2d')],'resourceId':_0x10f12e['id'],'type':_0x33a817[_0x12a4('0x2d')],'sectionId':_0x33a817['id']},{})[_0x12a4('0x27')](function(){return _0x3ad94c;});}else{return _0x3ad94c;}})['catch'](function(_0xc5669b){logger[_0x12a4('0x2b')](_0x12a4('0x58'),_0xc5669b);throw _0xc5669b;});}return _0x3ad94c;})[_0x12a4('0x27')](respondWithResult(_0x11ef07,0xc9))[_0x12a4('0x4b')](handleError(_0x11ef07,null));};exports[_0x12a4('0x59')]=function(_0x2e2e07,_0x3521cb){if(_0x2e2e07[_0x12a4('0x5a')]['id']){delete _0x2e2e07[_0x12a4('0x5a')]['id'];}return db[_0x12a4('0x31')][_0x12a4('0x4f')]({'where':{'id':_0x2e2e07[_0x12a4('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3521cb,null))[_0x12a4('0x27')](saveUpdates(_0x2e2e07[_0x12a4('0x5a')],null))[_0x12a4('0x27')](respondWithResult(_0x3521cb,null))[_0x12a4('0x4b')](handleError(_0x3521cb,null));};exports['destroy']=function(_0x2c95a8,_0x5720cf){return db[_0x12a4('0x31')][_0x12a4('0x4f')]({'where':{'id':_0x2c95a8[_0x12a4('0x4d')]['id']}})[_0x12a4('0x27')](handleEntityNotFound(_0x5720cf,null))[_0x12a4('0x27')](removeEntity(_0x5720cf,null))[_0x12a4('0x4b')](handleError(_0x5720cf,null));};
\ No newline at end of file
index 4c9f719..ee4c91b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68b6=['system','push','merge','Set','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','password','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','agent','then','catch','exports','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x68b6,0x1b4));var _0x668b=function(_0x2cf875,_0x111c9e){_0x2cf875=_0x2cf875-0x0;var _0x90e73d=_0x68b6[_0x2cf875];return _0x90e73d;};'use strict';var _=require(_0x668b('0x0'));var util=require(_0x668b('0x1'));var BPromise=require(_0x668b('0x2'));var attributes=require(_0x668b('0x3'));var getUserApplications=function(_0x4d14dd,_0x21a635,_0x1af829){var _0x258471=0x1;var _0x90ede3=[];var _0x23c5d4={'context':_0x21a635[_0x668b('0x4')]||_0x668b('0x5'),'exten':util[_0x668b('0x6')](_0x668b('0x7'),_0x4d14dd['prefix'],_0x1af829),'type':_0x668b('0x8'),'isApp':![],'ChanSpyId':_0x4d14dd['id'],'UserId':_0x21a635['id']};_0x90ede3[_0x668b('0x9')](_[_0x668b('0xa')]({'app':_0x668b('0xb'),'appdata':util[_0x668b('0x6')]('CDR(type)=%s','chanspy'),'priority':_0x258471++},_0x23c5d4));if(_0x4d14dd[_0x668b('0xc')]){_0x90ede3[_0x668b('0x9')](_[_0x668b('0xa')]({'app':_0x668b('0xd'),'appdata':util['format'](_0x668b('0xe'),_0x4d14dd[_0x668b('0xf')]),'priority':_0x258471++},_0x23c5d4));}if(_0x4d14dd[_0x668b('0x10')]){_0x90ede3[_0x668b('0x9')](_['merge']({'app':'Authenticate','appdata':_0x4d14dd[_0x668b('0x11')],'priority':_0x258471++},_0x23c5d4));}_0x90ede3[_0x668b('0x9')](_[_0x668b('0xa')]({'app':'ChanSpy','appdata':util[_0x668b('0x6')](_0x668b('0x12'),_0x21a635[_0x668b('0x13')],_0x4d14dd[_0x668b('0x14')]?_0x4d14dd['options'][_0x668b('0x15')](''):''),'priority':_0x258471++},_0x23c5d4));if(_0x4d14dd[_0x668b('0xc')]){_0x90ede3[_0x668b('0x9')](_[_0x668b('0xa')]({'app':_0x668b('0x16'),'priority':_0x258471++},_0x23c5d4));}return _0x90ede3;};var getChanSpyApplications=function(_0x49cebc,_0x402dc7){var _0x5afeac=[];for(var _0x16dd6c=0x0,_0x1f537a=0x1;_0x16dd6c<_0x402dc7[_0x668b('0x17')];_0x16dd6c++,_0x1f537a=0x1){_0x5afeac=_0x5afeac[_0x668b('0x18')](getUserApplications(_0x49cebc,_0x402dc7[_0x16dd6c],_0x402dc7[_0x16dd6c]['internal']));if(_0x402dc7[_0x16dd6c][_0x668b('0x19')]!=_0x402dc7[_0x16dd6c]['name']){_0x5afeac=_0x5afeac['concat'](getUserApplications(_0x49cebc,_0x402dc7[_0x16dd6c],_0x402dc7[_0x16dd6c][_0x668b('0x13')]));}}return _0x5afeac;};var getChanSpyPromise=function(_0x512d92,_0x348fae){return new BPromise(function(_0x3bf764,_0x1cd5f0){return _0x512d92[_0x668b('0x1a')]['findAll']({'attributes':['id',_0x668b('0x13'),_0x668b('0x19')],'where':{'role':_0x668b('0x1b'),'chanspy':!![]},'raw':!![]})[_0x668b('0x1c')](function(_0x266495){if(_0x266495){return _0x3bf764(getChanSpyApplications(_0x348fae,_0x266495));}return _0x3bf764([]);})[_0x668b('0x1d')](function(_0x283e81){_0x1cd5f0(_0x283e81);});});};module[_0x668b('0x1e')]=function(_0x2295e8,_0x25be73){var _0x3266da=_0x2295e8['models'];return _0x2295e8[_0x668b('0x1f')](_0x668b('0x20'),attributes,{'tableName':_0x668b('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x20cdee,_0x5b1a64,_0x4a4e07){return getChanSpyPromise(_0x3266da,_0x20cdee)[_0x668b('0x1c')](function(_0x6e09c7){if(_0x6e09c7&&_0x6e09c7[_0x668b('0x17')]){return _0x3266da[_0x668b('0x22')][_0x668b('0x23')](_0x6e09c7);}})[_0x668b('0x1c')](function(){_0x4a4e07();})[_0x668b('0x1d')](function(_0x4cb846){_0x4a4e07(_0x4cb846);});},'afterUpdate':function(_0x195eea,_0x25f34c,_0xafe95f){return _0x3266da[_0x668b('0x22')][_0x668b('0x24')]({'where':{'ChanSpyId':_0x195eea['id']}})['then'](function(){return getChanSpyPromise(_0x3266da,_0x195eea);})[_0x668b('0x1c')](function(_0x4f4c65){if(_0x4f4c65&&_0x4f4c65[_0x668b('0x17')]){return _0x3266da['VoiceExtension'][_0x668b('0x23')](_0x4f4c65);}})[_0x668b('0x1c')](function(){_0xafe95f();})[_0x668b('0x1d')](function(_0x57f110){_0xafe95f(_0x57f110);});},'afterDestroy':function(_0x5f0411,_0x40f806,_0x51aa92){return _0x3266da[_0x668b('0x22')][_0x668b('0x24')]({'where':{'ChanSpyId':_0x5f0411['id']}})[_0x668b('0x1c')](function(){_0x51aa92();})[_0x668b('0x1d')](function(_0x405097){_0x51aa92(_0x405097);});}}});};
\ No newline at end of file
+var _0x6c61=['auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','agent','then','catch','exports','models','VoiceExtension','destroy','bulkCreate','lodash','util','./voiceChanSpy.attributes','context','from-sip','format','%s%s','system','push','Set','record','merge','${UNIQUEID}.%s,a'];(function(_0x55f386,_0x205c50){var _0x299173=function(_0x483889){while(--_0x483889){_0x55f386['push'](_0x55f386['shift']());}};_0x299173(++_0x205c50);}(_0x6c61,0xd3));var _0x16c6=function(_0x537635,_0x125480){_0x537635=_0x537635-0x0;var _0xfed694=_0x6c61[_0x537635];return _0xfed694;};'use strict';var _=require(_0x16c6('0x0'));var util=require(_0x16c6('0x1'));var BPromise=require('bluebird');var attributes=require(_0x16c6('0x2'));var getUserApplications=function(_0x3c23a3,_0x586400,_0x5f10d2){var _0x1891d3=0x1;var _0x2612cf=[];var _0x30dfe5={'context':_0x586400[_0x16c6('0x3')]||_0x16c6('0x4'),'exten':util[_0x16c6('0x5')](_0x16c6('0x6'),_0x3c23a3['prefix'],_0x5f10d2),'type':_0x16c6('0x7'),'isApp':![],'ChanSpyId':_0x3c23a3['id'],'UserId':_0x586400['id']};_0x2612cf[_0x16c6('0x8')](_['merge']({'app':_0x16c6('0x9'),'appdata':util['format']('CDR(type)=%s','chanspy'),'priority':_0x1891d3++},_0x30dfe5));if(_0x3c23a3[_0x16c6('0xa')]){_0x2612cf['push'](_[_0x16c6('0xb')]({'app':'MixMonitor','appdata':util[_0x16c6('0x5')](_0x16c6('0xc'),_0x3c23a3['recordingFormat']),'priority':_0x1891d3++},_0x30dfe5));}if(_0x3c23a3[_0x16c6('0xd')]){_0x2612cf[_0x16c6('0x8')](_[_0x16c6('0xb')]({'app':_0x16c6('0xe'),'appdata':_0x3c23a3['password'],'priority':_0x1891d3++},_0x30dfe5));}_0x2612cf[_0x16c6('0x8')](_[_0x16c6('0xb')]({'app':_0x16c6('0xf'),'appdata':util[_0x16c6('0x5')](_0x16c6('0x10'),_0x586400[_0x16c6('0x11')],_0x3c23a3[_0x16c6('0x12')]?_0x3c23a3[_0x16c6('0x12')][_0x16c6('0x13')](''):''),'priority':_0x1891d3++},_0x30dfe5));if(_0x3c23a3[_0x16c6('0xa')]){_0x2612cf[_0x16c6('0x8')](_[_0x16c6('0xb')]({'app':_0x16c6('0x14'),'priority':_0x1891d3++},_0x30dfe5));}return _0x2612cf;};var getChanSpyApplications=function(_0x4fe62f,_0x38cf4b){var _0x28233a=[];for(var _0x33ea8b=0x0,_0x4eb411=0x1;_0x33ea8b<_0x38cf4b[_0x16c6('0x15')];_0x33ea8b++,_0x4eb411=0x1){_0x28233a=_0x28233a[_0x16c6('0x16')](getUserApplications(_0x4fe62f,_0x38cf4b[_0x33ea8b],_0x38cf4b[_0x33ea8b][_0x16c6('0x17')]));if(_0x38cf4b[_0x33ea8b]['internal']!=_0x38cf4b[_0x33ea8b]['name']){_0x28233a=_0x28233a[_0x16c6('0x16')](getUserApplications(_0x4fe62f,_0x38cf4b[_0x33ea8b],_0x38cf4b[_0x33ea8b]['name']));}}return _0x28233a;};var getChanSpyPromise=function(_0x275704,_0xb6cec3){return new BPromise(function(_0x32e196,_0x5e2bd6){return _0x275704['User']['findAll']({'attributes':['id','name',_0x16c6('0x17')],'where':{'role':_0x16c6('0x18'),'chanspy':!![]},'raw':!![]})[_0x16c6('0x19')](function(_0x1c4a86){if(_0x1c4a86){return _0x32e196(getChanSpyApplications(_0xb6cec3,_0x1c4a86));}return _0x32e196([]);})[_0x16c6('0x1a')](function(_0x59a62a){_0x5e2bd6(_0x59a62a);});});};module[_0x16c6('0x1b')]=function(_0x30d753,_0x368125){var _0x43db71=_0x30d753[_0x16c6('0x1c')];return _0x30d753['define']('VoiceChanSpy',attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x110ae5,_0x31faeb,_0x3110dd){return getChanSpyPromise(_0x43db71,_0x110ae5)[_0x16c6('0x19')](function(_0x5365c6){if(_0x5365c6&&_0x5365c6[_0x16c6('0x15')]){return _0x43db71[_0x16c6('0x1d')]['bulkCreate'](_0x5365c6);}})[_0x16c6('0x19')](function(){_0x3110dd();})[_0x16c6('0x1a')](function(_0x18fed2){_0x3110dd(_0x18fed2);});},'afterUpdate':function(_0x1373ce,_0x990698,_0x47799a){return _0x43db71['VoiceExtension'][_0x16c6('0x1e')]({'where':{'ChanSpyId':_0x1373ce['id']}})[_0x16c6('0x19')](function(){return getChanSpyPromise(_0x43db71,_0x1373ce);})[_0x16c6('0x19')](function(_0x1b6e52){if(_0x1b6e52&&_0x1b6e52[_0x16c6('0x15')]){return _0x43db71[_0x16c6('0x1d')][_0x16c6('0x1f')](_0x1b6e52);}})[_0x16c6('0x19')](function(){_0x47799a();})['catch'](function(_0x97f83a){_0x47799a(_0x97f83a);});},'afterDestroy':function(_0x3b566c,_0x137eb1,_0xed85d3){return _0x43db71[_0x16c6('0x1d')][_0x16c6('0x1e')]({'where':{'ChanSpyId':_0x3b566c['id']}})[_0x16c6('0x19')](function(){_0xed85d3();})[_0x16c6('0x1a')](function(_0x7cea3e){_0xed85d3(_0x7cea3e);});}}});};
\ No newline at end of file
index 729e292..d438453 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa74f=['result','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x444e8b,_0x3524cc){var _0x35eb37=function(_0x17e1a3){while(--_0x17e1a3){_0x444e8b['push'](_0x444e8b['shift']());}};_0x35eb37(++_0x3524cc);}(_0xa74f,0x9a));var _0xfa74=function(_0x4c4037,_0x15054b){_0x4c4037=_0x4c4037-0x0;var _0x357862=_0xa74f[_0x4c4037];return _0x357862;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfa74('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa74('0x1'));var db=require(_0xfa74('0x2'))['db'];var utils=require(_0xfa74('0x3'));var logger=require(_0xfa74('0x4'))('rpc');var config=require(_0xfa74('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfa74('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x9ddbd2,_0x3ac32e,_0x2d9fa9){return new BPromise(function(_0x287921,_0x344e04){return client['request'](_0x9ddbd2,_0x2d9fa9)[_0xfa74('0x7')](function(_0x37d4d8){logger[_0xfa74('0x8')](_0xfa74('0x9'),_0x3ac32e,'request\x20sent');logger[_0xfa74('0xa')](_0xfa74('0xb'),_0x3ac32e,'request\x20sent',JSON[_0xfa74('0xc')](_0x37d4d8));if(_0x37d4d8[_0xfa74('0xd')]){if(_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xe')]===0x1f4){logger['error'](_0xfa74('0x9'),_0x3ac32e,_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xf')]);return _0x344e04(_0x37d4d8[_0xfa74('0xd')]['message']);}logger[_0xfa74('0xd')](_0xfa74('0x9'),_0x3ac32e,_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xf')]);return _0x287921(_0x37d4d8[_0xfa74('0xd')]['message']);}else{logger[_0xfa74('0x8')](_0xfa74('0x9'),_0x3ac32e,_0xfa74('0x10'));_0x287921(_0x37d4d8[_0xfa74('0x11')][_0xfa74('0xf')]);}})[_0xfa74('0x12')](function(_0x3b9e32){logger['error'](_0xfa74('0x9'),_0x3ac32e,_0x3b9e32);_0x344e04(_0x3b9e32);});});}
\ No newline at end of file
+var _0x39cb=['code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2f62aa,_0x108e95){var _0x1a341f=function(_0x3aedcf){while(--_0x3aedcf){_0x2f62aa['push'](_0x2f62aa['shift']());}};_0x1a341f(++_0x108e95);}(_0x39cb,0x1bd));var _0xb39c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x39cb[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xb39c('0x0'));var moment=require(_0xb39c('0x1'));var BPromise=require('bluebird');var rs=require(_0xb39c('0x2'));var fs=require('fs');var Redis=require(_0xb39c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb39c('0x4'));var logger=require(_0xb39c('0x5'))(_0xb39c('0x6'));var config=require(_0xb39c('0x7'));var jayson=require(_0xb39c('0x8'));var client=jayson['client'][_0xb39c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fc868,_0x40112f,_0x3f2fbe){return new BPromise(function(_0x47d6d7,_0x5ae14a){return client[_0xb39c('0xa')](_0x2fc868,_0x3f2fbe)[_0xb39c('0xb')](function(_0x3ffb94){logger[_0xb39c('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x40112f,'request\x20sent');logger['debug'](_0xb39c('0xd'),_0x40112f,_0xb39c('0xe'),JSON[_0xb39c('0xf')](_0x3ffb94));if(_0x3ffb94[_0xb39c('0x10')]){if(_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x11')]===0x1f4){logger[_0xb39c('0x10')](_0xb39c('0x12'),_0x40112f,_0x3ffb94['error'][_0xb39c('0x13')]);return _0x5ae14a(_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x13')]);}logger['error'](_0xb39c('0x12'),_0x40112f,_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x13')]);return _0x47d6d7(_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x13')]);}else{logger[_0xb39c('0xc')](_0xb39c('0x12'),_0x40112f,'request\x20sent');_0x47d6d7(_0x3ffb94[_0xb39c('0x14')][_0xb39c('0x13')]);}})[_0xb39c('0x15')](function(_0x1c2c5f){logger[_0xb39c('0x10')](_0xb39c('0x12'),_0x40112f,_0x1c2c5f);_0x5ae14a(_0x1c2c5f);});});}
\ No newline at end of file
index 87c73af..97e9d1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcba0=['util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','index','/:id','isAuthenticated','show','put','delete','destroy','multer'];(function(_0x2edfbe,_0x537cea){var _0x22e135=function(_0x25e74f){while(--_0x25e74f){_0x2edfbe['push'](_0x2edfbe['shift']());}};_0x22e135(++_0x537cea);}(_0xcba0,0x153));var _0x0cba=function(_0x34a047,_0x200cb9){_0x34a047=_0x34a047-0x0;var _0x26cf89=_0xcba0[_0x34a047];return _0x26cf89;};'use strict';var multer=require(_0x0cba('0x0'));var util=require(_0x0cba('0x1'));var path=require('path');var timeout=require(_0x0cba('0x2'));var express=require(_0x0cba('0x3'));var router=express[_0x0cba('0x4')]();var fs_extra=require(_0x0cba('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0cba('0x6'));var config=require(_0x0cba('0x7'));var controller=require(_0x0cba('0x8'));router[_0x0cba('0x9')]('/',auth['isAuthenticated'](),controller[_0x0cba('0xa')]);router[_0x0cba('0x9')](_0x0cba('0xb'),auth[_0x0cba('0xc')](),controller[_0x0cba('0xd')]);router['post']('/',auth[_0x0cba('0xc')](),controller['create']);router[_0x0cba('0xe')](_0x0cba('0xb'),auth[_0x0cba('0xc')](),controller['update']);router[_0x0cba('0xf')](_0x0cba('0xb'),auth[_0x0cba('0xc')](),controller[_0x0cba('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xd675=['path','express','fs-extra','../../components/auth/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','/:id','show','post','create','update','destroy','exports','multer'];(function(_0x46a38b,_0x16ffb5){var _0x346e75=function(_0x34f8d0){while(--_0x34f8d0){_0x46a38b['push'](_0x46a38b['shift']());}};_0x346e75(++_0x16ffb5);}(_0xd675,0x1cf));var _0x5d67=function(_0x1d7827,_0x42b0db){_0x1d7827=_0x1d7827-0x0;var _0xb449f1=_0xd675[_0x1d7827];return _0xb449f1;};'use strict';var multer=require(_0x5d67('0x0'));var util=require('util');var path=require(_0x5d67('0x1'));var timeout=require('connect-timeout');var express=require(_0x5d67('0x2'));var router=express['Router']();var fs_extra=require(_0x5d67('0x3'));var auth=require(_0x5d67('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5d67('0x5'));var controller=require(_0x5d67('0x6'));router[_0x5d67('0x7')]('/',auth[_0x5d67('0x8')](),controller['index']);router[_0x5d67('0x7')](_0x5d67('0x9'),auth[_0x5d67('0x8')](),controller[_0x5d67('0xa')]);router[_0x5d67('0xb')]('/',auth[_0x5d67('0x8')](),controller[_0x5d67('0xc')]);router['put'](_0x5d67('0x9'),auth['isAuthenticated'](),controller[_0x5d67('0xd')]);router['delete'](_0x5d67('0x9'),auth[_0x5d67('0x8')](),controller[_0x5d67('0xe')]);module[_0x5d67('0xf')]=router;
\ No newline at end of file
index 0cc2f1e..b005f52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d26=['exports','name','STRING','BOOLEAN','sequelize'];(function(_0x4171bf,_0x4322f3){var _0x18a433=function(_0x41c545){while(--_0x41c545){_0x4171bf['push'](_0x4171bf['shift']());}};_0x18a433(++_0x4322f3);}(_0x9d26,0x81));var _0x69d2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9d26[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x69d2('0x0'));module[_0x69d2('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x69d2('0x2')},'description':{'type':Sequelize[_0x69d2('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x69d2('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x1a2f=['name','BOOLEAN','sequelize','exports'];(function(_0x2f2377,_0x11cc21){var _0x441e6b=function(_0x1d0e90){while(--_0x1d0e90){_0x2f2377['push'](_0x2f2377['shift']());}};_0x441e6b(++_0x11cc21);}(_0x1a2f,0x142));var _0xf1a2=function(_0x4c4364,_0x2c2641){_0x4c4364=_0x4c4364-0x0;var _0xf0347b=_0x1a2f[_0x4c4364];return _0xf0347b;};'use strict';var Sequelize=require(_0xf1a2('0x0'));module[_0xf1a2('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xf1a2('0x2')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xf1a2('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index 5376a54..2cb9893 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9977=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','jayson/promise','client','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','apply','update','then','destroy','get','Contexts','stack','name','index','map','VoiceContext','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','includeAll','rows','show','params','include','find','create','body','findAll','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','chan_sip.so','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','querystring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9977,0x1d6));var _0x7997=function(_0x39efbf,_0x118364){_0x39efbf=_0x39efbf-0x0;var _0xcbd510=_0x9977[_0x39efbf];return _0xcbd510;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7997('0x0'));var zipdir=require(_0x7997('0x1'));var jsonpatch=require(_0x7997('0x2'));var rp=require(_0x7997('0x3'));var moment=require(_0x7997('0x4'));var BPromise=require(_0x7997('0x5'));var Mustache=require(_0x7997('0x6'));var util=require(_0x7997('0x7'));var path=require(_0x7997('0x8'));var sox=require('sox');var csv=require(_0x7997('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7997('0xa'));var squel=require(_0x7997('0xb'));var crypto=require(_0x7997('0xc'));var jsforce=require(_0x7997('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7997('0xe'));var Papa=require(_0x7997('0xf'));var Redis=require(_0x7997('0x10'));var authService=require(_0x7997('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7997('0x12'));var logger=require(_0x7997('0x13'))(_0x7997('0x14'));var utils=require('../../config/utils');var config=require(_0x7997('0x15'));var licenseUtil=require(_0x7997('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x7997('0x17'));var client=jayson[_0x7997('0x18')][_0x7997('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x139239,_0x5037b3,_0x30fc15,_0x1c5752){return new BPromise(function(_0x5f13d3,_0x48b4d8){var _0x3c96ac=_0x1c5752||client;return _0x3c96ac[_0x7997('0x1a')](_0x139239,_0x30fc15)['then'](function(_0x25b491){logger[_0x7997('0x1b')](_0x7997('0x1c'),_0x5037b3,_0x7997('0x1d'));logger[_0x7997('0x1e')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x5037b3,_0x7997('0x1d'),JSON['stringify'](_0x25b491));if(_0x25b491[_0x7997('0x1f')]){if(_0x25b491[_0x7997('0x1f')]['code']===0x1f4){logger[_0x7997('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x5037b3,_0x25b491[_0x7997('0x1f')][_0x7997('0x20')]);return _0x48b4d8(_0x25b491[_0x7997('0x1f')]['message']);}logger['error'](_0x7997('0x1c'),_0x5037b3,_0x25b491[_0x7997('0x1f')][_0x7997('0x20')]);return _0x5f13d3(_0x25b491[_0x7997('0x1f')]['message']);}else{logger[_0x7997('0x1b')]('VoiceContext,\x20%s,\x20%s',_0x5037b3,_0x7997('0x1d'));_0x5f13d3(_0x25b491[_0x7997('0x21')][_0x7997('0x20')]);}})[_0x7997('0x22')](function(_0x1fcce6){logger['error'](_0x7997('0x1c'),_0x5037b3,_0x1fcce6);_0x48b4d8(_0x1fcce6);});});}function respondWithStatusCode(_0x400664,_0x596977){_0x596977=_0x596977||0xcc;return function(_0x550e04){if(_0x550e04){return _0x400664[_0x7997('0x23')](_0x596977);}return _0x400664[_0x7997('0x24')](_0x596977)['end']();};}function respondWithResult(_0x2e2b11,_0x9cbf6b){_0x9cbf6b=_0x9cbf6b||0xc8;return function(_0x5409be){if(_0x5409be){return _0x2e2b11['status'](_0x9cbf6b)[_0x7997('0x25')](_0x5409be);}};}function respondWithFilteredResult(_0x38bcfc,_0x2d0704){return function(_0x73bf42){if(_0x73bf42){var _0x5c2b80=typeof _0x2d0704[_0x7997('0x26')]===_0x7997('0x27')&&typeof _0x2d0704[_0x7997('0x28')]===_0x7997('0x27');var _0x4b7f61=_0x73bf42[_0x7997('0x29')];var _0x26aacf=_0x5c2b80?0x0:_0x2d0704['offset'];var _0x5e8d85=_0x5c2b80?_0x73bf42[_0x7997('0x29')]:_0x2d0704['offset']+_0x2d0704[_0x7997('0x28')];var _0x51c734;if(_0x5e8d85>=_0x4b7f61){_0x5e8d85=_0x4b7f61;_0x51c734=0xc8;}else{_0x51c734=0xce;}_0x38bcfc[_0x7997('0x24')](_0x51c734);return _0x38bcfc['set']('Content-Range',_0x26aacf+'-'+_0x5e8d85+'/'+_0x4b7f61)[_0x7997('0x25')](_0x73bf42);}return null;};}function patchUpdates(_0x2e7384){return function(_0x40d982){try{jsonpatch[_0x7997('0x2a')](_0x40d982,_0x2e7384,!![]);}catch(_0x2b6ee0){return BPromise['reject'](_0x2b6ee0);}return _0x40d982['save']();};}function saveUpdates(_0x12dd48,_0x1f02aa){return function(_0x5e3bba){if(_0x5e3bba){return _0x5e3bba[_0x7997('0x2b')](_0x12dd48)[_0x7997('0x2c')](function(_0x151cde){return _0x151cde;});}return null;};}function removeEntity(_0xcb00c8,_0x543097){return function(_0x341c66){if(_0x341c66){return _0x341c66[_0x7997('0x2d')]()['then'](function(){var _0x6678d1=_0x341c66[_0x7997('0x2e')]({'plain':!![]});var _0x3bd4c1=_0x7997('0x2f');return db['UserProfileResource'][_0x7997('0x2d')]({'where':{'type':_0x3bd4c1,'resourceId':_0x6678d1['id']}})['then'](function(){return _0x341c66;});})[_0x7997('0x2c')](function(){_0xcb00c8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x31389e,_0x35c73e){return function(_0x376d41){if(!_0x376d41){_0x31389e[_0x7997('0x23')](0x194);}return _0x376d41;};}function handleError(_0x120b6b,_0x165243){_0x165243=_0x165243||0x1f4;return function(_0x38d7ba){logger[_0x7997('0x1f')](_0x38d7ba[_0x7997('0x30')]);if(_0x38d7ba[_0x7997('0x31')]){delete _0x38d7ba['name'];}_0x120b6b[_0x7997('0x24')](_0x165243)['send'](_0x38d7ba);};}exports[_0x7997('0x32')]=function(_0x5051f5,_0x3565cf){var _0xcb2a43={},_0x246c8d={},_0x197a4c={'count':0x0,'rows':[]};var _0x229124=_[_0x7997('0x33')](db[_0x7997('0x34')][_0x7997('0x35')],function(_0x460243){return{'name':_0x460243[_0x7997('0x36')],'type':_0x460243['type'][_0x7997('0x37')]};});_0x246c8d[_0x7997('0x38')]=_[_0x7997('0x33')](_0x229124,'name');_0x246c8d[_0x7997('0x39')]=_[_0x7997('0x3a')](_0x5051f5[_0x7997('0x39')]);_0x246c8d[_0x7997('0x3b')]=_[_0x7997('0x3c')](_0x246c8d[_0x7997('0x38')],_0x246c8d[_0x7997('0x39')]);_0xcb2a43[_0x7997('0x3d')]=_[_0x7997('0x3c')](_0x246c8d[_0x7997('0x38')],qs[_0x7997('0x3e')](_0x5051f5[_0x7997('0x39')][_0x7997('0x3e')]));_0xcb2a43['attributes']=_0xcb2a43[_0x7997('0x3d')][_0x7997('0x3f')]?_0xcb2a43[_0x7997('0x3d')]:_0x246c8d[_0x7997('0x38')];if(!_0x5051f5['query'][_0x7997('0x40')](_0x7997('0x41'))){_0xcb2a43[_0x7997('0x28')]=qs[_0x7997('0x28')](_0x5051f5[_0x7997('0x39')][_0x7997('0x28')]);_0xcb2a43[_0x7997('0x26')]=qs[_0x7997('0x26')](_0x5051f5[_0x7997('0x39')][_0x7997('0x26')]);}_0xcb2a43[_0x7997('0x42')]=qs[_0x7997('0x43')](_0x5051f5['query'][_0x7997('0x43')]);_0xcb2a43['where']=qs[_0x7997('0x3b')](_[_0x7997('0x44')](_0x5051f5[_0x7997('0x39')],_0x246c8d[_0x7997('0x3b')]),_0x229124);if(_0x5051f5[_0x7997('0x39')][_0x7997('0x45')]){_0xcb2a43['where']=_[_0x7997('0x46')](_0xcb2a43[_0x7997('0x47')],{'$or':_[_0x7997('0x33')](_0x229124,function(_0x4ded24){if(_0x4ded24['type']!=='VIRTUAL'){var _0x20ac8e={};_0x20ac8e[_0x4ded24[_0x7997('0x31')]]={'$like':'%'+_0x5051f5[_0x7997('0x39')][_0x7997('0x45')]+'%'};return _0x20ac8e;}})});}_0xcb2a43=_['merge']({},_0xcb2a43,_0x5051f5[_0x7997('0x48')]);var _0x1aeea6={'where':_0xcb2a43['where']};return db['VoiceContext'][_0x7997('0x29')](_0x1aeea6)[_0x7997('0x2c')](function(_0x2be5dd){_0x197a4c[_0x7997('0x29')]=_0x2be5dd;if(_0x5051f5[_0x7997('0x39')][_0x7997('0x49')]){_0xcb2a43['include']=[{'all':!![]}];}return db[_0x7997('0x34')]['findAll'](_0xcb2a43);})[_0x7997('0x2c')](function(_0x5ba0ad){_0x197a4c[_0x7997('0x4a')]=_0x5ba0ad;return _0x197a4c;})[_0x7997('0x2c')](respondWithFilteredResult(_0x3565cf,_0xcb2a43))['catch'](handleError(_0x3565cf,null));};exports[_0x7997('0x4b')]=function(_0x50289c,_0x1465d2){var _0x496988={'raw':![],'where':{'id':_0x50289c[_0x7997('0x4c')]['id']}},_0x5c9163={};_0x5c9163[_0x7997('0x38')]=_[_0x7997('0x3a')](db[_0x7997('0x34')]['rawAttributes']);_0x5c9163[_0x7997('0x39')]=_[_0x7997('0x3a')](_0x50289c[_0x7997('0x39')]);_0x5c9163[_0x7997('0x3b')]=_['intersection'](_0x5c9163[_0x7997('0x38')],_0x5c9163[_0x7997('0x39')]);_0x496988[_0x7997('0x3d')]=_[_0x7997('0x3c')](_0x5c9163[_0x7997('0x38')],qs['fields'](_0x50289c[_0x7997('0x39')][_0x7997('0x3e')]));_0x496988[_0x7997('0x3d')]=_0x496988[_0x7997('0x3d')][_0x7997('0x3f')]?_0x496988[_0x7997('0x3d')]:_0x5c9163[_0x7997('0x38')];if(_0x50289c['query']['includeAll']){_0x496988[_0x7997('0x4d')]=[{'all':!![]}];}_0x496988=_[_0x7997('0x46')]({},_0x496988,_0x50289c[_0x7997('0x48')]);return db['VoiceContext'][_0x7997('0x4e')](_0x496988)[_0x7997('0x2c')](handleEntityNotFound(_0x1465d2,null))['then'](respondWithResult(_0x1465d2,null))[_0x7997('0x22')](handleError(_0x1465d2,null));};exports[_0x7997('0x4f')]=function(_0x4682ea,_0x1413a6,_0x30c472){var _0x120385;return db['VoiceContext'][_0x7997('0x4f')](_0x4682ea[_0x7997('0x50')],{'raw':!![]})[_0x7997('0x2c')](function(_0x46f31f){_0x120385=_0x46f31f;return db[_0x7997('0x34')][_0x7997('0x51')]({'raw':!![]});})[_0x7997('0x2c')](function(_0x4f5773){var _0x240e7e=fs[_0x7997('0x52')](path[_0x7997('0x53')](config[_0x7997('0x54')],_0x7997('0x55')),_0x7997('0x56'));var _0x448240=ejs[_0x7997('0x57')](_0x240e7e,{'contexts':_0x4f5773||[]});fs[_0x7997('0x58')](_0x7997('0x59'),_0x448240);})['then'](function(){return respondWithRpcPromise(_0x7997('0x5a'),'create',{'module':'chan_sip.so'});})[_0x7997('0x2c')](function(){var _0x5c2c5e=_0x4682ea[_0x7997('0x5b')][_0x7997('0x2e')]({'plain':!![]});if(!_0x5c2c5e)throw new Error(_0x7997('0x5c'));if(_0x5c2c5e[_0x7997('0x5d')]===_0x7997('0x5b')){var _0x367c87=_0x120385[_0x7997('0x2e')]({'plain':!![]});return db['UserProfileSection'][_0x7997('0x4e')]({'where':{'name':_0x7997('0x2f'),'userProfileId':_0x5c2c5e['userProfileId']},'raw':!![]})['then'](function(_0x52cd57){if(_0x52cd57&&_0x52cd57['autoAssociation']===0x0){return db[_0x7997('0x5e')][_0x7997('0x4f')]({'name':_0x367c87[_0x7997('0x31')],'resourceId':_0x367c87['id'],'type':_0x52cd57[_0x7997('0x31')],'sectionId':_0x52cd57['id']},{})['then'](function(){return _0x120385;});}else{return _0x120385;}})[_0x7997('0x22')](function(_0x39814e){logger[_0x7997('0x1f')](_0x7997('0x5f'),_0x39814e);throw _0x39814e;});}return _0x120385;})[_0x7997('0x2c')](respondWithResult(_0x1413a6,0xc9))[_0x7997('0x22')](handleError(_0x1413a6,null));};exports[_0x7997('0x2b')]=function(_0x2c1cd8,_0xdeff3d,_0x2cd98a){var _0x5bf14b;return db['VoiceContext'][_0x7997('0x4e')]({'where':{'id':_0x2c1cd8[_0x7997('0x4c')]['id']}})[_0x7997('0x2c')](handleEntityNotFound(_0xdeff3d,null))[_0x7997('0x2c')](saveUpdates(_0x2c1cd8['body'],null))[_0x7997('0x2c')](function(_0x3bb476){if(_0x3bb476){_0x5bf14b=_0x3bb476;return db[_0x7997('0x34')]['findAll']({'raw':!![]});}})[_0x7997('0x2c')](function(_0x40ec4b){var _0x3f469a=fs['readFileSync'](path[_0x7997('0x53')](config[_0x7997('0x54')],_0x7997('0x55')),_0x7997('0x56'));var _0x2a08a5=ejs[_0x7997('0x57')](_0x3f469a,{'contexts':_0x40ec4b||[]});fs[_0x7997('0x58')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x2a08a5);})[_0x7997('0x2c')](function(){return respondWithRpcPromise(_0x7997('0x5a'),_0x7997('0x2b'),{'module':_0x7997('0x60')});})[_0x7997('0x2c')](function(){return _0x5bf14b;})[_0x7997('0x2c')](respondWithResult(_0xdeff3d,null))['catch'](handleError(_0xdeff3d,null));};exports[_0x7997('0x2d')]=function(_0x33379e,_0x5e9cda,_0x12721f){var _0x34cd1e;return db[_0x7997('0x34')]['find']({'where':{'id':_0x33379e[_0x7997('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5e9cda,null))[_0x7997('0x2c')](removeEntity(_0x5e9cda,null))[_0x7997('0x2c')](function(){return db[_0x7997('0x34')][_0x7997('0x51')]({'raw':!![]});})['then'](function(_0x18e936){var _0x20b5f2=fs[_0x7997('0x52')](path[_0x7997('0x53')](config['root'],_0x7997('0x55')),'utf8');var _0x5bf48d=ejs[_0x7997('0x57')](_0x20b5f2,{'contexts':_0x18e936});fs['writeFileSync'](_0x7997('0x59'),_0x5bf48d);return respondWithRpcPromise(_0x7997('0x5a'),'destroy',{'module':'chan_sip.so'});})[_0x7997('0x22')](handleError(_0x5e9cda,null));};
\ No newline at end of file
+var _0x21ab=['merge','options','include','rows','catch','params','rawAttributes','fields','length','find','create','body','findAll','readFileSync','join','root','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','utf8','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/util','jayson/promise','client','then','info','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceContext,\x20%s,\x20%s','result','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','destroy','Contexts','UserProfileResource','stack','name','send','index','map','VoiceContext','fieldName','type','key','query','keys','filters','intersection','model','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x1982bd,_0x39fcc3){var _0x11063e=function(_0x1bee37){while(--_0x1bee37){_0x1982bd['push'](_0x1982bd['shift']());}};_0x11063e(++_0x39fcc3);}(_0x21ab,0xe7));var _0xb21a=function(_0x3233c3,_0x15e5fa){_0x3233c3=_0x3233c3-0x0;var _0x36029b=_0x21ab[_0x3233c3];return _0x36029b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb21a('0x0'));var zipdir=require(_0xb21a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb21a('0x2'));var moment=require(_0xb21a('0x3'));var BPromise=require(_0xb21a('0x4'));var Mustache=require(_0xb21a('0x5'));var util=require(_0xb21a('0x6'));var path=require(_0xb21a('0x7'));var sox=require(_0xb21a('0x8'));var csv=require(_0xb21a('0x9'));var ejs=require(_0xb21a('0xa'));var fs=require('fs');var fs_extra=require(_0xb21a('0xb'));var _=require('lodash');var squel=require(_0xb21a('0xc'));var crypto=require(_0xb21a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb21a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb21a('0xf'));var Papa=require(_0xb21a('0x10'));var Redis=require(_0xb21a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb21a('0x12'));var as=require(_0xb21a('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(_0xb21a('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0xb21a('0x15'));var client=jayson[_0xb21a('0x16')]['http']({'port':0x232a});function respondWithRpcPromise(_0x563686,_0x55db50,_0x1b59ff,_0x438685){return new BPromise(function(_0x4bbd85,_0x380dc1){var _0x547efc=_0x438685||client;return _0x547efc['request'](_0x563686,_0x1b59ff)[_0xb21a('0x17')](function(_0x36358f){logger[_0xb21a('0x18')]('VoiceContext,\x20%s,\x20%s',_0x55db50,_0xb21a('0x19'));logger['debug'](_0xb21a('0x1a'),_0x55db50,'request\x20sent',JSON[_0xb21a('0x1b')](_0x36358f));if(_0x36358f['error']){if(_0x36358f[_0xb21a('0x1c')][_0xb21a('0x1d')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x55db50,_0x36358f[_0xb21a('0x1c')][_0xb21a('0x1e')]);return _0x380dc1(_0x36358f[_0xb21a('0x1c')][_0xb21a('0x1e')]);}logger['error'](_0xb21a('0x1f'),_0x55db50,_0x36358f[_0xb21a('0x1c')][_0xb21a('0x1e')]);return _0x4bbd85(_0x36358f[_0xb21a('0x1c')][_0xb21a('0x1e')]);}else{logger[_0xb21a('0x18')](_0xb21a('0x1f'),_0x55db50,_0xb21a('0x19'));_0x4bbd85(_0x36358f[_0xb21a('0x20')][_0xb21a('0x1e')]);}})['catch'](function(_0x55dd96){logger[_0xb21a('0x1c')](_0xb21a('0x1f'),_0x55db50,_0x55dd96);_0x380dc1(_0x55dd96);});});}function respondWithStatusCode(_0x840690,_0x1dd3c2){_0x1dd3c2=_0x1dd3c2||0xcc;return function(_0x4ac492){if(_0x4ac492){return _0x840690[_0xb21a('0x21')](_0x1dd3c2);}return _0x840690[_0xb21a('0x22')](_0x1dd3c2)[_0xb21a('0x23')]();};}function respondWithResult(_0x54f993,_0x3ee1c6){_0x3ee1c6=_0x3ee1c6||0xc8;return function(_0x5e2604){if(_0x5e2604){return _0x54f993[_0xb21a('0x22')](_0x3ee1c6)[_0xb21a('0x24')](_0x5e2604);}};}function respondWithFilteredResult(_0x2607d9,_0x373d5a){return function(_0x3e68d3){if(_0x3e68d3){var _0xfcf942=typeof _0x373d5a[_0xb21a('0x25')]===_0xb21a('0x26')&&typeof _0x373d5a[_0xb21a('0x27')]===_0xb21a('0x26');var _0x9158e=_0x3e68d3[_0xb21a('0x28')];var _0x46f917=_0xfcf942?0x0:_0x373d5a[_0xb21a('0x25')];var _0x2ff627=_0xfcf942?_0x3e68d3[_0xb21a('0x28')]:_0x373d5a[_0xb21a('0x25')]+_0x373d5a[_0xb21a('0x27')];var _0x5ad82f;if(_0x2ff627>=_0x9158e){_0x2ff627=_0x9158e;_0x5ad82f=0xc8;}else{_0x5ad82f=0xce;}_0x2607d9['status'](_0x5ad82f);return _0x2607d9[_0xb21a('0x29')]('Content-Range',_0x46f917+'-'+_0x2ff627+'/'+_0x9158e)[_0xb21a('0x24')](_0x3e68d3);}return null;};}function patchUpdates(_0x75ad66){return function(_0x560c54){try{jsonpatch[_0xb21a('0x2a')](_0x560c54,_0x75ad66,!![]);}catch(_0x15b92c){return BPromise['reject'](_0x15b92c);}return _0x560c54['save']();};}function saveUpdates(_0x1a8a03,_0x1f3641){return function(_0x2528a8){if(_0x2528a8){return _0x2528a8[_0xb21a('0x2b')](_0x1a8a03)['then'](function(_0x1efe38){return _0x1efe38;});}return null;};}function removeEntity(_0x1208da,_0x3931a5){return function(_0x5877f0){if(_0x5877f0){return _0x5877f0[_0xb21a('0x2c')]()['then'](function(){var _0x348f25=_0x5877f0['get']({'plain':!![]});var _0x535770=_0xb21a('0x2d');return db[_0xb21a('0x2e')][_0xb21a('0x2c')]({'where':{'type':_0x535770,'resourceId':_0x348f25['id']}})['then'](function(){return _0x5877f0;});})[_0xb21a('0x17')](function(){_0x1208da['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x19f06e,_0x4b4694){return function(_0x5929f8){if(!_0x5929f8){_0x19f06e[_0xb21a('0x21')](0x194);}return _0x5929f8;};}function handleError(_0x2f8e4c,_0x301991){_0x301991=_0x301991||0x1f4;return function(_0x88d0bd){logger[_0xb21a('0x1c')](_0x88d0bd[_0xb21a('0x2f')]);if(_0x88d0bd['name']){delete _0x88d0bd[_0xb21a('0x30')];}_0x2f8e4c['status'](_0x301991)[_0xb21a('0x31')](_0x88d0bd);};}exports[_0xb21a('0x32')]=function(_0x477f9a,_0x9f2fdd){var _0x4cd12d={},_0x394baf={},_0x3f5d8e={'count':0x0,'rows':[]};var _0x1c113b=_[_0xb21a('0x33')](db[_0xb21a('0x34')]['rawAttributes'],function(_0x3fa8de){return{'name':_0x3fa8de[_0xb21a('0x35')],'type':_0x3fa8de[_0xb21a('0x36')][_0xb21a('0x37')]};});_0x394baf['model']=_[_0xb21a('0x33')](_0x1c113b,_0xb21a('0x30'));_0x394baf[_0xb21a('0x38')]=_[_0xb21a('0x39')](_0x477f9a[_0xb21a('0x38')]);_0x394baf[_0xb21a('0x3a')]=_[_0xb21a('0x3b')](_0x394baf[_0xb21a('0x3c')],_0x394baf[_0xb21a('0x38')]);_0x4cd12d[_0xb21a('0x3d')]=_[_0xb21a('0x3b')](_0x394baf[_0xb21a('0x3c')],qs['fields'](_0x477f9a['query']['fields']));_0x4cd12d['attributes']=_0x4cd12d[_0xb21a('0x3d')]['length']?_0x4cd12d[_0xb21a('0x3d')]:_0x394baf[_0xb21a('0x3c')];if(!_0x477f9a[_0xb21a('0x38')][_0xb21a('0x3e')](_0xb21a('0x3f'))){_0x4cd12d['limit']=qs['limit'](_0x477f9a['query'][_0xb21a('0x27')]);_0x4cd12d['offset']=qs['offset'](_0x477f9a[_0xb21a('0x38')]['offset']);}_0x4cd12d[_0xb21a('0x40')]=qs['sort'](_0x477f9a[_0xb21a('0x38')][_0xb21a('0x41')]);_0x4cd12d[_0xb21a('0x42')]=qs['filters'](_[_0xb21a('0x43')](_0x477f9a['query'],_0x394baf[_0xb21a('0x3a')]),_0x1c113b);if(_0x477f9a[_0xb21a('0x38')][_0xb21a('0x44')]){_0x4cd12d[_0xb21a('0x42')]=_[_0xb21a('0x45')](_0x4cd12d[_0xb21a('0x42')],{'$or':_[_0xb21a('0x33')](_0x1c113b,function(_0x440698){if(_0x440698[_0xb21a('0x36')]!=='VIRTUAL'){var _0x3ff91a={};_0x3ff91a[_0x440698['name']]={'$like':'%'+_0x477f9a[_0xb21a('0x38')][_0xb21a('0x44')]+'%'};return _0x3ff91a;}})});}_0x4cd12d=_[_0xb21a('0x45')]({},_0x4cd12d,_0x477f9a[_0xb21a('0x46')]);var _0x5ec1d9={'where':_0x4cd12d[_0xb21a('0x42')]};return db[_0xb21a('0x34')][_0xb21a('0x28')](_0x5ec1d9)[_0xb21a('0x17')](function(_0x4e5cbe){_0x3f5d8e[_0xb21a('0x28')]=_0x4e5cbe;if(_0x477f9a[_0xb21a('0x38')]['includeAll']){_0x4cd12d[_0xb21a('0x47')]=[{'all':!![]}];}return db[_0xb21a('0x34')]['findAll'](_0x4cd12d);})['then'](function(_0x115d67){_0x3f5d8e[_0xb21a('0x48')]=_0x115d67;return _0x3f5d8e;})['then'](respondWithFilteredResult(_0x9f2fdd,_0x4cd12d))[_0xb21a('0x49')](handleError(_0x9f2fdd,null));};exports['show']=function(_0x1d8e2d,_0x49699d){var _0x17820e={'raw':![],'where':{'id':_0x1d8e2d[_0xb21a('0x4a')]['id']}},_0x38d9fb={};_0x38d9fb['model']=_['keys'](db[_0xb21a('0x34')][_0xb21a('0x4b')]);_0x38d9fb[_0xb21a('0x38')]=_[_0xb21a('0x39')](_0x1d8e2d[_0xb21a('0x38')]);_0x38d9fb[_0xb21a('0x3a')]=_[_0xb21a('0x3b')](_0x38d9fb[_0xb21a('0x3c')],_0x38d9fb[_0xb21a('0x38')]);_0x17820e[_0xb21a('0x3d')]=_[_0xb21a('0x3b')](_0x38d9fb[_0xb21a('0x3c')],qs[_0xb21a('0x4c')](_0x1d8e2d[_0xb21a('0x38')][_0xb21a('0x4c')]));_0x17820e[_0xb21a('0x3d')]=_0x17820e['attributes'][_0xb21a('0x4d')]?_0x17820e[_0xb21a('0x3d')]:_0x38d9fb[_0xb21a('0x3c')];if(_0x1d8e2d[_0xb21a('0x38')]['includeAll']){_0x17820e['include']=[{'all':!![]}];}_0x17820e=_[_0xb21a('0x45')]({},_0x17820e,_0x1d8e2d[_0xb21a('0x46')]);return db[_0xb21a('0x34')][_0xb21a('0x4e')](_0x17820e)[_0xb21a('0x17')](handleEntityNotFound(_0x49699d,null))['then'](respondWithResult(_0x49699d,null))[_0xb21a('0x49')](handleError(_0x49699d,null));};exports[_0xb21a('0x4f')]=function(_0x32483c,_0x3adb9d,_0x1e9f0e){var _0x391e5c;return db[_0xb21a('0x34')][_0xb21a('0x4f')](_0x32483c[_0xb21a('0x50')],{'raw':!![]})[_0xb21a('0x17')](function(_0x2b8767){_0x391e5c=_0x2b8767;return db[_0xb21a('0x34')][_0xb21a('0x51')]({'raw':!![]});})[_0xb21a('0x17')](function(_0x48d829){var _0x47c886=fs[_0xb21a('0x52')](path[_0xb21a('0x53')](config[_0xb21a('0x54')],_0xb21a('0x55')),'utf8');var _0x43dd54=ejs[_0xb21a('0x56')](_0x47c886,{'contexts':_0x48d829||[]});fs[_0xb21a('0x57')](_0xb21a('0x58'),_0x43dd54);})[_0xb21a('0x17')](function(){return respondWithRpcPromise(_0xb21a('0x59'),_0xb21a('0x4f'),{'module':_0xb21a('0x5a')});})[_0xb21a('0x17')](function(){var _0x4d76ab=_0x32483c[_0xb21a('0x5b')][_0xb21a('0x5c')]({'plain':!![]});if(!_0x4d76ab)throw new Error(_0xb21a('0x5d'));if(_0x4d76ab[_0xb21a('0x5e')]===_0xb21a('0x5b')){var _0x1f6d0d=_0x391e5c[_0xb21a('0x5c')]({'plain':!![]});return db[_0xb21a('0x5f')][_0xb21a('0x4e')]({'where':{'name':'Contexts','userProfileId':_0x4d76ab[_0xb21a('0x60')]},'raw':!![]})[_0xb21a('0x17')](function(_0x1de30f){if(_0x1de30f&&_0x1de30f[_0xb21a('0x61')]===0x0){return db[_0xb21a('0x2e')][_0xb21a('0x4f')]({'name':_0x1f6d0d[_0xb21a('0x30')],'resourceId':_0x1f6d0d['id'],'type':_0x1de30f['name'],'sectionId':_0x1de30f['id']},{})[_0xb21a('0x17')](function(){return _0x391e5c;});}else{return _0x391e5c;}})[_0xb21a('0x49')](function(_0x9fa7f9){logger[_0xb21a('0x1c')](_0xb21a('0x62'),_0x9fa7f9);throw _0x9fa7f9;});}return _0x391e5c;})[_0xb21a('0x17')](respondWithResult(_0x3adb9d,0xc9))[_0xb21a('0x49')](handleError(_0x3adb9d,null));};exports['update']=function(_0x5858ea,_0x413740,_0x2053ac){var _0x32b8d0;return db[_0xb21a('0x34')][_0xb21a('0x4e')]({'where':{'id':_0x5858ea['params']['id']}})['then'](handleEntityNotFound(_0x413740,null))[_0xb21a('0x17')](saveUpdates(_0x5858ea['body'],null))['then'](function(_0x32dddb){if(_0x32dddb){_0x32b8d0=_0x32dddb;return db['VoiceContext'][_0xb21a('0x51')]({'raw':!![]});}})[_0xb21a('0x17')](function(_0xf8c4fb){var _0x419f0b=fs[_0xb21a('0x52')](path[_0xb21a('0x53')](config[_0xb21a('0x54')],_0xb21a('0x55')),_0xb21a('0x63'));var _0x38f42f=ejs['render'](_0x419f0b,{'contexts':_0xf8c4fb||[]});fs[_0xb21a('0x57')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x38f42f);})[_0xb21a('0x17')](function(){return respondWithRpcPromise(_0xb21a('0x59'),_0xb21a('0x2b'),{'module':_0xb21a('0x5a')});})['then'](function(){return _0x32b8d0;})[_0xb21a('0x17')](respondWithResult(_0x413740,null))[_0xb21a('0x49')](handleError(_0x413740,null));};exports[_0xb21a('0x2c')]=function(_0x387348,_0x40ba89,_0x40847f){var _0x5d3c2c;return db[_0xb21a('0x34')][_0xb21a('0x4e')]({'where':{'id':_0x387348[_0xb21a('0x4a')]['id']}})[_0xb21a('0x17')](handleEntityNotFound(_0x40ba89,null))[_0xb21a('0x17')](removeEntity(_0x40ba89,null))[_0xb21a('0x17')](function(){return db[_0xb21a('0x34')][_0xb21a('0x51')]({'raw':!![]});})['then'](function(_0x316fa3){var _0x10d532=fs[_0xb21a('0x52')](path['join'](config[_0xb21a('0x54')],_0xb21a('0x55')),_0xb21a('0x63'));var _0x3c9e0e=ejs['render'](_0x10d532,{'contexts':_0x316fa3});fs[_0xb21a('0x57')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3c9e0e);return respondWithRpcPromise(_0xb21a('0x59'),_0xb21a('0x2c'),{'module':_0xb21a('0x5a')});})[_0xb21a('0x49')](handleError(_0x40ba89,null));};
\ No newline at end of file
index dbb99f5..77838c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5ab=['rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x557c70,_0x4f4476){var _0x1a8065=function(_0x50df07){while(--_0x50df07){_0x557c70['push'](_0x557c70['shift']());}};_0x1a8065(++_0x4f4476);}(_0xa5ab,0xca));var _0xba5a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5ab[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xba5a('0x0'));var util=require(_0xba5a('0x1'));var logger=require(_0xba5a('0x2'))('api');var moment=require(_0xba5a('0x3'));var BPromise=require('bluebird');var rp=require(_0xba5a('0x4'));var fs=require('fs');var path=require(_0xba5a('0x5'));var rimraf=require(_0xba5a('0x6'));var config=require(_0xba5a('0x7'));var attributes=require(_0xba5a('0x8'));module[_0xba5a('0x9')]=function(_0x4ffeea,_0x22c2b7){return _0x4ffeea[_0xba5a('0xa')](_0xba5a('0xb'),attributes,{'tableName':_0xba5a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc65a=['bluebird','request-promise','rimraf','../../config/environment','exports','define','voice_contexts','lodash','../../config/logger'];(function(_0x3ee2ce,_0x2f082a){var _0x256ba0=function(_0x45a7e1){while(--_0x45a7e1){_0x3ee2ce['push'](_0x3ee2ce['shift']());}};_0x256ba0(++_0x2f082a);}(_0xc65a,0xfa));var _0xac65=function(_0x1b72fd,_0x40e973){_0x1b72fd=_0x1b72fd-0x0;var _0xa079e9=_0xc65a[_0x1b72fd];return _0xa079e9;};'use strict';var _=require(_0xac65('0x0'));var util=require('util');var logger=require(_0xac65('0x1'))('api');var moment=require('moment');var BPromise=require(_0xac65('0x2'));var rp=require(_0xac65('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xac65('0x4'));var config=require(_0xac65('0x5'));var attributes=require('./voiceContext.attributes');module[_0xac65('0x6')]=function(_0x201045,_0x20a2f1){return _0x201045[_0xac65('0x7')]('VoiceContext',attributes,{'tableName':_0xac65('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a2cc339..d6f492d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84cd=['code','VoiceContext,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x53b95f,_0x5b837e){var _0x599963=function(_0x512073){while(--_0x512073){_0x53b95f['push'](_0x53b95f['shift']());}};_0x599963(++_0x5b837e);}(_0x84cd,0x1e0));var _0xd84c=function(_0x3d8fc2,_0x8c78dc){_0x3d8fc2=_0x3d8fc2-0x0;var _0x5087e5=_0x84cd[_0x3d8fc2];return _0x5087e5;};'use strict';var _=require('lodash');var util=require(_0xd84c('0x0'));var moment=require(_0xd84c('0x1'));var BPromise=require(_0xd84c('0x2'));var rs=require(_0xd84c('0x3'));var fs=require('fs');var Redis=require(_0xd84c('0x4'));var db=require(_0xd84c('0x5'))['db'];var utils=require(_0xd84c('0x6'));var logger=require(_0xd84c('0x7'))(_0xd84c('0x8'));var config=require(_0xd84c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd84c('0xa')][_0xd84c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x352620,_0x357e6f,_0x5604f0){return new BPromise(function(_0x4b72b3,_0x378f2f){return client[_0xd84c('0xc')](_0x352620,_0x5604f0)[_0xd84c('0xd')](function(_0x2cd09c){logger[_0xd84c('0xe')]('VoiceContext,\x20%s,\x20%s',_0x357e6f,_0xd84c('0xf'));logger[_0xd84c('0x10')](_0xd84c('0x11'),_0x357e6f,_0xd84c('0xf'),JSON[_0xd84c('0x12')](_0x2cd09c));if(_0x2cd09c[_0xd84c('0x13')]){if(_0x2cd09c['error'][_0xd84c('0x14')]===0x1f4){logger[_0xd84c('0x13')](_0xd84c('0x15'),_0x357e6f,_0x2cd09c[_0xd84c('0x13')][_0xd84c('0x16')]);return _0x378f2f(_0x2cd09c[_0xd84c('0x13')]['message']);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x357e6f,_0x2cd09c[_0xd84c('0x13')][_0xd84c('0x16')]);return _0x4b72b3(_0x2cd09c[_0xd84c('0x13')][_0xd84c('0x16')]);}else{logger['info'](_0xd84c('0x15'),_0x357e6f,_0xd84c('0xf'));_0x4b72b3(_0x2cd09c[_0xd84c('0x17')][_0xd84c('0x16')]);}})[_0xd84c('0x18')](function(_0x235360){logger['error'](_0xd84c('0x15'),_0x357e6f,_0x235360);_0x378f2f(_0x235360);});});}
\ No newline at end of file
+var _0xc4dd=['stringify','error','message','request\x20sent','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s'];(function(_0x2ff658,_0x1b8af2){var _0xc6b01d=function(_0x30c9d7){while(--_0x30c9d7){_0x2ff658['push'](_0x2ff658['shift']());}};_0xc6b01d(++_0x1b8af2);}(_0xc4dd,0xad));var _0xdc4d=function(_0x527ffb,_0x4c7fd4){_0x527ffb=_0x527ffb-0x0;var _0x525ed8=_0xc4dd[_0x527ffb];return _0x525ed8;};'use strict';var _=require(_0xdc4d('0x0'));var util=require(_0xdc4d('0x1'));var moment=require(_0xdc4d('0x2'));var BPromise=require('bluebird');var rs=require(_0xdc4d('0x3'));var fs=require('fs');var Redis=require(_0xdc4d('0x4'));var db=require(_0xdc4d('0x5'))['db'];var utils=require(_0xdc4d('0x6'));var logger=require(_0xdc4d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xdc4d('0x8'));var client=jayson[_0xdc4d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c4ce7,_0x2a2a14,_0x566564){return new BPromise(function(_0x1c2e51,_0x1db67d){return client[_0xdc4d('0xa')](_0x3c4ce7,_0x566564)[_0xdc4d('0xb')](function(_0x1f3a6d){logger[_0xdc4d('0xc')](_0xdc4d('0xd'),_0x2a2a14,'request\x20sent');logger[_0xdc4d('0xe')](_0xdc4d('0xf'),_0x2a2a14,'request\x20sent',JSON[_0xdc4d('0x10')](_0x1f3a6d));if(_0x1f3a6d['error']){if(_0x1f3a6d[_0xdc4d('0x11')]['code']===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x2a2a14,_0x1f3a6d[_0xdc4d('0x11')][_0xdc4d('0x12')]);return _0x1db67d(_0x1f3a6d[_0xdc4d('0x11')]['message']);}logger[_0xdc4d('0x11')](_0xdc4d('0xd'),_0x2a2a14,_0x1f3a6d[_0xdc4d('0x11')]['message']);return _0x1c2e51(_0x1f3a6d[_0xdc4d('0x11')]['message']);}else{logger['info'](_0xdc4d('0xd'),_0x2a2a14,_0xdc4d('0x13'));_0x1c2e51(_0x1f3a6d[_0xdc4d('0x14')][_0xdc4d('0x12')]);}})['catch'](function(_0x7b1093){logger[_0xdc4d('0x11')](_0xdc4d('0xd'),_0x2a2a14,_0x7b1093);_0x1db67d(_0x7b1093);});});}
\ No newline at end of file
index a514232..3f20eee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc52f=['fs-extra','../../components/auth/service','./voiceDialReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','Router'];(function(_0x4f0593,_0x2eb282){var _0x5f4cb7=function(_0x6f4305){while(--_0x6f4305){_0x4f0593['push'](_0x4f0593['shift']());}};_0x5f4cb7(++_0x2eb282);}(_0xc52f,0x1e3));var _0xfc52=function(_0x5dca90,_0x3da4c8){_0x5dca90=_0x5dca90-0x0;var _0x32001c=_0xc52f[_0x5dca90];return _0x32001c;};'use strict';var multer=require(_0xfc52('0x0'));var util=require(_0xfc52('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfc52('0x2')]();var fs_extra=require(_0xfc52('0x3'));var auth=require(_0xfc52('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfc52('0x5'));router[_0xfc52('0x6')]('/',auth[_0xfc52('0x7')](),controller['index']);router[_0xfc52('0x6')](_0xfc52('0x8'),auth[_0xfc52('0x7')](),controller[_0xfc52('0x9')]);router[_0xfc52('0x6')](_0xfc52('0xa'),auth[_0xfc52('0x7')](),controller[_0xfc52('0xb')]);router[_0xfc52('0xc')]('/',auth[_0xfc52('0x7')](),controller[_0xfc52('0xd')]);router[_0xfc52('0xe')]('/:id',auth[_0xfc52('0x7')](),controller['update']);router[_0xfc52('0xf')](_0xfc52('0xa'),auth[_0xfc52('0x7')](),controller[_0xfc52('0x10')]);module[_0xfc52('0x11')]=router;
\ No newline at end of file
+var _0xa132=['express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','exports','multer','path'];(function(_0x3929a1,_0x296f9f){var _0x4470b1=function(_0xbdb506){while(--_0xbdb506){_0x3929a1['push'](_0x3929a1['shift']());}};_0x4470b1(++_0x296f9f);}(_0xa132,0x196));var _0x2a13=function(_0x1321c3,_0x894f75){_0x1321c3=_0x1321c3-0x0;var _0xabbb82=_0xa132[_0x1321c3];return _0xabbb82;};'use strict';var multer=require(_0x2a13('0x0'));var util=require('util');var path=require(_0x2a13('0x1'));var timeout=require('connect-timeout');var express=require(_0x2a13('0x2'));var router=express[_0x2a13('0x3')]();var fs_extra=require(_0x2a13('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2a13('0x5'));var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router[_0x2a13('0x6')]('/',auth[_0x2a13('0x7')](),controller['index']);router[_0x2a13('0x6')](_0x2a13('0x8'),auth['isAuthenticated'](),controller[_0x2a13('0x9')]);router[_0x2a13('0x6')](_0x2a13('0xa'),auth[_0x2a13('0x7')](),controller[_0x2a13('0xb')]);router['post']('/',auth[_0x2a13('0x7')](),controller[_0x2a13('0xc')]);router[_0x2a13('0xd')](_0x2a13('0xa'),auth['isAuthenticated'](),controller[_0x2a13('0xe')]);router[_0x2a13('0xf')](_0x2a13('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x2a13('0x10')]=router;
\ No newline at end of file
index b4d39ef..4865f53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6aa7=['called,connect,complete','sequelize','STRING','INTEGER','DATE'];(function(_0x34c999,_0x2ece80){var _0x2197e2=function(_0x2615d5){while(--_0x2615d5){_0x34c999['push'](_0x34c999['shift']());}};_0x2197e2(++_0x2ece80);}(_0x6aa7,0x178));var _0x76aa=function(_0x5c2bee,_0x3ba2b0){_0x5c2bee=_0x5c2bee-0x0;var _0x315056=_0x6aa7[_0x5c2bee];return _0x315056;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x76aa('0x1')]},'channel':{'type':Sequelize[_0x76aa('0x1')]},'channelstate':{'type':Sequelize[_0x76aa('0x2')]},'channelstatedesc':{'type':Sequelize[_0x76aa('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x76aa('0x1')]},'connectedlinenum':{'type':Sequelize[_0x76aa('0x1')]},'connectedlinename':{'type':Sequelize[_0x76aa('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x76aa('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x76aa('0x2')]},'uniqueid':{'type':Sequelize[_0x76aa('0x1')]},'linkedid':{'type':Sequelize[_0x76aa('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x76aa('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x76aa('0x1')]},'destcalleridnum':{'type':Sequelize[_0x76aa('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x76aa('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x76aa('0x1')]},'destlanguage':{'type':Sequelize[_0x76aa('0x1')]},'destaccountcode':{'type':Sequelize[_0x76aa('0x1')]},'destcontext':{'type':Sequelize[_0x76aa('0x1')]},'destexten':{'type':Sequelize[_0x76aa('0x1')]},'destpriority':{'type':Sequelize[_0x76aa('0x2')]},'destuniqueid':{'type':Sequelize[_0x76aa('0x1')]},'destlinkedid':{'type':Sequelize[_0x76aa('0x1')]},'dialstring':{'type':Sequelize[_0x76aa('0x1')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x76aa('0x3')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x76aa('0x3')]},'lastevent':{'type':Sequelize[_0x76aa('0x1')],'comment':_0x76aa('0x4')},'routeId':{'type':Sequelize[_0x76aa('0x2')]},'duration':{'type':Sequelize[_0x76aa('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x55ca=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x40af2a,_0x2dc215){var _0x421afb=function(_0x4c67e7){while(--_0x4c67e7){_0x40af2a['push'](_0x40af2a['shift']());}};_0x421afb(++_0x2dc215);}(_0x55ca,0x126));var _0xa55c=function(_0x4a0801,_0x55b298){_0x4a0801=_0x4a0801-0x0;var _0x47306d=_0x55ca[_0x4a0801];return _0x47306d;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'calleridnum':{'type':Sequelize[_0xa55c('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xa55c('0x2')]},'connectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'language':{'type':Sequelize[_0xa55c('0x2')]},'accountcode':{'type':Sequelize[_0xa55c('0x2')]},'context':{'type':Sequelize[_0xa55c('0x2')]},'exten':{'type':Sequelize[_0xa55c('0x2')]},'priority':{'type':Sequelize[_0xa55c('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xa55c('0x2')]},'destchannel':{'type':Sequelize[_0xa55c('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridnum':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'destlanguage':{'type':Sequelize[_0xa55c('0x2')]},'destaccountcode':{'type':Sequelize[_0xa55c('0x2')]},'destcontext':{'type':Sequelize[_0xa55c('0x2')]},'destexten':{'type':Sequelize[_0xa55c('0x2')]},'destpriority':{'type':Sequelize[_0xa55c('0x3')]},'destuniqueid':{'type':Sequelize[_0xa55c('0x2')]},'destlinkedid':{'type':Sequelize[_0xa55c('0x2')]},'dialstring':{'type':Sequelize[_0xa55c('0x2')]},'dialstatus':{'type':Sequelize[_0xa55c('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xa55c('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0xa55c('0x3')]},'holdtime':{'type':Sequelize[_0xa55c('0x3')]},'billableseconds':{'type':Sequelize[_0xa55c('0x3')]}};
\ No newline at end of file
index 7402d24..8a8fca7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa71c=['ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','end','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv'];(function(_0x40ffbd,_0x13cef6){var _0x45cb9c=function(_0x70ab6e){while(--_0x70ab6e){_0x40ffbd['push'](_0x40ffbd['shift']());}};_0x45cb9c(++_0x13cef6);}(_0xa71c,0x1b8));var _0xca71=function(_0x33496e,_0x26659b){_0x33496e=_0x33496e-0x0;var _0x1976ad=_0xa71c[_0x33496e];return _0x1976ad;};'use strict';var emlformat=require(_0xca71('0x0'));var rimraf=require(_0xca71('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xca71('0x2'));var rp=require(_0xca71('0x3'));var moment=require(_0xca71('0x4'));var BPromise=require(_0xca71('0x5'));var Mustache=require(_0xca71('0x6'));var util=require(_0xca71('0x7'));var path=require('path');var sox=require(_0xca71('0x8'));var csv=require(_0xca71('0x9'));var ejs=require(_0xca71('0xa'));var fs=require('fs');var fs_extra=require(_0xca71('0xb'));var _=require(_0xca71('0xc'));var squel=require(_0xca71('0xd'));var crypto=require(_0xca71('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xca71('0xf'));var toCsv=require(_0xca71('0x9'));var querystring=require(_0xca71('0x10'));var Papa=require('papaparse');var Redis=require(_0xca71('0x11'));var authService=require(_0xca71('0x12'));var qs=require(_0xca71('0x13'));var as=require(_0xca71('0x14'));var hardwareService=require(_0xca71('0x15'));var logger=require('../../config/logger')(_0xca71('0x16'));var utils=require('../../config/utils');var config=require(_0xca71('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xca71('0x18'))['db'];function respondWithStatusCode(_0x21a70f,_0x20ad53){_0x20ad53=_0x20ad53||0xcc;return function(_0x504906){if(_0x504906){return _0x21a70f[_0xca71('0x19')](_0x20ad53);}return _0x21a70f[_0xca71('0x1a')](_0x20ad53)['end']();};}function respondWithResult(_0x4533f4,_0x182e4e){_0x182e4e=_0x182e4e||0xc8;return function(_0x363f73){if(_0x363f73){return _0x4533f4[_0xca71('0x1a')](_0x182e4e)['json'](_0x363f73);}};}function respondWithFilteredResult(_0x32a0e3,_0x67bc62){return function(_0x519a35){if(_0x519a35){var _0x332b56=typeof _0x67bc62[_0xca71('0x1b')]===_0xca71('0x1c')&&typeof _0x67bc62[_0xca71('0x1d')]===_0xca71('0x1c');var _0x12aace=_0x519a35[_0xca71('0x1e')];var _0x266d77=_0x332b56?0x0:_0x67bc62[_0xca71('0x1b')];var _0x5525e4=_0x332b56?_0x519a35[_0xca71('0x1e')]:_0x67bc62[_0xca71('0x1b')]+_0x67bc62[_0xca71('0x1d')];var _0x1007f9;if(_0x5525e4>=_0x12aace){_0x5525e4=_0x12aace;_0x1007f9=0xc8;}else{_0x1007f9=0xce;}_0x32a0e3[_0xca71('0x1a')](_0x1007f9);return _0x32a0e3[_0xca71('0x1f')](_0xca71('0x20'),_0x266d77+'-'+_0x5525e4+'/'+_0x12aace)[_0xca71('0x21')](_0x519a35);}return null;};}function patchUpdates(_0x2dc213){return function(_0x3571c7){try{jsonpatch['apply'](_0x3571c7,_0x2dc213,!![]);}catch(_0x41f8df){return BPromise[_0xca71('0x22')](_0x41f8df);}return _0x3571c7[_0xca71('0x23')]();};}function saveUpdates(_0x55ed91,_0x5487a1){return function(_0x1efa58){if(_0x1efa58){return _0x1efa58['update'](_0x55ed91)[_0xca71('0x24')](function(_0x20b319){return _0x20b319;});}return null;};}function removeEntity(_0x5da968,_0x3225d7){return function(_0x45626f){if(_0x45626f){return _0x45626f[_0xca71('0x25')]()[_0xca71('0x24')](function(){_0x5da968[_0xca71('0x1a')](0xcc)[_0xca71('0x26')]();});}};}function handleEntityNotFound(_0x3d345f,_0x112b19){return function(_0xbe2f30){if(!_0xbe2f30){_0x3d345f[_0xca71('0x19')](0x194);}return _0xbe2f30;};}function handleError(_0x21ef58,_0x45e6b){_0x45e6b=_0x45e6b||0x1f4;return function(_0x4b9f44){logger[_0xca71('0x27')](_0x4b9f44[_0xca71('0x28')]);if(_0x4b9f44[_0xca71('0x29')]){delete _0x4b9f44[_0xca71('0x29')];}_0x21ef58[_0xca71('0x1a')](_0x45e6b)[_0xca71('0x2a')](_0x4b9f44);};}exports[_0xca71('0x2b')]=function(_0x3c2096,_0x453ea8){var _0x2f1a83={},_0x3465e8={},_0x3d6060={'count':0x0,'rows':[]};var _0x1d0aea=_[_0xca71('0x2c')](db[_0xca71('0x2d')][_0xca71('0x2e')],function(_0x4cf40e){return{'name':_0x4cf40e[_0xca71('0x2f')],'type':_0x4cf40e['type'][_0xca71('0x30')]};});_0x3465e8[_0xca71('0x31')]=_['map'](_0x1d0aea,_0xca71('0x29'));_0x3465e8[_0xca71('0x32')]=_[_0xca71('0x33')](_0x3c2096['query']);_0x3465e8[_0xca71('0x34')]=_[_0xca71('0x35')](_0x3465e8[_0xca71('0x31')],_0x3465e8[_0xca71('0x32')]);_0x2f1a83[_0xca71('0x36')]=_[_0xca71('0x35')](_0x3465e8['model'],qs[_0xca71('0x37')](_0x3c2096[_0xca71('0x32')]['fields']));_0x2f1a83[_0xca71('0x36')]=_0x2f1a83[_0xca71('0x36')][_0xca71('0x38')]?_0x2f1a83[_0xca71('0x36')]:_0x3465e8[_0xca71('0x31')];if(!_0x3c2096[_0xca71('0x32')]['hasOwnProperty'](_0xca71('0x39'))){_0x2f1a83[_0xca71('0x1d')]=qs[_0xca71('0x1d')](_0x3c2096[_0xca71('0x32')][_0xca71('0x1d')]);_0x2f1a83['offset']=qs[_0xca71('0x1b')](_0x3c2096[_0xca71('0x32')][_0xca71('0x1b')]);}_0x2f1a83['order']=qs[_0xca71('0x3a')](_0x3c2096[_0xca71('0x32')]['sort']);_0x2f1a83['where']=qs['filters'](_['pick'](_0x3c2096[_0xca71('0x32')],_0x3465e8[_0xca71('0x34')]),_0x1d0aea);if(_0x3c2096[_0xca71('0x32')][_0xca71('0x3b')]){_0x2f1a83[_0xca71('0x3c')]=_[_0xca71('0x3d')](_0x2f1a83[_0xca71('0x3c')],{'$or':_['map'](_0x1d0aea,function(_0x53012d){if(_0x53012d[_0xca71('0x3e')]!==_0xca71('0x3f')){var _0x3b8d5b={};_0x3b8d5b[_0x53012d[_0xca71('0x29')]]={'$like':'%'+_0x3c2096[_0xca71('0x32')][_0xca71('0x3b')]+'%'};return _0x3b8d5b;}})});}_0x2f1a83=_['merge']({},_0x2f1a83,_0x3c2096['options']);var _0x3a9686={'where':_0x2f1a83[_0xca71('0x3c')]};return db[_0xca71('0x2d')][_0xca71('0x1e')](_0x3a9686)[_0xca71('0x24')](function(_0x46a03f){_0x3d6060[_0xca71('0x1e')]=_0x46a03f;if(_0x3c2096[_0xca71('0x32')][_0xca71('0x40')]){_0x2f1a83[_0xca71('0x41')]=[{'all':!![]}];}return db['VoiceDialReport'][_0xca71('0x42')](_0x2f1a83);})[_0xca71('0x24')](function(_0x1fa686){_0x3d6060[_0xca71('0x43')]=_0x1fa686;return _0x3d6060;})['then'](respondWithFilteredResult(_0x453ea8,_0x2f1a83))[_0xca71('0x44')](handleError(_0x453ea8,null));};exports[_0xca71('0x45')]=function(_0x107f39,_0x2cdf0e){var _0x54e1ba={'raw':!![],'where':{'id':_0x107f39[_0xca71('0x46')]['id']}},_0x2758ea={};_0x2758ea['model']=_[_0xca71('0x33')](db[_0xca71('0x2d')][_0xca71('0x2e')]);_0x2758ea[_0xca71('0x32')]=_['keys'](_0x107f39[_0xca71('0x32')]);_0x2758ea[_0xca71('0x34')]=_['intersection'](_0x2758ea[_0xca71('0x31')],_0x2758ea[_0xca71('0x32')]);_0x54e1ba[_0xca71('0x36')]=_[_0xca71('0x35')](_0x2758ea[_0xca71('0x31')],qs[_0xca71('0x37')](_0x107f39[_0xca71('0x32')]['fields']));_0x54e1ba[_0xca71('0x36')]=_0x54e1ba[_0xca71('0x36')][_0xca71('0x38')]?_0x54e1ba[_0xca71('0x36')]:_0x2758ea[_0xca71('0x31')];if(_0x107f39[_0xca71('0x32')]['includeAll']){_0x54e1ba[_0xca71('0x41')]=[{'all':!![]}];}_0x54e1ba=_[_0xca71('0x3d')]({},_0x54e1ba,_0x107f39['options']);return db['VoiceDialReport'][_0xca71('0x47')](_0x54e1ba)[_0xca71('0x24')](handleEntityNotFound(_0x2cdf0e,null))[_0xca71('0x24')](respondWithResult(_0x2cdf0e,null))[_0xca71('0x44')](handleError(_0x2cdf0e,null));};exports[_0xca71('0x48')]=function(_0x1c8a31,_0x38b927){return db[_0xca71('0x2d')]['create'](_0x1c8a31[_0xca71('0x49')],{})[_0xca71('0x24')](respondWithResult(_0x38b927,0xc9))[_0xca71('0x44')](handleError(_0x38b927,null));};exports['update']=function(_0x44b991,_0x446051){if(_0x44b991[_0xca71('0x49')]['id']){delete _0x44b991[_0xca71('0x49')]['id'];}return db[_0xca71('0x2d')]['find']({'where':{'id':_0x44b991[_0xca71('0x46')]['id']}})['then'](handleEntityNotFound(_0x446051,null))[_0xca71('0x24')](saveUpdates(_0x44b991['body'],null))[_0xca71('0x24')](respondWithResult(_0x446051,null))[_0xca71('0x44')](handleError(_0x446051,null));};exports[_0xca71('0x25')]=function(_0xe436f3,_0x899405){return db[_0xca71('0x2d')][_0xca71('0x47')]({'where':{'id':_0xe436f3['params']['id']}})[_0xca71('0x24')](handleEntityNotFound(_0x899405,null))['then'](removeEntity(_0x899405,null))[_0xca71('0x44')](handleError(_0x899405,null));};exports['describe']=function(_0xac2cb4,_0x31d2d4){return db[_0xca71('0x2d')][_0xca71('0x4a')]()[_0xca71('0x24')](respondWithResult(_0x31d2d4,null))['catch'](handleError(_0x31d2d4,null));};
\ No newline at end of file
+var _0xe8f1=['create','update','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','reject','save','then','destroy','stack','name','send','map','VoiceDialReport','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','length'];(function(_0x38b05e,_0x5e3ff5){var _0x4595d7=function(_0x53450f){while(--_0x53450f){_0x38b05e['push'](_0x38b05e['shift']());}};_0x4595d7(++_0x5e3ff5);}(_0xe8f1,0x166));var _0x1e8f=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0xe8f1[_0x381589];return _0x2a075d;};'use strict';var emlformat=require(_0x1e8f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1e8f('0x1'));var jsonpatch=require(_0x1e8f('0x2'));var rp=require(_0x1e8f('0x3'));var moment=require(_0x1e8f('0x4'));var BPromise=require(_0x1e8f('0x5'));var Mustache=require(_0x1e8f('0x6'));var util=require(_0x1e8f('0x7'));var path=require(_0x1e8f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1e8f('0x9'));var _=require(_0x1e8f('0xa'));var squel=require('squel');var crypto=require(_0x1e8f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1e8f('0xc'));var toCsv=require(_0x1e8f('0xd'));var querystring=require('querystring');var Papa=require(_0x1e8f('0xe'));var Redis=require('ioredis');var authService=require(_0x1e8f('0xf'));var qs=require(_0x1e8f('0x10'));var as=require(_0x1e8f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e8f('0x12'))('api');var utils=require(_0x1e8f('0x13'));var config=require(_0x1e8f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1e8f('0x15'))['db'];function respondWithStatusCode(_0x3a2631,_0x220a97){_0x220a97=_0x220a97||0xcc;return function(_0x569c26){if(_0x569c26){return _0x3a2631[_0x1e8f('0x16')](_0x220a97);}return _0x3a2631[_0x1e8f('0x17')](_0x220a97)[_0x1e8f('0x18')]();};}function respondWithResult(_0xa31226,_0x37608c){_0x37608c=_0x37608c||0xc8;return function(_0x46a9bd){if(_0x46a9bd){return _0xa31226[_0x1e8f('0x17')](_0x37608c)[_0x1e8f('0x19')](_0x46a9bd);}};}function respondWithFilteredResult(_0x3a8107,_0x4ce86f){return function(_0x244d7e){if(_0x244d7e){var _0x5b43fb=typeof _0x4ce86f[_0x1e8f('0x1a')]===_0x1e8f('0x1b')&&typeof _0x4ce86f[_0x1e8f('0x1c')]==='undefined';var _0xae130c=_0x244d7e['count'];var _0x39dc6a=_0x5b43fb?0x0:_0x4ce86f[_0x1e8f('0x1a')];var _0xd90469=_0x5b43fb?_0x244d7e['count']:_0x4ce86f['offset']+_0x4ce86f[_0x1e8f('0x1c')];var _0x3a6b2f;if(_0xd90469>=_0xae130c){_0xd90469=_0xae130c;_0x3a6b2f=0xc8;}else{_0x3a6b2f=0xce;}_0x3a8107[_0x1e8f('0x17')](_0x3a6b2f);return _0x3a8107['set'](_0x1e8f('0x1d'),_0x39dc6a+'-'+_0xd90469+'/'+_0xae130c)[_0x1e8f('0x19')](_0x244d7e);}return null;};}function patchUpdates(_0x1cea84){return function(_0x598879){try{jsonpatch['apply'](_0x598879,_0x1cea84,!![]);}catch(_0x1dd6b1){return BPromise[_0x1e8f('0x1e')](_0x1dd6b1);}return _0x598879[_0x1e8f('0x1f')]();};}function saveUpdates(_0x325b8e,_0x58eb1d){return function(_0x2ca4a8){if(_0x2ca4a8){return _0x2ca4a8['update'](_0x325b8e)[_0x1e8f('0x20')](function(_0x1e905f){return _0x1e905f;});}return null;};}function removeEntity(_0x4b9a9a,_0x5776c4){return function(_0x437daa){if(_0x437daa){return _0x437daa[_0x1e8f('0x21')]()[_0x1e8f('0x20')](function(){_0x4b9a9a[_0x1e8f('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41b52e,_0x2ff53e){return function(_0x599a99){if(!_0x599a99){_0x41b52e[_0x1e8f('0x16')](0x194);}return _0x599a99;};}function handleError(_0x5645eb,_0x5b091b){_0x5b091b=_0x5b091b||0x1f4;return function(_0x40f01a){logger['error'](_0x40f01a[_0x1e8f('0x22')]);if(_0x40f01a[_0x1e8f('0x23')]){delete _0x40f01a[_0x1e8f('0x23')];}_0x5645eb['status'](_0x5b091b)[_0x1e8f('0x24')](_0x40f01a);};}exports['index']=function(_0x207c8a,_0x4ae2df){var _0x46f7cf={},_0x1e3512={},_0x5627dc={'count':0x0,'rows':[]};var _0xf84dba=_[_0x1e8f('0x25')](db[_0x1e8f('0x26')]['rawAttributes'],function(_0xf7dfa7){return{'name':_0xf7dfa7[_0x1e8f('0x27')],'type':_0xf7dfa7[_0x1e8f('0x28')][_0x1e8f('0x29')]};});_0x1e3512[_0x1e8f('0x2a')]=_[_0x1e8f('0x25')](_0xf84dba,_0x1e8f('0x23'));_0x1e3512['query']=_[_0x1e8f('0x2b')](_0x207c8a[_0x1e8f('0x2c')]);_0x1e3512['filters']=_[_0x1e8f('0x2d')](_0x1e3512[_0x1e8f('0x2a')],_0x1e3512['query']);_0x46f7cf[_0x1e8f('0x2e')]=_[_0x1e8f('0x2d')](_0x1e3512[_0x1e8f('0x2a')],qs[_0x1e8f('0x2f')](_0x207c8a['query'][_0x1e8f('0x2f')]));_0x46f7cf[_0x1e8f('0x2e')]=_0x46f7cf[_0x1e8f('0x2e')]['length']?_0x46f7cf[_0x1e8f('0x2e')]:_0x1e3512[_0x1e8f('0x2a')];if(!_0x207c8a[_0x1e8f('0x2c')][_0x1e8f('0x30')](_0x1e8f('0x31'))){_0x46f7cf[_0x1e8f('0x1c')]=qs[_0x1e8f('0x1c')](_0x207c8a[_0x1e8f('0x2c')]['limit']);_0x46f7cf[_0x1e8f('0x1a')]=qs[_0x1e8f('0x1a')](_0x207c8a['query']['offset']);}_0x46f7cf[_0x1e8f('0x32')]=qs[_0x1e8f('0x33')](_0x207c8a[_0x1e8f('0x2c')][_0x1e8f('0x33')]);_0x46f7cf['where']=qs[_0x1e8f('0x34')](_[_0x1e8f('0x35')](_0x207c8a[_0x1e8f('0x2c')],_0x1e3512[_0x1e8f('0x34')]),_0xf84dba);if(_0x207c8a[_0x1e8f('0x2c')][_0x1e8f('0x36')]){_0x46f7cf[_0x1e8f('0x37')]=_[_0x1e8f('0x38')](_0x46f7cf[_0x1e8f('0x37')],{'$or':_[_0x1e8f('0x25')](_0xf84dba,function(_0x5ed9b3){if(_0x5ed9b3[_0x1e8f('0x28')]!==_0x1e8f('0x39')){var _0x501ee0={};_0x501ee0[_0x5ed9b3[_0x1e8f('0x23')]]={'$like':'%'+_0x207c8a[_0x1e8f('0x2c')][_0x1e8f('0x36')]+'%'};return _0x501ee0;}})});}_0x46f7cf=_['merge']({},_0x46f7cf,_0x207c8a[_0x1e8f('0x3a')]);var _0x52d638={'where':_0x46f7cf[_0x1e8f('0x37')]};return db[_0x1e8f('0x26')][_0x1e8f('0x3b')](_0x52d638)[_0x1e8f('0x20')](function(_0x36fcb0){_0x5627dc[_0x1e8f('0x3b')]=_0x36fcb0;if(_0x207c8a[_0x1e8f('0x2c')][_0x1e8f('0x3c')]){_0x46f7cf[_0x1e8f('0x3d')]=[{'all':!![]}];}return db[_0x1e8f('0x26')][_0x1e8f('0x3e')](_0x46f7cf);})[_0x1e8f('0x20')](function(_0x1f7424){_0x5627dc[_0x1e8f('0x3f')]=_0x1f7424;return _0x5627dc;})[_0x1e8f('0x20')](respondWithFilteredResult(_0x4ae2df,_0x46f7cf))[_0x1e8f('0x40')](handleError(_0x4ae2df,null));};exports[_0x1e8f('0x41')]=function(_0x22f698,_0x387fb1){var _0x30852a={'raw':!![],'where':{'id':_0x22f698[_0x1e8f('0x42')]['id']}},_0x29182a={};_0x29182a[_0x1e8f('0x2a')]=_[_0x1e8f('0x2b')](db['VoiceDialReport']['rawAttributes']);_0x29182a['query']=_[_0x1e8f('0x2b')](_0x22f698[_0x1e8f('0x2c')]);_0x29182a[_0x1e8f('0x34')]=_[_0x1e8f('0x2d')](_0x29182a['model'],_0x29182a[_0x1e8f('0x2c')]);_0x30852a[_0x1e8f('0x2e')]=_[_0x1e8f('0x2d')](_0x29182a[_0x1e8f('0x2a')],qs[_0x1e8f('0x2f')](_0x22f698[_0x1e8f('0x2c')][_0x1e8f('0x2f')]));_0x30852a[_0x1e8f('0x2e')]=_0x30852a[_0x1e8f('0x2e')][_0x1e8f('0x43')]?_0x30852a[_0x1e8f('0x2e')]:_0x29182a[_0x1e8f('0x2a')];if(_0x22f698[_0x1e8f('0x2c')][_0x1e8f('0x3c')]){_0x30852a[_0x1e8f('0x3d')]=[{'all':!![]}];}_0x30852a=_[_0x1e8f('0x38')]({},_0x30852a,_0x22f698[_0x1e8f('0x3a')]);return db[_0x1e8f('0x26')]['find'](_0x30852a)[_0x1e8f('0x20')](handleEntityNotFound(_0x387fb1,null))['then'](respondWithResult(_0x387fb1,null))[_0x1e8f('0x40')](handleError(_0x387fb1,null));};exports[_0x1e8f('0x44')]=function(_0x3af92f,_0x26cbda){return db['VoiceDialReport'][_0x1e8f('0x44')](_0x3af92f['body'],{})[_0x1e8f('0x20')](respondWithResult(_0x26cbda,0xc9))['catch'](handleError(_0x26cbda,null));};exports[_0x1e8f('0x45')]=function(_0x3b8f31,_0x252752){if(_0x3b8f31[_0x1e8f('0x46')]['id']){delete _0x3b8f31['body']['id'];}return db['VoiceDialReport']['find']({'where':{'id':_0x3b8f31['params']['id']}})[_0x1e8f('0x20')](handleEntityNotFound(_0x252752,null))[_0x1e8f('0x20')](saveUpdates(_0x3b8f31[_0x1e8f('0x46')],null))[_0x1e8f('0x20')](respondWithResult(_0x252752,null))['catch'](handleError(_0x252752,null));};exports['destroy']=function(_0x2669ae,_0x27a46c){return db[_0x1e8f('0x26')]['find']({'where':{'id':_0x2669ae[_0x1e8f('0x42')]['id']}})[_0x1e8f('0x20')](handleEntityNotFound(_0x27a46c,null))[_0x1e8f('0x20')](removeEntity(_0x27a46c,null))[_0x1e8f('0x40')](handleError(_0x27a46c,null));};exports['describe']=function(_0x31323d,_0x5734a8){return db[_0x1e8f('0x26')]['describe']()[_0x1e8f('0x20')](respondWithResult(_0x5734a8,null))[_0x1e8f('0x40')](handleError(_0x5734a8,null));};
\ No newline at end of file
index 9d40a57..99358bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3ab=['./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','bluebird','path','../../config/environment'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0xd3ab,0x10a));var _0xbd3a=function(_0x38bc7e,_0x1667a8){_0x38bc7e=_0x38bc7e-0x0;var _0x332340=_0xd3ab[_0x38bc7e];return _0x332340;};'use strict';var _=require(_0xbd3a('0x0'));var util=require(_0xbd3a('0x1'));var logger=require(_0xbd3a('0x2'))(_0xbd3a('0x3'));var moment=require('moment');var BPromise=require(_0xbd3a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd3a('0x5'));var rimraf=require('rimraf');var config=require(_0xbd3a('0x6'));var attributes=require(_0xbd3a('0x7'));module[_0xbd3a('0x8')]=function(_0x357fa6,_0x70f037){return _0x357fa6[_0xbd3a('0x9')](_0xbd3a('0xa'),attributes,{'tableName':_0xbd3a('0xb'),'paranoid':![],'indexes':[{'fields':[_0xbd3a('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x579f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','uniqueid','lodash','util','api'];(function(_0x3576a8,_0x3beacc){var _0x110c61=function(_0x3e3ab9){while(--_0x3e3ab9){_0x3576a8['push'](_0x3576a8['shift']());}};_0x110c61(++_0x3beacc);}(_0x579f,0x14d));var _0xf579=function(_0x3e6edc,_0x379f39){_0x3e6edc=_0x3e6edc-0x0;var _0x3c870a=_0x579f[_0x3e6edc];return _0x3c870a;};'use strict';var _=require(_0xf579('0x0'));var util=require(_0xf579('0x1'));var logger=require('../../config/logger')(_0xf579('0x2'));var moment=require(_0xf579('0x3'));var BPromise=require(_0xf579('0x4'));var rp=require(_0xf579('0x5'));var fs=require('fs');var path=require(_0xf579('0x6'));var rimraf=require(_0xf579('0x7'));var config=require(_0xf579('0x8'));var attributes=require(_0xf579('0x9'));module[_0xf579('0xa')]=function(_0x203fc1,_0x279b3b){return _0x203fc1[_0xf579('0xb')](_0xf579('0xc'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xf579('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 483bc01..3cacf07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fce=['rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','options','raw','UpdateVoiceDialReport','update','where','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1e591e,_0x59f3b1){var _0x3229d2=function(_0x522501){while(--_0x522501){_0x1e591e['push'](_0x1e591e['shift']());}};_0x3229d2(++_0x59f3b1);}(_0x9fce,0xf2));var _0xe9fc=function(_0x7b173,_0x539d7f){_0x7b173=_0x7b173-0x0;var _0x1c598c=_0x9fce[_0x7b173];return _0x1c598c;};'use strict';var _=require(_0xe9fc('0x0'));var util=require(_0xe9fc('0x1'));var moment=require(_0xe9fc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe9fc('0x3'))['db'];var utils=require(_0xe9fc('0x4'));var logger=require(_0xe9fc('0x5'))(_0xe9fc('0x6'));var config=require(_0xe9fc('0x7'));var jayson=require(_0xe9fc('0x8'));var client=jayson[_0xe9fc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c1cd8,_0x32cf06,_0x3e01d4){return new BPromise(function(_0x25d698,_0x36d55d){return client[_0xe9fc('0xa')](_0x1c1cd8,_0x3e01d4)[_0xe9fc('0xb')](function(_0x23ee7b){logger[_0xe9fc('0xc')](_0xe9fc('0xd'),_0x32cf06,_0xe9fc('0xe'));logger[_0xe9fc('0xf')](_0xe9fc('0x10'),_0x32cf06,_0xe9fc('0xe'),JSON[_0xe9fc('0x11')](_0x23ee7b));if(_0x23ee7b[_0xe9fc('0x12')]){if(_0x23ee7b[_0xe9fc('0x12')][_0xe9fc('0x13')]===0x1f4){logger[_0xe9fc('0x12')](_0xe9fc('0xd'),_0x32cf06,_0x23ee7b['error'][_0xe9fc('0x14')]);return _0x36d55d(_0x23ee7b['error'][_0xe9fc('0x14')]);}logger[_0xe9fc('0x12')](_0xe9fc('0xd'),_0x32cf06,_0x23ee7b[_0xe9fc('0x12')][_0xe9fc('0x14')]);return _0x25d698(_0x23ee7b[_0xe9fc('0x12')][_0xe9fc('0x14')]);}else{logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x32cf06,_0xe9fc('0xe'));_0x25d698(_0x23ee7b[_0xe9fc('0x15')][_0xe9fc('0x14')]);}})[_0xe9fc('0x16')](function(_0x3934d6){logger['error'](_0xe9fc('0xd'),_0x32cf06,_0x3934d6);_0x36d55d(_0x3934d6);});});}exports[_0xe9fc('0x17')]=function(_0x21f508){var _0x3503e2=this;return new Promise(function(_0x4fa05d,_0x41d044){return db[_0xe9fc('0x18')][_0xe9fc('0x19')](_0x21f508['body'],{'raw':_0x21f508[_0xe9fc('0x1a')]?_0x21f508[_0xe9fc('0x1a')][_0xe9fc('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x46ecb5){logger[_0xe9fc('0xc')](_0xe9fc('0x17'),_0x21f508);logger[_0xe9fc('0xf')](_0xe9fc('0x17'),_0x21f508,JSON[_0xe9fc('0x11')](_0x46ecb5));_0x4fa05d(_0x46ecb5);})[_0xe9fc('0x16')](function(_0x3b6ca2){logger[_0xe9fc('0x12')](_0xe9fc('0x17'),_0x3b6ca2[_0xe9fc('0x14')],_0x21f508);_0x41d044(_0x3503e2[_0xe9fc('0x12')](0x1f4,_0x3b6ca2['message']));});});};exports[_0xe9fc('0x1c')]=function(_0x5ec8e9){var _0x381f98=this;return new Promise(function(_0x4aa922,_0xe1f03d){return db[_0xe9fc('0x18')][_0xe9fc('0x1d')](_0x5ec8e9['body'],{'raw':_0x5ec8e9[_0xe9fc('0x1a')]?_0x5ec8e9[_0xe9fc('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ec8e9['options']?_0x5ec8e9[_0xe9fc('0x1a')][_0xe9fc('0x1e')]||null:null,'attributes':_0x5ec8e9[_0xe9fc('0x1a')]?_0x5ec8e9['options']['attributes']||null:null,'limit':_0x5ec8e9[_0xe9fc('0x1a')]?_0x5ec8e9[_0xe9fc('0x1a')]['limit']||null:null})[_0xe9fc('0xb')](function(_0x1b6cd0){logger['info']('UpdateVoiceDialReport',_0x5ec8e9);logger[_0xe9fc('0xf')](_0xe9fc('0x1c'),_0x5ec8e9,JSON[_0xe9fc('0x11')](_0x1b6cd0));_0x4aa922(_0x1b6cd0);})['catch'](function(_0x4686d3){logger[_0xe9fc('0x12')](_0xe9fc('0x1c'),_0x4686d3['message'],_0x5ec8e9);_0xe1f03d(_0x381f98[_0xe9fc('0x12')](0x1f4,_0x4686d3[_0xe9fc('0x14')]));});});};
\ No newline at end of file
+var _0x36bc=['limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceDialReport','VoiceDialReport','body','options','raw','catch','UpdateVoiceDialReport','update','where','attributes'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x36bc,0xcd));var _0xc36b=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x36bc[_0x433a86];return _0x23000c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc36b('0x0'));var BPromise=require(_0xc36b('0x1'));var rs=require(_0xc36b('0x2'));var fs=require('fs');var Redis=require(_0xc36b('0x3'));var db=require(_0xc36b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc36b('0x5'))(_0xc36b('0x6'));var config=require(_0xc36b('0x7'));var jayson=require(_0xc36b('0x8'));var client=jayson[_0xc36b('0x9')][_0xc36b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5086ce,_0x2aae41,_0xf042){return new BPromise(function(_0x369a8d,_0x39c309){return client[_0xc36b('0xb')](_0x5086ce,_0xf042)[_0xc36b('0xc')](function(_0x59e6c5){logger[_0xc36b('0xd')](_0xc36b('0xe'),_0x2aae41,_0xc36b('0xf'));logger[_0xc36b('0x10')](_0xc36b('0x11'),_0x2aae41,'request\x20sent',JSON[_0xc36b('0x12')](_0x59e6c5));if(_0x59e6c5[_0xc36b('0x13')]){if(_0x59e6c5['error'][_0xc36b('0x14')]===0x1f4){logger[_0xc36b('0x13')](_0xc36b('0xe'),_0x2aae41,_0x59e6c5[_0xc36b('0x13')]['message']);return _0x39c309(_0x59e6c5[_0xc36b('0x13')][_0xc36b('0x15')]);}logger[_0xc36b('0x13')](_0xc36b('0xe'),_0x2aae41,_0x59e6c5[_0xc36b('0x13')][_0xc36b('0x15')]);return _0x369a8d(_0x59e6c5['error'][_0xc36b('0x15')]);}else{logger[_0xc36b('0xd')](_0xc36b('0xe'),_0x2aae41,_0xc36b('0xf'));_0x369a8d(_0x59e6c5[_0xc36b('0x16')][_0xc36b('0x15')]);}})['catch'](function(_0x5001a8){logger[_0xc36b('0x13')](_0xc36b('0xe'),_0x2aae41,_0x5001a8);_0x39c309(_0x5001a8);});});}exports[_0xc36b('0x17')]=function(_0xdc1e5a){var _0x18ca9f=this;return new Promise(function(_0x4a732f,_0x5ab5da){return db[_0xc36b('0x18')]['create'](_0xdc1e5a[_0xc36b('0x19')],{'raw':_0xdc1e5a[_0xc36b('0x1a')]?_0xdc1e5a[_0xc36b('0x1a')][_0xc36b('0x1b')]===undefined?!![]:![]:!![]})[_0xc36b('0xc')](function(_0x477e97){logger[_0xc36b('0xd')](_0xc36b('0x17'),_0xdc1e5a);logger['debug']('CreateVoiceDialReport',_0xdc1e5a,JSON['stringify'](_0x477e97));_0x4a732f(_0x477e97);})[_0xc36b('0x1c')](function(_0x298608){logger[_0xc36b('0x13')]('CreateVoiceDialReport',_0x298608['message'],_0xdc1e5a);_0x5ab5da(_0x18ca9f[_0xc36b('0x13')](0x1f4,_0x298608[_0xc36b('0x15')]));});});};exports[_0xc36b('0x1d')]=function(_0x1477fe){var _0x263549=this;return new Promise(function(_0x40a0fb,_0x2f8fe0){return db['VoiceDialReport'][_0xc36b('0x1e')](_0x1477fe['body'],{'raw':_0x1477fe[_0xc36b('0x1a')]?_0x1477fe[_0xc36b('0x1a')][_0xc36b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1477fe[_0xc36b('0x1a')]?_0x1477fe[_0xc36b('0x1a')][_0xc36b('0x1f')]||null:null,'attributes':_0x1477fe[_0xc36b('0x1a')]?_0x1477fe[_0xc36b('0x1a')][_0xc36b('0x20')]||null:null,'limit':_0x1477fe[_0xc36b('0x1a')]?_0x1477fe[_0xc36b('0x1a')][_0xc36b('0x21')]||null:null})['then'](function(_0x38628e){logger[_0xc36b('0xd')]('UpdateVoiceDialReport',_0x1477fe);logger[_0xc36b('0x10')](_0xc36b('0x1d'),_0x1477fe,JSON[_0xc36b('0x12')](_0x38628e));_0x40a0fb(_0x38628e);})[_0xc36b('0x1c')](function(_0x38b317){logger[_0xc36b('0x13')]('UpdateVoiceDialReport',_0x38b317[_0xc36b('0x15')],_0x1477fe);_0x2f8fe0(_0x263549[_0xc36b('0x13')](0x1f4,_0x38b317[_0xc36b('0x15')]));});});};
\ No newline at end of file
index 92d06f6..679a711 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1e1=['isAuthenticated','index','show','/:id/applications','addApplications','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceExtension.controller'];(function(_0x27227e,_0x38898c){var _0x54f517=function(_0x2bec56){while(--_0x2bec56){_0x27227e['push'](_0x27227e['shift']());}};_0x54f517(++_0x38898c);}(_0xa1e1,0x1f0));var _0x1a1e=function(_0x5733ea,_0x1cd489){_0x5733ea=_0x5733ea-0x0;var _0x1a923e=_0xa1e1[_0x5733ea];return _0x1a923e;};'use strict';var multer=require(_0x1a1e('0x0'));var util=require('util');var path=require(_0x1a1e('0x1'));var timeout=require(_0x1a1e('0x2'));var express=require(_0x1a1e('0x3'));var router=express[_0x1a1e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1a1e('0x5'));var config=require(_0x1a1e('0x6'));var controller=require(_0x1a1e('0x7'));router['get']('/',auth[_0x1a1e('0x8')](),controller[_0x1a1e('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1a1e('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x1a1e('0xb'),auth[_0x1a1e('0x8')](),controller[_0x1a1e('0xc')]);router['put'](_0x1a1e('0xd'),auth['isAuthenticated'](),controller[_0x1a1e('0xe')]);router[_0x1a1e('0xf')]('/:id',auth[_0x1a1e('0x8')](),controller[_0x1a1e('0x10')]);module[_0x1a1e('0x11')]=router;
\ No newline at end of file
+var _0x8866=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','get','isAuthenticated','post','/:id/applications','addApplications','put','update','delete','/:id','destroy'];(function(_0x199a28,_0x208484){var _0x2b1b9d=function(_0x140012){while(--_0x140012){_0x199a28['push'](_0x199a28['shift']());}};_0x2b1b9d(++_0x208484);}(_0x8866,0xfd));var _0x6886=function(_0x1850f2,_0xf1537f){_0x1850f2=_0x1850f2-0x0;var _0x135d5c=_0x8866[_0x1850f2];return _0x135d5c;};'use strict';var multer=require(_0x6886('0x0'));var util=require(_0x6886('0x1'));var path=require(_0x6886('0x2'));var timeout=require(_0x6886('0x3'));var express=require(_0x6886('0x4'));var router=express[_0x6886('0x5')]();var fs_extra=require(_0x6886('0x6'));var auth=require(_0x6886('0x7'));var interaction=require(_0x6886('0x8'));var config=require('../../config/environment');var controller=require(_0x6886('0x9'));router[_0x6886('0xa')]('/',auth[_0x6886('0xb')](),controller['index']);router[_0x6886('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6886('0xc')]('/',auth[_0x6886('0xb')](),controller['create']);router[_0x6886('0xc')](_0x6886('0xd'),auth[_0x6886('0xb')](),controller[_0x6886('0xe')]);router[_0x6886('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x6886('0x10')]);router[_0x6886('0x11')](_0x6886('0x12'),auth[_0x6886('0xb')](),controller[_0x6886('0x13')]);module[_0x6886('0x14')]=router;
\ No newline at end of file
index 1b75305..13dfe80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5893=['any','*,*,*,*','INTEGER','BOOLEAN','wav','getDataValue','exten','sequelize','exports','compositeIndex','STRING','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax'];(function(_0x4179ee,_0x1d91e3){var _0x36cce1=function(_0x41dc8b){while(--_0x41dc8b){_0x4179ee['push'](_0x4179ee['shift']());}};_0x36cce1(++_0x1d91e3);}(_0x5893,0x14b));var _0x3589=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5893[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x3589('0x0'));module[_0x3589('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3589('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x3589('0x3')],'allowNull':![],'unique':_0x3589('0x2')},'priority':{'type':Sequelize[_0x3589('0x3')],'allowNull':![],'defaultValue':'1','unique':_0x3589('0x2')},'tag':{'type':Sequelize[_0x3589('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3589('0x4')},'appdata':{'type':Sequelize[_0x3589('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x3589('0x5')](_0x3589('0x6'),_0x3589('0x7'),_0x3589('0x8'),_0x3589('0x9'),_0x3589('0xa'),'system',_0x3589('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x3589('0x3')]},'interval':{'type':Sequelize[_0x3589('0x3')],'allowNull':![],'defaultValue':_0x3589('0xc')},'IntervalId':{'type':Sequelize[_0x3589('0xd')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x3589('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0x3589('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0x3589('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x3589('0xd')]},'recordingFormat':{'type':Sequelize[_0x3589('0x3')],'defaultValue':_0x3589('0xf')},'answer':{'type':Sequelize[_0x3589('0xe')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x22135e){return this[_0x3589('0x10')](_0x3589('0x11'));}},'alias':{'type':Sequelize[_0x3589('0x3')],'allowNull':!![]}};
\ No newline at end of file
+var _0x23af=['STRING','compositeIndex','NoOp','internal','inbound-fax','system','*,*,*,*','INTEGER','wav','BOOLEAN','getDataValue','exten','sequelize','exports'];(function(_0x43cd95,_0x306b5e){var _0x5143b6=function(_0x2f9384){while(--_0x2f9384){_0x43cd95['push'](_0x43cd95['shift']());}};_0x5143b6(++_0x306b5e);}(_0x23af,0x116));var _0xf23a=function(_0x21ba7b,_0x1bba6d){_0x21ba7b=_0x21ba7b-0x0;var _0x2ca02b=_0x23af[_0x21ba7b];return _0x2ca02b;};'use strict';var Sequelize=require(_0xf23a('0x0'));module[_0xf23a('0x1')]={'context':{'type':Sequelize[_0xf23a('0x2')],'allowNull':![],'unique':_0xf23a('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xf23a('0x2')],'allowNull':![],'unique':_0xf23a('0x3')},'priority':{'type':Sequelize[_0xf23a('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xf23a('0x3')},'tag':{'type':Sequelize[_0xf23a('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xf23a('0x2')],'allowNull':![],'defaultValue':_0xf23a('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound','outbound',_0xf23a('0x5'),_0xf23a('0x6'),'outbound-fax',_0xf23a('0x7'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf23a('0x2')],'allowNull':![],'defaultValue':_0xf23a('0x8')},'IntervalId':{'type':Sequelize[_0xf23a('0x9')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xf23a('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xf23a('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0xf23a('0x2')],'defaultValue':_0xf23a('0xa')},'answer':{'type':Sequelize[_0xf23a('0xb')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xc36580){return this[_0xf23a('0xc')](_0xf23a('0xd'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
index f771e71..8a89831 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x028d=['VoiceExtensionId','isApp','createRouting','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','register','sendStatus','status','end','json','offset','count','limit','Content-Range','get','InboundRoutes','inbound','outbound','InternalRoutes','internal','filter','includes','type','find','value','name','UserProfileResource','destroy','then','error','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','create','body','startsWith','exten','user','role','OutboundRoutes','UserProfileSection','userProfileId','autoAssociation','update','description','mandatoryDisposition','alias','context','addApplications','sequelize','transaction','Transaction','READ_COMMITTED'];(function(_0x4c4e45,_0x4ba716){var _0x3e520e=function(_0x158d6b){while(--_0x158d6b){_0x4c4e45['push'](_0x4c4e45['shift']());}};_0x3e520e(++_0x4ba716);}(_0x028d,0x1b6));var _0xd028=function(_0xf589d9,_0x2bbcb7){_0xf589d9=_0xf589d9-0x0;var _0x5c52f7=_0x028d[_0xf589d9];return _0x5c52f7;};'use strict';var _=require('lodash');var Redis=require(_0xd028('0x0'));var qs=require(_0xd028('0x1'));var logger=require(_0xd028('0x2'))(_0xd028('0x3'));var config=require(_0xd028('0x4'));var db=require(_0xd028('0x5'))['db'];config[_0xd028('0x6')]=_['defaults'](config[_0xd028('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd028('0x6')]));require('./voiceExtension.socket')[_0xd028('0x7')](socket);function respondWithStatusCode(_0x520e6e,_0x1e2934){_0x1e2934=_0x1e2934||0xcc;return function(_0x3d52ce){if(_0x3d52ce){return _0x520e6e[_0xd028('0x8')](_0x1e2934);}return _0x520e6e[_0xd028('0x9')](_0x1e2934)[_0xd028('0xa')]();};}function respondWithResult(_0x27d0cd,_0x5f2974){_0x5f2974=_0x5f2974||0xc8;return function(_0x5c314b){if(_0x5c314b){return _0x27d0cd[_0xd028('0x9')](_0x5f2974)[_0xd028('0xb')](_0x5c314b);}};}function respondWithFilteredResult(_0x19a381,_0xb5109d){return function(_0x2cd795){if(_0x2cd795){var _0x1f1610=typeof _0xb5109d[_0xd028('0xc')]==='undefined'&&typeof _0xb5109d['limit']==='undefined';var _0x1c4f42=_0x2cd795[_0xd028('0xd')];var _0x30e724=_0x1f1610?0x0:_0xb5109d[_0xd028('0xc')];var _0xa53a2d=_0x1f1610?_0x2cd795[_0xd028('0xd')]:_0xb5109d[_0xd028('0xc')]+_0xb5109d[_0xd028('0xe')];var _0x51ef59;if(_0xa53a2d>=_0x1c4f42){_0xa53a2d=_0x1c4f42;_0x51ef59=0xc8;}else{_0x51ef59=0xce;}_0x19a381[_0xd028('0x9')](_0x51ef59);return _0x19a381['set'](_0xd028('0xf'),_0x30e724+'-'+_0xa53a2d+'/'+_0x1c4f42)[_0xd028('0xb')](_0x2cd795);}return null;};}function removeEntity(_0x34c4b8){return function(_0x3fd50e){if(_0x3fd50e){return _0x3fd50e['destroy']()['then'](function(){var _0x1375eb=_0x3fd50e[_0xd028('0x10')]({'plain':!![]});var _0x4cd9d6=[{'name':_0xd028('0x11'),'value':_0xd028('0x12'),'ignore':![]},{'name':'OutboundRoutes','value':_0xd028('0x13'),'ignore':![]},{'name':_0xd028('0x14'),'value':_0xd028('0x15'),'ignore':![]}];var _0x3a22da=_(_0x4cd9d6)[_0xd028('0x16')]('ignore')['map']('value')['value']();if(_[_0xd028('0x17')](_0x3a22da,_0x1375eb[_0xd028('0x18')])){return;}var _0x11e8b6=_[_0xd028('0x19')](_0x4cd9d6,[_0xd028('0x1a'),_0x1375eb[_0xd028('0x18')]])[_0xd028('0x1b')];return db[_0xd028('0x1c')][_0xd028('0x1d')]({'where':{'type':_0x11e8b6,'resourceId':_0x1375eb['id']}})['then'](function(){return _0x3fd50e;});})[_0xd028('0x1e')](function(){_0x34c4b8[_0xd028('0x9')](0xcc)[_0xd028('0xa')]();});}};}function handleEntityNotFound(_0x2ec9ee){return function(_0x5de596){if(!_0x5de596){_0x2ec9ee[_0xd028('0x8')](0x194);}return _0x5de596;};}function handleError(_0x2c9e4c,_0x1845c3){_0x1845c3=_0x1845c3||0x1f4;return function(_0x56ef89){logger[_0xd028('0x1f')](_0x56ef89[_0xd028('0x20')]);if(_0x56ef89['name']){delete _0x56ef89[_0xd028('0x1b')];}_0x2c9e4c[_0xd028('0x9')](_0x1845c3)[_0xd028('0x21')](_0x56ef89);};}exports[_0xd028('0x22')]=function(_0xd92541,_0xa6ddd0){var _0x210454={},_0x24b44f={},_0x5f1c99={'count':0x0,'rows':[]};var _0x3aa511=_['map'](db[_0xd028('0x23')][_0xd028('0x24')],function(_0x71489f){return{'name':_0x71489f[_0xd028('0x25')],'type':_0x71489f['type'][_0xd028('0x26')]};});_0x24b44f['model']=_['map'](_0x3aa511,_0xd028('0x1b'));_0x24b44f[_0xd028('0x27')]=_[_0xd028('0x28')](_0xd92541['query']);_0x24b44f[_0xd028('0x29')]=_[_0xd028('0x2a')](_0x24b44f[_0xd028('0x2b')],_0x24b44f['query']);_0x210454[_0xd028('0x2c')]=_[_0xd028('0x2a')](_0x24b44f['model'],qs[_0xd028('0x2d')](_0xd92541[_0xd028('0x27')][_0xd028('0x2d')]));_0x210454[_0xd028('0x2c')]=_0x210454[_0xd028('0x2c')][_0xd028('0x2e')]?_0x210454[_0xd028('0x2c')]:_0x24b44f[_0xd028('0x2b')];if(!_0xd92541['query'][_0xd028('0x2f')](_0xd028('0x30'))){_0x210454[_0xd028('0xe')]=qs[_0xd028('0xe')](_0xd92541[_0xd028('0x27')][_0xd028('0xe')]);_0x210454[_0xd028('0xc')]=qs[_0xd028('0xc')](_0xd92541[_0xd028('0x27')][_0xd028('0xc')]);}_0x210454[_0xd028('0x31')]=qs['sort'](_0xd92541[_0xd028('0x27')][_0xd028('0x32')]);_0x210454[_0xd028('0x33')]=qs[_0xd028('0x29')](_[_0xd028('0x34')](_0xd92541['query'],_0x24b44f[_0xd028('0x29')]),_0x3aa511);if(_0xd92541[_0xd028('0x27')][_0xd028('0x16')]){_0x210454[_0xd028('0x33')]=_[_0xd028('0x35')](_0x210454[_0xd028('0x33')],{'$or':_[_0xd028('0x36')](_0x3aa511,function(_0x3ebd9a){if(_0x3ebd9a[_0xd028('0x18')]!==_0xd028('0x37')){var _0x5a747e={};_0x5a747e[_0x3ebd9a[_0xd028('0x1b')]]={'$like':'%'+_0xd92541['query'][_0xd028('0x16')]+'%'};return _0x5a747e;}})});}_0x210454=_[_0xd028('0x35')]({},_0x210454,_0xd92541['options']);var _0x5585e9={'where':_0x210454[_0xd028('0x33')]};return db[_0xd028('0x23')][_0xd028('0xd')](_0x5585e9)[_0xd028('0x1e')](function(_0x44e220){_0x5f1c99[_0xd028('0xd')]=_0x44e220;if(_0xd92541[_0xd028('0x27')][_0xd028('0x38')]){_0x210454[_0xd028('0x39')]=[{'all':!![]}];}return db['VoiceExtension'][_0xd028('0x3a')](_0x210454);})['then'](function(_0x151a73){_0x5f1c99[_0xd028('0x3b')]=_0x151a73;return _0x5f1c99;})[_0xd028('0x1e')](respondWithFilteredResult(_0xa6ddd0,_0x210454))[_0xd028('0x3c')](handleError(_0xa6ddd0,null));};exports[_0xd028('0x3d')]=function(_0x38daf3,_0x522217){var _0x5d7e0a={'raw':![],'where':{'id':_0x38daf3[_0xd028('0x3e')]['id']}},_0x354079={};_0x354079[_0xd028('0x2b')]=_[_0xd028('0x28')](db[_0xd028('0x23')]['rawAttributes']);_0x354079[_0xd028('0x27')]=_[_0xd028('0x28')](_0x38daf3[_0xd028('0x27')]);_0x354079[_0xd028('0x29')]=_[_0xd028('0x2a')](_0x354079[_0xd028('0x2b')],_0x354079[_0xd028('0x27')]);_0x5d7e0a[_0xd028('0x2c')]=_[_0xd028('0x2a')](_0x354079['model'],qs[_0xd028('0x2d')](_0x38daf3[_0xd028('0x27')]['fields']));_0x5d7e0a['attributes']=_0x5d7e0a['attributes']['length']?_0x5d7e0a[_0xd028('0x2c')]:_0x354079[_0xd028('0x2b')];if(_0x38daf3['query'][_0xd028('0x38')]){_0x5d7e0a[_0xd028('0x39')]=[{'all':!![]}];}_0x5d7e0a=_[_0xd028('0x35')]({},_0x5d7e0a,_0x38daf3[_0xd028('0x3f')]);return db[_0xd028('0x23')]['find'](_0x5d7e0a)[_0xd028('0x1e')](handleEntityNotFound(_0x522217,null))['then'](respondWithResult(_0x522217,null))[_0xd028('0x3c')](handleError(_0x522217,null));};exports['destroy']=function(_0x4a5182,_0x4986a0){return db[_0xd028('0x23')]['find']({'where':{'id':_0x4a5182['params']['id']}})[_0xd028('0x1e')](handleEntityNotFound(_0x4986a0,null))[_0xd028('0x1e')](removeEntity(_0x4986a0,null))[_0xd028('0x3c')](handleError(_0x4986a0,null));};exports[_0xd028('0x40')]=function(_0x2e077c,_0x2ee6b8){if(_0x2e077c[_0xd028('0x41')][_0xd028('0x18')]==='outbound'&&!_[_0xd028('0x42')](_0x2e077c[_0xd028('0x41')][_0xd028('0x43')],'_')){_0x2e077c[_0xd028('0x41')]['exten']='_'['concat'](_0x2e077c[_0xd028('0x41')][_0xd028('0x43')]);}return db[_0xd028('0x23')][_0xd028('0x40')](_0x2e077c['body'],{'raw':![]})['then'](function(_0x472608){var _0x5edc62=_0x2e077c[_0xd028('0x44')]['get']({'plain':!![]});if(!_0x5edc62)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5edc62[_0xd028('0x45')]===_0xd028('0x44')){var _0x212da0=_0x472608[_0xd028('0x10')]({'plain':!![]});var _0x26cdca=[{'name':_0xd028('0x11'),'value':'inbound'},{'name':_0xd028('0x46'),'value':_0xd028('0x13')},{'name':_0xd028('0x14'),'value':_0xd028('0x15')}];var _0x469422=_[_0xd028('0x19')](_0x26cdca,[_0xd028('0x1a'),_0x212da0[_0xd028('0x18')]])[_0xd028('0x1b')];return db[_0xd028('0x47')][_0xd028('0x19')]({'where':{'name':_0x469422,'userProfileId':_0x5edc62[_0xd028('0x48')]},'raw':!![]})[_0xd028('0x1e')](function(_0x5ad429){if(_0x5ad429&&_0x5ad429[_0xd028('0x49')]===0x0){return db[_0xd028('0x1c')]['create']({'name':_0x212da0[_0xd028('0x1b')],'resourceId':_0x212da0['id'],'type':_0x5ad429[_0xd028('0x1b')],'sectionId':_0x5ad429['id']},{})[_0xd028('0x1e')](function(){return _0x472608;});}else{return _0x472608;}})[_0xd028('0x3c')](function(_0x2e9b46){logger[_0xd028('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e9b46);throw _0x2e9b46;});}return _0x472608;})[_0xd028('0x1e')](respondWithResult(_0x2ee6b8,0xc9))[_0xd028('0x3c')](handleError(_0x2ee6b8,null));};exports[_0xd028('0x4a')]=function(_0x3027fa,_0x382ffc){if(_0x3027fa[_0xd028('0x41')]['id']){delete _0x3027fa[_0xd028('0x41')]['id'];}return db['VoiceExtension']['find']({'where':{'id':_0x3027fa[_0xd028('0x3e')]['id']}})[_0xd028('0x1e')](handleEntityNotFound(_0x382ffc,null))[_0xd028('0x1e')](function(_0x5d8669){if(_0x5d8669){return db[_0xd028('0x23')]['update'](_[_0xd028('0x34')](_0x3027fa[_0xd028('0x41')],[_0xd028('0x43'),'context',_0xd028('0x4b'),'recordingFormat','cutdigits',_0xd028('0x4c'),_0xd028('0x4d')]),{'where':{'context':_0x5d8669[_0xd028('0x4e')],'exten':_0x5d8669[_0xd028('0x43')]},'individualHooks':!![]})[_0xd028('0x1e')](function(_0xeb6ab3){return _0xeb6ab3;});}return null;})[_0xd028('0x1e')](respondWithStatusCode(_0x382ffc,null))['catch'](handleError(_0x382ffc,null));};exports[_0xd028('0x4f')]=function(_0xbeedfa,_0x5c0597){var _0x3106f2=_0xbeedfa['params']['id'];var _0x36ad7d=_0xbeedfa['body'];var _0xb1d45f=0xc8;var _0x49e445=null;return db[_0xd028('0x50')][_0xd028('0x51')]({'isolationLevel':db['sequelize'][_0xd028('0x52')]['ISOLATION_LEVELS'][_0xd028('0x53')]},function(_0x1ec7db){return db['VoiceExtension']['findOne']({'where':{'id':_0x3106f2},'transaction':_0x1ec7db})[_0xd028('0x1e')](function(_0x45db13){if(_0x45db13){return db[_0xd028('0x23')][_0xd028('0x1d')]({'where':{'VoiceExtensionId':_0x3106f2},'transaction':_0x1ec7db})['then'](function(){var _0x5b8993=_[_0xd028('0x36')](_0x36ad7d,function(_0x3e1502){_0x3e1502[_0xd028('0x54')]=_0x3106f2;_0x3e1502[_0xd028('0x55')]=!![];return _0x3e1502;});return _0x45db13[_0xd028('0x56')](_0x5b8993);})[_0xd028('0x1e')](function(_0x568bc1){return db['VoiceExtension']['bulkCreate'](_0x568bc1,{'transaction':_0x1ec7db});});}else{_0xb1d45f=0x194;_0x49e445=[];}});})['then'](function(){if(_0xb1d45f!==0x194){return db[_0xd028('0x23')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x3106f2},'order':'cast(priority\x20as\x20unsigned)'})[_0xd028('0x1e')](function(_0x215f54){_0x49e445=_0x215f54;});}})[_0xd028('0x3c')](function(_0x3f874e){_0xb1d45f=0x1f4;logger[_0xd028('0x1f')](_0x3f874e[_0xd028('0x20')]);if(_0x3f874e['name']){delete _0x3f874e[_0xd028('0x1b')];}_0x49e445=_0x3f874e;})['finally'](function(){if(_0x49e445===null){_0x5c0597['sendStatus'](_0xb1d45f);}else{if(_0xb1d45f===0x1f4){_0x5c0597[_0xd028('0x9')](_0xb1d45f)[_0xd028('0x21')](_0x49e445);}else{_0x5c0597[_0xd028('0x9')](_0xb1d45f)[_0xd028('0xb')](_0x49e445);}}});};
\ No newline at end of file
+var _0x1098=['show','params','intersection','length','body','startsWith','exten','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','error','finally','json','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','destroy','then','get','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','map','value','includes','type','find','name','UserProfileResource','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','includeAll','include','findAll','catch'];(function(_0x598f02,_0x3c8b6a){var _0xe3db0=function(_0x56ba5b){while(--_0x56ba5b){_0x598f02['push'](_0x598f02['shift']());}};_0xe3db0(++_0x3c8b6a);}(_0x1098,0x1a9));var _0x8109=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1098[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var Redis=require(_0x8109('0x0'));var qs=require(_0x8109('0x1'));var logger=require(_0x8109('0x2'))(_0x8109('0x3'));var config=require(_0x8109('0x4'));var db=require(_0x8109('0x5'))['db'];config['redis']=_[_0x8109('0x6')](config[_0x8109('0x7')],{'host':_0x8109('0x8'),'port':0x18eb});var socket=require(_0x8109('0x9'))(new Redis(config[_0x8109('0x7')]));require(_0x8109('0xa'))['register'](socket);function respondWithStatusCode(_0x4ad2d4,_0x42dd1d){_0x42dd1d=_0x42dd1d||0xcc;return function(_0x458be1){if(_0x458be1){return _0x4ad2d4[_0x8109('0xb')](_0x42dd1d);}return _0x4ad2d4[_0x8109('0xc')](_0x42dd1d)[_0x8109('0xd')]();};}function respondWithResult(_0x97bbb7,_0x43c868){_0x43c868=_0x43c868||0xc8;return function(_0x2f6669){if(_0x2f6669){return _0x97bbb7['status'](_0x43c868)['json'](_0x2f6669);}};}function respondWithFilteredResult(_0x2f7467,_0x5f42e7){return function(_0x56d1f2){if(_0x56d1f2){var _0x246837=typeof _0x5f42e7[_0x8109('0xe')]==='undefined'&&typeof _0x5f42e7['limit']===_0x8109('0xf');var _0xf7fe88=_0x56d1f2[_0x8109('0x10')];var _0x590efd=_0x246837?0x0:_0x5f42e7[_0x8109('0xe')];var _0x2682eb=_0x246837?_0x56d1f2[_0x8109('0x10')]:_0x5f42e7[_0x8109('0xe')]+_0x5f42e7[_0x8109('0x11')];var _0x54de7b;if(_0x2682eb>=_0xf7fe88){_0x2682eb=_0xf7fe88;_0x54de7b=0xc8;}else{_0x54de7b=0xce;}_0x2f7467[_0x8109('0xc')](_0x54de7b);return _0x2f7467[_0x8109('0x12')](_0x8109('0x13'),_0x590efd+'-'+_0x2682eb+'/'+_0xf7fe88)['json'](_0x56d1f2);}return null;};}function removeEntity(_0x156a63){return function(_0x5a65ec){if(_0x5a65ec){return _0x5a65ec[_0x8109('0x14')]()[_0x8109('0x15')](function(){var _0x2cc886=_0x5a65ec[_0x8109('0x16')]({'plain':!![]});var _0x29af10=[{'name':'InboundRoutes','value':_0x8109('0x17'),'ignore':![]},{'name':_0x8109('0x18'),'value':_0x8109('0x19'),'ignore':![]},{'name':_0x8109('0x1a'),'value':_0x8109('0x1b'),'ignore':![]}];var _0x22ffc2=_(_0x29af10)[_0x8109('0x1c')]('ignore')[_0x8109('0x1d')](_0x8109('0x1e'))[_0x8109('0x1e')]();if(_[_0x8109('0x1f')](_0x22ffc2,_0x2cc886[_0x8109('0x20')])){return;}var _0x1d1626=_[_0x8109('0x21')](_0x29af10,['value',_0x2cc886[_0x8109('0x20')]])[_0x8109('0x22')];return db[_0x8109('0x23')][_0x8109('0x14')]({'where':{'type':_0x1d1626,'resourceId':_0x2cc886['id']}})[_0x8109('0x15')](function(){return _0x5a65ec;});})[_0x8109('0x15')](function(){_0x156a63[_0x8109('0xc')](0xcc)[_0x8109('0xd')]();});}};}function handleEntityNotFound(_0x120855){return function(_0x10188a){if(!_0x10188a){_0x120855[_0x8109('0xb')](0x194);}return _0x10188a;};}function handleError(_0x2b5d27,_0x1250d4){_0x1250d4=_0x1250d4||0x1f4;return function(_0xae94d1){logger['error'](_0xae94d1[_0x8109('0x24')]);if(_0xae94d1['name']){delete _0xae94d1[_0x8109('0x22')];}_0x2b5d27[_0x8109('0xc')](_0x1250d4)[_0x8109('0x25')](_0xae94d1);};}exports[_0x8109('0x26')]=function(_0x27ef5a,_0x2e828d){var _0x5e0eeb={},_0x5d404d={},_0x3abb23={'count':0x0,'rows':[]};var _0x4dc930=_[_0x8109('0x1d')](db[_0x8109('0x27')][_0x8109('0x28')],function(_0x54f24d){return{'name':_0x54f24d[_0x8109('0x29')],'type':_0x54f24d[_0x8109('0x20')][_0x8109('0x2a')]};});_0x5d404d[_0x8109('0x2b')]=_[_0x8109('0x1d')](_0x4dc930,_0x8109('0x22'));_0x5d404d[_0x8109('0x2c')]=_[_0x8109('0x2d')](_0x27ef5a[_0x8109('0x2c')]);_0x5d404d[_0x8109('0x2e')]=_['intersection'](_0x5d404d['model'],_0x5d404d[_0x8109('0x2c')]);_0x5e0eeb[_0x8109('0x2f')]=_['intersection'](_0x5d404d[_0x8109('0x2b')],qs[_0x8109('0x30')](_0x27ef5a['query'][_0x8109('0x30')]));_0x5e0eeb['attributes']=_0x5e0eeb[_0x8109('0x2f')]['length']?_0x5e0eeb[_0x8109('0x2f')]:_0x5d404d[_0x8109('0x2b')];if(!_0x27ef5a[_0x8109('0x2c')][_0x8109('0x31')](_0x8109('0x32'))){_0x5e0eeb['limit']=qs[_0x8109('0x11')](_0x27ef5a[_0x8109('0x2c')][_0x8109('0x11')]);_0x5e0eeb[_0x8109('0xe')]=qs[_0x8109('0xe')](_0x27ef5a[_0x8109('0x2c')][_0x8109('0xe')]);}_0x5e0eeb[_0x8109('0x33')]=qs[_0x8109('0x34')](_0x27ef5a[_0x8109('0x2c')][_0x8109('0x34')]);_0x5e0eeb[_0x8109('0x35')]=qs['filters'](_[_0x8109('0x36')](_0x27ef5a[_0x8109('0x2c')],_0x5d404d[_0x8109('0x2e')]),_0x4dc930);if(_0x27ef5a[_0x8109('0x2c')][_0x8109('0x1c')]){_0x5e0eeb[_0x8109('0x35')]=_['merge'](_0x5e0eeb[_0x8109('0x35')],{'$or':_['map'](_0x4dc930,function(_0x14609d){if(_0x14609d['type']!=='VIRTUAL'){var _0x1751d3={};_0x1751d3[_0x14609d[_0x8109('0x22')]]={'$like':'%'+_0x27ef5a[_0x8109('0x2c')][_0x8109('0x1c')]+'%'};return _0x1751d3;}})});}_0x5e0eeb=_[_0x8109('0x37')]({},_0x5e0eeb,_0x27ef5a['options']);var _0xa90523={'where':_0x5e0eeb['where']};return db[_0x8109('0x27')]['count'](_0xa90523)[_0x8109('0x15')](function(_0xa88b9b){_0x3abb23[_0x8109('0x10')]=_0xa88b9b;if(_0x27ef5a['query'][_0x8109('0x38')]){_0x5e0eeb[_0x8109('0x39')]=[{'all':!![]}];}return db[_0x8109('0x27')][_0x8109('0x3a')](_0x5e0eeb);})[_0x8109('0x15')](function(_0x4aa92b){_0x3abb23['rows']=_0x4aa92b;return _0x3abb23;})[_0x8109('0x15')](respondWithFilteredResult(_0x2e828d,_0x5e0eeb))[_0x8109('0x3b')](handleError(_0x2e828d,null));};exports[_0x8109('0x3c')]=function(_0x43d477,_0x5ca03c){var _0x483e48={'raw':![],'where':{'id':_0x43d477[_0x8109('0x3d')]['id']}},_0x1d6fac={};_0x1d6fac['model']=_[_0x8109('0x2d')](db[_0x8109('0x27')][_0x8109('0x28')]);_0x1d6fac[_0x8109('0x2c')]=_['keys'](_0x43d477[_0x8109('0x2c')]);_0x1d6fac['filters']=_[_0x8109('0x3e')](_0x1d6fac[_0x8109('0x2b')],_0x1d6fac['query']);_0x483e48[_0x8109('0x2f')]=_['intersection'](_0x1d6fac['model'],qs[_0x8109('0x30')](_0x43d477[_0x8109('0x2c')][_0x8109('0x30')]));_0x483e48['attributes']=_0x483e48['attributes'][_0x8109('0x3f')]?_0x483e48[_0x8109('0x2f')]:_0x1d6fac['model'];if(_0x43d477[_0x8109('0x2c')][_0x8109('0x38')]){_0x483e48[_0x8109('0x39')]=[{'all':!![]}];}_0x483e48=_[_0x8109('0x37')]({},_0x483e48,_0x43d477['options']);return db[_0x8109('0x27')][_0x8109('0x21')](_0x483e48)[_0x8109('0x15')](handleEntityNotFound(_0x5ca03c,null))[_0x8109('0x15')](respondWithResult(_0x5ca03c,null))['catch'](handleError(_0x5ca03c,null));};exports[_0x8109('0x14')]=function(_0x52d7c6,_0x314ba0){return db[_0x8109('0x27')][_0x8109('0x21')]({'where':{'id':_0x52d7c6['params']['id']}})[_0x8109('0x15')](handleEntityNotFound(_0x314ba0,null))[_0x8109('0x15')](removeEntity(_0x314ba0,null))[_0x8109('0x3b')](handleError(_0x314ba0,null));};exports['create']=function(_0x4dd8a0,_0x2219ec){if(_0x4dd8a0[_0x8109('0x40')][_0x8109('0x20')]===_0x8109('0x19')&&!_[_0x8109('0x41')](_0x4dd8a0[_0x8109('0x40')][_0x8109('0x42')],'_')){_0x4dd8a0['body'][_0x8109('0x42')]='_'['concat'](_0x4dd8a0[_0x8109('0x40')][_0x8109('0x42')]);}return db[_0x8109('0x27')][_0x8109('0x43')](_0x4dd8a0[_0x8109('0x40')],{'raw':![]})[_0x8109('0x15')](function(_0x6c75d5){var _0x535619=_0x4dd8a0[_0x8109('0x44')][_0x8109('0x16')]({'plain':!![]});if(!_0x535619)throw new Error(_0x8109('0x45'));if(_0x535619[_0x8109('0x46')]===_0x8109('0x44')){var _0x2fb48c=_0x6c75d5[_0x8109('0x16')]({'plain':!![]});var _0x3043f1=[{'name':_0x8109('0x47'),'value':_0x8109('0x17')},{'name':_0x8109('0x18'),'value':'outbound'},{'name':_0x8109('0x1a'),'value':_0x8109('0x1b')}];var _0xec10cc=_[_0x8109('0x21')](_0x3043f1,['value',_0x2fb48c[_0x8109('0x20')]])[_0x8109('0x22')];return db[_0x8109('0x48')]['find']({'where':{'name':_0xec10cc,'userProfileId':_0x535619[_0x8109('0x49')]},'raw':!![]})[_0x8109('0x15')](function(_0x29987d){if(_0x29987d&&_0x29987d[_0x8109('0x4a')]===0x0){return db[_0x8109('0x23')][_0x8109('0x43')]({'name':_0x2fb48c['name'],'resourceId':_0x2fb48c['id'],'type':_0x29987d[_0x8109('0x22')],'sectionId':_0x29987d['id']},{})[_0x8109('0x15')](function(){return _0x6c75d5;});}else{return _0x6c75d5;}})[_0x8109('0x3b')](function(_0x4e40e7){logger['error'](_0x8109('0x4b'),_0x4e40e7);throw _0x4e40e7;});}return _0x6c75d5;})[_0x8109('0x15')](respondWithResult(_0x2219ec,0xc9))[_0x8109('0x3b')](handleError(_0x2219ec,null));};exports[_0x8109('0x4c')]=function(_0x587863,_0x4e1d32){if(_0x587863[_0x8109('0x40')]['id']){delete _0x587863[_0x8109('0x40')]['id'];}return db[_0x8109('0x27')][_0x8109('0x21')]({'where':{'id':_0x587863[_0x8109('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4e1d32,null))[_0x8109('0x15')](function(_0x3cbad8){if(_0x3cbad8){return db[_0x8109('0x27')][_0x8109('0x4c')](_[_0x8109('0x36')](_0x587863[_0x8109('0x40')],[_0x8109('0x42'),_0x8109('0x4d'),'description',_0x8109('0x4e'),_0x8109('0x4f'),_0x8109('0x50'),_0x8109('0x51')]),{'where':{'context':_0x3cbad8['context'],'exten':_0x3cbad8['exten']},'individualHooks':!![]})[_0x8109('0x15')](function(_0x75fa04){return _0x75fa04;});}return null;})['then'](respondWithStatusCode(_0x4e1d32,null))[_0x8109('0x3b')](handleError(_0x4e1d32,null));};exports[_0x8109('0x52')]=function(_0x1afd65,_0x56b66a){var _0x29a250=_0x1afd65['params']['id'];var _0x34fab7=_0x1afd65[_0x8109('0x40')];var _0x478301=0xc8;var _0x11ce10=null;return db[_0x8109('0x53')][_0x8109('0x54')]({'isolationLevel':db[_0x8109('0x53')][_0x8109('0x55')][_0x8109('0x56')]['READ_COMMITTED']},function(_0x4e1a9b){return db[_0x8109('0x27')][_0x8109('0x57')]({'where':{'id':_0x29a250},'transaction':_0x4e1a9b})[_0x8109('0x15')](function(_0x2c0955){if(_0x2c0955){return db['VoiceExtension'][_0x8109('0x14')]({'where':{'VoiceExtensionId':_0x29a250},'transaction':_0x4e1a9b})[_0x8109('0x15')](function(){var _0x368f4c=_[_0x8109('0x1d')](_0x34fab7,function(_0x296f99){_0x296f99[_0x8109('0x58')]=_0x29a250;_0x296f99[_0x8109('0x59')]=!![];return _0x296f99;});return _0x2c0955[_0x8109('0x5a')](_0x368f4c);})[_0x8109('0x15')](function(_0x559610){return db[_0x8109('0x27')][_0x8109('0x5b')](_0x559610,{'transaction':_0x4e1a9b});});}else{_0x478301=0x194;_0x11ce10=[];}});})[_0x8109('0x15')](function(){if(_0x478301!==0x194){return db[_0x8109('0x27')][_0x8109('0x5c')]({'where':{'isApp':!![],'VoiceExtensionId':_0x29a250},'order':_0x8109('0x5d')})[_0x8109('0x15')](function(_0xffe213){_0x11ce10=_0xffe213;});}})[_0x8109('0x3b')](function(_0x55cef5){_0x478301=0x1f4;logger[_0x8109('0x5e')](_0x55cef5[_0x8109('0x24')]);if(_0x55cef5[_0x8109('0x22')]){delete _0x55cef5['name'];}_0x11ce10=_0x55cef5;})[_0x8109('0x5f')](function(){if(_0x11ce10===null){_0x56b66a[_0x8109('0xb')](_0x478301);}else{if(_0x478301===0x1f4){_0x56b66a[_0x8109('0xc')](_0x478301)[_0x8109('0x25')](_0x11ce10);}else{_0x56b66a[_0x8109('0xc')](_0x478301)[_0x8109('0x60')](_0x11ce10);}}});};
\ No newline at end of file
index fb609d3..4a3253e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2621=['../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x36cb6a,_0x2b4d79){var _0x2538cd=function(_0x4598b3){while(--_0x4598b3){_0x36cb6a['push'](_0x36cb6a['shift']());}};_0x2538cd(++_0x2b4d79);}(_0x2621,0xdb));var _0x1262=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2621[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x1262('0x0'));var VoiceExtension=require(_0x1262('0x1'))['db'][_0x1262('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x1262('0x3')](0x0);var events={'afterCreate':_0x1262('0x4'),'afterUpdate':_0x1262('0x5'),'afterDestroy':_0x1262('0x6')};function emitEvent(_0x245a28){return function(_0x49a40c,_0x465516,_0x423f99){VoiceExtensionEvents['emit'](_0x245a28+':'+_0x49a40c['id'],_0x49a40c);VoiceExtensionEvents[_0x1262('0x7')](_0x245a28,_0x49a40c);_0x423f99(null);};}for(var e in events){if(events[_0x1262('0x8')](e)){var event=events[e];VoiceExtension[_0x1262('0x9')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;
\ No newline at end of file
+var _0xeaf7=['update','remove','emit','hasOwnProperty','events','setMaxListeners','save'];(function(_0x539ce2,_0x54efa0){var _0x1c85b0=function(_0x3d82ac){while(--_0x3d82ac){_0x539ce2['push'](_0x539ce2['shift']());}};_0x1c85b0(++_0x54efa0);}(_0xeaf7,0xe4));var _0x7eaf=function(_0x1e36c5,_0x2e1377){_0x1e36c5=_0x1e36c5-0x0;var _0x35ca43=_0xeaf7[_0x1e36c5];return _0x35ca43;};'use strict';var EventEmitter=require(_0x7eaf('0x0'));var VoiceExtension=require('../../mysqldb')['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x7eaf('0x1')](0x0);var events={'afterCreate':_0x7eaf('0x2'),'afterUpdate':_0x7eaf('0x3'),'afterDestroy':_0x7eaf('0x4')};function emitEvent(_0x36658a){return function(_0x59a511,_0x211628,_0x5e48d7){VoiceExtensionEvents[_0x7eaf('0x5')](_0x36658a+':'+_0x59a511['id'],_0x59a511);VoiceExtensionEvents['emit'](_0x36658a,_0x59a511);_0x5e48d7(null);};}for(var e in events){if(events[_0x7eaf('0x6')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;
\ No newline at end of file
index aa3507a..f3093c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29af=['timeout','url','length','name','param','split','phone','prefix','${EXTEN:','SIP','join','options','indexOf','replace','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','callerID','Set(CALLERID(all)=','includes','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','outboundDial','appdata','last','priority','concat','catch','define','VoiceExtension','voice_extensions','get','Hangup','lodash','./voiceExtension.attributes','exports','models','type','context','exten','alias','Set','CDR(routeAlias)=','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk'];(function(_0x2fa5aa,_0x2a05d3){var _0x51a34f=function(_0x35070d){while(--_0x35070d){_0x2fa5aa['push'](_0x2fa5aa['shift']());}};_0x51a34f(++_0x2a05d3);}(_0x29af,0x134));var _0xf29a=function(_0x8fc0a4,_0x5b5beb){_0x8fc0a4=_0x8fc0a4-0x0;var _0x56a29d=_0x29af[_0x8fc0a4];return _0x56a29d;};'use strict';var _=require(_0xf29a('0x0'));var attributes=require(_0xf29a('0x1'));module[_0xf29a('0x2')]=function(_0x5d1cb4){var _0x133327=_0x5d1cb4[_0xf29a('0x3')];function _0x58929e(_0x40ab34){var _0x505d15=0x2;var _0x37e156=[{'type':_0x40ab34[_0xf29a('0x4')],'app':'Set','appdata':'CDR(type)='+_0x40ab34[_0xf29a('0x4')],'context':_0x40ab34[_0xf29a('0x5')],'exten':_0x40ab34[_0xf29a('0x6')],'priority':_0x505d15++,'VoiceExtensionId':_0x40ab34['id']},{'type':_0x40ab34[_0xf29a('0x4')],'app':_0x40ab34[_0xf29a('0x7')]?_0xf29a('0x8'):'NoOp','appdata':_0x40ab34[_0xf29a('0x7')]?_0xf29a('0x9')+_0x40ab34[_0xf29a('0x7')]:'No\x20alias\x20set','context':_0x40ab34['context'],'exten':_0x40ab34[_0xf29a('0x6')],'priority':_0x505d15++,'VoiceExtensionId':_0x40ab34['id']}];if(_0x40ab34[_0xf29a('0x4')]===_0xf29a('0xa')){_0x37e156[_0xf29a('0xb')]({'type':_0xf29a('0xa'),'app':_0xf29a('0x8'),'appdata':_0xf29a('0xc')+_0x40ab34['id'],'context':_0x40ab34['context'],'exten':_0x40ab34[_0xf29a('0x6')],'priority':_0x505d15++,'VoiceExtensionId':_0x40ab34['id']});}_0x37e156[_0xf29a('0xb')]({'type':_0x40ab34[_0xf29a('0x4')],'app':_0xf29a('0x8'),'appdata':_0xf29a('0xd'),'context':_0x40ab34[_0xf29a('0x5')],'exten':_0x40ab34[_0xf29a('0x6')],'priority':_0x505d15++,'VoiceExtensionId':_0x40ab34['id']},{'type':_0x40ab34['type'],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x40ab34[_0xf29a('0x5')],'exten':_0x40ab34[_0xf29a('0x6')],'priority':_0x505d15++,'VoiceExtensionId':_0x40ab34['id']},{'type':_0x40ab34[_0xf29a('0x4')],'app':_0xf29a('0x8'),'appdata':_0xf29a('0xe'),'context':_0x40ab34['context'],'exten':_0x40ab34[_0xf29a('0x6')],'priority':_0x505d15++,'VoiceExtensionId':_0x40ab34['id']});return _0x37e156;}function _0x42567e(_0x297764){var _0x283fe5=0x2;var _0x14d1dc=[{'type':_0xf29a('0xf'),'app':_0xf29a('0x8'),'appdata':_0xf29a('0x10'),'context':_0x297764[_0xf29a('0x5')],'exten':_0x297764[_0xf29a('0x6')],'priority':_0x283fe5++,'VoiceExtensionId':_0x297764['id']},{'type':'outbound','app':_0x297764[_0xf29a('0x7')]?_0xf29a('0x8'):'NoOp','appdata':_0x297764[_0xf29a('0x7')]?_0xf29a('0x9')+_0x297764[_0xf29a('0x7')]:'No\x20alias\x20set','context':_0x297764[_0xf29a('0x5')],'exten':_0x297764['exten'],'priority':_0x283fe5++,'VoiceExtensionId':_0x297764['id']},{'type':_0xf29a('0xf'),'app':_0xf29a('0x8'),'appdata':_0xf29a('0x11')+(_0x297764[_0xf29a('0x12')]?'${EXTEN:'+_0x297764[_0xf29a('0x12')]+'}':_0xf29a('0x13')),'context':_0x297764[_0xf29a('0x5')],'exten':_0x297764[_0xf29a('0x6')],'priority':_0x283fe5++,'VoiceExtensionId':_0x297764['id']},{'type':_0xf29a('0xf'),'app':_0xf29a('0x8'),'appdata':_0xf29a('0xc')+_0x297764['id'],'context':_0x297764['context'],'exten':_0x297764['exten'],'priority':_0x283fe5++,'VoiceExtensionId':_0x297764['id']},{'type':'outbound','app':_0xf29a('0x14'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x283fe5+0x2)+_0xf29a('0x15')+(_0x283fe5+0x1)+')','context':_0x297764[_0xf29a('0x5')],'exten':_0x297764[_0xf29a('0x6')],'priority':_0x283fe5++,'VoiceExtensionId':_0x297764['id']},{'type':'outbound','app':_0xf29a('0x8'),'appdata':_0x297764[_0xf29a('0x12')]?_0xf29a('0x16')+_0x297764[_0xf29a('0x12')]+'}':_0xf29a('0x17'),'context':_0x297764[_0xf29a('0x5')],'exten':_0x297764['exten'],'priority':_0x283fe5++,'VoiceExtensionId':_0x297764['id']},{'type':_0xf29a('0xf'),'app':_0xf29a('0x8'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x297764['context'],'exten':_0x297764['exten'],'priority':_0x283fe5++,'VoiceExtensionId':_0x297764['id']},{'type':_0xf29a('0xf'),'app':_0xf29a('0x8'),'appdata':_0xf29a('0x18'),'context':_0x297764[_0xf29a('0x5')],'exten':_0x297764[_0xf29a('0x6')],'priority':_0x283fe5++,'VoiceExtensionId':_0x297764['id']},{'type':_0xf29a('0xf'),'app':_0xf29a('0x8'),'appdata':'MONITOR_OPTIONS=ab','context':_0x297764[_0xf29a('0x5')],'exten':_0x297764[_0xf29a('0x6')],'priority':_0x283fe5++,'VoiceExtensionId':_0x297764['id']},{'type':_0xf29a('0xf'),'app':_0xf29a('0x8'),'appdata':_0xf29a('0x19')+_0x297764['id'],'context':_0x297764[_0xf29a('0x5')],'exten':_0x297764[_0xf29a('0x6')],'priority':_0x283fe5++,'VoiceExtensionId':_0x297764['id']}];if(_0x297764['hasOwnProperty'](_0xf29a('0x1a'))&&_0x297764['recordingFormat']!==_0xf29a('0x1b')){_0x14d1dc[_0xf29a('0xb')]({'type':_0xf29a('0xf'),'app':_0xf29a('0x8'),'appdata':_0xf29a('0x1c'),'context':_0x297764['context'],'exten':_0x297764[_0xf29a('0x6')],'priority':_0x283fe5++,'VoiceExtensionId':_0x297764['id']},{'type':'outbound','app':_0xf29a('0x8'),'appdata':_0xf29a('0x1d')+_0x297764['recordingFormat']||_0xf29a('0x1e'),'context':_0x297764[_0xf29a('0x5')],'exten':_0x297764['exten'],'priority':_0x283fe5++,'VoiceExtensionId':_0x297764['id']});}return _0x14d1dc;}function _0x13b011(_0x399698,_0x422cd8){var _0x33df00=[{'name':_0xf29a('0x1f'),'param':0x0},{'name':_0xf29a('0x20'),'param':0x1},{'name':'options','param':0x2},{'name':_0xf29a('0x21'),'param':0x3}];var _0x244d89={};var _0x10616d=_0x422cd8['split'](',');var _0x250e21=[];for(var _0x10c686=0x0;_0x10c686<_0x33df00[_0xf29a('0x22')];_0x10c686++){switch(_0x33df00[_0x10c686][_0xf29a('0x23')]){case _0xf29a('0x1f'):_0x244d89[_0xf29a('0x1f')]=_0x10616d[_0x33df00[_0x10c686][_0xf29a('0x24')]][_0xf29a('0x25')]('/')[0x1];_0x244d89[_0xf29a('0x26')]=_0x10616d[_0x33df00[_0x10c686][_0xf29a('0x24')]][_0xf29a('0x25')]('/')[0x2];_0x244d89[_0xf29a('0x27')]=_0x244d89['phone']?_0x244d89['phone'][_0xf29a('0x25')]('$')[0x0]:undefined;_0x244d89[_0xf29a('0x26')]=_0x399698[_0xf29a('0x12')]?(_0x244d89['prefix']||'')+_0xf29a('0x28')+_0x399698[_0xf29a('0x12')]+'}':(_0x244d89[_0xf29a('0x27')]||'')+_0xf29a('0x13');_0x250e21[_0x33df00[_0x10c686][_0xf29a('0x24')]]=[_0xf29a('0x29'),_0x244d89[_0xf29a('0x1f')],_0x244d89[_0xf29a('0x26')]][_0xf29a('0x2a')]('/');break;case _0xf29a('0x2b'):_0x244d89[_0xf29a('0x2b')]=_0x10616d[_0x33df00[_0x10c686]['param']];if(_0x399698[_0xf29a('0x1a')]!=='none'){if(_0x244d89[_0xf29a('0x2b')][_0xf29a('0x2c')]('U(xcally-mixmonitor-context)')<0x0){_0x244d89[_0xf29a('0x2b')]+='U(xcally-mixmonitor-context)';}}else{_0x244d89[_0xf29a('0x2b')]=_0x244d89[_0xf29a('0x2b')][_0xf29a('0x2d')](_0xf29a('0x2e'),'');}_0x250e21[_0x33df00[_0x10c686][_0xf29a('0x24')]]=_0x244d89['options'];break;default:_0x250e21[_0x33df00[_0x10c686][_0xf29a('0x24')]]=_0x10616d[_0x33df00[_0x10c686][_0xf29a('0x24')]];}}return _0x250e21[_0xf29a('0x2a')](',');}function _0xc63172(_0x558cd8,_0x116891,_0x1a898d){return new Promise(function(_0x3473bf,_0x34902b){var _0x2fd353=[];if(_[_0xf29a('0x2f')](_0x116891))return _0x3473bf(_0x2fd353);_0x133327[_0xf29a('0x30')][_0xf29a('0x31')]({'attributes':['id',_0xf29a('0x32'),_0xf29a('0x33')],'raw':!![]})[_0xf29a('0x34')](function(_0x2d179d){for(var _0x340c9c=0x0,_0xd69797=0x0;_0x340c9c<_0x116891[_0xf29a('0x22')];_0x340c9c++,_0xd69797=0x0){var _0x458ae4=_0x116891[_0x340c9c];var _0x2e59a5=[];var _0x282881=[];delete _0x458ae4['id'];if(_0x458ae4[_0xf29a('0x32')]!==_0xf29a('0x35')){_0x458ae4['intervals']=[_0x458ae4['interval']];}else{_0x458ae4[_0xf29a('0x36')]=_0x458ae4[_0xf29a('0x33')]?_[_0xf29a('0x37')](_[_0xf29a('0x38')](_0x2d179d,{'IntervalId':_0x458ae4[_0xf29a('0x33')]}),_0xf29a('0x32')):[];}_0x458ae4[_0xf29a('0x5')]=_0x558cd8[_0xf29a('0x5')];_0x458ae4[_0xf29a('0x6')]=_0x558cd8[_0xf29a('0x6')];if(_0x458ae4[_0xf29a('0x4')])_0x458ae4[_0xf29a('0x4')]=_0x458ae4[_0xf29a('0x4')][_0xf29a('0x39')]();if(_0x558cd8[_0xf29a('0x4')]===_0xf29a('0xf')){if(_0x458ae4[_0xf29a('0x3a')](_0xf29a('0x3b'))&&_0x458ae4[_0xf29a('0x3b')]&&_0x458ae4[_0xf29a('0x3b')]!=='--'){_0x2e59a5[_0xf29a('0xb')]({'type':_0x458ae4[_0xf29a('0x4')]['toLowerCase'](),'app':_0xf29a('0x8'),'appdata':_0xf29a('0x3c')+_0x458ae4[_0xf29a('0x3b')],'context':_0x558cd8[_0xf29a('0x5')],'exten':_0x558cd8[_0xf29a('0x6')],'priority':_0x458ae4['intervals'][_0xf29a('0x22')]+_0x1a898d+_0xd69797++,'VoiceExtensionId':_0x558cd8['id']});}_0x2e59a5[_0xf29a('0xb')]({'type':_0x458ae4[_0xf29a('0x4')]['toLowerCase'](),'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x458ae4[_0xf29a('0x3d')]?_0xf29a('0x3e')+_0x458ae4['callerID']+')':'NoOp(No\x20number\x20available)'),'context':_0x558cd8[_0xf29a('0x5')],'exten':_0x558cd8[_0xf29a('0x6')],'priority':_0x458ae4['intervals'][_0xf29a('0x22')]+_0x1a898d+_0xd69797++,'VoiceExtensionId':_0x558cd8['id']});}else{if(_0x458ae4[_0xf29a('0x3a')]('answer')){if(['queue','playback'][_0xf29a('0x3f')](_0x458ae4[_0xf29a('0x40')][_0xf29a('0x39')]())&&_0x458ae4[_0xf29a('0x41')]!==_0xf29a('0x42')){if(_0x458ae4[_0xf29a('0x43')]){_0x2e59a5['push']({'type':_0x458ae4[_0xf29a('0x4')][_0xf29a('0x39')](),'app':_0xf29a('0x14'),'appdata':_0xf29a('0x44'),'context':_0x558cd8[_0xf29a('0x5')],'exten':_0x558cd8[_0xf29a('0x6')],'priority':_0x458ae4[_0xf29a('0x36')][_0xf29a('0x22')]+_0x1a898d+_0xd69797++,'VoiceExtensionId':_0x558cd8['id']});_0x2e59a5[_0xf29a('0xb')]({'type':_0x458ae4['type']['toLowerCase'](),'app':_0xf29a('0x8'),'appdata':_0xf29a('0x45'),'context':_0x558cd8[_0xf29a('0x5')],'exten':_0x558cd8[_0xf29a('0x6')],'priority':_0x458ae4['intervals']['length']+_0x1a898d+_0xd69797++,'VoiceExtensionId':_0x558cd8['id']});}else{_0x2e59a5['push']({'type':_0x458ae4[_0xf29a('0x4')][_0xf29a('0x39')](),'app':_0xf29a('0x14'),'appdata':_0xf29a('0x46'),'context':_0x558cd8['context'],'exten':_0x558cd8[_0xf29a('0x6')],'priority':_0x458ae4[_0xf29a('0x36')][_0xf29a('0x22')]+_0x1a898d+_0xd69797++,'VoiceExtensionId':_0x558cd8['id']});_0x2e59a5[_0xf29a('0xb')]({'type':_0x458ae4['type'][_0xf29a('0x39')](),'app':'Set','appdata':_0xf29a('0x47'),'context':_0x558cd8[_0xf29a('0x5')],'exten':_0x558cd8[_0xf29a('0x6')],'priority':_0x458ae4[_0xf29a('0x36')][_0xf29a('0x22')]+_0x1a898d+_0xd69797++,'VoiceExtensionId':_0x558cd8['id']});}}}}for(var _0x19fa44=0x0;_0x19fa44<_0x458ae4[_0xf29a('0x36')][_0xf29a('0x22')];_0x19fa44++){var _0x5c87cf=_0x1a898d+_0x458ae4[_0xf29a('0x36')][_0xf29a('0x22')];var _0x43c886=_0x19fa44===_0x458ae4[_0xf29a('0x36')][_0xf29a('0x22')]-0x1?_0x1a898d+_0x2e59a5[_0xf29a('0x22')]+_0x282881[_0xf29a('0x22')]+0x2:_0x1a898d+_0x19fa44+0x1;_0x2e59a5['splice'](_0x19fa44,0x0,{'type':_0x558cd8[_0xf29a('0x4')],'app':_0xf29a('0x48'),'appdata':_0x458ae4[_0xf29a('0x36')][_0x19fa44]+'?'+_0x558cd8['context']+_0xf29a('0x49')+_0x5c87cf+':'+_0x558cd8[_0xf29a('0x5')]+_0xf29a('0x49')+_0x43c886,'exten':_0x558cd8[_0xf29a('0x6')],'context':_0x558cd8[_0xf29a('0x5')],'priority':_0x1a898d+_0x19fa44,'VoiceExtensionId':_0x558cd8['id']});}if(_0x458ae4[_0xf29a('0x41')]===_0xf29a('0x4a'))_0x458ae4[_0xf29a('0x4b')]=_0x13b011(_0x558cd8,_0x458ae4[_0xf29a('0x4b')]);_0x458ae4['priority']=_0x2e59a5[_0xf29a('0x22')]?_[_0xf29a('0x4c')](_0x2e59a5)[_0xf29a('0x4d')]+0x1:_0x1a898d;_0x2fd353=_[_0xf29a('0x4e')](_0x2fd353,_0x2e59a5,[_0x458ae4],_0x282881);_0x1a898d=_[_0xf29a('0x4c')](_0x2fd353)[_0xf29a('0x4d')]+0x1;}return _0x3473bf(_0x2fd353);})[_0xf29a('0x4f')](function(_0x4b8664){_0x34902b(_0x4b8664);});});}return _0x5d1cb4[_0xf29a('0x50')](_0xf29a('0x51'),attributes,{'tableName':_0xf29a('0x52'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x40e404){var _0x1df5ce=this[_0xf29a('0x53')]({'plain':!![]});var _0x4f6a67=_0x1df5ce['type']==='outbound'?_0x42567e(_0x1df5ce):_0x58929e(_0x1df5ce);return _0xc63172(_0x1df5ce,_0x40e404,_['last'](_0x4f6a67)[_0xf29a('0x4d')]+0x1)[_0xf29a('0x34')](function(_0x28fff0){var _0x119a11=_['concat'](_0x4f6a67,_0x28fff0);_0x119a11['push']({'type':_0x1df5ce[_0xf29a('0x4')],'app':_0xf29a('0x54'),'exten':_0x1df5ce[_0xf29a('0x6')],'context':_0x1df5ce[_0xf29a('0x5')],'priority':_[_0xf29a('0x4c')](_0x119a11)[_0xf29a('0x4d')]+0x1,'VoiceExtensionId':_0x1df5ce['id']});return _0x119a11;});}}});};
\ No newline at end of file
+var _0x0bde=['./voiceExtension.attributes','models','type','Set','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','cutdigits','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','split','length','param','prefix','phone','join','indexOf','U(xcally-mixmonitor-context)','Interval','interval','IntervalId','*,*,*,*','intervals','map','tag','toLowerCase','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','define','VoiceExtension','voice_extensions','then'];(function(_0x5ddec1,_0x250e63){var _0x157c63=function(_0x556b74){while(--_0x556b74){_0x5ddec1['push'](_0x5ddec1['shift']());}};_0x157c63(++_0x250e63);}(_0x0bde,0xe7));var _0xe0bd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0bde[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var attributes=require(_0xe0bd('0x0'));module['exports']=function(_0x3fb344){var _0x3dc984=_0x3fb344[_0xe0bd('0x1')];function _0x1e198a(_0x2da4bd){var _0x5541b9=0x2;var _0x34df88=[{'type':_0x2da4bd[_0xe0bd('0x2')],'app':_0xe0bd('0x3'),'appdata':_0xe0bd('0x4')+_0x2da4bd[_0xe0bd('0x2')],'context':_0x2da4bd[_0xe0bd('0x5')],'exten':_0x2da4bd[_0xe0bd('0x6')],'priority':_0x5541b9++,'VoiceExtensionId':_0x2da4bd['id']},{'type':_0x2da4bd['type'],'app':_0x2da4bd[_0xe0bd('0x7')]?_0xe0bd('0x3'):_0xe0bd('0x8'),'appdata':_0x2da4bd[_0xe0bd('0x7')]?_0xe0bd('0x9')+_0x2da4bd[_0xe0bd('0x7')]:_0xe0bd('0xa'),'context':_0x2da4bd[_0xe0bd('0x5')],'exten':_0x2da4bd['exten'],'priority':_0x5541b9++,'VoiceExtensionId':_0x2da4bd['id']}];if(_0x2da4bd['type']==='inbound'){_0x34df88[_0xe0bd('0xb')]({'type':'inbound','app':'Set','appdata':_0xe0bd('0xc')+_0x2da4bd['id'],'context':_0x2da4bd[_0xe0bd('0x5')],'exten':_0x2da4bd['exten'],'priority':_0x5541b9++,'VoiceExtensionId':_0x2da4bd['id']});}_0x34df88[_0xe0bd('0xb')]({'type':_0x2da4bd['type'],'app':_0xe0bd('0x3'),'appdata':_0xe0bd('0xd'),'context':_0x2da4bd[_0xe0bd('0x5')],'exten':_0x2da4bd[_0xe0bd('0x6')],'priority':_0x5541b9++,'VoiceExtensionId':_0x2da4bd['id']},{'type':_0x2da4bd[_0xe0bd('0x2')],'app':_0xe0bd('0x3'),'appdata':_0xe0bd('0xe'),'context':_0x2da4bd[_0xe0bd('0x5')],'exten':_0x2da4bd['exten'],'priority':_0x5541b9++,'VoiceExtensionId':_0x2da4bd['id']},{'type':_0x2da4bd['type'],'app':'Set','appdata':_0xe0bd('0xf'),'context':_0x2da4bd[_0xe0bd('0x5')],'exten':_0x2da4bd[_0xe0bd('0x6')],'priority':_0x5541b9++,'VoiceExtensionId':_0x2da4bd['id']});return _0x34df88;}function _0x379ea2(_0x464958){var _0x55f304=0x2;var _0x4ebe7a=[{'type':_0xe0bd('0x10'),'app':'Set','appdata':_0xe0bd('0x11'),'context':_0x464958[_0xe0bd('0x5')],'exten':_0x464958[_0xe0bd('0x6')],'priority':_0x55f304++,'VoiceExtensionId':_0x464958['id']},{'type':_0xe0bd('0x10'),'app':_0x464958['alias']?_0xe0bd('0x3'):_0xe0bd('0x8'),'appdata':_0x464958[_0xe0bd('0x7')]?'CDR(routeAlias)='+_0x464958[_0xe0bd('0x7')]:_0xe0bd('0xa'),'context':_0x464958[_0xe0bd('0x5')],'exten':_0x464958['exten'],'priority':_0x55f304++,'VoiceExtensionId':_0x464958['id']},{'type':_0xe0bd('0x10'),'app':_0xe0bd('0x3'),'appdata':_0xe0bd('0x12')+(_0x464958['cutdigits']?_0xe0bd('0x13')+_0x464958['cutdigits']+'}':_0xe0bd('0x14')),'context':_0x464958[_0xe0bd('0x5')],'exten':_0x464958['exten'],'priority':_0x55f304++,'VoiceExtensionId':_0x464958['id']},{'type':_0xe0bd('0x10'),'app':_0xe0bd('0x3'),'appdata':_0xe0bd('0xc')+_0x464958['id'],'context':_0x464958[_0xe0bd('0x5')],'exten':_0x464958[_0xe0bd('0x6')],'priority':_0x55f304++,'VoiceExtensionId':_0x464958['id']},{'type':_0xe0bd('0x10'),'app':_0xe0bd('0x15'),'appdata':_0xe0bd('0x16')+(_0x55f304+0x2)+'):Goto('+(_0x55f304+0x1)+')','context':_0x464958['context'],'exten':_0x464958[_0xe0bd('0x6')],'priority':_0x55f304++,'VoiceExtensionId':_0x464958['id']},{'type':_0xe0bd('0x10'),'app':'Set','appdata':_0x464958['cutdigits']?_0xe0bd('0x17')+_0x464958[_0xe0bd('0x18')]+'}':_0xe0bd('0x19'),'context':_0x464958[_0xe0bd('0x5')],'exten':_0x464958['exten'],'priority':_0x55f304++,'VoiceExtensionId':_0x464958['id']},{'type':_0xe0bd('0x10'),'app':'Set','appdata':_0xe0bd('0xd'),'context':_0x464958[_0xe0bd('0x5')],'exten':_0x464958[_0xe0bd('0x6')],'priority':_0x55f304++,'VoiceExtensionId':_0x464958['id']},{'type':_0xe0bd('0x10'),'app':_0xe0bd('0x3'),'appdata':_0xe0bd('0xe'),'context':_0x464958[_0xe0bd('0x5')],'exten':_0x464958[_0xe0bd('0x6')],'priority':_0x55f304++,'VoiceExtensionId':_0x464958['id']},{'type':_0xe0bd('0x10'),'app':_0xe0bd('0x3'),'appdata':_0xe0bd('0xf'),'context':_0x464958[_0xe0bd('0x5')],'exten':_0x464958[_0xe0bd('0x6')],'priority':_0x55f304++,'VoiceExtensionId':_0x464958['id']},{'type':'outbound','app':_0xe0bd('0x3'),'appdata':_0xe0bd('0x1a')+_0x464958['id'],'context':_0x464958[_0xe0bd('0x5')],'exten':_0x464958[_0xe0bd('0x6')],'priority':_0x55f304++,'VoiceExtensionId':_0x464958['id']}];if(_0x464958[_0xe0bd('0x1b')](_0xe0bd('0x1c'))&&_0x464958['recordingFormat']!=='none'){_0x4ebe7a[_0xe0bd('0xb')]({'type':_0xe0bd('0x10'),'app':_0xe0bd('0x3'),'appdata':_0xe0bd('0x1d'),'context':_0x464958[_0xe0bd('0x5')],'exten':_0x464958[_0xe0bd('0x6')],'priority':_0x55f304++,'VoiceExtensionId':_0x464958['id']},{'type':_0xe0bd('0x10'),'app':'Set','appdata':_0xe0bd('0x1e')+_0x464958[_0xe0bd('0x1c')]||_0xe0bd('0x1f'),'context':_0x464958[_0xe0bd('0x5')],'exten':_0x464958[_0xe0bd('0x6')],'priority':_0x55f304++,'VoiceExtensionId':_0x464958['id']});}return _0x4ebe7a;}function _0x1371d0(_0x543c59,_0xd82ced){var _0xa7b799=[{'name':_0xe0bd('0x20'),'param':0x0},{'name':_0xe0bd('0x21'),'param':0x1},{'name':_0xe0bd('0x22'),'param':0x2},{'name':'url','param':0x3}];var _0x5a606a={};var _0x46e58d=_0xd82ced[_0xe0bd('0x23')](',');var _0x5a534=[];for(var _0x568e46=0x0;_0x568e46<_0xa7b799[_0xe0bd('0x24')];_0x568e46++){switch(_0xa7b799[_0x568e46]['name']){case'trunk':_0x5a606a[_0xe0bd('0x20')]=_0x46e58d[_0xa7b799[_0x568e46][_0xe0bd('0x25')]]['split']('/')[0x1];_0x5a606a['phone']=_0x46e58d[_0xa7b799[_0x568e46]['param']][_0xe0bd('0x23')]('/')[0x2];_0x5a606a[_0xe0bd('0x26')]=_0x5a606a[_0xe0bd('0x27')]?_0x5a606a['phone'][_0xe0bd('0x23')]('$')[0x0]:undefined;_0x5a606a[_0xe0bd('0x27')]=_0x543c59[_0xe0bd('0x18')]?(_0x5a606a['prefix']||'')+'${EXTEN:'+_0x543c59[_0xe0bd('0x18')]+'}':(_0x5a606a['prefix']||'')+_0xe0bd('0x14');_0x5a534[_0xa7b799[_0x568e46][_0xe0bd('0x25')]]=['SIP',_0x5a606a[_0xe0bd('0x20')],_0x5a606a[_0xe0bd('0x27')]][_0xe0bd('0x28')]('/');break;case _0xe0bd('0x22'):_0x5a606a[_0xe0bd('0x22')]=_0x46e58d[_0xa7b799[_0x568e46][_0xe0bd('0x25')]];if(_0x543c59[_0xe0bd('0x1c')]!=='none'){if(_0x5a606a[_0xe0bd('0x22')][_0xe0bd('0x29')](_0xe0bd('0x2a'))<0x0){_0x5a606a[_0xe0bd('0x22')]+=_0xe0bd('0x2a');}}else{_0x5a606a['options']=_0x5a606a['options']['replace'](_0xe0bd('0x2a'),'');}_0x5a534[_0xa7b799[_0x568e46][_0xe0bd('0x25')]]=_0x5a606a[_0xe0bd('0x22')];break;default:_0x5a534[_0xa7b799[_0x568e46][_0xe0bd('0x25')]]=_0x46e58d[_0xa7b799[_0x568e46]['param']];}}return _0x5a534['join'](',');}function _0xd6418f(_0x19c426,_0x2f5314,_0x300c4d){return new Promise(function(_0x33e597,_0x1559d2){var _0x3d218d=[];if(_['isEmpty'](_0x2f5314))return _0x33e597(_0x3d218d);_0x3dc984[_0xe0bd('0x2b')]['findAll']({'attributes':['id',_0xe0bd('0x2c'),_0xe0bd('0x2d')],'raw':!![]})['then'](function(_0x4cfad0){for(var _0x2220b9=0x0,_0x12c1db=0x0;_0x2220b9<_0x2f5314[_0xe0bd('0x24')];_0x2220b9++,_0x12c1db=0x0){var _0x41202e=_0x2f5314[_0x2220b9];var _0x3f4a43=[];var _0x1bd42a=[];delete _0x41202e['id'];if(_0x41202e[_0xe0bd('0x2c')]!==_0xe0bd('0x2e')){_0x41202e[_0xe0bd('0x2f')]=[_0x41202e['interval']];}else{_0x41202e[_0xe0bd('0x2f')]=_0x41202e[_0xe0bd('0x2d')]?_[_0xe0bd('0x30')](_['filter'](_0x4cfad0,{'IntervalId':_0x41202e[_0xe0bd('0x2d')]}),_0xe0bd('0x2c')):[];}_0x41202e['context']=_0x19c426[_0xe0bd('0x5')];_0x41202e[_0xe0bd('0x6')]=_0x19c426['exten'];if(_0x41202e[_0xe0bd('0x2')])_0x41202e[_0xe0bd('0x2')]=_0x41202e[_0xe0bd('0x2')]['toLowerCase']();if(_0x19c426[_0xe0bd('0x2')]===_0xe0bd('0x10')){if(_0x41202e[_0xe0bd('0x1b')](_0xe0bd('0x31'))&&_0x41202e[_0xe0bd('0x31')]&&_0x41202e[_0xe0bd('0x31')]!=='--'){_0x3f4a43[_0xe0bd('0xb')]({'type':_0x41202e[_0xe0bd('0x2')][_0xe0bd('0x32')](),'app':'Set','appdata':'CDR(tag)='+_0x41202e['tag'],'context':_0x19c426[_0xe0bd('0x5')],'exten':_0x19c426[_0xe0bd('0x6')],'priority':_0x41202e['intervals'][_0xe0bd('0x24')]+_0x300c4d+_0x12c1db++,'VoiceExtensionId':_0x19c426['id']});}_0x3f4a43[_0xe0bd('0xb')]({'type':_0x41202e[_0xe0bd('0x2')][_0xe0bd('0x32')](),'app':_0xe0bd('0x15'),'appdata':_0xe0bd('0x33')+(_0x41202e[_0xe0bd('0x34')]?_0xe0bd('0x35')+_0x41202e[_0xe0bd('0x34')]+')':_0xe0bd('0x36')),'context':_0x19c426['context'],'exten':_0x19c426[_0xe0bd('0x6')],'priority':_0x41202e[_0xe0bd('0x2f')][_0xe0bd('0x24')]+_0x300c4d+_0x12c1db++,'VoiceExtensionId':_0x19c426['id']});}else{if(_0x41202e['hasOwnProperty'](_0xe0bd('0x37'))){if([_0xe0bd('0x38'),_0xe0bd('0x39')][_0xe0bd('0x3a')](_0x41202e[_0xe0bd('0x3b')][_0xe0bd('0x32')]())&&_0x41202e[_0xe0bd('0x3c')]!==_0xe0bd('0x3d')){if(_0x41202e[_0xe0bd('0x37')]){_0x3f4a43['push']({'type':_0x41202e[_0xe0bd('0x2')][_0xe0bd('0x32')](),'app':_0xe0bd('0x15'),'appdata':_0xe0bd('0x3e'),'context':_0x19c426['context'],'exten':_0x19c426[_0xe0bd('0x6')],'priority':_0x41202e[_0xe0bd('0x2f')][_0xe0bd('0x24')]+_0x300c4d+_0x12c1db++,'VoiceExtensionId':_0x19c426['id']});_0x3f4a43['push']({'type':_0x41202e['type'][_0xe0bd('0x32')](),'app':_0xe0bd('0x3'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x19c426[_0xe0bd('0x5')],'exten':_0x19c426[_0xe0bd('0x6')],'priority':_0x41202e[_0xe0bd('0x2f')][_0xe0bd('0x24')]+_0x300c4d+_0x12c1db++,'VoiceExtensionId':_0x19c426['id']});}else{_0x3f4a43['push']({'type':_0x41202e[_0xe0bd('0x2')][_0xe0bd('0x32')](),'app':_0xe0bd('0x15'),'appdata':_0xe0bd('0x3f'),'context':_0x19c426[_0xe0bd('0x5')],'exten':_0x19c426[_0xe0bd('0x6')],'priority':_0x41202e[_0xe0bd('0x2f')]['length']+_0x300c4d+_0x12c1db++,'VoiceExtensionId':_0x19c426['id']});_0x3f4a43[_0xe0bd('0xb')]({'type':_0x41202e[_0xe0bd('0x2')][_0xe0bd('0x32')](),'app':_0xe0bd('0x3'),'appdata':_0xe0bd('0x40'),'context':_0x19c426[_0xe0bd('0x5')],'exten':_0x19c426[_0xe0bd('0x6')],'priority':_0x41202e[_0xe0bd('0x2f')][_0xe0bd('0x24')]+_0x300c4d+_0x12c1db++,'VoiceExtensionId':_0x19c426['id']});}}}}for(var _0x25c3ef=0x0;_0x25c3ef<_0x41202e[_0xe0bd('0x2f')][_0xe0bd('0x24')];_0x25c3ef++){var _0x31ab5a=_0x300c4d+_0x41202e[_0xe0bd('0x2f')][_0xe0bd('0x24')];var _0x2fa8a0=_0x25c3ef===_0x41202e[_0xe0bd('0x2f')][_0xe0bd('0x24')]-0x1?_0x300c4d+_0x3f4a43[_0xe0bd('0x24')]+_0x1bd42a[_0xe0bd('0x24')]+0x2:_0x300c4d+_0x25c3ef+0x1;_0x3f4a43[_0xe0bd('0x41')](_0x25c3ef,0x0,{'type':_0x19c426[_0xe0bd('0x2')],'app':_0xe0bd('0x42'),'appdata':_0x41202e['intervals'][_0x25c3ef]+'?'+_0x19c426['context']+_0xe0bd('0x43')+_0x31ab5a+':'+_0x19c426[_0xe0bd('0x5')]+_0xe0bd('0x43')+_0x2fa8a0,'exten':_0x19c426['exten'],'context':_0x19c426['context'],'priority':_0x300c4d+_0x25c3ef,'VoiceExtensionId':_0x19c426['id']});}if(_0x41202e['appType']===_0xe0bd('0x44'))_0x41202e[_0xe0bd('0x45')]=_0x1371d0(_0x19c426,_0x41202e['appdata']);_0x41202e[_0xe0bd('0x46')]=_0x3f4a43['length']?_[_0xe0bd('0x47')](_0x3f4a43)[_0xe0bd('0x46')]+0x1:_0x300c4d;_0x3d218d=_[_0xe0bd('0x48')](_0x3d218d,_0x3f4a43,[_0x41202e],_0x1bd42a);_0x300c4d=_['last'](_0x3d218d)['priority']+0x1;}return _0x33e597(_0x3d218d);})['catch'](function(_0x13a86e){_0x1559d2(_0x13a86e);});});}return _0x3fb344[_0xe0bd('0x49')](_0xe0bd('0x4a'),attributes,{'tableName':_0xe0bd('0x4b'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x3f3ee0){var _0x371557=this['get']({'plain':!![]});var _0x338028=_0x371557[_0xe0bd('0x2')]==='outbound'?_0x379ea2(_0x371557):_0x1e198a(_0x371557);return _0xd6418f(_0x371557,_0x3f3ee0,_[_0xe0bd('0x47')](_0x338028)[_0xe0bd('0x46')]+0x1)[_0xe0bd('0x4c')](function(_0x16825e){var _0x18c16b=_[_0xe0bd('0x48')](_0x338028,_0x16825e);_0x18c16b[_0xe0bd('0xb')]({'type':_0x371557[_0xe0bd('0x2')],'app':'Hangup','exten':_0x371557[_0xe0bd('0x6')],'context':_0x371557[_0xe0bd('0x5')],'priority':_[_0xe0bd('0x47')](_0x18c16b)['priority']+0x1,'VoiceExtensionId':_0x371557['id']});return _0x18c16b;});}}});};
\ No newline at end of file
index 99eddaa..a492625 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d87=['catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','model','map','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result'];(function(_0x4a6c3a,_0x26d684){var _0x175496=function(_0x543e3a){while(--_0x543e3a){_0x4a6c3a['push'](_0x4a6c3a['shift']());}};_0x175496(++_0x26d684);}(_0x4d87,0xf0));var _0x74d8=function(_0x4641a7,_0x448505){_0x4641a7=_0x4641a7-0x0;var _0xb8ddec=_0x4d87[_0x4641a7];return _0xb8ddec;};'use strict';var _=require('lodash');var util=require(_0x74d8('0x0'));var moment=require(_0x74d8('0x1'));var BPromise=require(_0x74d8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x74d8('0x3'));var db=require(_0x74d8('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x74d8('0x5'));var config=require(_0x74d8('0x6'));var jayson=require(_0x74d8('0x7'));var client=jayson[_0x74d8('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x74d8('0x9')],{'host':_0x74d8('0xa'),'port':0x18eb});var socket=require(_0x74d8('0xb'))(new Redis(config[_0x74d8('0x9')]));require(_0x74d8('0xc'))[_0x74d8('0xd')](socket);function respondWithRpcPromise(_0x5e1ba0,_0x924d2c,_0xbf5ea1){return new BPromise(function(_0xc1e3c0,_0xa6301a){return client[_0x74d8('0xe')](_0x5e1ba0,_0xbf5ea1)[_0x74d8('0xf')](function(_0x40d175){logger[_0x74d8('0x10')](_0x74d8('0x11'),_0x924d2c,'request\x20sent');logger[_0x74d8('0x12')](_0x74d8('0x13'),_0x924d2c,'request\x20sent',JSON[_0x74d8('0x14')](_0x40d175));if(_0x40d175[_0x74d8('0x15')]){if(_0x40d175[_0x74d8('0x15')][_0x74d8('0x16')]===0x1f4){logger[_0x74d8('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x924d2c,_0x40d175['error']['message']);return _0xa6301a(_0x40d175[_0x74d8('0x15')][_0x74d8('0x17')]);}logger[_0x74d8('0x15')](_0x74d8('0x11'),_0x924d2c,_0x40d175[_0x74d8('0x15')][_0x74d8('0x17')]);return _0xc1e3c0(_0x40d175['error'][_0x74d8('0x17')]);}else{logger['info'](_0x74d8('0x11'),_0x924d2c,_0x74d8('0x18'));_0xc1e3c0(_0x40d175[_0x74d8('0x19')][_0x74d8('0x17')]);}})[_0x74d8('0x1a')](function(_0x22a331){logger[_0x74d8('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x924d2c,_0x22a331);_0xa6301a(_0x22a331);});});}exports[_0x74d8('0x1b')]=function(_0x2823f5){var _0x480b8a=this;return new Promise(function(_0x1b3f24,_0x3ea248){return db[_0x74d8('0x1c')][_0x74d8('0x1d')]({'raw':_0x2823f5[_0x74d8('0x1e')]?_0x2823f5[_0x74d8('0x1e')][_0x74d8('0x1f')]===undefined?!![]:![]:!![],'where':_0x2823f5[_0x74d8('0x1e')]?_0x2823f5[_0x74d8('0x1e')][_0x74d8('0x20')]||null:null,'attributes':_0x2823f5[_0x74d8('0x1e')]?_0x2823f5[_0x74d8('0x1e')][_0x74d8('0x21')]||null:null,'limit':_0x2823f5[_0x74d8('0x1e')]?_0x2823f5[_0x74d8('0x1e')][_0x74d8('0x22')]||null:null,'include':_0x2823f5[_0x74d8('0x1e')]?_0x2823f5[_0x74d8('0x1e')][_0x74d8('0x23')]?_['map'](_0x2823f5[_0x74d8('0x1e')][_0x74d8('0x23')],function(_0x252aa3){return{'model':db[_0x252aa3[_0x74d8('0x24')]],'as':_0x252aa3['as'],'attributes':_0x252aa3[_0x74d8('0x21')],'include':_0x252aa3[_0x74d8('0x23')]?_[_0x74d8('0x25')](_0x252aa3[_0x74d8('0x23')],function(_0x35a750){return{'model':db[_0x35a750[_0x74d8('0x24')]],'as':_0x35a750['as'],'attributes':_0x35a750[_0x74d8('0x21')],'include':_0x35a750['include']?_[_0x74d8('0x25')](_0x35a750[_0x74d8('0x23')],function(_0x54124d){return{'model':db[_0x54124d[_0x74d8('0x24')]],'as':_0x54124d['as'],'attributes':_0x54124d[_0x74d8('0x21')]};}):[]};}):[]};}):[]:[]})[_0x74d8('0xf')](function(_0x30ac88){logger['info'](_0x74d8('0x1b'),_0x2823f5);logger[_0x74d8('0x12')](_0x74d8('0x1b'),_0x2823f5,JSON[_0x74d8('0x14')](_0x30ac88));_0x1b3f24(_0x30ac88);})['catch'](function(_0x2b6f84){logger[_0x74d8('0x15')](_0x74d8('0x1b'),_0x2b6f84[_0x74d8('0x17')],_0x2823f5);_0x3ea248(_0x480b8a['error'](0x1f4,_0x2b6f84[_0x74d8('0x17')]));});});};
\ No newline at end of file
+var _0x0967=['client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','include','model','map','attributes','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x20298c,_0x338e1e){var _0x26fcc1=function(_0x305710){while(--_0x305710){_0x20298c['push'](_0x20298c['shift']());}};_0x26fcc1(++_0x338e1e);}(_0x0967,0x100));var _0x7096=function(_0x1d2684,_0x2f5da5){_0x1d2684=_0x1d2684-0x0;var _0xc81051=_0x0967[_0x1d2684];return _0xc81051;};'use strict';var _=require(_0x7096('0x0'));var util=require('util');var moment=require(_0x7096('0x1'));var BPromise=require(_0x7096('0x2'));var rs=require(_0x7096('0x3'));var fs=require('fs');var Redis=require(_0x7096('0x4'));var db=require(_0x7096('0x5'))['db'];var utils=require(_0x7096('0x6'));var logger=require(_0x7096('0x7'))(_0x7096('0x8'));var config=require('../../config/environment');var jayson=require(_0x7096('0x9'));var client=jayson[_0x7096('0xa')][_0x7096('0xb')]({'port':0x232a});config[_0x7096('0xc')]=_[_0x7096('0xd')](config[_0x7096('0xc')],{'host':_0x7096('0xe'),'port':0x18eb});var socket=require(_0x7096('0xf'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0x7096('0x10')](socket);function respondWithRpcPromise(_0x162c0a,_0x1e7792,_0x5781b5){return new BPromise(function(_0x4b8f7a,_0x2cd64a){return client[_0x7096('0x11')](_0x162c0a,_0x5781b5)[_0x7096('0x12')](function(_0x5703c2){logger['info'](_0x7096('0x13'),_0x1e7792,_0x7096('0x14'));logger['debug'](_0x7096('0x15'),_0x1e7792,'request\x20sent',JSON[_0x7096('0x16')](_0x5703c2));if(_0x5703c2[_0x7096('0x17')]){if(_0x5703c2['error'][_0x7096('0x18')]===0x1f4){logger[_0x7096('0x17')](_0x7096('0x13'),_0x1e7792,_0x5703c2[_0x7096('0x17')][_0x7096('0x19')]);return _0x2cd64a(_0x5703c2[_0x7096('0x17')]['message']);}logger[_0x7096('0x17')](_0x7096('0x13'),_0x1e7792,_0x5703c2[_0x7096('0x17')][_0x7096('0x19')]);return _0x4b8f7a(_0x5703c2[_0x7096('0x17')]['message']);}else{logger[_0x7096('0x1a')](_0x7096('0x13'),_0x1e7792,_0x7096('0x14'));_0x4b8f7a(_0x5703c2['result']['message']);}})[_0x7096('0x1b')](function(_0x4a4cf8){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x1e7792,_0x4a4cf8);_0x2cd64a(_0x4a4cf8);});});}exports[_0x7096('0x1c')]=function(_0x3b295a){var _0x32f448=this;return new Promise(function(_0x3f2fda,_0xbd59a9){return db[_0x7096('0x1d')][_0x7096('0x1e')]({'raw':_0x3b295a[_0x7096('0x1f')]?_0x3b295a['options'][_0x7096('0x20')]===undefined?!![]:![]:!![],'where':_0x3b295a[_0x7096('0x1f')]?_0x3b295a[_0x7096('0x1f')]['where']||null:null,'attributes':_0x3b295a[_0x7096('0x1f')]?_0x3b295a['options']['attributes']||null:null,'limit':_0x3b295a[_0x7096('0x1f')]?_0x3b295a['options']['limit']||null:null,'include':_0x3b295a[_0x7096('0x1f')]?_0x3b295a['options'][_0x7096('0x21')]?_['map'](_0x3b295a['options'][_0x7096('0x21')],function(_0x4a6423){return{'model':db[_0x4a6423[_0x7096('0x22')]],'as':_0x4a6423['as'],'attributes':_0x4a6423['attributes'],'include':_0x4a6423[_0x7096('0x21')]?_[_0x7096('0x23')](_0x4a6423['include'],function(_0x3b14ac){return{'model':db[_0x3b14ac[_0x7096('0x22')]],'as':_0x3b14ac['as'],'attributes':_0x3b14ac['attributes'],'include':_0x3b14ac['include']?_['map'](_0x3b14ac[_0x7096('0x21')],function(_0x2a6126){return{'model':db[_0x2a6126[_0x7096('0x22')]],'as':_0x2a6126['as'],'attributes':_0x2a6126[_0x7096('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x433e67){logger[_0x7096('0x1a')](_0x7096('0x1c'),_0x3b295a);logger[_0x7096('0x25')](_0x7096('0x1c'),_0x3b295a,JSON[_0x7096('0x16')](_0x433e67));_0x3f2fda(_0x433e67);})[_0x7096('0x1b')](function(_0x1611f9){logger[_0x7096('0x17')](_0x7096('0x1c'),_0x1611f9['message'],_0x3b295a);_0xbd59a9(_0x32f448['error'](0x1f4,_0x1611f9[_0x7096('0x19')]));});});};
\ No newline at end of file
index 644e10e..b5dcedc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabce=['voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x9d5b0f,_0x235c56){var _0x3a08ea=function(_0x2996b1){while(--_0x2996b1){_0x9d5b0f['push'](_0x9d5b0f['shift']());}};_0x3a08ea(++_0x235c56);}(_0xabce,0x103));var _0xeabc=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xabce[_0x4fc9e6];return _0x551d28;};'use strict';var VoiceExtensionEvents=require(_0xeabc('0x0'));var events=[_0xeabc('0x1'),_0xeabc('0x2'),_0xeabc('0x3')];function createListener(_0x49dbcc,_0x5bd1a4){return function(_0x5ebc95){_0x5bd1a4[_0xeabc('0x4')](_0x49dbcc,_0x5ebc95);};}function removeListener(_0x1d9f37,_0x1a88a7){return function(){VoiceExtensionEvents['removeListener'](_0x1d9f37,_0x1a88a7);};}exports['register']=function(_0x1b07a8){for(var _0x52a4d7=0x0,_0x229ba4=events['length'];_0x52a4d7<_0x229ba4;_0x52a4d7++){var _0x3bdc29=events[_0x52a4d7];var _0x9417af=createListener(_0xeabc('0x5')+_0x3bdc29,_0x1b07a8);VoiceExtensionEvents['on'](_0x3bdc29,_0x9417af);}};
\ No newline at end of file
+var _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0x43469b,_0x1e9d5c){var _0x514426=function(_0x259fe9){while(--_0x259fe9){_0x43469b['push'](_0x43469b['shift']());}};_0x514426(++_0x1e9d5c);}(_0xe14b,0x93));var _0xbe14=function(_0x2a4d5a,_0x487c39){_0x2a4d5a=_0x2a4d5a-0x0;var _0x5345e5=_0xe14b[_0x2a4d5a];return _0x5345e5;};'use strict';var VoiceExtensionEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){VoiceExtensionEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('voiceExtension:'+_0x196fca,_0x1fe204);VoiceExtensionEvents['on'](_0x196fca,_0x566ae7);}};
\ No newline at end of file
index b1873f9..49aa8ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fb4=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','getMessages','post','create','put'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x4fb4,0x190));var _0x44fb=function(_0x5da77b,_0x36a2af){_0x5da77b=_0x5da77b-0x0;var _0x2b65de=_0x4fb4[_0x5da77b];return _0x2b65de;};'use strict';var multer=require('multer');var util=require(_0x44fb('0x0'));var path=require(_0x44fb('0x1'));var timeout=require(_0x44fb('0x2'));var express=require(_0x44fb('0x3'));var router=express[_0x44fb('0x4')]();var fs_extra=require(_0x44fb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x44fb('0x6'));var config=require(_0x44fb('0x7'));var controller=require(_0x44fb('0x8'));router[_0x44fb('0x9')]('/',auth[_0x44fb('0xa')](),controller[_0x44fb('0xb')]);router[_0x44fb('0x9')](_0x44fb('0xc'),auth['isAuthenticated'](),controller[_0x44fb('0xd')]);router[_0x44fb('0x9')]('/:id/messages',auth[_0x44fb('0xa')](),controller[_0x44fb('0xe')]);router[_0x44fb('0xf')]('/',auth[_0x44fb('0xa')](),controller[_0x44fb('0x10')]);router[_0x44fb('0x11')](_0x44fb('0xc'),auth[_0x44fb('0xa')](),controller[_0x44fb('0x12')]);router[_0x44fb('0x13')]('/:id',auth[_0x44fb('0xa')](),controller[_0x44fb('0x14')]);module[_0x44fb('0x15')]=router;
\ No newline at end of file
+var _0x11e5=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','show','/:id/messages','getMessages','post','create','put','/:id','delete','destroy','exports','multer'];(function(_0x350057,_0x5a97de){var _0x1d7c9f=function(_0x22f11c){while(--_0x22f11c){_0x350057['push'](_0x350057['shift']());}};_0x1d7c9f(++_0x5a97de);}(_0x11e5,0x8b));var _0x511e=function(_0x3f1b70,_0x52affe){_0x3f1b70=_0x3f1b70-0x0;var _0x373e90=_0x11e5[_0x3f1b70];return _0x373e90;};'use strict';var multer=require(_0x511e('0x0'));var util=require('util');var path=require(_0x511e('0x1'));var timeout=require(_0x511e('0x2'));var express=require('express');var router=express[_0x511e('0x3')]();var fs_extra=require(_0x511e('0x4'));var auth=require(_0x511e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x511e('0x6'));var controller=require('./voiceMail.controller');router['get']('/',auth[_0x511e('0x7')](),controller[_0x511e('0x8')]);router[_0x511e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x511e('0xa')]);router[_0x511e('0x9')](_0x511e('0xb'),auth[_0x511e('0x7')](),controller[_0x511e('0xc')]);router[_0x511e('0xd')]('/',auth[_0x511e('0x7')](),controller[_0x511e('0xe')]);router[_0x511e('0xf')](_0x511e('0x10'),auth[_0x511e('0x7')](),controller['update']);router[_0x511e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x511e('0x12')]);module[_0x511e('0x13')]=router;
\ No newline at end of file
index 0bb1608..d968a78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28af=['getDataValue','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','INTEGER','VIRTUAL','fullname','\x20-\x20'];(function(_0x27d958,_0x29ef87){var _0x53e63e=function(_0x4130ec){while(--_0x4130ec){_0x27d958['push'](_0x27d958['shift']());}};_0x53e63e(++_0x29ef87);}(_0x28af,0xda));var _0xf28a=function(_0x27d958,_0x29ef87){_0x27d958=_0x27d958-0x0;var _0x53e63e=_0x28af[_0x27d958];return _0x53e63e;};'use strict';var Sequelize=require(_0xf28a('0x0'));module[_0xf28a('0x1')]={'customer_id':{'type':Sequelize[_0xf28a('0x2')]},'context':{'type':Sequelize[_0xf28a('0x2')],'defaultValue':_0xf28a('0x3'),'unique':_0xf28a('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0xf28a('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0xf28a('0x2')]},'email':{'type':Sequelize[_0xf28a('0x2')],'validate':{'isEmail':!![]},'set':function(_0x2c8037){this[_0xf28a('0x5')](_0xf28a('0x6'),typeof _0x2c8037===_0xf28a('0x7')&&_0x2c8037[_0xf28a('0x8')]()?_0x2c8037[_0xf28a('0x8')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0xf28a('0x2')],'defaultValue':_0xf28a('0x9')},'attach':{'type':Sequelize[_0xf28a('0xa')](_0xf28a('0xb'),'no'),'defaultValue':_0xf28a('0xb'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0xf28a('0xb'),'no'),'defaultValue':_0xf28a('0xb'),'allowNull':![]},'dialout':{'type':Sequelize[_0xf28a('0x2')]},'callback':{'type':Sequelize[_0xf28a('0x2')]},'review':{'type':Sequelize[_0xf28a('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xf28a('0xa')](_0xf28a('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xf28a('0xa')](_0xf28a('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xf28a('0xa')](_0xf28a('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xf28a('0xa')](_0xf28a('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xf28a('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xf28a('0xa')]('yes','no'),'defaultValue':_0xf28a('0xb'),'allowNull':![]},'forcename':{'type':Sequelize[_0xf28a('0xa')](_0xf28a('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xf28a('0xa')](_0xf28a('0xb'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xf28a('0xa')]('yes','no'),'defaultValue':_0xf28a('0xb'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0xf28a('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0xf28a('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xf28a('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xf28a('0xd')],'get':function(){return this['getDataValue'](_0xf28a('0xe'))+_0xf28a('0xf')+this[_0xf28a('0x10')](_0xf28a('0x11'));}}};
\ No newline at end of file
+var _0xc5b1=['mailbox','sequelize','exports','from-voicemail','STRING','contest_mailbox','setDataValue','trim','central','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','\x20-\x20'];(function(_0x1441a4,_0x5e7cbc){var _0x1bc254=function(_0x324c17){while(--_0x324c17){_0x1441a4['push'](_0x1441a4['shift']());}};_0x1bc254(++_0x5e7cbc);}(_0xc5b1,0x111));var _0x1c5b=function(_0x33dabb,_0x4d9e94){_0x33dabb=_0x33dabb-0x0;var _0xce36f6=_0xc5b1[_0x33dabb];return _0xce36f6;};'use strict';var Sequelize=require(_0x1c5b('0x0'));module[_0x1c5b('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0x1c5b('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x1c5b('0x3')],'defaultValue':'','allowNull':![],'unique':_0x1c5b('0x4')},'password':{'type':Sequelize[_0x1c5b('0x3')]},'fullname':{'type':Sequelize[_0x1c5b('0x3')]},'email':{'type':Sequelize[_0x1c5b('0x3')],'validate':{'isEmail':!![]},'set':function(_0x1f51ca){this[_0x1c5b('0x5')]('email',typeof _0x1f51ca==='string'&&_0x1f51ca[_0x1c5b('0x6')]()?_0x1f51ca[_0x1c5b('0x6')]():null);}},'pager':{'type':Sequelize[_0x1c5b('0x3')]},'tz':{'type':Sequelize[_0x1c5b('0x3')],'defaultValue':_0x1c5b('0x7')},'attach':{'type':Sequelize[_0x1c5b('0x8')](_0x1c5b('0x9'),'no'),'defaultValue':_0x1c5b('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x1c5b('0x8')](_0x1c5b('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x1c5b('0x8')](_0x1c5b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x1c5b('0x8')](_0x1c5b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x1c5b('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x1c5b('0x8')](_0x1c5b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x1c5b('0x8')](_0x1c5b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x1c5b('0x8')](_0x1c5b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x1c5b('0x8')]('yes','no'),'defaultValue':_0x1c5b('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x1c5b('0x8')](_0x1c5b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x1c5b('0x8')](_0x1c5b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x1c5b('0x8')]('yes','no'),'defaultValue':_0x1c5b('0x9'),'allowNull':![]},'stamp':{'type':_0x1c5b('0xa')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x1c5b('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x1c5b('0xc')],'get':function(){return this[_0x1c5b('0xd')]('fullname')+_0x1c5b('0xe')+this['getDataValue'](_0x1c5b('0xf'));}}};
\ No newline at end of file
index 2f50643..28feb2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3de3=['fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','params','include','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','getMessages','VoiceMailMessage','mailbox','findAndCountAll','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','get','Voicemails','UserProfileResource','destroy','error','name','send','index','map','VoiceMail','fieldName','keys','intersection','model','query','attributes'];(function(_0x3ec882,_0x1bf419){var _0x396bed=function(_0x3099c0){while(--_0x3099c0){_0x3ec882['push'](_0x3ec882['shift']());}};_0x396bed(++_0x1bf419);}(_0x3de3,0x1ce));var _0x33de=function(_0x1803f8,_0x5cb239){_0x1803f8=_0x1803f8-0x0;var _0x36e7a1=_0x3de3[_0x1803f8];return _0x36e7a1;};'use strict';var emlformat=require(_0x33de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x33de('0x1'));var jsonpatch=require(_0x33de('0x2'));var rp=require('request-promise');var moment=require(_0x33de('0x3'));var BPromise=require(_0x33de('0x4'));var Mustache=require(_0x33de('0x5'));var util=require(_0x33de('0x6'));var path=require('path');var sox=require(_0x33de('0x7'));var csv=require(_0x33de('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x33de('0x9'));var _=require('lodash');var squel=require(_0x33de('0xa'));var crypto=require(_0x33de('0xb'));var jsforce=require(_0x33de('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x33de('0x8'));var querystring=require(_0x33de('0xd'));var Papa=require(_0x33de('0xe'));var Redis=require('ioredis');var authService=require(_0x33de('0xf'));var qs=require(_0x33de('0x10'));var as=require(_0x33de('0x11'));var hardwareService=require(_0x33de('0x12'));var logger=require(_0x33de('0x13'))(_0x33de('0x14'));var utils=require(_0x33de('0x15'));var config=require(_0x33de('0x16'));var licenseUtil=require(_0x33de('0x17'));var db=require(_0x33de('0x18'))['db'];function respondWithStatusCode(_0x27d1d8,_0x5170ad){_0x5170ad=_0x5170ad||0xcc;return function(_0x6b1a4c){if(_0x6b1a4c){return _0x27d1d8[_0x33de('0x19')](_0x5170ad);}return _0x27d1d8['status'](_0x5170ad)['end']();};}function respondWithResult(_0x4164ab,_0x22bda8){_0x22bda8=_0x22bda8||0xc8;return function(_0x2b3748){if(_0x2b3748){return _0x4164ab[_0x33de('0x1a')](_0x22bda8)['json'](_0x2b3748);}};}function respondWithFilteredResult(_0x11e6b5,_0x1b1166){return function(_0x522ba0){if(_0x522ba0){var _0x4ff69f=typeof _0x1b1166[_0x33de('0x1b')]===_0x33de('0x1c')&&typeof _0x1b1166[_0x33de('0x1d')]==='undefined';var _0x2db887=_0x522ba0[_0x33de('0x1e')];var _0x52cfa0=_0x4ff69f?0x0:_0x1b1166[_0x33de('0x1b')];var _0x201ff3=_0x4ff69f?_0x522ba0['count']:_0x1b1166['offset']+_0x1b1166[_0x33de('0x1d')];var _0x52d718;if(_0x201ff3>=_0x2db887){_0x201ff3=_0x2db887;_0x52d718=0xc8;}else{_0x52d718=0xce;}_0x11e6b5[_0x33de('0x1a')](_0x52d718);return _0x11e6b5[_0x33de('0x1f')](_0x33de('0x20'),_0x52cfa0+'-'+_0x201ff3+'/'+_0x2db887)[_0x33de('0x21')](_0x522ba0);}return null;};}function patchUpdates(_0xc4f1a4){return function(_0x40a8e6){try{jsonpatch[_0x33de('0x22')](_0x40a8e6,_0xc4f1a4,!![]);}catch(_0x493263){return BPromise['reject'](_0x493263);}return _0x40a8e6[_0x33de('0x23')]();};}function saveUpdates(_0x5af3fa,_0x8acd8d){return function(_0x4cd8db){if(_0x4cd8db){return _0x4cd8db[_0x33de('0x24')](_0x5af3fa)[_0x33de('0x25')](function(_0x575e88){return _0x575e88;});}return null;};}function removeEntity(_0x2dbcf2,_0x5cd77e){return function(_0x67d040){if(_0x67d040){return _0x67d040['destroy']()[_0x33de('0x25')](function(){var _0x24e282=_0x67d040[_0x33de('0x26')]({'plain':!![]});var _0x5b79d7=_0x33de('0x27');return db[_0x33de('0x28')][_0x33de('0x29')]({'where':{'type':_0x5b79d7,'resourceId':_0x24e282['id']}})['then'](function(){return _0x67d040;});})[_0x33de('0x25')](function(){_0x2dbcf2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c8de9,_0x17c760){return function(_0x1a870a){if(!_0x1a870a){_0x1c8de9[_0x33de('0x19')](0x194);}return _0x1a870a;};}function handleError(_0x44b10e,_0x160687){_0x160687=_0x160687||0x1f4;return function(_0x3f22fb){logger[_0x33de('0x2a')](_0x3f22fb['stack']);if(_0x3f22fb['name']){delete _0x3f22fb[_0x33de('0x2b')];}_0x44b10e[_0x33de('0x1a')](_0x160687)[_0x33de('0x2c')](_0x3f22fb);};}exports[_0x33de('0x2d')]=function(_0x167cec,_0x20f393){var _0x427e82={},_0x4e1898={},_0x282158={'count':0x0,'rows':[]};var _0x1cee91=_[_0x33de('0x2e')](db[_0x33de('0x2f')]['rawAttributes'],function(_0xe5dc68){return{'name':_0xe5dc68[_0x33de('0x30')],'type':_0xe5dc68['type']['key']};});_0x4e1898['model']=_[_0x33de('0x2e')](_0x1cee91,_0x33de('0x2b'));_0x4e1898['query']=_[_0x33de('0x31')](_0x167cec['query']);_0x4e1898['filters']=_[_0x33de('0x32')](_0x4e1898[_0x33de('0x33')],_0x4e1898[_0x33de('0x34')]);_0x427e82[_0x33de('0x35')]=_[_0x33de('0x32')](_0x4e1898[_0x33de('0x33')],qs[_0x33de('0x36')](_0x167cec[_0x33de('0x34')]['fields']));_0x427e82[_0x33de('0x35')]=_0x427e82['attributes'][_0x33de('0x37')]?_0x427e82['attributes']:_0x4e1898['model'];if(!_0x167cec[_0x33de('0x34')][_0x33de('0x38')](_0x33de('0x39'))){_0x427e82[_0x33de('0x1d')]=qs[_0x33de('0x1d')](_0x167cec[_0x33de('0x34')]['limit']);_0x427e82[_0x33de('0x1b')]=qs[_0x33de('0x1b')](_0x167cec[_0x33de('0x34')][_0x33de('0x1b')]);}_0x427e82[_0x33de('0x3a')]=qs[_0x33de('0x3b')](_0x167cec[_0x33de('0x34')]['sort']);_0x427e82[_0x33de('0x3c')]=qs[_0x33de('0x3d')](_[_0x33de('0x3e')](_0x167cec[_0x33de('0x34')],_0x4e1898[_0x33de('0x3d')]),_0x1cee91);if(_0x167cec[_0x33de('0x34')][_0x33de('0x3f')]){_0x427e82['where']=_[_0x33de('0x40')](_0x427e82[_0x33de('0x3c')],{'$or':_[_0x33de('0x2e')](_0x1cee91,function(_0x7eaa40){if(_0x7eaa40[_0x33de('0x41')]!==_0x33de('0x42')){var _0x58f236={};_0x58f236[_0x7eaa40[_0x33de('0x2b')]]={'$like':'%'+_0x167cec['query'][_0x33de('0x3f')]+'%'};return _0x58f236;}})});}_0x427e82=_[_0x33de('0x40')]({},_0x427e82,_0x167cec['options']);var _0x198b72={'where':_0x427e82[_0x33de('0x3c')]};return db[_0x33de('0x2f')][_0x33de('0x1e')](_0x198b72)[_0x33de('0x25')](function(_0x4251e3){_0x282158[_0x33de('0x1e')]=_0x4251e3;if(_0x167cec[_0x33de('0x34')][_0x33de('0x43')]){_0x427e82['include']=[{'all':!![]}];}return db['VoiceMail'][_0x33de('0x44')](_0x427e82);})[_0x33de('0x25')](function(_0x20d04f){_0x282158[_0x33de('0x45')]=_0x20d04f;return _0x282158;})['then'](respondWithFilteredResult(_0x20f393,_0x427e82))[_0x33de('0x46')](handleError(_0x20f393,null));};exports['show']=function(_0x553ef2,_0x1f164c){var _0x3caa1f={'raw':!![],'where':{'id':_0x553ef2[_0x33de('0x47')]['id']}},_0x384b12={};_0x384b12[_0x33de('0x33')]=_[_0x33de('0x31')](db[_0x33de('0x2f')]['rawAttributes']);_0x384b12[_0x33de('0x34')]=_['keys'](_0x553ef2[_0x33de('0x34')]);_0x384b12['filters']=_[_0x33de('0x32')](_0x384b12[_0x33de('0x33')],_0x384b12['query']);_0x3caa1f[_0x33de('0x35')]=_[_0x33de('0x32')](_0x384b12[_0x33de('0x33')],qs['fields'](_0x553ef2['query'][_0x33de('0x36')]));_0x3caa1f[_0x33de('0x35')]=_0x3caa1f['attributes']['length']?_0x3caa1f[_0x33de('0x35')]:_0x384b12['model'];if(_0x553ef2['query']['includeAll']){_0x3caa1f[_0x33de('0x48')]=[{'all':!![]}];}_0x3caa1f=_[_0x33de('0x40')]({},_0x3caa1f,_0x553ef2[_0x33de('0x49')]);return db[_0x33de('0x2f')]['find'](_0x3caa1f)['then'](handleEntityNotFound(_0x1f164c,null))[_0x33de('0x25')](respondWithResult(_0x1f164c,null))[_0x33de('0x46')](handleError(_0x1f164c,null));};exports['create']=function(_0x1d016b,_0xc23633){return db[_0x33de('0x2f')][_0x33de('0x4a')](_0x1d016b[_0x33de('0x4b')],{})['then'](function(_0x185e5f){var _0x3bf2e3=_0x1d016b['user'][_0x33de('0x26')]({'plain':!![]});if(!_0x3bf2e3)throw new Error(_0x33de('0x4c'));if(_0x3bf2e3[_0x33de('0x4d')]===_0x33de('0x4e')){var _0xbbb376=_0x185e5f[_0x33de('0x26')]({'plain':!![]});var _0x3d6424=_0x33de('0x27');return db[_0x33de('0x4f')][_0x33de('0x50')]({'where':{'name':_0x3d6424,'userProfileId':_0x3bf2e3['userProfileId']},'raw':!![]})[_0x33de('0x25')](function(_0x3d66e1){if(_0x3d66e1&&_0x3d66e1[_0x33de('0x51')]===0x0){return db[_0x33de('0x28')][_0x33de('0x4a')]({'name':_0xbbb376[_0x33de('0x2b')],'resourceId':_0xbbb376['id'],'type':_0x3d66e1[_0x33de('0x2b')],'sectionId':_0x3d66e1['id']},{})['then'](function(){return _0x185e5f;});}else{return _0x185e5f;}})[_0x33de('0x46')](function(_0x32042e){logger[_0x33de('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32042e);throw _0x32042e;});}return _0x185e5f;})[_0x33de('0x25')](respondWithResult(_0xc23633,0xc9))[_0x33de('0x46')](handleError(_0xc23633,null));};exports[_0x33de('0x24')]=function(_0x303f72,_0x492aa7){if(_0x303f72['body']['id']){delete _0x303f72[_0x33de('0x4b')]['id'];}return db[_0x33de('0x2f')][_0x33de('0x50')]({'where':{'id':_0x303f72[_0x33de('0x47')]['id']}})[_0x33de('0x25')](handleEntityNotFound(_0x492aa7,null))['then'](saveUpdates(_0x303f72['body'],null))[_0x33de('0x25')](respondWithResult(_0x492aa7,null))[_0x33de('0x46')](handleError(_0x492aa7,null));};exports[_0x33de('0x29')]=function(_0x7112db,_0x3bd3b1){return db[_0x33de('0x2f')][_0x33de('0x50')]({'where':{'id':_0x7112db[_0x33de('0x47')]['id']}})[_0x33de('0x25')](handleEntityNotFound(_0x3bd3b1,null))['then'](removeEntity(_0x3bd3b1,null))[_0x33de('0x46')](handleError(_0x3bd3b1,null));};exports[_0x33de('0x52')]=function(_0x27b134,_0x5a0101,_0x1a34ea){return db['VoiceMail']['findOne']({'where':{'id':_0x27b134['params']['id']}})['then'](handleEntityNotFound(_0x5a0101,null))[_0x33de('0x25')](function(_0x36c4a2){var _0x4d3a85;var _0x397179={},_0x232840={};_0x232840['model']=_[_0x33de('0x31')](db[_0x33de('0x53')]['rawAttributes']);_0x232840[_0x33de('0x34')]=_[_0x33de('0x31')](_0x27b134[_0x33de('0x34')]);_0x232840[_0x33de('0x3d')]=_[_0x33de('0x32')](_0x232840[_0x33de('0x33')],_0x232840[_0x33de('0x34')]);_0x397179['attributes']=_['intersection'](_0x232840[_0x33de('0x33')],qs['fields'](_0x27b134[_0x33de('0x34')][_0x33de('0x36')]));_0x397179['attributes']=_0x397179[_0x33de('0x35')]['length']?_0x397179[_0x33de('0x35')]:_0x232840[_0x33de('0x33')];if(!_0x27b134['query']['hasOwnProperty'](_0x33de('0x39'))){_0x397179[_0x33de('0x1d')]=qs[_0x33de('0x1d')](_0x27b134[_0x33de('0x34')][_0x33de('0x1d')]);_0x397179['offset']=qs[_0x33de('0x1b')](_0x27b134[_0x33de('0x34')]['offset']);}_0x397179[_0x33de('0x3a')]=qs[_0x33de('0x3b')](_0x27b134['query'][_0x33de('0x3b')]);_0x397179[_0x33de('0x3c')]=qs['filters'](_['pick'](_0x27b134[_0x33de('0x34')],_0x232840['filters']));if(_0x27b134[_0x33de('0x34')]['filter']){_0x397179[_0x33de('0x3c')]=_['merge'](_0x397179['where'],{'$or':_['map'](_0x397179['attributes'],function(_0x50182b){var _0x4d290e={};_0x4d290e[_0x50182b]={'$like':'%'+_0x27b134[_0x33de('0x34')]['filter']+'%'};return _0x4d290e;})});}_0x397179[_0x33de('0x3c')]=_['merge'](_0x397179['where'],{'mailboxuser':_0x36c4a2[_0x33de('0x54')]});_0x397179=_[_0x33de('0x40')]({},_0x397179,_0x27b134[_0x33de('0x49')]);return db[_0x33de('0x53')][_0x33de('0x55')](_0x397179)[_0x33de('0x25')](respondWithFilteredResult(_0x5a0101,_0x397179));})[_0x33de('0x46')](handleError(_0x5a0101,null));};
\ No newline at end of file
+var _0xb7e7=['sort','where','pick','filter','options','show','params','keys','rawAttributes','intersection','includeAll','include','merge','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','VoiceMailMessage','findAndCountAll','eml-format','zip-dir','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','destroy','error','name','send','index','VoiceMail','fieldName','type','key','model','map','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x1d6f8c,_0x35f1e9){var _0x2df558=function(_0x2a0a83){while(--_0x2a0a83){_0x1d6f8c['push'](_0x1d6f8c['shift']());}};_0x2df558(++_0x35f1e9);}(_0xb7e7,0x121));var _0x7b7e=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0xb7e7[_0x342700];return _0x53406f;};'use strict';var emlformat=require(_0x7b7e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b7e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b7e('0x2'));var moment=require('moment');var BPromise=require(_0x7b7e('0x3'));var Mustache=require('mustache');var util=require(_0x7b7e('0x4'));var path=require(_0x7b7e('0x5'));var sox=require(_0x7b7e('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b7e('0x7'));var _=require(_0x7b7e('0x8'));var squel=require(_0x7b7e('0x9'));var crypto=require('crypto');var jsforce=require(_0x7b7e('0xa'));var deskjs=require(_0x7b7e('0xb'));var toCsv=require(_0x7b7e('0xc'));var querystring=require(_0x7b7e('0xd'));var Papa=require(_0x7b7e('0xe'));var Redis=require(_0x7b7e('0xf'));var authService=require(_0x7b7e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7b7e('0x11'));var hardwareService=require(_0x7b7e('0x12'));var logger=require(_0x7b7e('0x13'))(_0x7b7e('0x14'));var utils=require(_0x7b7e('0x15'));var config=require(_0x7b7e('0x16'));var licenseUtil=require(_0x7b7e('0x17'));var db=require(_0x7b7e('0x18'))['db'];function respondWithStatusCode(_0xaadda,_0x54d8ce){_0x54d8ce=_0x54d8ce||0xcc;return function(_0x267446){if(_0x267446){return _0xaadda[_0x7b7e('0x19')](_0x54d8ce);}return _0xaadda['status'](_0x54d8ce)[_0x7b7e('0x1a')]();};}function respondWithResult(_0x5976ac,_0x4c6011){_0x4c6011=_0x4c6011||0xc8;return function(_0x2889ed){if(_0x2889ed){return _0x5976ac[_0x7b7e('0x1b')](_0x4c6011)[_0x7b7e('0x1c')](_0x2889ed);}};}function respondWithFilteredResult(_0x457ec5,_0x3d2fb2){return function(_0x5703fd){if(_0x5703fd){var _0x51baf6=typeof _0x3d2fb2[_0x7b7e('0x1d')]===_0x7b7e('0x1e')&&typeof _0x3d2fb2[_0x7b7e('0x1f')]===_0x7b7e('0x1e');var _0x2cc400=_0x5703fd[_0x7b7e('0x20')];var _0x242368=_0x51baf6?0x0:_0x3d2fb2[_0x7b7e('0x1d')];var _0x2acb8c=_0x51baf6?_0x5703fd[_0x7b7e('0x20')]:_0x3d2fb2[_0x7b7e('0x1d')]+_0x3d2fb2[_0x7b7e('0x1f')];var _0x448980;if(_0x2acb8c>=_0x2cc400){_0x2acb8c=_0x2cc400;_0x448980=0xc8;}else{_0x448980=0xce;}_0x457ec5[_0x7b7e('0x1b')](_0x448980);return _0x457ec5[_0x7b7e('0x21')](_0x7b7e('0x22'),_0x242368+'-'+_0x2acb8c+'/'+_0x2cc400)[_0x7b7e('0x1c')](_0x5703fd);}return null;};}function patchUpdates(_0x49eddb){return function(_0x69262b){try{jsonpatch[_0x7b7e('0x23')](_0x69262b,_0x49eddb,!![]);}catch(_0x24718c){return BPromise['reject'](_0x24718c);}return _0x69262b[_0x7b7e('0x24')]();};}function saveUpdates(_0xbf0cb3,_0x14243b){return function(_0x200156){if(_0x200156){return _0x200156[_0x7b7e('0x25')](_0xbf0cb3)[_0x7b7e('0x26')](function(_0x28bf43){return _0x28bf43;});}return null;};}function removeEntity(_0x10a66a,_0x53bbb3){return function(_0x5d6215){if(_0x5d6215){return _0x5d6215['destroy']()[_0x7b7e('0x26')](function(){var _0x22598e=_0x5d6215[_0x7b7e('0x27')]({'plain':!![]});var _0x483c6f='Voicemails';return db['UserProfileResource'][_0x7b7e('0x28')]({'where':{'type':_0x483c6f,'resourceId':_0x22598e['id']}})[_0x7b7e('0x26')](function(){return _0x5d6215;});})[_0x7b7e('0x26')](function(){_0x10a66a[_0x7b7e('0x1b')](0xcc)[_0x7b7e('0x1a')]();});}};}function handleEntityNotFound(_0x48fad1,_0x6a1e71){return function(_0x21a15){if(!_0x21a15){_0x48fad1['sendStatus'](0x194);}return _0x21a15;};}function handleError(_0x57b9da,_0x4e5de7){_0x4e5de7=_0x4e5de7||0x1f4;return function(_0x12ef0b){logger[_0x7b7e('0x29')](_0x12ef0b['stack']);if(_0x12ef0b[_0x7b7e('0x2a')]){delete _0x12ef0b['name'];}_0x57b9da[_0x7b7e('0x1b')](_0x4e5de7)[_0x7b7e('0x2b')](_0x12ef0b);};}exports[_0x7b7e('0x2c')]=function(_0x5515ca,_0x3960b8){var _0xe31336={},_0x35602a={},_0x326dd2={'count':0x0,'rows':[]};var _0x33f9a1=_['map'](db[_0x7b7e('0x2d')]['rawAttributes'],function(_0x23a453){return{'name':_0x23a453[_0x7b7e('0x2e')],'type':_0x23a453[_0x7b7e('0x2f')][_0x7b7e('0x30')]};});_0x35602a[_0x7b7e('0x31')]=_[_0x7b7e('0x32')](_0x33f9a1,_0x7b7e('0x2a'));_0x35602a['query']=_['keys'](_0x5515ca[_0x7b7e('0x33')]);_0x35602a[_0x7b7e('0x34')]=_['intersection'](_0x35602a[_0x7b7e('0x31')],_0x35602a[_0x7b7e('0x33')]);_0xe31336[_0x7b7e('0x35')]=_['intersection'](_0x35602a[_0x7b7e('0x31')],qs[_0x7b7e('0x36')](_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x36')]));_0xe31336[_0x7b7e('0x35')]=_0xe31336[_0x7b7e('0x35')][_0x7b7e('0x37')]?_0xe31336[_0x7b7e('0x35')]:_0x35602a[_0x7b7e('0x31')];if(!_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x38')](_0x7b7e('0x39'))){_0xe31336[_0x7b7e('0x1f')]=qs[_0x7b7e('0x1f')](_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x1f')]);_0xe31336['offset']=qs[_0x7b7e('0x1d')](_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x1d')]);}_0xe31336[_0x7b7e('0x3a')]=qs[_0x7b7e('0x3b')](_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x3b')]);_0xe31336[_0x7b7e('0x3c')]=qs[_0x7b7e('0x34')](_[_0x7b7e('0x3d')](_0x5515ca['query'],_0x35602a[_0x7b7e('0x34')]),_0x33f9a1);if(_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x3e')]){_0xe31336[_0x7b7e('0x3c')]=_['merge'](_0xe31336[_0x7b7e('0x3c')],{'$or':_[_0x7b7e('0x32')](_0x33f9a1,function(_0x3d5280){if(_0x3d5280['type']!=='VIRTUAL'){var _0x22651e={};_0x22651e[_0x3d5280['name']]={'$like':'%'+_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x3e')]+'%'};return _0x22651e;}})});}_0xe31336=_['merge']({},_0xe31336,_0x5515ca[_0x7b7e('0x3f')]);var _0x2074d1={'where':_0xe31336[_0x7b7e('0x3c')]};return db[_0x7b7e('0x2d')][_0x7b7e('0x20')](_0x2074d1)[_0x7b7e('0x26')](function(_0xc888e4){_0x326dd2[_0x7b7e('0x20')]=_0xc888e4;if(_0x5515ca[_0x7b7e('0x33')]['includeAll']){_0xe31336['include']=[{'all':!![]}];}return db[_0x7b7e('0x2d')]['findAll'](_0xe31336);})[_0x7b7e('0x26')](function(_0x5e8b5d){_0x326dd2['rows']=_0x5e8b5d;return _0x326dd2;})[_0x7b7e('0x26')](respondWithFilteredResult(_0x3960b8,_0xe31336))['catch'](handleError(_0x3960b8,null));};exports[_0x7b7e('0x40')]=function(_0x52051c,_0xa8521d){var _0x3e58be={'raw':!![],'where':{'id':_0x52051c[_0x7b7e('0x41')]['id']}},_0x7ea84c={};_0x7ea84c['model']=_[_0x7b7e('0x42')](db[_0x7b7e('0x2d')][_0x7b7e('0x43')]);_0x7ea84c[_0x7b7e('0x33')]=_[_0x7b7e('0x42')](_0x52051c[_0x7b7e('0x33')]);_0x7ea84c['filters']=_['intersection'](_0x7ea84c['model'],_0x7ea84c[_0x7b7e('0x33')]);_0x3e58be[_0x7b7e('0x35')]=_[_0x7b7e('0x44')](_0x7ea84c[_0x7b7e('0x31')],qs[_0x7b7e('0x36')](_0x52051c[_0x7b7e('0x33')]['fields']));_0x3e58be[_0x7b7e('0x35')]=_0x3e58be[_0x7b7e('0x35')]['length']?_0x3e58be['attributes']:_0x7ea84c[_0x7b7e('0x31')];if(_0x52051c[_0x7b7e('0x33')][_0x7b7e('0x45')]){_0x3e58be[_0x7b7e('0x46')]=[{'all':!![]}];}_0x3e58be=_[_0x7b7e('0x47')]({},_0x3e58be,_0x52051c[_0x7b7e('0x3f')]);return db['VoiceMail'][_0x7b7e('0x48')](_0x3e58be)['then'](handleEntityNotFound(_0xa8521d,null))[_0x7b7e('0x26')](respondWithResult(_0xa8521d,null))[_0x7b7e('0x49')](handleError(_0xa8521d,null));};exports[_0x7b7e('0x4a')]=function(_0x5874e2,_0x58e4e6){return db[_0x7b7e('0x2d')][_0x7b7e('0x4a')](_0x5874e2[_0x7b7e('0x4b')],{})[_0x7b7e('0x26')](function(_0x1f9d0f){var _0x5cce7c=_0x5874e2[_0x7b7e('0x4c')][_0x7b7e('0x27')]({'plain':!![]});if(!_0x5cce7c)throw new Error(_0x7b7e('0x4d'));if(_0x5cce7c[_0x7b7e('0x4e')]===_0x7b7e('0x4c')){var _0x5a9697=_0x1f9d0f[_0x7b7e('0x27')]({'plain':!![]});var _0x29024e=_0x7b7e('0x4f');return db[_0x7b7e('0x50')][_0x7b7e('0x48')]({'where':{'name':_0x29024e,'userProfileId':_0x5cce7c[_0x7b7e('0x51')]},'raw':!![]})[_0x7b7e('0x26')](function(_0x4a7be0){if(_0x4a7be0&&_0x4a7be0[_0x7b7e('0x52')]===0x0){return db['UserProfileResource'][_0x7b7e('0x4a')]({'name':_0x5a9697[_0x7b7e('0x2a')],'resourceId':_0x5a9697['id'],'type':_0x4a7be0['name'],'sectionId':_0x4a7be0['id']},{})[_0x7b7e('0x26')](function(){return _0x1f9d0f;});}else{return _0x1f9d0f;}})[_0x7b7e('0x49')](function(_0x16c81d){logger[_0x7b7e('0x29')](_0x7b7e('0x53'),_0x16c81d);throw _0x16c81d;});}return _0x1f9d0f;})[_0x7b7e('0x26')](respondWithResult(_0x58e4e6,0xc9))[_0x7b7e('0x49')](handleError(_0x58e4e6,null));};exports['update']=function(_0xbf044d,_0x3ff731){if(_0xbf044d[_0x7b7e('0x4b')]['id']){delete _0xbf044d[_0x7b7e('0x4b')]['id'];}return db['VoiceMail']['find']({'where':{'id':_0xbf044d['params']['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x3ff731,null))[_0x7b7e('0x26')](saveUpdates(_0xbf044d[_0x7b7e('0x4b')],null))['then'](respondWithResult(_0x3ff731,null))['catch'](handleError(_0x3ff731,null));};exports[_0x7b7e('0x28')]=function(_0x39efb5,_0x4fecf7){return db[_0x7b7e('0x2d')][_0x7b7e('0x48')]({'where':{'id':_0x39efb5[_0x7b7e('0x41')]['id']}})['then'](handleEntityNotFound(_0x4fecf7,null))[_0x7b7e('0x26')](removeEntity(_0x4fecf7,null))[_0x7b7e('0x49')](handleError(_0x4fecf7,null));};exports['getMessages']=function(_0x25c933,_0x441c3c,_0x1d7db1){return db[_0x7b7e('0x2d')][_0x7b7e('0x54')]({'where':{'id':_0x25c933[_0x7b7e('0x41')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x441c3c,null))[_0x7b7e('0x26')](function(_0x45fff9){var _0x5509ad;var _0x29d0af={},_0x20108a={};_0x20108a['model']=_[_0x7b7e('0x42')](db[_0x7b7e('0x55')][_0x7b7e('0x43')]);_0x20108a['query']=_[_0x7b7e('0x42')](_0x25c933['query']);_0x20108a[_0x7b7e('0x34')]=_[_0x7b7e('0x44')](_0x20108a['model'],_0x20108a[_0x7b7e('0x33')]);_0x29d0af[_0x7b7e('0x35')]=_['intersection'](_0x20108a[_0x7b7e('0x31')],qs[_0x7b7e('0x36')](_0x25c933[_0x7b7e('0x33')][_0x7b7e('0x36')]));_0x29d0af['attributes']=_0x29d0af[_0x7b7e('0x35')][_0x7b7e('0x37')]?_0x29d0af[_0x7b7e('0x35')]:_0x20108a[_0x7b7e('0x31')];if(!_0x25c933[_0x7b7e('0x33')][_0x7b7e('0x38')](_0x7b7e('0x39'))){_0x29d0af[_0x7b7e('0x1f')]=qs[_0x7b7e('0x1f')](_0x25c933[_0x7b7e('0x33')]['limit']);_0x29d0af[_0x7b7e('0x1d')]=qs['offset'](_0x25c933['query'][_0x7b7e('0x1d')]);}_0x29d0af[_0x7b7e('0x3a')]=qs[_0x7b7e('0x3b')](_0x25c933[_0x7b7e('0x33')]['sort']);_0x29d0af[_0x7b7e('0x3c')]=qs[_0x7b7e('0x34')](_[_0x7b7e('0x3d')](_0x25c933[_0x7b7e('0x33')],_0x20108a[_0x7b7e('0x34')]));if(_0x25c933[_0x7b7e('0x33')]['filter']){_0x29d0af[_0x7b7e('0x3c')]=_['merge'](_0x29d0af['where'],{'$or':_[_0x7b7e('0x32')](_0x29d0af['attributes'],function(_0x47aa4c){var _0x4a2378={};_0x4a2378[_0x47aa4c]={'$like':'%'+_0x25c933[_0x7b7e('0x33')][_0x7b7e('0x3e')]+'%'};return _0x4a2378;})});}_0x29d0af['where']=_[_0x7b7e('0x47')](_0x29d0af[_0x7b7e('0x3c')],{'mailboxuser':_0x45fff9['mailbox']});_0x29d0af=_[_0x7b7e('0x47')]({},_0x29d0af,_0x25c933[_0x7b7e('0x3f')]);return db[_0x7b7e('0x55')][_0x7b7e('0x56')](_0x29d0af)[_0x7b7e('0x26')](respondWithFilteredResult(_0x441c3c,_0x29d0af));})[_0x7b7e('0x49')](handleError(_0x441c3c,null));};
\ No newline at end of file
index 5b52fa2..852fcbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90be=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','voice_voicemail','mailbox','context'];(function(_0x598f9a,_0x3a5e55){var _0x23ffa5=function(_0x5607a7){while(--_0x5607a7){_0x598f9a['push'](_0x598f9a['shift']());}};_0x23ffa5(++_0x3a5e55);}(_0x90be,0x1ee));var _0xe90b=function(_0x5922d5,_0x5ef30f){_0x5922d5=_0x5922d5-0x0;var _0x14ebc0=_0x90be[_0x5922d5];return _0x14ebc0;};'use strict';var _=require('lodash');var util=require(_0xe90b('0x0'));var logger=require(_0xe90b('0x1'))(_0xe90b('0x2'));var moment=require(_0xe90b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe90b('0x4'));var rimraf=require(_0xe90b('0x5'));var config=require(_0xe90b('0x6'));var attributes=require(_0xe90b('0x7'));module[_0xe90b('0x8')]=function(_0x98b8e4,_0x32d888){return _0x98b8e4[_0xe90b('0x9')]('VoiceMail',attributes,{'tableName':_0xe90b('0xa'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0xe90b('0xb'),_0xe90b('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6a7f=['VoiceMail','mailbox','util','api','moment','bluebird','request-promise','path','../../config/environment','./voiceMail.attributes','exports'];(function(_0x3fbf68,_0x425904){var _0x5520d3=function(_0x4b3fc2){while(--_0x4b3fc2){_0x3fbf68['push'](_0x3fbf68['shift']());}};_0x5520d3(++_0x425904);}(_0x6a7f,0x1d0));var _0xf6a7=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6a7f[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0xf6a7('0x0'));var logger=require('../../config/logger')(_0xf6a7('0x1'));var moment=require(_0xf6a7('0x2'));var BPromise=require(_0xf6a7('0x3'));var rp=require(_0xf6a7('0x4'));var fs=require('fs');var path=require(_0xf6a7('0x5'));var rimraf=require('rimraf');var config=require(_0xf6a7('0x6'));var attributes=require(_0xf6a7('0x7'));module[_0xf6a7('0x8')]=function(_0x44df55,_0x4ab90a){return _0x44df55['define'](_0xf6a7('0x9'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0xf6a7('0xa'),'context']}],'timestamps':!![]});};
\ No newline at end of file
index 4f4a424..4d4a272 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde80=['info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','moment','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xde80,0x88));var _0x0de8=function(_0x2d8d8a,_0x4382f8){_0x2d8d8a=_0x2d8d8a-0x0;var _0x37f3ee=_0xde80[_0x2d8d8a];return _0x37f3ee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0de8('0x0'));var BPromise=require('bluebird');var rs=require(_0x0de8('0x1'));var fs=require('fs');var Redis=require(_0x0de8('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0de8('0x3'));var logger=require(_0x0de8('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0de8('0x5'));var client=jayson[_0x0de8('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35ebbe,_0x26676b,_0x649045){return new BPromise(function(_0x186b12,_0x5f056b){return client[_0x0de8('0x7')](_0x35ebbe,_0x649045)['then'](function(_0x5abae5){logger[_0x0de8('0x8')](_0x0de8('0x9'),_0x26676b,'request\x20sent');logger[_0x0de8('0xa')](_0x0de8('0xb'),_0x26676b,_0x0de8('0xc'),JSON[_0x0de8('0xd')](_0x5abae5));if(_0x5abae5[_0x0de8('0xe')]){if(_0x5abae5[_0x0de8('0xe')]['code']===0x1f4){logger[_0x0de8('0xe')]('VoiceMail,\x20%s,\x20%s',_0x26676b,_0x5abae5[_0x0de8('0xe')]['message']);return _0x5f056b(_0x5abae5[_0x0de8('0xe')][_0x0de8('0xf')]);}logger['error'](_0x0de8('0x9'),_0x26676b,_0x5abae5[_0x0de8('0xe')][_0x0de8('0xf')]);return _0x186b12(_0x5abae5[_0x0de8('0xe')][_0x0de8('0xf')]);}else{logger[_0x0de8('0x8')](_0x0de8('0x9'),_0x26676b,'request\x20sent');_0x186b12(_0x5abae5[_0x0de8('0x10')][_0x0de8('0xf')]);}})[_0x0de8('0x11')](function(_0x265f94){logger[_0x0de8('0xe')](_0x0de8('0x9'),_0x26676b,_0x265f94);_0x5f056b(_0x265f94);});});}
\ No newline at end of file
+var _0x3690=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x5a04ad,_0x4f5875){var _0x5f1bca=function(_0xd4d910){while(--_0xd4d910){_0x5a04ad['push'](_0x5a04ad['shift']());}};_0x5f1bca(++_0x4f5875);}(_0x3690,0x1a5));var _0x0369=function(_0xfd49ed,_0x1272e1){_0xfd49ed=_0xfd49ed-0x0;var _0x355f54=_0x3690[_0xfd49ed];return _0x355f54;};'use strict';var _=require(_0x0369('0x0'));var util=require(_0x0369('0x1'));var moment=require(_0x0369('0x2'));var BPromise=require(_0x0369('0x3'));var rs=require(_0x0369('0x4'));var fs=require('fs');var Redis=require(_0x0369('0x5'));var db=require(_0x0369('0x6'))['db'];var utils=require(_0x0369('0x7'));var logger=require(_0x0369('0x8'))(_0x0369('0x9'));var config=require(_0x0369('0xa'));var jayson=require(_0x0369('0xb'));var client=jayson[_0x0369('0xc')][_0x0369('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4a25fb,_0x485193,_0x3c3533){return new BPromise(function(_0x4f44f0,_0x5f0e30){return client['request'](_0x4a25fb,_0x3c3533)[_0x0369('0xe')](function(_0x5d851b){logger[_0x0369('0xf')](_0x0369('0x10'),_0x485193,_0x0369('0x11'));logger[_0x0369('0x12')](_0x0369('0x13'),_0x485193,_0x0369('0x11'),JSON['stringify'](_0x5d851b));if(_0x5d851b[_0x0369('0x14')]){if(_0x5d851b[_0x0369('0x14')][_0x0369('0x15')]===0x1f4){logger[_0x0369('0x14')](_0x0369('0x10'),_0x485193,_0x5d851b[_0x0369('0x14')][_0x0369('0x16')]);return _0x5f0e30(_0x5d851b[_0x0369('0x14')][_0x0369('0x16')]);}logger[_0x0369('0x14')](_0x0369('0x10'),_0x485193,_0x5d851b['error']['message']);return _0x4f44f0(_0x5d851b[_0x0369('0x14')][_0x0369('0x16')]);}else{logger[_0x0369('0xf')](_0x0369('0x10'),_0x485193,_0x0369('0x11'));_0x4f44f0(_0x5d851b[_0x0369('0x17')]['message']);}})[_0x0369('0x18')](function(_0x3b02eb){logger['error'](_0x0369('0x10'),_0x485193,_0x3b02eb);_0x5f0e30(_0x3b02eb);});});}
\ No newline at end of file
index da7b55b..193ad1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbf2=['connect-timeout','Router','fs-extra','../../components/auth/service','./voiceMailMessage.controller','index','/:id','isAuthenticated','show','get','/:id/download','download','post','put','delete','exports','multer','util','path'];(function(_0xb46aa4,_0x3db253){var _0x4d2fd8=function(_0x1b24ce){while(--_0x1b24ce){_0xb46aa4['push'](_0xb46aa4['shift']());}};_0x4d2fd8(++_0x3db253);}(_0xfbf2,0xa8));var _0x2fbf=function(_0x25c90e,_0x362581){_0x25c90e=_0x25c90e-0x0;var _0x1d00e0=_0xfbf2[_0x25c90e];return _0x1d00e0;};'use strict';var multer=require(_0x2fbf('0x0'));var util=require(_0x2fbf('0x1'));var path=require(_0x2fbf('0x2'));var timeout=require(_0x2fbf('0x3'));var express=require('express');var router=express[_0x2fbf('0x4')]();var fs_extra=require(_0x2fbf('0x5'));var auth=require(_0x2fbf('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2fbf('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x2fbf('0x8')]);router['get'](_0x2fbf('0x9'),auth[_0x2fbf('0xa')](),controller[_0x2fbf('0xb')]);router[_0x2fbf('0xc')](_0x2fbf('0xd'),auth[_0x2fbf('0xa')](),controller[_0x2fbf('0xe')]);router[_0x2fbf('0xf')]('/',auth[_0x2fbf('0xa')](),controller['create']);router[_0x2fbf('0x10')](_0x2fbf('0x9'),auth[_0x2fbf('0xa')](),controller['update']);router[_0x2fbf('0x11')]('/:id',auth[_0x2fbf('0xa')](),controller['destroy']);module[_0x2fbf('0x12')]=router;
\ No newline at end of file
+var _0xbc60=['index','/:id','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated'];(function(_0x8ee3aa,_0x55b69d){var _0xfbc004=function(_0x206b4b){while(--_0x206b4b){_0x8ee3aa['push'](_0x8ee3aa['shift']());}};_0xfbc004(++_0x55b69d);}(_0xbc60,0xd9));var _0x0bc6=function(_0x2cfb88,_0x3f31cb){_0x2cfb88=_0x2cfb88-0x0;var _0x3ecc81=_0xbc60[_0x2cfb88];return _0x3ecc81;};'use strict';var multer=require(_0x0bc6('0x0'));var util=require(_0x0bc6('0x1'));var path=require(_0x0bc6('0x2'));var timeout=require(_0x0bc6('0x3'));var express=require(_0x0bc6('0x4'));var router=express['Router']();var fs_extra=require(_0x0bc6('0x5'));var auth=require(_0x0bc6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0bc6('0x7'));var controller=require(_0x0bc6('0x8'));router[_0x0bc6('0x9')]('/',auth[_0x0bc6('0xa')](),controller[_0x0bc6('0xb')]);router[_0x0bc6('0x9')](_0x0bc6('0xc'),auth[_0x0bc6('0xa')](),controller['show']);router['get']('/:id/download',auth[_0x0bc6('0xa')](),controller['download']);router[_0x0bc6('0xd')]('/',auth[_0x0bc6('0xa')](),controller[_0x0bc6('0xe')]);router[_0x0bc6('0xf')](_0x0bc6('0xc'),auth[_0x0bc6('0xa')](),controller[_0x0bc6('0x10')]);router['delete']('/:id',auth[_0x0bc6('0xa')](),controller[_0x0bc6('0x11')]);module[_0x0bc6('0x12')]=router;
\ No newline at end of file
index bd09bb7..1c5c7b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5da2=['getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports'];(function(_0x265d9e,_0xb9d257){var _0x1d45d6=function(_0x317223){while(--_0x317223){_0x265d9e['push'](_0x265d9e['shift']());}};_0x1d45d6(++_0xb9d257);}(_0x5da2,0xd7));var _0x25da=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x5da2[_0x44bcb0];return _0xfaf881;};'use strict';var Sequelize=require('sequelize');module[_0x25da('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5a6596){return this[_0x25da('0x1')]('id');}},'msgnum':{'type':Sequelize[_0x25da('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x25da('0x3')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x25da('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x25da('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x25da('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x25da('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x25da('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x25da('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x25da('0x4')](_0x25da('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x25da('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x25da('0x3')],'defaultValue':''},'stamp':{'type':_0x25da('0x6'),'defaultValue':Sequelize[_0x25da('0x7')](_0x25da('0x8'))}};
\ No newline at end of file
+var _0x86f4=['exports','VIRTUAL','getDataValue','INTEGER','STRING','long','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x3bca81,_0x56382e){var _0x520e54=function(_0x23b49b){while(--_0x23b49b){_0x3bca81['push'](_0x3bca81['shift']());}};_0x520e54(++_0x56382e);}(_0x86f4,0x11f));var _0x486f=function(_0x326a4d,_0x38e7c6){_0x326a4d=_0x326a4d-0x0;var _0x44a4b4=_0x86f4[_0x326a4d];return _0x44a4b4;};'use strict';var Sequelize=require('sequelize');module[_0x486f('0x0')]={'name':{'type':Sequelize[_0x486f('0x1')],'get':function(_0x48808e){return this[_0x486f('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x486f('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x486f('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x486f('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x486f('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x486f('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x486f('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x486f('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x486f('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x486f('0x5')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x486f('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize['literal'](_0x486f('0x6'))}};
\ No newline at end of file
index 3a97168..34da0ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e89=['send','index','map','VoiceMailMessage','rawAttributes','fieldName','key','model','differenceBy','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','create','body','find','download','recording','ValidationError','VoiceMailMessage\x20not\x20found','attachment','attachment;\x20filename=\x22','msg_id','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name'];(function(_0x1f8ceb,_0x4ec9bd){var _0x45ebda=function(_0x138549){while(--_0x138549){_0x1f8ceb['push'](_0x1f8ceb['shift']());}};_0x45ebda(++_0x4ec9bd);}(_0x8e89,0x8a));var _0x98e8=function(_0x32f26d,_0x2c0b5d){_0x32f26d=_0x32f26d-0x0;var _0x5d9ddc=_0x8e89[_0x32f26d];return _0x5d9ddc;};'use strict';var emlformat=require(_0x98e8('0x0'));var rimraf=require(_0x98e8('0x1'));var zipdir=require(_0x98e8('0x2'));var jsonpatch=require(_0x98e8('0x3'));var rp=require(_0x98e8('0x4'));var moment=require(_0x98e8('0x5'));var BPromise=require(_0x98e8('0x6'));var Mustache=require(_0x98e8('0x7'));var util=require(_0x98e8('0x8'));var path=require(_0x98e8('0x9'));var sox=require(_0x98e8('0xa'));var csv=require(_0x98e8('0xb'));var ejs=require(_0x98e8('0xc'));var fs=require('fs');var fs_extra=require(_0x98e8('0xd'));var _=require(_0x98e8('0xe'));var squel=require(_0x98e8('0xf'));var crypto=require(_0x98e8('0x10'));var jsforce=require(_0x98e8('0x11'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x98e8('0x12'));var Papa=require(_0x98e8('0x13'));var Redis=require(_0x98e8('0x14'));var authService=require(_0x98e8('0x15'));var qs=require(_0x98e8('0x16'));var as=require(_0x98e8('0x17'));var hardwareService=require(_0x98e8('0x18'));var logger=require(_0x98e8('0x19'))(_0x98e8('0x1a'));var utils=require(_0x98e8('0x1b'));var config=require(_0x98e8('0x1c'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x440a99,_0x14fa93){_0x14fa93=_0x14fa93||0xcc;return function(_0x2c0992){if(_0x2c0992){return _0x440a99[_0x98e8('0x1d')](_0x14fa93);}return _0x440a99[_0x98e8('0x1e')](_0x14fa93)[_0x98e8('0x1f')]();};}function respondWithResult(_0x1b2712,_0x1b326b){_0x1b326b=_0x1b326b||0xc8;return function(_0x366e0a){if(_0x366e0a){return _0x1b2712[_0x98e8('0x1e')](_0x1b326b)[_0x98e8('0x20')](_0x366e0a);}};}function respondWithFilteredResult(_0x5557e6,_0x3cdb7b){return function(_0x1668e4){if(_0x1668e4){var _0x18c7cb=typeof _0x3cdb7b[_0x98e8('0x21')]===_0x98e8('0x22')&&typeof _0x3cdb7b['limit']===_0x98e8('0x22');var _0x2873d4=_0x1668e4[_0x98e8('0x23')];var _0x595d5f=_0x18c7cb?0x0:_0x3cdb7b[_0x98e8('0x21')];var _0x3f6989=_0x18c7cb?_0x1668e4['count']:_0x3cdb7b[_0x98e8('0x21')]+_0x3cdb7b[_0x98e8('0x24')];var _0x31e8eb;if(_0x3f6989>=_0x2873d4){_0x3f6989=_0x2873d4;_0x31e8eb=0xc8;}else{_0x31e8eb=0xce;}_0x5557e6['status'](_0x31e8eb);return _0x5557e6[_0x98e8('0x25')](_0x98e8('0x26'),_0x595d5f+'-'+_0x3f6989+'/'+_0x2873d4)['json'](_0x1668e4);}return null;};}function patchUpdates(_0x3493b5){return function(_0x42842c){try{jsonpatch[_0x98e8('0x27')](_0x42842c,_0x3493b5,!![]);}catch(_0x152f59){return BPromise[_0x98e8('0x28')](_0x152f59);}return _0x42842c[_0x98e8('0x29')]();};}function saveUpdates(_0x321b37,_0x36ed1a){return function(_0xc1f9ce){if(_0xc1f9ce){return _0xc1f9ce[_0x98e8('0x2a')](_0x321b37)[_0x98e8('0x2b')](function(_0x1d021){return _0x1d021;});}return null;};}function removeEntity(_0x3fc4d2,_0x3e3854){return function(_0x1a3185){if(_0x1a3185){return _0x1a3185[_0x98e8('0x2c')]()['then'](function(){_0x3fc4d2[_0x98e8('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x102a11,_0x403bb1){return function(_0x27b017){if(!_0x27b017){_0x102a11[_0x98e8('0x1d')](0x194);}return _0x27b017;};}function handleError(_0xb2c1cb,_0x3c0f18){_0x3c0f18=_0x3c0f18||0x1f4;return function(_0x3889a9){logger[_0x98e8('0x2d')](_0x3889a9[_0x98e8('0x2e')]);if(_0x3889a9[_0x98e8('0x2f')]){delete _0x3889a9[_0x98e8('0x2f')];}_0xb2c1cb[_0x98e8('0x1e')](_0x3c0f18)[_0x98e8('0x30')](_0x3889a9);};}exports[_0x98e8('0x31')]=function(_0x52e594,_0xca0853){var _0x40c3e0={},_0xbdd9a9={},_0x467054={'count':0x0,'rows':[]};var _0x5e6fa9=_[_0x98e8('0x32')](db[_0x98e8('0x33')][_0x98e8('0x34')],function(_0x13c673){return{'name':_0x13c673[_0x98e8('0x35')],'type':_0x13c673['type'][_0x98e8('0x36')]};});_0xbdd9a9[_0x98e8('0x37')]=_[_0x98e8('0x38')](_[_0x98e8('0x32')](_0x5e6fa9,_0x98e8('0x2f')),['name']);_0xbdd9a9[_0x98e8('0x39')]=_['keys'](_0x52e594[_0x98e8('0x39')]);_0xbdd9a9[_0x98e8('0x3a')]=_[_0x98e8('0x3b')](_0xbdd9a9['model'],_0xbdd9a9[_0x98e8('0x39')]);_0x40c3e0[_0x98e8('0x3c')]=_[_0x98e8('0x3b')](_0xbdd9a9[_0x98e8('0x37')],qs[_0x98e8('0x3d')](_0x52e594[_0x98e8('0x39')][_0x98e8('0x3d')]));_0x40c3e0[_0x98e8('0x3c')]=_0x40c3e0[_0x98e8('0x3c')][_0x98e8('0x3e')]?_0x40c3e0[_0x98e8('0x3c')]:_0xbdd9a9[_0x98e8('0x37')];if(!_0x52e594[_0x98e8('0x39')][_0x98e8('0x3f')](_0x98e8('0x40'))){_0x40c3e0[_0x98e8('0x24')]=qs['limit'](_0x52e594['query'][_0x98e8('0x24')]);_0x40c3e0[_0x98e8('0x21')]=qs['offset'](_0x52e594[_0x98e8('0x39')][_0x98e8('0x21')]);}_0x40c3e0[_0x98e8('0x41')]=qs[_0x98e8('0x42')](_0x52e594[_0x98e8('0x39')]['sort']);_0x40c3e0[_0x98e8('0x43')]=qs[_0x98e8('0x3a')](_[_0x98e8('0x44')](_0x52e594[_0x98e8('0x39')],_0xbdd9a9[_0x98e8('0x3a')]),_0x5e6fa9);if(_0x52e594[_0x98e8('0x39')][_0x98e8('0x45')]){_0x40c3e0[_0x98e8('0x43')]=_[_0x98e8('0x46')](_0x40c3e0['where'],{'$or':_[_0x98e8('0x32')](_0x5e6fa9,function(_0x2a1e7f){if(_0x2a1e7f[_0x98e8('0x47')]!==_0x98e8('0x48')){var _0x196104={};_0x196104[_0x2a1e7f['name']]={'$like':'%'+_0x52e594['query'][_0x98e8('0x45')]+'%'};return _0x196104;}})});}_0x40c3e0=_['merge']({},_0x40c3e0,_0x52e594[_0x98e8('0x49')]);var _0x473e77={'where':_0x40c3e0[_0x98e8('0x43')]};return db[_0x98e8('0x33')]['count'](_0x473e77)[_0x98e8('0x2b')](function(_0x5d4691){_0x467054[_0x98e8('0x23')]=_0x5d4691;if(_0x52e594[_0x98e8('0x39')]['includeAll']){_0x40c3e0[_0x98e8('0x4a')]=[{'all':!![]}];}return db[_0x98e8('0x33')][_0x98e8('0x4b')](_0x40c3e0);})[_0x98e8('0x2b')](function(_0x568019){_0x467054[_0x98e8('0x4c')]=_0x568019;return _0x467054;})[_0x98e8('0x2b')](respondWithFilteredResult(_0xca0853,_0x40c3e0))[_0x98e8('0x4d')](handleError(_0xca0853,null));};exports[_0x98e8('0x4e')]=function(_0x18b03a,_0x19d5b8){var _0x18151a={'raw':!![],'where':{'id':_0x18b03a[_0x98e8('0x4f')]['id']}},_0x4b87da={};_0x4b87da[_0x98e8('0x37')]=_[_0x98e8('0x50')](db[_0x98e8('0x33')]['rawAttributes']);_0x4b87da['query']=_[_0x98e8('0x50')](_0x18b03a[_0x98e8('0x39')]);_0x4b87da['filters']=_['intersection'](_0x4b87da[_0x98e8('0x37')],_0x4b87da[_0x98e8('0x39')]);_0x18151a[_0x98e8('0x3c')]=_['intersection'](_0x4b87da['model'],qs['fields'](_0x18b03a[_0x98e8('0x39')][_0x98e8('0x3d')]));_0x18151a['attributes']=_0x18151a[_0x98e8('0x3c')][_0x98e8('0x3e')]?_0x18151a['attributes']:_0x4b87da[_0x98e8('0x37')];if(_0x18b03a[_0x98e8('0x39')][_0x98e8('0x51')]){_0x18151a[_0x98e8('0x4a')]=[{'all':!![]}];}_0x18151a=_['merge']({},_0x18151a,_0x18b03a['options']);return db[_0x98e8('0x33')]['find'](_0x18151a)['then'](handleEntityNotFound(_0x19d5b8,null))[_0x98e8('0x2b')](respondWithResult(_0x19d5b8,null))[_0x98e8('0x4d')](handleError(_0x19d5b8,null));};exports[_0x98e8('0x52')]=function(_0x302a73,_0x410d42){return db[_0x98e8('0x33')]['create'](_0x302a73['body'],{})[_0x98e8('0x2b')](respondWithResult(_0x410d42,0xc9))[_0x98e8('0x4d')](handleError(_0x410d42,null));};exports['update']=function(_0x108156,_0x1daf48){if(_0x108156[_0x98e8('0x53')]['id']){delete _0x108156[_0x98e8('0x53')]['id'];}return db[_0x98e8('0x33')][_0x98e8('0x54')]({'where':{'id':_0x108156[_0x98e8('0x4f')]['id']}})[_0x98e8('0x2b')](handleEntityNotFound(_0x1daf48,null))[_0x98e8('0x2b')](saveUpdates(_0x108156[_0x98e8('0x53')],null))['then'](respondWithResult(_0x1daf48,null))[_0x98e8('0x4d')](handleError(_0x1daf48,null));};exports['destroy']=function(_0x50325c,_0x5af763){return db[_0x98e8('0x33')]['find']({'where':{'id':_0x50325c[_0x98e8('0x4f')]['id']}})[_0x98e8('0x2b')](handleEntityNotFound(_0x5af763,null))[_0x98e8('0x2b')](removeEntity(_0x5af763,null))[_0x98e8('0x4d')](handleError(_0x5af763,null));};exports[_0x98e8('0x55')]=function(_0x9aa238,_0x3974ab,_0x16d645){return db['VoiceMailMessage']['find']({'where':{'id':_0x9aa238['params']['id']},'attributes':['id','recording','msg_id']})[_0x98e8('0x2b')](handleEntityNotFound(_0x3974ab,null))['then'](function(_0x19f312){if(_0x19f312){if(!_0x19f312[_0x98e8('0x56')]){throw new db['Sequelize'][(_0x98e8('0x57'))](_0x98e8('0x58'));}var _0x301851={'Content-Type':'audio/wav','Content-Disposition':_0x98e8('0x59')};if(_0x19f312['msg_id']){_0x301851['Content-Disposition']=_0x98e8('0x5a')+_0x19f312[_0x98e8('0x5b')]+_0x98e8('0x5c');}_0x3974ab['set'](_0x301851);return _0x3974ab[_0x98e8('0x30')](new Buffer(_0x19f312['recording']));}})[_0x98e8('0x4d')](handleError(_0x3974ab,null));};
\ No newline at end of file
+var _0x9136=['find','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','attachment;\x20filename=\x22','send','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../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','update','then','destroy','stack','name','map','VoiceMailMessage','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','length','catch','create','body'];(function(_0x2ca230,_0xe8f6a){var _0x33cb57=function(_0x4b5cb9){while(--_0x4b5cb9){_0x2ca230['push'](_0x2ca230['shift']());}};_0x33cb57(++_0xe8f6a);}(_0x9136,0x19b));var _0x6913=function(_0x3d62b0,_0x4fd859){_0x3d62b0=_0x3d62b0-0x0;var _0x1f9021=_0x9136[_0x3d62b0];return _0x1f9021;};'use strict';var emlformat=require(_0x6913('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6913('0x1'));var jsonpatch=require(_0x6913('0x2'));var rp=require(_0x6913('0x3'));var moment=require('moment');var BPromise=require(_0x6913('0x4'));var Mustache=require(_0x6913('0x5'));var util=require('util');var path=require(_0x6913('0x6'));var sox=require('sox');var csv=require(_0x6913('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6913('0x8'));var _=require(_0x6913('0x9'));var squel=require(_0x6913('0xa'));var crypto=require('crypto');var jsforce=require(_0x6913('0xb'));var deskjs=require(_0x6913('0xc'));var toCsv=require(_0x6913('0x7'));var querystring=require(_0x6913('0xd'));var Papa=require(_0x6913('0xe'));var Redis=require(_0x6913('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6913('0x10'));var hardwareService=require(_0x6913('0x11'));var logger=require('../../config/logger')(_0x6913('0x12'));var utils=require(_0x6913('0x13'));var config=require(_0x6913('0x14'));var licenseUtil=require(_0x6913('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa375ce,_0x49d466){_0x49d466=_0x49d466||0xcc;return function(_0x428ea8){if(_0x428ea8){return _0xa375ce[_0x6913('0x16')](_0x49d466);}return _0xa375ce[_0x6913('0x17')](_0x49d466)[_0x6913('0x18')]();};}function respondWithResult(_0x5b7645,_0x397228){_0x397228=_0x397228||0xc8;return function(_0x59c0e0){if(_0x59c0e0){return _0x5b7645['status'](_0x397228)[_0x6913('0x19')](_0x59c0e0);}};}function respondWithFilteredResult(_0x1b41fd,_0x177576){return function(_0x41177a){if(_0x41177a){var _0x22faed=typeof _0x177576[_0x6913('0x1a')]===_0x6913('0x1b')&&typeof _0x177576[_0x6913('0x1c')]==='undefined';var _0x4fe29a=_0x41177a[_0x6913('0x1d')];var _0x5eb9fd=_0x22faed?0x0:_0x177576['offset'];var _0x480b85=_0x22faed?_0x41177a['count']:_0x177576[_0x6913('0x1a')]+_0x177576[_0x6913('0x1c')];var _0x27f745;if(_0x480b85>=_0x4fe29a){_0x480b85=_0x4fe29a;_0x27f745=0xc8;}else{_0x27f745=0xce;}_0x1b41fd[_0x6913('0x17')](_0x27f745);return _0x1b41fd[_0x6913('0x1e')](_0x6913('0x1f'),_0x5eb9fd+'-'+_0x480b85+'/'+_0x4fe29a)['json'](_0x41177a);}return null;};}function patchUpdates(_0xa3cf9b){return function(_0x1ff208){try{jsonpatch[_0x6913('0x20')](_0x1ff208,_0xa3cf9b,!![]);}catch(_0x1de74b){return BPromise[_0x6913('0x21')](_0x1de74b);}return _0x1ff208[_0x6913('0x22')]();};}function saveUpdates(_0x3825d9,_0x478aeb){return function(_0xe320d){if(_0xe320d){return _0xe320d[_0x6913('0x23')](_0x3825d9)[_0x6913('0x24')](function(_0x5ce0b5){return _0x5ce0b5;});}return null;};}function removeEntity(_0x5a6455,_0x2ea87f){return function(_0x3f01ee){if(_0x3f01ee){return _0x3f01ee[_0x6913('0x25')]()['then'](function(){_0x5a6455[_0x6913('0x17')](0xcc)[_0x6913('0x18')]();});}};}function handleEntityNotFound(_0xe14433,_0x47453d){return function(_0x166593){if(!_0x166593){_0xe14433[_0x6913('0x16')](0x194);}return _0x166593;};}function handleError(_0x39a5aa,_0x2a4a8e){_0x2a4a8e=_0x2a4a8e||0x1f4;return function(_0x482916){logger['error'](_0x482916[_0x6913('0x26')]);if(_0x482916[_0x6913('0x27')]){delete _0x482916[_0x6913('0x27')];}_0x39a5aa['status'](_0x2a4a8e)['send'](_0x482916);};}exports['index']=function(_0x4c7a57,_0x9aa79e){var _0x1de5ce={},_0x17edb3={},_0x8aa5d6={'count':0x0,'rows':[]};var _0x20f86d=_[_0x6913('0x28')](db[_0x6913('0x29')]['rawAttributes'],function(_0x14a9cb){return{'name':_0x14a9cb['fieldName'],'type':_0x14a9cb[_0x6913('0x2a')][_0x6913('0x2b')]};});_0x17edb3[_0x6913('0x2c')]=_['differenceBy'](_[_0x6913('0x28')](_0x20f86d,_0x6913('0x27')),['name']);_0x17edb3[_0x6913('0x2d')]=_['keys'](_0x4c7a57[_0x6913('0x2d')]);_0x17edb3[_0x6913('0x2e')]=_[_0x6913('0x2f')](_0x17edb3[_0x6913('0x2c')],_0x17edb3[_0x6913('0x2d')]);_0x1de5ce['attributes']=_[_0x6913('0x2f')](_0x17edb3[_0x6913('0x2c')],qs[_0x6913('0x30')](_0x4c7a57[_0x6913('0x2d')][_0x6913('0x30')]));_0x1de5ce[_0x6913('0x31')]=_0x1de5ce['attributes']['length']?_0x1de5ce[_0x6913('0x31')]:_0x17edb3[_0x6913('0x2c')];if(!_0x4c7a57[_0x6913('0x2d')][_0x6913('0x32')](_0x6913('0x33'))){_0x1de5ce['limit']=qs[_0x6913('0x1c')](_0x4c7a57[_0x6913('0x2d')][_0x6913('0x1c')]);_0x1de5ce[_0x6913('0x1a')]=qs['offset'](_0x4c7a57['query'][_0x6913('0x1a')]);}_0x1de5ce['order']=qs[_0x6913('0x34')](_0x4c7a57[_0x6913('0x2d')][_0x6913('0x34')]);_0x1de5ce[_0x6913('0x35')]=qs[_0x6913('0x2e')](_[_0x6913('0x36')](_0x4c7a57[_0x6913('0x2d')],_0x17edb3[_0x6913('0x2e')]),_0x20f86d);if(_0x4c7a57[_0x6913('0x2d')][_0x6913('0x37')]){_0x1de5ce[_0x6913('0x35')]=_[_0x6913('0x38')](_0x1de5ce[_0x6913('0x35')],{'$or':_[_0x6913('0x28')](_0x20f86d,function(_0x279bb8){if(_0x279bb8[_0x6913('0x2a')]!=='VIRTUAL'){var _0x1b16e={};_0x1b16e[_0x279bb8[_0x6913('0x27')]]={'$like':'%'+_0x4c7a57[_0x6913('0x2d')]['filter']+'%'};return _0x1b16e;}})});}_0x1de5ce=_['merge']({},_0x1de5ce,_0x4c7a57[_0x6913('0x39')]);var _0x3025b2={'where':_0x1de5ce[_0x6913('0x35')]};return db[_0x6913('0x29')][_0x6913('0x1d')](_0x3025b2)[_0x6913('0x24')](function(_0x2051e5){_0x8aa5d6['count']=_0x2051e5;if(_0x4c7a57[_0x6913('0x2d')][_0x6913('0x3a')]){_0x1de5ce[_0x6913('0x3b')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x6913('0x3c')](_0x1de5ce);})[_0x6913('0x24')](function(_0x3396c1){_0x8aa5d6[_0x6913('0x3d')]=_0x3396c1;return _0x8aa5d6;})[_0x6913('0x24')](respondWithFilteredResult(_0x9aa79e,_0x1de5ce))['catch'](handleError(_0x9aa79e,null));};exports[_0x6913('0x3e')]=function(_0x369969,_0x5a5519){var _0x4f88b5={'raw':!![],'where':{'id':_0x369969[_0x6913('0x3f')]['id']}},_0x6d4cc8={};_0x6d4cc8[_0x6913('0x2c')]=_[_0x6913('0x40')](db[_0x6913('0x29')]['rawAttributes']);_0x6d4cc8[_0x6913('0x2d')]=_[_0x6913('0x40')](_0x369969[_0x6913('0x2d')]);_0x6d4cc8[_0x6913('0x2e')]=_[_0x6913('0x2f')](_0x6d4cc8['model'],_0x6d4cc8['query']);_0x4f88b5['attributes']=_['intersection'](_0x6d4cc8[_0x6913('0x2c')],qs[_0x6913('0x30')](_0x369969[_0x6913('0x2d')]['fields']));_0x4f88b5[_0x6913('0x31')]=_0x4f88b5['attributes'][_0x6913('0x41')]?_0x4f88b5[_0x6913('0x31')]:_0x6d4cc8[_0x6913('0x2c')];if(_0x369969['query']['includeAll']){_0x4f88b5['include']=[{'all':!![]}];}_0x4f88b5=_[_0x6913('0x38')]({},_0x4f88b5,_0x369969['options']);return db[_0x6913('0x29')]['find'](_0x4f88b5)[_0x6913('0x24')](handleEntityNotFound(_0x5a5519,null))[_0x6913('0x24')](respondWithResult(_0x5a5519,null))[_0x6913('0x42')](handleError(_0x5a5519,null));};exports[_0x6913('0x43')]=function(_0x399ec1,_0x1b69c3){return db[_0x6913('0x29')][_0x6913('0x43')](_0x399ec1['body'],{})['then'](respondWithResult(_0x1b69c3,0xc9))[_0x6913('0x42')](handleError(_0x1b69c3,null));};exports['update']=function(_0x293244,_0xbcfddb){if(_0x293244[_0x6913('0x44')]['id']){delete _0x293244[_0x6913('0x44')]['id'];}return db[_0x6913('0x29')][_0x6913('0x45')]({'where':{'id':_0x293244[_0x6913('0x3f')]['id']}})[_0x6913('0x24')](handleEntityNotFound(_0xbcfddb,null))[_0x6913('0x24')](saveUpdates(_0x293244[_0x6913('0x44')],null))['then'](respondWithResult(_0xbcfddb,null))[_0x6913('0x42')](handleError(_0xbcfddb,null));};exports[_0x6913('0x25')]=function(_0x5d42e6,_0x3f6191){return db['VoiceMailMessage'][_0x6913('0x45')]({'where':{'id':_0x5d42e6[_0x6913('0x3f')]['id']}})[_0x6913('0x24')](handleEntityNotFound(_0x3f6191,null))['then'](removeEntity(_0x3f6191,null))['catch'](handleError(_0x3f6191,null));};exports[_0x6913('0x46')]=function(_0x457c04,_0x22df1a,_0x4c2f06){return db[_0x6913('0x29')][_0x6913('0x45')]({'where':{'id':_0x457c04['params']['id']},'attributes':['id',_0x6913('0x47'),'msg_id']})[_0x6913('0x24')](handleEntityNotFound(_0x22df1a,null))[_0x6913('0x24')](function(_0x42628d){if(_0x42628d){if(!_0x42628d['recording']){throw new db[(_0x6913('0x48'))][(_0x6913('0x49'))](_0x6913('0x4a'));}var _0x4704d9={'Content-Type':_0x6913('0x4b'),'Content-Disposition':_0x6913('0x4c')};if(_0x42628d[_0x6913('0x4d')]){_0x4704d9['Content-Disposition']=_0x6913('0x4e')+_0x42628d[_0x6913('0x4d')]+'.wav\x22';}_0x22df1a[_0x6913('0x1e')](_0x4704d9);return _0x22df1a[_0x6913('0x4f')](new Buffer(_0x42628d[_0x6913('0x47')]));}})['catch'](handleError(_0x22df1a,null));};
\ No newline at end of file
index 6f8aaf1..5c09b30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5869=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api'];(function(_0x1ca93c,_0x3271ab){var _0x185169=function(_0x507763){while(--_0x507763){_0x1ca93c['push'](_0x1ca93c['shift']());}};_0x185169(++_0x3271ab);}(_0x5869,0xec));var _0x9586=function(_0x5c5cfb,_0x856fe6){_0x5c5cfb=_0x5c5cfb-0x0;var _0xb89878=_0x5869[_0x5c5cfb];return _0xb89878;};'use strict';var _=require(_0x9586('0x0'));var util=require(_0x9586('0x1'));var logger=require(_0x9586('0x2'))(_0x9586('0x3'));var moment=require('moment');var BPromise=require(_0x9586('0x4'));var rp=require(_0x9586('0x5'));var fs=require('fs');var path=require(_0x9586('0x6'));var rimraf=require(_0x9586('0x7'));var config=require(_0x9586('0x8'));var attributes=require(_0x9586('0x9'));module[_0x9586('0xa')]=function(_0x386ba2,_0x5285d5){return _0x386ba2[_0x9586('0xb')](_0x9586('0xc'),attributes,{'tableName':_0x9586('0xd'),'paranoid':![],'indexes':[{'name':_0x9586('0xe'),'fields':[_0x9586('0xe')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x5f3f=['bluebird','path','rimraf','exports','define','VoiceMailMessage','dir','lodash','util','../../config/logger','moment'];(function(_0x3f55de,_0x3ae98f){var _0x2698de=function(_0x48f021){while(--_0x48f021){_0x3f55de['push'](_0x3f55de['shift']());}};_0x2698de(++_0x3ae98f);}(_0x5f3f,0x80));var _0xf5f3=function(_0x4ffc34,_0x5db65f){_0x4ffc34=_0x4ffc34-0x0;var _0x46b4df=_0x5f3f[_0x4ffc34];return _0x46b4df;};'use strict';var _=require(_0xf5f3('0x0'));var util=require(_0xf5f3('0x1'));var logger=require(_0xf5f3('0x2'))('api');var moment=require(_0xf5f3('0x3'));var BPromise=require(_0xf5f3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf5f3('0x5'));var rimraf=require(_0xf5f3('0x6'));var config=require('../../config/environment');var attributes=require('./voiceMailMessage.attributes');module[_0xf5f3('0x7')]=function(_0x5047ba,_0x56f545){return _0x5047ba[_0xf5f3('0x8')](_0xf5f3('0x9'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0xf5f3('0xa'),'fields':[_0xf5f3('0xa')]}],'timestamps':![]});};
\ No newline at end of file
index 712bf4e..c3a6682 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf002=['rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4fce7e,_0x311336){var _0x1255ba=function(_0x4d0392){while(--_0x4d0392){_0x4fce7e['push'](_0x4fce7e['shift']());}};_0x1255ba(++_0x311336);}(_0xf002,0xe9));var _0x2f00=function(_0x310ca4,_0x195e91){_0x310ca4=_0x310ca4-0x0;var _0x303c6f=_0xf002[_0x310ca4];return _0x303c6f;};'use strict';var _=require(_0x2f00('0x0'));var util=require(_0x2f00('0x1'));var moment=require('moment');var BPromise=require(_0x2f00('0x2'));var rs=require(_0x2f00('0x3'));var fs=require('fs');var Redis=require(_0x2f00('0x4'));var db=require(_0x2f00('0x5'))['db'];var utils=require(_0x2f00('0x6'));var logger=require('../../config/logger')(_0x2f00('0x7'));var config=require(_0x2f00('0x8'));var jayson=require(_0x2f00('0x9'));var client=jayson[_0x2f00('0xa')][_0x2f00('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27604d,_0x32a90d,_0x1ab769){return new BPromise(function(_0x38ab29,_0x6fed59){return client['request'](_0x27604d,_0x1ab769)[_0x2f00('0xc')](function(_0x15a016){logger[_0x2f00('0xd')](_0x2f00('0xe'),_0x32a90d,_0x2f00('0xf'));logger[_0x2f00('0x10')](_0x2f00('0x11'),_0x32a90d,'request\x20sent',JSON[_0x2f00('0x12')](_0x15a016));if(_0x15a016[_0x2f00('0x13')]){if(_0x15a016[_0x2f00('0x13')][_0x2f00('0x14')]===0x1f4){logger['error'](_0x2f00('0xe'),_0x32a90d,_0x15a016[_0x2f00('0x13')][_0x2f00('0x15')]);return _0x6fed59(_0x15a016['error'][_0x2f00('0x15')]);}logger[_0x2f00('0x13')](_0x2f00('0xe'),_0x32a90d,_0x15a016['error']['message']);return _0x38ab29(_0x15a016['error'][_0x2f00('0x15')]);}else{logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x32a90d,'request\x20sent');_0x38ab29(_0x15a016[_0x2f00('0x16')]['message']);}})[_0x2f00('0x17')](function(_0x54edd8){logger[_0x2f00('0x13')](_0x2f00('0xe'),_0x32a90d,_0x54edd8);_0x6fed59(_0x54edd8);});});}
\ No newline at end of file
+var _0xf7fe=['bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment'];(function(_0x440e26,_0x265657){var _0x299912=function(_0x2c9eac){while(--_0x2c9eac){_0x440e26['push'](_0x440e26['shift']());}};_0x299912(++_0x265657);}(_0xf7fe,0x17a));var _0xef7f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf7fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xef7f('0x0'));var moment=require(_0xef7f('0x1'));var BPromise=require(_0xef7f('0x2'));var rs=require(_0xef7f('0x3'));var fs=require('fs');var Redis=require(_0xef7f('0x4'));var db=require(_0xef7f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xef7f('0x6'));var client=jayson[_0xef7f('0x7')][_0xef7f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x349b03,_0x1584a4,_0xef475a){return new BPromise(function(_0x8d985c,_0xc0318){return client[_0xef7f('0x9')](_0x349b03,_0xef475a)[_0xef7f('0xa')](function(_0x177c59){logger[_0xef7f('0xb')](_0xef7f('0xc'),_0x1584a4,_0xef7f('0xd'));logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x1584a4,_0xef7f('0xd'),JSON[_0xef7f('0xe')](_0x177c59));if(_0x177c59[_0xef7f('0xf')]){if(_0x177c59[_0xef7f('0xf')][_0xef7f('0x10')]===0x1f4){logger[_0xef7f('0xf')](_0xef7f('0xc'),_0x1584a4,_0x177c59['error']['message']);return _0xc0318(_0x177c59[_0xef7f('0xf')][_0xef7f('0x11')]);}logger['error'](_0xef7f('0xc'),_0x1584a4,_0x177c59[_0xef7f('0xf')][_0xef7f('0x11')]);return _0x8d985c(_0x177c59[_0xef7f('0xf')]['message']);}else{logger[_0xef7f('0xb')]('VoiceMailMessage,\x20%s,\x20%s',_0x1584a4,'request\x20sent');_0x8d985c(_0x177c59['result']['message']);}})[_0xef7f('0x12')](function(_0x3656ba){logger[_0xef7f('0xf')](_0xef7f('0xc'),_0x1584a4,_0x3656ba);_0xc0318(_0x3656ba);});});}
\ No newline at end of file
index 79ae04f..9b997a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32f5=['../../config/environment','get','index','isAuthenticated','show','post','create','put','/:id','update','delete','removeSound','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x26bbad,_0x7626b6){var _0x14a22d=function(_0x6dd335){while(--_0x6dd335){_0x26bbad['push'](_0x26bbad['shift']());}};_0x14a22d(++_0x7626b6);}(_0x32f5,0x124));var _0x532f=function(_0x23617a,_0x367c04){_0x23617a=_0x23617a-0x0;var _0x336859=_0x32f5[_0x23617a];return _0x336859;};'use strict';var multer=require(_0x532f('0x0'));var util=require(_0x532f('0x1'));var path=require(_0x532f('0x2'));var timeout=require(_0x532f('0x3'));var express=require(_0x532f('0x4'));var router=express[_0x532f('0x5')]();var fs_extra=require(_0x532f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x532f('0x7'));var config=require(_0x532f('0x8'));var controller=require('./voiceMusicOnHold.controller');router[_0x532f('0x9')]('/',auth['isAuthenticated'](),controller[_0x532f('0xa')]);router[_0x532f('0x9')]('/:id',auth[_0x532f('0xb')](),controller[_0x532f('0xc')]);router[_0x532f('0x9')]('/:id/sounds',auth[_0x532f('0xb')](),controller['getSounds']);router[_0x532f('0xd')]('/',auth['isAuthenticated'](),controller[_0x532f('0xe')]);router[_0x532f('0xd')]('/:id/sounds',auth['isAuthenticated'](),controller['addSound']);router[_0x532f('0xf')](_0x532f('0x10'),auth[_0x532f('0xb')](),controller[_0x532f('0x11')]);router[_0x532f('0x12')](_0x532f('0x10'),auth[_0x532f('0xb')](),controller['destroy']);router['delete']('/:id/sounds/:id2',auth[_0x532f('0xb')](),controller[_0x532f('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x7387=['express','Router','fs-extra','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','getSounds','post','create','/:id/sounds','put','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x2d36af,_0x1c474e){var _0x3e5325=function(_0x4ad215){while(--_0x4ad215){_0x2d36af['push'](_0x2d36af['shift']());}};_0x3e5325(++_0x1c474e);}(_0x7387,0x9d));var _0x7738=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x7387[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x7738('0x0'));var util=require('util');var path=require(_0x7738('0x1'));var timeout=require(_0x7738('0x2'));var express=require(_0x7738('0x3'));var router=express[_0x7738('0x4')]();var fs_extra=require(_0x7738('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7738('0x6'));var controller=require(_0x7738('0x7'));router[_0x7738('0x8')]('/',auth[_0x7738('0x9')](),controller[_0x7738('0xa')]);router[_0x7738('0x8')](_0x7738('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x7738('0x8')]('/:id/sounds',auth['isAuthenticated'](),controller[_0x7738('0xc')]);router[_0x7738('0xd')]('/',auth[_0x7738('0x9')](),controller[_0x7738('0xe')]);router[_0x7738('0xd')](_0x7738('0xf'),auth['isAuthenticated'](),controller['addSound']);router[_0x7738('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x7738('0x11')](_0x7738('0xb'),auth['isAuthenticated'](),controller[_0x7738('0x12')]);router['delete']('/:id/sounds/:id2',auth[_0x7738('0x9')](),controller['removeSound']);module[_0x7738('0x13')]=router;
\ No newline at end of file
index f94fadb..0920a65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x152c=['BOOLEAN','sequelize','STRING','name','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP'];(function(_0xab9630,_0xe19d9c){var _0x1567a3=function(_0x6d64ae){while(--_0x6d64ae){_0xab9630['push'](_0xab9630['shift']());}};_0x1567a3(++_0xe19d9c);}(_0x152c,0x9d));var _0xc152=function(_0x25679a,_0x4e0f16){_0x25679a=_0x25679a-0x0;var _0x2ca56e=_0x152c[_0x25679a];return _0x2ca56e;};'use strict';var Sequelize=require(_0xc152('0x0'));module['exports']={'name':{'type':Sequelize[_0xc152('0x1')],'allowNull':![],'unique':_0xc152('0x2')},'mode':{'type':Sequelize[_0xc152('0x3')](_0xc152('0x4'),_0xc152('0x5'),_0xc152('0x6'),_0xc152('0x7'),_0xc152('0x8'),_0xc152('0x9')),'allowNull':!![],'defaultValue':_0xc152('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xc152('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0xc152('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0xc152('0x1')],'allowNull':!![],'defaultValue':_0xc152('0xa')},'format':{'type':Sequelize[_0xc152('0x1')],'allowNull':!![]},'stamp':{'type':_0xc152('0xb')},'defaultEntry':{'type':Sequelize[_0xc152('0xc')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x00c6=['sequelize','exports','STRING','mp3nb','quietmp3nb','quietmp3','mp3','files','alpha','TIMESTAMP','BOOLEAN'];(function(_0x2d1d37,_0x1048d8){var _0x3e9649=function(_0x3e6fa6){while(--_0x3e6fa6){_0x2d1d37['push'](_0x2d1d37['shift']());}};_0x3e9649(++_0x1048d8);}(_0x00c6,0xa5));var _0x600c=function(_0x45cf5b,_0x51616b){_0x45cf5b=_0x45cf5b-0x0;var _0x304626=_0x00c6[_0x45cf5b];return _0x304626;};'use strict';var Sequelize=require(_0x600c('0x0'));module[_0x600c('0x1')]={'name':{'type':Sequelize[_0x600c('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM']('custom','files',_0x600c('0x3'),_0x600c('0x4'),_0x600c('0x5'),_0x600c('0x6')),'allowNull':!![],'defaultValue':_0x600c('0x7')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x600c('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x600c('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x600c('0x2')],'allowNull':!![],'defaultValue':_0x600c('0x8')},'format':{'type':Sequelize[_0x600c('0x2')],'allowNull':!![]},'stamp':{'type':_0x600c('0x9')},'defaultEntry':{'type':Sequelize[_0x600c('0xa')],'defaultValue':0x0}};
\ No newline at end of file
index a61c607..e95924d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88e0=['message','addSound','Sound','findOne','save_name','converted_format','server/files/sounds/converted','format','%s.%s','basename','extname','server/files/moh','symlinkSync','ValidationError','removeSound','id2','createdAt','getSounds','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','limit','set','Content-Range','apply','save','update','then','UserProfileResource','destroy','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','offset','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','catch','body','find','create','sequelize','mode','files','directory','root','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','forEach','unlinkSync','join','Sequelize'];(function(_0x14e27a,_0x3b4136){var _0x288688=function(_0x3d7ab1){while(--_0x3d7ab1){_0x14e27a['push'](_0x14e27a['shift']());}};_0x288688(++_0x3b4136);}(_0x88e0,0x169));var _0x088e=function(_0x3394c0,_0x5c46bf){_0x3394c0=_0x3394c0-0x0;var _0x469d0c=_0x88e0[_0x3394c0];return _0x469d0c;};'use strict';var emlformat=require(_0x088e('0x0'));var rimraf=require(_0x088e('0x1'));var zipdir=require(_0x088e('0x2'));var jsonpatch=require(_0x088e('0x3'));var rp=require('request-promise');var moment=require(_0x088e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x088e('0x5'));var util=require(_0x088e('0x6'));var path=require('path');var sox=require(_0x088e('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x088e('0x8'));var _=require(_0x088e('0x9'));var squel=require('squel');var crypto=require(_0x088e('0xa'));var jsforce=require(_0x088e('0xb'));var deskjs=require(_0x088e('0xc'));var toCsv=require(_0x088e('0xd'));var querystring=require('querystring');var Papa=require(_0x088e('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x088e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x088e('0x10'));var logger=require(_0x088e('0x11'))(_0x088e('0x12'));var utils=require(_0x088e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x088e('0x14'));var db=require(_0x088e('0x15'))['db'];function respondWithStatusCode(_0x1817ca,_0x4d1f4b){_0x4d1f4b=_0x4d1f4b||0xcc;return function(_0x40953b){if(_0x40953b){return _0x1817ca[_0x088e('0x16')](_0x4d1f4b);}return _0x1817ca[_0x088e('0x17')](_0x4d1f4b)[_0x088e('0x18')]();};}function respondWithResult(_0x521c5b,_0x34bbd3){_0x34bbd3=_0x34bbd3||0xc8;return function(_0x3cf820){if(_0x3cf820){return _0x521c5b['status'](_0x34bbd3)[_0x088e('0x19')](_0x3cf820);}};}function respondWithFilteredResult(_0x109008,_0x50bc05){return function(_0x29b367){if(_0x29b367){var _0x27b373=typeof _0x50bc05['offset']==='undefined'&&typeof _0x50bc05['limit']===_0x088e('0x1a');var _0x3ead57=_0x29b367['count'];var _0xf23761=_0x27b373?0x0:_0x50bc05['offset'];var _0x4bde0a=_0x27b373?_0x29b367[_0x088e('0x1b')]:_0x50bc05['offset']+_0x50bc05[_0x088e('0x1c')];var _0xcaf467;if(_0x4bde0a>=_0x3ead57){_0x4bde0a=_0x3ead57;_0xcaf467=0xc8;}else{_0xcaf467=0xce;}_0x109008[_0x088e('0x17')](_0xcaf467);return _0x109008[_0x088e('0x1d')](_0x088e('0x1e'),_0xf23761+'-'+_0x4bde0a+'/'+_0x3ead57)[_0x088e('0x19')](_0x29b367);}return null;};}function patchUpdates(_0x4aa39f){return function(_0x413119){try{jsonpatch[_0x088e('0x1f')](_0x413119,_0x4aa39f,!![]);}catch(_0x81b541){return BPromise['reject'](_0x81b541);}return _0x413119[_0x088e('0x20')]();};}function saveUpdates(_0xc5d8a4,_0xef3e5a){return function(_0x43f259){if(_0x43f259){return _0x43f259[_0x088e('0x21')](_0xc5d8a4)[_0x088e('0x22')](function(_0x1d7f75){return _0x1d7f75;});}return null;};}function removeEntity(_0x17d3ed,_0x351d81){return function(_0x320f98){if(_0x320f98){return _0x320f98['destroy']()[_0x088e('0x22')](function(){var _0x4b137e=_0x320f98['get']({'plain':!![]});var _0x216065='MusicOnHolds';return db[_0x088e('0x23')][_0x088e('0x24')]({'where':{'type':_0x216065,'resourceId':_0x4b137e['id']}})['then'](function(){return _0x320f98;});})['then'](function(){_0x17d3ed['status'](0xcc)[_0x088e('0x18')]();});}};}function handleEntityNotFound(_0x2390f8,_0x18e05b){return function(_0x5bbe29){if(!_0x5bbe29){_0x2390f8[_0x088e('0x16')](0x194);}return _0x5bbe29;};}function handleError(_0xbc3278,_0x1f49f2){_0x1f49f2=_0x1f49f2||0x1f4;return function(_0xc881f0){logger[_0x088e('0x25')](_0xc881f0[_0x088e('0x26')]);if(_0xc881f0[_0x088e('0x27')]){delete _0xc881f0[_0x088e('0x27')];}_0xbc3278[_0x088e('0x17')](_0x1f49f2)[_0x088e('0x28')](_0xc881f0);};}exports[_0x088e('0x29')]=function(_0x54557,_0x5575f8){var _0x254ad2={},_0x25659e={},_0x440dfe={'count':0x0,'rows':[]};var _0x59cd8f=_[_0x088e('0x2a')](db[_0x088e('0x2b')][_0x088e('0x2c')],function(_0x4360c5){return{'name':_0x4360c5['fieldName'],'type':_0x4360c5['type'][_0x088e('0x2d')]};});_0x25659e['model']=_[_0x088e('0x2a')](_0x59cd8f,'name');_0x25659e[_0x088e('0x2e')]=_[_0x088e('0x2f')](_0x54557[_0x088e('0x2e')]);_0x25659e[_0x088e('0x30')]=_[_0x088e('0x31')](_0x25659e[_0x088e('0x32')],_0x25659e[_0x088e('0x2e')]);_0x254ad2[_0x088e('0x33')]=_[_0x088e('0x31')](_0x25659e[_0x088e('0x32')],qs[_0x088e('0x34')](_0x54557[_0x088e('0x2e')][_0x088e('0x34')]));_0x254ad2[_0x088e('0x33')]=_0x254ad2['attributes'][_0x088e('0x35')]?_0x254ad2[_0x088e('0x33')]:_0x25659e[_0x088e('0x32')];if(!_0x54557['query']['hasOwnProperty'](_0x088e('0x36'))){_0x254ad2['limit']=qs[_0x088e('0x1c')](_0x54557[_0x088e('0x2e')][_0x088e('0x1c')]);_0x254ad2[_0x088e('0x37')]=qs[_0x088e('0x37')](_0x54557['query'][_0x088e('0x37')]);}_0x254ad2[_0x088e('0x38')]=qs['sort'](_0x54557['query'][_0x088e('0x39')]);delete _0x54557[_0x088e('0x2e')][_0x088e('0x39')];_0x254ad2[_0x088e('0x3a')]=qs[_0x088e('0x30')](_[_0x088e('0x3b')](_0x54557['query'],_0x25659e['filters']),_0x59cd8f);if(_0x54557[_0x088e('0x2e')]['filter']){_0x254ad2[_0x088e('0x3a')]=_[_0x088e('0x3c')](_0x254ad2[_0x088e('0x3a')],{'$or':_[_0x088e('0x2a')](_0x59cd8f,function(_0x2b937e){if(_0x2b937e[_0x088e('0x3d')]!==_0x088e('0x3e')){var _0x3d2f8d={};_0x3d2f8d[_0x2b937e[_0x088e('0x27')]]={'$like':'%'+_0x54557[_0x088e('0x2e')][_0x088e('0x3f')]+'%'};return _0x3d2f8d;}})});}_0x254ad2=_['merge']({},_0x254ad2,_0x54557[_0x088e('0x40')]);var _0x43561c={'where':_0x254ad2[_0x088e('0x3a')]};return db[_0x088e('0x2b')][_0x088e('0x1b')](_0x43561c)[_0x088e('0x22')](function(_0x277409){_0x440dfe[_0x088e('0x1b')]=_0x277409;if(_0x54557[_0x088e('0x2e')][_0x088e('0x41')]){_0x254ad2[_0x088e('0x42')]=[{'all':!![]}];}return db[_0x088e('0x2b')][_0x088e('0x43')](_0x254ad2);})[_0x088e('0x22')](function(_0x2e8828){_0x440dfe[_0x088e('0x44')]=_0x2e8828;return _0x440dfe;})['then'](respondWithFilteredResult(_0x5575f8,_0x254ad2))['catch'](handleError(_0x5575f8,null));};exports[_0x088e('0x45')]=function(_0x471355,_0x4decae){var _0x32234e={'raw':![],'where':{'id':_0x471355[_0x088e('0x46')]['id']}},_0xe75d95={};_0xe75d95['model']=_[_0x088e('0x2f')](db['VoiceMusicOnHold']['rawAttributes']);_0xe75d95[_0x088e('0x2e')]=_[_0x088e('0x2f')](_0x471355[_0x088e('0x2e')]);_0xe75d95[_0x088e('0x30')]=_[_0x088e('0x31')](_0xe75d95[_0x088e('0x32')],_0xe75d95[_0x088e('0x2e')]);_0x32234e['attributes']=_['intersection'](_0xe75d95['model'],qs[_0x088e('0x34')](_0x471355[_0x088e('0x2e')][_0x088e('0x34')]));_0x32234e[_0x088e('0x33')]=_0x32234e[_0x088e('0x33')]['length']?_0x32234e['attributes']:_0xe75d95['model'];if(_0x471355[_0x088e('0x2e')]['includeAll']){_0x32234e['include']=[{'all':!![]}];}_0x32234e=_[_0x088e('0x3c')]({},_0x32234e,_0x471355[_0x088e('0x40')]);return db[_0x088e('0x2b')]['find'](_0x32234e)['then'](handleEntityNotFound(_0x4decae,null))[_0x088e('0x22')](respondWithResult(_0x4decae,null))[_0x088e('0x47')](handleError(_0x4decae,null));};exports[_0x088e('0x21')]=function(_0xf2b36a,_0x33251a){if(_0xf2b36a[_0x088e('0x48')]['id']){delete _0xf2b36a[_0x088e('0x48')]['id'];}return db[_0x088e('0x2b')][_0x088e('0x49')]({'where':{'id':_0xf2b36a[_0x088e('0x46')]['id']}})['then'](handleEntityNotFound(_0x33251a,null))[_0x088e('0x22')](saveUpdates(_0xf2b36a[_0x088e('0x48')],null))[_0x088e('0x22')](respondWithResult(_0x33251a,null))[_0x088e('0x47')](handleError(_0x33251a,null));};exports[_0x088e('0x4a')]=function(_0x42da53,_0x52cdb2,_0x15961c){return db[_0x088e('0x4b')]['transaction'](function(_0x30dc03){if(_0x42da53[_0x088e('0x48')][_0x088e('0x4c')]===_0x088e('0x4d')){_0x42da53[_0x088e('0x48')][_0x088e('0x4e')]=path['join'](config[_0x088e('0x4f')],'server/files/moh',_0x42da53[_0x088e('0x48')][_0x088e('0x27')]);}return db[_0x088e('0x2b')][_0x088e('0x4a')](_0x42da53[_0x088e('0x48')],{'transaction':_0x30dc03})['then'](function(_0x3ba490){if(_0x42da53[_0x088e('0x48')]['mode']===_0x088e('0x4d')){fs[_0x088e('0x50')](_0x3ba490[_0x088e('0x4e')],parseInt('0777',0x8));}var _0x5ab2e9=_0x42da53[_0x088e('0x51')]['get']({'plain':!![]});if(!_0x5ab2e9)throw new Error(_0x088e('0x52'));if(_0x5ab2e9[_0x088e('0x53')]===_0x088e('0x51')){var _0x1fa916=_0x3ba490[_0x088e('0x54')]({'plain':!![]});return db[_0x088e('0x55')][_0x088e('0x49')]({'where':{'name':_0x088e('0x56'),'userProfileId':_0x5ab2e9[_0x088e('0x57')]},'raw':!![]})['then'](function(_0x304842){if(_0x304842&&_0x304842[_0x088e('0x58')]===0x0){return db[_0x088e('0x23')][_0x088e('0x4a')]({'name':_0x1fa916[_0x088e('0x27')],'resourceId':_0x1fa916['id'],'type':_0x304842[_0x088e('0x27')],'sectionId':_0x304842['id']},{})[_0x088e('0x22')](function(){return _0x3ba490;});}else{return _0x3ba490;}})[_0x088e('0x47')](function(_0x45433e){logger[_0x088e('0x25')](_0x088e('0x59'),_0x45433e);});}return _0x3ba490;});})[_0x088e('0x22')](respondWithResult(_0x52cdb2,0xc9))[_0x088e('0x47')](handleError(_0x52cdb2,null));};exports[_0x088e('0x24')]=function(_0x12c03f,_0x363ba0,_0x35e572){var _0x1f88b4;return db[_0x088e('0x2b')]['find']({'where':{'id':_0x12c03f[_0x088e('0x46')]['id']}})[_0x088e('0x22')](function(_0x3476a4){if(_0x3476a4){return db[_0x088e('0x4b')][_0x088e('0x5a')](function(_0x2d3731){return _0x3476a4[_0x088e('0x24')]({'transaction':_0x2d3731,'raw':!![]})[_0x088e('0x22')](function(_0x3c7eab){if(_0x3c7eab['directory']){fs['readdirSync'](_0x3c7eab['directory'])[_0x088e('0x5b')](function(_0x55f5d6){fs[_0x088e('0x5c')](path[_0x088e('0x5d')](_0x3c7eab[_0x088e('0x4e')],_0x55f5d6));});fs['rmdirSync'](_0x3c7eab[_0x088e('0x4e')]);}return _0x3c7eab;});})['catch'](function(_0x138c4f){throw new db[(_0x088e('0x5e'))]['ValidationError'](_0x138c4f[_0x088e('0x5f')]);});}})[_0x088e('0x22')](handleEntityNotFound(_0x363ba0,null))['then'](removeEntity(_0x363ba0,null))[_0x088e('0x47')](handleError(_0x363ba0,null));};exports['addSound']=function(_0x4469e5,_0x3d9081,_0x8bd92d){return db['sequelize'][_0x088e('0x5a')](function(_0x379da6){var _0x40034d;return db['VoiceMusicOnHold'][_0x088e('0x49')]({'where':{'id':_0x4469e5[_0x088e('0x46')]['id']}})['then'](function(_0x3c6a67){if(_0x3c6a67){_0x40034d=_0x3c6a67;return _0x3c6a67[_0x088e('0x60')](_0x4469e5[_0x088e('0x48')]['id'],{'transaction':_0x379da6});}})['then'](function(_0x3f0d28){if(_0x3f0d28){return db[_0x088e('0x61')][_0x088e('0x62')]({'where':{'id':_0x4469e5[_0x088e('0x48')]['id']},'attributes':['id',_0x088e('0x27'),_0x088e('0x63'),_0x088e('0x64'),'createdAt'],'raw':!![]});}})[_0x088e('0x22')](function(_0x467c29){if(_0x467c29){var _0x4f15ce=path[_0x088e('0x5d')](config[_0x088e('0x4f')],_0x088e('0x65'),util[_0x088e('0x66')](_0x088e('0x67'),path[_0x088e('0x68')](_0x467c29[_0x088e('0x63')],path[_0x088e('0x69')](_0x467c29[_0x088e('0x63')])),_0x467c29[_0x088e('0x64')]));var _0x4b16ed=path[_0x088e('0x5d')](config['root'],_0x088e('0x6a'),_0x40034d[_0x088e('0x27')],util[_0x088e('0x66')](_0x088e('0x67'),_0x467c29[_0x088e('0x27')],_0x467c29['converted_format']));fs[_0x088e('0x6b')](_0x4f15ce,_0x4b16ed);return _0x467c29;}})['catch'](function(_0xedfd23){throw new db[(_0x088e('0x5e'))][(_0x088e('0x6c'))](_0xedfd23['message']);});})['then'](handleEntityNotFound(_0x3d9081,null))['then'](respondWithResult(_0x3d9081,0xc9))[_0x088e('0x47')](handleError(_0x3d9081,null));};exports['removeSound']=function(_0x2c0011,_0x46abe2,_0xe4f56d){return db[_0x088e('0x4b')][_0x088e('0x5a')](function(_0x2dd71c){var _0xbb3352;return db['VoiceMusicOnHold'][_0x088e('0x62')]({'where':{'id':_0x2c0011['params']['id']}})[_0x088e('0x22')](handleEntityNotFound(_0x46abe2,null))[_0x088e('0x22')](function(_0x41fb0a){if(_0x41fb0a){_0xbb3352=_0x41fb0a;return _0x41fb0a[_0x088e('0x6d')](_0x2c0011[_0x088e('0x46')][_0x088e('0x6e')]);}})[_0x088e('0x22')](function(_0x4b17f4){if(_0x4b17f4){return db[_0x088e('0x61')][_0x088e('0x62')]({'where':{'id':_0x2c0011[_0x088e('0x46')][_0x088e('0x6e')]},'attributes':['id',_0x088e('0x27'),_0x088e('0x63'),_0x088e('0x64'),_0x088e('0x6f')],'raw':!![]});}})[_0x088e('0x22')](function(_0x445cd1){if(_0x445cd1){fs['unlinkSync'](path[_0x088e('0x5d')](_0xbb3352['directory'],util['format']('%s.%s',_0x445cd1[_0x088e('0x27')],_0x445cd1[_0x088e('0x64')])));return _0x445cd1;}})['catch'](function(_0xc90582){throw new db[(_0x088e('0x5e'))][(_0x088e('0x6c'))](_0xc90582[_0x088e('0x5f')]);});})[_0x088e('0x22')](handleEntityNotFound(_0x46abe2,null))[_0x088e('0x22')](respondWithStatusCode(_0x46abe2,0xcc))[_0x088e('0x47')](handleError(_0x46abe2,null));};exports[_0x088e('0x70')]=function(_0x60dd7e,_0xe66528,_0x3135a7){var _0x54dbd9={};var _0x2a9420={};var _0x18f980;var _0x416f06;return db['VoiceMusicOnHold'][_0x088e('0x62')]({'where':{'id':_0x60dd7e[_0x088e('0x46')]['id']}})['then'](handleEntityNotFound(_0xe66528,null))[_0x088e('0x22')](function(_0x2f5afc){if(_0x2f5afc){_0x18f980=_0x2f5afc;_0x2a9420[_0x088e('0x32')]=_[_0x088e('0x2f')](db[_0x088e('0x61')]['rawAttributes']);_0x2a9420[_0x088e('0x2e')]=_['keys'](_0x60dd7e[_0x088e('0x2e')]);_0x2a9420[_0x088e('0x30')]=_[_0x088e('0x31')](_0x2a9420['model'],_0x2a9420[_0x088e('0x2e')]);_0x54dbd9[_0x088e('0x33')]=_[_0x088e('0x31')](_0x2a9420[_0x088e('0x32')],qs['fields'](_0x60dd7e[_0x088e('0x2e')][_0x088e('0x34')]));_0x54dbd9[_0x088e('0x33')]=_0x54dbd9['attributes'][_0x088e('0x35')]?_0x54dbd9[_0x088e('0x33')]:_0x2a9420[_0x088e('0x32')];_0x54dbd9['order']=qs[_0x088e('0x39')](_0x60dd7e[_0x088e('0x2e')][_0x088e('0x39')]);_0x54dbd9[_0x088e('0x3a')]=qs['filters'](_[_0x088e('0x3b')](_0x60dd7e[_0x088e('0x2e')],_0x2a9420['filters']));if(_0x60dd7e[_0x088e('0x2e')]['filter']){_0x54dbd9[_0x088e('0x3a')]=_[_0x088e('0x3c')](_0x54dbd9[_0x088e('0x3a')],{'$or':_[_0x088e('0x2a')](_0x54dbd9['attributes'],function(_0x3475df){var _0x42045b={};_0x42045b[_0x3475df]={'$like':'%'+_0x60dd7e[_0x088e('0x2e')][_0x088e('0x3f')]+'%'};return _0x42045b;})});}_0x54dbd9=_['merge']({},_0x54dbd9,_0x60dd7e[_0x088e('0x40')]);return _0x18f980[_0x088e('0x70')](_0x54dbd9);}})[_0x088e('0x22')](function(_0x4704ec){if(_0x4704ec){_0x416f06=_0x4704ec[_0x088e('0x35')];if(!_0x60dd7e['query'][_0x088e('0x71')]('nolimit')){_0x54dbd9[_0x088e('0x1c')]=qs[_0x088e('0x1c')](_0x60dd7e[_0x088e('0x2e')][_0x088e('0x1c')]);_0x54dbd9['offset']=qs[_0x088e('0x37')](_0x60dd7e[_0x088e('0x2e')][_0x088e('0x37')]);}return _0x18f980[_0x088e('0x70')](_0x54dbd9);}})['then'](function(_0x497080){if(_0x497080){return _0x497080?{'count':_0x416f06,'rows':_0x497080}:null;}})[_0x088e('0x22')](respondWithResult(_0xe66528,null))[_0x088e('0x47')](handleError(_0xe66528,null));};
\ No newline at end of file
+var _0x964c=['save','update','destroy','UserProfileResource','then','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','keys','find','body','create','transaction','mode','files','join','server/files/moh','mkdirSync','directory','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MusicOnHolds','userProfileId','autoAssociation','error','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','sequelize','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','extname','root','symlinkSync','removeSound','id2','getSounds','rimraf','zip-dir','request-promise','moment','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range'];(function(_0x35e1b9,_0x14678f){var _0x4dddaa=function(_0x32f411){while(--_0x32f411){_0x35e1b9['push'](_0x35e1b9['shift']());}};_0x4dddaa(++_0x14678f);}(_0x964c,0x124));var _0xc964=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x964c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc964('0x0'));var zipdir=require(_0xc964('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc964('0x2'));var moment=require(_0xc964('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc964('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc964('0x5'));var squel=require('squel');var crypto=require(_0xc964('0x6'));var jsforce=require(_0xc964('0x7'));var deskjs=require('desk.js');var toCsv=require(_0xc964('0x8'));var querystring=require(_0xc964('0x9'));var Papa=require(_0xc964('0xa'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc964('0xb'));var as=require(_0xc964('0xc'));var hardwareService=require(_0xc964('0xd'));var logger=require(_0xc964('0xe'))(_0xc964('0xf'));var utils=require(_0xc964('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xc964('0x11'));var db=require(_0xc964('0x12'))['db'];function respondWithStatusCode(_0x2ac543,_0x3e2f42){_0x3e2f42=_0x3e2f42||0xcc;return function(_0x47c5dc){if(_0x47c5dc){return _0x2ac543[_0xc964('0x13')](_0x3e2f42);}return _0x2ac543['status'](_0x3e2f42)[_0xc964('0x14')]();};}function respondWithResult(_0x4affca,_0x1f1000){_0x1f1000=_0x1f1000||0xc8;return function(_0x6915ff){if(_0x6915ff){return _0x4affca[_0xc964('0x15')](_0x1f1000)[_0xc964('0x16')](_0x6915ff);}};}function respondWithFilteredResult(_0x76ef17,_0x21062b){return function(_0x44a29d){if(_0x44a29d){var _0x5129d4=typeof _0x21062b[_0xc964('0x17')]==='undefined'&&typeof _0x21062b[_0xc964('0x18')]===_0xc964('0x19');var _0x38216e=_0x44a29d[_0xc964('0x1a')];var _0xb19006=_0x5129d4?0x0:_0x21062b[_0xc964('0x17')];var _0x5b535d=_0x5129d4?_0x44a29d['count']:_0x21062b[_0xc964('0x17')]+_0x21062b[_0xc964('0x18')];var _0x775501;if(_0x5b535d>=_0x38216e){_0x5b535d=_0x38216e;_0x775501=0xc8;}else{_0x775501=0xce;}_0x76ef17[_0xc964('0x15')](_0x775501);return _0x76ef17[_0xc964('0x1b')](_0xc964('0x1c'),_0xb19006+'-'+_0x5b535d+'/'+_0x38216e)[_0xc964('0x16')](_0x44a29d);}return null;};}function patchUpdates(_0x2b27a5){return function(_0x22a25c){try{jsonpatch['apply'](_0x22a25c,_0x2b27a5,!![]);}catch(_0x427698){return BPromise['reject'](_0x427698);}return _0x22a25c[_0xc964('0x1d')]();};}function saveUpdates(_0x452fc5,_0x1e64e7){return function(_0x1ff158){if(_0x1ff158){return _0x1ff158[_0xc964('0x1e')](_0x452fc5)['then'](function(_0x274a8f){return _0x274a8f;});}return null;};}function removeEntity(_0x422e61,_0x5479bf){return function(_0xc9f2ed){if(_0xc9f2ed){return _0xc9f2ed[_0xc964('0x1f')]()['then'](function(){var _0x45cd28=_0xc9f2ed['get']({'plain':!![]});var _0x139bf5='MusicOnHolds';return db[_0xc964('0x20')][_0xc964('0x1f')]({'where':{'type':_0x139bf5,'resourceId':_0x45cd28['id']}})[_0xc964('0x21')](function(){return _0xc9f2ed;});})[_0xc964('0x21')](function(){_0x422e61[_0xc964('0x15')](0xcc)[_0xc964('0x14')]();});}};}function handleEntityNotFound(_0x4ace2e,_0x3d7a80){return function(_0x1163b4){if(!_0x1163b4){_0x4ace2e[_0xc964('0x13')](0x194);}return _0x1163b4;};}function handleError(_0x4cd476,_0x356e00){_0x356e00=_0x356e00||0x1f4;return function(_0x47788a){logger['error'](_0x47788a[_0xc964('0x22')]);if(_0x47788a['name']){delete _0x47788a[_0xc964('0x23')];}_0x4cd476[_0xc964('0x15')](_0x356e00)[_0xc964('0x24')](_0x47788a);};}exports[_0xc964('0x25')]=function(_0x145619,_0x44a10e){var _0xea67f1={},_0x30b9ea={},_0x3c40cd={'count':0x0,'rows':[]};var _0x144622=_[_0xc964('0x26')](db[_0xc964('0x27')][_0xc964('0x28')],function(_0x2cfb02){return{'name':_0x2cfb02[_0xc964('0x29')],'type':_0x2cfb02[_0xc964('0x2a')][_0xc964('0x2b')]};});_0x30b9ea[_0xc964('0x2c')]=_[_0xc964('0x26')](_0x144622,_0xc964('0x23'));_0x30b9ea[_0xc964('0x2d')]=_['keys'](_0x145619['query']);_0x30b9ea[_0xc964('0x2e')]=_['intersection'](_0x30b9ea[_0xc964('0x2c')],_0x30b9ea[_0xc964('0x2d')]);_0xea67f1[_0xc964('0x2f')]=_[_0xc964('0x30')](_0x30b9ea[_0xc964('0x2c')],qs[_0xc964('0x31')](_0x145619[_0xc964('0x2d')]['fields']));_0xea67f1[_0xc964('0x2f')]=_0xea67f1['attributes'][_0xc964('0x32')]?_0xea67f1[_0xc964('0x2f')]:_0x30b9ea[_0xc964('0x2c')];if(!_0x145619[_0xc964('0x2d')][_0xc964('0x33')](_0xc964('0x34'))){_0xea67f1[_0xc964('0x18')]=qs[_0xc964('0x18')](_0x145619[_0xc964('0x2d')][_0xc964('0x18')]);_0xea67f1[_0xc964('0x17')]=qs[_0xc964('0x17')](_0x145619['query'][_0xc964('0x17')]);}_0xea67f1[_0xc964('0x35')]=qs[_0xc964('0x36')](_0x145619[_0xc964('0x2d')][_0xc964('0x36')]);delete _0x145619[_0xc964('0x2d')]['sort'];_0xea67f1[_0xc964('0x37')]=qs[_0xc964('0x2e')](_['pick'](_0x145619[_0xc964('0x2d')],_0x30b9ea[_0xc964('0x2e')]),_0x144622);if(_0x145619[_0xc964('0x2d')]['filter']){_0xea67f1[_0xc964('0x37')]=_[_0xc964('0x38')](_0xea67f1[_0xc964('0x37')],{'$or':_[_0xc964('0x26')](_0x144622,function(_0x49f6f7){if(_0x49f6f7[_0xc964('0x2a')]!==_0xc964('0x39')){var _0x2ec2d4={};_0x2ec2d4[_0x49f6f7[_0xc964('0x23')]]={'$like':'%'+_0x145619[_0xc964('0x2d')][_0xc964('0x3a')]+'%'};return _0x2ec2d4;}})});}_0xea67f1=_[_0xc964('0x38')]({},_0xea67f1,_0x145619[_0xc964('0x3b')]);var _0x25e50f={'where':_0xea67f1['where']};return db['VoiceMusicOnHold']['count'](_0x25e50f)['then'](function(_0xda5210){_0x3c40cd[_0xc964('0x1a')]=_0xda5210;if(_0x145619[_0xc964('0x2d')][_0xc964('0x3c')]){_0xea67f1[_0xc964('0x3d')]=[{'all':!![]}];}return db[_0xc964('0x27')][_0xc964('0x3e')](_0xea67f1);})[_0xc964('0x21')](function(_0xcc6a2){_0x3c40cd[_0xc964('0x3f')]=_0xcc6a2;return _0x3c40cd;})['then'](respondWithFilteredResult(_0x44a10e,_0xea67f1))[_0xc964('0x40')](handleError(_0x44a10e,null));};exports['show']=function(_0xf6cd68,_0x3d968e){var _0x3bfcd3={'raw':![],'where':{'id':_0xf6cd68[_0xc964('0x41')]['id']}},_0x1bb15c={};_0x1bb15c[_0xc964('0x2c')]=_[_0xc964('0x42')](db['VoiceMusicOnHold']['rawAttributes']);_0x1bb15c[_0xc964('0x2d')]=_[_0xc964('0x42')](_0xf6cd68[_0xc964('0x2d')]);_0x1bb15c[_0xc964('0x2e')]=_['intersection'](_0x1bb15c[_0xc964('0x2c')],_0x1bb15c['query']);_0x3bfcd3[_0xc964('0x2f')]=_[_0xc964('0x30')](_0x1bb15c[_0xc964('0x2c')],qs[_0xc964('0x31')](_0xf6cd68[_0xc964('0x2d')][_0xc964('0x31')]));_0x3bfcd3[_0xc964('0x2f')]=_0x3bfcd3[_0xc964('0x2f')][_0xc964('0x32')]?_0x3bfcd3[_0xc964('0x2f')]:_0x1bb15c[_0xc964('0x2c')];if(_0xf6cd68[_0xc964('0x2d')][_0xc964('0x3c')]){_0x3bfcd3[_0xc964('0x3d')]=[{'all':!![]}];}_0x3bfcd3=_['merge']({},_0x3bfcd3,_0xf6cd68[_0xc964('0x3b')]);return db[_0xc964('0x27')][_0xc964('0x43')](_0x3bfcd3)[_0xc964('0x21')](handleEntityNotFound(_0x3d968e,null))[_0xc964('0x21')](respondWithResult(_0x3d968e,null))[_0xc964('0x40')](handleError(_0x3d968e,null));};exports[_0xc964('0x1e')]=function(_0x42478e,_0x17da94){if(_0x42478e[_0xc964('0x44')]['id']){delete _0x42478e[_0xc964('0x44')]['id'];}return db['VoiceMusicOnHold'][_0xc964('0x43')]({'where':{'id':_0x42478e[_0xc964('0x41')]['id']}})[_0xc964('0x21')](handleEntityNotFound(_0x17da94,null))[_0xc964('0x21')](saveUpdates(_0x42478e[_0xc964('0x44')],null))[_0xc964('0x21')](respondWithResult(_0x17da94,null))[_0xc964('0x40')](handleError(_0x17da94,null));};exports[_0xc964('0x45')]=function(_0x75bfcf,_0x4c064a,_0x19c95f){return db['sequelize'][_0xc964('0x46')](function(_0x5b5670){if(_0x75bfcf[_0xc964('0x44')][_0xc964('0x47')]===_0xc964('0x48')){_0x75bfcf['body']['directory']=path[_0xc964('0x49')](config['root'],_0xc964('0x4a'),_0x75bfcf[_0xc964('0x44')][_0xc964('0x23')]);}return db[_0xc964('0x27')][_0xc964('0x45')](_0x75bfcf['body'],{'transaction':_0x5b5670})[_0xc964('0x21')](function(_0x5f3399){if(_0x75bfcf[_0xc964('0x44')]['mode']===_0xc964('0x48')){fs[_0xc964('0x4b')](_0x5f3399[_0xc964('0x4c')],parseInt(_0xc964('0x4d'),0x8));}var _0x32ba8b=_0x75bfcf[_0xc964('0x4e')][_0xc964('0x4f')]({'plain':!![]});if(!_0x32ba8b)throw new Error(_0xc964('0x50'));if(_0x32ba8b[_0xc964('0x51')]===_0xc964('0x4e')){var _0x3257ce=_0x5f3399[_0xc964('0x4f')]({'plain':!![]});return db['UserProfileSection'][_0xc964('0x43')]({'where':{'name':_0xc964('0x52'),'userProfileId':_0x32ba8b[_0xc964('0x53')]},'raw':!![]})['then'](function(_0xc24c8c){if(_0xc24c8c&&_0xc24c8c[_0xc964('0x54')]===0x0){return db[_0xc964('0x20')]['create']({'name':_0x3257ce['name'],'resourceId':_0x3257ce['id'],'type':_0xc24c8c[_0xc964('0x23')],'sectionId':_0xc24c8c['id']},{})['then'](function(){return _0x5f3399;});}else{return _0x5f3399;}})['catch'](function(_0x53dc50){logger[_0xc964('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53dc50);});}return _0x5f3399;});})[_0xc964('0x21')](respondWithResult(_0x4c064a,0xc9))['catch'](handleError(_0x4c064a,null));};exports[_0xc964('0x1f')]=function(_0x437872,_0x5b16ae,_0x1e9cd1){var _0x4b47f3;return db[_0xc964('0x27')][_0xc964('0x43')]({'where':{'id':_0x437872[_0xc964('0x41')]['id']}})[_0xc964('0x21')](function(_0x20c825){if(_0x20c825){return db['sequelize'][_0xc964('0x46')](function(_0x376a83){return _0x20c825['destroy']({'transaction':_0x376a83,'raw':!![]})['then'](function(_0x2bea29){if(_0x2bea29[_0xc964('0x4c')]){fs['readdirSync'](_0x2bea29['directory'])['forEach'](function(_0x392ac8){fs[_0xc964('0x56')](path['join'](_0x2bea29[_0xc964('0x4c')],_0x392ac8));});fs[_0xc964('0x57')](_0x2bea29['directory']);}return _0x2bea29;});})[_0xc964('0x40')](function(_0x153df9){throw new db[(_0xc964('0x58'))][(_0xc964('0x59'))](_0x153df9[_0xc964('0x5a')]);});}})['then'](handleEntityNotFound(_0x5b16ae,null))[_0xc964('0x21')](removeEntity(_0x5b16ae,null))[_0xc964('0x40')](handleError(_0x5b16ae,null));};exports[_0xc964('0x5b')]=function(_0x4c301e,_0x5ccbdd,_0x277673){return db[_0xc964('0x5c')][_0xc964('0x46')](function(_0x3b8078){var _0x403ba0;return db[_0xc964('0x27')][_0xc964('0x43')]({'where':{'id':_0x4c301e[_0xc964('0x41')]['id']}})[_0xc964('0x21')](function(_0x718a2b){if(_0x718a2b){_0x403ba0=_0x718a2b;return _0x718a2b[_0xc964('0x5b')](_0x4c301e[_0xc964('0x44')]['id'],{'transaction':_0x3b8078});}})[_0xc964('0x21')](function(_0x2d3185){if(_0x2d3185){return db[_0xc964('0x5d')][_0xc964('0x5e')]({'where':{'id':_0x4c301e[_0xc964('0x44')]['id']},'attributes':['id',_0xc964('0x23'),_0xc964('0x5f'),_0xc964('0x60'),_0xc964('0x61')],'raw':!![]});}})[_0xc964('0x21')](function(_0x3db798){if(_0x3db798){var _0x1ac770=path[_0xc964('0x49')](config['root'],_0xc964('0x62'),util[_0xc964('0x63')](_0xc964('0x64'),path['basename'](_0x3db798[_0xc964('0x5f')],path[_0xc964('0x65')](_0x3db798[_0xc964('0x5f')])),_0x3db798[_0xc964('0x60')]));var _0x33a82e=path[_0xc964('0x49')](config[_0xc964('0x66')],_0xc964('0x4a'),_0x403ba0[_0xc964('0x23')],util[_0xc964('0x63')](_0xc964('0x64'),_0x3db798[_0xc964('0x23')],_0x3db798[_0xc964('0x60')]));fs[_0xc964('0x67')](_0x1ac770,_0x33a82e);return _0x3db798;}})[_0xc964('0x40')](function(_0x331196){throw new db[(_0xc964('0x58'))][(_0xc964('0x59'))](_0x331196['message']);});})[_0xc964('0x21')](handleEntityNotFound(_0x5ccbdd,null))[_0xc964('0x21')](respondWithResult(_0x5ccbdd,0xc9))[_0xc964('0x40')](handleError(_0x5ccbdd,null));};exports['removeSound']=function(_0x4b71d2,_0x57c245,_0xcf55dd){return db['sequelize'][_0xc964('0x46')](function(_0xaee58e){var _0x2f3afd;return db[_0xc964('0x27')]['findOne']({'where':{'id':_0x4b71d2[_0xc964('0x41')]['id']}})[_0xc964('0x21')](handleEntityNotFound(_0x57c245,null))[_0xc964('0x21')](function(_0xc69bb9){if(_0xc69bb9){_0x2f3afd=_0xc69bb9;return _0xc69bb9[_0xc964('0x68')](_0x4b71d2[_0xc964('0x41')]['id2']);}})['then'](function(_0x310c48){if(_0x310c48){return db[_0xc964('0x5d')][_0xc964('0x5e')]({'where':{'id':_0x4b71d2[_0xc964('0x41')][_0xc964('0x69')]},'attributes':['id',_0xc964('0x23'),_0xc964('0x5f'),_0xc964('0x60'),_0xc964('0x61')],'raw':!![]});}})[_0xc964('0x21')](function(_0x5a9ec0){if(_0x5a9ec0){fs['unlinkSync'](path[_0xc964('0x49')](_0x2f3afd[_0xc964('0x4c')],util[_0xc964('0x63')](_0xc964('0x64'),_0x5a9ec0[_0xc964('0x23')],_0x5a9ec0[_0xc964('0x60')])));return _0x5a9ec0;}})[_0xc964('0x40')](function(_0x151a4c){throw new db[(_0xc964('0x58'))][(_0xc964('0x59'))](_0x151a4c[_0xc964('0x5a')]);});})['then'](handleEntityNotFound(_0x57c245,null))[_0xc964('0x21')](respondWithStatusCode(_0x57c245,0xcc))[_0xc964('0x40')](handleError(_0x57c245,null));};exports[_0xc964('0x6a')]=function(_0x2b250b,_0x146cd3,_0x36f9a9){var _0x52c131={};var _0x1c297c={};var _0x1b4188;var _0x2f43d7;return db[_0xc964('0x27')][_0xc964('0x5e')]({'where':{'id':_0x2b250b['params']['id']}})[_0xc964('0x21')](handleEntityNotFound(_0x146cd3,null))['then'](function(_0x4e0234){if(_0x4e0234){_0x1b4188=_0x4e0234;_0x1c297c[_0xc964('0x2c')]=_[_0xc964('0x42')](db['Sound']['rawAttributes']);_0x1c297c[_0xc964('0x2d')]=_[_0xc964('0x42')](_0x2b250b[_0xc964('0x2d')]);_0x1c297c['filters']=_[_0xc964('0x30')](_0x1c297c[_0xc964('0x2c')],_0x1c297c[_0xc964('0x2d')]);_0x52c131[_0xc964('0x2f')]=_['intersection'](_0x1c297c[_0xc964('0x2c')],qs[_0xc964('0x31')](_0x2b250b[_0xc964('0x2d')][_0xc964('0x31')]));_0x52c131[_0xc964('0x2f')]=_0x52c131[_0xc964('0x2f')][_0xc964('0x32')]?_0x52c131[_0xc964('0x2f')]:_0x1c297c[_0xc964('0x2c')];_0x52c131['order']=qs[_0xc964('0x36')](_0x2b250b['query'][_0xc964('0x36')]);_0x52c131[_0xc964('0x37')]=qs[_0xc964('0x2e')](_['pick'](_0x2b250b['query'],_0x1c297c[_0xc964('0x2e')]));if(_0x2b250b[_0xc964('0x2d')]['filter']){_0x52c131['where']=_[_0xc964('0x38')](_0x52c131[_0xc964('0x37')],{'$or':_[_0xc964('0x26')](_0x52c131[_0xc964('0x2f')],function(_0xa1b37e){var _0x24209a={};_0x24209a[_0xa1b37e]={'$like':'%'+_0x2b250b['query'][_0xc964('0x3a')]+'%'};return _0x24209a;})});}_0x52c131=_[_0xc964('0x38')]({},_0x52c131,_0x2b250b[_0xc964('0x3b')]);return _0x1b4188[_0xc964('0x6a')](_0x52c131);}})[_0xc964('0x21')](function(_0x499e3a){if(_0x499e3a){_0x2f43d7=_0x499e3a[_0xc964('0x32')];if(!_0x2b250b[_0xc964('0x2d')]['hasOwnProperty'](_0xc964('0x34'))){_0x52c131[_0xc964('0x18')]=qs[_0xc964('0x18')](_0x2b250b[_0xc964('0x2d')][_0xc964('0x18')]);_0x52c131[_0xc964('0x17')]=qs[_0xc964('0x17')](_0x2b250b['query'][_0xc964('0x17')]);}return _0x1b4188[_0xc964('0x6a')](_0x52c131);}})['then'](function(_0x31f95d){if(_0x31f95d){return _0x31f95d?{'count':_0x2f43d7,'rows':_0x31f95d}:null;}})['then'](respondWithResult(_0x146cd3,null))[_0xc964('0x40')](handleError(_0x146cd3,null));};
\ No newline at end of file
index 666dc40..e72faf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x508a=['util','../../config/logger','moment','path','rimraf','../../config/environment','define','lodash'];(function(_0x584da8,_0x4944c4){var _0x4da924=function(_0x348f16){while(--_0x348f16){_0x584da8['push'](_0x584da8['shift']());}};_0x4da924(++_0x4944c4);}(_0x508a,0x1b7));var _0xa508=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x508a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa508('0x0'));var util=require(_0xa508('0x1'));var logger=require(_0xa508('0x2'))('api');var moment=require(_0xa508('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa508('0x4'));var rimraf=require(_0xa508('0x5'));var config=require(_0xa508('0x6'));var attributes=require('./voiceMusicOnHold.attributes');module['exports']=function(_0x147a54,_0x5239cb){return _0x147a54[_0xa508('0x7')]('VoiceMusicOnHold',attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbff4=['define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports'];(function(_0x3dfeb9,_0x1cc6e4){var _0x412314=function(_0x321253){while(--_0x321253){_0x3dfeb9['push'](_0x3dfeb9['shift']());}};_0x412314(++_0x1cc6e4);}(_0xbff4,0x107));var _0x4bff=function(_0x60df74,_0x458e29){_0x60df74=_0x60df74-0x0;var _0x5ee872=_0xbff4[_0x60df74];return _0x5ee872;};'use strict';var _=require(_0x4bff('0x0'));var util=require(_0x4bff('0x1'));var logger=require(_0x4bff('0x2'))(_0x4bff('0x3'));var moment=require(_0x4bff('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4bff('0x5'));var rimraf=require(_0x4bff('0x6'));var config=require(_0x4bff('0x7'));var attributes=require(_0x4bff('0x8'));module[_0x4bff('0x9')]=function(_0x187b7e,_0x58da24){return _0x187b7e[_0x4bff('0xa')](_0x4bff('0xb'),attributes,{'tableName':_0x4bff('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 302ea9a..05f5262 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x87d774,_0x1a110c){var _0x1a8372=function(_0x5641e8){while(--_0x5641e8){_0x87d774['push'](_0x87d774['shift']());}};_0x1a8372(++_0x1a110c);}(_0x34e8,0x12c));var _0x834e=function(_0x412e34,_0x20019b){_0x412e34=_0x412e34-0x0;var _0x15679e=_0x34e8[_0x412e34];return _0x15679e;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});}
\ No newline at end of file
+var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x203404,_0x3ebe9f){var _0x2a8a80=function(_0x49fd87){while(--_0x49fd87){_0x203404['push'](_0x203404['shift']());}};_0x2a8a80(++_0x3ebe9f);}(_0xedd9,0xfc));var _0x9edd=function(_0x20f752,_0x58c468){_0x20f752=_0x20f752-0x0;var _0x2ac17b=_0xedd9[_0x20f752];return _0x2ac17b;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});}
\ No newline at end of file
index 8aab2a4..fc9bed9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5309=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','/:id/users','/:id/teams','getTeams','post','create','addAgents','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x90a39a,_0x32020d){var _0x2b62f7=function(_0x6841cc){while(--_0x6841cc){_0x90a39a['push'](_0x90a39a['shift']());}};_0x2b62f7(++_0x32020d);}(_0x5309,0x1aa));var _0x9530=function(_0x30bd66,_0x36a93d){_0x30bd66=_0x30bd66-0x0;var _0x74c9dd=_0x5309[_0x30bd66];return _0x74c9dd;};'use strict';var multer=require(_0x9530('0x0'));var util=require(_0x9530('0x1'));var path=require(_0x9530('0x2'));var timeout=require(_0x9530('0x3'));var express=require(_0x9530('0x4'));var router=express[_0x9530('0x5')]();var fs_extra=require(_0x9530('0x6'));var auth=require(_0x9530('0x7'));var interaction=require(_0x9530('0x8'));var config=require(_0x9530('0x9'));var controller=require('./voicePrefix.controller');router['get']('/',auth[_0x9530('0xa')](),controller[_0x9530('0xb')]);router[_0x9530('0xc')]('/describe',auth['isAuthenticated'](),controller[_0x9530('0xd')]);router['get'](_0x9530('0xe'),auth[_0x9530('0xa')](),controller[_0x9530('0xf')]);router[_0x9530('0xc')](_0x9530('0x10'),auth[_0x9530('0xa')](),controller['getAgents']);router['get'](_0x9530('0x11'),auth[_0x9530('0xa')](),controller[_0x9530('0x12')]);router[_0x9530('0x13')]('/',auth[_0x9530('0xa')](),controller[_0x9530('0x14')]);router[_0x9530('0x13')](_0x9530('0x10'),auth[_0x9530('0xa')](),controller[_0x9530('0x15')]);router[_0x9530('0x13')]('/:id/teams',auth[_0x9530('0xa')](),controller['addTeams']);router[_0x9530('0x16')](_0x9530('0xe'),auth['isAuthenticated'](),controller[_0x9530('0x17')]);router[_0x9530('0x18')]('/:id',auth[_0x9530('0xa')](),controller[_0x9530('0x19')]);router[_0x9530('0x18')](_0x9530('0x10'),auth[_0x9530('0xa')](),controller['removeAgents']);router['delete'](_0x9530('0x11'),auth[_0x9530('0xa')](),controller['removeTeams']);module[_0x9530('0x1a')]=router;
\ No newline at end of file
+var _0x2029=['addAgents','addTeams','put','update','delete','destroy','removeAgents','removeTeams','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','describe','/:id','/:id/users','getAgents','/:id/teams','getTeams','post','create'];(function(_0x2074b3,_0x54589c){var _0x3529e7=function(_0xfbe935){while(--_0xfbe935){_0x2074b3['push'](_0x2074b3['shift']());}};_0x3529e7(++_0x54589c);}(_0x2029,0x171));var _0x9202=function(_0x32f9ab,_0x1c125f){_0x32f9ab=_0x32f9ab-0x0;var _0x4064bc=_0x2029[_0x32f9ab];return _0x4064bc;};'use strict';var multer=require(_0x9202('0x0'));var util=require(_0x9202('0x1'));var path=require('path');var timeout=require(_0x9202('0x2'));var express=require(_0x9202('0x3'));var router=express[_0x9202('0x4')]();var fs_extra=require(_0x9202('0x5'));var auth=require(_0x9202('0x6'));var interaction=require(_0x9202('0x7'));var config=require(_0x9202('0x8'));var controller=require(_0x9202('0x9'));router[_0x9202('0xa')]('/',auth[_0x9202('0xb')](),controller[_0x9202('0xc')]);router[_0x9202('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x9202('0xd')]);router['get'](_0x9202('0xe'),auth[_0x9202('0xb')](),controller['show']);router[_0x9202('0xa')](_0x9202('0xf'),auth[_0x9202('0xb')](),controller[_0x9202('0x10')]);router[_0x9202('0xa')](_0x9202('0x11'),auth[_0x9202('0xb')](),controller[_0x9202('0x12')]);router[_0x9202('0x13')]('/',auth[_0x9202('0xb')](),controller[_0x9202('0x14')]);router[_0x9202('0x13')](_0x9202('0xf'),auth[_0x9202('0xb')](),controller[_0x9202('0x15')]);router[_0x9202('0x13')](_0x9202('0x11'),auth['isAuthenticated'](),controller[_0x9202('0x16')]);router[_0x9202('0x17')](_0x9202('0xe'),auth[_0x9202('0xb')](),controller[_0x9202('0x18')]);router[_0x9202('0x19')](_0x9202('0xe'),auth[_0x9202('0xb')](),controller[_0x9202('0x1a')]);router[_0x9202('0x19')]('/:id/users',auth[_0x9202('0xb')](),controller[_0x9202('0x1b')]);router[_0x9202('0x19')](_0x9202('0x11'),auth[_0x9202('0xb')](),controller[_0x9202('0x1c')]);module[_0x9202('0x1d')]=router;
\ No newline at end of file
index ec77f66..ed53da4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b46=['STRING','sequelize','exports','name','system-','getDataValue'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x6b46,0xfd));var _0x66b4=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6b46[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x66b4('0x0'));module[_0x66b4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x66b4('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x5ef0f8){return _0x66b4('0x3')+this[_0x66b4('0x4')](_0x66b4('0x2'))+'-';}},'description':{'type':Sequelize[_0x66b4('0x5')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xcc57=['STRING','INTEGER','sequelize','exports','name'];(function(_0x236487,_0x39046f){var _0x1c64cc=function(_0x5e1bfb){while(--_0x5e1bfb){_0x236487['push'](_0x236487['shift']());}};_0x1c64cc(++_0x39046f);}(_0xcc57,0xed));var _0x7cc5=function(_0x53ff15,_0x384aff){_0x53ff15=_0x53ff15-0x0;var _0x10dbe1=_0xcc57[_0x53ff15];return _0x10dbe1;};'use strict';var Sequelize=require(_0x7cc5('0x0'));module[_0x7cc5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7cc5('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x39ea07){return'system-'+this['getDataValue'](_0x7cc5('0x2'))+'-';}},'description':{'type':Sequelize[_0x7cc5('0x3')]},'callerIdAll':{'type':Sequelize[_0x7cc5('0x3')]},'VoiceExtensionId':{'type':Sequelize[_0x7cc5('0x4')]}};
\ No newline at end of file
index c5f3e0c..facd067 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5eb8=['from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','register','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','map','VoicePrefix','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','sort','where','pick','VIRTUAL','filter','count','includeAll','include','findAll','rows','catch','show','params','keys','merge','options','find','describe','transaction','create','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','NoOp','VoicePrefixId','bulkCreate','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','charAt','system-','sequelize','findById','addAgents','omit','ids','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','order','hasOwnProperty','nolimit','getTeams','addTeams','Team','User','online','voicePause','interface','flatMap','Agents','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','removeTeams','field','tq.TeamId'];(function(_0x55a85e,_0xbb94d7){var _0x2c60cc=function(_0x40d914){while(--_0x40d914){_0x55a85e['push'](_0x55a85e['shift']());}};_0x2c60cc(++_0xbb94d7);}(_0x5eb8,0xb0));var _0x85eb=function(_0xab0515,_0x4b8ab2){_0xab0515=_0xab0515-0x0;var _0x443d59=_0x5eb8[_0xab0515];return _0x443d59;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x85eb('0x0'));var jsonpatch=require(_0x85eb('0x1'));var rp=require(_0x85eb('0x2'));var moment=require(_0x85eb('0x3'));var BPromise=require(_0x85eb('0x4'));var Mustache=require(_0x85eb('0x5'));var util=require(_0x85eb('0x6'));var path=require(_0x85eb('0x7'));var sox=require(_0x85eb('0x8'));var csv=require(_0x85eb('0x9'));var ejs=require(_0x85eb('0xa'));var fs=require('fs');var fs_extra=require(_0x85eb('0xb'));var _=require('lodash');var squel=require(_0x85eb('0xc'));var crypto=require(_0x85eb('0xd'));var jsforce=require(_0x85eb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85eb('0x9'));var querystring=require('querystring');var Papa=require(_0x85eb('0xf'));var Redis=require(_0x85eb('0x10'));var authService=require(_0x85eb('0x11'));var qs=require(_0x85eb('0x12'));var as=require(_0x85eb('0x13'));var hardwareService=require(_0x85eb('0x14'));var logger=require(_0x85eb('0x15'))('api');var utils=require(_0x85eb('0x16'));var config=require(_0x85eb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x85eb('0x18'))['db'];config[_0x85eb('0x19')]=_[_0x85eb('0x1a')](config[_0x85eb('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x85eb('0x19')]));require('./voicePrefix.socket')[_0x85eb('0x1b')](socket);function respondWithStatusCode(_0x23a82a,_0x600a7f){_0x600a7f=_0x600a7f||0xcc;return function(_0x1604ba){if(_0x1604ba){return _0x23a82a[_0x85eb('0x1c')](_0x600a7f);}return _0x23a82a['status'](_0x600a7f)[_0x85eb('0x1d')]();};}function respondWithResult(_0x59237b,_0x17140b){_0x17140b=_0x17140b||0xc8;return function(_0x10c2c9){if(_0x10c2c9){return _0x59237b[_0x85eb('0x1e')](_0x17140b)[_0x85eb('0x1f')](_0x10c2c9);}};}function respondWithFilteredResult(_0x5dbeda,_0x5c5cbb){return function(_0x50d2a8){if(_0x50d2a8){var _0xe198ca=typeof _0x5c5cbb[_0x85eb('0x20')]===_0x85eb('0x21')&&typeof _0x5c5cbb[_0x85eb('0x22')]===_0x85eb('0x21');var _0x34f875=_0x50d2a8['count'];var _0x24cf28=_0xe198ca?0x0:_0x5c5cbb[_0x85eb('0x20')];var _0xd9f06d=_0xe198ca?_0x50d2a8['count']:_0x5c5cbb['offset']+_0x5c5cbb['limit'];var _0x55b9e4;if(_0xd9f06d>=_0x34f875){_0xd9f06d=_0x34f875;_0x55b9e4=0xc8;}else{_0x55b9e4=0xce;}_0x5dbeda[_0x85eb('0x1e')](_0x55b9e4);return _0x5dbeda[_0x85eb('0x23')](_0x85eb('0x24'),_0x24cf28+'-'+_0xd9f06d+'/'+_0x34f875)[_0x85eb('0x1f')](_0x50d2a8);}return null;};}function patchUpdates(_0x465c74){return function(_0x3fc6da){try{jsonpatch['apply'](_0x3fc6da,_0x465c74,!![]);}catch(_0x5491d5){return BPromise['reject'](_0x5491d5);}return _0x3fc6da[_0x85eb('0x25')]();};}function saveUpdates(_0x1426c8,_0x3f7a4d){return function(_0x28b87d){if(_0x28b87d){return _0x28b87d[_0x85eb('0x26')](_0x1426c8)[_0x85eb('0x27')](function(_0x5dfc96){return _0x5dfc96;});}return null;};}function removeEntity(_0x39d3fe,_0x3453cd){return function(_0x4709ad){if(_0x4709ad){return _0x4709ad[_0x85eb('0x28')]()[_0x85eb('0x27')](function(){var _0x57a03c=_0x4709ad[_0x85eb('0x29')]({'plain':!![]});var _0x792d3a=_0x85eb('0x2a');return db[_0x85eb('0x2b')][_0x85eb('0x28')]({'where':{'type':_0x792d3a,'resourceId':_0x57a03c['id']}})[_0x85eb('0x27')](function(){return _0x4709ad;});})['then'](function(){_0x39d3fe['status'](0xcc)[_0x85eb('0x1d')]();});}};}function handleEntityNotFound(_0x585f2a,_0xa9b14f){return function(_0x5255eb){if(!_0x5255eb){_0x585f2a[_0x85eb('0x1c')](0x194);}return _0x5255eb;};}function handleError(_0x3570f7,_0x1ba904){_0x1ba904=_0x1ba904||0x1f4;return function(_0x1d9278){logger[_0x85eb('0x2c')](_0x1d9278[_0x85eb('0x2d')]);if(_0x1d9278[_0x85eb('0x2e')]){delete _0x1d9278['name'];}_0x3570f7[_0x85eb('0x1e')](_0x1ba904)[_0x85eb('0x2f')](_0x1d9278);};}exports['index']=function(_0x197898,_0x5af2de){var _0x5439aa={},_0x3c5ecc={},_0x3a533c={'count':0x0,'rows':[]};var _0x3e6f34=_[_0x85eb('0x30')](db[_0x85eb('0x31')][_0x85eb('0x32')],function(_0x39b574){return{'name':_0x39b574[_0x85eb('0x33')],'type':_0x39b574[_0x85eb('0x34')][_0x85eb('0x35')]};});_0x3c5ecc['model']=_[_0x85eb('0x30')](_0x3e6f34,_0x85eb('0x2e'));_0x3c5ecc['query']=_['keys'](_0x197898[_0x85eb('0x36')]);_0x3c5ecc[_0x85eb('0x37')]=_[_0x85eb('0x38')](_0x3c5ecc[_0x85eb('0x39')],_0x3c5ecc[_0x85eb('0x36')]);_0x5439aa[_0x85eb('0x3a')]=_[_0x85eb('0x38')](_0x3c5ecc[_0x85eb('0x39')],qs[_0x85eb('0x3b')](_0x197898[_0x85eb('0x36')][_0x85eb('0x3b')]));_0x5439aa[_0x85eb('0x3a')]=_0x5439aa[_0x85eb('0x3a')][_0x85eb('0x3c')]?_0x5439aa['attributes']:_0x3c5ecc[_0x85eb('0x39')];if(!_0x197898[_0x85eb('0x36')]['hasOwnProperty']('nolimit')){_0x5439aa[_0x85eb('0x22')]=qs[_0x85eb('0x22')](_0x197898['query'][_0x85eb('0x22')]);_0x5439aa['offset']=qs[_0x85eb('0x20')](_0x197898['query'][_0x85eb('0x20')]);}_0x5439aa['order']=qs[_0x85eb('0x3d')](_0x197898['query'][_0x85eb('0x3d')]);_0x5439aa[_0x85eb('0x3e')]=qs['filters'](_[_0x85eb('0x3f')](_0x197898['query'],_0x3c5ecc[_0x85eb('0x37')]),_0x3e6f34);if(_0x197898[_0x85eb('0x36')]['filter']){_0x5439aa[_0x85eb('0x3e')]=_['merge'](_0x5439aa['where'],{'$or':_[_0x85eb('0x30')](_0x3e6f34,function(_0x4edb2d){if(_0x4edb2d[_0x85eb('0x34')]!==_0x85eb('0x40')){var _0x5da012={};_0x5da012[_0x4edb2d['name']]={'$like':'%'+_0x197898[_0x85eb('0x36')][_0x85eb('0x41')]+'%'};return _0x5da012;}})});}_0x5439aa=_['merge']({},_0x5439aa,_0x197898['options']);var _0x2864e2={'where':_0x5439aa[_0x85eb('0x3e')]};return db[_0x85eb('0x31')][_0x85eb('0x42')](_0x2864e2)[_0x85eb('0x27')](function(_0x5b7411){_0x3a533c[_0x85eb('0x42')]=_0x5b7411;if(_0x197898[_0x85eb('0x36')][_0x85eb('0x43')]){_0x5439aa[_0x85eb('0x44')]=[{'all':!![]}];}return db[_0x85eb('0x31')][_0x85eb('0x45')](_0x5439aa);})[_0x85eb('0x27')](function(_0x3e11a8){_0x3a533c[_0x85eb('0x46')]=_0x3e11a8;return _0x3a533c;})['then'](respondWithFilteredResult(_0x5af2de,_0x5439aa))[_0x85eb('0x47')](handleError(_0x5af2de,null));};exports[_0x85eb('0x48')]=function(_0x5d90cc,_0x1b77b3){var _0x201aed={'raw':![],'where':{'id':_0x5d90cc[_0x85eb('0x49')]['id']}},_0x2dae5b={};_0x2dae5b[_0x85eb('0x39')]=_[_0x85eb('0x4a')](db['VoicePrefix'][_0x85eb('0x32')]);_0x2dae5b[_0x85eb('0x36')]=_[_0x85eb('0x4a')](_0x5d90cc[_0x85eb('0x36')]);_0x2dae5b[_0x85eb('0x37')]=_[_0x85eb('0x38')](_0x2dae5b[_0x85eb('0x39')],_0x2dae5b[_0x85eb('0x36')]);_0x201aed['attributes']=_[_0x85eb('0x38')](_0x2dae5b[_0x85eb('0x39')],qs[_0x85eb('0x3b')](_0x5d90cc[_0x85eb('0x36')][_0x85eb('0x3b')]));_0x201aed[_0x85eb('0x3a')]=_0x201aed[_0x85eb('0x3a')][_0x85eb('0x3c')]?_0x201aed[_0x85eb('0x3a')]:_0x2dae5b[_0x85eb('0x39')];if(_0x5d90cc[_0x85eb('0x36')][_0x85eb('0x43')]){_0x201aed['include']=[{'all':!![]}];}_0x201aed=_[_0x85eb('0x4b')]({},_0x201aed,_0x5d90cc[_0x85eb('0x4c')]);return db[_0x85eb('0x31')]['find'](_0x201aed)[_0x85eb('0x27')](handleEntityNotFound(_0x1b77b3,null))[_0x85eb('0x27')](respondWithResult(_0x1b77b3,null))[_0x85eb('0x47')](handleError(_0x1b77b3,null));};exports[_0x85eb('0x28')]=function(_0xd3ff2b,_0x4a7506){return db[_0x85eb('0x31')][_0x85eb('0x4d')]({'where':{'id':_0xd3ff2b[_0x85eb('0x49')]['id']}})['then'](handleEntityNotFound(_0x4a7506,null))[_0x85eb('0x27')](removeEntity(_0x4a7506,null))[_0x85eb('0x47')](handleError(_0x4a7506,null));};exports[_0x85eb('0x4e')]=function(_0x4c06ef,_0x56f510){return db[_0x85eb('0x31')]['describe']()['then'](respondWithResult(_0x56f510,null))[_0x85eb('0x47')](handleError(_0x56f510,null));};exports['create']=function(_0x39316d,_0xfb0ac){var _0x4e3d96;return db['sequelize'][_0x85eb('0x4f')](function(_0x249511){return db[_0x85eb('0x31')][_0x85eb('0x50')](_0x39316d[_0x85eb('0x51')],{'transaction':_0x249511})['then'](function(_0x1bb9f8){_0x4e3d96=_0x1bb9f8[_0x85eb('0x29')]({'plain':!![]});return db[_0x85eb('0x52')][_0x85eb('0x4d')]({'where':{'id':_0x4e3d96[_0x85eb('0x53')]},'raw':!![]})['then'](function(_0x140919){return createVoicePrefixExtensions(_0x4e3d96,_0x140919,_0x249511);});});})['then'](function(){var _0xd2e792=_0x39316d[_0x85eb('0x54')]['get']({'plain':!![]});if(!_0xd2e792)throw new Error(_0x85eb('0x55'));if(_0xd2e792[_0x85eb('0x56')]===_0x85eb('0x54')){var _0x26e04a=_0x4e3d96;return db[_0x85eb('0x57')][_0x85eb('0x4d')]({'where':{'name':'VoicePrefixes','userProfileId':_0xd2e792[_0x85eb('0x58')]},'raw':!![]})['then'](function(_0x311857){if(_0x311857&&_0x311857[_0x85eb('0x59')]===0x0){return db['UserProfileResource'][_0x85eb('0x50')]({'name':_0x26e04a[_0x85eb('0x2e')],'resourceId':_0x26e04a['id'],'type':_0x311857['name'],'sectionId':_0x311857['id']},{})[_0x85eb('0x27')](function(){return _0x4e3d96;});}else{return _0x4e3d96;}})['catch'](function(_0x452e7e){logger[_0x85eb('0x2c')](_0x85eb('0x5a'),_0x452e7e);throw _0x452e7e;});}return _0x4e3d96;})[_0x85eb('0x27')](respondWithResult(_0xfb0ac,null))[_0x85eb('0x47')](handleError(_0xfb0ac,null));};function Extension(_0x15d4a7,_0x5a729e,_0x2227ea,_0x76a9c6){this[_0x85eb('0x5b')]=_0x85eb('0x5c');this[_0x85eb('0x5d')]=_0x15d4a7;this[_0x85eb('0x5e')]=_0x2227ea;this[_0x85eb('0x34')]=_0x85eb('0x5f');this[_0x85eb('0x60')]=_0x85eb('0x61');this[_0x85eb('0x62')]=_0x5a729e;this['appdata']=_0x76a9c6;}function createVoicePrefixExtensions(_0x271842,_0x21b873,_0x46e5d3){return new BPromise(function(_0xdaf2fe,_0x4470b3){var _0x213b64=new Extension(formatPrefixName(_0x271842['prefix']),0x1,_0x85eb('0x63'),'Voice\x20Prefix');_0x213b64[_0x85eb('0x64')]=_0x271842['id'];return db[_0x85eb('0x52')][_0x85eb('0x50')](_0x213b64,{'transaction':_0x46e5d3})[_0x85eb('0x27')](function(_0x8f8a72){var _0x4f09dc=_0x8f8a72[_0x85eb('0x29')]({'plain':!![]});var _0x143d65=_[_0x85eb('0x30')](addVoicePrefixExtensions(_0x271842,_0x21b873),function(_0x2c40f8){_0x2c40f8[_0x85eb('0x53')]=_0x4f09dc['id'];_0x2c40f8[_0x85eb('0x64')]=_0x271842['id'];return _0x2c40f8;});return db[_0x85eb('0x52')][_0x85eb('0x65')](_0x143d65,{'transaction':_0x46e5d3})['then'](function(_0x3b896a){if(!_0x3b896a){return _0x4470b3('Extensions\x20creation\x20failed');}else{return _0xdaf2fe(_0x3b896a);}})[_0x85eb('0x47')](function(_0x3ff0f9){return _0x4470b3(_0x3ff0f9);});});;});};function addVoicePrefixExtensions(_0x2ac293,_0x41960f){var _0x259ee3=[];var _0x547ccb=formatPrefixName(_0x2ac293[_0x85eb('0x66')]);_0x259ee3[_0x85eb('0x67')](new Extension(_0x547ccb,0x2,_0x85eb('0x68'),_0x85eb('0x69')+_0x2ac293[_0x85eb('0x2e')]));if(_0x2ac293[_0x85eb('0x6a')]){_0x259ee3['push'](new Extension(_0x547ccb,0x3,'Set',_0x85eb('0x6b')+_0x2ac293['callerIdAll']));}else{_0x259ee3[_0x85eb('0x67')](new Extension(_0x547ccb,0x3,_0x85eb('0x63'),_0x85eb('0x6c')));}_0x259ee3[_0x85eb('0x67')](new Extension(_0x547ccb,0x4,_0x85eb('0x6d'),_0x41960f[_0x85eb('0x5b')]+','+'${EXTEN:'+(0x8+_0x2ac293[_0x85eb('0x2e')][_0x85eb('0x3c')])+'}'+','+0x1));return _0x259ee3;}function formatPrefixName(_0x3f30e4){var _0x2e65d5='_';for(var _0x52bbdf=0x0;_0x52bbdf<_0x3f30e4[_0x85eb('0x3c')];_0x52bbdf++){if(_0x3f30e4[_0x85eb('0x6e')](_0x52bbdf)=='-'){_0x2e65d5+=_0x3f30e4[_0x85eb('0x6e')](_0x52bbdf);}else{_0x2e65d5+='['+_0x3f30e4[_0x85eb('0x6e')](_0x52bbdf)+']';}}_0x2e65d5+='.';return _0x2e65d5;}exports['update']=function(_0x459317,_0x2e6734,_0x13a040){var _0x5fcd48=_0x459317[_0x85eb('0x51')];_0x5fcd48[_0x85eb('0x66')]=_0x85eb('0x6f')+_0x5fcd48[_0x85eb('0x2e')]+'-';return db[_0x85eb('0x70')][_0x85eb('0x4f')](function(_0x170a60){return db[_0x85eb('0x31')][_0x85eb('0x26')](_0x5fcd48,{'where':{'id':_0x5fcd48['id']},'transaction':_0x170a60})[_0x85eb('0x27')](function(){return db[_0x85eb('0x52')][_0x85eb('0x28')]({'where':{'VoicePrefixId':_0x5fcd48['id']},'transaction':_0x170a60})[_0x85eb('0x27')](function(){return db[_0x85eb('0x52')][_0x85eb('0x4d')]({'where':{'id':_0x5fcd48['VoiceExtensionId']},'raw':!![]})[_0x85eb('0x27')](function(_0x4dd31e){return createVoicePrefixExtensions(_0x5fcd48,_0x4dd31e,_0x170a60);});});});})[_0x85eb('0x27')](function(){return db[_0x85eb('0x31')][_0x85eb('0x71')](_0x5fcd48['id']);})[_0x85eb('0x27')](respondWithResult(_0x2e6734,null))[_0x85eb('0x47')](handleError(_0x2e6734,null));};exports[_0x85eb('0x72')]=function(_0x9f4f,_0x3076df,_0x2ca9f9){return db['VoicePrefix'][_0x85eb('0x4d')]({'where':{'id':_0x9f4f[_0x85eb('0x49')]['id']}})[_0x85eb('0x27')](handleEntityNotFound(_0x3076df,null))[_0x85eb('0x27')](function(_0x440968){if(_0x440968){return _0x440968['addAgents'](_0x9f4f[_0x85eb('0x51')]['ids'],_[_0x85eb('0x73')](_0x9f4f[_0x85eb('0x51')],[_0x85eb('0x74'),'id'])||{})['spread'](function(_0x2daa64){for(var _0x2e358d=0x0;_0x2e358d<_0x9f4f[_0x85eb('0x51')]['ids']['length'];_0x2e358d+=0x1){socket[_0x85eb('0x75')](_0x85eb('0x76'),{'UserId':Number(_0x9f4f[_0x85eb('0x51')][_0x85eb('0x74')][_0x2e358d]),'VoicePrefixId':Number(_0x9f4f['params']['id'])});}return _0x2daa64;});}})[_0x85eb('0x27')](respondWithResult(_0x3076df,null))['catch'](handleError(_0x3076df,null));};exports[_0x85eb('0x77')]=function(_0xed99f7,_0x528d2e,_0x2fad3b){return db[_0x85eb('0x31')][_0x85eb('0x4d')]({'where':{'id':_0xed99f7['params']['id']}})[_0x85eb('0x27')](handleEntityNotFound(_0x528d2e,null))['then'](function(_0x18049b){if(_0x18049b){return _0x18049b[_0x85eb('0x77')](_0xed99f7[_0x85eb('0x36')][_0x85eb('0x74')])[_0x85eb('0x27')](function(){if(_[_0x85eb('0x78')](_0xed99f7[_0x85eb('0x36')][_0x85eb('0x74')])){for(var _0x3a471d=0x0;_0x3a471d<_0xed99f7['query'][_0x85eb('0x74')][_0x85eb('0x3c')];_0x3a471d+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0xed99f7[_0x85eb('0x36')]['ids'][_0x3a471d]),'VoicePrefixId':Number(_0xed99f7[_0x85eb('0x49')]['id'])});}}else{socket['emit'](_0x85eb('0x79'),{'UserId':Number(_0xed99f7['query'][_0x85eb('0x74')]),'VoicePrefixId':Number(_0xed99f7[_0x85eb('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x528d2e,null))[_0x85eb('0x47')](handleError(_0x528d2e,null));};exports[_0x85eb('0x7a')]=function(_0x555236,_0x888c46,_0x3b327d){var _0xf076af={};var _0x16b378={};var _0x5dd40c;var _0x1d82a4;return db['VoicePrefix'][_0x85eb('0x7b')]({'where':{'id':_0x555236[_0x85eb('0x49')]['id']}})[_0x85eb('0x27')](handleEntityNotFound(_0x888c46,null))['then'](function(_0x60e9b9){if(_0x60e9b9){_0x5dd40c=_0x60e9b9;_0x16b378[_0x85eb('0x39')]=_[_0x85eb('0x4a')](db['User'][_0x85eb('0x32')]);_0x16b378['query']=_[_0x85eb('0x4a')](_0x555236[_0x85eb('0x36')]);_0x16b378[_0x85eb('0x37')]=_['intersection'](_0x16b378['model'],_0x16b378['query']);_0xf076af[_0x85eb('0x3a')]=_[_0x85eb('0x38')](_0x16b378[_0x85eb('0x39')],qs['fields'](_0x555236[_0x85eb('0x36')][_0x85eb('0x3b')]));_0xf076af[_0x85eb('0x3a')]=_0xf076af[_0x85eb('0x3a')][_0x85eb('0x3c')]?_0xf076af['attributes']:_0x16b378['model'];_0xf076af[_0x85eb('0x7c')]=qs[_0x85eb('0x3d')](_0x555236['query'][_0x85eb('0x3d')]);_0xf076af[_0x85eb('0x3e')]=qs[_0x85eb('0x37')](_[_0x85eb('0x3f')](_0x555236[_0x85eb('0x36')],_0x16b378[_0x85eb('0x37')]));if(_0x555236[_0x85eb('0x36')][_0x85eb('0x41')]){_0xf076af[_0x85eb('0x3e')]=_[_0x85eb('0x4b')](_0xf076af[_0x85eb('0x3e')],{'$or':_[_0x85eb('0x30')](_0xf076af[_0x85eb('0x3a')],function(_0x171428){var _0x326b12={};_0x326b12[_0x171428]={'$like':'%'+_0x555236['query'][_0x85eb('0x41')]+'%'};return _0x326b12;})});}_0xf076af=_[_0x85eb('0x4b')]({},_0xf076af,_0x555236[_0x85eb('0x4c')]);return _0x5dd40c[_0x85eb('0x7a')](_0xf076af);}})[_0x85eb('0x27')](function(_0x23191c){if(_0x23191c){_0x1d82a4=_0x23191c[_0x85eb('0x3c')];if(!_0x555236[_0x85eb('0x36')][_0x85eb('0x7d')](_0x85eb('0x7e'))){_0xf076af['limit']=qs[_0x85eb('0x22')](_0x555236[_0x85eb('0x36')][_0x85eb('0x22')]);_0xf076af[_0x85eb('0x20')]=qs['offset'](_0x555236[_0x85eb('0x36')][_0x85eb('0x20')]);}return _0x5dd40c[_0x85eb('0x7a')](_0xf076af);}})[_0x85eb('0x27')](function(_0x362ba9){if(_0x362ba9){return _0x362ba9?{'count':_0x1d82a4,'rows':_0x362ba9}:null;}})[_0x85eb('0x27')](respondWithResult(_0x888c46,null))['catch'](handleError(_0x888c46,null));};exports[_0x85eb('0x7f')]=function(_0x36dbb1,_0x12c3be,_0x59fc6a){var _0x15802f={};var _0x278558={};var _0x2d0bfb;var _0x3b3b07;return db[_0x85eb('0x31')][_0x85eb('0x7b')]({'where':{'id':_0x36dbb1[_0x85eb('0x49')]['id']}})[_0x85eb('0x27')](handleEntityNotFound(_0x12c3be,null))['then'](function(_0x44af01){if(_0x44af01){_0x2d0bfb=_0x44af01;_0x278558[_0x85eb('0x39')]=_['keys'](db['Team'][_0x85eb('0x32')]);_0x278558['query']=_[_0x85eb('0x4a')](_0x36dbb1[_0x85eb('0x36')]);_0x278558[_0x85eb('0x37')]=_[_0x85eb('0x38')](_0x278558['model'],_0x278558['query']);_0x15802f[_0x85eb('0x3a')]=_['intersection'](_0x278558[_0x85eb('0x39')],qs[_0x85eb('0x3b')](_0x36dbb1[_0x85eb('0x36')][_0x85eb('0x3b')]));_0x15802f['attributes']=_0x15802f['attributes'][_0x85eb('0x3c')]?_0x15802f[_0x85eb('0x3a')]:_0x278558[_0x85eb('0x39')];_0x15802f['order']=qs['sort'](_0x36dbb1[_0x85eb('0x36')][_0x85eb('0x3d')]);_0x15802f[_0x85eb('0x3e')]=qs[_0x85eb('0x37')](_[_0x85eb('0x3f')](_0x36dbb1[_0x85eb('0x36')],_0x278558[_0x85eb('0x37')]));if(_0x36dbb1[_0x85eb('0x36')][_0x85eb('0x41')]){_0x15802f[_0x85eb('0x3e')]=_[_0x85eb('0x4b')](_0x15802f['where'],{'$or':_[_0x85eb('0x30')](_0x15802f[_0x85eb('0x3a')],function(_0x483f5f){var _0x1fe3b6={};_0x1fe3b6[_0x483f5f]={'$like':'%'+_0x36dbb1[_0x85eb('0x36')][_0x85eb('0x41')]+'%'};return _0x1fe3b6;})});}_0x15802f=_[_0x85eb('0x4b')]({},_0x15802f,_0x36dbb1[_0x85eb('0x4c')]);return _0x2d0bfb[_0x85eb('0x7f')](_0x15802f);}})['then'](function(_0x4ba2d3){if(_0x4ba2d3){_0x3b3b07=_0x4ba2d3[_0x85eb('0x3c')];if(!_0x36dbb1['query'][_0x85eb('0x7d')]('nolimit')){_0x15802f[_0x85eb('0x22')]=qs[_0x85eb('0x22')](_0x36dbb1['query']['limit']);_0x15802f[_0x85eb('0x20')]=qs[_0x85eb('0x20')](_0x36dbb1['query'][_0x85eb('0x20')]);}return _0x2d0bfb[_0x85eb('0x7f')](_0x15802f);}})[_0x85eb('0x27')](function(_0x48ed21){if(_0x48ed21){return _0x48ed21?{'count':_0x3b3b07,'rows':_0x48ed21}:null;}})['then'](respondWithResult(_0x12c3be,null))[_0x85eb('0x47')](handleError(_0x12c3be,null));};exports[_0x85eb('0x80')]=function(_0x189733,_0x422d33,_0x1d695c){var _0x4c865d=_0x189733[_0x85eb('0x51')][_0x85eb('0x74')];var _0x3b84b7;return db[_0x85eb('0x81')]['findAll']({'where':{'id':_0x4c865d},'attributes':['id'],'include':[{'model':db[_0x85eb('0x82')],'as':'Agents','attributes':['id',_0x85eb('0x2e'),_0x85eb('0x83'),_0x85eb('0x84'),_0x85eb('0x85')],'raw':!![]}]})[_0x85eb('0x27')](function(_0x52e2b9){if(_0x52e2b9){_0x3b84b7=_0x52e2b9;var _0x34c380=_[_0x85eb('0x86')](_0x52e2b9,function(_0x3bf9b4){var _0x4d3be5=_0x3bf9b4[_0x85eb('0x29')]({'plain':!![]});return _0x4d3be5[_0x85eb('0x87')];});return db[_0x85eb('0x31')][_0x85eb('0x4d')]({'where':{'id':_0x189733[_0x85eb('0x49')]['id']}})[_0x85eb('0x27')](function(_0x209800){return db[_0x85eb('0x70')][_0x85eb('0x4f')](function(_0x344711){return _0x209800[_0x85eb('0x80')](_0x4c865d,{'transaction':_0x344711})[_0x85eb('0x27')](function(){return BPromise[_0x85eb('0x88')](_0x3b84b7,function(_0xfe9f80){return db[_0x85eb('0x89')][_0x85eb('0x8a')]({'TeamId':_0xfe9f80['id'],'VoicePrefixId':_0x189733['params']['id']},{'transaction':_0x344711});});})[_0x85eb('0x27')](function(){return BPromise[_0x85eb('0x88')](_0x34c380,function(_0x1c13a9){return db[_0x85eb('0x8b')][_0x85eb('0x8c')]({'where':{'UserId':_0x1c13a9['id'],'VoicePrefixId':_0x189733[_0x85eb('0x49')]['id']},'transaction':_0x344711});});})[_0x85eb('0x27')](function(){_0x34c380['forEach'](function(_0x419f52){socket[_0x85eb('0x75')]('userVoicePrefix:save',{'UserId':_0x419f52['id'],'VoicePrefixId':_0x209800['id']});});});});});}})[_0x85eb('0x27')](respondWithStatusCode(_0x422d33,null))['catch'](handleError(_0x422d33,null));};exports[_0x85eb('0x8d')]=function(_0x29a5bd,_0x933d13,_0x41dcd3){return db[_0x85eb('0x81')][_0x85eb('0x45')]({'where':{'id':_0x29a5bd[_0x85eb('0x36')][_0x85eb('0x74')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x85eb('0x27')](handleEntityNotFound(_0x933d13,null))[_0x85eb('0x27')](function(_0x29df56){var _0x1b9d2f=_['map'](_0x29df56,'id');var _0x44de5f=[];var _0x2e2af5=[];var _0x3d2e7d=squel['select']();_0x3d2e7d[_0x85eb('0x8e')](_0x85eb('0x8f'))[_0x85eb('0x90')]('team_has_voice_prefixes','tq')[_0x85eb('0x91')](_0x85eb('0x92'),'ut',_0x85eb('0x93'))['where'](_0x85eb('0x94'),_0x29a5bd[_0x85eb('0x49')]['id']);for(var _0x404fef=0x0;_0x404fef<_0x29df56[_0x85eb('0x3c')];_0x404fef+=0x1){let _0x537ce5=_0x29df56[_0x404fef];for(var _0x1a2426=0x0;_0x1a2426<_0x537ce5[_0x85eb('0x87')][_0x85eb('0x3c')];_0x1a2426+=0x1){let _0x142a76=_0x537ce5['Agents'][_0x1a2426];var _0x3b4c70=_0x3d2e7d[_0x85eb('0x95')]();_0x3b4c70[_0x85eb('0x3e')](_0x85eb('0x96'),_0x142a76['id']);_0x2e2af5[_0x85eb('0x67')](db[_0x85eb('0x70')]['query'](_0x3b4c70['toString'](),{'type':db[_0x85eb('0x70')][_0x85eb('0x97')][_0x85eb('0x98')]})[_0x85eb('0x27')](function(_0x34e916){if(_0x34e916[_0x85eb('0x3c')]===0x1){return _0x142a76['id'];}else{var _0x37973e=_['every'](_[_0x85eb('0x30')](_0x34e916,_0x85eb('0x99')),function(_0x5af162){return _[_0x85eb('0x9a')](_0x1b9d2f,_0x5af162);});if(_0x37973e){return _0x142a76['id'];}}}));}}return BPromise[_0x85eb('0x9b')](_0x2e2af5)[_0x85eb('0x27')](function(_0x24726f){_0x44de5f=_(_0x44de5f)[_0x85eb('0x9c')](_0x24726f)[_0x85eb('0x9d')]()[_0x85eb('0x9e')]();return db[_0x85eb('0x31')][_0x85eb('0x4d')]({'where':{'id':_0x29a5bd['params']['id']}})['then'](function(_0x5ac026){return db[_0x85eb('0x70')][_0x85eb('0x4f')](function(_0x27fd58){return _0x5ac026[_0x85eb('0x8d')](_0x29a5bd[_0x85eb('0x36')][_0x85eb('0x74')],{'transaction':_0x27fd58})[_0x85eb('0x27')](function(){if(!_[_0x85eb('0x9f')](_0x44de5f)){return _0x5ac026[_0x85eb('0x77')](_0x44de5f,{'transaction':_0x27fd58});}})[_0x85eb('0x27')](function(){_0x44de5f['forEach'](function(_0xc37e2){socket[_0x85eb('0x75')](_0x85eb('0x79'),{'UserId':_0xc37e2,'VoicePrefixId':_0x5ac026['id']});});});});});});})[_0x85eb('0x27')](respondWithStatusCode(_0x933d13,null))[_0x85eb('0x47')](handleError(_0x933d13,null));};
\ No newline at end of file
+var _0x2272=['Voice\x20Prefix\x20Extension','priority','NoOp','VoicePrefixId','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','goto','context','${EXTEN:','charAt','update','system-','findById','addAgents','ids','spread','emit','removeAgents','userVoicePrefix:remove','getAgents','User','order','pick','getTeams','findOne','addTeams','Team','Agents','online','voicePause','interface','flatMap','each','upsert','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','select','field','tq.TeamId','from','team_has_voice_prefixes','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','toString','SELECT','every','TeamId','includes','all','union','removeTeams','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./voicePrefix.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','stack','name','send','map','VoicePrefix','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoicePrefixes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','app','system','description'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x2272,0xd8));var _0x2227=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2272[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x2227('0x0'));var rimraf=require(_0x2227('0x1'));var zipdir=require(_0x2227('0x2'));var jsonpatch=require(_0x2227('0x3'));var rp=require(_0x2227('0x4'));var moment=require('moment');var BPromise=require(_0x2227('0x5'));var Mustache=require(_0x2227('0x6'));var util=require(_0x2227('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x2227('0x8'));var ejs=require(_0x2227('0x9'));var fs=require('fs');var fs_extra=require(_0x2227('0xa'));var _=require(_0x2227('0xb'));var squel=require(_0x2227('0xc'));var crypto=require(_0x2227('0xd'));var jsforce=require(_0x2227('0xe'));var deskjs=require(_0x2227('0xf'));var toCsv=require(_0x2227('0x8'));var querystring=require(_0x2227('0x10'));var Papa=require('papaparse');var Redis=require(_0x2227('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2227('0x12'));var as=require(_0x2227('0x13'));var hardwareService=require(_0x2227('0x14'));var logger=require(_0x2227('0x15'))(_0x2227('0x16'));var utils=require('../../config/utils');var config=require(_0x2227('0x17'));var licenseUtil=require(_0x2227('0x18'));var db=require(_0x2227('0x19'))['db'];config[_0x2227('0x1a')]=_[_0x2227('0x1b')](config[_0x2227('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2227('0x1c'))['register'](socket);function respondWithStatusCode(_0x42f60b,_0xb631b0){_0xb631b0=_0xb631b0||0xcc;return function(_0x510b09){if(_0x510b09){return _0x42f60b[_0x2227('0x1d')](_0xb631b0);}return _0x42f60b[_0x2227('0x1e')](_0xb631b0)[_0x2227('0x1f')]();};}function respondWithResult(_0x43e174,_0x42a93c){_0x42a93c=_0x42a93c||0xc8;return function(_0x1e78a8){if(_0x1e78a8){return _0x43e174['status'](_0x42a93c)[_0x2227('0x20')](_0x1e78a8);}};}function respondWithFilteredResult(_0x1cf016,_0x162723){return function(_0x531f75){if(_0x531f75){var _0x11bf80=typeof _0x162723[_0x2227('0x21')]===_0x2227('0x22')&&typeof _0x162723[_0x2227('0x23')]===_0x2227('0x22');var _0x28e642=_0x531f75[_0x2227('0x24')];var _0x4e0bba=_0x11bf80?0x0:_0x162723[_0x2227('0x21')];var _0x59f988=_0x11bf80?_0x531f75[_0x2227('0x24')]:_0x162723[_0x2227('0x21')]+_0x162723[_0x2227('0x23')];var _0x1f28ef;if(_0x59f988>=_0x28e642){_0x59f988=_0x28e642;_0x1f28ef=0xc8;}else{_0x1f28ef=0xce;}_0x1cf016[_0x2227('0x1e')](_0x1f28ef);return _0x1cf016[_0x2227('0x25')](_0x2227('0x26'),_0x4e0bba+'-'+_0x59f988+'/'+_0x28e642)[_0x2227('0x20')](_0x531f75);}return null;};}function patchUpdates(_0x3299fd){return function(_0x34c090){try{jsonpatch[_0x2227('0x27')](_0x34c090,_0x3299fd,!![]);}catch(_0x5a454f){return BPromise[_0x2227('0x28')](_0x5a454f);}return _0x34c090[_0x2227('0x29')]();};}function saveUpdates(_0x5b3a09,_0x2cef4b){return function(_0xbfdce1){if(_0xbfdce1){return _0xbfdce1['update'](_0x5b3a09)['then'](function(_0x17c7a4){return _0x17c7a4;});}return null;};}function removeEntity(_0xa4d18b,_0x35333f){return function(_0x1f30c3){if(_0x1f30c3){return _0x1f30c3['destroy']()[_0x2227('0x2a')](function(){var _0x301304=_0x1f30c3[_0x2227('0x2b')]({'plain':!![]});var _0x1957ee='VoicePrefixes';return db[_0x2227('0x2c')][_0x2227('0x2d')]({'where':{'type':_0x1957ee,'resourceId':_0x301304['id']}})[_0x2227('0x2a')](function(){return _0x1f30c3;});})[_0x2227('0x2a')](function(){_0xa4d18b[_0x2227('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55015e,_0x5d1d56){return function(_0x2dc38d){if(!_0x2dc38d){_0x55015e['sendStatus'](0x194);}return _0x2dc38d;};}function handleError(_0x2ba581,_0x1979d8){_0x1979d8=_0x1979d8||0x1f4;return function(_0x58609e){logger['error'](_0x58609e[_0x2227('0x2e')]);if(_0x58609e[_0x2227('0x2f')]){delete _0x58609e[_0x2227('0x2f')];}_0x2ba581['status'](_0x1979d8)[_0x2227('0x30')](_0x58609e);};}exports['index']=function(_0xaa2bbb,_0x3f108b){var _0x28ad1c={},_0xfa2140={},_0x155095={'count':0x0,'rows':[]};var _0x256b7b=_[_0x2227('0x31')](db[_0x2227('0x32')][_0x2227('0x33')],function(_0x781f79){return{'name':_0x781f79[_0x2227('0x34')],'type':_0x781f79['type'][_0x2227('0x35')]};});_0xfa2140[_0x2227('0x36')]=_[_0x2227('0x31')](_0x256b7b,_0x2227('0x2f'));_0xfa2140['query']=_[_0x2227('0x37')](_0xaa2bbb[_0x2227('0x38')]);_0xfa2140[_0x2227('0x39')]=_[_0x2227('0x3a')](_0xfa2140['model'],_0xfa2140[_0x2227('0x38')]);_0x28ad1c[_0x2227('0x3b')]=_[_0x2227('0x3a')](_0xfa2140['model'],qs['fields'](_0xaa2bbb[_0x2227('0x38')][_0x2227('0x3c')]));_0x28ad1c['attributes']=_0x28ad1c[_0x2227('0x3b')][_0x2227('0x3d')]?_0x28ad1c['attributes']:_0xfa2140[_0x2227('0x36')];if(!_0xaa2bbb['query'][_0x2227('0x3e')](_0x2227('0x3f'))){_0x28ad1c[_0x2227('0x23')]=qs[_0x2227('0x23')](_0xaa2bbb['query'][_0x2227('0x23')]);_0x28ad1c['offset']=qs[_0x2227('0x21')](_0xaa2bbb[_0x2227('0x38')][_0x2227('0x21')]);}_0x28ad1c['order']=qs[_0x2227('0x40')](_0xaa2bbb[_0x2227('0x38')][_0x2227('0x40')]);_0x28ad1c[_0x2227('0x41')]=qs[_0x2227('0x39')](_['pick'](_0xaa2bbb['query'],_0xfa2140[_0x2227('0x39')]),_0x256b7b);if(_0xaa2bbb['query'][_0x2227('0x42')]){_0x28ad1c[_0x2227('0x41')]=_[_0x2227('0x43')](_0x28ad1c[_0x2227('0x41')],{'$or':_[_0x2227('0x31')](_0x256b7b,function(_0xd08cd8){if(_0xd08cd8[_0x2227('0x44')]!==_0x2227('0x45')){var _0x5688b5={};_0x5688b5[_0xd08cd8[_0x2227('0x2f')]]={'$like':'%'+_0xaa2bbb['query'][_0x2227('0x42')]+'%'};return _0x5688b5;}})});}_0x28ad1c=_['merge']({},_0x28ad1c,_0xaa2bbb[_0x2227('0x46')]);var _0x59afc0={'where':_0x28ad1c[_0x2227('0x41')]};return db['VoicePrefix'][_0x2227('0x24')](_0x59afc0)[_0x2227('0x2a')](function(_0x46eb0f){_0x155095[_0x2227('0x24')]=_0x46eb0f;if(_0xaa2bbb[_0x2227('0x38')][_0x2227('0x47')]){_0x28ad1c['include']=[{'all':!![]}];}return db['VoicePrefix'][_0x2227('0x48')](_0x28ad1c);})['then'](function(_0x3552db){_0x155095['rows']=_0x3552db;return _0x155095;})[_0x2227('0x2a')](respondWithFilteredResult(_0x3f108b,_0x28ad1c))[_0x2227('0x49')](handleError(_0x3f108b,null));};exports[_0x2227('0x4a')]=function(_0xa3ae06,_0x3f9787){var _0x2871a6={'raw':![],'where':{'id':_0xa3ae06[_0x2227('0x4b')]['id']}},_0x5f5880={};_0x5f5880[_0x2227('0x36')]=_[_0x2227('0x37')](db[_0x2227('0x32')][_0x2227('0x33')]);_0x5f5880[_0x2227('0x38')]=_[_0x2227('0x37')](_0xa3ae06[_0x2227('0x38')]);_0x5f5880['filters']=_[_0x2227('0x3a')](_0x5f5880[_0x2227('0x36')],_0x5f5880[_0x2227('0x38')]);_0x2871a6[_0x2227('0x3b')]=_['intersection'](_0x5f5880[_0x2227('0x36')],qs[_0x2227('0x3c')](_0xa3ae06['query'][_0x2227('0x3c')]));_0x2871a6[_0x2227('0x3b')]=_0x2871a6[_0x2227('0x3b')][_0x2227('0x3d')]?_0x2871a6[_0x2227('0x3b')]:_0x5f5880[_0x2227('0x36')];if(_0xa3ae06[_0x2227('0x38')]['includeAll']){_0x2871a6[_0x2227('0x4c')]=[{'all':!![]}];}_0x2871a6=_[_0x2227('0x43')]({},_0x2871a6,_0xa3ae06['options']);return db[_0x2227('0x32')]['find'](_0x2871a6)[_0x2227('0x2a')](handleEntityNotFound(_0x3f9787,null))[_0x2227('0x2a')](respondWithResult(_0x3f9787,null))[_0x2227('0x49')](handleError(_0x3f9787,null));};exports[_0x2227('0x2d')]=function(_0x5387fc,_0x4e12c7){return db['VoicePrefix'][_0x2227('0x4d')]({'where':{'id':_0x5387fc[_0x2227('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4e12c7,null))[_0x2227('0x2a')](removeEntity(_0x4e12c7,null))[_0x2227('0x49')](handleError(_0x4e12c7,null));};exports[_0x2227('0x4e')]=function(_0x39166b,_0x4ee23c){return db['VoicePrefix'][_0x2227('0x4e')]()[_0x2227('0x2a')](respondWithResult(_0x4ee23c,null))[_0x2227('0x49')](handleError(_0x4ee23c,null));};exports[_0x2227('0x4f')]=function(_0x597f00,_0x26581d){var _0x443933;return db[_0x2227('0x50')][_0x2227('0x51')](function(_0x125fa8){return db[_0x2227('0x32')][_0x2227('0x4f')](_0x597f00[_0x2227('0x52')],{'transaction':_0x125fa8})[_0x2227('0x2a')](function(_0x418ec4){_0x443933=_0x418ec4[_0x2227('0x2b')]({'plain':!![]});return db[_0x2227('0x53')][_0x2227('0x4d')]({'where':{'id':_0x443933[_0x2227('0x54')]},'raw':!![]})[_0x2227('0x2a')](function(_0x10c21a){return createVoicePrefixExtensions(_0x443933,_0x10c21a,_0x125fa8);});});})['then'](function(){var _0xc176c9=_0x597f00[_0x2227('0x55')]['get']({'plain':!![]});if(!_0xc176c9)throw new Error(_0x2227('0x56'));if(_0xc176c9[_0x2227('0x57')]===_0x2227('0x55')){var _0x4e8622=_0x443933;return db['UserProfileSection']['find']({'where':{'name':_0x2227('0x58'),'userProfileId':_0xc176c9[_0x2227('0x59')]},'raw':!![]})['then'](function(_0x2171b1){if(_0x2171b1&&_0x2171b1[_0x2227('0x5a')]===0x0){return db[_0x2227('0x2c')]['create']({'name':_0x4e8622[_0x2227('0x2f')],'resourceId':_0x4e8622['id'],'type':_0x2171b1[_0x2227('0x2f')],'sectionId':_0x2171b1['id']},{})['then'](function(){return _0x443933;});}else{return _0x443933;}})[_0x2227('0x49')](function(_0x1f02be){logger['error'](_0x2227('0x5b'),_0x1f02be);throw _0x1f02be;});}return _0x443933;})[_0x2227('0x2a')](respondWithResult(_0x26581d,null))[_0x2227('0x49')](handleError(_0x26581d,null));};function Extension(_0x1ab7e0,_0x300741,_0x118225,_0x52861f){this['context']=_0x2227('0x5c');this['exten']=_0x1ab7e0;this[_0x2227('0x5d')]=_0x118225;this['type']=_0x2227('0x5e');this[_0x2227('0x5f')]=_0x2227('0x60');this[_0x2227('0x61')]=_0x300741;this['appdata']=_0x52861f;}function createVoicePrefixExtensions(_0x44a025,_0x41359a,_0x10df84){return new BPromise(function(_0x1ec0db,_0x30fbd8){var _0x4fdb8d=new Extension(formatPrefixName(_0x44a025['prefix']),0x1,_0x2227('0x62'),'Voice\x20Prefix');_0x4fdb8d[_0x2227('0x63')]=_0x44a025['id'];return db[_0x2227('0x53')]['create'](_0x4fdb8d,{'transaction':_0x10df84})['then'](function(_0x1aa091){var _0x335798=_0x1aa091[_0x2227('0x2b')]({'plain':!![]});var _0x2f6d49=_[_0x2227('0x31')](addVoicePrefixExtensions(_0x44a025,_0x41359a),function(_0x119d39){_0x119d39[_0x2227('0x54')]=_0x335798['id'];_0x119d39[_0x2227('0x63')]=_0x44a025['id'];return _0x119d39;});return db[_0x2227('0x53')]['bulkCreate'](_0x2f6d49,{'transaction':_0x10df84})[_0x2227('0x2a')](function(_0x1d0e87){if(!_0x1d0e87){return _0x30fbd8('Extensions\x20creation\x20failed');}else{return _0x1ec0db(_0x1d0e87);}})[_0x2227('0x49')](function(_0x108605){return _0x30fbd8(_0x108605);});});;});};function addVoicePrefixExtensions(_0x1b2634,_0x5a41d9){var _0x215fb2=[];var _0xfa23f1=formatPrefixName(_0x1b2634[_0x2227('0x64')]);_0x215fb2[_0x2227('0x65')](new Extension(_0xfa23f1,0x2,_0x2227('0x66'),_0x2227('0x67')+_0x1b2634[_0x2227('0x2f')]));if(_0x1b2634[_0x2227('0x68')]){_0x215fb2[_0x2227('0x65')](new Extension(_0xfa23f1,0x3,_0x2227('0x66'),_0x2227('0x69')+_0x1b2634[_0x2227('0x68')]));}else{_0x215fb2[_0x2227('0x65')](new Extension(_0xfa23f1,0x3,_0x2227('0x62'),'No\x20callerid\x20available'));}_0x215fb2[_0x2227('0x65')](new Extension(_0xfa23f1,0x4,_0x2227('0x6a'),_0x5a41d9[_0x2227('0x6b')]+','+_0x2227('0x6c')+(0x8+_0x1b2634[_0x2227('0x2f')][_0x2227('0x3d')])+'}'+','+0x1));return _0x215fb2;}function formatPrefixName(_0x1e7779){var _0x4633d8='_';for(var _0x4e0ca2=0x0;_0x4e0ca2<_0x1e7779[_0x2227('0x3d')];_0x4e0ca2++){if(_0x1e7779[_0x2227('0x6d')](_0x4e0ca2)=='-'){_0x4633d8+=_0x1e7779[_0x2227('0x6d')](_0x4e0ca2);}else{_0x4633d8+='['+_0x1e7779['charAt'](_0x4e0ca2)+']';}}_0x4633d8+='.';return _0x4633d8;}exports[_0x2227('0x6e')]=function(_0x4258a3,_0x24b5b0,_0x5bd233){var _0x398d76=_0x4258a3['body'];_0x398d76[_0x2227('0x64')]=_0x2227('0x6f')+_0x398d76[_0x2227('0x2f')]+'-';return db[_0x2227('0x50')]['transaction'](function(_0x3a34d8){return db[_0x2227('0x32')]['update'](_0x398d76,{'where':{'id':_0x398d76['id']},'transaction':_0x3a34d8})['then'](function(){return db[_0x2227('0x53')][_0x2227('0x2d')]({'where':{'VoicePrefixId':_0x398d76['id']},'transaction':_0x3a34d8})[_0x2227('0x2a')](function(){return db[_0x2227('0x53')][_0x2227('0x4d')]({'where':{'id':_0x398d76[_0x2227('0x54')]},'raw':!![]})[_0x2227('0x2a')](function(_0x36a85a){return createVoicePrefixExtensions(_0x398d76,_0x36a85a,_0x3a34d8);});});});})['then'](function(){return db[_0x2227('0x32')][_0x2227('0x70')](_0x398d76['id']);})[_0x2227('0x2a')](respondWithResult(_0x24b5b0,null))['catch'](handleError(_0x24b5b0,null));};exports['addAgents']=function(_0x5147fe,_0xf3038b,_0x57b27a){return db[_0x2227('0x32')][_0x2227('0x4d')]({'where':{'id':_0x5147fe[_0x2227('0x4b')]['id']}})[_0x2227('0x2a')](handleEntityNotFound(_0xf3038b,null))[_0x2227('0x2a')](function(_0x2435d0){if(_0x2435d0){return _0x2435d0[_0x2227('0x71')](_0x5147fe[_0x2227('0x52')][_0x2227('0x72')],_['omit'](_0x5147fe[_0x2227('0x52')],[_0x2227('0x72'),'id'])||{})[_0x2227('0x73')](function(_0x58e3ee){for(var _0x22a30f=0x0;_0x22a30f<_0x5147fe[_0x2227('0x52')]['ids']['length'];_0x22a30f+=0x1){socket[_0x2227('0x74')]('userVoicePrefix:save',{'UserId':Number(_0x5147fe[_0x2227('0x52')][_0x2227('0x72')][_0x22a30f]),'VoicePrefixId':Number(_0x5147fe[_0x2227('0x4b')]['id'])});}return _0x58e3ee;});}})[_0x2227('0x2a')](respondWithResult(_0xf3038b,null))[_0x2227('0x49')](handleError(_0xf3038b,null));};exports['removeAgents']=function(_0x9b431a,_0x128e74,_0x770f98){return db[_0x2227('0x32')]['find']({'where':{'id':_0x9b431a[_0x2227('0x4b')]['id']}})[_0x2227('0x2a')](handleEntityNotFound(_0x128e74,null))['then'](function(_0x5af36d){if(_0x5af36d){return _0x5af36d[_0x2227('0x75')](_0x9b431a[_0x2227('0x38')][_0x2227('0x72')])['then'](function(){if(_['isArray'](_0x9b431a[_0x2227('0x38')][_0x2227('0x72')])){for(var _0x13cd17=0x0;_0x13cd17<_0x9b431a[_0x2227('0x38')]['ids']['length'];_0x13cd17+=0x1){socket[_0x2227('0x74')]('userVoicePrefix:remove',{'UserId':Number(_0x9b431a[_0x2227('0x38')][_0x2227('0x72')][_0x13cd17]),'VoicePrefixId':Number(_0x9b431a[_0x2227('0x4b')]['id'])});}}else{socket['emit'](_0x2227('0x76'),{'UserId':Number(_0x9b431a['query'][_0x2227('0x72')]),'VoicePrefixId':Number(_0x9b431a[_0x2227('0x4b')]['id'])});}});}})[_0x2227('0x2a')](respondWithStatusCode(_0x128e74,null))[_0x2227('0x49')](handleError(_0x128e74,null));};exports[_0x2227('0x77')]=function(_0x190760,_0x2eea42,_0x9364ec){var _0x50c689={};var _0x266f3b={};var _0x3e2219;var _0x1f0fc8;return db['VoicePrefix']['findOne']({'where':{'id':_0x190760[_0x2227('0x4b')]['id']}})[_0x2227('0x2a')](handleEntityNotFound(_0x2eea42,null))[_0x2227('0x2a')](function(_0x5daa8b){if(_0x5daa8b){_0x3e2219=_0x5daa8b;_0x266f3b[_0x2227('0x36')]=_['keys'](db[_0x2227('0x78')]['rawAttributes']);_0x266f3b[_0x2227('0x38')]=_[_0x2227('0x37')](_0x190760['query']);_0x266f3b[_0x2227('0x39')]=_[_0x2227('0x3a')](_0x266f3b[_0x2227('0x36')],_0x266f3b[_0x2227('0x38')]);_0x50c689[_0x2227('0x3b')]=_[_0x2227('0x3a')](_0x266f3b['model'],qs['fields'](_0x190760[_0x2227('0x38')][_0x2227('0x3c')]));_0x50c689[_0x2227('0x3b')]=_0x50c689[_0x2227('0x3b')]['length']?_0x50c689['attributes']:_0x266f3b[_0x2227('0x36')];_0x50c689[_0x2227('0x79')]=qs[_0x2227('0x40')](_0x190760['query']['sort']);_0x50c689[_0x2227('0x41')]=qs[_0x2227('0x39')](_[_0x2227('0x7a')](_0x190760[_0x2227('0x38')],_0x266f3b[_0x2227('0x39')]));if(_0x190760[_0x2227('0x38')][_0x2227('0x42')]){_0x50c689[_0x2227('0x41')]=_[_0x2227('0x43')](_0x50c689['where'],{'$or':_['map'](_0x50c689[_0x2227('0x3b')],function(_0x5732e5){var _0x5f1ade={};_0x5f1ade[_0x5732e5]={'$like':'%'+_0x190760[_0x2227('0x38')]['filter']+'%'};return _0x5f1ade;})});}_0x50c689=_[_0x2227('0x43')]({},_0x50c689,_0x190760[_0x2227('0x46')]);return _0x3e2219['getAgents'](_0x50c689);}})[_0x2227('0x2a')](function(_0x3174ef){if(_0x3174ef){_0x1f0fc8=_0x3174ef[_0x2227('0x3d')];if(!_0x190760['query'][_0x2227('0x3e')]('nolimit')){_0x50c689['limit']=qs[_0x2227('0x23')](_0x190760['query'][_0x2227('0x23')]);_0x50c689[_0x2227('0x21')]=qs[_0x2227('0x21')](_0x190760['query'][_0x2227('0x21')]);}return _0x3e2219[_0x2227('0x77')](_0x50c689);}})[_0x2227('0x2a')](function(_0x467380){if(_0x467380){return _0x467380?{'count':_0x1f0fc8,'rows':_0x467380}:null;}})['then'](respondWithResult(_0x2eea42,null))['catch'](handleError(_0x2eea42,null));};exports[_0x2227('0x7b')]=function(_0x3b653f,_0x35c9ea,_0x2e4a1b){var _0x4cd27e={};var _0x1a2852={};var _0x4599ab;var _0x3d592a;return db[_0x2227('0x32')][_0x2227('0x7c')]({'where':{'id':_0x3b653f[_0x2227('0x4b')]['id']}})[_0x2227('0x2a')](handleEntityNotFound(_0x35c9ea,null))['then'](function(_0x524e6a){if(_0x524e6a){_0x4599ab=_0x524e6a;_0x1a2852[_0x2227('0x36')]=_[_0x2227('0x37')](db['Team'][_0x2227('0x33')]);_0x1a2852[_0x2227('0x38')]=_[_0x2227('0x37')](_0x3b653f[_0x2227('0x38')]);_0x1a2852['filters']=_[_0x2227('0x3a')](_0x1a2852['model'],_0x1a2852['query']);_0x4cd27e[_0x2227('0x3b')]=_[_0x2227('0x3a')](_0x1a2852[_0x2227('0x36')],qs[_0x2227('0x3c')](_0x3b653f[_0x2227('0x38')][_0x2227('0x3c')]));_0x4cd27e[_0x2227('0x3b')]=_0x4cd27e[_0x2227('0x3b')][_0x2227('0x3d')]?_0x4cd27e['attributes']:_0x1a2852[_0x2227('0x36')];_0x4cd27e[_0x2227('0x79')]=qs[_0x2227('0x40')](_0x3b653f[_0x2227('0x38')][_0x2227('0x40')]);_0x4cd27e['where']=qs[_0x2227('0x39')](_['pick'](_0x3b653f[_0x2227('0x38')],_0x1a2852[_0x2227('0x39')]));if(_0x3b653f[_0x2227('0x38')][_0x2227('0x42')]){_0x4cd27e[_0x2227('0x41')]=_[_0x2227('0x43')](_0x4cd27e[_0x2227('0x41')],{'$or':_[_0x2227('0x31')](_0x4cd27e['attributes'],function(_0x1686d7){var _0x30101f={};_0x30101f[_0x1686d7]={'$like':'%'+_0x3b653f[_0x2227('0x38')]['filter']+'%'};return _0x30101f;})});}_0x4cd27e=_[_0x2227('0x43')]({},_0x4cd27e,_0x3b653f[_0x2227('0x46')]);return _0x4599ab['getTeams'](_0x4cd27e);}})[_0x2227('0x2a')](function(_0x386b5d){if(_0x386b5d){_0x3d592a=_0x386b5d['length'];if(!_0x3b653f[_0x2227('0x38')][_0x2227('0x3e')](_0x2227('0x3f'))){_0x4cd27e[_0x2227('0x23')]=qs[_0x2227('0x23')](_0x3b653f[_0x2227('0x38')][_0x2227('0x23')]);_0x4cd27e[_0x2227('0x21')]=qs['offset'](_0x3b653f[_0x2227('0x38')][_0x2227('0x21')]);}return _0x4599ab[_0x2227('0x7b')](_0x4cd27e);}})[_0x2227('0x2a')](function(_0x172b34){if(_0x172b34){return _0x172b34?{'count':_0x3d592a,'rows':_0x172b34}:null;}})[_0x2227('0x2a')](respondWithResult(_0x35c9ea,null))['catch'](handleError(_0x35c9ea,null));};exports[_0x2227('0x7d')]=function(_0x2ffe4f,_0x28d3ca,_0x20def8){var _0x42787b=_0x2ffe4f[_0x2227('0x52')][_0x2227('0x72')];var _0x2cf763;return db[_0x2227('0x7e')][_0x2227('0x48')]({'where':{'id':_0x42787b},'attributes':['id'],'include':[{'model':db[_0x2227('0x78')],'as':_0x2227('0x7f'),'attributes':['id','name',_0x2227('0x80'),_0x2227('0x81'),_0x2227('0x82')],'raw':!![]}]})[_0x2227('0x2a')](function(_0x43af43){if(_0x43af43){_0x2cf763=_0x43af43;var _0x1766e5=_[_0x2227('0x83')](_0x43af43,function(_0x2fdf17){var _0x38e805=_0x2fdf17[_0x2227('0x2b')]({'plain':!![]});return _0x38e805['Agents'];});return db[_0x2227('0x32')][_0x2227('0x4d')]({'where':{'id':_0x2ffe4f[_0x2227('0x4b')]['id']}})[_0x2227('0x2a')](function(_0x2fdc19){return db[_0x2227('0x50')][_0x2227('0x51')](function(_0x3f7d5d){return _0x2fdc19['addTeams'](_0x42787b,{'transaction':_0x3f7d5d})[_0x2227('0x2a')](function(){return BPromise[_0x2227('0x84')](_0x2cf763,function(_0x36492d){return db['TeamVoicePrefix'][_0x2227('0x85')]({'TeamId':_0x36492d['id'],'VoicePrefixId':_0x2ffe4f[_0x2227('0x4b')]['id']},{'transaction':_0x3f7d5d});});})['then'](function(){return BPromise[_0x2227('0x84')](_0x1766e5,function(_0x2fb89b){return db[_0x2227('0x86')][_0x2227('0x87')]({'where':{'UserId':_0x2fb89b['id'],'VoicePrefixId':_0x2ffe4f[_0x2227('0x4b')]['id']},'transaction':_0x3f7d5d});});})['then'](function(){_0x1766e5[_0x2227('0x88')](function(_0x12fabe){socket[_0x2227('0x74')](_0x2227('0x89'),{'UserId':_0x12fabe['id'],'VoicePrefixId':_0x2fdc19['id']});});});});});}})[_0x2227('0x2a')](respondWithStatusCode(_0x28d3ca,null))['catch'](handleError(_0x28d3ca,null));};exports['removeTeams']=function(_0x2e153f,_0x312033,_0x1c557d){return db['Team']['findAll']({'where':{'id':_0x2e153f['query'][_0x2227('0x72')]},'attributes':['id'],'include':[{'model':db[_0x2227('0x78')],'as':_0x2227('0x7f'),'attributes':['id'],'raw':!![]}]})[_0x2227('0x2a')](handleEntityNotFound(_0x312033,null))[_0x2227('0x2a')](function(_0x3e5597){var _0x3f58d2=_['map'](_0x3e5597,'id');var _0x2930e9=[];var _0x4505ab=[];var _0x2824b1=squel[_0x2227('0x8a')]();_0x2824b1[_0x2227('0x8b')](_0x2227('0x8c'))[_0x2227('0x8d')](_0x2227('0x8e'),'tq')[_0x2227('0x8f')]('user_has_teams','ut',_0x2227('0x90'))[_0x2227('0x41')](_0x2227('0x91'),_0x2e153f[_0x2227('0x4b')]['id']);for(var _0x3b5b07=0x0;_0x3b5b07<_0x3e5597[_0x2227('0x3d')];_0x3b5b07+=0x1){let _0x19608d=_0x3e5597[_0x3b5b07];for(var _0x5008cc=0x0;_0x5008cc<_0x19608d[_0x2227('0x7f')][_0x2227('0x3d')];_0x5008cc+=0x1){let _0x15b3c4=_0x19608d[_0x2227('0x7f')][_0x5008cc];var _0x1a0805=_0x2824b1[_0x2227('0x92')]();_0x1a0805[_0x2227('0x41')]('ut.UserId\x20=\x20?',_0x15b3c4['id']);_0x4505ab[_0x2227('0x65')](db[_0x2227('0x50')][_0x2227('0x38')](_0x1a0805[_0x2227('0x93')](),{'type':db[_0x2227('0x50')]['QueryTypes'][_0x2227('0x94')]})[_0x2227('0x2a')](function(_0x4f822c){if(_0x4f822c['length']===0x1){return _0x15b3c4['id'];}else{var _0x1bab79=_[_0x2227('0x95')](_[_0x2227('0x31')](_0x4f822c,_0x2227('0x96')),function(_0x26c479){return _[_0x2227('0x97')](_0x3f58d2,_0x26c479);});if(_0x1bab79){return _0x15b3c4['id'];}}}));}}return BPromise[_0x2227('0x98')](_0x4505ab)['then'](function(_0x54db70){_0x2930e9=_(_0x2930e9)[_0x2227('0x99')](_0x54db70)['compact']()['value']();return db[_0x2227('0x32')][_0x2227('0x4d')]({'where':{'id':_0x2e153f[_0x2227('0x4b')]['id']}})[_0x2227('0x2a')](function(_0x152b89){return db[_0x2227('0x50')]['transaction'](function(_0x360f72){return _0x152b89[_0x2227('0x9a')](_0x2e153f['query'][_0x2227('0x72')],{'transaction':_0x360f72})[_0x2227('0x2a')](function(){if(!_[_0x2227('0x9b')](_0x2930e9)){return _0x152b89[_0x2227('0x75')](_0x2930e9,{'transaction':_0x360f72});}})[_0x2227('0x2a')](function(){_0x2930e9[_0x2227('0x88')](function(_0x66aa39){socket[_0x2227('0x74')](_0x2227('0x76'),{'UserId':_0x66aa39,'VoicePrefixId':_0x152b89['id']});});});});});});})[_0x2227('0x2a')](respondWithStatusCode(_0x312033,null))['catch'](handleError(_0x312033,null));};
\ No newline at end of file
index ae37840..3069a20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e7b=['hasOwnProperty','hook','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x54f6bb,_0x13464f){var _0x44cec8=function(_0x18e15e){while(--_0x18e15e){_0x54f6bb['push'](_0x54f6bb['shift']());}};_0x44cec8(++_0x13464f);}(_0x5e7b,0x1bb));var _0xb5e7=function(_0x26fc81,_0x57fc19){_0x26fc81=_0x26fc81-0x0;var _0x9feece=_0x5e7b[_0x26fc81];return _0x9feece;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xb5e7('0x0'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xb5e7('0x1')](0x0);var events={'afterCreate':_0xb5e7('0x2'),'afterUpdate':_0xb5e7('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3a2803){return function(_0x3fa6f3,_0x12423c,_0x124ef4){VoicePrefixEvents['emit'](_0x3a2803+':'+_0x3fa6f3['id'],_0x3fa6f3);VoicePrefixEvents[_0xb5e7('0x4')](_0x3a2803,_0x3fa6f3);_0x124ef4(null);};}for(var e in events){if(events[_0xb5e7('0x5')](e)){var event=events[e];VoicePrefix[_0xb5e7('0x6')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;
\ No newline at end of file
+var _0xb901=['save','update','emit','hasOwnProperty','exports','events','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0x5ca7b8,_0x1d8f03){var _0x58e84e=function(_0x2f0ffa){while(--_0x2f0ffa){_0x5ca7b8['push'](_0x5ca7b8['shift']());}};_0x58e84e(++_0x1d8f03);}(_0xb901,0x1d0));var _0x1b90=function(_0x21049b,_0x459222){_0x21049b=_0x21049b-0x0;var _0x58486f=_0xb901[_0x21049b];return _0x58486f;};'use strict';var EventEmitter=require(_0x1b90('0x0'));var VoicePrefix=require(_0x1b90('0x1'))['db'][_0x1b90('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x1b90('0x3')](0x0);var events={'afterCreate':_0x1b90('0x4'),'afterUpdate':_0x1b90('0x5'),'afterDestroy':'remove'};function emitEvent(_0x411fa5){return function(_0x1af0e2,_0x5b7aaf,_0x6bf3a7){VoicePrefixEvents[_0x1b90('0x6')](_0x411fa5+':'+_0x1af0e2['id'],_0x1af0e2);VoicePrefixEvents[_0x1b90('0x6')](_0x411fa5,_0x1af0e2);_0x6bf3a7(null);};}for(var e in events){if(events[_0x1b90('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x1b90('0x8')]=VoicePrefixEvents;
\ No newline at end of file
index 3435552..493a4e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b38=['../../config/environment','./voicePrefix.attributes','exports','define','voice_prefixes','lodash','util','api','bluebird','request-promise','rimraf'];(function(_0x34b821,_0x504e55){var _0x5e00a0=function(_0x242892){while(--_0x242892){_0x34b821['push'](_0x34b821['shift']());}};_0x5e00a0(++_0x504e55);}(_0x1b38,0x9f));var _0x81b3=function(_0x174a4d,_0x203ae3){_0x174a4d=_0x174a4d-0x0;var _0x240fa1=_0x1b38[_0x174a4d];return _0x240fa1;};'use strict';var _=require(_0x81b3('0x0'));var util=require(_0x81b3('0x1'));var logger=require('../../config/logger')(_0x81b3('0x2'));var moment=require('moment');var BPromise=require(_0x81b3('0x3'));var rp=require(_0x81b3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x81b3('0x5'));var config=require(_0x81b3('0x6'));var attributes=require(_0x81b3('0x7'));module[_0x81b3('0x8')]=function(_0x2f5bdb,_0x195d94){return _0x2f5bdb[_0x81b3('0x9')]('VoicePrefix',attributes,{'tableName':_0x81b3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5536=['rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','lodash','util','api','moment','bluebird','request-promise'];(function(_0x4125ae,_0x1477b8){var _0x511077=function(_0x5add24){while(--_0x5add24){_0x4125ae['push'](_0x4125ae['shift']());}};_0x511077(++_0x1477b8);}(_0x5536,0x8a));var _0x6553=function(_0x45fdfa,_0x2b2c9c){_0x45fdfa=_0x45fdfa-0x0;var _0xdd6c18=_0x5536[_0x45fdfa];return _0xdd6c18;};'use strict';var _=require(_0x6553('0x0'));var util=require(_0x6553('0x1'));var logger=require('../../config/logger')(_0x6553('0x2'));var moment=require(_0x6553('0x3'));var BPromise=require(_0x6553('0x4'));var rp=require(_0x6553('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6553('0x6'));var config=require(_0x6553('0x7'));var attributes=require(_0x6553('0x8'));module[_0x6553('0x9')]=function(_0x3b8d49,_0x5a868f){return _0x3b8d49[_0x6553('0xa')](_0x6553('0xb'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index da7b3ba..ab5cded 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53ec=['./voicePrefix.socket','register','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x57f345,_0x316929){var _0x255e43=function(_0x619f61){while(--_0x619f61){_0x57f345['push'](_0x57f345['shift']());}};_0x255e43(++_0x316929);}(_0x53ec,0x192));var _0xc53e=function(_0x542e14,_0x5dfd4b){_0x542e14=_0x542e14-0x0;var _0xe3bbb=_0x53ec[_0x542e14];return _0xe3bbb;};'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});config[_0xc53e('0xa')]=_[_0xc53e('0xb')](config['redis'],{'host':_0xc53e('0xc'),'port':0x18eb});var socket=require(_0xc53e('0xd'))(new Redis(config[_0xc53e('0xa')]));require(_0xc53e('0xe'))[_0xc53e('0xf')](socket);function respondWithRpcPromise(_0x2c88cb,_0xd82002,_0x361e9d){return new BPromise(function(_0xa98198,_0x4b7cfa){return client['request'](_0x2c88cb,_0x361e9d)[_0xc53e('0x10')](function(_0x5a2da7){logger['info'](_0xc53e('0x11'),_0xd82002,_0xc53e('0x12'));logger[_0xc53e('0x13')](_0xc53e('0x14'),_0xd82002,'request\x20sent',JSON['stringify'](_0x5a2da7));if(_0x5a2da7[_0xc53e('0x15')]){if(_0x5a2da7[_0xc53e('0x15')][_0xc53e('0x16')]===0x1f4){logger[_0xc53e('0x15')](_0xc53e('0x11'),_0xd82002,_0x5a2da7[_0xc53e('0x15')][_0xc53e('0x17')]);return _0x4b7cfa(_0x5a2da7[_0xc53e('0x15')][_0xc53e('0x17')]);}logger[_0xc53e('0x15')]('VoicePrefix,\x20%s,\x20%s',_0xd82002,_0x5a2da7[_0xc53e('0x15')][_0xc53e('0x17')]);return _0xa98198(_0x5a2da7[_0xc53e('0x15')][_0xc53e('0x17')]);}else{logger[_0xc53e('0x18')](_0xc53e('0x11'),_0xd82002,_0xc53e('0x12'));_0xa98198(_0x5a2da7[_0xc53e('0x19')][_0xc53e('0x17')]);}})['catch'](function(_0x546fab){logger[_0xc53e('0x15')](_0xc53e('0x11'),_0xd82002,_0x546fab);_0x4b7cfa(_0x546fab);});});}
\ No newline at end of file
+var _0x804d=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','lodash','util'];(function(_0x4caa32,_0x374643){var _0x160a54=function(_0x5851a6){while(--_0x5851a6){_0x4caa32['push'](_0x4caa32['shift']());}};_0x160a54(++_0x374643);}(_0x804d,0x116));var _0xd804=function(_0x46c835,_0x464658){_0x46c835=_0x46c835-0x0;var _0x1c340b=_0x804d[_0x46c835];return _0x1c340b;};'use strict';var _=require(_0xd804('0x0'));var util=require(_0xd804('0x1'));var moment=require(_0xd804('0x2'));var BPromise=require(_0xd804('0x3'));var rs=require(_0xd804('0x4'));var fs=require('fs');var Redis=require(_0xd804('0x5'));var db=require(_0xd804('0x6'))['db'];var utils=require(_0xd804('0x7'));var logger=require('../../config/logger')(_0xd804('0x8'));var config=require(_0xd804('0x9'));var jayson=require(_0xd804('0xa'));var client=jayson[_0xd804('0xb')][_0xd804('0xc')]({'port':0x232a});config[_0xd804('0xd')]=_[_0xd804('0xe')](config[_0xd804('0xd')],{'host':_0xd804('0xf'),'port':0x18eb});var socket=require(_0xd804('0x10'))(new Redis(config[_0xd804('0xd')]));require(_0xd804('0x11'))['register'](socket);function respondWithRpcPromise(_0x321d86,_0x2d2434,_0x46730f){return new BPromise(function(_0xa48fe0,_0x52dbe7){return client['request'](_0x321d86,_0x46730f)[_0xd804('0x12')](function(_0x2ce688){logger['info'](_0xd804('0x13'),_0x2d2434,_0xd804('0x14'));logger['debug'](_0xd804('0x15'),_0x2d2434,_0xd804('0x14'),JSON[_0xd804('0x16')](_0x2ce688));if(_0x2ce688['error']){if(_0x2ce688['error'][_0xd804('0x17')]===0x1f4){logger[_0xd804('0x18')](_0xd804('0x13'),_0x2d2434,_0x2ce688[_0xd804('0x18')][_0xd804('0x19')]);return _0x52dbe7(_0x2ce688['error'][_0xd804('0x19')]);}logger[_0xd804('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x2d2434,_0x2ce688[_0xd804('0x18')][_0xd804('0x19')]);return _0xa48fe0(_0x2ce688[_0xd804('0x18')]['message']);}else{logger[_0xd804('0x1a')]('VoicePrefix,\x20%s,\x20%s',_0x2d2434,_0xd804('0x14'));_0xa48fe0(_0x2ce688[_0xd804('0x1b')][_0xd804('0x19')]);}})['catch'](function(_0x33873f){logger[_0xd804('0x18')](_0xd804('0x13'),_0x2d2434,_0x33873f);_0x52dbe7(_0x33873f);});});}
\ No newline at end of file
index 8710012..625bdbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa249=['length','voicePrefix:','./voicePrefix.events','save','update'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0xa249,0x183));var _0x9a24=function(_0xf88555,_0x272649){_0xf88555=_0xf88555-0x0;var _0x176b63=_0xa249[_0xf88555];return _0x176b63;};'use strict';var VoicePrefixEvents=require(_0x9a24('0x0'));var events=[_0x9a24('0x1'),'remove',_0x9a24('0x2')];function createListener(_0x251d51,_0x575a09){return function(_0x12ef32){_0x575a09['emit'](_0x251d51,_0x12ef32);};}function removeListener(_0x3f83df,_0x48c56d){return function(){VoicePrefixEvents['removeListener'](_0x3f83df,_0x48c56d);};}exports['register']=function(_0x1b0728){for(var _0x167980=0x0,_0x3f59a1=events[_0x9a24('0x3')];_0x167980<_0x3f59a1;_0x167980++){var _0x3f2459=events[_0x167980];var _0x22f220=createListener(_0x9a24('0x4')+_0x3f2459,_0x1b0728);VoicePrefixEvents['on'](_0x3f2459,_0x22f220);}};
\ No newline at end of file
+var _0x1c42=['remove','update','emit','removeListener','register','length','save'];(function(_0x3710a4,_0x411b57){var _0x470675=function(_0x27892d){while(--_0x27892d){_0x3710a4['push'](_0x3710a4['shift']());}};_0x470675(++_0x411b57);}(_0x1c42,0x13a));var _0x21c4=function(_0x45b020,_0x2e495a){_0x45b020=_0x45b020-0x0;var _0x120d74=_0x1c42[_0x45b020];return _0x120d74;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x21c4('0x0'),_0x21c4('0x1'),_0x21c4('0x2')];function createListener(_0x558257,_0x27cb4a){return function(_0x40bc3e){_0x27cb4a[_0x21c4('0x3')](_0x558257,_0x40bc3e);};}function removeListener(_0xd7340,_0x435179){return function(){VoicePrefixEvents[_0x21c4('0x4')](_0xd7340,_0x435179);};}exports[_0x21c4('0x5')]=function(_0x8d4312){for(var _0x4fc4da=0x0,_0x247ec9=events[_0x21c4('0x6')];_0x4fc4da<_0x247ec9;_0x4fc4da++){var _0x54b2ea=events[_0x4fc4da];var _0x184e75=createListener('voicePrefix:'+_0x54b2ea,_0x8d4312);VoicePrefixEvents['on'](_0x54b2ea,_0x184e75);}};
\ No newline at end of file
index e86f3cc..e5f0416 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(_0x4ffaf4,_0x1de0ef){var _0x43a8eb=function(_0x1fc979){while(--_0x1fc979){_0x4ffaf4['push'](_0x4ffaf4['shift']());}};_0x43a8eb(++_0x1de0ef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router;
\ No newline at end of file
+var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x53537e,_0x280c98){var _0x281091=function(_0x2d5e7b){while(--_0x2d5e7b){_0x53537e['push'](_0x53537e['shift']());}};_0x281091(++_0x280c98);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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
index 7c2774f..cf451f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66fb=['split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','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)','#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,*,*,*','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#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\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\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','leastrecent','fewestcalls','rrmemory','linear','wrandom','setDataValue','strategy','getDataValue','type','dialMethod','booked','progressive','predictive','power','INTEGER','yes','all','once','periodic_announce','join'];(function(_0x108b9e,_0x1ec154){var _0x2c4bf6=function(_0x20519c){while(--_0x20519c){_0x108b9e['push'](_0x108b9e['shift']());}};_0x2c4bf6(++_0x1ec154);}(_0x66fb,0x86));var _0xb66f=function(_0x5c538d,_0x28f76f){_0x5c538d=_0x5c538d-0x0;var _0x58bb56=_0x66fb[_0x5c538d];return _0x58bb56;};'use strict';var Sequelize=require(_0xb66f('0x0'));module[_0xb66f('0x1')]={'name':{'type':Sequelize[_0xb66f('0x2')],'allowNull':![],'unique':_0xb66f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xb66f('0x4')](_0xb66f('0x5'),_0xb66f('0x6')),'allowNull':![],'defaultValue':_0xb66f('0x5')},'musiconhold':{'type':Sequelize[_0xb66f('0x2')],'defaultValue':_0xb66f('0x7')},'announce':{'type':Sequelize[_0xb66f('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xb66f('0x4')]('rr','ringall',_0xb66f('0x8'),_0xb66f('0x9'),'random',_0xb66f('0xa'),_0xb66f('0xb'),_0xb66f('0xc'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x140ab6){this[_0xb66f('0xd')](_0xb66f('0xe'),_0x140ab6?_0x140ab6:_0xb66f('0xa'));},'get':function(){var _0x4c993d=this[_0xb66f('0xf')](_0xb66f('0x10'));var _0x26860f=this[_0xb66f('0xf')](_0xb66f('0x11'));var _0x138a07=this[_0xb66f('0xf')](_0xb66f('0xe'));if(_0x4c993d===_0xb66f('0x5')){return _0x138a07;}if(_0x26860f===_0xb66f('0x12')&&_0x138a07===_0xb66f('0xa')||_0x26860f===_0xb66f('0x12')&&_0x138a07==='roundrobin'){return _0x138a07;}if(_0x26860f===_0xb66f('0x13')||_0x26860f===_0xb66f('0x14')||_0x26860f===_0xb66f('0x15')){return _0x138a07;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xb66f('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xb66f('0x16')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xb66f('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0xb66f('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xb66f('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xb66f('0x4')](_0xb66f('0x17'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize['ENUM']('yes','no',_0xb66f('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0xb66f('0x4')](_0xb66f('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xb66f('0x4')](_0xb66f('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xb66f('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xb66f('0x4')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0xb66f('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xb66f('0x4')](_0xb66f('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xb66f('0x4')](_0xb66f('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xb66f('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xb66f('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xb66f('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xb66f('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xb66f('0x4')](_0xb66f('0x17'),'no'),'defaultValue':_0xb66f('0x17')},'announce_holdtime':{'type':Sequelize['ENUM'](_0xb66f('0x17'),'no',_0xb66f('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xb66f('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xb66f('0x4')](_0xb66f('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0xb66f('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xb66f('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xb66f('0x2')]},'queue_youarenext':{'type':Sequelize[_0xb66f('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xb66f('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xb66f('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xb66f('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xb66f('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xb66f('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xb66f('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xb66f('0x2')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0xb66f('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xb66f('0x2')]},'queue_less_than':{'type':Sequelize[_0xb66f('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x26bb50){this[_0xb66f('0xd')](_0xb66f('0x1a'),_0x26bb50?_0x26bb50[_0xb66f('0x1b')](','):[]);},'get':function(){return this[_0xb66f('0xf')](_0xb66f('0x1a'))?this['getDataValue'](_0xb66f('0x1a'))[_0xb66f('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0xb66f('0x2')],'defaultValue':'yes','set':function(_0x241b87){this[_0xb66f('0xd')](_0xb66f('0x1d'),_0x241b87?_0x241b87[_0xb66f('0x1b')](','):undefined);},'get':function(){return this['getDataValue']('joinempty')?this[_0xb66f('0xf')](_0xb66f('0x1d'))[_0xb66f('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x53f727){this['setDataValue'](_0xb66f('0x1e'),_0x53f727?_0x53f727[_0xb66f('0x1b')](','):undefined);},'get':function(){return this[_0xb66f('0xf')](_0xb66f('0x1e'))?this[_0xb66f('0xf')]('leavewhenempty')['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xb66f('0x4')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xb66f('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xb66f('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0xb66f('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xb66f('0x2')]},'description':{'type':Sequelize[_0xb66f('0x2')]},'acw':{'type':Sequelize[_0xb66f('0x1f')],'defaultValue':0x0,'set':function(_0x52f9dc){this[_0xb66f('0xd')](_0xb66f('0x20'),_0x52f9dc);if(_0x52f9dc){if(this[_0xb66f('0xf')](_0xb66f('0x21'))<0x2){this[_0xb66f('0xd')](_0xb66f('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xb66f('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xb66f('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xb66f('0x4')]('preview',_0xb66f('0x13'),_0xb66f('0x15'),'predictive',_0xb66f('0x12')),'defaultValue':_0xb66f('0x13'),'comment':_0xb66f('0x22')},'dialLimitChannel':{'type':Sequelize[_0xb66f('0x16')](0x4)[_0xb66f('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xb66f('0x24')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0xb66f('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xb66f('0x25')},'dialPowerLevel':{'type':Sequelize[_0xb66f('0x26')](0x2)[_0xb66f('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xb66f('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0xb66f('0x4')](_0xb66f('0x28'),_0xb66f('0x29')),'defaultValue':_0xb66f('0x29'),'comment':_0xb66f('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xb66f('0x26')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xb66f('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0xb66f('0x16')](0x3)[_0xb66f('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xb66f('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb66f('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xb66f('0x16')](0x3)[_0xb66f('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb66f('0x2d')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0xb66f('0x2e'),'comment':_0xb66f('0x2f')},'dialQueueTimeout':{'type':Sequelize[_0xb66f('0x16')](0x3)[_0xb66f('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb66f('0x30')},'dialQueueProject':{'type':Sequelize[_0xb66f('0x2')],'comment':_0xb66f('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb66f('0x16')](0x3)[_0xb66f('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb66f('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb66f('0x16')](0x5)[_0xb66f('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xb66f('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb66f('0x33')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb66f('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb66f('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb66f('0x23')],'defaultValue':0x3,'comment':_0xb66f('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb66f('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb66f('0x36')},'dialGlobalMaxRetry':{'type':Sequelize[_0xb66f('0x16')](0x3)[_0xb66f('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb66f('0x37')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb66f('0x2')],'defaultValue':_0xb66f('0x38')},'dialPrefix':{'type':Sequelize[_0xb66f('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xb66f('0x4')]('always',_0xb66f('0x39'),_0xb66f('0x3a')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xb66f('0x1f')],'defaultValue':0x0,'comment':_0xb66f('0x3b')},'dialAMDInitialSilence':{'type':Sequelize[_0xb66f('0x16')](0x9)[_0xb66f('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb66f('0x3c')},'dialAMDGreeting':{'type':Sequelize[_0xb66f('0x16')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb66f('0x16')](0x9)[_0xb66f('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xb66f('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb66f('0x16')](0x9)[_0xb66f('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb66f('0x3e')},'dialAMDMinWordLength':{'type':Sequelize[_0xb66f('0x16')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb66f('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb66f('0x16')](0x9)[_0xb66f('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb66f('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb66f('0x16')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xb66f('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb66f('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xb66f('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0xb66f('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xb66f('0x42')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xb66f('0x43')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xb66f('0x44'),_0xb66f('0x45')),'defaultValue':_0xb66f('0x44')},'dialQueueProject2':{'type':Sequelize[_0xb66f('0x2')],'comment':_0xb66f('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xb66f('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb66f('0x16')](0x3)[_0xb66f('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb66f('0x46')},'dialCutDigit':{'type':Sequelize[_0xb66f('0x16')](0x3)[_0xb66f('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb66f('0x47')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xb66f('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb66f('0x48')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb66f('0x16')](0x5)[_0xb66f('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb66f('0x49')},'dialDropMaxRetry':{'type':Sequelize[_0xb66f('0x16')](0x3)[_0xb66f('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb66f('0x4a')},'dialDropRetryFrequency':{'type':Sequelize[_0xb66f('0x16')](0x5)[_0xb66f('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb66f('0x4b')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb66f('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb66f('0x4c')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb66f('0x16')](0x5)[_0xb66f('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xb66f('0x16')](0x3)[_0xb66f('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb66f('0x4d')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb66f('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb66f('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb66f('0x4e')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb66f('0x16')](0x5)[_0xb66f('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb66f('0x16')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x471ad0){if(!_0x471ad0)this['setDataValue'](_0xb66f('0x4f'),null);this[_0xb66f('0xd')](_0xb66f('0x50'),_0x471ad0);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xb66f('0x16')](0x3)[_0xb66f('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xb66f('0x1f')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xb66f('0x16')](0x3)[_0xb66f('0x23')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xb66f('0x1f')],'defaultValue':![]}};
\ No newline at end of file
+var _0x1823=['outbound','default','ENUM','ringall','leastrecent','fewestcalls','random','dialMethod','getDataValue','strategy','booked','rrmemory','progressive','predictive','INTEGER','yes','all','once','setDataValue','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview','power','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','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)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','inbound'];(function(_0x3fd360,_0x5a48f5){var _0x577763=function(_0x30244e){while(--_0x30244e){_0x3fd360['push'](_0x3fd360['shift']());}};_0x577763(++_0x5a48f5);}(_0x1823,0xde));var _0x3182=function(_0x7adc9f,_0xd98ac9){_0x7adc9f=_0x7adc9f-0x0;var _0x8d4c7a=_0x1823[_0x7adc9f];return _0x8d4c7a;};'use strict';var Sequelize=require(_0x3182('0x0'));module['exports']={'name':{'type':Sequelize[_0x3182('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x3182('0x2'),_0x3182('0x3')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x3182('0x1')],'defaultValue':_0x3182('0x4')},'announce':{'type':Sequelize[_0x3182('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0x3182('0x5')]('rr',_0x3182('0x6'),_0x3182('0x7'),_0x3182('0x8'),_0x3182('0x9'),'rrmemory','linear','wrandom','rrordered'),'allowNull':![],'defaultValue':_0x3182('0x6'),'set':function(_0x16061e){this['setDataValue']('strategy',_0x16061e?_0x16061e:'rrmemory');},'get':function(){var _0x3bc82f=this['getDataValue']('type');var _0x5a82b1=this['getDataValue'](_0x3182('0xa'));var _0x2d26b=this[_0x3182('0xb')](_0x3182('0xc'));if(_0x3bc82f===_0x3182('0x2')){return _0x2d26b;}if(_0x5a82b1===_0x3182('0xd')&&_0x2d26b===_0x3182('0xe')||_0x5a82b1==='booked'&&_0x2d26b==='roundrobin'){return _0x2d26b;}if(_0x5a82b1===_0x3182('0xf')||_0x5a82b1===_0x3182('0x10')||_0x5a82b1==='power'){return _0x2d26b;}return null;}},'servicelevel':{'type':Sequelize[_0x3182('0x11')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x3182('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x3182('0x11')](0xb)},'timeout':{'type':Sequelize[_0x3182('0x11')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x3182('0x11')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x3182('0x11')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x3182('0x5')](_0x3182('0x12'),'no'),'defaultValue':_0x3182('0x12')},'autopause':{'type':Sequelize[_0x3182('0x5')](_0x3182('0x12'),'no',_0x3182('0x13')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x3182('0x11')](0xb)},'autopausebusy':{'type':Sequelize[_0x3182('0x5')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x3182('0x5')](_0x3182('0x12'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x3182('0x5')](_0x3182('0x12'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x3182('0x5')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x3182('0x12'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x3182('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x3182('0x11')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x3182('0x11')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x3182('0x11')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x3182('0x5')](_0x3182('0x12'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x3182('0x5')](_0x3182('0x12'),'no'),'defaultValue':_0x3182('0x12')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x3182('0x12'),'no',_0x3182('0x14')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x3182('0x5')](_0x3182('0x12'),'no')},'announce_position_limit':{'type':Sequelize[_0x3182('0x11')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x3182('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x3182('0x1')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x3182('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x3182('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x3182('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x3182('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x3182('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x3182('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x3182('0x1')]},'queue_quantity1':{'type':Sequelize[_0x3182('0x1')]},'queue_quantity2':{'type':Sequelize[_0x3182('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x3182('0x1')]},'queue_less_than':{'type':Sequelize[_0x3182('0x1')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x20a11b){this[_0x3182('0x15')]('periodic_announce',_0x20a11b?_0x20a11b[_0x3182('0x16')](','):[]);},'get':function(){return this[_0x3182('0xb')]('periodic_announce')?this[_0x3182('0xb')](_0x3182('0x17'))[_0x3182('0x18')](','):[];}},'joinempty':{'type':Sequelize[_0x3182('0x1')],'defaultValue':_0x3182('0x12'),'set':function(_0x13575f){this[_0x3182('0x15')]('joinempty',_0x13575f?_0x13575f[_0x3182('0x16')](','):undefined);},'get':function(){return this[_0x3182('0xb')](_0x3182('0x19'))?this['getDataValue']('joinempty')[_0x3182('0x18')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x3182('0x1')],'defaultValue':'no','set':function(_0x26af8a){this[_0x3182('0x15')]('leavewhenempty',_0x26af8a?_0x26af8a[_0x3182('0x16')](','):undefined);},'get':function(){return this['getDataValue'](_0x3182('0x1a'))?this[_0x3182('0xb')](_0x3182('0x1a'))[_0x3182('0x18')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x3182('0x5')](_0x3182('0x12'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x3182('0x5')](_0x3182('0x12'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x3182('0x11')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x3182('0x5')](_0x3182('0x12'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x3182('0x1')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x3182('0x1b')],'defaultValue':0x0,'set':function(_0x242691){this[_0x3182('0x15')]('acw',_0x242691);if(_0x242691){if(this[_0x3182('0xb')](_0x3182('0x1c'))<0x2){this[_0x3182('0x15')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x3182('0x11')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x3182('0x1b')],'defaultValue':0x0,'comment':_0x3182('0x1d')},'dialMethod':{'type':Sequelize[_0x3182('0x5')](_0x3182('0x1e'),_0x3182('0xf'),_0x3182('0x1f'),'predictive',_0x3182('0xd')),'defaultValue':_0x3182('0xf'),'comment':_0x3182('0x20')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x3182('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3182('0x22')},'dialLimitQueue':{'type':Sequelize[_0x3182('0x11')](0x4)[_0x3182('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x3182('0x23')](0x2)[_0x3182('0x21')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x3182('0x5')](_0x3182('0x24'),'dropRate'),'defaultValue':_0x3182('0x25'),'comment':_0x3182('0x26')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x3182('0x23')](0x2)[_0x3182('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x3182('0x27')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x3182('0x21')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x3182('0x28')},'dialOriginateCallerIdName':{'type':Sequelize[_0x3182('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3182('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x3182('0x11')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3182('0x29')},'dialQueueOptions':{'type':Sequelize[_0x3182('0x1')],'defaultValue':_0x3182('0x2a'),'comment':_0x3182('0x2b')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x3182('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3182('0x2c')},'dialQueueProject':{'type':Sequelize[_0x3182('0x1')],'comment':_0x3182('0x2d')},'dialCongestionMaxRetry':{'type':Sequelize[_0x3182('0x11')](0x3)[_0x3182('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3182('0x2e')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3182('0x11')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3182('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x3182('0x11')](0x3)[_0x3182('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3182('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x3182('0x11')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3182('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x3182('0x11')](0x3)[_0x3182('0x21')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x3182('0x11')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3182('0x32')},'dialGlobalMaxRetry':{'type':Sequelize[_0x3182('0x11')](0x3)[_0x3182('0x21')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x3182('0x33')},'dialTimezone':{'type':Sequelize[_0x3182('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3182('0x1')],'defaultValue':_0x3182('0x34')},'dialPrefix':{'type':Sequelize[_0x3182('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x3182('0x5')](_0x3182('0x35'),_0x3182('0x36'),'onlyIfOpen'),'defaultValue':_0x3182('0x35')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x3182('0x37')},'dialAMDInitialSilence':{'type':Sequelize[_0x3182('0x11')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x3182('0x11')](0x9)[_0x3182('0x21')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x3182('0x38')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x3182('0x11')](0x9)[_0x3182('0x21')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3182('0x11')](0x9)[_0x3182('0x21')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3182('0x39')},'dialAMDMinWordLength':{'type':Sequelize[_0x3182('0x11')](0x9)[_0x3182('0x21')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3182('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x3182('0x11')](0x9)[_0x3182('0x21')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3182('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3182('0x11')](0x9)[_0x3182('0x21')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3182('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3182('0x11')](0x5)[_0x3182('0x21')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x3182('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x3182('0x11')](0x9)[_0x3182('0x21')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3182('0x3e')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x3182('0x21')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x3182('0x1b')],'defaultValue':0x0,'comment':_0x3182('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize[_0x3182('0x5')]('DESC',_0x3182('0x40')),'defaultValue':_0x3182('0x41')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x3182('0x2d')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x3182('0x1b')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x3182('0x1b')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x3182('0x21')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3182('0x42')},'dialCutDigit':{'type':Sequelize[_0x3182('0x11')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3182('0x43')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x3182('0x11')](0x3)[_0x3182('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x3182('0x11')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x3182('0x11')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3182('0x44')},'dialDropRetryFrequency':{'type':Sequelize[_0x3182('0x11')](0x5)[_0x3182('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3182('0x45')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x3182('0x11')](0x3)[_0x3182('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3182('0x46')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x3182('0x11')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x3182('0x11')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x3182('0x11')](0x5)[_0x3182('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3182('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x3182('0x11')](0x3)[_0x3182('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x3182('0x11')](0x5)[_0x3182('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x3182('0x48')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x63f193){if(!_0x63f193)this[_0x3182('0x15')](_0x3182('0x49'),null);this[_0x3182('0x15')](_0x3182('0x4a'),_0x63f193);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x3182('0x21')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x3182('0x11')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x3182('0x1b')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x3182('0x11')](0x3)[_0x3182('0x21')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x3182('0x1b')],'defaultValue':![]}};
\ No newline at end of file
index 2e008c6..2765e77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71ab=['updatedAt','omit','body','user','getHoppers','findOne','CmHopper','VoiceQueueId','CmHopperHistory','CmHopperFinal','CmHopperBlack','Team','getTeams','teams','Agents','voicePause','interface','flatMap','forEach','penalty','transaction','addTeams','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','emit','ids','User','select','field','tq.TeamId','from','join','user_has_teams','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','TeamId','union','compact','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','userVoiceQueue:save','online','all','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_contacts','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()','removeBlackLists','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','name','UserProfileResource','stack','send','index','VoiceQueue','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','VoiceQueues','UserProfileSection','userProfileId','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt'];(function(_0x1bac4a,_0x34f93f){var _0x257a51=function(_0x2ee692){while(--_0x2ee692){_0x1bac4a['push'](_0x1bac4a['shift']());}};_0x257a51(++_0x34f93f);}(_0x71ab,0x64));var _0xb71a=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x71ab[_0x138adb];return _0x1b27f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb71a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb71a('0x1'));var rp=require('request-promise');var moment=require(_0xb71a('0x2'));var BPromise=require(_0xb71a('0x3'));var Mustache=require(_0xb71a('0x4'));var util=require(_0xb71a('0x5'));var path=require(_0xb71a('0x6'));var sox=require(_0xb71a('0x7'));var csv=require(_0xb71a('0x8'));var ejs=require(_0xb71a('0x9'));var fs=require('fs');var fs_extra=require(_0xb71a('0xa'));var _=require(_0xb71a('0xb'));var squel=require(_0xb71a('0xc'));var crypto=require(_0xb71a('0xd'));var jsforce=require(_0xb71a('0xe'));var deskjs=require(_0xb71a('0xf'));var toCsv=require(_0xb71a('0x8'));var querystring=require(_0xb71a('0x10'));var Papa=require(_0xb71a('0x11'));var Redis=require(_0xb71a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb71a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb71a('0x14'));var logger=require(_0xb71a('0x15'))(_0xb71a('0x16'));var utils=require('../../config/utils');var config=require(_0xb71a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb71a('0x18'))['db'];config['redis']=_['defaults'](config[_0xb71a('0x19')],{'host':_0xb71a('0x1a'),'port':0x18eb});var socket=require(_0xb71a('0x1b'))(new Redis(config[_0xb71a('0x19')]));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x5364e3,_0x12900a){_0x12900a=_0x12900a||0xcc;return function(_0xc189cd){if(_0xc189cd){return _0x5364e3[_0xb71a('0x1c')](_0x12900a);}return _0x5364e3[_0xb71a('0x1d')](_0x12900a)[_0xb71a('0x1e')]();};}function respondWithResult(_0x1e9363,_0x31def2){_0x31def2=_0x31def2||0xc8;return function(_0x2ec64a){if(_0x2ec64a){return _0x1e9363[_0xb71a('0x1d')](_0x31def2)['json'](_0x2ec64a);}};}function respondWithFilteredResult(_0x1ca65e,_0x2d6369){return function(_0x374c8c){if(_0x374c8c){var _0x346524=typeof _0x2d6369[_0xb71a('0x1f')]===_0xb71a('0x20')&&typeof _0x2d6369[_0xb71a('0x21')]===_0xb71a('0x20');var _0x20bdfe=_0x374c8c[_0xb71a('0x22')];var _0x16394a=_0x346524?0x0:_0x2d6369['offset'];var _0x5bb77a=_0x346524?_0x374c8c[_0xb71a('0x22')]:_0x2d6369[_0xb71a('0x1f')]+_0x2d6369['limit'];var _0x4d8871;if(_0x5bb77a>=_0x20bdfe){_0x5bb77a=_0x20bdfe;_0x4d8871=0xc8;}else{_0x4d8871=0xce;}_0x1ca65e[_0xb71a('0x1d')](_0x4d8871);return _0x1ca65e['set'](_0xb71a('0x23'),_0x16394a+'-'+_0x5bb77a+'/'+_0x20bdfe)[_0xb71a('0x24')](_0x374c8c);}return null;};}function patchUpdates(_0x3ac77b){return function(_0x18fa8d){try{jsonpatch[_0xb71a('0x25')](_0x18fa8d,_0x3ac77b,!![]);}catch(_0x14b2a1){return BPromise[_0xb71a('0x26')](_0x14b2a1);}return _0x18fa8d[_0xb71a('0x27')]();};}function saveUpdates(_0x5f3f19,_0xd40f86){return function(_0x2c15bc){if(_0x2c15bc){return _0x2c15bc[_0xb71a('0x28')](_0x5f3f19)[_0xb71a('0x29')](function(_0x3401f7){return _0x3401f7;});}return null;};}function removeEntity(_0x1a010d,_0x20ed75){return function(_0xfc8df0){if(_0xfc8df0){return _0xfc8df0[_0xb71a('0x2a')]()[_0xb71a('0x29')](function(){var _0x45b849=_0xfc8df0[_0xb71a('0x2b')]({'plain':!![]});var _0x160f0f=[{'name':'VoiceQueues','value':_0xb71a('0x2c'),'ignore':![]},{'name':_0xb71a('0x2d'),'value':_0xb71a('0x2e'),'ignore':![]}];var _0x358954=_(_0x160f0f)[_0xb71a('0x2f')](_0xb71a('0x30'))[_0xb71a('0x31')](_0xb71a('0x32'))[_0xb71a('0x32')]();if(_[_0xb71a('0x33')](_0x358954,_0x45b849[_0xb71a('0x34')])){return;}var _0x542ffd=_['find'](_0x160f0f,[_0xb71a('0x32'),_0x45b849['type']])[_0xb71a('0x35')];return db[_0xb71a('0x36')]['destroy']({'where':{'type':_0x542ffd,'resourceId':_0x45b849['id']}})[_0xb71a('0x29')](function(){return _0xfc8df0;});})[_0xb71a('0x29')](function(){_0x1a010d[_0xb71a('0x1d')](0xcc)[_0xb71a('0x1e')]();});}};}function handleEntityNotFound(_0x3d3d81,_0x2364c3){return function(_0x5dd779){if(!_0x5dd779){_0x3d3d81[_0xb71a('0x1c')](0x194);}return _0x5dd779;};}function handleError(_0x3f137a,_0x256dbe){_0x256dbe=_0x256dbe||0x1f4;return function(_0x31e708){logger['error'](_0x31e708[_0xb71a('0x37')]);if(_0x31e708[_0xb71a('0x35')]){delete _0x31e708[_0xb71a('0x35')];}_0x3f137a[_0xb71a('0x1d')](_0x256dbe)[_0xb71a('0x38')](_0x31e708);};}exports[_0xb71a('0x39')]=function(_0x2962a0,_0x333280){var _0x10a203={},_0x3f5531={},_0x47e7da={'count':0x0,'rows':[]};var _0x5a0920=_[_0xb71a('0x31')](db[_0xb71a('0x3a')][_0xb71a('0x3b')],function(_0x12b907){return{'name':_0x12b907[_0xb71a('0x3c')],'type':_0x12b907[_0xb71a('0x34')][_0xb71a('0x3d')]};});_0x3f5531['model']=_[_0xb71a('0x31')](_0x5a0920,'name');_0x3f5531[_0xb71a('0x3e')]=_[_0xb71a('0x3f')](_0x2962a0[_0xb71a('0x3e')]);_0x3f5531[_0xb71a('0x40')]=_['intersection'](_0x3f5531[_0xb71a('0x41')],_0x3f5531[_0xb71a('0x3e')]);_0x10a203[_0xb71a('0x42')]=_[_0xb71a('0x43')](_0x3f5531[_0xb71a('0x41')],qs[_0xb71a('0x44')](_0x2962a0[_0xb71a('0x3e')][_0xb71a('0x44')]));_0x10a203[_0xb71a('0x42')]=_0x10a203['attributes'][_0xb71a('0x45')]?_0x10a203['attributes']:_0x3f5531[_0xb71a('0x41')];if(!_0x2962a0[_0xb71a('0x3e')][_0xb71a('0x46')](_0xb71a('0x47'))){_0x10a203[_0xb71a('0x21')]=qs[_0xb71a('0x21')](_0x2962a0['query']['limit']);_0x10a203['offset']=qs[_0xb71a('0x1f')](_0x2962a0['query'][_0xb71a('0x1f')]);}_0x10a203[_0xb71a('0x48')]=qs[_0xb71a('0x49')](_0x2962a0[_0xb71a('0x3e')][_0xb71a('0x49')]);_0x10a203[_0xb71a('0x4a')]=qs['filters'](_[_0xb71a('0x4b')](_0x2962a0[_0xb71a('0x3e')],_0x3f5531[_0xb71a('0x40')]),_0x5a0920);if(_0x2962a0[_0xb71a('0x3e')][_0xb71a('0x2f')]){_0x10a203[_0xb71a('0x4a')]=_['merge'](_0x10a203[_0xb71a('0x4a')],{'$or':_[_0xb71a('0x31')](_0x5a0920,function(_0x2fcf9a){if(_0x2fcf9a[_0xb71a('0x34')]!==_0xb71a('0x4c')){var _0x8f97ff={};_0x8f97ff[_0x2fcf9a[_0xb71a('0x35')]]={'$like':'%'+_0x2962a0['query']['filter']+'%'};return _0x8f97ff;}})});}_0x10a203=_[_0xb71a('0x4d')]({},_0x10a203,_0x2962a0[_0xb71a('0x4e')]);var _0x2f6b72={'where':_0x10a203[_0xb71a('0x4a')]};return db['VoiceQueue'][_0xb71a('0x22')](_0x2f6b72)['then'](function(_0x318d0e){_0x47e7da[_0xb71a('0x22')]=_0x318d0e;if(_0x2962a0['query'][_0xb71a('0x4f')]){_0x10a203[_0xb71a('0x50')]=[{'all':!![]}];}return db[_0xb71a('0x3a')][_0xb71a('0x51')](_0x10a203);})['then'](function(_0x188896){_0x47e7da[_0xb71a('0x52')]=_0x188896;return _0x47e7da;})[_0xb71a('0x29')](respondWithFilteredResult(_0x333280,_0x10a203))['catch'](handleError(_0x333280,null));};exports[_0xb71a('0x53')]=function(_0x1cd434,_0x29b0bd){var _0x5e9eea={'raw':![],'where':{'id':_0x1cd434[_0xb71a('0x54')]['id']}},_0x2148ed={};_0x2148ed[_0xb71a('0x41')]=_[_0xb71a('0x3f')](db[_0xb71a('0x3a')]['rawAttributes']);_0x2148ed[_0xb71a('0x3e')]=_[_0xb71a('0x3f')](_0x1cd434[_0xb71a('0x3e')]);_0x2148ed[_0xb71a('0x40')]=_['intersection'](_0x2148ed['model'],_0x2148ed[_0xb71a('0x3e')]);_0x5e9eea[_0xb71a('0x42')]=_[_0xb71a('0x43')](_0x2148ed[_0xb71a('0x41')],qs[_0xb71a('0x44')](_0x1cd434[_0xb71a('0x3e')][_0xb71a('0x44')]));_0x5e9eea[_0xb71a('0x42')]=_0x5e9eea[_0xb71a('0x42')][_0xb71a('0x45')]?_0x5e9eea['attributes']:_0x2148ed[_0xb71a('0x41')];if(_0x1cd434[_0xb71a('0x3e')]['includeAll']){_0x5e9eea[_0xb71a('0x50')]=[{'all':!![]}];}_0x5e9eea=_['merge']({},_0x5e9eea,_0x1cd434[_0xb71a('0x4e')]);return db[_0xb71a('0x3a')][_0xb71a('0x55')](_0x5e9eea)[_0xb71a('0x29')](handleEntityNotFound(_0x29b0bd,null))[_0xb71a('0x29')](respondWithResult(_0x29b0bd,null))['catch'](handleError(_0x29b0bd,null));};exports[_0xb71a('0x56')]=function(_0x5b1902,_0x267cc8){return db[_0xb71a('0x3a')]['create'](_0x5b1902['body'],{})[_0xb71a('0x29')](function(_0x19972a){var _0x4ef963=_0x5b1902['user']['get']({'plain':!![]});if(!_0x4ef963)throw new Error(_0xb71a('0x57'));if(_0x4ef963['role']==='user'){var _0x333ed0=_0x19972a[_0xb71a('0x2b')]({'plain':!![]});var _0xf029f7=[{'name':_0xb71a('0x58'),'value':'inbound'},{'name':_0xb71a('0x2d'),'value':_0xb71a('0x2e')}];var _0x15afe1=_['find'](_0xf029f7,[_0xb71a('0x32'),_0x333ed0[_0xb71a('0x34')]])['name'];return db[_0xb71a('0x59')][_0xb71a('0x55')]({'where':{'name':_0x15afe1,'userProfileId':_0x4ef963[_0xb71a('0x5a')]},'raw':!![]})['then'](function(_0x43c310){if(_0x43c310&&_0x43c310['autoAssociation']===0x0){return db[_0xb71a('0x36')][_0xb71a('0x56')]({'name':_0x333ed0['name'],'resourceId':_0x333ed0['id'],'type':_0x43c310[_0xb71a('0x35')],'sectionId':_0x43c310['id']},{})[_0xb71a('0x29')](function(){return _0x19972a;});}else{return _0x19972a;}})[_0xb71a('0x5b')](function(_0x1c6312){logger[_0xb71a('0x5c')](_0xb71a('0x5d'),_0x1c6312);throw _0x1c6312;});}return _0x19972a;})[_0xb71a('0x29')](respondWithResult(_0x267cc8,0xc9))['catch'](handleError(_0x267cc8,null));};exports['clone']=function(_0x19c72d,_0x43e9ea){var _0x2cf6a3={'where':{'id':_0x19c72d[_0xb71a('0x54')]['id']}},_0x25e342={};_0x25e342['model']=_['keys'](db[_0xb71a('0x3a')][_0xb71a('0x3b')]);_0x2cf6a3['attributes']=_[_0xb71a('0x43')](_0x25e342[_0xb71a('0x41')],qs['fields'](_0x19c72d[_0xb71a('0x3e')][_0xb71a('0x44')]));_0x2cf6a3[_0xb71a('0x42')]=_0x2cf6a3[_0xb71a('0x42')]['length']?_0x2cf6a3[_0xb71a('0x42')]:_0x25e342[_0xb71a('0x41')];if(_0x19c72d['query'][_0xb71a('0x4f')]){_0x2cf6a3[_0xb71a('0x50')]=[{'all':!![]}];}_0x2cf6a3=_[_0xb71a('0x4d')]({},_0x2cf6a3,_0x19c72d[_0xb71a('0x4e')]);return db[_0xb71a('0x3a')][_0xb71a('0x55')](_0x2cf6a3)[_0xb71a('0x29')](handleEntityNotFound(_0x43e9ea,null))[_0xb71a('0x29')](function(_0x559790){if(_0x559790){var _0x5c1080=_0x559790[_0xb71a('0x2b')]({'plain':!![]});_0x5c1080=qs['omit'](_0x5c1080,['id',_0xb71a('0x5e'),_0xb71a('0x5f')]);_0x19c72d['body']=_[_0xb71a('0x60')](_0x19c72d[_0xb71a('0x61')],['id',_0xb71a('0x5e'),_0xb71a('0x5f')]);return db[_0xb71a('0x3a')][_0xb71a('0x56')](_['merge'](_0x5c1080,_0x19c72d['body']),{'include':_0x19c72d[_0xb71a('0x3e')][_0xb71a('0x4f')]?[{'all':!![]}]:undefined})[_0xb71a('0x29')](function(_0x57db9b){var _0xe93fd=_0x19c72d['user'][_0xb71a('0x2b')]({'plain':!![]});if(!_0xe93fd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe93fd['role']===_0xb71a('0x62')){var _0x9af0c=_0x57db9b[_0xb71a('0x2b')]({'plain':!![]});var _0x2e770d=[{'name':_0xb71a('0x58'),'value':'inbound'},{'name':_0xb71a('0x2d'),'value':'outbound'}];var _0x1adf18=_[_0xb71a('0x55')](_0x2e770d,[_0xb71a('0x32'),_0x9af0c['type']])['name'];return db[_0xb71a('0x59')][_0xb71a('0x55')]({'where':{'name':_0x1adf18,'userProfileId':_0xe93fd[_0xb71a('0x5a')]},'raw':!![]})[_0xb71a('0x29')](function(_0x9eff28){if(_0x9eff28&&_0x9eff28['autoAssociation']===0x0){return db[_0xb71a('0x36')][_0xb71a('0x56')]({'name':_0x9af0c[_0xb71a('0x35')],'resourceId':_0x9af0c['id'],'type':_0x9eff28[_0xb71a('0x35')],'sectionId':_0x9eff28['id']},{})[_0xb71a('0x29')](function(){return _0x57db9b;});}else{return _0x57db9b;}})['catch'](function(_0x4a18ab){logger[_0xb71a('0x5c')](_0xb71a('0x5d'),_0x4a18ab);throw _0x4a18ab;});}return _0x57db9b;});}})[_0xb71a('0x29')](respondWithResult(_0x43e9ea,0xc9))[_0xb71a('0x5b')](handleError(_0x43e9ea,null));};exports[_0xb71a('0x28')]=function(_0xa2081f,_0x2e8b81){if(_0xa2081f['body']['id']){delete _0xa2081f[_0xb71a('0x61')]['id'];}return db[_0xb71a('0x3a')]['find']({'where':{'id':_0xa2081f[_0xb71a('0x54')]['id']}})[_0xb71a('0x29')](handleEntityNotFound(_0x2e8b81,null))[_0xb71a('0x29')](saveUpdates(_0xa2081f['body'],null))[_0xb71a('0x29')](respondWithResult(_0x2e8b81,null))[_0xb71a('0x5b')](handleError(_0x2e8b81,null));};exports[_0xb71a('0x2a')]=function(_0x5cf30d,_0x1fd31c){return db[_0xb71a('0x3a')][_0xb71a('0x55')]({'where':{'id':_0x5cf30d[_0xb71a('0x54')]['id']}})[_0xb71a('0x29')](handleEntityNotFound(_0x1fd31c,null))[_0xb71a('0x29')](removeEntity(_0x1fd31c,null))[_0xb71a('0x5b')](handleError(_0x1fd31c,null));};exports[_0xb71a('0x63')]=function(_0x5b9fc7,_0x8d74d9,_0x507da4){var _0x57896d={'raw':![],'where':{}};var _0x30d36a={};var _0x43e4b8={'count':0x0,'rows':[]};return db[_0xb71a('0x3a')][_0xb71a('0x64')]({'where':{'id':_0x5b9fc7['params']['id']}})[_0xb71a('0x29')](handleEntityNotFound(_0x8d74d9,null))['then'](function(_0x2dc979){if(_0x2dc979){_0x30d36a[_0xb71a('0x41')]=_['keys'](db[_0xb71a('0x65')]['rawAttributes']);_0x30d36a[_0xb71a('0x3e')]=_['keys'](_0x5b9fc7[_0xb71a('0x3e')]);_0x30d36a[_0xb71a('0x40')]=_[_0xb71a('0x43')](_0x30d36a[_0xb71a('0x41')],_0x30d36a['query']);_0x57896d[_0xb71a('0x42')]=_[_0xb71a('0x43')](_0x30d36a['model'],qs[_0xb71a('0x44')](_0x5b9fc7['query']['fields']));_0x57896d['attributes']=_0x57896d['attributes'][_0xb71a('0x45')]?_0x57896d[_0xb71a('0x42')]:_0x30d36a[_0xb71a('0x41')];if(!_0x5b9fc7['query'][_0xb71a('0x46')](_0xb71a('0x47'))){_0x57896d['limit']=qs[_0xb71a('0x21')](_0x5b9fc7[_0xb71a('0x3e')][_0xb71a('0x21')]);_0x57896d[_0xb71a('0x1f')]=qs[_0xb71a('0x1f')](_0x5b9fc7[_0xb71a('0x3e')]['offset']);}_0x57896d[_0xb71a('0x48')]=qs[_0xb71a('0x49')](_0x5b9fc7[_0xb71a('0x3e')][_0xb71a('0x49')]);_0x57896d[_0xb71a('0x4a')]=qs[_0xb71a('0x40')](_['pick'](_0x5b9fc7[_0xb71a('0x3e')],_0x30d36a[_0xb71a('0x40')]));_0x57896d['where'][_0xb71a('0x66')]=_0x2dc979['id'];if(_0x5b9fc7[_0xb71a('0x3e')][_0xb71a('0x2f')]){_0x57896d['where']=_[_0xb71a('0x4d')](_0x57896d[_0xb71a('0x4a')],{'$or':_[_0xb71a('0x31')](_0x57896d['attributes'],function(_0x1a658e){var _0x4168b7={};_0x4168b7[_0x1a658e]={'$like':'%'+_0x5b9fc7['query'][_0xb71a('0x2f')]+'%'};return _0x4168b7;})});}_0x57896d=_[_0xb71a('0x4d')]({},_0x57896d,_0x5b9fc7[_0xb71a('0x4e')]);return db[_0xb71a('0x65')]['count']({'where':_0x57896d[_0xb71a('0x4a')]})[_0xb71a('0x29')](function(_0x157535){_0x43e4b8[_0xb71a('0x22')]=_0x157535;if(_0x5b9fc7['query'][_0xb71a('0x4f')]){_0x57896d[_0xb71a('0x50')]=[{'all':!![]}];}return db['CmHopper'][_0xb71a('0x51')](_0x57896d);})[_0xb71a('0x29')](function(_0x5df234){_0x43e4b8[_0xb71a('0x52')]=_0x5df234;return _0x43e4b8;});}})[_0xb71a('0x29')](respondWithFilteredResult(_0x8d74d9,_0x57896d))[_0xb71a('0x5b')](handleError(_0x8d74d9,null));};exports['getHopperHistories']=function(_0x2dff0d,_0x2e49c3,_0x771e1){var _0xd5ff7b={'raw':!![],'where':{}};var _0x397e34={};var _0xc552ac={'count':0x0,'rows':[]};return db[_0xb71a('0x3a')][_0xb71a('0x64')]({'where':{'id':_0x2dff0d[_0xb71a('0x54')]['id']}})['then'](handleEntityNotFound(_0x2e49c3,null))['then'](function(_0x36a75e){if(_0x36a75e){_0x397e34[_0xb71a('0x41')]=_[_0xb71a('0x3f')](db[_0xb71a('0x67')][_0xb71a('0x3b')]);_0x397e34[_0xb71a('0x3e')]=_['keys'](_0x2dff0d[_0xb71a('0x3e')]);_0x397e34['filters']=_[_0xb71a('0x43')](_0x397e34['model'],_0x397e34[_0xb71a('0x3e')]);_0xd5ff7b[_0xb71a('0x42')]=_['intersection'](_0x397e34[_0xb71a('0x41')],qs[_0xb71a('0x44')](_0x2dff0d[_0xb71a('0x3e')][_0xb71a('0x44')]));_0xd5ff7b[_0xb71a('0x42')]=_0xd5ff7b['attributes'][_0xb71a('0x45')]?_0xd5ff7b[_0xb71a('0x42')]:_0x397e34['model'];if(!_0x2dff0d[_0xb71a('0x3e')][_0xb71a('0x46')]('nolimit')){_0xd5ff7b[_0xb71a('0x21')]=qs[_0xb71a('0x21')](_0x2dff0d[_0xb71a('0x3e')]['limit']);_0xd5ff7b[_0xb71a('0x1f')]=qs[_0xb71a('0x1f')](_0x2dff0d[_0xb71a('0x3e')]['offset']);}_0xd5ff7b[_0xb71a('0x48')]=qs[_0xb71a('0x49')](_0x2dff0d[_0xb71a('0x3e')][_0xb71a('0x49')]);_0xd5ff7b[_0xb71a('0x4a')]=qs['filters'](_[_0xb71a('0x4b')](_0x2dff0d['query'],_0x397e34[_0xb71a('0x40')]));_0xd5ff7b[_0xb71a('0x4a')][_0xb71a('0x66')]=_0x36a75e['id'];if(_0x2dff0d['query']['filter']){_0xd5ff7b[_0xb71a('0x4a')]=_[_0xb71a('0x4d')](_0xd5ff7b[_0xb71a('0x4a')],{'$or':_[_0xb71a('0x31')](_0xd5ff7b[_0xb71a('0x42')],function(_0x18dfb3){var _0x38ffc1={};_0x38ffc1[_0x18dfb3]={'$like':'%'+_0x2dff0d[_0xb71a('0x3e')][_0xb71a('0x2f')]+'%'};return _0x38ffc1;})});}_0xd5ff7b=_[_0xb71a('0x4d')]({},_0xd5ff7b,_0x2dff0d[_0xb71a('0x4e')]);return db[_0xb71a('0x67')][_0xb71a('0x22')]({'where':_0xd5ff7b[_0xb71a('0x4a')]})[_0xb71a('0x29')](function(_0x582134){_0xc552ac[_0xb71a('0x22')]=_0x582134;if(_0x2dff0d[_0xb71a('0x3e')][_0xb71a('0x4f')]){_0xd5ff7b['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0xd5ff7b);})[_0xb71a('0x29')](function(_0x4981c6){_0xc552ac[_0xb71a('0x52')]=_0x4981c6;return _0xc552ac;});}})[_0xb71a('0x29')](respondWithFilteredResult(_0x2e49c3,_0xd5ff7b))['catch'](handleError(_0x2e49c3,null));};exports['getHopperFinals']=function(_0x43ba33,_0x99a14f,_0x1d0050){var _0x3d6d60={'raw':!![],'where':{}};var _0x3362be={};var _0x86854b={'count':0x0,'rows':[]};return db[_0xb71a('0x3a')][_0xb71a('0x64')]({'where':{'id':_0x43ba33[_0xb71a('0x54')]['id']}})[_0xb71a('0x29')](handleEntityNotFound(_0x99a14f,null))[_0xb71a('0x29')](function(_0x119d32){if(_0x119d32){_0x3362be[_0xb71a('0x41')]=_[_0xb71a('0x3f')](db[_0xb71a('0x68')][_0xb71a('0x3b')]);_0x3362be[_0xb71a('0x3e')]=_[_0xb71a('0x3f')](_0x43ba33[_0xb71a('0x3e')]);_0x3362be[_0xb71a('0x40')]=_[_0xb71a('0x43')](_0x3362be[_0xb71a('0x41')],_0x3362be['query']);_0x3d6d60[_0xb71a('0x42')]=_[_0xb71a('0x43')](_0x3362be[_0xb71a('0x41')],qs[_0xb71a('0x44')](_0x43ba33[_0xb71a('0x3e')][_0xb71a('0x44')]));_0x3d6d60[_0xb71a('0x42')]=_0x3d6d60[_0xb71a('0x42')][_0xb71a('0x45')]?_0x3d6d60[_0xb71a('0x42')]:_0x3362be[_0xb71a('0x41')];if(!_0x43ba33[_0xb71a('0x3e')][_0xb71a('0x46')](_0xb71a('0x47'))){_0x3d6d60[_0xb71a('0x21')]=qs[_0xb71a('0x21')](_0x43ba33[_0xb71a('0x3e')][_0xb71a('0x21')]);_0x3d6d60[_0xb71a('0x1f')]=qs[_0xb71a('0x1f')](_0x43ba33['query'][_0xb71a('0x1f')]);}_0x3d6d60[_0xb71a('0x48')]=qs[_0xb71a('0x49')](_0x43ba33[_0xb71a('0x3e')][_0xb71a('0x49')]);_0x3d6d60[_0xb71a('0x4a')]=qs[_0xb71a('0x40')](_[_0xb71a('0x4b')](_0x43ba33['query'],_0x3362be['filters']));_0x3d6d60[_0xb71a('0x4a')][_0xb71a('0x66')]=_0x119d32['id'];if(_0x43ba33[_0xb71a('0x3e')][_0xb71a('0x2f')]){_0x3d6d60['where']=_[_0xb71a('0x4d')](_0x3d6d60[_0xb71a('0x4a')],{'$or':_[_0xb71a('0x31')](_0x3d6d60[_0xb71a('0x42')],function(_0x2915dd){var _0x18ebc4={};_0x18ebc4[_0x2915dd]={'$like':'%'+_0x43ba33[_0xb71a('0x3e')]['filter']+'%'};return _0x18ebc4;})});}_0x3d6d60=_[_0xb71a('0x4d')]({},_0x3d6d60,_0x43ba33[_0xb71a('0x4e')]);return db[_0xb71a('0x68')]['count']({'where':_0x3d6d60[_0xb71a('0x4a')]})[_0xb71a('0x29')](function(_0x3007f3){_0x86854b['count']=_0x3007f3;if(_0x43ba33[_0xb71a('0x3e')][_0xb71a('0x4f')]){_0x3d6d60[_0xb71a('0x50')]=[{'all':!![]}];}return db[_0xb71a('0x68')]['findAll'](_0x3d6d60);})[_0xb71a('0x29')](function(_0x30ebb7){_0x86854b[_0xb71a('0x52')]=_0x30ebb7;return _0x86854b;});}})[_0xb71a('0x29')](respondWithFilteredResult(_0x99a14f,_0x3d6d60))[_0xb71a('0x5b')](handleError(_0x99a14f,null));};exports['getHopperBlacks']=function(_0x18ad17,_0x125473,_0x1618d4){var _0x11d4cf={'raw':!![],'where':{}};var _0x9b76b0={};var _0x351832={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xb71a('0x64')]({'where':{'id':_0x18ad17[_0xb71a('0x54')]['id']}})['then'](handleEntityNotFound(_0x125473,null))[_0xb71a('0x29')](function(_0x1ab686){if(_0x1ab686){_0x9b76b0[_0xb71a('0x41')]=_[_0xb71a('0x3f')](db[_0xb71a('0x69')][_0xb71a('0x3b')]);_0x9b76b0[_0xb71a('0x3e')]=_[_0xb71a('0x3f')](_0x18ad17[_0xb71a('0x3e')]);_0x9b76b0[_0xb71a('0x40')]=_[_0xb71a('0x43')](_0x9b76b0[_0xb71a('0x41')],_0x9b76b0[_0xb71a('0x3e')]);_0x11d4cf[_0xb71a('0x42')]=_[_0xb71a('0x43')](_0x9b76b0[_0xb71a('0x41')],qs[_0xb71a('0x44')](_0x18ad17[_0xb71a('0x3e')]['fields']));_0x11d4cf['attributes']=_0x11d4cf[_0xb71a('0x42')][_0xb71a('0x45')]?_0x11d4cf['attributes']:_0x9b76b0[_0xb71a('0x41')];if(!_0x18ad17[_0xb71a('0x3e')][_0xb71a('0x46')](_0xb71a('0x47'))){_0x11d4cf[_0xb71a('0x21')]=qs[_0xb71a('0x21')](_0x18ad17[_0xb71a('0x3e')][_0xb71a('0x21')]);_0x11d4cf[_0xb71a('0x1f')]=qs[_0xb71a('0x1f')](_0x18ad17[_0xb71a('0x3e')][_0xb71a('0x1f')]);}_0x11d4cf[_0xb71a('0x48')]=qs['sort'](_0x18ad17[_0xb71a('0x3e')]['sort']);_0x11d4cf[_0xb71a('0x4a')]=qs[_0xb71a('0x40')](_['pick'](_0x18ad17[_0xb71a('0x3e')],_0x9b76b0[_0xb71a('0x40')]));_0x11d4cf['where'][_0xb71a('0x66')]=_0x1ab686['id'];if(_0x18ad17[_0xb71a('0x3e')][_0xb71a('0x2f')]){_0x11d4cf[_0xb71a('0x4a')]=_[_0xb71a('0x4d')](_0x11d4cf[_0xb71a('0x4a')],{'$or':_[_0xb71a('0x31')](_0x11d4cf[_0xb71a('0x42')],function(_0x304082){var _0x3f68ca={};_0x3f68ca[_0x304082]={'$like':'%'+_0x18ad17['query'][_0xb71a('0x2f')]+'%'};return _0x3f68ca;})});}_0x11d4cf=_[_0xb71a('0x4d')]({},_0x11d4cf,_0x18ad17['options']);return db[_0xb71a('0x69')][_0xb71a('0x22')]({'where':_0x11d4cf['where']})[_0xb71a('0x29')](function(_0x48b8b2){_0x351832[_0xb71a('0x22')]=_0x48b8b2;if(_0x18ad17[_0xb71a('0x3e')]['includeAll']){_0x11d4cf[_0xb71a('0x50')]=[{'all':!![]}];}return db[_0xb71a('0x69')]['findAll'](_0x11d4cf);})[_0xb71a('0x29')](function(_0x47e0d2){_0x351832[_0xb71a('0x52')]=_0x47e0d2;return _0x351832;});}})['then'](respondWithFilteredResult(_0x125473,_0x11d4cf))['catch'](handleError(_0x125473,null));};exports['getTeams']=function(_0x4ec008,_0x5a6606,_0x4be976){var _0x18d2aa={};var _0x42f4f8={};var _0x5d0026;var _0x3abb95;return db[_0xb71a('0x3a')]['findOne']({'where':{'id':_0x4ec008[_0xb71a('0x54')]['id']}})[_0xb71a('0x29')](handleEntityNotFound(_0x5a6606,null))[_0xb71a('0x29')](function(_0x56a104){if(_0x56a104){_0x5d0026=_0x56a104;_0x42f4f8['model']=_[_0xb71a('0x3f')](db[_0xb71a('0x6a')][_0xb71a('0x3b')]);_0x42f4f8[_0xb71a('0x3e')]=_[_0xb71a('0x3f')](_0x4ec008['query']);_0x42f4f8[_0xb71a('0x40')]=_[_0xb71a('0x43')](_0x42f4f8['model'],_0x42f4f8[_0xb71a('0x3e')]);_0x18d2aa[_0xb71a('0x42')]=_[_0xb71a('0x43')](_0x42f4f8[_0xb71a('0x41')],qs['fields'](_0x4ec008[_0xb71a('0x3e')][_0xb71a('0x44')]));_0x18d2aa[_0xb71a('0x42')]=_0x18d2aa[_0xb71a('0x42')]['length']?_0x18d2aa['attributes']:_0x42f4f8[_0xb71a('0x41')];_0x18d2aa[_0xb71a('0x48')]=qs[_0xb71a('0x49')](_0x4ec008[_0xb71a('0x3e')]['sort']);_0x18d2aa[_0xb71a('0x4a')]=qs[_0xb71a('0x40')](_[_0xb71a('0x4b')](_0x4ec008['query'],_0x42f4f8[_0xb71a('0x40')]));if(_0x4ec008[_0xb71a('0x3e')][_0xb71a('0x2f')]){_0x18d2aa[_0xb71a('0x4a')]=_[_0xb71a('0x4d')](_0x18d2aa[_0xb71a('0x4a')],{'$or':_['map'](_0x18d2aa[_0xb71a('0x42')],function(_0x1cb098){var _0x5083f8={};_0x5083f8[_0x1cb098]={'$like':'%'+_0x4ec008[_0xb71a('0x3e')]['filter']+'%'};return _0x5083f8;})});}_0x18d2aa=_['merge']({},_0x18d2aa,_0x4ec008[_0xb71a('0x4e')]);return _0x5d0026[_0xb71a('0x6b')](_0x18d2aa);}})[_0xb71a('0x29')](function(_0x3bd864){if(_0x3bd864){_0x3abb95=_0x3bd864['length'];if(!_0x4ec008[_0xb71a('0x3e')]['hasOwnProperty'](_0xb71a('0x47'))){_0x18d2aa[_0xb71a('0x21')]=qs[_0xb71a('0x21')](_0x4ec008[_0xb71a('0x3e')][_0xb71a('0x21')]);_0x18d2aa['offset']=qs[_0xb71a('0x1f')](_0x4ec008[_0xb71a('0x3e')][_0xb71a('0x1f')]);}return _0x5d0026[_0xb71a('0x6b')](_0x18d2aa);}})['then'](function(_0x348f8c){if(_0x348f8c){return _0x348f8c?{'count':_0x3abb95,'rows':_0x348f8c}:null;}})[_0xb71a('0x29')](respondWithResult(_0x5a6606,null))[_0xb71a('0x5b')](handleError(_0x5a6606,null));};exports['addTeams']=function(_0xab4985,_0x3dbde4,_0x4e6157){var _0x108f4d=_0xab4985[_0xb71a('0x61')][_0xb71a('0x6c')];var _0xecef29=_[_0xb71a('0x31')](_0x108f4d,'id');return db[_0xb71a('0x6a')][_0xb71a('0x51')]({'where':{'id':_0xecef29},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb71a('0x6d'),'attributes':['id','name','online',_0xb71a('0x6e'),_0xb71a('0x6f')],'raw':!![]}]})[_0xb71a('0x29')](function(_0x8fff21){if(_0x8fff21){var _0x504785=_[_0xb71a('0x70')](_0x8fff21,function(_0x59ae1e){var _0x90b8eb=_0x59ae1e[_0xb71a('0x2b')]({'plain':!![]});_0x90b8eb[_0xb71a('0x6d')][_0xb71a('0x71')](function(_0x1cad05){_0x1cad05[_0xb71a('0x72')]=_[_0xb71a('0x55')](_0x108f4d,{'id':_0x90b8eb['id']})[_0xb71a('0x72')];});return _0x90b8eb[_0xb71a('0x6d')];});return db[_0xb71a('0x3a')]['find']({'where':{'id':_0xab4985[_0xb71a('0x54')]['id']}})['then'](function(_0x438b58){return db['sequelize'][_0xb71a('0x73')](function(_0x3e35a4){return _0x438b58[_0xb71a('0x74')](_0xecef29,{'transaction':_0x3e35a4})[_0xb71a('0x29')](function(){return BPromise[_0xb71a('0x75')](_0x108f4d,function(_0x53399c){return db[_0xb71a('0x76')][_0xb71a('0x77')]({'TeamId':_0x53399c['id'],'VoiceQueueId':_0xab4985['params']['id'],'penalty':_0x53399c['penalty']},{'transaction':_0x3e35a4});});})[_0xb71a('0x29')](function(){return BPromise[_0xb71a('0x75')](_0x504785,function(_0x51e7b2){return db[_0xb71a('0x78')][_0xb71a('0x79')]({'where':{'UserId':_0x51e7b2['id'],'VoiceQueueId':_0xab4985[_0xb71a('0x54')]['id']},'defaults':{'penalty':_0x51e7b2[_0xb71a('0x72')]},'transaction':_0x3e35a4});});})[_0xb71a('0x29')](function(){return BPromise[_0xb71a('0x75')](_[_0xb71a('0x2f')](_0x504785,{'online':!![]}),function(_0x5a39af){return db[_0xb71a('0x7a')][_0xb71a('0x77')]({'membername':_0x5a39af[_0xb71a('0x35')],'UserId':_0x5a39af['id'],'queue_name':_0x438b58[_0xb71a('0x35')],'VoiceQueueId':_0x438b58['id'],'interface':_[_0xb71a('0x7b')](_0x5a39af['interface'])?util[_0xb71a('0x7c')]('SIP/%s',_0x5a39af[_0xb71a('0x35')]):_0x5a39af['interface'],'paused':_0x5a39af['voicePause']||![],'penalty':_0x5a39af[_0xb71a('0x72')]},{'transaction':_0x3e35a4});});})[_0xb71a('0x29')](function(){_0x504785[_0xb71a('0x71')](function(_0x35e3fe){socket[_0xb71a('0x7d')]('userVoiceQueue:save',{'UserId':_0x35e3fe['id'],'VoiceQueueId':_0x438b58['id']});});});});});}})[_0xb71a('0x29')](respondWithStatusCode(_0x3dbde4,null))[_0xb71a('0x5b')](handleError(_0x3dbde4,null));};exports['removeTeams']=function(_0xabbd5,_0x338400,_0x5330b5){return db[_0xb71a('0x6a')][_0xb71a('0x51')]({'where':{'id':_0xabbd5[_0xb71a('0x3e')][_0xb71a('0x7e')]},'attributes':['id'],'include':[{'model':db[_0xb71a('0x7f')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x338400,null))[_0xb71a('0x29')](function(_0x48b1ac){var _0x2c89a5=_['map'](_0x48b1ac,'id');var _0x5d6e87=[];var _0x555205=[];var _0xe8c99f=squel[_0xb71a('0x80')]();_0xe8c99f[_0xb71a('0x81')](_0xb71a('0x82'))[_0xb71a('0x83')]('team_has_voice_queues','tq')[_0xb71a('0x84')](_0xb71a('0x85'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xb71a('0x4a')](_0xb71a('0x86'),_0xabbd5[_0xb71a('0x54')]['id']);for(var _0x56ca82=0x0;_0x56ca82<_0x48b1ac['length'];_0x56ca82+=0x1){let _0x12d81d=_0x48b1ac[_0x56ca82];for(var _0x37d0ec=0x0;_0x37d0ec<_0x12d81d['Agents'][_0xb71a('0x45')];_0x37d0ec+=0x1){let _0x1ecd58=_0x12d81d[_0xb71a('0x6d')][_0x37d0ec];var _0x1e5d88=_0xe8c99f[_0xb71a('0x87')]();_0x1e5d88[_0xb71a('0x4a')](_0xb71a('0x88'),_0x1ecd58['id']);_0x555205[_0xb71a('0x89')](db[_0xb71a('0x8a')][_0xb71a('0x3e')](_0x1e5d88[_0xb71a('0x8b')](),{'type':db['sequelize'][_0xb71a('0x8c')]['SELECT']})[_0xb71a('0x29')](function(_0x2a57c7){if(_0x2a57c7['length']===0x1){return _0x1ecd58['id'];}else{var _0x3ce63e=_['every'](_[_0xb71a('0x31')](_0x2a57c7,_0xb71a('0x8d')),function(_0x10fa62){return _[_0xb71a('0x33')](_0x2c89a5,_0x10fa62);});if(_0x3ce63e){return _0x1ecd58['id'];}}}));}}return BPromise['all'](_0x555205)[_0xb71a('0x29')](function(_0x508d8c){_0x5d6e87=_(_0x5d6e87)[_0xb71a('0x8e')](_0x508d8c)[_0xb71a('0x8f')]()[_0xb71a('0x32')]();return db['VoiceQueue'][_0xb71a('0x55')]({'where':{'id':_0xabbd5['params']['id']}})[_0xb71a('0x29')](function(_0x3b1b85){return db[_0xb71a('0x8a')][_0xb71a('0x73')](function(_0x56f7b3){return _0x3b1b85[_0xb71a('0x90')](_0xabbd5[_0xb71a('0x3e')]['ids'],{'transaction':_0x56f7b3})[_0xb71a('0x29')](function(){if(!_[_0xb71a('0x91')](_0x5d6e87)){return _0x3b1b85[_0xb71a('0x92')](_0x5d6e87,{'transaction':_0x56f7b3})[_0xb71a('0x29')](function(){return db['UserVoiceQueueRt'][_0xb71a('0x2a')]({'where':{'VoiceQueueId':_0xabbd5[_0xb71a('0x54')]['id'],'UserId':_0x5d6e87},'transaction':_0x56f7b3});});}})[_0xb71a('0x29')](function(){_0x5d6e87[_0xb71a('0x71')](function(_0x707e12){socket[_0xb71a('0x7d')](_0xb71a('0x93'),{'UserId':_0x707e12,'VoiceQueueId':_0x3b1b85['id']});});});});});});})[_0xb71a('0x29')](respondWithStatusCode(_0x338400,null))['catch'](handleError(_0x338400,null));};exports[_0xb71a('0x94')]=function(_0x26909d,_0x193525,_0x24196a){var _0x56a564,_0x15c770;return db[_0xb71a('0x3a')]['find']({'where':{'id':_0x26909d[_0xb71a('0x54')]['id']}})[_0xb71a('0x29')](handleEntityNotFound(_0x193525,null))[_0xb71a('0x29')](function(_0x54f198){if(_0x54f198){_0x15c770=_0x54f198;return _0x54f198[_0xb71a('0x94')](_0x26909d[_0xb71a('0x61')][_0xb71a('0x7e')],_['omit'](_0x26909d[_0xb71a('0x61')],[_0xb71a('0x7e'),'id'])||{})[_0xb71a('0x95')](function(_0x6e3687){for(var _0x1e98e4=0x0;_0x1e98e4<_0x26909d[_0xb71a('0x61')][_0xb71a('0x7e')]['length'];_0x1e98e4+=0x1){socket['emit'](_0xb71a('0x96'),{'UserId':Number(_0x26909d[_0xb71a('0x61')][_0xb71a('0x7e')][_0x1e98e4]),'VoiceQueueId':Number(_0x26909d[_0xb71a('0x54')]['id'])});}return _0x6e3687;});}})[_0xb71a('0x29')](function(_0x35428c){_0x56a564=_0x35428c||[];if(_0x15c770){return db[_0xb71a('0x7f')][_0xb71a('0x51')]({'where':{'id':_0x26909d[_0xb71a('0x61')]['ids']},'attributes':['id','name',_0xb71a('0x97'),_0xb71a('0x6e'),_0xb71a('0x6f')],'raw':!![]});}})[_0xb71a('0x29')](function(_0x3b021d){if(!_['isEmpty'](_0x3b021d)){var _0x1764d7=[];for(var _0x1be129=0x0;_0x1be129<_0x3b021d[_0xb71a('0x45')];_0x1be129++){if(_0x3b021d[_0x1be129][_0xb71a('0x97')]){_0x1764d7[_0xb71a('0x89')](db[_0xb71a('0x7a')][_0xb71a('0x77')]({'membername':_0x3b021d[_0x1be129]['name'],'UserId':_0x3b021d[_0x1be129]['id'],'queue_name':_0x15c770[_0xb71a('0x35')],'VoiceQueueId':_0x15c770['id'],'interface':_[_0xb71a('0x7b')](_0x3b021d[_0x1be129][_0xb71a('0x6f')])?util[_0xb71a('0x7c')]('SIP/%s',_0x3b021d[_0x1be129][_0xb71a('0x35')]):_0x3b021d[_0x1be129][_0xb71a('0x6f')],'paused':_0x3b021d[_0x1be129][_0xb71a('0x6e')]||![],'penalty':_0x26909d[_0xb71a('0x61')]['penalty']||0x0}));}}return BPromise[_0xb71a('0x98')](_0x1764d7);}})[_0xb71a('0x29')](function(){return _0x56a564;})[_0xb71a('0x29')](respondWithResult(_0x193525,null))[_0xb71a('0x5b')](handleError(_0x193525,null));};exports[_0xb71a('0x92')]=function(_0x5f5c9c,_0x5ac5f3,_0x3fff8c){return db[_0xb71a('0x3a')][_0xb71a('0x55')]({'where':{'id':_0x5f5c9c[_0xb71a('0x54')]['id']}})['then'](handleEntityNotFound(_0x5ac5f3,null))[_0xb71a('0x29')](function(_0x6dbd4a){if(_0x6dbd4a){return _0x6dbd4a['removeAgents'](_0x5f5c9c[_0xb71a('0x3e')][_0xb71a('0x7e')])[_0xb71a('0x29')](function(){if(_[_0xb71a('0x99')](_0x5f5c9c['query'][_0xb71a('0x7e')])){for(var _0x3f612a=0x0;_0x3f612a<_0x5f5c9c[_0xb71a('0x3e')]['ids']['length'];_0x3f612a+=0x1){socket[_0xb71a('0x7d')]('userVoiceQueue:remove',{'UserId':Number(_0x5f5c9c[_0xb71a('0x3e')][_0xb71a('0x7e')][_0x3f612a]),'VoiceQueueId':Number(_0x5f5c9c[_0xb71a('0x54')]['id'])});}}else{socket[_0xb71a('0x7d')](_0xb71a('0x93'),{'UserId':Number(_0x5f5c9c[_0xb71a('0x3e')][_0xb71a('0x7e')]),'VoiceQueueId':Number(_0x5f5c9c[_0xb71a('0x54')]['id'])});}});}})['then'](function(_0x59dfa3){return db[_0xb71a('0x7a')][_0xb71a('0x2a')]({'where':{'VoiceQueueId':_0x5f5c9c[_0xb71a('0x54')]['id'],'UserId':_0x5f5c9c[_0xb71a('0x3e')][_0xb71a('0x7e')]}})[_0xb71a('0x29')](function(){return _0x59dfa3;});})['then'](respondWithStatusCode(_0x5ac5f3,null))['catch'](handleError(_0x5ac5f3,null));};exports[_0xb71a('0x9a')]=function(_0x369e33,_0x97794e,_0x40d7a0){var _0x4ca0f2={};var _0x359c74={};var _0x4c5970;var _0x4af16b;return db[_0xb71a('0x3a')][_0xb71a('0x64')]({'where':{'id':_0x369e33[_0xb71a('0x54')]['id']}})[_0xb71a('0x29')](handleEntityNotFound(_0x97794e,null))['then'](function(_0x46462c){if(_0x46462c){_0x4c5970=_0x46462c;_0x359c74[_0xb71a('0x41')]=_['keys'](db[_0xb71a('0x7f')][_0xb71a('0x3b')]);_0x359c74[_0xb71a('0x3e')]=_['keys'](_0x369e33[_0xb71a('0x3e')]);_0x359c74['filters']=_[_0xb71a('0x43')](_0x359c74['model'],_0x359c74[_0xb71a('0x3e')]);_0x4ca0f2[_0xb71a('0x42')]=_[_0xb71a('0x43')](_0x359c74[_0xb71a('0x41')],qs['fields'](_0x369e33['query'][_0xb71a('0x44')]));_0x4ca0f2[_0xb71a('0x42')]=_0x4ca0f2['attributes'][_0xb71a('0x45')]?_0x4ca0f2[_0xb71a('0x42')]:_0x359c74[_0xb71a('0x41')];_0x4ca0f2[_0xb71a('0x48')]=qs[_0xb71a('0x49')](_0x369e33['query'][_0xb71a('0x49')]);_0x4ca0f2[_0xb71a('0x4a')]=qs[_0xb71a('0x40')](_[_0xb71a('0x4b')](_0x369e33['query'],_0x359c74[_0xb71a('0x40')]));if(_0x369e33[_0xb71a('0x3e')][_0xb71a('0x2f')]){_0x4ca0f2['where']=_[_0xb71a('0x4d')](_0x4ca0f2[_0xb71a('0x4a')],{'$or':_[_0xb71a('0x31')](_0x4ca0f2[_0xb71a('0x42')],function(_0x2d234d){var _0xc527b1={};_0xc527b1[_0x2d234d]={'$like':'%'+_0x369e33[_0xb71a('0x3e')][_0xb71a('0x2f')]+'%'};return _0xc527b1;})});}_0x4ca0f2=_[_0xb71a('0x4d')]({},_0x4ca0f2,_0x369e33[_0xb71a('0x4e')]);return _0x4c5970[_0xb71a('0x9a')](_0x4ca0f2);}})[_0xb71a('0x29')](function(_0x199dae){if(_0x199dae){_0x4af16b=_0x199dae['length'];if(!_0x369e33[_0xb71a('0x3e')][_0xb71a('0x46')](_0xb71a('0x47'))){_0x4ca0f2[_0xb71a('0x21')]=qs['limit'](_0x369e33[_0xb71a('0x3e')][_0xb71a('0x21')]);_0x4ca0f2[_0xb71a('0x1f')]=qs[_0xb71a('0x1f')](_0x369e33[_0xb71a('0x3e')][_0xb71a('0x1f')]);}return _0x4c5970[_0xb71a('0x9a')](_0x4ca0f2);}})['then'](function(_0xb43bdc){if(_0xb43bdc){return _0xb43bdc?{'count':_0x4af16b,'rows':_0xb43bdc}:null;}})['then'](respondWithResult(_0x97794e,null))[_0xb71a('0x5b')](handleError(_0x97794e,null));};exports[_0xb71a('0x9b')]=function(_0x594935,_0x1abbd1,_0x36659c){var _0x334d1e={};var _0x48b54a={};var _0x2c9c93;var _0x3ade3c;return db[_0xb71a('0x3a')][_0xb71a('0x64')]({'where':{'id':_0x594935['params']['id']}})['then'](handleEntityNotFound(_0x1abbd1,null))['then'](function(_0x2ec2c6){if(_0x2ec2c6){_0x2c9c93=_0x2ec2c6;_0x48b54a['model']=_[_0xb71a('0x3f')](db['UserVoiceQueueRt'][_0xb71a('0x3b')]);_0x48b54a['query']=_[_0xb71a('0x3f')](_0x594935[_0xb71a('0x3e')]);_0x48b54a[_0xb71a('0x40')]=_[_0xb71a('0x43')](_0x48b54a[_0xb71a('0x41')],_0x48b54a[_0xb71a('0x3e')]);_0x334d1e[_0xb71a('0x42')]=_[_0xb71a('0x43')](_0x48b54a[_0xb71a('0x41')],qs[_0xb71a('0x44')](_0x594935[_0xb71a('0x3e')][_0xb71a('0x44')]));_0x334d1e[_0xb71a('0x42')]=_0x334d1e[_0xb71a('0x42')][_0xb71a('0x45')]?_0x334d1e[_0xb71a('0x42')]:_0x48b54a[_0xb71a('0x41')];_0x334d1e[_0xb71a('0x48')]=qs[_0xb71a('0x49')](_0x594935[_0xb71a('0x3e')]['sort']);_0x334d1e[_0xb71a('0x4a')]=qs[_0xb71a('0x40')](_['pick'](_0x594935['query'],_0x48b54a[_0xb71a('0x40')]));if(_0x594935[_0xb71a('0x3e')][_0xb71a('0x2f')]){_0x334d1e['where']=_[_0xb71a('0x4d')](_0x334d1e[_0xb71a('0x4a')],{'$or':_['map'](_0x334d1e['attributes'],function(_0x3ed674){var _0x29352f={};_0x29352f[_0x3ed674]={'$like':'%'+_0x594935[_0xb71a('0x3e')]['filter']+'%'};return _0x29352f;})});}_0x334d1e=_[_0xb71a('0x4d')]({},_0x334d1e,_0x594935['options']);return _0x2c9c93[_0xb71a('0x9b')](_0x334d1e);}})[_0xb71a('0x29')](function(_0x27b048){if(_0x27b048){_0x3ade3c=_0x27b048['length'];if(!_0x594935[_0xb71a('0x3e')][_0xb71a('0x46')]('nolimit')){_0x334d1e[_0xb71a('0x21')]=qs[_0xb71a('0x21')](_0x594935[_0xb71a('0x3e')][_0xb71a('0x21')]);_0x334d1e[_0xb71a('0x1f')]=qs['offset'](_0x594935[_0xb71a('0x3e')][_0xb71a('0x1f')]);}return _0x2c9c93[_0xb71a('0x9b')](_0x334d1e);}})['then'](function(_0x3f9792){return _0x3f9792?{'count':_0x3ade3c,'rows':_0x3f9792}:null;})[_0xb71a('0x29')](respondWithResult(_0x1abbd1,null))[_0xb71a('0x5b')](handleError(_0x1abbd1,null));};exports[_0xb71a('0x9c')]=function(_0x1bb57c,_0x5ddd78,_0xa790e8){var _0x5cbc9c={};var _0x1e15f5={};var _0x1d5779;var _0x499586;return db[_0xb71a('0x3a')][_0xb71a('0x64')]({'where':{'id':_0x1bb57c[_0xb71a('0x54')]['id']}})[_0xb71a('0x29')](handleEntityNotFound(_0x5ddd78,null))[_0xb71a('0x29')](function(_0x14b836){if(_0x14b836){_0x1d5779=_0x14b836;_0x1e15f5[_0xb71a('0x41')]=_[_0xb71a('0x3f')](db[_0xb71a('0x9d')][_0xb71a('0x3b')]);_0x1e15f5['query']=_[_0xb71a('0x3f')](_0x1bb57c[_0xb71a('0x3e')]);_0x1e15f5[_0xb71a('0x40')]=_[_0xb71a('0x43')](_0x1e15f5[_0xb71a('0x41')],_0x1e15f5[_0xb71a('0x3e')]);_0x5cbc9c[_0xb71a('0x42')]=_['intersection'](_0x1e15f5[_0xb71a('0x41')],qs['fields'](_0x1bb57c['query'][_0xb71a('0x44')]));_0x5cbc9c[_0xb71a('0x42')]=_0x5cbc9c['attributes'][_0xb71a('0x45')]?_0x5cbc9c[_0xb71a('0x42')]:_0x1e15f5[_0xb71a('0x41')];_0x5cbc9c[_0xb71a('0x48')]=qs['sort'](_0x1bb57c['query'][_0xb71a('0x49')]);_0x5cbc9c[_0xb71a('0x4a')]=qs['filters'](_[_0xb71a('0x4b')](_0x1bb57c[_0xb71a('0x3e')],_0x1e15f5[_0xb71a('0x40')]));if(_0x1bb57c[_0xb71a('0x3e')][_0xb71a('0x2f')]){_0x5cbc9c[_0xb71a('0x4a')]=_[_0xb71a('0x4d')](_0x5cbc9c[_0xb71a('0x4a')],{'$or':_[_0xb71a('0x31')](_0x5cbc9c[_0xb71a('0x42')],function(_0x452f06){var _0x3dfe80={};_0x3dfe80[_0x452f06]={'$like':'%'+_0x1bb57c[_0xb71a('0x3e')][_0xb71a('0x2f')]+'%'};return _0x3dfe80;})});}_0x5cbc9c=_[_0xb71a('0x4d')]({},_0x5cbc9c,_0x1bb57c['options']);return _0x1d5779[_0xb71a('0x9c')](_0x5cbc9c);}})[_0xb71a('0x29')](function(_0xe8ce86){if(_0xe8ce86){_0x499586=_0xe8ce86[_0xb71a('0x45')];if(!_0x1bb57c['query'][_0xb71a('0x46')](_0xb71a('0x47'))){_0x5cbc9c[_0xb71a('0x21')]=qs['limit'](_0x1bb57c[_0xb71a('0x3e')]['limit']);_0x5cbc9c[_0xb71a('0x1f')]=qs[_0xb71a('0x1f')](_0x1bb57c[_0xb71a('0x3e')][_0xb71a('0x1f')]);}return _0x1d5779['getLists'](_0x5cbc9c);}})[_0xb71a('0x29')](function(_0x20d281){if(_0x20d281){return _0x20d281?{'count':_0x499586,'rows':_0x20d281}:null;}})[_0xb71a('0x29')](respondWithResult(_0x5ddd78,null))['catch'](handleError(_0x5ddd78,null));};exports[_0xb71a('0x9e')]=function(_0x597bf9,_0x134dab,_0x5d9ad2){var _0x26f89f=moment()[_0xb71a('0x7c')](_0xb71a('0x9f'));var _0x45a458,_0x5c0bf6;return db['VoiceQueue'][_0xb71a('0x55')]({'where':{'id':_0x597bf9['params']['id']}})['then'](handleEntityNotFound(_0x134dab,null))['then'](function(_0x5cfaa8){if(_0x5cfaa8){_0x5c0bf6=_0x5cfaa8;return _0x5cfaa8[_0xb71a('0x9e')](_0x597bf9[_0xb71a('0x61')][_0xb71a('0x7e')],_[_0xb71a('0x60')](_0x597bf9['body'],[_0xb71a('0x7e'),'id'])||{});}return null;})[_0xb71a('0x95')](function(_0x186f92){var _0x9eeafc;_0x45a458=_0x186f92||[];var _0x2ca37e=[];if(_0x186f92){for(var _0x2d1846=0x0;_0x2d1846<_0x186f92[_0xb71a('0x45')];_0x2d1846+=0x1){var _0x377810=_0x186f92[_0x2d1846][_0xb71a('0x2b')]({'plain':!![]});_0x5c0bf6[_0xb71a('0xa0')]=_0x597bf9[_0xb71a('0x61')][_0xb71a('0xa0')]?_0x597bf9[_0xb71a('0x61')][_0xb71a('0xa0')]:_0x5c0bf6[_0xb71a('0xa0')];switch(_0x5c0bf6[_0xb71a('0xa0')]){case _0xb71a('0xa1'):_0x9eeafc=squel[_0xb71a('0xa2')]()[_0xb71a('0xa3')](_0xb71a('0xa4'))[_0xb71a('0xa5')]([_0xb71a('0xa6'),_0xb71a('0xa7'),_0xb71a('0xa8'),_0xb71a('0xa9'),_0xb71a('0x66'),_0xb71a('0x5e'),_0xb71a('0x5f')],squel['select']()[_0xb71a('0x81')](_0xb71a('0xa6'),_0xb71a('0xa6'))[_0xb71a('0x81')]('\x27'+_0x26f89f+'\x27','scheduledAt')['field']('id',_0xb71a('0xa8'))[_0xb71a('0x81')](_0x377810['CmListId'][_0xb71a('0x8b')](),_0xb71a('0xa9'))[_0xb71a('0x81')](_0x597bf9[_0xb71a('0x54')]['id'][_0xb71a('0x8b')](),_0xb71a('0x66'))[_0xb71a('0x81')]('\x27'+_0x26f89f+'\x27','createdAt')[_0xb71a('0x81')]('\x27'+_0x26f89f+'\x27',_0xb71a('0x5f'))[_0xb71a('0x83')]('cm_contacts')[_0xb71a('0x4a')](_0xb71a('0xaa'))[_0xb71a('0x4a')](_0xb71a('0xab'),_0x377810[_0xb71a('0xac')][_0xb71a('0x8b')]())[_0xb71a('0x4a')](_0xb71a('0xad'))[_0xb71a('0x4a')](_0xb71a('0xae'),squel[_0xb71a('0x80')]()[_0xb71a('0x81')](_0xb71a('0xaf'))['from'](_0xb71a('0xb0'))['where'](_0xb71a('0x86'),_0x597bf9['params']['id'][_0xb71a('0x8b')]()))[_0xb71a('0x4a')]('phone\x20NOT\x20IN\x20(?)',squel[_0xb71a('0x80')]()[_0xb71a('0x81')](_0xb71a('0xb1'))['from']('cm_hopper')[_0xb71a('0x4a')](_0xb71a('0x86'),_0x597bf9[_0xb71a('0x54')]['id'][_0xb71a('0x8b')]())))[_0xb71a('0x8b')]();break;case'onlyIfOpen':_0x9eeafc=squel[_0xb71a('0xa2')]()[_0xb71a('0xa3')](_0xb71a('0xa4'))[_0xb71a('0xa5')]([_0xb71a('0xa6'),_0xb71a('0xa7'),_0xb71a('0xa8'),_0xb71a('0xa9'),_0xb71a('0x66'),_0xb71a('0x5e'),_0xb71a('0x5f')],squel[_0xb71a('0x80')]()[_0xb71a('0x81')](_0xb71a('0xa6'),_0xb71a('0xa6'))['field']('\x27'+_0x26f89f+'\x27',_0xb71a('0xa7'))[_0xb71a('0x81')]('id',_0xb71a('0xa8'))[_0xb71a('0x81')](_0x377810[_0xb71a('0xac')]['toString'](),_0xb71a('0xa9'))[_0xb71a('0x81')](_0x597bf9[_0xb71a('0x54')]['id'][_0xb71a('0x8b')](),_0xb71a('0x66'))['field']('\x27'+_0x26f89f+'\x27','createdAt')[_0xb71a('0x81')]('\x27'+_0x26f89f+'\x27',_0xb71a('0x5f'))[_0xb71a('0x83')](_0xb71a('0xb2'))['where'](_0xb71a('0xaa'))[_0xb71a('0x4a')]('ListId\x20=\x20?',_0x377810[_0xb71a('0xac')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xb71a('0x81')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')['where'](_0xb71a('0x86'),_0x597bf9['params']['id']['toString']())))['toString']();break;default:_0x9eeafc=squel[_0xb71a('0xa2')]()['into'](_0xb71a('0xa4'))[_0xb71a('0xa5')]([_0xb71a('0xa6'),_0xb71a('0xa7'),_0xb71a('0xa8'),'ListId',_0xb71a('0x66'),_0xb71a('0x5e'),_0xb71a('0x5f')],squel[_0xb71a('0x80')]()[_0xb71a('0x81')](_0xb71a('0xa6'),_0xb71a('0xa6'))[_0xb71a('0x81')]('\x27'+_0x26f89f+'\x27','scheduledAt')[_0xb71a('0x81')]('id',_0xb71a('0xa8'))['field'](_0x377810[_0xb71a('0xac')][_0xb71a('0x8b')](),_0xb71a('0xa9'))['field'](_0x597bf9[_0xb71a('0x54')]['id'][_0xb71a('0x8b')](),_0xb71a('0x66'))[_0xb71a('0x81')]('\x27'+_0x26f89f+'\x27',_0xb71a('0x5e'))[_0xb71a('0x81')]('\x27'+_0x26f89f+'\x27',_0xb71a('0x5f'))['from'](_0xb71a('0xb2'))['where'](_0xb71a('0xaa'))['where']('ListId\x20=\x20?',_0x377810[_0xb71a('0xac')]['toString']())[_0xb71a('0x4a')](_0xb71a('0xad')))[_0xb71a('0x8b')]();}_0x2ca37e[_0xb71a('0x89')](db['sequelize']['query'](_0x9eeafc));}return BPromise[_0xb71a('0x98')](_0x2ca37e);}})['then'](function(){var _0x155523=[];var _0x44f6f0=squel[_0xb71a('0xa2')]()[_0xb71a('0xa3')](_0xb71a('0xb3'))[_0xb71a('0xa5')]([_0xb71a('0xb4'),_0xb71a('0xa6'),_0xb71a('0xb5'),_0xb71a('0x5e'),_0xb71a('0x5f')],squel['select']()[_0xb71a('0x81')](_0xb71a('0xb6'))['field'](_0xb71a('0xb7'))[_0xb71a('0x81')](_0xb71a('0xb8'))[_0xb71a('0x81')]('\x27'+_0x26f89f+'\x27',_0xb71a('0x5e'))[_0xb71a('0x81')]('\x27'+_0x26f89f+'\x27',_0xb71a('0x5f'))[_0xb71a('0x83')](_0xb71a('0xb9'),'ci')['join']('cm_hopper','h','h.ContactId=ci.CmContactId')[_0xb71a('0x4a')](_0xb71a('0xba'),_0x26f89f)[_0xb71a('0x4a')](_0xb71a('0xbb'),_0xb71a('0xbc')))[_0xb71a('0x8b')]();_0x155523['push'](db[_0xb71a('0x8a')][_0xb71a('0x3e')](_0x44f6f0));return BPromise['all'](_0x155523);})['then'](function(){return _0x45a458;})['then'](respondWithResult(_0x134dab,null))[_0xb71a('0x5b')](handleError(_0x134dab,null));};exports['removeLists']=function(_0x4bd873,_0x2081ae,_0x4e594f){return db['VoiceQueue'][_0xb71a('0x55')]({'where':{'id':_0x4bd873[_0xb71a('0x54')]['id']}})[_0xb71a('0x29')](handleEntityNotFound(_0x2081ae,null))[_0xb71a('0x29')](function(_0x475e66){if(_0x475e66){return _0x475e66[_0xb71a('0xbd')](_0x4bd873[_0xb71a('0x3e')][_0xb71a('0x7e')]);}})['then'](function(_0xe1b46a){if(_0xe1b46a){return db[_0xb71a('0x65')][_0xb71a('0x2a')]({'where':{'ListId':_0x4bd873['query'][_0xb71a('0x7e')],'VoiceQueueId':_0x4bd873[_0xb71a('0x54')]['id']}})[_0xb71a('0x29')](function(){return _0xe1b46a;});}})[_0xb71a('0x29')](respondWithStatusCode(_0x2081ae,null))[_0xb71a('0x5b')](handleError(_0x2081ae,null));};exports[_0xb71a('0xbe')]=function(_0x1824b3,_0x4fec8c,_0x3d44e8){var _0x503fd3={};var _0x2cbda4={};var _0x1ee107;var _0x5b50d0;return db[_0xb71a('0x3a')][_0xb71a('0x64')]({'where':{'id':_0x1824b3[_0xb71a('0x54')]['id']}})[_0xb71a('0x29')](handleEntityNotFound(_0x4fec8c,null))[_0xb71a('0x29')](function(_0x6df70f){if(_0x6df70f){_0x1ee107=_0x6df70f;_0x2cbda4[_0xb71a('0x41')]=_['keys'](db[_0xb71a('0x9d')]['rawAttributes']);_0x2cbda4[_0xb71a('0x3e')]=_['keys'](_0x1824b3[_0xb71a('0x3e')]);_0x2cbda4[_0xb71a('0x40')]=_[_0xb71a('0x43')](_0x2cbda4['model'],_0x2cbda4[_0xb71a('0x3e')]);_0x503fd3[_0xb71a('0x42')]=_[_0xb71a('0x43')](_0x2cbda4[_0xb71a('0x41')],qs[_0xb71a('0x44')](_0x1824b3[_0xb71a('0x3e')][_0xb71a('0x44')]));_0x503fd3[_0xb71a('0x42')]=_0x503fd3[_0xb71a('0x42')][_0xb71a('0x45')]?_0x503fd3[_0xb71a('0x42')]:_0x2cbda4[_0xb71a('0x41')];_0x503fd3[_0xb71a('0x48')]=qs[_0xb71a('0x49')](_0x1824b3[_0xb71a('0x3e')][_0xb71a('0x49')]);_0x503fd3[_0xb71a('0x4a')]=qs[_0xb71a('0x40')](_[_0xb71a('0x4b')](_0x1824b3[_0xb71a('0x3e')],_0x2cbda4[_0xb71a('0x40')]));if(_0x1824b3['query'][_0xb71a('0x2f')]){_0x503fd3[_0xb71a('0x4a')]=_['merge'](_0x503fd3[_0xb71a('0x4a')],{'$or':_[_0xb71a('0x31')](_0x503fd3[_0xb71a('0x42')],function(_0x40e431){var _0x41a42d={};_0x41a42d[_0x40e431]={'$like':'%'+_0x1824b3[_0xb71a('0x3e')]['filter']+'%'};return _0x41a42d;})});}_0x503fd3=_['merge']({},_0x503fd3,_0x1824b3[_0xb71a('0x4e')]);return _0x1ee107['getBlackLists'](_0x503fd3);}})[_0xb71a('0x29')](function(_0xfeae17){if(_0xfeae17){_0x5b50d0=_0xfeae17[_0xb71a('0x45')];if(!_0x1824b3['query']['hasOwnProperty'](_0xb71a('0x47'))){_0x503fd3[_0xb71a('0x21')]=qs['limit'](_0x1824b3[_0xb71a('0x3e')][_0xb71a('0x21')]);_0x503fd3[_0xb71a('0x1f')]=qs[_0xb71a('0x1f')](_0x1824b3[_0xb71a('0x3e')][_0xb71a('0x1f')]);}return _0x1ee107[_0xb71a('0xbe')](_0x503fd3);}})[_0xb71a('0x29')](function(_0x23ce90){if(_0x23ce90){return _0x23ce90?{'count':_0x5b50d0,'rows':_0x23ce90}:null;}})[_0xb71a('0x29')](respondWithResult(_0x4fec8c,null))['catch'](handleError(_0x4fec8c,null));};exports[_0xb71a('0xbf')]=function(_0x1726fa,_0x379812,_0x42ddcc){var _0x25b4e0,_0x149b4c;return db[_0xb71a('0x3a')][_0xb71a('0x55')]({'where':{'id':_0x1726fa[_0xb71a('0x54')]['id']}})[_0xb71a('0x29')](handleEntityNotFound(_0x379812,null))[_0xb71a('0x29')](function(_0x1a0615){if(_0x1a0615){_0x149b4c=_0x1a0615;return _0x1a0615['addBlackLists'](_0x1726fa['body']['ids'],_[_0xb71a('0x60')](_0x1726fa[_0xb71a('0x61')],['ids','id'])||{});}return null;})[_0xb71a('0x95')](function(_0x58ae6d){var _0x490ff3;_0x25b4e0=_0x58ae6d||[];var _0x672c6c=[];if(_0x58ae6d){for(var _0x3757ba=0x0;_0x3757ba<_0x58ae6d[_0xb71a('0x45')];_0x3757ba+=0x1){var _0x70512f=_0x58ae6d[_0x3757ba][_0xb71a('0x2b')]({'plain':!![]});_0x490ff3=squel[_0xb71a('0xa2')]()[_0xb71a('0xa3')](_0xb71a('0xc0'))[_0xb71a('0xa5')]([_0xb71a('0xa6'),_0xb71a('0xa8'),_0xb71a('0xa9'),_0xb71a('0x66'),_0xb71a('0x5e'),_0xb71a('0x5f')],squel[_0xb71a('0x80')]()[_0xb71a('0x81')](_0xb71a('0xa6'),_0xb71a('0xa6'))[_0xb71a('0x81')]('id',_0xb71a('0xa8'))[_0xb71a('0x81')](_0x70512f[_0xb71a('0xac')][_0xb71a('0x8b')](),_0xb71a('0xa9'))[_0xb71a('0x81')](_0x1726fa[_0xb71a('0x54')]['id'][_0xb71a('0x8b')](),'VoiceQueueId')['field'](_0xb71a('0xc1'),_0xb71a('0x5e'))[_0xb71a('0x81')](_0xb71a('0xc1'),'updatedAt')['from'](_0xb71a('0xb2'))['where'](_0xb71a('0xaa'))['where'](_0xb71a('0xab'),_0x70512f[_0xb71a('0xac')]['toString']())[_0xb71a('0x4a')](_0xb71a('0xad')))[_0xb71a('0x8b')]();_0x672c6c[_0xb71a('0x89')](db[_0xb71a('0x8a')][_0xb71a('0x3e')](_0x490ff3));}return BPromise['all'](_0x672c6c);}})[_0xb71a('0x29')](function(){return _0x25b4e0;})[_0xb71a('0x29')](respondWithResult(_0x379812,null))[_0xb71a('0x5b')](handleError(_0x379812,null));};exports['removeBlackLists']=function(_0x3f371d,_0xfb020,_0x2753bd){return db[_0xb71a('0x3a')][_0xb71a('0x55')]({'where':{'id':_0x3f371d[_0xb71a('0x54')]['id']}})[_0xb71a('0x29')](handleEntityNotFound(_0xfb020,null))[_0xb71a('0x29')](function(_0x7e78fa){if(_0x7e78fa){return _0x7e78fa[_0xb71a('0xc2')](_0x3f371d[_0xb71a('0x3e')][_0xb71a('0x7e')]);}})['then'](function(_0x1299d8){if(_0x1299d8){return db[_0xb71a('0x69')][_0xb71a('0x2a')]({'where':{'ListId':_0x3f371d[_0xb71a('0x3e')]['ids'],'VoiceQueueId':_0x3f371d[_0xb71a('0x54')]['id']}})[_0xb71a('0x29')](function(){return _0x1299d8;});}})[_0xb71a('0x29')](respondWithStatusCode(_0xfb020,null))['catch'](handleError(_0xfb020,null));};
\ No newline at end of file
+var _0xf072=['voicePause','emit','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','join','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','push','toString','SELECT','TeamId','all','union','compact','transaction','isEmpty','userVoiceQueue:remove','addAgents','spread','isNil','SIP/%s','removeAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','phone','CmListId','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','into','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','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','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','status','json','undefined','count','offset','Content-Range','apply','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','name','error','stack','send','index','fieldName','query','keys','filters','intersection','fields','attributes','model','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','VoiceQueue','includeAll','include','findAll','catch','params','length','find','create','role','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rawAttributes','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','findOne','CmHopper','rows','getHopperHistories','CmHopperHistory','hasOwnProperty','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','teams','User','Agents','online','interface','flatMap','forEach','penalty','sequelize','addTeams','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','format'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xf072,0x1cf));var _0x2f07=function(_0x5778a8,_0x189f9d){_0x5778a8=_0x5778a8-0x0;var _0x5cc6ae=_0xf072[_0x5778a8];return _0x5cc6ae;};'use strict';var emlformat=require(_0x2f07('0x0'));var rimraf=require(_0x2f07('0x1'));var zipdir=require(_0x2f07('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2f07('0x3'));var moment=require('moment');var BPromise=require(_0x2f07('0x4'));var Mustache=require(_0x2f07('0x5'));var util=require(_0x2f07('0x6'));var path=require('path');var sox=require(_0x2f07('0x7'));var csv=require(_0x2f07('0x8'));var ejs=require(_0x2f07('0x9'));var fs=require('fs');var fs_extra=require(_0x2f07('0xa'));var _=require(_0x2f07('0xb'));var squel=require(_0x2f07('0xc'));var crypto=require(_0x2f07('0xd'));var jsforce=require(_0x2f07('0xe'));var deskjs=require(_0x2f07('0xf'));var toCsv=require(_0x2f07('0x8'));var querystring=require(_0x2f07('0x10'));var Papa=require(_0x2f07('0x11'));var Redis=require(_0x2f07('0x12'));var authService=require(_0x2f07('0x13'));var qs=require(_0x2f07('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2f07('0x15'));var logger=require(_0x2f07('0x16'))(_0x2f07('0x17'));var utils=require(_0x2f07('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2f07('0x19'))['db'];config[_0x2f07('0x1a')]=_['defaults'](config[_0x2f07('0x1a')],{'host':_0x2f07('0x1b'),'port':0x18eb});var socket=require(_0x2f07('0x1c'))(new Redis(config['redis']));require(_0x2f07('0x1d'))[_0x2f07('0x1e')](socket);function respondWithStatusCode(_0x3596ea,_0xe2ffb7){_0xe2ffb7=_0xe2ffb7||0xcc;return function(_0x254dbb){if(_0x254dbb){return _0x3596ea[_0x2f07('0x1f')](_0xe2ffb7);}return _0x3596ea['status'](_0xe2ffb7)[_0x2f07('0x20')]();};}function respondWithResult(_0x5a7b5c,_0x2232a4){_0x2232a4=_0x2232a4||0xc8;return function(_0xe8cf4d){if(_0xe8cf4d){return _0x5a7b5c[_0x2f07('0x21')](_0x2232a4)[_0x2f07('0x22')](_0xe8cf4d);}};}function respondWithFilteredResult(_0x1ec70d,_0x46c9b4){return function(_0x1a6135){if(_0x1a6135){var _0xe3ed0=typeof _0x46c9b4['offset']===_0x2f07('0x23')&&typeof _0x46c9b4['limit']===_0x2f07('0x23');var _0x2df6ed=_0x1a6135[_0x2f07('0x24')];var _0xd944d6=_0xe3ed0?0x0:_0x46c9b4[_0x2f07('0x25')];var _0x5267e1=_0xe3ed0?_0x1a6135[_0x2f07('0x24')]:_0x46c9b4['offset']+_0x46c9b4['limit'];var _0x51ed43;if(_0x5267e1>=_0x2df6ed){_0x5267e1=_0x2df6ed;_0x51ed43=0xc8;}else{_0x51ed43=0xce;}_0x1ec70d[_0x2f07('0x21')](_0x51ed43);return _0x1ec70d['set'](_0x2f07('0x26'),_0xd944d6+'-'+_0x5267e1+'/'+_0x2df6ed)['json'](_0x1a6135);}return null;};}function patchUpdates(_0x354ee2){return function(_0x2c495f){try{jsonpatch[_0x2f07('0x27')](_0x2c495f,_0x354ee2,!![]);}catch(_0x307888){return BPromise['reject'](_0x307888);}return _0x2c495f[_0x2f07('0x28')]();};}function saveUpdates(_0x428d8c,_0x37c42a){return function(_0x5cfa32){if(_0x5cfa32){return _0x5cfa32[_0x2f07('0x29')](_0x428d8c)[_0x2f07('0x2a')](function(_0x522006){return _0x522006;});}return null;};}function removeEntity(_0x1dcedc,_0x1c9ca1){return function(_0x5d5898){if(_0x5d5898){return _0x5d5898[_0x2f07('0x2b')]()['then'](function(){var _0x894cd4=_0x5d5898[_0x2f07('0x2c')]({'plain':!![]});var _0x27bd72=[{'name':_0x2f07('0x2d'),'value':_0x2f07('0x2e'),'ignore':![]},{'name':_0x2f07('0x2f'),'value':_0x2f07('0x30'),'ignore':![]}];var _0xfc52cf=_(_0x27bd72)[_0x2f07('0x31')](_0x2f07('0x32'))[_0x2f07('0x33')](_0x2f07('0x34'))['value']();if(_[_0x2f07('0x35')](_0xfc52cf,_0x894cd4[_0x2f07('0x36')])){return;}var _0xada137=_['find'](_0x27bd72,[_0x2f07('0x34'),_0x894cd4[_0x2f07('0x36')]])[_0x2f07('0x37')];return db['UserProfileResource'][_0x2f07('0x2b')]({'where':{'type':_0xada137,'resourceId':_0x894cd4['id']}})[_0x2f07('0x2a')](function(){return _0x5d5898;});})[_0x2f07('0x2a')](function(){_0x1dcedc[_0x2f07('0x21')](0xcc)[_0x2f07('0x20')]();});}};}function handleEntityNotFound(_0x2e9a5d,_0x3fed73){return function(_0x5c7593){if(!_0x5c7593){_0x2e9a5d[_0x2f07('0x1f')](0x194);}return _0x5c7593;};}function handleError(_0x5b0407,_0x3496eb){_0x3496eb=_0x3496eb||0x1f4;return function(_0x5fd540){logger[_0x2f07('0x38')](_0x5fd540[_0x2f07('0x39')]);if(_0x5fd540[_0x2f07('0x37')]){delete _0x5fd540[_0x2f07('0x37')];}_0x5b0407[_0x2f07('0x21')](_0x3496eb)[_0x2f07('0x3a')](_0x5fd540);};}exports[_0x2f07('0x3b')]=function(_0x7baef5,_0x2fafba){var _0x2461cc={},_0xa74d2c={},_0x2cadb1={'count':0x0,'rows':[]};var _0x461155=_[_0x2f07('0x33')](db['VoiceQueue']['rawAttributes'],function(_0x3975cd){return{'name':_0x3975cd[_0x2f07('0x3c')],'type':_0x3975cd[_0x2f07('0x36')]['key']};});_0xa74d2c['model']=_[_0x2f07('0x33')](_0x461155,'name');_0xa74d2c[_0x2f07('0x3d')]=_[_0x2f07('0x3e')](_0x7baef5[_0x2f07('0x3d')]);_0xa74d2c[_0x2f07('0x3f')]=_[_0x2f07('0x40')](_0xa74d2c['model'],_0xa74d2c[_0x2f07('0x3d')]);_0x2461cc['attributes']=_[_0x2f07('0x40')](_0xa74d2c['model'],qs[_0x2f07('0x41')](_0x7baef5['query']['fields']));_0x2461cc[_0x2f07('0x42')]=_0x2461cc[_0x2f07('0x42')]['length']?_0x2461cc[_0x2f07('0x42')]:_0xa74d2c[_0x2f07('0x43')];if(!_0x7baef5[_0x2f07('0x3d')]['hasOwnProperty'](_0x2f07('0x44'))){_0x2461cc[_0x2f07('0x45')]=qs[_0x2f07('0x45')](_0x7baef5[_0x2f07('0x3d')][_0x2f07('0x45')]);_0x2461cc[_0x2f07('0x25')]=qs[_0x2f07('0x25')](_0x7baef5[_0x2f07('0x3d')]['offset']);}_0x2461cc[_0x2f07('0x46')]=qs[_0x2f07('0x47')](_0x7baef5[_0x2f07('0x3d')][_0x2f07('0x47')]);_0x2461cc[_0x2f07('0x48')]=qs[_0x2f07('0x3f')](_[_0x2f07('0x49')](_0x7baef5['query'],_0xa74d2c[_0x2f07('0x3f')]),_0x461155);if(_0x7baef5[_0x2f07('0x3d')][_0x2f07('0x31')]){_0x2461cc[_0x2f07('0x48')]=_[_0x2f07('0x4a')](_0x2461cc[_0x2f07('0x48')],{'$or':_['map'](_0x461155,function(_0x2361f2){if(_0x2361f2[_0x2f07('0x36')]!==_0x2f07('0x4b')){var _0x1dedbf={};_0x1dedbf[_0x2361f2['name']]={'$like':'%'+_0x7baef5['query'][_0x2f07('0x31')]+'%'};return _0x1dedbf;}})});}_0x2461cc=_[_0x2f07('0x4a')]({},_0x2461cc,_0x7baef5[_0x2f07('0x4c')]);var _0x1277f0={'where':_0x2461cc['where']};return db[_0x2f07('0x4d')][_0x2f07('0x24')](_0x1277f0)[_0x2f07('0x2a')](function(_0x4254f2){_0x2cadb1[_0x2f07('0x24')]=_0x4254f2;if(_0x7baef5[_0x2f07('0x3d')][_0x2f07('0x4e')]){_0x2461cc[_0x2f07('0x4f')]=[{'all':!![]}];}return db[_0x2f07('0x4d')][_0x2f07('0x50')](_0x2461cc);})['then'](function(_0x5f33b3){_0x2cadb1['rows']=_0x5f33b3;return _0x2cadb1;})[_0x2f07('0x2a')](respondWithFilteredResult(_0x2fafba,_0x2461cc))[_0x2f07('0x51')](handleError(_0x2fafba,null));};exports['show']=function(_0x97c166,_0x562b0f){var _0x3a7159={'raw':![],'where':{'id':_0x97c166[_0x2f07('0x52')]['id']}},_0x83d27a={};_0x83d27a['model']=_[_0x2f07('0x3e')](db[_0x2f07('0x4d')]['rawAttributes']);_0x83d27a['query']=_[_0x2f07('0x3e')](_0x97c166[_0x2f07('0x3d')]);_0x83d27a[_0x2f07('0x3f')]=_[_0x2f07('0x40')](_0x83d27a[_0x2f07('0x43')],_0x83d27a[_0x2f07('0x3d')]);_0x3a7159[_0x2f07('0x42')]=_[_0x2f07('0x40')](_0x83d27a[_0x2f07('0x43')],qs[_0x2f07('0x41')](_0x97c166[_0x2f07('0x3d')][_0x2f07('0x41')]));_0x3a7159[_0x2f07('0x42')]=_0x3a7159[_0x2f07('0x42')][_0x2f07('0x53')]?_0x3a7159[_0x2f07('0x42')]:_0x83d27a['model'];if(_0x97c166[_0x2f07('0x3d')][_0x2f07('0x4e')]){_0x3a7159[_0x2f07('0x4f')]=[{'all':!![]}];}_0x3a7159=_[_0x2f07('0x4a')]({},_0x3a7159,_0x97c166[_0x2f07('0x4c')]);return db[_0x2f07('0x4d')][_0x2f07('0x54')](_0x3a7159)[_0x2f07('0x2a')](handleEntityNotFound(_0x562b0f,null))[_0x2f07('0x2a')](respondWithResult(_0x562b0f,null))['catch'](handleError(_0x562b0f,null));};exports[_0x2f07('0x55')]=function(_0x231327,_0x1b6bec){return db[_0x2f07('0x4d')]['create'](_0x231327['body'],{})[_0x2f07('0x2a')](function(_0x282ef6){var _0x54225b=_0x231327['user'][_0x2f07('0x2c')]({'plain':!![]});if(!_0x54225b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54225b[_0x2f07('0x56')]===_0x2f07('0x57')){var _0x236e61=_0x282ef6[_0x2f07('0x2c')]({'plain':!![]});var _0x1c74b3=[{'name':_0x2f07('0x2d'),'value':_0x2f07('0x2e')},{'name':_0x2f07('0x2f'),'value':_0x2f07('0x30')}];var _0x3b381a=_['find'](_0x1c74b3,[_0x2f07('0x34'),_0x236e61[_0x2f07('0x36')]])[_0x2f07('0x37')];return db[_0x2f07('0x58')]['find']({'where':{'name':_0x3b381a,'userProfileId':_0x54225b[_0x2f07('0x59')]},'raw':!![]})['then'](function(_0x565f23){if(_0x565f23&&_0x565f23['autoAssociation']===0x0){return db[_0x2f07('0x5a')][_0x2f07('0x55')]({'name':_0x236e61[_0x2f07('0x37')],'resourceId':_0x236e61['id'],'type':_0x565f23[_0x2f07('0x37')],'sectionId':_0x565f23['id']},{})[_0x2f07('0x2a')](function(){return _0x282ef6;});}else{return _0x282ef6;}})['catch'](function(_0x13c1b0){logger[_0x2f07('0x38')](_0x2f07('0x5b'),_0x13c1b0);throw _0x13c1b0;});}return _0x282ef6;})['then'](respondWithResult(_0x1b6bec,0xc9))[_0x2f07('0x51')](handleError(_0x1b6bec,null));};exports['clone']=function(_0x64762c,_0x4c9b01){var _0x198ea6={'where':{'id':_0x64762c[_0x2f07('0x52')]['id']}},_0x3e7224={};_0x3e7224[_0x2f07('0x43')]=_[_0x2f07('0x3e')](db[_0x2f07('0x4d')][_0x2f07('0x5c')]);_0x198ea6[_0x2f07('0x42')]=_[_0x2f07('0x40')](_0x3e7224[_0x2f07('0x43')],qs['fields'](_0x64762c['query'][_0x2f07('0x41')]));_0x198ea6['attributes']=_0x198ea6['attributes']['length']?_0x198ea6['attributes']:_0x3e7224[_0x2f07('0x43')];if(_0x64762c['query'][_0x2f07('0x4e')]){_0x198ea6[_0x2f07('0x4f')]=[{'all':!![]}];}_0x198ea6=_[_0x2f07('0x4a')]({},_0x198ea6,_0x64762c[_0x2f07('0x4c')]);return db['VoiceQueue'][_0x2f07('0x54')](_0x198ea6)[_0x2f07('0x2a')](handleEntityNotFound(_0x4c9b01,null))[_0x2f07('0x2a')](function(_0x3eb1ea){if(_0x3eb1ea){var _0x482801=_0x3eb1ea[_0x2f07('0x2c')]({'plain':!![]});_0x482801=qs[_0x2f07('0x5d')](_0x482801,['id',_0x2f07('0x5e'),_0x2f07('0x5f')]);_0x64762c['body']=_[_0x2f07('0x5d')](_0x64762c[_0x2f07('0x60')],['id',_0x2f07('0x5e'),_0x2f07('0x5f')]);return db['VoiceQueue'][_0x2f07('0x55')](_['merge'](_0x482801,_0x64762c[_0x2f07('0x60')]),{'include':_0x64762c[_0x2f07('0x3d')][_0x2f07('0x4e')]?[{'all':!![]}]:undefined})[_0x2f07('0x2a')](function(_0x5990d5){var _0xadb6a3=_0x64762c[_0x2f07('0x57')]['get']({'plain':!![]});if(!_0xadb6a3)throw new Error(_0x2f07('0x61'));if(_0xadb6a3[_0x2f07('0x56')]==='user'){var _0x356473=_0x5990d5[_0x2f07('0x2c')]({'plain':!![]});var _0x40a8db=[{'name':'VoiceQueues','value':'inbound'},{'name':_0x2f07('0x2f'),'value':_0x2f07('0x30')}];var _0x5bd2e4=_[_0x2f07('0x54')](_0x40a8db,[_0x2f07('0x34'),_0x356473[_0x2f07('0x36')]])[_0x2f07('0x37')];return db[_0x2f07('0x58')][_0x2f07('0x54')]({'where':{'name':_0x5bd2e4,'userProfileId':_0xadb6a3[_0x2f07('0x59')]},'raw':!![]})[_0x2f07('0x2a')](function(_0x539065){if(_0x539065&&_0x539065['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x356473['name'],'resourceId':_0x356473['id'],'type':_0x539065['name'],'sectionId':_0x539065['id']},{})['then'](function(){return _0x5990d5;});}else{return _0x5990d5;}})[_0x2f07('0x51')](function(_0x46f607){logger[_0x2f07('0x38')](_0x2f07('0x5b'),_0x46f607);throw _0x46f607;});}return _0x5990d5;});}})['then'](respondWithResult(_0x4c9b01,0xc9))[_0x2f07('0x51')](handleError(_0x4c9b01,null));};exports[_0x2f07('0x29')]=function(_0x1e265a,_0x33365c){if(_0x1e265a['body']['id']){delete _0x1e265a[_0x2f07('0x60')]['id'];}return db[_0x2f07('0x4d')]['find']({'where':{'id':_0x1e265a['params']['id']}})['then'](handleEntityNotFound(_0x33365c,null))['then'](saveUpdates(_0x1e265a[_0x2f07('0x60')],null))[_0x2f07('0x2a')](respondWithResult(_0x33365c,null))[_0x2f07('0x51')](handleError(_0x33365c,null));};exports['destroy']=function(_0x250212,_0x3062fc){return db[_0x2f07('0x4d')][_0x2f07('0x54')]({'where':{'id':_0x250212[_0x2f07('0x52')]['id']}})[_0x2f07('0x2a')](handleEntityNotFound(_0x3062fc,null))[_0x2f07('0x2a')](removeEntity(_0x3062fc,null))[_0x2f07('0x51')](handleError(_0x3062fc,null));};exports['getHoppers']=function(_0x504c05,_0x417618,_0x1ab958){var _0x3031c0={'raw':![],'where':{}};var _0x2ee500={};var _0x5646b3={'count':0x0,'rows':[]};return db[_0x2f07('0x4d')][_0x2f07('0x62')]({'where':{'id':_0x504c05[_0x2f07('0x52')]['id']}})[_0x2f07('0x2a')](handleEntityNotFound(_0x417618,null))[_0x2f07('0x2a')](function(_0xfae3d){if(_0xfae3d){_0x2ee500['model']=_[_0x2f07('0x3e')](db[_0x2f07('0x63')][_0x2f07('0x5c')]);_0x2ee500[_0x2f07('0x3d')]=_[_0x2f07('0x3e')](_0x504c05['query']);_0x2ee500[_0x2f07('0x3f')]=_[_0x2f07('0x40')](_0x2ee500[_0x2f07('0x43')],_0x2ee500[_0x2f07('0x3d')]);_0x3031c0[_0x2f07('0x42')]=_[_0x2f07('0x40')](_0x2ee500['model'],qs[_0x2f07('0x41')](_0x504c05[_0x2f07('0x3d')]['fields']));_0x3031c0[_0x2f07('0x42')]=_0x3031c0[_0x2f07('0x42')][_0x2f07('0x53')]?_0x3031c0['attributes']:_0x2ee500[_0x2f07('0x43')];if(!_0x504c05[_0x2f07('0x3d')]['hasOwnProperty'](_0x2f07('0x44'))){_0x3031c0['limit']=qs[_0x2f07('0x45')](_0x504c05[_0x2f07('0x3d')][_0x2f07('0x45')]);_0x3031c0[_0x2f07('0x25')]=qs[_0x2f07('0x25')](_0x504c05[_0x2f07('0x3d')][_0x2f07('0x25')]);}_0x3031c0[_0x2f07('0x46')]=qs[_0x2f07('0x47')](_0x504c05['query'][_0x2f07('0x47')]);_0x3031c0[_0x2f07('0x48')]=qs[_0x2f07('0x3f')](_[_0x2f07('0x49')](_0x504c05[_0x2f07('0x3d')],_0x2ee500[_0x2f07('0x3f')]));_0x3031c0['where']['VoiceQueueId']=_0xfae3d['id'];if(_0x504c05[_0x2f07('0x3d')][_0x2f07('0x31')]){_0x3031c0[_0x2f07('0x48')]=_[_0x2f07('0x4a')](_0x3031c0['where'],{'$or':_[_0x2f07('0x33')](_0x3031c0['attributes'],function(_0x3b5cd5){var _0x5dfc86={};_0x5dfc86[_0x3b5cd5]={'$like':'%'+_0x504c05[_0x2f07('0x3d')][_0x2f07('0x31')]+'%'};return _0x5dfc86;})});}_0x3031c0=_[_0x2f07('0x4a')]({},_0x3031c0,_0x504c05[_0x2f07('0x4c')]);return db[_0x2f07('0x63')][_0x2f07('0x24')]({'where':_0x3031c0[_0x2f07('0x48')]})[_0x2f07('0x2a')](function(_0x2dea37){_0x5646b3[_0x2f07('0x24')]=_0x2dea37;if(_0x504c05['query'][_0x2f07('0x4e')]){_0x3031c0['include']=[{'all':!![]}];}return db[_0x2f07('0x63')][_0x2f07('0x50')](_0x3031c0);})[_0x2f07('0x2a')](function(_0x1da0ba){_0x5646b3[_0x2f07('0x64')]=_0x1da0ba;return _0x5646b3;});}})['then'](respondWithFilteredResult(_0x417618,_0x3031c0))[_0x2f07('0x51')](handleError(_0x417618,null));};exports[_0x2f07('0x65')]=function(_0xd4675,_0x515f43,_0x578f6e){var _0x5061f3={'raw':!![],'where':{}};var _0x50f150={};var _0xeb1e55={'count':0x0,'rows':[]};return db[_0x2f07('0x4d')][_0x2f07('0x62')]({'where':{'id':_0xd4675['params']['id']}})[_0x2f07('0x2a')](handleEntityNotFound(_0x515f43,null))[_0x2f07('0x2a')](function(_0x35f284){if(_0x35f284){_0x50f150[_0x2f07('0x43')]=_[_0x2f07('0x3e')](db[_0x2f07('0x66')][_0x2f07('0x5c')]);_0x50f150['query']=_[_0x2f07('0x3e')](_0xd4675['query']);_0x50f150[_0x2f07('0x3f')]=_[_0x2f07('0x40')](_0x50f150['model'],_0x50f150['query']);_0x5061f3[_0x2f07('0x42')]=_[_0x2f07('0x40')](_0x50f150[_0x2f07('0x43')],qs[_0x2f07('0x41')](_0xd4675[_0x2f07('0x3d')][_0x2f07('0x41')]));_0x5061f3[_0x2f07('0x42')]=_0x5061f3['attributes'][_0x2f07('0x53')]?_0x5061f3[_0x2f07('0x42')]:_0x50f150['model'];if(!_0xd4675['query'][_0x2f07('0x67')]('nolimit')){_0x5061f3['limit']=qs[_0x2f07('0x45')](_0xd4675[_0x2f07('0x3d')][_0x2f07('0x45')]);_0x5061f3[_0x2f07('0x25')]=qs['offset'](_0xd4675[_0x2f07('0x3d')][_0x2f07('0x25')]);}_0x5061f3[_0x2f07('0x46')]=qs['sort'](_0xd4675[_0x2f07('0x3d')][_0x2f07('0x47')]);_0x5061f3[_0x2f07('0x48')]=qs['filters'](_['pick'](_0xd4675[_0x2f07('0x3d')],_0x50f150[_0x2f07('0x3f')]));_0x5061f3[_0x2f07('0x48')][_0x2f07('0x68')]=_0x35f284['id'];if(_0xd4675[_0x2f07('0x3d')][_0x2f07('0x31')]){_0x5061f3[_0x2f07('0x48')]=_[_0x2f07('0x4a')](_0x5061f3[_0x2f07('0x48')],{'$or':_[_0x2f07('0x33')](_0x5061f3[_0x2f07('0x42')],function(_0xc2eb59){var _0x56a571={};_0x56a571[_0xc2eb59]={'$like':'%'+_0xd4675[_0x2f07('0x3d')][_0x2f07('0x31')]+'%'};return _0x56a571;})});}_0x5061f3=_[_0x2f07('0x4a')]({},_0x5061f3,_0xd4675[_0x2f07('0x4c')]);return db[_0x2f07('0x66')][_0x2f07('0x24')]({'where':_0x5061f3[_0x2f07('0x48')]})['then'](function(_0xf1dc56){_0xeb1e55[_0x2f07('0x24')]=_0xf1dc56;if(_0xd4675[_0x2f07('0x3d')][_0x2f07('0x4e')]){_0x5061f3[_0x2f07('0x4f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x2f07('0x50')](_0x5061f3);})[_0x2f07('0x2a')](function(_0x418fab){_0xeb1e55[_0x2f07('0x64')]=_0x418fab;return _0xeb1e55;});}})[_0x2f07('0x2a')](respondWithFilteredResult(_0x515f43,_0x5061f3))[_0x2f07('0x51')](handleError(_0x515f43,null));};exports[_0x2f07('0x69')]=function(_0x535ab6,_0x327b78,_0x2bb444){var _0x5260b0={'raw':!![],'where':{}};var _0x45d089={};var _0x51a952={'count':0x0,'rows':[]};return db[_0x2f07('0x4d')]['findOne']({'where':{'id':_0x535ab6[_0x2f07('0x52')]['id']}})[_0x2f07('0x2a')](handleEntityNotFound(_0x327b78,null))[_0x2f07('0x2a')](function(_0x2efeb7){if(_0x2efeb7){_0x45d089[_0x2f07('0x43')]=_['keys'](db[_0x2f07('0x6a')][_0x2f07('0x5c')]);_0x45d089[_0x2f07('0x3d')]=_[_0x2f07('0x3e')](_0x535ab6[_0x2f07('0x3d')]);_0x45d089[_0x2f07('0x3f')]=_[_0x2f07('0x40')](_0x45d089['model'],_0x45d089[_0x2f07('0x3d')]);_0x5260b0[_0x2f07('0x42')]=_[_0x2f07('0x40')](_0x45d089[_0x2f07('0x43')],qs[_0x2f07('0x41')](_0x535ab6[_0x2f07('0x3d')]['fields']));_0x5260b0[_0x2f07('0x42')]=_0x5260b0[_0x2f07('0x42')][_0x2f07('0x53')]?_0x5260b0[_0x2f07('0x42')]:_0x45d089[_0x2f07('0x43')];if(!_0x535ab6['query'][_0x2f07('0x67')]('nolimit')){_0x5260b0[_0x2f07('0x45')]=qs[_0x2f07('0x45')](_0x535ab6['query'][_0x2f07('0x45')]);_0x5260b0[_0x2f07('0x25')]=qs['offset'](_0x535ab6[_0x2f07('0x3d')][_0x2f07('0x25')]);}_0x5260b0['order']=qs[_0x2f07('0x47')](_0x535ab6[_0x2f07('0x3d')][_0x2f07('0x47')]);_0x5260b0[_0x2f07('0x48')]=qs['filters'](_[_0x2f07('0x49')](_0x535ab6['query'],_0x45d089[_0x2f07('0x3f')]));_0x5260b0[_0x2f07('0x48')][_0x2f07('0x68')]=_0x2efeb7['id'];if(_0x535ab6['query'][_0x2f07('0x31')]){_0x5260b0[_0x2f07('0x48')]=_[_0x2f07('0x4a')](_0x5260b0[_0x2f07('0x48')],{'$or':_['map'](_0x5260b0[_0x2f07('0x42')],function(_0x4e9206){var _0x1b4dfc={};_0x1b4dfc[_0x4e9206]={'$like':'%'+_0x535ab6['query'][_0x2f07('0x31')]+'%'};return _0x1b4dfc;})});}_0x5260b0=_['merge']({},_0x5260b0,_0x535ab6[_0x2f07('0x4c')]);return db[_0x2f07('0x6a')][_0x2f07('0x24')]({'where':_0x5260b0[_0x2f07('0x48')]})['then'](function(_0x1af136){_0x51a952[_0x2f07('0x24')]=_0x1af136;if(_0x535ab6['query']['includeAll']){_0x5260b0[_0x2f07('0x4f')]=[{'all':!![]}];}return db[_0x2f07('0x6a')][_0x2f07('0x50')](_0x5260b0);})[_0x2f07('0x2a')](function(_0x1d21c4){_0x51a952[_0x2f07('0x64')]=_0x1d21c4;return _0x51a952;});}})[_0x2f07('0x2a')](respondWithFilteredResult(_0x327b78,_0x5260b0))[_0x2f07('0x51')](handleError(_0x327b78,null));};exports[_0x2f07('0x6b')]=function(_0x5a6650,_0x440f8c,_0x558341){var _0x4f4243={'raw':!![],'where':{}};var _0x5bac6d={};var _0x573bd3={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x2f07('0x62')]({'where':{'id':_0x5a6650[_0x2f07('0x52')]['id']}})['then'](handleEntityNotFound(_0x440f8c,null))[_0x2f07('0x2a')](function(_0x4775e2){if(_0x4775e2){_0x5bac6d[_0x2f07('0x43')]=_['keys'](db['CmHopperBlack'][_0x2f07('0x5c')]);_0x5bac6d[_0x2f07('0x3d')]=_[_0x2f07('0x3e')](_0x5a6650[_0x2f07('0x3d')]);_0x5bac6d['filters']=_[_0x2f07('0x40')](_0x5bac6d['model'],_0x5bac6d[_0x2f07('0x3d')]);_0x4f4243[_0x2f07('0x42')]=_['intersection'](_0x5bac6d[_0x2f07('0x43')],qs['fields'](_0x5a6650['query'][_0x2f07('0x41')]));_0x4f4243[_0x2f07('0x42')]=_0x4f4243[_0x2f07('0x42')]['length']?_0x4f4243[_0x2f07('0x42')]:_0x5bac6d[_0x2f07('0x43')];if(!_0x5a6650['query'][_0x2f07('0x67')](_0x2f07('0x44'))){_0x4f4243[_0x2f07('0x45')]=qs['limit'](_0x5a6650[_0x2f07('0x3d')][_0x2f07('0x45')]);_0x4f4243[_0x2f07('0x25')]=qs['offset'](_0x5a6650[_0x2f07('0x3d')][_0x2f07('0x25')]);}_0x4f4243[_0x2f07('0x46')]=qs[_0x2f07('0x47')](_0x5a6650[_0x2f07('0x3d')][_0x2f07('0x47')]);_0x4f4243[_0x2f07('0x48')]=qs[_0x2f07('0x3f')](_[_0x2f07('0x49')](_0x5a6650[_0x2f07('0x3d')],_0x5bac6d[_0x2f07('0x3f')]));_0x4f4243[_0x2f07('0x48')][_0x2f07('0x68')]=_0x4775e2['id'];if(_0x5a6650['query'][_0x2f07('0x31')]){_0x4f4243[_0x2f07('0x48')]=_[_0x2f07('0x4a')](_0x4f4243[_0x2f07('0x48')],{'$or':_[_0x2f07('0x33')](_0x4f4243[_0x2f07('0x42')],function(_0x2074ce){var _0x5a2fd4={};_0x5a2fd4[_0x2074ce]={'$like':'%'+_0x5a6650[_0x2f07('0x3d')]['filter']+'%'};return _0x5a2fd4;})});}_0x4f4243=_['merge']({},_0x4f4243,_0x5a6650[_0x2f07('0x4c')]);return db[_0x2f07('0x6c')][_0x2f07('0x24')]({'where':_0x4f4243[_0x2f07('0x48')]})[_0x2f07('0x2a')](function(_0x337bd6){_0x573bd3['count']=_0x337bd6;if(_0x5a6650[_0x2f07('0x3d')][_0x2f07('0x4e')]){_0x4f4243[_0x2f07('0x4f')]=[{'all':!![]}];}return db[_0x2f07('0x6c')][_0x2f07('0x50')](_0x4f4243);})[_0x2f07('0x2a')](function(_0x1e3616){_0x573bd3['rows']=_0x1e3616;return _0x573bd3;});}})[_0x2f07('0x2a')](respondWithFilteredResult(_0x440f8c,_0x4f4243))['catch'](handleError(_0x440f8c,null));};exports[_0x2f07('0x6d')]=function(_0x4f21d4,_0x268bd3,_0x22265e){var _0x2a821f={};var _0x5bb61e={};var _0x15ed30;var _0x14f4c6;return db['VoiceQueue'][_0x2f07('0x62')]({'where':{'id':_0x4f21d4[_0x2f07('0x52')]['id']}})[_0x2f07('0x2a')](handleEntityNotFound(_0x268bd3,null))[_0x2f07('0x2a')](function(_0x4264cc){if(_0x4264cc){_0x15ed30=_0x4264cc;_0x5bb61e[_0x2f07('0x43')]=_['keys'](db[_0x2f07('0x6e')][_0x2f07('0x5c')]);_0x5bb61e[_0x2f07('0x3d')]=_[_0x2f07('0x3e')](_0x4f21d4[_0x2f07('0x3d')]);_0x5bb61e['filters']=_[_0x2f07('0x40')](_0x5bb61e[_0x2f07('0x43')],_0x5bb61e[_0x2f07('0x3d')]);_0x2a821f[_0x2f07('0x42')]=_[_0x2f07('0x40')](_0x5bb61e[_0x2f07('0x43')],qs['fields'](_0x4f21d4['query'][_0x2f07('0x41')]));_0x2a821f[_0x2f07('0x42')]=_0x2a821f['attributes'][_0x2f07('0x53')]?_0x2a821f[_0x2f07('0x42')]:_0x5bb61e[_0x2f07('0x43')];_0x2a821f[_0x2f07('0x46')]=qs[_0x2f07('0x47')](_0x4f21d4[_0x2f07('0x3d')]['sort']);_0x2a821f[_0x2f07('0x48')]=qs[_0x2f07('0x3f')](_[_0x2f07('0x49')](_0x4f21d4['query'],_0x5bb61e[_0x2f07('0x3f')]));if(_0x4f21d4['query'][_0x2f07('0x31')]){_0x2a821f['where']=_[_0x2f07('0x4a')](_0x2a821f['where'],{'$or':_[_0x2f07('0x33')](_0x2a821f['attributes'],function(_0x36afe7){var _0x378752={};_0x378752[_0x36afe7]={'$like':'%'+_0x4f21d4['query'][_0x2f07('0x31')]+'%'};return _0x378752;})});}_0x2a821f=_['merge']({},_0x2a821f,_0x4f21d4[_0x2f07('0x4c')]);return _0x15ed30[_0x2f07('0x6d')](_0x2a821f);}})['then'](function(_0x489bb4){if(_0x489bb4){_0x14f4c6=_0x489bb4['length'];if(!_0x4f21d4['query'][_0x2f07('0x67')]('nolimit')){_0x2a821f['limit']=qs['limit'](_0x4f21d4[_0x2f07('0x3d')][_0x2f07('0x45')]);_0x2a821f['offset']=qs[_0x2f07('0x25')](_0x4f21d4[_0x2f07('0x3d')][_0x2f07('0x25')]);}return _0x15ed30[_0x2f07('0x6d')](_0x2a821f);}})[_0x2f07('0x2a')](function(_0x3d796c){if(_0x3d796c){return _0x3d796c?{'count':_0x14f4c6,'rows':_0x3d796c}:null;}})[_0x2f07('0x2a')](respondWithResult(_0x268bd3,null))['catch'](handleError(_0x268bd3,null));};exports['addTeams']=function(_0x4720c8,_0x4a8eed,_0x20ae81){var _0x3df070=_0x4720c8[_0x2f07('0x60')][_0x2f07('0x6f')];var _0x5ad57f=_[_0x2f07('0x33')](_0x3df070,'id');return db['Team'][_0x2f07('0x50')]({'where':{'id':_0x5ad57f},'attributes':['id'],'include':[{'model':db[_0x2f07('0x70')],'as':_0x2f07('0x71'),'attributes':['id','name',_0x2f07('0x72'),'voicePause',_0x2f07('0x73')],'raw':!![]}]})[_0x2f07('0x2a')](function(_0x3e2280){if(_0x3e2280){var _0x4742de=_[_0x2f07('0x74')](_0x3e2280,function(_0x7e978b){var _0x3d2cc8=_0x7e978b['get']({'plain':!![]});_0x3d2cc8[_0x2f07('0x71')][_0x2f07('0x75')](function(_0x38b1d8){_0x38b1d8[_0x2f07('0x76')]=_[_0x2f07('0x54')](_0x3df070,{'id':_0x3d2cc8['id']})['penalty'];});return _0x3d2cc8['Agents'];});return db[_0x2f07('0x4d')][_0x2f07('0x54')]({'where':{'id':_0x4720c8[_0x2f07('0x52')]['id']}})['then'](function(_0x571fef){return db[_0x2f07('0x77')]['transaction'](function(_0x19560e){return _0x571fef[_0x2f07('0x78')](_0x5ad57f,{'transaction':_0x19560e})[_0x2f07('0x2a')](function(){return BPromise[_0x2f07('0x79')](_0x3df070,function(_0x57bb55){return db[_0x2f07('0x7a')][_0x2f07('0x7b')]({'TeamId':_0x57bb55['id'],'VoiceQueueId':_0x4720c8[_0x2f07('0x52')]['id'],'penalty':_0x57bb55[_0x2f07('0x76')]},{'transaction':_0x19560e});});})['then'](function(){return BPromise[_0x2f07('0x79')](_0x4742de,function(_0x2a5ec1){return db[_0x2f07('0x7c')][_0x2f07('0x7d')]({'where':{'UserId':_0x2a5ec1['id'],'VoiceQueueId':_0x4720c8[_0x2f07('0x52')]['id']},'defaults':{'penalty':_0x2a5ec1[_0x2f07('0x76')]},'transaction':_0x19560e});});})[_0x2f07('0x2a')](function(){return BPromise[_0x2f07('0x79')](_['filter'](_0x4742de,{'online':!![]}),function(_0x413edb){return db[_0x2f07('0x7e')][_0x2f07('0x7b')]({'membername':_0x413edb[_0x2f07('0x37')],'UserId':_0x413edb['id'],'queue_name':_0x571fef['name'],'VoiceQueueId':_0x571fef['id'],'interface':_['isNil'](_0x413edb[_0x2f07('0x73')])?util[_0x2f07('0x7f')]('SIP/%s',_0x413edb[_0x2f07('0x37')]):_0x413edb[_0x2f07('0x73')],'paused':_0x413edb[_0x2f07('0x80')]||![],'penalty':_0x413edb[_0x2f07('0x76')]},{'transaction':_0x19560e});});})[_0x2f07('0x2a')](function(){_0x4742de[_0x2f07('0x75')](function(_0x36cfe9){socket[_0x2f07('0x81')](_0x2f07('0x82'),{'UserId':_0x36cfe9['id'],'VoiceQueueId':_0x571fef['id']});});});});});}})['then'](respondWithStatusCode(_0x4a8eed,null))[_0x2f07('0x51')](handleError(_0x4a8eed,null));};exports[_0x2f07('0x83')]=function(_0x856a68,_0x3443e9,_0x1c8372){return db['Team'][_0x2f07('0x50')]({'where':{'id':_0x856a68[_0x2f07('0x3d')][_0x2f07('0x84')]},'attributes':['id'],'include':[{'model':db[_0x2f07('0x70')],'as':_0x2f07('0x71'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3443e9,null))[_0x2f07('0x2a')](function(_0x2ec246){var _0x231979=_[_0x2f07('0x33')](_0x2ec246,'id');var _0x2e0cc2=[];var _0x1060d4=[];var _0x57e70f=squel[_0x2f07('0x85')]();_0x57e70f[_0x2f07('0x86')](_0x2f07('0x87'))['from']('team_has_voice_queues','tq')[_0x2f07('0x88')]('user_has_teams','ut',_0x2f07('0x89'))['where'](_0x2f07('0x8a'),_0x856a68[_0x2f07('0x52')]['id']);for(var _0xbd4127=0x0;_0xbd4127<_0x2ec246['length'];_0xbd4127+=0x1){let _0x12a880=_0x2ec246[_0xbd4127];for(var _0x220b97=0x0;_0x220b97<_0x12a880[_0x2f07('0x71')][_0x2f07('0x53')];_0x220b97+=0x1){let _0x3a94fc=_0x12a880['Agents'][_0x220b97];var _0x58f454=_0x57e70f['clone']();_0x58f454[_0x2f07('0x48')]('ut.UserId\x20=\x20?',_0x3a94fc['id']);_0x1060d4[_0x2f07('0x8b')](db['sequelize'][_0x2f07('0x3d')](_0x58f454[_0x2f07('0x8c')](),{'type':db[_0x2f07('0x77')]['QueryTypes'][_0x2f07('0x8d')]})[_0x2f07('0x2a')](function(_0x1d4c57){if(_0x1d4c57['length']===0x1){return _0x3a94fc['id'];}else{var _0x100e8a=_['every'](_[_0x2f07('0x33')](_0x1d4c57,_0x2f07('0x8e')),function(_0x44a55c){return _[_0x2f07('0x35')](_0x231979,_0x44a55c);});if(_0x100e8a){return _0x3a94fc['id'];}}}));}}return BPromise[_0x2f07('0x8f')](_0x1060d4)[_0x2f07('0x2a')](function(_0x2eea15){_0x2e0cc2=_(_0x2e0cc2)[_0x2f07('0x90')](_0x2eea15)[_0x2f07('0x91')]()[_0x2f07('0x34')]();return db[_0x2f07('0x4d')]['find']({'where':{'id':_0x856a68[_0x2f07('0x52')]['id']}})['then'](function(_0x29f293){return db[_0x2f07('0x77')][_0x2f07('0x92')](function(_0x3f6ade){return _0x29f293[_0x2f07('0x83')](_0x856a68['query']['ids'],{'transaction':_0x3f6ade})[_0x2f07('0x2a')](function(){if(!_[_0x2f07('0x93')](_0x2e0cc2)){return _0x29f293['removeAgents'](_0x2e0cc2,{'transaction':_0x3f6ade})['then'](function(){return db[_0x2f07('0x7e')][_0x2f07('0x2b')]({'where':{'VoiceQueueId':_0x856a68[_0x2f07('0x52')]['id'],'UserId':_0x2e0cc2},'transaction':_0x3f6ade});});}})['then'](function(){_0x2e0cc2[_0x2f07('0x75')](function(_0x15d0f0){socket[_0x2f07('0x81')](_0x2f07('0x94'),{'UserId':_0x15d0f0,'VoiceQueueId':_0x29f293['id']});});});});});});})[_0x2f07('0x2a')](respondWithStatusCode(_0x3443e9,null))[_0x2f07('0x51')](handleError(_0x3443e9,null));};exports[_0x2f07('0x95')]=function(_0x300522,_0xc26f55,_0x4c169b){var _0x2400c8,_0x348fe3;return db[_0x2f07('0x4d')][_0x2f07('0x54')]({'where':{'id':_0x300522[_0x2f07('0x52')]['id']}})[_0x2f07('0x2a')](handleEntityNotFound(_0xc26f55,null))[_0x2f07('0x2a')](function(_0x87e122){if(_0x87e122){_0x348fe3=_0x87e122;return _0x87e122['addAgents'](_0x300522[_0x2f07('0x60')][_0x2f07('0x84')],_[_0x2f07('0x5d')](_0x300522[_0x2f07('0x60')],[_0x2f07('0x84'),'id'])||{})[_0x2f07('0x96')](function(_0x5903f8){for(var _0xeef344=0x0;_0xeef344<_0x300522[_0x2f07('0x60')][_0x2f07('0x84')][_0x2f07('0x53')];_0xeef344+=0x1){socket[_0x2f07('0x81')](_0x2f07('0x82'),{'UserId':Number(_0x300522[_0x2f07('0x60')][_0x2f07('0x84')][_0xeef344]),'VoiceQueueId':Number(_0x300522[_0x2f07('0x52')]['id'])});}return _0x5903f8;});}})[_0x2f07('0x2a')](function(_0x26d046){_0x2400c8=_0x26d046||[];if(_0x348fe3){return db[_0x2f07('0x70')][_0x2f07('0x50')]({'where':{'id':_0x300522[_0x2f07('0x60')]['ids']},'attributes':['id',_0x2f07('0x37'),_0x2f07('0x72'),_0x2f07('0x80'),_0x2f07('0x73')],'raw':!![]});}})[_0x2f07('0x2a')](function(_0x185316){if(!_[_0x2f07('0x93')](_0x185316)){var _0x1d273b=[];for(var _0x2b432c=0x0;_0x2b432c<_0x185316[_0x2f07('0x53')];_0x2b432c++){if(_0x185316[_0x2b432c]['online']){_0x1d273b[_0x2f07('0x8b')](db[_0x2f07('0x7e')]['upsert']({'membername':_0x185316[_0x2b432c][_0x2f07('0x37')],'UserId':_0x185316[_0x2b432c]['id'],'queue_name':_0x348fe3[_0x2f07('0x37')],'VoiceQueueId':_0x348fe3['id'],'interface':_[_0x2f07('0x97')](_0x185316[_0x2b432c][_0x2f07('0x73')])?util[_0x2f07('0x7f')](_0x2f07('0x98'),_0x185316[_0x2b432c][_0x2f07('0x37')]):_0x185316[_0x2b432c][_0x2f07('0x73')],'paused':_0x185316[_0x2b432c][_0x2f07('0x80')]||![],'penalty':_0x300522[_0x2f07('0x60')]['penalty']||0x0}));}}return BPromise[_0x2f07('0x8f')](_0x1d273b);}})[_0x2f07('0x2a')](function(){return _0x2400c8;})[_0x2f07('0x2a')](respondWithResult(_0xc26f55,null))[_0x2f07('0x51')](handleError(_0xc26f55,null));};exports[_0x2f07('0x99')]=function(_0x2aee07,_0x1b491f,_0x46685d){return db[_0x2f07('0x4d')][_0x2f07('0x54')]({'where':{'id':_0x2aee07[_0x2f07('0x52')]['id']}})['then'](handleEntityNotFound(_0x1b491f,null))[_0x2f07('0x2a')](function(_0x68f732){if(_0x68f732){return _0x68f732[_0x2f07('0x99')](_0x2aee07[_0x2f07('0x3d')][_0x2f07('0x84')])[_0x2f07('0x2a')](function(){if(_[_0x2f07('0x9a')](_0x2aee07[_0x2f07('0x3d')]['ids'])){for(var _0x412e01=0x0;_0x412e01<_0x2aee07[_0x2f07('0x3d')]['ids'][_0x2f07('0x53')];_0x412e01+=0x1){socket[_0x2f07('0x81')](_0x2f07('0x94'),{'UserId':Number(_0x2aee07[_0x2f07('0x3d')][_0x2f07('0x84')][_0x412e01]),'VoiceQueueId':Number(_0x2aee07[_0x2f07('0x52')]['id'])});}}else{socket[_0x2f07('0x81')](_0x2f07('0x94'),{'UserId':Number(_0x2aee07[_0x2f07('0x3d')][_0x2f07('0x84')]),'VoiceQueueId':Number(_0x2aee07['params']['id'])});}});}})[_0x2f07('0x2a')](function(_0x3a76a3){return db[_0x2f07('0x7e')][_0x2f07('0x2b')]({'where':{'VoiceQueueId':_0x2aee07['params']['id'],'UserId':_0x2aee07[_0x2f07('0x3d')][_0x2f07('0x84')]}})[_0x2f07('0x2a')](function(){return _0x3a76a3;});})[_0x2f07('0x2a')](respondWithStatusCode(_0x1b491f,null))[_0x2f07('0x51')](handleError(_0x1b491f,null));};exports[_0x2f07('0x9b')]=function(_0x1e1d51,_0x3b6add,_0x501105){var _0x5005ef={};var _0x20f9bb={};var _0x39fe9a;var _0x3b4021;return db[_0x2f07('0x4d')][_0x2f07('0x62')]({'where':{'id':_0x1e1d51[_0x2f07('0x52')]['id']}})[_0x2f07('0x2a')](handleEntityNotFound(_0x3b6add,null))['then'](function(_0x47392a){if(_0x47392a){_0x39fe9a=_0x47392a;_0x20f9bb[_0x2f07('0x43')]=_['keys'](db['User']['rawAttributes']);_0x20f9bb[_0x2f07('0x3d')]=_[_0x2f07('0x3e')](_0x1e1d51[_0x2f07('0x3d')]);_0x20f9bb[_0x2f07('0x3f')]=_[_0x2f07('0x40')](_0x20f9bb[_0x2f07('0x43')],_0x20f9bb[_0x2f07('0x3d')]);_0x5005ef['attributes']=_[_0x2f07('0x40')](_0x20f9bb['model'],qs[_0x2f07('0x41')](_0x1e1d51[_0x2f07('0x3d')][_0x2f07('0x41')]));_0x5005ef[_0x2f07('0x42')]=_0x5005ef[_0x2f07('0x42')][_0x2f07('0x53')]?_0x5005ef[_0x2f07('0x42')]:_0x20f9bb[_0x2f07('0x43')];_0x5005ef['order']=qs['sort'](_0x1e1d51['query'][_0x2f07('0x47')]);_0x5005ef[_0x2f07('0x48')]=qs['filters'](_[_0x2f07('0x49')](_0x1e1d51[_0x2f07('0x3d')],_0x20f9bb[_0x2f07('0x3f')]));if(_0x1e1d51[_0x2f07('0x3d')][_0x2f07('0x31')]){_0x5005ef['where']=_[_0x2f07('0x4a')](_0x5005ef[_0x2f07('0x48')],{'$or':_[_0x2f07('0x33')](_0x5005ef['attributes'],function(_0x2e3b92){var _0x5603e2={};_0x5603e2[_0x2e3b92]={'$like':'%'+_0x1e1d51[_0x2f07('0x3d')]['filter']+'%'};return _0x5603e2;})});}_0x5005ef=_[_0x2f07('0x4a')]({},_0x5005ef,_0x1e1d51[_0x2f07('0x4c')]);return _0x39fe9a[_0x2f07('0x9b')](_0x5005ef);}})[_0x2f07('0x2a')](function(_0x1fd2f0){if(_0x1fd2f0){_0x3b4021=_0x1fd2f0[_0x2f07('0x53')];if(!_0x1e1d51[_0x2f07('0x3d')]['hasOwnProperty'](_0x2f07('0x44'))){_0x5005ef[_0x2f07('0x45')]=qs['limit'](_0x1e1d51[_0x2f07('0x3d')][_0x2f07('0x45')]);_0x5005ef[_0x2f07('0x25')]=qs[_0x2f07('0x25')](_0x1e1d51['query'][_0x2f07('0x25')]);}return _0x39fe9a[_0x2f07('0x9b')](_0x5005ef);}})['then'](function(_0x3954e3){if(_0x3954e3){return _0x3954e3?{'count':_0x3b4021,'rows':_0x3954e3}:null;}})[_0x2f07('0x2a')](respondWithResult(_0x3b6add,null))[_0x2f07('0x51')](handleError(_0x3b6add,null));};exports[_0x2f07('0x9c')]=function(_0x3391a2,_0x305013,_0xf31736){var _0xc382f2={};var _0x17e916={};var _0x2ce48a;var _0x2c79c7;return db[_0x2f07('0x4d')][_0x2f07('0x62')]({'where':{'id':_0x3391a2[_0x2f07('0x52')]['id']}})[_0x2f07('0x2a')](handleEntityNotFound(_0x305013,null))[_0x2f07('0x2a')](function(_0x546a7f){if(_0x546a7f){_0x2ce48a=_0x546a7f;_0x17e916[_0x2f07('0x43')]=_[_0x2f07('0x3e')](db[_0x2f07('0x7e')][_0x2f07('0x5c')]);_0x17e916['query']=_[_0x2f07('0x3e')](_0x3391a2[_0x2f07('0x3d')]);_0x17e916[_0x2f07('0x3f')]=_['intersection'](_0x17e916['model'],_0x17e916['query']);_0xc382f2[_0x2f07('0x42')]=_['intersection'](_0x17e916[_0x2f07('0x43')],qs[_0x2f07('0x41')](_0x3391a2[_0x2f07('0x3d')][_0x2f07('0x41')]));_0xc382f2[_0x2f07('0x42')]=_0xc382f2[_0x2f07('0x42')][_0x2f07('0x53')]?_0xc382f2[_0x2f07('0x42')]:_0x17e916['model'];_0xc382f2[_0x2f07('0x46')]=qs[_0x2f07('0x47')](_0x3391a2[_0x2f07('0x3d')][_0x2f07('0x47')]);_0xc382f2['where']=qs[_0x2f07('0x3f')](_['pick'](_0x3391a2['query'],_0x17e916[_0x2f07('0x3f')]));if(_0x3391a2[_0x2f07('0x3d')][_0x2f07('0x31')]){_0xc382f2[_0x2f07('0x48')]=_[_0x2f07('0x4a')](_0xc382f2[_0x2f07('0x48')],{'$or':_[_0x2f07('0x33')](_0xc382f2[_0x2f07('0x42')],function(_0x28bcb3){var _0x22c095={};_0x22c095[_0x28bcb3]={'$like':'%'+_0x3391a2[_0x2f07('0x3d')]['filter']+'%'};return _0x22c095;})});}_0xc382f2=_['merge']({},_0xc382f2,_0x3391a2[_0x2f07('0x4c')]);return _0x2ce48a['getMembers'](_0xc382f2);}})[_0x2f07('0x2a')](function(_0x3f53dd){if(_0x3f53dd){_0x2c79c7=_0x3f53dd['length'];if(!_0x3391a2[_0x2f07('0x3d')][_0x2f07('0x67')](_0x2f07('0x44'))){_0xc382f2['limit']=qs[_0x2f07('0x45')](_0x3391a2[_0x2f07('0x3d')][_0x2f07('0x45')]);_0xc382f2[_0x2f07('0x25')]=qs[_0x2f07('0x25')](_0x3391a2[_0x2f07('0x3d')][_0x2f07('0x25')]);}return _0x2ce48a['getMembers'](_0xc382f2);}})[_0x2f07('0x2a')](function(_0x105a3d){return _0x105a3d?{'count':_0x2c79c7,'rows':_0x105a3d}:null;})[_0x2f07('0x2a')](respondWithResult(_0x305013,null))[_0x2f07('0x51')](handleError(_0x305013,null));};exports[_0x2f07('0x9d')]=function(_0xcad610,_0x396c8a,_0x79f713){var _0x438abe={};var _0x572ad9={};var _0x1baece;var _0x2d85e7;return db['VoiceQueue'][_0x2f07('0x62')]({'where':{'id':_0xcad610['params']['id']}})[_0x2f07('0x2a')](handleEntityNotFound(_0x396c8a,null))[_0x2f07('0x2a')](function(_0x5d3a63){if(_0x5d3a63){_0x1baece=_0x5d3a63;_0x572ad9['model']=_[_0x2f07('0x3e')](db[_0x2f07('0x9e')][_0x2f07('0x5c')]);_0x572ad9[_0x2f07('0x3d')]=_['keys'](_0xcad610[_0x2f07('0x3d')]);_0x572ad9[_0x2f07('0x3f')]=_[_0x2f07('0x40')](_0x572ad9[_0x2f07('0x43')],_0x572ad9[_0x2f07('0x3d')]);_0x438abe[_0x2f07('0x42')]=_[_0x2f07('0x40')](_0x572ad9[_0x2f07('0x43')],qs[_0x2f07('0x41')](_0xcad610[_0x2f07('0x3d')][_0x2f07('0x41')]));_0x438abe[_0x2f07('0x42')]=_0x438abe[_0x2f07('0x42')][_0x2f07('0x53')]?_0x438abe[_0x2f07('0x42')]:_0x572ad9[_0x2f07('0x43')];_0x438abe[_0x2f07('0x46')]=qs[_0x2f07('0x47')](_0xcad610[_0x2f07('0x3d')][_0x2f07('0x47')]);_0x438abe[_0x2f07('0x48')]=qs['filters'](_[_0x2f07('0x49')](_0xcad610['query'],_0x572ad9[_0x2f07('0x3f')]));if(_0xcad610[_0x2f07('0x3d')]['filter']){_0x438abe[_0x2f07('0x48')]=_[_0x2f07('0x4a')](_0x438abe[_0x2f07('0x48')],{'$or':_[_0x2f07('0x33')](_0x438abe[_0x2f07('0x42')],function(_0xd685b4){var _0x2ebfa5={};_0x2ebfa5[_0xd685b4]={'$like':'%'+_0xcad610[_0x2f07('0x3d')][_0x2f07('0x31')]+'%'};return _0x2ebfa5;})});}_0x438abe=_[_0x2f07('0x4a')]({},_0x438abe,_0xcad610[_0x2f07('0x4c')]);return _0x1baece[_0x2f07('0x9d')](_0x438abe);}})[_0x2f07('0x2a')](function(_0x4bbc29){if(_0x4bbc29){_0x2d85e7=_0x4bbc29[_0x2f07('0x53')];if(!_0xcad610[_0x2f07('0x3d')]['hasOwnProperty'](_0x2f07('0x44'))){_0x438abe[_0x2f07('0x45')]=qs[_0x2f07('0x45')](_0xcad610[_0x2f07('0x3d')]['limit']);_0x438abe['offset']=qs[_0x2f07('0x25')](_0xcad610[_0x2f07('0x3d')][_0x2f07('0x25')]);}return _0x1baece[_0x2f07('0x9d')](_0x438abe);}})[_0x2f07('0x2a')](function(_0x122d8b){if(_0x122d8b){return _0x122d8b?{'count':_0x2d85e7,'rows':_0x122d8b}:null;}})[_0x2f07('0x2a')](respondWithResult(_0x396c8a,null))[_0x2f07('0x51')](handleError(_0x396c8a,null));};exports[_0x2f07('0x9f')]=function(_0x2d2566,_0x1226ff,_0x52323e){var _0x330e23=moment()['format'](_0x2f07('0xa0'));var _0x4b70b4,_0x33b90f;return db[_0x2f07('0x4d')]['find']({'where':{'id':_0x2d2566[_0x2f07('0x52')]['id']}})[_0x2f07('0x2a')](handleEntityNotFound(_0x1226ff,null))[_0x2f07('0x2a')](function(_0x427de8){if(_0x427de8){_0x33b90f=_0x427de8;return _0x427de8['addLists'](_0x2d2566[_0x2f07('0x60')][_0x2f07('0x84')],_[_0x2f07('0x5d')](_0x2d2566[_0x2f07('0x60')],[_0x2f07('0x84'),'id'])||{});}return null;})['spread'](function(_0xf2a414){var _0x4d5836;_0x4b70b4=_0xf2a414||[];var _0x2d01cf=[];if(_0xf2a414){for(var _0x447211=0x0;_0x447211<_0xf2a414[_0x2f07('0x53')];_0x447211+=0x1){var _0x3b87b8=_0xf2a414[_0x447211][_0x2f07('0x2c')]({'plain':!![]});_0x33b90f[_0x2f07('0xa1')]=_0x2d2566[_0x2f07('0x60')][_0x2f07('0xa1')]?_0x2d2566[_0x2f07('0x60')][_0x2f07('0xa1')]:_0x33b90f[_0x2f07('0xa1')];switch(_0x33b90f[_0x2f07('0xa1')]){case _0x2f07('0xa2'):_0x4d5836=squel[_0x2f07('0xa3')]()['into'](_0x2f07('0xa4'))[_0x2f07('0xa5')](['phone',_0x2f07('0xa6'),_0x2f07('0xa7'),_0x2f07('0xa8'),_0x2f07('0x68'),_0x2f07('0x5e'),_0x2f07('0x5f')],squel[_0x2f07('0x85')]()[_0x2f07('0x86')]('phone',_0x2f07('0xa9'))[_0x2f07('0x86')]('\x27'+_0x330e23+'\x27',_0x2f07('0xa6'))['field']('id','ContactId')[_0x2f07('0x86')](_0x3b87b8[_0x2f07('0xaa')]['toString'](),_0x2f07('0xa8'))['field'](_0x2d2566['params']['id'][_0x2f07('0x8c')](),_0x2f07('0x68'))['field']('\x27'+_0x330e23+'\x27',_0x2f07('0x5e'))['field']('\x27'+_0x330e23+'\x27','updatedAt')[_0x2f07('0xab')](_0x2f07('0xac'))[_0x2f07('0x48')](_0x2f07('0xad'))[_0x2f07('0x48')]('ListId\x20=\x20?',_0x3b87b8[_0x2f07('0xaa')][_0x2f07('0x8c')]())[_0x2f07('0x48')]('phone\x20IS\x20NOT\x20NULL')[_0x2f07('0x48')](_0x2f07('0xae'),squel[_0x2f07('0x85')]()[_0x2f07('0x86')](_0x2f07('0xaf'))[_0x2f07('0xab')](_0x2f07('0xb0'))['where']('VoiceQueueId\x20=\x20?',_0x2d2566['params']['id'][_0x2f07('0x8c')]()))[_0x2f07('0x48')](_0x2f07('0xae'),squel[_0x2f07('0x85')]()['field'](_0x2f07('0xb1'))['from'](_0x2f07('0xa4'))[_0x2f07('0x48')](_0x2f07('0x8a'),_0x2d2566[_0x2f07('0x52')]['id'][_0x2f07('0x8c')]())))['toString']();break;case _0x2f07('0xb2'):_0x4d5836=squel[_0x2f07('0xa3')]()[_0x2f07('0xb3')](_0x2f07('0xa4'))[_0x2f07('0xa5')]([_0x2f07('0xa9'),_0x2f07('0xa6'),'ContactId',_0x2f07('0xa8'),_0x2f07('0x68'),_0x2f07('0x5e'),_0x2f07('0x5f')],squel[_0x2f07('0x85')]()[_0x2f07('0x86')](_0x2f07('0xa9'),_0x2f07('0xa9'))[_0x2f07('0x86')]('\x27'+_0x330e23+'\x27','scheduledAt')[_0x2f07('0x86')]('id',_0x2f07('0xa7'))['field'](_0x3b87b8[_0x2f07('0xaa')][_0x2f07('0x8c')](),'ListId')['field'](_0x2d2566[_0x2f07('0x52')]['id'][_0x2f07('0x8c')](),_0x2f07('0x68'))[_0x2f07('0x86')]('\x27'+_0x330e23+'\x27',_0x2f07('0x5e'))[_0x2f07('0x86')]('\x27'+_0x330e23+'\x27',_0x2f07('0x5f'))[_0x2f07('0xab')]('cm_contacts')[_0x2f07('0x48')]('deletedAt\x20IS\x20NULL')[_0x2f07('0x48')](_0x2f07('0xb4'),_0x3b87b8['CmListId'][_0x2f07('0x8c')]())[_0x2f07('0x48')](_0x2f07('0xb5'))[_0x2f07('0x48')](_0x2f07('0xae'),squel[_0x2f07('0x85')]()[_0x2f07('0x86')]('COALESCE(phone,\x27\x27)')[_0x2f07('0xab')](_0x2f07('0xa4'))[_0x2f07('0x48')](_0x2f07('0x8a'),_0x2d2566['params']['id'][_0x2f07('0x8c')]())))['toString']();break;default:_0x4d5836=squel[_0x2f07('0xa3')]()[_0x2f07('0xb3')](_0x2f07('0xa4'))[_0x2f07('0xa5')]([_0x2f07('0xa9'),_0x2f07('0xa6'),_0x2f07('0xa7'),_0x2f07('0xa8'),_0x2f07('0x68'),_0x2f07('0x5e'),_0x2f07('0x5f')],squel['select']()['field'](_0x2f07('0xa9'),'phone')['field']('\x27'+_0x330e23+'\x27',_0x2f07('0xa6'))[_0x2f07('0x86')]('id',_0x2f07('0xa7'))[_0x2f07('0x86')](_0x3b87b8[_0x2f07('0xaa')]['toString'](),_0x2f07('0xa8'))['field'](_0x2d2566['params']['id']['toString'](),_0x2f07('0x68'))[_0x2f07('0x86')]('\x27'+_0x330e23+'\x27',_0x2f07('0x5e'))[_0x2f07('0x86')]('\x27'+_0x330e23+'\x27',_0x2f07('0x5f'))[_0x2f07('0xab')](_0x2f07('0xac'))[_0x2f07('0x48')](_0x2f07('0xad'))[_0x2f07('0x48')](_0x2f07('0xb4'),_0x3b87b8['CmListId'][_0x2f07('0x8c')]())[_0x2f07('0x48')](_0x2f07('0xb5')))[_0x2f07('0x8c')]();}_0x2d01cf[_0x2f07('0x8b')](db[_0x2f07('0x77')][_0x2f07('0x3d')](_0x4d5836));}return BPromise[_0x2f07('0x8f')](_0x2d01cf);}})[_0x2f07('0x2a')](function(){var _0x4f599b=[];var _0xf41c84=squel[_0x2f07('0xa3')]()[_0x2f07('0xb3')](_0x2f07('0xb6'))['fromQuery']([_0x2f07('0xb7'),_0x2f07('0xa9'),_0x2f07('0xb8'),_0x2f07('0x5e'),_0x2f07('0x5f')],squel['select']()[_0x2f07('0x86')](_0x2f07('0xb9'))[_0x2f07('0x86')]('ci.item')[_0x2f07('0x86')](_0x2f07('0xba'))[_0x2f07('0x86')]('\x27'+_0x330e23+'\x27',_0x2f07('0x5e'))[_0x2f07('0x86')]('\x27'+_0x330e23+'\x27',_0x2f07('0x5f'))[_0x2f07('0xab')](_0x2f07('0xbb'),'ci')[_0x2f07('0x88')](_0x2f07('0xa4'),'h','h.ContactId=ci.CmContactId')[_0x2f07('0x48')](_0x2f07('0xbc'),_0x330e23)[_0x2f07('0x48')](_0x2f07('0xbd'),_0x2f07('0xbe')))[_0x2f07('0x8c')]();_0x4f599b[_0x2f07('0x8b')](db[_0x2f07('0x77')][_0x2f07('0x3d')](_0xf41c84));return BPromise['all'](_0x4f599b);})['then'](function(){return _0x4b70b4;})[_0x2f07('0x2a')](respondWithResult(_0x1226ff,null))[_0x2f07('0x51')](handleError(_0x1226ff,null));};exports[_0x2f07('0xbf')]=function(_0x18d5e7,_0x1dc5f6,_0x2013b7){return db['VoiceQueue'][_0x2f07('0x54')]({'where':{'id':_0x18d5e7[_0x2f07('0x52')]['id']}})['then'](handleEntityNotFound(_0x1dc5f6,null))[_0x2f07('0x2a')](function(_0x3f9dfa){if(_0x3f9dfa){return _0x3f9dfa[_0x2f07('0xbf')](_0x18d5e7['query'][_0x2f07('0x84')]);}})[_0x2f07('0x2a')](function(_0x3ddf04){if(_0x3ddf04){return db[_0x2f07('0x63')][_0x2f07('0x2b')]({'where':{'ListId':_0x18d5e7[_0x2f07('0x3d')][_0x2f07('0x84')],'VoiceQueueId':_0x18d5e7['params']['id']}})[_0x2f07('0x2a')](function(){return _0x3ddf04;});}})[_0x2f07('0x2a')](respondWithStatusCode(_0x1dc5f6,null))[_0x2f07('0x51')](handleError(_0x1dc5f6,null));};exports['getBlackLists']=function(_0x21d5a3,_0x27da18,_0x381619){var _0x32e62a={};var _0x4c64b0={};var _0x142b6e;var _0x360808;return db[_0x2f07('0x4d')][_0x2f07('0x62')]({'where':{'id':_0x21d5a3['params']['id']}})[_0x2f07('0x2a')](handleEntityNotFound(_0x27da18,null))[_0x2f07('0x2a')](function(_0x407e27){if(_0x407e27){_0x142b6e=_0x407e27;_0x4c64b0[_0x2f07('0x43')]=_[_0x2f07('0x3e')](db[_0x2f07('0x9e')][_0x2f07('0x5c')]);_0x4c64b0[_0x2f07('0x3d')]=_[_0x2f07('0x3e')](_0x21d5a3['query']);_0x4c64b0[_0x2f07('0x3f')]=_['intersection'](_0x4c64b0[_0x2f07('0x43')],_0x4c64b0[_0x2f07('0x3d')]);_0x32e62a[_0x2f07('0x42')]=_[_0x2f07('0x40')](_0x4c64b0[_0x2f07('0x43')],qs[_0x2f07('0x41')](_0x21d5a3[_0x2f07('0x3d')]['fields']));_0x32e62a[_0x2f07('0x42')]=_0x32e62a[_0x2f07('0x42')][_0x2f07('0x53')]?_0x32e62a[_0x2f07('0x42')]:_0x4c64b0[_0x2f07('0x43')];_0x32e62a[_0x2f07('0x46')]=qs[_0x2f07('0x47')](_0x21d5a3['query'][_0x2f07('0x47')]);_0x32e62a[_0x2f07('0x48')]=qs[_0x2f07('0x3f')](_[_0x2f07('0x49')](_0x21d5a3[_0x2f07('0x3d')],_0x4c64b0[_0x2f07('0x3f')]));if(_0x21d5a3['query'][_0x2f07('0x31')]){_0x32e62a['where']=_['merge'](_0x32e62a[_0x2f07('0x48')],{'$or':_[_0x2f07('0x33')](_0x32e62a['attributes'],function(_0x5d722c){var _0x32cf90={};_0x32cf90[_0x5d722c]={'$like':'%'+_0x21d5a3[_0x2f07('0x3d')][_0x2f07('0x31')]+'%'};return _0x32cf90;})});}_0x32e62a=_[_0x2f07('0x4a')]({},_0x32e62a,_0x21d5a3['options']);return _0x142b6e[_0x2f07('0xc0')](_0x32e62a);}})['then'](function(_0x140c0f){if(_0x140c0f){_0x360808=_0x140c0f[_0x2f07('0x53')];if(!_0x21d5a3[_0x2f07('0x3d')][_0x2f07('0x67')](_0x2f07('0x44'))){_0x32e62a[_0x2f07('0x45')]=qs[_0x2f07('0x45')](_0x21d5a3[_0x2f07('0x3d')][_0x2f07('0x45')]);_0x32e62a['offset']=qs[_0x2f07('0x25')](_0x21d5a3[_0x2f07('0x3d')][_0x2f07('0x25')]);}return _0x142b6e['getBlackLists'](_0x32e62a);}})[_0x2f07('0x2a')](function(_0x483087){if(_0x483087){return _0x483087?{'count':_0x360808,'rows':_0x483087}:null;}})['then'](respondWithResult(_0x27da18,null))[_0x2f07('0x51')](handleError(_0x27da18,null));};exports[_0x2f07('0xc1')]=function(_0x4cff52,_0x1a8deb,_0x490e4a){var _0x9da89e,_0x126dc2;return db[_0x2f07('0x4d')]['find']({'where':{'id':_0x4cff52[_0x2f07('0x52')]['id']}})[_0x2f07('0x2a')](handleEntityNotFound(_0x1a8deb,null))[_0x2f07('0x2a')](function(_0x445c63){if(_0x445c63){_0x126dc2=_0x445c63;return _0x445c63[_0x2f07('0xc1')](_0x4cff52[_0x2f07('0x60')]['ids'],_[_0x2f07('0x5d')](_0x4cff52[_0x2f07('0x60')],[_0x2f07('0x84'),'id'])||{});}return null;})[_0x2f07('0x96')](function(_0xab4389){var _0x5b8a73;_0x9da89e=_0xab4389||[];var _0x497446=[];if(_0xab4389){for(var _0x312c0a=0x0;_0x312c0a<_0xab4389[_0x2f07('0x53')];_0x312c0a+=0x1){var _0x4a84e5=_0xab4389[_0x312c0a][_0x2f07('0x2c')]({'plain':!![]});_0x5b8a73=squel[_0x2f07('0xa3')]()['into'](_0x2f07('0xc2'))[_0x2f07('0xa5')]([_0x2f07('0xa9'),_0x2f07('0xa7'),'ListId',_0x2f07('0x68'),_0x2f07('0x5e'),_0x2f07('0x5f')],squel[_0x2f07('0x85')]()['field']('phone','phone')[_0x2f07('0x86')]('id',_0x2f07('0xa7'))[_0x2f07('0x86')](_0x4a84e5[_0x2f07('0xaa')]['toString'](),_0x2f07('0xa8'))[_0x2f07('0x86')](_0x4cff52[_0x2f07('0x52')]['id'][_0x2f07('0x8c')](),'VoiceQueueId')[_0x2f07('0x86')](_0x2f07('0xc3'),_0x2f07('0x5e'))['field']('NOW()',_0x2f07('0x5f'))['from'](_0x2f07('0xac'))[_0x2f07('0x48')](_0x2f07('0xad'))[_0x2f07('0x48')](_0x2f07('0xb4'),_0x4a84e5[_0x2f07('0xaa')][_0x2f07('0x8c')]())[_0x2f07('0x48')](_0x2f07('0xb5')))[_0x2f07('0x8c')]();_0x497446[_0x2f07('0x8b')](db[_0x2f07('0x77')]['query'](_0x5b8a73));}return BPromise['all'](_0x497446);}})['then'](function(){return _0x9da89e;})['then'](respondWithResult(_0x1a8deb,null))['catch'](handleError(_0x1a8deb,null));};exports[_0x2f07('0xc4')]=function(_0x539580,_0x3e8b77,_0x5415cc){return db[_0x2f07('0x4d')][_0x2f07('0x54')]({'where':{'id':_0x539580[_0x2f07('0x52')]['id']}})['then'](handleEntityNotFound(_0x3e8b77,null))[_0x2f07('0x2a')](function(_0x10b507){if(_0x10b507){return _0x10b507[_0x2f07('0xc4')](_0x539580['query'][_0x2f07('0x84')]);}})[_0x2f07('0x2a')](function(_0x698f72){if(_0x698f72){return db['CmHopperBlack'][_0x2f07('0x2b')]({'where':{'ListId':_0x539580[_0x2f07('0x3d')][_0x2f07('0x84')],'VoiceQueueId':_0x539580[_0x2f07('0x52')]['id']}})[_0x2f07('0x2a')](function(){return _0x698f72;});}})['then'](respondWithStatusCode(_0x3e8b77,null))[_0x2f07('0x51')](handleError(_0x3e8b77,null));};
\ No newline at end of file
index 8c46aae..c2c4ae0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad42=['hook','exports','events','../../mysqldb','VoiceQueue','save','remove','emit'];(function(_0x26f518,_0x5a6c2d){var _0x3666d=function(_0x38ef7f){while(--_0x38ef7f){_0x26f518['push'](_0x26f518['shift']());}};_0x3666d(++_0x5a6c2d);}(_0xad42,0x182));var _0x2ad4=function(_0x182828,_0x2a2c40){_0x182828=_0x182828-0x0;var _0x1489d7=_0xad42[_0x182828];return _0x1489d7;};'use strict';var EventEmitter=require(_0x2ad4('0x0'));var VoiceQueue=require(_0x2ad4('0x1'))['db'][_0x2ad4('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2ad4('0x3'),'afterUpdate':'update','afterDestroy':_0x2ad4('0x4')};function emitEvent(_0x5b8f30){return function(_0x57e9e9,_0x4761c2,_0xd1e28b){VoiceQueueEvents[_0x2ad4('0x5')](_0x5b8f30+':'+_0x57e9e9['id'],_0x57e9e9);VoiceQueueEvents['emit'](_0x5b8f30,_0x57e9e9);_0xd1e28b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x2ad4('0x6')](e,emitEvent(event));}}module[_0x2ad4('0x7')]=VoiceQueueEvents;
\ No newline at end of file
+var _0xad24=['exports','events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x1cb0b4,_0x1fd48d){var _0x525b60=function(_0x1efccc){while(--_0x1efccc){_0x1cb0b4['push'](_0x1cb0b4['shift']());}};_0x525b60(++_0x1fd48d);}(_0xad24,0x99));var _0x4ad2=function(_0x135b17,_0x274485){_0x135b17=_0x135b17-0x0;var _0xcdbc9f=_0xad24[_0x135b17];return _0xcdbc9f;};'use strict';var EventEmitter=require(_0x4ad2('0x0'));var VoiceQueue=require(_0x4ad2('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x4ad2('0x2')](0x0);var events={'afterCreate':_0x4ad2('0x3'),'afterUpdate':'update','afterDestroy':_0x4ad2('0x4')};function emitEvent(_0x16a190){return function(_0x111d83,_0x148020,_0x5165ea){VoiceQueueEvents[_0x4ad2('0x5')](_0x16a190+':'+_0x111d83['id'],_0x111d83);VoiceQueueEvents[_0x4ad2('0x5')](_0x16a190,_0x111d83);_0x5165ea(null);};}for(var e in events){if(events[_0x4ad2('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x4ad2('0x7')]=VoiceQueueEvents;
\ No newline at end of file
index 9466c5a..7e8429b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x382757,_0x571ba1){var _0x45f217=function(_0x1bc781){while(--_0x1bc781){_0x382757['push'](_0x382757['shift']());}};_0x45f217(++_0x571ba1);}(_0xedd9,0xfc));var _0x9edd=function(_0x385706,_0x27cd45){_0x385706=_0x385706-0x0;var _0x16aa20=_0xedd9[_0x385706];return _0x16aa20;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x3a9a16,_0x2c7749){var _0xcbaffd=function(_0xe5cd){while(--_0xe5cd){_0x3a9a16['push'](_0x3a9a16['shift']());}};_0xcbaffd(++_0x2c7749);}(_0x34e8,0x12c));var _0x834e=function(_0x11de3b,_0x24836a){_0x11de3b=_0x11de3b-0x0;var _0x1f19b6=_0x34e8[_0x11de3b];return _0x1f19b6;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fbf3256..815966d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc56b=['info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','VoiceQueue,\x20%s,\x20%s','message','result','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','map','include','model','catch','ShowVoiceQueue','find','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','register','request','then'];(function(_0x330141,_0x1dd290){var _0x1b68a2=function(_0x4e7f3c){while(--_0x4e7f3c){_0x330141['push'](_0x330141['shift']());}};_0x1b68a2(++_0x1dd290);}(_0xc56b,0x19e));var _0xbc56=function(_0x4224ff,_0x1bee4d){_0x4224ff=_0x4224ff-0x0;var _0x200e93=_0xc56b[_0x4224ff];return _0x200e93;};'use strict';var _=require(_0xbc56('0x0'));var util=require(_0xbc56('0x1'));var moment=require(_0xbc56('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbc56('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbc56('0x4'));var logger=require(_0xbc56('0x5'))(_0xbc56('0x6'));var config=require(_0xbc56('0x7'));var jayson=require(_0xbc56('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xbc56('0x9')]=_[_0xbc56('0xa')](config[_0xbc56('0x9')],{'host':_0xbc56('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueue.socket')[_0xbc56('0xc')](socket);function respondWithRpcPromise(_0xb56430,_0x2dc4cb,_0xcf3af5){return new BPromise(function(_0x33450a,_0x587776){return client[_0xbc56('0xd')](_0xb56430,_0xcf3af5)[_0xbc56('0xe')](function(_0x3114d5){logger[_0xbc56('0xf')]('VoiceQueue,\x20%s,\x20%s',_0x2dc4cb,_0xbc56('0x10'));logger[_0xbc56('0x11')](_0xbc56('0x12'),_0x2dc4cb,_0xbc56('0x10'),JSON['stringify'](_0x3114d5));if(_0x3114d5[_0xbc56('0x13')]){if(_0x3114d5[_0xbc56('0x13')][_0xbc56('0x14')]===0x1f4){logger['error'](_0xbc56('0x15'),_0x2dc4cb,_0x3114d5[_0xbc56('0x13')][_0xbc56('0x16')]);return _0x587776(_0x3114d5[_0xbc56('0x13')][_0xbc56('0x16')]);}logger[_0xbc56('0x13')](_0xbc56('0x15'),_0x2dc4cb,_0x3114d5['error']['message']);return _0x33450a(_0x3114d5['error']['message']);}else{logger[_0xbc56('0xf')](_0xbc56('0x15'),_0x2dc4cb,_0xbc56('0x10'));_0x33450a(_0x3114d5[_0xbc56('0x17')]['message']);}})['catch'](function(_0x1559f0){logger[_0xbc56('0x13')](_0xbc56('0x15'),_0x2dc4cb,_0x1559f0);_0x587776(_0x1559f0);});});}exports[_0xbc56('0x18')]=function(_0x16fb87){var _0x16413c=this;return new Promise(function(_0x17153f,_0x17fb50){return db[_0xbc56('0x19')][_0xbc56('0x1a')]({'raw':_0x16fb87[_0xbc56('0x1b')]?_0x16fb87[_0xbc56('0x1b')][_0xbc56('0x1c')]===undefined?!![]:![]:!![],'where':_0x16fb87['options']?_0x16fb87[_0xbc56('0x1b')][_0xbc56('0x1d')]||null:null,'attributes':_0x16fb87[_0xbc56('0x1b')]?_0x16fb87['options'][_0xbc56('0x1e')]||null:null,'limit':_0x16fb87[_0xbc56('0x1b')]?_0x16fb87[_0xbc56('0x1b')][_0xbc56('0x1f')]||null:null,'include':_0x16fb87[_0xbc56('0x1b')]?_0x16fb87[_0xbc56('0x1b')]['include']?_[_0xbc56('0x20')](_0x16fb87['options']['include'],function(_0x2bef21){return{'model':db[_0x2bef21['model']],'as':_0x2bef21['as'],'attributes':_0x2bef21[_0xbc56('0x1e')],'include':_0x2bef21[_0xbc56('0x21')]?_['map'](_0x2bef21['include'],function(_0x13fd03){return{'model':db[_0x13fd03[_0xbc56('0x22')]],'as':_0x13fd03['as'],'attributes':_0x13fd03[_0xbc56('0x1e')],'include':_0x13fd03[_0xbc56('0x21')]?_[_0xbc56('0x20')](_0x13fd03[_0xbc56('0x21')],function(_0x1ca9b0){return{'model':db[_0x1ca9b0['model']],'as':_0x1ca9b0['as'],'attributes':_0x1ca9b0[_0xbc56('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbc56('0xe')](function(_0x5c9d4a){logger[_0xbc56('0xf')](_0xbc56('0x18'),_0x16fb87);logger[_0xbc56('0x11')](_0xbc56('0x18'),_0x16fb87,JSON['stringify'](_0x5c9d4a));_0x17153f(_0x5c9d4a);})[_0xbc56('0x23')](function(_0x12b042){logger[_0xbc56('0x13')](_0xbc56('0x18'),_0x12b042[_0xbc56('0x16')],_0x16fb87);_0x17fb50(_0x16413c[_0xbc56('0x13')](0x1f4,_0x12b042['message']));});});};exports[_0xbc56('0x24')]=function(_0x48101a){var _0x5043fc=this;return new Promise(function(_0x4fe8fe,_0x1081b6){return db['VoiceQueue'][_0xbc56('0x25')]({'raw':_0x48101a[_0xbc56('0x1b')]?_0x48101a[_0xbc56('0x1b')][_0xbc56('0x1c')]===undefined?!![]:![]:!![],'where':_0x48101a[_0xbc56('0x1b')]?_0x48101a[_0xbc56('0x1b')][_0xbc56('0x1d')]||null:null,'attributes':_0x48101a['options']?_0x48101a[_0xbc56('0x1b')]['attributes']||null:null,'include':_0x48101a[_0xbc56('0x1b')]?_0x48101a['options'][_0xbc56('0x21')]?_['map'](_0x48101a[_0xbc56('0x1b')]['include'],function(_0x3d3c43){return{'model':db[_0x3d3c43[_0xbc56('0x22')]],'as':_0x3d3c43['as'],'attributes':_0x3d3c43[_0xbc56('0x1e')],'include':_0x3d3c43[_0xbc56('0x21')]?_[_0xbc56('0x20')](_0x3d3c43[_0xbc56('0x21')],function(_0x5a7bad){return{'model':db[_0x5a7bad[_0xbc56('0x22')]],'as':_0x5a7bad['as'],'attributes':_0x5a7bad[_0xbc56('0x1e')],'include':_0x5a7bad[_0xbc56('0x21')]?_[_0xbc56('0x20')](_0x5a7bad['include'],function(_0x47c105){return{'model':db[_0x47c105[_0xbc56('0x22')]],'as':_0x47c105['as'],'attributes':_0x47c105[_0xbc56('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x56e593){logger[_0xbc56('0xf')](_0xbc56('0x24'),_0x48101a);logger[_0xbc56('0x11')](_0xbc56('0x24'),_0x48101a,JSON[_0xbc56('0x26')](_0x56e593));_0x4fe8fe(_0x56e593);})[_0xbc56('0x23')](function(_0x3666c8){logger['error'](_0xbc56('0x24'),_0x3666c8[_0xbc56('0x16')],_0x48101a);_0x1081b6(_0x5043fc[_0xbc56('0x13')](0x1f4,_0x3666c8['message']));});});};
\ No newline at end of file
+var _0xb34b=['VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VoiceQueue,\x20%s,\x20%s','message','info','result','catch','GetVoiceQueue','VoiceQueue','options','raw','where','attributes','limit','include','model','map','then','debug','ShowVoiceQueue','find','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','request'];(function(_0x1f3fbd,_0x4693ab){var _0xbba216=function(_0x352810){while(--_0x352810){_0x1f3fbd['push'](_0x1f3fbd['shift']());}};_0xbba216(++_0x4693ab);}(_0xb34b,0x19d));var _0xbb34=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xb34b[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xbb34('0x0'));var util=require(_0xbb34('0x1'));var moment=require(_0xbb34('0x2'));var BPromise=require(_0xbb34('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbb34('0x4'));var logger=require('../../config/logger')(_0xbb34('0x5'));var config=require(_0xbb34('0x6'));var jayson=require(_0xbb34('0x7'));var client=jayson[_0xbb34('0x8')][_0xbb34('0x9')]({'port':0x232a});config[_0xbb34('0xa')]=_[_0xbb34('0xb')](config[_0xbb34('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xbb34('0xc'))(new Redis(config[_0xbb34('0xa')]));require(_0xbb34('0xd'))[_0xbb34('0xe')](socket);function respondWithRpcPromise(_0x561980,_0x2d2bdf,_0x5a0104){return new BPromise(function(_0x18ae99,_0x4d0e03){return client[_0xbb34('0xf')](_0x561980,_0x5a0104)['then'](function(_0x1bbae6){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x2d2bdf,'request\x20sent');logger['debug'](_0xbb34('0x10'),_0x2d2bdf,_0xbb34('0x11'),JSON[_0xbb34('0x12')](_0x1bbae6));if(_0x1bbae6['error']){if(_0x1bbae6[_0xbb34('0x13')]['code']===0x1f4){logger['error'](_0xbb34('0x14'),_0x2d2bdf,_0x1bbae6[_0xbb34('0x13')][_0xbb34('0x15')]);return _0x4d0e03(_0x1bbae6[_0xbb34('0x13')][_0xbb34('0x15')]);}logger['error'](_0xbb34('0x14'),_0x2d2bdf,_0x1bbae6[_0xbb34('0x13')][_0xbb34('0x15')]);return _0x18ae99(_0x1bbae6[_0xbb34('0x13')][_0xbb34('0x15')]);}else{logger[_0xbb34('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x2d2bdf,_0xbb34('0x11'));_0x18ae99(_0x1bbae6[_0xbb34('0x17')]['message']);}})[_0xbb34('0x18')](function(_0xf9613f){logger[_0xbb34('0x13')](_0xbb34('0x14'),_0x2d2bdf,_0xf9613f);_0x4d0e03(_0xf9613f);});});}exports[_0xbb34('0x19')]=function(_0x4abc2f){var _0xb6b2f8=this;return new Promise(function(_0x56ec6e,_0x45042f){return db[_0xbb34('0x1a')]['findAll']({'raw':_0x4abc2f[_0xbb34('0x1b')]?_0x4abc2f[_0xbb34('0x1b')][_0xbb34('0x1c')]===undefined?!![]:![]:!![],'where':_0x4abc2f[_0xbb34('0x1b')]?_0x4abc2f[_0xbb34('0x1b')][_0xbb34('0x1d')]||null:null,'attributes':_0x4abc2f[_0xbb34('0x1b')]?_0x4abc2f['options'][_0xbb34('0x1e')]||null:null,'limit':_0x4abc2f[_0xbb34('0x1b')]?_0x4abc2f[_0xbb34('0x1b')][_0xbb34('0x1f')]||null:null,'include':_0x4abc2f[_0xbb34('0x1b')]?_0x4abc2f[_0xbb34('0x1b')][_0xbb34('0x20')]?_['map'](_0x4abc2f[_0xbb34('0x1b')]['include'],function(_0x551fc6){return{'model':db[_0x551fc6[_0xbb34('0x21')]],'as':_0x551fc6['as'],'attributes':_0x551fc6['attributes'],'include':_0x551fc6['include']?_[_0xbb34('0x22')](_0x551fc6[_0xbb34('0x20')],function(_0x49e193){return{'model':db[_0x49e193[_0xbb34('0x21')]],'as':_0x49e193['as'],'attributes':_0x49e193[_0xbb34('0x1e')],'include':_0x49e193['include']?_[_0xbb34('0x22')](_0x49e193[_0xbb34('0x20')],function(_0x538004){return{'model':db[_0x538004[_0xbb34('0x21')]],'as':_0x538004['as'],'attributes':_0x538004[_0xbb34('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbb34('0x23')](function(_0x501462){logger['info'](_0xbb34('0x19'),_0x4abc2f);logger[_0xbb34('0x24')](_0xbb34('0x19'),_0x4abc2f,JSON[_0xbb34('0x12')](_0x501462));_0x56ec6e(_0x501462);})[_0xbb34('0x18')](function(_0x1506aa){logger[_0xbb34('0x13')](_0xbb34('0x19'),_0x1506aa[_0xbb34('0x15')],_0x4abc2f);_0x45042f(_0xb6b2f8['error'](0x1f4,_0x1506aa['message']));});});};exports[_0xbb34('0x25')]=function(_0x5d5b49){var _0x1eb718=this;return new Promise(function(_0x164398,_0x3dcf86){return db[_0xbb34('0x1a')][_0xbb34('0x26')]({'raw':_0x5d5b49[_0xbb34('0x1b')]?_0x5d5b49['options'][_0xbb34('0x1c')]===undefined?!![]:![]:!![],'where':_0x5d5b49[_0xbb34('0x1b')]?_0x5d5b49[_0xbb34('0x1b')][_0xbb34('0x1d')]||null:null,'attributes':_0x5d5b49[_0xbb34('0x1b')]?_0x5d5b49[_0xbb34('0x1b')][_0xbb34('0x1e')]||null:null,'include':_0x5d5b49[_0xbb34('0x1b')]?_0x5d5b49[_0xbb34('0x1b')]['include']?_[_0xbb34('0x22')](_0x5d5b49[_0xbb34('0x1b')][_0xbb34('0x20')],function(_0x14e0b2){return{'model':db[_0x14e0b2[_0xbb34('0x21')]],'as':_0x14e0b2['as'],'attributes':_0x14e0b2[_0xbb34('0x1e')],'include':_0x14e0b2[_0xbb34('0x20')]?_[_0xbb34('0x22')](_0x14e0b2[_0xbb34('0x20')],function(_0x5c3ab0){return{'model':db[_0x5c3ab0['model']],'as':_0x5c3ab0['as'],'attributes':_0x5c3ab0[_0xbb34('0x1e')],'include':_0x5c3ab0[_0xbb34('0x20')]?_['map'](_0x5c3ab0[_0xbb34('0x20')],function(_0xe96124){return{'model':db[_0xe96124['model']],'as':_0xe96124['as'],'attributes':_0xe96124[_0xbb34('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbb34('0x23')](function(_0x53f5c7){logger[_0xbb34('0x16')]('ShowVoiceQueue',_0x5d5b49);logger['debug'](_0xbb34('0x25'),_0x5d5b49,JSON[_0xbb34('0x12')](_0x53f5c7));_0x164398(_0x53f5c7);})[_0xbb34('0x18')](function(_0x56a81e){logger[_0xbb34('0x13')](_0xbb34('0x25'),_0x56a81e[_0xbb34('0x15')],_0x5d5b49);_0x3dcf86(_0x1eb718[_0xbb34('0x13')](0x1f4,_0x56a81e['message']));});});};
\ No newline at end of file
index 5ce2e48..937016f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x477f=['remove','emit','removeListener','register','length','./voiceQueue.events'];(function(_0x12b683,_0x124186){var _0xfb150b=function(_0x565ce7){while(--_0x565ce7){_0x12b683['push'](_0x12b683['shift']());}};_0xfb150b(++_0x124186);}(_0x477f,0xfb));var _0xf477=function(_0x5b98ad,_0x1f872d){_0x5b98ad=_0x5b98ad-0x0;var _0x56047e=_0x477f[_0x5b98ad];return _0x56047e;};'use strict';var VoiceQueueEvents=require(_0xf477('0x0'));var events=['save',_0xf477('0x1'),'update'];function createListener(_0x596d22,_0x5bb49b){return function(_0x275df7){_0x5bb49b[_0xf477('0x2')](_0x596d22,_0x275df7);};}function removeListener(_0x2fa5b0,_0x41b5db){return function(){VoiceQueueEvents[_0xf477('0x3')](_0x2fa5b0,_0x41b5db);};}exports[_0xf477('0x4')]=function(_0x3b1466){for(var _0x3b1800=0x0,_0x19191c=events[_0xf477('0x5')];_0x3b1800<_0x19191c;_0x3b1800++){var _0x2c4021=events[_0x3b1800];var _0x1bb08c=createListener('voiceQueue:'+_0x2c4021,_0x3b1466);VoiceQueueEvents['on'](_0x2c4021,_0x1bb08c);}};
\ No newline at end of file
+var _0xfb42=['register','voiceQueue:','./voiceQueue.events','save','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfb42,0x122));var _0x2fb4=function(_0xcf554c,_0x5f131b){_0xcf554c=_0xcf554c-0x0;var _0x1d5c46=_0xfb42[_0xcf554c];return _0x1d5c46;};'use strict';var VoiceQueueEvents=require(_0x2fb4('0x0'));var events=[_0x2fb4('0x1'),'remove',_0x2fb4('0x2')];function createListener(_0x20c526,_0x137799){return function(_0x5e7428){_0x137799[_0x2fb4('0x3')](_0x20c526,_0x5e7428);};}function removeListener(_0x2c3d50,_0x4780d2){return function(){VoiceQueueEvents['removeListener'](_0x2c3d50,_0x4780d2);};}exports[_0x2fb4('0x4')]=function(_0x362f77){for(var _0x2324df=0x0,_0x716dd0=events['length'];_0x2324df<_0x716dd0;_0x2324df++){var _0x3bcb73=events[_0x2324df];var _0x2371ec=createListener(_0x2fb4('0x5')+_0x3bcb73,_0x362f77);VoiceQueueEvents['on'](_0x3bcb73,_0x2371ec);}};
\ No newline at end of file
index 638d025..a4e1480 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8738=['/index','getVoiceQueuesReport','/:id','show','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0xa40219,_0x21027e){var _0x391974=function(_0x14e4de){while(--_0x14e4de){_0xa40219['push'](_0xa40219['shift']());}};_0x391974(++_0x21027e);}(_0x8738,0xee));var _0x8873=function(_0x54af0d,_0x3e5db0){_0x54af0d=_0x54af0d-0x0;var _0x57b08d=_0x8738[_0x54af0d];return _0x57b08d;};'use strict';var multer=require(_0x8873('0x0'));var util=require(_0x8873('0x1'));var path=require(_0x8873('0x2'));var timeout=require(_0x8873('0x3'));var express=require(_0x8873('0x4'));var router=express[_0x8873('0x5')]();var fs_extra=require(_0x8873('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8873('0x7'));var config=require(_0x8873('0x8'));var controller=require(_0x8873('0x9'));router[_0x8873('0xa')]('/',auth[_0x8873('0xb')](),controller[_0x8873('0xc')]);router['get'](_0x8873('0xd'),auth[_0x8873('0xb')](),controller[_0x8873('0xe')]);router[_0x8873('0xa')](_0x8873('0xf'),auth[_0x8873('0xb')](),controller[_0x8873('0x10')]);router['get'](_0x8873('0x11'),auth[_0x8873('0xb')](),controller[_0x8873('0x12')]);router['post']('/',auth[_0x8873('0xb')](),controller[_0x8873('0x13')]);router[_0x8873('0x14')]('/:id',auth[_0x8873('0xb')](),controller['update']);router['delete'](_0x8873('0x11'),auth[_0x8873('0xb')](),controller[_0x8873('0x15')]);module[_0x8873('0x16')]=router;
\ No newline at end of file
+var _0x0cf9=['exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','index','get','/describe','describe','/index','isAuthenticated','/:id','post','create','put','update'];(function(_0x5578c0,_0x4f9a4d){var _0x24ae5d=function(_0x2c004a){while(--_0x2c004a){_0x5578c0['push'](_0x5578c0['shift']());}};_0x24ae5d(++_0x4f9a4d);}(_0x0cf9,0x19f));var _0x90cf=function(_0x57a670,_0x30e402){_0x57a670=_0x57a670-0x0;var _0x41ce21=_0x0cf9[_0x57a670];return _0x41ce21;};'use strict';var multer=require('multer');var util=require(_0x90cf('0x0'));var path=require(_0x90cf('0x1'));var timeout=require(_0x90cf('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x90cf('0x3'));var auth=require(_0x90cf('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x90cf('0x5'));var controller=require('./voiceQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x90cf('0x6')]);router[_0x90cf('0x7')](_0x90cf('0x8'),auth['isAuthenticated'](),controller[_0x90cf('0x9')]);router[_0x90cf('0x7')](_0x90cf('0xa'),auth[_0x90cf('0xb')](),controller['getVoiceQueuesReport']);router[_0x90cf('0x7')](_0x90cf('0xc'),auth[_0x90cf('0xb')](),controller['show']);router[_0x90cf('0xd')]('/',auth[_0x90cf('0xb')](),controller[_0x90cf('0xe')]);router[_0x90cf('0xf')](_0x90cf('0xc'),auth['isAuthenticated'](),controller[_0x90cf('0x10')]);router['delete'](_0x90cf('0xc'),auth[_0x90cf('0xb')](),controller['destroy']);module[_0x90cf('0x11')]=router;
\ No newline at end of file
index d06decc..cb7d112 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa62=['format','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','sequelize','moment','exports','STRING','DATE','getDataValue'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xaa62,0xf1));var _0x2aa6=function(_0x496a35,_0x2670f1){_0x496a35=_0x496a35-0x0;var _0x5e22a1=_0xaa62[_0x496a35];return _0x5e22a1;};'use strict';var Sequelize=require(_0x2aa6('0x0'));var moment=require(_0x2aa6('0x1'));module[_0x2aa6('0x2')]={'type':{'type':Sequelize[_0x2aa6('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x2aa6('0x3')]},'calleridname':{'type':Sequelize[_0x2aa6('0x3')]},'queue':{'type':Sequelize[_0x2aa6('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x2aa6('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x1525a2){var _0x512330=moment(_0x1525a2);var _0x1383df=moment(this[_0x2aa6('0x5')]('queuecallerjoinAt'))[_0x2aa6('0x6')](_0x2aa6('0x7'));var _0x13f503=_0x512330['diff'](_0x1383df,_0x2aa6('0x8'));this[_0x2aa6('0x9')](_0x2aa6('0xa'),_0x1525a2);this[_0x2aa6('0x9')]('holdtime',_0x13f503||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x2aa6('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x2aa6('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x2aa6('0x4')]},'queuecallerexit':{'type':Sequelize[_0x2aa6('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x2aa6('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x2aa6('0xb')]},'channel':{'type':Sequelize[_0x2aa6('0x3')]},'connectedlinenum':{'type':Sequelize[_0x2aa6('0x3')]},'connectedlinename':{'type':Sequelize[_0x2aa6('0x3')]},'accountcode':{'type':Sequelize[_0x2aa6('0x3')]},'context':{'type':Sequelize[_0x2aa6('0x3')]},'exten':{'type':Sequelize[_0x2aa6('0x3')]},'priority':{'type':Sequelize[_0x2aa6('0x3')]},'holdtime':{'type':Sequelize[_0x2aa6('0xb')]},'mohtime':{'type':Sequelize[_0x2aa6('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2aa6('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x2aa6('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x2aa6('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x2aa6('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2aa6('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize[_0x2aa6('0x3')]}};
\ No newline at end of file
+var _0x33f3=['exports','STRING','DATE','getDataValue','YYYY-MM-DD\x20HH:mm:ss','seconds','queuecallerleaveAt','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment'];(function(_0xf4dfa4,_0x2f9143){var _0x3a5ac1=function(_0x4a1671){while(--_0x4a1671){_0xf4dfa4['push'](_0xf4dfa4['shift']());}};_0x3a5ac1(++_0x2f9143);}(_0x33f3,0xd0));var _0x333f=function(_0xfef581,_0x9143d5){_0xfef581=_0xfef581-0x0;var _0x15c2ef=_0x33f3[_0xfef581];return _0x15c2ef;};'use strict';var Sequelize=require(_0x333f('0x0'));var moment=require(_0x333f('0x1'));module[_0x333f('0x2')]={'type':{'type':Sequelize[_0x333f('0x3')]},'uniqueid':{'type':Sequelize[_0x333f('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x333f('0x3')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x333f('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x59dd38){var _0x239dd0=moment(_0x59dd38);var _0x4daf39=moment(this[_0x333f('0x5')]('queuecallerjoinAt'))['format'](_0x333f('0x6'));var _0x56eb6b=_0x239dd0['diff'](_0x4daf39,_0x333f('0x7'));this['setDataValue'](_0x333f('0x8'),_0x59dd38);this[_0x333f('0x9')](_0x333f('0xa'),_0x56eb6b||null);}},'position':{'type':Sequelize[_0x333f('0xb')]},'count':{'type':Sequelize[_0x333f('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x333f('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x333f('0x4')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x333f('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x333f('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x333f('0x3')],'comment':_0x333f('0xd')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x333f('0x3')]},'connectedlinenum':{'type':Sequelize[_0x333f('0x3')]},'connectedlinename':{'type':Sequelize[_0x333f('0x3')]},'accountcode':{'type':Sequelize[_0x333f('0x3')]},'context':{'type':Sequelize[_0x333f('0x3')]},'exten':{'type':Sequelize[_0x333f('0x3')]},'priority':{'type':Sequelize[_0x333f('0x3')]},'holdtime':{'type':Sequelize[_0x333f('0xb')]},'mohtime':{'type':Sequelize[_0x333f('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x333f('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x333f('0x3')],'comment':_0x333f('0xe')},'transferexten':{'type':Sequelize[_0x333f('0x3')]},'transferuniqueid':{'type':Sequelize[_0x333f('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x333f('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x333f('0xb')],'defaultValue':0x0},'note':{'type':Sequelize[_0x333f('0x3')]}};
\ No newline at end of file
index 7c237a0..3ce01ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8656=['describe','hasOwnProperty','findAll','getVoiceQueuesReport','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','find','catch','create','body','params'];(function(_0x51b0d9,_0x315257){var _0x322602=function(_0x11ed1c){while(--_0x11ed1c){_0x51b0d9['push'](_0x51b0d9['shift']());}};_0x322602(++_0x315257);}(_0x8656,0x1a8));var _0x6865=function(_0x174ab8,_0x47ea5f){_0x174ab8=_0x174ab8-0x0;var _0x2aab09=_0x8656[_0x174ab8];return _0x2aab09;};'use strict';var emlformat=require(_0x6865('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6865('0x1'));var jsonpatch=require(_0x6865('0x2'));var rp=require('request-promise');var moment=require(_0x6865('0x3'));var BPromise=require(_0x6865('0x4'));var Mustache=require(_0x6865('0x5'));var util=require(_0x6865('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6865('0x7'));var ejs=require(_0x6865('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6865('0x9'));var crypto=require('crypto');var jsforce=require(_0x6865('0xa'));var deskjs=require(_0x6865('0xb'));var toCsv=require('to-csv');var querystring=require(_0x6865('0xc'));var Papa=require('papaparse');var Redis=require(_0x6865('0xd'));var authService=require(_0x6865('0xe'));var qs=require(_0x6865('0xf'));var as=require(_0x6865('0x10'));var hardwareService=require(_0x6865('0x11'));var logger=require('../../config/logger')(_0x6865('0x12'));var utils=require(_0x6865('0x13'));var config=require(_0x6865('0x14'));var licenseUtil=require(_0x6865('0x15'));var db=require(_0x6865('0x16'))['db'];config[_0x6865('0x17')]=_[_0x6865('0x18')](config[_0x6865('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x6865('0x19'))(new Redis(config[_0x6865('0x17')]));require(_0x6865('0x1a'))[_0x6865('0x1b')](socket);function respondWithStatusCode(_0x3a4822,_0x1a895c){_0x1a895c=_0x1a895c||0xcc;return function(_0x107338){if(_0x107338){return _0x3a4822['sendStatus'](_0x1a895c);}return _0x3a4822[_0x6865('0x1c')](_0x1a895c)['end']();};}function respondWithResult(_0x38d9b8,_0x1a0f12){_0x1a0f12=_0x1a0f12||0xc8;return function(_0x5e434a){if(_0x5e434a){return _0x38d9b8[_0x6865('0x1c')](_0x1a0f12)[_0x6865('0x1d')](_0x5e434a);}};}function respondWithFilteredResult(_0x152f84,_0x160e2c){return function(_0x2c6dcb){if(_0x2c6dcb){var _0x3e951b=typeof _0x160e2c[_0x6865('0x1e')]===_0x6865('0x1f')&&typeof _0x160e2c['limit']===_0x6865('0x1f');var _0x31c551=_0x2c6dcb['count'];var _0x568ac1=_0x3e951b?0x0:_0x160e2c[_0x6865('0x1e')];var _0x4e25ce=_0x3e951b?_0x2c6dcb[_0x6865('0x20')]:_0x160e2c[_0x6865('0x1e')]+_0x160e2c[_0x6865('0x21')];var _0x41b197;if(_0x4e25ce>=_0x31c551){_0x4e25ce=_0x31c551;_0x41b197=0xc8;}else{_0x41b197=0xce;}_0x152f84[_0x6865('0x1c')](_0x41b197);return _0x152f84[_0x6865('0x22')](_0x6865('0x23'),_0x568ac1+'-'+_0x4e25ce+'/'+_0x31c551)[_0x6865('0x1d')](_0x2c6dcb);}return null;};}function patchUpdates(_0x3dae73){return function(_0x4be030){try{jsonpatch[_0x6865('0x24')](_0x4be030,_0x3dae73,!![]);}catch(_0x4294fd){return BPromise[_0x6865('0x25')](_0x4294fd);}return _0x4be030['save']();};}function saveUpdates(_0xffd402,_0x4f3f59){return function(_0x1d6d6d){if(_0x1d6d6d){return _0x1d6d6d[_0x6865('0x26')](_0xffd402)[_0x6865('0x27')](function(_0x150571){return _0x150571;});}return null;};}function removeEntity(_0x499098,_0x14bf55){return function(_0x421817){if(_0x421817){return _0x421817[_0x6865('0x28')]()[_0x6865('0x27')](function(){_0x499098[_0x6865('0x1c')](0xcc)[_0x6865('0x29')]();});}};}function handleEntityNotFound(_0x580cc1,_0x4bcb8b){return function(_0x4fb407){if(!_0x4fb407){_0x580cc1[_0x6865('0x2a')](0x194);}return _0x4fb407;};}function handleError(_0x97b7c6,_0x30f5a4){_0x30f5a4=_0x30f5a4||0x1f4;return function(_0x3568ca){logger[_0x6865('0x2b')](_0x3568ca[_0x6865('0x2c')]);if(_0x3568ca[_0x6865('0x2d')]){delete _0x3568ca['name'];}_0x97b7c6[_0x6865('0x1c')](_0x30f5a4)[_0x6865('0x2e')](_0x3568ca);};}exports[_0x6865('0x2f')]=function(_0x52e813,_0x2e9afc){var _0x5a7e41={},_0x4d80dd={},_0x3fda31={'count':0x0,'rows':[]};var _0xf57bb=_[_0x6865('0x30')](db[_0x6865('0x31')][_0x6865('0x32')],function(_0x4ca832){return{'name':_0x4ca832[_0x6865('0x33')],'type':_0x4ca832['type'][_0x6865('0x34')]};});_0x4d80dd[_0x6865('0x35')]=_[_0x6865('0x30')](_0xf57bb,'name');_0x4d80dd[_0x6865('0x36')]=_[_0x6865('0x37')](_0x52e813[_0x6865('0x36')]);_0x4d80dd[_0x6865('0x38')]=_[_0x6865('0x39')](_0x4d80dd[_0x6865('0x35')],_0x4d80dd[_0x6865('0x36')]);_0x5a7e41[_0x6865('0x3a')]=_[_0x6865('0x39')](_0x4d80dd['model'],qs[_0x6865('0x3b')](_0x52e813[_0x6865('0x36')][_0x6865('0x3b')]));_0x5a7e41[_0x6865('0x3a')]=_0x5a7e41[_0x6865('0x3a')][_0x6865('0x3c')]?_0x5a7e41[_0x6865('0x3a')]:_0x4d80dd['model'];if(!_0x52e813['query']['hasOwnProperty'](_0x6865('0x3d'))){_0x5a7e41[_0x6865('0x21')]=qs[_0x6865('0x21')](_0x52e813[_0x6865('0x36')][_0x6865('0x21')]);_0x5a7e41['offset']=qs[_0x6865('0x1e')](_0x52e813[_0x6865('0x36')][_0x6865('0x1e')]);}_0x5a7e41[_0x6865('0x3e')]=qs[_0x6865('0x3f')](_0x52e813[_0x6865('0x36')][_0x6865('0x3f')]);_0x5a7e41[_0x6865('0x40')]=qs[_0x6865('0x38')](_[_0x6865('0x41')](_0x52e813[_0x6865('0x36')],_0x4d80dd[_0x6865('0x38')]),_0xf57bb);if(_0x52e813[_0x6865('0x36')][_0x6865('0x42')]){_0x5a7e41[_0x6865('0x40')]=_[_0x6865('0x43')](_0x5a7e41[_0x6865('0x40')],{'$or':_[_0x6865('0x30')](_0xf57bb,function(_0x4e6069){if(_0x4e6069[_0x6865('0x44')]!==_0x6865('0x45')){var _0x30eb6a={};_0x30eb6a[_0x4e6069[_0x6865('0x2d')]]={'$like':'%'+_0x52e813[_0x6865('0x36')][_0x6865('0x42')]+'%'};return _0x30eb6a;}})});}_0x5a7e41=_[_0x6865('0x43')]({},_0x5a7e41,_0x52e813[_0x6865('0x46')]);var _0x5e3086={'where':_0x5a7e41[_0x6865('0x40')]};return db[_0x6865('0x31')][_0x6865('0x20')](_0x5e3086)[_0x6865('0x27')](function(_0x22e684){_0x3fda31[_0x6865('0x20')]=_0x22e684;if(_0x52e813['query'][_0x6865('0x47')]){_0x5a7e41[_0x6865('0x48')]=[{'all':!![]}];}return db[_0x6865('0x31')]['findAll'](_0x5a7e41);})[_0x6865('0x27')](function(_0x3818d6){_0x3fda31[_0x6865('0x49')]=_0x3818d6;return _0x3fda31;})[_0x6865('0x27')](respondWithFilteredResult(_0x2e9afc,_0x5a7e41))['catch'](handleError(_0x2e9afc,null));};exports[_0x6865('0x4a')]=function(_0x569f68,_0x2bb4f8){var _0x1c3044={'raw':![],'where':{'id':_0x569f68['params']['id']}},_0x3a6eb7={};_0x3a6eb7[_0x6865('0x35')]=_[_0x6865('0x37')](db[_0x6865('0x31')][_0x6865('0x32')]);_0x3a6eb7['query']=_[_0x6865('0x37')](_0x569f68[_0x6865('0x36')]);_0x3a6eb7[_0x6865('0x38')]=_[_0x6865('0x39')](_0x3a6eb7['model'],_0x3a6eb7[_0x6865('0x36')]);_0x1c3044['attributes']=_['intersection'](_0x3a6eb7[_0x6865('0x35')],qs[_0x6865('0x3b')](_0x569f68[_0x6865('0x36')][_0x6865('0x3b')]));_0x1c3044['attributes']=_0x1c3044['attributes'][_0x6865('0x3c')]?_0x1c3044['attributes']:_0x3a6eb7[_0x6865('0x35')];if(_0x569f68['query'][_0x6865('0x47')]){_0x1c3044['include']=[{'all':!![]}];}_0x1c3044=_[_0x6865('0x43')]({},_0x1c3044,_0x569f68[_0x6865('0x46')]);return db[_0x6865('0x31')][_0x6865('0x4b')](_0x1c3044)[_0x6865('0x27')](handleEntityNotFound(_0x2bb4f8,null))[_0x6865('0x27')](respondWithResult(_0x2bb4f8,null))[_0x6865('0x4c')](handleError(_0x2bb4f8,null));};exports[_0x6865('0x4d')]=function(_0xbb76f4,_0x5bfa01){return db[_0x6865('0x31')][_0x6865('0x4d')](_0xbb76f4[_0x6865('0x4e')],{})[_0x6865('0x27')](respondWithResult(_0x5bfa01,0xc9))[_0x6865('0x4c')](handleError(_0x5bfa01,null));};exports['update']=function(_0x2d8d8b,_0x5dc007){if(_0x2d8d8b[_0x6865('0x4e')]['id']){delete _0x2d8d8b[_0x6865('0x4e')]['id'];}return db[_0x6865('0x31')][_0x6865('0x4b')]({'where':{'id':_0x2d8d8b[_0x6865('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5dc007,null))[_0x6865('0x27')](saveUpdates(_0x2d8d8b[_0x6865('0x4e')],null))[_0x6865('0x27')](respondWithResult(_0x5dc007,null))[_0x6865('0x4c')](handleError(_0x5dc007,null));};exports[_0x6865('0x28')]=function(_0x2b4714,_0x31264d){return db[_0x6865('0x31')][_0x6865('0x4b')]({'where':{'id':_0x2b4714[_0x6865('0x4f')]['id']}})[_0x6865('0x27')](handleEntityNotFound(_0x31264d,null))[_0x6865('0x27')](removeEntity(_0x31264d,null))[_0x6865('0x4c')](handleError(_0x31264d,null));};exports['describe']=function(_0xe393f8,_0x41a423){return db[_0x6865('0x31')][_0x6865('0x50')]()['then'](respondWithResult(_0x41a423,null))[_0x6865('0x4c')](handleError(_0x41a423,null));};exports['getVoiceQueuesReport']=function(_0x538b3d,_0x401d5d){var _0x36cb70={},_0x3cb604={},_0x2464f3={'count':0x0,'rows':[]};_0x3cb604[_0x6865('0x35')]=_[_0x6865('0x37')](db['VoiceQueueReport']['rawAttributes']);_0x3cb604[_0x6865('0x36')]=_[_0x6865('0x37')](_0x538b3d[_0x6865('0x36')]);_0x3cb604[_0x6865('0x38')]=_['intersection'](_0x3cb604['model'],_0x3cb604[_0x6865('0x36')]);_0x36cb70['attributes']=_[_0x6865('0x39')](_0x3cb604['model'],qs[_0x6865('0x3b')](_0x538b3d[_0x6865('0x36')]['fields']));_0x36cb70[_0x6865('0x3a')]=_0x36cb70['attributes'][_0x6865('0x3c')]?_0x36cb70[_0x6865('0x3a')]:_0x3cb604[_0x6865('0x35')];if(!_0x538b3d[_0x6865('0x36')][_0x6865('0x51')](_0x6865('0x3d'))){_0x36cb70[_0x6865('0x21')]=qs[_0x6865('0x21')](_0x538b3d['query'][_0x6865('0x21')]);_0x36cb70[_0x6865('0x1e')]=qs[_0x6865('0x1e')](_0x538b3d[_0x6865('0x36')]['offset']);}_0x36cb70['order']=qs['sort'](_0x538b3d[_0x6865('0x36')][_0x6865('0x3f')]);_0x36cb70[_0x6865('0x40')]=qs[_0x6865('0x38')](_[_0x6865('0x41')](_0x538b3d[_0x6865('0x36')],_0x3cb604['filters']));if(_0x538b3d[_0x6865('0x36')][_0x6865('0x42')]){_0x36cb70['where']=_[_0x6865('0x43')](_0x36cb70[_0x6865('0x40')],{'$or':_[_0x6865('0x30')](_0x36cb70['attributes'],function(_0x644982){var _0x33c287={};_0x33c287[_0x644982]={'$like':'%'+_0x538b3d['query'][_0x6865('0x42')]+'%'};return _0x33c287;})});}_0x36cb70=_[_0x6865('0x43')]({},_0x36cb70,_0x538b3d[_0x6865('0x46')]);var _0x3db5f2={'where':_0x36cb70[_0x6865('0x40')]};return db[_0x6865('0x31')][_0x6865('0x20')](_0x3db5f2)[_0x6865('0x27')](function(_0x3159c5){_0x2464f3[_0x6865('0x20')]=_0x3159c5;if(_0x538b3d[_0x6865('0x36')][_0x6865('0x47')]){_0x36cb70['include']=[{'all':!![]}];}return db[_0x6865('0x31')][_0x6865('0x52')](_0x36cb70);})[_0x6865('0x27')](function(_0x83a944){_0x2464f3[_0x6865('0x49')]=_0x83a944;return _0x2464f3;})[_0x6865('0x27')](respondWithFilteredResult(_0x401d5d,_0x36cb70,_0x6865('0x53')))[_0x6865('0x4c')](handleError(_0x401d5d,null,_0x6865('0x53')));};
\ No newline at end of file
+var _0x71d0=['key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','getVoiceQueuesReport','nolimit','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','VoiceQueueReport','type'];(function(_0x25877d,_0x561686){var _0x580758=function(_0x5b18cd){while(--_0x5b18cd){_0x25877d['push'](_0x25877d['shift']());}};_0x580758(++_0x561686);}(_0x71d0,0x1be));var _0x071d=function(_0x3b2148,_0x4ad8bc){_0x3b2148=_0x3b2148-0x0;var _0x1eafe0=_0x71d0[_0x3b2148];return _0x1eafe0;};'use strict';var emlformat=require(_0x071d('0x0'));var rimraf=require(_0x071d('0x1'));var zipdir=require(_0x071d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x071d('0x3'));var moment=require(_0x071d('0x4'));var BPromise=require(_0x071d('0x5'));var Mustache=require(_0x071d('0x6'));var util=require('util');var path=require(_0x071d('0x7'));var sox=require(_0x071d('0x8'));var csv=require('to-csv');var ejs=require(_0x071d('0x9'));var fs=require('fs');var fs_extra=require(_0x071d('0xa'));var _=require(_0x071d('0xb'));var squel=require(_0x071d('0xc'));var crypto=require(_0x071d('0xd'));var jsforce=require(_0x071d('0xe'));var deskjs=require(_0x071d('0xf'));var toCsv=require(_0x071d('0x10'));var querystring=require(_0x071d('0x11'));var Papa=require('papaparse');var Redis=require(_0x071d('0x12'));var authService=require(_0x071d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x071d('0x14'));var hardwareService=require(_0x071d('0x15'));var logger=require(_0x071d('0x16'))('api');var utils=require(_0x071d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x071d('0x18'))['db'];config[_0x071d('0x19')]=_[_0x071d('0x1a')](config[_0x071d('0x19')],{'host':_0x071d('0x1b'),'port':0x18eb});var socket=require(_0x071d('0x1c'))(new Redis(config[_0x071d('0x19')]));require('./voiceQueueReport.socket')[_0x071d('0x1d')](socket);function respondWithStatusCode(_0x1bcdf6,_0x45a5a6){_0x45a5a6=_0x45a5a6||0xcc;return function(_0x36686a){if(_0x36686a){return _0x1bcdf6[_0x071d('0x1e')](_0x45a5a6);}return _0x1bcdf6[_0x071d('0x1f')](_0x45a5a6)[_0x071d('0x20')]();};}function respondWithResult(_0x8e7403,_0x453022){_0x453022=_0x453022||0xc8;return function(_0x5e7ac0){if(_0x5e7ac0){return _0x8e7403[_0x071d('0x1f')](_0x453022)[_0x071d('0x21')](_0x5e7ac0);}};}function respondWithFilteredResult(_0x2c675e,_0xcb81c1){return function(_0x3e386b){if(_0x3e386b){var _0x5cfc8c=typeof _0xcb81c1[_0x071d('0x22')]===_0x071d('0x23')&&typeof _0xcb81c1[_0x071d('0x24')]==='undefined';var _0x36146f=_0x3e386b[_0x071d('0x25')];var _0x37780c=_0x5cfc8c?0x0:_0xcb81c1[_0x071d('0x22')];var _0x5c4ceb=_0x5cfc8c?_0x3e386b['count']:_0xcb81c1[_0x071d('0x22')]+_0xcb81c1[_0x071d('0x24')];var _0x2d67d3;if(_0x5c4ceb>=_0x36146f){_0x5c4ceb=_0x36146f;_0x2d67d3=0xc8;}else{_0x2d67d3=0xce;}_0x2c675e['status'](_0x2d67d3);return _0x2c675e[_0x071d('0x26')]('Content-Range',_0x37780c+'-'+_0x5c4ceb+'/'+_0x36146f)[_0x071d('0x21')](_0x3e386b);}return null;};}function patchUpdates(_0x12fccf){return function(_0x2d028e){try{jsonpatch[_0x071d('0x27')](_0x2d028e,_0x12fccf,!![]);}catch(_0x4045c9){return BPromise[_0x071d('0x28')](_0x4045c9);}return _0x2d028e[_0x071d('0x29')]();};}function saveUpdates(_0x479505,_0x528bcb){return function(_0x51c654){if(_0x51c654){return _0x51c654[_0x071d('0x2a')](_0x479505)[_0x071d('0x2b')](function(_0x13d6e4){return _0x13d6e4;});}return null;};}function removeEntity(_0x2ab4b8,_0x34acaf){return function(_0xb0b7c){if(_0xb0b7c){return _0xb0b7c[_0x071d('0x2c')]()[_0x071d('0x2b')](function(){_0x2ab4b8[_0x071d('0x1f')](0xcc)[_0x071d('0x20')]();});}};}function handleEntityNotFound(_0x8b45c1,_0x26a75c){return function(_0x58ad32){if(!_0x58ad32){_0x8b45c1['sendStatus'](0x194);}return _0x58ad32;};}function handleError(_0x59311a,_0x57dc5c){_0x57dc5c=_0x57dc5c||0x1f4;return function(_0x48b727){logger[_0x071d('0x2d')](_0x48b727[_0x071d('0x2e')]);if(_0x48b727['name']){delete _0x48b727[_0x071d('0x2f')];}_0x59311a[_0x071d('0x1f')](_0x57dc5c)[_0x071d('0x30')](_0x48b727);};}exports['index']=function(_0x462845,_0x40b5c7){var _0xda57a5={},_0x338a={},_0x1816e0={'count':0x0,'rows':[]};var _0x1d291e=_[_0x071d('0x31')](db[_0x071d('0x32')]['rawAttributes'],function(_0xfa74d4){return{'name':_0xfa74d4['fieldName'],'type':_0xfa74d4[_0x071d('0x33')][_0x071d('0x34')]};});_0x338a['model']=_[_0x071d('0x31')](_0x1d291e,_0x071d('0x2f'));_0x338a[_0x071d('0x35')]=_[_0x071d('0x36')](_0x462845[_0x071d('0x35')]);_0x338a[_0x071d('0x37')]=_[_0x071d('0x38')](_0x338a[_0x071d('0x39')],_0x338a[_0x071d('0x35')]);_0xda57a5[_0x071d('0x3a')]=_[_0x071d('0x38')](_0x338a[_0x071d('0x39')],qs[_0x071d('0x3b')](_0x462845[_0x071d('0x35')]['fields']));_0xda57a5[_0x071d('0x3a')]=_0xda57a5[_0x071d('0x3a')][_0x071d('0x3c')]?_0xda57a5['attributes']:_0x338a[_0x071d('0x39')];if(!_0x462845['query'][_0x071d('0x3d')]('nolimit')){_0xda57a5[_0x071d('0x24')]=qs[_0x071d('0x24')](_0x462845['query'][_0x071d('0x24')]);_0xda57a5[_0x071d('0x22')]=qs['offset'](_0x462845['query'][_0x071d('0x22')]);}_0xda57a5[_0x071d('0x3e')]=qs[_0x071d('0x3f')](_0x462845['query'][_0x071d('0x3f')]);_0xda57a5[_0x071d('0x40')]=qs[_0x071d('0x37')](_[_0x071d('0x41')](_0x462845[_0x071d('0x35')],_0x338a['filters']),_0x1d291e);if(_0x462845[_0x071d('0x35')][_0x071d('0x42')]){_0xda57a5[_0x071d('0x40')]=_[_0x071d('0x43')](_0xda57a5[_0x071d('0x40')],{'$or':_[_0x071d('0x31')](_0x1d291e,function(_0x217233){if(_0x217233[_0x071d('0x33')]!==_0x071d('0x44')){var _0x4d4d00={};_0x4d4d00[_0x217233[_0x071d('0x2f')]]={'$like':'%'+_0x462845['query']['filter']+'%'};return _0x4d4d00;}})});}_0xda57a5=_[_0x071d('0x43')]({},_0xda57a5,_0x462845['options']);var _0x59350b={'where':_0xda57a5[_0x071d('0x40')]};return db[_0x071d('0x32')][_0x071d('0x25')](_0x59350b)[_0x071d('0x2b')](function(_0xaa67d4){_0x1816e0[_0x071d('0x25')]=_0xaa67d4;if(_0x462845[_0x071d('0x35')][_0x071d('0x45')]){_0xda57a5[_0x071d('0x46')]=[{'all':!![]}];}return db[_0x071d('0x32')][_0x071d('0x47')](_0xda57a5);})[_0x071d('0x2b')](function(_0x17c0d1){_0x1816e0[_0x071d('0x48')]=_0x17c0d1;return _0x1816e0;})[_0x071d('0x2b')](respondWithFilteredResult(_0x40b5c7,_0xda57a5))[_0x071d('0x49')](handleError(_0x40b5c7,null));};exports[_0x071d('0x4a')]=function(_0x5107dc,_0x20bfc7){var _0x47e8fd={'raw':![],'where':{'id':_0x5107dc[_0x071d('0x4b')]['id']}},_0x3f89b2={};_0x3f89b2['model']=_[_0x071d('0x36')](db[_0x071d('0x32')][_0x071d('0x4c')]);_0x3f89b2[_0x071d('0x35')]=_['keys'](_0x5107dc[_0x071d('0x35')]);_0x3f89b2[_0x071d('0x37')]=_[_0x071d('0x38')](_0x3f89b2[_0x071d('0x39')],_0x3f89b2[_0x071d('0x35')]);_0x47e8fd[_0x071d('0x3a')]=_[_0x071d('0x38')](_0x3f89b2[_0x071d('0x39')],qs[_0x071d('0x3b')](_0x5107dc['query']['fields']));_0x47e8fd['attributes']=_0x47e8fd['attributes']['length']?_0x47e8fd[_0x071d('0x3a')]:_0x3f89b2['model'];if(_0x5107dc[_0x071d('0x35')][_0x071d('0x45')]){_0x47e8fd['include']=[{'all':!![]}];}_0x47e8fd=_[_0x071d('0x43')]({},_0x47e8fd,_0x5107dc['options']);return db['VoiceQueueReport']['find'](_0x47e8fd)[_0x071d('0x2b')](handleEntityNotFound(_0x20bfc7,null))[_0x071d('0x2b')](respondWithResult(_0x20bfc7,null))[_0x071d('0x49')](handleError(_0x20bfc7,null));};exports[_0x071d('0x4d')]=function(_0x1c8f3b,_0x55f783){return db[_0x071d('0x32')]['create'](_0x1c8f3b[_0x071d('0x4e')],{})[_0x071d('0x2b')](respondWithResult(_0x55f783,0xc9))[_0x071d('0x49')](handleError(_0x55f783,null));};exports[_0x071d('0x2a')]=function(_0x81fe20,_0x4b832c){if(_0x81fe20[_0x071d('0x4e')]['id']){delete _0x81fe20[_0x071d('0x4e')]['id'];}return db['VoiceQueueReport'][_0x071d('0x4f')]({'where':{'id':_0x81fe20[_0x071d('0x4b')]['id']}})[_0x071d('0x2b')](handleEntityNotFound(_0x4b832c,null))[_0x071d('0x2b')](saveUpdates(_0x81fe20[_0x071d('0x4e')],null))[_0x071d('0x2b')](respondWithResult(_0x4b832c,null))[_0x071d('0x49')](handleError(_0x4b832c,null));};exports[_0x071d('0x2c')]=function(_0x179058,_0x8ba1e1){return db[_0x071d('0x32')][_0x071d('0x4f')]({'where':{'id':_0x179058['params']['id']}})[_0x071d('0x2b')](handleEntityNotFound(_0x8ba1e1,null))[_0x071d('0x2b')](removeEntity(_0x8ba1e1,null))[_0x071d('0x49')](handleError(_0x8ba1e1,null));};exports['describe']=function(_0x5b590e,_0x2eff9a){return db['VoiceQueueReport'][_0x071d('0x50')]()[_0x071d('0x2b')](respondWithResult(_0x2eff9a,null))[_0x071d('0x49')](handleError(_0x2eff9a,null));};exports[_0x071d('0x51')]=function(_0x133547,_0x2e6b21){var _0x353880={},_0xf1622d={},_0x430e83={'count':0x0,'rows':[]};_0xf1622d[_0x071d('0x39')]=_[_0x071d('0x36')](db[_0x071d('0x32')][_0x071d('0x4c')]);_0xf1622d[_0x071d('0x35')]=_[_0x071d('0x36')](_0x133547[_0x071d('0x35')]);_0xf1622d[_0x071d('0x37')]=_[_0x071d('0x38')](_0xf1622d[_0x071d('0x39')],_0xf1622d[_0x071d('0x35')]);_0x353880['attributes']=_[_0x071d('0x38')](_0xf1622d[_0x071d('0x39')],qs[_0x071d('0x3b')](_0x133547[_0x071d('0x35')][_0x071d('0x3b')]));_0x353880[_0x071d('0x3a')]=_0x353880[_0x071d('0x3a')][_0x071d('0x3c')]?_0x353880[_0x071d('0x3a')]:_0xf1622d[_0x071d('0x39')];if(!_0x133547[_0x071d('0x35')][_0x071d('0x3d')](_0x071d('0x52'))){_0x353880['limit']=qs[_0x071d('0x24')](_0x133547['query'][_0x071d('0x24')]);_0x353880['offset']=qs[_0x071d('0x22')](_0x133547[_0x071d('0x35')]['offset']);}_0x353880[_0x071d('0x3e')]=qs[_0x071d('0x3f')](_0x133547['query'][_0x071d('0x3f')]);_0x353880[_0x071d('0x40')]=qs['filters'](_[_0x071d('0x41')](_0x133547[_0x071d('0x35')],_0xf1622d[_0x071d('0x37')]));if(_0x133547[_0x071d('0x35')][_0x071d('0x42')]){_0x353880['where']=_[_0x071d('0x43')](_0x353880[_0x071d('0x40')],{'$or':_[_0x071d('0x31')](_0x353880[_0x071d('0x3a')],function(_0x66baf){var _0x4fc7df={};_0x4fc7df[_0x66baf]={'$like':'%'+_0x133547[_0x071d('0x35')]['filter']+'%'};return _0x4fc7df;})});}_0x353880=_[_0x071d('0x43')]({},_0x353880,_0x133547['options']);var _0x59502e={'where':_0x353880[_0x071d('0x40')]};return db[_0x071d('0x32')][_0x071d('0x25')](_0x59502e)[_0x071d('0x2b')](function(_0x1f567a){_0x430e83['count']=_0x1f567a;if(_0x133547[_0x071d('0x35')][_0x071d('0x45')]){_0x353880[_0x071d('0x46')]=[{'all':!![]}];}return db[_0x071d('0x32')][_0x071d('0x47')](_0x353880);})['then'](function(_0x1237ab){_0x430e83[_0x071d('0x48')]=_0x1237ab;return _0x430e83;})[_0x071d('0x2b')](respondWithFilteredResult(_0x2e6b21,_0x353880,_0x071d('0x51')))[_0x071d('0x49')](handleError(_0x2e6b21,null,_0x071d('0x51')));};
\ No newline at end of file
index 5f4d15e..af8fa4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f69=['exports','events','../../mysqldb','VoiceQueueReport','save','update','remove','emit','hasOwnProperty'];(function(_0x56d29f,_0x5edfbc){var _0x30aff8=function(_0xdea053){while(--_0xdea053){_0x56d29f['push'](_0x56d29f['shift']());}};_0x30aff8(++_0x5edfbc);}(_0x2f69,0x169));var _0x92f6=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x2f69[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require(_0x92f6('0x0'));var VoiceQueueReport=require(_0x92f6('0x1'))['db'][_0x92f6('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x92f6('0x3'),'afterUpdate':_0x92f6('0x4'),'afterDestroy':_0x92f6('0x5')};function emitEvent(_0x4d2a66){return function(_0x34af65,_0x14b03f,_0xc79c62){VoiceQueueReportEvents[_0x92f6('0x6')](_0x4d2a66+':'+_0x34af65['id'],_0x34af65);VoiceQueueReportEvents[_0x92f6('0x6')](_0x4d2a66,_0x34af65);_0xc79c62(null);};}for(var e in events){if(events[_0x92f6('0x7')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x92f6('0x8')]=VoiceQueueReportEvents;
\ No newline at end of file
+var _0xe51e=['hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit'];(function(_0x198c44,_0x1158d2){var _0x3d813c=function(_0x3a4eec){while(--_0x3a4eec){_0x198c44['push'](_0x198c44['shift']());}};_0x3d813c(++_0x1158d2);}(_0xe51e,0xde));var _0xee51=function(_0x111cd9,_0x1ef8a3){_0x111cd9=_0x111cd9-0x0;var _0x226dc0=_0xe51e[_0x111cd9];return _0x226dc0;};'use strict';var EventEmitter=require(_0xee51('0x0'));var VoiceQueueReport=require(_0xee51('0x1'))['db'][_0xee51('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xee51('0x3')](0x0);var events={'afterCreate':_0xee51('0x4'),'afterUpdate':_0xee51('0x5'),'afterDestroy':_0xee51('0x6')};function emitEvent(_0x438529){return function(_0x23da93,_0x5d7092,_0x47f626){VoiceQueueReportEvents[_0xee51('0x7')](_0x438529+':'+_0x23da93['id'],_0x23da93);VoiceQueueReportEvents[_0xee51('0x7')](_0x438529,_0x23da93);_0x47f626(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xee51('0x8')](e,emitEvent(event));}}module[_0xee51('0x9')]=VoiceQueueReportEvents;
\ No newline at end of file
index a355d0b..d057a83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x696a=['exports','define','VoiceQueueReport','report_queue','calleridnum','lodash','../../config/logger','api','moment','bluebird','path','rimraf','./voiceQueueReport.attributes'];(function(_0x52997d,_0x1af1f7){var _0x214f46=function(_0x1ef758){while(--_0x1ef758){_0x52997d['push'](_0x52997d['shift']());}};_0x214f46(++_0x1af1f7);}(_0x696a,0x164));var _0xa696=function(_0x5cc8b9,_0x20e3c3){_0x5cc8b9=_0x5cc8b9-0x0;var _0x58892e=_0x696a[_0x5cc8b9];return _0x58892e;};'use strict';var _=require(_0xa696('0x0'));var util=require('util');var logger=require(_0xa696('0x1'))(_0xa696('0x2'));var moment=require(_0xa696('0x3'));var BPromise=require(_0xa696('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa696('0x5'));var rimraf=require(_0xa696('0x6'));var config=require('../../config/environment');var attributes=require(_0xa696('0x7'));module[_0xa696('0x8')]=function(_0x94dfc6,_0x423432){return _0x94dfc6[_0xa696('0x9')](_0xa696('0xa'),attributes,{'tableName':_0xa696('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xa696('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe672=['api','moment','bluebird','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','uniqueid','lodash','util','../../config/logger'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xe672,0x8c));var _0x2e67=function(_0x1980a7,_0x31242d){_0x1980a7=_0x1980a7-0x0;var _0x350432=_0xe672[_0x1980a7];return _0x350432;};'use strict';var _=require(_0x2e67('0x0'));var util=require(_0x2e67('0x1'));var logger=require(_0x2e67('0x2'))(_0x2e67('0x3'));var moment=require(_0x2e67('0x4'));var BPromise=require(_0x2e67('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2e67('0x6'));var config=require(_0x2e67('0x7'));var attributes=require(_0x2e67('0x8'));module[_0x2e67('0x9')]=function(_0x5cee2d,_0x135124){return _0x5cee2d[_0x2e67('0xa')](_0x2e67('0xb'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x2e67('0xc')]},{'fields':['calleridnum']}],'timestamps':!![]});};
\ No newline at end of file
index 00af492..5a0a5f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41a9=['defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','map','include','model','CreateVoiceQueueReport','create','update','body','UpdateVoiceQueueReport','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x41a9,0x1cf));var _0x941a=function(_0x266a56,_0x3913bd){_0x266a56=_0x266a56-0x0;var _0x15ed23=_0x41a9[_0x266a56];return _0x15ed23;};'use strict';var _=require(_0x941a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x941a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x941a('0x2'));var db=require(_0x941a('0x3'))['db'];var utils=require(_0x941a('0x4'));var logger=require(_0x941a('0x5'))('rpc');var config=require(_0x941a('0x6'));var jayson=require(_0x941a('0x7'));var client=jayson['client'][_0x941a('0x8')]({'port':0x232a});config[_0x941a('0x9')]=_[_0x941a('0xa')](config['redis'],{'host':_0x941a('0xb'),'port':0x18eb});var socket=require(_0x941a('0xc'))(new Redis(config[_0x941a('0x9')]));require(_0x941a('0xd'))[_0x941a('0xe')](socket);function respondWithRpcPromise(_0x114227,_0x498eac,_0x1a0c32){return new BPromise(function(_0x285799,_0x9ad606){return client[_0x941a('0xf')](_0x114227,_0x1a0c32)[_0x941a('0x10')](function(_0x5716f8){logger[_0x941a('0x11')](_0x941a('0x12'),_0x498eac,_0x941a('0x13'));logger[_0x941a('0x14')](_0x941a('0x15'),_0x498eac,_0x941a('0x13'),JSON[_0x941a('0x16')](_0x5716f8));if(_0x5716f8[_0x941a('0x17')]){if(_0x5716f8[_0x941a('0x17')]['code']===0x1f4){logger['error'](_0x941a('0x12'),_0x498eac,_0x5716f8[_0x941a('0x17')][_0x941a('0x18')]);return _0x9ad606(_0x5716f8[_0x941a('0x17')][_0x941a('0x18')]);}logger['error'](_0x941a('0x12'),_0x498eac,_0x5716f8[_0x941a('0x17')][_0x941a('0x18')]);return _0x285799(_0x5716f8['error'][_0x941a('0x18')]);}else{logger[_0x941a('0x11')](_0x941a('0x12'),_0x498eac,_0x941a('0x13'));_0x285799(_0x5716f8[_0x941a('0x19')]['message']);}})[_0x941a('0x1a')](function(_0x3ceee6){logger[_0x941a('0x17')](_0x941a('0x12'),_0x498eac,_0x3ceee6);_0x9ad606(_0x3ceee6);});});}exports[_0x941a('0x1b')]=function(_0x2c3d70){var _0x4edc6a=this;return new Promise(function(_0x145496,_0x7bed8c){return db[_0x941a('0x1c')][_0x941a('0x1d')]({'raw':_0x2c3d70['options']?_0x2c3d70[_0x941a('0x1e')][_0x941a('0x1f')]===undefined?!![]:![]:!![],'where':_0x2c3d70['options']?_0x2c3d70[_0x941a('0x1e')][_0x941a('0x20')]||null:null,'attributes':_0x2c3d70[_0x941a('0x1e')]?_0x2c3d70[_0x941a('0x1e')][_0x941a('0x21')]||null:null,'limit':_0x2c3d70['options']?_0x2c3d70[_0x941a('0x1e')][_0x941a('0x22')]||null:null,'include':_0x2c3d70[_0x941a('0x1e')]?_0x2c3d70[_0x941a('0x1e')]['include']?_[_0x941a('0x23')](_0x2c3d70[_0x941a('0x1e')][_0x941a('0x24')],function(_0x5d1697){return{'model':db[_0x5d1697[_0x941a('0x25')]],'as':_0x5d1697['as'],'attributes':_0x5d1697[_0x941a('0x21')],'include':_0x5d1697[_0x941a('0x24')]?_[_0x941a('0x23')](_0x5d1697[_0x941a('0x24')],function(_0x376e8a){return{'model':db[_0x376e8a['model']],'as':_0x376e8a['as'],'attributes':_0x376e8a[_0x941a('0x21')],'include':_0x376e8a[_0x941a('0x24')]?_[_0x941a('0x23')](_0x376e8a[_0x941a('0x24')],function(_0x42dcb2){return{'model':db[_0x42dcb2[_0x941a('0x25')]],'as':_0x42dcb2['as'],'attributes':_0x42dcb2[_0x941a('0x21')]};}):[]};}):[]};}):[]:[]})[_0x941a('0x10')](function(_0x33a250){logger[_0x941a('0x11')](_0x941a('0x1b'),_0x2c3d70);logger[_0x941a('0x14')]('GetVoiceQueueReport',_0x2c3d70,JSON['stringify'](_0x33a250));_0x145496(_0x33a250);})[_0x941a('0x1a')](function(_0x2828a1){logger[_0x941a('0x17')]('GetVoiceQueueReport',_0x2828a1[_0x941a('0x18')],_0x2c3d70);_0x7bed8c(_0x4edc6a[_0x941a('0x17')](0x1f4,_0x2828a1[_0x941a('0x18')]));});});};exports[_0x941a('0x26')]=function(_0x555320){var _0x29f6cf=this;return new Promise(function(_0x81d798,_0x53e4b8){return db[_0x941a('0x1c')][_0x941a('0x27')](_0x555320['body'],{'raw':_0x555320[_0x941a('0x1e')]?_0x555320[_0x941a('0x1e')][_0x941a('0x1f')]===undefined?!![]:![]:!![]})[_0x941a('0x10')](function(_0x36c66b){logger[_0x941a('0x11')](_0x941a('0x26'),_0x555320);logger[_0x941a('0x14')](_0x941a('0x26'),_0x555320,JSON[_0x941a('0x16')](_0x36c66b));_0x81d798(_0x36c66b);})[_0x941a('0x1a')](function(_0x253154){logger[_0x941a('0x17')](_0x941a('0x26'),_0x253154['message'],_0x555320);_0x53e4b8(_0x29f6cf['error'](0x1f4,_0x253154[_0x941a('0x18')]));});});};exports['UpdateVoiceQueueReport']=function(_0x480bb9){var _0x3f76b0=this;return new Promise(function(_0x2fd180,_0x35b2da){return db['VoiceQueueReport'][_0x941a('0x28')](_0x480bb9[_0x941a('0x29')],{'raw':_0x480bb9[_0x941a('0x1e')]?_0x480bb9[_0x941a('0x1e')][_0x941a('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x480bb9[_0x941a('0x1e')]?_0x480bb9[_0x941a('0x1e')][_0x941a('0x20')]||null:null,'attributes':_0x480bb9[_0x941a('0x1e')]?_0x480bb9[_0x941a('0x1e')][_0x941a('0x21')]||null:null,'limit':_0x480bb9[_0x941a('0x1e')]?_0x480bb9[_0x941a('0x1e')][_0x941a('0x22')]||null:null})[_0x941a('0x10')](function(_0x21a63e){logger[_0x941a('0x11')](_0x941a('0x2a'),_0x480bb9);logger['debug'](_0x941a('0x2a'),_0x480bb9,JSON[_0x941a('0x16')](_0x21a63e));_0x2fd180(_0x21a63e);})[_0x941a('0x1a')](function(_0x12633b){logger[_0x941a('0x17')](_0x941a('0x2a'),_0x12633b['message'],_0x480bb9);_0x35b2da(_0x3f76b0['error'](0x1f4,_0x12633b[_0x941a('0x18')]));});});};
\ No newline at end of file
+var _0x34c9=['VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','findAll','options','raw','where','include','model','attributes','map','GetVoiceQueueReport','CreateVoiceQueueReport','VoiceQueueReport','create','UpdateVoiceQueueReport','body','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','debug'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x34c9,0x1b0));var _0x934c=function(_0x255cab,_0x53a59e){_0x255cab=_0x255cab-0x0;var _0x53fd8b=_0x34c9[_0x255cab];return _0x53fd8b;};'use strict';var _=require('lodash');var util=require(_0x934c('0x0'));var moment=require(_0x934c('0x1'));var BPromise=require(_0x934c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x934c('0x3'));var db=require(_0x934c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x934c('0x5'))(_0x934c('0x6'));var config=require('../../config/environment');var jayson=require(_0x934c('0x7'));var client=jayson[_0x934c('0x8')][_0x934c('0x9')]({'port':0x232a});config['redis']=_[_0x934c('0xa')](config[_0x934c('0xb')],{'host':_0x934c('0xc'),'port':0x18eb});var socket=require(_0x934c('0xd'))(new Redis(config[_0x934c('0xb')]));require('./voiceQueueReport.socket')[_0x934c('0xe')](socket);function respondWithRpcPromise(_0x410d1d,_0x20ff8f,_0x1a12cb){return new BPromise(function(_0xeeb1b,_0x21fef1){return client[_0x934c('0xf')](_0x410d1d,_0x1a12cb)[_0x934c('0x10')](function(_0x14c2a1){logger[_0x934c('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x20ff8f,'request\x20sent');logger[_0x934c('0x12')](_0x934c('0x13'),_0x20ff8f,_0x934c('0x14'),JSON[_0x934c('0x15')](_0x14c2a1));if(_0x14c2a1[_0x934c('0x16')]){if(_0x14c2a1[_0x934c('0x16')]['code']===0x1f4){logger[_0x934c('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x20ff8f,_0x14c2a1[_0x934c('0x16')]['message']);return _0x21fef1(_0x14c2a1[_0x934c('0x16')]['message']);}logger[_0x934c('0x16')](_0x934c('0x17'),_0x20ff8f,_0x14c2a1[_0x934c('0x16')][_0x934c('0x18')]);return _0xeeb1b(_0x14c2a1[_0x934c('0x16')][_0x934c('0x18')]);}else{logger[_0x934c('0x11')](_0x934c('0x17'),_0x20ff8f,_0x934c('0x14'));_0xeeb1b(_0x14c2a1[_0x934c('0x19')][_0x934c('0x18')]);}})[_0x934c('0x1a')](function(_0xf2a23e){logger[_0x934c('0x16')](_0x934c('0x17'),_0x20ff8f,_0xf2a23e);_0x21fef1(_0xf2a23e);});});}exports['GetVoiceQueueReport']=function(_0x1ef132){var _0x78dc47=this;return new Promise(function(_0x88973c,_0x20d10c){return db['VoiceQueueReport'][_0x934c('0x1b')]({'raw':_0x1ef132[_0x934c('0x1c')]?_0x1ef132[_0x934c('0x1c')][_0x934c('0x1d')]===undefined?!![]:![]:!![],'where':_0x1ef132[_0x934c('0x1c')]?_0x1ef132[_0x934c('0x1c')][_0x934c('0x1e')]||null:null,'attributes':_0x1ef132[_0x934c('0x1c')]?_0x1ef132['options']['attributes']||null:null,'limit':_0x1ef132[_0x934c('0x1c')]?_0x1ef132[_0x934c('0x1c')]['limit']||null:null,'include':_0x1ef132[_0x934c('0x1c')]?_0x1ef132[_0x934c('0x1c')][_0x934c('0x1f')]?_['map'](_0x1ef132[_0x934c('0x1c')][_0x934c('0x1f')],function(_0x3737f7){return{'model':db[_0x3737f7[_0x934c('0x20')]],'as':_0x3737f7['as'],'attributes':_0x3737f7[_0x934c('0x21')],'include':_0x3737f7[_0x934c('0x1f')]?_[_0x934c('0x22')](_0x3737f7['include'],function(_0x36a242){return{'model':db[_0x36a242[_0x934c('0x20')]],'as':_0x36a242['as'],'attributes':_0x36a242[_0x934c('0x21')],'include':_0x36a242[_0x934c('0x1f')]?_[_0x934c('0x22')](_0x36a242[_0x934c('0x1f')],function(_0x443099){return{'model':db[_0x443099[_0x934c('0x20')]],'as':_0x443099['as'],'attributes':_0x443099[_0x934c('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x40254f){logger[_0x934c('0x11')](_0x934c('0x23'),_0x1ef132);logger['debug']('GetVoiceQueueReport',_0x1ef132,JSON[_0x934c('0x15')](_0x40254f));_0x88973c(_0x40254f);})[_0x934c('0x1a')](function(_0x33c0f6){logger[_0x934c('0x16')](_0x934c('0x23'),_0x33c0f6[_0x934c('0x18')],_0x1ef132);_0x20d10c(_0x78dc47['error'](0x1f4,_0x33c0f6['message']));});});};exports[_0x934c('0x24')]=function(_0x2c390b){var _0x45e466=this;return new Promise(function(_0x2b3453,_0x28e134){return db[_0x934c('0x25')][_0x934c('0x26')](_0x2c390b['body'],{'raw':_0x2c390b['options']?_0x2c390b[_0x934c('0x1c')][_0x934c('0x1d')]===undefined?!![]:![]:!![]})[_0x934c('0x10')](function(_0x26428e){logger['info']('CreateVoiceQueueReport',_0x2c390b);logger[_0x934c('0x12')](_0x934c('0x24'),_0x2c390b,JSON[_0x934c('0x15')](_0x26428e));_0x2b3453(_0x26428e);})['catch'](function(_0x229843){logger[_0x934c('0x16')]('CreateVoiceQueueReport',_0x229843['message'],_0x2c390b);_0x28e134(_0x45e466[_0x934c('0x16')](0x1f4,_0x229843[_0x934c('0x18')]));});});};exports[_0x934c('0x27')]=function(_0x2546e2){var _0x501bb2=this;return new Promise(function(_0x3d5681,_0x458844){return db['VoiceQueueReport']['update'](_0x2546e2[_0x934c('0x28')],{'raw':_0x2546e2[_0x934c('0x1c')]?_0x2546e2[_0x934c('0x1c')][_0x934c('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2546e2['options']?_0x2546e2['options'][_0x934c('0x1e')]||null:null,'attributes':_0x2546e2[_0x934c('0x1c')]?_0x2546e2['options'][_0x934c('0x21')]||null:null,'limit':_0x2546e2[_0x934c('0x1c')]?_0x2546e2['options']['limit']||null:null})['then'](function(_0x593175){logger[_0x934c('0x11')](_0x934c('0x27'),_0x2546e2);logger[_0x934c('0x12')](_0x934c('0x27'),_0x2546e2,JSON[_0x934c('0x15')](_0x593175));_0x3d5681(_0x593175);})[_0x934c('0x1a')](function(_0x35f36e){logger[_0x934c('0x16')](_0x934c('0x27'),_0x35f36e[_0x934c('0x18')],_0x2546e2);_0x458844(_0x501bb2[_0x934c('0x16')](0x1f4,_0x35f36e['message']));});});};
\ No newline at end of file
index 2c75595..ad86e41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb39f=['remove','update','emit','removeListener','length','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0x4410f9,_0x175692){var _0x2b2000=function(_0x276ae3){while(--_0x276ae3){_0x4410f9['push'](_0x4410f9['shift']());}};_0x2b2000(++_0x175692);}(_0xb39f,0x1e6));var _0xfb39=function(_0x47854d,_0x402a91){_0x47854d=_0x47854d-0x0;var _0x12d3e8=_0xb39f[_0x47854d];return _0x12d3e8;};'use strict';var VoiceQueueReportEvents=require(_0xfb39('0x0'));var events=[_0xfb39('0x1'),_0xfb39('0x2'),_0xfb39('0x3')];function createListener(_0x5ba2ac,_0x4bc0e0){return function(_0x588127){_0x4bc0e0[_0xfb39('0x4')](_0x5ba2ac,_0x588127);};}function removeListener(_0x50f9a1,_0x3d2ee9){return function(){VoiceQueueReportEvents[_0xfb39('0x5')](_0x50f9a1,_0x3d2ee9);};}exports['register']=function(_0x1619f6){for(var _0x455dbe=0x0,_0x45bb1c=events[_0xfb39('0x6')];_0x455dbe<_0x45bb1c;_0x455dbe++){var _0x4ce401=events[_0x455dbe];var _0x4daba2=createListener(_0xfb39('0x7')+_0x4ce401,_0x1619f6);VoiceQueueReportEvents['on'](_0x4ce401,_0x4daba2);}};
\ No newline at end of file
+var _0x0e17=['remove','update','emit','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0x1f5057,_0x359308){var _0x29a63b=function(_0x33ccd7){while(--_0x33ccd7){_0x1f5057['push'](_0x1f5057['shift']());}};_0x29a63b(++_0x359308);}(_0x0e17,0xd6));var _0x70e1=function(_0x42301f,_0x11243d){_0x42301f=_0x42301f-0x0;var _0x56411d=_0x0e17[_0x42301f];return _0x56411d;};'use strict';var VoiceQueueReportEvents=require(_0x70e1('0x0'));var events=[_0x70e1('0x1'),_0x70e1('0x2'),_0x70e1('0x3')];function createListener(_0x35862c,_0x45b94b){return function(_0x9289d7){_0x45b94b[_0x70e1('0x4')](_0x35862c,_0x9289d7);};}function removeListener(_0x406801,_0x2c62b8){return function(){VoiceQueueReportEvents[_0x70e1('0x5')](_0x406801,_0x2c62b8);};}exports[_0x70e1('0x6')]=function(_0x4cb0b1){for(var _0xc64213=0x0,_0x16a2ad=events[_0x70e1('0x7')];_0xc64213<_0x16a2ad;_0xc64213++){var _0x27f310=events[_0xc64213];var _0x26218a=createListener(_0x70e1('0x8')+_0x27f310,_0x4cb0b1);VoiceQueueReportEvents['on'](_0x27f310,_0x26218a);}};
\ No newline at end of file
index 3180442..b2b98ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0689=['exports','multer','path','express','Router','fs-extra','../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy'];(function(_0x128641,_0x1ec4c1){var _0x228d4c=function(_0x13604e){while(--_0x13604e){_0x128641['push'](_0x128641['shift']());}};_0x228d4c(++_0x1ec4c1);}(_0x0689,0x10f));var _0x9068=function(_0xeec31d,_0x189f0c){_0xeec31d=_0xeec31d-0x0;var _0x5915e1=_0x0689[_0xeec31d];return _0x5915e1;};'use strict';var multer=require(_0x9068('0x0'));var util=require('util');var path=require(_0x9068('0x1'));var timeout=require('connect-timeout');var express=require(_0x9068('0x2'));var router=express[_0x9068('0x3')]();var fs_extra=require(_0x9068('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9068('0x5'));var config=require('../../config/environment');var controller=require(_0x9068('0x6'));router[_0x9068('0x7')]('/',auth[_0x9068('0x8')](),controller['index']);router['get'](_0x9068('0x9'),auth[_0x9068('0x8')](),controller[_0x9068('0xa')]);router[_0x9068('0xb')]('/',auth[_0x9068('0x8')](),controller[_0x9068('0xc')]);router[_0x9068('0xd')](_0x9068('0x9'),auth[_0x9068('0x8')](),controller[_0x9068('0xe')]);router[_0x9068('0xf')](_0x9068('0x9'),auth[_0x9068('0x8')](),controller[_0x9068('0x10')]);module[_0x9068('0x11')]=router;
\ No newline at end of file
+var _0x1c75=['put','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','post','isAuthenticated','create'];(function(_0x4fdc46,_0x2a3759){var _0x2c178a=function(_0x59ead9){while(--_0x59ead9){_0x4fdc46['push'](_0x4fdc46['shift']());}};_0x2c178a(++_0x2a3759);}(_0x1c75,0xf4));var _0x51c7=function(_0x38ed42,_0x3d9a37){_0x38ed42=_0x38ed42-0x0;var _0x474931=_0x1c75[_0x38ed42];return _0x474931;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x51c7('0x0'));var express=require(_0x51c7('0x1'));var router=express[_0x51c7('0x2')]();var fs_extra=require(_0x51c7('0x3'));var auth=require(_0x51c7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x51c7('0x5'));var controller=require('./voiceQueuesLog.controller');router[_0x51c7('0x6')]('/',auth['isAuthenticated'](),controller[_0x51c7('0x7')]);router[_0x51c7('0x6')](_0x51c7('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x51c7('0x9')]('/',auth[_0x51c7('0xa')](),controller[_0x51c7('0xb')]);router[_0x51c7('0xc')](_0x51c7('0x8'),auth[_0x51c7('0xa')](),controller['update']);router[_0x51c7('0xd')](_0x51c7('0x8'),auth[_0x51c7('0xa')](),controller[_0x51c7('0xe')]);module[_0x51c7('0xf')]=router;
\ No newline at end of file
index eeaf2b6..30b4088 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc4d=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports','STRING','DATE'];(function(_0x454018,_0x46e33a){var _0x24697d=function(_0x3ec647){while(--_0x3ec647){_0x454018['push'](_0x454018['shift']());}};_0x24697d(++_0x46e33a);}(_0xdc4d,0x9d));var _0xddc4=function(_0x4ba46e,_0x3bc6e0){_0x4ba46e=_0x4ba46e-0x0;var _0x5e3360=_0xdc4d[_0x4ba46e];return _0x5e3360;};'use strict';var Sequelize=require(_0xddc4('0x0'));var moment=require(_0xddc4('0x1'));module[_0xddc4('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0xddc4('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xddc4('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xddc4('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xddc4('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xddc4('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xddc4('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xddc4('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xddc4('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xddc4('0x4')],'allowNull':![],'defaultValue':Sequelize['literal'](_0xddc4('0x5'))}};
\ No newline at end of file
+var _0x36eb=['moment','exports','STRING','DATE','literal'];(function(_0x529a1f,_0x41480f){var _0x51177e=function(_0x544bed){while(--_0x544bed){_0x529a1f['push'](_0x529a1f['shift']());}};_0x51177e(++_0x41480f);}(_0x36eb,0x168));var _0xb36e=function(_0x5eb697,_0x4c0076){_0x5eb697=_0x5eb697-0x0;var _0x5f67e0=_0x36eb[_0x5eb697];return _0x5f67e0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb36e('0x0'));module[_0xb36e('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xb36e('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xb36e('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xb36e('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xb36e('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xb36e('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xb36e('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xb36e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xb36e('0x4')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}};
\ No newline at end of file
index 8b08f63..c0f70d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2727=['length','include','catch','create','body','destroy','find','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','set','reject','save','update','then','error','name','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','findAll','rows','show','params','VoiceQueuesLog'];(function(_0x10e7d6,_0x48fd96){var _0x44839a=function(_0x2fbd0d){while(--_0x2fbd0d){_0x10e7d6['push'](_0x10e7d6['shift']());}};_0x44839a(++_0x48fd96);}(_0x2727,0x11b));var _0x7272=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x2727[_0x1cfa0d];return _0xe33279;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7272('0x0'));var zipdir=require(_0x7272('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7272('0x2'));var BPromise=require(_0x7272('0x3'));var Mustache=require(_0x7272('0x4'));var util=require(_0x7272('0x5'));var path=require(_0x7272('0x6'));var sox=require(_0x7272('0x7'));var csv=require(_0x7272('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7272('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x7272('0xa'));var toCsv=require(_0x7272('0x8'));var querystring=require(_0x7272('0xb'));var Papa=require(_0x7272('0xc'));var Redis=require(_0x7272('0xd'));var authService=require(_0x7272('0xe'));var qs=require(_0x7272('0xf'));var as=require(_0x7272('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7272('0x11'))(_0x7272('0x12'));var utils=require('../../config/utils');var config=require(_0x7272('0x13'));var licenseUtil=require(_0x7272('0x14'));var db=require(_0x7272('0x15'))['db'];function respondWithStatusCode(_0x411def,_0x4a521f){_0x4a521f=_0x4a521f||0xcc;return function(_0x29a494){if(_0x29a494){return _0x411def[_0x7272('0x16')](_0x4a521f);}return _0x411def[_0x7272('0x17')](_0x4a521f)[_0x7272('0x18')]();};}function respondWithResult(_0xd5c420,_0x3739ad){_0x3739ad=_0x3739ad||0xc8;return function(_0x52e854){if(_0x52e854){return _0xd5c420[_0x7272('0x17')](_0x3739ad)[_0x7272('0x19')](_0x52e854);}};}function respondWithFilteredResult(_0x43fc6f,_0x5eb552){return function(_0x3c3f40){if(_0x3c3f40){var _0xabe3b4=typeof _0x5eb552['offset']==='undefined'&&typeof _0x5eb552['limit']==='undefined';var _0x642414=_0x3c3f40['count'];var _0x111a3f=_0xabe3b4?0x0:_0x5eb552[_0x7272('0x1a')];var _0x26f021=_0xabe3b4?_0x3c3f40['count']:_0x5eb552[_0x7272('0x1a')]+_0x5eb552[_0x7272('0x1b')];var _0x3e96fc;if(_0x26f021>=_0x642414){_0x26f021=_0x642414;_0x3e96fc=0xc8;}else{_0x3e96fc=0xce;}_0x43fc6f[_0x7272('0x17')](_0x3e96fc);return _0x43fc6f[_0x7272('0x1c')]('Content-Range',_0x111a3f+'-'+_0x26f021+'/'+_0x642414)[_0x7272('0x19')](_0x3c3f40);}return null;};}function patchUpdates(_0x241871){return function(_0x37e208){try{jsonpatch['apply'](_0x37e208,_0x241871,!![]);}catch(_0x46fa8f){return BPromise[_0x7272('0x1d')](_0x46fa8f);}return _0x37e208[_0x7272('0x1e')]();};}function saveUpdates(_0x3b20d2,_0x1bac14){return function(_0x26875f){if(_0x26875f){return _0x26875f[_0x7272('0x1f')](_0x3b20d2)['then'](function(_0x1f0a7c){return _0x1f0a7c;});}return null;};}function removeEntity(_0xb04a17,_0x371246){return function(_0x41ae77){if(_0x41ae77){return _0x41ae77['destroy']()[_0x7272('0x20')](function(){_0xb04a17['status'](0xcc)[_0x7272('0x18')]();});}};}function handleEntityNotFound(_0x3bb5ce,_0x4b4d60){return function(_0x4aa4c5){if(!_0x4aa4c5){_0x3bb5ce[_0x7272('0x16')](0x194);}return _0x4aa4c5;};}function handleError(_0x5881e7,_0xb2316e){_0xb2316e=_0xb2316e||0x1f4;return function(_0x3e06be){logger[_0x7272('0x21')](_0x3e06be['stack']);if(_0x3e06be[_0x7272('0x22')]){delete _0x3e06be[_0x7272('0x22')];}_0x5881e7['status'](_0xb2316e)['send'](_0x3e06be);};}exports['index']=function(_0x5f2f47,_0x30581e){var _0x128ba0={},_0x39383d={},_0x3787d2={'count':0x0,'rows':[]};var _0x224947=_[_0x7272('0x23')](db['VoiceQueuesLog'][_0x7272('0x24')],function(_0x1f42fb){return{'name':_0x1f42fb[_0x7272('0x25')],'type':_0x1f42fb[_0x7272('0x26')]['key']};});_0x39383d['model']=_[_0x7272('0x23')](_0x224947,_0x7272('0x22'));_0x39383d[_0x7272('0x27')]=_[_0x7272('0x28')](_0x5f2f47[_0x7272('0x27')]);_0x39383d[_0x7272('0x29')]=_[_0x7272('0x2a')](_0x39383d[_0x7272('0x2b')],_0x39383d[_0x7272('0x27')]);_0x128ba0['attributes']=_['intersection'](_0x39383d[_0x7272('0x2b')],qs[_0x7272('0x2c')](_0x5f2f47[_0x7272('0x27')]['fields']));_0x128ba0[_0x7272('0x2d')]=_0x128ba0[_0x7272('0x2d')]['length']?_0x128ba0[_0x7272('0x2d')]:_0x39383d['model'];if(!_0x5f2f47[_0x7272('0x27')][_0x7272('0x2e')](_0x7272('0x2f'))){_0x128ba0['limit']=qs[_0x7272('0x1b')](_0x5f2f47['query'][_0x7272('0x1b')]);_0x128ba0['offset']=qs['offset'](_0x5f2f47[_0x7272('0x27')][_0x7272('0x1a')]);}_0x128ba0[_0x7272('0x30')]=qs[_0x7272('0x31')](_0x5f2f47[_0x7272('0x27')][_0x7272('0x31')]);_0x128ba0[_0x7272('0x32')]=qs['filters'](_[_0x7272('0x33')](_0x5f2f47[_0x7272('0x27')],_0x39383d[_0x7272('0x29')]),_0x224947);if(_0x5f2f47[_0x7272('0x27')][_0x7272('0x34')]){_0x128ba0[_0x7272('0x32')]=_[_0x7272('0x35')](_0x128ba0['where'],{'$or':_[_0x7272('0x23')](_0x224947,function(_0x1a2ab2){if(_0x1a2ab2[_0x7272('0x26')]!=='VIRTUAL'){var _0x10a9bb={};_0x10a9bb[_0x1a2ab2[_0x7272('0x22')]]={'$like':'%'+_0x5f2f47[_0x7272('0x27')][_0x7272('0x34')]+'%'};return _0x10a9bb;}})});}_0x128ba0=_[_0x7272('0x35')]({},_0x128ba0,_0x5f2f47[_0x7272('0x36')]);var _0x2203b7={'where':_0x128ba0[_0x7272('0x32')]};return db['VoiceQueuesLog'][_0x7272('0x37')](_0x2203b7)[_0x7272('0x20')](function(_0x120ca9){_0x3787d2[_0x7272('0x37')]=_0x120ca9;if(_0x5f2f47[_0x7272('0x27')][_0x7272('0x38')]){_0x128ba0['include']=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x7272('0x39')](_0x128ba0);})['then'](function(_0x21b948){_0x3787d2[_0x7272('0x3a')]=_0x21b948;return _0x3787d2;})[_0x7272('0x20')](respondWithFilteredResult(_0x30581e,_0x128ba0))['catch'](handleError(_0x30581e,null));};exports[_0x7272('0x3b')]=function(_0x31a0db,_0x47cc56){var _0x1db7af={'raw':!![],'where':{'id':_0x31a0db[_0x7272('0x3c')]['id']}},_0x4da591={};_0x4da591[_0x7272('0x2b')]=_[_0x7272('0x28')](db[_0x7272('0x3d')][_0x7272('0x24')]);_0x4da591[_0x7272('0x27')]=_[_0x7272('0x28')](_0x31a0db['query']);_0x4da591[_0x7272('0x29')]=_[_0x7272('0x2a')](_0x4da591['model'],_0x4da591[_0x7272('0x27')]);_0x1db7af['attributes']=_['intersection'](_0x4da591[_0x7272('0x2b')],qs[_0x7272('0x2c')](_0x31a0db[_0x7272('0x27')][_0x7272('0x2c')]));_0x1db7af[_0x7272('0x2d')]=_0x1db7af['attributes'][_0x7272('0x3e')]?_0x1db7af['attributes']:_0x4da591['model'];if(_0x31a0db[_0x7272('0x27')][_0x7272('0x38')]){_0x1db7af[_0x7272('0x3f')]=[{'all':!![]}];}_0x1db7af=_[_0x7272('0x35')]({},_0x1db7af,_0x31a0db['options']);return db['VoiceQueuesLog']['find'](_0x1db7af)[_0x7272('0x20')](handleEntityNotFound(_0x47cc56,null))['then'](respondWithResult(_0x47cc56,null))[_0x7272('0x40')](handleError(_0x47cc56,null));};exports[_0x7272('0x41')]=function(_0x11cbd5,_0x14626){return db[_0x7272('0x3d')][_0x7272('0x41')](_0x11cbd5[_0x7272('0x42')],{})['then'](respondWithResult(_0x14626,0xc9))[_0x7272('0x40')](handleError(_0x14626,null));};exports['update']=function(_0x1eb020,_0x42d256){if(_0x1eb020[_0x7272('0x42')]['id']){delete _0x1eb020['body']['id'];}return db[_0x7272('0x3d')]['find']({'where':{'id':_0x1eb020[_0x7272('0x3c')]['id']}})['then'](handleEntityNotFound(_0x42d256,null))['then'](saveUpdates(_0x1eb020['body'],null))[_0x7272('0x20')](respondWithResult(_0x42d256,null))[_0x7272('0x40')](handleError(_0x42d256,null));};exports[_0x7272('0x43')]=function(_0x394800,_0x3377c9){return db[_0x7272('0x3d')][_0x7272('0x44')]({'where':{'id':_0x394800[_0x7272('0x3c')]['id']}})[_0x7272('0x20')](handleEntityNotFound(_0x3377c9,null))[_0x7272('0x20')](removeEntity(_0x3377c9,null))[_0x7272('0x40')](handleError(_0x3377c9,null));};
\ No newline at end of file
+var _0x6347=['offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','then','includeAll','include','VoiceQueuesLog','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x205e37,_0x58a1bb){var _0x35918f=function(_0x314dbe){while(--_0x314dbe){_0x205e37['push'](_0x205e37['shift']());}};_0x35918f(++_0x58a1bb);}(_0x6347,0xbd));var _0x7634=function(_0x19290d,_0x268a1f){_0x19290d=_0x19290d-0x0;var _0x598de8=_0x6347[_0x19290d];return _0x598de8;};'use strict';var emlformat=require(_0x7634('0x0'));var rimraf=require(_0x7634('0x1'));var zipdir=require(_0x7634('0x2'));var jsonpatch=require(_0x7634('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7634('0x4'));var util=require(_0x7634('0x5'));var path=require('path');var sox=require(_0x7634('0x6'));var csv=require(_0x7634('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7634('0x8'));var squel=require(_0x7634('0x9'));var crypto=require(_0x7634('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7634('0x7'));var querystring=require(_0x7634('0xb'));var Papa=require(_0x7634('0xc'));var Redis=require(_0x7634('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x7634('0xe'));var as=require(_0x7634('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7634('0x10'))('api');var utils=require(_0x7634('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x7634('0x12'));var db=require(_0x7634('0x13'))['db'];function respondWithStatusCode(_0x4adb2c,_0x8978a3){_0x8978a3=_0x8978a3||0xcc;return function(_0x4777d){if(_0x4777d){return _0x4adb2c[_0x7634('0x14')](_0x8978a3);}return _0x4adb2c[_0x7634('0x15')](_0x8978a3)[_0x7634('0x16')]();};}function respondWithResult(_0x404d92,_0x1bcd32){_0x1bcd32=_0x1bcd32||0xc8;return function(_0x19e69e){if(_0x19e69e){return _0x404d92[_0x7634('0x15')](_0x1bcd32)[_0x7634('0x17')](_0x19e69e);}};}function respondWithFilteredResult(_0x5b15b0,_0x47d9c6){return function(_0x563650){if(_0x563650){var _0x3c7434=typeof _0x47d9c6[_0x7634('0x18')]===_0x7634('0x19')&&typeof _0x47d9c6[_0x7634('0x1a')]==='undefined';var _0x1185e0=_0x563650[_0x7634('0x1b')];var _0x1891a9=_0x3c7434?0x0:_0x47d9c6[_0x7634('0x18')];var _0x1d39cc=_0x3c7434?_0x563650['count']:_0x47d9c6[_0x7634('0x18')]+_0x47d9c6['limit'];var _0x2338e7;if(_0x1d39cc>=_0x1185e0){_0x1d39cc=_0x1185e0;_0x2338e7=0xc8;}else{_0x2338e7=0xce;}_0x5b15b0[_0x7634('0x15')](_0x2338e7);return _0x5b15b0['set'](_0x7634('0x1c'),_0x1891a9+'-'+_0x1d39cc+'/'+_0x1185e0)[_0x7634('0x17')](_0x563650);}return null;};}function patchUpdates(_0x4baa68){return function(_0x5cb0ae){try{jsonpatch[_0x7634('0x1d')](_0x5cb0ae,_0x4baa68,!![]);}catch(_0x202598){return BPromise[_0x7634('0x1e')](_0x202598);}return _0x5cb0ae[_0x7634('0x1f')]();};}function saveUpdates(_0x5ea333,_0x30a3ef){return function(_0x81b6d4){if(_0x81b6d4){return _0x81b6d4[_0x7634('0x20')](_0x5ea333)['then'](function(_0x258f7e){return _0x258f7e;});}return null;};}function removeEntity(_0x312152,_0x2f40f8){return function(_0x5b0094){if(_0x5b0094){return _0x5b0094[_0x7634('0x21')]()['then'](function(){_0x312152[_0x7634('0x15')](0xcc)[_0x7634('0x16')]();});}};}function handleEntityNotFound(_0x30a75d,_0x3e4793){return function(_0x701c4c){if(!_0x701c4c){_0x30a75d[_0x7634('0x14')](0x194);}return _0x701c4c;};}function handleError(_0x563587,_0x5efd38){_0x5efd38=_0x5efd38||0x1f4;return function(_0x5d38ab){logger[_0x7634('0x22')](_0x5d38ab[_0x7634('0x23')]);if(_0x5d38ab['name']){delete _0x5d38ab[_0x7634('0x24')];}_0x563587['status'](_0x5efd38)[_0x7634('0x25')](_0x5d38ab);};}exports['index']=function(_0x436bb5,_0x369309){var _0x476580={},_0xec3ad7={},_0x456657={'count':0x0,'rows':[]};var _0x6a506c=_[_0x7634('0x26')](db['VoiceQueuesLog'][_0x7634('0x27')],function(_0x529295){return{'name':_0x529295[_0x7634('0x28')],'type':_0x529295[_0x7634('0x29')][_0x7634('0x2a')]};});_0xec3ad7[_0x7634('0x2b')]=_['map'](_0x6a506c,_0x7634('0x24'));_0xec3ad7[_0x7634('0x2c')]=_[_0x7634('0x2d')](_0x436bb5[_0x7634('0x2c')]);_0xec3ad7['filters']=_['intersection'](_0xec3ad7[_0x7634('0x2b')],_0xec3ad7[_0x7634('0x2c')]);_0x476580[_0x7634('0x2e')]=_[_0x7634('0x2f')](_0xec3ad7['model'],qs[_0x7634('0x30')](_0x436bb5[_0x7634('0x2c')][_0x7634('0x30')]));_0x476580[_0x7634('0x2e')]=_0x476580['attributes'][_0x7634('0x31')]?_0x476580['attributes']:_0xec3ad7[_0x7634('0x2b')];if(!_0x436bb5['query']['hasOwnProperty'](_0x7634('0x32'))){_0x476580[_0x7634('0x1a')]=qs[_0x7634('0x1a')](_0x436bb5[_0x7634('0x2c')]['limit']);_0x476580[_0x7634('0x18')]=qs['offset'](_0x436bb5[_0x7634('0x2c')][_0x7634('0x18')]);}_0x476580[_0x7634('0x33')]=qs['sort'](_0x436bb5[_0x7634('0x2c')]['sort']);_0x476580[_0x7634('0x34')]=qs[_0x7634('0x35')](_[_0x7634('0x36')](_0x436bb5['query'],_0xec3ad7[_0x7634('0x35')]),_0x6a506c);if(_0x436bb5[_0x7634('0x2c')][_0x7634('0x37')]){_0x476580['where']=_[_0x7634('0x38')](_0x476580[_0x7634('0x34')],{'$or':_[_0x7634('0x26')](_0x6a506c,function(_0x5788cb){if(_0x5788cb['type']!==_0x7634('0x39')){var _0x34fd81={};_0x34fd81[_0x5788cb['name']]={'$like':'%'+_0x436bb5[_0x7634('0x2c')][_0x7634('0x37')]+'%'};return _0x34fd81;}})});}_0x476580=_[_0x7634('0x38')]({},_0x476580,_0x436bb5[_0x7634('0x3a')]);var _0x5889ef={'where':_0x476580[_0x7634('0x34')]};return db['VoiceQueuesLog']['count'](_0x5889ef)[_0x7634('0x3b')](function(_0x247a66){_0x456657['count']=_0x247a66;if(_0x436bb5[_0x7634('0x2c')][_0x7634('0x3c')]){_0x476580[_0x7634('0x3d')]=[{'all':!![]}];}return db[_0x7634('0x3e')][_0x7634('0x3f')](_0x476580);})[_0x7634('0x3b')](function(_0x215e6f){_0x456657[_0x7634('0x40')]=_0x215e6f;return _0x456657;})[_0x7634('0x3b')](respondWithFilteredResult(_0x369309,_0x476580))[_0x7634('0x41')](handleError(_0x369309,null));};exports[_0x7634('0x42')]=function(_0x153258,_0x3686b8){var _0x20dcc1={'raw':!![],'where':{'id':_0x153258[_0x7634('0x43')]['id']}},_0x2af8b2={};_0x2af8b2['model']=_[_0x7634('0x2d')](db[_0x7634('0x3e')][_0x7634('0x27')]);_0x2af8b2[_0x7634('0x2c')]=_['keys'](_0x153258['query']);_0x2af8b2[_0x7634('0x35')]=_['intersection'](_0x2af8b2[_0x7634('0x2b')],_0x2af8b2['query']);_0x20dcc1[_0x7634('0x2e')]=_[_0x7634('0x2f')](_0x2af8b2[_0x7634('0x2b')],qs[_0x7634('0x30')](_0x153258[_0x7634('0x2c')][_0x7634('0x30')]));_0x20dcc1[_0x7634('0x2e')]=_0x20dcc1[_0x7634('0x2e')]['length']?_0x20dcc1['attributes']:_0x2af8b2['model'];if(_0x153258[_0x7634('0x2c')][_0x7634('0x3c')]){_0x20dcc1[_0x7634('0x3d')]=[{'all':!![]}];}_0x20dcc1=_['merge']({},_0x20dcc1,_0x153258[_0x7634('0x3a')]);return db['VoiceQueuesLog'][_0x7634('0x44')](_0x20dcc1)[_0x7634('0x3b')](handleEntityNotFound(_0x3686b8,null))[_0x7634('0x3b')](respondWithResult(_0x3686b8,null))[_0x7634('0x41')](handleError(_0x3686b8,null));};exports['create']=function(_0x54ba3a,_0x123d9c){return db[_0x7634('0x3e')][_0x7634('0x45')](_0x54ba3a[_0x7634('0x46')],{})['then'](respondWithResult(_0x123d9c,0xc9))[_0x7634('0x41')](handleError(_0x123d9c,null));};exports[_0x7634('0x20')]=function(_0x3e3faf,_0x3eaf41){if(_0x3e3faf[_0x7634('0x46')]['id']){delete _0x3e3faf[_0x7634('0x46')]['id'];}return db[_0x7634('0x3e')]['find']({'where':{'id':_0x3e3faf['params']['id']}})['then'](handleEntityNotFound(_0x3eaf41,null))['then'](saveUpdates(_0x3e3faf[_0x7634('0x46')],null))[_0x7634('0x3b')](respondWithResult(_0x3eaf41,null))[_0x7634('0x41')](handleError(_0x3eaf41,null));};exports[_0x7634('0x21')]=function(_0x20be1a,_0x1ef1ee){return db['VoiceQueuesLog'][_0x7634('0x44')]({'where':{'id':_0x20be1a[_0x7634('0x43')]['id']}})[_0x7634('0x3b')](handleEntityNotFound(_0x1ef1ee,null))[_0x7634('0x3b')](removeEntity(_0x1ef1ee,null))['catch'](handleError(_0x1ef1ee,null));};
\ No newline at end of file
index 02dcd56..4db9ece 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ddd=['define','VoiceQueuesLog','voice_queues_log','event_dtm','dtm','lodash','path','rimraf','../../config/environment','exports'];(function(_0x3f85bb,_0x43b18b){var _0x52b060=function(_0x35b128){while(--_0x35b128){_0x3f85bb['push'](_0x3f85bb['shift']());}};_0x52b060(++_0x43b18b);}(_0x4ddd,0x18b));var _0xd4dd=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x4ddd[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0xd4dd('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd4dd('0x1'));var rimraf=require(_0xd4dd('0x2'));var config=require(_0xd4dd('0x3'));var attributes=require('./voiceQueuesLog.attributes');module[_0xd4dd('0x4')]=function(_0x207f91,_0x2796e1){return _0x207f91[_0xd4dd('0x5')](_0xd4dd('0x6'),attributes,{'tableName':_0xd4dd('0x7'),'paranoid':![],'indexes':[{'name':_0xd4dd('0x8'),'fields':['event',_0xd4dd('0x9')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x1c75=['event','dtm','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','VoiceQueuesLog'];(function(_0x39ac23,_0x426b9f){var _0x53d4c7=function(_0x20a6d5){while(--_0x20a6d5){_0x39ac23['push'](_0x39ac23['shift']());}};_0x53d4c7(++_0x426b9f);}(_0x1c75,0xf4));var _0x51c7=function(_0x3d1996,_0x1f08f0){_0x3d1996=_0x3d1996-0x0;var _0x550afd=_0x1c75[_0x3d1996];return _0x550afd;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x51c7('0x0'));var moment=require(_0x51c7('0x1'));var BPromise=require(_0x51c7('0x2'));var rp=require(_0x51c7('0x3'));var fs=require('fs');var path=require(_0x51c7('0x4'));var rimraf=require('rimraf');var config=require(_0x51c7('0x5'));var attributes=require('./voiceQueuesLog.attributes');module[_0x51c7('0x6')]=function(_0x5c67ac,_0x406764){return _0x5c67ac[_0x51c7('0x7')](_0x51c7('0x8'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x51c7('0x9'),_0x51c7('0xa')]}],'timestamps':![]});};
\ No newline at end of file
index 4648846..cbb2503 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d4d=['code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3f763e,_0x278a4c){var _0x1d5e38=function(_0x321dda){while(--_0x321dda){_0x3f763e['push'](_0x3f763e['shift']());}};_0x1d5e38(++_0x278a4c);}(_0x2d4d,0x94));var _0xd2d4=function(_0x222a66,_0x223db7){_0x222a66=_0x222a66-0x0;var _0x751d38=_0x2d4d[_0x222a66];return _0x751d38;};'use strict';var _=require(_0xd2d4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd2d4('0x1'));var fs=require('fs');var Redis=require(_0xd2d4('0x2'));var db=require(_0xd2d4('0x3'))['db'];var utils=require(_0xd2d4('0x4'));var logger=require(_0xd2d4('0x5'))(_0xd2d4('0x6'));var config=require(_0xd2d4('0x7'));var jayson=require(_0xd2d4('0x8'));var client=jayson[_0xd2d4('0x9')][_0xd2d4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56d1e3,_0x23e700,_0x57bae4){return new BPromise(function(_0x45176e,_0x89452c){return client[_0xd2d4('0xb')](_0x56d1e3,_0x57bae4)[_0xd2d4('0xc')](function(_0x2db655){logger[_0xd2d4('0xd')](_0xd2d4('0xe'),_0x23e700,_0xd2d4('0xf'));logger[_0xd2d4('0x10')](_0xd2d4('0x11'),_0x23e700,_0xd2d4('0xf'),JSON[_0xd2d4('0x12')](_0x2db655));if(_0x2db655[_0xd2d4('0x13')]){if(_0x2db655[_0xd2d4('0x13')][_0xd2d4('0x14')]===0x1f4){logger[_0xd2d4('0x13')](_0xd2d4('0xe'),_0x23e700,_0x2db655[_0xd2d4('0x13')][_0xd2d4('0x15')]);return _0x89452c(_0x2db655[_0xd2d4('0x13')][_0xd2d4('0x15')]);}logger[_0xd2d4('0x13')](_0xd2d4('0xe'),_0x23e700,_0x2db655[_0xd2d4('0x13')][_0xd2d4('0x15')]);return _0x45176e(_0x2db655[_0xd2d4('0x13')][_0xd2d4('0x15')]);}else{logger[_0xd2d4('0xd')](_0xd2d4('0xe'),_0x23e700,'request\x20sent');_0x45176e(_0x2db655[_0xd2d4('0x16')][_0xd2d4('0x15')]);}})[_0xd2d4('0x17')](function(_0x21e7a1){logger['error'](_0xd2d4('0xe'),_0x23e700,_0x21e7a1);_0x89452c(_0x21e7a1);});});}
\ No newline at end of file
+var _0x1a49=['message','info','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x153372,_0x3317b1){var _0x27f691=function(_0x69985e){while(--_0x69985e){_0x153372['push'](_0x153372['shift']());}};_0x27f691(++_0x3317b1);}(_0x1a49,0xf6));var _0x91a4=function(_0x546c2a,_0x14df51){_0x546c2a=_0x546c2a-0x0;var _0x1e0b94=_0x1a49[_0x546c2a];return _0x1e0b94;};'use strict';var _=require(_0x91a4('0x0'));var util=require(_0x91a4('0x1'));var moment=require(_0x91a4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x91a4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x91a4('0x4'));var logger=require(_0x91a4('0x5'))('rpc');var config=require(_0x91a4('0x6'));var jayson=require(_0x91a4('0x7'));var client=jayson[_0x91a4('0x8')][_0x91a4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2842e3,_0x4afd74,_0x55f3a8){return new BPromise(function(_0x43c4cc,_0x5a0b6c){return client[_0x91a4('0xa')](_0x2842e3,_0x55f3a8)[_0x91a4('0xb')](function(_0x3b8c4d){logger['info'](_0x91a4('0xc'),_0x4afd74,'request\x20sent');logger[_0x91a4('0xd')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x4afd74,_0x91a4('0xe'),JSON[_0x91a4('0xf')](_0x3b8c4d));if(_0x3b8c4d['error']){if(_0x3b8c4d[_0x91a4('0x10')][_0x91a4('0x11')]===0x1f4){logger[_0x91a4('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4afd74,_0x3b8c4d['error'][_0x91a4('0x12')]);return _0x5a0b6c(_0x3b8c4d[_0x91a4('0x10')]['message']);}logger[_0x91a4('0x10')](_0x91a4('0xc'),_0x4afd74,_0x3b8c4d[_0x91a4('0x10')][_0x91a4('0x12')]);return _0x43c4cc(_0x3b8c4d[_0x91a4('0x10')][_0x91a4('0x12')]);}else{logger[_0x91a4('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4afd74,_0x91a4('0xe'));_0x43c4cc(_0x3b8c4d[_0x91a4('0x14')][_0x91a4('0x12')]);}})[_0x91a4('0x15')](function(_0x5b3bda){logger['error'](_0x91a4('0xc'),_0x4afd74,_0x5b3bda);_0x5a0b6c(_0x5b3bda);});});}
\ No newline at end of file
index f8422d3..4aaecd7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x562f=['show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','get','isAuthenticated','/describe','describe','/:id'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x562f,0xa5));var _0xf562=function(_0x1dad4f,_0x13b837){_0x1dad4f=_0x1dad4f-0x0;var _0x22468b=_0x562f[_0x1dad4f];return _0x22468b;};'use strict';var multer=require('multer');var util=require(_0xf562('0x0'));var path=require('path');var timeout=require(_0xf562('0x1'));var express=require(_0xf562('0x2'));var router=express['Router']();var fs_extra=require(_0xf562('0x3'));var auth=require(_0xf562('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router[_0xf562('0x5')]('/',auth[_0xf562('0x6')](),controller['index']);router[_0xf562('0x5')](_0xf562('0x7'),auth[_0xf562('0x6')](),controller[_0xf562('0x8')]);router['get'](_0xf562('0x9'),auth[_0xf562('0x6')](),controller[_0xf562('0xa')]);router[_0xf562('0x5')](_0xf562('0xb'),auth[_0xf562('0x6')](),controller[_0xf562('0xc')]);router[_0xf562('0x5')](_0xf562('0xd'),controller[_0xf562('0xe')]);router['get'](_0xf562('0xf'),auth[_0xf562('0x6')](),controller[_0xf562('0x10')]);router[_0xf562('0x11')]('/',auth[_0xf562('0x6')](),controller[_0xf562('0x12')]);router[_0xf562('0x11')](_0xf562('0xf'),auth[_0xf562('0x6')](),controller[_0xf562('0x13')]);router[_0xf562('0x14')](_0xf562('0x9'),auth[_0xf562('0x6')](),controller[_0xf562('0x15')]);router[_0xf562('0x16')](_0xf562('0x9'),auth[_0xf562('0x6')](),controller[_0xf562('0x17')]);module[_0xf562('0x18')]=router;
\ No newline at end of file
+var _0x0186=['runTranscribe','put','update','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','post','create','/:id/transcribe'];(function(_0x290758,_0x533cd6){var _0xd9d01d=function(_0x11a672){while(--_0x11a672){_0x290758['push'](_0x290758['shift']());}};_0xd9d01d(++_0x533cd6);}(_0x0186,0x67));var _0x6018=function(_0x862d65,_0x394a71){_0x862d65=_0x862d65-0x0;var _0x56ab79=_0x0186[_0x862d65];return _0x56ab79;};'use strict';var multer=require(_0x6018('0x0'));var util=require(_0x6018('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6018('0x2'));var router=express[_0x6018('0x3')]();var fs_extra=require(_0x6018('0x4'));var auth=require(_0x6018('0x5'));var interaction=require(_0x6018('0x6'));var config=require('../../config/environment');var controller=require(_0x6018('0x7'));router['get']('/',auth[_0x6018('0x8')](),controller[_0x6018('0x9')]);router[_0x6018('0xa')](_0x6018('0xb'),auth[_0x6018('0x8')](),controller[_0x6018('0xc')]);router['get'](_0x6018('0xd'),auth[_0x6018('0x8')](),controller[_0x6018('0xe')]);router[_0x6018('0xa')](_0x6018('0xf'),auth[_0x6018('0x8')](),controller[_0x6018('0x10')]);router[_0x6018('0xa')](_0x6018('0x11'),controller[_0x6018('0x12')]);router[_0x6018('0xa')]('/:id/transcribe',auth[_0x6018('0x8')](),controller['downloadTranscribe']);router[_0x6018('0x13')]('/',auth[_0x6018('0x8')](),controller[_0x6018('0x14')]);router[_0x6018('0x13')](_0x6018('0x15'),auth[_0x6018('0x8')](),controller[_0x6018('0x16')]);router[_0x6018('0x17')](_0x6018('0xd'),auth['isAuthenticated'](),controller[_0x6018('0x18')]);router['delete'](_0x6018('0xd'),auth[_0x6018('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 907f589..8ee9f58 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(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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 6374051..5d0fc97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e8f=['create','body','find','describe','download','../../components/encryptor','value','existsSync','decryptFile','Sequelize','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','sequelize','MD5','uniqueid','token','$and','push','%s.cypher','secrets','recording','ValidationError','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','runTranscribe','findOne','transcribe','transcribeRegion','bucket','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','transcribeAccountId','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','language','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','papaparse','aws-sdk','uuid/v4','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','VoiceRecording','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','options','includeAll','rows','catch','show','params','include'];(function(_0xdabc03,_0x3cfdcf){var _0x10c7ad=function(_0x461492){while(--_0x461492){_0xdabc03['push'](_0xdabc03['shift']());}};_0x10c7ad(++_0x3cfdcf);}(_0x9e8f,0x175));var _0xf9e8=function(_0x50ee8a,_0x1b7e6f){_0x50ee8a=_0x50ee8a-0x0;var _0x2f2281=_0x9e8f[_0x50ee8a];return _0x2f2281;};'use strict';var emlformat=require(_0xf9e8('0x0'));var rimraf=require(_0xf9e8('0x1'));var zipdir=require(_0xf9e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf9e8('0x3'));var BPromise=require(_0xf9e8('0x4'));var Mustache=require(_0xf9e8('0x5'));var util=require(_0xf9e8('0x6'));var path=require(_0xf9e8('0x7'));var sox=require(_0xf9e8('0x8'));var csv=require(_0xf9e8('0x9'));var ejs=require(_0xf9e8('0xa'));var fs=require('fs');var fs_extra=require(_0xf9e8('0xb'));var _=require(_0xf9e8('0xc'));var squel=require('squel');var crypto=require(_0xf9e8('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf9e8('0x9'));var querystring=require('querystring');var Papa=require(_0xf9e8('0xe'));var AWS=require(_0xf9e8('0xf'));var uuidv4=require(_0xf9e8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf9e8('0x11'));var as=require(_0xf9e8('0x12'));var hardwareService=require(_0xf9e8('0x13'));var logger=require(_0xf9e8('0x14'))(_0xf9e8('0x15'));var utils=require(_0xf9e8('0x16'));var config=require(_0xf9e8('0x17'));var licenseUtil=require(_0xf9e8('0x18'));var db=require(_0xf9e8('0x19'))['db'];function respondWithStatusCode(_0x55fbc8,_0x434f2c){_0x434f2c=_0x434f2c||0xcc;return function(_0x4bbaf3){if(_0x4bbaf3){return _0x55fbc8[_0xf9e8('0x1a')](_0x434f2c);}return _0x55fbc8[_0xf9e8('0x1b')](_0x434f2c)[_0xf9e8('0x1c')]();};}function respondWithResult(_0x245c29,_0x1b934c){_0x1b934c=_0x1b934c||0xc8;return function(_0x3722e5){if(_0x3722e5){return _0x245c29[_0xf9e8('0x1b')](_0x1b934c)['json'](_0x3722e5);}};}function respondWithFilteredResult(_0x2af74b,_0x471136){return function(_0x1739e4){if(_0x1739e4){var _0x3ba52e=typeof _0x471136['offset']===_0xf9e8('0x1d')&&typeof _0x471136['limit']===_0xf9e8('0x1d');var _0x60f14f=_0x1739e4[_0xf9e8('0x1e')];var _0x2c7278=_0x3ba52e?0x0:_0x471136['offset'];var _0x8b08e4=_0x3ba52e?_0x1739e4['count']:_0x471136[_0xf9e8('0x1f')]+_0x471136[_0xf9e8('0x20')];var _0x59e4b3;if(_0x8b08e4>=_0x60f14f){_0x8b08e4=_0x60f14f;_0x59e4b3=0xc8;}else{_0x59e4b3=0xce;}_0x2af74b['status'](_0x59e4b3);return _0x2af74b[_0xf9e8('0x21')]('Content-Range',_0x2c7278+'-'+_0x8b08e4+'/'+_0x60f14f)['json'](_0x1739e4);}return null;};}function patchUpdates(_0x539e0c){return function(_0x44c1b3){try{jsonpatch[_0xf9e8('0x22')](_0x44c1b3,_0x539e0c,!![]);}catch(_0x5cc182){return BPromise[_0xf9e8('0x23')](_0x5cc182);}return _0x44c1b3[_0xf9e8('0x24')]();};}function saveUpdates(_0x5b944d,_0x1d9d5c){return function(_0x312b0b){if(_0x312b0b){return _0x312b0b[_0xf9e8('0x25')](_0x5b944d)[_0xf9e8('0x26')](function(_0x1fcade){return _0x1fcade;});}return null;};}function removeEntity(_0x13444c,_0x2914e3){return function(_0x9d0dcf){if(_0x9d0dcf){return _0x9d0dcf[_0xf9e8('0x27')]()['then'](function(){_0x13444c[_0xf9e8('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9c85c2,_0x538285){return function(_0x5759eb){if(!_0x5759eb){_0x9c85c2['sendStatus'](0x194);}return _0x5759eb;};}function handleError(_0x4055c9,_0xd98389){_0xd98389=_0xd98389||0x1f4;return function(_0x4261a1){logger['error'](_0x4261a1[_0xf9e8('0x28')]);if(_0x4261a1[_0xf9e8('0x29')]){delete _0x4261a1[_0xf9e8('0x29')];}_0x4055c9['status'](_0xd98389)[_0xf9e8('0x2a')](_0x4261a1);};}exports[_0xf9e8('0x2b')]=function(_0x593f95,_0x20683c){var _0x58fa26={},_0xcbf9a7={},_0x3f20b0={'count':0x0,'rows':[]};var _0x3564d7=_[_0xf9e8('0x2c')](db[_0xf9e8('0x2d')]['rawAttributes'],function(_0x4c656b){return{'name':_0x4c656b[_0xf9e8('0x2e')],'type':_0x4c656b[_0xf9e8('0x2f')][_0xf9e8('0x30')]};});_0xcbf9a7[_0xf9e8('0x31')]=_[_0xf9e8('0x32')](_[_0xf9e8('0x2c')](_0x3564d7,_0xf9e8('0x29')),[_0xf9e8('0x33')]);_0xcbf9a7[_0xf9e8('0x34')]=_[_0xf9e8('0x35')](_0x593f95[_0xf9e8('0x34')]);_0xcbf9a7[_0xf9e8('0x36')]=_[_0xf9e8('0x37')](_0xcbf9a7['model'],_0xcbf9a7[_0xf9e8('0x34')]);_0x58fa26[_0xf9e8('0x38')]=_[_0xf9e8('0x37')](_0xcbf9a7[_0xf9e8('0x31')],qs[_0xf9e8('0x39')](_0x593f95['query'][_0xf9e8('0x39')]));_0x58fa26[_0xf9e8('0x38')]=_0x58fa26[_0xf9e8('0x38')][_0xf9e8('0x3a')]?_0x58fa26[_0xf9e8('0x38')]:_0xcbf9a7['model'];if(!_0x593f95['query'][_0xf9e8('0x3b')]('nolimit')){_0x58fa26[_0xf9e8('0x20')]=qs[_0xf9e8('0x20')](_0x593f95[_0xf9e8('0x34')][_0xf9e8('0x20')]);_0x58fa26['offset']=qs[_0xf9e8('0x1f')](_0x593f95[_0xf9e8('0x34')][_0xf9e8('0x1f')]);}_0x58fa26['order']=qs[_0xf9e8('0x3c')](_0x593f95[_0xf9e8('0x34')][_0xf9e8('0x3c')]);_0x58fa26[_0xf9e8('0x3d')]=qs[_0xf9e8('0x36')](_['pick'](_0x593f95[_0xf9e8('0x34')],_0xcbf9a7[_0xf9e8('0x36')]),_0x3564d7);if(_0x593f95[_0xf9e8('0x34')][_0xf9e8('0x3e')]){_0x58fa26[_0xf9e8('0x3d')]=_['merge'](_0x58fa26['where'],{'$or':_['map'](_0x3564d7,function(_0x58b617){if(_0x58b617[_0xf9e8('0x2f')]!=='VIRTUAL'){var _0x39dfef={};_0x39dfef[_0x58b617[_0xf9e8('0x29')]]={'$like':'%'+_0x593f95[_0xf9e8('0x34')]['filter']+'%'};return _0x39dfef;}})});}_0x58fa26=_[_0xf9e8('0x3f')]({},_0x58fa26,_0x593f95[_0xf9e8('0x40')]);var _0x20ddf7={'where':_0x58fa26[_0xf9e8('0x3d')]};return db[_0xf9e8('0x2d')]['count'](_0x20ddf7)['then'](function(_0xc43b9b){_0x3f20b0[_0xf9e8('0x1e')]=_0xc43b9b;if(_0x593f95[_0xf9e8('0x34')][_0xf9e8('0x41')]){_0x58fa26['include']=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x58fa26);})[_0xf9e8('0x26')](function(_0x4442a3){_0x3f20b0[_0xf9e8('0x42')]=_0x4442a3;return _0x3f20b0;})['then'](respondWithFilteredResult(_0x20683c,_0x58fa26))[_0xf9e8('0x43')](handleError(_0x20683c,null));};exports[_0xf9e8('0x44')]=function(_0x51ac82,_0x540173){var _0x3e91e1={'raw':![],'where':{'id':_0x51ac82[_0xf9e8('0x45')]['id']}},_0x5bf451={};_0x5bf451['model']=_['keys'](db[_0xf9e8('0x2d')]['rawAttributes']);_0x5bf451[_0xf9e8('0x34')]=_[_0xf9e8('0x35')](_0x51ac82[_0xf9e8('0x34')]);_0x5bf451[_0xf9e8('0x36')]=_[_0xf9e8('0x37')](_0x5bf451[_0xf9e8('0x31')],_0x5bf451[_0xf9e8('0x34')]);_0x3e91e1['attributes']=_[_0xf9e8('0x37')](_0x5bf451[_0xf9e8('0x31')],qs[_0xf9e8('0x39')](_0x51ac82[_0xf9e8('0x34')][_0xf9e8('0x39')]));_0x3e91e1[_0xf9e8('0x38')]=_0x3e91e1[_0xf9e8('0x38')][_0xf9e8('0x3a')]?_0x3e91e1[_0xf9e8('0x38')]:_0x5bf451[_0xf9e8('0x31')];if(_0x51ac82[_0xf9e8('0x34')][_0xf9e8('0x41')]){_0x3e91e1[_0xf9e8('0x46')]=[{'all':!![]}];}_0x3e91e1=_['merge']({},_0x3e91e1,_0x51ac82[_0xf9e8('0x40')]);return db[_0xf9e8('0x2d')]['find'](_0x3e91e1)[_0xf9e8('0x26')](handleEntityNotFound(_0x540173,null))[_0xf9e8('0x26')](respondWithResult(_0x540173,null))[_0xf9e8('0x43')](handleError(_0x540173,null));};exports[_0xf9e8('0x47')]=function(_0x9110cb,_0x387778){return db[_0xf9e8('0x2d')]['create'](_0x9110cb[_0xf9e8('0x48')],{})[_0xf9e8('0x26')](respondWithResult(_0x387778,0xc9))['catch'](handleError(_0x387778,null));};exports[_0xf9e8('0x25')]=function(_0x11197b,_0x5cf23b){if(_0x11197b[_0xf9e8('0x48')]['id']){delete _0x11197b[_0xf9e8('0x48')]['id'];}return db[_0xf9e8('0x2d')][_0xf9e8('0x49')]({'where':{'id':_0x11197b[_0xf9e8('0x45')]['id']}})[_0xf9e8('0x26')](handleEntityNotFound(_0x5cf23b,null))[_0xf9e8('0x26')](saveUpdates(_0x11197b[_0xf9e8('0x48')],null))[_0xf9e8('0x26')](respondWithResult(_0x5cf23b,null))[_0xf9e8('0x43')](handleError(_0x5cf23b,null));};exports[_0xf9e8('0x4a')]=function(_0x288ea2,_0x4bcc2e){return db[_0xf9e8('0x2d')][_0xf9e8('0x4a')]()[_0xf9e8('0x26')](respondWithResult(_0x4bcc2e,null))['catch'](handleError(_0x4bcc2e,null));};exports[_0xf9e8('0x4b')]=function(_0x191d0c,_0x26995f,_0x32e2da){var _0x3621c9=require(_0xf9e8('0x4c'));var _0x1dc0ae=![];var _0x2a14d5={};if(_0x191d0c[_0xf9e8('0x34')]['type']&&_0x191d0c[_0xf9e8('0x34')][_0xf9e8('0x2f')]==='uniqueid'){_0x2a14d5['uniqueid']=_0x191d0c[_0xf9e8('0x45')]['id'];}else{_0x2a14d5['id']=_0x191d0c[_0xf9e8('0x45')]['id'];}return db[_0xf9e8('0x2d')][_0xf9e8('0x49')]({'where':_0x2a14d5,'attributes':['id',_0xf9e8('0x4d')],'raw':!![]})[_0xf9e8('0x26')](handleEntityNotFound(_0x26995f,null))['then'](function(_0x400af1){if(_0x400af1){var _0x5619c4=_0x400af1['value'];var _0x336446=util[_0xf9e8('0x33')]('%s.cypher',_0x5619c4);if(fs[_0xf9e8('0x4e')](_0x336446)){_0x1dc0ae=!![];return _0x3621c9[_0xf9e8('0x4f')](_0x336446,_0x5619c4,config['secrets']['recording'])[_0xf9e8('0x26')](function(){return _0x400af1;});}return _0x400af1;}})['then'](function(_0x457723){if(_0x457723){var _0x2265ef=_0x457723['value'];if(!fs['existsSync'](_0x2265ef)){throw new db[(_0xf9e8('0x50'))]['ValidationError'](_0xf9e8('0x51'));}if(_0x457723[_0xf9e8('0x52')]){return _0x26995f[_0xf9e8('0x4b')](_0x2265ef,_0x457723[_0xf9e8('0x52')]+path[_0xf9e8('0x53')](_0x2265ef),function(){if(_0x1dc0ae){fs['unlink'](_0x2265ef);}});}else{return _0x26995f[_0xf9e8('0x4b')](_0x2265ef,function(_0x44ffe2){if(_0x1dc0ae){fs[_0xf9e8('0x54')](_0x2265ef);}});}}})['catch'](function(_0x146144){if(_0x146144[_0xf9e8('0x55')]===_0xf9e8('0x51')){_0x26995f[_0xf9e8('0x1b')](0x194)[_0xf9e8('0x2a')](_0xf9e8('0x56'));}else{return handleError(_0x26995f,null);}});};exports['downloads']=function(_0xb44757,_0x201a1e,_0x1b7ce7){var _0x9128e5=require(_0xf9e8('0x4c'));var _0x3b1d4b=![];var _0x549705={'$and':[db[_0xf9e8('0x57')]['where'](db[_0xf9e8('0x57')]['fn'](_0xf9e8('0x58'),db[_0xf9e8('0x57')]['col'](_0xf9e8('0x59'))),_0xb44757['query'][_0xf9e8('0x5a')])]};if(_0xb44757[_0xf9e8('0x34')][_0xf9e8('0x2f')]&&_0xb44757['query'][_0xf9e8('0x2f')]===_0xf9e8('0x59')){_0x549705[_0xf9e8('0x5b')][_0xf9e8('0x5c')]({'uniqueid':_0xb44757[_0xf9e8('0x45')]['id']});}else{_0x549705['$and'][_0xf9e8('0x5c')]({'id':_0xb44757['params']['id']});}return db['VoiceRecording'][_0xf9e8('0x49')]({'where':_0x549705,'attributes':['id',_0xf9e8('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x201a1e,null))[_0xf9e8('0x26')](function(_0x4c2b82){if(_0x4c2b82){var _0x2a1660=util[_0xf9e8('0x33')](_0xf9e8('0x5d'),_0x4c2b82[_0xf9e8('0x4d')]);if(fs[_0xf9e8('0x4e')](_0x2a1660)){_0x3b1d4b=!![];return _0x9128e5[_0xf9e8('0x4f')](_0x2a1660,_0x4c2b82[_0xf9e8('0x4d')],config[_0xf9e8('0x5e')][_0xf9e8('0x5f')])[_0xf9e8('0x26')](function(){return _0x4c2b82;});}return _0x4c2b82;}})[_0xf9e8('0x26')](function(_0x2df90d){if(_0x2df90d){if(!fs['existsSync'](_0x2df90d['value'])){throw new db[(_0xf9e8('0x50'))][(_0xf9e8('0x60'))]('VoiceRecording\x20not\x20found');}if(_0x2df90d[_0xf9e8('0x52')]){return _0x201a1e[_0xf9e8('0x4b')](_0x2df90d[_0xf9e8('0x4d')],_0x2df90d['filename']+path[_0xf9e8('0x53')](_0x2df90d[_0xf9e8('0x4d')]),function(){if(_0x3b1d4b){fs[_0xf9e8('0x54')](_0x2df90d['value']);}});}else{return _0x201a1e['download'](_0x2df90d[_0xf9e8('0x4d')],function(_0x2937ce){if(_0x3b1d4b){fs[_0xf9e8('0x54')](_0x2df90d['value']);}});}}})[_0xf9e8('0x43')](handleError(_0x201a1e,null));};exports['destroy']=function(_0x4a6d69,_0x240577){return db[_0xf9e8('0x2d')][_0xf9e8('0x49')]({'where':{'id':_0x4a6d69[_0xf9e8('0x45')]['id']}})['then'](function(_0xce4ab1){if(_[_0xf9e8('0x61')](_0xce4ab1)){throw new ReferenceError(_0xf9e8('0x62'));}return _0xce4ab1;})[_0xf9e8('0x26')](function(_0x365246){var _0x51ea72=_0x365246[_0xf9e8('0x4d')];logger[_0xf9e8('0x63')](_0xf9e8('0x64'),_0x51ea72);if(!_['isNil'](_0x365246[_0xf9e8('0x4d')])&&fs[_0xf9e8('0x4e')](_0x51ea72)){logger[_0xf9e8('0x63')](_0xf9e8('0x65')+_0x51ea72+_0xf9e8('0x66'));fs[_0xf9e8('0x67')](_0x51ea72);}_0x51ea72=_0x51ea72+_0xf9e8('0x68');if(!_['isNil'](_0x365246[_0xf9e8('0x4d')])&&fs[_0xf9e8('0x4e')](_0x51ea72)){logger['info'](_0xf9e8('0x65')+_0x51ea72+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xf9e8('0x67')](_0x51ea72);}return _0x365246;})['then'](function(_0x3a0458){if(!_0x3a0458)throw new InternalError();return _0x3a0458[_0xf9e8('0x27')]();})[_0xf9e8('0x26')](function(){_0x240577[_0xf9e8('0x1b')](0xcc)['end']();})[_0xf9e8('0x43')](handleError(_0x240577,null));};function getBucketslist(_0x29b5a1,_0x3e7dca,_0x4c7b08){return new Promise(function(_0x31eb47,_0x379694){var _0x20bc45=new AWS['S3']({'accessKeyId':_0x3e7dca,'secretAccessKey':_0x29b5a1,'region':_0x4c7b08});_0x20bc45[_0xf9e8('0x69')]({},function(_0x13ea8d,_0x501bf6){if(_0x13ea8d){return _0x379694(_0x13ea8d);}else{return _0x31eb47(_0x501bf6);}});});}function createBucket(_0x45495e,_0x44e6f4,_0x2103c4,_0x30d556){return new Promise(function(_0x23ede5,_0x504621){var _0x2fb0b7=new AWS['S3']({'accessKeyId':_0x44e6f4,'secretAccessKey':_0x45495e,'region':_0x2103c4});_0x2fb0b7[_0xf9e8('0x6a')]({'Bucket':_0x30d556},function(_0x3ce29d,_0x4cc693){if(_0x3ce29d){return _0x504621(_0x3ce29d);}else{return _0x23ede5(_0x4cc693);}});});}function uploadFile(_0x25184e,_0x34e14e,_0x49c318,_0x39bb92,_0x5e3657,_0x3cd5a2){return new Promise(function(_0x5b57d3,_0x5d6cbb){var _0x4e27b2=new AWS['S3']({'accessKeyId':_0x34e14e,'secretAccessKey':_0x25184e,'region':_0x49c318});_0x4e27b2['upload']({'Bucket':_0x39bb92,'Key':_0x5e3657,'Body':_0x3cd5a2},function(_0x208f65,_0x372bb8){if(_0x208f65){return _0x5d6cbb(_0x208f65);}else{return _0x5b57d3(_0x372bb8);}});});}function startTranscribe(_0xcda5aa,_0x599597,_0x522b42,_0x81671e,_0x12bc48,_0x245ca3){return new Promise(function(_0x292099,_0x5b0911){var _0x7a8566=new AWS[(_0xf9e8('0x6b'))]({'accessKeyId':_0x599597,'secretAccessKey':_0xcda5aa,'region':_0x522b42});_0x7a8566[_0xf9e8('0x6c')]({'TranscriptionJobName':_0x81671e,'LanguageCode':_0x12bc48,'Media':{'MediaFileUri':_0x245ca3}},function(_0x28b591,_0xe411b3){if(_0x28b591){return _0x5b0911(_0x28b591);}else{return _0x292099(_0xe411b3);}});});}function transcribe(_0x40a14d,_0x4d43ea,_0x5dc9a2,_0x1c8e57,_0x37cbb5,_0x1ca9f8,_0x1aec61){return new Promise(function(_0x4d57aa,_0x33b40f){var _0x40ed7b={};logger[_0xf9e8('0x63')](util[_0xf9e8('0x33')](_0xf9e8('0x6d'),_0x40a14d,_0x37cbb5));return uploadFile(_0x4d43ea,_0x5dc9a2,_0x1c8e57,_0x37cbb5,path[_0xf9e8('0x6e')](_0x1ca9f8),fs[_0xf9e8('0x6f')](_0x1ca9f8))[_0xf9e8('0x26')](function(_0x1ff486){logger[_0xf9e8('0x63')](util[_0xf9e8('0x33')](_0xf9e8('0x70'),_0x40a14d,_0x37cbb5,_0x1ff486['Location']));_0x40ed7b['bucket']=_0x1ff486[_0xf9e8('0x71')];_0x40ed7b[_0xf9e8('0x72')]=_0x1ff486[_0xf9e8('0x73')];logger['info'](util[_0xf9e8('0x33')](_0xf9e8('0x74'),_0x40a14d));return startTranscribe(_0x4d43ea,_0x5dc9a2,_0x1c8e57,uuidv4(),_0x1aec61,_0x1ff486[_0xf9e8('0x73')]);})[_0xf9e8('0x26')](function(_0x636ca6){logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x40a14d,_0x636ca6[_0xf9e8('0x75')][_0xf9e8('0x76')]));_0x40ed7b[_0xf9e8('0x77')]=_0x636ca6['TranscriptionJob'][_0xf9e8('0x76')];_0x40ed7b[_0xf9e8('0x78')]=_0x636ca6[_0xf9e8('0x75')]['TranscriptionJobStatus'];return _0x4d57aa(_0x40ed7b);})[_0xf9e8('0x43')](function(_0x4dc4cf){return _0x33b40f(_0x4dc4cf);});});}exports[_0xf9e8('0x79')]=function(_0x22d413,_0x208087,_0x4645d8){var _0x35cb41;var _0x23df17;var _0x17a57f;var _0x405f43=require(_0xf9e8('0x4c'));return db[_0xf9e8('0x2d')][_0xf9e8('0x7a')]({'where':{'id':_0x22d413[_0xf9e8('0x45')]['id']}})['then'](function(_0x7d439){if(_0x7d439){var _0x4c9409=util[_0xf9e8('0x33')](_0xf9e8('0x5d'),_0x7d439['value']);if(fs[_0xf9e8('0x4e')](_0x4c9409)){cypher=!![];return _0x405f43['decryptFile'](_0x4c9409,_0x7d439[_0xf9e8('0x4d')],config[_0xf9e8('0x5e')][_0xf9e8('0x5f')])[_0xf9e8('0x26')](function(){return _0x7d439;});}return _0x7d439;}})[_0xf9e8('0x26')](function(_0x2fef43){if(!_0x2fef43){throw new db[(_0xf9e8('0x50'))][(_0xf9e8('0x60'))]('Voice\x20Recording\x20not\x20found');}_0x23df17=_0x2fef43;return db['Setting'][_0xf9e8('0x7a')]({'where':{'id':0x1}});})[_0xf9e8('0x26')](handleEntityNotFound(_0x208087,null))['then'](function(_0x4b7e91){if(_0x4b7e91){_0x35cb41=_0x4b7e91;if(!_0x35cb41[_0xf9e8('0x7b')]||!_0x35cb41['transcribeAccountId']||!_0x35cb41[_0xf9e8('0x7c')]||!_0x35cb41['language']||!_0x35cb41[_0xf9e8('0x7d')]){throw new db[(_0xf9e8('0x50'))][(_0xf9e8('0x60'))](_0xf9e8('0x7e'));}if(_0x22d413['body'][_0xf9e8('0x7f')]&&(!_0x35cb41[_0xf9e8('0x80')]||!_0x35cb41[_0xf9e8('0x81')]||!_0x35cb41['sentimentRegion']||!_0x35cb41['language']||!_0x35cb41[_0xf9e8('0x7d')])){throw new db[(_0xf9e8('0x50'))]['ValidationError'](_0xf9e8('0x82'));}return db['CloudProvider'][_0xf9e8('0x7a')]({'where':{'id':_0x35cb41[_0xf9e8('0x83')]}});}})[_0xf9e8('0x26')](function(_0x5b675e){if(!_0x5b675e){throw new db[(_0xf9e8('0x50'))][(_0xf9e8('0x60'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x5b675e[_0xf9e8('0x84')]||!_0x5b675e[_0xf9e8('0x85')]){throw new db['Sequelize'][(_0xf9e8('0x60'))](_0xf9e8('0x86'));}_0x17a57f=_0x5b675e;return getBucketslist(_0x17a57f[_0xf9e8('0x84')],_0x17a57f['data2'],_0x35cb41[_0xf9e8('0x7c')]);})['then'](function(_0x1d9303){if(_0x1d9303&&_0x1d9303['Buckets']){var _0x392ecb=_[_0xf9e8('0x49')](_0x1d9303[_0xf9e8('0x87')],function(_0x5b58e1){return _0x5b58e1['Name']===_0x35cb41[_0xf9e8('0x7d')];});if(!_0x392ecb){logger[_0xf9e8('0x63')](util[_0xf9e8('0x33')](_0xf9e8('0x88'),_0x22d413['params']['id'],_0x35cb41[_0xf9e8('0x7d')]));return createBucket(_0x17a57f[_0xf9e8('0x84')],_0x17a57f[_0xf9e8('0x85')],_0x35cb41[_0xf9e8('0x7c')],_0x35cb41[_0xf9e8('0x7d')]);}logger[_0xf9e8('0x63')](util[_0xf9e8('0x33')](_0xf9e8('0x89'),_0x22d413[_0xf9e8('0x45')]['id'],_0x35cb41[_0xf9e8('0x7d')]));return;}})['then'](function(_0x2120b6){if(_0x23df17[_0xf9e8('0x78')]===_0xf9e8('0x8a')){return transcribe(_0x22d413[_0xf9e8('0x45')]['id'],_0x17a57f[_0xf9e8('0x84')],_0x17a57f[_0xf9e8('0x85')],_0x35cb41[_0xf9e8('0x7c')],_0x35cb41[_0xf9e8('0x7d')],_0x23df17['value'],_0x35cb41[_0xf9e8('0x8b')]);}else{logger[_0xf9e8('0x63')](util[_0xf9e8('0x33')](_0xf9e8('0x8c'),_0x22d413[_0xf9e8('0x45')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0xf9e8('0x26')](function(_0x3f46b2){if(_0x3f46b2){_0x3f46b2[_0xf9e8('0x8d')]=_0x22d413[_0xf9e8('0x48')][_0xf9e8('0x7f')];return _0x23df17[_0xf9e8('0x8e')](_0x3f46b2);}})[_0xf9e8('0x26')](respondWithResult(_0x208087,null))['catch'](handleError(_0x208087,null));};function writeFile(_0x42982c,_0x1accf6){return new Promise(function(_0x508c00,_0x1eff24){fs[_0xf9e8('0x8f')](_0x1accf6,_0x42982c,function(_0x28d26d,_0x3f85d5){if(_0x28d26d){return _0x1eff24(_0x28d26d);}else{return _0x508c00(_0x3f85d5);}});});}exports['downloadTranscribe']=function(_0x5ae1ec,_0x354e17,_0x31675d){return db[_0xf9e8('0x2d')][_0xf9e8('0x7a')]({'where':{'id':_0x5ae1ec[_0xf9e8('0x45')]['id']}})[_0xf9e8('0x26')](handleEntityNotFound(_0x354e17))[_0xf9e8('0x26')](function(_0x536505){if(_0x536505&&_0x536505[_0xf9e8('0x90')]){var _0x3e0a7c=_0x536505[_0xf9e8('0x90')];var _0x343a97=config[_0xf9e8('0x91')]+_0xf9e8('0x92')+_0x536505['id']+_0xf9e8('0x93');if(fs[_0xf9e8('0x4e')](_0x343a97)){return _0x343a97;}return writeFile(_0x3e0a7c,_0x343a97)[_0xf9e8('0x26')](function(){return _0x343a97;});}else{throw new db[(_0xf9e8('0x50'))][(_0xf9e8('0x60'))]('Transcript\x20not\x20available');}})[_0xf9e8('0x26')](function(_0x4f01ab){return _0x354e17[_0xf9e8('0x4b')](_0x4f01ab);})[_0xf9e8('0x43')](handleError(_0x354e17));};
\ No newline at end of file
+var _0x9f27=['count','offset','limit','status','set','Content-Range','json','apply','reject','save','destroy','then','error','name','send','index','VoiceRecording','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','include','rows','catch','show','params','includeAll','options','find','create','update','body','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','existsSync','secrets','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','decryptFile','recording','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','transcribe','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','end','undefined'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x9f27,0x1b4));var _0x79f2=function(_0x86aeab,_0x821540){_0x86aeab=_0x86aeab-0x0;var _0x32699d=_0x9f27[_0x86aeab];return _0x32699d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x79f2('0x0'));var zipdir=require(_0x79f2('0x1'));var jsonpatch=require(_0x79f2('0x2'));var rp=require(_0x79f2('0x3'));var moment=require('moment');var BPromise=require(_0x79f2('0x4'));var Mustache=require(_0x79f2('0x5'));var util=require(_0x79f2('0x6'));var path=require(_0x79f2('0x7'));var sox=require(_0x79f2('0x8'));var csv=require(_0x79f2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x79f2('0xa'));var _=require(_0x79f2('0xb'));var squel=require(_0x79f2('0xc'));var crypto=require(_0x79f2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x79f2('0xe'));var toCsv=require(_0x79f2('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var AWS=require(_0x79f2('0xf'));var uuidv4=require('uuid/v4');var Redis=require(_0x79f2('0x10'));var authService=require(_0x79f2('0x11'));var qs=require(_0x79f2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x79f2('0x13'));var logger=require(_0x79f2('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x79f2('0x15'));var licenseUtil=require(_0x79f2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1622f2,_0x54a6c7){_0x54a6c7=_0x54a6c7||0xcc;return function(_0x1752ca){if(_0x1752ca){return _0x1622f2[_0x79f2('0x17')](_0x54a6c7);}return _0x1622f2['status'](_0x54a6c7)[_0x79f2('0x18')]();};}function respondWithResult(_0x24b2e4,_0x445a0e){_0x445a0e=_0x445a0e||0xc8;return function(_0x18e815){if(_0x18e815){return _0x24b2e4['status'](_0x445a0e)['json'](_0x18e815);}};}function respondWithFilteredResult(_0x3cb1ae,_0x28a94f){return function(_0xde8dba){if(_0xde8dba){var _0x513f4f=typeof _0x28a94f['offset']===_0x79f2('0x19')&&typeof _0x28a94f['limit']==='undefined';var _0xe652c0=_0xde8dba[_0x79f2('0x1a')];var _0x5d1a67=_0x513f4f?0x0:_0x28a94f[_0x79f2('0x1b')];var _0x1a6713=_0x513f4f?_0xde8dba['count']:_0x28a94f['offset']+_0x28a94f[_0x79f2('0x1c')];var _0x6e0ae0;if(_0x1a6713>=_0xe652c0){_0x1a6713=_0xe652c0;_0x6e0ae0=0xc8;}else{_0x6e0ae0=0xce;}_0x3cb1ae[_0x79f2('0x1d')](_0x6e0ae0);return _0x3cb1ae[_0x79f2('0x1e')](_0x79f2('0x1f'),_0x5d1a67+'-'+_0x1a6713+'/'+_0xe652c0)[_0x79f2('0x20')](_0xde8dba);}return null;};}function patchUpdates(_0x5ca0a0){return function(_0x27d622){try{jsonpatch[_0x79f2('0x21')](_0x27d622,_0x5ca0a0,!![]);}catch(_0x4b61d7){return BPromise[_0x79f2('0x22')](_0x4b61d7);}return _0x27d622[_0x79f2('0x23')]();};}function saveUpdates(_0x4c6e87,_0x1fa245){return function(_0xbe2951){if(_0xbe2951){return _0xbe2951['update'](_0x4c6e87)['then'](function(_0x83e018){return _0x83e018;});}return null;};}function removeEntity(_0x148bf5,_0x5e4822){return function(_0x4a1b3b){if(_0x4a1b3b){return _0x4a1b3b[_0x79f2('0x24')]()[_0x79f2('0x25')](function(){_0x148bf5['status'](0xcc)[_0x79f2('0x18')]();});}};}function handleEntityNotFound(_0x250b68,_0x1d5891){return function(_0x355c98){if(!_0x355c98){_0x250b68[_0x79f2('0x17')](0x194);}return _0x355c98;};}function handleError(_0x5b80db,_0x34e179){_0x34e179=_0x34e179||0x1f4;return function(_0x5de642){logger[_0x79f2('0x26')](_0x5de642['stack']);if(_0x5de642[_0x79f2('0x27')]){delete _0x5de642[_0x79f2('0x27')];}_0x5b80db[_0x79f2('0x1d')](_0x34e179)[_0x79f2('0x28')](_0x5de642);};}exports[_0x79f2('0x29')]=function(_0x4ab34a,_0x37d750){var _0x5ca8c4={},_0x179e19={},_0x114354={'count':0x0,'rows':[]};var _0x289223=_['map'](db[_0x79f2('0x2a')][_0x79f2('0x2b')],function(_0x2168ac){return{'name':_0x2168ac[_0x79f2('0x2c')],'type':_0x2168ac[_0x79f2('0x2d')]['key']};});_0x179e19[_0x79f2('0x2e')]=_['differenceBy'](_[_0x79f2('0x2f')](_0x289223,'name'),['format']);_0x179e19[_0x79f2('0x30')]=_[_0x79f2('0x31')](_0x4ab34a[_0x79f2('0x30')]);_0x179e19[_0x79f2('0x32')]=_[_0x79f2('0x33')](_0x179e19[_0x79f2('0x2e')],_0x179e19[_0x79f2('0x30')]);_0x5ca8c4[_0x79f2('0x34')]=_['intersection'](_0x179e19[_0x79f2('0x2e')],qs[_0x79f2('0x35')](_0x4ab34a[_0x79f2('0x30')]['fields']));_0x5ca8c4[_0x79f2('0x34')]=_0x5ca8c4[_0x79f2('0x34')][_0x79f2('0x36')]?_0x5ca8c4[_0x79f2('0x34')]:_0x179e19[_0x79f2('0x2e')];if(!_0x4ab34a['query'][_0x79f2('0x37')](_0x79f2('0x38'))){_0x5ca8c4['limit']=qs[_0x79f2('0x1c')](_0x4ab34a[_0x79f2('0x30')][_0x79f2('0x1c')]);_0x5ca8c4[_0x79f2('0x1b')]=qs['offset'](_0x4ab34a[_0x79f2('0x30')]['offset']);}_0x5ca8c4[_0x79f2('0x39')]=qs[_0x79f2('0x3a')](_0x4ab34a[_0x79f2('0x30')][_0x79f2('0x3a')]);_0x5ca8c4['where']=qs[_0x79f2('0x32')](_[_0x79f2('0x3b')](_0x4ab34a[_0x79f2('0x30')],_0x179e19[_0x79f2('0x32')]),_0x289223);if(_0x4ab34a[_0x79f2('0x30')]['filter']){_0x5ca8c4[_0x79f2('0x3c')]=_[_0x79f2('0x3d')](_0x5ca8c4['where'],{'$or':_[_0x79f2('0x2f')](_0x289223,function(_0x1edc4f){if(_0x1edc4f[_0x79f2('0x2d')]!==_0x79f2('0x3e')){var _0x549941={};_0x549941[_0x1edc4f[_0x79f2('0x27')]]={'$like':'%'+_0x4ab34a[_0x79f2('0x30')][_0x79f2('0x3f')]+'%'};return _0x549941;}})});}_0x5ca8c4=_['merge']({},_0x5ca8c4,_0x4ab34a['options']);var _0x205178={'where':_0x5ca8c4[_0x79f2('0x3c')]};return db['VoiceRecording']['count'](_0x205178)[_0x79f2('0x25')](function(_0x5991aa){_0x114354[_0x79f2('0x1a')]=_0x5991aa;if(_0x4ab34a[_0x79f2('0x30')]['includeAll']){_0x5ca8c4[_0x79f2('0x40')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x5ca8c4);})[_0x79f2('0x25')](function(_0x510441){_0x114354[_0x79f2('0x41')]=_0x510441;return _0x114354;})[_0x79f2('0x25')](respondWithFilteredResult(_0x37d750,_0x5ca8c4))[_0x79f2('0x42')](handleError(_0x37d750,null));};exports[_0x79f2('0x43')]=function(_0x3bd6c8,_0xb3b379){var _0x534b6f={'raw':![],'where':{'id':_0x3bd6c8[_0x79f2('0x44')]['id']}},_0x5822e6={};_0x5822e6[_0x79f2('0x2e')]=_[_0x79f2('0x31')](db['VoiceRecording'][_0x79f2('0x2b')]);_0x5822e6['query']=_[_0x79f2('0x31')](_0x3bd6c8[_0x79f2('0x30')]);_0x5822e6['filters']=_['intersection'](_0x5822e6['model'],_0x5822e6[_0x79f2('0x30')]);_0x534b6f['attributes']=_['intersection'](_0x5822e6[_0x79f2('0x2e')],qs['fields'](_0x3bd6c8[_0x79f2('0x30')]['fields']));_0x534b6f[_0x79f2('0x34')]=_0x534b6f[_0x79f2('0x34')][_0x79f2('0x36')]?_0x534b6f[_0x79f2('0x34')]:_0x5822e6[_0x79f2('0x2e')];if(_0x3bd6c8[_0x79f2('0x30')][_0x79f2('0x45')]){_0x534b6f[_0x79f2('0x40')]=[{'all':!![]}];}_0x534b6f=_['merge']({},_0x534b6f,_0x3bd6c8[_0x79f2('0x46')]);return db[_0x79f2('0x2a')][_0x79f2('0x47')](_0x534b6f)[_0x79f2('0x25')](handleEntityNotFound(_0xb3b379,null))[_0x79f2('0x25')](respondWithResult(_0xb3b379,null))[_0x79f2('0x42')](handleError(_0xb3b379,null));};exports[_0x79f2('0x48')]=function(_0x4feb40,_0x5ad7b2){return db[_0x79f2('0x2a')][_0x79f2('0x48')](_0x4feb40['body'],{})['then'](respondWithResult(_0x5ad7b2,0xc9))[_0x79f2('0x42')](handleError(_0x5ad7b2,null));};exports[_0x79f2('0x49')]=function(_0x3764a6,_0x1808e5){if(_0x3764a6[_0x79f2('0x4a')]['id']){delete _0x3764a6['body']['id'];}return db['VoiceRecording'][_0x79f2('0x47')]({'where':{'id':_0x3764a6[_0x79f2('0x44')]['id']}})[_0x79f2('0x25')](handleEntityNotFound(_0x1808e5,null))[_0x79f2('0x25')](saveUpdates(_0x3764a6[_0x79f2('0x4a')],null))[_0x79f2('0x25')](respondWithResult(_0x1808e5,null))[_0x79f2('0x42')](handleError(_0x1808e5,null));};exports['describe']=function(_0x2ee393,_0xf263a3){return db[_0x79f2('0x2a')][_0x79f2('0x4b')]()['then'](respondWithResult(_0xf263a3,null))[_0x79f2('0x42')](handleError(_0xf263a3,null));};exports[_0x79f2('0x4c')]=function(_0x405f2b,_0x16dfd4,_0x2b1b73){var _0x13ff7b=require(_0x79f2('0x4d'));var _0x33ed3b=![];var _0x388f69={};if(_0x405f2b[_0x79f2('0x30')][_0x79f2('0x2d')]&&_0x405f2b['query'][_0x79f2('0x2d')]==='uniqueid'){_0x388f69[_0x79f2('0x4e')]=_0x405f2b['params']['id'];}else{_0x388f69['id']=_0x405f2b[_0x79f2('0x44')]['id'];}return db[_0x79f2('0x2a')][_0x79f2('0x47')]({'where':_0x388f69,'attributes':['id','value'],'raw':!![]})[_0x79f2('0x25')](handleEntityNotFound(_0x16dfd4,null))['then'](function(_0x526d08){if(_0x526d08){var _0x2c0316=_0x526d08[_0x79f2('0x4f')];var _0x4a724b=util[_0x79f2('0x50')](_0x79f2('0x51'),_0x2c0316);if(fs[_0x79f2('0x52')](_0x4a724b)){_0x33ed3b=!![];return _0x13ff7b['decryptFile'](_0x4a724b,_0x2c0316,config[_0x79f2('0x53')]['recording'])[_0x79f2('0x25')](function(){return _0x526d08;});}return _0x526d08;}})[_0x79f2('0x25')](function(_0x31835c){if(_0x31835c){var _0x4b789e=_0x31835c['value'];if(!fs[_0x79f2('0x52')](_0x4b789e)){throw new db[(_0x79f2('0x54'))][(_0x79f2('0x55'))](_0x79f2('0x56'));}if(_0x31835c[_0x79f2('0x57')]){return _0x16dfd4[_0x79f2('0x4c')](_0x4b789e,_0x31835c[_0x79f2('0x57')]+path[_0x79f2('0x58')](_0x4b789e),function(){if(_0x33ed3b){fs[_0x79f2('0x59')](_0x4b789e);}});}else{return _0x16dfd4[_0x79f2('0x4c')](_0x4b789e,function(_0x3df293){if(_0x33ed3b){fs[_0x79f2('0x59')](_0x4b789e);}});}}})[_0x79f2('0x42')](function(_0x421ab2){if(_0x421ab2[_0x79f2('0x5a')]===_0x79f2('0x56')){_0x16dfd4[_0x79f2('0x1d')](0x194)[_0x79f2('0x28')](_0x79f2('0x5b'));}else{return handleError(_0x16dfd4,null);}});};exports[_0x79f2('0x5c')]=function(_0x5440f6,_0x292e76,_0x439fa6){var _0x48d9f3=require(_0x79f2('0x4d'));var _0x4c209e=![];var _0x13e8da={'$and':[db['sequelize'][_0x79f2('0x3c')](db[_0x79f2('0x5d')]['fn'](_0x79f2('0x5e'),db['sequelize'][_0x79f2('0x5f')](_0x79f2('0x4e'))),_0x5440f6[_0x79f2('0x30')][_0x79f2('0x60')])]};if(_0x5440f6['query'][_0x79f2('0x2d')]&&_0x5440f6['query'][_0x79f2('0x2d')]==='uniqueid'){_0x13e8da[_0x79f2('0x61')][_0x79f2('0x62')]({'uniqueid':_0x5440f6[_0x79f2('0x44')]['id']});}else{_0x13e8da[_0x79f2('0x61')][_0x79f2('0x62')]({'id':_0x5440f6[_0x79f2('0x44')]['id']});}return db[_0x79f2('0x2a')][_0x79f2('0x47')]({'where':_0x13e8da,'attributes':['id','value'],'raw':!![]})[_0x79f2('0x25')](handleEntityNotFound(_0x292e76,null))[_0x79f2('0x25')](function(_0x23e653){if(_0x23e653){var _0x10ce54=util[_0x79f2('0x50')](_0x79f2('0x51'),_0x23e653[_0x79f2('0x4f')]);if(fs[_0x79f2('0x52')](_0x10ce54)){_0x4c209e=!![];return _0x48d9f3[_0x79f2('0x63')](_0x10ce54,_0x23e653[_0x79f2('0x4f')],config['secrets'][_0x79f2('0x64')])['then'](function(){return _0x23e653;});}return _0x23e653;}})[_0x79f2('0x25')](function(_0x3b8ef7){if(_0x3b8ef7){if(!fs[_0x79f2('0x52')](_0x3b8ef7[_0x79f2('0x4f')])){throw new db['Sequelize'][(_0x79f2('0x55'))](_0x79f2('0x56'));}if(_0x3b8ef7[_0x79f2('0x57')]){return _0x292e76['download'](_0x3b8ef7['value'],_0x3b8ef7[_0x79f2('0x57')]+path[_0x79f2('0x58')](_0x3b8ef7[_0x79f2('0x4f')]),function(){if(_0x4c209e){fs[_0x79f2('0x59')](_0x3b8ef7[_0x79f2('0x4f')]);}});}else{return _0x292e76[_0x79f2('0x4c')](_0x3b8ef7[_0x79f2('0x4f')],function(_0xc51c67){if(_0x4c209e){fs[_0x79f2('0x59')](_0x3b8ef7[_0x79f2('0x4f')]);}});}}})[_0x79f2('0x42')](handleError(_0x292e76,null));};exports[_0x79f2('0x24')]=function(_0x14f5a5,_0x3f5476){return db[_0x79f2('0x2a')][_0x79f2('0x47')]({'where':{'id':_0x14f5a5[_0x79f2('0x44')]['id']}})[_0x79f2('0x25')](function(_0x363e3c){if(_[_0x79f2('0x65')](_0x363e3c)){throw new ReferenceError(_0x79f2('0x66'));}return _0x363e3c;})[_0x79f2('0x25')](function(_0x3bebcf){var _0x15a2bd=_0x3bebcf[_0x79f2('0x4f')];logger['info'](_0x79f2('0x67'),_0x15a2bd);if(!_[_0x79f2('0x65')](_0x3bebcf[_0x79f2('0x4f')])&&fs['existsSync'](_0x15a2bd)){logger[_0x79f2('0x68')](_0x79f2('0x69')+_0x15a2bd+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x79f2('0x6a')](_0x15a2bd);}_0x15a2bd=_0x15a2bd+_0x79f2('0x6b');if(!_[_0x79f2('0x65')](_0x3bebcf[_0x79f2('0x4f')])&&fs['existsSync'](_0x15a2bd)){logger['info']('File:\x20\x22'+_0x15a2bd+_0x79f2('0x6c'));fs[_0x79f2('0x6a')](_0x15a2bd);}return _0x3bebcf;})[_0x79f2('0x25')](function(_0x30de7f){if(!_0x30de7f)throw new InternalError();return _0x30de7f['destroy']();})[_0x79f2('0x25')](function(){_0x3f5476[_0x79f2('0x1d')](0xcc)[_0x79f2('0x18')]();})[_0x79f2('0x42')](handleError(_0x3f5476,null));};function getBucketslist(_0x3ba038,_0x520bbe,_0x2b4443){return new Promise(function(_0x308bd0,_0x149b5f){var _0x14967d=new AWS['S3']({'accessKeyId':_0x520bbe,'secretAccessKey':_0x3ba038,'region':_0x2b4443});_0x14967d[_0x79f2('0x6d')]({},function(_0x36d102,_0x204713){if(_0x36d102){return _0x149b5f(_0x36d102);}else{return _0x308bd0(_0x204713);}});});}function createBucket(_0x3860f5,_0xf9cbd5,_0x105e60,_0x24a8b8){return new Promise(function(_0x159f01,_0x19ac9c){var _0x4aae88=new AWS['S3']({'accessKeyId':_0xf9cbd5,'secretAccessKey':_0x3860f5,'region':_0x105e60});_0x4aae88[_0x79f2('0x6e')]({'Bucket':_0x24a8b8},function(_0x47a0fb,_0x77191a){if(_0x47a0fb){return _0x19ac9c(_0x47a0fb);}else{return _0x159f01(_0x77191a);}});});}function uploadFile(_0x361634,_0x2640f9,_0x47fc04,_0x14ed57,_0x196100,_0xef27ba){return new Promise(function(_0x2f9bf5,_0x1c3cfd){var _0x4ea87=new AWS['S3']({'accessKeyId':_0x2640f9,'secretAccessKey':_0x361634,'region':_0x47fc04});_0x4ea87[_0x79f2('0x6f')]({'Bucket':_0x14ed57,'Key':_0x196100,'Body':_0xef27ba},function(_0x3f3de3,_0x4ccb5b){if(_0x3f3de3){return _0x1c3cfd(_0x3f3de3);}else{return _0x2f9bf5(_0x4ccb5b);}});});}function startTranscribe(_0x56535e,_0x2107ff,_0x3b00c9,_0x4ce7b4,_0x5657d5,_0x2ae1dc){return new Promise(function(_0x2eaa7d,_0x18f5e4){var _0x1b44b1=new AWS[(_0x79f2('0x70'))]({'accessKeyId':_0x2107ff,'secretAccessKey':_0x56535e,'region':_0x3b00c9});_0x1b44b1[_0x79f2('0x71')]({'TranscriptionJobName':_0x4ce7b4,'LanguageCode':_0x5657d5,'Media':{'MediaFileUri':_0x2ae1dc}},function(_0x3645f0,_0x523f34){if(_0x3645f0){return _0x18f5e4(_0x3645f0);}else{return _0x2eaa7d(_0x523f34);}});});}function transcribe(_0x453a7e,_0x51b109,_0x32950e,_0xa5cc3a,_0x3e9793,_0xebba1e,_0x3979c1){return new Promise(function(_0x30284c,_0x43cf5c){var _0x1ccf14={};logger[_0x79f2('0x68')](util[_0x79f2('0x50')](_0x79f2('0x72'),_0x453a7e,_0x3e9793));return uploadFile(_0x51b109,_0x32950e,_0xa5cc3a,_0x3e9793,path['basename'](_0xebba1e),fs['readFileSync'](_0xebba1e))[_0x79f2('0x25')](function(_0x51eb84){logger[_0x79f2('0x68')](util[_0x79f2('0x50')](_0x79f2('0x73'),_0x453a7e,_0x3e9793,_0x51eb84[_0x79f2('0x74')]));_0x1ccf14[_0x79f2('0x75')]=_0x51eb84[_0x79f2('0x76')];_0x1ccf14[_0x79f2('0x77')]=_0x51eb84[_0x79f2('0x74')];logger['info'](util['format'](_0x79f2('0x78'),_0x453a7e));return startTranscribe(_0x51b109,_0x32950e,_0xa5cc3a,uuidv4(),_0x3979c1,_0x51eb84[_0x79f2('0x74')]);})[_0x79f2('0x25')](function(_0x440625){logger[_0x79f2('0x68')](util[_0x79f2('0x50')](_0x79f2('0x79'),_0x453a7e,_0x440625[_0x79f2('0x7a')][_0x79f2('0x7b')]));_0x1ccf14[_0x79f2('0x7c')]=_0x440625['TranscriptionJob'][_0x79f2('0x7b')];_0x1ccf14['transcribeStatus']=_0x440625[_0x79f2('0x7a')][_0x79f2('0x7d')];return _0x30284c(_0x1ccf14);})['catch'](function(_0xcea0f7){return _0x43cf5c(_0xcea0f7);});});}exports[_0x79f2('0x7e')]=function(_0xf821a,_0x512853,_0x93a6ae){var _0x505f69;var _0xd38fb8;var _0x471763;var _0x284ebf=require(_0x79f2('0x4d'));return db['VoiceRecording'][_0x79f2('0x7f')]({'where':{'id':_0xf821a[_0x79f2('0x44')]['id']}})[_0x79f2('0x25')](function(_0xb1d89b){if(_0xb1d89b){var _0x27fb45=util['format'](_0x79f2('0x51'),_0xb1d89b['value']);if(fs['existsSync'](_0x27fb45)){cypher=!![];return _0x284ebf[_0x79f2('0x63')](_0x27fb45,_0xb1d89b[_0x79f2('0x4f')],config[_0x79f2('0x53')][_0x79f2('0x64')])[_0x79f2('0x25')](function(){return _0xb1d89b;});}return _0xb1d89b;}})[_0x79f2('0x25')](function(_0x14d301){if(!_0x14d301){throw new db['Sequelize']['ValidationError'](_0x79f2('0x80'));}_0xd38fb8=_0x14d301;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0x79f2('0x25')](handleEntityNotFound(_0x512853,null))[_0x79f2('0x25')](function(_0xfe681a){if(_0xfe681a){_0x505f69=_0xfe681a;if(!_0x505f69[_0x79f2('0x81')]||!_0x505f69['transcribeAccountId']||!_0x505f69[_0x79f2('0x82')]||!_0x505f69[_0x79f2('0x83')]||!_0x505f69[_0x79f2('0x75')]){throw new db[(_0x79f2('0x54'))][(_0x79f2('0x55'))](_0x79f2('0x84'));}if(_0xf821a[_0x79f2('0x4a')][_0x79f2('0x85')]&&(!_0x505f69[_0x79f2('0x86')]||!_0x505f69[_0x79f2('0x87')]||!_0x505f69[_0x79f2('0x88')]||!_0x505f69[_0x79f2('0x83')]||!_0x505f69[_0x79f2('0x75')])){throw new db[(_0x79f2('0x54'))][(_0x79f2('0x55'))]('Sentiment\x20Analysis\x20not\x20configured');}return db['CloudProvider'][_0x79f2('0x7f')]({'where':{'id':_0x505f69[_0x79f2('0x89')]}});}})[_0x79f2('0x25')](function(_0xf81e3a){if(!_0xf81e3a){throw new db[(_0x79f2('0x54'))][(_0x79f2('0x55'))](_0x79f2('0x8a'));}if(!_0xf81e3a[_0x79f2('0x8b')]||!_0xf81e3a['data2']){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x471763=_0xf81e3a;return getBucketslist(_0x471763['data1'],_0x471763[_0x79f2('0x8c')],_0x505f69[_0x79f2('0x82')]);})[_0x79f2('0x25')](function(_0x1898f0){if(_0x1898f0&&_0x1898f0[_0x79f2('0x8d')]){var _0x28258e=_[_0x79f2('0x47')](_0x1898f0[_0x79f2('0x8d')],function(_0x2509da){return _0x2509da[_0x79f2('0x8e')]===_0x505f69[_0x79f2('0x75')];});if(!_0x28258e){logger[_0x79f2('0x68')](util['format'](_0x79f2('0x8f'),_0xf821a[_0x79f2('0x44')]['id'],_0x505f69[_0x79f2('0x75')]));return createBucket(_0x471763['data1'],_0x471763[_0x79f2('0x8c')],_0x505f69[_0x79f2('0x82')],_0x505f69[_0x79f2('0x75')]);}logger[_0x79f2('0x68')](util[_0x79f2('0x50')](_0x79f2('0x90'),_0xf821a['params']['id'],_0x505f69[_0x79f2('0x75')]));return;}})['then'](function(_0x4791f0){if(_0xd38fb8[_0x79f2('0x91')]==='NEW'){return transcribe(_0xf821a[_0x79f2('0x44')]['id'],_0x471763['data1'],_0x471763[_0x79f2('0x8c')],_0x505f69[_0x79f2('0x82')],_0x505f69['bucket'],_0xd38fb8[_0x79f2('0x4f')],_0x505f69[_0x79f2('0x83')]);}else{logger[_0x79f2('0x68')](util[_0x79f2('0x50')](_0x79f2('0x92'),_0xf821a[_0x79f2('0x44')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})['then'](function(_0x3782ad){if(_0x3782ad){_0x3782ad[_0x79f2('0x93')]=_0xf821a[_0x79f2('0x4a')]['runSentiment'];return _0xd38fb8[_0x79f2('0x94')](_0x3782ad);}})[_0x79f2('0x25')](respondWithResult(_0x512853,null))['catch'](handleError(_0x512853,null));};function writeFile(_0x33f65a,_0x77cdf6){return new Promise(function(_0x3efeb4,_0xa06d6e){fs[_0x79f2('0x95')](_0x77cdf6,_0x33f65a,function(_0x253487,_0x3852dc){if(_0x253487){return _0xa06d6e(_0x253487);}else{return _0x3efeb4(_0x3852dc);}});});}exports['downloadTranscribe']=function(_0x58c8d7,_0x4cdf39,_0x60f954){return db[_0x79f2('0x2a')][_0x79f2('0x7f')]({'where':{'id':_0x58c8d7[_0x79f2('0x44')]['id']}})[_0x79f2('0x25')](handleEntityNotFound(_0x4cdf39))[_0x79f2('0x25')](function(_0x4e4f41){if(_0x4e4f41&&_0x4e4f41[_0x79f2('0x96')]){var _0x36aab8=_0x4e4f41['fileText'];var _0xf051be=config['root']+_0x79f2('0x97')+_0x4e4f41['id']+_0x79f2('0x98');if(fs[_0x79f2('0x52')](_0xf051be)){return _0xf051be;}return writeFile(_0x36aab8,_0xf051be)[_0x79f2('0x25')](function(){return _0xf051be;});}else{throw new db[(_0x79f2('0x54'))]['ValidationError'](_0x79f2('0x99'));}})['then'](function(_0x4dc4fe){return _0x4cdf39[_0x79f2('0x4c')](_0x4dc4fe);})['catch'](handleError(_0x4cdf39));};
\ No newline at end of file
index f81bf43..4317281 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x682e=['./voiceRecording.attributes','exports','define','VoiceRecording','uniqueid','transcribeStatus'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x682e,0x1ce));var _0xe682=function(_0x123563,_0x2e08bb){_0x123563=_0x123563-0x0;var _0x5af0e9=_0x682e[_0x123563];return _0x5af0e9;};'use strict';var attributes=require(_0xe682('0x0'));module[_0xe682('0x1')]=function(_0x25d567,_0x12a2fe){return _0x25d567[_0xe682('0x2')](_0xe682('0x3'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0xe682('0x4'),'fields':[_0xe682('0x4')]},{'name':_0xe682('0x5'),'fields':[_0xe682('0x5')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8cfd=['./voiceRecording.attributes','exports','define','VoiceRecording','uniqueid','transcribeStatus'];(function(_0x39871a,_0x4042cf){var _0x38dd97=function(_0x2a0023){while(--_0x2a0023){_0x39871a['push'](_0x39871a['shift']());}};_0x38dd97(++_0x4042cf);}(_0x8cfd,0xe4));var _0xd8cf=function(_0x3396cd,_0x4047f0){_0x3396cd=_0x3396cd-0x0;var _0x2d6b4a=_0x8cfd[_0x3396cd];return _0x2d6b4a;};'use strict';var attributes=require(_0xd8cf('0x0'));module[_0xd8cf('0x1')]=function(_0x370288,_0x1935a9){return _0x370288[_0xd8cf('0x2')](_0xd8cf('0x3'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0xd8cf('0x4'),'fields':[_0xd8cf('0x4')]},{'name':_0xd8cf('0x5'),'fields':[_0xd8cf('0x5')]}],'timestamps':!![]});};
\ No newline at end of file
index 57674e0..7f2dafe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcaf2=['CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','encryptFile','secrets','recording','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','VoiceRecording','body','options','raw','where','attributes','limit','UpdateVoiceRecording','stringify','catch'];(function(_0x119d7c,_0x417a3f){var _0x5051a6=function(_0x5ab171){while(--_0x5ab171){_0x119d7c['push'](_0x119d7c['shift']());}};_0x5051a6(++_0x417a3f);}(_0xcaf2,0x8a));var _0x2caf=function(_0x42e4d7,_0x4bd202){_0x42e4d7=_0x42e4d7-0x0;var _0x346cd8=_0xcaf2[_0x42e4d7];return _0x346cd8;};'use strict';var _=require(_0x2caf('0x0'));var util=require('util');var moment=require(_0x2caf('0x1'));var BPromise=require(_0x2caf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2caf('0x3'));var db=require(_0x2caf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2caf('0x5'))('rpc');var config=require(_0x2caf('0x6'));var jayson=require(_0x2caf('0x7'));var client=jayson[_0x2caf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc44e4e,_0x314486,_0x4667c6){return new BPromise(function(_0x34e792,_0x5611aa){return client[_0x2caf('0x9')](_0xc44e4e,_0x4667c6)[_0x2caf('0xa')](function(_0x45e520){logger[_0x2caf('0xb')](_0x2caf('0xc'),_0x314486,_0x2caf('0xd'));logger[_0x2caf('0xe')](_0x2caf('0xf'),_0x314486,_0x2caf('0xd'),JSON['stringify'](_0x45e520));if(_0x45e520[_0x2caf('0x10')]){if(_0x45e520[_0x2caf('0x10')][_0x2caf('0x11')]===0x1f4){logger[_0x2caf('0x10')](_0x2caf('0xc'),_0x314486,_0x45e520[_0x2caf('0x10')][_0x2caf('0x12')]);return _0x5611aa(_0x45e520[_0x2caf('0x10')]['message']);}logger[_0x2caf('0x10')](_0x2caf('0xc'),_0x314486,_0x45e520['error']['message']);return _0x34e792(_0x45e520['error'][_0x2caf('0x12')]);}else{logger['info'](_0x2caf('0xc'),_0x314486,_0x2caf('0xd'));_0x34e792(_0x45e520[_0x2caf('0x13')][_0x2caf('0x12')]);}})['catch'](function(_0x184355){logger['error'](_0x2caf('0xc'),_0x314486,_0x184355);_0x5611aa(_0x184355);});});}exports['UpdateVoiceRecording']=function(_0x4a33fc){var _0x3e975f=this;return new Promise(function(_0x58047b,_0xe72440){return db[_0x2caf('0x14')]['update'](_0x4a33fc[_0x2caf('0x15')],{'raw':_0x4a33fc[_0x2caf('0x16')]?_0x4a33fc[_0x2caf('0x16')][_0x2caf('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a33fc[_0x2caf('0x16')]?_0x4a33fc['options'][_0x2caf('0x18')]||null:null,'attributes':_0x4a33fc[_0x2caf('0x16')]?_0x4a33fc[_0x2caf('0x16')][_0x2caf('0x19')]||null:null,'limit':_0x4a33fc[_0x2caf('0x16')]?_0x4a33fc[_0x2caf('0x16')][_0x2caf('0x1a')]||null:null})[_0x2caf('0xa')](function(_0x3332b1){logger[_0x2caf('0xb')](_0x2caf('0x1b'),_0x4a33fc);logger['debug'](_0x2caf('0x1b'),_0x4a33fc,JSON[_0x2caf('0x1c')](_0x3332b1));_0x58047b(_0x3332b1);})[_0x2caf('0x1d')](function(_0x401ea2){logger[_0x2caf('0x10')](_0x2caf('0x1b'),_0x401ea2[_0x2caf('0x12')],_0x4a33fc);_0xe72440(_0x3e975f[_0x2caf('0x10')](0x1f4,_0x401ea2[_0x2caf('0x12')]));});});};exports[_0x2caf('0x1e')]=function(_0x5ad211){var _0x6a32ac=this;return new Promise(function(_0x325eda,_0xbefce6){var _0x37b08f=require(_0x2caf('0x1f'));var _0x17d3c6;return db[_0x2caf('0x20')][_0x2caf('0x21')]({'attributes':['id',_0x2caf('0x22')],'where':{'id':0x1},'raw':!![]})[_0x2caf('0xa')](function(_0x30da75){_0x17d3c6=_0x30da75;return db[_0x2caf('0x14')][_0x2caf('0x23')](_0x5ad211['body']);})[_0x2caf('0xa')](function(_0xda0ec5){if(_0x17d3c6[_0x2caf('0x22')]&&fs[_0x2caf('0x24')](_0xda0ec5[_0x2caf('0x25')])){var _0x1f52bf=util[_0x2caf('0x26')]('%s.cypher',_0xda0ec5[_0x2caf('0x25')]);return _0x37b08f[_0x2caf('0x27')](_0xda0ec5['value'],_0x1f52bf,config[_0x2caf('0x28')][_0x2caf('0x29')])[_0x2caf('0xa')](function(){fs['unlink'](_0xda0ec5[_0x2caf('0x25')]);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0xda0ec5;});}return _0xda0ec5;})[_0x2caf('0xa')](function(_0x28b715){logger[_0x2caf('0xb')](_0x2caf('0x1e'),_0x5ad211);logger[_0x2caf('0xe')](_0x2caf('0x1e'),_0x5ad211,JSON[_0x2caf('0x1c')](_0x28b715));_0x325eda(_0x28b715);})[_0x2caf('0x1d')](function(_0x20818e){logger['error'](_0x2caf('0x1e'),_0x20818e[_0x2caf('0x12')],_0x5ad211);_0xbefce6(_0x6a32ac[_0x2caf('0x10')](0x1f4,_0x20818e[_0x2caf('0x12')]));});});};
\ No newline at end of file
+var _0x0424=['stringify','error','message','info','result','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','limit','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s'];(function(_0x809dbd,_0xf5f241){var _0x5497bf=function(_0x4642bf){while(--_0x4642bf){_0x809dbd['push'](_0x809dbd['shift']());}};_0x5497bf(++_0xf5f241);}(_0x0424,0x159));var _0x4042=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x0424[_0x2db12b];return _0x20990b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4042('0x0'));var BPromise=require(_0x4042('0x1'));var rs=require(_0x4042('0x2'));var fs=require('fs');var Redis=require(_0x4042('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4042('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4042('0x5'));var jayson=require(_0x4042('0x6'));var client=jayson[_0x4042('0x7')][_0x4042('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3abaf1,_0xa5310f,_0x10ec07){return new BPromise(function(_0x5d11bf,_0x509772){return client[_0x4042('0x9')](_0x3abaf1,_0x10ec07)[_0x4042('0xa')](function(_0x103e4a){logger['info'](_0x4042('0xb'),_0xa5310f,_0x4042('0xc'));logger[_0x4042('0xd')](_0x4042('0xe'),_0xa5310f,_0x4042('0xc'),JSON[_0x4042('0xf')](_0x103e4a));if(_0x103e4a[_0x4042('0x10')]){if(_0x103e4a[_0x4042('0x10')]['code']===0x1f4){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a['error'][_0x4042('0x11')]);return _0x509772(_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);}logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);return _0x5d11bf(_0x103e4a['error'][_0x4042('0x11')]);}else{logger[_0x4042('0x12')]('VoiceRecording,\x20%s,\x20%s',_0xa5310f,_0x4042('0xc'));_0x5d11bf(_0x103e4a[_0x4042('0x13')][_0x4042('0x11')]);}})[_0x4042('0x14')](function(_0x31e765){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x31e765);_0x509772(_0x31e765);});});}exports[_0x4042('0x15')]=function(_0x466077){var _0x4b02d4=this;return new Promise(function(_0xe5c1ec,_0x4fe024){return db[_0x4042('0x16')]['update'](_0x466077[_0x4042('0x17')],{'raw':_0x466077[_0x4042('0x18')]?_0x466077[_0x4042('0x18')][_0x4042('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x466077['options']?_0x466077[_0x4042('0x18')][_0x4042('0x1a')]||null:null,'attributes':_0x466077[_0x4042('0x18')]?_0x466077[_0x4042('0x18')]['attributes']||null:null,'limit':_0x466077[_0x4042('0x18')]?_0x466077[_0x4042('0x18')][_0x4042('0x1b')]||null:null})[_0x4042('0xa')](function(_0x352631){logger['info'](_0x4042('0x15'),_0x466077);logger[_0x4042('0xd')]('UpdateVoiceRecording',_0x466077,JSON[_0x4042('0xf')](_0x352631));_0xe5c1ec(_0x352631);})['catch'](function(_0x271b82){logger[_0x4042('0x10')](_0x4042('0x15'),_0x271b82['message'],_0x466077);_0x4fe024(_0x4b02d4[_0x4042('0x10')](0x1f4,_0x271b82[_0x4042('0x11')]));});});};exports[_0x4042('0x1c')]=function(_0xbdadc8){var _0x1c4d9f=this;return new Promise(function(_0x52e575,_0x58c409){var _0x1d8d48=require(_0x4042('0x1d'));var _0x26542c;return db[_0x4042('0x1e')][_0x4042('0x1f')]({'attributes':['id',_0x4042('0x20')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x33733b){_0x26542c=_0x33733b;return db[_0x4042('0x16')]['create'](_0xbdadc8[_0x4042('0x17')]);})[_0x4042('0xa')](function(_0xe924fe){if(_0x26542c['callRecordingEncryption']&&fs['existsSync'](_0xe924fe[_0x4042('0x21')])){var _0x43bd1c=util['format'](_0x4042('0x22'),_0xe924fe[_0x4042('0x21')]);return _0x1d8d48[_0x4042('0x23')](_0xe924fe[_0x4042('0x21')],_0x43bd1c,config[_0x4042('0x24')][_0x4042('0x25')])[_0x4042('0xa')](function(){fs[_0x4042('0x26')](_0xe924fe[_0x4042('0x21')]);logger['info'](_0x4042('0x27'));return _0xe924fe;});}return _0xe924fe;})[_0x4042('0xa')](function(_0x5320f8){logger[_0x4042('0x12')](_0x4042('0x1c'),_0xbdadc8);logger['debug'](_0x4042('0x1c'),_0xbdadc8,JSON[_0x4042('0xf')](_0x5320f8));_0x52e575(_0x5320f8);})[_0x4042('0x14')](function(_0xaa7c99){logger[_0x4042('0x10')](_0x4042('0x1c'),_0xaa7c99[_0x4042('0x11')],_0xbdadc8);_0x58c409(_0x1c4d9f[_0x4042('0x10')](0x1f4,_0xaa7c99[_0x4042('0x11')]));});});};
\ No newline at end of file
index 04ab9fa..fe68959 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74e7=['../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','index','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0xe44204,_0x3922a7){var _0x4c2e54=function(_0x4675a1){while(--_0x4675a1){_0xe44204['push'](_0xe44204['shift']());}};_0x4c2e54(++_0x3922a7);}(_0x74e7,0x112));var _0x774e=function(_0x448a3e,_0x1c9a9e){_0x448a3e=_0x448a3e-0x0;var _0x34592a=_0x74e7[_0x448a3e];return _0x34592a;};'use strict';var multer=require(_0x774e('0x0'));var util=require('util');var path=require(_0x774e('0x1'));var timeout=require(_0x774e('0x2'));var express=require(_0x774e('0x3'));var router=express['Router']();var fs_extra=require(_0x774e('0x4'));var auth=require(_0x774e('0x5'));var interaction=require(_0x774e('0x6'));var config=require(_0x774e('0x7'));var controller=require(_0x774e('0x8'));router[_0x774e('0x9')]('/',auth['isAuthenticated'](),controller[_0x774e('0xa')]);router[_0x774e('0x9')]('/describe',auth[_0x774e('0xb')](),controller['describe']);router[_0x774e('0x9')](_0x774e('0xc'),auth[_0x774e('0xb')](),controller['show']);router[_0x774e('0xd')]('/',auth[_0x774e('0xb')](),controller[_0x774e('0xe')]);router[_0x774e('0xf')](_0x774e('0xc'),auth['isAuthenticated'](),controller[_0x774e('0x10')]);router[_0x774e('0x11')](_0x774e('0xc'),auth['isAuthenticated'](),controller[_0x774e('0x12')]);module[_0x774e('0x13')]=router;
\ No newline at end of file
+var _0x3b79=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util'];(function(_0x4adc1d,_0x4d9f58){var _0x946900=function(_0x157c62){while(--_0x157c62){_0x4adc1d['push'](_0x4adc1d['shift']());}};_0x946900(++_0x4d9f58);}(_0x3b79,0x1e1));var _0x93b7=function(_0x4357d7,_0x431972){_0x4357d7=_0x4357d7-0x0;var _0x35389e=_0x3b79[_0x4357d7];return _0x35389e;};'use strict';var multer=require(_0x93b7('0x0'));var util=require(_0x93b7('0x1'));var path=require(_0x93b7('0x2'));var timeout=require(_0x93b7('0x3'));var express=require(_0x93b7('0x4'));var router=express[_0x93b7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x93b7('0x6'));var interaction=require(_0x93b7('0x7'));var config=require(_0x93b7('0x8'));var controller=require(_0x93b7('0x9'));router['get']('/',auth[_0x93b7('0xa')](),controller[_0x93b7('0xb')]);router[_0x93b7('0xc')](_0x93b7('0xd'),auth['isAuthenticated'](),controller[_0x93b7('0xe')]);router[_0x93b7('0xc')](_0x93b7('0xf'),auth[_0x93b7('0xa')](),controller[_0x93b7('0x10')]);router[_0x93b7('0x11')]('/',auth[_0x93b7('0xa')](),controller[_0x93b7('0x12')]);router[_0x93b7('0x13')](_0x93b7('0xf'),auth[_0x93b7('0xa')](),controller[_0x93b7('0x14')]);router['delete'](_0x93b7('0xf'),auth['isAuthenticated'](),controller[_0x93b7('0x15')]);module[_0x93b7('0x16')]=router;
\ No newline at end of file
index 604deb4..9ff8c06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x928e=['attended','STRING','Yes','sequelize','moment','exports','ENUM','blind'];(function(_0x103b3f,_0x442d66){var _0x3ccac9=function(_0x58ae59){while(--_0x58ae59){_0x103b3f['push'](_0x103b3f['shift']());}};_0x3ccac9(++_0x442d66);}(_0x928e,0x1d3));var _0xe928=function(_0x10da4f,_0x14905e){_0x10da4f=_0x10da4f-0x0;var _0xd296b3=_0x928e[_0x10da4f];return _0xd296b3;};'use strict';var Sequelize=require(_0xe928('0x0'));var moment=require(_0xe928('0x1'));module[_0xe928('0x2')]={'type':{'type':Sequelize[_0xe928('0x3')](_0xe928('0x4'),_0xe928('0x5'))},'result':{'type':Sequelize[_0xe928('0x6')]},'transfererchannel':{'type':Sequelize[_0xe928('0x6')]},'transferercalleridnum':{'type':Sequelize[_0xe928('0x6')]},'transferercalleridname':{'type':Sequelize[_0xe928('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0xe928('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0xe928('0x6')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0xe928('0x6')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xe928('0x6')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xe928('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xe928('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0xe928('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0xe928('0x6')]},'transfereecontext':{'type':Sequelize[_0xe928('0x6')]},'transfereeexten':{'type':Sequelize[_0xe928('0x6')]},'transfereelinkedid':{'type':Sequelize[_0xe928('0x6')]},'isexternal':{'type':Sequelize['ENUM'](_0xe928('0x7'),'No')},'context':{'type':Sequelize[_0xe928('0x6')]},'extension':{'type':Sequelize[_0xe928('0x6')]}};
\ No newline at end of file
+var _0x9c90=['Yes','sequelize','moment','exports','ENUM','blind','attended','STRING'];(function(_0x2390bd,_0x212fbd){var _0x3a969d=function(_0x3dd049){while(--_0x3dd049){_0x2390bd['push'](_0x2390bd['shift']());}};_0x3a969d(++_0x212fbd);}(_0x9c90,0x1b1));var _0x09c9=function(_0x2962d5,_0x38deda){_0x2962d5=_0x2962d5-0x0;var _0x273406=_0x9c90[_0x2962d5];return _0x273406;};'use strict';var Sequelize=require(_0x09c9('0x0'));var moment=require(_0x09c9('0x1'));module[_0x09c9('0x2')]={'type':{'type':Sequelize[_0x09c9('0x3')](_0x09c9('0x4'),_0x09c9('0x5'))},'result':{'type':Sequelize[_0x09c9('0x6')]},'transfererchannel':{'type':Sequelize[_0x09c9('0x6')]},'transferercalleridnum':{'type':Sequelize[_0x09c9('0x6')]},'transferercalleridname':{'type':Sequelize[_0x09c9('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0x09c9('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0x09c9('0x6')]},'transfereraccountcode':{'type':Sequelize[_0x09c9('0x6')]},'transferercontext':{'type':Sequelize[_0x09c9('0x6')]},'transfererexten':{'type':Sequelize[_0x09c9('0x6')]},'transfererlinkedid':{'type':Sequelize[_0x09c9('0x6')]},'transfereechannel':{'type':Sequelize[_0x09c9('0x6')]},'transfereecalleridnum':{'type':Sequelize[_0x09c9('0x6')]},'transfereecalleridname':{'type':Sequelize[_0x09c9('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x09c9('0x6')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x09c9('0x6')]},'transfereecontext':{'type':Sequelize[_0x09c9('0x6')]},'transfereeexten':{'type':Sequelize[_0x09c9('0x6')]},'transfereelinkedid':{'type':Sequelize[_0x09c9('0x6')]},'isexternal':{'type':Sequelize[_0x09c9('0x3')](_0x09c9('0x7'),'No')},'context':{'type':Sequelize[_0x09c9('0x6')]},'extension':{'type':Sequelize[_0x09c9('0x6')]}};
\ No newline at end of file
index 2670e9b..4095c22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4292=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','set','Content-Range','apply','then','destroy','error','stack','name','index','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','VoiceTransferReport','count','includeAll','include','findAll','rows','params','intersection','fields','find','catch','create','body','update','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5a14e2,_0x2ecc09){var _0x558407=function(_0x1c9a2b){while(--_0x1c9a2b){_0x5a14e2['push'](_0x5a14e2['shift']());}};_0x558407(++_0x2ecc09);}(_0x4292,0x114));var _0x2429=function(_0x217372,_0x1822ce){_0x217372=_0x217372-0x0;var _0x2715a1=_0x4292[_0x217372];return _0x2715a1;};'use strict';var emlformat=require(_0x2429('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2429('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2429('0x2'));var moment=require(_0x2429('0x3'));var BPromise=require(_0x2429('0x4'));var Mustache=require(_0x2429('0x5'));var util=require(_0x2429('0x6'));var path=require(_0x2429('0x7'));var sox=require(_0x2429('0x8'));var csv=require(_0x2429('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2429('0xa'));var _=require(_0x2429('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2429('0xc'));var deskjs=require(_0x2429('0xd'));var toCsv=require(_0x2429('0x9'));var querystring=require(_0x2429('0xe'));var Papa=require(_0x2429('0xf'));var Redis=require(_0x2429('0x10'));var authService=require(_0x2429('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2429('0x12'));var hardwareService=require(_0x2429('0x13'));var logger=require(_0x2429('0x14'))(_0x2429('0x15'));var utils=require('../../config/utils');var config=require(_0x2429('0x16'));var licenseUtil=require(_0x2429('0x17'));var db=require(_0x2429('0x18'))['db'];function respondWithStatusCode(_0x5067a5,_0x54498d){_0x54498d=_0x54498d||0xcc;return function(_0x131302){if(_0x131302){return _0x5067a5['sendStatus'](_0x54498d);}return _0x5067a5['status'](_0x54498d)[_0x2429('0x19')]();};}function respondWithResult(_0x5b0635,_0x296f7e){_0x296f7e=_0x296f7e||0xc8;return function(_0x42fa36){if(_0x42fa36){return _0x5b0635[_0x2429('0x1a')](_0x296f7e)[_0x2429('0x1b')](_0x42fa36);}};}function respondWithFilteredResult(_0x13c7d3,_0x522e18){return function(_0x46c67a){if(_0x46c67a){var _0x501a9d=typeof _0x522e18[_0x2429('0x1c')]===_0x2429('0x1d')&&typeof _0x522e18[_0x2429('0x1e')]===_0x2429('0x1d');var _0x5b36f9=_0x46c67a['count'];var _0x195d68=_0x501a9d?0x0:_0x522e18['offset'];var _0x4cecd4=_0x501a9d?_0x46c67a['count']:_0x522e18[_0x2429('0x1c')]+_0x522e18[_0x2429('0x1e')];var _0x13bea8;if(_0x4cecd4>=_0x5b36f9){_0x4cecd4=_0x5b36f9;_0x13bea8=0xc8;}else{_0x13bea8=0xce;}_0x13c7d3['status'](_0x13bea8);return _0x13c7d3[_0x2429('0x1f')](_0x2429('0x20'),_0x195d68+'-'+_0x4cecd4+'/'+_0x5b36f9)[_0x2429('0x1b')](_0x46c67a);}return null;};}function patchUpdates(_0x129651){return function(_0x2eb748){try{jsonpatch[_0x2429('0x21')](_0x2eb748,_0x129651,!![]);}catch(_0x8325f){return BPromise['reject'](_0x8325f);}return _0x2eb748['save']();};}function saveUpdates(_0x45ea85,_0x2793db){return function(_0x466be){if(_0x466be){return _0x466be['update'](_0x45ea85)[_0x2429('0x22')](function(_0x2a2354){return _0x2a2354;});}return null;};}function removeEntity(_0x20e2ae,_0x22e847){return function(_0x19caba){if(_0x19caba){return _0x19caba[_0x2429('0x23')]()[_0x2429('0x22')](function(){_0x20e2ae[_0x2429('0x1a')](0xcc)[_0x2429('0x19')]();});}};}function handleEntityNotFound(_0x2716c7,_0x66737e){return function(_0x491bf6){if(!_0x491bf6){_0x2716c7['sendStatus'](0x194);}return _0x491bf6;};}function handleError(_0x218d67,_0x3ce0ad){_0x3ce0ad=_0x3ce0ad||0x1f4;return function(_0x4d3e5a){logger[_0x2429('0x24')](_0x4d3e5a[_0x2429('0x25')]);if(_0x4d3e5a[_0x2429('0x26')]){delete _0x4d3e5a['name'];}_0x218d67[_0x2429('0x1a')](_0x3ce0ad)['send'](_0x4d3e5a);};}exports[_0x2429('0x27')]=function(_0x384a43,_0xef40de){var _0x1fa594={},_0x470241={},_0xd1d8fc={'count':0x0,'rows':[]};var _0xe85917=_['map'](db['VoiceTransferReport'][_0x2429('0x28')],function(_0x2f6da2){return{'name':_0x2f6da2[_0x2429('0x29')],'type':_0x2f6da2[_0x2429('0x2a')]['key']};});_0x470241[_0x2429('0x2b')]=_[_0x2429('0x2c')](_0xe85917,_0x2429('0x26'));_0x470241[_0x2429('0x2d')]=_[_0x2429('0x2e')](_0x384a43[_0x2429('0x2d')]);_0x470241[_0x2429('0x2f')]=_['intersection'](_0x470241[_0x2429('0x2b')],_0x470241[_0x2429('0x2d')]);_0x1fa594['attributes']=_['intersection'](_0x470241[_0x2429('0x2b')],qs['fields'](_0x384a43[_0x2429('0x2d')]['fields']));_0x1fa594['attributes']=_0x1fa594[_0x2429('0x30')][_0x2429('0x31')]?_0x1fa594[_0x2429('0x30')]:_0x470241[_0x2429('0x2b')];if(!_0x384a43[_0x2429('0x2d')][_0x2429('0x32')](_0x2429('0x33'))){_0x1fa594[_0x2429('0x1e')]=qs[_0x2429('0x1e')](_0x384a43[_0x2429('0x2d')][_0x2429('0x1e')]);_0x1fa594['offset']=qs['offset'](_0x384a43[_0x2429('0x2d')]['offset']);}_0x1fa594['order']=qs[_0x2429('0x34')](_0x384a43[_0x2429('0x2d')][_0x2429('0x34')]);_0x1fa594['where']=qs[_0x2429('0x2f')](_[_0x2429('0x35')](_0x384a43[_0x2429('0x2d')],_0x470241[_0x2429('0x2f')]),_0xe85917);if(_0x384a43['query'][_0x2429('0x36')]){_0x1fa594[_0x2429('0x37')]=_['merge'](_0x1fa594['where'],{'$or':_[_0x2429('0x2c')](_0xe85917,function(_0x239315){if(_0x239315[_0x2429('0x2a')]!==_0x2429('0x38')){var _0x5e0f14={};_0x5e0f14[_0x239315['name']]={'$like':'%'+_0x384a43[_0x2429('0x2d')]['filter']+'%'};return _0x5e0f14;}})});}_0x1fa594=_[_0x2429('0x39')]({},_0x1fa594,_0x384a43[_0x2429('0x3a')]);var _0x36195c={'where':_0x1fa594[_0x2429('0x37')]};return db[_0x2429('0x3b')][_0x2429('0x3c')](_0x36195c)[_0x2429('0x22')](function(_0x23b259){_0xd1d8fc[_0x2429('0x3c')]=_0x23b259;if(_0x384a43[_0x2429('0x2d')][_0x2429('0x3d')]){_0x1fa594[_0x2429('0x3e')]=[{'all':!![]}];}return db[_0x2429('0x3b')][_0x2429('0x3f')](_0x1fa594);})['then'](function(_0x3d1489){_0xd1d8fc[_0x2429('0x40')]=_0x3d1489;return _0xd1d8fc;})[_0x2429('0x22')](respondWithFilteredResult(_0xef40de,_0x1fa594))['catch'](handleError(_0xef40de,null));};exports['show']=function(_0x3514cd,_0x590cdb){var _0x540405={'raw':!![],'where':{'id':_0x3514cd[_0x2429('0x41')]['id']}},_0x41afe1={};_0x41afe1[_0x2429('0x2b')]=_['keys'](db[_0x2429('0x3b')][_0x2429('0x28')]);_0x41afe1['query']=_[_0x2429('0x2e')](_0x3514cd['query']);_0x41afe1[_0x2429('0x2f')]=_['intersection'](_0x41afe1['model'],_0x41afe1[_0x2429('0x2d')]);_0x540405[_0x2429('0x30')]=_[_0x2429('0x42')](_0x41afe1['model'],qs[_0x2429('0x43')](_0x3514cd[_0x2429('0x2d')][_0x2429('0x43')]));_0x540405['attributes']=_0x540405[_0x2429('0x30')][_0x2429('0x31')]?_0x540405[_0x2429('0x30')]:_0x41afe1['model'];if(_0x3514cd['query'][_0x2429('0x3d')]){_0x540405['include']=[{'all':!![]}];}_0x540405=_[_0x2429('0x39')]({},_0x540405,_0x3514cd[_0x2429('0x3a')]);return db[_0x2429('0x3b')][_0x2429('0x44')](_0x540405)['then'](handleEntityNotFound(_0x590cdb,null))[_0x2429('0x22')](respondWithResult(_0x590cdb,null))[_0x2429('0x45')](handleError(_0x590cdb,null));};exports[_0x2429('0x46')]=function(_0x4c46e6,_0x4312e3){return db[_0x2429('0x3b')][_0x2429('0x46')](_0x4c46e6[_0x2429('0x47')],{})[_0x2429('0x22')](respondWithResult(_0x4312e3,0xc9))[_0x2429('0x45')](handleError(_0x4312e3,null));};exports[_0x2429('0x48')]=function(_0x2a3be5,_0x1ef933){if(_0x2a3be5[_0x2429('0x47')]['id']){delete _0x2a3be5['body']['id'];}return db[_0x2429('0x3b')][_0x2429('0x44')]({'where':{'id':_0x2a3be5[_0x2429('0x41')]['id']}})[_0x2429('0x22')](handleEntityNotFound(_0x1ef933,null))['then'](saveUpdates(_0x2a3be5[_0x2429('0x47')],null))[_0x2429('0x22')](respondWithResult(_0x1ef933,null))[_0x2429('0x45')](handleError(_0x1ef933,null));};exports[_0x2429('0x23')]=function(_0x4a2f90,_0x58602e){return db[_0x2429('0x3b')]['find']({'where':{'id':_0x4a2f90['params']['id']}})['then'](handleEntityNotFound(_0x58602e,null))[_0x2429('0x22')](removeEntity(_0x58602e,null))[_0x2429('0x45')](handleError(_0x58602e,null));};exports[_0x2429('0x49')]=function(_0x260c4d,_0x25d5cc){return db[_0x2429('0x3b')][_0x2429('0x49')]()[_0x2429('0x22')](respondWithResult(_0x25d5cc,null))[_0x2429('0x45')](handleError(_0x25d5cc,null));};
\ No newline at end of file
+var _0xf1db=['merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','name','send','index','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter'];(function(_0x84c7bb,_0x19267d){var _0x481bb9=function(_0xd8a747){while(--_0xd8a747){_0x84c7bb['push'](_0x84c7bb['shift']());}};_0x481bb9(++_0x19267d);}(_0xf1db,0x142));var _0xbf1d=function(_0x3de573,_0x24d1ba){_0x3de573=_0x3de573-0x0;var _0x19b6e2=_0xf1db[_0x3de573];return _0x19b6e2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbf1d('0x0'));var zipdir=require(_0xbf1d('0x1'));var jsonpatch=require(_0xbf1d('0x2'));var rp=require(_0xbf1d('0x3'));var moment=require(_0xbf1d('0x4'));var BPromise=require(_0xbf1d('0x5'));var Mustache=require(_0xbf1d('0x6'));var util=require(_0xbf1d('0x7'));var path=require(_0xbf1d('0x8'));var sox=require('sox');var csv=require(_0xbf1d('0x9'));var ejs=require(_0xbf1d('0xa'));var fs=require('fs');var fs_extra=require(_0xbf1d('0xb'));var _=require(_0xbf1d('0xc'));var squel=require('squel');var crypto=require(_0xbf1d('0xd'));var jsforce=require(_0xbf1d('0xe'));var deskjs=require(_0xbf1d('0xf'));var toCsv=require(_0xbf1d('0x9'));var querystring=require(_0xbf1d('0x10'));var Papa=require(_0xbf1d('0x11'));var Redis=require(_0xbf1d('0x12'));var authService=require(_0xbf1d('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf1d('0x14'));var logger=require(_0xbf1d('0x15'))(_0xbf1d('0x16'));var utils=require(_0xbf1d('0x17'));var config=require(_0xbf1d('0x18'));var licenseUtil=require(_0xbf1d('0x19'));var db=require(_0xbf1d('0x1a'))['db'];function respondWithStatusCode(_0x380162,_0x307d75){_0x307d75=_0x307d75||0xcc;return function(_0x477983){if(_0x477983){return _0x380162[_0xbf1d('0x1b')](_0x307d75);}return _0x380162[_0xbf1d('0x1c')](_0x307d75)[_0xbf1d('0x1d')]();};}function respondWithResult(_0x3056e2,_0x504407){_0x504407=_0x504407||0xc8;return function(_0x2b6b11){if(_0x2b6b11){return _0x3056e2[_0xbf1d('0x1c')](_0x504407)[_0xbf1d('0x1e')](_0x2b6b11);}};}function respondWithFilteredResult(_0x5c56b4,_0x4cd36e){return function(_0x125718){if(_0x125718){var _0x2acd9c=typeof _0x4cd36e[_0xbf1d('0x1f')]===_0xbf1d('0x20')&&typeof _0x4cd36e[_0xbf1d('0x21')]===_0xbf1d('0x20');var _0x5d2eb2=_0x125718[_0xbf1d('0x22')];var _0x226c48=_0x2acd9c?0x0:_0x4cd36e[_0xbf1d('0x1f')];var _0x428413=_0x2acd9c?_0x125718[_0xbf1d('0x22')]:_0x4cd36e[_0xbf1d('0x1f')]+_0x4cd36e[_0xbf1d('0x21')];var _0x1f2611;if(_0x428413>=_0x5d2eb2){_0x428413=_0x5d2eb2;_0x1f2611=0xc8;}else{_0x1f2611=0xce;}_0x5c56b4[_0xbf1d('0x1c')](_0x1f2611);return _0x5c56b4[_0xbf1d('0x23')]('Content-Range',_0x226c48+'-'+_0x428413+'/'+_0x5d2eb2)[_0xbf1d('0x1e')](_0x125718);}return null;};}function patchUpdates(_0x52bc38){return function(_0x3b0cdd){try{jsonpatch[_0xbf1d('0x24')](_0x3b0cdd,_0x52bc38,!![]);}catch(_0x400fb0){return BPromise['reject'](_0x400fb0);}return _0x3b0cdd[_0xbf1d('0x25')]();};}function saveUpdates(_0x24937d,_0x4441f8){return function(_0x121d84){if(_0x121d84){return _0x121d84[_0xbf1d('0x26')](_0x24937d)[_0xbf1d('0x27')](function(_0x3a9d39){return _0x3a9d39;});}return null;};}function removeEntity(_0xf00934,_0x46d71e){return function(_0x51b43a){if(_0x51b43a){return _0x51b43a[_0xbf1d('0x28')]()[_0xbf1d('0x27')](function(){_0xf00934[_0xbf1d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48f19d,_0x15e83c){return function(_0xcac176){if(!_0xcac176){_0x48f19d[_0xbf1d('0x1b')](0x194);}return _0xcac176;};}function handleError(_0x2b3851,_0x3bb8da){_0x3bb8da=_0x3bb8da||0x1f4;return function(_0x33b1bc){logger['error'](_0x33b1bc['stack']);if(_0x33b1bc['name']){delete _0x33b1bc[_0xbf1d('0x29')];}_0x2b3851[_0xbf1d('0x1c')](_0x3bb8da)[_0xbf1d('0x2a')](_0x33b1bc);};}exports[_0xbf1d('0x2b')]=function(_0x539d09,_0x4810d1){var _0xf43dd9={},_0x280b0b={},_0x4170c2={'count':0x0,'rows':[]};var _0x4452dc=_['map'](db[_0xbf1d('0x2c')][_0xbf1d('0x2d')],function(_0x353f32){return{'name':_0x353f32[_0xbf1d('0x2e')],'type':_0x353f32[_0xbf1d('0x2f')][_0xbf1d('0x30')]};});_0x280b0b[_0xbf1d('0x31')]=_['map'](_0x4452dc,_0xbf1d('0x29'));_0x280b0b[_0xbf1d('0x32')]=_[_0xbf1d('0x33')](_0x539d09['query']);_0x280b0b[_0xbf1d('0x34')]=_[_0xbf1d('0x35')](_0x280b0b[_0xbf1d('0x31')],_0x280b0b[_0xbf1d('0x32')]);_0xf43dd9[_0xbf1d('0x36')]=_[_0xbf1d('0x35')](_0x280b0b[_0xbf1d('0x31')],qs[_0xbf1d('0x37')](_0x539d09[_0xbf1d('0x32')][_0xbf1d('0x37')]));_0xf43dd9[_0xbf1d('0x36')]=_0xf43dd9['attributes'][_0xbf1d('0x38')]?_0xf43dd9[_0xbf1d('0x36')]:_0x280b0b[_0xbf1d('0x31')];if(!_0x539d09[_0xbf1d('0x32')][_0xbf1d('0x39')](_0xbf1d('0x3a'))){_0xf43dd9[_0xbf1d('0x21')]=qs[_0xbf1d('0x21')](_0x539d09[_0xbf1d('0x32')][_0xbf1d('0x21')]);_0xf43dd9['offset']=qs[_0xbf1d('0x1f')](_0x539d09[_0xbf1d('0x32')][_0xbf1d('0x1f')]);}_0xf43dd9['order']=qs[_0xbf1d('0x3b')](_0x539d09[_0xbf1d('0x32')]['sort']);_0xf43dd9[_0xbf1d('0x3c')]=qs[_0xbf1d('0x34')](_[_0xbf1d('0x3d')](_0x539d09[_0xbf1d('0x32')],_0x280b0b[_0xbf1d('0x34')]),_0x4452dc);if(_0x539d09[_0xbf1d('0x32')][_0xbf1d('0x3e')]){_0xf43dd9[_0xbf1d('0x3c')]=_[_0xbf1d('0x3f')](_0xf43dd9['where'],{'$or':_['map'](_0x4452dc,function(_0x4d4bb0){if(_0x4d4bb0[_0xbf1d('0x2f')]!==_0xbf1d('0x40')){var _0x2d2d91={};_0x2d2d91[_0x4d4bb0['name']]={'$like':'%'+_0x539d09[_0xbf1d('0x32')][_0xbf1d('0x3e')]+'%'};return _0x2d2d91;}})});}_0xf43dd9=_[_0xbf1d('0x3f')]({},_0xf43dd9,_0x539d09['options']);var _0x5c49c0={'where':_0xf43dd9['where']};return db[_0xbf1d('0x2c')][_0xbf1d('0x22')](_0x5c49c0)[_0xbf1d('0x27')](function(_0x500ade){_0x4170c2[_0xbf1d('0x22')]=_0x500ade;if(_0x539d09[_0xbf1d('0x32')][_0xbf1d('0x41')]){_0xf43dd9[_0xbf1d('0x42')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0xbf1d('0x43')](_0xf43dd9);})['then'](function(_0x155484){_0x4170c2[_0xbf1d('0x44')]=_0x155484;return _0x4170c2;})[_0xbf1d('0x27')](respondWithFilteredResult(_0x4810d1,_0xf43dd9))[_0xbf1d('0x45')](handleError(_0x4810d1,null));};exports[_0xbf1d('0x46')]=function(_0x98a1af,_0x55ddb1){var _0x504368={'raw':!![],'where':{'id':_0x98a1af[_0xbf1d('0x47')]['id']}},_0x134839={};_0x134839[_0xbf1d('0x31')]=_[_0xbf1d('0x33')](db[_0xbf1d('0x2c')]['rawAttributes']);_0x134839['query']=_['keys'](_0x98a1af[_0xbf1d('0x32')]);_0x134839['filters']=_[_0xbf1d('0x35')](_0x134839[_0xbf1d('0x31')],_0x134839[_0xbf1d('0x32')]);_0x504368['attributes']=_['intersection'](_0x134839[_0xbf1d('0x31')],qs[_0xbf1d('0x37')](_0x98a1af[_0xbf1d('0x32')]['fields']));_0x504368[_0xbf1d('0x36')]=_0x504368['attributes'][_0xbf1d('0x38')]?_0x504368[_0xbf1d('0x36')]:_0x134839['model'];if(_0x98a1af[_0xbf1d('0x32')][_0xbf1d('0x41')]){_0x504368[_0xbf1d('0x42')]=[{'all':!![]}];}_0x504368=_[_0xbf1d('0x3f')]({},_0x504368,_0x98a1af[_0xbf1d('0x48')]);return db[_0xbf1d('0x2c')]['find'](_0x504368)[_0xbf1d('0x27')](handleEntityNotFound(_0x55ddb1,null))[_0xbf1d('0x27')](respondWithResult(_0x55ddb1,null))[_0xbf1d('0x45')](handleError(_0x55ddb1,null));};exports[_0xbf1d('0x49')]=function(_0x22b289,_0x54cb9f){return db['VoiceTransferReport'][_0xbf1d('0x49')](_0x22b289[_0xbf1d('0x4a')],{})[_0xbf1d('0x27')](respondWithResult(_0x54cb9f,0xc9))[_0xbf1d('0x45')](handleError(_0x54cb9f,null));};exports[_0xbf1d('0x26')]=function(_0x33a780,_0xe3c937){if(_0x33a780[_0xbf1d('0x4a')]['id']){delete _0x33a780['body']['id'];}return db[_0xbf1d('0x2c')][_0xbf1d('0x4b')]({'where':{'id':_0x33a780[_0xbf1d('0x47')]['id']}})[_0xbf1d('0x27')](handleEntityNotFound(_0xe3c937,null))[_0xbf1d('0x27')](saveUpdates(_0x33a780[_0xbf1d('0x4a')],null))['then'](respondWithResult(_0xe3c937,null))[_0xbf1d('0x45')](handleError(_0xe3c937,null));};exports['destroy']=function(_0x5cec43,_0x290d86){return db[_0xbf1d('0x2c')][_0xbf1d('0x4b')]({'where':{'id':_0x5cec43[_0xbf1d('0x47')]['id']}})['then'](handleEntityNotFound(_0x290d86,null))[_0xbf1d('0x27')](removeEntity(_0x290d86,null))[_0xbf1d('0x45')](handleError(_0x290d86,null));};exports['describe']=function(_0x47abce,_0x31144c){return db[_0xbf1d('0x2c')][_0xbf1d('0x4c')]()[_0xbf1d('0x27')](respondWithResult(_0x31144c,null))[_0xbf1d('0x45')](handleError(_0x31144c,null));};
\ No newline at end of file
index 87ba382..ae0a0cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafae=['lodash','util','../../config/logger','api','moment','bluebird','path','exports','define','report_call_transfer'];(function(_0x1a87b3,_0x45ba68){var _0x37e84d=function(_0x39f49e){while(--_0x39f49e){_0x1a87b3['push'](_0x1a87b3['shift']());}};_0x37e84d(++_0x45ba68);}(_0xafae,0x19a));var _0xeafa=function(_0xd661ce,_0x32b04d){_0xd661ce=_0xd661ce-0x0;var _0x9dc037=_0xafae[_0xd661ce];return _0x9dc037;};'use strict';var _=require(_0xeafa('0x0'));var util=require(_0xeafa('0x1'));var logger=require(_0xeafa('0x2'))(_0xeafa('0x3'));var moment=require(_0xeafa('0x4'));var BPromise=require(_0xeafa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeafa('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceTransferReport.attributes');module[_0xeafa('0x7')]=function(_0x2c78ff,_0x162310){return _0x2c78ff[_0xeafa('0x8')]('VoiceTransferReport',attributes,{'tableName':_0xeafa('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd323=['rimraf','../../config/environment','exports','define','VoiceTransferReport','report_call_transfer','lodash','../../config/logger','api','moment','path'];(function(_0x4cba56,_0x5b2c44){var _0x3cc9f3=function(_0x5bb80a){while(--_0x5bb80a){_0x4cba56['push'](_0x4cba56['shift']());}};_0x3cc9f3(++_0x5b2c44);}(_0xd323,0xf8));var _0x3d32=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd323[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3d32('0x0'));var util=require('util');var logger=require(_0x3d32('0x1'))(_0x3d32('0x2'));var moment=require(_0x3d32('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d32('0x4'));var rimraf=require(_0x3d32('0x5'));var config=require(_0x3d32('0x6'));var attributes=require('./voiceTransferReport.attributes');module[_0x3d32('0x7')]=function(_0x3ce4b8,_0x2ccfe0){return _0x3ce4b8[_0x3d32('0x8')](_0x3d32('0x9'),attributes,{'tableName':_0x3d32('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8ff7868..be288b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2950=['info','result','catch','CreateVoiceTransferReport','create','options','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceTransferReport,\x20%s,\x20%s'];(function(_0x511ec0,_0x789506){var _0x18369e=function(_0x32bc42){while(--_0x32bc42){_0x511ec0['push'](_0x511ec0['shift']());}};_0x18369e(++_0x789506);}(_0x2950,0x15f));var _0x0295=function(_0x5be32c,_0x1acaec){_0x5be32c=_0x5be32c-0x0;var _0x2335ee=_0x2950[_0x5be32c];return _0x2335ee;};'use strict';var _=require(_0x0295('0x0'));var util=require('util');var moment=require(_0x0295('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0295('0x2'))['db'];var utils=require(_0x0295('0x3'));var logger=require(_0x0295('0x4'))(_0x0295('0x5'));var config=require('../../config/environment');var jayson=require(_0x0295('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x543d2a,_0x1969bd,_0x1af2d4){return new BPromise(function(_0x379a6d,_0xa1fcf){return client[_0x0295('0x7')](_0x543d2a,_0x1af2d4)[_0x0295('0x8')](function(_0x423b44){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x1969bd,_0x0295('0x9'));logger[_0x0295('0xa')](_0x0295('0xb'),_0x1969bd,_0x0295('0x9'),JSON[_0x0295('0xc')](_0x423b44));if(_0x423b44[_0x0295('0xd')]){if(_0x423b44[_0x0295('0xd')][_0x0295('0xe')]===0x1f4){logger[_0x0295('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x1969bd,_0x423b44[_0x0295('0xd')][_0x0295('0xf')]);return _0xa1fcf(_0x423b44['error']['message']);}logger[_0x0295('0xd')](_0x0295('0x10'),_0x1969bd,_0x423b44[_0x0295('0xd')][_0x0295('0xf')]);return _0x379a6d(_0x423b44[_0x0295('0xd')]['message']);}else{logger[_0x0295('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x1969bd,_0x0295('0x9'));_0x379a6d(_0x423b44[_0x0295('0x12')]['message']);}})[_0x0295('0x13')](function(_0x4a59e9){logger[_0x0295('0xd')](_0x0295('0x10'),_0x1969bd,_0x4a59e9);_0xa1fcf(_0x4a59e9);});});}exports[_0x0295('0x14')]=function(_0x3656f5){var _0x1c2656=this;return new Promise(function(_0x11c5eb,_0x841b36){return db['VoiceTransferReport'][_0x0295('0x15')](_0x3656f5['body'],{'raw':_0x3656f5[_0x0295('0x16')]?_0x3656f5[_0x0295('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1facbe){logger[_0x0295('0x11')](_0x0295('0x14'),_0x3656f5);logger['debug'](_0x0295('0x14'),_0x3656f5,JSON[_0x0295('0xc')](_0x1facbe));_0x11c5eb(_0x1facbe);})['catch'](function(_0x2b2078){logger[_0x0295('0xd')]('CreateVoiceTransferReport',_0x2b2078[_0x0295('0xf')],_0x3656f5);_0x841b36(_0x1c2656[_0x0295('0xd')](0x1f4,_0x2b2078[_0x0295('0xf')]));});});};
\ No newline at end of file
+var _0x366c=['info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','options','raw','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','request','then'];(function(_0x370ab9,_0x3d06df){var _0x869719=function(_0x3db278){while(--_0x3db278){_0x370ab9['push'](_0x370ab9['shift']());}};_0x869719(++_0x3d06df);}(_0x366c,0x109));var _0xc366=function(_0x52cf03,_0x296828){_0x52cf03=_0x52cf03-0x0;var _0x15a9d0=_0x366c[_0x52cf03];return _0x15a9d0;};'use strict';var _=require(_0xc366('0x0'));var util=require(_0xc366('0x1'));var moment=require(_0xc366('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc366('0x3'));var db=require(_0xc366('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc366('0x5'))('rpc');var config=require(_0xc366('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc366('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3be894,_0xe5d7c3,_0x48a084){return new BPromise(function(_0x2406e6,_0x445536){return client[_0xc366('0x8')](_0x3be894,_0x48a084)[_0xc366('0x9')](function(_0x23132d){logger[_0xc366('0xa')](_0xc366('0xb'),_0xe5d7c3,_0xc366('0xc'));logger[_0xc366('0xd')](_0xc366('0xe'),_0xe5d7c3,'request\x20sent',JSON[_0xc366('0xf')](_0x23132d));if(_0x23132d[_0xc366('0x10')]){if(_0x23132d[_0xc366('0x10')][_0xc366('0x11')]===0x1f4){logger[_0xc366('0x10')](_0xc366('0xb'),_0xe5d7c3,_0x23132d[_0xc366('0x10')][_0xc366('0x12')]);return _0x445536(_0x23132d[_0xc366('0x10')]['message']);}logger[_0xc366('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0xe5d7c3,_0x23132d[_0xc366('0x10')][_0xc366('0x12')]);return _0x2406e6(_0x23132d[_0xc366('0x10')][_0xc366('0x12')]);}else{logger[_0xc366('0xa')](_0xc366('0xb'),_0xe5d7c3,'request\x20sent');_0x2406e6(_0x23132d[_0xc366('0x13')][_0xc366('0x12')]);}})[_0xc366('0x14')](function(_0x3cc029){logger[_0xc366('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0xe5d7c3,_0x3cc029);_0x445536(_0x3cc029);});});}exports[_0xc366('0x15')]=function(_0x585ba9){var _0x38798e=this;return new Promise(function(_0x32ce19,_0x1a4d06){return db[_0xc366('0x16')]['create'](_0x585ba9['body'],{'raw':_0x585ba9[_0xc366('0x17')]?_0x585ba9[_0xc366('0x17')][_0xc366('0x18')]===undefined?!![]:![]:!![]})[_0xc366('0x9')](function(_0x397307){logger[_0xc366('0xa')](_0xc366('0x15'),_0x585ba9);logger[_0xc366('0xd')]('CreateVoiceTransferReport',_0x585ba9,JSON[_0xc366('0xf')](_0x397307));_0x32ce19(_0x397307);})[_0xc366('0x14')](function(_0x337aa5){logger['error']('CreateVoiceTransferReport',_0x337aa5['message'],_0x585ba9);_0x1a4d06(_0x38798e[_0xc366('0x10')](0x1f4,_0x337aa5[_0xc366('0x12')]));});});};
\ No newline at end of file
index 49b80d6..3964e45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14d=['hangup','answer','/hold','hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','originate','post','/hangup','isWebrtcLicence'];(function(_0x57ec1a,_0x2b7624){var _0x2159ad=function(_0x4738b4){while(--_0x4738b4){_0x57ec1a['push'](_0x57ec1a['shift']());}};_0x2159ad(++_0x2b7624);}(_0xe14d,0x1ee));var _0xde14=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe14d[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xde14('0x0'));var router=express[_0xde14('0x1')]();var auth=require(_0xde14('0x2'));var controller=require(_0xde14('0x3'));router['post'](_0xde14('0x4'),auth[_0xde14('0x5')](),auth['isWebrtcLicence'](),controller[_0xde14('0x6')]);router[_0xde14('0x7')](_0xde14('0x8'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xa')]);router['post']('/answer',auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xb')]);router[_0xde14('0x7')](_0xde14('0xc'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xd')]);router['post'](_0xde14('0xe'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xf')]);router[_0xde14('0x7')](_0xde14('0x10'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0x11')]);router[_0xde14('0x7')](_0xde14('0x12'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0x13')]);module[_0xde14('0x14')]=router;
\ No newline at end of file
+var _0xe14d=['hangup','answer','/hold','hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','originate','post','/hangup','isWebrtcLicence'];(function(_0x59f0dc,_0x1e2497){var _0x5b5445=function(_0x57ca91){while(--_0x57ca91){_0x59f0dc['push'](_0x59f0dc['shift']());}};_0x5b5445(++_0x1e2497);}(_0xe14d,0x1ee));var _0xde14=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xe14d[_0x8de54f];return _0x14cba4;};'use strict';var express=require(_0xde14('0x0'));var router=express[_0xde14('0x1')]();var auth=require(_0xde14('0x2'));var controller=require(_0xde14('0x3'));router['post'](_0xde14('0x4'),auth[_0xde14('0x5')](),auth['isWebrtcLicence'](),controller[_0xde14('0x6')]);router[_0xde14('0x7')](_0xde14('0x8'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xa')]);router['post']('/answer',auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xb')]);router[_0xde14('0x7')](_0xde14('0xc'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xd')]);router['post'](_0xde14('0xe'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xf')]);router[_0xde14('0x7')](_0xde14('0x10'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0x11')]);router[_0xde14('0x7')](_0xde14('0x12'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0x13')]);module[_0xde14('0x14')]=router;
\ No newline at end of file
index 723f498..b99d29d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2121=['string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','request','then','message','catch','User','findOne','agent','VoiceChannels','all','filter','rows','sessionId','sessionId\x20','originate','originate\x20fired:','body','validate','length','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','originate\x20executed!','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer\x20fired:','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','conference\x20executed!','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','lodash','util','bluebird','jayson/promise','client','http','webbarapi','redis','defaults','localhost','socket.io-emitter','number','userId\x20is\x20required'];(function(_0x5f038b,_0x372c73){var _0x32e7d9=function(_0x2c6ce9){while(--_0x2c6ce9){_0x5f038b['push'](_0x5f038b['shift']());}};_0x32e7d9(++_0x372c73);}(_0x2121,0x1b4));var _0x1212=function(_0x320fbe,_0x39e074){_0x320fbe=_0x320fbe-0x0;var _0x19807b=_0x2121[_0x320fbe];return _0x19807b;};'use strict';var path=require(_0x1212('0x0'));var fs=require('fs');var _=require(_0x1212('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var util=require(_0x1212('0x2'));var BPromise=require(_0x1212('0x3'));var jayson=require(_0x1212('0x4'));var amiClient=jayson[_0x1212('0x5')][_0x1212('0x6')]({'port':0x232a});var logger=require('../../config/logger')(_0x1212('0x7'));var Redis=require('ioredis');config[_0x1212('0x8')]=_[_0x1212('0x9')](config[_0x1212('0x8')],{'host':_0x1212('0xa'),'port':0x18eb});var io=require(_0x1212('0xb'))(new Redis(config[_0x1212('0x8')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x1212('0xc'),'required':[!![],_0x1212('0xd')]},'callNumber':{'type':_0x1212('0xe'),'required':[!![],_0x1212('0xf')]},'callerId':{'type':_0x1212('0xe')},'callbackUrl':{'type':_0x1212('0xe')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x1212('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x1212('0xc'),'required':[!![],_0x1212('0xd')]},'sessionId':{'type':_0x1212('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x1212('0xd')]},'sessionId':{'type':_0x1212('0xe'),'required':[!![],_0x1212('0x10')]},'transferNumber':{'type':_0x1212('0xe'),'required':[!![],_0x1212('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0x1212('0xc'),'required':[!![],_0x1212('0xd')]},'sessionId':{'type':_0x1212('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x1212('0xc'),'required':[!![],_0x1212('0xd')]},'sessionId':{'type':_0x1212('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x1212('0xc'),'required':[!![],_0x1212('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':_0x1212('0xc'),'required':[!![],_0x1212('0xd')]}});function emit(_0x5cc246,_0x568870,_0x54ae52){logger[_0x1212('0x12')](_0x5cc246,_0x568870,JSON[_0x1212('0x13')](_0x54ae52));io['to'](_0x5cc246)[_0x1212('0x14')](_0x568870,_0x54ae52);}function handleError(_0x3dd9dd){return function(_0x3cf284){console[_0x1212('0x15')](_0x1212('0x16'),_0x3cf284,_0x3cf284 instanceof RangeError);logger[_0x1212('0x17')](_0x3cf284[_0x1212('0x18')]);if(_0x3cf284 instanceof RangeError){if(_0x3cf284['name']){delete _0x3cf284[_0x1212('0x19')];}_0x3dd9dd[_0x1212('0x1a')](0x194)[_0x1212('0x1b')](_0x3cf284);}else{if(_0x3cf284[_0x1212('0x19')]){delete _0x3cf284[_0x1212('0x19')];}_0x3dd9dd[_0x1212('0x1a')](0x1f4)[_0x1212('0x1b')](_0x3cf284);}};}function checkError(){return function(_0x8d4002){if(!_0x8d4002){throw new RangeError('NotFound');}return _0x8d4002;};}function respondWithRpcPromise(_0x38a5e2,_0x3a9664){return new BPromise(function(_0x46d6df,_0x5d15ca){var _0x1571fd=amiClient;return _0x1571fd[_0x1212('0x1c')](_0x38a5e2,_0x3a9664)[_0x1212('0x1d')](function(_0x28c92b){if(_0x28c92b['error']){if(_0x28c92b['error']['code']===0x1f4){return _0x5d15ca(_0x28c92b['error']['message']);}return _0x46d6df(_0x28c92b[_0x1212('0x17')][_0x1212('0x1e')]);}else{_0x46d6df(_0x28c92b['result']);}})[_0x1212('0x1f')](function(_0xa1c850){_0x5d15ca(_0xa1c850);});});}function getAgent(_0x52c7b0){return db[_0x1212('0x20')][_0x1212('0x21')]({'where':{'id':_0x52c7b0,'role':_0x1212('0x22')}})[_0x1212('0x1d')](checkError());}function getAgentCheckSession(_0x3a0ddf,_0x3f6be3){return new BPromise(function(_0x2750b0,_0x2666be){var _0x53aa25=respondWithRpcPromise(_0x1212('0x23'));var _0x7706a0=getAgent(_0x3a0ddf);Promise[_0x1212('0x24')]([_0x53aa25,_0x7706a0])[_0x1212('0x1d')](function(_0x17d0f6){var _0x26446d=_0x17d0f6[0x0];var _0x315f00=_0x17d0f6[0x1];var _0x40b8f6=_[_0x1212('0x25')](_0x26446d[_0x1212('0x26')],function(_0x4b8e34){return _0x4b8e34['UserId']==_0x315f00['id']&&_0x4b8e34[_0x1212('0x27')]==_0x3f6be3;});if(_0x40b8f6['length']==0x1){_0x2750b0(_0x315f00);}else{_0x2666be(new RangeError(_0x1212('0x28')+_0x3f6be3+'\x20not\x20found!'));}});});}exports[_0x1212('0x29')]=function(_0x585bb6,_0x2c9313){logger[_0x1212('0x12')](_0x1212('0x2a'),_0x585bb6[_0x1212('0x2b')]);var _0x4df9d1=originateValidation[_0x1212('0x2c')](_0x585bb6[_0x1212('0x2b')]);if(_0x4df9d1[_0x1212('0x2d')]>0x0){return _0x2c9313[_0x1212('0x1a')](0x190)[_0x1212('0x2e')](_0x4df9d1);}var _0x47c63f=_0x585bb6[_0x1212('0x2b')][_0x1212('0x2f')];var _0x1cf542=_0x585bb6['body'][_0x1212('0x30')];var _0x33309a=_0x585bb6[_0x1212('0x2b')][_0x1212('0x31')];var _0x52c611=_0x585bb6[_0x1212('0x2b')][_0x1212('0x32')];return getAgent(_0x47c63f)['then'](function(_0x405feb){logger[_0x1212('0x12')](_0x1212('0x33'),_0x405feb['name']);emit(util[_0x1212('0x34')](_0x1212('0x35'),_0x405feb[_0x1212('0x19')]),'webbar:originate',{'callNumber':_0x1cf542,'callerId':_0x33309a,'callbackUrl':_0x52c611});return _0x2c9313[_0x1212('0x1a')](0xc8)['json']({'error':![],'message':_0x1212('0x36')});})[_0x1212('0x1f')](handleError(_0x2c9313));};exports['hangup']=function(_0x4e5be7,_0x2447c6){logger['info'](_0x1212('0x37'),_0x4e5be7[_0x1212('0x2b')]);var _0x31a69c=hangupValidation[_0x1212('0x2c')](_0x4e5be7[_0x1212('0x2b')]);if(_0x31a69c[_0x1212('0x2d')]>0x0){return _0x2447c6[_0x1212('0x1a')](0x190)[_0x1212('0x2e')](_0x31a69c);}var _0x320a5c=_0x4e5be7[_0x1212('0x2b')][_0x1212('0x2f')];var _0x1bbb84=_0x4e5be7[_0x1212('0x2b')][_0x1212('0x27')];return getAgent(_0x320a5c)[_0x1212('0x1d')](function(_0x42b95a){logger[_0x1212('0x12')](_0x1212('0x33'),_0x42b95a['name']);emit(util[_0x1212('0x34')]('user:%s',_0x42b95a['name']),_0x1212('0x38'),{'sessionId':_0x1bbb84});return _0x2447c6[_0x1212('0x1a')](0xc8)[_0x1212('0x2e')]({'error':![],'message':_0x1212('0x39')});})[_0x1212('0x1f')](handleError(_0x2447c6));};exports['answer']=function(_0x497c20,_0x37391e){logger[_0x1212('0x12')](_0x1212('0x3a'),_0x497c20[_0x1212('0x2b')]);var _0x45fc95=answerValidation[_0x1212('0x2c')](_0x497c20[_0x1212('0x2b')]);if(_0x45fc95[_0x1212('0x2d')]>0x0){return _0x37391e[_0x1212('0x1a')](0x190)[_0x1212('0x2e')](_0x45fc95);}var _0x1af6ae=_0x497c20[_0x1212('0x2b')]['userId'];var _0x584d32=_0x497c20[_0x1212('0x2b')][_0x1212('0x27')];return getAgent(_0x1af6ae)['then'](function(_0x1a9c63){logger['info'](_0x1212('0x33'),_0x1a9c63[_0x1212('0x19')]);emit(util[_0x1212('0x34')](_0x1212('0x35'),_0x1a9c63[_0x1212('0x19')]),'webbar:answer',{'sessionId':_0x584d32});return _0x37391e[_0x1212('0x1a')](0xc8)[_0x1212('0x2e')]({'error':![],'message':_0x1212('0x3b')});})['catch'](handleError(_0x37391e));};exports[_0x1212('0x3c')]=function(_0x298538,_0x4b1625){logger[_0x1212('0x12')](_0x1212('0x3d'),_0x298538[_0x1212('0x2b')]);var _0x126df5=holdValidation[_0x1212('0x2c')](_0x298538[_0x1212('0x2b')]);if(_0x126df5['length']>0x0){return _0x4b1625[_0x1212('0x1a')](0x190)[_0x1212('0x2e')](_0x126df5);}var _0x3a4f8c=_0x298538['body']['userId'];var _0xf7d207=_0x298538['body'][_0x1212('0x27')];return getAgent(_0x3a4f8c)['then'](function(_0x50a8ef){logger[_0x1212('0x12')](_0x1212('0x33'),_0x50a8ef['name']);emit(util[_0x1212('0x34')]('user:%s',_0x50a8ef[_0x1212('0x19')]),_0x1212('0x3e'),{'sessionId':_0xf7d207});return _0x4b1625['status'](0xc8)['json']({'error':![],'message':_0x1212('0x3f')});})['catch'](handleError(_0x4b1625));};exports[_0x1212('0x40')]=function(_0x53a46f,_0x20e66f){logger['info'](_0x1212('0x41'),_0x53a46f[_0x1212('0x2b')]);var _0x249066=unholdValidation[_0x1212('0x2c')](_0x53a46f[_0x1212('0x2b')]);if(_0x249066[_0x1212('0x2d')]>0x0){return _0x20e66f['status'](0x190)['json'](_0x249066);}var _0x2a983e=_0x53a46f[_0x1212('0x2b')][_0x1212('0x2f')];var _0x140984=_0x53a46f[_0x1212('0x2b')][_0x1212('0x27')];return getAgent(_0x2a983e)['then'](function(_0x5e3644){logger['info'](_0x1212('0x33'),_0x5e3644[_0x1212('0x19')]);emit(util[_0x1212('0x34')](_0x1212('0x35'),_0x5e3644[_0x1212('0x19')]),'webbar:unhold',{'sessionId':_0x140984});return _0x20e66f[_0x1212('0x1a')](0xc8)[_0x1212('0x2e')]({'error':![],'message':_0x1212('0x42')});})[_0x1212('0x1f')](handleError(_0x20e66f));};exports[_0x1212('0x43')]=function(_0x271ecf,_0x4901c1){logger[_0x1212('0x12')](_0x1212('0x44'),_0x4901c1[_0x1212('0x2b')]);var _0x4a86bd=callsValidation[_0x1212('0x2c')](_0x271ecf[_0x1212('0x2b')]);if(_0x4a86bd[_0x1212('0x2d')]>0x0){return _0x4901c1[_0x1212('0x1a')](0x190)['json'](_0x4a86bd);}var _0x27e94b=_0x271ecf[_0x1212('0x2b')][_0x1212('0x2f')];var _0x41e155=respondWithRpcPromise(_0x1212('0x23'));var _0x162fb0=getAgent(_0x27e94b);return Promise['all']([_0x41e155,_0x162fb0])[_0x1212('0x1d')](function(_0x4ee27a){var _0x568935=_0x4ee27a[0x0];var _0x3c940a=_0x4ee27a[0x1];var _0x343e54=_['filter'](_0x568935[_0x1212('0x26')],function(_0x486162){return _0x486162['UserId']==_0x3c940a['id'];});return _0x4901c1['status'](0xc8)['json']({'count':_0x343e54['length'],'rows':_0x343e54});})[_0x1212('0x1f')](handleError(_0x4901c1));};exports[_0x1212('0x45')]=function(_0x467c40,_0x121f00){logger[_0x1212('0x12')](_0x1212('0x46'),_0x467c40[_0x1212('0x2b')]);var _0x41f7be=conferenceValidation[_0x1212('0x2c')](_0x467c40[_0x1212('0x2b')]);if(_0x41f7be[_0x1212('0x2d')]>0x0){return _0x121f00[_0x1212('0x1a')](0x190)[_0x1212('0x2e')](_0x41f7be);}var _0x49c742=_0x467c40[_0x1212('0x2b')]['userId'];return getAgent(_0x49c742)[_0x1212('0x1d')](function(_0x1170cb){logger[_0x1212('0x12')](_0x1212('0x33'),_0x1170cb[_0x1212('0x19')]);emit(util[_0x1212('0x34')](_0x1212('0x35'),_0x1170cb[_0x1212('0x19')]),'webbar:conference');return _0x121f00[_0x1212('0x1a')](0xc8)[_0x1212('0x2e')]({'error':![],'message':_0x1212('0x47')});})[_0x1212('0x1f')](handleError(_0x121f00));};exports['transfer']=function(_0xa0f4f2,_0x28bb5e){logger['info'](_0x1212('0x48'),_0xa0f4f2[_0x1212('0x2b')]);var _0x519879=transferValidation[_0x1212('0x2c')](_0xa0f4f2[_0x1212('0x2b')]);if(_0x519879[_0x1212('0x2d')]>0x0){return _0x28bb5e[_0x1212('0x1a')](0x190)[_0x1212('0x2e')](_0x519879);}var _0x3a9843=_0xa0f4f2[_0x1212('0x2b')][_0x1212('0x2f')];var _0x388432=_0xa0f4f2[_0x1212('0x2b')][_0x1212('0x27')];var _0x59b660=_0xa0f4f2[_0x1212('0x2b')]['transferNumber'];return getAgent(_0x3a9843)[_0x1212('0x1d')](function(_0x54cca8){logger[_0x1212('0x12')](_0x1212('0x33'),_0x54cca8[_0x1212('0x19')]);emit(util[_0x1212('0x34')]('user:%s',_0x54cca8['name']),_0x1212('0x49'),{'sessionId':_0x388432,'transferNumber':_0x59b660});return _0x28bb5e[_0x1212('0x1a')](0xc8)[_0x1212('0x2e')]({'error':![],'message':_0x1212('0x4a')});})['catch'](handleError(_0x28bb5e));};
\ No newline at end of file
+var _0xd382=['stack','name','status','send','NotFound','request','then','error','code','message','result','catch','User','findOne','VoiceChannels','rows','UserId','sessionId','length','\x20not\x20found!','originate','originate\x20fired:','body','json','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','userId','hangup\x20executed!','webbar:answer','answer\x20executed!','hold','hold\x20fired:','unhold','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','all','filter','conference','webbar:conference','conference\x20executed!','transfer','transferNumber','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','defaults','redis','socket.io-emitter','validate','string','callNumber\x20is\x20required','number','userId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:'];(function(_0x4e58e4,_0x42a9cd){var _0x29450c=function(_0xcdc327){while(--_0xcdc327){_0x4e58e4['push'](_0x4e58e4['shift']());}};_0x29450c(++_0x42a9cd);}(_0xd382,0x1b6));var _0x2d38=function(_0x1ae38b,_0x1accf8){_0x1ae38b=_0x1ae38b-0x0;var _0x5a076d=_0xd382[_0x1ae38b];return _0x5a076d;};'use strict';var path=require(_0x2d38('0x0'));var fs=require('fs');var _=require(_0x2d38('0x1'));var db=require(_0x2d38('0x2'))['db'];var config=require(_0x2d38('0x3'));var util=require(_0x2d38('0x4'));var BPromise=require(_0x2d38('0x5'));var jayson=require(_0x2d38('0x6'));var amiClient=jayson[_0x2d38('0x7')][_0x2d38('0x8')]({'port':0x232a});var logger=require(_0x2d38('0x9'))('webbarapi');var Redis=require('ioredis');config['redis']=_[_0x2d38('0xa')](config[_0x2d38('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x2d38('0xc'))(new Redis(config[_0x2d38('0xb')]));var Schema=require(_0x2d38('0xd'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x2d38('0xe'),'required':[!![],_0x2d38('0xf')]},'callerId':{'type':_0x2d38('0xe')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x2d38('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x2d38('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x2d38('0x10'),'required':[!![],_0x2d38('0x11')]},'sessionId':{'type':_0x2d38('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x2d38('0x10'),'required':[!![],_0x2d38('0x11')]},'sessionId':{'type':_0x2d38('0xe'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x2d38('0xe'),'required':[!![],_0x2d38('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0x2d38('0x10'),'required':[!![],_0x2d38('0x11')]},'sessionId':{'type':_0x2d38('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x2d38('0x11')]},'sessionId':{'type':_0x2d38('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x2d38('0x10'),'required':[!![],_0x2d38('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0x2d38('0x10'),'required':[!![],_0x2d38('0x11')]}});function emit(_0xc6de5a,_0x2d3cb1,_0xc17f9e){logger[_0x2d38('0x13')](_0xc6de5a,_0x2d3cb1,JSON[_0x2d38('0x14')](_0xc17f9e));io['to'](_0xc6de5a)[_0x2d38('0x15')](_0x2d3cb1,_0xc17f9e);}function handleError(_0x31a29e){return function(_0x1e3028){console[_0x2d38('0x16')](_0x2d38('0x17'),_0x1e3028,_0x1e3028 instanceof RangeError);logger['error'](_0x1e3028[_0x2d38('0x18')]);if(_0x1e3028 instanceof RangeError){if(_0x1e3028[_0x2d38('0x19')]){delete _0x1e3028['name'];}_0x31a29e[_0x2d38('0x1a')](0x194)[_0x2d38('0x1b')](_0x1e3028);}else{if(_0x1e3028[_0x2d38('0x19')]){delete _0x1e3028['name'];}_0x31a29e[_0x2d38('0x1a')](0x1f4)['send'](_0x1e3028);}};}function checkError(){return function(_0x4bdac6){if(!_0x4bdac6){throw new RangeError(_0x2d38('0x1c'));}return _0x4bdac6;};}function respondWithRpcPromise(_0x2e0b73,_0x3713ea){return new BPromise(function(_0x3892a5,_0x19e658){var _0x3138bc=amiClient;return _0x3138bc[_0x2d38('0x1d')](_0x2e0b73,_0x3713ea)[_0x2d38('0x1e')](function(_0x24e2cb){if(_0x24e2cb[_0x2d38('0x1f')]){if(_0x24e2cb['error'][_0x2d38('0x20')]===0x1f4){return _0x19e658(_0x24e2cb['error'][_0x2d38('0x21')]);}return _0x3892a5(_0x24e2cb['error'][_0x2d38('0x21')]);}else{_0x3892a5(_0x24e2cb[_0x2d38('0x22')]);}})[_0x2d38('0x23')](function(_0x10e283){_0x19e658(_0x10e283);});});}function getAgent(_0xffa3ce){return db[_0x2d38('0x24')][_0x2d38('0x25')]({'where':{'id':_0xffa3ce,'role':'agent'}})[_0x2d38('0x1e')](checkError());}function getAgentCheckSession(_0x3f0f7a,_0x34599a){return new BPromise(function(_0x3d18cd,_0x346934){var _0xe73710=respondWithRpcPromise(_0x2d38('0x26'));var _0x3a6437=getAgent(_0x3f0f7a);Promise['all']([_0xe73710,_0x3a6437])['then'](function(_0x5570c2){var _0x31d427=_0x5570c2[0x0];var _0xbd364b=_0x5570c2[0x1];var _0xd333fe=_['filter'](_0x31d427[_0x2d38('0x27')],function(_0x4b5891){return _0x4b5891[_0x2d38('0x28')]==_0xbd364b['id']&&_0x4b5891[_0x2d38('0x29')]==_0x34599a;});if(_0xd333fe[_0x2d38('0x2a')]==0x1){_0x3d18cd(_0xbd364b);}else{_0x346934(new RangeError('sessionId\x20'+_0x34599a+_0x2d38('0x2b')));}});});}exports[_0x2d38('0x2c')]=function(_0x389e74,_0x52a3ce){logger[_0x2d38('0x13')](_0x2d38('0x2d'),_0x389e74[_0x2d38('0x2e')]);var _0x1b48a9=originateValidation[_0x2d38('0xd')](_0x389e74[_0x2d38('0x2e')]);if(_0x1b48a9['length']>0x0){return _0x52a3ce[_0x2d38('0x1a')](0x190)[_0x2d38('0x2f')](_0x1b48a9);}var _0xa9bf8c=_0x389e74[_0x2d38('0x2e')]['userId'];var _0x21c943=_0x389e74[_0x2d38('0x2e')][_0x2d38('0x30')];var _0x46c154=_0x389e74[_0x2d38('0x2e')][_0x2d38('0x31')];var _0x2f2549=_0x389e74[_0x2d38('0x2e')][_0x2d38('0x32')];return getAgent(_0xa9bf8c)[_0x2d38('0x1e')](function(_0x5b8ae7){logger['info'](_0x2d38('0x33'),_0x5b8ae7[_0x2d38('0x19')]);emit(util[_0x2d38('0x34')](_0x2d38('0x35'),_0x5b8ae7[_0x2d38('0x19')]),_0x2d38('0x36'),{'callNumber':_0x21c943,'callerId':_0x46c154,'callbackUrl':_0x2f2549});return _0x52a3ce[_0x2d38('0x1a')](0xc8)[_0x2d38('0x2f')]({'error':![],'message':_0x2d38('0x37')});})[_0x2d38('0x23')](handleError(_0x52a3ce));};exports[_0x2d38('0x38')]=function(_0x29dda7,_0x11f5b8){logger['info'](_0x2d38('0x39'),_0x29dda7[_0x2d38('0x2e')]);var _0x30b318=hangupValidation[_0x2d38('0xd')](_0x29dda7['body']);if(_0x30b318[_0x2d38('0x2a')]>0x0){return _0x11f5b8[_0x2d38('0x1a')](0x190)[_0x2d38('0x2f')](_0x30b318);}var _0x11e58c=_0x29dda7[_0x2d38('0x2e')][_0x2d38('0x3a')];var _0x971848=_0x29dda7[_0x2d38('0x2e')][_0x2d38('0x29')];return getAgent(_0x11e58c)[_0x2d38('0x1e')](function(_0x3cd072){logger[_0x2d38('0x13')](_0x2d38('0x33'),_0x3cd072[_0x2d38('0x19')]);emit(util['format'](_0x2d38('0x35'),_0x3cd072[_0x2d38('0x19')]),'webbar:hangup',{'sessionId':_0x971848});return _0x11f5b8['status'](0xc8)[_0x2d38('0x2f')]({'error':![],'message':_0x2d38('0x3b')});})[_0x2d38('0x23')](handleError(_0x11f5b8));};exports['answer']=function(_0x6108f1,_0x17cc8d){logger[_0x2d38('0x13')]('answer\x20fired:',_0x6108f1['body']);var _0x2eeca7=answerValidation['validate'](_0x6108f1[_0x2d38('0x2e')]);if(_0x2eeca7[_0x2d38('0x2a')]>0x0){return _0x17cc8d[_0x2d38('0x1a')](0x190)['json'](_0x2eeca7);}var _0x50cb25=_0x6108f1[_0x2d38('0x2e')][_0x2d38('0x3a')];var _0x306d6d=_0x6108f1['body'][_0x2d38('0x29')];return getAgent(_0x50cb25)[_0x2d38('0x1e')](function(_0x94f76b){logger['info'](_0x2d38('0x33'),_0x94f76b[_0x2d38('0x19')]);emit(util[_0x2d38('0x34')]('user:%s',_0x94f76b['name']),_0x2d38('0x3c'),{'sessionId':_0x306d6d});return _0x17cc8d[_0x2d38('0x1a')](0xc8)[_0x2d38('0x2f')]({'error':![],'message':_0x2d38('0x3d')});})['catch'](handleError(_0x17cc8d));};exports[_0x2d38('0x3e')]=function(_0x26d0b0,_0xd2df89){logger['info'](_0x2d38('0x3f'),_0x26d0b0['body']);var _0x580d04=holdValidation[_0x2d38('0xd')](_0x26d0b0[_0x2d38('0x2e')]);if(_0x580d04[_0x2d38('0x2a')]>0x0){return _0xd2df89[_0x2d38('0x1a')](0x190)['json'](_0x580d04);}var _0x4c4c95=_0x26d0b0[_0x2d38('0x2e')]['userId'];var _0x9c67cb=_0x26d0b0[_0x2d38('0x2e')][_0x2d38('0x29')];return getAgent(_0x4c4c95)[_0x2d38('0x1e')](function(_0x35a2ae){logger[_0x2d38('0x13')](_0x2d38('0x33'),_0x35a2ae[_0x2d38('0x19')]);emit(util[_0x2d38('0x34')]('user:%s',_0x35a2ae[_0x2d38('0x19')]),'webbar:hold',{'sessionId':_0x9c67cb});return _0xd2df89[_0x2d38('0x1a')](0xc8)[_0x2d38('0x2f')]({'error':![],'message':'hold\x20executed!'});})[_0x2d38('0x23')](handleError(_0xd2df89));};exports[_0x2d38('0x40')]=function(_0x187ba3,_0x3c2756){logger[_0x2d38('0x13')](_0x2d38('0x41'),_0x187ba3[_0x2d38('0x2e')]);var _0x360804=unholdValidation['validate'](_0x187ba3[_0x2d38('0x2e')]);if(_0x360804[_0x2d38('0x2a')]>0x0){return _0x3c2756[_0x2d38('0x1a')](0x190)[_0x2d38('0x2f')](_0x360804);}var _0x389982=_0x187ba3[_0x2d38('0x2e')][_0x2d38('0x3a')];var _0x358e2b=_0x187ba3[_0x2d38('0x2e')]['sessionId'];return getAgent(_0x389982)[_0x2d38('0x1e')](function(_0x1f92c2){logger['info']('entityFound:',_0x1f92c2[_0x2d38('0x19')]);emit(util[_0x2d38('0x34')](_0x2d38('0x35'),_0x1f92c2[_0x2d38('0x19')]),'webbar:unhold',{'sessionId':_0x358e2b});return _0x3c2756['status'](0xc8)[_0x2d38('0x2f')]({'error':![],'message':_0x2d38('0x42')});})[_0x2d38('0x23')](handleError(_0x3c2756));};exports[_0x2d38('0x43')]=function(_0x3f1f12,_0x457a82){logger[_0x2d38('0x13')](_0x2d38('0x44'),_0x457a82[_0x2d38('0x2e')]);var _0x24c107=callsValidation[_0x2d38('0xd')](_0x3f1f12['body']);if(_0x24c107[_0x2d38('0x2a')]>0x0){return _0x457a82['status'](0x190)['json'](_0x24c107);}var _0x175981=_0x3f1f12[_0x2d38('0x2e')][_0x2d38('0x3a')];var _0x4d310b=respondWithRpcPromise('VoiceChannels');var _0x3ca706=getAgent(_0x175981);return Promise[_0x2d38('0x45')]([_0x4d310b,_0x3ca706])['then'](function(_0x720bd9){var _0x245e6a=_0x720bd9[0x0];var _0x2e978c=_0x720bd9[0x1];var _0x456dc4=_[_0x2d38('0x46')](_0x245e6a['rows'],function(_0x519913){return _0x519913[_0x2d38('0x28')]==_0x2e978c['id'];});return _0x457a82['status'](0xc8)[_0x2d38('0x2f')]({'count':_0x456dc4[_0x2d38('0x2a')],'rows':_0x456dc4});})[_0x2d38('0x23')](handleError(_0x457a82));};exports[_0x2d38('0x47')]=function(_0x4fa858,_0x415817){logger[_0x2d38('0x13')]('conference\x20fired:',_0x4fa858[_0x2d38('0x2e')]);var _0x2fa092=conferenceValidation['validate'](_0x4fa858[_0x2d38('0x2e')]);if(_0x2fa092['length']>0x0){return _0x415817['status'](0x190)[_0x2d38('0x2f')](_0x2fa092);}var _0xfb9270=_0x4fa858['body']['userId'];return getAgent(_0xfb9270)[_0x2d38('0x1e')](function(_0x4deb3c){logger[_0x2d38('0x13')](_0x2d38('0x33'),_0x4deb3c[_0x2d38('0x19')]);emit(util['format']('user:%s',_0x4deb3c[_0x2d38('0x19')]),_0x2d38('0x48'));return _0x415817['status'](0xc8)[_0x2d38('0x2f')]({'error':![],'message':_0x2d38('0x49')});})[_0x2d38('0x23')](handleError(_0x415817));};exports[_0x2d38('0x4a')]=function(_0x16e148,_0x498fc2){logger[_0x2d38('0x13')]('transfer\x20fired:',_0x16e148[_0x2d38('0x2e')]);var _0x333792=transferValidation['validate'](_0x16e148['body']);if(_0x333792[_0x2d38('0x2a')]>0x0){return _0x498fc2[_0x2d38('0x1a')](0x190)[_0x2d38('0x2f')](_0x333792);}var _0x163ad5=_0x16e148['body'][_0x2d38('0x3a')];var _0x5de6ba=_0x16e148['body'][_0x2d38('0x29')];var _0x11f13e=_0x16e148[_0x2d38('0x2e')][_0x2d38('0x4b')];return getAgent(_0x163ad5)['then'](function(_0x453fff){logger[_0x2d38('0x13')](_0x2d38('0x33'),_0x453fff[_0x2d38('0x19')]);emit(util['format']('user:%s',_0x453fff['name']),'webbar:transfer',{'sessionId':_0x5de6ba,'transferNumber':_0x11f13e});return _0x498fc2['status'](0xc8)['json']({'error':![],'message':_0x2d38('0x4c')});})[_0x2d38('0x23')](handleError(_0x498fc2));};
\ No newline at end of file
index d018e6f..6d60d7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0598=['put','update','delete','destroy','/:id/canned_answers','removeAgents','multer','util','connect-timeout','fs-extra','../../components/auth/service','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','getAgents','/:id/applications','getApplications','post','addDisposition','/:id/users','addAgents','addApplications','/:id/notify'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0598,0x92));var _0x8059=function(_0x2a3090,_0x1a0f97){_0x2a3090=_0x2a3090-0x0;var _0x530f51=_0x0598[_0x2a3090];return _0x530f51;};'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('./whatsappAccount.controller');router[_0x8059('0x5')]('/',auth[_0x8059('0x6')](),controller['index']);router['get'](_0x8059('0x7'),auth[_0x8059('0x6')](),controller[_0x8059('0x8')]);router[_0x8059('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x8059('0x9')]);router[_0x8059('0x5')](_0x8059('0xa'),auth[_0x8059('0x6')](),controller[_0x8059('0xb')]);router['get']('/:id/canned_answers',auth[_0x8059('0x6')](),controller[_0x8059('0xc')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x8059('0xd')]);router[_0x8059('0x5')](_0x8059('0xe'),auth[_0x8059('0x6')](),controller[_0x8059('0xf')]);router['post']('/',auth[_0x8059('0x6')](),controller['create']);router[_0x8059('0x10')]('/:id/dispositions',auth[_0x8059('0x6')](),controller[_0x8059('0x11')]);router[_0x8059('0x10')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);router[_0x8059('0x10')](_0x8059('0x12'),auth[_0x8059('0x6')](),controller[_0x8059('0x13')]);router[_0x8059('0x10')]('/:id/applications',auth[_0x8059('0x6')](),controller[_0x8059('0x14')]);router[_0x8059('0x10')](_0x8059('0x15'),controller['notify']);router[_0x8059('0x10')]('/:id/send',auth[_0x8059('0x6')](),controller['send']);router[_0x8059('0x16')]('/:id',auth[_0x8059('0x6')](),controller[_0x8059('0x17')]);router[_0x8059('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x8059('0x19')]);router[_0x8059('0x18')](_0x8059('0xa'),auth[_0x8059('0x6')](),controller['removeDispositions']);router[_0x8059('0x18')](_0x8059('0x1a'),auth[_0x8059('0x6')](),controller['removeAnswers']);router[_0x8059('0x18')](_0x8059('0x12'),auth[_0x8059('0x6')](),controller[_0x8059('0x1b')]);module['exports']=router;
\ No newline at end of file
+var _0x01d9=['/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x167cb6,_0x1ee407){var _0x3e3063=function(_0x2a9ed4){while(--_0x2a9ed4){_0x167cb6['push'](_0x167cb6['shift']());}};_0x3e3063(++_0x1ee407);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var path=require(_0x901d('0x2'));var timeout=require(_0x901d('0x3'));var express=require('express');var router=express[_0x901d('0x4')]();var fs_extra=require(_0x901d('0x5'));var auth=require(_0x901d('0x6'));var interaction=require(_0x901d('0x7'));var config=require(_0x901d('0x8'));var controller=require(_0x901d('0x9'));router[_0x901d('0xa')]('/',auth['isAuthenticated'](),controller[_0x901d('0xb')]);router[_0x901d('0xa')](_0x901d('0xc'),auth[_0x901d('0xd')](),controller[_0x901d('0xe')]);router[_0x901d('0xa')](_0x901d('0xf'),auth[_0x901d('0xd')](),controller[_0x901d('0x10')]);router[_0x901d('0xa')](_0x901d('0x11'),auth[_0x901d('0xd')](),controller[_0x901d('0x12')]);router['get'](_0x901d('0x13'),auth['isAuthenticated'](),controller[_0x901d('0x14')]);router[_0x901d('0xa')](_0x901d('0x15'),auth[_0x901d('0xd')](),controller[_0x901d('0x16')]);router['get'](_0x901d('0x17'),auth[_0x901d('0xd')](),controller[_0x901d('0x18')]);router[_0x901d('0x19')]('/',auth[_0x901d('0xd')](),controller[_0x901d('0x1a')]);router['post'](_0x901d('0x11'),auth[_0x901d('0xd')](),controller[_0x901d('0x1b')]);router[_0x901d('0x19')](_0x901d('0x13'),auth[_0x901d('0xd')](),controller[_0x901d('0x1c')]);router[_0x901d('0x19')](_0x901d('0x15'),auth[_0x901d('0xd')](),controller[_0x901d('0x1d')]);router[_0x901d('0x19')](_0x901d('0x17'),auth[_0x901d('0xd')](),controller[_0x901d('0x1e')]);router[_0x901d('0x19')](_0x901d('0x1f'),controller[_0x901d('0x20')]);router['post'](_0x901d('0x21'),auth[_0x901d('0xd')](),controller['send']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x901d('0x22')]);router[_0x901d('0x23')]('/:id',auth[_0x901d('0xd')](),controller[_0x901d('0x24')]);router['delete'](_0x901d('0x11'),auth[_0x901d('0xd')](),controller[_0x901d('0x25')]);router[_0x901d('0x23')](_0x901d('0x13'),auth[_0x901d('0xd')](),controller[_0x901d('0x26')]);router[_0x901d('0x23')]('/:id/users',auth[_0x901d('0xd')](),controller[_0x901d('0x27')]);module[_0x901d('0x28')]=router;
\ No newline at end of file
index 68b02dd..538be88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ecb=['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','name','STRING','generate','ENUM','twilio','sinch','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3ecb,0x1b1));var _0xb3ec=function(_0x11e1ef,_0x3cbe5e){_0x11e1ef=_0x11e1ef-0x0;var _0x125d5b=_0x3ecb[_0x11e1ef];return _0x125d5b;};'use strict';var Sequelize=require(_0xb3ec('0x0'));var rs=require(_0xb3ec('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xb3ec('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xb3ec('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xb3ec('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xb3ec('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb3ec('0x5')](_0xb3ec('0x6'),_0xb3ec('0x7'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0xb3ec('0x3')]},'authToken':{'type':Sequelize[_0xb3ec('0x3')]},'notificationTemplate':{'type':Sequelize[_0xb3ec('0x8')],'defaultValue':function(){return _0xb3ec('0x9');}},'notificationSound':{'type':Sequelize[_0xb3ec('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb3ec('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb3ec('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb3ec('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xb3ec('0xc')},'mandatoryDisposition':{'type':Sequelize[_0xb3ec('0xa')],'defaultValue':![],'comment':_0xb3ec('0xd'),'set':function(_0x21fe11){if(!_0x21fe11){this[_0xb3ec('0xe')](_0xb3ec('0xf'),null);}this[_0xb3ec('0xe')](_0xb3ec('0x10'),_0x21fe11);}},'description':{'type':Sequelize[_0xb3ec('0x3')]}};
\ No newline at end of file
+var _0xccba=['TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0xccba,0x18f));var _0xaccb=function(_0x44454f,_0x4bfbe8){_0x44454f=_0x44454f-0x0;var _0x475150=_0xccba[_0x44454f];return _0x475150;};'use strict';var Sequelize=require(_0xaccb('0x0'));var rs=require(_0xaccb('0x1'));module[_0xaccb('0x2')]={'name':{'type':Sequelize[_0xaccb('0x3')],'unique':_0xaccb('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xaccb('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xaccb('0x3')],'defaultValue':function(){return rs[_0xaccb('0x5')]();}},'phone':{'type':Sequelize[_0xaccb('0x3')]},'type':{'type':Sequelize[_0xaccb('0x6')]('twilio','sinch')},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xaccb('0x3')]},'notificationTemplate':{'type':Sequelize[_0xaccb('0x7')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xaccb('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xaccb('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xaccb('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xaccb('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xaccb('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xaccb('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xaccb('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xaccb('0xa'),'set':function(_0x233bcf){if(!_0x233bcf){this[_0xaccb('0xb')](_0xaccb('0xc'),null);}this[_0xaccb('0xb')](_0xaccb('0xd'),_0x233bcf);}},'description':{'type':Sequelize[_0xaccb('0x3')]}};
\ No newline at end of file
index 73340a6..e2c6fb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd564=['options','include','findAll','rows','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','hasOwnProperty','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','includeAll','removeAnswers','addAgents','spread','length','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','findAndCountAll','priority','stack','finally','getApplications','notify','Applications','account','statuses','state','timestamp','message_id','applications','orderBy','asc','Sequelize','ValidationError','createdAt','updatedAt','difference','ListId','mobile','twilio','from','From','whatsapp:','Body','messageId','MessageSid','sinch','notifications','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','CmContact','Contacts','DESC','contact','WhatsappInteraction','interaction','created','autoclose','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','to\x20is\x20mandatory','List','out','WhatsappMessage','Messages','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','redis','./whatsappAccount.socket','register','client','http','then','info','request\x20sent','debug','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','reject','update','destroy','UserProfileResource','end','name','send','index','Pause','map','WhatsappAccount','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','pick','filter','where','merge','VIRTUAL'];(function(_0x178604,_0x688861){var _0x3cf983=function(_0x494fd4){while(--_0x494fd4){_0x178604['push'](_0x178604['shift']());}};_0x3cf983(++_0x688861);}(_0xd564,0x137));var _0x4d56=function(_0x9e4572,_0x29e793){_0x9e4572=_0x9e4572-0x0;var _0x4e28d9=_0xd564[_0x9e4572];return _0x4e28d9;};'use strict';var emlformat=require(_0x4d56('0x0'));var rimraf=require(_0x4d56('0x1'));var zipdir=require(_0x4d56('0x2'));var jsonpatch=require(_0x4d56('0x3'));var rp=require(_0x4d56('0x4'));var moment=require(_0x4d56('0x5'));var BPromise=require(_0x4d56('0x6'));var Mustache=require(_0x4d56('0x7'));var util=require('util');var path=require('path');var sox=require(_0x4d56('0x8'));var csv=require('to-csv');var ejs=require(_0x4d56('0x9'));var fs=require('fs');var fs_extra=require(_0x4d56('0xa'));var _=require(_0x4d56('0xb'));var squel=require('squel');var crypto=require(_0x4d56('0xc'));var jsforce=require(_0x4d56('0xd'));var deskjs=require(_0x4d56('0xe'));var toCsv=require(_0x4d56('0xf'));var querystring=require('querystring');var Papa=require(_0x4d56('0x10'));var Redis=require(_0x4d56('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4d56('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4d56('0x13'));var logger=require('../../config/logger')(_0x4d56('0x14'));var utils=require(_0x4d56('0x15'));var config=require(_0x4d56('0x16'));var licenseUtil=require(_0x4d56('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x4d56('0x18')](config['redis'],{'host':_0x4d56('0x19'),'port':0x18eb});var socket=require(_0x4d56('0x1a'))(new Redis(config[_0x4d56('0x1b')]));require(_0x4d56('0x1c'))[_0x4d56('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4d56('0x1e')][_0x4d56('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x317e37,_0x181883,_0x5e8992,_0x5cb01e){return new BPromise(function(_0x427d55,_0xed6b1e){var _0x4f7336=_0x5cb01e||client;return _0x4f7336['request'](_0x317e37,_0x5e8992)[_0x4d56('0x20')](function(_0x45b69a){logger[_0x4d56('0x21')]('WhatsappAccount,\x20%s,\x20%s',_0x181883,_0x4d56('0x22'));logger[_0x4d56('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x181883,_0x4d56('0x22'),JSON[_0x4d56('0x24')](_0x45b69a));if(_0x45b69a[_0x4d56('0x25')]){if(_0x45b69a[_0x4d56('0x25')][_0x4d56('0x26')]===0x1f4){logger[_0x4d56('0x25')](_0x4d56('0x27'),_0x181883,_0x45b69a['error'][_0x4d56('0x28')]);return _0xed6b1e(_0x45b69a['error'][_0x4d56('0x28')]);}logger[_0x4d56('0x25')](_0x4d56('0x27'),_0x181883,_0x45b69a['error'][_0x4d56('0x28')]);return _0x427d55(_0x45b69a['error'][_0x4d56('0x28')]);}else{logger['info'](_0x4d56('0x27'),_0x181883,_0x4d56('0x22'));_0x427d55(_0x45b69a[_0x4d56('0x29')][_0x4d56('0x28')]);}})[_0x4d56('0x2a')](function(_0x32f1b8){logger[_0x4d56('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x181883,_0x32f1b8);_0xed6b1e(_0x32f1b8);});});}function respondWithStatusCode(_0x2df69d,_0x563cd4){_0x563cd4=_0x563cd4||0xcc;return function(_0x4c6c23){if(_0x4c6c23){return _0x2df69d[_0x4d56('0x2b')](_0x563cd4);}return _0x2df69d[_0x4d56('0x2c')](_0x563cd4)['end']();};}function respondWithResult(_0x71bbb,_0x57e905){_0x57e905=_0x57e905||0xc8;return function(_0xc274f3){if(_0xc274f3){return _0x71bbb[_0x4d56('0x2c')](_0x57e905)[_0x4d56('0x2d')](_0xc274f3);}};}function respondWithFilteredResult(_0x41afcc,_0x14d6fd){return function(_0x446a79){if(_0x446a79){var _0xedc53e=typeof _0x14d6fd[_0x4d56('0x2e')]===_0x4d56('0x2f')&&typeof _0x14d6fd['limit']==='undefined';var _0x2a267b=_0x446a79['count'];var _0x5d5243=_0xedc53e?0x0:_0x14d6fd[_0x4d56('0x2e')];var _0x2beee7=_0xedc53e?_0x446a79[_0x4d56('0x30')]:_0x14d6fd[_0x4d56('0x2e')]+_0x14d6fd[_0x4d56('0x31')];var _0x2b1510;if(_0x2beee7>=_0x2a267b){_0x2beee7=_0x2a267b;_0x2b1510=0xc8;}else{_0x2b1510=0xce;}_0x41afcc[_0x4d56('0x2c')](_0x2b1510);return _0x41afcc[_0x4d56('0x32')]('Content-Range',_0x5d5243+'-'+_0x2beee7+'/'+_0x2a267b)[_0x4d56('0x2d')](_0x446a79);}return null;};}function patchUpdates(_0x48b453){return function(_0x118526){try{jsonpatch['apply'](_0x118526,_0x48b453,!![]);}catch(_0x448038){return BPromise[_0x4d56('0x33')](_0x448038);}return _0x118526['save']();};}function saveUpdates(_0x3f107d,_0x2a0744){return function(_0x3c914c){if(_0x3c914c){return _0x3c914c[_0x4d56('0x34')](_0x3f107d)['then'](function(_0x574cf6){return _0x574cf6;});}return null;};}function removeEntity(_0xaa6302,_0x360d5d){return function(_0x74ad57){if(_0x74ad57){return _0x74ad57[_0x4d56('0x35')]()['then'](function(){var _0x262dfc=_0x74ad57['get']({'plain':!![]});var _0x282c78='WhatsappAccounts';return db[_0x4d56('0x36')]['destroy']({'where':{'type':_0x282c78,'resourceId':_0x262dfc['id']}})['then'](function(){return _0x74ad57;});})[_0x4d56('0x20')](function(){_0xaa6302[_0x4d56('0x2c')](0xcc)[_0x4d56('0x37')]();});}};}function handleEntityNotFound(_0x6be02b,_0x568c5f){return function(_0x50f7e1){if(!_0x50f7e1){_0x6be02b[_0x4d56('0x2b')](0x194);}return _0x50f7e1;};}function handleError(_0x3c7cf5,_0x2785c7){_0x2785c7=_0x2785c7||0x1f4;return function(_0x5922d6){logger[_0x4d56('0x25')](_0x5922d6['stack']);if(_0x5922d6[_0x4d56('0x38')]){delete _0x5922d6['name'];}_0x3c7cf5['status'](_0x2785c7)[_0x4d56('0x39')](_0x5922d6);};}exports[_0x4d56('0x3a')]=function(_0x32b5d3,_0x2ec4c4){var _0x31ef6c={'include':[{'model':db[_0x4d56('0x3b')],'as':'mandatoryDispositionPause'}]},_0x12b2db={},_0x1b34e5={'count':0x0,'rows':[]};var _0xd86146=_[_0x4d56('0x3c')](db[_0x4d56('0x3d')][_0x4d56('0x3e')],function(_0xa8ced1){return{'name':_0xa8ced1['fieldName'],'type':_0xa8ced1[_0x4d56('0x3f')][_0x4d56('0x40')]};});_0x12b2db[_0x4d56('0x41')]=_[_0x4d56('0x3c')](_0xd86146,'name');_0x12b2db['query']=_[_0x4d56('0x42')](_0x32b5d3[_0x4d56('0x43')]);_0x12b2db[_0x4d56('0x44')]=_[_0x4d56('0x45')](_0x12b2db[_0x4d56('0x41')],_0x12b2db['query']);_0x31ef6c[_0x4d56('0x46')]=_[_0x4d56('0x45')](_0x12b2db[_0x4d56('0x41')],qs[_0x4d56('0x47')](_0x32b5d3[_0x4d56('0x43')][_0x4d56('0x47')]));_0x31ef6c[_0x4d56('0x46')]=_0x31ef6c[_0x4d56('0x46')]['length']?_0x31ef6c['attributes']:_0x12b2db[_0x4d56('0x41')];if(!_0x32b5d3[_0x4d56('0x43')]['hasOwnProperty'](_0x4d56('0x48'))){_0x31ef6c[_0x4d56('0x31')]=qs[_0x4d56('0x31')](_0x32b5d3[_0x4d56('0x43')][_0x4d56('0x31')]);_0x31ef6c[_0x4d56('0x2e')]=qs[_0x4d56('0x2e')](_0x32b5d3[_0x4d56('0x43')][_0x4d56('0x2e')]);}_0x31ef6c['order']=qs[_0x4d56('0x49')](_0x32b5d3[_0x4d56('0x43')]['sort']);_0x31ef6c['where']=qs[_0x4d56('0x44')](_[_0x4d56('0x4a')](_0x32b5d3[_0x4d56('0x43')],_0x12b2db['filters']),_0xd86146);if(_0x32b5d3[_0x4d56('0x43')][_0x4d56('0x4b')]){_0x31ef6c[_0x4d56('0x4c')]=_[_0x4d56('0x4d')](_0x31ef6c['where'],{'$or':_[_0x4d56('0x3c')](_0xd86146,function(_0x4cdec0){if(_0x4cdec0[_0x4d56('0x3f')]!==_0x4d56('0x4e')){var _0x47e3f7={};_0x47e3f7[_0x4cdec0[_0x4d56('0x38')]]={'$like':'%'+_0x32b5d3[_0x4d56('0x43')][_0x4d56('0x4b')]+'%'};return _0x47e3f7;}})});}_0x31ef6c=_[_0x4d56('0x4d')]({},_0x31ef6c,_0x32b5d3[_0x4d56('0x4f')]);var _0x3e09b8={'where':_0x31ef6c['where']};return db['WhatsappAccount'][_0x4d56('0x30')](_0x3e09b8)[_0x4d56('0x20')](function(_0x4acfcb){_0x1b34e5[_0x4d56('0x30')]=_0x4acfcb;if(_0x32b5d3['query']['includeAll']){_0x31ef6c[_0x4d56('0x50')]=[{'all':!![]}];}return db[_0x4d56('0x3d')][_0x4d56('0x51')](_0x31ef6c);})[_0x4d56('0x20')](function(_0x1cd924){_0x1b34e5[_0x4d56('0x52')]=_0x1cd924;return _0x1b34e5;})[_0x4d56('0x20')](respondWithFilteredResult(_0x2ec4c4,_0x31ef6c))['catch'](handleError(_0x2ec4c4,null));};exports[_0x4d56('0x53')]=function(_0x5ea9ed,_0x3472c8){var _0x5cfed5={'raw':![],'where':{'id':_0x5ea9ed[_0x4d56('0x54')]['id']},'include':[{'model':db[_0x4d56('0x3b')],'as':'mandatoryDispositionPause'}]},_0x5598f6={};_0x5598f6[_0x4d56('0x41')]=_[_0x4d56('0x42')](db[_0x4d56('0x3d')]['rawAttributes']);_0x5598f6[_0x4d56('0x43')]=_[_0x4d56('0x42')](_0x5ea9ed[_0x4d56('0x43')]);_0x5598f6[_0x4d56('0x44')]=_['intersection'](_0x5598f6[_0x4d56('0x41')],_0x5598f6[_0x4d56('0x43')]);_0x5cfed5['attributes']=_[_0x4d56('0x45')](_0x5598f6[_0x4d56('0x41')],qs[_0x4d56('0x47')](_0x5ea9ed[_0x4d56('0x43')][_0x4d56('0x47')]));_0x5cfed5[_0x4d56('0x46')]=_0x5cfed5[_0x4d56('0x46')]['length']?_0x5cfed5[_0x4d56('0x46')]:_0x5598f6[_0x4d56('0x41')];if(_0x5ea9ed[_0x4d56('0x43')]['includeAll']){_0x5cfed5[_0x4d56('0x50')]=[{'all':!![]}];}_0x5cfed5=_[_0x4d56('0x4d')]({},_0x5cfed5,_0x5ea9ed[_0x4d56('0x4f')]);return db[_0x4d56('0x3d')][_0x4d56('0x55')](_0x5cfed5)[_0x4d56('0x20')](handleEntityNotFound(_0x3472c8,null))[_0x4d56('0x20')](respondWithResult(_0x3472c8,null))[_0x4d56('0x2a')](handleError(_0x3472c8,null));};exports[_0x4d56('0x56')]=function(_0x337a04,_0x51ff72){return db[_0x4d56('0x3d')]['create'](_0x337a04[_0x4d56('0x57')],{})[_0x4d56('0x20')](function(_0x20ccac){var _0x37e8ef=_0x337a04[_0x4d56('0x58')][_0x4d56('0x59')]({'plain':!![]});if(!_0x37e8ef)throw new Error(_0x4d56('0x5a'));if(_0x37e8ef[_0x4d56('0x5b')]===_0x4d56('0x58')){var _0x2f4060=_0x20ccac[_0x4d56('0x59')]({'plain':!![]});var _0x284862=_0x4d56('0x5c');return db[_0x4d56('0x5d')][_0x4d56('0x55')]({'where':{'name':_0x284862,'userProfileId':_0x37e8ef[_0x4d56('0x5e')]},'raw':!![]})[_0x4d56('0x20')](function(_0x1c4ef2){if(_0x1c4ef2&&_0x1c4ef2[_0x4d56('0x5f')]===0x0){return db[_0x4d56('0x36')][_0x4d56('0x56')]({'name':_0x2f4060[_0x4d56('0x38')],'resourceId':_0x2f4060['id'],'type':_0x1c4ef2[_0x4d56('0x38')],'sectionId':_0x1c4ef2['id']},{})[_0x4d56('0x20')](function(){return _0x20ccac;});}else{return _0x20ccac;}})['catch'](function(_0xa427e8){logger[_0x4d56('0x25')](_0x4d56('0x60'),_0xa427e8);throw _0xa427e8;});}return _0x20ccac;})[_0x4d56('0x20')](respondWithResult(_0x51ff72,0xc9))['catch'](handleError(_0x51ff72,null));};exports[_0x4d56('0x34')]=function(_0x58caf5,_0x4f7245){if(_0x58caf5[_0x4d56('0x57')]['id']){delete _0x58caf5[_0x4d56('0x57')]['id'];}return db['WhatsappAccount'][_0x4d56('0x55')]({'where':{'id':_0x58caf5[_0x4d56('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0x4d56('0x61')}]})[_0x4d56('0x20')](handleEntityNotFound(_0x4f7245,null))[_0x4d56('0x20')](saveUpdates(_0x58caf5[_0x4d56('0x57')],null))[_0x4d56('0x20')](respondWithResult(_0x4f7245,null))['catch'](handleError(_0x4f7245,null));};exports['destroy']=function(_0x36752c,_0xe2d283){return db['WhatsappAccount'][_0x4d56('0x55')]({'where':{'id':_0x36752c[_0x4d56('0x54')]['id']}})['then'](handleEntityNotFound(_0xe2d283,null))[_0x4d56('0x20')](removeEntity(_0xe2d283,null))['catch'](handleError(_0xe2d283,null));};exports['describe']=function(_0x47da18,_0x363aea){return db[_0x4d56('0x3d')][_0x4d56('0x62')]()[_0x4d56('0x20')](respondWithResult(_0x363aea,null))[_0x4d56('0x2a')](handleError(_0x363aea,null));};exports[_0x4d56('0x63')]=function(_0xb5b68a,_0x5b6f33,_0x44f034){if(_0xb5b68a[_0x4d56('0x57')]['id']){delete _0xb5b68a[_0x4d56('0x57')]['id'];}return db[_0x4d56('0x3d')]['find']({'where':{'id':_0xb5b68a[_0x4d56('0x54')]['id']}})[_0x4d56('0x20')](handleEntityNotFound(_0x5b6f33,null))['then'](function(_0x46fd0f){if(_0x46fd0f){_0xb5b68a['body'][_0x4d56('0x64')]=_0x46fd0f['id'];return db[_0x4d56('0x65')][_0x4d56('0x56')](_0xb5b68a['body']);}})[_0x4d56('0x20')](respondWithResult(_0x5b6f33,null))[_0x4d56('0x2a')](handleError(_0x5b6f33,null));};exports[_0x4d56('0x66')]=function(_0x4ed2b6,_0x4d715e,_0xd5a592){var _0x1c44c5={'raw':![],'where':{}};var _0x4e1a99={};var _0x587953={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x4d56('0x67')]({'where':{'id':_0x4ed2b6['params']['id']}})[_0x4d56('0x20')](handleEntityNotFound(_0x4d715e,null))[_0x4d56('0x20')](function(_0x8c0885){if(_0x8c0885){_0x4e1a99[_0x4d56('0x41')]=_[_0x4d56('0x42')](db[_0x4d56('0x65')][_0x4d56('0x3e')]);_0x4e1a99[_0x4d56('0x43')]=_[_0x4d56('0x42')](_0x4ed2b6[_0x4d56('0x43')]);_0x4e1a99['filters']=_['intersection'](_0x4e1a99[_0x4d56('0x41')],_0x4e1a99[_0x4d56('0x43')]);_0x1c44c5[_0x4d56('0x46')]=_[_0x4d56('0x45')](_0x4e1a99[_0x4d56('0x41')],qs[_0x4d56('0x47')](_0x4ed2b6[_0x4d56('0x43')][_0x4d56('0x47')]));_0x1c44c5[_0x4d56('0x46')]=_0x1c44c5[_0x4d56('0x46')]['length']?_0x1c44c5['attributes']:_0x4e1a99['model'];if(!_0x4ed2b6[_0x4d56('0x43')][_0x4d56('0x68')](_0x4d56('0x48'))){_0x1c44c5[_0x4d56('0x31')]=qs[_0x4d56('0x31')](_0x4ed2b6[_0x4d56('0x43')][_0x4d56('0x31')]);_0x1c44c5['offset']=qs[_0x4d56('0x2e')](_0x4ed2b6[_0x4d56('0x43')]['offset']);}_0x1c44c5[_0x4d56('0x69')]=qs[_0x4d56('0x49')](_0x4ed2b6[_0x4d56('0x43')][_0x4d56('0x49')]);_0x1c44c5['where']=qs['filters'](_[_0x4d56('0x4a')](_0x4ed2b6[_0x4d56('0x43')],_0x4e1a99['filters']));_0x1c44c5[_0x4d56('0x4c')][_0x4d56('0x64')]=_0x8c0885['id'];if(_0x4ed2b6['query'][_0x4d56('0x4b')]){_0x1c44c5[_0x4d56('0x4c')]=_[_0x4d56('0x4d')](_0x1c44c5[_0x4d56('0x4c')],{'$or':_[_0x4d56('0x3c')](_0x1c44c5['attributes'],function(_0x5bc07d){var _0x3c9bd0={};_0x3c9bd0[_0x5bc07d]={'$like':'%'+_0x4ed2b6[_0x4d56('0x43')][_0x4d56('0x4b')]+'%'};return _0x3c9bd0;})});}_0x1c44c5=_[_0x4d56('0x4d')]({},_0x1c44c5,_0x4ed2b6['options']);return db[_0x4d56('0x65')][_0x4d56('0x30')]({'where':_0x1c44c5[_0x4d56('0x4c')]})[_0x4d56('0x20')](function(_0x30ff8a){_0x587953[_0x4d56('0x30')]=_0x30ff8a;if(_0x4ed2b6[_0x4d56('0x43')]['includeAll']){_0x1c44c5[_0x4d56('0x50')]=[{'all':!![]}];}return db[_0x4d56('0x65')][_0x4d56('0x51')](_0x1c44c5);})[_0x4d56('0x20')](function(_0x1370e9){_0x587953[_0x4d56('0x52')]=_0x1370e9;return _0x587953;});}})[_0x4d56('0x20')](respondWithFilteredResult(_0x4d715e,_0x1c44c5))[_0x4d56('0x2a')](handleError(_0x4d715e,null));};exports['removeDispositions']=function(_0x2a39f3,_0x51d8c9,_0x205069){return db['WhatsappAccount'][_0x4d56('0x55')]({'where':{'id':_0x2a39f3['params']['id']}})[_0x4d56('0x20')](handleEntityNotFound(_0x51d8c9,null))['then'](function(_0x4ae064){if(_0x4ae064){return _0x4ae064[_0x4d56('0x6a')](_0x2a39f3[_0x4d56('0x43')][_0x4d56('0x6b')]);}})[_0x4d56('0x20')](respondWithStatusCode(_0x51d8c9,null))['catch'](handleError(_0x51d8c9,null));};exports[_0x4d56('0x6c')]=function(_0x376d97,_0x54be22,_0x319d9b){if(_0x376d97[_0x4d56('0x57')]['id']){delete _0x376d97['body']['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x376d97['params']['id']}})[_0x4d56('0x20')](handleEntityNotFound(_0x54be22,null))[_0x4d56('0x20')](function(_0x181814){if(_0x181814){_0x376d97['body']['WhatsappAccountId']=_0x181814['id'];return db[_0x4d56('0x6d')][_0x4d56('0x56')](_0x376d97[_0x4d56('0x57')]);}})[_0x4d56('0x20')](respondWithResult(_0x54be22,null))[_0x4d56('0x2a')](handleError(_0x54be22,null));};exports[_0x4d56('0x6e')]=function(_0x2b00f8,_0x41e73f,_0x4252d2){var _0x28d5e1={'raw':![],'where':{}};var _0x508392={};var _0x242e4f={'count':0x0,'rows':[]};return db[_0x4d56('0x3d')][_0x4d56('0x67')]({'where':{'id':_0x2b00f8['params']['id']}})[_0x4d56('0x20')](handleEntityNotFound(_0x41e73f,null))[_0x4d56('0x20')](function(_0x5a3114){if(_0x5a3114){_0x508392[_0x4d56('0x41')]=_['keys'](db['CannedAnswer'][_0x4d56('0x3e')]);_0x508392['query']=_[_0x4d56('0x42')](_0x2b00f8[_0x4d56('0x43')]);_0x508392['filters']=_[_0x4d56('0x45')](_0x508392[_0x4d56('0x41')],_0x508392[_0x4d56('0x43')]);_0x28d5e1['attributes']=_[_0x4d56('0x45')](_0x508392['model'],qs[_0x4d56('0x47')](_0x2b00f8[_0x4d56('0x43')][_0x4d56('0x47')]));_0x28d5e1[_0x4d56('0x46')]=_0x28d5e1[_0x4d56('0x46')]['length']?_0x28d5e1[_0x4d56('0x46')]:_0x508392['model'];if(!_0x2b00f8[_0x4d56('0x43')][_0x4d56('0x68')]('nolimit')){_0x28d5e1['limit']=qs[_0x4d56('0x31')](_0x2b00f8[_0x4d56('0x43')][_0x4d56('0x31')]);_0x28d5e1[_0x4d56('0x2e')]=qs['offset'](_0x2b00f8[_0x4d56('0x43')][_0x4d56('0x2e')]);}_0x28d5e1['order']=qs[_0x4d56('0x49')](_0x2b00f8[_0x4d56('0x43')][_0x4d56('0x49')]);_0x28d5e1['where']=qs['filters'](_[_0x4d56('0x4a')](_0x2b00f8[_0x4d56('0x43')],_0x508392[_0x4d56('0x44')]));_0x28d5e1[_0x4d56('0x4c')][_0x4d56('0x64')]=_0x5a3114['id'];if(_0x2b00f8[_0x4d56('0x43')][_0x4d56('0x4b')]){_0x28d5e1[_0x4d56('0x4c')]=_[_0x4d56('0x4d')](_0x28d5e1[_0x4d56('0x4c')],{'$or':_[_0x4d56('0x3c')](_0x28d5e1[_0x4d56('0x46')],function(_0x21d4c9){var _0x12e618={};_0x12e618[_0x21d4c9]={'$like':'%'+_0x2b00f8['query'][_0x4d56('0x4b')]+'%'};return _0x12e618;})});}_0x28d5e1=_[_0x4d56('0x4d')]({},_0x28d5e1,_0x2b00f8['options']);return db[_0x4d56('0x6d')][_0x4d56('0x30')]({'where':_0x28d5e1[_0x4d56('0x4c')]})[_0x4d56('0x20')](function(_0x1764af){_0x242e4f[_0x4d56('0x30')]=_0x1764af;if(_0x2b00f8[_0x4d56('0x43')][_0x4d56('0x6f')]){_0x28d5e1[_0x4d56('0x50')]=[{'all':!![]}];}return db[_0x4d56('0x6d')]['findAll'](_0x28d5e1);})['then'](function(_0x3b2926){_0x242e4f[_0x4d56('0x52')]=_0x3b2926;return _0x242e4f;});}})['then'](respondWithFilteredResult(_0x41e73f,_0x28d5e1))['catch'](handleError(_0x41e73f,null));};exports['removeAnswers']=function(_0x4e572e,_0x275e3b,_0x27147a){return db[_0x4d56('0x3d')]['find']({'where':{'id':_0x4e572e[_0x4d56('0x54')]['id']}})['then'](handleEntityNotFound(_0x275e3b,null))[_0x4d56('0x20')](function(_0x2626d7){if(_0x2626d7){return _0x2626d7[_0x4d56('0x70')](_0x4e572e['query'][_0x4d56('0x6b')]);}})['then'](respondWithStatusCode(_0x275e3b,null))['catch'](handleError(_0x275e3b,null));};exports[_0x4d56('0x71')]=function(_0x3c264c,_0x521697,_0x469740){return db[_0x4d56('0x3d')][_0x4d56('0x55')]({'where':{'id':_0x3c264c[_0x4d56('0x54')]['id']}})['then'](handleEntityNotFound(_0x521697,null))[_0x4d56('0x20')](function(_0x35250e){if(_0x35250e){return _0x35250e['addAgents'](_0x3c264c[_0x4d56('0x57')][_0x4d56('0x6b')],_['omit'](_0x3c264c[_0x4d56('0x57')],[_0x4d56('0x6b'),'id'])||{})[_0x4d56('0x72')](function(_0x3a30f8){for(var _0x1d6846=0x0;_0x1d6846<_0x3c264c[_0x4d56('0x57')][_0x4d56('0x6b')][_0x4d56('0x73')];_0x1d6846+=0x1){socket[_0x4d56('0x74')](_0x4d56('0x75'),{'UserId':Number(_0x3c264c[_0x4d56('0x57')][_0x4d56('0x6b')][_0x1d6846]),'WhatsappAccountId':Number(_0x3c264c['params']['id'])});}return _0x3a30f8;});}})[_0x4d56('0x20')](respondWithResult(_0x521697,null))[_0x4d56('0x2a')](handleError(_0x521697,null));};exports[_0x4d56('0x76')]=function(_0x4bffd3,_0x59ab67,_0x4a15bd){return db[_0x4d56('0x3d')][_0x4d56('0x55')]({'where':{'id':_0x4bffd3['params']['id']}})[_0x4d56('0x20')](handleEntityNotFound(_0x59ab67,null))[_0x4d56('0x20')](function(_0x101f22){if(_0x101f22){return _0x101f22[_0x4d56('0x76')](_0x4bffd3[_0x4d56('0x43')][_0x4d56('0x6b')])[_0x4d56('0x20')](function(){if(_['isArray'](_0x4bffd3[_0x4d56('0x43')]['ids'])){for(var _0x298f92=0x0;_0x298f92<_0x4bffd3['query'][_0x4d56('0x6b')][_0x4d56('0x73')];_0x298f92+=0x1){socket[_0x4d56('0x74')](_0x4d56('0x77'),{'UserId':Number(_0x4bffd3[_0x4d56('0x43')][_0x4d56('0x6b')][_0x298f92]),'WhatsappAccountId':Number(_0x4bffd3[_0x4d56('0x54')]['id'])});}}else{socket[_0x4d56('0x74')](_0x4d56('0x77'),{'UserId':Number(_0x4bffd3[_0x4d56('0x43')]['ids']),'WhatsappAccountId':Number(_0x4bffd3[_0x4d56('0x54')]['id'])});}});}})[_0x4d56('0x20')](respondWithStatusCode(_0x59ab67,null))['catch'](handleError(_0x59ab67,null));};exports[_0x4d56('0x78')]=function(_0x1f05fb,_0x5129dc,_0x3319b7){var _0x3b7834={};var _0x433b2d={};var _0x3ea711;var _0x30b5a5;return db['WhatsappAccount'][_0x4d56('0x67')]({'where':{'id':_0x1f05fb[_0x4d56('0x54')]['id']}})['then'](handleEntityNotFound(_0x5129dc,null))[_0x4d56('0x20')](function(_0x1747a2){if(_0x1747a2){_0x3ea711=_0x1747a2;_0x433b2d['model']=_['keys'](db[_0x4d56('0x79')]['rawAttributes']);_0x433b2d[_0x4d56('0x43')]=_[_0x4d56('0x42')](_0x1f05fb[_0x4d56('0x43')]);_0x433b2d[_0x4d56('0x44')]=_[_0x4d56('0x45')](_0x433b2d[_0x4d56('0x41')],_0x433b2d[_0x4d56('0x43')]);_0x3b7834[_0x4d56('0x46')]=_[_0x4d56('0x45')](_0x433b2d[_0x4d56('0x41')],qs[_0x4d56('0x47')](_0x1f05fb[_0x4d56('0x43')]['fields']));_0x3b7834[_0x4d56('0x46')]=_0x3b7834['attributes'][_0x4d56('0x73')]?_0x3b7834['attributes']:_0x433b2d[_0x4d56('0x41')];_0x3b7834[_0x4d56('0x69')]=qs[_0x4d56('0x49')](_0x1f05fb[_0x4d56('0x43')][_0x4d56('0x49')]);_0x3b7834[_0x4d56('0x4c')]=qs[_0x4d56('0x44')](_[_0x4d56('0x4a')](_0x1f05fb['query'],_0x433b2d[_0x4d56('0x44')]));if(_0x1f05fb[_0x4d56('0x43')]['filter']){_0x3b7834[_0x4d56('0x4c')]=_[_0x4d56('0x4d')](_0x3b7834[_0x4d56('0x4c')],{'$or':_[_0x4d56('0x3c')](_0x3b7834[_0x4d56('0x46')],function(_0x3a40fa){var _0x3fd967={};_0x3fd967[_0x3a40fa]={'$like':'%'+_0x1f05fb[_0x4d56('0x43')][_0x4d56('0x4b')]+'%'};return _0x3fd967;})});}_0x3b7834=_[_0x4d56('0x4d')]({},_0x3b7834,_0x1f05fb[_0x4d56('0x4f')]);return _0x3ea711[_0x4d56('0x78')](_0x3b7834);}})[_0x4d56('0x20')](function(_0x2c98c2){if(_0x2c98c2){_0x30b5a5=_0x2c98c2[_0x4d56('0x73')];if(!_0x1f05fb[_0x4d56('0x43')][_0x4d56('0x68')](_0x4d56('0x48'))){_0x3b7834[_0x4d56('0x31')]=qs[_0x4d56('0x31')](_0x1f05fb[_0x4d56('0x43')][_0x4d56('0x31')]);_0x3b7834[_0x4d56('0x2e')]=qs[_0x4d56('0x2e')](_0x1f05fb[_0x4d56('0x43')][_0x4d56('0x2e')]);}return _0x3ea711[_0x4d56('0x78')](_0x3b7834);}})['then'](function(_0xff93d){if(_0xff93d){return _0xff93d?{'count':_0x30b5a5,'rows':_0xff93d}:null;}})[_0x4d56('0x20')](respondWithResult(_0x5129dc,null))[_0x4d56('0x2a')](handleError(_0x5129dc,null));};exports[_0x4d56('0x7a')]=function(_0x1a8d61,_0x4c3859){var _0x597df1=_0x1a8d61[_0x4d56('0x54')]['id'];var _0x46f1ee=_0x1a8d61['body'];var _0x38d0e8=0xc8;var _0x4e270c=null;return db[_0x4d56('0x7b')]['transaction']({'isolationLevel':db[_0x4d56('0x7b')][_0x4d56('0x7c')][_0x4d56('0x7d')][_0x4d56('0x7e')]},function(_0x185c8b){return db['WhatsappAccount'][_0x4d56('0x67')]({'where':{'id':_0x597df1},'transaction':_0x185c8b})[_0x4d56('0x20')](function(_0x1a0ec0){if(_0x1a0ec0){return db[_0x4d56('0x7f')][_0x4d56('0x35')]({'where':{'WhatsappAccountId':_0x597df1},'transaction':_0x185c8b})['then'](function(){var _0x29f7c2=_[_0x4d56('0x3c')](_0x46f1ee,function(_0xdccffd){_0xdccffd[_0x4d56('0x64')]=_0x597df1;return _0xdccffd;});return db[_0x4d56('0x7f')]['bulkCreate'](_0x29f7c2,{'transaction':_0x185c8b});});}else{_0x38d0e8=0x194;_0x4e270c=[];}});})[_0x4d56('0x20')](function(){if(_0x38d0e8!==0x194){return db['WhatsappApplication'][_0x4d56('0x80')]({'where':{'WhatsappAccountId':_0x597df1},'order':_0x4d56('0x81')})[_0x4d56('0x20')](function(_0x48b57f){_0x4e270c=_0x48b57f;});}})[_0x4d56('0x2a')](function(_0x554305){_0x38d0e8=0x1f4;logger[_0x4d56('0x25')](_0x554305[_0x4d56('0x82')]);if(_0x554305[_0x4d56('0x38')]){delete _0x554305[_0x4d56('0x38')];}_0x4e270c=_0x554305;})[_0x4d56('0x83')](function(){if(_0x4e270c===null){_0x4c3859['sendStatus'](_0x38d0e8);}else{if(_0x38d0e8===0x1f4){_0x4c3859[_0x4d56('0x2c')](_0x38d0e8)[_0x4d56('0x39')](_0x4e270c);}else{_0x4c3859[_0x4d56('0x2c')](_0x38d0e8)[_0x4d56('0x2d')](_0x4e270c);}}});};exports[_0x4d56('0x84')]=function(_0x3584a3,_0x6bec51,_0x5d8c1a){var _0x37d734={};var _0x579b44={};var _0x366267;var _0x57d239;return db[_0x4d56('0x3d')][_0x4d56('0x67')]({'where':{'id':_0x3584a3[_0x4d56('0x54')]['id']}})[_0x4d56('0x20')](handleEntityNotFound(_0x6bec51,null))[_0x4d56('0x20')](function(_0xe04c1c){if(_0xe04c1c){_0x366267=_0xe04c1c;_0x579b44[_0x4d56('0x41')]=_['keys'](db['WhatsappApplication'][_0x4d56('0x3e')]);_0x579b44[_0x4d56('0x43')]=_['keys'](_0x3584a3[_0x4d56('0x43')]);_0x579b44['filters']=_[_0x4d56('0x45')](_0x579b44['model'],_0x579b44['query']);_0x37d734['attributes']=_[_0x4d56('0x45')](_0x579b44['model'],qs[_0x4d56('0x47')](_0x3584a3[_0x4d56('0x43')][_0x4d56('0x47')]));_0x37d734[_0x4d56('0x46')]=_0x37d734[_0x4d56('0x46')][_0x4d56('0x73')]?_0x37d734['attributes']:_0x579b44[_0x4d56('0x41')];_0x37d734[_0x4d56('0x69')]=qs[_0x4d56('0x49')](_0x3584a3['query']['sort']);_0x37d734[_0x4d56('0x4c')]=qs[_0x4d56('0x44')](_[_0x4d56('0x4a')](_0x3584a3[_0x4d56('0x43')],_0x579b44[_0x4d56('0x44')]));if(_0x3584a3[_0x4d56('0x43')][_0x4d56('0x4b')]){_0x37d734['where']=_[_0x4d56('0x4d')](_0x37d734[_0x4d56('0x4c')],{'$or':_['map'](_0x37d734['attributes'],function(_0x122fda){var _0x4fc2cf={};_0x4fc2cf[_0x122fda]={'$like':'%'+_0x3584a3['query'][_0x4d56('0x4b')]+'%'};return _0x4fc2cf;})});}_0x37d734=_[_0x4d56('0x4d')]({},_0x37d734,_0x3584a3['options']);return _0x366267[_0x4d56('0x84')](_0x37d734);}})[_0x4d56('0x20')](function(_0x6f5e17){if(_0x6f5e17){_0x57d239=_0x6f5e17[_0x4d56('0x73')];if(!_0x3584a3['query'][_0x4d56('0x68')](_0x4d56('0x48'))){_0x37d734['limit']=qs[_0x4d56('0x31')](_0x3584a3[_0x4d56('0x43')][_0x4d56('0x31')]);_0x37d734[_0x4d56('0x2e')]=qs['offset'](_0x3584a3[_0x4d56('0x43')][_0x4d56('0x2e')]);}return _0x366267['getApplications'](_0x37d734);}})['then'](function(_0x42c106){if(_0x42c106){return _0x42c106?{'count':_0x57d239,'rows':_0x42c106}:null;}})[_0x4d56('0x20')](respondWithResult(_0x6bec51,null))[_0x4d56('0x2a')](handleError(_0x6bec51,null));};exports[_0x4d56('0x85')]=function(_0x17fb1e,_0x57ddcf,_0x5b16e0){var _0x3a01cc={'channel':'whatsapp'};var _0x2b9a13=[];var _0x1fe7d1=[];var _0x99779e={};return db[_0x4d56('0x3d')][_0x4d56('0x55')]({'where':{'id':_0x17fb1e[_0x4d56('0x54')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x4d56('0x86')}]})['then'](handleEntityNotFound(_0x57ddcf,null))['then'](function(_0x5cafe5){_0x3a01cc['account']=_0x5cafe5;if(_0x3a01cc[_0x4d56('0x87')]&&_0x3a01cc[_0x4d56('0x87')][_0x4d56('0x3f')]==='sinch'&&_0x17fb1e[_0x4d56('0x57')][_0x4d56('0x88')]){if(_0x17fb1e[_0x4d56('0x57')][_0x4d56('0x88')][_0x4d56('0x73')]===0x0)return;if(_0x17fb1e[_0x4d56('0x57')]['statuses'][0x0][_0x4d56('0x89')]!=='read')return;return db['WhatsappMessage'][_0x4d56('0x34')]({'read':!![],'readAt':_0x17fb1e[_0x4d56('0x57')][_0x4d56('0x88')][0x0][_0x4d56('0x8a')]},{'where':{'messageId':_0x17fb1e[_0x4d56('0x57')]['statuses'][0x0][_0x4d56('0x8b')]},'individualHooks':!![]})[_0x4d56('0x20')](function(_0x130723){return _0x57ddcf[_0x4d56('0x2c')](0xc8)[_0x4d56('0x2d')](_0x130723);});}_0x3a01cc[_0x4d56('0x8c')]=_[_0x4d56('0x8d')](_0x5cafe5[_0x4d56('0x86')],[_0x4d56('0x81')],[_0x4d56('0x8e')]);if(_0x3a01cc[_0x4d56('0x87')][_0x4d56('0x86')]){delete _0x3a01cc[_0x4d56('0x87')][_0x4d56('0x86')];}return db['CmContact'][_0x4d56('0x62')]()[_0x4d56('0x20')](function(_0x302178){if(!_0x302178){throw new db[(_0x4d56('0x8f'))][(_0x4d56('0x90'))]('no\x20available\x20attributes');}_0x2b9a13=_['difference'](_['keys'](_0x302178),[_0x4d56('0x91'),_0x4d56('0x92')]);_0x1fe7d1=_[_0x4d56('0x93')](_[_0x4d56('0x42')](_0x302178),[_0x4d56('0x91'),_0x4d56('0x92'),'CompanyId',_0x4d56('0x94')]);_0x3a01cc[_0x4d56('0x57')]={'mapKey':_0x4d56('0x95')};if(_0x3a01cc[_0x4d56('0x87')]&&_0x3a01cc[_0x4d56('0x87')][_0x4d56('0x3f')]===_0x4d56('0x96')){_0x3a01cc[_0x4d56('0x57')][_0x4d56('0x97')]=_0x17fb1e['body'][_0x4d56('0x98')]['replace'](_0x4d56('0x99'),'');_0x3a01cc[_0x4d56('0x57')][_0x4d56('0x57')]=_0x17fb1e[_0x4d56('0x57')][_0x4d56('0x9a')];_0x3a01cc[_0x4d56('0x57')][_0x4d56('0x9b')]=_0x17fb1e['body'][_0x4d56('0x9c')];}if(_0x3a01cc['account']&&_0x3a01cc[_0x4d56('0x87')][_0x4d56('0x3f')]===_0x4d56('0x9d')){_0x3a01cc[_0x4d56('0x57')][_0x4d56('0x97')]=_0x17fb1e[_0x4d56('0x57')][_0x4d56('0x9e')][0x0][_0x4d56('0x97')];_0x3a01cc[_0x4d56('0x57')][_0x4d56('0x57')]=_0x17fb1e[_0x4d56('0x57')]['notifications'][0x0]['message'][_0x4d56('0x57')];_0x3a01cc[_0x4d56('0x57')][_0x4d56('0x9b')]=_0x17fb1e[_0x4d56('0x57')][_0x4d56('0x9e')][0x0]['message_id'];}if(_0x3a01cc[_0x4d56('0x57')]['id']){delete _0x3a01cc[_0x4d56('0x57')]['id'];}if(_['isNil'](_0x3a01cc[_0x4d56('0x57')][_0x4d56('0x97')])){throw new db[(_0x4d56('0x8f'))]['ValidationError'](_0x4d56('0x9f'));}if(_[_0x4d56('0xa0')](_0x3a01cc['body'][_0x4d56('0x57')])||_0x3a01cc[_0x4d56('0x57')][_0x4d56('0x57')]===''){throw new db[(_0x4d56('0x8f'))][(_0x4d56('0x90'))](_0x4d56('0xa1'));}if(_[_0x4d56('0xa0')](_0x3a01cc[_0x4d56('0x57')][_0x4d56('0xa2')])){throw new db[(_0x4d56('0x8f'))][(_0x4d56('0x90'))](_0x4d56('0xa3')+_0x1fe7d1);}if(!_[_0x4d56('0xa4')](_0x1fe7d1,_0x3a01cc[_0x4d56('0x57')]['mapKey'])){throw new db[(_0x4d56('0x8f'))][(_0x4d56('0x90'))](_0x4d56('0xa5')+_0x1fe7d1);}_0x99779e[_0x3a01cc[_0x4d56('0x57')][_0x4d56('0xa2')]]=_0x3a01cc['body']['from'];return db['CmList']['find']({'where':{'id':_0x3a01cc[_0x4d56('0x87')][_0x4d56('0x94')]},'include':[{'model':db[_0x4d56('0xa6')],'as':_0x4d56('0xa7'),'where':_0x99779e,'limit':0x1,'order':[[_0x4d56('0x92'),_0x4d56('0xa8')]]}]});})[_0x4d56('0x20')](handleEntityNotFound(_0x57ddcf,null))[_0x4d56('0x20')](function(_0x3704a1){if(_0x3704a1){_0x3a01cc['list']=_['omit'](_0x3704a1,['Contacts']);if(_0x3704a1['Contacts'][_0x4d56('0x73')]){return _0x3704a1['Contacts'][0x0];}var _0x725b55=_[_0x4d56('0x18')](_0x3a01cc['body'],{'firstName':_0x3a01cc['body'][_0x4d56('0x97')],'ListId':_0x3704a1['id']});_0x725b55[_0x3a01cc[_0x4d56('0x57')][_0x4d56('0xa2')]]=_0x3a01cc[_0x4d56('0x57')]['from'];return db['CmContact'][_0x4d56('0x56')](_0x725b55,{'fields':_0x2b9a13,'raw':!![]});}})[_0x4d56('0x20')](handleEntityNotFound(_0x57ddcf,null))[_0x4d56('0x20')](function(_0x510751){if(_0x510751){_0x3a01cc[_0x4d56('0xa9')]=_0x510751;var _0x401729={'ContactId':_0x510751['id'],'phone':_0x3a01cc[_0x4d56('0x57')]['from'],'WhatsappAccountId':_0x17fb1e[_0x4d56('0x54')]['id']};var _0x3beb76={'ContactId':_0x510751['id'],'WhatsappAccountId':_0x17fb1e['params']['id'],'closed':![]};return db[_0x4d56('0xaa')][_0x4d56('0x55')]({'where':_0x3beb76})[_0x4d56('0x20')](function(_0x2b43fd){if(_0x2b43fd){return[_0x2b43fd,![]];}return db[_0x4d56('0xaa')][_0x4d56('0x56')](_0x401729)['then'](function(_0x27d5a0){return[_0x27d5a0,!![]];});});}})[_0x4d56('0x72')](function(_0x21b627,_0x873748){_0x3a01cc['interaction']=_0x21b627[_0x4d56('0x59')]({'plain':!![]});_0x3a01cc[_0x4d56('0xab')][_0x4d56('0xac')]=![];if(_0x873748){if(_0x3a01cc['account'][_0x4d56('0xad')]){_0x3a01cc[_0x4d56('0x8c')]['push']({'id':0x0,'priority':_0x3a01cc[_0x4d56('0x8c')][_0x4d56('0x73')]+0x1,'app':_0x4d56('0xae'),'appdata':_0x4d56('0xaf'),'interval':_0x4d56('0xb0')});}_0x3a01cc[_0x4d56('0xab')][_0x4d56('0xac')]=!![];}return db['WhatsappMessage'][_0x4d56('0x56')]({'phone':_0x3a01cc['body'][_0x4d56('0x97')],'messageId':_0x3a01cc[_0x4d56('0x57')][_0x4d56('0x9b')],'body':_0x3a01cc[_0x4d56('0x57')][_0x4d56('0x57')],'WhatsappAccountId':_0x17fb1e[_0x4d56('0x54')]['id'],'WhatsappInteractionId':_0x21b627['id'],'direction':'in','ContactId':_0x21b627['ContactId'],'AttachmentId':_0x3a01cc[_0x4d56('0x57')][_0x4d56('0xb1')]});})[_0x4d56('0x20')](function(_0x376fec){_0x3a01cc[_0x4d56('0x28')]=_0x376fec;if(_0x3a01cc['interaction'][_0x4d56('0xb2')]){return db[_0x4d56('0x79')][_0x4d56('0x55')]({'attributes':['id',_0x4d56('0x38')],'where':{'id':_0x3a01cc[_0x4d56('0xab')][_0x4d56('0xb2')]}})[_0x4d56('0x20')](function(_0x50086){if(_0x50086){_0x3a01cc[_0x4d56('0x8c')][_0x4d56('0xb3')]({'id':0x0,'priority':0x0,'app':_0x4d56('0xb4'),'appdata':_0x50086[_0x4d56('0x38')]+','+(_0x3a01cc[_0x4d56('0x87')][_0x4d56('0xb5')]||0xa),'interval':_0x4d56('0xb0')});}return respondWithRpcPromise(_0x4d56('0xb6'),'startRouting',_0x3a01cc);});}return respondWithRpcPromise(_0x4d56('0xb6'),_0x4d56('0xb7'),_0x3a01cc);})['then'](function(_0x4ec127){if(_0x4ec127){var _0x1c464e=0xc8;var _0x444bc1=_0x4d56('0xb8');logger['info'](_0x4d56('0xb9'),_0x444bc1,_0x1c464e,'entity\x20found');logger[_0x4d56('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x444bc1,_0x1c464e,_0x4d56('0xba'),JSON['stringify'](_0x4ec127));if(_0x3a01cc[_0x4d56('0x87')][_0x4d56('0x3f')]===_0x4d56('0x96')){return _0x57ddcf[_0x4d56('0x2c')](_0x1c464e)[_0x4d56('0x32')](_0x4d56('0xbb'),'text/xml')[_0x4d56('0x39')]('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x57ddcf[_0x4d56('0x2c')](_0x1c464e)[_0x4d56('0x2d')](_0x4ec127);}}});})[_0x4d56('0x2a')](handleError(_0x57ddcf,null));};exports[_0x4d56('0x39')]=function(_0x38e506,_0x459153,_0x31c3b1){var _0xcc5d21,_0x1955f8,_0x5f5504;if(_[_0x4d56('0xa0')](_0x38e506[_0x4d56('0x57')]['body'])||_0x38e506['body'][_0x4d56('0x57')]===''){throw new db['Sequelize']['ValidationError'](_0x4d56('0xa1'));}if(_[_0x4d56('0xa0')](_0x38e506[_0x4d56('0x57')]['to'])){throw new db[(_0x4d56('0x8f'))]['ValidationError'](_0x4d56('0xbc'));}_0xcc5d21=_0x38e506[_0x4d56('0x57')]['to'];return db[_0x4d56('0x3d')]['find']({'where':{'id':_0x38e506[_0x4d56('0x54')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x4d56('0xa6')],'as':_0x4d56('0xa7'),'where':{'mobile':_0xcc5d21},'limit':0x1,'order':[['updatedAt',_0x4d56('0xa8')]]}]}]})['then'](handleEntityNotFound(_0x459153,null))['then'](function(_0x5c72da){if(_0x5c72da&&_0x5c72da['List']){_0x1955f8=_0x5c72da[_0x4d56('0x59')]({'plain':!![]});if(_0x1955f8[_0x4d56('0xbd')]&&_0x1955f8[_0x4d56('0xbd')]['Contacts'][_0x4d56('0x73')]){return _0x1955f8['List']['Contacts'][0x0];}return db[_0x4d56('0xa6')][_0x4d56('0x56')](_[_0x4d56('0x18')](_0x38e506[_0x4d56('0x57')],{'firstName':_0xcc5d21,'mobile':_0xcc5d21,'phone':_0xcc5d21,'ListId':_0x1955f8[_0x4d56('0x94')]}));}})['then'](handleEntityNotFound(_0x459153,null))[_0x4d56('0x20')](function(_0x1c91cb){if(_0x1c91cb){_0x5f5504=_0x1c91cb;return db[_0x4d56('0xaa')]['find']({'where':{'ContactId':_0x5f5504['id'],'closed':![],'WhatsappAccountId':_0x1955f8['id']}})[_0x4d56('0x20')](function(_0x4e552d){if(_0x4e552d){return[_0x4e552d,![]];}return db[_0x4d56('0xaa')][_0x4d56('0x56')]({'UserId':_0x38e506['user']['id'],'ContactId':_0x5f5504['id'],'WhatsappAccountId':_0x1955f8['id'],'phone':_0xcc5d21,'firstMsgDirection':_0x4d56('0xbe'),'Messages':[_[_0x4d56('0x4d')](_0x38e506[_0x4d56('0x57')],{'read':![],'body':_0x38e506[_0x4d56('0x57')]['body'],'phone':_0xcc5d21,'WhatsappAccountId':_0x1955f8['id'],'UserId':_0x38e506[_0x4d56('0x58')]['id'],'ContactId':_0x5f5504['id']})]},{'include':[{'model':db[_0x4d56('0xbf')],'as':_0x4d56('0xc0')}]})[_0x4d56('0x20')](function(_0x4f1252){return[_0x4f1252,!![]];});});}})[_0x4d56('0x72')](function(_0x436734,_0x2a32fb){if(_0x2a32fb){return _0x436734;}return db[_0x4d56('0xbf')][_0x4d56('0x56')](_['merge'](_0x38e506[_0x4d56('0x57')],{'read':![],'body':_0x38e506[_0x4d56('0x57')][_0x4d56('0x57')],'phone':_0xcc5d21,'WhatsappAccountId':_0x1955f8['id'],'WhatsappInteractionId':_0x436734['id'],'UserId':_0x38e506[_0x4d56('0x58')]['id'],'ContactId':_0x5f5504['id']}))['then'](function(_0x51b908){_0x436734[_0x4d56('0xc1')][_0x4d56('0xc0')]=[];_0x436734['dataValues']['Messages'][_0x4d56('0xc2')](_0x51b908['dataValues']);return _0x436734;});})['then'](respondWithResult(_0x459153,null))['catch'](handleError(_0x459153,null));};
\ No newline at end of file
+var _0xc069=['User','pick','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','notify','whatsapp','Applications','account','statuses','state','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','CmContact','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','sinch','notifications','isNil','ValidationError','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','Contacts','DESC','list','defaults','contact','WhatsappInteraction','interaction','autoclose','close','*,*,*,*','ContactId','AttachmentId','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','CmList','List','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','destroy','get','WhatsappAccounts','UserProfileResource','name','send','index','Pause','map','WhatsappAccount','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','mandatoryDispositionPause','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','getDispositions','findOne','Disposition','WhatsappAccountId','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc069,0x116));var _0x9c06=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc069[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x9c06('0x0'));var rimraf=require(_0x9c06('0x1'));var zipdir=require(_0x9c06('0x2'));var jsonpatch=require(_0x9c06('0x3'));var rp=require(_0x9c06('0x4'));var moment=require(_0x9c06('0x5'));var BPromise=require(_0x9c06('0x6'));var Mustache=require(_0x9c06('0x7'));var util=require('util');var path=require(_0x9c06('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9c06('0x9'));var fs=require('fs');var fs_extra=require(_0x9c06('0xa'));var _=require(_0x9c06('0xb'));var squel=require(_0x9c06('0xc'));var crypto=require(_0x9c06('0xd'));var jsforce=require(_0x9c06('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9c06('0xf'));var querystring=require('querystring');var Papa=require(_0x9c06('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9c06('0x11'));var as=require(_0x9c06('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9c06('0x13'))(_0x9c06('0x14'));var utils=require('../../config/utils');var config=require(_0x9c06('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9c06('0x16'))['db'];config[_0x9c06('0x17')]=_['defaults'](config[_0x9c06('0x17')],{'host':_0x9c06('0x18'),'port':0x18eb});var socket=require(_0x9c06('0x19'))(new Redis(config[_0x9c06('0x17')]));require(_0x9c06('0x1a'))['register'](socket);var jayson=require(_0x9c06('0x1b'));var client=jayson[_0x9c06('0x1c')][_0x9c06('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x860701,_0x24ec24,_0x13e839,_0x4d96ef){return new BPromise(function(_0x243264,_0x389edf){var _0x279a6f=_0x4d96ef||client;return _0x279a6f[_0x9c06('0x1e')](_0x860701,_0x13e839)[_0x9c06('0x1f')](function(_0x41711a){logger[_0x9c06('0x20')](_0x9c06('0x21'),_0x24ec24,_0x9c06('0x22'));logger[_0x9c06('0x23')](_0x9c06('0x24'),_0x24ec24,_0x9c06('0x22'),JSON[_0x9c06('0x25')](_0x41711a));if(_0x41711a['error']){if(_0x41711a[_0x9c06('0x26')]['code']===0x1f4){logger[_0x9c06('0x26')](_0x9c06('0x21'),_0x24ec24,_0x41711a[_0x9c06('0x26')][_0x9c06('0x27')]);return _0x389edf(_0x41711a['error']['message']);}logger[_0x9c06('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x24ec24,_0x41711a[_0x9c06('0x26')][_0x9c06('0x27')]);return _0x243264(_0x41711a[_0x9c06('0x26')]['message']);}else{logger[_0x9c06('0x20')](_0x9c06('0x21'),_0x24ec24,_0x9c06('0x22'));_0x243264(_0x41711a[_0x9c06('0x28')]['message']);}})[_0x9c06('0x29')](function(_0x5c450c){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x24ec24,_0x5c450c);_0x389edf(_0x5c450c);});});}function respondWithStatusCode(_0x51057a,_0x2d02b3){_0x2d02b3=_0x2d02b3||0xcc;return function(_0x482289){if(_0x482289){return _0x51057a[_0x9c06('0x2a')](_0x2d02b3);}return _0x51057a[_0x9c06('0x2b')](_0x2d02b3)[_0x9c06('0x2c')]();};}function respondWithResult(_0x17b3d6,_0x5368e1){_0x5368e1=_0x5368e1||0xc8;return function(_0x31019b){if(_0x31019b){return _0x17b3d6[_0x9c06('0x2b')](_0x5368e1)[_0x9c06('0x2d')](_0x31019b);}};}function respondWithFilteredResult(_0x7714b0,_0x45efa8){return function(_0x327eda){if(_0x327eda){var _0x5f33e8=typeof _0x45efa8[_0x9c06('0x2e')]===_0x9c06('0x2f')&&typeof _0x45efa8['limit']===_0x9c06('0x2f');var _0x285626=_0x327eda[_0x9c06('0x30')];var _0x59297a=_0x5f33e8?0x0:_0x45efa8[_0x9c06('0x2e')];var _0x2b43e0=_0x5f33e8?_0x327eda[_0x9c06('0x30')]:_0x45efa8['offset']+_0x45efa8['limit'];var _0x197285;if(_0x2b43e0>=_0x285626){_0x2b43e0=_0x285626;_0x197285=0xc8;}else{_0x197285=0xce;}_0x7714b0[_0x9c06('0x2b')](_0x197285);return _0x7714b0[_0x9c06('0x31')](_0x9c06('0x32'),_0x59297a+'-'+_0x2b43e0+'/'+_0x285626)[_0x9c06('0x2d')](_0x327eda);}return null;};}function patchUpdates(_0x4b4aee){return function(_0x24a580){try{jsonpatch[_0x9c06('0x33')](_0x24a580,_0x4b4aee,!![]);}catch(_0x337bcf){return BPromise[_0x9c06('0x34')](_0x337bcf);}return _0x24a580['save']();};}function saveUpdates(_0x280ff0,_0x292751){return function(_0xce8d5e){if(_0xce8d5e){return _0xce8d5e[_0x9c06('0x35')](_0x280ff0)[_0x9c06('0x1f')](function(_0x390d4d){return _0x390d4d;});}return null;};}function removeEntity(_0x296769,_0x11d1d4){return function(_0x36f87f){if(_0x36f87f){return _0x36f87f[_0x9c06('0x36')]()[_0x9c06('0x1f')](function(){var _0x4bdaca=_0x36f87f[_0x9c06('0x37')]({'plain':!![]});var _0x52b250=_0x9c06('0x38');return db[_0x9c06('0x39')]['destroy']({'where':{'type':_0x52b250,'resourceId':_0x4bdaca['id']}})['then'](function(){return _0x36f87f;});})['then'](function(){_0x296769[_0x9c06('0x2b')](0xcc)[_0x9c06('0x2c')]();});}};}function handleEntityNotFound(_0x18a587,_0x2d7461){return function(_0x4734a9){if(!_0x4734a9){_0x18a587[_0x9c06('0x2a')](0x194);}return _0x4734a9;};}function handleError(_0x5a7a95,_0x20b59b){_0x20b59b=_0x20b59b||0x1f4;return function(_0xe90510){logger['error'](_0xe90510['stack']);if(_0xe90510[_0x9c06('0x3a')]){delete _0xe90510[_0x9c06('0x3a')];}_0x5a7a95[_0x9c06('0x2b')](_0x20b59b)[_0x9c06('0x3b')](_0xe90510);};}exports[_0x9c06('0x3c')]=function(_0x20a439,_0x2ba4a3){var _0xb7f1b8={'include':[{'model':db[_0x9c06('0x3d')],'as':'mandatoryDispositionPause'}]},_0x40fdd5={},_0x7a67a2={'count':0x0,'rows':[]};var _0x3a2152=_[_0x9c06('0x3e')](db[_0x9c06('0x3f')][_0x9c06('0x40')],function(_0x44a73e){return{'name':_0x44a73e['fieldName'],'type':_0x44a73e[_0x9c06('0x41')][_0x9c06('0x42')]};});_0x40fdd5[_0x9c06('0x43')]=_[_0x9c06('0x3e')](_0x3a2152,_0x9c06('0x3a'));_0x40fdd5[_0x9c06('0x44')]=_[_0x9c06('0x45')](_0x20a439['query']);_0x40fdd5['filters']=_[_0x9c06('0x46')](_0x40fdd5[_0x9c06('0x43')],_0x40fdd5[_0x9c06('0x44')]);_0xb7f1b8[_0x9c06('0x47')]=_[_0x9c06('0x46')](_0x40fdd5[_0x9c06('0x43')],qs[_0x9c06('0x48')](_0x20a439['query']['fields']));_0xb7f1b8[_0x9c06('0x47')]=_0xb7f1b8['attributes'][_0x9c06('0x49')]?_0xb7f1b8['attributes']:_0x40fdd5[_0x9c06('0x43')];if(!_0x20a439['query'][_0x9c06('0x4a')](_0x9c06('0x4b'))){_0xb7f1b8[_0x9c06('0x4c')]=qs[_0x9c06('0x4c')](_0x20a439[_0x9c06('0x44')][_0x9c06('0x4c')]);_0xb7f1b8[_0x9c06('0x2e')]=qs['offset'](_0x20a439[_0x9c06('0x44')]['offset']);}_0xb7f1b8[_0x9c06('0x4d')]=qs[_0x9c06('0x4e')](_0x20a439[_0x9c06('0x44')]['sort']);_0xb7f1b8[_0x9c06('0x4f')]=qs[_0x9c06('0x50')](_['pick'](_0x20a439[_0x9c06('0x44')],_0x40fdd5[_0x9c06('0x50')]),_0x3a2152);if(_0x20a439[_0x9c06('0x44')][_0x9c06('0x51')]){_0xb7f1b8['where']=_[_0x9c06('0x52')](_0xb7f1b8[_0x9c06('0x4f')],{'$or':_[_0x9c06('0x3e')](_0x3a2152,function(_0x322f2b){if(_0x322f2b['type']!==_0x9c06('0x53')){var _0x2e284c={};_0x2e284c[_0x322f2b[_0x9c06('0x3a')]]={'$like':'%'+_0x20a439[_0x9c06('0x44')][_0x9c06('0x51')]+'%'};return _0x2e284c;}})});}_0xb7f1b8=_[_0x9c06('0x52')]({},_0xb7f1b8,_0x20a439['options']);var _0x4f74ac={'where':_0xb7f1b8[_0x9c06('0x4f')]};return db[_0x9c06('0x3f')][_0x9c06('0x30')](_0x4f74ac)[_0x9c06('0x1f')](function(_0x31f302){_0x7a67a2['count']=_0x31f302;if(_0x20a439['query'][_0x9c06('0x54')]){_0xb7f1b8[_0x9c06('0x55')]=[{'all':!![]}];}return db[_0x9c06('0x3f')][_0x9c06('0x56')](_0xb7f1b8);})['then'](function(_0x458df9){_0x7a67a2['rows']=_0x458df9;return _0x7a67a2;})[_0x9c06('0x1f')](respondWithFilteredResult(_0x2ba4a3,_0xb7f1b8))[_0x9c06('0x29')](handleError(_0x2ba4a3,null));};exports[_0x9c06('0x57')]=function(_0x291573,_0x1f4898){var _0x50cf84={'raw':![],'where':{'id':_0x291573[_0x9c06('0x58')]['id']},'include':[{'model':db[_0x9c06('0x3d')],'as':_0x9c06('0x59')}]},_0x5f59ed={};_0x5f59ed[_0x9c06('0x43')]=_[_0x9c06('0x45')](db[_0x9c06('0x3f')]['rawAttributes']);_0x5f59ed[_0x9c06('0x44')]=_[_0x9c06('0x45')](_0x291573[_0x9c06('0x44')]);_0x5f59ed[_0x9c06('0x50')]=_[_0x9c06('0x46')](_0x5f59ed[_0x9c06('0x43')],_0x5f59ed['query']);_0x50cf84['attributes']=_['intersection'](_0x5f59ed[_0x9c06('0x43')],qs[_0x9c06('0x48')](_0x291573[_0x9c06('0x44')]['fields']));_0x50cf84[_0x9c06('0x47')]=_0x50cf84[_0x9c06('0x47')][_0x9c06('0x49')]?_0x50cf84['attributes']:_0x5f59ed[_0x9c06('0x43')];if(_0x291573[_0x9c06('0x44')][_0x9c06('0x54')]){_0x50cf84[_0x9c06('0x55')]=[{'all':!![]}];}_0x50cf84=_['merge']({},_0x50cf84,_0x291573[_0x9c06('0x5a')]);return db['WhatsappAccount']['find'](_0x50cf84)[_0x9c06('0x1f')](handleEntityNotFound(_0x1f4898,null))[_0x9c06('0x1f')](respondWithResult(_0x1f4898,null))['catch'](handleError(_0x1f4898,null));};exports['create']=function(_0x548216,_0x4432d1){return db[_0x9c06('0x3f')][_0x9c06('0x5b')](_0x548216[_0x9c06('0x5c')],{})['then'](function(_0x411367){var _0x3c22bf=_0x548216[_0x9c06('0x5d')][_0x9c06('0x37')]({'plain':!![]});if(!_0x3c22bf)throw new Error(_0x9c06('0x5e'));if(_0x3c22bf[_0x9c06('0x5f')]===_0x9c06('0x5d')){var _0x2f6edd=_0x411367[_0x9c06('0x37')]({'plain':!![]});var _0x3a503a=_0x9c06('0x38');return db[_0x9c06('0x60')][_0x9c06('0x61')]({'where':{'name':_0x3a503a,'userProfileId':_0x3c22bf[_0x9c06('0x62')]},'raw':!![]})[_0x9c06('0x1f')](function(_0x441ca4){if(_0x441ca4&&_0x441ca4[_0x9c06('0x63')]===0x0){return db[_0x9c06('0x39')][_0x9c06('0x5b')]({'name':_0x2f6edd['name'],'resourceId':_0x2f6edd['id'],'type':_0x441ca4[_0x9c06('0x3a')],'sectionId':_0x441ca4['id']},{})['then'](function(){return _0x411367;});}else{return _0x411367;}})[_0x9c06('0x29')](function(_0x5d76eb){logger[_0x9c06('0x26')](_0x9c06('0x64'),_0x5d76eb);throw _0x5d76eb;});}return _0x411367;})[_0x9c06('0x1f')](respondWithResult(_0x4432d1,0xc9))[_0x9c06('0x29')](handleError(_0x4432d1,null));};exports['update']=function(_0x51c427,_0x5b2503){if(_0x51c427['body']['id']){delete _0x51c427[_0x9c06('0x5c')]['id'];}return db['WhatsappAccount'][_0x9c06('0x61')]({'where':{'id':_0x51c427[_0x9c06('0x58')]['id']},'include':[{'model':db[_0x9c06('0x3d')],'as':_0x9c06('0x59')}]})['then'](handleEntityNotFound(_0x5b2503,null))[_0x9c06('0x1f')](saveUpdates(_0x51c427[_0x9c06('0x5c')],null))[_0x9c06('0x1f')](respondWithResult(_0x5b2503,null))[_0x9c06('0x29')](handleError(_0x5b2503,null));};exports[_0x9c06('0x36')]=function(_0x3269a9,_0x507c94){return db['WhatsappAccount'][_0x9c06('0x61')]({'where':{'id':_0x3269a9[_0x9c06('0x58')]['id']}})[_0x9c06('0x1f')](handleEntityNotFound(_0x507c94,null))[_0x9c06('0x1f')](removeEntity(_0x507c94,null))['catch'](handleError(_0x507c94,null));};exports[_0x9c06('0x65')]=function(_0x46388c,_0x404314){return db[_0x9c06('0x3f')][_0x9c06('0x65')]()[_0x9c06('0x1f')](respondWithResult(_0x404314,null))[_0x9c06('0x29')](handleError(_0x404314,null));};exports[_0x9c06('0x66')]=function(_0xf54c17,_0x841a9e,_0x2bd638){if(_0xf54c17['body']['id']){delete _0xf54c17[_0x9c06('0x5c')]['id'];}return db[_0x9c06('0x3f')][_0x9c06('0x61')]({'where':{'id':_0xf54c17[_0x9c06('0x58')]['id']}})[_0x9c06('0x1f')](handleEntityNotFound(_0x841a9e,null))[_0x9c06('0x1f')](function(_0x342d4c){if(_0x342d4c){_0xf54c17[_0x9c06('0x5c')]['WhatsappAccountId']=_0x342d4c['id'];return db['Disposition'][_0x9c06('0x5b')](_0xf54c17[_0x9c06('0x5c')]);}})[_0x9c06('0x1f')](respondWithResult(_0x841a9e,null))[_0x9c06('0x29')](handleError(_0x841a9e,null));};exports[_0x9c06('0x67')]=function(_0x291bf8,_0x4a6ea2,_0x59b738){var _0x56ed82={'raw':![],'where':{}};var _0x46b9e0={};var _0x46c04b={'count':0x0,'rows':[]};return db[_0x9c06('0x3f')][_0x9c06('0x68')]({'where':{'id':_0x291bf8[_0x9c06('0x58')]['id']}})[_0x9c06('0x1f')](handleEntityNotFound(_0x4a6ea2,null))[_0x9c06('0x1f')](function(_0x5958c4){if(_0x5958c4){_0x46b9e0[_0x9c06('0x43')]=_[_0x9c06('0x45')](db[_0x9c06('0x69')][_0x9c06('0x40')]);_0x46b9e0[_0x9c06('0x44')]=_['keys'](_0x291bf8[_0x9c06('0x44')]);_0x46b9e0[_0x9c06('0x50')]=_[_0x9c06('0x46')](_0x46b9e0[_0x9c06('0x43')],_0x46b9e0['query']);_0x56ed82[_0x9c06('0x47')]=_[_0x9c06('0x46')](_0x46b9e0[_0x9c06('0x43')],qs[_0x9c06('0x48')](_0x291bf8[_0x9c06('0x44')][_0x9c06('0x48')]));_0x56ed82['attributes']=_0x56ed82[_0x9c06('0x47')][_0x9c06('0x49')]?_0x56ed82[_0x9c06('0x47')]:_0x46b9e0['model'];if(!_0x291bf8['query'][_0x9c06('0x4a')](_0x9c06('0x4b'))){_0x56ed82[_0x9c06('0x4c')]=qs[_0x9c06('0x4c')](_0x291bf8[_0x9c06('0x44')][_0x9c06('0x4c')]);_0x56ed82[_0x9c06('0x2e')]=qs[_0x9c06('0x2e')](_0x291bf8[_0x9c06('0x44')]['offset']);}_0x56ed82[_0x9c06('0x4d')]=qs['sort'](_0x291bf8['query']['sort']);_0x56ed82[_0x9c06('0x4f')]=qs[_0x9c06('0x50')](_['pick'](_0x291bf8[_0x9c06('0x44')],_0x46b9e0[_0x9c06('0x50')]));_0x56ed82[_0x9c06('0x4f')][_0x9c06('0x6a')]=_0x5958c4['id'];if(_0x291bf8[_0x9c06('0x44')][_0x9c06('0x51')]){_0x56ed82[_0x9c06('0x4f')]=_[_0x9c06('0x52')](_0x56ed82[_0x9c06('0x4f')],{'$or':_[_0x9c06('0x3e')](_0x56ed82[_0x9c06('0x47')],function(_0x2c782d){var _0xc350d9={};_0xc350d9[_0x2c782d]={'$like':'%'+_0x291bf8[_0x9c06('0x44')][_0x9c06('0x51')]+'%'};return _0xc350d9;})});}_0x56ed82=_[_0x9c06('0x52')]({},_0x56ed82,_0x291bf8[_0x9c06('0x5a')]);return db['Disposition'][_0x9c06('0x30')]({'where':_0x56ed82['where']})[_0x9c06('0x1f')](function(_0xc50099){_0x46c04b[_0x9c06('0x30')]=_0xc50099;if(_0x291bf8[_0x9c06('0x44')][_0x9c06('0x54')]){_0x56ed82[_0x9c06('0x55')]=[{'all':!![]}];}return db[_0x9c06('0x69')][_0x9c06('0x56')](_0x56ed82);})[_0x9c06('0x1f')](function(_0x1b7593){_0x46c04b[_0x9c06('0x6b')]=_0x1b7593;return _0x46c04b;});}})[_0x9c06('0x1f')](respondWithFilteredResult(_0x4a6ea2,_0x56ed82))['catch'](handleError(_0x4a6ea2,null));};exports[_0x9c06('0x6c')]=function(_0x580128,_0x53cb99,_0x591b2f){return db['WhatsappAccount'][_0x9c06('0x61')]({'where':{'id':_0x580128[_0x9c06('0x58')]['id']}})[_0x9c06('0x1f')](handleEntityNotFound(_0x53cb99,null))[_0x9c06('0x1f')](function(_0x4ee9d2){if(_0x4ee9d2){return _0x4ee9d2[_0x9c06('0x6c')](_0x580128['query'][_0x9c06('0x6d')]);}})[_0x9c06('0x1f')](respondWithStatusCode(_0x53cb99,null))[_0x9c06('0x29')](handleError(_0x53cb99,null));};exports[_0x9c06('0x6e')]=function(_0x34b6f3,_0x497bb3,_0x17a607){if(_0x34b6f3[_0x9c06('0x5c')]['id']){delete _0x34b6f3['body']['id'];}return db[_0x9c06('0x3f')][_0x9c06('0x61')]({'where':{'id':_0x34b6f3['params']['id']}})[_0x9c06('0x1f')](handleEntityNotFound(_0x497bb3,null))[_0x9c06('0x1f')](function(_0x135d1e){if(_0x135d1e){_0x34b6f3[_0x9c06('0x5c')][_0x9c06('0x6a')]=_0x135d1e['id'];return db[_0x9c06('0x6f')]['create'](_0x34b6f3['body']);}})[_0x9c06('0x1f')](respondWithResult(_0x497bb3,null))[_0x9c06('0x29')](handleError(_0x497bb3,null));};exports[_0x9c06('0x70')]=function(_0x434ded,_0xccb42f,_0x4eacfd){var _0x3424f2={'raw':![],'where':{}};var _0xe394a6={};var _0x432089={'count':0x0,'rows':[]};return db[_0x9c06('0x3f')][_0x9c06('0x68')]({'where':{'id':_0x434ded[_0x9c06('0x58')]['id']}})[_0x9c06('0x1f')](handleEntityNotFound(_0xccb42f,null))[_0x9c06('0x1f')](function(_0x866a9c){if(_0x866a9c){_0xe394a6[_0x9c06('0x43')]=_[_0x9c06('0x45')](db[_0x9c06('0x6f')]['rawAttributes']);_0xe394a6[_0x9c06('0x44')]=_[_0x9c06('0x45')](_0x434ded[_0x9c06('0x44')]);_0xe394a6[_0x9c06('0x50')]=_[_0x9c06('0x46')](_0xe394a6[_0x9c06('0x43')],_0xe394a6[_0x9c06('0x44')]);_0x3424f2['attributes']=_['intersection'](_0xe394a6[_0x9c06('0x43')],qs['fields'](_0x434ded[_0x9c06('0x44')][_0x9c06('0x48')]));_0x3424f2[_0x9c06('0x47')]=_0x3424f2['attributes'][_0x9c06('0x49')]?_0x3424f2[_0x9c06('0x47')]:_0xe394a6['model'];if(!_0x434ded[_0x9c06('0x44')][_0x9c06('0x4a')](_0x9c06('0x4b'))){_0x3424f2[_0x9c06('0x4c')]=qs[_0x9c06('0x4c')](_0x434ded[_0x9c06('0x44')][_0x9c06('0x4c')]);_0x3424f2[_0x9c06('0x2e')]=qs[_0x9c06('0x2e')](_0x434ded['query'][_0x9c06('0x2e')]);}_0x3424f2['order']=qs[_0x9c06('0x4e')](_0x434ded[_0x9c06('0x44')][_0x9c06('0x4e')]);_0x3424f2['where']=qs[_0x9c06('0x50')](_['pick'](_0x434ded[_0x9c06('0x44')],_0xe394a6[_0x9c06('0x50')]));_0x3424f2[_0x9c06('0x4f')][_0x9c06('0x6a')]=_0x866a9c['id'];if(_0x434ded[_0x9c06('0x44')]['filter']){_0x3424f2[_0x9c06('0x4f')]=_[_0x9c06('0x52')](_0x3424f2['where'],{'$or':_[_0x9c06('0x3e')](_0x3424f2[_0x9c06('0x47')],function(_0x1055c3){var _0x59fbe8={};_0x59fbe8[_0x1055c3]={'$like':'%'+_0x434ded[_0x9c06('0x44')][_0x9c06('0x51')]+'%'};return _0x59fbe8;})});}_0x3424f2=_[_0x9c06('0x52')]({},_0x3424f2,_0x434ded[_0x9c06('0x5a')]);return db[_0x9c06('0x6f')][_0x9c06('0x30')]({'where':_0x3424f2[_0x9c06('0x4f')]})[_0x9c06('0x1f')](function(_0xe42f16){_0x432089[_0x9c06('0x30')]=_0xe42f16;if(_0x434ded['query']['includeAll']){_0x3424f2['include']=[{'all':!![]}];}return db[_0x9c06('0x6f')][_0x9c06('0x56')](_0x3424f2);})['then'](function(_0x4a480d){_0x432089['rows']=_0x4a480d;return _0x432089;});}})[_0x9c06('0x1f')](respondWithFilteredResult(_0xccb42f,_0x3424f2))['catch'](handleError(_0xccb42f,null));};exports[_0x9c06('0x71')]=function(_0x130954,_0x587c44,_0x58cafd){return db[_0x9c06('0x3f')][_0x9c06('0x61')]({'where':{'id':_0x130954[_0x9c06('0x58')]['id']}})[_0x9c06('0x1f')](handleEntityNotFound(_0x587c44,null))[_0x9c06('0x1f')](function(_0x598078){if(_0x598078){return _0x598078[_0x9c06('0x71')](_0x130954[_0x9c06('0x44')]['ids']);}})[_0x9c06('0x1f')](respondWithStatusCode(_0x587c44,null))[_0x9c06('0x29')](handleError(_0x587c44,null));};exports[_0x9c06('0x72')]=function(_0x11c2f8,_0x10cdde,_0x388093){return db[_0x9c06('0x3f')][_0x9c06('0x61')]({'where':{'id':_0x11c2f8[_0x9c06('0x58')]['id']}})['then'](handleEntityNotFound(_0x10cdde,null))[_0x9c06('0x1f')](function(_0x5ebccd){if(_0x5ebccd){return _0x5ebccd[_0x9c06('0x72')](_0x11c2f8[_0x9c06('0x5c')]['ids'],_[_0x9c06('0x73')](_0x11c2f8[_0x9c06('0x5c')],['ids','id'])||{})['spread'](function(_0x510449){for(var _0x2f8f4c=0x0;_0x2f8f4c<_0x11c2f8['body'][_0x9c06('0x6d')][_0x9c06('0x49')];_0x2f8f4c+=0x1){socket[_0x9c06('0x74')](_0x9c06('0x75'),{'UserId':Number(_0x11c2f8[_0x9c06('0x5c')][_0x9c06('0x6d')][_0x2f8f4c]),'WhatsappAccountId':Number(_0x11c2f8['params']['id'])});}return _0x510449;});}})[_0x9c06('0x1f')](respondWithResult(_0x10cdde,null))[_0x9c06('0x29')](handleError(_0x10cdde,null));};exports[_0x9c06('0x76')]=function(_0x382224,_0x3e85a1,_0xf0f78a){return db[_0x9c06('0x3f')]['find']({'where':{'id':_0x382224[_0x9c06('0x58')]['id']}})['then'](handleEntityNotFound(_0x3e85a1,null))[_0x9c06('0x1f')](function(_0x54209b){if(_0x54209b){return _0x54209b[_0x9c06('0x76')](_0x382224[_0x9c06('0x44')][_0x9c06('0x6d')])[_0x9c06('0x1f')](function(){if(_[_0x9c06('0x77')](_0x382224[_0x9c06('0x44')]['ids'])){for(var _0x2be0c4=0x0;_0x2be0c4<_0x382224[_0x9c06('0x44')]['ids'][_0x9c06('0x49')];_0x2be0c4+=0x1){socket[_0x9c06('0x74')]('userWhatsappAccount:remove',{'UserId':Number(_0x382224[_0x9c06('0x44')][_0x9c06('0x6d')][_0x2be0c4]),'WhatsappAccountId':Number(_0x382224['params']['id'])});}}else{socket['emit'](_0x9c06('0x78'),{'UserId':Number(_0x382224[_0x9c06('0x44')]['ids']),'WhatsappAccountId':Number(_0x382224['params']['id'])});}});}})[_0x9c06('0x1f')](respondWithStatusCode(_0x3e85a1,null))[_0x9c06('0x29')](handleError(_0x3e85a1,null));};exports[_0x9c06('0x79')]=function(_0x588fd4,_0x46b222,_0x472ee7){var _0x2cc4bf={};var _0x3da629={};var _0x3150cc;var _0x450246;return db[_0x9c06('0x3f')][_0x9c06('0x68')]({'where':{'id':_0x588fd4[_0x9c06('0x58')]['id']}})[_0x9c06('0x1f')](handleEntityNotFound(_0x46b222,null))[_0x9c06('0x1f')](function(_0x1d39c3){if(_0x1d39c3){_0x3150cc=_0x1d39c3;_0x3da629[_0x9c06('0x43')]=_[_0x9c06('0x45')](db[_0x9c06('0x7a')][_0x9c06('0x40')]);_0x3da629[_0x9c06('0x44')]=_[_0x9c06('0x45')](_0x588fd4[_0x9c06('0x44')]);_0x3da629[_0x9c06('0x50')]=_[_0x9c06('0x46')](_0x3da629[_0x9c06('0x43')],_0x3da629['query']);_0x2cc4bf['attributes']=_['intersection'](_0x3da629[_0x9c06('0x43')],qs['fields'](_0x588fd4[_0x9c06('0x44')][_0x9c06('0x48')]));_0x2cc4bf[_0x9c06('0x47')]=_0x2cc4bf[_0x9c06('0x47')][_0x9c06('0x49')]?_0x2cc4bf[_0x9c06('0x47')]:_0x3da629['model'];_0x2cc4bf[_0x9c06('0x4d')]=qs[_0x9c06('0x4e')](_0x588fd4[_0x9c06('0x44')][_0x9c06('0x4e')]);_0x2cc4bf[_0x9c06('0x4f')]=qs[_0x9c06('0x50')](_[_0x9c06('0x7b')](_0x588fd4[_0x9c06('0x44')],_0x3da629[_0x9c06('0x50')]));if(_0x588fd4[_0x9c06('0x44')][_0x9c06('0x51')]){_0x2cc4bf[_0x9c06('0x4f')]=_['merge'](_0x2cc4bf['where'],{'$or':_[_0x9c06('0x3e')](_0x2cc4bf[_0x9c06('0x47')],function(_0x3bb053){var _0x4c0490={};_0x4c0490[_0x3bb053]={'$like':'%'+_0x588fd4['query'][_0x9c06('0x51')]+'%'};return _0x4c0490;})});}_0x2cc4bf=_[_0x9c06('0x52')]({},_0x2cc4bf,_0x588fd4[_0x9c06('0x5a')]);return _0x3150cc[_0x9c06('0x79')](_0x2cc4bf);}})[_0x9c06('0x1f')](function(_0x3a537d){if(_0x3a537d){_0x450246=_0x3a537d['length'];if(!_0x588fd4[_0x9c06('0x44')][_0x9c06('0x4a')](_0x9c06('0x4b'))){_0x2cc4bf[_0x9c06('0x4c')]=qs[_0x9c06('0x4c')](_0x588fd4[_0x9c06('0x44')]['limit']);_0x2cc4bf[_0x9c06('0x2e')]=qs[_0x9c06('0x2e')](_0x588fd4['query']['offset']);}return _0x3150cc[_0x9c06('0x79')](_0x2cc4bf);}})['then'](function(_0x5963a4){if(_0x5963a4){return _0x5963a4?{'count':_0x450246,'rows':_0x5963a4}:null;}})[_0x9c06('0x1f')](respondWithResult(_0x46b222,null))[_0x9c06('0x29')](handleError(_0x46b222,null));};exports[_0x9c06('0x7c')]=function(_0x36597e,_0x23aa85){var _0x3ae506=_0x36597e[_0x9c06('0x58')]['id'];var _0x507d4b=_0x36597e[_0x9c06('0x5c')];var _0x14e129=0xc8;var _0xaee80e=null;return db['sequelize'][_0x9c06('0x7d')]({'isolationLevel':db[_0x9c06('0x7e')][_0x9c06('0x7f')][_0x9c06('0x80')][_0x9c06('0x81')]},function(_0x1bdf8a){return db[_0x9c06('0x3f')][_0x9c06('0x68')]({'where':{'id':_0x3ae506},'transaction':_0x1bdf8a})[_0x9c06('0x1f')](function(_0x5f05a4){if(_0x5f05a4){return db[_0x9c06('0x82')]['destroy']({'where':{'WhatsappAccountId':_0x3ae506},'transaction':_0x1bdf8a})[_0x9c06('0x1f')](function(){var _0x11d05f=_[_0x9c06('0x3e')](_0x507d4b,function(_0x186d3d){_0x186d3d['WhatsappAccountId']=_0x3ae506;return _0x186d3d;});return db[_0x9c06('0x82')][_0x9c06('0x83')](_0x11d05f,{'transaction':_0x1bdf8a});});}else{_0x14e129=0x194;_0xaee80e=[];}});})[_0x9c06('0x1f')](function(){if(_0x14e129!==0x194){return db['WhatsappApplication'][_0x9c06('0x84')]({'where':{'WhatsappAccountId':_0x3ae506},'order':_0x9c06('0x85')})[_0x9c06('0x1f')](function(_0x1951f8){_0xaee80e=_0x1951f8;});}})[_0x9c06('0x29')](function(_0x236e42){_0x14e129=0x1f4;logger['error'](_0x236e42[_0x9c06('0x86')]);if(_0x236e42[_0x9c06('0x3a')]){delete _0x236e42[_0x9c06('0x3a')];}_0xaee80e=_0x236e42;})[_0x9c06('0x87')](function(){if(_0xaee80e===null){_0x23aa85[_0x9c06('0x2a')](_0x14e129);}else{if(_0x14e129===0x1f4){_0x23aa85[_0x9c06('0x2b')](_0x14e129)[_0x9c06('0x3b')](_0xaee80e);}else{_0x23aa85[_0x9c06('0x2b')](_0x14e129)[_0x9c06('0x2d')](_0xaee80e);}}});};exports[_0x9c06('0x88')]=function(_0x3e95e1,_0x4f9083,_0x1ff3d7){var _0xf2c1ce={};var _0xb0b612={};var _0x30a4ca;var _0x402068;return db[_0x9c06('0x3f')][_0x9c06('0x68')]({'where':{'id':_0x3e95e1[_0x9c06('0x58')]['id']}})[_0x9c06('0x1f')](handleEntityNotFound(_0x4f9083,null))[_0x9c06('0x1f')](function(_0xcc5de1){if(_0xcc5de1){_0x30a4ca=_0xcc5de1;_0xb0b612[_0x9c06('0x43')]=_[_0x9c06('0x45')](db[_0x9c06('0x82')][_0x9c06('0x40')]);_0xb0b612[_0x9c06('0x44')]=_[_0x9c06('0x45')](_0x3e95e1[_0x9c06('0x44')]);_0xb0b612['filters']=_[_0x9c06('0x46')](_0xb0b612['model'],_0xb0b612[_0x9c06('0x44')]);_0xf2c1ce[_0x9c06('0x47')]=_[_0x9c06('0x46')](_0xb0b612['model'],qs['fields'](_0x3e95e1['query']['fields']));_0xf2c1ce[_0x9c06('0x47')]=_0xf2c1ce[_0x9c06('0x47')][_0x9c06('0x49')]?_0xf2c1ce[_0x9c06('0x47')]:_0xb0b612[_0x9c06('0x43')];_0xf2c1ce[_0x9c06('0x4d')]=qs[_0x9c06('0x4e')](_0x3e95e1[_0x9c06('0x44')][_0x9c06('0x4e')]);_0xf2c1ce[_0x9c06('0x4f')]=qs[_0x9c06('0x50')](_[_0x9c06('0x7b')](_0x3e95e1[_0x9c06('0x44')],_0xb0b612[_0x9c06('0x50')]));if(_0x3e95e1[_0x9c06('0x44')][_0x9c06('0x51')]){_0xf2c1ce[_0x9c06('0x4f')]=_[_0x9c06('0x52')](_0xf2c1ce[_0x9c06('0x4f')],{'$or':_[_0x9c06('0x3e')](_0xf2c1ce[_0x9c06('0x47')],function(_0xb659ed){var _0x234671={};_0x234671[_0xb659ed]={'$like':'%'+_0x3e95e1[_0x9c06('0x44')]['filter']+'%'};return _0x234671;})});}_0xf2c1ce=_[_0x9c06('0x52')]({},_0xf2c1ce,_0x3e95e1[_0x9c06('0x5a')]);return _0x30a4ca[_0x9c06('0x88')](_0xf2c1ce);}})[_0x9c06('0x1f')](function(_0x772e4){if(_0x772e4){_0x402068=_0x772e4[_0x9c06('0x49')];if(!_0x3e95e1[_0x9c06('0x44')]['hasOwnProperty']('nolimit')){_0xf2c1ce['limit']=qs[_0x9c06('0x4c')](_0x3e95e1[_0x9c06('0x44')][_0x9c06('0x4c')]);_0xf2c1ce[_0x9c06('0x2e')]=qs[_0x9c06('0x2e')](_0x3e95e1[_0x9c06('0x44')][_0x9c06('0x2e')]);}return _0x30a4ca[_0x9c06('0x88')](_0xf2c1ce);}})[_0x9c06('0x1f')](function(_0x562511){if(_0x562511){return _0x562511?{'count':_0x402068,'rows':_0x562511}:null;}})[_0x9c06('0x1f')](respondWithResult(_0x4f9083,null))[_0x9c06('0x29')](handleError(_0x4f9083,null));};exports[_0x9c06('0x89')]=function(_0x3f1b04,_0x1f495d,_0x472bed){var _0x1c9b8e={'channel':_0x9c06('0x8a')};var _0x232550=[];var _0x523610=[];var _0x35b305={};return db[_0x9c06('0x3f')][_0x9c06('0x61')]({'where':{'id':_0x3f1b04[_0x9c06('0x58')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x9c06('0x8b')}]})[_0x9c06('0x1f')](handleEntityNotFound(_0x1f495d,null))[_0x9c06('0x1f')](function(_0x543264){_0x1c9b8e[_0x9c06('0x8c')]=_0x543264;if(_0x1c9b8e[_0x9c06('0x8c')]&&_0x1c9b8e[_0x9c06('0x8c')][_0x9c06('0x41')]==='sinch'&&_0x3f1b04['body']['statuses']){if(_0x3f1b04[_0x9c06('0x5c')][_0x9c06('0x8d')][_0x9c06('0x49')]===0x0)return;if(_0x3f1b04[_0x9c06('0x5c')][_0x9c06('0x8d')][0x0][_0x9c06('0x8e')]!=='read')return;return db[_0x9c06('0x8f')][_0x9c06('0x35')]({'read':!![],'readAt':_0x3f1b04[_0x9c06('0x5c')][_0x9c06('0x8d')][0x0][_0x9c06('0x90')]},{'where':{'messageId':_0x3f1b04[_0x9c06('0x5c')]['statuses'][0x0][_0x9c06('0x91')]},'individualHooks':!![]})['then'](function(_0x160cdf){return _0x1f495d['status'](0xc8)[_0x9c06('0x2d')](_0x160cdf);});}_0x1c9b8e[_0x9c06('0x92')]=_[_0x9c06('0x93')](_0x543264['Applications'],[_0x9c06('0x85')],[_0x9c06('0x94')]);if(_0x1c9b8e['account'][_0x9c06('0x8b')]){delete _0x1c9b8e['account'][_0x9c06('0x8b')];}return db[_0x9c06('0x95')]['describe']()['then'](function(_0x196353){if(!_0x196353){throw new db['Sequelize']['ValidationError'](_0x9c06('0x96'));}_0x232550=_['difference'](_[_0x9c06('0x45')](_0x196353),[_0x9c06('0x97'),_0x9c06('0x98')]);_0x523610=_[_0x9c06('0x99')](_[_0x9c06('0x45')](_0x196353),['createdAt',_0x9c06('0x98'),_0x9c06('0x9a'),_0x9c06('0x9b')]);_0x1c9b8e[_0x9c06('0x5c')]={'mapKey':_0x9c06('0x9c')};if(_0x1c9b8e[_0x9c06('0x8c')]&&_0x1c9b8e[_0x9c06('0x8c')][_0x9c06('0x41')]===_0x9c06('0x9d')){_0x1c9b8e[_0x9c06('0x5c')][_0x9c06('0x9e')]=_0x3f1b04[_0x9c06('0x5c')][_0x9c06('0x9f')][_0x9c06('0xa0')](_0x9c06('0xa1'),'');_0x1c9b8e['body'][_0x9c06('0x5c')]=_0x3f1b04[_0x9c06('0x5c')][_0x9c06('0xa2')];_0x1c9b8e[_0x9c06('0x5c')][_0x9c06('0xa3')]=_0x3f1b04[_0x9c06('0x5c')]['MessageSid'];}if(_0x1c9b8e[_0x9c06('0x8c')]&&_0x1c9b8e[_0x9c06('0x8c')][_0x9c06('0x41')]===_0x9c06('0xa4')){_0x1c9b8e[_0x9c06('0x5c')]['from']=_0x3f1b04['body']['notifications'][0x0]['from'];_0x1c9b8e[_0x9c06('0x5c')][_0x9c06('0x5c')]=_0x3f1b04[_0x9c06('0x5c')][_0x9c06('0xa5')][0x0][_0x9c06('0x27')][_0x9c06('0x5c')];_0x1c9b8e[_0x9c06('0x5c')]['messageId']=_0x3f1b04['body'][_0x9c06('0xa5')][0x0][_0x9c06('0x91')];}if(_0x1c9b8e[_0x9c06('0x5c')]['id']){delete _0x1c9b8e['body']['id'];}if(_[_0x9c06('0xa6')](_0x1c9b8e[_0x9c06('0x5c')]['from'])){throw new db['Sequelize'][(_0x9c06('0xa7'))](_0x9c06('0xa8'));}if(_[_0x9c06('0xa6')](_0x1c9b8e[_0x9c06('0x5c')][_0x9c06('0x5c')])||_0x1c9b8e[_0x9c06('0x5c')][_0x9c06('0x5c')]===''){throw new db[(_0x9c06('0xa9'))][(_0x9c06('0xa7'))](_0x9c06('0xaa'));}if(_[_0x9c06('0xa6')](_0x1c9b8e[_0x9c06('0x5c')][_0x9c06('0xab')])){throw new db[(_0x9c06('0xa9'))]['ValidationError'](_0x9c06('0xac')+_0x523610);}if(!_[_0x9c06('0xad')](_0x523610,_0x1c9b8e[_0x9c06('0x5c')][_0x9c06('0xab')])){throw new db[(_0x9c06('0xa9'))][(_0x9c06('0xa7'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x523610);}_0x35b305[_0x1c9b8e[_0x9c06('0x5c')]['mapKey']]=_0x1c9b8e[_0x9c06('0x5c')]['from'];return db['CmList'][_0x9c06('0x61')]({'where':{'id':_0x1c9b8e[_0x9c06('0x8c')][_0x9c06('0x9b')]},'include':[{'model':db['CmContact'],'as':_0x9c06('0xae'),'where':_0x35b305,'limit':0x1,'order':[[_0x9c06('0x98'),_0x9c06('0xaf')]]}]});})[_0x9c06('0x1f')](handleEntityNotFound(_0x1f495d,null))[_0x9c06('0x1f')](function(_0x4ed0be){if(_0x4ed0be){_0x1c9b8e[_0x9c06('0xb0')]=_[_0x9c06('0x73')](_0x4ed0be,[_0x9c06('0xae')]);if(_0x4ed0be[_0x9c06('0xae')][_0x9c06('0x49')]){return _0x4ed0be[_0x9c06('0xae')][0x0];}var _0x42a421=_[_0x9c06('0xb1')](_0x1c9b8e['body'],{'firstName':_0x1c9b8e[_0x9c06('0x5c')]['from'],'ListId':_0x4ed0be['id']});_0x42a421[_0x1c9b8e[_0x9c06('0x5c')][_0x9c06('0xab')]]=_0x1c9b8e['body'][_0x9c06('0x9e')];return db[_0x9c06('0x95')][_0x9c06('0x5b')](_0x42a421,{'fields':_0x232550,'raw':!![]});}})[_0x9c06('0x1f')](handleEntityNotFound(_0x1f495d,null))[_0x9c06('0x1f')](function(_0x1a3be9){if(_0x1a3be9){_0x1c9b8e[_0x9c06('0xb2')]=_0x1a3be9;var _0x580269={'ContactId':_0x1a3be9['id'],'phone':_0x1c9b8e[_0x9c06('0x5c')][_0x9c06('0x9e')],'WhatsappAccountId':_0x3f1b04[_0x9c06('0x58')]['id']};var _0x513248={'ContactId':_0x1a3be9['id'],'WhatsappAccountId':_0x3f1b04[_0x9c06('0x58')]['id'],'closed':![]};return db[_0x9c06('0xb3')]['find']({'where':_0x513248})[_0x9c06('0x1f')](function(_0xd392d1){if(_0xd392d1){return[_0xd392d1,![]];}return db[_0x9c06('0xb3')]['create'](_0x580269)['then'](function(_0x306c91){return[_0x306c91,!![]];});});}})['spread'](function(_0x1332e5,_0x2e6970){_0x1c9b8e[_0x9c06('0xb4')]=_0x1332e5[_0x9c06('0x37')]({'plain':!![]});_0x1c9b8e[_0x9c06('0xb4')]['created']=![];if(_0x2e6970){if(_0x1c9b8e[_0x9c06('0x8c')][_0x9c06('0xb5')]){_0x1c9b8e[_0x9c06('0x92')]['push']({'id':0x0,'priority':_0x1c9b8e[_0x9c06('0x92')][_0x9c06('0x49')]+0x1,'app':_0x9c06('0xb6'),'appdata':'unmanaged','interval':_0x9c06('0xb7')});}_0x1c9b8e[_0x9c06('0xb4')]['created']=!![];}return db['WhatsappMessage'][_0x9c06('0x5b')]({'phone':_0x1c9b8e[_0x9c06('0x5c')][_0x9c06('0x9e')],'messageId':_0x1c9b8e[_0x9c06('0x5c')][_0x9c06('0xa3')],'body':_0x1c9b8e[_0x9c06('0x5c')]['body'],'WhatsappAccountId':_0x3f1b04[_0x9c06('0x58')]['id'],'WhatsappInteractionId':_0x1332e5['id'],'direction':'in','ContactId':_0x1332e5[_0x9c06('0xb8')],'AttachmentId':_0x1c9b8e[_0x9c06('0x5c')][_0x9c06('0xb9')]});})[_0x9c06('0x1f')](function(_0x4f0e1a){_0x1c9b8e[_0x9c06('0x27')]=_0x4f0e1a;if(_0x1c9b8e[_0x9c06('0xb4')]['UserId']){return db[_0x9c06('0x7a')][_0x9c06('0x61')]({'attributes':['id',_0x9c06('0x3a')],'where':{'id':_0x1c9b8e[_0x9c06('0xb4')]['UserId']}})[_0x9c06('0x1f')](function(_0xde26ef){if(_0xde26ef){_0x1c9b8e[_0x9c06('0x92')][_0x9c06('0xba')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xde26ef['name']+','+(_0x1c9b8e[_0x9c06('0x8c')][_0x9c06('0xbb')]||0xa),'interval':_0x9c06('0xb7')});}return respondWithRpcPromise(_0x9c06('0xbc'),'startRouting',_0x1c9b8e);});}return respondWithRpcPromise(_0x9c06('0xbc'),_0x9c06('0xbd'),_0x1c9b8e);})[_0x9c06('0x1f')](function(_0x8436ec){if(_0x8436ec){var _0x3c8bce=0xc8;var _0x520a36=_0x9c06('0xbe');logger[_0x9c06('0x20')](_0x9c06('0x24'),_0x520a36,_0x3c8bce,_0x9c06('0xbf'));logger['debug'](_0x9c06('0xc0'),_0x520a36,_0x3c8bce,_0x9c06('0xbf'),JSON[_0x9c06('0x25')](_0x8436ec));if(_0x1c9b8e[_0x9c06('0x8c')]['type']===_0x9c06('0x9d')){return _0x1f495d['status'](_0x3c8bce)[_0x9c06('0x31')]('Content-Type',_0x9c06('0xc1'))[_0x9c06('0x3b')](_0x9c06('0xc2'));}else{return _0x1f495d[_0x9c06('0x2b')](_0x3c8bce)[_0x9c06('0x2d')](_0x8436ec);}}});})[_0x9c06('0x29')](handleError(_0x1f495d,null));};exports[_0x9c06('0x3b')]=function(_0x115e61,_0x457732,_0x151918){var _0x37ce67,_0x177b8a,_0x1e41f6;if(_[_0x9c06('0xa6')](_0x115e61[_0x9c06('0x5c')][_0x9c06('0x5c')])||_0x115e61[_0x9c06('0x5c')][_0x9c06('0x5c')]===''){throw new db[(_0x9c06('0xa9'))][(_0x9c06('0xa7'))](_0x9c06('0xaa'));}if(_['isNil'](_0x115e61['body']['to'])){throw new db[(_0x9c06('0xa9'))]['ValidationError']('to\x20is\x20mandatory');}_0x37ce67=_0x115e61[_0x9c06('0x5c')]['to'];return db[_0x9c06('0x3f')]['find']({'where':{'id':_0x115e61['params']['id']},'include':[{'model':db[_0x9c06('0xc3')],'as':'List','include':[{'model':db['CmContact'],'as':_0x9c06('0xae'),'where':{'mobile':_0x37ce67},'limit':0x1,'order':[[_0x9c06('0x98'),_0x9c06('0xaf')]]}]}]})[_0x9c06('0x1f')](handleEntityNotFound(_0x457732,null))[_0x9c06('0x1f')](function(_0x55c483){if(_0x55c483&&_0x55c483['List']){_0x177b8a=_0x55c483[_0x9c06('0x37')]({'plain':!![]});if(_0x177b8a[_0x9c06('0xc4')]&&_0x177b8a[_0x9c06('0xc4')]['Contacts'][_0x9c06('0x49')]){return _0x177b8a[_0x9c06('0xc4')][_0x9c06('0xae')][0x0];}return db['CmContact']['create'](_[_0x9c06('0xb1')](_0x115e61['body'],{'firstName':_0x37ce67,'mobile':_0x37ce67,'phone':_0x37ce67,'ListId':_0x177b8a[_0x9c06('0x9b')]}));}})[_0x9c06('0x1f')](handleEntityNotFound(_0x457732,null))[_0x9c06('0x1f')](function(_0x3ef3b8){if(_0x3ef3b8){_0x1e41f6=_0x3ef3b8;return db[_0x9c06('0xb3')][_0x9c06('0x61')]({'where':{'ContactId':_0x1e41f6['id'],'closed':![],'WhatsappAccountId':_0x177b8a['id']}})['then'](function(_0x5cd40a){if(_0x5cd40a){return[_0x5cd40a,![]];}return db[_0x9c06('0xb3')][_0x9c06('0x5b')]({'UserId':_0x115e61[_0x9c06('0x5d')]['id'],'ContactId':_0x1e41f6['id'],'WhatsappAccountId':_0x177b8a['id'],'phone':_0x37ce67,'firstMsgDirection':_0x9c06('0xc5'),'Messages':[_['merge'](_0x115e61[_0x9c06('0x5c')],{'read':![],'body':_0x115e61[_0x9c06('0x5c')][_0x9c06('0x5c')],'phone':_0x37ce67,'WhatsappAccountId':_0x177b8a['id'],'UserId':_0x115e61[_0x9c06('0x5d')]['id'],'ContactId':_0x1e41f6['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x9c06('0xc6')}]})['then'](function(_0xbf63af){return[_0xbf63af,!![]];});});}})['spread'](function(_0x265159,_0x1cae1a){if(_0x1cae1a){return _0x265159;}return db[_0x9c06('0x8f')]['create'](_[_0x9c06('0x52')](_0x115e61[_0x9c06('0x5c')],{'read':![],'body':_0x115e61[_0x9c06('0x5c')][_0x9c06('0x5c')],'phone':_0x37ce67,'WhatsappAccountId':_0x177b8a['id'],'WhatsappInteractionId':_0x265159['id'],'UserId':_0x115e61['user']['id'],'ContactId':_0x1e41f6['id']}))[_0x9c06('0x1f')](function(_0x412252){_0x265159[_0x9c06('0xc7')][_0x9c06('0xc6')]=[];_0x265159[_0x9c06('0xc7')]['Messages']['push'](_0x412252[_0x9c06('0xc7')]);return _0x265159;});})[_0x9c06('0x1f')](respondWithResult(_0x457732,null))[_0x9c06('0x29')](handleError(_0x457732,null));};
\ No newline at end of file
index 8dab7af..14527ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf51=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save'];(function(_0x4a0a1e,_0x367f6a){var _0x23ce29=function(_0x5e029a){while(--_0x5e029a){_0x4a0a1e['push'](_0x4a0a1e['shift']());}};_0x23ce29(++_0x367f6a);}(_0xbf51,0x145));var _0x1bf5=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0xbf51[_0x456fb1];return _0x4083d6;};'use strict';var EventEmitter=require(_0x1bf5('0x0'));var WhatsappAccount=require(_0x1bf5('0x1'))['db'][_0x1bf5('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x1bf5('0x3')](0x0);var events={'afterCreate':_0x1bf5('0x4'),'afterUpdate':_0x1bf5('0x5'),'afterDestroy':_0x1bf5('0x6')};function emitEvent(_0xccb5d3){return function(_0x12601c,_0x1b9fc7,_0xd787c8){WhatsappAccountEvents[_0x1bf5('0x7')](_0xccb5d3+':'+_0x12601c['id'],_0x12601c);WhatsappAccountEvents[_0x1bf5('0x7')](_0xccb5d3,_0x12601c);_0xd787c8(null);};}for(var e in events){if(events[_0x1bf5('0x8')](e)){var event=events[e];WhatsappAccount[_0x1bf5('0x9')](e,emitEvent(event));}}module[_0x1bf5('0xa')]=WhatsappAccountEvents;
\ No newline at end of file
+var _0x9386=['WhatsappAccount','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x3e0165,_0x829393){var _0x3de6d2=function(_0x8495db){while(--_0x8495db){_0x3e0165['push'](_0x3e0165['shift']());}};_0x3de6d2(++_0x829393);}(_0x9386,0x76));var _0x6938=function(_0x1c8022,_0x425c5a){_0x1c8022=_0x1c8022-0x0;var _0x15fea0=_0x9386[_0x1c8022];return _0x15fea0;};'use strict';var EventEmitter=require(_0x6938('0x0'));var WhatsappAccount=require(_0x6938('0x1'))['db'][_0x6938('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6938('0x3'),'afterDestroy':_0x6938('0x4')};function emitEvent(_0x4df2b0){return function(_0x62a379,_0x109504,_0x20e1ef){WhatsappAccountEvents[_0x6938('0x5')](_0x4df2b0+':'+_0x62a379['id'],_0x62a379);WhatsappAccountEvents[_0x6938('0x5')](_0x4df2b0,_0x62a379);_0x20e1ef(null);};}for(var e in events){if(events[_0x6938('0x6')](e)){var event=events[e];WhatsappAccount[_0x6938('0x7')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents;
\ No newline at end of file
index bbc5837..9167027 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3925=['rimraf','exports','define','WhatsappAccount','lodash','util','api','bluebird','path'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x3925,0x190));var _0x5392=function(_0x459a0a,_0x25c46f){_0x459a0a=_0x459a0a-0x0;var _0x4ab46c=_0x3925[_0x459a0a];return _0x4ab46c;};'use strict';var _=require(_0x5392('0x0'));var util=require(_0x5392('0x1'));var logger=require('../../config/logger')(_0x5392('0x2'));var moment=require('moment');var BPromise=require(_0x5392('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5392('0x4'));var rimraf=require(_0x5392('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappAccount.attributes');module[_0x5392('0x6')]=function(_0xdb0ba7,_0x4a9f23){return _0xdb0ba7[_0x5392('0x7')](_0x5392('0x8'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4631=['./whatsappAccount.attributes','exports','define','WhatsappAccount','lodash','util','api','bluebird','path'];(function(_0x1244c4,_0x4450ed){var _0x2bc87a=function(_0x4d91c2){while(--_0x4d91c2){_0x1244c4['push'](_0x1244c4['shift']());}};_0x2bc87a(++_0x4450ed);}(_0x4631,0x13f));var _0x1463=function(_0x21090b,_0x39dd3b){_0x21090b=_0x21090b-0x0;var _0x3c68d7=_0x4631[_0x21090b];return _0x3c68d7;};'use strict';var _=require(_0x1463('0x0'));var util=require(_0x1463('0x1'));var logger=require('../../config/logger')(_0x1463('0x2'));var moment=require('moment');var BPromise=require(_0x1463('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1463('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1463('0x5'));module[_0x1463('0x6')]=function(_0x1fd673,_0x3e828f){return _0x1fd673[_0x1463('0x7')](_0x1463('0x8'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 53d8b3f..42fb23b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbd2=['find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./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'];(function(_0x3afb1e,_0x43fcd9){var _0x408028=function(_0x49ed62){while(--_0x49ed62){_0x3afb1e['push'](_0x3afb1e['shift']());}};_0x408028(++_0x43fcd9);}(_0xdbd2,0x119));var _0x2dbd=function(_0x57f54f,_0x517e1b){_0x57f54f=_0x57f54f-0x0;var _0x396b35=_0xdbd2[_0x57f54f];return _0x396b35;};'use strict';var _=require(_0x2dbd('0x0'));var util=require(_0x2dbd('0x1'));var moment=require(_0x2dbd('0x2'));var BPromise=require(_0x2dbd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2dbd('0x4'));var db=require(_0x2dbd('0x5'))['db'];var utils=require(_0x2dbd('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2dbd('0x7'));var jayson=require(_0x2dbd('0x8'));var client=jayson[_0x2dbd('0x9')][_0x2dbd('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2dbd('0xb')],{'host':_0x2dbd('0xc'),'port':0x18eb});var socket=require(_0x2dbd('0xd'))(new Redis(config[_0x2dbd('0xb')]));require(_0x2dbd('0xe'))[_0x2dbd('0xf')](socket);function respondWithRpcPromise(_0x5c0d8c,_0x543161,_0x2562f2){return new BPromise(function(_0x330a90,_0x1d073b){return client[_0x2dbd('0x10')](_0x5c0d8c,_0x2562f2)[_0x2dbd('0x11')](function(_0x1ebf97){logger[_0x2dbd('0x12')](_0x2dbd('0x13'),_0x543161,_0x2dbd('0x14'));logger[_0x2dbd('0x15')](_0x2dbd('0x16'),_0x543161,_0x2dbd('0x14'),JSON[_0x2dbd('0x17')](_0x1ebf97));if(_0x1ebf97['error']){if(_0x1ebf97[_0x2dbd('0x18')][_0x2dbd('0x19')]===0x1f4){logger[_0x2dbd('0x18')](_0x2dbd('0x13'),_0x543161,_0x1ebf97['error'][_0x2dbd('0x1a')]);return _0x1d073b(_0x1ebf97[_0x2dbd('0x18')][_0x2dbd('0x1a')]);}logger['error'](_0x2dbd('0x13'),_0x543161,_0x1ebf97['error'][_0x2dbd('0x1a')]);return _0x330a90(_0x1ebf97[_0x2dbd('0x18')][_0x2dbd('0x1a')]);}else{logger[_0x2dbd('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x543161,'request\x20sent');_0x330a90(_0x1ebf97[_0x2dbd('0x1b')]['message']);}})[_0x2dbd('0x1c')](function(_0x4a1902){logger[_0x2dbd('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x543161,_0x4a1902);_0x1d073b(_0x4a1902);});});}exports[_0x2dbd('0x1d')]=function(_0x16b540){var _0x4cd502=this;return new Promise(function(_0xc64c5d,_0x146777){return db[_0x2dbd('0x1e')][_0x2dbd('0x1f')]({'raw':_0x16b540[_0x2dbd('0x20')]?_0x16b540[_0x2dbd('0x20')][_0x2dbd('0x21')]===undefined?!![]:![]:!![],'where':_0x16b540[_0x2dbd('0x20')]?_0x16b540[_0x2dbd('0x20')][_0x2dbd('0x22')]||null:null,'attributes':_0x16b540['options']?_0x16b540[_0x2dbd('0x20')][_0x2dbd('0x23')]||null:null,'include':_0x16b540[_0x2dbd('0x20')]?_0x16b540[_0x2dbd('0x20')][_0x2dbd('0x24')]?_[_0x2dbd('0x25')](_0x16b540[_0x2dbd('0x20')][_0x2dbd('0x24')],function(_0x382af1){return{'model':db[_0x382af1[_0x2dbd('0x26')]],'as':_0x382af1['as'],'attributes':_0x382af1[_0x2dbd('0x23')],'include':_0x382af1[_0x2dbd('0x24')]?_['map'](_0x382af1[_0x2dbd('0x24')],function(_0x5158f5){return{'model':db[_0x5158f5[_0x2dbd('0x26')]],'as':_0x5158f5['as'],'attributes':_0x5158f5[_0x2dbd('0x23')],'include':_0x5158f5[_0x2dbd('0x24')]?_['map'](_0x5158f5[_0x2dbd('0x24')],function(_0x2abaf9){return{'model':db[_0x2abaf9['model']],'as':_0x2abaf9['as'],'attributes':_0x2abaf9[_0x2dbd('0x23')]};}):[]};}):[]};}):[]:[]})[_0x2dbd('0x11')](function(_0x57cc95){logger[_0x2dbd('0x12')](_0x2dbd('0x1d'),_0x16b540);logger[_0x2dbd('0x15')](_0x2dbd('0x1d'),_0x16b540,JSON[_0x2dbd('0x17')](_0x57cc95));_0xc64c5d(_0x57cc95);})[_0x2dbd('0x1c')](function(_0x54b870){logger[_0x2dbd('0x18')]('ShowWhatsappAccount',_0x54b870['message'],_0x16b540);_0x146777(_0x4cd502[_0x2dbd('0x18')](0x1f4,_0x54b870[_0x2dbd('0x1a')]));});});};
\ No newline at end of file
+var _0xb3f0=['code','WhatsappAccount,\x20%s,\x20%s','message','error','result','catch','ShowWhatsappAccount','options','where','attributes','include','map','model','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./whatsappAccount.socket','register','then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x27eaf0,_0x40e6bb){var _0x566b5d=function(_0xe99642){while(--_0xe99642){_0x27eaf0['push'](_0x27eaf0['shift']());}};_0x566b5d(++_0x40e6bb);}(_0xb3f0,0x103));var _0x0b3f=function(_0x50f392,_0x1d8441){_0x50f392=_0x50f392-0x0;var _0x5926f2=_0xb3f0[_0x50f392];return _0x5926f2;};'use strict';var _=require('lodash');var util=require(_0x0b3f('0x0'));var moment=require(_0x0b3f('0x1'));var BPromise=require(_0x0b3f('0x2'));var rs=require(_0x0b3f('0x3'));var fs=require('fs');var Redis=require(_0x0b3f('0x4'));var db=require(_0x0b3f('0x5'))['db'];var utils=require(_0x0b3f('0x6'));var logger=require(_0x0b3f('0x7'))(_0x0b3f('0x8'));var config=require(_0x0b3f('0x9'));var jayson=require(_0x0b3f('0xa'));var client=jayson['client'][_0x0b3f('0xb')]({'port':0x232a});config[_0x0b3f('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0b3f('0xd'))(new Redis(config['redis']));require(_0x0b3f('0xe'))[_0x0b3f('0xf')](socket);function respondWithRpcPromise(_0x288658,_0x3e233c,_0x58e0d1){return new BPromise(function(_0xcfc74a,_0x4fd649){return client['request'](_0x288658,_0x58e0d1)[_0x0b3f('0x10')](function(_0x1f5f5a){logger[_0x0b3f('0x11')]('WhatsappAccount,\x20%s,\x20%s',_0x3e233c,'request\x20sent');logger[_0x0b3f('0x12')](_0x0b3f('0x13'),_0x3e233c,_0x0b3f('0x14'),JSON['stringify'](_0x1f5f5a));if(_0x1f5f5a['error']){if(_0x1f5f5a['error'][_0x0b3f('0x15')]===0x1f4){logger['error'](_0x0b3f('0x16'),_0x3e233c,_0x1f5f5a['error'][_0x0b3f('0x17')]);return _0x4fd649(_0x1f5f5a[_0x0b3f('0x18')][_0x0b3f('0x17')]);}logger[_0x0b3f('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x3e233c,_0x1f5f5a[_0x0b3f('0x18')]['message']);return _0xcfc74a(_0x1f5f5a[_0x0b3f('0x18')]['message']);}else{logger[_0x0b3f('0x11')]('WhatsappAccount,\x20%s,\x20%s',_0x3e233c,_0x0b3f('0x14'));_0xcfc74a(_0x1f5f5a[_0x0b3f('0x19')]['message']);}})[_0x0b3f('0x1a')](function(_0x137154){logger[_0x0b3f('0x18')](_0x0b3f('0x16'),_0x3e233c,_0x137154);_0x4fd649(_0x137154);});});}exports[_0x0b3f('0x1b')]=function(_0x2a0cd6){var _0x5eb0d2=this;return new Promise(function(_0x16e8fb,_0x4d8f21){return db['WhatsappAccount']['find']({'raw':_0x2a0cd6['options']?_0x2a0cd6[_0x0b3f('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2a0cd6[_0x0b3f('0x1c')]?_0x2a0cd6['options'][_0x0b3f('0x1d')]||null:null,'attributes':_0x2a0cd6[_0x0b3f('0x1c')]?_0x2a0cd6[_0x0b3f('0x1c')][_0x0b3f('0x1e')]||null:null,'include':_0x2a0cd6[_0x0b3f('0x1c')]?_0x2a0cd6[_0x0b3f('0x1c')][_0x0b3f('0x1f')]?_[_0x0b3f('0x20')](_0x2a0cd6[_0x0b3f('0x1c')]['include'],function(_0x2d36f7){return{'model':db[_0x2d36f7[_0x0b3f('0x21')]],'as':_0x2d36f7['as'],'attributes':_0x2d36f7[_0x0b3f('0x1e')],'include':_0x2d36f7['include']?_['map'](_0x2d36f7[_0x0b3f('0x1f')],function(_0x443270){return{'model':db[_0x443270['model']],'as':_0x443270['as'],'attributes':_0x443270['attributes'],'include':_0x443270['include']?_['map'](_0x443270[_0x0b3f('0x1f')],function(_0x28d6d2){return{'model':db[_0x28d6d2[_0x0b3f('0x21')]],'as':_0x28d6d2['as'],'attributes':_0x28d6d2[_0x0b3f('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ef675){logger[_0x0b3f('0x11')](_0x0b3f('0x1b'),_0x2a0cd6);logger[_0x0b3f('0x12')](_0x0b3f('0x1b'),_0x2a0cd6,JSON[_0x0b3f('0x22')](_0x4ef675));_0x16e8fb(_0x4ef675);})['catch'](function(_0x19ca22){logger[_0x0b3f('0x18')]('ShowWhatsappAccount',_0x19ca22['message'],_0x2a0cd6);_0x4d8f21(_0x5eb0d2['error'](0x1f4,_0x19ca22['message']));});});};
\ No newline at end of file
index ec99c61..badd59a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe625=['save','remove','emit','removeListener','register','length','whatsappAccount:'];(function(_0x1ebe2f,_0x523227){var _0xdeb06f=function(_0x2a6051){while(--_0x2a6051){_0x1ebe2f['push'](_0x1ebe2f['shift']());}};_0xdeb06f(++_0x523227);}(_0xe625,0x196));var _0x5e62=function(_0x3476b4,_0x4ca78c){_0x3476b4=_0x3476b4-0x0;var _0x31607c=_0xe625[_0x3476b4];return _0x31607c;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x5e62('0x0'),_0x5e62('0x1'),'update'];function createListener(_0x348337,_0x456d83){return function(_0x1cf512){_0x456d83[_0x5e62('0x2')](_0x348337,_0x1cf512);};}function removeListener(_0x982e59,_0x5cae99){return function(){WhatsappAccountEvents[_0x5e62('0x3')](_0x982e59,_0x5cae99);};}exports[_0x5e62('0x4')]=function(_0x29b3cb){for(var _0x347426=0x0,_0x395cb7=events[_0x5e62('0x5')];_0x347426<_0x395cb7;_0x347426++){var _0x52472d=events[_0x347426];var _0x26ab75=createListener(_0x5e62('0x6')+_0x52472d,_0x29b3cb);WhatsappAccountEvents['on'](_0x52472d,_0x26ab75);}};
\ No newline at end of file
+var _0x4e06=['length','whatsappAccount:','remove','update','emit','removeListener','register'];(function(_0x3fddcd,_0x38edfd){var _0xd38b06=function(_0x4e2f4e){while(--_0x4e2f4e){_0x3fddcd['push'](_0x3fddcd['shift']());}};_0xd38b06(++_0x38edfd);}(_0x4e06,0x175));var _0x64e0=function(_0x1389e3,_0x2ed4bd){_0x1389e3=_0x1389e3-0x0;var _0x3f6873=_0x4e06[_0x1389e3];return _0x3f6873;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=['save',_0x64e0('0x0'),_0x64e0('0x1')];function createListener(_0x211de0,_0x337bac){return function(_0x563838){_0x337bac[_0x64e0('0x2')](_0x211de0,_0x563838);};}function removeListener(_0x233e56,_0x14406e){return function(){WhatsappAccountEvents[_0x64e0('0x3')](_0x233e56,_0x14406e);};}exports[_0x64e0('0x4')]=function(_0x54fd8d){for(var _0x877e91=0x0,_0x50c7b7=events[_0x64e0('0x5')];_0x877e91<_0x50c7b7;_0x877e91++){var _0x3e3e7f=events[_0x877e91];var _0x36d839=createListener(_0x64e0('0x6')+_0x3e3e7f,_0x54fd8d);WhatsappAccountEvents['on'](_0x3e3e7f,_0x36d839);}};
\ No newline at end of file
index f598a4c..f0626fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40da=['index','show','create','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller','get','isAuthenticated'];(function(_0x560249,_0x237eda){var _0x19b813=function(_0x37ab1f){while(--_0x37ab1f){_0x560249['push'](_0x560249['shift']());}};_0x19b813(++_0x237eda);}(_0x40da,0x15e));var _0xa40d=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x40da[_0x1928c9];return _0x51b5fb;};'use strict';var multer=require(_0xa40d('0x0'));var util=require(_0xa40d('0x1'));var path=require('path');var timeout=require(_0xa40d('0x2'));var express=require(_0xa40d('0x3'));var router=express[_0xa40d('0x4')]();var fs_extra=require(_0xa40d('0x5'));var auth=require(_0xa40d('0x6'));var interaction=require(_0xa40d('0x7'));var config=require('../../config/environment');var controller=require(_0xa40d('0x8'));router[_0xa40d('0x9')]('/',auth[_0xa40d('0xa')](),controller[_0xa40d('0xb')]);router[_0xa40d('0x9')]('/:id',auth[_0xa40d('0xa')](),controller[_0xa40d('0xc')]);router['post']('/',auth[_0xa40d('0xa')](),controller[_0xa40d('0xd')]);router[_0xa40d('0xe')](_0xa40d('0xf'),auth[_0xa40d('0xa')](),controller['update']);router[_0xa40d('0x10')]('/:id',auth[_0xa40d('0xa')](),controller[_0xa40d('0x11')]);module[_0xa40d('0x12')]=router;
\ No newline at end of file
+var _0x7dd8=['show','post','create','/:id','update','destroy','exports','multer','util','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7dd8,0xbd));var _0x87dd=function(_0x2a453b,_0x479c50){_0x2a453b=_0x2a453b-0x0;var _0x132f79=_0x7dd8[_0x2a453b];return _0x132f79;};'use strict';var multer=require(_0x87dd('0x0'));var util=require(_0x87dd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x87dd('0x2'));var auth=require(_0x87dd('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x87dd('0x4'));var controller=require('./whatsappApplication.controller');router[_0x87dd('0x5')]('/',auth[_0x87dd('0x6')](),controller['index']);router[_0x87dd('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x87dd('0x7')]);router[_0x87dd('0x8')]('/',auth[_0x87dd('0x6')](),controller[_0x87dd('0x9')]);router['put'](_0x87dd('0xa'),auth[_0x87dd('0x6')](),controller[_0x87dd('0xb')]);router['delete'](_0x87dd('0xa'),auth[_0x87dd('0x6')](),controller[_0x87dd('0xc')]);module[_0x87dd('0xd')]=router;
\ No newline at end of file
index 0a16062..bb4ca8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c20=['INTEGER','STRING','noop','TEXT','sequelize'];(function(_0x16a07b,_0x5ae039){var _0x2e00b6=function(_0x30454e){while(--_0x30454e){_0x16a07b['push'](_0x16a07b['shift']());}};_0x2e00b6(++_0x5ae039);}(_0x7c20,0xcc));var _0x07c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c20[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x07c2('0x0'));module['exports']={'priority':{'type':Sequelize[_0x07c2('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x07c2('0x2')],'allowNull':![],'defaultValue':_0x07c2('0x3')},'appdata':{'type':Sequelize[_0x07c2('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x07c2('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xa1d9=['exports','STRING','noop','*,*,*,*','sequelize'];(function(_0x322413,_0x2250cc){var _0x3ffabc=function(_0x18476d){while(--_0x18476d){_0x322413['push'](_0x322413['shift']());}};_0x3ffabc(++_0x2250cc);}(_0xa1d9,0x153));var _0x9a1d=function(_0xc056a0,_0x520912){_0xc056a0=_0xc056a0-0x0;var _0x3b6780=_0xa1d9[_0xc056a0];return _0x3b6780;};'use strict';var Sequelize=require(_0x9a1d('0x0'));module[_0x9a1d('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x9a1d('0x2')],'allowNull':![],'defaultValue':_0x9a1d('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9a1d('0x2')]},'interval':{'type':Sequelize[_0x9a1d('0x2')],'defaultValue':_0x9a1d('0x4')}};
\ No newline at end of file
index 0ab23d9..95b41ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3646=['sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../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','reject','save','update','destroy','stack','name','send','WhatsappApplication','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','filter','VIRTUAL','options','then','includeAll','include','rows','catch','show','params','merge','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path'];(function(_0x2053ea,_0x1ab2d4){var _0x2232c4=function(_0x4230df){while(--_0x4230df){_0x2053ea['push'](_0x2053ea['shift']());}};_0x2232c4(++_0x1ab2d4);}(_0x3646,0x15f));var _0x6364=function(_0x49dbb6,_0x49aaa2){_0x49dbb6=_0x49dbb6-0x0;var _0x3028f1=_0x3646[_0x49dbb6];return _0x3028f1;};'use strict';var emlformat=require(_0x6364('0x0'));var rimraf=require(_0x6364('0x1'));var zipdir=require(_0x6364('0x2'));var jsonpatch=require(_0x6364('0x3'));var rp=require('request-promise');var moment=require(_0x6364('0x4'));var BPromise=require(_0x6364('0x5'));var Mustache=require(_0x6364('0x6'));var util=require(_0x6364('0x7'));var path=require(_0x6364('0x8'));var sox=require(_0x6364('0x9'));var csv=require(_0x6364('0xa'));var ejs=require(_0x6364('0xb'));var fs=require('fs');var fs_extra=require(_0x6364('0xc'));var _=require(_0x6364('0xd'));var squel=require(_0x6364('0xe'));var crypto=require('crypto');var jsforce=require(_0x6364('0xf'));var deskjs=require(_0x6364('0x10'));var toCsv=require(_0x6364('0xa'));var querystring=require(_0x6364('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6364('0x12'));var as=require(_0x6364('0x13'));var hardwareService=require(_0x6364('0x14'));var logger=require(_0x6364('0x15'))(_0x6364('0x16'));var utils=require(_0x6364('0x17'));var config=require(_0x6364('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6364('0x19'))['db'];function respondWithStatusCode(_0x366907,_0x3af977){_0x3af977=_0x3af977||0xcc;return function(_0x4fa2f3){if(_0x4fa2f3){return _0x366907[_0x6364('0x1a')](_0x3af977);}return _0x366907[_0x6364('0x1b')](_0x3af977)[_0x6364('0x1c')]();};}function respondWithResult(_0x35ade7,_0x5d309e){_0x5d309e=_0x5d309e||0xc8;return function(_0x1f9fd4){if(_0x1f9fd4){return _0x35ade7['status'](_0x5d309e)[_0x6364('0x1d')](_0x1f9fd4);}};}function respondWithFilteredResult(_0x22c9ad,_0x147a5b){return function(_0x56ca03){if(_0x56ca03){var _0x2cfaa8=typeof _0x147a5b[_0x6364('0x1e')]===_0x6364('0x1f')&&typeof _0x147a5b[_0x6364('0x20')]===_0x6364('0x1f');var _0x1ce965=_0x56ca03[_0x6364('0x21')];var _0x4c9c0a=_0x2cfaa8?0x0:_0x147a5b[_0x6364('0x1e')];var _0x52a942=_0x2cfaa8?_0x56ca03[_0x6364('0x21')]:_0x147a5b[_0x6364('0x1e')]+_0x147a5b[_0x6364('0x20')];var _0xb91255;if(_0x52a942>=_0x1ce965){_0x52a942=_0x1ce965;_0xb91255=0xc8;}else{_0xb91255=0xce;}_0x22c9ad[_0x6364('0x1b')](_0xb91255);return _0x22c9ad['set'](_0x6364('0x22'),_0x4c9c0a+'-'+_0x52a942+'/'+_0x1ce965)[_0x6364('0x1d')](_0x56ca03);}return null;};}function patchUpdates(_0x5f42fb){return function(_0x365f7d){try{jsonpatch['apply'](_0x365f7d,_0x5f42fb,!![]);}catch(_0xadbc82){return BPromise[_0x6364('0x23')](_0xadbc82);}return _0x365f7d[_0x6364('0x24')]();};}function saveUpdates(_0x32c924,_0x39f06d){return function(_0x37a540){if(_0x37a540){return _0x37a540[_0x6364('0x25')](_0x32c924)['then'](function(_0x12abc0){return _0x12abc0;});}return null;};}function removeEntity(_0x4c425f,_0x37b360){return function(_0x58eed8){if(_0x58eed8){return _0x58eed8[_0x6364('0x26')]()['then'](function(){_0x4c425f[_0x6364('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32c3e8,_0x2115d8){return function(_0x4028d8){if(!_0x4028d8){_0x32c3e8['sendStatus'](0x194);}return _0x4028d8;};}function handleError(_0x1d9530,_0x548ef2){_0x548ef2=_0x548ef2||0x1f4;return function(_0x267ed9){logger['error'](_0x267ed9[_0x6364('0x27')]);if(_0x267ed9['name']){delete _0x267ed9[_0x6364('0x28')];}_0x1d9530[_0x6364('0x1b')](_0x548ef2)[_0x6364('0x29')](_0x267ed9);};}exports['index']=function(_0xd879a7,_0x1e40ff){var _0x265106={},_0x487945={},_0xd39469={'count':0x0,'rows':[]};var _0x109d6f=_['map'](db[_0x6364('0x2a')][_0x6364('0x2b')],function(_0x2f9c58){return{'name':_0x2f9c58[_0x6364('0x2c')],'type':_0x2f9c58[_0x6364('0x2d')][_0x6364('0x2e')]};});_0x487945[_0x6364('0x2f')]=_[_0x6364('0x30')](_0x109d6f,'name');_0x487945[_0x6364('0x31')]=_[_0x6364('0x32')](_0xd879a7[_0x6364('0x31')]);_0x487945[_0x6364('0x33')]=_['intersection'](_0x487945[_0x6364('0x2f')],_0x487945[_0x6364('0x31')]);_0x265106[_0x6364('0x34')]=_[_0x6364('0x35')](_0x487945[_0x6364('0x2f')],qs[_0x6364('0x36')](_0xd879a7[_0x6364('0x31')]['fields']));_0x265106[_0x6364('0x34')]=_0x265106[_0x6364('0x34')][_0x6364('0x37')]?_0x265106[_0x6364('0x34')]:_0x487945[_0x6364('0x2f')];if(!_0xd879a7[_0x6364('0x31')]['hasOwnProperty'](_0x6364('0x38'))){_0x265106[_0x6364('0x20')]=qs['limit'](_0xd879a7[_0x6364('0x31')]['limit']);_0x265106[_0x6364('0x1e')]=qs[_0x6364('0x1e')](_0xd879a7[_0x6364('0x31')][_0x6364('0x1e')]);}_0x265106[_0x6364('0x39')]=qs[_0x6364('0x3a')](_0xd879a7[_0x6364('0x31')]['sort']);_0x265106['where']=qs['filters'](_['pick'](_0xd879a7['query'],_0x487945[_0x6364('0x33')]),_0x109d6f);if(_0xd879a7[_0x6364('0x31')][_0x6364('0x3b')]){_0x265106['where']=_['merge'](_0x265106['where'],{'$or':_[_0x6364('0x30')](_0x109d6f,function(_0x2ddf7f){if(_0x2ddf7f[_0x6364('0x2d')]!==_0x6364('0x3c')){var _0x268211={};_0x268211[_0x2ddf7f[_0x6364('0x28')]]={'$like':'%'+_0xd879a7['query'][_0x6364('0x3b')]+'%'};return _0x268211;}})});}_0x265106=_['merge']({},_0x265106,_0xd879a7[_0x6364('0x3d')]);var _0x341582={'where':_0x265106['where']};return db[_0x6364('0x2a')][_0x6364('0x21')](_0x341582)[_0x6364('0x3e')](function(_0x42f6e6){_0xd39469['count']=_0x42f6e6;if(_0xd879a7[_0x6364('0x31')][_0x6364('0x3f')]){_0x265106[_0x6364('0x40')]=[{'all':!![]}];}return db['WhatsappApplication']['findAll'](_0x265106);})['then'](function(_0x57c4a8){_0xd39469[_0x6364('0x41')]=_0x57c4a8;return _0xd39469;})['then'](respondWithFilteredResult(_0x1e40ff,_0x265106))[_0x6364('0x42')](handleError(_0x1e40ff,null));};exports[_0x6364('0x43')]=function(_0x1e453b,_0xc2f182){var _0x5a6764={'raw':!![],'where':{'id':_0x1e453b[_0x6364('0x44')]['id']}},_0x5ce383={};_0x5ce383[_0x6364('0x2f')]=_[_0x6364('0x32')](db[_0x6364('0x2a')]['rawAttributes']);_0x5ce383[_0x6364('0x31')]=_['keys'](_0x1e453b['query']);_0x5ce383['filters']=_[_0x6364('0x35')](_0x5ce383[_0x6364('0x2f')],_0x5ce383[_0x6364('0x31')]);_0x5a6764[_0x6364('0x34')]=_[_0x6364('0x35')](_0x5ce383[_0x6364('0x2f')],qs[_0x6364('0x36')](_0x1e453b[_0x6364('0x31')][_0x6364('0x36')]));_0x5a6764[_0x6364('0x34')]=_0x5a6764['attributes']['length']?_0x5a6764[_0x6364('0x34')]:_0x5ce383[_0x6364('0x2f')];if(_0x1e453b[_0x6364('0x31')]['includeAll']){_0x5a6764[_0x6364('0x40')]=[{'all':!![]}];}_0x5a6764=_[_0x6364('0x45')]({},_0x5a6764,_0x1e453b['options']);return db[_0x6364('0x2a')]['find'](_0x5a6764)[_0x6364('0x3e')](handleEntityNotFound(_0xc2f182,null))['then'](respondWithResult(_0xc2f182,null))['catch'](handleError(_0xc2f182,null));};exports['create']=function(_0x462efe,_0x37353c){return db[_0x6364('0x2a')][_0x6364('0x46')](_0x462efe[_0x6364('0x47')],{})['then'](respondWithResult(_0x37353c,0xc9))[_0x6364('0x42')](handleError(_0x37353c,null));};exports[_0x6364('0x25')]=function(_0x2adbca,_0x2f4653){if(_0x2adbca[_0x6364('0x47')]['id']){delete _0x2adbca[_0x6364('0x47')]['id'];}return db['WhatsappApplication']['find']({'where':{'id':_0x2adbca[_0x6364('0x44')]['id']}})[_0x6364('0x3e')](handleEntityNotFound(_0x2f4653,null))[_0x6364('0x3e')](saveUpdates(_0x2adbca[_0x6364('0x47')],null))[_0x6364('0x3e')](respondWithResult(_0x2f4653,null))[_0x6364('0x42')](handleError(_0x2f4653,null));};exports['destroy']=function(_0x84d4ec,_0x499589){return db[_0x6364('0x2a')]['find']({'where':{'id':_0x84d4ec[_0x6364('0x44')]['id']}})[_0x6364('0x3e')](handleEntityNotFound(_0x499589,null))['then'](removeEntity(_0x499589,null))[_0x6364('0x42')](handleError(_0x499589,null));};
\ No newline at end of file
+var _0x8921=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','status','error','stack','name','index','WhatsappApplication','rawAttributes','fieldName','type','key','model','map','filters','intersection','attributes','fields','query','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','catch','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x8921,0x9a));var _0x1892=function(_0x30dc9e,_0x43c901){_0x30dc9e=_0x30dc9e-0x0;var _0x37f54b=_0x8921[_0x30dc9e];return _0x37f54b;};'use strict';var emlformat=require(_0x1892('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1892('0x1'));var jsonpatch=require(_0x1892('0x2'));var rp=require(_0x1892('0x3'));var moment=require(_0x1892('0x4'));var BPromise=require(_0x1892('0x5'));var Mustache=require(_0x1892('0x6'));var util=require(_0x1892('0x7'));var path=require(_0x1892('0x8'));var sox=require(_0x1892('0x9'));var csv=require(_0x1892('0xa'));var ejs=require(_0x1892('0xb'));var fs=require('fs');var fs_extra=require(_0x1892('0xc'));var _=require('lodash');var squel=require(_0x1892('0xd'));var crypto=require(_0x1892('0xe'));var jsforce=require(_0x1892('0xf'));var deskjs=require(_0x1892('0x10'));var toCsv=require(_0x1892('0xa'));var querystring=require(_0x1892('0x11'));var Papa=require('papaparse');var Redis=require(_0x1892('0x12'));var authService=require(_0x1892('0x13'));var qs=require(_0x1892('0x14'));var as=require(_0x1892('0x15'));var hardwareService=require(_0x1892('0x16'));var logger=require(_0x1892('0x17'))(_0x1892('0x18'));var utils=require(_0x1892('0x19'));var config=require(_0x1892('0x1a'));var licenseUtil=require(_0x1892('0x1b'));var db=require(_0x1892('0x1c'))['db'];function respondWithStatusCode(_0x5b8534,_0x9437fc){_0x9437fc=_0x9437fc||0xcc;return function(_0x3eec77){if(_0x3eec77){return _0x5b8534[_0x1892('0x1d')](_0x9437fc);}return _0x5b8534['status'](_0x9437fc)[_0x1892('0x1e')]();};}function respondWithResult(_0xeb57f7,_0xdfdecf){_0xdfdecf=_0xdfdecf||0xc8;return function(_0xf11b26){if(_0xf11b26){return _0xeb57f7['status'](_0xdfdecf)['json'](_0xf11b26);}};}function respondWithFilteredResult(_0x934968,_0x4b15ec){return function(_0x1fafe1){if(_0x1fafe1){var _0x4b3757=typeof _0x4b15ec[_0x1892('0x1f')]===_0x1892('0x20')&&typeof _0x4b15ec[_0x1892('0x21')]===_0x1892('0x20');var _0x27cfc7=_0x1fafe1['count'];var _0x5d28fc=_0x4b3757?0x0:_0x4b15ec[_0x1892('0x1f')];var _0x49937d=_0x4b3757?_0x1fafe1[_0x1892('0x22')]:_0x4b15ec['offset']+_0x4b15ec[_0x1892('0x21')];var _0x148da7;if(_0x49937d>=_0x27cfc7){_0x49937d=_0x27cfc7;_0x148da7=0xc8;}else{_0x148da7=0xce;}_0x934968['status'](_0x148da7);return _0x934968[_0x1892('0x23')](_0x1892('0x24'),_0x5d28fc+'-'+_0x49937d+'/'+_0x27cfc7)[_0x1892('0x25')](_0x1fafe1);}return null;};}function patchUpdates(_0xf4d237){return function(_0x55b410){try{jsonpatch['apply'](_0x55b410,_0xf4d237,!![]);}catch(_0x48b59c){return BPromise[_0x1892('0x26')](_0x48b59c);}return _0x55b410[_0x1892('0x27')]();};}function saveUpdates(_0x48ca15,_0xa9a3e0){return function(_0x8fd69a){if(_0x8fd69a){return _0x8fd69a[_0x1892('0x28')](_0x48ca15)[_0x1892('0x29')](function(_0x53e3bf){return _0x53e3bf;});}return null;};}function removeEntity(_0xff60d4,_0x3d7da3){return function(_0x2fc141){if(_0x2fc141){return _0x2fc141[_0x1892('0x2a')]()['then'](function(){_0xff60d4[_0x1892('0x2b')](0xcc)[_0x1892('0x1e')]();});}};}function handleEntityNotFound(_0x25cd30,_0x38aac3){return function(_0x296c45){if(!_0x296c45){_0x25cd30[_0x1892('0x1d')](0x194);}return _0x296c45;};}function handleError(_0x8b09dc,_0x42c3cd){_0x42c3cd=_0x42c3cd||0x1f4;return function(_0x3b6628){logger[_0x1892('0x2c')](_0x3b6628[_0x1892('0x2d')]);if(_0x3b6628['name']){delete _0x3b6628[_0x1892('0x2e')];}_0x8b09dc[_0x1892('0x2b')](_0x42c3cd)['send'](_0x3b6628);};}exports[_0x1892('0x2f')]=function(_0x480848,_0x23098b){var _0x1ca4db={},_0x1ed528={},_0x416794={'count':0x0,'rows':[]};var _0x823674=_['map'](db[_0x1892('0x30')][_0x1892('0x31')],function(_0x2e0657){return{'name':_0x2e0657[_0x1892('0x32')],'type':_0x2e0657[_0x1892('0x33')][_0x1892('0x34')]};});_0x1ed528[_0x1892('0x35')]=_[_0x1892('0x36')](_0x823674,_0x1892('0x2e'));_0x1ed528['query']=_['keys'](_0x480848['query']);_0x1ed528[_0x1892('0x37')]=_[_0x1892('0x38')](_0x1ed528['model'],_0x1ed528['query']);_0x1ca4db[_0x1892('0x39')]=_[_0x1892('0x38')](_0x1ed528['model'],qs[_0x1892('0x3a')](_0x480848[_0x1892('0x3b')][_0x1892('0x3a')]));_0x1ca4db[_0x1892('0x39')]=_0x1ca4db['attributes'][_0x1892('0x3c')]?_0x1ca4db[_0x1892('0x39')]:_0x1ed528['model'];if(!_0x480848[_0x1892('0x3b')]['hasOwnProperty']('nolimit')){_0x1ca4db[_0x1892('0x21')]=qs[_0x1892('0x21')](_0x480848['query'][_0x1892('0x21')]);_0x1ca4db[_0x1892('0x1f')]=qs[_0x1892('0x1f')](_0x480848[_0x1892('0x3b')][_0x1892('0x1f')]);}_0x1ca4db[_0x1892('0x3d')]=qs[_0x1892('0x3e')](_0x480848[_0x1892('0x3b')][_0x1892('0x3e')]);_0x1ca4db[_0x1892('0x3f')]=qs['filters'](_[_0x1892('0x40')](_0x480848[_0x1892('0x3b')],_0x1ed528[_0x1892('0x37')]),_0x823674);if(_0x480848['query'][_0x1892('0x41')]){_0x1ca4db[_0x1892('0x3f')]=_[_0x1892('0x42')](_0x1ca4db[_0x1892('0x3f')],{'$or':_['map'](_0x823674,function(_0x1f0f47){if(_0x1f0f47[_0x1892('0x33')]!==_0x1892('0x43')){var _0x2208ba={};_0x2208ba[_0x1f0f47[_0x1892('0x2e')]]={'$like':'%'+_0x480848[_0x1892('0x3b')][_0x1892('0x41')]+'%'};return _0x2208ba;}})});}_0x1ca4db=_[_0x1892('0x42')]({},_0x1ca4db,_0x480848[_0x1892('0x44')]);var _0x3cb36f={'where':_0x1ca4db[_0x1892('0x3f')]};return db['WhatsappApplication'][_0x1892('0x22')](_0x3cb36f)[_0x1892('0x29')](function(_0x118bfb){_0x416794[_0x1892('0x22')]=_0x118bfb;if(_0x480848[_0x1892('0x3b')][_0x1892('0x45')]){_0x1ca4db[_0x1892('0x46')]=[{'all':!![]}];}return db[_0x1892('0x30')][_0x1892('0x47')](_0x1ca4db);})[_0x1892('0x29')](function(_0x2ded54){_0x416794[_0x1892('0x48')]=_0x2ded54;return _0x416794;})['then'](respondWithFilteredResult(_0x23098b,_0x1ca4db))['catch'](handleError(_0x23098b,null));};exports['show']=function(_0x5e55ea,_0x53a7cc){var _0x17b833={'raw':!![],'where':{'id':_0x5e55ea[_0x1892('0x49')]['id']}},_0x4c0261={};_0x4c0261['model']=_[_0x1892('0x4a')](db[_0x1892('0x30')][_0x1892('0x31')]);_0x4c0261[_0x1892('0x3b')]=_[_0x1892('0x4a')](_0x5e55ea[_0x1892('0x3b')]);_0x4c0261[_0x1892('0x37')]=_[_0x1892('0x38')](_0x4c0261[_0x1892('0x35')],_0x4c0261[_0x1892('0x3b')]);_0x17b833[_0x1892('0x39')]=_[_0x1892('0x38')](_0x4c0261[_0x1892('0x35')],qs['fields'](_0x5e55ea[_0x1892('0x3b')]['fields']));_0x17b833['attributes']=_0x17b833[_0x1892('0x39')]['length']?_0x17b833[_0x1892('0x39')]:_0x4c0261[_0x1892('0x35')];if(_0x5e55ea[_0x1892('0x3b')][_0x1892('0x45')]){_0x17b833['include']=[{'all':!![]}];}_0x17b833=_['merge']({},_0x17b833,_0x5e55ea[_0x1892('0x44')]);return db[_0x1892('0x30')]['find'](_0x17b833)[_0x1892('0x29')](handleEntityNotFound(_0x53a7cc,null))['then'](respondWithResult(_0x53a7cc,null))[_0x1892('0x4b')](handleError(_0x53a7cc,null));};exports[_0x1892('0x4c')]=function(_0x117ec2,_0x150612){return db[_0x1892('0x30')]['create'](_0x117ec2[_0x1892('0x4d')],{})['then'](respondWithResult(_0x150612,0xc9))['catch'](handleError(_0x150612,null));};exports[_0x1892('0x28')]=function(_0x137533,_0x12555f){if(_0x137533[_0x1892('0x4d')]['id']){delete _0x137533[_0x1892('0x4d')]['id'];}return db[_0x1892('0x30')][_0x1892('0x4e')]({'where':{'id':_0x137533['params']['id']}})[_0x1892('0x29')](handleEntityNotFound(_0x12555f,null))[_0x1892('0x29')](saveUpdates(_0x137533[_0x1892('0x4d')],null))[_0x1892('0x29')](respondWithResult(_0x12555f,null))[_0x1892('0x4b')](handleError(_0x12555f,null));};exports[_0x1892('0x2a')]=function(_0x5366cf,_0x428c08){return db['WhatsappApplication'][_0x1892('0x4e')]({'where':{'id':_0x5366cf[_0x1892('0x49')]['id']}})['then'](handleEntityNotFound(_0x428c08,null))[_0x1892('0x29')](removeEntity(_0x428c08,null))[_0x1892('0x4b')](handleError(_0x428c08,null));};
\ No newline at end of file
index a4dd4f4..6e03d66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3be=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4'];(function(_0x18cac4,_0x57a4d5){var _0x2227c6=function(_0x72934d){while(--_0x72934d){_0x18cac4['push'](_0x18cac4['shift']());}};_0x2227c6(++_0x57a4d5);}(_0xf3be,0x1e1));var _0xef3b=function(_0x386997,_0x2914e2){_0x386997=_0x386997-0x0;var _0x99d69f=_0xf3be[_0x386997];return _0x99d69f;};'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':!![],'charset':_0xef3b('0xa'),'collate':_0xef3b('0xb')});};
\ No newline at end of file
+var _0xf5a7=['../../config/environment','./whatsappApplication.attributes','exports','define','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x557283,_0x1941db){var _0x200200=function(_0x5cb2b2){while(--_0x5cb2b2){_0x557283['push'](_0x557283['shift']());}};_0x200200(++_0x1941db);}(_0xf5a7,0x133));var _0x7f5a=function(_0x3c1874,_0x13fef7){_0x3c1874=_0x3c1874-0x0;var _0x55fcbd=_0xf5a7[_0x3c1874];return _0x55fcbd;};'use strict';var _=require(_0x7f5a('0x0'));var util=require(_0x7f5a('0x1'));var logger=require('../../config/logger')(_0x7f5a('0x2'));var moment=require(_0x7f5a('0x3'));var BPromise=require(_0x7f5a('0x4'));var rp=require(_0x7f5a('0x5'));var fs=require('fs');var path=require(_0x7f5a('0x6'));var rimraf=require(_0x7f5a('0x7'));var config=require(_0x7f5a('0x8'));var attributes=require(_0x7f5a('0x9'));module[_0x7f5a('0xa')]=function(_0x520bf9,_0x2808f2){return _0x520bf9[_0x7f5a('0xb')]('WhatsappApplication',attributes,{'tableName':_0x7f5a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7f5a('0xd'),'collate':_0x7f5a('0xe')});};
\ No newline at end of file
index e24feb8..ae85693 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','WhatsappApplication,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x457456,_0x3b3078){var _0x4a8cc4=function(_0x22cdf9){while(--_0x22cdf9){_0x457456['push'](_0x457456['shift']());}};_0x4a8cc4(++_0x3b3078);}(_0x3e74,0x175));var _0x43e7=function(_0x2db89b,_0x169dd3){_0x2db89b=_0x2db89b-0x0;var _0x129331=_0x3e74[_0x2db89b];return _0x129331;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}
\ No newline at end of file
+var _0x54ef=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0xdb95c2,_0x1c0ac4){var _0x38d69d=function(_0x10f0c4){while(--_0x10f0c4){_0xdb95c2['push'](_0xdb95c2['shift']());}};_0x38d69d(++_0x1c0ac4);}(_0x54ef,0x112));var _0xf54e=function(_0x1d1932,_0xaf723f){_0x1d1932=_0x1d1932-0x0;var _0x22b7dc=_0x54ef[_0x1d1932];return _0x22b7dc;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf54e('0x3'));var fs=require('fs');var Redis=require(_0xf54e('0x4'));var db=require(_0xf54e('0x5'))['db'];var utils=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var config=require(_0xf54e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x99cf9,_0x2464ae,_0x561870){return new BPromise(function(_0x27e69b,_0x57a1ce){return client[_0xf54e('0xb')](_0x99cf9,_0x561870)[_0xf54e('0xc')](function(_0x47c5e1){logger[_0xf54e('0xd')](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));logger[_0xf54e('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x2464ae,_0xf54e('0xf'),JSON[_0xf54e('0x11')](_0x47c5e1));if(_0x47c5e1[_0xf54e('0x12')]){if(_0x47c5e1[_0xf54e('0x12')]['code']===0x1f4){logger[_0xf54e('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x2464ae,_0x47c5e1['error'][_0xf54e('0x13')]);return _0x57a1ce(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}logger[_0xf54e('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x2464ae,_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);return _0x27e69b(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}else{logger['info'](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));_0x27e69b(_0x47c5e1[_0xf54e('0x14')]['message']);}})['catch'](function(_0xd87020){logger[_0xf54e('0x12')](_0xf54e('0xe'),_0x2464ae,_0xd87020);_0x57a1ce(_0xd87020);});});}
\ No newline at end of file
index b88729e..098a95b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3248=['/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','get','/describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','whatsapp','addTags','put','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy'];(function(_0x2055b9,_0x11a7cd){var _0x5249e3=function(_0x287f1e){while(--_0x287f1e){_0x2055b9['push'](_0x2055b9['shift']());}};_0x5249e3(++_0x11a7cd);}(_0x3248,0x1b0));var _0x8324=function(_0x3f7a44,_0x26deb6){_0x3f7a44=_0x3f7a44-0x0;var _0x444af5=_0x3248[_0x3f7a44];return _0x444af5;};'use strict';var multer=require(_0x8324('0x0'));var util=require(_0x8324('0x1'));var path=require(_0x8324('0x2'));var timeout=require(_0x8324('0x3'));var express=require(_0x8324('0x4'));var router=express[_0x8324('0x5')]();var fs_extra=require(_0x8324('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8324('0x7'));var controller=require(_0x8324('0x8'));router['get']('/',auth[_0x8324('0x9')](),controller[_0x8324('0xa')]);router[_0x8324('0xb')](_0x8324('0xc'),auth[_0x8324('0x9')](),controller['describe']);router[_0x8324('0xb')](_0x8324('0xd'),auth[_0x8324('0x9')](),controller['show']);router['get'](_0x8324('0xe'),auth[_0x8324('0x9')](),controller[_0x8324('0xf')]);router['get'](_0x8324('0x10'),auth[_0x8324('0x9')](),controller[_0x8324('0x11')]);router[_0x8324('0x12')]('/',auth[_0x8324('0x9')](),controller[_0x8324('0x13')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0x8324('0x14')]);router['post']('/:id/tags',auth[_0x8324('0x9')](),interaction[_0x8324('0x15')](_0x8324('0x16'),'whatsappinteraction:addtags'),controller[_0x8324('0x17')]);router[_0x8324('0x18')](_0x8324('0xd'),auth['isAuthenticated'](),interaction[_0x8324('0x15')](_0x8324('0x16'),_0x8324('0x19')),controller[_0x8324('0x1a')]);router[_0x8324('0x1b')](_0x8324('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0x8324('0x16'),_0x8324('0x1c')),controller[_0x8324('0x1d')]);router['delete'](_0x8324('0x1e'),auth[_0x8324('0x9')](),controller[_0x8324('0x1f')]);module[_0x8324('0x20')]=router;
\ No newline at end of file
+var _0x84e7=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','describe','/:id','show','getMessages','/:id/download','post','create','/:id/messages','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','update','delete','whatsappinteraction:destroy','/:id/tags','removeTags','exports'];(function(_0x452eab,_0x4a3832){var _0x32277a=function(_0x1b1f15){while(--_0x1b1f15){_0x452eab['push'](_0x452eab['shift']());}};_0x32277a(++_0x4a3832);}(_0x84e7,0x122));var _0x784e=function(_0x3d7382,_0xa335dd){_0x3d7382=_0x3d7382-0x0;var _0x2ce821=_0x84e7[_0x3d7382];return _0x2ce821;};'use strict';var multer=require('multer');var util=require(_0x784e('0x0'));var path=require(_0x784e('0x1'));var timeout=require('connect-timeout');var express=require(_0x784e('0x2'));var router=express[_0x784e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x784e('0x4'));var interaction=require(_0x784e('0x5'));var config=require(_0x784e('0x6'));var controller=require(_0x784e('0x7'));router[_0x784e('0x8')]('/',auth[_0x784e('0x9')](),controller['index']);router[_0x784e('0x8')]('/describe',auth[_0x784e('0x9')](),controller[_0x784e('0xa')]);router['get'](_0x784e('0xb'),auth[_0x784e('0x9')](),controller[_0x784e('0xc')]);router[_0x784e('0x8')]('/:id/messages',auth['isAuthenticated'](),controller[_0x784e('0xd')]);router[_0x784e('0x8')](_0x784e('0xe'),auth[_0x784e('0x9')](),controller['download']);router[_0x784e('0xf')]('/',auth[_0x784e('0x9')](),controller[_0x784e('0x10')]);router[_0x784e('0xf')](_0x784e('0x11'),auth[_0x784e('0x9')](),controller['addMessage']);router[_0x784e('0xf')]('/:id/tags',auth[_0x784e('0x9')](),interaction[_0x784e('0x12')](_0x784e('0x13'),_0x784e('0x14')),controller[_0x784e('0x15')]);router[_0x784e('0x16')](_0x784e('0xb'),auth[_0x784e('0x9')](),interaction[_0x784e('0x12')]('whatsapp','whatsappinteraction:update'),controller[_0x784e('0x17')]);router[_0x784e('0x18')](_0x784e('0xb'),auth[_0x784e('0x9')](),interaction[_0x784e('0x12')](_0x784e('0x13'),_0x784e('0x19')),controller['destroy']);router[_0x784e('0x18')](_0x784e('0x1a'),auth[_0x784e('0x9')](),controller[_0x784e('0x1b')]);module[_0x784e('0x1c')]=router;
\ No newline at end of file
index 28e20e3..b531b8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b69=['DATE','out','BOOLEAN','sequelize','moment','exports','STRING','ENUM'];(function(_0x2d4da8,_0x5ae0d6){var _0x2f9401=function(_0x30783f){while(--_0x30783f){_0x2d4da8['push'](_0x2d4da8['shift']());}};_0x2f9401(++_0x5ae0d6);}(_0x9b69,0xa3));var _0x99b6=function(_0xcbb425,_0x117e46){_0xcbb425=_0xcbb425-0x0;var _0x7158fe=_0x9b69[_0xcbb425];return _0x7158fe;};'use strict';var Sequelize=require(_0x99b6('0x0'));var moment=require(_0x99b6('0x1'));module[_0x99b6('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x99b6('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x99b6('0x3')]},'note':{'type':Sequelize[_0x99b6('0x3')]},'phone':{'type':Sequelize[_0x99b6('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x99b6('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x99b6('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x99b6('0x4')]('in',_0x99b6('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x99b6('0x7')],'defaultValue':![]}};
\ No newline at end of file
+var _0x8ba0=['moment','exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x8ba0,0x1c7));var _0x08ba=function(_0x5b6650,_0x26e0a9){_0x5b6650=_0x5b6650-0x0;var _0x340509=_0x8ba0[_0x5b6650];return _0x340509;};'use strict';var Sequelize=require(_0x08ba('0x0'));var moment=require(_0x08ba('0x1'));module[_0x08ba('0x2')]={'closed':{'type':Sequelize[_0x08ba('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x08ba('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x08ba('0x5')]},'note':{'type':Sequelize[_0x08ba('0x5')]},'phone':{'type':Sequelize[_0x08ba('0x5')]},'read1stAt':{'type':Sequelize[_0x08ba('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x08ba('0x6')]('in',_0x08ba('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x08ba('0x6')]('in',_0x08ba('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x08ba('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 2d67d38..a1d40b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb683=['User','fullname','CmContact','Contact','lastName','Attachment','direction','secret','read','WhatsappAccount','Account','Owner','N.A.','createdAt','closed','closedAt','disposition','basename','existsSync','createReadStream','createWriteStream','firstName','out','value','renderFile','transcript-','.pdf','Whatsapp','createPdfFromHTML','err','unlinkSync','zip-dir','moment','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','update','destroy','then','error','stack','name','map','rawAttributes','fieldName','type','key','getOptions','findAll','whatsapp','user','catch','show','params','model','keys','WhatsappInteraction','query','filters','intersection','attributes','fields','length','include','merge','options','find','create','body','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','hasOwnProperty','nolimit','sort','where','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','omit','spread','color','whatsappInteractionTags:save','removeTags','download','unix','toString','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','push'];(function(_0x8c125c,_0x1c1ccb){var _0x56cf5b=function(_0x29daf3){while(--_0x29daf3){_0x8c125c['push'](_0x8c125c['shift']());}};_0x56cf5b(++_0x1c1ccb);}(_0xb683,0x199));var _0x3b68=function(_0x14ec9d,_0x45d283){_0x14ec9d=_0x14ec9d-0x0;var _0x3636df=_0xb683[_0x14ec9d];return _0x3636df;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x3b68('0x0'));var moment=require(_0x3b68('0x1'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x3b68('0x2'));var ejs=require(_0x3b68('0x3'));var fs=require('fs');var _=require(_0x3b68('0x4'));var Redis=require(_0x3b68('0x5'));var interaction=require(_0x3b68('0x6'));var qs=require(_0x3b68('0x7'));var pdf=require(_0x3b68('0x8'));var logger=require(_0x3b68('0x9'))(_0x3b68('0xa'));var config=require('../../config/environment');var db=require(_0x3b68('0xb'))['db'];config[_0x3b68('0xc')]=_['defaults'](config[_0x3b68('0xc')],{'host':_0x3b68('0xd'),'port':0x18eb});var socket=require(_0x3b68('0xe'))(new Redis(config[_0x3b68('0xc')]));require(_0x3b68('0xf'))[_0x3b68('0x10')](socket);function respondWithStatusCode(_0x35846f,_0x560b38){_0x560b38=_0x560b38||0xcc;return function(_0x580071){if(_0x580071){return _0x35846f[_0x3b68('0x11')](_0x560b38);}return _0x35846f['status'](_0x560b38)[_0x3b68('0x12')]();};}function respondWithResult(_0x5db161,_0x597821){_0x597821=_0x597821||0xc8;return function(_0x2219e9){if(_0x2219e9){return _0x5db161[_0x3b68('0x13')](_0x597821)['json'](_0x2219e9);}};}function respondWithFilteredResult(_0x1d3e52,_0x3ced7e){return function(_0x45a468){if(_0x45a468){var _0x4b27aa=typeof _0x3ced7e[_0x3b68('0x14')]==='undefined'&&typeof _0x3ced7e[_0x3b68('0x15')]===_0x3b68('0x16');var _0x2a8901=_0x45a468['count'];var _0x423731=_0x4b27aa?0x0:_0x3ced7e['offset'];var _0x32af3b=_0x4b27aa?_0x45a468[_0x3b68('0x17')]:_0x3ced7e[_0x3b68('0x14')]+_0x3ced7e[_0x3b68('0x15')];var _0x17fb70;if(_0x32af3b>=_0x2a8901){_0x32af3b=_0x2a8901;_0x17fb70=0xc8;}else{_0x17fb70=0xce;}_0x1d3e52['status'](_0x17fb70);return _0x1d3e52[_0x3b68('0x18')](_0x3b68('0x19'),_0x423731+'-'+_0x32af3b+'/'+_0x2a8901)[_0x3b68('0x1a')](_0x45a468);}return null;};}function saveUpdates(_0x5921d2){return function(_0x6eb892){if(_0x6eb892){return _0x6eb892[_0x3b68('0x1b')](_0x5921d2)['then'](function(_0x21d4d6){return _0x21d4d6;});}return null;};}function removeEntity(_0x3b3397){return function(_0x375b4e){if(_0x375b4e){return _0x375b4e[_0x3b68('0x1c')]()[_0x3b68('0x1d')](function(){_0x3b3397[_0x3b68('0x13')](0xcc)[_0x3b68('0x12')]();});}};}function handleEntityNotFound(_0x22df95){return function(_0x489407){if(!_0x489407){_0x22df95[_0x3b68('0x11')](0x194);}return _0x489407;};}function handleError(_0x11d070,_0x4f1acc){_0x4f1acc=_0x4f1acc||0x1f4;return function(_0x2556ec){logger[_0x3b68('0x1e')](_0x2556ec[_0x3b68('0x1f')]);if(_0x2556ec['name']){delete _0x2556ec[_0x3b68('0x20')];}_0x11d070[_0x3b68('0x13')](_0x4f1acc)['send'](_0x2556ec);};}exports['index']=function(_0x2f02a6,_0x39ad07){var _0x43b55e={};var _0x39f98a=_[_0x3b68('0x21')](db['WhatsappInteraction'][_0x3b68('0x22')],function(_0x388008){return{'name':_0x388008[_0x3b68('0x23')],'type':_0x388008[_0x3b68('0x24')][_0x3b68('0x25')]};});_0x43b55e=qs[_0x3b68('0x26')](_0x39f98a,_0x2f02a6);return interaction[_0x3b68('0x27')](_0x3b68('0x28'),_0x2f02a6['query'],_0x2f02a6[_0x3b68('0x29')],_0x43b55e,_0x39f98a)[_0x3b68('0x1d')](respondWithFilteredResult(_0x39ad07,_0x43b55e))[_0x3b68('0x2a')](handleError(_0x39ad07,null));};exports[_0x3b68('0x2b')]=function(_0x5b87f3,_0x2d63f7){var _0x16bf67={'raw':![],'where':{'id':_0x5b87f3[_0x3b68('0x2c')]['id']}},_0x19f355={};_0x19f355[_0x3b68('0x2d')]=_[_0x3b68('0x2e')](db[_0x3b68('0x2f')]['rawAttributes']);_0x19f355['query']=_[_0x3b68('0x2e')](_0x5b87f3[_0x3b68('0x30')]);_0x19f355[_0x3b68('0x31')]=_[_0x3b68('0x32')](_0x19f355[_0x3b68('0x2d')],_0x19f355[_0x3b68('0x30')]);_0x16bf67[_0x3b68('0x33')]=_[_0x3b68('0x32')](_0x19f355['model'],qs['fields'](_0x5b87f3['query'][_0x3b68('0x34')]));_0x16bf67['attributes']=_0x16bf67['attributes'][_0x3b68('0x35')]?_0x16bf67[_0x3b68('0x33')]:_0x19f355[_0x3b68('0x2d')];if(_0x5b87f3[_0x3b68('0x30')]['includeAll']){_0x16bf67[_0x3b68('0x36')]=[{'all':!![]}];}_0x16bf67=_[_0x3b68('0x37')]({},_0x16bf67,_0x5b87f3[_0x3b68('0x38')]);return db['WhatsappInteraction'][_0x3b68('0x39')](_0x16bf67)[_0x3b68('0x1d')](handleEntityNotFound(_0x2d63f7,null))[_0x3b68('0x1d')](respondWithResult(_0x2d63f7,null))[_0x3b68('0x2a')](handleError(_0x2d63f7,null));};exports[_0x3b68('0x3a')]=function(_0x487044,_0x1eb86d){return db[_0x3b68('0x2f')][_0x3b68('0x3a')](_0x487044[_0x3b68('0x3b')],{})['then'](respondWithResult(_0x1eb86d,0xc9))['catch'](handleError(_0x1eb86d,null));};exports['update']=function(_0x3e2bea,_0x284da8){if(_0x3e2bea['body']['id']){delete _0x3e2bea[_0x3b68('0x3b')]['id'];}return db[_0x3b68('0x2f')]['find']({'where':{'id':_0x3e2bea['params']['id']}})[_0x3b68('0x1d')](handleEntityNotFound(_0x284da8,null))[_0x3b68('0x1d')](saveUpdates(_0x3e2bea[_0x3b68('0x3b')],null))['then'](respondWithResult(_0x284da8,null))[_0x3b68('0x2a')](handleError(_0x284da8,null));};exports[_0x3b68('0x1c')]=function(_0x2d815c,_0x25a552){return db['WhatsappInteraction']['find']({'where':{'id':_0x2d815c['params']['id']}})[_0x3b68('0x1d')](handleEntityNotFound(_0x25a552,null))['then'](removeEntity(_0x25a552,null))[_0x3b68('0x2a')](handleError(_0x25a552,null));};exports['describe']=function(_0x4ecf53,_0x269eaa){return db[_0x3b68('0x2f')][_0x3b68('0x3c')]()['then'](respondWithResult(_0x269eaa,null))[_0x3b68('0x2a')](handleError(_0x269eaa,null));};exports[_0x3b68('0x3d')]=function(_0x4e9668,_0x4d6216){return db[_0x3b68('0x3e')][_0x3b68('0x39')]({'where':{'id':_0x4e9668[_0x3b68('0x2c')]['id']}})[_0x3b68('0x1d')](handleEntityNotFound(_0x4d6216,null))[_0x3b68('0x1d')](function(_0x3b9e11){if(_0x3b9e11){return _0x3b9e11[_0x3b68('0x3d')](_0x4e9668[_0x3b68('0x3b')][_0x3b68('0x3f')],_['omit'](_0x4e9668['body'],['ids','id'])||{});}})[_0x3b68('0x1d')](respondWithResult(_0x4d6216,null))[_0x3b68('0x2a')](handleError(_0x4d6216,null));};exports[_0x3b68('0x40')]=function(_0x1a6363,_0xcecab1){var _0x5eec3a={'raw':![],'where':{}};var _0xa58608={};var _0x29a6c8={'count':0x0,'rows':[]};return db[_0x3b68('0x2f')][_0x3b68('0x41')]({'where':{'id':_0x1a6363['params']['id']}})[_0x3b68('0x1d')](handleEntityNotFound(_0xcecab1,null))[_0x3b68('0x1d')](function(_0x38e3e0){if(_0x38e3e0){_0xa58608[_0x3b68('0x2d')]=_[_0x3b68('0x2e')](db[_0x3b68('0x3e')]['rawAttributes']);_0xa58608[_0x3b68('0x30')]=_[_0x3b68('0x2e')](_0x1a6363[_0x3b68('0x30')]);_0xa58608[_0x3b68('0x31')]=_['intersection'](_0xa58608[_0x3b68('0x2d')],_0xa58608[_0x3b68('0x30')]);_0x5eec3a['attributes']=_[_0x3b68('0x32')](_0xa58608[_0x3b68('0x2d')],qs[_0x3b68('0x34')](_0x1a6363[_0x3b68('0x30')][_0x3b68('0x34')]));_0x5eec3a[_0x3b68('0x33')]=_0x5eec3a[_0x3b68('0x33')][_0x3b68('0x35')]?_0x5eec3a[_0x3b68('0x33')]:_0xa58608[_0x3b68('0x2d')];if(!_0x1a6363[_0x3b68('0x30')][_0x3b68('0x42')](_0x3b68('0x43'))){_0x5eec3a[_0x3b68('0x15')]=qs['limit'](_0x1a6363[_0x3b68('0x30')]['limit']);_0x5eec3a[_0x3b68('0x14')]=qs[_0x3b68('0x14')](_0x1a6363[_0x3b68('0x30')][_0x3b68('0x14')]);}_0x5eec3a['order']=qs[_0x3b68('0x44')](_0x1a6363[_0x3b68('0x30')]['sort']);_0x5eec3a[_0x3b68('0x45')]=qs[_0x3b68('0x31')](_[_0x3b68('0x46')](_0x1a6363['query'],_0xa58608['filters']));_0x5eec3a[_0x3b68('0x45')]['WhatsappInteractionId']=_0x38e3e0['id'];if(_0x1a6363[_0x3b68('0x30')][_0x3b68('0x47')]){_0x5eec3a[_0x3b68('0x45')]=_[_0x3b68('0x37')](_0x5eec3a[_0x3b68('0x45')],{'$or':_[_0x3b68('0x21')](_0x5eec3a[_0x3b68('0x33')],function(_0xd24c65){var _0x406e5a={};_0x406e5a[_0xd24c65]={'$like':'%'+_0x1a6363[_0x3b68('0x30')]['filter']+'%'};return _0x406e5a;})});}if(_0x1a6363[_0x3b68('0x30')]['$gte']){var _0x1d4957=_0x1a6363['query'][_0x3b68('0x48')][_0x3b68('0x49')](',');var _0x268a9d={};_0x268a9d[_0x1d4957[0x0]]={'$gte':moment(_0x1d4957[0x1])[_0x3b68('0x4a')](_0x3b68('0x4b'))};_0x5eec3a['where']=_[_0x3b68('0x37')](_0x5eec3a[_0x3b68('0x45')],_0x268a9d);}_0x5eec3a=_['merge']({},_0x5eec3a,_0x1a6363[_0x3b68('0x38')]);return db[_0x3b68('0x3e')][_0x3b68('0x17')]({'where':_0x5eec3a[_0x3b68('0x45')]})[_0x3b68('0x1d')](function(_0xf477a5){_0x29a6c8['count']=_0xf477a5;if(_0x1a6363[_0x3b68('0x30')][_0x3b68('0x4c')]){_0x5eec3a['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0x3b68('0x27')](_0x5eec3a);})['then'](function(_0x2f0c07){_0x29a6c8[_0x3b68('0x4d')]=_0x2f0c07;return _0x29a6c8;});}})[_0x3b68('0x1d')](respondWithFilteredResult(_0xcecab1,_0x5eec3a))['catch'](handleError(_0xcecab1,null));};exports[_0x3b68('0x4e')]=function(_0x2da56f,_0x4da507){return db[_0x3b68('0x2f')][_0x3b68('0x39')]({'where':{'id':_0x2da56f[_0x3b68('0x2c')]['id']}})[_0x3b68('0x1d')](handleEntityNotFound(_0x4da507,null))[_0x3b68('0x1d')](function(_0x278961){if(_0x278961){return _0x278961['setTags'](_0x2da56f[_0x3b68('0x3b')][_0x3b68('0x3f')],_[_0x3b68('0x4f')](_0x2da56f['body'],['ids','id'])||{})[_0x3b68('0x50')](function(){return db['Tag'][_0x3b68('0x27')]({'attributes':['id','name',_0x3b68('0x51')],'where':{'id':_0x2da56f[_0x3b68('0x3b')][_0x3b68('0x3f')]}});})[_0x3b68('0x1d')](function(_0x230d40){socket['emit'](_0x3b68('0x52'),{'id':Number(_0x2da56f[_0x3b68('0x2c')]['id']),'tags':_0x230d40||[]});return{'id':Number(_0x2da56f['params']['id']),'tags':_0x230d40||[]};});}})[_0x3b68('0x1d')](respondWithResult(_0x4da507,null))[_0x3b68('0x2a')](handleError(_0x4da507,null));};exports['removeTags']=function(_0xd68ed7,_0x195433){return db[_0x3b68('0x2f')][_0x3b68('0x39')]({'where':{'id':_0xd68ed7[_0x3b68('0x2c')]['id']}})[_0x3b68('0x1d')](handleEntityNotFound(_0x195433,null))['then'](function(_0x5c3840){if(_0x5c3840){return _0x5c3840[_0x3b68('0x53')](_0xd68ed7[_0x3b68('0x30')]['ids']);}})[_0x3b68('0x1d')](respondWithStatusCode(_0x195433,null))['catch'](handleError(_0x195433,null));};exports[_0x3b68('0x54')]=function(_0x12ae83,_0x1357cd){var _0x2a157f=moment()[_0x3b68('0x55')]()[_0x3b68('0x56')]();var _0x2d5e42=path[_0x3b68('0x57')](config[_0x3b68('0x58')],'server',_0x3b68('0x59'),_0x3b68('0x5a'));var _0x4576f3=path['join'](config[_0x3b68('0x58')],_0x3b68('0x5b'),'files',_0x3b68('0x5c'));var _0x1be45c=path[_0x3b68('0x57')](_0x2d5e42,_0x2a157f);var _0x35a2df=util['format'](_0x3b68('0x5d'),_0x12ae83[_0x3b68('0x2c')]['id'],_0x2a157f);var _0x2f9c0d=path[_0x3b68('0x57')](_0x2d5e42,_0x35a2df);var _0x23b946=[];_0x23b946[_0x3b68('0x5e')]({'model':db[_0x3b68('0x5f')],'as':_0x3b68('0x5f'),'attributes':['id',_0x3b68('0x60')],'raw':!![]});_0x23b946[_0x3b68('0x5e')]({'model':db[_0x3b68('0x61')],'as':_0x3b68('0x62'),'attributes':['id','firstName',_0x3b68('0x63')],'raw':!![]});if(_0x12ae83[_0x3b68('0x30')][_0x3b68('0x5c')]){_0x23b946[_0x3b68('0x5e')]({'model':db[_0x3b68('0x64')],'as':'Attachment','raw':!![]});}var _0x27bcc3=[{'model':db[_0x3b68('0x3e')],'as':'Messages','attributes':['id',_0x3b68('0x3b'),'createdAt',_0x3b68('0x65'),_0x3b68('0x66'),_0x3b68('0x67')],'include':_0x23b946}];_0x27bcc3['push']({'model':db[_0x3b68('0x68')],'as':_0x3b68('0x69'),'attributes':['id',_0x3b68('0x20')]});_0x27bcc3[_0x3b68('0x5e')]({'model':db['User'],'as':_0x3b68('0x6a'),'attributes':['id',_0x3b68('0x60')]});return db[_0x3b68('0x2f')]['find']({'where':{'id':_0x12ae83[_0x3b68('0x2c')]['id']},'include':_0x27bcc3})[_0x3b68('0x1d')](handleEntityNotFound(_0x1357cd,null))[_0x3b68('0x1d')](function(_0x21affa){if(_0x21affa){var _0x5a41eb=_0x21affa['get']({'plain':!![]});fs['mkdirSync'](_0x1be45c);var _0x4409b7={'channel':'Whatsapp','account':_0x5a41eb[_0x3b68('0x69')][_0x3b68('0x20')],'agent':_0x5a41eb['Owner']?_0x5a41eb['Owner']['fullname']:_0x3b68('0x6b'),'createdAt':moment(_0x5a41eb[_0x3b68('0x6c')])[_0x3b68('0x4a')](_0x3b68('0x4b'))[_0x3b68('0x56')](),'closedAt':_0x5a41eb[_0x3b68('0x6d')]?moment(_0x5a41eb[_0x3b68('0x6e')])['format'](_0x3b68('0x4b'))[_0x3b68('0x56')]():'','disposition':_0x5a41eb[_0x3b68('0x6f')],'messages':_(_0x5a41eb['Messages'])[_0x3b68('0x47')]({'secret':![]})[_0x3b68('0x21')](function(_0x4f2d28){if(_0x4f2d28[_0x3b68('0x64')]){var _0x2fb77f=path[_0x3b68('0x57')](_0x4576f3,_0x4f2d28['Attachment'][_0x3b68('0x70')]);if(fs[_0x3b68('0x71')](_0x2fb77f)){fs[_0x3b68('0x72')](_0x2fb77f)['pipe'](fs[_0x3b68('0x73')](path[_0x3b68('0x57')](_0x1be45c,_0x4f2d28[_0x3b68('0x64')][_0x3b68('0x70')])));}}return{'date':moment(_0x4f2d28[_0x3b68('0x6c')])[_0x3b68('0x4a')](_0x3b68('0x4b'))[_0x3b68('0x56')](),'sender':_0x4f2d28[_0x3b68('0x65')]==='out'?_0x4f2d28[_0x3b68('0x5f')]?_0x4f2d28['User'][_0x3b68('0x60')]:'System':_0x4f2d28['Contact'][_0x3b68('0x74')]+(_0x4f2d28[_0x3b68('0x62')][_0x3b68('0x63')]?'\x20'+_0x4f2d28[_0x3b68('0x62')][_0x3b68('0x63')]:''),'body':_0x4f2d28[_0x3b68('0x64')]?_0x4f2d28[_0x3b68('0x64')][_0x3b68('0x70')]:_0x4f2d28[_0x3b68('0x3b')],'direction':_0x4f2d28[_0x3b68('0x65')]===_0x3b68('0x75')?'A':'C','secret':_0x4f2d28[_0x3b68('0x66')],'read':_0x4f2d28[_0x3b68('0x67')],'attachment':_0x4f2d28[_0x3b68('0x64')]};})[_0x3b68('0x76')]()};return ejs[_0x3b68('0x77')](path[_0x3b68('0x57')](config[_0x3b68('0x58')],_0x3b68('0x5b'),'views','downloadInteraction.ejs'),{'interaction':_0x4409b7})[_0x3b68('0x1d')](function(_0x1f2da9){var _0x5d83be=path[_0x3b68('0x57')](_0x1be45c,_0x3b68('0x78')+_0x5a41eb['id']+'-'+_0x2a157f+_0x3b68('0x79'));var _0x816784={'path':_0x5d83be,'channel':_0x3b68('0x7a'),'interactionId':_0x5a41eb['id']};return pdf[_0x3b68('0x7b')](_0x1f2da9,_0x816784);})[_0x3b68('0x1d')](function(){return new BPromise(function(_0xb7b856,_0x1bd204){zipdir(_0x1be45c,{'saveTo':_0x2f9c0d},function(_0x20e4ef,_0x13665f){if(_0x20e4ef)return _0x1bd204(_0x20e4ef);return _0xb7b856(_0x13665f);});})[_0x3b68('0x1d')](function(){return new BPromise(function(_0x3f91a1,_0x3410cd){rimraf(_0x1be45c,function(_0x4b6c7f){if(_0x4b6c7f)_0x3410cd(_0x4b6c7f);return _0x3f91a1();});});})[_0x3b68('0x1d')](function(){return _0x1357cd[_0x3b68('0x54')](_0x2f9c0d,_0x35a2df,function(_0x255035){if(_0x255035){console['log'](_0x3b68('0x7c'),_0x255035);}else{fs[_0x3b68('0x7d')](_0x2f9c0d);}});});});}else{return _0x1357cd[_0x3b68('0x11')](0xc8);}})[_0x3b68('0x2a')](handleError(_0x1357cd,null));};
\ No newline at end of file
+var _0xba87=['redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','name','send','index','WhatsappInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','whatsapp','query','user','params','keys','attributes','intersection','model','fields','includeAll','include','options','catch','create','body','find','ids','omit','getMessages','findOne','WhatsappMessage','filters','length','hasOwnProperty','order','sort','pick','where','WhatsappInteractionId','filter','merge','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','addTags','spread','color','removeTags','download','toString','join','root','server','files','push','User','CmContact','Contact','firstName','attachments','Attachment','Messages','secret','read','WhatsappAccount','Owner','fullname','get','Account','createdAt','closed','basename','existsSync','createReadStream','direction','out','System','lastName','value','renderFile','views','downloadInteraction.ejs','.pdf','Whatsapp','createPdfFromHTML','err','unlinkSync','rimraf','moment','bluebird','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment'];(function(_0x120da6,_0x15f450){var _0x3d6c07=function(_0x5acddd){while(--_0x5acddd){_0x120da6['push'](_0x120da6['shift']());}};_0x3d6c07(++_0x15f450);}(_0xba87,0xe1));var _0x7ba8=function(_0x5013bd,_0x4d4b8d){_0x5013bd=_0x5013bd-0x0;var _0x5d3e13=_0xba87[_0x5013bd];return _0x5d3e13;};'use strict';var rimraf=require(_0x7ba8('0x0'));var zipdir=require('zip-dir');var moment=require(_0x7ba8('0x1'));var BPromise=require(_0x7ba8('0x2'));var util=require(_0x7ba8('0x3'));var path=require(_0x7ba8('0x4'));var ejs=require(_0x7ba8('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x7ba8('0x6'));var interaction=require(_0x7ba8('0x7'));var qs=require(_0x7ba8('0x8'));var pdf=require(_0x7ba8('0x9'));var logger=require(_0x7ba8('0xa'))(_0x7ba8('0xb'));var config=require(_0x7ba8('0xc'));var db=require('../../mysqldb')['db'];config[_0x7ba8('0xd')]=_[_0x7ba8('0xe')](config[_0x7ba8('0xd')],{'host':_0x7ba8('0xf'),'port':0x18eb});var socket=require(_0x7ba8('0x10'))(new Redis(config['redis']));require('./whatsappInteraction.socket')['register'](socket);function respondWithStatusCode(_0x3da1f6,_0x58d5c8){_0x58d5c8=_0x58d5c8||0xcc;return function(_0x3466e3){if(_0x3466e3){return _0x3da1f6[_0x7ba8('0x11')](_0x58d5c8);}return _0x3da1f6[_0x7ba8('0x12')](_0x58d5c8)[_0x7ba8('0x13')]();};}function respondWithResult(_0x57b8fc,_0x1cb319){_0x1cb319=_0x1cb319||0xc8;return function(_0x2cd2c9){if(_0x2cd2c9){return _0x57b8fc[_0x7ba8('0x12')](_0x1cb319)[_0x7ba8('0x14')](_0x2cd2c9);}};}function respondWithFilteredResult(_0x5a5c40,_0x117079){return function(_0x57499f){if(_0x57499f){var _0x4b510f=typeof _0x117079[_0x7ba8('0x15')]===_0x7ba8('0x16')&&typeof _0x117079[_0x7ba8('0x17')]===_0x7ba8('0x16');var _0x54e2c4=_0x57499f['count'];var _0x2447b9=_0x4b510f?0x0:_0x117079['offset'];var _0x45d421=_0x4b510f?_0x57499f[_0x7ba8('0x18')]:_0x117079[_0x7ba8('0x15')]+_0x117079[_0x7ba8('0x17')];var _0x4dfefa;if(_0x45d421>=_0x54e2c4){_0x45d421=_0x54e2c4;_0x4dfefa=0xc8;}else{_0x4dfefa=0xce;}_0x5a5c40[_0x7ba8('0x12')](_0x4dfefa);return _0x5a5c40[_0x7ba8('0x19')](_0x7ba8('0x1a'),_0x2447b9+'-'+_0x45d421+'/'+_0x54e2c4)[_0x7ba8('0x14')](_0x57499f);}return null;};}function saveUpdates(_0x3061fc){return function(_0x52a898){if(_0x52a898){return _0x52a898[_0x7ba8('0x1b')](_0x3061fc)[_0x7ba8('0x1c')](function(_0x42e1a9){return _0x42e1a9;});}return null;};}function removeEntity(_0x1a2ca7){return function(_0x259eb9){if(_0x259eb9){return _0x259eb9[_0x7ba8('0x1d')]()[_0x7ba8('0x1c')](function(){_0x1a2ca7[_0x7ba8('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55c276){return function(_0xf469b6){if(!_0xf469b6){_0x55c276[_0x7ba8('0x11')](0x194);}return _0xf469b6;};}function handleError(_0x1b196d,_0x8c8f08){_0x8c8f08=_0x8c8f08||0x1f4;return function(_0x2abe5e){logger['error'](_0x2abe5e['stack']);if(_0x2abe5e['name']){delete _0x2abe5e[_0x7ba8('0x1e')];}_0x1b196d['status'](_0x8c8f08)[_0x7ba8('0x1f')](_0x2abe5e);};}exports[_0x7ba8('0x20')]=function(_0x12166a,_0x4d98bf){var _0x1f3fe9={};var _0x159283=_['map'](db[_0x7ba8('0x21')][_0x7ba8('0x22')],function(_0x45a2d9){return{'name':_0x45a2d9[_0x7ba8('0x23')],'type':_0x45a2d9[_0x7ba8('0x24')][_0x7ba8('0x25')]};});_0x1f3fe9=qs[_0x7ba8('0x26')](_0x159283,_0x12166a);return interaction[_0x7ba8('0x27')](_0x7ba8('0x28'),_0x12166a[_0x7ba8('0x29')],_0x12166a[_0x7ba8('0x2a')],_0x1f3fe9,_0x159283)[_0x7ba8('0x1c')](respondWithFilteredResult(_0x4d98bf,_0x1f3fe9))['catch'](handleError(_0x4d98bf,null));};exports['show']=function(_0x1a2321,_0x142b80){var _0x3455ec={'raw':![],'where':{'id':_0x1a2321[_0x7ba8('0x2b')]['id']}},_0x132d0c={};_0x132d0c['model']=_[_0x7ba8('0x2c')](db[_0x7ba8('0x21')][_0x7ba8('0x22')]);_0x132d0c[_0x7ba8('0x29')]=_['keys'](_0x1a2321[_0x7ba8('0x29')]);_0x132d0c['filters']=_['intersection'](_0x132d0c['model'],_0x132d0c['query']);_0x3455ec[_0x7ba8('0x2d')]=_[_0x7ba8('0x2e')](_0x132d0c[_0x7ba8('0x2f')],qs[_0x7ba8('0x30')](_0x1a2321[_0x7ba8('0x29')][_0x7ba8('0x30')]));_0x3455ec[_0x7ba8('0x2d')]=_0x3455ec['attributes']['length']?_0x3455ec['attributes']:_0x132d0c[_0x7ba8('0x2f')];if(_0x1a2321[_0x7ba8('0x29')][_0x7ba8('0x31')]){_0x3455ec[_0x7ba8('0x32')]=[{'all':!![]}];}_0x3455ec=_['merge']({},_0x3455ec,_0x1a2321[_0x7ba8('0x33')]);return db['WhatsappInteraction']['find'](_0x3455ec)['then'](handleEntityNotFound(_0x142b80,null))[_0x7ba8('0x1c')](respondWithResult(_0x142b80,null))[_0x7ba8('0x34')](handleError(_0x142b80,null));};exports['create']=function(_0x579f1b,_0x3f72d8){return db[_0x7ba8('0x21')][_0x7ba8('0x35')](_0x579f1b[_0x7ba8('0x36')],{})[_0x7ba8('0x1c')](respondWithResult(_0x3f72d8,0xc9))[_0x7ba8('0x34')](handleError(_0x3f72d8,null));};exports[_0x7ba8('0x1b')]=function(_0x4a967e,_0xeb628c){if(_0x4a967e[_0x7ba8('0x36')]['id']){delete _0x4a967e['body']['id'];}return db[_0x7ba8('0x21')][_0x7ba8('0x37')]({'where':{'id':_0x4a967e[_0x7ba8('0x2b')]['id']}})['then'](handleEntityNotFound(_0xeb628c,null))['then'](saveUpdates(_0x4a967e['body'],null))[_0x7ba8('0x1c')](respondWithResult(_0xeb628c,null))[_0x7ba8('0x34')](handleError(_0xeb628c,null));};exports[_0x7ba8('0x1d')]=function(_0x338774,_0x50a8e7){return db[_0x7ba8('0x21')]['find']({'where':{'id':_0x338774[_0x7ba8('0x2b')]['id']}})[_0x7ba8('0x1c')](handleEntityNotFound(_0x50a8e7,null))[_0x7ba8('0x1c')](removeEntity(_0x50a8e7,null))[_0x7ba8('0x34')](handleError(_0x50a8e7,null));};exports['describe']=function(_0x2c4cea,_0x39d357){return db[_0x7ba8('0x21')]['describe']()[_0x7ba8('0x1c')](respondWithResult(_0x39d357,null))['catch'](handleError(_0x39d357,null));};exports['addMessage']=function(_0x975ce8,_0x188d8d){return db['WhatsappMessage'][_0x7ba8('0x37')]({'where':{'id':_0x975ce8[_0x7ba8('0x2b')]['id']}})['then'](handleEntityNotFound(_0x188d8d,null))['then'](function(_0x47cad3){if(_0x47cad3){return _0x47cad3['addMessage'](_0x975ce8[_0x7ba8('0x36')][_0x7ba8('0x38')],_[_0x7ba8('0x39')](_0x975ce8['body'],['ids','id'])||{});}})[_0x7ba8('0x1c')](respondWithResult(_0x188d8d,null))[_0x7ba8('0x34')](handleError(_0x188d8d,null));};exports[_0x7ba8('0x3a')]=function(_0x46c873,_0x47bbc1){var _0x2a3700={'raw':![],'where':{}};var _0x11ba17={};var _0x4cde26={'count':0x0,'rows':[]};return db[_0x7ba8('0x21')][_0x7ba8('0x3b')]({'where':{'id':_0x46c873[_0x7ba8('0x2b')]['id']}})[_0x7ba8('0x1c')](handleEntityNotFound(_0x47bbc1,null))['then'](function(_0x1ed1a5){if(_0x1ed1a5){_0x11ba17['model']=_[_0x7ba8('0x2c')](db[_0x7ba8('0x3c')]['rawAttributes']);_0x11ba17['query']=_[_0x7ba8('0x2c')](_0x46c873[_0x7ba8('0x29')]);_0x11ba17[_0x7ba8('0x3d')]=_['intersection'](_0x11ba17[_0x7ba8('0x2f')],_0x11ba17[_0x7ba8('0x29')]);_0x2a3700[_0x7ba8('0x2d')]=_[_0x7ba8('0x2e')](_0x11ba17[_0x7ba8('0x2f')],qs[_0x7ba8('0x30')](_0x46c873[_0x7ba8('0x29')][_0x7ba8('0x30')]));_0x2a3700[_0x7ba8('0x2d')]=_0x2a3700['attributes'][_0x7ba8('0x3e')]?_0x2a3700[_0x7ba8('0x2d')]:_0x11ba17[_0x7ba8('0x2f')];if(!_0x46c873[_0x7ba8('0x29')][_0x7ba8('0x3f')]('nolimit')){_0x2a3700['limit']=qs[_0x7ba8('0x17')](_0x46c873[_0x7ba8('0x29')][_0x7ba8('0x17')]);_0x2a3700[_0x7ba8('0x15')]=qs[_0x7ba8('0x15')](_0x46c873[_0x7ba8('0x29')][_0x7ba8('0x15')]);}_0x2a3700[_0x7ba8('0x40')]=qs[_0x7ba8('0x41')](_0x46c873['query'][_0x7ba8('0x41')]);_0x2a3700['where']=qs[_0x7ba8('0x3d')](_[_0x7ba8('0x42')](_0x46c873[_0x7ba8('0x29')],_0x11ba17[_0x7ba8('0x3d')]));_0x2a3700[_0x7ba8('0x43')][_0x7ba8('0x44')]=_0x1ed1a5['id'];if(_0x46c873[_0x7ba8('0x29')][_0x7ba8('0x45')]){_0x2a3700[_0x7ba8('0x43')]=_[_0x7ba8('0x46')](_0x2a3700[_0x7ba8('0x43')],{'$or':_[_0x7ba8('0x47')](_0x2a3700[_0x7ba8('0x2d')],function(_0x583ff4){var _0x3a4233={};_0x3a4233[_0x583ff4]={'$like':'%'+_0x46c873['query']['filter']+'%'};return _0x3a4233;})});}if(_0x46c873[_0x7ba8('0x29')][_0x7ba8('0x48')]){var _0x1811b0=_0x46c873[_0x7ba8('0x29')][_0x7ba8('0x48')][_0x7ba8('0x49')](',');var _0x5e3f72={};_0x5e3f72[_0x1811b0[0x0]]={'$gte':moment(_0x1811b0[0x1])[_0x7ba8('0x4a')](_0x7ba8('0x4b'))};_0x2a3700[_0x7ba8('0x43')]=_[_0x7ba8('0x46')](_0x2a3700[_0x7ba8('0x43')],_0x5e3f72);}_0x2a3700=_['merge']({},_0x2a3700,_0x46c873[_0x7ba8('0x33')]);return db[_0x7ba8('0x3c')][_0x7ba8('0x18')]({'where':_0x2a3700[_0x7ba8('0x43')]})['then'](function(_0x4bcc83){_0x4cde26[_0x7ba8('0x18')]=_0x4bcc83;if(_0x46c873[_0x7ba8('0x29')][_0x7ba8('0x31')]){_0x2a3700['include']=[{'all':!![]}];}return db[_0x7ba8('0x3c')][_0x7ba8('0x27')](_0x2a3700);})[_0x7ba8('0x1c')](function(_0x39bb8a){_0x4cde26['rows']=_0x39bb8a;return _0x4cde26;});}})[_0x7ba8('0x1c')](respondWithFilteredResult(_0x47bbc1,_0x2a3700))[_0x7ba8('0x34')](handleError(_0x47bbc1,null));};exports[_0x7ba8('0x4c')]=function(_0x2fd351,_0x2681dc){return db['WhatsappInteraction'][_0x7ba8('0x37')]({'where':{'id':_0x2fd351['params']['id']}})[_0x7ba8('0x1c')](handleEntityNotFound(_0x2681dc,null))['then'](function(_0xda1a12){if(_0xda1a12){return _0xda1a12['setTags'](_0x2fd351[_0x7ba8('0x36')][_0x7ba8('0x38')],_[_0x7ba8('0x39')](_0x2fd351[_0x7ba8('0x36')],['ids','id'])||{})[_0x7ba8('0x4d')](function(){return db['Tag']['findAll']({'attributes':['id','name',_0x7ba8('0x4e')],'where':{'id':_0x2fd351[_0x7ba8('0x36')][_0x7ba8('0x38')]}});})[_0x7ba8('0x1c')](function(_0x10de3e){socket['emit']('whatsappInteractionTags:save',{'id':Number(_0x2fd351['params']['id']),'tags':_0x10de3e||[]});return{'id':Number(_0x2fd351[_0x7ba8('0x2b')]['id']),'tags':_0x10de3e||[]};});}})['then'](respondWithResult(_0x2681dc,null))[_0x7ba8('0x34')](handleError(_0x2681dc,null));};exports[_0x7ba8('0x4f')]=function(_0x44e4d8,_0x1a6a9d){return db['WhatsappInteraction'][_0x7ba8('0x37')]({'where':{'id':_0x44e4d8[_0x7ba8('0x2b')]['id']}})[_0x7ba8('0x1c')](handleEntityNotFound(_0x1a6a9d,null))[_0x7ba8('0x1c')](function(_0xe2ef6c){if(_0xe2ef6c){return _0xe2ef6c[_0x7ba8('0x4f')](_0x44e4d8[_0x7ba8('0x29')][_0x7ba8('0x38')]);}})[_0x7ba8('0x1c')](respondWithStatusCode(_0x1a6a9d,null))['catch'](handleError(_0x1a6a9d,null));};exports[_0x7ba8('0x50')]=function(_0x21cf53,_0x43b2c1){var _0x2447c4=moment()['unix']()[_0x7ba8('0x51')]();var _0x1ae005=path[_0x7ba8('0x52')](config[_0x7ba8('0x53')],_0x7ba8('0x54'),_0x7ba8('0x55'),'tmp');var _0x41ce72=path['join'](config[_0x7ba8('0x53')],'server',_0x7ba8('0x55'),'attachments');var _0x2cc3ac=path[_0x7ba8('0x52')](_0x1ae005,_0x2447c4);var _0x2daa57=util[_0x7ba8('0x4a')]('transcript-%d-%s.zip',_0x21cf53[_0x7ba8('0x2b')]['id'],_0x2447c4);var _0x5837b8=path[_0x7ba8('0x52')](_0x1ae005,_0x2daa57);var _0xfcc8a=[];_0xfcc8a[_0x7ba8('0x56')]({'model':db[_0x7ba8('0x57')],'as':_0x7ba8('0x57'),'attributes':['id','fullname'],'raw':!![]});_0xfcc8a['push']({'model':db[_0x7ba8('0x58')],'as':_0x7ba8('0x59'),'attributes':['id',_0x7ba8('0x5a'),'lastName'],'raw':!![]});if(_0x21cf53[_0x7ba8('0x29')][_0x7ba8('0x5b')]){_0xfcc8a[_0x7ba8('0x56')]({'model':db[_0x7ba8('0x5c')],'as':_0x7ba8('0x5c'),'raw':!![]});}var _0x31f588=[{'model':db['WhatsappMessage'],'as':_0x7ba8('0x5d'),'attributes':['id',_0x7ba8('0x36'),'createdAt','direction',_0x7ba8('0x5e'),_0x7ba8('0x5f')],'include':_0xfcc8a}];_0x31f588[_0x7ba8('0x56')]({'model':db[_0x7ba8('0x60')],'as':'Account','attributes':['id',_0x7ba8('0x1e')]});_0x31f588['push']({'model':db[_0x7ba8('0x57')],'as':_0x7ba8('0x61'),'attributes':['id',_0x7ba8('0x62')]});return db[_0x7ba8('0x21')][_0x7ba8('0x37')]({'where':{'id':_0x21cf53[_0x7ba8('0x2b')]['id']},'include':_0x31f588})[_0x7ba8('0x1c')](handleEntityNotFound(_0x43b2c1,null))[_0x7ba8('0x1c')](function(_0x59eac5){if(_0x59eac5){var _0x3bc03d=_0x59eac5[_0x7ba8('0x63')]({'plain':!![]});fs['mkdirSync'](_0x2cc3ac);var _0x40082f={'channel':'Whatsapp','account':_0x3bc03d[_0x7ba8('0x64')][_0x7ba8('0x1e')],'agent':_0x3bc03d[_0x7ba8('0x61')]?_0x3bc03d[_0x7ba8('0x61')][_0x7ba8('0x62')]:'N.A.','createdAt':moment(_0x3bc03d[_0x7ba8('0x65')])[_0x7ba8('0x4a')](_0x7ba8('0x4b'))['toString'](),'closedAt':_0x3bc03d[_0x7ba8('0x66')]?moment(_0x3bc03d['closedAt'])[_0x7ba8('0x4a')](_0x7ba8('0x4b'))['toString']():'','disposition':_0x3bc03d['disposition'],'messages':_(_0x3bc03d[_0x7ba8('0x5d')])[_0x7ba8('0x45')]({'secret':![]})[_0x7ba8('0x47')](function(_0x46dc65){if(_0x46dc65[_0x7ba8('0x5c')]){var _0xd2069b=path['join'](_0x41ce72,_0x46dc65[_0x7ba8('0x5c')][_0x7ba8('0x67')]);if(fs[_0x7ba8('0x68')](_0xd2069b)){fs[_0x7ba8('0x69')](_0xd2069b)['pipe'](fs['createWriteStream'](path[_0x7ba8('0x52')](_0x2cc3ac,_0x46dc65[_0x7ba8('0x5c')]['basename'])));}}return{'date':moment(_0x46dc65[_0x7ba8('0x65')])[_0x7ba8('0x4a')](_0x7ba8('0x4b'))[_0x7ba8('0x51')](),'sender':_0x46dc65[_0x7ba8('0x6a')]===_0x7ba8('0x6b')?_0x46dc65[_0x7ba8('0x57')]?_0x46dc65[_0x7ba8('0x57')]['fullname']:_0x7ba8('0x6c'):_0x46dc65[_0x7ba8('0x59')][_0x7ba8('0x5a')]+(_0x46dc65[_0x7ba8('0x59')][_0x7ba8('0x6d')]?'\x20'+_0x46dc65[_0x7ba8('0x59')][_0x7ba8('0x6d')]:''),'body':_0x46dc65['Attachment']?_0x46dc65[_0x7ba8('0x5c')][_0x7ba8('0x67')]:_0x46dc65[_0x7ba8('0x36')],'direction':_0x46dc65['direction']===_0x7ba8('0x6b')?'A':'C','secret':_0x46dc65[_0x7ba8('0x5e')],'read':_0x46dc65[_0x7ba8('0x5f')],'attachment':_0x46dc65[_0x7ba8('0x5c')]};})[_0x7ba8('0x6e')]()};return ejs[_0x7ba8('0x6f')](path[_0x7ba8('0x52')](config[_0x7ba8('0x53')],_0x7ba8('0x54'),_0x7ba8('0x70'),_0x7ba8('0x71')),{'interaction':_0x40082f})[_0x7ba8('0x1c')](function(_0x58c114){var _0x42b9db=path[_0x7ba8('0x52')](_0x2cc3ac,'transcript-'+_0x3bc03d['id']+'-'+_0x2447c4+_0x7ba8('0x72'));var _0x9bc654={'path':_0x42b9db,'channel':_0x7ba8('0x73'),'interactionId':_0x3bc03d['id']};return pdf[_0x7ba8('0x74')](_0x58c114,_0x9bc654);})[_0x7ba8('0x1c')](function(){return new BPromise(function(_0x54517b,_0x292401){zipdir(_0x2cc3ac,{'saveTo':_0x5837b8},function(_0x34d788,_0x5623fe){if(_0x34d788)return _0x292401(_0x34d788);return _0x54517b(_0x5623fe);});})[_0x7ba8('0x1c')](function(){return new BPromise(function(_0x5bf024,_0x121079){rimraf(_0x2cc3ac,function(_0x4b8964){if(_0x4b8964)_0x121079(_0x4b8964);return _0x5bf024();});});})[_0x7ba8('0x1c')](function(){return _0x43b2c1[_0x7ba8('0x50')](_0x5837b8,_0x2daa57,function(_0x1e15f0){if(_0x1e15f0){console['log'](_0x7ba8('0x75'),_0x1e15f0);}else{fs[_0x7ba8('0x76')](_0x5837b8);}});});});}else{return _0x43b2c1[_0x7ba8('0x11')](0xc8);}})['catch'](handleError(_0x43b2c1,null));};
\ No newline at end of file
index 6219237..287810d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2182=['events','../../mysqldb','WhatsappInteraction','setMaxListeners','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x1c9f4c,_0x45e41f){var _0x42eef6=function(_0x529977){while(--_0x529977){_0x1c9f4c['push'](_0x1c9f4c['shift']());}};_0x42eef6(++_0x45e41f);}(_0x2182,0xea));var _0x2218=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2182[_0x397e5f];return _0x5302b8;};'use strict';var EventEmitter=require(_0x2218('0x0'));var WhatsappInteraction=require(_0x2218('0x1'))['db'][_0x2218('0x2')];var WhatsappMessage=require(_0x2218('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x2218('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2218('0x4'),'afterDestroy':_0x2218('0x5')};function emitEvent(_0x3348af){return function(_0x6fd30,_0xf3271d,_0x1e2df1){_0x6fd30[_0x2218('0x6')]({'attributes':['id'],'raw':!![]})[_0x2218('0x7')](function(_0x142d1d){_0x6fd30[_0x2218('0x8')]('Users',_0x142d1d[_0x2218('0x9')](function(_0xed1f79){return{'id':_0xed1f79['id']};}));return WhatsappMessage[_0x2218('0xa')]({'where':{'WhatsappInteractionId':_0x6fd30['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2218('0x7')](function(_0x49df16){_0x6fd30[_0x2218('0x8')](_0x2218('0xb'),_0x49df16[_0x2218('0xc')]);WhatsappInteractionEvents[_0x2218('0xd')](_0x3348af+':'+_0x6fd30['id'],_0x6fd30);WhatsappInteractionEvents['emit'](_0x3348af,_0x6fd30);_0x1e2df1(null);})[_0x2218('0xe')](_0x1e2df1(null));};}for(var e in events){if(events[_0x2218('0xf')](e)){var event=events[e];WhatsappInteraction[_0x2218('0x10')](e,emitEvent(event));}}module[_0x2218('0x11')]=WhatsappInteractionEvents;
\ No newline at end of file
+var _0x6324=['WhatsappInteraction','setMaxListeners','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x564821,_0x4d037e){var _0x2b604d=function(_0x26fabf){while(--_0x26fabf){_0x564821['push'](_0x564821['shift']());}};_0x2b604d(++_0x4d037e);}(_0x6324,0x142));var _0x4632=function(_0x466611,_0x421a63){_0x466611=_0x466611-0x0;var _0x4112c4=_0x6324[_0x466611];return _0x4112c4;};'use strict';var EventEmitter=require(_0x4632('0x0'));var WhatsappInteraction=require(_0x4632('0x1'))['db'][_0x4632('0x2')];var WhatsappMessage=require(_0x4632('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x4632('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4632('0x4'),'afterDestroy':'remove'};function emitEvent(_0x13b218){return function(_0x592e39,_0x140bc7,_0x24aba6){_0x592e39[_0x4632('0x5')]({'attributes':['id'],'raw':!![]})[_0x4632('0x6')](function(_0x4a15b2){_0x592e39[_0x4632('0x7')](_0x4632('0x8'),_0x4a15b2[_0x4632('0x9')](function(_0x5a523b){return{'id':_0x5a523b['id']};}));return WhatsappMessage[_0x4632('0xa')]({'where':{'WhatsappInteractionId':_0x592e39['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4632('0x6')](function(_0x47a518){_0x592e39['setDataValue'](_0x4632('0xb'),_0x47a518[_0x4632('0xc')]);WhatsappInteractionEvents[_0x4632('0xd')](_0x13b218+':'+_0x592e39['id'],_0x592e39);WhatsappInteractionEvents[_0x4632('0xd')](_0x13b218,_0x592e39);_0x24aba6(null);})[_0x4632('0xe')](_0x24aba6(null));};}for(var e in events){if(events[_0x4632('0xf')](e)){var event=events[e];WhatsappInteraction[_0x4632('0x10')](e,emitEvent(event));}}module[_0x4632('0x11')]=WhatsappInteractionEvents;
\ No newline at end of file
index 5fd1c96..5f0e0c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78d1=['rimraf','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x86dad7,_0xe3b7c0){var _0x328095=function(_0x54fc6c){while(--_0x54fc6c){_0x86dad7['push'](_0x86dad7['shift']());}};_0x328095(++_0xe3b7c0);}(_0x78d1,0x159));var _0x178d=function(_0x2e85a3,_0x209612){_0x2e85a3=_0x2e85a3-0x0;var _0x4e5c02=_0x78d1[_0x2e85a3];return _0x4e5c02;};'use strict';var _=require(_0x178d('0x0'));var util=require(_0x178d('0x1'));var logger=require(_0x178d('0x2'))('api');var moment=require(_0x178d('0x3'));var BPromise=require(_0x178d('0x4'));var rp=require(_0x178d('0x5'));var fs=require('fs');var path=require(_0x178d('0x6'));var rimraf=require(_0x178d('0x7'));var config=require(_0x178d('0x8'));var attributes=require(_0x178d('0x9'));module['exports']=function(_0x3b2c16,_0x39b461){return _0x3b2c16[_0x178d('0xa')](_0x178d('0xb'),attributes,{'tableName':_0x178d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x343c1f,_0x3c4391,_0x59f8e3){if(_0x343c1f['changed']('closed')){_0x343c1f[_0x178d('0xd')]=moment()[_0x178d('0xe')](_0x178d('0xf'));}_0x59f8e3(null,_0x343c1f);}}});};
\ No newline at end of file
+var _0x232f=['format','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','closed','closedAt'];(function(_0x5e7759,_0x2653bc){var _0x3923f3=function(_0x265171){while(--_0x265171){_0x5e7759['push'](_0x5e7759['shift']());}};_0x3923f3(++_0x2653bc);}(_0x232f,0x7a));var _0xf232=function(_0x330414,_0x4f3207){_0x330414=_0x330414-0x0;var _0x99dbff=_0x232f[_0x330414];return _0x99dbff;};'use strict';var _=require('lodash');var util=require(_0xf232('0x0'));var logger=require(_0xf232('0x1'))('api');var moment=require(_0xf232('0x2'));var BPromise=require(_0xf232('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf232('0x4'));var config=require(_0xf232('0x5'));var attributes=require(_0xf232('0x6'));module[_0xf232('0x7')]=function(_0x393693,_0x58c523){return _0x393693['define']('WhatsappInteraction',attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1597f5,_0x39e87b,_0xc212fb){if(_0x1597f5['changed'](_0xf232('0x8'))){_0x1597f5[_0xf232('0x9')]=moment()[_0xf232('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}_0xc212fb(null,_0x1597f5);}}});};
\ No newline at end of file
index 0e49fa2..719110f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x681e=['addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','info','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappInteraction,\x20%s,\x20%s','message','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options','where','attributes','limit','then','AddTagsToWhatsappInteraction'];(function(_0x1dd4fb,_0x432f33){var _0xbb788e=function(_0x566aae){while(--_0x566aae){_0x1dd4fb['push'](_0x1dd4fb['shift']());}};_0xbb788e(++_0x432f33);}(_0x681e,0x11c));var _0xe681=function(_0x8c16e2,_0x4afe21){_0x8c16e2=_0x8c16e2-0x0;var _0x54676c=_0x681e[_0x8c16e2];return _0x54676c;};'use strict';var _=require(_0xe681('0x0'));var util=require(_0xe681('0x1'));var moment=require(_0xe681('0x2'));var BPromise=require(_0xe681('0x3'));var rs=require(_0xe681('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe681('0x5'))['db'];var utils=require(_0xe681('0x6'));var logger=require(_0xe681('0x7'))(_0xe681('0x8'));var config=require(_0xe681('0x9'));var jayson=require(_0xe681('0xa'));var client=jayson[_0xe681('0xb')][_0xe681('0xc')]({'port':0x232a});config[_0xe681('0xd')]=_['defaults'](config[_0xe681('0xd')],{'host':_0xe681('0xe'),'port':0x18eb});var socket=require(_0xe681('0xf'))(new Redis(config[_0xe681('0xd')]));require(_0xe681('0x10'))[_0xe681('0x11')](socket);function respondWithRpcPromise(_0x1418af,_0x426a91,_0x502b64){return new BPromise(function(_0x55332e,_0x6e4d3f){return client['request'](_0x1418af,_0x502b64)['then'](function(_0x3c7231){logger[_0xe681('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x426a91,_0xe681('0x13'));logger[_0xe681('0x14')](_0xe681('0x15'),_0x426a91,_0xe681('0x13'),JSON[_0xe681('0x16')](_0x3c7231));if(_0x3c7231['error']){if(_0x3c7231['error']['code']===0x1f4){logger[_0xe681('0x17')](_0xe681('0x18'),_0x426a91,_0x3c7231[_0xe681('0x17')][_0xe681('0x19')]);return _0x6e4d3f(_0x3c7231[_0xe681('0x17')][_0xe681('0x19')]);}logger[_0xe681('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x426a91,_0x3c7231[_0xe681('0x17')][_0xe681('0x19')]);return _0x55332e(_0x3c7231[_0xe681('0x17')][_0xe681('0x19')]);}else{logger[_0xe681('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x426a91,_0xe681('0x13'));_0x55332e(_0x3c7231['result'][_0xe681('0x19')]);}})[_0xe681('0x1a')](function(_0x250ffb){logger[_0xe681('0x17')](_0xe681('0x18'),_0x426a91,_0x250ffb);_0x6e4d3f(_0x250ffb);});});}exports[_0xe681('0x1b')]=function(_0x438350){var _0x32e7ae=this;return new Promise(function(_0x3379aa,_0x16e647){return db[_0xe681('0x1c')][_0xe681('0x1d')](_0x438350['body'],{'raw':_0x438350[_0xe681('0x1e')]?_0x438350['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x438350[_0xe681('0x1e')]?_0x438350[_0xe681('0x1e')][_0xe681('0x1f')]||null:null,'attributes':_0x438350[_0xe681('0x1e')]?_0x438350[_0xe681('0x1e')][_0xe681('0x20')]||null:null,'limit':_0x438350[_0xe681('0x1e')]?_0x438350[_0xe681('0x1e')][_0xe681('0x21')]||null:null})[_0xe681('0x22')](function(_0x5a1453){logger[_0xe681('0x12')](_0xe681('0x1b'),_0x438350);logger['debug'](_0xe681('0x1b'),_0x438350,JSON['stringify'](_0x5a1453));_0x3379aa(_0x5a1453);})[_0xe681('0x1a')](function(_0x182db1){logger[_0xe681('0x17')](_0xe681('0x1b'),_0x182db1[_0xe681('0x19')],_0x438350);_0x16e647(_0x32e7ae[_0xe681('0x17')](0x1f4,_0x182db1[_0xe681('0x19')]));});});};exports[_0xe681('0x23')]=function(_0xc9d9b2){return new Promise(function(_0x32a9b2,_0x294099){return db['WhatsappInteraction']['find']({'where':_0xc9d9b2[_0xe681('0x1e')]?_0xc9d9b2['options'][_0xe681('0x1f')]||null:null})[_0xe681('0x22')](function(_0x37ef05){if(_0x37ef05){return _0x37ef05[_0xe681('0x24')](_0xc9d9b2['body'][_0xe681('0x25')],_[_0xe681('0x26')](_0xc9d9b2['body'],[_0xe681('0x25'),'id'])||{});}})['spread'](function(_0x48ffc0){logger[_0xe681('0x12')]('AddTags',_0xc9d9b2);logger[_0xe681('0x14')](_0xe681('0x27'),_0xc9d9b2,JSON[_0xe681('0x16')](_0x48ffc0));_0x32a9b2(_0x48ffc0);})[_0xe681('0x1a')](function(_0x684aa){logger[_0xe681('0x17')]('AddTags',_0x684aa[_0xe681('0x19')],_0xc9d9b2);_0x294099(_this[_0xe681('0x17')](0x1f4,_0x684aa[_0xe681('0x19')]));});});};
\ No newline at end of file
+var _0x3f9e=['addTags','body','ids','omit','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','./whatsappInteraction.socket','register','request','then','info','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','WhatsappInteraction,\x20%s,\x20%s','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','where','AddTagsToWhatsappInteraction','find'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x3f9e,0x1bd));var _0xe3f9=function(_0x419d3b,_0x194567){_0x419d3b=_0x419d3b-0x0;var _0x3e50e0=_0x3f9e[_0x419d3b];return _0x3e50e0;};'use strict';var _=require(_0xe3f9('0x0'));var util=require('util');var moment=require(_0xe3f9('0x1'));var BPromise=require(_0xe3f9('0x2'));var rs=require(_0xe3f9('0x3'));var fs=require('fs');var Redis=require(_0xe3f9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe3f9('0x5'));var logger=require(_0xe3f9('0x6'))(_0xe3f9('0x7'));var config=require('../../config/environment');var jayson=require(_0xe3f9('0x8'));var client=jayson[_0xe3f9('0x9')]['http']({'port':0x232a});config['redis']=_[_0xe3f9('0xa')](config[_0xe3f9('0xb')],{'host':_0xe3f9('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe3f9('0xb')]));require(_0xe3f9('0xd'))[_0xe3f9('0xe')](socket);function respondWithRpcPromise(_0x461193,_0x5cc8b8,_0x17f2ec){return new BPromise(function(_0x18bae0,_0x448586){return client[_0xe3f9('0xf')](_0x461193,_0x17f2ec)[_0xe3f9('0x10')](function(_0x76bca0){logger[_0xe3f9('0x11')]('WhatsappInteraction,\x20%s,\x20%s',_0x5cc8b8,'request\x20sent');logger[_0xe3f9('0x12')](_0xe3f9('0x13'),_0x5cc8b8,_0xe3f9('0x14'),JSON[_0xe3f9('0x15')](_0x76bca0));if(_0x76bca0[_0xe3f9('0x16')]){if(_0x76bca0[_0xe3f9('0x16')]['code']===0x1f4){logger[_0xe3f9('0x16')](_0xe3f9('0x17'),_0x5cc8b8,_0x76bca0[_0xe3f9('0x16')]['message']);return _0x448586(_0x76bca0[_0xe3f9('0x16')][_0xe3f9('0x18')]);}logger['error'](_0xe3f9('0x17'),_0x5cc8b8,_0x76bca0[_0xe3f9('0x16')][_0xe3f9('0x18')]);return _0x18bae0(_0x76bca0[_0xe3f9('0x16')][_0xe3f9('0x18')]);}else{logger['info'](_0xe3f9('0x17'),_0x5cc8b8,'request\x20sent');_0x18bae0(_0x76bca0[_0xe3f9('0x19')]['message']);}})[_0xe3f9('0x1a')](function(_0x527c8d){logger[_0xe3f9('0x16')](_0xe3f9('0x17'),_0x5cc8b8,_0x527c8d);_0x448586(_0x527c8d);});});}exports[_0xe3f9('0x1b')]=function(_0x33dd21){var _0x99a1f5=this;return new Promise(function(_0x33c4d0,_0xfe6ebf){return db[_0xe3f9('0x1c')][_0xe3f9('0x1d')](_0x33dd21['body'],{'raw':_0x33dd21[_0xe3f9('0x1e')]?_0x33dd21['options'][_0xe3f9('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33dd21['options']?_0x33dd21[_0xe3f9('0x1e')][_0xe3f9('0x20')]||null:null,'attributes':_0x33dd21[_0xe3f9('0x1e')]?_0x33dd21[_0xe3f9('0x1e')]['attributes']||null:null,'limit':_0x33dd21[_0xe3f9('0x1e')]?_0x33dd21[_0xe3f9('0x1e')]['limit']||null:null})[_0xe3f9('0x10')](function(_0x3a641d){logger[_0xe3f9('0x11')](_0xe3f9('0x1b'),_0x33dd21);logger[_0xe3f9('0x12')](_0xe3f9('0x1b'),_0x33dd21,JSON[_0xe3f9('0x15')](_0x3a641d));_0x33c4d0(_0x3a641d);})[_0xe3f9('0x1a')](function(_0x1dae84){logger[_0xe3f9('0x16')]('UpdateWhatsappInteraction',_0x1dae84[_0xe3f9('0x18')],_0x33dd21);_0xfe6ebf(_0x99a1f5[_0xe3f9('0x16')](0x1f4,_0x1dae84[_0xe3f9('0x18')]));});});};exports[_0xe3f9('0x21')]=function(_0x4d67ee){return new Promise(function(_0x7925a,_0x210250){return db[_0xe3f9('0x1c')][_0xe3f9('0x22')]({'where':_0x4d67ee[_0xe3f9('0x1e')]?_0x4d67ee['options'][_0xe3f9('0x20')]||null:null})[_0xe3f9('0x10')](function(_0x876b38){if(_0x876b38){return _0x876b38[_0xe3f9('0x23')](_0x4d67ee[_0xe3f9('0x24')][_0xe3f9('0x25')],_[_0xe3f9('0x26')](_0x4d67ee[_0xe3f9('0x24')],[_0xe3f9('0x25'),'id'])||{});}})['spread'](function(_0x31312c){logger[_0xe3f9('0x11')]('AddTags',_0x4d67ee);logger[_0xe3f9('0x12')](_0xe3f9('0x27'),_0x4d67ee,JSON[_0xe3f9('0x15')](_0x31312c));_0x7925a(_0x31312c);})[_0xe3f9('0x1a')](function(_0x28ab63){logger[_0xe3f9('0x16')](_0xe3f9('0x27'),_0x28ab63['message'],_0x4d67ee);_0x210250(_this[_0xe3f9('0x16')](0x1f4,_0x28ab63['message']));});});};
\ No newline at end of file
index 6c20cb2..4644486 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf19=['save','update','emit','register','length','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x281e5e,_0xf320e2){var _0x5a22d2=function(_0x405ff9){while(--_0x405ff9){_0x281e5e['push'](_0x281e5e['shift']());}};_0x5a22d2(++_0xf320e2);}(_0xbf19,0x1aa));var _0x9bf1=function(_0x37cb77,_0x52eddf){_0x37cb77=_0x37cb77-0x0;var _0x52db4f=_0xbf19[_0x37cb77];return _0x52db4f;};'use strict';var WhatsappInteractionEvents=require(_0x9bf1('0x0'));var events=[_0x9bf1('0x1'),'remove',_0x9bf1('0x2')];function createListener(_0x3b28d2,_0x436e92){return function(_0x4297f3){_0x436e92[_0x9bf1('0x3')](_0x3b28d2,_0x4297f3);};}function removeListener(_0x447fca,_0x5a6647){return function(){WhatsappInteractionEvents['removeListener'](_0x447fca,_0x5a6647);};}exports[_0x9bf1('0x4')]=function(_0x52df56){for(var _0x5674eb=0x0,_0x1b858b=events[_0x9bf1('0x5')];_0x5674eb<_0x1b858b;_0x5674eb++){var _0x42d405=events[_0x5674eb];var _0x7b2ff9=createListener(_0x9bf1('0x6')+_0x42d405,_0x52df56);WhatsappInteractionEvents['on'](_0x42d405,_0x7b2ff9);}};
\ No newline at end of file
+var _0x33c7=['removeListener','register','whatsappInteraction:','./whatsappInteraction.events','save','remove'];(function(_0x543c51,_0xff0084){var _0x360555=function(_0x2a0801){while(--_0x2a0801){_0x543c51['push'](_0x543c51['shift']());}};_0x360555(++_0xff0084);}(_0x33c7,0xbd));var _0x733c=function(_0x515099,_0x46bdbd){_0x515099=_0x515099-0x0;var _0x26e0a7=_0x33c7[_0x515099];return _0x26e0a7;};'use strict';var WhatsappInteractionEvents=require(_0x733c('0x0'));var events=[_0x733c('0x1'),_0x733c('0x2'),'update'];function createListener(_0x18522c,_0xf71016){return function(_0x4a4261){_0xf71016['emit'](_0x18522c,_0x4a4261);};}function removeListener(_0x5c47f0,_0x4ca963){return function(){WhatsappInteractionEvents[_0x733c('0x3')](_0x5c47f0,_0x4ca963);};}exports[_0x733c('0x4')]=function(_0x3f418f){for(var _0x3a28f9=0x0,_0x20c185=events['length'];_0x3a28f9<_0x20c185;_0x3a28f9++){var _0x32fc7d=events[_0x3a28f9];var _0x1aaf5d=createListener(_0x733c('0x5')+_0x32fc7d,_0x3f418f);WhatsappInteractionEvents['on'](_0x32fc7d,_0x1aaf5d);}};
\ No newline at end of file
index ac28bd0..b5c3784 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bf3=['index','/describe','describe','show','tracked','whatsappmessage:create','create','post','/:id/status','status','put','/:id','update','/:id/accept','accept','reject','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated'];(function(_0x34e14d,_0x5dea39){var _0x3d8e08=function(_0x134769){while(--_0x134769){_0x34e14d['push'](_0x34e14d['shift']());}};_0x3d8e08(++_0x5dea39);}(_0x4bf3,0x13e));var _0x34bf=function(_0x5a8c7e,_0x2ac85c){_0x5a8c7e=_0x5a8c7e-0x0;var _0x315d92=_0x4bf3[_0x5a8c7e];return _0x315d92;};'use strict';var multer=require(_0x34bf('0x0'));var util=require(_0x34bf('0x1'));var path=require(_0x34bf('0x2'));var timeout=require(_0x34bf('0x3'));var express=require(_0x34bf('0x4'));var router=express[_0x34bf('0x5')]();var fs_extra=require(_0x34bf('0x6'));var auth=require(_0x34bf('0x7'));var interaction=require(_0x34bf('0x8'));var config=require('../../config/environment');var controller=require(_0x34bf('0x9'));router[_0x34bf('0xa')]('/',auth[_0x34bf('0xb')](),controller[_0x34bf('0xc')]);router[_0x34bf('0xa')](_0x34bf('0xd'),auth[_0x34bf('0xb')](),controller[_0x34bf('0xe')]);router[_0x34bf('0xa')]('/:id',auth[_0x34bf('0xb')](),controller[_0x34bf('0xf')]);router['post']('/',auth[_0x34bf('0xb')](),interaction[_0x34bf('0x10')]('whatsapp',_0x34bf('0x11')),controller[_0x34bf('0x12')]);router[_0x34bf('0x13')](_0x34bf('0x14'),controller[_0x34bf('0x15')]);router[_0x34bf('0x16')](_0x34bf('0x17'),auth[_0x34bf('0xb')](),controller[_0x34bf('0x18')]);router[_0x34bf('0x16')](_0x34bf('0x19'),auth[_0x34bf('0xb')](),controller[_0x34bf('0x1a')]);router[_0x34bf('0x16')]('/:id/reject',auth[_0x34bf('0xb')](),controller[_0x34bf('0x1b')]);router[_0x34bf('0x1c')](_0x34bf('0x17'),auth[_0x34bf('0xb')](),controller[_0x34bf('0x1d')]);module['exports']=router;
\ No newline at end of file
+var _0xf1e3=['post','isAuthenticated','tracked','whatsapp','create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller','get','index','describe','/:id'];(function(_0x39d711,_0xe11eb7){var _0xee1d0c=function(_0x457e08){while(--_0x457e08){_0x39d711['push'](_0x39d711['shift']());}};_0xee1d0c(++_0xe11eb7);}(_0xf1e3,0x14e));var _0x3f1e=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0xf1e3[_0x220f3f];return _0x1f170e;};'use strict';var multer=require(_0x3f1e('0x0'));var util=require(_0x3f1e('0x1'));var path=require(_0x3f1e('0x2'));var timeout=require(_0x3f1e('0x3'));var express=require(_0x3f1e('0x4'));var router=express[_0x3f1e('0x5')]();var fs_extra=require(_0x3f1e('0x6'));var auth=require(_0x3f1e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3f1e('0x8'));var controller=require(_0x3f1e('0x9'));router[_0x3f1e('0xa')]('/',auth['isAuthenticated'](),controller[_0x3f1e('0xb')]);router[_0x3f1e('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x3f1e('0xc')]);router['get'](_0x3f1e('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x3f1e('0xe')]('/',auth[_0x3f1e('0xf')](),interaction[_0x3f1e('0x10')](_0x3f1e('0x11'),'whatsappmessage:create'),controller[_0x3f1e('0x12')]);router[_0x3f1e('0xe')](_0x3f1e('0x13'),controller[_0x3f1e('0x14')]);router[_0x3f1e('0x15')](_0x3f1e('0xd'),auth['isAuthenticated'](),controller[_0x3f1e('0x16')]);router[_0x3f1e('0x15')](_0x3f1e('0x17'),auth[_0x3f1e('0xf')](),controller[_0x3f1e('0x18')]);router[_0x3f1e('0x15')](_0x3f1e('0x19'),auth[_0x3f1e('0xf')](),controller[_0x3f1e('0x1a')]);router['delete'](_0x3f1e('0xd'),auth['isAuthenticated'](),controller[_0x3f1e('0x1b')]);module[_0x3f1e('0x1c')]=router;
\ No newline at end of file
index 20fbed3..6ffacc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb770=['STRING','DATE','sequelize','medium','BOOLEAN','ENUM','out'];(function(_0x16903b,_0x10f871){var _0x519ec2=function(_0x3b8a76){while(--_0x3b8a76){_0x16903b['push'](_0x16903b['shift']());}};_0x519ec2(++_0x10f871);}(_0xb770,0x191));var _0x0b77=function(_0x4bd355,_0x1ff6d5){_0x4bd355=_0x4bd355-0x0;var _0x36f0a4=_0xb770[_0x4bd355];return _0x36f0a4;};'use strict';var Sequelize=require(_0x0b77('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x0b77('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x0b77('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0b77('0x3')]('in',_0x0b77('0x4')),'defaultValue':_0x0b77('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x0b77('0x5')]},'readAt':{'type':Sequelize[_0x0b77('0x6')]},'secret':{'type':Sequelize[_0x0b77('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x0b77('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x7118=['DATE','BOOLEAN','TEXT','medium','ENUM','out','STRING'];(function(_0x37b42e,_0x3c4b35){var _0x1dca41=function(_0x23fdf7){while(--_0x23fdf7){_0x37b42e['push'](_0x37b42e['shift']());}};_0x1dca41(++_0x3c4b35);}(_0x7118,0x159));var _0x8711=function(_0x2988c9,_0x5525ed){_0x2988c9=_0x2988c9-0x0;var _0x5908d3=_0x7118[_0x2988c9];return _0x5908d3;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x8711('0x0')](_0x8711('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x8711('0x2')]('in',_0x8711('0x3')),'defaultValue':_0x8711('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x8711('0x4')](0xbe)},'phone':{'type':Sequelize[_0x8711('0x4')]},'readAt':{'type':Sequelize[_0x8711('0x5')]},'secret':{'type':Sequelize[_0x8711('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x8711('0x0')]}};
\ No newline at end of file
index 1c7bd28..c804dd5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8040=['fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','sequelize','Sequelize','interface','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappMessage.socket','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','stack','name','index','map','WhatsappMessage','fieldName','type','key','model','query','filters','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','rawAttributes','intersection','fields','find','create','body','describe','whatsapp-interactions','accept','whatsapp','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','contact','User'];(function(_0x4f0f49,_0x10b7e0){var _0x16a2bc=function(_0x12041d){while(--_0x12041d){_0x4f0f49['push'](_0x4f0f49['shift']());}};_0x16a2bc(++_0x10b7e0);}(_0x8040,0x1c2));var _0x0804=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x8040[_0x29b609];return _0x54c952;};'use strict';var emlformat=require(_0x0804('0x0'));var rimraf=require(_0x0804('0x1'));var zipdir=require(_0x0804('0x2'));var jsonpatch=require(_0x0804('0x3'));var rp=require(_0x0804('0x4'));var moment=require('moment');var BPromise=require(_0x0804('0x5'));var Mustache=require(_0x0804('0x6'));var util=require('util');var path=require('path');var sox=require(_0x0804('0x7'));var csv=require(_0x0804('0x8'));var ejs=require(_0x0804('0x9'));var fs=require('fs');var fs_extra=require(_0x0804('0xa'));var _=require(_0x0804('0xb'));var squel=require(_0x0804('0xc'));var crypto=require('crypto');var jsforce=require(_0x0804('0xd'));var deskjs=require(_0x0804('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0804('0xf'));var Redis=require('ioredis');var authService=require(_0x0804('0x10'));var qs=require(_0x0804('0x11'));var as=require(_0x0804('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0804('0x13'))(_0x0804('0x14'));var utils=require('../../config/utils');var config=require(_0x0804('0x15'));var licenseUtil=require(_0x0804('0x16'));var db=require(_0x0804('0x17'))['db'];config[_0x0804('0x18')]=_[_0x0804('0x19')](config['redis'],{'host':_0x0804('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0804('0x18')]));require(_0x0804('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x0804('0x1c')][_0x0804('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x1982f2,_0x437cc1,_0x4e049f,_0x191db2){return new BPromise(function(_0x95ac0a,_0x2f75af){var _0x420a28=_0x191db2||client;return _0x420a28[_0x0804('0x1e')](_0x1982f2,_0x4e049f)[_0x0804('0x1f')](function(_0x52702a){logger[_0x0804('0x20')](_0x0804('0x21'),_0x437cc1,_0x0804('0x22'));logger[_0x0804('0x23')](_0x0804('0x24'),_0x437cc1,_0x0804('0x22'),JSON[_0x0804('0x25')](_0x52702a));if(_0x52702a['error']){if(_0x52702a[_0x0804('0x26')][_0x0804('0x27')]===0x1f4){logger[_0x0804('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x437cc1,_0x52702a[_0x0804('0x26')][_0x0804('0x28')]);return _0x2f75af(_0x52702a[_0x0804('0x26')]['message']);}logger[_0x0804('0x26')](_0x0804('0x21'),_0x437cc1,_0x52702a[_0x0804('0x26')][_0x0804('0x28')]);return _0x95ac0a(_0x52702a[_0x0804('0x26')]['message']);}else{logger[_0x0804('0x20')](_0x0804('0x21'),_0x437cc1,_0x0804('0x22'));_0x95ac0a(_0x52702a[_0x0804('0x29')]['message']);}})[_0x0804('0x2a')](function(_0x26f742){logger[_0x0804('0x26')](_0x0804('0x21'),_0x437cc1,_0x26f742);_0x2f75af(_0x26f742);});});}function respondWithStatusCode(_0x562b59,_0xf1981c){_0xf1981c=_0xf1981c||0xcc;return function(_0x216bf2){if(_0x216bf2){return _0x562b59['sendStatus'](_0xf1981c);}return _0x562b59[_0x0804('0x2b')](_0xf1981c)[_0x0804('0x2c')]();};}function respondWithResult(_0x4eb2b0,_0x8e330c){_0x8e330c=_0x8e330c||0xc8;return function(_0x159130){if(_0x159130){return _0x4eb2b0[_0x0804('0x2b')](_0x8e330c)[_0x0804('0x2d')](_0x159130);}};}function respondWithFilteredResult(_0x218f37,_0x38022a){return function(_0x41e506){if(_0x41e506){var _0x4bf9e4=typeof _0x38022a[_0x0804('0x2e')]===_0x0804('0x2f')&&typeof _0x38022a['limit']===_0x0804('0x2f');var _0x29eeec=_0x41e506['count'];var _0x2eabe9=_0x4bf9e4?0x0:_0x38022a[_0x0804('0x2e')];var _0x3da607=_0x4bf9e4?_0x41e506[_0x0804('0x30')]:_0x38022a['offset']+_0x38022a[_0x0804('0x31')];var _0x4ecba9;if(_0x3da607>=_0x29eeec){_0x3da607=_0x29eeec;_0x4ecba9=0xc8;}else{_0x4ecba9=0xce;}_0x218f37[_0x0804('0x2b')](_0x4ecba9);return _0x218f37[_0x0804('0x32')]('Content-Range',_0x2eabe9+'-'+_0x3da607+'/'+_0x29eeec)[_0x0804('0x2d')](_0x41e506);}return null;};}function patchUpdates(_0x5939b4){return function(_0x172b6d){try{jsonpatch[_0x0804('0x33')](_0x172b6d,_0x5939b4,!![]);}catch(_0x4137e4){return BPromise[_0x0804('0x34')](_0x4137e4);}return _0x172b6d[_0x0804('0x35')]();};}function saveUpdates(_0x17496c,_0x1c3871){return function(_0x5d29e6){if(_0x5d29e6){return _0x5d29e6[_0x0804('0x36')](_0x17496c)[_0x0804('0x1f')](function(_0x312916){return _0x312916;});}return null;};}function removeEntity(_0x16b649,_0x4af095){return function(_0x2e83c8){if(_0x2e83c8){return _0x2e83c8[_0x0804('0x37')]()[_0x0804('0x1f')](function(){_0x16b649[_0x0804('0x2b')](0xcc)[_0x0804('0x2c')]();});}};}function handleEntityNotFound(_0x79bb47,_0xe0295e){return function(_0x507fd7){if(!_0x507fd7){_0x79bb47['sendStatus'](0x194);}return _0x507fd7;};}function handleError(_0x485b68,_0x50a944){_0x50a944=_0x50a944||0x1f4;return function(_0x5d0780){logger[_0x0804('0x26')](_0x5d0780[_0x0804('0x38')]);if(_0x5d0780[_0x0804('0x39')]){delete _0x5d0780[_0x0804('0x39')];}_0x485b68[_0x0804('0x2b')](_0x50a944)['send'](_0x5d0780);};}exports[_0x0804('0x3a')]=function(_0x69e26f,_0x144d97){var _0x398e46={},_0x4d362d={},_0x17e49e={'count':0x0,'rows':[]};var _0x26befd=_[_0x0804('0x3b')](db[_0x0804('0x3c')]['rawAttributes'],function(_0x2f9a79){return{'name':_0x2f9a79[_0x0804('0x3d')],'type':_0x2f9a79[_0x0804('0x3e')][_0x0804('0x3f')]};});_0x4d362d[_0x0804('0x40')]=_['map'](_0x26befd,_0x0804('0x39'));_0x4d362d['query']=_['keys'](_0x69e26f[_0x0804('0x41')]);_0x4d362d[_0x0804('0x42')]=_['intersection'](_0x4d362d[_0x0804('0x40')],_0x4d362d['query']);_0x398e46[_0x0804('0x43')]=_['intersection'](_0x4d362d[_0x0804('0x40')],qs['fields'](_0x69e26f[_0x0804('0x41')]['fields']));_0x398e46[_0x0804('0x43')]=_0x398e46[_0x0804('0x43')][_0x0804('0x44')]?_0x398e46[_0x0804('0x43')]:_0x4d362d[_0x0804('0x40')];if(!_0x69e26f[_0x0804('0x41')][_0x0804('0x45')](_0x0804('0x46'))){_0x398e46[_0x0804('0x31')]=qs[_0x0804('0x31')](_0x69e26f[_0x0804('0x41')][_0x0804('0x31')]);_0x398e46[_0x0804('0x2e')]=qs[_0x0804('0x2e')](_0x69e26f[_0x0804('0x41')]['offset']);}_0x398e46['order']=qs['sort'](_0x69e26f[_0x0804('0x41')][_0x0804('0x47')]);_0x398e46[_0x0804('0x48')]=qs[_0x0804('0x42')](_[_0x0804('0x49')](_0x69e26f[_0x0804('0x41')],_0x4d362d['filters']),_0x26befd);if(_0x69e26f['query'][_0x0804('0x4a')]){_0x398e46['where']=_[_0x0804('0x4b')](_0x398e46['where'],{'$or':_[_0x0804('0x3b')](_0x26befd,function(_0x5941f6){if(_0x5941f6[_0x0804('0x3e')]!==_0x0804('0x4c')){var _0x33341f={};_0x33341f[_0x5941f6[_0x0804('0x39')]]={'$like':'%'+_0x69e26f[_0x0804('0x41')][_0x0804('0x4a')]+'%'};return _0x33341f;}})});}_0x398e46=_[_0x0804('0x4b')]({},_0x398e46,_0x69e26f['options']);var _0x22eb3b={'where':_0x398e46[_0x0804('0x48')]};return db[_0x0804('0x3c')]['count'](_0x22eb3b)[_0x0804('0x1f')](function(_0x4d8295){_0x17e49e[_0x0804('0x30')]=_0x4d8295;if(_0x69e26f[_0x0804('0x41')][_0x0804('0x4d')]){_0x398e46[_0x0804('0x4e')]=[{'all':!![]}];}return db[_0x0804('0x3c')][_0x0804('0x4f')](_0x398e46);})['then'](function(_0x591510){_0x17e49e[_0x0804('0x50')]=_0x591510;return _0x17e49e;})[_0x0804('0x1f')](respondWithFilteredResult(_0x144d97,_0x398e46))['catch'](handleError(_0x144d97,null));};exports[_0x0804('0x51')]=function(_0x37c1e1,_0x2e232c){var _0xa42cd3={'raw':!![],'where':{'id':_0x37c1e1[_0x0804('0x52')]['id']}},_0x3c5d70={};_0x3c5d70[_0x0804('0x40')]=_[_0x0804('0x53')](db[_0x0804('0x3c')][_0x0804('0x54')]);_0x3c5d70[_0x0804('0x41')]=_[_0x0804('0x53')](_0x37c1e1[_0x0804('0x41')]);_0x3c5d70[_0x0804('0x42')]=_[_0x0804('0x55')](_0x3c5d70[_0x0804('0x40')],_0x3c5d70[_0x0804('0x41')]);_0xa42cd3['attributes']=_['intersection'](_0x3c5d70[_0x0804('0x40')],qs['fields'](_0x37c1e1['query'][_0x0804('0x56')]));_0xa42cd3[_0x0804('0x43')]=_0xa42cd3[_0x0804('0x43')][_0x0804('0x44')]?_0xa42cd3[_0x0804('0x43')]:_0x3c5d70[_0x0804('0x40')];if(_0x37c1e1['query']['includeAll']){_0xa42cd3[_0x0804('0x4e')]=[{'all':!![]}];}_0xa42cd3=_[_0x0804('0x4b')]({},_0xa42cd3,_0x37c1e1['options']);return db['WhatsappMessage'][_0x0804('0x57')](_0xa42cd3)['then'](handleEntityNotFound(_0x2e232c,null))[_0x0804('0x1f')](respondWithResult(_0x2e232c,null))[_0x0804('0x2a')](handleError(_0x2e232c,null));};exports[_0x0804('0x58')]=function(_0x1efe81,_0x37d223){return db[_0x0804('0x3c')][_0x0804('0x58')](_0x1efe81[_0x0804('0x59')],{})[_0x0804('0x1f')](respondWithResult(_0x37d223,0xc9))[_0x0804('0x2a')](handleError(_0x37d223,null));};exports['update']=function(_0x180f72,_0x2e8882){if(_0x180f72['body']['id']){delete _0x180f72['body']['id'];}return db[_0x0804('0x3c')][_0x0804('0x57')]({'where':{'id':_0x180f72[_0x0804('0x52')]['id']}})[_0x0804('0x1f')](handleEntityNotFound(_0x2e8882,null))[_0x0804('0x1f')](saveUpdates(_0x180f72[_0x0804('0x59')],null))['then'](respondWithResult(_0x2e8882,null))[_0x0804('0x2a')](handleError(_0x2e8882,null));};exports[_0x0804('0x37')]=function(_0x335ce0,_0x1b912b){return db[_0x0804('0x3c')]['find']({'where':{'id':_0x335ce0[_0x0804('0x52')]['id']}})[_0x0804('0x1f')](handleEntityNotFound(_0x1b912b,null))[_0x0804('0x1f')](removeEntity(_0x1b912b,null))[_0x0804('0x2a')](handleError(_0x1b912b,null));};exports[_0x0804('0x5a')]=function(_0x2383e7,_0x45f81d){return db[_0x0804('0x3c')][_0x0804('0x5a')]()[_0x0804('0x1f')](respondWithResult(_0x45f81d,null))[_0x0804('0x2a')](handleError(_0x45f81d,null));};var interaction_log=require('../../config/logger')(_0x0804('0x5b'));exports[_0x0804('0x5c')]=function(_0x4600db,_0x4807a8,_0x38ba46){var _0x5d102f={'agent':{},'channel':_0x0804('0x5d')};if(_0x4600db[_0x0804('0x59')]['id']){delete _0x4600db['body']['id'];}_0x4600db[_0x0804('0x59')]['read']=!![];_0x4600db['body'][_0x0804('0x5e')]=moment()[_0x0804('0x5f')](_0x0804('0x60'));_0x4600db[_0x0804('0x59')][_0x0804('0x61')]=_0x4600db[_0x0804('0x59')][_0x0804('0x61')]||_0x4600db[_0x0804('0x62')]['id'];_0x5d102f[_0x0804('0x63')]['id']=_0x4600db[_0x0804('0x59')][_0x0804('0x61')];return db['WhatsappMessage'][_0x0804('0x57')]({'where':{'id':_0x4600db['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4807a8,null))[_0x0804('0x1f')](saveUpdates(_0x4600db[_0x0804('0x59')],null))[_0x0804('0x1f')](function(_0x28708b){if(_0x28708b){_0x5d102f[_0x0804('0x28')]=_0x28708b[_0x0804('0x64')]({'plain':!![]});return db[_0x0804('0x65')][_0x0804('0x57')]({'where':{'id':_0x28708b[_0x0804('0x66')]}});}return null;})[_0x0804('0x1f')](handleEntityNotFound(_0x4807a8,null))[_0x0804('0x1f')](function(_0x4fd616){if(_0x4fd616){return _0x4fd616[_0x0804('0x36')]({'UserId':_0x4600db[_0x0804('0x59')][_0x0804('0x61')],'read1stAt':_[_0x0804('0x67')](_0x4fd616['read1stAt'])?moment()[_0x0804('0x5f')](_0x0804('0x60')):undefined});}return null;})[_0x0804('0x1f')](function(_0x17fa6b){if(_0x17fa6b){_0x5d102f[_0x0804('0x68')]=_0x17fa6b[_0x0804('0x64')]({'plain':!![]});interaction_log[_0x0804('0x20')](_0x0804('0x69'),_0x4600db[_0x0804('0x62')]['id'],_0x4600db[_0x0804('0x62')]['name'],_0x4600db[_0x0804('0x62')][_0x0804('0x6a')],_0x5d102f[_0x0804('0x68')]['id'],_0x4600db[_0x0804('0x59')]?JSON[_0x0804('0x25')](_0x4600db[_0x0804('0x59')]):_0x0804('0x6b'));return respondWithRpcPromise(_0x0804('0x6c'),'acceptMessage',_0x5d102f);}return null;})[_0x0804('0x1f')](function(_0x16828e){var _0x21d4cf=_0x0804('0x6d')+_0x16828e[_0x0804('0x28')]['ContactId'];return db['sequelize'][_0x0804('0x41')](_0x21d4cf,{'type':db['Sequelize'][_0x0804('0x6e')][_0x0804('0x6f')],'raw':!![]})[_0x0804('0x1f')](function(_0xd294ff){return _0xd294ff;});})[_0x0804('0x1f')](function(_0x4dc975){if(_0x4dc975){_0x5d102f[_0x0804('0x28')][_0x0804('0x70')]=_0x4dc975[0x0];if(!_0x4600db[_0x0804('0x59')]['UserId'])return;return db[_0x0804('0x71')][_0x0804('0x57')]({'where':{'id':_0x4600db[_0x0804('0x59')][_0x0804('0x61')],'role':_0x0804('0x63')},'attributes':['id','name',_0x0804('0x72'),_0x0804('0x73'),_0x0804('0x74')],'raw':!![]});}return null;})[_0x0804('0x1f')](function(_0x44f24f){if(!_0x44f24f)return null;_0x5d102f['message']['agent']=_0x44f24f;return _0x5d102f;})['then'](function(_0x3feb8a){if(_0x3feb8a){if(_0x4600db['body'][_0x0804('0x75')]){_0x5d102f[_0x0804('0x28')]['interface']=util[_0x0804('0x5f')](_0x0804('0x76'),_0x4600db[_0x0804('0x62')][_0x0804('0x39')]);_0x5d102f[_0x0804('0x28')][_0x0804('0x77')]=_0x5d102f[_0x0804('0x77')];_0x5d102f['message'][_0x0804('0x78')]=_0x5d102f['channel'];_0x5d102f['message'][_0x0804('0x79')]=_0x0804('0x5c');return respondWithRpcPromise(_0x0804('0x7a'),_0x0804('0x7a'),{'event':_0x0804('0x7b'),'message':_0x5d102f[_0x0804('0x28')]},client9002)['then'](function(){return _0x5d102f;});}return _0x5d102f;}return null;})[_0x0804('0x1f')](respondWithResult(_0x4807a8,null))['catch'](handleError(_0x4807a8,null));};var interaction_log=require(_0x0804('0x13'))(_0x0804('0x5b'));exports[_0x0804('0x34')]=function(_0x25c4fb,_0x4a8f6a,_0x356d9e){var _0x3f2a5b={'agent':{},'channel':_0x0804('0x5d')};if(_0x25c4fb[_0x0804('0x59')]['id']){delete _0x25c4fb['body']['id'];}_0x25c4fb[_0x0804('0x59')]['UserId']=_0x25c4fb['body'][_0x0804('0x61')]||_0x25c4fb['user']['id'];_0x3f2a5b['agent']['id']=_0x25c4fb[_0x0804('0x59')]['UserId'];return db[_0x0804('0x3c')]['find']({'where':{'id':_0x25c4fb[_0x0804('0x52')]['id'],'UserId':null}})[_0x0804('0x1f')](handleEntityNotFound(_0x4a8f6a,null))[_0x0804('0x1f')](function(_0x43d109){if(_0x43d109){_0x3f2a5b[_0x0804('0x28')]=_0x43d109[_0x0804('0x64')]({'plain':!![]});return db[_0x0804('0x65')]['find']({'where':{'id':_0x43d109['WhatsappInteractionId']}});}return null;})[_0x0804('0x1f')](handleEntityNotFound(_0x4a8f6a,null))[_0x0804('0x1f')](function(_0x29b854){if(_0x29b854){_0x3f2a5b[_0x0804('0x68')]=_0x29b854['get']({'plain':!![]});interaction_log['info'](_0x0804('0x7c'),_0x25c4fb[_0x0804('0x62')]['id'],_0x25c4fb[_0x0804('0x62')][_0x0804('0x39')],_0x25c4fb[_0x0804('0x62')]['role'],_0x3f2a5b['interaction']['id'],_0x25c4fb[_0x0804('0x59')]?JSON[_0x0804('0x25')](_0x25c4fb['body']):_0x0804('0x6b'));return respondWithRpcPromise(_0x0804('0x7d'),_0x0804('0x7e'),_0x3f2a5b);}return null;})['then'](function(_0x4b1b6d){var _0x35cce9=_0x0804('0x6d')+_0x4b1b6d[_0x0804('0x28')][_0x0804('0x7f')];return db[_0x0804('0x80')][_0x0804('0x41')](_0x35cce9,{'type':db[_0x0804('0x81')]['QueryTypes'][_0x0804('0x6f')],'raw':!![]})[_0x0804('0x1f')](function(_0x161b6d){return _0x161b6d;});})[_0x0804('0x1f')](function(_0x12ceb5){if(_0x12ceb5){_0x3f2a5b[_0x0804('0x28')][_0x0804('0x70')]=_0x12ceb5[0x0];if(!_0x25c4fb[_0x0804('0x59')][_0x0804('0x61')])return;return db['User'][_0x0804('0x57')]({'where':{'id':_0x25c4fb[_0x0804('0x59')][_0x0804('0x61')],'role':_0x0804('0x63')},'attributes':['id','name',_0x0804('0x72'),_0x0804('0x73'),_0x0804('0x74')],'raw':!![]});}return null;})[_0x0804('0x1f')](function(_0x58aea7){if(!_0x58aea7)return null;_0x3f2a5b[_0x0804('0x28')][_0x0804('0x63')]=_0x58aea7;return _0x3f2a5b;})['then'](function(_0x206464){if(_0x206464){_0x206464[_0x0804('0x28')][_0x0804('0x82')]=util[_0x0804('0x5f')](_0x0804('0x76'),_0x25c4fb['user'][_0x0804('0x39')]);_0x206464[_0x0804('0x28')][_0x0804('0x77')]=_0x3f2a5b['channel'];_0x206464['message'][_0x0804('0x78')]=_0x3f2a5b[_0x0804('0x77')];_0x206464[_0x0804('0x28')][_0x0804('0x79')]=_0x0804('0x34');respondWithRpcPromise(_0x0804('0x7a'),_0x0804('0x7a'),{'event':'rejectmessage','message':_0x206464[_0x0804('0x28')]},client9002);return _0x3f2a5b;}return null;})[_0x0804('0x1f')](respondWithResult(_0x4a8f6a,null))[_0x0804('0x2a')](handleError(_0x4a8f6a,null));};exports[_0x0804('0x2b')]=function(_0x53161b,_0x15331,_0x3d5dd2){if(_0x53161b['body']['id']){delete _0x53161b[_0x0804('0x59')]['id'];}var _0x3d0716;return db[_0x0804('0x3c')]['find']({'where':{'id':_0x53161b[_0x0804('0x52')]['id']}})[_0x0804('0x1f')](handleEntityNotFound(_0x15331,null))[_0x0804('0x1f')](function(_0x164391){if(_0x164391){_0x3d0716=_0x164391;return db[_0x0804('0x83')][_0x0804('0x57')]({'where':{'id':_0x164391[_0x0804('0x84')]}});}})[_0x0804('0x1f')](handleEntityNotFound(_0x15331,null))[_0x0804('0x1f')](function(_0x217de4){if(_0x217de4){logger[_0x0804('0x23')](_0x0804('0x85'),_0x0804('0x2b'),_0x0804('0x86'),_0x217de4[_0x0804('0x3e')],util[_0x0804('0x87')](_0x53161b[_0x0804('0x59')],{'showHidden':![],'depth':null}));switch(_0x217de4[_0x0804('0x3e')]){case'twilio':if(_0x53161b[_0x0804('0x59')][_0x0804('0x88')]&&_0x53161b[_0x0804('0x59')][_0x0804('0x88')]===_0x3d0716['messageId']&&_0x53161b[_0x0804('0x59')][_0x0804('0x89')]&&_0x53161b[_0x0804('0x59')][_0x0804('0x89')]===_0x0804('0x8a')){return _0x3d0716[_0x0804('0x36')]({'read':!![]});}else{logger[_0x0804('0x26')](_0x0804('0x8b'),'status',_0x0804('0x8c'),util['inspect'](_0x53161b[_0x0804('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x3d0716;}})[_0x0804('0x1f')](respondWithResult(_0x15331,null))[_0x0804('0x2a')](handleError(_0x15331,null));};
\ No newline at end of file
+var _0x0982=['length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','WhatsappMessage','includeAll','include','rows','show','keys','find','create','body','params','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','fullname','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','User','email','internal','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./whatsappMessage.socket','jayson/promise','client','http','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','end','json','limit','offset','count','set','Content-Range','update','destroy','sendStatus','stack','name','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0982,0x1e6));var _0x2098=function(_0x200068,_0x5bd3d2){_0x200068=_0x200068-0x0;var _0x21c298=_0x0982[_0x200068];return _0x21c298;};'use strict';var emlformat=require(_0x2098('0x0'));var rimraf=require(_0x2098('0x1'));var zipdir=require(_0x2098('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2098('0x3'));var BPromise=require(_0x2098('0x4'));var Mustache=require(_0x2098('0x5'));var util=require(_0x2098('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x2098('0x7'));var ejs=require(_0x2098('0x8'));var fs=require('fs');var fs_extra=require(_0x2098('0x9'));var _=require(_0x2098('0xa'));var squel=require(_0x2098('0xb'));var crypto=require(_0x2098('0xc'));var jsforce=require(_0x2098('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2098('0x7'));var querystring=require(_0x2098('0xe'));var Papa=require(_0x2098('0xf'));var Redis=require('ioredis');var authService=require(_0x2098('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2098('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2098('0x12'));var utils=require(_0x2098('0x13'));var config=require(_0x2098('0x14'));var licenseUtil=require(_0x2098('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x2098('0x16')](config[_0x2098('0x17')],{'host':_0x2098('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2098('0x17')]));require(_0x2098('0x19'))['register'](socket);var jayson=require(_0x2098('0x1a'));var client=jayson[_0x2098('0x1b')][_0x2098('0x1c')]({'port':0x232c});var client9002=jayson[_0x2098('0x1b')][_0x2098('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x21ca9d,_0x52fb3b,_0x2e3453,_0x4f2fa5){return new BPromise(function(_0x42fe09,_0x1ed3b1){var _0x35669d=_0x4f2fa5||client;return _0x35669d[_0x2098('0x1d')](_0x21ca9d,_0x2e3453)[_0x2098('0x1e')](function(_0x47fceb){logger['info'](_0x2098('0x1f'),_0x52fb3b,_0x2098('0x20'));logger[_0x2098('0x21')](_0x2098('0x22'),_0x52fb3b,_0x2098('0x20'),JSON[_0x2098('0x23')](_0x47fceb));if(_0x47fceb[_0x2098('0x24')]){if(_0x47fceb[_0x2098('0x24')][_0x2098('0x25')]===0x1f4){logger[_0x2098('0x24')](_0x2098('0x1f'),_0x52fb3b,_0x47fceb[_0x2098('0x24')][_0x2098('0x26')]);return _0x1ed3b1(_0x47fceb[_0x2098('0x24')]['message']);}logger[_0x2098('0x24')](_0x2098('0x1f'),_0x52fb3b,_0x47fceb[_0x2098('0x24')]['message']);return _0x42fe09(_0x47fceb['error']['message']);}else{logger[_0x2098('0x27')](_0x2098('0x1f'),_0x52fb3b,'request\x20sent');_0x42fe09(_0x47fceb[_0x2098('0x28')][_0x2098('0x26')]);}})[_0x2098('0x29')](function(_0x5f4257){logger['error'](_0x2098('0x1f'),_0x52fb3b,_0x5f4257);_0x1ed3b1(_0x5f4257);});});}function respondWithStatusCode(_0x5e4b98,_0x66d910){_0x66d910=_0x66d910||0xcc;return function(_0x227af9){if(_0x227af9){return _0x5e4b98['sendStatus'](_0x66d910);}return _0x5e4b98[_0x2098('0x2a')](_0x66d910)[_0x2098('0x2b')]();};}function respondWithResult(_0x3f21b2,_0x3904fe){_0x3904fe=_0x3904fe||0xc8;return function(_0x5cb196){if(_0x5cb196){return _0x3f21b2['status'](_0x3904fe)[_0x2098('0x2c')](_0x5cb196);}};}function respondWithFilteredResult(_0x639abb,_0x2fca9c){return function(_0x409d4c){if(_0x409d4c){var _0x1a3167=typeof _0x2fca9c['offset']==='undefined'&&typeof _0x2fca9c[_0x2098('0x2d')]==='undefined';var _0x2ed2ea=_0x409d4c['count'];var _0x910b5c=_0x1a3167?0x0:_0x2fca9c[_0x2098('0x2e')];var _0x13276b=_0x1a3167?_0x409d4c[_0x2098('0x2f')]:_0x2fca9c['offset']+_0x2fca9c['limit'];var _0x18d2c0;if(_0x13276b>=_0x2ed2ea){_0x13276b=_0x2ed2ea;_0x18d2c0=0xc8;}else{_0x18d2c0=0xce;}_0x639abb[_0x2098('0x2a')](_0x18d2c0);return _0x639abb[_0x2098('0x30')](_0x2098('0x31'),_0x910b5c+'-'+_0x13276b+'/'+_0x2ed2ea)[_0x2098('0x2c')](_0x409d4c);}return null;};}function patchUpdates(_0x4238a9){return function(_0xfd55d1){try{jsonpatch['apply'](_0xfd55d1,_0x4238a9,!![]);}catch(_0x291ac7){return BPromise['reject'](_0x291ac7);}return _0xfd55d1['save']();};}function saveUpdates(_0x4f8d1f,_0x40e2c4){return function(_0x54014c){if(_0x54014c){return _0x54014c[_0x2098('0x32')](_0x4f8d1f)[_0x2098('0x1e')](function(_0x53bfa4){return _0x53bfa4;});}return null;};}function removeEntity(_0x168172,_0x29fea8){return function(_0x5dad7f){if(_0x5dad7f){return _0x5dad7f[_0x2098('0x33')]()[_0x2098('0x1e')](function(){_0x168172[_0x2098('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10ccaf,_0x481105){return function(_0x48af3c){if(!_0x48af3c){_0x10ccaf[_0x2098('0x34')](0x194);}return _0x48af3c;};}function handleError(_0xbc90c4,_0x393544){_0x393544=_0x393544||0x1f4;return function(_0x54d566){logger[_0x2098('0x24')](_0x54d566[_0x2098('0x35')]);if(_0x54d566[_0x2098('0x36')]){delete _0x54d566[_0x2098('0x36')];}_0xbc90c4['status'](_0x393544)['send'](_0x54d566);};}exports[_0x2098('0x37')]=function(_0x3dcb53,_0x3adf07){var _0x2e9bc4={},_0x2e808b={},_0x572f7c={'count':0x0,'rows':[]};var _0x66b18c=_[_0x2098('0x38')](db['WhatsappMessage'][_0x2098('0x39')],function(_0x2e6528){return{'name':_0x2e6528['fieldName'],'type':_0x2e6528[_0x2098('0x3a')][_0x2098('0x3b')]};});_0x2e808b[_0x2098('0x3c')]=_[_0x2098('0x38')](_0x66b18c,'name');_0x2e808b[_0x2098('0x3d')]=_['keys'](_0x3dcb53['query']);_0x2e808b[_0x2098('0x3e')]=_[_0x2098('0x3f')](_0x2e808b[_0x2098('0x3c')],_0x2e808b[_0x2098('0x3d')]);_0x2e9bc4[_0x2098('0x40')]=_['intersection'](_0x2e808b[_0x2098('0x3c')],qs[_0x2098('0x41')](_0x3dcb53[_0x2098('0x3d')]['fields']));_0x2e9bc4[_0x2098('0x40')]=_0x2e9bc4[_0x2098('0x40')][_0x2098('0x42')]?_0x2e9bc4[_0x2098('0x40')]:_0x2e808b[_0x2098('0x3c')];if(!_0x3dcb53[_0x2098('0x3d')][_0x2098('0x43')](_0x2098('0x44'))){_0x2e9bc4[_0x2098('0x2d')]=qs['limit'](_0x3dcb53[_0x2098('0x3d')][_0x2098('0x2d')]);_0x2e9bc4[_0x2098('0x2e')]=qs[_0x2098('0x2e')](_0x3dcb53[_0x2098('0x3d')][_0x2098('0x2e')]);}_0x2e9bc4[_0x2098('0x45')]=qs[_0x2098('0x46')](_0x3dcb53[_0x2098('0x3d')][_0x2098('0x46')]);_0x2e9bc4[_0x2098('0x47')]=qs[_0x2098('0x3e')](_[_0x2098('0x48')](_0x3dcb53[_0x2098('0x3d')],_0x2e808b['filters']),_0x66b18c);if(_0x3dcb53[_0x2098('0x3d')]['filter']){_0x2e9bc4[_0x2098('0x47')]=_[_0x2098('0x49')](_0x2e9bc4[_0x2098('0x47')],{'$or':_[_0x2098('0x38')](_0x66b18c,function(_0x4f5e7b){if(_0x4f5e7b[_0x2098('0x3a')]!=='VIRTUAL'){var _0x3663a3={};_0x3663a3[_0x4f5e7b['name']]={'$like':'%'+_0x3dcb53[_0x2098('0x3d')][_0x2098('0x4a')]+'%'};return _0x3663a3;}})});}_0x2e9bc4=_['merge']({},_0x2e9bc4,_0x3dcb53[_0x2098('0x4b')]);var _0x310fda={'where':_0x2e9bc4[_0x2098('0x47')]};return db[_0x2098('0x4c')]['count'](_0x310fda)[_0x2098('0x1e')](function(_0x2e29f6){_0x572f7c[_0x2098('0x2f')]=_0x2e29f6;if(_0x3dcb53['query'][_0x2098('0x4d')]){_0x2e9bc4[_0x2098('0x4e')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x2e9bc4);})[_0x2098('0x1e')](function(_0x23f258){_0x572f7c[_0x2098('0x4f')]=_0x23f258;return _0x572f7c;})[_0x2098('0x1e')](respondWithFilteredResult(_0x3adf07,_0x2e9bc4))['catch'](handleError(_0x3adf07,null));};exports[_0x2098('0x50')]=function(_0x37643f,_0x5cdf2b){var _0x1eee33={'raw':!![],'where':{'id':_0x37643f['params']['id']}},_0x4c23ec={};_0x4c23ec[_0x2098('0x3c')]=_[_0x2098('0x51')](db['WhatsappMessage'][_0x2098('0x39')]);_0x4c23ec[_0x2098('0x3d')]=_[_0x2098('0x51')](_0x37643f['query']);_0x4c23ec[_0x2098('0x3e')]=_['intersection'](_0x4c23ec[_0x2098('0x3c')],_0x4c23ec['query']);_0x1eee33[_0x2098('0x40')]=_[_0x2098('0x3f')](_0x4c23ec[_0x2098('0x3c')],qs[_0x2098('0x41')](_0x37643f[_0x2098('0x3d')][_0x2098('0x41')]));_0x1eee33[_0x2098('0x40')]=_0x1eee33[_0x2098('0x40')]['length']?_0x1eee33[_0x2098('0x40')]:_0x4c23ec[_0x2098('0x3c')];if(_0x37643f[_0x2098('0x3d')][_0x2098('0x4d')]){_0x1eee33[_0x2098('0x4e')]=[{'all':!![]}];}_0x1eee33=_[_0x2098('0x49')]({},_0x1eee33,_0x37643f[_0x2098('0x4b')]);return db[_0x2098('0x4c')][_0x2098('0x52')](_0x1eee33)[_0x2098('0x1e')](handleEntityNotFound(_0x5cdf2b,null))[_0x2098('0x1e')](respondWithResult(_0x5cdf2b,null))[_0x2098('0x29')](handleError(_0x5cdf2b,null));};exports[_0x2098('0x53')]=function(_0x3943f5,_0x3a6ec3){return db['WhatsappMessage'][_0x2098('0x53')](_0x3943f5[_0x2098('0x54')],{})[_0x2098('0x1e')](respondWithResult(_0x3a6ec3,0xc9))['catch'](handleError(_0x3a6ec3,null));};exports[_0x2098('0x32')]=function(_0x14b078,_0xd46391){if(_0x14b078[_0x2098('0x54')]['id']){delete _0x14b078[_0x2098('0x54')]['id'];}return db[_0x2098('0x4c')]['find']({'where':{'id':_0x14b078[_0x2098('0x55')]['id']}})[_0x2098('0x1e')](handleEntityNotFound(_0xd46391,null))['then'](saveUpdates(_0x14b078[_0x2098('0x54')],null))[_0x2098('0x1e')](respondWithResult(_0xd46391,null))[_0x2098('0x29')](handleError(_0xd46391,null));};exports[_0x2098('0x33')]=function(_0x8b5df7,_0x1e5164){return db[_0x2098('0x4c')][_0x2098('0x52')]({'where':{'id':_0x8b5df7['params']['id']}})[_0x2098('0x1e')](handleEntityNotFound(_0x1e5164,null))[_0x2098('0x1e')](removeEntity(_0x1e5164,null))[_0x2098('0x29')](handleError(_0x1e5164,null));};exports['describe']=function(_0x1f4d27,_0x452475){return db[_0x2098('0x4c')][_0x2098('0x56')]()[_0x2098('0x1e')](respondWithResult(_0x452475,null))[_0x2098('0x29')](handleError(_0x452475,null));};var interaction_log=require(_0x2098('0x57'))(_0x2098('0x58'));exports[_0x2098('0x59')]=function(_0x265dc9,_0x4f95ba,_0x14511a){var _0x79d8cd={'agent':{},'channel':_0x2098('0x5a')};if(_0x265dc9[_0x2098('0x54')]['id']){delete _0x265dc9['body']['id'];}_0x265dc9[_0x2098('0x54')]['read']=!![];_0x265dc9[_0x2098('0x54')]['readAt']=moment()[_0x2098('0x5b')](_0x2098('0x5c'));_0x265dc9[_0x2098('0x54')][_0x2098('0x5d')]=_0x265dc9[_0x2098('0x54')][_0x2098('0x5d')]||_0x265dc9[_0x2098('0x5e')]['id'];_0x79d8cd[_0x2098('0x5f')]['id']=_0x265dc9['body']['UserId'];return db[_0x2098('0x4c')][_0x2098('0x52')]({'where':{'id':_0x265dc9['params']['id'],'UserId':null}})[_0x2098('0x1e')](handleEntityNotFound(_0x4f95ba,null))[_0x2098('0x1e')](saveUpdates(_0x265dc9[_0x2098('0x54')],null))[_0x2098('0x1e')](function(_0x2144a5){if(_0x2144a5){_0x79d8cd[_0x2098('0x26')]=_0x2144a5[_0x2098('0x60')]({'plain':!![]});return db[_0x2098('0x61')]['find']({'where':{'id':_0x2144a5[_0x2098('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x4f95ba,null))[_0x2098('0x1e')](function(_0x504c83){if(_0x504c83){return _0x504c83[_0x2098('0x32')]({'UserId':_0x265dc9[_0x2098('0x54')][_0x2098('0x5d')],'read1stAt':_[_0x2098('0x63')](_0x504c83['read1stAt'])?moment()[_0x2098('0x5b')](_0x2098('0x5c')):undefined});}return null;})[_0x2098('0x1e')](function(_0x3d2a96){if(_0x3d2a96){_0x79d8cd[_0x2098('0x64')]=_0x3d2a96[_0x2098('0x60')]({'plain':!![]});interaction_log[_0x2098('0x27')](_0x2098('0x65'),_0x265dc9[_0x2098('0x5e')]['id'],_0x265dc9[_0x2098('0x5e')][_0x2098('0x36')],_0x265dc9[_0x2098('0x5e')][_0x2098('0x66')],_0x79d8cd['interaction']['id'],_0x265dc9['body']?JSON[_0x2098('0x23')](_0x265dc9['body']):'null');return respondWithRpcPromise(_0x2098('0x67'),_0x2098('0x68'),_0x79d8cd);}return null;})[_0x2098('0x1e')](function(_0x1bc040){var _0x156030=_0x2098('0x69')+_0x1bc040['message'][_0x2098('0x6a')];return db[_0x2098('0x6b')]['query'](_0x156030,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x2098('0x1e')](function(_0x332a71){return _0x332a71;});})['then'](function(_0x5dd835){if(_0x5dd835){_0x79d8cd['message']['contact']=_0x5dd835[0x0];if(!_0x265dc9['body'][_0x2098('0x5d')])return;return db['User']['find']({'where':{'id':_0x265dc9[_0x2098('0x54')][_0x2098('0x5d')],'role':_0x2098('0x5f')},'attributes':['id',_0x2098('0x36'),_0x2098('0x6c'),'email','internal'],'raw':!![]});}return null;})[_0x2098('0x1e')](function(_0x51a39b){if(!_0x51a39b)return null;_0x79d8cd[_0x2098('0x26')][_0x2098('0x5f')]=_0x51a39b;return _0x79d8cd;})[_0x2098('0x1e')](function(_0xa01768){if(_0xa01768){if(_0x265dc9[_0x2098('0x54')][_0x2098('0x6d')]){_0x79d8cd[_0x2098('0x26')][_0x2098('0x6e')]=util[_0x2098('0x5b')](_0x2098('0x6f'),_0x265dc9[_0x2098('0x5e')][_0x2098('0x36')]);_0x79d8cd[_0x2098('0x26')][_0x2098('0x70')]=_0x79d8cd[_0x2098('0x70')];_0x79d8cd[_0x2098('0x26')][_0x2098('0x71')]=_0x79d8cd[_0x2098('0x70')];_0x79d8cd[_0x2098('0x26')][_0x2098('0x72')]='accept';return respondWithRpcPromise(_0x2098('0x73'),_0x2098('0x73'),{'event':_0x2098('0x74'),'message':_0x79d8cd[_0x2098('0x26')]},client9002)['then'](function(){return _0x79d8cd;});}return _0x79d8cd;}return null;})[_0x2098('0x1e')](respondWithResult(_0x4f95ba,null))[_0x2098('0x29')](handleError(_0x4f95ba,null));};var interaction_log=require(_0x2098('0x57'))(_0x2098('0x58'));exports[_0x2098('0x75')]=function(_0x28bd34,_0x72a608,_0x303d3c){var _0x1e0758={'agent':{},'channel':'whatsapp'};if(_0x28bd34[_0x2098('0x54')]['id']){delete _0x28bd34[_0x2098('0x54')]['id'];}_0x28bd34[_0x2098('0x54')][_0x2098('0x5d')]=_0x28bd34['body'][_0x2098('0x5d')]||_0x28bd34[_0x2098('0x5e')]['id'];_0x1e0758[_0x2098('0x5f')]['id']=_0x28bd34[_0x2098('0x54')][_0x2098('0x5d')];return db['WhatsappMessage'][_0x2098('0x52')]({'where':{'id':_0x28bd34[_0x2098('0x55')]['id'],'UserId':null}})[_0x2098('0x1e')](handleEntityNotFound(_0x72a608,null))['then'](function(_0x96bcdc){if(_0x96bcdc){_0x1e0758[_0x2098('0x26')]=_0x96bcdc[_0x2098('0x60')]({'plain':!![]});return db[_0x2098('0x61')][_0x2098('0x52')]({'where':{'id':_0x96bcdc[_0x2098('0x62')]}});}return null;})[_0x2098('0x1e')](handleEntityNotFound(_0x72a608,null))['then'](function(_0x53176b){if(_0x53176b){_0x1e0758['interaction']=_0x53176b[_0x2098('0x60')]({'plain':!![]});interaction_log[_0x2098('0x27')](_0x2098('0x76'),_0x28bd34['user']['id'],_0x28bd34[_0x2098('0x5e')][_0x2098('0x36')],_0x28bd34[_0x2098('0x5e')][_0x2098('0x66')],_0x1e0758[_0x2098('0x64')]['id'],_0x28bd34[_0x2098('0x54')]?JSON[_0x2098('0x23')](_0x28bd34['body']):_0x2098('0x77'));return respondWithRpcPromise(_0x2098('0x78'),_0x2098('0x79'),_0x1e0758);}return null;})[_0x2098('0x1e')](function(_0x4f657a){var _0x425365='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4f657a[_0x2098('0x26')][_0x2098('0x6a')];return db[_0x2098('0x6b')][_0x2098('0x3d')](_0x425365,{'type':db[_0x2098('0x7a')][_0x2098('0x7b')][_0x2098('0x7c')],'raw':!![]})[_0x2098('0x1e')](function(_0x7c327a){return _0x7c327a;});})[_0x2098('0x1e')](function(_0x6024c5){if(_0x6024c5){_0x1e0758[_0x2098('0x26')]['contact']=_0x6024c5[0x0];if(!_0x28bd34['body'][_0x2098('0x5d')])return;return db[_0x2098('0x7d')][_0x2098('0x52')]({'where':{'id':_0x28bd34['body'][_0x2098('0x5d')],'role':'agent'},'attributes':['id',_0x2098('0x36'),_0x2098('0x6c'),_0x2098('0x7e'),_0x2098('0x7f')],'raw':!![]});}return null;})['then'](function(_0x509f9b){if(!_0x509f9b)return null;_0x1e0758[_0x2098('0x26')][_0x2098('0x5f')]=_0x509f9b;return _0x1e0758;})['then'](function(_0x16c787){if(_0x16c787){_0x16c787[_0x2098('0x26')][_0x2098('0x6e')]=util[_0x2098('0x5b')](_0x2098('0x6f'),_0x28bd34[_0x2098('0x5e')]['name']);_0x16c787[_0x2098('0x26')]['channel']=_0x1e0758[_0x2098('0x70')];_0x16c787[_0x2098('0x26')]['motionChannel']=_0x1e0758[_0x2098('0x70')];_0x16c787[_0x2098('0x26')][_0x2098('0x72')]='reject';respondWithRpcPromise(_0x2098('0x73'),_0x2098('0x73'),{'event':_0x2098('0x80'),'message':_0x16c787[_0x2098('0x26')]},client9002);return _0x1e0758;}return null;})[_0x2098('0x1e')](respondWithResult(_0x72a608,null))[_0x2098('0x29')](handleError(_0x72a608,null));};exports[_0x2098('0x2a')]=function(_0x3aa55f,_0x787df0,_0x16f0f9){if(_0x3aa55f[_0x2098('0x54')]['id']){delete _0x3aa55f[_0x2098('0x54')]['id'];}var _0x46c1e9;return db[_0x2098('0x4c')][_0x2098('0x52')]({'where':{'id':_0x3aa55f[_0x2098('0x55')]['id']}})['then'](handleEntityNotFound(_0x787df0,null))[_0x2098('0x1e')](function(_0x4881e7){if(_0x4881e7){_0x46c1e9=_0x4881e7;return db[_0x2098('0x81')][_0x2098('0x52')]({'where':{'id':_0x4881e7[_0x2098('0x82')]}});}})[_0x2098('0x1e')](handleEntityNotFound(_0x787df0,null))['then'](function(_0x177826){if(_0x177826){logger[_0x2098('0x21')](_0x2098('0x83'),_0x2098('0x2a'),'received\x20delivery\x20report\x20from',_0x177826[_0x2098('0x3a')],util[_0x2098('0x84')](_0x3aa55f[_0x2098('0x54')],{'showHidden':![],'depth':null}));switch(_0x177826[_0x2098('0x3a')]){case _0x2098('0x85'):if(_0x3aa55f[_0x2098('0x54')]['MessageSid']&&_0x3aa55f[_0x2098('0x54')]['MessageSid']===_0x46c1e9[_0x2098('0x86')]&&_0x3aa55f['body'][_0x2098('0x87')]&&_0x3aa55f['body'][_0x2098('0x87')]===_0x2098('0x88')){return _0x46c1e9[_0x2098('0x32')]({'read':!![]});}else{logger[_0x2098('0x24')](_0x2098('0x89'),_0x2098('0x2a'),'twilio',util[_0x2098('0x84')](_0x3aa55f['body'],{'showHidden':![],'depth':null}));}break;}return _0x46c1e9;}})['then'](respondWithResult(_0x787df0,null))[_0x2098('0x29')](handleError(_0x787df0,null));};
\ No newline at end of file
index 2a71386..73978e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7af2=['hook','../../mysqldb','WhatsappMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x472204,_0x281f41){var _0x2da08c=function(_0x966ebc){while(--_0x966ebc){_0x472204['push'](_0x472204['shift']());}};_0x2da08c(++_0x281f41);}(_0x7af2,0x119));var _0x27af=function(_0x53874d,_0x522af1){_0x53874d=_0x53874d-0x0;var _0x391c4e=_0x7af2[_0x53874d];return _0x391c4e;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x27af('0x0'))['db'][_0x27af('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x27af('0x2')](0x0);var events={'afterCreate':_0x27af('0x3'),'afterUpdate':'update','afterDestroy':_0x27af('0x4')};function emitEvent(_0x1067e7){return function(_0x709cb6,_0x2a542f,_0x22ae46){WhatsappMessageEvents[_0x27af('0x5')](_0x1067e7+':'+_0x709cb6['id'],_0x709cb6);WhatsappMessageEvents[_0x27af('0x5')](_0x1067e7,_0x709cb6);_0x22ae46(null);};}for(var e in events){if(events[_0x27af('0x6')](e)){var event=events[e];WhatsappMessage[_0x27af('0x7')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents;
\ No newline at end of file
+var _0xe1e3=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','remove','emit'];(function(_0x500cfa,_0x5de336){var _0x22e6bd=function(_0x3c6f18){while(--_0x3c6f18){_0x500cfa['push'](_0x500cfa['shift']());}};_0x22e6bd(++_0x5de336);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x1bafac,_0x88945e){_0x1bafac=_0x1bafac-0x0;var _0x14a6c8=_0xe1e3[_0x1bafac];return _0x14a6c8;};'use strict';var EventEmitter=require(_0x3e1e('0x0'));var WhatsappMessage=require(_0x3e1e('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x3e1e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3e1e('0x3')};function emitEvent(_0x4d5360){return function(_0x3bacc,_0x5a11ef,_0x1abd25){WhatsappMessageEvents[_0x3e1e('0x4')](_0x4d5360+':'+_0x3bacc['id'],_0x3bacc);WhatsappMessageEvents[_0x3e1e('0x4')](_0x4d5360,_0x3bacc);_0x1abd25(null);};}for(var e in events){if(events[_0x3e1e('0x5')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x3e1e('0x6')]=WhatsappMessageEvents;
\ No newline at end of file
index 6a33a82..ae9c0a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2962=['whatsapp:','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','POST','application/json','message_id','statuses','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','WhatsappMessage','messageId','fti_whatsapp_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','then','update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','accountSid','authToken','phone','messages','create'];(function(_0x478ee1,_0x1d974e){var _0x48dc22=function(_0x307622){while(--_0x307622){_0x478ee1['push'](_0x478ee1['shift']());}};_0x48dc22(++_0x1d974e);}(_0x2962,0xca));var _0x2296=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x2962[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x2296('0x0'));var util=require(_0x2296('0x1'));var logger=require(_0x2296('0x2'))(_0x2296('0x3'));var moment=require('moment');var BPromise=require(_0x2296('0x4'));var rp=require('request-promise');var fetch=require(_0x2296('0x5'));var fs=require('fs');var path=require(_0x2296('0x6'));var rimraf=require(_0x2296('0x7'));var config=require(_0x2296('0x8'));var attributes=require(_0x2296('0x9'));module['exports']=function(_0x33bbaf,_0x3442b6){return _0x33bbaf[_0x2296('0xa')](_0x2296('0xb'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x2296('0xc'),'fields':[_0x2296('0xc')]},{'name':_0x2296('0xd'),'fields':[_0x2296('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x540252,_0x20461c,_0x1364c1){var _0x4f1f2c=_0x33bbaf[_0x2296('0xf')];var _0x1c88b3=_0x540252[_0x2296('0x10')]({'plain':!![]});if(_0x1c88b3[_0x2296('0x11')][_0x2296('0x12')]()==='in'||_0x1c88b3[_0x2296('0x11')][_0x2296('0x12')]()===_0x2296('0x13')&&!_0x1c88b3[_0x2296('0x14')]&&!_[_0x2296('0x15')](_0x1c88b3[_0x2296('0x16')])){_0x4f1f2c[_0x2296('0x17')]['findOne']({'where':{'id':_0x1c88b3['WhatsappInteractionId']}})[_0x2296('0x18')](function(_0x44f33f){if(_0x44f33f){_0x44f33f[_0x2296('0x19')]({'lastMsgAt':_0x1c88b3[_0x2296('0x1a')],'lastMsgDirection':_0x1c88b3[_0x2296('0x11')][_0x2296('0x12')]()});}})[_0x2296('0x1b')](function(_0x4eb79f){console[_0x2296('0x1c')](_0x4eb79f);});}if(_0x1c88b3[_0x2296('0x11')]===_0x2296('0x13')&&!_0x1c88b3[_0x2296('0x14')]){var _0x1478da;_0x4f1f2c[_0x2296('0x1d')][_0x2296('0x1e')]({'where':{'id':_0x1c88b3[_0x2296('0x1f')]},'raw':!![]})[_0x2296('0x18')](function(_0x128b3b){_0x1478da=_0x128b3b;if(_0x1478da&&_0x1478da[_0x2296('0x20')]){switch(_0x1478da[_0x2296('0x20')]){case'twilio':var _0x388444=require('twilio');if(_0x1478da[_0x2296('0x21')]&&_0x1478da[_0x2296('0x22')]&&_0x1478da[_0x2296('0x23')]){var _0x434e2e=new _0x388444(_0x1478da[_0x2296('0x21')],_0x1478da[_0x2296('0x22')]);_0x434e2e[_0x2296('0x24')][_0x2296('0x25')]({'body':_0x1c88b3[_0x2296('0xe')],'to':_0x2296('0x26')+_0x1c88b3[_0x2296('0x23')],'from':_0x2296('0x26')+_0x1478da[_0x2296('0x23')],'statusCallback':_0x1478da['remote']+_0x2296('0x27')+_0x1c88b3['id']+_0x2296('0x28')+_0x1478da[_0x2296('0x29')]})[_0x2296('0x18')](function(_0x3a7d9c){if(_0x3a7d9c['sid']){return _0x540252[_0x2296('0x19')]({'messageId':_0x3a7d9c[_0x2296('0x2a')]});}})[_0x2296('0x1b')](function(_0x2accb7){logger['error'](_0x2296('0x2b'),_0x2296('0x2c'),_0x2296('0x2d'),util[_0x2296('0x2e')](_0x2accb7,{'showHidden':![],'depth':null}));});}else{logger[_0x2296('0x1c')](_0x2296('0x2b'),'afterCreate','twilio',_0x2296('0x2f'));}break;case _0x2296('0x30'):var _0x35d423=_0x1478da[_0x2296('0x21')];var _0x6cb3c9=_0x1478da['authToken'];var _0x19fe0b=_0x1478da[_0x2296('0x31')]+_0x2296('0x32')+_0x35d423+_0x2296('0x33');var _0x9ea9ca={'to':[_0x1c88b3[_0x2296('0x23')]],'message':{'type':'text','text':_0x1c88b3[_0x2296('0xe')]}};var _0x162419={'method':_0x2296('0x34'),'uri':_0x19fe0b,'headers':{'Authorization':'Bearer\x20'+_0x6cb3c9,'Content-Type':_0x2296('0x35')},'body':_0x9ea9ca,'json':!![]};rp(_0x162419)[_0x2296('0x18')](function(_0xd6cf20){if(_0xd6cf20['statuses'][0x0][_0x2296('0x36')]){return _0x540252[_0x2296('0x19')]({'messageId':_0xd6cf20[_0x2296('0x37')][0x0]['message_id']});}})[_0x2296('0x1b')](function(_0x1eda8f){logger['err'](_0x2296('0x38'),_0x1eda8f);});break;}}})[_0x2296('0x39')](function(){_0x1364c1();});}else{_0x1364c1();}}},'charset':_0x2296('0x3a'),'collate':_0x2296('0x3b')});};
\ No newline at end of file
+var _0xb2d8=['define','WhatsappMessage','whatsapp_messages','messageId','body','FULLTEXT','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','then','update','createdAt','catch','type','authToken','phone','accountSid','create','whatsapp:','/api/whatsapp/messages/','/status?token=','token','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','/messages/','text','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','request-promise','node-fetch','path','rimraf','../../config/environment'];(function(_0x4c86e6,_0x51a196){var _0x512314=function(_0x449789){while(--_0x449789){_0x4c86e6['push'](_0x4c86e6['shift']());}};_0x512314(++_0x51a196);}(_0xb2d8,0x94));var _0x8b2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb2d8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x8b2d('0x0'));var logger=require(_0x8b2d('0x1'))('api');var moment=require(_0x8b2d('0x2'));var BPromise=require('bluebird');var rp=require(_0x8b2d('0x3'));var fetch=require(_0x8b2d('0x4'));var fs=require('fs');var path=require(_0x8b2d('0x5'));var rimraf=require(_0x8b2d('0x6'));var config=require(_0x8b2d('0x7'));var attributes=require('./whatsappMessage.attributes');module['exports']=function(_0x4536cb,_0x136776){return _0x4536cb[_0x8b2d('0x8')](_0x8b2d('0x9'),attributes,{'tableName':_0x8b2d('0xa'),'paranoid':![],'indexes':[{'name':_0x8b2d('0xb'),'fields':[_0x8b2d('0xb')]},{'name':'fti_whatsapp_messages','fields':[_0x8b2d('0xc')],'type':_0x8b2d('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5f0c5d,_0x1ceaab,_0x2beca9){var _0x4610dc=_0x4536cb['models'];var _0x32b277=_0x5f0c5d['get']({'plain':!![]});if(_0x32b277[_0x8b2d('0xe')][_0x8b2d('0xf')]()==='in'||_0x32b277[_0x8b2d('0xe')][_0x8b2d('0xf')]()===_0x8b2d('0x10')&&!_0x32b277[_0x8b2d('0x11')]&&!_[_0x8b2d('0x12')](_0x32b277[_0x8b2d('0x13')])){_0x4610dc[_0x8b2d('0x14')][_0x8b2d('0x15')]({'where':{'id':_0x32b277['WhatsappInteractionId']}})[_0x8b2d('0x16')](function(_0x1263d9){if(_0x1263d9){_0x1263d9[_0x8b2d('0x17')]({'lastMsgAt':_0x32b277[_0x8b2d('0x18')],'lastMsgDirection':_0x32b277[_0x8b2d('0xe')][_0x8b2d('0xf')]()});}})[_0x8b2d('0x19')](function(_0x53e092){console['error'](_0x53e092);});}if(_0x32b277[_0x8b2d('0xe')]===_0x8b2d('0x10')&&!_0x32b277['secret']){var _0x447879;_0x4610dc['WhatsappAccount']['find']({'where':{'id':_0x32b277['WhatsappAccountId']},'raw':!![]})[_0x8b2d('0x16')](function(_0x2a67e6){_0x447879=_0x2a67e6;if(_0x447879&&_0x447879[_0x8b2d('0x1a')]){switch(_0x447879[_0x8b2d('0x1a')]){case'twilio':var _0x30228e=require('twilio');if(_0x447879['accountSid']&&_0x447879[_0x8b2d('0x1b')]&&_0x447879[_0x8b2d('0x1c')]){var _0x4ca115=new _0x30228e(_0x447879[_0x8b2d('0x1d')],_0x447879['authToken']);_0x4ca115['messages'][_0x8b2d('0x1e')]({'body':_0x32b277[_0x8b2d('0xc')],'to':_0x8b2d('0x1f')+_0x32b277[_0x8b2d('0x1c')],'from':'whatsapp:'+_0x447879[_0x8b2d('0x1c')],'statusCallback':_0x447879['remote']+_0x8b2d('0x20')+_0x32b277['id']+_0x8b2d('0x21')+_0x447879[_0x8b2d('0x22')]})[_0x8b2d('0x16')](function(_0x4e4134){if(_0x4e4134[_0x8b2d('0x23')]){return _0x5f0c5d[_0x8b2d('0x17')]({'messageId':_0x4e4134['sid']});}})[_0x8b2d('0x19')](function(_0x2b423f){logger[_0x8b2d('0x24')](_0x8b2d('0x25'),_0x8b2d('0x26'),'twilio',util[_0x8b2d('0x27')](_0x2b423f,{'showHidden':![],'depth':null}));});}else{logger[_0x8b2d('0x24')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x8b2d('0x26'),_0x8b2d('0x28'),_0x8b2d('0x29'));}break;case'sinch':var _0x5d041f=_0x447879[_0x8b2d('0x1d')];var _0x36422c=_0x447879[_0x8b2d('0x1b')];var _0x222186=_0x447879['baseUrl']+'/whatsapp/v1/'+_0x5d041f+_0x8b2d('0x2a');var _0x379295={'to':[_0x32b277[_0x8b2d('0x1c')]],'message':{'type':_0x8b2d('0x2b'),'text':_0x32b277[_0x8b2d('0xc')]}};var _0x55d1e0={'method':'POST','uri':_0x222186,'headers':{'Authorization':'Bearer\x20'+_0x36422c,'Content-Type':_0x8b2d('0x2c')},'body':_0x379295,'json':!![]};rp(_0x55d1e0)[_0x8b2d('0x16')](function(_0xbbdc37){if(_0xbbdc37[_0x8b2d('0x2d')][0x0][_0x8b2d('0x2e')]){return _0x5f0c5d['update']({'messageId':_0xbbdc37[_0x8b2d('0x2d')][0x0]['message_id']});}})[_0x8b2d('0x19')](function(_0x4d9bf5){logger[_0x8b2d('0x2f')](_0x8b2d('0x30'),_0x4d9bf5);});break;}}})[_0x8b2d('0x31')](function(){_0x2beca9();});}else{_0x2beca9();}}},'charset':_0x8b2d('0x32'),'collate':_0x8b2d('0x33')});};
\ No newline at end of file
index e0bbc76..b5142e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe9e=['WhatsappMessage','body','options','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost','./whatsappMessage.socket','register','request','then','info','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappMessage,\x20%s,\x20%s','result','catch','CreateWhatsappMessage'];(function(_0x2965f5,_0x249c7d){var _0x3d8a7f=function(_0x487f13){while(--_0x487f13){_0x2965f5['push'](_0x2965f5['shift']());}};_0x3d8a7f(++_0x249c7d);}(_0xfe9e,0x190));var _0xefe9=function(_0x1d0e07,_0x2037e9){_0x1d0e07=_0x1d0e07-0x0;var _0x8912e0=_0xfe9e[_0x1d0e07];return _0x8912e0;};'use strict';var _=require(_0xefe9('0x0'));var util=require(_0xefe9('0x1'));var moment=require(_0xefe9('0x2'));var BPromise=require(_0xefe9('0x3'));var rs=require(_0xefe9('0x4'));var fs=require('fs');var Redis=require(_0xefe9('0x5'));var db=require(_0xefe9('0x6'))['db'];var utils=require(_0xefe9('0x7'));var logger=require(_0xefe9('0x8'))('rpc');var config=require(_0xefe9('0x9'));var jayson=require(_0xefe9('0xa'));var client=jayson[_0xefe9('0xb')]['http']({'port':0x232a});config[_0xefe9('0xc')]=_['defaults'](config[_0xefe9('0xc')],{'host':_0xefe9('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xefe9('0xe'))[_0xefe9('0xf')](socket);function respondWithRpcPromise(_0x34beec,_0x2348e0,_0x2dfdc4){return new BPromise(function(_0x47db7d,_0x57ad14){return client[_0xefe9('0x10')](_0x34beec,_0x2dfdc4)[_0xefe9('0x11')](function(_0x1877dd){logger[_0xefe9('0x12')]('WhatsappMessage,\x20%s,\x20%s',_0x2348e0,_0xefe9('0x13'));logger['debug'](_0xefe9('0x14'),_0x2348e0,_0xefe9('0x13'),JSON[_0xefe9('0x15')](_0x1877dd));if(_0x1877dd[_0xefe9('0x16')]){if(_0x1877dd[_0xefe9('0x16')][_0xefe9('0x17')]===0x1f4){logger[_0xefe9('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x2348e0,_0x1877dd[_0xefe9('0x16')][_0xefe9('0x18')]);return _0x57ad14(_0x1877dd[_0xefe9('0x16')][_0xefe9('0x18')]);}logger[_0xefe9('0x16')](_0xefe9('0x19'),_0x2348e0,_0x1877dd['error'][_0xefe9('0x18')]);return _0x47db7d(_0x1877dd[_0xefe9('0x16')]['message']);}else{logger[_0xefe9('0x12')](_0xefe9('0x19'),_0x2348e0,_0xefe9('0x13'));_0x47db7d(_0x1877dd[_0xefe9('0x1a')][_0xefe9('0x18')]);}})[_0xefe9('0x1b')](function(_0x488ff1){logger[_0xefe9('0x16')](_0xefe9('0x19'),_0x2348e0,_0x488ff1);_0x57ad14(_0x488ff1);});});}exports[_0xefe9('0x1c')]=function(_0x592f55){var _0x4add26=this;return new Promise(function(_0x5f2f87,_0x186cd0){return db[_0xefe9('0x1d')]['create'](_0x592f55[_0xefe9('0x1e')],{'raw':_0x592f55[_0xefe9('0x1f')]?_0x592f55[_0xefe9('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0xefe9('0x11')](function(_0x2e5060){logger[_0xefe9('0x12')]('CreateWhatsappMessage',_0x592f55);logger[_0xefe9('0x20')]('CreateWhatsappMessage',_0x592f55,JSON[_0xefe9('0x15')](_0x2e5060));_0x5f2f87(_0x2e5060);})[_0xefe9('0x1b')](function(_0x2ad4f9){logger['error'](_0xefe9('0x1c'),_0x2ad4f9[_0xefe9('0x18')],_0x592f55);_0x186cd0(_0x4add26[_0xefe9('0x16')](0x1f4,_0x2ad4f9[_0xefe9('0x18')]));});});};
\ No newline at end of file
+var _0xc8dd=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','./whatsappMessage.socket','register','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','then','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xc8dd,0x102));var _0xdc8d=function(_0x263f4c,_0x438626){_0x263f4c=_0x263f4c-0x0;var _0x3a78d3=_0xc8dd[_0x263f4c];return _0x3a78d3;};'use strict';var _=require('lodash');var util=require(_0xdc8d('0x0'));var moment=require(_0xdc8d('0x1'));var BPromise=require(_0xdc8d('0x2'));var rs=require(_0xdc8d('0x3'));var fs=require('fs');var Redis=require(_0xdc8d('0x4'));var db=require(_0xdc8d('0x5'))['db'];var utils=require(_0xdc8d('0x6'));var logger=require(_0xdc8d('0x7'))(_0xdc8d('0x8'));var config=require('../../config/environment');var jayson=require(_0xdc8d('0x9'));var client=jayson[_0xdc8d('0xa')][_0xdc8d('0xb')]({'port':0x232a});config[_0xdc8d('0xc')]=_[_0xdc8d('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdc8d('0xe'))[_0xdc8d('0xf')](socket);function respondWithRpcPromise(_0x53c127,_0xe964e,_0x6df8ec){return new BPromise(function(_0x43b063,_0x25d5a0){return client[_0xdc8d('0x10')](_0x53c127,_0x6df8ec)['then'](function(_0x311d0f){logger[_0xdc8d('0x11')](_0xdc8d('0x12'),_0xe964e,_0xdc8d('0x13'));logger['debug'](_0xdc8d('0x14'),_0xe964e,'request\x20sent',JSON[_0xdc8d('0x15')](_0x311d0f));if(_0x311d0f[_0xdc8d('0x16')]){if(_0x311d0f['error']['code']===0x1f4){logger[_0xdc8d('0x16')](_0xdc8d('0x12'),_0xe964e,_0x311d0f['error'][_0xdc8d('0x17')]);return _0x25d5a0(_0x311d0f[_0xdc8d('0x16')][_0xdc8d('0x17')]);}logger[_0xdc8d('0x16')](_0xdc8d('0x12'),_0xe964e,_0x311d0f[_0xdc8d('0x16')]['message']);return _0x43b063(_0x311d0f[_0xdc8d('0x16')][_0xdc8d('0x17')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0xe964e,_0xdc8d('0x13'));_0x43b063(_0x311d0f[_0xdc8d('0x18')][_0xdc8d('0x17')]);}})['catch'](function(_0x474f94){logger['error'](_0xdc8d('0x12'),_0xe964e,_0x474f94);_0x25d5a0(_0x474f94);});});}exports[_0xdc8d('0x19')]=function(_0x4312d8){var _0x2c8f65=this;return new Promise(function(_0xbfb95,_0x354222){return db[_0xdc8d('0x1a')][_0xdc8d('0x1b')](_0x4312d8[_0xdc8d('0x1c')],{'raw':_0x4312d8['options']?_0x4312d8[_0xdc8d('0x1d')][_0xdc8d('0x1e')]===undefined?!![]:![]:!![]})[_0xdc8d('0x1f')](function(_0x1faa81){logger['info'](_0xdc8d('0x19'),_0x4312d8);logger[_0xdc8d('0x20')](_0xdc8d('0x19'),_0x4312d8,JSON[_0xdc8d('0x15')](_0x1faa81));_0xbfb95(_0x1faa81);})['catch'](function(_0x21ef1b){logger[_0xdc8d('0x16')](_0xdc8d('0x19'),_0x21ef1b[_0xdc8d('0x17')],_0x4312d8);_0x354222(_0x2c8f65[_0xdc8d('0x16')](0x1f4,_0x21ef1b[_0xdc8d('0x17')]));});});};
\ No newline at end of file
index f8f7984..ce8752d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1991=['length','whatsappMessage:','./whatsappMessage.events','save','remove','update','emit','removeListener','register'];(function(_0xbf1870,_0x53acd9){var _0x5324b1=function(_0x1b8ee9){while(--_0x1b8ee9){_0xbf1870['push'](_0xbf1870['shift']());}};_0x5324b1(++_0x53acd9);}(_0x1991,0x107));var _0x1199=function(_0x43f5be,_0x119556){_0x43f5be=_0x43f5be-0x0;var _0x58257d=_0x1991[_0x43f5be];return _0x58257d;};'use strict';var WhatsappMessageEvents=require(_0x1199('0x0'));var events=[_0x1199('0x1'),_0x1199('0x2'),_0x1199('0x3')];function createListener(_0x4cb5a9,_0x4ce0b1){return function(_0x3ee123){_0x4ce0b1[_0x1199('0x4')](_0x4cb5a9,_0x3ee123);};}function removeListener(_0x2e6b4d,_0x1c4213){return function(){WhatsappMessageEvents[_0x1199('0x5')](_0x2e6b4d,_0x1c4213);};}exports[_0x1199('0x6')]=function(_0x1d5a7c){for(var _0x3a7de2=0x0,_0x205eaf=events[_0x1199('0x7')];_0x3a7de2<_0x205eaf;_0x3a7de2++){var _0x34e907=events[_0x3a7de2];var _0x1297b1=createListener(_0x1199('0x8')+_0x34e907,_0x1d5a7c);WhatsappMessageEvents['on'](_0x34e907,_0x1297b1);}};
\ No newline at end of file
+var _0x5597=['removeListener','register','length','./whatsappMessage.events','update','emit'];(function(_0x7f660f,_0x154ec5){var _0x5d8fe4=function(_0x56bdf6){while(--_0x56bdf6){_0x7f660f['push'](_0x7f660f['shift']());}};_0x5d8fe4(++_0x154ec5);}(_0x5597,0xb1));var _0x7559=function(_0xb0bdc8,_0x3888c0){_0xb0bdc8=_0xb0bdc8-0x0;var _0x52ae4b=_0x5597[_0xb0bdc8];return _0x52ae4b;};'use strict';var WhatsappMessageEvents=require(_0x7559('0x0'));var events=['save','remove',_0x7559('0x1')];function createListener(_0x3f1b39,_0x295026){return function(_0x253bf5){_0x295026[_0x7559('0x2')](_0x3f1b39,_0x253bf5);};}function removeListener(_0x22e6e6,_0x2c9cc8){return function(){WhatsappMessageEvents[_0x7559('0x3')](_0x22e6e6,_0x2c9cc8);};}exports[_0x7559('0x4')]=function(_0x5e725a){for(var _0x362ea0=0x0,_0x3b534b=events[_0x7559('0x5')];_0x362ea0<_0x3b534b;_0x362ea0++){var _0x108355=events[_0x362ea0];var _0x5be5cc=createListener('whatsappMessage:'+_0x108355,_0x5e725a);WhatsappMessageEvents['on'](_0x108355,_0x5be5cc);}};
\ No newline at end of file
index c183e76..d942953 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c6d=['addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueue.controller','get','isAuthenticated','index','/describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','post'];(function(_0x4aec37,_0x1c72a5){var _0x52a663=function(_0x3a6a80){while(--_0x3a6a80){_0x4aec37['push'](_0x4aec37['shift']());}};_0x52a663(++_0x1c72a5);}(_0x6c6d,0x12b));var _0xd6c6=function(_0x3ad935,_0x209700){_0x3ad935=_0x3ad935-0x0;var _0x5d6602=_0x6c6d[_0x3ad935];return _0x5d6602;};'use strict';var multer=require(_0xd6c6('0x0'));var util=require(_0xd6c6('0x1'));var path=require('path');var timeout=require(_0xd6c6('0x2'));var express=require(_0xd6c6('0x3'));var router=express[_0xd6c6('0x4')]();var fs_extra=require(_0xd6c6('0x5'));var auth=require(_0xd6c6('0x6'));var interaction=require(_0xd6c6('0x7'));var config=require('../../config/environment');var controller=require(_0xd6c6('0x8'));router[_0xd6c6('0x9')]('/',auth[_0xd6c6('0xa')](),controller[_0xd6c6('0xb')]);router['get'](_0xd6c6('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xd6c6('0x9')](_0xd6c6('0xd'),auth[_0xd6c6('0xa')](),controller[_0xd6c6('0xe')]);router[_0xd6c6('0x9')]('/:id/members',auth[_0xd6c6('0xa')](),controller[_0xd6c6('0xf')]);router[_0xd6c6('0x9')](_0xd6c6('0x10'),auth[_0xd6c6('0xa')](),controller[_0xd6c6('0x11')]);router[_0xd6c6('0x9')](_0xd6c6('0x12'),auth[_0xd6c6('0xa')](),controller['getAgents']);router[_0xd6c6('0x13')]('/',auth[_0xd6c6('0xa')](),controller['create']);router[_0xd6c6('0x13')](_0xd6c6('0x10'),auth[_0xd6c6('0xa')](),controller[_0xd6c6('0x14')]);router[_0xd6c6('0x13')](_0xd6c6('0x12'),auth[_0xd6c6('0xa')](),controller[_0xd6c6('0x15')]);router[_0xd6c6('0x16')](_0xd6c6('0xd'),auth['isAuthenticated'](),controller[_0xd6c6('0x17')]);router[_0xd6c6('0x18')](_0xd6c6('0xd'),auth[_0xd6c6('0xa')](),controller[_0xd6c6('0x19')]);router[_0xd6c6('0x18')](_0xd6c6('0x10'),auth[_0xd6c6('0xa')](),controller[_0xd6c6('0x1a')]);router[_0xd6c6('0x18')](_0xd6c6('0x12'),auth[_0xd6c6('0xa')](),controller[_0xd6c6('0x1b')]);module[_0xd6c6('0x1c')]=router;
\ No newline at end of file
+var _0x9f34=['/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','create','post','addTeams','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','index','get'];(function(_0x534f7c,_0x3eb489){var _0x5c3e22=function(_0x5dd4a4){while(--_0x5dd4a4){_0x534f7c['push'](_0x534f7c['shift']());}};_0x5c3e22(++_0x3eb489);}(_0x9f34,0x8b));var _0x49f3=function(_0x11e791,_0x2ddd){_0x11e791=_0x11e791-0x0;var _0x480d02=_0x9f34[_0x11e791];return _0x480d02;};'use strict';var multer=require(_0x49f3('0x0'));var util=require(_0x49f3('0x1'));var path=require('path');var timeout=require(_0x49f3('0x2'));var express=require('express');var router=express[_0x49f3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x49f3('0x4'));var interaction=require(_0x49f3('0x5'));var config=require(_0x49f3('0x6'));var controller=require(_0x49f3('0x7'));router['get']('/',auth[_0x49f3('0x8')](),controller[_0x49f3('0x9')]);router[_0x49f3('0xa')](_0x49f3('0xb'),auth[_0x49f3('0x8')](),controller[_0x49f3('0xc')]);router[_0x49f3('0xa')](_0x49f3('0xd'),auth[_0x49f3('0x8')](),controller[_0x49f3('0xe')]);router[_0x49f3('0xa')](_0x49f3('0xf'),auth[_0x49f3('0x8')](),controller[_0x49f3('0x10')]);router[_0x49f3('0xa')](_0x49f3('0x11'),auth['isAuthenticated'](),controller[_0x49f3('0x12')]);router[_0x49f3('0xa')]('/:id/users',auth['isAuthenticated'](),controller[_0x49f3('0x13')]);router['post']('/',auth[_0x49f3('0x8')](),controller[_0x49f3('0x14')]);router[_0x49f3('0x15')](_0x49f3('0x11'),auth[_0x49f3('0x8')](),controller[_0x49f3('0x16')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x49f3('0x17')](_0x49f3('0xd'),auth[_0x49f3('0x8')](),controller[_0x49f3('0x18')]);router[_0x49f3('0x19')](_0x49f3('0xd'),auth[_0x49f3('0x8')](),controller[_0x49f3('0x1a')]);router[_0x49f3('0x19')]('/:id/teams',auth[_0x49f3('0x8')](),controller[_0x49f3('0x1b')]);router['delete']('/:id/users',auth[_0x49f3('0x8')](),controller[_0x49f3('0x1c')]);module[_0x49f3('0x1d')]=router;
\ No newline at end of file
index 96088b1..8059493 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7119=['name','ENUM','rrmemory','beepall','roundrobin','exports'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x7119,0x1c7));var _0x9711=function(_0x3a607e,_0x54d530){_0x3a607e=_0x3a607e-0x0;var _0x37b106=_0x7119[_0x3a607e];return _0x37b106;};'use strict';var Sequelize=require('sequelize');module[_0x9711('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x9711('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9711('0x2')](_0x9711('0x3'),_0x9711('0x4'),_0x9711('0x5'))},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x885e=['INTEGER','ENUM','rrmemory','beepall','sequelize','exports','name'];(function(_0x7ed2b2,_0x38e016){var _0x27320e=function(_0x4bc460){while(--_0x4bc460){_0x7ed2b2['push'](_0x7ed2b2['shift']());}};_0x27320e(++_0x38e016);}(_0x885e,0xe4));var _0xe885=function(_0x4f207c,_0x46af42){_0x4f207c=_0x4f207c-0x0;var _0x7ddf86=_0x885e[_0x4f207c];return _0x7ddf86;};'use strict';var Sequelize=require(_0xe885('0x0'));module[_0xe885('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe885('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xe885('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe885('0x4')](_0xe885('0x5'),_0xe885('0x6'),'roundrobin')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 2312b93..691e293 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8a1=['request-promise','moment','mustache','path','sox','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','end','status','offset','limit','undefined','set','Content-Range','json','apply','reject','save','update','then','destroy','get','WhatsappQueues','sendStatus','stack','name','send','index','WhatsappQueue','fieldName','type','key','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','merge','count','includeAll','rows','catch','show','params','model','rawAttributes','include','find','create','user','role','userProfileId','autoAssociation','error','body','describe','getMembers','findOne','UserWhatsappQueue','hasOwnProperty','order','WhatsappQueueId','filter','options','findAll','User','findAndCountAll','UserId','agent','whatsappPause','createdAt','format','updatedAt','getTeams','Team','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','transaction','userWhatsappQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch'];(function(_0x3ea36c,_0x4c4860){var _0x2c90f1=function(_0x4dbc12){while(--_0x4dbc12){_0x3ea36c['push'](_0x3ea36c['shift']());}};_0x2c90f1(++_0x4c4860);}(_0xf8a1,0x117));var _0x1f8a=function(_0x28821e,_0x43d56c){_0x28821e=_0x28821e-0x0;var _0x29d248=_0xf8a1[_0x28821e];return _0x29d248;};'use strict';var emlformat=require(_0x1f8a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1f8a('0x1'));var jsonpatch=require(_0x1f8a('0x2'));var rp=require(_0x1f8a('0x3'));var moment=require(_0x1f8a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1f8a('0x5'));var util=require('util');var path=require(_0x1f8a('0x6'));var sox=require(_0x1f8a('0x7'));var csv=require('to-csv');var ejs=require(_0x1f8a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1f8a('0x9'));var squel=require('squel');var crypto=require(_0x1f8a('0xa'));var jsforce=require(_0x1f8a('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1f8a('0xc'));var Papa=require(_0x1f8a('0xd'));var Redis=require('ioredis');var authService=require(_0x1f8a('0xe'));var qs=require(_0x1f8a('0xf'));var as=require(_0x1f8a('0x10'));var hardwareService=require(_0x1f8a('0x11'));var logger=require(_0x1f8a('0x12'))(_0x1f8a('0x13'));var utils=require(_0x1f8a('0x14'));var config=require(_0x1f8a('0x15'));var licenseUtil=require(_0x1f8a('0x16'));var db=require(_0x1f8a('0x17'))['db'];config['redis']=_['defaults'](config[_0x1f8a('0x18')],{'host':_0x1f8a('0x19'),'port':0x18eb});var socket=require(_0x1f8a('0x1a'))(new Redis(config[_0x1f8a('0x18')]));require('./whatsappQueue.socket')['register'](socket);function respondWithStatusCode(_0x5730a7,_0x1fe4b4){_0x1fe4b4=_0x1fe4b4||0xcc;return function(_0x47a7bb){if(_0x47a7bb){return _0x5730a7['sendStatus'](_0x1fe4b4);}return _0x5730a7['status'](_0x1fe4b4)[_0x1f8a('0x1b')]();};}function respondWithResult(_0x591152,_0x4991fb){_0x4991fb=_0x4991fb||0xc8;return function(_0x4f48b0){if(_0x4f48b0){return _0x591152[_0x1f8a('0x1c')](_0x4991fb)['json'](_0x4f48b0);}};}function respondWithFilteredResult(_0x4f7c2f,_0x520a1c){return function(_0x2f35a3){if(_0x2f35a3){var _0x18f600=typeof _0x520a1c[_0x1f8a('0x1d')]==='undefined'&&typeof _0x520a1c[_0x1f8a('0x1e')]===_0x1f8a('0x1f');var _0x5a59a4=_0x2f35a3['count'];var _0xb471cd=_0x18f600?0x0:_0x520a1c[_0x1f8a('0x1d')];var _0x3765f9=_0x18f600?_0x2f35a3['count']:_0x520a1c['offset']+_0x520a1c['limit'];var _0x446fcc;if(_0x3765f9>=_0x5a59a4){_0x3765f9=_0x5a59a4;_0x446fcc=0xc8;}else{_0x446fcc=0xce;}_0x4f7c2f['status'](_0x446fcc);return _0x4f7c2f[_0x1f8a('0x20')](_0x1f8a('0x21'),_0xb471cd+'-'+_0x3765f9+'/'+_0x5a59a4)[_0x1f8a('0x22')](_0x2f35a3);}return null;};}function patchUpdates(_0x51c69f){return function(_0x1f3aa5){try{jsonpatch[_0x1f8a('0x23')](_0x1f3aa5,_0x51c69f,!![]);}catch(_0xe45b97){return BPromise[_0x1f8a('0x24')](_0xe45b97);}return _0x1f3aa5[_0x1f8a('0x25')]();};}function saveUpdates(_0x138b1e,_0x592b9e){return function(_0x25e57b){if(_0x25e57b){return _0x25e57b[_0x1f8a('0x26')](_0x138b1e)[_0x1f8a('0x27')](function(_0x3ba53e){return _0x3ba53e;});}return null;};}function removeEntity(_0x2fa033,_0x48bd08){return function(_0x53cc30){if(_0x53cc30){return _0x53cc30[_0x1f8a('0x28')]()[_0x1f8a('0x27')](function(){var _0x6d1448=_0x53cc30[_0x1f8a('0x29')]({'plain':!![]});var _0x17e9aa=_0x1f8a('0x2a');return db['UserProfileResource'][_0x1f8a('0x28')]({'where':{'type':_0x17e9aa,'resourceId':_0x6d1448['id']}})['then'](function(){return _0x53cc30;});})['then'](function(){_0x2fa033['status'](0xcc)[_0x1f8a('0x1b')]();});}};}function handleEntityNotFound(_0x57181f,_0x4dff6f){return function(_0x428fa7){if(!_0x428fa7){_0x57181f[_0x1f8a('0x2b')](0x194);}return _0x428fa7;};}function handleError(_0xd5e290,_0x4af35f){_0x4af35f=_0x4af35f||0x1f4;return function(_0x2fcc3a){logger['error'](_0x2fcc3a[_0x1f8a('0x2c')]);if(_0x2fcc3a[_0x1f8a('0x2d')]){delete _0x2fcc3a[_0x1f8a('0x2d')];}_0xd5e290['status'](_0x4af35f)[_0x1f8a('0x2e')](_0x2fcc3a);};}exports[_0x1f8a('0x2f')]=function(_0x4c5fba,_0x47696a){var _0x54f100={},_0x2ad636={},_0x4804d9={'count':0x0,'rows':[]};var _0x41aaee=_['map'](db[_0x1f8a('0x30')]['rawAttributes'],function(_0x2c4c46){return{'name':_0x2c4c46[_0x1f8a('0x31')],'type':_0x2c4c46[_0x1f8a('0x32')][_0x1f8a('0x33')]};});_0x2ad636['model']=_[_0x1f8a('0x34')](_0x41aaee,_0x1f8a('0x2d'));_0x2ad636[_0x1f8a('0x35')]=_[_0x1f8a('0x36')](_0x4c5fba[_0x1f8a('0x35')]);_0x2ad636[_0x1f8a('0x37')]=_[_0x1f8a('0x38')](_0x2ad636['model'],_0x2ad636[_0x1f8a('0x35')]);_0x54f100[_0x1f8a('0x39')]=_[_0x1f8a('0x38')](_0x2ad636['model'],qs[_0x1f8a('0x3a')](_0x4c5fba['query'][_0x1f8a('0x3a')]));_0x54f100[_0x1f8a('0x39')]=_0x54f100[_0x1f8a('0x39')][_0x1f8a('0x3b')]?_0x54f100[_0x1f8a('0x39')]:_0x2ad636['model'];if(!_0x4c5fba['query']['hasOwnProperty'](_0x1f8a('0x3c'))){_0x54f100[_0x1f8a('0x1e')]=qs['limit'](_0x4c5fba['query'][_0x1f8a('0x1e')]);_0x54f100[_0x1f8a('0x1d')]=qs[_0x1f8a('0x1d')](_0x4c5fba['query'][_0x1f8a('0x1d')]);}_0x54f100['order']=qs[_0x1f8a('0x3d')](_0x4c5fba[_0x1f8a('0x35')][_0x1f8a('0x3d')]);_0x54f100[_0x1f8a('0x3e')]=qs['filters'](_[_0x1f8a('0x3f')](_0x4c5fba[_0x1f8a('0x35')],_0x2ad636[_0x1f8a('0x37')]),_0x41aaee);if(_0x4c5fba['query']['filter']){_0x54f100[_0x1f8a('0x3e')]=_['merge'](_0x54f100['where'],{'$or':_['map'](_0x41aaee,function(_0x142e39){if(_0x142e39[_0x1f8a('0x32')]!==_0x1f8a('0x40')){var _0x5ef27c={};_0x5ef27c[_0x142e39[_0x1f8a('0x2d')]]={'$like':'%'+_0x4c5fba[_0x1f8a('0x35')]['filter']+'%'};return _0x5ef27c;}})});}_0x54f100=_[_0x1f8a('0x41')]({},_0x54f100,_0x4c5fba['options']);var _0x44a383={'where':_0x54f100[_0x1f8a('0x3e')]};return db[_0x1f8a('0x30')][_0x1f8a('0x42')](_0x44a383)[_0x1f8a('0x27')](function(_0x5e054f){_0x4804d9[_0x1f8a('0x42')]=_0x5e054f;if(_0x4c5fba['query'][_0x1f8a('0x43')]){_0x54f100['include']=[{'all':!![]}];}return db['WhatsappQueue']['findAll'](_0x54f100);})['then'](function(_0x2b06a7){_0x4804d9[_0x1f8a('0x44')]=_0x2b06a7;return _0x4804d9;})[_0x1f8a('0x27')](respondWithFilteredResult(_0x47696a,_0x54f100))[_0x1f8a('0x45')](handleError(_0x47696a,null));};exports[_0x1f8a('0x46')]=function(_0x47ff41,_0x5b987e){var _0x155d73={'raw':!![],'where':{'id':_0x47ff41[_0x1f8a('0x47')]['id']}},_0x1a2152={};_0x1a2152[_0x1f8a('0x48')]=_[_0x1f8a('0x36')](db[_0x1f8a('0x30')][_0x1f8a('0x49')]);_0x1a2152[_0x1f8a('0x35')]=_['keys'](_0x47ff41[_0x1f8a('0x35')]);_0x1a2152[_0x1f8a('0x37')]=_[_0x1f8a('0x38')](_0x1a2152['model'],_0x1a2152[_0x1f8a('0x35')]);_0x155d73[_0x1f8a('0x39')]=_[_0x1f8a('0x38')](_0x1a2152['model'],qs[_0x1f8a('0x3a')](_0x47ff41[_0x1f8a('0x35')]['fields']));_0x155d73[_0x1f8a('0x39')]=_0x155d73[_0x1f8a('0x39')][_0x1f8a('0x3b')]?_0x155d73['attributes']:_0x1a2152[_0x1f8a('0x48')];if(_0x47ff41['query'][_0x1f8a('0x43')]){_0x155d73[_0x1f8a('0x4a')]=[{'all':!![]}];}_0x155d73=_[_0x1f8a('0x41')]({},_0x155d73,_0x47ff41['options']);return db[_0x1f8a('0x30')][_0x1f8a('0x4b')](_0x155d73)['then'](handleEntityNotFound(_0x5b987e,null))[_0x1f8a('0x27')](respondWithResult(_0x5b987e,null))['catch'](handleError(_0x5b987e,null));};exports[_0x1f8a('0x4c')]=function(_0x309b29,_0x25c3f3){return db['WhatsappQueue'][_0x1f8a('0x4c')](_0x309b29['body'],{})[_0x1f8a('0x27')](function(_0xdbc8ac){var _0x2a5b72=_0x309b29[_0x1f8a('0x4d')][_0x1f8a('0x29')]({'plain':!![]});if(!_0x2a5b72)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a5b72[_0x1f8a('0x4e')]===_0x1f8a('0x4d')){var _0x1796d4=_0xdbc8ac[_0x1f8a('0x29')]({'plain':!![]});var _0x5688e9=_0x1f8a('0x2a');return db['UserProfileSection'][_0x1f8a('0x4b')]({'where':{'name':_0x5688e9,'userProfileId':_0x2a5b72[_0x1f8a('0x4f')]},'raw':!![]})[_0x1f8a('0x27')](function(_0x54f931){if(_0x54f931&&_0x54f931[_0x1f8a('0x50')]===0x0){return db['UserProfileResource'][_0x1f8a('0x4c')]({'name':_0x1796d4['name'],'resourceId':_0x1796d4['id'],'type':_0x54f931[_0x1f8a('0x2d')],'sectionId':_0x54f931['id']},{})['then'](function(){return _0xdbc8ac;});}else{return _0xdbc8ac;}})[_0x1f8a('0x45')](function(_0x597cff){logger[_0x1f8a('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x597cff);throw _0x597cff;});}return _0xdbc8ac;})[_0x1f8a('0x27')](respondWithResult(_0x25c3f3,0xc9))['catch'](handleError(_0x25c3f3,null));};exports[_0x1f8a('0x26')]=function(_0x4e1685,_0x81ea6b){if(_0x4e1685['body']['id']){delete _0x4e1685[_0x1f8a('0x52')]['id'];}return db['WhatsappQueue'][_0x1f8a('0x4b')]({'where':{'id':_0x4e1685[_0x1f8a('0x47')]['id']}})[_0x1f8a('0x27')](handleEntityNotFound(_0x81ea6b,null))[_0x1f8a('0x27')](saveUpdates(_0x4e1685['body'],null))[_0x1f8a('0x27')](respondWithResult(_0x81ea6b,null))[_0x1f8a('0x45')](handleError(_0x81ea6b,null));};exports[_0x1f8a('0x28')]=function(_0x3c86e7,_0x206fdd){return db[_0x1f8a('0x30')]['find']({'where':{'id':_0x3c86e7['params']['id']}})[_0x1f8a('0x27')](handleEntityNotFound(_0x206fdd,null))[_0x1f8a('0x27')](removeEntity(_0x206fdd,null))[_0x1f8a('0x45')](handleError(_0x206fdd,null));};exports[_0x1f8a('0x53')]=function(_0x2c397d,_0x127843){return db['WhatsappQueue']['describe']()[_0x1f8a('0x27')](respondWithResult(_0x127843,null))[_0x1f8a('0x45')](handleError(_0x127843,null));};exports[_0x1f8a('0x54')]=function(_0x37190,_0x3e1258,_0xb4e063){var _0x14c359={'raw':!![],'where':{}},_0x4255e={},_0x414bab;return db[_0x1f8a('0x30')][_0x1f8a('0x55')]({'where':{'id':_0x37190[_0x1f8a('0x47')]['id']}})[_0x1f8a('0x27')](handleEntityNotFound(_0x3e1258,null))['then'](function(_0x103b14){if(_0x103b14){_0x414bab=_0x103b14['get']({'plain':!![]});_0x4255e[_0x1f8a('0x48')]=_[_0x1f8a('0x36')](db[_0x1f8a('0x56')][_0x1f8a('0x49')]);_0x4255e['query']=_[_0x1f8a('0x36')](_0x37190[_0x1f8a('0x35')]);_0x4255e[_0x1f8a('0x37')]=_[_0x1f8a('0x38')](_0x4255e[_0x1f8a('0x48')],_0x4255e[_0x1f8a('0x35')]);_0x14c359[_0x1f8a('0x39')]=_[_0x1f8a('0x38')](_0x4255e['model'],qs['fields'](_0x37190[_0x1f8a('0x35')][_0x1f8a('0x3a')]));_0x14c359[_0x1f8a('0x39')]=_0x14c359[_0x1f8a('0x39')][_0x1f8a('0x3b')]?_0x14c359[_0x1f8a('0x39')]:_0x4255e[_0x1f8a('0x48')];if(!_0x37190[_0x1f8a('0x35')][_0x1f8a('0x57')](_0x1f8a('0x3c'))){_0x14c359[_0x1f8a('0x1e')]=qs[_0x1f8a('0x1e')](_0x37190[_0x1f8a('0x35')][_0x1f8a('0x1e')]);_0x14c359[_0x1f8a('0x1d')]=qs[_0x1f8a('0x1d')](_0x37190[_0x1f8a('0x35')]['offset']);}_0x14c359[_0x1f8a('0x58')]=qs[_0x1f8a('0x3d')](_0x37190['query']['sort']);_0x14c359['where']=qs[_0x1f8a('0x37')](_[_0x1f8a('0x3f')](_0x37190[_0x1f8a('0x35')],_0x4255e[_0x1f8a('0x37')]));_0x14c359[_0x1f8a('0x3e')][_0x1f8a('0x59')]=_0x103b14['id'];if(_0x37190[_0x1f8a('0x35')][_0x1f8a('0x5a')]){_0x14c359[_0x1f8a('0x3e')]=_['merge'](_0x14c359[_0x1f8a('0x3e')],{'$or':_['map'](_0x14c359[_0x1f8a('0x39')],function(_0x578ae9){var _0x26b9b0={};_0x26b9b0[_0x578ae9]={'$like':'%'+_0x37190[_0x1f8a('0x35')][_0x1f8a('0x5a')]+'%'};return _0x26b9b0;})});}_0x14c359=_[_0x1f8a('0x41')]({},_0x14c359,_0x37190[_0x1f8a('0x5b')]);return db['UserWhatsappQueue'][_0x1f8a('0x5c')](_0x14c359);}})[_0x1f8a('0x27')](function(_0x35c8ec){if(_0x35c8ec){return db[_0x1f8a('0x5d')][_0x1f8a('0x5e')]({'where':{'id':_[_0x1f8a('0x34')](_0x35c8ec,_0x1f8a('0x5f')),'role':_0x1f8a('0x60')},'attributes':['id',_0x1f8a('0x2d'),_0x1f8a('0x61'),'updatedAt',_0x1f8a('0x62')]});}})[_0x1f8a('0x27')](function(_0x444d1b){if(_0x444d1b){return{'count':_0x444d1b[_0x1f8a('0x42')],'rows':_[_0x1f8a('0x34')](_0x444d1b['rows'],function(_0x4aae21){return{'membername':_0x4aae21['name'],'UserId':_0x4aae21['id'],'queue_name':_0x414bab[_0x1f8a('0x2d')],'WhatsappQueueId':_0x414bab['id'],'interface':util[_0x1f8a('0x63')]('%s/%s','SIP',_0x4aae21['name']),'penalty':0x0,'paused':_0x4aae21[_0x1f8a('0x61')],'createdAt':_0x4aae21[_0x1f8a('0x62')],'updatedAt':_0x4aae21[_0x1f8a('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1f8a('0x27')](respondWithFilteredResult(_0x3e1258,_0x14c359))[_0x1f8a('0x45')](handleError(_0x3e1258,null));};exports[_0x1f8a('0x65')]=function(_0x1eb6fe,_0x2faaf0,_0x23a3c1){var _0x52423f={};var _0x263eaf={};var _0x33a9f5;var _0x136d21;return db['WhatsappQueue']['findOne']({'where':{'id':_0x1eb6fe[_0x1f8a('0x47')]['id']}})[_0x1f8a('0x27')](handleEntityNotFound(_0x2faaf0,null))[_0x1f8a('0x27')](function(_0x1a9ef6){if(_0x1a9ef6){_0x33a9f5=_0x1a9ef6;_0x263eaf['model']=_[_0x1f8a('0x36')](db[_0x1f8a('0x66')]['rawAttributes']);_0x263eaf['query']=_['keys'](_0x1eb6fe[_0x1f8a('0x35')]);_0x263eaf[_0x1f8a('0x37')]=_[_0x1f8a('0x38')](_0x263eaf[_0x1f8a('0x48')],_0x263eaf['query']);_0x52423f[_0x1f8a('0x39')]=_[_0x1f8a('0x38')](_0x263eaf[_0x1f8a('0x48')],qs[_0x1f8a('0x3a')](_0x1eb6fe[_0x1f8a('0x35')][_0x1f8a('0x3a')]));_0x52423f[_0x1f8a('0x39')]=_0x52423f[_0x1f8a('0x39')]['length']?_0x52423f['attributes']:_0x263eaf[_0x1f8a('0x48')];_0x52423f[_0x1f8a('0x58')]=qs[_0x1f8a('0x3d')](_0x1eb6fe[_0x1f8a('0x35')][_0x1f8a('0x3d')]);_0x52423f[_0x1f8a('0x3e')]=qs[_0x1f8a('0x37')](_['pick'](_0x1eb6fe[_0x1f8a('0x35')],_0x263eaf[_0x1f8a('0x37')]));if(_0x1eb6fe['query'][_0x1f8a('0x5a')]){_0x52423f[_0x1f8a('0x3e')]=_['merge'](_0x52423f['where'],{'$or':_['map'](_0x52423f[_0x1f8a('0x39')],function(_0x459095){var _0x10b040={};_0x10b040[_0x459095]={'$like':'%'+_0x1eb6fe[_0x1f8a('0x35')][_0x1f8a('0x5a')]+'%'};return _0x10b040;})});}_0x52423f=_['merge']({},_0x52423f,_0x1eb6fe[_0x1f8a('0x5b')]);return _0x33a9f5[_0x1f8a('0x65')](_0x52423f);}})[_0x1f8a('0x27')](function(_0x3afbce){if(_0x3afbce){_0x136d21=_0x3afbce[_0x1f8a('0x3b')];if(!_0x1eb6fe[_0x1f8a('0x35')][_0x1f8a('0x57')]('nolimit')){_0x52423f[_0x1f8a('0x1e')]=qs[_0x1f8a('0x1e')](_0x1eb6fe[_0x1f8a('0x35')]['limit']);_0x52423f[_0x1f8a('0x1d')]=qs['offset'](_0x1eb6fe[_0x1f8a('0x35')][_0x1f8a('0x1d')]);}return _0x33a9f5[_0x1f8a('0x65')](_0x52423f);}})[_0x1f8a('0x27')](function(_0x45615a){if(_0x45615a){return _0x45615a?{'count':_0x136d21,'rows':_0x45615a}:null;}})['then'](respondWithResult(_0x2faaf0,null))[_0x1f8a('0x45')](handleError(_0x2faaf0,null));};exports[_0x1f8a('0x67')]=function(_0x16d802,_0x400d1c,_0x4ff014){var _0x86a061=_0x16d802[_0x1f8a('0x52')][_0x1f8a('0x68')];return db['Team'][_0x1f8a('0x5c')]({'where':{'id':_0x86a061},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1f8a('0x69'),'attributes':['id',_0x1f8a('0x2d'),'online',_0x1f8a('0x6a'),_0x1f8a('0x6b')],'raw':!![]}]})[_0x1f8a('0x27')](function(_0x5beb38){if(_0x5beb38){var _0x595ff7=_[_0x1f8a('0x6c')](_0x5beb38,function(_0x27e711){var _0x2cfaa6=_0x27e711[_0x1f8a('0x29')]({'plain':!![]});return _0x2cfaa6[_0x1f8a('0x69')];});return db[_0x1f8a('0x30')]['find']({'where':{'id':_0x16d802[_0x1f8a('0x47')]['id']}})[_0x1f8a('0x27')](function(_0x3ea158){return db[_0x1f8a('0x6d')]['transaction'](function(_0x2063f2){return _0x3ea158[_0x1f8a('0x67')](_0x86a061,{'transaction':_0x2063f2})[_0x1f8a('0x27')](function(){return BPromise[_0x1f8a('0x6e')](_0x595ff7,function(_0x33aa51){return db[_0x1f8a('0x56')][_0x1f8a('0x6f')]({'where':{'UserId':_0x33aa51['id'],'WhatsappQueueId':_0x16d802[_0x1f8a('0x47')]['id']},'transaction':_0x2063f2});});})['then'](function(){_0x595ff7[_0x1f8a('0x70')](function(_0x2decc8){socket[_0x1f8a('0x71')](_0x1f8a('0x72'),{'UserId':_0x2decc8['id'],'WhatsappQueueId':_0x3ea158['id']});});});});});}})[_0x1f8a('0x27')](respondWithStatusCode(_0x400d1c,null))['catch'](handleError(_0x400d1c,null));};exports[_0x1f8a('0x73')]=function(_0x52db27,_0x1f93a4,_0x69aff4){return db[_0x1f8a('0x66')][_0x1f8a('0x5c')]({'where':{'id':_0x52db27['query'][_0x1f8a('0x68')]},'attributes':['id'],'include':[{'model':db[_0x1f8a('0x5d')],'as':_0x1f8a('0x69'),'attributes':['id'],'raw':!![]}]})[_0x1f8a('0x27')](handleEntityNotFound(_0x1f93a4,null))['then'](function(_0x26d79b){var _0x9a58ac=_[_0x1f8a('0x34')](_0x26d79b,'id');var _0x1638f2=[];var _0x18362f=[];var _0x1f82b9=squel['select']();_0x1f82b9[_0x1f8a('0x74')](_0x1f8a('0x75'))['from']('team_has_whatsapp_queues','tq')[_0x1f8a('0x76')](_0x1f8a('0x77'),'ut',_0x1f8a('0x78'))[_0x1f8a('0x3e')](_0x1f8a('0x79'),_0x52db27[_0x1f8a('0x47')]['id']);for(var _0x252476=0x0;_0x252476<_0x26d79b[_0x1f8a('0x3b')];_0x252476+=0x1){let _0x5a9c82=_0x26d79b[_0x252476];for(var _0x7df002=0x0;_0x7df002<_0x5a9c82['Agents'][_0x1f8a('0x3b')];_0x7df002+=0x1){let _0x238af3=_0x5a9c82[_0x1f8a('0x69')][_0x7df002];var _0x734e5b=_0x1f82b9[_0x1f8a('0x7a')]();_0x734e5b[_0x1f8a('0x3e')](_0x1f8a('0x7b'),_0x238af3['id']);_0x18362f[_0x1f8a('0x7c')](db[_0x1f8a('0x6d')]['query'](_0x734e5b[_0x1f8a('0x7d')](),{'type':db['sequelize'][_0x1f8a('0x7e')]['SELECT']})[_0x1f8a('0x27')](function(_0x3f9180){if(_0x3f9180[_0x1f8a('0x3b')]===0x1){return _0x238af3['id'];}else{var _0xbdef2f=_[_0x1f8a('0x7f')](_[_0x1f8a('0x34')](_0x3f9180,_0x1f8a('0x80')),function(_0x201a90){return _[_0x1f8a('0x81')](_0x9a58ac,_0x201a90);});if(_0xbdef2f){return _0x238af3['id'];}}}));}}return BPromise[_0x1f8a('0x82')](_0x18362f)[_0x1f8a('0x27')](function(_0x5180b2){_0x1638f2=_(_0x1638f2)[_0x1f8a('0x83')](_0x5180b2)[_0x1f8a('0x84')]()[_0x1f8a('0x85')]();return db['WhatsappQueue'][_0x1f8a('0x4b')]({'where':{'id':_0x52db27[_0x1f8a('0x47')]['id']}})['then'](function(_0x54a98f){return db[_0x1f8a('0x6d')][_0x1f8a('0x86')](function(_0x3f8485){return _0x54a98f[_0x1f8a('0x73')](_0x52db27[_0x1f8a('0x35')]['ids'],{'transaction':_0x3f8485})[_0x1f8a('0x27')](function(){if(!_['isEmpty'](_0x1638f2)){return _0x54a98f['removeAgents'](_0x1638f2,{'transaction':_0x3f8485});}})[_0x1f8a('0x27')](function(){_0x1638f2[_0x1f8a('0x70')](function(_0x4921ad){socket[_0x1f8a('0x71')](_0x1f8a('0x87'),{'UserId':_0x4921ad,'WhatsappQueueId':_0x54a98f['id']});});});});});});})[_0x1f8a('0x27')](respondWithStatusCode(_0x1f93a4,null))[_0x1f8a('0x45')](handleError(_0x1f93a4,null));};exports[_0x1f8a('0x88')]=function(_0x1f2db9,_0xa018a9,_0x23dd74){return db['WhatsappQueue'][_0x1f8a('0x4b')]({'where':{'id':_0x1f2db9[_0x1f8a('0x47')]['id']}})[_0x1f8a('0x27')](handleEntityNotFound(_0xa018a9,null))[_0x1f8a('0x27')](function(_0x286c35){if(_0x286c35){return _0x286c35[_0x1f8a('0x88')](_0x1f2db9[_0x1f8a('0x52')][_0x1f8a('0x68')],_['omit'](_0x1f2db9[_0x1f8a('0x52')],[_0x1f8a('0x68'),'id'])||{})[_0x1f8a('0x89')](function(_0x581fd4){for(var _0x227f6f=0x0;_0x227f6f<_0x1f2db9[_0x1f8a('0x52')][_0x1f8a('0x68')][_0x1f8a('0x3b')];_0x227f6f+=0x1){socket[_0x1f8a('0x71')]('userWhatsappQueue:save',{'UserId':Number(_0x1f2db9[_0x1f8a('0x52')][_0x1f8a('0x68')][_0x227f6f]),'WhatsappQueueId':Number(_0x1f2db9[_0x1f8a('0x47')]['id'])});}return _0x581fd4;});}})[_0x1f8a('0x27')](respondWithResult(_0xa018a9,null))[_0x1f8a('0x45')](handleError(_0xa018a9,null));};exports[_0x1f8a('0x8a')]=function(_0x15ddae,_0x2b22e2,_0xeb0bf6){return db[_0x1f8a('0x30')][_0x1f8a('0x4b')]({'where':{'id':_0x15ddae[_0x1f8a('0x47')]['id']}})[_0x1f8a('0x27')](handleEntityNotFound(_0x2b22e2,null))[_0x1f8a('0x27')](function(_0x3095c8){if(_0x3095c8){return _0x3095c8[_0x1f8a('0x8a')](_0x15ddae[_0x1f8a('0x35')][_0x1f8a('0x68')])[_0x1f8a('0x27')](function(){if(_[_0x1f8a('0x8b')](_0x15ddae[_0x1f8a('0x35')]['ids'])){for(var _0xa3604=0x0;_0xa3604<_0x15ddae['query'][_0x1f8a('0x68')][_0x1f8a('0x3b')];_0xa3604+=0x1){socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x15ddae[_0x1f8a('0x35')]['ids'][_0xa3604]),'WhatsappQueueId':Number(_0x15ddae['params']['id'])});}}else{socket[_0x1f8a('0x71')]('userWhatsappQueue:remove',{'UserId':Number(_0x15ddae[_0x1f8a('0x35')][_0x1f8a('0x68')]),'WhatsappQueueId':Number(_0x15ddae[_0x1f8a('0x47')]['id'])});}});}})[_0x1f8a('0x27')](respondWithStatusCode(_0x2b22e2,null))[_0x1f8a('0x45')](handleError(_0x2b22e2,null));};exports[_0x1f8a('0x8c')]=function(_0x2477b3,_0x367f7c,_0x40f26b){var _0x4103b4={};var _0x357fe9={};var _0x5f282e;var _0x4b351f;return db[_0x1f8a('0x30')][_0x1f8a('0x55')]({'where':{'id':_0x2477b3[_0x1f8a('0x47')]['id']}})['then'](handleEntityNotFound(_0x367f7c,null))[_0x1f8a('0x27')](function(_0xda9f34){if(_0xda9f34){_0x5f282e=_0xda9f34;_0x357fe9[_0x1f8a('0x48')]=_[_0x1f8a('0x36')](db['User']['rawAttributes']);_0x357fe9[_0x1f8a('0x35')]=_[_0x1f8a('0x36')](_0x2477b3['query']);_0x357fe9[_0x1f8a('0x37')]=_[_0x1f8a('0x38')](_0x357fe9[_0x1f8a('0x48')],_0x357fe9[_0x1f8a('0x35')]);_0x4103b4[_0x1f8a('0x39')]=_[_0x1f8a('0x38')](_0x357fe9[_0x1f8a('0x48')],qs['fields'](_0x2477b3[_0x1f8a('0x35')][_0x1f8a('0x3a')]));_0x4103b4[_0x1f8a('0x39')]=_0x4103b4[_0x1f8a('0x39')][_0x1f8a('0x3b')]?_0x4103b4['attributes']:_0x357fe9[_0x1f8a('0x48')];_0x4103b4[_0x1f8a('0x58')]=qs[_0x1f8a('0x3d')](_0x2477b3[_0x1f8a('0x35')][_0x1f8a('0x3d')]);_0x4103b4[_0x1f8a('0x3e')]=qs[_0x1f8a('0x37')](_[_0x1f8a('0x3f')](_0x2477b3[_0x1f8a('0x35')],_0x357fe9[_0x1f8a('0x37')]));if(_0x2477b3[_0x1f8a('0x35')][_0x1f8a('0x5a')]){_0x4103b4[_0x1f8a('0x3e')]=_[_0x1f8a('0x41')](_0x4103b4[_0x1f8a('0x3e')],{'$or':_[_0x1f8a('0x34')](_0x4103b4[_0x1f8a('0x39')],function(_0x555bf0){var _0x4bd0a6={};_0x4bd0a6[_0x555bf0]={'$like':'%'+_0x2477b3[_0x1f8a('0x35')]['filter']+'%'};return _0x4bd0a6;})});}_0x4103b4=_[_0x1f8a('0x41')]({},_0x4103b4,_0x2477b3['options']);return _0x5f282e[_0x1f8a('0x8c')](_0x4103b4);}})['then'](function(_0x4cd47b){if(_0x4cd47b){_0x4b351f=_0x4cd47b[_0x1f8a('0x3b')];if(!_0x2477b3[_0x1f8a('0x35')][_0x1f8a('0x57')](_0x1f8a('0x3c'))){_0x4103b4['limit']=qs[_0x1f8a('0x1e')](_0x2477b3[_0x1f8a('0x35')][_0x1f8a('0x1e')]);_0x4103b4['offset']=qs[_0x1f8a('0x1d')](_0x2477b3['query'][_0x1f8a('0x1d')]);}return _0x5f282e['getAgents'](_0x4103b4);}})['then'](function(_0x44c437){if(_0x44c437){return _0x44c437?{'count':_0x4b351f,'rows':_0x44c437}:null;}})[_0x1f8a('0x27')](respondWithResult(_0x367f7c,null))[_0x1f8a('0x45')](handleError(_0x367f7c,null));};
\ No newline at end of file
+var _0xb03a=['describe','hasOwnProperty','order','pick','WhatsappQueueId','UserWhatsappQueue','User','findAndCountAll','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','findOne','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','push','sequelize','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','destroy','get','WhatsappQueues','UserProfileResource','then','error','stack','name','send','WhatsappQueue','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','nolimit','limit','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x5e169c,_0x11199a){var _0x3c14bf=function(_0x149f38){while(--_0x149f38){_0x5e169c['push'](_0x5e169c['shift']());}};_0x3c14bf(++_0x11199a);}(_0xb03a,0xc0));var _0xab03=function(_0x79645d,_0x276356){_0x79645d=_0x79645d-0x0;var _0x15f169=_0xb03a[_0x79645d];return _0x15f169;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab03('0x0'));var zipdir=require(_0xab03('0x1'));var jsonpatch=require(_0xab03('0x2'));var rp=require('request-promise');var moment=require(_0xab03('0x3'));var BPromise=require(_0xab03('0x4'));var Mustache=require(_0xab03('0x5'));var util=require(_0xab03('0x6'));var path=require('path');var sox=require(_0xab03('0x7'));var csv=require(_0xab03('0x8'));var ejs=require(_0xab03('0x9'));var fs=require('fs');var fs_extra=require(_0xab03('0xa'));var _=require(_0xab03('0xb'));var squel=require(_0xab03('0xc'));var crypto=require(_0xab03('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xab03('0xe'));var Redis=require(_0xab03('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xab03('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xab03('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xab03('0x12'));var licenseUtil=require(_0xab03('0x13'));var db=require(_0xab03('0x14'))['db'];config[_0xab03('0x15')]=_[_0xab03('0x16')](config[_0xab03('0x15')],{'host':_0xab03('0x17'),'port':0x18eb});var socket=require(_0xab03('0x18'))(new Redis(config[_0xab03('0x15')]));require(_0xab03('0x19'))[_0xab03('0x1a')](socket);function respondWithStatusCode(_0x10b210,_0x5e4a01){_0x5e4a01=_0x5e4a01||0xcc;return function(_0x5dd486){if(_0x5dd486){return _0x10b210[_0xab03('0x1b')](_0x5e4a01);}return _0x10b210[_0xab03('0x1c')](_0x5e4a01)[_0xab03('0x1d')]();};}function respondWithResult(_0x49201f,_0x3f9f61){_0x3f9f61=_0x3f9f61||0xc8;return function(_0x7fa4ec){if(_0x7fa4ec){return _0x49201f[_0xab03('0x1c')](_0x3f9f61)[_0xab03('0x1e')](_0x7fa4ec);}};}function respondWithFilteredResult(_0x3c91a0,_0xc5e118){return function(_0x31825f){if(_0x31825f){var _0xe28314=typeof _0xc5e118[_0xab03('0x1f')]===_0xab03('0x20')&&typeof _0xc5e118['limit']==='undefined';var _0x407747=_0x31825f['count'];var _0x4c882b=_0xe28314?0x0:_0xc5e118[_0xab03('0x1f')];var _0x124d00=_0xe28314?_0x31825f[_0xab03('0x21')]:_0xc5e118['offset']+_0xc5e118['limit'];var _0x4e6bc5;if(_0x124d00>=_0x407747){_0x124d00=_0x407747;_0x4e6bc5=0xc8;}else{_0x4e6bc5=0xce;}_0x3c91a0[_0xab03('0x1c')](_0x4e6bc5);return _0x3c91a0['set'](_0xab03('0x22'),_0x4c882b+'-'+_0x124d00+'/'+_0x407747)[_0xab03('0x1e')](_0x31825f);}return null;};}function patchUpdates(_0x53eccd){return function(_0x1931bf){try{jsonpatch[_0xab03('0x23')](_0x1931bf,_0x53eccd,!![]);}catch(_0x2fa4db){return BPromise[_0xab03('0x24')](_0x2fa4db);}return _0x1931bf[_0xab03('0x25')]();};}function saveUpdates(_0xf4c270,_0x33e34a){return function(_0x4d1e17){if(_0x4d1e17){return _0x4d1e17[_0xab03('0x26')](_0xf4c270)['then'](function(_0x3647df){return _0x3647df;});}return null;};}function removeEntity(_0x5794a4,_0x4623cf){return function(_0x4affee){if(_0x4affee){return _0x4affee[_0xab03('0x27')]()['then'](function(){var _0x5cf905=_0x4affee[_0xab03('0x28')]({'plain':!![]});var _0x370b09=_0xab03('0x29');return db[_0xab03('0x2a')][_0xab03('0x27')]({'where':{'type':_0x370b09,'resourceId':_0x5cf905['id']}})['then'](function(){return _0x4affee;});})[_0xab03('0x2b')](function(){_0x5794a4['status'](0xcc)[_0xab03('0x1d')]();});}};}function handleEntityNotFound(_0x554c52,_0x17d19a){return function(_0x12d7e2){if(!_0x12d7e2){_0x554c52['sendStatus'](0x194);}return _0x12d7e2;};}function handleError(_0x227330,_0x2ad7bd){_0x2ad7bd=_0x2ad7bd||0x1f4;return function(_0xb0c391){logger[_0xab03('0x2c')](_0xb0c391[_0xab03('0x2d')]);if(_0xb0c391['name']){delete _0xb0c391[_0xab03('0x2e')];}_0x227330['status'](_0x2ad7bd)[_0xab03('0x2f')](_0xb0c391);};}exports['index']=function(_0x1fa174,_0x523565){var _0xbaef14={},_0x4519e8={},_0x415b20={'count':0x0,'rows':[]};var _0xff1ab0=_['map'](db[_0xab03('0x30')][_0xab03('0x31')],function(_0x43b02a){return{'name':_0x43b02a[_0xab03('0x32')],'type':_0x43b02a[_0xab03('0x33')][_0xab03('0x34')]};});_0x4519e8['model']=_[_0xab03('0x35')](_0xff1ab0,_0xab03('0x2e'));_0x4519e8[_0xab03('0x36')]=_[_0xab03('0x37')](_0x1fa174['query']);_0x4519e8[_0xab03('0x38')]=_['intersection'](_0x4519e8[_0xab03('0x39')],_0x4519e8['query']);_0xbaef14[_0xab03('0x3a')]=_[_0xab03('0x3b')](_0x4519e8[_0xab03('0x39')],qs[_0xab03('0x3c')](_0x1fa174[_0xab03('0x36')][_0xab03('0x3c')]));_0xbaef14[_0xab03('0x3a')]=_0xbaef14[_0xab03('0x3a')][_0xab03('0x3d')]?_0xbaef14['attributes']:_0x4519e8[_0xab03('0x39')];if(!_0x1fa174[_0xab03('0x36')]['hasOwnProperty'](_0xab03('0x3e'))){_0xbaef14['limit']=qs[_0xab03('0x3f')](_0x1fa174[_0xab03('0x36')][_0xab03('0x3f')]);_0xbaef14[_0xab03('0x1f')]=qs[_0xab03('0x1f')](_0x1fa174[_0xab03('0x36')][_0xab03('0x1f')]);}_0xbaef14['order']=qs['sort'](_0x1fa174[_0xab03('0x36')][_0xab03('0x40')]);_0xbaef14[_0xab03('0x41')]=qs[_0xab03('0x38')](_['pick'](_0x1fa174[_0xab03('0x36')],_0x4519e8[_0xab03('0x38')]),_0xff1ab0);if(_0x1fa174[_0xab03('0x36')][_0xab03('0x42')]){_0xbaef14[_0xab03('0x41')]=_[_0xab03('0x43')](_0xbaef14[_0xab03('0x41')],{'$or':_[_0xab03('0x35')](_0xff1ab0,function(_0x4a7e53){if(_0x4a7e53[_0xab03('0x33')]!==_0xab03('0x44')){var _0x480a94={};_0x480a94[_0x4a7e53['name']]={'$like':'%'+_0x1fa174[_0xab03('0x36')][_0xab03('0x42')]+'%'};return _0x480a94;}})});}_0xbaef14=_[_0xab03('0x43')]({},_0xbaef14,_0x1fa174[_0xab03('0x45')]);var _0x2b15d4={'where':_0xbaef14['where']};return db[_0xab03('0x30')][_0xab03('0x21')](_0x2b15d4)[_0xab03('0x2b')](function(_0x1da4b9){_0x415b20[_0xab03('0x21')]=_0x1da4b9;if(_0x1fa174['query']['includeAll']){_0xbaef14[_0xab03('0x46')]=[{'all':!![]}];}return db[_0xab03('0x30')][_0xab03('0x47')](_0xbaef14);})[_0xab03('0x2b')](function(_0xb40266){_0x415b20[_0xab03('0x48')]=_0xb40266;return _0x415b20;})[_0xab03('0x2b')](respondWithFilteredResult(_0x523565,_0xbaef14))[_0xab03('0x49')](handleError(_0x523565,null));};exports[_0xab03('0x4a')]=function(_0x12015d,_0x53a243){var _0x196ff4={'raw':!![],'where':{'id':_0x12015d[_0xab03('0x4b')]['id']}},_0x5eee00={};_0x5eee00['model']=_[_0xab03('0x37')](db[_0xab03('0x30')][_0xab03('0x31')]);_0x5eee00['query']=_[_0xab03('0x37')](_0x12015d[_0xab03('0x36')]);_0x5eee00[_0xab03('0x38')]=_[_0xab03('0x3b')](_0x5eee00[_0xab03('0x39')],_0x5eee00[_0xab03('0x36')]);_0x196ff4[_0xab03('0x3a')]=_[_0xab03('0x3b')](_0x5eee00['model'],qs[_0xab03('0x3c')](_0x12015d[_0xab03('0x36')][_0xab03('0x3c')]));_0x196ff4[_0xab03('0x3a')]=_0x196ff4[_0xab03('0x3a')][_0xab03('0x3d')]?_0x196ff4[_0xab03('0x3a')]:_0x5eee00[_0xab03('0x39')];if(_0x12015d[_0xab03('0x36')]['includeAll']){_0x196ff4[_0xab03('0x46')]=[{'all':!![]}];}_0x196ff4=_[_0xab03('0x43')]({},_0x196ff4,_0x12015d[_0xab03('0x45')]);return db['WhatsappQueue']['find'](_0x196ff4)['then'](handleEntityNotFound(_0x53a243,null))[_0xab03('0x2b')](respondWithResult(_0x53a243,null))[_0xab03('0x49')](handleError(_0x53a243,null));};exports[_0xab03('0x4c')]=function(_0x5aeb9f,_0x5c7294){return db[_0xab03('0x30')]['create'](_0x5aeb9f[_0xab03('0x4d')],{})['then'](function(_0x95e670){var _0xf249e5=_0x5aeb9f[_0xab03('0x4e')][_0xab03('0x28')]({'plain':!![]});if(!_0xf249e5)throw new Error(_0xab03('0x4f'));if(_0xf249e5['role']===_0xab03('0x4e')){var _0x39825f=_0x95e670['get']({'plain':!![]});var _0x463676='WhatsappQueues';return db[_0xab03('0x50')][_0xab03('0x51')]({'where':{'name':_0x463676,'userProfileId':_0xf249e5[_0xab03('0x52')]},'raw':!![]})[_0xab03('0x2b')](function(_0x49a639){if(_0x49a639&&_0x49a639['autoAssociation']===0x0){return db[_0xab03('0x2a')][_0xab03('0x4c')]({'name':_0x39825f[_0xab03('0x2e')],'resourceId':_0x39825f['id'],'type':_0x49a639[_0xab03('0x2e')],'sectionId':_0x49a639['id']},{})['then'](function(){return _0x95e670;});}else{return _0x95e670;}})[_0xab03('0x49')](function(_0x4a4501){logger[_0xab03('0x2c')](_0xab03('0x53'),_0x4a4501);throw _0x4a4501;});}return _0x95e670;})['then'](respondWithResult(_0x5c7294,0xc9))[_0xab03('0x49')](handleError(_0x5c7294,null));};exports['update']=function(_0x510166,_0x4d9c99){if(_0x510166[_0xab03('0x4d')]['id']){delete _0x510166['body']['id'];}return db[_0xab03('0x30')][_0xab03('0x51')]({'where':{'id':_0x510166['params']['id']}})[_0xab03('0x2b')](handleEntityNotFound(_0x4d9c99,null))[_0xab03('0x2b')](saveUpdates(_0x510166['body'],null))[_0xab03('0x2b')](respondWithResult(_0x4d9c99,null))['catch'](handleError(_0x4d9c99,null));};exports['destroy']=function(_0x31957f,_0x1751eb){return db['WhatsappQueue'][_0xab03('0x51')]({'where':{'id':_0x31957f['params']['id']}})[_0xab03('0x2b')](handleEntityNotFound(_0x1751eb,null))['then'](removeEntity(_0x1751eb,null))[_0xab03('0x49')](handleError(_0x1751eb,null));};exports[_0xab03('0x54')]=function(_0x30c20c,_0x35e3f4){return db[_0xab03('0x30')][_0xab03('0x54')]()[_0xab03('0x2b')](respondWithResult(_0x35e3f4,null))['catch'](handleError(_0x35e3f4,null));};exports['getMembers']=function(_0x2a5105,_0x3ed9ce,_0xd794a9){var _0x4525c6={'raw':!![],'where':{}},_0x22f483={},_0x1a03aa;return db[_0xab03('0x30')]['findOne']({'where':{'id':_0x2a5105[_0xab03('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3ed9ce,null))['then'](function(_0x34d9b3){if(_0x34d9b3){_0x1a03aa=_0x34d9b3['get']({'plain':!![]});_0x22f483['model']=_[_0xab03('0x37')](db['UserWhatsappQueue'][_0xab03('0x31')]);_0x22f483[_0xab03('0x36')]=_[_0xab03('0x37')](_0x2a5105[_0xab03('0x36')]);_0x22f483[_0xab03('0x38')]=_['intersection'](_0x22f483[_0xab03('0x39')],_0x22f483[_0xab03('0x36')]);_0x4525c6[_0xab03('0x3a')]=_[_0xab03('0x3b')](_0x22f483[_0xab03('0x39')],qs[_0xab03('0x3c')](_0x2a5105[_0xab03('0x36')][_0xab03('0x3c')]));_0x4525c6[_0xab03('0x3a')]=_0x4525c6[_0xab03('0x3a')][_0xab03('0x3d')]?_0x4525c6['attributes']:_0x22f483[_0xab03('0x39')];if(!_0x2a5105['query'][_0xab03('0x55')]('nolimit')){_0x4525c6['limit']=qs[_0xab03('0x3f')](_0x2a5105[_0xab03('0x36')][_0xab03('0x3f')]);_0x4525c6['offset']=qs[_0xab03('0x1f')](_0x2a5105[_0xab03('0x36')][_0xab03('0x1f')]);}_0x4525c6[_0xab03('0x56')]=qs[_0xab03('0x40')](_0x2a5105[_0xab03('0x36')][_0xab03('0x40')]);_0x4525c6[_0xab03('0x41')]=qs[_0xab03('0x38')](_[_0xab03('0x57')](_0x2a5105[_0xab03('0x36')],_0x22f483[_0xab03('0x38')]));_0x4525c6[_0xab03('0x41')][_0xab03('0x58')]=_0x34d9b3['id'];if(_0x2a5105['query'][_0xab03('0x42')]){_0x4525c6['where']=_[_0xab03('0x43')](_0x4525c6[_0xab03('0x41')],{'$or':_[_0xab03('0x35')](_0x4525c6[_0xab03('0x3a')],function(_0x30e637){var _0xdb1310={};_0xdb1310[_0x30e637]={'$like':'%'+_0x2a5105[_0xab03('0x36')]['filter']+'%'};return _0xdb1310;})});}_0x4525c6=_[_0xab03('0x43')]({},_0x4525c6,_0x2a5105['options']);return db[_0xab03('0x59')]['findAll'](_0x4525c6);}})[_0xab03('0x2b')](function(_0x491958){if(_0x491958){return db[_0xab03('0x5a')][_0xab03('0x5b')]({'where':{'id':_[_0xab03('0x35')](_0x491958,'UserId'),'role':'agent'},'attributes':['id',_0xab03('0x2e'),_0xab03('0x5c'),_0xab03('0x5d'),_0xab03('0x5e')]});}})[_0xab03('0x2b')](function(_0x58751a){if(_0x58751a){return{'count':_0x58751a['count'],'rows':_['map'](_0x58751a[_0xab03('0x48')],function(_0x3cc1ef){return{'membername':_0x3cc1ef[_0xab03('0x2e')],'UserId':_0x3cc1ef['id'],'queue_name':_0x1a03aa[_0xab03('0x2e')],'WhatsappQueueId':_0x1a03aa['id'],'interface':util[_0xab03('0x5f')](_0xab03('0x60'),_0xab03('0x61'),_0x3cc1ef[_0xab03('0x2e')]),'penalty':0x0,'paused':_0x3cc1ef[_0xab03('0x5c')],'createdAt':_0x3cc1ef['createdAt'],'updatedAt':_0x3cc1ef[_0xab03('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3ed9ce,_0x4525c6))[_0xab03('0x49')](handleError(_0x3ed9ce,null));};exports['getTeams']=function(_0x2ec7ca,_0x578364,_0x2a6a92){var _0x2da8e0={};var _0x32bbaf={};var _0x1b9f3b;var _0x4e4957;return db[_0xab03('0x30')][_0xab03('0x62')]({'where':{'id':_0x2ec7ca[_0xab03('0x4b')]['id']}})[_0xab03('0x2b')](handleEntityNotFound(_0x578364,null))['then'](function(_0x4bc2d7){if(_0x4bc2d7){_0x1b9f3b=_0x4bc2d7;_0x32bbaf[_0xab03('0x39')]=_[_0xab03('0x37')](db[_0xab03('0x63')][_0xab03('0x31')]);_0x32bbaf['query']=_['keys'](_0x2ec7ca[_0xab03('0x36')]);_0x32bbaf[_0xab03('0x38')]=_[_0xab03('0x3b')](_0x32bbaf[_0xab03('0x39')],_0x32bbaf[_0xab03('0x36')]);_0x2da8e0[_0xab03('0x3a')]=_[_0xab03('0x3b')](_0x32bbaf[_0xab03('0x39')],qs[_0xab03('0x3c')](_0x2ec7ca['query'][_0xab03('0x3c')]));_0x2da8e0[_0xab03('0x3a')]=_0x2da8e0[_0xab03('0x3a')][_0xab03('0x3d')]?_0x2da8e0[_0xab03('0x3a')]:_0x32bbaf[_0xab03('0x39')];_0x2da8e0[_0xab03('0x56')]=qs['sort'](_0x2ec7ca[_0xab03('0x36')][_0xab03('0x40')]);_0x2da8e0[_0xab03('0x41')]=qs[_0xab03('0x38')](_[_0xab03('0x57')](_0x2ec7ca[_0xab03('0x36')],_0x32bbaf[_0xab03('0x38')]));if(_0x2ec7ca[_0xab03('0x36')][_0xab03('0x42')]){_0x2da8e0[_0xab03('0x41')]=_[_0xab03('0x43')](_0x2da8e0[_0xab03('0x41')],{'$or':_[_0xab03('0x35')](_0x2da8e0[_0xab03('0x3a')],function(_0x165b17){var _0x16bd98={};_0x16bd98[_0x165b17]={'$like':'%'+_0x2ec7ca[_0xab03('0x36')][_0xab03('0x42')]+'%'};return _0x16bd98;})});}_0x2da8e0=_['merge']({},_0x2da8e0,_0x2ec7ca[_0xab03('0x45')]);return _0x1b9f3b[_0xab03('0x64')](_0x2da8e0);}})[_0xab03('0x2b')](function(_0x541434){if(_0x541434){_0x4e4957=_0x541434['length'];if(!_0x2ec7ca[_0xab03('0x36')]['hasOwnProperty']('nolimit')){_0x2da8e0[_0xab03('0x3f')]=qs[_0xab03('0x3f')](_0x2ec7ca[_0xab03('0x36')][_0xab03('0x3f')]);_0x2da8e0[_0xab03('0x1f')]=qs['offset'](_0x2ec7ca['query']['offset']);}return _0x1b9f3b[_0xab03('0x64')](_0x2da8e0);}})[_0xab03('0x2b')](function(_0x4be84d){if(_0x4be84d){return _0x4be84d?{'count':_0x4e4957,'rows':_0x4be84d}:null;}})[_0xab03('0x2b')](respondWithResult(_0x578364,null))['catch'](handleError(_0x578364,null));};exports[_0xab03('0x65')]=function(_0x564bf6,_0x3295a5,_0x19cdcd){var _0x12eb04=_0x564bf6[_0xab03('0x4d')][_0xab03('0x66')];return db[_0xab03('0x63')][_0xab03('0x47')]({'where':{'id':_0x12eb04},'attributes':['id'],'include':[{'model':db[_0xab03('0x5a')],'as':_0xab03('0x67'),'attributes':['id',_0xab03('0x2e'),_0xab03('0x68'),_0xab03('0x69'),_0xab03('0x6a')],'raw':!![]}]})['then'](function(_0x442676){if(_0x442676){var _0x223b74=_[_0xab03('0x6b')](_0x442676,function(_0x8578ce){var _0x2aa5b8=_0x8578ce[_0xab03('0x28')]({'plain':!![]});return _0x2aa5b8['Agents'];});return db[_0xab03('0x30')][_0xab03('0x51')]({'where':{'id':_0x564bf6['params']['id']}})[_0xab03('0x2b')](function(_0x5296b7){return db['sequelize'][_0xab03('0x6c')](function(_0x55362a){return _0x5296b7[_0xab03('0x65')](_0x12eb04,{'transaction':_0x55362a})['then'](function(){return BPromise['each'](_0x223b74,function(_0x110d26){return db[_0xab03('0x59')][_0xab03('0x6d')]({'where':{'UserId':_0x110d26['id'],'WhatsappQueueId':_0x564bf6[_0xab03('0x4b')]['id']},'transaction':_0x55362a});});})['then'](function(){_0x223b74[_0xab03('0x6e')](function(_0x1124df){socket[_0xab03('0x6f')](_0xab03('0x70'),{'UserId':_0x1124df['id'],'WhatsappQueueId':_0x5296b7['id']});});});});});}})[_0xab03('0x2b')](respondWithStatusCode(_0x3295a5,null))['catch'](handleError(_0x3295a5,null));};exports[_0xab03('0x71')]=function(_0x5c3bd7,_0x6daf2e,_0x4b1925){return db[_0xab03('0x63')]['findAll']({'where':{'id':_0x5c3bd7[_0xab03('0x36')][_0xab03('0x66')]},'attributes':['id'],'include':[{'model':db[_0xab03('0x5a')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xab03('0x2b')](handleEntityNotFound(_0x6daf2e,null))[_0xab03('0x2b')](function(_0x14f7ce){var _0x2c16a6=_[_0xab03('0x35')](_0x14f7ce,'id');var _0xcae13a=[];var _0xc1f0d1=[];var _0x4831a9=squel[_0xab03('0x72')]();_0x4831a9[_0xab03('0x73')](_0xab03('0x74'))['from'](_0xab03('0x75'),'tq')[_0xab03('0x76')]('user_has_teams','ut',_0xab03('0x77'))['where'](_0xab03('0x78'),_0x5c3bd7['params']['id']);for(var _0x6204a3=0x0;_0x6204a3<_0x14f7ce['length'];_0x6204a3+=0x1){let _0x2eb8e2=_0x14f7ce[_0x6204a3];for(var _0x4a7001=0x0;_0x4a7001<_0x2eb8e2[_0xab03('0x67')][_0xab03('0x3d')];_0x4a7001+=0x1){let _0x37dca8=_0x2eb8e2[_0xab03('0x67')][_0x4a7001];var _0x47d850=_0x4831a9[_0xab03('0x79')]();_0x47d850[_0xab03('0x41')]('ut.UserId\x20=\x20?',_0x37dca8['id']);_0xc1f0d1[_0xab03('0x7a')](db[_0xab03('0x7b')][_0xab03('0x36')](_0x47d850['toString'](),{'type':db[_0xab03('0x7b')][_0xab03('0x7c')][_0xab03('0x7d')]})['then'](function(_0x2f76f7){if(_0x2f76f7['length']===0x1){return _0x37dca8['id'];}else{var _0x1615e0=_[_0xab03('0x7e')](_['map'](_0x2f76f7,_0xab03('0x7f')),function(_0x5d62b1){return _['includes'](_0x2c16a6,_0x5d62b1);});if(_0x1615e0){return _0x37dca8['id'];}}}));}}return BPromise[_0xab03('0x80')](_0xc1f0d1)['then'](function(_0x5abae3){_0xcae13a=_(_0xcae13a)[_0xab03('0x81')](_0x5abae3)[_0xab03('0x82')]()[_0xab03('0x83')]();return db[_0xab03('0x30')][_0xab03('0x51')]({'where':{'id':_0x5c3bd7[_0xab03('0x4b')]['id']}})['then'](function(_0x54bb47){return db['sequelize']['transaction'](function(_0x185260){return _0x54bb47['removeTeams'](_0x5c3bd7[_0xab03('0x36')][_0xab03('0x66')],{'transaction':_0x185260})['then'](function(){if(!_[_0xab03('0x84')](_0xcae13a)){return _0x54bb47[_0xab03('0x85')](_0xcae13a,{'transaction':_0x185260});}})[_0xab03('0x2b')](function(){_0xcae13a['forEach'](function(_0xd2d65a){socket['emit'](_0xab03('0x86'),{'UserId':_0xd2d65a,'WhatsappQueueId':_0x54bb47['id']});});});});});});})[_0xab03('0x2b')](respondWithStatusCode(_0x6daf2e,null))[_0xab03('0x49')](handleError(_0x6daf2e,null));};exports[_0xab03('0x87')]=function(_0x1c6ec5,_0x2c1c96,_0x47b3c7){return db['WhatsappQueue'][_0xab03('0x51')]({'where':{'id':_0x1c6ec5[_0xab03('0x4b')]['id']}})[_0xab03('0x2b')](handleEntityNotFound(_0x2c1c96,null))[_0xab03('0x2b')](function(_0x533b5f){if(_0x533b5f){return _0x533b5f['addAgents'](_0x1c6ec5['body'][_0xab03('0x66')],_[_0xab03('0x88')](_0x1c6ec5['body'],[_0xab03('0x66'),'id'])||{})['spread'](function(_0x1d9dd3){for(var _0x421fff=0x0;_0x421fff<_0x1c6ec5[_0xab03('0x4d')]['ids'][_0xab03('0x3d')];_0x421fff+=0x1){socket[_0xab03('0x6f')](_0xab03('0x70'),{'UserId':Number(_0x1c6ec5['body'][_0xab03('0x66')][_0x421fff]),'WhatsappQueueId':Number(_0x1c6ec5['params']['id'])});}return _0x1d9dd3;});}})[_0xab03('0x2b')](respondWithResult(_0x2c1c96,null))[_0xab03('0x49')](handleError(_0x2c1c96,null));};exports[_0xab03('0x85')]=function(_0x4ad884,_0x589378,_0x19a466){return db[_0xab03('0x30')][_0xab03('0x51')]({'where':{'id':_0x4ad884['params']['id']}})['then'](handleEntityNotFound(_0x589378,null))[_0xab03('0x2b')](function(_0x356dd3){if(_0x356dd3){return _0x356dd3[_0xab03('0x85')](_0x4ad884['query'][_0xab03('0x66')])['then'](function(){if(_['isArray'](_0x4ad884[_0xab03('0x36')]['ids'])){for(var _0x3d84fb=0x0;_0x3d84fb<_0x4ad884['query']['ids'][_0xab03('0x3d')];_0x3d84fb+=0x1){socket[_0xab03('0x6f')](_0xab03('0x86'),{'UserId':Number(_0x4ad884[_0xab03('0x36')][_0xab03('0x66')][_0x3d84fb]),'WhatsappQueueId':Number(_0x4ad884[_0xab03('0x4b')]['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x4ad884[_0xab03('0x36')]['ids']),'WhatsappQueueId':Number(_0x4ad884[_0xab03('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x589378,null))[_0xab03('0x49')](handleError(_0x589378,null));};exports[_0xab03('0x89')]=function(_0x2b30c3,_0x11cc12,_0x51ac4a){var _0x5ca2f2={};var _0x614390={};var _0x533e5e;var _0x5ddd44;return db[_0xab03('0x30')][_0xab03('0x62')]({'where':{'id':_0x2b30c3[_0xab03('0x4b')]['id']}})[_0xab03('0x2b')](handleEntityNotFound(_0x11cc12,null))[_0xab03('0x2b')](function(_0x4e2862){if(_0x4e2862){_0x533e5e=_0x4e2862;_0x614390[_0xab03('0x39')]=_[_0xab03('0x37')](db[_0xab03('0x5a')][_0xab03('0x31')]);_0x614390['query']=_['keys'](_0x2b30c3[_0xab03('0x36')]);_0x614390[_0xab03('0x38')]=_[_0xab03('0x3b')](_0x614390[_0xab03('0x39')],_0x614390[_0xab03('0x36')]);_0x5ca2f2['attributes']=_['intersection'](_0x614390[_0xab03('0x39')],qs[_0xab03('0x3c')](_0x2b30c3[_0xab03('0x36')][_0xab03('0x3c')]));_0x5ca2f2['attributes']=_0x5ca2f2[_0xab03('0x3a')][_0xab03('0x3d')]?_0x5ca2f2['attributes']:_0x614390[_0xab03('0x39')];_0x5ca2f2[_0xab03('0x56')]=qs[_0xab03('0x40')](_0x2b30c3[_0xab03('0x36')][_0xab03('0x40')]);_0x5ca2f2['where']=qs[_0xab03('0x38')](_[_0xab03('0x57')](_0x2b30c3[_0xab03('0x36')],_0x614390[_0xab03('0x38')]));if(_0x2b30c3[_0xab03('0x36')][_0xab03('0x42')]){_0x5ca2f2[_0xab03('0x41')]=_[_0xab03('0x43')](_0x5ca2f2[_0xab03('0x41')],{'$or':_['map'](_0x5ca2f2[_0xab03('0x3a')],function(_0x34f1ad){var _0x3b9100={};_0x3b9100[_0x34f1ad]={'$like':'%'+_0x2b30c3[_0xab03('0x36')]['filter']+'%'};return _0x3b9100;})});}_0x5ca2f2=_['merge']({},_0x5ca2f2,_0x2b30c3[_0xab03('0x45')]);return _0x533e5e[_0xab03('0x89')](_0x5ca2f2);}})[_0xab03('0x2b')](function(_0xa04c4){if(_0xa04c4){_0x5ddd44=_0xa04c4[_0xab03('0x3d')];if(!_0x2b30c3[_0xab03('0x36')]['hasOwnProperty'](_0xab03('0x3e'))){_0x5ca2f2[_0xab03('0x3f')]=qs['limit'](_0x2b30c3[_0xab03('0x36')][_0xab03('0x3f')]);_0x5ca2f2[_0xab03('0x1f')]=qs[_0xab03('0x1f')](_0x2b30c3[_0xab03('0x36')][_0xab03('0x1f')]);}return _0x533e5e[_0xab03('0x89')](_0x5ca2f2);}})[_0xab03('0x2b')](function(_0x15b849){if(_0x15b849){return _0x15b849?{'count':_0x5ddd44,'rows':_0x15b849}:null;}})[_0xab03('0x2b')](respondWithResult(_0x11cc12,null))['catch'](handleError(_0x11cc12,null));};
\ No newline at end of file
index 14b629c..94eba0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5868=['WhatsappQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x25d264,_0x2b49ba){var _0x309b3b=function(_0x36fb95){while(--_0x36fb95){_0x25d264['push'](_0x25d264['shift']());}};_0x309b3b(++_0x2b49ba);}(_0x5868,0x194));var _0x8586=function(_0x4d6d79,_0x3e4e8f){_0x4d6d79=_0x4d6d79-0x0;var _0x553ad2=_0x5868[_0x4d6d79];return _0x553ad2;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x8586('0x0'))['db'][_0x8586('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x8586('0x2')](0x0);var events={'afterCreate':_0x8586('0x3'),'afterUpdate':'update','afterDestroy':_0x8586('0x4')};function emitEvent(_0x464516){return function(_0xc808ce,_0x342e4e,_0x46dea5){WhatsappQueueEvents[_0x8586('0x5')](_0x464516+':'+_0xc808ce['id'],_0xc808ce);WhatsappQueueEvents[_0x8586('0x5')](_0x464516,_0xc808ce);_0x46dea5(null);};}for(var e in events){if(events[_0x8586('0x6')](e)){var event=events[e];WhatsappQueue[_0x8586('0x7')](e,emitEvent(event));}}module[_0x8586('0x8')]=WhatsappQueueEvents;
\ No newline at end of file
+var _0xd8ed=['emit','hasOwnProperty','exports','../../mysqldb','WhatsappQueue','setMaxListeners','save','remove'];(function(_0x27acda,_0x4c11a6){var _0x47f760=function(_0xc481bc){while(--_0xc481bc){_0x27acda['push'](_0x27acda['shift']());}};_0x47f760(++_0x4c11a6);}(_0xd8ed,0x6b));var _0xdd8e=function(_0x45421f,_0x101caa){_0x45421f=_0x45421f-0x0;var _0x5707ce=_0xd8ed[_0x45421f];return _0x5707ce;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xdd8e('0x0'))['db'][_0xdd8e('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xdd8e('0x2')](0x0);var events={'afterCreate':_0xdd8e('0x3'),'afterUpdate':'update','afterDestroy':_0xdd8e('0x4')};function emitEvent(_0x3df67b){return function(_0x22b2c4,_0x4fa3f7,_0x51b1bc){WhatsappQueueEvents[_0xdd8e('0x5')](_0x3df67b+':'+_0x22b2c4['id'],_0x22b2c4);WhatsappQueueEvents[_0xdd8e('0x5')](_0x3df67b,_0x22b2c4);_0x51b1bc(null);};}for(var e in events){if(events[_0xdd8e('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xdd8e('0x7')]=WhatsappQueueEvents;
\ No newline at end of file
index b729200..8678528 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6488=['WhatsappQueue','whatsapp_queues','lodash','api','bluebird','request-promise','rimraf','./whatsappQueue.attributes','exports','define'];(function(_0x310dc2,_0x2299c4){var _0x24980f=function(_0xde9b88){while(--_0xde9b88){_0x310dc2['push'](_0x310dc2['shift']());}};_0x24980f(++_0x2299c4);}(_0x6488,0x19c));var _0x8648=function(_0x667081,_0x1d02b8){_0x667081=_0x667081-0x0;var _0x1c1e88=_0x6488[_0x667081];return _0x1c1e88;};'use strict';var _=require(_0x8648('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8648('0x1'));var moment=require('moment');var BPromise=require(_0x8648('0x2'));var rp=require(_0x8648('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8648('0x4'));var config=require('../../config/environment');var attributes=require(_0x8648('0x5'));module[_0x8648('0x6')]=function(_0x3809c1,_0x1e55e8){return _0x3809c1[_0x8648('0x7')](_0x8648('0x8'),attributes,{'tableName':_0x8648('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2c84=['util','../../config/logger','api','request-promise','path','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues'];(function(_0x40be96,_0x4f0e14){var _0x3c0479=function(_0x32fbee){while(--_0x32fbee){_0x40be96['push'](_0x40be96['shift']());}};_0x3c0479(++_0x4f0e14);}(_0x2c84,0xa5));var _0x42c8=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2c84[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x42c8('0x0'));var logger=require(_0x42c8('0x1'))(_0x42c8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x42c8('0x3'));var fs=require('fs');var path=require(_0x42c8('0x4'));var rimraf=require('rimraf');var config=require(_0x42c8('0x5'));var attributes=require(_0x42c8('0x6'));module[_0x42c8('0x7')]=function(_0x45650a,_0xc3a3e4){return _0x45650a[_0x42c8('0x8')](_0x42c8('0x9'),attributes,{'tableName':_0x42c8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3a1a2c2..1aa3c25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdad5=['ShowWhatsappQueue','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','socket.io-emitter','./whatsappQueue.socket','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','message','info','catch','GetWhatsappQueue','options','where','attributes','include','map','model','stringify','WhatsappQueue','find'];(function(_0x1f9f5f,_0x509fb7){var _0x51d649=function(_0x4a5285){while(--_0x4a5285){_0x1f9f5f['push'](_0x1f9f5f['shift']());}};_0x51d649(++_0x509fb7);}(_0xdad5,0xcd));var _0x5dad=function(_0x293aae,_0xfab260){_0x293aae=_0x293aae-0x0;var _0x3b7abd=_0xdad5[_0x293aae];return _0x3b7abd;};'use strict';var _=require(_0x5dad('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5dad('0x1'));var rs=require(_0x5dad('0x2'));var fs=require('fs');var Redis=require(_0x5dad('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5dad('0x4'));var logger=require(_0x5dad('0x5'))(_0x5dad('0x6'));var config=require(_0x5dad('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5dad('0x8')][_0x5dad('0x9')]({'port':0x232a});config['redis']=_[_0x5dad('0xa')](config[_0x5dad('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x5dad('0xc'))(new Redis(config['redis']));require(_0x5dad('0xd'))['register'](socket);function respondWithRpcPromise(_0x3ce3bd,_0x50c113,_0x13f8e6){return new BPromise(function(_0x1558e3,_0x3184a2){return client['request'](_0x3ce3bd,_0x13f8e6)[_0x5dad('0xe')](function(_0x2bb82a){logger['info'](_0x5dad('0xf'),_0x50c113,_0x5dad('0x10'));logger[_0x5dad('0x11')](_0x5dad('0x12'),_0x50c113,_0x5dad('0x10'),JSON['stringify'](_0x2bb82a));if(_0x2bb82a['error']){if(_0x2bb82a[_0x5dad('0x13')]['code']===0x1f4){logger[_0x5dad('0x13')](_0x5dad('0xf'),_0x50c113,_0x2bb82a[_0x5dad('0x13')][_0x5dad('0x14')]);return _0x3184a2(_0x2bb82a['error']['message']);}logger[_0x5dad('0x13')](_0x5dad('0xf'),_0x50c113,_0x2bb82a[_0x5dad('0x13')][_0x5dad('0x14')]);return _0x1558e3(_0x2bb82a['error'][_0x5dad('0x14')]);}else{logger[_0x5dad('0x15')](_0x5dad('0xf'),_0x50c113,'request\x20sent');_0x1558e3(_0x2bb82a['result'][_0x5dad('0x14')]);}})[_0x5dad('0x16')](function(_0x40fa1d){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x50c113,_0x40fa1d);_0x3184a2(_0x40fa1d);});});}exports[_0x5dad('0x17')]=function(_0x14ef62){var _0x40f5b1=this;return new Promise(function(_0x4cf41c,_0x21ce2d){return db['WhatsappQueue']['findAll']({'raw':_0x14ef62['options']?_0x14ef62[_0x5dad('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x14ef62['options']?_0x14ef62[_0x5dad('0x18')][_0x5dad('0x19')]||null:null,'attributes':_0x14ef62[_0x5dad('0x18')]?_0x14ef62[_0x5dad('0x18')][_0x5dad('0x1a')]||null:null,'limit':_0x14ef62[_0x5dad('0x18')]?_0x14ef62[_0x5dad('0x18')]['limit']||null:null,'include':_0x14ef62[_0x5dad('0x18')]?_0x14ef62[_0x5dad('0x18')][_0x5dad('0x1b')]?_[_0x5dad('0x1c')](_0x14ef62['options']['include'],function(_0x4f75ae){return{'model':db[_0x4f75ae[_0x5dad('0x1d')]],'as':_0x4f75ae['as'],'attributes':_0x4f75ae[_0x5dad('0x1a')],'include':_0x4f75ae['include']?_[_0x5dad('0x1c')](_0x4f75ae[_0x5dad('0x1b')],function(_0x2fe9a9){return{'model':db[_0x2fe9a9['model']],'as':_0x2fe9a9['as'],'attributes':_0x2fe9a9[_0x5dad('0x1a')],'include':_0x2fe9a9[_0x5dad('0x1b')]?_[_0x5dad('0x1c')](_0x2fe9a9[_0x5dad('0x1b')],function(_0x18e77c){return{'model':db[_0x18e77c[_0x5dad('0x1d')]],'as':_0x18e77c['as'],'attributes':_0x18e77c[_0x5dad('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5dad('0xe')](function(_0x8e5ff){logger[_0x5dad('0x15')](_0x5dad('0x17'),_0x14ef62);logger['debug'](_0x5dad('0x17'),_0x14ef62,JSON[_0x5dad('0x1e')](_0x8e5ff));_0x4cf41c(_0x8e5ff);})[_0x5dad('0x16')](function(_0x54981d){logger[_0x5dad('0x13')]('GetWhatsappQueue',_0x54981d[_0x5dad('0x14')],_0x14ef62);_0x21ce2d(_0x40f5b1[_0x5dad('0x13')](0x1f4,_0x54981d['message']));});});};exports['ShowWhatsappQueue']=function(_0x114e37){var _0x844dca=this;return new Promise(function(_0x5d10b6,_0x19ae69){return db[_0x5dad('0x1f')][_0x5dad('0x20')]({'raw':_0x114e37[_0x5dad('0x18')]?_0x114e37[_0x5dad('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x114e37[_0x5dad('0x18')]?_0x114e37[_0x5dad('0x18')][_0x5dad('0x19')]||null:null,'attributes':_0x114e37['options']?_0x114e37[_0x5dad('0x18')]['attributes']||null:null,'include':_0x114e37[_0x5dad('0x18')]?_0x114e37[_0x5dad('0x18')][_0x5dad('0x1b')]?_[_0x5dad('0x1c')](_0x114e37['options'][_0x5dad('0x1b')],function(_0x322697){return{'model':db[_0x322697[_0x5dad('0x1d')]],'as':_0x322697['as'],'attributes':_0x322697[_0x5dad('0x1a')],'include':_0x322697[_0x5dad('0x1b')]?_['map'](_0x322697['include'],function(_0x191bea){return{'model':db[_0x191bea[_0x5dad('0x1d')]],'as':_0x191bea['as'],'attributes':_0x191bea[_0x5dad('0x1a')],'include':_0x191bea[_0x5dad('0x1b')]?_['map'](_0x191bea[_0x5dad('0x1b')],function(_0x4c06c7){return{'model':db[_0x4c06c7[_0x5dad('0x1d')]],'as':_0x4c06c7['as'],'attributes':_0x4c06c7[_0x5dad('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4674a6){logger['info']('ShowWhatsappQueue',_0x114e37);logger['debug'](_0x5dad('0x21'),_0x114e37,JSON[_0x5dad('0x1e')](_0x4674a6));_0x5d10b6(_0x4674a6);})['catch'](function(_0x48867f){logger[_0x5dad('0x13')]('ShowWhatsappQueue',_0x48867f[_0x5dad('0x14')],_0x114e37);_0x19ae69(_0x844dca[_0x5dad('0x13')](0x1f4,_0x48867f[_0x5dad('0x14')]));});});};
\ No newline at end of file
+var _0x475d=['client','defaults','redis','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','limit','map','include','attributes','model','ShowWhatsappQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1b66e9,_0x5ea388){var _0x3d5d36=function(_0x411659){while(--_0x411659){_0x1b66e9['push'](_0x1b66e9['shift']());}};_0x3d5d36(++_0x5ea388);}(_0x475d,0x1ee));var _0xd475=function(_0x40b7fc,_0x51c685){_0x40b7fc=_0x40b7fc-0x0;var _0xe7387a=_0x475d[_0x40b7fc];return _0xe7387a;};'use strict';var _=require(_0xd475('0x0'));var util=require(_0xd475('0x1'));var moment=require('moment');var BPromise=require(_0xd475('0x2'));var rs=require(_0xd475('0x3'));var fs=require('fs');var Redis=require(_0xd475('0x4'));var db=require(_0xd475('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd475('0x6'))(_0xd475('0x7'));var config=require(_0xd475('0x8'));var jayson=require(_0xd475('0x9'));var client=jayson[_0xd475('0xa')]['http']({'port':0x232a});config['redis']=_[_0xd475('0xb')](config[_0xd475('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xd475('0xd'))(new Redis(config['redis']));require(_0xd475('0xe'))[_0xd475('0xf')](socket);function respondWithRpcPromise(_0x3a1c8d,_0xfc4195,_0x514636){return new BPromise(function(_0x54b3b5,_0xe0606e){return client[_0xd475('0x10')](_0x3a1c8d,_0x514636)[_0xd475('0x11')](function(_0x11d775){logger[_0xd475('0x12')](_0xd475('0x13'),_0xfc4195,'request\x20sent');logger[_0xd475('0x14')](_0xd475('0x15'),_0xfc4195,_0xd475('0x16'),JSON[_0xd475('0x17')](_0x11d775));if(_0x11d775[_0xd475('0x18')]){if(_0x11d775[_0xd475('0x18')][_0xd475('0x19')]===0x1f4){logger['error'](_0xd475('0x13'),_0xfc4195,_0x11d775[_0xd475('0x18')][_0xd475('0x1a')]);return _0xe0606e(_0x11d775['error'][_0xd475('0x1a')]);}logger[_0xd475('0x18')](_0xd475('0x13'),_0xfc4195,_0x11d775[_0xd475('0x18')][_0xd475('0x1a')]);return _0x54b3b5(_0x11d775[_0xd475('0x18')]['message']);}else{logger[_0xd475('0x12')]('WhatsappQueue,\x20%s,\x20%s',_0xfc4195,_0xd475('0x16'));_0x54b3b5(_0x11d775[_0xd475('0x1b')][_0xd475('0x1a')]);}})[_0xd475('0x1c')](function(_0x15802e){logger[_0xd475('0x18')](_0xd475('0x13'),_0xfc4195,_0x15802e);_0xe0606e(_0x15802e);});});}exports[_0xd475('0x1d')]=function(_0x1282fc){var _0x34f208=this;return new Promise(function(_0x14b532,_0x20c246){return db[_0xd475('0x1e')][_0xd475('0x1f')]({'raw':_0x1282fc[_0xd475('0x20')]?_0x1282fc[_0xd475('0x20')][_0xd475('0x21')]===undefined?!![]:![]:!![],'where':_0x1282fc[_0xd475('0x20')]?_0x1282fc[_0xd475('0x20')][_0xd475('0x22')]||null:null,'attributes':_0x1282fc[_0xd475('0x20')]?_0x1282fc[_0xd475('0x20')]['attributes']||null:null,'limit':_0x1282fc[_0xd475('0x20')]?_0x1282fc[_0xd475('0x20')][_0xd475('0x23')]||null:null,'include':_0x1282fc[_0xd475('0x20')]?_0x1282fc[_0xd475('0x20')]['include']?_[_0xd475('0x24')](_0x1282fc['options'][_0xd475('0x25')],function(_0x383553){return{'model':db[_0x383553['model']],'as':_0x383553['as'],'attributes':_0x383553[_0xd475('0x26')],'include':_0x383553[_0xd475('0x25')]?_[_0xd475('0x24')](_0x383553['include'],function(_0x29c34f){return{'model':db[_0x29c34f[_0xd475('0x27')]],'as':_0x29c34f['as'],'attributes':_0x29c34f[_0xd475('0x26')],'include':_0x29c34f[_0xd475('0x25')]?_[_0xd475('0x24')](_0x29c34f[_0xd475('0x25')],function(_0xd59c2c){return{'model':db[_0xd59c2c[_0xd475('0x27')]],'as':_0xd59c2c['as'],'attributes':_0xd59c2c[_0xd475('0x26')]};}):[]};}):[]};}):[]:[]})[_0xd475('0x11')](function(_0x58c9f6){logger[_0xd475('0x12')](_0xd475('0x1d'),_0x1282fc);logger[_0xd475('0x14')]('GetWhatsappQueue',_0x1282fc,JSON['stringify'](_0x58c9f6));_0x14b532(_0x58c9f6);})[_0xd475('0x1c')](function(_0x420671){logger[_0xd475('0x18')](_0xd475('0x1d'),_0x420671[_0xd475('0x1a')],_0x1282fc);_0x20c246(_0x34f208[_0xd475('0x18')](0x1f4,_0x420671[_0xd475('0x1a')]));});});};exports[_0xd475('0x28')]=function(_0x260759){var _0x5da656=this;return new Promise(function(_0x394ae1,_0xe31fe5){return db[_0xd475('0x1e')][_0xd475('0x29')]({'raw':_0x260759[_0xd475('0x20')]?_0x260759[_0xd475('0x20')][_0xd475('0x21')]===undefined?!![]:![]:!![],'where':_0x260759['options']?_0x260759[_0xd475('0x20')]['where']||null:null,'attributes':_0x260759[_0xd475('0x20')]?_0x260759['options'][_0xd475('0x26')]||null:null,'include':_0x260759[_0xd475('0x20')]?_0x260759[_0xd475('0x20')][_0xd475('0x25')]?_[_0xd475('0x24')](_0x260759['options'][_0xd475('0x25')],function(_0x4c2480){return{'model':db[_0x4c2480[_0xd475('0x27')]],'as':_0x4c2480['as'],'attributes':_0x4c2480[_0xd475('0x26')],'include':_0x4c2480['include']?_[_0xd475('0x24')](_0x4c2480[_0xd475('0x25')],function(_0x1cdaee){return{'model':db[_0x1cdaee[_0xd475('0x27')]],'as':_0x1cdaee['as'],'attributes':_0x1cdaee['attributes'],'include':_0x1cdaee['include']?_[_0xd475('0x24')](_0x1cdaee[_0xd475('0x25')],function(_0x45d1f0){return{'model':db[_0x45d1f0[_0xd475('0x27')]],'as':_0x45d1f0['as'],'attributes':_0x45d1f0[_0xd475('0x26')]};}):[]};}):[]};}):[]:[]})[_0xd475('0x11')](function(_0x476137){logger[_0xd475('0x12')](_0xd475('0x28'),_0x260759);logger[_0xd475('0x14')](_0xd475('0x28'),_0x260759,JSON['stringify'](_0x476137));_0x394ae1(_0x476137);})['catch'](function(_0x3297ba){logger['error']('ShowWhatsappQueue',_0x3297ba[_0xd475('0x1a')],_0x260759);_0xe31fe5(_0x5da656[_0xd475('0x18')](0x1f4,_0x3297ba[_0xd475('0x1a')]));});});};
\ No newline at end of file
index 92c2ddc..d7da41c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0472=['save','update','emit','removeListener','register','length','whatsappQueue:'];(function(_0x2b8d9a,_0x567a67){var _0x879dd=function(_0xecaf){while(--_0xecaf){_0x2b8d9a['push'](_0x2b8d9a['shift']());}};_0x879dd(++_0x567a67);}(_0x0472,0x10a));var _0x2047=function(_0xf29c3a,_0x3f43be){_0xf29c3a=_0xf29c3a-0x0;var _0x5632c9=_0x0472[_0xf29c3a];return _0x5632c9;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x2047('0x0'),'remove',_0x2047('0x1')];function createListener(_0x461ee0,_0x48d430){return function(_0x437ec6){_0x48d430[_0x2047('0x2')](_0x461ee0,_0x437ec6);};}function removeListener(_0x3865e8,_0x185478){return function(){WhatsappQueueEvents[_0x2047('0x3')](_0x3865e8,_0x185478);};}exports[_0x2047('0x4')]=function(_0x2c47be){for(var _0x1c45c4=0x0,_0x38223d=events[_0x2047('0x5')];_0x1c45c4<_0x38223d;_0x1c45c4++){var _0x50873e=events[_0x1c45c4];var _0x41ca25=createListener(_0x2047('0x6')+_0x50873e,_0x2c47be);WhatsappQueueEvents['on'](_0x50873e,_0x41ca25);}};
\ No newline at end of file
+var _0x1ffc=['removeListener','register','whatsappQueue:','./whatsappQueue.events','save','remove','update'];(function(_0x5dab9e,_0x35981b){var _0x13c7c9=function(_0x2caf8b){while(--_0x2caf8b){_0x5dab9e['push'](_0x5dab9e['shift']());}};_0x13c7c9(++_0x35981b);}(_0x1ffc,0x65));var _0xc1ff=function(_0x256b7a,_0x5ec434){_0x256b7a=_0x256b7a-0x0;var _0x421a54=_0x1ffc[_0x256b7a];return _0x421a54;};'use strict';var WhatsappQueueEvents=require(_0xc1ff('0x0'));var events=[_0xc1ff('0x1'),_0xc1ff('0x2'),_0xc1ff('0x3')];function createListener(_0x51ec89,_0x1a9f42){return function(_0x424569){_0x1a9f42['emit'](_0x51ec89,_0x424569);};}function removeListener(_0x367bd4,_0x512441){return function(){WhatsappQueueEvents[_0xc1ff('0x4')](_0x367bd4,_0x512441);};}exports[_0xc1ff('0x5')]=function(_0x4ebb34){for(var _0x3a51a5=0x0,_0x43e463=events['length'];_0x3a51a5<_0x43e463;_0x3a51a5++){var _0x16ad34=events[_0x3a51a5];var _0x49c0be=createListener(_0xc1ff('0x6')+_0x16ad34,_0x4ebb34);WhatsappQueueEvents['on'](_0x16ad34,_0x49c0be);}};
\ No newline at end of file
index 54e95c5..0f5da13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06a6=['connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappQueueReport.controller','get','index','isAuthenticated','show','post','create','put','/:id','update','destroy','multer','util','path'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x06a6,0x12d));var _0x606a=function(_0x1c9671,_0x3cf964){_0x1c9671=_0x1c9671-0x0;var _0x1dd552=_0x06a6[_0x1c9671];return _0x1dd552;};'use strict';var multer=require(_0x606a('0x0'));var util=require(_0x606a('0x1'));var path=require(_0x606a('0x2'));var timeout=require(_0x606a('0x3'));var express=require(_0x606a('0x4'));var router=express[_0x606a('0x5')]();var fs_extra=require(_0x606a('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x606a('0x7'));var controller=require(_0x606a('0x8'));router[_0x606a('0x9')]('/',auth['isAuthenticated'](),controller[_0x606a('0xa')]);router[_0x606a('0x9')]('/describe',auth[_0x606a('0xb')](),controller['describe']);router['get']('/:id',auth[_0x606a('0xb')](),controller[_0x606a('0xc')]);router[_0x606a('0xd')]('/',auth[_0x606a('0xb')](),controller[_0x606a('0xe')]);router[_0x606a('0xf')](_0x606a('0x10'),auth['isAuthenticated'](),controller[_0x606a('0x11')]);router['delete'](_0x606a('0x10'),auth[_0x606a('0xb')](),controller[_0x606a('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x2913=['put','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create'];(function(_0x44cbf2,_0x43ee3d){var _0x5146fe=function(_0x44c486){while(--_0x44c486){_0x44cbf2['push'](_0x44cbf2['shift']());}};_0x5146fe(++_0x43ee3d);}(_0x2913,0x13f));var _0x3291=function(_0x4fda07,_0x29c36a){_0x4fda07=_0x4fda07-0x0;var _0x14ba38=_0x2913[_0x4fda07];return _0x14ba38;};'use strict';var multer=require('multer');var util=require(_0x3291('0x0'));var path=require('path');var timeout=require(_0x3291('0x1'));var express=require(_0x3291('0x2'));var router=express[_0x3291('0x3')]();var fs_extra=require(_0x3291('0x4'));var auth=require(_0x3291('0x5'));var interaction=require(_0x3291('0x6'));var config=require(_0x3291('0x7'));var controller=require(_0x3291('0x8'));router[_0x3291('0x9')]('/',auth[_0x3291('0xa')](),controller[_0x3291('0xb')]);router[_0x3291('0x9')]('/describe',auth[_0x3291('0xa')](),controller[_0x3291('0xc')]);router[_0x3291('0x9')](_0x3291('0xd'),auth[_0x3291('0xa')](),controller[_0x3291('0xe')]);router[_0x3291('0xf')]('/',auth[_0x3291('0xa')](),controller[_0x3291('0x10')]);router[_0x3291('0x11')](_0x3291('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x3291('0x12')](_0x3291('0xd'),auth[_0x3291('0xa')](),controller[_0x3291('0x13')]);module[_0x3291('0x14')]=router;
\ No newline at end of file
index a99360e..5c82487 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x532e8b,_0x564e4d){var _0x202202=function(_0x18dd0f){while(--_0x18dd0f){_0x532e8b['push'](_0x532e8b['shift']());}};_0x202202(++_0x564e4d);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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(_0x4994f7,_0x17c085){var _0x5ebe22=function(_0x110b28){while(--_0x110b28){_0x4994f7['push'](_0x4994f7['shift']());}};_0x5ebe22(++_0x17c085);}(_0x7a54,0x106));var _0x47a5=function(_0x1877e8,_0x139210){_0x1877e8=_0x1877e8-0x0;var _0x27e020=_0x7a54[_0x1877e8];return _0x27e020;};'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 69e2817..59a1a07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbee3=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','WhatsappQueueReport','rawAttributes','type','key','model','keys','query','attributes','intersection','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','body','find','describe','rimraf','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0xbee3,0xd5));var _0x3bee=function(_0x46529d,_0x21525f){_0x46529d=_0x46529d-0x0;var _0x5cba65=_0xbee3[_0x46529d];return _0x5cba65;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3bee('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3bee('0x1'));var moment=require(_0x3bee('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3bee('0x3'));var util=require(_0x3bee('0x4'));var path=require(_0x3bee('0x5'));var sox=require('sox');var csv=require(_0x3bee('0x6'));var ejs=require(_0x3bee('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3bee('0x8'));var squel=require(_0x3bee('0x9'));var crypto=require(_0x3bee('0xa'));var jsforce=require(_0x3bee('0xb'));var deskjs=require(_0x3bee('0xc'));var toCsv=require(_0x3bee('0x6'));var querystring=require(_0x3bee('0xd'));var Papa=require('papaparse');var Redis=require(_0x3bee('0xe'));var authService=require(_0x3bee('0xf'));var qs=require(_0x3bee('0x10'));var as=require(_0x3bee('0x11'));var hardwareService=require(_0x3bee('0x12'));var logger=require(_0x3bee('0x13'))('api');var utils=require(_0x3bee('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3bee('0x15'));var db=require(_0x3bee('0x16'))['db'];function respondWithStatusCode(_0x407526,_0x6950d0){_0x6950d0=_0x6950d0||0xcc;return function(_0x410124){if(_0x410124){return _0x407526[_0x3bee('0x17')](_0x6950d0);}return _0x407526[_0x3bee('0x18')](_0x6950d0)['end']();};}function respondWithResult(_0xad01f9,_0x33504d){_0x33504d=_0x33504d||0xc8;return function(_0x31ac52){if(_0x31ac52){return _0xad01f9[_0x3bee('0x18')](_0x33504d)[_0x3bee('0x19')](_0x31ac52);}};}function respondWithFilteredResult(_0x5b9473,_0x558436){return function(_0x346767){if(_0x346767){var _0x515397=typeof _0x558436[_0x3bee('0x1a')]===_0x3bee('0x1b')&&typeof _0x558436['limit']==='undefined';var _0x1582a4=_0x346767[_0x3bee('0x1c')];var _0xfdba3b=_0x515397?0x0:_0x558436[_0x3bee('0x1a')];var _0x49095a=_0x515397?_0x346767[_0x3bee('0x1c')]:_0x558436[_0x3bee('0x1a')]+_0x558436[_0x3bee('0x1d')];var _0x49b32d;if(_0x49095a>=_0x1582a4){_0x49095a=_0x1582a4;_0x49b32d=0xc8;}else{_0x49b32d=0xce;}_0x5b9473[_0x3bee('0x18')](_0x49b32d);return _0x5b9473[_0x3bee('0x1e')](_0x3bee('0x1f'),_0xfdba3b+'-'+_0x49095a+'/'+_0x1582a4)['json'](_0x346767);}return null;};}function patchUpdates(_0x4f36af){return function(_0x1afd0f){try{jsonpatch[_0x3bee('0x20')](_0x1afd0f,_0x4f36af,!![]);}catch(_0x57aba4){return BPromise[_0x3bee('0x21')](_0x57aba4);}return _0x1afd0f[_0x3bee('0x22')]();};}function saveUpdates(_0x2eea75,_0x179e62){return function(_0x28c248){if(_0x28c248){return _0x28c248[_0x3bee('0x23')](_0x2eea75)[_0x3bee('0x24')](function(_0x582fa9){return _0x582fa9;});}return null;};}function removeEntity(_0x8ae4ca,_0x1ed0c1){return function(_0x1fed5a){if(_0x1fed5a){return _0x1fed5a[_0x3bee('0x25')]()['then'](function(){_0x8ae4ca[_0x3bee('0x18')](0xcc)[_0x3bee('0x26')]();});}};}function handleEntityNotFound(_0x1e0111,_0x4b4cd4){return function(_0x5ed022){if(!_0x5ed022){_0x1e0111[_0x3bee('0x17')](0x194);}return _0x5ed022;};}function handleError(_0x479f45,_0x5341e2){_0x5341e2=_0x5341e2||0x1f4;return function(_0x2c0e50){logger[_0x3bee('0x27')](_0x2c0e50[_0x3bee('0x28')]);if(_0x2c0e50['name']){delete _0x2c0e50[_0x3bee('0x29')];}_0x479f45[_0x3bee('0x18')](_0x5341e2)[_0x3bee('0x2a')](_0x2c0e50);};}exports['index']=function(_0x239fa4,_0xf08fb3){var _0x3a3d92={},_0x496abd={},_0x1115ed={'count':0x0,'rows':[]};var _0x24d523=_[_0x3bee('0x2b')](db[_0x3bee('0x2c')][_0x3bee('0x2d')],function(_0x559c2b){return{'name':_0x559c2b['fieldName'],'type':_0x559c2b[_0x3bee('0x2e')][_0x3bee('0x2f')]};});_0x496abd[_0x3bee('0x30')]=_[_0x3bee('0x2b')](_0x24d523,'name');_0x496abd['query']=_[_0x3bee('0x31')](_0x239fa4[_0x3bee('0x32')]);_0x496abd['filters']=_['intersection'](_0x496abd[_0x3bee('0x30')],_0x496abd[_0x3bee('0x32')]);_0x3a3d92[_0x3bee('0x33')]=_[_0x3bee('0x34')](_0x496abd[_0x3bee('0x30')],qs[_0x3bee('0x35')](_0x239fa4[_0x3bee('0x32')][_0x3bee('0x35')]));_0x3a3d92[_0x3bee('0x33')]=_0x3a3d92[_0x3bee('0x33')]['length']?_0x3a3d92['attributes']:_0x496abd[_0x3bee('0x30')];if(!_0x239fa4['query']['hasOwnProperty'](_0x3bee('0x36'))){_0x3a3d92[_0x3bee('0x1d')]=qs[_0x3bee('0x1d')](_0x239fa4[_0x3bee('0x32')][_0x3bee('0x1d')]);_0x3a3d92[_0x3bee('0x1a')]=qs[_0x3bee('0x1a')](_0x239fa4[_0x3bee('0x32')]['offset']);}_0x3a3d92[_0x3bee('0x37')]=qs[_0x3bee('0x38')](_0x239fa4['query'][_0x3bee('0x38')]);_0x3a3d92[_0x3bee('0x39')]=qs[_0x3bee('0x3a')](_[_0x3bee('0x3b')](_0x239fa4[_0x3bee('0x32')],_0x496abd['filters']),_0x24d523);if(_0x239fa4['query'][_0x3bee('0x3c')]){_0x3a3d92[_0x3bee('0x39')]=_[_0x3bee('0x3d')](_0x3a3d92[_0x3bee('0x39')],{'$or':_[_0x3bee('0x2b')](_0x24d523,function(_0x3d9656){if(_0x3d9656[_0x3bee('0x2e')]!==_0x3bee('0x3e')){var _0x2fb349={};_0x2fb349[_0x3d9656[_0x3bee('0x29')]]={'$like':'%'+_0x239fa4[_0x3bee('0x32')][_0x3bee('0x3c')]+'%'};return _0x2fb349;}})});}_0x3a3d92=_['merge']({},_0x3a3d92,_0x239fa4[_0x3bee('0x3f')]);var _0x1b5eca={'where':_0x3a3d92[_0x3bee('0x39')]};return db[_0x3bee('0x2c')][_0x3bee('0x1c')](_0x1b5eca)[_0x3bee('0x24')](function(_0x1622b9){_0x1115ed[_0x3bee('0x1c')]=_0x1622b9;if(_0x239fa4[_0x3bee('0x32')][_0x3bee('0x40')]){_0x3a3d92[_0x3bee('0x41')]=[{'all':!![]}];}return db[_0x3bee('0x2c')][_0x3bee('0x42')](_0x3a3d92);})['then'](function(_0x2b773d){_0x1115ed[_0x3bee('0x43')]=_0x2b773d;return _0x1115ed;})[_0x3bee('0x24')](respondWithFilteredResult(_0xf08fb3,_0x3a3d92))[_0x3bee('0x44')](handleError(_0xf08fb3,null));};exports[_0x3bee('0x45')]=function(_0x44489f,_0x13dd72){var _0xd1140d={'raw':!![],'where':{'id':_0x44489f[_0x3bee('0x46')]['id']}},_0x5d9e1b={};_0x5d9e1b[_0x3bee('0x30')]=_[_0x3bee('0x31')](db['WhatsappQueueReport'][_0x3bee('0x2d')]);_0x5d9e1b['query']=_[_0x3bee('0x31')](_0x44489f['query']);_0x5d9e1b['filters']=_[_0x3bee('0x34')](_0x5d9e1b[_0x3bee('0x30')],_0x5d9e1b[_0x3bee('0x32')]);_0xd1140d[_0x3bee('0x33')]=_[_0x3bee('0x34')](_0x5d9e1b['model'],qs['fields'](_0x44489f[_0x3bee('0x32')]['fields']));_0xd1140d[_0x3bee('0x33')]=_0xd1140d['attributes'][_0x3bee('0x47')]?_0xd1140d['attributes']:_0x5d9e1b[_0x3bee('0x30')];if(_0x44489f[_0x3bee('0x32')][_0x3bee('0x40')]){_0xd1140d[_0x3bee('0x41')]=[{'all':!![]}];}_0xd1140d=_['merge']({},_0xd1140d,_0x44489f['options']);return db[_0x3bee('0x2c')]['find'](_0xd1140d)['then'](handleEntityNotFound(_0x13dd72,null))['then'](respondWithResult(_0x13dd72,null))[_0x3bee('0x44')](handleError(_0x13dd72,null));};exports['create']=function(_0x125fa5,_0x33d615){return db[_0x3bee('0x2c')]['create'](_0x125fa5[_0x3bee('0x48')],{})['then'](respondWithResult(_0x33d615,0xc9))[_0x3bee('0x44')](handleError(_0x33d615,null));};exports['update']=function(_0x26ccd7,_0x16b096){if(_0x26ccd7[_0x3bee('0x48')]['id']){delete _0x26ccd7['body']['id'];}return db[_0x3bee('0x2c')][_0x3bee('0x49')]({'where':{'id':_0x26ccd7[_0x3bee('0x46')]['id']}})['then'](handleEntityNotFound(_0x16b096,null))['then'](saveUpdates(_0x26ccd7[_0x3bee('0x48')],null))[_0x3bee('0x24')](respondWithResult(_0x16b096,null))[_0x3bee('0x44')](handleError(_0x16b096,null));};exports[_0x3bee('0x25')]=function(_0x3b5d7a,_0x21ab40){return db[_0x3bee('0x2c')]['find']({'where':{'id':_0x3b5d7a[_0x3bee('0x46')]['id']}})[_0x3bee('0x24')](handleEntityNotFound(_0x21ab40,null))['then'](removeEntity(_0x21ab40,null))['catch'](handleError(_0x21ab40,null));};exports[_0x3bee('0x4a')]=function(_0x5d4755,_0x1cb54e){return db[_0x3bee('0x2c')][_0x3bee('0x4a')]()['then'](respondWithResult(_0x1cb54e,null))[_0x3bee('0x44')](handleError(_0x1cb54e,null));};
\ No newline at end of file
+var _0xf7b4=['../../config/environment','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','WhatsappQueueReport','rows','catch','show','params','find','create','body','destroy','describe','eml-format','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0xf7b4,0x152));var _0x4f7b=function(_0x5cdae9,_0x5e30a9){_0x5cdae9=_0x5cdae9-0x0;var _0x417701=_0xf7b4[_0x5cdae9];return _0x417701;};'use strict';var emlformat=require(_0x4f7b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4f7b('0x1'));var rp=require(_0x4f7b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4f7b('0x3'));var util=require(_0x4f7b('0x4'));var path=require(_0x4f7b('0x5'));var sox=require(_0x4f7b('0x6'));var csv=require(_0x4f7b('0x7'));var ejs=require(_0x4f7b('0x8'));var fs=require('fs');var fs_extra=require(_0x4f7b('0x9'));var _=require(_0x4f7b('0xa'));var squel=require(_0x4f7b('0xb'));var crypto=require(_0x4f7b('0xc'));var jsforce=require(_0x4f7b('0xd'));var deskjs=require(_0x4f7b('0xe'));var toCsv=require(_0x4f7b('0x7'));var querystring=require('querystring');var Papa=require(_0x4f7b('0xf'));var Redis=require(_0x4f7b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4f7b('0x11'));var as=require(_0x4f7b('0x12'));var hardwareService=require(_0x4f7b('0x13'));var logger=require(_0x4f7b('0x14'))(_0x4f7b('0x15'));var utils=require('../../config/utils');var config=require(_0x4f7b('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd9b349,_0x2e8dd9){_0x2e8dd9=_0x2e8dd9||0xcc;return function(_0x3c55e1){if(_0x3c55e1){return _0xd9b349[_0x4f7b('0x17')](_0x2e8dd9);}return _0xd9b349['status'](_0x2e8dd9)[_0x4f7b('0x18')]();};}function respondWithResult(_0x368091,_0x407cee){_0x407cee=_0x407cee||0xc8;return function(_0x43a51a){if(_0x43a51a){return _0x368091[_0x4f7b('0x19')](_0x407cee)[_0x4f7b('0x1a')](_0x43a51a);}};}function respondWithFilteredResult(_0x40ecb0,_0x2437cc){return function(_0x260667){if(_0x260667){var _0x29fdd5=typeof _0x2437cc[_0x4f7b('0x1b')]===_0x4f7b('0x1c')&&typeof _0x2437cc['limit']===_0x4f7b('0x1c');var _0x496322=_0x260667['count'];var _0x24e5cf=_0x29fdd5?0x0:_0x2437cc[_0x4f7b('0x1b')];var _0x519d90=_0x29fdd5?_0x260667[_0x4f7b('0x1d')]:_0x2437cc[_0x4f7b('0x1b')]+_0x2437cc[_0x4f7b('0x1e')];var _0xf2311f;if(_0x519d90>=_0x496322){_0x519d90=_0x496322;_0xf2311f=0xc8;}else{_0xf2311f=0xce;}_0x40ecb0['status'](_0xf2311f);return _0x40ecb0[_0x4f7b('0x1f')]('Content-Range',_0x24e5cf+'-'+_0x519d90+'/'+_0x496322)[_0x4f7b('0x1a')](_0x260667);}return null;};}function patchUpdates(_0x12374b){return function(_0xa2f54e){try{jsonpatch[_0x4f7b('0x20')](_0xa2f54e,_0x12374b,!![]);}catch(_0x27127b){return BPromise[_0x4f7b('0x21')](_0x27127b);}return _0xa2f54e[_0x4f7b('0x22')]();};}function saveUpdates(_0x1f545e,_0x2a8b50){return function(_0x5508bd){if(_0x5508bd){return _0x5508bd[_0x4f7b('0x23')](_0x1f545e)[_0x4f7b('0x24')](function(_0x2c9ea6){return _0x2c9ea6;});}return null;};}function removeEntity(_0x5bd43f,_0x150f57){return function(_0x4610a4){if(_0x4610a4){return _0x4610a4['destroy']()[_0x4f7b('0x24')](function(){_0x5bd43f['status'](0xcc)[_0x4f7b('0x18')]();});}};}function handleEntityNotFound(_0x2429be,_0x23c820){return function(_0x278c41){if(!_0x278c41){_0x2429be[_0x4f7b('0x17')](0x194);}return _0x278c41;};}function handleError(_0x94478b,_0x181e13){_0x181e13=_0x181e13||0x1f4;return function(_0x3ad769){logger['error'](_0x3ad769[_0x4f7b('0x25')]);if(_0x3ad769[_0x4f7b('0x26')]){delete _0x3ad769[_0x4f7b('0x26')];}_0x94478b['status'](_0x181e13)[_0x4f7b('0x27')](_0x3ad769);};}exports[_0x4f7b('0x28')]=function(_0x1db684,_0x3a56ff){var _0x1ccce0={},_0x4ebffa={},_0xac1f93={'count':0x0,'rows':[]};var _0x3331b2=_[_0x4f7b('0x29')](db['WhatsappQueueReport'][_0x4f7b('0x2a')],function(_0x5d13a1){return{'name':_0x5d13a1['fieldName'],'type':_0x5d13a1[_0x4f7b('0x2b')]['key']};});_0x4ebffa[_0x4f7b('0x2c')]=_[_0x4f7b('0x29')](_0x3331b2,_0x4f7b('0x26'));_0x4ebffa[_0x4f7b('0x2d')]=_[_0x4f7b('0x2e')](_0x1db684[_0x4f7b('0x2d')]);_0x4ebffa[_0x4f7b('0x2f')]=_[_0x4f7b('0x30')](_0x4ebffa[_0x4f7b('0x2c')],_0x4ebffa[_0x4f7b('0x2d')]);_0x1ccce0[_0x4f7b('0x31')]=_[_0x4f7b('0x30')](_0x4ebffa[_0x4f7b('0x2c')],qs[_0x4f7b('0x32')](_0x1db684[_0x4f7b('0x2d')][_0x4f7b('0x32')]));_0x1ccce0[_0x4f7b('0x31')]=_0x1ccce0[_0x4f7b('0x31')][_0x4f7b('0x33')]?_0x1ccce0[_0x4f7b('0x31')]:_0x4ebffa[_0x4f7b('0x2c')];if(!_0x1db684[_0x4f7b('0x2d')]['hasOwnProperty'](_0x4f7b('0x34'))){_0x1ccce0['limit']=qs[_0x4f7b('0x1e')](_0x1db684[_0x4f7b('0x2d')]['limit']);_0x1ccce0[_0x4f7b('0x1b')]=qs[_0x4f7b('0x1b')](_0x1db684[_0x4f7b('0x2d')]['offset']);}_0x1ccce0[_0x4f7b('0x35')]=qs[_0x4f7b('0x36')](_0x1db684[_0x4f7b('0x2d')][_0x4f7b('0x36')]);_0x1ccce0[_0x4f7b('0x37')]=qs[_0x4f7b('0x2f')](_[_0x4f7b('0x38')](_0x1db684['query'],_0x4ebffa[_0x4f7b('0x2f')]),_0x3331b2);if(_0x1db684['query'][_0x4f7b('0x39')]){_0x1ccce0[_0x4f7b('0x37')]=_[_0x4f7b('0x3a')](_0x1ccce0['where'],{'$or':_[_0x4f7b('0x29')](_0x3331b2,function(_0x53da14){if(_0x53da14[_0x4f7b('0x2b')]!==_0x4f7b('0x3b')){var _0x49644e={};_0x49644e[_0x53da14['name']]={'$like':'%'+_0x1db684[_0x4f7b('0x2d')]['filter']+'%'};return _0x49644e;}})});}_0x1ccce0=_[_0x4f7b('0x3a')]({},_0x1ccce0,_0x1db684[_0x4f7b('0x3c')]);var _0x54f9e8={'where':_0x1ccce0[_0x4f7b('0x37')]};return db['WhatsappQueueReport']['count'](_0x54f9e8)['then'](function(_0x1e4421){_0xac1f93[_0x4f7b('0x1d')]=_0x1e4421;if(_0x1db684[_0x4f7b('0x2d')][_0x4f7b('0x3d')]){_0x1ccce0['include']=[{'all':!![]}];}return db[_0x4f7b('0x3e')]['findAll'](_0x1ccce0);})[_0x4f7b('0x24')](function(_0x586406){_0xac1f93[_0x4f7b('0x3f')]=_0x586406;return _0xac1f93;})['then'](respondWithFilteredResult(_0x3a56ff,_0x1ccce0))[_0x4f7b('0x40')](handleError(_0x3a56ff,null));};exports[_0x4f7b('0x41')]=function(_0x302163,_0x3ab08f){var _0x2986cd={'raw':!![],'where':{'id':_0x302163[_0x4f7b('0x42')]['id']}},_0x325cd6={};_0x325cd6[_0x4f7b('0x2c')]=_[_0x4f7b('0x2e')](db[_0x4f7b('0x3e')][_0x4f7b('0x2a')]);_0x325cd6[_0x4f7b('0x2d')]=_[_0x4f7b('0x2e')](_0x302163[_0x4f7b('0x2d')]);_0x325cd6[_0x4f7b('0x2f')]=_[_0x4f7b('0x30')](_0x325cd6[_0x4f7b('0x2c')],_0x325cd6[_0x4f7b('0x2d')]);_0x2986cd['attributes']=_['intersection'](_0x325cd6[_0x4f7b('0x2c')],qs[_0x4f7b('0x32')](_0x302163[_0x4f7b('0x2d')][_0x4f7b('0x32')]));_0x2986cd['attributes']=_0x2986cd['attributes'][_0x4f7b('0x33')]?_0x2986cd[_0x4f7b('0x31')]:_0x325cd6[_0x4f7b('0x2c')];if(_0x302163[_0x4f7b('0x2d')]['includeAll']){_0x2986cd['include']=[{'all':!![]}];}_0x2986cd=_[_0x4f7b('0x3a')]({},_0x2986cd,_0x302163[_0x4f7b('0x3c')]);return db[_0x4f7b('0x3e')][_0x4f7b('0x43')](_0x2986cd)[_0x4f7b('0x24')](handleEntityNotFound(_0x3ab08f,null))['then'](respondWithResult(_0x3ab08f,null))[_0x4f7b('0x40')](handleError(_0x3ab08f,null));};exports[_0x4f7b('0x44')]=function(_0x35c0ea,_0x5df68e){return db[_0x4f7b('0x3e')][_0x4f7b('0x44')](_0x35c0ea[_0x4f7b('0x45')],{})[_0x4f7b('0x24')](respondWithResult(_0x5df68e,0xc9))[_0x4f7b('0x40')](handleError(_0x5df68e,null));};exports[_0x4f7b('0x23')]=function(_0xee485,_0x2e563f){if(_0xee485[_0x4f7b('0x45')]['id']){delete _0xee485[_0x4f7b('0x45')]['id'];}return db['WhatsappQueueReport'][_0x4f7b('0x43')]({'where':{'id':_0xee485[_0x4f7b('0x42')]['id']}})[_0x4f7b('0x24')](handleEntityNotFound(_0x2e563f,null))['then'](saveUpdates(_0xee485[_0x4f7b('0x45')],null))[_0x4f7b('0x24')](respondWithResult(_0x2e563f,null))[_0x4f7b('0x40')](handleError(_0x2e563f,null));};exports[_0x4f7b('0x46')]=function(_0x145dd7,_0x7e624){return db[_0x4f7b('0x3e')][_0x4f7b('0x43')]({'where':{'id':_0x145dd7[_0x4f7b('0x42')]['id']}})[_0x4f7b('0x24')](handleEntityNotFound(_0x7e624,null))['then'](removeEntity(_0x7e624,null))[_0x4f7b('0x40')](handleError(_0x7e624,null));};exports[_0x4f7b('0x47')]=function(_0x12b6a6,_0x4d1ac9){return db[_0x4f7b('0x3e')][_0x4f7b('0x47')]()[_0x4f7b('0x24')](respondWithResult(_0x4d1ac9,null))[_0x4f7b('0x40')](handleError(_0x4d1ac9,null));};
\ No newline at end of file
index 20a97b9..fef4cea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc12c=['path','rimraf','../../config/environment','exports','define','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xce93c,_0x555be5){var _0x230720=function(_0x6d5428){while(--_0x6d5428){_0xce93c['push'](_0xce93c['shift']());}};_0x230720(++_0x555be5);}(_0xc12c,0x125));var _0xcc12=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xc12c[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xcc12('0x0'));var util=require(_0xcc12('0x1'));var logger=require(_0xcc12('0x2'))(_0xcc12('0x3'));var moment=require(_0xcc12('0x4'));var BPromise=require(_0xcc12('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc12('0x6'));var rimraf=require(_0xcc12('0x7'));var config=require(_0xcc12('0x8'));var attributes=require('./whatsappQueueReport.attributes');module[_0xcc12('0x9')]=function(_0x10ae6d,_0x33f005){return _0x10ae6d[_0xcc12('0xa')]('WhatsappQueueReport',attributes,{'tableName':_0xcc12('0xb'),'paranoid':![],'indexes':[{'name':_0xcc12('0xc'),'fields':[_0xcc12('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x18de=['uniqueid','lodash','../../config/logger','api','moment','rimraf','define','WhatsappQueueReport','report_whatsapp_queue'];(function(_0x3ed4cf,_0x44a269){var _0xad4e4d=function(_0x1283a8){while(--_0x1283a8){_0x3ed4cf['push'](_0x3ed4cf['shift']());}};_0xad4e4d(++_0x44a269);}(_0x18de,0x1cc));var _0xe18d=function(_0x345ff7,_0x467d52){_0x345ff7=_0x345ff7-0x0;var _0x1d3190=_0x18de[_0x345ff7];return _0x1d3190;};'use strict';var _=require(_0xe18d('0x0'));var util=require('util');var logger=require(_0xe18d('0x1'))(_0xe18d('0x2'));var moment=require(_0xe18d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe18d('0x4'));var config=require('../../config/environment');var attributes=require('./whatsappQueueReport.attributes');module['exports']=function(_0x45100c,_0x4b0a29){return _0x45100c[_0xe18d('0x5')](_0xe18d('0x6'),attributes,{'tableName':_0xe18d('0x7'),'paranoid':![],'indexes':[{'name':_0xe18d('0x8'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index bcbcc11..3fa19d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe33a=['WhatsappQueueReport','update','body','attributes','limit','UpdateWhatsappQueueReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','create','options','raw','CreateWhatsappQueueReport','catch'];(function(_0x1848a2,_0x599ec5){var _0x900166=function(_0x1398d1){while(--_0x1398d1){_0x1848a2['push'](_0x1848a2['shift']());}};_0x900166(++_0x599ec5);}(_0xe33a,0x1e6));var _0xae33=function(_0x583974,_0x15c486){_0x583974=_0x583974-0x0;var _0x531944=_0xe33a[_0x583974];return _0x531944;};'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')]('WhatsappQueueReport,\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']('WhatsappQueueReport,\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['CreateWhatsappQueueReport']=function(_0x24aaa2){var _0x5c57b1=this;return new Promise(function(_0x123dd4,_0xaf82d7){return db['WhatsappQueueReport'][_0xae33('0x15')](_0x24aaa2['body'],{'raw':_0x24aaa2[_0xae33('0x16')]?_0x24aaa2[_0xae33('0x16')][_0xae33('0x17')]===undefined?!![]:![]:!![]})[_0xae33('0xb')](function(_0x3e3fe4){logger[_0xae33('0xc')](_0xae33('0x18'),_0x24aaa2);logger[_0xae33('0xe')](_0xae33('0x18'),_0x24aaa2,JSON['stringify'](_0x3e3fe4));_0x123dd4(_0x3e3fe4);})[_0xae33('0x19')](function(_0x17c4b4){logger[_0xae33('0x11')](_0xae33('0x18'),_0x17c4b4[_0xae33('0x13')],_0x24aaa2);_0xaf82d7(_0x5c57b1['error'](0x1f4,_0x17c4b4[_0xae33('0x13')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x2e08ea){var _0x5ce849=this;return new Promise(function(_0x340b00,_0x3f48b3){return db[_0xae33('0x1a')][_0xae33('0x1b')](_0x2e08ea[_0xae33('0x1c')],{'raw':_0x2e08ea['options']?_0x2e08ea[_0xae33('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e08ea[_0xae33('0x16')]?_0x2e08ea['options']['where']||null:null,'attributes':_0x2e08ea[_0xae33('0x16')]?_0x2e08ea[_0xae33('0x16')][_0xae33('0x1d')]||null:null,'limit':_0x2e08ea[_0xae33('0x16')]?_0x2e08ea[_0xae33('0x16')][_0xae33('0x1e')]||null:null})[_0xae33('0xb')](function(_0x61287a){logger[_0xae33('0xc')](_0xae33('0x1f'),_0x2e08ea);logger[_0xae33('0xe')](_0xae33('0x1f'),_0x2e08ea,JSON[_0xae33('0x10')](_0x61287a));_0x340b00(_0x61287a);})[_0xae33('0x19')](function(_0x595000){logger[_0xae33('0x11')]('UpdateWhatsappQueueReport',_0x595000[_0xae33('0x13')],_0x2e08ea);_0x3f48b3(_0x5ce849[_0xae33('0x11')](0x1f4,_0x595000[_0xae33('0x13')]));});});};
\ No newline at end of file
+var _0xe2a5=['http','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','UpdateWhatsappQueueReport','update','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x13ac10,_0x46e79e){var _0x28eda2=function(_0x169ef0){while(--_0x169ef0){_0x13ac10['push'](_0x13ac10['shift']());}};_0x28eda2(++_0x46e79e);}(_0xe2a5,0x1a9));var _0x5e2a=function(_0x1e2ef5,_0x303786){_0x1e2ef5=_0x1e2ef5-0x0;var _0x5d51d0=_0xe2a5[_0x1e2ef5];return _0x5d51d0;};'use strict';var _=require('lodash');var util=require(_0x5e2a('0x0'));var moment=require(_0x5e2a('0x1'));var BPromise=require(_0x5e2a('0x2'));var rs=require(_0x5e2a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5e2a('0x4'))['db'];var utils=require(_0x5e2a('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x5e2a('0x6'));var jayson=require(_0x5e2a('0x7'));var client=jayson[_0x5e2a('0x8')][_0x5e2a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x501726,_0x5f0633,_0x21f492){return new BPromise(function(_0x185cbe,_0x41efb7){return client['request'](_0x501726,_0x21f492)[_0x5e2a('0xa')](function(_0x4726b4){logger[_0x5e2a('0xb')](_0x5e2a('0xc'),_0x5f0633,_0x5e2a('0xd'));logger[_0x5e2a('0xe')](_0x5e2a('0xf'),_0x5f0633,_0x5e2a('0xd'),JSON[_0x5e2a('0x10')](_0x4726b4));if(_0x4726b4[_0x5e2a('0x11')]){if(_0x4726b4[_0x5e2a('0x11')][_0x5e2a('0x12')]===0x1f4){logger[_0x5e2a('0x11')](_0x5e2a('0xc'),_0x5f0633,_0x4726b4[_0x5e2a('0x11')][_0x5e2a('0x13')]);return _0x41efb7(_0x4726b4[_0x5e2a('0x11')]['message']);}logger[_0x5e2a('0x11')](_0x5e2a('0xc'),_0x5f0633,_0x4726b4[_0x5e2a('0x11')]['message']);return _0x185cbe(_0x4726b4[_0x5e2a('0x11')][_0x5e2a('0x13')]);}else{logger['info'](_0x5e2a('0xc'),_0x5f0633,_0x5e2a('0xd'));_0x185cbe(_0x4726b4[_0x5e2a('0x14')][_0x5e2a('0x13')]);}})[_0x5e2a('0x15')](function(_0x2f113b){logger[_0x5e2a('0x11')](_0x5e2a('0xc'),_0x5f0633,_0x2f113b);_0x41efb7(_0x2f113b);});});}exports[_0x5e2a('0x16')]=function(_0x441553){var _0x1370e9=this;return new Promise(function(_0x5955bf,_0x5c2e4e){return db[_0x5e2a('0x17')][_0x5e2a('0x18')](_0x441553[_0x5e2a('0x19')],{'raw':_0x441553[_0x5e2a('0x1a')]?_0x441553[_0x5e2a('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x8ab975){logger[_0x5e2a('0xb')](_0x5e2a('0x16'),_0x441553);logger[_0x5e2a('0xe')](_0x5e2a('0x16'),_0x441553,JSON[_0x5e2a('0x10')](_0x8ab975));_0x5955bf(_0x8ab975);})[_0x5e2a('0x15')](function(_0x4d437f){logger[_0x5e2a('0x11')](_0x5e2a('0x16'),_0x4d437f['message'],_0x441553);_0x5c2e4e(_0x1370e9[_0x5e2a('0x11')](0x1f4,_0x4d437f['message']));});});};exports[_0x5e2a('0x1b')]=function(_0x1c1d5c){var _0x39c11e=this;return new Promise(function(_0x34e4bf,_0x5afa58){return db[_0x5e2a('0x17')][_0x5e2a('0x1c')](_0x1c1d5c[_0x5e2a('0x19')],{'raw':_0x1c1d5c['options']?_0x1c1d5c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c1d5c[_0x5e2a('0x1a')]?_0x1c1d5c[_0x5e2a('0x1a')]['where']||null:null,'attributes':_0x1c1d5c['options']?_0x1c1d5c['options'][_0x5e2a('0x1d')]||null:null,'limit':_0x1c1d5c[_0x5e2a('0x1a')]?_0x1c1d5c[_0x5e2a('0x1a')][_0x5e2a('0x1e')]||null:null})['then'](function(_0x58b419){logger[_0x5e2a('0xb')](_0x5e2a('0x1b'),_0x1c1d5c);logger[_0x5e2a('0xe')](_0x5e2a('0x1b'),_0x1c1d5c,JSON[_0x5e2a('0x10')](_0x58b419));_0x34e4bf(_0x58b419);})['catch'](function(_0x45bcba){logger[_0x5e2a('0x11')](_0x5e2a('0x1b'),_0x45bcba['message'],_0x1c1d5c);_0x5afa58(_0x39c11e['error'](0x1f4,_0x45bcba[_0x5e2a('0x13')]));});});};
\ No newline at end of file
index 8b1db0a..0032e63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaddd=['fs-extra','../../components/interaction/service','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','delete','exports','util','path','connect-timeout','express'];(function(_0x20187a,_0x2ec206){var _0x9b0290=function(_0x25fc01){while(--_0x25fc01){_0x20187a['push'](_0x20187a['shift']());}};_0x9b0290(++_0x2ec206);}(_0xaddd,0x68));var _0xdadd=function(_0x38fb0d,_0x52b5db){_0x38fb0d=_0x38fb0d-0x0;var _0x30a5d6=_0xaddd[_0x38fb0d];return _0x30a5d6;};'use strict';var multer=require('multer');var util=require(_0xdadd('0x0'));var path=require(_0xdadd('0x1'));var timeout=require(_0xdadd('0x2'));var express=require(_0xdadd('0x3'));var router=express['Router']();var fs_extra=require(_0xdadd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdadd('0x5'));var config=require('../../config/environment');var controller=require(_0xdadd('0x6'));router[_0xdadd('0x7')]('/',auth[_0xdadd('0x8')](),controller[_0xdadd('0x9')]);router[_0xdadd('0x7')](_0xdadd('0xa'),auth['isAuthenticated'](),controller[_0xdadd('0xb')]);router[_0xdadd('0x7')](_0xdadd('0xc'),auth[_0xdadd('0x8')](),controller[_0xdadd('0xd')]);router[_0xdadd('0xe')]('/',auth[_0xdadd('0x8')](),controller[_0xdadd('0xf')]);router['put'](_0xdadd('0xc'),auth[_0xdadd('0x8')](),controller['update']);router[_0xdadd('0x10')](_0xdadd('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xdadd('0x11')]=router;
\ No newline at end of file
+var _0x1326=['isAuthenticated','index','/describe','/:id','show','post','update','delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get'];(function(_0x5e4572,_0x3d9f80){var _0x203a81=function(_0xf90ce8){while(--_0xf90ce8){_0x5e4572['push'](_0x5e4572['shift']());}};_0x203a81(++_0x3d9f80);}(_0x1326,0x1cb));var _0x6132=function(_0x3eee78,_0x5acc63){_0x3eee78=_0x3eee78-0x0;var _0x53a5e5=_0x1326[_0x3eee78];return _0x53a5e5;};'use strict';var multer=require(_0x6132('0x0'));var util=require(_0x6132('0x1'));var path=require('path');var timeout=require(_0x6132('0x2'));var express=require('express');var router=express[_0x6132('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6132('0x4'));var interaction=require(_0x6132('0x5'));var config=require(_0x6132('0x6'));var controller=require(_0x6132('0x7'));router[_0x6132('0x8')]('/',auth[_0x6132('0x9')](),controller[_0x6132('0xa')]);router['get'](_0x6132('0xb'),auth[_0x6132('0x9')](),controller['describe']);router['get'](_0x6132('0xc'),auth[_0x6132('0x9')](),controller[_0x6132('0xd')]);router[_0x6132('0xe')]('/',auth[_0x6132('0x9')](),controller['create']);router['put'](_0x6132('0xc'),auth[_0x6132('0x9')](),controller[_0x6132('0xf')]);router[_0x6132('0x10')](_0x6132('0xc'),auth[_0x6132('0x9')](),controller[_0x6132('0x11')]);module['exports']=router;
\ No newline at end of file
index f650fb5..3a8354a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10b8=['DATE','sequelize','exports','STRING','ENUM','account','agent'];(function(_0x3009c5,_0x42aee3){var _0x2d9d19=function(_0x18e2ad){while(--_0x18e2ad){_0x3009c5['push'](_0x3009c5['shift']());}};_0x2d9d19(++_0x42aee3);}(_0x10b8,0x166));var _0x810b=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x10b8[_0x51020b];return _0x371e47;};'use strict';var Sequelize=require(_0x810b('0x0'));module[_0x810b('0x1')]={'uniqueid':{'type':Sequelize[_0x810b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x810b('0x3')](_0x810b('0x4'),_0x810b('0x5'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x810b('0x6')]}};
\ No newline at end of file
+var _0xbc7a=['agent','queue','DATE','sequelize','exports','STRING','account'];(function(_0x6a186c,_0x4c92e8){var _0x19b2c9=function(_0x52829e){while(--_0x52829e){_0x6a186c['push'](_0x6a186c['shift']());}};_0x19b2c9(++_0x4c92e8);}(_0xbc7a,0xa4));var _0xabc7=function(_0x24e8dc,_0x5a8df7){_0x24e8dc=_0x24e8dc-0x0;var _0x4cef0d=_0xbc7a[_0x24e8dc];return _0x4cef0d;};'use strict';var Sequelize=require(_0xabc7('0x0'));module[_0xabc7('0x1')]={'uniqueid':{'type':Sequelize[_0xabc7('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xabc7('0x3'),_0xabc7('0x4'),_0xabc7('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xabc7('0x6')]}};
\ No newline at end of file
index 66d2f65..ea490cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1c4=['lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','send','WhatsappTransferReport','fieldName','type','key','model','map','name','query','keys','intersection','fields','attributes','length','nolimit','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','catch','show','params','create','body','find','describe','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv'];(function(_0x48043a,_0x2b99c1){var _0x7d92d2=function(_0xe18174){while(--_0xe18174){_0x48043a['push'](_0x48043a['shift']());}};_0x7d92d2(++_0x2b99c1);}(_0xf1c4,0x15b));var _0x4f1c=function(_0x20a1e4,_0x1b727d){_0x20a1e4=_0x20a1e4-0x0;var _0x5a339a=_0xf1c4[_0x20a1e4];return _0x5a339a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4f1c('0x0'));var jsonpatch=require(_0x4f1c('0x1'));var rp=require(_0x4f1c('0x2'));var moment=require('moment');var BPromise=require(_0x4f1c('0x3'));var Mustache=require('mustache');var util=require(_0x4f1c('0x4'));var path=require(_0x4f1c('0x5'));var sox=require(_0x4f1c('0x6'));var csv=require(_0x4f1c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4f1c('0x8'));var squel=require(_0x4f1c('0x9'));var crypto=require(_0x4f1c('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4f1c('0x7'));var querystring=require(_0x4f1c('0xb'));var Papa=require(_0x4f1c('0xc'));var Redis=require(_0x4f1c('0xd'));var authService=require(_0x4f1c('0xe'));var qs=require(_0x4f1c('0xf'));var as=require(_0x4f1c('0x10'));var hardwareService=require(_0x4f1c('0x11'));var logger=require(_0x4f1c('0x12'))(_0x4f1c('0x13'));var utils=require('../../config/utils');var config=require(_0x4f1c('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x4f1c('0x15'))['db'];function respondWithStatusCode(_0x348b1e,_0x48487a){_0x48487a=_0x48487a||0xcc;return function(_0x5120ea){if(_0x5120ea){return _0x348b1e[_0x4f1c('0x16')](_0x48487a);}return _0x348b1e[_0x4f1c('0x17')](_0x48487a)[_0x4f1c('0x18')]();};}function respondWithResult(_0x20688d,_0x1bceac){_0x1bceac=_0x1bceac||0xc8;return function(_0xdf7ab6){if(_0xdf7ab6){return _0x20688d[_0x4f1c('0x17')](_0x1bceac)[_0x4f1c('0x19')](_0xdf7ab6);}};}function respondWithFilteredResult(_0x566a52,_0x5033ee){return function(_0x49721b){if(_0x49721b){var _0x4e5ede=typeof _0x5033ee[_0x4f1c('0x1a')]===_0x4f1c('0x1b')&&typeof _0x5033ee[_0x4f1c('0x1c')]===_0x4f1c('0x1b');var _0xb7287a=_0x49721b['count'];var _0x170532=_0x4e5ede?0x0:_0x5033ee[_0x4f1c('0x1a')];var _0x93c340=_0x4e5ede?_0x49721b[_0x4f1c('0x1d')]:_0x5033ee[_0x4f1c('0x1a')]+_0x5033ee[_0x4f1c('0x1c')];var _0x19e98c;if(_0x93c340>=_0xb7287a){_0x93c340=_0xb7287a;_0x19e98c=0xc8;}else{_0x19e98c=0xce;}_0x566a52[_0x4f1c('0x17')](_0x19e98c);return _0x566a52[_0x4f1c('0x1e')](_0x4f1c('0x1f'),_0x170532+'-'+_0x93c340+'/'+_0xb7287a)['json'](_0x49721b);}return null;};}function patchUpdates(_0x351677){return function(_0x58b714){try{jsonpatch[_0x4f1c('0x20')](_0x58b714,_0x351677,!![]);}catch(_0x250520){return BPromise['reject'](_0x250520);}return _0x58b714[_0x4f1c('0x21')]();};}function saveUpdates(_0x2e9670,_0x4e5863){return function(_0x5edfa7){if(_0x5edfa7){return _0x5edfa7[_0x4f1c('0x22')](_0x2e9670)[_0x4f1c('0x23')](function(_0x360e9c){return _0x360e9c;});}return null;};}function removeEntity(_0x31eebf,_0x5e5b6f){return function(_0x470675){if(_0x470675){return _0x470675[_0x4f1c('0x24')]()[_0x4f1c('0x23')](function(){_0x31eebf[_0x4f1c('0x17')](0xcc)[_0x4f1c('0x18')]();});}};}function handleEntityNotFound(_0x2e5854,_0x28c6d6){return function(_0x3165b7){if(!_0x3165b7){_0x2e5854[_0x4f1c('0x16')](0x194);}return _0x3165b7;};}function handleError(_0x229ee4,_0xa33bad){_0xa33bad=_0xa33bad||0x1f4;return function(_0x17f8dc){logger[_0x4f1c('0x25')](_0x17f8dc[_0x4f1c('0x26')]);if(_0x17f8dc['name']){delete _0x17f8dc['name'];}_0x229ee4['status'](_0xa33bad)[_0x4f1c('0x27')](_0x17f8dc);};}exports['index']=function(_0x4c9372,_0x376a8c){var _0x18d278={},_0x2a1b72={},_0x25aa56={'count':0x0,'rows':[]};var _0x51170a=_['map'](db[_0x4f1c('0x28')]['rawAttributes'],function(_0x89a38f){return{'name':_0x89a38f[_0x4f1c('0x29')],'type':_0x89a38f[_0x4f1c('0x2a')][_0x4f1c('0x2b')]};});_0x2a1b72[_0x4f1c('0x2c')]=_[_0x4f1c('0x2d')](_0x51170a,_0x4f1c('0x2e'));_0x2a1b72[_0x4f1c('0x2f')]=_[_0x4f1c('0x30')](_0x4c9372[_0x4f1c('0x2f')]);_0x2a1b72['filters']=_[_0x4f1c('0x31')](_0x2a1b72[_0x4f1c('0x2c')],_0x2a1b72['query']);_0x18d278['attributes']=_[_0x4f1c('0x31')](_0x2a1b72[_0x4f1c('0x2c')],qs[_0x4f1c('0x32')](_0x4c9372[_0x4f1c('0x2f')]['fields']));_0x18d278['attributes']=_0x18d278[_0x4f1c('0x33')][_0x4f1c('0x34')]?_0x18d278['attributes']:_0x2a1b72[_0x4f1c('0x2c')];if(!_0x4c9372[_0x4f1c('0x2f')]['hasOwnProperty'](_0x4f1c('0x35'))){_0x18d278[_0x4f1c('0x1c')]=qs[_0x4f1c('0x1c')](_0x4c9372[_0x4f1c('0x2f')][_0x4f1c('0x1c')]);_0x18d278[_0x4f1c('0x1a')]=qs[_0x4f1c('0x1a')](_0x4c9372[_0x4f1c('0x2f')]['offset']);}_0x18d278['order']=qs['sort'](_0x4c9372[_0x4f1c('0x2f')][_0x4f1c('0x36')]);_0x18d278['where']=qs[_0x4f1c('0x37')](_[_0x4f1c('0x38')](_0x4c9372[_0x4f1c('0x2f')],_0x2a1b72[_0x4f1c('0x37')]),_0x51170a);if(_0x4c9372[_0x4f1c('0x2f')][_0x4f1c('0x39')]){_0x18d278[_0x4f1c('0x3a')]=_['merge'](_0x18d278[_0x4f1c('0x3a')],{'$or':_['map'](_0x51170a,function(_0x14b488){if(_0x14b488['type']!==_0x4f1c('0x3b')){var _0x5cce7c={};_0x5cce7c[_0x14b488[_0x4f1c('0x2e')]]={'$like':'%'+_0x4c9372[_0x4f1c('0x2f')][_0x4f1c('0x39')]+'%'};return _0x5cce7c;}})});}_0x18d278=_[_0x4f1c('0x3c')]({},_0x18d278,_0x4c9372[_0x4f1c('0x3d')]);var _0x16e67b={'where':_0x18d278['where']};return db[_0x4f1c('0x28')][_0x4f1c('0x1d')](_0x16e67b)['then'](function(_0x4674f2){_0x25aa56[_0x4f1c('0x1d')]=_0x4674f2;if(_0x4c9372[_0x4f1c('0x2f')][_0x4f1c('0x3e')]){_0x18d278[_0x4f1c('0x3f')]=[{'all':!![]}];}return db[_0x4f1c('0x28')]['findAll'](_0x18d278);})[_0x4f1c('0x23')](function(_0x1318db){_0x25aa56['rows']=_0x1318db;return _0x25aa56;})[_0x4f1c('0x23')](respondWithFilteredResult(_0x376a8c,_0x18d278))[_0x4f1c('0x40')](handleError(_0x376a8c,null));};exports[_0x4f1c('0x41')]=function(_0x237a22,_0x39c540){var _0x5a13a2={'raw':!![],'where':{'id':_0x237a22[_0x4f1c('0x42')]['id']}},_0x58548d={};_0x58548d[_0x4f1c('0x2c')]=_[_0x4f1c('0x30')](db['WhatsappTransferReport']['rawAttributes']);_0x58548d[_0x4f1c('0x2f')]=_[_0x4f1c('0x30')](_0x237a22[_0x4f1c('0x2f')]);_0x58548d[_0x4f1c('0x37')]=_[_0x4f1c('0x31')](_0x58548d['model'],_0x58548d[_0x4f1c('0x2f')]);_0x5a13a2['attributes']=_[_0x4f1c('0x31')](_0x58548d[_0x4f1c('0x2c')],qs[_0x4f1c('0x32')](_0x237a22[_0x4f1c('0x2f')][_0x4f1c('0x32')]));_0x5a13a2[_0x4f1c('0x33')]=_0x5a13a2['attributes'][_0x4f1c('0x34')]?_0x5a13a2[_0x4f1c('0x33')]:_0x58548d[_0x4f1c('0x2c')];if(_0x237a22[_0x4f1c('0x2f')]['includeAll']){_0x5a13a2['include']=[{'all':!![]}];}_0x5a13a2=_[_0x4f1c('0x3c')]({},_0x5a13a2,_0x237a22[_0x4f1c('0x3d')]);return db[_0x4f1c('0x28')]['find'](_0x5a13a2)['then'](handleEntityNotFound(_0x39c540,null))['then'](respondWithResult(_0x39c540,null))[_0x4f1c('0x40')](handleError(_0x39c540,null));};exports[_0x4f1c('0x43')]=function(_0x4eecc3,_0x285dad){return db[_0x4f1c('0x28')][_0x4f1c('0x43')](_0x4eecc3[_0x4f1c('0x44')],{})[_0x4f1c('0x23')](respondWithResult(_0x285dad,0xc9))[_0x4f1c('0x40')](handleError(_0x285dad,null));};exports[_0x4f1c('0x22')]=function(_0x311050,_0x599bba){if(_0x311050[_0x4f1c('0x44')]['id']){delete _0x311050[_0x4f1c('0x44')]['id'];}return db['WhatsappTransferReport'][_0x4f1c('0x45')]({'where':{'id':_0x311050[_0x4f1c('0x42')]['id']}})[_0x4f1c('0x23')](handleEntityNotFound(_0x599bba,null))[_0x4f1c('0x23')](saveUpdates(_0x311050[_0x4f1c('0x44')],null))[_0x4f1c('0x23')](respondWithResult(_0x599bba,null))[_0x4f1c('0x40')](handleError(_0x599bba,null));};exports[_0x4f1c('0x24')]=function(_0xc3ca89,_0x5eff4b){return db[_0x4f1c('0x28')][_0x4f1c('0x45')]({'where':{'id':_0xc3ca89['params']['id']}})[_0x4f1c('0x23')](handleEntityNotFound(_0x5eff4b,null))['then'](removeEntity(_0x5eff4b,null))[_0x4f1c('0x40')](handleError(_0x5eff4b,null));};exports[_0x4f1c('0x46')]=function(_0x321d2a,_0x5e0321){return db['WhatsappTransferReport']['describe']()[_0x4f1c('0x23')](respondWithResult(_0x5e0321,null))[_0x4f1c('0x40')](handleError(_0x5e0321,null));};
\ No newline at end of file
+var _0x4bb0=['send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','keys','length','include','find','create','body','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','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','sendStatus','error','name'];(function(_0x880009,_0x1a36f4){var _0x541685=function(_0x19f7ea){while(--_0x19f7ea){_0x880009['push'](_0x880009['shift']());}};_0x541685(++_0x1a36f4);}(_0x4bb0,0x73));var _0x04bb=function(_0x100e36,_0x4da225){_0x100e36=_0x100e36-0x0;var _0x1df0c9=_0x4bb0[_0x100e36];return _0x1df0c9;};'use strict';var emlformat=require(_0x04bb('0x0'));var rimraf=require(_0x04bb('0x1'));var zipdir=require(_0x04bb('0x2'));var jsonpatch=require(_0x04bb('0x3'));var rp=require(_0x04bb('0x4'));var moment=require(_0x04bb('0x5'));var BPromise=require(_0x04bb('0x6'));var Mustache=require(_0x04bb('0x7'));var util=require(_0x04bb('0x8'));var path=require(_0x04bb('0x9'));var sox=require(_0x04bb('0xa'));var csv=require('to-csv');var ejs=require(_0x04bb('0xb'));var fs=require('fs');var fs_extra=require(_0x04bb('0xc'));var _=require(_0x04bb('0xd'));var squel=require(_0x04bb('0xe'));var crypto=require(_0x04bb('0xf'));var jsforce=require(_0x04bb('0x10'));var deskjs=require(_0x04bb('0x11'));var toCsv=require(_0x04bb('0x12'));var querystring=require(_0x04bb('0x13'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x04bb('0x14'));var as=require(_0x04bb('0x15'));var hardwareService=require(_0x04bb('0x16'));var logger=require(_0x04bb('0x17'))('api');var utils=require(_0x04bb('0x18'));var config=require(_0x04bb('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x04bb('0x1a'))['db'];function respondWithStatusCode(_0x1a0370,_0x33f38c){_0x33f38c=_0x33f38c||0xcc;return function(_0x2e7c81){if(_0x2e7c81){return _0x1a0370['sendStatus'](_0x33f38c);}return _0x1a0370[_0x04bb('0x1b')](_0x33f38c)[_0x04bb('0x1c')]();};}function respondWithResult(_0x26c986,_0x4e20fb){_0x4e20fb=_0x4e20fb||0xc8;return function(_0x57d3ab){if(_0x57d3ab){return _0x26c986[_0x04bb('0x1b')](_0x4e20fb)[_0x04bb('0x1d')](_0x57d3ab);}};}function respondWithFilteredResult(_0x3ea048,_0xba2415){return function(_0x41be00){if(_0x41be00){var _0x4f2ec7=typeof _0xba2415[_0x04bb('0x1e')]===_0x04bb('0x1f')&&typeof _0xba2415[_0x04bb('0x20')]==='undefined';var _0x4e4be8=_0x41be00[_0x04bb('0x21')];var _0xa1b844=_0x4f2ec7?0x0:_0xba2415['offset'];var _0x3ce992=_0x4f2ec7?_0x41be00[_0x04bb('0x21')]:_0xba2415[_0x04bb('0x1e')]+_0xba2415['limit'];var _0x3db2dc;if(_0x3ce992>=_0x4e4be8){_0x3ce992=_0x4e4be8;_0x3db2dc=0xc8;}else{_0x3db2dc=0xce;}_0x3ea048['status'](_0x3db2dc);return _0x3ea048[_0x04bb('0x22')](_0x04bb('0x23'),_0xa1b844+'-'+_0x3ce992+'/'+_0x4e4be8)['json'](_0x41be00);}return null;};}function patchUpdates(_0x4689a0){return function(_0x44ce75){try{jsonpatch['apply'](_0x44ce75,_0x4689a0,!![]);}catch(_0x4539e4){return BPromise[_0x04bb('0x24')](_0x4539e4);}return _0x44ce75['save']();};}function saveUpdates(_0x38f872,_0x188c74){return function(_0xdd6527){if(_0xdd6527){return _0xdd6527[_0x04bb('0x25')](_0x38f872)['then'](function(_0x116c51){return _0x116c51;});}return null;};}function removeEntity(_0x2043d2,_0x5d960a){return function(_0x21bfc4){if(_0x21bfc4){return _0x21bfc4[_0x04bb('0x26')]()[_0x04bb('0x27')](function(){_0x2043d2['status'](0xcc)[_0x04bb('0x1c')]();});}};}function handleEntityNotFound(_0x83bb7,_0x529228){return function(_0x4dd82c){if(!_0x4dd82c){_0x83bb7[_0x04bb('0x28')](0x194);}return _0x4dd82c;};}function handleError(_0x839022,_0x19845a){_0x19845a=_0x19845a||0x1f4;return function(_0x2f3a14){logger[_0x04bb('0x29')](_0x2f3a14['stack']);if(_0x2f3a14['name']){delete _0x2f3a14[_0x04bb('0x2a')];}_0x839022[_0x04bb('0x1b')](_0x19845a)[_0x04bb('0x2b')](_0x2f3a14);};}exports[_0x04bb('0x2c')]=function(_0x1fe962,_0x3a6100){var _0x58c64f={},_0x5ba7bf={},_0x33b688={'count':0x0,'rows':[]};var _0x5364ea=_[_0x04bb('0x2d')](db[_0x04bb('0x2e')][_0x04bb('0x2f')],function(_0x137f65){return{'name':_0x137f65[_0x04bb('0x30')],'type':_0x137f65[_0x04bb('0x31')][_0x04bb('0x32')]};});_0x5ba7bf[_0x04bb('0x33')]=_['map'](_0x5364ea,_0x04bb('0x2a'));_0x5ba7bf[_0x04bb('0x34')]=_['keys'](_0x1fe962[_0x04bb('0x34')]);_0x5ba7bf[_0x04bb('0x35')]=_[_0x04bb('0x36')](_0x5ba7bf[_0x04bb('0x33')],_0x5ba7bf[_0x04bb('0x34')]);_0x58c64f[_0x04bb('0x37')]=_[_0x04bb('0x36')](_0x5ba7bf[_0x04bb('0x33')],qs[_0x04bb('0x38')](_0x1fe962['query'][_0x04bb('0x38')]));_0x58c64f[_0x04bb('0x37')]=_0x58c64f[_0x04bb('0x37')]['length']?_0x58c64f[_0x04bb('0x37')]:_0x5ba7bf['model'];if(!_0x1fe962[_0x04bb('0x34')][_0x04bb('0x39')](_0x04bb('0x3a'))){_0x58c64f[_0x04bb('0x20')]=qs['limit'](_0x1fe962[_0x04bb('0x34')][_0x04bb('0x20')]);_0x58c64f[_0x04bb('0x1e')]=qs['offset'](_0x1fe962[_0x04bb('0x34')][_0x04bb('0x1e')]);}_0x58c64f[_0x04bb('0x3b')]=qs[_0x04bb('0x3c')](_0x1fe962[_0x04bb('0x34')][_0x04bb('0x3c')]);_0x58c64f['where']=qs[_0x04bb('0x35')](_[_0x04bb('0x3d')](_0x1fe962['query'],_0x5ba7bf[_0x04bb('0x35')]),_0x5364ea);if(_0x1fe962[_0x04bb('0x34')]['filter']){_0x58c64f[_0x04bb('0x3e')]=_[_0x04bb('0x3f')](_0x58c64f[_0x04bb('0x3e')],{'$or':_[_0x04bb('0x2d')](_0x5364ea,function(_0x39bff5){if(_0x39bff5[_0x04bb('0x31')]!==_0x04bb('0x40')){var _0x107566={};_0x107566[_0x39bff5[_0x04bb('0x2a')]]={'$like':'%'+_0x1fe962['query'][_0x04bb('0x41')]+'%'};return _0x107566;}})});}_0x58c64f=_['merge']({},_0x58c64f,_0x1fe962[_0x04bb('0x42')]);var _0x2b6c10={'where':_0x58c64f[_0x04bb('0x3e')]};return db[_0x04bb('0x2e')][_0x04bb('0x21')](_0x2b6c10)[_0x04bb('0x27')](function(_0x15f68e){_0x33b688['count']=_0x15f68e;if(_0x1fe962[_0x04bb('0x34')][_0x04bb('0x43')]){_0x58c64f['include']=[{'all':!![]}];}return db[_0x04bb('0x2e')][_0x04bb('0x44')](_0x58c64f);})[_0x04bb('0x27')](function(_0x517d3e){_0x33b688['rows']=_0x517d3e;return _0x33b688;})['then'](respondWithFilteredResult(_0x3a6100,_0x58c64f))[_0x04bb('0x45')](handleError(_0x3a6100,null));};exports[_0x04bb('0x46')]=function(_0x5a8a30,_0x4a67fc){var _0x5c8947={'raw':!![],'where':{'id':_0x5a8a30[_0x04bb('0x47')]['id']}},_0xc7b774={};_0xc7b774[_0x04bb('0x33')]=_[_0x04bb('0x48')](db['WhatsappTransferReport'][_0x04bb('0x2f')]);_0xc7b774['query']=_[_0x04bb('0x48')](_0x5a8a30[_0x04bb('0x34')]);_0xc7b774['filters']=_['intersection'](_0xc7b774[_0x04bb('0x33')],_0xc7b774[_0x04bb('0x34')]);_0x5c8947[_0x04bb('0x37')]=_[_0x04bb('0x36')](_0xc7b774[_0x04bb('0x33')],qs[_0x04bb('0x38')](_0x5a8a30['query'][_0x04bb('0x38')]));_0x5c8947[_0x04bb('0x37')]=_0x5c8947['attributes'][_0x04bb('0x49')]?_0x5c8947[_0x04bb('0x37')]:_0xc7b774[_0x04bb('0x33')];if(_0x5a8a30['query'][_0x04bb('0x43')]){_0x5c8947[_0x04bb('0x4a')]=[{'all':!![]}];}_0x5c8947=_[_0x04bb('0x3f')]({},_0x5c8947,_0x5a8a30['options']);return db[_0x04bb('0x2e')][_0x04bb('0x4b')](_0x5c8947)[_0x04bb('0x27')](handleEntityNotFound(_0x4a67fc,null))[_0x04bb('0x27')](respondWithResult(_0x4a67fc,null))[_0x04bb('0x45')](handleError(_0x4a67fc,null));};exports['create']=function(_0x2d294b,_0x1380d0){return db[_0x04bb('0x2e')][_0x04bb('0x4c')](_0x2d294b[_0x04bb('0x4d')],{})[_0x04bb('0x27')](respondWithResult(_0x1380d0,0xc9))['catch'](handleError(_0x1380d0,null));};exports[_0x04bb('0x25')]=function(_0x27b773,_0x3cfdf3){if(_0x27b773[_0x04bb('0x4d')]['id']){delete _0x27b773[_0x04bb('0x4d')]['id'];}return db[_0x04bb('0x2e')][_0x04bb('0x4b')]({'where':{'id':_0x27b773[_0x04bb('0x47')]['id']}})[_0x04bb('0x27')](handleEntityNotFound(_0x3cfdf3,null))[_0x04bb('0x27')](saveUpdates(_0x27b773['body'],null))[_0x04bb('0x27')](respondWithResult(_0x3cfdf3,null))[_0x04bb('0x45')](handleError(_0x3cfdf3,null));};exports[_0x04bb('0x26')]=function(_0x982a2a,_0x1bf9b5){return db[_0x04bb('0x2e')][_0x04bb('0x4b')]({'where':{'id':_0x982a2a[_0x04bb('0x47')]['id']}})[_0x04bb('0x27')](handleEntityNotFound(_0x1bf9b5,null))[_0x04bb('0x27')](removeEntity(_0x1bf9b5,null))[_0x04bb('0x45')](handleError(_0x1bf9b5,null));};exports[_0x04bb('0x4e')]=function(_0x119993,_0x16ce77){return db[_0x04bb('0x2e')][_0x04bb('0x4e')]()[_0x04bb('0x27')](respondWithResult(_0x16ce77,null))['catch'](handleError(_0x16ce77,null));};
\ No newline at end of file
index 3e737e3..5733d52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bcd=['util','moment','bluebird','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid'];(function(_0x864484,_0x8d1543){var _0x18d472=function(_0x24b657){while(--_0x24b657){_0x864484['push'](_0x864484['shift']());}};_0x18d472(++_0x8d1543);}(_0x0bcd,0xe7));var _0xd0bc=function(_0x507b0e,_0x60eae8){_0x507b0e=_0x507b0e-0x0;var _0x42c3d1=_0x0bcd[_0x507b0e];return _0x42c3d1;};'use strict';var _=require('lodash');var util=require(_0xd0bc('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xd0bc('0x1'));var BPromise=require(_0xd0bc('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd0bc('0x3'));var rimraf=require(_0xd0bc('0x4'));var config=require(_0xd0bc('0x5'));var attributes=require(_0xd0bc('0x6'));module['exports']=function(_0x34c931,_0x52cac4){return _0x34c931[_0xd0bc('0x7')](_0xd0bc('0x8'),attributes,{'tableName':_0xd0bc('0x9'),'paranoid':![],'indexes':[{'name':_0xd0bc('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x036d=['api','moment','bluebird','request-promise','rimraf','./whatsappTransferReport.attributes','define','WhatsappTransferReport','uniqueid','util'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x036d,0xc7));var _0xd036=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x036d[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0xd036('0x0'));var logger=require('../../config/logger')(_0xd036('0x1'));var moment=require(_0xd036('0x2'));var BPromise=require(_0xd036('0x3'));var rp=require(_0xd036('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd036('0x5'));var config=require('../../config/environment');var attributes=require(_0xd036('0x6'));module['exports']=function(_0x213ee6,_0x947381){return _0x213ee6[_0xd036('0x7')](_0xd036('0x8'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0xd036('0x9'),'fields':[_0xd036('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index 3dab18d..3c2e3c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae2c=['client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4e667e,_0x112720){var _0x454ef3=function(_0x1b22c5){while(--_0x1b22c5){_0x4e667e['push'](_0x4e667e['shift']());}};_0x454ef3(++_0x112720);}(_0xae2c,0x1f0));var _0xcae2=function(_0x5dd163,_0x32da59){_0x5dd163=_0x5dd163-0x0;var _0xc66814=_0xae2c[_0x5dd163];return _0xc66814;};'use strict';var _=require(_0xcae2('0x0'));var util=require(_0xcae2('0x1'));var moment=require(_0xcae2('0x2'));var BPromise=require(_0xcae2('0x3'));var rs=require(_0xcae2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcae2('0x5'));var logger=require(_0xcae2('0x6'))(_0xcae2('0x7'));var config=require(_0xcae2('0x8'));var jayson=require(_0xcae2('0x9'));var client=jayson[_0xcae2('0xa')][_0xcae2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x68b8d9,_0x5127bd,_0x141861){return new BPromise(function(_0x1cee9c,_0x131387){return client[_0xcae2('0xc')](_0x68b8d9,_0x141861)[_0xcae2('0xd')](function(_0x4e0750){logger[_0xcae2('0xe')](_0xcae2('0xf'),_0x5127bd,'request\x20sent');logger[_0xcae2('0x10')](_0xcae2('0x11'),_0x5127bd,'request\x20sent',JSON[_0xcae2('0x12')](_0x4e0750));if(_0x4e0750[_0xcae2('0x13')]){if(_0x4e0750[_0xcae2('0x13')][_0xcae2('0x14')]===0x1f4){logger[_0xcae2('0x13')](_0xcae2('0xf'),_0x5127bd,_0x4e0750['error']['message']);return _0x131387(_0x4e0750[_0xcae2('0x13')][_0xcae2('0x15')]);}logger['error'](_0xcae2('0xf'),_0x5127bd,_0x4e0750[_0xcae2('0x13')][_0xcae2('0x15')]);return _0x1cee9c(_0x4e0750[_0xcae2('0x13')][_0xcae2('0x15')]);}else{logger['info'](_0xcae2('0xf'),_0x5127bd,'request\x20sent');_0x1cee9c(_0x4e0750['result'][_0xcae2('0x15')]);}})[_0xcae2('0x16')](function(_0x367f2d){logger[_0xcae2('0x13')](_0xcae2('0xf'),_0x5127bd,_0x367f2d);_0x131387(_0x367f2d);});});}
\ No newline at end of file
+var _0x6c2b=['code','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x4868c7,_0x3f6ea3){var _0x59b918=function(_0x1e71ed){while(--_0x1e71ed){_0x4868c7['push'](_0x4868c7['shift']());}};_0x59b918(++_0x3f6ea3);}(_0x6c2b,0x1d1));var _0xb6c2=function(_0xf1af27,_0x598bb1){_0xf1af27=_0xf1af27-0x0;var _0x46b274=_0x6c2b[_0xf1af27];return _0x46b274;};'use strict';var _=require(_0xb6c2('0x0'));var util=require('util');var moment=require(_0xb6c2('0x1'));var BPromise=require(_0xb6c2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb6c2('0x3'));var db=require(_0xb6c2('0x4'))['db'];var utils=require(_0xb6c2('0x5'));var logger=require(_0xb6c2('0x6'))(_0xb6c2('0x7'));var config=require(_0xb6c2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb6c2('0x9')][_0xb6c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x457d16,_0x521b79,_0x778126){return new BPromise(function(_0x889ee5,_0xa67698){return client[_0xb6c2('0xb')](_0x457d16,_0x778126)[_0xb6c2('0xc')](function(_0x196efc){logger[_0xb6c2('0xd')](_0xb6c2('0xe'),_0x521b79,_0xb6c2('0xf'));logger[_0xb6c2('0x10')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x521b79,_0xb6c2('0xf'),JSON[_0xb6c2('0x11')](_0x196efc));if(_0x196efc[_0xb6c2('0x12')]){if(_0x196efc[_0xb6c2('0x12')][_0xb6c2('0x13')]===0x1f4){logger[_0xb6c2('0x12')](_0xb6c2('0xe'),_0x521b79,_0x196efc['error'][_0xb6c2('0x14')]);return _0xa67698(_0x196efc['error'][_0xb6c2('0x14')]);}logger['error'](_0xb6c2('0xe'),_0x521b79,_0x196efc[_0xb6c2('0x12')][_0xb6c2('0x14')]);return _0x889ee5(_0x196efc[_0xb6c2('0x12')][_0xb6c2('0x14')]);}else{logger[_0xb6c2('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x521b79,_0xb6c2('0xf'));_0x889ee5(_0x196efc['result']['message']);}})[_0xb6c2('0x15')](function(_0x3caacc){logger[_0xb6c2('0x12')](_0xb6c2('0xe'),_0x521b79,_0x3caacc);_0xa67698(_0x3caacc);});});}
\ No newline at end of file
index 081b3e5..e8059bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x126e=['\x20processes\x20failed\x20at\x20startup:\x20','name','Online\x20apps:','map','online','join','Offline\x20apps:','status','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','then','seedDB','default','listen','info','start','filter','exitCode','number','length'];(function(_0x486c68,_0xbedc08){var _0x460317=function(_0x2108c1){while(--_0x2108c1){_0x486c68['push'](_0x486c68['shift']());}};_0x460317(++_0xbedc08);}(_0x126e,0x108));var _0xe126=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x126e[_0x3ff085];return _0x2b68c3;};'use strict';var _=require('lodash');var db=require(_0xe126('0x0'))['db'];var seedDb=require(_0xe126('0x1'));var checkLicense=require(_0xe126('0x2'));var rpc=require(_0xe126('0x3'));var config=require(_0xe126('0x4'));var logger=require(_0xe126('0x5'))('app');var pm2=require(_0xe126('0x6'));var pm2Config=require(_0xe126('0x7'));var schedule=require(_0xe126('0x8'));var chat=require(_0xe126('0x9'));var whatsapp=require(_0xe126('0xa'));var transcribe=require(_0xe126('0xb'));var provider=require(_0xe126('0xc'));function main(){return db['sequelize'][_0xe126('0xd')]()[_0xe126('0xe')](function(){if(config[_0xe126('0xf')]){return seedDb[_0xe126('0x10')]();}})[_0xe126('0xe')](function(){return checkLicense['default']();})[_0xe126('0xe')](function(){return rpc[_0xe126('0x11')]();})['then'](function(_0xd69bf4){logger[_0xe126('0x12')](_0xd69bf4);return chat['start']();})[_0xe126('0xe')](function(){return whatsapp['start']();})[_0xe126('0xe')](function(){return schedule['start']();})[_0xe126('0xe')](function(){return transcribe[_0xe126('0x13')]();})[_0xe126('0xe')](function(){return provider[_0xe126('0x13')]();})[_0xe126('0xe')](function(_0x1a57c4){logger[_0xe126('0x12')](_0x1a57c4);return pm2['start'](pm2Config);})[_0xe126('0xe')](function(_0x1c02c9){var _0x4d335f=_0x1c02c9[_0xe126('0x14')](function(_0x28d7dd){return typeof _0x28d7dd[_0xe126('0x15')]===_0xe126('0x16')&&_0x28d7dd['exitCode']>=0x0;});if(_0x4d335f[_0xe126('0x17')]>0x0){throw new Error(_0x4d335f[_0xe126('0x17')]+_0xe126('0x18')+_['map'](_0x4d335f,function(_0x2b0baa){return'\x22'+_0x2b0baa['pm2_env'][_0xe126('0x19')]+'\x22';}));}logger[_0xe126('0x12')](_0xe126('0x1a'),_[_0xe126('0x1b')](_[_0xe126('0x14')](_0x1c02c9,{'status':_0xe126('0x1c')}),_0xe126('0x19'))[_0xe126('0x1d')]());logger['info'](_0xe126('0x1e'),_[_0xe126('0x1b')](_[_0xe126('0x14')](_0x1c02c9,function(_0x2e5617){return _0x2e5617[_0xe126('0x1f')]!==_0xe126('0x1c');}),_0xe126('0x19'))[_0xe126('0x1d')]()||'None');console['log'](_0xe126('0x20'));})[_0xe126('0x21')](function(_0x256b05){console['log']('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x256b05);logger['error'](_0xe126('0x22'),_0x256b05);process[_0xe126('0x23')](0x1);});}main();
\ No newline at end of file
+var _0x2427=['./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','seedDB','default','then','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','Online\x20apps:','name','status','online','join','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/license'];(function(_0x28579c,_0x368469){var _0x119cf1=function(_0x667944){while(--_0x667944){_0x28579c['push'](_0x28579c['shift']());}};_0x119cf1(++_0x368469);}(_0x2427,0x165));var _0x7242=function(_0x2837c3,_0x344ca9){_0x2837c3=_0x2837c3-0x0;var _0x31d0c3=_0x2427[_0x2837c3];return _0x31d0c3;};'use strict';var _=require(_0x7242('0x0'));var db=require(_0x7242('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x7242('0x2'));var rpc=require('./rpc');var config=require(_0x7242('0x3'));var logger=require('./config/logger')(_0x7242('0x4'));var pm2=require(_0x7242('0x5'));var pm2Config=require(_0x7242('0x6'));var schedule=require('./config/schedule');var chat=require(_0x7242('0x7'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x7242('0x8'));var provider=require(_0x7242('0x9'));function main(){return db[_0x7242('0xa')][_0x7242('0xb')]()['then'](function(){if(config[_0x7242('0xc')]){return seedDb[_0x7242('0xd')]();}})['then'](function(){return checkLicense[_0x7242('0xd')]();})[_0x7242('0xe')](function(){return rpc[_0x7242('0xf')]();})['then'](function(_0x423018){logger[_0x7242('0x10')](_0x423018);return chat[_0x7242('0x11')]();})[_0x7242('0xe')](function(){return whatsapp['start']();})[_0x7242('0xe')](function(){return schedule[_0x7242('0x11')]();})['then'](function(){return transcribe[_0x7242('0x11')]();})[_0x7242('0xe')](function(){return provider[_0x7242('0x11')]();})['then'](function(_0x4bd60d){logger[_0x7242('0x10')](_0x4bd60d);return pm2['start'](pm2Config);})[_0x7242('0xe')](function(_0x375ca6){var _0x294535=_0x375ca6[_0x7242('0x12')](function(_0x461f20){return typeof _0x461f20[_0x7242('0x13')]===_0x7242('0x14')&&_0x461f20['exitCode']>=0x0;});if(_0x294535[_0x7242('0x15')]>0x0){throw new Error(_0x294535['length']+_0x7242('0x16')+_[_0x7242('0x17')](_0x294535,function(_0x4828a0){return'\x22'+_0x4828a0['pm2_env']['name']+'\x22';}));}logger[_0x7242('0x10')](_0x7242('0x18'),_['map'](_['filter'](_0x375ca6,{'status':'online'}),_0x7242('0x19'))['join']());logger[_0x7242('0x10')]('Offline\x20apps:',_[_0x7242('0x17')](_[_0x7242('0x12')](_0x375ca6,function(_0xb3a27f){return _0xb3a27f[_0x7242('0x1a')]!==_0x7242('0x1b');}),_0x7242('0x19'))[_0x7242('0x1c')]()||'None');console[_0x7242('0x1d')](_0x7242('0x1e'));})[_0x7242('0x1f')](function(_0x546be9){console[_0x7242('0x1d')](_0x7242('0x20'),_0x546be9);logger[_0x7242('0x21')](_0x7242('0x22'),_0x546be9);process[_0x7242('0x23')](0x1);});}main();
\ No newline at end of file
index c7d43b3..ab6f59a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['util','moment','session','role','fullname','name','internal','userpic','voicePause','chatPause','faxPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','interface','userProfileId','privacyEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','params','closed','then','disposition','unmanaged','json','Forbidden.','headers','authorization','startsWith','Basic','User','find','authenticate','pass','status','Wrong\x20credentials.','catch','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','allowedLoginAttempts','blockDuration','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','apiKeyNonce','isNil','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','length','join','promisify','secret','secrets','payload','options','randomBytes','toString','floor','now','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','express-jwt','basic-auth','crypto','bluebird'];(function(_0x2b10d1,_0x183dc0){var _0xf5ea65=function(_0x53a93f){while(--_0x53a93f){_0x2b10d1['push'](_0x2b10d1['shift']());}};_0xf5ea65(++_0x183dc0);}(_0x3e74,0x175));var _0x43e7=function(_0x16f131,_0x442796){_0x16f131=_0x16f131-0x0;var _0x14f1a0=_0x3e74[_0x16f131];return _0x14f1a0;};'use strict';var db=require(_0x43e7('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x43e7('0x1'));var licenseUtil=require(_0x43e7('0x2'));var encryptor=require(_0x43e7('0x3'));var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require(_0x43e7('0x4'));var compose=require('composable-middleware');var basicAuth=require(_0x43e7('0x5'));var crypto=require(_0x43e7('0x6'));var BPromise=require(_0x43e7('0x7'));var util=require(_0x43e7('0x8'));var moment=require(_0x43e7('0x9'));var validateJwt=expressJwt({'secret':config['secrets'][_0x43e7('0xa')]});var userAttributes=['id',_0x43e7('0xb'),_0x43e7('0xc'),_0x43e7('0xd'),_0x43e7('0xe'),'email',_0x43e7('0xf'),'permissions','md5secret',_0x43e7('0x10'),_0x43e7('0x11'),'mailPause',_0x43e7('0x12'),'smsPause',_0x43e7('0x13'),_0x43e7('0x14'),'showWebBar',_0x43e7('0x15'),_0x43e7('0x16'),_0x43e7('0x17'),_0x43e7('0x18'),'passwordResetAt','alias',_0x43e7('0x19'),_0x43e7('0x1a'),_0x43e7('0x1b'),'phoneBarEnableRecording','phoneBarEnableDtmfTone',_0x43e7('0x1c'),_0x43e7('0x1d'),_0x43e7('0x1e'),_0x43e7('0x1f'),'phoneBarRemoteControlPort','hotdesk',_0x43e7('0x20'),_0x43e7('0x21'),_0x43e7('0x22'),'settingsEnabled','wssPort',_0x43e7('0x23'),_0x43e7('0x24'),_0x43e7('0x25'),_0x43e7('0x26'),_0x43e7('0x27'),_0x43e7('0x28'),_0x43e7('0x29'),_0x43e7('0x2a'),_0x43e7('0x2b'),_0x43e7('0x2c'),_0x43e7('0x2d'),_0x43e7('0x2e'),'openchannelAutoanswerDelay',_0x43e7('0x2f'),_0x43e7('0x30'),'whatsappAutoanswer',_0x43e7('0x31')];exports[_0x43e7('0x32')]=function(){return this[_0x43e7('0x33')](!![])[_0x43e7('0x34')](function(_0x4077fb,_0x2f4cb4,_0x54a9e7){if(_0x4077fb[_0x43e7('0x35')]){_0x54a9e7();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x4077fb[_0x43e7('0x36')]['id']},'attributes':['id',_0x43e7('0x37'),'disposition'],'raw':!![]})[_0x43e7('0x38')](function(_0x4ca5cf){if(_0x4ca5cf&&_0x4ca5cf[_0x43e7('0x37')]){return _0x2f4cb4['status'](_0x4ca5cf[_0x43e7('0x39')]===_0x43e7('0x3a')?0x195:0x193)[_0x43e7('0x3b')]({'message':_0x4ca5cf[_0x43e7('0x39')]==='unmanaged'?'Unmanaged.':_0x43e7('0x3c')});}else{_0x54a9e7();}})['catch'](function(_0x2dd5f){_0x54a9e7(_0x2dd5f);});}});};exports[_0x43e7('0x33')]=function isAuthenticated(_0x3565cf){return compose()[_0x43e7('0x34')](function(_0x5087d7,_0x33a1a5,_0x4690a6){var _0x45b675;if(_0x5087d7[_0x43e7('0x3d')][_0x43e7('0x3e')]){if(_[_0x43e7('0x3f')](_0x5087d7[_0x43e7('0x3d')][_0x43e7('0x3e')],_0x43e7('0x40'))){var _0x35dbcd=basicAuth(_0x5087d7);db[_0x43e7('0x41')][_0x43e7('0x42')]({'where':{'name':_0x35dbcd[_0x43e7('0xd')]}})[_0x43e7('0x38')](function(_0x4bdb17){if(!_0x4bdb17||!_0x4bdb17[_0x43e7('0x43')](_0x35dbcd[_0x43e7('0x44')])){return _0x33a1a5[_0x43e7('0x45')](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x46')});}_0x5087d7['user']={'id':_0x4bdb17['id']};_0x4690a6();})[_0x43e7('0x47')](function(_0x49b83d){_0x4690a6(_0x49b83d);});}else if(_[_0x43e7('0x3f')](_0x5087d7[_0x43e7('0x3d')]['authorization'],'Bearer')){validateJwt(_0x5087d7,_0x33a1a5,_0x4690a6);}else{if(_0x3565cf){_0x4690a6();}else{return _0x33a1a5['status'](0x193)[_0x43e7('0x3b')]({'message':_0x43e7('0x48')});}}}else if(_0x5087d7[_0x43e7('0x49')][_0x43e7('0x4a')]){try{var _0x108313={'audience':hardwareConf[_0x43e7('0x4b')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x5087d7['query']['apikey'],_0x108313)['then'](function(_0x4e8e86){return db['User']['find']({'where':{'id':_0x4e8e86[_0x43e7('0x4c')]}})['then'](function(_0x2b4bfd){_0x45b675=_0x2b4bfd;return db[_0x43e7('0x4d')][_0x43e7('0x4e')]({'where':{'id':0x1},'attributes':[_0x43e7('0x4f'),_0x43e7('0x50')],'raw':!![]});})[_0x43e7('0x38')](function(_0x101d45){if(!_0x45b675||!_['isEqual'](_0x45b675['apiKeyNonce'],_0x4e8e86['nonce'])){return _0x33a1a5[_0x43e7('0x45')](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x51')});}if(_0x45b675[_0x43e7('0x52')]){return _0x33a1a5[_0x43e7('0x45')](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x53')});}if(_0x45b675[_0x43e7('0x54')]){if(_0x101d45['blockDuration']>0x0){if(moment(_0x45b675[_0x43e7('0x55')])[_0x43e7('0x56')](_0x101d45['blockDuration'],_0x43e7('0x57'))>moment()){return _0x33a1a5['status'](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x53')});}}else{return _0x33a1a5[_0x43e7('0x45')](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x53')});}}_0x5087d7[_0x43e7('0x35')]={'id':_0x45b675['id']};_0x4690a6();});})['catch'](function(){return _0x33a1a5['status'](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x53')});});}catch(_0x44b6ae){_0x4690a6(_0x44b6ae);}}else if(_0x3565cf){_0x4690a6();}else{return _0x33a1a5[_0x43e7('0x45')](0x193)[_0x43e7('0x3b')]({'message':'Unknown\x20authorization\x20format'});}})[_0x43e7('0x34')](function(_0x4227c4,_0x575439,_0x3628e0){if(_0x4227c4['user']){db[_0x43e7('0x41')]['find']({'where':{'id':_0x4227c4[_0x43e7('0x35')]['id']},'attributes':userAttributes})[_0x43e7('0x38')](function(_0x3a5807){if(!_0x3a5807){return _0x575439[_0x43e7('0x45')](0x194)['json']({'message':'User\x20not\x20found.'});}_0x4227c4[_0x43e7('0x35')]=_0x3a5807;_0x3628e0();})[_0x43e7('0x47')](function(_0xe979b5){_0x3628e0(_0xe979b5);});}else if(_0x3565cf){_0x3628e0();}else{return _0x575439[_0x43e7('0x45')](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x43e7('0x34')](function(_0x57f5d0,_0x2ab022,_0x4b3a59){return licenseUtil['getLicense']()[_0x43e7('0x38')](function(_0x5ee1c5){if(_0x5ee1c5[_0x43e7('0x58')]){_0x4b3a59();}else{return _0x2ab022[_0x43e7('0x45')](0x193)[_0x43e7('0x3b')]({'message':_0x43e7('0x59')});}})['catch'](function(_0x91f1e4){_0x4b3a59(_0x91f1e4);});});};exports[_0x43e7('0x5a')]=function isWebrtcLicence(){return compose()[_0x43e7('0x34')](function(_0x1fd277,_0x296dc8,_0x1efe59){return licenseUtil['getLicense']()['then'](function(_0x3bc9de){if(_0x3bc9de[_0x43e7('0x5b')]){_0x1efe59();}else{return _0x296dc8[_0x43e7('0x45')](0x193)['json']({'message':'Forbidden'});}})['catch'](function(_0x292ded){_0x1efe59(_0x292ded);});});};exports[_0x43e7('0x5c')]=function(_0x52b098,_0x351ca2,_0x47686e){_0x52b098[_0x43e7('0x5c')]=!![];return _0x47686e();};exports['signToken']=function signToken(_0x593155){return signJwt(_0x593155);};exports['setTokenCookie']=function(_0x4de644,_0x214e7e){if(!_0x4de644[_0x43e7('0x35')]){return _0x214e7e['status'](0x194)[_0x43e7('0x3b')]({'message':_0x43e7('0x5d')});}var _0x426bcb={'payload':{'id':_0x4de644[_0x43e7('0x35')]['id'],'role':_0x4de644['user'][_0x43e7('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x426bcb)['then'](function(_0x4bebd4){_0x214e7e[_0x43e7('0x5e')](_0x43e7('0x5f'),_0x4bebd4);_0x214e7e[_0x43e7('0x60')](_0x43e7('0x61'));})[_0x43e7('0x47')](function(_0x2351cf){return _0x214e7e[_0x43e7('0x45')](0x1f4)[_0x43e7('0x62')](_0x2351cf);});};exports[_0x43e7('0x63')]=function(_0x2b5515){if(_['isNil'](_0x2b5515[_0x43e7('0x64')])||_[_0x43e7('0x65')](_0x2b5515['apiKeyIat'])){return null;}else{return createJwt(_0x2b5515);}};exports[_0x43e7('0x66')]=function(_0x4e6f6d){_0x4e6f6d[_0x43e7('0x64')]=generateNonce();_0x4e6f6d[_0x43e7('0x67')]=generateIssuedAt();return createJwt(_0x4e6f6d);};exports[_0x43e7('0x68')]=function(_0x1f561f,_0xfe13fa){var _0x5e5556=_0x1f561f['query'][_0x43e7('0x4a')];if(_0x5e5556){var _0x2ab7ee={'nonce':_0xfe13fa[_0x43e7('0x64')],'iat':_0xfe13fa[_0x43e7('0x67')],'audience':hardwareConf[_0x43e7('0x4b')](),'issuer':hardwareConf[_0x43e7('0x4b')]()};return verifyJwt(_0x5e5556,_0x2ab7ee)[_0x43e7('0x38')](function(){return generateApiKey(_0xfe13fa);});}else{throw{'message':_0x43e7('0x69')};}};exports[_0x43e7('0x6a')]=function(_0x24e758){var _0x312306=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x312306['test'](_0x24e758))throw new db[(_0x43e7('0x6b'))][(_0x43e7('0x6c'))]('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[_0x43e7('0x6d')]=function(_0x220bf2,_0x2d0052,_0x558d54){var _0x5d63c6=encryptor[_0x43e7('0x6e')](_0x2d0052)[_0x43e7('0x6f')](',');for(var _0x4ebdde=0x0;_0x4ebdde<_0x558d54;_0x4ebdde++){if(!_0x5d63c6[_0x4ebdde])break;if(_0x220bf2[_0x43e7('0x70')]()===_0x5d63c6[_0x4ebdde]['toLowerCase']()){var _0x49a6ce=util[_0x43e7('0x71')](_0x43e7('0x72'),_0x558d54);if(_0x558d54===0x1){_0x49a6ce=_0x43e7('0x73');}throw new db[(_0x43e7('0x6b'))][(_0x43e7('0x6c'))](_0x49a6ce);}}return;};exports['updatePasswordsHistory']=function(_0xc3976,_0xdb9fbe){var _0x4d89bd=_0xdb9fbe?encryptor[_0x43e7('0x6e')](_0xdb9fbe)[_0x43e7('0x6f')](','):[];if(_0x4d89bd[_0x43e7('0x74')]===0x5){_0x4d89bd['splice'](-0x1,0x1);}_0x4d89bd['unshift'](_0xc3976);return encryptor['encryptString'](_0x4d89bd[_0x43e7('0x75')](','));};function signJwt(_0x4058ce){var _0x323cf7=BPromise[_0x43e7('0x76')](jwt['sign'],{'context':jwt});var _0x5a50fc=_0x4058ce[_0x43e7('0x77')]||config[_0x43e7('0x78')][_0x43e7('0xa')];return new BPromise(function(_0x5dd349,_0x5ea0db){_0x323cf7(_0x4058ce[_0x43e7('0x79')],_0x5a50fc,_0x4058ce[_0x43e7('0x7a')])[_0x43e7('0x38')](function(_0x2a194d){_0x5dd349(_0x2a194d);})[_0x43e7('0x47')](function(_0xd41e79){_0x5ea0db(_0xd41e79);});});}function verifyJwt(_0x4665db,_0x46748f,_0x406155){var _0x381208=BPromise[_0x43e7('0x76')](jwt['verify'],{'context':jwt});var _0x5f3824=_0x406155||config[_0x43e7('0x78')]['session'];return new BPromise(function(_0x501616,_0x50edb2){_0x381208(_0x4665db,_0x5f3824,_0x46748f)[_0x43e7('0x38')](function(_0xe666b0){_0x501616(_0xe666b0);})['catch'](function(_0xfe5a8d){_0x50edb2(_0xfe5a8d);});});}function generateNonce(){return crypto[_0x43e7('0x7b')](0x10)[_0x43e7('0x7c')]('hex');}function generateIssuedAt(){return Math[_0x43e7('0x7d')](Date[_0x43e7('0x7e')]()/0x3e8)[_0x43e7('0x7c')]();}function createJwt(_0xc9723){var _0x2f43d7={'payload':{'iat':_0xc9723[_0x43e7('0x67')],'nonce':_0xc9723[_0x43e7('0x64')]},'options':{'algorithm':'HS512','subject':_0xc9723['id'][_0x43e7('0x7c')](),'issuer':hardwareConf[_0x43e7('0x4b')](),'audience':hardwareConf[_0x43e7('0x4b')]()}};return signJwt(_0x2f43d7)['then'](function(_0x56b06d){return{'iat':_0xc9723[_0x43e7('0x67')],'nonce':_0xc9723['apiKeyNonce'],'token':_0x56b06d};});}
\ No newline at end of file
+var _0x3e74=['util','moment','session','role','fullname','name','internal','userpic','voicePause','chatPause','faxPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','interface','userProfileId','privacyEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','params','closed','then','disposition','unmanaged','json','Forbidden.','headers','authorization','startsWith','Basic','User','find','authenticate','pass','status','Wrong\x20credentials.','catch','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','allowedLoginAttempts','blockDuration','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','apiKeyNonce','isNil','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','length','join','promisify','secret','secrets','payload','options','randomBytes','toString','floor','now','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','express-jwt','basic-auth','crypto','bluebird'];(function(_0x522059,_0x1e2395){var _0x497e2e=function(_0x1ca1a0){while(--_0x1ca1a0){_0x522059['push'](_0x522059['shift']());}};_0x497e2e(++_0x1e2395);}(_0x3e74,0x175));var _0x43e7=function(_0x514381,_0x55ffbf){_0x514381=_0x514381-0x0;var _0x5c6fb7=_0x3e74[_0x514381];return _0x5c6fb7;};'use strict';var db=require(_0x43e7('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x43e7('0x1'));var licenseUtil=require(_0x43e7('0x2'));var encryptor=require(_0x43e7('0x3'));var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require(_0x43e7('0x4'));var compose=require('composable-middleware');var basicAuth=require(_0x43e7('0x5'));var crypto=require(_0x43e7('0x6'));var BPromise=require(_0x43e7('0x7'));var util=require(_0x43e7('0x8'));var moment=require(_0x43e7('0x9'));var validateJwt=expressJwt({'secret':config['secrets'][_0x43e7('0xa')]});var userAttributes=['id',_0x43e7('0xb'),_0x43e7('0xc'),_0x43e7('0xd'),_0x43e7('0xe'),'email',_0x43e7('0xf'),'permissions','md5secret',_0x43e7('0x10'),_0x43e7('0x11'),'mailPause',_0x43e7('0x12'),'smsPause',_0x43e7('0x13'),_0x43e7('0x14'),'showWebBar',_0x43e7('0x15'),_0x43e7('0x16'),_0x43e7('0x17'),_0x43e7('0x18'),'passwordResetAt','alias',_0x43e7('0x19'),_0x43e7('0x1a'),_0x43e7('0x1b'),'phoneBarEnableRecording','phoneBarEnableDtmfTone',_0x43e7('0x1c'),_0x43e7('0x1d'),_0x43e7('0x1e'),_0x43e7('0x1f'),'phoneBarRemoteControlPort','hotdesk',_0x43e7('0x20'),_0x43e7('0x21'),_0x43e7('0x22'),'settingsEnabled','wssPort',_0x43e7('0x23'),_0x43e7('0x24'),_0x43e7('0x25'),_0x43e7('0x26'),_0x43e7('0x27'),_0x43e7('0x28'),_0x43e7('0x29'),_0x43e7('0x2a'),_0x43e7('0x2b'),_0x43e7('0x2c'),_0x43e7('0x2d'),_0x43e7('0x2e'),'openchannelAutoanswerDelay',_0x43e7('0x2f'),_0x43e7('0x30'),'whatsappAutoanswer',_0x43e7('0x31')];exports[_0x43e7('0x32')]=function(){return this[_0x43e7('0x33')](!![])[_0x43e7('0x34')](function(_0x4077fb,_0x2f4cb4,_0x54a9e7){if(_0x4077fb[_0x43e7('0x35')]){_0x54a9e7();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x4077fb[_0x43e7('0x36')]['id']},'attributes':['id',_0x43e7('0x37'),'disposition'],'raw':!![]})[_0x43e7('0x38')](function(_0x4ca5cf){if(_0x4ca5cf&&_0x4ca5cf[_0x43e7('0x37')]){return _0x2f4cb4['status'](_0x4ca5cf[_0x43e7('0x39')]===_0x43e7('0x3a')?0x195:0x193)[_0x43e7('0x3b')]({'message':_0x4ca5cf[_0x43e7('0x39')]==='unmanaged'?'Unmanaged.':_0x43e7('0x3c')});}else{_0x54a9e7();}})['catch'](function(_0x2dd5f){_0x54a9e7(_0x2dd5f);});}});};exports[_0x43e7('0x33')]=function isAuthenticated(_0x3565cf){return compose()[_0x43e7('0x34')](function(_0x5087d7,_0x33a1a5,_0x4690a6){var _0x45b675;if(_0x5087d7[_0x43e7('0x3d')][_0x43e7('0x3e')]){if(_[_0x43e7('0x3f')](_0x5087d7[_0x43e7('0x3d')][_0x43e7('0x3e')],_0x43e7('0x40'))){var _0x35dbcd=basicAuth(_0x5087d7);db[_0x43e7('0x41')][_0x43e7('0x42')]({'where':{'name':_0x35dbcd[_0x43e7('0xd')]}})[_0x43e7('0x38')](function(_0x4bdb17){if(!_0x4bdb17||!_0x4bdb17[_0x43e7('0x43')](_0x35dbcd[_0x43e7('0x44')])){return _0x33a1a5[_0x43e7('0x45')](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x46')});}_0x5087d7['user']={'id':_0x4bdb17['id']};_0x4690a6();})[_0x43e7('0x47')](function(_0x49b83d){_0x4690a6(_0x49b83d);});}else if(_[_0x43e7('0x3f')](_0x5087d7[_0x43e7('0x3d')]['authorization'],'Bearer')){validateJwt(_0x5087d7,_0x33a1a5,_0x4690a6);}else{if(_0x3565cf){_0x4690a6();}else{return _0x33a1a5['status'](0x193)[_0x43e7('0x3b')]({'message':_0x43e7('0x48')});}}}else if(_0x5087d7[_0x43e7('0x49')][_0x43e7('0x4a')]){try{var _0x108313={'audience':hardwareConf[_0x43e7('0x4b')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x5087d7['query']['apikey'],_0x108313)['then'](function(_0x4e8e86){return db['User']['find']({'where':{'id':_0x4e8e86[_0x43e7('0x4c')]}})['then'](function(_0x2b4bfd){_0x45b675=_0x2b4bfd;return db[_0x43e7('0x4d')][_0x43e7('0x4e')]({'where':{'id':0x1},'attributes':[_0x43e7('0x4f'),_0x43e7('0x50')],'raw':!![]});})[_0x43e7('0x38')](function(_0x101d45){if(!_0x45b675||!_['isEqual'](_0x45b675['apiKeyNonce'],_0x4e8e86['nonce'])){return _0x33a1a5[_0x43e7('0x45')](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x51')});}if(_0x45b675[_0x43e7('0x52')]){return _0x33a1a5[_0x43e7('0x45')](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x53')});}if(_0x45b675[_0x43e7('0x54')]){if(_0x101d45['blockDuration']>0x0){if(moment(_0x45b675[_0x43e7('0x55')])[_0x43e7('0x56')](_0x101d45['blockDuration'],_0x43e7('0x57'))>moment()){return _0x33a1a5['status'](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x53')});}}else{return _0x33a1a5[_0x43e7('0x45')](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x53')});}}_0x5087d7[_0x43e7('0x35')]={'id':_0x45b675['id']};_0x4690a6();});})['catch'](function(){return _0x33a1a5['status'](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x53')});});}catch(_0x44b6ae){_0x4690a6(_0x44b6ae);}}else if(_0x3565cf){_0x4690a6();}else{return _0x33a1a5[_0x43e7('0x45')](0x193)[_0x43e7('0x3b')]({'message':'Unknown\x20authorization\x20format'});}})[_0x43e7('0x34')](function(_0x4227c4,_0x575439,_0x3628e0){if(_0x4227c4['user']){db[_0x43e7('0x41')]['find']({'where':{'id':_0x4227c4[_0x43e7('0x35')]['id']},'attributes':userAttributes})[_0x43e7('0x38')](function(_0x3a5807){if(!_0x3a5807){return _0x575439[_0x43e7('0x45')](0x194)['json']({'message':'User\x20not\x20found.'});}_0x4227c4[_0x43e7('0x35')]=_0x3a5807;_0x3628e0();})[_0x43e7('0x47')](function(_0xe979b5){_0x3628e0(_0xe979b5);});}else if(_0x3565cf){_0x3628e0();}else{return _0x575439[_0x43e7('0x45')](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x43e7('0x34')](function(_0x57f5d0,_0x2ab022,_0x4b3a59){return licenseUtil['getLicense']()[_0x43e7('0x38')](function(_0x5ee1c5){if(_0x5ee1c5[_0x43e7('0x58')]){_0x4b3a59();}else{return _0x2ab022[_0x43e7('0x45')](0x193)[_0x43e7('0x3b')]({'message':_0x43e7('0x59')});}})['catch'](function(_0x91f1e4){_0x4b3a59(_0x91f1e4);});});};exports[_0x43e7('0x5a')]=function isWebrtcLicence(){return compose()[_0x43e7('0x34')](function(_0x1fd277,_0x296dc8,_0x1efe59){return licenseUtil['getLicense']()['then'](function(_0x3bc9de){if(_0x3bc9de[_0x43e7('0x5b')]){_0x1efe59();}else{return _0x296dc8[_0x43e7('0x45')](0x193)['json']({'message':'Forbidden'});}})['catch'](function(_0x292ded){_0x1efe59(_0x292ded);});});};exports[_0x43e7('0x5c')]=function(_0x52b098,_0x351ca2,_0x47686e){_0x52b098[_0x43e7('0x5c')]=!![];return _0x47686e();};exports['signToken']=function signToken(_0x593155){return signJwt(_0x593155);};exports['setTokenCookie']=function(_0x4de644,_0x214e7e){if(!_0x4de644[_0x43e7('0x35')]){return _0x214e7e['status'](0x194)[_0x43e7('0x3b')]({'message':_0x43e7('0x5d')});}var _0x426bcb={'payload':{'id':_0x4de644[_0x43e7('0x35')]['id'],'role':_0x4de644['user'][_0x43e7('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x426bcb)['then'](function(_0x4bebd4){_0x214e7e[_0x43e7('0x5e')](_0x43e7('0x5f'),_0x4bebd4);_0x214e7e[_0x43e7('0x60')](_0x43e7('0x61'));})[_0x43e7('0x47')](function(_0x2351cf){return _0x214e7e[_0x43e7('0x45')](0x1f4)[_0x43e7('0x62')](_0x2351cf);});};exports[_0x43e7('0x63')]=function(_0x2b5515){if(_['isNil'](_0x2b5515[_0x43e7('0x64')])||_[_0x43e7('0x65')](_0x2b5515['apiKeyIat'])){return null;}else{return createJwt(_0x2b5515);}};exports[_0x43e7('0x66')]=function(_0x4e6f6d){_0x4e6f6d[_0x43e7('0x64')]=generateNonce();_0x4e6f6d[_0x43e7('0x67')]=generateIssuedAt();return createJwt(_0x4e6f6d);};exports[_0x43e7('0x68')]=function(_0x1f561f,_0xfe13fa){var _0x5e5556=_0x1f561f['query'][_0x43e7('0x4a')];if(_0x5e5556){var _0x2ab7ee={'nonce':_0xfe13fa[_0x43e7('0x64')],'iat':_0xfe13fa[_0x43e7('0x67')],'audience':hardwareConf[_0x43e7('0x4b')](),'issuer':hardwareConf[_0x43e7('0x4b')]()};return verifyJwt(_0x5e5556,_0x2ab7ee)[_0x43e7('0x38')](function(){return generateApiKey(_0xfe13fa);});}else{throw{'message':_0x43e7('0x69')};}};exports[_0x43e7('0x6a')]=function(_0x24e758){var _0x312306=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x312306['test'](_0x24e758))throw new db[(_0x43e7('0x6b'))][(_0x43e7('0x6c'))]('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[_0x43e7('0x6d')]=function(_0x220bf2,_0x2d0052,_0x558d54){var _0x5d63c6=encryptor[_0x43e7('0x6e')](_0x2d0052)[_0x43e7('0x6f')](',');for(var _0x4ebdde=0x0;_0x4ebdde<_0x558d54;_0x4ebdde++){if(!_0x5d63c6[_0x4ebdde])break;if(_0x220bf2[_0x43e7('0x70')]()===_0x5d63c6[_0x4ebdde]['toLowerCase']()){var _0x49a6ce=util[_0x43e7('0x71')](_0x43e7('0x72'),_0x558d54);if(_0x558d54===0x1){_0x49a6ce=_0x43e7('0x73');}throw new db[(_0x43e7('0x6b'))][(_0x43e7('0x6c'))](_0x49a6ce);}}return;};exports['updatePasswordsHistory']=function(_0xc3976,_0xdb9fbe){var _0x4d89bd=_0xdb9fbe?encryptor[_0x43e7('0x6e')](_0xdb9fbe)[_0x43e7('0x6f')](','):[];if(_0x4d89bd[_0x43e7('0x74')]===0x5){_0x4d89bd['splice'](-0x1,0x1);}_0x4d89bd['unshift'](_0xc3976);return encryptor['encryptString'](_0x4d89bd[_0x43e7('0x75')](','));};function signJwt(_0x4058ce){var _0x323cf7=BPromise[_0x43e7('0x76')](jwt['sign'],{'context':jwt});var _0x5a50fc=_0x4058ce[_0x43e7('0x77')]||config[_0x43e7('0x78')][_0x43e7('0xa')];return new BPromise(function(_0x5dd349,_0x5ea0db){_0x323cf7(_0x4058ce[_0x43e7('0x79')],_0x5a50fc,_0x4058ce[_0x43e7('0x7a')])[_0x43e7('0x38')](function(_0x2a194d){_0x5dd349(_0x2a194d);})[_0x43e7('0x47')](function(_0xd41e79){_0x5ea0db(_0xd41e79);});});}function verifyJwt(_0x4665db,_0x46748f,_0x406155){var _0x381208=BPromise[_0x43e7('0x76')](jwt['verify'],{'context':jwt});var _0x5f3824=_0x406155||config[_0x43e7('0x78')]['session'];return new BPromise(function(_0x501616,_0x50edb2){_0x381208(_0x4665db,_0x5f3824,_0x46748f)[_0x43e7('0x38')](function(_0xe666b0){_0x501616(_0xe666b0);})['catch'](function(_0xfe5a8d){_0x50edb2(_0xfe5a8d);});});}function generateNonce(){return crypto[_0x43e7('0x7b')](0x10)[_0x43e7('0x7c')]('hex');}function generateIssuedAt(){return Math[_0x43e7('0x7d')](Date[_0x43e7('0x7e')]()/0x3e8)[_0x43e7('0x7c')]();}function createJwt(_0xc9723){var _0x2f43d7={'payload':{'iat':_0xc9723[_0x43e7('0x67')],'nonce':_0xc9723[_0x43e7('0x64')]},'options':{'algorithm':'HS512','subject':_0xc9723['id'][_0x43e7('0x7c')](),'issuer':hardwareConf[_0x43e7('0x4b')](),'audience':hardwareConf[_0x43e7('0x4b')]()}};return signJwt(_0x2f43d7)['then'](function(_0x56b06d){return{'iat':_0xc9723[_0x43e7('0x67')],'nonce':_0xc9723['apiKeyNonce'],'token':_0x56b06d};});}
\ No newline at end of file
index af1d781..68ba522 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(_0x444f0a,_0x14e245){var _0x420ccb=function(_0x517867){while(--_0x517867){_0x444f0a['push'](_0x444f0a['shift']());}};_0x420ccb(++_0x14e245);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x5f66[_0x4154a6];return _0x3b2786;};'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 _0x2032=['map','findOne','slice','all','length','fieldType','type','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','where','user','ids','tag','countFilteredContacts','count','buildContactsQuery','clause','getFilteredContacts','rows','describe','CmContact','filter','startsWith','cf_'];(function(_0x52c382,_0xbe24b4){var _0x45e0a6=function(_0x2806df){while(--_0x2806df){_0x52c382['push'](_0x52c382['shift']());}};_0x45e0a6(++_0xbe24b4);}(_0x2032,0xd9));var _0x2203=function(_0xb3a2,_0x4c93b9){_0xb3a2=_0xb3a2-0x0;var _0x230a66=_0x2032[_0xb3a2];return _0x230a66;};'use strict';var _=require('lodash');var sqlUtils=require(_0x2203('0x0'));var db=require(_0x2203('0x1'))['db'];exports[_0x2203('0x2')]=function(_0x4c28da,_0x486390,_0x228a29,_0x4b4c7f){var _0x46c49a={'count':0x0,'rows':[]};var _0x880dcd=sqlUtils[_0x2203('0x3')](_0x486390,_0x4c28da);if(_0x880dcd){return Promise[_0x2203('0x4')](_0x46c49a);}var _0x3f7ba1=sqlUtils[_0x2203('0x5')]();var _0x2e0f63={};var _0x2676aa=![];var _0x18c4d6=![];return Promise[_0x2203('0x4')]()[_0x2203('0x6')](function(){if(_0x4c28da['search']){return sqlUtils['parseAdvancedSearchFilter'](_0x4c28da[_0x2203('0x7')],_0x4b4c7f);}else{return sqlUtils['parseQueryParameters'](_0x4c28da,_0x4b4c7f);}})[_0x2203('0x6')](function(_0x2972f3){_0x3f7ba1[_0x2203('0x8')](_0x2972f3['default']);_0x3f7ba1[_0x2203('0x8')](_0x2972f3['fields']);_0x3f7ba1[_0x2203('0x8')](_0x2972f3['filter']);_0x3f7ba1[_0x2203('0x8')](_0x2972f3[_0x2203('0x9')]['clause']);_0x2e0f63=_0x2972f3['tags'];_0x18c4d6=_0x2972f3['user']['skip'];return sqlUtils['checkListsRestrictions'](_0x486390,_0x4c28da,_0x18c4d6);})[_0x2203('0x6')](function(_0x538b30){_0x3f7ba1['where'](_0x538b30);var _0x21a3af=_0x4c28da[_0x2203('0x7')]?_0x2e0f63[_0x2203('0xa')]:_0x4c28da[_0x2203('0xb')];_0x2676aa=_0x21a3af?!![]:![];return sqlUtils[_0x2203('0xc')](_0x3f7ba1,_0x21a3af);})[_0x2203('0x6')](function(_0x2c36e6){_0x46c49a[_0x2203('0xd')]=_0x2c36e6;if(_0x46c49a[_0x2203('0xd')]===0x0){return;}return sqlUtils[_0x2203('0xe')](_0x3f7ba1,_0x4c28da['fields'],_0x228a29,_0x2676aa,_0x2e0f63[_0x2203('0xf')],_0x18c4d6);})[_0x2203('0x6')](function(_0x4893ff){if(!_0x4893ff){return[];}return sqlUtils[_0x2203('0x10')](_0x4893ff,_0x4c28da,_0x228a29);})[_0x2203('0x6')](function(_0x4aeb9f){_0x46c49a[_0x2203('0x11')]=_0x4aeb9f;return _0x46c49a;})['catch'](function(_0x2904ba){throw _0x2904ba;});};exports[_0x2203('0x12')]=function(){var _0x3c8c34={};var _0x3b4034=[];return db[_0x2203('0x13')][_0x2203('0x12')]()['then'](function(_0x13d3f7){_0x3c8c34=_0x13d3f7;var _0x50822b=Object['keys'](_0x3c8c34)[_0x2203('0x14')](function(_0x496d82){return _[_0x2203('0x15')](_0x496d82,_0x2203('0x16'))?_0x496d82:undefined;});var _0x5d4c4e=_0x50822b[_0x2203('0x17')](function(_0x5e29cd){return db['CmCustomField'][_0x2203('0x18')]({'where':{'id':_0x5e29cd[_0x2203('0x19')](0x3)},'raw':!![]});});return Promise[_0x2203('0x1a')](_0x5d4c4e);})[_0x2203('0x6')](function(_0x1244f4){for(var _0x3114ef=0x0;_0x3114ef<_0x1244f4[_0x2203('0x1b')];_0x3114ef++){if(_0x1244f4[_0x3114ef]){var _0x250349='cf_'+_0x1244f4[_0x3114ef]['id'];_0x3c8c34[_0x250349][_0x2203('0x1c')]=_0x1244f4[_0x3114ef][_0x2203('0x1d')];}}_0x3b4034=_[_0x2203('0x17')](Object['keys'](_0x3c8c34),function(_0xb2071b){return{'name':_0xb2071b,'type':_0x3c8c34[_0xb2071b][_0x2203('0x1d')]};});return _0x3b4034;})['catch'](function(_0xd6e109){throw _0xd6e109;});};
\ No newline at end of file
index f2470fa..5e280ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf98b=['having','order','subqry.','findAll','color','keyBy','Sequelize','SELECT','CmContact','sequelize','query','toString','Tags','clone','c.id','isEmpty','t.id\x20IN\x20?','QueryTypes','COUNT(*)','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','search','ListId','autocomplete','true','select','from','cm_contacts','c.deletedAt\x20IS\x20NULL','subqry','left_join','uc.CmContactId\x20=\x20','.id','tools_tags','firstName','lastName','mobile','fax','email','createdAt','updatedAt','deletedAt','includes','forEach','TagIds','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','length','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','dateOfBirth','datetime','castTo','DATE','type','start','value','end','Tag','split','map','tags','clause','and','ids','User','user','uc.UserId\x20=\x20?','keys','some','compact','Contact','push','c.ListId\x20IN\x20?','concat','\x20=\x20?','resolve','then','tag','filter','getLists','attributes','group','limit','offset','subqry.id'];(function(_0x2fdfcf,_0x3497fa){var _0x7eb4f7=function(_0x38eb80){while(--_0x38eb80){_0x2fdfcf['push'](_0x2fdfcf['shift']());}};_0x7eb4f7(++_0x3497fa);}(_0xf98b,0x155));var _0xbf98=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xf98b[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0xbf98('0x0'));var squel=require(_0xbf98('0x1'));var as=require(_0xbf98('0x2'));var qs=require(_0xbf98('0x3'));var utils=require(_0xbf98('0x4'));var db=require(_0xbf98('0x5'))['db'];function skipContactsQuery(_0x3c465f,_0x35ffec){var _0x5757e3=![];if(_0x3c465f[_0xbf98('0x6')]==='agent'&&!_0x35ffec[_0xbf98('0x7')]&&!_0x35ffec[_0xbf98('0x8')]&&_0x35ffec[_0xbf98('0x9')]!==_0xbf98('0xa')){_0x5757e3=!![];}return _0x5757e3;}function getContactsSubquery(){return squel[_0xbf98('0xb')]()[_0xbf98('0xc')](_0xbf98('0xd'),'c')['where'](_0xbf98('0xe'));}function applyJoinClauses(_0x5135e3,_0x464479){var _0x4caec8=_0x464479?'c':_0xbf98('0xf');_0x5135e3[_0xbf98('0x10')]('cm_user_has_contacts','uc',_0xbf98('0x11')+_0x4caec8+_0xbf98('0x12'))[_0xbf98('0x10')]('cm_contact_has_tags','ct','ct.CmContactId\x20=\x20'+_0x4caec8+_0xbf98('0x12'))[_0xbf98('0x10')](_0xbf98('0x13'),'t','t.id\x20=\x20ct.TagId');return _0x5135e3;}function addFieldsToQuery(_0x331e24,_0x987f1c,_0x34a361,_0x4e33f8,_0x132e08){var _0x22560e=_0x132e08?'c':_0xbf98('0xf');if(!_0x987f1c){_0x987f1c=['id',_0xbf98('0x14'),_0xbf98('0x15'),'phone',_0xbf98('0x16'),_0xbf98('0x17'),_0xbf98('0x18'),_0xbf98('0x8'),'CompanyId',_0xbf98('0x19'),_0xbf98('0x1a'),_0xbf98('0x1b'),'TagIds'];}else if(!_0x987f1c[_0xbf98('0x1c')]('id')){_0x987f1c['push']('id');}var _0x9db5f8=_0x34a361&&_0x132e08||!_0x34a361&&!_0x132e08;if(_0x4e33f8){_0x9db5f8=_0x4e33f8&&_0x132e08||!_0x4e33f8&&!_0x132e08;}_0x987f1c[_0xbf98('0x1d')](function(_0x1b0c04){if(_0x1b0c04===_0xbf98('0x1e')){if(_0x9db5f8){_0x331e24['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x1b0c04);}else if(_0x34a361||_0x4e33f8){_0x331e24[_0xbf98('0x1f')](_0x22560e+'.'+_0x1b0c04);}}else{_0x331e24[_0xbf98('0x1f')](_0x22560e+'.'+_0x1b0c04);}});return _0x331e24;}function getSqlClauses(){var _0x5b1551={'default':squel['expr'](),'fields':squel[_0xbf98('0x20')](),'filter':squel[_0xbf98('0x20')](),'tags':{'clause':squel[_0xbf98('0x20')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x5b1551;}function parseTagParameter(_0x553950){var _0x5a0963=squel[_0xbf98('0x20')]();if(_0x553950){var _0x3493a5=utils[_0xbf98('0x21')](_0x553950);_0x3493a5['forEach'](function(_0x1ddf21){_0x5a0963['or'](_0xbf98('0x22'),'%,'+_0x1ddf21+',%');});}return _0x5a0963;}function parseSearchFilter(_0x1376b1){var _0x2ee57d=squel['expr']();if(_0x1376b1){var _0x49c3f7=_0x1376b1[_0xbf98('0x23')]('\x5c','\x5c\x5c')[_0xbf98('0x23')](/'/g,'\x27\x27');if(_0x49c3f7['split']('\x20')[_0xbf98('0x24')]>0x1){_0x2ee57d['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xbf98('0x25')](_0x49c3f7),null);}else{if(qs[_0xbf98('0x26')](_0x49c3f7)){_0x2ee57d['or'](_0xbf98('0x27'),_0x49c3f7+'%');_0x2ee57d['or'](_0xbf98('0x28'),_0x49c3f7+'%');_0x2ee57d['or']('c.mobile\x20LIKE\x20?',_0x49c3f7+'%');_0x2ee57d['or'](_0xbf98('0x29'),_0x49c3f7+'%');}else if(qs[_0xbf98('0x2a')](_0x49c3f7)){_0x2ee57d['or'](_0xbf98('0x2b'),_0x49c3f7+'%');}else{_0x2ee57d['or'](_0xbf98('0x2c'),'%'+_0x49c3f7+'%');_0x2ee57d['or'](_0xbf98('0x2d'),'%'+_0x49c3f7+'%');_0x2ee57d['or'](_0xbf98('0x2b'),'%'+_0x49c3f7+'%');}}}return _0x2ee57d;}function parseAdvancedSearchFilter(_0x427f1f,_0x5e576e){var _0x211d41=getSqlClauses();var _0x102785=as[_0xbf98('0x2e')](_0x427f1f);var _0x393f73=_0x102785[_0xbf98('0x2f')];for(var _0xcca9e2=0x0;_0xcca9e2<_0x102785[_0xbf98('0x30')][_0xbf98('0x24')];_0xcca9e2++){var _0x5633ec=_0x102785[_0xbf98('0x30')][_0xcca9e2];var _0x55f446='c';var _0x473fbd=_[_0xbf98('0x31')](_0x5e576e,[_0xbf98('0x32'),_0x5633ec[_0xbf98('0x1f')]]);if(_0x473fbd){if(_0x5633ec['field']===_0xbf98('0x33')||_0x473fbd['fieldType']===_0xbf98('0x34')){_0x5633ec[_0xbf98('0x35')]=_0xbf98('0x36');}var _0x2c1621=as['buildExpression'](_0x55f446,_0x473fbd[_0xbf98('0x37')],_0x5633ec);_0x211d41['default'][_0x393f73](_0x2c1621['text'],_0x2c1621['value'][_0xbf98('0x38')],_0x2c1621[_0xbf98('0x39')][_0xbf98('0x3a')]);}else{if(_0x5633ec[_0xbf98('0x1f')]===_0xbf98('0x3b')){var _0x3b27e3=_0x5633ec[_0xbf98('0x39')][_0xbf98('0x3c')](',')[_0xbf98('0x3d')](function(_0x15c35a){return Number(_0x15c35a);});var _0x23d451=parseTagParameter(_0x3b27e3);_0x211d41[_0xbf98('0x3e')][_0xbf98('0x3f')][_0xbf98('0x40')](_0x23d451);_0x211d41[_0xbf98('0x3e')][_0xbf98('0x41')]=_0x3b27e3;}else if(_0x5633ec[_0xbf98('0x1f')]===_0xbf98('0x42')){_0x211d41[_0xbf98('0x43')][_0xbf98('0x3f')][_0xbf98('0x40')](_0xbf98('0x44'),_0x5633ec[_0xbf98('0x39')]);_0x211d41['user']['skip']=!![];}}}return _0x211d41;}function parseModelFields(_0x1c3272,_0x241a1f){var _0x1960df=squel[_0xbf98('0x20')]();var _0x16f34e=_(_0x1c3272)[_0xbf98('0x45')]()[_0xbf98('0x3d')](function(_0x108bf0){return _[_0xbf98('0x46')](_0x241a1f,[_0xbf98('0x32'),_0x108bf0])?_0x108bf0:undefined;})[_0xbf98('0x47')]()['value']();if(_0x1c3272[_0xbf98('0x48')]){_0x16f34e[_0xbf98('0x49')]('Contact');}if(_0x16f34e[_0xbf98('0x24')]>0x0){_0x16f34e[_0xbf98('0x1d')](function(_0x5d3495){if(_0x5d3495===_0xbf98('0x8')){_0x1960df[_0xbf98('0x40')](_0xbf98('0x4a'),[][_0xbf98('0x4b')](_0x1c3272[_0x5d3495]));}else if(_0x5d3495===_0xbf98('0x48')){var _0x181b9f='%'+_0x1c3272[_0x5d3495]+'%';_0x1960df[_0xbf98('0x40')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x181b9f);}else{_0x1960df[_0xbf98('0x40')]('c.'+_0x5d3495+_0xbf98('0x4c'),_0x1c3272[_0x5d3495]);}});}return _0x1960df;}function parseQueryParameters(_0x53a3db,_0x414159){var _0x21f8a1=getSqlClauses();return Promise[_0xbf98('0x4d')]()['then'](function(){return parseModelFields(_0x53a3db,_0x414159);})[_0xbf98('0x4e')](function(_0x209966){_0x21f8a1['fields'][_0xbf98('0x40')](_0x209966);return parseTagParameter(_0x53a3db[_0xbf98('0x4f')]);})[_0xbf98('0x4e')](function(_0x194d4b){_0x21f8a1[_0xbf98('0x3e')][_0xbf98('0x3f')]['and'](_0x194d4b);return parseSearchFilter(_0x53a3db[_0xbf98('0x50')]);})[_0xbf98('0x4e')](function(_0x145bf7){_0x21f8a1['filter']=_0x145bf7;return _0x21f8a1;});}function checkListsRestrictions(_0x1b78aa,_0x4d5246,_0x464bbb){var _0x39e45e=squel['expr']();return Promise['resolve']()[_0xbf98('0x4e')](function(){if(_0x4d5246[_0xbf98('0x7')]&&_0x1b78aa[_0xbf98('0x6')]==='agent'&&!_0x464bbb){return _0x1b78aa[_0xbf98('0x51')]({'attributes':['id'],'raw':!![]});}})[_0xbf98('0x4e')](function(_0x572e0d){if(_0x572e0d){if(_0x572e0d['length']===0x0){_0x39e45e['and']('c.ListId\x20IS\x20NULL');}else{_0x39e45e['and'](_0xbf98('0x4a'),_[_0xbf98('0x3d')](_0x572e0d,'id'));}}})['then'](function(){return _0x39e45e;});}function buildContactsQuery(_0xc9b8ff,_0x358101,_0x4cd4fd,_0x3def66,_0x331b0d,_0x206da2){if(_0x358101){_0x358101=_0x4cd4fd[_0xbf98('0x52')];}_0xc9b8ff=addFieldsToQuery(_0xc9b8ff,_0x358101,_0x3def66,_0x206da2,!![]);var _0xa40630=squel[_0xbf98('0xb')]();_0xa40630=addFieldsToQuery(_0xa40630,_0x358101,_0x3def66,_0x206da2,![]);if(_0x3def66||_0x206da2){_0xc9b8ff=applyJoinClauses(_0xc9b8ff,!![]);_0xc9b8ff[_0xbf98('0x53')]('c.id');if(_0x4cd4fd['limit']){_0xa40630['limit'](_0x4cd4fd[_0xbf98('0x54')]);}if(_0x4cd4fd['offset']){_0xa40630['offset'](_0x4cd4fd[_0xbf98('0x55')]);}}else{_0xa40630=applyJoinClauses(_0xa40630,![]);_0xa40630[_0xbf98('0x53')](_0xbf98('0x56'));if(_0x4cd4fd[_0xbf98('0x54')]){_0xc9b8ff[_0xbf98('0x54')](_0x4cd4fd[_0xbf98('0x54')]);}if(_0x4cd4fd['offset']){_0xc9b8ff[_0xbf98('0x55')](_0x4cd4fd['offset']);}}_0xa40630[_0xbf98('0x57')](_0x331b0d);if(_0x4cd4fd[_0xbf98('0x58')]){_0x4cd4fd[_0xbf98('0x58')][_0xbf98('0x1d')](function(_0x24ad2e){_0xc9b8ff[_0xbf98('0x58')]('c.'+_0x24ad2e[0x0],_0x24ad2e[0x1]==='DESC'?![]:!![]);_0xa40630[_0xbf98('0x58')](_0xbf98('0x59')+_0x24ad2e[0x0],_0x24ad2e[0x1]==='DESC'?![]:!![]);});}_0xa40630['from'](_0xc9b8ff,_0xbf98('0xf'));return _0xa40630;}function getFilteredContacts(_0x1fd043){var _0x23b3de=[];return db[_0xbf98('0x3b')][_0xbf98('0x5a')]({'attributes':['id','name',_0xbf98('0x5b')],'raw':!![]})[_0xbf98('0x4e')](function(_0x57f74e){_0x23b3de=_[_0xbf98('0x5c')](_0x57f74e,'id');var _0x2996b2={'type':db[_0xbf98('0x5d')]['QueryTypes'][_0xbf98('0x5e')],'model':db[_0xbf98('0x5f')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xbf98('0x60')][_0xbf98('0x61')](_0x1fd043[_0xbf98('0x62')](),_0x2996b2);})['then'](function(_0xe25179){_0xe25179[_0xbf98('0x1d')](function(_0x1397a7){if(_0x1397a7[_0xbf98('0x1e')]){_0x1397a7[_0xbf98('0x63')]=[];_0x1397a7['TagIds'][_0xbf98('0x3c')](',')[_0xbf98('0x1d')](function(_0x848338){_0x1397a7[_0xbf98('0x63')][_0xbf98('0x49')](_0x23b3de[_0x848338]);});}delete _0x1397a7[_0xbf98('0x1e')];});return _0xe25179;});}function countFilteredContacts(_0x527bc1,_0x89657e){var _0x5462ef=_0x527bc1[_0xbf98('0x64')]();_0x5462ef[_0xbf98('0x1f')]('COUNT(*)');_0x5462ef=applyJoinClauses(_0x5462ef,!![]);_0x527bc1[_0xbf98('0x53')](_0xbf98('0x65'));var _0x175171=utils['getSelectedTags'](_0x89657e);if(!_[_0xbf98('0x66')](_0x175171)){_0x5462ef['where'](_0xbf98('0x67'),_0x175171);}var _0x958f8c={'type':db[_0xbf98('0x5d')][_0xbf98('0x68')]['SELECT'],'raw':!![]};return db['sequelize']['query'](_0x5462ef['toString'](),_0x958f8c)[_0xbf98('0x4e')](function(_0x47d646){return _0x47d646[0x0][_0xbf98('0x69')];});}module[_0xbf98('0x6a')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery};
\ No newline at end of file
+var _0x3f58=['getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','fieldType','datetime','castTo','DATE','buildExpression','type','default','text','start','value','end','Tag','map','clause','and','tags','User','user','uc.UserId\x20=\x20?','skip','keys','some','compact','Contact','\x20=\x20?','resolve','then','fields','tag','filter','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','attributes','select','group','c.id','offset','subqry.id','limit','order','DESC','subqry.','findAll','color','keyBy','Sequelize','QueryTypes','CmContact','sequelize','query','Tags','clone','COUNT(*)','where','t.id\x20IN\x20?','SELECT','toString','exports','lodash','../parsers/advancedSearch','../parsers/qs','../interaction/utils','role','agent','search','ListId','autocomplete','true','from','c.deletedAt\x20IS\x20NULL','subqry','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','phone','mobile','fax','email','CompanyId','createdAt','updatedAt','deletedAt','TagIds','push','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3f58,0xb8));var _0x83f5=function(_0x5f16e9,_0x613a2f){_0x5f16e9=_0x5f16e9-0x0;var _0x115d09=_0x3f58[_0x5f16e9];return _0x115d09;};'use strict';var _=require(_0x83f5('0x0'));var squel=require('squel');var as=require(_0x83f5('0x1'));var qs=require(_0x83f5('0x2'));var utils=require(_0x83f5('0x3'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x5d10c9,_0xfaa04c){var _0xafd665=![];if(_0x5d10c9[_0x83f5('0x4')]===_0x83f5('0x5')&&!_0xfaa04c[_0x83f5('0x6')]&&!_0xfaa04c[_0x83f5('0x7')]&&_0xfaa04c[_0x83f5('0x8')]!==_0x83f5('0x9')){_0xafd665=!![];}return _0xafd665;}function getContactsSubquery(){return squel['select']()[_0x83f5('0xa')]('cm_contacts','c')['where'](_0x83f5('0xb'));}function applyJoinClauses(_0x25ef45,_0x58f46f){var _0x1e080b=_0x58f46f?'c':_0x83f5('0xc');_0x25ef45['left_join'](_0x83f5('0xd'),'uc',_0x83f5('0xe')+_0x1e080b+_0x83f5('0xf'))[_0x83f5('0x10')](_0x83f5('0x11'),'ct',_0x83f5('0x12')+_0x1e080b+'.id')[_0x83f5('0x10')](_0x83f5('0x13'),'t',_0x83f5('0x14'));return _0x25ef45;}function addFieldsToQuery(_0x23f1b9,_0x21c6f1,_0x13b8e4,_0x156cfe,_0x38503f){var _0x48af80=_0x38503f?'c':_0x83f5('0xc');if(!_0x21c6f1){_0x21c6f1=['id',_0x83f5('0x15'),_0x83f5('0x16'),_0x83f5('0x17'),_0x83f5('0x18'),_0x83f5('0x19'),_0x83f5('0x1a'),_0x83f5('0x7'),_0x83f5('0x1b'),_0x83f5('0x1c'),_0x83f5('0x1d'),_0x83f5('0x1e'),_0x83f5('0x1f')];}else if(!_0x21c6f1['includes']('id')){_0x21c6f1[_0x83f5('0x20')]('id');}var _0x3cd833=_0x13b8e4&&_0x38503f||!_0x13b8e4&&!_0x38503f;if(_0x156cfe){_0x3cd833=_0x156cfe&&_0x38503f||!_0x156cfe&&!_0x38503f;}_0x21c6f1['forEach'](function(_0x49e3e2){if(_0x49e3e2===_0x83f5('0x1f')){if(_0x3cd833){_0x23f1b9[_0x83f5('0x21')](_0x83f5('0x22'),_0x49e3e2);}else if(_0x13b8e4||_0x156cfe){_0x23f1b9[_0x83f5('0x21')](_0x48af80+'.'+_0x49e3e2);}}else{_0x23f1b9[_0x83f5('0x21')](_0x48af80+'.'+_0x49e3e2);}});return _0x23f1b9;}function getSqlClauses(){var _0x179ba7={'default':squel['expr'](),'fields':squel['expr'](),'filter':squel['expr'](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel[_0x83f5('0x23')](),'skip':![]}};return _0x179ba7;}function parseTagParameter(_0x137000){var _0x17a49e=squel['expr']();if(_0x137000){var _0x48aff2=utils[_0x83f5('0x24')](_0x137000);_0x48aff2[_0x83f5('0x25')](function(_0xc41b2c){_0x17a49e['or'](_0x83f5('0x26'),'%,'+_0xc41b2c+',%');});}return _0x17a49e;}function parseSearchFilter(_0x56f8e8){var _0x2f88a4=squel['expr']();if(_0x56f8e8){var _0x3d7095=_0x56f8e8['replace']('\x5c','\x5c\x5c')[_0x83f5('0x27')](/'/g,'\x27\x27');if(_0x3d7095[_0x83f5('0x28')]('\x20')[_0x83f5('0x29')]>0x1){_0x2f88a4['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x83f5('0x2a')](_0x3d7095),null);}else{if(qs[_0x83f5('0x2b')](_0x3d7095)){_0x2f88a4['or']('c.id\x20LIKE\x20?',_0x3d7095+'%');_0x2f88a4['or'](_0x83f5('0x2c'),_0x3d7095+'%');_0x2f88a4['or']('c.mobile\x20LIKE\x20?',_0x3d7095+'%');_0x2f88a4['or'](_0x83f5('0x2d'),_0x3d7095+'%');}else if(qs[_0x83f5('0x2e')](_0x3d7095)){_0x2f88a4['or'](_0x83f5('0x2f'),_0x3d7095+'%');}else{_0x2f88a4['or'](_0x83f5('0x30'),'%'+_0x3d7095+'%');_0x2f88a4['or']('c.lastName\x20LIKE\x20?','%'+_0x3d7095+'%');_0x2f88a4['or'](_0x83f5('0x2f'),'%'+_0x3d7095+'%');}}}return _0x2f88a4;}function parseAdvancedSearchFilter(_0x16369e,_0x3e023a){var _0x141535=getSqlClauses();var _0x11d5be=as[_0x83f5('0x31')](_0x16369e);var _0x1c3a56=_0x11d5be[_0x83f5('0x32')];for(var _0x5903bd=0x0;_0x5903bd<_0x11d5be[_0x83f5('0x33')]['length'];_0x5903bd++){var _0xf6581b=_0x11d5be[_0x83f5('0x33')][_0x5903bd];var _0x5f558c='c';var _0x3984a3=_[_0x83f5('0x34')](_0x3e023a,[_0x83f5('0x35'),_0xf6581b[_0x83f5('0x21')]]);if(_0x3984a3){if(_0xf6581b[_0x83f5('0x21')]==='dateOfBirth'||_0x3984a3[_0x83f5('0x36')]===_0x83f5('0x37')){_0xf6581b[_0x83f5('0x38')]=_0x83f5('0x39');}var _0x432a38=as[_0x83f5('0x3a')](_0x5f558c,_0x3984a3[_0x83f5('0x3b')],_0xf6581b);_0x141535[_0x83f5('0x3c')][_0x1c3a56](_0x432a38[_0x83f5('0x3d')],_0x432a38['value'][_0x83f5('0x3e')],_0x432a38[_0x83f5('0x3f')][_0x83f5('0x40')]);}else{if(_0xf6581b[_0x83f5('0x21')]===_0x83f5('0x41')){var _0x1b8715=_0xf6581b[_0x83f5('0x3f')][_0x83f5('0x28')](',')[_0x83f5('0x42')](function(_0x37acf8){return Number(_0x37acf8);});var _0x4e4dbd=parseTagParameter(_0x1b8715);_0x141535['tags'][_0x83f5('0x43')][_0x83f5('0x44')](_0x4e4dbd);_0x141535[_0x83f5('0x45')]['ids']=_0x1b8715;}else if(_0xf6581b[_0x83f5('0x21')]===_0x83f5('0x46')){_0x141535[_0x83f5('0x47')][_0x83f5('0x43')][_0x83f5('0x44')](_0x83f5('0x48'),_0xf6581b['value']);_0x141535[_0x83f5('0x47')][_0x83f5('0x49')]=!![];}}}return _0x141535;}function parseModelFields(_0x475053,_0x1342fa){var _0x35a1b1=squel[_0x83f5('0x23')]();var _0x1b7dda=_(_0x475053)[_0x83f5('0x4a')]()[_0x83f5('0x42')](function(_0x5a489e){return _[_0x83f5('0x4b')](_0x1342fa,[_0x83f5('0x35'),_0x5a489e])?_0x5a489e:undefined;})[_0x83f5('0x4c')]()[_0x83f5('0x3f')]();if(_0x475053[_0x83f5('0x4d')]){_0x1b7dda[_0x83f5('0x20')](_0x83f5('0x4d'));}if(_0x1b7dda[_0x83f5('0x29')]>0x0){_0x1b7dda[_0x83f5('0x25')](function(_0x607a17){if(_0x607a17==='ListId'){_0x35a1b1['and']('c.ListId\x20IN\x20?',[]['concat'](_0x475053[_0x607a17]));}else if(_0x607a17===_0x83f5('0x4d')){var _0x1df5e1='%'+_0x475053[_0x607a17]+'%';_0x35a1b1['and']('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x1df5e1);}else{_0x35a1b1['and']('c.'+_0x607a17+_0x83f5('0x4e'),_0x475053[_0x607a17]);}});}return _0x35a1b1;}function parseQueryParameters(_0x417aaa,_0x2262a7){var _0x1a3158=getSqlClauses();return Promise[_0x83f5('0x4f')]()[_0x83f5('0x50')](function(){return parseModelFields(_0x417aaa,_0x2262a7);})[_0x83f5('0x50')](function(_0x1d11d7){_0x1a3158[_0x83f5('0x51')][_0x83f5('0x44')](_0x1d11d7);return parseTagParameter(_0x417aaa[_0x83f5('0x52')]);})[_0x83f5('0x50')](function(_0x4c8ca7){_0x1a3158[_0x83f5('0x45')][_0x83f5('0x43')][_0x83f5('0x44')](_0x4c8ca7);return parseSearchFilter(_0x417aaa[_0x83f5('0x53')]);})['then'](function(_0x59bfe9){_0x1a3158[_0x83f5('0x53')]=_0x59bfe9;return _0x1a3158;});}function checkListsRestrictions(_0x1004b7,_0x198019,_0x578e53){var _0xcd632c=squel[_0x83f5('0x23')]();return Promise[_0x83f5('0x4f')]()[_0x83f5('0x50')](function(){if(_0x198019[_0x83f5('0x6')]&&_0x1004b7[_0x83f5('0x4')]===_0x83f5('0x5')&&!_0x578e53){return _0x1004b7[_0x83f5('0x54')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x5360f6){if(_0x5360f6){if(_0x5360f6[_0x83f5('0x29')]===0x0){_0xcd632c['and'](_0x83f5('0x55'));}else{_0xcd632c['and'](_0x83f5('0x56'),_[_0x83f5('0x42')](_0x5360f6,'id'));}}})[_0x83f5('0x50')](function(){return _0xcd632c;});}function buildContactsQuery(_0x45b3f8,_0x1ace2d,_0x5ae707,_0x1072bd,_0x1b5546,_0x299354){if(_0x1ace2d){_0x1ace2d=_0x5ae707[_0x83f5('0x57')];}_0x45b3f8=addFieldsToQuery(_0x45b3f8,_0x1ace2d,_0x1072bd,_0x299354,!![]);var _0x4739d3=squel[_0x83f5('0x58')]();_0x4739d3=addFieldsToQuery(_0x4739d3,_0x1ace2d,_0x1072bd,_0x299354,![]);if(_0x1072bd||_0x299354){_0x45b3f8=applyJoinClauses(_0x45b3f8,!![]);_0x45b3f8[_0x83f5('0x59')](_0x83f5('0x5a'));if(_0x5ae707['limit']){_0x4739d3['limit'](_0x5ae707['limit']);}if(_0x5ae707[_0x83f5('0x5b')]){_0x4739d3['offset'](_0x5ae707['offset']);}}else{_0x4739d3=applyJoinClauses(_0x4739d3,![]);_0x4739d3[_0x83f5('0x59')](_0x83f5('0x5c'));if(_0x5ae707[_0x83f5('0x5d')]){_0x45b3f8[_0x83f5('0x5d')](_0x5ae707[_0x83f5('0x5d')]);}if(_0x5ae707[_0x83f5('0x5b')]){_0x45b3f8[_0x83f5('0x5b')](_0x5ae707[_0x83f5('0x5b')]);}}_0x4739d3['having'](_0x1b5546);if(_0x5ae707['order']){_0x5ae707[_0x83f5('0x5e')][_0x83f5('0x25')](function(_0x589362){_0x45b3f8['order']('c.'+_0x589362[0x0],_0x589362[0x1]===_0x83f5('0x5f')?![]:!![]);_0x4739d3['order'](_0x83f5('0x60')+_0x589362[0x0],_0x589362[0x1]==='DESC'?![]:!![]);});}_0x4739d3[_0x83f5('0xa')](_0x45b3f8,'subqry');return _0x4739d3;}function getFilteredContacts(_0x42e1b0){var _0x4796f8=[];return db[_0x83f5('0x41')][_0x83f5('0x61')]({'attributes':['id',_0x83f5('0x35'),_0x83f5('0x62')],'raw':!![]})['then'](function(_0x21d1bb){_0x4796f8=_[_0x83f5('0x63')](_0x21d1bb,'id');var _0x3ff695={'type':db[_0x83f5('0x64')][_0x83f5('0x65')]['SELECT'],'model':db[_0x83f5('0x66')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x83f5('0x67')][_0x83f5('0x68')](_0x42e1b0['toString'](),_0x3ff695);})[_0x83f5('0x50')](function(_0x120478){_0x120478[_0x83f5('0x25')](function(_0x4e42cd){if(_0x4e42cd[_0x83f5('0x1f')]){_0x4e42cd[_0x83f5('0x69')]=[];_0x4e42cd[_0x83f5('0x1f')][_0x83f5('0x28')](',')[_0x83f5('0x25')](function(_0x55b3e7){_0x4e42cd[_0x83f5('0x69')][_0x83f5('0x20')](_0x4796f8[_0x55b3e7]);});}delete _0x4e42cd['TagIds'];});return _0x120478;});}function countFilteredContacts(_0x2e1daa,_0x1f4f7c){var _0x526f3b=_0x2e1daa[_0x83f5('0x6a')]();_0x526f3b[_0x83f5('0x21')](_0x83f5('0x6b'));_0x526f3b=applyJoinClauses(_0x526f3b,!![]);_0x2e1daa[_0x83f5('0x59')](_0x83f5('0x5a'));var _0x427712=utils['getSelectedTags'](_0x1f4f7c);if(!_['isEmpty'](_0x427712)){_0x526f3b[_0x83f5('0x6c')](_0x83f5('0x6d'),_0x427712);}var _0x4d376c={'type':db['Sequelize'][_0x83f5('0x65')][_0x83f5('0x6e')],'raw':!![]};return db[_0x83f5('0x67')]['query'](_0x526f3b[_0x83f5('0x6f')](),_0x4d376c)[_0x83f5('0x50')](function(_0x2a7582){return _0x2a7582[0x0][_0x83f5('0x6b')];});}module[_0x83f5('0x70')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery};
\ No newline at end of file
index 32d51c7..10aae8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7f8=['app','secrets','session','aes-256-ctr','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','hasOwnProperty','encryptFile','createReadStream','data','binary','write','end','final','close','createWriteStream','createDecipher','update','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','../../config/environment','../../config/logger'];(function(_0x290e0e,_0x78aa77){var _0xf8cf06=function(_0x1aee50){while(--_0x1aee50){_0x290e0e['push'](_0x290e0e['shift']());}};_0xf8cf06(++_0x78aa77);}(_0xe7f8,0xb6));var _0x8e7f=function(_0x3ac274,_0x4daee6){_0x3ac274=_0x3ac274-0x0;var _0x13499a=_0xe7f8[_0x3ac274];return _0x13499a;};'use strict';var crypto=require(_0x8e7f('0x0'));var fs=require('fs');var BPromise=require(_0x8e7f('0x1'));var _=require('lodash');var config=require(_0x8e7f('0x2'));var logger=require(_0x8e7f('0x3'))(_0x8e7f('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x8e7f('0x5')][_0x8e7f('0x6')],'algorithm':_0x8e7f('0x7')};const fileOptions={'algorithm':'aes192'};if(config[_0x8e7f('0x8')]&&config[_0x8e7f('0x8')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0x8e7f('0x8')][_0x8e7f('0x9')]);if(isSupported){fileOptions[_0x8e7f('0x9')]=config[_0x8e7f('0x8')][_0x8e7f('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x8e7f('0xa')](config[_0x8e7f('0x8')][_0x8e7f('0x9')],_0x8e7f('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x4564e3){return AES_SUPPORTED_RX['test'](_0x4564e3);}function getSupportedCiphers(){return crypto[_0x8e7f('0xc')]()[_0x8e7f('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x768864){return getSupportedCiphers()['indexOf'](_0x768864)>-0x1;}function combineOptions(_0xa5e61a){var _0x5b7b25={};for(var _0x1d72f2 in fileOptions){if(fileOptions[_0x8e7f('0xe')](_0x1d72f2)){_0x5b7b25[_0x1d72f2]=fileOptions[_0x1d72f2];}}if(_0xa5e61a){for(var _0x312390 in _0xa5e61a){if(_0xa5e61a[_0x8e7f('0xe')](_0x312390)){_0x5b7b25[_0x312390]=_0xa5e61a[_0x312390];}}}return _0x5b7b25;}exports[_0x8e7f('0xf')]=function(_0x2d75d,_0x3a9545,_0x4e90df,_0x27ccfc){return new BPromise(function(_0x12b393,_0x49d901){_0x27ccfc=combineOptions(_0x27ccfc);var _0x4f7251=new Buffer(_0x4e90df);var _0x13e638=fs[_0x8e7f('0x10')](_0x2d75d);var _0xcf1b69=fs['createWriteStream'](_0x3a9545);var _0x34b8fb=crypto['createCipher'](_0x27ccfc['algorithm'],_0x4f7251);_0x13e638['on'](_0x8e7f('0x11'),function(_0x1e4f8f){var _0x13ea42=new Buffer(_0x34b8fb['update'](_0x1e4f8f),_0x8e7f('0x12'));_0xcf1b69[_0x8e7f('0x13')](_0x13ea42);});_0x13e638['on'](_0x8e7f('0x14'),function(){try{var _0x59ae95=new Buffer(_0x34b8fb[_0x8e7f('0x15')](_0x8e7f('0x12')),_0x8e7f('0x12'));_0xcf1b69['write'](_0x59ae95);_0xcf1b69[_0x8e7f('0x14')]();_0xcf1b69['on'](_0x8e7f('0x16'),function(){return _0x12b393(_0x3a9545);});}catch(_0x31d472){fs['unlink'](_0x3a9545);return _0x49d901(_0x31d472);}});});};exports['decryptFile']=function(_0x51511f,_0x5c2d3d,_0x32fa6e,_0x40f116){return new BPromise(function(_0x29cf28,_0x503c62){_0x40f116=combineOptions(_0x40f116);var _0x37a5b8=new Buffer(_0x32fa6e);var _0x319c55=fs[_0x8e7f('0x10')](_0x51511f);var _0x3a1030=fs[_0x8e7f('0x17')](_0x5c2d3d);var _0x5c9cdc=crypto[_0x8e7f('0x18')](_0x40f116[_0x8e7f('0x9')],_0x37a5b8);_0x319c55['on'](_0x8e7f('0x11'),function(_0x15de79){var _0xc139c=new Buffer(_0x5c9cdc[_0x8e7f('0x19')](_0x15de79),'binary');_0x3a1030[_0x8e7f('0x13')](_0xc139c);});_0x319c55['on']('end',function(){try{var _0x6a3fff=new Buffer(_0x5c9cdc[_0x8e7f('0x15')](_0x8e7f('0x12')),_0x8e7f('0x12'));_0x3a1030[_0x8e7f('0x13')](_0x6a3fff);_0x3a1030[_0x8e7f('0x14')]();_0x3a1030['on'](_0x8e7f('0x16'),function(){return _0x29cf28(_0x5c2d3d);});}catch(_0x2de38b){fs['unlink'](_0x5c2d3d);return _0x503c62(_0x2de38b);}});});};exports[_0x8e7f('0x1a')]=function(_0x129d1e,_0x2831bf,_0xa26488){var _0x3375e7=_0xa26488||stringOptions[_0x8e7f('0x9')];var _0x737404=_0x2831bf||stringOptions[_0x8e7f('0x1b')];var _0x241c44=crypto['createCipher'](_0x3375e7,_0x737404);var _0x4f92b9=_0x241c44[_0x8e7f('0x19')](_0x129d1e,_0x8e7f('0x1c'),'base64');_0x4f92b9+=_0x241c44[_0x8e7f('0x15')](_0x8e7f('0x1d'));return _0x4f92b9;};exports[_0x8e7f('0x1e')]=function(_0x34f0cd,_0x5214ca,_0x4ad72d){var _0x17d677=_0x4ad72d||stringOptions[_0x8e7f('0x9')];var _0x3c3fe3=_0x5214ca||stringOptions[_0x8e7f('0x1b')];var _0x4d65f2=crypto[_0x8e7f('0x18')](_0x17d677,_0x3c3fe3);var _0x490d50=_0x4d65f2['update'](_0x34f0cd,_0x8e7f('0x1d'),'utf8');_0x490d50+=_0x4d65f2[_0x8e7f('0x15')](_0x8e7f('0x1c'));return _0x490d50;};
\ No newline at end of file
+var _0x2f08=['bluebird','lodash','../../config/logger','app','secrets','session','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','indexOf','hasOwnProperty','createReadStream','data','update','binary','final','write','end','close','decryptFile','createWriteStream','createDecipher','encryptString','secret','createCipher','base64','decryptString','utf8','crypto'];(function(_0x2f49df,_0x518919){var _0x1ec090=function(_0x19e46f){while(--_0x19e46f){_0x2f49df['push'](_0x2f49df['shift']());}};_0x1ec090(++_0x518919);}(_0x2f08,0x131));var _0x82f0=function(_0x144b30,_0x77072d){_0x144b30=_0x144b30-0x0;var _0x1bb7bc=_0x2f08[_0x144b30];return _0x1bb7bc;};'use strict';var crypto=require(_0x82f0('0x0'));var fs=require('fs');var BPromise=require(_0x82f0('0x1'));var _=require(_0x82f0('0x2'));var config=require('../../config/environment');var logger=require(_0x82f0('0x3'))(_0x82f0('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x82f0('0x5')][_0x82f0('0x6')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x82f0('0x7')};if(config[_0x82f0('0x8')]&&config[_0x82f0('0x8')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0x82f0('0x8')][_0x82f0('0x9')]);if(isSupported){fileOptions[_0x82f0('0x9')]=config[_0x82f0('0x8')][_0x82f0('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x82f0('0xa')](',\x20');logger[_0x82f0('0xb')](config[_0x82f0('0x8')][_0x82f0('0x9')],_0x82f0('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0xab8de8){return AES_SUPPORTED_RX['test'](_0xab8de8);}function getSupportedCiphers(){return crypto[_0x82f0('0xd')]()[_0x82f0('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x15af96){return getSupportedCiphers()[_0x82f0('0xf')](_0x15af96)>-0x1;}function combineOptions(_0x1d7fb7){var _0x5e8221={};for(var _0x12bb68 in fileOptions){if(fileOptions[_0x82f0('0x10')](_0x12bb68)){_0x5e8221[_0x12bb68]=fileOptions[_0x12bb68];}}if(_0x1d7fb7){for(var _0x1d0fe8 in _0x1d7fb7){if(_0x1d7fb7[_0x82f0('0x10')](_0x1d0fe8)){_0x5e8221[_0x1d0fe8]=_0x1d7fb7[_0x1d0fe8];}}}return _0x5e8221;}exports['encryptFile']=function(_0x1d85b5,_0x4a0491,_0x5c4cc4,_0x426f55){return new BPromise(function(_0x130208,_0x3595e8){_0x426f55=combineOptions(_0x426f55);var _0x2d025a=new Buffer(_0x5c4cc4);var _0x513db8=fs[_0x82f0('0x11')](_0x1d85b5);var _0x5e50c3=fs['createWriteStream'](_0x4a0491);var _0x134dd7=crypto['createCipher'](_0x426f55[_0x82f0('0x9')],_0x2d025a);_0x513db8['on'](_0x82f0('0x12'),function(_0x570651){var _0x330914=new Buffer(_0x134dd7[_0x82f0('0x13')](_0x570651),_0x82f0('0x14'));_0x5e50c3['write'](_0x330914);});_0x513db8['on']('end',function(){try{var _0x40d907=new Buffer(_0x134dd7[_0x82f0('0x15')](_0x82f0('0x14')),_0x82f0('0x14'));_0x5e50c3[_0x82f0('0x16')](_0x40d907);_0x5e50c3[_0x82f0('0x17')]();_0x5e50c3['on'](_0x82f0('0x18'),function(){return _0x130208(_0x4a0491);});}catch(_0x4e4d0e){fs['unlink'](_0x4a0491);return _0x3595e8(_0x4e4d0e);}});});};exports[_0x82f0('0x19')]=function(_0x1ba761,_0x3cd433,_0xcd9412,_0x34e6f2){return new BPromise(function(_0x29d566,_0x153b76){_0x34e6f2=combineOptions(_0x34e6f2);var _0x14ba25=new Buffer(_0xcd9412);var _0x16f6db=fs[_0x82f0('0x11')](_0x1ba761);var _0x5032a6=fs[_0x82f0('0x1a')](_0x3cd433);var _0x5242b4=crypto[_0x82f0('0x1b')](_0x34e6f2[_0x82f0('0x9')],_0x14ba25);_0x16f6db['on']('data',function(_0x453c98){var _0x2f1c23=new Buffer(_0x5242b4['update'](_0x453c98),_0x82f0('0x14'));_0x5032a6[_0x82f0('0x16')](_0x2f1c23);});_0x16f6db['on'](_0x82f0('0x17'),function(){try{var _0x112944=new Buffer(_0x5242b4[_0x82f0('0x15')](_0x82f0('0x14')),_0x82f0('0x14'));_0x5032a6[_0x82f0('0x16')](_0x112944);_0x5032a6[_0x82f0('0x17')]();_0x5032a6['on'](_0x82f0('0x18'),function(){return _0x29d566(_0x3cd433);});}catch(_0x36ea83){fs['unlink'](_0x3cd433);return _0x153b76(_0x36ea83);}});});};exports[_0x82f0('0x1c')]=function(_0x534bd5,_0x41a9cc,_0xe67c2c){var _0x491178=_0xe67c2c||stringOptions['algorithm'];var _0x3630d2=_0x41a9cc||stringOptions[_0x82f0('0x1d')];var _0x428499=crypto[_0x82f0('0x1e')](_0x491178,_0x3630d2);var _0x1f9362=_0x428499[_0x82f0('0x13')](_0x534bd5,'utf8',_0x82f0('0x1f'));_0x1f9362+=_0x428499[_0x82f0('0x15')](_0x82f0('0x1f'));return _0x1f9362;};exports[_0x82f0('0x20')]=function(_0x2ec9c8,_0x49571f,_0x579585){var _0x5f74bd=_0x579585||stringOptions['algorithm'];var _0xec1bc7=_0x49571f||stringOptions['secret'];var _0x1bb168=crypto[_0x82f0('0x1b')](_0x5f74bd,_0xec1bc7);var _0x3ac757=_0x1bb168['update'](_0x2ec9c8,_0x82f0('0x1f'),_0x82f0('0x21'));_0x3ac757+=_0x1bb168['final'](_0x82f0('0x21'));return _0x3ac757;};
\ No newline at end of file
index 7281cf6..37b398a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21cc=['util','path','lodash','to-csv','bluebird','rimraf','../../mysqldb','../../config/logger','analytics','argv','update','info','Setting','find','split','splitSizeCsv','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','length','forEach','push','query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','mkdirSync','join','csv','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','inspect','Failed','finally','exit'];(function(_0x5dba8f,_0x74ebaf){var _0x359ed4=function(_0x4af407){while(--_0x4af407){_0x5dba8f['push'](_0x5dba8f['shift']());}};_0x359ed4(++_0x74ebaf);}(_0x21cc,0x11a));var _0xc21c=function(_0x253875,_0x19d574){_0x253875=_0x253875-0x0;var _0x4fabe7=_0x21cc[_0x253875];return _0x4fabe7;};'use strict';var util=require(_0xc21c('0x0'));var path=require(_0xc21c('0x1'));var _=require(_0xc21c('0x2'));var csv=require(_0xc21c('0x3'));var fs=require('fs');var BPromise=require(_0xc21c('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0xc21c('0x5'));var db=require(_0xc21c('0x6'))['db'];var dbH=require(_0xc21c('0x6'))['dbH'];var logger=require(_0xc21c('0x7'))(_0xc21c('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xc21c('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x10130a,_0x59724e){var _0xbd1f8={'status':_0x10130a};var _0x5a17a8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x59724e){_0xbd1f8['savename']=_0x59724e;}return db['AnalyticExtractedReport'][_0xc21c('0xa')](_0xbd1f8,_0x5a17a8);}function main(){var _0x58aa16=0x1388;var _0xc4e6bb;logger[_0xc21c('0xb')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0xc21c('0xc')][_0xc21c('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc21c('0xe'),_0xc21c('0xf')]})[_0xc21c('0x10')](function(_0x50024d){if(_0x50024d){_0xc4e6bb=_0x50024d;_0x58aa16=_0xc4e6bb[_0xc21c('0xf')]||0x1388;}})['then'](function(){return dbH['sequelize']['query'](util['format'](_0xc21c('0x11'),QUERY),{'type':dbH[_0xc21c('0x12')][_0xc21c('0x13')][_0xc21c('0x14')]});})[_0xc21c('0x10')](function(_0x524248){if(!_0x524248[0x0][_0xc21c('0x15')]){return analyticExtractedReport(_0xc21c('0x16'));}var _0x3eaebb=[];var _0x3bc7d0=0x0;if(_0xc4e6bb[_0xc21c('0xe')]){if(_0x524248&&_0x524248[_0xc21c('0x17')]){var _0x57fe78=_['range'](_0x524248[0x0][_0xc21c('0x15')]/_0x58aa16);var _0x591757=Number['isInteger'](_0x524248[0x0]['num']/_0x58aa16)?_0x524248[0x0]['num']%_0x58aa16:0x0;_0x57fe78[_0xc21c('0x18')](function(_0x517e95){if(_0x517e95>0x0){_0x3bc7d0+=_0x58aa16;}_0x3eaebb[_0xc21c('0x19')](dbH[_0xc21c('0x12')][_0xc21c('0x1a')](util[_0xc21c('0x1b')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x58aa16,_0x3bc7d0),{'type':dbH[_0xc21c('0x12')]['QueryTypes'][_0xc21c('0x14')]}));});if(_0x591757>0x0){_0x3bc7d0+=_0x58aa16;_0x3eaebb[_0xc21c('0x19')](dbH[_0xc21c('0x12')][_0xc21c('0x1a')](util[_0xc21c('0x1b')](_0xc21c('0x1c'),QUERY,_0x591757,_0x3bc7d0),{'type':dbH['sequelize'][_0xc21c('0x13')][_0xc21c('0x14')]}));}}}else{_0x3eaebb[_0xc21c('0x19')](dbH[_0xc21c('0x12')]['query'](QUERY,{'type':dbH[_0xc21c('0x12')][_0xc21c('0x13')][_0xc21c('0x14')]}));}var _0xb9689c=path[_0xc21c('0x1d')](PATH);var _0x4e0816=path[_0xc21c('0x1e')](PATH,_0xc21c('0x1f'));var _0x45ddac=_0xc4e6bb[_0xc21c('0xe')]&&_0x3eaebb[_0xc21c('0x17')]>0x1;var _0x27d436=[];if(!fs['existsSync'](path['join'](_0xb9689c,_0x4e0816))&&_0x45ddac){fs[_0xc21c('0x20')](path[_0xc21c('0x21')](_0xb9689c,_0x4e0816));}return BPromise['each'](_0x3eaebb,function(_0x1770c9){_0x27d436[_0xc21c('0x19')](_0x1770c9);})[_0xc21c('0x10')](function(){for(var _0x119d50=0x0;_0x119d50<_0x27d436['length'];_0x119d50+=0x1){var _0x182e11;var _0x25a18d=_0x27d436[_0x119d50];if(_0x45ddac){_0x182e11=path[_0xc21c('0x21')](_0xb9689c,_0x4e0816,util[_0xc21c('0x1b')]('%s%d.%s',_0x4e0816,_0x119d50,_0xc21c('0x22')));}else{_0x182e11=path[_0xc21c('0x21')](_0xb9689c,util['format']('%s.%s',_0x4e0816,_0xc21c('0x22')));}fs[_0xc21c('0x23')](_0x182e11,csv(_0x25a18d));}})[_0xc21c('0x10')](function(){if(_0x45ddac){return new Promise(function(_0x277320){zipdir(path[_0xc21c('0x21')](_0xb9689c,_0x4e0816),{'saveTo':path[_0xc21c('0x21')](_0xb9689c,util[_0xc21c('0x1b')]('%s.%s',_0x4e0816,_0xc21c('0x24')))},function(_0x10124,_0x73603b){rimraf(path[_0xc21c('0x21')](_0xb9689c,_0x4e0816),function(){});_0x277320(_0xc21c('0x25'));});});}})[_0xc21c('0x10')](function(){logger['info'](util[_0xc21c('0x1b')](_0xc21c('0x26'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xc21c('0x27'),_0x45ddac?util[_0xc21c('0x1b')]('%s.%s',_0x4e0816,_0x45ddac?_0xc21c('0x24'):_0xc21c('0x22')):null);});})[_0xc21c('0x28')](function(_0x37ea5d){logger[_0xc21c('0xb')](util[_0xc21c('0x1b')](_0xc21c('0x29'),EXTRACTED_REPORT_ID,_0xc21c('0x2a')),util[_0xc21c('0x2b')](_0x37ea5d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xc21c('0x2c'));})[_0xc21c('0x2d')](function(){process[_0xc21c('0x2e')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0xaeb2=['writeFileSync','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','AnalyticExtractedReport','update','info','format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','mkdirSync','each','join','%s%d.%s','csv','%s.%s'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xaeb2,0x73));var _0x2aeb=function(_0x5c727c,_0x5ed2dc){_0x5c727c=_0x5c727c-0x0;var _0x3f11de=_0xaeb2[_0x5c727c];return _0x3f11de;};'use strict';var util=require(_0x2aeb('0x0'));var path=require(_0x2aeb('0x1'));var _=require(_0x2aeb('0x2'));var csv=require(_0x2aeb('0x3'));var fs=require('fs');var BPromise=require(_0x2aeb('0x4'));var zipdir=require(_0x2aeb('0x5'));var rimraf=require(_0x2aeb('0x6'));var db=require(_0x2aeb('0x7'))['db'];var dbH=require(_0x2aeb('0x7'))[_0x2aeb('0x8')];var logger=require('../../config/logger')(_0x2aeb('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x2aeb('0xa')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x29b30c,_0x1282dc){var _0x4f3fc5={'status':_0x29b30c};var _0x1eeab2={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1282dc){_0x4f3fc5['savename']=_0x1282dc;}return db[_0x2aeb('0xb')][_0x2aeb('0xc')](_0x4f3fc5,_0x1eeab2);}function main(){var _0x282b48=0x1388;var _0x5412fb;logger[_0x2aeb('0xd')](util[_0x2aeb('0xe')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x2aeb('0xf')));return db[_0x2aeb('0x10')][_0x2aeb('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2aeb('0x12'),_0x2aeb('0x13')]})[_0x2aeb('0x14')](function(_0x29c836){if(_0x29c836){_0x5412fb=_0x29c836;_0x282b48=_0x5412fb[_0x2aeb('0x13')]||0x1388;}})[_0x2aeb('0x14')](function(){return dbH[_0x2aeb('0x15')][_0x2aeb('0x16')](util[_0x2aeb('0xe')](_0x2aeb('0x17'),QUERY),{'type':dbH[_0x2aeb('0x15')][_0x2aeb('0x18')][_0x2aeb('0x19')]});})[_0x2aeb('0x14')](function(_0x558ce7){if(!_0x558ce7[0x0][_0x2aeb('0x1a')]){return analyticExtractedReport(_0x2aeb('0x1b'));}var _0x1cbd29=[];var _0x39e7cf=0x0;if(_0x5412fb[_0x2aeb('0x12')]){if(_0x558ce7&&_0x558ce7[_0x2aeb('0x1c')]){var _0x4f7347=_[_0x2aeb('0x1d')](_0x558ce7[0x0][_0x2aeb('0x1a')]/_0x282b48);var _0x2c588a=Number[_0x2aeb('0x1e')](_0x558ce7[0x0][_0x2aeb('0x1a')]/_0x282b48)?_0x558ce7[0x0][_0x2aeb('0x1a')]%_0x282b48:0x0;_0x4f7347[_0x2aeb('0x1f')](function(_0x561f47){if(_0x561f47>0x0){_0x39e7cf+=_0x282b48;}_0x1cbd29[_0x2aeb('0x20')](dbH['sequelize'][_0x2aeb('0x16')](util[_0x2aeb('0xe')](_0x2aeb('0x21'),QUERY,_0x282b48,_0x39e7cf),{'type':dbH[_0x2aeb('0x15')][_0x2aeb('0x18')][_0x2aeb('0x19')]}));});if(_0x2c588a>0x0){_0x39e7cf+=_0x282b48;_0x1cbd29[_0x2aeb('0x20')](dbH[_0x2aeb('0x15')][_0x2aeb('0x16')](util[_0x2aeb('0xe')](_0x2aeb('0x21'),QUERY,_0x2c588a,_0x39e7cf),{'type':dbH[_0x2aeb('0x15')][_0x2aeb('0x18')][_0x2aeb('0x19')]}));}}}else{_0x1cbd29[_0x2aeb('0x20')](dbH[_0x2aeb('0x15')][_0x2aeb('0x16')](QUERY,{'type':dbH['sequelize'][_0x2aeb('0x18')]['SELECT']}));}var _0x590dcb=path[_0x2aeb('0x22')](PATH);var _0x245cb3=path[_0x2aeb('0x23')](PATH,_0x2aeb('0x24'));var _0x12dd41=_0x5412fb[_0x2aeb('0x12')]&&_0x1cbd29['length']>0x1;var _0x3297d9=[];if(!fs[_0x2aeb('0x25')](path['join'](_0x590dcb,_0x245cb3))&&_0x12dd41){fs[_0x2aeb('0x26')](path['join'](_0x590dcb,_0x245cb3));}return BPromise[_0x2aeb('0x27')](_0x1cbd29,function(_0x501643){_0x3297d9[_0x2aeb('0x20')](_0x501643);})['then'](function(){for(var _0x2ca38b=0x0;_0x2ca38b<_0x3297d9[_0x2aeb('0x1c')];_0x2ca38b+=0x1){var _0x15be11;var _0x508067=_0x3297d9[_0x2ca38b];if(_0x12dd41){_0x15be11=path[_0x2aeb('0x28')](_0x590dcb,_0x245cb3,util[_0x2aeb('0xe')](_0x2aeb('0x29'),_0x245cb3,_0x2ca38b,_0x2aeb('0x2a')));}else{_0x15be11=path[_0x2aeb('0x28')](_0x590dcb,util[_0x2aeb('0xe')](_0x2aeb('0x2b'),_0x245cb3,'csv'));}fs[_0x2aeb('0x2c')](_0x15be11,csv(_0x508067));}})['then'](function(){if(_0x12dd41){return new Promise(function(_0x333e7c){zipdir(path[_0x2aeb('0x28')](_0x590dcb,_0x245cb3),{'saveTo':path[_0x2aeb('0x28')](_0x590dcb,util[_0x2aeb('0xe')]('%s.%s',_0x245cb3,'zip'))},function(_0x44fd53,_0x478637){rimraf(path[_0x2aeb('0x28')](_0x590dcb,_0x245cb3),function(){});_0x333e7c(_0x2aeb('0x2d'));});});}})['then'](function(){logger[_0x2aeb('0xd')](util['format'](_0x2aeb('0x2e'),EXTRACTED_REPORT_ID,_0x2aeb('0xf')));return analyticExtractedReport(_0x2aeb('0x2f'),_0x12dd41?util[_0x2aeb('0xe')](_0x2aeb('0x2b'),_0x245cb3,_0x12dd41?_0x2aeb('0x30'):_0x2aeb('0x2a')):null);});})[_0x2aeb('0x31')](function(_0x525768){logger['info'](util[_0x2aeb('0xe')](_0x2aeb('0x32'),EXTRACTED_REPORT_ID,'CSV'),util[_0x2aeb('0x33')](_0x525768,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x2aeb('0x34'));})['finally'](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
index 1f25c63..cd8dd42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18e5=['Setting','find','split','splitSizePdf','then','range','num','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','dirname','basename','.pdf','existsSync','join','mkdirSync','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','createWriteStream','finish','error','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','JSDOM','window','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','pick','toString','fill','length','auto','push','body','concat','chunk','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','margin','\x20/\x20','footer','right'];(function(_0x5647a5,_0x4fc32e){var _0x419234=function(_0x4bfb94){while(--_0x4bfb94){_0x5647a5['push'](_0x5647a5['shift']());}};_0x419234(++_0x4fc32e);}(_0x18e5,0x1d6));var _0x518e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x18e5[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x518e('0x0'));var path=require(_0x518e('0x1'));var moment=require(_0x518e('0x2'));var htmlToPdfmake=require(_0x518e('0x3'));var PdfPrinter=require(_0x518e('0x4'));var zipdir=require(_0x518e('0x5'));var rimraf=require('rimraf');var JSDOM=require(_0x518e('0x6'))[_0x518e('0x7')];var window=new JSDOM('')[_0x518e('0x8')];var BPromise=require('bluebird');var db=require(_0x518e('0x9'))['db'];var dbH=require('../../mysqldb')[_0x518e('0xa')];var logger=require(_0x518e('0xb'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x518e('0xc')][0x2]);var QUERY=process[_0x518e('0xc')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x518e('0xc')][0x5];var FORMAT=_0x518e('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x223165,_0x4a6c17){var _0x1be547={'status':_0x223165};var _0x43fc30={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4a6c17){_0x1be547[_0x518e('0xe')]=_0x4a6c17;}return db[_0x518e('0xf')][_0x518e('0x10')](_0x1be547,_0x43fc30);}function getHeaders(_0x237357){return _[_0x518e('0x11')](_0x237357,function(_0x17ae1f){return{'text':_0x17ae1f,'style':'tableHeader'};});}function getRows(_0x1282a7,_0x457fa7){return _['map'](_0x457fa7,function(_0x3aeaaa){return _(_0x3aeaaa)[_0x518e('0x12')](_0x1282a7)[_0x518e('0x11')](function(_0x14f643){return _0x14f643?_[_0x518e('0x13')](_0x14f643):'';})['value']();});}function createTable(_0x3fb775,_0xeaf255){var _0x55fd2c={'widths':_[_0x518e('0x14')](Array(_0x3fb775[_0x518e('0x15')]),0x91),'heights':function(_0x5a07d2){return _0x5a07d2===0x0?_0x518e('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x107fd3=getHeaders(_0x3fb775);_0x55fd2c['body'][_0x518e('0x17')](_0x107fd3);var _0x213f44=getRows(_0x3fb775,_0xeaf255);_0x55fd2c[_0x518e('0x18')]=_0x55fd2c[_0x518e('0x18')][_0x518e('0x19')](_0x213f44);return _0x55fd2c;}function createTables(_0x37e279){var _0x44cc35=[];var _0x58a687=_[_0x518e('0x1a')](Object['keys'](_0x37e279[0x0]),0x5);_0x58a687[_0x518e('0x1b')](function(_0x112c80){_0x44cc35[_0x518e('0x17')](createTable(_0x112c80,_0x37e279));});return _0x44cc35;}function getPDFDocDefinition(_0x28c342){var _0xa796ac=util[_0x518e('0x1c')](_0x518e('0x1d'),NAME,EXTRACTED_REPORT[_0x518e('0x1e')],moment(EXTRACTED_REPORT[_0x518e('0x1f')])[_0x518e('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0x518e('0x20')])[_0x518e('0x1c')](FORMAT));var _0x38d5a4=[];for(var _0x3e1ec6=0x0;_0x3e1ec6<_0x28c342[_0x518e('0x15')];_0x3e1ec6++){var _0xe11cad=[];if(_0x3e1ec6===0x0){_0xe11cad[_0x518e('0x17')]({'text':_0xa796ac,'style':_0x518e('0x21')});}var _0x2e57f1={'table':_0x28c342[_0x3e1ec6]};if(_0x3e1ec6>0x0){_0x2e57f1[_0x518e('0x22')]=_0x518e('0x23');_0x2e57f1[_0x518e('0x24')]=[0x0,0x46,0x0,0x0];}_0xe11cad['push'](_0x2e57f1);_0x38d5a4[_0x518e('0x17')](_0xe11cad);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x38d5a4,'footer':function(_0xdd9eb2,_0xbbb863){return{'text':_0xdd9eb2[_0x518e('0x13')]()+_0x518e('0x25')+_0xbbb863,'style':_0x518e('0x26')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x518e('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1dd27e){var _0x2219cd=0x1388;var _0x44ecc3;if(!_0x1dd27e[0x0]['num']){return analyticExtractedReport('Empty');}return db[_0x518e('0x28')][_0x518e('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x518e('0x2a'),_0x518e('0x2b')]})[_0x518e('0x2c')](function(_0x100e8c){if(_0x100e8c){_0x44ecc3=_0x100e8c;_0x2219cd=_0x44ecc3[_0x518e('0x2b')]||0x3e8;}})[_0x518e('0x2c')](function(){var _0x571599=[];var _0x233d28=0x0;if(_0x44ecc3[_0x518e('0x2a')]){if(_0x1dd27e&&_0x1dd27e[_0x518e('0x15')]){var _0xd214ba=_[_0x518e('0x2d')](_0x1dd27e[0x0][_0x518e('0x2e')]/_0x2219cd);var _0x310c51=Number['isInteger'](_0x1dd27e[0x0][_0x518e('0x2e')]/_0x2219cd)?_0x1dd27e[0x0]['num']%_0x2219cd:0x0;_0xd214ba[_0x518e('0x1b')](function(_0x4eaf16){if(_0x4eaf16>0x0){_0x233d28+=_0x2219cd;}_0x571599['push'](dbH[_0x518e('0x2f')]['query'](util[_0x518e('0x1c')](_0x518e('0x30'),QUERY,_0x2219cd,_0x233d28),{'type':dbH[_0x518e('0x2f')][_0x518e('0x31')][_0x518e('0x32')]}));});if(_0x310c51>0x0){_0x233d28+=_0x2219cd;_0x571599[_0x518e('0x17')](dbH['sequelize'][_0x518e('0x33')](util[_0x518e('0x1c')](_0x518e('0x30'),QUERY,_0x310c51,_0x233d28),{'type':dbH['sequelize'][_0x518e('0x31')][_0x518e('0x32')]}));}}}else{_0x571599[_0x518e('0x17')](dbH[_0x518e('0x2f')][_0x518e('0x33')](QUERY,{'type':dbH[_0x518e('0x2f')][_0x518e('0x31')]['SELECT']}));}var _0x512d80=path[_0x518e('0x34')](PATH);var _0x482053=path[_0x518e('0x35')](PATH,_0x518e('0x36'));var _0x44bf87=_0x44ecc3[_0x518e('0x2a')]&&_0x571599[_0x518e('0x15')]>0x1;var _0x19ea16=[];if(!fs[_0x518e('0x37')](path[_0x518e('0x38')](_0x512d80,_0x482053))&&_0x44bf87){fs[_0x518e('0x39')](path[_0x518e('0x38')](_0x512d80,_0x482053));}return BPromise['each'](_0x571599,function(_0x26e6f9){_0x19ea16[_0x518e('0x17')](_0x26e6f9);})[_0x518e('0x2c')](function(){var _0x48952b=[];for(var _0x5243d2=0x0;_0x5243d2<_0x19ea16[_0x518e('0x15')];_0x5243d2+=0x1){var _0x18cb1c=_0x19ea16[_0x5243d2];var _0x4a9c84=createTables(_[_0x518e('0x3a')](_0x18cb1c));var _0x41971d;var _0x5d10f8=getPDFDocDefinition(_0x4a9c84);var _0x378f46=getPDFPrinter();var _0x4137a6=_0x378f46[_0x518e('0x3b')](_0x5d10f8);if(_0x44bf87){_0x41971d=path[_0x518e('0x38')](_0x512d80,_0x482053,util[_0x518e('0x1c')](_0x518e('0x3c'),_0x482053,_0x5243d2,_0x518e('0x3d')));}else{_0x41971d=path[_0x518e('0x38')](_0x512d80,util[_0x518e('0x1c')](_0x518e('0x3e'),_0x482053,_0x518e('0x3d')));}_0x48952b[_0x518e('0x17')](writePDFDocument(_0x4137a6,_0x41971d));}return Promise[_0x518e('0x3f')](_0x48952b);})[_0x518e('0x2c')](function(){if(_0x44bf87){return new Promise(function(_0xe46697){zipdir(path[_0x518e('0x38')](_0x512d80,_0x482053),{'saveTo':path[_0x518e('0x38')](_0x512d80,util[_0x518e('0x1c')](_0x518e('0x3e'),_0x482053,_0x518e('0x40')))},function(){rimraf(path[_0x518e('0x38')](_0x512d80,_0x482053),function(){});_0xe46697(_0x518e('0x41'));});});}})[_0x518e('0x2c')](function(){if(!_0x44bf87)return;rimraf(path[_0x518e('0x38')](_0x512d80,_0x482053),function(){});})[_0x518e('0x2c')](function(){logger['info'](util['format'](_0x518e('0x42'),EXTRACTED_REPORT_ID,_0x518e('0x43')));return analyticExtractedReport(_0x518e('0x44'),_0x44bf87?util[_0x518e('0x1c')](_0x518e('0x3e'),_0x482053,_0x44bf87?_0x518e('0x40'):_0x518e('0x3d')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x518e('0x1c')](_0x518e('0x45'),EXTRACTED_REPORT_ID,_0x518e('0x43')));return db['AnalyticExtractedReport']['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x518e('0x2c')](function(_0x6bc2a){EXTRACTED_REPORT=_0x6bc2a;return dbH[_0x518e('0x2f')][_0x518e('0x33')](util['format'](_0x518e('0x46'),QUERY),{'type':dbH[_0x518e('0x2f')][_0x518e('0x31')][_0x518e('0x32')]});})['then'](extractReport)[_0x518e('0x47')](function(_0x5dc1ba){logger['info'](util['format'](_0x518e('0x48'),EXTRACTED_REPORT_ID,_0x518e('0x43')),util['inspect'](_0x5dc1ba,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x518e('0x49')](function(){process[_0x518e('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x336a94=new PdfPrinter({'Arial':{'normal':__dirname+_0x518e('0x4b'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x518e('0x4c')}});return _0x336a94;}function getPDFDocDefinitionFromHTML(_0x2c7cbd,_0x26b88a){var _0x5d132e=util[_0x518e('0x1c')](_0x518e('0x4d'),_0x26b88a['channel'],_0x26b88a[_0x518e('0x4e')]);var _0x113c2e=moment()[_0x518e('0x1c')](_0x518e('0x4f'))['toString']();var _0x31a104=htmlToPdfmake(_0x2c7cbd,{'window':window,'tableAutoSize':!![]});return{'content':[_0x31a104],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x518e('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x518e('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x518e('0x50')}},'header':function(){return[{'text':_0x518e('0x51'),'style':_0x518e('0x21')}];},'footer':function(_0x40076d,_0x5cc838){return[{'text':util['format']('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x5d132e,_0x40076d,_0x5cc838,_0x113c2e),'style':_0x518e('0x26')}];}};}function writePDFDocument(_0x5ddad5,_0x3967d9){return new Promise(function(_0x24c4aa,_0x77b334){var _0x5ebe36=_0x5ddad5['pipe'](fs[_0x518e('0x52')](_0x3967d9));_0x5ebe36['on'](_0x518e('0x53'),function(){_0x24c4aa(_0x518e('0x53'));});_0x5ebe36['on'](_0x518e('0x54'),function(_0x8e7635){_0x77b334(_0x8e7635);});_0x5ddad5['end']();});}exports['createPdfFromHTML']=function(_0x5751cc,_0x3447bc){var _0x46a00e=getPDFPrinter();var _0x351117=getPDFDocDefinitionFromHTML(_0x5751cc,_0x3447bc);var _0x32d75a=_0x46a00e[_0x518e('0x3b')](_0x351117);return writePDFDocument(_0x32d75a,_0x3447bc['path'])[_0x518e('0x47')](function(_0x4efe57){throw _0x4efe57;});};
\ No newline at end of file
+var _0xfdb9=['findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','inspect','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','error','end','createPdfFromHTML','util','path','moment','html-to-pdfmake','rimraf','jsdom','JSDOM','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','length','auto','body','push','chunk','keys','forEach','format','name','startDate','endDate','header','pageBreak','before','landscape','toString','\x20/\x20','Arial','black','right','num','Empty','Setting','then','split','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','join','mkdirSync','flatten','createPdfKitDocument','pdf','%s.%s','all','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip'];(function(_0x5090e1,_0x58d194){var _0x53b80a=function(_0x50f029){while(--_0x50f029){_0x5090e1['push'](_0x5090e1['shift']());}};_0x53b80a(++_0x58d194);}(_0xfdb9,0xbe));var _0x9fdb=function(_0x51733c,_0x1a30d1){_0x51733c=_0x51733c-0x0;var _0x188f1a=_0xfdb9[_0x51733c];return _0x188f1a;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x9fdb('0x0'));var path=require(_0x9fdb('0x1'));var moment=require(_0x9fdb('0x2'));var htmlToPdfmake=require(_0x9fdb('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require(_0x9fdb('0x4'));var JSDOM=require(_0x9fdb('0x5'))[_0x9fdb('0x6')];var window=new JSDOM('')['window'];var BPromise=require(_0x9fdb('0x7'));var db=require(_0x9fdb('0x8'))['db'];var dbH=require('../../mysqldb')[_0x9fdb('0x9')];var logger=require(_0x9fdb('0xa'))(_0x9fdb('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0x9fdb('0xc')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x9fdb('0xc')][0x4];var NAME=process[_0x9fdb('0xc')][0x5];var FORMAT=_0x9fdb('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x273739,_0x1f3695){var _0xb4de8b={'status':_0x273739};var _0x3c7773={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1f3695){_0xb4de8b[_0x9fdb('0xe')]=_0x1f3695;}return db[_0x9fdb('0xf')][_0x9fdb('0x10')](_0xb4de8b,_0x3c7773);}function getHeaders(_0x2fda86){return _[_0x9fdb('0x11')](_0x2fda86,function(_0x46b4dc){return{'text':_0x46b4dc,'style':_0x9fdb('0x12')};});}function getRows(_0x252750,_0x3d1636){return _[_0x9fdb('0x11')](_0x3d1636,function(_0x2ded3f){return _(_0x2ded3f)['pick'](_0x252750)[_0x9fdb('0x11')](function(_0x301c6e){return _0x301c6e?_['toString'](_0x301c6e):'';})['value']();});}function createTable(_0x3319f0,_0x3a5cb6){var _0x28399f={'widths':_['fill'](Array(_0x3319f0[_0x9fdb('0x13')]),0x91),'heights':function(_0xa05099){return _0xa05099===0x0?_0x9fdb('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3461e0=getHeaders(_0x3319f0);_0x28399f[_0x9fdb('0x15')][_0x9fdb('0x16')](_0x3461e0);var _0x3d2247=getRows(_0x3319f0,_0x3a5cb6);_0x28399f[_0x9fdb('0x15')]=_0x28399f[_0x9fdb('0x15')]['concat'](_0x3d2247);return _0x28399f;}function createTables(_0x577140){var _0x2af5b6=[];var _0x13e16d=_[_0x9fdb('0x17')](Object[_0x9fdb('0x18')](_0x577140[0x0]),0x5);_0x13e16d[_0x9fdb('0x19')](function(_0x1d1c23){_0x2af5b6['push'](createTable(_0x1d1c23,_0x577140));});return _0x2af5b6;}function getPDFDocDefinition(_0x2136b3){var _0x4f458d=util[_0x9fdb('0x1a')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x9fdb('0x1b')],moment(EXTRACTED_REPORT[_0x9fdb('0x1c')])[_0x9fdb('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0x9fdb('0x1d')])[_0x9fdb('0x1a')](FORMAT));var _0x5ce824=[];for(var _0x536d0d=0x0;_0x536d0d<_0x2136b3[_0x9fdb('0x13')];_0x536d0d++){var _0x3e8bf7=[];if(_0x536d0d===0x0){_0x3e8bf7[_0x9fdb('0x16')]({'text':_0x4f458d,'style':_0x9fdb('0x1e')});}var _0x265cfc={'table':_0x2136b3[_0x536d0d]};if(_0x536d0d>0x0){_0x265cfc[_0x9fdb('0x1f')]=_0x9fdb('0x20');_0x265cfc['margin']=[0x0,0x46,0x0,0x0];}_0x3e8bf7['push'](_0x265cfc);_0x5ce824[_0x9fdb('0x16')](_0x3e8bf7);}return{'pageSize':'A4','pageOrientation':_0x9fdb('0x21'),'content':_0x5ce824,'footer':function(_0x4f74b5,_0x28060e){return{'text':_0x4f74b5[_0x9fdb('0x22')]()+_0x9fdb('0x23')+_0x28060e,'style':'footer'};},'defaultStyle':{'font':_0x9fdb('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x9fdb('0x25')},'footer':{'alignment':_0x9fdb('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x35145f){var _0x3e6fde=0x1388;var _0x3130e7;if(!_0x35145f[0x0][_0x9fdb('0x27')]){return analyticExtractedReport(_0x9fdb('0x28'));}return db[_0x9fdb('0x29')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})['then'](function(_0x52a231){if(_0x52a231){_0x3130e7=_0x52a231;_0x3e6fde=_0x3130e7['splitSizePdf']||0x3e8;}})[_0x9fdb('0x2a')](function(){var _0x3c46fa=[];var _0x13817c=0x0;if(_0x3130e7[_0x9fdb('0x2b')]){if(_0x35145f&&_0x35145f[_0x9fdb('0x13')]){var _0x5c0b97=_['range'](_0x35145f[0x0][_0x9fdb('0x27')]/_0x3e6fde);var _0x454fe4=Number[_0x9fdb('0x2c')](_0x35145f[0x0]['num']/_0x3e6fde)?_0x35145f[0x0][_0x9fdb('0x27')]%_0x3e6fde:0x0;_0x5c0b97['forEach'](function(_0x4d0670){if(_0x4d0670>0x0){_0x13817c+=_0x3e6fde;}_0x3c46fa[_0x9fdb('0x16')](dbH[_0x9fdb('0x2d')][_0x9fdb('0x2e')](util[_0x9fdb('0x1a')](_0x9fdb('0x2f'),QUERY,_0x3e6fde,_0x13817c),{'type':dbH[_0x9fdb('0x2d')][_0x9fdb('0x30')][_0x9fdb('0x31')]}));});if(_0x454fe4>0x0){_0x13817c+=_0x3e6fde;_0x3c46fa[_0x9fdb('0x16')](dbH[_0x9fdb('0x2d')][_0x9fdb('0x2e')](util['format'](_0x9fdb('0x2f'),QUERY,_0x454fe4,_0x13817c),{'type':dbH[_0x9fdb('0x2d')][_0x9fdb('0x30')][_0x9fdb('0x31')]}));}}}else{_0x3c46fa['push'](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x9fdb('0x2d')][_0x9fdb('0x30')][_0x9fdb('0x31')]}));}var _0x1a41d0=path[_0x9fdb('0x32')](PATH);var _0x1fe89d=path[_0x9fdb('0x33')](PATH,_0x9fdb('0x34'));var _0x4feca2=_0x3130e7[_0x9fdb('0x2b')]&&_0x3c46fa[_0x9fdb('0x13')]>0x1;var _0x3e284f=[];if(!fs[_0x9fdb('0x35')](path[_0x9fdb('0x36')](_0x1a41d0,_0x1fe89d))&&_0x4feca2){fs[_0x9fdb('0x37')](path[_0x9fdb('0x36')](_0x1a41d0,_0x1fe89d));}return BPromise['each'](_0x3c46fa,function(_0x5c60f4){_0x3e284f[_0x9fdb('0x16')](_0x5c60f4);})[_0x9fdb('0x2a')](function(){var _0x511940=[];for(var _0xae1594=0x0;_0xae1594<_0x3e284f[_0x9fdb('0x13')];_0xae1594+=0x1){var _0x3f0a4e=_0x3e284f[_0xae1594];var _0x1f276f=createTables(_[_0x9fdb('0x38')](_0x3f0a4e));var _0x2c6eda;var _0x4a54c2=getPDFDocDefinition(_0x1f276f);var _0x87780=getPDFPrinter();var _0x385e71=_0x87780[_0x9fdb('0x39')](_0x4a54c2);if(_0x4feca2){_0x2c6eda=path['join'](_0x1a41d0,_0x1fe89d,util[_0x9fdb('0x1a')]('%s%d.%s',_0x1fe89d,_0xae1594,_0x9fdb('0x3a')));}else{_0x2c6eda=path[_0x9fdb('0x36')](_0x1a41d0,util[_0x9fdb('0x1a')](_0x9fdb('0x3b'),_0x1fe89d,'pdf'));}_0x511940[_0x9fdb('0x16')](writePDFDocument(_0x385e71,_0x2c6eda));}return Promise[_0x9fdb('0x3c')](_0x511940);})[_0x9fdb('0x2a')](function(){if(_0x4feca2){return new Promise(function(_0xcf2727){zipdir(path['join'](_0x1a41d0,_0x1fe89d),{'saveTo':path[_0x9fdb('0x36')](_0x1a41d0,util[_0x9fdb('0x1a')]('%s.%s',_0x1fe89d,'zip'))},function(){rimraf(path[_0x9fdb('0x36')](_0x1a41d0,_0x1fe89d),function(){});_0xcf2727('zip\x20finished');});});}})[_0x9fdb('0x2a')](function(){if(!_0x4feca2)return;rimraf(path[_0x9fdb('0x36')](_0x1a41d0,_0x1fe89d),function(){});})[_0x9fdb('0x2a')](function(){logger[_0x9fdb('0x3d')](util['format'](_0x9fdb('0x3e'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x9fdb('0x3f'),_0x4feca2?util['format']('%s.%s',_0x1fe89d,_0x4feca2?_0x9fdb('0x40'):_0x9fdb('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x9fdb('0x3d')](util[_0x9fdb('0x1a')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport'][_0x9fdb('0x41')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x9fdb('0x2a')](function(_0x272ed4){EXTRACTED_REPORT=_0x272ed4;return dbH[_0x9fdb('0x2d')][_0x9fdb('0x2e')](util[_0x9fdb('0x1a')](_0x9fdb('0x42'),QUERY),{'type':dbH[_0x9fdb('0x2d')][_0x9fdb('0x30')][_0x9fdb('0x31')]});})[_0x9fdb('0x2a')](extractReport)[_0x9fdb('0x43')](function(_0x56b9ea){logger[_0x9fdb('0x3d')](util[_0x9fdb('0x1a')](_0x9fdb('0x44'),EXTRACTED_REPORT_ID,_0x9fdb('0x45')),util[_0x9fdb('0x46')](_0x56b9ea,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9fdb('0x47'));})[_0x9fdb('0x48')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5a4b3a=new PdfPrinter({'Arial':{'normal':__dirname+_0x9fdb('0x49'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x9fdb('0x4a')}});return _0x5a4b3a;}function getPDFDocDefinitionFromHTML(_0x5ba531,_0x36959b){var _0x5f2382=util[_0x9fdb('0x1a')](_0x9fdb('0x4b'),_0x36959b[_0x9fdb('0x4c')],_0x36959b['interactionId']);var _0x57c04b=moment()[_0x9fdb('0x1a')](_0x9fdb('0x4d'))[_0x9fdb('0x22')]();var _0x58a68c=htmlToPdfmake(_0x5ba531,{'window':window,'tableAutoSize':!![]});return{'content':[_0x58a68c],'defaultStyle':{'font':_0x9fdb('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x9fdb('0x4e'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x9fdb('0x4e'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x9fdb('0x4e')}},'header':function(){return[{'text':_0x9fdb('0x4f'),'style':_0x9fdb('0x1e')}];},'footer':function(_0x575813,_0x1dbaef){return[{'text':util[_0x9fdb('0x1a')](_0x9fdb('0x50'),_0x5f2382,_0x575813,_0x1dbaef,_0x57c04b),'style':'footer'}];}};}function writePDFDocument(_0x9361af,_0x355b3c){return new Promise(function(_0x3e6e6d,_0x48d9d2){var _0x2b1b70=_0x9361af[_0x9fdb('0x51')](fs['createWriteStream'](_0x355b3c));_0x2b1b70['on']('finish',function(){_0x3e6e6d('finish');});_0x2b1b70['on'](_0x9fdb('0x52'),function(_0x29be16){_0x48d9d2(_0x29be16);});_0x9361af[_0x9fdb('0x53')]();});}exports[_0x9fdb('0x54')]=function(_0x409924,_0x4c404c){var _0x206702=getPDFPrinter();var _0x2a8fd4=getPDFDocDefinitionFromHTML(_0x409924,_0x4c404c);var _0x5ea502=_0x206702[_0x9fdb('0x39')](_0x2a8fd4);return writePDFDocument(_0x5ea502,_0x4c404c['path'])[_0x9fdb('0x43')](function(_0x181048){throw _0x181048;});};
\ No newline at end of file
index 560b847..0db1991 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa264=['../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','split','splitSizeXlsx','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','query','basename','length','existsSync','join','mkdirSync','%s%d.%s','xlsx','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Failed','finally','exit','util','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa264,0x148));var _0x4a26=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xa264[_0x432fca];return _0x3adba4;};'use strict';var util=require(_0x4a26('0x0'));var path=require('path');var _=require(_0x4a26('0x1'));var fs=require('fs');var json2xls=require(_0x4a26('0x2'));var BPromise=require(_0x4a26('0x3'));var zipdir=require(_0x4a26('0x4'));var rimraf=require(_0x4a26('0x5'));var db=require(_0x4a26('0x6'))['db'];var dbH=require('../../mysqldb')[_0x4a26('0x7')];var logger=require(_0x4a26('0x8'))(_0x4a26('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x4a26('0xa')][0x2]);var QUERY=process[_0x4a26('0xa')][0x3];var PATH=process[_0x4a26('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2758c1,_0x5f3886){var _0x6c431b={'status':_0x2758c1};var _0x5202dd={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5f3886){_0x6c431b[_0x4a26('0xb')]=_0x5f3886;}return db[_0x4a26('0xc')]['update'](_0x6c431b,_0x5202dd);}function main(){var _0x4a3aa9=0x1388;var _0x1c2828;logger[_0x4a26('0xd')](util[_0x4a26('0xe')](_0x4a26('0xf'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x4a26('0x10')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x4a26('0x11'),_0x4a26('0x12')]})['then'](function(_0x168bee){if(_0x168bee){_0x1c2828=_0x168bee;_0x4a3aa9=_0x1c2828[_0x4a26('0x12')]||0x1388;}})[_0x4a26('0x13')](function(){return dbH[_0x4a26('0x14')]['query'](util[_0x4a26('0xe')](_0x4a26('0x15'),QUERY),{'type':dbH['sequelize'][_0x4a26('0x16')][_0x4a26('0x17')]});})[_0x4a26('0x13')](function(_0x438eb0){if(!_0x438eb0[0x0]['num']){return analyticExtractedReport('Empty');}var _0x16a69a=[];var _0x1beba9=0x0;if(_0x1c2828[_0x4a26('0x11')]){if(_0x438eb0&&_0x438eb0['length']){var _0x5573c5=_['range'](_0x438eb0[0x0][_0x4a26('0x18')]/_0x4a3aa9);var _0x5c8b0f=Number[_0x4a26('0x19')](_0x438eb0[0x0]['num']/_0x4a3aa9)?_0x438eb0[0x0][_0x4a26('0x18')]%_0x4a3aa9:0x0;_0x5573c5[_0x4a26('0x1a')](function(_0xabc2f){if(_0xabc2f>0x0){_0x1beba9+=_0x4a3aa9;}_0x16a69a[_0x4a26('0x1b')](dbH['sequelize']['query'](util['format'](_0x4a26('0x1c'),QUERY,_0x4a3aa9,_0x1beba9),{'type':dbH[_0x4a26('0x14')][_0x4a26('0x16')][_0x4a26('0x17')]}));});if(_0x5c8b0f>0x0){_0x1beba9+=_0x4a3aa9;_0x16a69a[_0x4a26('0x1b')](dbH[_0x4a26('0x14')][_0x4a26('0x1d')](util[_0x4a26('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5c8b0f,_0x1beba9),{'type':dbH[_0x4a26('0x14')][_0x4a26('0x16')][_0x4a26('0x17')]}));}}}else{_0x16a69a['push'](dbH[_0x4a26('0x14')][_0x4a26('0x1d')](QUERY,{'type':dbH['sequelize'][_0x4a26('0x16')][_0x4a26('0x17')]}));}var _0x346c89=path['dirname'](PATH);var _0x59a021=path[_0x4a26('0x1e')](PATH,'.xlsx');var _0x348e29=_0x1c2828[_0x4a26('0x11')]&&_0x16a69a[_0x4a26('0x1f')]>0x1;var _0x2e68ec=[];if(!fs[_0x4a26('0x20')](path[_0x4a26('0x21')](_0x346c89,_0x59a021))&&_0x348e29){fs[_0x4a26('0x22')](path['join'](_0x346c89,_0x59a021));}return BPromise['each'](_0x16a69a,function(_0x30874d){_0x2e68ec['push'](_0x30874d);})['then'](function(){for(var _0x470389=0x0;_0x470389<_0x2e68ec[_0x4a26('0x1f')];_0x470389+=0x1){var _0x45f9d4;var _0x207941=_0x2e68ec[_0x470389];if(_0x348e29){_0x45f9d4=path[_0x4a26('0x21')](_0x346c89,_0x59a021,util[_0x4a26('0xe')](_0x4a26('0x23'),_0x59a021,_0x470389,_0x4a26('0x24')));}else{_0x45f9d4=path['join'](_0x346c89,util[_0x4a26('0xe')](_0x4a26('0x25'),_0x59a021,_0x4a26('0x24')));}fs[_0x4a26('0x26')](_0x45f9d4,json2xls(_0x207941),'binary');}})[_0x4a26('0x13')](function(){if(_0x348e29){return new Promise(function(_0x5505ff){zipdir(path[_0x4a26('0x21')](_0x346c89,_0x59a021),{'saveTo':path['join'](_0x346c89,util[_0x4a26('0xe')](_0x4a26('0x25'),_0x59a021,_0x4a26('0x27')))},function(_0x59d914,_0x23fde4){rimraf(path[_0x4a26('0x21')](_0x346c89,_0x59a021),function(){});_0x5505ff(_0x4a26('0x28'));});});}})['then'](function(){logger[_0x4a26('0xd')](util[_0x4a26('0xe')](_0x4a26('0x29'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x4a26('0x2a'),_0x348e29?util[_0x4a26('0xe')](_0x4a26('0x25'),_0x59a021,_0x348e29?_0x4a26('0x27'):_0x4a26('0x24')):null);});})['catch'](function(_0x40db11){logger['info'](util[_0x4a26('0xe')](_0x4a26('0x2b'),EXTRACTED_REPORT_ID,_0x4a26('0x2c')),util['inspect'](_0x40db11,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x4a26('0x2d'));})[_0x4a26('0x2e')](function(){process[_0x4a26('0x2f')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0xdadd=['Failed','finally','exit','util','path','json2xls','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','then','splitSizeXlsx','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.xlsx','existsSync','join','each','%s%d.%s','%s.%s','xlsx','binary','zip','zip\x20finished','XLSX','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect'];(function(_0x2fade5,_0x5d720f){var _0x4ebf9e=function(_0x432730){while(--_0x432730){_0x2fade5['push'](_0x2fade5['shift']());}};_0x4ebf9e(++_0x5d720f);}(_0xdadd,0x18b));var _0xddad=function(_0x169585,_0x476cc6){_0x169585=_0x169585-0x0;var _0x5cf666=_0xdadd[_0x169585];return _0x5cf666;};'use strict';var util=require(_0xddad('0x0'));var path=require(_0xddad('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0xddad('0x2'));var BPromise=require(_0xddad('0x3'));var zipdir=require(_0xddad('0x4'));var rimraf=require('rimraf');var db=require(_0xddad('0x5'))['db'];var dbH=require('../../mysqldb')[_0xddad('0x6')];var logger=require(_0xddad('0x7'))(_0xddad('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xddad('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xdfdb42,_0x939d9e){var _0x18e403={'status':_0xdfdb42};var _0x5777a5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x939d9e){_0x18e403['savename']=_0x939d9e;}return db[_0xddad('0xa')][_0xddad('0xb')](_0x18e403,_0x5777a5);}function main(){var _0x4c49e2=0x1388;var _0x2a3fe7;logger[_0xddad('0xc')](util[_0xddad('0xd')](_0xddad('0xe'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xddad('0xf')][_0xddad('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xddad('0x11'),'splitSizeXlsx']})[_0xddad('0x12')](function(_0x1fd47c){if(_0x1fd47c){_0x2a3fe7=_0x1fd47c;_0x4c49e2=_0x2a3fe7[_0xddad('0x13')]||0x1388;}})[_0xddad('0x12')](function(){return dbH[_0xddad('0x14')][_0xddad('0x15')](util[_0xddad('0xd')](_0xddad('0x16'),QUERY),{'type':dbH[_0xddad('0x14')]['QueryTypes'][_0xddad('0x17')]});})['then'](function(_0x1a7660){if(!_0x1a7660[0x0][_0xddad('0x18')]){return analyticExtractedReport('Empty');}var _0x23218a=[];var _0x2aea31=0x0;if(_0x2a3fe7[_0xddad('0x11')]){if(_0x1a7660&&_0x1a7660['length']){var _0xde603c=_[_0xddad('0x19')](_0x1a7660[0x0][_0xddad('0x18')]/_0x4c49e2);var _0x2c1702=Number['isInteger'](_0x1a7660[0x0][_0xddad('0x18')]/_0x4c49e2)?_0x1a7660[0x0]['num']%_0x4c49e2:0x0;_0xde603c[_0xddad('0x1a')](function(_0x12e205){if(_0x12e205>0x0){_0x2aea31+=_0x4c49e2;}_0x23218a[_0xddad('0x1b')](dbH['sequelize'][_0xddad('0x15')](util[_0xddad('0xd')](_0xddad('0x1c'),QUERY,_0x4c49e2,_0x2aea31),{'type':dbH[_0xddad('0x14')][_0xddad('0x1d')][_0xddad('0x17')]}));});if(_0x2c1702>0x0){_0x2aea31+=_0x4c49e2;_0x23218a[_0xddad('0x1b')](dbH['sequelize']['query'](util['format'](_0xddad('0x1c'),QUERY,_0x2c1702,_0x2aea31),{'type':dbH[_0xddad('0x14')][_0xddad('0x1d')][_0xddad('0x17')]}));}}}else{_0x23218a[_0xddad('0x1b')](dbH[_0xddad('0x14')][_0xddad('0x15')](QUERY,{'type':dbH[_0xddad('0x14')][_0xddad('0x1d')][_0xddad('0x17')]}));}var _0x2327b0=path[_0xddad('0x1e')](PATH);var _0x5635e1=path[_0xddad('0x1f')](PATH,_0xddad('0x20'));var _0x371e5f=_0x2a3fe7[_0xddad('0x11')]&&_0x23218a['length']>0x1;var _0x4920bf=[];if(!fs[_0xddad('0x21')](path[_0xddad('0x22')](_0x2327b0,_0x5635e1))&&_0x371e5f){fs['mkdirSync'](path['join'](_0x2327b0,_0x5635e1));}return BPromise[_0xddad('0x23')](_0x23218a,function(_0x220786){_0x4920bf[_0xddad('0x1b')](_0x220786);})['then'](function(){for(var _0x237169=0x0;_0x237169<_0x4920bf['length'];_0x237169+=0x1){var _0x1276db;var _0x92a3ba=_0x4920bf[_0x237169];if(_0x371e5f){_0x1276db=path[_0xddad('0x22')](_0x2327b0,_0x5635e1,util[_0xddad('0xd')](_0xddad('0x24'),_0x5635e1,_0x237169,'xlsx'));}else{_0x1276db=path[_0xddad('0x22')](_0x2327b0,util['format'](_0xddad('0x25'),_0x5635e1,_0xddad('0x26')));}fs['writeFileSync'](_0x1276db,json2xls(_0x92a3ba),_0xddad('0x27'));}})['then'](function(){if(_0x371e5f){return new Promise(function(_0x5381e4){zipdir(path['join'](_0x2327b0,_0x5635e1),{'saveTo':path[_0xddad('0x22')](_0x2327b0,util[_0xddad('0xd')](_0xddad('0x25'),_0x5635e1,_0xddad('0x28')))},function(_0x1764b8,_0x586ae7){rimraf(path['join'](_0x2327b0,_0x5635e1),function(){});_0x5381e4(_0xddad('0x29'));});});}})[_0xddad('0x12')](function(){logger[_0xddad('0xc')](util[_0xddad('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xddad('0x2a')));return analyticExtractedReport('Completed',_0x371e5f?util[_0xddad('0xd')](_0xddad('0x25'),_0x5635e1,_0x371e5f?'zip':_0xddad('0x26')):null);});})[_0xddad('0x2b')](function(_0x4e89c5){logger[_0xddad('0xc')](util[_0xddad('0xd')](_0xddad('0x2c'),EXTRACTED_REPORT_ID,_0xddad('0x2a')),util[_0xddad('0x2d')](_0x4e89c5,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xddad('0x2e'));})[_0xddad('0x2f')](function(){process[_0xddad('0x30')](EXIT_CODE);});}main();
\ No newline at end of file
index f1ba5a5..caa6d45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7998=['exten','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','cutdigits','${EXTEN}','ExecIf','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','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','tag','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','Interval','then','intervals','VoiceExtension','findAll','IntervalId','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter'];(function(_0x10691e,_0xe5265){var _0x30ce27=function(_0x53b8d3){while(--_0x53b8d3){_0x10691e['push'](_0x10691e['shift']());}};_0x30ce27(++_0xe5265);}(_0x7998,0x15b));var _0x8799=function(_0x361b8c,_0x1caf39){_0x361b8c=_0x361b8c-0x0;var _0x3faa41=_0x7998[_0x361b8c];return _0x3faa41;};'use strict';var _=require(_0x8799('0x0'));var util=require(_0x8799('0x1'));function rewrite(_0x4a3094,_0x1d65c2){var _0x9b0687=this;return _0x4a3094[_0x8799('0x2')][_0x8799('0x3')]['findAll']({'raw':!![]})[_0x8799('0x4')](function(_0x18372b){_0x9b0687[_0x8799('0x5')]=_0x18372b;return _0x4a3094[_0x8799('0x2')][_0x8799('0x6')][_0x8799('0x7')]({'where':{'IntervalId':_0x1d65c2[_0x8799('0x8')]},'raw':!![]});})[_0x8799('0x4')](function(_0x57aefc){return _0x4a3094[_0x8799('0x2')]['VoiceExtension']['findAll']({'where':{'exten':{'$in':_[_0x8799('0x9')](_[_0x8799('0xa')](_0x57aefc,'exten'))}},'order':[{'raw':_0x8799('0xb')}],'raw':!![]});})[_0x8799('0x4')](function(_0x59f7a7){var _0x4e33a1=_['filter'](_0x59f7a7,{'priority':'1'});var _0x1147be=_[_0x8799('0xc')](_0x59f7a7,{'isApp':0x1});var _0x4a5131=_['groupBy'](_0x1147be,_0x8799('0xd'));var _0x2364c8=[_0x8799('0xe'),_0x8799('0xf')];var _0x5ebf93=[];var _0x3fbfb2=[];for(var _0x76e468 in _0x4a5131){if(_0x4a5131[_0x8799('0x10')](_0x76e468)){_0x9b0687[_0x8799('0x11')]=0x2;_0x9b0687[_0x8799('0x12')]=[];_0x9b0687[_0x8799('0x13')]=_[_0x8799('0x14')](_0x4e33a1,{'exten':_0x4a5131[_0x76e468][0x0][_0x8799('0xd')]});_0x9b0687[_0x8799('0x12')][_0x8799('0x15')]({'type':_0x4a5131[_0x76e468][0x0][_0x8799('0x16')],'app':_0x8799('0x17'),'appdata':util[_0x8799('0x18')](_0x8799('0x19'),_0x4a5131[_0x76e468][0x0]['type']),'context':_0x4a5131[_0x76e468][0x0][_0x8799('0x1a')],'exten':_0x4a5131[_0x76e468][0x0][_0x8799('0xd')],'priority':_0x9b0687[_0x8799('0x11')]++,'VoiceExtensionId':_0x4a5131[_0x76e468][0x0][_0x8799('0x1b')]});if(_0x4a5131[_0x76e468][0x0][_0x8799('0x16')]===_0x8799('0x1c')){_0x9b0687[_0x8799('0x12')]['push']({'type':_0x4a5131[_0x76e468][0x0][_0x8799('0x16')],'app':_0x8799('0x17'),'appdata':_0x8799('0x1d')+_0x4a5131[_0x76e468][0x0][_0x8799('0x1b')],'context':_0x4a5131[_0x76e468][0x0]['context'],'exten':_0x4a5131[_0x76e468][0x0][_0x8799('0xd')],'priority':_0x9b0687[_0x8799('0x11')]++,'VoiceExtensionId':_0x4a5131[_0x76e468][0x0]['VoiceExtensionId']});}else if(_0x4a5131[_0x76e468][0x0][_0x8799('0x16')]===_0x8799('0x1e')){if(_0x9b0687[_0x8799('0x13')]){_0x9b0687[_0x8799('0x12')]['push']({'type':_0x4a5131[_0x76e468][0x0][_0x8799('0x16')],'app':_0x8799('0x17'),'appdata':'CDR(destination)='+(_0x9b0687[_0x8799('0x13')][_0x8799('0x1f')]?'${EXTEN:'+_0x9b0687['extension']['cutdigits']+'}':_0x8799('0x20')),'context':_0x4a5131[_0x76e468][0x0][_0x8799('0x1a')],'exten':_0x4a5131[_0x76e468][0x0][_0x8799('0xd')],'priority':_0x9b0687['priority']++,'VoiceExtensionId':_0x4a5131[_0x76e468][0x0][_0x8799('0x1b')]});}_0x9b0687[_0x8799('0x12')][_0x8799('0x15')]({'type':_0x4a5131[_0x76e468][0x0][_0x8799('0x16')],'app':_0x8799('0x17'),'appdata':_0x8799('0x1d')+_0x4a5131[_0x76e468][0x0][_0x8799('0x1b')],'context':_0x4a5131[_0x76e468][0x0][_0x8799('0x1a')],'exten':_0x4a5131[_0x76e468][0x0][_0x8799('0xd')],'priority':_0x9b0687['priority']++,'VoiceExtensionId':_0x4a5131[_0x76e468][0x0]['VoiceExtensionId']});var _0x1628b7=_0x9b0687[_0x8799('0x11')]++;_0x9b0687[_0x8799('0x12')][_0x8799('0x15')]({'type':_0x4a5131[_0x76e468][0x0]['type'],'app':_0x8799('0x21'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x1628b7+0x2)+'):Goto('+(_0x1628b7+0x1)+')','context':_0x4a5131[_0x76e468][0x0][_0x8799('0x1a')],'exten':_0x4a5131[_0x76e468][0x0][_0x8799('0xd')],'priority':_0x1628b7,'VoiceExtensionId':_0x4a5131[_0x76e468][0x0][_0x8799('0x1b')]});if(_0x9b0687[_0x8799('0x13')]){_0x9b0687['extensions'][_0x8799('0x15')]({'type':_0x4a5131[_0x76e468][0x0][_0x8799('0x16')],'app':_0x8799('0x17'),'appdata':_0x9b0687[_0x8799('0x13')]['cutdigits']?_0x8799('0x22')+_0x9b0687['extension']['cutdigits']+'}':_0x8799('0x23'),'context':_0x4a5131[_0x76e468][0x0][_0x8799('0x1a')],'exten':_0x4a5131[_0x76e468][0x0]['exten'],'priority':_0x9b0687[_0x8799('0x11')]++,'VoiceExtensionId':_0x4a5131[_0x76e468][0x0]['VoiceExtensionId']});}_0x9b0687[_0x8799('0x12')][_0x8799('0x15')]({'type':_0x4a5131[_0x76e468][0x0][_0x8799('0x16')],'app':'Set','appdata':_0x8799('0x24')+_0x4a5131[_0x76e468][0x0][_0x8799('0x1b')],'context':_0x4a5131[_0x76e468][0x0]['context'],'exten':_0x4a5131[_0x76e468][0x0]['exten'],'priority':_0x9b0687['priority']++,'VoiceExtensionId':_0x4a5131[_0x76e468][0x0][_0x8799('0x1b')]});if(_0x9b0687[_0x8799('0x13')]&&_0x9b0687['extension'][_0x8799('0x10')](_0x8799('0x25'))&&_0x9b0687[_0x8799('0x13')]['recordingFormat']!==_0x8799('0x26')){_0x9b0687['extensions'][_0x8799('0x15')]({'type':_0x4a5131[_0x76e468][0x0]['type'],'app':_0x8799('0x17'),'appdata':_0x8799('0x27'),'context':_0x4a5131[_0x76e468][0x0][_0x8799('0x1a')],'exten':_0x4a5131[_0x76e468][0x0][_0x8799('0xd')],'priority':_0x9b0687[_0x8799('0x11')]++,'VoiceExtensionId':_0x4a5131[_0x76e468][0x0]['VoiceExtensionId']});_0x9b0687[_0x8799('0x12')]['push']({'type':_0x4a5131[_0x76e468][0x0][_0x8799('0x16')],'app':_0x8799('0x17'),'appdata':_0x8799('0x28')+_0x9b0687[_0x8799('0x13')]['recordingFormat']||_0x8799('0x29'),'context':_0x4a5131[_0x76e468][0x0][_0x8799('0x1a')],'exten':_0x4a5131[_0x76e468][0x0]['exten'],'priority':_0x9b0687['priority']++,'VoiceExtensionId':_0x4a5131[_0x76e468][0x0]['VoiceExtensionId']});}}_0x9b0687[_0x8799('0x12')][_0x8799('0x15')]({'type':_0x4a5131[_0x76e468][0x0][_0x8799('0x16')],'app':_0x8799('0x17'),'appdata':_0x8799('0x2a'),'context':_0x4a5131[_0x76e468][0x0]['context'],'exten':_0x4a5131[_0x76e468][0x0]['exten'],'priority':_0x9b0687[_0x8799('0x11')]++,'VoiceExtensionId':_0x4a5131[_0x76e468][0x0][_0x8799('0x1b')]});_0x9b0687[_0x8799('0x12')][_0x8799('0x15')]({'type':_0x4a5131[_0x76e468][0x0]['type'],'app':'Set','appdata':_0x8799('0x2b'),'context':_0x4a5131[_0x76e468][0x0]['context'],'exten':_0x4a5131[_0x76e468][0x0][_0x8799('0xd')],'priority':_0x9b0687['priority']++,'VoiceExtensionId':_0x4a5131[_0x76e468][0x0][_0x8799('0x1b')]});_0x9b0687['extensions'][_0x8799('0x15')]({'type':_0x4a5131[_0x76e468][0x0]['type'],'app':_0x8799('0x17'),'appdata':_0x8799('0x2c'),'context':_0x4a5131[_0x76e468][0x0][_0x8799('0x1a')],'exten':_0x4a5131[_0x76e468][0x0][_0x8799('0xd')],'priority':_0x9b0687['priority']++,'VoiceExtensionId':_0x4a5131[_0x76e468][0x0][_0x8799('0x1b')]});for(var _0x47a6ed=0x0,_0x3e92a4=0x0;_0x47a6ed<_0x4a5131[_0x76e468]['length'];_0x47a6ed+=0x1,_0x3e92a4=0x0){var _0x2a2181=_0x4a5131[_0x76e468][_0x47a6ed];if(_0x2a2181[_0x8799('0x16')]){_0x2a2181[_0x8799('0x16')]=_0x2a2181['type'][_0x8799('0x2d')]();}var _0x4f9c87=[];var _0xae1078=[];delete _0x2a2181['id'];delete _0x2a2181[_0x8799('0x2e')];delete _0x2a2181[_0x8799('0x2f')];var _0x61dea=_0x2a2181[_0x8799('0x30')]!=='*,*,*,*'?[_0x2a2181[_0x8799('0x30')]]:_0x2a2181[_0x8799('0x8')]?_[_0x8799('0xa')](_[_0x8799('0xc')](_0x9b0687[_0x8799('0x5')],{'IntervalId':_0x2a2181['IntervalId']}),_0x8799('0x30')):[];if(_0x2a2181[_0x8799('0x10')]('tag')){if(_0x2a2181[_0x8799('0x31')]&&_0x2a2181[_0x8799('0x31')]!=='--'){_0x4f9c87[_0x8799('0x15')]({'type':_0x2a2181[_0x8799('0x16')],'app':'Set','appdata':'CDR(tag)='+_0x2a2181[_0x8799('0x31')],'context':_0x2a2181['context'],'exten':_0x2a2181['exten'],'priority':_0x61dea[_0x8799('0x32')]+_0x9b0687[_0x8799('0x11')]+_0x3e92a4++,'VoiceExtensionId':_0x2a2181['VoiceExtensionId']});}}if(_0x2a2181[_0x8799('0x16')]===_0x8799('0x1e')&&_0x2a2181['hasOwnProperty'](_0x8799('0x33'))){if(_0x2a2181['callerID']){_0x4f9c87[_0x8799('0x15')]({'type':_0x2a2181['type'],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x2a2181[_0x8799('0x33')]+')','context':_0x2a2181[_0x8799('0x1a')],'exten':_0x2a2181[_0x8799('0xd')],'priority':_0x61dea[_0x8799('0x32')]+_0x9b0687[_0x8799('0x11')]+_0x3e92a4++,'VoiceExtensionId':_0x2a2181['VoiceExtensionId']});}else{_0x4f9c87[_0x8799('0x15')]({'type':_0x2a2181[_0x8799('0x16')],'app':'ExecIf','appdata':_0x8799('0x34'),'context':_0x2a2181['context'],'exten':_0x2a2181[_0x8799('0xd')],'priority':_0x61dea[_0x8799('0x32')]+_0x9b0687[_0x8799('0x11')]+_0x3e92a4++,'VoiceExtensionId':_0x2a2181[_0x8799('0x1b')]});}}if(_0x2a2181[_0x8799('0x10')](_0x8799('0x35'))){if(_0x2364c8[_0x8799('0x36')](_0x2a2181[_0x8799('0x37')][_0x8799('0x2d')]())>=0x0&&_0x2a2181['appType']!==_0x8799('0x38')){if(_0x2a2181[_0x8799('0x35')]){_0x4f9c87[_0x8799('0x15')]({'type':_0x2a2181['type'],'app':_0x8799('0x21'),'appdata':_0x8799('0x39'),'context':_0x2a2181[_0x8799('0x1a')],'exten':_0x2a2181[_0x8799('0xd')],'priority':_0x61dea[_0x8799('0x32')]+_0x9b0687[_0x8799('0x11')]+_0x3e92a4++,'VoiceExtensionId':_0x2a2181[_0x8799('0x1b')]});_0x4f9c87[_0x8799('0x15')]({'type':_0x2a2181[_0x8799('0x16')],'app':_0x8799('0x17'),'appdata':_0x8799('0x3a'),'context':_0x2a2181[_0x8799('0x1a')],'exten':_0x2a2181[_0x8799('0xd')],'priority':_0x61dea[_0x8799('0x32')]+_0x9b0687[_0x8799('0x11')]+_0x3e92a4++,'VoiceExtensionId':_0x2a2181[_0x8799('0x1b')]});}else{_0x4f9c87['push']({'type':_0x2a2181[_0x8799('0x16')],'app':_0x8799('0x21'),'appdata':_0x8799('0x3b'),'context':_0x2a2181['context'],'exten':_0x2a2181[_0x8799('0xd')],'priority':_0x61dea['length']+_0x9b0687[_0x8799('0x11')]+_0x3e92a4++,'VoiceExtensionId':_0x2a2181[_0x8799('0x1b')]});_0x4f9c87[_0x8799('0x15')]({'type':_0x2a2181[_0x8799('0x16')],'app':_0x8799('0x17'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x2a2181[_0x8799('0x1a')],'exten':_0x2a2181['exten'],'priority':_0x61dea[_0x8799('0x32')]+_0x9b0687[_0x8799('0x11')]+_0x3e92a4++,'VoiceExtensionId':_0x2a2181[_0x8799('0x1b')]});}}}for(var _0x2da1af=0x0;_0x2da1af<_0x61dea[_0x8799('0x32')];_0x2da1af+=0x1){var _0x4e2842=_0x9b0687[_0x8799('0x11')]+_0x61dea['length'];var _0x1c37d9=_0x2da1af===_0x61dea[_0x8799('0x32')]-0x1?_0x9b0687['priority']+_0x4f9c87['length']+_0xae1078['length']+0x2:_0x9b0687[_0x8799('0x11')]+_0x2da1af+0x1;_0x4f9c87[_0x8799('0x3c')](_0x2da1af,0x0,{'type':_0x2a2181['type'],'app':_0x8799('0x3d'),'appdata':_0x61dea[_0x2da1af]+'?'+_0x2a2181[_0x8799('0x1a')]+',${EXTEN},'+_0x4e2842+':'+_0x2a2181['context']+_0x8799('0x3e')+_0x1c37d9,'exten':_0x2a2181[_0x8799('0xd')],'context':_0x2a2181[_0x8799('0x1a')],'priority':_0x9b0687[_0x8799('0x11')]+_0x2da1af,'VoiceExtensionId':_0x4a5131[_0x76e468][0x0][_0x8799('0x1b')]});}_0x2a2181[_0x8799('0x11')]=_0x4f9c87['length']?_[_0x8799('0x3f')](_0x4f9c87)[_0x8799('0x11')]+0x1:_0x9b0687[_0x8799('0x11')];_0x9b0687[_0x8799('0x11')]=(_0xae1078['length']?_[_0x8799('0x3f')](_0xae1078)[_0x8799('0x11')]:_0x2a2181[_0x8799('0x11')])+0x1;_0x9b0687[_0x8799('0x12')]=_[_0x8799('0x40')](_0x9b0687[_0x8799('0x12')],_0x4f9c87,[_0x2a2181],_0xae1078);}_0x9b0687[_0x8799('0x12')][_0x8799('0x15')]({'type':_0x4a5131[_0x76e468][0x0]['type'],'app':_0x8799('0x41'),'exten':_0x4a5131[_0x76e468][0x0][_0x8799('0xd')],'context':_0x4a5131[_0x76e468][0x0]['context'],'priority':_0x9b0687[_0x8799('0x11')],'VoiceExtensionId':_0x4a5131[_0x76e468][0x0][_0x8799('0x1b')]});_0x5ebf93[_0x8799('0x15')](_0x4a5131[_0x76e468][0x0][_0x8799('0x1b')]);_0x3fbfb2=_[_0x8799('0x40')](_0x3fbfb2,_0x9b0687[_0x8799('0x12')]);}}return _0x4a3094[_0x8799('0x42')](function(_0x19c1ac){return _0x4a3094['models'][_0x8799('0x6')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x5ebf93}},'transaction':_0x19c1ac})[_0x8799('0x4')](function(_0x452e95){return _0x4a3094[_0x8799('0x2')][_0x8799('0x6')][_0x8799('0x43')](_[_0x8799('0x44')](_0x3fbfb2,_0x8799('0x11')),{'transaction':_0x19c1ac});});});})[_0x8799('0x45')](function(_0x58bffa){console[_0x8799('0x46')](_0x58bffa);});}exports[_0x8799('0x47')]=rewrite;
\ No newline at end of file
+var _0x4dae=['$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','concat','Hangup','transaction','bulkCreate','catch','error','rewrite','lodash','models','Interval','then','intervals','VoiceExtension','findAll','IntervalId','uniq','map','exten','filter','queue','hasOwnProperty','priority','extensions','extension','find','push','Set','format','CDR(type)=%s','type','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','updatedAt','interval','*,*,*,*','tag','callerID'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x4dae,0x127));var _0xe4da=function(_0x577cf7,_0xb2ef51){_0x577cf7=_0x577cf7-0x0;var _0x2ece28=_0x4dae[_0x577cf7];return _0x2ece28;};'use strict';var _=require(_0xe4da('0x0'));var util=require('util');function rewrite(_0x45edfa,_0x17775b){var _0x41c022=this;return _0x45edfa[_0xe4da('0x1')][_0xe4da('0x2')]['findAll']({'raw':!![]})[_0xe4da('0x3')](function(_0x1b4a1f){_0x41c022[_0xe4da('0x4')]=_0x1b4a1f;return _0x45edfa[_0xe4da('0x1')][_0xe4da('0x5')][_0xe4da('0x6')]({'where':{'IntervalId':_0x17775b[_0xe4da('0x7')]},'raw':!![]});})[_0xe4da('0x3')](function(_0x11d7ec){return _0x45edfa[_0xe4da('0x1')][_0xe4da('0x5')]['findAll']({'where':{'exten':{'$in':_[_0xe4da('0x8')](_[_0xe4da('0x9')](_0x11d7ec,_0xe4da('0xa')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xe4da('0x3')](function(_0x573386){var _0x57dab6=_[_0xe4da('0xb')](_0x573386,{'priority':'1'});var _0x297a59=_['filter'](_0x573386,{'isApp':0x1});var _0x4d3cfd=_['groupBy'](_0x297a59,_0xe4da('0xa'));var _0x442112=[_0xe4da('0xc'),'playback'];var _0x1bb80c=[];var _0x42df25=[];for(var _0x202a56 in _0x4d3cfd){if(_0x4d3cfd[_0xe4da('0xd')](_0x202a56)){_0x41c022[_0xe4da('0xe')]=0x2;_0x41c022[_0xe4da('0xf')]=[];_0x41c022[_0xe4da('0x10')]=_[_0xe4da('0x11')](_0x57dab6,{'exten':_0x4d3cfd[_0x202a56][0x0]['exten']});_0x41c022[_0xe4da('0xf')][_0xe4da('0x12')]({'type':_0x4d3cfd[_0x202a56][0x0]['type'],'app':_0xe4da('0x13'),'appdata':util[_0xe4da('0x14')](_0xe4da('0x15'),_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x16')]),'context':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x17')],'exten':_0x4d3cfd[_0x202a56][0x0]['exten'],'priority':_0x41c022[_0xe4da('0xe')]++,'VoiceExtensionId':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x18')]});if(_0x4d3cfd[_0x202a56][0x0]['type']===_0xe4da('0x19')){_0x41c022[_0xe4da('0xf')]['push']({'type':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x16')],'app':_0xe4da('0x13'),'appdata':_0xe4da('0x1a')+_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x18')],'context':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x17')],'exten':_0x4d3cfd[_0x202a56][0x0]['exten'],'priority':_0x41c022[_0xe4da('0xe')]++,'VoiceExtensionId':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x18')]});}else if(_0x4d3cfd[_0x202a56][0x0]['type']===_0xe4da('0x1b')){if(_0x41c022[_0xe4da('0x10')]){_0x41c022[_0xe4da('0xf')][_0xe4da('0x12')]({'type':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x16')],'app':_0xe4da('0x13'),'appdata':_0xe4da('0x1c')+(_0x41c022['extension'][_0xe4da('0x1d')]?_0xe4da('0x1e')+_0x41c022[_0xe4da('0x10')][_0xe4da('0x1d')]+'}':_0xe4da('0x1f')),'context':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x17')],'exten':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0xa')],'priority':_0x41c022[_0xe4da('0xe')]++,'VoiceExtensionId':_0x4d3cfd[_0x202a56][0x0]['VoiceExtensionId']});}_0x41c022[_0xe4da('0xf')]['push']({'type':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x16')],'app':_0xe4da('0x13'),'appdata':_0xe4da('0x1a')+_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x18')],'context':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x17')],'exten':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0xa')],'priority':_0x41c022[_0xe4da('0xe')]++,'VoiceExtensionId':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x18')]});var _0x2696f2=_0x41c022['priority']++;_0x41c022['extensions']['push']({'type':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x16')],'app':_0xe4da('0x20'),'appdata':_0xe4da('0x21')+(_0x2696f2+0x2)+_0xe4da('0x22')+(_0x2696f2+0x1)+')','context':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x17')],'exten':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0xa')],'priority':_0x2696f2,'VoiceExtensionId':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x18')]});if(_0x41c022[_0xe4da('0x10')]){_0x41c022[_0xe4da('0xf')][_0xe4da('0x12')]({'type':_0x4d3cfd[_0x202a56][0x0]['type'],'app':_0xe4da('0x13'),'appdata':_0x41c022['extension'][_0xe4da('0x1d')]?_0xe4da('0x23')+_0x41c022[_0xe4da('0x10')][_0xe4da('0x1d')]+'}':_0xe4da('0x24'),'context':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x17')],'exten':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0xa')],'priority':_0x41c022['priority']++,'VoiceExtensionId':_0x4d3cfd[_0x202a56][0x0]['VoiceExtensionId']});}_0x41c022['extensions'][_0xe4da('0x12')]({'type':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x16')],'app':_0xe4da('0x13'),'appdata':'outboundrouteid='+_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x18')],'context':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x17')],'exten':_0x4d3cfd[_0x202a56][0x0]['exten'],'priority':_0x41c022[_0xe4da('0xe')]++,'VoiceExtensionId':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x18')]});if(_0x41c022[_0xe4da('0x10')]&&_0x41c022['extension'][_0xe4da('0xd')]('recordingFormat')&&_0x41c022[_0xe4da('0x10')][_0xe4da('0x25')]!==_0xe4da('0x26')){_0x41c022['extensions'][_0xe4da('0x12')]({'type':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x16')],'app':_0xe4da('0x13'),'appdata':_0xe4da('0x27'),'context':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x17')],'exten':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0xa')],'priority':_0x41c022[_0xe4da('0xe')]++,'VoiceExtensionId':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x18')]});_0x41c022[_0xe4da('0xf')][_0xe4da('0x12')]({'type':_0x4d3cfd[_0x202a56][0x0]['type'],'app':'Set','appdata':_0xe4da('0x28')+_0x41c022[_0xe4da('0x10')][_0xe4da('0x25')]||'wav','context':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x17')],'exten':_0x4d3cfd[_0x202a56][0x0]['exten'],'priority':_0x41c022[_0xe4da('0xe')]++,'VoiceExtensionId':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x18')]});}}_0x41c022[_0xe4da('0xf')]['push']({'type':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x16')],'app':'Set','appdata':_0xe4da('0x29'),'context':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x17')],'exten':_0x4d3cfd[_0x202a56][0x0]['exten'],'priority':_0x41c022[_0xe4da('0xe')]++,'VoiceExtensionId':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x18')]});_0x41c022[_0xe4da('0xf')]['push']({'type':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x16')],'app':_0xe4da('0x13'),'appdata':_0xe4da('0x2a'),'context':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x17')],'exten':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0xa')],'priority':_0x41c022[_0xe4da('0xe')]++,'VoiceExtensionId':_0x4d3cfd[_0x202a56][0x0]['VoiceExtensionId']});_0x41c022[_0xe4da('0xf')][_0xe4da('0x12')]({'type':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x16')],'app':_0xe4da('0x13'),'appdata':'MONITOR_OPTIONS=ab','context':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x17')],'exten':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0xa')],'priority':_0x41c022[_0xe4da('0xe')]++,'VoiceExtensionId':_0x4d3cfd[_0x202a56][0x0]['VoiceExtensionId']});for(var _0x45e1e1=0x0,_0x5343dc=0x0;_0x45e1e1<_0x4d3cfd[_0x202a56][_0xe4da('0x2b')];_0x45e1e1+=0x1,_0x5343dc=0x0){var _0x1cdc61=_0x4d3cfd[_0x202a56][_0x45e1e1];if(_0x1cdc61[_0xe4da('0x16')]){_0x1cdc61[_0xe4da('0x16')]=_0x1cdc61[_0xe4da('0x16')][_0xe4da('0x2c')]();}var _0x5119e6=[];var _0x48f5f7=[];delete _0x1cdc61['id'];delete _0x1cdc61['createdAt'];delete _0x1cdc61[_0xe4da('0x2d')];var _0x1a7445=_0x1cdc61[_0xe4da('0x2e')]!==_0xe4da('0x2f')?[_0x1cdc61[_0xe4da('0x2e')]]:_0x1cdc61[_0xe4da('0x7')]?_[_0xe4da('0x9')](_['filter'](_0x41c022[_0xe4da('0x4')],{'IntervalId':_0x1cdc61[_0xe4da('0x7')]}),_0xe4da('0x2e')):[];if(_0x1cdc61[_0xe4da('0xd')](_0xe4da('0x30'))){if(_0x1cdc61[_0xe4da('0x30')]&&_0x1cdc61[_0xe4da('0x30')]!=='--'){_0x5119e6[_0xe4da('0x12')]({'type':_0x1cdc61[_0xe4da('0x16')],'app':_0xe4da('0x13'),'appdata':'CDR(tag)='+_0x1cdc61[_0xe4da('0x30')],'context':_0x1cdc61[_0xe4da('0x17')],'exten':_0x1cdc61[_0xe4da('0xa')],'priority':_0x1a7445['length']+_0x41c022[_0xe4da('0xe')]+_0x5343dc++,'VoiceExtensionId':_0x1cdc61['VoiceExtensionId']});}}if(_0x1cdc61[_0xe4da('0x16')]===_0xe4da('0x1b')&&_0x1cdc61[_0xe4da('0xd')]('callerID')){if(_0x1cdc61[_0xe4da('0x31')]){_0x5119e6[_0xe4da('0x12')]({'type':_0x1cdc61[_0xe4da('0x16')],'app':_0xe4da('0x20'),'appdata':_0xe4da('0x32')+_0x1cdc61[_0xe4da('0x31')]+')','context':_0x1cdc61[_0xe4da('0x17')],'exten':_0x1cdc61[_0xe4da('0xa')],'priority':_0x1a7445[_0xe4da('0x2b')]+_0x41c022['priority']+_0x5343dc++,'VoiceExtensionId':_0x1cdc61['VoiceExtensionId']});}else{_0x5119e6[_0xe4da('0x12')]({'type':_0x1cdc61[_0xe4da('0x16')],'app':'ExecIf','appdata':_0xe4da('0x33'),'context':_0x1cdc61['context'],'exten':_0x1cdc61['exten'],'priority':_0x1a7445[_0xe4da('0x2b')]+_0x41c022[_0xe4da('0xe')]+_0x5343dc++,'VoiceExtensionId':_0x1cdc61[_0xe4da('0x18')]});}}if(_0x1cdc61['hasOwnProperty'](_0xe4da('0x34'))){if(_0x442112[_0xe4da('0x35')](_0x1cdc61[_0xe4da('0x36')][_0xe4da('0x2c')]())>=0x0&&_0x1cdc61['appType']!==_0xe4da('0x37')){if(_0x1cdc61[_0xe4da('0x34')]){_0x5119e6[_0xe4da('0x12')]({'type':_0x1cdc61[_0xe4da('0x16')],'app':_0xe4da('0x20'),'appdata':_0xe4da('0x38'),'context':_0x1cdc61[_0xe4da('0x17')],'exten':_0x1cdc61[_0xe4da('0xa')],'priority':_0x1a7445[_0xe4da('0x2b')]+_0x41c022['priority']+_0x5343dc++,'VoiceExtensionId':_0x1cdc61[_0xe4da('0x18')]});_0x5119e6[_0xe4da('0x12')]({'type':_0x1cdc61['type'],'app':_0xe4da('0x13'),'appdata':_0xe4da('0x39'),'context':_0x1cdc61[_0xe4da('0x17')],'exten':_0x1cdc61['exten'],'priority':_0x1a7445[_0xe4da('0x2b')]+_0x41c022[_0xe4da('0xe')]+_0x5343dc++,'VoiceExtensionId':_0x1cdc61[_0xe4da('0x18')]});}else{_0x5119e6[_0xe4da('0x12')]({'type':_0x1cdc61[_0xe4da('0x16')],'app':_0xe4da('0x20'),'appdata':_0xe4da('0x3a'),'context':_0x1cdc61['context'],'exten':_0x1cdc61['exten'],'priority':_0x1a7445[_0xe4da('0x2b')]+_0x41c022[_0xe4da('0xe')]+_0x5343dc++,'VoiceExtensionId':_0x1cdc61[_0xe4da('0x18')]});_0x5119e6[_0xe4da('0x12')]({'type':_0x1cdc61[_0xe4da('0x16')],'app':_0xe4da('0x13'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x1cdc61[_0xe4da('0x17')],'exten':_0x1cdc61[_0xe4da('0xa')],'priority':_0x1a7445[_0xe4da('0x2b')]+_0x41c022[_0xe4da('0xe')]+_0x5343dc++,'VoiceExtensionId':_0x1cdc61[_0xe4da('0x18')]});}}}for(var _0x24f7af=0x0;_0x24f7af<_0x1a7445[_0xe4da('0x2b')];_0x24f7af+=0x1){var _0xddfd5e=_0x41c022['priority']+_0x1a7445['length'];var _0x39ddbe=_0x24f7af===_0x1a7445[_0xe4da('0x2b')]-0x1?_0x41c022[_0xe4da('0xe')]+_0x5119e6[_0xe4da('0x2b')]+_0x48f5f7['length']+0x2:_0x41c022[_0xe4da('0xe')]+_0x24f7af+0x1;_0x5119e6[_0xe4da('0x3b')](_0x24f7af,0x0,{'type':_0x1cdc61[_0xe4da('0x16')],'app':_0xe4da('0x3c'),'appdata':_0x1a7445[_0x24f7af]+'?'+_0x1cdc61['context']+_0xe4da('0x3d')+_0xddfd5e+':'+_0x1cdc61[_0xe4da('0x17')]+',${EXTEN},'+_0x39ddbe,'exten':_0x1cdc61[_0xe4da('0xa')],'context':_0x1cdc61[_0xe4da('0x17')],'priority':_0x41c022[_0xe4da('0xe')]+_0x24f7af,'VoiceExtensionId':_0x4d3cfd[_0x202a56][0x0]['VoiceExtensionId']});}_0x1cdc61['priority']=_0x5119e6[_0xe4da('0x2b')]?_['last'](_0x5119e6)[_0xe4da('0xe')]+0x1:_0x41c022[_0xe4da('0xe')];_0x41c022['priority']=(_0x48f5f7[_0xe4da('0x2b')]?_['last'](_0x48f5f7)[_0xe4da('0xe')]:_0x1cdc61[_0xe4da('0xe')])+0x1;_0x41c022[_0xe4da('0xf')]=_[_0xe4da('0x3e')](_0x41c022[_0xe4da('0xf')],_0x5119e6,[_0x1cdc61],_0x48f5f7);}_0x41c022[_0xe4da('0xf')][_0xe4da('0x12')]({'type':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x16')],'app':_0xe4da('0x3f'),'exten':_0x4d3cfd[_0x202a56][0x0]['exten'],'context':_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x17')],'priority':_0x41c022[_0xe4da('0xe')],'VoiceExtensionId':_0x4d3cfd[_0x202a56][0x0]['VoiceExtensionId']});_0x1bb80c['push'](_0x4d3cfd[_0x202a56][0x0][_0xe4da('0x18')]);_0x42df25=_[_0xe4da('0x3e')](_0x42df25,_0x41c022['extensions']);}}return _0x45edfa[_0xe4da('0x40')](function(_0x209907){return _0x45edfa['models']['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x1bb80c}},'transaction':_0x209907})[_0xe4da('0x3')](function(_0x3b9748){return _0x45edfa[_0xe4da('0x1')][_0xe4da('0x5')][_0xe4da('0x41')](_['sortBy'](_0x42df25,'priority'),{'transaction':_0x209907});});});})[_0xe4da('0x42')](function(_0x2ed8c1){console[_0xe4da('0x43')](_0x2ed8c1);});}exports[_0xe4da('0x44')]=rewrite;
\ No newline at end of file
index 9819c11..d264bc7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9ce=['Campaign','CampaignId','cmContact,\x20%s,\x20%s','stringify','contact:csv_','resolve','emit','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','createReadStream','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','api','defaults','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','errors','length','map','message','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','then','pick','catch','Error\x20while\x20creating\x20contact:\x20','cmContact','inspect','into','fromQuery','scheduledAt','ContactId','updatedAt','field','NOW()','toString','from','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper','insert','createdAt','select','calleridnum','cm_hopper_final','\x20=\x20?','deletedAt\x20IS\x20NULL','str','cm_hopper_black','id\x20IN\x20?','dialCheckDuplicateType','CmList','Lists','always','query','VoiceQueueId','onlyIfOpen','push','sequelize','all','findAll','outbound','BlackLists','get'];(function(_0x141658,_0x27b519){var _0x16388a=function(_0x55c6f1){while(--_0x55c6f1){_0x141658['push'](_0x141658['shift']());}};_0x16388a(++_0x27b519);}(_0xa9ce,0x78));var _0xea9c=function(_0x56172a,_0x4e9617){_0x56172a=_0x56172a-0x0;var _0x259380=_0xa9ce[_0x56172a];return _0x259380;};'use strict';var BPromise=require('bluebird');var util=require(_0xea9c('0x0'));var _=require(_0xea9c('0x1'));var fs=require('fs');var squel=require(_0xea9c('0x2'));var Papa=require(_0xea9c('0x3'));var Redis=require('ioredis');var db=require(_0xea9c('0x4'))['db'];var config=require(_0xea9c('0x5'));var logger=require(_0xea9c('0x6'))(_0xea9c('0x7'));config['redis']=_[_0xea9c('0x8')](config[_0xea9c('0x9')],{'host':_0xea9c('0xa'),'port':0x18eb});var socket=require(_0xea9c('0xb'))(new Redis(config[_0xea9c('0x9')]));require(_0xea9c('0xc'))[_0xea9c('0xd')](socket);try{if(!process[_0xea9c('0xe')][0x2]||process['argv'][0x2]===_0xea9c('0xf')||process[_0xea9c('0xe')][0x2]===_0xea9c('0x10')){throw new Error(_0xea9c('0x11'));}var FILEPATH=process[_0xea9c('0xe')][0x2];if(!process[_0xea9c('0xe')][0x3]||process['argv'][0x3]==='undefined'||process[_0xea9c('0xe')][0x3]===_0xea9c('0x10')||!process[_0xea9c('0xe')][0x4]||process[_0xea9c('0xe')][0x4]===_0xea9c('0xf')||process[_0xea9c('0xe')][0x4]===_0xea9c('0x10')){throw new Error(_0xea9c('0x12'));}var FIELDS=_['zipObject'](process['argv'][0x3][_0xea9c('0x13')](','),process[_0xea9c('0xe')][0x4][_0xea9c('0x13')](','));if(!process[_0xea9c('0xe')][0x5]||process[_0xea9c('0xe')][0x5]==='undefined'||process[_0xea9c('0xe')][0x5]==='null'){throw new Error(_0xea9c('0x14'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0xea9c('0xe')][0x6]&&process[_0xea9c('0xe')][0x6]!==_0xea9c('0xf')&&process[_0xea9c('0xe')][0x6]!==_0xea9c('0x10')?process[_0xea9c('0xe')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xea9c('0xe')][0x7]!==_0xea9c('0xf')&&process[_0xea9c('0xe')][0x7]!==_0xea9c('0x10')?process[_0xea9c('0xe')][0x7]:null;if(!process[_0xea9c('0xe')][0x8]||process[_0xea9c('0xe')][0x8]===_0xea9c('0xf')||process[_0xea9c('0xe')][0x8]===_0xea9c('0x10')){throw new Error(_0xea9c('0x15'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x4d172c){logger[_0xea9c('0x16')](_0x4d172c);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(_0xb1204,_0x50b315,_0x352639,_0x231e79){var _0x415d74={'message':_0x50b315};_0x415d74[_0xb1204]=!![];if(_0x352639){_0x415d74[_0xea9c('0x17')]=_0x352639;}if(_0x231e79){_0x415d74[_0xea9c('0x18')]=_0x231e79;}return _0x415d74;}function isEmail(_0xf207ff){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))*$/[_0xea9c('0x19')](_0xf207ff);}function checkRow(_0x93176a,_0x3734a5,_0x1e2025){return new BPromise(function(_0x307be0,_0x418aa6){if(_['isNil'](_0x93176a)){return _0x418aa6(handleCheckRowError('error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x1e2025));}if(_0x93176a['errors']&&_0x93176a[_0xea9c('0x1a')][_0xea9c('0x1b')]){var _0x18fa96=_[_0xea9c('0x1c')](_0x93176a[_0xea9c('0x1a')],_0xea9c('0x1d'))['join'](';');return _0x418aa6(handleCheckRowError(_0xea9c('0x16'),_0x18fa96,null,_0x1e2025));}var _0xed1040={};for(var _0x1d6600 in FIELDS){if(FIELDS[_0xea9c('0x1e')](_0x1d6600)&&FIELDS[_0x1d6600]){_0xed1040[_0x1d6600]=_0x93176a[_0xea9c('0x1f')][0x0][FIELDS[_0x1d6600]]||_0x93176a[_0xea9c('0x1f')][0x0]['\ufeff'+FIELDS[_0x1d6600]];}}if(!_0xed1040[_0xea9c('0x20')]){return _0x418aa6(handleCheckRowError(_0xea9c('0x16'),_0xea9c('0x21'),null,_0x1e2025));}if(!_0xed1040[_0xea9c('0x22')]){return _0x418aa6(handleCheckRowError(_0xea9c('0x16'),_0xea9c('0x23'),null,_0x1e2025));}if(_0xed1040[_0xea9c('0x24')]){var _0x2b8eff=moment(_0xed1040[_0xea9c('0x24')],_0xea9c('0x25'));if(!_0x2b8eff['isValid']()){return _0x418aa6(handleCheckRowError('error',_0xea9c('0x26'),null,_0x1e2025));}}if(_0xed1040[_0xea9c('0x27')]){if(!isEmail(_0xed1040['email'])){return _0x418aa6(handleCheckRowError(_0xea9c('0x16'),'email\x20format\x20is\x20not\x20valid!',null,_0x1e2025));}}_0xed1040[_0xea9c('0x28')]=LISTID;_0xed1040[_0xea9c('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x3734a5){var _0x501fcb={};for(var _0x52bf4f=0x0,_0x4f5527=DUPLICATES['length'];_0x52bf4f<_0x4f5527;_0x52bf4f+=0x1){_0x501fcb[DUPLICATES[_0x52bf4f]]=_0xed1040[DUPLICATES[_0x52bf4f]];}var _0x4b649b=_[_0xea9c('0x2a')](_0x3734a5,_0x501fcb);if(_0x4b649b){return _0x418aa6(handleCheckRowError(_0xea9c('0x2b'),_0xea9c('0x2c'),_0x4b649b,_0x1e2025));}}return db[_0xea9c('0x2d')][_0xea9c('0x2e')](_0xed1040,{'raw':!![],'hooks':![],'fields':_['keys'](_0xed1040)})[_0xea9c('0x2f')](function(_0x3c0d0d){if(DUPLICATES&&DUPLICATES[_0xea9c('0x1b')]&&_0x3734a5){_0x3734a5['push'](_[_0xea9c('0x30')](_0xed1040,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3c0d0d['id'];return _0x307be0();})[_0xea9c('0x31')](function(_0x35aa82){return _0x418aa6(handleCheckRowError(_0xea9c('0x16'),_0xea9c('0x32')+(_0x35aa82['message']||JSON['stringify'](_0x35aa82)),null,_0x1e2025));});});}function checkHopper(){function _0x3af28f(){return function(_0x65a4d6){logger[_0xea9c('0x16')](_0xea9c('0x33'),'checkHopper',util[_0xea9c('0x34')](_0x65a4d6,{'showHidden':![],'depth':null}));};}var _0xb5f1ef=function(_0x357b54,_0x5560e8){var _0x556dc8=squel['insert']()[_0xea9c('0x35')]('cm_hopper')[_0xea9c('0x36')]([_0xea9c('0x22'),_0xea9c('0x37'),_0xea9c('0x38'),'ListId',_0x5560e8,'createdAt',_0xea9c('0x39')],squel['select']()[_0xea9c('0x3a')](_0xea9c('0x22'),_0xea9c('0x22'))['field'](_0xea9c('0x3b'),_0xea9c('0x37'))['field']('id',_0xea9c('0x38'))[_0xea9c('0x3a')](LISTID[_0xea9c('0x3c')](),_0xea9c('0x28'))['field'](_0x357b54['id']['toString'](),_0x5560e8)['field'](_0xea9c('0x3b'),'createdAt')[_0xea9c('0x3a')](_0xea9c('0x3b'),_0xea9c('0x39'))[_0xea9c('0x3d')](_0xea9c('0x3e'))[_0xea9c('0x3f')]('deletedAt\x20IS\x20NULL')[_0xea9c('0x3f')](_0xea9c('0x40'),LISTID[_0xea9c('0x3c')]())[_0xea9c('0x3f')](_0xea9c('0x41'))[_0xea9c('0x3f')](_0xea9c('0x42'),squel['select']()['field'](_0xea9c('0x22'))[_0xea9c('0x3d')](_0xea9c('0x43'))[_0xea9c('0x3f')](_0x5560e8+'\x20=\x20?',_0x357b54['id'][_0xea9c('0x3c')]())))[_0xea9c('0x3c')]();return _0x556dc8;};var _0x58c657=function(_0x5a12da,_0x10b3c0){var _0x1acb1a=squel[_0xea9c('0x44')]()[_0xea9c('0x35')](_0xea9c('0x43'))[_0xea9c('0x36')]([_0xea9c('0x22'),'scheduledAt',_0xea9c('0x38'),'ListId',_0x10b3c0,_0xea9c('0x45'),_0xea9c('0x39')],squel[_0xea9c('0x46')]()[_0xea9c('0x3a')](_0xea9c('0x22'),_0xea9c('0x22'))[_0xea9c('0x3a')](_0xea9c('0x3b'),'scheduledAt')[_0xea9c('0x3a')]('id',_0xea9c('0x38'))[_0xea9c('0x3a')](LISTID[_0xea9c('0x3c')](),'ListId')[_0xea9c('0x3a')](_0x5a12da['id'][_0xea9c('0x3c')](),_0x10b3c0)['field'](_0xea9c('0x3b'),_0xea9c('0x45'))['field'](_0xea9c('0x3b'),_0xea9c('0x39'))[_0xea9c('0x3d')]('cm_contacts')[_0xea9c('0x3f')]('deletedAt\x20IS\x20NULL')[_0xea9c('0x3f')](_0xea9c('0x40'),LISTID['toString']())[_0xea9c('0x3f')]('id\x20IN\x20?',squel['str'](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL')[_0xea9c('0x3f')](_0xea9c('0x42'),squel['select']()[_0xea9c('0x3a')](_0xea9c('0x47'))[_0xea9c('0x3d')](_0xea9c('0x48'))[_0xea9c('0x3f')](_0x10b3c0+'\x20=\x20?',_0x5a12da['id']['toString']()))[_0xea9c('0x3f')](_0xea9c('0x42'),squel[_0xea9c('0x46')]()[_0xea9c('0x3a')](_0xea9c('0x22'))[_0xea9c('0x3d')](_0xea9c('0x43'))[_0xea9c('0x3f')](_0x10b3c0+_0xea9c('0x49'),_0x5a12da['id'][_0xea9c('0x3c')]())))[_0xea9c('0x3c')]();return _0x1acb1a;};function _0x217148(_0xbb16ec,_0xa02c60){var _0x44c042=squel[_0xea9c('0x44')]()[_0xea9c('0x35')]('cm_hopper')[_0xea9c('0x36')]([_0xea9c('0x22'),_0xea9c('0x37'),_0xea9c('0x38'),_0xea9c('0x28'),_0xa02c60,_0xea9c('0x45'),'updatedAt'],squel[_0xea9c('0x46')]()['field']('phone',_0xea9c('0x22'))[_0xea9c('0x3a')](_0xea9c('0x3b'),_0xea9c('0x37'))['field']('id','ContactId')['field'](LISTID[_0xea9c('0x3c')](),'ListId')[_0xea9c('0x3a')](_0xbb16ec['id'][_0xea9c('0x3c')](),_0xa02c60)['field'](_0xea9c('0x3b'),_0xea9c('0x45'))[_0xea9c('0x3a')](_0xea9c('0x3b'),_0xea9c('0x39'))[_0xea9c('0x3d')]('cm_contacts')[_0xea9c('0x3f')](_0xea9c('0x4a'))['where']('ListId\x20=\x20?',LISTID[_0xea9c('0x3c')]())['where']('id\x20IN\x20?',squel[_0xea9c('0x4b')](hopperContacts))['where'](_0xea9c('0x41')))[_0xea9c('0x3c')]();return _0x44c042;}function _0x54cb48(_0x411da3,_0x1ee014){var _0x42cc1c=squel[_0xea9c('0x44')]()[_0xea9c('0x35')](_0xea9c('0x4c'))[_0xea9c('0x36')]([_0xea9c('0x22'),_0xea9c('0x38'),_0xea9c('0x28'),_0x1ee014,_0xea9c('0x45'),_0xea9c('0x39')],squel[_0xea9c('0x46')]()['field']('phone','phone')[_0xea9c('0x3a')]('id',_0xea9c('0x38'))[_0xea9c('0x3a')](LISTID[_0xea9c('0x3c')](),_0xea9c('0x28'))[_0xea9c('0x3a')](_0x411da3['id'][_0xea9c('0x3c')](),_0x1ee014)[_0xea9c('0x3a')](_0xea9c('0x3b'),_0xea9c('0x45'))[_0xea9c('0x3a')](_0xea9c('0x3b'),_0xea9c('0x39'))[_0xea9c('0x3d')](_0xea9c('0x3e'))[_0xea9c('0x3f')]('deletedAt\x20IS\x20NULL')['where'](_0xea9c('0x40'),LISTID[_0xea9c('0x3c')]())[_0xea9c('0x3f')](_0xea9c('0x4d'),squel[_0xea9c('0x4b')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0xea9c('0x3c')]();return _0x42cc1c;}return db['VoiceQueue']['findAll']({'where':{'type':'outbound'},'attributes':['id',_0xea9c('0x4e')],'include':[{'model':db[_0xea9c('0x4f')],'as':_0xea9c('0x50'),'where':{'id':LISTID}}]})[_0xea9c('0x2f')](function(_0x2affad){var _0x21e168=[];if(_0x2affad){var _0x14c3f3;for(var _0x21e5ff=0x0,_0x25b7b9;_0x21e5ff<_0x2affad[_0xea9c('0x1b')];_0x21e5ff+=0x1){_0x25b7b9=_0x2affad[_0x21e5ff]['get']({'plain':!![]});switch(_0x25b7b9[_0xea9c('0x4e')]){case _0xea9c('0x51'):_0x21e168['push'](db['sequelize'][_0xea9c('0x52')](_0x58c657(_0x25b7b9,_0xea9c('0x53')))['then'](function(){})[_0xea9c('0x31')](_0x3af28f()));break;case _0xea9c('0x54'):_0x21e168[_0xea9c('0x55')](db[_0xea9c('0x56')]['query'](_0xb5f1ef(_0x25b7b9,_0xea9c('0x53')))[_0xea9c('0x2f')](function(){})[_0xea9c('0x31')](_0x3af28f()));break;default:_0x21e168[_0xea9c('0x55')](db[_0xea9c('0x56')][_0xea9c('0x52')](_0x217148(_0x25b7b9,_0xea9c('0x53')))[_0xea9c('0x2f')](function(){})[_0xea9c('0x31')](_0x3af28f()));}}}return _0x21e168;})[_0xea9c('0x57')]()['then'](function(){return db['VoiceQueue'][_0xea9c('0x58')]({'where':{'type':_0xea9c('0x59')},'attributes':['id'],'include':[{'model':db[_0xea9c('0x4f')],'as':_0xea9c('0x5a'),'where':{'id':LISTID}}]})[_0xea9c('0x2f')](function(_0x46b2c4){var _0x548053=[];if(_0x46b2c4){var _0x914cb4;for(var _0x34d7ee=0x0,_0x4eabc9;_0x34d7ee<_0x46b2c4[_0xea9c('0x1b')];_0x34d7ee+=0x1){_0x4eabc9=_0x46b2c4[_0x34d7ee][_0xea9c('0x5b')]({'plain':!![]});_0x548053['push'](db[_0xea9c('0x56')]['query'](_0x54cb48(_0x4eabc9,_0xea9c('0x53')))[_0xea9c('0x2f')](function(){})['catch'](_0x3af28f()));}}return _0x548053;})[_0xea9c('0x57')]();})[_0xea9c('0x2f')](function(){return db[_0xea9c('0x5c')][_0xea9c('0x58')]({'attributes':['id',_0xea9c('0x4e')],'include':[{'model':db[_0xea9c('0x4f')],'as':'Lists','where':{'id':LISTID}}]})[_0xea9c('0x2f')](function(_0x3dddf8){var _0x307b58=[];if(_0x3dddf8){for(var _0x220e45=0x0,_0x23769e;_0x220e45<_0x3dddf8[_0xea9c('0x1b')];_0x220e45+=0x1){_0x23769e=_0x3dddf8[_0x220e45][_0xea9c('0x5b')]({'plain':!![]});switch(_0x23769e['dialCheckDuplicateType']){case _0xea9c('0x51'):_0x307b58[_0xea9c('0x55')](db[_0xea9c('0x56')][_0xea9c('0x52')](_0x58c657(_0x23769e,_0xea9c('0x5d')))[_0xea9c('0x2f')](function(){})['catch'](_0x3af28f()));break;case'onlyIfOpen':_0x307b58[_0xea9c('0x55')](db['sequelize']['query'](_0xb5f1ef(_0x23769e,_0xea9c('0x5d')))[_0xea9c('0x2f')](function(){})[_0xea9c('0x31')](_0x3af28f()));break;default:_0x307b58[_0xea9c('0x55')](db['sequelize']['query'](_0x217148(_0x23769e,'CampaignId'))[_0xea9c('0x2f')](function(){})[_0xea9c('0x31')](_0x3af28f()));}}}return _0x307b58;})[_0xea9c('0x57')]();})[_0xea9c('0x2f')](function(){return db[_0xea9c('0x5c')][_0xea9c('0x58')]({'attributes':['id'],'include':[{'model':db[_0xea9c('0x4f')],'as':_0xea9c('0x5a'),'where':{'id':LISTID}}]})['then'](function(_0x2e2a53){var _0xf384cf=[];if(_0x2e2a53){for(var _0x163a12=0x0,_0x5b1030;_0x163a12<_0x2e2a53[_0xea9c('0x1b')];_0x163a12+=0x1){_0x5b1030=_0x2e2a53[_0x163a12][_0xea9c('0x5b')]({'plain':!![]});_0xf384cf[_0xea9c('0x55')](db['sequelize'][_0xea9c('0x52')](_0x54cb48(_0x5b1030,_0xea9c('0x5d')))['then'](function(){})['catch'](_0x3af28f()));}}return _0xf384cf;})['all']();})[_0xea9c('0x31')](function(_0x10dcf8){logger[_0xea9c('0x16')](_0xea9c('0x5e'),'generalCheckHopper',_0x10dcf8[_0xea9c('0x1d')]);});}var processPromises=function(_0x3586a5){return BPromise[_0xea9c('0x57')](promises)[_0xea9c('0x2f')](function(_0x1239f9){})[_0xea9c('0x31')](function(_0x10c488){logger[_0xea9c('0x16')]('Error\x20processing\x20rows\x20block:',JSON[_0xea9c('0x5f')](_0x10c488));})['finally'](function(){socket['emit'](_0xea9c('0x60')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3586a5){return _0x3586a5['resume']();}});};var endCsv=function(){return BPromise[_0xea9c('0x61')]()[_0xea9c('0x2f')](function(){if(hopperContacts){return checkHopper();}})[_0xea9c('0x2f')](function(){socket[_0xea9c('0x62')](_0xea9c('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x92f17a){logger[_0xea9c('0x16')](_0xea9c('0x63'),JSON['stringify'](_0x92f17a));}finally{process['exit'](0x0);}});};process['on'](_0xea9c('0x64'),function(){logger[_0xea9c('0x65')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xea9c('0x61')]()[_0xea9c('0x2f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xea9c('0x13')](',');return db[_0xea9c('0x2d')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xea9c('0x2f')](function(_0x27202d){var _0x39d06e=fs[_0xea9c('0x66')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x39d06e,{'header':!![],'skipEmptyLines':!![],'step':function(_0x58c63a,_0x1499bb){total+=0x1;var _0x199385=total;promises[_0xea9c('0x55')](checkRow(_0x58c63a,_0x27202d,_0x199385)[_0xea9c('0x2f')](function(){success+=0x1;})[_0xea9c('0x31')](function(_0x21f0df){if(_0x21f0df['error']){errors+=0x1;delete _0x21f0df['error'];}else if(_0x21f0df[_0xea9c('0x2b')]){duplicates+=0x1;delete _0x21f0df[_0xea9c('0x2b')];}rows[_0xea9c('0x55')](_0x21f0df);}));if(total%0xc8===0x0){_0x1499bb[_0xea9c('0x67')]();return processPromises(_0x1499bb);}},'complete':function(){return processPromises()['then'](function(){logger[_0xea9c('0x65')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x5e77d9,_0x327dde){logger[_0xea9c('0x65')](_0xea9c('0x68'),JSON[_0xea9c('0x5f')](_0x5e77d9));endCsv();}});})['catch'](function(_0x20d751){logger[_0xea9c('0x16')](_0xea9c('0x69'),JSON['stringify'](_0x20d751));});}main();
\ No newline at end of file
+var _0x671e=['cmContact','checkHopper','inspect','insert','into','cm_hopper','ContactId','createdAt','updatedAt','select','field','phone','NOW()','scheduledAt','toString','from','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','fromQuery','deletedAt\x20IS\x20NULL','id\x20IN\x20?','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','str','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','always','push','sequelize','query','VoiceQueueId','then','onlyIfOpen','BlackLists','get','all','Campaign','Lists','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','createReadStream','duplicate','pause','CSV\x20parsed\x20correctly!','util','lodash','squel','../../../mysqldb','api','redis','defaults','localhost','socket.io-emitter','register','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','errors','hasOwnProperty','data','firstName\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','Duplicate\x20Contact','CmContact','keys','pick','catch','message','stringify'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x671e,0xa3));var _0xe671=function(_0x243266,_0x5aa8a3){_0x243266=_0x243266-0x0;var _0x50a8a=_0x671e[_0x243266];return _0x50a8a;};'use strict';var BPromise=require('bluebird');var util=require(_0xe671('0x0'));var _=require(_0xe671('0x1'));var fs=require('fs');var squel=require(_0xe671('0x2'));var Papa=require('papaparse');var Redis=require('ioredis');var db=require(_0xe671('0x3'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xe671('0x4'));config[_0xe671('0x5')]=_[_0xe671('0x6')](config[_0xe671('0x5')],{'host':_0xe671('0x7'),'port':0x18eb});var socket=require(_0xe671('0x8'))(new Redis(config[_0xe671('0x5')]));require('../../../api/cmContact/cmContact.socket')[_0xe671('0x9')](socket);try{if(!process[_0xe671('0xa')][0x2]||process[_0xe671('0xa')][0x2]===_0xe671('0xb')||process['argv'][0x2]===_0xe671('0xc')){throw new Error(_0xe671('0xd'));}var FILEPATH=process['argv'][0x2];if(!process[_0xe671('0xa')][0x3]||process[_0xe671('0xa')][0x3]===_0xe671('0xb')||process[_0xe671('0xa')][0x3]==='null'||!process['argv'][0x4]||process[_0xe671('0xa')][0x4]==='undefined'||process['argv'][0x4]===_0xe671('0xc')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xe671('0xe')](process['argv'][0x3]['split'](','),process[_0xe671('0xa')][0x4][_0xe671('0xf')](','));if(!process['argv'][0x5]||process[_0xe671('0xa')][0x5]==='undefined'||process['argv'][0x5]==='null'){throw new Error(_0xe671('0x10'));}var LISTID=process[_0xe671('0xa')][0x5];var COMPANYID=process[_0xe671('0xa')][0x6]&&process['argv'][0x6]!==_0xe671('0xb')&&process['argv'][0x6]!==_0xe671('0xc')?process[_0xe671('0xa')][0x6]:null;var DUPLICATES=process[_0xe671('0xa')][0x7]&&process[_0xe671('0xa')][0x7]!=='undefined'&&process[_0xe671('0xa')][0x7]!=='null'?process[_0xe671('0xa')][0x7]:null;if(!process['argv'][0x8]||process['argv'][0x8]==='undefined'||process[_0xe671('0xa')][0x8]===_0xe671('0xc')){throw new Error(_0xe671('0x11'));}var SOCKET_TIMESTAMP=process[_0xe671('0xa')][0x8];}catch(_0x2c433d){logger[_0xe671('0x12')](_0x2c433d);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(_0x2f4073,_0x23ec13,_0x7a431a,_0x17da9e){var _0x34de94={'message':_0x23ec13};_0x34de94[_0x2f4073]=!![];if(_0x7a431a){_0x34de94[_0xe671('0x13')]=_0x7a431a;}if(_0x17da9e){_0x34de94[_0xe671('0x14')]=_0x17da9e;}return _0x34de94;}function isEmail(_0x41507c){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'](_0x41507c);}function checkRow(_0x4ab325,_0x1fdeea,_0x11a517){return new BPromise(function(_0x68a364,_0x10e479){if(_[_0xe671('0x15')](_0x4ab325)){return _0x10e479(handleCheckRowError(_0xe671('0x12'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x11a517));}if(_0x4ab325['errors']&&_0x4ab325[_0xe671('0x16')]['length']){var _0x2ec657=_['map'](_0x4ab325[_0xe671('0x16')],'message')['join'](';');return _0x10e479(handleCheckRowError('error',_0x2ec657,null,_0x11a517));}var _0x5b95a1={};for(var _0x5872fa in FIELDS){if(FIELDS[_0xe671('0x17')](_0x5872fa)&&FIELDS[_0x5872fa]){_0x5b95a1[_0x5872fa]=_0x4ab325[_0xe671('0x18')][0x0][FIELDS[_0x5872fa]]||_0x4ab325['data'][0x0]['\ufeff'+FIELDS[_0x5872fa]];}}if(!_0x5b95a1['firstName']){return _0x10e479(handleCheckRowError(_0xe671('0x12'),_0xe671('0x19'),null,_0x11a517));}if(!_0x5b95a1['phone']){return _0x10e479(handleCheckRowError(_0xe671('0x12'),'phone\x20not\x20specified!',null,_0x11a517));}if(_0x5b95a1['birthDate']){var _0x54b470=moment(_0x5b95a1[_0xe671('0x1a')],_0xe671('0x1b'));if(!_0x54b470['isValid']()){return _0x10e479(handleCheckRowError(_0xe671('0x12'),_0xe671('0x1c'),null,_0x11a517));}}if(_0x5b95a1[_0xe671('0x1d')]){if(!isEmail(_0x5b95a1[_0xe671('0x1d')])){return _0x10e479(handleCheckRowError('error',_0xe671('0x1e'),null,_0x11a517));}}_0x5b95a1[_0xe671('0x1f')]=LISTID;_0x5b95a1[_0xe671('0x20')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x1fdeea){var _0x4d2758={};for(var _0x244f86=0x0,_0x4e96ce=DUPLICATES[_0xe671('0x21')];_0x244f86<_0x4e96ce;_0x244f86+=0x1){_0x4d2758[DUPLICATES[_0x244f86]]=_0x5b95a1[DUPLICATES[_0x244f86]];}var _0x47b4d2=_['find'](_0x1fdeea,_0x4d2758);if(_0x47b4d2){return _0x10e479(handleCheckRowError('duplicate',_0xe671('0x22'),_0x47b4d2,_0x11a517));}}return db[_0xe671('0x23')]['create'](_0x5b95a1,{'raw':!![],'hooks':![],'fields':_[_0xe671('0x24')](_0x5b95a1)})['then'](function(_0x4b3f2a){if(DUPLICATES&&DUPLICATES[_0xe671('0x21')]&&_0x1fdeea){_0x1fdeea['push'](_[_0xe671('0x25')](_0x5b95a1,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4b3f2a['id'];return _0x68a364();})[_0xe671('0x26')](function(_0x341131){return _0x10e479(handleCheckRowError(_0xe671('0x12'),'Error\x20while\x20creating\x20contact:\x20'+(_0x341131[_0xe671('0x27')]||JSON[_0xe671('0x28')](_0x341131)),null,_0x11a517));});});}function checkHopper(){function _0x325de7(){return function(_0x569c9a){logger[_0xe671('0x12')](_0xe671('0x29'),_0xe671('0x2a'),util[_0xe671('0x2b')](_0x569c9a,{'showHidden':![],'depth':null}));};}var _0x227604=function(_0x4665a0,_0x313629){var _0x5387b8=squel[_0xe671('0x2c')]()[_0xe671('0x2d')](_0xe671('0x2e'))['fromQuery'](['phone','scheduledAt',_0xe671('0x2f'),_0xe671('0x1f'),_0x313629,_0xe671('0x30'),_0xe671('0x31')],squel[_0xe671('0x32')]()[_0xe671('0x33')](_0xe671('0x34'),_0xe671('0x34'))['field'](_0xe671('0x35'),_0xe671('0x36'))[_0xe671('0x33')]('id','ContactId')[_0xe671('0x33')](LISTID['toString'](),_0xe671('0x1f'))[_0xe671('0x33')](_0x4665a0['id'][_0xe671('0x37')](),_0x313629)[_0xe671('0x33')]('NOW()',_0xe671('0x30'))[_0xe671('0x33')](_0xe671('0x35'),_0xe671('0x31'))[_0xe671('0x38')](_0xe671('0x39'))[_0xe671('0x3a')]('deletedAt\x20IS\x20NULL')[_0xe671('0x3a')](_0xe671('0x3b'),LISTID[_0xe671('0x37')]())[_0xe671('0x3a')](_0xe671('0x3c'))['where'](_0xe671('0x3d'),squel['select']()[_0xe671('0x33')](_0xe671('0x34'))[_0xe671('0x38')](_0xe671('0x2e'))['where'](_0x313629+'\x20=\x20?',_0x4665a0['id'][_0xe671('0x37')]())))['toString']();return _0x5387b8;};var _0x489b13=function(_0x4ae284,_0x174e7f){var _0x3fffb3=squel['insert']()['into'](_0xe671('0x2e'))[_0xe671('0x3e')]([_0xe671('0x34'),_0xe671('0x36'),_0xe671('0x2f'),_0xe671('0x1f'),_0x174e7f,_0xe671('0x30'),_0xe671('0x31')],squel[_0xe671('0x32')]()[_0xe671('0x33')](_0xe671('0x34'),_0xe671('0x34'))[_0xe671('0x33')](_0xe671('0x35'),_0xe671('0x36'))['field']('id','ContactId')['field'](LISTID[_0xe671('0x37')](),_0xe671('0x1f'))[_0xe671('0x33')](_0x4ae284['id'][_0xe671('0x37')](),_0x174e7f)[_0xe671('0x33')](_0xe671('0x35'),_0xe671('0x30'))[_0xe671('0x33')](_0xe671('0x35'),_0xe671('0x31'))[_0xe671('0x38')](_0xe671('0x39'))[_0xe671('0x3a')](_0xe671('0x3f'))[_0xe671('0x3a')](_0xe671('0x3b'),LISTID[_0xe671('0x37')]())[_0xe671('0x3a')](_0xe671('0x40'),squel['str'](hopperContacts))[_0xe671('0x3a')]('phone\x20IS\x20NOT\x20NULL')[_0xe671('0x3a')](_0xe671('0x3d'),squel[_0xe671('0x32')]()[_0xe671('0x33')](_0xe671('0x41'))[_0xe671('0x38')](_0xe671('0x42'))[_0xe671('0x3a')](_0x174e7f+_0xe671('0x43'),_0x4ae284['id']['toString']()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xe671('0x32')]()[_0xe671('0x33')]('phone')[_0xe671('0x38')](_0xe671('0x2e'))[_0xe671('0x3a')](_0x174e7f+_0xe671('0x43'),_0x4ae284['id'][_0xe671('0x37')]())))[_0xe671('0x37')]();return _0x3fffb3;};function _0x41fe33(_0x3cd7f7,_0x3a6407){var _0x18d135=squel['insert']()[_0xe671('0x2d')]('cm_hopper')[_0xe671('0x3e')]([_0xe671('0x34'),_0xe671('0x36'),_0xe671('0x2f'),'ListId',_0x3a6407,_0xe671('0x30'),_0xe671('0x31')],squel[_0xe671('0x32')]()['field'](_0xe671('0x34'),_0xe671('0x34'))['field']('NOW()',_0xe671('0x36'))[_0xe671('0x33')]('id',_0xe671('0x2f'))[_0xe671('0x33')](LISTID['toString'](),_0xe671('0x1f'))['field'](_0x3cd7f7['id'][_0xe671('0x37')](),_0x3a6407)[_0xe671('0x33')](_0xe671('0x35'),_0xe671('0x30'))[_0xe671('0x33')](_0xe671('0x35'),_0xe671('0x31'))[_0xe671('0x38')](_0xe671('0x39'))[_0xe671('0x3a')](_0xe671('0x3f'))[_0xe671('0x3a')](_0xe671('0x3b'),LISTID[_0xe671('0x37')]())['where']('id\x20IN\x20?',squel['str'](hopperContacts))[_0xe671('0x3a')](_0xe671('0x3c')))['toString']();return _0x18d135;}function _0x5b2292(_0xa123e9,_0x93acc){var _0x5df5a5=squel[_0xe671('0x2c')]()[_0xe671('0x2d')](_0xe671('0x44'))[_0xe671('0x3e')]([_0xe671('0x34'),'ContactId',_0xe671('0x1f'),_0x93acc,_0xe671('0x30'),'updatedAt'],squel['select']()[_0xe671('0x33')](_0xe671('0x34'),_0xe671('0x34'))['field']('id',_0xe671('0x2f'))[_0xe671('0x33')](LISTID[_0xe671('0x37')](),_0xe671('0x1f'))[_0xe671('0x33')](_0xa123e9['id'][_0xe671('0x37')](),_0x93acc)[_0xe671('0x33')](_0xe671('0x35'),_0xe671('0x30'))['field']('NOW()','updatedAt')[_0xe671('0x38')](_0xe671('0x39'))['where'](_0xe671('0x3f'))[_0xe671('0x3a')](_0xe671('0x3b'),LISTID[_0xe671('0x37')]())[_0xe671('0x3a')](_0xe671('0x40'),squel[_0xe671('0x45')](hopperContacts))['where'](_0xe671('0x3c')))[_0xe671('0x37')]();return _0x5df5a5;}return db[_0xe671('0x46')][_0xe671('0x47')]({'where':{'type':_0xe671('0x48')},'attributes':['id',_0xe671('0x49')],'include':[{'model':db[_0xe671('0x4a')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x2a9fd9){var _0x5d8d31=[];if(_0x2a9fd9){var _0x45279f;for(var _0x49dbe7=0x0,_0x4a0d19;_0x49dbe7<_0x2a9fd9['length'];_0x49dbe7+=0x1){_0x4a0d19=_0x2a9fd9[_0x49dbe7]['get']({'plain':!![]});switch(_0x4a0d19[_0xe671('0x49')]){case _0xe671('0x4b'):_0x5d8d31[_0xe671('0x4c')](db[_0xe671('0x4d')][_0xe671('0x4e')](_0x489b13(_0x4a0d19,_0xe671('0x4f')))[_0xe671('0x50')](function(){})['catch'](_0x325de7()));break;case _0xe671('0x51'):_0x5d8d31[_0xe671('0x4c')](db[_0xe671('0x4d')][_0xe671('0x4e')](_0x227604(_0x4a0d19,_0xe671('0x4f')))['then'](function(){})[_0xe671('0x26')](_0x325de7()));break;default:_0x5d8d31[_0xe671('0x4c')](db[_0xe671('0x4d')]['query'](_0x41fe33(_0x4a0d19,_0xe671('0x4f')))[_0xe671('0x50')](function(){})[_0xe671('0x26')](_0x325de7()));}}}return _0x5d8d31;})['all']()[_0xe671('0x50')](function(){return db[_0xe671('0x46')][_0xe671('0x47')]({'where':{'type':_0xe671('0x48')},'attributes':['id'],'include':[{'model':db[_0xe671('0x4a')],'as':_0xe671('0x52'),'where':{'id':LISTID}}]})[_0xe671('0x50')](function(_0x31e475){var _0x5cee0a=[];if(_0x31e475){var _0x242e3e;for(var _0x596ecd=0x0,_0x4cc5fb;_0x596ecd<_0x31e475[_0xe671('0x21')];_0x596ecd+=0x1){_0x4cc5fb=_0x31e475[_0x596ecd][_0xe671('0x53')]({'plain':!![]});_0x5cee0a[_0xe671('0x4c')](db[_0xe671('0x4d')]['query'](_0x5b2292(_0x4cc5fb,'VoiceQueueId'))['then'](function(){})[_0xe671('0x26')](_0x325de7()));}}return _0x5cee0a;})[_0xe671('0x54')]();})[_0xe671('0x50')](function(){return db[_0xe671('0x55')][_0xe671('0x47')]({'attributes':['id',_0xe671('0x49')],'include':[{'model':db[_0xe671('0x4a')],'as':_0xe671('0x56'),'where':{'id':LISTID}}]})[_0xe671('0x50')](function(_0x30e03e){var _0x5f5100=[];if(_0x30e03e){for(var _0x5e8957=0x0,_0x527a42;_0x5e8957<_0x30e03e[_0xe671('0x21')];_0x5e8957+=0x1){_0x527a42=_0x30e03e[_0x5e8957]['get']({'plain':!![]});switch(_0x527a42[_0xe671('0x49')]){case _0xe671('0x4b'):_0x5f5100[_0xe671('0x4c')](db[_0xe671('0x4d')]['query'](_0x489b13(_0x527a42,_0xe671('0x57')))[_0xe671('0x50')](function(){})[_0xe671('0x26')](_0x325de7()));break;case _0xe671('0x51'):_0x5f5100[_0xe671('0x4c')](db['sequelize']['query'](_0x227604(_0x527a42,'CampaignId'))[_0xe671('0x50')](function(){})[_0xe671('0x26')](_0x325de7()));break;default:_0x5f5100['push'](db['sequelize'][_0xe671('0x4e')](_0x41fe33(_0x527a42,_0xe671('0x57')))['then'](function(){})[_0xe671('0x26')](_0x325de7()));}}}return _0x5f5100;})[_0xe671('0x54')]();})[_0xe671('0x50')](function(){return db[_0xe671('0x55')][_0xe671('0x47')]({'attributes':['id'],'include':[{'model':db[_0xe671('0x4a')],'as':_0xe671('0x52'),'where':{'id':LISTID}}]})[_0xe671('0x50')](function(_0x2df34a){var _0x4fc795=[];if(_0x2df34a){for(var _0x2c42fb=0x0,_0x1c308a;_0x2c42fb<_0x2df34a[_0xe671('0x21')];_0x2c42fb+=0x1){_0x1c308a=_0x2df34a[_0x2c42fb][_0xe671('0x53')]({'plain':!![]});_0x4fc795['push'](db[_0xe671('0x4d')]['query'](_0x5b2292(_0x1c308a,'CampaignId'))['then'](function(){})[_0xe671('0x26')](_0x325de7()));}}return _0x4fc795;})[_0xe671('0x54')]();})[_0xe671('0x26')](function(_0x2a30f2){logger[_0xe671('0x12')](_0xe671('0x58'),'generalCheckHopper',_0x2a30f2[_0xe671('0x27')]);});}var processPromises=function(_0x21d99a){return BPromise[_0xe671('0x54')](promises)[_0xe671('0x50')](function(_0x1e7ab7){})[_0xe671('0x26')](function(_0x364eef){logger[_0xe671('0x12')](_0xe671('0x59'),JSON[_0xe671('0x28')](_0x364eef));})[_0xe671('0x5a')](function(){socket[_0xe671('0x5b')](_0xe671('0x5c')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x21d99a){return _0x21d99a[_0xe671('0x5d')]();}});};var endCsv=function(){return BPromise[_0xe671('0x5e')]()[_0xe671('0x50')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit'](_0xe671('0x5c')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x95f08){logger[_0xe671('0x12')](_0xe671('0x5f'),JSON[_0xe671('0x28')](_0x95f08));}finally{process['exit'](0x0);}});};process['on'](_0xe671('0x60'),function(){logger[_0xe671('0x61')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xe671('0x5e')]()[_0xe671('0x50')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xe671('0xf')](',');return db[_0xe671('0x23')][_0xe671('0x47')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xe671('0x50')](function(_0x27146e){var _0x52dff0=fs[_0xe671('0x62')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x52dff0,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2eba16,_0x2d0edd){total+=0x1;var _0x56c8d9=total;promises[_0xe671('0x4c')](checkRow(_0x2eba16,_0x27146e,_0x56c8d9)[_0xe671('0x50')](function(){success+=0x1;})[_0xe671('0x26')](function(_0x450653){if(_0x450653[_0xe671('0x12')]){errors+=0x1;delete _0x450653[_0xe671('0x12')];}else if(_0x450653[_0xe671('0x63')]){duplicates+=0x1;delete _0x450653[_0xe671('0x63')];}rows[_0xe671('0x4c')](_0x450653);}));if(total%0xc8===0x0){_0x2d0edd[_0xe671('0x64')]();return processPromises(_0x2d0edd);}},'complete':function(){return processPromises()[_0xe671('0x50')](function(){logger[_0xe671('0x61')](_0xe671('0x65'));endCsv();});},'error':function(_0x2c4042,_0xa44b0f){logger[_0xe671('0x61')]('CSV\x20parse\x20error',JSON[_0xe671('0x28')](_0x2c4042));endCsv();}});})[_0xe671('0x26')](function(_0x1a9f45){logger[_0xe671('0x12')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0xe671('0x28')](_0x1a9f45));});}main();
\ No newline at end of file
index 229ab20..d933f69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f4f=['campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','query','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','utcOffset','set','offset','main','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','keys','includes','header','ContactItemType','name','_description','AdditionalPhones','createReadStream','data','errors','find','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','hasOwnProperty','itemTypeId','description','SystemRow','appendFileSync','rows','emit','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','DROP\x20TABLE\x20','each','contactId','orderBy','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','voice_queues_has_cm_lists','VoiceQueueId','finish','affectedRows','contact:import:','unlink','catch','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','SIGINT','path','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','YYYY-MM-DD\x20HH:mm:ss','format','select','field','phone','from','.id\x20=\x20','where','join','CmContact','then','push','all','split','length','isNil','filter','CmContactHasItem','findOne','update','updated','create','PHONE','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','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','insert','cm_hopper_black','.CmListId','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','\x20=\x20','toString','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','into','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','min_id','Received\x20SIGINT','error','message','exit','info','sequelize','spread'];(function(_0x56f69f,_0x1a67f1){var _0x1a0bf8=function(_0x3ee708){while(--_0x3ee708){_0x56f69f['push'](_0x56f69f['shift']());}};_0x1a0bf8(++_0x1a67f1);}(_0x4f4f,0x1ca));var _0xf4f4=function(_0x2abde0,_0x34c56e){_0x2abde0=_0x2abde0-0x0;var _0x33d1e6=_0x4f4f[_0x2abde0];return _0x33d1e6;};'use strict';var fs=require('fs');var path=require(_0xf4f4('0x0'));var _=require('lodash');var Papa=require('papaparse');var util=require(_0xf4f4('0x1'));var BPromise=require(_0xf4f4('0x2'));var moment=require(_0xf4f4('0x3'));var squel=require(_0xf4f4('0x4'));var Redis=require('ioredis');var db=require(_0xf4f4('0x5'))['db'];var config=require('../../../config/environment');var shared=require(_0xf4f4('0x6'));var logger=require(_0xf4f4('0x7'))(_0xf4f4('0x8'));config[_0xf4f4('0x9')]=_[_0xf4f4('0xa')](config['redis'],{'host':_0xf4f4('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format'](_0xf4f4('0xc'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xf4f4('0xd')](_0xf4f4('0xc'));function isEmail(_0x4f5059){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'](_0x4f5059);}function selectNotIn(_0x45ca7b,_0x4a2920,_0x3e4d0a,_0x4431b3,_0x384835){return squel[_0xf4f4('0xe')]()[_0xf4f4('0xf')](_0xf4f4('0x10'))[_0xf4f4('0x11')](_0x4431b3)['join'](_0x4a2920,null,_0x4a2920+_0xf4f4('0x12')+_0x4431b3+'.'+_0x3e4d0a)['where'](_0x4431b3+'.'+_0x3e4d0a+'\x20=\x20'+_0x45ca7b+'.'+_0x3e4d0a)[_0xf4f4('0x13')](_0x4a2920+'.dialCheckDuplicateType\x20IN\x20('+_0x384835[_0xf4f4('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x12db64,_0xceb35f){promisesAdditionalPhones=[];return db[_0xf4f4('0x15')]['findAll']({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xf4f4('0x16')](function(_0x563347){if(_0x563347!==null){var _0x141e57=[];for(var _0x10cd15=0x0;_0x10cd15<_0x563347['length'];_0x10cd15++){var _0x47885d=_0x563347[_0x10cd15];_0x141e57[_0xf4f4('0x17')](insertAdditionalPhones(_0x47885d));}}Promise[_0xf4f4('0x18')](_0x141e57)[_0xf4f4('0x16')](function(){_0x12db64({'val':0x1});});});});}function insertAdditionalPhones(_0x80dd5e){return new Promise(function(_0x2e5808,_0x3f615c){var _0x219ca5=_0x80dd5e['AdditionalPhones'];var _0x56afd5=_0x219ca5[_0xf4f4('0x19')](';');var _0xbde985=[];orderBy=0x0;for(var _0x27dd17=0x0;_0x27dd17<_0x56afd5['length'];_0x27dd17++){_0xbde985[_0xf4f4('0x17')](splitAdditionalPhone(_0x80dd5e['id'],_0x56afd5[_0x27dd17]));}Promise[_0xf4f4('0x18')](_0xbde985)[_0xf4f4('0x16')](function(){_0x2e5808({'val':_0x56afd5[_0xf4f4('0x1a')]});});});}function splitAdditionalPhone(_0x20d761,_0x44f072){return new Promise(function(_0x31a538,_0x196a27){var _0x77905d=_0x44f072[_0xf4f4('0x19')](':');var _0x4240a0=_0x77905d[0x0];var _0x28bc6e=_0x77905d[0x1];if(!_[_0xf4f4('0x1b')](_0x28bc6e)){var _0x2fce8b=_0x28bc6e['split']('|');var _0xece40f=[];for(var _0xca0574=0x0;_0xca0574<_0x2fce8b[_0xf4f4('0x1a')];_0xca0574++){if(_0x2fce8b[_0xca0574]!==''){var _0x1b78f1=_[_0xf4f4('0x1c')](promisesAdditionalPhones,{'contactId':_0x20d761,'phone':_0x2fce8b[_0xca0574]});if(_0x1b78f1['length']==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x20d761,'contactTypeId':_0x4240a0,'phone':_0x2fce8b[_0xca0574],'orderBy':orderBy});}}}_0x31a538({'ok':0x1});}else _0x31a538({'res':0x0});});}function createAdditionalPhone(_0x292693,_0x24781b,_0x6ea8b1,_0x411b98){var _0x42bd80='';var _0x288379='';var _0x3601f5=_0x6ea8b1['split']('§');_0x42bd80=_0x3601f5[0x0];if(_0x3601f5[_0xf4f4('0x1a')]==0x2)_0x288379=_0x3601f5[0x1];return new Promise(function(_0x2b1599,_0x9666a){return db[_0xf4f4('0x1d')][_0xf4f4('0x1e')]({'where':{'CmContactId':_0x292693,'item':_0x42bd80}})[_0xf4f4('0x16')](function(_0x58c2a2){if(_0x58c2a2){return db['CmContactHasItem'][_0xf4f4('0x1f')]({'ItemTypeId':_0x24781b,'description':_0x288379,'OrderBy':_0x411b98},{'where':{'CmContactId':_0x292693,'item':_0x42bd80}})['then'](function(_0x1f4937){_0x2b1599({'res':_0xf4f4('0x20')});});}else{return db['CmContactHasItem'][_0xf4f4('0x21')]({'CmContactId':_0x292693,'item':_0x42bd80,'description':_0x288379,'ItemTypeId':_0x24781b,'OrderBy':_0x411b98,'ItemClass':_0xf4f4('0x22')})[_0xf4f4('0x16')](function(_0x6740a5){_0x2b1599({'res':_0xf4f4('0x23')});});}});});}function insertCmHopper(_0x2c8029,_0x113fbb,_0x144b95,_0x407d82,_0x905e7b){var _0x32c3fa=[_0xf4f4('0x24'),_0xf4f4('0x25'),_0xf4f4('0x26'),_0xf4f4('0x27'),_0x113fbb+'.'+_0x407d82,_0xf4f4('0x28'),_0xf4f4('0x29'),_0xf4f4('0x2a'),_0xf4f4('0x2b'),'\x22'+_0x905e7b+'\x22'];return squel['insert']()['into']('cm_hopper')[_0xf4f4('0x2c')]([_0xf4f4('0x10'),_0xf4f4('0x2d'),_0xf4f4('0x2e'),_0xf4f4('0x2f'),_0x407d82,_0xf4f4('0x30'),_0xf4f4('0x31'),_0xf4f4('0x32'),_0xf4f4('0x33'),_0xf4f4('0x34')],squel['select']()[_0xf4f4('0x35')](_0x32c3fa)[_0xf4f4('0x11')](_0x113fbb)[_0xf4f4('0x14')](_0xf4f4('0x36'),null,_0xf4f4('0x37')+_0x113fbb+'.CmListId')['join'](_0x144b95,null,_0x144b95+_0xf4f4('0x12')+_0x113fbb+'.'+_0x407d82)['where'](_0x113fbb+_0xf4f4('0x38'),_0x2c8029)[_0xf4f4('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xf4f4('0x13')](_0xf4f4('0x39'),selectNotIn(_0x113fbb,_0x144b95,_0x407d82,_0xf4f4('0x3a'),[_0xf4f4('0x3b'),_0xf4f4('0x3c')]))[_0xf4f4('0x13')](_0xf4f4('0x39'),selectNotIn(_0x113fbb,_0x144b95,_0x407d82,'cm_hopper',[_0xf4f4('0x3b')])))['toString']();}function insertCmHopperBlack(_0x496c1a,_0x4c7900,_0x15727c,_0x4dfd36){var _0x2ef5e1=[_0xf4f4('0x24'),_0xf4f4('0x26'),_0xf4f4('0x27'),_0x4c7900+'.'+_0x4dfd36,_0xf4f4('0x28'),_0xf4f4('0x29')];return squel[_0xf4f4('0x3d')]()['into'](_0xf4f4('0x3e'))[_0xf4f4('0x2c')]([_0xf4f4('0x10'),_0xf4f4('0x2e'),_0xf4f4('0x2f'),_0x4dfd36,'createdAt','updatedAt'],squel['select']()[_0xf4f4('0x35')](_0x2ef5e1)['from'](_0x4c7900)['join'](_0xf4f4('0x36'),null,'cm_contacts.ListId\x20=\x20'+_0x4c7900+_0xf4f4('0x3f'))[_0xf4f4('0x14')](_0x15727c,null,_0x15727c+_0xf4f4('0x12')+_0x4c7900+'.'+_0x4dfd36)[_0xf4f4('0x13')](_0x4c7900+_0xf4f4('0x38'),_0x496c1a)[_0xf4f4('0x13')](_0xf4f4('0x40'),NOW)[_0xf4f4('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xf4f4('0xe')]()[_0xf4f4('0xf')](_0xf4f4('0x10'))[_0xf4f4('0x11')](_0xf4f4('0x3e'))[_0xf4f4('0x13')](_0xf4f4('0x41'),_0x496c1a)[_0xf4f4('0x13')](_0x4dfd36+_0xf4f4('0x42')+_0x4c7900+'.'+_0x4dfd36)))[_0xf4f4('0x43')]();}function insertTzCmHopper(_0x401bad,_0x58361,_0x71937c,_0x3b9313,_0x31a31a,_0x68085e){var _0x2587fb=[_0xf4f4('0x24'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x68085e+'.offset-cm_contacts.utcOffset\x20minute)',_0xf4f4('0x26'),_0xf4f4('0x27'),_0x58361+'.'+_0x3b9313,_0xf4f4('0x28'),'cm_contacts.updatedAt',_0xf4f4('0x2a'),'cm_contacts.UserId','\x22'+_0x31a31a+'\x22'];var _0x560a37=squel[_0xf4f4('0x3d')]()['into'](_0xf4f4('0x3a'))['fromQuery']([_0xf4f4('0x10'),'scheduledat',_0xf4f4('0x2e'),_0xf4f4('0x2f'),_0x3b9313,_0xf4f4('0x30'),_0xf4f4('0x31'),_0xf4f4('0x32'),_0xf4f4('0x33'),_0xf4f4('0x34')],squel[_0xf4f4('0xe')]()[_0xf4f4('0x35')](_0x2587fb)['from'](_0x58361)[_0xf4f4('0x14')](_0xf4f4('0x36'),null,_0xf4f4('0x37')+_0x58361+_0xf4f4('0x3f'))['join'](_0x71937c,null,_0x71937c+_0xf4f4('0x12')+_0x58361+'.'+_0x3b9313)['join'](_0x68085e,null,_0x68085e+_0xf4f4('0x12')+_0x58361+'.'+_0x3b9313)[_0xf4f4('0x13')](_0x58361+_0xf4f4('0x38'),_0x401bad)[_0xf4f4('0x13')](_0xf4f4('0x40'),NOW)[_0xf4f4('0x13')](_0xf4f4('0x39'),selectNotIn(_0x58361,_0x71937c,_0x3b9313,_0xf4f4('0x3a'),[_0xf4f4('0x3b'),_0xf4f4('0x3c')]))[_0xf4f4('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x58361,_0x71937c,_0x3b9313,_0xf4f4('0x3a'),[_0xf4f4('0x3b')])))[_0xf4f4('0x43')]();return _0x560a37;}function insertTzCmHopperBlack(_0x44db17,_0x5cbaa6,_0x468061,_0x575553){var _0x2bf708=[_0xf4f4('0x24'),_0xf4f4('0x26'),_0xf4f4('0x27'),_0x5cbaa6+'.'+_0x575553,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0xf4f4('0x3d')]()['into'](_0xf4f4('0x3e'))['fromQuery']([_0xf4f4('0x10'),_0xf4f4('0x2e'),'ListId',_0x575553,'createdAt','updatedAt'],squel['select']()[_0xf4f4('0x35')](_0x2bf708)[_0xf4f4('0x11')](_0x5cbaa6)[_0xf4f4('0x14')](_0xf4f4('0x36'),null,_0xf4f4('0x37')+_0x5cbaa6+_0xf4f4('0x3f'))[_0xf4f4('0x14')](_0x468061,null,_0x468061+_0xf4f4('0x12')+_0x5cbaa6+'.'+_0x575553)[_0xf4f4('0x13')](_0x5cbaa6+'.CmListId\x20=\x20?',_0x44db17)[_0xf4f4('0x13')](_0xf4f4('0x40'),NOW)['where'](_0xf4f4('0x39'),squel['select']()['field']('phone')['from']('cm_hopper_black')[_0xf4f4('0x13')](_0xf4f4('0x41'),_0x44db17)['where'](_0x575553+_0xf4f4('0x42')+_0x5cbaa6+'.'+_0x575553)))[_0xf4f4('0x43')]();}function insertCmHopperAdditionalPhones(_0x5e713d){var _0xd0953=[_0xf4f4('0x44'),_0xf4f4('0x45'),_0xf4f4('0x46'),'cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt'];return squel['insert']()[_0xf4f4('0x47')](_0xf4f4('0x48'))[_0xf4f4('0x2c')]([_0xf4f4('0x49'),_0xf4f4('0x10'),_0xf4f4('0x4a'),_0xf4f4('0x30'),'updatedAt'],squel[_0xf4f4('0xe')]()[_0xf4f4('0x35')](_0xd0953)[_0xf4f4('0x11')]('cm_hopper')['join'](_0xf4f4('0x36'),null,_0xf4f4('0x4b'))[_0xf4f4('0x14')]('cm_contact_has_items',null,_0xf4f4('0x4c'))['where'](_0xf4f4('0x4d'),_0x5e713d)[_0xf4f4('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0xf4f4('0x43')]();}function insertCmContact(_0x5efccc,_0x395f4e,_0x100336,_0x59d5d5){var _0x2222b2=_[_0xf4f4('0x4e')](_['keys'](_0x59d5d5),[_0xf4f4('0x2f'),_0xf4f4('0x4f'),_0xf4f4('0x30'),_0xf4f4('0x31')]);return squel[_0xf4f4('0x3d')]()['into'](_0xf4f4('0x36'))[_0xf4f4('0x2c')](_0x2222b2,squel['select']()[_0xf4f4('0x35')](_0x2222b2)[_0xf4f4('0x11')](_0x395f4e)[_0xf4f4('0x13')]('('+_0x100336[_0xf4f4('0x14')](',')+_0xf4f4('0x50'),squel[_0xf4f4('0xe')]()[_0xf4f4('0x35')](_0x100336)[_0xf4f4('0x11')](_0xf4f4('0x36'))[_0xf4f4('0x13')]('ListId\x20=\x20?',_0x5efccc)['where'](_0xf4f4('0x51')))[_0xf4f4('0x13')](_0xf4f4('0x52'),squel[_0xf4f4('0xe')]()[_0xf4f4('0xf')]('MIN(id)',_0xf4f4('0x53'))[_0xf4f4('0x11')](_0x395f4e)['group'](_0x100336[_0xf4f4('0x14')](','))))[_0xf4f4('0x43')]();}function handleStop(){logger['info'](_0xf4f4('0x54'));stopped=!![];}function handleUncaughtException(_0x5f0edd){logger[_0xf4f4('0x55')](_0x5f0edd[_0xf4f4('0x56')]);process[_0xf4f4('0x57')](0x1);}function handleError(_0xec8e34,_0x538456){stats['errors'][_0xf4f4('0x17')]({'name':_0x538456['code'],'message':_0x538456[_0xf4f4('0x56')],'row':_0xec8e34});}function handleQuery(_0x9e0760){logger[_0xf4f4('0x58')](_0x9e0760);return db[_0xf4f4('0x59')]['query'](_0x9e0760)[_0xf4f4('0x5a')](function(_0x562553){results[_0xf4f4('0x17')](_0x562553);})['catch'](function(_0x4c57bf){logger['error'](_0x4c57bf['message']);});}function updateTzCampaigns(_0x2d9c7c){return new Promise(function(_0x10c41d,_0x307ef1){var _0x4d3877=squel[_0xf4f4('0xe')]()[_0xf4f4('0x35')]([_0xf4f4('0x5b'),_0xf4f4('0x5c')])[_0xf4f4('0x11')](_0xf4f4('0x5d'))[_0xf4f4('0x14')](_0xf4f4('0x5e'),null,_0xf4f4('0x5f'))[_0xf4f4('0x13')](_0xf4f4('0x60')+_0x2d9c7c);db[_0xf4f4('0x59')][_0xf4f4('0x61')](_0x4d3877['toString']())[_0xf4f4('0x5a')](function(_0x2289bf){var _0x432d8c=[];for(var _0x2d0a92=0x0;_0x2d0a92<_0x2289bf[_0xf4f4('0x1a')];_0x2d0a92++){_0x432d8c[_0xf4f4('0x17')](getTimezoneData(_0x2289bf[_0x2d0a92],tmp_campaigns));}BPromise['all'](_0x432d8c)['then'](function(){_0x10c41d({'val':0x1});});})['catch'](function(_0xcbce4a){logger[_0xf4f4('0x55')](_0xcbce4a['message']);_0x10c41d({'val':0x0});});});}function updateTzVoiceQueues(_0x289d8b){return new Promise(function(_0x5d774b,_0x16b8b7){var _0x36f728=squel[_0xf4f4('0xe')]()[_0xf4f4('0x35')]([_0xf4f4('0x62'),_0xf4f4('0x63')])[_0xf4f4('0x11')](_0xf4f4('0x64'))[_0xf4f4('0x14')]('voice_queues_has_cm_lists',null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0xf4f4('0x13')](_0xf4f4('0x65')+_0x289d8b);db[_0xf4f4('0x59')][_0xf4f4('0x61')](_0x36f728[_0xf4f4('0x43')]())[_0xf4f4('0x5a')](function(_0x3dea02){var _0x5b2434=[];for(var _0x182a04=0x0;_0x182a04<_0x3dea02['length'];_0x182a04++){_0x5b2434[_0xf4f4('0x17')](getTimezoneData(_0x3dea02[_0x182a04],tmp_voice_queues));}BPromise[_0xf4f4('0x18')](_0x5b2434)[_0xf4f4('0x16')](function(){_0x5d774b({'val':0x1});});})['catch'](function(_0xb035a1){logger[_0xf4f4('0x55')](_0xb035a1[_0xf4f4('0x56')]);_0x5d774b({'val':0x0});});});}function getTimezoneData(_0x5be2b6,_0x53c5c2){return new Promise(function(_0x232e4e,_0x57b3b5){var _0x2c02c6=shared[_0xf4f4('0x66')];var _0xcb9df7=_0x2c02c6[_0x5be2b6[_0xf4f4('0x67')]];if(_[_0xf4f4('0x1b')](_0xcb9df7)){_0x232e4e({'ret':0x1});}else{var _0x2d1ce7=_0xcb9df7[_0xf4f4('0x68')];var _0x273a0f=squel[_0xf4f4('0x3d')]()[_0xf4f4('0x47')](_0x53c5c2)[_0xf4f4('0x69')]('id',_0x5be2b6['id'])[_0xf4f4('0x69')](_0xf4f4('0x6a'),_0x2d1ce7)[_0xf4f4('0x69')](_0xf4f4('0x67'),_0x5be2b6['dialTimezone'])[_0xf4f4('0x43')]();return db[_0xf4f4('0x59')][_0xf4f4('0x61')](_0x273a0f)[_0xf4f4('0x5a')](function(_0x1d7a80){_0x232e4e({'ret':0x1});})['catch'](function(_0x5c26dc){logger[_0xf4f4('0x55')](_0x5c26dc[_0xf4f4('0x56')]);_0x57b3b5({'ret':0x1});});}});}function handleTZQuery(_0x1fc06a){logger[_0xf4f4('0x58')](_0x1fc06a);return db[_0xf4f4('0x59')][_0xf4f4('0x61')](_0x1fc06a)[_0xf4f4('0x5a')](function(_0x19facf){})['catch'](function(_0x4f5e6b){logger[_0xf4f4('0x55')](_0x4f5e6b['message']);});}function main(_0x260a1e,_0x4c96ee,_0x112919,_0x4e55c4){logger[_0xf4f4('0x58')](_0xf4f4('0x6b'),_0x260a1e,JSON['stringify'](_0x4c96ee));process['send'](_0xf4f4('0x6c'));var _0x34d081=_0x4c96ee[_0xf4f4('0x6d')];var _0x370777=_[_0xf4f4('0x6e')](_0x34d081);var _0x509c95=_0x4c96ee[_0xf4f4('0x6f')];var _0x1d1723=path[_0xf4f4('0x14')](config[_0xf4f4('0x70')],_0xf4f4('0x71'),_0x509c95+_0xf4f4('0x72'));hasTZ=_[_0xf4f4('0x73')](_0x34d081)[_0xf4f4('0x74')]('dialTimezone');var _0x7b57d7=_[_0xf4f4('0x73')](_0x34d081)[_0xf4f4('0x14')]();logger[_0xf4f4('0x58')](_0xf4f4('0x75'),_0x7b57d7);db[_0xf4f4('0x76')]['findAll']({'raw':!![],'attributes':['id',_0xf4f4('0x77')]})[_0xf4f4('0x16')](function(_0x17f560){for(var _0xc50c35=0x0;_0xc50c35<_0x17f560[_0xf4f4('0x1a')];_0xc50c35++){if(_0x17f560[_0xc50c35][_0xf4f4('0x77')]in _0x34d081){contactItemTypes[_0xf4f4('0x17')](_0x17f560[_0xc50c35]);delete _0x370777[_0x17f560[_0xc50c35]['name']];hasAdditionalPhones=!![];}for(var _0x142e45 in _0x34d081){if(_0x17f560[_0xc50c35][_0xf4f4('0x77')]+_0xf4f4('0x78')===_0x142e45){phoneDescriptions[_0xf4f4('0x17')]({'itemTypeId':_0x17f560[_0xc50c35]['id'],'description':_0x142e45});delete _0x370777[_0x142e45];}}}if(hasAdditionalPhones)_0x370777[_0xf4f4('0x79')]='';var _0x55f51d=_[_0xf4f4('0x73')](_0x370777)[_0xf4f4('0x14')]();logger[_0xf4f4('0x58')](_0xf4f4('0x75'),_0x55f51d);fs['writeFileSync'](_0x1d1723,_0x55f51d+'\x0a');Papa['parse'](fs[_0xf4f4('0x7a')](_0x260a1e),{'header':!![],'skipEmptyLines':!![],'step':function(_0x53a27c,_0x2d40b4){try{for(var _0x13c85d=0x0,_0x27351d=[];_0x13c85d<_0x53a27c[_0xf4f4('0x7b')]['length'];_0x13c85d++){stats['rows']+=0x1;if(_0x53a27c[_0xf4f4('0x7c')][_0x13c85d]){handleError(_0x53a27c[_0xf4f4('0x7b')][_0x13c85d],_0x53a27c[_0xf4f4('0x7c')][_0x13c85d]);}else{var _0x1f6feb=[];var _0x219d51=[];var _0x19fa7c={};for(var _0x47d67b in _0x34d081){let _0x554ad4=contactItemTypes[_0xf4f4('0x7d')](_0x4ecfdb=>_0x4ecfdb[_0xf4f4('0x77')]===_0x47d67b);let _0x567584=contactItemTypes[_0xf4f4('0x7d')](_0x122e79=>_0x122e79[_0xf4f4('0x77')]+'_description'===_0x47d67b);if(_[_0xf4f4('0x1b')](_0x554ad4)&&_[_0xf4f4('0x1b')](_0x567584)){if(_0x34d081['hasOwnProperty'](_0x47d67b)){if(_0x53a27c[_0xf4f4('0x7b')][_0x13c85d][_0x34d081[_0x47d67b]]){var _0x3be4a6=_[_0xf4f4('0x7e')](_0x53a27c[_0xf4f4('0x7b')][_0x13c85d][_0x34d081[_0x47d67b]][_0xf4f4('0x7f')](/"/g,'\x27'));switch(_0x47d67b){case _0xf4f4('0x2d'):var _0x28b15b=moment(_0x3be4a6,_0xf4f4('0xc'),!![]);if(_0x28b15b['isValid']()){_0x27351d[_0xf4f4('0x17')]('\x22'+_0x3be4a6+'\x22');}else{_0x1f6feb[_0xf4f4('0x17')](_0xf4f4('0x80'));}break;case _0xf4f4('0x32'):var _0x226bf5=parseInt(_0x3be4a6);_0x3be4a6=_[_0xf4f4('0x81')](_0x226bf5)||_0x226bf5<0x0||_0x226bf5>0x4?_0x4e55c4?0x3:0x2:_0x226bf5;_0x27351d[_0xf4f4('0x17')]('\x22'+_0x3be4a6+'\x22');break;case'UserId':var _0x1c3141=parseInt(_0x3be4a6);if(_[_0xf4f4('0x82')](_0x1c3141)&&_[_0xf4f4('0x74')](_0x112919,_0x1c3141)){_0x27351d[_0xf4f4('0x17')]('\x22'+_0x1c3141+'\x22');}else{_0x1f6feb[_0xf4f4('0x17')](_0xf4f4('0x83'));}break;case'email':if(isEmail(_0x3be4a6)){_0x27351d[_0xf4f4('0x17')]('\x22'+_0x3be4a6+'\x22');}else{_0x1f6feb[_0xf4f4('0x17')](_0xf4f4('0x84'));}break;case _0xf4f4('0x85'):var _0x4a0489=moment(_0x3be4a6,_0xf4f4('0x86'),!![]);if(_0x4a0489[_0xf4f4('0x87')]()){_0x27351d[_0xf4f4('0x17')]('\x22'+_0x3be4a6+'\x22');}else{_0x1f6feb[_0xf4f4('0x17')](_0xf4f4('0x88'));}break;case'dialTimezone':var _0x1d9277=shared[_0xf4f4('0x66')];var _0x1acef0=_0x1d9277[_0x3be4a6];if(!_['isNil'](_0x1acef0)){var _0x1adffe=_0x1acef0[_0xf4f4('0x68')];_0x27351d[_0xf4f4('0x17')]('\x22'+_0x3be4a6+'\x22');_0x27351d[_0xf4f4('0x17')]('\x22'+_0x1adffe+'\x22');}break;default:_0x27351d[_0xf4f4('0x17')]('\x22'+_0x3be4a6+'\x22');}}else{switch(_0x47d67b){case _0xf4f4('0x89'):case _0xf4f4('0x10'):_0x1f6feb['push'](_0x47d67b+_0xf4f4('0x8a'));break;default:_0x27351d[_0xf4f4('0x17')]('\x22\x22');}}}}else{var _0x20c942='';if(!_[_0xf4f4('0x1b')](_0x554ad4)){if(!_0x19fa7c[_0xf4f4('0x8b')](_0x554ad4['id'])){if(!_[_0xf4f4('0x1b')](_0x53a27c['data'][_0x13c85d][_0x34d081[_0x47d67b]])){var _0x3be4a6=_['trim'](_0x53a27c[_0xf4f4('0x7b')][_0x13c85d][_0x34d081[_0x47d67b]][_0xf4f4('0x7f')](/"/g,'\x27'));var _0x4a1c52=phoneDescriptions[_0xf4f4('0x7d')](_0x1ac941=>_0x1ac941[_0xf4f4('0x8c')]===_0x554ad4['id']);if(!_[_0xf4f4('0x1b')](_0x4a1c52)){var _0x416dbe=_[_0xf4f4('0x7e')](_0x53a27c['data'][_0x13c85d][_0x34d081[_0x4a1c52[_0xf4f4('0x8d')]]]['replace'](/"/g,'\x27'));if(!_[_0xf4f4('0x1b')](_0x416dbe))_0x3be4a6=_0x3be4a6+'§'+_0x416dbe;}if(_0x20c942=='')_0x20c942=_0x3be4a6;else _0x20c942+='|'+_0x3be4a6;}_0x219d51[_0xf4f4('0x17')](_0x554ad4['id']+':'+_0x20c942);_0x19fa7c[_0x554ad4['id']]=0x1;}}}}if(hasAdditionalPhones){_0x27351d[_0xf4f4('0x17')]('\x22'+_0x219d51[_0xf4f4('0x14')](';')+'\x22');}if(_0x1f6feb[_0xf4f4('0x1a')]){handleError(_0x53a27c[_0xf4f4('0x7b')][_0x13c85d],{'code':_0xf4f4('0x8e'),'message':_0x1f6feb['join']()});}else{fs[_0xf4f4('0x8f')](_0x1d1723,_0x27351d[_0xf4f4('0x14')]()+'\x0a');}_0x27351d=[];}if(!(stats[_0xf4f4('0x90')]%0xc8)){socket[_0xf4f4('0x91')]('contact:import:'+_0x509c95,stats);stats[_0xf4f4('0x7c')]=[];}}if(stopped){logger['info']('Abort\x20parser');_0x2d40b4[_0xf4f4('0x92')]();}}catch(_0x397f8a){handleError(_0x53a27c[_0xf4f4('0x7b')][_0x13c85d],{'code':_0xf4f4('0x93'),'message':_0x397f8a['message']});logger['error'](_0xf4f4('0x94'),_0x397f8a['message']);}},'complete':function(){try{var _0x21f509=[];var _0x96778e=[];var _0x2f9d42=_0xf4f4('0x36');if(_0x4c96ee[_0xf4f4('0x95')]&&_0x4c96ee[_0xf4f4('0x95')]['length']){_0x2f9d42=_0xf4f4('0x96')+_0x509c95;_0x21f509[_0xf4f4('0x17')](_0xf4f4('0x97')+_0x2f9d42+_0xf4f4('0x98'));}tmp_campaigns=_0xf4f4('0x99')+_0x509c95;tmp_voice_queues=_0xf4f4('0x9a')+_0x509c95;_0x96778e[_0xf4f4('0x17')](_0xf4f4('0x97')+tmp_campaigns+_0xf4f4('0x9b'));_0x96778e[_0xf4f4('0x17')](_0xf4f4('0x97')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise['each'](_0x96778e,handleTZQuery)[_0xf4f4('0x16')](function(_0xc85013){updateTzCampaigns(_0x4c96ee[_0xf4f4('0x2f')])[_0xf4f4('0x16')](function(_0x34e85f){updateTzVoiceQueues(_0x4c96ee[_0xf4f4('0x2f')])['then'](function(_0x36ee3d){if(hasTZ)_0x55f51d=_0x55f51d[_0xf4f4('0x7f')](_0xf4f4('0x67'),_0xf4f4('0x9c'));var _0x59e899=util[_0xf4f4('0xd')](_0xf4f4('0x9d'),_0x1d1723,_0x2f9d42,_0x55f51d,_0x4c96ee['ListId'],_0x4c96ee[_0xf4f4('0x4f')]||null,NOW,NOW);if(_['isNil'](_0x34d081['scheduledat'])){_0x59e899+=',\x20scheduledAt\x20=\x20NOW()';}_0x21f509[_0xf4f4('0x17')](_0x59e899);if(_0x4c96ee['duplicates']&&_0x4c96ee[_0xf4f4('0x95')][_0xf4f4('0x1a')]){_0x21f509[_0xf4f4('0x17')](insertCmContact(_0x4c96ee[_0xf4f4('0x2f')],_0x2f9d42,_0x4c96ee[_0xf4f4('0x95')],_0x34d081));_0x21f509[_0xf4f4('0x17')](_0xf4f4('0x9e')+_0x2f9d42+';');}BPromise[_0xf4f4('0x9f')](_0x21f509,handleQuery)[_0xf4f4('0x16')](function(_0x48e53e){BPromise[_0xf4f4('0x18')]([handleAdditionalPhones()])[_0xf4f4('0x16')](function(){_0x21f509=[];for(var _0x557ba1=0x0;_0x557ba1<promisesAdditionalPhones[_0xf4f4('0x1a')];_0x557ba1++){if(promisesAdditionalPhones[_0x557ba1]['phone']!='§'){_0x21f509[_0xf4f4('0x17')](createAdditionalPhone(promisesAdditionalPhones[_0x557ba1][_0xf4f4('0xa0')],promisesAdditionalPhones[_0x557ba1]['contactTypeId'],promisesAdditionalPhones[_0x557ba1][_0xf4f4('0x10')],promisesAdditionalPhones[_0x557ba1][_0xf4f4('0xa1')]));}}BPromise['all'](_0x21f509)['then'](function(){_0x21f509=[];if(hasTZ){_0x21f509['push'](insertTzCmHopper(_0x4c96ee[_0xf4f4('0x2f')],'voice_queues_has_cm_lists',_0xf4f4('0x64'),'VoiceQueueId',_0x4e55c4,tmp_voice_queues));_0x21f509[_0xf4f4('0x17')](insertTzCmHopperBlack(_0x4c96ee['ListId'],_0xf4f4('0xa2'),_0xf4f4('0x64'),'VoiceQueueId'));_0x21f509['push'](insertTzCmHopper(_0x4c96ee[_0xf4f4('0x2f')],'campaigns_has_cm_lists',_0xf4f4('0x5d'),_0xf4f4('0xa3'),_0x4e55c4,tmp_campaigns));_0x21f509[_0xf4f4('0x17')](insertTzCmHopperBlack(_0x4c96ee['ListId'],_0xf4f4('0xa4'),'campaigns',_0xf4f4('0xa3')));_0x21f509[_0xf4f4('0x17')](insertCmHopperAdditionalPhones(_0x4c96ee['ListId']));}else{_0x21f509['push'](insertCmHopper(_0x4c96ee['ListId'],_0xf4f4('0xa5'),'voice_queues',_0xf4f4('0xa6'),_0x4e55c4));_0x21f509['push'](insertCmHopperBlack(_0x4c96ee[_0xf4f4('0x2f')],_0xf4f4('0xa2'),_0xf4f4('0x64'),_0xf4f4('0xa6')));_0x21f509[_0xf4f4('0x17')](insertCmHopper(_0x4c96ee['ListId'],_0xf4f4('0x5e'),_0xf4f4('0x5d'),_0xf4f4('0xa3'),_0x4e55c4));_0x21f509[_0xf4f4('0x17')](insertCmHopperBlack(_0x4c96ee[_0xf4f4('0x2f')],'campaigns_has_cm_blacklists',_0xf4f4('0x5d'),_0xf4f4('0xa3')));_0x21f509[_0xf4f4('0x17')](insertCmHopperAdditionalPhones(_0x4c96ee['ListId']));}_0x21f509[_0xf4f4('0x17')](_0xf4f4('0x9e')+tmp_campaigns+';');_0x21f509[_0xf4f4('0x17')](_0xf4f4('0x9e')+tmp_voice_queues+';');BPromise[_0xf4f4('0x9f')](_0x21f509,handleQuery)[_0xf4f4('0x16')](function(_0x18cd40){stats[_0xf4f4('0xa7')]=!![];stats[_0xf4f4('0xa8')]=_0x4c96ee['duplicates']&&_0x4c96ee['duplicates'][_0xf4f4('0x1a')]?results[0x2][_0xf4f4('0xa8')]:results[0x0]['affectedRows'];socket[_0xf4f4('0x91')](_0xf4f4('0xa9')+_0x509c95,stats);fs[_0xf4f4('0xaa')](_0x260a1e);fs[_0xf4f4('0xaa')](_0x1d1723);process[_0xf4f4('0x57')](0x0);})[_0xf4f4('0xab')](function(_0x117da7){logger[_0xf4f4('0x55')](_0x117da7['message']);process[_0xf4f4('0x57')](0x1);});});});})['catch'](function(_0x36315f){logger[_0xf4f4('0x55')](_0x36315f[_0xf4f4('0x56')]);process[_0xf4f4('0x57')](0x1);});});});});}catch(_0xb0f706){logger['error'](_0xf4f4('0xac'),_0xb0f706['message']);process[_0xf4f4('0x57')](0x1);}},'error':function(_0x3b654e,_0x551df6,_0x3f10cb,_0x15210c){throw new Error(_0x15210c);}});});}function validate(){if(process['argv']&&process[_0xf4f4('0xad')][_0xf4f4('0x1a')]<0x4){throw new Error(_0xf4f4('0xae'));}var _0x250f91=path[_0xf4f4('0x14')](config[_0xf4f4('0x70')],_0xf4f4('0x71'),process[_0xf4f4('0xad')][0x2]);if(!fs[_0xf4f4('0xaf')](_0x250f91)){throw new Error(_0xf4f4('0xb0'));}var _0x2794b8={};try{_0x2794b8=JSON[_0xf4f4('0xb1')](process['argv'][0x3]);if(!_0x2794b8[_0xf4f4('0x6d')]){throw new Error(_0xf4f4('0xb2'));}if(!_0x2794b8[_0xf4f4('0x6d')][_0xf4f4('0x10')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x2794b8[_0xf4f4('0x6d')]['firstName']){throw new Error(_0xf4f4('0xb3'));}var _0x1f9cd8=0x0;if(_0x2794b8['binding']['UserId']){_0x1f9cd8=0x1;}if(!_0x2794b8[_0xf4f4('0x2f')]){throw new Error(_0xf4f4('0xb4'));}}catch(_0xb4d8ea){throw new Error(_0xf4f4('0xb5'));}var _0x3a25e8=[];try{_0x3a25e8=_['map'](JSON[_0xf4f4('0xb1')](process[_0xf4f4('0xad')][0x4]),'id');}catch(_0x11ddf9){logger[_0xf4f4('0x58')]('No\x20agent\x20available');}main(_0x250f91,_0x2794b8,_0x3a25e8,_0x1f9cd8);}validate();process['on'](_0xf4f4('0xb6'),handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
+var _0xfb51=['message','exit','errors','sequelize','query','spread','catch','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns_has_cm_lists.CmListId=','all','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','set','offset','stringify','send','start','binding','clone','socket_timestamp','.csv','keys','includes','name','header','writeFileSync','parse','data','rows','find','_description','hasOwnProperty','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','agent\x20not\x20exists','email','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','utcOffset','firstName','itemTypeId','description','replace','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','SystemError','step','duplicates','\x20LIKE\x20cm_contacts;','voice_queues_','CREATE\x20TABLE\x20','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','DROP\x20TABLE\x20','contactId','contactTypeId','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','root','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','No\x20agent\x20available','uncaughtException','path','lodash','util','bluebird','squel','ioredis','../../../mysqldb','../../../config/logger','import','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','from','join','.id\x20=\x20','where','\x20=\x20','CmContact','findAll','AdditionalPhones','then','length','push','split','isNil','filter','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','cm_contacts.phone','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.UserId','insert','into','phone','ContactId','ListId','createdAt','UserId','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','fromQuery','updatedAt','cm_hopper_black','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.id','cm_contacts.updatedAt','cm_contacts.priority','scheduledat','priority','recallme','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_hopper_additional_phones','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','info','Received\x20SIGINT','error'];(function(_0x89eb20,_0xda9928){var _0x18a51e=function(_0x51c397){while(--_0x51c397){_0x89eb20['push'](_0x89eb20['shift']());}};_0x18a51e(++_0xda9928);}(_0xfb51,0x1c1));var _0x1fb5=function(_0x16d411,_0x5e0970){_0x16d411=_0x16d411-0x0;var _0x20336d=_0xfb51[_0x16d411];return _0x20336d;};'use strict';var fs=require('fs');var path=require(_0x1fb5('0x0'));var _=require(_0x1fb5('0x1'));var Papa=require('papaparse');var util=require(_0x1fb5('0x2'));var BPromise=require(_0x1fb5('0x3'));var moment=require('moment');var squel=require(_0x1fb5('0x4'));var Redis=require(_0x1fb5('0x5'));var db=require(_0x1fb5('0x6'))['db'];var config=require('../../../config/environment');var shared=require('../../../config/environment/shared');var logger=require(_0x1fb5('0x7'))(_0x1fb5('0x8'));config[_0x1fb5('0x9')]=_[_0x1fb5('0xa')](config['redis'],{'host':_0x1fb5('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1fb5('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x1fb5('0xc')]('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()['format'](_0x1fb5('0xd'));function isEmail(_0xf2b9c4){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))*$/[_0x1fb5('0xe')](_0xf2b9c4);}function selectNotIn(_0x1ec20a,_0x3e49d1,_0x20ecf4,_0x4e35b6,_0x18b4ce){return squel[_0x1fb5('0xf')]()[_0x1fb5('0x10')]('phone')[_0x1fb5('0x11')](_0x4e35b6)[_0x1fb5('0x12')](_0x3e49d1,null,_0x3e49d1+_0x1fb5('0x13')+_0x4e35b6+'.'+_0x20ecf4)[_0x1fb5('0x14')](_0x4e35b6+'.'+_0x20ecf4+_0x1fb5('0x15')+_0x1ec20a+'.'+_0x20ecf4)[_0x1fb5('0x14')](_0x3e49d1+'.dialCheckDuplicateType\x20IN\x20('+_0x18b4ce[_0x1fb5('0x12')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x433c67,_0x3e7769){promisesAdditionalPhones=[];return db[_0x1fb5('0x16')][_0x1fb5('0x17')]({'raw':!![],'attributes':['id',_0x1fb5('0x18')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x1fb5('0x19')](function(_0x1ef073){if(_0x1ef073!==null){var _0x1e5406=[];for(var _0x33b838=0x0;_0x33b838<_0x1ef073[_0x1fb5('0x1a')];_0x33b838++){var _0x131ad3=_0x1ef073[_0x33b838];_0x1e5406[_0x1fb5('0x1b')](insertAdditionalPhones(_0x131ad3));}}Promise['all'](_0x1e5406)[_0x1fb5('0x19')](function(){_0x433c67({'val':0x1});});});});}function insertAdditionalPhones(_0x56dcc3){return new Promise(function(_0x144337,_0x19b4b4){var _0x16e4f7=_0x56dcc3['AdditionalPhones'];var _0x16e37e=_0x16e4f7['split'](';');var _0x3dfbbf=[];orderBy=0x0;for(var _0x2e8b12=0x0;_0x2e8b12<_0x16e37e[_0x1fb5('0x1a')];_0x2e8b12++){_0x3dfbbf['push'](splitAdditionalPhone(_0x56dcc3['id'],_0x16e37e[_0x2e8b12]));}Promise['all'](_0x3dfbbf)[_0x1fb5('0x19')](function(){_0x144337({'val':_0x16e37e[_0x1fb5('0x1a')]});});});}function splitAdditionalPhone(_0x1707bb,_0x18af1b){return new Promise(function(_0x37835f,_0x54923a){var _0x31dec6=_0x18af1b[_0x1fb5('0x1c')](':');var _0x2c1c5e=_0x31dec6[0x0];var _0x3177ae=_0x31dec6[0x1];if(!_[_0x1fb5('0x1d')](_0x3177ae)){var _0x3eeea7=_0x3177ae[_0x1fb5('0x1c')]('|');var _0x2db493=[];for(var _0x4ac297=0x0;_0x4ac297<_0x3eeea7[_0x1fb5('0x1a')];_0x4ac297++){if(_0x3eeea7[_0x4ac297]!==''){var _0x33d16f=_[_0x1fb5('0x1e')](promisesAdditionalPhones,{'contactId':_0x1707bb,'phone':_0x3eeea7[_0x4ac297]});if(_0x33d16f[_0x1fb5('0x1a')]==0x0){orderBy++;promisesAdditionalPhones[_0x1fb5('0x1b')]({'contactId':_0x1707bb,'contactTypeId':_0x2c1c5e,'phone':_0x3eeea7[_0x4ac297],'orderBy':orderBy});}}}_0x37835f({'ok':0x1});}else _0x37835f({'res':0x0});});}function createAdditionalPhone(_0x410b26,_0x46cf85,_0x1ecaad,_0x3eb9da){var _0x512f41='';var _0x4db9e1='';var _0x349f4d=_0x1ecaad['split']('§');_0x512f41=_0x349f4d[0x0];if(_0x349f4d[_0x1fb5('0x1a')]==0x2)_0x4db9e1=_0x349f4d[0x1];return new Promise(function(_0x4f653f,_0xf38221){return db[_0x1fb5('0x1f')][_0x1fb5('0x20')]({'where':{'CmContactId':_0x410b26,'item':_0x512f41}})[_0x1fb5('0x19')](function(_0xce2f6e){if(_0xce2f6e){return db[_0x1fb5('0x1f')][_0x1fb5('0x21')]({'ItemTypeId':_0x46cf85,'description':_0x4db9e1,'OrderBy':_0x3eb9da},{'where':{'CmContactId':_0x410b26,'item':_0x512f41}})[_0x1fb5('0x19')](function(_0x20b2a2){_0x4f653f({'res':_0x1fb5('0x22')});});}else{return db[_0x1fb5('0x1f')][_0x1fb5('0x23')]({'CmContactId':_0x410b26,'item':_0x512f41,'description':_0x4db9e1,'ItemTypeId':_0x46cf85,'OrderBy':_0x3eb9da,'ItemClass':_0x1fb5('0x24')})['then'](function(_0x23ac0d){_0x4f653f({'res':_0x1fb5('0x25')});});}});});}function insertCmHopper(_0x3ce9b8,_0xaa0e11,_0x325a61,_0x6d7f0,_0x14fd71){var _0x16e2eb=[_0x1fb5('0x26'),'cm_contacts.scheduledat','cm_contacts.id',_0x1fb5('0x27'),_0xaa0e11+'.'+_0x6d7f0,_0x1fb5('0x28'),'cm_contacts.updatedAt','cm_contacts.priority',_0x1fb5('0x29'),'\x22'+_0x14fd71+'\x22'];return squel[_0x1fb5('0x2a')]()[_0x1fb5('0x2b')]('cm_hopper')['fromQuery']([_0x1fb5('0x2c'),'scheduledat',_0x1fb5('0x2d'),_0x1fb5('0x2e'),_0x6d7f0,_0x1fb5('0x2f'),'updatedAt','priority',_0x1fb5('0x30'),'recallme'],squel['select']()[_0x1fb5('0x31')](_0x16e2eb)[_0x1fb5('0x11')](_0xaa0e11)[_0x1fb5('0x12')](_0x1fb5('0x32'),null,_0x1fb5('0x33')+_0xaa0e11+_0x1fb5('0x34'))[_0x1fb5('0x12')](_0x325a61,null,_0x325a61+_0x1fb5('0x13')+_0xaa0e11+'.'+_0x6d7f0)[_0x1fb5('0x14')](_0xaa0e11+_0x1fb5('0x35'),_0x3ce9b8)[_0x1fb5('0x14')](_0x1fb5('0x36'),NOW)[_0x1fb5('0x14')](_0x1fb5('0x37'),selectNotIn(_0xaa0e11,_0x325a61,_0x6d7f0,_0x1fb5('0x38'),[_0x1fb5('0x39'),_0x1fb5('0x3a')]))[_0x1fb5('0x14')](_0x1fb5('0x37'),selectNotIn(_0xaa0e11,_0x325a61,_0x6d7f0,_0x1fb5('0x38'),[_0x1fb5('0x39')])))[_0x1fb5('0x3b')]();}function insertCmHopperBlack(_0x58889c,_0x16a082,_0x12a978,_0x34fd13){var _0x34651f=['cm_contacts.phone','cm_contacts.id',_0x1fb5('0x27'),_0x16a082+'.'+_0x34fd13,_0x1fb5('0x28'),'cm_contacts.updatedAt'];return squel[_0x1fb5('0x2a')]()['into']('cm_hopper_black')[_0x1fb5('0x3c')]([_0x1fb5('0x2c'),_0x1fb5('0x2d'),_0x1fb5('0x2e'),_0x34fd13,_0x1fb5('0x2f'),_0x1fb5('0x3d')],squel['select']()['fields'](_0x34651f)[_0x1fb5('0x11')](_0x16a082)['join'](_0x1fb5('0x32'),null,'cm_contacts.ListId\x20=\x20'+_0x16a082+'.CmListId')[_0x1fb5('0x12')](_0x12a978,null,_0x12a978+'.id\x20=\x20'+_0x16a082+'.'+_0x34fd13)[_0x1fb5('0x14')](_0x16a082+_0x1fb5('0x35'),_0x58889c)[_0x1fb5('0x14')](_0x1fb5('0x36'),NOW)[_0x1fb5('0x14')](_0x1fb5('0x37'),squel[_0x1fb5('0xf')]()[_0x1fb5('0x10')](_0x1fb5('0x2c'))[_0x1fb5('0x11')](_0x1fb5('0x3e'))[_0x1fb5('0x14')](_0x1fb5('0x3f'),_0x58889c)[_0x1fb5('0x14')](_0x34fd13+'\x20=\x20'+_0x16a082+'.'+_0x34fd13)))[_0x1fb5('0x3b')]();}function insertTzCmHopper(_0x543e77,_0x44b9c5,_0x31a69b,_0x4655cd,_0xb9400b,_0x4a5543){var _0x4e1ee2=['cm_contacts.phone',_0x1fb5('0x40')+_0x4a5543+_0x1fb5('0x41'),_0x1fb5('0x42'),_0x1fb5('0x27'),_0x44b9c5+'.'+_0x4655cd,_0x1fb5('0x28'),_0x1fb5('0x43'),_0x1fb5('0x44'),_0x1fb5('0x29'),'\x22'+_0xb9400b+'\x22'];var _0x1b9909=squel[_0x1fb5('0x2a')]()[_0x1fb5('0x2b')](_0x1fb5('0x38'))['fromQuery']([_0x1fb5('0x2c'),_0x1fb5('0x45'),_0x1fb5('0x2d'),_0x1fb5('0x2e'),_0x4655cd,_0x1fb5('0x2f'),_0x1fb5('0x3d'),_0x1fb5('0x46'),_0x1fb5('0x30'),_0x1fb5('0x47')],squel[_0x1fb5('0xf')]()[_0x1fb5('0x31')](_0x4e1ee2)['from'](_0x44b9c5)[_0x1fb5('0x12')](_0x1fb5('0x32'),null,_0x1fb5('0x33')+_0x44b9c5+_0x1fb5('0x34'))[_0x1fb5('0x12')](_0x31a69b,null,_0x31a69b+_0x1fb5('0x13')+_0x44b9c5+'.'+_0x4655cd)[_0x1fb5('0x12')](_0x4a5543,null,_0x4a5543+_0x1fb5('0x13')+_0x44b9c5+'.'+_0x4655cd)['where'](_0x44b9c5+_0x1fb5('0x35'),_0x543e77)['where'](_0x1fb5('0x36'),NOW)[_0x1fb5('0x14')](_0x1fb5('0x37'),selectNotIn(_0x44b9c5,_0x31a69b,_0x4655cd,'cm_hopper',[_0x1fb5('0x39'),'\x22onlyIfOpen\x22']))['where'](_0x1fb5('0x37'),selectNotIn(_0x44b9c5,_0x31a69b,_0x4655cd,_0x1fb5('0x38'),[_0x1fb5('0x39')])))['toString']();return _0x1b9909;}function insertTzCmHopperBlack(_0x1359fa,_0x22ff67,_0x1b4d36,_0x2cd211){var _0xebb396=[_0x1fb5('0x26'),'cm_contacts.id',_0x1fb5('0x27'),_0x22ff67+'.'+_0x2cd211,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel['insert']()[_0x1fb5('0x2b')](_0x1fb5('0x3e'))[_0x1fb5('0x3c')]([_0x1fb5('0x2c'),'ContactId','ListId',_0x2cd211,'createdAt','updatedAt'],squel[_0x1fb5('0xf')]()['fields'](_0xebb396)['from'](_0x22ff67)[_0x1fb5('0x12')](_0x1fb5('0x32'),null,'cm_contacts.ListId\x20=\x20'+_0x22ff67+_0x1fb5('0x34'))[_0x1fb5('0x12')](_0x1b4d36,null,_0x1b4d36+'.id\x20=\x20'+_0x22ff67+'.'+_0x2cd211)['where'](_0x22ff67+'.CmListId\x20=\x20?',_0x1359fa)[_0x1fb5('0x14')](_0x1fb5('0x36'),NOW)[_0x1fb5('0x14')](_0x1fb5('0x37'),squel[_0x1fb5('0xf')]()[_0x1fb5('0x10')](_0x1fb5('0x2c'))['from'](_0x1fb5('0x3e'))[_0x1fb5('0x14')](_0x1fb5('0x3f'),_0x1359fa)['where'](_0x2cd211+_0x1fb5('0x15')+_0x22ff67+'.'+_0x2cd211)))[_0x1fb5('0x3b')]();}function insertCmHopperAdditionalPhones(_0xb78859){var _0x34d023=[_0x1fb5('0x48'),_0x1fb5('0x49'),_0x1fb5('0x4a'),_0x1fb5('0x4b'),'cm_contact_has_items.updatedAt'];return squel['insert']()[_0x1fb5('0x2b')](_0x1fb5('0x4c'))[_0x1fb5('0x3c')](['CmHopperId','phone',_0x1fb5('0x4d'),_0x1fb5('0x2f'),_0x1fb5('0x3d')],squel[_0x1fb5('0xf')]()[_0x1fb5('0x31')](_0x34d023)['from']('cm_hopper')[_0x1fb5('0x12')](_0x1fb5('0x32'),null,_0x1fb5('0x4e'))['join'](_0x1fb5('0x4f'),null,_0x1fb5('0x50'))[_0x1fb5('0x14')](_0x1fb5('0x51'),_0xb78859)[_0x1fb5('0x14')](_0x1fb5('0x36'),NOW))[_0x1fb5('0x3b')]();}function insertCmContact(_0x4af6ad,_0x14f26a,_0x245633,_0x1fc2d8){var _0x3de291=_[_0x1fb5('0x52')](_['keys'](_0x1fc2d8),['ListId',_0x1fb5('0x53'),'createdAt',_0x1fb5('0x3d')]);return squel[_0x1fb5('0x2a')]()[_0x1fb5('0x2b')](_0x1fb5('0x32'))[_0x1fb5('0x3c')](_0x3de291,squel['select']()[_0x1fb5('0x31')](_0x3de291)[_0x1fb5('0x11')](_0x14f26a)[_0x1fb5('0x14')]('('+_0x245633[_0x1fb5('0x12')](',')+_0x1fb5('0x54'),squel[_0x1fb5('0xf')]()['fields'](_0x245633)[_0x1fb5('0x11')](_0x1fb5('0x32'))[_0x1fb5('0x14')](_0x1fb5('0x3f'),_0x4af6ad)[_0x1fb5('0x14')](_0x1fb5('0x55')))[_0x1fb5('0x14')](_0x1fb5('0x56'),squel[_0x1fb5('0xf')]()[_0x1fb5('0x10')](_0x1fb5('0x57'),'min_id')['from'](_0x14f26a)['group'](_0x245633['join'](','))))[_0x1fb5('0x3b')]();}function handleStop(){logger[_0x1fb5('0x58')](_0x1fb5('0x59'));stopped=!![];}function handleUncaughtException(_0x50f17d){logger[_0x1fb5('0x5a')](_0x50f17d[_0x1fb5('0x5b')]);process[_0x1fb5('0x5c')](0x1);}function handleError(_0x5ecc1d,_0xac08c0){stats[_0x1fb5('0x5d')][_0x1fb5('0x1b')]({'name':_0xac08c0['code'],'message':_0xac08c0[_0x1fb5('0x5b')],'row':_0x5ecc1d});}function handleQuery(_0x1ed3a8){logger[_0x1fb5('0x58')](_0x1ed3a8);return db[_0x1fb5('0x5e')][_0x1fb5('0x5f')](_0x1ed3a8)[_0x1fb5('0x60')](function(_0x4178bd){results['push'](_0x4178bd);})[_0x1fb5('0x61')](function(_0x527c2f){logger[_0x1fb5('0x5a')](_0x527c2f['message']);});}function updateTzCampaigns(_0x33284c){return new Promise(function(_0x81f735,_0x564b5b){var _0x4f5c74=squel['select']()['fields'](['campaigns.id',_0x1fb5('0x62')])['from'](_0x1fb5('0x63'))['join'](_0x1fb5('0x64'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0x1fb5('0x14')](_0x1fb5('0x65')+_0x33284c);db['sequelize'][_0x1fb5('0x5f')](_0x4f5c74[_0x1fb5('0x3b')]())['spread'](function(_0x2b8280){var _0x2c2a34=[];for(var _0x34aa68=0x0;_0x34aa68<_0x2b8280[_0x1fb5('0x1a')];_0x34aa68++){_0x2c2a34[_0x1fb5('0x1b')](getTimezoneData(_0x2b8280[_0x34aa68],tmp_campaigns));}BPromise[_0x1fb5('0x66')](_0x2c2a34)[_0x1fb5('0x19')](function(){_0x81f735({'val':0x1});});})[_0x1fb5('0x61')](function(_0x5b08da){logger[_0x1fb5('0x5a')](_0x5b08da['message']);_0x81f735({'val':0x0});});});}function updateTzVoiceQueues(_0x39a724){return new Promise(function(_0x5f0543,_0x5a5236){var _0x2b27b5=squel['select']()[_0x1fb5('0x31')]([_0x1fb5('0x67'),_0x1fb5('0x68')])[_0x1fb5('0x11')](_0x1fb5('0x69'))['join']('voice_queues_has_cm_lists',null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0x1fb5('0x14')](_0x1fb5('0x6a')+_0x39a724);db[_0x1fb5('0x5e')][_0x1fb5('0x5f')](_0x2b27b5[_0x1fb5('0x3b')]())[_0x1fb5('0x60')](function(_0x30b26e){var _0x5b5f57=[];for(var _0x6e38ce=0x0;_0x6e38ce<_0x30b26e[_0x1fb5('0x1a')];_0x6e38ce++){_0x5b5f57[_0x1fb5('0x1b')](getTimezoneData(_0x30b26e[_0x6e38ce],tmp_voice_queues));}BPromise[_0x1fb5('0x66')](_0x5b5f57)[_0x1fb5('0x19')](function(){_0x5f0543({'val':0x1});});})[_0x1fb5('0x61')](function(_0x4c8ad4){logger[_0x1fb5('0x5a')](_0x4c8ad4[_0x1fb5('0x5b')]);_0x5f0543({'val':0x0});});});}function getTimezoneData(_0x55a507,_0xca6353){return new Promise(function(_0x106444,_0x4081d3){var _0x5a312d=shared[_0x1fb5('0x6b')];var _0x310ad0=_0x5a312d[_0x55a507[_0x1fb5('0x6c')]];if(_[_0x1fb5('0x1d')](_0x310ad0)){_0x106444({'ret':0x1});}else{var _0x4282dc=_0x310ad0['utcOffset'];var _0xd68712=squel[_0x1fb5('0x2a')]()[_0x1fb5('0x2b')](_0xca6353)['set']('id',_0x55a507['id'])[_0x1fb5('0x6d')](_0x1fb5('0x6e'),_0x4282dc)[_0x1fb5('0x6d')]('dialTimezone',_0x55a507['dialTimezone'])['toString']();return db['sequelize']['query'](_0xd68712)[_0x1fb5('0x60')](function(_0x8bc67d){_0x106444({'ret':0x1});})[_0x1fb5('0x61')](function(_0x523d19){logger[_0x1fb5('0x5a')](_0x523d19['message']);_0x4081d3({'ret':0x1});});}});}function handleTZQuery(_0x16fcd9){logger['info'](_0x16fcd9);return db[_0x1fb5('0x5e')]['query'](_0x16fcd9)[_0x1fb5('0x60')](function(_0x7ba0c9){})[_0x1fb5('0x61')](function(_0x1aa084){logger['error'](_0x1aa084[_0x1fb5('0x5b')]);});}function main(_0x557e89,_0x4b2f71,_0x2cc8bf,_0x4194c1){logger[_0x1fb5('0x58')]('main',_0x557e89,JSON[_0x1fb5('0x6f')](_0x4b2f71));process[_0x1fb5('0x70')](_0x1fb5('0x71'));var _0x772bc5=_0x4b2f71[_0x1fb5('0x72')];var _0x4f12f4=_[_0x1fb5('0x73')](_0x772bc5);var _0x321bb5=_0x4b2f71[_0x1fb5('0x74')];var _0x2c472d=path[_0x1fb5('0x12')](config['root'],'server/files/tmp',_0x321bb5+_0x1fb5('0x75'));hasTZ=_[_0x1fb5('0x76')](_0x772bc5)[_0x1fb5('0x77')](_0x1fb5('0x6c'));var _0x293a73=_[_0x1fb5('0x76')](_0x772bc5)[_0x1fb5('0x12')]();logger['info']('header',_0x293a73);db['ContactItemType']['findAll']({'raw':!![],'attributes':['id',_0x1fb5('0x78')]})['then'](function(_0x49ba3f){for(var _0x4f8c78=0x0;_0x4f8c78<_0x49ba3f[_0x1fb5('0x1a')];_0x4f8c78++){if(_0x49ba3f[_0x4f8c78][_0x1fb5('0x78')]in _0x772bc5){contactItemTypes[_0x1fb5('0x1b')](_0x49ba3f[_0x4f8c78]);delete _0x4f12f4[_0x49ba3f[_0x4f8c78][_0x1fb5('0x78')]];hasAdditionalPhones=!![];}for(var _0x19db4f in _0x772bc5){if(_0x49ba3f[_0x4f8c78][_0x1fb5('0x78')]+'_description'===_0x19db4f){phoneDescriptions[_0x1fb5('0x1b')]({'itemTypeId':_0x49ba3f[_0x4f8c78]['id'],'description':_0x19db4f});delete _0x4f12f4[_0x19db4f];}}}if(hasAdditionalPhones)_0x4f12f4[_0x1fb5('0x18')]='';var _0x1d66ad=_[_0x1fb5('0x76')](_0x4f12f4)[_0x1fb5('0x12')]();logger[_0x1fb5('0x58')](_0x1fb5('0x79'),_0x1d66ad);fs[_0x1fb5('0x7a')](_0x2c472d,_0x1d66ad+'\x0a');Papa[_0x1fb5('0x7b')](fs['createReadStream'](_0x557e89),{'header':!![],'skipEmptyLines':!![],'step':function(_0x217f7e,_0x2570a5){try{for(var _0x78dabc=0x0,_0xb687c1=[];_0x78dabc<_0x217f7e[_0x1fb5('0x7c')][_0x1fb5('0x1a')];_0x78dabc++){stats[_0x1fb5('0x7d')]+=0x1;if(_0x217f7e[_0x1fb5('0x5d')][_0x78dabc]){handleError(_0x217f7e[_0x1fb5('0x7c')][_0x78dabc],_0x217f7e['errors'][_0x78dabc]);}else{var _0x4b8d27=[];var _0x5386d0=[];var _0x3f738a={};for(var _0xcd4a6c in _0x772bc5){let _0x5f1958=contactItemTypes[_0x1fb5('0x7e')](_0x9909f6=>_0x9909f6[_0x1fb5('0x78')]===_0xcd4a6c);let _0x250f31=contactItemTypes['find'](_0x13a788=>_0x13a788[_0x1fb5('0x78')]+_0x1fb5('0x7f')===_0xcd4a6c);if(_[_0x1fb5('0x1d')](_0x5f1958)&&_[_0x1fb5('0x1d')](_0x250f31)){if(_0x772bc5[_0x1fb5('0x80')](_0xcd4a6c)){if(_0x217f7e[_0x1fb5('0x7c')][_0x78dabc][_0x772bc5[_0xcd4a6c]]){var _0x4966b3=_[_0x1fb5('0x81')](_0x217f7e['data'][_0x78dabc][_0x772bc5[_0xcd4a6c]]['replace'](/"/g,'\x27'));switch(_0xcd4a6c){case _0x1fb5('0x45'):var _0x41681b=moment(_0x4966b3,_0x1fb5('0xd'),!![]);if(_0x41681b[_0x1fb5('0x82')]()){_0xb687c1['push']('\x22'+_0x4966b3+'\x22');}else{_0x4b8d27[_0x1fb5('0x1b')](_0x1fb5('0x83'));}break;case'priority':var _0x17258a=parseInt(_0x4966b3);_0x4966b3=_['isNaN'](_0x17258a)||_0x17258a<0x0||_0x17258a>0x4?_0x4194c1?0x3:0x2:_0x17258a;_0xb687c1[_0x1fb5('0x1b')]('\x22'+_0x4966b3+'\x22');break;case'UserId':var _0x405f56=parseInt(_0x4966b3);if(_[_0x1fb5('0x84')](_0x405f56)&&_[_0x1fb5('0x77')](_0x2cc8bf,_0x405f56)){_0xb687c1[_0x1fb5('0x1b')]('\x22'+_0x405f56+'\x22');}else{_0x4b8d27[_0x1fb5('0x1b')](_0x1fb5('0x85'));}break;case _0x1fb5('0x86'):if(isEmail(_0x4966b3)){_0xb687c1[_0x1fb5('0x1b')]('\x22'+_0x4966b3+'\x22');}else{_0x4b8d27[_0x1fb5('0x1b')]('email\x20wrong\x20format');}break;case _0x1fb5('0x87'):var _0x54441f=moment(_0x4966b3,'YYYY-MM-DD',!![]);if(_0x54441f[_0x1fb5('0x82')]()){_0xb687c1[_0x1fb5('0x1b')]('\x22'+_0x4966b3+'\x22');}else{_0x4b8d27[_0x1fb5('0x1b')](_0x1fb5('0x88'));}break;case'dialTimezone':var _0x16da1c=shared[_0x1fb5('0x6b')];var _0x10ba68=_0x16da1c[_0x4966b3];if(!_[_0x1fb5('0x1d')](_0x10ba68)){var _0x256fd4=_0x10ba68[_0x1fb5('0x89')];_0xb687c1[_0x1fb5('0x1b')]('\x22'+_0x4966b3+'\x22');_0xb687c1[_0x1fb5('0x1b')]('\x22'+_0x256fd4+'\x22');}break;default:_0xb687c1[_0x1fb5('0x1b')]('\x22'+_0x4966b3+'\x22');}}else{switch(_0xcd4a6c){case _0x1fb5('0x8a'):case'phone':_0x4b8d27[_0x1fb5('0x1b')](_0xcd4a6c+'\x20not\x20specified');break;default:_0xb687c1[_0x1fb5('0x1b')]('\x22\x22');}}}}else{var _0x12e67d='';if(!_[_0x1fb5('0x1d')](_0x5f1958)){if(!_0x3f738a[_0x1fb5('0x80')](_0x5f1958['id'])){if(!_['isNil'](_0x217f7e[_0x1fb5('0x7c')][_0x78dabc][_0x772bc5[_0xcd4a6c]])){var _0x4966b3=_[_0x1fb5('0x81')](_0x217f7e[_0x1fb5('0x7c')][_0x78dabc][_0x772bc5[_0xcd4a6c]]['replace'](/"/g,'\x27'));var _0x5bb35d=phoneDescriptions[_0x1fb5('0x7e')](_0x45d32a=>_0x45d32a[_0x1fb5('0x8b')]===_0x5f1958['id']);if(!_[_0x1fb5('0x1d')](_0x5bb35d)){var _0x4f28f5=_[_0x1fb5('0x81')](_0x217f7e[_0x1fb5('0x7c')][_0x78dabc][_0x772bc5[_0x5bb35d[_0x1fb5('0x8c')]]][_0x1fb5('0x8d')](/"/g,'\x27'));if(!_[_0x1fb5('0x1d')](_0x4f28f5))_0x4966b3=_0x4966b3+'§'+_0x4f28f5;}if(_0x12e67d=='')_0x12e67d=_0x4966b3;else _0x12e67d+='|'+_0x4966b3;}_0x5386d0['push'](_0x5f1958['id']+':'+_0x12e67d);_0x3f738a[_0x5f1958['id']]=0x1;}}}}if(hasAdditionalPhones){_0xb687c1['push']('\x22'+_0x5386d0['join'](';')+'\x22');}if(_0x4b8d27[_0x1fb5('0x1a')]){handleError(_0x217f7e[_0x1fb5('0x7c')][_0x78dabc],{'code':_0x1fb5('0x8e'),'message':_0x4b8d27[_0x1fb5('0x12')]()});}else{fs[_0x1fb5('0x8f')](_0x2c472d,_0xb687c1[_0x1fb5('0x12')]()+'\x0a');}_0xb687c1=[];}if(!(stats[_0x1fb5('0x7d')]%0xc8)){socket[_0x1fb5('0x90')](_0x1fb5('0x91')+_0x321bb5,stats);stats['errors']=[];}}if(stopped){logger['info'](_0x1fb5('0x92'));_0x2570a5['abort']();}}catch(_0x486f00){handleError(_0x217f7e[_0x1fb5('0x7c')][_0x78dabc],{'code':_0x1fb5('0x93'),'message':_0x486f00['message']});logger[_0x1fb5('0x5a')](_0x1fb5('0x94'),_0x486f00[_0x1fb5('0x5b')]);}},'complete':function(){try{var _0x3c0efc=[];var _0x5e463a=[];var _0x2f3410=_0x1fb5('0x32');if(_0x4b2f71[_0x1fb5('0x95')]&&_0x4b2f71[_0x1fb5('0x95')][_0x1fb5('0x1a')]){_0x2f3410='cm_contacts_'+_0x321bb5;_0x3c0efc[_0x1fb5('0x1b')]('CREATE\x20TABLE\x20'+_0x2f3410+_0x1fb5('0x96'));}tmp_campaigns='campaigns_'+_0x321bb5;tmp_voice_queues=_0x1fb5('0x97')+_0x321bb5;_0x5e463a[_0x1fb5('0x1b')](_0x1fb5('0x98')+tmp_campaigns+_0x1fb5('0x99'));_0x5e463a['push'](_0x1fb5('0x98')+tmp_voice_queues+_0x1fb5('0x99'));BPromise[_0x1fb5('0x9a')](_0x5e463a,handleTZQuery)[_0x1fb5('0x19')](function(_0x1f5ffd){updateTzCampaigns(_0x4b2f71['ListId'])['then'](function(_0x44e574){updateTzVoiceQueues(_0x4b2f71[_0x1fb5('0x2e')])[_0x1fb5('0x19')](function(_0x1e1c7d){if(hasTZ)_0x1d66ad=_0x1d66ad[_0x1fb5('0x8d')](_0x1fb5('0x6c'),_0x1fb5('0x9b'));var _0xc181b9=util['format'](_0x1fb5('0x9c'),_0x2c472d,_0x2f3410,_0x1d66ad,_0x4b2f71['ListId'],_0x4b2f71['CompanyId']||null,NOW,NOW);if(_[_0x1fb5('0x1d')](_0x772bc5[_0x1fb5('0x45')])){_0xc181b9+=',\x20scheduledAt\x20=\x20NOW()';}_0x3c0efc[_0x1fb5('0x1b')](_0xc181b9);if(_0x4b2f71[_0x1fb5('0x95')]&&_0x4b2f71['duplicates'][_0x1fb5('0x1a')]){_0x3c0efc[_0x1fb5('0x1b')](insertCmContact(_0x4b2f71['ListId'],_0x2f3410,_0x4b2f71[_0x1fb5('0x95')],_0x772bc5));_0x3c0efc[_0x1fb5('0x1b')](_0x1fb5('0x9d')+_0x2f3410+';');}BPromise[_0x1fb5('0x9a')](_0x3c0efc,handleQuery)[_0x1fb5('0x19')](function(_0x3e618e){BPromise['all']([handleAdditionalPhones()])[_0x1fb5('0x19')](function(){_0x3c0efc=[];for(var _0x41378d=0x0;_0x41378d<promisesAdditionalPhones[_0x1fb5('0x1a')];_0x41378d++){if(promisesAdditionalPhones[_0x41378d]['phone']!='§'){_0x3c0efc[_0x1fb5('0x1b')](createAdditionalPhone(promisesAdditionalPhones[_0x41378d][_0x1fb5('0x9e')],promisesAdditionalPhones[_0x41378d][_0x1fb5('0x9f')],promisesAdditionalPhones[_0x41378d][_0x1fb5('0x2c')],promisesAdditionalPhones[_0x41378d]['orderBy']));}}BPromise[_0x1fb5('0x66')](_0x3c0efc)[_0x1fb5('0x19')](function(){_0x3c0efc=[];if(hasTZ){_0x3c0efc['push'](insertTzCmHopper(_0x4b2f71[_0x1fb5('0x2e')],_0x1fb5('0xa0'),_0x1fb5('0x69'),_0x1fb5('0xa1'),_0x4194c1,tmp_voice_queues));_0x3c0efc[_0x1fb5('0x1b')](insertTzCmHopperBlack(_0x4b2f71['ListId'],_0x1fb5('0xa2'),_0x1fb5('0x69'),_0x1fb5('0xa1')));_0x3c0efc[_0x1fb5('0x1b')](insertTzCmHopper(_0x4b2f71[_0x1fb5('0x2e')],_0x1fb5('0x64'),_0x1fb5('0x63'),_0x1fb5('0xa3'),_0x4194c1,tmp_campaigns));_0x3c0efc['push'](insertTzCmHopperBlack(_0x4b2f71[_0x1fb5('0x2e')],'campaigns_has_cm_blacklists',_0x1fb5('0x63'),_0x1fb5('0xa3')));_0x3c0efc['push'](insertCmHopperAdditionalPhones(_0x4b2f71[_0x1fb5('0x2e')]));}else{_0x3c0efc['push'](insertCmHopper(_0x4b2f71[_0x1fb5('0x2e')],_0x1fb5('0xa0'),_0x1fb5('0x69'),_0x1fb5('0xa1'),_0x4194c1));_0x3c0efc[_0x1fb5('0x1b')](insertCmHopperBlack(_0x4b2f71['ListId'],_0x1fb5('0xa2'),_0x1fb5('0x69'),_0x1fb5('0xa1')));_0x3c0efc[_0x1fb5('0x1b')](insertCmHopper(_0x4b2f71[_0x1fb5('0x2e')],_0x1fb5('0x64'),'campaigns',_0x1fb5('0xa3'),_0x4194c1));_0x3c0efc['push'](insertCmHopperBlack(_0x4b2f71[_0x1fb5('0x2e')],_0x1fb5('0xa4'),'campaigns',_0x1fb5('0xa3')));_0x3c0efc[_0x1fb5('0x1b')](insertCmHopperAdditionalPhones(_0x4b2f71[_0x1fb5('0x2e')]));}_0x3c0efc['push']('DROP\x20TABLE\x20'+tmp_campaigns+';');_0x3c0efc['push'](_0x1fb5('0x9d')+tmp_voice_queues+';');BPromise['each'](_0x3c0efc,handleQuery)['then'](function(_0xc916f1){stats[_0x1fb5('0xa5')]=!![];stats[_0x1fb5('0xa6')]=_0x4b2f71[_0x1fb5('0x95')]&&_0x4b2f71[_0x1fb5('0x95')][_0x1fb5('0x1a')]?results[0x2][_0x1fb5('0xa6')]:results[0x0][_0x1fb5('0xa6')];socket['emit'](_0x1fb5('0x91')+_0x321bb5,stats);fs[_0x1fb5('0xa7')](_0x557e89);fs['unlink'](_0x2c472d);process['exit'](0x0);})[_0x1fb5('0x61')](function(_0x54d969){logger[_0x1fb5('0x5a')](_0x54d969[_0x1fb5('0x5b')]);process[_0x1fb5('0x5c')](0x1);});});});})[_0x1fb5('0x61')](function(_0x25afaa){logger[_0x1fb5('0x5a')](_0x25afaa[_0x1fb5('0x5b')]);process['exit'](0x1);});});});});}catch(_0x338fff){logger['error'](_0x1fb5('0xa8'),_0x338fff['message']);process['exit'](0x1);}},'error':function(_0x2f0384,_0x4378bc,_0x26eeef,_0x44cde7){throw new Error(_0x44cde7);}});});}function validate(){if(process[_0x1fb5('0xa9')]&&process[_0x1fb5('0xa9')][_0x1fb5('0x1a')]<0x4){throw new Error(_0x1fb5('0xaa'));}var _0x12e8f6=path['join'](config[_0x1fb5('0xab')],_0x1fb5('0xac'),process[_0x1fb5('0xa9')][0x2]);if(!fs[_0x1fb5('0xad')](_0x12e8f6)){throw new Error(_0x1fb5('0xae'));}var _0x1766ee={};try{_0x1766ee=JSON['parse'](process[_0x1fb5('0xa9')][0x3]);if(!_0x1766ee[_0x1fb5('0x72')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x1766ee[_0x1fb5('0x72')][_0x1fb5('0x2c')]){throw new Error(_0x1fb5('0xaf'));}if(!_0x1766ee[_0x1fb5('0x72')][_0x1fb5('0x8a')]){throw new Error(_0x1fb5('0xb0'));}var _0xae63d2=0x0;if(_0x1766ee['binding'][_0x1fb5('0x30')]){_0xae63d2=0x1;}if(!_0x1766ee[_0x1fb5('0x2e')]){throw new Error(_0x1fb5('0xb1'));}}catch(_0x50bbeb){throw new Error('body\x20id\x20mandatory');}var _0x410ad0=[];try{_0x410ad0=_['map'](JSON['parse'](process[_0x1fb5('0xa9')][0x4]),'id');}catch(_0x1289fe){logger[_0x1fb5('0x58')](_0x1fb5('0xb2'));}main(_0x12e8f6,_0x1766ee,_0x410ad0,_0xae63d2);}validate();process['on']('SIGINT',handleStop);process['on'](_0x1fb5('0xb3'),handleUncaughtException);
\ No newline at end of file
index 6302326..549a196 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x237d=['where','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','spread','isNil','AdditionalPhones','push','all','catch','error','message','split','length','filter','CmContactHasItem','findOne','then','update','updated','create','inserted','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','createdAt','updatedAt','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.ListId','cm_hopper_black','ListId','.CmListId\x20=\x20?','field','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_hopper_additional_phones','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','min_id','group','Received\x20SIGINT','exit','errors','code','info','main','send','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','body','ContactItemType','findAll','name','header','writeFileSync','parse','createReadStream','data','rows','find','_description','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','hasOwnProperty','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','abort','SystemError','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','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\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','contactId','contactTypeId','orderBy','finish','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','phone','from','join','.id\x20=\x20','\x20=\x20'];(function(_0x55754e,_0x286388){var _0x2e9948=function(_0x1eaeff){while(--_0x1eaeff){_0x55754e['push'](_0x55754e['shift']());}};_0x2e9948(++_0x286388);}(_0x237d,0x1d9));var _0xd237=function(_0x42c439,_0xa44e39){_0x42c439=_0x42c439-0x0;var _0x58a0a1=_0x237d[_0x42c439];return _0x58a0a1;};'use strict';var fs=require('fs');var path=require(_0xd237('0x0'));var _=require(_0xd237('0x1'));var Papa=require(_0xd237('0x2'));var util=require(_0xd237('0x3'));var BPromise=require('bluebird');var moment=require(_0xd237('0x4'));var squel=require(_0xd237('0x5'));var Redis=require(_0xd237('0x6'));var db=require(_0xd237('0x7'))['db'];var config=require(_0xd237('0x8'));var logger=require(_0xd237('0x9'))('import');config[_0xd237('0xa')]=_[_0xd237('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd237('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()['format'](_0xd237('0xc'));var tempTableName=_0xd237('0xd')+moment()['format'](_0xd237('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x1475fb){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))*$/[_0xd237('0xf')](_0x1475fb);}function selectNotIn(_0x3c8135,_0x2111ee,_0x46b4e3,_0x316042,_0x247450){return squel[_0xd237('0x10')]()['field'](_0xd237('0x11'))[_0xd237('0x12')](_0x316042)[_0xd237('0x13')](_0x2111ee,null,_0x2111ee+_0xd237('0x14')+_0x316042+'.'+_0x46b4e3)['where'](_0x316042+'.'+_0x46b4e3+_0xd237('0x15')+_0x3c8135+'.'+_0x46b4e3)[_0xd237('0x16')](_0x2111ee+_0xd237('0x17')+_0x247450[_0xd237('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x176b4c,_0x4100b4){promisesAdditionalPhones=[];promisesContact=[];return db[_0xd237('0x18')][_0xd237('0x19')](_0xd237('0x1a')+tempTableName)[_0xd237('0x1b')](function(_0x408719){if(_0x408719!==null){var _0x3086c4=[];for(var _0x3db7a9=0x0;_0x3db7a9<_0x408719['length'];_0x3db7a9++){var _0x2011e7=_0x408719[_0x3db7a9];if(!_[_0xd237('0x1c')](_0x2011e7[_0xd237('0x11')])){if(!_[_0xd237('0x1c')](_0x2011e7[_0xd237('0x1d')]))_0x3086c4[_0xd237('0x1e')](insertAdditionalPhones(_0x2011e7));promisesContact[_0xd237('0x1e')]({'contact':_0x2011e7});}}}Promise[_0xd237('0x1f')](_0x3086c4)['then'](function(){_0x176b4c({'val':0x1});});})[_0xd237('0x20')](function(_0x8f339b){logger[_0xd237('0x21')](_0x8f339b[_0xd237('0x22')]);});});}function insertAdditionalPhones(_0x27d7d3){return new Promise(function(_0x19bfb8,_0x65942){var _0x3b8599=_0x27d7d3[_0xd237('0x1d')];if(_[_0xd237('0x1c')](_0x3b8599))_0x65942({'val':0x0});else{var _0x385de8=_0x3b8599[_0xd237('0x23')](';');var _0x10d937=[];orderBy=0x0;for(var _0x343ea1=0x0;_0x343ea1<_0x385de8[_0xd237('0x24')];_0x343ea1++){_0x10d937['push'](splitAdditionalPhone(_0x27d7d3['id'],_0x385de8[_0x343ea1]));}Promise[_0xd237('0x1f')](_0x10d937)['then'](function(){_0x19bfb8({'val':_0x385de8[_0xd237('0x24')]});});}});}function splitAdditionalPhone(_0x187459,_0x203aac){return new Promise(function(_0x431f90,_0x502ba1){var _0xf13922=_0x203aac[_0xd237('0x23')](':');var _0x375142=_0xf13922[0x0];var _0x14f22b=_0xf13922[0x1];if(_0x14f22b!==''){var _0x5b4ee6=_0x14f22b[_0xd237('0x23')]('|');var _0x1ed1df=[];for(var _0x5733e3=0x0;_0x5733e3<_0x5b4ee6[_0xd237('0x24')];_0x5733e3++){if(_0x5b4ee6[_0x5733e3]!==''){var _0x9f826e=_[_0xd237('0x25')](promisesAdditionalPhones,{'contactId':_0x187459,'phone':_0x5b4ee6[_0x5733e3]});if(_0x9f826e[_0xd237('0x24')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x187459,'contactTypeId':_0x375142,'phone':_0x5b4ee6[_0x5733e3],'orderBy':orderBy});}}}_0x431f90({'ok':0x1});}else _0x431f90({'res':0x0});});}function createAdditionalPhone(_0x4cc361,_0x59133d,_0x376d32,_0x3a14ff){var _0xde1567='';var _0x7f193e='';var _0x4a1b23=_0x376d32[_0xd237('0x23')]('§');_0xde1567=_0x4a1b23[0x0];if(_0x4a1b23[_0xd237('0x24')]==0x2)_0x7f193e=_0x4a1b23[0x1];return new Promise(function(_0x560125,_0x126beb){return db[_0xd237('0x26')][_0xd237('0x27')]({'where':{'CmContactId':_0x4cc361,'item':_0xde1567}})[_0xd237('0x28')](function(_0x3630a7){if(_0x3630a7){return db['CmContactHasItem'][_0xd237('0x29')]({'ItemTypeId':_0x59133d,'description':_0x7f193e,'OrderBy':_0x3a14ff},{'where':{'CmContactId':_0x4cc361,'item':_0xde1567}})[_0xd237('0x28')](function(_0x1edbcd){_0x560125({'res':_0xd237('0x2a')});});}else{return db[_0xd237('0x26')][_0xd237('0x2b')]({'CmContactId':_0x4cc361,'item':_0xde1567,'ItemTypeId':_0x59133d,'description':_0x7f193e,'OrderBy':_0x3a14ff,'ItemClass':'PHONE'})[_0xd237('0x28')](function(_0x56a843){_0x560125({'res':_0xd237('0x2c')});});}});});}function updateContact(_0x5ea141){return new Promise(function(_0x1418d1,_0x250054){var _0x12ba9a=_0x5ea141['id'];delete _0x5ea141['id'];return db['CmContact']['update'](_0x5ea141,{'where':{'id':_0x12ba9a}})['then'](function(_0x1943d6){updatedRows+=0x1;return db[_0xd237('0x2d')][_0xd237('0x29')]({'phone':_0x5ea141['phone']},{'where':{'ContactId':_0x12ba9a}})['then'](function(_0x247c22){_0x1418d1({'ret':'OK'});});});});}function insertCmHopper(_0x32da2b,_0x40d4f6,_0x18b6c3,_0x37d4fd,_0xdd0af8){var _0x1b24bf=[_0xd237('0x2e'),_0xd237('0x2f'),_0xd237('0x30'),'cm_contacts.ListId',_0x40d4f6+'.'+_0x37d4fd,_0xd237('0x31'),_0xd237('0x32'),'cm_contacts.priority',_0xd237('0x33'),'\x22'+_0xdd0af8+'\x22'];return squel[_0xd237('0x34')]()[_0xd237('0x35')](_0xd237('0x36'))[_0xd237('0x37')]([_0xd237('0x11'),_0xd237('0x38'),'ContactId','ListId',_0x37d4fd,_0xd237('0x39'),_0xd237('0x3a'),'priority',_0xd237('0x3b'),_0xd237('0x3c')],squel[_0xd237('0x10')]()[_0xd237('0x3d')](_0x1b24bf)['from'](_0x40d4f6)['join'](_0xd237('0x3e'),null,_0xd237('0x3f')+_0x40d4f6+_0xd237('0x40'))[_0xd237('0x13')](_0x18b6c3,null,_0x18b6c3+_0xd237('0x14')+_0x40d4f6+'.'+_0x37d4fd)[_0xd237('0x16')](_0x40d4f6+'.CmListId\x20=\x20?',_0x32da2b)[_0xd237('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xd237('0x16')](_0xd237('0x41'),selectNotIn(_0x40d4f6,_0x18b6c3,_0x37d4fd,_0xd237('0x36'),[_0xd237('0x42'),_0xd237('0x43')]))[_0xd237('0x16')](_0xd237('0x41'),selectNotIn(_0x40d4f6,_0x18b6c3,_0x37d4fd,_0xd237('0x36'),[_0xd237('0x42')])))[_0xd237('0x44')]();}function insertCmHopperBlack(_0x4a003e,_0x50dfb9,_0x6f29dd,_0x22c579){var _0x21b431=[_0xd237('0x2e'),_0xd237('0x30'),_0xd237('0x45'),_0x50dfb9+'.'+_0x22c579,_0xd237('0x31'),_0xd237('0x32')];return squel['insert']()[_0xd237('0x35')](_0xd237('0x46'))[_0xd237('0x37')]([_0xd237('0x11'),'ContactId',_0xd237('0x47'),_0x22c579,_0xd237('0x39'),'updatedAt'],squel[_0xd237('0x10')]()['fields'](_0x21b431)[_0xd237('0x12')](_0x50dfb9)['join']('cm_contacts',null,_0xd237('0x3f')+_0x50dfb9+_0xd237('0x40'))['join'](_0x6f29dd,null,_0x6f29dd+_0xd237('0x14')+_0x50dfb9+'.'+_0x22c579)[_0xd237('0x16')](_0x50dfb9+_0xd237('0x48'),_0x4a003e)[_0xd237('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xd237('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xd237('0x10')]()[_0xd237('0x49')](_0xd237('0x11'))['from'](_0xd237('0x46'))[_0xd237('0x16')](_0xd237('0x4a'),_0x4a003e)['where'](_0x22c579+'\x20=\x20?',_0x50dfb9+'.'+_0x22c579)))[_0xd237('0x44')]();}function insertCmHopperAdditionalPhones(_0x23db5a){var _0x6103c1=[_0xd237('0x4b'),_0xd237('0x4c'),_0xd237('0x4d'),'cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt'];return squel[_0xd237('0x34')]()[_0xd237('0x35')](_0xd237('0x4e'))[_0xd237('0x37')](['CmHopperId',_0xd237('0x11'),_0xd237('0x4f'),'createdAt',_0xd237('0x3a')],squel[_0xd237('0x10')]()[_0xd237('0x3d')](_0x6103c1)[_0xd237('0x12')](_0xd237('0x36'))[_0xd237('0x13')](_0xd237('0x3e'),null,_0xd237('0x50'))['join']('cm_contact_has_items',null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xd237('0x16')](_0xd237('0x51'),_0x23db5a)['where']('cm_contacts.createdAt\x20=\x20?',NOW))['toString']();}function insertCmContact(_0x22d89d,_0x1d0fda,_0x313ffa,_0x39b9e2){var _0x5ced95=_[_0xd237('0x52')](_[_0xd237('0x53')](_0x39b9e2),[_0xd237('0x47'),_0xd237('0x54'),_0xd237('0x39'),'updatedAt']);return squel[_0xd237('0x34')]()[_0xd237('0x35')](_0xd237('0x3e'))[_0xd237('0x37')](_0x5ced95,squel[_0xd237('0x10')]()[_0xd237('0x3d')](_0x5ced95)[_0xd237('0x12')](_0x1d0fda)[_0xd237('0x16')]('('+_0x313ffa['join'](',')+_0xd237('0x55'),squel[_0xd237('0x10')]()[_0xd237('0x3d')](_0x313ffa)[_0xd237('0x12')](_0xd237('0x3e'))[_0xd237('0x16')](_0xd237('0x4a'),_0x22d89d))['where'](_0xd237('0x56'),squel['select']()['field']('MIN(id)',_0xd237('0x57'))['from'](_0x1d0fda)[_0xd237('0x58')](_0x313ffa['join'](','))))['toString']();}function handleStop(){logger['info'](_0xd237('0x59'));stopped=!![];}function handleUncaughtException(_0x4b5fd0){logger[_0xd237('0x21')](_0x4b5fd0[_0xd237('0x22')]);process[_0xd237('0x5a')](0x1);}function handleError(_0x4eaa44,_0x4a8379){stats[_0xd237('0x5b')][_0xd237('0x1e')]({'name':_0x4a8379[_0xd237('0x5c')],'message':_0x4a8379[_0xd237('0x22')],'row':_0x4eaa44});}function handleQuery(_0x46296f){logger[_0xd237('0x5d')](_0x46296f);return db[_0xd237('0x18')][_0xd237('0x19')](_0x46296f)['spread'](function(_0x1eafe4){results['push'](_0x1eafe4);})['catch'](function(_0x44a0c3){logger['error'](_0x44a0c3[_0xd237('0x22')]);});}function main(_0x5076dc,_0x3ac2ee,_0x33ff24,_0x3a9347){logger[_0xd237('0x5d')](_0xd237('0x5e'),_0x5076dc,JSON['stringify'](_0x3ac2ee));process[_0xd237('0x5f')](_0xd237('0x60'));var _0x3f8a02=_0x3ac2ee[_0xd237('0x61')];var _0x21b725=_[_0xd237('0x62')](_0x3f8a02);var _0x32e9de=_0x3ac2ee[_0xd237('0x63')];var _0x3cf939=path[_0xd237('0x13')](config[_0xd237('0x64')],_0xd237('0x65'),_0x32e9de+_0xd237('0x66'));logger[_0xd237('0x5d')](_0xd237('0x67'),_0x3ac2ee);db[_0xd237('0x68')][_0xd237('0x69')]({'raw':!![],'attributes':['id','name']})[_0xd237('0x28')](function(_0x2a731b){for(var _0xe1a625=0x0;_0xe1a625<_0x2a731b[_0xd237('0x24')];_0xe1a625++){if(_0x2a731b[_0xe1a625][_0xd237('0x6a')]in _0x3f8a02){contactItemTypes[_0xd237('0x1e')](_0x2a731b[_0xe1a625]);delete _0x21b725[_0x2a731b[_0xe1a625][_0xd237('0x6a')]];hasAdditionalPhones=!![];}for(var _0x145d97 in _0x3f8a02){if(_0x2a731b[_0xe1a625][_0xd237('0x6a')]+'_description'===_0x145d97){phoneDescriptions[_0xd237('0x1e')]({'itemTypeId':_0x2a731b[_0xe1a625]['id'],'description':_0x145d97});delete _0x21b725[_0x145d97];}}}if(hasAdditionalPhones)_0x21b725[_0xd237('0x1d')]='';var _0x2399fb=_[_0xd237('0x53')](_0x21b725)['join']();logger['info'](_0xd237('0x6b'),_0x2399fb);fs[_0xd237('0x6c')](_0x3cf939,_0x2399fb+'\x0a');Papa[_0xd237('0x6d')](fs[_0xd237('0x6e')](_0x5076dc),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3f7d17,_0xd28a2f){try{for(var _0x2f24d5=0x0,_0x246c84=[];_0x2f24d5<_0x3f7d17[_0xd237('0x6f')]['length'];_0x2f24d5++){stats[_0xd237('0x70')]+=0x1;if(_0x3f7d17[_0xd237('0x5b')][_0x2f24d5]){handleError(_0x3f7d17[_0xd237('0x6f')][_0x2f24d5],_0x3f7d17[_0xd237('0x5b')][_0x2f24d5]);}else{var _0x4742cb=[];var _0x4437d1=[];var _0x58b3e7={};for(var _0xdbf692 in _0x3f8a02){let _0xca4002=contactItemTypes[_0xd237('0x71')](_0x3e13ae=>_0x3e13ae[_0xd237('0x6a')]===_0xdbf692);let _0x4c2772=contactItemTypes[_0xd237('0x71')](_0x2f7091=>_0x2f7091['name']+_0xd237('0x72')===_0xdbf692);if(_[_0xd237('0x1c')](_0xca4002)&&_[_0xd237('0x1c')](_0x4c2772)){if(_0x3f8a02['hasOwnProperty'](_0xdbf692)){if(_0x3f7d17[_0xd237('0x6f')][_0x2f24d5][_0x3f8a02[_0xdbf692]]){var _0x161a1a=_[_0xd237('0x73')](_0x3f7d17[_0xd237('0x6f')][_0x2f24d5][_0x3f8a02[_0xdbf692]][_0xd237('0x74')](/"/g,'\x27'));switch(_0xdbf692){case _0xd237('0x38'):var _0x7ba98d=moment(_0x161a1a,_0xd237('0xc'),!![]);if(_0x7ba98d[_0xd237('0x75')]()){_0x246c84[_0xd237('0x1e')]('\x22'+_0x161a1a+'\x22');}else{_0x4742cb[_0xd237('0x1e')](_0xd237('0x76'));}break;case _0xd237('0x77'):var _0x53092b=parseInt(_0x161a1a);_0x161a1a=_[_0xd237('0x78')](_0x53092b)||_0x53092b<0x0||_0x53092b>0x4?_0x3a9347?0x3:0x2:_0x53092b;_0x246c84[_0xd237('0x1e')]('\x22'+_0x161a1a+'\x22');break;case _0xd237('0x3b'):var _0xe1a962=parseInt(_0x161a1a);if(_[_0xd237('0x79')](_0xe1a962)&&_[_0xd237('0x7a')](_0x33ff24,_0xe1a962)){_0x246c84[_0xd237('0x1e')]('\x22'+_0xe1a962+'\x22');}else{_0x4742cb['push'](_0xd237('0x7b'));}break;case'email':if(isEmail(_0x161a1a)){_0x246c84[_0xd237('0x1e')]('\x22'+_0x161a1a+'\x22');}else{_0x4742cb[_0xd237('0x1e')](_0xd237('0x7c'));}break;case _0xd237('0x7d'):var _0x48005f=moment(_0x161a1a,_0xd237('0x7e'),!![]);if(_0x48005f[_0xd237('0x75')]()){_0x246c84['push']('\x22'+_0x161a1a+'\x22');}else{_0x4742cb['push'](_0xd237('0x7f'));}break;default:_0x246c84['push']('\x22'+_0x161a1a+'\x22');}}else{switch(_0xdbf692){case _0xd237('0x80'):case'phone':_0x4742cb['push'](_0xdbf692+_0xd237('0x81'));break;default:_0x246c84['push']('\x22\x22');}}}}else{var _0x41494c='';if(!_[_0xd237('0x1c')](_0xca4002)){if(!_0x58b3e7[_0xd237('0x82')](_0xca4002['id'])){for(var _0x1970de=0x0;_0x1970de<_0x3f8a02[_0xdbf692]['length'];_0x1970de++){var _0x161a1a=_[_0xd237('0x73')](_0x3f7d17[_0xd237('0x6f')][_0x2f24d5][_0x3f8a02[_0xdbf692][_0x1970de]][_0xd237('0x74')](/"/g,'\x27'));var _0x1dbbc5=phoneDescriptions['find'](_0x2b8f95=>_0x2b8f95[_0xd237('0x83')]===_0xca4002['id']);if(!_[_0xd237('0x1c')](_0x1dbbc5)){var _0x1b4b65=_[_0xd237('0x73')](_0x3f7d17[_0xd237('0x6f')][_0x2f24d5][_0x3f8a02[_0x1dbbc5[_0xd237('0x84')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0xd237('0x1c')](_0x1b4b65))_0x161a1a=_0x161a1a+'§'+_0x1b4b65;}if(_0x41494c=='')_0x41494c=_0x161a1a;else _0x41494c+='|'+_0x161a1a;}_0x4437d1[_0xd237('0x1e')](_0xca4002['id']+':'+_0x41494c);_0x58b3e7[_0xca4002['id']]=0x1;}}}}if(hasAdditionalPhones){_0x246c84[_0xd237('0x1e')]('\x22'+_0x4437d1[_0xd237('0x13')](';')+'\x22');}if(_0x4742cb[_0xd237('0x24')]){handleError(_0x3f7d17[_0xd237('0x6f')][_0x2f24d5],{'code':_0xd237('0x85'),'message':_0x4742cb[_0xd237('0x13')]()});}else{fs[_0xd237('0x86')](_0x3cf939,_0x246c84[_0xd237('0x13')]()+'\x0a');}_0x246c84=[];}if(!(stats[_0xd237('0x70')]%0xc8)){socket[_0xd237('0x87')](_0xd237('0x88')+_0x32e9de,stats);stats['errors']=[];}}if(stopped){logger[_0xd237('0x5d')]('Abort\x20parser');_0xd28a2f[_0xd237('0x89')]();}}catch(_0x1705ae){handleError(_0x3f7d17['data'][_0x2f24d5],{'code':_0xd237('0x8a'),'message':_0x1705ae[_0xd237('0x22')]});logger[_0xd237('0x21')](_0xd237('0x8b'),_0x1705ae[_0xd237('0x22')]);}},'complete':function(){try{var _0x1be6e5=[];var _0x43a51d=tempTableName;_0x1be6e5['push'](_0xd237('0x8c')+_0x43a51d+_0xd237('0x8d'));logger[_0xd237('0x5d')](_0xd237('0x8e'),contactItemTypes[_0xd237('0x24')]);var _0x1041be=util[_0xd237('0x8f')](_0xd237('0x90'),_0x3cf939,_0x43a51d,_0x2399fb,_0x3ac2ee['ListId'],_0x3ac2ee['CompanyId']||null,NOW,NOW);if(_[_0xd237('0x1c')](_0x3f8a02[_0xd237('0x38')])){_0x1041be+=_0xd237('0x91');}_0x1be6e5['push'](_0x1041be);BPromise[_0xd237('0x92')](_0x1be6e5,handleQuery)[_0xd237('0x28')](function(_0x3f9fe7){BPromise[_0xd237('0x1f')]([handleAdditionalPhones()])[_0xd237('0x28')](function(){_0x1be6e5=[];for(var _0x19dfa9=0x0;_0x19dfa9<promisesContact[_0xd237('0x24')];_0x19dfa9++){_0x1be6e5[_0xd237('0x1e')](updateContact(promisesContact[_0x19dfa9][_0xd237('0x93')]));}BPromise[_0xd237('0x1f')](_0x1be6e5)['then'](function(){_0x1be6e5=[];for(var _0xa13474=0x0;_0xa13474<promisesAdditionalPhones[_0xd237('0x24')];_0xa13474++){_0x1be6e5[_0xd237('0x1e')](createAdditionalPhone(promisesAdditionalPhones[_0xa13474][_0xd237('0x94')],promisesAdditionalPhones[_0xa13474][_0xd237('0x95')],promisesAdditionalPhones[_0xa13474][_0xd237('0x11')],promisesAdditionalPhones[_0xa13474][_0xd237('0x96')]));}BPromise[_0xd237('0x1f')](_0x1be6e5)[_0xd237('0x28')](function(){_0x1be6e5=[];_0x1be6e5['push'](insertCmHopperAdditionalPhones(_0x3ac2ee[_0xd237('0x47')]));_0x1be6e5[_0xd237('0x1e')]('DROP\x20TABLE\x20'+_0x43a51d+';');BPromise[_0xd237('0x92')](_0x1be6e5,handleQuery)['then'](function(_0x2f7181){stats[_0xd237('0x97')]=!![];stats['affectedRows']=updatedRows;socket[_0xd237('0x87')]('contact:import:'+_0x32e9de,stats);fs[_0xd237('0x98')](_0x5076dc);fs[_0xd237('0x98')](_0x3cf939);process[_0xd237('0x5a')](0x0);})[_0xd237('0x20')](function(_0x1c7cc1){logger[_0xd237('0x21')](_0x1c7cc1['message']);process[_0xd237('0x5a')](0x1);});});});});})['catch'](function(_0x1053b7){logger[_0xd237('0x21')](_0x1053b7[_0xd237('0x22')]);process[_0xd237('0x5a')](0x1);});}catch(_0x3a7f4d){logger[_0xd237('0x21')](_0xd237('0x99'),_0x3a7f4d['message']);process[_0xd237('0x5a')](0x1);}},'error':function(_0x235c5e,_0x37753b,_0x1c13dd,_0x30c1bd){throw new Error(_0x30c1bd);}});});}function validate(){if(process[_0xd237('0x9a')]&&process[_0xd237('0x9a')]['length']<0x4){throw new Error(_0xd237('0x9b'));}var _0x303d95=path['join'](config[_0xd237('0x64')],_0xd237('0x65'),process[_0xd237('0x9a')][0x2]);if(!fs[_0xd237('0x9c')](_0x303d95)){throw new Error(_0xd237('0x9d'));}var _0x291531={};try{_0x291531=JSON['parse'](process['argv'][0x3]);if(!_0x291531[_0xd237('0x61')]){throw new Error(_0xd237('0x9e'));}var _0x271b5d=0x0;if(_0x291531[_0xd237('0x61')][_0xd237('0x3b')]){_0x271b5d=0x1;}if(!_0x291531[_0xd237('0x47')]){throw new Error(_0xd237('0x9f'));}}catch(_0x475a68){throw new Error(_0xd237('0xa0'));}var _0x2b7225=[];try{_0x2b7225=_[_0xd237('0xa1')](JSON['parse'](process['argv'][0x4]),'id');}catch(_0x3b3e4b){logger[_0xd237('0x5d')](_0xd237('0xa2'));}main(_0x303d95,_0x291531,_0x2b7225,_0x271b5d);}validate();process['on'](_0xd237('0xa3'),handleStop);process['on'](_0xd237('0xa4'),handleUncaughtException);
\ No newline at end of file
+var _0x352e=['createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.createdAt','insert','cm_hopper_black','\x20=\x20?','toString','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','concat','keys','ListId','ListId\x20=\x20?','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','error','exit','errors','stringify','send','start','socket_timestamp','root','server/files/tmp','.csv','body','ContactItemType','findAll','name','_description','header','writeFileSync','parse','createReadStream','data','find','hasOwnProperty','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','includes','email','email\x20wrong\x20format','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','trim','replace','itemTypeId','description','appendFileSync','rows','emit','contact:import:','Abort\x20parser','abort','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','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','CompanyId',',\x20scheduledAt\x20=\x20NOW()','each','contact','contactId','contactTypeId','orderBy','DROP\x20TABLE\x20','affectedRows','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','phone','from','join','.id\x20=\x20','\x20=\x20','where','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','then','catch','message','split','all','updated','CmContactHasItem','create','PHONE','CmContact','update','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','into','cm_hopper','fromQuery','scheduledat','ContactId'];(function(_0x264b9b,_0xa1181e){var _0x4c7a0e=function(_0x4b77a0){while(--_0x4b77a0){_0x264b9b['push'](_0x264b9b['shift']());}};_0x4c7a0e(++_0xa1181e);}(_0x352e,0x1a6));var _0xe352=function(_0x23eb4b,_0x5a5e06){_0x23eb4b=_0x23eb4b-0x0;var _0x430517=_0x352e[_0x23eb4b];return _0x430517;};'use strict';var fs=require('fs');var path=require(_0xe352('0x0'));var _=require(_0xe352('0x1'));var Papa=require(_0xe352('0x2'));var util=require(_0xe352('0x3'));var BPromise=require(_0xe352('0x4'));var moment=require(_0xe352('0x5'));var squel=require(_0xe352('0x6'));var Redis=require(_0xe352('0x7'));var db=require('../../../mysqldb')['db'];var config=require(_0xe352('0x8'));var logger=require(_0xe352('0x9'))('import');config[_0xe352('0xa')]=_[_0xe352('0xb')](config[_0xe352('0xa')],{'host':_0xe352('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe352('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()[_0xe352('0xd')](_0xe352('0xe'));var tempTableName=_0xe352('0xf')+moment()['format'](_0xe352('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x42bc13){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))*$/[_0xe352('0x11')](_0x42bc13);}function selectNotIn(_0x181d92,_0x3eb6c0,_0xd1a6af,_0x4b0b13,_0x5bb25e){return squel[_0xe352('0x12')]()[_0xe352('0x13')](_0xe352('0x14'))[_0xe352('0x15')](_0x4b0b13)[_0xe352('0x16')](_0x3eb6c0,null,_0x3eb6c0+_0xe352('0x17')+_0x4b0b13+'.'+_0xd1a6af)['where'](_0x4b0b13+'.'+_0xd1a6af+_0xe352('0x18')+_0x181d92+'.'+_0xd1a6af)[_0xe352('0x19')](_0x3eb6c0+'.dialCheckDuplicateType\x20IN\x20('+_0x5bb25e[_0xe352('0x16')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0xc0a528,_0x56afa0){promisesAdditionalPhones=[];promisesContact=[];return db[_0xe352('0x1a')][_0xe352('0x1b')](_0xe352('0x1c')+tempTableName)[_0xe352('0x1d')](function(_0xc7b5c1){if(_0xc7b5c1!==null){var _0xa00062=[];for(var _0x31e417=0x0;_0x31e417<_0xc7b5c1[_0xe352('0x1e')];_0x31e417++){var _0x5df4c5=_0xc7b5c1[_0x31e417];if(!_[_0xe352('0x1f')](_0x5df4c5['phone'])){if(!_['isNil'](_0x5df4c5[_0xe352('0x20')]))_0xa00062[_0xe352('0x21')](insertAdditionalPhones(_0x5df4c5));promisesContact['push']({'contact':_0x5df4c5});}}}Promise['all'](_0xa00062)[_0xe352('0x22')](function(){_0xc0a528({'val':0x1});});})[_0xe352('0x23')](function(_0x759b6){logger['error'](_0x759b6[_0xe352('0x24')]);});});}function insertAdditionalPhones(_0x36a427){return new Promise(function(_0xa70d53,_0x4b2c53){var _0x4961c9=_0x36a427[_0xe352('0x20')];if(_[_0xe352('0x1f')](_0x4961c9))_0x4b2c53({'val':0x0});else{var _0x269954=_0x4961c9[_0xe352('0x25')](';');var _0x1db31e=[];orderBy=0x0;for(var _0x59e9c0=0x0;_0x59e9c0<_0x269954[_0xe352('0x1e')];_0x59e9c0++){_0x1db31e[_0xe352('0x21')](splitAdditionalPhone(_0x36a427['id'],_0x269954[_0x59e9c0]));}Promise[_0xe352('0x26')](_0x1db31e)[_0xe352('0x22')](function(){_0xa70d53({'val':_0x269954['length']});});}});}function splitAdditionalPhone(_0x14317b,_0x53cf17){return new Promise(function(_0x3cc4f7,_0x55ff39){var _0x2c8552=_0x53cf17[_0xe352('0x25')](':');var _0x41e235=_0x2c8552[0x0];var _0x1b1245=_0x2c8552[0x1];if(_0x1b1245!==''){var _0x319aca=_0x1b1245[_0xe352('0x25')]('|');var _0x50ff6e=[];for(var _0x4987c0=0x0;_0x4987c0<_0x319aca['length'];_0x4987c0++){if(_0x319aca[_0x4987c0]!==''){var _0x2aa94a=_['filter'](promisesAdditionalPhones,{'contactId':_0x14317b,'phone':_0x319aca[_0x4987c0]});if(_0x2aa94a[_0xe352('0x1e')]==0x0){orderBy++;promisesAdditionalPhones[_0xe352('0x21')]({'contactId':_0x14317b,'contactTypeId':_0x41e235,'phone':_0x319aca[_0x4987c0],'orderBy':orderBy});}}}_0x3cc4f7({'ok':0x1});}else _0x3cc4f7({'res':0x0});});}function createAdditionalPhone(_0x25ca29,_0x252eab,_0x30028b,_0xd3c70a){var _0x26c360='';var _0x24ae32='';var _0x32e669=_0x30028b[_0xe352('0x25')]('§');_0x26c360=_0x32e669[0x0];if(_0x32e669[_0xe352('0x1e')]==0x2)_0x24ae32=_0x32e669[0x1];return new Promise(function(_0x587012,_0x43d174){return db['CmContactHasItem']['findOne']({'where':{'CmContactId':_0x25ca29,'item':_0x26c360}})[_0xe352('0x22')](function(_0x3cdc62){if(_0x3cdc62){return db['CmContactHasItem']['update']({'ItemTypeId':_0x252eab,'description':_0x24ae32,'OrderBy':_0xd3c70a},{'where':{'CmContactId':_0x25ca29,'item':_0x26c360}})['then'](function(_0x5d8533){_0x587012({'res':_0xe352('0x27')});});}else{return db[_0xe352('0x28')][_0xe352('0x29')]({'CmContactId':_0x25ca29,'item':_0x26c360,'ItemTypeId':_0x252eab,'description':_0x24ae32,'OrderBy':_0xd3c70a,'ItemClass':_0xe352('0x2a')})[_0xe352('0x22')](function(_0x1576a2){_0x587012({'res':'inserted'});});}});});}function updateContact(_0x2623c6){return new Promise(function(_0x36af96,_0x343d5d){var _0x2a605f=_0x2623c6['id'];delete _0x2623c6['id'];return db[_0xe352('0x2b')][_0xe352('0x2c')](_0x2623c6,{'where':{'id':_0x2a605f}})[_0xe352('0x22')](function(_0x2c2f04){updatedRows+=0x1;return db['CmHopper'][_0xe352('0x2c')]({'phone':_0x2623c6[_0xe352('0x14')]},{'where':{'ContactId':_0x2a605f}})['then'](function(_0x4aa63c){_0x36af96({'ret':'OK'});});});});}function insertCmHopper(_0xf88f5b,_0x5eda6e,_0x13aef5,_0x35c1dc,_0x29a280){var _0x3e2eac=[_0xe352('0x2d'),_0xe352('0x2e'),'cm_contacts.id',_0xe352('0x2f'),_0x5eda6e+'.'+_0x35c1dc,'cm_contacts.createdAt',_0xe352('0x30'),_0xe352('0x31'),'cm_contacts.UserId','\x22'+_0x29a280+'\x22'];return squel['insert']()[_0xe352('0x32')](_0xe352('0x33'))[_0xe352('0x34')]([_0xe352('0x14'),_0xe352('0x35'),_0xe352('0x36'),'ListId',_0x35c1dc,_0xe352('0x37'),_0xe352('0x38'),_0xe352('0x39'),_0xe352('0x3a'),_0xe352('0x3b')],squel[_0xe352('0x12')]()[_0xe352('0x3c')](_0x3e2eac)[_0xe352('0x15')](_0x5eda6e)[_0xe352('0x16')](_0xe352('0x3d'),null,_0xe352('0x3e')+_0x5eda6e+_0xe352('0x3f'))['join'](_0x13aef5,null,_0x13aef5+_0xe352('0x17')+_0x5eda6e+'.'+_0x35c1dc)[_0xe352('0x19')](_0x5eda6e+_0xe352('0x40'),_0xf88f5b)[_0xe352('0x19')](_0xe352('0x41'),NOW)['where'](_0xe352('0x42'),selectNotIn(_0x5eda6e,_0x13aef5,_0x35c1dc,_0xe352('0x33'),[_0xe352('0x43'),_0xe352('0x44')]))[_0xe352('0x19')](_0xe352('0x42'),selectNotIn(_0x5eda6e,_0x13aef5,_0x35c1dc,'cm_hopper',[_0xe352('0x43')])))['toString']();}function insertCmHopperBlack(_0xbccb9,_0x4e0eed,_0x475b3f,_0x376229){var _0x187ccd=['cm_contacts.phone','cm_contacts.id',_0xe352('0x2f'),_0x4e0eed+'.'+_0x376229,_0xe352('0x45'),'cm_contacts.updatedAt'];return squel[_0xe352('0x46')]()[_0xe352('0x32')](_0xe352('0x47'))[_0xe352('0x34')]([_0xe352('0x14'),'ContactId','ListId',_0x376229,_0xe352('0x37'),_0xe352('0x38')],squel[_0xe352('0x12')]()[_0xe352('0x3c')](_0x187ccd)[_0xe352('0x15')](_0x4e0eed)[_0xe352('0x16')](_0xe352('0x3d'),null,_0xe352('0x3e')+_0x4e0eed+_0xe352('0x3f'))['join'](_0x475b3f,null,_0x475b3f+_0xe352('0x17')+_0x4e0eed+'.'+_0x376229)['where'](_0x4e0eed+_0xe352('0x40'),_0xbccb9)[_0xe352('0x19')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xe352('0x19')](_0xe352('0x42'),squel[_0xe352('0x12')]()[_0xe352('0x13')]('phone')[_0xe352('0x15')](_0xe352('0x47'))[_0xe352('0x19')]('ListId\x20=\x20?',_0xbccb9)[_0xe352('0x19')](_0x376229+_0xe352('0x48'),_0x4e0eed+'.'+_0x376229)))[_0xe352('0x49')]();}function insertCmHopperAdditionalPhones(_0x55fdd1){var _0x345da6=[_0xe352('0x4a'),_0xe352('0x4b'),_0xe352('0x4c'),_0xe352('0x4d'),'cm_contact_has_items.updatedAt'];return squel['insert']()[_0xe352('0x32')](_0xe352('0x4e'))[_0xe352('0x34')]([_0xe352('0x4f'),_0xe352('0x14'),_0xe352('0x50'),_0xe352('0x37'),_0xe352('0x38')],squel['select']()[_0xe352('0x3c')](_0x345da6)['from'](_0xe352('0x33'))[_0xe352('0x16')](_0xe352('0x3d'),null,_0xe352('0x51'))[_0xe352('0x16')](_0xe352('0x52'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')['where'](_0xe352('0x53'),_0x55fdd1)[_0xe352('0x19')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0xe352('0x49')]();}function insertCmContact(_0x1626fe,_0x52cd6c,_0x904469,_0x2d642f){var _0xa39be9=_[_0xe352('0x54')](_[_0xe352('0x55')](_0x2d642f),[_0xe352('0x56'),'CompanyId','createdAt',_0xe352('0x38')]);return squel[_0xe352('0x46')]()[_0xe352('0x32')](_0xe352('0x3d'))['fromQuery'](_0xa39be9,squel[_0xe352('0x12')]()[_0xe352('0x3c')](_0xa39be9)['from'](_0x52cd6c)[_0xe352('0x19')]('('+_0x904469[_0xe352('0x16')](',')+')\x20NOT\x20IN\x20?',squel[_0xe352('0x12')]()[_0xe352('0x3c')](_0x904469)[_0xe352('0x15')](_0xe352('0x3d'))['where'](_0xe352('0x57'),_0x1626fe))[_0xe352('0x19')](_0xe352('0x58'),squel[_0xe352('0x12')]()[_0xe352('0x13')](_0xe352('0x59'),_0xe352('0x5a'))[_0xe352('0x15')](_0x52cd6c)['group'](_0x904469[_0xe352('0x16')](','))))[_0xe352('0x49')]();}function handleStop(){logger[_0xe352('0x5b')](_0xe352('0x5c'));stopped=!![];}function handleUncaughtException(_0x6254f1){logger[_0xe352('0x5d')](_0x6254f1[_0xe352('0x24')]);process[_0xe352('0x5e')](0x1);}function handleError(_0x49f804,_0x4bfca7){stats[_0xe352('0x5f')]['push']({'name':_0x4bfca7['code'],'message':_0x4bfca7[_0xe352('0x24')],'row':_0x49f804});}function handleQuery(_0x53cbd6){logger['info'](_0x53cbd6);return db[_0xe352('0x1a')][_0xe352('0x1b')](_0x53cbd6)[_0xe352('0x1d')](function(_0x1a303f){results[_0xe352('0x21')](_0x1a303f);})[_0xe352('0x23')](function(_0x8c94d7){logger[_0xe352('0x5d')](_0x8c94d7[_0xe352('0x24')]);});}function main(_0x4439ea,_0x42be58,_0x40e65e,_0x6416e0){logger[_0xe352('0x5b')]('main',_0x4439ea,JSON[_0xe352('0x60')](_0x42be58));process[_0xe352('0x61')](_0xe352('0x62'));var _0x11a1d6=_0x42be58['binding'];var _0x457da1=_['clone'](_0x11a1d6);var _0x50f1b8=_0x42be58[_0xe352('0x63')];var _0x43f381=path[_0xe352('0x16')](config[_0xe352('0x64')],_0xe352('0x65'),_0x50f1b8+_0xe352('0x66'));logger[_0xe352('0x5b')](_0xe352('0x67'),_0x42be58);db[_0xe352('0x68')][_0xe352('0x69')]({'raw':!![],'attributes':['id',_0xe352('0x6a')]})[_0xe352('0x22')](function(_0x2d2678){for(var _0x5283d6=0x0;_0x5283d6<_0x2d2678[_0xe352('0x1e')];_0x5283d6++){if(_0x2d2678[_0x5283d6][_0xe352('0x6a')]in _0x11a1d6){contactItemTypes[_0xe352('0x21')](_0x2d2678[_0x5283d6]);delete _0x457da1[_0x2d2678[_0x5283d6][_0xe352('0x6a')]];hasAdditionalPhones=!![];}for(var _0x1592cb in _0x11a1d6){if(_0x2d2678[_0x5283d6]['name']+_0xe352('0x6b')===_0x1592cb){phoneDescriptions[_0xe352('0x21')]({'itemTypeId':_0x2d2678[_0x5283d6]['id'],'description':_0x1592cb});delete _0x457da1[_0x1592cb];}}}if(hasAdditionalPhones)_0x457da1[_0xe352('0x20')]='';var _0x600586=_['keys'](_0x457da1)['join']();logger[_0xe352('0x5b')](_0xe352('0x6c'),_0x600586);fs[_0xe352('0x6d')](_0x43f381,_0x600586+'\x0a');Papa[_0xe352('0x6e')](fs[_0xe352('0x6f')](_0x4439ea),{'header':!![],'skipEmptyLines':!![],'step':function(_0x37b111,_0x9c9787){try{for(var _0x21a330=0x0,_0x5495d1=[];_0x21a330<_0x37b111[_0xe352('0x70')][_0xe352('0x1e')];_0x21a330++){stats['rows']+=0x1;if(_0x37b111[_0xe352('0x5f')][_0x21a330]){handleError(_0x37b111[_0xe352('0x70')][_0x21a330],_0x37b111['errors'][_0x21a330]);}else{var _0x5f2e47=[];var _0x49c23e=[];var _0x469506={};for(var _0xd3caa8 in _0x11a1d6){let _0x1bd9da=contactItemTypes[_0xe352('0x71')](_0x847647=>_0x847647[_0xe352('0x6a')]===_0xd3caa8);let _0x360102=contactItemTypes[_0xe352('0x71')](_0x566376=>_0x566376['name']+_0xe352('0x6b')===_0xd3caa8);if(_[_0xe352('0x1f')](_0x1bd9da)&&_['isNil'](_0x360102)){if(_0x11a1d6[_0xe352('0x72')](_0xd3caa8)){if(_0x37b111[_0xe352('0x70')][_0x21a330][_0x11a1d6[_0xd3caa8]]){var _0x479076=_['trim'](_0x37b111[_0xe352('0x70')][_0x21a330][_0x11a1d6[_0xd3caa8]]['replace'](/"/g,'\x27'));switch(_0xd3caa8){case _0xe352('0x35'):var _0x1a9b08=moment(_0x479076,_0xe352('0xe'),!![]);if(_0x1a9b08['isValid']()){_0x5495d1[_0xe352('0x21')]('\x22'+_0x479076+'\x22');}else{_0x5f2e47[_0xe352('0x21')](_0xe352('0x73'));}break;case _0xe352('0x39'):var _0x5453cf=parseInt(_0x479076);_0x479076=_['isNaN'](_0x5453cf)||_0x5453cf<0x0||_0x5453cf>0x4?_0x6416e0?0x3:0x2:_0x5453cf;_0x5495d1[_0xe352('0x21')]('\x22'+_0x479076+'\x22');break;case _0xe352('0x3a'):var _0x30466b=parseInt(_0x479076);if(_['isNumber'](_0x30466b)&&_[_0xe352('0x74')](_0x40e65e,_0x30466b)){_0x5495d1[_0xe352('0x21')]('\x22'+_0x30466b+'\x22');}else{_0x5f2e47[_0xe352('0x21')]('agent\x20not\x20exists');}break;case _0xe352('0x75'):if(isEmail(_0x479076)){_0x5495d1[_0xe352('0x21')]('\x22'+_0x479076+'\x22');}else{_0x5f2e47[_0xe352('0x21')](_0xe352('0x76'));}break;case'dateOfBirth':var _0x25da38=moment(_0x479076,_0xe352('0x77'),!![]);if(_0x25da38[_0xe352('0x78')]()){_0x5495d1['push']('\x22'+_0x479076+'\x22');}else{_0x5f2e47['push'](_0xe352('0x79'));}break;default:_0x5495d1[_0xe352('0x21')]('\x22'+_0x479076+'\x22');}}else{switch(_0xd3caa8){case _0xe352('0x7a'):case _0xe352('0x14'):_0x5f2e47[_0xe352('0x21')](_0xd3caa8+'\x20not\x20specified');break;default:_0x5495d1['push']('\x22\x22');}}}}else{var _0x7afddc='';if(!_[_0xe352('0x1f')](_0x1bd9da)){if(!_0x469506[_0xe352('0x72')](_0x1bd9da['id'])){for(var _0x34c898=0x0;_0x34c898<_0x11a1d6[_0xd3caa8][_0xe352('0x1e')];_0x34c898++){var _0x479076=_[_0xe352('0x7b')](_0x37b111['data'][_0x21a330][_0x11a1d6[_0xd3caa8][_0x34c898]][_0xe352('0x7c')](/"/g,'\x27'));var _0x15e191=phoneDescriptions[_0xe352('0x71')](_0x2e7ce0=>_0x2e7ce0[_0xe352('0x7d')]===_0x1bd9da['id']);if(!_[_0xe352('0x1f')](_0x15e191)){var _0x2f4e1a=_[_0xe352('0x7b')](_0x37b111[_0xe352('0x70')][_0x21a330][_0x11a1d6[_0x15e191[_0xe352('0x7e')]][0x0]][_0xe352('0x7c')](/"/g,'\x27'));if(!_[_0xe352('0x1f')](_0x2f4e1a))_0x479076=_0x479076+'§'+_0x2f4e1a;}if(_0x7afddc=='')_0x7afddc=_0x479076;else _0x7afddc+='|'+_0x479076;}_0x49c23e['push'](_0x1bd9da['id']+':'+_0x7afddc);_0x469506[_0x1bd9da['id']]=0x1;}}}}if(hasAdditionalPhones){_0x5495d1[_0xe352('0x21')]('\x22'+_0x49c23e[_0xe352('0x16')](';')+'\x22');}if(_0x5f2e47['length']){handleError(_0x37b111[_0xe352('0x70')][_0x21a330],{'code':'SystemRow','message':_0x5f2e47[_0xe352('0x16')]()});}else{fs[_0xe352('0x7f')](_0x43f381,_0x5495d1[_0xe352('0x16')]()+'\x0a');}_0x5495d1=[];}if(!(stats[_0xe352('0x80')]%0xc8)){socket[_0xe352('0x81')](_0xe352('0x82')+_0x50f1b8,stats);stats[_0xe352('0x5f')]=[];}}if(stopped){logger['info'](_0xe352('0x83'));_0x9c9787[_0xe352('0x84')]();}}catch(_0x441f71){handleError(_0x37b111[_0xe352('0x70')][_0x21a330],{'code':'SystemError','message':_0x441f71[_0xe352('0x24')]});logger[_0xe352('0x5d')]('step',_0x441f71[_0xe352('0x24')]);}},'complete':function(){try{var _0x3f768d=[];var _0x18d93f=tempTableName;_0x3f768d[_0xe352('0x21')](_0xe352('0x85')+_0x18d93f+_0xe352('0x86'));logger['info'](_0xe352('0x87'),contactItemTypes[_0xe352('0x1e')]);var _0x4715bc=util[_0xe352('0xd')](_0xe352('0x88'),_0x43f381,_0x18d93f,_0x600586,_0x42be58[_0xe352('0x56')],_0x42be58[_0xe352('0x89')]||null,NOW,NOW);if(_[_0xe352('0x1f')](_0x11a1d6[_0xe352('0x35')])){_0x4715bc+=_0xe352('0x8a');}_0x3f768d[_0xe352('0x21')](_0x4715bc);BPromise[_0xe352('0x8b')](_0x3f768d,handleQuery)[_0xe352('0x22')](function(_0x423adb){BPromise[_0xe352('0x26')]([handleAdditionalPhones()])[_0xe352('0x22')](function(){_0x3f768d=[];for(var _0x418c36=0x0;_0x418c36<promisesContact['length'];_0x418c36++){_0x3f768d[_0xe352('0x21')](updateContact(promisesContact[_0x418c36][_0xe352('0x8c')]));}BPromise['all'](_0x3f768d)[_0xe352('0x22')](function(){_0x3f768d=[];for(var _0x131126=0x0;_0x131126<promisesAdditionalPhones['length'];_0x131126++){_0x3f768d[_0xe352('0x21')](createAdditionalPhone(promisesAdditionalPhones[_0x131126][_0xe352('0x8d')],promisesAdditionalPhones[_0x131126][_0xe352('0x8e')],promisesAdditionalPhones[_0x131126][_0xe352('0x14')],promisesAdditionalPhones[_0x131126][_0xe352('0x8f')]));}BPromise['all'](_0x3f768d)[_0xe352('0x22')](function(){_0x3f768d=[];_0x3f768d[_0xe352('0x21')](insertCmHopperAdditionalPhones(_0x42be58[_0xe352('0x56')]));_0x3f768d['push'](_0xe352('0x90')+_0x18d93f+';');BPromise['each'](_0x3f768d,handleQuery)[_0xe352('0x22')](function(_0x352532){stats['finish']=!![];stats[_0xe352('0x91')]=updatedRows;socket[_0xe352('0x81')](_0xe352('0x82')+_0x50f1b8,stats);fs[_0xe352('0x92')](_0x4439ea);fs[_0xe352('0x92')](_0x43f381);process[_0xe352('0x5e')](0x0);})[_0xe352('0x23')](function(_0x39a5e2){logger[_0xe352('0x5d')](_0x39a5e2[_0xe352('0x24')]);process['exit'](0x1);});});});});})['catch'](function(_0x529d5f){logger[_0xe352('0x5d')](_0x529d5f['message']);process[_0xe352('0x5e')](0x1);});}catch(_0x5113fc){logger[_0xe352('0x5d')](_0xe352('0x93'),_0x5113fc[_0xe352('0x24')]);process[_0xe352('0x5e')](0x1);}},'error':function(_0x47ccd2,_0x13c7cf,_0x530478,_0x33fba9){throw new Error(_0x33fba9);}});});}function validate(){if(process[_0xe352('0x94')]&&process['argv'][_0xe352('0x1e')]<0x4){throw new Error(_0xe352('0x95'));}var _0x4f9657=path[_0xe352('0x16')](config[_0xe352('0x64')],'server/files/tmp',process[_0xe352('0x94')][0x2]);if(!fs[_0xe352('0x96')](_0x4f9657)){throw new Error(_0xe352('0x97'));}var _0x1e758e={};try{_0x1e758e=JSON[_0xe352('0x6e')](process[_0xe352('0x94')][0x3]);if(!_0x1e758e['binding']){throw new Error(_0xe352('0x98'));}var _0x2eb487=0x0;if(_0x1e758e['binding'][_0xe352('0x3a')]){_0x2eb487=0x1;}if(!_0x1e758e[_0xe352('0x56')]){throw new Error(_0xe352('0x99'));}}catch(_0x5035f9){throw new Error(_0xe352('0x9a'));}var _0x456802=[];try{_0x456802=_[_0xe352('0x9b')](JSON[_0xe352('0x6e')](process['argv'][0x4]),'id');}catch(_0x21d814){logger[_0xe352('0x5b')](_0xe352('0x9c'));}main(_0x4f9657,_0x1e758e,_0x456802,_0x2eb487);}validate();process['on'](_0xe352('0x9d'),handleStop);process['on'](_0xe352('0x9e'),handleUncaughtException);
\ No newline at end of file
index a6e0911..45258c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ec2=['holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','UniqueId','starttime','Answer\x20Time','answertime','endtime','duration','getSubjects','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','calleridnum','outbound','string','Outbound\x20Call','destcalleridnum','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','queue','uniqueid','Date','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time'];(function(_0x1dec97,_0x5bc3c4){var _0x95cc95=function(_0xb83505){while(--_0xb83505){_0x1dec97['push'](_0x1dec97['shift']());}};_0x95cc95(++_0x5bc3c4);}(_0x8ec2,0x1ce));var _0x28ec=function(_0x2f37e0,_0x393ef9){_0x2f37e0=_0x2f37e0-0x0;var _0x43ccce=_0x8ec2[_0x2f37e0];return _0x43ccce;};'use strict';exports[_0x28ec('0x0')]=function(_0x124838,_0x51a3ef){var _0x4f7844=[{'type':'string','content':_0x28ec('0x1'),'variableName':null}];switch(_0x124838[_0x28ec('0x2')]()){case _0x28ec('0x3'):switch(_0x51a3ef[_0x28ec('0x2')]()){case _0x28ec('0x4'):_0x4f7844[_0x28ec('0x5')]({'type':_0x28ec('0x6'),'content':'','variableName':'queue'});_0x4f7844['push']({'type':_0x28ec('0x6'),'content':'','variableName':_0x28ec('0x7')});break;case _0x28ec('0x8'):_0x4f7844['push']({'type':_0x28ec('0x9'),'content':_0x28ec('0xa'),'variableName':null});_0x4f7844[_0x28ec('0x5')]({'type':_0x28ec('0x6'),'content':'','variableName':_0x28ec('0xb')});break;}}return _0x4f7844;};exports['getDescriptions']=function(_0x3e53af,_0x384482){var _0x34d0dd=[];switch(_0x3e53af[_0x28ec('0x2')]()){case _0x28ec('0x3'):switch(_0x384482[_0x28ec('0x2')]()){case _0x28ec('0x4'):_0x34d0dd=[{'type':_0x28ec('0x9'),'content':_0x28ec('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x28ec('0xd'),'content':'','key':_0x28ec('0xe'),'keyType':_0x28ec('0x6'),'variableName':_0x28ec('0x7')},{'type':_0x28ec('0xd'),'content':'','key':_0x28ec('0xf'),'keyType':_0x28ec('0x6'),'variableName':_0x28ec('0x10')},{'type':'keyValue','content':'','key':_0x28ec('0x11'),'keyType':_0x28ec('0x6'),'variableName':_0x28ec('0x12')},{'type':'keyValue','content':'','key':_0x28ec('0x13'),'keyType':_0x28ec('0x6'),'variableName':_0x28ec('0x14')},{'type':_0x28ec('0xd'),'content':'','key':'UniqueId','keyType':_0x28ec('0x6'),'variableName':_0x28ec('0x15')},{'type':_0x28ec('0xd'),'content':'','key':_0x28ec('0x16'),'keyType':_0x28ec('0x6'),'variableName':'agentcalledAt'},{'type':_0x28ec('0x9'),'content':_0x28ec('0x17'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Name','keyType':_0x28ec('0x6'),'variableName':_0x28ec('0x18')},{'type':_0x28ec('0xd'),'content':'','key':_0x28ec('0x19'),'keyType':_0x28ec('0x6'),'variableName':_0x28ec('0xb')},{'type':_0x28ec('0x9'),'content':_0x28ec('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0x28ec('0xd'),'content':'','key':_0x28ec('0x1b'),'keyType':'variable','variableName':_0x28ec('0x1c')},{'type':'keyValue','content':'','key':_0x28ec('0x1d'),'keyType':'variable','variableName':_0x28ec('0x1e')},{'type':_0x28ec('0xd'),'content':'','key':'Agent\x20Complete','keyType':_0x28ec('0x6'),'variableName':_0x28ec('0x1f')},{'type':'keyValue','content':'','key':_0x28ec('0x20'),'keyType':'variable','variableName':_0x28ec('0x21')},{'type':'keyValue','content':'','key':_0x28ec('0x22'),'keyType':_0x28ec('0x6'),'variableName':_0x28ec('0x23')}];break;case'outbound':_0x34d0dd=[{'type':_0x28ec('0x9'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x28ec('0xd'),'content':'','key':_0x28ec('0x24'),'keyType':_0x28ec('0x6'),'keyContent':'','variableName':_0x28ec('0xb')},{'type':_0x28ec('0xd'),'content':'','key':_0x28ec('0x25'),'keyType':_0x28ec('0x6'),'keyContent':'','variableName':_0x28ec('0x26')},{'type':_0x28ec('0xd'),'content':'','key':_0x28ec('0x27'),'keyType':_0x28ec('0x6'),'keyContent':'','variableName':_0x28ec('0x15')},{'type':_0x28ec('0xd'),'content':'','key':'Date','keyType':_0x28ec('0x6'),'keyContent':'','variableName':_0x28ec('0x28')},{'type':_0x28ec('0x9'),'content':_0x28ec('0x1a')},{'type':_0x28ec('0xd'),'content':'','key':_0x28ec('0x29'),'keyType':_0x28ec('0x6'),'keyContent':'','variableName':_0x28ec('0x2a')},{'type':'keyValue','content':'','key':'Complete\x20Time','keyType':_0x28ec('0x6'),'keyContent':'','variableName':_0x28ec('0x2b')},{'type':_0x28ec('0xd'),'content':'','key':'Duration','keyType':'variable','keyContent':'','variableName':_0x28ec('0x2c')},{'type':_0x28ec('0xd'),'content':'','key':'Billable\x20Time','keyType':_0x28ec('0x6'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x34d0dd;};
\ No newline at end of file
+var _0x27f0=['Queue','UniqueId','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','talktime','Called\x20Number','Member\x20Name','membername','starttime','***\x20Time\x20Info\x20***','Answer\x20Time','answertime','Complete\x20Time','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','variable','queue','push','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','inbound','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten'];(function(_0x4bf38e,_0x5037f7){var _0x184471=function(_0x1a9e42){while(--_0x1a9e42){_0x4bf38e['push'](_0x4bf38e['shift']());}};_0x184471(++_0x5037f7);}(_0x27f0,0xd8));var _0x027f=function(_0x335054,_0x563748){_0x335054=_0x335054-0x0;var _0x2cb088=_0x27f0[_0x335054];return _0x2cb088;};'use strict';exports[_0x027f('0x0')]=function(_0x2c1b8c,_0x89d975){var _0x1ac68a=[{'type':_0x027f('0x1'),'content':_0x027f('0x2'),'variableName':null}];switch(_0x2c1b8c[_0x027f('0x3')]()){case'voice':switch(_0x89d975[_0x027f('0x3')]()){case'inbound':_0x1ac68a['push']({'type':_0x027f('0x4'),'content':'','variableName':_0x027f('0x5')});_0x1ac68a[_0x027f('0x6')]({'type':_0x027f('0x4'),'content':'','variableName':_0x027f('0x7')});break;case _0x027f('0x8'):_0x1ac68a[_0x027f('0x6')]({'type':_0x027f('0x1'),'content':_0x027f('0x9'),'variableName':null});_0x1ac68a[_0x027f('0x6')]({'type':_0x027f('0x4'),'content':'','variableName':_0x027f('0xa')});break;}}return _0x1ac68a;};exports[_0x027f('0xb')]=function(_0x253eda,_0x463ea5){var _0xb14c7d=[];switch(_0x253eda[_0x027f('0x3')]()){case'voice':switch(_0x463ea5[_0x027f('0x3')]()){case _0x027f('0xc'):_0xb14c7d=[{'type':_0x027f('0x1'),'content':_0x027f('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x027f('0xe'),'content':'','key':'Caller\x20Number','keyType':_0x027f('0x4'),'variableName':_0x027f('0x7')},{'type':_0x027f('0xe'),'content':'','key':_0x027f('0xf'),'keyType':_0x027f('0x4'),'variableName':_0x027f('0x10')},{'type':_0x027f('0xe'),'content':'','key':_0x027f('0x11'),'keyType':'variable','variableName':_0x027f('0x12')},{'type':_0x027f('0xe'),'content':'','key':_0x027f('0x13'),'keyType':_0x027f('0x4'),'variableName':_0x027f('0x5')},{'type':_0x027f('0xe'),'content':'','key':_0x027f('0x14'),'keyType':_0x027f('0x4'),'variableName':'uniqueid'},{'type':_0x027f('0xe'),'content':'','key':_0x027f('0x15'),'keyType':'variable','variableName':_0x027f('0x16')},{'type':_0x027f('0x1'),'content':_0x027f('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x027f('0xe'),'content':'','key':_0x027f('0x18'),'keyType':_0x027f('0x4'),'variableName':_0x027f('0x19')},{'type':'keyValue','content':'','key':_0x027f('0x1a'),'keyType':_0x027f('0x4'),'variableName':'destcalleridnum'},{'type':_0x027f('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x027f('0x1b'),'keyType':_0x027f('0x4'),'variableName':_0x027f('0x16')},{'type':_0x027f('0xe'),'content':'','key':_0x027f('0x1c'),'keyType':_0x027f('0x4'),'variableName':_0x027f('0x1d')},{'type':_0x027f('0xe'),'content':'','key':_0x027f('0x1e'),'keyType':_0x027f('0x4'),'variableName':_0x027f('0x1f')},{'type':_0x027f('0xe'),'content':'','key':_0x027f('0x20'),'keyType':_0x027f('0x4'),'variableName':_0x027f('0x21')},{'type':_0x027f('0xe'),'content':'','key':'Talk\x20Time','keyType':_0x027f('0x4'),'variableName':_0x027f('0x22')}];break;case _0x027f('0x8'):_0xb14c7d=[{'type':_0x027f('0x1'),'content':_0x027f('0xd'),'variableName':null},{'type':_0x027f('0xe'),'content':'','key':_0x027f('0x23'),'keyType':_0x027f('0x4'),'keyContent':'','variableName':_0x027f('0xa')},{'type':_0x027f('0xe'),'content':'','key':_0x027f('0x24'),'keyType':_0x027f('0x4'),'keyContent':'','variableName':_0x027f('0x25')},{'type':_0x027f('0xe'),'content':'','key':'UniqueId','keyType':_0x027f('0x4'),'keyContent':'','variableName':'uniqueid'},{'type':_0x027f('0xe'),'content':'','key':'Date','keyType':_0x027f('0x4'),'keyContent':'','variableName':_0x027f('0x26')},{'type':_0x027f('0x1'),'content':_0x027f('0x27')},{'type':_0x027f('0xe'),'content':'','key':_0x027f('0x28'),'keyType':_0x027f('0x4'),'keyContent':'','variableName':_0x027f('0x29')},{'type':'keyValue','content':'','key':_0x027f('0x2a'),'keyType':_0x027f('0x4'),'keyContent':'','variableName':'endtime'},{'type':_0x027f('0xe'),'content':'','key':_0x027f('0x2b'),'keyType':_0x027f('0x4'),'keyContent':'','variableName':_0x027f('0x2c')},{'type':'keyValue','content':'','key':_0x027f('0x2d'),'keyType':'variable','keyContent':'','variableName':_0x027f('0x2e')}];break;}}return _0xb14c7d;};
\ No newline at end of file
index eb0a352..82f86fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d14=['rows','catch','user','clone','omit','html','phone','fax','mobile','lodash','./sql-utils','./utils','getInteractionsQuery','resolve','then','search','parseQueryParameters','where','body','contact','fields','having','read','tags','group','i.id','ids','tag','countFilteredInteractions','count','length','clause','order','forEach','contactName','DESC','closed','getClosedOrderClause','getFilteredInteractions'];(function(_0x4e111e,_0x4a0e83){var _0x319cc0=function(_0x577758){while(--_0x577758){_0x4e111e['push'](_0x4e111e['shift']());}};_0x319cc0(++_0x4a0e83);}(_0x5d14,0xcc));var _0x45d1=function(_0x8be9fb,_0x2f90d9){_0x8be9fb=_0x8be9fb-0x0;var _0x3b41ac=_0x5d14[_0x8be9fb];return _0x3b41ac;};'use strict';var _=require(_0x45d1('0x0'));var sqlUtils=require(_0x45d1('0x1'));var utils=require(_0x45d1('0x2'));exports['findAll']=function(_0x235646,_0x13a647,_0x119011,_0x4450f0,_0x4d90c1){var _0x2537b4={'count':0x0,'rows':[]};var _0x6e3ec8=sqlUtils['skipInteractionsQuery'](_0x235646,_0x119011,_0x13a647);if(_0x6e3ec8){return Promise['resolve'](_0x2537b4);}var _0x5ece7d=sqlUtils[_0x45d1('0x3')](_0x235646);var _0x268574={};return Promise[_0x45d1('0x4')]()[_0x45d1('0x5')](function(){if(_0x13a647[_0x45d1('0x6')]){return sqlUtils['parseAdvancedSearchFilter'](_0x13a647[_0x45d1('0x6')],_0x4d90c1);}else{return sqlUtils[_0x45d1('0x7')](_0x235646,_0x13a647,_0x4d90c1);}})[_0x45d1('0x5')](function(_0x34cd79){_0x5ece7d[_0x45d1('0x8')](_0x34cd79[_0x45d1('0x9')]);_0x5ece7d[_0x45d1('0x8')](_0x34cd79[_0x45d1('0xa')]);_0x5ece7d[_0x45d1('0x8')](_0x34cd79['default']);_0x5ece7d['where'](_0x34cd79[_0x45d1('0xb')]);_0x5ece7d[_0x45d1('0x8')](_0x34cd79['filter']);_0x5ece7d[_0x45d1('0x8')](_0x34cd79['user']);_0x5ece7d[_0x45d1('0xc')](_0x34cd79[_0x45d1('0xd')]);_0x268574=_0x34cd79[_0x45d1('0xe')];return sqlUtils['checkAccountsRestrictions'](_0x235646,_0x119011,_0x13a647);})[_0x45d1('0x5')](function(_0x16d429){_0x5ece7d['where'](_0x16d429);_0x5ece7d[_0x45d1('0xf')](_0x45d1('0x10'));var _0x44f4e9=_0x13a647[_0x45d1('0x6')]?_0x268574[_0x45d1('0x11')]:_0x13a647[_0x45d1('0x12')];return sqlUtils[_0x45d1('0x13')](_0x5ece7d,_0x44f4e9);})[_0x45d1('0x5')](function(_0x376a32){_0x2537b4[_0x45d1('0x14')]=_0x376a32[_0x45d1('0x15')];if(_0x2537b4[_0x45d1('0x14')]===0x0){return[];}_0x5ece7d[_0x45d1('0xc')](_0x268574[_0x45d1('0x16')]);if(_0x4450f0[_0x45d1('0x17')]){_0x4450f0[_0x45d1('0x17')][_0x45d1('0x18')](function(_0x5961d6){var _0xe8755a=_0x5961d6[0x0]===_0x45d1('0x19')?_0x5961d6[0x0]:'i.'+_0x5961d6[0x0];_0x5ece7d[_0x45d1('0x17')](_0xe8755a,_0x5961d6[0x1]===_0x45d1('0x1a')?![]:!![]);if(_0x5961d6[0x0]===_0x45d1('0x1b')){var _0x2534a5=sqlUtils[_0x45d1('0x1c')](_0x235646,_0x13a647);_0x5ece7d[_0x45d1('0x17')](_0x2534a5,_0x5961d6[0x1]===_0x45d1('0x1a')?![]:!![]);}});}return sqlUtils[_0x45d1('0x1d')](_0x235646,_0x5ece7d,_0x13a647,_0x4450f0);})[_0x45d1('0x5')](function(_0x5ca008){_0x2537b4[_0x45d1('0x1e')]=_0x5ca008;return _0x2537b4;})[_0x45d1('0x1f')](function(_0x3700d3){throw _0x3700d3;});};exports['tracked']=function(_0x3858d8,_0x565220){return function(_0x3f55f7,_0x329b3d,_0x42dadb){var _0xbaf226=_0x3f55f7[_0x45d1('0x20')];var _0xe9b603={};var _0x54b76c=_0x3f55f7['query'];if(_0xe9b603){_0xe9b603=_[_0x45d1('0x21')](_0x3f55f7[_0x45d1('0x9')]);_0xe9b603=_[_0x45d1('0x22')](_0xe9b603,[_0x45d1('0x9'),_0x45d1('0x23'),_0x45d1('0x24'),_0x45d1('0x25'),_0x45d1('0x26')]);}utils['updateUser'](_0xbaf226,_0xe9b603,_0x54b76c,_0x3858d8,_0x565220);_0x42dadb(null);};};
\ No newline at end of file
+var _0x6952=['body','default','fields','filter','user','having','read','checkAccountsRestrictions','group','i.id','ids','countFilteredInteractions','clause','forEach','contactName','DESC','closed','getClosedOrderClause','getFilteredInteractions','catch','tracked','omit','html','phone','fax','mobile','lodash','./utils','findAll','getInteractionsQuery','resolve','then','search','where'];(function(_0x1ab817,_0x586c26){var _0x5b1d31=function(_0x13fc6a){while(--_0x13fc6a){_0x1ab817['push'](_0x1ab817['shift']());}};_0x5b1d31(++_0x586c26);}(_0x6952,0x12a));var _0x2695=function(_0x534567,_0x1c4563){_0x534567=_0x534567-0x0;var _0x294292=_0x6952[_0x534567];return _0x294292;};'use strict';var _=require(_0x2695('0x0'));var sqlUtils=require('./sql-utils');var utils=require(_0x2695('0x1'));exports[_0x2695('0x2')]=function(_0x58fdbf,_0x35d8bd,_0x549536,_0x12d7d9,_0x412f36){var _0x5b7f9a={'count':0x0,'rows':[]};var _0x670712=sqlUtils['skipInteractionsQuery'](_0x58fdbf,_0x549536,_0x35d8bd);if(_0x670712){return Promise['resolve'](_0x5b7f9a);}var _0x1aab87=sqlUtils[_0x2695('0x3')](_0x58fdbf);var _0x20d859={};return Promise[_0x2695('0x4')]()[_0x2695('0x5')](function(){if(_0x35d8bd[_0x2695('0x6')]){return sqlUtils['parseAdvancedSearchFilter'](_0x35d8bd['search'],_0x412f36);}else{return sqlUtils['parseQueryParameters'](_0x58fdbf,_0x35d8bd,_0x412f36);}})[_0x2695('0x5')](function(_0x447fba){_0x1aab87[_0x2695('0x7')](_0x447fba[_0x2695('0x8')]);_0x1aab87[_0x2695('0x7')](_0x447fba['contact']);_0x1aab87[_0x2695('0x7')](_0x447fba[_0x2695('0x9')]);_0x1aab87[_0x2695('0x7')](_0x447fba[_0x2695('0xa')]);_0x1aab87[_0x2695('0x7')](_0x447fba[_0x2695('0xb')]);_0x1aab87['where'](_0x447fba[_0x2695('0xc')]);_0x1aab87[_0x2695('0xd')](_0x447fba[_0x2695('0xe')]);_0x20d859=_0x447fba['tags'];return sqlUtils[_0x2695('0xf')](_0x58fdbf,_0x549536,_0x35d8bd);})[_0x2695('0x5')](function(_0x5f5dd3){_0x1aab87[_0x2695('0x7')](_0x5f5dd3);_0x1aab87[_0x2695('0x10')](_0x2695('0x11'));var _0x3dc8ba=_0x35d8bd[_0x2695('0x6')]?_0x20d859[_0x2695('0x12')]:_0x35d8bd['tag'];return sqlUtils[_0x2695('0x13')](_0x1aab87,_0x3dc8ba);})[_0x2695('0x5')](function(_0x4b66f1){_0x5b7f9a['count']=_0x4b66f1['length'];if(_0x5b7f9a['count']===0x0){return[];}_0x1aab87[_0x2695('0xd')](_0x20d859[_0x2695('0x14')]);if(_0x12d7d9['order']){_0x12d7d9['order'][_0x2695('0x15')](function(_0x196756){var _0x21d662=_0x196756[0x0]===_0x2695('0x16')?_0x196756[0x0]:'i.'+_0x196756[0x0];_0x1aab87['order'](_0x21d662,_0x196756[0x1]===_0x2695('0x17')?![]:!![]);if(_0x196756[0x0]===_0x2695('0x18')){var _0x386893=sqlUtils[_0x2695('0x19')](_0x58fdbf,_0x35d8bd);_0x1aab87['order'](_0x386893,_0x196756[0x1]===_0x2695('0x17')?![]:!![]);}});}return sqlUtils[_0x2695('0x1a')](_0x58fdbf,_0x1aab87,_0x35d8bd,_0x12d7d9);})[_0x2695('0x5')](function(_0x6a0bc7){_0x5b7f9a['rows']=_0x6a0bc7;return _0x5b7f9a;})[_0x2695('0x1b')](function(_0xde032){throw _0xde032;});};exports[_0x2695('0x1c')]=function(_0x4599d1,_0x505046){return function(_0x265c6f,_0x2c627b,_0x497517){var _0x32cd99=_0x265c6f[_0x2695('0xc')];var _0x2119b1={};var _0x18534d=_0x265c6f['query'];if(_0x2119b1){_0x2119b1=_['clone'](_0x265c6f[_0x2695('0x8')]);_0x2119b1=_[_0x2695('0x1d')](_0x2119b1,['body',_0x2695('0x1e'),_0x2695('0x1f'),_0x2695('0x20'),_0x2695('0x21')]);}utils['updateUser'](_0x32cd99,_0x2119b1,_0x18534d,_0x4599d1,_0x505046);_0x497517(null);};};
\ No newline at end of file
index f550d14..0c67258 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c5d=['conditions','find','buildExpression','default','text','start','value','unreadMessages','read','and','Contact','operator','$substring','split','contact','ContactId','type','end','map','ids','user','UserId','body','plainBody','some','compact','concat','createdAt','parse','$gte','$lte','null','resolve','then','fields','tag','filter','get','capitalize','Websites','Accounts','\x20IS\x20NULL','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','Interaction','QueryTypes','SELECT','sequelize','query','keyBy','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.ContactId','i.MailAccountId','i.UserId','openchannel','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','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','toString','groupBy','Setting','findOne','enableEmailPreview','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','Sequelize','exports','lodash','squel','../parsers/qs','updateInteraction','./utils','../../mysqldb','role','select','name','field','from','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','ui.','left_join','users','length','where','\x20IN\x20?','getInteractionsTables','getAccountFK','interactions','cm_contacts','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','it.','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','{OPERATOR}','replace','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','i.from\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','mail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','sqlOperator'];(function(_0x3fc51b,_0x5b2bbf){var _0x3a5937=function(_0x4fbc7c){while(--_0x4fbc7c){_0x3fc51b['push'](_0x3fc51b['shift']());}};_0x3a5937(++_0x5b2bbf);}(_0x0c5d,0x6c));var _0xd0c5=function(_0x416dfc,_0x469d36){_0x416dfc=_0x416dfc-0x0;var _0x3d093b=_0x0c5d[_0x416dfc];return _0x3d093b;};'use strict';var _=require(_0xd0c5('0x0'));var squel=require(_0xd0c5('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0xd0c5('0x2'));var updateInteraction=require('./update-interaction')[_0xd0c5('0x3')];var utils=require(_0xd0c5('0x4'));var db=require(_0xd0c5('0x5'))['db'];function skipInteractionsQuery(_0x177811,_0x4664bc,_0xc3a9b9){var _0x166636=![];var _0x121911=utils['getAccountFK'](_0x177811);if(_0x4664bc[_0xd0c5('0x6')]==='agent'&&!_0xc3a9b9['search']&&!_0xc3a9b9[_0x121911]){_0x166636=!![];}return _0x166636;}function getTagsQuery(){return squel[_0xd0c5('0x7')]()['field']('id')['field'](_0xd0c5('0x8'))[_0xd0c5('0x9')]('color')[_0xd0c5('0xa')](_0xd0c5('0xb'));}function getUsersQuery(_0x5ae844,_0x458d02){var _0x410037=utils[_0xd0c5('0xc')](_0x5ae844);var _0x30ea26=_0xd0c5('0xd')+_0x5ae844+_0xd0c5('0xe');var _0x1310cf=squel[_0xd0c5('0x7')]()[_0xd0c5('0x9')](_0xd0c5('0xf'))[_0xd0c5('0x9')](_0xd0c5('0x10'))['field'](_0xd0c5('0x11')+_0x410037)[_0xd0c5('0xa')](_0x30ea26,'ui')[_0xd0c5('0x12')](_0xd0c5('0x13'),'u','u.id\x20=\x20ui.UserId');if(_0x458d02[_0xd0c5('0x14')]>0x0){_0x1310cf[_0xd0c5('0x15')](_0xd0c5('0x11')+_0x410037+_0xd0c5('0x16'),_['map'](_0x458d02,'id'));}return _0x1310cf;}function getInteractionsQuery(_0x2be13d){var _0x5809ba=utils[_0xd0c5('0x17')](_0x2be13d);var _0x57c76a=utils[_0xd0c5('0x18')](_0x2be13d);var _0x692aeb=utils[_0xd0c5('0xc')](_0x2be13d);return squel[_0xd0c5('0x7')]()[_0xd0c5('0xa')](_0x5809ba[_0xd0c5('0x19')],'i')[_0xd0c5('0x12')](_0xd0c5('0x1a'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xd0c5('0x12')](_0xd0c5('0x13'),'o','o.id\x20=\x20i.UserId')[_0xd0c5('0x12')](_0x5809ba[_0xd0c5('0x1b')],'a',_0xd0c5('0x1c')+_0x57c76a)[_0xd0c5('0x12')](_0x5809ba[_0xd0c5('0x1d')],'me',_0xd0c5('0x1e')+_0x692aeb+_0xd0c5('0x1f'))['left_join'](_0x5809ba['interactionsTags'],'it',_0xd0c5('0x20')+_0x692aeb+_0xd0c5('0x1f'))[_0xd0c5('0x12')](_0xd0c5('0xb'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x185e33={'body':squel['expr'](),'contact':squel['expr'](),'default':squel[_0xd0c5('0x21')](),'fields':squel[_0xd0c5('0x21')](),'filter':squel[_0xd0c5('0x21')](),'read':squel[_0xd0c5('0x21')](),'tags':{'clause':squel[_0xd0c5('0x21')](),'ids':null},'user':squel[_0xd0c5('0x21')]()};return _0x185e33;}function parseTagParameter(_0xbcef61){var _0x17443b=squel[_0xd0c5('0x21')]();if(_0xbcef61){var _0x198e39=utils[_0xd0c5('0x22')](_0xbcef61);_0x198e39[_0xd0c5('0x23')](function(_0x3502fe){_0x17443b['or'](_0xd0c5('0x24'),'%,'+_0x3502fe+',%');});}return _0x17443b;}function parseReadParameter(_0x1df662){var _0x2869a3='';if(_0x1df662){_0x2869a3=_0xd0c5('0x25');if(_0x1df662==='1'){_0x2869a3=_0x2869a3['replace'](_0xd0c5('0x26'),'=');}else{_0x2869a3=_0x2869a3[_0xd0c5('0x27')](_0xd0c5('0x26'),'>');}}return _0x2869a3;}function parseSearchFilter(_0x21ed42,_0xa2afc1){var _0xcca299=squel[_0xd0c5('0x21')]();if(_0xa2afc1){var _0x571410=_0xa2afc1[_0xd0c5('0x27')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xd0c5('0x28')](_0x571410)){_0xcca299['or'](_0xd0c5('0x29'),_0x571410+'%');if([_0xd0c5('0x2a'),_0xd0c5('0x2b')][_0xd0c5('0x2c')](_0x21ed42)){_0xcca299['or'](_0xd0c5('0x2d'),_0x571410+'%');}else if(_0x21ed42===_0xd0c5('0x2e')){_0xcca299['or']('i.fax\x20LIKE\x20?',_0x571410+'%');}else if(_0x21ed42==='openchannel'){_0xcca299['or'](_0xd0c5('0x2f'),_0x571410+'%');}}else if(_0x21ed42==='mail'&&qs[_0xd0c5('0x30')](_0x571410)){_0xcca299['or'](_0xd0c5('0x31'),_0x571410+'%');}else{if(_0x21ed42===_0xd0c5('0x32')){_0xcca299['or'](_0xd0c5('0x33'),qs['getFullTextValue'](_0x571410))['or'](_0xd0c5('0x34'),qs[_0xd0c5('0x35')](_0x571410));}else{if(_0x21ed42!=='fax'){_0xcca299['or'](_0xd0c5('0x36'),qs['getFullTextValue'](_0x571410));}_0xcca299['or'](_0xd0c5('0x37'),_0x571410+'%');}}}return _0xcca299;}function parseAdvancedSearchFilter(_0x2bddff,_0x44b67a){var _0x511f5c=getSqlClauses();var _0x2fda97=as[_0xd0c5('0x38')](_0x2bddff);var _0x2e8f04=_0x2fda97[_0xd0c5('0x39')];for(var _0x432d57=0x0;_0x432d57<_0x2fda97[_0xd0c5('0x3a')][_0xd0c5('0x14')];_0x432d57++){var _0x323fb3=_0x2fda97[_0xd0c5('0x3a')][_0x432d57];var _0x54042='i';var _0x14c397=_[_0xd0c5('0x3b')](_0x44b67a,[_0xd0c5('0x8'),_0x323fb3['field']]);if(_0x14c397){var _0x4e3d0e=as[_0xd0c5('0x3c')](_0x54042,_0x14c397['type'],_0x323fb3);_0x511f5c[_0xd0c5('0x3d')][_0x2e8f04](_0x4e3d0e[_0xd0c5('0x3e')],_0x4e3d0e['value'][_0xd0c5('0x3f')],_0x4e3d0e[_0xd0c5('0x40')]['end']);}else{switch(_0x323fb3[_0xd0c5('0x9')]){case _0xd0c5('0x41'):var _0x831e0b=parseReadParameter(_0x323fb3[_0xd0c5('0x40')]);_0x511f5c[_0xd0c5('0x42')][_0xd0c5('0x43')](_0x831e0b);break;case _0xd0c5('0x44'):if(_0x323fb3[_0xd0c5('0x45')]===_0xd0c5('0x46')){if(_0x323fb3[_0xd0c5('0x40')][_0xd0c5('0x47')]('\x20')[_0xd0c5('0x14')]>0x1){_0x511f5c[_0xd0c5('0x48')][_0x2e8f04]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd0c5('0x35')](_0x323fb3[_0xd0c5('0x40')]),null);}else{var _0x215048='%'+_0x323fb3[_0xd0c5('0x40')]+'%';_0x511f5c[_0xd0c5('0x48')][_0x2e8f04]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x215048,_0x215048,_0x215048);}}else{_0x14c397=_['find'](_0x44b67a,[_0xd0c5('0x8'),_0xd0c5('0x49')]);_0x323fb3[_0xd0c5('0x9')]=_0xd0c5('0x49');_0x4e3d0e=as['buildExpression'](_0x54042,_0x14c397[_0xd0c5('0x4a')],_0x323fb3);_0x511f5c[_0xd0c5('0x48')][_0x2e8f04](_0x4e3d0e[_0xd0c5('0x3e')],_0x4e3d0e[_0xd0c5('0x40')][_0xd0c5('0x3f')],_0x4e3d0e[_0xd0c5('0x40')][_0xd0c5('0x4b')]);}break;case'Tag':var _0x36ae03=_0x323fb3[_0xd0c5('0x40')]['split'](',')[_0xd0c5('0x4c')](function(_0x2634f3){return Number(_0x2634f3);});var _0x17ab06=parseTagParameter(_0x36ae03);_0x511f5c['tags']['clause']['and'](_0x17ab06);_0x511f5c['tags'][_0xd0c5('0x4d')]=_0x36ae03;break;case'User':if(_0x323fb3[_0xd0c5('0x45')]==='$substring'){_0x511f5c[_0xd0c5('0x4e')][_0x2e8f04]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x323fb3[_0xd0c5('0x40')]+'%',null);}else{_0x14c397=_[_0xd0c5('0x3b')](_0x44b67a,[_0xd0c5('0x8'),_0xd0c5('0x4f')]);_0x323fb3[_0xd0c5('0x9')]='UserId';_0x4e3d0e=as[_0xd0c5('0x3c')](_0x54042,_0x14c397[_0xd0c5('0x4a')],_0x323fb3);_0x511f5c[_0xd0c5('0x4e')][_0x2e8f04](_0x4e3d0e[_0xd0c5('0x3e')],_0x4e3d0e[_0xd0c5('0x40')][_0xd0c5('0x3f')],_0x4e3d0e['value'][_0xd0c5('0x4b')]);}break;case _0xd0c5('0x50'):case _0xd0c5('0x51'):_0x4e3d0e=as[_0xd0c5('0x3c')]('me',null,_0x323fb3);_0x511f5c['body'][_0x2e8f04](_0x4e3d0e[_0xd0c5('0x3e')],_0x4e3d0e[_0xd0c5('0x40')][_0xd0c5('0x3f')],_0x4e3d0e[_0xd0c5('0x40')][_0xd0c5('0x4b')]);break;}}}return _0x511f5c;}function parseModelFields(_0x43d0ad,_0x17d71c,_0x269d63){var _0x393094=utils[_0xd0c5('0x18')](_0x43d0ad);var _0x26fe06=squel[_0xd0c5('0x21')]();var _0x592ff6=_(_0x17d71c)['keys']()[_0xd0c5('0x4c')](function(_0x1dd3aa){return _[_0xd0c5('0x52')](_0x269d63,[_0xd0c5('0x8'),_0x1dd3aa])?_0x1dd3aa:undefined;})[_0xd0c5('0x53')]()[_0xd0c5('0x40')]();if(_0x592ff6['length']>0x0){_0x592ff6[_0xd0c5('0x23')](function(_0x2c2485){if(_0x2c2485===_0x393094){_0x26fe06[_0xd0c5('0x43')]('i.'+_0x393094+_0xd0c5('0x16'),[][_0xd0c5('0x54')](_0x17d71c[_0x2c2485]));}else if(_0x2c2485===_0xd0c5('0x55')){var _0x3441eb=JSON[_0xd0c5('0x56')](_0x17d71c[_0x2c2485])[_0xd0c5('0x57')];var _0x278962=JSON[_0xd0c5('0x56')](_0x17d71c[_0x2c2485])[_0xd0c5('0x58')];_0x26fe06[_0xd0c5('0x43')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3441eb,_0x278962);}else{if(_0x17d71c[_0x2c2485]===_0xd0c5('0x59')){_0x26fe06[_0xd0c5('0x43')]('i.'+_0x2c2485+'\x20IS\x20NULL');}else{_0x26fe06[_0xd0c5('0x43')]('i.'+_0x2c2485+'\x20=\x20?',_0x17d71c[_0x2c2485]);}}});}return _0x26fe06;}function parseQueryParameters(_0x588347,_0x34c5c5,_0x5ff7d5){var _0x3b2ee8=getSqlClauses();return Promise[_0xd0c5('0x5a')]()[_0xd0c5('0x5b')](function(){return parseModelFields(_0x588347,_0x34c5c5,_0x5ff7d5);})[_0xd0c5('0x5b')](function(_0x23fcd6){_0x3b2ee8[_0xd0c5('0x5c')][_0xd0c5('0x43')](_0x23fcd6);return parseReadParameter(_0x34c5c5[_0xd0c5('0x42')]);})[_0xd0c5('0x5b')](function(_0x476ed3){_0x3b2ee8[_0xd0c5('0x42')][_0xd0c5('0x43')](_0x476ed3);return parseTagParameter(_0x34c5c5[_0xd0c5('0x5d')]);})[_0xd0c5('0x5b')](function(_0x1df7ae){_0x3b2ee8['tags']['clause'][_0xd0c5('0x43')](_0x1df7ae);return parseSearchFilter(_0x588347,_0x34c5c5[_0xd0c5('0x5e')]);})['then'](function(_0x5c3b61){_0x3b2ee8[_0xd0c5('0x5e')]=_0x5c3b61;return _0x3b2ee8;});}function checkAccountsRestrictions(_0x245038,_0x3a5bf9,_0x164646){var _0x268fb0=utils[_0xd0c5('0x18')](_0x245038);var _0x19db83=_0xd0c5('0x5f')+_[_0xd0c5('0x60')](_0x245038)+(_0x245038==='chat'?_0xd0c5('0x61'):_0xd0c5('0x62'));var _0x4ec681=squel[_0xd0c5('0x21')]();return Promise['resolve']()[_0xd0c5('0x5b')](function(){if(_0x164646['search']&&_0x3a5bf9[_0xd0c5('0x6')]==='agent'){return _0x3a5bf9[_0x19db83]({'attributes':['id'],'raw':!![]});}})[_0xd0c5('0x5b')](function(_0x339710){if(_0x339710){if(_0x339710[_0xd0c5('0x14')]===0x0){_0x4ec681[_0xd0c5('0x43')]('i.'+_0x268fb0+_0xd0c5('0x63'));}else{_0x4ec681[_0xd0c5('0x43')]('i.'+_0x268fb0+_0xd0c5('0x16'),_[_0xd0c5('0x4c')](_0x339710,'id'));}}else if(!_0x164646[_0x268fb0]){_0x4ec681[_0xd0c5('0x43')]('i.'+_0x268fb0+_0xd0c5('0x64'));}})[_0xd0c5('0x5b')](function(){return _0x4ec681;});}function getClosedOrderClause(_0x3c7e4b,_0x5599cf){var _0x160db5='';var _0x4b8eee=[_0xd0c5('0x65'),_0xd0c5('0x66'),'i.disposition'];if(_0x3c7e4b===_0xd0c5('0x32')){_0x4b8eee[_0xd0c5('0x67')](_0xd0c5('0x68'));}if(_0x5599cf[_0xd0c5('0x69')]==='0'&&_0x3c7e4b===_0xd0c5('0x32')){_0x160db5=_0xd0c5('0x68');}else{if(_0x5599cf['closed']==='1'){_0x4b8eee[_0xd0c5('0x6a')]();}_0x160db5=_0xd0c5('0x6b')+_0x4b8eee[_0xd0c5('0x6c')](',\x20')+')';}return _0x160db5;}function getFilteredInteractions(_0x22815a,_0x5c170d,_0x3440db,_0x229405){var _0x23783c=utils[_0xd0c5('0xc')](_0x22815a);var _0x19b799=_[_0xd0c5('0x60')](_0x22815a)+_0xd0c5('0x6d');var _0xcab1fc=[];var _0x66078a=getTagsQuery();var _0x3d283a={'type':db['Sequelize'][_0xd0c5('0x6e')][_0xd0c5('0x6f')],'raw':!![]};var _0x3b27d7=[];var _0x427461=[];return db[_0xd0c5('0x70')][_0xd0c5('0x71')](_0x66078a['toString'](),_0x3d283a)[_0xd0c5('0x5b')](function(_0x490c93){_0xcab1fc=_[_0xd0c5('0x72')](_0x490c93,'id');_0x3d283a=_[_0xd0c5('0x73')](_0x3d283a,{'model':db[_0x19b799],'mapToModel':!![],'nest':!![]});if(_0x3440db[_0xd0c5('0x5c')]){_0x229405[_0xd0c5('0x74')][_0xd0c5('0x23')](function(_0x5ca677){_0x5c170d['field']('i.'+_0x5ca677);});}else{_0x5c170d[_0xd0c5('0x9')](_0xd0c5('0x75'),_0xd0c5('0x41'));_0x5c170d[_0xd0c5('0x9')](_0xd0c5('0x76'),_0xd0c5('0x77'));_0x5c170d[_0xd0c5('0x9')](_0xd0c5('0x78'),_0xd0c5('0x79'));if(_0x22815a===_0xd0c5('0x32')){_0x5c170d[_0xd0c5('0x9')](_0xd0c5('0x7a'),_0xd0c5('0x7b'));_0x5c170d[_0xd0c5('0x9')](_0xd0c5('0x7c'),_0xd0c5('0x7d'));_0x5c170d[_0xd0c5('0x9')]('i.id');_0x5c170d[_0xd0c5('0x9')]('i.createdAt');_0x5c170d[_0xd0c5('0x9')](_0xd0c5('0x7e'));_0x5c170d['field'](_0xd0c5('0x7f'));_0x5c170d[_0xd0c5('0x9')](_0xd0c5('0x80'));_0x5c170d[_0xd0c5('0x9')](_0xd0c5('0x81'));_0x5c170d[_0xd0c5('0x9')](_0xd0c5('0x82'));_0x5c170d[_0xd0c5('0x9')](_0xd0c5('0x83'));_0x5c170d['field']('i.subject');_0x5c170d[_0xd0c5('0x9')]('i.disposition');_0x5c170d['field'](_0xd0c5('0x66'));_0x5c170d[_0xd0c5('0x9')](_0xd0c5('0x65'));_0x5c170d[_0xd0c5('0x9')](_0xd0c5('0x68'));_0x5c170d['field']('i.to');_0x5c170d[_0xd0c5('0x9')](_0xd0c5('0x84'));_0x5c170d[_0xd0c5('0x9')](_0xd0c5('0x85'));_0x5c170d[_0xd0c5('0x9')](_0xd0c5('0x86'));}else if(_0x22815a===_0xd0c5('0x87')){_0x5c170d['field'](_0xd0c5('0x88'),_0xd0c5('0x7d'));}else{_0x5c170d[_0xd0c5('0x9')](_0xd0c5('0x89'),'contactName');}if(_0x22815a!==_0xd0c5('0x32')){_0x5c170d['field'](_0xd0c5('0x8a'));}_0x5c170d[_0xd0c5('0x9')](_0xd0c5('0x8b'),_0xd0c5('0x8c'));_0x5c170d[_0xd0c5('0x9')]('c.lastName',_0xd0c5('0x8d'));_0x5c170d[_0xd0c5('0x9')](_0xd0c5('0x8e'),_0xd0c5('0x8f'));_0x5c170d[_0xd0c5('0x9')](_0xd0c5('0x90'),'Contact.phone');_0x5c170d[_0xd0c5('0x9')]('c.mobile',_0xd0c5('0x91'));_0x5c170d[_0xd0c5('0x9')](_0xd0c5('0x92'),_0xd0c5('0x93'));_0x5c170d[_0xd0c5('0x9')](_0xd0c5('0x94'),_0xd0c5('0x95'));_0x5c170d[_0xd0c5('0x9')]('o.internal',_0xd0c5('0x96'));_0x5c170d['field'](_0xd0c5('0x97'),_0xd0c5('0x98'));}if(_0x229405[_0xd0c5('0x99')]){_0x5c170d[_0xd0c5('0x99')](_0x229405[_0xd0c5('0x99')]);}if(_0x229405[_0xd0c5('0x9a')]){_0x5c170d[_0xd0c5('0x9a')](_0x229405[_0xd0c5('0x9a')]);}return db[_0xd0c5('0x70')]['query'](_0x5c170d[_0xd0c5('0x9b')](),_0x3d283a);})[_0xd0c5('0x5b')](function(_0x15d596){_0x3b27d7=_0x15d596;var _0xd3c843=getUsersQuery(_0x22815a,_0x3b27d7);return db[_0xd0c5('0x70')]['query'](_0xd3c843[_0xd0c5('0x9b')](),_0x3d283a);})[_0xd0c5('0x5b')](function(_0x53ad30){_0x427461=_[_0xd0c5('0x9c')](_0x53ad30,_0x23783c);if(_0x22815a===_0xd0c5('0x32')){return db[_0xd0c5('0x9d')][_0xd0c5('0x9e')]({'attributes':[_0xd0c5('0x9f')],'raw':!![]});}})[_0xd0c5('0x5b')](function(_0xb4efc5){var _0x463f3d=_0xb4efc5?_0xb4efc5[_0xd0c5('0x9f')]:undefined;var _0x4b79f3=_0x3b27d7[_0xd0c5('0x4c')](function(_0x30044e){return updateInteraction(_0x30044e,_0xcab1fc,_0x427461,_0x463f3d);});return Promise['all'](_0x4b79f3);});}function countFilteredInteractions(_0xd0c69e,_0x246793){var _0x287c00=_0xd0c69e[_0xd0c5('0xa0')]();_0x287c00[_0xd0c5('0x9')](_0xd0c5('0xa1'));_0x287c00[_0xd0c5('0x9')](_0xd0c5('0x75'),_0xd0c5('0x41'));var _0x1ad7db=utils['getSelectedTags'](_0x246793);if(!_[_0xd0c5('0xa2')](_0x1ad7db)){_0x287c00['where'](_0xd0c5('0xa3'),_0x1ad7db);}var _0x233bde={'type':db[_0xd0c5('0xa4')][_0xd0c5('0x6e')][_0xd0c5('0x6f')],'raw':!![]};return db[_0xd0c5('0x70')][_0xd0c5('0x71')](_0x287c00[_0xd0c5('0x9b')](),_0x233bde);}module[_0xd0c5('0xa5')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery};
\ No newline at end of file
+var _0x04b8=['o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','groupBy','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)','getSelectedTags','isEmpty','t.id\x20IN\x20?','QueryTypes','exports','squel','../parsers/qs','./update-interaction','./utils','../../mysqldb','getAccountFK','role','agent','select','field','name','color','from','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','where','ui.','map','getInteractionsTables','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','t.id\x20=\x20it.TagId','expr','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','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','type','default','text','value','start','end','unreadMessages','read','and','operator','$substring','split','contact','ContactId','buildExpression','Tag','tags','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','plainBody','keys','some','compact','\x20IN\x20?','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','resolve','then','fields','tag','clause','filter','get','capitalize','chat','Websites','Accounts','\x20IS\x20NULL','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','i.substatus','closed','shift','join','Sequelize','SELECT','sequelize','query','toString','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.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.closed','i.closedAt','i.attach','i.subject','i.ContactId','i.MailAccountId','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','i.*','Contact.firstName','Contact.lastName','Contact.email','Contact.phone','c.fax','Owner.fullname'];(function(_0x4996d5,_0x123daf){var _0x4793f9=function(_0x30c7ec){while(--_0x30c7ec){_0x4996d5['push'](_0x4996d5['shift']());}};_0x4793f9(++_0x123daf);}(_0x04b8,0x159));var _0x804b=function(_0x3da92e,_0xebfa2d){_0x3da92e=_0x3da92e-0x0;var _0x43d835=_0x04b8[_0x3da92e];return _0x43d835;};'use strict';var _=require('lodash');var squel=require(_0x804b('0x0'));var as=require('../parsers/advancedSearch');var qs=require(_0x804b('0x1'));var updateInteraction=require(_0x804b('0x2'))['updateInteraction'];var utils=require(_0x804b('0x3'));var db=require(_0x804b('0x4'))['db'];function skipInteractionsQuery(_0x5857dc,_0x3530f6,_0x1c3474){var _0x2b0392=![];var _0x5a8a5b=utils[_0x804b('0x5')](_0x5857dc);if(_0x3530f6[_0x804b('0x6')]===_0x804b('0x7')&&!_0x1c3474['search']&&!_0x1c3474[_0x5a8a5b]){_0x2b0392=!![];}return _0x2b0392;}function getTagsQuery(){return squel[_0x804b('0x8')]()[_0x804b('0x9')]('id')['field'](_0x804b('0xa'))[_0x804b('0x9')](_0x804b('0xb'))[_0x804b('0xc')](_0x804b('0xd'));}function getUsersQuery(_0x5c1a40,_0x22c98d){var _0x3338ba=utils[_0x804b('0xe')](_0x5c1a40);var _0x7029e7=_0x804b('0xf')+_0x5c1a40+_0x804b('0x10');var _0x50ba27=squel[_0x804b('0x8')]()['field'](_0x804b('0x11'))[_0x804b('0x9')](_0x804b('0x12'))[_0x804b('0x9')]('ui.'+_0x3338ba)[_0x804b('0xc')](_0x7029e7,'ui')[_0x804b('0x13')](_0x804b('0x14'),'u',_0x804b('0x15'));if(_0x22c98d['length']>0x0){_0x50ba27[_0x804b('0x16')](_0x804b('0x17')+_0x3338ba+'\x20IN\x20?',_[_0x804b('0x18')](_0x22c98d,'id'));}return _0x50ba27;}function getInteractionsQuery(_0x511d22){var _0x2c90b9=utils[_0x804b('0x19')](_0x511d22);var _0x13662e=utils[_0x804b('0x5')](_0x511d22);var _0x3a05c0=utils['getInteractionFK'](_0x511d22);return squel[_0x804b('0x8')]()['from'](_0x2c90b9[_0x804b('0x1a')],'i')[_0x804b('0x13')](_0x804b('0x1b'),'c',_0x804b('0x1c'))['left_join'](_0x804b('0x14'),'o',_0x804b('0x1d'))[_0x804b('0x13')](_0x2c90b9[_0x804b('0x1e')],'a',_0x804b('0x1f')+_0x13662e)[_0x804b('0x13')](_0x2c90b9[_0x804b('0x20')],'me',_0x804b('0x21')+_0x3a05c0+_0x804b('0x22'))[_0x804b('0x13')](_0x2c90b9[_0x804b('0x23')],'it','it.'+_0x3a05c0+_0x804b('0x22'))[_0x804b('0x13')]('tools_tags','t',_0x804b('0x24'));}function getSqlClauses(){var _0x367024={'body':squel[_0x804b('0x25')](),'contact':squel[_0x804b('0x25')](),'default':squel[_0x804b('0x25')](),'fields':squel['expr'](),'filter':squel[_0x804b('0x25')](),'read':squel[_0x804b('0x25')](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0x804b('0x25')]()};return _0x367024;}function parseTagParameter(_0x2366b6){var _0x1117a5=squel[_0x804b('0x25')]();if(_0x2366b6){var _0x2d88da=utils['getSelectedTags'](_0x2366b6);_0x2d88da[_0x804b('0x26')](function(_0x22f822){_0x1117a5['or'](_0x804b('0x27'),'%,'+_0x22f822+',%');});}return _0x1117a5;}function parseReadParameter(_0xe145e){var _0x3d1ecc='';if(_0xe145e){_0x3d1ecc='unreadMessages\x20{OPERATOR}\x200';if(_0xe145e==='1'){_0x3d1ecc=_0x3d1ecc[_0x804b('0x28')](_0x804b('0x29'),'=');}else{_0x3d1ecc=_0x3d1ecc[_0x804b('0x28')]('{OPERATOR}','>');}}return _0x3d1ecc;}function parseSearchFilter(_0x3dbd41,_0x407357){var _0x187a40=squel['expr']();if(_0x407357){var _0x408857=_0x407357[_0x804b('0x28')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x804b('0x2a')](_0x408857)){_0x187a40['or'](_0x804b('0x2b'),_0x408857+'%');if([_0x804b('0x2c'),_0x804b('0x2d')][_0x804b('0x2e')](_0x3dbd41)){_0x187a40['or'](_0x804b('0x2f'),_0x408857+'%');}else if(_0x3dbd41==='fax'){_0x187a40['or'](_0x804b('0x30'),_0x408857+'%');}else if(_0x3dbd41===_0x804b('0x31')){_0x187a40['or'](_0x804b('0x32'),_0x408857+'%');}}else if(_0x3dbd41===_0x804b('0x33')&&qs[_0x804b('0x34')](_0x408857)){_0x187a40['or'](_0x804b('0x35'),_0x408857+'%');}else{if(_0x3dbd41===_0x804b('0x33')){_0x187a40['or'](_0x804b('0x36'),qs[_0x804b('0x37')](_0x408857))['or'](_0x804b('0x38'),qs[_0x804b('0x37')](_0x408857));}else{if(_0x3dbd41!==_0x804b('0x39')){_0x187a40['or'](_0x804b('0x3a'),qs[_0x804b('0x37')](_0x408857));}_0x187a40['or'](_0x804b('0x3b'),_0x408857+'%');}}}return _0x187a40;}function parseAdvancedSearchFilter(_0x384c44,_0x3f02ef){var _0x1be16f=getSqlClauses();var _0xf47023=as[_0x804b('0x3c')](_0x384c44);var _0xa9d773=_0xf47023[_0x804b('0x3d')];for(var _0x447ad8=0x0;_0x447ad8<_0xf47023[_0x804b('0x3e')][_0x804b('0x3f')];_0x447ad8++){var _0x5de917=_0xf47023['conditions'][_0x447ad8];var _0x584452='i';var _0x3da331=_[_0x804b('0x40')](_0x3f02ef,[_0x804b('0xa'),_0x5de917['field']]);if(_0x3da331){var _0x5918f2=as['buildExpression'](_0x584452,_0x3da331[_0x804b('0x41')],_0x5de917);_0x1be16f[_0x804b('0x42')][_0xa9d773](_0x5918f2[_0x804b('0x43')],_0x5918f2[_0x804b('0x44')][_0x804b('0x45')],_0x5918f2[_0x804b('0x44')][_0x804b('0x46')]);}else{switch(_0x5de917[_0x804b('0x9')]){case _0x804b('0x47'):var _0x1d8398=parseReadParameter(_0x5de917[_0x804b('0x44')]);_0x1be16f[_0x804b('0x48')][_0x804b('0x49')](_0x1d8398);break;case'Contact':if(_0x5de917[_0x804b('0x4a')]===_0x804b('0x4b')){if(_0x5de917[_0x804b('0x44')][_0x804b('0x4c')]('\x20')[_0x804b('0x3f')]>0x1){_0x1be16f['contact'][_0xa9d773]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x804b('0x37')](_0x5de917[_0x804b('0x44')]),null);}else{var _0xbaa118='%'+_0x5de917['value']+'%';_0x1be16f[_0x804b('0x4d')][_0xa9d773]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0xbaa118,_0xbaa118,_0xbaa118);}}else{_0x3da331=_[_0x804b('0x40')](_0x3f02ef,[_0x804b('0xa'),_0x804b('0x4e')]);_0x5de917[_0x804b('0x9')]=_0x804b('0x4e');_0x5918f2=as[_0x804b('0x4f')](_0x584452,_0x3da331[_0x804b('0x41')],_0x5de917);_0x1be16f['contact'][_0xa9d773](_0x5918f2[_0x804b('0x43')],_0x5918f2[_0x804b('0x44')][_0x804b('0x45')],_0x5918f2[_0x804b('0x44')]['end']);}break;case _0x804b('0x50'):var _0x2ef9ce=_0x5de917[_0x804b('0x44')][_0x804b('0x4c')](',')[_0x804b('0x18')](function(_0xbca498){return Number(_0xbca498);});var _0x29c9e6=parseTagParameter(_0x2ef9ce);_0x1be16f[_0x804b('0x51')]['clause'][_0x804b('0x49')](_0x29c9e6);_0x1be16f['tags']['ids']=_0x2ef9ce;break;case'User':if(_0x5de917[_0x804b('0x4a')]==='$substring'){_0x1be16f[_0x804b('0x52')][_0xa9d773](_0x804b('0x53'),'%'+_0x5de917[_0x804b('0x44')]+'%',null);}else{_0x3da331=_[_0x804b('0x40')](_0x3f02ef,['name',_0x804b('0x54')]);_0x5de917[_0x804b('0x9')]=_0x804b('0x54');_0x5918f2=as['buildExpression'](_0x584452,_0x3da331[_0x804b('0x41')],_0x5de917);_0x1be16f[_0x804b('0x52')][_0xa9d773](_0x5918f2[_0x804b('0x43')],_0x5918f2['value'][_0x804b('0x45')],_0x5918f2[_0x804b('0x44')][_0x804b('0x46')]);}break;case _0x804b('0x55'):case _0x804b('0x56'):_0x5918f2=as[_0x804b('0x4f')]('me',null,_0x5de917);_0x1be16f[_0x804b('0x55')][_0xa9d773](_0x5918f2[_0x804b('0x43')],_0x5918f2[_0x804b('0x44')][_0x804b('0x45')],_0x5918f2[_0x804b('0x44')][_0x804b('0x46')]);break;}}}return _0x1be16f;}function parseModelFields(_0x20862f,_0x2c1796,_0x578e92){var _0x52d0a2=utils[_0x804b('0x5')](_0x20862f);var _0x179d38=squel[_0x804b('0x25')]();var _0x53124f=_(_0x2c1796)[_0x804b('0x57')]()['map'](function(_0x458283){return _[_0x804b('0x58')](_0x578e92,[_0x804b('0xa'),_0x458283])?_0x458283:undefined;})[_0x804b('0x59')]()[_0x804b('0x44')]();if(_0x53124f[_0x804b('0x3f')]>0x0){_0x53124f['forEach'](function(_0x47eddc){if(_0x47eddc===_0x52d0a2){_0x179d38[_0x804b('0x49')]('i.'+_0x52d0a2+_0x804b('0x5a'),[]['concat'](_0x2c1796[_0x47eddc]));}else if(_0x47eddc==='createdAt'){var _0x2fa47d=JSON[_0x804b('0x5b')](_0x2c1796[_0x47eddc])[_0x804b('0x5c')];var _0x4efe2a=JSON[_0x804b('0x5b')](_0x2c1796[_0x47eddc])[_0x804b('0x5d')];_0x179d38['and'](_0x804b('0x5e'),_0x2fa47d,_0x4efe2a);}else{if(_0x2c1796[_0x47eddc]==='null'){_0x179d38[_0x804b('0x49')]('i.'+_0x47eddc+'\x20IS\x20NULL');}else{_0x179d38[_0x804b('0x49')]('i.'+_0x47eddc+_0x804b('0x5f'),_0x2c1796[_0x47eddc]);}}});}return _0x179d38;}function parseQueryParameters(_0x47c835,_0x2f9360,_0x4a0275){var _0x36b417=getSqlClauses();return Promise[_0x804b('0x60')]()[_0x804b('0x61')](function(){return parseModelFields(_0x47c835,_0x2f9360,_0x4a0275);})[_0x804b('0x61')](function(_0x16cc5f){_0x36b417[_0x804b('0x62')][_0x804b('0x49')](_0x16cc5f);return parseReadParameter(_0x2f9360[_0x804b('0x48')]);})[_0x804b('0x61')](function(_0x2e4ab4){_0x36b417['read']['and'](_0x2e4ab4);return parseTagParameter(_0x2f9360[_0x804b('0x63')]);})['then'](function(_0x490294){_0x36b417[_0x804b('0x51')][_0x804b('0x64')][_0x804b('0x49')](_0x490294);return parseSearchFilter(_0x47c835,_0x2f9360[_0x804b('0x65')]);})['then'](function(_0x4f7cc4){_0x36b417[_0x804b('0x65')]=_0x4f7cc4;return _0x36b417;});}function checkAccountsRestrictions(_0x3954d0,_0x399f9b,_0x6005bf){var _0x9e261a=utils[_0x804b('0x5')](_0x3954d0);var _0x24c9b0=_0x804b('0x66')+_[_0x804b('0x67')](_0x3954d0)+(_0x3954d0===_0x804b('0x68')?_0x804b('0x69'):_0x804b('0x6a'));var _0x38abab=squel[_0x804b('0x25')]();return Promise[_0x804b('0x60')]()[_0x804b('0x61')](function(){if(_0x6005bf['search']&&_0x399f9b[_0x804b('0x6')]===_0x804b('0x7')){return _0x399f9b[_0x24c9b0]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x87640a){if(_0x87640a){if(_0x87640a[_0x804b('0x3f')]===0x0){_0x38abab[_0x804b('0x49')]('i.'+_0x9e261a+_0x804b('0x6b'));}else{_0x38abab['and']('i.'+_0x9e261a+_0x804b('0x5a'),_[_0x804b('0x18')](_0x87640a,'id'));}}else if(!_0x6005bf[_0x9e261a]){_0x38abab['and']('i.'+_0x9e261a+_0x804b('0x6c'));}})[_0x804b('0x61')](function(){return _0x38abab;});}function getClosedOrderClause(_0x45bdb4,_0x53e68f){var _0x126ae4='';var _0x313b76=[_0x804b('0x6d'),_0x804b('0x6e'),_0x804b('0x6f')];if(_0x45bdb4==='mail'){_0x313b76[_0x804b('0x70')](_0x804b('0x71'));}if(_0x53e68f[_0x804b('0x72')]==='0'&&_0x45bdb4===_0x804b('0x33')){_0x126ae4='i.substatus';}else{if(_0x53e68f['closed']==='1'){_0x313b76[_0x804b('0x73')]();}_0x126ae4='CONCAT_WS(\x27\x27,\x20'+_0x313b76[_0x804b('0x74')](',\x20')+')';}return _0x126ae4;}function getFilteredInteractions(_0xe551a0,_0x31773e,_0x366f68,_0x2bfef2){var _0x5d4f6c=utils[_0x804b('0xe')](_0xe551a0);var _0xb386f9=_[_0x804b('0x67')](_0xe551a0)+'Interaction';var _0x360a81=[];var _0x427c56=getTagsQuery();var _0x5ce2e7={'type':db[_0x804b('0x75')]['QueryTypes'][_0x804b('0x76')],'raw':!![]};var _0x45d98f=[];var _0x58ef15=[];return db[_0x804b('0x77')][_0x804b('0x78')](_0x427c56[_0x804b('0x79')](),_0x5ce2e7)['then'](function(_0x436425){_0x360a81=_['keyBy'](_0x436425,'id');_0x5ce2e7=_[_0x804b('0x7a')](_0x5ce2e7,{'model':db[_0xb386f9],'mapToModel':!![],'nest':!![]});if(_0x366f68[_0x804b('0x62')]){_0x2bfef2[_0x804b('0x7b')][_0x804b('0x26')](function(_0x4e81f3){_0x31773e[_0x804b('0x9')]('i.'+_0x4e81f3);});}else{_0x31773e[_0x804b('0x9')](_0x804b('0x7c'),_0x804b('0x47'));_0x31773e[_0x804b('0x9')](_0x804b('0x7d'),'Account.key');_0x31773e[_0x804b('0x9')](_0x804b('0x7e'),'Account.mandatoryDisposition');if(_0xe551a0===_0x804b('0x33')){_0x31773e[_0x804b('0x9')](_0x804b('0x7f'),_0x804b('0x80'));_0x31773e['field'](_0x804b('0x81'),_0x804b('0x82'));_0x31773e['field'](_0x804b('0x83'));_0x31773e[_0x804b('0x9')]('i.createdAt');_0x31773e[_0x804b('0x9')]('i.updatedAt');_0x31773e[_0x804b('0x9')](_0x804b('0x84'));_0x31773e[_0x804b('0x9')](_0x804b('0x85'));_0x31773e[_0x804b('0x9')](_0x804b('0x86'));_0x31773e[_0x804b('0x9')]('i.lastMsgAt');_0x31773e[_0x804b('0x9')]('i.lastMsgDirection');_0x31773e[_0x804b('0x9')](_0x804b('0x87'));_0x31773e[_0x804b('0x9')](_0x804b('0x6f'));_0x31773e[_0x804b('0x9')](_0x804b('0x6e'));_0x31773e[_0x804b('0x9')](_0x804b('0x6d'));_0x31773e[_0x804b('0x9')](_0x804b('0x71'));_0x31773e[_0x804b('0x9')]('i.to');_0x31773e['field'](_0x804b('0x88'));_0x31773e[_0x804b('0x9')](_0x804b('0x89'));_0x31773e[_0x804b('0x9')]('i.UserId');}else if(_0xe551a0===_0x804b('0x31')){_0x31773e[_0x804b('0x9')](_0x804b('0x8a'),_0x804b('0x82'));}else{_0x31773e[_0x804b('0x9')](_0x804b('0x8b'),_0x804b('0x82'));}if(_0xe551a0!==_0x804b('0x33')){_0x31773e[_0x804b('0x9')](_0x804b('0x8c'));}_0x31773e['field']('c.firstName',_0x804b('0x8d'));_0x31773e[_0x804b('0x9')]('c.lastName',_0x804b('0x8e'));_0x31773e[_0x804b('0x9')]('c.email',_0x804b('0x8f'));_0x31773e['field']('c.phone',_0x804b('0x90'));_0x31773e[_0x804b('0x9')]('c.mobile','Contact.mobile');_0x31773e[_0x804b('0x9')](_0x804b('0x91'),'Contact.fax');_0x31773e[_0x804b('0x9')]('o.fullname',_0x804b('0x92'));_0x31773e[_0x804b('0x9')](_0x804b('0x93'),'Owner.internal');_0x31773e[_0x804b('0x9')](_0x804b('0x94'),_0x804b('0x95'));}if(_0x2bfef2[_0x804b('0x96')]){_0x31773e[_0x804b('0x96')](_0x2bfef2[_0x804b('0x96')]);}if(_0x2bfef2[_0x804b('0x97')]){_0x31773e[_0x804b('0x97')](_0x2bfef2[_0x804b('0x97')]);}return db[_0x804b('0x77')]['query'](_0x31773e['toString'](),_0x5ce2e7);})[_0x804b('0x61')](function(_0x3c1238){_0x45d98f=_0x3c1238;var _0x3dd61f=getUsersQuery(_0xe551a0,_0x45d98f);return db[_0x804b('0x77')][_0x804b('0x78')](_0x3dd61f[_0x804b('0x79')](),_0x5ce2e7);})[_0x804b('0x61')](function(_0x29f6d9){_0x58ef15=_[_0x804b('0x98')](_0x29f6d9,_0x5d4f6c);if(_0xe551a0==='mail'){return db[_0x804b('0x99')][_0x804b('0x9a')]({'attributes':[_0x804b('0x9b')],'raw':!![]});}})[_0x804b('0x61')](function(_0xe99c06){var _0x176d92=_0xe99c06?_0xe99c06[_0x804b('0x9b')]:undefined;var _0x336cf6=_0x45d98f[_0x804b('0x18')](function(_0x3a501d){return updateInteraction(_0x3a501d,_0x360a81,_0x58ef15,_0x176d92);});return Promise[_0x804b('0x9c')](_0x336cf6);});}function countFilteredInteractions(_0x31db34,_0x22aa97){var _0x18441e=_0x31db34[_0x804b('0x9d')]();_0x18441e[_0x804b('0x9')](_0x804b('0x9e'));_0x18441e[_0x804b('0x9')](_0x804b('0x7c'),_0x804b('0x47'));var _0x351f2c=utils[_0x804b('0x9f')](_0x22aa97);if(!_[_0x804b('0xa0')](_0x351f2c)){_0x18441e[_0x804b('0x16')](_0x804b('0xa1'),_0x351f2c);}var _0x4ff449={'type':db[_0x804b('0x75')][_0x804b('0xa2')][_0x804b('0x76')],'raw':!![]};return db['sequelize'][_0x804b('0x78')](_0x18441e[_0x804b('0x79')](),_0x4ff449);}module[_0x804b('0xa3')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery};
\ No newline at end of file
index a6cc213..b655380 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f00=['updateInteraction','Users','TagIds','catch','../../mysqldb','map','fullname','split','forEach','waiting','unmanaged','total','closed','abandoned','UserId','answered','talking','disposition','MailMessage','out','plainBody','-id','then','lastMsgText'];(function(_0x2fc30a,_0x349fbd){var _0x5cad21=function(_0xbca2f7){while(--_0xbca2f7){_0x2fc30a['push'](_0x2fc30a['shift']());}};_0x5cad21(++_0x349fbd);}(_0x3f00,0x19c));var _0x03f0=function(_0x3d9555,_0xdc4e50){_0x3d9555=_0x3d9555-0x0;var _0xa1df2d=_0x3f00[_0x3d9555];return _0xa1df2d;};'use strict';var _=require('lodash');var db=require(_0x03f0('0x0'))['db'];function getInteractionUsers(_0x56ce5f,_0x2418ef){return new Promise(function(_0x3b90ba,_0xcdf2ff){try{var _0x4daa87=[];if(_0x2418ef[_0x56ce5f]){_0x4daa87=_0x2418ef[_0x56ce5f][_0x03f0('0x1')](function(_0x192358){return{'id':_0x192358['id'],'fullname':_0x192358[_0x03f0('0x2')]};});}return _0x3b90ba(_0x4daa87);}catch(_0x176b73){_0xcdf2ff(_0x176b73);}});}function getInteractionTags(_0x5dc2ce,_0x4a57dc){var _0x16e26b=[];if(_0x5dc2ce){_0x5dc2ce[_0x03f0('0x3')](',')[_0x03f0('0x4')](function(_0x10e979){_0x16e26b['push'](_0x4a57dc[_0x10e979]);});}return _0x16e26b;}function updateWaitingCounter(_0x3b3f28){if(_0x3b3f28[_0x03f0('0x5')]){_0x3b3f28[_0x03f0('0x5')]-=0x1;}}function updateInteractionCounters(_0xb6a963){_0xb6a963[_0x03f0('0x5')]=0x0;_0xb6a963['talking']=0x0;_0xb6a963['answered']=0x0;_0xb6a963[_0x03f0('0x6')]=0x0;_0xb6a963['abandoned']=0x0;_0xb6a963[_0x03f0('0x7')]=0x0;if(_0xb6a963[_0x03f0('0x8')]){if(_0xb6a963['disposition']===_0x03f0('0x9')){_0xb6a963['abandoned']+=0x1;updateWaitingCounter(_0xb6a963);}if(_0xb6a963[_0x03f0('0xa')]){_0xb6a963[_0x03f0('0xb')]+=0x1;if(_0xb6a963['talking']){_0xb6a963[_0x03f0('0xc')]-=0x1;}}else{if(_0xb6a963[_0x03f0('0xd')]){_0xb6a963[_0x03f0('0x6')]+=0x1;updateWaitingCounter(_0xb6a963);}}}else{if(!_0xb6a963[_0x03f0('0xa')]){_0xb6a963[_0x03f0('0x5')]+=0x1;}if(_0xb6a963['UserId']){_0xb6a963[_0x03f0('0xc')]+=0x1;updateWaitingCounter(_0xb6a963);}}_0xb6a963[_0x03f0('0x7')]+=0x1;return _0xb6a963;}function getLastMessageText(_0x4879b7){return db[_0x03f0('0xe')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x4879b7['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x03f0('0xf')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x03f0('0x10')],'order':_0x03f0('0x11'),'raw':!![]})[_0x03f0('0x12')](function(_0x305e13){if(_0x305e13&&_0x305e13[_0x03f0('0x10')]){_0x4879b7[_0x03f0('0x13')]=_['trimStart'](_0x305e13['plainBody']);}return _0x4879b7;})['catch'](function(_0xcc008d){throw _0xcc008d;});}exports[_0x03f0('0x14')]=function(_0x4a9a60,_0x3ea975,_0xbe9e7b,_0x4bf9e8){return new Promise(function(_0x47b237,_0x2f372a){return getInteractionUsers(_0x4a9a60['id'],_0xbe9e7b)['then'](function(_0x3cc9b9){_0x4a9a60[_0x03f0('0x15')]=_0x3cc9b9;return getInteractionTags(_0x4a9a60[_0x03f0('0x16')],_0x3ea975);})['then'](function(_0x49f206){_0x4a9a60['Tags']=_0x49f206;delete _0x4a9a60[_0x03f0('0x16')];return updateInteractionCounters(_0x4a9a60);})[_0x03f0('0x12')](function(_0xaf847){if(_0x4bf9e8){return getLastMessageText(_0xaf847);}else{return _0xaf847;}})[_0x03f0('0x12')](function(_0x4be5bf){_0x47b237(_0x4be5bf);})[_0x03f0('0x17')](function(_0x12ee33){_0x2f372a(_0x12ee33);});});};
\ No newline at end of file
+var _0xffde=['out','plainBody','-id','then','lastMsgText','trimStart','catch','updateInteraction','Users','TagIds','Tags','map','fullname','split','push','waiting','talking','answered','unmanaged','abandoned','total','closed','disposition','UserId','MailMessage','findOne'];(function(_0x44db50,_0x5ecc02){var _0x2647ff=function(_0x2e454b){while(--_0x2e454b){_0x44db50['push'](_0x44db50['shift']());}};_0x2647ff(++_0x5ecc02);}(_0xffde,0xc1));var _0xeffd=function(_0x398741,_0x32462f){_0x398741=_0x398741-0x0;var _0x28a892=_0xffde[_0x398741];return _0x28a892;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x38de5b,_0x363b91){return new Promise(function(_0x12164d,_0x1f75ad){try{var _0x14edc7=[];if(_0x363b91[_0x38de5b]){_0x14edc7=_0x363b91[_0x38de5b][_0xeffd('0x0')](function(_0x396db2){return{'id':_0x396db2['id'],'fullname':_0x396db2[_0xeffd('0x1')]};});}return _0x12164d(_0x14edc7);}catch(_0x2ca006){_0x1f75ad(_0x2ca006);}});}function getInteractionTags(_0x1469e4,_0x11e30a){var _0x4db58e=[];if(_0x1469e4){_0x1469e4[_0xeffd('0x2')](',')['forEach'](function(_0x5ea3a8){_0x4db58e[_0xeffd('0x3')](_0x11e30a[_0x5ea3a8]);});}return _0x4db58e;}function updateWaitingCounter(_0x3b42e7){if(_0x3b42e7[_0xeffd('0x4')]){_0x3b42e7[_0xeffd('0x4')]-=0x1;}}function updateInteractionCounters(_0x2735ee){_0x2735ee[_0xeffd('0x4')]=0x0;_0x2735ee[_0xeffd('0x5')]=0x0;_0x2735ee[_0xeffd('0x6')]=0x0;_0x2735ee[_0xeffd('0x7')]=0x0;_0x2735ee[_0xeffd('0x8')]=0x0;_0x2735ee[_0xeffd('0x9')]=0x0;if(_0x2735ee[_0xeffd('0xa')]){if(_0x2735ee[_0xeffd('0xb')]===_0xeffd('0x8')){_0x2735ee[_0xeffd('0x8')]+=0x1;updateWaitingCounter(_0x2735ee);}if(_0x2735ee[_0xeffd('0xc')]){_0x2735ee[_0xeffd('0x6')]+=0x1;if(_0x2735ee[_0xeffd('0x5')]){_0x2735ee[_0xeffd('0x5')]-=0x1;}}else{if(_0x2735ee[_0xeffd('0xb')]){_0x2735ee[_0xeffd('0x7')]+=0x1;updateWaitingCounter(_0x2735ee);}}}else{if(!_0x2735ee[_0xeffd('0xc')]){_0x2735ee[_0xeffd('0x4')]+=0x1;}if(_0x2735ee['UserId']){_0x2735ee[_0xeffd('0x5')]+=0x1;updateWaitingCounter(_0x2735ee);}}_0x2735ee[_0xeffd('0x9')]+=0x1;return _0x2735ee;}function getLastMessageText(_0x2d9fda){return db[_0xeffd('0xd')][_0xeffd('0xe')]({'where':{'$and':[{'MailInteractionId':_0x2d9fda['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xeffd('0xf')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xeffd('0x10')],'order':_0xeffd('0x11'),'raw':!![]})[_0xeffd('0x12')](function(_0x5031c4){if(_0x5031c4&&_0x5031c4['plainBody']){_0x2d9fda[_0xeffd('0x13')]=_[_0xeffd('0x14')](_0x5031c4[_0xeffd('0x10')]);}return _0x2d9fda;})[_0xeffd('0x15')](function(_0x209a7c){throw _0x209a7c;});}exports[_0xeffd('0x16')]=function(_0xea1552,_0x1adeec,_0x4e1be0,_0x3159a9){return new Promise(function(_0x386489,_0xc3610f){return getInteractionUsers(_0xea1552['id'],_0x4e1be0)[_0xeffd('0x12')](function(_0x50f924){_0xea1552[_0xeffd('0x17')]=_0x50f924;return getInteractionTags(_0xea1552[_0xeffd('0x18')],_0x1adeec);})[_0xeffd('0x12')](function(_0x282a12){_0xea1552[_0xeffd('0x19')]=_0x282a12;delete _0xea1552[_0xeffd('0x18')];return updateInteractionCounters(_0xea1552);})[_0xeffd('0x12')](function(_0x232967){if(_0x3159a9){return getLastMessageText(_0x232967);}else{return _0x232967;}})['then'](function(_0x40aade){_0x386489(_0x40aade);})[_0xeffd('0x15')](function(_0x36da98){_0xc3610f(_0x36da98);});});};
\ No newline at end of file
index 84f2be2..fa2891b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19e3=['_interactions','_interaction_has_tags','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then','catch','error','exports','lodash','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','websites'];(function(_0x332aa8,_0x3b22ef){var _0x51373e=function(_0xa6bd80){while(--_0xa6bd80){_0x332aa8['push'](_0x332aa8['shift']());}};_0x51373e(++_0x3b22ef);}(_0x19e3,0xd7));var _0x319e=function(_0x3b4067,_0x2ea1ff){_0x3b4067=_0x3b4067-0x0;var _0x4e3243=_0x19e3[_0x3b4067];return _0x4e3243;};'use strict';var _=require(_0x319e('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x319e('0x1'))(_0x319e('0x2')),'mail':require(_0x319e('0x1'))(_0x319e('0x3')),'fax':require(_0x319e('0x1'))(_0x319e('0x4')),'sms':require(_0x319e('0x1'))(_0x319e('0x5')),'chat':require(_0x319e('0x1'))(_0x319e('0x6')),'whatsapp':require(_0x319e('0x1'))(_0x319e('0x7'))};function getAccountFK(_0x6f4e4c){return _[_0x319e('0x8')](_0x6f4e4c)+(_0x6f4e4c===_0x319e('0x9')?_0x319e('0xa'):_0x319e('0xb'))+'Id';}function getInteractionFK(_0x1360ca){return _[_0x319e('0x8')](_0x1360ca)+_0x319e('0xc');}function getInteractionId(_0x5a3b02,_0x1228c8,_0x33e3d6){if(_0x5a3b02&&_0x5a3b02[_[_0x319e('0xd')](_0x33e3d6)+_0x319e('0xc')]){return _0x5a3b02[_[_0x319e('0xd')](_0x33e3d6)+'InteractionId'];}else if(_0x5a3b02&&_0x5a3b02['id']){return _0x5a3b02['id'];}else if(_0x1228c8&&_0x1228c8['id']){return _0x1228c8['id'];}else{return _0x319e('0xe');}}function getInteractionsTables(_0x2006a8){return{'accounts':_0x2006a8+'_'+(_0x2006a8===_0x319e('0x9')?_0x319e('0xf'):'accounts'),'interactions':_0x2006a8+_0x319e('0x10'),'interactionsTags':_0x2006a8+_0x319e('0x11'),'messages':_0x2006a8+'_messages','userInteractions':_0x319e('0x12')+_0x2006a8+_0x319e('0x10')};}function getSelectedTags(_0x2f9111){var _0x4fb9b2=[];if(_0x2f9111){_0x4fb9b2=Array[_0x319e('0x13')](_0x2f9111)?_0x2f9111:[_0x2f9111];}return _0x4fb9b2;}function log(_0x566bfa,_0x2ac1de,_0x300a6a,_0x13a32f,_0x4090d1,_0x394620){loggers[_0x4090d1[_0x319e('0x14')]()][_0x566bfa](_0x319e('0x15'),_0x394620[_0x319e('0x16')](),_0x2ac1de?_0x2ac1de['id']:null,_0x2ac1de?_0x2ac1de[_0x319e('0x17')]:null,_0x2ac1de?_0x2ac1de[_0x319e('0x18')]:null,getInteractionId(_0x300a6a,_0x13a32f,_0x4090d1),_0x300a6a?JSON[_0x319e('0x19')](_0x300a6a):_0x319e('0x1a'));}function updateUser(_0x4a27ac,_0x57a17d,_0x54536e,_0x29c2a6,_0x11a97d){db[_[_0x319e('0xd')](_0x29c2a6)+_0x319e('0x1b')][_0x319e('0x1c')]({'where':{'id':getInteractionId(_0x57a17d,_0x54536e,_0x29c2a6)}})[_0x319e('0x1d')](function(_0x81aa78){if(_0x81aa78){return _0x81aa78['update']({'UserId':_0x4a27ac?_0x4a27ac['id']:null});}})[_0x319e('0x1d')](function(_0x4c350a){if(_0x4c350a){log('info',_0x4a27ac,_0x57a17d,_0x54536e,_0x29c2a6,_0x11a97d);}})[_0x319e('0x1e')](function(){log(_0x319e('0x1f'),_0x4a27ac,_0x57a17d,_0x54536e,_0x29c2a6,_0x11a97d);});}module[_0x319e('0x20')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser};
\ No newline at end of file
+var _0xfd6e=['accounts','_interactions','_interaction_has_tags','_messages','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','Interaction','findOne','then','update','info','catch','error','exports','lodash','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','InteractionId','upperFirst','chat','websites'];(function(_0x204f2d,_0x439c43){var _0x3240f9=function(_0x380e11){while(--_0x380e11){_0x204f2d['push'](_0x204f2d['shift']());}};_0x3240f9(++_0x439c43);}(_0xfd6e,0x120));var _0xefd6=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfd6e[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xefd6('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0xefd6('0x1'))(_0xefd6('0x2')),'mail':require(_0xefd6('0x1'))(_0xefd6('0x3')),'fax':require(_0xefd6('0x1'))('fax-interactions'),'sms':require('../../config/logger')(_0xefd6('0x4')),'chat':require(_0xefd6('0x1'))(_0xefd6('0x5')),'whatsapp':require(_0xefd6('0x1'))(_0xefd6('0x6'))};function getAccountFK(_0x2f532a){return _[_0xefd6('0x7')](_0x2f532a)+(_0x2f532a==='chat'?'Website':'Account')+'Id';}function getInteractionFK(_0x4d546b){return _[_0xefd6('0x7')](_0x4d546b)+_0xefd6('0x8');}function getInteractionId(_0x4f5461,_0x3ea151,_0x1bef07){if(_0x4f5461&&_0x4f5461[_[_0xefd6('0x9')](_0x1bef07)+_0xefd6('0x8')]){return _0x4f5461[_[_0xefd6('0x9')](_0x1bef07)+'InteractionId'];}else if(_0x4f5461&&_0x4f5461['id']){return _0x4f5461['id'];}else if(_0x3ea151&&_0x3ea151['id']){return _0x3ea151['id'];}else{return'unknown';}}function getInteractionsTables(_0x57a7b7){return{'accounts':_0x57a7b7+'_'+(_0x57a7b7===_0xefd6('0xa')?_0xefd6('0xb'):_0xefd6('0xc')),'interactions':_0x57a7b7+_0xefd6('0xd'),'interactionsTags':_0x57a7b7+_0xefd6('0xe'),'messages':_0x57a7b7+_0xefd6('0xf'),'userInteractions':_0xefd6('0x10')+_0x57a7b7+_0xefd6('0xd')};}function getSelectedTags(_0x398ad6){var _0x37375c=[];if(_0x398ad6){_0x37375c=Array[_0xefd6('0x11')](_0x398ad6)?_0x398ad6:[_0x398ad6];}return _0x37375c;}function log(_0x4045f9,_0x3719bd,_0x59de1d,_0x4a36d6,_0x5dd270,_0x31ee8f){loggers[_0x5dd270[_0xefd6('0x12')]()][_0x4045f9](_0xefd6('0x13'),_0x31ee8f['toUpperCase'](),_0x3719bd?_0x3719bd['id']:null,_0x3719bd?_0x3719bd['name']:null,_0x3719bd?_0x3719bd['role']:null,getInteractionId(_0x59de1d,_0x4a36d6,_0x5dd270),_0x59de1d?JSON[_0xefd6('0x14')](_0x59de1d):_0xefd6('0x15'));}function updateUser(_0x435262,_0x2d7774,_0x2e8353,_0x1384d7,_0xa8d9af){db[_[_0xefd6('0x9')](_0x1384d7)+_0xefd6('0x16')][_0xefd6('0x17')]({'where':{'id':getInteractionId(_0x2d7774,_0x2e8353,_0x1384d7)}})[_0xefd6('0x18')](function(_0x5c7a28){if(_0x5c7a28){return _0x5c7a28[_0xefd6('0x19')]({'UserId':_0x435262?_0x435262['id']:null});}})[_0xefd6('0x18')](function(_0x4f7bf9){if(_0x4f7bf9){log(_0xefd6('0x1a'),_0x435262,_0x2d7774,_0x2e8353,_0x1384d7,_0xa8d9af);}})[_0xefd6('0x1b')](function(){log(_0xefd6('0x1c'),_0x435262,_0x2d7774,_0x2e8353,_0x1384d7,_0xa8d9af);});}module[_0xefd6('0x1d')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser};
\ No newline at end of file
index b73406d..8e69b63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62d3=['update','base64','final','utf8','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','isUserLimit','crypto','util','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format'];(function(_0x112024,_0x5ee5a0){var _0x3516c6=function(_0x141e90){while(--_0x141e90){_0x112024['push'](_0x112024['shift']());}};_0x3516c6(++_0x5ee5a0);}(_0x62d3,0xbe));var _0x362d=function(_0x511f29,_0x27cbaf){_0x511f29=_0x511f29-0x0;var _0xa48afd=_0x62d3[_0x511f29];return _0xa48afd;};'use strict';var crypto=require(_0x362d('0x0'));var util=require(_0x362d('0x1'));var compose=require('composable-middleware');var db=require(_0x362d('0x2'))['db'];var config=require(_0x362d('0x3'));function getValueFromLicense(_0x50af8a,_0xa94159){if(_0x50af8a&&_0xa94159){if(_0xa94159[_0x362d('0x4')]&&_0xa94159[_0x362d('0x5')]){var _0x53d706=_0xa94159[_0x362d('0x4')];var _0x3af5c0=_0xa94159[_0x362d('0x5')];var _0x837fd1=_0x53d706['split']('-')[0x4];var _0x124e08=_0x53d706[_0x362d('0x6')]('-')[0x0];var _0xa9da1c=crypto[_0x362d('0x7')](_0x362d('0x8'),util[_0x362d('0x9')]('%s:%s:%s',_0x837fd1,_0x53d706,_0x124e08));var _0xc40163=_0xa9da1c[_0x362d('0xa')](_0x3af5c0,_0x362d('0xb'),'utf8');_0xc40163+=_0xa9da1c[_0x362d('0xc')](_0x362d('0xd'));var _0x583f59=JSON['parse'](_0xc40163);return _0x583f59['hasOwnProperty'](_0x50af8a)?_0x583f59[_0x50af8a]:null;}}return null;}function isLimit(_0x448908,_0x40859e,_0x53cf10,_0x126b45){var _0x1dabf1=_0x40859e;return compose()[_0x362d('0xe')](function(_0xb1257a,_0x555c5a,_0x3b5d3c){return db[_0x362d('0xf')][_0x362d('0x10')]({'where':{'id':0x1},'raw':!![]})[_0x362d('0x11')](function(_0xb86fb3){var _0x54c00c=getValueFromLicense(_0x448908,_0xb86fb3);return _0x54c00c?_0x54c00c:_0x1dabf1;})[_0x362d('0x11')](function(_0x8facbc){_0x1dabf1=_0x8facbc;return _0x53cf10[_0x362d('0x12')](_0x126b45);})[_0x362d('0x11')](function(_0x39e20a){if(_0x39e20a>=_0x1dabf1){return _0x555c5a[_0x362d('0x13')](0x193)[_0x362d('0x14')]({'message':util[_0x362d('0x9')](_0x362d('0x15'),_0x448908)});}_0x3b5d3c();})['catch'](function(_0x83cba8){_0x3b5d3c(_0x83cba8);});});}function isUserLimit(){return isLimit(_0x362d('0x16'),0x1,db[_0x362d('0x17')],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports[_0x362d('0x18')]=isUserLimit;
\ No newline at end of file
+var _0xec14=['../../config/environment','data1','license','split','createDecipher','format','%s:%s:%s','update','base64','utf8','final','hasOwnProperty','use','count','then','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','user','util','composable-middleware','../../mysqldb'];(function(_0x2331e0,_0x25845d){var _0x459974=function(_0x263dba){while(--_0x263dba){_0x2331e0['push'](_0x2331e0['shift']());}};_0x459974(++_0x25845d);}(_0xec14,0xfa));var _0x4ec1=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xec14[_0xf0bcac];return _0x4e4c65;};'use strict';var crypto=require('crypto');var util=require(_0x4ec1('0x0'));var compose=require(_0x4ec1('0x1'));var db=require(_0x4ec1('0x2'))['db'];var config=require(_0x4ec1('0x3'));function getValueFromLicense(_0x11873a,_0x2b5b26){if(_0x11873a&&_0x2b5b26){if(_0x2b5b26['data1']&&_0x2b5b26['license']){var _0x1aff88=_0x2b5b26[_0x4ec1('0x4')];var _0x5092fa=_0x2b5b26[_0x4ec1('0x5')];var _0x141961=_0x1aff88['split']('-')[0x4];var _0x20bec2=_0x1aff88[_0x4ec1('0x6')]('-')[0x0];var _0x2c8d82=crypto[_0x4ec1('0x7')]('aes-256-ctr',util[_0x4ec1('0x8')](_0x4ec1('0x9'),_0x141961,_0x1aff88,_0x20bec2));var _0x5273a0=_0x2c8d82[_0x4ec1('0xa')](_0x5092fa,_0x4ec1('0xb'),_0x4ec1('0xc'));_0x5273a0+=_0x2c8d82[_0x4ec1('0xd')]('utf8');var _0x2b8026=JSON['parse'](_0x5273a0);return _0x2b8026[_0x4ec1('0xe')](_0x11873a)?_0x2b8026[_0x11873a]:null;}}return null;}function isLimit(_0x18497a,_0x2d973f,_0x2f86f2,_0x2e292a){var _0x39468a=_0x2d973f;return compose()[_0x4ec1('0xf')](function(_0x55836c,_0x15601c,_0x86c224){return db['License']['findOne']({'where':{'id':0x1},'raw':!![]})['then'](function(_0xfc9e82){var _0x4a73f2=getValueFromLicense(_0x18497a,_0xfc9e82);return _0x4a73f2?_0x4a73f2:_0x39468a;})['then'](function(_0x140800){_0x39468a=_0x140800;return _0x2f86f2[_0x4ec1('0x10')](_0x2e292a);})[_0x4ec1('0x11')](function(_0xad2b3a){if(_0xad2b3a>=_0x39468a){return _0x15601c['status'](0x193)[_0x4ec1('0x12')]({'message':util['format'](_0x4ec1('0x13'),_0x18497a)});}_0x86c224();})['catch'](function(_0x202757){_0x86c224(_0x202757);});});}function isUserLimit(){return isLimit(_0x4ec1('0x14'),0x1,db[_0x4ec1('0x15')],{'where':{'$or':[{'role':'admin'},{'role':_0x4ec1('0x16')}]}});}exports['isUserLimit']=isUserLimit;
\ No newline at end of file
index a6e40c5..3b8047b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e0f=['=\x20?','<>\x20?','$endsWith','$lt','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$in','$substring','$startsWith','start','pop','utcOffset','hours','minutes','seconds','lodash','moment','sqlOperator','startsWith','replace','[$or]','split','slice','forEach','shift','match','filter','indexOf','map','conditions','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','$lte','add','days','format','castTo','text','CAST(','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','NOT\x20IN\x20?'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x6e0f,0x78));var _0xf6e0=function(_0x4f02a5,_0x154972){_0x4f02a5=_0x4f02a5-0x0;var _0x23ca4f=_0x6e0f[_0x4f02a5];return _0x23ca4f;};'use strict';var _=require(_0xf6e0('0x0'));var moment=require(_0xf6e0('0x1'));exports['parseSearch']=function(_0x547040){var _0xa84d61={'conditions':[]};_0xa84d61[_0xf6e0('0x2')]=_[_0xf6e0('0x3')](_0x547040,'[$or]')?'or':'and';var _0x4edf9d=_0x547040[_0xf6e0('0x4')]('[$and]','')[_0xf6e0('0x4')](_0xf6e0('0x5'),'')[_0xf6e0('0x6')]('||');for(var _0x311389=0x0;_0x311389<_0x4edf9d['length'];_0x311389++){var _0x1ef631=_0x4edf9d[_0x311389][_0xf6e0('0x6')](':=');var _0x11da27=_0x1ef631[0x0];var _0x373d40=_0x1ef631[_0xf6e0('0x7')](0x1);_0x373d40[_0xf6e0('0x8')](function(_0x41b328){var _0x108852=_0x41b328['split']('[')[_0xf6e0('0x9')]();var _0x485ecd=_0x41b328[_0xf6e0('0xa')](/\[(.*?)\]/g);_0x485ecd[_0xf6e0('0x8')](function(_0x208abc){var _0xe75561=_0x208abc['split']('[')[_0xf6e0('0xb')](function(_0x733222){return _0x733222[_0xf6e0('0xc')](']')>-0x1;})[_0xf6e0('0xd')](function(_0x571757){return _0x571757[_0xf6e0('0x6')](']')[0x0];})[0x0];_0xa84d61[_0xf6e0('0xe')]['push']({'field':_0x11da27,'operator':_0x108852,'value':_0xe75561});});});}return _0xa84d61;};exports[_0xf6e0('0xf')]=function(_0xcfeeff,_0x931fa5,_0x52f918){var _0x532dea={};if(_0x931fa5===_0xf6e0('0x10')){if(_0x52f918[_0xf6e0('0x11')]===_0xf6e0('0x12')){_0x52f918[_0xf6e0('0x11')]=_0xf6e0('0x13');_0x52f918[_0xf6e0('0x14')]+=','+_0x52f918[_0xf6e0('0x14')];}else if(_[_0xf6e0('0x15')]([_0xf6e0('0x16'),_0xf6e0('0x17')],_0x52f918['operator'])){_0x52f918['value']=moment(_0x52f918[_0xf6e0('0x14')])[_0xf6e0('0x18')](0x1,_0xf6e0('0x19'))[_0xf6e0('0x1a')]('YYYY-MM-DD');}}if(_0x52f918[_0xf6e0('0x1b')]){_0x931fa5=_0x52f918[_0xf6e0('0x1b')];_0x532dea[_0xf6e0('0x1c')]=_0xf6e0('0x1d')+_0xcfeeff+'.'+_0x52f918[_0xf6e0('0x1e')]+'\x20AS\x20'+_0x52f918[_0xf6e0('0x1b')]+')\x20'+parseOperator(_0x52f918[_0xf6e0('0x11')]);}else{_0x532dea[_0xf6e0('0x1c')]=_0xcfeeff+'.'+_0x52f918[_0xf6e0('0x1e')]+'\x20'+parseOperator(_0x52f918[_0xf6e0('0x11')]);}if(_[_0xf6e0('0x15')]([_0xf6e0('0x1f'),_0xf6e0('0x20')],_0x52f918[_0xf6e0('0x11')]))_0x532dea['text']='('+_0x532dea['text']+_0xf6e0('0x21')+_0xcfeeff+'.'+_0x52f918[_0xf6e0('0x1e')]+_0xf6e0('0x22');_0x532dea[_0xf6e0('0x14')]=parseValue(_0x931fa5,_0x52f918['operator'],_0x52f918[_0xf6e0('0x14')]);return _0x532dea;};function parseOperator(_0x33fc17){var _0x5be81b;switch(_0x33fc17){case'$in':_0x5be81b='IN\x20?';break;case _0xf6e0('0x20'):_0x5be81b=_0xf6e0('0x23');break;case _0xf6e0('0x12'):_0x5be81b=_0xf6e0('0x24');break;case _0xf6e0('0x1f'):_0x5be81b=_0xf6e0('0x25');break;case'$substring':case'$startsWith':case _0xf6e0('0x26'):_0x5be81b='LIKE\x20?';break;case _0xf6e0('0x27'):_0x5be81b='<\x20?';break;case _0xf6e0('0x16'):_0x5be81b='>\x20?';break;case _0xf6e0('0x17'):_0x5be81b='<=\x20?';break;case _0xf6e0('0x28'):_0x5be81b=_0xf6e0('0x29');break;case _0xf6e0('0x13'):_0x5be81b=_0xf6e0('0x2a');break;}return _0x5be81b;}function parseValue(_0xcaf5c9,_0x3b9349,_0x1714db){var _0x14f9b8={'start':undefined,'end':undefined};switch(_0x3b9349){case _0xf6e0('0x2b'):case _0xf6e0('0x20'):_0x14f9b8['start']=_0x1714db[_0xf6e0('0x6')](',');break;case _0xf6e0('0x2c'):_0x14f9b8['start']='%'+_0x1714db+'%';break;case _0xf6e0('0x2d'):_0x14f9b8[_0xf6e0('0x2e')]=_0x1714db+'%';break;case _0xf6e0('0x26'):_0x14f9b8['start']='%'+_0x1714db;break;case'$between':var _0x1ea136=_0x1714db[_0xf6e0('0x6')](',');var _0x1714db=_0x1ea136[_0xf6e0('0x9')]();var _0x5d6e66=_0x1ea136[_0xf6e0('0x2f')]();if(_0xcaf5c9===_0xf6e0('0x10')){_0x1714db=moment(_0x1714db)[_0xf6e0('0x30')](0x0,!![])['format']();_0x5d6e66=moment(_0x5d6e66)[_0xf6e0('0x30')](0x0,!![])['add'](0x17,_0xf6e0('0x31'))['add'](0x3b,_0xf6e0('0x32'))[_0xf6e0('0x18')](0x3b,_0xf6e0('0x33'))[_0xf6e0('0x1a')]();}_0x14f9b8={'start':_0x1714db,'end':_0x5d6e66};break;default:_0x14f9b8[_0xf6e0('0x2e')]=_0x1714db;break;}return _0x14f9b8;}
\ No newline at end of file
+var _0x623e=['CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$endsWith','LIKE\x20?','$lt','<\x20?','<=\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','shift','utcOffset','lodash','moment','parseSearch','sqlOperator','[$or]','replace','[$and]','split','length','slice','match','forEach','indexOf','map','conditions','push','buildExpression','DATE','operator','$between','value','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text'];(function(_0x3d2d51,_0x32a363){var _0x2120de=function(_0x26d89f){while(--_0x26d89f){_0x3d2d51['push'](_0x3d2d51['shift']());}};_0x2120de(++_0x32a363);}(_0x623e,0xe2));var _0xe623=function(_0x8e637f,_0x13b69e){_0x8e637f=_0x8e637f-0x0;var _0x1f8c40=_0x623e[_0x8e637f];return _0x1f8c40;};'use strict';var _=require(_0xe623('0x0'));var moment=require(_0xe623('0x1'));exports[_0xe623('0x2')]=function(_0x4c6157){var _0x354307={'conditions':[]};_0x354307[_0xe623('0x3')]=_['startsWith'](_0x4c6157,_0xe623('0x4'))?'or':'and';var _0x3f5c3e=_0x4c6157[_0xe623('0x5')](_0xe623('0x6'),'')[_0xe623('0x5')](_0xe623('0x4'),'')[_0xe623('0x7')]('||');for(var _0x417160=0x0;_0x417160<_0x3f5c3e[_0xe623('0x8')];_0x417160++){var _0x4e935e=_0x3f5c3e[_0x417160][_0xe623('0x7')](':=');var _0x387e89=_0x4e935e[0x0];var _0x1fadc7=_0x4e935e[_0xe623('0x9')](0x1);_0x1fadc7['forEach'](function(_0x191062){var _0x41f0f3=_0x191062['split']('[')['shift']();var _0x4a6fb3=_0x191062[_0xe623('0xa')](/\[(.*?)\]/g);_0x4a6fb3[_0xe623('0xb')](function(_0x4cb648){var _0xe8ad07=_0x4cb648[_0xe623('0x7')]('[')['filter'](function(_0x1da4e8){return _0x1da4e8[_0xe623('0xc')](']')>-0x1;})[_0xe623('0xd')](function(_0x2e048f){return _0x2e048f[_0xe623('0x7')](']')[0x0];})[0x0];_0x354307[_0xe623('0xe')][_0xe623('0xf')]({'field':_0x387e89,'operator':_0x41f0f3,'value':_0xe8ad07});});});}return _0x354307;};exports[_0xe623('0x10')]=function(_0x540e0c,_0x193654,_0x4691b8){var _0x481057={};if(_0x193654===_0xe623('0x11')){if(_0x4691b8['operator']==='$eq'){_0x4691b8[_0xe623('0x12')]=_0xe623('0x13');_0x4691b8[_0xe623('0x14')]+=','+_0x4691b8[_0xe623('0x14')];}else if(_['includes']([_0xe623('0x15'),_0xe623('0x16')],_0x4691b8[_0xe623('0x12')])){_0x4691b8[_0xe623('0x14')]=moment(_0x4691b8[_0xe623('0x14')])[_0xe623('0x17')](0x1,_0xe623('0x18'))[_0xe623('0x19')](_0xe623('0x1a'));}}if(_0x4691b8[_0xe623('0x1b')]){_0x193654=_0x4691b8[_0xe623('0x1b')];_0x481057[_0xe623('0x1c')]=_0xe623('0x1d')+_0x540e0c+'.'+_0x4691b8[_0xe623('0x1e')]+_0xe623('0x1f')+_0x4691b8['castTo']+')\x20'+parseOperator(_0x4691b8[_0xe623('0x12')]);}else{_0x481057[_0xe623('0x1c')]=_0x540e0c+'.'+_0x4691b8[_0xe623('0x1e')]+'\x20'+parseOperator(_0x4691b8['operator']);}if(_['includes']([_0xe623('0x20'),_0xe623('0x21')],_0x4691b8[_0xe623('0x12')]))_0x481057[_0xe623('0x1c')]='('+_0x481057[_0xe623('0x1c')]+_0xe623('0x22')+_0x540e0c+'.'+_0x4691b8['field']+_0xe623('0x23');_0x481057[_0xe623('0x14')]=parseValue(_0x193654,_0x4691b8[_0xe623('0x12')],_0x4691b8['value']);return _0x481057;};function parseOperator(_0x183e5a){var _0x4ecda6;switch(_0x183e5a){case'$in':_0x4ecda6=_0xe623('0x24');break;case _0xe623('0x21'):_0x4ecda6=_0xe623('0x25');break;case'$eq':_0x4ecda6=_0xe623('0x26');break;case _0xe623('0x20'):_0x4ecda6=_0xe623('0x27');break;case _0xe623('0x28'):case'$startsWith':case _0xe623('0x29'):_0x4ecda6=_0xe623('0x2a');break;case _0xe623('0x2b'):_0x4ecda6=_0xe623('0x2c');break;case _0xe623('0x15'):_0x4ecda6='>\x20?';break;case _0xe623('0x16'):_0x4ecda6=_0xe623('0x2d');break;case'$gte':_0x4ecda6=_0xe623('0x2e');break;case'$between':_0x4ecda6=_0xe623('0x2f');break;}return _0x4ecda6;}function parseValue(_0x28f6d9,_0x4c9c75,_0x515343){var _0x5d5aa2={'start':undefined,'end':undefined};switch(_0x4c9c75){case'$in':case _0xe623('0x21'):_0x5d5aa2['start']=_0x515343['split'](',');break;case _0xe623('0x28'):_0x5d5aa2['start']='%'+_0x515343+'%';break;case'$startsWith':_0x5d5aa2[_0xe623('0x30')]=_0x515343+'%';break;case _0xe623('0x29'):_0x5d5aa2['start']='%'+_0x515343;break;case _0xe623('0x13'):var _0xff3c41=_0x515343[_0xe623('0x7')](',');var _0x515343=_0xff3c41[_0xe623('0x31')]();var _0x3d8b45=_0xff3c41['pop']();if(_0x28f6d9===_0xe623('0x11')){_0x515343=moment(_0x515343)[_0xe623('0x32')](0x0,!![])[_0xe623('0x19')]();_0x3d8b45=moment(_0x3d8b45)[_0xe623('0x32')](0x0,!![])['add'](0x17,'hours')[_0xe623('0x17')](0x3b,'minutes')[_0xe623('0x17')](0x3b,'seconds')[_0xe623('0x19')]();}_0x5d5aa2={'start':_0x515343,'end':_0x3d8b45};break;default:_0x5d5aa2[_0xe623('0x30')]=_0x515343;break;}return _0x5d5aa2;}
\ No newline at end of file
index 78afaae..52776a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd67b=['attributes','nolimit','offset','sort','where','filter','object','columns','value','merge','lower','options','sequelize','includes','parse','keys','fields','split','filters','forOwn','find','type','DATE','isPlainObject','$gte','YYYY-MM-DD','utc','format','$lte','subtract','name','isArray','limit','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','omit','isEmpty','length','isString','unset','hasOwnProperty','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','push','getOptions','$id','query','model','intersection'];(function(_0x41eacb,_0x45a8df){var _0xc758b5=function(_0x292d00){while(--_0x292d00){_0x41eacb['push'](_0x41eacb['shift']());}};_0xc758b5(++_0x45a8df);}(_0xd67b,0x133));var _0xbd67=function(_0x38785b,_0x451a72){_0x38785b=_0x38785b-0x0;var _0x2f7183=_0xd67b[_0x38785b];return _0x2f7183;};'use strict';var _=require('lodash');var sequelize=require(_0xbd67('0x0'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1da24d){var _0x280954=['ne'];try{var _0x317e33=JSON['parse'](_0x1da24d);var _0x40e384=Object['keys'](_0x317e33)[0x0];return _0x280954[_0xbd67('0x1')](_0x40e384);}catch(_0x5a827b){return![];}}function getOperatorValue(_0x309962){var _0xa5c384=JSON[_0xbd67('0x2')](_0x309962);var _0x27b016=Object[_0xbd67('0x3')](_0xa5c384)[0x0];var _0x72f9ac=_0xa5c384[_0x27b016];return{['$'+_0x27b016]:_0x72f9ac};}exports[_0xbd67('0x4')]=function(_0xfad775){var _0x1da7f1=null;if(_0xfad775){_0x1da7f1=_0xfad775[_0xbd67('0x5')](',');}return _0x1da7f1;};exports[_0xbd67('0x6')]=function(_0x3a7f43,_0x283f2f){var _0x52b981={};if(!_['isEmpty'](_0x3a7f43)){_[_0xbd67('0x7')](_0x3a7f43,function(_0x5aad7a,_0x388d95){try{if(_0x283f2f){var _0xb6b4b5=_[_0xbd67('0x8')](_0x283f2f,{'name':_0x388d95})||{};if(hasSequelizeOperator(_0x5aad7a)){_0x52b981[_0x388d95]=getOperatorValue(_0x5aad7a);}else if(_0xb6b4b5[_0xbd67('0x9')]===_0xbd67('0xa')&&_[_0xbd67('0xb')](_0x5aad7a)){var _0x3621ad=JSON[_0xbd67('0x2')](_0x5aad7a);var _0x341b2b={'$gte':moment(moment(_0x3621ad[_0xbd67('0xc')])['format'](_0xbd67('0xd')))[_0xbd67('0xe')]()[_0xbd67('0xf')](),'$lte':moment(moment(_0x3621ad[_0xbd67('0x10')])[_0xbd67('0xf')](_0xbd67('0xd')))[_0xbd67('0xe')]()[_0xbd67('0x11')](0x1,'s')[_0xbd67('0xf')]()};_0x52b981[_0x388d95]=_0x341b2b;}else if(_0xb6b4b5[_0xbd67('0x12')]==='uniqueid'){_0x52b981[_0x388d95]=_0x5aad7a;}else{_0x52b981[_0x388d95]=_['isArray'](_0x5aad7a)?_0x5aad7a:JSON[_0xbd67('0x2')](_0x5aad7a);}}else{_0x52b981[_0x388d95]=_[_0xbd67('0x13')](_0x5aad7a)?_0x5aad7a:JSON[_0xbd67('0x2')](_0x5aad7a);}}catch(_0x47d066){_0x52b981[_0x388d95]=_0x5aad7a[_0xbd67('0x5')](',');}});}return _0x52b981;};exports[_0xbd67('0x14')]=function(_0x357ff2){_0x357ff2=parseInt(_0x357ff2,0xa);if(!_0x357ff2||_0x357ff2<0x0){_0x357ff2=LIMIT_VALUE;}return _0x357ff2;};exports['offset']=function(_0x5906a2){_0x5906a2=parseInt(_0x5906a2,0xa);if(!_0x5906a2||_0x5906a2<0x0){_0x5906a2=0x0;}return _0x5906a2;};exports['sort']=function(_0x1f9193){var _0x4609b7,_0xb3f67f=null;if(_0x1f9193){_0x4609b7=_0x1f9193['split'](',');_0xb3f67f=_[_0xbd67('0x15')](_0x4609b7,function(_0x40ec96){if(_0x40ec96[_0xbd67('0x16')]('-')===0x0){return[_0x40ec96===_0xbd67('0x17')?sequelize[_0xbd67('0x18')](sequelize[_0xbd67('0x19')]('priority'),_0xbd67('0x1a')):_0x40ec96[_0xbd67('0x1b')](0x1),_0xbd67('0x1c')];}else{return[_0x40ec96===_0xbd67('0x17')?sequelize[_0xbd67('0x18')](sequelize[_0xbd67('0x19')](_0xbd67('0x17')),_0xbd67('0x1a')):_0x40ec96,_0xbd67('0x1d')];}});}return _0xb3f67f;};exports[_0xbd67('0x1e')]=function(_0x46b7ff,_0x57602d){if(_[_0xbd67('0x1f')](_0x46b7ff)){return _0x46b7ff;}if(_['isArray'](_0x46b7ff)){for(var _0x25bf7a=0x0;_0x25bf7a<_0x46b7ff[_0xbd67('0x20')];_0x25bf7a+=0x1){_0x46b7ff[_0x25bf7a]=this[_0xbd67('0x1e')](_0x46b7ff[_0x25bf7a],_0x57602d);}return _0x46b7ff;}if(!_['isObject'](_0x46b7ff)){return _0x46b7ff;}if(_[_0xbd67('0x21')](_0x57602d)){_0x57602d=[_0x57602d];}if(!_[_0xbd67('0x13')](_0x57602d)){return _0x46b7ff;}for(var _0x4dfa19=0x0;_0x4dfa19<_0x57602d[_0xbd67('0x20')];_0x4dfa19+=0x1){_[_0xbd67('0x22')](_0x46b7ff,_0x57602d[_0x4dfa19]);}for(var _0x374f1b in _0x46b7ff){if(_0x46b7ff[_0xbd67('0x23')](_0x374f1b)){_0x46b7ff[_0x374f1b]=this[_0xbd67('0x1e')](_0x46b7ff[_0x374f1b],_0x57602d);}}return _0x46b7ff;};exports['isNumeric']=function(_0x5975dc){return _0x5975dc[_0xbd67('0x24')](RegExp(_0xbd67('0x25')))?!![]:![];};exports[_0xbd67('0x26')]=function(_0x44eced){return _0x44eced[_0xbd67('0x24')](/^\S+@\S+$/)?!![]:![];};exports[_0xbd67('0x27')]=function(_0x256137){var _0x2e123e=[];_0x256137[_0xbd67('0x5')](/[ ,]+/)[_0xbd67('0x28')](function(_0x5cb0ce){_0x5cb0ce=_0x5cb0ce['replace'](/([^:]")"+/g,'$1');_0x5cb0ce='+'+_0x5cb0ce+'*';var _0x5fcae8=/[ `!@#$%^&*()_\-?~]/;if(_0x5cb0ce[_0xbd67('0x24')](_0x5fcae8))_0x5cb0ce='\x22'+_0x5cb0ce+'\x22';_0x2e123e[_0xbd67('0x29')](_0x5cb0ce);});return _0x2e123e['join']('\x20');};exports[_0xbd67('0x2a')]=function(_0x15da85,_0xb3f593,_0x484989){var _0x4d1ce3={},_0x5186eb={};if(_0xb3f593['query'][_0xbd67('0x2b')]){_0xb3f593[_0xbd67('0x2c')]['id']=_0xb3f593[_0xbd67('0x2c')]['$id'];delete _0xb3f593['query'][_0xbd67('0x2b')];}_0x4d1ce3[_0xbd67('0x2d')]=_[_0xbd67('0x15')](_0x15da85,_0xbd67('0x12'));_0x4d1ce3[_0xbd67('0x2c')]=_[_0xbd67('0x3')](_0xb3f593['query']);_0x4d1ce3[_0xbd67('0x6')]=_[_0xbd67('0x2e')](_0x4d1ce3[_0xbd67('0x2d')],_0x4d1ce3['query']);_0x5186eb[_0xbd67('0x2f')]=_['intersection'](_0x4d1ce3[_0xbd67('0x2d')],this[_0xbd67('0x4')](_0xb3f593['query'][_0xbd67('0x4')]));_0x5186eb[_0xbd67('0x2f')]=_0x5186eb[_0xbd67('0x2f')][_0xbd67('0x20')]?_0x5186eb[_0xbd67('0x2f')]:_0x4d1ce3[_0xbd67('0x2d')];if(!_0xb3f593['query'][_0xbd67('0x23')](_0xbd67('0x30'))){_0x5186eb[_0xbd67('0x14')]=this[_0xbd67('0x14')](_0xb3f593[_0xbd67('0x2c')]['limit']);_0x5186eb['offset']=this[_0xbd67('0x31')](_0xb3f593[_0xbd67('0x2c')][_0xbd67('0x31')]);}_0x5186eb['order']=this[_0xbd67('0x32')](_0xb3f593[_0xbd67('0x2c')][_0xbd67('0x32')]);_0x5186eb[_0xbd67('0x33')]=this['filters'](_['pick'](_0xb3f593['query'],_0x4d1ce3['filters']),_0x15da85);if(_0xb3f593['query'][_0xbd67('0x34')]){var _0x5a6b2d=_0x15da85;var _0x4d08a6=_0xb3f593['query'][_0xbd67('0x34')];if(typeof _0x4d08a6===_0xbd67('0x35')){_0x5a6b2d=_[_0xbd67('0x34')](_0x15da85,function(_0x2ca134){return _['includes'](_0x4d08a6[_0xbd67('0x36')],_0x2ca134[_0xbd67('0x12')]);});_0x4d08a6=_0x4d08a6[_0xbd67('0x37')];}_0x5186eb[_0xbd67('0x33')]=_[_0xbd67('0x38')](_0x5186eb[_0xbd67('0x33')],{'$or':_[_0xbd67('0x15')](_0x5a6b2d,function(_0x532c9b){if(_0x532c9b[_0xbd67('0x9')]!=='VIRTUAL'){if(_0x484989){return sequelize[_0xbd67('0x33')](sequelize['fn'](_0xbd67('0x39'),sequelize[_0xbd67('0x19')](_0x532c9b[_0xbd67('0x12')])),{'$like':sequelize['fn'](_0xbd67('0x39'),'%'+_0xb3f593[_0xbd67('0x2c')][_0xbd67('0x34')]+'%')});}else{var _0xfe170b={};_0xfe170b[_0x532c9b['name']]={'$like':'%'+_0xb3f593[_0xbd67('0x2c')][_0xbd67('0x34')]+'%'};return _0xfe170b;}}})});}_0x5186eb=_['merge']({},_0x5186eb,_0xb3f593[_0xbd67('0x3a')]);return _0x5186eb;};
\ No newline at end of file
+var _0x7da7=['attributes','length','nolimit','where','pick','filter','object','columns','value','merge','VIRTUAL','lower','options','lodash','sequelize','moment','parse','keys','includes','fields','split','forOwn','type','DATE','isPlainObject','$gte','YYYY-MM-DD','utc','format','$lte','subtract','name','uniqueid','limit','offset','sort','map','indexOf','priority','cast','unsigned','DESC','col','ASC','isEmpty','isArray','omit','isObject','isString','unset','hasOwnProperty','^[+]?[0-9]*$','isEmail','match','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','model','filters'];(function(_0x57ccab,_0x5db258){var _0x3b3471=function(_0x4e6fba){while(--_0x4e6fba){_0x57ccab['push'](_0x57ccab['shift']());}};_0x3b3471(++_0x5db258);}(_0x7da7,0x10d));var _0x77da=function(_0x145b3c,_0x31ea4a){_0x145b3c=_0x145b3c-0x0;var _0x1b6e36=_0x7da7[_0x145b3c];return _0x1b6e36;};'use strict';var _=require(_0x77da('0x0'));var sequelize=require(_0x77da('0x1'));var moment=require(_0x77da('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x571213){var _0x59892b=['ne'];try{var _0x37667b=JSON[_0x77da('0x3')](_0x571213);var _0x4f60c3=Object[_0x77da('0x4')](_0x37667b)[0x0];return _0x59892b[_0x77da('0x5')](_0x4f60c3);}catch(_0x56458c){return![];}}function getOperatorValue(_0x19331c){var _0xc54a12=JSON['parse'](_0x19331c);var _0x30afe0=Object['keys'](_0xc54a12)[0x0];var _0x1191de=_0xc54a12[_0x30afe0];return{['$'+_0x30afe0]:_0x1191de};}exports[_0x77da('0x6')]=function(_0x37c5ab){var _0x910e5b=null;if(_0x37c5ab){_0x910e5b=_0x37c5ab[_0x77da('0x7')](',');}return _0x910e5b;};exports['filters']=function(_0x40c86e,_0xb55827){var _0x172d7f={};if(!_['isEmpty'](_0x40c86e)){_[_0x77da('0x8')](_0x40c86e,function(_0x1ab717,_0x163350){try{if(_0xb55827){var _0x2a675a=_['find'](_0xb55827,{'name':_0x163350})||{};if(hasSequelizeOperator(_0x1ab717)){_0x172d7f[_0x163350]=getOperatorValue(_0x1ab717);}else if(_0x2a675a[_0x77da('0x9')]===_0x77da('0xa')&&_[_0x77da('0xb')](_0x1ab717)){var _0x5d6e2f=JSON['parse'](_0x1ab717);var _0x26e3ff={'$gte':moment(moment(_0x5d6e2f[_0x77da('0xc')])['format'](_0x77da('0xd')))[_0x77da('0xe')]()[_0x77da('0xf')](),'$lte':moment(moment(_0x5d6e2f[_0x77da('0x10')])['format'](_0x77da('0xd')))['utc']()[_0x77da('0x11')](0x1,'s')[_0x77da('0xf')]()};_0x172d7f[_0x163350]=_0x26e3ff;}else if(_0x2a675a[_0x77da('0x12')]===_0x77da('0x13')){_0x172d7f[_0x163350]=_0x1ab717;}else{_0x172d7f[_0x163350]=_['isArray'](_0x1ab717)?_0x1ab717:JSON['parse'](_0x1ab717);}}else{_0x172d7f[_0x163350]=_['isArray'](_0x1ab717)?_0x1ab717:JSON['parse'](_0x1ab717);}}catch(_0x103e46){_0x172d7f[_0x163350]=_0x1ab717[_0x77da('0x7')](',');}});}return _0x172d7f;};exports[_0x77da('0x14')]=function(_0x335dcb){_0x335dcb=parseInt(_0x335dcb,0xa);if(!_0x335dcb||_0x335dcb<0x0){_0x335dcb=LIMIT_VALUE;}return _0x335dcb;};exports[_0x77da('0x15')]=function(_0x12d2b1){_0x12d2b1=parseInt(_0x12d2b1,0xa);if(!_0x12d2b1||_0x12d2b1<0x0){_0x12d2b1=0x0;}return _0x12d2b1;};exports[_0x77da('0x16')]=function(_0x3b6dde){var _0x544104,_0x492063=null;if(_0x3b6dde){_0x544104=_0x3b6dde[_0x77da('0x7')](',');_0x492063=_[_0x77da('0x17')](_0x544104,function(_0x507979){if(_0x507979[_0x77da('0x18')]('-')===0x0){return[_0x507979===_0x77da('0x19')?sequelize[_0x77da('0x1a')](sequelize['col']('priority'),_0x77da('0x1b')):_0x507979['substr'](0x1),_0x77da('0x1c')];}else{return[_0x507979===_0x77da('0x19')?sequelize[_0x77da('0x1a')](sequelize[_0x77da('0x1d')](_0x77da('0x19')),_0x77da('0x1b')):_0x507979,_0x77da('0x1e')];}});}return _0x492063;};exports['omit']=function(_0x4885ec,_0xfd160){if(_[_0x77da('0x1f')](_0x4885ec)){return _0x4885ec;}if(_[_0x77da('0x20')](_0x4885ec)){for(var _0xbd06b7=0x0;_0xbd06b7<_0x4885ec['length'];_0xbd06b7+=0x1){_0x4885ec[_0xbd06b7]=this[_0x77da('0x21')](_0x4885ec[_0xbd06b7],_0xfd160);}return _0x4885ec;}if(!_[_0x77da('0x22')](_0x4885ec)){return _0x4885ec;}if(_[_0x77da('0x23')](_0xfd160)){_0xfd160=[_0xfd160];}if(!_[_0x77da('0x20')](_0xfd160)){return _0x4885ec;}for(var _0x446ae7=0x0;_0x446ae7<_0xfd160['length'];_0x446ae7+=0x1){_[_0x77da('0x24')](_0x4885ec,_0xfd160[_0x446ae7]);}for(var _0x3e090d in _0x4885ec){if(_0x4885ec[_0x77da('0x25')](_0x3e090d)){_0x4885ec[_0x3e090d]=this[_0x77da('0x21')](_0x4885ec[_0x3e090d],_0xfd160);}}return _0x4885ec;};exports['isNumeric']=function(_0x5b4638){return _0x5b4638['match'](RegExp(_0x77da('0x26')))?!![]:![];};exports[_0x77da('0x27')]=function(_0x410d09){return _0x410d09[_0x77da('0x28')](/^\S+@\S+$/)?!![]:![];};exports[_0x77da('0x29')]=function(_0x4eeb99){var _0x350b4e=[];_0x4eeb99[_0x77da('0x7')](/[ ,]+/)[_0x77da('0x2a')](function(_0x1d381b){_0x1d381b=_0x1d381b[_0x77da('0x2b')](/([^:]")"+/g,'$1');_0x1d381b='+'+_0x1d381b+'*';var _0x46e6b4=/[ `!@#$%^&*()_\-?~]/;if(_0x1d381b['match'](_0x46e6b4))_0x1d381b='\x22'+_0x1d381b+'\x22';_0x350b4e[_0x77da('0x2c')](_0x1d381b);});return _0x350b4e[_0x77da('0x2d')]('\x20');};exports[_0x77da('0x2e')]=function(_0x38643a,_0x3c3c64,_0x12ea16){var _0x3343b4={},_0x2c790d={};if(_0x3c3c64['query']['$id']){_0x3c3c64[_0x77da('0x2f')]['id']=_0x3c3c64[_0x77da('0x2f')]['$id'];delete _0x3c3c64[_0x77da('0x2f')][_0x77da('0x30')];}_0x3343b4[_0x77da('0x31')]=_[_0x77da('0x17')](_0x38643a,_0x77da('0x12'));_0x3343b4[_0x77da('0x2f')]=_[_0x77da('0x4')](_0x3c3c64['query']);_0x3343b4[_0x77da('0x32')]=_['intersection'](_0x3343b4['model'],_0x3343b4['query']);_0x2c790d[_0x77da('0x33')]=_['intersection'](_0x3343b4[_0x77da('0x31')],this[_0x77da('0x6')](_0x3c3c64[_0x77da('0x2f')][_0x77da('0x6')]));_0x2c790d[_0x77da('0x33')]=_0x2c790d[_0x77da('0x33')][_0x77da('0x34')]?_0x2c790d['attributes']:_0x3343b4[_0x77da('0x31')];if(!_0x3c3c64[_0x77da('0x2f')][_0x77da('0x25')](_0x77da('0x35'))){_0x2c790d[_0x77da('0x14')]=this[_0x77da('0x14')](_0x3c3c64['query'][_0x77da('0x14')]);_0x2c790d[_0x77da('0x15')]=this[_0x77da('0x15')](_0x3c3c64['query'][_0x77da('0x15')]);}_0x2c790d['order']=this['sort'](_0x3c3c64['query']['sort']);_0x2c790d[_0x77da('0x36')]=this[_0x77da('0x32')](_[_0x77da('0x37')](_0x3c3c64['query'],_0x3343b4[_0x77da('0x32')]),_0x38643a);if(_0x3c3c64['query'][_0x77da('0x38')]){var _0x517bd0=_0x38643a;var _0x3c216f=_0x3c3c64[_0x77da('0x2f')][_0x77da('0x38')];if(typeof _0x3c216f===_0x77da('0x39')){_0x517bd0=_[_0x77da('0x38')](_0x38643a,function(_0x5ecf12){return _[_0x77da('0x5')](_0x3c216f[_0x77da('0x3a')],_0x5ecf12[_0x77da('0x12')]);});_0x3c216f=_0x3c216f[_0x77da('0x3b')];}_0x2c790d[_0x77da('0x36')]=_[_0x77da('0x3c')](_0x2c790d['where'],{'$or':_[_0x77da('0x17')](_0x517bd0,function(_0x2f0495){if(_0x2f0495[_0x77da('0x9')]!==_0x77da('0x3d')){if(_0x12ea16){return sequelize[_0x77da('0x36')](sequelize['fn'](_0x77da('0x3e'),sequelize['col'](_0x2f0495[_0x77da('0x12')])),{'$like':sequelize['fn']('lower','%'+_0x3c3c64[_0x77da('0x2f')][_0x77da('0x38')]+'%')});}else{var _0x40a492={};_0x40a492[_0x2f0495['name']]={'$like':'%'+_0x3c3c64[_0x77da('0x2f')][_0x77da('0x38')]+'%'};return _0x40a492;}}})});}_0x2c790d=_[_0x77da('0x3c')]({},_0x2c790d,_0x3c3c64[_0x77da('0x3f')]);return _0x2c790d;};
\ No newline at end of file
index 5069183..2b028fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0d4=['indexOf','validateSortParameter','sort','toLowerCase','userpic','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','openchannelStatus','whatsappStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','filterAgentAttributes','lodash','../../mysqldb','client','http','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','pause','chatStatus','faxStatus','mailStatus','smsStatus','request','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','*pause','busy','getAgentStatus','isArray','Queue','map','getAgents','all','flatten','uniq','value','getAgentIdsByQueues','resolve','includes','User','fullname','chatPause','pauseType','find','globalStatus','getSortedAgentsIdsByStatus','split','fields','order','startsWith','DESC','ASC','internal'];(function(_0x33a476,_0x52c445){var _0x158a2f=function(_0x8aa5c5){while(--_0x8aa5c5){_0x33a476['push'](_0x33a476['shift']());}};_0x158a2f(++_0x52c445);}(_0xf0d4,0x146));var _0x4f0d=function(_0xe2bb9e,_0x2629a9){_0xe2bb9e=_0xe2bb9e-0x0;var _0x43ba10=_0xf0d4[_0xe2bb9e];return _0x43ba10;};'use strict';var _=require(_0x4f0d('0x0'));var jayson=require('jayson/promise');var db=require(_0x4f0d('0x1'))['db'];var amiClient=jayson[_0x4f0d('0x2')]['http']({'port':0x232a});var routingClient=jayson['client'][_0x4f0d('0x3')]({'port':0x232c});function isAgentPaused(_0x16fa3a,_0x189296){var _0x3c99aa=[_0x16fa3a['chatPause'],_0x16fa3a[_0x4f0d('0x4')],_0x16fa3a[_0x4f0d('0x5')],_0x16fa3a[_0x4f0d('0x6')],_0x16fa3a[_0x4f0d('0x7')],_0x16fa3a[_0x4f0d('0x8')],_0x16fa3a[_0x4f0d('0x9')]];if(!_0x189296)return _[_0x4f0d('0xa')](_0x3c99aa);var _0x3e5a08=_[_0x4f0d('0xb')](_0x3c99aa);return _0x3e5a08[_0x4f0d('0xc')]>0x0&&_0x3e5a08['length']<_0x3c99aa[_0x4f0d('0xc')]?!![]:![];}function isIdle(_0xe2f214){return _0xe2f214===_0x4f0d('0xd')||_0xe2f214===_0x4f0d('0xe')||_0xe2f214===_0x4f0d('0xf')||_0xe2f214===_0x4f0d('0x10')||_[_0x4f0d('0x11')](_0xe2f214);}function isAgentIdle(_0x4ce8b6){if(_0x4ce8b6['voiceStatus']!==_0x4f0d('0xd')&&_0x4ce8b6[_0x4f0d('0x8')]){_0x4ce8b6[_0x4f0d('0x12')]=_0x4f0d('0x13');return![];}return _[_0x4f0d('0xa')]([_0x4ce8b6[_0x4f0d('0x14')],_0x4ce8b6[_0x4f0d('0x15')],_0x4ce8b6[_0x4f0d('0x16')],_0x4ce8b6['openchannelStatus'],_0x4ce8b6[_0x4f0d('0x17')],_0x4ce8b6['voiceStatus'],_0x4ce8b6['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient[_0x4f0d('0x18')]('Agents',{})[_0x4f0d('0x19')](function(_0x243ab6){if(_0x243ab6[_0x4f0d('0x1a')]){throw new Error(_0x4f0d('0x1b'));}var _0x555d9a=_0x243ab6[_0x4f0d('0x1c')];return routingClient[_0x4f0d('0x18')](_0x4f0d('0x1d'),{})[_0x4f0d('0x19')](function(_0x2bac08){if(_0x2bac08['error']){throw new Error(_0x4f0d('0x1e'));}var _0xe090d3=_0x2bac08['result'];return _[_0x4f0d('0x1f')]({},_0x555d9a,_0xe090d3);});})[_0x4f0d('0x20')](function(_0x38df9e){throw _0x38df9e;});}exports[_0x4f0d('0x21')]=getRealtimeAgents;function getAgentStatus(_0xf7909d){var _0xda5f5d='unknown';if(isAgentPaused(_0xf7909d))_0xda5f5d=_0x4f0d('0x13');else if(isAgentPaused(_0xf7909d,!![]))_0xda5f5d=_0x4f0d('0x22');else if(isAgentIdle(_0xf7909d))_0xda5f5d=_0x4f0d('0xd');else _0xda5f5d=_0x4f0d('0x23');return _0xda5f5d;}exports[_0x4f0d('0x24')]=getAgentStatus;function getAgentIdsByQueues(_0x4e1e64,_0x25d961){var _0x520095=_[_0x4f0d('0x25')](_0x4e1e64)?_0x4e1e64:[_0x4e1e64];var _0x5158bb=_['startCase'](_0x25d961)+_0x4f0d('0x26');var _0xf8d632=_[_0x4f0d('0x27')](_0x520095,function(_0x35b529){return db[_0x5158bb]['findOne']({'where':{'id':_0x35b529}})[_0x4f0d('0x19')](function(_0x2cddf5){if(!_0x2cddf5)return[];return _0x2cddf5[_0x4f0d('0x28')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x4f0d('0x29')](_0xf8d632)['then'](function(_0x2bf176){var _0x338130=_(_0x2bf176)[_0x4f0d('0x2a')]()[_0x4f0d('0x27')]('id')[_0x4f0d('0x2b')]()[_0x4f0d('0x2c')]();return _0x338130;});}exports[_0x4f0d('0x2d')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x28a167,_0x424918,_0x2e28b9){try{if(_0x424918['length']>0x0){_0x28a167=_0x28a167[_0x4f0d('0xb')](function(_0x573ff6){return _0x424918['includes'](_0x573ff6['id']);});}var _0x39eb79=_0x28a167['filter'](function(_0x2cda39){var _0x4429d7=_0x4f0d('0x23');if(isAgentIdle(_0x2cda39)){_0x4429d7=_0x4f0d('0xd');}return _0x4429d7===_0x2e28b9;});return _[_0x4f0d('0x27')](_0x39eb79,'id');}catch(_0xf3f0a){throw _0xf3f0a;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x32f9da,_0x2168cc,_0x3ed5f0){return Promise[_0x4f0d('0x2e')]()[_0x4f0d('0x19')](function(){if(_0x2168cc[_0x4f0d('0xc')]>0x0){_0x32f9da=_0x32f9da[_0x4f0d('0xb')](function(_0x3ff3d3){return _0x2168cc[_0x4f0d('0x2f')](_0x3ff3d3['id']);});}return _0x32f9da;})['then'](function(){return db[_0x4f0d('0x30')]['findAll']({'attributes':['id','name',_0x4f0d('0x31'),_0x4f0d('0x32'),'faxPause',_0x4f0d('0x5'),_0x4f0d('0x6'),_0x4f0d('0x7'),'voicePause',_0x4f0d('0x9'),_0x4f0d('0x33')],'where':{'id':{'$in':_[_0x4f0d('0x27')](_0x32f9da,'id')}},'raw':!![]});})[_0x4f0d('0x19')](function(_0x3bc791){return _0x3bc791[_0x4f0d('0x27')](function(_0x40c6aa){var _0x1e9abc=_[_0x4f0d('0x34')](_0x32f9da,['id',_0x40c6aa['id']]);var _0x38c2b2=filterAgentAttributes(_0x1e9abc);_[_0x4f0d('0x1f')](_0x40c6aa,_0x38c2b2);_0x40c6aa[_0x4f0d('0x35')]=getAgentStatus(_0x40c6aa);return _0x40c6aa;});})['then'](function(_0x414814){var _0x35149c=sortAgentsByStatus(_0x414814,_0x3ed5f0);return _[_0x4f0d('0x27')](_0x35149c,'id');})[_0x4f0d('0x20')](function(_0x478201){throw _0x478201;});}exports[_0x4f0d('0x36')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x47ac18){var _0x2b40fd={'fields':[],'order':null};var _0x416978=_0x47ac18[_0x4f0d('0x37')](',');_0x2b40fd[_0x4f0d('0x38')]=_[_0x4f0d('0xb')](_0x416978,function(_0x3957ca){if(!_0x3957ca[_0x4f0d('0x2f')](_0x4f0d('0x35'))){return!![];}_0x2b40fd[_0x4f0d('0x39')]=_[_0x4f0d('0x3a')](_0x3957ca,'-')?_0x4f0d('0x3b'):_0x4f0d('0x3c');return![];});return _0x2b40fd;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x418ff4){if(_0x418ff4[_0x4f0d('0x2f')]('fullname')&&!_0x418ff4[_0x4f0d('0x2f')](_0x4f0d('0x3d'))){var _0x1370e2=_0x418ff4['substring'](0x0,_0x418ff4[_0x4f0d('0x3e')](_0x4f0d('0x31')));_0x418ff4+=','+_0x1370e2+_0x4f0d('0x3d');}return _0x418ff4;}exports[_0x4f0d('0x3f')]=validateSortParameter;function sortAgentsByStatus(_0x28357b,_0x3d1e04){var _0x17405d=_0x28357b[_0x4f0d('0x40')](function(_0x21c7ce,_0x3f4a1e){if(_0x21c7ce[_0x4f0d('0x35')]===_0x3f4a1e[_0x4f0d('0x35')]){if(_0x21c7ce[_0x4f0d('0x35')]===_0x4f0d('0x13')){if(_0x3d1e04===_0x4f0d('0x3b')){return(_0x21c7ce[_0x4f0d('0x33')]||'')<(_0x3f4a1e[_0x4f0d('0x33')]||'')||_0x21c7ce['fullname']['toLowerCase']()>_0x3f4a1e['fullname'][_0x4f0d('0x41')]()?0x1:-0x1;}else{return(_0x21c7ce[_0x4f0d('0x33')]||'')<(_0x3f4a1e[_0x4f0d('0x33')]||'')||_0x21c7ce[_0x4f0d('0x31')]['toLowerCase']()>_0x3f4a1e[_0x4f0d('0x31')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x3d1e04==='DESC'){return _0x21c7ce[_0x4f0d('0x31')][_0x4f0d('0x41')]()<_0x3f4a1e[_0x4f0d('0x31')]['toLowerCase']()?0x1:-0x1;}else{return _0x21c7ce[_0x4f0d('0x31')]['toLowerCase']()<_0x3f4a1e[_0x4f0d('0x31')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x3d1e04===_0x4f0d('0x3b')){return _0x21c7ce[_0x4f0d('0x35')]<_0x3f4a1e[_0x4f0d('0x35')]?0x1:-0x1;}else{return _0x21c7ce[_0x4f0d('0x35')]<_0x3f4a1e[_0x4f0d('0x35')]?-0x1:0x1;}}});return _0x17405d;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x105869){var _0x57dce3=[_0x4f0d('0x42'),'online','lastLoginAt',_0x4f0d('0x43'),_0x4f0d('0x33'),_0x4f0d('0x43'),_0x4f0d('0x3d'),_0x4f0d('0x44'),'chatPause',_0x4f0d('0x6'),_0x4f0d('0x5'),_0x4f0d('0x7'),_0x4f0d('0x9'),'faxPause',_0x4f0d('0x8'),_0x4f0d('0x45'),_0x4f0d('0x46'),_0x4f0d('0x47'),_0x4f0d('0x48'),_0x4f0d('0x49'),'faxCapacity',_0x4f0d('0x4a'),_0x4f0d('0x4b'),_0x4f0d('0x4c'),_0x4f0d('0x4d'),'whatsappCurrentCapacity',_0x4f0d('0x4e'),_0x4f0d('0x14'),_0x4f0d('0x4f'),_0x4f0d('0x16'),'smsStatus',_0x4f0d('0x50'),_0x4f0d('0x15'),_0x4f0d('0x12'),_0x4f0d('0x51'),_0x4f0d('0x52'),_0x4f0d('0x53'),_0x4f0d('0x54'),_0x4f0d('0x55'),_0x4f0d('0x56'),_0x4f0d('0x57'),_0x4f0d('0x58'),_0x4f0d('0x59'),_0x4f0d('0x5a'),_0x4f0d('0x5b'),_0x4f0d('0x5c'),_0x4f0d('0x5d')];var _0x4f231=[_0x4f0d('0x32'),'openchannelPause',_0x4f0d('0x5'),'smsPause',_0x4f0d('0x9'),_0x4f0d('0x4'),_0x4f0d('0x8'),'online'];var _0x15e227=_(_0x105869)[_0x4f0d('0x5e')](_0x4f231)[_0x4f0d('0x5f')](_0x57dce3)['value']();return _0x15e227;}exports[_0x4f0d('0x60')]=filterAgentAttributes;
\ No newline at end of file
+var _0x908d=['mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','filterAgentAttributes','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','whatsappPause','every','filter','length','idle','unknown','unavailable','ringing','isNil','voicePause','pause','faxStatus','mailStatus','openchannelStatus','voiceStatus','then','error','result','request','isArray','startCase','Queue','map','findOne','all','flatten','uniq','value','getAgentIdsByQueues','busy','getAgentIdsByStatus','resolve','includes','findAll','name','fullname','pauseType','merge','globalStatus','catch','getSortedAgentsIdsByStatus','split','fields','order','ASC','internal','indexOf','validateSortParameter','sort','DESC','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','faxCapacity','chatCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','smsStatus','chatStatusTime','openchannelStatusTime'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x908d,0x1ce));var _0xd908=function(_0x222077,_0x7b71d7){_0x222077=_0x222077-0x0;var _0x4b5b7c=_0x908d[_0x222077];return _0x4b5b7c;};'use strict';var _=require('lodash');var jayson=require(_0xd908('0x0'));var db=require(_0xd908('0x1'))['db'];var amiClient=jayson[_0xd908('0x2')][_0xd908('0x3')]({'port':0x232a});var routingClient=jayson[_0xd908('0x2')][_0xd908('0x3')]({'port':0x232c});function isAgentPaused(_0x248968,_0x34ade6){var _0x2402ac=[_0x248968[_0xd908('0x4')],_0x248968[_0xd908('0x5')],_0x248968[_0xd908('0x6')],_0x248968[_0xd908('0x7')],_0x248968[_0xd908('0x8')],_0x248968['voicePause'],_0x248968[_0xd908('0x9')]];if(!_0x34ade6)return _[_0xd908('0xa')](_0x2402ac);var _0x51ab47=_[_0xd908('0xb')](_0x2402ac);return _0x51ab47['length']>0x0&&_0x51ab47['length']<_0x2402ac[_0xd908('0xc')]?!![]:![];}function isIdle(_0x54faaa){return _0x54faaa===_0xd908('0xd')||_0x54faaa===_0xd908('0xe')||_0x54faaa===_0xd908('0xf')||_0x54faaa===_0xd908('0x10')||_[_0xd908('0x11')](_0x54faaa);}function isAgentIdle(_0x1c933d){if(_0x1c933d['voiceStatus']!==_0xd908('0xd')&&_0x1c933d[_0xd908('0x12')]){_0x1c933d['voiceStatus']=_0xd908('0x13');return![];}return _[_0xd908('0xa')]([_0x1c933d['chatStatus'],_0x1c933d[_0xd908('0x14')],_0x1c933d[_0xd908('0x15')],_0x1c933d[_0xd908('0x16')],_0x1c933d['smsStatus'],_0x1c933d[_0xd908('0x17')],_0x1c933d['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient['request']('Agents',{})[_0xd908('0x18')](function(_0x52bf3b){if(_0x52bf3b[_0xd908('0x19')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x52a598=_0x52bf3b[_0xd908('0x1a')];return routingClient[_0xd908('0x1b')]('Agents',{})['then'](function(_0x68b872){if(_0x68b872[_0xd908('0x19')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x20a4ef=_0x68b872['result'];return _['merge']({},_0x52a598,_0x20a4ef);});})['catch'](function(_0x58bfa3){throw _0x58bfa3;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x4079bb){var _0x47bc8a=_0xd908('0xe');if(isAgentPaused(_0x4079bb))_0x47bc8a='pause';else if(isAgentPaused(_0x4079bb,!![]))_0x47bc8a='*pause';else if(isAgentIdle(_0x4079bb))_0x47bc8a=_0xd908('0xd');else _0x47bc8a='busy';return _0x47bc8a;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x5c5446,_0x34b22d){var _0x279c87=_[_0xd908('0x1c')](_0x5c5446)?_0x5c5446:[_0x5c5446];var _0x11dcaa=_[_0xd908('0x1d')](_0x34b22d)+_0xd908('0x1e');var _0x37641b=_[_0xd908('0x1f')](_0x279c87,function(_0x1e09ad){return db[_0x11dcaa][_0xd908('0x20')]({'where':{'id':_0x1e09ad}})[_0xd908('0x18')](function(_0x5f53fe){if(!_0x5f53fe)return[];return _0x5f53fe['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0xd908('0x21')](_0x37641b)[_0xd908('0x18')](function(_0x3c59ff){var _0x30e80b=_(_0x3c59ff)[_0xd908('0x22')]()[_0xd908('0x1f')]('id')[_0xd908('0x23')]()[_0xd908('0x24')]();return _0x30e80b;});}exports[_0xd908('0x25')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x259d89,_0x2bbf1d,_0xcc1e9f){try{if(_0x2bbf1d[_0xd908('0xc')]>0x0){_0x259d89=_0x259d89['filter'](function(_0x252e57){return _0x2bbf1d['includes'](_0x252e57['id']);});}var _0x3e981c=_0x259d89[_0xd908('0xb')](function(_0x589a01){var _0x2c0a8f=_0xd908('0x26');if(isAgentIdle(_0x589a01)){_0x2c0a8f=_0xd908('0xd');}return _0x2c0a8f===_0xcc1e9f;});return _[_0xd908('0x1f')](_0x3e981c,'id');}catch(_0x578e95){throw _0x578e95;}}exports[_0xd908('0x27')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x39e636,_0x3fb00e,_0x4e61b2){return Promise[_0xd908('0x28')]()[_0xd908('0x18')](function(){if(_0x3fb00e['length']>0x0){_0x39e636=_0x39e636[_0xd908('0xb')](function(_0x5c0c1f){return _0x3fb00e[_0xd908('0x29')](_0x5c0c1f['id']);});}return _0x39e636;})[_0xd908('0x18')](function(){return db['User'][_0xd908('0x2a')]({'attributes':['id',_0xd908('0x2b'),_0xd908('0x2c'),'chatPause','faxPause','mailPause','openchannelPause',_0xd908('0x8'),'voicePause',_0xd908('0x9'),_0xd908('0x2d')],'where':{'id':{'$in':_[_0xd908('0x1f')](_0x39e636,'id')}},'raw':!![]});})[_0xd908('0x18')](function(_0x184783){return _0x184783['map'](function(_0x267f4a){var _0x2a61f4=_['find'](_0x39e636,['id',_0x267f4a['id']]);var _0x3cf212=filterAgentAttributes(_0x2a61f4);_[_0xd908('0x2e')](_0x267f4a,_0x3cf212);_0x267f4a[_0xd908('0x2f')]=getAgentStatus(_0x267f4a);return _0x267f4a;});})[_0xd908('0x18')](function(_0x44f8c0){var _0x20ccdd=sortAgentsByStatus(_0x44f8c0,_0x4e61b2);return _[_0xd908('0x1f')](_0x20ccdd,'id');})[_0xd908('0x30')](function(_0x1e9a69){throw _0x1e9a69;});}exports[_0xd908('0x31')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x17c400){var _0x151353={'fields':[],'order':null};var _0x4f23ae=_0x17c400[_0xd908('0x32')](',');_0x151353[_0xd908('0x33')]=_[_0xd908('0xb')](_0x4f23ae,function(_0x4b6336){if(!_0x4b6336[_0xd908('0x29')](_0xd908('0x2f'))){return!![];}_0x151353[_0xd908('0x34')]=_['startsWith'](_0x4b6336,'-')?'DESC':_0xd908('0x35');return![];});return _0x151353;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x3db8a9){if(_0x3db8a9[_0xd908('0x29')]('fullname')&&!_0x3db8a9['includes'](_0xd908('0x36'))){var _0x35c043=_0x3db8a9['substring'](0x0,_0x3db8a9[_0xd908('0x37')](_0xd908('0x2c')));_0x3db8a9+=','+_0x35c043+_0xd908('0x36');}return _0x3db8a9;}exports[_0xd908('0x38')]=validateSortParameter;function sortAgentsByStatus(_0x40f56c,_0x37b35e){var _0x49eaa3=_0x40f56c[_0xd908('0x39')](function(_0x1adead,_0x1a5d5b){if(_0x1adead['globalStatus']===_0x1a5d5b['globalStatus']){if(_0x1adead['globalStatus']===_0xd908('0x13')){if(_0x37b35e===_0xd908('0x3a')){return(_0x1adead[_0xd908('0x2d')]||'')<(_0x1a5d5b[_0xd908('0x2d')]||'')||_0x1adead[_0xd908('0x2c')][_0xd908('0x3b')]()>_0x1a5d5b['fullname'][_0xd908('0x3b')]()?0x1:-0x1;}else{return(_0x1adead['pauseType']||'')<(_0x1a5d5b[_0xd908('0x2d')]||'')||_0x1adead['fullname']['toLowerCase']()>_0x1a5d5b[_0xd908('0x2c')][_0xd908('0x3b')]()?-0x1:0x1;}}else{if(_0x37b35e===_0xd908('0x3a')){return _0x1adead[_0xd908('0x2c')]['toLowerCase']()<_0x1a5d5b[_0xd908('0x2c')][_0xd908('0x3b')]()?0x1:-0x1;}else{return _0x1adead[_0xd908('0x2c')]['toLowerCase']()<_0x1a5d5b['fullname'][_0xd908('0x3b')]()?-0x1:0x1;}}}else{if(_0x37b35e==='DESC'){return _0x1adead['globalStatus']<_0x1a5d5b[_0xd908('0x2f')]?0x1:-0x1;}else{return _0x1adead[_0xd908('0x2f')]<_0x1a5d5b['globalStatus']?-0x1:0x1;}}});return _0x49eaa3;}exports[_0xd908('0x3c')]=sortAgentsByStatus;function filterAgentAttributes(_0x568f8d){var _0x370cd7=[_0xd908('0x3d'),_0xd908('0x3e'),_0xd908('0x3f'),_0xd908('0x40'),_0xd908('0x2d'),_0xd908('0x40'),'internal',_0xd908('0x41'),_0xd908('0x4'),_0xd908('0x7'),_0xd908('0x6'),'smsPause',_0xd908('0x9'),_0xd908('0x5'),_0xd908('0x12'),_0xd908('0x42'),_0xd908('0x43'),_0xd908('0x44'),'smsCapacity','whatsappCapacity',_0xd908('0x45'),_0xd908('0x46'),'openchannelCurrentCapacity',_0xd908('0x47'),_0xd908('0x48'),_0xd908('0x49'),_0xd908('0x4a'),'chatStatus',_0xd908('0x16'),_0xd908('0x15'),_0xd908('0x4b'),'whatsappStatus',_0xd908('0x14'),_0xd908('0x17'),_0xd908('0x4c'),_0xd908('0x4d'),_0xd908('0x4e'),_0xd908('0x4f'),_0xd908('0x50'),_0xd908('0x51'),_0xd908('0x52'),'queue',_0xd908('0x53'),_0xd908('0x54'),_0xd908('0x55'),_0xd908('0x56'),_0xd908('0x57')];var _0x5520d1=[_0xd908('0x4'),_0xd908('0x7'),_0xd908('0x6'),'smsPause',_0xd908('0x9'),_0xd908('0x5'),'voicePause',_0xd908('0x3e')];var _0x280411=_(_0x568f8d)[_0xd908('0x58')](_0x5520d1)['pick'](_0x370cd7)['value']();return _0x280411;}exports[_0xd908('0x59')]=filterAgentAttributes;
\ No newline at end of file
index 279ead8..54d6e8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xceee=['format','result','catch','getRealtimeQueues','voice','outbound','get','paused','loggedInDb','available','waiting','talking','find','merge','initializeQueues','lodash','jayson/promise','util','client','http','loggedIn','busy','onHold','ringInUse','unknown','pTalking','originated','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','request','startCase','Queues','error'];(function(_0x5c1b59,_0x19f4b4){var _0xaff792=function(_0x1e998f){while(--_0x1e998f){_0x5c1b59['push'](_0x5c1b59['shift']());}};_0xaff792(++_0x19f4b4);}(_0xceee,0x1ef));var _0xecee=function(_0x692aa4,_0x38bca4){_0x692aa4=_0x692aa4-0x0;var _0x1b5947=_0xceee[_0x692aa4];return _0x1b5947;};'use strict';var _=require(_0xecee('0x0'));var jayson=require(_0xecee('0x1'));var util=require(_0xecee('0x2'));var amiClient=jayson[_0xecee('0x3')][_0xecee('0x4')]({'port':0x232a});var routingClient=jayson[_0xecee('0x3')][_0xecee('0x4')]({'port':0x232c});var QUEUE_DEFAULT_ATTRIBUTES=['available',_0xecee('0x5'),'paused','waiting'];var INBOUND_VOICE_QUEUE_ATTRIBUTES=[_0xecee('0x6'),'inUse','invalid','loggedInDb','notInUse',_0xecee('0x7'),'ringing',_0xecee('0x8'),'talking','unavailable',_0xecee('0x9')];var OUTBOUND_VOICE_QUEUE_ATTRIBUTES=[_0xecee('0xa'),_0xecee('0xb'),'message',_0xecee('0xc'),_0xecee('0xd'),_0xecee('0xe'),_0xecee('0xf'),_0xecee('0x10'),_0xecee('0x11'),_0xecee('0x12'),_0xecee('0x13'),_0xecee('0x14'),_0xecee('0x15'),_0xecee('0x16'),_0xecee('0x17'),_0xecee('0x18'),_0xecee('0x19'),_0xecee('0x1a'),'predictiveIntervalDroppedCallsTimeout',_0xecee('0x1b'),'predictiveIntervalAvgHoldtime',_0xecee('0x1c')];function getRealtimeQueues(_0x13386b,_0x39ff62){var _0x17309a=_0x39ff62==='voice'?amiClient:routingClient;return _0x17309a[_0xecee('0x1d')](_[_0xecee('0x1e')](_0x39ff62)+_0xecee('0x1f'),_0x13386b)['then'](function(_0x2f68f6){if(_0x2f68f6[_0xecee('0x20')])throw new Error(util[_0xecee('0x21')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x39ff62));return _0x2f68f6[_0xecee('0x22')];})[_0xecee('0x23')](function(_0x2d53b0){throw _0x2d53b0;});}exports[_0xecee('0x24')]=getRealtimeQueues;function initializeQueues(_0x5a4065,_0x381b8d,_0x9957e2,_0x2f7308){var _0x3dd8af=QUEUE_DEFAULT_ATTRIBUTES;if(_0x9957e2===_0xecee('0x25')){if(_0x2f7308===_0xecee('0x26')){_0x3dd8af=_0x3dd8af['concat'](OUTBOUND_VOICE_QUEUE_ATTRIBUTES);}else{_0x3dd8af=_0x3dd8af['concat'](INBOUND_VOICE_QUEUE_ATTRIBUTES);}}return _0x5a4065['map'](function(_0x271878){var _0x49384d=_0x271878[_0xecee('0x27')]({'plain':!![]});_0x49384d[_0xecee('0x28')]=0x0;_0x49384d[_0xecee('0x29')]=0x0;_0x49384d[_0xecee('0x5')]=0x0;_0x49384d[_0xecee('0x2a')]=0x0;_0x49384d[_0xecee('0x2b')]=0x0;if(_0x9957e2==='voice'){_0x49384d[_0xecee('0x2c')]=0x0;_0x49384d[_0xecee('0x6')]=0x0;if(_0x2f7308===_0xecee('0x26')){_0x49384d[_0xecee('0xa')]=0x0;_0x49384d[_0xecee('0xb')]=0x0;}}var _0x5548f1=_[_0xecee('0x2d')](_0x381b8d,['id',_0x49384d['id']]);if(_0x5548f1){_[_0xecee('0x2e')](_0x49384d,_['pick'](_0x5548f1,_0x3dd8af));}return _0x49384d;});}exports[_0xecee('0x2f')]=initializeQueues;
\ No newline at end of file
+var _0x0b07=['dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase','Queues','then','error','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','outbound','concat','map','get','pTalking','find','pick','initializeQueues','lodash','client','http','available','loggedIn','paused','busy','inUse','invalid','loggedInDb','notInUse','onHold','ringInUse','talking','unknown','originated','message','dialMethod','Trunk','startProgressive','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold'];(function(_0x7c1a77,_0x1cefe3){var _0x3496d7=function(_0x306bb5){while(--_0x306bb5){_0x7c1a77['push'](_0x7c1a77['shift']());}};_0x3496d7(++_0x1cefe3);}(_0x0b07,0x7d));var _0x70b0=function(_0x3358ba,_0x24c5fc){_0x3358ba=_0x3358ba-0x0;var _0x296e73=_0x0b07[_0x3358ba];return _0x296e73;};'use strict';var _=require(_0x70b0('0x0'));var jayson=require('jayson/promise');var util=require('util');var amiClient=jayson[_0x70b0('0x1')][_0x70b0('0x2')]({'port':0x232a});var routingClient=jayson['client'][_0x70b0('0x2')]({'port':0x232c});var QUEUE_DEFAULT_ATTRIBUTES=[_0x70b0('0x3'),_0x70b0('0x4'),_0x70b0('0x5'),'waiting'];var INBOUND_VOICE_QUEUE_ATTRIBUTES=[_0x70b0('0x6'),_0x70b0('0x7'),_0x70b0('0x8'),_0x70b0('0x9'),_0x70b0('0xa'),_0x70b0('0xb'),'ringing',_0x70b0('0xc'),_0x70b0('0xd'),'unavailable',_0x70b0('0xe')];var OUTBOUND_VOICE_QUEUE_ATTRIBUTES=['pTalking',_0x70b0('0xf'),_0x70b0('0x10'),'dialActive',_0x70b0('0x11'),_0x70b0('0x12'),'startPredictive',_0x70b0('0x13'),_0x70b0('0x14'),'erlangCallToSecond',_0x70b0('0x15'),_0x70b0('0x16'),_0x70b0('0x17'),_0x70b0('0x18'),_0x70b0('0x19'),'predictiveIntervalAvailable',_0x70b0('0x1a'),_0x70b0('0x1b'),_0x70b0('0x1c'),_0x70b0('0x1d'),_0x70b0('0x1e'),_0x70b0('0x1f')];function getRealtimeQueues(_0x3a54c4,_0x101410){var _0x2f69e0=_0x101410===_0x70b0('0x20')?amiClient:routingClient;return _0x2f69e0[_0x70b0('0x21')](_[_0x70b0('0x22')](_0x101410)+_0x70b0('0x23'),_0x3a54c4)[_0x70b0('0x24')](function(_0x1181a4){if(_0x1181a4[_0x70b0('0x25')])throw new Error(util['format'](_0x70b0('0x26'),_0x101410));return _0x1181a4[_0x70b0('0x27')];})[_0x70b0('0x28')](function(_0x57f8b8){throw _0x57f8b8;});}exports[_0x70b0('0x29')]=getRealtimeQueues;function initializeQueues(_0x111d53,_0x4dbd9d,_0x1b2514,_0x241d85){var _0x45f6a3=QUEUE_DEFAULT_ATTRIBUTES;if(_0x1b2514===_0x70b0('0x20')){if(_0x241d85===_0x70b0('0x2a')){_0x45f6a3=_0x45f6a3[_0x70b0('0x2b')](OUTBOUND_VOICE_QUEUE_ATTRIBUTES);}else{_0x45f6a3=_0x45f6a3[_0x70b0('0x2b')](INBOUND_VOICE_QUEUE_ATTRIBUTES);}}return _0x111d53[_0x70b0('0x2c')](function(_0x4a8711){var _0x25e4ac=_0x4a8711[_0x70b0('0x2d')]({'plain':!![]});_0x25e4ac[_0x70b0('0x5')]=0x0;_0x25e4ac[_0x70b0('0x9')]=0x0;_0x25e4ac[_0x70b0('0x4')]=0x0;_0x25e4ac['available']=0x0;_0x25e4ac['waiting']=0x0;if(_0x1b2514===_0x70b0('0x20')){_0x25e4ac[_0x70b0('0xd')]=0x0;_0x25e4ac[_0x70b0('0x6')]=0x0;if(_0x241d85===_0x70b0('0x2a')){_0x25e4ac[_0x70b0('0x2e')]=0x0;_0x25e4ac[_0x70b0('0xf')]=0x0;}}var _0x194d39=_[_0x70b0('0x2f')](_0x4dbd9d,['id',_0x25e4ac['id']]);if(_0x194d39){_['merge'](_0x25e4ac,_[_0x70b0('0x30')](_0x194d39,_0x45f6a3));}return _0x25e4ac;});}exports[_0x70b0('0x31')]=initializeQueues;
\ No newline at end of file
index 51a4847..a695bef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0xd5160a,_0x572c4b){var _0x576cf9=function(_0xa95da6){while(--_0xa95da6){_0xd5160a['push'](_0xd5160a['shift']());}};_0x576cf9(++_0x572c4b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());};
\ No newline at end of file
+var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x46c9cc,_0xd27dca){var _0x21b46e=function(_0x33b2f5){while(--_0x33b2f5){_0x46c9cc['push'](_0x46c9cc['shift']());}};_0x21b46e(++_0xd27dca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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 299172f..605f8b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6dd8=['digest','hex','substring','bimedia-machine-uuid','child_process','execSync','orderBy','keys','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','map','createHash','md5','update','platform','test','licenseToken','replace','hostname','macAddress','ipAddress'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x6dd8,0x16b));var _0x86dd=function(_0x55afa9,_0x34bb2d){_0x55afa9=_0x55afa9-0x0;var _0x1ba0ad=_0x6dd8[_0x55afa9];return _0x1ba0ad;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require(_0x86dd('0x0'));var exec=require(_0x86dd('0x1'))[_0x86dd('0x2')];var config=require('../environment');function getInterfaces(){var _0x31cae9=[];var _0x2729c9=os['networkInterfaces']();var _0x51a1ba=_[_0x86dd('0x3')](_[_0x86dd('0x4')](_0x2729c9));for(var _0x1cf9eb=0x0;_0x1cf9eb<_0x51a1ba['length'];_0x1cf9eb++){var _0x37f4e4=_0x2729c9[_0x51a1ba[_0x1cf9eb]][_0x86dd('0x5')](function(_0x296785){return _0x296785[_0x86dd('0x6')]===_0x86dd('0x7')&&_0x296785[_0x86dd('0x8')]===![];});_0x31cae9=_0x31cae9[_0x86dd('0x9')](_0x37f4e4);}return _0x31cae9;}function getFirstInterface(){var _0x4b8101=_[_0x86dd('0xa')](getInterfaces());return{'macAddress':_0x4b8101&&_0x4b8101[_0x86dd('0xb')]?_0x4b8101[_0x86dd('0xb')]:_0x86dd('0xc'),'ipAddress':_0x4b8101&&_0x4b8101['address']?_0x4b8101[_0x86dd('0xd')]:'127.0.0.1'};}exports[_0x86dd('0xe')]=getFirstInterface;function getCPUhash(){var _0x5865a3=_['orderBy'](os[_0x86dd('0xf')]()[_0x86dd('0x10')](function(_0x41b94b){return _0x41b94b['model'];}))['join'](':');return crypto[_0x86dd('0x11')](_0x86dd('0x12'))[_0x86dd('0x13')](_0x5865a3)['digest']('hex');}exports['getUuid']=function(){var _0x33b1d4=os[_0x86dd('0x14')]();var _0x577f86=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x577f86[_0x86dd('0x15')](config['licenseToken'])){return config[_0x86dd('0x16')];}else if(_0x33b1d4==='win32'){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0x86dd('0x17')]('\x0d\x0a','');}else{var _0x17e232=getFirstInterface();var _0x1e9e1f=getCPUhash();var _0x439afa=_0x1e9e1f+'|'+os[_0x86dd('0x18')]()+'|'+_0x17e232[_0x86dd('0x19')]+'|'+_0x17e232[_0x86dd('0x1a')];var _0xdb2419=crypto[_0x86dd('0x11')]('md5')[_0x86dd('0x13')](_0x439afa)[_0x86dd('0x1b')](_0x86dd('0x1c'));return _0xdb2419[_0x86dd('0x1d')](0x0,0x8)+'-'+_0xdb2419[_0x86dd('0x1d')](0x8,0xc)+'-'+_0xdb2419['substring'](0xc,0x10)+'-'+_0xdb2419['substring'](0x10,0x14)+'-'+_0xdb2419['substring'](0x14);}};
\ No newline at end of file
+var _0x752c=['join','createHash','md5','update','digest','hex','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','ipAddress','substring','lodash','execSync','../environment','networkInterfaces','keys','length','filter','IPv4','mac','00:00:00:00:00:00','address','127.0.0.1','orderBy','cpus','map','model'];(function(_0x383feb,_0x3d53c9){var _0x743423=function(_0x20c948){while(--_0x20c948){_0x383feb['push'](_0x383feb['shift']());}};_0x743423(++_0x3d53c9);}(_0x752c,0x95));var _0xc752=function(_0x182c90,_0x17163e){_0x182c90=_0x182c90-0x0;var _0x250725=_0x752c[_0x182c90];return _0x250725;};'use strict';var _=require(_0xc752('0x0'));var os=require('os');var crypto=require('crypto');var machine=require('bimedia-machine-uuid');var exec=require('child_process')[_0xc752('0x1')];var config=require(_0xc752('0x2'));function getInterfaces(){var _0x4ef702=[];var _0x495452=os[_0xc752('0x3')]();var _0x212acd=_['orderBy'](_[_0xc752('0x4')](_0x495452));for(var _0x45bfe2=0x0;_0x45bfe2<_0x212acd[_0xc752('0x5')];_0x45bfe2++){var _0x2f816d=_0x495452[_0x212acd[_0x45bfe2]][_0xc752('0x6')](function(_0x37965a){return _0x37965a['family']===_0xc752('0x7')&&_0x37965a['internal']===![];});_0x4ef702=_0x4ef702['concat'](_0x2f816d);}return _0x4ef702;}function getFirstInterface(){var _0xf98227=_['head'](getInterfaces());return{'macAddress':_0xf98227&&_0xf98227[_0xc752('0x8')]?_0xf98227[_0xc752('0x8')]:_0xc752('0x9'),'ipAddress':_0xf98227&&_0xf98227[_0xc752('0xa')]?_0xf98227['address']:_0xc752('0xb')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0xabcd6a=_[_0xc752('0xc')](os[_0xc752('0xd')]()[_0xc752('0xe')](function(_0x2c9385){return _0x2c9385[_0xc752('0xf')];}))[_0xc752('0x10')](':');return crypto[_0xc752('0x11')](_0xc752('0x12'))[_0xc752('0x13')](_0xabcd6a)[_0xc752('0x14')](_0xc752('0x15'));}exports[_0xc752('0x16')]=function(){var _0x575756=os[_0xc752('0x17')]();var _0x173a01=/[0-9a-f-]{36}/;if(config[_0xc752('0x18')]&&_0x173a01[_0xc752('0x19')](config[_0xc752('0x18')])){return config['licenseToken'];}else if(_0x575756===_0xc752('0x1a')){return exec(_0xc752('0x1b'),{'encoding':_0xc752('0x1c')})['replace']('\x0d\x0a','');}else{var _0xf81149=getFirstInterface();var _0xeec80c=getCPUhash();var _0x4e6a18=_0xeec80c+'|'+os[_0xc752('0x1d')]()+'|'+_0xf81149[_0xc752('0x1e')]+'|'+_0xf81149[_0xc752('0x1f')];var _0x5f54ce=crypto['createHash'](_0xc752('0x12'))[_0xc752('0x13')](_0x4e6a18)[_0xc752('0x14')](_0xc752('0x15'));return _0x5f54ce[_0xc752('0x20')](0x0,0x8)+'-'+_0x5f54ce[_0xc752('0x20')](0x8,0xc)+'-'+_0x5f54ce['substring'](0xc,0x10)+'-'+_0x5f54ce[_0xc752('0x20')](0x10,0x14)+'-'+_0x5f54ce[_0xc752('0x20')](0x14);}};
\ No newline at end of file
index dcc5b31..9c409e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8de3=['Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','format','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','catch','error','message','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','pkginfo','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED'];(function(_0x40f2b4,_0x145a9c){var _0x3ae8c9=function(_0x30f881){while(--_0x30f881){_0x40f2b4['push'](_0x40f2b4['shift']());}};_0x3ae8c9(++_0x145a9c);}(_0x8de3,0xda));var _0x38de=function(_0x515e9f,_0xff9586){_0x515e9f=_0x515e9f-0x0;var _0x19cbf0=_0x8de3[_0x515e9f];return _0x19cbf0;};'use strict';var util=require(_0x38de('0x0'));var moment=require('moment');var rp=require('request-promise');var BPromise=require('bluebird');var pkginfo=require(_0x38de('0x1'))(module,'version');var db=require(_0x38de('0x2'))['db'];var encryptor=require(_0x38de('0x3'));var hardware=require(_0x38de('0x4'));var logger=require(_0x38de('0x5'))(_0x38de('0x6'));var HOST=_0x38de('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x30f647){return new BPromise(function(_0x2b06ae,_0x42ac5c){var _0x29a0f6=util['format'](_0x38de('0x8'),HOST,_0x30f647,module[_0x38de('0x9')][_0x38de('0xa')]);if(oldToken){_0x29a0f6=util['format'](_0x38de('0xb'),HOST,_0x30f647,module['exports']['version'],oldToken);}var _0x53be75={'uri':_0x29a0f6,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x53be75)[_0x38de('0xc')](function(_0x1adb2d){_0x2b06ae(_0x1adb2d);})['catch'](function(_0x2bb9b8){_0x42ac5c(_0x2bb9b8);});});}function manageLicense(_0x13f64a,_0x117340){var _0x384ff8=_0x117340[_0x38de('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x384ff8[_0x38de('0xe')]!==_0x13f64a&&!_0x384ff8[_0x38de('0xf')]){oldToken=_0x384ff8[_0x38de('0xe')];}httpRequest(_0x13f64a)[_0x38de('0xc')](function(_0x17ff73){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x17ff73[_0x38de('0x10')]){isOldTokenSent=![];if(!_0x384ff8['license']&&_0x384ff8[_0x38de('0x6')]!=_0x17ff73['license']||_0x384ff8[_0x38de('0x6')]&&_0x384ff8[_0x38de('0xf')]){logger[_0x38de('0x11')](_0x38de('0x12'));}if(_0x384ff8['license']&&!_0x384ff8['data2']&&_0x384ff8[_0x38de('0x6')]!=_0x17ff73[_0x38de('0x6')]){logger[_0x38de('0x11')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x384ff8[_0x38de('0x6')]&&!_0x384ff8[_0x38de('0xf')]&&_0x384ff8['license']==_0x17ff73['license']){return _0x117340;}return _0x117340[_0x38de('0x13')]({'data1':_0x13f64a,'data2':null,'license':_0x17ff73['license']});}else{if(_0x17ff73['license']||_0x384ff8[_0x38de('0x6')]){if(!_0x384ff8['data2']){if(_0x384ff8[_0x38de('0xe')]==_0x13f64a){GRAY_PERIOD_REASON=_0x38de('0x14');logger[_0x38de('0x11')](_0x38de('0x15'));}else{GRAY_PERIOD_REASON=_0x38de('0x16');logger[_0x38de('0x11')](_0x38de('0x17'),_0x384ff8['data1'],_0x13f64a);}logger[_0x38de('0x11')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x38de('0x18')](),moment()[_0x38de('0x19')](_0x38de('0x1a')));return _0x117340[_0x38de('0x13')]({'data2':encryptor[_0x38de('0x1b')](moment()[_0x38de('0x19')](_0x38de('0x1a')))});}else{if(moment()[_0x38de('0x1c')](encryptor[_0x38de('0x1d')](_0x384ff8[_0x38de('0xf')]),_0x38de('0x1e'))>DAYS){logger[_0x38de('0x11')](_0x38de('0x1f'),moment()['format']('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x117340[_0x38de('0x13')]({'data1':_0x13f64a,'data2':null,'license':null});}}}else{if(_0x384ff8['data1']!=_0x13f64a){logger['info'](_0x38de('0x17'),_0x384ff8[_0x38de('0xe')],_0x13f64a);return _0x117340[_0x38de('0x13')]({'data1':_0x13f64a,'data2':null,'license':null});}}}return _0x117340;})[_0x38de('0xc')](function(_0xef746d){_0x117340=_0xef746d;})[_0x38de('0x20')](function(_0x220120){logger[_0x38de('0x21')](_0x220120[_0x38de('0x22')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x117340);},TIME);});}function defaultLicense(){var _0x3bce21=hardware['getUuid']();if(_0x3bce21){return db[_0x38de('0x23')][_0x38de('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x3bce21}})[_0x38de('0x25')](function(_0x5d4822,_0x362026){logger['info'](_0x38de('0x26'),_0x3bce21);manageLicense(_0x3bce21,_0x5d4822);})['catch'](function(_0x27f098){logger[_0x38de('0x21')](_0x27f098[_0x38de('0x22')]);});}}exports[_0x38de('0x27')]=defaultLicense;
\ No newline at end of file
+var _0x4852=['YYYY-MM-DD\x20HH:mm','diff','decryptString','DEMO\x20START\x20AT\x20%s','message','finally','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','request-promise','bluebird','version','../../mysqldb','../../components/encryptor','../logger','license','format','%s/api/servers/%s/check?version=%s','exports','GET','then','catch','get','data1','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase'];(function(_0x18ecf5,_0xc2651c){var _0x14a57c=function(_0x485745){while(--_0x485745){_0x18ecf5['push'](_0x18ecf5['shift']());}};_0x14a57c(++_0xc2651c);}(_0x4852,0x17c));var _0x2485=function(_0x4b26ec,_0x29deec){_0x4b26ec=_0x4b26ec-0x0;var _0x2d4501=_0x4852[_0x4b26ec];return _0x2d4501;};'use strict';var util=require(_0x2485('0x0'));var moment=require('moment');var rp=require(_0x2485('0x1'));var BPromise=require(_0x2485('0x2'));var pkginfo=require('pkginfo')(module,_0x2485('0x3'));var db=require(_0x2485('0x4'))['db'];var encryptor=require(_0x2485('0x5'));var hardware=require('./hardware');var logger=require(_0x2485('0x6'))(_0x2485('0x7'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x30f659){return new BPromise(function(_0xbf4fcd,_0x5d08b7){var _0x2714b7=util[_0x2485('0x8')](_0x2485('0x9'),HOST,_0x30f659,module[_0x2485('0xa')][_0x2485('0x3')]);if(oldToken){_0x2714b7=util[_0x2485('0x8')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x30f659,module[_0x2485('0xa')][_0x2485('0x3')],oldToken);}var _0x1d4ff1={'uri':_0x2714b7,'method':_0x2485('0xb'),'timeout':0xea60,'json':!![]};return rp(_0x1d4ff1)[_0x2485('0xc')](function(_0xcf47eb){_0xbf4fcd(_0xcf47eb);})[_0x2485('0xd')](function(_0x566ad6){_0x5d08b7(_0x566ad6);});});}function manageLicense(_0x3a58ce,_0x40b8e2){var _0x590f7b=_0x40b8e2[_0x2485('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x590f7b[_0x2485('0xf')]!==_0x3a58ce&&!_0x590f7b[_0x2485('0x10')]){oldToken=_0x590f7b[_0x2485('0xf')];}httpRequest(_0x3a58ce)[_0x2485('0xc')](function(_0x35adc6){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x35adc6['active']){isOldTokenSent=![];if(!_0x590f7b[_0x2485('0x7')]&&_0x590f7b['license']!=_0x35adc6[_0x2485('0x7')]||_0x590f7b['license']&&_0x590f7b[_0x2485('0x10')]){logger[_0x2485('0x11')](_0x2485('0x12'));}if(_0x590f7b['license']&&!_0x590f7b[_0x2485('0x10')]&&_0x590f7b[_0x2485('0x7')]!=_0x35adc6[_0x2485('0x7')]){logger['info'](_0x2485('0x13'));}if(_0x590f7b[_0x2485('0x7')]&&!_0x590f7b[_0x2485('0x10')]&&_0x590f7b[_0x2485('0x7')]==_0x35adc6[_0x2485('0x7')]){return _0x40b8e2;}return _0x40b8e2[_0x2485('0x14')]({'data1':_0x3a58ce,'data2':null,'license':_0x35adc6['license']});}else{if(_0x35adc6[_0x2485('0x7')]||_0x590f7b[_0x2485('0x7')]){if(!_0x590f7b[_0x2485('0x10')]){if(_0x590f7b['data1']==_0x3a58ce){GRAY_PERIOD_REASON=_0x2485('0x15');logger[_0x2485('0x11')](_0x2485('0x16'));}else{GRAY_PERIOD_REASON=_0x2485('0x17');logger[_0x2485('0x11')](_0x2485('0x18'),_0x590f7b[_0x2485('0xf')],_0x3a58ce);}logger[_0x2485('0x11')](_0x2485('0x19'),GRAY_PERIOD_REASON[_0x2485('0x1a')](),moment()['format'](_0x2485('0x1b')));return _0x40b8e2[_0x2485('0x14')]({'data2':encryptor['encryptString'](moment()['format'](_0x2485('0x1b')))});}else{if(moment()[_0x2485('0x1c')](encryptor[_0x2485('0x1d')](_0x590f7b['data2']),'days')>DAYS){logger[_0x2485('0x11')](_0x2485('0x1e'),moment()[_0x2485('0x8')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x40b8e2['update']({'data1':_0x3a58ce,'data2':null,'license':null});}}}else{if(_0x590f7b[_0x2485('0xf')]!=_0x3a58ce){logger['info'](_0x2485('0x18'),_0x590f7b[_0x2485('0xf')],_0x3a58ce);return _0x40b8e2['update']({'data1':_0x3a58ce,'data2':null,'license':null});}}}return _0x40b8e2;})[_0x2485('0xc')](function(_0x415d63){_0x40b8e2=_0x415d63;})['catch'](function(_0x36f5cb){logger['error'](_0x36f5cb[_0x2485('0x1f')]);})[_0x2485('0x20')](function(){setTimeout(function(){manageLicense(hardware[_0x2485('0x21')](),_0x40b8e2);},TIME);});}function defaultLicense(){var _0xf5ae4b=hardware['getUuid']();if(_0xf5ae4b){return db['License'][_0x2485('0x22')]({'where':{'id':0x1},'defaults':{'data1':_0xf5ae4b}})[_0x2485('0x23')](function(_0x78575c,_0x299b05){logger[_0x2485('0x11')](_0x2485('0x24'),_0xf5ae4b);manageLicense(_0xf5ae4b,_0x78575c);})[_0x2485('0xd')](function(_0x32c034){logger['error'](_0x32c034['message']);});}}exports['default']=defaultLicense;
\ No newline at end of file
index f6e52a7..86ff77b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9d5=['Demo\x20license','Breaking\x20license','getUuid','License','find','defaults','then','catch','uuid','license','License\x20key\x20value\x20not\x20found','data1','data2','split','decryptString','%s:%s:%s','parse','deadline','add','format','changed','disabled','message','findAll','role','sequelize','COUNT','count','admin','user','telephone','users','telephones','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z'];(function(_0x12c6a0,_0x121b8d){var _0x358883=function(_0x5b7e66){while(--_0x5b7e66){_0x12c6a0['push'](_0x12c6a0['shift']());}};_0x358883(++_0x121b8d);}(_0xf9d5,0xe3));var _0x5f9d=function(_0x5c25d8,_0x36c7e7){_0x5c25d8=_0x5c25d8-0x0;var _0x48652c=_0xf9d5[_0x5c25d8];return _0x48652c;};'use strict';var util=require(_0x5f9d('0x0'));var _=require(_0x5f9d('0x1'));var moment=require(_0x5f9d('0x2'));var BPromise=require(_0x5f9d('0x3'));var hardware=require(_0x5f9d('0x4'));var encryptor=require(_0x5f9d('0x5'));var db=require(_0x5f9d('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5f9d('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x5f9d('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5f9d('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x5f9d('0x9'),'machineUuid':hardware[_0x5f9d('0xa')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0xe77173){return new BPromise(function(_0x46d9b3,_0x293d37){return db[_0x5f9d('0xb')][_0x5f9d('0xc')](_[_0x5f9d('0xd')](_0xe77173,{'raw':!![],'where':{'id':0x1}}))[_0x5f9d('0xe')](function(_0x5efc26){return checkLicense(_0x5efc26,null);})[_0x5f9d('0xe')](function(_0x4f4520){_0x46d9b3(_0x4f4520);return;})[_0x5f9d('0xf')](function(_0x1bb198){_0x293d37(_0x1bb198);});});}function checkLicense(_0xa4db9,_0x37c6c1){if(!_0xa4db9){demoLicense[_0x5f9d('0x10')]=_0xa4db9['data1'];return demoLicense;}try{var _0x1d8f6c=_0x37c6c1||_0xa4db9[_0x5f9d('0x11')];if(_['isEmpty'](_0x1d8f6c)){throw new Error(_0x5f9d('0x12'));}var _0x86fbe0=_0xa4db9[_0x5f9d('0x13')];var _0xeb00f0=_0xa4db9[_0x5f9d('0x14')];var _0x36c310=_0x86fbe0[_0x5f9d('0x15')]('-')[0x4];var _0x5b062a=_0x86fbe0[_0x5f9d('0x15')]('-')[0x0];var _0x1be232=encryptor[_0x5f9d('0x16')](_0x1d8f6c,util['format'](_0x5f9d('0x17'),_0x36c310,_0x86fbe0,_0x5b062a));var _0x322ed7=JSON[_0x5f9d('0x18')](_0x1be232);_0x322ed7['demo']=![];_0x322ed7[_0x5f9d('0x10')]=_0x86fbe0;_0x322ed7['machineUuid']=hardware['getUuid']();if(_0xeb00f0){var _0x470a56=encryptor['decryptString'](_0xeb00f0);_0x322ed7['gray']=_0x470a56;_0x322ed7[_0x5f9d('0x19')]=moment(_0x470a56)[_0x5f9d('0x1a')](0x7,'days')[_0x5f9d('0x1b')]();_0x322ed7['grayReason']=_0x322ed7[_0x5f9d('0x10')]!=_0x322ed7['machineUuid']?_0x5f9d('0x1c'):_0x5f9d('0x1d');}return _0x322ed7;}catch(_0xe00b0d){breakingLicense[_0x5f9d('0x10')]=_0xa4db9['data1'];breakingLicense[_0x5f9d('0x1e')]=_0xe00b0d['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x2e89ce,_0x428863){getLicense()[_0x5f9d('0xe')](function(_0x33c81d){return db['User'][_0x5f9d('0x1f')]({'attributes':[_0x5f9d('0x20'),[db[_0x5f9d('0x21')]['fn'](_0x5f9d('0x22'),db[_0x5f9d('0x21')]['col'](_0x5f9d('0x20'))),_0x5f9d('0x23')]],'group':_0x5f9d('0x20'),'where':{'role':{'$or':[_0x5f9d('0x24'),_0x5f9d('0x25'),_0x5f9d('0x26')]}},'raw':!![]})[_0x5f9d('0xe')](function(_0x550f19){var _0x8fe994={'user':_0x33c81d[_0x5f9d('0x27')]||0x0,'telephone':_0x33c81d[_0x5f9d('0x28')]||0x0};_0x550f19[_0x5f9d('0x29')](function(_0x41e69f){var _0x4906f8=_0x41e69f[_0x5f9d('0x20')]===_0x5f9d('0x24')?_0x5f9d('0x25'):_0x41e69f['role'];_0x8fe994[_0x4906f8]-=_0x41e69f['count'];if(_0x8fe994[_0x4906f8]<0x0)_0x8fe994[_0x4906f8]=0x0;});_0x2e89ce(_0x8fe994);return;});})[_0x5f9d('0xf')](function(_0x573a6c){_0x428863(_0x573a6c);});});}function checkUserLimits(_0x4b3951){return new BPromise(function(_0x50595a,_0x5572c0){getLimits()[_0x5f9d('0xe')](function(_0x50db13){var _0x35b63e=_[_0x5f9d('0x2a')](_[_0x5f9d('0x2b')](_0x4b3951,'role'),[_0x5f9d('0x24'),_0x5f9d('0x25'),_0x5f9d('0x26')]);var _0x371e34=(_0x35b63e[_0x5f9d('0x24')]||0x0)+(_0x35b63e[_0x5f9d('0x25')]||0x0);var _0x1a668a=_0x35b63e['telephone']||0x0;if(_0x371e34>_0x50db13['user'])return _0x5572c0(_0x5f9d('0x2c'));if(_0x1a668a>_0x50db13[_0x5f9d('0x26')])return _0x5572c0(_0x5f9d('0x2d'));return _0x50595a();})[_0x5f9d('0xf')](function(_0x35151d){_0x5572c0(_0x35151d);});});}module[_0x5f9d('0x2e')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
+var _0x753b=['License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','split','decryptString','format','%s:%s:%s','parse','demo','gray','deadline','add','days','grayReason','changed','disabled','message','User','role','sequelize','COUNT','col','count','telephone','users','telephones','admin','user','countBy'];(function(_0x136619,_0x31c9b2){var _0x38c4a5=function(_0x10b74d){while(--_0x10b74d){_0x136619['push'](_0x136619['shift']());}};_0x38c4a5(++_0x31c9b2);}(_0x753b,0x14c));var _0xb753=function(_0x6edc85,_0x2c7710){_0x6edc85=_0x6edc85-0x0;var _0x4631a9=_0x753b[_0x6edc85];return _0x4631a9;};'use strict';var util=require('util');var _=require(_0xb753('0x0'));var moment=require(_0xb753('0x1'));var BPromise=require(_0xb753('0x2'));var hardware=require(_0xb753('0x3'));var encryptor=require(_0xb753('0x4'));var db=require(_0xb753('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb753('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xb753('0x7'),'machineUuid':hardware[_0xb753('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0xb753('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x40c046){return new BPromise(function(_0x5a09bc,_0x4628f7){return db['License'][_0xb753('0x9')](_[_0xb753('0xa')](_0x40c046,{'raw':!![],'where':{'id':0x1}}))[_0xb753('0xb')](function(_0x2e3d89){return checkLicense(_0x2e3d89,null);})['then'](function(_0x4c1402){_0x5a09bc(_0x4c1402);return;})[_0xb753('0xc')](function(_0x5d80aa){_0x4628f7(_0x5d80aa);});});}function checkLicense(_0x28ae74,_0xf9b5da){if(!_0x28ae74){demoLicense[_0xb753('0xd')]=_0x28ae74[_0xb753('0xe')];return demoLicense;}try{var _0x3bc08d=_0xf9b5da||_0x28ae74[_0xb753('0xf')];if(_[_0xb753('0x10')](_0x3bc08d)){throw new Error(_0xb753('0x11'));}var _0x521bd1=_0x28ae74[_0xb753('0xe')];var _0x484856=_0x28ae74['data2'];var _0x4110b4=_0x521bd1[_0xb753('0x12')]('-')[0x4];var _0x46f2e1=_0x521bd1['split']('-')[0x0];var _0x1b0ece=encryptor[_0xb753('0x13')](_0x3bc08d,util[_0xb753('0x14')](_0xb753('0x15'),_0x4110b4,_0x521bd1,_0x46f2e1));var _0x59fb82=JSON[_0xb753('0x16')](_0x1b0ece);_0x59fb82[_0xb753('0x17')]=![];_0x59fb82[_0xb753('0xd')]=_0x521bd1;_0x59fb82['machineUuid']=hardware[_0xb753('0x8')]();if(_0x484856){var _0x1f5148=encryptor[_0xb753('0x13')](_0x484856);_0x59fb82[_0xb753('0x18')]=_0x1f5148;_0x59fb82[_0xb753('0x19')]=moment(_0x1f5148)[_0xb753('0x1a')](0x7,_0xb753('0x1b'))[_0xb753('0x14')]();_0x59fb82[_0xb753('0x1c')]=_0x59fb82['uuid']!=_0x59fb82['machineUuid']?_0xb753('0x1d'):_0xb753('0x1e');}return _0x59fb82;}catch(_0x4eedc9){breakingLicense[_0xb753('0xd')]=_0x28ae74[_0xb753('0xe')];breakingLicense['message']=_0x4eedc9[_0xb753('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x52f4b9,_0x37776e){getLicense()['then'](function(_0x4d7831){return db[_0xb753('0x20')]['findAll']({'attributes':[_0xb753('0x21'),[db[_0xb753('0x22')]['fn'](_0xb753('0x23'),db[_0xb753('0x22')][_0xb753('0x24')](_0xb753('0x21'))),_0xb753('0x25')]],'group':_0xb753('0x21'),'where':{'role':{'$or':['admin','user',_0xb753('0x26')]}},'raw':!![]})[_0xb753('0xb')](function(_0x2711d9){var _0x3bce88={'user':_0x4d7831[_0xb753('0x27')]||0x0,'telephone':_0x4d7831[_0xb753('0x28')]||0x0};_0x2711d9['forEach'](function(_0x5a2766){var _0x17a498=_0x5a2766['role']===_0xb753('0x29')?_0xb753('0x2a'):_0x5a2766[_0xb753('0x21')];_0x3bce88[_0x17a498]-=_0x5a2766['count'];if(_0x3bce88[_0x17a498]<0x0)_0x3bce88[_0x17a498]=0x0;});_0x52f4b9(_0x3bce88);return;});})[_0xb753('0xc')](function(_0x41d856){_0x37776e(_0x41d856);});});}function checkUserLimits(_0x517190){return new BPromise(function(_0x39f58e,_0x26153f){getLimits()[_0xb753('0xb')](function(_0x4171ad){var _0x1ce323=_['pick'](_[_0xb753('0x2b')](_0x517190,_0xb753('0x21')),[_0xb753('0x29'),'user','telephone']);var _0x26f83c=(_0x1ce323[_0xb753('0x29')]||0x0)+(_0x1ce323[_0xb753('0x2a')]||0x0);var _0x1a0ee6=_0x1ce323[_0xb753('0x26')]||0x0;if(_0x26f83c>_0x4171ad[_0xb753('0x2a')])return _0x26153f(_0xb753('0x2c'));if(_0x1a0ee6>_0x4171ad[_0xb753('0x26')])return _0x26153f(_0xb753('0x2d'));return _0x39f58e();})[_0xb753('0xc')](function(_0x3d8fcd){_0x26153f(_0x3d8fcd);});});}module[_0xb753('0x2e')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
index fba5d1c..c7077ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x065e=['secret','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x065e,0x1a7));var _0xe065=function(_0x145f49,_0x3812b9){_0x145f49=_0x145f49-0x0;var _0x343c38=_0x065e[_0x145f49];return _0x343c38;};'use strict';module[_0xe065('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xe065('0x1'),'DEBUG':''};
\ No newline at end of file
+var _0xefda=['exports','app-id','secret'];(function(_0x51bda1,_0x44f80d){var _0x1ce08c=function(_0x5b788e){while(--_0x5b788e){_0x51bda1['push'](_0x51bda1['shift']());}};_0x1ce08c(++_0x44f80d);}(_0xefda,0x96));var _0xaefd=function(_0x3b6a84,_0x3286a1){_0x3b6a84=_0x3b6a84-0x0;var _0x5a1d99=_0xefda[_0x3b6a84];return _0x5a1d99;};'use strict';module[_0xaefd('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0xaefd('0x1'),'GOOGLE_SECRET':_0xaefd('0x2'),'DEBUG':''};
\ No newline at end of file
index 7be2147..b4c84ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32f0=['fileLogger','../utils/loggers'];(function(_0x26aaaf,_0x4e8f2a){var _0x24e1a8=function(_0x53c0ec){while(--_0x53c0ec){_0x26aaaf['push'](_0x26aaaf['shift']());}};_0x24e1a8(++_0x4e8f2a);}(_0x32f0,0x1c3));var _0x032f=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x32f0[_0x5f309e];return _0x487b5e;};'use strict';var fileLogger=require(_0x032f('0x0'))[_0x032f('0x1')];module['exports']=fileLogger;
\ No newline at end of file
+var _0x8f02=['../utils/loggers','fileLogger','exports'];(function(_0x2b18f2,_0xccf589){var _0x4ed53d=function(_0x107034){while(--_0x107034){_0x2b18f2['push'](_0x2b18f2['shift']());}};_0x4ed53d(++_0xccf589);}(_0x8f02,0xba));var _0x28f0=function(_0x7f5879,_0x54a6d2){_0x7f5879=_0x7f5879-0x0;var _0x3412d0=_0x8f02[_0x7f5879];return _0x3412d0;};'use strict';var fileLogger=require(_0x28f0('0x0'))[_0x28f0('0x1')];module[_0x28f0('0x2')]=fileLogger;
\ No newline at end of file
index 7eb327a..e1dcd1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x145d=['../../services/xdr/index.js','path','ami','agi','join','email','../../services/email/index.js','../../services/routing/index.js','xdr'];(function(_0x1bb58a,_0x49b338){var _0x508303=function(_0x36ad36){while(--_0x36ad36){_0x1bb58a['push'](_0x1bb58a['shift']());}};_0x508303(++_0x49b338);}(_0x145d,0x1ba));var _0xd145=function(_0x5019bb,_0x516449){_0x5019bb=_0x5019bb-0x0;var _0x4d07b2=_0x145d[_0x5019bb];return _0x4d07b2;};'use strict';var path=require(_0xd145('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path['join'](__dirname,'../../services/express/index.js')},{'name':_0xd145('0x1'),'script':path['join'](__dirname,'../../services/ami/index.js')},{'name':_0xd145('0x2'),'script':path[_0xd145('0x3')](__dirname,'../../services/agi/index.js')},{'name':_0xd145('0x4'),'script':path[_0xd145('0x3')](__dirname,_0xd145('0x5'))},{'name':'routing','script':path[_0xd145('0x3')](__dirname,_0xd145('0x6'))},{'name':_0xd145('0x7'),'script':path[_0xd145('0x3')](__dirname,_0xd145('0x8'))}]};module['exports']=config;
\ No newline at end of file
+var _0xf448=['../../services/express/index.js','ami','agi','join','../../services/agi/index.js','email','routing','xdr','../../services/xdr/index.js','exports','path','express'];(function(_0x89178b,_0x52a9ec){var _0x212e41=function(_0x425abd){while(--_0x425abd){_0x89178b['push'](_0x89178b['shift']());}};_0x212e41(++_0x52a9ec);}(_0xf448,0x136));var _0x8f44=function(_0x2ea680,_0x99a563){_0x2ea680=_0x2ea680-0x0;var _0x317396=_0xf448[_0x2ea680];return _0x317396;};'use strict';var path=require(_0x8f44('0x0'));var os=require('os');var config={'apps':[{'name':_0x8f44('0x1'),'script':path['join'](__dirname,_0x8f44('0x2'))},{'name':_0x8f44('0x3'),'script':path['join'](__dirname,'../../services/ami/index.js')},{'name':_0x8f44('0x4'),'script':path[_0x8f44('0x5')](__dirname,_0x8f44('0x6'))},{'name':_0x8f44('0x7'),'script':path[_0x8f44('0x5')](__dirname,'../../services/email/index.js')},{'name':_0x8f44('0x8'),'script':path[_0x8f44('0x5')](__dirname,'../../services/routing/index.js')},{'name':_0x8f44('0x9'),'script':path[_0x8f44('0x5')](__dirname,_0x8f44('0xa'))}]};module[_0x8f44('0xb')]=config;
\ No newline at end of file
index c31e4b1..aa2cff0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x953d=['start','then','disconnect','stop','restart','list','delete','dump','pm2','bluebird','./config','connect','connected'];(function(_0xc45596,_0x5c410e){var _0x425ffe=function(_0x3c327d){while(--_0x3c327d){_0xc45596['push'](_0xc45596['shift']());}};_0x425ffe(++_0x5c410e);}(_0x953d,0x1a8));var _0xd953=function(_0x5147a4,_0x4e4b41){_0x5147a4=_0x5147a4-0x0;var _0x84faf6=_0x953d[_0x5147a4];return _0x84faf6;};'use strict';var pm2=require(_0xd953('0x0'));var BPromise=require(_0xd953('0x1'));var config=require(_0xd953('0x2'));function connect(){return new BPromise(function(_0x2ed6b5,_0x47e3b9){return pm2[_0xd953('0x3')](function(_0x2456fa){if(_0x2456fa){return _0x47e3b9(_0x2456fa);}return _0x2ed6b5(_0xd953('0x4'));});});};exports[_0xd953('0x5')]=function(_0x52e71f){return connect()[_0xd953('0x6')](function(){return new BPromise(function(_0x49969e,_0x3ed133){return pm2[_0xd953('0x5')](_0x52e71f,function(_0x1851a2,_0x452010){if(_0x1851a2){return _0x3ed133(_0x1851a2);}pm2[_0xd953('0x7')]();return _0x49969e(_0x452010);});});});};exports[_0xd953('0x8')]=function(_0x319163){return connect()[_0xd953('0x6')](function(){return new BPromise(function(_0x7b2f07,_0x4b2b34){return pm2[_0xd953('0x8')](_0x319163,function(_0x752353,_0x5cb7a7){if(_0x752353){return _0x4b2b34(_0x752353);}pm2['disconnect']();return _0x7b2f07(_0x5cb7a7);});});});};exports['restart']=function(_0x311d6a){return connect()[_0xd953('0x6')](function(){return new BPromise(function(_0x41d3f6,_0x46c3f7){return pm2[_0xd953('0x9')](_0x311d6a,function(_0x310eaf,_0x446593){if(_0x310eaf){return _0x46c3f7(_0x310eaf);}pm2[_0xd953('0x7')]();return _0x41d3f6(_0x446593);});});});};exports[_0xd953('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x37cae7,_0x1ce188){return pm2[_0xd953('0xa')](function(_0x13626a,_0x50f7a8){if(_0x13626a){return _0x1ce188(_0x13626a);}pm2['disconnect']();return _0x37cae7(_0x50f7a8);});});});};exports['describe']=function(_0x16b7d1){return connect()['then'](function(){return new BPromise(function(_0x447fb4,_0x1a5ffa){return pm2['describe'](_0x16b7d1,function(_0x321dd6,_0x1a9d78){if(_0x321dd6){return _0x1a5ffa(_0x321dd6);}pm2['disconnect']();return _0x447fb4(_0x1a9d78);});});});};exports[_0xd953('0xb')]=function(_0x3ebccf){return connect()[_0xd953('0x6')](function(){return new BPromise(function(_0x414837,_0xf20fbc){return pm2[_0xd953('0xb')](_0x3ebccf,function(_0x103a22,_0x4b9628){if(_0x103a22){return _0xf20fbc(_0x103a22);}pm2[_0xd953('0x7')]();return _0x414837(_0x4b9628);});});});};exports[_0xd953('0xc')]=function(){return connect()[_0xd953('0x6')](function(){return new BPromise(function(_0x30df06,_0x4290dc){return pm2[_0xd953('0xc')](function(_0x2627a8){if(_0x2627a8){return _0x4290dc(_0x2627a8);}return _0x30df06('saved');});});});};
\ No newline at end of file
+var _0xa319=['then','start','disconnect','stop','restart','list','describe','delete','dump','saved','pm2','./config','connect'];(function(_0x4f98da,_0x544223){var _0x4f10c4=function(_0x46a988){while(--_0x46a988){_0x4f98da['push'](_0x4f98da['shift']());}};_0x4f10c4(++_0x544223);}(_0xa319,0x176));var _0x9a31=function(_0x475a41,_0x1af49f){_0x475a41=_0x475a41-0x0;var _0x5b3cb7=_0xa319[_0x475a41];return _0x5b3cb7;};'use strict';var pm2=require(_0x9a31('0x0'));var BPromise=require('bluebird');var config=require(_0x9a31('0x1'));function connect(){return new BPromise(function(_0x5b934f,_0x253db1){return pm2[_0x9a31('0x2')](function(_0x55b114){if(_0x55b114){return _0x253db1(_0x55b114);}return _0x5b934f('connected');});});};exports['start']=function(_0x58351f){return connect()[_0x9a31('0x3')](function(){return new BPromise(function(_0x3dd6c6,_0x2cca99){return pm2[_0x9a31('0x4')](_0x58351f,function(_0x3e9ff6,_0x12b43c){if(_0x3e9ff6){return _0x2cca99(_0x3e9ff6);}pm2[_0x9a31('0x5')]();return _0x3dd6c6(_0x12b43c);});});});};exports[_0x9a31('0x6')]=function(_0x1e59ad){return connect()['then'](function(){return new BPromise(function(_0x3d2048,_0x16ee06){return pm2[_0x9a31('0x6')](_0x1e59ad,function(_0x465036,_0x225a2a){if(_0x465036){return _0x16ee06(_0x465036);}pm2[_0x9a31('0x5')]();return _0x3d2048(_0x225a2a);});});});};exports[_0x9a31('0x7')]=function(_0x22250a){return connect()['then'](function(){return new BPromise(function(_0x3d9bdd,_0x324eba){return pm2[_0x9a31('0x7')](_0x22250a,function(_0x1a03c7,_0x7e38b1){if(_0x1a03c7){return _0x324eba(_0x1a03c7);}pm2['disconnect']();return _0x3d9bdd(_0x7e38b1);});});});};exports[_0x9a31('0x8')]=function(){return connect()[_0x9a31('0x3')](function(){return new BPromise(function(_0x2a3d38,_0x2d034b){return pm2[_0x9a31('0x8')](function(_0x116bd6,_0x2453af){if(_0x116bd6){return _0x2d034b(_0x116bd6);}pm2['disconnect']();return _0x2a3d38(_0x2453af);});});});};exports['describe']=function(_0x53d086){return connect()['then'](function(){return new BPromise(function(_0x1611c1,_0x119df6){return pm2[_0x9a31('0x9')](_0x53d086,function(_0x16a348,_0x8a8db0){if(_0x16a348){return _0x119df6(_0x16a348);}pm2['disconnect']();return _0x1611c1(_0x8a8db0);});});});};exports['delete']=function(_0x3d235c){return connect()[_0x9a31('0x3')](function(){return new BPromise(function(_0x7b3250,_0x4d7dca){return pm2[_0x9a31('0xa')](_0x3d235c,function(_0x13b0ea,_0xf618f){if(_0x13b0ea){return _0x4d7dca(_0x13b0ea);}pm2[_0x9a31('0x5')]();return _0x7b3250(_0xf618f);});});});};exports[_0x9a31('0xb')]=function(){return connect()[_0x9a31('0x3')](function(){return new BPromise(function(_0x27981d,_0x437015){return pm2[_0x9a31('0xb')](function(_0x38f03e){if(_0x38f03e){return _0x437015(_0x38f03e);}return _0x27981d(_0x9a31('0xc'));});});});};
\ No newline at end of file
index b7662ee..c05e2a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe16a=['join','update','system','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','length','info','[CHAT]\x20Interactions\x20to\x20close:'];(function(_0x39ffd1,_0x299703){var _0x31267e=function(_0x11b420){while(--_0x11b420){_0x39ffd1['push'](_0x39ffd1['shift']());}};_0x31267e(++_0x299703);}(_0xe16a,0xb6));var _0xae16=function(_0x25d947,_0x5c070c){_0x25d947=_0x25d947-0x0;var _0x4fa896=_0xe16a[_0x25d947];return _0x4fa896;};'use strict';var _=require(_0xae16('0x0'));var moment=require('moment');var Redis=require(_0xae16('0x1'));var util=require(_0xae16('0x2'));var config=require(_0xae16('0x3'));var db=require(_0xae16('0x4'))['db'];var logger=require(_0xae16('0x5'))(_0xae16('0x6'));config[_0xae16('0x7')]=_[_0xae16('0x8')](config['redis'],{'host':_0xae16('0x9'),'port':0x18eb});var io=require(_0xae16('0xa'))(new Redis(config[_0xae16('0x7')]));function closeInteractions(){var _0x32ccf9=0x0;var _0x37905c=[];return db['Setting'][_0xae16('0xb')]({'raw':!![],'attributes':['id',_0xae16('0xc')],'where':{'id':0x1}})[_0xae16('0xd')](function(_0x599262){_0x32ccf9=_0x599262[_0xae16('0xc')];if(_0x32ccf9){return db[_0xae16('0xe')][_0xae16('0xf')]({'raw':!![],'attributes':['id',_0xae16('0x10')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xae16('0x11')](_0x599262['chatTimeout'],_0xae16('0x12'))}}});}else{return[];}})[_0xae16('0xd')](function(_0x422824){if(_0x422824&&_0x422824[_0xae16('0x13')]){_0x37905c=_['map'](_0x422824||[],'id');logger[_0xae16('0x14')](_0xae16('0x15'),_0x37905c[_0xae16('0x16')]());return db[_0xae16('0xe')][_0xae16('0x17')]({'closeReason':_0xae16('0x18'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xae16('0x19')](_0xae16('0x1a'))},{'where':{'id':_0x37905c}});}})[_0xae16('0xd')](function(){if(_0x37905c&&_0x37905c[_0xae16('0x13')]){logger[_0xae16('0x14')](_0xae16('0x1b'),_0x37905c[_0xae16('0x16')]());for(var _0x3dbfc0=0x0;_0x3dbfc0<_0x37905c['length'];_0x3dbfc0++){io[_0xae16('0x1c')]('chatInteraction:update',{'id':_0x37905c[_0x3dbfc0],'closed':!![]});}}})[_0xae16('0x1d')](function(_0x1552b0){logger[_0xae16('0x1e')](_0xae16('0x1f'),_0x1552b0?util[_0xae16('0x20')](_0x1552b0,{'showHidden':![],'depth':null}):'');});}exports[_0xae16('0x21')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0xda5a=['lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','localhost','socket.io-emitter','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','chatInteraction:update','catch','error','inspect','start'];(function(_0x552fce,_0x3f24bc){var _0x3e27a2=function(_0xc91154){while(--_0xc91154){_0x552fce['push'](_0x552fce['shift']());}};_0x3e27a2(++_0x3f24bc);}(_0xda5a,0xaf));var _0xada5=function(_0x2a8444,_0xb5ee31){_0x2a8444=_0x2a8444-0x0;var _0x53c724=_0xda5a[_0x2a8444];return _0x53c724;};'use strict';var _=require(_0xada5('0x0'));var moment=require(_0xada5('0x1'));var Redis=require(_0xada5('0x2'));var util=require(_0xada5('0x3'));var config=require(_0xada5('0x4'));var db=require(_0xada5('0x5'))['db'];var logger=require(_0xada5('0x6'))(_0xada5('0x7'));config[_0xada5('0x8')]=_['defaults'](config[_0xada5('0x8')],{'host':_0xada5('0x9'),'port':0x18eb});var io=require(_0xada5('0xa'))(new Redis(config[_0xada5('0x8')]));function closeInteractions(){var _0x3e0713=0x0;var _0xf73e6=[];return db['Setting'][_0xada5('0xb')]({'raw':!![],'attributes':['id',_0xada5('0xc')],'where':{'id':0x1}})[_0xada5('0xd')](function(_0x49286b){_0x3e0713=_0x49286b[_0xada5('0xc')];if(_0x3e0713){return db[_0xada5('0xe')][_0xada5('0xf')]({'raw':!![],'attributes':['id',_0xada5('0x10')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xada5('0x11')](_0x49286b[_0xada5('0xc')],_0xada5('0x12'))}}});}else{return[];}})[_0xada5('0xd')](function(_0x2c2cfe){if(_0x2c2cfe&&_0x2c2cfe[_0xada5('0x13')]){_0xf73e6=_[_0xada5('0x14')](_0x2c2cfe||[],'id');logger[_0xada5('0x15')](_0xada5('0x16'),_0xf73e6['join']());return db[_0xada5('0xe')][_0xada5('0x17')]({'closeReason':_0xada5('0x18'),'disposition':_0xada5('0x19'),'closed':!![],'closedAt':moment()[_0xada5('0x1a')](_0xada5('0x1b'))},{'where':{'id':_0xf73e6}});}})[_0xada5('0xd')](function(){if(_0xf73e6&&_0xf73e6['length']){logger['info'](_0xada5('0x1c'),_0xf73e6[_0xada5('0x1d')]());for(var _0x5f0bc0=0x0;_0x5f0bc0<_0xf73e6[_0xada5('0x13')];_0x5f0bc0++){io['emit'](_0xada5('0x1e'),{'id':_0xf73e6[_0x5f0bc0],'closed':!![]});}}})[_0xada5('0x1f')](function(_0x155459){logger[_0xada5('0x20')]('[CHAT]\x20Error\x20closing\x20interactions',_0x155459?util[_0xada5('0x21')](_0x155459,{'showHidden':![],'depth':null}):'');});}exports[_0xada5('0x22')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 375ce54..740e772 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed20=['../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x254f53,_0x14b5fc){var _0x4d9970=function(_0x1a2d94){while(--_0x1a2d94){_0x254f53['push'](_0x254f53['shift']());}};_0x4d9970(++_0x14b5fc);}(_0xed20,0xe4));var _0x0ed2=function(_0x5797aa,_0x3fdb39){_0x5797aa=_0x5797aa-0x0;var _0x427812=_0xed20[_0x5797aa];return _0x427812;};'use strict';function start(){var _0x411abb=require(_0x0ed2('0x0'));return _0x411abb['startAllRefreshIntervals']();}module['exports']={'intervals':{},'start':start};
\ No newline at end of file
+var _0xdc2f=['exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xdc2f,0xaf));var _0xfdc2=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0xdc2f[_0x44bcb0];return _0xfaf881;};'use strict';function start(){var _0x2b547d=require(_0xfdc2('0x0'));return _0x2b547d['startAllRefreshIntervals']();}module[_0xfdc2('0x1')]={'intervals':{},'start':start};
\ No newline at end of file
index 4f933c2..1fb597b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12c9=['length','stop','deleteJob','delete\x20cron','toRun','run\x20job','cron','active','startAt','endAt','add','start','add\x20cron','exists','isBetween','update\x20cron','stop\x20cron','run','util','lodash','moment','cron-job-manager','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','email','MailAccount','getSmtpOptions','\x22%s\x22\x20<%s>','name','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','existsSync','status','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','info','email\x20sent','catch','data','Smtp','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','Schedule','findAll','MailServerOut','CloudProvider','keys','map','keyBy','toString','difference','intersection'];(function(_0x4a78f5,_0x37a1d0){var _0x5c1cf1=function(_0x28d878){while(--_0x28d878){_0x4a78f5['push'](_0x4a78f5['shift']());}};_0x5c1cf1(++_0x37a1d0);}(_0x12c9,0x10e));var _0x912c=function(_0x14aa2d,_0x17e091){_0x14aa2d=_0x14aa2d-0x0;var _0x382624=_0x12c9[_0x14aa2d];return _0x382624;};'use strict';var fs=require('fs');var util=require(_0x912c('0x0'));var path=require('path');var _=require(_0x912c('0x1'));var moment=require(_0x912c('0x2'));var CronJobManager=require(_0x912c('0x3'));var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x912c('0x4'))(_0x912c('0x5'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x912c('0x6'));var analyticDefaultReportController=require(_0x912c('0x7'));var client=jayson['client'][_0x912c('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4600d8,_0x44662a){return function(){logger['info']('Try\x20to\x20send\x20a\x20mail\x20to',_0x4600d8[_0x912c('0x9')]);var _0x222030=!![];var _0x4eb1c5=_0x4600d8[_0x912c('0xa')][_0x912c('0xb')]();var _0x58edac={'account':_0x4eb1c5,'message':{'from':util['format'](_0x912c('0xc'),_0x4600d8[_0x912c('0xa')][_0x912c('0xd')],_0x4600d8[_0x912c('0xa')]['email']||_0x4600d8[_0x912c('0xa')]['Smtp']['user']),'to':_0x4600d8[_0x912c('0x9')],'cc':_0x4600d8['cc'],'bcc':_0x4600d8[_0x912c('0xe')],'subject':util[_0x912c('0xf')](_0x912c('0x10'),_0x44662a[_0x912c('0xd')],_0x4600d8['subtractNumber'],_0x4600d8[_0x912c('0x11')])}};var _0x5caf46=path[_0x912c('0x12')](__dirname,_0x912c('0x13'));var _0x2f89c7=_0x44662a[_0x912c('0x14')];var _0x7a3d34=util[_0x912c('0xf')](_0x912c('0x15'),path[_0x912c('0x16')](_0x44662a[_0x912c('0x14')],path[_0x912c('0x17')](_0x44662a[_0x912c('0x14')])),'zip');var _0x2ec379=path[_0x912c('0x12')](_0x5caf46,_0x2f89c7);var _0x2c8ab5=path['join'](_0x5caf46,_0x7a3d34);if(fs[_0x912c('0x18')](_0x2ec379)){_0x44662a[_0x912c('0x19')]='Sent';_0x58edac[_0x912c('0x1a')][_0x912c('0x1b')]=[{'filename':_0x2f89c7,'path':_0x2ec379}];_0x58edac[_0x912c('0x1a')][_0x912c('0x1c')]=util[_0x912c('0xf')](_0x912c('0x1d'),JSON[_0x912c('0x1e')](_0x44662a,null,0x2));}else if(fs[_0x912c('0x18')](_0x2c8ab5)){_0x44662a[_0x912c('0x19')]='Sent';_0x58edac['message'][_0x912c('0x1b')]=[{'filename':_0x7a3d34,'path':_0x2c8ab5}];}else{_0x58edac['message'][_0x912c('0x1c')]=_0x912c('0x1f');if(!_0x4600d8[_0x912c('0x20')]){_0x222030=![];logger['info'](_0x912c('0x21'));}}if(_0x222030){return client[_0x912c('0x22')](_0x912c('0x23'),_0x58edac)[_0x912c('0x24')](function(_0x5a916e){if(_0x5a916e[_0x912c('0x25')]){return logger[_0x912c('0x25')](_0x912c('0x26'),JSON[_0x912c('0x1e')](_0x5a916e));}return logger[_0x912c('0x27')](_0x912c('0x28'));})[_0x912c('0x29')](function(_0x134012){return logger[_0x912c('0x25')](_0x912c('0x26'),JSON[_0x912c('0x1e')](_0x134012));});}};}function handleError(){return function(_0x4b3334){return logger[_0x912c('0x25')](JSON[_0x912c('0x1e')](_0x4b3334));};}function handleResult(_0xebbd58){return function(_0x1d5e8a){logger[_0x912c('0x27')](_0x912c('0x2a'),JSON[_0x912c('0x1e')](_0x1d5e8a));if(_0xebbd58[_0x912c('0xa')]&&_0xebbd58['MailAccount'][_0x912c('0x2b')]&&!_[_0x912c('0x2c')](_0xebbd58[_0x912c('0x9')])){setTimeout(handleSendEmail(_0xebbd58,_0x1d5e8a),0x3c*0x3e8);}};}function handleJob(_0xbd1f95){return function(){try{if(_['isNil'](_0xbd1f95[_0x912c('0x2d')])){return logger[_0x912c('0x27')](_0x912c('0x2e'));}if(_['isNil'](_0xbd1f95[_0x912c('0x11')])){return logger[_0x912c('0x27')](_0x912c('0x2f'));}var _0x54df3b={'startDate':moment()[_0x912c('0x30')](_0xbd1f95[_0x912c('0x2d')],_0xbd1f95[_0x912c('0x11')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format'](_0x912c('0x31')),'type':_0x912c('0x32'),'output':_0xbd1f95[_0x912c('0x33')],'name':_0xbd1f95['name']};if(!_[_0x912c('0x2c')](_0xbd1f95[_0x912c('0x34')])){logger[_0x912c('0x27')](_0x912c('0x35'),_0xbd1f95['DefaultReportId']);return analyticDefaultReportController[_0x912c('0x36')]({'id':_0xbd1f95[_0x912c('0x34')]},_0x54df3b)['then'](handleResult(_0xbd1f95))[_0x912c('0x29')](handleError());}if(!_[_0x912c('0x2c')](_0xbd1f95[_0x912c('0x37')])){logger[_0x912c('0x27')]('exec\x20custom\x20report\x20id:%s',_0xbd1f95[_0x912c('0x37')]);return analyticCustomReportController['runReport']({'id':_0xbd1f95[_0x912c('0x37')]},_0x54df3b)[_0x912c('0x24')](handleResult(_0xbd1f95))[_0x912c('0x29')](handleError());}}catch(_0xbca6b4){logger[_0x912c('0x25')](JSON[_0x912c('0x1e')](_0xbca6b4));}return logger[_0x912c('0x27')]('no\x20report\x20id');};}function getJobs(_0x47fbb0){var _0x1b77d9={};if(_0x47fbb0){_0x1b77d9['id']=_0x47fbb0;}return db[_0x912c('0x38')][_0x912c('0x39')]({'where':_0x1b77d9,'include':[{'model':db[_0x912c('0xa')],'attributes':['id','name',_0x912c('0x9')],'include':[{'model':db[_0x912c('0x3a')],'as':'Smtp','include':[{'model':db[_0x912c('0x3b')],'as':'CloudProvider'}]}]}]})[_0x912c('0x24')](function(_0x411428){var _0xa6e2ac=_[_0x912c('0x3c')](manager['jobs']);var _0x155282=_[_0x912c('0x3d')](_0x411428,function(_0xdcca74){return _0xdcca74['id']['toString']();});var _0x248578=_[_0x912c('0x3e')](_0x411428,function(_0x6550e9){return _0x6550e9['id'][_0x912c('0x3f')]();});var _0x1c28dc=_0x47fbb0?_0x155282:_[_0x912c('0x40')](_0x155282,_0xa6e2ac);var _0xed709e=_[_0x912c('0x41')](_0x155282,_0xa6e2ac);var _0x5d9a68=_[_0x912c('0x40')](_0xa6e2ac,_0x155282);var _0x3b4d17;var _0x5c9576;for(_0x3b4d17=0x0;_0x3b4d17<_0x5d9a68[_0x912c('0x42')]&&!_0x47fbb0;_0x3b4d17+=0x1){_0x5c9576=_0x5d9a68[_0x3b4d17][_0x912c('0x3f')]();if(manager['exists'](_0x5c9576)){manager[_0x912c('0x43')](_0x5c9576);manager[_0x912c('0x44')](_0x5c9576);logger['info'](_0x912c('0x45'),_0x5c9576);}}logger[_0x912c('0x27')](_0x912c('0x46'),JSON[_0x912c('0x1e')](_0x1c28dc));for(_0x3b4d17=0x0;_0x3b4d17<_0x1c28dc[_0x912c('0x42')];_0x3b4d17+=0x1){_0x5c9576=_0x1c28dc[_0x3b4d17][_0x912c('0x3f')]();logger[_0x912c('0x27')]('index',_0x5c9576);if(_0x47fbb0){logger[_0x912c('0x27')]('my\x20id',_0x47fbb0);logger[_0x912c('0x27')](JSON['stringify'](_0x248578[_0x5c9576]));BPromise['resolve']()[_0x912c('0x24')](handleJob(_0x248578[_0x5c9576]));logger[_0x912c('0x27')](_0x912c('0x47'),_0x248578[_0x5c9576][_0x912c('0xd')],_0x248578[_0x5c9576][_0x912c('0x48')]);}else if(_0x248578[_0x5c9576][_0x912c('0x48')]&&_0x248578[_0x5c9576][_0x912c('0x49')]&&moment()['isBetween'](_0x248578[_0x5c9576][_0x912c('0x4a')],_0x248578[_0x5c9576][_0x912c('0x4b')])){manager[_0x912c('0x4c')](_0x5c9576,_0x248578[_0x5c9576]['cron'],handleJob(_0x248578[_0x5c9576]));manager[_0x912c('0x4d')](_0x5c9576);logger[_0x912c('0x27')](_0x912c('0x4e'),_0x248578[_0x5c9576]['name'],_0x248578[_0x5c9576]['cron']);}else if(manager[_0x912c('0x4f')](_0x5c9576)){manager[_0x912c('0x43')](_0x5c9576);manager[_0x912c('0x44')](_0x5c9576);logger[_0x912c('0x27')]('stop\x20cron',_0x248578[_0x5c9576][_0x912c('0xd')],_0x248578[_0x5c9576][_0x912c('0x48')]);}}for(_0x3b4d17=0x0,_0x5c9576;_0x3b4d17<_0xed709e[_0x912c('0x42')]&&!_0x47fbb0;_0x3b4d17+=0x1){_0x5c9576=_0xed709e[_0x3b4d17][_0x912c('0x3f')]();if(manager[_0x912c('0x4f')](_0x5c9576)){if(_0x248578[_0x5c9576]['cron']&&_0x248578[_0x5c9576]['active']&&moment()[_0x912c('0x50')](_0x248578[_0x5c9576]['startAt'],_0x248578[_0x5c9576]['endAt'])){manager['update'](_0x5c9576,_0x248578[_0x5c9576]['cron'],handleJob(_0x248578[_0x5c9576]));logger[_0x912c('0x27')](_0x912c('0x51'),_0x248578[_0x5c9576][_0x912c('0xd')],_0x248578[_0x5c9576]['cron']);}else{manager['stop'](_0x5c9576);manager[_0x912c('0x44')](_0x5c9576);logger[_0x912c('0x27')](_0x912c('0x52'),_0x248578[_0x5c9576]['name'],_0x248578[_0x5c9576][_0x912c('0x48')]);}}}})[_0x912c('0x29')](function(_0x12f114){logger[_0x912c('0x25')](JSON[_0x912c('0x1e')](_0x12f114));});}exports[_0x912c('0x53')]=function(_0x1e5105){return getJobs(_0x1e5105);};exports[_0x912c('0x4d')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0x3d4a=['MailAccount','getSmtpOptions','\x22%s\x22\x20<%s>','email','Smtp','user','format','name','subtractNumber','subtractUnit','savename','%s.%s','basename','extname','zip','join','existsSync','status','Sent','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','catch','no\x20report\x20id','Schedule','findAll','CloudProvider','keys','jobs','map','difference','intersection','length','toString','deleteJob','delete\x20cron','index','my\x20id','run\x20job','cron','active','isBetween','endAt','add','start','exists','stop\x20cron','stop','run','util','path','moment','cron-job-manager','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info'];(function(_0x2b6960,_0x231952){var _0x3cf4e7=function(_0x58e820){while(--_0x58e820){_0x2b6960['push'](_0x2b6960['shift']());}};_0x3cf4e7(++_0x231952);}(_0x3d4a,0x1e6));var _0xa3d4=function(_0x3265d9,_0x5088a3){_0x3265d9=_0x3265d9-0x0;var _0x54d89a=_0x3d4a[_0x3265d9];return _0x54d89a;};'use strict';var fs=require('fs');var util=require(_0xa3d4('0x0'));var path=require(_0xa3d4('0x1'));var _=require('lodash');var moment=require(_0xa3d4('0x2'));var CronJobManager=require(_0xa3d4('0x3'));var jayson=require('jayson/promise');var BPromise=require(_0xa3d4('0x4'));var logger=require(_0xa3d4('0x5'))(_0xa3d4('0x6'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xa3d4('0x7'));var analyticDefaultReportController=require(_0xa3d4('0x8'));var client=jayson[_0xa3d4('0x9')][_0xa3d4('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x1d9470,_0x3bbe03){return function(){logger[_0xa3d4('0xb')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x1d9470['email']);var _0x1665a9=!![];var _0x3f3f59=_0x1d9470[_0xa3d4('0xc')][_0xa3d4('0xd')]();var _0x38d2f5={'account':_0x3f3f59,'message':{'from':util['format'](_0xa3d4('0xe'),_0x1d9470['MailAccount']['name'],_0x1d9470[_0xa3d4('0xc')][_0xa3d4('0xf')]||_0x1d9470[_0xa3d4('0xc')][_0xa3d4('0x10')][_0xa3d4('0x11')]),'to':_0x1d9470[_0xa3d4('0xf')],'cc':_0x1d9470['cc'],'bcc':_0x1d9470['bcc'],'subject':util[_0xa3d4('0x12')]('Report\x20%s\x20last\x20%s\x20%s',_0x3bbe03[_0xa3d4('0x13')],_0x1d9470[_0xa3d4('0x14')],_0x1d9470[_0xa3d4('0x15')])}};var _0x339659=path['join'](__dirname,'../../files/reports');var _0x4be4fa=_0x3bbe03[_0xa3d4('0x16')];var _0x20e30b=util[_0xa3d4('0x12')](_0xa3d4('0x17'),path[_0xa3d4('0x18')](_0x3bbe03[_0xa3d4('0x16')],path[_0xa3d4('0x19')](_0x3bbe03[_0xa3d4('0x16')])),_0xa3d4('0x1a'));var _0x29143b=path[_0xa3d4('0x1b')](_0x339659,_0x4be4fa);var _0x43636e=path['join'](_0x339659,_0x20e30b);if(fs[_0xa3d4('0x1c')](_0x29143b)){_0x3bbe03[_0xa3d4('0x1d')]=_0xa3d4('0x1e');_0x38d2f5[_0xa3d4('0x1f')]['attachments']=[{'filename':_0x4be4fa,'path':_0x29143b}];_0x38d2f5[_0xa3d4('0x1f')]['text']=util['format'](_0xa3d4('0x20'),JSON[_0xa3d4('0x21')](_0x3bbe03,null,0x2));}else if(fs['existsSync'](_0x43636e)){_0x3bbe03[_0xa3d4('0x1d')]='Sent';_0x38d2f5[_0xa3d4('0x1f')]['attachments']=[{'filename':_0x20e30b,'path':_0x43636e}];}else{_0x38d2f5[_0xa3d4('0x1f')][_0xa3d4('0x22')]=_0xa3d4('0x23');if(!_0x1d9470[_0xa3d4('0x24')]){_0x1665a9=![];logger[_0xa3d4('0xb')](_0xa3d4('0x25'));}}if(_0x1665a9){return client[_0xa3d4('0x26')](_0xa3d4('0x27'),_0x38d2f5)[_0xa3d4('0x28')](function(_0x19314d){if(_0x19314d[_0xa3d4('0x29')]){return logger[_0xa3d4('0x29')](_0xa3d4('0x2a'),JSON['stringify'](_0x19314d));}return logger[_0xa3d4('0xb')](_0xa3d4('0x2b'));})['catch'](function(_0x1766d9){return logger[_0xa3d4('0x29')]('error\x20mail',JSON[_0xa3d4('0x21')](_0x1766d9));});}};}function handleError(){return function(_0xbefec9){return logger[_0xa3d4('0x29')](JSON[_0xa3d4('0x21')](_0xbefec9));};}function handleResult(_0x4286b9){return function(_0x3b48f3){logger[_0xa3d4('0xb')](_0xa3d4('0x2c'),JSON['stringify'](_0x3b48f3));if(_0x4286b9[_0xa3d4('0xc')]&&_0x4286b9[_0xa3d4('0xc')][_0xa3d4('0x10')]&&!_['isNil'](_0x4286b9['email'])){setTimeout(handleSendEmail(_0x4286b9,_0x3b48f3),0x3c*0x3e8);}};}function handleJob(_0x34eb80){return function(){try{if(_[_0xa3d4('0x2d')](_0x34eb80[_0xa3d4('0x14')])){return logger[_0xa3d4('0xb')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xa3d4('0x2d')](_0x34eb80[_0xa3d4('0x15')])){return logger[_0xa3d4('0xb')](_0xa3d4('0x2e'));}var _0x4a71cb={'startDate':moment()[_0xa3d4('0x2f')](_0x34eb80[_0xa3d4('0x14')],_0x34eb80['subtractUnit'])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0xa3d4('0x12')](_0xa3d4('0x30')),'type':_0xa3d4('0x31'),'output':_0x34eb80[_0xa3d4('0x32')],'name':_0x34eb80[_0xa3d4('0x13')]};if(!_[_0xa3d4('0x2d')](_0x34eb80[_0xa3d4('0x33')])){logger[_0xa3d4('0xb')](_0xa3d4('0x34'),_0x34eb80[_0xa3d4('0x33')]);return analyticDefaultReportController[_0xa3d4('0x35')]({'id':_0x34eb80['DefaultReportId']},_0x4a71cb)[_0xa3d4('0x28')](handleResult(_0x34eb80))['catch'](handleError());}if(!_['isNil'](_0x34eb80[_0xa3d4('0x36')])){logger[_0xa3d4('0xb')](_0xa3d4('0x37'),_0x34eb80[_0xa3d4('0x36')]);return analyticCustomReportController['runReport']({'id':_0x34eb80[_0xa3d4('0x36')]},_0x4a71cb)[_0xa3d4('0x28')](handleResult(_0x34eb80))[_0xa3d4('0x38')](handleError());}}catch(_0x236baa){logger[_0xa3d4('0x29')](JSON[_0xa3d4('0x21')](_0x236baa));}return logger[_0xa3d4('0xb')](_0xa3d4('0x39'));};}function getJobs(_0x365e04){var _0x582247={};if(_0x365e04){_0x582247['id']=_0x365e04;}return db[_0xa3d4('0x3a')][_0xa3d4('0x3b')]({'where':_0x582247,'include':[{'model':db[_0xa3d4('0xc')],'attributes':['id','name',_0xa3d4('0xf')],'include':[{'model':db['MailServerOut'],'as':_0xa3d4('0x10'),'include':[{'model':db[_0xa3d4('0x3c')],'as':'CloudProvider'}]}]}]})[_0xa3d4('0x28')](function(_0x4e6c15){var _0x1d37cc=_[_0xa3d4('0x3d')](manager[_0xa3d4('0x3e')]);var _0x198329=_[_0xa3d4('0x3f')](_0x4e6c15,function(_0x325edc){return _0x325edc['id']['toString']();});var _0x121840=_['keyBy'](_0x4e6c15,function(_0x4fce64){return _0x4fce64['id']['toString']();});var _0x28e92a=_0x365e04?_0x198329:_[_0xa3d4('0x40')](_0x198329,_0x1d37cc);var _0x3b4c84=_[_0xa3d4('0x41')](_0x198329,_0x1d37cc);var _0x3ec778=_['difference'](_0x1d37cc,_0x198329);var _0x62e54b;var _0x5df501;for(_0x62e54b=0x0;_0x62e54b<_0x3ec778[_0xa3d4('0x42')]&&!_0x365e04;_0x62e54b+=0x1){_0x5df501=_0x3ec778[_0x62e54b][_0xa3d4('0x43')]();if(manager['exists'](_0x5df501)){manager['stop'](_0x5df501);manager[_0xa3d4('0x44')](_0x5df501);logger['info'](_0xa3d4('0x45'),_0x5df501);}}logger['info']('toRun',JSON['stringify'](_0x28e92a));for(_0x62e54b=0x0;_0x62e54b<_0x28e92a[_0xa3d4('0x42')];_0x62e54b+=0x1){_0x5df501=_0x28e92a[_0x62e54b][_0xa3d4('0x43')]();logger['info'](_0xa3d4('0x46'),_0x5df501);if(_0x365e04){logger[_0xa3d4('0xb')](_0xa3d4('0x47'),_0x365e04);logger[_0xa3d4('0xb')](JSON[_0xa3d4('0x21')](_0x121840[_0x5df501]));BPromise['resolve']()[_0xa3d4('0x28')](handleJob(_0x121840[_0x5df501]));logger[_0xa3d4('0xb')](_0xa3d4('0x48'),_0x121840[_0x5df501][_0xa3d4('0x13')],_0x121840[_0x5df501]['cron']);}else if(_0x121840[_0x5df501][_0xa3d4('0x49')]&&_0x121840[_0x5df501][_0xa3d4('0x4a')]&&moment()[_0xa3d4('0x4b')](_0x121840[_0x5df501]['startAt'],_0x121840[_0x5df501][_0xa3d4('0x4c')])){manager[_0xa3d4('0x4d')](_0x5df501,_0x121840[_0x5df501][_0xa3d4('0x49')],handleJob(_0x121840[_0x5df501]));manager[_0xa3d4('0x4e')](_0x5df501);logger[_0xa3d4('0xb')]('add\x20cron',_0x121840[_0x5df501][_0xa3d4('0x13')],_0x121840[_0x5df501][_0xa3d4('0x49')]);}else if(manager[_0xa3d4('0x4f')](_0x5df501)){manager['stop'](_0x5df501);manager[_0xa3d4('0x44')](_0x5df501);logger[_0xa3d4('0xb')](_0xa3d4('0x50'),_0x121840[_0x5df501][_0xa3d4('0x13')],_0x121840[_0x5df501][_0xa3d4('0x49')]);}}for(_0x62e54b=0x0,_0x5df501;_0x62e54b<_0x3b4c84[_0xa3d4('0x42')]&&!_0x365e04;_0x62e54b+=0x1){_0x5df501=_0x3b4c84[_0x62e54b]['toString']();if(manager['exists'](_0x5df501)){if(_0x121840[_0x5df501][_0xa3d4('0x49')]&&_0x121840[_0x5df501][_0xa3d4('0x4a')]&&moment()['isBetween'](_0x121840[_0x5df501]['startAt'],_0x121840[_0x5df501][_0xa3d4('0x4c')])){manager['update'](_0x5df501,_0x121840[_0x5df501][_0xa3d4('0x49')],handleJob(_0x121840[_0x5df501]));logger[_0xa3d4('0xb')]('update\x20cron',_0x121840[_0x5df501]['name'],_0x121840[_0x5df501][_0xa3d4('0x49')]);}else{manager[_0xa3d4('0x51')](_0x5df501);manager[_0xa3d4('0x44')](_0x5df501);logger['info'](_0xa3d4('0x50'),_0x121840[_0x5df501][_0xa3d4('0x13')],_0x121840[_0x5df501][_0xa3d4('0x49')]);}}}})['catch'](function(_0x59367a){logger[_0xa3d4('0x29')](JSON['stringify'](_0x59367a));});}exports[_0xa3d4('0x52')]=function(_0x3e1588){return getJobs(_0x3e1588);};exports[_0xa3d4('0x4e')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index f68a8e7..f278625 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bb4=['length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','bucket','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','Sentiment','catch','name','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribe','Transcribe\x20not\x20configured','transcribeAccountId','push','all','SequelizeValidationError','error','start','lodash','aws-sdk','util','bluebird','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','fileText','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','transcripts'];(function(_0x57e2fd,_0x54e75b){var _0x54022e=function(_0x19b41b){while(--_0x19b41b){_0x57e2fd['push'](_0x57e2fd['shift']());}};_0x54022e(++_0x54e75b);}(_0x0bb4,0x77));var _0x40bb=function(_0x13a147,_0x461113){_0x13a147=_0x13a147-0x0;var _0x8853d0=_0x0bb4[_0x13a147];return _0x8853d0;};var _=require(_0x40bb('0x0'));var AWS=require(_0x40bb('0x1'));var rp=require('request-promise');var util=require(_0x40bb('0x2'));var BPromise=require(_0x40bb('0x3'));var db=require(_0x40bb('0x4'))['db'];var logger=require(_0x40bb('0x5'))('transcribe');function getTranscriptionJob(_0x10646e,_0x54fef0,_0x266cf4,_0x57a115){return new Promise(function(_0xa8c628,_0xe75667){var _0x4d15f6=new AWS[(_0x40bb('0x6'))]({'accessKeyId':_0x54fef0,'secretAccessKey':_0x10646e,'region':_0x266cf4});_0x4d15f6[_0x40bb('0x7')]({'TranscriptionJobName':_0x57a115},function(_0x50d70f,_0x1dc35d){if(_0x50d70f){return _0xe75667(_0x50d70f);}else{return _0xa8c628(_0x1dc35d);}});});}function sentiment(_0x5d98d0,_0x3e8ef4,_0x3bc5c5,_0x1ee54b,_0x35095d){return new Promise(function(_0x44c1b5,_0x3ee596){var _0x3a86c3=new AWS[(_0x40bb('0x8'))]({'accessKeyId':_0x3e8ef4,'secretAccessKey':_0x5d98d0,'region':_0x3bc5c5});_0x3a86c3[_0x40bb('0x9')]({'Text':_0x1ee54b,'LanguageCode':_0x35095d[_0x40bb('0xa')](0x0,0x2)},function(_0x23bac7,_0x774cef){if(_0x23bac7){return _0x3ee596(_0x23bac7);}else{return _0x44c1b5(_0x774cef);}});});}function checkTranscribeJob(_0x1505a9,_0x344b09,_0x436966){var _0x2a3ae5;return new BPromise(function(_0x713bae,_0x4c98ae){logger['info'](util[_0x40bb('0xb')](_0x40bb('0xc'),_0x1505a9['id'],_0x1505a9[_0x40bb('0xd')]));return getTranscriptionJob(_0x436966[_0x40bb('0xe')],_0x436966[_0x40bb('0xf')],_0x344b09[_0x40bb('0x10')],_0x1505a9[_0x40bb('0xd')])[_0x40bb('0x11')](function(_0x4a177c){logger[_0x40bb('0x12')](util[_0x40bb('0xb')](_0x40bb('0x13'),_0x1505a9['id'],_0x1505a9[_0x40bb('0xd')],_0x4a177c[_0x40bb('0x14')]['TranscriptionJobStatus']));if(!_0x1505a9[_0x40bb('0x15')]){switch(_0x4a177c[_0x40bb('0x14')][_0x40bb('0x16')]){case _0x40bb('0x17'):var _0x77e2d2={'transcribeStatus':_0x4a177c[_0x40bb('0x14')][_0x40bb('0x16')],'fileUri':_0x4a177c['TranscriptionJob'][_0x40bb('0x18')][_0x40bb('0x19')]};logger[_0x40bb('0x12')](util[_0x40bb('0xb')](_0x40bb('0x1a'),_0x1505a9['id']));return rp({'uri':_0x4a177c[_0x40bb('0x14')][_0x40bb('0x18')][_0x40bb('0x19')],'json':!![]})[_0x40bb('0x11')](function(_0x1f0ac7){logger[_0x40bb('0x12')](util[_0x40bb('0xb')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x1505a9['id']));if(_0x1f0ac7&&_0x1f0ac7[_0x40bb('0x1b')]&&_0x1f0ac7[_0x40bb('0x1b')][_0x40bb('0x1c')]&&_0x1f0ac7[_0x40bb('0x1b')][_0x40bb('0x1c')][_0x40bb('0x1d')]){_0x77e2d2[_0x40bb('0x15')]='';for(var _0x2a0278=0x0;_0x2a0278<_0x1f0ac7[_0x40bb('0x1b')][_0x40bb('0x1c')][_0x40bb('0x1d')];_0x2a0278++){_0x77e2d2['fileText']+=_0x1f0ac7['results'][_0x40bb('0x1c')][_0x2a0278][_0x40bb('0x1e')]+'';}}return _0x1505a9[_0x40bb('0x1f')](_0x77e2d2);})['then'](function(){logger[_0x40bb('0x12')](util[_0x40bb('0xb')](_0x40bb('0x20'),_0x1505a9['id']));if(!_0x1505a9[_0x40bb('0x21')]){throw new db[(_0x40bb('0x22'))][(_0x40bb('0x23'))](_0x40bb('0x24'));}if(!_0x344b09[_0x40bb('0x25')]||!_0x344b09[_0x40bb('0x26')]||!_0x344b09['sentimentRegion']||!_0x344b09[_0x40bb('0x27')]||!_0x344b09[_0x40bb('0x28')]){throw new db['Sequelize'][(_0x40bb('0x23'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x77e2d2[_0x40bb('0x15')]){throw new Error('Transcript\x20not\x20available');}if(_0x344b09['sentimentAccountId']===_0x436966['id']){return _0x436966;}else{return db[_0x40bb('0x29')][_0x40bb('0x2a')]({'where':{'id':_settings[_0x40bb('0x26')]}});}})['then'](function(_0x1ce1fe){if(!_0x1ce1fe){throw new db[(_0x40bb('0x22'))][(_0x40bb('0x23'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x1ce1fe[_0x40bb('0xe')]||!_0x1ce1fe[_0x40bb('0xf')]){throw new db[(_0x40bb('0x22'))][(_0x40bb('0x23'))](_0x40bb('0x2b'));}_0x2a3ae5=_0x1ce1fe;logger[_0x40bb('0x12')](util[_0x40bb('0xb')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x1505a9['id']));return sentiment(_0x2a3ae5['data1'],_0x2a3ae5[_0x40bb('0xf')],_0x344b09['sentimentRegion'],_0x77e2d2[_0x40bb('0x15')],_0x344b09[_0x40bb('0x27')]);})[_0x40bb('0x11')](function(_0x52f5f1){logger[_0x40bb('0x12')](util['format'](_0x40bb('0x2c'),_0x1505a9['id']));return _0x1505a9[_0x40bb('0x1f')]({'sentiment':_0x52f5f1['Sentiment'],'sPositive':_0x52f5f1[_0x40bb('0x2d')][_0x40bb('0x2e')],'sNegative':_0x52f5f1['SentimentScore'][_0x40bb('0x2f')],'sMixed':_0x52f5f1[_0x40bb('0x2d')][_0x40bb('0x30')],'sNeutral':_0x52f5f1['SentimentScore'][_0x40bb('0x31')]});})[_0x40bb('0x11')](function(){logger['info'](util['format'](_0x40bb('0x20'),_0x1505a9['id']));_0x713bae();});case'FAILED':return _0x1505a9[_0x40bb('0x1f')]({'transcribeStatus':_0x40bb('0x32'),'failureReason':_0x4a177c[_0x40bb('0x14')][_0x40bb('0x33')]})['then'](function(){logger['info'](util['format'](_0x40bb('0x20'),_0x1505a9['id']));_0x713bae();});default:logger[_0x40bb('0x12')](util['format'](_0x40bb('0x34'),_0x1505a9['id']));break;}}else{return BPromise[_0x40bb('0x35')]()[_0x40bb('0x11')](function(){if(!_0x1505a9[_0x40bb('0x21')]){throw new db['Sequelize'][(_0x40bb('0x23'))](_0x40bb('0x24'));}if(!_0x344b09[_0x40bb('0x25')]||!_0x344b09[_0x40bb('0x26')]||!_0x344b09[_0x40bb('0x36')]||!_0x344b09['language']||!_0x344b09['bucket']){throw new db['Sequelize'][(_0x40bb('0x23'))](_0x40bb('0x37'));}if(!_0x1505a9['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x344b09[_0x40bb('0x26')]===_0x436966['id']){return _0x436966;}else{return db[_0x40bb('0x29')][_0x40bb('0x2a')]({'where':{'id':_settings[_0x40bb('0x26')]}});}})[_0x40bb('0x11')](function(_0x194728){if(!_0x194728){throw new db['Sequelize'][(_0x40bb('0x23'))](_0x40bb('0x38'));}if(!_0x194728['data1']||!_0x194728['data2']){throw new db['Sequelize']['ValidationError'](_0x40bb('0x2b'));}_0x2a3ae5=_0x194728;logger[_0x40bb('0x12')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x1505a9['id']));return sentiment(_0x2a3ae5[_0x40bb('0xe')],_0x2a3ae5[_0x40bb('0xf')],_0x344b09[_0x40bb('0x36')],_0x1505a9['fileText'],_0x344b09['language']);})[_0x40bb('0x11')](function(_0x21fdbe){logger[_0x40bb('0x12')](util['format'](_0x40bb('0x2c'),_0x1505a9['id']));return _0x1505a9[_0x40bb('0x1f')]({'sentiment':_0x21fdbe[_0x40bb('0x39')],'sPositive':_0x21fdbe[_0x40bb('0x2d')]['Positive'],'sNegative':_0x21fdbe[_0x40bb('0x2d')][_0x40bb('0x2f')],'sMixed':_0x21fdbe[_0x40bb('0x2d')][_0x40bb('0x30')],'sNeutral':_0x21fdbe['SentimentScore'][_0x40bb('0x31')],'transcribeStatus':_0x40bb('0x17')});})[_0x40bb('0x11')](function(){logger['info'](util[_0x40bb('0xb')](_0x40bb('0x20'),_0x1505a9['id']));_0x713bae();});}})[_0x40bb('0x3a')](function(_0x138a72){if(_0x138a72){if(!_0x138a72[_0x40bb('0x3b')]||_0x138a72[_0x40bb('0x3b')]!=='SequelizeValidationError'){logger['error'](util[_0x40bb('0xb')](_0x40bb('0x3c'),_0x1505a9['id']),util[_0x40bb('0x3d')](_0x138a72,{'showHidden':![],'depth':null}));}}_0x713bae();});});}function checkTranscribe(){var _0x577c05;var _0x21c211;var _0x3302ea;return db[_0x40bb('0x3e')][_0x40bb('0x3f')]({'where':{'transcribeStatus':'IN_PROGRESS'}})['then'](function(_0x5ae6f7){if(!_0x5ae6f7||!_0x5ae6f7['length']){throw new db[(_0x40bb('0x22'))][(_0x40bb('0x23'))](_0x40bb('0x40'));}_0x577c05=_0x5ae6f7;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0x40bb('0x11')](function(_0x757421){if(!_0x757421){throw new db[(_0x40bb('0x22'))][(_0x40bb('0x23'))](_0x40bb('0x41'));}_0x21c211=_0x757421;if(!_0x21c211[_0x40bb('0x42')]||!_0x21c211['transcribeAccountId']||!_0x21c211[_0x40bb('0x10')]||!_0x21c211[_0x40bb('0x27')]||!_0x21c211['bucket']){throw new db[(_0x40bb('0x22'))][(_0x40bb('0x23'))](_0x40bb('0x43'));}return db[_0x40bb('0x29')][_0x40bb('0x2a')]({'where':{'id':_0x21c211[_0x40bb('0x44')]}});})['then'](function(_0x42e8f7){if(!_0x42e8f7){throw new db[(_0x40bb('0x22'))][(_0x40bb('0x23'))](_0x40bb('0x38'));}if(!_0x42e8f7['data1']||!_0x42e8f7[_0x40bb('0xf')]){throw new db[(_0x40bb('0x22'))][(_0x40bb('0x23'))](_0x40bb('0x2b'));}_0x3302ea=_0x42e8f7;var _0x5eca2d=[];_0x577c05['forEach'](function(_0x3c6821){_0x5eca2d[_0x40bb('0x45')](checkTranscribeJob(_0x3c6821,_0x21c211,_0x3302ea));});return BPromise[_0x40bb('0x46')](_0x5eca2d);})[_0x40bb('0x3a')](function(_0x307bf0){if(_0x307bf0){if(!_0x307bf0[_0x40bb('0x3b')]||_0x307bf0['name']!==_0x40bb('0x47')){logger[_0x40bb('0x48')](util[_0x40bb('0x3d')](_0x307bf0,{'showHidden':![],'depth':null}));}}});}exports[_0x40bb('0x49')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0x9af1=['bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','Transcript\x20not\x20available','findOne','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribe','forEach','all','catch','error','start','lodash','aws-sdk','request-promise','bluebird','../../mysqldb','../../config/logger','TranscribeService','Comprehend','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','transcribeRegion','transcribeName','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','TranscriptFileUri','format','[RECORDING:%d]\x20Get\x20transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion'];(function(_0x4adfe0,_0xbeeeb2){var _0x5ddc85=function(_0x240e65){while(--_0x240e65){_0x4adfe0['push'](_0x4adfe0['shift']());}};_0x5ddc85(++_0xbeeeb2);}(_0x9af1,0x68));var _0x19af=function(_0x6b416,_0x532d76){_0x6b416=_0x6b416-0x0;var _0x32bb18=_0x9af1[_0x6b416];return _0x32bb18;};var _=require(_0x19af('0x0'));var AWS=require(_0x19af('0x1'));var rp=require(_0x19af('0x2'));var util=require('util');var BPromise=require(_0x19af('0x3'));var db=require(_0x19af('0x4'))['db'];var logger=require(_0x19af('0x5'))('transcribe');function getTranscriptionJob(_0x4a3621,_0x3506ac,_0x4feb94,_0x11c0fc){return new Promise(function(_0x157fc9,_0x41a50f){var _0x46c2fe=new AWS[(_0x19af('0x6'))]({'accessKeyId':_0x3506ac,'secretAccessKey':_0x4a3621,'region':_0x4feb94});_0x46c2fe['getTranscriptionJob']({'TranscriptionJobName':_0x11c0fc},function(_0x3e7b4e,_0x4bd19e){if(_0x3e7b4e){return _0x41a50f(_0x3e7b4e);}else{return _0x157fc9(_0x4bd19e);}});});}function sentiment(_0x43c3ff,_0x55478b,_0x2720c7,_0x3f90b6,_0x49e7bc){return new Promise(function(_0x57a520,_0x1e3b6a){var _0x5d7f42=new AWS[(_0x19af('0x7'))]({'accessKeyId':_0x55478b,'secretAccessKey':_0x43c3ff,'region':_0x2720c7});_0x5d7f42['detectSentiment']({'Text':_0x3f90b6,'LanguageCode':_0x49e7bc[_0x19af('0x8')](0x0,0x2)},function(_0xb3be9,_0x47846d){if(_0xb3be9){return _0x1e3b6a(_0xb3be9);}else{return _0x57a520(_0x47846d);}});});}function checkTranscribeJob(_0x2fe283,_0x5c9096,_0x527040){var _0x2408e6;return new BPromise(function(_0x22d2f3,_0x54f6bc){logger[_0x19af('0x9')](util['format'](_0x19af('0xa'),_0x2fe283['id'],_0x2fe283['transcribeName']));return getTranscriptionJob(_0x527040[_0x19af('0xb')],_0x527040['data2'],_0x5c9096[_0x19af('0xc')],_0x2fe283[_0x19af('0xd')])['then'](function(_0x1c2ac2){logger[_0x19af('0x9')](util['format'](_0x19af('0xe'),_0x2fe283['id'],_0x2fe283['transcribeName'],_0x1c2ac2[_0x19af('0xf')][_0x19af('0x10')]));if(!_0x2fe283[_0x19af('0x11')]){switch(_0x1c2ac2['TranscriptionJob'][_0x19af('0x10')]){case _0x19af('0x12'):var _0x3b34d6={'transcribeStatus':_0x1c2ac2[_0x19af('0xf')]['TranscriptionJobStatus'],'fileUri':_0x1c2ac2[_0x19af('0xf')]['Transcript'][_0x19af('0x13')]};logger['info'](util[_0x19af('0x14')](_0x19af('0x15'),_0x2fe283['id']));return rp({'uri':_0x1c2ac2[_0x19af('0xf')]['Transcript'][_0x19af('0x13')],'json':!![]})[_0x19af('0x16')](function(_0xf05f34){logger[_0x19af('0x9')](util[_0x19af('0x14')](_0x19af('0x17'),_0x2fe283['id']));if(_0xf05f34&&_0xf05f34['results']&&_0xf05f34[_0x19af('0x18')]['transcripts']&&_0xf05f34[_0x19af('0x18')][_0x19af('0x19')][_0x19af('0x1a')]){_0x3b34d6[_0x19af('0x11')]='';for(var _0x125a48=0x0;_0x125a48<_0xf05f34[_0x19af('0x18')][_0x19af('0x19')][_0x19af('0x1a')];_0x125a48++){_0x3b34d6['fileText']+=_0xf05f34[_0x19af('0x18')][_0x19af('0x19')][_0x125a48][_0x19af('0x1b')]+'';}}return _0x2fe283[_0x19af('0x1c')](_0x3b34d6);})['then'](function(){logger[_0x19af('0x9')](util[_0x19af('0x14')](_0x19af('0x1d'),_0x2fe283['id']));if(!_0x2fe283[_0x19af('0x1e')]){throw new db[(_0x19af('0x1f'))][(_0x19af('0x20'))](_0x19af('0x21'));}if(!_0x5c9096['sentiment']||!_0x5c9096[_0x19af('0x22')]||!_0x5c9096[_0x19af('0x23')]||!_0x5c9096['language']||!_0x5c9096[_0x19af('0x24')]){throw new db[(_0x19af('0x1f'))]['ValidationError'](_0x19af('0x25'));}if(!_0x3b34d6[_0x19af('0x11')]){throw new Error('Transcript\x20not\x20available');}if(_0x5c9096[_0x19af('0x22')]===_0x527040['id']){return _0x527040;}else{return db[_0x19af('0x26')]['findOne']({'where':{'id':_settings[_0x19af('0x22')]}});}})[_0x19af('0x16')](function(_0x9396c4){if(!_0x9396c4){throw new db['Sequelize'][(_0x19af('0x20'))](_0x19af('0x27'));}if(!_0x9396c4[_0x19af('0xb')]||!_0x9396c4[_0x19af('0x28')]){throw new db[(_0x19af('0x1f'))]['ValidationError'](_0x19af('0x29'));}_0x2408e6=_0x9396c4;logger[_0x19af('0x9')](util['format'](_0x19af('0x2a'),_0x2fe283['id']));return sentiment(_0x2408e6[_0x19af('0xb')],_0x2408e6['data2'],_0x5c9096[_0x19af('0x23')],_0x3b34d6[_0x19af('0x11')],_0x5c9096[_0x19af('0x2b')]);})['then'](function(_0x1b01e8){logger['info'](util[_0x19af('0x14')](_0x19af('0x2c'),_0x2fe283['id']));return _0x2fe283[_0x19af('0x1c')]({'sentiment':_0x1b01e8[_0x19af('0x2d')],'sPositive':_0x1b01e8[_0x19af('0x2e')][_0x19af('0x2f')],'sNegative':_0x1b01e8[_0x19af('0x2e')][_0x19af('0x30')],'sMixed':_0x1b01e8['SentimentScore']['Mixed'],'sNeutral':_0x1b01e8[_0x19af('0x2e')][_0x19af('0x31')]});})['then'](function(){logger[_0x19af('0x9')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2fe283['id']));_0x22d2f3();});case _0x19af('0x32'):return _0x2fe283['update']({'transcribeStatus':_0x19af('0x32'),'failureReason':_0x1c2ac2['TranscriptionJob'][_0x19af('0x33')]})['then'](function(){logger['info'](util[_0x19af('0x14')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2fe283['id']));_0x22d2f3();});default:logger[_0x19af('0x9')](util['format'](_0x19af('0x34'),_0x2fe283['id']));break;}}else{return BPromise[_0x19af('0x35')]()['then'](function(){if(!_0x2fe283[_0x19af('0x1e')]){throw new db[(_0x19af('0x1f'))][(_0x19af('0x20'))](_0x19af('0x21'));}if(!_0x5c9096[_0x19af('0x36')]||!_0x5c9096[_0x19af('0x22')]||!_0x5c9096['sentimentRegion']||!_0x5c9096[_0x19af('0x2b')]||!_0x5c9096[_0x19af('0x24')]){throw new db[(_0x19af('0x1f'))][(_0x19af('0x20'))](_0x19af('0x25'));}if(!_0x2fe283['fileText']){throw new Error(_0x19af('0x37'));}if(_0x5c9096[_0x19af('0x22')]===_0x527040['id']){return _0x527040;}else{return db[_0x19af('0x26')][_0x19af('0x38')]({'where':{'id':_settings[_0x19af('0x22')]}});}})['then'](function(_0x2daa0a){if(!_0x2daa0a){throw new db[(_0x19af('0x1f'))][(_0x19af('0x20'))](_0x19af('0x27'));}if(!_0x2daa0a[_0x19af('0xb')]||!_0x2daa0a['data2']){throw new db[(_0x19af('0x1f'))][(_0x19af('0x20'))]('Cloud\x20Provider\x20not\x20configured');}_0x2408e6=_0x2daa0a;logger['info'](util[_0x19af('0x14')](_0x19af('0x2a'),_0x2fe283['id']));return sentiment(_0x2408e6[_0x19af('0xb')],_0x2408e6[_0x19af('0x28')],_0x5c9096[_0x19af('0x23')],_0x2fe283[_0x19af('0x11')],_0x5c9096[_0x19af('0x2b')]);})[_0x19af('0x16')](function(_0x1f0bd3){logger[_0x19af('0x9')](util[_0x19af('0x14')](_0x19af('0x2c'),_0x2fe283['id']));return _0x2fe283['update']({'sentiment':_0x1f0bd3[_0x19af('0x2d')],'sPositive':_0x1f0bd3['SentimentScore'][_0x19af('0x2f')],'sNegative':_0x1f0bd3[_0x19af('0x2e')][_0x19af('0x30')],'sMixed':_0x1f0bd3[_0x19af('0x2e')]['Mixed'],'sNeutral':_0x1f0bd3[_0x19af('0x2e')][_0x19af('0x31')],'transcribeStatus':_0x19af('0x12')});})['then'](function(){logger[_0x19af('0x9')](util[_0x19af('0x14')](_0x19af('0x1d'),_0x2fe283['id']));_0x22d2f3();});}})['catch'](function(_0x366933){if(_0x366933){if(!_0x366933[_0x19af('0x39')]||_0x366933['name']!==_0x19af('0x3a')){logger['error'](util[_0x19af('0x14')](_0x19af('0x3b'),_0x2fe283['id']),util['inspect'](_0x366933,{'showHidden':![],'depth':null}));}}_0x22d2f3();});});}function checkTranscribe(){var _0x237c4b;var _0x4e3f1f;var _0xffa8f4;return db['VoiceRecording'][_0x19af('0x3c')]({'where':{'transcribeStatus':_0x19af('0x3d')}})[_0x19af('0x16')](function(_0x554c06){if(!_0x554c06||!_0x554c06[_0x19af('0x1a')]){throw new db[(_0x19af('0x1f'))][(_0x19af('0x20'))](_0x19af('0x3e'));}_0x237c4b=_0x554c06;return db[_0x19af('0x3f')]['findOne']({'where':{'id':0x1}});})[_0x19af('0x16')](function(_0x39b457){if(!_0x39b457){throw new db[(_0x19af('0x1f'))][(_0x19af('0x20'))]('Settings\x20not\x20available');}_0x4e3f1f=_0x39b457;if(!_0x4e3f1f[_0x19af('0x40')]||!_0x4e3f1f['transcribeAccountId']||!_0x4e3f1f[_0x19af('0xc')]||!_0x4e3f1f[_0x19af('0x2b')]||!_0x4e3f1f[_0x19af('0x24')]){throw new db[(_0x19af('0x1f'))][(_0x19af('0x20'))]('Transcribe\x20not\x20configured');}return db['CloudProvider'][_0x19af('0x38')]({'where':{'id':_0x4e3f1f['transcribeAccountId']}});})['then'](function(_0x1ea572){if(!_0x1ea572){throw new db[(_0x19af('0x1f'))][(_0x19af('0x20'))](_0x19af('0x27'));}if(!_0x1ea572['data1']||!_0x1ea572['data2']){throw new db[(_0x19af('0x1f'))][(_0x19af('0x20'))](_0x19af('0x29'));}_0xffa8f4=_0x1ea572;var _0x7f84e=[];_0x237c4b[_0x19af('0x41')](function(_0x5eb9c1){_0x7f84e['push'](checkTranscribeJob(_0x5eb9c1,_0x4e3f1f,_0xffa8f4));});return BPromise[_0x19af('0x42')](_0x7f84e);})[_0x19af('0x43')](function(_0x522a93){if(_0x522a93){if(!_0x522a93['name']||_0x522a93[_0x19af('0x39')]!==_0x19af('0x3a')){logger[_0x19af('0x44')](util['inspect'](_0x522a93,{'showHidden':![],'depth':null}));}}});}exports[_0x19af('0x45')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
index ba014cb..f680c41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49c1=['whatsappInteraction:update','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','findAll','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','emit'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x49c1,0x154));var _0x149c=function(_0x4b9422,_0x4aac94){_0x4b9422=_0x4b9422-0x0;var _0x12a277=_0x49c1[_0x4b9422];return _0x12a277;};'use strict';var _=require(_0x149c('0x0'));var moment=require(_0x149c('0x1'));var Redis=require('ioredis');var util=require(_0x149c('0x2'));var config=require(_0x149c('0x3'));var db=require(_0x149c('0x4'))['db'];var logger=require(_0x149c('0x5'))(_0x149c('0x6'));config[_0x149c('0x7')]=_[_0x149c('0x8')](config[_0x149c('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x2561c4=[];return db['WhatsappInteraction'][_0x149c('0x9')]({'raw':!![],'attributes':['id',_0x149c('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x149c('0xb')](0x18,_0x149c('0xc'))}}})[_0x149c('0xd')](function(_0x373218){if(_0x373218&&_0x373218[_0x149c('0xe')]){_0x2561c4=_[_0x149c('0xf')](_0x373218||[],'id');logger[_0x149c('0x10')](_0x149c('0x11'),_0x2561c4[_0x149c('0x12')]());return db['WhatsappInteraction'][_0x149c('0x13')]({'closeReason':_0x149c('0x14'),'disposition':_0x149c('0x15'),'closed':!![],'closedAt':moment()['format'](_0x149c('0x16'))},{'where':{'id':_0x2561c4}});}})['then'](function(){if(_0x2561c4&&_0x2561c4[_0x149c('0xe')]){logger['info']('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x2561c4[_0x149c('0x12')]());for(var _0x4f926c=0x0;_0x4f926c<_0x2561c4[_0x149c('0xe')];_0x4f926c++){io[_0x149c('0x17')](_0x149c('0x18'),{'id':_0x2561c4[_0x4f926c],'closed':!![]});}}})['catch'](function(_0x18f136){logger[_0x149c('0x19')](_0x149c('0x1a'),_0x18f136?util[_0x149c('0x1b')](_0x18f136,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0xd6c9=['defaults','redis','localhost','socket.io-emitter','findAll','lastMsgAt','hours','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','system','timeout','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','catch','error','inspect','start','lodash','moment','util','../../config/environment','../../mysqldb','schedule'];(function(_0x1b33c2,_0x4500d3){var _0x56d29c=function(_0x5edf05){while(--_0x5edf05){_0x1b33c2['push'](_0x1b33c2['shift']());}};_0x56d29c(++_0x4500d3);}(_0xd6c9,0xa2));var _0x9d6c=function(_0x30fd21,_0x243160){_0x30fd21=_0x30fd21-0x0;var _0x9b474a=_0xd6c9[_0x30fd21];return _0x9b474a;};'use strict';var _=require(_0x9d6c('0x0'));var moment=require(_0x9d6c('0x1'));var Redis=require('ioredis');var util=require(_0x9d6c('0x2'));var config=require(_0x9d6c('0x3'));var db=require(_0x9d6c('0x4'))['db'];var logger=require('../logger')(_0x9d6c('0x5'));config['redis']=_[_0x9d6c('0x6')](config[_0x9d6c('0x7')],{'host':_0x9d6c('0x8'),'port':0x18eb});var io=require(_0x9d6c('0x9'))(new Redis(config[_0x9d6c('0x7')]));function closeInteractions(){var _0x1f98aa=[];return db['WhatsappInteraction'][_0x9d6c('0xa')]({'raw':!![],'attributes':['id',_0x9d6c('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x9d6c('0xc'))}}})['then'](function(_0x54d6e5){if(_0x54d6e5&&_0x54d6e5[_0x9d6c('0xd')]){_0x1f98aa=_[_0x9d6c('0xe')](_0x54d6e5||[],'id');logger[_0x9d6c('0xf')](_0x9d6c('0x10'),_0x1f98aa['join']());return db['WhatsappInteraction'][_0x9d6c('0x11')]({'closeReason':_0x9d6c('0x12'),'disposition':_0x9d6c('0x13'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x1f98aa}});}})[_0x9d6c('0x14')](function(){if(_0x1f98aa&&_0x1f98aa['length']){logger['info'](_0x9d6c('0x15'),_0x1f98aa[_0x9d6c('0x16')]());for(var _0x3b6f55=0x0;_0x3b6f55<_0x1f98aa[_0x9d6c('0xd')];_0x3b6f55++){io[_0x9d6c('0x17')]('whatsappInteraction:update',{'id':_0x1f98aa[_0x3b6f55],'closed':!![]});}}})[_0x9d6c('0x18')](function(_0x4cd119){logger[_0x9d6c('0x19')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x4cd119?util[_0x9d6c('0x1a')](_0x4cd119,{'showHidden':![],'depth':null}):'');});}exports[_0x9d6c('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index f65c3b7..733e5b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c83=['CmHopper','bulkCreate','hopper1','log','contacts2','catch','util','../mysqldb','push','Innocenzo','now','Biondo','innocenzo.biondo','@xcally.com','CmContact','destroy','then','finished\x20populating','contacts1'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5c83,0x9e));var _0x35c8=function(_0x385467,_0x298239){_0x385467=_0x385467-0x0;var _0x5ed67e=_0x5c83[_0x385467];return _0x5ed67e;};'use strict';var util=require(_0x35c8('0x0'));var db=require(_0x35c8('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x35c8('0x2')]({'id':i,'firstName':_0x35c8('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x35c8('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x35c8('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x35c8('0x4')](),'updatedAt':Date[_0x35c8('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x35c8('0x2')]({'id':i,'firstName':_0x35c8('0x3')+i,'lastName':_0x35c8('0x5')+i,'phone':0xf879fb460+i,'email':_0x35c8('0x6')+i+_0x35c8('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x35c8('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x35c8('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x35c8('0x4')](),'updatedAt':Date[_0x35c8('0x4')]()});}db[_0x35c8('0x8')][_0x35c8('0x9')]({'where':{}})[_0x35c8('0xa')](function(){return db[_0x35c8('0x8')]['bulkCreate'](contacts);})[_0x35c8('0xa')](function(){console['log'](_0x35c8('0xb'),_0x35c8('0xc'));return db[_0x35c8('0xd')][_0x35c8('0x9')]({'where':{}});})['then'](function(){return db['CmHopper'][_0x35c8('0xe')](hopper);})[_0x35c8('0xa')](function(){console['log'](_0x35c8('0xb'),_0x35c8('0xf'));return db['CmContact'][_0x35c8('0xe')](contacts2);})[_0x35c8('0xa')](function(){console[_0x35c8('0x10')](_0x35c8('0xb'),_0x35c8('0x11'));return db[_0x35c8('0xd')][_0x35c8('0xe')](hopper2);})[_0x35c8('0xa')](function(){console[_0x35c8('0x10')](_0x35c8('0xb'),'hopper2');})[_0x35c8('0x12')](function(_0x56267a){console[_0x35c8('0x10')](_0x56267a);});
\ No newline at end of file
+var _0xfb29=['Biondo','CmContact','then','bulkCreate','log','finished\x20populating','contacts1','destroy','CmHopper','hopper1','hopper2','catch','util','../mysqldb','push','Innocenzo','innocenzo.biondo','@xcally.com','now'];(function(_0x14c767,_0x26292e){var _0x272e82=function(_0x3bfba5){while(--_0x3bfba5){_0x14c767['push'](_0x14c767['shift']());}};_0x272e82(++_0x26292e);}(_0xfb29,0xb7));var _0x9fb2=function(_0x45588a,_0x478a78){_0x45588a=_0x45588a-0x0;var _0x3bad4b=_0xfb29[_0x45588a];return _0x3bad4b;};'use strict';var util=require(_0x9fb2('0x0'));var db=require(_0x9fb2('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x9fb2('0x2')]({'id':i,'firstName':_0x9fb2('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x9fb2('0x4')+i+_0x9fb2('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x9fb2('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x9fb2('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x9fb2('0x6')](),'updatedAt':Date[_0x9fb2('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x9fb2('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x9fb2('0x7')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x9fb2('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x9fb2('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x9fb2('0x6')](),'updatedAt':Date['now']()});}db[_0x9fb2('0x8')]['destroy']({'where':{}})[_0x9fb2('0x9')](function(){return db[_0x9fb2('0x8')][_0x9fb2('0xa')](contacts);})[_0x9fb2('0x9')](function(){console[_0x9fb2('0xb')](_0x9fb2('0xc'),_0x9fb2('0xd'));return db['CmHopper'][_0x9fb2('0xe')]({'where':{}});})[_0x9fb2('0x9')](function(){return db[_0x9fb2('0xf')][_0x9fb2('0xa')](hopper);})[_0x9fb2('0x9')](function(){console[_0x9fb2('0xb')](_0x9fb2('0xc'),_0x9fb2('0x10'));return db[_0x9fb2('0x8')][_0x9fb2('0xa')](contacts2);})[_0x9fb2('0x9')](function(){console[_0x9fb2('0xb')]('finished\x20populating','contacts2');return db[_0x9fb2('0xf')][_0x9fb2('0xa')](hopper2);})[_0x9fb2('0x9')](function(){console[_0x9fb2('0xb')](_0x9fb2('0xc'),_0x9fb2('0x11'));})[_0x9fb2('0x12')](function(_0x2a7fda){console[_0x9fb2('0xb')](_0x2a7fda);});
\ No newline at end of file
index 5817492..c8bc92e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8c5=['/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','friend','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb8c5,0x1e3));var _0x5b8c=function(_0x483a68,_0x2acc85){_0x483a68=_0x483a68-0x0;var _0x5d8176=_0xb8c5[_0x483a68];return _0x5d8176;};'use strict';var util=require(_0x5b8c('0x0'));var db=require(_0x5b8c('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x5b8c('0x2')]({'name':util[_0x5b8c('0x3')](_0x5b8c('0x4'),'agent',i),'fullname':util[_0x5b8c('0x3')](_0x5b8c('0x4'),'agent',i),'email':util[_0x5b8c('0x3')]('%s%s@xcally.com',_0x5b8c('0x5'),i),'role':_0x5b8c('0x5'),'password':'password','internal':0xfa0+i,'type':_0x5b8c('0x6'),'transport':['udp','ws',_0x5b8c('0x7')],'disallow':['all'],'allow':[_0x5b8c('0x8')],'defaultuser':util[_0x5b8c('0x3')]('%s%s',_0x5b8c('0x5'),i),'encryption':_0x5b8c('0x9'),'avpf':'yes','force_avp':'yes','icesupport':_0x5b8c('0x9'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x5b8c('0xa'),'dtlsprivatekey':_0x5b8c('0xb'),'dtlssetup':_0x5b8c('0xc'),'callerid':util[_0x5b8c('0x3')](_0x5b8c('0xd'),util[_0x5b8c('0x3')](_0x5b8c('0x4'),_0x5b8c('0x5'),i),0xfa0+i)});}db['User'][_0x5b8c('0xe')](users)[_0x5b8c('0xf')](function(){console[_0x5b8c('0x10')](_0x5b8c('0x11'));})[_0x5b8c('0x12')](function(_0x76b701){console[_0x5b8c('0x10')](_0x76b701);});
\ No newline at end of file
+var _0x052f=['actpass','User','bulkCreate','log','catch','util','push','format','%s%s','agent','password','udp','all','ulaw','yes','/etc/pki/tls/certs/motion.crt'];(function(_0x56c6a9,_0x1239ee){var _0xa3ad43=function(_0x386c0a){while(--_0x386c0a){_0x56c6a9['push'](_0x56c6a9['shift']());}};_0xa3ad43(++_0x1239ee);}(_0x052f,0xf5));var _0xf052=function(_0x41a5a6,_0x43b522){_0x41a5a6=_0x41a5a6-0x0;var _0x2d2c93=_0x052f[_0x41a5a6];return _0x2d2c93;};'use strict';var util=require(_0xf052('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xf052('0x1')]({'name':util['format']('%s%s','agent',i),'fullname':util[_0xf052('0x2')](_0xf052('0x3'),_0xf052('0x4'),i),'email':util[_0xf052('0x2')]('%s%s@xcally.com',_0xf052('0x4'),i),'role':_0xf052('0x4'),'password':_0xf052('0x5'),'internal':0xfa0+i,'type':'friend','transport':[_0xf052('0x6'),'ws','wss'],'disallow':[_0xf052('0x7')],'allow':[_0xf052('0x8')],'defaultuser':util['format'](_0xf052('0x3'),_0xf052('0x4'),i),'encryption':_0xf052('0x9'),'avpf':'yes','force_avp':_0xf052('0x9'),'icesupport':'yes','dtlsenable':_0xf052('0x9'),'dtlsverify':'no','dtlscertfile':_0xf052('0xa'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xf052('0xb'),'callerid':util[_0xf052('0x2')]('\x22%s\x22\x20<%s>',util[_0xf052('0x2')](_0xf052('0x3'),_0xf052('0x4'),i),0xfa0+i)});}db[_0xf052('0xc')][_0xf052('0xd')](users)['then'](function(){console[_0xf052('0xe')]('add\x20user');})[_0xf052('0xf')](function(_0x19e2ca){console['log'](_0x19e2ca);});
\ No newline at end of file
index 4f456bf..1dd6b05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94d4=['%s:queue:%s','Agents','length','handshake','find','userProfileId','query','ChatInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','WhatsappQueue','ChatQueues','OpenchannelQueues','OpenchannelQueue','Trunk','getVoiceQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','openchannel','telephone:%s','leave','ChatInteractions','removeChatInteractions','removeMailInteractions','emit','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','request','connectedAt','disconnect','DISCONNECTED','CONNECTED','lodash','util','../mysqldb','./environment','name','User','role','agent','telephone','type','ivr','UserProfileSection','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','Campaign','format'];(function(_0xa1f465,_0x48e306){var _0x126406=function(_0x4ae16b){while(--_0x4ae16b){_0xa1f465['push'](_0xa1f465['shift']());}};_0x126406(++_0x48e306);}(_0x94d4,0xa5));var _0x494d=function(_0x55451a,_0x311541){_0x55451a=_0x55451a-0x0;var _0xc79144=_0x94d4[_0x55451a];return _0xc79144;};'use strict';var _=require(_0x494d('0x0'));var util=require(_0x494d('0x1'));var BPromise=require('bluebird');var db=require(_0x494d('0x2'))['db'];var config=require(_0x494d('0x3'));var queryQueues={'attributes':['id',_0x494d('0x4')],'include':[{'as':'Agents','model':db[_0x494d('0x5')],'attributes':['id',_0x494d('0x4'),_0x494d('0x6')],'raw':!![],'where':{'role':_0x494d('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x494d('0x4')],'where':{'role':_0x494d('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x494d('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x494d('0x9')],'where':{'type':_0x494d('0xa')}};function getAssociatedResources(_0x5408b3,_0x4c3e5f,_0x456fe8){return db[_0x494d('0xb')]['findOne']({'where':{'name':_0x5408b3,'userProfileId':_0x4c3e5f},'raw':!![]})[_0x494d('0xc')](function(_0x28bff7){if(_0x28bff7){if(_0x28bff7[_0x494d('0xd')]){switch(_0x5408b3){case _0x494d('0xe'):case'ChatQueues':case _0x494d('0xf'):case _0x494d('0x10'):case'MailQueues':case'OpenchannelQueues':case'WhatsappQueues':return db[_0x456fe8][_0x494d('0x11')](queryQueues);case _0x494d('0x12'):return db[_0x456fe8][_0x494d('0x11')](queryTelephones);case _0x494d('0x13'):return db[_0x456fe8][_0x494d('0x11')](queryTrunks);case _0x494d('0x14'):return db[_0x456fe8][_0x494d('0x11')](queryCampaigns);}}else{return db[_0x494d('0x15')][_0x494d('0x11')]({'attributes':[_0x494d('0x16')],'where':{'sectionId':_0x28bff7['id']},'raw':!![]})[_0x494d('0xc')](function(_0x5c2c67){if(_0x5c2c67){var _0x22f04f={'where':{'id':_[_0x494d('0x17')](_0x5c2c67,_0x494d('0x16'))},'raw':!![]};switch(_0x456fe8){case _0x494d('0x5'):_0x22f04f[_0x494d('0x18')][_0x494d('0x6')]=_0x494d('0x8');break;case _0x494d('0x19'):_0x22f04f[_0x494d('0x18')][_0x494d('0x9')]=_0x494d('0xa');break;}return db[_0x456fe8][_0x494d('0x11')](_0x22f04f);}else{return[];}});}}else{return[];}})[_0x494d('0xc')](function(_0x23997d){return _0x23997d;});}function joinOrLeaveQueues(_0x20dd3d,_0x3e4be3,_0x134632,_0x5bf90b){_0x20dd3d[_0x3e4be3](util[_0x494d('0x1a')](_0x494d('0x1b'),_0x134632,_0x5bf90b[_0x494d('0x4')]));if(_0x5bf90b[_0x494d('0x1c')]){for(var _0x4c2731=0x0;_0x4c2731<_0x5bf90b['Agents'][_0x494d('0x1d')];_0x4c2731+=0x1){_0x20dd3d[_0x3e4be3](util[_0x494d('0x1a')]('user:%s',_0x5bf90b['Agents'][_0x4c2731][_0x494d('0x4')]));}}}function joinOrLeave(_0x5b9c64,_0x1dec57,_0x52f26d){var _0x2be6f0;if(_0x5b9c64[_0x494d('0x1e')]['query']['id']){db[_0x494d('0x5')][_0x494d('0x1f')]({'attributes':['id',_0x494d('0x4'),_0x494d('0x6'),_0x494d('0x20')],'where':{'id':_0x5b9c64['handshake'][_0x494d('0x21')]['id']},'include':[{'model':db[_0x494d('0x22')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x494d('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x494d('0x24')],'as':_0x494d('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x494d('0x26')],'as':_0x494d('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x494d('0x28')],'as':_0x494d('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x494d('0x2a')],'as':_0x494d('0x2b'),'attributes':['id'],'raw':!![]}]})[_0x494d('0xc')](function(_0x1a8d4b){if(_0x1a8d4b){_0x2be6f0=_0x1a8d4b;_0x5b9c64[_0x1dec57](util[_0x494d('0x1a')](_0x494d('0x2c'),_0x1a8d4b['name']));var _0x220dd8=[];switch(_0x1a8d4b[_0x494d('0x6')]){case _0x494d('0x2d'):_0x5b9c64[_0x1dec57](_0x494d('0x2e'));_0x5b9c64[_0x1dec57](_0x494d('0x2f'));if(queryQueues[_0x494d('0x30')](_0x494d('0x31'))){delete queryQueues[_0x494d('0x31')];}_0x220dd8[_0x494d('0x32')](db[_0x494d('0x33')]['findAll'](queryQueues));_0x220dd8[_0x494d('0x32')](db[_0x494d('0x34')]['findAll'](queryQueues));_0x220dd8[_0x494d('0x32')](db[_0x494d('0x35')]['findAll'](queryQueues));_0x220dd8['push'](db[_0x494d('0x36')]['findAll'](queryQueues));_0x220dd8[_0x494d('0x32')](db[_0x494d('0x37')][_0x494d('0x11')](queryQueues));_0x220dd8[_0x494d('0x32')](db['OpenchannelQueue']['findAll'](queryQueues));_0x220dd8[_0x494d('0x32')](db[_0x494d('0x38')][_0x494d('0x11')](queryQueues));_0x220dd8['push'](db['User'][_0x494d('0x11')](queryTelephones));_0x220dd8[_0x494d('0x32')](db['Trunk'][_0x494d('0x11')](queryTrunks));_0x220dd8[_0x494d('0x32')](db[_0x494d('0x19')]['findAll'](queryCampaigns));_0x220dd8['push'](db['User'][_0x494d('0x11')](queryAgents));break;case'user':_0x5b9c64[_0x1dec57]('voice:inbound');_0x5b9c64[_0x1dec57](_0x494d('0x2f'));_0x220dd8[_0x494d('0x32')](getAssociatedResources(_0x494d('0xe'),_0x1a8d4b[_0x494d('0x20')],_0x494d('0x33')));_0x220dd8['push'](getAssociatedResources(_0x494d('0x39'),_0x1a8d4b[_0x494d('0x20')],_0x494d('0x34')));_0x220dd8[_0x494d('0x32')](getAssociatedResources(_0x494d('0xf'),_0x1a8d4b['userProfileId'],_0x494d('0x35')));_0x220dd8[_0x494d('0x32')](getAssociatedResources('SmsQueues',_0x1a8d4b[_0x494d('0x20')],_0x494d('0x36')));_0x220dd8[_0x494d('0x32')](getAssociatedResources('MailQueues',_0x1a8d4b[_0x494d('0x20')],_0x494d('0x37')));_0x220dd8['push'](getAssociatedResources(_0x494d('0x3a'),_0x1a8d4b[_0x494d('0x20')],_0x494d('0x3b')));_0x220dd8['push'](getAssociatedResources('WhatsappQueues',_0x1a8d4b[_0x494d('0x20')],'WhatsappQueue'));_0x220dd8[_0x494d('0x32')](getAssociatedResources(_0x494d('0x12'),_0x1a8d4b[_0x494d('0x20')],'User'));_0x220dd8[_0x494d('0x32')](getAssociatedResources(_0x494d('0x13'),_0x1a8d4b['userProfileId'],_0x494d('0x3c')));_0x220dd8[_0x494d('0x32')](getAssociatedResources('IvrCampaigns',_0x1a8d4b[_0x494d('0x20')],_0x494d('0x19')));_0x220dd8['push'](db[_0x494d('0x5')][_0x494d('0x11')](queryAgents));break;case _0x494d('0x7'):_0x5b9c64[_0x1dec57](_0x494d('0x2e'));_0x5b9c64[_0x1dec57]('voice:outbound');_0x220dd8[_0x494d('0x32')](_0x1a8d4b[_0x494d('0x3d')]({'attributes':['id',_0x494d('0x4')]}));_0x220dd8[_0x494d('0x32')](_0x1a8d4b['getChatQueues']({'attributes':['id','name']}));_0x220dd8[_0x494d('0x32')](_0x1a8d4b[_0x494d('0x3e')]({'attributes':['id','name']}));_0x220dd8[_0x494d('0x32')](_0x1a8d4b[_0x494d('0x3f')]({'attributes':['id',_0x494d('0x4')]}));_0x220dd8['push'](_0x1a8d4b['getMailQueues']({'attributes':['id',_0x494d('0x4')]}));_0x220dd8[_0x494d('0x32')](_0x1a8d4b[_0x494d('0x40')]({'attributes':['id',_0x494d('0x4')]}));_0x220dd8[_0x494d('0x32')](_0x1a8d4b[_0x494d('0x41')]({'attributes':['id',_0x494d('0x4')]}));break;}return BPromise[_0x494d('0x42')](_0x220dd8);}})[_0x494d('0xc')](function(_0xcc60c2){if(_0xcc60c2&&_0xcc60c2[_0x494d('0x1d')]){for(var _0x30a1eb=0x0;_0x30a1eb<_0xcc60c2['length'];_0x30a1eb+=0x1){for(var _0x37c49d=0x0;_0x37c49d<_0xcc60c2[_0x30a1eb][_0x494d('0x1d')];_0x37c49d+=0x1){switch(_0x30a1eb){case 0x0:joinOrLeaveQueues(_0x5b9c64,_0x1dec57,_0x494d('0x43'),_0xcc60c2[_0x30a1eb][_0x37c49d]);break;case 0x1:joinOrLeaveQueues(_0x5b9c64,_0x1dec57,_0x494d('0x44'),_0xcc60c2[_0x30a1eb][_0x37c49d]);break;case 0x2:joinOrLeaveQueues(_0x5b9c64,_0x1dec57,_0x494d('0x45'),_0xcc60c2[_0x30a1eb][_0x37c49d]);break;case 0x3:joinOrLeaveQueues(_0x5b9c64,_0x1dec57,_0x494d('0x46'),_0xcc60c2[_0x30a1eb][_0x37c49d]);break;case 0x4:joinOrLeaveQueues(_0x5b9c64,_0x1dec57,_0x494d('0x47'),_0xcc60c2[_0x30a1eb][_0x37c49d]);break;case 0x5:joinOrLeaveQueues(_0x5b9c64,_0x1dec57,_0x494d('0x48'),_0xcc60c2[_0x30a1eb][_0x37c49d]);break;case 0x6:joinOrLeaveQueues(_0x5b9c64,_0x1dec57,'whatsapp',_0xcc60c2[_0x30a1eb][_0x37c49d]);break;case 0x7:if(_0x2be6f0[_0x494d('0x6')]!==_0x494d('0x7'))_0x5b9c64[_0x1dec57](util[_0x494d('0x1a')](_0x494d('0x49'),_0xcc60c2[_0x30a1eb][_0x37c49d][_0x494d('0x4')]));break;case 0x8:if(_0x2be6f0['role']!=='agent')_0x5b9c64[_0x1dec57](util[_0x494d('0x1a')]('trunk:%s',_0xcc60c2[_0x30a1eb][_0x37c49d][_0x494d('0x4')]));break;case 0x9:if(_0x2be6f0[_0x494d('0x6')]!==_0x494d('0x7'))_0x5b9c64[_0x1dec57](util[_0x494d('0x1a')]('campaign:%s:%s',_0xcc60c2[_0x30a1eb][_0x37c49d][_0x494d('0x9')],_0xcc60c2[_0x30a1eb][_0x37c49d][_0x494d('0x4')]));break;case 0xa:_0x5b9c64[_0x1dec57](util['format'](_0x494d('0x2c'),_0xcc60c2[_0x30a1eb][_0x37c49d][_0x494d('0x4')]));break;}}}}})[_0x494d('0xc')](function(){if(_0x1dec57===_0x494d('0x4a')){var _0x2d3a26=_[_0x494d('0x17')](_0x2be6f0[_0x494d('0x4b')],'id');return _0x2be6f0[_0x494d('0x4c')](_0x2d3a26)['then'](function(){for(var _0x5c07b5=0x0;_0x5c07b5<_0x2d3a26[_0x494d('0x1d')];_0x5c07b5+=0x1){_0x52f26d['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x2d3a26[_0x5c07b5]),'UserId':Number(_0x2be6f0['id'])});}});}})[_0x494d('0xc')](function(){if(_0x1dec57===_0x494d('0x4a')){var _0x338a66=_[_0x494d('0x17')](_0x2be6f0[_0x494d('0x23')],'id');return _0x2be6f0[_0x494d('0x4d')](_0x338a66)['then'](function(){for(var _0xdd869e=0x0;_0xdd869e<_0x338a66[_0x494d('0x1d')];_0xdd869e+=0x1){_0x52f26d[_0x494d('0x4e')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x338a66[_0xdd869e]),'UserId':Number(_0x2be6f0['id'])});}});}})[_0x494d('0xc')](function(){if(_0x1dec57===_0x494d('0x4a')){var _0x596628=_[_0x494d('0x17')](_0x2be6f0[_0x494d('0x25')],'id');return _0x2be6f0[_0x494d('0x4f')](_0x596628)[_0x494d('0xc')](function(){for(var _0x4bc5e5=0x0;_0x4bc5e5<_0x596628['length'];_0x4bc5e5+=0x1){_0x52f26d[_0x494d('0x4e')](_0x494d('0x50'),{'FaxInteractionId':Number(_0x596628[_0x4bc5e5]),'UserId':Number(_0x2be6f0['id'])});}});}})[_0x494d('0xc')](function(){if(_0x1dec57===_0x494d('0x4a')){var _0x538f07=_[_0x494d('0x17')](_0x2be6f0[_0x494d('0x27')],'id');return _0x2be6f0[_0x494d('0x51')](_0x538f07)['then'](function(){for(var _0x421198=0x0;_0x421198<_0x538f07['length'];_0x421198+=0x1){_0x52f26d[_0x494d('0x4e')](_0x494d('0x52'),{'SmsInteractionId':Number(_0x538f07[_0x421198]),'UserId':Number(_0x2be6f0['id'])});}});}})['then'](function(){if(_0x1dec57===_0x494d('0x4a')){var _0x1d4d86=_[_0x494d('0x17')](_0x2be6f0[_0x494d('0x29')],'id');return _0x2be6f0['removeOpenchannelInteractions'](_0x1d4d86)[_0x494d('0xc')](function(){for(var _0x3beb37=0x0;_0x3beb37<_0x1d4d86[_0x494d('0x1d')];_0x3beb37+=0x1){_0x52f26d[_0x494d('0x4e')](_0x494d('0x53'),{'OpenchannelInteractionId':Number(_0x1d4d86[_0x3beb37]),'UserId':Number(_0x2be6f0['id'])});}});}})['then'](function(){if(_0x1dec57===_0x494d('0x4a')){var _0x8304b5=_[_0x494d('0x17')](_0x2be6f0[_0x494d('0x2b')],'id');return _0x2be6f0[_0x494d('0x54')](_0x8304b5)[_0x494d('0xc')](function(){for(var _0x1c12a0=0x0;_0x1c12a0<_0x8304b5[_0x494d('0x1d')];_0x1c12a0+=0x1){_0x52f26d[_0x494d('0x4e')](_0x494d('0x55'),{'WhatsappInteractionId':Number(_0x8304b5[_0x1c12a0]),'UserId':Number(_0x2be6f0['id'])});}});}})[_0x494d('0x56')](function(_0x17c800){_0x5b9c64[_0x494d('0x57')](_0x17c800);});}}function onDisconnect(_0x30f2a0,_0x20dc78){joinOrLeave(_0x30f2a0,_0x494d('0x4a'),_0x20dc78);}function onConnect(_0x532e21){joinOrLeave(_0x532e21,_0x494d('0x58'));}exports[_0x494d('0x59')]=function(_0x44e182){_0x44e182['on'](_0x494d('0x5a'),function(_0x330233){_0x330233['setMaxListeners'](0x0);_0x330233['address']=_0x330233[_0x494d('0x5b')][_0x494d('0x5a')]['remoteAddress']+':'+_0x330233[_0x494d('0x5b')]['connection']['remotePort'];_0x330233[_0x494d('0x5c')]=new Date();_0x330233[_0x494d('0x57')]=function(_0x8e3bf1){console[_0x494d('0x57')]('SocketIO\x20'+_0x330233['nsp']['name']+'['+_0x330233['address']+']',_0x8e3bf1);};_0x330233['on'](_0x494d('0x5d'),function(){onDisconnect(_0x330233,_0x44e182);_0x330233['log'](_0x494d('0x5e'));});onConnect(_0x330233);_0x330233[_0x494d('0x57')](_0x494d('0x5f'));});};
\ No newline at end of file
+var _0x161a=['sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','removeMailInteractions','map','removeFaxInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','default','connection','request','remoteAddress','log','SocketIO\x20','nsp','address','DISCONNECTED','bluebird','../mysqldb','name','User','telephone','agent','type','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','resourceId','where','role','Campaign','ivr','format','%s:queue:%s','Agents','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:outbound','include','push','VoiceQueue','ChatQueue','MailQueue','OpenchannelQueue','Trunk','user','voice:inbound','FaxQueue','SmsQueue','OpenchannelQueues','WhatsappQueue','Trunks','getVoiceQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','voice'];(function(_0x4b9806,_0x1517c0){var _0x12f4d4=function(_0x2f0984){while(--_0x2f0984){_0x4b9806['push'](_0x4b9806['shift']());}};_0x12f4d4(++_0x1517c0);}(_0x161a,0x140));var _0xa161=function(_0x34bd34,_0x1444f7){_0x34bd34=_0x34bd34-0x0;var _0x4e36d6=_0x161a[_0x34bd34];return _0x4e36d6;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0xa161('0x0'));var db=require(_0xa161('0x1'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0xa161('0x2')],'include':[{'as':'Agents','model':db[_0xa161('0x3')],'attributes':['id',_0xa161('0x2'),'role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xa161('0x2')],'where':{'role':_0xa161('0x4')}};var queryTrunks={'raw':!![],'attributes':['id',_0xa161('0x2')]};var queryAgents={'raw':!![],'attributes':['id',_0xa161('0x2')],'where':{'role':_0xa161('0x5')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xa161('0x2'),_0xa161('0x6')],'where':{'type':'ivr'}};function getAssociatedResources(_0x44aae9,_0x1e914a,_0x327221){return db[_0xa161('0x7')][_0xa161('0x8')]({'where':{'name':_0x44aae9,'userProfileId':_0x1e914a},'raw':!![]})[_0xa161('0x9')](function(_0x1c443e){if(_0x1c443e){if(_0x1c443e[_0xa161('0xa')]){switch(_0x44aae9){case _0xa161('0xb'):case _0xa161('0xc'):case _0xa161('0xd'):case _0xa161('0xe'):case _0xa161('0xf'):case'OpenchannelQueues':case _0xa161('0x10'):return db[_0x327221][_0xa161('0x11')](queryQueues);case _0xa161('0x12'):return db[_0x327221][_0xa161('0x11')](queryTelephones);case'Trunks':return db[_0x327221][_0xa161('0x11')](queryTrunks);case _0xa161('0x13'):return db[_0x327221]['findAll'](queryCampaigns);}}else{return db[_0xa161('0x14')][_0xa161('0x11')]({'attributes':['resourceId'],'where':{'sectionId':_0x1c443e['id']},'raw':!![]})[_0xa161('0x9')](function(_0x3493c0){if(_0x3493c0){var _0xff6d28={'where':{'id':_['map'](_0x3493c0,_0xa161('0x15'))},'raw':!![]};switch(_0x327221){case _0xa161('0x3'):_0xff6d28[_0xa161('0x16')][_0xa161('0x17')]=_0xa161('0x4');break;case _0xa161('0x18'):_0xff6d28[_0xa161('0x16')]['type']=_0xa161('0x19');break;}return db[_0x327221][_0xa161('0x11')](_0xff6d28);}else{return[];}});}}else{return[];}})['then'](function(_0x22b33e){return _0x22b33e;});}function joinOrLeaveQueues(_0x4bda6a,_0x3e5b4f,_0x3ccf0c,_0x2dd796){_0x4bda6a[_0x3e5b4f](util[_0xa161('0x1a')](_0xa161('0x1b'),_0x3ccf0c,_0x2dd796['name']));if(_0x2dd796[_0xa161('0x1c')]){for(var _0xfd6078=0x0;_0xfd6078<_0x2dd796[_0xa161('0x1c')][_0xa161('0x1d')];_0xfd6078+=0x1){_0x4bda6a[_0x3e5b4f](util[_0xa161('0x1a')](_0xa161('0x1e'),_0x2dd796[_0xa161('0x1c')][_0xfd6078][_0xa161('0x2')]));}}}function joinOrLeave(_0x583add,_0x2d511b,_0x27bf12){var _0x57cf33;if(_0x583add[_0xa161('0x1f')][_0xa161('0x20')]['id']){db[_0xa161('0x3')][_0xa161('0x21')]({'attributes':['id',_0xa161('0x2'),_0xa161('0x17'),_0xa161('0x22')],'where':{'id':_0x583add[_0xa161('0x1f')][_0xa161('0x20')]['id']},'include':[{'model':db[_0xa161('0x23')],'as':_0xa161('0x24'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0xa161('0x25'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0xa161('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xa161('0x27')],'as':_0xa161('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xa161('0x29')],'as':_0xa161('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0xa161('0x2b')],'as':_0xa161('0x2c'),'attributes':['id'],'raw':!![]}]})[_0xa161('0x9')](function(_0x40b118){if(_0x40b118){_0x57cf33=_0x40b118;_0x583add[_0x2d511b](util[_0xa161('0x1a')](_0xa161('0x1e'),_0x40b118[_0xa161('0x2')]));var _0x159b0f=[];switch(_0x40b118[_0xa161('0x17')]){case _0xa161('0x2d'):_0x583add[_0x2d511b]('voice:inbound');_0x583add[_0x2d511b](_0xa161('0x2e'));if(queryQueues['hasOwnProperty'](_0xa161('0x2f'))){delete queryQueues['include'];}_0x159b0f[_0xa161('0x30')](db[_0xa161('0x31')][_0xa161('0x11')](queryQueues));_0x159b0f[_0xa161('0x30')](db[_0xa161('0x32')][_0xa161('0x11')](queryQueues));_0x159b0f[_0xa161('0x30')](db['FaxQueue']['findAll'](queryQueues));_0x159b0f[_0xa161('0x30')](db['SmsQueue']['findAll'](queryQueues));_0x159b0f['push'](db[_0xa161('0x33')][_0xa161('0x11')](queryQueues));_0x159b0f[_0xa161('0x30')](db[_0xa161('0x34')][_0xa161('0x11')](queryQueues));_0x159b0f[_0xa161('0x30')](db['WhatsappQueue'][_0xa161('0x11')](queryQueues));_0x159b0f['push'](db[_0xa161('0x3')][_0xa161('0x11')](queryTelephones));_0x159b0f['push'](db[_0xa161('0x35')][_0xa161('0x11')](queryTrunks));_0x159b0f[_0xa161('0x30')](db['Campaign'][_0xa161('0x11')](queryCampaigns));_0x159b0f[_0xa161('0x30')](db[_0xa161('0x3')][_0xa161('0x11')](queryAgents));break;case _0xa161('0x36'):_0x583add[_0x2d511b](_0xa161('0x37'));_0x583add[_0x2d511b](_0xa161('0x2e'));_0x159b0f['push'](getAssociatedResources(_0xa161('0xb'),_0x40b118['userProfileId'],_0xa161('0x31')));_0x159b0f['push'](getAssociatedResources(_0xa161('0xc'),_0x40b118[_0xa161('0x22')],'ChatQueue'));_0x159b0f['push'](getAssociatedResources('FaxQueues',_0x40b118[_0xa161('0x22')],_0xa161('0x38')));_0x159b0f[_0xa161('0x30')](getAssociatedResources('SmsQueues',_0x40b118[_0xa161('0x22')],_0xa161('0x39')));_0x159b0f[_0xa161('0x30')](getAssociatedResources(_0xa161('0xf'),_0x40b118[_0xa161('0x22')],_0xa161('0x33')));_0x159b0f[_0xa161('0x30')](getAssociatedResources(_0xa161('0x3a'),_0x40b118[_0xa161('0x22')],_0xa161('0x34')));_0x159b0f[_0xa161('0x30')](getAssociatedResources(_0xa161('0x10'),_0x40b118[_0xa161('0x22')],_0xa161('0x3b')));_0x159b0f['push'](getAssociatedResources('Telephones',_0x40b118[_0xa161('0x22')],'User'));_0x159b0f['push'](getAssociatedResources(_0xa161('0x3c'),_0x40b118[_0xa161('0x22')],'Trunk'));_0x159b0f[_0xa161('0x30')](getAssociatedResources(_0xa161('0x13'),_0x40b118[_0xa161('0x22')],'Campaign'));_0x159b0f[_0xa161('0x30')](db[_0xa161('0x3')][_0xa161('0x11')](queryAgents));break;case _0xa161('0x5'):_0x583add[_0x2d511b](_0xa161('0x37'));_0x583add[_0x2d511b](_0xa161('0x2e'));_0x159b0f[_0xa161('0x30')](_0x40b118[_0xa161('0x3d')]({'attributes':['id','name']}));_0x159b0f[_0xa161('0x30')](_0x40b118['getChatQueues']({'attributes':['id',_0xa161('0x2')]}));_0x159b0f['push'](_0x40b118[_0xa161('0x3e')]({'attributes':['id','name']}));_0x159b0f['push'](_0x40b118[_0xa161('0x3f')]({'attributes':['id','name']}));_0x159b0f[_0xa161('0x30')](_0x40b118[_0xa161('0x40')]({'attributes':['id',_0xa161('0x2')]}));_0x159b0f[_0xa161('0x30')](_0x40b118[_0xa161('0x41')]({'attributes':['id',_0xa161('0x2')]}));_0x159b0f[_0xa161('0x30')](_0x40b118[_0xa161('0x42')]({'attributes':['id',_0xa161('0x2')]}));break;}return BPromise['all'](_0x159b0f);}})[_0xa161('0x9')](function(_0x51d017){if(_0x51d017&&_0x51d017[_0xa161('0x1d')]){for(var _0x1bd6c8=0x0;_0x1bd6c8<_0x51d017[_0xa161('0x1d')];_0x1bd6c8+=0x1){for(var _0x2af569=0x0;_0x2af569<_0x51d017[_0x1bd6c8][_0xa161('0x1d')];_0x2af569+=0x1){switch(_0x1bd6c8){case 0x0:joinOrLeaveQueues(_0x583add,_0x2d511b,_0xa161('0x43'),_0x51d017[_0x1bd6c8][_0x2af569]);break;case 0x1:joinOrLeaveQueues(_0x583add,_0x2d511b,'chat',_0x51d017[_0x1bd6c8][_0x2af569]);break;case 0x2:joinOrLeaveQueues(_0x583add,_0x2d511b,'fax',_0x51d017[_0x1bd6c8][_0x2af569]);break;case 0x3:joinOrLeaveQueues(_0x583add,_0x2d511b,_0xa161('0x44'),_0x51d017[_0x1bd6c8][_0x2af569]);break;case 0x4:joinOrLeaveQueues(_0x583add,_0x2d511b,_0xa161('0x45'),_0x51d017[_0x1bd6c8][_0x2af569]);break;case 0x5:joinOrLeaveQueues(_0x583add,_0x2d511b,_0xa161('0x46'),_0x51d017[_0x1bd6c8][_0x2af569]);break;case 0x6:joinOrLeaveQueues(_0x583add,_0x2d511b,_0xa161('0x47'),_0x51d017[_0x1bd6c8][_0x2af569]);break;case 0x7:if(_0x57cf33['role']!=='agent')_0x583add[_0x2d511b](util['format'](_0xa161('0x48'),_0x51d017[_0x1bd6c8][_0x2af569]['name']));break;case 0x8:if(_0x57cf33[_0xa161('0x17')]!=='agent')_0x583add[_0x2d511b](util['format'](_0xa161('0x49'),_0x51d017[_0x1bd6c8][_0x2af569][_0xa161('0x2')]));break;case 0x9:if(_0x57cf33[_0xa161('0x17')]!=='agent')_0x583add[_0x2d511b](util[_0xa161('0x1a')](_0xa161('0x4a'),_0x51d017[_0x1bd6c8][_0x2af569]['type'],_0x51d017[_0x1bd6c8][_0x2af569][_0xa161('0x2')]));break;case 0xa:_0x583add[_0x2d511b](util[_0xa161('0x1a')](_0xa161('0x1e'),_0x51d017[_0x1bd6c8][_0x2af569][_0xa161('0x2')]));break;}}}}})[_0xa161('0x9')](function(){if(_0x2d511b===_0xa161('0x4b')){var _0x5462c8=_['map'](_0x57cf33['ChatInteractions'],'id');return _0x57cf33[_0xa161('0x4c')](_0x5462c8)[_0xa161('0x9')](function(){for(var _0x3a4226=0x0;_0x3a4226<_0x5462c8['length'];_0x3a4226+=0x1){_0x27bf12[_0xa161('0x4d')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x5462c8[_0x3a4226]),'UserId':Number(_0x57cf33['id'])});}});}})[_0xa161('0x9')](function(){if(_0x2d511b===_0xa161('0x4b')){var _0x2a5bbc=_['map'](_0x57cf33[_0xa161('0x25')],'id');return _0x57cf33[_0xa161('0x4e')](_0x2a5bbc)[_0xa161('0x9')](function(){for(var _0x18ae89=0x0;_0x18ae89<_0x2a5bbc[_0xa161('0x1d')];_0x18ae89+=0x1){_0x27bf12[_0xa161('0x4d')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x2a5bbc[_0x18ae89]),'UserId':Number(_0x57cf33['id'])});}});}})[_0xa161('0x9')](function(){if(_0x2d511b===_0xa161('0x4b')){var _0x1faf64=_[_0xa161('0x4f')](_0x57cf33[_0xa161('0x26')],'id');return _0x57cf33[_0xa161('0x50')](_0x1faf64)[_0xa161('0x9')](function(){for(var _0x46d7df=0x0;_0x46d7df<_0x1faf64[_0xa161('0x1d')];_0x46d7df+=0x1){_0x27bf12[_0xa161('0x4d')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x1faf64[_0x46d7df]),'UserId':Number(_0x57cf33['id'])});}});}})[_0xa161('0x9')](function(){if(_0x2d511b==='leave'){var _0x3586a4=_[_0xa161('0x4f')](_0x57cf33[_0xa161('0x28')],'id');return _0x57cf33[_0xa161('0x51')](_0x3586a4)[_0xa161('0x9')](function(){for(var _0x5b6e56=0x0;_0x5b6e56<_0x3586a4['length'];_0x5b6e56+=0x1){_0x27bf12['emit'](_0xa161('0x52'),{'SmsInteractionId':Number(_0x3586a4[_0x5b6e56]),'UserId':Number(_0x57cf33['id'])});}});}})[_0xa161('0x9')](function(){if(_0x2d511b==='leave'){var _0x5f4d98=_[_0xa161('0x4f')](_0x57cf33[_0xa161('0x2a')],'id');return _0x57cf33[_0xa161('0x53')](_0x5f4d98)[_0xa161('0x9')](function(){for(var _0xa91343=0x0;_0xa91343<_0x5f4d98[_0xa161('0x1d')];_0xa91343+=0x1){_0x27bf12[_0xa161('0x4d')](_0xa161('0x54'),{'OpenchannelInteractionId':Number(_0x5f4d98[_0xa91343]),'UserId':Number(_0x57cf33['id'])});}});}})['then'](function(){if(_0x2d511b===_0xa161('0x4b')){var _0x4b4c6c=_[_0xa161('0x4f')](_0x57cf33[_0xa161('0x2c')],'id');return _0x57cf33[_0xa161('0x55')](_0x4b4c6c)[_0xa161('0x9')](function(){for(var _0x37ee89=0x0;_0x37ee89<_0x4b4c6c['length'];_0x37ee89+=0x1){_0x27bf12[_0xa161('0x4d')](_0xa161('0x56'),{'WhatsappInteractionId':Number(_0x4b4c6c[_0x37ee89]),'UserId':Number(_0x57cf33['id'])});}});}})[_0xa161('0x57')](function(_0xca2dd9){_0x583add['log'](_0xca2dd9);});}}function onDisconnect(_0x435940,_0xea7cf5){joinOrLeave(_0x435940,_0xa161('0x4b'),_0xea7cf5);}function onConnect(_0x14f1e2){joinOrLeave(_0x14f1e2,'join');}exports[_0xa161('0x58')]=function(_0x3cdb7e){_0x3cdb7e['on'](_0xa161('0x59'),function(_0x2cd779){_0x2cd779['setMaxListeners'](0x0);_0x2cd779['address']=_0x2cd779[_0xa161('0x5a')][_0xa161('0x59')][_0xa161('0x5b')]+':'+_0x2cd779[_0xa161('0x5a')][_0xa161('0x59')]['remotePort'];_0x2cd779['connectedAt']=new Date();_0x2cd779[_0xa161('0x5c')]=function(_0x6c6cf1){console[_0xa161('0x5c')](_0xa161('0x5d')+_0x2cd779[_0xa161('0x5e')][_0xa161('0x2')]+'['+_0x2cd779[_0xa161('0x5f')]+']',_0x6c6cf1);};_0x2cd779['on']('disconnect',function(){onDisconnect(_0x2cd779,_0x3cdb7e);_0x2cd779[_0xa161('0x5c')](_0xa161('0x60'));});onConnect(_0x2cd779);_0x2cd779[_0xa161('0x5c')]('CONNECTED');});};
\ No newline at end of file
index 1b20566..881e11a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62f9=['code','get','channel','motionChannel','event','direction','resolve','undefined','ContactId','sequelize','query','Sequelize','SELECT','contact','UserId','interface','format','name','incomingmessage','outgoingmessage','catch','AfterCreateMessage','offlineMessage','opened','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SIP/%s','agent','AfterCreate','changed','closed','substatus','AfterUpdate','User','find','default','hasOwnProperty','model','hook','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','triggers','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','SmsInteraction','Sms','SmsMessage','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','Openchannel','OpenchannelInteraction','request','then','info','Trigger,\x20%s','EventManager','error'];(function(_0x1f8a2a,_0x906b0f){var _0x4dcaa7=function(_0x55098d){while(--_0x55098d){_0x1f8a2a['push'](_0x1f8a2a['shift']());}};_0x4dcaa7(++_0x906b0f);}(_0x62f9,0xc0));var _0x962f=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x62f9[_0x3a6efd];return _0x487b9a;};'use strict';var util=require(_0x962f('0x0'));var db=require(_0x962f('0x1'))['db'];var jayson=require(_0x962f('0x2'));var logger=require(_0x962f('0x3'))(_0x962f('0x4'));var client=jayson[_0x962f('0x5')][_0x962f('0x6')]({'port':0x232a});var triggers=[{'channel':_0x962f('0x7'),'model':_0x962f('0x8'),'event':_0x962f('0x9'),'condition':_0x962f('0xa'),'callback':afterCreate},{'channel':_0x962f('0x7'),'model':_0x962f('0x8'),'event':_0x962f('0xb'),'condition':_0x962f('0xc'),'callback':afterUpdate},{'channel':_0x962f('0x7'),'model':_0x962f('0xd'),'event':_0x962f('0x9'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x962f('0x7'),'model':'ChatOfflineMessage','event':_0x962f('0x9'),'condition':_0x962f('0xe'),'callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0x962f('0xf'),'event':_0x962f('0x9'),'condition':_0x962f('0xa'),'callback':afterCreate},{'channel':_0x962f('0x10'),'model':_0x962f('0xf'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':'Sms','model':_0x962f('0x11'),'event':_0x962f('0x9'),'condition':_0x962f('0xe'),'callback':afterCreateMessage},{'channel':_0x962f('0x12'),'model':_0x962f('0x13'),'event':_0x962f('0x9'),'condition':_0x962f('0xa'),'callback':afterCreate},{'channel':_0x962f('0x12'),'model':_0x962f('0x13'),'event':_0x962f('0xb'),'condition':_0x962f('0xc'),'callback':afterUpdate},{'channel':_0x962f('0x12'),'model':'WhatsappMessage','event':_0x962f('0x9'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x962f('0x14'),'model':_0x962f('0x15'),'event':_0x962f('0x9'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x962f('0x14'),'model':'FaxInteraction','event':'afterUpdate','condition':_0x962f('0xc'),'callback':afterUpdate},{'channel':_0x962f('0x14'),'model':_0x962f('0x16'),'event':_0x962f('0x9'),'condition':_0x962f('0xe'),'callback':afterCreateMessage},{'channel':_0x962f('0x17'),'model':_0x962f('0x18'),'event':_0x962f('0x9'),'condition':_0x962f('0xa'),'callback':afterCreate},{'channel':_0x962f('0x17'),'model':_0x962f('0x18'),'event':_0x962f('0xb'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Mail','model':'MailMessage','event':_0x962f('0x9'),'condition':_0x962f('0xe'),'callback':afterCreateMessage},{'channel':_0x962f('0x19'),'model':_0x962f('0x1a'),'event':_0x962f('0x9'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x962f('0x19'),'model':'OpenchannelInteraction','event':_0x962f('0xb'),'condition':_0x962f('0xc'),'callback':afterUpdate},{'channel':_0x962f('0x19'),'model':'OpenchannelMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage}];function request(_0x425817){return client[_0x962f('0x1b')]('EventManager',_0x425817)[_0x962f('0x1c')](function(_0x57f5a6){logger[_0x962f('0x1d')](_0x962f('0x1e'),_0x962f('0x1f'),_0x57f5a6);if(_0x57f5a6[_0x962f('0x20')]){if(_0x57f5a6[_0x962f('0x20')][_0x962f('0x21')]===0x1f4){logger[_0x962f('0x20')](_0x962f('0x1e'),_0x962f('0x1f'),_0x57f5a6['error']);}}})['catch'](function(_0x5aac0d){logger[_0x962f('0x20')](_0x962f('0x1e'),_0x962f('0x1f'),_0x5aac0d);});}function afterCreateMessage(_0x1f3bb9){return function(_0x20e159){_0x20e159=_0x20e159[_0x962f('0x22')]({'plain':!![]});_0x20e159[_0x962f('0x23')]=_0x1f3bb9;_0x20e159[_0x962f('0x24')]=_0x1f3bb9;_0x20e159[_0x962f('0x25')]=_0x20e159[_0x962f('0x26')];Promise[_0x962f('0x27')]()[_0x962f('0x1c')](function(){if(typeof _0x20e159['ContactId']===_0x962f('0x28'))return null;var _0x18ac16='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x20e159[_0x962f('0x29')];return db[_0x962f('0x2a')][_0x962f('0x2b')](_0x18ac16,{'type':db[_0x962f('0x2c')]['QueryTypes'][_0x962f('0x2d')],'raw':!![]});})[_0x962f('0x1c')](function(_0x4dcb37){if(_0x4dcb37){_0x20e159[_0x962f('0x2e')]=_0x4dcb37[0x0];}if(typeof _0x20e159[_0x962f('0x2f')]===_0x962f('0x28'))return;return getAgent(_0x20e159[_0x962f('0x2f')]);})['then'](function(_0x31aa64){if(_0x31aa64){_0x20e159[_0x962f('0x30')]=util[_0x962f('0x31')]('SIP/%s',_0x31aa64[_0x962f('0x32')]);_0x20e159['agent']=_0x31aa64;_0x20e159[_0x962f('0x23')]=_0x1f3bb9;return request({'event':_0x962f('0x33'),'message':_0x20e159});}else{return request({'event':_0x962f('0x34'),'message':_0x20e159});}})[_0x962f('0x35')](function(_0x21baa5){logger[_0x962f('0x20')]('Trigger,\x20%s',_0x962f('0x36'),_0x21baa5);});};}function afterCreateOfflineMessage(_0x3b9396){return function(_0xd335cb){_0xd335cb=_0xd335cb['get']({'plain':!![]});_0xd335cb[_0x962f('0x23')]=_0x3b9396;_0xd335cb[_0x962f('0x24')]=_0x3b9396;_0xd335cb[_0x962f('0x25')]=_0x962f('0x37');return request({'event':_0xd335cb[_0x962f('0x25')],'message':_0xd335cb});};}function afterCreate(_0x148845,_0x1ca5e2){return function(_0x3787fc){_0x3787fc=_0x3787fc[_0x962f('0x22')]({'plain':!![]});_0x3787fc['channel']=_0x148845;_0x3787fc[_0x962f('0x24')]=_0x148845;_0x3787fc[_0x962f('0x25')]=_0x962f('0x38');Promise[_0x962f('0x27')]()['then'](function(){var _0x11db9e=_0x962f('0x39')+_0x3787fc[_0x962f('0x29')];return db[_0x962f('0x2a')][_0x962f('0x2b')](_0x11db9e,{'type':db[_0x962f('0x2c')][_0x962f('0x3a')][_0x962f('0x2d')],'raw':!![]});})['then'](function(_0x384823){if(_0x384823){_0x3787fc[_0x962f('0x2e')]=_0x384823[0x0];}if(typeof _0x3787fc[_0x962f('0x2f')]===_0x962f('0x28'))return;return getAgent(_0x3787fc['UserId']);})[_0x962f('0x1c')](function(_0x3a8ecf){if(_0x3a8ecf){_0x3787fc[_0x962f('0x30')]=util[_0x962f('0x31')](_0x962f('0x3b'),_0x3a8ecf[_0x962f('0x32')]);_0x3787fc[_0x962f('0x3c')]=_0x3a8ecf;}return request({'event':_0x1ca5e2,'message':_0x3787fc});})[_0x962f('0x35')](function(_0x500ed9){logger[_0x962f('0x20')]('Trigger,\x20%s',_0x962f('0x3d'),_0x500ed9);});};}function afterUpdate(_0x43dd89){return function(_0x4f0c55){var _0x25346e=_0x4f0c55[_0x962f('0x3e')]('closed')&&_0x4f0c55[_0x962f('0x3f')];var _0x14118f=_0x4f0c55[_0x962f('0x3e')](_0x962f('0x40'));if(_0x25346e||_0x14118f){var _0x4fed1b=_0x25346e?_0x962f('0xc'):_0x962f('0x40');var _0x49047d=_0x4f0c55[_0x962f('0x22')]({'plain':!![]});_0x49047d[_0x962f('0x23')]=_0x43dd89;_0x49047d[_0x962f('0x24')]=_0x43dd89;_0x49047d['event']=_0x25346e?_0x962f('0x3f'):_0x962f('0x40');var _0x2e7edc='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x49047d[_0x962f('0x29')];return db[_0x962f('0x2a')]['query'](_0x2e7edc,{'type':db['Sequelize']['QueryTypes'][_0x962f('0x2d')],'raw':!![]})[_0x962f('0x1c')](function(_0x7e58d4){if(_0x7e58d4){_0x49047d[_0x962f('0x2e')]=_0x7e58d4[0x0];}if(typeof _0x49047d[_0x962f('0x2f')]===_0x962f('0x28'))return;return getAgent(_0x49047d[_0x962f('0x2f')]);})['then'](function(_0x52ef09){if(_0x52ef09){_0x49047d[_0x962f('0x30')]=util[_0x962f('0x31')](_0x962f('0x3b'),_0x52ef09[_0x962f('0x32')]);_0x49047d[_0x962f('0x3c')]=_0x52ef09;}return request({'event':_0x4fed1b,'message':_0x49047d});})[_0x962f('0x35')](function(_0x29dcb4){logger['error'](_0x962f('0x1e'),_0x962f('0x41'),_0x29dcb4);});}};}function getAgent(_0x3bc50f){return db[_0x962f('0x42')][_0x962f('0x43')]({'where':{'id':_0x3bc50f},'attributes':['id',_0x962f('0x32'),'fullname','email','internal'],'raw':!![]})['then'](function(_0x11a746){return _0x11a746;});}exports[_0x962f('0x44')]=function(){for(var _0x9c5a0=0x0;_0x9c5a0<triggers['length'];_0x9c5a0+=0x1){if(db[_0x962f('0x45')](triggers[_0x9c5a0][_0x962f('0x46')])){db[triggers[_0x9c5a0][_0x962f('0x46')]][_0x962f('0x47')](triggers[_0x9c5a0][_0x962f('0x25')],triggers[_0x9c5a0][_0x962f('0x48')](triggers[_0x9c5a0][_0x962f('0x23')][_0x962f('0x49')](),triggers[_0x9c5a0][_0x962f('0x4a')]));}}};
\ No newline at end of file
+var _0x41fc=['newmessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','newinteraction','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','MailMessage','OpenchannelInteraction','Openchannel','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','channel','motionChannel','event','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','QueryTypes','SELECT','contact','UserId','interface','format','SIP/%s','name','incomingmessage','outgoingmessage','AfterCreateMessage','offlineMessage','opened','AfterCreate','closed','changed','substatus','agent','User','find','default','hasOwnProperty','model','hook','callback','toLowerCase','condition','../../mysqldb','jayson/promise','../logger','triggers','client','http','Chat','ChatInteraction','afterUpdate','closedinteraction','ChatMessage','afterCreate','ChatOfflineMessage'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x41fc,0x1bb));var _0xc41f=function(_0x29812b,_0x221dab){_0x29812b=_0x29812b-0x0;var _0x3702fe=_0x41fc[_0x29812b];return _0x3702fe;};'use strict';var util=require('util');var db=require(_0xc41f('0x0'))['db'];var jayson=require(_0xc41f('0x1'));var logger=require(_0xc41f('0x2'))(_0xc41f('0x3'));var client=jayson[_0xc41f('0x4')][_0xc41f('0x5')]({'port':0x232a});var triggers=[{'channel':_0xc41f('0x6'),'model':_0xc41f('0x7'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0xc41f('0x6'),'model':_0xc41f('0x7'),'event':_0xc41f('0x8'),'condition':_0xc41f('0x9'),'callback':afterUpdate},{'channel':'Chat','model':_0xc41f('0xa'),'event':_0xc41f('0xb'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xc41f('0x6'),'model':_0xc41f('0xc'),'event':_0xc41f('0xb'),'condition':_0xc41f('0xd'),'callback':afterCreateOfflineMessage},{'channel':_0xc41f('0xe'),'model':_0xc41f('0xf'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0xc41f('0xe'),'model':_0xc41f('0xf'),'event':_0xc41f('0x8'),'condition':_0xc41f('0x9'),'callback':afterUpdate},{'channel':_0xc41f('0xe'),'model':_0xc41f('0x10'),'event':_0xc41f('0xb'),'condition':_0xc41f('0xd'),'callback':afterCreateMessage},{'channel':_0xc41f('0x11'),'model':_0xc41f('0x12'),'event':_0xc41f('0xb'),'condition':_0xc41f('0x13'),'callback':afterCreate},{'channel':_0xc41f('0x11'),'model':_0xc41f('0x12'),'event':_0xc41f('0x8'),'condition':_0xc41f('0x9'),'callback':afterUpdate},{'channel':_0xc41f('0x11'),'model':'WhatsappMessage','event':_0xc41f('0xb'),'condition':_0xc41f('0xd'),'callback':afterCreateMessage},{'channel':_0xc41f('0x14'),'model':_0xc41f('0x15'),'event':'afterCreate','condition':_0xc41f('0x13'),'callback':afterCreate},{'channel':'Fax','model':_0xc41f('0x15'),'event':_0xc41f('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xc41f('0x14'),'model':_0xc41f('0x16'),'event':'afterCreate','condition':_0xc41f('0xd'),'callback':afterCreateMessage},{'channel':'Mail','model':_0xc41f('0x17'),'event':'afterCreate','condition':_0xc41f('0x13'),'callback':afterCreate},{'channel':'Mail','model':_0xc41f('0x17'),'event':_0xc41f('0x8'),'condition':_0xc41f('0x9'),'callback':afterUpdate},{'channel':_0xc41f('0x18'),'model':_0xc41f('0x19'),'event':_0xc41f('0xb'),'condition':_0xc41f('0xd'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0xc41f('0x1a'),'event':_0xc41f('0xb'),'condition':_0xc41f('0x13'),'callback':afterCreate},{'channel':'Openchannel','model':_0xc41f('0x1a'),'event':_0xc41f('0x8'),'condition':_0xc41f('0x9'),'callback':afterUpdate},{'channel':_0xc41f('0x1b'),'model':_0xc41f('0x1c'),'event':_0xc41f('0xb'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x2167d6){return client[_0xc41f('0x1d')](_0xc41f('0x1e'),_0x2167d6)[_0xc41f('0x1f')](function(_0x478956){logger[_0xc41f('0x20')](_0xc41f('0x21'),_0xc41f('0x1e'),_0x478956);if(_0x478956[_0xc41f('0x22')]){if(_0x478956['error'][_0xc41f('0x23')]===0x1f4){logger[_0xc41f('0x22')]('Trigger,\x20%s','EventManager',_0x478956['error']);}}})[_0xc41f('0x24')](function(_0x11c4cf){logger[_0xc41f('0x22')]('Trigger,\x20%s','EventManager',_0x11c4cf);});}function afterCreateMessage(_0xda1b68){return function(_0x463a99){_0x463a99=_0x463a99[_0xc41f('0x25')]({'plain':!![]});_0x463a99[_0xc41f('0x26')]=_0xda1b68;_0x463a99[_0xc41f('0x27')]=_0xda1b68;_0x463a99[_0xc41f('0x28')]=_0x463a99[_0xc41f('0x29')];Promise[_0xc41f('0x2a')]()[_0xc41f('0x1f')](function(){if(typeof _0x463a99[_0xc41f('0x2b')]===_0xc41f('0x2c'))return null;var _0x5aa8cc=_0xc41f('0x2d')+_0x463a99['ContactId'];return db[_0xc41f('0x2e')][_0xc41f('0x2f')](_0x5aa8cc,{'type':db[_0xc41f('0x30')][_0xc41f('0x31')][_0xc41f('0x32')],'raw':!![]});})[_0xc41f('0x1f')](function(_0x139704){if(_0x139704){_0x463a99[_0xc41f('0x33')]=_0x139704[0x0];}if(typeof _0x463a99[_0xc41f('0x34')]==='undefined')return;return getAgent(_0x463a99[_0xc41f('0x34')]);})[_0xc41f('0x1f')](function(_0x17d2dc){if(_0x17d2dc){_0x463a99[_0xc41f('0x35')]=util[_0xc41f('0x36')](_0xc41f('0x37'),_0x17d2dc[_0xc41f('0x38')]);_0x463a99['agent']=_0x17d2dc;_0x463a99[_0xc41f('0x26')]=_0xda1b68;return request({'event':_0xc41f('0x39'),'message':_0x463a99});}else{return request({'event':_0xc41f('0x3a'),'message':_0x463a99});}})['catch'](function(_0x28f232){logger[_0xc41f('0x22')](_0xc41f('0x21'),_0xc41f('0x3b'),_0x28f232);});};}function afterCreateOfflineMessage(_0x102253){return function(_0x333a4d){_0x333a4d=_0x333a4d[_0xc41f('0x25')]({'plain':!![]});_0x333a4d['channel']=_0x102253;_0x333a4d[_0xc41f('0x27')]=_0x102253;_0x333a4d['event']=_0xc41f('0x3c');return request({'event':_0x333a4d['event'],'message':_0x333a4d});};}function afterCreate(_0x36106b,_0x168907){return function(_0x1a663e){_0x1a663e=_0x1a663e[_0xc41f('0x25')]({'plain':!![]});_0x1a663e[_0xc41f('0x26')]=_0x36106b;_0x1a663e['motionChannel']=_0x36106b;_0x1a663e[_0xc41f('0x28')]=_0xc41f('0x3d');Promise[_0xc41f('0x2a')]()[_0xc41f('0x1f')](function(){var _0x436cc1=_0xc41f('0x2d')+_0x1a663e[_0xc41f('0x2b')];return db['sequelize']['query'](_0x436cc1,{'type':db[_0xc41f('0x30')]['QueryTypes'][_0xc41f('0x32')],'raw':!![]});})['then'](function(_0x2247bb){if(_0x2247bb){_0x1a663e[_0xc41f('0x33')]=_0x2247bb[0x0];}if(typeof _0x1a663e[_0xc41f('0x34')]===_0xc41f('0x2c'))return;return getAgent(_0x1a663e[_0xc41f('0x34')]);})['then'](function(_0x1eedd3){if(_0x1eedd3){_0x1a663e[_0xc41f('0x35')]=util['format'](_0xc41f('0x37'),_0x1eedd3[_0xc41f('0x38')]);_0x1a663e['agent']=_0x1eedd3;}return request({'event':_0x168907,'message':_0x1a663e});})[_0xc41f('0x24')](function(_0x2e90f8){logger[_0xc41f('0x22')](_0xc41f('0x21'),_0xc41f('0x3e'),_0x2e90f8);});};}function afterUpdate(_0x1cf71d){return function(_0x2a881b){var _0x4c3771=_0x2a881b['changed'](_0xc41f('0x3f'))&&_0x2a881b[_0xc41f('0x3f')];var _0x13824a=_0x2a881b[_0xc41f('0x40')](_0xc41f('0x41'));if(_0x4c3771||_0x13824a){var _0x321f81=_0x4c3771?'closedinteraction':_0xc41f('0x41');var _0x48fce9=_0x2a881b['get']({'plain':!![]});_0x48fce9[_0xc41f('0x26')]=_0x1cf71d;_0x48fce9[_0xc41f('0x27')]=_0x1cf71d;_0x48fce9[_0xc41f('0x28')]=_0x4c3771?_0xc41f('0x3f'):'substatus';var _0x337d15=_0xc41f('0x2d')+_0x48fce9['ContactId'];return db[_0xc41f('0x2e')][_0xc41f('0x2f')](_0x337d15,{'type':db[_0xc41f('0x30')][_0xc41f('0x31')][_0xc41f('0x32')],'raw':!![]})[_0xc41f('0x1f')](function(_0x2f22e3){if(_0x2f22e3){_0x48fce9[_0xc41f('0x33')]=_0x2f22e3[0x0];}if(typeof _0x48fce9[_0xc41f('0x34')]===_0xc41f('0x2c'))return;return getAgent(_0x48fce9[_0xc41f('0x34')]);})[_0xc41f('0x1f')](function(_0x37ba4b){if(_0x37ba4b){_0x48fce9[_0xc41f('0x35')]=util[_0xc41f('0x36')](_0xc41f('0x37'),_0x37ba4b[_0xc41f('0x38')]);_0x48fce9[_0xc41f('0x42')]=_0x37ba4b;}return request({'event':_0x321f81,'message':_0x48fce9});})['catch'](function(_0x17c3d2){logger[_0xc41f('0x22')](_0xc41f('0x21'),'AfterUpdate',_0x17c3d2);});}};}function getAgent(_0x44a877){return db[_0xc41f('0x43')][_0xc41f('0x44')]({'where':{'id':_0x44a877},'attributes':['id',_0xc41f('0x38'),'fullname','email','internal'],'raw':!![]})[_0xc41f('0x1f')](function(_0x263fc2){return _0x263fc2;});}exports[_0xc41f('0x45')]=function(){for(var _0x18155f=0x0;_0x18155f<triggers['length'];_0x18155f+=0x1){if(db[_0xc41f('0x46')](triggers[_0x18155f]['model'])){db[triggers[_0x18155f][_0xc41f('0x47')]][_0xc41f('0x48')](triggers[_0x18155f][_0xc41f('0x28')],triggers[_0x18155f][_0xc41f('0x49')](triggers[_0x18155f][_0xc41f('0x26')][_0xc41f('0x4a')](),triggers[_0x18155f][_0xc41f('0x4b')]));}}};
\ No newline at end of file
index a8a44e2..9916b13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fce=['then','agents','catch','lodash','bluebird','../mysqldb','./license/util','mail','chat','sms','whatsapp','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','agent','User','count'];(function(_0x179773,_0x296780){var _0x13efcb=function(_0x590067){while(--_0x590067){_0x179773['push'](_0x179773['shift']());}};_0x13efcb(++_0x296780);}(_0x3fce,0x12e));var _0xe3fc=function(_0x466af7,_0x2f7551){_0x466af7=_0x466af7-0x0;var _0x348c96=_0x3fce[_0x466af7];return _0x348c96;};'use strict';var _=require(_0xe3fc('0x0'));var BPromise=require(_0xe3fc('0x1'));var db=require(_0xe3fc('0x2'))['db'];var util=require(_0xe3fc('0x3'));var channels=['voice',_0xe3fc('0x4'),_0xe3fc('0x5'),'fax',_0xe3fc('0x6'),_0xe3fc('0x7'),'openchannel'];exports[_0xe3fc('0x8')]=function(){return channels;};exports[_0xe3fc('0x9')]=function(_0x4fb2e5){_0x4fb2e5=_0x4fb2e5[_0xe3fc('0xa')]();return _[_0xe3fc('0xb')](channels,_0x4fb2e5);};exports[_0xe3fc('0xc')]=function(_0x167d62,_0x57e9ae,_0x22009e,_0x37b4fa){var _0xde8d69={'loginAttempts':_0x57e9ae,'blocked':_0x22009e};if(!_[_0xe3fc('0xd')](_0x37b4fa)){_0xde8d69[_0xe3fc('0xe')]=_0x37b4fa;}return _0x167d62[_0xe3fc('0xf')](_0xde8d69);};exports[_0xe3fc('0x10')]=function(_0x42d29f){return new BPromise(function(_0x31397b,_0x2e467d){var _0x1cceb0=0x0;if(_0x42d29f['role']!==_0xe3fc('0x11')){_0x31397b(_0x42d29f);}db[_0xe3fc('0x12')][_0xe3fc('0x13')]({'where':{'role':_0xe3fc('0x11'),'online':!![],'id':{'$ne':_0x42d29f['id']}}})[_0xe3fc('0x14')](function(_0x4d478d){_0x1cceb0=_0x4d478d;return util['getLicense']();})[_0xe3fc('0x14')](function(_0x2bafca){if(_0x2bafca&&_0x2bafca[_0xe3fc('0x15')]&&_0x1cceb0>=_0x2bafca[_0xe3fc('0x15')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x31397b(_0x42d29f);})[_0xe3fc('0x16')](function(_0x1b82a9){_0x2e467d(_0x1b82a9);});});};
\ No newline at end of file
+var _0x8902=['count','then','agents','lodash','bluebird','../mysqldb','./license/util','mail','chat','fax','sms','isValidChannel','toLowerCase','includes','clearBlockUser','blockedAt','getLicense','agent','User'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8902,0x1b8));var _0x2890=function(_0x30312f,_0x1d85e5){_0x30312f=_0x30312f-0x0;var _0x3a566f=_0x8902[_0x30312f];return _0x3a566f;};'use strict';var _=require(_0x2890('0x0'));var BPromise=require(_0x2890('0x1'));var db=require(_0x2890('0x2'))['db'];var util=require(_0x2890('0x3'));var channels=['voice',_0x2890('0x4'),_0x2890('0x5'),_0x2890('0x6'),_0x2890('0x7'),'whatsapp','openchannel'];exports['getChannels']=function(){return channels;};exports[_0x2890('0x8')]=function(_0x1b3aae){_0x1b3aae=_0x1b3aae[_0x2890('0x9')]();return _[_0x2890('0xa')](channels,_0x1b3aae);};exports[_0x2890('0xb')]=function(_0x4b0c98,_0x458050,_0x1609ab,_0x566562){var _0x3e4148={'loginAttempts':_0x458050,'blocked':_0x1609ab};if(!_['isUndefined'](_0x566562)){_0x3e4148[_0x2890('0xc')]=_0x566562;}return _0x4b0c98['updateAttributes'](_0x3e4148);};exports[_0x2890('0xd')]=function(_0x4d5d47){return new BPromise(function(_0x17d341,_0x180780){var _0x48d7d1=0x0;if(_0x4d5d47['role']!==_0x2890('0xe')){_0x17d341(_0x4d5d47);}db[_0x2890('0xf')][_0x2890('0x10')]({'where':{'role':_0x2890('0xe'),'online':!![],'id':{'$ne':_0x4d5d47['id']}}})['then'](function(_0x1931d6){_0x48d7d1=_0x1931d6;return util[_0x2890('0xd')]();})[_0x2890('0x11')](function(_0x5b357e){if(_0x5b357e&&_0x5b357e[_0x2890('0x12')]&&_0x48d7d1>=_0x5b357e[_0x2890('0x12')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x17d341(_0x4d5d47);})['catch'](function(_0x555505){_0x180780(_0x555505);});});};
\ No newline at end of file
index c6b5202..d64b8db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x153f=['inherits','Forbidden','OutOfInterval','error','status','send','exports','util','../config/logger','api','message','Internal\x20Server\x20Error','Error','Bad\x20Request','name','Entity\x20not\x20found','Not\x20Found'];(function(_0x3b1c36,_0x5d6885){var _0x542038=function(_0x284bcb){while(--_0x284bcb){_0x3b1c36['push'](_0x3b1c36['shift']());}};_0x542038(++_0x5d6885);}(_0x153f,0x15b));var _0xf153=function(_0x1c6f0d,_0x254eb0){_0x1c6f0d=_0x1c6f0d-0x0;var _0x512118=_0x153f[_0x1c6f0d];return _0x512118;};'use strict';var util=require(_0xf153('0x0'));var logger=require(_0xf153('0x1'))(_0xf153('0x2'));var APIError=function(_0x44cea3,_0x2afb9a){this[_0xf153('0x3')]=_0x44cea3||_0xf153('0x4');this['name']=_0x2afb9a||_0xf153('0x5');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x1f9ead){this[_0xf153('0x3')]=_0x1f9ead||_0xf153('0x6');this[_0xf153('0x7')]=_0xf153('0x6');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x17ba96){this[_0xf153('0x3')]=_0x17ba96||_0xf153('0x8');this[_0xf153('0x7')]=_0xf153('0x9');util[_0xf153('0xa')](APINotFoundError,APIError);};function getStatusCode(_0x44845c){switch(_0x44845c){case _0xf153('0x6'):return 0x190;case _0xf153('0xb'),_0xf153('0xc'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function handleError(_0x2b76eb){return function(_0x1c8de7){logger[_0xf153('0xd')](_0x1c8de7['stack']);var _0x3a8838=getStatusCode(_0x1c8de7[_0xf153('0x7')]);if(_0x1c8de7[_0xf153('0x7')])delete _0x1c8de7[_0xf153('0x7')];return _0x2b76eb[_0xf153('0xe')](_0x3a8838)[_0xf153('0xf')](_0x1c8de7);};}module[_0xf153('0x10')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError};
\ No newline at end of file
+var _0xbdb7=['Error','Bad\x20Request','Entity\x20not\x20found','inherits','Forbidden','OutOfInterval','Not\x20Found','status','util','../config/logger','api','message','Internal\x20Server\x20Error','name'];(function(_0xabe145,_0x2ef96d){var _0x433e19=function(_0x3eca1a){while(--_0x3eca1a){_0xabe145['push'](_0xabe145['shift']());}};_0x433e19(++_0x2ef96d);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x365a40,_0x5c073e){_0x365a40=_0x365a40-0x0;var _0x1dd6d5=_0xbdb7[_0x365a40];return _0x1dd6d5;};'use strict';var util=require(_0x7bdb('0x0'));var logger=require(_0x7bdb('0x1'))(_0x7bdb('0x2'));var APIError=function(_0x2a2c1c,_0x23c326){this[_0x7bdb('0x3')]=_0x2a2c1c||_0x7bdb('0x4');this[_0x7bdb('0x5')]=_0x23c326||_0x7bdb('0x6');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x28542c){this['message']=_0x28542c||'Bad\x20Request';this[_0x7bdb('0x5')]=_0x7bdb('0x7');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x513cba){this[_0x7bdb('0x3')]=_0x513cba||_0x7bdb('0x8');this['name']='Not\x20Found';util[_0x7bdb('0x9')](APINotFoundError,APIError);};function getStatusCode(_0x1a6b61){switch(_0x1a6b61){case _0x7bdb('0x7'):return 0x190;case _0x7bdb('0xa'),_0x7bdb('0xb'):return 0x193;case _0x7bdb('0xc'):return 0x194;default:return 0x1f4;}}function handleError(_0x297724){return function(_0x258cc6){logger['error'](_0x258cc6['stack']);var _0x52b9b9=getStatusCode(_0x258cc6[_0x7bdb('0x5')]);if(_0x258cc6[_0x7bdb('0x5')])delete _0x258cc6['name'];return _0x297724[_0x7bdb('0xd')](_0x52b9b9)['send'](_0x258cc6);};}module['exports']={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError};
\ No newline at end of file
index bfb364e..f7ccf4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x312f=['send','exports','404','status','render','json'];(function(_0x4e35e5,_0x41ff30){var _0x1778e4=function(_0x5e900c){while(--_0x5e900c){_0x4e35e5['push'](_0x4e35e5['shift']());}};_0x1778e4(++_0x41ff30);}(_0x312f,0x1ab));var _0xf312=function(_0x1dadd8,_0x41f173){_0x1dadd8=_0x1dadd8-0x0;var _0x2ff460=_0x312f[_0x1dadd8];return _0x2ff460;};'use strict';module[_0xf312('0x0')][0x194]=function pageNotFound(_0x1e8297,_0x1a3ca6){var _0x2b3a20=_0xf312('0x1');var _0x4d6a6f=0x194;var _0x564bb2={'status':_0x4d6a6f};_0x1a3ca6[_0xf312('0x2')](_0x564bb2['status']);_0x1a3ca6[_0xf312('0x3')](_0x2b3a20,{},function(_0x259d35,_0x276bf3){if(_0x259d35){return _0x1a3ca6[_0xf312('0x2')](_0x564bb2[_0xf312('0x2')])[_0xf312('0x4')](_0x564bb2);}_0x1a3ca6[_0xf312('0x5')](_0x276bf3);});};
\ No newline at end of file
+var _0x0efb=['send','exports','404','status','render','json'];(function(_0xb92c03,_0x3eae0a){var _0x4838de=function(_0x55d5da){while(--_0x55d5da){_0xb92c03['push'](_0xb92c03['shift']());}};_0x4838de(++_0x3eae0a);}(_0x0efb,0x163));var _0xb0ef=function(_0x41cfd4,_0x1ed2cc){_0x41cfd4=_0x41cfd4-0x0;var _0x190f48=_0x0efb[_0x41cfd4];return _0x190f48;};'use strict';module[_0xb0ef('0x0')][0x194]=function pageNotFound(_0x2d2988,_0x28329b){var _0x231a6a=_0xb0ef('0x1');var _0x486d61=0x194;var _0x2c0ecb={'status':_0x486d61};_0x28329b[_0xb0ef('0x2')](_0x2c0ecb['status']);_0x28329b[_0xb0ef('0x3')](_0x231a6a,{},function(_0x56a305,_0x108863){if(_0x56a305){return _0x28329b[_0xb0ef('0x2')](_0x2c0ecb[_0xb0ef('0x2')])[_0xb0ef('0x4')](_0x2c0ecb);}_0x28329b[_0xb0ef('0x5')](_0x108863);});};
\ No newline at end of file
index 4096506..4dae7b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x554f=['ChatOfflineMessage','ChatOfflineMessageId','TagId','Items','FaxAccountId','Exntensions','FaxMessage','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','Users','SmsQueueId','team_has_sms_queues','Teams','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','ProactiveActions','ChatApplication','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','team_has_chat_queues','ChatGroupId','chat_group_has_users','Contacts','CompanyId','Phones','CmContactId','cm_contact_has_tags','AdditionalPhones','Agent','Campaign','OwnerId','CampaignId','All','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','SmsApplications','DefaultReportId','CustomReportId','Sound','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','CmHopperId','AllConditions','AllCondition','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','Configurations','AccountId','SubjectId','SalesforceField','DescriptionId','FieldId','Description','VariableId','Subjects','Subject','Field','Descriptions','int_desk_configuration_has_tags','ZohoAccount','ZohoConfiguration','ZendeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','VtigerConfiguration','VtigerField','Dynamics365Account','FreshsalesAccount','FromId','ToId','SessionId','ProjectId','TeamVoiceQueue','team_has_openchannel_queues','OpenchannelQueues','WhatsappQueues','Hoppers','SquareProjectId','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','ToUserId','ToMailQueueId','ToQueue','ToAccount','FromChatWebsiteId','FromAgent','ToAgent','ToChatQueueId','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','FromUserId','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','Queues','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','WhatsappQueueReport','ToWhatsappAccountId','WhatsappQueueId','user','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','127.0.0.1','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','xC@LL1234','mysql','name','database','username','password','options','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','Trunk','../api/trunk/trunk.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../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','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','VoiceMail','cascade','userSetting','hasMany','Recordings','UserId','VoiceQueuesRt','VoiceExtension','Extensions','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','SmsInteractions','WhatsappInteractions','UserNotification','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','CmContact','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','MailInteractions','user_has_mail_interactions','ChatInteractions','FaxInteractions','user_has_fax_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueues','ChatQueues','FaxQueue','FaxQueues','SmsQueues','UserOpenchannelQueue','UserWhatsappQueue','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','VoiceContext','Applications','VoiceMusicOnHold','Sounds','moh_has_sounds','Members','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','mailboxuser','mailbox','VoiceQueueReport','QueueCalls','uniqueid','Contact','ContactId','MailServerIn','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Dispositions','Answers','Messages','Interactions','List','ListId','Template','TemplateId','team_has_mail_queues','MailInteractionId','Account','Owner','Tag','mail_interaction_has_tags','Tags','ThroughTags','Attachment','Attachments','Interaction','ChatWebsiteId'];(function(_0x4b4717,_0x1ab8ff){var _0x56edc8=function(_0x4f89ab){while(--_0x4f89ab){_0x4b4717['push'](_0x4b4717['shift']());}};_0x56edc8(++_0x1ab8ff);}(_0x554f,0x8a));var _0xf554=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x554f[_0x178e48];return _0x440d7e;};'use strict';var config=require(_0xf554('0x0'));var Sequelize=require(_0xf554('0x1'));var _=require(_0xf554('0x2'));var jstz=require(_0xf554('0x3'));var timezone=jstz[_0xf554('0x4')]();config[_0xf554('0x1')]=_[_0xf554('0x5')](config[_0xf554('0x1')],{'database':_0xf554('0x6'),'username':_0xf554('0x7'),'password':'xC@LL1234','options':{'host':_0xf554('0x8'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xf554('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xf554('0xa'),'collate':_0xf554('0xb')}}});config[_0xf554('0xc')]=_[_0xf554('0x5')](config[_0xf554('0xc')],{'database':_0xf554('0x6'),'username':_0xf554('0x7'),'password':_0xf554('0xd'),'options':{'host':_0xf554('0x8'),'port':0xcea,'dialect':_0xf554('0xe'),'dialectOptions':{'charset':_0xf554('0x9')},'logging':![],'timezone':timezone[_0xf554('0xf')](),'define':{'charset':_0xf554('0xa'),'collate':_0xf554('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf554('0x1')][_0xf554('0x10')],config[_0xf554('0x1')][_0xf554('0x11')],config[_0xf554('0x1')][_0xf554('0x12')],config[_0xf554('0x1')][_0xf554('0x13')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf554('0xc')]['database'],config[_0xf554('0xc')][_0xf554('0x11')],config[_0xf554('0xc')][_0xf554('0x12')],config['sequelizeHistory'][_0xf554('0x13')])};db[_0xf554('0x14')]=db['sequelize'][_0xf554('0x15')]('../api/user/user.model');db[_0xf554('0x16')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x17'));db['VoiceContext']=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x18'));db['VoiceExtension']=db['sequelize'][_0xf554('0x15')](_0xf554('0x19'));db['VoiceMusicOnHold']=db['sequelize']['import'](_0xf554('0x1a'));db[_0xf554('0x1b')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x1c'));db[_0xf554('0x1d')]=db[_0xf554('0x1')][_0xf554('0x15')]('../api/voiceRecording/voiceRecording.model');db['ScreenRecording']=db['sequelize'][_0xf554('0x15')]('../api/screenRecording/screenRecording.model');db['VoiceMail']=db[_0xf554('0x1')]['import'](_0xf554('0x1e'));db[_0xf554('0x1f')]=db[_0xf554('0x1')][_0xf554('0x15')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0xf554('0x20')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x21'));db[_0xf554('0x22')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x23'));db[_0xf554('0x24')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x25'));db['VoiceQueueReport']=db[_0xf554('0x1')][_0xf554('0x15')]('../api/voiceQueueReport/voiceQueueReport.model');db['MemberReport']=db[_0xf554('0x1')][_0xf554('0x15')]('../api/memberReport/memberReport.model');db[_0xf554('0x26')]=db['sequelize']['import'](_0xf554('0x27'));db['VoiceTransferReport']=db[_0xf554('0x1')]['import']('../api/voiceTransferReport/voiceTransferReport.model');db[_0xf554('0x28')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x29'));db[_0xf554('0x2a')]=db[_0xf554('0x1')]['import'](_0xf554('0x2b'));db[_0xf554('0x2c')]=db[_0xf554('0x1')]['import'](_0xf554('0x2d'));db[_0xf554('0x2e')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x2f'));db[_0xf554('0x30')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x31'));db[_0xf554('0x32')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x33'));db['UserOpenchannelQueue']=db['sequelize'][_0xf554('0x15')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db['UserWhatsappQueue']=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x34'));db['MailServerIn']=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x35'));db['MailServerOut']=db[_0xf554('0x1')]['import'](_0xf554('0x36'));db[_0xf554('0x37')]=db['sequelize'][_0xf554('0x15')](_0xf554('0x38'));db[_0xf554('0x39')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x3a'));db[_0xf554('0x3b')]=db[_0xf554('0x1')]['import'](_0xf554('0x3c'));db[_0xf554('0x3d')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x3e'));db[_0xf554('0x3f')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x40'));db[_0xf554('0x41')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x42'));db[_0xf554('0x43')]=db['sequelize']['import'](_0xf554('0x44'));db[_0xf554('0x45')]=db[_0xf554('0x1')]['import']('../api/dashboard/dashboard.model');db[_0xf554('0x46')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x47'));db[_0xf554('0x48')]=db['sequelize'][_0xf554('0x15')](_0xf554('0x49'));db[_0xf554('0x4a')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x4b'));db[_0xf554('0x4c')]=db['sequelize'][_0xf554('0x15')](_0xf554('0x4d'));db['FaxMessage']=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x4e'));db['FaxQueue']=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x4f'));db[_0xf554('0x50')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x51'));db[_0xf554('0x52')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x53'));db[_0xf554('0x54')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x55'));db[_0xf554('0x56')]=db[_0xf554('0x1')]['import'](_0xf554('0x57'));db[_0xf554('0x58')]=db[_0xf554('0x1')][_0xf554('0x15')]('../api/smsMessage/smsMessage.model');db[_0xf554('0x59')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x5a'));db[_0xf554('0x5b')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x5c'));db['OpenchannelApplication']=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x5d'));db[_0xf554('0x5e')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x5f'));db[_0xf554('0x60')]=db['sequelize'][_0xf554('0x15')](_0xf554('0x61'));db[_0xf554('0x62')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x63'));db[_0xf554('0x64')]=db[_0xf554('0x1')]['import'](_0xf554('0x65'));db[_0xf554('0x66')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x67'));db['ChatApplication']=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x68'));db[_0xf554('0x69')]=db[_0xf554('0x1')]['import'](_0xf554('0x6a'));db[_0xf554('0x6b')]=db[_0xf554('0x1')]['import']('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db['sequelize'][_0xf554('0x15')](_0xf554('0x6c'));db[_0xf554('0x6d')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x6e'));db[_0xf554('0x6f')]=db[_0xf554('0x1')]['import'](_0xf554('0x70'));db[_0xf554('0x71')]=db[_0xf554('0x1')]['import'](_0xf554('0x72'));db[_0xf554('0x73')]=db[_0xf554('0x1')]['import'](_0xf554('0x74'));db['CmContact']=db[_0xf554('0x1')]['import'](_0xf554('0x75'));db[_0xf554('0x76')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x77'));db[_0xf554('0x78')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x79'));db[_0xf554('0x7a')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x7b'));db[_0xf554('0x7c')]=db[_0xf554('0x1')][_0xf554('0x15')]('../api/cmHopperHistory/cmHopperHistory.model');db['ReportAgentPreview']=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x7d'));db[_0xf554('0x7e')]=db['sequelize'][_0xf554('0x15')](_0xf554('0x7f'));db[_0xf554('0x80')]=db['sequelize']['import'](_0xf554('0x81'));db[_0xf554('0x82')]=db['sequelize'][_0xf554('0x15')](_0xf554('0x83'));db[_0xf554('0x84')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x85'));db[_0xf554('0x86')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x87'));db[_0xf554('0x88')]=db['sequelize'][_0xf554('0x15')](_0xf554('0x89'));db[_0xf554('0x8a')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x8b'));db[_0xf554('0x8c')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x8d'));db[_0xf554('0x8e')]=db['sequelize'][_0xf554('0x15')](_0xf554('0x8f'));db[_0xf554('0x90')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x91'));db[_0xf554('0x92')]=db['sequelize'][_0xf554('0x15')](_0xf554('0x93'));db['Sound']=db['sequelize'][_0xf554('0x15')]('../api/sound/sound.model');db['Tag']=db['sequelize']['import']('../api/tag/tag.model');db[_0xf554('0x94')]=db[_0xf554('0x1')]['import'](_0xf554('0x95'));db[_0xf554('0x96')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x97'));db[_0xf554('0x98')]=db['sequelize']['import'](_0xf554('0x99'));db['Template']=db[_0xf554('0x1')][_0xf554('0x15')]('../api/template/template.model');db[_0xf554('0x9a')]=db['sequelize']['import'](_0xf554('0x9b'));db[_0xf554('0x9c')]=db[_0xf554('0x1')]['import'](_0xf554('0x9d'));db[_0xf554('0x9e')]=db[_0xf554('0x1')]['import'](_0xf554('0x9f'));db[_0xf554('0xa0')]=db['sequelize'][_0xf554('0x15')](_0xf554('0xa1'));db[_0xf554('0xa2')]=db[_0xf554('0x1')][_0xf554('0x15')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0xf554('0xa3')]=db[_0xf554('0x1')]['import']('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xf554('0xa4')]=db[_0xf554('0x1')][_0xf554('0x15')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xf554('0xa5')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0xa6'));db[_0xf554('0xa7')]=db[_0xf554('0x1')][_0xf554('0x15')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db['sequelize'][_0xf554('0x15')](_0xf554('0xa8'));db[_0xf554('0xa9')]=db['sequelize'][_0xf554('0x15')](_0xf554('0xaa'));db[_0xf554('0xab')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0xac'));db['SalesforceField']=db[_0xf554('0x1')][_0xf554('0x15')]('../api/intSalesforceField/intSalesforceField.model');db[_0xf554('0xad')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0xae'));db[_0xf554('0xaf')]=db['sequelize']['import']('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0xf554('0xb0')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0xb1'));db[_0xf554('0xb2')]=db[_0xf554('0x1')]['import']('../api/intDeskAccount/intDeskAccount.model');db[_0xf554('0xb3')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0xb4'));db[_0xf554('0xb5')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0xb6'));db['ZohoAccount']=db[_0xf554('0x1')]['import'](_0xf554('0xb7'));db['ZohoConfiguration']=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0xb8'));db[_0xf554('0xb9')]=db[_0xf554('0x1')][_0xf554('0x15')]('../api/intZohoField/intZohoField.model');db['ZendeskAccount']=db['sequelize'][_0xf554('0x15')](_0xf554('0xba'));db['ZendeskConfiguration']=db[_0xf554('0x1')]['import'](_0xf554('0xbb'));db[_0xf554('0xbc')]=db[_0xf554('0x1')]['import']('../api/intZendeskField/intZendeskField.model');db[_0xf554('0xbd')]=db[_0xf554('0x1')][_0xf554('0x15')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xf554('0xbe')]=db[_0xf554('0x1')]['import'](_0xf554('0xbf'));db[_0xf554('0xc0')]=db[_0xf554('0x1')]['import']('../api/intFreshdeskField/intFreshdeskField.model');db[_0xf554('0xc1')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0xc2'));db['VtigerConfiguration']=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0xc3'));db['VtigerField']=db['sequelize']['import'](_0xf554('0xc4'));db[_0xf554('0xc5')]=db['sequelize'][_0xf554('0x15')](_0xf554('0xc6'));db[_0xf554('0xc7')]=db[_0xf554('0x1')]['import'](_0xf554('0xc8'));db[_0xf554('0xc9')]=db[_0xf554('0x1')]['import'](_0xf554('0xca'));db['Dynamics365Account']=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0xcb'));db[_0xf554('0xcc')]=db[_0xf554('0x1')]['import'](_0xf554('0xcd'));db[_0xf554('0xce')]=db['sequelize'][_0xf554('0x15')]('../api/intDynamics365Field/intDynamics365Field.model');db['FreshsalesAccount']=db[_0xf554('0x1')][_0xf554('0x15')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0xf554('0xcf')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0xd0'));db[_0xf554('0xd1')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0xd2'));db[_0xf554('0x9e')]=db['sequelize']['import'](_0xf554('0x9f'));db[_0xf554('0xd3')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0xd4'));db[_0xf554('0xd5')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0xd6'));db[_0xf554('0xd7')]=db[_0xf554('0x1')]['import'](_0xf554('0xd8'));db[_0xf554('0xd9')]=db[_0xf554('0x1')][_0xf554('0x15')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xf554('0xda')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0xdb'));db[_0xf554('0xdc')]=db['sequelize'][_0xf554('0x15')](_0xf554('0xdd'));db[_0xf554('0xde')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0xdf'));db[_0xf554('0xe0')]=db[_0xf554('0x1')][_0xf554('0x15')]('../api/squareReport/squareReport.model');db[_0xf554('0xe1')]=db[_0xf554('0x1')]['import'](_0xf554('0xe2'));db[_0xf554('0xe3')]=db[_0xf554('0x1')]['import'](_0xf554('0xe4'));db['Setting']=db[_0xf554('0x1')]['import'](_0xf554('0xe5'));db[_0xf554('0xe6')]=db[_0xf554('0x1')][_0xf554('0x15')]('../api/squareOdbc/squareOdbc.model');db[_0xf554('0xe7')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0xe8'));db[_0xf554('0xe9')]=db['sequelize'][_0xf554('0x15')](_0xf554('0xea'));db['SquareMessage']=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0xeb'));db[_0xf554('0xec')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0xed'));db[_0xf554('0xee')]=db[_0xf554('0x1')]['import'](_0xf554('0xef'));db['Campaign']=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0xf0'));db[_0xf554('0xf1')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0xf2'));db['Attachment']=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0xf3'));db[_0xf554('0xf4')]=db['sequelize'][_0xf554('0x15')]('../api/plugin/plugin.model');db['MailTransferReport']=db[_0xf554('0x1')][_0xf554('0x15')]('../api/mailTransferReport/mailTransferReport.model');db[_0xf554('0xf5')]=db['sequelize'][_0xf554('0x15')](_0xf554('0xf6'));db['FaxTransferReport']=db['sequelize'][_0xf554('0x15')](_0xf554('0xf7'));db[_0xf554('0xf8')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0xf9'));db['SmsTransferReport']=db['sequelize'][_0xf554('0x15')](_0xf554('0xfa'));db[_0xf554('0xfb')]=db['sequelize']['import'](_0xf554('0xfc'));db[_0xf554('0xfd')]=db[_0xf554('0x1')]['import'](_0xf554('0xfe'));db[_0xf554('0xff')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x100'));db[_0xf554('0x101')]=db[_0xf554('0x1')]['import'](_0xf554('0x102'));db[_0xf554('0x103')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x104'));db['UserNotification']=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x105'));db[_0xf554('0x106')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x107'));db[_0xf554('0x108')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x109'));db[_0xf554('0x10a')]=db[_0xf554('0x1')]['import']('../api/whatsappInteraction/whatsappInteraction.model');db['WhatsappMessage']=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x10b'));db['WhatsappQueueReport']=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x10c'));db[_0xf554('0x10d')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x10e'));db[_0xf554('0x10f')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x110'));db[_0xf554('0x111')]=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x112'));db['TeamVoiceQueue']=db[_0xf554('0x1')][_0xf554('0x15')](_0xf554('0x113'));db[_0xf554('0x114')]=db[_0xf554('0x1')]['import'](_0xf554('0x115'));db[_0xf554('0x116')]=db['sequelize']['import'](_0xf554('0x117'));db[_0xf554('0x118')]=db['sequelize'][_0xf554('0x15')](_0xf554('0x119'));db['User'][_0xf554('0x11a')](db['VoiceMail'],{'as':_0xf554('0x11b'),'onDelete':_0xf554('0x11c'),'foreignKey':'UserId'});db['User'][_0xf554('0x11a')](db[_0xf554('0x118')],{'as':_0xf554('0x11d'),'onDelete':'cascade','foreignKey':'UserId'});db['User'][_0xf554('0x11e')](db[_0xf554('0x1d')],{'as':_0xf554('0x11f'),'foreignKey':_0xf554('0x120')});db[_0xf554('0x14')][_0xf554('0x11e')](db[_0xf554('0x28')],{'as':_0xf554('0x121'),'foreignKey':_0xf554('0x120')});db['User']['hasMany'](db[_0xf554('0x122')],{'as':_0xf554('0x123'),'onDelete':_0xf554('0x11c'),'hooks':!![]});db['User'][_0xf554('0x11e')](db[_0xf554('0x7a')],{'as':_0xf554('0x124'),'foreignKey':_0xf554('0x120')});db[_0xf554('0x14')]['hasMany'](db[_0xf554('0x7c')],{'as':_0xf554('0x125'),'foreignKey':_0xf554('0x120')});db[_0xf554('0x14')][_0xf554('0x11e')](db[_0xf554('0x126')],{'as':_0xf554('0x126'),'foreignKey':_0xf554('0x120')});db[_0xf554('0x14')][_0xf554('0x11e')](db['OpenchannelInteraction'],{'as':_0xf554('0x127'),'foreignKey':_0xf554('0x120')});db[_0xf554('0x14')][_0xf554('0x11e')](db[_0xf554('0x69')],{'as':'ChatInteractions','foreignKey':_0xf554('0x120')});db[_0xf554('0x14')][_0xf554('0x11e')](db['SmsInteraction'],{'as':_0xf554('0x128'),'foreignKey':'UserId'});db[_0xf554('0x14')][_0xf554('0x11e')](db[_0xf554('0x4c')],{'as':'FaxInteractions','foreignKey':_0xf554('0x120')});db['User']['hasMany'](db[_0xf554('0x3d')],{'as':'MailInteractions','foreignKey':_0xf554('0x120')});db['User'][_0xf554('0x11e')](db[_0xf554('0x10a')],{'as':_0xf554('0x129'),'foreignKey':_0xf554('0x120')});db[_0xf554('0x14')][_0xf554('0x11e')](db[_0xf554('0x12a')],{'as':_0xf554('0x12b'),'foreignKey':_0xf554('0x12c')});db[_0xf554('0x14')][_0xf554('0x12d')](db[_0xf554('0xff')],{'as':_0xf554('0xff'),'foreignKey':_0xf554('0x12e')});db['User'][_0xf554('0x12f')](db[_0xf554('0x6f')],{'as':'Groups','through':'chat_group_has_users'});db['User']['belongsToMany'](db[_0xf554('0x130')],{'as':'Contacts','through':_0xf554('0x131')});db[_0xf554('0x14')][_0xf554('0x12f')](db[_0xf554('0xfb')],{'as':_0xf554('0x132'),'through':_0xf554('0x133')});db[_0xf554('0x14')]['belongsToMany'](db[_0xf554('0xec')],{'through':_0xf554('0x134')});db['User'][_0xf554('0x12f')](db['MailInteraction'],{'as':_0xf554('0x135'),'through':_0xf554('0x136')});db[_0xf554('0x14')][_0xf554('0x12f')](db[_0xf554('0x69')],{'as':_0xf554('0x137'),'through':'user_has_chat_interactions'});db[_0xf554('0x14')][_0xf554('0x12f')](db[_0xf554('0x4c')],{'as':_0xf554('0x138'),'through':_0xf554('0x139')});db[_0xf554('0x14')]['belongsToMany'](db[_0xf554('0x56')],{'as':_0xf554('0x128'),'through':'user_has_sms_interactions'});db[_0xf554('0x14')][_0xf554('0x12f')](db[_0xf554('0x5e')],{'as':_0xf554('0x127'),'through':_0xf554('0x13a')});db[_0xf554('0x14')]['belongsToMany'](db[_0xf554('0x10a')],{'as':_0xf554('0x129'),'through':_0xf554('0x13b')});db[_0xf554('0x14')][_0xf554('0x12f')](db[_0xf554('0x1b')],{'as':_0xf554('0x13c'),'through':_0xf554('0x2a'),'required':![]});db[_0xf554('0x14')][_0xf554('0x12f')](db['VoicePrefix'],{'as':_0xf554('0x13d'),'through':_0xf554('0x116'),'required':![]});db[_0xf554('0x14')][_0xf554('0x12f')](db[_0xf554('0x39')],{'as':_0xf554('0x13e'),'through':_0xf554('0x2e'),'required':![]});db[_0xf554('0x14')]['belongsToMany'](db['ChatQueue'],{'as':_0xf554('0x13f'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0xf554('0x14')][_0xf554('0x12f')](db[_0xf554('0x140')],{'as':_0xf554('0x141'),'through':_0xf554('0x30'),'required':![]});db[_0xf554('0x14')][_0xf554('0x12f')](db['SmsQueue'],{'as':_0xf554('0x142'),'through':_0xf554('0x32'),'required':![]});db['User'][_0xf554('0x12f')](db[_0xf554('0x62')],{'as':'OpenchannelQueues','through':_0xf554('0x143'),'required':![]});db[_0xf554('0x14')][_0xf554('0x12f')](db[_0xf554('0x10f')],{'as':'WhatsappQueues','through':_0xf554('0x144'),'required':![]});db[_0xf554('0x14')]['belongsToMany'](db['CmList'],{'through':_0xf554('0x133')});db[_0xf554('0x14')][_0xf554('0x12f')](db[_0xf554('0x64')],{'as':_0xf554('0x145'),'through':_0xf554('0x146')});db[_0xf554('0x14')][_0xf554('0x12f')](db[_0xf554('0x48')],{'as':_0xf554('0x147'),'through':_0xf554('0x148')});db[_0xf554('0x14')][_0xf554('0x12f')](db['MailAccount'],{'as':_0xf554('0x149'),'through':_0xf554('0x14a')});db[_0xf554('0x14')][_0xf554('0x12f')](db[_0xf554('0x5b')],{'as':_0xf554('0x14b'),'through':_0xf554('0x14c')});db[_0xf554('0x14')][_0xf554('0x12f')](db[_0xf554('0x52')],{'as':_0xf554('0x14d'),'through':_0xf554('0x14e')});db[_0xf554('0x14')][_0xf554('0x12f')](db['WhatsappAccount'],{'as':_0xf554('0x14f'),'through':_0xf554('0x150')});db[_0xf554('0x16')][_0xf554('0x11e')](db[_0xf554('0x122')],{'as':_0xf554('0x151'),'onDelete':_0xf554('0x11c'),'foreignKey':_0xf554('0x152')});db[_0xf554('0x153')]['hasMany'](db[_0xf554('0x122')],{'onDelete':_0xf554('0x11c')});db[_0xf554('0x122')]['hasMany'](db['VoiceExtension'],{'as':_0xf554('0x154'),'onDelete':'cascade'});db[_0xf554('0x155')][_0xf554('0x12f')](db['Sound'],{'as':_0xf554('0x156'),'through':_0xf554('0x157')});db[_0xf554('0x1b')]['hasMany'](db[_0xf554('0x28')],{'as':_0xf554('0x158'),'foreignKey':_0xf554('0x159')});db[_0xf554('0x1b')][_0xf554('0x11e')](db[_0xf554('0x76')],{'as':'Hoppers','foreignKey':_0xf554('0x159')});db['VoiceQueue'][_0xf554('0x11e')](db[_0xf554('0x7a')],{'as':_0xf554('0x124'),'foreignKey':_0xf554('0x159')});db['VoiceQueue']['hasMany'](db[_0xf554('0x7c')],{'as':_0xf554('0x15a'),'foreignKey':'VoiceQueueId'});db[_0xf554('0x1b')][_0xf554('0x11e')](db[_0xf554('0x126')],{'as':_0xf554('0x126'),'foreignKey':_0xf554('0x159')});db[_0xf554('0x1b')][_0xf554('0x11e')](db['CmHopperBlack'],{'as':_0xf554('0x15b'),'foreignKey':'VoiceQueueId'});db[_0xf554('0x1b')]['hasMany'](db[_0xf554('0xdc')],{'as':_0xf554('0x15c'),'foreignKey':_0xf554('0x159')});db[_0xf554('0x1b')][_0xf554('0x12d')](db[_0xf554('0x26')],{'as':_0xf554('0x26'),'foreignKey':_0xf554('0x15d')});db[_0xf554('0x1b')]['belongsTo'](db[_0xf554('0x26')],{'as':_0xf554('0x15e'),'foreignKey':_0xf554('0x15f')});db[_0xf554('0x1b')]['belongsTo'](db['Interval'],{'as':_0xf554('0x8a'),'foreignKey':_0xf554('0x160')});db[_0xf554('0x1b')][_0xf554('0x12d')](db[_0xf554('0x8c')],{'as':_0xf554('0x161'),'foreignKey':_0xf554('0x162')});db[_0xf554('0x1b')][_0xf554('0x12f')](db[_0xf554('0xfb')],{'as':_0xf554('0x132'),'through':_0xf554('0x163')});db[_0xf554('0x1b')][_0xf554('0x12f')](db['User'],{'as':_0xf554('0x164'),'through':_0xf554('0x2a')});db[_0xf554('0x1b')][_0xf554('0x12f')](db[_0xf554('0xec')],{'as':'Teams','through':'TeamVoiceQueue'});db[_0xf554('0x1b')][_0xf554('0x12f')](db[_0xf554('0xfb')],{'as':_0xf554('0x165'),'through':_0xf554('0x166')});db[_0xf554('0x1d')][_0xf554('0x12d')](db[_0xf554('0x14')],{'as':_0xf554('0x14'),'foreignKey':'UserId'});db[_0xf554('0x167')]['belongsTo'](db['User'],{'as':'User','foreignKey':'UserId'});db[_0xf554('0x11b')]['hasMany'](db[_0xf554('0x1f')],{'as':'Messages','onDelete':_0xf554('0x11c'),'foreignKey':_0xf554('0x168'),'sourceKey':_0xf554('0x169')});db[_0xf554('0x1f')]['belongsTo'](db['VoiceMail'],{'foreignKey':_0xf554('0x168'),'targetKey':'mailbox'});db['VoiceCallReport']['hasMany'](db[_0xf554('0x16a')],{'as':_0xf554('0x16b'),'foreignKey':_0xf554('0x16c'),'constraints':![]});db['VoiceCallReport']['hasMany'](db[_0xf554('0x24')],{'as':'AgentReports','foreignKey':_0xf554('0x16c'),'constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0xf554('0x14')],{'as':_0xf554('0x14'),'foreignKey':_0xf554('0x120')});db[_0xf554('0x20')][_0xf554('0x12d')](db[_0xf554('0x130')],{'as':_0xf554('0x16d'),'foreignKey':_0xf554('0x16e')});db[_0xf554('0x16f')]['belongsTo'](db['MailAccount'],{'as':_0xf554('0x37'),'foreignKey':_0xf554('0x170')});db['MailServerIn'][_0xf554('0x12d')](db[_0xf554('0x111')],{'as':_0xf554('0x111'),'foreignKey':_0xf554('0x171'),'onDelete':'restrict'});db[_0xf554('0x172')][_0xf554('0x12d')](db['MailAccount'],{'as':_0xf554('0x37'),'foreignKey':'MailAccountId'});db[_0xf554('0x172')][_0xf554('0x12d')](db[_0xf554('0x111')],{'as':_0xf554('0x111'),'foreignKey':_0xf554('0x171'),'onDelete':_0xf554('0x173')});db[_0xf554('0x37')][_0xf554('0x11a')](db[_0xf554('0x16f')],{'as':_0xf554('0x174'),'onDelete':_0xf554('0x11c')});db['MailAccount'][_0xf554('0x11a')](db[_0xf554('0x172')],{'as':_0xf554('0x175'),'onDelete':_0xf554('0x11c')});db['MailAccount'][_0xf554('0x11e')](db[_0xf554('0x86')],{'as':_0xf554('0x176'),'foreignKey':_0xf554('0x170'),'onDelete':_0xf554('0x11c')});db[_0xf554('0x37')][_0xf554('0x11e')](db[_0xf554('0x84')],{'as':_0xf554('0x177'),'foreignKey':_0xf554('0x170')});db[_0xf554('0x37')][_0xf554('0x11e')](db[_0xf554('0x3f')],{'as':_0xf554('0x178'),'foreignKey':_0xf554('0x170')});db[_0xf554('0x37')]['hasMany'](db[_0xf554('0x3d')],{'as':_0xf554('0x179')});db[_0xf554('0x37')]['hasMany'](db[_0xf554('0x41')],{'as':_0xf554('0x154')});db['MailAccount'][_0xf554('0x12d')](db[_0xf554('0xfb')],{'as':_0xf554('0x17a'),'foreignKey':_0xf554('0x17b')});db['MailAccount'][_0xf554('0x12d')](db['Template'],{'as':_0xf554('0x17c'),'foreignKey':_0xf554('0x17d')});db[_0xf554('0x37')][_0xf554('0x12d')](db[_0xf554('0x8c')],{'as':_0xf554('0x161'),'foreignKey':_0xf554('0x162')});db['MailAccount'][_0xf554('0x12f')](db[_0xf554('0x14')],{'as':_0xf554('0x164'),'through':_0xf554('0x14a')});db['MailQueue']['belongsToMany'](db[_0xf554('0x14')],{'as':_0xf554('0x164'),'through':_0xf554('0x2e')});db[_0xf554('0x39')][_0xf554('0x12f')](db[_0xf554('0xec')],{'through':_0xf554('0x17e'),'as':'Teams'});db[_0xf554('0x3d')]['hasMany'](db['MailMessage'],{'as':_0xf554('0x178'),'onDelete':'cascade','foreignKey':_0xf554('0x17f')});db['MailInteraction']['belongsTo'](db[_0xf554('0x37')],{'as':_0xf554('0x180'),'foreignKey':'MailAccountId'});db[_0xf554('0x3d')][_0xf554('0x12d')](db[_0xf554('0x130')],{'as':'Contact','foreignKey':_0xf554('0x16e')});db['MailInteraction'][_0xf554('0x12d')](db[_0xf554('0x14')],{'as':_0xf554('0x181'),'foreignKey':_0xf554('0x120')});db['MailInteraction'][_0xf554('0x12f')](db[_0xf554('0x182')],{'through':_0xf554('0x183'),'as':_0xf554('0x184')});db[_0xf554('0x3d')][_0xf554('0x12f')](db['Tag'],{'through':'mail_interaction_has_tags','as':_0xf554('0x185')});db['MailInteraction'][_0xf554('0x12f')](db['User'],{'as':'Users','through':_0xf554('0x136'),'foreignKey':_0xf554('0x17f')});db['MailMessage']['hasMany'](db[_0xf554('0x186')],{'as':_0xf554('0x187'),'onDelete':_0xf554('0x11c')});db[_0xf554('0x3f')][_0xf554('0x12d')](db[_0xf554('0x14')],{'as':_0xf554('0x14')});db[_0xf554('0x3f')]['belongsTo'](db[_0xf554('0x130')],{'onDelete':_0xf554('0x11c'),'as':_0xf554('0x16d')});db['MailMessage'][_0xf554('0x12d')](db[_0xf554('0x3d')],{'as':_0xf554('0x188'),'foreignKey':_0xf554('0x17f')});db[_0xf554('0x3f')]['belongsTo'](db[_0xf554('0x37')],{'as':_0xf554('0x180'),'foreignKey':_0xf554('0x170')});db[_0xf554('0x3f')][_0xf554('0x12d')](db[_0xf554('0x64')],{'as':_0xf554('0x64'),'foreignKey':_0xf554('0x189')});db[_0xf554('0x3f')][_0xf554('0x12d')](db[_0xf554('0x18a')],{'as':'ChatOfflineMessage','foreignKey':_0xf554('0x18b')});db[_0xf554('0x41')][_0xf554('0x12d')](db[_0xf554('0x14')],{'onDelete':_0xf554('0x173')});db[_0xf554('0x41')][_0xf554('0x12d')](db[_0xf554('0x39')],{'onDelete':'restrict'});db['MailApplication']['belongsTo'](db[_0xf554('0x37')],{'onDelete':_0xf554('0x173')});db[_0xf554('0x41')][_0xf554('0x12d')](db[_0xf554('0x8a')],{'onDelete':_0xf554('0x173'),'foreignKey':_0xf554('0x160')});db[_0xf554('0x41')][_0xf554('0x12d')](db['Tag'],{'onDelete':_0xf554('0x173'),'foreignKey':_0xf554('0x18c')});db[_0xf554('0x43')][_0xf554('0x12d')](db['MailAccount'],{});db[_0xf554('0x43')][_0xf554('0x12d')](db[_0xf554('0xfb')],{'as':'List','foreignKey':'ListId'});db[_0xf554('0x43')]['belongsTo'](db[_0xf554('0x130')],{'as':_0xf554('0x16d'),'foreignKey':_0xf554('0x16e')});db[_0xf554('0x43')][_0xf554('0x12d')](db[_0xf554('0x3d')],{});db[_0xf554('0x43')][_0xf554('0x12d')](db[_0xf554('0x3f')],{});db[_0xf554('0x43')]['belongsTo'](db[_0xf554('0x14')],{});db[_0xf554('0x43')][_0xf554('0x12d')](db[_0xf554('0x39')],{});db[_0xf554('0x45')]['hasMany'](db['DashboardItem'],{'as':_0xf554('0x18d'),'onDelete':_0xf554('0x11c')});db[_0xf554('0x48')]['hasMany'](db[_0xf554('0x86')],{'as':_0xf554('0x176'),'foreignKey':_0xf554('0x18e'),'onDelete':_0xf554('0x11c')});db['FaxAccount'][_0xf554('0x11e')](db[_0xf554('0x84')],{'as':'Answers','foreignKey':_0xf554('0x18e')});db[_0xf554('0x48')][_0xf554('0x11e')](db[_0xf554('0x4c')],{'as':_0xf554('0x179')});db[_0xf554('0x48')][_0xf554('0x11e')](db[_0xf554('0x4a')],{'as':_0xf554('0x154')});db['FaxAccount'][_0xf554('0x11e')](db['VoiceExtension'],{'as':_0xf554('0x18f'),'onDelete':_0xf554('0x11c')});db[_0xf554('0x48')]['hasMany'](db[_0xf554('0x190')],{'as':_0xf554('0x178')});db['FaxAccount'][_0xf554('0x12d')](db[_0xf554('0x26')],{'as':_0xf554('0x26')});db[_0xf554('0x48')][_0xf554('0x12d')](db[_0xf554('0xfb')],{'as':'List','foreignKey':'ListId'});db[_0xf554('0x48')][_0xf554('0x12d')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xf554('0x162')});db[_0xf554('0x48')][_0xf554('0x12f')](db[_0xf554('0x14')],{'as':_0xf554('0x164'),'through':_0xf554('0x148')});db[_0xf554('0x4a')]['belongsTo'](db[_0xf554('0x14')],{'onDelete':_0xf554('0x173')});db[_0xf554('0x4a')][_0xf554('0x12d')](db[_0xf554('0x140')],{'onDelete':'restrict'});db['FaxApplication'][_0xf554('0x12d')](db[_0xf554('0x48')],{'onDelete':_0xf554('0x173')});db['FaxApplication'][_0xf554('0x12d')](db[_0xf554('0x182')],{'onDelete':_0xf554('0x173'),'foreignKey':_0xf554('0x18c')});db[_0xf554('0x4c')]['hasMany'](db[_0xf554('0x190')],{'as':_0xf554('0x178'),'onDelete':'cascade','foreignKey':_0xf554('0x191')});db['FaxInteraction'][_0xf554('0x12d')](db['FaxAccount'],{'as':_0xf554('0x180'),'foreignKey':_0xf554('0x18e')});db[_0xf554('0x4c')][_0xf554('0x12d')](db[_0xf554('0x130')],{'as':_0xf554('0x16d'),'foreignKey':_0xf554('0x16e')});db['FaxInteraction'][_0xf554('0x12d')](db[_0xf554('0x14')],{'as':_0xf554('0x181'),'foreignKey':_0xf554('0x120')});db[_0xf554('0x4c')][_0xf554('0x12f')](db[_0xf554('0x182')],{'through':_0xf554('0x192'),'as':_0xf554('0x184')});db[_0xf554('0x4c')][_0xf554('0x12f')](db[_0xf554('0x182')],{'through':'fax_interaction_has_tags','as':'ThroughTags'});db[_0xf554('0x4c')][_0xf554('0x12f')](db[_0xf554('0x14')],{'as':'Users','through':_0xf554('0x139'),'foreignKey':'FaxInteractionId'});db[_0xf554('0x190')][_0xf554('0x12d')](db['User'],{'onDelete':_0xf554('0x11c'),'as':_0xf554('0x14')});db[_0xf554('0x190')]['belongsTo'](db[_0xf554('0x4c')],{'as':_0xf554('0x188'),'foreignKey':'FaxInteractionId'});db[_0xf554('0x190')][_0xf554('0x12d')](db[_0xf554('0x130')],{'onDelete':_0xf554('0x11c'),'as':_0xf554('0x16d')});db[_0xf554('0x190')][_0xf554('0x12d')](db[_0xf554('0x186')],{'as':_0xf554('0x186'),'foreignKey':_0xf554('0x193')});db[_0xf554('0x190')][_0xf554('0x12d')](db[_0xf554('0x48')],{'as':'Account','foreignKey':_0xf554('0x18e')});db[_0xf554('0x140')][_0xf554('0x12f')](db[_0xf554('0x14')],{'as':_0xf554('0x164'),'through':_0xf554('0x30')});db['FaxQueue'][_0xf554('0x12f')](db[_0xf554('0xec')],{'through':_0xf554('0x194'),'as':'Teams'});db['FaxQueueReport']['belongsTo'](db[_0xf554('0x48')],{});db[_0xf554('0x50')]['belongsTo'](db[_0xf554('0xfb')],{'as':'List','foreignKey':_0xf554('0x17b')});db[_0xf554('0x50')][_0xf554('0x12d')](db[_0xf554('0x130')],{'as':'Contact','foreignKey':_0xf554('0x16e')});db[_0xf554('0x50')][_0xf554('0x12d')](db[_0xf554('0x4c')],{});db[_0xf554('0x50')][_0xf554('0x12d')](db[_0xf554('0x190')],{});db[_0xf554('0x50')]['belongsTo'](db[_0xf554('0x14')],{});db['FaxQueueReport'][_0xf554('0x12d')](db['FaxQueue'],{});db[_0xf554('0x52')][_0xf554('0x11e')](db[_0xf554('0x86')],{'as':_0xf554('0x176'),'foreignKey':_0xf554('0x195'),'onDelete':_0xf554('0x11c')});db[_0xf554('0x52')][_0xf554('0x11e')](db[_0xf554('0x84')],{'as':_0xf554('0x177'),'foreignKey':_0xf554('0x195')});db[_0xf554('0x52')][_0xf554('0x11e')](db[_0xf554('0x58')],{'as':'Messages','foreignKey':'SmsAccountId'});db['SmsAccount'][_0xf554('0x11e')](db['SmsInteraction'],{'as':_0xf554('0x179')});db[_0xf554('0x52')][_0xf554('0x11e')](db[_0xf554('0x54')],{'as':_0xf554('0x154')});db[_0xf554('0x52')][_0xf554('0x12d')](db[_0xf554('0xfb')],{'as':'List','foreignKey':_0xf554('0x17b')});db[_0xf554('0x52')][_0xf554('0x12d')](db['Pause'],{'as':_0xf554('0x161'),'foreignKey':_0xf554('0x162')});db[_0xf554('0x52')][_0xf554('0x12f')](db[_0xf554('0x14')],{'as':_0xf554('0x164'),'through':_0xf554('0x14e')});db[_0xf554('0x54')][_0xf554('0x12d')](db[_0xf554('0x14')],{'onDelete':_0xf554('0x173')});db[_0xf554('0x54')]['belongsTo'](db['SmsQueue'],{'onDelete':_0xf554('0x173')});db['SmsApplication'][_0xf554('0x12d')](db[_0xf554('0x52')],{'onDelete':_0xf554('0x173')});db[_0xf554('0x54')][_0xf554('0x12d')](db['Interval'],{'onDelete':'restrict','foreignKey':'IntervalId'});db['SmsApplication'][_0xf554('0x12d')](db[_0xf554('0x182')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xf554('0x56')][_0xf554('0x11e')](db[_0xf554('0x58')],{'as':'Messages','onDelete':_0xf554('0x11c'),'foreignKey':_0xf554('0x196')});db[_0xf554('0x56')][_0xf554('0x12d')](db[_0xf554('0x52')],{'as':_0xf554('0x180'),'foreignKey':_0xf554('0x195')});db['SmsInteraction']['belongsTo'](db[_0xf554('0x130')],{'as':_0xf554('0x16d'),'foreignKey':'ContactId'});db[_0xf554('0x56')]['belongsTo'](db[_0xf554('0x14')],{'as':_0xf554('0x181'),'foreignKey':'UserId'});db[_0xf554('0x56')][_0xf554('0x12f')](db[_0xf554('0x182')],{'through':_0xf554('0x197'),'as':_0xf554('0x184')});db[_0xf554('0x56')][_0xf554('0x12f')](db['Tag'],{'through':_0xf554('0x197'),'as':_0xf554('0x185')});db['SmsInteraction'][_0xf554('0x12f')](db[_0xf554('0x14')],{'as':_0xf554('0x198'),'through':'user_has_sms_interactions','foreignKey':_0xf554('0x196')});db[_0xf554('0x58')][_0xf554('0x12d')](db['User'],{'as':_0xf554('0x14')});db['SmsMessage'][_0xf554('0x12d')](db[_0xf554('0x130')],{'onDelete':_0xf554('0x11c'),'as':_0xf554('0x16d')});db[_0xf554('0x58')][_0xf554('0x12d')](db[_0xf554('0x56')],{'onDelete':_0xf554('0x11c'),'as':'Interaction','foreignKey':_0xf554('0x196')});db['SmsMessage'][_0xf554('0x12d')](db[_0xf554('0x52')],{'as':'Account','foreignKey':_0xf554('0x195')});db[_0xf554('0x59')][_0xf554('0x12f')](db['User'],{'as':'Agents','through':_0xf554('0x32'),'foreignKey':_0xf554('0x199')});db[_0xf554('0x59')][_0xf554('0x12f')](db[_0xf554('0xec')],{'through':_0xf554('0x19a'),'as':_0xf554('0x19b')});db[_0xf554('0x5b')]['hasMany'](db[_0xf554('0x86')],{'as':_0xf554('0x176'),'foreignKey':_0xf554('0x19c'),'onDelete':_0xf554('0x11c')});db[_0xf554('0x5b')][_0xf554('0x11e')](db[_0xf554('0x84')],{'as':_0xf554('0x177'),'foreignKey':'OpenchannelAccountId'});db[_0xf554('0x5b')]['hasMany'](db[_0xf554('0x5e')],{'as':_0xf554('0x179'),'foreignKey':_0xf554('0x19c')});db[_0xf554('0x5b')][_0xf554('0x11e')](db[_0xf554('0x60')],{'as':_0xf554('0x178'),'foreignKey':_0xf554('0x19c')});db['OpenchannelAccount']['hasMany'](db[_0xf554('0x19d')],{'as':'Applications','foreignKey':_0xf554('0x19c')});db[_0xf554('0x5b')][_0xf554('0x12d')](db[_0xf554('0xfb')],{'as':'List','foreignKey':_0xf554('0x17b')});db['OpenchannelAccount'][_0xf554('0x12d')](db[_0xf554('0x8c')],{'as':_0xf554('0x161'),'foreignKey':_0xf554('0x162')});db[_0xf554('0x5b')][_0xf554('0x12f')](db['User'],{'as':_0xf554('0x164'),'through':_0xf554('0x14c')});db[_0xf554('0x19d')][_0xf554('0x12d')](db[_0xf554('0x14')],{'onDelete':_0xf554('0x173')});db[_0xf554('0x19d')][_0xf554('0x12d')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0xf554('0x19e')});db[_0xf554('0x19d')][_0xf554('0x12d')](db[_0xf554('0x5b')],{'onDelete':_0xf554('0x173'),'foreignKey':_0xf554('0x19c')});db[_0xf554('0x19d')]['belongsTo'](db['Interval'],{'onDelete':_0xf554('0x173'),'foreignKey':_0xf554('0x160')});db[_0xf554('0x19d')]['belongsTo'](db[_0xf554('0x182')],{'onDelete':_0xf554('0x173'),'foreignKey':_0xf554('0x18c')});db['OpenchannelInteraction'][_0xf554('0x11e')](db[_0xf554('0x60')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xf554('0x19f')});db[_0xf554('0x5e')][_0xf554('0x12d')](db[_0xf554('0x5b')],{'as':_0xf554('0x180'),'foreignKey':'OpenchannelAccountId'});db[_0xf554('0x5e')][_0xf554('0x12d')](db[_0xf554('0x130')],{'as':_0xf554('0x16d'),'foreignKey':_0xf554('0x16e')});db['OpenchannelInteraction'][_0xf554('0x12d')](db[_0xf554('0x14')],{'as':_0xf554('0x181'),'foreignKey':_0xf554('0x120')});db[_0xf554('0x5e')][_0xf554('0x12f')](db[_0xf554('0x182')],{'through':_0xf554('0x1a0'),'as':_0xf554('0x184')});db[_0xf554('0x5e')][_0xf554('0x12f')](db[_0xf554('0x182')],{'through':'openchannel_interaction_has_tags','as':_0xf554('0x185')});db[_0xf554('0x5e')]['belongsToMany'](db[_0xf554('0x14')],{'as':_0xf554('0x198'),'through':_0xf554('0x13a'),'foreignKey':_0xf554('0x19f')});db['OpenchannelMessage'][_0xf554('0x12d')](db[_0xf554('0x14')],{'onDelete':_0xf554('0x11c'),'as':_0xf554('0x14')});db[_0xf554('0x60')]['belongsTo'](db[_0xf554('0x130')],{'onDelete':_0xf554('0x11c'),'as':'Contact'});db[_0xf554('0x60')][_0xf554('0x12d')](db['OpenchannelInteraction'],{'onDelete':_0xf554('0x11c'),'as':_0xf554('0x188'),'foreignKey':_0xf554('0x19f')});db[_0xf554('0x60')][_0xf554('0x12d')](db['Attachment'],{'as':_0xf554('0x186'),'foreignKey':_0xf554('0x193')});db[_0xf554('0x60')][_0xf554('0x12d')](db[_0xf554('0x5b')],{'as':_0xf554('0x180'),'foreignKey':_0xf554('0x19c')});db['OpenchannelQueue'][_0xf554('0x12f')](db[_0xf554('0x14')],{'as':_0xf554('0x164'),'through':_0xf554('0x143'),'foreignKey':_0xf554('0x19e')});db[_0xf554('0x62')]['belongsToMany'](db['Team'],{'through':'team_has_openchannel_queues','as':'Teams'});db['ChatWebsite'][_0xf554('0x11e')](db[_0xf554('0x86')],{'as':_0xf554('0x176'),'foreignKey':_0xf554('0x189'),'onDelete':_0xf554('0x11c')});db[_0xf554('0x64')][_0xf554('0x11e')](db['CannedAnswer'],{'as':_0xf554('0x177'),'foreignKey':'ChatWebsiteId'});db[_0xf554('0x64')][_0xf554('0x11e')](db['ChatProactiveAction'],{'as':_0xf554('0x1a1')});db[_0xf554('0x64')][_0xf554('0x11e')](db[_0xf554('0x69')],{'as':_0xf554('0x179')});db[_0xf554('0x64')][_0xf554('0x11e')](db[_0xf554('0x1a2')],{'as':_0xf554('0x154')});db[_0xf554('0x64')][_0xf554('0x11e')](db[_0xf554('0x6b')],{'as':_0xf554('0x178')});db[_0xf554('0x64')][_0xf554('0x12d')](db[_0xf554('0xfb')],{'as':_0xf554('0x17a'),'foreignKey':_0xf554('0x17b')});db['ChatWebsite']['belongsTo'](db[_0xf554('0x8a')],{'as':_0xf554('0x8a'),'foreignKey':_0xf554('0x160')});db['ChatWebsite']['belongsTo'](db[_0xf554('0x37')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0xf554('0x64')][_0xf554('0x12d')](db[_0xf554('0x8c')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xf554('0x64')][_0xf554('0x12f')](db[_0xf554('0x14')],{'as':_0xf554('0x164'),'through':_0xf554('0x146')});db[_0xf554('0x66')][_0xf554('0x12d')](db[_0xf554('0x5b')],{});db[_0xf554('0x66')][_0xf554('0x12d')](db['CmList'],{'as':_0xf554('0x17a'),'foreignKey':_0xf554('0x17b')});db[_0xf554('0x66')][_0xf554('0x12d')](db[_0xf554('0x130')],{'as':_0xf554('0x16d'),'foreignKey':_0xf554('0x16e')});db[_0xf554('0x66')][_0xf554('0x12d')](db[_0xf554('0x5e')],{});db[_0xf554('0x66')]['belongsTo'](db[_0xf554('0x60')],{});db[_0xf554('0x66')]['belongsTo'](db[_0xf554('0x14')],{});db[_0xf554('0x66')][_0xf554('0x12d')](db[_0xf554('0x62')],{});db[_0xf554('0x1a2')][_0xf554('0x12d')](db[_0xf554('0x14')],{'as':'Agent','foreignKey':_0xf554('0x120'),'onDelete':_0xf554('0x173')});db['ChatApplication'][_0xf554('0x12d')](db[_0xf554('0x6d')],{'as':_0xf554('0x1a3'),'foreignKey':_0xf554('0x1a4'),'onDelete':'restrict'});db['ChatApplication'][_0xf554('0x12d')](db[_0xf554('0x64')],{'as':_0xf554('0x1a5'),'foreignKey':_0xf554('0x189'),'onDelete':_0xf554('0x173')});db['ChatApplication'][_0xf554('0x12d')](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xf554('0x69')][_0xf554('0x11e')](db['ChatMessage'],{'as':'Messages','onDelete':_0xf554('0x11c'),'foreignKey':_0xf554('0x1a6')});db[_0xf554('0x69')][_0xf554('0x12d')](db[_0xf554('0x64')],{'as':_0xf554('0x180'),'foreignKey':'ChatWebsiteId'});db[_0xf554('0x69')][_0xf554('0x12d')](db['CmContact'],{'as':'Contact','foreignKey':_0xf554('0x16e')});db[_0xf554('0x69')][_0xf554('0x12d')](db[_0xf554('0x14')],{'as':_0xf554('0x181'),'foreignKey':_0xf554('0x120')});db[_0xf554('0x69')][_0xf554('0x12f')](db[_0xf554('0x182')],{'through':_0xf554('0x1a7'),'as':'Tags'});db[_0xf554('0x69')][_0xf554('0x12f')](db['Tag'],{'through':_0xf554('0x1a7'),'as':_0xf554('0x185')});db[_0xf554('0x69')][_0xf554('0x12f')](db[_0xf554('0x14')],{'as':_0xf554('0x198'),'through':_0xf554('0x1a8'),'foreignKey':'ChatInteractionId'});db[_0xf554('0x6b')]['belongsTo'](db[_0xf554('0x14')],{'onDelete':_0xf554('0x11c'),'as':_0xf554('0x14')});db[_0xf554('0x6b')][_0xf554('0x12d')](db[_0xf554('0x130')],{'onDelete':_0xf554('0x11c'),'as':_0xf554('0x16d'),'foreignKey':'ContactId'});db[_0xf554('0x6b')]['belongsTo'](db['ChatInteraction'],{'onDelete':_0xf554('0x11c'),'as':_0xf554('0x188'),'foreignKey':'ChatInteractionId'});db['ChatMessage']['belongsTo'](db[_0xf554('0x186')],{'as':_0xf554('0x186'),'foreignKey':_0xf554('0x193')});db[_0xf554('0x6b')][_0xf554('0x12d')](db[_0xf554('0x64')],{'as':_0xf554('0x180'),'foreignKey':_0xf554('0x189')});db[_0xf554('0x18a')][_0xf554('0x11e')](db[_0xf554('0x186')],{'as':_0xf554('0x187'),'foreignKey':_0xf554('0x18b'),'onDelete':_0xf554('0x11c'),'hooks':!![]});db[_0xf554('0x18a')][_0xf554('0x12d')](db[_0xf554('0x130')],{'onDelete':_0xf554('0x11c'),'as':_0xf554('0x16d'),'foreignKey':_0xf554('0x16e')});db[_0xf554('0x18a')][_0xf554('0x12d')](db['ChatWebsite'],{'as':_0xf554('0x180'),'foreignKey':_0xf554('0x189')});db['ChatQueue'][_0xf554('0x12f')](db[_0xf554('0x14')],{'as':_0xf554('0x164'),'through':_0xf554('0x2c'),'hooks':!![]});db[_0xf554('0x6d')][_0xf554('0x12f')](db[_0xf554('0xec')],{'through':_0xf554('0x1a9'),'as':'Teams'});db[_0xf554('0x6f')][_0xf554('0x11e')](db[_0xf554('0xd7')],{'as':_0xf554('0x178'),'foreignKey':_0xf554('0x1aa'),'onDelete':_0xf554('0x11c')});db[_0xf554('0x6f')][_0xf554('0x12f')](db[_0xf554('0x14')],{'as':_0xf554('0x158'),'through':_0xf554('0x1ab')});db[_0xf554('0x71')]['belongsTo'](db[_0xf554('0x64')],{'as':_0xf554('0x1a5'),'foreignKey':_0xf554('0x189')});db[_0xf554('0x73')][_0xf554('0x11e')](db[_0xf554('0x130')],{'as':_0xf554('0x1ac'),'foreignKey':_0xf554('0x1ad')});db[_0xf554('0x130')][_0xf554('0x11e')](db[_0xf554('0x96')],{'as':_0xf554('0x1ae'),'foreignKey':_0xf554('0x1af')});db[_0xf554('0x130')][_0xf554('0x11e')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0xf554('0x16e')});db[_0xf554('0x130')]['hasMany'](db[_0xf554('0x7a')],{'as':'HopperFinals','foreignKey':_0xf554('0x16e')});db['CmContact']['hasMany'](db['CmHopperHistory'],{'as':_0xf554('0x15a'),'foreignKey':_0xf554('0x16e')});db[_0xf554('0x130')][_0xf554('0x11e')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xf554('0x16e')});db[_0xf554('0x130')]['hasMany'](db[_0xf554('0xdc')],{'as':_0xf554('0x15c'),'foreignKey':_0xf554('0x16e')});db['CmContact'][_0xf554('0x11e')](db[_0xf554('0x5e')],{'as':_0xf554('0x127'),'foreignKey':_0xf554('0x16e'),'onDelete':_0xf554('0x173')});db['CmContact'][_0xf554('0x11e')](db[_0xf554('0x69')],{'as':'ChatInteractions','foreignKey':_0xf554('0x16e'),'onDelete':_0xf554('0x173')});db[_0xf554('0x130')][_0xf554('0x11e')](db[_0xf554('0x56')],{'as':'SmsInteractions','foreignKey':_0xf554('0x16e'),'onDelete':'restrict'});db[_0xf554('0x130')][_0xf554('0x11e')](db[_0xf554('0x4c')],{'as':_0xf554('0x138'),'foreignKey':_0xf554('0x16e'),'onDelete':_0xf554('0x173')});db['CmContact'][_0xf554('0x11e')](db[_0xf554('0x3d')],{'as':_0xf554('0x135'),'foreignKey':_0xf554('0x16e'),'onDelete':_0xf554('0x173')});db[_0xf554('0x130')][_0xf554('0x12d')](db[_0xf554('0x73')],{'as':'Company','foreignKey':'CompanyId'});db[_0xf554('0x130')][_0xf554('0x12d')](db[_0xf554('0xfb')],{'as':'List','foreignKey':_0xf554('0x17b'),'onDelete':'cascade'});db[_0xf554('0x130')]['belongsToMany'](db[_0xf554('0x14')],{'as':'Users','through':_0xf554('0x131')});db[_0xf554('0x130')][_0xf554('0x12f')](db[_0xf554('0x182')],{'as':_0xf554('0x184'),'through':'cm_contact_has_tags'});db[_0xf554('0x130')]['belongsToMany'](db['Tag'],{'through':_0xf554('0x1b0'),'as':_0xf554('0x185')});db[_0xf554('0x76')][_0xf554('0x11e')](db[_0xf554('0x98')],{'as':_0xf554('0x1b1'),'foreignKey':'CmHopperId'});db[_0xf554('0x76')][_0xf554('0x12d')](db[_0xf554('0x130')],{'as':'Contact','foreignKey':_0xf554('0x16e'),'onDelete':_0xf554('0x11c')});db[_0xf554('0x76')][_0xf554('0x12d')](db[_0xf554('0xfb')],{'as':_0xf554('0x17a'),'foreignKey':_0xf554('0x17b'),'onDelete':_0xf554('0x11c')});db[_0xf554('0x76')][_0xf554('0x12d')](db[_0xf554('0x14')],{'as':_0xf554('0x1b2'),'foreignKey':_0xf554('0x120')});db[_0xf554('0x76')]['belongsTo'](db['VoiceQueue'],{'as':_0xf554('0x1a3'),'foreignKey':_0xf554('0x159'),'onDelete':'cascade'});db[_0xf554('0x76')][_0xf554('0x12d')](db[_0xf554('0x1b3')],{'as':_0xf554('0x1b3'),'foreignKey':'CampaignId','onDelete':_0xf554('0x11c')});db[_0xf554('0x76')][_0xf554('0x12d')](db[_0xf554('0x14')],{'as':_0xf554('0x181'),'foreignKey':_0xf554('0x1b4')});db[_0xf554('0x78')]['belongsTo'](db[_0xf554('0x130')],{'as':_0xf554('0x16d'),'foreignKey':_0xf554('0x16e'),'onDelete':_0xf554('0x11c')});db['CmHopperBlack']['belongsTo'](db[_0xf554('0xfb')],{'as':_0xf554('0x17a'),'foreignKey':_0xf554('0x17b'),'onDelete':_0xf554('0x11c')});db[_0xf554('0x78')]['belongsTo'](db[_0xf554('0x1b')],{'as':'Queue','foreignKey':_0xf554('0x159'),'onDelete':_0xf554('0x11c')});db[_0xf554('0x78')][_0xf554('0x12d')](db[_0xf554('0x1b3')],{'as':'Campaign','foreignKey':_0xf554('0x1b5'),'onDelete':'cascade'});db[_0xf554('0x82')]['hasMany'](db[_0xf554('0x88')],{'as':{'plural':_0xf554('0x1b6'),'singular':'OneAll'},'foreignKey':_0xf554('0x1b7'),'onDelete':_0xf554('0x11c'),'hooks':!![]});db['Automation'][_0xf554('0x11e')](db[_0xf554('0x88')],{'as':{'plural':_0xf554('0x1b8'),'singular':_0xf554('0x1b9')},'foreignKey':_0xf554('0x1ba'),'onDelete':_0xf554('0x11c'),'hooks':!![]});db[_0xf554('0x82')][_0xf554('0x11e')](db[_0xf554('0x80')],{'as':_0xf554('0x1bb'),'foreignKey':_0xf554('0x1bc'),'onDelete':_0xf554('0x11c'),'hooks':!![]});db[_0xf554('0x86')][_0xf554('0x11e')](db[_0xf554('0x86')],{'as':_0xf554('0x176'),'foreignKey':_0xf554('0x1bd'),'onDelete':_0xf554('0x11c')});db[_0xf554('0x8a')][_0xf554('0x11e')](db[_0xf554('0x8a')],{'as':_0xf554('0x1be'),'foreignKey':'IntervalId','onDelete':'cascade','hooks':!![],'required':![]});db[_0xf554('0x8a')][_0xf554('0x11e')](db[_0xf554('0x122')],{'as':_0xf554('0x123'),'foreignKey':'IntervalId','onDelete':_0xf554('0x173')});db[_0xf554('0x8a')]['hasMany'](db[_0xf554('0x41')],{'as':_0xf554('0x1bf'),'foreignKey':_0xf554('0x160')});db[_0xf554('0x8a')][_0xf554('0x11e')](db[_0xf554('0x1a2')],{'as':_0xf554('0x1c0'),'foreignKey':_0xf554('0x160')});db[_0xf554('0x8a')][_0xf554('0x11e')](db[_0xf554('0x4a')],{'as':'FaxApplications','foreignKey':_0xf554('0x160')});db[_0xf554('0x8a')][_0xf554('0x11e')](db['SmsApplication'],{'as':_0xf554('0x1c1'),'foreignKey':_0xf554('0x160')});db[_0xf554('0x92')][_0xf554('0x12d')](db[_0xf554('0x37')],{});db[_0xf554('0x92')][_0xf554('0x12d')](db[_0xf554('0xa3')],{'foreignKey':_0xf554('0x1c2')});db[_0xf554('0x92')][_0xf554('0x12d')](db[_0xf554('0xa2')],{'foreignKey':_0xf554('0x1c3')});db[_0xf554('0x1c4')][_0xf554('0x12f')](db[_0xf554('0x155')],{'as':_0xf554('0x1c5'),'through':'moh_has_sounds','onDelete':_0xf554('0x173')});db[_0xf554('0x182')]['belongsToMany'](db[_0xf554('0x130')],{'through':_0xf554('0x1b0')});db[_0xf554('0x182')]['belongsToMany'](db[_0xf554('0x69')],{'through':'chat_interaction_has_tags'});db[_0xf554('0x182')]['belongsToMany'](db[_0xf554('0x3d')],{'through':_0xf554('0x183')});db[_0xf554('0x182')][_0xf554('0x12f')](db[_0xf554('0x56')],{'through':_0xf554('0x197')});db[_0xf554('0x182')]['belongsToMany'](db[_0xf554('0x4c')],{'through':_0xf554('0x192')});db[_0xf554('0x182')][_0xf554('0x12f')](db[_0xf554('0x5e')],{'through':_0xf554('0x1a0')});db[_0xf554('0x182')][_0xf554('0x12f')](db[_0xf554('0x10a')],{'through':_0xf554('0x1c6')});db[_0xf554('0x96')][_0xf554('0x12d')](db[_0xf554('0x94')],{'as':_0xf554('0x1c7'),'foreignKey':_0xf554('0x1c8')});db[_0xf554('0x98')]['belongsTo'](db[_0xf554('0x76')],{'as':'Hopper','foreignKey':_0xf554('0x1c9')});db[_0xf554('0x96')][_0xf554('0x12d')](db[_0xf554('0x130')],{'as':_0xf554('0x16d'),'foreignKey':_0xf554('0x1af')});db[_0xf554('0x9a')][_0xf554('0x11e')](db[_0xf554('0x88')],{'as':{'plural':_0xf554('0x1ca'),'singular':_0xf554('0x1cb')},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db['Trigger'][_0xf554('0x11e')](db[_0xf554('0x88')],{'as':{'plural':'AnyConditions','singular':_0xf554('0x1cc')},'foreignKey':_0xf554('0x1cd'),'onDelete':_0xf554('0x11c'),'hooks':!![]});db['Trigger'][_0xf554('0x11e')](db['Action'],{'as':_0xf554('0x1bb'),'foreignKey':_0xf554('0x1ce'),'onDelete':_0xf554('0x11c'),'hooks':!![]});db[_0xf554('0xa2')][_0xf554('0x11e')](db[_0xf554('0xa7')],{'as':_0xf554('0x1cf'),'onDelete':'cascade','foreignKey':_0xf554('0x1c3'),'hooks':!![]});db['AnalyticDefaultReport']['hasMany'](db[_0xf554('0xa7')],{'as':_0xf554('0x1cf'),'onDelete':_0xf554('0x11c'),'foreignKey':'DefaultReportId'});db[_0xf554('0xa5')][_0xf554('0x11e')](db[_0xf554('0xa7')],{'as':'Fields','onDelete':_0xf554('0x11c'),'foreignKey':_0xf554('0x1d0')});db['AnalyticFieldReport'][_0xf554('0x12d')](db['AnalyticMetric'],{'foreignKey':_0xf554('0x1d0')});db[_0xf554('0xa9')][_0xf554('0x11e')](db[_0xf554('0xab')],{'as':_0xf554('0x1d1'),'onDelete':_0xf554('0x11c'),'foreignKey':_0xf554('0x1d2')});db[_0xf554('0xab')]['hasMany'](db['SalesforceField'],{'as':'Subjects','onDelete':_0xf554('0x11c'),'foreignKey':_0xf554('0x1d3')});db[_0xf554('0xab')][_0xf554('0x11e')](db[_0xf554('0x1d4')],{'as':'Descriptions','onDelete':_0xf554('0x11c'),'foreignKey':_0xf554('0x1d5')});db[_0xf554('0xab')]['hasMany'](db['SalesforceField'],{'as':_0xf554('0x1cf'),'onDelete':'cascade','foreignKey':_0xf554('0x1d6')});db[_0xf554('0xab')][_0xf554('0x12d')](db[_0xf554('0xa9')],{'as':_0xf554('0x180'),'foreignKey':_0xf554('0x1d2')});db[_0xf554('0x1d4')][_0xf554('0x11e')](db[_0xf554('0x1d4')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xf554('0x1d4')]['hasMany'](db['SalesforceField'],{'as':_0xf554('0x1d7'),'foreignKey':_0xf554('0x1d5')});db[_0xf554('0x1d4')][_0xf554('0x11e')](db[_0xf554('0x1d4')],{'as':'Field','foreignKey':'FieldId'});db['SalesforceField']['belongsTo'](db[_0xf554('0x9c')],{'as':_0xf554('0x9c'),'foreignKey':_0xf554('0x1d8')});db[_0xf554('0xad')][_0xf554('0x11e')](db[_0xf554('0xaf')],{'as':'Configurations','onDelete':_0xf554('0x11c'),'foreignKey':_0xf554('0x1d2')});db[_0xf554('0xaf')][_0xf554('0x11e')](db['SugarcrmField'],{'as':_0xf554('0x1d9'),'onDelete':_0xf554('0x11c'),'foreignKey':'SubjectId'});db[_0xf554('0xaf')][_0xf554('0x11e')](db[_0xf554('0xb0')],{'as':'Descriptions','onDelete':_0xf554('0x11c'),'foreignKey':_0xf554('0x1d5')});db[_0xf554('0xaf')][_0xf554('0x11e')](db['SugarcrmField'],{'as':_0xf554('0x1cf'),'onDelete':_0xf554('0x11c'),'foreignKey':_0xf554('0x1d6')});db[_0xf554('0xaf')]['belongsTo'](db[_0xf554('0xad')],{'as':_0xf554('0x180'),'foreignKey':_0xf554('0x1d2')});db[_0xf554('0xb0')]['hasMany'](db[_0xf554('0xb0')],{'as':_0xf554('0x1da'),'foreignKey':_0xf554('0x1d3')});db['SugarcrmField'][_0xf554('0x11e')](db['SugarcrmField'],{'as':_0xf554('0x1d7'),'foreignKey':_0xf554('0x1d5')});db['SugarcrmField'][_0xf554('0x11e')](db[_0xf554('0xb0')],{'as':_0xf554('0x1db'),'foreignKey':_0xf554('0x1d6')});db[_0xf554('0xb0')][_0xf554('0x12d')](db[_0xf554('0x9c')],{'as':_0xf554('0x9c'),'foreignKey':_0xf554('0x1d8')});db[_0xf554('0xb2')][_0xf554('0x11e')](db['DeskConfiguration'],{'as':_0xf554('0x1d1'),'onDelete':_0xf554('0x11c'),'foreignKey':_0xf554('0x1d2')});db['DeskConfiguration'][_0xf554('0x11e')](db['DeskField'],{'as':_0xf554('0x1d9'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xf554('0xb3')][_0xf554('0x11e')](db[_0xf554('0xb5')],{'as':_0xf554('0x1dc'),'onDelete':_0xf554('0x11c'),'foreignKey':_0xf554('0x1d5')});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':_0xf554('0x1cf'),'onDelete':_0xf554('0x11c'),'foreignKey':_0xf554('0x1d6')});db[_0xf554('0xb3')][_0xf554('0x12d')](db['DeskAccount'],{'as':_0xf554('0x180'),'foreignKey':_0xf554('0x1d2')});db[_0xf554('0xb3')][_0xf554('0x12f')](db[_0xf554('0x182')],{'through':_0xf554('0x1dd')});db['DeskField']['hasMany'](db[_0xf554('0xb5')],{'as':_0xf554('0x1da'),'foreignKey':_0xf554('0x1d3')});db[_0xf554('0xb5')][_0xf554('0x11e')](db[_0xf554('0xb5')],{'as':_0xf554('0x1d7'),'foreignKey':_0xf554('0x1d5')});db[_0xf554('0xb5')][_0xf554('0x11e')](db[_0xf554('0xb5')],{'as':_0xf554('0x1db'),'foreignKey':'FieldId'});db[_0xf554('0xb5')][_0xf554('0x12d')](db[_0xf554('0x9c')],{'as':_0xf554('0x9c'),'foreignKey':_0xf554('0x1d8')});db[_0xf554('0x1de')]['hasMany'](db[_0xf554('0x1df')],{'as':_0xf554('0x1d1'),'onDelete':_0xf554('0x11c'),'foreignKey':'AccountId'});db[_0xf554('0x1df')][_0xf554('0x11e')](db['ZohoField'],{'as':_0xf554('0x1d9'),'onDelete':_0xf554('0x11c'),'foreignKey':'SubjectId'});db[_0xf554('0x1df')]['hasMany'](db[_0xf554('0xb9')],{'as':_0xf554('0x1dc'),'onDelete':_0xf554('0x11c'),'foreignKey':_0xf554('0x1d5')});db[_0xf554('0x1df')][_0xf554('0x11e')](db[_0xf554('0xb9')],{'as':_0xf554('0x1cf'),'onDelete':'cascade','foreignKey':'FieldId'});db['ZohoConfiguration'][_0xf554('0x12d')](db['ZohoAccount'],{'as':'Account','foreignKey':_0xf554('0x1d2')});db['ZohoField'][_0xf554('0x11e')](db[_0xf554('0xb9')],{'as':_0xf554('0x1da'),'foreignKey':'SubjectId'});db[_0xf554('0xb9')][_0xf554('0x11e')](db['ZohoField'],{'as':_0xf554('0x1d7'),'foreignKey':_0xf554('0x1d5')});db['ZohoField']['hasMany'](db['ZohoField'],{'as':_0xf554('0x1db'),'foreignKey':'FieldId'});db[_0xf554('0xb9')]['belongsTo'](db[_0xf554('0x9c')],{'as':_0xf554('0x9c'),'foreignKey':_0xf554('0x1d8')});db[_0xf554('0x1e0')][_0xf554('0x11e')](db[_0xf554('0x1e1')],{'as':_0xf554('0x1d1'),'onDelete':_0xf554('0x11c'),'foreignKey':_0xf554('0x1d2')});db[_0xf554('0x1e1')][_0xf554('0x11e')](db['ZendeskField'],{'as':'Subjects','foreignKey':_0xf554('0x1d3')});db[_0xf554('0x1e1')][_0xf554('0x11e')](db['ZendeskField'],{'as':_0xf554('0x1dc'),'foreignKey':_0xf554('0x1d5')});db[_0xf554('0x1e1')]['hasMany'](db['ZendeskField'],{'as':_0xf554('0x1cf'),'foreignKey':_0xf554('0x1d6')});db[_0xf554('0x1e1')][_0xf554('0x12d')](db[_0xf554('0x1e0')],{'as':_0xf554('0x180'),'foreignKey':_0xf554('0x1d2')});db['ZendeskConfiguration']['belongsToMany'](db[_0xf554('0x182')],{'through':_0xf554('0x1e2')});db[_0xf554('0xbc')]['hasMany'](db['ZendeskField'],{'as':_0xf554('0x1da'),'foreignKey':_0xf554('0x1d3')});db[_0xf554('0xbc')][_0xf554('0x11e')](db['ZendeskField'],{'as':_0xf554('0x1d7'),'foreignKey':_0xf554('0x1d5')});db[_0xf554('0xbc')][_0xf554('0x11e')](db[_0xf554('0xbc')],{'as':_0xf554('0x1db'),'foreignKey':_0xf554('0x1d6')});db[_0xf554('0xbc')][_0xf554('0x12d')](db[_0xf554('0x9c')],{'as':_0xf554('0x9c'),'foreignKey':_0xf554('0x1d8')});db[_0xf554('0xbd')][_0xf554('0x11e')](db['FreshdeskConfiguration'],{'as':'Configurations','onDelete':_0xf554('0x11c'),'foreignKey':'AccountId'});db[_0xf554('0xbe')][_0xf554('0x11e')](db[_0xf554('0xc0')],{'as':'Subjects','onDelete':_0xf554('0x11c'),'foreignKey':_0xf554('0x1d3')});db[_0xf554('0xbe')]['hasMany'](db['FreshdeskField'],{'as':_0xf554('0x1dc'),'onDelete':'cascade','foreignKey':_0xf554('0x1d5')});db[_0xf554('0xbe')][_0xf554('0x11e')](db['FreshdeskField'],{'as':_0xf554('0x1cf'),'onDelete':_0xf554('0x11c'),'foreignKey':_0xf554('0x1d6')});db[_0xf554('0xbe')][_0xf554('0x12d')](db[_0xf554('0xbd')],{'as':_0xf554('0x180'),'foreignKey':'AccountId'});db[_0xf554('0xbe')][_0xf554('0x12f')](db[_0xf554('0x182')],{'through':'int_freshdesk_configuration_has_tags'});db['FreshdeskField'][_0xf554('0x11e')](db[_0xf554('0xc0')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xf554('0xc0')][_0xf554('0x11e')](db[_0xf554('0xc0')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xf554('0xc0')][_0xf554('0x11e')](db[_0xf554('0xc0')],{'as':_0xf554('0x1db'),'foreignKey':_0xf554('0x1d6')});db['FreshdeskField'][_0xf554('0x12d')](db[_0xf554('0x9c')],{'as':'Variable','foreignKey':_0xf554('0x1d8')});db['VtigerAccount'][_0xf554('0x11e')](db[_0xf554('0x1e3')],{'as':'Configurations','onDelete':_0xf554('0x11c'),'foreignKey':_0xf554('0x1d2')});db[_0xf554('0x1e3')][_0xf554('0x11e')](db[_0xf554('0x1e4')],{'as':_0xf554('0x1d9'),'foreignKey':_0xf554('0x1d3')});db[_0xf554('0x1e3')][_0xf554('0x11e')](db[_0xf554('0x1e4')],{'as':_0xf554('0x1dc'),'foreignKey':_0xf554('0x1d5')});db[_0xf554('0x1e3')]['hasMany'](db[_0xf554('0x1e4')],{'as':_0xf554('0x1cf'),'foreignKey':_0xf554('0x1d6')});db['VtigerConfiguration'][_0xf554('0x12d')](db[_0xf554('0xc1')],{'as':_0xf554('0x180'),'foreignKey':_0xf554('0x1d2')});db[_0xf554('0x1e4')][_0xf554('0x11e')](db[_0xf554('0x1e4')],{'as':'Subject','foreignKey':_0xf554('0x1d3')});db[_0xf554('0x1e4')]['hasMany'](db[_0xf554('0x1e4')],{'as':_0xf554('0x1d7'),'foreignKey':_0xf554('0x1d5')});db[_0xf554('0x1e4')][_0xf554('0x11e')](db[_0xf554('0x1e4')],{'as':_0xf554('0x1db'),'foreignKey':_0xf554('0x1d6')});db[_0xf554('0x1e4')][_0xf554('0x12d')](db[_0xf554('0x9c')],{'as':_0xf554('0x9c'),'foreignKey':_0xf554('0x1d8')});db[_0xf554('0xc5')]['hasMany'](db[_0xf554('0xc7')],{'as':_0xf554('0x1d1'),'onDelete':_0xf554('0x11c'),'foreignKey':_0xf554('0x1d2')});db['ServicenowConfiguration'][_0xf554('0x11e')](db[_0xf554('0xc9')],{'as':_0xf554('0x1d9'),'foreignKey':_0xf554('0x1d3')});db['ServicenowConfiguration']['hasMany'](db[_0xf554('0xc9')],{'as':'Descriptions','foreignKey':_0xf554('0x1d5')});db[_0xf554('0xc7')]['hasMany'](db[_0xf554('0xc9')],{'as':_0xf554('0x1cf'),'foreignKey':_0xf554('0x1d6')});db[_0xf554('0xc7')][_0xf554('0x12d')](db[_0xf554('0xc5')],{'as':_0xf554('0x180'),'foreignKey':_0xf554('0x1d2')});db[_0xf554('0xc9')][_0xf554('0x11e')](db[_0xf554('0xc9')],{'as':_0xf554('0x1da'),'foreignKey':_0xf554('0x1d3')});db[_0xf554('0xc9')][_0xf554('0x11e')](db[_0xf554('0xc9')],{'as':_0xf554('0x1d7'),'foreignKey':_0xf554('0x1d5')});db['ServicenowField']['hasMany'](db[_0xf554('0xc9')],{'as':'Field','foreignKey':_0xf554('0x1d6')});db['ServicenowField'][_0xf554('0x12d')](db[_0xf554('0x9c')],{'as':_0xf554('0x9c'),'foreignKey':'VariableId'});db[_0xf554('0x1e5')][_0xf554('0x11e')](db[_0xf554('0xcc')],{'as':'Configurations','onDelete':_0xf554('0x11c'),'foreignKey':_0xf554('0x1d2')});db[_0xf554('0x1e5')]['belongsTo'](db[_0xf554('0x111')],{'as':_0xf554('0x111'),'foreignKey':_0xf554('0x171')});db[_0xf554('0xcc')][_0xf554('0x11e')](db[_0xf554('0xce')],{'as':_0xf554('0x1d9'),'onDelete':_0xf554('0x11c'),'foreignKey':_0xf554('0x1d3')});db[_0xf554('0xcc')]['hasMany'](db[_0xf554('0xce')],{'as':_0xf554('0x1dc'),'onDelete':_0xf554('0x11c'),'foreignKey':_0xf554('0x1d5')});db['Dynamics365Configuration'][_0xf554('0x11e')](db['Dynamics365Field'],{'as':_0xf554('0x1cf'),'onDelete':_0xf554('0x11c'),'foreignKey':_0xf554('0x1d6')});db[_0xf554('0xcc')]['belongsTo'](db[_0xf554('0x1e5')],{'as':_0xf554('0x180'),'foreignKey':_0xf554('0x1d2')});db[_0xf554('0xce')]['hasMany'](db['Dynamics365Field'],{'as':_0xf554('0x1da'),'foreignKey':_0xf554('0x1d3')});db[_0xf554('0xce')]['hasMany'](db['Dynamics365Field'],{'as':_0xf554('0x1d7'),'foreignKey':_0xf554('0x1d5')});db[_0xf554('0xce')][_0xf554('0x11e')](db[_0xf554('0xce')],{'as':_0xf554('0x1db'),'foreignKey':_0xf554('0x1d6')});db[_0xf554('0xce')][_0xf554('0x12d')](db[_0xf554('0x9c')],{'as':_0xf554('0x9c'),'foreignKey':_0xf554('0x1d8')});db[_0xf554('0x1e6')]['hasMany'](db['FreshsalesConfiguration'],{'as':_0xf554('0x1d1'),'onDelete':'cascade','foreignKey':_0xf554('0x1d2')});db[_0xf554('0xcf')]['hasMany'](db['FreshsalesField'],{'as':_0xf554('0x1d9'),'foreignKey':'SubjectId'});db['FreshsalesConfiguration'][_0xf554('0x11e')](db[_0xf554('0xd1')],{'as':_0xf554('0x1dc'),'foreignKey':'DescriptionId'});db['FreshsalesConfiguration']['hasMany'](db[_0xf554('0xd1')],{'as':_0xf554('0x1cf'),'foreignKey':_0xf554('0x1d6')});db['FreshsalesConfiguration']['belongsTo'](db['FreshsalesAccount'],{'as':'Account','foreignKey':'AccountId'});db[_0xf554('0xd1')]['hasMany'](db[_0xf554('0xd1')],{'as':'Subject','foreignKey':_0xf554('0x1d3')});db[_0xf554('0xd1')][_0xf554('0x11e')](db['FreshsalesField'],{'as':_0xf554('0x1d7'),'foreignKey':'DescriptionId'});db[_0xf554('0xd1')][_0xf554('0x11e')](db['FreshsalesField'],{'as':_0xf554('0x1db'),'foreignKey':_0xf554('0x1d6')});db[_0xf554('0xd1')][_0xf554('0x12d')](db[_0xf554('0x9c')],{'as':_0xf554('0x9c'),'foreignKey':_0xf554('0x1d8')});db[_0xf554('0xd5')][_0xf554('0x12d')](db[_0xf554('0x64')],{});db['ChatQueueReport']['belongsTo'](db['CmList'],{'as':_0xf554('0x17a'),'foreignKey':_0xf554('0x17b')});db[_0xf554('0xd5')][_0xf554('0x12d')](db[_0xf554('0x130')],{'as':_0xf554('0x16d'),'foreignKey':_0xf554('0x16e')});db[_0xf554('0xd5')][_0xf554('0x12d')](db[_0xf554('0x69')],{});db['ChatQueueReport'][_0xf554('0x12d')](db['ChatMessage'],{});db[_0xf554('0xd5')][_0xf554('0x12d')](db[_0xf554('0x14')],{});db[_0xf554('0xd5')][_0xf554('0x12d')](db[_0xf554('0x6d')],{});db[_0xf554('0xd7')][_0xf554('0x12d')](db[_0xf554('0x14')],{'onDelete':_0xf554('0x11c'),'foreignKey':_0xf554('0x1e7')});db[_0xf554('0xd7')][_0xf554('0x12d')](db['User'],{'onDelete':_0xf554('0x11c'),'foreignKey':_0xf554('0x1e8')});db[_0xf554('0xdc')][_0xf554('0x11e')](db['JscriptyQuestionReport'],{'foreignKey':'SessionId','onDelete':_0xf554('0x11c')});db['JscriptySessionReport'][_0xf554('0x11e')](db[_0xf554('0xd9')],{'foreignKey':_0xf554('0x1e9'),'onDelete':_0xf554('0x11c')});db[_0xf554('0xde')][_0xf554('0x12d')](db['SmsAccount'],{});db['SmsQueueReport'][_0xf554('0x12d')](db['CmList'],{'as':_0xf554('0x17a'),'foreignKey':'ListId'});db[_0xf554('0xde')][_0xf554('0x12d')](db[_0xf554('0x130')],{'as':'Contact','foreignKey':_0xf554('0x16e')});db[_0xf554('0xde')]['belongsTo'](db[_0xf554('0x56')],{});db['SmsQueueReport'][_0xf554('0x12d')](db[_0xf554('0x58')],{});db['SmsQueueReport']['belongsTo'](db[_0xf554('0x14')],{});db['SmsQueueReport']['belongsTo'](db[_0xf554('0x59')],{});db[_0xf554('0xe3')]['hasMany'](db[_0xf554('0xdc')],{'foreignKey':_0xf554('0x1ea')});db[_0xf554('0xe3')][_0xf554('0x11e')](db[_0xf554('0xda')],{'foreignKey':_0xf554('0x1ea')});db[_0xf554('0xe3')][_0xf554('0x11e')](db[_0xf554('0xd9')],{'foreignKey':_0xf554('0x1ea')});db['Team'][_0xf554('0x12f')](db[_0xf554('0x14')],{'as':_0xf554('0x164'),'through':_0xf554('0x134')});db[_0xf554('0xec')][_0xf554('0x12f')](db[_0xf554('0x1b')],{'through':_0xf554('0x1eb'),'as':_0xf554('0x13c')});db[_0xf554('0xec')][_0xf554('0x12f')](db[_0xf554('0x39')],{'through':'team_has_mail_queues','as':'MailQueues'});db[_0xf554('0xec')]['belongsToMany'](db[_0xf554('0x6d')],{'through':_0xf554('0x1a9'),'as':_0xf554('0x13f')});db[_0xf554('0xec')]['belongsToMany'](db[_0xf554('0x140')],{'through':_0xf554('0x194'),'as':_0xf554('0x141')});db[_0xf554('0xec')]['belongsToMany'](db[_0xf554('0x59')],{'through':_0xf554('0x19a'),'as':'SmsQueues'});db[_0xf554('0xec')]['belongsToMany'](db[_0xf554('0x62')],{'through':_0xf554('0x1ec'),'as':_0xf554('0x1ed')});db[_0xf554('0xec')]['belongsToMany'](db['WhatsappQueue'],{'through':'team_has_whatsapp_queues','as':_0xf554('0x1ee')});db[_0xf554('0xec')][_0xf554('0x12f')](db['VoicePrefix'],{'through':'TeamVoicePrefix','as':_0xf554('0x13d')});db[_0xf554('0x1b3')][_0xf554('0x11e')](db[_0xf554('0x76')],{'as':_0xf554('0x1ef'),'foreignKey':_0xf554('0x1b5')});db[_0xf554('0x1b3')]['hasMany'](db[_0xf554('0x7a')],{'as':_0xf554('0x124'),'foreignKey':_0xf554('0x1b5')});db[_0xf554('0x1b3')][_0xf554('0x11e')](db[_0xf554('0x7c')],{'as':_0xf554('0x15a'),'foreignKey':_0xf554('0x1b5')});db[_0xf554('0x1b3')]['hasMany'](db[_0xf554('0x78')],{'as':_0xf554('0x15b'),'foreignKey':_0xf554('0x1b5')});db[_0xf554('0x1b3')][_0xf554('0x12d')](db[_0xf554('0x26')],{'as':'Trunk','foreignKey':'TrunkId'});db[_0xf554('0x1b3')][_0xf554('0x12d')](db[_0xf554('0x26')],{'as':_0xf554('0x15e'),'foreignKey':'TrunkBackupId'});db[_0xf554('0x1b3')]['belongsTo'](db[_0xf554('0x8a')],{'as':_0xf554('0x8a'),'foreignKey':_0xf554('0x160')});db[_0xf554('0x1b3')][_0xf554('0x12d')](db['SquareProject'],{'as':_0xf554('0xe7'),'foreignKey':_0xf554('0x1f0')});db['Campaign'][_0xf554('0x12f')](db[_0xf554('0xfb')],{'as':'Lists','through':'campaigns_has_cm_lists'});db[_0xf554('0x1b3')][_0xf554('0x12f')](db[_0xf554('0xfb')],{'as':_0xf554('0x165'),'through':_0xf554('0x1f1')});db[_0xf554('0x186')][_0xf554('0x12d')](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':_0xf554('0x18b')});db[_0xf554('0x1f2')][_0xf554('0x12d')](db[_0xf554('0x3f')],{});db['MailTransferReport']['belongsTo'](db['MailInteraction'],{});db['MailTransferReport']['belongsTo'](db[_0xf554('0x37')],{'foreignKey':_0xf554('0x1f3'),'as':_0xf554('0x1f4')});db[_0xf554('0x1f2')][_0xf554('0x12d')](db[_0xf554('0x14')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xf554('0x1f2')][_0xf554('0x12d')](db[_0xf554('0x14')],{'foreignKey':_0xf554('0x1f5'),'as':'ToAgent'});db[_0xf554('0x1f2')][_0xf554('0x12d')](db['MailQueue'],{'foreignKey':_0xf554('0x1f6'),'as':_0xf554('0x1f7')});db['MailTransferReport'][_0xf554('0x12d')](db['MailAccount'],{'foreignKey':'ToMailAccountId','as':_0xf554('0x1f8')});db[_0xf554('0xf5')][_0xf554('0x12d')](db[_0xf554('0x6b')],{});db[_0xf554('0xf5')]['belongsTo'](db[_0xf554('0x69')],{});db['ChatTransferReport']['belongsTo'](db[_0xf554('0x64')],{'foreignKey':_0xf554('0x1f9'),'as':_0xf554('0x1f4')});db[_0xf554('0xf5')][_0xf554('0x12d')](db[_0xf554('0x14')],{'foreignKey':'FromUserId','as':_0xf554('0x1fa')});db['ChatTransferReport'][_0xf554('0x12d')](db['User'],{'foreignKey':_0xf554('0x1f5'),'as':_0xf554('0x1fb')});db[_0xf554('0xf5')][_0xf554('0x12d')](db['ChatQueue'],{'foreignKey':_0xf554('0x1fc'),'as':'ToQueue'});db[_0xf554('0xf5')][_0xf554('0x12d')](db[_0xf554('0x64')],{'foreignKey':_0xf554('0x1fd'),'as':_0xf554('0x1f8')});db['FaxTransferReport'][_0xf554('0x12d')](db[_0xf554('0x190')],{});db['FaxTransferReport'][_0xf554('0x12d')](db[_0xf554('0x4c')],{});db[_0xf554('0x1fe')]['belongsTo'](db[_0xf554('0x48')],{'foreignKey':_0xf554('0x1ff'),'as':_0xf554('0x1f4')});db[_0xf554('0x1fe')][_0xf554('0x12d')](db[_0xf554('0x14')],{'foreignKey':_0xf554('0x200'),'as':_0xf554('0x1fa')});db[_0xf554('0x1fe')][_0xf554('0x12d')](db[_0xf554('0x14')],{'foreignKey':_0xf554('0x1f5'),'as':_0xf554('0x1fb')});db[_0xf554('0x1fe')]['belongsTo'](db[_0xf554('0x140')],{'foreignKey':_0xf554('0x201'),'as':_0xf554('0x1f7')});db[_0xf554('0x1fe')]['belongsTo'](db[_0xf554('0x48')],{'foreignKey':'ToFaxAccountId','as':_0xf554('0x1f8')});db[_0xf554('0xf8')]['belongsTo'](db[_0xf554('0x60')],{});db['OpenchannelTransferReport'][_0xf554('0x12d')](db[_0xf554('0x5e')],{});db[_0xf554('0xf8')][_0xf554('0x12d')](db[_0xf554('0x5b')],{'foreignKey':_0xf554('0x202'),'as':_0xf554('0x1f4')});db[_0xf554('0xf8')]['belongsTo'](db[_0xf554('0x14')],{'foreignKey':_0xf554('0x200'),'as':_0xf554('0x1fa')});db[_0xf554('0xf8')][_0xf554('0x12d')](db['User'],{'foreignKey':'ToUserId','as':_0xf554('0x1fb')});db[_0xf554('0xf8')][_0xf554('0x12d')](db['OpenchannelQueue'],{'foreignKey':_0xf554('0x203'),'as':'ToQueue'});db[_0xf554('0xf8')]['belongsTo'](db[_0xf554('0x5b')],{'foreignKey':_0xf554('0x204'),'as':_0xf554('0x1f8')});db['SmsTransferReport'][_0xf554('0x12d')](db[_0xf554('0x58')],{});db[_0xf554('0x205')][_0xf554('0x12d')](db[_0xf554('0x56')],{});db['SmsTransferReport'][_0xf554('0x12d')](db[_0xf554('0x52')],{'foreignKey':_0xf554('0x206'),'as':_0xf554('0x1f4')});db[_0xf554('0x205')]['belongsTo'](db[_0xf554('0x14')],{'foreignKey':_0xf554('0x200'),'as':_0xf554('0x1fa')});db[_0xf554('0x205')]['belongsTo'](db[_0xf554('0x14')],{'foreignKey':_0xf554('0x1f5'),'as':'ToAgent'});db[_0xf554('0x205')][_0xf554('0x12d')](db['SmsQueue'],{'foreignKey':_0xf554('0x207'),'as':_0xf554('0x1f7')});db['SmsTransferReport']['belongsTo'](db[_0xf554('0x52')],{'foreignKey':_0xf554('0x208'),'as':_0xf554('0x1f8')});db[_0xf554('0xfb')][_0xf554('0x11e')](db['Disposition'],{'as':_0xf554('0x176'),'foreignKey':'ListId','onDelete':'cascade'});db[_0xf554('0xfb')][_0xf554('0x11e')](db[_0xf554('0x7e')],{'as':'CustomFields','foreignKey':_0xf554('0x17b')});db[_0xf554('0xfb')][_0xf554('0x11e')](db[_0xf554('0x130')],{'as':_0xf554('0x1ac'),'onDelete':'cascade','foreignKey':_0xf554('0x17b')});db[_0xf554('0xfb')][_0xf554('0x11e')](db[_0xf554('0x7a')],{'as':_0xf554('0x124'),'foreignKey':'ListId'});db[_0xf554('0xfb')][_0xf554('0x11e')](db[_0xf554('0x7c')],{'as':_0xf554('0x125'),'foreignKey':_0xf554('0x17b')});db['CmList']['hasMany'](db[_0xf554('0x126')],{'as':_0xf554('0x126'),'foreignKey':_0xf554('0x17b')});db[_0xf554('0xfb')][_0xf554('0x12f')](db[_0xf554('0x1b')],{'as':_0xf554('0x209'),'through':'voice_queues_has_cm_lists'});db[_0xf554('0xfb')]['belongsToMany'](db['User'],{'as':_0xf554('0x164'),'through':'cm_user_has_lists'});db[_0xf554('0xfd')]['hasMany'](db[_0xf554('0x122')],{'as':_0xf554('0x123'),'onDelete':'cascade'});db['VoicePrefix']['belongsToMany'](db['User'],{'as':_0xf554('0x164'),'through':_0xf554('0x116')});db[_0xf554('0xfd')][_0xf554('0x12f')](db[_0xf554('0xec')],{'through':_0xf554('0x114'),'as':_0xf554('0x19b')});db['UserProfile']['hasMany'](db[_0xf554('0x14')],{'as':'Users','foreignKey':_0xf554('0x12e')});db['UserProfile'][_0xf554('0x11e')](db[_0xf554('0x101')],{'as':_0xf554('0x20a'),'foreignKey':_0xf554('0x12e'),'onDelete':_0xf554('0x11c')});db[_0xf554('0x101')]['hasMany'](db[_0xf554('0x103')],{'as':_0xf554('0x20b'),'foreignKey':_0xf554('0x20c'),'onDelete':_0xf554('0x11c')});db[_0xf554('0x106')][_0xf554('0x11e')](db['Disposition'],{'as':_0xf554('0x176'),'foreignKey':_0xf554('0x20d'),'onDelete':'cascade'});db[_0xf554('0x106')][_0xf554('0x11e')](db[_0xf554('0x84')],{'as':_0xf554('0x177'),'foreignKey':'WhatsappAccountId'});db['WhatsappAccount']['hasMany'](db[_0xf554('0x20e')],{'as':'Messages','foreignKey':_0xf554('0x20d')});db[_0xf554('0x106')]['hasMany'](db[_0xf554('0x10a')],{'as':'Interactions'});db[_0xf554('0x106')][_0xf554('0x11e')](db['WhatsappApplication'],{'as':_0xf554('0x154')});db[_0xf554('0x106')][_0xf554('0x12d')](db[_0xf554('0xfb')],{'as':_0xf554('0x17a'),'foreignKey':_0xf554('0x17b')});db[_0xf554('0x106')][_0xf554('0x12d')](db[_0xf554('0x8c')],{'as':_0xf554('0x161'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xf554('0x106')][_0xf554('0x12f')](db[_0xf554('0x14')],{'as':_0xf554('0x164'),'through':_0xf554('0x150')});db[_0xf554('0x108')][_0xf554('0x12d')](db['User'],{'onDelete':_0xf554('0x173')});db['WhatsappApplication'][_0xf554('0x12d')](db[_0xf554('0x10f')],{'onDelete':_0xf554('0x173')});db[_0xf554('0x108')]['belongsTo'](db[_0xf554('0x106')],{'onDelete':'restrict'});db[_0xf554('0x108')][_0xf554('0x12d')](db[_0xf554('0x8a')],{'onDelete':_0xf554('0x173'),'foreignKey':_0xf554('0x160')});db['WhatsappApplication'][_0xf554('0x12d')](db[_0xf554('0x182')],{'onDelete':_0xf554('0x173'),'foreignKey':_0xf554('0x18c')});db[_0xf554('0x10a')][_0xf554('0x11e')](db[_0xf554('0x20e')],{'as':_0xf554('0x178'),'onDelete':'cascade','foreignKey':_0xf554('0x20f')});db[_0xf554('0x10a')][_0xf554('0x12d')](db['WhatsappAccount'],{'as':'Account','foreignKey':'WhatsappAccountId'});db[_0xf554('0x10a')][_0xf554('0x12d')](db[_0xf554('0x130')],{'as':_0xf554('0x16d'),'foreignKey':_0xf554('0x16e')});db[_0xf554('0x10a')][_0xf554('0x12d')](db[_0xf554('0x14')],{'as':_0xf554('0x181'),'foreignKey':_0xf554('0x120')});db[_0xf554('0x10a')][_0xf554('0x12f')](db['Tag'],{'through':_0xf554('0x1c6'),'as':_0xf554('0x184')});db[_0xf554('0x10a')][_0xf554('0x12f')](db[_0xf554('0x182')],{'through':'whatsapp_interaction_has_tags','as':_0xf554('0x185')});db[_0xf554('0x10a')][_0xf554('0x12f')](db[_0xf554('0x14')],{'as':_0xf554('0x198'),'through':'user_has_whatsapp_interactions','foreignKey':_0xf554('0x20f')});db[_0xf554('0x20e')][_0xf554('0x12d')](db[_0xf554('0x14')],{'as':_0xf554('0x14')});db[_0xf554('0x20e')]['belongsTo'](db['CmContact'],{'onDelete':_0xf554('0x11c'),'as':'Contact'});db[_0xf554('0x20e')][_0xf554('0x12d')](db[_0xf554('0x10a')],{'onDelete':'cascade','as':_0xf554('0x188'),'foreignKey':_0xf554('0x20f')});db[_0xf554('0x20e')][_0xf554('0x12d')](db['WhatsappAccount'],{'as':_0xf554('0x180'),'foreignKey':_0xf554('0x20d')});db[_0xf554('0x210')]['belongsTo'](db[_0xf554('0x106')],{});db['WhatsappQueueReport'][_0xf554('0x12d')](db[_0xf554('0xfb')],{'as':_0xf554('0x17a'),'foreignKey':_0xf554('0x17b')});db[_0xf554('0x210')][_0xf554('0x12d')](db[_0xf554('0x130')],{'as':'Contact','foreignKey':_0xf554('0x16e')});db[_0xf554('0x210')][_0xf554('0x12d')](db[_0xf554('0x10a')],{});db['WhatsappQueueReport']['belongsTo'](db['WhatsappQueue'],{});db[_0xf554('0x210')][_0xf554('0x12d')](db[_0xf554('0x20e')],{});db[_0xf554('0x210')][_0xf554('0x12d')](db[_0xf554('0x14')],{});db[_0xf554('0x10d')][_0xf554('0x12d')](db[_0xf554('0x20e')],{});db['WhatsappTransferReport'][_0xf554('0x12d')](db['WhatsappInteraction'],{});db[_0xf554('0x10d')][_0xf554('0x12d')](db[_0xf554('0x106')],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db[_0xf554('0x10d')]['belongsTo'](db[_0xf554('0x106')],{'foreignKey':_0xf554('0x211'),'as':_0xf554('0x1f8')});db['WhatsappTransferReport'][_0xf554('0x12d')](db[_0xf554('0x10f')],{'foreignKey':'ToQueueId','as':_0xf554('0x1f7')});db['WhatsappTransferReport'][_0xf554('0x12d')](db[_0xf554('0x14')],{'foreignKey':'FromUserId','as':_0xf554('0x1fa')});db[_0xf554('0x10d')][_0xf554('0x12d')](db[_0xf554('0x14')],{'foreignKey':_0xf554('0x1f5'),'as':_0xf554('0x1fb')});db[_0xf554('0x10f')][_0xf554('0x12f')](db[_0xf554('0x14')],{'as':_0xf554('0x164'),'through':_0xf554('0x144'),'foreignKey':_0xf554('0x212')});db[_0xf554('0x10f')][_0xf554('0x12f')](db[_0xf554('0xec')],{'through':'team_has_whatsapp_queues','as':_0xf554('0x19b')});db[_0xf554('0x118')][_0xf554('0x12d')](db['User'],{'as':_0xf554('0x213'),'foreignKey':'UserId','onDelete':_0xf554('0x11c'),'hooks':!![]});db[_0xf554('0x111')][_0xf554('0x11a')](db[_0xf554('0x1e5')],{'as':_0xf554('0x1e5'),'onDelete':_0xf554('0x173')});db[_0xf554('0x111')]['hasOne'](db['MailServerIn'],{'as':'Imap','onDelete':_0xf554('0x173')});db[_0xf554('0x111')][_0xf554('0x11a')](db[_0xf554('0x172')],{'as':_0xf554('0x175'),'onDelete':'restrict'});module['exports']={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0xfb42=['ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','ContactItemType','../api/contactItemType/contactItemType.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','Integration','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','AnalyticExtractedReport','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','../api/userVoicePrefix/userVoicePrefix.model','../api/user-setting/user-setting.model','User','hasOne','cascade','UserId','UserSetting','userSetting','hasMany','VoiceQueuesRt','Extensions','HopperFinals','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','UserNotifications','belongsTo','belongsToMany','Groups','chat_group_has_users','Contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_chat_interactions','user_has_sms_interactions','user_has_openchannel_interactions','WhatsappInteractions','VoiceQueue','VoiceQueues','VoicePrefixes','UserVoicePrefix','UserMailQueue','ChatQueues','FaxQueues','UserFaxQueue','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','ChatWebsites','FaxAccount','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','Trunk','TrunkId','TrunkBackup','Pause','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','QueueCalls','uniqueid','Contact','ContactId','MailAccountId','CloudProviderId','restrict','Smtp','CannedAnswer','Answers','MailMessage','List','TemplateId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','team_has_mail_queues','Teams','Account','Owner','Tag','mail_interaction_has_tags','ThroughTags','Users','user_has_mail_interactions','MailInteractionId','Attachments','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','MailApplication','IntervalId','ListId','Items','Dispositions','FaxAccountId','Interactions','Exntensions','TagId','fax_interaction_has_tags','Tags','user_has_fax_interactions','FaxInteractionId','Interaction','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsApplication','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ProactiveActions','ChatApplication','user_has_chat_websites','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatGroupId','Members','CompanyId','CmContactHasItem','Phones','CmContactId','CmHopper','cm_user_has_contacts','cm_contact_has_tags','CmHopperId','Campaign','CampaignId','Automation','All','OneAll','Condition','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','Configurations','AccountId','SalesforceField','Subjects','DescriptionId','FieldId','Subject','SubjectId','Description','VariableId','Descriptions','Field','DeskField','int_desk_configuration_has_tags','ZohoField','ZendeskAccount','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','VtigerField','ServicenowField','FreshsalesAccount','FromId','ToId','SessionId','SmsQueueReport','JscriptyProject','ProjectId','MailQueues','team_has_whatsapp_queues','TeamVoicePrefix','SquareProjectId','campaigns_has_cm_blacklists','FromAccount','FromUserId','ToUserId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAgent','ToChatQueueId','FaxTransferReport','FromFaxAccountId','ToAgent','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','CmCustomField','CustomFields','HopperHistory','Queues','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccount','WhatsappAccountId','WhatsappInteractionId','user_has_whatsapp_interactions','ToQueueId','Imap','exports','../config/environment','sequelize','lodash','jstz','defaultsDeep','xC@LL1234','127.0.0.1','mysql','utf8mb4','utf8','sequelizeHistory','motion2','name','utf8_general_ci','database','username','password','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model'];(function(_0x12b87a,_0x193af3){var _0x35f927=function(_0x372645){while(--_0x372645){_0x12b87a['push'](_0x12b87a['shift']());}};_0x35f927(++_0x193af3);}(_0xfb42,0x198));var _0x2fb4=function(_0x83ea3d,_0x37d917){_0x83ea3d=_0x83ea3d-0x0;var _0x21bf8e=_0xfb42[_0x83ea3d];return _0x21bf8e;};'use strict';var config=require(_0x2fb4('0x0'));var Sequelize=require(_0x2fb4('0x1'));var _=require(_0x2fb4('0x2'));var jstz=require(_0x2fb4('0x3'));var timezone=jstz['determine']();config['sequelize']=_[_0x2fb4('0x4')](config[_0x2fb4('0x1')],{'database':'motion2','username':'xcall','password':_0x2fb4('0x5'),'options':{'host':_0x2fb4('0x6'),'port':0xcea,'dialect':_0x2fb4('0x7'),'dialectOptions':{'charset':_0x2fb4('0x8')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x2fb4('0x9'),'collate':'utf8_general_ci'}}});config[_0x2fb4('0xa')]=_[_0x2fb4('0x4')](config['sequelizeHistory'],{'database':_0x2fb4('0xb'),'username':'xcall','password':'xC@LL1234','options':{'host':_0x2fb4('0x6'),'port':0xcea,'dialect':_0x2fb4('0x7'),'dialectOptions':{'charset':_0x2fb4('0x8')},'logging':![],'timezone':timezone[_0x2fb4('0xc')](),'define':{'charset':'utf8','collate':_0x2fb4('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x2fb4('0xe')],config[_0x2fb4('0x1')][_0x2fb4('0xf')],config[_0x2fb4('0x1')][_0x2fb4('0x10')],config[_0x2fb4('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x2fb4('0xa')][_0x2fb4('0xe')],config['sequelizeHistory'][_0x2fb4('0xf')],config[_0x2fb4('0xa')][_0x2fb4('0x10')],config[_0x2fb4('0xa')]['options'])};db['User']=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x12'));db[_0x2fb4('0x13')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x14'));db['VoiceContext']=db[_0x2fb4('0x1')][_0x2fb4('0x11')]('../api/voiceContext/voiceContext.model');db[_0x2fb4('0x15')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x16'));db[_0x2fb4('0x17')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x18'));db['VoiceQueue']=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x19'));db[_0x2fb4('0x1a')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x1b'));db[_0x2fb4('0x1c')]=db['sequelize'][_0x2fb4('0x11')](_0x2fb4('0x1d'));db[_0x2fb4('0x1e')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x1f'));db[_0x2fb4('0x20')]=db['sequelize']['import'](_0x2fb4('0x21'));db[_0x2fb4('0x22')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x23'));db[_0x2fb4('0x24')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x25'));db[_0x2fb4('0x26')]=db[_0x2fb4('0x1')]['import'](_0x2fb4('0x27'));db[_0x2fb4('0x28')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0x2fb4('0x29')]=db['sequelize'][_0x2fb4('0x11')](_0x2fb4('0x2a'));db['Trunk']=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x2b'));db[_0x2fb4('0x2c')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x2d'));db[_0x2fb4('0x2e')]=db[_0x2fb4('0x1')]['import'](_0x2fb4('0x2f'));db[_0x2fb4('0x30')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x31'));db[_0x2fb4('0x32')]=db[_0x2fb4('0x1')]['import']('../api/userChatQueue/userChatQueue.model');db['UserMailQueue']=db[_0x2fb4('0x1')][_0x2fb4('0x11')]('../api/userMailQueue/userMailQueue.model');db['UserFaxQueue']=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x33'));db[_0x2fb4('0x34')]=db[_0x2fb4('0x1')]['import']('../api/userSmsQueue/userSmsQueue.model');db[_0x2fb4('0x35')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x36'));db[_0x2fb4('0x37')]=db[_0x2fb4('0x1')]['import']('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x2fb4('0x38')]=db['sequelize']['import'](_0x2fb4('0x39'));db[_0x2fb4('0x3a')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x3b'));db[_0x2fb4('0x3c')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')]('../api/mailAccount/mailAccount.model');db[_0x2fb4('0x3d')]=db['sequelize']['import'](_0x2fb4('0x3e'));db['MailSubstatus']=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x3f'));db[_0x2fb4('0x40')]=db['sequelize'][_0x2fb4('0x11')](_0x2fb4('0x41'));db['MailMessage']=db['sequelize']['import']('../api/mailMessage/mailMessage.model');db['MailApplication']=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x42'));db[_0x2fb4('0x43')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x44'));db[_0x2fb4('0x45')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x46'));db[_0x2fb4('0x47')]=db['sequelize']['import']('../api/dashboardItem/dashboardItem.model');db['FaxAccount']=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x48'));db[_0x2fb4('0x49')]=db['sequelize'][_0x2fb4('0x11')](_0x2fb4('0x4a'));db[_0x2fb4('0x4b')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x4c'));db[_0x2fb4('0x4d')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x4e'));db[_0x2fb4('0x4f')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x50'));db['FaxQueueReport']=db['sequelize']['import']('../api/faxQueueReport/faxQueueReport.model');db['SmsAccount']=db[_0x2fb4('0x1')][_0x2fb4('0x11')]('../api/smsAccount/smsAccount.model');db['SmsApplication']=db['sequelize'][_0x2fb4('0x11')]('../api/smsApplication/smsApplication.model');db[_0x2fb4('0x51')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')]('../api/smsInteraction/smsInteraction.model');db[_0x2fb4('0x52')]=db[_0x2fb4('0x1')]['import'](_0x2fb4('0x53'));db[_0x2fb4('0x54')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x55'));db[_0x2fb4('0x56')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x57'));db[_0x2fb4('0x58')]=db['sequelize']['import'](_0x2fb4('0x59'));db['OpenchannelInteraction']=db['sequelize'][_0x2fb4('0x11')](_0x2fb4('0x5a'));db['OpenchannelMessage']=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x5b'));db['OpenchannelQueue']=db['sequelize'][_0x2fb4('0x11')](_0x2fb4('0x5c'));db[_0x2fb4('0x5d')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x5e'));db[_0x2fb4('0x5f')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x60'));db['ChatApplication']=db['sequelize'][_0x2fb4('0x11')]('../api/chatApplication/chatApplication.model');db[_0x2fb4('0x61')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x62'));db[_0x2fb4('0x63')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x64'));db['ChatOfflineMessage']=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x65'));db[_0x2fb4('0x66')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x67'));db[_0x2fb4('0x68')]=db[_0x2fb4('0x1')]['import'](_0x2fb4('0x69'));db[_0x2fb4('0x6a')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0x2fb4('0x6b')]=db['sequelize']['import'](_0x2fb4('0x6c'));db[_0x2fb4('0x6d')]=db[_0x2fb4('0x1')]['import'](_0x2fb4('0x6e'));db['CmHopper']=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x6f'));db[_0x2fb4('0x70')]=db[_0x2fb4('0x1')]['import'](_0x2fb4('0x71'));db[_0x2fb4('0x72')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x73'));db[_0x2fb4('0x74')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x75'));db[_0x2fb4('0x76')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x77'));db['CmCustomField']=db['sequelize'][_0x2fb4('0x11')](_0x2fb4('0x78'));db[_0x2fb4('0x79')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x7a'));db['Automation']=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x7b'));db['CannedAnswer']=db['sequelize'][_0x2fb4('0x11')](_0x2fb4('0x7c'));db[_0x2fb4('0x7d')]=db['sequelize'][_0x2fb4('0x11')](_0x2fb4('0x7e'));db['Condition']=db[_0x2fb4('0x1')]['import'](_0x2fb4('0x7f'));db[_0x2fb4('0x80')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x81'));db['Pause']=db['sequelize'][_0x2fb4('0x11')](_0x2fb4('0x82'));db['Cdr']=db[_0x2fb4('0x1')][_0x2fb4('0x11')]('../api/cdr/cdr.model');db[_0x2fb4('0x83')]=db['sequelize'][_0x2fb4('0x11')](_0x2fb4('0x84'));db[_0x2fb4('0x85')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x86'));db[_0x2fb4('0x87')]=db[_0x2fb4('0x1')]['import'](_0x2fb4('0x88'));db['Tag']=db[_0x2fb4('0x1')][_0x2fb4('0x11')]('../api/tag/tag.model');db[_0x2fb4('0x89')]=db['sequelize']['import'](_0x2fb4('0x8a'));db['CmContactHasItem']=db[_0x2fb4('0x1')][_0x2fb4('0x11')]('../api/cmContactHasItem/cmContactHasItem.model');db[_0x2fb4('0x8b')]=db[_0x2fb4('0x1')]['import'](_0x2fb4('0x8c'));db[_0x2fb4('0x8d')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x8e'));db[_0x2fb4('0x8f')]=db['sequelize'][_0x2fb4('0x11')](_0x2fb4('0x90'));db[_0x2fb4('0x91')]=db['sequelize'][_0x2fb4('0x11')]('../api/variable/variable.model');db[_0x2fb4('0x92')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')]('../api/integration/integration.model');db['IntegrationReport']=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x93'));db[_0x2fb4('0x94')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0x2fb4('0x95')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x2fb4('0x96')]=db['sequelize'][_0x2fb4('0x11')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x2fb4('0x97')]=db[_0x2fb4('0x1')]['import']('../api/analyticMetric/analyticMetric.model');db[_0x2fb4('0x98')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x99'));db['AnalyticTreeReport']=db['sequelize'][_0x2fb4('0x11')](_0x2fb4('0x9a'));db[_0x2fb4('0x9b')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x9c'));db[_0x2fb4('0x9d')]=db[_0x2fb4('0x1')]['import'](_0x2fb4('0x9e'));db['SalesforceField']=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x9f'));db[_0x2fb4('0xa0')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0xa1'));db[_0x2fb4('0xa2')]=db[_0x2fb4('0x1')]['import'](_0x2fb4('0xa3'));db[_0x2fb4('0xa4')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0xa5'));db[_0x2fb4('0xa6')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0xa7'));db[_0x2fb4('0xa8')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0xa9'));db['DeskField']=db[_0x2fb4('0x1')][_0x2fb4('0x11')]('../api/intDeskField/intDeskField.model');db[_0x2fb4('0xaa')]=db[_0x2fb4('0x1')]['import'](_0x2fb4('0xab'));db[_0x2fb4('0xac')]=db[_0x2fb4('0x1')]['import'](_0x2fb4('0xad'));db['ZohoField']=db[_0x2fb4('0x1')][_0x2fb4('0x11')]('../api/intZohoField/intZohoField.model');db['ZendeskAccount']=db[_0x2fb4('0x1')]['import'](_0x2fb4('0xae'));db[_0x2fb4('0xaf')]=db['sequelize']['import'](_0x2fb4('0xb0'));db[_0x2fb4('0xb1')]=db['sequelize'][_0x2fb4('0x11')](_0x2fb4('0xb2'));db['FreshdeskAccount']=db['sequelize'][_0x2fb4('0x11')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize']['import'](_0x2fb4('0xb3'));db[_0x2fb4('0xb4')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x2fb4('0xb5')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0xb6'));db[_0x2fb4('0xb7')]=db[_0x2fb4('0x1')]['import']('../api/intVtigerConfiguration/intVtigerConfiguration.model');db['VtigerField']=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0xb8'));db[_0x2fb4('0xb9')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0xba'));db[_0x2fb4('0xbb')]=db['sequelize'][_0x2fb4('0x11')](_0x2fb4('0xbc'));db['ServicenowField']=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0xbd'));db[_0x2fb4('0xbe')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0xbf'));db[_0x2fb4('0xc0')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0xc1'));db[_0x2fb4('0xc2')]=db[_0x2fb4('0x1')]['import'](_0x2fb4('0xc3'));db['FreshsalesAccount']=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0xc4'));db[_0x2fb4('0xc5')]=db[_0x2fb4('0x1')]['import']('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0x2fb4('0xc6')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0xc7'));db[_0x2fb4('0x92')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0xc8'));db[_0x2fb4('0xc9')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0xca'));db[_0x2fb4('0xcb')]=db['sequelize']['import'](_0x2fb4('0xcc'));db[_0x2fb4('0xcd')]=db['sequelize'][_0x2fb4('0x11')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x2fb4('0xce')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0xcf'));db['JscriptyQuestionReport']=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0xd0'));db[_0x2fb4('0xd1')]=db['sequelize'][_0x2fb4('0x11')](_0x2fb4('0xd2'));db['SmsQueueReport']=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0xd3'));db[_0x2fb4('0xd4')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0xd5'));db[_0x2fb4('0xd6')]=db['sequelize'][_0x2fb4('0x11')](_0x2fb4('0xd7'));db['JscriptyProject']=db['sequelize'][_0x2fb4('0x11')](_0x2fb4('0xd8'));db[_0x2fb4('0xd9')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0xda'));db[_0x2fb4('0xdb')]=db['sequelize']['import']('../api/squareOdbc/squareOdbc.model');db[_0x2fb4('0xdc')]=db['sequelize'][_0x2fb4('0x11')]('../api/squareProject/squareProject.model');db[_0x2fb4('0xdd')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0xde'));db[_0x2fb4('0xdf')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0xe0'));db['Team']=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0xe1'));db[_0x2fb4('0xe2')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0xe3'));db['Campaign']=db[_0x2fb4('0x1')]['import'](_0x2fb4('0xe4'));db[_0x2fb4('0xe5')]=db['sequelize'][_0x2fb4('0x11')](_0x2fb4('0xe6'));db[_0x2fb4('0xe7')]=db[_0x2fb4('0x1')]['import'](_0x2fb4('0xe8'));db[_0x2fb4('0xe9')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0xea'));db[_0x2fb4('0xeb')]=db[_0x2fb4('0x1')]['import']('../api/mailTransferReport/mailTransferReport.model');db[_0x2fb4('0xec')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0xed'));db['FaxTransferReport']=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0xee'));db[_0x2fb4('0xef')]=db['sequelize'][_0x2fb4('0x11')](_0x2fb4('0xf0'));db['SmsTransferReport']=db['sequelize'][_0x2fb4('0x11')](_0x2fb4('0xf1'));db[_0x2fb4('0xf2')]=db[_0x2fb4('0x1')]['import'](_0x2fb4('0xf3'));db[_0x2fb4('0xf4')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')]('../api/voicePrefix/voicePrefix.model');db[_0x2fb4('0xf5')]=db['sequelize'][_0x2fb4('0x11')](_0x2fb4('0xf6'));db[_0x2fb4('0xf7')]=db['sequelize']['import'](_0x2fb4('0xf8'));db[_0x2fb4('0xf9')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')]('../api/userProfileResource/userProfileResource.model');db[_0x2fb4('0xfa')]=db['sequelize'][_0x2fb4('0x11')](_0x2fb4('0xfb'));db['WhatsappAccount']=db[_0x2fb4('0x1')]['import']('../api/whatsappAccount/whatsappAccount.model');db[_0x2fb4('0xfc')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0xfd'));db[_0x2fb4('0xfe')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0x2fb4('0xff')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x100'));db[_0x2fb4('0x101')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x102'));db[_0x2fb4('0x103')]=db['sequelize'][_0x2fb4('0x11')](_0x2fb4('0x104'));db[_0x2fb4('0x105')]=db[_0x2fb4('0x1')][_0x2fb4('0x11')]('../api/whatsappQueue/whatsappQueue.model');db[_0x2fb4('0x106')]=db['sequelize'][_0x2fb4('0x11')](_0x2fb4('0x107'));db[_0x2fb4('0x108')]=db[_0x2fb4('0x1')]['import'](_0x2fb4('0x109'));db['TeamVoicePrefix']=db[_0x2fb4('0x1')][_0x2fb4('0x11')]('../api/teamVoicePrefix/teamVoicePrefix.model');db['UserVoicePrefix']=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x10a'));db['UserSetting']=db[_0x2fb4('0x1')][_0x2fb4('0x11')](_0x2fb4('0x10b'));db[_0x2fb4('0x10c')][_0x2fb4('0x10d')](db[_0x2fb4('0x1e')],{'as':'VoiceMail','onDelete':_0x2fb4('0x10e'),'foreignKey':_0x2fb4('0x10f')});db[_0x2fb4('0x10c')][_0x2fb4('0x10d')](db[_0x2fb4('0x110')],{'as':_0x2fb4('0x111'),'onDelete':_0x2fb4('0x10e'),'foreignKey':'UserId'});db['User'][_0x2fb4('0x112')](db[_0x2fb4('0x1a')],{'as':'Recordings','foreignKey':'UserId'});db[_0x2fb4('0x10c')][_0x2fb4('0x112')](db[_0x2fb4('0x2e')],{'as':_0x2fb4('0x113'),'foreignKey':_0x2fb4('0x10f')});db['User'][_0x2fb4('0x112')](db['VoiceExtension'],{'as':_0x2fb4('0x114'),'onDelete':'cascade','hooks':!![]});db[_0x2fb4('0x10c')][_0x2fb4('0x112')](db[_0x2fb4('0x72')],{'as':_0x2fb4('0x115'),'foreignKey':_0x2fb4('0x10f')});db[_0x2fb4('0x10c')][_0x2fb4('0x112')](db[_0x2fb4('0x74')],{'as':'HopperHistory','foreignKey':'UserId'});db['User']['hasMany'](db[_0x2fb4('0x76')],{'as':_0x2fb4('0x76'),'foreignKey':_0x2fb4('0x10f')});db['User']['hasMany'](db[_0x2fb4('0x116')],{'as':_0x2fb4('0x117'),'foreignKey':_0x2fb4('0x10f')});db[_0x2fb4('0x10c')]['hasMany'](db[_0x2fb4('0x61')],{'as':_0x2fb4('0x118'),'foreignKey':'UserId'});db[_0x2fb4('0x10c')][_0x2fb4('0x112')](db[_0x2fb4('0x51')],{'as':_0x2fb4('0x119'),'foreignKey':'UserId'});db['User'][_0x2fb4('0x112')](db[_0x2fb4('0x4b')],{'as':_0x2fb4('0x11a'),'foreignKey':_0x2fb4('0x10f')});db['User'][_0x2fb4('0x112')](db[_0x2fb4('0x40')],{'as':_0x2fb4('0x11b'),'foreignKey':_0x2fb4('0x10f')});db[_0x2fb4('0x10c')][_0x2fb4('0x112')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','foreignKey':_0x2fb4('0x10f')});db[_0x2fb4('0x10c')][_0x2fb4('0x112')](db['UserNotification'],{'as':_0x2fb4('0x11c'),'foreignKey':'SenderId'});db[_0x2fb4('0x10c')][_0x2fb4('0x11d')](db['UserProfile'],{'as':_0x2fb4('0xf5'),'foreignKey':'userProfileId'});db[_0x2fb4('0x10c')][_0x2fb4('0x11e')](db[_0x2fb4('0x68')],{'as':_0x2fb4('0x11f'),'through':_0x2fb4('0x120')});db['User'][_0x2fb4('0x11e')](db[_0x2fb4('0x6d')],{'as':_0x2fb4('0x121'),'through':'cm_user_has_contacts'});db[_0x2fb4('0x10c')]['belongsToMany'](db['CmList'],{'as':_0x2fb4('0x122'),'through':_0x2fb4('0x123')});db[_0x2fb4('0x10c')]['belongsToMany'](db[_0x2fb4('0x124')],{'through':_0x2fb4('0x125')});db[_0x2fb4('0x10c')]['belongsToMany'](db['MailInteraction'],{'as':_0x2fb4('0x11b'),'through':'user_has_mail_interactions'});db[_0x2fb4('0x10c')][_0x2fb4('0x11e')](db[_0x2fb4('0x61')],{'as':_0x2fb4('0x118'),'through':_0x2fb4('0x126')});db['User']['belongsToMany'](db[_0x2fb4('0x4b')],{'as':'FaxInteractions','through':'user_has_fax_interactions'});db[_0x2fb4('0x10c')][_0x2fb4('0x11e')](db[_0x2fb4('0x51')],{'as':_0x2fb4('0x119'),'through':_0x2fb4('0x127')});db['User'][_0x2fb4('0x11e')](db[_0x2fb4('0x116')],{'as':_0x2fb4('0x117'),'through':_0x2fb4('0x128')});db[_0x2fb4('0x10c')][_0x2fb4('0x11e')](db[_0x2fb4('0xfe')],{'as':_0x2fb4('0x129'),'through':'user_has_whatsapp_interactions'});db[_0x2fb4('0x10c')][_0x2fb4('0x11e')](db[_0x2fb4('0x12a')],{'as':_0x2fb4('0x12b'),'through':_0x2fb4('0x30'),'required':![]});db[_0x2fb4('0x10c')][_0x2fb4('0x11e')](db[_0x2fb4('0xf4')],{'as':_0x2fb4('0x12c'),'through':_0x2fb4('0x12d'),'required':![]});db[_0x2fb4('0x10c')][_0x2fb4('0x11e')](db[_0x2fb4('0x3d')],{'as':'MailQueues','through':_0x2fb4('0x12e'),'required':![]});db[_0x2fb4('0x10c')][_0x2fb4('0x11e')](db[_0x2fb4('0x66')],{'as':_0x2fb4('0x12f'),'through':_0x2fb4('0x32'),'required':![],'hooks':!![]});db['User'][_0x2fb4('0x11e')](db['FaxQueue'],{'as':_0x2fb4('0x130'),'through':_0x2fb4('0x131'),'required':![]});db[_0x2fb4('0x10c')][_0x2fb4('0x11e')](db[_0x2fb4('0x54')],{'as':_0x2fb4('0x132'),'through':'UserSmsQueue','required':![]});db['User'][_0x2fb4('0x11e')](db[_0x2fb4('0x133')],{'as':_0x2fb4('0x134'),'through':_0x2fb4('0x35'),'required':![]});db[_0x2fb4('0x10c')][_0x2fb4('0x11e')](db[_0x2fb4('0x105')],{'as':_0x2fb4('0x135'),'through':_0x2fb4('0x37'),'required':![]});db['User'][_0x2fb4('0x11e')](db[_0x2fb4('0xf2')],{'through':_0x2fb4('0x123')});db[_0x2fb4('0x10c')][_0x2fb4('0x11e')](db[_0x2fb4('0x5d')],{'as':_0x2fb4('0x136'),'through':'user_has_chat_websites'});db['User'][_0x2fb4('0x11e')](db[_0x2fb4('0x137')],{'as':'FaxAccounts','through':_0x2fb4('0x138')});db[_0x2fb4('0x10c')][_0x2fb4('0x11e')](db[_0x2fb4('0x3c')],{'as':'MailAccounts','through':_0x2fb4('0x139')});db[_0x2fb4('0x10c')][_0x2fb4('0x11e')](db['OpenchannelAccount'],{'as':_0x2fb4('0x13a'),'through':_0x2fb4('0x13b')});db[_0x2fb4('0x10c')]['belongsToMany'](db[_0x2fb4('0x13c')],{'as':_0x2fb4('0x13d'),'through':_0x2fb4('0x13e')});db['User']['belongsToMany'](db['WhatsappAccount'],{'as':_0x2fb4('0x13f'),'through':_0x2fb4('0x140')});db[_0x2fb4('0x13')][_0x2fb4('0x112')](db['VoiceExtension'],{'as':'SpiedAgents','onDelete':_0x2fb4('0x10e'),'foreignKey':_0x2fb4('0x141')});db[_0x2fb4('0x142')][_0x2fb4('0x112')](db[_0x2fb4('0x15')],{'onDelete':_0x2fb4('0x10e')});db[_0x2fb4('0x15')]['hasMany'](db[_0x2fb4('0x15')],{'as':_0x2fb4('0x143'),'onDelete':'cascade'});db[_0x2fb4('0x17')][_0x2fb4('0x11e')](db['Sound'],{'as':_0x2fb4('0x144'),'through':_0x2fb4('0x145')});db[_0x2fb4('0x12a')][_0x2fb4('0x112')](db[_0x2fb4('0x2e')],{'as':'Members','foreignKey':_0x2fb4('0x146')});db[_0x2fb4('0x12a')][_0x2fb4('0x112')](db['CmHopper'],{'as':_0x2fb4('0x147'),'foreignKey':_0x2fb4('0x146')});db[_0x2fb4('0x12a')][_0x2fb4('0x112')](db['CmHopperFinal'],{'as':_0x2fb4('0x115'),'foreignKey':_0x2fb4('0x146')});db[_0x2fb4('0x12a')][_0x2fb4('0x112')](db[_0x2fb4('0x74')],{'as':_0x2fb4('0x148'),'foreignKey':_0x2fb4('0x146')});db[_0x2fb4('0x12a')][_0x2fb4('0x112')](db['ReportAgentPreview'],{'as':_0x2fb4('0x76'),'foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db['CmHopperBlack'],{'as':_0x2fb4('0x149'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x2fb4('0x112')](db['JscriptySessionReport'],{'as':_0x2fb4('0x14a'),'foreignKey':_0x2fb4('0x146')});db[_0x2fb4('0x12a')][_0x2fb4('0x11d')](db[_0x2fb4('0x14b')],{'as':_0x2fb4('0x14b'),'foreignKey':_0x2fb4('0x14c')});db[_0x2fb4('0x12a')][_0x2fb4('0x11d')](db['Trunk'],{'as':_0x2fb4('0x14d'),'foreignKey':'TrunkBackupId'});db[_0x2fb4('0x12a')][_0x2fb4('0x11d')](db[_0x2fb4('0x80')],{'as':'Interval','foreignKey':'IntervalId'});db[_0x2fb4('0x12a')][_0x2fb4('0x11d')](db[_0x2fb4('0x14e')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x2fb4('0x12a')][_0x2fb4('0x11e')](db['CmList'],{'as':_0x2fb4('0x122'),'through':'voice_queues_has_cm_lists'});db['VoiceQueue'][_0x2fb4('0x11e')](db[_0x2fb4('0x10c')],{'as':'Agents','through':_0x2fb4('0x30')});db[_0x2fb4('0x12a')][_0x2fb4('0x11e')](db['Team'],{'as':'Teams','through':_0x2fb4('0x108')});db[_0x2fb4('0x12a')][_0x2fb4('0x11e')](db['CmList'],{'as':_0x2fb4('0x14f'),'through':_0x2fb4('0x150')});db[_0x2fb4('0x1a')]['belongsTo'](db[_0x2fb4('0x10c')],{'as':_0x2fb4('0x10c'),'foreignKey':'UserId'});db[_0x2fb4('0x1c')][_0x2fb4('0x11d')](db[_0x2fb4('0x10c')],{'as':_0x2fb4('0x10c'),'foreignKey':_0x2fb4('0x10f')});db[_0x2fb4('0x1e')][_0x2fb4('0x112')](db['VoiceMailMessage'],{'as':_0x2fb4('0x151'),'onDelete':_0x2fb4('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x2fb4('0x152')});db[_0x2fb4('0x20')][_0x2fb4('0x11d')](db[_0x2fb4('0x1e')],{'foreignKey':_0x2fb4('0x153'),'targetKey':_0x2fb4('0x152')});db[_0x2fb4('0x22')][_0x2fb4('0x112')](db[_0x2fb4('0x28')],{'as':_0x2fb4('0x154'),'foreignKey':'uniqueid','constraints':![]});db[_0x2fb4('0x22')][_0x2fb4('0x112')](db[_0x2fb4('0x26')],{'as':'AgentReports','foreignKey':_0x2fb4('0x155'),'constraints':![]});db[_0x2fb4('0x22')][_0x2fb4('0x11d')](db[_0x2fb4('0x10c')],{'as':_0x2fb4('0x10c'),'foreignKey':_0x2fb4('0x10f')});db[_0x2fb4('0x22')]['belongsTo'](db[_0x2fb4('0x6d')],{'as':_0x2fb4('0x156'),'foreignKey':_0x2fb4('0x157')});db[_0x2fb4('0x38')][_0x2fb4('0x11d')](db[_0x2fb4('0x3c')],{'as':_0x2fb4('0x3c'),'foreignKey':_0x2fb4('0x158')});db['MailServerIn']['belongsTo'](db[_0x2fb4('0x106')],{'as':'CloudProvider','foreignKey':_0x2fb4('0x159'),'onDelete':_0x2fb4('0x15a')});db[_0x2fb4('0x3a')][_0x2fb4('0x11d')](db[_0x2fb4('0x3c')],{'as':_0x2fb4('0x3c'),'foreignKey':_0x2fb4('0x158')});db[_0x2fb4('0x3a')][_0x2fb4('0x11d')](db[_0x2fb4('0x106')],{'as':'CloudProvider','foreignKey':_0x2fb4('0x159'),'onDelete':'restrict'});db[_0x2fb4('0x3c')][_0x2fb4('0x10d')](db[_0x2fb4('0x38')],{'as':'Imap','onDelete':_0x2fb4('0x10e')});db[_0x2fb4('0x3c')][_0x2fb4('0x10d')](db[_0x2fb4('0x3a')],{'as':_0x2fb4('0x15b'),'onDelete':_0x2fb4('0x10e')});db[_0x2fb4('0x3c')][_0x2fb4('0x112')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x2fb4('0x158'),'onDelete':_0x2fb4('0x10e')});db[_0x2fb4('0x3c')][_0x2fb4('0x112')](db[_0x2fb4('0x15c')],{'as':_0x2fb4('0x15d'),'foreignKey':'MailAccountId'});db[_0x2fb4('0x3c')][_0x2fb4('0x112')](db[_0x2fb4('0x15e')],{'as':_0x2fb4('0x151'),'foreignKey':'MailAccountId'});db[_0x2fb4('0x3c')]['hasMany'](db['MailInteraction'],{'as':'Interactions'});db['MailAccount'][_0x2fb4('0x112')](db['MailApplication'],{'as':_0x2fb4('0x143')});db[_0x2fb4('0x3c')]['belongsTo'](db[_0x2fb4('0xf2')],{'as':_0x2fb4('0x15f'),'foreignKey':'ListId'});db['MailAccount'][_0x2fb4('0x11d')](db[_0x2fb4('0x8d')],{'as':_0x2fb4('0x8d'),'foreignKey':_0x2fb4('0x160')});db[_0x2fb4('0x3c')][_0x2fb4('0x11d')](db[_0x2fb4('0x14e')],{'as':_0x2fb4('0x161'),'foreignKey':_0x2fb4('0x162')});db[_0x2fb4('0x3c')][_0x2fb4('0x11e')](db[_0x2fb4('0x10c')],{'as':_0x2fb4('0x163'),'through':_0x2fb4('0x139')});db[_0x2fb4('0x3d')][_0x2fb4('0x11e')](db['User'],{'as':_0x2fb4('0x163'),'through':'UserMailQueue'});db[_0x2fb4('0x3d')][_0x2fb4('0x11e')](db[_0x2fb4('0x124')],{'through':_0x2fb4('0x164'),'as':_0x2fb4('0x165')});db[_0x2fb4('0x40')][_0x2fb4('0x112')](db['MailMessage'],{'as':'Messages','onDelete':_0x2fb4('0x10e'),'foreignKey':'MailInteractionId'});db['MailInteraction'][_0x2fb4('0x11d')](db[_0x2fb4('0x3c')],{'as':_0x2fb4('0x166'),'foreignKey':_0x2fb4('0x158')});db['MailInteraction'][_0x2fb4('0x11d')](db['CmContact'],{'as':_0x2fb4('0x156'),'foreignKey':_0x2fb4('0x157')});db[_0x2fb4('0x40')][_0x2fb4('0x11d')](db[_0x2fb4('0x10c')],{'as':_0x2fb4('0x167'),'foreignKey':'UserId'});db[_0x2fb4('0x40')][_0x2fb4('0x11e')](db[_0x2fb4('0x168')],{'through':'mail_interaction_has_tags','as':'Tags'});db[_0x2fb4('0x40')]['belongsToMany'](db[_0x2fb4('0x168')],{'through':_0x2fb4('0x169'),'as':_0x2fb4('0x16a')});db[_0x2fb4('0x40')][_0x2fb4('0x11e')](db[_0x2fb4('0x10c')],{'as':_0x2fb4('0x16b'),'through':_0x2fb4('0x16c'),'foreignKey':_0x2fb4('0x16d')});db[_0x2fb4('0x15e')][_0x2fb4('0x112')](db[_0x2fb4('0xe7')],{'as':_0x2fb4('0x16e'),'onDelete':_0x2fb4('0x10e')});db[_0x2fb4('0x15e')][_0x2fb4('0x11d')](db[_0x2fb4('0x10c')],{'as':'User'});db['MailMessage'][_0x2fb4('0x11d')](db[_0x2fb4('0x6d')],{'onDelete':'cascade','as':_0x2fb4('0x156')});db[_0x2fb4('0x15e')][_0x2fb4('0x11d')](db[_0x2fb4('0x40')],{'as':'Interaction','foreignKey':_0x2fb4('0x16d')});db[_0x2fb4('0x15e')][_0x2fb4('0x11d')](db[_0x2fb4('0x3c')],{'as':_0x2fb4('0x166'),'foreignKey':_0x2fb4('0x158')});db[_0x2fb4('0x15e')]['belongsTo'](db['ChatWebsite'],{'as':_0x2fb4('0x5d'),'foreignKey':_0x2fb4('0x16f')});db[_0x2fb4('0x15e')]['belongsTo'](db[_0x2fb4('0x170')],{'as':_0x2fb4('0x170'),'foreignKey':_0x2fb4('0x171')});db[_0x2fb4('0x172')][_0x2fb4('0x11d')](db['User'],{'onDelete':_0x2fb4('0x15a')});db[_0x2fb4('0x172')][_0x2fb4('0x11d')](db[_0x2fb4('0x3d')],{'onDelete':_0x2fb4('0x15a')});db[_0x2fb4('0x172')][_0x2fb4('0x11d')](db[_0x2fb4('0x3c')],{'onDelete':_0x2fb4('0x15a')});db[_0x2fb4('0x172')]['belongsTo'](db['Interval'],{'onDelete':_0x2fb4('0x15a'),'foreignKey':_0x2fb4('0x173')});db['MailApplication'][_0x2fb4('0x11d')](db[_0x2fb4('0x168')],{'onDelete':_0x2fb4('0x15a'),'foreignKey':'TagId'});db[_0x2fb4('0x43')][_0x2fb4('0x11d')](db[_0x2fb4('0x3c')],{});db['MailQueueReport'][_0x2fb4('0x11d')](db[_0x2fb4('0xf2')],{'as':_0x2fb4('0x15f'),'foreignKey':_0x2fb4('0x174')});db[_0x2fb4('0x43')][_0x2fb4('0x11d')](db[_0x2fb4('0x6d')],{'as':_0x2fb4('0x156'),'foreignKey':_0x2fb4('0x157')});db[_0x2fb4('0x43')][_0x2fb4('0x11d')](db['MailInteraction'],{});db[_0x2fb4('0x43')]['belongsTo'](db['MailMessage'],{});db['MailQueueReport']['belongsTo'](db[_0x2fb4('0x10c')],{});db[_0x2fb4('0x43')][_0x2fb4('0x11d')](db[_0x2fb4('0x3d')],{});db['Dashboard'][_0x2fb4('0x112')](db[_0x2fb4('0x47')],{'as':_0x2fb4('0x175'),'onDelete':'cascade'});db['FaxAccount'][_0x2fb4('0x112')](db['Disposition'],{'as':_0x2fb4('0x176'),'foreignKey':_0x2fb4('0x177'),'onDelete':_0x2fb4('0x10e')});db['FaxAccount'][_0x2fb4('0x112')](db[_0x2fb4('0x15c')],{'as':'Answers','foreignKey':_0x2fb4('0x177')});db[_0x2fb4('0x137')][_0x2fb4('0x112')](db['FaxInteraction'],{'as':_0x2fb4('0x178')});db['FaxAccount'][_0x2fb4('0x112')](db['FaxApplication'],{'as':'Applications'});db[_0x2fb4('0x137')][_0x2fb4('0x112')](db['VoiceExtension'],{'as':_0x2fb4('0x179'),'onDelete':_0x2fb4('0x10e')});db[_0x2fb4('0x137')][_0x2fb4('0x112')](db[_0x2fb4('0x4d')],{'as':'Messages'});db['FaxAccount']['belongsTo'](db[_0x2fb4('0x14b')],{'as':'Trunk'});db[_0x2fb4('0x137')][_0x2fb4('0x11d')](db[_0x2fb4('0xf2')],{'as':_0x2fb4('0x15f'),'foreignKey':'ListId'});db[_0x2fb4('0x137')][_0x2fb4('0x11d')](db['Pause'],{'as':_0x2fb4('0x161'),'foreignKey':_0x2fb4('0x162')});db[_0x2fb4('0x137')][_0x2fb4('0x11e')](db[_0x2fb4('0x10c')],{'as':_0x2fb4('0x163'),'through':_0x2fb4('0x138')});db['FaxApplication'][_0x2fb4('0x11d')](db[_0x2fb4('0x10c')],{'onDelete':_0x2fb4('0x15a')});db[_0x2fb4('0x49')][_0x2fb4('0x11d')](db['FaxQueue'],{'onDelete':_0x2fb4('0x15a')});db['FaxApplication'][_0x2fb4('0x11d')](db[_0x2fb4('0x137')],{'onDelete':_0x2fb4('0x15a')});db[_0x2fb4('0x49')]['belongsTo'](db['Tag'],{'onDelete':_0x2fb4('0x15a'),'foreignKey':_0x2fb4('0x17a')});db['FaxInteraction']['hasMany'](db['FaxMessage'],{'as':_0x2fb4('0x151'),'onDelete':'cascade','foreignKey':'FaxInteractionId'});db[_0x2fb4('0x4b')]['belongsTo'](db[_0x2fb4('0x137')],{'as':_0x2fb4('0x166'),'foreignKey':_0x2fb4('0x177')});db[_0x2fb4('0x4b')]['belongsTo'](db['CmContact'],{'as':_0x2fb4('0x156'),'foreignKey':_0x2fb4('0x157')});db[_0x2fb4('0x4b')][_0x2fb4('0x11d')](db[_0x2fb4('0x10c')],{'as':_0x2fb4('0x167'),'foreignKey':_0x2fb4('0x10f')});db[_0x2fb4('0x4b')][_0x2fb4('0x11e')](db[_0x2fb4('0x168')],{'through':_0x2fb4('0x17b'),'as':_0x2fb4('0x17c')});db['FaxInteraction']['belongsToMany'](db[_0x2fb4('0x168')],{'through':_0x2fb4('0x17b'),'as':'ThroughTags'});db[_0x2fb4('0x4b')][_0x2fb4('0x11e')](db[_0x2fb4('0x10c')],{'as':_0x2fb4('0x16b'),'through':_0x2fb4('0x17d'),'foreignKey':_0x2fb4('0x17e')});db[_0x2fb4('0x4d')][_0x2fb4('0x11d')](db['User'],{'onDelete':_0x2fb4('0x10e'),'as':_0x2fb4('0x10c')});db[_0x2fb4('0x4d')][_0x2fb4('0x11d')](db[_0x2fb4('0x4b')],{'as':_0x2fb4('0x17f'),'foreignKey':'FaxInteractionId'});db[_0x2fb4('0x4d')][_0x2fb4('0x11d')](db['CmContact'],{'onDelete':'cascade','as':_0x2fb4('0x156')});db['FaxMessage'][_0x2fb4('0x11d')](db[_0x2fb4('0xe7')],{'as':_0x2fb4('0xe7'),'foreignKey':_0x2fb4('0x180')});db['FaxMessage'][_0x2fb4('0x11d')](db[_0x2fb4('0x137')],{'as':_0x2fb4('0x166'),'foreignKey':'FaxAccountId'});db[_0x2fb4('0x4f')][_0x2fb4('0x11e')](db[_0x2fb4('0x10c')],{'as':_0x2fb4('0x163'),'through':_0x2fb4('0x131')});db[_0x2fb4('0x4f')][_0x2fb4('0x11e')](db[_0x2fb4('0x124')],{'through':_0x2fb4('0x181'),'as':_0x2fb4('0x165')});db[_0x2fb4('0x182')]['belongsTo'](db[_0x2fb4('0x137')],{});db['FaxQueueReport']['belongsTo'](db[_0x2fb4('0xf2')],{'as':_0x2fb4('0x15f'),'foreignKey':'ListId'});db[_0x2fb4('0x182')][_0x2fb4('0x11d')](db[_0x2fb4('0x6d')],{'as':_0x2fb4('0x156'),'foreignKey':_0x2fb4('0x157')});db[_0x2fb4('0x182')][_0x2fb4('0x11d')](db['FaxInteraction'],{});db[_0x2fb4('0x182')][_0x2fb4('0x11d')](db[_0x2fb4('0x4d')],{});db[_0x2fb4('0x182')][_0x2fb4('0x11d')](db['User'],{});db['FaxQueueReport'][_0x2fb4('0x11d')](db[_0x2fb4('0x4f')],{});db['SmsAccount'][_0x2fb4('0x112')](db[_0x2fb4('0x7d')],{'as':_0x2fb4('0x176'),'foreignKey':_0x2fb4('0x183'),'onDelete':_0x2fb4('0x10e')});db['SmsAccount'][_0x2fb4('0x112')](db[_0x2fb4('0x15c')],{'as':_0x2fb4('0x15d'),'foreignKey':_0x2fb4('0x183')});db[_0x2fb4('0x13c')][_0x2fb4('0x112')](db[_0x2fb4('0x52')],{'as':_0x2fb4('0x151'),'foreignKey':'SmsAccountId'});db[_0x2fb4('0x13c')]['hasMany'](db[_0x2fb4('0x51')],{'as':_0x2fb4('0x178')});db[_0x2fb4('0x13c')][_0x2fb4('0x112')](db[_0x2fb4('0x184')],{'as':_0x2fb4('0x143')});db[_0x2fb4('0x13c')]['belongsTo'](db[_0x2fb4('0xf2')],{'as':_0x2fb4('0x15f'),'foreignKey':_0x2fb4('0x174')});db[_0x2fb4('0x13c')][_0x2fb4('0x11d')](db['Pause'],{'as':_0x2fb4('0x161'),'foreignKey':_0x2fb4('0x162')});db[_0x2fb4('0x13c')][_0x2fb4('0x11e')](db[_0x2fb4('0x10c')],{'as':'Agents','through':'user_has_sms_accounts'});db[_0x2fb4('0x184')]['belongsTo'](db[_0x2fb4('0x10c')],{'onDelete':_0x2fb4('0x15a')});db['SmsApplication']['belongsTo'](db['SmsQueue'],{'onDelete':_0x2fb4('0x15a')});db['SmsApplication']['belongsTo'](db[_0x2fb4('0x13c')],{'onDelete':_0x2fb4('0x15a')});db[_0x2fb4('0x184')]['belongsTo'](db[_0x2fb4('0x80')],{'onDelete':_0x2fb4('0x15a'),'foreignKey':_0x2fb4('0x173')});db[_0x2fb4('0x184')]['belongsTo'](db[_0x2fb4('0x168')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x2fb4('0x51')][_0x2fb4('0x112')](db[_0x2fb4('0x52')],{'as':_0x2fb4('0x151'),'onDelete':'cascade','foreignKey':'SmsInteractionId'});db[_0x2fb4('0x51')][_0x2fb4('0x11d')](db[_0x2fb4('0x13c')],{'as':_0x2fb4('0x166'),'foreignKey':_0x2fb4('0x183')});db[_0x2fb4('0x51')][_0x2fb4('0x11d')](db[_0x2fb4('0x6d')],{'as':'Contact','foreignKey':_0x2fb4('0x157')});db[_0x2fb4('0x51')]['belongsTo'](db[_0x2fb4('0x10c')],{'as':'Owner','foreignKey':_0x2fb4('0x10f')});db[_0x2fb4('0x51')][_0x2fb4('0x11e')](db['Tag'],{'through':_0x2fb4('0x185'),'as':_0x2fb4('0x17c')});db['SmsInteraction'][_0x2fb4('0x11e')](db[_0x2fb4('0x168')],{'through':_0x2fb4('0x185'),'as':_0x2fb4('0x16a')});db['SmsInteraction'][_0x2fb4('0x11e')](db[_0x2fb4('0x10c')],{'as':_0x2fb4('0x16b'),'through':'user_has_sms_interactions','foreignKey':_0x2fb4('0x186')});db[_0x2fb4('0x52')][_0x2fb4('0x11d')](db[_0x2fb4('0x10c')],{'as':'User'});db[_0x2fb4('0x52')][_0x2fb4('0x11d')](db[_0x2fb4('0x6d')],{'onDelete':_0x2fb4('0x10e'),'as':_0x2fb4('0x156')});db[_0x2fb4('0x52')][_0x2fb4('0x11d')](db[_0x2fb4('0x51')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x2fb4('0x186')});db[_0x2fb4('0x52')][_0x2fb4('0x11d')](db[_0x2fb4('0x13c')],{'as':_0x2fb4('0x166'),'foreignKey':_0x2fb4('0x183')});db[_0x2fb4('0x54')][_0x2fb4('0x11e')](db[_0x2fb4('0x10c')],{'as':_0x2fb4('0x163'),'through':_0x2fb4('0x34'),'foreignKey':_0x2fb4('0x187')});db[_0x2fb4('0x54')]['belongsToMany'](db[_0x2fb4('0x124')],{'through':_0x2fb4('0x188'),'as':_0x2fb4('0x165')});db[_0x2fb4('0x56')][_0x2fb4('0x112')](db[_0x2fb4('0x7d')],{'as':_0x2fb4('0x176'),'foreignKey':'OpenchannelAccountId','onDelete':_0x2fb4('0x10e')});db[_0x2fb4('0x56')][_0x2fb4('0x112')](db[_0x2fb4('0x15c')],{'as':'Answers','foreignKey':_0x2fb4('0x189')});db[_0x2fb4('0x56')][_0x2fb4('0x112')](db[_0x2fb4('0x116')],{'as':'Interactions','foreignKey':_0x2fb4('0x189')});db[_0x2fb4('0x56')]['hasMany'](db[_0x2fb4('0x18a')],{'as':'Messages','foreignKey':_0x2fb4('0x189')});db['OpenchannelAccount'][_0x2fb4('0x112')](db[_0x2fb4('0x58')],{'as':'Applications','foreignKey':_0x2fb4('0x189')});db[_0x2fb4('0x56')][_0x2fb4('0x11d')](db[_0x2fb4('0xf2')],{'as':_0x2fb4('0x15f'),'foreignKey':_0x2fb4('0x174')});db[_0x2fb4('0x56')][_0x2fb4('0x11d')](db[_0x2fb4('0x14e')],{'as':_0x2fb4('0x161'),'foreignKey':_0x2fb4('0x162')});db[_0x2fb4('0x56')]['belongsToMany'](db[_0x2fb4('0x10c')],{'as':_0x2fb4('0x163'),'through':_0x2fb4('0x13b')});db[_0x2fb4('0x58')][_0x2fb4('0x11d')](db[_0x2fb4('0x10c')],{'onDelete':_0x2fb4('0x15a')});db[_0x2fb4('0x58')]['belongsTo'](db['OpenchannelQueue'],{'onDelete':_0x2fb4('0x15a'),'foreignKey':_0x2fb4('0x18b')});db[_0x2fb4('0x58')][_0x2fb4('0x11d')](db['OpenchannelAccount'],{'onDelete':_0x2fb4('0x15a'),'foreignKey':_0x2fb4('0x189')});db['OpenchannelApplication'][_0x2fb4('0x11d')](db[_0x2fb4('0x80')],{'onDelete':_0x2fb4('0x15a'),'foreignKey':_0x2fb4('0x173')});db[_0x2fb4('0x58')][_0x2fb4('0x11d')](db[_0x2fb4('0x168')],{'onDelete':'restrict','foreignKey':_0x2fb4('0x17a')});db['OpenchannelInteraction'][_0x2fb4('0x112')](db['OpenchannelMessage'],{'as':_0x2fb4('0x151'),'onDelete':_0x2fb4('0x10e'),'foreignKey':'OpenchannelInteractionId'});db[_0x2fb4('0x116')]['belongsTo'](db['OpenchannelAccount'],{'as':_0x2fb4('0x166'),'foreignKey':_0x2fb4('0x189')});db[_0x2fb4('0x116')][_0x2fb4('0x11d')](db[_0x2fb4('0x6d')],{'as':_0x2fb4('0x156'),'foreignKey':_0x2fb4('0x157')});db[_0x2fb4('0x116')]['belongsTo'](db[_0x2fb4('0x10c')],{'as':'Owner','foreignKey':_0x2fb4('0x10f')});db[_0x2fb4('0x116')][_0x2fb4('0x11e')](db[_0x2fb4('0x168')],{'through':_0x2fb4('0x18c'),'as':_0x2fb4('0x17c')});db[_0x2fb4('0x116')][_0x2fb4('0x11e')](db[_0x2fb4('0x168')],{'through':'openchannel_interaction_has_tags','as':_0x2fb4('0x16a')});db['OpenchannelInteraction'][_0x2fb4('0x11e')](db[_0x2fb4('0x10c')],{'as':_0x2fb4('0x16b'),'through':'user_has_openchannel_interactions','foreignKey':_0x2fb4('0x18d')});db[_0x2fb4('0x18a')][_0x2fb4('0x11d')](db[_0x2fb4('0x10c')],{'onDelete':_0x2fb4('0x10e'),'as':'User'});db['OpenchannelMessage'][_0x2fb4('0x11d')](db[_0x2fb4('0x6d')],{'onDelete':'cascade','as':_0x2fb4('0x156')});db[_0x2fb4('0x18a')][_0x2fb4('0x11d')](db[_0x2fb4('0x116')],{'onDelete':_0x2fb4('0x10e'),'as':'Interaction','foreignKey':_0x2fb4('0x18d')});db['OpenchannelMessage'][_0x2fb4('0x11d')](db[_0x2fb4('0xe7')],{'as':_0x2fb4('0xe7'),'foreignKey':_0x2fb4('0x180')});db['OpenchannelMessage'][_0x2fb4('0x11d')](db[_0x2fb4('0x56')],{'as':_0x2fb4('0x166'),'foreignKey':_0x2fb4('0x189')});db[_0x2fb4('0x133')][_0x2fb4('0x11e')](db['User'],{'as':'Agents','through':_0x2fb4('0x35'),'foreignKey':_0x2fb4('0x18b')});db['OpenchannelQueue'][_0x2fb4('0x11e')](db[_0x2fb4('0x124')],{'through':_0x2fb4('0x18e'),'as':_0x2fb4('0x165')});db['ChatWebsite']['hasMany'](db[_0x2fb4('0x7d')],{'as':_0x2fb4('0x176'),'foreignKey':_0x2fb4('0x16f'),'onDelete':_0x2fb4('0x10e')});db['ChatWebsite'][_0x2fb4('0x112')](db['CannedAnswer'],{'as':'Answers','foreignKey':'ChatWebsiteId'});db[_0x2fb4('0x5d')][_0x2fb4('0x112')](db['ChatProactiveAction'],{'as':_0x2fb4('0x18f')});db['ChatWebsite'][_0x2fb4('0x112')](db[_0x2fb4('0x61')],{'as':_0x2fb4('0x178')});db[_0x2fb4('0x5d')][_0x2fb4('0x112')](db[_0x2fb4('0x190')],{'as':_0x2fb4('0x143')});db[_0x2fb4('0x5d')][_0x2fb4('0x112')](db['ChatMessage'],{'as':_0x2fb4('0x151')});db['ChatWebsite'][_0x2fb4('0x11d')](db[_0x2fb4('0xf2')],{'as':_0x2fb4('0x15f'),'foreignKey':_0x2fb4('0x174')});db['ChatWebsite']['belongsTo'](db[_0x2fb4('0x80')],{'as':_0x2fb4('0x80'),'foreignKey':_0x2fb4('0x173')});db['ChatWebsite'][_0x2fb4('0x11d')](db[_0x2fb4('0x3c')],{'as':_0x2fb4('0x3c'),'foreignKey':'MailAccountId'});db[_0x2fb4('0x5d')][_0x2fb4('0x11d')](db['Pause'],{'as':_0x2fb4('0x161'),'foreignKey':_0x2fb4('0x162')});db[_0x2fb4('0x5d')][_0x2fb4('0x11e')](db['User'],{'as':_0x2fb4('0x163'),'through':_0x2fb4('0x191')});db[_0x2fb4('0x5f')]['belongsTo'](db['OpenchannelAccount'],{});db[_0x2fb4('0x5f')][_0x2fb4('0x11d')](db['CmList'],{'as':_0x2fb4('0x15f'),'foreignKey':_0x2fb4('0x174')});db[_0x2fb4('0x5f')][_0x2fb4('0x11d')](db[_0x2fb4('0x6d')],{'as':_0x2fb4('0x156'),'foreignKey':_0x2fb4('0x157')});db[_0x2fb4('0x5f')]['belongsTo'](db[_0x2fb4('0x116')],{});db['OpenchannelQueueReport'][_0x2fb4('0x11d')](db['OpenchannelMessage'],{});db[_0x2fb4('0x5f')][_0x2fb4('0x11d')](db[_0x2fb4('0x10c')],{});db[_0x2fb4('0x5f')][_0x2fb4('0x11d')](db['OpenchannelQueue'],{});db['ChatApplication'][_0x2fb4('0x11d')](db[_0x2fb4('0x10c')],{'as':_0x2fb4('0x192'),'foreignKey':_0x2fb4('0x10f'),'onDelete':'restrict'});db[_0x2fb4('0x190')][_0x2fb4('0x11d')](db[_0x2fb4('0x66')],{'as':_0x2fb4('0x193'),'foreignKey':_0x2fb4('0x194'),'onDelete':_0x2fb4('0x15a')});db[_0x2fb4('0x190')][_0x2fb4('0x11d')](db[_0x2fb4('0x5d')],{'as':_0x2fb4('0x195'),'foreignKey':'ChatWebsiteId','onDelete':_0x2fb4('0x15a')});db[_0x2fb4('0x190')][_0x2fb4('0x11d')](db[_0x2fb4('0x168')],{'onDelete':_0x2fb4('0x15a'),'foreignKey':_0x2fb4('0x17a')});db[_0x2fb4('0x61')]['hasMany'](db[_0x2fb4('0x63')],{'as':_0x2fb4('0x151'),'onDelete':_0x2fb4('0x10e'),'foreignKey':_0x2fb4('0x196')});db[_0x2fb4('0x61')]['belongsTo'](db[_0x2fb4('0x5d')],{'as':_0x2fb4('0x166'),'foreignKey':_0x2fb4('0x16f')});db['ChatInteraction']['belongsTo'](db[_0x2fb4('0x6d')],{'as':_0x2fb4('0x156'),'foreignKey':_0x2fb4('0x157')});db[_0x2fb4('0x61')][_0x2fb4('0x11d')](db['User'],{'as':_0x2fb4('0x167'),'foreignKey':'UserId'});db[_0x2fb4('0x61')][_0x2fb4('0x11e')](db[_0x2fb4('0x168')],{'through':_0x2fb4('0x197'),'as':_0x2fb4('0x17c')});db[_0x2fb4('0x61')]['belongsToMany'](db[_0x2fb4('0x168')],{'through':_0x2fb4('0x197'),'as':'ThroughTags'});db[_0x2fb4('0x61')][_0x2fb4('0x11e')](db['User'],{'as':_0x2fb4('0x16b'),'through':'user_has_chat_interactions','foreignKey':'ChatInteractionId'});db[_0x2fb4('0x63')]['belongsTo'](db[_0x2fb4('0x10c')],{'onDelete':'cascade','as':'User'});db[_0x2fb4('0x63')][_0x2fb4('0x11d')](db[_0x2fb4('0x6d')],{'onDelete':_0x2fb4('0x10e'),'as':_0x2fb4('0x156'),'foreignKey':_0x2fb4('0x157')});db[_0x2fb4('0x63')][_0x2fb4('0x11d')](db[_0x2fb4('0x61')],{'onDelete':_0x2fb4('0x10e'),'as':_0x2fb4('0x17f'),'foreignKey':_0x2fb4('0x196')});db[_0x2fb4('0x63')]['belongsTo'](db[_0x2fb4('0xe7')],{'as':_0x2fb4('0xe7'),'foreignKey':_0x2fb4('0x180')});db['ChatMessage'][_0x2fb4('0x11d')](db[_0x2fb4('0x5d')],{'as':_0x2fb4('0x166'),'foreignKey':_0x2fb4('0x16f')});db['ChatOfflineMessage']['hasMany'](db['Attachment'],{'as':_0x2fb4('0x16e'),'foreignKey':_0x2fb4('0x171'),'onDelete':_0x2fb4('0x10e'),'hooks':!![]});db[_0x2fb4('0x170')][_0x2fb4('0x11d')](db[_0x2fb4('0x6d')],{'onDelete':_0x2fb4('0x10e'),'as':'Contact','foreignKey':_0x2fb4('0x157')});db[_0x2fb4('0x170')][_0x2fb4('0x11d')](db[_0x2fb4('0x5d')],{'as':'Account','foreignKey':_0x2fb4('0x16f')});db['ChatQueue']['belongsToMany'](db[_0x2fb4('0x10c')],{'as':_0x2fb4('0x163'),'through':'UserChatQueue','hooks':!![]});db[_0x2fb4('0x66')]['belongsToMany'](db['Team'],{'through':'team_has_chat_queues','as':_0x2fb4('0x165')});db['ChatGroup'][_0x2fb4('0x112')](db['ChatInternalMessage'],{'as':_0x2fb4('0x151'),'foreignKey':_0x2fb4('0x198'),'onDelete':_0x2fb4('0x10e')});db[_0x2fb4('0x68')][_0x2fb4('0x11e')](db[_0x2fb4('0x10c')],{'as':_0x2fb4('0x199'),'through':_0x2fb4('0x120')});db[_0x2fb4('0x6a')][_0x2fb4('0x11d')](db[_0x2fb4('0x5d')],{'as':_0x2fb4('0x195'),'foreignKey':_0x2fb4('0x16f')});db[_0x2fb4('0x6b')][_0x2fb4('0x112')](db[_0x2fb4('0x6d')],{'as':'Contacts','foreignKey':_0x2fb4('0x19a')});db[_0x2fb4('0x6d')][_0x2fb4('0x112')](db[_0x2fb4('0x19b')],{'as':_0x2fb4('0x19c'),'foreignKey':_0x2fb4('0x19d')});db[_0x2fb4('0x6d')][_0x2fb4('0x112')](db[_0x2fb4('0x19e')],{'as':_0x2fb4('0x147'),'foreignKey':_0x2fb4('0x157')});db[_0x2fb4('0x6d')][_0x2fb4('0x112')](db[_0x2fb4('0x72')],{'as':_0x2fb4('0x115'),'foreignKey':_0x2fb4('0x157')});db[_0x2fb4('0x6d')][_0x2fb4('0x112')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':'ContactId'});db['CmContact'][_0x2fb4('0x112')](db[_0x2fb4('0x76')],{'as':_0x2fb4('0x76'),'foreignKey':_0x2fb4('0x157')});db[_0x2fb4('0x6d')][_0x2fb4('0x112')](db[_0x2fb4('0xd1')],{'as':_0x2fb4('0x14a'),'foreignKey':_0x2fb4('0x157')});db[_0x2fb4('0x6d')][_0x2fb4('0x112')](db['OpenchannelInteraction'],{'as':_0x2fb4('0x117'),'foreignKey':_0x2fb4('0x157'),'onDelete':'restrict'});db[_0x2fb4('0x6d')][_0x2fb4('0x112')](db[_0x2fb4('0x61')],{'as':_0x2fb4('0x118'),'foreignKey':_0x2fb4('0x157'),'onDelete':'restrict'});db['CmContact'][_0x2fb4('0x112')](db['SmsInteraction'],{'as':_0x2fb4('0x119'),'foreignKey':'ContactId','onDelete':_0x2fb4('0x15a')});db['CmContact'][_0x2fb4('0x112')](db[_0x2fb4('0x4b')],{'as':_0x2fb4('0x11a'),'foreignKey':_0x2fb4('0x157'),'onDelete':_0x2fb4('0x15a')});db['CmContact']['hasMany'](db['MailInteraction'],{'as':'MailInteractions','foreignKey':'ContactId','onDelete':'restrict'});db[_0x2fb4('0x6d')][_0x2fb4('0x11d')](db[_0x2fb4('0x6b')],{'as':'Company','foreignKey':_0x2fb4('0x19a')});db[_0x2fb4('0x6d')]['belongsTo'](db[_0x2fb4('0xf2')],{'as':'List','foreignKey':_0x2fb4('0x174'),'onDelete':_0x2fb4('0x10e')});db[_0x2fb4('0x6d')]['belongsToMany'](db[_0x2fb4('0x10c')],{'as':_0x2fb4('0x16b'),'through':_0x2fb4('0x19f')});db['CmContact'][_0x2fb4('0x11e')](db[_0x2fb4('0x168')],{'as':_0x2fb4('0x17c'),'through':_0x2fb4('0x1a0')});db[_0x2fb4('0x6d')][_0x2fb4('0x11e')](db[_0x2fb4('0x168')],{'through':_0x2fb4('0x1a0'),'as':_0x2fb4('0x16a')});db[_0x2fb4('0x19e')][_0x2fb4('0x112')](db[_0x2fb4('0x8b')],{'as':'AdditionalPhones','foreignKey':_0x2fb4('0x1a1')});db['CmHopper'][_0x2fb4('0x11d')](db[_0x2fb4('0x6d')],{'as':_0x2fb4('0x156'),'foreignKey':_0x2fb4('0x157'),'onDelete':'cascade'});db['CmHopper'][_0x2fb4('0x11d')](db[_0x2fb4('0xf2')],{'as':_0x2fb4('0x15f'),'foreignKey':_0x2fb4('0x174'),'onDelete':_0x2fb4('0x10e')});db[_0x2fb4('0x19e')]['belongsTo'](db[_0x2fb4('0x10c')],{'as':_0x2fb4('0x192'),'foreignKey':'UserId'});db[_0x2fb4('0x19e')][_0x2fb4('0x11d')](db['VoiceQueue'],{'as':_0x2fb4('0x193'),'foreignKey':_0x2fb4('0x146'),'onDelete':_0x2fb4('0x10e')});db['CmHopper']['belongsTo'](db[_0x2fb4('0x1a2')],{'as':_0x2fb4('0x1a2'),'foreignKey':_0x2fb4('0x1a3'),'onDelete':_0x2fb4('0x10e')});db[_0x2fb4('0x19e')][_0x2fb4('0x11d')](db[_0x2fb4('0x10c')],{'as':_0x2fb4('0x167'),'foreignKey':'OwnerId'});db[_0x2fb4('0x70')][_0x2fb4('0x11d')](db[_0x2fb4('0x6d')],{'as':'Contact','foreignKey':_0x2fb4('0x157'),'onDelete':_0x2fb4('0x10e')});db[_0x2fb4('0x70')][_0x2fb4('0x11d')](db[_0x2fb4('0xf2')],{'as':_0x2fb4('0x15f'),'foreignKey':'ListId','onDelete':'cascade'});db['CmHopperBlack'][_0x2fb4('0x11d')](db[_0x2fb4('0x12a')],{'as':_0x2fb4('0x193'),'foreignKey':_0x2fb4('0x146'),'onDelete':_0x2fb4('0x10e')});db['CmHopperBlack'][_0x2fb4('0x11d')](db[_0x2fb4('0x1a2')],{'as':_0x2fb4('0x1a2'),'foreignKey':_0x2fb4('0x1a3'),'onDelete':'cascade'});db[_0x2fb4('0x1a4')][_0x2fb4('0x112')](db['Condition'],{'as':{'plural':_0x2fb4('0x1a5'),'singular':_0x2fb4('0x1a6')},'foreignKey':'AutomationAllId','onDelete':_0x2fb4('0x10e'),'hooks':!![]});db[_0x2fb4('0x1a4')]['hasMany'](db[_0x2fb4('0x1a7')],{'as':{'plural':_0x2fb4('0x1a8'),'singular':_0x2fb4('0x1a9')},'foreignKey':_0x2fb4('0x1aa'),'onDelete':_0x2fb4('0x10e'),'hooks':!![]});db['Automation'][_0x2fb4('0x112')](db[_0x2fb4('0x79')],{'as':_0x2fb4('0x1ab'),'foreignKey':_0x2fb4('0x1ac'),'onDelete':_0x2fb4('0x10e'),'hooks':!![]});db[_0x2fb4('0x7d')][_0x2fb4('0x112')](db[_0x2fb4('0x7d')],{'as':_0x2fb4('0x176'),'foreignKey':_0x2fb4('0x1ad'),'onDelete':_0x2fb4('0x10e')});db[_0x2fb4('0x80')]['hasMany'](db['Interval'],{'as':_0x2fb4('0x1ae'),'foreignKey':_0x2fb4('0x173'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0x2fb4('0x80')][_0x2fb4('0x112')](db[_0x2fb4('0x15')],{'as':_0x2fb4('0x114'),'foreignKey':_0x2fb4('0x173'),'onDelete':_0x2fb4('0x15a')});db[_0x2fb4('0x80')][_0x2fb4('0x112')](db[_0x2fb4('0x172')],{'as':_0x2fb4('0x1af'),'foreignKey':_0x2fb4('0x173')});db[_0x2fb4('0x80')][_0x2fb4('0x112')](db[_0x2fb4('0x190')],{'as':_0x2fb4('0x1b0'),'foreignKey':_0x2fb4('0x173')});db[_0x2fb4('0x80')][_0x2fb4('0x112')](db[_0x2fb4('0x49')],{'as':_0x2fb4('0x1b1'),'foreignKey':_0x2fb4('0x173')});db[_0x2fb4('0x80')][_0x2fb4('0x112')](db[_0x2fb4('0x184')],{'as':_0x2fb4('0x1b2'),'foreignKey':_0x2fb4('0x173')});db[_0x2fb4('0x85')]['belongsTo'](db[_0x2fb4('0x3c')],{});db[_0x2fb4('0x85')][_0x2fb4('0x11d')](db[_0x2fb4('0x95')],{'foreignKey':_0x2fb4('0x1b3')});db[_0x2fb4('0x85')]['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x2fb4('0x1b4')});db[_0x2fb4('0x87')][_0x2fb4('0x11e')](db[_0x2fb4('0x17')],{'as':_0x2fb4('0x1b5'),'through':'moh_has_sounds','onDelete':_0x2fb4('0x15a')});db[_0x2fb4('0x168')][_0x2fb4('0x11e')](db[_0x2fb4('0x6d')],{'through':_0x2fb4('0x1a0')});db[_0x2fb4('0x168')]['belongsToMany'](db[_0x2fb4('0x61')],{'through':'chat_interaction_has_tags'});db[_0x2fb4('0x168')][_0x2fb4('0x11e')](db[_0x2fb4('0x40')],{'through':_0x2fb4('0x169')});db['Tag'][_0x2fb4('0x11e')](db[_0x2fb4('0x51')],{'through':'sms_interaction_has_tags'});db[_0x2fb4('0x168')]['belongsToMany'](db[_0x2fb4('0x4b')],{'through':'fax_interaction_has_tags'});db[_0x2fb4('0x168')]['belongsToMany'](db[_0x2fb4('0x116')],{'through':_0x2fb4('0x18c')});db[_0x2fb4('0x168')][_0x2fb4('0x11e')](db[_0x2fb4('0xfe')],{'through':_0x2fb4('0x1b6')});db['CmContactHasItem']['belongsTo'](db[_0x2fb4('0x89')],{'as':_0x2fb4('0x1b7'),'foreignKey':_0x2fb4('0x1b8')});db['CmHopperAdditionalPhone'][_0x2fb4('0x11d')](db[_0x2fb4('0x19e')],{'as':_0x2fb4('0x1b9'),'foreignKey':_0x2fb4('0x1a1')});db[_0x2fb4('0x19b')]['belongsTo'](db[_0x2fb4('0x6d')],{'as':_0x2fb4('0x156'),'foreignKey':'CmContactId'});db[_0x2fb4('0x8f')][_0x2fb4('0x112')](db[_0x2fb4('0x1a7')],{'as':{'plural':'AllConditions','singular':'AllCondition'},'foreignKey':'TriggerAllId','onDelete':_0x2fb4('0x10e'),'hooks':!![]});db[_0x2fb4('0x8f')][_0x2fb4('0x112')](db[_0x2fb4('0x1a7')],{'as':{'plural':_0x2fb4('0x1ba'),'singular':_0x2fb4('0x1bb')},'foreignKey':_0x2fb4('0x1bc'),'onDelete':_0x2fb4('0x10e'),'hooks':!![]});db[_0x2fb4('0x8f')]['hasMany'](db[_0x2fb4('0x79')],{'as':'Actions','foreignKey':_0x2fb4('0x1bd'),'onDelete':_0x2fb4('0x10e'),'hooks':!![]});db['AnalyticCustomReport'][_0x2fb4('0x112')](db[_0x2fb4('0x98')],{'as':_0x2fb4('0x1be'),'onDelete':_0x2fb4('0x10e'),'foreignKey':_0x2fb4('0x1b4'),'hooks':!![]});db[_0x2fb4('0x95')]['hasMany'](db[_0x2fb4('0x98')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x2fb4('0x1b3')});db[_0x2fb4('0x97')]['hasMany'](db[_0x2fb4('0x98')],{'as':_0x2fb4('0x1be'),'onDelete':_0x2fb4('0x10e'),'foreignKey':_0x2fb4('0x1bf')});db[_0x2fb4('0x98')][_0x2fb4('0x11d')](db['AnalyticMetric'],{'foreignKey':'MetricId'});db[_0x2fb4('0x9b')][_0x2fb4('0x112')](db['SalesforceConfiguration'],{'as':_0x2fb4('0x1c0'),'onDelete':_0x2fb4('0x10e'),'foreignKey':_0x2fb4('0x1c1')});db[_0x2fb4('0x9d')][_0x2fb4('0x112')](db[_0x2fb4('0x1c2')],{'as':_0x2fb4('0x1c3'),'onDelete':_0x2fb4('0x10e'),'foreignKey':'SubjectId'});db['SalesforceConfiguration'][_0x2fb4('0x112')](db[_0x2fb4('0x1c2')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x2fb4('0x1c4')});db['SalesforceConfiguration'][_0x2fb4('0x112')](db[_0x2fb4('0x1c2')],{'as':_0x2fb4('0x1be'),'onDelete':_0x2fb4('0x10e'),'foreignKey':_0x2fb4('0x1c5')});db['SalesforceConfiguration'][_0x2fb4('0x11d')](db[_0x2fb4('0x9b')],{'as':_0x2fb4('0x166'),'foreignKey':_0x2fb4('0x1c1')});db[_0x2fb4('0x1c2')][_0x2fb4('0x112')](db[_0x2fb4('0x1c2')],{'as':_0x2fb4('0x1c6'),'foreignKey':_0x2fb4('0x1c7')});db[_0x2fb4('0x1c2')]['hasMany'](db[_0x2fb4('0x1c2')],{'as':_0x2fb4('0x1c8'),'foreignKey':'DescriptionId'});db[_0x2fb4('0x1c2')]['hasMany'](db[_0x2fb4('0x1c2')],{'as':'Field','foreignKey':'FieldId'});db[_0x2fb4('0x1c2')][_0x2fb4('0x11d')](db[_0x2fb4('0x91')],{'as':_0x2fb4('0x91'),'foreignKey':_0x2fb4('0x1c9')});db[_0x2fb4('0xa0')][_0x2fb4('0x112')](db[_0x2fb4('0xa2')],{'as':'Configurations','onDelete':_0x2fb4('0x10e'),'foreignKey':_0x2fb4('0x1c1')});db['SugarcrmConfiguration'][_0x2fb4('0x112')](db[_0x2fb4('0xa4')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x2fb4('0xa2')][_0x2fb4('0x112')](db['SugarcrmField'],{'as':_0x2fb4('0x1ca'),'onDelete':_0x2fb4('0x10e'),'foreignKey':_0x2fb4('0x1c4')});db[_0x2fb4('0xa2')][_0x2fb4('0x112')](db[_0x2fb4('0xa4')],{'as':_0x2fb4('0x1be'),'onDelete':_0x2fb4('0x10e'),'foreignKey':_0x2fb4('0x1c5')});db['SugarcrmConfiguration'][_0x2fb4('0x11d')](db[_0x2fb4('0xa0')],{'as':_0x2fb4('0x166'),'foreignKey':_0x2fb4('0x1c1')});db[_0x2fb4('0xa4')][_0x2fb4('0x112')](db['SugarcrmField'],{'as':_0x2fb4('0x1c6'),'foreignKey':_0x2fb4('0x1c7')});db['SugarcrmField'][_0x2fb4('0x112')](db[_0x2fb4('0xa4')],{'as':_0x2fb4('0x1c8'),'foreignKey':_0x2fb4('0x1c4')});db[_0x2fb4('0xa4')]['hasMany'](db[_0x2fb4('0xa4')],{'as':_0x2fb4('0x1cb'),'foreignKey':'FieldId'});db[_0x2fb4('0xa4')][_0x2fb4('0x11d')](db[_0x2fb4('0x91')],{'as':_0x2fb4('0x91'),'foreignKey':'VariableId'});db[_0x2fb4('0xa6')][_0x2fb4('0x112')](db[_0x2fb4('0xa8')],{'as':'Configurations','onDelete':_0x2fb4('0x10e'),'foreignKey':_0x2fb4('0x1c1')});db['DeskConfiguration']['hasMany'](db[_0x2fb4('0x1cc')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x2fb4('0x1c7')});db['DeskConfiguration'][_0x2fb4('0x112')](db[_0x2fb4('0x1cc')],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db['DeskConfiguration'][_0x2fb4('0x112')](db['DeskField'],{'as':_0x2fb4('0x1be'),'onDelete':_0x2fb4('0x10e'),'foreignKey':_0x2fb4('0x1c5')});db[_0x2fb4('0xa8')][_0x2fb4('0x11d')](db[_0x2fb4('0xa6')],{'as':_0x2fb4('0x166'),'foreignKey':_0x2fb4('0x1c1')});db[_0x2fb4('0xa8')][_0x2fb4('0x11e')](db[_0x2fb4('0x168')],{'through':_0x2fb4('0x1cd')});db['DeskField'][_0x2fb4('0x112')](db[_0x2fb4('0x1cc')],{'as':_0x2fb4('0x1c6'),'foreignKey':'SubjectId'});db[_0x2fb4('0x1cc')][_0x2fb4('0x112')](db[_0x2fb4('0x1cc')],{'as':_0x2fb4('0x1c8'),'foreignKey':_0x2fb4('0x1c4')});db[_0x2fb4('0x1cc')]['hasMany'](db[_0x2fb4('0x1cc')],{'as':_0x2fb4('0x1cb'),'foreignKey':_0x2fb4('0x1c5')});db[_0x2fb4('0x1cc')][_0x2fb4('0x11d')](db[_0x2fb4('0x91')],{'as':_0x2fb4('0x91'),'foreignKey':_0x2fb4('0x1c9')});db[_0x2fb4('0xaa')][_0x2fb4('0x112')](db[_0x2fb4('0xac')],{'as':_0x2fb4('0x1c0'),'onDelete':'cascade','foreignKey':_0x2fb4('0x1c1')});db['ZohoConfiguration'][_0x2fb4('0x112')](db['ZohoField'],{'as':_0x2fb4('0x1c3'),'onDelete':'cascade','foreignKey':_0x2fb4('0x1c7')});db['ZohoConfiguration']['hasMany'](db[_0x2fb4('0x1ce')],{'as':_0x2fb4('0x1ca'),'onDelete':_0x2fb4('0x10e'),'foreignKey':_0x2fb4('0x1c4')});db[_0x2fb4('0xac')]['hasMany'](db['ZohoField'],{'as':_0x2fb4('0x1be'),'onDelete':_0x2fb4('0x10e'),'foreignKey':_0x2fb4('0x1c5')});db[_0x2fb4('0xac')][_0x2fb4('0x11d')](db[_0x2fb4('0xaa')],{'as':'Account','foreignKey':'AccountId'});db[_0x2fb4('0x1ce')][_0x2fb4('0x112')](db[_0x2fb4('0x1ce')],{'as':_0x2fb4('0x1c6'),'foreignKey':_0x2fb4('0x1c7')});db[_0x2fb4('0x1ce')]['hasMany'](db[_0x2fb4('0x1ce')],{'as':_0x2fb4('0x1c8'),'foreignKey':_0x2fb4('0x1c4')});db[_0x2fb4('0x1ce')]['hasMany'](db[_0x2fb4('0x1ce')],{'as':_0x2fb4('0x1cb'),'foreignKey':_0x2fb4('0x1c5')});db[_0x2fb4('0x1ce')]['belongsTo'](db['Variable'],{'as':_0x2fb4('0x91'),'foreignKey':_0x2fb4('0x1c9')});db[_0x2fb4('0x1cf')][_0x2fb4('0x112')](db[_0x2fb4('0xaf')],{'as':_0x2fb4('0x1c0'),'onDelete':_0x2fb4('0x10e'),'foreignKey':'AccountId'});db[_0x2fb4('0xaf')][_0x2fb4('0x112')](db[_0x2fb4('0xb1')],{'as':_0x2fb4('0x1c3'),'foreignKey':_0x2fb4('0x1c7')});db[_0x2fb4('0xaf')][_0x2fb4('0x112')](db[_0x2fb4('0xb1')],{'as':_0x2fb4('0x1ca'),'foreignKey':_0x2fb4('0x1c4')});db[_0x2fb4('0xaf')]['hasMany'](db[_0x2fb4('0xb1')],{'as':_0x2fb4('0x1be'),'foreignKey':'FieldId'});db[_0x2fb4('0xaf')]['belongsTo'](db[_0x2fb4('0x1cf')],{'as':_0x2fb4('0x166'),'foreignKey':_0x2fb4('0x1c1')});db[_0x2fb4('0xaf')][_0x2fb4('0x11e')](db[_0x2fb4('0x168')],{'through':_0x2fb4('0x1d0')});db[_0x2fb4('0xb1')][_0x2fb4('0x112')](db[_0x2fb4('0xb1')],{'as':_0x2fb4('0x1c6'),'foreignKey':_0x2fb4('0x1c7')});db[_0x2fb4('0xb1')][_0x2fb4('0x112')](db[_0x2fb4('0xb1')],{'as':_0x2fb4('0x1c8'),'foreignKey':_0x2fb4('0x1c4')});db[_0x2fb4('0xb1')][_0x2fb4('0x112')](db[_0x2fb4('0xb1')],{'as':'Field','foreignKey':'FieldId'});db[_0x2fb4('0xb1')][_0x2fb4('0x11d')](db['Variable'],{'as':_0x2fb4('0x91'),'foreignKey':'VariableId'});db[_0x2fb4('0x1d1')][_0x2fb4('0x112')](db[_0x2fb4('0x1d2')],{'as':_0x2fb4('0x1c0'),'onDelete':_0x2fb4('0x10e'),'foreignKey':'AccountId'});db[_0x2fb4('0x1d2')][_0x2fb4('0x112')](db[_0x2fb4('0xb4')],{'as':_0x2fb4('0x1c3'),'onDelete':_0x2fb4('0x10e'),'foreignKey':_0x2fb4('0x1c7')});db[_0x2fb4('0x1d2')][_0x2fb4('0x112')](db[_0x2fb4('0xb4')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x2fb4('0x1c4')});db[_0x2fb4('0x1d2')]['hasMany'](db[_0x2fb4('0xb4')],{'as':_0x2fb4('0x1be'),'onDelete':'cascade','foreignKey':_0x2fb4('0x1c5')});db[_0x2fb4('0x1d2')][_0x2fb4('0x11d')](db[_0x2fb4('0x1d1')],{'as':_0x2fb4('0x166'),'foreignKey':_0x2fb4('0x1c1')});db[_0x2fb4('0x1d2')][_0x2fb4('0x11e')](db[_0x2fb4('0x168')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x2fb4('0xb4')][_0x2fb4('0x112')](db[_0x2fb4('0xb4')],{'as':_0x2fb4('0x1c6'),'foreignKey':_0x2fb4('0x1c7')});db['FreshdeskField'][_0x2fb4('0x112')](db[_0x2fb4('0xb4')],{'as':_0x2fb4('0x1c8'),'foreignKey':_0x2fb4('0x1c4')});db[_0x2fb4('0xb4')][_0x2fb4('0x112')](db[_0x2fb4('0xb4')],{'as':'Field','foreignKey':_0x2fb4('0x1c5')});db['FreshdeskField'][_0x2fb4('0x11d')](db[_0x2fb4('0x91')],{'as':_0x2fb4('0x91'),'foreignKey':'VariableId'});db[_0x2fb4('0xb5')][_0x2fb4('0x112')](db[_0x2fb4('0xb7')],{'as':_0x2fb4('0x1c0'),'onDelete':_0x2fb4('0x10e'),'foreignKey':_0x2fb4('0x1c1')});db[_0x2fb4('0xb7')][_0x2fb4('0x112')](db[_0x2fb4('0x1d3')],{'as':_0x2fb4('0x1c3'),'foreignKey':_0x2fb4('0x1c7')});db[_0x2fb4('0xb7')][_0x2fb4('0x112')](db[_0x2fb4('0x1d3')],{'as':'Descriptions','foreignKey':_0x2fb4('0x1c4')});db[_0x2fb4('0xb7')]['hasMany'](db['VtigerField'],{'as':_0x2fb4('0x1be'),'foreignKey':'FieldId'});db[_0x2fb4('0xb7')][_0x2fb4('0x11d')](db['VtigerAccount'],{'as':_0x2fb4('0x166'),'foreignKey':_0x2fb4('0x1c1')});db[_0x2fb4('0x1d3')][_0x2fb4('0x112')](db[_0x2fb4('0x1d3')],{'as':_0x2fb4('0x1c6'),'foreignKey':_0x2fb4('0x1c7')});db[_0x2fb4('0x1d3')][_0x2fb4('0x112')](db[_0x2fb4('0x1d3')],{'as':'Description','foreignKey':_0x2fb4('0x1c4')});db['VtigerField'][_0x2fb4('0x112')](db[_0x2fb4('0x1d3')],{'as':_0x2fb4('0x1cb'),'foreignKey':'FieldId'});db[_0x2fb4('0x1d3')][_0x2fb4('0x11d')](db['Variable'],{'as':_0x2fb4('0x91'),'foreignKey':_0x2fb4('0x1c9')});db[_0x2fb4('0xb9')][_0x2fb4('0x112')](db[_0x2fb4('0xbb')],{'as':'Configurations','onDelete':_0x2fb4('0x10e'),'foreignKey':'AccountId'});db[_0x2fb4('0xbb')][_0x2fb4('0x112')](db['ServicenowField'],{'as':_0x2fb4('0x1c3'),'foreignKey':'SubjectId'});db[_0x2fb4('0xbb')][_0x2fb4('0x112')](db[_0x2fb4('0x1d4')],{'as':_0x2fb4('0x1ca'),'foreignKey':_0x2fb4('0x1c4')});db[_0x2fb4('0xbb')][_0x2fb4('0x112')](db[_0x2fb4('0x1d4')],{'as':'Fields','foreignKey':_0x2fb4('0x1c5')});db[_0x2fb4('0xbb')][_0x2fb4('0x11d')](db[_0x2fb4('0xb9')],{'as':_0x2fb4('0x166'),'foreignKey':_0x2fb4('0x1c1')});db[_0x2fb4('0x1d4')][_0x2fb4('0x112')](db[_0x2fb4('0x1d4')],{'as':_0x2fb4('0x1c6'),'foreignKey':_0x2fb4('0x1c7')});db[_0x2fb4('0x1d4')][_0x2fb4('0x112')](db[_0x2fb4('0x1d4')],{'as':_0x2fb4('0x1c8'),'foreignKey':_0x2fb4('0x1c4')});db[_0x2fb4('0x1d4')][_0x2fb4('0x112')](db[_0x2fb4('0x1d4')],{'as':'Field','foreignKey':'FieldId'});db[_0x2fb4('0x1d4')][_0x2fb4('0x11d')](db[_0x2fb4('0x91')],{'as':_0x2fb4('0x91'),'foreignKey':'VariableId'});db[_0x2fb4('0xbe')]['hasMany'](db[_0x2fb4('0xc0')],{'as':_0x2fb4('0x1c0'),'onDelete':'cascade','foreignKey':_0x2fb4('0x1c1')});db[_0x2fb4('0xbe')]['belongsTo'](db[_0x2fb4('0x106')],{'as':_0x2fb4('0x106'),'foreignKey':_0x2fb4('0x159')});db[_0x2fb4('0xc0')][_0x2fb4('0x112')](db['Dynamics365Field'],{'as':'Subjects','onDelete':_0x2fb4('0x10e'),'foreignKey':'SubjectId'});db['Dynamics365Configuration']['hasMany'](db['Dynamics365Field'],{'as':_0x2fb4('0x1ca'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x2fb4('0xc0')][_0x2fb4('0x112')](db[_0x2fb4('0xc2')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x2fb4('0x1c5')});db[_0x2fb4('0xc0')][_0x2fb4('0x11d')](db[_0x2fb4('0xbe')],{'as':'Account','foreignKey':_0x2fb4('0x1c1')});db[_0x2fb4('0xc2')]['hasMany'](db[_0x2fb4('0xc2')],{'as':_0x2fb4('0x1c6'),'foreignKey':_0x2fb4('0x1c7')});db[_0x2fb4('0xc2')][_0x2fb4('0x112')](db[_0x2fb4('0xc2')],{'as':_0x2fb4('0x1c8'),'foreignKey':_0x2fb4('0x1c4')});db[_0x2fb4('0xc2')][_0x2fb4('0x112')](db[_0x2fb4('0xc2')],{'as':_0x2fb4('0x1cb'),'foreignKey':_0x2fb4('0x1c5')});db[_0x2fb4('0xc2')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0x2fb4('0x1c9')});db[_0x2fb4('0x1d5')][_0x2fb4('0x112')](db['FreshsalesConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db['FreshsalesConfiguration'][_0x2fb4('0x112')](db['FreshsalesField'],{'as':_0x2fb4('0x1c3'),'foreignKey':_0x2fb4('0x1c7')});db[_0x2fb4('0xc5')]['hasMany'](db[_0x2fb4('0xc6')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x2fb4('0xc5')][_0x2fb4('0x112')](db[_0x2fb4('0xc6')],{'as':_0x2fb4('0x1be'),'foreignKey':_0x2fb4('0x1c5')});db[_0x2fb4('0xc5')]['belongsTo'](db[_0x2fb4('0x1d5')],{'as':_0x2fb4('0x166'),'foreignKey':_0x2fb4('0x1c1')});db[_0x2fb4('0xc6')]['hasMany'](db[_0x2fb4('0xc6')],{'as':_0x2fb4('0x1c6'),'foreignKey':_0x2fb4('0x1c7')});db[_0x2fb4('0xc6')][_0x2fb4('0x112')](db['FreshsalesField'],{'as':_0x2fb4('0x1c8'),'foreignKey':_0x2fb4('0x1c4')});db['FreshsalesField'][_0x2fb4('0x112')](db[_0x2fb4('0xc6')],{'as':'Field','foreignKey':_0x2fb4('0x1c5')});db[_0x2fb4('0xc6')][_0x2fb4('0x11d')](db[_0x2fb4('0x91')],{'as':_0x2fb4('0x91'),'foreignKey':_0x2fb4('0x1c9')});db[_0x2fb4('0xcb')]['belongsTo'](db[_0x2fb4('0x5d')],{});db['ChatQueueReport'][_0x2fb4('0x11d')](db[_0x2fb4('0xf2')],{'as':'List','foreignKey':_0x2fb4('0x174')});db[_0x2fb4('0xcb')][_0x2fb4('0x11d')](db[_0x2fb4('0x6d')],{'as':_0x2fb4('0x156'),'foreignKey':_0x2fb4('0x157')});db[_0x2fb4('0xcb')][_0x2fb4('0x11d')](db[_0x2fb4('0x61')],{});db['ChatQueueReport'][_0x2fb4('0x11d')](db[_0x2fb4('0x63')],{});db['ChatQueueReport'][_0x2fb4('0x11d')](db['User'],{});db[_0x2fb4('0xcb')][_0x2fb4('0x11d')](db[_0x2fb4('0x66')],{});db[_0x2fb4('0xcd')]['belongsTo'](db['User'],{'onDelete':'cascade','foreignKey':_0x2fb4('0x1d6')});db[_0x2fb4('0xcd')][_0x2fb4('0x11d')](db[_0x2fb4('0x10c')],{'onDelete':_0x2fb4('0x10e'),'foreignKey':_0x2fb4('0x1d7')});db[_0x2fb4('0xd1')][_0x2fb4('0x112')](db['JscriptyQuestionReport'],{'foreignKey':_0x2fb4('0x1d8'),'onDelete':_0x2fb4('0x10e')});db[_0x2fb4('0xd1')][_0x2fb4('0x112')](db[_0x2fb4('0xce')],{'foreignKey':_0x2fb4('0x1d8'),'onDelete':'cascade'});db[_0x2fb4('0x1d9')][_0x2fb4('0x11d')](db[_0x2fb4('0x13c')],{});db[_0x2fb4('0x1d9')][_0x2fb4('0x11d')](db[_0x2fb4('0xf2')],{'as':_0x2fb4('0x15f'),'foreignKey':_0x2fb4('0x174')});db[_0x2fb4('0x1d9')]['belongsTo'](db[_0x2fb4('0x6d')],{'as':_0x2fb4('0x156'),'foreignKey':_0x2fb4('0x157')});db['SmsQueueReport'][_0x2fb4('0x11d')](db['SmsInteraction'],{});db[_0x2fb4('0x1d9')]['belongsTo'](db[_0x2fb4('0x52')],{});db[_0x2fb4('0x1d9')][_0x2fb4('0x11d')](db[_0x2fb4('0x10c')],{});db['SmsQueueReport'][_0x2fb4('0x11d')](db['SmsQueue'],{});db[_0x2fb4('0x1da')][_0x2fb4('0x112')](db['JscriptySessionReport'],{'foreignKey':_0x2fb4('0x1db')});db[_0x2fb4('0x1da')][_0x2fb4('0x112')](db['JscriptyQuestionReport'],{'foreignKey':_0x2fb4('0x1db')});db['JscriptyProject'][_0x2fb4('0x112')](db[_0x2fb4('0xce')],{'foreignKey':_0x2fb4('0x1db')});db[_0x2fb4('0x124')][_0x2fb4('0x11e')](db[_0x2fb4('0x10c')],{'as':_0x2fb4('0x163'),'through':_0x2fb4('0x125')});db['Team'][_0x2fb4('0x11e')](db[_0x2fb4('0x12a')],{'through':_0x2fb4('0x108'),'as':_0x2fb4('0x12b')});db['Team'][_0x2fb4('0x11e')](db['MailQueue'],{'through':_0x2fb4('0x164'),'as':_0x2fb4('0x1dc')});db['Team']['belongsToMany'](db[_0x2fb4('0x66')],{'through':'team_has_chat_queues','as':_0x2fb4('0x12f')});db[_0x2fb4('0x124')]['belongsToMany'](db[_0x2fb4('0x4f')],{'through':'team_has_fax_queues','as':'FaxQueues'});db['Team'][_0x2fb4('0x11e')](db[_0x2fb4('0x54')],{'through':_0x2fb4('0x188'),'as':_0x2fb4('0x132')});db[_0x2fb4('0x124')][_0x2fb4('0x11e')](db[_0x2fb4('0x133')],{'through':_0x2fb4('0x18e'),'as':'OpenchannelQueues'});db[_0x2fb4('0x124')][_0x2fb4('0x11e')](db[_0x2fb4('0x105')],{'through':_0x2fb4('0x1dd'),'as':_0x2fb4('0x135')});db['Team']['belongsToMany'](db['VoicePrefix'],{'through':_0x2fb4('0x1de'),'as':_0x2fb4('0x12c')});db[_0x2fb4('0x1a2')][_0x2fb4('0x112')](db[_0x2fb4('0x19e')],{'as':_0x2fb4('0x147'),'foreignKey':_0x2fb4('0x1a3')});db[_0x2fb4('0x1a2')][_0x2fb4('0x112')](db['CmHopperFinal'],{'as':_0x2fb4('0x115'),'foreignKey':_0x2fb4('0x1a3')});db[_0x2fb4('0x1a2')]['hasMany'](db[_0x2fb4('0x74')],{'as':'HopperHistories','foreignKey':_0x2fb4('0x1a3')});db[_0x2fb4('0x1a2')]['hasMany'](db['CmHopperBlack'],{'as':_0x2fb4('0x149'),'foreignKey':_0x2fb4('0x1a3')});db[_0x2fb4('0x1a2')][_0x2fb4('0x11d')](db[_0x2fb4('0x14b')],{'as':_0x2fb4('0x14b'),'foreignKey':_0x2fb4('0x14c')});db[_0x2fb4('0x1a2')][_0x2fb4('0x11d')](db[_0x2fb4('0x14b')],{'as':_0x2fb4('0x14d'),'foreignKey':'TrunkBackupId'});db[_0x2fb4('0x1a2')]['belongsTo'](db[_0x2fb4('0x80')],{'as':_0x2fb4('0x80'),'foreignKey':_0x2fb4('0x173')});db[_0x2fb4('0x1a2')][_0x2fb4('0x11d')](db['SquareProject'],{'as':_0x2fb4('0xdc'),'foreignKey':_0x2fb4('0x1df')});db[_0x2fb4('0x1a2')][_0x2fb4('0x11e')](db[_0x2fb4('0xf2')],{'as':_0x2fb4('0x122'),'through':'campaigns_has_cm_lists'});db[_0x2fb4('0x1a2')][_0x2fb4('0x11e')](db['CmList'],{'as':_0x2fb4('0x14f'),'through':_0x2fb4('0x1e0')});db['Attachment'][_0x2fb4('0x11d')](db[_0x2fb4('0x170')],{'as':_0x2fb4('0x170'),'foreignKey':_0x2fb4('0x171')});db[_0x2fb4('0xeb')][_0x2fb4('0x11d')](db[_0x2fb4('0x15e')],{});db[_0x2fb4('0xeb')]['belongsTo'](db[_0x2fb4('0x40')],{});db['MailTransferReport'][_0x2fb4('0x11d')](db[_0x2fb4('0x3c')],{'foreignKey':'FromMailAccountId','as':_0x2fb4('0x1e1')});db[_0x2fb4('0xeb')][_0x2fb4('0x11d')](db[_0x2fb4('0x10c')],{'foreignKey':_0x2fb4('0x1e2'),'as':'FromAgent'});db[_0x2fb4('0xeb')]['belongsTo'](db['User'],{'foreignKey':_0x2fb4('0x1e3'),'as':'ToAgent'});db[_0x2fb4('0xeb')][_0x2fb4('0x11d')](db[_0x2fb4('0x3d')],{'foreignKey':'ToMailQueueId','as':_0x2fb4('0x1e4')});db[_0x2fb4('0xeb')][_0x2fb4('0x11d')](db['MailAccount'],{'foreignKey':_0x2fb4('0x1e5'),'as':_0x2fb4('0x1e6')});db['ChatTransferReport']['belongsTo'](db[_0x2fb4('0x63')],{});db['ChatTransferReport'][_0x2fb4('0x11d')](db['ChatInteraction'],{});db[_0x2fb4('0xec')][_0x2fb4('0x11d')](db[_0x2fb4('0x5d')],{'foreignKey':_0x2fb4('0x1e7'),'as':'FromAccount'});db['ChatTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x2fb4('0x1e2'),'as':_0x2fb4('0x1e8')});db[_0x2fb4('0xec')]['belongsTo'](db['User'],{'foreignKey':_0x2fb4('0x1e3'),'as':'ToAgent'});db[_0x2fb4('0xec')]['belongsTo'](db[_0x2fb4('0x66')],{'foreignKey':_0x2fb4('0x1e9'),'as':_0x2fb4('0x1e4')});db[_0x2fb4('0xec')][_0x2fb4('0x11d')](db['ChatWebsite'],{'foreignKey':'ToChatWebsiteId','as':_0x2fb4('0x1e6')});db[_0x2fb4('0x1ea')][_0x2fb4('0x11d')](db[_0x2fb4('0x4d')],{});db[_0x2fb4('0x1ea')][_0x2fb4('0x11d')](db['FaxInteraction'],{});db[_0x2fb4('0x1ea')][_0x2fb4('0x11d')](db[_0x2fb4('0x137')],{'foreignKey':_0x2fb4('0x1eb'),'as':_0x2fb4('0x1e1')});db[_0x2fb4('0x1ea')][_0x2fb4('0x11d')](db[_0x2fb4('0x10c')],{'foreignKey':_0x2fb4('0x1e2'),'as':_0x2fb4('0x1e8')});db[_0x2fb4('0x1ea')][_0x2fb4('0x11d')](db[_0x2fb4('0x10c')],{'foreignKey':_0x2fb4('0x1e3'),'as':_0x2fb4('0x1ec')});db[_0x2fb4('0x1ea')][_0x2fb4('0x11d')](db[_0x2fb4('0x4f')],{'foreignKey':'ToFaxQueueId','as':'ToQueue'});db['FaxTransferReport'][_0x2fb4('0x11d')](db['FaxAccount'],{'foreignKey':'ToFaxAccountId','as':_0x2fb4('0x1e6')});db['OpenchannelTransferReport'][_0x2fb4('0x11d')](db[_0x2fb4('0x18a')],{});db['OpenchannelTransferReport']['belongsTo'](db[_0x2fb4('0x116')],{});db[_0x2fb4('0xef')][_0x2fb4('0x11d')](db['OpenchannelAccount'],{'foreignKey':_0x2fb4('0x1ed'),'as':_0x2fb4('0x1e1')});db[_0x2fb4('0xef')][_0x2fb4('0x11d')](db[_0x2fb4('0x10c')],{'foreignKey':_0x2fb4('0x1e2'),'as':_0x2fb4('0x1e8')});db[_0x2fb4('0xef')][_0x2fb4('0x11d')](db[_0x2fb4('0x10c')],{'foreignKey':_0x2fb4('0x1e3'),'as':'ToAgent'});db[_0x2fb4('0xef')]['belongsTo'](db['OpenchannelQueue'],{'foreignKey':_0x2fb4('0x1ee'),'as':'ToQueue'});db[_0x2fb4('0xef')][_0x2fb4('0x11d')](db[_0x2fb4('0x56')],{'foreignKey':_0x2fb4('0x1ef'),'as':'ToAccount'});db[_0x2fb4('0x1f0')][_0x2fb4('0x11d')](db['SmsMessage'],{});db[_0x2fb4('0x1f0')][_0x2fb4('0x11d')](db[_0x2fb4('0x51')],{});db[_0x2fb4('0x1f0')][_0x2fb4('0x11d')](db['SmsAccount'],{'foreignKey':_0x2fb4('0x1f1'),'as':_0x2fb4('0x1e1')});db[_0x2fb4('0x1f0')]['belongsTo'](db[_0x2fb4('0x10c')],{'foreignKey':_0x2fb4('0x1e2'),'as':'FromAgent'});db[_0x2fb4('0x1f0')][_0x2fb4('0x11d')](db[_0x2fb4('0x10c')],{'foreignKey':_0x2fb4('0x1e3'),'as':_0x2fb4('0x1ec')});db[_0x2fb4('0x1f0')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x2fb4('0x1e4')});db[_0x2fb4('0x1f0')][_0x2fb4('0x11d')](db[_0x2fb4('0x13c')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList'][_0x2fb4('0x112')](db['Disposition'],{'as':'Dispositions','foreignKey':'ListId','onDelete':'cascade'});db[_0x2fb4('0xf2')][_0x2fb4('0x112')](db[_0x2fb4('0x1f2')],{'as':_0x2fb4('0x1f3'),'foreignKey':_0x2fb4('0x174')});db[_0x2fb4('0xf2')][_0x2fb4('0x112')](db[_0x2fb4('0x6d')],{'as':_0x2fb4('0x121'),'onDelete':_0x2fb4('0x10e'),'foreignKey':_0x2fb4('0x174')});db[_0x2fb4('0xf2')][_0x2fb4('0x112')](db[_0x2fb4('0x72')],{'as':_0x2fb4('0x115'),'foreignKey':_0x2fb4('0x174')});db[_0x2fb4('0xf2')]['hasMany'](db[_0x2fb4('0x74')],{'as':_0x2fb4('0x1f4'),'foreignKey':'ListId'});db[_0x2fb4('0xf2')][_0x2fb4('0x112')](db[_0x2fb4('0x76')],{'as':_0x2fb4('0x76'),'foreignKey':'ListId'});db[_0x2fb4('0xf2')][_0x2fb4('0x11e')](db['VoiceQueue'],{'as':_0x2fb4('0x1f5'),'through':_0x2fb4('0x1f6')});db[_0x2fb4('0xf2')][_0x2fb4('0x11e')](db[_0x2fb4('0x10c')],{'as':'Agents','through':_0x2fb4('0x123')});db[_0x2fb4('0xf4')]['hasMany'](db['VoiceExtension'],{'as':_0x2fb4('0x114'),'onDelete':'cascade'});db['VoicePrefix'][_0x2fb4('0x11e')](db[_0x2fb4('0x10c')],{'as':_0x2fb4('0x163'),'through':_0x2fb4('0x12d')});db['VoicePrefix']['belongsToMany'](db[_0x2fb4('0x124')],{'through':_0x2fb4('0x1de'),'as':'Teams'});db[_0x2fb4('0xf5')][_0x2fb4('0x112')](db['User'],{'as':_0x2fb4('0x16b'),'foreignKey':_0x2fb4('0x1f7')});db[_0x2fb4('0xf5')][_0x2fb4('0x112')](db[_0x2fb4('0xf7')],{'as':_0x2fb4('0x1f8'),'foreignKey':_0x2fb4('0x1f7'),'onDelete':_0x2fb4('0x10e')});db[_0x2fb4('0xf7')][_0x2fb4('0x112')](db[_0x2fb4('0xf9')],{'as':_0x2fb4('0x1f9'),'foreignKey':_0x2fb4('0x1fa'),'onDelete':_0x2fb4('0x10e')});db[_0x2fb4('0x1fb')][_0x2fb4('0x112')](db[_0x2fb4('0x7d')],{'as':_0x2fb4('0x176'),'foreignKey':'WhatsappAccountId','onDelete':_0x2fb4('0x10e')});db['WhatsappAccount'][_0x2fb4('0x112')](db[_0x2fb4('0x15c')],{'as':_0x2fb4('0x15d'),'foreignKey':_0x2fb4('0x1fc')});db[_0x2fb4('0x1fb')][_0x2fb4('0x112')](db[_0x2fb4('0xff')],{'as':_0x2fb4('0x151'),'foreignKey':_0x2fb4('0x1fc')});db[_0x2fb4('0x1fb')]['hasMany'](db[_0x2fb4('0xfe')],{'as':_0x2fb4('0x178')});db[_0x2fb4('0x1fb')][_0x2fb4('0x112')](db['WhatsappApplication'],{'as':'Applications'});db[_0x2fb4('0x1fb')][_0x2fb4('0x11d')](db[_0x2fb4('0xf2')],{'as':_0x2fb4('0x15f'),'foreignKey':_0x2fb4('0x174')});db[_0x2fb4('0x1fb')][_0x2fb4('0x11d')](db[_0x2fb4('0x14e')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x2fb4('0x1fb')]['belongsToMany'](db[_0x2fb4('0x10c')],{'as':_0x2fb4('0x163'),'through':'user_has_whatsapp_accounts'});db['WhatsappApplication'][_0x2fb4('0x11d')](db[_0x2fb4('0x10c')],{'onDelete':_0x2fb4('0x15a')});db['WhatsappApplication']['belongsTo'](db[_0x2fb4('0x105')],{'onDelete':_0x2fb4('0x15a')});db[_0x2fb4('0xfc')][_0x2fb4('0x11d')](db[_0x2fb4('0x1fb')],{'onDelete':_0x2fb4('0x15a')});db['WhatsappApplication'][_0x2fb4('0x11d')](db['Interval'],{'onDelete':_0x2fb4('0x15a'),'foreignKey':_0x2fb4('0x173')});db[_0x2fb4('0xfc')]['belongsTo'](db[_0x2fb4('0x168')],{'onDelete':_0x2fb4('0x15a'),'foreignKey':'TagId'});db['WhatsappInteraction'][_0x2fb4('0x112')](db[_0x2fb4('0xff')],{'as':'Messages','onDelete':_0x2fb4('0x10e'),'foreignKey':_0x2fb4('0x1fd')});db[_0x2fb4('0xfe')][_0x2fb4('0x11d')](db[_0x2fb4('0x1fb')],{'as':'Account','foreignKey':_0x2fb4('0x1fc')});db[_0x2fb4('0xfe')][_0x2fb4('0x11d')](db[_0x2fb4('0x6d')],{'as':_0x2fb4('0x156'),'foreignKey':'ContactId'});db[_0x2fb4('0xfe')]['belongsTo'](db[_0x2fb4('0x10c')],{'as':'Owner','foreignKey':_0x2fb4('0x10f')});db[_0x2fb4('0xfe')][_0x2fb4('0x11e')](db['Tag'],{'through':_0x2fb4('0x1b6'),'as':_0x2fb4('0x17c')});db['WhatsappInteraction'][_0x2fb4('0x11e')](db[_0x2fb4('0x168')],{'through':_0x2fb4('0x1b6'),'as':_0x2fb4('0x16a')});db[_0x2fb4('0xfe')][_0x2fb4('0x11e')](db[_0x2fb4('0x10c')],{'as':_0x2fb4('0x16b'),'through':_0x2fb4('0x1fe'),'foreignKey':_0x2fb4('0x1fd')});db[_0x2fb4('0xff')][_0x2fb4('0x11d')](db[_0x2fb4('0x10c')],{'as':_0x2fb4('0x10c')});db[_0x2fb4('0xff')][_0x2fb4('0x11d')](db['CmContact'],{'onDelete':_0x2fb4('0x10e'),'as':'Contact'});db[_0x2fb4('0xff')]['belongsTo'](db['WhatsappInteraction'],{'onDelete':_0x2fb4('0x10e'),'as':_0x2fb4('0x17f'),'foreignKey':_0x2fb4('0x1fd')});db[_0x2fb4('0xff')][_0x2fb4('0x11d')](db['WhatsappAccount'],{'as':_0x2fb4('0x166'),'foreignKey':'WhatsappAccountId'});db[_0x2fb4('0x101')][_0x2fb4('0x11d')](db['WhatsappAccount'],{});db[_0x2fb4('0x101')][_0x2fb4('0x11d')](db[_0x2fb4('0xf2')],{'as':'List','foreignKey':'ListId'});db[_0x2fb4('0x101')][_0x2fb4('0x11d')](db[_0x2fb4('0x6d')],{'as':'Contact','foreignKey':_0x2fb4('0x157')});db[_0x2fb4('0x101')][_0x2fb4('0x11d')](db[_0x2fb4('0xfe')],{});db[_0x2fb4('0x101')][_0x2fb4('0x11d')](db[_0x2fb4('0x105')],{});db[_0x2fb4('0x101')]['belongsTo'](db['WhatsappMessage'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x2fb4('0x10c')],{});db[_0x2fb4('0x103')]['belongsTo'](db[_0x2fb4('0xff')],{});db['WhatsappTransferReport'][_0x2fb4('0x11d')](db[_0x2fb4('0xfe')],{});db['WhatsappTransferReport'][_0x2fb4('0x11d')](db[_0x2fb4('0x1fb')],{'foreignKey':'FromWhatsappAccountId','as':_0x2fb4('0x1e1')});db[_0x2fb4('0x103')][_0x2fb4('0x11d')](db[_0x2fb4('0x1fb')],{'foreignKey':'ToWhatsappAccountId','as':_0x2fb4('0x1e6')});db[_0x2fb4('0x103')][_0x2fb4('0x11d')](db[_0x2fb4('0x105')],{'foreignKey':_0x2fb4('0x1ff'),'as':_0x2fb4('0x1e4')});db[_0x2fb4('0x103')][_0x2fb4('0x11d')](db[_0x2fb4('0x10c')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x2fb4('0x103')][_0x2fb4('0x11d')](db[_0x2fb4('0x10c')],{'foreignKey':_0x2fb4('0x1e3'),'as':_0x2fb4('0x1ec')});db[_0x2fb4('0x105')][_0x2fb4('0x11e')](db['User'],{'as':_0x2fb4('0x163'),'through':'UserWhatsappQueue','foreignKey':'WhatsappQueueId'});db[_0x2fb4('0x105')]['belongsToMany'](db[_0x2fb4('0x124')],{'through':_0x2fb4('0x1dd'),'as':_0x2fb4('0x165')});db[_0x2fb4('0x110')][_0x2fb4('0x11d')](db[_0x2fb4('0x10c')],{'as':'user','foreignKey':_0x2fb4('0x10f'),'onDelete':_0x2fb4('0x10e'),'hooks':!![]});db[_0x2fb4('0x106')]['hasOne'](db[_0x2fb4('0xbe')],{'as':_0x2fb4('0xbe'),'onDelete':_0x2fb4('0x15a')});db[_0x2fb4('0x106')]['hasOne'](db[_0x2fb4('0x38')],{'as':_0x2fb4('0x200'),'onDelete':_0x2fb4('0x15a')});db[_0x2fb4('0x106')][_0x2fb4('0x10d')](db['MailServerOut'],{'as':_0x2fb4('0x15b'),'onDelete':_0x2fb4('0x15a')});module[_0x2fb4('0x201')]={'db':db,'dbH':dbH};
\ No newline at end of file
index 4a9aa93..5460e0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3a0=['default','use','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','/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/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','/api/pauses','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/tag','/api/contact_item_types','./api/contactItemType','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','./api/squareOdbc','/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/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/user-settings','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','/www','root','/demo','snippet','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs'];(function(_0x5c6994,_0x19ad9a){var _0x1d5c84=function(_0x4a385a){while(--_0x4a385a){_0x5c6994['push'](_0x5c6994['shift']());}};_0x1d5c84(++_0x19ad9a);}(_0xa3a0,0x10d));var _0x0a3a=function(_0xc42411,_0x4ebb2e){_0xc42411=_0xc42411-0x0;var _0x31e0bf=_0xa3a0[_0xc42411];return _0x31e0bf;};'use strict';var path=require('path');var express=require(_0x0a3a('0x0'));var errors=require(_0x0a3a('0x1'));var config=require(_0x0a3a('0x2'));var setupLoggers=require(_0x0a3a('0x3'))[_0x0a3a('0x4')];var clientSideLogs=require(_0x0a3a('0x5'));exports[_0x0a3a('0x6')]=function(_0x49dac4){return setupLoggers(_0x49dac4)['then'](function(){_0x49dac4[_0x0a3a('0x7')]('/api/users',require('./api/user'));_0x49dac4[_0x0a3a('0x7')]('/api/voice/chanspy',require(_0x0a3a('0x8')));_0x49dac4['use'](_0x0a3a('0x9'),require(_0x0a3a('0xa')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xb'),require(_0x0a3a('0xc')));_0x49dac4[_0x0a3a('0x7')]('/api/voice/mohs',require(_0x0a3a('0xd')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xe'),require(_0x0a3a('0xf')));_0x49dac4['use'](_0x0a3a('0x10'),require(_0x0a3a('0x11')));_0x49dac4[_0x0a3a('0x7')]('/api/screen/recordings',require(_0x0a3a('0x12')));_0x49dac4['use'](_0x0a3a('0x13'),require('./api/voiceMail'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x14'),require('./api/voiceMailMessage'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x15'),require('./api/voiceCallReport'));_0x49dac4['use'](_0x0a3a('0x16'),require(_0x0a3a('0x17')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x18'),require(_0x0a3a('0x19')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x1a'),require('./api/voiceQueueReport'));_0x49dac4[_0x0a3a('0x7')]('/api/members/reports',require('./api/memberReport'));_0x49dac4['use'](_0x0a3a('0x1b'),require(_0x0a3a('0x1c')));_0x49dac4['use'](_0x0a3a('0x1d'),require(_0x0a3a('0x1e')));_0x49dac4['use'](_0x0a3a('0x1f'),require(_0x0a3a('0x20')));_0x49dac4['use'](_0x0a3a('0x21'),require(_0x0a3a('0x22')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x23'),require(_0x0a3a('0x24')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x25'),require(_0x0a3a('0x26')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x27'),require(_0x0a3a('0x28')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x29'),require(_0x0a3a('0x2a')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x2b'),require(_0x0a3a('0x2c')));_0x49dac4[_0x0a3a('0x7')]('/api/mail/reports/queue',require(_0x0a3a('0x2d')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x2e'),require(_0x0a3a('0x2f')));_0x49dac4[_0x0a3a('0x7')]('/api/dashboards/items',require(_0x0a3a('0x30')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x31'),require('./api/faxAccount'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x32'),require(_0x0a3a('0x33')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x34'),require('./api/faxInteraction'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x35'),require(_0x0a3a('0x36')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x37'),require('./api/faxQueue'));_0x49dac4['use']('/api/fax/reports/queue',require('./api/faxQueueReport'));_0x49dac4[_0x0a3a('0x7')]('/api/sms/accounts',require(_0x0a3a('0x38')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x39'),require(_0x0a3a('0x3a')));_0x49dac4['use'](_0x0a3a('0x3b'),require('./api/smsInteraction'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x3c'),require('./api/smsMessage'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x3d'),require(_0x0a3a('0x3e')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x3f'),require(_0x0a3a('0x40')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x41'),require(_0x0a3a('0x42')));_0x49dac4[_0x0a3a('0x7')]('/api/openchannel/interactions',require(_0x0a3a('0x43')));_0x49dac4['use']('/api/openchannel/messages',require(_0x0a3a('0x44')));_0x49dac4['use'](_0x0a3a('0x45'),require('./api/openchannelQueue'));_0x49dac4['use'](_0x0a3a('0x46'),require(_0x0a3a('0x47')));_0x49dac4['use']('/api/openchannel/reports/queue',require(_0x0a3a('0x48')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x49'),require('./api/chatApplication'));_0x49dac4['use'](_0x0a3a('0x4a'),require(_0x0a3a('0x4b')));_0x49dac4['use'](_0x0a3a('0x4c'),require('./api/chatMessage'));_0x49dac4['use'](_0x0a3a('0x4d'),require(_0x0a3a('0x4e')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x4f'),require('./api/chatQueue'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x50'),require(_0x0a3a('0x51')));_0x49dac4['use'](_0x0a3a('0x52'),require(_0x0a3a('0x53')));_0x49dac4['use'](_0x0a3a('0x54'),require(_0x0a3a('0x55')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x56'),require(_0x0a3a('0x57')));_0x49dac4['use'](_0x0a3a('0x58'),require(_0x0a3a('0x59')));_0x49dac4[_0x0a3a('0x7')]('/api/cm/hopper_black',require('./api/cmHopperBlack'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x5a'),require(_0x0a3a('0x5b')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x5c'),require(_0x0a3a('0x5d')));_0x49dac4['use'](_0x0a3a('0x5e'),require(_0x0a3a('0x5f')));_0x49dac4['use'](_0x0a3a('0x60'),require(_0x0a3a('0x61')));_0x49dac4['use']('/api/automations',require(_0x0a3a('0x62')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x63'),require(_0x0a3a('0x64')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x65'),require(_0x0a3a('0x66')));_0x49dac4['use'](_0x0a3a('0x67'),require('./api/condition'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x68'),require('./api/interval'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x69'),require(_0x0a3a('0x6a')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x6b'),require(_0x0a3a('0x6c')));_0x49dac4[_0x0a3a('0x7')]('/api/voiceQueuesLog',require(_0x0a3a('0x6d')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x6e'),require(_0x0a3a('0x6f')));_0x49dac4['use'](_0x0a3a('0x70'),require('./api/sound'));_0x49dac4[_0x0a3a('0x7')]('/api/tags',require(_0x0a3a('0x71')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x72'),require(_0x0a3a('0x73')));_0x49dac4[_0x0a3a('0x7')]('/api/cm_contact_has_items',require(_0x0a3a('0x74')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x75'),require(_0x0a3a('0x76')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x77'),require(_0x0a3a('0x78')));_0x49dac4['use']('/api/triggers',require(_0x0a3a('0x79')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x7a'),require(_0x0a3a('0x7b')));_0x49dac4[_0x0a3a('0x7')]('/api/integrations',require(_0x0a3a('0x7c')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x7d'),require(_0x0a3a('0x7e')));_0x49dac4[_0x0a3a('0x7')]('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x49dac4['use'](_0x0a3a('0x7f'),require(_0x0a3a('0x80')));_0x49dac4['use'](_0x0a3a('0x81'),require(_0x0a3a('0x82')));_0x49dac4['use'](_0x0a3a('0x83'),require('./api/analyticMetric'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x84'),require(_0x0a3a('0x85')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x86'),require('./api/analyticTreeReport'));_0x49dac4[_0x0a3a('0x7')]('/api/integrations/salesforce/accounts',require(_0x0a3a('0x87')));_0x49dac4['use']('/api/integrations/salesforce/configurations',require(_0x0a3a('0x88')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x89'),require(_0x0a3a('0x8a')));_0x49dac4['use'](_0x0a3a('0x8b'),require('./api/intSugarcrmAccount'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x8c'),require('./api/intSugarcrmConfiguration'));_0x49dac4[_0x0a3a('0x7')]('/api/integrations/sugarcrm/fields',require(_0x0a3a('0x8d')));_0x49dac4['use'](_0x0a3a('0x8e'),require(_0x0a3a('0x8f')));_0x49dac4['use'](_0x0a3a('0x90'),require(_0x0a3a('0x91')));_0x49dac4[_0x0a3a('0x7')]('/api/integrations/desk/fields',require('./api/intDeskField'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x92'),require(_0x0a3a('0x93')));_0x49dac4[_0x0a3a('0x7')]('/api/integrations/zoho/configurations',require(_0x0a3a('0x94')));_0x49dac4['use'](_0x0a3a('0x95'),require(_0x0a3a('0x96')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x97'),require(_0x0a3a('0x98')));_0x49dac4[_0x0a3a('0x7')]('/api/integrations/zendesk/configurations',require(_0x0a3a('0x99')));_0x49dac4[_0x0a3a('0x7')]('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x9a'),require('./api/intFreshdeskAccount'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x9b'),require(_0x0a3a('0x9c')));_0x49dac4['use'](_0x0a3a('0x9d'),require(_0x0a3a('0x9e')));_0x49dac4[_0x0a3a('0x7')]('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x9f'),require(_0x0a3a('0xa0')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xa1'),require(_0x0a3a('0xa2')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xa3'),require('./api/intServicenowAccount'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xa4'),require(_0x0a3a('0xa5')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xa6'),require(_0x0a3a('0xa7')));_0x49dac4['use'](_0x0a3a('0xa8'),require(_0x0a3a('0xa9')));_0x49dac4['use'](_0x0a3a('0xaa'),require('./api/intDynamics365Configuration'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xab'),require(_0x0a3a('0xac')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xad'),require(_0x0a3a('0xae')));_0x49dac4['use'](_0x0a3a('0xaf'),require(_0x0a3a('0xb0')));_0x49dac4[_0x0a3a('0x7')]('/api/integrations/freshsales/fields',require(_0x0a3a('0xb1')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xb2'),require(_0x0a3a('0xb3')));_0x49dac4[_0x0a3a('0x7')]('/api/chat/reports/queue',require(_0x0a3a('0xb4')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xb5'),require(_0x0a3a('0xb6')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xb7'),require(_0x0a3a('0xb8')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xb9'),require(_0x0a3a('0xba')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xbb'),require(_0x0a3a('0xbc')));_0x49dac4['use'](_0x0a3a('0xbd'),require(_0x0a3a('0xbe')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xbf'),require('./api/squareReport'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xc0'),require(_0x0a3a('0xc1')));_0x49dac4['use'](_0x0a3a('0xc2'),require(_0x0a3a('0xc3')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xc4'),require(_0x0a3a('0xc5')));_0x49dac4[_0x0a3a('0x7')]('/api/square/odbc',require(_0x0a3a('0xc6')));_0x49dac4[_0x0a3a('0x7')]('/api/square/projects',require('./api/squareProject'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xc7'),require(_0x0a3a('0xc8')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xc9'),require(_0x0a3a('0xca')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xcb'),require(_0x0a3a('0xcc')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xcd'),require(_0x0a3a('0xce')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xcf'),require(_0x0a3a('0xd0')));_0x49dac4['use'](_0x0a3a('0xd1'),require('./api/migration'));_0x49dac4[_0x0a3a('0x7')]('/api/attachments',require(_0x0a3a('0xd2')));_0x49dac4['use'](_0x0a3a('0xd3'),require(_0x0a3a('0xd4')));_0x49dac4['use'](_0x0a3a('0xd5'),require('./api/mailTransferReport'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xd6'),require('./api/chatTransferReport'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xd7'),require('./api/faxTransferReport'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xd8'),require(_0x0a3a('0xd9')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xda'),require(_0x0a3a('0xdb')));_0x49dac4[_0x0a3a('0x7')]('/api/cm/lists',require(_0x0a3a('0xdc')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xdd'),require('./api/voicePrefix'));_0x49dac4[_0x0a3a('0x7')]('/api/userProfiles',require('./api/userProfile'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xde'),require(_0x0a3a('0xdf')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xe0'),require(_0x0a3a('0xe1')));_0x49dac4[_0x0a3a('0x7')]('/api/userNotifications',require(_0x0a3a('0xe2')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xe3'),require(_0x0a3a('0xe4')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xe5'),require(_0x0a3a('0xe6')));_0x49dac4['use'](_0x0a3a('0xe7'),require('./api/whatsappInteraction'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xe8'),require('./api/whatsappMessage'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xe9'),require(_0x0a3a('0xea')));_0x49dac4['use'](_0x0a3a('0xeb'),require(_0x0a3a('0xec')));_0x49dac4[_0x0a3a('0x7')]('/api/whatsapp/queues',require(_0x0a3a('0xed')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xee'),require(_0x0a3a('0xef')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xf0'),require('./api/realtime'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xf1'),require('./api/user-setting'));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xf2'),require(_0x0a3a('0xf3')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xf4'),require(_0x0a3a('0xf5')));_0x49dac4['use'](_0x0a3a('0xf6'),require(_0x0a3a('0xf7')));_0x49dac4[_0x0a3a('0x7')]('/api/jira',require(_0x0a3a('0xf8')));_0x49dac4['use'](_0x0a3a('0xf9'),require(_0x0a3a('0xfa')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xfb'),require(_0x0a3a('0xfc')));_0x49dac4[_0x0a3a('0x7')]('/api/system',require(_0x0a3a('0xfd')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0xfe'),require(_0x0a3a('0xff')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x100'),require(_0x0a3a('0x101')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x102'),clientSideLogs);_0x49dac4['use'](_0x0a3a('0x103'),express[_0x0a3a('0x104')](path[_0x0a3a('0x105')](config['root'],_0x0a3a('0x103'))));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x106'),express[_0x0a3a('0x104')](path[_0x0a3a('0x105')](config[_0x0a3a('0x107')],_0x0a3a('0x106'))));_0x49dac4['use'](_0x0a3a('0x108'),express[_0x0a3a('0x104')](path[_0x0a3a('0x105')](config['root'],_0x0a3a('0x108'))));_0x49dac4['use']('/snippet',express[_0x0a3a('0x104')](path[_0x0a3a('0x105')](config['root'],_0x0a3a('0x109'),'3.0.0')));_0x49dac4[_0x0a3a('0x7')](_0x0a3a('0x10a'),express[_0x0a3a('0x104')](path['join'](config[_0x0a3a('0x107')],_0x0a3a('0x10b'))));_0x49dac4[_0x0a3a('0x10c')](_0x0a3a('0x10d'))['get'](errors[0x194]);_0x49dac4[_0x0a3a('0x10c')]('/*')[_0x0a3a('0x10e')](function(_0x38c48e,_0x2e4f87){_0x2e4f87[_0x0a3a('0x10f')](path[_0x0a3a('0x110')](_0x49dac4[_0x0a3a('0x10e')](_0x0a3a('0x111'))+_0x0a3a('0x112')));});return _0x49dac4;});};
\ No newline at end of file
+var _0x9b0f=['/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatOfflineMessage','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','/api/automations','./api/automation','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/recordings','./api/squareRecording','/api/teams','./api/team','/api/license','./api/license','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','./api/user-setting','./api/authLocal','/api/auth/google','./api/authGoogle','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','express','./config/environment','./api/client-side-logs','/api/users','use','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage'];(function(_0x195caa,_0x47cb03){var _0x2ad7b4=function(_0x29c394){while(--_0x29c394){_0x195caa['push'](_0x195caa['shift']());}};_0x2ad7b4(++_0x47cb03);}(_0x9b0f,0xff));var _0xf9b0=function(_0xdc43a4,_0x36fdd0){_0xdc43a4=_0xdc43a4-0x0;var _0x4cc4d3=_0x9b0f[_0xdc43a4];return _0x4cc4d3;};'use strict';var path=require('path');var express=require(_0xf9b0('0x0'));var errors=require('./errors');var config=require(_0xf9b0('0x1'));var setupLoggers=require('./utils/client-side-logger')['setupLoggers'];var clientSideLogs=require(_0xf9b0('0x2'));exports['default']=function(_0x171966){return setupLoggers(_0x171966)['then'](function(){_0x171966['use'](_0xf9b0('0x3'),require('./api/user'));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x5'),require('./api/voiceChanSpy'));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x6'),require(_0xf9b0('0x7')));_0x171966['use']('/api/voice/extensions',require(_0xf9b0('0x8')));_0x171966[_0xf9b0('0x4')]('/api/voice/mohs',require(_0xf9b0('0x9')));_0x171966['use'](_0xf9b0('0xa'),require(_0xf9b0('0xb')));_0x171966['use'](_0xf9b0('0xc'),require(_0xf9b0('0xd')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0xe'),require(_0xf9b0('0xf')));_0x171966['use']('/api/voice/mails',require(_0xf9b0('0x10')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x11'),require(_0xf9b0('0x12')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x13'),require(_0xf9b0('0x14')));_0x171966['use'](_0xf9b0('0x15'),require('./api/voiceDialReport'));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x16'),require(_0xf9b0('0x17')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x18'),require(_0xf9b0('0x19')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x1a'),require(_0xf9b0('0x1b')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x1c'),require(_0xf9b0('0x1d')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x1e'),require(_0xf9b0('0x1f')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x20'),require('./api/mailServerOut'));_0x171966['use'](_0xf9b0('0x21'),require('./api/mailAccount'));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x22'),require(_0xf9b0('0x23')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x24'),require(_0xf9b0('0x25')));_0x171966[_0xf9b0('0x4')]('/api/mail/interactions',require(_0xf9b0('0x26')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x27'),require(_0xf9b0('0x28')));_0x171966['use']('/api/mail/applications',require(_0xf9b0('0x29')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x2a'),require('./api/mailQueueReport'));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x2b'),require('./api/dashboard'));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x2c'),require(_0xf9b0('0x2d')));_0x171966['use'](_0xf9b0('0x2e'),require(_0xf9b0('0x2f')));_0x171966[_0xf9b0('0x4')]('/api/fax/applications',require(_0xf9b0('0x30')));_0x171966['use'](_0xf9b0('0x31'),require(_0xf9b0('0x32')));_0x171966[_0xf9b0('0x4')]('/api/fax/messages',require(_0xf9b0('0x33')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x34'),require(_0xf9b0('0x35')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x36'),require(_0xf9b0('0x37')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x38'),require(_0xf9b0('0x39')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x3a'),require(_0xf9b0('0x3b')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x3c'),require(_0xf9b0('0x3d')));_0x171966['use'](_0xf9b0('0x3e'),require('./api/smsMessage'));_0x171966['use'](_0xf9b0('0x3f'),require(_0xf9b0('0x40')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x41'),require(_0xf9b0('0x42')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x43'),require(_0xf9b0('0x44')));_0x171966['use']('/api/openchannel/interactions',require(_0xf9b0('0x45')));_0x171966[_0xf9b0('0x4')]('/api/openchannel/messages',require(_0xf9b0('0x46')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x47'),require(_0xf9b0('0x48')));_0x171966[_0xf9b0('0x4')]('/api/chat/websites',require(_0xf9b0('0x49')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x4a'),require('./api/openchannelQueueReport'));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x4b'),require(_0xf9b0('0x4c')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x4d'),require(_0xf9b0('0x4e')));_0x171966[_0xf9b0('0x4')]('/api/chat/messages',require('./api/chatMessage'));_0x171966[_0xf9b0('0x4')]('/api/chat/offline_messages',require(_0xf9b0('0x4f')));_0x171966[_0xf9b0('0x4')]('/api/chat/queues',require('./api/chatQueue'));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x50'),require(_0xf9b0('0x51')));_0x171966[_0xf9b0('0x4')]('/api/chat/proactive_actions',require(_0xf9b0('0x52')));_0x171966['use']('/api/cm/companies',require(_0xf9b0('0x53')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x54'),require(_0xf9b0('0x55')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x56'),require('./api/cmHopper'));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x57'),require(_0xf9b0('0x58')));_0x171966[_0xf9b0('0x4')]('/api/cm/hopper_final',require(_0xf9b0('0x59')));_0x171966[_0xf9b0('0x4')]('/api/cm/hopper_history',require(_0xf9b0('0x5a')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x5b'),require('./api/cmCustomField'));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x5c'),require('./api/action'));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x5d'),require(_0xf9b0('0x5e')));_0x171966[_0xf9b0('0x4')]('/api/canned_answers',require('./api/cannedAnswer'));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x5f'),require(_0xf9b0('0x60')));_0x171966['use'](_0xf9b0('0x61'),require('./api/condition'));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x62'),require(_0xf9b0('0x63')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x64'),require(_0xf9b0('0x65')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x66'),require(_0xf9b0('0x67')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x68'),require(_0xf9b0('0x69')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x6a'),require(_0xf9b0('0x6b')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x6c'),require(_0xf9b0('0x6d')));_0x171966['use'](_0xf9b0('0x6e'),require(_0xf9b0('0x6f')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x70'),require(_0xf9b0('0x71')));_0x171966['use']('/api/cm_contact_has_items',require(_0xf9b0('0x72')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x73'),require(_0xf9b0('0x74')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x75'),require('./api/template'));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x76'),require(_0xf9b0('0x77')));_0x171966['use'](_0xf9b0('0x78'),require(_0xf9b0('0x79')));_0x171966['use'](_0xf9b0('0x7a'),require(_0xf9b0('0x7b')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x7c'),require(_0xf9b0('0x7d')));_0x171966['use'](_0xf9b0('0x7e'),require(_0xf9b0('0x7f')));_0x171966[_0xf9b0('0x4')]('/api/analytics/default_reports',require(_0xf9b0('0x80')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x81'),require(_0xf9b0('0x82')));_0x171966['use'](_0xf9b0('0x83'),require(_0xf9b0('0x84')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x85'),require(_0xf9b0('0x86')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x87'),require(_0xf9b0('0x88')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x89'),require('./api/intSalesforceAccount'));_0x171966[_0xf9b0('0x4')]('/api/integrations/salesforce/configurations',require(_0xf9b0('0x8a')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x8b'),require('./api/intSalesforceField'));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x8c'),require(_0xf9b0('0x8d')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x8e'),require(_0xf9b0('0x8f')));_0x171966['use'](_0xf9b0('0x90'),require(_0xf9b0('0x91')));_0x171966['use'](_0xf9b0('0x92'),require('./api/intDeskAccount'));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x93'),require(_0xf9b0('0x94')));_0x171966[_0xf9b0('0x4')]('/api/integrations/desk/fields',require(_0xf9b0('0x95')));_0x171966[_0xf9b0('0x4')]('/api/integrations/zoho/accounts',require(_0xf9b0('0x96')));_0x171966['use']('/api/integrations/zoho/configurations',require('./api/intZohoConfiguration'));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x97'),require(_0xf9b0('0x98')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x99'),require(_0xf9b0('0x9a')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x9b'),require('./api/intZendeskConfiguration'));_0x171966[_0xf9b0('0x4')]('/api/integrations/zendesk/fields',require(_0xf9b0('0x9c')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x9d'),require(_0xf9b0('0x9e')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x9f'),require(_0xf9b0('0xa0')));_0x171966['use'](_0xf9b0('0xa1'),require(_0xf9b0('0xa2')));_0x171966['use'](_0xf9b0('0xa3'),require('./api/intVtigerAccount'));_0x171966[_0xf9b0('0x4')]('/api/integrations/vtiger/configurations',require(_0xf9b0('0xa4')));_0x171966['use']('/api/integrations/vtiger/fields',require(_0xf9b0('0xa5')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0xa6'),require(_0xf9b0('0xa7')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0xa8'),require('./api/intServicenowConfiguration'));_0x171966['use'](_0xf9b0('0xa9'),require(_0xf9b0('0xaa')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0xab'),require(_0xf9b0('0xac')));_0x171966[_0xf9b0('0x4')]('/api/integrations/dynamics365/configurations',require(_0xf9b0('0xad')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0xae'),require('./api/intDynamics365Field'));_0x171966[_0xf9b0('0x4')](_0xf9b0('0xaf'),require('./api/intFreshsalesAccount'));_0x171966[_0xf9b0('0x4')](_0xf9b0('0xb0'),require(_0xf9b0('0xb1')));_0x171966['use'](_0xf9b0('0xb2'),require(_0xf9b0('0xb3')));_0x171966['use'](_0xf9b0('0xb4'),require(_0xf9b0('0xb5')));_0x171966['use'](_0xf9b0('0xb6'),require(_0xf9b0('0xb7')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0xb8'),require(_0xf9b0('0xb9')));_0x171966['use']('/api/jscripty/answers/reports',require(_0xf9b0('0xba')));_0x171966['use'](_0xf9b0('0xbb'),require(_0xf9b0('0xbc')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0xbd'),require(_0xf9b0('0xbe')));_0x171966[_0xf9b0('0x4')]('/api/sms/reports/queue',require(_0xf9b0('0xbf')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0xc0'),require(_0xf9b0('0xc1')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0xc2'),require(_0xf9b0('0xc3')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0xc4'),require(_0xf9b0('0xc5')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0xc6'),require('./api/setting'));_0x171966[_0xf9b0('0x4')](_0xf9b0('0xc7'),require(_0xf9b0('0xc8')));_0x171966[_0xf9b0('0x4')]('/api/square/projects',require('./api/squareProject'));_0x171966['use'](_0xf9b0('0xc9'),require(_0xf9b0('0xca')));_0x171966['use']('/api/square/messages',require('./api/squareMessage'));_0x171966[_0xf9b0('0x4')](_0xf9b0('0xcb'),require(_0xf9b0('0xcc')));_0x171966['use'](_0xf9b0('0xcd'),require(_0xf9b0('0xce')));_0x171966['use']('/api/campaigns',require('./api/campaign'));_0x171966[_0xf9b0('0x4')]('/api/migrations',require(_0xf9b0('0xcf')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0xd0'),require(_0xf9b0('0xd1')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0xd2'),require(_0xf9b0('0xd3')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0xd4'),require(_0xf9b0('0xd5')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0xd6'),require(_0xf9b0('0xd7')));_0x171966[_0xf9b0('0x4')]('/api/fax/reports/transfer',require(_0xf9b0('0xd8')));_0x171966['use'](_0xf9b0('0xd9'),require(_0xf9b0('0xda')));_0x171966['use']('/api/sms/reports/transfer',require(_0xf9b0('0xdb')));_0x171966['use'](_0xf9b0('0xdc'),require(_0xf9b0('0xdd')));_0x171966['use'](_0xf9b0('0xde'),require(_0xf9b0('0xdf')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0xe0'),require(_0xf9b0('0xe1')));_0x171966['use'](_0xf9b0('0xe2'),require(_0xf9b0('0xe3')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0xe4'),require(_0xf9b0('0xe5')));_0x171966[_0xf9b0('0x4')]('/api/userNotifications',require(_0xf9b0('0xe6')));_0x171966[_0xf9b0('0x4')]('/api/whatsapp/accounts',require(_0xf9b0('0xe7')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0xe8'),require(_0xf9b0('0xe9')));_0x171966[_0xf9b0('0x4')]('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0x171966['use'](_0xf9b0('0xea'),require(_0xf9b0('0xeb')));_0x171966['use'](_0xf9b0('0xec'),require('./api/whatsappQueueReport'));_0x171966[_0xf9b0('0x4')]('/api/whatsapp/reports/transfer',require(_0xf9b0('0xed')));_0x171966['use']('/api/whatsapp/queues',require(_0xf9b0('0xee')));_0x171966['use'](_0xf9b0('0xef'),require(_0xf9b0('0xf0')));_0x171966[_0xf9b0('0x4')]('/api/realtime',require(_0xf9b0('0xf1')));_0x171966[_0xf9b0('0x4')]('/api/user-settings',require(_0xf9b0('0xf2')));_0x171966[_0xf9b0('0x4')]('/api/auth/local',require(_0xf9b0('0xf3')));_0x171966['use'](_0xf9b0('0xf4'),require(_0xf9b0('0xf5')));_0x171966['use']('/api/auth/activedirectory',require(_0xf9b0('0xf6')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0xf7'),require(_0xf9b0('0xf8')));_0x171966['use'](_0xf9b0('0xf9'),require(_0xf9b0('0xfa')));_0x171966['use']('/api/version',require(_0xf9b0('0xfb')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0xfc'),require(_0xf9b0('0xfd')));_0x171966[_0xf9b0('0x4')]('/api/pm2',require(_0xf9b0('0xfe')));_0x171966[_0xf9b0('0x4')](_0xf9b0('0xff'),require(_0xf9b0('0x100')));_0x171966[_0xf9b0('0x4')]('/api/logs',clientSideLogs);_0x171966[_0xf9b0('0x4')](_0xf9b0('0x101'),express[_0xf9b0('0x102')](path[_0xf9b0('0x103')](config[_0xf9b0('0x104')],_0xf9b0('0x101'))));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x105'),express[_0xf9b0('0x102')](path[_0xf9b0('0x103')](config[_0xf9b0('0x104')],_0xf9b0('0x105'))));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x106'),express[_0xf9b0('0x102')](path['join'](config[_0xf9b0('0x104')],_0xf9b0('0x106'))));_0x171966[_0xf9b0('0x4')](_0xf9b0('0x107'),express[_0xf9b0('0x102')](path['join'](config[_0xf9b0('0x104')],_0xf9b0('0x108'),'3.0.0')));_0x171966['use'](_0xf9b0('0x109'),express[_0xf9b0('0x102')](path[_0xf9b0('0x103')](config[_0xf9b0('0x104')],_0xf9b0('0x10a'))));_0x171966[_0xf9b0('0x10b')](_0xf9b0('0x10c'))['get'](errors[0x194]);_0x171966[_0xf9b0('0x10b')]('/*')[_0xf9b0('0x10d')](function(_0x1dda1c,_0x40fe1d){_0x40fe1d[_0xf9b0('0x10e')](path[_0xf9b0('0x10f')](_0x171966[_0xf9b0('0x10d')](_0xf9b0('0x110'))+_0xf9b0('0x111')));});return _0x171966;});};
\ No newline at end of file
index 0176656..92d0ca5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8de3=['../api/mailQueue/mailQueue.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.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/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','jayson/promise','lodash','../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/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc'];(function(_0x34905c,_0x4da712){var _0x274736=function(_0x5300be){while(--_0x5300be){_0x34905c['push'](_0x34905c['shift']());}};_0x274736(++_0x4da712);}(_0x8de3,0x11c));var _0x38de=function(_0x2bb3f6,_0x25fde0){_0x2bb3f6=_0x2bb3f6-0x0;var _0x62b339=_0x8de3[_0x2bb3f6];return _0x62b339;};'use strict';var jayson=require(_0x38de('0x0'));var _=require(_0x38de('0x1'));var config=require(_0x38de('0x2'));exports[_0x38de('0x3')]=function(){return new Promise(function(_0x596ccf,_0x27da84){var _0x1b8151={};_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x5')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require('../api/voiceExtension/voiceExtension.rpc'));_0x1b8151=_['merge'](_0x1b8151,require(_0x38de('0x6')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x7')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x8')));_0x1b8151=_['merge'](_0x1b8151,require(_0x38de('0x9')));_0x1b8151=_['merge'](_0x1b8151,require(_0x38de('0xa')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0xb')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require('../api/memberReport/memberReport.rpc'));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0xc')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0xd')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0xe')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require('../api/mailServerIn/mailServerIn.rpc'));_0x1b8151=_['merge'](_0x1b8151,require(_0x38de('0xf')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x10')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require('../api/mailInteraction/mailInteraction.rpc'));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require('../api/mailMessage/mailMessage.rpc'));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x11')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x12')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x13')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require('../api/faxApplication/faxApplication.rpc'));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x14')));_0x1b8151=_['merge'](_0x1b8151,require('../api/faxMessage/faxMessage.rpc'));_0x1b8151=_['merge'](_0x1b8151,require(_0x38de('0x15')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x16')));_0x1b8151=_['merge'](_0x1b8151,require('../api/smsAccount/smsAccount.rpc'));_0x1b8151=_['merge'](_0x1b8151,require(_0x38de('0x17')));_0x1b8151=_['merge'](_0x1b8151,require(_0x38de('0x18')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x19')));_0x1b8151=_['merge'](_0x1b8151,require(_0x38de('0x1a')));_0x1b8151=_['merge'](_0x1b8151,require(_0x38de('0x1b')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x1b8151=_['merge'](_0x1b8151,require(_0x38de('0x1c')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x1d')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x1e')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x1f')));_0x1b8151=_['merge'](_0x1b8151,require(_0x38de('0x20')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x21')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x22')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x23')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x24')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x25')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x26')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x27')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x28')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x29')));_0x1b8151=_['merge'](_0x1b8151,require(_0x38de('0x2a')));_0x1b8151=_['merge'](_0x1b8151,require(_0x38de('0x2b')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x2c')));_0x1b8151=_['merge'](_0x1b8151,require(_0x38de('0x2d')));_0x1b8151=_['merge'](_0x1b8151,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x2e')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x2f')));_0x1b8151=_['merge'](_0x1b8151,require(_0x38de('0x30')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x31')));_0x1b8151=_['merge'](_0x1b8151,require(_0x38de('0x32')));_0x1b8151=_['merge'](_0x1b8151,require(_0x38de('0x33')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x34')));_0x1b8151=_['merge'](_0x1b8151,require(_0x38de('0x35')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x1b8151=_['merge'](_0x1b8151,require(_0x38de('0x36')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x37')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x38')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x39')));_0x1b8151=_['merge'](_0x1b8151,require('../api/squareOdbc/squareOdbc.rpc'));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x3a')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x3b')));_0x1b8151=_['merge'](_0x1b8151,require(_0x38de('0x3c')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x3d')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require('../api/attachment/attachment.rpc'));_0x1b8151=_['merge'](_0x1b8151,require(_0x38de('0x3e')));_0x1b8151=_['merge'](_0x1b8151,require(_0x38de('0x3f')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x40')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x41')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x42')));_0x1b8151=_[_0x38de('0x4')](_0x1b8151,require(_0x38de('0x43')));var _0x2fbceb=jayson['server'](_0x1b8151)[_0x38de('0x44')]();var _0x88b793=config[_0x38de('0x45')][_0x38de('0x46')]||config[_0x38de('0x46')]+0x1;var _0x62dcbc=config[_0x38de('0x45')]['ip']||'localhost';_0x2fbceb['on'](_0x38de('0x47'),function(_0x47a27d){return _0x27da84(_0x47a27d);});_0x2fbceb[_0x38de('0x3')](_0x88b793,_0x62dcbc,function(){console['log'](_0x38de('0x48'),_0x62dcbc,_0x88b793);require(_0x38de('0x49'))[_0x38de('0x4a')]();return _0x596ccf('RPC\x20listening\x20on\x20'+_0x62dcbc+':'+_0x88b793);});});};
\ No newline at end of file
+var _0x734f=['listen','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','merge','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/pause/pause.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.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/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/attachment/attachment.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error'];(function(_0x5191f6,_0x57698c){var _0x454bea=function(_0x1fea33){while(--_0x1fea33){_0x5191f6['push'](_0x5191f6['shift']());}};_0x454bea(++_0x57698c);}(_0x734f,0xd3));var _0xf734=function(_0x57fd59,_0x49ff36){_0x57fd59=_0x57fd59-0x0;var _0x29e757=_0x734f[_0x57fd59];return _0x29e757;};'use strict';var jayson=require(_0xf734('0x0'));var _=require(_0xf734('0x1'));var config=require(_0xf734('0x2'));exports['listen']=function(){return new Promise(function(_0x426923,_0x7a2cfb){var _0x3f6c18={};_0x3f6c18=_['merge'](_0x3f6c18,require('../api/user/user.rpc'));_0x3f6c18=_['merge'](_0x3f6c18,require(_0xf734('0x3')));_0x3f6c18=_['merge'](_0x3f6c18,require(_0xf734('0x4')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x6')));_0x3f6c18=_['merge'](_0x3f6c18,require(_0xf734('0x7')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x3f6c18=_['merge'](_0x3f6c18,require(_0xf734('0x8')));_0x3f6c18=_['merge'](_0x3f6c18,require(_0xf734('0x9')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require('../api/memberReport/memberReport.rpc'));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0xa')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0xb')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0xc')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require('../api/mailServerIn/mailServerIn.rpc'));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0xd')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require('../api/mailQueue/mailQueue.rpc'));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0xe')));_0x3f6c18=_['merge'](_0x3f6c18,require(_0xf734('0xf')));_0x3f6c18=_['merge'](_0x3f6c18,require(_0xf734('0x10')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require('../api/faxAccount/faxAccount.rpc'));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x11')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x12')));_0x3f6c18=_['merge'](_0x3f6c18,require(_0xf734('0x13')));_0x3f6c18=_['merge'](_0x3f6c18,require(_0xf734('0x14')));_0x3f6c18=_['merge'](_0x3f6c18,require(_0xf734('0x15')));_0x3f6c18=_['merge'](_0x3f6c18,require(_0xf734('0x16')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x17')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x18')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require('../api/smsQueue/smsQueue.rpc'));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x19')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x1a')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x1b')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x1c')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x1d')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x1e')));_0x3f6c18=_['merge'](_0x3f6c18,require(_0xf734('0x1f')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x20')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x21')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x22')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x23')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x24')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require('../api/interval/interval.rpc'));_0x3f6c18=_['merge'](_0x3f6c18,require(_0xf734('0x25')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require('../api/sound/sound.rpc'));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require('../api/template/template.rpc'));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x26')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x27')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x28')));_0x3f6c18=_['merge'](_0x3f6c18,require(_0xf734('0x29')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x2a')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x2b')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x3f6c18=_['merge'](_0x3f6c18,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x3f6c18=_['merge'](_0x3f6c18,require(_0xf734('0x2c')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x2d')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x2e')));_0x3f6c18=_['merge'](_0x3f6c18,require(_0xf734('0x2f')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x30')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x31')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require('../api/squareReport/squareReport.rpc'));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x32')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x33')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require('../api/squareOdbc/squareOdbc.rpc'));_0x3f6c18=_['merge'](_0x3f6c18,require(_0xf734('0x34')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x35')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require('../api/squareMessage/squareMessage.rpc'));_0x3f6c18=_['merge'](_0x3f6c18,require('../api/campaign/campaign.rpc'));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x36')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require('../api/plugin/plugin.rpc'));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x37')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x38')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x39')));_0x3f6c18=_[_0xf734('0x5')](_0x3f6c18,require(_0xf734('0x3a')));var _0x1f4e47=jayson[_0xf734('0x3b')](_0x3f6c18)[_0xf734('0x3c')]();var _0xc35978=config[_0xf734('0x3d')]['port']||config[_0xf734('0x3e')]+0x1;var _0x4c2a84=config[_0xf734('0x3d')]['ip']||_0xf734('0x3f');_0x1f4e47['on'](_0xf734('0x40'),function(_0x3f6f4a){return _0x7a2cfb(_0x3f6f4a);});_0x1f4e47[_0xf734('0x41')](_0xc35978,_0x4c2a84,function(){console['log'](_0xf734('0x42'),_0x4c2a84,_0xc35978);require(_0xf734('0x43'))['default']();return _0x426923(_0xf734('0x44')+_0x4c2a84+':'+_0xc35978);});});};
\ No newline at end of file
index 5815ea0..5b29b54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f75=['sync','prototype','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','exec','isArray','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setExtension','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','streamFile','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','util','lodash','EventEmitter','./reply','call','utf8','setTimeout','ready','line','toLowerCase','emit','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','replace','indexOf','startsWith','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','sendRequest'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x4f75,0xbb));var _0x54f7=function(_0x436de1,_0x500a38){_0x436de1=_0x436de1-0x0;var _0x8a766f=_0x4f75[_0x436de1];return _0x8a766f;};'use strict';var util=require(_0x54f7('0x0'));var _=require(_0x54f7('0x1'));var EventEmitter=require('events')[_0x54f7('0x2')];var AGIReply=require(_0x54f7('0x3'));var AGIError=require('./error');function AGIChannel(_0x7ffc5f){var _0x383133=this,_0x141cd0=new AGIReply(),_0x328d55=![],_0x11c0c9={};EventEmitter[_0x54f7('0x4')](_0x383133);_0x7ffc5f['setEncoding'](_0x54f7('0x5'));_0x7ffc5f[_0x54f7('0x6')](0x8*0x3c*0x3c*0x3e8);_0x141cd0['setEncoding'](_0x54f7('0x5'));_0x141cd0['on']('headers',function(_0x2cf04d){for(var _0x19609b in _0x2cf04d){_0x383133[_0x19609b]=_0x2cf04d[_0x19609b];}_0x383133['emit'](_0x54f7('0x7'));});_0x141cd0['on'](_0x54f7('0x8'),function(_0x75948a){if(_0x75948a[_0x54f7('0x9')]()=='hangup'){_0x383133[_0x54f7('0xa')]('hangup');return;}if(_0x75948a[_0x54f7('0xb')](0x0,0xb)==_0x54f7('0xc')){_0x328d55=!![];}if(_0x328d55){_0x11c0c9['rx']+=_0x75948a+'\x0a';if(_0x75948a[_0x54f7('0xd')](_0x54f7('0xe'))!=-0x1){_0x328d55=![];}}else{_0x11c0c9['rx']=_0x75948a;}if(_0x328d55){return;}if(typeof _0x11c0c9['cb']==_0x54f7('0xf')){var _0x495ef8=_0x11c0c9['rx']['substring'](0x0,0x3),_0x1ac843=null,_0x52bb74=null;_0x495ef8=parseInt(_0x495ef8);if(isNaN(_0x495ef8)){_0x11c0c9['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x495ef8!=0xc8){_0x11c0c9['cb'](null,{'code':_0x495ef8,'result':-0x1,'extra':'KO'});return;}_0x1ac843=_0x11c0c9['rx'][_0x54f7('0xb')](0x4)[_0x54f7('0x10')]('result=','');if(_0x1ac843['indexOf']('\x20')!=-0x1){_0x1ac843=_0x1ac843['substr'](0x0,_0x1ac843[_0x54f7('0x11')]('\x20'));}if(_[_0x54f7('0x12')](_0x1ac843,'-1')){_0x1ac843=parseInt(_0x1ac843);}_0x52bb74=_0x11c0c9['rx'][_0x54f7('0x13')]('\x20');if(_0x52bb74[_0x54f7('0x14')]==0x3){_0x52bb74=_0x52bb74[0x2][_0x54f7('0xb')](0x1,_0x52bb74[0x2]['length']-0x1);}else if(_0x52bb74[_0x54f7('0x14')]>0x3){var _0x274f30=/\((.+)\)/;var _0x43a286=_0x11c0c9['rx'][_0x54f7('0x15')](_0x274f30);if(_0x43a286){_0x52bb74=_0x43a286[0x1];}else{_0x52bb74=null;}}else{_0x52bb74=null;}_0x11c0c9['cb'](null,{'code':_0x495ef8,'result':_0x1ac843,'extra':_0x52bb74});}});_0x7ffc5f['on'](_0x54f7('0x16'),function(_0x39d7db){_0x383133[_0x54f7('0xa')](_0x54f7('0x16'),new AGIError('E_AGI_SOCKET_ERROR',_0x39d7db[_0x54f7('0x17')]));});_0x7ffc5f['on'](_0x54f7('0x18'),function(){_0x383133[_0x54f7('0xa')](_0x54f7('0x18'),new AGIError(_0x54f7('0x19')));});_0x7ffc5f['on'](_0x54f7('0x1a'),function(){_0x383133[_0x54f7('0xa')](_0x54f7('0x1a'),new AGIError(_0x54f7('0x1b')));_0x7ffc5f[_0x54f7('0x1c')]();});_0x7ffc5f[_0x54f7('0x1d')](_0x141cd0);this[_0x54f7('0x1e')]=function(_0x39430d,_0x52ff22){var _0x39430d=_0x39430d||'',_0x52ff22=typeof _0x52ff22==_0x54f7('0xf')?_0x52ff22:new Function();_0x11c0c9={'tx':_0x39430d,'rx':'','cb':_0x52ff22};_0x7ffc5f['write'](_0x39430d+'\x0a');},this[_0x54f7('0x18')]=function(){_0x7ffc5f[_0x54f7('0x1c')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x54f7('0x1f')]=function(_0x1a449f){return this[_0x54f7('0x1e')][_0x54f7('0x20')](this,_0x1a449f);};AGIChannel[_0x54f7('0x21')]['answer']=function(){return this[_0x54f7('0x1f')](_0x54f7('0x22'));};AGIChannel[_0x54f7('0x21')][_0x54f7('0x23')]=function(_0x24da0c,_0x597540,_0x3aa132){_0x24da0c=_0x24da0c===undefined?_0x54f7('0x24'):_0x24da0c;_0x597540=_0x597540===undefined?'5':_0x597540;_0x3aa132=_0x3aa132===undefined?'1':_0x3aa132;return this[_0x54f7('0x1f')](util[_0x54f7('0x25')](_0x54f7('0x26'),_0x24da0c,_0x597540*0x3e8,_0x3aa132));};AGIChannel[_0x54f7('0x21')][_0x54f7('0x27')]=function(_0xb2bc0f){_0xb2bc0f=_0xb2bc0f||_0x54f7('0x28');return this['sendRequest'](util[_0x54f7('0x25')]('VERBOSE\x20\x22%s\x22',_0xb2bc0f));};AGIChannel['prototype'][_0x54f7('0x29')]=function(_0x1fe06a,_0x409c6f){if(_[_0x54f7('0x2a')](_0x409c6f)){return this['sendRequest'](util['format'](_0x54f7('0x2b'),_0x1fe06a,_0x409c6f[_0x54f7('0x2c')](',')));}return this[_0x54f7('0x1f')](util[_0x54f7('0x25')]('EXEC\x20%s\x20%s',_0x1fe06a,_0x409c6f));};AGIChannel[_0x54f7('0x21')]['setContext']=function(_0x650877){return this[_0x54f7('0x1f')](util[_0x54f7('0x25')](_0x54f7('0x2d'),_0x650877));};AGIChannel[_0x54f7('0x21')]['setExtension']=function(_0x18dfa5){return this[_0x54f7('0x1f')](util[_0x54f7('0x25')](_0x54f7('0x2e'),_0x18dfa5));};AGIChannel[_0x54f7('0x21')]['setPriority']=function(_0x548128){return this['sendRequest'](util[_0x54f7('0x25')](_0x54f7('0x2f'),_0x548128));};AGIChannel[_0x54f7('0x21')]['hangup']=function(){return this[_0x54f7('0x1f')](_0x54f7('0x30'));};AGIChannel[_0x54f7('0x21')][_0x54f7('0x31')]=function(_0x410f39,_0x1bfb08){var _0x417139=_['isBoolean'](_0x1bfb08)||_[_0x54f7('0x32')](_0x1bfb08)?_0x1bfb08[_0x54f7('0x33')]():_0x1bfb08;return this[_0x54f7('0x1f')](util[_0x54f7('0x25')](_0x54f7('0x34'),_0x410f39,_0x417139?_0x417139[_0x54f7('0x33')]()[_0x54f7('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x54f7('0x21')][_0x54f7('0x35')]=function(_0x3d49ac,_0x1c4ee5){return this[_0x54f7('0x1f')](util[_0x54f7('0x25')](_0x54f7('0x36'),_0x3d49ac,_0x1c4ee5));};AGIChannel['prototype']['sayDigits']=function(_0x3b2602,_0x42c4b5){return this['sendRequest'](util[_0x54f7('0x25')](_0x54f7('0x37'),_0x3b2602,_0x42c4b5));};AGIChannel['prototype']['sayPhonetic']=function(_0xb9c753,_0x469bf9){return this[_0x54f7('0x1f')](util[_0x54f7('0x25')](_0x54f7('0x38'),_0xb9c753,_0x469bf9));};AGIChannel[_0x54f7('0x21')][_0x54f7('0x39')]=function(_0x3e96c5,_0x364a29,_0x373dae){_0x364a29=_0x364a29||this[_0x54f7('0x3a')];_0x373dae=_0x373dae||0x1;this['setContext'](_0x3e96c5);this[_0x54f7('0x3b')](_0x364a29);this[_0x54f7('0x3c')](_0x373dae);return this['noop'](util[_0x54f7('0x25')](_0x54f7('0x3d'),_0x3e96c5,_0x364a29,_0x373dae));};AGIChannel[_0x54f7('0x21')][_0x54f7('0x3e')]=function(_0x535f89){return this[_0x54f7('0x1f')](util[_0x54f7('0x25')](_0x54f7('0x3f'),_0x535f89));};AGIChannel[_0x54f7('0x21')][_0x54f7('0x40')]=function(_0x145b52,_0x121b62,_0x2f17c1,_0xa4161b,_0x206ce2,_0x48c4d9){_0x121b62=_0x121b62||_0x54f7('0x41');_0x2f17c1=_0x2f17c1||'';_0xa4161b=_0xa4161b===undefined?-0x1:_0xa4161b==='-1'?-0x1:_0xa4161b*0x3e8;_0x206ce2=_0x206ce2===undefined?'':'s='+_0x206ce2;_0x48c4d9=_0x48c4d9?_0x54f7('0x42'):'';return this[_0x54f7('0x1f')](util[_0x54f7('0x25')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x145b52,_0x121b62,_0x2f17c1,_0xa4161b,_0x48c4d9,_0x206ce2));};AGIChannel[_0x54f7('0x21')][_0x54f7('0x43')]=function(_0x5322e7,_0x135904){_0x135904=_0x135904||'';return this[_0x54f7('0x1f')](util[_0x54f7('0x25')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x5322e7,_0x135904));};AGIChannel[_0x54f7('0x21')][_0x54f7('0x44')]=function(_0x22db56){return this['exec'](_0x54f7('0x45'),_0x22db56);};AGIChannel['prototype'][_0x54f7('0x46')]=function(_0x899494){return this[_0x54f7('0x29')](_0x54f7('0x47'),_0x899494);};AGIChannel['prototype'][_0x54f7('0x16')]=function(_0x3884f3,_0x5ad8d7){this[_0x54f7('0x27')](util[_0x54f7('0x25')](_0x54f7('0x48'),_0x3884f3['id'],_0x3884f3['label'],_0x5ad8d7));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel;
\ No newline at end of file
+var _0x5c0e=['length','match','error','close','E_AGI_SOCKET_CLOSE','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','inherits','prototype','sendRequest','answer','beep','format','NO\x20MESSAGE','exec','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','replace','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','extension','noop','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','label','exports','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','setTimeout','utf8','headers','emit','line','toLowerCase','hangup','substring','520-Invalid','search','function','result=','indexOf','substr','startsWith'];(function(_0x197ec2,_0xed493){var _0x14af7c=function(_0x1c0a92){while(--_0x1c0a92){_0x197ec2['push'](_0x197ec2['shift']());}};_0x14af7c(++_0xed493);}(_0x5c0e,0x160));var _0xe5c0=function(_0x42184d,_0x264f92){_0x42184d=_0x42184d-0x0;var _0x144722=_0x5c0e[_0x42184d];return _0x144722;};'use strict';var util=require(_0xe5c0('0x0'));var _=require(_0xe5c0('0x1'));var EventEmitter=require(_0xe5c0('0x2'))[_0xe5c0('0x3')];var AGIReply=require(_0xe5c0('0x4'));var AGIError=require(_0xe5c0('0x5'));function AGIChannel(_0x36decd){var _0x50f25a=this,_0x361b5d=new AGIReply(),_0x4c9bf9=![],_0x43fb02={};EventEmitter[_0xe5c0('0x6')](_0x50f25a);_0x36decd[_0xe5c0('0x7')]('utf8');_0x36decd[_0xe5c0('0x8')](0x8*0x3c*0x3c*0x3e8);_0x361b5d[_0xe5c0('0x7')](_0xe5c0('0x9'));_0x361b5d['on'](_0xe5c0('0xa'),function(_0x1148ef){for(var _0x21edb1 in _0x1148ef){_0x50f25a[_0x21edb1]=_0x1148ef[_0x21edb1];}_0x50f25a[_0xe5c0('0xb')]('ready');});_0x361b5d['on'](_0xe5c0('0xc'),function(_0x504c36){if(_0x504c36[_0xe5c0('0xd')]()==_0xe5c0('0xe')){_0x50f25a['emit'](_0xe5c0('0xe'));return;}if(_0x504c36[_0xe5c0('0xf')](0x0,0xb)==_0xe5c0('0x10')){_0x4c9bf9=!![];}if(_0x4c9bf9){_0x43fb02['rx']+=_0x504c36+'\x0a';if(_0x504c36[_0xe5c0('0x11')]('520\x20End\x20of\x20proper')!=-0x1){_0x4c9bf9=![];}}else{_0x43fb02['rx']=_0x504c36;}if(_0x4c9bf9){return;}if(typeof _0x43fb02['cb']==_0xe5c0('0x12')){var _0x5bedb7=_0x43fb02['rx'][_0xe5c0('0xf')](0x0,0x3),_0x9afa6f=null,_0x25b01f=null;_0x5bedb7=parseInt(_0x5bedb7);if(isNaN(_0x5bedb7)){_0x43fb02['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x5bedb7!=0xc8){_0x43fb02['cb'](null,{'code':_0x5bedb7,'result':-0x1,'extra':'KO'});return;}_0x9afa6f=_0x43fb02['rx'][_0xe5c0('0xf')](0x4)['replace'](_0xe5c0('0x13'),'');if(_0x9afa6f[_0xe5c0('0x14')]('\x20')!=-0x1){_0x9afa6f=_0x9afa6f[_0xe5c0('0x15')](0x0,_0x9afa6f[_0xe5c0('0x14')]('\x20'));}if(_[_0xe5c0('0x16')](_0x9afa6f,'-1')){_0x9afa6f=parseInt(_0x9afa6f);}_0x25b01f=_0x43fb02['rx']['split']('\x20');if(_0x25b01f['length']==0x3){_0x25b01f=_0x25b01f[0x2][_0xe5c0('0xf')](0x1,_0x25b01f[0x2][_0xe5c0('0x17')]-0x1);}else if(_0x25b01f[_0xe5c0('0x17')]>0x3){var _0x3f85f4=/\((.+)\)/;var _0x3687d7=_0x43fb02['rx'][_0xe5c0('0x18')](_0x3f85f4);if(_0x3687d7){_0x25b01f=_0x3687d7[0x1];}else{_0x25b01f=null;}}else{_0x25b01f=null;}_0x43fb02['cb'](null,{'code':_0x5bedb7,'result':_0x9afa6f,'extra':_0x25b01f});}});_0x36decd['on'](_0xe5c0('0x19'),function(_0x42e62a){_0x50f25a['emit'](_0xe5c0('0x19'),new AGIError('E_AGI_SOCKET_ERROR',_0x42e62a['code']));});_0x36decd['on']('close',function(){_0x50f25a[_0xe5c0('0xb')](_0xe5c0('0x1a'),new AGIError(_0xe5c0('0x1b')));});_0x36decd['on']('timeout',function(){_0x50f25a[_0xe5c0('0xb')]('timeout',new AGIError(_0xe5c0('0x1c')));_0x36decd[_0xe5c0('0x1d')]();});_0x36decd[_0xe5c0('0x1e')](_0x361b5d);this[_0xe5c0('0x1f')]=function(_0x4b1a21,_0x10e25c){var _0x4b1a21=_0x4b1a21||'',_0x10e25c=typeof _0x10e25c==_0xe5c0('0x12')?_0x10e25c:new Function();_0x43fb02={'tx':_0x4b1a21,'rx':'','cb':_0x10e25c};_0x36decd['write'](_0x4b1a21+'\x0a');},this[_0xe5c0('0x1a')]=function(){_0x36decd[_0xe5c0('0x1d')]();};}util[_0xe5c0('0x20')](AGIChannel,EventEmitter);AGIChannel[_0xe5c0('0x21')][_0xe5c0('0x22')]=function(_0xb8cdf0){return this[_0xe5c0('0x1f')]['sync'](this,_0xb8cdf0);};AGIChannel[_0xe5c0('0x21')][_0xe5c0('0x23')]=function(){return this[_0xe5c0('0x22')]('ANSWER');};AGIChannel[_0xe5c0('0x21')]['getData']=function(_0x40109a,_0x322f41,_0x7a4dbe){_0x40109a=_0x40109a===undefined?_0xe5c0('0x24'):_0x40109a;_0x322f41=_0x322f41===undefined?'5':_0x322f41;_0x7a4dbe=_0x7a4dbe===undefined?'1':_0x7a4dbe;return this['sendRequest'](util[_0xe5c0('0x25')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x40109a,_0x322f41*0x3e8,_0x7a4dbe));};AGIChannel[_0xe5c0('0x21')]['noop']=function(_0x2c64bf){_0x2c64bf=_0x2c64bf||_0xe5c0('0x26');return this[_0xe5c0('0x22')](util[_0xe5c0('0x25')]('VERBOSE\x20\x22%s\x22',_0x2c64bf));};AGIChannel[_0xe5c0('0x21')][_0xe5c0('0x27')]=function(_0x1ca89f,_0x4d1262){if(_['isArray'](_0x4d1262)){return this['sendRequest'](util[_0xe5c0('0x25')](_0xe5c0('0x28'),_0x1ca89f,_0x4d1262[_0xe5c0('0x29')](',')));}return this[_0xe5c0('0x22')](util[_0xe5c0('0x25')](_0xe5c0('0x28'),_0x1ca89f,_0x4d1262));};AGIChannel[_0xe5c0('0x21')][_0xe5c0('0x2a')]=function(_0x2816cc){return this[_0xe5c0('0x22')](util[_0xe5c0('0x25')](_0xe5c0('0x2b'),_0x2816cc));};AGIChannel['prototype'][_0xe5c0('0x2c')]=function(_0x18098e){return this[_0xe5c0('0x22')](util[_0xe5c0('0x25')](_0xe5c0('0x2d'),_0x18098e));};AGIChannel[_0xe5c0('0x21')][_0xe5c0('0x2e')]=function(_0x4b99ea){return this[_0xe5c0('0x22')](util[_0xe5c0('0x25')](_0xe5c0('0x2f'),_0x4b99ea));};AGIChannel[_0xe5c0('0x21')][_0xe5c0('0xe')]=function(){return this[_0xe5c0('0x22')](_0xe5c0('0x30'));};AGIChannel[_0xe5c0('0x21')]['setVariable']=function(_0x2984f1,_0x4eed0e){var _0x1a2fff=_[_0xe5c0('0x31')](_0x4eed0e)||_[_0xe5c0('0x32')](_0x4eed0e)?_0x4eed0e[_0xe5c0('0x33')]():_0x4eed0e;return this[_0xe5c0('0x22')](util['format'](_0xe5c0('0x34'),_0x2984f1,_0x1a2fff?_0x1a2fff[_0xe5c0('0x33')]()[_0xe5c0('0x35')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xe5c0('0x21')][_0xe5c0('0x36')]=function(_0x360490,_0xfcba56){return this[_0xe5c0('0x22')](util[_0xe5c0('0x25')](_0xe5c0('0x37'),_0x360490,_0xfcba56));};AGIChannel[_0xe5c0('0x21')][_0xe5c0('0x38')]=function(_0x279fcf,_0x4241d4){return this[_0xe5c0('0x22')](util[_0xe5c0('0x25')](_0xe5c0('0x39'),_0x279fcf,_0x4241d4));};AGIChannel[_0xe5c0('0x21')][_0xe5c0('0x3a')]=function(_0x5b11c6,_0x21f03c){return this[_0xe5c0('0x22')](util[_0xe5c0('0x25')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x5b11c6,_0x21f03c));};AGIChannel['prototype'][_0xe5c0('0x3b')]=function(_0x4c70ff,_0x24145b,_0x1ab408){_0x24145b=_0x24145b||this[_0xe5c0('0x3c')];_0x1ab408=_0x1ab408||0x1;this[_0xe5c0('0x2a')](_0x4c70ff);this['setExtension'](_0x24145b);this[_0xe5c0('0x2e')](_0x1ab408);return this[_0xe5c0('0x3d')](util[_0xe5c0('0x25')](_0xe5c0('0x3e'),_0x4c70ff,_0x24145b,_0x1ab408));};AGIChannel['prototype'][_0xe5c0('0x3f')]=function(_0x5ac1a4){return this['sendRequest'](util[_0xe5c0('0x25')](_0xe5c0('0x40'),_0x5ac1a4));};AGIChannel[_0xe5c0('0x21')][_0xe5c0('0x41')]=function(_0x277f1b,_0xe467dc,_0x40c139,_0x479875,_0x5c1218,_0xd8f47e){_0xe467dc=_0xe467dc||_0xe5c0('0x42');_0x40c139=_0x40c139||'';_0x479875=_0x479875===undefined?-0x1:_0x479875==='-1'?-0x1:_0x479875*0x3e8;_0x5c1218=_0x5c1218===undefined?'':'s='+_0x5c1218;_0xd8f47e=_0xd8f47e?'BEEP':'';return this[_0xe5c0('0x22')](util['format'](_0xe5c0('0x43'),_0x277f1b,_0xe467dc,_0x40c139,_0x479875,_0xd8f47e,_0x5c1218));};AGIChannel[_0xe5c0('0x21')][_0xe5c0('0x44')]=function(_0x55a735,_0xb12e2e){_0xb12e2e=_0xb12e2e||'';return this['sendRequest'](util[_0xe5c0('0x25')](_0xe5c0('0x45'),_0x55a735,_0xb12e2e));};AGIChannel['prototype'][_0xe5c0('0x46')]=function(_0x48d188){return this[_0xe5c0('0x27')](_0xe5c0('0x47'),_0x48d188);};AGIChannel[_0xe5c0('0x21')][_0xe5c0('0x48')]=function(_0x40e879){return this['exec']('WAIT',_0x40e879);};AGIChannel['prototype'][_0xe5c0('0x19')]=function(_0x37107e,_0x16a9a5){this[_0xe5c0('0x3d')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x37107e['id'],_0x37107e[_0xe5c0('0x49')],_0x16a9a5));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xe5c0('0x4a')]=AGIChannel;
\ No newline at end of file
index 6d2c650..fc605a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf253=['Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xf253,0x105));var _0x3f25=function(_0x5229bb,_0x4b17f5){_0x5229bb=_0x5229bb-0x0;var _0x15db9b=_0xf253[_0x5229bb];return _0x15db9b;};'use strict';var util=require(_0x3f25('0x0'));var error={'E_AGI_UNDEFINED':_0x3f25('0x1'),'E_AGI_ARGUMENT_PORT':_0x3f25('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x3f25('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x3f25('0x4'),'E_AGI_SOCKET_ERROR':_0x3f25('0x5'),'E_AGI_SOCKET_CLOSE':_0x3f25('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x3f25('0x7'),'E_AGI_COMMAND_EMPTY':_0x3f25('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x3f25('0x9'),'E_AGI_IVR_ENTRY':_0x3f25('0xa')};function AGIError(_0x207165){var _0x207165=_0x207165||null,_0x1715aa=_0x1715aa||[],_0x5ef2c7=0x1,_0x21e3db='';if(!error[_0x207165]){_0x207165=_0x3f25('0xb');}_0x1715aa[_0x3f25('0xc')](error[_0x207165]);while(arguments[_0x5ef2c7]){_0x1715aa['push'](arguments[_0x5ef2c7]);_0x5ef2c7++;}_0x21e3db=util['format']['apply'](util,_0x1715aa);this['message']=_0x21e3db;this[_0x3f25('0xd')]=_0x207165;}module[_0x3f25('0xe')]=AGIError;
\ No newline at end of file
+var _0x3b2c=['Socket\x20error.\x20Code:\x20%s.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','apply','message','name','exports','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.'];(function(_0x2e1972,_0x58c521){var _0x94632d=function(_0x3cd50d){while(--_0x3cd50d){_0x2e1972['push'](_0x2e1972['shift']());}};_0x94632d(++_0x58c521);}(_0x3b2c,0x175));var _0xc3b2=function(_0x12a4e2,_0x20fcb3){_0x12a4e2=_0x12a4e2-0x0;var _0x49f003=_0x3b2c[_0x12a4e2];return _0x49f003;};'use strict';var util=require(_0xc3b2('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0xc3b2('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xc3b2('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0xc3b2('0x3'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xc3b2('0x4'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xc3b2('0x5'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xc3b2('0x6'),'E_AGI_IVR_ENTRY':_0xc3b2('0x7')};function AGIError(_0x3a414a){var _0x3a414a=_0x3a414a||null,_0x2316a8=_0x2316a8||[],_0xe9e0ff=0x1,_0x5a9509='';if(!error[_0x3a414a]){_0x3a414a='E_AGI_UNDEFINED';}_0x2316a8[_0xc3b2('0x8')](error[_0x3a414a]);while(arguments[_0xe9e0ff]){_0x2316a8[_0xc3b2('0x8')](arguments[_0xe9e0ff]);_0xe9e0ff++;}_0x5a9509=util['format'][_0xc3b2('0x9')](util,_0x2316a8);this[_0xc3b2('0xa')]=_0x5a9509;this[_0xc3b2('0xb')]=_0x3a414a;}module[_0xc3b2('0xc')]=AGIError;
\ No newline at end of file
index 300b5df..56caf57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6076=['agi','emit','error','E_AGI_SERVER_ERROR','projectUpdate','lodash','events','EventEmitter','ioredis','./error','../../config/environment','redis','defaults','localhost'];(function(_0x170f7e,_0x1f444a){var _0x54aca1=function(_0x3fce86){while(--_0x3fce86){_0x170f7e['push'](_0x170f7e['shift']());}};_0x54aca1(++_0x1f444a);}(_0x6076,0x163));var _0x6607=function(_0x521a8b,_0x3dfc1c){_0x521a8b=_0x521a8b-0x0;var _0x30d8f9=_0x6076[_0x521a8b];return _0x30d8f9;};'use strict';var _=require(_0x6607('0x0'));var EventEmitter=require(_0x6607('0x1'))[_0x6607('0x2')];var Redis=require(_0x6607('0x3'));var AGIError=require(_0x6607('0x4'));var config=require(_0x6607('0x5'));config[_0x6607('0x6')]=_[_0x6607('0x7')](config[_0x6607('0x6')],{'host':_0x6607('0x8'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x6607('0x6')]);sub['subscribe'](_0x6607('0x9'),function(_0x429cbb){if(_0x429cbb)return eventEmitter[_0x6607('0xa')](_0x6607('0xb'),new AGIError(_0x6607('0xc'),_0x429cbb));});sub['on']('message',function(_0x200589,_0x34c365){if(_0x200589!==_0x6607('0x9'))return;try{var _0x4e9f0b=JSON['parse'](_0x34c365);eventEmitter[_0x6607('0xa')](_0x6607('0xd'),_0x4e9f0b);}catch(_0x22d1ba){eventEmitter[_0x6607('0xa')](_0x6607('0xb'),new AGIError(_0x6607('0xc'),_0x22d1ba));}});module['exports']={'EventEmitter':eventEmitter};
\ No newline at end of file
+var _0x10f3=['../../config/environment','redis','defaults','localhost','subscribe','agi','emit','error','E_AGI_SERVER_ERROR','parse','exports','lodash','events','EventEmitter','ioredis','./error'];(function(_0x5aa9a7,_0x36662a){var _0x4f11b6=function(_0x98f1a1){while(--_0x98f1a1){_0x5aa9a7['push'](_0x5aa9a7['shift']());}};_0x4f11b6(++_0x36662a);}(_0x10f3,0xbb));var _0x310f=function(_0xf75c37,_0x2fa1c7){_0xf75c37=_0xf75c37-0x0;var _0x568a1f=_0x10f3[_0xf75c37];return _0x568a1f;};'use strict';var _=require(_0x310f('0x0'));var EventEmitter=require(_0x310f('0x1'))[_0x310f('0x2')];var Redis=require(_0x310f('0x3'));var AGIError=require(_0x310f('0x4'));var config=require(_0x310f('0x5'));config[_0x310f('0x6')]=_[_0x310f('0x7')](config['redis'],{'host':_0x310f('0x8'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x310f('0x6')]);sub[_0x310f('0x9')](_0x310f('0xa'),function(_0x5b75af){if(_0x5b75af)return eventEmitter[_0x310f('0xb')](_0x310f('0xc'),new AGIError(_0x310f('0xd'),_0x5b75af));});sub['on']('message',function(_0x26b6ca,_0x512359){if(_0x26b6ca!==_0x310f('0xa'))return;try{var _0x7201d0=JSON[_0x310f('0xe')](_0x512359);eventEmitter['emit']('projectUpdate',_0x7201d0);}catch(_0x46ed07){eventEmitter[_0x310f('0xb')](_0x310f('0xc'),new AGIError(_0x310f('0xd'),_0x46ed07));}});module[_0x310f('0xf')]={'EventEmitter':eventEmitter};
\ No newline at end of file
index 402a7ae..b1f75f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4ca=['prototype','no\x20vertex\x20found','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','vswitch','target','default','agicommand','menu','invalid','traverseBFS','default\x20on\x20switch\x20not\x20found','includes','condition\x20not\x20found','exports','../../../config/logger','agi','getdigits','vertices','edges','numberOfEdges','addVertex','push','size'];(function(_0x2637ac,_0x377857){var _0x4a5758=function(_0x5d5043){while(--_0x5d5043){_0x2637ac['push'](_0x2637ac['shift']());}};_0x4a5758(++_0x377857);}(_0xb4ca,0x1b7));var _0xab4c=function(_0x2ae279,_0x1b1d57){_0x2ae279=_0x2ae279-0x0;var _0x48ad35=_0xb4ca[_0x2ae279];return _0x48ad35;};'use strict';var _=require('lodash');var logger=require(_0xab4c('0x0'))(_0xab4c('0x1'));var verticesWithRetry=['menu',_0xab4c('0x2'),'getsecretdigits'];var Graph=function(){this[_0xab4c('0x3')]={};this[_0xab4c('0x4')]={};this[_0xab4c('0x5')]=0x0;};Graph['prototype'][_0xab4c('0x6')]=function(_0x962b7b){this[_0xab4c('0x3')][_0x962b7b['id']]=_0x962b7b;this[_0xab4c('0x4')][_0x962b7b['id']]=[];};Graph['prototype']['addEdge']=function(_0x83a234,_0x57c26c,_0x11ff46){this[_0xab4c('0x4')][_0x83a234][_0xab4c('0x7')]({'target':_0x57c26c,'condition':_0x11ff46});this[_0xab4c('0x5')]+=0x1;};Graph['prototype']['size']=function(){return _[_0xab4c('0x8')](this[_0xab4c('0x3')]);};Graph['prototype']['relations']=function(){return this['numberOfEdges'];};Graph[_0xab4c('0x9')]['getVertex']=function(_0x5a382f){return this[_0xab4c('0x3')][_0x5a382f];};Graph[_0xab4c('0x9')]['traverseBFS']=function(_0x13607f,_0x29f475){if(!this[_0xab4c('0x3')][_0x13607f]){return logger['info'](_0xab4c('0xa'));}var _0x11e6d4=_0x29f475(this[_0xab4c('0x3')][_0x13607f]);if(!_0x11e6d4){return logger[_0xab4c('0xb')](_0xab4c('0xc'));}if(this[_0xab4c('0x4')][_0x13607f][_0xab4c('0xd')]===0x0){return logger[_0xab4c('0xb')](_0xab4c('0xe'));}for(var _0x4e8e19=0x0,_0x6d2437=[],_0x2f6238=![];_0x4e8e19<this['edges'][_0x13607f][_0xab4c('0xd')];_0x4e8e19+=0x1){if(this['edges'][_0x13607f][_0x4e8e19][_0xab4c('0xf')]){_0x6d2437=this['edges'][_0x13607f][_0x4e8e19][_0xab4c('0xf')][_0xab4c('0x10')](',');for(var _0x21b752=0x0;_0x21b752<_0x6d2437[_0xab4c('0xd')];_0x21b752+=0x1){if(this[_0xab4c('0x3')][_0x13607f]['agicommand']===_0xab4c('0x11')&&_0x6d2437[_0x21b752]==='-'){_0x2f6238=this[_0xab4c('0x4')][_0x13607f][_0x4e8e19][_0xab4c('0x12')];logger[_0xab4c('0xb')](_0xab4c('0x13'),_0x6d2437[_0x21b752],this['edges'][_0x13607f][_0x4e8e19][_0xab4c('0x12')]);}else if(this[_0xab4c('0x3')][_0x13607f][_0xab4c('0x14')]===_0xab4c('0x15')&&_0x6d2437[_0x21b752]==='i'){_0x2f6238=this[_0xab4c('0x4')][_0x13607f][_0x4e8e19]['target'];logger[_0xab4c('0xb')](_0xab4c('0x16'),_0x6d2437[_0x21b752],this[_0xab4c('0x4')][_0x13607f][_0x4e8e19][_0xab4c('0x12')]);}if(_0x6d2437[_0x21b752]===_0x11e6d4){return this[_0xab4c('0x17')](this[_0xab4c('0x4')][_0x13607f][_0x4e8e19]['target'],_0x29f475);}}}else{return this[_0xab4c('0x17')](this[_0xab4c('0x4')][_0x13607f][_0x4e8e19][_0xab4c('0x12')],_0x29f475);}}if(_0x6d2437['length']){if(this[_0xab4c('0x3')][_0x13607f][_0xab4c('0x14')]===_0xab4c('0x11')){if(_0x2f6238){return this[_0xab4c('0x17')](_0x2f6238,_0x29f475);}return logger[_0xab4c('0xb')](_0xab4c('0x18'));}else if(_[_0xab4c('0x19')](verticesWithRetry,this['vertices'][_0x13607f][_0xab4c('0x14')])){if(_0x11e6d4==='-'){return logger[_0xab4c('0xb')]('max\x20retry\x20reach');}if(_0x2f6238&&_0x11e6d4!=='t'){return this[_0xab4c('0x17')](_0x2f6238,_0x29f475);}return this[_0xab4c('0x17')](_0x13607f,_0x29f475);}return logger['info'](_0xab4c('0x1a'));}};module[_0xab4c('0x1b')]=Graph;
\ No newline at end of file
+var _0x97a0=['menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','push','size','relations','getVertex','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','vswitch','target','default','agicommand','invalid','traverseBFS','default\x20on\x20switch\x20not\x20found','includes','condition\x20not\x20found','exports','lodash','../../../config/logger','agi'];(function(_0x2074db,_0x10b81b){var _0x27324c=function(_0x5c3d5c){while(--_0x5c3d5c){_0x2074db['push'](_0x2074db['shift']());}};_0x27324c(++_0x10b81b);}(_0x97a0,0x171));var _0x097a=function(_0x12dc86,_0x295ab1){_0x12dc86=_0x12dc86-0x0;var _0x400c6f=_0x97a0[_0x12dc86];return _0x400c6f;};'use strict';var _=require(_0x097a('0x0'));var logger=require(_0x097a('0x1'))(_0x097a('0x2'));var verticesWithRetry=[_0x097a('0x3'),_0x097a('0x4'),_0x097a('0x5')];var Graph=function(){this[_0x097a('0x6')]={};this[_0x097a('0x7')]={};this[_0x097a('0x8')]=0x0;};Graph[_0x097a('0x9')][_0x097a('0xa')]=function(_0x3a0ab0){this[_0x097a('0x6')][_0x3a0ab0['id']]=_0x3a0ab0;this[_0x097a('0x7')][_0x3a0ab0['id']]=[];};Graph[_0x097a('0x9')]['addEdge']=function(_0x56d515,_0x28bacc,_0xae9272){this[_0x097a('0x7')][_0x56d515][_0x097a('0xb')]({'target':_0x28bacc,'condition':_0xae9272});this[_0x097a('0x8')]+=0x1;};Graph[_0x097a('0x9')]['size']=function(){return _[_0x097a('0xc')](this[_0x097a('0x6')]);};Graph[_0x097a('0x9')][_0x097a('0xd')]=function(){return this[_0x097a('0x8')];};Graph['prototype'][_0x097a('0xe')]=function(_0x433f52){return this[_0x097a('0x6')][_0x433f52];};Graph[_0x097a('0x9')]['traverseBFS']=function(_0x376e65,_0x25c302){if(!this[_0x097a('0x6')][_0x376e65]){return logger[_0x097a('0xf')](_0x097a('0x10'));}var _0x357c9e=_0x25c302(this[_0x097a('0x6')][_0x376e65]);if(!_0x357c9e){return logger[_0x097a('0xf')](_0x097a('0x11'));}if(this[_0x097a('0x7')][_0x376e65][_0x097a('0x12')]===0x0){return logger['info'](_0x097a('0x13'));}for(var _0x48b626=0x0,_0x25d5b5=[],_0x5dd556=![];_0x48b626<this[_0x097a('0x7')][_0x376e65][_0x097a('0x12')];_0x48b626+=0x1){if(this['edges'][_0x376e65][_0x48b626][_0x097a('0x14')]){_0x25d5b5=this[_0x097a('0x7')][_0x376e65][_0x48b626][_0x097a('0x14')]['split'](',');for(var _0x408769=0x0;_0x408769<_0x25d5b5[_0x097a('0x12')];_0x408769+=0x1){if(this[_0x097a('0x6')][_0x376e65]['agicommand']===_0x097a('0x15')&&_0x25d5b5[_0x408769]==='-'){_0x5dd556=this[_0x097a('0x7')][_0x376e65][_0x48b626][_0x097a('0x16')];logger[_0x097a('0xf')](_0x097a('0x17'),_0x25d5b5[_0x408769],this['edges'][_0x376e65][_0x48b626][_0x097a('0x16')]);}else if(this['vertices'][_0x376e65][_0x097a('0x18')]===_0x097a('0x3')&&_0x25d5b5[_0x408769]==='i'){_0x5dd556=this[_0x097a('0x7')][_0x376e65][_0x48b626][_0x097a('0x16')];logger[_0x097a('0xf')](_0x097a('0x19'),_0x25d5b5[_0x408769],this['edges'][_0x376e65][_0x48b626][_0x097a('0x16')]);}if(_0x25d5b5[_0x408769]===_0x357c9e){return this['traverseBFS'](this[_0x097a('0x7')][_0x376e65][_0x48b626]['target'],_0x25c302);}}}else{return this['traverseBFS'](this[_0x097a('0x7')][_0x376e65][_0x48b626][_0x097a('0x16')],_0x25c302);}}if(_0x25d5b5[_0x097a('0x12')]){if(this['vertices'][_0x376e65][_0x097a('0x18')]===_0x097a('0x15')){if(_0x5dd556){return this[_0x097a('0x1a')](_0x5dd556,_0x25c302);}return logger[_0x097a('0xf')](_0x097a('0x1b'));}else if(_[_0x097a('0x1c')](verticesWithRetry,this[_0x097a('0x6')][_0x376e65][_0x097a('0x18')])){if(_0x357c9e==='-'){return logger['info']('max\x20retry\x20reach');}if(_0x5dd556&&_0x357c9e!=='t'){return this[_0x097a('0x1a')](_0x5dd556,_0x25c302);}return this[_0x097a('0x1a')](_0x376e65,_0x25c302);}return logger[_0x097a('0xf')](_0x097a('0x1d'));}};module[_0x097a('0x1e')]=Graph;
\ No newline at end of file
index 8cddf0f..28194a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0d5=['port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','error','[%s]\x20%s','name','[ERROR]\x20%s','stack','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[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','hasOwnProperty','indexOf','substring','debug','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','handleNotFound','production','handleUnpublished','initialize','getLicense','callysquare','[LICENSE]\x20VOICE\x20IS\x20DISABLED','catch','[LICENSE]','finally','./server','connection','syncho','util','../../config/environment','../../config/license/util','./rpc','EventEmitter','agi','defaults','127.0.0.1','projectUpdate','nextTick','deleted','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!'];(function(_0x438e00,_0x2ad474){var _0xd1098=function(_0x5e5708){while(--_0x5e5708){_0x438e00['push'](_0x438e00['shift']());}};_0xd1098(++_0x2ad474);}(_0xb0d5,0x1f2));var _0x5b0d=function(_0x454d94,_0x2d5642){_0x454d94=_0x454d94-0x0;var _0x1389b0=_0xb0d5[_0x454d94];return _0x1389b0;};'use strict';var _=require('lodash');var syncho=require(_0x5b0d('0x0'));var util=require(_0x5b0d('0x1'));var config=require(_0x5b0d('0x2'));var logger=require('../../config/logger')('agi');var utilLicense=require(_0x5b0d('0x3'));var rpc=require(_0x5b0d('0x4'));var Project=require('./project');var AGIEmitter=require('./events')[_0x5b0d('0x5')];var projects=[];config[_0x5b0d('0x6')]=_[_0x5b0d('0x7')](config['agi'],{'ip':_0x5b0d('0x8'),'port':0x11dd});AGIEmitter['on'](_0x5b0d('0x9'),projectUpdateHandler);function connectionHandler(_0x1ff40c){process[_0x5b0d('0xa')](function(){syncho(function(){try{setChannelVariables(_0x1ff40c);agiHandler(_0x1ff40c);}catch(_0x501015){logger['error'](_0x501015['stack']);}});});}function projectUpdateHandler(_0x5103f9){try{var _0x344e74=_['findIndex'](projects,['id',_0x5103f9['id']]);if(_0x344e74>-0x1){if(_0x5103f9[_0x5b0d('0xb')]===!![]){projects['splice'](_0x344e74,0x1);}else{projects[_0x344e74]=_0x5103f9;}}else{projects[_0x5b0d('0xc')](_0x5103f9);}}catch(_0xa18357){logger['error'](_0xa18357['stack']);}}function listeningHandler(){console[_0x5b0d('0xd')](_0x5b0d('0xe'),config['agi'][_0x5b0d('0xf')]);logger[_0x5b0d('0x10')](util[_0x5b0d('0x11')](_0x5b0d('0x12'),config[_0x5b0d('0x6')]['ip'],config[_0x5b0d('0x6')][_0x5b0d('0xf')]));}function errorHandler(_0x1f674d){if(_0x1f674d&&_0x1f674d['name']&&_0x1f674d[_0x5b0d('0x13')]){logger[_0x5b0d('0x14')](util[_0x5b0d('0x11')](_0x5b0d('0x15'),_0x1f674d[_0x5b0d('0x16')],_0x1f674d[_0x5b0d('0x13')]));}else{logger[_0x5b0d('0x14')](util[_0x5b0d('0x11')](_0x5b0d('0x17'),_0x1f674d[_0x5b0d('0x18')]));}}function closeHandler(){logger[_0x5b0d('0x10')](util['format'](_0x5b0d('0x19'),this[_0x5b0d('0x1a')],this[_0x5b0d('0x1b')],this[_0x5b0d('0x1c')],this[_0x5b0d('0x1d')],this[_0x5b0d('0x1e')]));try{createSquareReport(this);}catch(_0x4432f5){logger[_0x5b0d('0x14')](_0x4432f5[_0x5b0d('0x18')]);}}function timeoutHandler(){logger['info'](util['format'](_0x5b0d('0x1f'),this[_0x5b0d('0x1a')],this[_0x5b0d('0x1b')],this[_0x5b0d('0x1c')],this[_0x5b0d('0x1d')],this[_0x5b0d('0x1e')]));}function hangupHandler(){logger[_0x5b0d('0x10')](util['format'](_0x5b0d('0x20'),this[_0x5b0d('0x1a')],this[_0x5b0d('0x1b')],this[_0x5b0d('0x1c')],this[_0x5b0d('0x1d')],this[_0x5b0d('0x1e')]));this[_0x5b0d('0x21')]=!![];}function createSquareReport(_0x3e19ad,_0x1392f4){rpc[_0x5b0d('0x22')](_0x3e19ad)[_0x5b0d('0x23')](function(_0x49d5cc){if(_0x1392f4){_0x1392f4(null,_0x49d5cc);}})['catch'](function(_0xe374c0){if(_0x1392f4){_0x1392f4(null,_0xe374c0);}});}function setChannelVariables(_0x22efff){for(var _0x42a222 in _0x22efff){if(_0x22efff[_0x5b0d('0x24')](_0x42a222)){if(_0x42a222[_0x5b0d('0x25')]('agi_')===0x0){_0x22efff[_0x42a222[_0x5b0d('0x26')](0x4)]=_0x22efff[_0x42a222];delete _0x22efff[_0x42a222];}}}}function agiHandler(_0x2951e6){logger[_0x5b0d('0x27')](_0x5b0d('0x28'),JSON['stringify'](_0x2951e6,null,0x2));logger['info'](util['format'](_0x5b0d('0x29'),_0x2951e6[_0x5b0d('0x1a')],_0x2951e6[_0x5b0d('0x1b')],_0x2951e6['callerid'],_0x2951e6['dnid'],_0x2951e6[_0x5b0d('0x1e')]));_0x2951e6['on'](_0x5b0d('0x14'),errorHandler);_0x2951e6['on'](_0x5b0d('0x2a'),closeHandler);_0x2951e6['on'](_0x5b0d('0x2b'),timeoutHandler);_0x2951e6[_0x5b0d('0x21')]=![];_0x2951e6['on'](_0x5b0d('0x2c'),hangupHandler);var _0x839941=_['find'](projects,[_0x5b0d('0x16'),_0x2951e6[_0x5b0d('0x1a')]]);if(!_0x839941)return Project[_0x5b0d('0x2d')](_0x2951e6);if(!_0x839941[_0x5b0d('0x2e')])return Project[_0x5b0d('0x2f')](_0x2951e6);return Project[_0x5b0d('0x30')](_0x839941,_0x2951e6);}function main(){var _0xfda6c5;return utilLicense[_0x5b0d('0x31')]()[_0x5b0d('0x23')](function(_0x2cc5ac){if(!_0x2cc5ac)return;if(_0x2cc5ac['voice']){if(_0x2cc5ac['callysquare']&&_0x2cc5ac[_0x5b0d('0x32')]>0x0){logger['info'](util['format']('[LICENSE]\x20CHANNELS:\x20%s',_0x2cc5ac['callysquare']));_0xfda6c5=_0x2cc5ac[_0x5b0d('0x32')];}else{logger[_0x5b0d('0x10')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger['info'](_0x5b0d('0x33'));_0xfda6c5=-0x1;}})[_0x5b0d('0x23')](function(){return Project['getAll']();})[_0x5b0d('0x23')](function(_0x12bb3f){projects=_0x12bb3f;return;})[_0x5b0d('0x34')](function(_0xc4e898){logger[_0x5b0d('0x14')](_0x5b0d('0x35'),_0xc4e898[_0x5b0d('0x18')]);})[_0x5b0d('0x36')](function(){var _0x544fcc=require(_0x5b0d('0x37'))(config[_0x5b0d('0x6')]['port'],config[_0x5b0d('0x6')]['ip'],_0xfda6c5);_0x544fcc['on'](_0x5b0d('0x14'),errorHandler);_0x544fcc['on']('listening',listeningHandler);_0x544fcc['on'](_0x5b0d('0x38'),connectionHandler);_0x544fcc['on']('close',closeHandler);});}main();
\ No newline at end of file
+var _0xc5b7=['callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','then','getAll','catch','[LICENSE]','./server','listening','connection','syncho','util','../../config/environment','agi','../../config/license/util','./rpc','./project','EventEmitter','defaults','127.0.0.1','projectUpdate','nextTick','error','stack','findIndex','deleted','splice','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','name','[%s]\x20%s','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','evtHangup','hasOwnProperty','indexOf','agi_','substring','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','handleUnpublished','voice'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc5b7,0x184));var _0x7c5b=function(_0x996e9b,_0x37b139){_0x996e9b=_0x996e9b-0x0;var _0x166645=_0xc5b7[_0x996e9b];return _0x166645;};'use strict';var _=require('lodash');var syncho=require(_0x7c5b('0x0'));var util=require(_0x7c5b('0x1'));var config=require(_0x7c5b('0x2'));var logger=require('../../config/logger')(_0x7c5b('0x3'));var utilLicense=require(_0x7c5b('0x4'));var rpc=require(_0x7c5b('0x5'));var Project=require(_0x7c5b('0x6'));var AGIEmitter=require('./events')[_0x7c5b('0x7')];var projects=[];config[_0x7c5b('0x3')]=_[_0x7c5b('0x8')](config['agi'],{'ip':_0x7c5b('0x9'),'port':0x11dd});AGIEmitter['on'](_0x7c5b('0xa'),projectUpdateHandler);function connectionHandler(_0x21ad89){process[_0x7c5b('0xb')](function(){syncho(function(){try{setChannelVariables(_0x21ad89);agiHandler(_0x21ad89);}catch(_0x21482a){logger[_0x7c5b('0xc')](_0x21482a[_0x7c5b('0xd')]);}});});}function projectUpdateHandler(_0x268148){try{var _0xdaabdc=_[_0x7c5b('0xe')](projects,['id',_0x268148['id']]);if(_0xdaabdc>-0x1){if(_0x268148[_0x7c5b('0xf')]===!![]){projects[_0x7c5b('0x10')](_0xdaabdc,0x1);}else{projects[_0xdaabdc]=_0x268148;}}else{projects['push'](_0x268148);}}catch(_0x2746ab){logger[_0x7c5b('0xc')](_0x2746ab[_0x7c5b('0xd')]);}}function listeningHandler(){console[_0x7c5b('0x11')](_0x7c5b('0x12'),config[_0x7c5b('0x3')][_0x7c5b('0x13')]);logger['info'](util[_0x7c5b('0x14')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x7c5b('0x3')]['ip'],config[_0x7c5b('0x3')]['port']));}function errorHandler(_0x4bdcf3){if(_0x4bdcf3&&_0x4bdcf3[_0x7c5b('0x15')]&&_0x4bdcf3['message']){logger[_0x7c5b('0xc')](util[_0x7c5b('0x14')](_0x7c5b('0x16'),_0x4bdcf3[_0x7c5b('0x15')],_0x4bdcf3['message']));}else{logger['error'](util[_0x7c5b('0x14')](_0x7c5b('0x17'),_0x4bdcf3[_0x7c5b('0xd')]));}}function closeHandler(){logger[_0x7c5b('0x18')](util[_0x7c5b('0x14')](_0x7c5b('0x19'),this[_0x7c5b('0x1a')],this[_0x7c5b('0x1b')],this['callerid'],this[_0x7c5b('0x1c')],this[_0x7c5b('0x1d')]));try{createSquareReport(this);}catch(_0x56010d){logger['error'](_0x56010d[_0x7c5b('0xd')]);}}function timeoutHandler(){logger[_0x7c5b('0x18')](util[_0x7c5b('0x14')](_0x7c5b('0x1e'),this[_0x7c5b('0x1a')],this['calleridname'],this['callerid'],this[_0x7c5b('0x1c')],this['uniqueid']));}function hangupHandler(){logger[_0x7c5b('0x18')](util[_0x7c5b('0x14')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x7c5b('0x1b')],this[_0x7c5b('0x1f')],this[_0x7c5b('0x1c')],this[_0x7c5b('0x1d')]));this[_0x7c5b('0x20')]=!![];}function createSquareReport(_0x23df6b,_0x263cc0){rpc['createSquareReport'](_0x23df6b)['then'](function(_0x3b6834){if(_0x263cc0){_0x263cc0(null,_0x3b6834);}})['catch'](function(_0x575420){if(_0x263cc0){_0x263cc0(null,_0x575420);}});}function setChannelVariables(_0x29309a){for(var _0x58cffb in _0x29309a){if(_0x29309a[_0x7c5b('0x21')](_0x58cffb)){if(_0x58cffb[_0x7c5b('0x22')](_0x7c5b('0x23'))===0x0){_0x29309a[_0x58cffb[_0x7c5b('0x24')](0x4)]=_0x29309a[_0x58cffb];delete _0x29309a[_0x58cffb];}}}}function agiHandler(_0x3e0dac){logger['debug'](_0x7c5b('0x25'),JSON['stringify'](_0x3e0dac,null,0x2));logger['info'](util[_0x7c5b('0x14')](_0x7c5b('0x26'),_0x3e0dac[_0x7c5b('0x1a')],_0x3e0dac[_0x7c5b('0x1b')],_0x3e0dac[_0x7c5b('0x1f')],_0x3e0dac['dnid'],_0x3e0dac[_0x7c5b('0x1d')]));_0x3e0dac['on'](_0x7c5b('0xc'),errorHandler);_0x3e0dac['on'](_0x7c5b('0x27'),closeHandler);_0x3e0dac['on'](_0x7c5b('0x28'),timeoutHandler);_0x3e0dac[_0x7c5b('0x20')]=![];_0x3e0dac['on'](_0x7c5b('0x29'),hangupHandler);var _0x33acf7=_['find'](projects,['name',_0x3e0dac['arg_1']]);if(!_0x33acf7)return Project['handleNotFound'](_0x3e0dac);if(!_0x33acf7['production'])return Project[_0x7c5b('0x2a')](_0x3e0dac);return Project['initialize'](_0x33acf7,_0x3e0dac);}function main(){var _0x4ab417;return utilLicense['getLicense']()['then'](function(_0x7c6de2){if(!_0x7c6de2)return;if(_0x7c6de2[_0x7c5b('0x2b')]){if(_0x7c6de2[_0x7c5b('0x2c')]&&_0x7c6de2[_0x7c5b('0x2c')]>0x0){logger[_0x7c5b('0x18')](util[_0x7c5b('0x14')](_0x7c5b('0x2d'),_0x7c6de2[_0x7c5b('0x2c')]));_0x4ab417=_0x7c6de2[_0x7c5b('0x2c')];}else{logger['info']('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x7c5b('0x18')](_0x7c5b('0x2e'));_0x4ab417=-0x1;}})[_0x7c5b('0x2f')](function(){return Project[_0x7c5b('0x30')]();})[_0x7c5b('0x2f')](function(_0xd50f54){projects=_0xd50f54;return;})[_0x7c5b('0x31')](function(_0x5f708c){logger['error'](_0x7c5b('0x32'),_0x5f708c[_0x7c5b('0xd')]);})['finally'](function(){var _0x33f9db=require(_0x7c5b('0x33'))(config[_0x7c5b('0x3')]['port'],config[_0x7c5b('0x3')]['ip'],_0x4ab417);_0x33f9db['on']('error',errorHandler);_0x33f9db['on'](_0x7c5b('0x34'),listeningHandler);_0x33f9db['on'](_0x7c5b('0x35'),connectionHandler);_0x33f9db['on']('close',closeHandler);});}main();
\ No newline at end of file
index 2800de7..38fe183 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a97=['then','error','message','result','catch','bluebird','client','request'];(function(_0x28ebf4,_0x482afb){var _0x46b771=function(_0x97314a){while(--_0x97314a){_0x28ebf4['push'](_0x28ebf4['shift']());}};_0x46b771(++_0x482afb);}(_0x7a97,0x195));var _0x77a9=function(_0x5615d6,_0x1ce57b){_0x5615d6=_0x5615d6-0x0;var _0x560ddf=_0x7a97[_0x5615d6];return _0x560ddf;};'use strict';var BPromise=require(_0x77a9('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x77a9('0x1')]['http']({'port':0x232b});function request(_0x328140,_0x52b3c7){return new BPromise(function(_0x3761bb,_0x57449d){return client[_0x77a9('0x2')](_0x328140,_0x52b3c7)[_0x77a9('0x3')](function(_0x486544){if(_0x486544[_0x77a9('0x4')]){return _0x57449d(_0x486544[_0x77a9('0x4')][_0x77a9('0x5')]);}else{return _0x3761bb(_0x486544[_0x77a9('0x6')]);}})[_0x77a9('0x7')](function(_0x298a5b){return _0x57449d(_0x298a5b);});});}exports['sendMailMessage']=function(_0x1b4e21,_0x463227){return request('SendMail',{'account':_0x1b4e21,'message':_0x463227});};
\ No newline at end of file
+var _0x7160=['request','then','error','message','result','sendMailMessage','SendMail','bluebird','jayson/promise','http'];(function(_0x48f2b7,_0x40f214){var _0x54506f=function(_0x193c0a){while(--_0x193c0a){_0x48f2b7['push'](_0x48f2b7['shift']());}};_0x54506f(++_0x40f214);}(_0x7160,0x18d));var _0x0716=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7160[_0x2dafbe];return _0x58a45a;};'use strict';var BPromise=require(_0x0716('0x0'));var jayson=require(_0x0716('0x1'));var client=jayson['client'][_0x0716('0x2')]({'port':0x232b});function request(_0x3699fb,_0x372ef6){return new BPromise(function(_0x367846,_0x233866){return client[_0x0716('0x3')](_0x3699fb,_0x372ef6)[_0x0716('0x4')](function(_0x19a9fc){if(_0x19a9fc[_0x0716('0x5')]){return _0x233866(_0x19a9fc[_0x0716('0x5')][_0x0716('0x6')]);}else{return _0x367846(_0x19a9fc[_0x0716('0x7')]);}})['catch'](function(_0x442d8d){return _0x233866(_0x442d8d);});});}exports[_0x0716('0x8')]=function(_0x5b514c,_0x7ee8bc){return request(_0x0716('0x9'),{'account':_0x5b514c,'message':_0x7ee8bc});};
\ No newline at end of file
index 22a244a..2481d63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5157=['[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','clear','gotoc','context','extension','priority','stringify','code','result','evtHangup','isUndefined','response','error','uniqueid','finally','vertex','toString','agicommand\x20not\x20found','[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','close','exports','lodash','moment','xml2json','util','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','maxRetry','retry','omit','mxCell','isArray','length','source','target','addEdge','toJson','mxGraphModel','root','inspect','production','start','debug','joinAt','YYYY-MM-DD\x20HH:mm:ss','info','format'];(function(_0x135904,_0x1e252b){var _0x1ce7d5=function(_0x25a721){while(--_0x25a721){_0x135904['push'](_0x135904['shift']());}};_0x1ce7d5(++_0x1e252b);}(_0x5157,0x113));var _0x7515=function(_0x5a4926,_0x2d05ec){_0x5a4926=_0x5a4926-0x0;var _0x55a29c=_0x5157[_0x5a4926];return _0x55a29c;};'use strict';var _=require(_0x7515('0x0'));var moment=require(_0x7515('0x1'));var parser=require(_0x7515('0x2'));var util=require(_0x7515('0x3'));var logger=require(_0x7515('0x4'))(_0x7515('0x5'));var rpc=require(_0x7515('0x6'));var mailRpc=require(_0x7515('0x7'));var Graph=require(_0x7515('0x8'));var Vertices=require(_0x7515('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x7515('0xa')]()['catch'](function(_0x1305fc){logger['error'](_0x7515('0xb'),_0x1305fc[_0x7515('0xc')]);return[];});}function addVertex(_0x274ee7,_0x15f1dc,_0x2f58f0){_0x15f1dc[_0x7515('0xd')]=_0x2f58f0;if(_0x15f1dc[_0x7515('0xe')]('retry')){_0x15f1dc[_0x7515('0xf')]=parseInt(_0x15f1dc[_0x7515('0x10')],0xa);}_0x274ee7['addVertex'](_[_0x7515('0x11')](_0x15f1dc,_0x7515('0x12')));}function initGraph(_0x2ac8db,_0x5b5474){var _0x1c1913=new Graph();for(var _0xff6bdf in _0x2ac8db){if(_0x2ac8db[_0x7515('0xe')](_0xff6bdf)){if(_[_0x7515('0x13')](_0x2ac8db[_0xff6bdf])){for(var _0x1cf631=0x0;_0x1cf631<_0x2ac8db[_0xff6bdf]['length'];_0x1cf631+=0x1){addVertex(_0x1c1913,_0x2ac8db[_0xff6bdf][_0x1cf631],_0xff6bdf);}}else{addVertex(_0x1c1913,_0x2ac8db[_0xff6bdf],_0xff6bdf);}}}for(var _0x31368e=0x0;_0x31368e<_0x5b5474[_0x7515('0x14')];_0x31368e+=0x1){if(_0x5b5474[_0x31368e][_0x7515('0x15')]&&_0x5b5474[_0x31368e][_0x7515('0x16')]){_0x1c1913[_0x7515('0x17')](_0x5b5474[_0x31368e][_0x7515('0x15')],_0x5b5474[_0x31368e][_0x7515('0x16')],_0x5b5474[_0x31368e]['value']);}}return _0x1c1913;}function getRoot(_0x3457b6){return parser[_0x7515('0x18')](_0x3457b6,{'object':!![]})[_0x7515('0x19')][_0x7515('0x1a')];}function inspect(_0x18709e){return util[_0x7515('0x1b')](_0x18709e,{'showHidden':![],'depth':null});}function initialize(_0x560c60,_0x1dfadb){var _0x40e0f1=getRoot(_0x560c60[_0x7515('0x1c')]);if(!_0x40e0f1||!_0x40e0f1[_0x7515('0x1d')])return;var _0x22e599,_0x38360a,_0x5259e0;logger[_0x7515('0x1e')]('root',JSON['stringify'](_0x40e0f1,null,0x2));_0x1dfadb[_0x7515('0x1f')]=moment()['format'](_0x7515('0x20'));_0x22e599=initGraph(_[_0x7515('0x11')](_0x40e0f1,_0x7515('0x12')),_0x40e0f1['mxCell']);_0x38360a=new Vertices(_0x1dfadb,rpc,mailRpc);logger[_0x7515('0x21')](util[_0x7515('0x22')](_0x7515('0x23'),_0x1dfadb[_0x7515('0x24')],_0x1dfadb[_0x7515('0x25')],_0x1dfadb['callerid'],_0x1dfadb[_0x7515('0x26')],_0x1dfadb['uniqueid']));_0x22e599[_0x7515('0x27')](_0x40e0f1['start']['id'],function(_0x56ec64){try{_0x56ec64=_0x38360a[_0x7515('0x28')](_0x56ec64);logger[_0x7515('0x1e')]('vertex',JSON['stringify'](_0x56ec64,null,0x2));if(_0x56ec64[_0x7515('0xd')]===_0x7515('0x29')){logger[_0x7515('0x21')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x1dfadb['context']=_0x56ec64[_0x7515('0x2a')]||_0x1dfadb['context'];_0x1dfadb[_0x7515('0x2b')]=_0x56ec64['extension'];_0x1dfadb['priority']=_0x56ec64[_0x7515('0x2c')]?_0x56ec64[_0x7515('0x2c')]-0x1:0x1;return null;}else if(_0x56ec64&&_0x38360a[_0x56ec64[_0x7515('0xd')]]){_0x5259e0=_0x38360a[_0x56ec64[_0x7515('0xd')]](_0x56ec64);logger[_0x7515('0x21')]('response',JSON[_0x7515('0x2d')](_0x5259e0,null,0x2));if(_0x5259e0&&_0x5259e0[_0x7515('0x2e')]===AGI_CODE_SUCCESS&&_0x5259e0[_0x7515('0x2f')]!==AGI_RESULT_ERROR&&!_0x1dfadb[_0x7515('0x30')]){logger[_0x7515('0x1e')]('response',inspect(_0x5259e0));return _[_0x7515('0x31')](_0x5259e0['result'])?null:_0x5259e0[_0x7515('0x2f')]['toString']();}else{logger['error'](_0x7515('0x32'),inspect(_0x5259e0));return null;}}else{logger[_0x7515('0x33')]('agicommand\x20not\x20found');return null;}}catch(_0x1a29fa){logger['error'](_0x1a29fa[_0x7515('0xc')]);return null;}});if(_0x40e0f1['finally']){logger[_0x7515('0x21')](util[_0x7515('0x22')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1dfadb['arg_1'],_0x1dfadb[_0x7515('0x25')],_0x1dfadb['callerid'],_0x1dfadb[_0x7515('0x26')],_0x1dfadb[_0x7515('0x34')]));_0x22e599['traverseBFS'](_0x40e0f1[_0x7515('0x35')]['id'],function(_0x54e4fb){try{_0x54e4fb=_0x38360a[_0x7515('0x28')](_0x54e4fb);logger['debug'](_0x7515('0x36'),JSON['stringify'](_0x54e4fb,null,0x2));if(_0x54e4fb&&_0x38360a[_0x54e4fb[_0x7515('0xd')]]){_0x5259e0=_0x38360a[_0x54e4fb[_0x7515('0xd')]](_0x54e4fb);if(_0x5259e0){logger[_0x7515('0x1e')]('response',inspect(_0x5259e0));return _['isUndefined'](_0x5259e0[_0x7515('0x2f')])?null:_0x5259e0[_0x7515('0x2f')][_0x7515('0x37')]();}else{logger[_0x7515('0x33')](_0x7515('0x32'),inspect(_0x5259e0));return null;}}else{logger[_0x7515('0x33')](_0x7515('0x38'));return null;}}catch(_0x3df5c7){logger[_0x7515('0x33')](_0x3df5c7[_0x7515('0xc')]);return null;}});}logger['info'](util[_0x7515('0x22')](_0x7515('0x39'),_0x1dfadb[_0x7515('0x24')],_0x1dfadb[_0x7515('0x25')],_0x1dfadb['callerid'],_0x1dfadb['dnid'],_0x1dfadb[_0x7515('0x34')]));logger['info'](util[_0x7515('0x22')](_0x7515('0x3a'),_0x1dfadb[_0x7515('0x2a')],_0x1dfadb['extension'],parseInt(_0x1dfadb[_0x7515('0x2c')],0xa)+0x1));_0x1dfadb[_0x7515('0x3b')](_0x1dfadb[_0x7515('0x2a')],_0x1dfadb['extension'],parseInt(_0x1dfadb[_0x7515('0x2c')],0xa)+0x1);_0x1dfadb[_0x7515('0x3c')]();}function handleNotFound(_0x144161){logger[_0x7515('0x33')](util[_0x7515('0x22')]('Project\x20%s\x20not\x20found',_0x144161[_0x7515('0x24')]));_0x144161[_0x7515('0x3b')](_0x144161[_0x7515('0x2a')],_0x144161[_0x7515('0x2b')],parseInt(_0x144161[_0x7515('0x2c')],0xa)+0x1);_0x144161[_0x7515('0x3c')]();}function handleUnpublished(_0x302d07){logger[_0x7515('0x33')](util[_0x7515('0x22')]('Project\x20%s\x20not\x20published',_0x302d07['arg_1']));_0x302d07['continueAt'](_0x302d07[_0x7515('0x2a')],_0x302d07[_0x7515('0x2b')],parseInt(_0x302d07[_0x7515('0x2c')],0xa)+0x1);_0x302d07[_0x7515('0x3c')]();}module[_0x7515('0x3d')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize};
\ No newline at end of file
+var _0x8636=['error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','maxRetry','retry','addVertex','omit','isArray','length','target','addEdge','source','value','toJson','root','inspect','production','start','debug','format','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','callerid','dnid','uniqueid','traverseBFS','clear','vertex','agicommand','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','response','stringify','code','result','evtHangup','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','priority','continueAt','close','Project\x20%s\x20not\x20published','exports','lodash','xml2json','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x8636,0x128));var _0x6863=function(_0x1758e7,_0x514db1){_0x1758e7=_0x1758e7-0x0;var _0x5f46c0=_0x8636[_0x1758e7];return _0x5f46c0;};'use strict';var _=require(_0x6863('0x0'));var moment=require('moment');var parser=require(_0x6863('0x1'));var util=require('util');var logger=require('../../config/logger')(_0x6863('0x2'));var rpc=require(_0x6863('0x3'));var mailRpc=require(_0x6863('0x4'));var Graph=require(_0x6863('0x5'));var Vertices=require(_0x6863('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x6863('0x7')]()[_0x6863('0x8')](function(_0x51c257){logger[_0x6863('0x9')](_0x6863('0xa'),_0x51c257[_0x6863('0xb')]);return[];});}function addVertex(_0x2fb971,_0x31b92e,_0x21e422){_0x31b92e['agicommand']=_0x21e422;if(_0x31b92e['hasOwnProperty']('retry')){_0x31b92e[_0x6863('0xc')]=parseInt(_0x31b92e[_0x6863('0xd')],0xa);}_0x2fb971[_0x6863('0xe')](_[_0x6863('0xf')](_0x31b92e,'mxCell'));}function initGraph(_0x4395cf,_0x468a0f){var _0x2e32ce=new Graph();for(var _0x4bca46 in _0x4395cf){if(_0x4395cf['hasOwnProperty'](_0x4bca46)){if(_[_0x6863('0x10')](_0x4395cf[_0x4bca46])){for(var _0x54ded0=0x0;_0x54ded0<_0x4395cf[_0x4bca46][_0x6863('0x11')];_0x54ded0+=0x1){addVertex(_0x2e32ce,_0x4395cf[_0x4bca46][_0x54ded0],_0x4bca46);}}else{addVertex(_0x2e32ce,_0x4395cf[_0x4bca46],_0x4bca46);}}}for(var _0xa45055=0x0;_0xa45055<_0x468a0f[_0x6863('0x11')];_0xa45055+=0x1){if(_0x468a0f[_0xa45055]['source']&&_0x468a0f[_0xa45055][_0x6863('0x12')]){_0x2e32ce[_0x6863('0x13')](_0x468a0f[_0xa45055][_0x6863('0x14')],_0x468a0f[_0xa45055][_0x6863('0x12')],_0x468a0f[_0xa45055][_0x6863('0x15')]);}}return _0x2e32ce;}function getRoot(_0x21eb38){return parser[_0x6863('0x16')](_0x21eb38,{'object':!![]})['mxGraphModel'][_0x6863('0x17')];}function inspect(_0x17f281){return util[_0x6863('0x18')](_0x17f281,{'showHidden':![],'depth':null});}function initialize(_0x2fbf62,_0x1c58a1){var _0x3d4a15=getRoot(_0x2fbf62[_0x6863('0x19')]);if(!_0x3d4a15||!_0x3d4a15[_0x6863('0x1a')])return;var _0x48211e,_0x423d53,_0x2875df;logger[_0x6863('0x1b')](_0x6863('0x17'),JSON['stringify'](_0x3d4a15,null,0x2));_0x1c58a1['joinAt']=moment()[_0x6863('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');_0x48211e=initGraph(_['omit'](_0x3d4a15,_0x6863('0x1d')),_0x3d4a15[_0x6863('0x1d')]);_0x423d53=new Vertices(_0x1c58a1,rpc,mailRpc);logger[_0x6863('0x1e')](util['format'](_0x6863('0x1f'),_0x1c58a1[_0x6863('0x20')],_0x1c58a1[_0x6863('0x21')],_0x1c58a1[_0x6863('0x22')],_0x1c58a1[_0x6863('0x23')],_0x1c58a1[_0x6863('0x24')]));_0x48211e[_0x6863('0x25')](_0x3d4a15[_0x6863('0x1a')]['id'],function(_0x5bc5a9){try{_0x5bc5a9=_0x423d53[_0x6863('0x26')](_0x5bc5a9);logger['debug'](_0x6863('0x27'),JSON['stringify'](_0x5bc5a9,null,0x2));if(_0x5bc5a9[_0x6863('0x28')]==='gotoc'){logger[_0x6863('0x1e')](_0x6863('0x29'));_0x1c58a1[_0x6863('0x2a')]=_0x5bc5a9[_0x6863('0x2a')]||_0x1c58a1['context'];_0x1c58a1[_0x6863('0x2b')]=_0x5bc5a9['extension'];_0x1c58a1['priority']=_0x5bc5a9['priority']?_0x5bc5a9['priority']-0x1:0x1;return null;}else if(_0x5bc5a9&&_0x423d53[_0x5bc5a9['agicommand']]){_0x2875df=_0x423d53[_0x5bc5a9['agicommand']](_0x5bc5a9);logger[_0x6863('0x1e')](_0x6863('0x2c'),JSON[_0x6863('0x2d')](_0x2875df,null,0x2));if(_0x2875df&&_0x2875df[_0x6863('0x2e')]===AGI_CODE_SUCCESS&&_0x2875df[_0x6863('0x2f')]!==AGI_RESULT_ERROR&&!_0x1c58a1[_0x6863('0x30')]){logger[_0x6863('0x1b')](_0x6863('0x2c'),inspect(_0x2875df));return _[_0x6863('0x31')](_0x2875df[_0x6863('0x2f')])?null:_0x2875df['result'][_0x6863('0x32')]();}else{logger[_0x6863('0x9')]('response',inspect(_0x2875df));return null;}}else{logger[_0x6863('0x9')](_0x6863('0x33'));return null;}}catch(_0x371a15){logger[_0x6863('0x9')](_0x371a15[_0x6863('0xb')]);return null;}});if(_0x3d4a15[_0x6863('0x34')]){logger[_0x6863('0x1e')](util[_0x6863('0x1c')](_0x6863('0x35'),_0x1c58a1[_0x6863('0x20')],_0x1c58a1['calleridname'],_0x1c58a1[_0x6863('0x22')],_0x1c58a1[_0x6863('0x23')],_0x1c58a1['uniqueid']));_0x48211e[_0x6863('0x25')](_0x3d4a15[_0x6863('0x34')]['id'],function(_0x5cae84){try{_0x5cae84=_0x423d53[_0x6863('0x26')](_0x5cae84);logger['debug'](_0x6863('0x27'),JSON[_0x6863('0x2d')](_0x5cae84,null,0x2));if(_0x5cae84&&_0x423d53[_0x5cae84[_0x6863('0x28')]]){_0x2875df=_0x423d53[_0x5cae84['agicommand']](_0x5cae84);if(_0x2875df){logger[_0x6863('0x1b')](_0x6863('0x2c'),inspect(_0x2875df));return _[_0x6863('0x31')](_0x2875df[_0x6863('0x2f')])?null:_0x2875df[_0x6863('0x2f')][_0x6863('0x32')]();}else{logger[_0x6863('0x9')](_0x6863('0x2c'),inspect(_0x2875df));return null;}}else{logger['error'](_0x6863('0x33'));return null;}}catch(_0x5db18f){logger['error'](_0x5db18f[_0x6863('0xb')]);return null;}});}logger['info'](util[_0x6863('0x1c')](_0x6863('0x36'),_0x1c58a1[_0x6863('0x20')],_0x1c58a1[_0x6863('0x21')],_0x1c58a1['callerid'],_0x1c58a1[_0x6863('0x23')],_0x1c58a1[_0x6863('0x24')]));logger[_0x6863('0x1e')](util[_0x6863('0x1c')](_0x6863('0x37'),_0x1c58a1[_0x6863('0x2a')],_0x1c58a1[_0x6863('0x2b')],parseInt(_0x1c58a1[_0x6863('0x38')],0xa)+0x1));_0x1c58a1[_0x6863('0x39')](_0x1c58a1[_0x6863('0x2a')],_0x1c58a1[_0x6863('0x2b')],parseInt(_0x1c58a1['priority'],0xa)+0x1);_0x1c58a1[_0x6863('0x3a')]();}function handleNotFound(_0x395a6b){logger[_0x6863('0x9')](util[_0x6863('0x1c')]('Project\x20%s\x20not\x20found',_0x395a6b[_0x6863('0x20')]));_0x395a6b[_0x6863('0x39')](_0x395a6b['context'],_0x395a6b['extension'],parseInt(_0x395a6b['priority'],0xa)+0x1);_0x395a6b[_0x6863('0x3a')]();}function handleUnpublished(_0x3498d8){logger['error'](util[_0x6863('0x1c')](_0x6863('0x3b'),_0x3498d8[_0x6863('0x20')]));_0x3498d8[_0x6863('0x39')](_0x3498d8[_0x6863('0x2a')],_0x3498d8[_0x6863('0x2b')],parseInt(_0x3498d8[_0x6863('0x38')],0xa)+0x1);_0x3498d8['close']();}module[_0x6863('0x3c')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize};
\ No newline at end of file
index 039339a..b82d18f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b34=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','toString','substring','length','split','indexOf','slice','emit','line'];(function(_0x198eae,_0xf23e90){var _0x2ad186=function(_0x24e88f){while(--_0x24e88f){_0x198eae['push'](_0x198eae['shift']());}};_0x2ad186(++_0xf23e90);}(_0x7b34,0x18d));var _0x47b3=function(_0x286203,_0x2faaf7){_0x286203=_0x286203-0x0;var _0x37a671=_0x7b34[_0x286203];return _0x37a671;};'use strict';var util=require(_0x47b3('0x0'));var Transform=require(_0x47b3('0x1'))[_0x47b3('0x2')];function AGIReply(_0x3b7c14){Transform[_0x47b3('0x3')](this,_0x3b7c14);this[_0x47b3('0x4')]='';this[_0x47b3('0x5')]=![];}util[_0x47b3('0x6')](AGIReply,Transform);AGIReply[_0x47b3('0x7')][_0x47b3('0x8')]=function(_0x2d31ea,_0x2b59c3,_0x1d4b7b){var _0x14a176='\x0a',_0x333ae0=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x5047bd=-0x1,_0x2f2adf=-0x1,_0x51e6cb='',_0xb6549a=0x0,_0x3e771f='',_0x3ed2a0='';this[_0x47b3('0x4')]+=_0x2d31ea[_0x47b3('0x9')]();_0x3e771f=this[_0x47b3('0x4')];if(!this[_0x47b3('0x5')]){_0xb6549a=0x0;while(_0x333ae0[_0xb6549a]){while((_0x2f2adf=_0x3e771f['indexOf'](_0x333ae0[_0xb6549a]))!=-0x1){_0x51e6cb=_0x333ae0[_0xb6549a];_0x3ed2a0=_0x3e771f[_0x47b3('0xa')](0x0,_0x2f2adf);_0x3e771f=_0x3e771f['substring'](_0x2f2adf+_0x51e6cb[_0x47b3('0xb')]);var _0x44d64c=_0x3ed2a0[_0x47b3('0xc')](_0x14a176),_0x28fa5a=0x0,_0x2124d5={},_0x528b42='',_0x29e88c='',_0x593020=-0x1;while(_0x44d64c[_0x28fa5a]){_0x593020=_0x44d64c[_0x28fa5a][_0x47b3('0xd')](':');if(_0x593020!=-0x1){_0x528b42=_0x44d64c[_0x28fa5a][_0x47b3('0xe')](0x0,_0x593020)['trim']();_0x29e88c=_0x44d64c[_0x28fa5a][_0x47b3('0xe')](_0x593020+0x1)['trim']();if(_0x528b42[_0x47b3('0xb')]>0x0){_0x2124d5[_0x528b42]=_0x29e88c;}}else{}_0x28fa5a++;}this[_0x47b3('0xf')]('headers',_0x2124d5);this[_0x47b3('0x5')]=!![];}_0xb6549a++;}this[_0x47b3('0x4')]=_0x3e771f;}else{while((_0x5047bd=_0x3e771f[_0x47b3('0xd')](_0x14a176))!=-0x1){_0x3ed2a0=_0x3e771f[_0x47b3('0xa')](0x0,_0x5047bd);this[_0x47b3('0xf')](_0x47b3('0x10'),_0x3ed2a0);_0x3e771f=_0x3e771f[_0x47b3('0xa')](_0x5047bd+_0x14a176[_0x47b3('0xb')]);}this[_0x47b3('0x4')]=_0x3e771f;}_0x1d4b7b();};module[_0x47b3('0x11')]=AGIReply;
\ No newline at end of file
+var _0x93cc=['stream','Transform','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','length','split','trim','slice','emit','headers','_inBody','exports'];(function(_0x701991,_0x2dad95){var _0x4b435b=function(_0x4bf8d7){while(--_0x4bf8d7){_0x701991['push'](_0x701991['shift']());}};_0x4b435b(++_0x2dad95);}(_0x93cc,0x168));var _0xc93c=function(_0x4c90a4,_0x4794fb){_0x4c90a4=_0x4c90a4-0x0;var _0x655e5d=_0x93cc[_0x4c90a4];return _0x655e5d;};'use strict';var util=require('util');var Transform=require(_0xc93c('0x0'))[_0xc93c('0x1')];function AGIReply(_0x503beb){Transform['call'](this,_0x503beb);this['_localBuffer']='';this['_inBody']=![];}util[_0xc93c('0x2')](AGIReply,Transform);AGIReply[_0xc93c('0x3')][_0xc93c('0x4')]=function(_0x3e3fb7,_0x318daf,_0x2591d8){var _0x5dd9df='\x0a',_0x586bcd=['\x0a\x0a',_0xc93c('0x5')],_0x25c5e6=-0x1,_0x3ffe3b=-0x1,_0x20c12e='',_0x3ef7ee=0x0,_0x1d433d='',_0x57d366='';this[_0xc93c('0x6')]+=_0x3e3fb7[_0xc93c('0x7')]();_0x1d433d=this[_0xc93c('0x6')];if(!this['_inBody']){_0x3ef7ee=0x0;while(_0x586bcd[_0x3ef7ee]){while((_0x3ffe3b=_0x1d433d[_0xc93c('0x8')](_0x586bcd[_0x3ef7ee]))!=-0x1){_0x20c12e=_0x586bcd[_0x3ef7ee];_0x57d366=_0x1d433d[_0xc93c('0x9')](0x0,_0x3ffe3b);_0x1d433d=_0x1d433d[_0xc93c('0x9')](_0x3ffe3b+_0x20c12e[_0xc93c('0xa')]);var _0xfe06ba=_0x57d366[_0xc93c('0xb')](_0x5dd9df),_0x433a68=0x0,_0x409ba9={},_0x528a8f='',_0x4d038c='',_0x2a18e6=-0x1;while(_0xfe06ba[_0x433a68]){_0x2a18e6=_0xfe06ba[_0x433a68][_0xc93c('0x8')](':');if(_0x2a18e6!=-0x1){_0x528a8f=_0xfe06ba[_0x433a68]['slice'](0x0,_0x2a18e6)[_0xc93c('0xc')]();_0x4d038c=_0xfe06ba[_0x433a68][_0xc93c('0xd')](_0x2a18e6+0x1)['trim']();if(_0x528a8f['length']>0x0){_0x409ba9[_0x528a8f]=_0x4d038c;}}else{}_0x433a68++;}this[_0xc93c('0xe')](_0xc93c('0xf'),_0x409ba9);this[_0xc93c('0x10')]=!![];}_0x3ef7ee++;}this[_0xc93c('0x6')]=_0x1d433d;}else{while((_0x25c5e6=_0x1d433d[_0xc93c('0x8')](_0x5dd9df))!=-0x1){_0x57d366=_0x1d433d['substring'](0x0,_0x25c5e6);this[_0xc93c('0xe')]('line',_0x57d366);_0x1d433d=_0x1d433d[_0xc93c('0x9')](_0x25c5e6+_0x5dd9df[_0xc93c('0xa')]);}this[_0xc93c('0x6')]=_0x1d433d;}_0x2591d8();};module[_0xc93c('0x11')]=AGIReply;
\ No newline at end of file
index 7e5b6cf..8f5778b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb90d=['CloudProvider','email','getSquareProjectById','getVariableById','ShowVariable','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','ShowSound','save_name','getIntervalById','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','moment','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','getSquareProject','ShowSquareProject','production','getMailAccountById','Smtp'];(function(_0x5e6487,_0x2718b8){var _0x70c092=function(_0x16300f){while(--_0x16300f){_0x5e6487['push'](_0x5e6487['shift']());}};_0x70c092(++_0x2718b8);}(_0xb90d,0x17a));var _0xdb90=function(_0xf7ff4,_0x543a19){_0xf7ff4=_0xf7ff4-0x0;var _0x554e6a=_0xb90d[_0xf7ff4];return _0x554e6a;};'use strict';var _=require('lodash');var moment=require(_0xdb90('0x0'));var jayson=require(_0xdb90('0x1'));var client=jayson[_0xdb90('0x2')][_0xdb90('0x3')]({'port':0x2329});function request(_0x8cab86,_0x42e57f){return new Promise(function(_0x4a9a1f,_0x3db22e){return client[_0xdb90('0x4')](_0x8cab86,_0x42e57f)[_0xdb90('0x5')](function(_0x532dbc){if(_0x532dbc['error']){return _0x3db22e(_0x532dbc[_0xdb90('0x6')][_0xdb90('0x7')]);}else{return _0x4a9a1f(_0x532dbc[_0xdb90('0x8')]);}})[_0xdb90('0x9')](function(_0x57862b){return _0x3db22e(_0x57862b);});});}exports[_0xdb90('0xa')]=function(){return request(_0xdb90('0xb'),{'options':{'raw':![],'attributes':['id',_0xdb90('0xc'),'production']}});};exports[_0xdb90('0xd')]=function(_0x40312b){return request(_0xdb90('0xe'),{'options':{'raw':![],'where':{'name':_0x40312b},'attributes':[_0xdb90('0xf')]}});};exports[_0xdb90('0x10')]=function(_0x48eb30){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x48eb30},'include':[{'model':'MailServerOut','as':_0xdb90('0x11'),'include':[{'model':_0xdb90('0x12'),'as':_0xdb90('0x12')}]}],'attributes':['id',_0xdb90('0xc'),_0xdb90('0x13')],'smtp':!![]}});};exports[_0xdb90('0x14')]=function(_0x5655d2){return request('ShowSquareProject',{'options':{'where':{'id':_0x5655d2},'attributes':['name']}});};exports['getVoiceQueueById']=function(_0x569d40){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x569d40},'attributes':[_0xdb90('0xc')]}});};exports[_0xdb90('0x15')]=function(_0x5b93b1){return request(_0xdb90('0x16'),{'options':{'where':{'id':_0x5b93b1},'attributes':[_0xdb90('0xc')]}});};exports['getSquareOdbcById']=function(_0x4a3298){return request(_0xdb90('0x17'),{'options':{'where':{'id':_0x4a3298},'attributes':[_0xdb90('0x18')]}});};exports[_0xdb90('0x19')]=function(_0x5101e9){return request(_0xdb90('0x1a'),{'options':{'where':{'id':_0x5101e9},'attributes':[_0xdb90('0xc')]}});};exports[_0xdb90('0x1b')]=function(_0x44d4d4){return request(_0xdb90('0x1c'),{'options':{'where':{'phone':_0x44d4d4[_0xdb90('0x1d')]},'attributes':['id']}});};exports[_0xdb90('0x1e')]=function(_0x1838ed){return request(_0xdb90('0x1f'),{'options':{'where':{'id':_0x1838ed},'attributes':[_0xdb90('0xc')]}});};exports['getSoundById']=function(_0x55e1b7){return request(_0xdb90('0x20'),{'options':{'where':{'id':_0x55e1b7},'attributes':[_0xdb90('0x21')]}});};exports[_0xdb90('0x22')]=function(_0x13f84d){return request(_0xdb90('0x23'),{'options':{'raw':![],'where':{'id':_0x13f84d},'include':[{'model':'Interval','as':_0xdb90('0x24')}]}});};exports[_0xdb90('0x25')]=function(_0x590e6a){return request(_0xdb90('0x26'),{'options':{'where':{'id':_0x590e6a},'attributes':['id','name']}});};exports[_0xdb90('0x27')]=function(_0x2fdb1b){return request(_0xdb90('0x28'),{'body':_0x2fdb1b});};exports[_0xdb90('0x29')]=function(_0xb591f1){return request(_0xdb90('0x2a'),{'body':_0xb591f1});};exports[_0xdb90('0x2b')]=function(_0x23aea1){return request(_0xdb90('0x2c'),{'body':_[_0xdb90('0x2d')](_0x23aea1,{'project_name':_0x23aea1[_0xdb90('0x2e')],'prev_project_name':_0x23aea1['arg_2']||'','is_subproject':_0x23aea1[_0xdb90('0x2f')]?!![]:![],'leaveAt':moment()[_0xdb90('0x30')](_0xdb90('0x31'))})});};exports['createSquareRecording']=function(_0x536eae){return request(_0xdb90('0x32'),{'body':_0x536eae});};exports[_0xdb90('0x33')]=function(_0x3c8349){return request(_0xdb90('0x34'),{'body':_0x3c8349});};exports[_0xdb90('0x35')]=function(_0x321efc){return request(_0xdb90('0x36'),{'options':{'raw':![],'where':{'phone':_0x321efc[_0xdb90('0x1d')],'ListId':_0x321efc['ListId']}}})[_0xdb90('0x5')](function(_0x204f8a){if(_0x204f8a){return _0x204f8a;}return request(_0xdb90('0x37'),{'body':_0x321efc});});};exports[_0xdb90('0x38')]=function(_0x3e9791){return request(_0xdb90('0x39'),{'options':{'where':{'id':_0x3e9791},'attributes':[_0xdb90('0xc')]}});};exports[_0xdb90('0x3a')]=function(_0x35a471,_0x43a20e){return request(_0xdb90('0x3b'),{'body':{'interface':_0x43a20e},'options':{'where':_0x35a471}});};exports[_0xdb90('0x3c')]=function(_0x3c2608,_0x62712d,_0x487953){return request(_0xdb90('0x3d'),{'body':{'type':_0x62712d,'uniqueid':_0x487953},'options':{'where':_0x3c2608}});};exports[_0xdb90('0x3e')]=function(_0x8d9d6a){return request(_0xdb90('0x3f'),{'body':{},'options':{'where':_0x8d9d6a}});};exports[_0xdb90('0x40')]=function(_0x55002){return request(_0xdb90('0x41'),{'body':{},'options':{'where':_0x55002}});};
\ No newline at end of file
+var _0x2123=['dsn','getUserById','ShowUser','GetContactByPhone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','ShowInterval','Interval','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','CreateSquareReport','merge','arg_2','format','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','http','request','then','error','message','result','GetSquareProjects','name','production','getSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc'];(function(_0x41879e,_0xe73e16){var _0x4e9797=function(_0x541042){while(--_0x541042){_0x41879e['push'](_0x41879e['shift']());}};_0x4e9797(++_0xe73e16);}(_0x2123,0x190));var _0x3212=function(_0x3bfd5e,_0x582c64){_0x3bfd5e=_0x3bfd5e-0x0;var _0x390d5c=_0x2123[_0x3bfd5e];return _0x390d5c;};'use strict';var _=require(_0x3212('0x0'));var moment=require(_0x3212('0x1'));var jayson=require(_0x3212('0x2'));var client=jayson[_0x3212('0x3')][_0x3212('0x4')]({'port':0x2329});function request(_0x2ff863,_0x8c047){return new Promise(function(_0x2e951f,_0x304f80){return client[_0x3212('0x5')](_0x2ff863,_0x8c047)[_0x3212('0x6')](function(_0x265328){if(_0x265328['error']){return _0x304f80(_0x265328[_0x3212('0x7')][_0x3212('0x8')]);}else{return _0x2e951f(_0x265328[_0x3212('0x9')]);}})['catch'](function(_0x3e17a3){return _0x304f80(_0x3e17a3);});});}exports['getSquareProjects']=function(){return request(_0x3212('0xa'),{'options':{'raw':![],'attributes':['id',_0x3212('0xb'),_0x3212('0xc')]}});};exports[_0x3212('0xd')]=function(_0x54f331){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x54f331},'attributes':[_0x3212('0xc')]}});};exports[_0x3212('0xe')]=function(_0x1a3b2f){return request(_0x3212('0xf'),{'options':{'raw':![],'where':{'id':_0x1a3b2f},'include':[{'model':_0x3212('0x10'),'as':_0x3212('0x11'),'include':[{'model':_0x3212('0x12'),'as':_0x3212('0x12')}]}],'attributes':['id',_0x3212('0xb'),_0x3212('0x13')],'smtp':!![]}});};exports[_0x3212('0x14')]=function(_0x2e4cf0){return request(_0x3212('0x15'),{'options':{'where':{'id':_0x2e4cf0},'attributes':[_0x3212('0xb')]}});};exports[_0x3212('0x16')]=function(_0x3d1fda){return request(_0x3212('0x17'),{'options':{'where':{'id':_0x3d1fda},'attributes':[_0x3212('0xb')]}});};exports[_0x3212('0x18')]=function(_0x46c5f5){return request(_0x3212('0x19'),{'options':{'where':{'id':_0x46c5f5},'attributes':[_0x3212('0xb')]}});};exports['getSquareOdbcById']=function(_0x43a642){return request(_0x3212('0x1a'),{'options':{'where':{'id':_0x43a642},'attributes':[_0x3212('0x1b')]}});};exports[_0x3212('0x1c')]=function(_0x521f3f){return request(_0x3212('0x1d'),{'options':{'where':{'id':_0x521f3f},'attributes':[_0x3212('0xb')]}});};exports['getContactByPhone']=function(_0x4c1158){return request(_0x3212('0x1e'),{'options':{'where':{'phone':_0x4c1158['phone']},'attributes':['id']}});};exports[_0x3212('0x1f')]=function(_0x41237c){return request(_0x3212('0x20'),{'options':{'where':{'id':_0x41237c},'attributes':[_0x3212('0xb')]}});};exports[_0x3212('0x21')]=function(_0x4aa12a){return request(_0x3212('0x22'),{'options':{'where':{'id':_0x4aa12a},'attributes':[_0x3212('0x23')]}});};exports['getIntervalById']=function(_0x459b55){return request(_0x3212('0x24'),{'options':{'raw':![],'where':{'id':_0x459b55},'include':[{'model':_0x3212('0x25'),'as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x255d00){return request(_0x3212('0x26'),{'options':{'where':{'id':_0x255d00},'attributes':['id',_0x3212('0xb')]}});};exports[_0x3212('0x27')]=function(_0x3ceb3c){return request(_0x3212('0x28'),{'body':_0x3ceb3c});};exports['createSquareDetailsReport']=function(_0x565812){return request(_0x3212('0x29'),{'body':_0x565812});};exports['createSquareReport']=function(_0x24cdf3){return request(_0x3212('0x2a'),{'body':_[_0x3212('0x2b')](_0x24cdf3,{'project_name':_0x24cdf3['arg_1'],'prev_project_name':_0x24cdf3[_0x3212('0x2c')]||'','is_subproject':_0x24cdf3[_0x3212('0x2c')]?!![]:![],'leaveAt':moment()[_0x3212('0x2d')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x3212('0x2e')]=function(_0x35b4eb){return request(_0x3212('0x2f'),{'body':_0x35b4eb});};exports[_0x3212('0x30')]=function(_0x21f003){return request(_0x3212('0x31'),{'body':_0x21f003});};exports[_0x3212('0x32')]=function(_0x3813a3){return request(_0x3212('0x33'),{'options':{'raw':![],'where':{'phone':_0x3813a3[_0x3212('0x34')],'ListId':_0x3813a3[_0x3212('0x35')]}}})[_0x3212('0x6')](function(_0x57613f){if(_0x57613f){return _0x57613f;}return request(_0x3212('0x36'),{'body':_0x3813a3});});};exports[_0x3212('0x37')]=function(_0x4726fb){return request(_0x3212('0x38'),{'options':{'where':{'id':_0x4726fb},'attributes':[_0x3212('0xb')]}});};exports[_0x3212('0x39')]=function(_0x3a7883,_0x5059bd){return request(_0x3212('0x3a'),{'body':{'interface':_0x5059bd},'options':{'where':_0x3a7883}});};exports['agentPause']=function(_0x164b1f,_0x562c9f,_0x2fae5d){return request('PauseUser',{'body':{'type':_0x562c9f,'uniqueid':_0x2fae5d},'options':{'where':_0x164b1f}});};exports['agentUnpause']=function(_0x38f56a){return request('UnpauseUser',{'body':{},'options':{'where':_0x38f56a}});};exports[_0x3212('0x3b')]=function(_0x3754ce){return request(_0x3212('0x3c'),{'body':{},'options':{'where':_0x3754ce}});};
\ No newline at end of file
index 4d0973c..5234924 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa3f=['exports','./polly','./lex'];(function(_0x1ae254,_0x50c2ff){var _0x5a392c=function(_0x34c531){while(--_0x34c531){_0x1ae254['push'](_0x1ae254['shift']());}};_0x5a392c(++_0x50c2ff);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x4653d7,_0x34a1dc){_0x4653d7=_0x4653d7-0x0;var _0x23c761=_0xaa3f[_0x4653d7];return _0x23c761;};var polly=require(_0xfaa3('0x0'));var lex=require(_0xfaa3('0x1'));module[_0xfaa3('0x2')]={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0x87f1=['./lex','exports'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x87f1,0x170));var _0x187f=function(_0x568254,_0x719787){_0x568254=_0x568254-0x0;var _0x49d1b0=_0x87f1[_0x568254];return _0x49d1b0;};var polly=require('./polly');var lex=require(_0x187f('0x0'));module[_0x187f('0x1')]={'polly':polly,'lex':lex};
\ No newline at end of file
index 669b65e..9f14e4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdace=['./lib/api'];(function(_0x648163,_0x241576){var _0x199d4d=function(_0x23055d){while(--_0x23055d){_0x648163['push'](_0x648163['shift']());}};_0x199d4d(++_0x241576);}(_0xdace,0xc5));var _0xedac=function(_0x55d8c5,_0x10287a){_0x55d8c5=_0x55d8c5-0x0;var _0x225ae5=_0xdace[_0x55d8c5];return _0x225ae5;};'use strict';var lex=require(_0xedac('0x0'));module['exports']=function(_0x1c76b2,_0x13adb5,_0x46eba0,_0x518516,_0x413d77,_0x36bcd2){return lex(_0x1c76b2,_0x13adb5,_0x46eba0,_0x518516,_0x413d77,_0x36bcd2);};
\ No newline at end of file
+var _0xd64b=['./lib/api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd64b,0xc1));var _0xbd64=function(_0x11fc8b,_0x4ee51d){_0x11fc8b=_0x11fc8b-0x0;var _0x4ea86e=_0xd64b[_0x11fc8b];return _0x4ea86e;};'use strict';var lex=require(_0xbd64('0x0'));module['exports']=function(_0xf0de04,_0x4bfb7c,_0x30b9b3,_0xcbecd5,_0x64bd3b,_0x3f1f05){return lex(_0xf0de04,_0x4bfb7c,_0x30b9b3,_0xcbecd5,_0x64bd3b,_0x3f1f05);};
\ No newline at end of file
index e04b772..e06358c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x516df8,_0x3d65ef){var _0x558809=function(_0x10dabd){while(--_0x10dabd){_0x516df8['push'](_0x516df8['shift']());}};_0x558809(++_0x3d65ef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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(_0x47c8f0,_0x5bb499){var _0x52f892=function(_0x5127a1){while(--_0x5127a1){_0x47c8f0['push'](_0x47c8f0['shift']());}};_0x52f892(++_0x5bb499);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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 edfbf1f..b8aa5f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bed=['exports'];(function(_0x3de4f8,_0x336c7d){var _0x3d81fc=function(_0x53b9f9){while(--_0x53b9f9){_0x3de4f8['push'](_0x3de4f8['shift']());}};_0x3d81fc(++_0x336c7d);}(_0x1bed,0x116));var _0xd1be=function(_0x387611,_0x2fc0f0){_0x387611=_0x387611-0x0;var _0x9f9be6=_0x1bed[_0x387611];return _0x9f9be6;};'use strict';var polly=require('./lib/api');module[_0xd1be('0x0')]=function(_0x3d9952,_0x5f33d1,_0x4ad669,_0xeacf37,_0x35a659,_0x17b4bc,_0x1ea63a){return polly(_0x3d9952,_0x5f33d1,_0x4ad669,_0xeacf37,_0x35a659,_0x17b4bc,_0x1ea63a);};
\ No newline at end of file
+var _0xb369=['./lib/api','exports'];(function(_0xf13d92,_0x61142c){var _0x56ef0f=function(_0xe75b62){while(--_0xe75b62){_0xf13d92['push'](_0xf13d92['shift']());}};_0x56ef0f(++_0x61142c);}(_0xb369,0xf6));var _0x9b36=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xb369[_0x2c91e9];return _0x13f0ff;};'use strict';var polly=require(_0x9b36('0x0'));module[_0x9b36('0x1')]=function(_0x21dd3e,_0x43208f,_0x533a54,_0x21d006,_0x22c284,_0x524861,_0x21be7b){return polly(_0x21dd3e,_0x43208f,_0x533a54,_0x21d006,_0x22c284,_0x524861,_0x21be7b);};
\ No newline at end of file
index 6504aeb..ac8dc45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x606d=['synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','randomstring','aws-sdk'];(function(_0x18b52e,_0x5852b6){var _0x27899b=function(_0x5df315){while(--_0x5df315){_0x18b52e['push'](_0x18b52e['shift']());}};_0x27899b(++_0x5852b6);}(_0x606d,0x105));var _0xd606=function(_0x424dd0,_0x23f3ae){_0x424dd0=_0x424dd0-0x0;var _0x55ef22=_0x606d[_0x424dd0];return _0x55ef22;};'use strict';var fs=require('fs');var path=require(_0xd606('0x0'));var BPromise=require('bluebird');var rs=require(_0xd606('0x1'));var AWS=require(_0xd606('0x2'));function pollyResult(_0x326a65,_0x22fe59,_0x45f945){return new BPromise(function(_0xbf3624,_0x3505ba){_0x326a65[_0xd606('0x3')](_0x22fe59,function(_0x16a664,_0x212353){if(_0x16a664){_0x3505ba(_0x16a664);}else if(_0x212353){if(_0x212353[_0xd606('0x4')]instanceof Buffer){fs[_0xd606('0x5')](_0x45f945,_0x212353[_0xd606('0x4')],function(_0x32ef2b){if(_0x32ef2b){_0x3505ba(_0x32ef2b);}else{_0xbf3624();}});}else{_0x3505ba(new Error(_0xd606('0x6')));}}else{_0x3505ba(new Error(_0xd606('0x7')));}});});}module[_0xd606('0x8')]=function(_0x5ec8e3,_0x2468f2,_0x37d234,_0x78ccf2,_0x51c655,_0x4d418a,_0x2264c9){var _0x34fb9e=new AWS[(_0xd606('0x9'))]({'accessKeyId':_0x5ec8e3,'secretAccessKey':_0x2468f2,'region':_0x37d234});var _0x56ea31={'Text':_0x51c655,'TextType':_0x4d418a||_0xd606('0xa'),'OutputFormat':_0xd606('0xb'),'VoiceId':_0x78ccf2};return pollyResult(_0x34fb9e,_0x56ea31,_0x2264c9);};
\ No newline at end of file
+var _0x0ce0=['mp3','path','bluebird','randomstring','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly'];(function(_0x1dd82f,_0x52acb7){var _0x353ca4=function(_0x5ee4c9){while(--_0x5ee4c9){_0x1dd82f['push'](_0x1dd82f['shift']());}};_0x353ca4(++_0x52acb7);}(_0x0ce0,0xb1));var _0x00ce=function(_0x234577,_0x3b9004){_0x234577=_0x234577-0x0;var _0x28fea6=_0x0ce0[_0x234577];return _0x28fea6;};'use strict';var fs=require('fs');var path=require(_0x00ce('0x0'));var BPromise=require(_0x00ce('0x1'));var rs=require(_0x00ce('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x3b894a,_0x197c42,_0x23e750){return new BPromise(function(_0x373027,_0x3db538){_0x3b894a[_0x00ce('0x3')](_0x197c42,function(_0x281660,_0x418a9f){if(_0x281660){_0x3db538(_0x281660);}else if(_0x418a9f){if(_0x418a9f[_0x00ce('0x4')]instanceof Buffer){fs[_0x00ce('0x5')](_0x23e750,_0x418a9f[_0x00ce('0x4')],function(_0x3cc596){if(_0x3cc596){_0x3db538(_0x3cc596);}else{_0x373027();}});}else{_0x3db538(new Error(_0x00ce('0x6')));}}else{_0x3db538(new Error(_0x00ce('0x7')));}});});}module[_0x00ce('0x8')]=function(_0x1b8f57,_0x45f783,_0x314d88,_0x2c2ba5,_0x22adcb,_0x11101c,_0x144727){var _0x7603fb=new AWS[(_0x00ce('0x9'))]({'accessKeyId':_0x1b8f57,'secretAccessKey':_0x45f783,'region':_0x314d88});var _0x1af302={'Text':_0x22adcb,'TextType':_0x11101c||'text','OutputFormat':_0x00ce('0xa'),'VoiceId':_0x2c2ba5};return pollyResult(_0x7603fb,_0x1af302,_0x144727);};
\ No newline at end of file
index acee0fa..c02f9e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf20f=['./lib/api','exports'];(function(_0x58b801,_0x410ef2){var _0x2985a9=function(_0x2cfb36){while(--_0x2cfb36){_0x58b801['push'](_0x58b801['shift']());}};_0x2985a9(++_0x410ef2);}(_0xf20f,0xf4));var _0xff20=function(_0x328d6f,_0x5b1662){_0x328d6f=_0x328d6f-0x0;var _0x1d5160=_0xf20f[_0x328d6f];return _0x1d5160;};'use strict';var asr=require(_0xff20('0x0'));module[_0xff20('0x1')]=function(_0x59b0d8,_0x203a4b,_0x27fa16,_0x4bbd4a){return asr(_0x59b0d8,_0x203a4b,_0x27fa16);};
\ No newline at end of file
+var _0x2363=['exports','./lib/api'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2363,0x115));var _0x3236=function(_0xee5d37,_0xed0cbe){_0xee5d37=_0xee5d37-0x0;var _0x4cb59b=_0x2363[_0xee5d37];return _0x4cb59b;};'use strict';var asr=require(_0x3236('0x0'));module[_0x3236('0x1')]=function(_0x55f37c,_0x105749,_0x3ec217,_0x1d7194){return asr(_0x55f37c,_0x105749,_0x3ec217);};
\ No newline at end of file
index f41de42..0dc8fab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e0d=['url','exports','filepath\x20should\x20be\x20a\x20string','string','length','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','/v1/speech:recognize?key='];(function(_0x3ec74e,_0x2f6536){var _0x5a53f9=function(_0x461459){while(--_0x461459){_0x3ec74e['push'](_0x3ec74e['shift']());}};_0x5a53f9(++_0x2f6536);}(_0x8e0d,0x82));var _0xd8e0=function(_0x5e9876,_0x16052d){_0x5e9876=_0x5e9876-0x0;var _0x576c48=_0x8e0d[_0x5e9876];return _0x576c48;};'use strict';var url=require(_0xd8e0('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module[_0xd8e0('0x1')]=function(_0x11f7df,_0x549e82,_0x3ee520){return new BPromise(function(_0x180f36,_0x14598d){var _0xe9c59f;if(typeof _0x11f7df!=='string'||_0x11f7df['length']===0x0){return _0x14598d(_0xd8e0('0x2'));}if(typeof _0x549e82!==_0xd8e0('0x3')||_0x549e82[_0xd8e0('0x4')]===0x0){return _0x14598d(_0xd8e0('0x5'));}if(typeof _0x3ee520!=='undefined'&&(typeof _0x3ee520!==_0xd8e0('0x3')||_0x3ee520[_0xd8e0('0x4')]===0x0)){return _0x14598d(_0xd8e0('0x6'));}try{_0xe9c59f=fs[_0xd8e0('0x7')](_0x11f7df)[_0xd8e0('0x8')]('base64');}catch(_0x332007){return _0x14598d(_0x332007);}return _0x180f36({'method':'POST','uri':host+_0xd8e0('0x9')+_0x549e82,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':'8000','languageCode':_0x3ee520},'audio':{'content':_0xe9c59f}},'json':!![]});});};
\ No newline at end of file
+var _0x6e16=['base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','https://speech.googleapis.com','length','filepath\x20should\x20be\x20a\x20string','string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString'];(function(_0x51384e,_0x7d942a){var _0x4f6385=function(_0x4a22bc){while(--_0x4a22bc){_0x51384e['push'](_0x51384e['shift']());}};_0x4f6385(++_0x7d942a);}(_0x6e16,0x1d3));var _0x66e1=function(_0x3fe7c5,_0x1f9054){_0x3fe7c5=_0x3fe7c5-0x0;var _0xdd9274=_0x6e16[_0x3fe7c5];return _0xdd9274;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host=_0x66e1('0x0');module['exports']=function(_0xac185,_0x4e3854,_0x4f811b){return new BPromise(function(_0x45d429,_0x491345){var _0x892e60;if(typeof _0xac185!=='string'||_0xac185[_0x66e1('0x1')]===0x0){return _0x491345(_0x66e1('0x2'));}if(typeof _0x4e3854!==_0x66e1('0x3')||_0x4e3854['length']===0x0){return _0x491345(_0x66e1('0x4'));}if(typeof _0x4f811b!==_0x66e1('0x5')&&(typeof _0x4f811b!==_0x66e1('0x3')||_0x4f811b[_0x66e1('0x1')]===0x0)){return _0x491345(_0x66e1('0x6'));}try{_0x892e60=fs[_0x66e1('0x7')](_0xac185)[_0x66e1('0x8')](_0x66e1('0x9'));}catch(_0x9cba7){return _0x491345(_0x9cba7);}return _0x45d429({'method':_0x66e1('0xa'),'uri':host+_0x66e1('0xb')+_0x4e3854,'body':{'config':{'encoding':_0x66e1('0xc'),'sampleRateHertz':_0x66e1('0xd'),'languageCode':_0x4f811b},'audio':{'content':_0x892e60}},'json':!![]});});};
\ No newline at end of file
index 3e51f0d..632d1ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb761=['./asr'];(function(_0x4a180e,_0x3f9cb5){var _0x3a8eaa=function(_0x55b532){while(--_0x55b532){_0x4a180e['push'](_0x4a180e['shift']());}};_0x3a8eaa(++_0x3f9cb5);}(_0xb761,0x19c));var _0x1b76=function(_0x37d0bc,_0x109b96){_0x37d0bc=_0x37d0bc-0x0;var _0x170e60=_0xb761[_0x37d0bc];return _0x170e60;};var asr=require(_0x1b76('0x0'));module['exports']={'asr':asr};
\ No newline at end of file
+var _0x5b27=['exports','./asr'];(function(_0x4caf42,_0x1016d8){var _0x8d6285=function(_0x42c9a4){while(--_0x42c9a4){_0x4caf42['push'](_0x4caf42['shift']());}};_0x8d6285(++_0x1016d8);}(_0x5b27,0x1ed));var _0x75b2=function(_0x462406,_0xa107b9){_0x462406=_0x462406-0x0;var _0x784241=_0x5b27[_0x462406];return _0x784241;};var asr=require(_0x75b2('0x0'));module[_0x75b2('0x1')]={'asr':asr};
\ No newline at end of file
index d597b4d..adb22af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6965=['length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','.wav','goggleTTS\x20path','googleASR','uri','results','map','alternatives','join','confidence','googleASR\x20confidence','name','message','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','endConversation','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','isFallback','queryText','intentDetectionConfidence','tildeASR','asr','Tilde\x20ASR\x20transcription','transcript','awsPolly','polly','awsLex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile','dirName','apiai-promise','bluebird','http','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','download\x20error','pipe','get','data','end','wav','error\x20convert','finish\x20to\x20convert','resolve','writeFileSync','base64','then','unlink','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','tmp','generate','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','utf8','application/x-www-form-urlencoded','f.req=','stringify','generic','slice','parse\x20response\x20failed:\x0a'];(function(_0x2fcd90,_0x4780cc){var _0x55b596=function(_0xe475f6){while(--_0xe475f6){_0x2fcd90['push'](_0x2fcd90['shift']());}};_0x55b596(++_0x4780cc);}(_0x6965,0xd1));var _0x5696=function(_0x3258b6,_0x2d7ae1){_0x3258b6=_0x3258b6-0x0;var _0x54f732=_0x6965[_0x3258b6];return _0x54f732;};'use strict';var apiai=require(_0x5696('0x0'));var BPromise=require(_0x5696('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x5696('0x2'));var https=require('https');var md5=require(_0x5696('0x3'));var path=require(_0x5696('0x4'));var querystring=require(_0x5696('0x5'));var rp=require(_0x5696('0x6'));var rs=require(_0x5696('0x7'));var sox=require(_0x5696('0x8'));var tts=require(_0x5696('0x9'));var urlParse=require(_0x5696('0xa'))[_0x5696('0xb')];var util=require(_0x5696('0xc'));var aws=require(_0x5696('0xd'));var google=require(_0x5696('0xe'));var sestek=require(_0x5696('0xf'));var tilde=require(_0x5696('0x10'));var logger=require(_0x5696('0x11'))('agi');var ISPEECH_API=_0x5696('0x12');function downloadFile(_0x1dfcd4,_0x13d5d5){return new BPromise(function(_0x498f4b,_0x34c7c4){var _0xef92a0=urlParse(_0x1dfcd4);var _0xb0500b=_0xef92a0[_0x5696('0x13')]===_0x5696('0x14')?https:http;var _0x4082e1={'host':_0xef92a0[_0x5696('0x15')],'path':_0xef92a0[_0x5696('0x4')],'headers':{'user-agent':_0x5696('0x16')}};_0xb0500b['get'](_0x4082e1,function(_0x276ab6){if(_0x276ab6[_0x5696('0x17')]!==0xc8){logger[_0x5696('0x18')](_0x5696('0x19')+_0x1dfcd4+_0x5696('0x1a')+_0x276ab6[_0x5696('0x17')]+'\x20('+_0x276ab6[_0x5696('0x1b')]+')');_0x34c7c4(new Error('request\x20to\x20'+_0x1dfcd4+_0x5696('0x1a')+_0x276ab6[_0x5696('0x17')]+'\x20('+_0x276ab6[_0x5696('0x1b')]+')'));return;}var _0x2c9956=fs[_0x5696('0x1c')](_0x13d5d5);_0x2c9956['on'](_0x5696('0x1d'),function(){logger[_0x5696('0x1e')](_0x5696('0x1f'));_0x2c9956['close'](_0x498f4b);});_0x2c9956['on']('error',function(_0xce0771){fs['unlink'](_0x13d5d5);logger[_0x5696('0x18')](_0x5696('0x20'),_0xce0771);_0x34c7c4(_0xce0771);});_0x276ab6[_0x5696('0x21')](_0x2c9956);})['on'](_0x5696('0x18'),function(_0x1a40e3){logger['error'](_0x1a40e3);_0x34c7c4(_0x1a40e3);})['end']();});}function uploadFile(_0xe71d7f){return new BPromise(function(_0x1173eb,_0x5b7274){var _0x307e9c=urlParse(_0xe71d7f);var _0x160f22=_0x307e9c[_0x5696('0x13')]==='https:'?https:http;var _0x120c1b={'host':_0x307e9c[_0x5696('0x15')],'path':_0x307e9c[_0x5696('0x4')],'headers':{'user-agent':_0x5696('0x16')}};_0x160f22[_0x5696('0x22')](_0x120c1b,function(_0x1086ac){if(_0x1086ac[_0x5696('0x17')]!==0xc8){_0x5b7274(new Error(_0x5696('0x19')+_0xe71d7f+_0x5696('0x1a')+_0x1086ac[_0x5696('0x17')]+'\x20('+_0x1086ac[_0x5696('0x1b')]+')'));return;}var _0x21d64d='';_0x1086ac['on'](_0x5696('0x23'),function(_0x47f9a6){_0x21d64d+=_0x47f9a6;});_0x1086ac['on'](_0x5696('0x24'),function(){_0x1173eb(_0x21d64d);});})['on'](_0x5696('0x18'),function(_0x107b98){_0x5b7274(_0x107b98);})['end']();});}function convertFile(_0x11b31d,_0x4ccb8f){return new BPromise(function(_0x462b68,_0x2c29f0){var _0x3af553=sox['transcode'](_0x11b31d,_0x4ccb8f,{'sampleRate':0x1f40,'format':_0x5696('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3af553['on'](_0x5696('0x18'),function(_0x163f5d){logger['error'](_0x5696('0x26'),_0x163f5d);_0x2c29f0(_0x163f5d);});_0x3af553['on'](_0x5696('0x24'),function(){logger[_0x5696('0x1e')](_0x5696('0x27'));_0x462b68();});_0x3af553['start']();});}function base64Decode(_0x582a3f,_0xc8c5e9){var _0x420b83=path[_0x5696('0x28')](__dirname,'tmp',rs['generate'](0x4)+'.wav');fs[_0x5696('0x29')](_0x420b83,_0x582a3f,_0x5696('0x2a'));return convertFile(_0x420b83,_0xc8c5e9)[_0x5696('0x2b')](function(){try{fs[_0x5696('0x2c')](_0x420b83);fs[_0x5696('0x2d')](_0xc8c5e9,_0x5696('0x2e'));}catch(_0x4ec57b){logger[_0x5696('0x18')](_0x4ec57b);}return _0xc8c5e9[_0x5696('0x2f')]('.')[0x0];});}function base64Encode(_0x5537c3){var _0x5615b3=fs[_0x5696('0x30')](_0x5537c3);return new Buffer(_0x5615b3)[_0x5696('0x31')](_0x5696('0x2a'));}exports[_0x5696('0x32')]=function(_0x2af87d,_0xce180d,_0x7856a6,_0x9f8707,_0xc44120,_0x4910d4){var _0x3f084f,_0x31847e;var _0x268aab=_0x5696('0x33');var _0x2a4b98=_0x5696('0x34')+_0x2af87d;var _0x49a939={};if(_0xce180d===_0x5696('0x35')){_0x49a939[_0x5696('0x36')]={'ssml':_0x7856a6};}else{_0x49a939[_0x5696('0x36')]={'text':_0x7856a6};};_0x49a939[_0x5696('0x37')]={'languageCode':_0x9f8707,'ssmlGender':_0xc44120};_0x49a939[_0x5696('0x38')]={'audioEncoding':_0x5696('0x39'),'sampleRateHertz':0x1f40};var _0x16897e={'url':_0x268aab+_0x5696('0x3a')+_0x2a4b98,'method':_0x5696('0x3b'),'json':!![],'body':_0x49a939};return rp(_0x16897e)[_0x5696('0x2b')](function(_0x2a9b7f){return new BPromise(function(_0x512722,_0x545d94){_0x3f084f=path[_0x5696('0x28')](__dirname,_0x5696('0x3c'),rs[_0x5696('0x3d')](0x4)+_0x5696('0x3e'));var _0x195c84=Buffer[_0x5696('0x3f')](_0x2a9b7f[_0x5696('0x40')],'base64');return fs[_0x5696('0x41')](_0x3f084f,_0x195c84,function(_0x361484){_0x545d94(_0x361484);},function(_0x5cca9f){fs[_0x5696('0x2d')](_0x3f084f,_0x5696('0x2e'));_0x512722(_0x5cca9f);});});})['then'](function(_0x127939){_0x31847e=path[_0x5696('0x28')](__dirname,_0x5696('0x3c'),rs[_0x5696('0x3d')](0x4)+'.wav');return convertFile(_0x3f084f,_0x31847e);})['then'](function(){try{fs[_0x5696('0x2c')](_0x3f084f);fs[_0x5696('0x2d')](_0x31847e,_0x5696('0x2e'));}catch(_0x149615){logger[_0x5696('0x18')](_0x149615);}logger[_0x5696('0x1e')](_0x5696('0x42'),_0x31847e[_0x5696('0x2f')]('.')[0x0]);return _0x31847e[_0x5696('0x2f')]('.')[0x0];});};exports[_0x5696('0x43')]=function(_0x256e26,_0xaa389c){var _0x208dc4='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x5ee08a,_0x4578f0;var _0x165cd6;var _0x22e72c={'encoding':_0x5696('0x44'),'method':_0x5696('0x3b'),'timeout':0x2710,'url':_0x208dc4,'headers':{'Content-Type':_0x5696('0x45')},'body':_0x5696('0x46')+encodeURIComponent(JSON['stringify']([[['jQ1olc',JSON[_0x5696('0x47')]([_0x256e26,_0xaa389c||'en',![],'null']),null,_0x5696('0x48')]]]))};return rp(_0x22e72c)[_0x5696('0x2b')](function(_0x35e956){try{_0x165cd6=eval(_0x35e956[_0x5696('0x49')](0x5))[0x0][0x2];}catch(_0x353cf1){throw new Error(_0x5696('0x4a')+_0x35e956['data']);}if(!_0x165cd6){if(_0x256e26[_0x5696('0x4b')]>0xc8){throw new Error(_0x5696('0x4c'));}else{throw new Error(_0x5696('0x4d')+_0xaa389c+_0x5696('0x4e'));}}try{_0x165cd6=eval(_0x165cd6)[0x0];}catch(_0x3d3a97){throw new Error(_0x5696('0x4a')+res[_0x5696('0x23')]);}const _0x59a658=_0x165cd6;_0x5ee08a=path[_0x5696('0x28')](__dirname,_0x5696('0x3c'),rs[_0x5696('0x3d')](0x4)+_0x5696('0x3e'));fs[_0x5696('0x29')](_0x5ee08a,_0x165cd6,{'encoding':_0x5696('0x2a')});_0x4578f0=path[_0x5696('0x28')](__dirname,_0x5696('0x3c'),rs[_0x5696('0x3d')](0x4)+_0x5696('0x4f'));return convertFile(_0x5ee08a,_0x4578f0);})[_0x5696('0x2b')](function(){try{fs[_0x5696('0x2c')](_0x5ee08a);fs['chmodSync'](_0x4578f0,'777');}catch(_0x2edd3c){logger[_0x5696('0x18')](_0x2edd3c);}logger[_0x5696('0x1e')](_0x5696('0x50'),_0x4578f0['split']('.')[0x0]);return _0x4578f0['split']('.')[0x0];});};exports[_0x5696('0x51')]=function(_0x3fff1c,_0x2a3d2e,_0x56ed02){return google['asr'](_0x3fff1c,_0x2a3d2e,_0x56ed02)[_0x5696('0x2b')](function(_0x18a6c5){logger[_0x5696('0x1e')](_0x18a6c5[_0x5696('0x52')]);return rp(_0x18a6c5);})[_0x5696('0x2b')](function(_0x551b16){var _0x1a5c71='';var _0x54793a=0x0;try{fs[_0x5696('0x2c')](_0x3fff1c);}catch(_0x2ec5b1){logger[_0x5696('0x18')](_0x2ec5b1);}if(_0x551b16&&_0x551b16['results']){_0x1a5c71=_0x551b16[_0x5696('0x53')][_0x5696('0x54')](function(_0x15a895){return _0x15a895&&_0x15a895[_0x5696('0x55')][0x0]&&_0x15a895[_0x5696('0x55')][0x0]['transcript']?_0x15a895[_0x5696('0x55')][0x0]['transcript']:'';})[_0x5696('0x56')]('\x0a');_0x54793a=_0x551b16[_0x5696('0x53')]['map'](function(_0x17271e){return _0x17271e&&_0x17271e['alternatives'][0x0]&&_0x17271e[_0x5696('0x55')][0x0][_0x5696('0x57')]?_0x17271e[_0x5696('0x55')][0x0][_0x5696('0x57')]:0x0;})[_0x5696('0x56')]('\x0a');}logger[_0x5696('0x1e')]('googleASR\x20transcription',_0x1a5c71);logger[_0x5696('0x1e')](_0x5696('0x58'),_0x54793a);return{'transcript':_0x1a5c71,'confidence':_0x54793a};})['catch'](function(_0x5a02eb){logger[_0x5696('0x18')]('[%s]\x20%s:%s',_0x5a02eb[_0x5696('0x17')],_0x5a02eb[_0x5696('0x59')],_0x5a02eb[_0x5696('0x5a')]);});};exports['googleDialogflow']=function(_0x150a3b,_0x3bdb47,_0x4eb743,_0x4770c0){var _0x164c03=apiai(_0x3bdb47,{'language':_0x4770c0||'en'});return _0x164c03[_0x5696('0x5b')](_0x4eb743,{'sessionId':md5(_0x150a3b)})['then'](function(_0x4e6e42){logger[_0x5696('0x1e')](JSON[_0x5696('0x47')](_0x4e6e42));return{'source':_0x4e6e42[_0x5696('0x5c')][_0x5696('0x5d')],'resolvedQuery':_0x4e6e42['result'][_0x5696('0x5e')],'action':_0x4e6e42[_0x5696('0x5c')][_0x5696('0x5f')],'actionIncomplete':_0x4e6e42[_0x5696('0x5c')][_0x5696('0x60')],'speech':_0x4e6e42[_0x5696('0x5c')][_0x5696('0x61')][_0x5696('0x62')],'score':_0x4e6e42[_0x5696('0x5c')][_0x5696('0x63')],'statusCode':_0x4e6e42[_0x5696('0x64')][_0x5696('0x65')],'endConversation':_0x4e6e42['result']['metadata'][_0x5696('0x66')]||![],'isFallbackIntent':_0x4e6e42[_0x5696('0x5c')][_0x5696('0x67')][_0x5696('0x68')]};});};exports[_0x5696('0x69')]=function(_0xa81cf1,_0x6b7967,_0x5acf76,_0x31bb02,_0x51e8b3,_0x28502a){var _0x1948d5=_0x31bb02[_0x5696('0x6a')](/\\n/g,'\x0a');var _0x5c9a3a={'credentials':{'private_key':_0x1948d5,'client_email':_0x5acf76}};var _0x268c37=new dialogflow[(_0x5696('0x6b'))](_0x5c9a3a);var _0x39f83c=_0x268c37[_0x5696('0x6c')](_0x6b7967,md5(_0xa81cf1));var _0x8e4d87={'session':_0x39f83c,'queryInput':{'text':{'text':_0x51e8b3,'languageCode':_0x28502a}}};return _0x268c37[_0x5696('0x6d')](_0x8e4d87)['then'](function(_0x3ab7f2){if(_0x3ab7f2&&_0x3ab7f2['length']){logger[_0x5696('0x1e')](_0x5696('0x6e'),JSON[_0x5696('0x47')](_0x3ab7f2));var _0x4325f1=_0x3ab7f2[0x0];if(_0x4325f1){var _0x2f1a46={'action':_0x4325f1[_0x5696('0x6f')]['action'],'allRequiredParamsPresent':_0x4325f1[_0x5696('0x6f')]['allRequiredParamsPresent'],'endConversation':_0x4325f1[_0x5696('0x6f')]['diagnosticInfo']&&_0x4325f1['queryResult'][_0x5696('0x70')][_0x5696('0x71')]?_0x4325f1[_0x5696('0x6f')]['diagnosticInfo'][_0x5696('0x71')][_0x5696('0x72')][_0x5696('0x73')]:![],'fulfillmentText':_0x4325f1[_0x5696('0x6f')][_0x5696('0x74')],'intentName':_0x4325f1[_0x5696('0x6f')][_0x5696('0x75')][_0x5696('0x59')],'intentDisplayName':_0x4325f1[_0x5696('0x6f')][_0x5696('0x75')]['displayName'],'isFallbackIntent':_0x4325f1[_0x5696('0x6f')][_0x5696('0x75')][_0x5696('0x76')],'languageCode':_0x4325f1['queryResult']['languageCode'],'queryText':_0x4325f1[_0x5696('0x6f')][_0x5696('0x77')],'responseId':_0x4325f1['responseId'],'score':_0x4325f1[_0x5696('0x6f')][_0x5696('0x78')],'speech':_0x4325f1[_0x5696('0x6f')][_0x5696('0x74')],'providerResponse':JSON[_0x5696('0x47')](_0x3ab7f2)};return _0x2f1a46;}}});};exports[_0x5696('0x79')]=function(_0xfbf07c,_0x5c30ff,_0x231c61,_0x223b1d){return tilde[_0x5696('0x7a')](_0xfbf07c,_0x5c30ff,_0x231c61,_0x223b1d)[_0x5696('0x2b')](function(_0x3bfef9){try{fs['unlink'](_0xfbf07c);}catch(_0x39c4ec){logger[_0x5696('0x18')](_0x39c4ec);}logger[_0x5696('0x1e')](_0x5696('0x7b'),_0x3bfef9[_0x5696('0x7c')]);logger['info']('Tilde\x20ASR\x20confidence',_0x3bfef9['confidence']);return _0x3bfef9;});};exports[_0x5696('0x7d')]=function(_0x4ecacf,_0x46da8a,_0x551f6a,_0x1be541,_0x1d2b97,_0x42ba09){var _0x49e246=path['resolve'](__dirname,_0x5696('0x3c'),rs[_0x5696('0x3d')](0x4)+_0x5696('0x3e'));var _0x5bab21;return aws[_0x5696('0x7e')](_0x4ecacf,_0x46da8a,_0x551f6a,_0x1be541,_0x1d2b97,_0x42ba09,_0x49e246)[_0x5696('0x2b')](function(){_0x5bab21=path[_0x5696('0x28')](__dirname,'tmp',rs[_0x5696('0x3d')](0x4)+_0x5696('0x4f'));return convertFile(_0x49e246,_0x5bab21);})['then'](function(){try{fs['unlink'](_0x49e246);fs[_0x5696('0x2d')](_0x5bab21,'777');}catch(_0x55ef18){logger[_0x5696('0x18')](_0x55ef18);}return _0x5bab21['split']('.')[0x0];});};exports[_0x5696('0x7f')]=function(_0x1a766c,_0x21aa10,_0xcb19f8,_0x392d30,_0x46d8dc,_0x1c3c07){return aws['lex'](_0x1a766c,_0x21aa10,_0xcb19f8,_0x392d30,_0x46d8dc,_0x1c3c07)[_0x5696('0x2b')](function(_0x8113b1){logger[_0x5696('0x1e')](JSON[_0x5696('0x47')](_0x8113b1));return _0x8113b1;});};exports['ispeechTTS']=function(_0x1e62d3,_0x1d59c8,_0xeea767,_0x328e57){var _0x3ef2c2=util[_0x5696('0x80')](_0x5696('0x81'),ISPEECH_API,_0x1e62d3,encodeURIComponent(_0x1d59c8),_0xeea767,_0x328e57);var _0x2738ce=path[_0x5696('0x28')](__dirname,_0x5696('0x3c'),rs[_0x5696('0x3d')](0x4)+_0x5696('0x3e'));var _0x372556;return downloadFile(_0x3ef2c2,_0x2738ce)[_0x5696('0x2b')](function(){_0x372556=path[_0x5696('0x28')](__dirname,_0x5696('0x3c'),rs['generate'](0x4)+'.wav');return convertFile(_0x2738ce,_0x372556);})[_0x5696('0x2b')](function(){try{fs[_0x5696('0x2c')](_0x2738ce);fs[_0x5696('0x2d')](_0x372556,'777');}catch(_0x36cd20){logger['error'](_0x36cd20);}return _0x372556[_0x5696('0x2f')]('.')[0x0];});};exports[_0x5696('0x82')]=function(_0x81ee0e,_0x11255a,_0x420e7f,_0xb5ec42){var _0x1444cc=util[_0x5696('0x80')](_0x5696('0x83'),ISPEECH_API,_0x11255a,_0x420e7f,base64Encode(_0x81ee0e),_0xb5ec42?util[_0x5696('0x80')]('model=%s',encodeURIComponent(_0xb5ec42)):_0x5696('0x84'));return uploadFile(_0x1444cc)[_0x5696('0x2b')](function(_0x2d4dd0){return querystring['parse'](_0x2d4dd0);});};exports[_0x5696('0x85')]=function(_0x27af30,_0xc59404){return sestek[_0x5696('0x86')](_0x27af30,_0xc59404)['then'](function(_0x144724){logger[_0x5696('0x1e')](JSON[_0x5696('0x47')](_0x144724));var _0x2b9eca={'speech':_0x144724[_0x5696('0x87')],'action':_0x144724['channelData']?_0x144724[_0x5696('0x88')][_0x5696('0x89')]:undefined,'actiondata':_0x144724[_0x5696('0x88')]?_0x144724['channelData'][_0x5696('0x8a')]:undefined};if(_0x144724['channelData']&&_0x144724[_0x5696('0x88')][_0x5696('0x8b')]){return base64Decode(_0x144724[_0x5696('0x88')][_0x5696('0x8b')]['Data'],path['resolve'](__dirname,_0x5696('0x3c'),rs[_0x5696('0x3d')](0x4)+_0x5696('0x4f')))[_0x5696('0x2b')](function(_0x54474a){_0x2b9eca[_0x5696('0x8c')]=_0x54474a;return _0x2b9eca;});}return _0x2b9eca;});};exports[_0x5696('0x8d')]=function(){return __dirname;};
\ No newline at end of file
+var _0xbb19=['status','isFallbackIntent','replace','SessionsClient','sessionPath','detectIntent','length','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','boolValue','intent','name','displayName','isFallback','languageCode','responseId','intentDetectionConfidence','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','sox','url','parse','util','./aws','./sestek','../../../config/logger','agi','https:','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish','finish\x20download\x20file','download\x20error','protocol','host','data','end','transcode','wav','error\x20convert','info','finish\x20to\x20convert','resolve','tmp','generate','.wav','base64','unlink','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','MP3','text:synthesize','POST','then','.mp3','from','writeFile','googleCloudTTS\x20path','googleTTS','application/x-www-form-urlencoded','stringify','jQ1olc','null','generic','parse\x20response\x20failed:\x0a','lang\x20\x22','goggleTTS\x20path','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20confidence','catch','[%s]\x20%s:%s','message','googleDialogflow','textRequest','result','source','action','actionIncomplete','fulfillment','speech','score'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbb19,0x1bf));var _0x9bb1=function(_0xaec77c,_0x365e5f){_0xaec77c=_0xaec77c-0x0;var _0x124861=_0xbb19[_0xaec77c];return _0x124861;};'use strict';var apiai=require(_0x9bb1('0x0'));var BPromise=require(_0x9bb1('0x1'));var dialogflow=require(_0x9bb1('0x2'));var fs=require('fs');var http=require(_0x9bb1('0x3'));var https=require(_0x9bb1('0x4'));var md5=require(_0x9bb1('0x5'));var path=require(_0x9bb1('0x6'));var querystring=require(_0x9bb1('0x7'));var rp=require(_0x9bb1('0x8'));var rs=require(_0x9bb1('0x9'));var sox=require(_0x9bb1('0xa'));var tts=require('google-tts-api');var urlParse=require(_0x9bb1('0xb'))[_0x9bb1('0xc')];var util=require(_0x9bb1('0xd'));var aws=require(_0x9bb1('0xe'));var google=require('./google');var sestek=require(_0x9bb1('0xf'));var tilde=require('./tilde');var logger=require(_0x9bb1('0x10'))(_0x9bb1('0x11'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x1eb674,_0x514f11){return new BPromise(function(_0x340c85,_0x17ca32){var _0x445b2c=urlParse(_0x1eb674);var _0x4ae287=_0x445b2c['protocol']===_0x9bb1('0x12')?https:http;var _0x48fb1f={'host':_0x445b2c['host'],'path':_0x445b2c[_0x9bb1('0x6')],'headers':{'user-agent':_0x9bb1('0x13')}};_0x4ae287[_0x9bb1('0x14')](_0x48fb1f,function(_0x5f1da8){if(_0x5f1da8[_0x9bb1('0x15')]!==0xc8){logger[_0x9bb1('0x16')]('request\x20to\x20'+_0x1eb674+_0x9bb1('0x17')+_0x5f1da8[_0x9bb1('0x15')]+'\x20('+_0x5f1da8[_0x9bb1('0x18')]+')');_0x17ca32(new Error(_0x9bb1('0x19')+_0x1eb674+_0x9bb1('0x17')+_0x5f1da8[_0x9bb1('0x15')]+'\x20('+_0x5f1da8[_0x9bb1('0x18')]+')'));return;}var _0x283069=fs[_0x9bb1('0x1a')](_0x514f11);_0x283069['on'](_0x9bb1('0x1b'),function(){logger['info'](_0x9bb1('0x1c'));_0x283069['close'](_0x340c85);});_0x283069['on'](_0x9bb1('0x16'),function(_0x495d61){fs['unlink'](_0x514f11);logger[_0x9bb1('0x16')](_0x9bb1('0x1d'),_0x495d61);_0x17ca32(_0x495d61);});_0x5f1da8['pipe'](_0x283069);})['on'](_0x9bb1('0x16'),function(_0x3768f9){logger[_0x9bb1('0x16')](_0x3768f9);_0x17ca32(_0x3768f9);})['end']();});}function uploadFile(_0x28a630){return new BPromise(function(_0x21c579,_0x228417){var _0x23292c=urlParse(_0x28a630);var _0x35886f=_0x23292c[_0x9bb1('0x1e')]===_0x9bb1('0x12')?https:http;var _0x4c8d4a={'host':_0x23292c[_0x9bb1('0x1f')],'path':_0x23292c[_0x9bb1('0x6')],'headers':{'user-agent':_0x9bb1('0x13')}};_0x35886f[_0x9bb1('0x14')](_0x4c8d4a,function(_0x474b4e){if(_0x474b4e[_0x9bb1('0x15')]!==0xc8){_0x228417(new Error(_0x9bb1('0x19')+_0x28a630+_0x9bb1('0x17')+_0x474b4e[_0x9bb1('0x15')]+'\x20('+_0x474b4e[_0x9bb1('0x18')]+')'));return;}var _0x61ddd4='';_0x474b4e['on'](_0x9bb1('0x20'),function(_0x54bb85){_0x61ddd4+=_0x54bb85;});_0x474b4e['on']('end',function(){_0x21c579(_0x61ddd4);});})['on'](_0x9bb1('0x16'),function(_0x42978d){_0x228417(_0x42978d);})[_0x9bb1('0x21')]();});}function convertFile(_0xce2921,_0x2b441e){return new BPromise(function(_0x4ab5af,_0x2cac96){var _0x5ae5bb=sox[_0x9bb1('0x22')](_0xce2921,_0x2b441e,{'sampleRate':0x1f40,'format':_0x9bb1('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5ae5bb['on'](_0x9bb1('0x16'),function(_0x7fe5ec){logger['error'](_0x9bb1('0x24'),_0x7fe5ec);_0x2cac96(_0x7fe5ec);});_0x5ae5bb['on'](_0x9bb1('0x21'),function(){logger[_0x9bb1('0x25')](_0x9bb1('0x26'));_0x4ab5af();});_0x5ae5bb['start']();});}function base64Decode(_0x2342cc,_0x3275a8){var _0x411c56=path[_0x9bb1('0x27')](__dirname,_0x9bb1('0x28'),rs[_0x9bb1('0x29')](0x4)+_0x9bb1('0x2a'));fs['writeFileSync'](_0x411c56,_0x2342cc,_0x9bb1('0x2b'));return convertFile(_0x411c56,_0x3275a8)['then'](function(){try{fs[_0x9bb1('0x2c')](_0x411c56);fs[_0x9bb1('0x2d')](_0x3275a8,_0x9bb1('0x2e'));}catch(_0x4f48b6){logger[_0x9bb1('0x16')](_0x4f48b6);}return _0x3275a8[_0x9bb1('0x2f')]('.')[0x0];});}function base64Encode(_0x339620){var _0x4ef175=fs[_0x9bb1('0x30')](_0x339620);return new Buffer(_0x4ef175)[_0x9bb1('0x31')](_0x9bb1('0x2b'));}exports[_0x9bb1('0x32')]=function(_0x445db9,_0x340252,_0x30a1e4,_0x1554cc,_0x3b4a6b,_0x25023e){var _0x369520,_0x23eacf;var _0x31d5b9=_0x9bb1('0x33');var _0x306f29=_0x9bb1('0x34')+_0x445db9;var _0x2a76aa={};if(_0x340252===_0x9bb1('0x35')){_0x2a76aa[_0x9bb1('0x36')]={'ssml':_0x30a1e4};}else{_0x2a76aa[_0x9bb1('0x36')]={'text':_0x30a1e4};};_0x2a76aa[_0x9bb1('0x37')]={'languageCode':_0x1554cc,'ssmlGender':_0x3b4a6b};_0x2a76aa['audioConfig']={'audioEncoding':_0x9bb1('0x38'),'sampleRateHertz':0x1f40};var _0x538c8f={'url':_0x31d5b9+_0x9bb1('0x39')+_0x306f29,'method':_0x9bb1('0x3a'),'json':!![],'body':_0x2a76aa};return rp(_0x538c8f)[_0x9bb1('0x3b')](function(_0x4f06f0){return new BPromise(function(_0x2c4a03,_0x3734dd){_0x369520=path[_0x9bb1('0x27')](__dirname,_0x9bb1('0x28'),rs[_0x9bb1('0x29')](0x4)+_0x9bb1('0x3c'));var _0x126170=Buffer[_0x9bb1('0x3d')](_0x4f06f0['audioContent'],_0x9bb1('0x2b'));return fs[_0x9bb1('0x3e')](_0x369520,_0x126170,function(_0x53251a){_0x3734dd(_0x53251a);},function(_0x19eb7b){fs['chmodSync'](_0x369520,'777');_0x2c4a03(_0x19eb7b);});});})[_0x9bb1('0x3b')](function(_0xb96336){_0x23eacf=path[_0x9bb1('0x27')](__dirname,_0x9bb1('0x28'),rs[_0x9bb1('0x29')](0x4)+'.wav');return convertFile(_0x369520,_0x23eacf);})[_0x9bb1('0x3b')](function(){try{fs['unlink'](_0x369520);fs['chmodSync'](_0x23eacf,_0x9bb1('0x2e'));}catch(_0x13e1de){logger[_0x9bb1('0x16')](_0x13e1de);}logger['info'](_0x9bb1('0x3f'),_0x23eacf[_0x9bb1('0x2f')]('.')[0x0]);return _0x23eacf[_0x9bb1('0x2f')]('.')[0x0];});};exports[_0x9bb1('0x40')]=function(_0x3e2d2c,_0x5b1a53){var _0x57c3ab='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x3bec32,_0x43c534;var _0x2bbbca;var _0x3907e4={'encoding':'utf8','method':_0x9bb1('0x3a'),'timeout':0x2710,'url':_0x57c3ab,'headers':{'Content-Type':_0x9bb1('0x41')},'body':'f.req='+encodeURIComponent(JSON[_0x9bb1('0x42')]([[[_0x9bb1('0x43'),JSON[_0x9bb1('0x42')]([_0x3e2d2c,_0x5b1a53||'en',![],_0x9bb1('0x44')]),null,_0x9bb1('0x45')]]]))};return rp(_0x3907e4)[_0x9bb1('0x3b')](function(_0x38e5de){try{_0x2bbbca=eval(_0x38e5de['slice'](0x5))[0x0][0x2];}catch(_0x58424a){throw new Error(_0x9bb1('0x46')+_0x38e5de[_0x9bb1('0x20')]);}if(!_0x2bbbca){if(_0x3e2d2c['length']>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x9bb1('0x47')+_0x5b1a53+'\x22\x20might\x20not\x20exist');}}try{_0x2bbbca=eval(_0x2bbbca)[0x0];}catch(_0x5ac2b3){throw new Error(_0x9bb1('0x46')+res[_0x9bb1('0x20')]);}const _0x236c69=_0x2bbbca;_0x3bec32=path[_0x9bb1('0x27')](__dirname,'tmp',rs[_0x9bb1('0x29')](0x4)+_0x9bb1('0x3c'));fs['writeFileSync'](_0x3bec32,_0x2bbbca,{'encoding':_0x9bb1('0x2b')});_0x43c534=path[_0x9bb1('0x27')](__dirname,_0x9bb1('0x28'),rs[_0x9bb1('0x29')](0x4)+_0x9bb1('0x2a'));return convertFile(_0x3bec32,_0x43c534);})[_0x9bb1('0x3b')](function(){try{fs[_0x9bb1('0x2c')](_0x3bec32);fs[_0x9bb1('0x2d')](_0x43c534,'777');}catch(_0x1d49ab){logger[_0x9bb1('0x16')](_0x1d49ab);}logger[_0x9bb1('0x25')](_0x9bb1('0x48'),_0x43c534[_0x9bb1('0x2f')]('.')[0x0]);return _0x43c534[_0x9bb1('0x2f')]('.')[0x0];});};exports['googleASR']=function(_0x43b07a,_0x3474eb,_0x57a7e1){return google[_0x9bb1('0x49')](_0x43b07a,_0x3474eb,_0x57a7e1)[_0x9bb1('0x3b')](function(_0x3af416){logger['info'](_0x3af416['uri']);return rp(_0x3af416);})[_0x9bb1('0x3b')](function(_0x3f9614){var _0x418516='';var _0x373cef=0x0;try{fs['unlink'](_0x43b07a);}catch(_0x58cf5b){logger[_0x9bb1('0x16')](_0x58cf5b);}if(_0x3f9614&&_0x3f9614[_0x9bb1('0x4a')]){_0x418516=_0x3f9614['results'][_0x9bb1('0x4b')](function(_0x5525cc){return _0x5525cc&&_0x5525cc[_0x9bb1('0x4c')][0x0]&&_0x5525cc[_0x9bb1('0x4c')][0x0]['transcript']?_0x5525cc[_0x9bb1('0x4c')][0x0][_0x9bb1('0x4d')]:'';})[_0x9bb1('0x4e')]('\x0a');_0x373cef=_0x3f9614[_0x9bb1('0x4a')][_0x9bb1('0x4b')](function(_0x557537){return _0x557537&&_0x557537['alternatives'][0x0]&&_0x557537[_0x9bb1('0x4c')][0x0][_0x9bb1('0x4f')]?_0x557537['alternatives'][0x0][_0x9bb1('0x4f')]:0x0;})['join']('\x0a');}logger[_0x9bb1('0x25')]('googleASR\x20transcription',_0x418516);logger[_0x9bb1('0x25')](_0x9bb1('0x50'),_0x373cef);return{'transcript':_0x418516,'confidence':_0x373cef};})[_0x9bb1('0x51')](function(_0x9e8b3e){logger[_0x9bb1('0x16')](_0x9bb1('0x52'),_0x9e8b3e[_0x9bb1('0x15')],_0x9e8b3e['name'],_0x9e8b3e[_0x9bb1('0x53')]);});};exports[_0x9bb1('0x54')]=function(_0x2ccf5d,_0x308336,_0x33ad79,_0x3f5f57){var _0x1934ae=apiai(_0x308336,{'language':_0x3f5f57||'en'});return _0x1934ae[_0x9bb1('0x55')](_0x33ad79,{'sessionId':md5(_0x2ccf5d)})['then'](function(_0x5e81b0){logger['info'](JSON[_0x9bb1('0x42')](_0x5e81b0));return{'source':_0x5e81b0[_0x9bb1('0x56')][_0x9bb1('0x57')],'resolvedQuery':_0x5e81b0['result']['resolvedQuery'],'action':_0x5e81b0['result'][_0x9bb1('0x58')],'actionIncomplete':_0x5e81b0['result'][_0x9bb1('0x59')],'speech':_0x5e81b0[_0x9bb1('0x56')][_0x9bb1('0x5a')][_0x9bb1('0x5b')],'score':_0x5e81b0[_0x9bb1('0x56')][_0x9bb1('0x5c')],'statusCode':_0x5e81b0[_0x9bb1('0x5d')]['code'],'endConversation':_0x5e81b0['result']['metadata']['endConversation']||![],'isFallbackIntent':_0x5e81b0[_0x9bb1('0x56')]['metadata'][_0x9bb1('0x5e')]};});};exports['googleDialogflowV2']=function(_0x2fcba0,_0x1263cf,_0x223b96,_0x5bac1f,_0x5a8acb,_0x43e753){var _0x2f7657=_0x5bac1f[_0x9bb1('0x5f')](/\\n/g,'\x0a');var _0x8037ae={'credentials':{'private_key':_0x2f7657,'client_email':_0x223b96}};var _0x53ef87=new dialogflow[(_0x9bb1('0x60'))](_0x8037ae);var _0x24513a=_0x53ef87[_0x9bb1('0x61')](_0x1263cf,md5(_0x2fcba0));var _0x39c4c5={'session':_0x24513a,'queryInput':{'text':{'text':_0x5a8acb,'languageCode':_0x43e753}}};return _0x53ef87[_0x9bb1('0x62')](_0x39c4c5)['then'](function(_0x159a2d){if(_0x159a2d&&_0x159a2d[_0x9bb1('0x63')]){logger['info'](_0x9bb1('0x64'),JSON['stringify'](_0x159a2d));var _0x33ac1b=_0x159a2d[0x0];if(_0x33ac1b){var _0x3670dd={'action':_0x33ac1b[_0x9bb1('0x65')]['action'],'allRequiredParamsPresent':_0x33ac1b['queryResult']['allRequiredParamsPresent'],'endConversation':_0x33ac1b[_0x9bb1('0x65')]['diagnosticInfo']&&_0x33ac1b[_0x9bb1('0x65')][_0x9bb1('0x66')]['fields']?_0x33ac1b[_0x9bb1('0x65')]['diagnosticInfo'][_0x9bb1('0x67')]['end_conversation'][_0x9bb1('0x68')]:![],'fulfillmentText':_0x33ac1b['queryResult']['fulfillmentText'],'intentName':_0x33ac1b[_0x9bb1('0x65')][_0x9bb1('0x69')][_0x9bb1('0x6a')],'intentDisplayName':_0x33ac1b[_0x9bb1('0x65')][_0x9bb1('0x69')][_0x9bb1('0x6b')],'isFallbackIntent':_0x33ac1b[_0x9bb1('0x65')]['intent'][_0x9bb1('0x6c')],'languageCode':_0x33ac1b[_0x9bb1('0x65')][_0x9bb1('0x6d')],'queryText':_0x33ac1b[_0x9bb1('0x65')]['queryText'],'responseId':_0x33ac1b[_0x9bb1('0x6e')],'score':_0x33ac1b['queryResult'][_0x9bb1('0x6f')],'speech':_0x33ac1b[_0x9bb1('0x65')][_0x9bb1('0x70')],'providerResponse':JSON['stringify'](_0x159a2d)};return _0x3670dd;}}});};exports[_0x9bb1('0x71')]=function(_0x1ea9f5,_0x3046a3,_0x5364a7,_0x37abc1){return tilde[_0x9bb1('0x49')](_0x1ea9f5,_0x3046a3,_0x5364a7,_0x37abc1)[_0x9bb1('0x3b')](function(_0x3e9edd){try{fs[_0x9bb1('0x2c')](_0x1ea9f5);}catch(_0xa7e120){logger[_0x9bb1('0x16')](_0xa7e120);}logger['info'](_0x9bb1('0x72'),_0x3e9edd[_0x9bb1('0x4d')]);logger[_0x9bb1('0x25')](_0x9bb1('0x73'),_0x3e9edd[_0x9bb1('0x4f')]);return _0x3e9edd;});};exports[_0x9bb1('0x74')]=function(_0x40b765,_0x164c75,_0x4435a9,_0x4eb8f1,_0x456bf2,_0x42812c){var _0xce0883=path[_0x9bb1('0x27')](__dirname,_0x9bb1('0x28'),rs[_0x9bb1('0x29')](0x4)+_0x9bb1('0x3c'));var _0x1418ba;return aws[_0x9bb1('0x75')](_0x40b765,_0x164c75,_0x4435a9,_0x4eb8f1,_0x456bf2,_0x42812c,_0xce0883)[_0x9bb1('0x3b')](function(){_0x1418ba=path[_0x9bb1('0x27')](__dirname,_0x9bb1('0x28'),rs[_0x9bb1('0x29')](0x4)+'.wav');return convertFile(_0xce0883,_0x1418ba);})['then'](function(){try{fs[_0x9bb1('0x2c')](_0xce0883);fs[_0x9bb1('0x2d')](_0x1418ba,'777');}catch(_0xf48f4e){logger[_0x9bb1('0x16')](_0xf48f4e);}return _0x1418ba['split']('.')[0x0];});};exports['awsLex']=function(_0x2186cd,_0x39df95,_0x26b971,_0x2f7f9e,_0xfe5dc9,_0x205053){return aws[_0x9bb1('0x76')](_0x2186cd,_0x39df95,_0x26b971,_0x2f7f9e,_0xfe5dc9,_0x205053)[_0x9bb1('0x3b')](function(_0x529962){logger[_0x9bb1('0x25')](JSON['stringify'](_0x529962));return _0x529962;});};exports[_0x9bb1('0x77')]=function(_0x14ad6f,_0x107621,_0x226c59,_0xe4155b){var _0x50c4cc=util[_0x9bb1('0x78')](_0x9bb1('0x79'),ISPEECH_API,_0x14ad6f,encodeURIComponent(_0x107621),_0x226c59,_0xe4155b);var _0x202428=path[_0x9bb1('0x27')](__dirname,_0x9bb1('0x28'),rs[_0x9bb1('0x29')](0x4)+_0x9bb1('0x3c'));var _0x515194;return downloadFile(_0x50c4cc,_0x202428)[_0x9bb1('0x3b')](function(){_0x515194=path['resolve'](__dirname,_0x9bb1('0x28'),rs[_0x9bb1('0x29')](0x4)+_0x9bb1('0x2a'));return convertFile(_0x202428,_0x515194);})[_0x9bb1('0x3b')](function(){try{fs['unlink'](_0x202428);fs[_0x9bb1('0x2d')](_0x515194,_0x9bb1('0x2e'));}catch(_0x33017b){logger[_0x9bb1('0x16')](_0x33017b);}return _0x515194[_0x9bb1('0x2f')]('.')[0x0];});};exports[_0x9bb1('0x7a')]=function(_0x2985e6,_0x5149d1,_0x53f6ff,_0x3aafe8){var _0x30b835=util['format'](_0x9bb1('0x7b'),ISPEECH_API,_0x5149d1,_0x53f6ff,base64Encode(_0x2985e6),_0x3aafe8?util[_0x9bb1('0x78')](_0x9bb1('0x7c'),encodeURIComponent(_0x3aafe8)):_0x9bb1('0x7d'));return uploadFile(_0x30b835)[_0x9bb1('0x3b')](function(_0x339255){return querystring[_0x9bb1('0xc')](_0x339255);});};exports[_0x9bb1('0x7e')]=function(_0x2a2689,_0x495df0){return sestek[_0x9bb1('0x7f')](_0x2a2689,_0x495df0)[_0x9bb1('0x3b')](function(_0x2a6545){logger[_0x9bb1('0x25')](JSON[_0x9bb1('0x42')](_0x2a6545));var _0xdbba68={'speech':_0x2a6545['text'],'action':_0x2a6545[_0x9bb1('0x80')]?_0x2a6545['channelData'][_0x9bb1('0x81')]:undefined,'actiondata':_0x2a6545[_0x9bb1('0x80')]?_0x2a6545['channelData'][_0x9bb1('0x82')]:undefined};if(_0x2a6545[_0x9bb1('0x80')]&&_0x2a6545[_0x9bb1('0x80')]['AudioFromTts']){return base64Decode(_0x2a6545[_0x9bb1('0x80')][_0x9bb1('0x83')][_0x9bb1('0x84')],path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x9bb1('0x2a')))['then'](function(_0x59f14d){_0xdbba68[_0x9bb1('0x85')]=_0x59f14d;return _0xdbba68;});}return _0xdbba68;});};exports[_0x9bb1('0x86')]=function(){return __dirname;};
\ No newline at end of file
index 391d1b2..db649e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb309=['./nda'];(function(_0x16ca11,_0x5c8f1e){var _0x3c8f7e=function(_0x4cb921){while(--_0x4cb921){_0x16ca11['push'](_0x16ca11['shift']());}};_0x3c8f7e(++_0x5c8f1e);}(_0xb309,0x129));var _0x9b30=function(_0x1eb64b,_0x1ec889){_0x1eb64b=_0x1eb64b-0x0;var _0x1498e0=_0xb309[_0x1eb64b];return _0x1498e0;};var nda=require(_0x9b30('0x0'));module['exports']={'nda':nda};
\ No newline at end of file
+var _0xde57=['exports','./nda'];(function(_0x54a2e4,_0x1ff92c){var _0x4742d0=function(_0x147a6f){while(--_0x147a6f){_0x54a2e4['push'](_0x54a2e4['shift']());}};_0x4742d0(++_0x1ff92c);}(_0xde57,0x6d));var _0x7de5=function(_0x1b02bb,_0x3d9fde){_0x1b02bb=_0x1b02bb-0x0;var _0x131245=_0xde57[_0x1b02bb];return _0x131245;};var nda=require(_0x7de5('0x0'));module[_0x7de5('0x1')]={'nda':nda};
\ No newline at end of file
index bbcb837..e098e05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40ca=['POST','ndauth_url','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension','Bearer\x20','project','body','channelData','ProjectName','audio/wav','CustomAction','CustomActionData','custom_action_data','info','stringify','request-promise','agi','exports'];(function(_0xcaf3d8,_0x2af9a8){var _0x4d1cb9=function(_0x55e179){while(--_0x55e179){_0xcaf3d8['push'](_0xcaf3d8['shift']());}};_0x4d1cb9(++_0x2af9a8);}(_0x40ca,0x1a1));var _0xa40c=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x40ca[_0x2ec461];return _0x28603d;};'use strict';var rp=require(_0xa40c('0x0'));var url=require('url');var logger=require('../../../../../config/logger')(_0xa40c('0x1'));module[_0xa40c('0x2')]=function(_0x2c7760,_0x1f2731){var _0x5e774a={'method':_0xa40c('0x3'),'uri':url['resolve'](_0x1f2731[_0xa40c('0x4')],'/token'),'form':{'grant_type':_0xa40c('0x5'),'username':_0x1f2731['username'],'password':_0x1f2731[_0xa40c('0x5')]},'json':!![]};return rp(_0x5e774a)[_0xa40c('0x6')](function(_0x6fadf3){var _0x444497={'method':_0xa40c('0x3'),'uri':url['resolve'](_0x1f2731[_0xa40c('0x7')],_0xa40c('0x8')),'body':{'type':_0x1f2731[_0xa40c('0x9')]||_0xa40c('0xa'),'channelId':_0xa40c('0xb'),'conversation':{'id':_0x2c7760[_0xa40c('0xc')]},'from':{'id':_0x2c7760[_0xa40c('0xd')],'name':_0x2c7760[_0xa40c('0xe')]},'recipient':{'id':_0x2c7760[_0xa40c('0xf')],'name':_0x2c7760[_0xa40c('0x10')]},'text':_0x1f2731['text'],'channelData':{}},'headers':{'Authorization':_0xa40c('0x11')+_0x6fadf3['access_token']},'json':!![]};if(_0x1f2731[_0xa40c('0x12')]){_0x444497[_0xa40c('0x13')][_0xa40c('0x14')][_0xa40c('0x15')]=_0x1f2731[_0xa40c('0x12')];}if(_0x1f2731['ndagenerate_audio']=='1'){_0x444497[_0xa40c('0x13')][_0xa40c('0x14')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xa40c('0x16')};}if(_0x1f2731['custom_action']){_0x444497[_0xa40c('0x13')][_0xa40c('0x14')][_0xa40c('0x17')]=_0x1f2731['custom_action'];if(_0x1f2731['custom_action_data']){_0x444497[_0xa40c('0x13')][_0xa40c('0x14')][_0xa40c('0x18')]=_0x1f2731[_0xa40c('0x19')];}}logger[_0xa40c('0x1a')](JSON[_0xa40c('0x1b')](_0x444497));return rp(_0x444497);});};
\ No newline at end of file
+var _0xa71a=['Nda','uniqueid','callerid','calleridname','dnid','extension','project','body','channelData','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','resolve','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xa71a,0xf1));var _0xaa71=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa71a[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require(_0xaa71('0x0'));var url=require(_0xaa71('0x1'));var logger=require(_0xaa71('0x2'))(_0xaa71('0x3'));module['exports']=function(_0x231220,_0x583869){var _0xebe9e7={'method':'POST','uri':url[_0xaa71('0x4')](_0x583869['ndauth_url'],_0xaa71('0x5')),'form':{'grant_type':_0xaa71('0x6'),'username':_0x583869[_0xaa71('0x7')],'password':_0x583869['password']},'json':!![]};return rp(_0xebe9e7)[_0xaa71('0x8')](function(_0x35b8cf){var _0x5a0dca={'method':'POST','uri':url[_0xaa71('0x4')](_0x583869[_0xaa71('0x9')],_0xaa71('0xa')),'body':{'type':_0x583869['ndaactivity_type']||'message','channelId':_0xaa71('0xb'),'conversation':{'id':_0x231220[_0xaa71('0xc')]},'from':{'id':_0x231220[_0xaa71('0xd')],'name':_0x231220[_0xaa71('0xe')]},'recipient':{'id':_0x231220[_0xaa71('0xf')],'name':_0x231220[_0xaa71('0x10')]},'text':_0x583869['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x35b8cf['access_token']},'json':!![]};if(_0x583869[_0xaa71('0x11')]){_0x5a0dca[_0xaa71('0x12')][_0xaa71('0x13')]['ProjectName']=_0x583869[_0xaa71('0x11')];}if(_0x583869[_0xaa71('0x14')]=='1'){_0x5a0dca[_0xaa71('0x12')][_0xaa71('0x13')][_0xaa71('0x15')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xaa71('0x16')};}if(_0x583869['custom_action']){_0x5a0dca[_0xaa71('0x12')][_0xaa71('0x13')][_0xaa71('0x17')]=_0x583869['custom_action'];if(_0x583869[_0xaa71('0x18')]){_0x5a0dca[_0xaa71('0x12')][_0xaa71('0x13')][_0xaa71('0x19')]=_0x583869[_0xaa71('0x18')];}}logger[_0xaa71('0x1a')](JSON[_0xaa71('0x1b')](_0x5a0dca));return rp(_0x5a0dca);});};
\ No newline at end of file
index 6dd10ae..9f51bf0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39d2=['./lib/api','exports'];(function(_0x158f01,_0x12af3e){var _0x5ef74e=function(_0x5e7adc){while(--_0x5e7adc){_0x158f01['push'](_0x158f01['shift']());}};_0x5ef74e(++_0x12af3e);}(_0x39d2,0x14e));var _0x239d=function(_0x3b19ea,_0x518b6b){_0x3b19ea=_0x3b19ea-0x0;var _0x40ece9=_0x39d2[_0x3b19ea];return _0x40ece9;};'use strict';var asr=require(_0x239d('0x0'));module[_0x239d('0x1')]=function(_0x59d9e1,_0x217df8,_0x53b347,_0x4fa799){return asr(_0x59d9e1,_0x217df8,_0x53b347,_0x4fa799);};
\ No newline at end of file
+var _0xcf8a=['exports','./lib/api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcf8a,0x1c5));var _0xacf8=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xcf8a[_0x57b54c];return _0x59cc19;};'use strict';var asr=require(_0xacf8('0x0'));module[_0xacf8('0x1')]=function(_0x12d458,_0x269002,_0x315362,_0xad4d7e){return asr(_0x12d458,_0x269002,_0x315362,_0xad4d7e);};
\ No newline at end of file
index 0a11daa..5e1e7af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd471=['createReadStream','data','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','isObject','open','bluebird','moment','crypto','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix'];(function(_0x5a27e8,_0x492a2f){var _0x4e38f7=function(_0x2a4048){while(--_0x2a4048){_0x5a27e8['push'](_0x5a27e8['shift']());}};_0x4e38f7(++_0x492a2f);}(_0xd471,0x6c));var _0x1d47=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xd471[_0x13d07a];return _0x5ee0ee;};'use strict';var BPromise=require(_0x1d47('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x1d47('0x1'));var crypto=require(_0x1d47('0x2'));var logger=require('../../../../../../config/logger')(_0x1d47('0x3'));module[_0x1d47('0x4')]=function(_0x35ae3f,_0x1088dc,_0x374cfe,_0x380455){return new BPromise(function(_0x66a199,_0x30488b){logger[_0x1d47('0x5')](_0x1d47('0x6'),_0x380455||_0x1d47('0x7'));var _0x39b863=new WebSocket(_0x380455||_0x1d47('0x7'),{'perMessageDeflate':![]});var _0x3bb6ec='';var _0x214c04='0';var _0x41ce5e='1';var _0x334a29='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x5d1e26(_0x3b2308){var _0x3e3e83=crypto[_0x1d47('0x8')](_0x1d47('0x9'));_0x3e3e83[_0x1d47('0xa')](_0x3b2308);return _0x3e3e83[_0x1d47('0xb')](_0x1d47('0xc'));}function _0x1eb16a(){try{logger['info'](_0x1d47('0xd'));var _0xdecb48=moment()[_0x1d47('0xe')]();var _0x4676ec=_0x5d1e26(_0xdecb48+_0x1088dc+_0x374cfe);_0x39b863['send'](JSON['stringify']({'appID':_0x1088dc,'timestamp':_0xdecb48,'appKey':_0x4676ec}));var _0x8c653d=fs[_0x1d47('0xf')](_0x35ae3f);_0x8c653d['on'](_0x1d47('0x10'),function(_0x7099cc){_0x39b863[_0x1d47('0x11')](_0x7099cc);});_0x8c653d['on'](_0x1d47('0x12'),function(){_0x39b863[_0x1d47('0x11')](_0x1d47('0x13'));});}catch(_0x491bbf){logger[_0x1d47('0x14')](_0x1d47('0x15'),JSON[_0x1d47('0x16')](_0x491bbf));_0x39b863[_0x1d47('0x17')]();}}function _0x28daee(_0x43856b){try{if(_0x43856b){var _0xe47edf=JSON[_0x1d47('0x18')](_0x43856b);switch(_0xe47edf[_0x1d47('0x19')]){case 0x0:if(_0xe47edf['result']){if(_0xe47edf[_0x1d47('0x1a')][_0x1d47('0x1b')]){logger[_0x1d47('0x5')](_0x1d47('0x1c'),JSON[_0x1d47('0x16')](_0xe47edf[_0x1d47('0x1a')][_0x1d47('0x1d')]));_0x3bb6ec=_0xe47edf[_0x1d47('0x1a')][_0x1d47('0x1d')][0x0]['transcript'];_0x214c04=_0xe47edf[_0x1d47('0x1a')][_0x1d47('0x1d')][0x0]['likelihood'];_0x41ce5e='0';_0x334a29=_0x1d47('0x1e');_0x39b863[_0x1d47('0x17')]();}}break;case 0x1:logger[_0x1d47('0x5')](_0x1d47('0x1f'));_0x41ce5e='1';_0x334a29='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x1d47('0x5')](_0x1d47('0x20'));_0x41ce5e='2';_0x334a29=_0x1d47('0x20');break;case 0x9:logger['info'](_0x1d47('0x21'));_0x41ce5e='9';_0x334a29=_0x1d47('0x21');break;case 0xa:logger[_0x1d47('0x5')](_0x1d47('0x22'));_0x41ce5e='10';_0x334a29='Authentication\x20failed.';break;case 0xb:logger[_0x1d47('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x41ce5e='11';_0x334a29=_0x1d47('0x23');}}}catch(_0x49e4f8){logger[_0x1d47('0x14')](_0x1d47('0x24'),JSON['stringify'](_0x49e4f8));_0x39b863[_0x1d47('0x17')]();}}function _0x460dce(){logger[_0x1d47('0x5')](_0x1d47('0x25'));_0x66a199({'transcript':_0x3bb6ec,'confidence':_0x214c04,'status':_0x41ce5e,'status_message':_0x334a29});}function _0xb7c81a(_0x351a19){logger['error']('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x1d47('0x26')](_0x351a19)){logger[_0x1d47('0x14')](_[_0x1d47('0x27')](_0x351a19)?JSON[_0x1d47('0x16')](_0x351a19):_0x351a19);}}_0x39b863['on'](_0x1d47('0x28'),_0x1eb16a);_0x39b863['on']('message',_0x28daee);_0x39b863['on'](_0x1d47('0x12'),_0x460dce);_0x39b863['on']('error',_0xb7c81a);});};
\ No newline at end of file
+var _0x337a=['hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','Open\x20Tilde\x20ASR\x20socket','unix','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses'];(function(_0x5f49c3,_0x5dd26b){var _0x34a453=function(_0x17025d){while(--_0x17025d){_0x5f49c3['push'](_0x5f49c3['shift']());}};_0x34a453(++_0x5dd26b);}(_0x337a,0x1ee));var _0xa337=function(_0x2f23f9,_0xff675e){_0x2f23f9=_0x2f23f9-0x0;var _0x2a75f0=_0x337a[_0x2f23f9];return _0x2a75f0;};'use strict';var BPromise=require('bluebird');var _=require(_0xa337('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xa337('0x1'));var crypto=require(_0xa337('0x2'));var logger=require(_0xa337('0x3'))(_0xa337('0x4'));module[_0xa337('0x5')]=function(_0x263468,_0x34fa30,_0x3122de,_0x4a3f8f){return new BPromise(function(_0x2c410e,_0x1f8575){logger[_0xa337('0x6')](_0xa337('0x7'),_0x4a3f8f||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x19d342=new WebSocket(_0x4a3f8f||_0xa337('0x8'),{'perMessageDeflate':![]});var _0x386fda='';var _0xb24ace='0';var _0x4db6f3='1';var _0xff19bc=_0xa337('0x9');function _0x165166(_0x22ebb2){var _0x4d5e66=crypto[_0xa337('0xa')]('sha1');_0x4d5e66[_0xa337('0xb')](_0x22ebb2);return _0x4d5e66['digest']('hex');}function _0x5c4d4c(){try{logger['info'](_0xa337('0xc'));var _0x5bea59=moment()[_0xa337('0xd')]();var _0x35552a=_0x165166(_0x5bea59+_0x34fa30+_0x3122de);_0x19d342[_0xa337('0xe')](JSON['stringify']({'appID':_0x34fa30,'timestamp':_0x5bea59,'appKey':_0x35552a}));var _0x5c49d1=fs['createReadStream'](_0x263468);_0x5c49d1['on']('data',function(_0x37bc1f){_0x19d342[_0xa337('0xe')](_0x37bc1f);});_0x5c49d1['on'](_0xa337('0xf'),function(){_0x19d342[_0xa337('0xe')](_0xa337('0x10'));});}catch(_0x3143d8){logger[_0xa337('0x11')](_0xa337('0x12'),JSON[_0xa337('0x13')](_0x3143d8));_0x19d342[_0xa337('0x14')]();}}function _0x59f7f8(_0x391930){try{if(_0x391930){var _0x23a575=JSON[_0xa337('0x15')](_0x391930);switch(_0x23a575[_0xa337('0x16')]){case 0x0:if(_0x23a575[_0xa337('0x17')]){if(_0x23a575[_0xa337('0x17')][_0xa337('0x18')]){logger['info'](_0xa337('0x19'),JSON['stringify'](_0x23a575[_0xa337('0x17')][_0xa337('0x1a')]));_0x386fda=_0x23a575['result'][_0xa337('0x1a')][0x0][_0xa337('0x1b')];_0xb24ace=_0x23a575[_0xa337('0x17')]['hypotheses'][0x0][_0xa337('0x1c')];_0x4db6f3='0';_0xff19bc='Success.';_0x19d342['terminate']();}}break;case 0x1:logger[_0xa337('0x6')](_0xa337('0x9'));_0x4db6f3='1';_0xff19bc='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xa337('0x6')](_0xa337('0x1d'));_0x4db6f3='2';_0xff19bc=_0xa337('0x1d');break;case 0x9:logger[_0xa337('0x6')](_0xa337('0x1e'));_0x4db6f3='9';_0xff19bc=_0xa337('0x1e');break;case 0xa:logger[_0xa337('0x6')](_0xa337('0x1f'));_0x4db6f3='10';_0xff19bc=_0xa337('0x1f');break;case 0xb:logger[_0xa337('0x6')](_0xa337('0x20'));_0x4db6f3='11';_0xff19bc=_0xa337('0x20');}}}catch(_0x2b86e6){logger[_0xa337('0x11')](_0xa337('0x21'),JSON[_0xa337('0x13')](_0x2b86e6));_0x19d342['terminate']();}}function _0x23c2d1(){logger[_0xa337('0x6')](_0xa337('0x22'));_0x2c410e({'transcript':_0x386fda,'confidence':_0xb24ace,'status':_0x4db6f3,'status_message':_0xff19bc});}function _0x5d3d19(_0x46fb27){logger[_0xa337('0x11')](_0xa337('0x23'));if(!_[_0xa337('0x24')](_0x46fb27)){logger[_0xa337('0x11')](_[_0xa337('0x25')](_0x46fb27)?JSON[_0xa337('0x13')](_0x46fb27):_0x46fb27);}}_0x19d342['on'](_0xa337('0x26'),_0x5c4d4c);_0x19d342['on'](_0xa337('0x27'),_0x59f7f8);_0x19d342['on'](_0xa337('0xf'),_0x23c2d1);_0x19d342['on'](_0xa337('0x11'),_0x5d3d19);});};
\ No newline at end of file
index 518ef38..50522e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0aff=['./asr'];(function(_0x430f53,_0x47ec74){var _0x179ebd=function(_0x330cbe){while(--_0x330cbe){_0x430f53['push'](_0x430f53['shift']());}};_0x179ebd(++_0x47ec74);}(_0x0aff,0x9f));var _0xf0af=function(_0x260859,_0x3cfcff){_0x260859=_0x260859-0x0;var _0x4b77f8=_0x0aff[_0x260859];return _0x4b77f8;};var asr=require(_0xf0af('0x0'));module['exports']={'asr':asr};
\ No newline at end of file
+var _0x869f=['exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x869f,0x1d9));var _0xf869=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x869f[_0x27af45];return _0x18df21;};var asr=require('./asr');module[_0xf869('0x0')]={'asr':asr};
\ No newline at end of file
index c599137..b09597a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x4f4e4b,_0x46ea73){var _0x23a628=function(_0x56791){while(--_0x56791){_0x4f4e4b['push'](_0x4f4e4b['shift']());}};_0x23a628(++_0x46ea73);}(_0xe706,0xa3));var _0x6e70=function(_0x22c393,_0x1f2389){_0x22c393=_0x22c393-0x0;var _0x161580=_0xe706[_0x22c393];return _0x161580;};'use strict';var util=require(_0x6e70('0x0'));var net=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIError=require(_0x6e70('0x3'));var AGIChannel=require(_0x6e70('0x4'));var AGIServer=function(_0x2ca810,_0x7dfbc3,_0x142c27){var _0x2164a4=this;var _0x376a8d=null;var _0x506db9=0x0;if(!_0x2ca810)_0x2ca810=0x11dd;if(!_0x7dfbc3)_0x7dfbc3=_0x6e70('0x5');EventEmitter[_0x6e70('0x6')](_0x2164a4);function _0x36357b(){if(!_0x2ca810){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x9')));return![];}_0x376a8d=net[_0x6e70('0xa')]();_0x376a8d[_0x6e70('0xb')](_0x2ca810,_0x7dfbc3);_0x376a8d['on'](_0x6e70('0xc'),function(){_0x2164a4[_0x6e70('0x7')](_0x6e70('0xc'));});_0x376a8d['on'](_0x6e70('0xd'),function(_0x743eb5){_0x376a8d[_0x6e70('0xe')](function(_0x37b3e0,_0x4600f9){if(_0x37b3e0){_0x2164a4['emit']('error',new AGIError(_0x6e70('0xf'),_0x37b3e0));}else if(_0x142c27&&_0x142c27<0x0){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x10')));_0x743eb5[_0x6e70('0x11')]();}else if(_0x142c27&&_0x142c27>0x0&&_0x142c27<_0x4600f9){_0x506db9+=0x1;_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x12'),_0x506db9));_0x743eb5['destroy']();}else{var _0x52737e=new AGIChannel(_0x743eb5);_0x52737e['on']('ready',function(){_0x2164a4[_0x6e70('0x7')]('connection',_0x52737e);});}});});_0x376a8d['on']('error',function(_0x304716){_0x2164a4[_0x6e70('0x7')]('error',new AGIError(_0x6e70('0xf'),_0x304716['code']));});_0x376a8d['on'](_0x6e70('0x13'),function(){_0x2164a4[_0x6e70('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6e70('0x14')](function(){_0x36357b();});};util['inherits'](AGIServer,EventEmitter);module[_0x6e70('0x15')]=function(_0x173afe,_0x53acdc,_0x497d61){return new AGIServer(_0x173afe,_0x53acdc,_0x497d61);};
\ No newline at end of file
+var _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x115621,_0x341cde){var _0x5ef5ce=function(_0x2ca3f2){while(--_0x2ca3f2){_0x115621['push'](_0x115621['shift']());}};_0x5ef5ce(++_0x341cde);}(_0xe706,0xa3));var _0x6e70=function(_0x1a7a1b,_0x518846){_0x1a7a1b=_0x1a7a1b-0x0;var _0x350750=_0xe706[_0x1a7a1b];return _0x350750;};'use strict';var util=require(_0x6e70('0x0'));var net=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIError=require(_0x6e70('0x3'));var AGIChannel=require(_0x6e70('0x4'));var AGIServer=function(_0x2ca810,_0x7dfbc3,_0x142c27){var _0x2164a4=this;var _0x376a8d=null;var _0x506db9=0x0;if(!_0x2ca810)_0x2ca810=0x11dd;if(!_0x7dfbc3)_0x7dfbc3=_0x6e70('0x5');EventEmitter[_0x6e70('0x6')](_0x2164a4);function _0x36357b(){if(!_0x2ca810){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x9')));return![];}_0x376a8d=net[_0x6e70('0xa')]();_0x376a8d[_0x6e70('0xb')](_0x2ca810,_0x7dfbc3);_0x376a8d['on'](_0x6e70('0xc'),function(){_0x2164a4[_0x6e70('0x7')](_0x6e70('0xc'));});_0x376a8d['on'](_0x6e70('0xd'),function(_0x743eb5){_0x376a8d[_0x6e70('0xe')](function(_0x37b3e0,_0x4600f9){if(_0x37b3e0){_0x2164a4['emit']('error',new AGIError(_0x6e70('0xf'),_0x37b3e0));}else if(_0x142c27&&_0x142c27<0x0){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x10')));_0x743eb5[_0x6e70('0x11')]();}else if(_0x142c27&&_0x142c27>0x0&&_0x142c27<_0x4600f9){_0x506db9+=0x1;_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x12'),_0x506db9));_0x743eb5['destroy']();}else{var _0x52737e=new AGIChannel(_0x743eb5);_0x52737e['on']('ready',function(){_0x2164a4[_0x6e70('0x7')]('connection',_0x52737e);});}});});_0x376a8d['on']('error',function(_0x304716){_0x2164a4[_0x6e70('0x7')]('error',new AGIError(_0x6e70('0xf'),_0x304716['code']));});_0x376a8d['on'](_0x6e70('0x13'),function(){_0x2164a4[_0x6e70('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6e70('0x14')](function(){_0x36357b();});};util['inherits'](AGIServer,EventEmitter);module[_0x6e70('0x15')]=function(_0x173afe,_0x53acdc,_0x497d61){return new AGIServer(_0x173afe,_0x53acdc,_0x497d61);};
\ No newline at end of file
index 50ffa1e..1766a5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc933=['SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','replace','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','SIP/%s','opts','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','out','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','sesteknda','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','Executed\x20command\x20%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20found','getData','response','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','condition','no\x20condition\x20configured','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','true','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','login','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','no\x20find\x20by\x20configured','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','getPause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','position','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','%s_STATUS_CODE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','saynumber','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','template_id','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','sms_account_id','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','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','Trying\x20Google\x20Cloud\x20TTS\x20%s','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','success','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','join','exports','util','lodash','shelljs','odbc','randomstring','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawBody','getdigits','getsecretdigits','channel','getVariable','rpc','getVariableById','then','name','catch','prototype','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getMailAccount','sendMailMessage','mailRpc','getIntervals','getIntervalById','IntervalId','map','interval','getSoundPath','%s/sounds/converted/%s','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','toString','callback_priority','agentPause','agent','agentUnpause','agentLogout','agentLogin','format','%s/%s@from-sip/n','shellCommand','exec','trim','googleCloudTTS','apiKey','text','languageCode','en-US','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','timeout','number','includes','POST','PUT','method','toUpperCase','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','render','stringify','body','statusCode','statusMessage','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','hasOwnProperty','isString','replaceAllVariables','isPlainObject','recursiveNodeIndex','saveRestApiResult','%s.%s','isArray','length','setVariable','split','replaceAll','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','sync','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','result','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','MRCPRecog'];(function(_0x2ab5d7,_0x1243d9){var _0x516388=function(_0x412cd1){while(--_0x412cd1){_0x2ab5d7['push'](_0x2ab5d7['shift']());}};_0x516388(++_0x1243d9);}(_0xc933,0xf9));var _0x3c93=function(_0x1d2821,_0x18698a){_0x1d2821=_0x1d2821-0x0;var _0x3a8497=_0xc933[_0x1d2821];return _0x3a8497;};'use strict';var fs=require('fs');var util=require(_0x3c93('0x0'));var _=require(_0x3c93('0x1'));var sh=require(_0x3c93('0x2'));var odbc=require(_0x3c93('0x3'))();var rs=require(_0x3c93('0x4'));var moment=require('moment');var Mustache=require(_0x3c93('0x5'));var rp=require(_0x3c93('0x6'));var logger=require(_0x3c93('0x7'))(_0x3c93('0x8'));var config=require(_0x3c93('0x9'));var shared=require('../../config/environment/shared');var scripts=require(_0x3c93('0xa'));var FILES_PATH=_0x3c93('0xb');var recursiveMapAttributes=['rawHeaders',_0x3c93('0xc')];var verticesWithRetry=['menu',_0x3c93('0xd'),_0x3c93('0xe')];var AGIVertices=function(_0x137d3c,_0xb32593,_0x46f9e8){this[_0x3c93('0xf')]=_0x137d3c;this['rpc']=_0xb32593;this['mailRpc']=_0x46f9e8;};AGIVertices['prototype'][_0x3c93('0x10')]=function(_0x39ff98,_0x2a904f){this[_0x3c93('0x11')][_0x3c93('0x12')](_0x39ff98)[_0x3c93('0x13')](function(_0x283ed8){_0x2a904f(null,_0x283ed8?_0x283ed8[_0x3c93('0x14')]:![]);})[_0x3c93('0x15')](function(_0x2c0bce){_0x2a904f(_0x2c0bce);});};AGIVertices[_0x3c93('0x16')][_0x3c93('0x17')]=function(_0xaa2eae,_0x1fc09c){this[_0x3c93('0x11')][_0x3c93('0x18')](_0xaa2eae)[_0x3c93('0x13')](function(_0x5c01ba){_0x1fc09c(null,_0x5c01ba?_0x5c01ba['name']:![]);})[_0x3c93('0x15')](function(_0x3a7ae7){_0x1fc09c(_0x3a7ae7);});};AGIVertices[_0x3c93('0x16')][_0x3c93('0x19')]=function(_0x35890a,_0x8b3fdc){this[_0x3c93('0x11')]['getSquareProjectById'](_0x35890a)['then'](function(_0xe14ac8){_0x8b3fdc(null,_0xe14ac8?_0xe14ac8[_0x3c93('0x14')]:![]);})['catch'](function(_0x54a8d8){_0x8b3fdc(_0x54a8d8);});};AGIVertices['prototype'][_0x3c93('0x1a')]=function(_0x599def,_0x47da2e){this['rpc'][_0x3c93('0x1b')](_0x599def)[_0x3c93('0x13')](function(_0xa4bcfb){_0x47da2e(null,_0xa4bcfb?_0xa4bcfb[_0x3c93('0x1c')]:![]);})[_0x3c93('0x15')](function(_0x269d3a){_0x47da2e(_0x269d3a);});};AGIVertices[_0x3c93('0x16')][_0x3c93('0x1d')]=function(_0x3207ac,_0x3d88c2){this['rpc'][_0x3c93('0x1e')](_0x3207ac)[_0x3c93('0x13')](function(_0xcbc8b){_0x3d88c2(null,_0xcbc8b?_0xcbc8b[_0x3c93('0x14')]:![]);})[_0x3c93('0x15')](function(_0x329cd3){_0x3d88c2(_0x329cd3);});};AGIVertices['prototype'][_0x3c93('0x1f')]=function(_0x3932f2,_0x88f6d4){this[_0x3c93('0x11')][_0x3c93('0x20')](_0x3932f2)[_0x3c93('0x13')](function(_0x1a180f){_0x88f6d4(null,_0x1a180f?_0x1a180f[_0x3c93('0x14')]:![]);})[_0x3c93('0x15')](function(_0x568e40){_0x88f6d4(_0x568e40);});};AGIVertices[_0x3c93('0x16')][_0x3c93('0x21')]=function(_0x3f49a5,_0x51de7b){var _0x129354=this;this[_0x3c93('0x11')][_0x3c93('0x22')](_0x3f49a5)[_0x3c93('0x13')](function(_0x4d7a78){_0x51de7b(null,_0x4d7a78?_0x129354['getSoundPath'](_0x4d7a78['save_name']):![]);})[_0x3c93('0x15')](function(_0x27d63e){_0x51de7b(_0x27d63e);});};AGIVertices[_0x3c93('0x16')][_0x3c93('0x23')]=function(_0x5e5601,_0x186b30){this['rpc']['getMailAccountById'](_0x5e5601)[_0x3c93('0x13')](function(_0x2dfb63){_0x186b30(null,_0x2dfb63?_0x2dfb63:![]);})[_0x3c93('0x15')](function(_0x5b1d6f){_0x186b30(_0x5b1d6f);});};AGIVertices[_0x3c93('0x16')][_0x3c93('0x24')]=function(_0x2947a1,_0x57e7d3,_0x28d04f){this[_0x3c93('0x25')][_0x3c93('0x24')](_0x2947a1,_0x57e7d3)[_0x3c93('0x13')](function(){_0x28d04f(null);})[_0x3c93('0x15')](function(_0x34892b){_0x28d04f(_0x34892b);});};AGIVertices['prototype'][_0x3c93('0x26')]=function(_0x3da67b,_0x57efa7){this[_0x3c93('0x11')][_0x3c93('0x27')](_0x3da67b)[_0x3c93('0x13')](function(_0x4e5c98){if(_0x4e5c98){if(_0x4e5c98[_0x3c93('0x28')]){_0x57efa7(null,[_0x4e5c98['interval']]);}else{_0x57efa7(null,_[_0x3c93('0x29')](_0x4e5c98['Intervals'],_0x3c93('0x2a')));}}else{_0x57efa7(null,![]);}})[_0x3c93('0x15')](function(_0x31b2c5){_0x57efa7(_0x31b2c5);});};AGIVertices[_0x3c93('0x16')][_0x3c93('0x2b')]=function(_0x41ea9f){return util['format'](_0x3c93('0x2c'),FILES_PATH,_0x41ea9f);};AGIVertices[_0x3c93('0x16')][_0x3c93('0x2d')]=function(_0x28dc82,_0x1c2526,_0xb00081){odbc[_0x3c93('0x2e')](_0x28dc82,function(_0x56a8b8){if(_0x56a8b8){logger[_0x3c93('0x2f')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x56a8b8);_0xb00081(_0x56a8b8);}else{logger[_0x3c93('0x30')](_0x3c93('0x31'));odbc[_0x3c93('0x32')](_0x1c2526,function(_0x4ced96,_0x2bf5ad){if(_0x4ced96){logger[_0x3c93('0x30')](_0x3c93('0x33'),_0x1c2526);_0xb00081(_0x4ced96);}else{logger['info']('Query\x20executed\x20correctly\x20%s',_0x1c2526);odbc[_0x3c93('0x34')](function(_0x535226){if(_0x535226){logger[_0x3c93('0x2f')](_0x3c93('0x35'),_0x535226);}_0xb00081(null,_0x2bf5ad);});}});}});};AGIVertices[_0x3c93('0x16')][_0x3c93('0x36')]=function(_0x2cad40,_0x235b5c){this[_0x3c93('0x11')][_0x3c93('0x37')](_0x2cad40)[_0x3c93('0x13')](function(_0x4c8793){_0x235b5c(null,_0x4c8793?_0x4c8793:![]);})['catch'](function(_0xd9301c){_0x235b5c(_0xd9301c);});};AGIVertices['prototype'][_0x3c93('0x38')]=function(_0x1f48d3,_0x1ccaf2){this['rpc'][_0x3c93('0x38')](_0x1f48d3)[_0x3c93('0x13')](function(_0x45559d){_0x1ccaf2(null,_0x45559d);})[_0x3c93('0x15')](function(_0x47053c){_0x1ccaf2(_0x47053c);});};AGIVertices[_0x3c93('0x16')]['createSquareDetailsReport']=function(_0x5c101a,_0x1acef7,_0x2c2ce3){this[_0x3c93('0x11')][_0x3c93('0x39')]({'uniqueid':this[_0x3c93('0xf')][_0x3c93('0x3a')],'node':_0x5c101a[_0x3c93('0x3b')],'application':_0x5c101a[_0x3c93('0x3c')],'data':_0x1acef7||null,'project_name':this[_0x3c93('0xf')][_0x3c93('0x3d')],'callerid':this[_0x3c93('0xf')][_0x3c93('0x3e')]})[_0x3c93('0x13')](function(_0x23dd36){if(_0x2c2ce3){_0x2c2ce3(null,_0x23dd36);}})[_0x3c93('0x15')](function(_0xc1311a){if(_0x2c2ce3){_0x2c2ce3(_0xc1311a);}});};AGIVertices[_0x3c93('0x16')][_0x3c93('0x3f')]=function(_0x15ff92,_0x6ffc8d,_0x4b15a0,_0x502468){this[_0x3c93('0x11')][_0x3c93('0x3f')]({'uniqueid':this['channel'][_0x3c93('0x3a')],'callerid':this[_0x3c93('0xf')][_0x3c93('0x3e')],'calleridname':this['channel'][_0x3c93('0x40')],'context':this[_0x3c93('0xf')][_0x3c93('0x41')],'extension':this['channel'][_0x3c93('0x42')],'priority':this['channel'][_0x3c93('0x43')],'accountcode':this['channel'][_0x3c93('0x44')],'dnid':this[_0x3c93('0xf')]['dnid'],'projectName':this[_0x3c93('0xf')][_0x3c93('0x3d')],'saveName':_0x6ffc8d,'filename':_0x15ff92[_0x3c93('0x45')]||_0x6ffc8d,'savePath':_0x4b15a0})[_0x3c93('0x13')](function(_0x3a7034){_0x502468(null,_0x3a7034);})[_0x3c93('0x15')](function(_0x50c10c){_0x502468(_0x50c10c);});};AGIVertices[_0x3c93('0x16')][_0x3c93('0x46')]=function(_0x427f2d,_0xd2b3d1,_0x35bb28,_0x239ffa,_0x2ef73d){this[_0x3c93('0x11')][_0x3c93('0x46')]({'uniqueid':this[_0x3c93('0xf')][_0x3c93('0x3a')],'body':_0x427f2d,'direction':_0xd2b3d1,'providerName':_0x35bb28,'providerResponse':_0x239ffa})[_0x3c93('0x13')](function(_0x38be76){if(_0x2ef73d){_0x2ef73d(null,_0x38be76);}})[_0x3c93('0x15')](function(_0x4f492c){if(_0x2ef73d){_0x2ef73d(_0x4f492c);}});};AGIVertices['prototype'][_0x3c93('0x47')]=function(_0x37e126,_0x2ff8c5){this['rpc'][_0x3c93('0x47')]({'firstName':_[_0x3c93('0x48')](_0x37e126[_0x3c93('0x14')])||_[_0x3c93('0x49')](_0x37e126[_0x3c93('0x14')])?_0x3c93('0x4a')+Math[_0x3c93('0x4b')]():_0x37e126['name'],'lastName':_['isEmpty'](_0x37e126['lastName'])||_[_0x3c93('0x49')](_0x37e126[_0x3c93('0x4c')])?null:_0x37e126[_0x3c93('0x4c')],'phone':_0x37e126[_0x3c93('0x4d')],'ListId':_0x37e126[_0x3c93('0x4e')],'scheduledat':_0x37e126[_0x3c93('0x4f')],'callbackUniqueid':this[_0x3c93('0xf')][_0x3c93('0x3a')],'tags':_0x3c93('0x50'),'description':'Callback\x20scheduled\x20at\x20'+_0x37e126['scheduledAt'][_0x3c93('0x51')](),'priority':_0x37e126[_0x3c93('0x52')]})[_0x3c93('0x13')](function(_0x53a00d){_0x2ff8c5(null,_0x53a00d);})[_0x3c93('0x15')](function(_0x3069a7){_0x2ff8c5(_0x3069a7);});};AGIVertices[_0x3c93('0x16')]['getPause']=function(_0x2d7914,_0x4e897a){this['rpc']['getPauseById'](_0x2d7914)[_0x3c93('0x13')](function(_0x5a2788){_0x4e897a(null,_0x5a2788?_0x5a2788['name']:![]);})['catch'](function(_0x23daa3){_0x4e897a(_0x23daa3);});};AGIVertices['prototype'][_0x3c93('0x53')]=function(_0x139e9a,_0x57d250,_0x1e73bb){var _0x6ebb7c={'role':_0x3c93('0x54')};_0x6ebb7c[_0x139e9a]=this[_0x3c93('0xf')]['callerid'];this['rpc'][_0x3c93('0x53')](_0x6ebb7c,_0x57d250,this[_0x3c93('0xf')][_0x3c93('0x3a')])[_0x3c93('0x13')](function(_0x26113e){_0x1e73bb(null,_[_0x3c93('0x49')](_0x26113e)?![]:!![]);})[_0x3c93('0x15')](function(_0x15ce86){logger[_0x3c93('0x2f')](_0x15ce86);_0x1e73bb(null,![]);});};AGIVertices[_0x3c93('0x16')][_0x3c93('0x55')]=function(_0x5638bc,_0x3dd0e7){var _0x38ab0c={'role':_0x3c93('0x54')};_0x38ab0c[_0x5638bc]=this['channel'][_0x3c93('0x3e')];this['rpc'][_0x3c93('0x55')](_0x38ab0c)['then'](function(_0x33c831){_0x3dd0e7(null,_[_0x3c93('0x49')](_0x33c831)?![]:!![]);})[_0x3c93('0x15')](function(_0x3a646c){logger[_0x3c93('0x2f')](_0x3a646c);_0x3dd0e7(null,![]);});};AGIVertices[_0x3c93('0x16')][_0x3c93('0x56')]=function(_0x46d76e,_0x147563){var _0x16680d={'role':'agent'};_0x16680d[_0x46d76e]=this[_0x3c93('0xf')]['callerid'];this[_0x3c93('0x11')][_0x3c93('0x56')](_0x16680d)[_0x3c93('0x13')](function(_0x4fa66a){_0x147563(null,_[_0x3c93('0x49')](_0x4fa66a)?![]:!![]);})['catch'](function(_0x3431da){logger[_0x3c93('0x2f')](_0x3431da);_0x147563(null,![]);});};AGIVertices[_0x3c93('0x16')][_0x3c93('0x57')]=function(_0x39d574,_0x1b8d40){var _0x1e0f3f={'role':_0x3c93('0x54')};_0x1e0f3f[_0x39d574]=this[_0x3c93('0xf')][_0x3c93('0x3e')];var _0x9d31d5=_0x39d574!='internal'?util[_0x3c93('0x58')](_0x3c93('0x59'),'LOCAL',this[_0x3c93('0xf')][_0x3c93('0x3e')]):undefined;this['rpc'][_0x3c93('0x57')](_0x1e0f3f,_0x9d31d5)[_0x3c93('0x13')](function(_0xad4578){_0x1b8d40(null,_['isNil'](_0xad4578)?![]:!![]);})[_0x3c93('0x15')](function(_0x13f207){logger['error'](_0x13f207);_0x1b8d40(null,![]);});};AGIVertices[_0x3c93('0x16')][_0x3c93('0x5a')]=function(_0x2d131e,_0x59f6de){sh[_0x3c93('0x5b')](_[_0x3c93('0x5c')](_0x2d131e),function(_0x2f543d,_0x2b098e){var _0x847d1e=_0x2b098e['replace'](/(\r\n|\n|\r)/gm,'');_0x59f6de(null,_0x847d1e);});};AGIVertices[_0x3c93('0x16')][_0x3c93('0x5d')]=function(_0x1ff4a4,_0x4d9c80){scripts['googleCloudTTS'](_0x1ff4a4[_0x3c93('0x5e')],_0x1ff4a4['google_cloud_tts_text_type']||_0x3c93('0x5f'),_0x1ff4a4[_0x3c93('0x5f')],_0x1ff4a4[_0x3c93('0x60')]||_0x3c93('0x61'),_0x1ff4a4['ssmlGender']||_0x3c93('0x62'),_0x1ff4a4[_0x3c93('0x63')]||_0x3c93('0x64'))[_0x3c93('0x13')](function(_0x2b6a7b){_0x4d9c80(null,_0x2b6a7b);})[_0x3c93('0x15')](function(_0x34e5a1){_0x4d9c80(_0x34e5a1);});};AGIVertices['prototype'][_0x3c93('0x65')]=function(_0x7ece5d,_0x960aeb){scripts[_0x3c93('0x65')](_0x7ece5d[_0x3c93('0x5f')],_0x7ece5d[_0x3c93('0x66')]||'en',0x1)[_0x3c93('0x13')](function(_0x49cdf3){_0x960aeb(null,_0x49cdf3);})['catch'](function(_0x4f6c5f){_0x960aeb(_0x4f6c5f);});};AGIVertices['prototype'][_0x3c93('0x67')]=function(_0x2c54bc,_0x335a0c){var _0x2ce986={'uri':_0x2c54bc[_0x3c93('0x68')],'method':_0x2c54bc['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x2c54bc[_0x3c93('0x69')])===_0x3c93('0x6a')&&parseInt(_0x2c54bc['timeout'])>=0x1?parseInt(_0x2c54bc[_0x3c93('0x69')])*0x3e8:0x5*0x3e8};if(_[_0x3c93('0x6b')]([_0x3c93('0x6c'),_0x3c93('0x6d')],_0x2ce986[_0x3c93('0x6e')][_0x3c93('0x6f')]())){try{_0x2ce986['body']=_0x2c54bc[_0x3c93('0xc')]?JSON['parse'](_0x2c54bc['rawBody']):{};}catch(_0xf83954){logger['error'](_0x3c93('0x70'),_0xf83954);}}try{_0x2ce986[_0x3c93('0x71')]=_0x2c54bc[_0x3c93('0x72')]?JSON[_0x3c93('0x73')](_0x2c54bc[_0x3c93('0x72')]):{};}catch(_0x37f435){logger[_0x3c93('0x2f')](_0x3c93('0x74'),_0x37f435);}if(_0x2c54bc[_0x3c93('0x75')]){try{var _0x57a929=require(_0x2c54bc[_0x3c93('0x75')])['sync'](this,_0x2ce986);_0x2ce986['uri']=Mustache[_0x3c93('0x76')](_0x2c54bc[_0x3c93('0x68')],_0x57a929,{},['$$','$$']);if(_0x2ce986[_0x3c93('0x71')]){_0x2ce986[_0x3c93('0x71')]=JSON[_0x3c93('0x73')](Mustache['render'](JSON[_0x3c93('0x77')](_0x2ce986[_0x3c93('0x71')]),_0x57a929,{},['$$','$$']));}if(_0x2ce986[_0x3c93('0x78')]){_0x2ce986[_0x3c93('0x78')]=JSON[_0x3c93('0x73')](Mustache[_0x3c93('0x76')](JSON['stringify'](_0x2ce986[_0x3c93('0x78')]),_0x57a929,{},['$$','$$']));}}catch(_0x5e0724){logger[_0x3c93('0x2f')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x5e0724);}}rp(_0x2ce986)[_0x3c93('0x13')](function(_0xa99cc3){var _0x854db8={'statusCode':_0xa99cc3[_0x3c93('0x79')]||0xc8,'statusMessage':_0xa99cc3[_0x3c93('0x7a')]||'OK','headers':_0xa99cc3[_0x3c93('0x71')]||{},'body':_0xa99cc3['body']||{}};_0x335a0c(null,_0x854db8);})['catch'](function(_0x1cb5db){var _0x72593d={'statusCode':_0x1cb5db[_0x3c93('0x79')]||0x1f4,'statusMessage':_0x1cb5db['message']||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x1cb5db['options'][_0x3c93('0x71')]||{},'body':_0x1cb5db[_0x3c93('0x7b')][_0x3c93('0x78')]||{}};_0x335a0c(null,_0x72593d);});};AGIVertices[_0x3c93('0x16')][_0x3c93('0x7c')]=function(_0x401d57,_0x12d1e3){scripts['googleDialogflow'](this[_0x3c93('0xf')][_0x3c93('0x3a')],_0x401d57[_0x3c93('0x7d')],_0x401d57[_0x3c93('0x5f')],_0x401d57[_0x3c93('0x7e')]||'en')['then'](function(_0xacb768){_0x12d1e3(null,_0xacb768);})['catch'](function(_0x3f5a07){_0x12d1e3(_0x3f5a07);});};AGIVertices[_0x3c93('0x16')][_0x3c93('0x7f')]=function(_0x52caa9,_0xa29e95){scripts[_0x3c93('0x7f')](this[_0x3c93('0xf')]['uniqueid'],_0x52caa9[_0x3c93('0x80')],_0x52caa9['client_email'],_0x52caa9[_0x3c93('0x81')],_0x52caa9[_0x3c93('0x5f')],_0x52caa9[_0x3c93('0x82')]||'en')['then'](function(_0x4ba9aa){_0xa29e95(null,_0x4ba9aa);})[_0x3c93('0x15')](function(_0x327c9e){_0xa29e95(_0x327c9e);});};AGIVertices[_0x3c93('0x16')]['sestekNDA']=function(_0x1e8cd8,_0x4639e7){scripts[_0x3c93('0x83')](this[_0x3c93('0xf')],_0x1e8cd8)[_0x3c93('0x13')](function(_0x114490){_0x4639e7(null,_0x114490);})[_0x3c93('0x15')](function(_0x21d300){_0x4639e7(_0x21d300);});};AGIVertices[_0x3c93('0x16')][_0x3c93('0x84')]=function(_0x3f96a0,_0x3b5bb1){scripts['ispeechTTS'](_0x3f96a0[_0x3c93('0x7d')],_0x3f96a0[_0x3c93('0x5f')],_0x3f96a0[_0x3c93('0x85')]||'en-US',_0x3f96a0[_0x3c93('0x86')])[_0x3c93('0x13')](function(_0x1bb6e8){_0x3b5bb1(null,_0x1bb6e8);})[_0x3c93('0x15')](function(_0x287077){_0x3b5bb1(_0x287077);});};AGIVertices[_0x3c93('0x16')][_0x3c93('0x87')]=function(_0x2854aa,_0x582972,_0x2e396a){scripts[_0x3c93('0x87')](_0x582972,_0x2854aa[_0x3c93('0x7d')],_0x2854aa[_0x3c93('0x88')]||_0x3c93('0x61'),this[_0x3c93('0x89')](_0x2854aa['model'])?_0x2854aa[_0x3c93('0x8a')]:undefined)[_0x3c93('0x13')](function(_0x38c54f){_0x2e396a(null,_0x38c54f);})[_0x3c93('0x15')](function(_0xd5d7c2){_0x2e396a(_0xd5d7c2);});};AGIVertices['prototype'][_0x3c93('0x8b')]=function(_0x153617,_0x2e4998){scripts[_0x3c93('0x8b')](_0x153617[_0x3c93('0x8c')],_0x153617[_0x3c93('0x8d')],_0x153617[_0x3c93('0x8e')],_0x153617[_0x3c93('0x8f')]||_0x3c93('0x90'),_0x153617[_0x3c93('0x5f')],_0x153617[_0x3c93('0x91')]||_0x3c93('0x5f'))[_0x3c93('0x13')](function(_0x1272e2){_0x2e4998(null,_0x1272e2);})[_0x3c93('0x15')](function(_0x51fb14){_0x2e4998(_0x51fb14);});};AGIVertices[_0x3c93('0x16')][_0x3c93('0x92')]=function(_0x353949,_0x54110f){scripts[_0x3c93('0x92')](this[_0x3c93('0xf')][_0x3c93('0x3a')],_0x353949[_0x3c93('0x8c')],_0x353949[_0x3c93('0x8d')],_0x353949['aws_lex_region'],_0x353949['text'],_0x353949[_0x3c93('0x93')])[_0x3c93('0x13')](function(_0x14c371){_0x54110f(null,_0x14c371);})[_0x3c93('0x15')](function(_0x493053){_0x54110f(_0x493053);});};AGIVertices[_0x3c93('0x16')][_0x3c93('0x94')]=function(_0x5e8b6c,_0x3f9094,_0x9e99f6){scripts['googleASR'](_0x3f9094,_0x5e8b6c[_0x3c93('0x7d')],_0x5e8b6c[_0x3c93('0x95')]||_0x3c93('0x61'))[_0x3c93('0x13')](function(_0x4083ca){_0x9e99f6(null,_0x4083ca);})['catch'](function(_0xbd2014){_0x9e99f6(_0xbd2014);});};AGIVertices[_0x3c93('0x16')][_0x3c93('0x96')]=function(_0x236039,_0x46aca2,_0x1b19e8){scripts['tildeASR'](_0x46aca2,_0x236039[_0x3c93('0x97')],_0x236039[_0x3c93('0x98')],_0x236039[_0x3c93('0x99')])[_0x3c93('0x13')](function(_0x4efed7){_0x1b19e8(null,_0x4efed7);})[_0x3c93('0x15')](function(_0x1e590e){_0x1b19e8(_0x1e590e);});};AGIVertices['prototype']['clear']=function(_0x1743a7){var _0x13ac4b=_['includes'](verticesWithRetry,_0x1743a7['agicommand'])?_0x1743a7:_['clone'](_0x1743a7);for(var _0x501a13 in _0x13ac4b){if(_0x13ac4b[_0x3c93('0x9a')](_0x501a13)){if(_0x13ac4b[_0x501a13]&&_[_0x3c93('0x9b')](_0x13ac4b[_0x501a13])){if(_['includes'](recursiveMapAttributes,_0x501a13)){_0x13ac4b[_0x501a13]=this['replaceObjectAllVariables'](_0x13ac4b[_0x501a13]);}else{_0x13ac4b[_0x501a13]=this[_0x3c93('0x9c')](_0x13ac4b[_0x501a13]);}}}}return _0x13ac4b;};AGIVertices[_0x3c93('0x16')]['recursiveNodeIndex']=function(_0x45ace4){for(var _0x4e57c7 in _0x45ace4){if(_0x45ace4[_0x3c93('0x9a')](_0x4e57c7)){if(_[_0x3c93('0x9d')](_0x45ace4[_0x4e57c7])){this[_0x3c93('0x9e')](_0x45ace4[_0x4e57c7]);}else if(_['isArray'](_0x45ace4[_0x4e57c7])){for(var _0x3428ce=0x0;_0x3428ce<_0x45ace4[_0x4e57c7]['length'];_0x3428ce++){this[_0x3c93('0x9e')](_0x45ace4[_0x4e57c7][_0x3428ce]);}}else if(_[_0x3c93('0x9b')](_0x45ace4[_0x4e57c7])){_0x45ace4[_0x4e57c7]=this['replaceAllVariables'](_0x45ace4[_0x4e57c7]);}}}};AGIVertices['prototype'][_0x3c93('0x9f')]=function(_0x1cd606,_0x28f796){for(var _0x406d5d in _0x1cd606){if(_0x1cd606[_0x3c93('0x9a')](_0x406d5d)){if(_[_0x3c93('0x9d')](_0x1cd606[_0x406d5d])){if(!_[_0x3c93('0x48')](_0x1cd606[_0x406d5d])){this[_0x3c93('0x9f')](_0x1cd606[_0x406d5d],util[_0x3c93('0x58')](_0x3c93('0xa0'),_0x28f796,_0x406d5d));}}else if(_[_0x3c93('0xa1')](_0x1cd606[_0x406d5d])){for(var _0x4bb272=0x0;_0x4bb272<_0x1cd606[_0x406d5d][_0x3c93('0xa2')];_0x4bb272++){this[_0x3c93('0x9f')](_0x1cd606[_0x406d5d][_0x4bb272],util[_0x3c93('0x58')](_0x3c93('0xa0'),_0x28f796,_0x406d5d+'['+_0x4bb272+']'));}}else{if(!_[_0x3c93('0x49')](_0x1cd606[_0x406d5d])){this[_0x3c93('0xf')][_0x3c93('0xa3')](util[_0x3c93('0x58')](_0x3c93('0xa0'),_0x28f796,_0x406d5d),_0x1cd606[_0x406d5d]);}}}}};AGIVertices[_0x3c93('0x16')]['replaceObjectAllVariables']=function(_0x1c493f){try{var _0x23f2ed=JSON[_0x3c93('0x73')](_0x1c493f);this[_0x3c93('0x9e')](_0x23f2ed);return JSON['stringify'](_0x23f2ed);}catch(_0x2e086d){return this['replaceAllVariables'](_0x1c493f);}};AGIVertices[_0x3c93('0x16')][_0x3c93('0x9c')]=function(_0x4f4250){var _0x44e012=_0x4f4250[_0x3c93('0xa4')]('{');for(var _0x3fee55=0x1;_0x3fee55<_0x44e012[_0x3c93('0xa2')];_0x3fee55+=0x1){var _0x58b91d=_0x44e012[_0x3fee55][_0x3c93('0xa4')]('}');if(_0x58b91d[_0x3c93('0xa2')]>0x1){_0x4f4250=_0x4f4250[_0x3c93('0xa5')]('{'+_0x58b91d[0x0]+'}',this[_0x3c93('0xf')][_0x3c93('0x10')](_0x58b91d[0x0])[_0x3c93('0xa6')]||_0x58b91d[0x0]);}}if(_0x44e012[_0x3c93('0xa2')]===0x1){return _0x4f4250[_0x3c93('0x51')]();}return this[_0x3c93('0x9c')](_0x4f4250);};AGIVertices[_0x3c93('0x16')][_0x3c93('0xa7')]=function(_0x55cd9f,_0x45304b){var _0x26ce86=this[_0x3c93('0xf')][_0x3c93('0x10')](_0x55cd9f);if(_0x26ce86['result']===-0x1){return _0x26ce86;}logger[_0x3c93('0x30')](util[_0x3c93('0x58')](_0x3c93('0xa8'),_0x45304b,_0x26ce86[_0x3c93('0xa6')]));return this[_0x3c93('0xf')]['setVariable'](_0x45304b,_0x26ce86[_0x3c93('0xa6')]);};AGIVertices[_0x3c93('0x16')][_0x3c93('0x89')]=function(_0x7a5bc6){return _0x7a5bc6&&_0x7a5bc6!=='0'&&_0x7a5bc6!=='-1'&&_0x7a5bc6!=='';};AGIVertices[_0x3c93('0x16')]['maxRetry']=function(_0xf3d1d5){this[_0x3c93('0x39')][_0x3c93('0xa9')](this,_0xf3d1d5,'-');_0xf3d1d5['retry']=_0xf3d1d5[_0x3c93('0xaa')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x3c93('0x16')][_0x3c93('0xab')]=function(_0x59383a){logger[_0x3c93('0x30')](util[_0x3c93('0x58')](_0x3c93('0xac'),_0x59383a[_0x3c93('0x3b')]));if(!this[_0x3c93('0x89')](_0x59383a[_0x3c93('0x5f')])){return this[_0x3c93('0xf')]['noop'](_0x3c93('0xad'));}var _0x348dde='\x22'+_0x59383a['text']+'\x22';if(this[_0x3c93('0x89')](_0x59383a[_0x3c93('0x7b')])){_0x348dde+=','+_0x59383a[_0x3c93('0x7b')];}var _0x39f72a=this[_0x3c93('0xf')]['exec'](_0x3c93('0xae'),_0x348dde);if(_0x39f72a['result']===-0x1){return _0x39f72a;}return this['channel'][_0x3c93('0xaf')](util[_0x3c93('0x58')](_0x3c93('0xb0'),_0x348dde));};AGIVertices[_0x3c93('0x16')]['mrcprecog']=function(_0xab7aba){logger[_0x3c93('0x30')](util['format'](_0x3c93('0xb1'),_0xab7aba['label']));if(!this['isConfigured'](_0xab7aba[_0x3c93('0xb2')])){return this[_0x3c93('0xf')]['noop'](_0x3c93('0xb3'));}var _0x4b3c84=_0xab7aba[_0x3c93('0xb2')];if(this[_0x3c93('0x89')](_0xab7aba['options'])){_0x4b3c84+=','+_0xab7aba[_0x3c93('0x7b')];}var _0x27f874=this['channel'][_0x3c93('0x5b')]('MRCPRecog',_0x4b3c84);if(_0x27f874[_0x3c93('0xb4')]===-0x1){return _0x27f874;}var _0x468da8=this[_0x3c93('0xa7')]('RECOG_CONFIDENCE()',_0x3c93('0xb5'));if(_0x468da8[_0x3c93('0xb4')]===-0x1){return _0x468da8;}var _0x3690b2=this[_0x3c93('0xa7')](_0x3c93('0xb6'),_0x3c93('0xb7'));if(_0x3690b2[_0x3c93('0xb4')]===-0x1){return _0x3690b2;}var _0x2274b8=this[_0x3c93('0xa7')](_0x3c93('0xb8'),'MRCP_RECOG_INSTANCE');if(_0x2274b8[_0x3c93('0xb4')]===-0x1){return _0x2274b8;}return this[_0x3c93('0xf')][_0x3c93('0xaf')](util[_0x3c93('0x58')](_0x3c93('0xb9'),_0x4b3c84));};AGIVertices[_0x3c93('0x16')][_0x3c93('0x8')]=function(_0x215b1c){logger[_0x3c93('0x30')](util['format'](_0x3c93('0xba'),_0x215b1c[_0x3c93('0x3b')]));return this[_0x3c93('0xf')][_0x3c93('0x8')]([_0x215b1c[_0x3c93('0xbb')],_0x215b1c[_0x3c93('0xbc')]]);};AGIVertices['prototype'][_0x3c93('0xbd')]=function(_0x1109d8){logger[_0x3c93('0x30')](util[_0x3c93('0x58')](_0x3c93('0xbe'),_0x1109d8[_0x3c93('0x3b')]));if(this[_0x3c93('0x89')](_0x1109d8['timeout'])){logger[_0x3c93('0x30')](util[_0x3c93('0x58')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x1109d8[_0x3c93('0x69')]));var _0xdabc5f=this[_0x3c93('0xf')][_0x3c93('0xbf')](_0x1109d8['timeout']);if(_0xdabc5f['result']===-0x1){return _0xdabc5f;}}return this[_0x3c93('0xf')][_0x3c93('0xbd')]();};AGIVertices[_0x3c93('0x16')][_0x3c93('0x50')]=function(_0x242588){logger[_0x3c93('0x30')](util[_0x3c93('0x58')](_0x3c93('0xc0'),_0x242588[_0x3c93('0x3b')]));if(!this[_0x3c93('0x89')](_0x242588[_0x3c93('0x4e')])){return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x242588,_0x3c93('0xc1'));}_0x242588[_0x3c93('0x4f')]=moment();if(this[_0x3c93('0x89')](_0x242588['delay'])){_0x242588[_0x3c93('0x4f')]=moment()[_0x3c93('0xc2')](_0x242588['delay'],_0x3c93('0xc3'));}if(!this['isConfigured'](_0x242588[_0x3c93('0x52')])){_0x242588[_0x3c93('0x52')]=0x2;}this[_0x3c93('0x47')][_0x3c93('0xa9')](this,_0x242588);return this['channel'][_0x3c93('0xaf')](util[_0x3c93('0x58')](_0x3c93('0xc4'),_0x242588[_0x3c93('0x4d')],_0x242588[_0x3c93('0x4e')],_0x242588[_0x3c93('0x4f')]));};AGIVertices['prototype'][_0x3c93('0xc5')]=function(_0x4f12a4){logger[_0x3c93('0x30')](util[_0x3c93('0x58')](_0x3c93('0xc6'),_0x4f12a4['label']));var _0x247a71=this[_0x3c93('0xf')]['exec'](_0x4f12a4['application'],_0x4f12a4['options']);if(_0x247a71['result']===-0x1){return _0x247a71;}return this[_0x3c93('0xf')]['noop'](util['format'](_0x3c93('0xc7'),_0x4f12a4['application'],_0x4f12a4[_0x3c93('0x7b')]));};AGIVertices[_0x3c93('0x16')][_0x3c93('0xc8')]=function(_0x30525d){logger[_0x3c93('0x30')](util['format'](_0x3c93('0xc9'),_0x30525d[_0x3c93('0x3b')]));if(!this[_0x3c93('0x89')](_0x30525d[_0x3c93('0x5f')])){return this[_0x3c93('0xf')][_0x3c93('0xaf')]('no\x20text\x20configured');}var _0x566479='\x22'+_0x30525d['text']+'\x22';if(this['isConfigured'](_0x30525d[_0x3c93('0x7b')])){_0x566479+=','+_0x30525d[_0x3c93('0x7b')];}var _0x221c7=this[_0x3c93('0xf')]['exec'](_0x3c93('0xae'),_0x566479);if(_0x221c7[_0x3c93('0xb4')]===-0x1){return _0x221c7;}return this[_0x3c93('0xf')][_0x3c93('0xaf')](util[_0x3c93('0x58')](_0x3c93('0xb0'),_0x566479));};AGIVertices[_0x3c93('0x16')][_0x3c93('0xca')]=function(_0x5a991e){logger[_0x3c93('0x30')](util['format'](_0x3c93('0xcb'),_0x5a991e['label']));if(!this[_0x3c93('0x89')](_0x5a991e[_0x3c93('0x5f')])){return this['channel']['noop'](_0x3c93('0xad'));}var _0x1710ef='\x22'+_0x5a991e[_0x3c93('0x5f')]+'\x22';if(this['isConfigured'](_0x5a991e[_0x3c93('0x7b')])){_0x1710ef+=','+_0x5a991e[_0x3c93('0x7b')];}var _0xc2e26d=this[_0x3c93('0xf')][_0x3c93('0x5b')]('MRCPSynth',_0x1710ef);if(_0xc2e26d[_0x3c93('0xb4')]===-0x1){return _0xc2e26d;}return this['channel'][_0x3c93('0xaf')](util[_0x3c93('0x58')]('Executed\x20command\x20MRCPSynth\x20%s',_0x1710ef));};AGIVertices[_0x3c93('0x16')][_0x3c93('0xcc')]=function(_0x2504a5){logger[_0x3c93('0x30')](util[_0x3c93('0x58')](_0x3c93('0xcd'),_0x2504a5[_0x3c93('0x3b')]));if(!this[_0x3c93('0x89')](_0x2504a5[_0x3c93('0xb2')])){return this['channel'][_0x3c93('0xaf')](_0x3c93('0xb3'));}var _0xd76b42=_0x2504a5[_0x3c93('0xb2')];if(this[_0x3c93('0x89')](_0x2504a5[_0x3c93('0x7b')])){_0xd76b42+=','+_0x2504a5['options'];}var _0x14ee45=this[_0x3c93('0xf')][_0x3c93('0x5b')]('MRCPRecog',_0xd76b42);if(_0x14ee45[_0x3c93('0xb4')]===-0x1){return _0x14ee45;}var _0x4c8efa=this[_0x3c93('0xa7')](_0x3c93('0xce'),_0x3c93('0xcf'));if(_0x4c8efa['result']===-0x1){return _0x4c8efa;}var _0x3ba956=this[_0x3c93('0xa7')](_0x3c93('0xb6'),_0x3c93('0xd0'));if(_0x3ba956[_0x3c93('0xb4')]===-0x1){return _0x3ba956;}var _0x24c8e4=this[_0x3c93('0xa7')](_0x3c93('0xb8'),_0x3c93('0xd1'));if(_0x24c8e4[_0x3c93('0xb4')]===-0x1){return _0x24c8e4;}return this['channel'][_0x3c93('0xaf')](util[_0x3c93('0x58')](_0x3c93('0xb9'),_0xd76b42));};AGIVertices[_0x3c93('0x16')][_0x3c93('0xd2')]=function(_0x48bd3f){logger[_0x3c93('0x30')](util[_0x3c93('0x58')](_0x3c93('0xd3'),_0x48bd3f[_0x3c93('0x3b')]));if(!this[_0x3c93('0x89')](_0x48bd3f[_0x3c93('0xb2')])){return this['channel']['noop']('no\x20grammar\x20configured');}var _0x335f13=_0x48bd3f['grammar'];if(this[_0x3c93('0x89')](_0x48bd3f['options'])){_0x335f13+=','+_0x48bd3f[_0x3c93('0x7b')];}var _0x3be612=this[_0x3c93('0xf')]['exec'](_0x3c93('0xd4'),_0x335f13);if(_0x3be612['result']===-0x1){return _0x3be612;}var _0xfe8dd4=this[_0x3c93('0xa7')](_0x3c93('0xce'),_0x3c93('0xd5'));if(_0xfe8dd4[_0x3c93('0xb4')]===-0x1){return _0xfe8dd4;}var _0xbea75f=this['getAndSetVariable'](_0x3c93('0xb6'),_0x3c93('0xd6'));if(_0xbea75f[_0x3c93('0xb4')]===-0x1){return _0xbea75f;}var _0x2ffc6a=this[_0x3c93('0xa7')]('RECOG_INSTANCE()',_0x3c93('0xd7'));if(_0x2ffc6a[_0x3c93('0xb4')]===-0x1){return _0x2ffc6a;}return this['channel'][_0x3c93('0xaf')](util['format'](_0x3c93('0xb9'),_0x335f13));};AGIVertices[_0x3c93('0x16')][_0x3c93('0xd8')]=function(_0x3edcca){logger['info'](util[_0x3c93('0x58')](_0x3c93('0xd9'),_0x3edcca[_0x3c93('0x3b')]));if(!this['isConfigured'](_0x3edcca[_0x3c93('0xda')])){return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x3edcca,_0x3c93('0xdb'));}var _0x5a7751=this[_0x3c93('0x1a')]['sync'](this,_0x3edcca['odbc_id']);if(!_0x5a7751){return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x3edcca,_0x3c93('0xdc'));}if(!this['isConfigured'](_0x3edcca['query'])){return this[_0x3c93('0xf')]['error'](_0x3edcca,_0x3c93('0xdd'));}var _0x20b4d2=_0x3edcca[_0x3c93('0x32')][_0x3c93('0xde')](/(\r\n|\n|\r)/gm,'\x20');this[_0x3c93('0xf')][_0x3c93('0xaf')](util['format'](_0x3c93('0xdf'),_0x20b4d2));var _0x1af825=this['getQueryOdbc'][_0x3c93('0xa9')](this,_0x5a7751,_0x20b4d2);this[_0x3c93('0x39')][_0x3c93('0xa9')](this,_0x3edcca,_0x20b4d2);if(!this['isConfigured'](_0x3edcca[_0x3c93('0xe0')])){return this[_0x3c93('0xf')][_0x3c93('0xaf')](_0x3c93('0xe1'));}var _0x5c3bc9=this[_0x3c93('0x10')][_0x3c93('0xa9')](this,_0x3edcca['variable_id']);if(!_0x5c3bc9){return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x3edcca,_0x3c93('0xe2'));}var _0x57909c=this;_0x1af825[_0x3c93('0xe3')](function(_0x3c06c3,_0xe60eb7){Object[_0x3c93('0xe4')](_0x3c06c3)['forEach'](function(_0x4e58f4){_0x57909c[_0x3c93('0xf')]['setVariable'](util['format'](_0x3c93('0xe5'),_0x5c3bc9,_0xe60eb7,_0x4e58f4),_0x3c06c3[_0x4e58f4]);});});this[_0x3c93('0xf')][_0x3c93('0xa3')](util[_0x3c93('0x58')](_0x3c93('0xe6'),_0x5c3bc9),_0x1af825[_0x3c93('0xa2')]);return this[_0x3c93('0xf')]['noop'](util['format']('variable\x20%s\x20set',_0x5c3bc9));};AGIVertices[_0x3c93('0x16')]['dial']=function(_0x3deb8e){logger['debug'](util[_0x3c93('0x58')](_0x3c93('0xe7'),_0x3deb8e[_0x3c93('0x3b')]));if(!this[_0x3c93('0x89')](_0x3deb8e[_0x3c93('0xe8')])){return this['channel'][_0x3c93('0x2f')](_0x3deb8e,_0x3c93('0xe9'));}var _0x40a945=this[_0x3c93('0x1d')]['sync'](this,_0x3deb8e[_0x3c93('0xe8')]);if(!_0x40a945){return this[_0x3c93('0xf')]['error'](_0x3deb8e,'no\x20user\x20found');}var _0xc3f5b8=this['channel'][_0x3c93('0x5b')](_0x3c93('0xea'),[util[_0x3c93('0x58')](_0x3c93('0xeb'),_0x40a945),_0x3deb8e['timeout'],_0x3deb8e[_0x3c93('0xec')],_0x3deb8e[_0x3c93('0x68')]]);if(_0xc3f5b8[_0x3c93('0xb4')]===-0x1){return _0xc3f5b8;}return this[_0x3c93('0xf')][_0x3c93('0xaf')](util[_0x3c93('0x58')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x3c93('0x16')]['dialogflow']=function(_0x49f895){logger[_0x3c93('0x30')](util[_0x3c93('0x58')](_0x3c93('0xed'),_0x49f895[_0x3c93('0x3b')]));if(!this[_0x3c93('0x89')](_0x49f895[_0x3c93('0x7d')])){return this['channel'][_0x3c93('0xaf')](_0x3c93('0xee'));}if(!this[_0x3c93('0x89')](_0x49f895['text'])){return this['channel']['noop']('no\x20text\x20configured');}this[_0x3c93('0xf')][_0x3c93('0xef')]=!![];this[_0x3c93('0x39')](_0x49f895);this[_0x3c93('0x46')](_0x49f895[_0x3c93('0x5f')],'in','','');this[_0x3c93('0xf')]['noop'](util[_0x3c93('0x58')](_0x3c93('0xf0'),_0x49f895[_0x3c93('0x5f')]));var _0x111d73=this[_0x3c93('0x7c')][_0x3c93('0xa9')](this,_0x49f895);if(_0x111d73){for(var _0x645bb4 in _0x111d73){if(_0x111d73[_0x3c93('0x9a')](_0x645bb4)){this[_0x3c93('0xf')][_0x3c93('0xa3')](util[_0x3c93('0x58')](_0x3c93('0xf1'),_0x645bb4[_0x3c93('0x6f')]()),_0x111d73[_0x645bb4]);}}this[_0x3c93('0x46')](_0x111d73[_0x3c93('0xf2')],'out',_0x3c93('0xf3'),'');return this['channel'][_0x3c93('0xaf')](util['format'](_0x3c93('0xf4'),_0x111d73[_0x3c93('0xf2')]));}return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x49f895,_0x3c93('0xf5'));};AGIVertices[_0x3c93('0x16')][_0x3c93('0xf6')]=function(_0x5740dc){logger[_0x3c93('0x30')](util[_0x3c93('0x58')](_0x3c93('0xf7'),_0x5740dc['label']));if(!this[_0x3c93('0x89')](_0x5740dc[_0x3c93('0x80')])){return this[_0x3c93('0xf')][_0x3c93('0xaf')](_0x3c93('0xf8'));}if(!this[_0x3c93('0x89')](_0x5740dc[_0x3c93('0xf9')])){return this[_0x3c93('0xf')]['noop'](_0x3c93('0xfa'));}if(!this[_0x3c93('0x89')](_0x5740dc['private_key'])){return this[_0x3c93('0xf')][_0x3c93('0xaf')](_0x3c93('0xfb'));}if(!this[_0x3c93('0x89')](_0x5740dc[_0x3c93('0x82')])){return this[_0x3c93('0xf')]['noop'](_0x3c93('0xfc'));}if(!this[_0x3c93('0x89')](_0x5740dc[_0x3c93('0x5f')])){return this[_0x3c93('0xf')]['noop'](_0x3c93('0xad'));}this['channel']['bot']=!![];this[_0x3c93('0x39')](_0x5740dc);this[_0x3c93('0x46')](_0x5740dc[_0x3c93('0x5f')],'in','','');this[_0x3c93('0xf')][_0x3c93('0xaf')](util[_0x3c93('0x58')](_0x3c93('0xfd'),_0x5740dc[_0x3c93('0x5f')]));var _0x8cf9d3=this[_0x3c93('0x7f')][_0x3c93('0xa9')](this,_0x5740dc);if(_0x8cf9d3){for(var _0x5a56b9 in _0x8cf9d3){if(_0x8cf9d3[_0x3c93('0x9a')](_0x5a56b9)){if(_0x5a56b9!==_0x3c93('0xfe')){this[_0x3c93('0xf')]['setVariable'](util[_0x3c93('0x58')](_0x3c93('0xf1'),_0x5a56b9['toUpperCase']()),_0x8cf9d3[_0x5a56b9]);}}}this[_0x3c93('0x46')](_0x8cf9d3[_0x3c93('0xf2')],_0x3c93('0xff'),_0x3c93('0xf6'),_0x8cf9d3[_0x3c93('0xfe')]);return this[_0x3c93('0xf')][_0x3c93('0xaf')](util[_0x3c93('0x58')](_0x3c93('0x100'),_0x8cf9d3[_0x3c93('0xf2')]));}return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x5740dc,_0x3c93('0x101'));};AGIVertices[_0x3c93('0x16')]['sesteknda']=function(_0x2272f4){logger[_0x3c93('0x30')](util[_0x3c93('0x58')](_0x3c93('0x102'),_0x2272f4['label']));if(!this[_0x3c93('0x89')](_0x2272f4[_0x3c93('0x103')])){return this['channel'][_0x3c93('0xaf')](_0x3c93('0x104'));}if(!this[_0x3c93('0x89')](_0x2272f4[_0x3c93('0x105')])){return this[_0x3c93('0xf')][_0x3c93('0xaf')]('no\x20username\x20configured');}if(!this[_0x3c93('0x89')](_0x2272f4[_0x3c93('0x106')])){return this[_0x3c93('0xf')]['noop'](_0x3c93('0x107'));}if(!this['isConfigured'](_0x2272f4[_0x3c93('0x108')])){return this[_0x3c93('0xf')][_0x3c93('0xaf')](_0x3c93('0xad'));}this['channel'][_0x3c93('0xef')]=!![];this[_0x3c93('0x39')](_0x2272f4);this['createSquareMessage'](_0x2272f4['text'],'in','','');this['channel']['noop'](util[_0x3c93('0x58')](_0x3c93('0x109'),_0x2272f4['text']));var _0x118760=this[_0x3c93('0x83')]['sync'](this,_0x2272f4);if(_0x118760){for(var _0x4f2880 in _0x118760){if(_0x118760['hasOwnProperty'](_0x4f2880)){this[_0x3c93('0xf')][_0x3c93('0xa3')](util[_0x3c93('0x58')](_0x3c93('0x10a'),_0x4f2880[_0x3c93('0x6f')]()),_0x118760[_0x4f2880]);}}this[_0x3c93('0x46')](_0x118760[_0x3c93('0xf2')],_0x3c93('0xff'),_0x3c93('0x10b'),'');if(_0x118760['audiofile']){this[_0x3c93('0xf')][_0x3c93('0xaf')](util[_0x3c93('0x58')](_0x3c93('0x10c'),_0x118760[_0x3c93('0x10d')]));var _0x6cba05=this[_0x3c93('0xf')][_0x3c93('0x10e')](_0x118760[_0x3c93('0x10d')]);try{fs[_0x3c93('0x10f')](_0x118760[_0x3c93('0x10d')]+_0x3c93('0x110'));}catch(_0x4d6c9d){logger[_0x3c93('0x2f')](_0x4d6c9d);}return _0x6cba05;}else{return this[_0x3c93('0xf')]['noop'](util[_0x3c93('0x58')](_0x3c93('0x111'),_0x118760['speech']));}}return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x2272f4,_0x3c93('0x112'));};AGIVertices[_0x3c93('0x16')][_0x3c93('0x113')]=function(_0x1b9b77){logger[_0x3c93('0x30')](util[_0x3c93('0x58')](_0x3c93('0x114'),_0x1b9b77[_0x3c93('0x3b')]));return this[_0x3c93('0xf')][_0x3c93('0xaf')](_0x3c93('0x113'));};AGIVertices[_0x3c93('0x16')][_0x3c93('0x115')]=function(_0x420db8){logger[_0x3c93('0x30')](util[_0x3c93('0x58')](_0x3c93('0x116'),_0x420db8[_0x3c93('0x3b')]));var _0x2991fc='';if(_0x420db8[_0x3c93('0x117')]){if(!this[_0x3c93('0x89')](_0x420db8['trunk_id'])){return this['channel'][_0x3c93('0x2f')](_0x420db8,_0x3c93('0x118'));}else{var _0x511f84=parseInt(_0x420db8[_0x3c93('0x117')],0xa);if(isNaN(_0x511f84)){_0x2991fc=_0x420db8[_0x3c93('0x117')];}else{_0x2991fc=this[_0x3c93('0x1f')][_0x3c93('0xa9')](this,_0x420db8[_0x3c93('0x117')]);if(!_0x2991fc){return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x420db8,_0x3c93('0x119'));}}}}else if(_0x420db8['trunk_name']){_0x2991fc=_0x420db8[_0x3c93('0x11a')];}else{return this['channel'][_0x3c93('0x2f')](_0x420db8,_0x3c93('0x118'));}var _0x4d6244=this['channel'][_0x3c93('0x5b')](_0x3c93('0xea'),[util[_0x3c93('0x58')]('SIP/%s/%s',_0x2991fc,_0x420db8[_0x3c93('0x4d')]),_0x420db8[_0x3c93('0x69')],_0x420db8[_0x3c93('0xec')],_0x420db8[_0x3c93('0x68')]]);if(_0x4d6244[_0x3c93('0xb4')]===-0x1){return _0x4d6244;}return this['channel'][_0x3c93('0xaf')](util[_0x3c93('0x58')](_0x3c93('0x11b'),'DIAL'));};AGIVertices['prototype'][_0x3c93('0x11c')]=function(_0x507405){logger['info'](util[_0x3c93('0x58')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x507405[_0x3c93('0x3b')]));return this[_0x3c93('0xf')][_0x3c93('0xaf')](_0x3c93('0x11c'));};AGIVertices[_0x3c93('0x16')]['getdigits']=function(_0x5525c8){logger['info'](util[_0x3c93('0x58')](_0x3c93('0x11d'),_0x5525c8['label']));if(_0x5525c8[_0x3c93('0x11e')]===0x0){return this[_0x3c93('0xaa')](_0x5525c8);}_0x5525c8['retry']-=0x1;if(!this[_0x3c93('0x89')](_0x5525c8[_0x3c93('0x11f')])){return this['channel'][_0x3c93('0x2f')](_0x5525c8,'no\x20file\x20audio\x20selected');}var _0x4c83ad=this[_0x3c93('0x21')][_0x3c93('0xa9')](this,_0x5525c8['file_id']);if(!_0x4c83ad){return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x5525c8,_0x3c93('0x120'));}if(!this['isConfigured'](_0x5525c8[_0x3c93('0xe0')])){return this[_0x3c93('0xf')][_0x3c93('0x2f')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x475c21=this[_0x3c93('0xf')][_0x3c93('0x121')](_0x4c83ad,_0x5525c8[_0x3c93('0x122')],_0x5525c8['maxdigit']);var _0xe5df19=_0x475c21['result']?_0x475c21[_0x3c93('0xb4')][_0x3c93('0x51')]():'';logger[_0x3c93('0x30')]('test',JSON[_0x3c93('0x77')](_0x475c21));if(_0x475c21[_0x3c93('0xb4')]===-0x1){this[_0x3c93('0x39')][_0x3c93('0xa9')](this,_0x5525c8,_0xe5df19);return _0x475c21;}else if(_0x475c21['extra']===_0x3c93('0x69')){_0x475c21[_0x3c93('0xb4')]=_0xe5df19[_0x3c93('0xa2')]>=parseInt(_0x5525c8[_0x3c93('0x123')])?'x':'i';}else{_0x475c21[_0x3c93('0xb4')]=_0xe5df19['length']>=parseInt(_0x5525c8[_0x3c93('0x123')])&&_0xe5df19[_0x3c93('0xa2')]<=parseInt(_0x5525c8[_0x3c93('0x124')])?'x':'i';}var _0x320147=this[_0x3c93('0x10')][_0x3c93('0xa9')](this,_0x5525c8[_0x3c93('0xe0')]);if(!_0x320147){return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x5525c8,'no\x20variable\x20found');}this[_0x3c93('0xf')][_0x3c93('0xa3')](_0x320147,_0xe5df19);if(this[_0x3c93('0x89')](_0x5525c8[_0x3c93('0x125')])){var _0x2c2ca7=parseInt(_0x5525c8[_0x3c93('0x125')],0xa);var _0x23b390=rs[_0x3c93('0x126')]({'charset':'*','length':_0x2c2ca7});var _0x7b922b=_0xe5df19[_0x3c93('0xa2')];if(_0x7b922b>0x0){if(_0x7b922b>_0x2c2ca7){this[_0x3c93('0x39')][_0x3c93('0xa9')](this,_0x5525c8,_0x5525c8[_0x3c93('0x127')]===_0x3c93('0x128')?_0x23b390+_0xe5df19['substr'](_0x2c2ca7):_0xe5df19[_0x3c93('0x129')](0x0,_0x7b922b-_0x2c2ca7)+_0x23b390);}else{this['createSquareDetailsReport'][_0x3c93('0xa9')](this,_0x5525c8,rs[_0x3c93('0x126')]({'charset':'*','length':_0x7b922b}));}}else{this[_0x3c93('0x39')][_0x3c93('0xa9')](this,_0x5525c8,'');}}else{this['createSquareDetailsReport'][_0x3c93('0xa9')](this,_0x5525c8,_0xe5df19);}return _0x475c21;};AGIVertices[_0x3c93('0x16')][_0x3c93('0xe')]=function(_0x36abcd){logger[_0x3c93('0x30')](util[_0x3c93('0x58')](_0x3c93('0x12a'),_0x36abcd[_0x3c93('0x3b')]));return this[_0x3c93('0xd')](_0x36abcd);};AGIVertices[_0x3c93('0x16')][_0x3c93('0x12b')]=function(_0xcbef0){logger[_0x3c93('0x30')](util[_0x3c93('0x58')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0xcbef0['label']));this['createSquareDetailsReport']['sync'](this,_0xcbef0,_0xcbef0[_0x3c93('0x12c')]);return this['channel'][_0x3c93('0xaf')](util[_0x3c93('0x58')]('GOAL\x20%s',_0xcbef0[_0x3c93('0x12c')]));};AGIVertices[_0x3c93('0x16')][_0x3c93('0x12d')]=function(_0x113d64){logger[_0x3c93('0x30')](util[_0x3c93('0x58')](_0x3c93('0x12e'),_0x113d64[_0x3c93('0x3b')]));if(!this[_0x3c93('0x89')](_0x113d64['aws_access_key_id'])||!this[_0x3c93('0x89')](_0x113d64[_0x3c93('0x8d')])){return this[_0x3c93('0xf')]['noop'](_0x3c93('0x12f'));}if(!this[_0x3c93('0x89')](_0x113d64[_0x3c93('0x5f')])){return this[_0x3c93('0xf')]['noop']('no\x20text\x20configured');}this[_0x3c93('0xf')][_0x3c93('0xaf')](util[_0x3c93('0x58')]('Trying\x20aws\x20Polly\x20%s',_0x113d64['text']));var _0x30b311=this[_0x3c93('0x8b')][_0x3c93('0xa9')](this,_0x113d64);if(_0x30b311){this[_0x3c93('0xf')][_0x3c93('0xaf')](util[_0x3c93('0x58')](_0x3c93('0x130'),_0x30b311));var _0x5167d9=this[_0x3c93('0xf')][_0x3c93('0x10e')](_0x30b311);try{fs[_0x3c93('0x10f')](_0x30b311+_0x3c93('0x110'));}catch(_0x8f62c4){logger['error'](_0x8f62c4);}return _0x5167d9;}return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x113d64,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x3c93('0x16')]['awslex']=function(_0x3a1074){logger[_0x3c93('0x30')](util['format'](_0x3c93('0x131'),_0x3a1074['label']));if(!this['isConfigured'](_0x3a1074[_0x3c93('0x8c')])||!this['isConfigured'](_0x3a1074[_0x3c93('0x8d')])){return this[_0x3c93('0xf')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x3c93('0x89')](_0x3a1074['aws_bot_name'])){return this[_0x3c93('0xf')][_0x3c93('0xaf')](_0x3c93('0x132'));}if(!this[_0x3c93('0x89')](_0x3a1074[_0x3c93('0x5f')])){return this[_0x3c93('0xf')][_0x3c93('0xaf')]('no\x20text\x20configured');}this[_0x3c93('0xf')][_0x3c93('0xef')]=!![];this[_0x3c93('0x39')](_0x3a1074);this[_0x3c93('0x46')](_0x3a1074[_0x3c93('0x5f')],'in','','');this[_0x3c93('0xf')][_0x3c93('0xaf')](util[_0x3c93('0x58')]('Trying\x20Amazon\x20Lex:\x20%s',_0x3a1074[_0x3c93('0x5f')]));var _0x30ffa5=this[_0x3c93('0x92')][_0x3c93('0xa9')](this,_0x3a1074);if(_0x30ffa5){for(var _0x2f7301 in _0x30ffa5){if(_0x30ffa5['hasOwnProperty'](_0x2f7301)&&_[_0x3c93('0x9b')](_0x30ffa5[_0x2f7301])){this[_0x3c93('0xf')][_0x3c93('0xa3')](util[_0x3c93('0x58')]('AWS_LEX_%s',_0x2f7301[_0x3c93('0x6f')]()),_0x30ffa5[_0x2f7301]);}}if(_[_0x3c93('0x49')](_0x30ffa5[_0x3c93('0x133')])){return this[_0x3c93('0xf')]['noop'](_0x3c93('0x134'));}else{this[_0x3c93('0x46')](_0x30ffa5[_0x3c93('0x133')],'out',_0x3c93('0x135'),'');return this[_0x3c93('0xf')][_0x3c93('0xaf')](util['format']('Amazon\x20Lex\x20Result\x20%s',_0x30ffa5[_0x3c93('0x133')]));}}return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x3a1074,_0x3c93('0x136'));};AGIVertices[_0x3c93('0x16')][_0x3c93('0x137')]=function(_0x3683b4){logger['info'](util[_0x3c93('0x58')](_0x3c93('0x138'),_0x3683b4[_0x3c93('0x3b')],_0x3683b4[_0x3c93('0x69')]));if(!this[_0x3c93('0x89')](_0x3683b4[_0x3c93('0x7d')])){return this[_0x3c93('0xf')][_0x3c93('0xaf')](_0x3c93('0xee'));}var _0x4cce99=_0x3c93('0x139');var _0x3f3191=util['format'](_0x3c93('0x13a'),FILES_PATH,rs[_0x3c93('0x126')](0x4));var _0xbce434=util['format'](_0x3c93('0xa0'),_0x3f3191,_0x4cce99);var _0x5cde82=!![];if(_0x3683b4[_0x3c93('0x13b')]===_0x3c93('0x13c')){_0x5cde82=![];}var _0x24cf87=this[_0x3c93('0xf')][_0x3c93('0x13d')](_0x3f3191,_0x4cce99,_0x3683b4[_0x3c93('0x13e')],_0x3683b4['timeout'],undefined,_0x5cde82);if(_0x24cf87['result']!==-0x1){this[_0x3c93('0xf')][_0x3c93('0xaf')](util[_0x3c93('0x58')]('google\x20%s\x20file\x20created',_0xbce434));var _0x3feea3=this[_0x3c93('0x94')][_0x3c93('0xa9')](this,_0x3683b4,_0xbce434);if(_0x3feea3){for(var _0x50dff4 in _0x3feea3){if(_0x3feea3[_0x3c93('0x9a')](_0x50dff4)){this[_0x3c93('0xf')][_0x3c93('0xa3')](util[_0x3c93('0x58')](_0x3c93('0x13f'),_0x50dff4['toUpperCase']()),_0x3feea3[_0x50dff4]);}}return this[_0x3c93('0xf')][_0x3c93('0xaf')](util[_0x3c93('0x58')](_0x3c93('0x140'),JSON[_0x3c93('0x77')](_0x3feea3)));}}return _0x24cf87;};AGIVertices['prototype'][_0x3c93('0x141')]=function(_0xfac3a1){logger['info'](util[_0x3c93('0x58')](_0x3c93('0x142'),_0xfac3a1['label']));if(!this[_0x3c93('0x89')](_0xfac3a1[_0x3c93('0x97')])){return this[_0x3c93('0xf')][_0x3c93('0xaf')](_0x3c93('0x143'));}if(!this[_0x3c93('0x89')](_0xfac3a1[_0x3c93('0x98')])){return this[_0x3c93('0xf')][_0x3c93('0xaf')]('no\x20appsecret\x20configured');}var _0x4e1e4a=_0x3c93('0x139');var _0x447710=util[_0x3c93('0x58')]('%s/recordings/%s',FILES_PATH,rs[_0x3c93('0x126')](0x4));var _0x2fda3c=util[_0x3c93('0x58')](_0x3c93('0xa0'),_0x447710,_0x4e1e4a);var _0x40bcd2=!![];if(_0xfac3a1[_0x3c93('0x13b')]===_0x3c93('0x13c')){_0x40bcd2=![];}var _0x358556=this[_0x3c93('0xf')]['recordFile'](_0x447710,_0x4e1e4a,_0xfac3a1['intKey'],_0xfac3a1[_0x3c93('0x69')],undefined,_0x40bcd2);if(_0x358556[_0x3c93('0xb4')]!==-0x1){this[_0x3c93('0xf')][_0x3c93('0xaf')](util[_0x3c93('0x58')](_0x3c93('0x144'),_0x2fda3c));var _0xa2bba8=this[_0x3c93('0x96')]['sync'](this,_0xfac3a1,_0x2fda3c);if(_0xa2bba8){for(var _0x3406a7 in _0xa2bba8){if(_0xa2bba8[_0x3c93('0x9a')](_0x3406a7)){this[_0x3c93('0xf')][_0x3c93('0xa3')](util['format']('TILDE_ASR_%s',_0x3406a7[_0x3c93('0x6f')]()),_0xa2bba8[_0x3406a7]);}}return this[_0x3c93('0xf')][_0x3c93('0xaf')](util[_0x3c93('0x58')](_0x3c93('0x145'),JSON['stringify'](_0xa2bba8)));}}return _0x358556;};AGIVertices[_0x3c93('0x16')][_0x3c93('0x146')]=function(_0x320985){logger[_0x3c93('0x30')](util[_0x3c93('0x58')](_0x3c93('0x147'),_0x320985[_0x3c93('0x3b')]));return this[_0x3c93('0xf')]['continueAt'](_0x320985[_0x3c93('0x41')],_0x320985['extension'],_0x320985[_0x3c93('0x43')]);};AGIVertices[_0x3c93('0x16')]['gotoif']=function(_0x84a21){logger[_0x3c93('0x30')](util['format']('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x84a21[_0x3c93('0x3b')]));if(!this['isConfigured'](_0x84a21[_0x3c93('0x148')])){return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x84a21,_0x3c93('0x149'));}try{var _0x3553d1=eval(_0x84a21['condition'])?'true':_0x3c93('0x14a');this[_0x3c93('0xf')][_0x3c93('0xaf')](util[_0x3c93('0x58')]('EVAL\x20CONDITION\x20%s\x20%s',_0x84a21[_0x3c93('0x148')],_0x3553d1));return{'code':0xc8,'result':_0x3553d1};}catch(_0x9c74ba){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x3c93('0x16')][_0x3c93('0x14b')]=function(_0x45ee5f){logger[_0x3c93('0x30')](util['format'](_0x3c93('0x14c'),_0x45ee5f['label']));if(!this['isConfigured'](_0x45ee5f[_0x3c93('0x14d')])){return this['channel'][_0x3c93('0x2f')](_0x45ee5f,_0x3c93('0x14e'));}var _0x32ca30=this[_0x3c93('0x26')]['sync'](this,_0x45ee5f[_0x3c93('0x14d')]);if(!_0x32ca30){return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x45ee5f,_0x3c93('0x14f'));}for(var _0x1fda1e=0x0;_0x1fda1e<_0x32ca30['length'];_0x1fda1e+=0x1){var _0x122722=this[_0x3c93('0xf')][_0x3c93('0x10')](util[_0x3c93('0x58')](_0x3c93('0x150'),_0x32ca30[_0x1fda1e]));if(_0x122722[_0x3c93('0xb4')]===-0x1){return _0x122722;}logger[_0x3c93('0x30')](util[_0x3c93('0x58')]('IFTIME\x20%s\x20%s',_0x32ca30[_0x1fda1e],_0x122722[_0x3c93('0xa6')]));if(_0x122722[_0x3c93('0xa6')]===_0x3c93('0x151')){logger['info'](util[_0x3c93('0x58')]('IFTIME\x20%s\x20%s',_0x32ca30[_0x1fda1e],'true'));this[_0x3c93('0xf')][_0x3c93('0xaf')](util[_0x3c93('0x58')](_0x3c93('0x152'),_0x32ca30[_0x1fda1e],_0x3c93('0x151')));return{'code':0xc8,'result':'true'};}else{logger[_0x3c93('0x30')](util[_0x3c93('0x58')]('IFTIME\x20%s\x20%s',_0x32ca30[_0x1fda1e],_0x3c93('0x14a')));this[_0x3c93('0xf')]['noop'](util[_0x3c93('0x58')](_0x3c93('0x152'),_0x32ca30[_0x1fda1e],_0x3c93('0x14a')));}}return{'code':0xc8,'result':_0x3c93('0x14a')};};AGIVertices[_0x3c93('0x16')]['hangup']=function(_0x17d005){logger[_0x3c93('0x30')](util[_0x3c93('0x58')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x17d005[_0x3c93('0x3b')]));return this[_0x3c93('0xf')][_0x3c93('0x153')]();};AGIVertices[_0x3c93('0x16')][_0x3c93('0x154')]=function(_0x480178){logger[_0x3c93('0x30')](util[_0x3c93('0x58')](_0x3c93('0x155'),_0x480178['label']));if(!this['isConfigured'](_0x480178[_0x3c93('0x7d')])){return this['channel']['noop']('no\x20key\x20configured');}var _0x4cf23d=_0x3c93('0x139');var _0x85bd9e=util['format'](_0x3c93('0x13a'),FILES_PATH,rs[_0x3c93('0x126')](0x4));var _0x34ba83=util[_0x3c93('0x58')]('%s.%s',_0x85bd9e,_0x4cf23d);var _0x1941dc=!![];if(_0x480178[_0x3c93('0x13b')]===_0x3c93('0x13c')){_0x1941dc=![];}var _0x285dc8=this[_0x3c93('0xf')][_0x3c93('0x13d')](_0x85bd9e,_0x4cf23d,_0x480178['intKey'],_0x480178['timeout'],undefined,_0x1941dc);if(_0x285dc8[_0x3c93('0xb4')]!==-0x1){this[_0x3c93('0xf')][_0x3c93('0xaf')](util[_0x3c93('0x58')](_0x3c93('0x156'),_0x34ba83));var _0xcac8fe=this[_0x3c93('0x87')][_0x3c93('0xa9')](this,_0x480178,_0x34ba83);if(_0xcac8fe){for(var _0x3782dd in _0xcac8fe){if(_0xcac8fe[_0x3c93('0x9a')](_0x3782dd)){this[_0x3c93('0xf')]['setVariable'](util['format']('ISPEECH_ASR_%s',_0x3782dd[_0x3c93('0x6f')]()),_0xcac8fe[_0x3782dd]);}}return this[_0x3c93('0xf')][_0x3c93('0xaf')](util[_0x3c93('0x58')]('IspeechASR\x20Result\x20%s',JSON[_0x3c93('0x77')](_0xcac8fe)));}}return _0x285dc8;};AGIVertices['prototype']['ispeechtts']=function(_0x1fe331){logger['info'](util[_0x3c93('0x58')](_0x3c93('0x157'),_0x1fe331['label']));if(!this['isConfigured'](_0x1fe331['key'])){return this['channel'][_0x3c93('0xaf')](_0x3c93('0xee'));}if(!this[_0x3c93('0x89')](_0x1fe331[_0x3c93('0x5f')])){return this['channel']['noop']('no\x20text\x20configured');}this[_0x3c93('0xf')]['noop'](util[_0x3c93('0x58')]('Trying\x20ispeech\x20TTS\x20%s',_0x1fe331[_0x3c93('0x5f')]));var _0x5cf3dc=this['ispeechTTS']['sync'](this,_0x1fe331);if(_0x5cf3dc){this[_0x3c93('0xf')][_0x3c93('0xaf')](util[_0x3c93('0x58')](_0x3c93('0x156'),_0x5cf3dc));var _0x243e4d=this[_0x3c93('0xf')][_0x3c93('0x10e')](_0x5cf3dc,_0x1fe331[_0x3c93('0x13e')]);try{fs['unlink'](_0x5cf3dc+_0x3c93('0x110'));}catch(_0x5a658c){logger['error'](_0x5a658c);}return _0x243e4d;}return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x1fe331,_0x3c93('0x158'));};AGIVertices[_0x3c93('0x16')][_0x3c93('0x159')]=function(_0x4c7b6a){logger[_0x3c93('0x30')](util[_0x3c93('0x58')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x4c7b6a[_0x3c93('0x3b')]));if(!this[_0x3c93('0x89')](_0x4c7b6a[_0x3c93('0x15a')])){return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x4c7b6a,'no\x20find\x20by\x20configured');}logger['info'](util['format'](_0x3c93('0x15b'),this[_0x3c93('0xf')][_0x3c93('0x3e')],_0x4c7b6a[_0x3c93('0x15a')]));var _0x1fc295=this[_0x3c93('0x57')][_0x3c93('0xa9')](this,_0x4c7b6a[_0x3c93('0x15a')]);if(_0x1fc295){logger['info'](util[_0x3c93('0x58')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x3c93('0xf')][_0x3c93('0x3e')],_0x4c7b6a['findBy']));this[_0x3c93('0xf')][_0x3c93('0xaf')](util[_0x3c93('0x58')](_0x3c93('0x15c'),this['channel']['callerid'],_0x4c7b6a[_0x3c93('0x15a')]));return{'code':0xc8,'result':'success'};}else{logger[_0x3c93('0x30')](util[_0x3c93('0x58')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x3c93('0xf')][_0x3c93('0x3e')],_0x4c7b6a[_0x3c93('0x15a')]));this[_0x3c93('0xf')]['noop'](util[_0x3c93('0x58')](_0x3c93('0x15d'),this[_0x3c93('0xf')][_0x3c93('0x3e')],_0x4c7b6a[_0x3c93('0x15a')]));return{'code':0xc8,'result':_0x3c93('0x15e')};}};AGIVertices[_0x3c93('0x16')]['logout']=function(_0x31e79f){logger[_0x3c93('0x30')](util[_0x3c93('0x58')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x31e79f[_0x3c93('0x3b')]));if(!this['isConfigured'](_0x31e79f[_0x3c93('0x15a')])){return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x31e79f,_0x3c93('0x15f'));}logger[_0x3c93('0x30')](util[_0x3c93('0x58')](_0x3c93('0x15b'),this[_0x3c93('0xf')]['callerid'],_0x31e79f[_0x3c93('0x15a')]));var _0x47e578=this['agentLogout'][_0x3c93('0xa9')](this,_0x31e79f['findBy']);if(_0x47e578){logger[_0x3c93('0x30')](util[_0x3c93('0x58')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x3c93('0xf')][_0x3c93('0x3e')],_0x31e79f['findBy']));this[_0x3c93('0xf')][_0x3c93('0xaf')](util[_0x3c93('0x58')](_0x3c93('0x15c'),this['channel'][_0x3c93('0x3e')],_0x31e79f['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x3c93('0x30')](util[_0x3c93('0x58')](_0x3c93('0x15d'),this[_0x3c93('0xf')][_0x3c93('0x3e')],_0x31e79f['findBy']));this[_0x3c93('0xf')][_0x3c93('0xaf')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x3c93('0xf')]['callerid'],_0x31e79f[_0x3c93('0x15a')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x3c93('0x160')]=function(_0x20b6c8){logger[_0x3c93('0x30')](util[_0x3c93('0x58')](_0x3c93('0x161'),_0x20b6c8['label']));if(!this['isConfigured'](_0x20b6c8[_0x3c93('0x162')])){return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x20b6c8,_0x3c93('0x163'));}this['channel'][_0x3c93('0xaf')](util['format'](_0x3c93('0x164'),_0x20b6c8[_0x3c93('0x162')]));var _0x4b565a=eval(_0x20b6c8[_0x3c93('0x162')]);if(!this[_0x3c93('0x89')](_0x20b6c8['variable_id'])){return this['channel']['noop'](_0x3c93('0xe1'));}var _0x1b2cae=this['getVariable']['sync'](this,_0x20b6c8[_0x3c93('0xe0')]);if(!_0x1b2cae){return this[_0x3c93('0xf')]['error'](_0x20b6c8,_0x3c93('0xe2'));}if(_[_0x3c93('0xa1')](_0x4b565a)){var _0x5a9f36=this;_0x4b565a[_0x3c93('0xe3')](function(_0x4093f7,_0x59ae03){_0x5a9f36['channel'][_0x3c93('0xa3')](util[_0x3c93('0x58')](_0x3c93('0x165'),_0x1b2cae,_0x59ae03),_0x4093f7);});return this[_0x3c93('0xf')]['noop'](util[_0x3c93('0x58')](_0x3c93('0x166'),_0x1b2cae));}else{return this['channel'][_0x3c93('0xa3')](_0x1b2cae,_0x4b565a);}};AGIVertices[_0x3c93('0x16')][_0x3c93('0x167')]=function(_0x4545b0){logger['info'](util[_0x3c93('0x58')](_0x3c93('0x168'),_0x4545b0['label']));if(_0x4545b0['retry']===0x0){return this['maxRetry'](_0x4545b0);}_0x4545b0[_0x3c93('0x11e')]-=0x1;if(!this[_0x3c93('0x89')](_0x4545b0[_0x3c93('0x11f')])){return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x4545b0,_0x3c93('0x169'));}var _0x2c6f7d=this['getSound']['sync'](this,_0x4545b0['file_id']);if(!_0x2c6f7d){return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x4545b0,_0x3c93('0x120'));}var _0x36fcf7=this['channel'][_0x3c93('0x121')](_0x2c6f7d,_0x4545b0[_0x3c93('0x122')],_0x4545b0[_0x3c93('0x16a')]);var _0x447074=_0x36fcf7[_0x3c93('0xb4')];if(_0x36fcf7[_0x3c93('0xb4')]===-0x1){this[_0x3c93('0x39')]['sync'](this,_0x4545b0,'-1');return _0x36fcf7;}else if(_0x36fcf7['extra']===_0x3c93('0x69')){_0x36fcf7[_0x3c93('0xb4')]=_0x36fcf7[_0x3c93('0xb4')][_0x3c93('0xa2')]>0x0?_0x36fcf7['result']:'t';}else if(_[_0x3c93('0x48')](_0x36fcf7['result'])){_0x36fcf7[_0x3c93('0xb4')]='#';_0x447074='#';}if(!this[_0x3c93('0x89')](_0x4545b0[_0x3c93('0xe0')])){this[_0x3c93('0xf')][_0x3c93('0xaf')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x210b84=this[_0x3c93('0x10')][_0x3c93('0xa9')](this,_0x4545b0['variable_id']);if(!_0x210b84){return this[_0x3c93('0xf')]['error'](_0x4545b0,'no\x20variable\x20found');}this[_0x3c93('0xf')]['setVariable'](_0x210b84,_0x447074);}this[_0x3c93('0x39')][_0x3c93('0xa9')](this,_0x4545b0,_0x447074);return _0x36fcf7;};AGIVertices[_0x3c93('0x16')][_0x3c93('0xaf')]=function(_0x169f0d){logger['info'](util['format'](_0x3c93('0x16b'),_0x169f0d[_0x3c93('0x3b')]));return this['channel'][_0x3c93('0xaf')](_0x169f0d['output']||_0x169f0d['label']);};AGIVertices[_0x3c93('0x16')][_0x3c93('0x16c')]=function(_0x1fe988){logger[_0x3c93('0x30')](util[_0x3c93('0x58')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x1fe988[_0x3c93('0x3b')]));if(!this[_0x3c93('0x89')](_0x1fe988[_0x3c93('0x15a')])){return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x1fe988,'no\x20find\x20by\x20configured');}logger[_0x3c93('0x30')](util['format'](_0x3c93('0x15b'),this[_0x3c93('0xf')]['callerid'],_0x1fe988[_0x3c93('0x15a')]));var _0x3ce8e2=this[_0x3c93('0x16d')][_0x3c93('0xa9')](this,_0x1fe988[_0x3c93('0x16e')]);var _0x9f8c16=this[_0x3c93('0x53')][_0x3c93('0xa9')](this,_0x1fe988[_0x3c93('0x15a')],_0x3ce8e2);if(_0x9f8c16){logger[_0x3c93('0x30')](util['format'](_0x3c93('0x15c'),this['channel'][_0x3c93('0x3e')],_0x1fe988[_0x3c93('0x15a')]));this['channel'][_0x3c93('0xaf')](util[_0x3c93('0x58')](_0x3c93('0x15c'),this[_0x3c93('0xf')][_0x3c93('0x3e')],_0x1fe988['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x3c93('0x30')](util[_0x3c93('0x58')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x3c93('0x3e')],_0x1fe988[_0x3c93('0x15a')]));this[_0x3c93('0xf')][_0x3c93('0xaf')](util[_0x3c93('0x58')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x3c93('0xf')][_0x3c93('0x3e')],_0x1fe988[_0x3c93('0x15a')]));return{'code':0xc8,'result':_0x3c93('0x15e')};}};AGIVertices[_0x3c93('0x16')][_0x3c93('0x16f')]=function(_0x3b4ede){logger[_0x3c93('0x30')](util['format'](_0x3c93('0x170'),_0x3b4ede[_0x3c93('0x3b')]));if(!this['isConfigured'](_0x3b4ede[_0x3c93('0x11f')])){return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x3b4ede,_0x3c93('0x169'));}var _0x6599ea=this[_0x3c93('0x21')][_0x3c93('0xa9')](this,_0x3b4ede[_0x3c93('0x11f')]);if(!_0x6599ea){return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x3b4ede,_0x3c93('0x120'));}var _0x3246f7=this[_0x3c93('0xf')]['exec'](_0x3c93('0x171'),[_0x6599ea,_0x3b4ede[_0x3c93('0xec')]]);if(_0x3246f7[_0x3c93('0xb4')]===-0x1){return _0x3246f7;}return this[_0x3c93('0xf')][_0x3c93('0xaf')](util[_0x3c93('0x58')]('Executed\x20command\x20%s\x20%s',_0x3c93('0x171'),_0x6599ea));};AGIVertices[_0x3c93('0x16')][_0x3c93('0x172')]=function(_0x6f75ef){logger[_0x3c93('0x30')](util[_0x3c93('0x58')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x6f75ef[_0x3c93('0x3b')]));if(!this['isConfigured'](_0x6f75ef[_0x3c93('0x173')])){return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x6f75ef,_0x3c93('0x174'));}var _0x4233fb='';var _0x537274=parseInt(_0x6f75ef[_0x3c93('0x173')],0xa);if(isNaN(_0x537274)){_0x4233fb=_0x6f75ef[_0x3c93('0x173')];}else{_0x4233fb=this['getVoiceQueue'][_0x3c93('0xa9')](this,_0x6f75ef['queue_id']);if(!_0x4233fb){return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x6f75ef,_0x3c93('0x175'));}}var _0x1b4556='';if(this[_0x3c93('0x89')](_0x6f75ef[_0x3c93('0x11f')])){var _0x4a5d8e=this[_0x3c93('0x21')][_0x3c93('0xa9')](this,_0x6f75ef['file_id']);if(_0x4a5d8e){_0x1b4556=_0x4a5d8e;}}this[_0x3c93('0x39')]['sync'](this,_0x6f75ef,_0x4233fb);if(_0x6f75ef['opts'][_0x3c93('0x176')]('x')<0x0){_0x6f75ef['opts']+='x';}if(_0x6f75ef['opts'][_0x3c93('0x176')]('X')<0x0){_0x6f75ef['opts']+='X';}this[_0x3c93('0xf')][_0x3c93('0xa3')](_0x3c93('0x177'),_0x4233fb?_0x4233fb[_0x3c93('0x178')]():'');var _0x50e59c=this[_0x3c93('0xf')]['exec']('QUEUE',[_0x4233fb,_0x6f75ef['opts'],_0x6f75ef[_0x3c93('0x68')],_0x1b4556,_0x6f75ef[_0x3c93('0x69')],_0x6f75ef['agi'],_0x6f75ef[_0x3c93('0x179')],_0x6f75ef[_0x3c93('0x17a')],'',_0x6f75ef[_0x3c93('0x17b')]]);if(_0x50e59c[_0x3c93('0xb4')]===-0x1){return _0x50e59c;}return this[_0x3c93('0xf')][_0x3c93('0xaf')](util[_0x3c93('0x58')](_0x3c93('0xc7'),_0x3c93('0x17c'),_0x4233fb));};AGIVertices[_0x3c93('0x16')][_0x3c93('0x17d')]=function(_0x459186){logger['info'](util[_0x3c93('0x58')](_0x3c93('0x17e'),_0x459186[_0x3c93('0x3b')]));var _0x267b71=_0x459186[_0x3c93('0x17f')]||_0x3c93('0x139');var _0x52f7d6=util[_0x3c93('0x58')](_0x3c93('0x180'),this[_0x3c93('0xf')][_0x3c93('0x3a')],rs['generate'](0x5));var _0x5abbc8=util[_0x3c93('0x58')](_0x3c93('0x181'),FILES_PATH,_0x52f7d6,_0x267b71);var _0x19181c=util[_0x3c93('0x58')](_0x3c93('0x13a'),FILES_PATH,_0x52f7d6);this['createSquareRecording'][_0x3c93('0xa9')](this,_0x459186,_0x52f7d6,_0x5abbc8);this[_0x3c93('0xf')][_0x3c93('0xa3')](_0x3c93('0x182'),_0x52f7d6);logger['info'](_0x3c93('0x183'),_0x19181c,_0x267b71,_0x459186['escape_digits'],_0x459186[_0x3c93('0x69')]);return this[_0x3c93('0xf')][_0x3c93('0x13d')](_0x19181c,_0x267b71,_0x459186[_0x3c93('0x184')],_0x459186[_0x3c93('0x69')],undefined,!![]);};AGIVertices[_0x3c93('0x16')][_0x3c93('0x185')]=function(_0x55fe1a){logger[_0x3c93('0x30')](util['format'](_0x3c93('0x186'),_0x55fe1a['label']));if(!this['isConfigured'](_0x55fe1a[_0x3c93('0x68')])){return this[_0x3c93('0xf')][_0x3c93('0xaf')](_0x3c93('0x187'));}var _0x2101be=this[_0x3c93('0x67')]['sync'](this,_0x55fe1a);logger['info'](util[_0x3c93('0x58')]('Response:',util['inspect'](_0x2101be,{'showHidden':![],'depth':null})));if(!this[_0x3c93('0x89')](_0x55fe1a[_0x3c93('0xe0')])){return this[_0x3c93('0xf')][_0x3c93('0xaf')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x20e60d=this[_0x3c93('0x10')]['sync'](this,_0x55fe1a[_0x3c93('0xe0')]);if(!_0x20e60d){return this['channel'][_0x3c93('0x2f')](_0x55fe1a,_0x3c93('0xe2'));}this[_0x3c93('0xf')][_0x3c93('0xa3')](util[_0x3c93('0x58')](_0x3c93('0x188'),_0x20e60d),_0x2101be[_0x3c93('0x79')]?_0x2101be['statusCode']:'200');this[_0x3c93('0xf')][_0x3c93('0xa3')](util[_0x3c93('0x58')]('%s_STATUS_MESSAGE',_0x20e60d),_0x2101be[_0x3c93('0x7a')]?_0x2101be['statusMessage']:'OK');if(_0x2101be[_0x3c93('0x78')]){try{this[_0x3c93('0x9f')](_0x2101be[_0x3c93('0x78')],_0x20e60d);}catch(_0x2a0edf){logger['error'](util['format'](_0x3c93('0x189'),_0x20e60d));}}return this[_0x3c93('0xf')][_0x3c93('0xaf')](util[_0x3c93('0x58')](_0x3c93('0x18a'),_0x20e60d));};AGIVertices[_0x3c93('0x16')]['saydigits']=function(_0x333e49){logger[_0x3c93('0x30')](util[_0x3c93('0x58')](_0x3c93('0x18b'),_0x333e49[_0x3c93('0x3b')]));return this[_0x3c93('0xf')][_0x3c93('0x18c')](_0x333e49['digits'][_0x3c93('0xde')](/\s+/g,''),_0x333e49['escape_digits']);};AGIVertices[_0x3c93('0x16')][_0x3c93('0x18d')]=function(_0x10ba3c){logger[_0x3c93('0x30')](util[_0x3c93('0x58')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x10ba3c[_0x3c93('0x3b')]));return this['channel'][_0x3c93('0x18e')](_0x10ba3c[_0x3c93('0x6a')]['replace'](/\s+/g,''),_0x10ba3c['escape_digits']);};AGIVertices[_0x3c93('0x16')][_0x3c93('0x18f')]=function(_0x5f4028){logger[_0x3c93('0x30')](util[_0x3c93('0x58')](_0x3c93('0x190'),_0x5f4028['label']));return this[_0x3c93('0xf')][_0x3c93('0x191')](_0x5f4028[_0x3c93('0x5f')],_0x5f4028['escape_digits']);};AGIVertices[_0x3c93('0x16')][_0x3c93('0x192')]=function(_0x4e2849){logger[_0x3c93('0x30')](util['format'](_0x3c93('0x193'),_0x4e2849[_0x3c93('0x3b')]));if(!this[_0x3c93('0x89')](_0x4e2849[_0x3c93('0x194')])){return this[_0x3c93('0xf')]['noop'](_0x3c93('0x195'));}var _0x1a5b6e=this[_0x3c93('0x23')][_0x3c93('0xa9')](this,_0x4e2849[_0x3c93('0x194')]);if(!_0x1a5b6e||!_0x1a5b6e[_0x3c93('0x196')]){return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x4e2849,_0x3c93('0x197'));}var _0x210b52={'from':util['format'](_0x3c93('0x198'),_0x1a5b6e[_0x3c93('0x14')],_0x1a5b6e[_0x3c93('0x199')]||_0x1a5b6e[_0x3c93('0x196')][_0x3c93('0x19a')]),'to':_0x4e2849['to']||'','cc':_0x4e2849['cc']||'','bcc':_0x4e2849[_0x3c93('0x19b')]||'','subject':_0x4e2849[_0x3c93('0x19c')],'html':_0x4e2849[_0x3c93('0x5f')],'text':_0x4e2849[_0x3c93('0x5f')]};if(this[_0x3c93('0x89')](_0x4e2849[_0x3c93('0x19d')])){}logger['debug']('sendMail\x20message',JSON[_0x3c93('0x77')](_0x210b52));this[_0x3c93('0x39')][_0x3c93('0xa9')](this,_0x4e2849,_0x4e2849[_0x3c93('0x194')]);this[_0x3c93('0xf')]['noop'](util[_0x3c93('0x58')](_0x3c93('0x19e'),_0x1a5b6e[_0x3c93('0x14')]));this[_0x3c93('0x24')]['sync'](this,_0x1a5b6e[_0x3c93('0x19f')],_0x210b52);return this[_0x3c93('0xf')][_0x3c93('0xaf')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x3c93('0x1a0')]=function(_0x322d22){logger[_0x3c93('0x30')](util[_0x3c93('0x58')](_0x3c93('0x1a1'),_0x322d22['label']));return this['channel'][_0x3c93('0xaf')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x3c93('0x16')]['sendSMS']=function(_0x11d315){logger[_0x3c93('0x30')](util[_0x3c93('0x58')](_0x3c93('0x1a2'),_0x11d315[_0x3c93('0x3b')]));if(!this['isConfigured'](_0x11d315['sms_account_id'])){return this[_0x3c93('0xf')]['noop']('no\x20sms\x20account\x20configured');}var _0x36c336=this[_0x3c93('0x36')]['sync'](this,_0x11d315['sms_account_id']);if(!_0x36c336){return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x11d315,_0x3c93('0x1a3'));}var _0x15339d={'body':_0x11d315[_0x3c93('0x1a4')],'phone':_0x11d315['to']||'','SmsAccountId':_0x36c336['id']};logger['debug'](_0x3c93('0x1a5'),JSON['stringify'](_0x15339d));this[_0x3c93('0x39')]['sync'](this,_0x11d315,_0x11d315[_0x3c93('0x1a6')]);this['channel'][_0x3c93('0xaf')](util[_0x3c93('0x58')](_0x3c93('0x1a7'),_0x36c336[_0x3c93('0x14')]));this['createSmsMessage'][_0x3c93('0xa9')](this,_0x15339d);return this[_0x3c93('0xf')][_0x3c93('0xaf')](_0x3c93('0x1a8'));};AGIVertices['prototype'][_0x3c93('0x1a9')]=function(_0x27cc10){logger[_0x3c93('0x30')](util[_0x3c93('0x58')](_0x3c93('0x1aa'),_0x27cc10[_0x3c93('0x3b')]));if(!this[_0x3c93('0x89')](_0x27cc10['variable_id'])){return this[_0x3c93('0xf')]['error'](_0x27cc10,'no\x20variable\x20selected');}var _0x2351a6=this['getVariable'][_0x3c93('0xa9')](this,_0x27cc10[_0x3c93('0xe0')]);if(!_0x2351a6){return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x27cc10,'no\x20variable\x20found');}return this[_0x3c93('0xf')]['setVariable'](_0x2351a6,_0x27cc10[_0x3c93('0x1ab')]);};AGIVertices['prototype'][_0x3c93('0x1ac')]=function(_0xbdd69e){logger[_0x3c93('0x30')](util[_0x3c93('0x58')](_0x3c93('0x1ad'),_0xbdd69e['label']));this[_0x3c93('0xf')][_0x3c93('0xaf')](_0x3c93('0x1ae'));if(_0xbdd69e[_0x3c93('0xbd')]===_0x3c93('0x1af')){this['channel'][_0x3c93('0xaf')](_0x3c93('0x1b0'));return this[_0x3c93('0xf')][_0x3c93('0xbd')]();}return this['channel'][_0x3c93('0xaf')](_0x3c93('0x1b1'));};AGIVertices[_0x3c93('0x16')]['subproject']=function(_0x74e156){logger[_0x3c93('0x30')](util[_0x3c93('0x58')](_0x3c93('0x1b2'),_0x74e156[_0x3c93('0x3b')]));if(!this[_0x3c93('0x89')](_0x74e156[_0x3c93('0x1b3')])){return this[_0x3c93('0xf')]['error'](_0x74e156,_0x3c93('0x1b4'));}var _0x3e004c=this[_0x3c93('0x19')][_0x3c93('0xa9')](this,_0x74e156[_0x3c93('0x1b3')]);if(!this[_0x3c93('0x89')](_0x3e004c)){return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x74e156,util[_0x3c93('0x58')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x74e156[_0x3c93('0x1b3')]));}if(_0x3e004c===this[_0x3c93('0xf')][_0x3c93('0x3d')]){return this['channel'][_0x3c93('0x2f')](_0x74e156,_0x3c93('0x1b5'));}this['createSquareDetailsReport'][_0x3c93('0xa9')](this,_0x74e156,_0x3e004c);var _0x472a90=this[_0x3c93('0xf')][_0x3c93('0x5b')](_0x3c93('0x1b6'),util[_0x3c93('0x58')](_0x3c93('0x1b7'),config['agi'][_0x3c93('0x1b8')]||_0x3c93('0x1b9'),_0x3e004c,this['channel']['arg_1']));if(_0x472a90[_0x3c93('0xb4')]===-0x1){return _0x472a90;}return this[_0x3c93('0xf')][_0x3c93('0xaf')](util[_0x3c93('0x58')](_0x3c93('0xc7'),_0x3c93('0x1b6'),_0x3e004c));};AGIVertices[_0x3c93('0x16')][_0x3c93('0x1ba')]=function(_0x27817e){logger[_0x3c93('0x30')](util[_0x3c93('0x58')](_0x3c93('0x1bb'),_0x27817e[_0x3c93('0x3b')]));var _0x5c6c46=this['shellCommand']['sync'](this,_0x27817e['command']);this['createSquareDetailsReport'][_0x3c93('0xa9')](this,_0x27817e,_0x27817e[_0x3c93('0xbb')]);if(this['isConfigured'](_0x27817e[_0x3c93('0xe0')])){var _0x2e9655=this['getVariable'][_0x3c93('0xa9')](this,_0x27817e['variable_id']);if(_0x2e9655){this[_0x3c93('0xf')]['setVariable'](_0x2e9655,_0x5c6c46);return this[_0x3c93('0xf')]['noop'](util[_0x3c93('0x58')](_0x3c93('0x1bc'),_0x27817e['command'],_0x2e9655));}}return this[_0x3c93('0xf')][_0x3c93('0xaf')](util['format'](_0x3c93('0x1bd'),_0x27817e[_0x3c93('0xbb')]));};AGIVertices['prototype'][_0x3c93('0x1be')]=function(_0x347c3d){logger[_0x3c93('0x30')](util['format'](_0x3c93('0x1bf'),_0x347c3d[_0x3c93('0x3b')]));_0x347c3d[_0x3c93('0x5f')]=_0x347c3d[_0x3c93('0x5f')][_0x3c93('0xde')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x3c93('0x89')](_0x347c3d[_0x3c93('0x5e')])){return this[_0x3c93('0xf')]['noop']('no\x20apiKey\x20configured');}if(!this[_0x3c93('0x89')](_0x347c3d[_0x3c93('0x5f')])){return this['channel'][_0x3c93('0xaf')](_0x3c93('0xad'));}this[_0x3c93('0xf')]['noop'](util[_0x3c93('0x58')](_0x3c93('0x1c0'),_0x347c3d[_0x3c93('0x5f')]));var _0x1cb9f6=this[_0x3c93('0x5d')]['sync'](this,_0x347c3d);if(_0x1cb9f6){this['channel'][_0x3c93('0xaf')](util[_0x3c93('0x58')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x1cb9f6));var _0x209ca5=this[_0x3c93('0xf')]['streamFile'](_0x1cb9f6);try{fs[_0x3c93('0x10f')](_0x1cb9f6+'.wav');}catch(_0x25ab12){logger['error'](_0x25ab12);}return _0x209ca5;}return this['channel']['error'](_0x347c3d,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x3c93('0x1c1')]=function(_0x39822b){logger['info'](util[_0x3c93('0x58')](_0x3c93('0x1c2'),_0x39822b[_0x3c93('0x3b')]));_0x39822b[_0x3c93('0x5f')]=_0x39822b['text'][_0x3c93('0xde')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x3c93('0x89')](_0x39822b['text'])){return this['channel'][_0x3c93('0xaf')](_0x3c93('0xad'));}this['channel'][_0x3c93('0xaf')](util['format']('Trying\x20Google\x20TTS\x20%s',_0x39822b[_0x3c93('0x5f')]));var _0x218892=this[_0x3c93('0x65')]['sync'](this,_0x39822b);if(_0x218892){this[_0x3c93('0xf')][_0x3c93('0xaf')](util['format'](_0x3c93('0x1c3'),_0x218892));var _0xb9fde9=this[_0x3c93('0xf')]['streamFile'](_0x218892);try{fs[_0x3c93('0x10f')](_0x218892+'.wav');}catch(_0x55dd37){logger['error'](_0x55dd37);}return _0xb9fde9;}return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x39822b,_0x3c93('0x1c4'));};AGIVertices[_0x3c93('0x16')][_0x3c93('0x1c5')]=function(_0x4654f7){logger[_0x3c93('0x30')](util['format'](_0x3c93('0x1c6'),_0x4654f7[_0x3c93('0x3b')]));if(!this[_0x3c93('0x89')](_0x4654f7[_0x3c93('0x15a')])){return this['channel']['error'](_0x4654f7,_0x3c93('0x15f'));}logger['info'](util[_0x3c93('0x58')](_0x3c93('0x15b'),this[_0x3c93('0xf')][_0x3c93('0x3e')],_0x4654f7[_0x3c93('0x15a')]));var _0x2639ab=this[_0x3c93('0x55')][_0x3c93('0xa9')](this,_0x4654f7[_0x3c93('0x15a')]);if(_0x2639ab){logger[_0x3c93('0x30')](util['format'](_0x3c93('0x15c'),this['channel'][_0x3c93('0x3e')],_0x4654f7[_0x3c93('0x15a')]));this[_0x3c93('0xf')][_0x3c93('0xaf')](util['format'](_0x3c93('0x15c'),this[_0x3c93('0xf')][_0x3c93('0x3e')],_0x4654f7[_0x3c93('0x15a')]));return{'code':0xc8,'result':_0x3c93('0x1c7')};}else{logger['info'](util[_0x3c93('0x58')](_0x3c93('0x15d'),this[_0x3c93('0xf')][_0x3c93('0x3e')],_0x4654f7[_0x3c93('0x15a')]));this['channel'][_0x3c93('0xaf')](util['format'](_0x3c93('0x15d'),this[_0x3c93('0xf')][_0x3c93('0x3e')],_0x4654f7[_0x3c93('0x15a')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x3c93('0x16')][_0x3c93('0x1c8')]=function(_0x12b5c6){logger[_0x3c93('0x30')](util['format'](_0x3c93('0x1c9'),_0x12b5c6['label']));var _0x5dcf62=this[_0x3c93('0xf')]['exec']('VOICEMAIL',[_0x12b5c6[_0x3c93('0x1ca')],_0x12b5c6[_0x3c93('0x7b')]]);if(_0x5dcf62['result']===-0x1){return _0x5dcf62;}return this[_0x3c93('0xf')][_0x3c93('0xaf')](util[_0x3c93('0x58')](_0x3c93('0xc7'),_0x3c93('0x1cb'),_0x12b5c6['mailbox']));};AGIVertices[_0x3c93('0x16')]['vswitch']=function(_0x1a7c44){logger[_0x3c93('0x30')](util[_0x3c93('0x58')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x1a7c44[_0x3c93('0x3b')]));if(!this[_0x3c93('0x89')](_0x1a7c44[_0x3c93('0xe0')])){return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x1a7c44,'no\x20variable\x20selected');}var _0x329bab=this[_0x3c93('0x10')]['sync'](this,_0x1a7c44[_0x3c93('0xe0')]);if(!_0x329bab){return this[_0x3c93('0xf')][_0x3c93('0x2f')](_0x1a7c44,'no\x20variable\x20found');}var _0x5807a7=this[_0x3c93('0xf')][_0x3c93('0x10')](_0x329bab);return{'code':0xc8,'result':_0x5807a7['extra']?_0x5807a7[_0x3c93('0xa6')]:'-'};};String[_0x3c93('0x16')][_0x3c93('0xa5')]=function(_0x482add,_0x5417ae){return this['split'](_0x482add)[_0x3c93('0x1cc')](_0x5417ae);};module[_0x3c93('0x1cd')]=AGIVertices;
\ No newline at end of file
+var _0x983c=['no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20found','keys','forEach','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','no\x20project_id\x20configured','client_email','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','wav','beep','NOBEEP','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','EVAL\x20CONDITION\x20%s\x20%s','false','gotoiftime','getIntervals','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','math','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','Enter\x20in\x20RECORD\x20(%s)\x20block','%s/recordings/%s.%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','Smtp','user','sendMail\x20message','sendMailMessage','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','set','variable_value','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','arg_1','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','exports','util','lodash','shelljs','odbc','randomstring','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','rawHeaders','rawBody','menu','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','name','catch','getVoiceQueue','getVoiceQueueById','then','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getSound','getSoundById','getSoundPath','save_name','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','agicommand','createSquareRecording','callerid','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','uniqueid','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','text','ssmlGender','audioEncoding','googleTTS','google_tts_language','restAPI','url','method','timeout','includes','POST','PUT','toUpperCase','body','parse','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','statusMessage','statusCode','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','key','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clone','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','saveRestApiResult','length','%s.%s','replaceObjectAllVariables','split','replaceAll','extra','getAndSetVariable','result','setVariable','isConfigured','maxRetry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected'];(function(_0x786e9,_0x1a029){var _0x1f891b=function(_0x31ad7c){while(--_0x31ad7c){_0x786e9['push'](_0x786e9['shift']());}};_0x1f891b(++_0x1a029);}(_0x983c,0xf3));var _0xc983=function(_0x5da794,_0xf1cf6){_0x5da794=_0x5da794-0x0;var _0x2517ad=_0x983c[_0x5da794];return _0x2517ad;};'use strict';var fs=require('fs');var util=require(_0xc983('0x0'));var _=require(_0xc983('0x1'));var sh=require(_0xc983('0x2'));var odbc=require(_0xc983('0x3'))();var rs=require(_0xc983('0x4'));var moment=require('moment');var Mustache=require(_0xc983('0x5'));var rp=require(_0xc983('0x6'));var logger=require(_0xc983('0x7'))(_0xc983('0x8'));var config=require(_0xc983('0x9'));var shared=require(_0xc983('0xa'));var scripts=require(_0xc983('0xb'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xc983('0xc'),_0xc983('0xd')];var verticesWithRetry=[_0xc983('0xe'),_0xc983('0xf'),'getsecretdigits'];var AGIVertices=function(_0x548063,_0x4fbf6f,_0x5ad672){this[_0xc983('0x10')]=_0x548063;this[_0xc983('0x11')]=_0x4fbf6f;this[_0xc983('0x12')]=_0x5ad672;};AGIVertices[_0xc983('0x13')][_0xc983('0x14')]=function(_0x2e7f76,_0x3574d1){this[_0xc983('0x11')][_0xc983('0x15')](_0x2e7f76)['then'](function(_0x160b3b){_0x3574d1(null,_0x160b3b?_0x160b3b[_0xc983('0x16')]:![]);})[_0xc983('0x17')](function(_0x1b4dd2){_0x3574d1(_0x1b4dd2);});};AGIVertices[_0xc983('0x13')][_0xc983('0x18')]=function(_0x5e5f2d,_0x1ebf7c){this[_0xc983('0x11')][_0xc983('0x19')](_0x5e5f2d)[_0xc983('0x1a')](function(_0x3e17e4){_0x1ebf7c(null,_0x3e17e4?_0x3e17e4[_0xc983('0x16')]:![]);})['catch'](function(_0x18d7f5){_0x1ebf7c(_0x18d7f5);});};AGIVertices[_0xc983('0x13')][_0xc983('0x1b')]=function(_0x1907ad,_0x2f5dad){this[_0xc983('0x11')][_0xc983('0x1c')](_0x1907ad)[_0xc983('0x1a')](function(_0x135e0d){_0x2f5dad(null,_0x135e0d?_0x135e0d[_0xc983('0x16')]:![]);})['catch'](function(_0x5c7833){_0x2f5dad(_0x5c7833);});};AGIVertices[_0xc983('0x13')][_0xc983('0x1d')]=function(_0x3bdbc9,_0x150a19){this[_0xc983('0x11')][_0xc983('0x1e')](_0x3bdbc9)[_0xc983('0x1a')](function(_0x51c552){_0x150a19(null,_0x51c552?_0x51c552['dsn']:![]);})[_0xc983('0x17')](function(_0x3873b1){_0x150a19(_0x3873b1);});};AGIVertices[_0xc983('0x13')][_0xc983('0x1f')]=function(_0xfcf7b6,_0x35e092){this[_0xc983('0x11')][_0xc983('0x20')](_0xfcf7b6)[_0xc983('0x1a')](function(_0x6851b5){_0x35e092(null,_0x6851b5?_0x6851b5[_0xc983('0x16')]:![]);})[_0xc983('0x17')](function(_0x48a916){_0x35e092(_0x48a916);});};AGIVertices['prototype'][_0xc983('0x21')]=function(_0x446c80,_0x54040e){this[_0xc983('0x11')]['getTrunkById'](_0x446c80)[_0xc983('0x1a')](function(_0x16b2fa){_0x54040e(null,_0x16b2fa?_0x16b2fa[_0xc983('0x16')]:![]);})[_0xc983('0x17')](function(_0x16f027){_0x54040e(_0x16f027);});};AGIVertices['prototype'][_0xc983('0x22')]=function(_0x22636c,_0x1fc738){var _0x183871=this;this[_0xc983('0x11')][_0xc983('0x23')](_0x22636c)['then'](function(_0x2a94c1){_0x1fc738(null,_0x2a94c1?_0x183871[_0xc983('0x24')](_0x2a94c1[_0xc983('0x25')]):![]);})['catch'](function(_0x2db574){_0x1fc738(_0x2db574);});};AGIVertices[_0xc983('0x13')]['getMailAccount']=function(_0x5c1737,_0x4fecbb){this[_0xc983('0x11')]['getMailAccountById'](_0x5c1737)['then'](function(_0x36369c){_0x4fecbb(null,_0x36369c?_0x36369c:![]);})[_0xc983('0x17')](function(_0x5d222e){_0x4fecbb(_0x5d222e);});};AGIVertices[_0xc983('0x13')]['sendMailMessage']=function(_0x4e821b,_0x55106e,_0x127340){this[_0xc983('0x12')]['sendMailMessage'](_0x4e821b,_0x55106e)[_0xc983('0x1a')](function(){_0x127340(null);})[_0xc983('0x17')](function(_0x8079c6){_0x127340(_0x8079c6);});};AGIVertices[_0xc983('0x13')]['getIntervals']=function(_0x560820,_0x31c3c1){this[_0xc983('0x11')][_0xc983('0x26')](_0x560820)['then'](function(_0x51fbdb){if(_0x51fbdb){if(_0x51fbdb[_0xc983('0x27')]){_0x31c3c1(null,[_0x51fbdb[_0xc983('0x28')]]);}else{_0x31c3c1(null,_[_0xc983('0x29')](_0x51fbdb[_0xc983('0x2a')],_0xc983('0x28')));}}else{_0x31c3c1(null,![]);}})[_0xc983('0x17')](function(_0x6e4728){_0x31c3c1(_0x6e4728);});};AGIVertices[_0xc983('0x13')][_0xc983('0x24')]=function(_0x1f1ba8){return util[_0xc983('0x2b')](_0xc983('0x2c'),FILES_PATH,_0x1f1ba8);};AGIVertices['prototype']['getQueryOdbc']=function(_0x9e9f66,_0x4befd6,_0x1d3cac){odbc[_0xc983('0x2d')](_0x9e9f66,function(_0x5cf2df){if(_0x5cf2df){logger['error'](_0xc983('0x2e'),_0x5cf2df);_0x1d3cac(_0x5cf2df);}else{logger[_0xc983('0x2f')](_0xc983('0x30'));odbc[_0xc983('0x31')](_0x4befd6,function(_0x48b9a9,_0x45b9e4){if(_0x48b9a9){logger[_0xc983('0x2f')](_0xc983('0x32'),_0x4befd6);_0x1d3cac(_0x48b9a9);}else{logger['info'](_0xc983('0x33'),_0x4befd6);odbc[_0xc983('0x34')](function(_0x479c34){if(_0x479c34){logger[_0xc983('0x35')](_0xc983('0x36'),_0x479c34);}_0x1d3cac(null,_0x45b9e4);});}});}});};AGIVertices[_0xc983('0x13')][_0xc983('0x37')]=function(_0x17d9cc,_0x6aecb8){this[_0xc983('0x11')][_0xc983('0x38')](_0x17d9cc)['then'](function(_0x72f3af){_0x6aecb8(null,_0x72f3af?_0x72f3af:![]);})['catch'](function(_0x4a0f3d){_0x6aecb8(_0x4a0f3d);});};AGIVertices[_0xc983('0x13')][_0xc983('0x39')]=function(_0x4f5e3f,_0x3debfd){this[_0xc983('0x11')][_0xc983('0x39')](_0x4f5e3f)['then'](function(_0x2ea6cc){_0x3debfd(null,_0x2ea6cc);})[_0xc983('0x17')](function(_0x20385b){_0x3debfd(_0x20385b);});};AGIVertices[_0xc983('0x13')][_0xc983('0x3a')]=function(_0x2b0162,_0x6ab43e,_0x503835){this[_0xc983('0x11')][_0xc983('0x3a')]({'uniqueid':this[_0xc983('0x10')]['uniqueid'],'node':_0x2b0162[_0xc983('0x3b')],'application':_0x2b0162[_0xc983('0x3c')],'data':_0x6ab43e||null,'project_name':this[_0xc983('0x10')]['arg_1'],'callerid':this[_0xc983('0x10')]['callerid']})[_0xc983('0x1a')](function(_0x28f9d6){if(_0x503835){_0x503835(null,_0x28f9d6);}})[_0xc983('0x17')](function(_0x51e11c){if(_0x503835){_0x503835(_0x51e11c);}});};AGIVertices[_0xc983('0x13')][_0xc983('0x3d')]=function(_0x6a2abe,_0x1fa2d3,_0x19f6d5,_0x17f79e){this[_0xc983('0x11')]['createSquareRecording']({'uniqueid':this[_0xc983('0x10')]['uniqueid'],'callerid':this['channel'][_0xc983('0x3e')],'calleridname':this['channel'][_0xc983('0x3f')],'context':this[_0xc983('0x10')][_0xc983('0x40')],'extension':this[_0xc983('0x10')][_0xc983('0x41')],'priority':this[_0xc983('0x10')][_0xc983('0x42')],'accountcode':this[_0xc983('0x10')][_0xc983('0x43')],'dnid':this[_0xc983('0x10')][_0xc983('0x44')],'projectName':this[_0xc983('0x10')]['arg_1'],'saveName':_0x1fa2d3,'filename':_0x6a2abe[_0xc983('0x45')]||_0x1fa2d3,'savePath':_0x19f6d5})[_0xc983('0x1a')](function(_0x175563){_0x17f79e(null,_0x175563);})['catch'](function(_0x3fd424){_0x17f79e(_0x3fd424);});};AGIVertices[_0xc983('0x13')]['createSquareMessage']=function(_0x5f1143,_0x223e29,_0x18249f,_0x92935a,_0x1d4250){this[_0xc983('0x11')][_0xc983('0x46')]({'uniqueid':this[_0xc983('0x10')][_0xc983('0x47')],'body':_0x5f1143,'direction':_0x223e29,'providerName':_0x18249f,'providerResponse':_0x92935a})[_0xc983('0x1a')](function(_0x5a9631){if(_0x1d4250){_0x1d4250(null,_0x5a9631);}})[_0xc983('0x17')](function(_0x2d0eaa){if(_0x1d4250){_0x1d4250(_0x2d0eaa);}});};AGIVertices[_0xc983('0x13')][_0xc983('0x48')]=function(_0x1cc905,_0x136351){this['rpc'][_0xc983('0x48')]({'firstName':_[_0xc983('0x49')](_0x1cc905[_0xc983('0x16')])||_[_0xc983('0x4a')](_0x1cc905[_0xc983('0x16')])?_0xc983('0x4b')+Math[_0xc983('0x4c')]():_0x1cc905[_0xc983('0x16')],'lastName':_[_0xc983('0x49')](_0x1cc905[_0xc983('0x4d')])||_[_0xc983('0x4a')](_0x1cc905[_0xc983('0x4d')])?null:_0x1cc905[_0xc983('0x4d')],'phone':_0x1cc905[_0xc983('0x4e')],'ListId':_0x1cc905[_0xc983('0x4f')],'scheduledat':_0x1cc905[_0xc983('0x50')],'callbackUniqueid':this['channel'][_0xc983('0x47')],'tags':_0xc983('0x51'),'description':_0xc983('0x52')+_0x1cc905['scheduledAt'][_0xc983('0x53')](),'priority':_0x1cc905[_0xc983('0x54')]})[_0xc983('0x1a')](function(_0x30110d){_0x136351(null,_0x30110d);})[_0xc983('0x17')](function(_0x1fb490){_0x136351(_0x1fb490);});};AGIVertices['prototype']['getPause']=function(_0x1f183e,_0x423393){this['rpc']['getPauseById'](_0x1f183e)[_0xc983('0x1a')](function(_0x23eef6){_0x423393(null,_0x23eef6?_0x23eef6[_0xc983('0x16')]:![]);})[_0xc983('0x17')](function(_0x4962f1){_0x423393(_0x4962f1);});};AGIVertices[_0xc983('0x13')][_0xc983('0x55')]=function(_0x830b54,_0x41e8ef,_0x3ff91a){var _0x125d16={'role':_0xc983('0x56')};_0x125d16[_0x830b54]=this[_0xc983('0x10')][_0xc983('0x3e')];this[_0xc983('0x11')]['agentPause'](_0x125d16,_0x41e8ef,this['channel']['uniqueid'])['then'](function(_0x315d64){_0x3ff91a(null,_[_0xc983('0x4a')](_0x315d64)?![]:!![]);})[_0xc983('0x17')](function(_0x121c64){logger['error'](_0x121c64);_0x3ff91a(null,![]);});};AGIVertices[_0xc983('0x13')][_0xc983('0x57')]=function(_0x2caec4,_0xd57236){var _0x19dd38={'role':_0xc983('0x56')};_0x19dd38[_0x2caec4]=this[_0xc983('0x10')]['callerid'];this[_0xc983('0x11')][_0xc983('0x57')](_0x19dd38)['then'](function(_0x5d3d97){_0xd57236(null,_[_0xc983('0x4a')](_0x5d3d97)?![]:!![]);})[_0xc983('0x17')](function(_0x1f49fc){logger[_0xc983('0x35')](_0x1f49fc);_0xd57236(null,![]);});};AGIVertices[_0xc983('0x13')][_0xc983('0x58')]=function(_0x4dc2b3,_0x131245){var _0x2400ce={'role':_0xc983('0x56')};_0x2400ce[_0x4dc2b3]=this['channel']['callerid'];this['rpc'][_0xc983('0x58')](_0x2400ce)[_0xc983('0x1a')](function(_0x5d7208){_0x131245(null,_[_0xc983('0x4a')](_0x5d7208)?![]:!![]);})[_0xc983('0x17')](function(_0x1ac232){logger['error'](_0x1ac232);_0x131245(null,![]);});};AGIVertices[_0xc983('0x13')][_0xc983('0x59')]=function(_0x232e9a,_0x10aaa9){var _0x33a594={'role':_0xc983('0x56')};_0x33a594[_0x232e9a]=this['channel'][_0xc983('0x3e')];var _0x3234ae=_0x232e9a!=_0xc983('0x5a')?util[_0xc983('0x2b')](_0xc983('0x5b'),_0xc983('0x5c'),this[_0xc983('0x10')]['callerid']):undefined;this[_0xc983('0x11')][_0xc983('0x59')](_0x33a594,_0x3234ae)[_0xc983('0x1a')](function(_0x24402d){_0x10aaa9(null,_[_0xc983('0x4a')](_0x24402d)?![]:!![]);})['catch'](function(_0x5b837d){logger['error'](_0x5b837d);_0x10aaa9(null,![]);});};AGIVertices['prototype'][_0xc983('0x5d')]=function(_0x488b6d,_0x2d07ca){sh[_0xc983('0x5e')](_[_0xc983('0x5f')](_0x488b6d),function(_0x4f4a83,_0x47b0df){var _0x474c50=_0x47b0df[_0xc983('0x60')](/(\r\n|\n|\r)/gm,'');_0x2d07ca(null,_0x474c50);});};AGIVertices[_0xc983('0x13')][_0xc983('0x61')]=function(_0x399bce,_0x90bd53){scripts['googleCloudTTS'](_0x399bce[_0xc983('0x62')],_0x399bce['google_cloud_tts_text_type']||'text',_0x399bce[_0xc983('0x63')],_0x399bce['languageCode']||'en-US',_0x399bce[_0xc983('0x64')]||'MALE',_0x399bce[_0xc983('0x65')]||'MP3')['then'](function(_0x5b209a){_0x90bd53(null,_0x5b209a);})['catch'](function(_0x4325ba){_0x90bd53(_0x4325ba);});};AGIVertices[_0xc983('0x13')][_0xc983('0x66')]=function(_0x296d41,_0x2ed289){scripts['googleTTS'](_0x296d41['text'],_0x296d41[_0xc983('0x67')]||'en',0x1)[_0xc983('0x1a')](function(_0x1d0fe6){_0x2ed289(null,_0x1d0fe6);})[_0xc983('0x17')](function(_0x5118a3){_0x2ed289(_0x5118a3);});};AGIVertices[_0xc983('0x13')][_0xc983('0x68')]=function(_0x114da6,_0x4c39a4){var _0x247c6a={'uri':_0x114da6[_0xc983('0x69')],'method':_0x114da6[_0xc983('0x6a')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x114da6[_0xc983('0x6b')])==='number'&&parseInt(_0x114da6[_0xc983('0x6b')])>=0x1?parseInt(_0x114da6[_0xc983('0x6b')])*0x3e8:0x5*0x3e8};if(_[_0xc983('0x6c')]([_0xc983('0x6d'),_0xc983('0x6e')],_0x247c6a[_0xc983('0x6a')][_0xc983('0x6f')]())){try{_0x247c6a[_0xc983('0x70')]=_0x114da6['rawBody']?JSON[_0xc983('0x71')](_0x114da6[_0xc983('0xd')]):{};}catch(_0x4f29db){logger[_0xc983('0x35')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x4f29db);}}try{_0x247c6a[_0xc983('0x72')]=_0x114da6['rawHeaders']?JSON[_0xc983('0x71')](_0x114da6[_0xc983('0xc')]):{};}catch(_0x37234e){logger[_0xc983('0x35')](_0xc983('0x73'),_0x37234e);}if(_0x114da6[_0xc983('0x74')]){try{var _0x379eb1=require(_0x114da6['computedVariables'])[_0xc983('0x75')](this,_0x247c6a);_0x247c6a[_0xc983('0x76')]=Mustache[_0xc983('0x77')](_0x114da6[_0xc983('0x69')],_0x379eb1,{},['$$','$$']);if(_0x247c6a['headers']){_0x247c6a[_0xc983('0x72')]=JSON[_0xc983('0x71')](Mustache[_0xc983('0x77')](JSON[_0xc983('0x78')](_0x247c6a[_0xc983('0x72')]),_0x379eb1,{},['$$','$$']));}if(_0x247c6a[_0xc983('0x70')]){_0x247c6a[_0xc983('0x70')]=JSON[_0xc983('0x71')](Mustache['render'](JSON[_0xc983('0x78')](_0x247c6a[_0xc983('0x70')]),_0x379eb1,{},['$$','$$']));}}catch(_0x333391){logger[_0xc983('0x35')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x333391);}}rp(_0x247c6a)[_0xc983('0x1a')](function(_0x3f7a25){var _0x3b1071={'statusCode':_0x3f7a25['statusCode']||0xc8,'statusMessage':_0x3f7a25[_0xc983('0x79')]||'OK','headers':_0x3f7a25['headers']||{},'body':_0x3f7a25[_0xc983('0x70')]||{}};_0x4c39a4(null,_0x3b1071);})[_0xc983('0x17')](function(_0x3f2ecc){var _0x46e5e1={'statusCode':_0x3f2ecc[_0xc983('0x7a')]||0x1f4,'statusMessage':_0x3f2ecc['message']||_0xc983('0x7b'),'headers':_0x3f2ecc[_0xc983('0x7c')][_0xc983('0x72')]||{},'body':_0x3f2ecc[_0xc983('0x7c')][_0xc983('0x70')]||{}};_0x4c39a4(null,_0x46e5e1);});};AGIVertices[_0xc983('0x13')][_0xc983('0x7d')]=function(_0x3a7da6,_0x3cd100){scripts[_0xc983('0x7d')](this[_0xc983('0x10')]['uniqueid'],_0x3a7da6['key'],_0x3a7da6[_0xc983('0x63')],_0x3a7da6[_0xc983('0x7e')]||'en')[_0xc983('0x1a')](function(_0x37302e){_0x3cd100(null,_0x37302e);})[_0xc983('0x17')](function(_0x3a9068){_0x3cd100(_0x3a9068);});};AGIVertices['prototype'][_0xc983('0x7f')]=function(_0x5c64f5,_0xe56532){scripts[_0xc983('0x7f')](this[_0xc983('0x10')][_0xc983('0x47')],_0x5c64f5[_0xc983('0x80')],_0x5c64f5['client_email'],_0x5c64f5[_0xc983('0x81')],_0x5c64f5[_0xc983('0x63')],_0x5c64f5[_0xc983('0x82')]||'en')['then'](function(_0x26eefc){_0xe56532(null,_0x26eefc);})[_0xc983('0x17')](function(_0x242fa6){_0xe56532(_0x242fa6);});};AGIVertices[_0xc983('0x13')]['sestekNDA']=function(_0x2870c9,_0x1cda92){scripts[_0xc983('0x83')](this[_0xc983('0x10')],_0x2870c9)[_0xc983('0x1a')](function(_0x1790ad){_0x1cda92(null,_0x1790ad);})[_0xc983('0x17')](function(_0x256712){_0x1cda92(_0x256712);});};AGIVertices[_0xc983('0x13')][_0xc983('0x84')]=function(_0x39849e,_0x4d9e04){scripts[_0xc983('0x84')](_0x39849e['key'],_0x39849e[_0xc983('0x63')],_0x39849e[_0xc983('0x85')]||_0xc983('0x86'),_0x39849e[_0xc983('0x87')])[_0xc983('0x1a')](function(_0x22a754){_0x4d9e04(null,_0x22a754);})[_0xc983('0x17')](function(_0xe0bef8){_0x4d9e04(_0xe0bef8);});};AGIVertices[_0xc983('0x13')][_0xc983('0x88')]=function(_0x5ec04b,_0x3805a5,_0x5e8b9a){scripts[_0xc983('0x88')](_0x3805a5,_0x5ec04b[_0xc983('0x89')],_0x5ec04b[_0xc983('0x8a')]||_0xc983('0x86'),this['isConfigured'](_0x5ec04b[_0xc983('0x8b')])?_0x5ec04b[_0xc983('0x8b')]:undefined)[_0xc983('0x1a')](function(_0x15f509){_0x5e8b9a(null,_0x15f509);})[_0xc983('0x17')](function(_0x579430){_0x5e8b9a(_0x579430);});};AGIVertices[_0xc983('0x13')][_0xc983('0x8c')]=function(_0x276652,_0x2897fc){scripts['awsPolly'](_0x276652[_0xc983('0x8d')],_0x276652[_0xc983('0x8e')],_0x276652[_0xc983('0x8f')],_0x276652[_0xc983('0x90')]||_0xc983('0x91'),_0x276652[_0xc983('0x63')],_0x276652[_0xc983('0x92')]||'text')[_0xc983('0x1a')](function(_0x324c01){_0x2897fc(null,_0x324c01);})[_0xc983('0x17')](function(_0x434f11){_0x2897fc(_0x434f11);});};AGIVertices[_0xc983('0x13')][_0xc983('0x93')]=function(_0x4d5728,_0x39e537){scripts[_0xc983('0x93')](this[_0xc983('0x10')][_0xc983('0x47')],_0x4d5728['aws_access_key_id'],_0x4d5728[_0xc983('0x8e')],_0x4d5728['aws_lex_region'],_0x4d5728[_0xc983('0x63')],_0x4d5728[_0xc983('0x94')])[_0xc983('0x1a')](function(_0x29b654){_0x39e537(null,_0x29b654);})[_0xc983('0x17')](function(_0xe62537){_0x39e537(_0xe62537);});};AGIVertices['prototype'][_0xc983('0x95')]=function(_0x625c2c,_0x377079,_0x5e86e2){scripts[_0xc983('0x95')](_0x377079,_0x625c2c[_0xc983('0x89')],_0x625c2c[_0xc983('0x96')]||_0xc983('0x86'))[_0xc983('0x1a')](function(_0x4e4cad){_0x5e86e2(null,_0x4e4cad);})['catch'](function(_0x1d18af){_0x5e86e2(_0x1d18af);});};AGIVertices[_0xc983('0x13')][_0xc983('0x97')]=function(_0x2e917e,_0x296ee2,_0x349e8f){scripts[_0xc983('0x97')](_0x296ee2,_0x2e917e[_0xc983('0x98')],_0x2e917e[_0xc983('0x99')],_0x2e917e['uri'])[_0xc983('0x1a')](function(_0x26b3d5){_0x349e8f(null,_0x26b3d5);})[_0xc983('0x17')](function(_0x53f255){_0x349e8f(_0x53f255);});};AGIVertices['prototype']['clear']=function(_0x55c17f){var _0x4efcde=_[_0xc983('0x6c')](verticesWithRetry,_0x55c17f[_0xc983('0x3c')])?_0x55c17f:_[_0xc983('0x9a')](_0x55c17f);for(var _0x42c84b in _0x4efcde){if(_0x4efcde[_0xc983('0x9b')](_0x42c84b)){if(_0x4efcde[_0x42c84b]&&_[_0xc983('0x9c')](_0x4efcde[_0x42c84b])){if(_['includes'](recursiveMapAttributes,_0x42c84b)){_0x4efcde[_0x42c84b]=this['replaceObjectAllVariables'](_0x4efcde[_0x42c84b]);}else{_0x4efcde[_0x42c84b]=this[_0xc983('0x9d')](_0x4efcde[_0x42c84b]);}}}}return _0x4efcde;};AGIVertices['prototype'][_0xc983('0x9e')]=function(_0x30c70f){for(var _0x4670b8 in _0x30c70f){if(_0x30c70f[_0xc983('0x9b')](_0x4670b8)){if(_[_0xc983('0x9f')](_0x30c70f[_0x4670b8])){this[_0xc983('0x9e')](_0x30c70f[_0x4670b8]);}else if(_[_0xc983('0xa0')](_0x30c70f[_0x4670b8])){for(var _0x407b28=0x0;_0x407b28<_0x30c70f[_0x4670b8]['length'];_0x407b28++){this['recursiveNodeIndex'](_0x30c70f[_0x4670b8][_0x407b28]);}}else if(_[_0xc983('0x9c')](_0x30c70f[_0x4670b8])){_0x30c70f[_0x4670b8]=this[_0xc983('0x9d')](_0x30c70f[_0x4670b8]);}}}};AGIVertices['prototype'][_0xc983('0xa1')]=function(_0x1c3437,_0x5b508b){for(var _0x250880 in _0x1c3437){if(_0x1c3437[_0xc983('0x9b')](_0x250880)){if(_[_0xc983('0x9f')](_0x1c3437[_0x250880])){if(!_[_0xc983('0x49')](_0x1c3437[_0x250880])){this[_0xc983('0xa1')](_0x1c3437[_0x250880],util[_0xc983('0x2b')]('%s.%s',_0x5b508b,_0x250880));}}else if(_['isArray'](_0x1c3437[_0x250880])){for(var _0x3e13fa=0x0;_0x3e13fa<_0x1c3437[_0x250880][_0xc983('0xa2')];_0x3e13fa++){this['saveRestApiResult'](_0x1c3437[_0x250880][_0x3e13fa],util[_0xc983('0x2b')](_0xc983('0xa3'),_0x5b508b,_0x250880+'['+_0x3e13fa+']'));}}else{if(!_[_0xc983('0x4a')](_0x1c3437[_0x250880])){this[_0xc983('0x10')]['setVariable'](util['format'](_0xc983('0xa3'),_0x5b508b,_0x250880),_0x1c3437[_0x250880]);}}}}};AGIVertices[_0xc983('0x13')][_0xc983('0xa4')]=function(_0x5c6407){try{var _0x534a14=JSON['parse'](_0x5c6407);this[_0xc983('0x9e')](_0x534a14);return JSON['stringify'](_0x534a14);}catch(_0x418951){return this[_0xc983('0x9d')](_0x5c6407);}};AGIVertices[_0xc983('0x13')][_0xc983('0x9d')]=function(_0x33c95c){var _0x46bd5d=_0x33c95c[_0xc983('0xa5')]('{');for(var _0x28b9f0=0x1;_0x28b9f0<_0x46bd5d[_0xc983('0xa2')];_0x28b9f0+=0x1){var _0x33ee9c=_0x46bd5d[_0x28b9f0][_0xc983('0xa5')]('}');if(_0x33ee9c[_0xc983('0xa2')]>0x1){_0x33c95c=_0x33c95c[_0xc983('0xa6')]('{'+_0x33ee9c[0x0]+'}',this[_0xc983('0x10')][_0xc983('0x14')](_0x33ee9c[0x0])[_0xc983('0xa7')]||_0x33ee9c[0x0]);}}if(_0x46bd5d['length']===0x1){return _0x33c95c[_0xc983('0x53')]();}return this[_0xc983('0x9d')](_0x33c95c);};AGIVertices[_0xc983('0x13')][_0xc983('0xa8')]=function(_0x76f755,_0x55c782){var _0x306fb2=this['channel']['getVariable'](_0x76f755);if(_0x306fb2[_0xc983('0xa9')]===-0x1){return _0x306fb2;}logger[_0xc983('0x2f')](util[_0xc983('0x2b')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x55c782,_0x306fb2['extra']));return this[_0xc983('0x10')][_0xc983('0xaa')](_0x55c782,_0x306fb2['extra']);};AGIVertices['prototype'][_0xc983('0xab')]=function(_0x231370){return _0x231370&&_0x231370!=='0'&&_0x231370!=='-1'&&_0x231370!=='';};AGIVertices[_0xc983('0x13')][_0xc983('0xac')]=function(_0x1d3bf2){this[_0xc983('0x3a')]['sync'](this,_0x1d3bf2,'-');_0x1d3bf2['retry']=_0x1d3bf2[_0xc983('0xac')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xc983('0x13')]['mrcpsynth']=function(_0x271141){logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0xad'),_0x271141[_0xc983('0x3b')]));if(!this[_0xc983('0xab')](_0x271141[_0xc983('0x63')])){return this['channel'][_0xc983('0xae')](_0xc983('0xaf'));}var _0x308ea3='\x22'+_0x271141[_0xc983('0x63')]+'\x22';if(this['isConfigured'](_0x271141[_0xc983('0x7c')])){_0x308ea3+=','+_0x271141[_0xc983('0x7c')];}var _0x51e228=this['channel'][_0xc983('0x5e')](_0xc983('0xb0'),_0x308ea3);if(_0x51e228['result']===-0x1){return _0x51e228;}return this[_0xc983('0x10')][_0xc983('0xae')](util[_0xc983('0x2b')](_0xc983('0xb1'),_0x308ea3));};AGIVertices[_0xc983('0x13')]['mrcprecog']=function(_0x2b6117){logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0xb2'),_0x2b6117[_0xc983('0x3b')]));if(!this[_0xc983('0xab')](_0x2b6117['grammar'])){return this['channel'][_0xc983('0xae')]('no\x20grammar\x20configured');}var _0x4ba207=_0x2b6117[_0xc983('0xb3')];if(this[_0xc983('0xab')](_0x2b6117[_0xc983('0x7c')])){_0x4ba207+=','+_0x2b6117[_0xc983('0x7c')];}var _0x3a114b=this['channel'][_0xc983('0x5e')](_0xc983('0xb4'),_0x4ba207);if(_0x3a114b[_0xc983('0xa9')]===-0x1){return _0x3a114b;}var _0x47a4e5=this[_0xc983('0xa8')]('RECOG_CONFIDENCE()',_0xc983('0xb5'));if(_0x47a4e5['result']===-0x1){return _0x47a4e5;}var _0x531dab=this[_0xc983('0xa8')](_0xc983('0xb6'),'MRCP_RECOG_TRANSCRIPT');if(_0x531dab['result']===-0x1){return _0x531dab;}var _0x2144ec=this[_0xc983('0xa8')]('RECOG_INSTANCE()',_0xc983('0xb7'));if(_0x2144ec[_0xc983('0xa9')]===-0x1){return _0x2144ec;}return this[_0xc983('0x10')][_0xc983('0xae')](util[_0xc983('0x2b')]('Executed\x20command\x20MRCPRecog\x20%s',_0x4ba207));};AGIVertices[_0xc983('0x13')]['agi']=function(_0x4d4d70){logger[_0xc983('0x2f')](util['format'](_0xc983('0xb8'),_0x4d4d70[_0xc983('0x3b')]));return this['channel'][_0xc983('0x8')]([_0x4d4d70[_0xc983('0xb9')],_0x4d4d70[_0xc983('0xba')]]);};AGIVertices[_0xc983('0x13')][_0xc983('0xbb')]=function(_0x5d772c){logger['info'](util[_0xc983('0x2b')](_0xc983('0xbc'),_0x5d772c['label']));if(this[_0xc983('0xab')](_0x5d772c[_0xc983('0x6b')])){logger[_0xc983('0x2f')](util[_0xc983('0x2b')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x5d772c[_0xc983('0x6b')]));var _0x5302c5=this[_0xc983('0x10')][_0xc983('0xbd')](_0x5d772c['timeout']);if(_0x5302c5[_0xc983('0xa9')]===-0x1){return _0x5302c5;}}return this[_0xc983('0x10')][_0xc983('0xbb')]();};AGIVertices[_0xc983('0x13')][_0xc983('0x51')]=function(_0x9d494a){logger[_0xc983('0x2f')](util['format'](_0xc983('0xbe'),_0x9d494a[_0xc983('0x3b')]));if(!this['isConfigured'](_0x9d494a['list_id'])){return this[_0xc983('0x10')][_0xc983('0x35')](_0x9d494a,_0xc983('0xbf'));}_0x9d494a[_0xc983('0x50')]=moment();if(this['isConfigured'](_0x9d494a[_0xc983('0xc0')])){_0x9d494a['scheduledAt']=moment()['add'](_0x9d494a[_0xc983('0xc0')],'minutes');}if(!this[_0xc983('0xab')](_0x9d494a['callback_priority'])){_0x9d494a['callback_priority']=0x2;}this[_0xc983('0x48')][_0xc983('0x75')](this,_0x9d494a);return this[_0xc983('0x10')][_0xc983('0xae')](util[_0xc983('0x2b')](_0xc983('0xc1'),_0x9d494a[_0xc983('0x4e')],_0x9d494a['list_id'],_0x9d494a[_0xc983('0x50')]));};AGIVertices[_0xc983('0x13')][_0xc983('0xc2')]=function(_0x1a5e11){logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0xc3'),_0x1a5e11['label']));var _0x3c6f9a=this[_0xc983('0x10')][_0xc983('0x5e')](_0x1a5e11[_0xc983('0xc4')],_0x1a5e11['options']);if(_0x3c6f9a[_0xc983('0xa9')]===-0x1){return _0x3c6f9a;}return this[_0xc983('0x10')][_0xc983('0xae')](util[_0xc983('0x2b')]('Executed\x20command\x20%s\x20%s',_0x1a5e11[_0xc983('0xc4')],_0x1a5e11[_0xc983('0x7c')]));};AGIVertices['prototype'][_0xc983('0xc5')]=function(_0x2b844c){logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0xc6'),_0x2b844c['label']));if(!this[_0xc983('0xab')](_0x2b844c['text'])){return this['channel'][_0xc983('0xae')](_0xc983('0xaf'));}var _0x4b86ae='\x22'+_0x2b844c[_0xc983('0x63')]+'\x22';if(this[_0xc983('0xab')](_0x2b844c[_0xc983('0x7c')])){_0x4b86ae+=','+_0x2b844c['options'];}var _0x34978b=this['channel']['exec']('MRCPSynth',_0x4b86ae);if(_0x34978b[_0xc983('0xa9')]===-0x1){return _0x34978b;}return this[_0xc983('0x10')][_0xc983('0xae')](util[_0xc983('0x2b')](_0xc983('0xb1'),_0x4b86ae));};AGIVertices[_0xc983('0x13')]['sestektts']=function(_0x501c55){logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0xc7'),_0x501c55[_0xc983('0x3b')]));if(!this[_0xc983('0xab')](_0x501c55['text'])){return this['channel'][_0xc983('0xae')](_0xc983('0xaf'));}var _0x252b19='\x22'+_0x501c55[_0xc983('0x63')]+'\x22';if(this[_0xc983('0xab')](_0x501c55['options'])){_0x252b19+=','+_0x501c55['options'];}var _0x587068=this[_0xc983('0x10')][_0xc983('0x5e')](_0xc983('0xb0'),_0x252b19);if(_0x587068[_0xc983('0xa9')]===-0x1){return _0x587068;}return this[_0xc983('0x10')][_0xc983('0xae')](util[_0xc983('0x2b')](_0xc983('0xb1'),_0x252b19));};AGIVertices[_0xc983('0x13')][_0xc983('0xc8')]=function(_0xd1b82f){logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0xc9'),_0xd1b82f[_0xc983('0x3b')]));if(!this[_0xc983('0xab')](_0xd1b82f[_0xc983('0xb3')])){return this[_0xc983('0x10')][_0xc983('0xae')](_0xc983('0xca'));}var _0xa477aa=_0xd1b82f['grammar'];if(this['isConfigured'](_0xd1b82f[_0xc983('0x7c')])){_0xa477aa+=','+_0xd1b82f['options'];}var _0x2f730e=this[_0xc983('0x10')][_0xc983('0x5e')](_0xc983('0xb4'),_0xa477aa);if(_0x2f730e['result']===-0x1){return _0x2f730e;}var _0x3e3f0a=this[_0xc983('0xa8')](_0xc983('0xcb'),_0xc983('0xcc'));if(_0x3e3f0a['result']===-0x1){return _0x3e3f0a;}var _0xc4c593=this['getAndSetVariable'](_0xc983('0xb6'),_0xc983('0xcd'));if(_0xc4c593[_0xc983('0xa9')]===-0x1){return _0xc4c593;}var _0x3e2ebd=this[_0xc983('0xa8')](_0xc983('0xce'),'LUMENVOX_ASR_INSTANCE');if(_0x3e2ebd[_0xc983('0xa9')]===-0x1){return _0x3e2ebd;}return this[_0xc983('0x10')][_0xc983('0xae')](util[_0xc983('0x2b')]('Executed\x20command\x20MRCPRecog\x20%s',_0xa477aa));};AGIVertices[_0xc983('0x13')]['sestekasr']=function(_0x238392){logger[_0xc983('0x2f')](util['format'](_0xc983('0xcf'),_0x238392[_0xc983('0x3b')]));if(!this['isConfigured'](_0x238392[_0xc983('0xb3')])){return this['channel'][_0xc983('0xae')]('no\x20grammar\x20configured');}var _0x1b6edb=_0x238392[_0xc983('0xb3')];if(this[_0xc983('0xab')](_0x238392[_0xc983('0x7c')])){_0x1b6edb+=','+_0x238392['options'];}var _0x5ee3c1=this['channel']['exec']('MRCPRecog',_0x1b6edb);if(_0x5ee3c1['result']===-0x1){return _0x5ee3c1;}var _0x379161=this[_0xc983('0xa8')](_0xc983('0xcb'),_0xc983('0xd0'));if(_0x379161[_0xc983('0xa9')]===-0x1){return _0x379161;}var _0x4ea88d=this[_0xc983('0xa8')](_0xc983('0xb6'),_0xc983('0xd1'));if(_0x4ea88d[_0xc983('0xa9')]===-0x1){return _0x4ea88d;}var _0x30340e=this[_0xc983('0xa8')]('RECOG_INSTANCE()',_0xc983('0xd2'));if(_0x30340e[_0xc983('0xa9')]===-0x1){return _0x30340e;}return this[_0xc983('0x10')][_0xc983('0xae')](util[_0xc983('0x2b')]('Executed\x20command\x20MRCPRecog\x20%s',_0x1b6edb));};AGIVertices['prototype'][_0xc983('0xd3')]=function(_0x1dd6f1){logger[_0xc983('0x2f')](util['format'](_0xc983('0xd4'),_0x1dd6f1[_0xc983('0x3b')]));if(!this[_0xc983('0xab')](_0x1dd6f1[_0xc983('0xd5')])){return this[_0xc983('0x10')]['error'](_0x1dd6f1,_0xc983('0xd6'));}var _0x477358=this['getSquareOdbc'][_0xc983('0x75')](this,_0x1dd6f1[_0xc983('0xd5')]);if(!_0x477358){return this[_0xc983('0x10')][_0xc983('0x35')](_0x1dd6f1,_0xc983('0xd7'));}if(!this[_0xc983('0xab')](_0x1dd6f1[_0xc983('0x31')])){return this[_0xc983('0x10')][_0xc983('0x35')](_0x1dd6f1,_0xc983('0xd8'));}var _0x26b13b=_0x1dd6f1['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0xc983('0x10')][_0xc983('0xae')](util[_0xc983('0x2b')](_0xc983('0xd9'),_0x26b13b));var _0x426828=this[_0xc983('0xda')][_0xc983('0x75')](this,_0x477358,_0x26b13b);this['createSquareDetailsReport'][_0xc983('0x75')](this,_0x1dd6f1,_0x26b13b);if(!this[_0xc983('0xab')](_0x1dd6f1[_0xc983('0xdb')])){return this['channel']['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x867ddb=this[_0xc983('0x14')][_0xc983('0x75')](this,_0x1dd6f1[_0xc983('0xdb')]);if(!_0x867ddb){return this[_0xc983('0x10')][_0xc983('0x35')](_0x1dd6f1,_0xc983('0xdc'));}var _0x505284=this;_0x426828['forEach'](function(_0x4fff59,_0x5d6e17){Object[_0xc983('0xdd')](_0x4fff59)[_0xc983('0xde')](function(_0x11ce04){_0x505284[_0xc983('0x10')][_0xc983('0xaa')](util[_0xc983('0x2b')]('%s[%s][%s]',_0x867ddb,_0x5d6e17,_0x11ce04),_0x4fff59[_0x11ce04]);});});this[_0xc983('0x10')][_0xc983('0xaa')](util[_0xc983('0x2b')](_0xc983('0xdf'),_0x867ddb),_0x426828[_0xc983('0xa2')]);return this[_0xc983('0x10')][_0xc983('0xae')](util['format'](_0xc983('0xe0'),_0x867ddb));};AGIVertices['prototype']['dial']=function(_0x576b18){logger[_0xc983('0xe1')](util['format'](_0xc983('0xe2'),_0x576b18[_0xc983('0x3b')]));if(!this[_0xc983('0xab')](_0x576b18[_0xc983('0xe3')])){return this[_0xc983('0x10')][_0xc983('0x35')](_0x576b18,_0xc983('0xe4'));}var _0x1a54de=this[_0xc983('0x1f')][_0xc983('0x75')](this,_0x576b18[_0xc983('0xe3')]);if(!_0x1a54de){return this[_0xc983('0x10')]['error'](_0x576b18,_0xc983('0xe5'));}var _0x461b2b=this[_0xc983('0x10')][_0xc983('0x5e')]('DIAL',[util[_0xc983('0x2b')](_0xc983('0xe6'),_0x1a54de),_0x576b18['timeout'],_0x576b18[_0xc983('0xe7')],_0x576b18[_0xc983('0x69')]]);if(_0x461b2b[_0xc983('0xa9')]===-0x1){return _0x461b2b;}return this[_0xc983('0x10')][_0xc983('0xae')](util[_0xc983('0x2b')](_0xc983('0xe8'),_0xc983('0xe9')));};AGIVertices[_0xc983('0x13')][_0xc983('0xea')]=function(_0x5a4b1f){logger['info'](util['format'](_0xc983('0xeb'),_0x5a4b1f[_0xc983('0x3b')]));if(!this['isConfigured'](_0x5a4b1f[_0xc983('0x89')])){return this[_0xc983('0x10')][_0xc983('0xae')](_0xc983('0xec'));}if(!this[_0xc983('0xab')](_0x5a4b1f[_0xc983('0x63')])){return this[_0xc983('0x10')][_0xc983('0xae')](_0xc983('0xaf'));}this['channel'][_0xc983('0xed')]=!![];this[_0xc983('0x3a')](_0x5a4b1f);this[_0xc983('0x46')](_0x5a4b1f[_0xc983('0x63')],'in','','');this[_0xc983('0x10')]['noop'](util[_0xc983('0x2b')](_0xc983('0xee'),_0x5a4b1f[_0xc983('0x63')]));var _0x17a8ca=this['googleDialogflow']['sync'](this,_0x5a4b1f);if(_0x17a8ca){for(var _0x5b6c58 in _0x17a8ca){if(_0x17a8ca['hasOwnProperty'](_0x5b6c58)){this[_0xc983('0x10')][_0xc983('0xaa')](util[_0xc983('0x2b')](_0xc983('0xef'),_0x5b6c58['toUpperCase']()),_0x17a8ca[_0x5b6c58]);}}this['createSquareMessage'](_0x17a8ca[_0xc983('0xf0')],_0xc983('0xf1'),_0xc983('0xea'),'');return this['channel'][_0xc983('0xae')](util[_0xc983('0x2b')](_0xc983('0xf2'),_0x17a8ca['speech']));}return this['channel']['error'](_0x5a4b1f,_0xc983('0xf3'));};AGIVertices[_0xc983('0x13')]['dialogflowV2']=function(_0x59f969){logger[_0xc983('0x2f')](util[_0xc983('0x2b')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x59f969['label']));if(!this[_0xc983('0xab')](_0x59f969[_0xc983('0x80')])){return this[_0xc983('0x10')]['noop'](_0xc983('0xf4'));}if(!this[_0xc983('0xab')](_0x59f969[_0xc983('0xf5')])){return this[_0xc983('0x10')][_0xc983('0xae')]('no\x20client_email\x20configured');}if(!this[_0xc983('0xab')](_0x59f969[_0xc983('0x81')])){return this[_0xc983('0x10')][_0xc983('0xae')]('no\x20private_key\x20configured');}if(!this['isConfigured'](_0x59f969[_0xc983('0x82')])){return this[_0xc983('0x10')][_0xc983('0xae')](_0xc983('0xf6'));}if(!this[_0xc983('0xab')](_0x59f969[_0xc983('0x63')])){return this[_0xc983('0x10')]['noop']('no\x20text\x20configured');}this[_0xc983('0x10')]['bot']=!![];this[_0xc983('0x3a')](_0x59f969);this[_0xc983('0x46')](_0x59f969[_0xc983('0x63')],'in','','');this[_0xc983('0x10')][_0xc983('0xae')](util['format'](_0xc983('0xf7'),_0x59f969[_0xc983('0x63')]));var _0x181633=this[_0xc983('0x7f')]['sync'](this,_0x59f969);if(_0x181633){for(var _0x2e09f6 in _0x181633){if(_0x181633[_0xc983('0x9b')](_0x2e09f6)){if(_0x2e09f6!==_0xc983('0xf8')){this[_0xc983('0x10')]['setVariable'](util['format'](_0xc983('0xef'),_0x2e09f6[_0xc983('0x6f')]()),_0x181633[_0x2e09f6]);}}}this[_0xc983('0x46')](_0x181633['speech'],_0xc983('0xf1'),_0xc983('0xf9'),_0x181633[_0xc983('0xf8')]);return this[_0xc983('0x10')]['noop'](util[_0xc983('0x2b')](_0xc983('0xfa'),_0x181633[_0xc983('0xf0')]));}return this[_0xc983('0x10')][_0xc983('0x35')](_0x59f969,_0xc983('0xfb'));};AGIVertices[_0xc983('0x13')][_0xc983('0xfc')]=function(_0x16d626){logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0xfd'),_0x16d626[_0xc983('0x3b')]));if(!this[_0xc983('0xab')](_0x16d626['ndauth_url'])){return this[_0xc983('0x10')][_0xc983('0xae')](_0xc983('0xfe'));}if(!this['isConfigured'](_0x16d626['username'])){return this[_0xc983('0x10')][_0xc983('0xae')](_0xc983('0xff'));}if(!this['isConfigured'](_0x16d626[_0xc983('0x100')])){return this['channel']['noop'](_0xc983('0x101'));}if(!this[_0xc983('0xab')](_0x16d626[_0xc983('0x102')])){return this[_0xc983('0x10')]['noop'](_0xc983('0xaf'));}this[_0xc983('0x10')][_0xc983('0xed')]=!![];this[_0xc983('0x3a')](_0x16d626);this[_0xc983('0x46')](_0x16d626[_0xc983('0x63')],'in','','');this['channel'][_0xc983('0xae')](util['format'](_0xc983('0x103'),_0x16d626[_0xc983('0x63')]));var _0x50280e=this[_0xc983('0x83')]['sync'](this,_0x16d626);if(_0x50280e){for(var _0x285982 in _0x50280e){if(_0x50280e[_0xc983('0x9b')](_0x285982)){this['channel'][_0xc983('0xaa')](util[_0xc983('0x2b')]('SESTEK_NDA_%s',_0x285982[_0xc983('0x6f')]()),_0x50280e[_0x285982]);}}this[_0xc983('0x46')](_0x50280e['speech'],'out','sesteknda','');if(_0x50280e[_0xc983('0x104')]){this[_0xc983('0x10')]['noop'](util['format'](_0xc983('0x105'),_0x50280e[_0xc983('0x104')]));var _0x4b94eb=this[_0xc983('0x10')][_0xc983('0x106')](_0x50280e[_0xc983('0x104')]);try{fs[_0xc983('0x107')](_0x50280e['audiofile']+_0xc983('0x108'));}catch(_0xaeeb24){logger['error'](_0xaeeb24);}return _0x4b94eb;}else{return this['channel'][_0xc983('0xae')](util['format']('SestekNDA\x20Result\x20%s',_0x50280e[_0xc983('0xf0')]));}}return this[_0xc983('0x10')][_0xc983('0x35')](_0x16d626,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xc983('0x13')][_0xc983('0x109')]=function(_0x5e1981){logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0x10a'),_0x5e1981[_0xc983('0x3b')]));return this[_0xc983('0x10')][_0xc983('0xae')](_0xc983('0x109'));};AGIVertices['prototype']['ext_dial']=function(_0x380eed){logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0x10b'),_0x380eed[_0xc983('0x3b')]));var _0x6fafce='';if(_0x380eed[_0xc983('0x10c')]){if(!this['isConfigured'](_0x380eed[_0xc983('0x10c')])){return this[_0xc983('0x10')][_0xc983('0x35')](_0x380eed,_0xc983('0x10d'));}else{var _0x38b8f0=parseInt(_0x380eed[_0xc983('0x10c')],0xa);if(isNaN(_0x38b8f0)){_0x6fafce=_0x380eed[_0xc983('0x10c')];}else{_0x6fafce=this[_0xc983('0x21')][_0xc983('0x75')](this,_0x380eed[_0xc983('0x10c')]);if(!_0x6fafce){return this[_0xc983('0x10')][_0xc983('0x35')](_0x380eed,'no\x20trunk\x20found');}}}}else if(_0x380eed[_0xc983('0x10e')]){_0x6fafce=_0x380eed[_0xc983('0x10e')];}else{return this[_0xc983('0x10')]['error'](_0x380eed,_0xc983('0x10d'));}var _0x526b33=this[_0xc983('0x10')][_0xc983('0x5e')](_0xc983('0xe9'),[util['format'](_0xc983('0x10f'),_0x6fafce,_0x380eed['phone']),_0x380eed[_0xc983('0x6b')],_0x380eed[_0xc983('0xe7')],_0x380eed[_0xc983('0x69')]]);if(_0x526b33['result']===-0x1){return _0x526b33;}return this['channel'][_0xc983('0xae')](util['format'](_0xc983('0xe8'),'DIAL'));};AGIVertices[_0xc983('0x13')][_0xc983('0x110')]=function(_0x5097b7){logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0x111'),_0x5097b7[_0xc983('0x3b')]));return this[_0xc983('0x10')][_0xc983('0xae')](_0xc983('0x110'));};AGIVertices['prototype'][_0xc983('0xf')]=function(_0x406901){logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0x112'),_0x406901['label']));if(_0x406901[_0xc983('0x113')]===0x0){return this[_0xc983('0xac')](_0x406901);}_0x406901[_0xc983('0x113')]-=0x1;if(!this[_0xc983('0xab')](_0x406901[_0xc983('0x114')])){return this[_0xc983('0x10')][_0xc983('0x35')](_0x406901,_0xc983('0x115'));}var _0x4a365b=this['getSound'][_0xc983('0x75')](this,_0x406901['file_id']);if(!_0x4a365b){return this[_0xc983('0x10')][_0xc983('0x35')](_0x406901,_0xc983('0x116'));}if(!this[_0xc983('0xab')](_0x406901[_0xc983('0xdb')])){return this['channel'][_0xc983('0x35')](_0xc983('0x117'));}var _0x5719fc=this[_0xc983('0x10')][_0xc983('0x118')](_0x4a365b,_0x406901[_0xc983('0x119')],_0x406901[_0xc983('0x11a')]);var _0x29ec0a=_0x5719fc[_0xc983('0xa9')]?_0x5719fc[_0xc983('0xa9')][_0xc983('0x53')]():'';logger[_0xc983('0x2f')](_0xc983('0x11b'),JSON[_0xc983('0x78')](_0x5719fc));if(_0x5719fc[_0xc983('0xa9')]===-0x1){this[_0xc983('0x3a')]['sync'](this,_0x406901,_0x29ec0a);return _0x5719fc;}else if(_0x5719fc['extra']==='timeout'){_0x5719fc['result']=_0x29ec0a[_0xc983('0xa2')]>=parseInt(_0x406901[_0xc983('0x11c')])?'x':'i';}else{_0x5719fc[_0xc983('0xa9')]=_0x29ec0a['length']>=parseInt(_0x406901[_0xc983('0x11c')])&&_0x29ec0a[_0xc983('0xa2')]<=parseInt(_0x406901[_0xc983('0x11a')])?'x':'i';}var _0x3227f3=this['getVariable'][_0xc983('0x75')](this,_0x406901[_0xc983('0xdb')]);if(!_0x3227f3){return this[_0xc983('0x10')][_0xc983('0x35')](_0x406901,'no\x20variable\x20found');}this[_0xc983('0x10')]['setVariable'](_0x3227f3,_0x29ec0a);if(this['isConfigured'](_0x406901[_0xc983('0x11d')])){var _0x55fb86=parseInt(_0x406901['hiddendigitsnum'],0xa);var _0x2aaa1a=rs[_0xc983('0x11e')]({'charset':'*','length':_0x55fb86});var _0x5552c9=_0x29ec0a[_0xc983('0xa2')];if(_0x5552c9>0x0){if(_0x5552c9>_0x55fb86){this[_0xc983('0x3a')][_0xc983('0x75')](this,_0x406901,_0x406901[_0xc983('0x11f')]===_0xc983('0x120')?_0x2aaa1a+_0x29ec0a[_0xc983('0x121')](_0x55fb86):_0x29ec0a[_0xc983('0x121')](0x0,_0x5552c9-_0x55fb86)+_0x2aaa1a);}else{this[_0xc983('0x3a')][_0xc983('0x75')](this,_0x406901,rs[_0xc983('0x11e')]({'charset':'*','length':_0x5552c9}));}}else{this[_0xc983('0x3a')]['sync'](this,_0x406901,'');}}else{this[_0xc983('0x3a')][_0xc983('0x75')](this,_0x406901,_0x29ec0a);}return _0x5719fc;};AGIVertices[_0xc983('0x13')]['getsecretdigits']=function(_0x1290e2){logger['info'](util['format'](_0xc983('0x122'),_0x1290e2[_0xc983('0x3b')]));return this['getdigits'](_0x1290e2);};AGIVertices[_0xc983('0x13')]['goal']=function(_0xc36d05){logger[_0xc983('0x2f')](util[_0xc983('0x2b')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0xc36d05[_0xc983('0x3b')]));this[_0xc983('0x3a')]['sync'](this,_0xc36d05,_0xc36d05[_0xc983('0x123')]);return this['channel'][_0xc983('0xae')](util[_0xc983('0x2b')](_0xc983('0x124'),_0xc36d05[_0xc983('0x123')]));};AGIVertices[_0xc983('0x13')][_0xc983('0x125')]=function(_0x379c5c){logger[_0xc983('0x2f')](util['format']('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x379c5c[_0xc983('0x3b')]));if(!this['isConfigured'](_0x379c5c['aws_access_key_id'])||!this['isConfigured'](_0x379c5c[_0xc983('0x8e')])){return this[_0xc983('0x10')][_0xc983('0xae')](_0xc983('0x126'));}if(!this['isConfigured'](_0x379c5c['text'])){return this['channel'][_0xc983('0xae')](_0xc983('0xaf'));}this['channel'][_0xc983('0xae')](util[_0xc983('0x2b')](_0xc983('0x127'),_0x379c5c[_0xc983('0x63')]));var _0x348d2a=this[_0xc983('0x8c')]['sync'](this,_0x379c5c);if(_0x348d2a){this[_0xc983('0x10')][_0xc983('0xae')](util[_0xc983('0x2b')]('aws\x20Polly\x20%s\x20file\x20created',_0x348d2a));var _0xc0c0fe=this[_0xc983('0x10')][_0xc983('0x106')](_0x348d2a);try{fs[_0xc983('0x107')](_0x348d2a+_0xc983('0x108'));}catch(_0x28e911){logger[_0xc983('0x35')](_0x28e911);}return _0xc0c0fe;}return this[_0xc983('0x10')][_0xc983('0x35')](_0x379c5c,_0xc983('0x128'));};AGIVertices[_0xc983('0x13')]['awslex']=function(_0x2c3b9c){logger[_0xc983('0x2f')](util[_0xc983('0x2b')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x2c3b9c[_0xc983('0x3b')]));if(!this['isConfigured'](_0x2c3b9c[_0xc983('0x8d')])||!this[_0xc983('0xab')](_0x2c3b9c[_0xc983('0x8e')])){return this[_0xc983('0x10')][_0xc983('0xae')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xc983('0xab')](_0x2c3b9c['aws_bot_name'])){return this[_0xc983('0x10')][_0xc983('0xae')](_0xc983('0x129'));}if(!this[_0xc983('0xab')](_0x2c3b9c['text'])){return this[_0xc983('0x10')][_0xc983('0xae')](_0xc983('0xaf'));}this[_0xc983('0x10')][_0xc983('0xed')]=!![];this['createSquareDetailsReport'](_0x2c3b9c);this[_0xc983('0x46')](_0x2c3b9c['text'],'in','','');this[_0xc983('0x10')][_0xc983('0xae')](util[_0xc983('0x2b')](_0xc983('0x12a'),_0x2c3b9c[_0xc983('0x63')]));var _0x2e7456=this[_0xc983('0x93')][_0xc983('0x75')](this,_0x2c3b9c);if(_0x2e7456){for(var _0x46058b in _0x2e7456){if(_0x2e7456[_0xc983('0x9b')](_0x46058b)&&_[_0xc983('0x9c')](_0x2e7456[_0x46058b])){this['channel'][_0xc983('0xaa')](util['format'](_0xc983('0x12b'),_0x46058b[_0xc983('0x6f')]()),_0x2e7456[_0x46058b]);}}if(_['isNil'](_0x2e7456[_0xc983('0x12c')])){return this['channel']['noop'](_0xc983('0x12d'));}else{this[_0xc983('0x46')](_0x2e7456[_0xc983('0x12c')],_0xc983('0xf1'),_0xc983('0x12e'),'');return this[_0xc983('0x10')][_0xc983('0xae')](util[_0xc983('0x2b')](_0xc983('0x12f'),_0x2e7456[_0xc983('0x12c')]));}}return this['channel'][_0xc983('0x35')](_0x2c3b9c,_0xc983('0x130'));};AGIVertices[_0xc983('0x13')][_0xc983('0x131')]=function(_0x336920){logger[_0xc983('0x2f')](util['format'](_0xc983('0x132'),_0x336920['label'],_0x336920[_0xc983('0x6b')]));if(!this['isConfigured'](_0x336920['key'])){return this['channel'][_0xc983('0xae')]('no\x20key\x20configured');}var _0x4f35d9='wav';var _0x1979c2=util['format'](_0xc983('0x133'),FILES_PATH,rs[_0xc983('0x11e')](0x4));var _0xe90ef1=util[_0xc983('0x2b')](_0xc983('0xa3'),_0x1979c2,_0x4f35d9);var _0x4ae3ca=!![];if(_0x336920['beep']==='NOBEEP'){_0x4ae3ca=![];}var _0x34e06e=this[_0xc983('0x10')][_0xc983('0x134')](_0x1979c2,_0x4f35d9,_0x336920['intKey'],_0x336920[_0xc983('0x6b')],undefined,_0x4ae3ca);if(_0x34e06e[_0xc983('0xa9')]!==-0x1){this[_0xc983('0x10')][_0xc983('0xae')](util['format'](_0xc983('0x135'),_0xe90ef1));var _0xe0fe4f=this[_0xc983('0x95')][_0xc983('0x75')](this,_0x336920,_0xe90ef1);if(_0xe0fe4f){for(var _0x3c810d in _0xe0fe4f){if(_0xe0fe4f[_0xc983('0x9b')](_0x3c810d)){this[_0xc983('0x10')][_0xc983('0xaa')](util['format'](_0xc983('0x136'),_0x3c810d[_0xc983('0x6f')]()),_0xe0fe4f[_0x3c810d]);}}return this[_0xc983('0x10')][_0xc983('0xae')](util[_0xc983('0x2b')](_0xc983('0x137'),JSON[_0xc983('0x78')](_0xe0fe4f)));}}return _0x34e06e;};AGIVertices['prototype']['tildeasr']=function(_0x3c39d9){logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0x138'),_0x3c39d9[_0xc983('0x3b')]));if(!this['isConfigured'](_0x3c39d9['appid'])){return this[_0xc983('0x10')][_0xc983('0xae')]('no\x20appid\x20configured');}if(!this['isConfigured'](_0x3c39d9['appsecret'])){return this[_0xc983('0x10')][_0xc983('0xae')](_0xc983('0x139'));}var _0x20310a=_0xc983('0x13a');var _0x5c88db=util['format'](_0xc983('0x133'),FILES_PATH,rs[_0xc983('0x11e')](0x4));var _0x48ffbb=util[_0xc983('0x2b')](_0xc983('0xa3'),_0x5c88db,_0x20310a);var _0x671dac=!![];if(_0x3c39d9[_0xc983('0x13b')]===_0xc983('0x13c')){_0x671dac=![];}var _0x3400e2=this[_0xc983('0x10')][_0xc983('0x134')](_0x5c88db,_0x20310a,_0x3c39d9[_0xc983('0x13d')],_0x3c39d9['timeout'],undefined,_0x671dac);if(_0x3400e2[_0xc983('0xa9')]!==-0x1){this['channel'][_0xc983('0xae')](util[_0xc983('0x2b')](_0xc983('0x13e'),_0x48ffbb));var _0x10ca47=this['tildeASR'][_0xc983('0x75')](this,_0x3c39d9,_0x48ffbb);if(_0x10ca47){for(var _0x5cbadc in _0x10ca47){if(_0x10ca47[_0xc983('0x9b')](_0x5cbadc)){this[_0xc983('0x10')][_0xc983('0xaa')](util['format'](_0xc983('0x13f'),_0x5cbadc[_0xc983('0x6f')]()),_0x10ca47[_0x5cbadc]);}}return this[_0xc983('0x10')][_0xc983('0xae')](util[_0xc983('0x2b')](_0xc983('0x140'),JSON[_0xc983('0x78')](_0x10ca47)));}}return _0x3400e2;};AGIVertices['prototype'][_0xc983('0x141')]=function(_0x51f92f){logger[_0xc983('0x2f')](util[_0xc983('0x2b')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x51f92f['label']));return this[_0xc983('0x10')][_0xc983('0x142')](_0x51f92f[_0xc983('0x40')],_0x51f92f[_0xc983('0x41')],_0x51f92f[_0xc983('0x42')]);};AGIVertices[_0xc983('0x13')][_0xc983('0x143')]=function(_0x559add){logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0x144'),_0x559add[_0xc983('0x3b')]));if(!this[_0xc983('0xab')](_0x559add[_0xc983('0x145')])){return this[_0xc983('0x10')][_0xc983('0x35')](_0x559add,'no\x20condition\x20configured');}try{var _0x342a2e=eval(_0x559add[_0xc983('0x145')])?_0xc983('0x146'):'false';this['channel'][_0xc983('0xae')](util[_0xc983('0x2b')](_0xc983('0x147'),_0x559add['condition'],_0x342a2e));return{'code':0xc8,'result':_0x342a2e};}catch(_0x17317c){return{'code':0xc8,'result':_0xc983('0x148')};}};AGIVertices[_0xc983('0x13')][_0xc983('0x149')]=function(_0x1331ce){logger[_0xc983('0x2f')](util[_0xc983('0x2b')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x1331ce[_0xc983('0x3b')]));if(!this[_0xc983('0xab')](_0x1331ce['interval_id'])){return this[_0xc983('0x10')][_0xc983('0x35')](_0x1331ce,'no\x20interval\x20configured');}var _0x44ea5f=this[_0xc983('0x14a')]['sync'](this,_0x1331ce[_0xc983('0x14b')]);if(!_0x44ea5f){return this[_0xc983('0x10')]['error'](_0x1331ce,_0xc983('0x14c'));}for(var _0x160974=0x0;_0x160974<_0x44ea5f[_0xc983('0xa2')];_0x160974+=0x1){var _0x32c517=this[_0xc983('0x10')]['getVariable'](util[_0xc983('0x2b')](_0xc983('0x14d'),_0x44ea5f[_0x160974]));if(_0x32c517[_0xc983('0xa9')]===-0x1){return _0x32c517;}logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0x14e'),_0x44ea5f[_0x160974],_0x32c517['extra']));if(_0x32c517[_0xc983('0xa7')]==='true'){logger[_0xc983('0x2f')](util[_0xc983('0x2b')]('IFTIME\x20%s\x20%s',_0x44ea5f[_0x160974],_0xc983('0x146')));this[_0xc983('0x10')][_0xc983('0xae')](util[_0xc983('0x2b')](_0xc983('0x14e'),_0x44ea5f[_0x160974],_0xc983('0x146')));return{'code':0xc8,'result':_0xc983('0x146')};}else{logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0x14e'),_0x44ea5f[_0x160974],_0xc983('0x148')));this['channel'][_0xc983('0xae')](util[_0xc983('0x2b')]('IFTIME\x20%s\x20%s',_0x44ea5f[_0x160974],_0xc983('0x148')));}}return{'code':0xc8,'result':_0xc983('0x148')};};AGIVertices[_0xc983('0x13')][_0xc983('0x14f')]=function(_0x5c3a5c){logger[_0xc983('0x2f')](util['format'](_0xc983('0x150'),_0x5c3a5c[_0xc983('0x3b')]));return this[_0xc983('0x10')][_0xc983('0x14f')]();};AGIVertices[_0xc983('0x13')][_0xc983('0x151')]=function(_0x5c037d){logger[_0xc983('0x2f')](util['format'](_0xc983('0x152'),_0x5c037d[_0xc983('0x3b')]));if(!this[_0xc983('0xab')](_0x5c037d[_0xc983('0x89')])){return this['channel'][_0xc983('0xae')]('no\x20key\x20configured');}var _0x239601=_0xc983('0x13a');var _0x61b6e3=util[_0xc983('0x2b')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x410232=util[_0xc983('0x2b')](_0xc983('0xa3'),_0x61b6e3,_0x239601);var _0x198f8d=!![];if(_0x5c037d['beep']==='NOBEEP'){_0x198f8d=![];}var _0x241dcc=this[_0xc983('0x10')][_0xc983('0x134')](_0x61b6e3,_0x239601,_0x5c037d['intKey'],_0x5c037d[_0xc983('0x6b')],undefined,_0x198f8d);if(_0x241dcc['result']!==-0x1){this[_0xc983('0x10')][_0xc983('0xae')](util[_0xc983('0x2b')](_0xc983('0x153'),_0x410232));var _0x3f230f=this[_0xc983('0x88')][_0xc983('0x75')](this,_0x5c037d,_0x410232);if(_0x3f230f){for(var _0x5ed1e1 in _0x3f230f){if(_0x3f230f['hasOwnProperty'](_0x5ed1e1)){this['channel'][_0xc983('0xaa')](util[_0xc983('0x2b')](_0xc983('0x154'),_0x5ed1e1[_0xc983('0x6f')]()),_0x3f230f[_0x5ed1e1]);}}return this[_0xc983('0x10')][_0xc983('0xae')](util[_0xc983('0x2b')](_0xc983('0x155'),JSON[_0xc983('0x78')](_0x3f230f)));}}return _0x241dcc;};AGIVertices['prototype'][_0xc983('0x156')]=function(_0x475592){logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0x157'),_0x475592['label']));if(!this[_0xc983('0xab')](_0x475592['key'])){return this[_0xc983('0x10')][_0xc983('0xae')](_0xc983('0xec'));}if(!this[_0xc983('0xab')](_0x475592[_0xc983('0x63')])){return this['channel'][_0xc983('0xae')]('no\x20text\x20configured');}this['channel'][_0xc983('0xae')](util[_0xc983('0x2b')]('Trying\x20ispeech\x20TTS\x20%s',_0x475592[_0xc983('0x63')]));var _0x479228=this['ispeechTTS'][_0xc983('0x75')](this,_0x475592);if(_0x479228){this[_0xc983('0x10')][_0xc983('0xae')](util[_0xc983('0x2b')](_0xc983('0x153'),_0x479228));var _0x422a8d=this['channel'][_0xc983('0x106')](_0x479228,_0x475592[_0xc983('0x13d')]);try{fs['unlink'](_0x479228+_0xc983('0x108'));}catch(_0x182d4e){logger['error'](_0x182d4e);}return _0x422a8d;}return this[_0xc983('0x10')][_0xc983('0x35')](_0x475592,_0xc983('0x158'));};AGIVertices['prototype'][_0xc983('0x159')]=function(_0x26766){logger['info'](util[_0xc983('0x2b')](_0xc983('0x15a'),_0x26766[_0xc983('0x3b')]));if(!this[_0xc983('0xab')](_0x26766[_0xc983('0x15b')])){return this[_0xc983('0x10')]['error'](_0x26766,_0xc983('0x15c'));}logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0x15d'),this['channel'][_0xc983('0x3e')],_0x26766['findBy']));var _0x8970b1=this[_0xc983('0x59')][_0xc983('0x75')](this,_0x26766[_0xc983('0x15b')]);if(_0x8970b1){logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0x15e'),this['channel'][_0xc983('0x3e')],_0x26766[_0xc983('0x15b')]));this[_0xc983('0x10')][_0xc983('0xae')](util['format'](_0xc983('0x15e'),this['channel']['callerid'],_0x26766['findBy']));return{'code':0xc8,'result':_0xc983('0x15f')};}else{logger[_0xc983('0x2f')](util['format'](_0xc983('0x160'),this[_0xc983('0x10')]['callerid'],_0x26766['findBy']));this['channel']['noop'](util[_0xc983('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xc983('0x10')]['callerid'],_0x26766[_0xc983('0x15b')]));return{'code':0xc8,'result':_0xc983('0x161')};}};AGIVertices[_0xc983('0x13')][_0xc983('0x162')]=function(_0x1e725d){logger[_0xc983('0x2f')](util[_0xc983('0x2b')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x1e725d[_0xc983('0x3b')]));if(!this['isConfigured'](_0x1e725d['findBy'])){return this[_0xc983('0x10')]['error'](_0x1e725d,_0xc983('0x15c'));}logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0x15d'),this[_0xc983('0x10')][_0xc983('0x3e')],_0x1e725d[_0xc983('0x15b')]));var _0x3c5f34=this['agentLogout'][_0xc983('0x75')](this,_0x1e725d[_0xc983('0x15b')]);if(_0x3c5f34){logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0x15e'),this[_0xc983('0x10')][_0xc983('0x3e')],_0x1e725d[_0xc983('0x15b')]));this[_0xc983('0x10')]['noop'](util[_0xc983('0x2b')](_0xc983('0x15e'),this['channel'][_0xc983('0x3e')],_0x1e725d['findBy']));return{'code':0xc8,'result':_0xc983('0x15f')};}else{logger[_0xc983('0x2f')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xc983('0x10')][_0xc983('0x3e')],_0x1e725d[_0xc983('0x15b')]));this[_0xc983('0x10')]['noop'](util[_0xc983('0x2b')](_0xc983('0x160'),this[_0xc983('0x10')][_0xc983('0x3e')],_0x1e725d[_0xc983('0x15b')]));return{'code':0xc8,'result':_0xc983('0x161')};}};AGIVertices['prototype'][_0xc983('0x163')]=function(_0x2cb667){logger['info'](util[_0xc983('0x2b')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x2cb667[_0xc983('0x3b')]));if(!this[_0xc983('0xab')](_0x2cb667[_0xc983('0x164')])){return this[_0xc983('0x10')][_0xc983('0x35')](_0x2cb667,_0xc983('0x165'));}this[_0xc983('0x10')][_0xc983('0xae')](util[_0xc983('0x2b')](_0xc983('0x166'),_0x2cb667[_0xc983('0x164')]));var _0x2523eb=eval(_0x2cb667[_0xc983('0x164')]);if(!this[_0xc983('0xab')](_0x2cb667['variable_id'])){return this[_0xc983('0x10')][_0xc983('0xae')](_0xc983('0x117'));}var _0xdf805c=this['getVariable'][_0xc983('0x75')](this,_0x2cb667['variable_id']);if(!_0xdf805c){return this[_0xc983('0x10')][_0xc983('0x35')](_0x2cb667,'no\x20variable\x20found');}if(_[_0xc983('0xa0')](_0x2523eb)){var _0x528053=this;_0x2523eb[_0xc983('0xde')](function(_0x3b291e,_0x2e6cf4){_0x528053['channel'][_0xc983('0xaa')](util[_0xc983('0x2b')](_0xc983('0x167'),_0xdf805c,_0x2e6cf4),_0x3b291e);});return this['channel'][_0xc983('0xae')](util[_0xc983('0x2b')](_0xc983('0x168'),_0xdf805c));}else{return this[_0xc983('0x10')][_0xc983('0xaa')](_0xdf805c,_0x2523eb);}};AGIVertices[_0xc983('0x13')][_0xc983('0xe')]=function(_0x5effcb){logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0x169'),_0x5effcb[_0xc983('0x3b')]));if(_0x5effcb[_0xc983('0x113')]===0x0){return this[_0xc983('0xac')](_0x5effcb);}_0x5effcb[_0xc983('0x113')]-=0x1;if(!this[_0xc983('0xab')](_0x5effcb[_0xc983('0x114')])){return this[_0xc983('0x10')][_0xc983('0x35')](_0x5effcb,_0xc983('0x115'));}var _0x4dd7b3=this[_0xc983('0x22')][_0xc983('0x75')](this,_0x5effcb[_0xc983('0x114')]);if(!_0x4dd7b3){return this[_0xc983('0x10')][_0xc983('0x35')](_0x5effcb,'no\x20file\x20audio\x20found');}var _0x8c1897=this['channel']['getData'](_0x4dd7b3,_0x5effcb[_0xc983('0x119')],_0x5effcb[_0xc983('0x16a')]);var _0x514fac=_0x8c1897['result'];if(_0x8c1897[_0xc983('0xa9')]===-0x1){this[_0xc983('0x3a')]['sync'](this,_0x5effcb,'-1');return _0x8c1897;}else if(_0x8c1897['extra']===_0xc983('0x6b')){_0x8c1897['result']=_0x8c1897[_0xc983('0xa9')]['length']>0x0?_0x8c1897[_0xc983('0xa9')]:'t';}else if(_[_0xc983('0x49')](_0x8c1897[_0xc983('0xa9')])){_0x8c1897[_0xc983('0xa9')]='#';_0x514fac='#';}if(!this[_0xc983('0xab')](_0x5effcb['variable_id'])){this[_0xc983('0x10')][_0xc983('0xae')](_0xc983('0x117'));}else{var _0x3a0da5=this[_0xc983('0x14')][_0xc983('0x75')](this,_0x5effcb[_0xc983('0xdb')]);if(!_0x3a0da5){return this[_0xc983('0x10')][_0xc983('0x35')](_0x5effcb,_0xc983('0xdc'));}this[_0xc983('0x10')][_0xc983('0xaa')](_0x3a0da5,_0x514fac);}this['createSquareDetailsReport']['sync'](this,_0x5effcb,_0x514fac);return _0x8c1897;};AGIVertices[_0xc983('0x13')][_0xc983('0xae')]=function(_0x3805c3){logger[_0xc983('0x2f')](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x3805c3[_0xc983('0x3b')]));return this[_0xc983('0x10')][_0xc983('0xae')](_0x3805c3[_0xc983('0x16b')]||_0x3805c3[_0xc983('0x3b')]);};AGIVertices[_0xc983('0x13')][_0xc983('0x16c')]=function(_0x50c35b){logger[_0xc983('0x2f')](util['format'](_0xc983('0x16d'),_0x50c35b['label']));if(!this['isConfigured'](_0x50c35b['findBy'])){return this[_0xc983('0x10')]['error'](_0x50c35b,_0xc983('0x15c'));}logger['info'](util[_0xc983('0x2b')](_0xc983('0x15d'),this[_0xc983('0x10')][_0xc983('0x3e')],_0x50c35b[_0xc983('0x15b')]));var _0x445e4d=this[_0xc983('0x16e')]['sync'](this,_0x50c35b[_0xc983('0x16f')]);var _0x126bfe=this['agentPause'][_0xc983('0x75')](this,_0x50c35b['findBy'],_0x445e4d);if(_0x126bfe){logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0x15e'),this['channel'][_0xc983('0x3e')],_0x50c35b[_0xc983('0x15b')]));this[_0xc983('0x10')][_0xc983('0xae')](util[_0xc983('0x2b')](_0xc983('0x15e'),this[_0xc983('0x10')][_0xc983('0x3e')],_0x50c35b[_0xc983('0x15b')]));return{'code':0xc8,'result':_0xc983('0x15f')};}else{logger[_0xc983('0x2f')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xc983('0x10')][_0xc983('0x3e')],_0x50c35b[_0xc983('0x15b')]));this['channel'][_0xc983('0xae')](util[_0xc983('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xc983('0x10')][_0xc983('0x3e')],_0x50c35b[_0xc983('0x15b')]));return{'code':0xc8,'result':_0xc983('0x161')};}};AGIVertices['prototype'][_0xc983('0x170')]=function(_0x45a8dc){logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0x171'),_0x45a8dc[_0xc983('0x3b')]));if(!this[_0xc983('0xab')](_0x45a8dc[_0xc983('0x114')])){return this['channel'][_0xc983('0x35')](_0x45a8dc,_0xc983('0x115'));}var _0x3fb088=this[_0xc983('0x22')][_0xc983('0x75')](this,_0x45a8dc[_0xc983('0x114')]);if(!_0x3fb088){return this[_0xc983('0x10')][_0xc983('0x35')](_0x45a8dc,_0xc983('0x116'));}var _0x2b6c5e=this[_0xc983('0x10')][_0xc983('0x5e')](_0xc983('0x172'),[_0x3fb088,_0x45a8dc['opts']]);if(_0x2b6c5e[_0xc983('0xa9')]===-0x1){return _0x2b6c5e;}return this[_0xc983('0x10')][_0xc983('0xae')](util['format'](_0xc983('0x173'),_0xc983('0x172'),_0x3fb088));};AGIVertices['prototype'][_0xc983('0x174')]=function(_0xa47498){logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0x175'),_0xa47498[_0xc983('0x3b')]));if(!this[_0xc983('0xab')](_0xa47498[_0xc983('0x176')])){return this[_0xc983('0x10')][_0xc983('0x35')](_0xa47498,_0xc983('0x177'));}var _0x2e82bc='';var _0x3f9c45=parseInt(_0xa47498[_0xc983('0x176')],0xa);if(isNaN(_0x3f9c45)){_0x2e82bc=_0xa47498[_0xc983('0x176')];}else{_0x2e82bc=this[_0xc983('0x18')][_0xc983('0x75')](this,_0xa47498[_0xc983('0x176')]);if(!_0x2e82bc){return this[_0xc983('0x10')]['error'](_0xa47498,_0xc983('0x178'));}}var _0x2e2d8c='';if(this[_0xc983('0xab')](_0xa47498[_0xc983('0x114')])){var _0x424f91=this[_0xc983('0x22')][_0xc983('0x75')](this,_0xa47498[_0xc983('0x114')]);if(_0x424f91){_0x2e2d8c=_0x424f91;}}this[_0xc983('0x3a')][_0xc983('0x75')](this,_0xa47498,_0x2e82bc);if(_0xa47498[_0xc983('0xe7')][_0xc983('0x179')]('x')<0x0){_0xa47498[_0xc983('0xe7')]+='x';}if(_0xa47498[_0xc983('0xe7')][_0xc983('0x179')]('X')<0x0){_0xa47498[_0xc983('0xe7')]+='X';}this[_0xc983('0x10')][_0xc983('0xaa')](_0xc983('0x17a'),_0x2e82bc?_0x2e82bc[_0xc983('0x17b')]():'');var _0xf35a25=this[_0xc983('0x10')][_0xc983('0x5e')](_0xc983('0x17c'),[_0x2e82bc,_0xa47498[_0xc983('0xe7')],_0xa47498[_0xc983('0x69')],_0x2e2d8c,_0xa47498['timeout'],_0xa47498['agi'],_0xa47498['macro'],_0xa47498[_0xc983('0x17d')],'',_0xa47498['position']]);if(_0xf35a25[_0xc983('0xa9')]===-0x1){return _0xf35a25;}return this[_0xc983('0x10')]['noop'](util[_0xc983('0x2b')](_0xc983('0x173'),_0xc983('0x17c'),_0x2e82bc));};AGIVertices[_0xc983('0x13')]['record']=function(_0x18976d){logger['info'](util[_0xc983('0x2b')](_0xc983('0x17e'),_0x18976d[_0xc983('0x3b')]));var _0x8e9dfa=_0x18976d['recordingFormat']||_0xc983('0x13a');var _0x2bdb25=util[_0xc983('0x2b')]('%s_%s',this[_0xc983('0x10')][_0xc983('0x47')],rs[_0xc983('0x11e')](0x5));var _0x5ba64b=util['format'](_0xc983('0x17f'),FILES_PATH,_0x2bdb25,_0x8e9dfa);var _0x1efac8=util[_0xc983('0x2b')](_0xc983('0x133'),FILES_PATH,_0x2bdb25);this['createSquareRecording'][_0xc983('0x75')](this,_0x18976d,_0x2bdb25,_0x5ba64b);this[_0xc983('0x10')][_0xc983('0xaa')]('RECORDING_SAVENAME',_0x2bdb25);logger[_0xc983('0x2f')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x1efac8,_0x8e9dfa,_0x18976d[_0xc983('0x180')],_0x18976d[_0xc983('0x6b')]);return this[_0xc983('0x10')][_0xc983('0x134')](_0x1efac8,_0x8e9dfa,_0x18976d[_0xc983('0x180')],_0x18976d[_0xc983('0x6b')],undefined,!![]);};AGIVertices['prototype'][_0xc983('0x181')]=function(_0xc879a9){logger['info'](util[_0xc983('0x2b')](_0xc983('0x182'),_0xc879a9[_0xc983('0x3b')]));if(!this[_0xc983('0xab')](_0xc879a9[_0xc983('0x69')])){return this[_0xc983('0x10')][_0xc983('0xae')](_0xc983('0x183'));}var _0x445a75=this[_0xc983('0x68')][_0xc983('0x75')](this,_0xc879a9);logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0x184'),util[_0xc983('0x185')](_0x445a75,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0xc879a9[_0xc983('0xdb')])){return this['channel']['noop'](_0xc983('0x186'));}var _0x4b82be=this['getVariable'][_0xc983('0x75')](this,_0xc879a9[_0xc983('0xdb')]);if(!_0x4b82be){return this['channel'][_0xc983('0x35')](_0xc879a9,_0xc983('0xdc'));}this[_0xc983('0x10')][_0xc983('0xaa')](util[_0xc983('0x2b')](_0xc983('0x187'),_0x4b82be),_0x445a75[_0xc983('0x7a')]?_0x445a75[_0xc983('0x7a')]:_0xc983('0x188'));this['channel']['setVariable'](util[_0xc983('0x2b')]('%s_STATUS_MESSAGE',_0x4b82be),_0x445a75['statusMessage']?_0x445a75[_0xc983('0x79')]:'OK');if(_0x445a75[_0xc983('0x70')]){try{this[_0xc983('0xa1')](_0x445a75[_0xc983('0x70')],_0x4b82be);}catch(_0x472f12){logger['error'](util[_0xc983('0x2b')](_0xc983('0x189'),_0x4b82be));}}return this[_0xc983('0x10')][_0xc983('0xae')](util[_0xc983('0x2b')](_0xc983('0xe0'),_0x4b82be));};AGIVertices[_0xc983('0x13')]['saydigits']=function(_0x2dd158){logger['info'](util[_0xc983('0x2b')](_0xc983('0x18a'),_0x2dd158[_0xc983('0x3b')]));return this[_0xc983('0x10')]['sayDigits'](_0x2dd158[_0xc983('0x18b')][_0xc983('0x60')](/\s+/g,''),_0x2dd158[_0xc983('0x180')]);};AGIVertices[_0xc983('0x13')][_0xc983('0x18c')]=function(_0x1c98bf){logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0x18d'),_0x1c98bf[_0xc983('0x3b')]));return this[_0xc983('0x10')][_0xc983('0x18e')](_0x1c98bf[_0xc983('0x18f')][_0xc983('0x60')](/\s+/g,''),_0x1c98bf['escape_digits']);};AGIVertices[_0xc983('0x13')][_0xc983('0x190')]=function(_0x2d5b75){logger[_0xc983('0x2f')](util[_0xc983('0x2b')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x2d5b75[_0xc983('0x3b')]));return this['channel'][_0xc983('0x191')](_0x2d5b75[_0xc983('0x63')],_0x2d5b75[_0xc983('0x180')]);};AGIVertices[_0xc983('0x13')]['sendMail']=function(_0x468d9d){logger['info'](util[_0xc983('0x2b')](_0xc983('0x192'),_0x468d9d[_0xc983('0x3b')]));if(!this[_0xc983('0xab')](_0x468d9d[_0xc983('0x193')])){return this[_0xc983('0x10')][_0xc983('0xae')](_0xc983('0x194'));}var _0x58fab3=this[_0xc983('0x195')][_0xc983('0x75')](this,_0x468d9d['account_id']);if(!_0x58fab3||!_0x58fab3['Smtp']){return this['channel']['error'](_0x468d9d,_0xc983('0x196'));}var _0x3c096a={'from':util[_0xc983('0x2b')](_0xc983('0x197'),_0x58fab3[_0xc983('0x16')],_0x58fab3['email']||_0x58fab3[_0xc983('0x198')][_0xc983('0x199')]),'to':_0x468d9d['to']||'','cc':_0x468d9d['cc']||'','bcc':_0x468d9d['bcc']||'','subject':_0x468d9d['subject'],'html':_0x468d9d['text'],'text':_0x468d9d[_0xc983('0x63')]};if(this['isConfigured'](_0x468d9d['template_id'])){}logger[_0xc983('0xe1')](_0xc983('0x19a'),JSON['stringify'](_0x3c096a));this[_0xc983('0x3a')][_0xc983('0x75')](this,_0x468d9d,_0x468d9d[_0xc983('0x193')]);this[_0xc983('0x10')]['noop'](util[_0xc983('0x2b')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x58fab3['name']));this[_0xc983('0x19b')]['sync'](this,_0x58fab3[_0xc983('0x19c')],_0x3c096a);return this[_0xc983('0x10')]['noop'](_0xc983('0x19d'));};AGIVertices[_0xc983('0x13')][_0xc983('0x19e')]=function(_0x2c684c){logger[_0xc983('0x2f')](util[_0xc983('0x2b')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x2c684c[_0xc983('0x3b')]));return this[_0xc983('0x10')][_0xc983('0xae')](_0xc983('0x19f'));};AGIVertices[_0xc983('0x13')][_0xc983('0x1a0')]=function(_0x1d74db){logger['info'](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x1d74db[_0xc983('0x3b')]));if(!this['isConfigured'](_0x1d74db[_0xc983('0x1a1')])){return this[_0xc983('0x10')][_0xc983('0xae')]('no\x20sms\x20account\x20configured');}var _0x10f61d=this[_0xc983('0x37')][_0xc983('0x75')](this,_0x1d74db[_0xc983('0x1a1')]);if(!_0x10f61d){return this[_0xc983('0x10')][_0xc983('0x35')](_0x1d74db,_0xc983('0x1a2'));}var _0xf8e747={'body':_0x1d74db[_0xc983('0x1a3')],'phone':_0x1d74db['to']||'','SmsAccountId':_0x10f61d['id']};logger[_0xc983('0xe1')]('sendSMS\x20message',JSON[_0xc983('0x78')](_0xf8e747));this['createSquareDetailsReport'][_0xc983('0x75')](this,_0x1d74db,_0x1d74db[_0xc983('0x1a1')]);this['channel'][_0xc983('0xae')](util['format'](_0xc983('0x1a4'),_0x10f61d[_0xc983('0x16')]));this[_0xc983('0x39')][_0xc983('0x75')](this,_0xf8e747);return this['channel']['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xc983('0x13')][_0xc983('0x1a5')]=function(_0x489189){logger[_0xc983('0x2f')](util[_0xc983('0x2b')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x489189['label']));if(!this[_0xc983('0xab')](_0x489189[_0xc983('0xdb')])){return this[_0xc983('0x10')][_0xc983('0x35')](_0x489189,'no\x20variable\x20selected');}var _0x372d36=this[_0xc983('0x14')]['sync'](this,_0x489189[_0xc983('0xdb')]);if(!_0x372d36){return this[_0xc983('0x10')][_0xc983('0x35')](_0x489189,_0xc983('0xdc'));}return this[_0xc983('0x10')][_0xc983('0xaa')](_0x372d36,_0x489189[_0xc983('0x1a6')]);};AGIVertices[_0xc983('0x13')]['start']=function(_0x114f47){logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0x1a7'),_0x114f47[_0xc983('0x3b')]));this[_0xc983('0x10')]['noop'](_0xc983('0x1a8'));if(_0x114f47[_0xc983('0xbb')]===_0xc983('0x1a9')){this[_0xc983('0x10')]['noop'](_0xc983('0x1aa'));return this['channel']['answer']();}return this[_0xc983('0x10')][_0xc983('0xae')](_0xc983('0x1ab'));};AGIVertices[_0xc983('0x13')][_0xc983('0x1ac')]=function(_0x42def7){logger['info'](util[_0xc983('0x2b')](_0xc983('0x1ad'),_0x42def7['label']));if(!this[_0xc983('0xab')](_0x42def7[_0xc983('0x1ae')])){return this[_0xc983('0x10')][_0xc983('0x35')](_0x42def7,'no\x20subproject\x20selected');}var _0x415bca=this[_0xc983('0x1b')][_0xc983('0x75')](this,_0x42def7[_0xc983('0x1ae')]);if(!this[_0xc983('0xab')](_0x415bca)){return this[_0xc983('0x10')]['error'](_0x42def7,util[_0xc983('0x2b')](_0xc983('0x1af'),_0x42def7[_0xc983('0x1ae')]));}if(_0x415bca===this[_0xc983('0x10')][_0xc983('0x1b0')]){return this['channel'][_0xc983('0x35')](_0x42def7,_0xc983('0x1b1'));}this[_0xc983('0x3a')][_0xc983('0x75')](this,_0x42def7,_0x415bca);var _0x299cf8=this[_0xc983('0x10')][_0xc983('0x5e')]('AGI',util[_0xc983('0x2b')](_0xc983('0x1b2'),config[_0xc983('0x8')]['host']||_0xc983('0x1b3'),_0x415bca,this['channel']['arg_1']));if(_0x299cf8[_0xc983('0xa9')]===-0x1){return _0x299cf8;}return this['channel'][_0xc983('0xae')](util['format']('Executed\x20command\x20%s\x20%s',_0xc983('0x1b4'),_0x415bca));};AGIVertices['prototype'][_0xc983('0x1b5')]=function(_0x1c3eee){logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0x1b6'),_0x1c3eee[_0xc983('0x3b')]));var _0x645fc0=this[_0xc983('0x5d')][_0xc983('0x75')](this,_0x1c3eee[_0xc983('0xb9')]);this[_0xc983('0x3a')][_0xc983('0x75')](this,_0x1c3eee,_0x1c3eee[_0xc983('0xb9')]);if(this[_0xc983('0xab')](_0x1c3eee[_0xc983('0xdb')])){var _0x3a5c68=this[_0xc983('0x14')][_0xc983('0x75')](this,_0x1c3eee[_0xc983('0xdb')]);if(_0x3a5c68){this[_0xc983('0x10')][_0xc983('0xaa')](_0x3a5c68,_0x645fc0);return this[_0xc983('0x10')]['noop'](util[_0xc983('0x2b')](_0xc983('0x1b7'),_0x1c3eee[_0xc983('0xb9')],_0x3a5c68));}}return this[_0xc983('0x10')]['noop'](util[_0xc983('0x2b')](_0xc983('0x1b8'),_0x1c3eee[_0xc983('0xb9')]));};AGIVertices[_0xc983('0x13')][_0xc983('0x1b9')]=function(_0x19261d){logger['info'](util[_0xc983('0x2b')](_0xc983('0x1ba'),_0x19261d[_0xc983('0x3b')]));_0x19261d[_0xc983('0x63')]=_0x19261d[_0xc983('0x63')][_0xc983('0x60')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x19261d['apiKey'])){return this['channel'][_0xc983('0xae')](_0xc983('0x1bb'));}if(!this[_0xc983('0xab')](_0x19261d[_0xc983('0x63')])){return this[_0xc983('0x10')]['noop']('no\x20text\x20configured');}this[_0xc983('0x10')][_0xc983('0xae')](util[_0xc983('0x2b')](_0xc983('0x1bc'),_0x19261d[_0xc983('0x63')]));var _0x935198=this[_0xc983('0x61')][_0xc983('0x75')](this,_0x19261d);if(_0x935198){this[_0xc983('0x10')]['noop'](util[_0xc983('0x2b')](_0xc983('0x1bd'),_0x935198));var _0x2ab7c9=this[_0xc983('0x10')][_0xc983('0x106')](_0x935198);try{fs[_0xc983('0x107')](_0x935198+_0xc983('0x108'));}catch(_0x1b0a99){logger[_0xc983('0x35')](_0x1b0a99);}return _0x2ab7c9;}return this[_0xc983('0x10')]['error'](_0x19261d,_0xc983('0x1be'));};AGIVertices[_0xc983('0x13')]['tts']=function(_0x56bef0){logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0x1bf'),_0x56bef0['label']));_0x56bef0[_0xc983('0x63')]=_0x56bef0[_0xc983('0x63')][_0xc983('0x60')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x56bef0[_0xc983('0x63')])){return this[_0xc983('0x10')]['noop'](_0xc983('0xaf'));}this[_0xc983('0x10')][_0xc983('0xae')](util['format'](_0xc983('0x1c0'),_0x56bef0['text']));var _0x11d226=this[_0xc983('0x66')][_0xc983('0x75')](this,_0x56bef0);if(_0x11d226){this[_0xc983('0x10')][_0xc983('0xae')](util['format'](_0xc983('0x1c1'),_0x11d226));var _0x41abc1=this[_0xc983('0x10')][_0xc983('0x106')](_0x11d226);try{fs[_0xc983('0x107')](_0x11d226+'.wav');}catch(_0x4d9b7a){logger[_0xc983('0x35')](_0x4d9b7a);}return _0x41abc1;}return this['channel'][_0xc983('0x35')](_0x56bef0,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xc983('0x13')]['unpause']=function(_0x4f1630){logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0x1c2'),_0x4f1630['label']));if(!this[_0xc983('0xab')](_0x4f1630['findBy'])){return this['channel'][_0xc983('0x35')](_0x4f1630,'no\x20find\x20by\x20configured');}logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0x15d'),this[_0xc983('0x10')][_0xc983('0x3e')],_0x4f1630[_0xc983('0x15b')]));var _0x797406=this[_0xc983('0x57')][_0xc983('0x75')](this,_0x4f1630[_0xc983('0x15b')]);if(_0x797406){logger[_0xc983('0x2f')](util['format'](_0xc983('0x15e'),this['channel'][_0xc983('0x3e')],_0x4f1630[_0xc983('0x15b')]));this[_0xc983('0x10')][_0xc983('0xae')](util['format'](_0xc983('0x15e'),this[_0xc983('0x10')]['callerid'],_0x4f1630[_0xc983('0x15b')]));return{'code':0xc8,'result':_0xc983('0x15f')};}else{logger['info'](util[_0xc983('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xc983('0x10')]['callerid'],_0x4f1630[_0xc983('0x15b')]));this[_0xc983('0x10')][_0xc983('0xae')](util[_0xc983('0x2b')](_0xc983('0x160'),this[_0xc983('0x10')][_0xc983('0x3e')],_0x4f1630[_0xc983('0x15b')]));return{'code':0xc8,'result':_0xc983('0x161')};}};AGIVertices[_0xc983('0x13')]['voicemail']=function(_0x13e017){logger['info'](util['format'](_0xc983('0x1c3'),_0x13e017[_0xc983('0x3b')]));var _0x133e8b=this['channel'][_0xc983('0x5e')](_0xc983('0x1c4'),[_0x13e017[_0xc983('0x1c5')],_0x13e017[_0xc983('0x7c')]]);if(_0x133e8b[_0xc983('0xa9')]===-0x1){return _0x133e8b;}return this['channel']['noop'](util[_0xc983('0x2b')](_0xc983('0x173'),_0xc983('0x1c4'),_0x13e017['mailbox']));};AGIVertices['prototype'][_0xc983('0x1c6')]=function(_0x3cbed4){logger[_0xc983('0x2f')](util[_0xc983('0x2b')](_0xc983('0x1c7'),_0x3cbed4[_0xc983('0x3b')]));if(!this[_0xc983('0xab')](_0x3cbed4[_0xc983('0xdb')])){return this[_0xc983('0x10')][_0xc983('0x35')](_0x3cbed4,_0xc983('0x1c8'));}var _0x3232b6=this['getVariable'][_0xc983('0x75')](this,_0x3cbed4[_0xc983('0xdb')]);if(!_0x3232b6){return this['channel'][_0xc983('0x35')](_0x3cbed4,'no\x20variable\x20found');}var _0x5cef34=this[_0xc983('0x10')][_0xc983('0x14')](_0x3232b6);return{'code':0xc8,'result':_0x5cef34[_0xc983('0xa7')]?_0x5cef34['extra']:'-'};};String[_0xc983('0x13')]['replaceAll']=function(_0x3f86d5,_0xd56f8c){return this[_0xc983('0xa5')](_0x3f86d5)['join'](_0xd56f8c);};module[_0xc983('0x1c9')]=AGIVertices;
\ No newline at end of file
index 64f485c..a976698 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31af=['mandatoryDispositionPause','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','uniqueid','update','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','prototype','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','transfereeuniqueid','secondtransfereruniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','[ACW][syncAgentRingNoAnswer]\x20%s','util','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','diff','seconds','startAcw','interface','queue','ACW','mandatoryDisposition'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x31af,0x194));var _0xf31a=function(_0x42fdd0,_0x287c23){_0x42fdd0=_0x42fdd0-0x0;var _0x2d4318=_0x31af[_0x42fdd0];return _0x2d4318;};'use strict';var util=require(_0xf31a('0x0'));var _=require('lodash');var moment=require(_0xf31a('0x1'));var ami=require(_0xf31a('0x2'));var logger=require(_0xf31a('0x3'))(_0xf31a('0x4'));var RpcUser=require(_0xf31a('0x5'));var RpcVoiceAgentReport=require(_0xf31a('0x6'));function Acw(_0x10485a){this['voiceQueues']=_0x10485a[_0xf31a('0x7')];this[_0xf31a('0x8')]=_0x10485a[_0xf31a('0x8')];this[_0xf31a('0x9')]=_0x10485a[_0xf31a('0x9')];this[_0xf31a('0xa')]={};ami['on'](_0xf31a('0xb'),this[_0xf31a('0xc')][_0xf31a('0xd')](this));ami['on'](_0xf31a('0xe'),this[_0xf31a('0xf')][_0xf31a('0xd')](this));ami['on'](_0xf31a('0x10'),this[_0xf31a('0x11')][_0xf31a('0xd')](this));ami['on'](_0xf31a('0x12'),this[_0xf31a('0x13')]['bind'](this));ami['on'](_0xf31a('0x14'),this['syncAttendedTransfer'][_0xf31a('0xd')](this));ami['on']('blindtransfer',this[_0xf31a('0x15')][_0xf31a('0xd')](this));ami['on'](_0xf31a('0x16'),this[_0xf31a('0x17')][_0xf31a('0xd')](this));}function getDiff(_0x44dd97){var _0x581f11=moment()['milliseconds'](0x0);var _0x1728e5=moment(_0x44dd97)['milliseconds'](0x0);return _0x581f11[_0xf31a('0x18')](_0x1728e5,_0xf31a('0x19'));}Acw['prototype'][_0xf31a('0x1a')]=function(_0x29698e){try{var _0x14a531=this;var _0xd3fc74=this['channels'][_0x29698e][_0xf31a('0x1b')];var _0xd7d832=this[_0xf31a('0xa')][_0x29698e][_0xf31a('0x1c')];var _0x8afa9e=this[_0xf31a('0x7')][_0xd7d832];var _0x201015=![];var _0x2247db=_0xf31a('0x1d');if(_0x8afa9e[_0xf31a('0x1e')]){if(_0x8afa9e[_0xf31a('0x1f')]['name']){_0x201015=!![];_0x2247db=_0x8afa9e['mandatoryDispositionPause']['name'];}}ami['Action']({'action':_0xf31a('0x20'),'interface':_0xd3fc74,'paused':!![],'reason':_0x2247db})[_0xf31a('0x21')](function(_0x338338){if(_0x14a531[_0xf31a('0x8')][_0xd3fc74]){return RpcUser['getAgent'](_0x14a531[_0xf31a('0x8')][_0xd3fc74]['id'])[_0xf31a('0x21')](function(_0x2aed6a){if(_0x2aed6a&&!_0x2aed6a[_0xf31a('0x22')]){logger[_0xf31a('0x23')](_0xf31a('0x24'),_0x29698e,_0xd3fc74,_0xd7d832);var _0x13d68f=_0x14a531['channels'][_0x29698e][_0xf31a('0x25')]&&_0x14a531[_0xf31a('0xa')][_0x29698e]['destlinkedid']?_0x14a531[_0xf31a('0xa')][_0x29698e][_0xf31a('0x26')]:_0x29698e;return RpcUser['savePause'](_0x14a531[_0xf31a('0x8')][_0xd3fc74],_0x2247db,_0x13d68f)['then'](function(_0x276937){if(!_0x201015){_0x14a531[_0xf31a('0x9')][_0xd3fc74]={};logger[_0xf31a('0x23')](_0xf31a('0x27'),_0x29698e,_0x14a531[_0xf31a('0x7')][_0xd7d832][_0xf31a('0x28')],_0xd3fc74,_0xd7d832);_0x14a531[_0xf31a('0x9')][_0xd3fc74][_0xf31a('0x29')]=setTimeout(_0x14a531[_0xf31a('0x2a')][_0xf31a('0xd')](_0x14a531,_0xd3fc74),_0x14a531[_0xf31a('0x7')][_0xd7d832]['acwTimeout']*0x3e8);_0x14a531[_0xf31a('0x9')][_0xd3fc74][_0xf31a('0x2b')]=moment()[_0xf31a('0x2c')]('YYYY-MM-DD\x20HH:mm:ss');_0x14a531['timers'][_0xd3fc74][_0xf31a('0x2d')]=_0x29698e;_0x14a531[_0xf31a('0x9')][_0xd3fc74][_0xf31a('0x1c')]=_0xd7d832;_0x14a531[_0xf31a('0x9')][_0xd3fc74]['updateAcw']=function(){var _0x2c91d2=getDiff(_0x14a531[_0xf31a('0x9')][_0xd3fc74][_0xf31a('0x2b')]);clearTimeout(_0x14a531[_0xf31a('0x9')][_0xd3fc74]['timer']);_0x14a531[_0xf31a('0x9')][_0xd3fc74][_0xf31a('0x29')]=![];RpcVoiceAgentReport[_0xf31a('0x2e')]({'acwtime':_0x2c91d2},_0x14a531[_0xf31a('0x9')][_0xd3fc74][_0xf31a('0x2d')],_0xd3fc74)['then'](function(_0x5aa6cc){logger[_0xf31a('0x23')]('[%s][UPDATE][ACWTIME:%s]',_0x29698e,_0x2c91d2,_0x5aa6cc);})[_0xf31a('0x2f')](function(_0x9b2cc4){logger[_0xf31a('0x30')](_0xf31a('0x31'),_0x29698e,_0x9b2cc4);});delete _0x14a531[_0xf31a('0x9')][_0xd3fc74];};}});}else{logger[_0xf31a('0x23')](_0xf31a('0x32'),_0x29698e,_0xd3fc74,_0xd7d832);}});}})['catch'](function(_0x434582){logger[_0xf31a('0x30')](_0xf31a('0x27'),_0x29698e,_0x14a531[_0xf31a('0x7')][_0xd7d832][_0xf31a('0x28')],_0xd3fc74,_0xd7d832);})[_0xf31a('0x33')](function(){delete _0x14a531[_0xf31a('0xa')][_0x29698e];});}catch(_0x1ec5f5){logger[_0xf31a('0x30')](_0xf31a('0x34'),_0x1ec5f5[_0xf31a('0x35')]);}};Acw[_0xf31a('0x36')][_0xf31a('0x2a')]=function(_0x474de8){try{var _0x5c0194=this;if(_0x5c0194['timers'][_0x474de8]){_0x5c0194[_0xf31a('0x9')][_0x474de8][_0xf31a('0x29')]=![];var _0x6a546c=_0x5c0194['timers'][_0x474de8][_0xf31a('0x2d')];var _0x3c8e6d=_0x5c0194[_0xf31a('0x9')][_0x474de8][_0xf31a('0x1c')];var _0x464086=_0x5c0194['voiceQueues'][_0x3c8e6d][_0xf31a('0x28')];logger[_0xf31a('0x23')](_0xf31a('0x37'),_0x6a546c,_0x474de8);RpcUser[_0xf31a('0x38')](this[_0xf31a('0x8')][_0x474de8]);RpcVoiceAgentReport['update']({'acwtime':_0x464086,'agentacw':!![]},_0x6a546c,_0x474de8)[_0xf31a('0x21')](function(_0x4353c0){logger[_0xf31a('0x23')](_0xf31a('0x39'),_0x6a546c,_0x464086,_0x4353c0);})[_0xf31a('0x2f')](function(_0x1df3d3){logger[_0xf31a('0x30')](_0xf31a('0x31'),_0x6a546c,_0x1df3d3);});}else{logger[_0xf31a('0x30')](_0xf31a('0x3a'),_0x474de8);if(_0x5c0194[_0xf31a('0x9')]){logger[_0xf31a('0x23')](_0xf31a('0x3b'),JSON[_0xf31a('0x3c')](_0x5c0194[_0xf31a('0x9')]));}}}catch(_0x30a261){logger['error'](_0xf31a('0x3d'),_0x30a261['message']);}};Acw[_0xf31a('0x36')][_0xf31a('0xc')]=function(_0xbb2f26){try{if(this[_0xf31a('0x7')][_0xbb2f26[_0xf31a('0x1c')]]&&(this[_0xf31a('0x7')][_0xbb2f26[_0xf31a('0x1c')]][_0xf31a('0x4')]||this[_0xf31a('0x7')][_0xbb2f26[_0xf31a('0x1c')]][_0xf31a('0x1e')])){if(this[_0xf31a('0x8')][_0xbb2f26[_0xf31a('0x1b')]]){this[_0xf31a('0xa')][_0xbb2f26['uniqueid']]={'queue':_0xbb2f26[_0xf31a('0x1c')],'interface':_0xbb2f26[_0xf31a('0x1b')],'destlinkedid':_0xbb2f26[_0xf31a('0x26')]};}}}catch(_0x13b4d6){logger[_0xf31a('0x30')](_0xf31a('0x3e'),_0x13b4d6[_0xf31a('0x35')]);}};Acw[_0xf31a('0x36')][_0xf31a('0x17')]=function(_0x283db9){try{if(this['voiceQueues'][_0x283db9[_0xf31a('0x1c')]]&&(this[_0xf31a('0x7')][_0x283db9[_0xf31a('0x1c')]]['acw']||this[_0xf31a('0x7')][_0x283db9[_0xf31a('0x1c')]]['mandatoryDisposition'])){if(this[_0xf31a('0x8')][_0x283db9['interface']]){this[_0xf31a('0xa')][_0x283db9[_0xf31a('0x2d')]]={'queue':_0x283db9[_0xf31a('0x1c')],'interface':_0x283db9['interface']};}}}catch(_0x31053e){logger[_0xf31a('0x30')](_0xf31a('0x3f'),_0x31053e[_0xf31a('0x35')]);}};Acw[_0xf31a('0x36')]['syncHangupRequest']=function(_0x17b8db){try{if(this[_0xf31a('0xa')][_0x17b8db[_0xf31a('0x2d')]]&&_[_0xf31a('0x40')](this['channels'][_0x17b8db['uniqueid']][_0xf31a('0x25')])){logger[_0xf31a('0x23')](_0xf31a('0x41'),_0x17b8db['uniqueid']);this['startAcw'](_0x17b8db[_0xf31a('0x2d')]);}else if(this[_0xf31a('0xa')][_0x17b8db['linkedid']]&&_[_0xf31a('0x40')](this[_0xf31a('0xa')][_0x17b8db[_0xf31a('0x42')]][_0xf31a('0x25')])){logger[_0xf31a('0x23')]('[%s][HANGUP:LINKEDID]',_0x17b8db[_0xf31a('0x42')]);this[_0xf31a('0x1a')](_0x17b8db['linkedid']);}}catch(_0x33824d){logger[_0xf31a('0x30')](_0xf31a('0x43'),_0x33824d[_0xf31a('0x35')]);}};Acw[_0xf31a('0x36')][_0xf31a('0x11')]=function(_0x133054){try{if(this[_0xf31a('0xa')][_0x133054[_0xf31a('0x2d')]]&&this['channels'][_0x133054[_0xf31a('0x2d')]]['attended']){logger[_0xf31a('0x23')](_0xf31a('0x44'),_0x133054[_0xf31a('0x2d')]);this[_0xf31a('0x1a')](_0x133054[_0xf31a('0x2d')]);}else if(this['channels'][_0x133054[_0xf31a('0x42')]]&&this[_0xf31a('0xa')][_0x133054[_0xf31a('0x42')]][_0xf31a('0x25')]){logger[_0xf31a('0x23')](_0xf31a('0x45'),_0x133054[_0xf31a('0x42')]);this['startAcw'](_0x133054['linkedid']);}}catch(_0x5ba322){logger[_0xf31a('0x30')](_0xf31a('0x46'),_0x5ba322[_0xf31a('0x35')]);}};Acw[_0xf31a('0x36')][_0xf31a('0x47')]=function(_0xcaba7e){try{if(!_['isNil'](this[_0xf31a('0xa')][_0xcaba7e[_0xf31a('0x48')]])){this[_0xf31a('0x1a')](_0xcaba7e[_0xf31a('0x48')]);if(this[_0xf31a('0xa')][_0xcaba7e[_0xf31a('0x49')]]){this[_0xf31a('0xa')][_0xcaba7e['secondtransfereruniqueid']][_0xf31a('0x25')]=!![];this[_0xf31a('0xa')][_0xcaba7e['transfertargetuniqueid']]=this['channels'][_0xcaba7e['secondtransfereruniqueid']];delete this[_0xf31a('0xa')][_0xcaba7e[_0xf31a('0x49')]];}}else if(!_[_0xf31a('0x4a')](this[_0xf31a('0xa')][_0xcaba7e['transfertargetuniqueid']])){this['startAcw'](_0xcaba7e['transfertargetuniqueid']);if(this[_0xf31a('0xa')][_0xcaba7e['origtransfereruniqueid']]){this[_0xf31a('0xa')][_0xcaba7e[_0xf31a('0x4b')]]['attended']=!![];this[_0xf31a('0xa')][_0xcaba7e[_0xf31a('0x48')]]=this[_0xf31a('0xa')][_0xcaba7e[_0xf31a('0x4b')]];delete this[_0xf31a('0xa')][_0xcaba7e['origtransfereruniqueid']];}}}catch(_0x2a6656){logger[_0xf31a('0x30')](_0xf31a('0x4c'),_0x2a6656['message']);}};Acw['prototype'][_0xf31a('0x15')]=function(_0x4e3e7a){try{if(this['channels'][_0x4e3e7a[_0xf31a('0x4d')]]){logger['info'](_0xf31a('0x4e'),JSON[_0xf31a('0x3c')](_0x4e3e7a[_0xf31a('0x4d')]));this['startAcw'](_0x4e3e7a[_0xf31a('0x4d')]);}else if(this[_0xf31a('0xa')][_0x4e3e7a[_0xf31a('0x4f')]]){logger['info'](_0xf31a('0x50'),JSON['stringify'](_0x4e3e7a[_0xf31a('0x4f')]));this['startAcw'](_0x4e3e7a[_0xf31a('0x4f')]);}}catch(_0x3a3b5a){logger[_0xf31a('0x30')](_0xf31a('0x51'),_0x3a3b5a['message']);}};Acw[_0xf31a('0x36')]['syncAgentRingNoAnswer']=function(_0x5e6fb5){try{if(this[_0xf31a('0x7')][_0x5e6fb5['queue']]&&this[_0xf31a('0x7')][_0x5e6fb5['queue']][_0xf31a('0x52')]===_0xf31a('0x53')){if(this[_0xf31a('0x8')][_0x5e6fb5[_0xf31a('0x1b')]]){logger[_0xf31a('0x23')](_0xf31a('0x54'),_0x5e6fb5['uniqueid'],_0x5e6fb5['interface'],_0x5e6fb5[_0xf31a('0x1c')]);return RpcUser[_0xf31a('0x55')](this[_0xf31a('0x8')][_0x5e6fb5['interface']],'Auto-Pause',_0x5e6fb5[_0xf31a('0x2d')]);}}}catch(_0x2effd0){logger[_0xf31a('0x30')](_0xf31a('0x56'),_0x2effd0[_0xf31a('0x35')]);}};module['exports']=Acw;
\ No newline at end of file
+var _0xda89=['stopAcw','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','[ACW][START]\x20%s','message','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][STOP]\x20%s','syncAgentConnect','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','timers','channels','bind','hangup','syncHangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','agents','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer'];(function(_0x4e972f,_0x5778be){var _0xd89ceb=function(_0x4dc2a6){while(--_0x4dc2a6){_0x4e972f['push'](_0x4e972f['shift']());}};_0xd89ceb(++_0x5778be);}(_0xda89,0x1dc));var _0x9da8=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xda89[_0x87b0ff];return _0x3bc0b2;};'use strict';var _=require(_0x9da8('0x0'));var moment=require('moment');var ami=require(_0x9da8('0x1'));var logger=require(_0x9da8('0x2'))(_0x9da8('0x3'));var RpcUser=require(_0x9da8('0x4'));var RpcVoiceAgentReport=require(_0x9da8('0x5'));function Acw(_0x9391d2){this[_0x9da8('0x6')]=_0x9391d2[_0x9da8('0x6')];this['agents']=_0x9391d2['agents'];this[_0x9da8('0x7')]=_0x9391d2['timers'];this[_0x9da8('0x8')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0x9da8('0x9')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0x9da8('0x9')](this));ami['on'](_0x9da8('0xa'),this[_0x9da8('0xb')][_0x9da8('0x9')](this));ami['on'](_0x9da8('0xc'),this['syncAgentRingNoAnswer'][_0x9da8('0x9')](this));ami['on'](_0x9da8('0xd'),this[_0x9da8('0xe')]['bind'](this));ami['on'](_0x9da8('0xf'),this['syncBlindTransfer'][_0x9da8('0x9')](this));ami['on'](_0x9da8('0x10'),this[_0x9da8('0x11')]['bind'](this));}function getDiff(_0x398cfe){var _0x546fd2=moment()[_0x9da8('0x12')](0x0);var _0x2e5435=moment(_0x398cfe)[_0x9da8('0x12')](0x0);return _0x546fd2['diff'](_0x2e5435,_0x9da8('0x13'));}Acw[_0x9da8('0x14')][_0x9da8('0x15')]=function(_0x476dce){try{var _0x5a33c3=this;var _0x42cbb1=this[_0x9da8('0x8')][_0x476dce][_0x9da8('0x16')];var _0x43ceed=this[_0x9da8('0x8')][_0x476dce]['queue'];var _0x43385b=this[_0x9da8('0x6')][_0x43ceed];var _0x34e19d=![];var _0x2c794c=_0x9da8('0x17');if(_0x43385b[_0x9da8('0x18')]){if(_0x43385b[_0x9da8('0x19')][_0x9da8('0x1a')]){_0x34e19d=!![];_0x2c794c=_0x43385b['mandatoryDispositionPause'][_0x9da8('0x1a')];}}ami[_0x9da8('0x1b')]({'action':_0x9da8('0x1c'),'interface':_0x42cbb1,'paused':!![],'reason':_0x2c794c})[_0x9da8('0x1d')](function(){if(_0x5a33c3[_0x9da8('0x1e')][_0x42cbb1]){return RpcUser[_0x9da8('0x1f')](_0x5a33c3[_0x9da8('0x1e')][_0x42cbb1]['id'])['then'](function(_0x3a683f){if(_0x3a683f&&!_0x3a683f[_0x9da8('0x20')]){logger['info'](_0x9da8('0x21'),_0x476dce,_0x42cbb1,_0x43ceed);var _0xceeeba=_0x5a33c3[_0x9da8('0x8')][_0x476dce][_0x9da8('0x22')]&&_0x5a33c3[_0x9da8('0x8')][_0x476dce][_0x9da8('0x23')]?_0x5a33c3[_0x9da8('0x8')][_0x476dce]['destlinkedid']:_0x476dce;return RpcUser[_0x9da8('0x24')](_0x5a33c3['agents'][_0x42cbb1],_0x2c794c,_0xceeeba)[_0x9da8('0x1d')](function(){if(!_0x34e19d){_0x5a33c3[_0x9da8('0x7')][_0x42cbb1]={};logger[_0x9da8('0x25')](_0x9da8('0x26'),_0x476dce,_0x5a33c3['voiceQueues'][_0x43ceed]['acwTimeout'],_0x42cbb1,_0x43ceed);_0x5a33c3[_0x9da8('0x7')][_0x42cbb1][_0x9da8('0x27')]=setTimeout(_0x5a33c3[_0x9da8('0x28')][_0x9da8('0x9')](_0x5a33c3,_0x42cbb1),_0x5a33c3['voiceQueues'][_0x43ceed][_0x9da8('0x29')]*0x3e8);_0x5a33c3[_0x9da8('0x7')][_0x42cbb1][_0x9da8('0x2a')]=moment()[_0x9da8('0x2b')](_0x9da8('0x2c'));_0x5a33c3[_0x9da8('0x7')][_0x42cbb1][_0x9da8('0x2d')]=_0x476dce;_0x5a33c3['timers'][_0x42cbb1][_0x9da8('0x2e')]=_0x43ceed;_0x5a33c3[_0x9da8('0x7')][_0x42cbb1][_0x9da8('0x2f')]=function(){var _0x9df42f=getDiff(_0x5a33c3[_0x9da8('0x7')][_0x42cbb1][_0x9da8('0x2a')]);clearTimeout(_0x5a33c3[_0x9da8('0x7')][_0x42cbb1]['timer']);_0x5a33c3[_0x9da8('0x7')][_0x42cbb1][_0x9da8('0x27')]=![];RpcVoiceAgentReport[_0x9da8('0x30')]({'acwtime':_0x9df42f},_0x5a33c3[_0x9da8('0x7')][_0x42cbb1][_0x9da8('0x2d')],_0x42cbb1)[_0x9da8('0x1d')](function(_0x3f533d){logger[_0x9da8('0x25')](_0x9da8('0x31'),_0x476dce,_0x9df42f,_0x3f533d);})['catch'](function(_0x181544){logger[_0x9da8('0x32')](_0x9da8('0x33'),_0x476dce,_0x181544);});delete _0x5a33c3[_0x9da8('0x7')][_0x42cbb1];};}});}else{logger[_0x9da8('0x25')](_0x9da8('0x34'),_0x476dce,_0x42cbb1,_0x43ceed);}});}})[_0x9da8('0x35')](function(){logger[_0x9da8('0x32')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x476dce,_0x5a33c3[_0x9da8('0x6')][_0x43ceed][_0x9da8('0x29')],_0x42cbb1,_0x43ceed);})[_0x9da8('0x36')](function(){delete _0x5a33c3[_0x9da8('0x8')][_0x476dce];});}catch(_0x3dcbd5){logger[_0x9da8('0x32')](_0x9da8('0x37'),_0x3dcbd5[_0x9da8('0x38')]);}};Acw[_0x9da8('0x14')][_0x9da8('0x28')]=function(_0x4e7d72){try{var _0x787de0=this;if(_0x787de0['timers'][_0x4e7d72]){_0x787de0[_0x9da8('0x7')][_0x4e7d72][_0x9da8('0x27')]=![];var _0x13ecd8=_0x787de0[_0x9da8('0x7')][_0x4e7d72]['uniqueid'];var _0x13d6f5=_0x787de0['timers'][_0x4e7d72][_0x9da8('0x2e')];var _0x3c91a7=_0x787de0[_0x9da8('0x6')][_0x13d6f5][_0x9da8('0x29')];logger[_0x9da8('0x25')]('[%s][TIMER][STOP][AGENT:%s]',_0x13ecd8,_0x4e7d72);RpcUser[_0x9da8('0x39')](this[_0x9da8('0x1e')][_0x4e7d72]);RpcVoiceAgentReport[_0x9da8('0x30')]({'acwtime':_0x3c91a7,'agentacw':!![]},_0x13ecd8,_0x4e7d72)['then'](function(_0xaf9bb2){logger['info'](_0x9da8('0x31'),_0x13ecd8,_0x3c91a7,_0xaf9bb2);})['catch'](function(_0x391ae7){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x13ecd8,_0x391ae7);});}else{logger['error'](_0x9da8('0x3a'),_0x4e7d72);if(_0x787de0[_0x9da8('0x7')]){logger['info']('[ACW][TIMERS]',JSON['stringify'](_0x787de0[_0x9da8('0x7')]));}}}catch(_0xfcdcba){logger['error'](_0x9da8('0x3b'),_0xfcdcba[_0x9da8('0x38')]);}};Acw[_0x9da8('0x14')][_0x9da8('0x3c')]=function(_0x30d560){try{if(this['voiceQueues'][_0x30d560[_0x9da8('0x2e')]]&&(this[_0x9da8('0x6')][_0x30d560[_0x9da8('0x2e')]][_0x9da8('0x3')]||this[_0x9da8('0x6')][_0x30d560[_0x9da8('0x2e')]]['mandatoryDisposition'])){if(this['agents'][_0x30d560['interface']]){this['channels'][_0x30d560['uniqueid']]={'queue':_0x30d560[_0x9da8('0x2e')],'interface':_0x30d560[_0x9da8('0x16')],'destlinkedid':_0x30d560[_0x9da8('0x23')]};}}}catch(_0x42c36d){logger[_0x9da8('0x32')]('[ACW][syncAgentConnect]\x20%s',_0x42c36d[_0x9da8('0x38')]);}};Acw[_0x9da8('0x14')][_0x9da8('0x11')]=function(_0x422fdb){try{if(this[_0x9da8('0x6')][_0x422fdb[_0x9da8('0x2e')]]&&(this['voiceQueues'][_0x422fdb[_0x9da8('0x2e')]]['acw']||this[_0x9da8('0x6')][_0x422fdb['queue']][_0x9da8('0x18')])){if(this[_0x9da8('0x1e')][_0x422fdb[_0x9da8('0x16')]]){this[_0x9da8('0x8')][_0x422fdb[_0x9da8('0x2d')]]={'queue':_0x422fdb[_0x9da8('0x2e')],'interface':_0x422fdb[_0x9da8('0x16')]};}}}catch(_0x31ca89){logger['error'](_0x9da8('0x3d'),_0x31ca89[_0x9da8('0x38')]);}};Acw[_0x9da8('0x14')][_0x9da8('0x3e')]=function(_0xc71612){try{if(this[_0x9da8('0x8')][_0xc71612[_0x9da8('0x2d')]]&&_[_0x9da8('0x3f')](this[_0x9da8('0x8')][_0xc71612[_0x9da8('0x2d')]]['attended'])){logger[_0x9da8('0x25')](_0x9da8('0x40'),_0xc71612[_0x9da8('0x2d')]);this[_0x9da8('0x15')](_0xc71612[_0x9da8('0x2d')]);}else if(this[_0x9da8('0x8')][_0xc71612[_0x9da8('0x41')]]&&_[_0x9da8('0x3f')](this[_0x9da8('0x8')][_0xc71612[_0x9da8('0x41')]][_0x9da8('0x22')])){logger[_0x9da8('0x25')]('[%s][HANGUP:LINKEDID]',_0xc71612['linkedid']);this[_0x9da8('0x15')](_0xc71612[_0x9da8('0x41')]);}}catch(_0x53583e){logger[_0x9da8('0x32')](_0x9da8('0x42'),_0x53583e[_0x9da8('0x38')]);}};Acw[_0x9da8('0x14')][_0x9da8('0xb')]=function(_0x44a99d){try{if(this['channels'][_0x44a99d['uniqueid']]&&this[_0x9da8('0x8')][_0x44a99d[_0x9da8('0x2d')]][_0x9da8('0x22')]){logger[_0x9da8('0x25')](_0x9da8('0x43'),_0x44a99d['uniqueid']);this['startAcw'](_0x44a99d[_0x9da8('0x2d')]);}else if(this[_0x9da8('0x8')][_0x44a99d[_0x9da8('0x41')]]&&this['channels'][_0x44a99d[_0x9da8('0x41')]][_0x9da8('0x22')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x44a99d[_0x9da8('0x41')]);this['startAcw'](_0x44a99d[_0x9da8('0x41')]);}}catch(_0x3330b3){logger[_0x9da8('0x32')](_0x9da8('0x44'),_0x3330b3['message']);}};Acw[_0x9da8('0x14')][_0x9da8('0xe')]=function(_0x25b834){try{if(!_[_0x9da8('0x45')](this[_0x9da8('0x8')][_0x25b834[_0x9da8('0x46')]])){this[_0x9da8('0x15')](_0x25b834[_0x9da8('0x46')]);if(this[_0x9da8('0x8')][_0x25b834[_0x9da8('0x47')]]){this[_0x9da8('0x8')][_0x25b834[_0x9da8('0x47')]][_0x9da8('0x22')]=!![];this[_0x9da8('0x8')][_0x25b834[_0x9da8('0x48')]]=this[_0x9da8('0x8')][_0x25b834[_0x9da8('0x47')]];delete this['channels'][_0x25b834[_0x9da8('0x47')]];}}else if(!_[_0x9da8('0x45')](this[_0x9da8('0x8')][_0x25b834[_0x9da8('0x48')]])){this[_0x9da8('0x15')](_0x25b834[_0x9da8('0x48')]);if(this['channels'][_0x25b834['origtransfereruniqueid']]){this[_0x9da8('0x8')][_0x25b834[_0x9da8('0x49')]]['attended']=!![];this[_0x9da8('0x8')][_0x25b834[_0x9da8('0x46')]]=this[_0x9da8('0x8')][_0x25b834['origtransfereruniqueid']];delete this[_0x9da8('0x8')][_0x25b834['origtransfereruniqueid']];}}}catch(_0x141482){logger[_0x9da8('0x32')](_0x9da8('0x4a'),_0x141482['message']);}};Acw[_0x9da8('0x14')][_0x9da8('0x4b')]=function(_0x87986f){try{if(this['channels'][_0x87986f[_0x9da8('0x4c')]]){logger[_0x9da8('0x25')](_0x9da8('0x4d'),JSON[_0x9da8('0x4e')](_0x87986f[_0x9da8('0x4c')]));this['startAcw'](_0x87986f[_0x9da8('0x4c')]);}else if(this[_0x9da8('0x8')][_0x87986f['transfererlinkedid']]){logger[_0x9da8('0x25')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x9da8('0x4e')](_0x87986f[_0x9da8('0x4f')]));this['startAcw'](_0x87986f[_0x9da8('0x4f')]);}}catch(_0xb09e67){logger['error'](_0x9da8('0x50'),_0xb09e67['message']);}};Acw[_0x9da8('0x14')]['syncAgentRingNoAnswer']=function(_0x530fde){try{if(this[_0x9da8('0x6')][_0x530fde[_0x9da8('0x2e')]]&&this[_0x9da8('0x6')][_0x530fde[_0x9da8('0x2e')]][_0x9da8('0x51')]==='all'){if(this['agents'][_0x530fde[_0x9da8('0x16')]]){logger['info'](_0x9da8('0x52'),_0x530fde[_0x9da8('0x2d')],_0x530fde[_0x9da8('0x16')],_0x530fde['queue']);return RpcUser['savePause'](this[_0x9da8('0x1e')][_0x530fde[_0x9da8('0x16')]],_0x9da8('0x53'),_0x530fde[_0x9da8('0x2d')]);}}}catch(_0x12f833){logger[_0x9da8('0x32')](_0x9da8('0x54'),_0x12f833[_0x9da8('0x38')]);}};module[_0x9da8('0x55')]=Acw;
\ No newline at end of file
index 7d43deb..ed13089 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf07e=['once','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','actionSipShowRegistry','then','catch','bluebird','util','../../config/logger','ami','../../config/environment','asterisk','port','password','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','username','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','info'];(function(_0x23a451,_0x165659){var _0x28cb94=function(_0x50df39){while(--_0x50df39){_0x23a451['push'](_0x23a451['shift']());}};_0x28cb94(++_0x165659);}(_0xf07e,0x70));var _0xef07=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf07e[_0x3dd15e];return _0x231fd0;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xef07('0x0'));var util=require(_0xef07('0x1'));var logger=require(_0xef07('0x2'))(_0xef07('0x3'));var config=require(_0xef07('0x4'));var ami=new Manager(config[_0xef07('0x5')][_0xef07('0x6')],config[_0xef07('0x5')]['ip'],config[_0xef07('0x5')]['username'],config[_0xef07('0x5')][_0xef07('0x7')],!![]);ami['keepConnected']();ami[_0xef07('0x8')]=BPromise[_0xef07('0x9')](ami[_0xef07('0xa')]);function error(_0x444cac){logger[_0xef07('0xb')](util[_0xef07('0xc')](_0xef07('0xd'),config['asterisk']['username'],config['asterisk']['ip'],config[_0xef07('0x5')][_0xef07('0x6')],util[_0xef07('0xe')](_0x444cac,![],null)));}function close(){logger[_0xef07('0xb')](util[_0xef07('0xc')](_0xef07('0xf'),config[_0xef07('0x5')][_0xef07('0x10')],config['asterisk']['ip'],config['asterisk'][_0xef07('0x6')]));}ami['actionSipShowRegistry']=function(){return function(){return ami['Action']({'action':_0xef07('0x11')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0xef07('0x8')]({'action':_0xef07('0x12')});};};ami[_0xef07('0x13')]=function(){return function(){return ami[_0xef07('0x8')]({'action':_0xef07('0x14')});};};ami[_0xef07('0x15')]=function(){return function(){return ami[_0xef07('0x8')]({'action':_0xef07('0x16')});};};ami['actionCoreShowChannels']=function(){return function(){return ami['Action']({'action':'coreshowchannels'});};};function connect(){logger[_0xef07('0x17')](util[_0xef07('0xc')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xef07('0x5')][_0xef07('0x10')],config[_0xef07('0x5')]['ip'],config[_0xef07('0x5')][_0xef07('0x6')]));ami['once'](_0xef07('0xb'),error);ami[_0xef07('0x18')]('close',close);}ami['on'](_0xef07('0x19'),connect);ami['on'](_0xef07('0x1a'),function(_0x2c2242){logger[_0xef07('0x17')](util[_0xef07('0xc')](_0xef07('0x1b'),config[_0xef07('0x5')]['username'],config[_0xef07('0x5')]['ip'],config[_0xef07('0x5')][_0xef07('0x6')],util[_0xef07('0xe')](_0x2c2242,![],null)));});ami['on'](_0xef07('0x1c'),function(){logger[_0xef07('0x17')](util[_0xef07('0xc')](_0xef07('0x1d'),config[_0xef07('0x5')][_0xef07('0x10')],config[_0xef07('0x5')]['ip'],config['asterisk']['port']));return Promise[_0xef07('0x1e')]()['then'](ami[_0xef07('0x1f')]())[_0xef07('0x20')](ami['actionDeviceStateList']())[_0xef07('0x20')](ami[_0xef07('0x13')]())[_0xef07('0x20')](ami[_0xef07('0x15')]())[_0xef07('0x20')](ami['actionCoreShowChannels']())[_0xef07('0x21')](function(_0x4ef1cb){logger['error']('[ami.js][fullybooted]',util['inspect'](_0x4ef1cb,{'showHidden':![],'depth':null}));});});ami['once']('error',error);ami[_0xef07('0x18')]('close',close);module['exports']=ami;
\ No newline at end of file
+var _0xdc04=['coreshowchannels','info','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','then','actionDeviceStateList','actionSipPeerStatus','catch','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','util','../../config/logger','ami','../../config/environment','asterisk','port','username','password','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','devicestatelist','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels'];(function(_0x27787d,_0x3c832a){var _0x2ec19c=function(_0x1d7c49){while(--_0x1d7c49){_0x27787d['push'](_0x27787d['shift']());}};_0x2ec19c(++_0x3c832a);}(_0xdc04,0x18a));var _0x4dc0=function(_0x1032b1,_0x3a3508){_0x1032b1=_0x1032b1-0x0;var _0x530f98=_0xdc04[_0x1032b1];return _0x530f98;};'use strict';var Manager=require(_0x4dc0('0x0'));var BPromise=require(_0x4dc0('0x1'));var util=require(_0x4dc0('0x2'));var logger=require(_0x4dc0('0x3'))(_0x4dc0('0x4'));var config=require(_0x4dc0('0x5'));var ami=new Manager(config[_0x4dc0('0x6')][_0x4dc0('0x7')],config[_0x4dc0('0x6')]['ip'],config[_0x4dc0('0x6')][_0x4dc0('0x8')],config[_0x4dc0('0x6')][_0x4dc0('0x9')],!![]);ami['keepConnected']();ami[_0x4dc0('0xa')]=BPromise[_0x4dc0('0xb')](ami[_0x4dc0('0xc')]);function error(_0x14f1e9){logger[_0x4dc0('0xd')](util[_0x4dc0('0xe')](_0x4dc0('0xf'),config[_0x4dc0('0x6')][_0x4dc0('0x8')],config[_0x4dc0('0x6')]['ip'],config[_0x4dc0('0x6')]['port'],util['inspect'](_0x14f1e9,![],null)));}function close(){logger[_0x4dc0('0xd')](util[_0x4dc0('0xe')](_0x4dc0('0x10'),config[_0x4dc0('0x6')][_0x4dc0('0x8')],config['asterisk']['ip'],config['asterisk'][_0x4dc0('0x7')]));}ami[_0x4dc0('0x11')]=function(){return function(){return ami[_0x4dc0('0xa')]({'action':_0x4dc0('0x12')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x4dc0('0xa')]({'action':_0x4dc0('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x4dc0('0xa')]({'action':_0x4dc0('0x14')});};};ami[_0x4dc0('0x15')]=function(){return function(){return ami[_0x4dc0('0xa')]({'action':_0x4dc0('0x16')});};};ami[_0x4dc0('0x17')]=function(){return function(){return ami[_0x4dc0('0xa')]({'action':_0x4dc0('0x18')});};};function connect(){logger[_0x4dc0('0x19')](util[_0x4dc0('0xe')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config['asterisk']['username'],config[_0x4dc0('0x6')]['ip'],config[_0x4dc0('0x6')]['port']));ami[_0x4dc0('0x1a')](_0x4dc0('0xd'),error);ami[_0x4dc0('0x1a')](_0x4dc0('0x1b'),close);}ami['on'](_0x4dc0('0x1c'),connect);ami['on'](_0x4dc0('0x1d'),function(_0x1ba4d2){logger[_0x4dc0('0x19')](util[_0x4dc0('0xe')](_0x4dc0('0x1e'),config[_0x4dc0('0x6')]['username'],config[_0x4dc0('0x6')]['ip'],config[_0x4dc0('0x6')]['port'],util[_0x4dc0('0x1f')](_0x1ba4d2,![],null)));});ami['on']('fullybooted',function(){logger['info'](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x4dc0('0x6')][_0x4dc0('0x8')],config[_0x4dc0('0x6')]['ip'],config[_0x4dc0('0x6')][_0x4dc0('0x7')]));return Promise['resolve']()['then'](ami[_0x4dc0('0x11')]())[_0x4dc0('0x20')](ami[_0x4dc0('0x21')]())[_0x4dc0('0x20')](ami[_0x4dc0('0x22')]())[_0x4dc0('0x20')](ami[_0x4dc0('0x15')]())[_0x4dc0('0x20')](ami[_0x4dc0('0x17')]())[_0x4dc0('0x23')](function(_0x479edb){logger[_0x4dc0('0xd')](_0x4dc0('0x24'),util[_0x4dc0('0x1f')](_0x479edb,{'showHidden':![],'depth':null}));});});ami[_0x4dc0('0x1a')]('error',error);ami[_0x4dc0('0x1a')](_0x4dc0('0x1b'),close);module[_0x4dc0('0x25')]=ami;
\ No newline at end of file
index 33f7db1..b9e22c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['message','result','catch','exports','bluebird','ami','http','Request','request','debug','rpc','memberReport','error'];(function(_0x4e5552,_0x19ec4e){var _0x60a338=function(_0x40c70e){while(--_0x40c70e){_0x4e5552['push'](_0x4e5552['shift']());}};_0x60a338(++_0x19ec4e);}(_0x9bde,0xe1));var _0xe9bd=function(_0x2b406b,_0x10d0ed){_0x2b406b=_0x2b406b-0x0;var _0x1ae577=_0x9bde[_0x2b406b];return _0x1ae577;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var client=jayson['client'][_0xe9bd('0x2')]({'port':0x2329});client[_0xe9bd('0x3')]=function(_0x131f6a,_0x1c1b34){return new BPromise(function(_0x10822d,_0x1a4d14){return client[_0xe9bd('0x4')](_0x131f6a,_0x1c1b34)['then'](function(_0x4763e9){logger[_0xe9bd('0x5')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x1c1b34,_0x4763e9);if(_0x4763e9[_0xe9bd('0x8')]){logger[_0xe9bd('0x8')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x4763e9[_0xe9bd('0x8')][_0xe9bd('0x9')],_0x1c1b34);return _0x1a4d14(_0x4763e9['error']['message']);}else{return _0x10822d(_0x4763e9[_0xe9bd('0xa')]);}})[_0xe9bd('0xb')](function(_0x2601ac){logger['error'](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x2601ac,_0x1c1b34);return _0x1a4d14(_0x2601ac);});});};module[_0xe9bd('0xc')]=client;
\ No newline at end of file
+var _0xb7e7=['exports','jayson/promise','../../config/logger','client','Request','debug','rpc','error','memberReport','message','result','catch'];(function(_0x90f34f,_0x404021){var _0x4b18cf=function(_0x25112d){while(--_0x25112d){_0x90f34f['push'](_0x90f34f['shift']());}};_0x4b18cf(++_0x404021);}(_0xb7e7,0x121));var _0x7b7e=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0xb7e7[_0x50aa2e];return _0x5e07f0;};'use strict';var jayson=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var logger=require(_0x7b7e('0x1'))('ami');var client=jayson[_0x7b7e('0x2')]['http']({'port':0x2329});client[_0x7b7e('0x3')]=function(_0x556d68,_0x31d0ed){return new BPromise(function(_0x118577,_0x1d9384){return client['request'](_0x556d68,_0x31d0ed)['then'](function(_0x333fa4){logger[_0x7b7e('0x4')](_0x7b7e('0x5'),'memberReport',_0x556d68,_0x31d0ed,_0x333fa4);if(_0x333fa4[_0x7b7e('0x6')]){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x333fa4[_0x7b7e('0x6')][_0x7b7e('0x8')],_0x31d0ed);return _0x1d9384(_0x333fa4[_0x7b7e('0x6')]['message']);}else{return _0x118577(_0x333fa4[_0x7b7e('0x9')]);}})[_0x7b7e('0xa')](function(_0x10a666){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x10a666,_0x31d0ed);return _0x1d9384(_0x10a666);});});};module[_0x7b7e('0xb')]=client;
\ No newline at end of file
index f1df616..db91cbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37d4=['uniqueid','name','phone','Contact','firstName','lastName','queue','active','type','dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','VoiceQueueId','CampaignId','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','substring','getQueue','exports','util','moment','isNil','string','voiceQueue'];(function(_0x68aff2,_0x35a8a8){var _0x149631=function(_0x1090a8){while(--_0x1090a8){_0x68aff2['push'](_0x68aff2['shift']());}};_0x149631(++_0x35a8a8);}(_0x37d4,0xa3));var _0x437d=function(_0x1ab21c,_0x446e99){_0x1ab21c=_0x1ab21c-0x0;var _0x53dcb1=_0x37d4[_0x1ab21c];return _0x53dcb1;};'use strict';var util=require(_0x437d('0x0'));var _=require('lodash');var moment=require(_0x437d('0x1'));function checkNameSurname(_0x46da7b,_0x3a3410,_0x2bf7bf){var _0x409914='';if(!_[_0x437d('0x2')](_0x3a3410)&&_0x437d('0x3')===typeof _0x3a3410){_0x409914+=_0x3a3410;}if(!_['isNil'](_0x2bf7bf)&&_0x437d('0x3')===typeof _0x2bf7bf){_0x409914+='\x20'+_0x2bf7bf;}if(_0x409914!==''){return _0x409914;}return _0x46da7b;}function Action(_0x3da592,_0x438a8f,_0x1288eb){this[_0x437d('0x4')]=_0x3da592;this[_0x437d('0x5')]=_0x1288eb||undefined;this[_0x437d('0x6')]=checkNameSurname(_0x438a8f['Contact'][_0x437d('0x7')],_0x438a8f[_0x437d('0x8')][_0x437d('0x9')],_0x438a8f[_0x437d('0x8')][_0x437d('0xa')]);this['number']=_0x438a8f[_0x437d('0x7')];this[_0x437d('0xb')]=_0x3da592[_0x437d('0x6')];this[_0x437d('0xc')]=_0x438a8f[_0x437d('0xc')]||![];this[_0x437d('0xd')]=_0x3da592['type'];this[_0x437d('0xe')]=_0x3da592[_0x437d('0xe')]||0x3;this['scheduledat']=_0x438a8f['scheduledat'];this[_0x437d('0xf')]=_0x438a8f[_0x437d('0xf')];this[_0x437d('0x10')]=_0x438a8f[_0x437d('0x10')];this[_0x437d('0x11')]=_0x438a8f[_0x437d('0x11')];this[_0x437d('0x12')]=_0x438a8f['countnosuchnumberretry'];this['countdropretry']=_0x438a8f['countdropretry'];this[_0x437d('0x13')]=_0x438a8f[_0x437d('0x13')];this['countmachineretry']=_0x438a8f[_0x437d('0x14')];this['countagentrejectretry']=_0x438a8f[_0x437d('0x15')];this[_0x437d('0x16')]=_0x438a8f[_0x437d('0x16')];this[_0x437d('0x17')]=_0x438a8f[_0x437d('0x17')];this['UserId']=_0x438a8f['UserId'];this[_0x437d('0x18')]=_0x438a8f['VoiceQueueId'];this[_0x437d('0x19')]=_0x438a8f[_0x437d('0x19')];this['idHopper']=_0x438a8f['id'];this[_0x437d('0x1a')]=_0x438a8f[_0x437d('0x8')][_0x437d('0x9')]||'';this[_0x437d('0x1b')]=moment()[_0x437d('0x1c')](_0x437d('0x1d'));this[_0x437d('0x1e')]=_0x438a8f[_0x437d('0x1e')];this[_0x437d('0x1f')]=_0x438a8f['callbackuniqueid'];this[_0x437d('0x20')]=_0x438a8f['callbackat'];this[_0x437d('0x21')]=_0x438a8f[_0x437d('0x21')];this[_0x437d('0x22')]='';this[_0x437d('0x23')]='';}Action[_0x437d('0x24')]['getCaller']=function(){return util[_0x437d('0x1c')](_0x437d('0x25'),this[_0x437d('0x6')],this[_0x437d('0x4')]['dialCutDigit']>0x0?this[_0x437d('0x26')][_0x437d('0x27')](this[_0x437d('0x4')]['dialCutDigit']):this[_0x437d('0x26')]);};Action[_0x437d('0x24')][_0x437d('0x28')]=function(){return this[_0x437d('0xb')];};module[_0x437d('0x29')]=Action;
\ No newline at end of file
+var _0xea13=['active','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','CampaignId','idHopper','ContactFirstName','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue','util','lodash','moment','isNil','string','voiceQueue','uniqueid','phone','Contact','firstName','lastName','queue','name'];(function(_0x6afbac,_0x395a57){var _0x3b16a3=function(_0x5bb267){while(--_0x5bb267){_0x6afbac['push'](_0x6afbac['shift']());}};_0x3b16a3(++_0x395a57);}(_0xea13,0xc5));var _0x3ea1=function(_0x1252c8,_0x394be6){_0x1252c8=_0x1252c8-0x0;var _0x1e54c1=_0xea13[_0x1252c8];return _0x1e54c1;};'use strict';var util=require(_0x3ea1('0x0'));var _=require(_0x3ea1('0x1'));var moment=require(_0x3ea1('0x2'));function checkNameSurname(_0x30b27c,_0x1427d3,_0x57dc42){var _0x49e993='';if(!_[_0x3ea1('0x3')](_0x1427d3)&&'string'===typeof _0x1427d3){_0x49e993+=_0x1427d3;}if(!_[_0x3ea1('0x3')](_0x57dc42)&&_0x3ea1('0x4')===typeof _0x57dc42){_0x49e993+='\x20'+_0x57dc42;}if(_0x49e993!==''){return _0x49e993;}return _0x30b27c;}function Action(_0x59a683,_0x531d1f,_0x264314){this[_0x3ea1('0x5')]=_0x59a683;this[_0x3ea1('0x6')]=_0x264314||undefined;this['name']=checkNameSurname(_0x531d1f['Contact'][_0x3ea1('0x7')],_0x531d1f[_0x3ea1('0x8')][_0x3ea1('0x9')],_0x531d1f[_0x3ea1('0x8')][_0x3ea1('0xa')]);this['number']=_0x531d1f[_0x3ea1('0x7')];this[_0x3ea1('0xb')]=_0x59a683[_0x3ea1('0xc')];this[_0x3ea1('0xd')]=_0x531d1f[_0x3ea1('0xd')]||![];this['type']=_0x59a683['type'];this[_0x3ea1('0xe')]=_0x59a683['dialQueueTimeout']||0x3;this[_0x3ea1('0xf')]=_0x531d1f[_0x3ea1('0xf')];this[_0x3ea1('0x10')]=_0x531d1f[_0x3ea1('0x10')];this[_0x3ea1('0x11')]=_0x531d1f['countcongestionretry'];this[_0x3ea1('0x12')]=_0x531d1f[_0x3ea1('0x12')];this['countnosuchnumberretry']=_0x531d1f['countnosuchnumberretry'];this[_0x3ea1('0x13')]=_0x531d1f['countdropretry'];this[_0x3ea1('0x14')]=_0x531d1f[_0x3ea1('0x14')];this[_0x3ea1('0x15')]=_0x531d1f['countmachineretry'];this[_0x3ea1('0x16')]=_0x531d1f[_0x3ea1('0x16')];this[_0x3ea1('0x17')]=_0x531d1f['ContactId'];this[_0x3ea1('0x18')]=_0x531d1f['ListId'];this[_0x3ea1('0x19')]=_0x531d1f[_0x3ea1('0x19')];this['VoiceQueueId']=_0x531d1f['VoiceQueueId'];this[_0x3ea1('0x1a')]=_0x531d1f[_0x3ea1('0x1a')];this[_0x3ea1('0x1b')]=_0x531d1f['id'];this[_0x3ea1('0x1c')]=_0x531d1f[_0x3ea1('0x8')][_0x3ea1('0x9')]||'';this['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x531d1f[_0x3ea1('0x1d')];this[_0x3ea1('0x1e')]=_0x531d1f[_0x3ea1('0x1e')];this[_0x3ea1('0x1f')]=_0x531d1f['callbackat'];this[_0x3ea1('0x20')]=_0x531d1f['recallme'];this['originatecalleridnum']='';this[_0x3ea1('0x21')]='';}Action[_0x3ea1('0x22')][_0x3ea1('0x23')]=function(){return util[_0x3ea1('0x24')](_0x3ea1('0x25'),this[_0x3ea1('0xc')],this[_0x3ea1('0x5')][_0x3ea1('0x26')]>0x0?this[_0x3ea1('0x27')][_0x3ea1('0x28')](this[_0x3ea1('0x5')][_0x3ea1('0x26')]):this[_0x3ea1('0x27')]);};Action[_0x3ea1('0x22')][_0x3ea1('0x29')]=function(){return this[_0x3ea1('0xb')];};module['exports']=Action;
\ No newline at end of file
index 1eec894..89c7c1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8600=['countdropretry','countagentrejectretry','uniqueid','name','calleridnum','starttime','responsetime','answertime','endtime','format','talktime','queue','membername','reason','callback','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','Answer','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry'];(function(_0x2f6065,_0x7b5c34){var _0x5e8241=function(_0x2eeb34){while(--_0x2eeb34){_0x2f6065['push'](_0x2f6065['shift']());}};_0x5e8241(++_0x7b5c34);}(_0x8600,0x107));var _0x0860=function(_0x51b829,_0xb2594c){_0x51b829=_0x51b829-0x0;var _0x12437a=_0x8600[_0x51b829];return _0x12437a;};'use strict';var util=require(_0x0860('0x0'));var _=require(_0x0860('0x1'));var moment=require(_0x0860('0x2'));function getSeconds(_0x3c246b,_0x5caf38){var _0x2aa5a9=moment(_0x3c246b)[_0x0860('0x3')](0x0);var _0x58ad52=moment(_0x5caf38)[_0x0860('0x3')](0x0);return _0x2aa5a9[_0x0860('0x4')](_0x58ad52,_0x0860('0x5'));}function AgentComplete(_0x3c8a44,_0x24d373){this[_0x0860('0x6')]=0x4;this['statedesc']=_0x0860('0x7');this['scheduledat']=_0x3c8a44[_0x0860('0x8')];this[_0x0860('0x9')]=_0x3c8a44[_0x0860('0x9')];this['campaigntype']=_0x3c8a44[_0x0860('0x9')]==='outbound'?'queue':_0x3c8a44[_0x0860('0x9')];this[_0x0860('0xa')]=_0x3c8a44['countbusyretry'];this[_0x0860('0xb')]=_0x3c8a44[_0x0860('0xb')];this[_0x0860('0xc')]=_0x3c8a44[_0x0860('0xc')];this[_0x0860('0xd')]=_0x3c8a44['countbusyretry']+_0x3c8a44[_0x0860('0xb')]+_0x3c8a44[_0x0860('0xc')]+_0x3c8a44[_0x0860('0xe')]+_0x3c8a44['countdropretry']+_0x3c8a44[_0x0860('0xf')]+_0x3c8a44[_0x0860('0x10')]+_0x3c8a44['countagentrejectretry'];this[_0x0860('0xe')]=_0x3c8a44[_0x0860('0xe')];this[_0x0860('0x11')]=_0x3c8a44[_0x0860('0x11')];this[_0x0860('0xf')]=_0x3c8a44['countabandonedretry'];this[_0x0860('0x10')]=_0x3c8a44[_0x0860('0x10')];this['countagentrejectretry']=_0x3c8a44[_0x0860('0x12')];this[_0x0860('0x13')]=_0x24d373[_0x0860('0x13')];this['calleridname']=_0x3c8a44[_0x0860('0x14')];this[_0x0860('0x15')]=_0x3c8a44['number'];this[_0x0860('0x16')]=_0x3c8a44[_0x0860('0x16')];this[_0x0860('0x17')]=_0x3c8a44['responsetime'];this[_0x0860('0x18')]=_0x3c8a44[_0x0860('0x18')];this[_0x0860('0x19')]=moment()[_0x0860('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x3c8a44[_0x0860('0x17')],_0x3c8a44[_0x0860('0x16')]);this['holdtime']=getSeconds(_0x3c8a44[_0x0860('0x18')],_0x3c8a44[_0x0860('0x17')]);this[_0x0860('0x1b')]=getSeconds(this['endtime'],_0x3c8a44[_0x0860('0x18')]);this[_0x0860('0x1c')]=_0x24d373[_0x0860('0x1c')];this[_0x0860('0x1d')]=_0x24d373['membername'];this[_0x0860('0x1e')]=_0x24d373['reason'];this[_0x0860('0x1f')]=_0x3c8a44['callback'];this['callbackuniqueid']=_0x3c8a44['callbackuniqueid'];this[_0x0860('0x20')]=_0x3c8a44['callbackat'];this[_0x0860('0x21')]=_0x3c8a44[_0x0860('0x21')];this[_0x0860('0x22')]=_0x3c8a44[_0x0860('0x22')];this[_0x0860('0x23')]=_0x3c8a44['ListId'];this['UserId']=_0x3c8a44['UserId'];this[_0x0860('0x24')]=_0x3c8a44[_0x0860('0x24')];this[_0x0860('0x25')]=_0x3c8a44[_0x0860('0x25')];this['originatecalleridnum']=_0x3c8a44['originatecalleridnum']||'';this['originatecalleridname']=_0x3c8a44[_0x0860('0x26')]||'';}module[_0x0860('0x27')]=AgentComplete;
\ No newline at end of file
+var _0xf13f=['type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','state','statedesc','Answer','scheduledat'];(function(_0x41bbd7,_0x3041f8){var _0x116b13=function(_0x411319){while(--_0x411319){_0x41bbd7['push'](_0x41bbd7['shift']());}};_0x116b13(++_0x3041f8);}(_0xf13f,0x170));var _0xff13=function(_0x3f81b2,_0xa5c135){_0x3f81b2=_0x3f81b2-0x0;var _0x1c50aa=_0xf13f[_0x3f81b2];return _0x1c50aa;};'use strict';var util=require(_0xff13('0x0'));var _=require(_0xff13('0x1'));var moment=require(_0xff13('0x2'));function getSeconds(_0x54b784,_0xb8c7c){var _0x5c013b=moment(_0x54b784)[_0xff13('0x3')](0x0);var _0x3a7127=moment(_0xb8c7c)[_0xff13('0x3')](0x0);return _0x5c013b['diff'](_0x3a7127,'seconds');}function AgentComplete(_0x292abb,_0xbb533e){this[_0xff13('0x4')]=0x4;this[_0xff13('0x5')]=_0xff13('0x6');this[_0xff13('0x7')]=_0x292abb[_0xff13('0x7')];this[_0xff13('0x8')]=_0x292abb[_0xff13('0x8')];this[_0xff13('0x9')]=_0x292abb[_0xff13('0x8')]===_0xff13('0xa')?_0xff13('0xb'):_0x292abb[_0xff13('0x8')];this[_0xff13('0xc')]=_0x292abb[_0xff13('0xc')];this[_0xff13('0xd')]=_0x292abb[_0xff13('0xd')];this[_0xff13('0xe')]=_0x292abb['countnoanswerretry'];this[_0xff13('0xf')]=_0x292abb[_0xff13('0xc')]+_0x292abb[_0xff13('0xd')]+_0x292abb[_0xff13('0xe')]+_0x292abb[_0xff13('0x10')]+_0x292abb[_0xff13('0x11')]+_0x292abb[_0xff13('0x12')]+_0x292abb[_0xff13('0x13')]+_0x292abb[_0xff13('0x14')];this[_0xff13('0x10')]=_0x292abb[_0xff13('0x10')];this['countdropretry']=_0x292abb[_0xff13('0x11')];this[_0xff13('0x12')]=_0x292abb[_0xff13('0x12')];this['countmachineretry']=_0x292abb[_0xff13('0x13')];this[_0xff13('0x14')]=_0x292abb[_0xff13('0x14')];this['uniqueid']=_0xbb533e[_0xff13('0x15')];this[_0xff13('0x16')]=_0x292abb[_0xff13('0x17')];this['calleridnum']=_0x292abb[_0xff13('0x18')];this[_0xff13('0x19')]=_0x292abb[_0xff13('0x19')];this[_0xff13('0x1a')]=_0x292abb[_0xff13('0x1a')];this[_0xff13('0x1b')]=_0x292abb[_0xff13('0x1b')];this[_0xff13('0x1c')]=moment()[_0xff13('0x1d')](_0xff13('0x1e'));this[_0xff13('0x1f')]=getSeconds(_0x292abb['responsetime'],_0x292abb['starttime']);this[_0xff13('0x20')]=getSeconds(_0x292abb[_0xff13('0x1b')],_0x292abb[_0xff13('0x1a')]);this[_0xff13('0x21')]=getSeconds(this[_0xff13('0x1c')],_0x292abb[_0xff13('0x1b')]);this[_0xff13('0xb')]=_0xbb533e[_0xff13('0xb')];this[_0xff13('0x22')]=_0xbb533e[_0xff13('0x22')];this['reason']=_0xbb533e['reason'];this['callback']=_0x292abb[_0xff13('0x23')];this['callbackuniqueid']=_0x292abb[_0xff13('0x24')];this[_0xff13('0x25')]=_0x292abb[_0xff13('0x25')];this[_0xff13('0x26')]=_0x292abb[_0xff13('0x26')];this[_0xff13('0x27')]=_0x292abb[_0xff13('0x27')];this['ListId']=_0x292abb[_0xff13('0x28')];this[_0xff13('0x29')]=_0x292abb['UserId'];this[_0xff13('0x2a')]=_0x292abb[_0xff13('0x2a')];this[_0xff13('0x2b')]=_0x292abb[_0xff13('0x2b')];this[_0xff13('0x2c')]=_0x292abb[_0xff13('0x2c')]||'';this[_0xff13('0x2d')]=_0x292abb[_0xff13('0x2d')]||'';}module[_0xff13('0x2e')]=AgentComplete;
\ No newline at end of file
index a7e7c2a..46c0b09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca9e=['holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','calleridname','calleridnum','responsetime','endtime','ringtime'];(function(_0x257d1c,_0x213ee6){var _0x59b03d=function(_0x19af8e){while(--_0x19af8e){_0x257d1c['push'](_0x257d1c['shift']());}};_0x59b03d(++_0x213ee6);}(_0xca9e,0x136));var _0xeca9=function(_0x517feb,_0x39d88b){_0x517feb=_0x517feb-0x0;var _0x5083aa=_0xca9e[_0x517feb];return _0x5083aa;};'use strict';var util=require(_0xeca9('0x0'));var _=require(_0xeca9('0x1'));var moment=require(_0xeca9('0x2'));function getSeconds(_0x1c579d,_0x2df937){var _0x1443e3=moment(_0x1c579d)[_0xeca9('0x3')](0x0);var _0x2c6185=moment(_0x2df937)[_0xeca9('0x3')](0x0);return _0x1443e3[_0xeca9('0x4')](_0x2c6185,_0xeca9('0x5'));}function Final(_0x1c4ce6){this[_0xeca9('0x6')]=_0x1c4ce6[_0xeca9('0x6')];this['scheduledat']=_0x1c4ce6[_0xeca9('0x7')];this[_0xeca9('0x8')]=_0x1c4ce6['type'];this['campaigntype']=_0x1c4ce6[_0xeca9('0x8')]===_0xeca9('0x9')?_0xeca9('0xa'):_0x1c4ce6['type'];this[_0xeca9('0xb')]=_0x1c4ce6[_0xeca9('0xb')];this[_0xeca9('0xc')]=_0x1c4ce6[_0xeca9('0xc')];this[_0xeca9('0xd')]=_0x1c4ce6[_0xeca9('0xd')];this['countglobal']=_0x1c4ce6[_0xeca9('0xb')]+_0x1c4ce6[_0xeca9('0xc')]+_0x1c4ce6['countnoanswerretry']+_0x1c4ce6[_0xeca9('0xe')]+_0x1c4ce6['countdropretry']+_0x1c4ce6[_0xeca9('0xf')]+_0x1c4ce6[_0xeca9('0x10')]+_0x1c4ce6['countagentrejectretry'];this[_0xeca9('0xe')]=_0x1c4ce6[_0xeca9('0xe')];this[_0xeca9('0x11')]=_0x1c4ce6['countdropretry'];this[_0xeca9('0xf')]=_0x1c4ce6[_0xeca9('0xf')];this[_0xeca9('0x10')]=_0x1c4ce6[_0xeca9('0x10')];this['countagentrejectretry']=_0x1c4ce6['countagentrejectretry'];this[_0xeca9('0xa')]=_0x1c4ce6[_0xeca9('0xa')];this['calleridname']=_0x1c4ce6[_0xeca9('0x12')];this[_0xeca9('0x13')]=_0x1c4ce6['calleridnum'];this['starttime']=_0x1c4ce6['starttime'];this[_0xeca9('0x14')]=_0x1c4ce6[_0xeca9('0x14')];this[_0xeca9('0x15')]=_0x1c4ce6['responsetime'];this[_0xeca9('0x16')]=_0x1c4ce6['ringtime']||0x0;this['holdtime']=_0x1c4ce6[_0xeca9('0x17')]||0x0;this['talktime']=_0x1c4ce6[_0xeca9('0x18')]||0x0;this[_0xeca9('0x19')]=_0x1c4ce6['callback'];this[_0xeca9('0x1a')]=_0x1c4ce6[_0xeca9('0x1a')];this['callbackat']=_0x1c4ce6[_0xeca9('0x1b')];this['recallme']=_0x1c4ce6[_0xeca9('0x1c')];this[_0xeca9('0x1d')]=_0x1c4ce6[_0xeca9('0x1d')];this['ListId']=_0x1c4ce6[_0xeca9('0x1e')];this[_0xeca9('0x1f')]=_0x1c4ce6['UserId'];this[_0xeca9('0x20')]=_0x1c4ce6[_0xeca9('0x20')];this[_0xeca9('0x21')]=_0x1c4ce6[_0xeca9('0x21')];this['originatecalleridnum']=_0x1c4ce6[_0xeca9('0x22')]||'';this['originatecalleridname']=_0x1c4ce6[_0xeca9('0x23')]||'';}module[_0xeca9('0x24')]=Final;
\ No newline at end of file
+var _0x84ab=['countagentrejectretry','countnosuchnumberretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x444e3a,_0x255b32){var _0x2b9dfe=function(_0x4dc47d){while(--_0x4dc47d){_0x444e3a['push'](_0x444e3a['shift']());}};_0x2b9dfe(++_0x255b32);}(_0x84ab,0x12f));var _0xb84a=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x84ab[_0xc67528];return _0x38e26d;};'use strict';var util=require(_0xb84a('0x0'));var _=require(_0xb84a('0x1'));var moment=require(_0xb84a('0x2'));function getSeconds(_0x1ea089,_0x473c3){var _0x512f13=moment(_0x1ea089)[_0xb84a('0x3')](0x0);var _0x18a4a5=moment(_0x473c3)['milliseconds'](0x0);return _0x512f13[_0xb84a('0x4')](_0x18a4a5,_0xb84a('0x5'));}function Final(_0x28c83b){this['uniqueid']=_0x28c83b['uniqueid'];this['scheduledat']=_0x28c83b[_0xb84a('0x6')];this['type']=_0x28c83b[_0xb84a('0x7')];this[_0xb84a('0x8')]=_0x28c83b['type']===_0xb84a('0x9')?'queue':_0x28c83b[_0xb84a('0x7')];this[_0xb84a('0xa')]=_0x28c83b[_0xb84a('0xa')];this['countcongestionretry']=_0x28c83b['countcongestionretry'];this['countnoanswerretry']=_0x28c83b[_0xb84a('0xb')];this[_0xb84a('0xc')]=_0x28c83b[_0xb84a('0xa')]+_0x28c83b[_0xb84a('0xd')]+_0x28c83b[_0xb84a('0xb')]+_0x28c83b['countnosuchnumberretry']+_0x28c83b[_0xb84a('0xe')]+_0x28c83b[_0xb84a('0xf')]+_0x28c83b[_0xb84a('0x10')]+_0x28c83b[_0xb84a('0x11')];this[_0xb84a('0x12')]=_0x28c83b[_0xb84a('0x12')];this[_0xb84a('0xe')]=_0x28c83b[_0xb84a('0xe')];this[_0xb84a('0xf')]=_0x28c83b[_0xb84a('0xf')];this[_0xb84a('0x10')]=_0x28c83b[_0xb84a('0x10')];this['countagentrejectretry']=_0x28c83b[_0xb84a('0x11')];this[_0xb84a('0x13')]=_0x28c83b[_0xb84a('0x13')];this[_0xb84a('0x14')]=_0x28c83b[_0xb84a('0x14')];this[_0xb84a('0x15')]=_0x28c83b[_0xb84a('0x15')];this[_0xb84a('0x16')]=_0x28c83b[_0xb84a('0x16')];this[_0xb84a('0x17')]=_0x28c83b[_0xb84a('0x17')];this[_0xb84a('0x18')]=_0x28c83b[_0xb84a('0x17')];this[_0xb84a('0x19')]=_0x28c83b['ringtime']||0x0;this[_0xb84a('0x1a')]=_0x28c83b[_0xb84a('0x1a')]||0x0;this['talktime']=_0x28c83b[_0xb84a('0x1b')]||0x0;this[_0xb84a('0x1c')]=_0x28c83b[_0xb84a('0x1c')];this[_0xb84a('0x1d')]=_0x28c83b['callbackuniqueid'];this['callbackat']=_0x28c83b[_0xb84a('0x1e')];this[_0xb84a('0x1f')]=_0x28c83b[_0xb84a('0x1f')];this[_0xb84a('0x20')]=_0x28c83b[_0xb84a('0x20')];this[_0xb84a('0x21')]=_0x28c83b[_0xb84a('0x21')];this[_0xb84a('0x22')]=_0x28c83b[_0xb84a('0x22')];this[_0xb84a('0x23')]=_0x28c83b[_0xb84a('0x23')];this[_0xb84a('0x24')]=_0x28c83b[_0xb84a('0x24')];this[_0xb84a('0x25')]=_0x28c83b[_0xb84a('0x25')]||'';this[_0xb84a('0x26')]=_0x28c83b[_0xb84a('0x26')]||'';}module[_0xb84a('0x27')]=Final;
\ No newline at end of file
index 7fbe1a8..c4c7241 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x403d=['UserId','VoiceQueueId','CampaignId','exports','util','lodash','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','ringtime','holdtime','talktime','IVR','cause-txt','callback','callbackuniqueid','callbackat','ContactId','ListId'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x403d,0x138));var _0xd403=function(_0x55a440,_0x5dacbc){_0x55a440=_0x55a440-0x0;var _0x1561b9=_0x403d[_0x55a440];return _0x1561b9;};'use strict';var util=require(_0xd403('0x0'));var _=require(_0xd403('0x1'));var moment=require('moment');function getSeconds(_0x197dae,_0x21403d){var _0x182877=moment(_0x197dae)[_0xd403('0x2')](0x0);var _0x53553c=moment(_0x21403d)[_0xd403('0x2')](0x0);return _0x182877[_0xd403('0x3')](_0x53553c,_0xd403('0x4'));}function Hangup(_0x3d8e29,_0x27380b){this[_0xd403('0x5')]=0x4;this[_0xd403('0x6')]=_0xd403('0x7');this[_0xd403('0x8')]=_0x3d8e29[_0xd403('0x8')];this[_0xd403('0x9')]=_0x3d8e29[_0xd403('0x9')];this['campaigntype']=_0x3d8e29['type']===_0xd403('0xa')?_0xd403('0xb'):_0x3d8e29[_0xd403('0x9')];this[_0xd403('0xc')]=_0x3d8e29[_0xd403('0xc')];this[_0xd403('0xd')]=_0x3d8e29[_0xd403('0xd')];this['countnoanswerretry']=_0x3d8e29[_0xd403('0xe')];this[_0xd403('0xf')]=_0x3d8e29[_0xd403('0xc')]+_0x3d8e29[_0xd403('0xd')]+_0x3d8e29[_0xd403('0xe')]+_0x3d8e29[_0xd403('0x10')]+_0x3d8e29['countdropretry']+_0x3d8e29[_0xd403('0x11')]+_0x3d8e29[_0xd403('0x12')]+_0x3d8e29[_0xd403('0x13')];this[_0xd403('0x10')]=_0x3d8e29[_0xd403('0x10')];this[_0xd403('0x14')]=_0x3d8e29[_0xd403('0x14')];this[_0xd403('0x11')]=_0x3d8e29[_0xd403('0x11')];this['countmachineretry']=_0x3d8e29[_0xd403('0x12')];this[_0xd403('0x13')]=_0x3d8e29['countagentrejectretry'];this[_0xd403('0x15')]=_0x27380b[_0xd403('0x15')];this[_0xd403('0x16')]=_0x3d8e29[_0xd403('0x17')];this[_0xd403('0x18')]=_0x3d8e29[_0xd403('0x19')];this[_0xd403('0x1a')]=_0x3d8e29[_0xd403('0x1a')];this[_0xd403('0x1b')]=_0x3d8e29[_0xd403('0x1b')];this[_0xd403('0x1c')]=moment()[_0xd403('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xd403('0x1e')]=getSeconds(_0x3d8e29[_0xd403('0x1b')],_0x3d8e29[_0xd403('0x1a')]);this[_0xd403('0x1f')]=0x0;this[_0xd403('0x20')]=getSeconds(this['endtime'],_0x3d8e29[_0xd403('0x1b')]);this['queue']=_0x3d8e29[_0xd403('0xb')];this['membername']=_0xd403('0x21');this['reason']=_0x27380b[_0xd403('0x22')];this[_0xd403('0x23')]=_0x3d8e29[_0xd403('0x23')];this[_0xd403('0x24')]=_0x3d8e29[_0xd403('0x24')];this[_0xd403('0x25')]=_0x3d8e29[_0xd403('0x25')];this['recallme']=_0x3d8e29['recallme'];this[_0xd403('0x26')]=_0x3d8e29[_0xd403('0x26')];this[_0xd403('0x27')]=_0x3d8e29[_0xd403('0x27')];this[_0xd403('0x28')]=_0x3d8e29['UserId'];this['VoiceQueueId']=_0x3d8e29[_0xd403('0x29')];this[_0xd403('0x2a')]=_0x3d8e29[_0xd403('0x2a')];}module[_0xd403('0x2b')]=Hangup;
\ No newline at end of file
+var _0xdb23=['number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','cause-txt','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','uniqueid','name','calleridnum'];(function(_0x36f641,_0x1a3063){var _0x39b299=function(_0x20c0a3){while(--_0x20c0a3){_0x36f641['push'](_0x36f641['shift']());}};_0x39b299(++_0x1a3063);}(_0xdb23,0x14f));var _0x3db2=function(_0x19eeed,_0x271eff){_0x19eeed=_0x19eeed-0x0;var _0x266413=_0xdb23[_0x19eeed];return _0x266413;};'use strict';var util=require(_0x3db2('0x0'));var _=require(_0x3db2('0x1'));var moment=require('moment');function getSeconds(_0x5f1d5d,_0x256d60){var _0x30af70=moment(_0x5f1d5d)[_0x3db2('0x2')](0x0);var _0x14a76e=moment(_0x256d60)[_0x3db2('0x2')](0x0);return _0x30af70[_0x3db2('0x3')](_0x14a76e,_0x3db2('0x4'));}function Hangup(_0x11b93c,_0x16e639){this[_0x3db2('0x5')]=0x4;this[_0x3db2('0x6')]=_0x3db2('0x7');this[_0x3db2('0x8')]=_0x11b93c['scheduledat'];this[_0x3db2('0x9')]=_0x11b93c['type'];this[_0x3db2('0xa')]=_0x11b93c[_0x3db2('0x9')]===_0x3db2('0xb')?_0x3db2('0xc'):_0x11b93c[_0x3db2('0x9')];this['countbusyretry']=_0x11b93c[_0x3db2('0xd')];this[_0x3db2('0xe')]=_0x11b93c[_0x3db2('0xe')];this[_0x3db2('0xf')]=_0x11b93c['countnoanswerretry'];this[_0x3db2('0x10')]=_0x11b93c[_0x3db2('0xd')]+_0x11b93c[_0x3db2('0xe')]+_0x11b93c[_0x3db2('0xf')]+_0x11b93c[_0x3db2('0x11')]+_0x11b93c['countdropretry']+_0x11b93c[_0x3db2('0x12')]+_0x11b93c['countmachineretry']+_0x11b93c[_0x3db2('0x13')];this[_0x3db2('0x11')]=_0x11b93c[_0x3db2('0x11')];this[_0x3db2('0x14')]=_0x11b93c[_0x3db2('0x14')];this[_0x3db2('0x12')]=_0x11b93c[_0x3db2('0x12')];this[_0x3db2('0x15')]=_0x11b93c[_0x3db2('0x15')];this['countagentrejectretry']=_0x11b93c[_0x3db2('0x13')];this[_0x3db2('0x16')]=_0x16e639[_0x3db2('0x16')];this['calleridname']=_0x11b93c[_0x3db2('0x17')];this[_0x3db2('0x18')]=_0x11b93c[_0x3db2('0x19')];this[_0x3db2('0x1a')]=_0x11b93c[_0x3db2('0x1a')];this[_0x3db2('0x1b')]=_0x11b93c[_0x3db2('0x1b')];this[_0x3db2('0x1c')]=moment()[_0x3db2('0x1d')](_0x3db2('0x1e'));this[_0x3db2('0x1f')]=getSeconds(_0x11b93c['responsetime'],_0x11b93c[_0x3db2('0x1a')]);this[_0x3db2('0x20')]=0x0;this[_0x3db2('0x21')]=getSeconds(this['endtime'],_0x11b93c[_0x3db2('0x1b')]);this[_0x3db2('0xc')]=_0x11b93c[_0x3db2('0xc')];this[_0x3db2('0x22')]='IVR';this[_0x3db2('0x23')]=_0x16e639[_0x3db2('0x24')];this['callback']=_0x11b93c['callback'];this[_0x3db2('0x25')]=_0x11b93c['callbackuniqueid'];this[_0x3db2('0x26')]=_0x11b93c[_0x3db2('0x26')];this[_0x3db2('0x27')]=_0x11b93c['recallme'];this['ContactId']=_0x11b93c['ContactId'];this[_0x3db2('0x28')]=_0x11b93c[_0x3db2('0x28')];this[_0x3db2('0x29')]=_0x11b93c[_0x3db2('0x29')];this[_0x3db2('0x2a')]=_0x11b93c['VoiceQueueId'];this[_0x3db2('0x2b')]=_0x11b93c[_0x3db2('0x2b')];}module[_0x3db2('0x2c')]=Hangup;
\ No newline at end of file
index 1d0be4f..6dab5f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf44f=['holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','diff','uniqueid','scheduledat','type','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','name','calleridnum','number','starttime','responsetime'];(function(_0x442409,_0x1021fe){var _0x18cc41=function(_0x210ba6){while(--_0x210ba6){_0x442409['push'](_0x442409['shift']());}};_0x18cc41(++_0x1021fe);}(_0xf44f,0x7d));var _0xff44=function(_0x3f8a7e,_0x2d8f8c){_0x3f8a7e=_0x3f8a7e-0x0;var _0x104adc=_0xf44f[_0x3f8a7e];return _0x104adc;};'use strict';var util=require('util');var _=require(_0xff44('0x0'));var moment=require(_0xff44('0x1'));function getSeconds(_0x14c6f8,_0x333eeb){var _0x1e9185=moment(_0x14c6f8)['milliseconds'](0x0);var _0x1a2734=moment(_0x333eeb)['milliseconds'](0x0);return _0x1e9185[_0xff44('0x2')](_0x1a2734,'seconds');}function History(_0x14f6de){this['uniqueid']=_0x14f6de[_0xff44('0x3')];this[_0xff44('0x4')]=_0x14f6de[_0xff44('0x4')]||undefined;this[_0xff44('0x5')]=_0x14f6de[_0xff44('0x5')];this['campaigntype']=_0x14f6de[_0xff44('0x5')]===_0xff44('0x6')?_0xff44('0x7'):_0x14f6de[_0xff44('0x5')];this['countbusyretry']=_0x14f6de['countbusyretry'];this[_0xff44('0x8')]=_0x14f6de[_0xff44('0x8')];this[_0xff44('0x9')]=_0x14f6de[_0xff44('0x9')];this[_0xff44('0xa')]=_0x14f6de[_0xff44('0xb')]+_0x14f6de[_0xff44('0x8')]+_0x14f6de[_0xff44('0x9')]+_0x14f6de['countnosuchnumberretry']+_0x14f6de[_0xff44('0xc')]+_0x14f6de[_0xff44('0xd')]+_0x14f6de[_0xff44('0xe')]+_0x14f6de[_0xff44('0xf')];this[_0xff44('0x10')]=_0x14f6de['countnosuchnumberretry'];this['countdropretry']=_0x14f6de[_0xff44('0xc')];this[_0xff44('0xd')]=_0x14f6de[_0xff44('0xd')];this[_0xff44('0xe')]=_0x14f6de[_0xff44('0xe')];this['countagentrejectretry']=_0x14f6de[_0xff44('0xf')];this[_0xff44('0x7')]=_0x14f6de[_0xff44('0x7')];this[_0xff44('0x11')]=_0x14f6de[_0xff44('0x12')];this[_0xff44('0x13')]=_0x14f6de[_0xff44('0x14')];this[_0xff44('0x15')]=_0x14f6de['starttime'];this[_0xff44('0x16')]=_0x14f6de[_0xff44('0x16')];this['endtime']=_0x14f6de[_0xff44('0x16')];this['ringtime']=getSeconds(_0x14f6de[_0xff44('0x16')],_0x14f6de[_0xff44('0x15')]);this[_0xff44('0x17')]=0x0;this[_0xff44('0x18')]=0x0;this[_0xff44('0x19')]=_0x14f6de[_0xff44('0x19')];this[_0xff44('0x1a')]=_0x14f6de[_0xff44('0x1a')];this[_0xff44('0x1b')]=_0x14f6de[_0xff44('0x1b')];this[_0xff44('0x1c')]=_0x14f6de[_0xff44('0x1c')];this[_0xff44('0x1d')]=_0x14f6de[_0xff44('0x1d')];this[_0xff44('0x1e')]=_0x14f6de[_0xff44('0x1e')];this[_0xff44('0x1f')]=_0x14f6de[_0xff44('0x1f')];this[_0xff44('0x20')]=_0x14f6de['VoiceQueueId'];this[_0xff44('0x21')]=_0x14f6de['CampaignId'];this[_0xff44('0x22')]=_0x14f6de['originatecalleridnum']||'';this[_0xff44('0x23')]=_0x14f6de[_0xff44('0x23')]||'';}module[_0xff44('0x24')]=History;
\ No newline at end of file
+var _0x4fe3=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x4fe3,0x93));var _0x34fe=function(_0x6361a,_0x1ed251){_0x6361a=_0x6361a-0x0;var _0x3ef022=_0x4fe3[_0x6361a];return _0x3ef022;};'use strict';var util=require(_0x34fe('0x0'));var _=require(_0x34fe('0x1'));var moment=require(_0x34fe('0x2'));function getSeconds(_0x59bfcc,_0x241090){var _0x21b346=moment(_0x59bfcc)['milliseconds'](0x0);var _0x3693a2=moment(_0x241090)[_0x34fe('0x3')](0x0);return _0x21b346[_0x34fe('0x4')](_0x3693a2,_0x34fe('0x5'));}function History(_0x8ffb0f){this[_0x34fe('0x6')]=_0x8ffb0f[_0x34fe('0x6')];this[_0x34fe('0x7')]=_0x8ffb0f['scheduledat']||undefined;this['type']=_0x8ffb0f[_0x34fe('0x8')];this[_0x34fe('0x9')]=_0x8ffb0f[_0x34fe('0x8')]===_0x34fe('0xa')?_0x34fe('0xb'):_0x8ffb0f['type'];this[_0x34fe('0xc')]=_0x8ffb0f[_0x34fe('0xc')];this[_0x34fe('0xd')]=_0x8ffb0f['countcongestionretry'];this[_0x34fe('0xe')]=_0x8ffb0f[_0x34fe('0xe')];this[_0x34fe('0xf')]=_0x8ffb0f[_0x34fe('0xc')]+_0x8ffb0f['countcongestionretry']+_0x8ffb0f['countnoanswerretry']+_0x8ffb0f[_0x34fe('0x10')]+_0x8ffb0f[_0x34fe('0x11')]+_0x8ffb0f[_0x34fe('0x12')]+_0x8ffb0f[_0x34fe('0x13')]+_0x8ffb0f[_0x34fe('0x14')];this['countnosuchnumberretry']=_0x8ffb0f[_0x34fe('0x10')];this[_0x34fe('0x11')]=_0x8ffb0f[_0x34fe('0x11')];this[_0x34fe('0x12')]=_0x8ffb0f[_0x34fe('0x12')];this[_0x34fe('0x13')]=_0x8ffb0f['countmachineretry'];this[_0x34fe('0x14')]=_0x8ffb0f[_0x34fe('0x14')];this[_0x34fe('0xb')]=_0x8ffb0f['queue'];this[_0x34fe('0x15')]=_0x8ffb0f[_0x34fe('0x16')];this[_0x34fe('0x17')]=_0x8ffb0f[_0x34fe('0x18')];this[_0x34fe('0x19')]=_0x8ffb0f[_0x34fe('0x19')];this[_0x34fe('0x1a')]=_0x8ffb0f[_0x34fe('0x1a')];this['endtime']=_0x8ffb0f[_0x34fe('0x1a')];this[_0x34fe('0x1b')]=getSeconds(_0x8ffb0f[_0x34fe('0x1a')],_0x8ffb0f[_0x34fe('0x19')]);this[_0x34fe('0x1c')]=0x0;this['talktime']=0x0;this[_0x34fe('0x1d')]=_0x8ffb0f['callback'];this[_0x34fe('0x1e')]=_0x8ffb0f[_0x34fe('0x1e')];this[_0x34fe('0x1f')]=_0x8ffb0f[_0x34fe('0x1f')];this['recallme']=_0x8ffb0f[_0x34fe('0x20')];this[_0x34fe('0x21')]=_0x8ffb0f['ContactId'];this[_0x34fe('0x22')]=_0x8ffb0f[_0x34fe('0x22')];this[_0x34fe('0x23')]=_0x8ffb0f[_0x34fe('0x23')];this[_0x34fe('0x24')]=_0x8ffb0f['VoiceQueueId'];this[_0x34fe('0x25')]=_0x8ffb0f[_0x34fe('0x25')];this['originatecalleridnum']=_0x8ffb0f[_0x34fe('0x26')]||'';this['originatecalleridname']=_0x8ffb0f[_0x34fe('0x27')]||'';}module[_0x34fe('0x28')]=History;
\ No newline at end of file
index 8822a7b..db96dda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0a8=['[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','dropreason','TIMEOUT','dialDropRetryFrequency','voiceQueue','additional','dialDropMaxRetry','[rescheduleContact][Drop]','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','callAdditionalPhoneAfterMin','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncNewExten','actionid','roundrobin','paused','stateinterface','locked','pick','queueStatusComplete','[unlockQueueStatus][undefined]','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','resetActiveCalls','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTime','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','\x20Timezone\x20unknow\x20','push','iftime\x20%s,%s','timezones','content','indexOf','true','command','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','progressive','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','handlePreviewRecallNotifications','Agent','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','throttle','dialPreviewRecallmeReminder','filter','online','reachable','map','user:%s','syncCampaigns','[syncCampaigns]','pow','replace','random','actionOriginate','object','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','dialQueueProject2','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','xcally-motion-dialer','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','toUpper','callerid','dialOriginateCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','variables','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','NoSuchNumber','nosuchnumber','dialNoSuchNumberRetryFrequency','reason\x200\x20no\x20such\x20number....','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','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]','one\x20call\x20every:','[handlePredictive]','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[booked][checkContactBlack][else]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','dialLimitQueue','[actionOriginate]\x20','checkContactBlack','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','getContactDialer','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','Ts\x20=\x20','[abandonmentRate]','p\x20=\x20','Amax\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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','interval\x20=\x20','exports','util','lodash','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','../ami','redis','localhost','../rpc/cmHopperHistory','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','name','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','Trunk','active','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','debug','inspect','error','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','available','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','state','statedesc','starttime','clearZombieChannels','[uniqueid]','[actions]','isNil','Action','status','channel','queue','updateOriginated','[Dialer][checkChannel][ivr]','countReScheduled','resolve','catch','[countReScheduled]\x20','then','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','saveInDb','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','unmonitored','variable','amdstatus','exten','dialAMDActive','value','HANGUP','uniqueid','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','outboundAnswerAgiCallsDay','Machine','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','stateGlobal','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ContactId','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countdropretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','outboundUnknownCallsDay','cause-txt','Unknow','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime'];(function(_0x42804f,_0x2bfee7){var _0xd799a5=function(_0xe73653){while(--_0xe73653){_0x42804f['push'](_0x42804f['shift']());}};_0xd799a5(++_0x2bfee7);}(_0xd0a8,0x115));var _0x8d0a=function(_0x471318,_0x45756b){_0x471318=_0x471318-0x0;var _0x55e240=_0xd0a8[_0x471318];return _0x55e240;};'use strict';var util=require(_0x8d0a('0x0'));var _=require(_0x8d0a('0x1'));var uuid=require('uuid');var moment=require(_0x8d0a('0x2'));var rr=require('rr');var md5=require(_0x8d0a('0x3'));var Redis=require(_0x8d0a('0x4'));var ut=require(_0x8d0a('0x5'));var config=require(_0x8d0a('0x6'));var logger=require(_0x8d0a('0x7'))(_0x8d0a('0x8'));var loggerBooked=require(_0x8d0a('0x7'))(_0x8d0a('0x9'));var loggerPredictive=require('../../../config/logger')(_0x8d0a('0xa'));var loggerPredictiveCalls=require(_0x8d0a('0x7'))(_0x8d0a('0xb'));var loggerSyncQueueSummary=require('../../../config/logger')('syncQueueSummary');var ami=require(_0x8d0a('0xc'));config['redis']=_['defaults'](config[_0x8d0a('0xd')],{'host':_0x8d0a('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8d0a('0xd')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x8d0a('0xf'));var cmHopperAdditionalPhone=require(_0x8d0a('0x10'));var cmHopperBlack=require(_0x8d0a('0x11'));var voiceQueueRt=require(_0x8d0a('0x12'));var RpcSetting=require(_0x8d0a('0x13'));var Action=require(_0x8d0a('0x14'));var History=require('./history');var Final=require(_0x8d0a('0x15'));var AgentComplete=require(_0x8d0a('0x16'));var QueueCallerAbandon=require(_0x8d0a('0x17'));var Hangup=require(_0x8d0a('0x18'));var ipAgi=process[_0x8d0a('0x19')][_0x8d0a('0x1a')]||_0x8d0a('0x1b');var strategy={'rrmemory':_0x8d0a('0x1c'),'roundrobin':'roundrobin'};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x8d0a('0x1d')][_0x8d0a('0x1e')]=function(_0x61f64b){this[_0x8d0a('0x1f')]=this['tail']?this[_0x8d0a('0x1f')][_0x8d0a('0x20')](_0x61f64b):_0x61f64b();};function Dialer(_0x564307,_0x365634){this[_0x8d0a('0x21')]=new Sequence();this[_0x8d0a('0x22')]=_0x365634;this[_0x8d0a('0x23')]=_0x564307['voiceQueues'];this['campaigns']=_0x564307[_0x8d0a('0x24')];this[_0x8d0a('0x25')]=_0x564307[_0x8d0a('0x25')];this[_0x8d0a('0x26')]=_0x564307[_0x8d0a('0x26')];this[_0x8d0a('0x27')]=config[_0x8d0a('0x27')]||0x2;this['channels']={};this[_0x8d0a('0x28')]={};this[_0x8d0a('0x29')]={};this[_0x8d0a('0x2a')]={};this['optionPredictive']={};this[_0x8d0a('0x2b')]={};this[_0x8d0a('0x2c')]={};this[_0x8d0a('0x2d')]={};this[_0x8d0a('0x2e')]={};this['queueBookedRR']={};ami['on']('agentconnect',this[_0x8d0a('0x2f')]['bind'](this));ami['on'](_0x8d0a('0x30'),this[_0x8d0a('0x31')][_0x8d0a('0x32')](this));ami['on']('originateresponse',this[_0x8d0a('0x33')][_0x8d0a('0x32')](this));ami['on'](_0x8d0a('0x34'),this[_0x8d0a('0x35')][_0x8d0a('0x32')](this));ami['on'](_0x8d0a('0x36'),this[_0x8d0a('0x37')][_0x8d0a('0x32')](this));ami['on'](_0x8d0a('0x38'),this[_0x8d0a('0x39')][_0x8d0a('0x32')](this));ami['on']('hangup',this[_0x8d0a('0x3a')]['bind'](this));ami['on'](_0x8d0a('0x3b'),this['syncNewExten'][_0x8d0a('0x32')](this));ami['on'](_0x8d0a('0x3c'),this[_0x8d0a('0x3d')]['bind'](this));ami['on'](_0x8d0a('0x3e'),this[_0x8d0a('0x3f')][_0x8d0a('0x32')](this));ami['on'](_0x8d0a('0x40'),this[_0x8d0a('0x41')][_0x8d0a('0x32')](this));this[_0x8d0a('0x42')]();this[_0x8d0a('0x43')]();RpcSetting[_0x8d0a('0x44')]()['then'](function(_0x2dd5d3){previewRecallmeReminderInterval=_0x2dd5d3[_0x8d0a('0x45')];});}function isNotNull(_0x427d22){return _0x427d22!==null&&!_[_0x8d0a('0x46')](_0x427d22);}function checkIsLoggedIn(_0x501d8a,_0x1e7a35){return function(){if(_0x1e7a35<=0x0){_0x501d8a[_0x8d0a('0x47')]=_0x8d0a('0x48');throw _0x501d8a['name']+_0x8d0a('0x49');}};}function isActive(_0x423d15){return _0x423d15;}function checkIsActive(_0x55ed55,_0x4e3366){return function(){if(!isActive(_0x4e3366)){_0x55ed55['message']='NOT_ACTIVE';throw _0x55ed55[_0x8d0a('0x4a')]+'\x20NOT\x20Active';}};}function checkInterval(_0x5f58ac){return function(){if(!isNotNull(_0x5f58ac['Interval'])){_0x5f58ac[_0x8d0a('0x47')]=_0x8d0a('0x4b');throw _0x5f58ac['name']+_0x8d0a('0x4c');}if(!isNotNull(_0x5f58ac[_0x8d0a('0x4d')][_0x8d0a('0x4e')])){_0x5f58ac['message']=_0x8d0a('0x4b');throw _0x5f58ac[_0x8d0a('0x4a')]+_0x8d0a('0x4c');}if(!isNotNull(_['isEmpty'](_0x5f58ac[_0x8d0a('0x4d')][_0x8d0a('0x4e')]))){_0x5f58ac[_0x8d0a('0x47')]='INTERVAL_IS_NULL';throw _0x5f58ac['name']+_0x8d0a('0x4c');}};}function msgResponse(_0xb7e37b,_0x52e307,_0x2acc1d){return{'action':_0xb7e37b,'response':_0x52e307,'message':_0x2acc1d,'stack':_0x2acc1d};}function myreject(_0x3f73c1){return function(_0x530889){return _0x3f73c1(msgResponse(_0x8d0a('0x4f'),_0x8d0a('0x50'),JSON[_0x8d0a('0x51')](_0x530889)));};}function getSeconds(_0x16262d,_0x31f3c9){var _0x56e9f0=moment(_0x16262d)[_0x8d0a('0x52')](0x0);var _0x138764=moment(_0x31f3c9)['milliseconds'](0x0);return _0x56e9f0[_0x8d0a('0x53')](_0x138764,_0x8d0a('0x54'));}function emit(_0x40ba6c,_0x738f88,_0x1de608){io['to'](_0x40ba6c)[_0x8d0a('0x55')](_0x738f88,_0x1de608);}function emitVoiceQueueSummary(_0x25f20b){if(_0x25f20b[_0x8d0a('0x56')]===_0x8d0a('0x57')){var _0xc75823={'id':_0x25f20b['id'],'name':_0x25f20b['name'],'strategy':_0x25f20b[_0x8d0a('0x58')],'answered':_0x25f20b[_0x8d0a('0x59')],'available':_0x25f20b['available'],'loggedIn':_0x25f20b[_0x8d0a('0x5a')],'pTalking':_0x25f20b[_0x8d0a('0x5b')],'sumBillable':_0x25f20b[_0x8d0a('0x5c')],'sumDuration':_0x25f20b[_0x8d0a('0x5d')],'sumHoldTime':_0x25f20b[_0x8d0a('0x5e')]||0x0,'talking':_0x25f20b[_0x8d0a('0x5f')],'total':_0x25f20b['total'],'type':_0x25f20b[_0x8d0a('0x56')],'unmanaged':_0x25f20b[_0x8d0a('0x60')],'abandoned':_0x25f20b[_0x8d0a('0x61')],'waiting':_0x25f20b['waiting'],'loggedInDb':_0x25f20b[_0x8d0a('0x62')],'dialActive':_0x25f20b[_0x8d0a('0x63')],'dialMethod':_0x25f20b[_0x8d0a('0x64')],'dialOriginateCallerIdName':_0x25f20b[_0x8d0a('0x65')],'dialOriginateCallerIdNumber':_0x25f20b['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x25f20b[_0x8d0a('0x66')],'dialPrefix':_0x25f20b[_0x8d0a('0x67')],'outboundAnswerAgiCallsDay':_0x25f20b['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x25f20b[_0x8d0a('0x68')],'outboundBlacklistCallsDay':_0x25f20b[_0x8d0a('0x69')],'outboundBusyCallsDay':_0x25f20b['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x25f20b['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x25f20b[_0x8d0a('0x6a')],'outboundDropCallsDayCallersExit':_0x25f20b['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x25f20b['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x25f20b[_0x8d0a('0x6b')],'outboundNoSuchCallsDay':_0x25f20b[_0x8d0a('0x6c')],'outboundOriginateFailureCallsDay':_0x25f20b[_0x8d0a('0x6d')],'outboundReCallsDay':_0x25f20b[_0x8d0a('0x6e')],'outboundRejectCallsDay':_0x25f20b[_0x8d0a('0x6f')],'outboundUnknownCallsDay':_0x25f20b['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x25f20b[_0x8d0a('0x70')],'predictiveIntervalAvgHoldtime':_0x25f20b[_0x8d0a('0x71')],'predictiveIntervalAvgTalktime':_0x25f20b['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x25f20b[_0x8d0a('0x72')],'predictiveIntervalDroppedCallsTimeout':_0x25f20b[_0x8d0a('0x73')],'predictiveIntervalErlangCalls':_0x25f20b[_0x8d0a('0x74')],'predictiveIntervalErlangCallsDroppedCalls':_0x25f20b[_0x8d0a('0x75')],'predictiveIntervalHitRate':_0x25f20b[_0x8d0a('0x76')],'predictiveIntervalMultiplicativeFactor':_0x25f20b[_0x8d0a('0x77')],'predictiveIntervalPauses':_0x25f20b['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x25f20b['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x25f20b['predictiveIntervalTotalCalls'],'message':_0x25f20b[_0x8d0a('0x47')],'originated':_0x25f20b[_0x8d0a('0x78')],'erlangCalls':_0x25f20b[_0x8d0a('0x79')],'erlangCallToSecond':_0x25f20b[_0x8d0a('0x7a')],'erlangAbandonmentRate':_0x25f20b['erlangAbandonmentRate'],'erlangBusyFactor':_0x25f20b[_0x8d0a('0x7b')],'startPredictive':_0x25f20b[_0x8d0a('0x2b')],'startProgressive':_0x25f20b[_0x8d0a('0x2c')]};if(_0x25f20b[_0x8d0a('0x7c')]){_0xc75823[_0x8d0a('0x7c')]={'id':_0x25f20b[_0x8d0a('0x7c')]['id'],'name':_0x25f20b[_0x8d0a('0x7c')][_0x8d0a('0x4a')],'active':_0x25f20b[_0x8d0a('0x7c')][_0x8d0a('0x7d')],'callerid':_0x25f20b[_0x8d0a('0x7c')]['callerid']};}if(_0x25f20b[_0x8d0a('0x4d')]){_0xc75823[_0x8d0a('0x4d')]={'id':_0x25f20b['Interval']['id'],'name':_0x25f20b['Interval'][_0x8d0a('0x4a')]};}var _0x209f14=md5(JSON['stringify'](_0xc75823));if(_0x25f20b[_0x8d0a('0x3')]!==_0x209f14){_0x25f20b[_0x8d0a('0x3')]=_0x209f14;emit(util[_0x8d0a('0x7e')](_0x8d0a('0x7f'),_0xc75823[_0x8d0a('0x4a')]),_0x8d0a('0x80'),_0xc75823);}}}function emitCampaignSummary(_0x56dd5a){if(_0x56dd5a[_0x8d0a('0x56')]===_0x8d0a('0x81')){emit(util[_0x8d0a('0x7e')](_0x8d0a('0x82'),_0x56dd5a[_0x8d0a('0x4a')]),'campaign:save',_0x56dd5a);}}function checkGetDataPredictive(_0x1b00f7){if(isNotNull(_0x1b00f7)&&!_[_0x8d0a('0x83')](_0x1b00f7)){loggerPredictive[_0x8d0a('0x84')](_0x8d0a('0x85'));loggerPredictive[_0x8d0a('0x84')](_0x8d0a('0x86'),_0x1b00f7[_0x8d0a('0x87')]);loggerPredictive[_0x8d0a('0x84')](_0x8d0a('0x88'),_0x1b00f7[_0x8d0a('0x70')]);loggerPredictive[_0x8d0a('0x84')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1b00f7[_0x8d0a('0x73')]);loggerPredictive[_0x8d0a('0x84')](_0x8d0a('0x89'),_0x1b00f7[_0x8d0a('0x72')]);loggerPredictive['info'](_0x8d0a('0x8a'),_0x1b00f7[_0x8d0a('0x71')]);loggerPredictive[_0x8d0a('0x84')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1b00f7[_0x8d0a('0x8b')]);loggerPredictive[_0x8d0a('0x84')](_0x8d0a('0x8c'));if(_0x1b00f7['predictiveIntervalTotalCalls']>0x0){if(!_[_0x8d0a('0x46')](_0x1b00f7[_0x8d0a('0x8b')])&&_0x1b00f7['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x8d0a('0x84')](_0x8d0a('0x8d'));if(!_[_0x8d0a('0x46')](_0x1b00f7[_0x8d0a('0x71')])&&_0x1b00f7[_0x8d0a('0x71')]>0x0){return!![];}loggerPredictive['info'](_0x8d0a('0x8e'));}else{loggerPredictive['info'](_0x8d0a('0x8f'));}}else{loggerPredictive['info'](_0x8d0a('0x90'));}return![];}function mergeDataErlangB(_0x480e9e){return function(_0x22cd93){loggerPredictive[_0x8d0a('0x84')](_0x8d0a('0x91'));loggerPredictive[_0x8d0a('0x84')](_0x8d0a('0x92'),_0x22cd93[_0x8d0a('0x79')]);loggerPredictive[_0x8d0a('0x84')](_0x8d0a('0x93'),_0x22cd93[_0x8d0a('0x7a')]);loggerPredictive[_0x8d0a('0x84')](_0x8d0a('0x94'),_0x22cd93[_0x8d0a('0x95')]);loggerPredictive['info'](_0x8d0a('0x96'),_0x22cd93['erlangBusyFactor']);loggerPredictive[_0x8d0a('0x84')](_0x8d0a('0x94'),_0x22cd93[_0x8d0a('0x95')]);loggerPredictive[_0x8d0a('0x84')](_0x8d0a('0x8c'));_[_0x8d0a('0x97')](_0x480e9e,_0x22cd93);};}function getDiff(_0x4290d1){var _0xa39672=moment()[_0x8d0a('0x52')](0x0);var _0x466b27=moment(_0x4290d1)[_0x8d0a('0x52')](0x0);return _0xa39672[_0x8d0a('0x53')](_0x466b27,'seconds');}function ifInterval(_0x636f5d,_0x1c020e){if(_[_0x8d0a('0x46')](_0x1c020e)){return![];}return getDiff(_0x1c020e)<_0x636f5d*0x3c;}function freeVariablesPredictive(_0x5c91f4){if(isNotNull(_0x5c91f4)){if(!_['isUndefined'](_0x5c91f4[_0x8d0a('0x2c')])){_0x5c91f4[_0x8d0a('0x2c')]=undefined;loggerPredictive[_0x8d0a('0x84')](_0x5c91f4[_0x8d0a('0x4a')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x8d0a('0x46')](_0x5c91f4[_0x8d0a('0x2b')])){_0x5c91f4[_0x8d0a('0x2b')]=undefined;loggerPredictive[_0x8d0a('0x84')](_0x5c91f4[_0x8d0a('0x4a')],_0x8d0a('0x98'));}if(!_['isUndefined'](_0x5c91f4[_0x8d0a('0x99')])){clearInterval(_0x5c91f4[_0x8d0a('0x99')]);_0x5c91f4[_0x8d0a('0x99')]=undefined;loggerPredictive[_0x8d0a('0x84')](_0x5c91f4[_0x8d0a('0x4a')],_0x8d0a('0x9a'));}}}function erlangb(_0x214077,_0x53a2fe){if(_0x53a2fe===0x0){return 0x0;}var _0x20495c=0x1;for(var _0x4a152d=0x1;_0x4a152d<=_0x53a2fe;_0x4a152d+=0x1){_0x20495c=0x1+_0x20495c*_0x4a152d/_0x214077;}return 0x1/_0x20495c;}function isVoiceQueueOutbound(_0x2e24a1){return _0x2e24a1===_0x8d0a('0x57');}function isNotPreview(_0x2e480b){return _0x2e480b!==_0x8d0a('0x22');}function isCampaignIvr(_0x2c30b8){return _0x2c30b8===_0x8d0a('0x81');}function getCallerId(_0x400d5e,_0x5edfc7,_0x2f8bd5){if(!_[_0x8d0a('0x46')](_0x2f8bd5)&&typeof _0x2f8bd5===_0x8d0a('0x9b')&&!_[_0x8d0a('0x83')](_0x2f8bd5)){if(!_[_0x8d0a('0x46')](_0x5edfc7)&&typeof _0x5edfc7===_0x8d0a('0x9b')&&!_[_0x8d0a('0x83')](_0x5edfc7)){return util[_0x8d0a('0x7e')](_0x8d0a('0x9c'),_0x5edfc7,_0x2f8bd5);}return util[_0x8d0a('0x7e')](_0x8d0a('0x9c'),_0x2f8bd5,_0x2f8bd5);}if(!_['isUndefined'](_0x400d5e)&&typeof _0x400d5e===_0x8d0a('0x9b')&&!_['isEmpty'](_0x400d5e)){return _0x400d5e;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x1bf1a6,_0x231190){return function(_0x58de64){freeVariablesPredictive(_0x231190);emitVoiceQueueSummary(_0x231190);emitCampaignSummary(_0x231190);loggerSyncQueueSummary[_0x8d0a('0x9d')](_0x1bf1a6,util[_0x8d0a('0x9e')](_0x58de64,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x326ee8,_0x21d801){return function(_0x151c4f){loggerPredictive[_0x8d0a('0x9f')](_0x21d801[_0x8d0a('0x4a')],_0x326ee8);loggerPredictive['error'](_0x151c4f['stack']);freeVariablesPredictive(_0x21d801);};}function loggerCatch(_0x203200){return function(_0x522215){logger[_0x8d0a('0x9f')](_0x203200,util['inspect'](_0x522215,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x8bd0b1){return _0x8bd0b1&&!_[_0x8d0a('0x46')](_0x8bd0b1)&&_0x8bd0b1[_0x8d0a('0xa0')]>0x0;}function decremetOriginate(_0x39d6e3){if(!_[_0x8d0a('0x46')](_0x39d6e3)&&_0x39d6e3!==null){if(typeof _0x39d6e3['originated']!==_0x8d0a('0xa1')){if(_0x39d6e3['originated']>0x0){_0x39d6e3['originated']-=0x1;}else{logger[_0x8d0a('0x9f')](_0x8d0a('0xa2'));}}}else{logger['error']('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x54327a,_0x1256e2,_0x1fd9c8){if(_0x1256e2>_0x1fd9c8){for(var _0x497979=0x0;_0x497979<_0x1256e2-_0x1fd9c8;_0x497979+=0x1){decremetOriginate(_0x54327a);}}}function loggerGetContactDialer(_0x2be072,_0x378260,_0x1a5a8b){return function(_0x5d9593){checkContactLowerLimitOriginate(_0x378260,_0x1a5a8b,0x0);logger[_0x8d0a('0x9f')](_0x2be072,util[_0x8d0a('0x9e')](_0x5d9593,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5a3342){return function(_0x3cb60b){if(isNotNull(_0x3cb60b)&&isNotNull(_0x3cb60b[0x0])){if(_0x3cb60b[0x0][_0x8d0a('0xa3')]>0x0){_0x5a3342[_0x8d0a('0x47')]=_0x8d0a('0xa4');logger['info'](_0x8d0a('0xa5')+_0x5a3342[_0x8d0a('0x4a')],_0x3cb60b[0x0][_0x8d0a('0xa3')],_0x8d0a('0xa6'));}else{_0x5a3342['message']=_0x8d0a('0xa7');logger[_0x8d0a('0x84')](_0x8d0a('0xa8')+_0x5a3342[_0x8d0a('0x4a')]);}}};}function notSendMessagesQueue(_0x22aaf3){if(_0x22aaf3[_0x8d0a('0xa9')]){freeVariablesPredictive(_0x22aaf3);if(_0x22aaf3[_0x8d0a('0x78')]===0x0&&_0x22aaf3[_0x8d0a('0x5f')]===0x0&&_0x22aaf3['waiting']===0x0&&(_0x22aaf3[_0x8d0a('0x5b')]||0x0)===0x0){_0x22aaf3[_0x8d0a('0xa9')]=![];_0x22aaf3[_0x8d0a('0xaa')]=0x0;_0x22aaf3[_0x8d0a('0x47')]=_0x8d0a('0xab');loggerSyncQueueSummary[_0x8d0a('0x9d')](_0x8d0a('0xac'),_0x22aaf3[_0x8d0a('0x4a')],_0x8d0a('0xad'));}else{_0x22aaf3[_0x8d0a('0x47')]=_0x8d0a('0xae');loggerSyncQueueSummary[_0x8d0a('0x9d')](_0x8d0a('0xac'),_0x22aaf3[_0x8d0a('0x4a')],'is\x20disactive');}emitVoiceQueueSummary(_0x22aaf3);}}function notSendMessagesCampaign(_0x1f4778){if(_0x1f4778['sendMessageOneNotActive']){if(_0x1f4778[_0x8d0a('0x78')]===0x0){_0x1f4778['sendMessageOneNotActive']=![];_0x1f4778['message']=_0x8d0a('0xab');loggerSyncQueueSummary['debug'](_0x8d0a('0xaf'),_0x1f4778['name'],_0x8d0a('0xad'));}else{_0x1f4778[_0x8d0a('0x47')]=_0x8d0a('0xae');loggerSyncQueueSummary[_0x8d0a('0x9d')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x1f4778[_0x8d0a('0x4a')],_0x8d0a('0xb0'));}emitCampaignSummary(_0x1f4778);}}function createObjHistory(_0x52372c,_0x543459,_0x5e8331,_0x14a1fb,_0x542d63){_0x52372c[_0x8d0a('0x47')]=_0x5e8331;var _0x3d1587=new Action(_0x52372c,_0x543459);var _0x10db77=new History(_0x3d1587);_0x10db77[_0x8d0a('0xb1')]=_0x14a1fb;_0x10db77[_0x8d0a('0xb2')]=_0x542d63;_0x10db77['endtime']=_0x3d1587[_0x8d0a('0xb3')];return _0x10db77;}Dialer['prototype']['loopClearZombieChannels']=function(){var _0x596f81=this;setInterval(function(){_0x596f81[_0x8d0a('0xb4')](_0x596f81[_0x8d0a('0x2a')],_0x8d0a('0xb5'));_0x596f81[_0x8d0a('0xb4')](_0x596f81[_0x8d0a('0x28')],_0x8d0a('0xb6'));},0x32c8);};Dialer[_0x8d0a('0x1d')][_0x8d0a('0xb4')]=function(_0x186f8e,_0x2387ff){var _0x451ea6=this;for(var _0x2c950d in _0x186f8e){if(typeof _0x186f8e[_0x2c950d]!==_0x8d0a('0xa1')){this[_0x8d0a('0x21')][_0x8d0a('0x1e')](function(){if(!_[_0x8d0a('0xb7')](_0x186f8e[_0x2c950d])){return ami[_0x8d0a('0xb8')]({'action':_0x8d0a('0xb9'),'channel':_0x186f8e[_0x2c950d][_0x8d0a('0xba')]})['catch'](function(_0x4858bc){if(_0x4858bc[_0x8d0a('0x47')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x186f8e[_0x2c950d]&&_0x186f8e[_0x2c950d][_0x8d0a('0x56')]!==_0x8d0a('0x81')){_0x451ea6['updateOriginated'](_0x451ea6[_0x8d0a('0x23')][_0x186f8e[_0x2c950d][_0x8d0a('0xbb')]]);logger[_0x8d0a('0x9f')]('[Dialer][checkChannel]',_0x2387ff,_0x2c950d,_0x186f8e[_0x2c950d][_0x8d0a('0xbb')]);delete _0x186f8e[_0x2c950d];}if(_0x186f8e[_0x2c950d]&&_0x186f8e[_0x2c950d][_0x8d0a('0x56')]===_0x8d0a('0x81')){_0x451ea6[_0x8d0a('0xbc')](_0x451ea6[_0x8d0a('0x24')][_0x186f8e[_0x2c950d][_0x8d0a('0xbb')]]);logger[_0x8d0a('0x9f')](_0x8d0a('0xbd'),_0x2387ff,_0x2c950d,_0x186f8e[_0x2c950d][_0x8d0a('0xbb')]);delete _0x186f8e[_0x2c950d];}},0x2328);}});}});}}};Dialer[_0x8d0a('0x1d')][_0x8d0a('0xbe')]=function(_0x178a0f){return Promise[_0x8d0a('0xbf')]()['then'](cmHopper['countReScheduled'](_0x178a0f))[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0xc1')));};Dialer[_0x8d0a('0x1d')]['checkIsBlackList']=function(_0x179c58){return Promise['resolve']()[_0x8d0a('0xc2')](cmHopperBlack[_0x8d0a('0xc3')](_0x179c58))[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0xc4')));};Dialer[_0x8d0a('0x1d')][_0x8d0a('0xc5')]=function(_0x5151ac,_0x14d426,_0x260de4){return Promise[_0x8d0a('0xbf')]()[_0x8d0a('0xc2')](cmHopperAdditionalPhone[_0x8d0a('0xc5')](_0x5151ac,_0x14d426,_0x260de4))[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0xc6')));};Dialer['prototype'][_0x8d0a('0xc7')]=function(_0x1853a4,_0x40673f,_0x5d71c5){return Promise[_0x8d0a('0xbf')]()[_0x8d0a('0xc2')](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x1853a4,_0x40673f,_0x5d71c5))[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0xc8')));};Dialer[_0x8d0a('0x1d')][_0x8d0a('0xc9')]=function(_0x5b4a7e){return Promise[_0x8d0a('0xbf')]()['then'](cmHopperBlack[_0x8d0a('0xc9')](_0x5b4a7e))[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0xca')));};Dialer[_0x8d0a('0x1d')][_0x8d0a('0xcb')]=function(_0x438e06){return Promise['resolve']()[_0x8d0a('0xc2')](cmHopperHistory[_0x8d0a('0xcc')](_0x438e06))[_0x8d0a('0xc0')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x8d0a('0x1d')][_0x8d0a('0xcd')]=function(_0x124e85){return Promise[_0x8d0a('0xbf')]()[_0x8d0a('0xc2')](cmHopper[_0x8d0a('0xcd')](_0x124e85))[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0xce')));};Dialer[_0x8d0a('0x1d')][_0x8d0a('0xcf')]=function(_0x30931c,_0x1257d3,_0x3b4ac5){return Promise[_0x8d0a('0xbf')]()['then'](cmHopper[_0x8d0a('0xcf')](_0x30931c,_0x1257d3,_0x3b4ac5))[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0xd0')));};Dialer[_0x8d0a('0x1d')]['getContactDialer']=function(_0x3274c6,_0x3b3410,_0x5ea1d4,_0x3512ef,_0x15dfd1){return Promise[_0x8d0a('0xbf')]()[_0x8d0a('0xc2')](cmHopper['getContactDialer'](_0x3274c6,_0x3b3410,_0x5ea1d4,_0x3512ef))[_0x8d0a('0xc0')](function(_0x3ad6f4){_0x15dfd1['temp']-=_0x5ea1d4;_0x15dfd1[_0x8d0a('0xd1')]=_0x15dfd1[_0x8d0a('0xd1')]>0x0?_0x15dfd1['temp']:0x0;loggerCatch(_0x8d0a('0xd2'))(_0x3ad6f4);});};Dialer[_0x8d0a('0x1d')]['getContactDialerIvr']=function(_0x508dfd,_0x52215d,_0x1aebf3,_0x4296e2){return Promise[_0x8d0a('0xbf')]()['then'](cmHopper[_0x8d0a('0xd3')](_0x508dfd,_0x52215d,_0x1aebf3))[_0x8d0a('0xc0')](function(_0x10eb29){_0x4296e2['temp']-=_0x52215d;_0x4296e2['temp']=_0x4296e2[_0x8d0a('0xd1')]>0x0?_0x4296e2['temp']:0x0;loggerCatch(_0x8d0a('0xd4'))(_0x10eb29);});};Dialer[_0x8d0a('0x1d')][_0x8d0a('0xd5')]=function(_0x138191){return Promise[_0x8d0a('0xbf')]()['then'](voiceQueueRt[_0x8d0a('0xd5')](_0x138191))[_0x8d0a('0xc0')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x8d0a('0x1d')][_0x8d0a('0xd6')]=function(_0x3b8571){return Promise[_0x8d0a('0xbf')]()[_0x8d0a('0xc2')](cmHopper['moveContactManagedDialer'](_0x3b8571))[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0xd7')));};Dialer[_0x8d0a('0x1d')][_0x8d0a('0xd8')]=function(_0x2ade0e){return Promise[_0x8d0a('0xbf')]()['then'](cmHopperHistory[_0x8d0a('0xd8')](_0x2ade0e))['catch'](loggerCatch(_0x8d0a('0xd9')));};Dialer[_0x8d0a('0x1d')][_0x8d0a('0xbc')]=function(_0x4ddb46){if(!_[_0x8d0a('0x46')](_0x4ddb46)&&_0x4ddb46!==null){if(typeof _0x4ddb46[_0x8d0a('0x78')]!==_0x8d0a('0xa1')){if(_0x4ddb46[_0x8d0a('0x78')]>0x0){_0x4ddb46['originated']-=0x1;}else{logger[_0x8d0a('0x9f')](_0x8d0a('0xda'));}}}else{logger[_0x8d0a('0x9f')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype'][_0x8d0a('0xdb')]=function(_0x5a2357,_0x47490a){var _0x4e3cba=this;return function(_0x52e209){_0x4e3cba['updateOriginated'](_0x47490a);logger[_0x8d0a('0x9f')](_0x5a2357,util['inspect'](_0x52e209,{'showHidden':![],'depth':null}));};};Dialer[_0x8d0a('0x1d')][_0x8d0a('0xdc')]=function(_0x1b7285,_0x4523ce,_0x2f61bb){var _0x44aa1f={'state':0x19,'statedesc':'notFound'};this[_0x8d0a('0xbc')](_0x4523ce);this[_0x8d0a('0xdd')](_[_0x8d0a('0x97')](_0x44aa1f,_['pick'](_0x2f61bb,['ContactId',_0x8d0a('0xde'),_0x8d0a('0xdf'),_0x8d0a('0xe0'),_0x8d0a('0xe1')])),_0x8d0a('0xe2'),_0x8d0a('0xe3'));logger['error'](_0x1b7285);};Dialer[_0x8d0a('0x1d')][_0x8d0a('0xe4')]=function(_0x4274c8){return _0x4274c8===_0x8d0a('0xe5');};Dialer[_0x8d0a('0x1d')][_0x8d0a('0xe6')]=function(_0x3e9edf){return!_[_0x8d0a('0x46')](_0x3e9edf)&&_0x3e9edf&&!_[_0x8d0a('0x46')](_0x3e9edf[_0x8d0a('0x4a')])&&!_[_0x8d0a('0x46')](_0x3e9edf[_0x8d0a('0x7d')])&&_0x3e9edf[_0x8d0a('0x7d')]&&(this[_0x8d0a('0x26')][util[_0x8d0a('0x7e')](_0x8d0a('0xe7'),_0x3e9edf['name'])][_0x8d0a('0xb9')]==='reachable'||this[_0x8d0a('0x26')][util[_0x8d0a('0x7e')](_0x8d0a('0xe7'),_0x3e9edf[_0x8d0a('0x4a')])][_0x8d0a('0xb9')]===_0x8d0a('0xe8'));};Dialer['prototype'][_0x8d0a('0xdd')]=function(_0x5c14ec,_0x492aef,_0x26f08a){this[_0x8d0a('0xd8')](_0x5c14ec)[_0x8d0a('0xc0')](loggerCatch(_0x492aef));this[_0x8d0a('0xd6')](_0x5c14ec)['catch'](loggerCatch(_0x26f08a));};Dialer[_0x8d0a('0x1d')]['syncVarSet']=function(_0x2e875a){var _0x3fe7ca=this;var _0x4df8dd=this[_0x8d0a('0x2a')][_0x2e875a['uniqueid']];var _0x1c97b8;if(!_['isNil'](_0x2e875a)&&!_['isNil'](_0x2e875a[_0x8d0a('0xe9')])&&!_['isNil'](_0x2e875a[_0x8d0a('0xe9')][_0x8d0a('0xea')])&&_0x2e875a[_0x8d0a('0xeb')]==='xcally-motion-dialer'&&_0x4df8dd){if(_0x4df8dd['type']!==_0x8d0a('0x81')&&this[_0x8d0a('0x23')][_0x4df8dd['queue']][_0x8d0a('0xec')]&&_0x2e875a[_0x8d0a('0xed')]===_0x8d0a('0xee')){delete this[_0x8d0a('0x2a')][_0x2e875a[_0x8d0a('0xef')]];this[_0x8d0a('0xbc')](this['voiceQueues'][_0x4df8dd[_0x8d0a('0xbb')]]);this['voiceQueues'][_0x4df8dd['queue']][_0x8d0a('0x68')]+=0x1;this['voiceQueues'][_0x4df8dd[_0x8d0a('0xbb')]]['outboundAnswerAgiCallsDay']+=0x1;_0x1c97b8=new Hangup(_0x4df8dd,_0x2e875a);_0x1c97b8[_0x8d0a('0xb1')]=0x12;_0x1c97b8[_0x8d0a('0xb2')]=_0x8d0a('0xf0');_0x1c97b8[_0x8d0a('0xf1')]=_0x8d0a('0xf2');ami[_0x8d0a('0x55')](_0x8d0a('0xf3'),ut[_0x8d0a('0xf4')](_0x1c97b8,_0x8d0a('0xf5')));this['saveInDb'](_0x1c97b8,_0x8d0a('0xf6'),_0x8d0a('0xf7'));}if(_0x4df8dd[_0x8d0a('0x56')]!=='ivr'&&this[_0x8d0a('0x23')][_0x4df8dd[_0x8d0a('0xbb')]][_0x8d0a('0xec')]&&_0x2e875a[_0x8d0a('0xed')]==='MACHINE'){return new Promise(function(_0x52b58b,_0x3718a0){delete _0x3fe7ca[_0x8d0a('0x2a')][_0x2e875a[_0x8d0a('0xef')]];_0x3fe7ca[_0x8d0a('0xbc')](_0x3fe7ca[_0x8d0a('0x23')][_0x4df8dd['queue']]);_0x3fe7ca[_0x8d0a('0x23')][_0x4df8dd[_0x8d0a('0xbb')]][_0x8d0a('0x68')]+=0x1;_0x3fe7ca[_0x8d0a('0x23')][_0x4df8dd[_0x8d0a('0xbb')]][_0x8d0a('0xf8')]+=0x1;var _0x3f74d0=_0x3fe7ca[_0x8d0a('0x23')][_0x4df8dd[_0x8d0a('0xbb')]];var _0xf268fe=new Hangup(_0x4df8dd,_0x2e875a);_0xf268fe[_0x8d0a('0xb1')]=0x13;_0xf268fe[_0x8d0a('0xb2')]=_0x8d0a('0xf9');_0xf268fe[_0x8d0a('0xf1')]=_0x8d0a('0xf2');_0xf268fe['countmachineretry']+=0x1;_0xf268fe[_0x8d0a('0xfa')]+=0x1;_0xf268fe[_0x8d0a('0xf5')]=!![];ami['emit'](_0x8d0a('0xf3'),ut[_0x8d0a('0xf4')](_0xf268fe,'amd'));_0x3fe7ca[_0x8d0a('0xd8')](_0xf268fe)[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0xfb')));if(_0xf268fe[_0x8d0a('0xfc')]+_0xf268fe[_0x8d0a('0xfd')]+_0xf268fe[_0x8d0a('0xfe')]+_0xf268fe[_0x8d0a('0xff')]+_0xf268fe['countdropretry']+_0xf268fe[_0x8d0a('0x100')]+_0xf268fe[_0x8d0a('0x101')]+_0xf268fe['countagentrejectretry']>=_0x3f74d0['dialGlobalMaxRetry']){_0x3fe7ca[_0x8d0a('0x102')](_0xf268fe,_0x52b58b,_0x3718a0,'reason19\x20machine....');}else{if(_0xf268fe[_0x8d0a('0x101')]>=_0x3f74d0[_0x8d0a('0x103')]){_0x3fe7ca[_0x8d0a('0x104')](_0xf268fe,_0x52b58b,_0x3718a0,_0x8d0a('0x105'));}else{_0x3fe7ca[_0x8d0a('0xcd')]({'active':![],'countmachineretry':_0xf268fe['countmachineretry'],'scheduledat':moment()[_0x8d0a('0x106')](_0x3f74d0[_0x8d0a('0x107')],_0x8d0a('0x108'))[_0x8d0a('0x7e')](_0x8d0a('0x109')),'ContactId':_0xf268fe[_0x8d0a('0x10a')],'ListId':_0xf268fe[_0x8d0a('0xde')],'VoiceQueueId':_0xf268fe[_0x8d0a('0xe0')]||undefined,'CampaignId':_0xf268fe['CampaignId']||undefined})[_0x8d0a('0xc0')](loggerCatch('[rescheduleContact][Machine]'));_0x52b58b({'reschedule':0x1});}}});}if(_0x4df8dd[_0x8d0a('0x56')]===_0x8d0a('0x81')&&this[_0x8d0a('0x24')][_0x4df8dd['queue']]['dialAMDActive']&&_0x2e875a[_0x8d0a('0xed')]==='HANGUP'){delete this[_0x8d0a('0x2a')][_0x2e875a['uniqueid']];this[_0x8d0a('0xbc')](this[_0x8d0a('0x24')][_0x4df8dd['queue']]);_0x1c97b8=new Hangup(_0x4df8dd,_0x2e875a);_0x1c97b8[_0x8d0a('0xb1')]=0x12;_0x1c97b8[_0x8d0a('0xb2')]=_0x8d0a('0xf0');_0x1c97b8['membername']=_0x8d0a('0xf2');ami[_0x8d0a('0x55')](_0x8d0a('0xf3'),ut['buildObj'](_0x1c97b8,_0x8d0a('0xf5')));this[_0x8d0a('0xdd')](_0x1c97b8,_0x8d0a('0x10b'),_0x8d0a('0x10c'));}if(_0x4df8dd['type']===_0x8d0a('0x81')&&this['campaigns'][_0x4df8dd[_0x8d0a('0xbb')]][_0x8d0a('0xec')]&&_0x2e875a[_0x8d0a('0xed')]==='MACHINE'){return new Promise(function(_0x2bda65,_0x375607){delete _0x3fe7ca['uniqueId'][_0x2e875a[_0x8d0a('0xef')]];_0x3fe7ca[_0x8d0a('0xbc')](_0x3fe7ca['campaigns'][_0x4df8dd['queue']]);_0x3fe7ca[_0x8d0a('0x24')][_0x4df8dd[_0x8d0a('0xbb')]][_0x8d0a('0x68')]+=0x1;_0x3fe7ca[_0x8d0a('0x24')][_0x4df8dd[_0x8d0a('0xbb')]][_0x8d0a('0xf8')]+=0x1;var _0x591ae1=_0x3fe7ca[_0x8d0a('0x24')][_0x4df8dd[_0x8d0a('0xbb')]];var _0x982d8b=new Hangup(_0x4df8dd,_0x2e875a);_0x982d8b[_0x8d0a('0xb1')]=0x13;_0x982d8b[_0x8d0a('0xb2')]='Machine';_0x982d8b['membername']=_0x8d0a('0xf2');_0x982d8b[_0x8d0a('0x101')]+=0x1;_0x982d8b[_0x8d0a('0xfa')]+=0x1;_0x982d8b[_0x8d0a('0xf5')]=!![];ami[_0x8d0a('0x55')](_0x8d0a('0xf3'),ut[_0x8d0a('0xf4')](_0x982d8b,'amd'));_0x3fe7ca[_0x8d0a('0xd8')](_0x982d8b)[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0xfb')));if(_0x982d8b[_0x8d0a('0xfc')]+_0x982d8b[_0x8d0a('0xfd')]+_0x982d8b[_0x8d0a('0xfe')]+_0x982d8b[_0x8d0a('0xff')]+_0x982d8b[_0x8d0a('0x10d')]+_0x982d8b[_0x8d0a('0x100')]+_0x982d8b['countmachineretry']+_0x982d8b[_0x8d0a('0x10e')]>=_0x591ae1[_0x8d0a('0x10f')]){_0x3fe7ca['stateGlobal'](_0x982d8b,_0x2bda65,_0x375607,_0x8d0a('0x110'));}else{if(_0x982d8b[_0x8d0a('0x101')]>=_0x591ae1[_0x8d0a('0x103')]){_0x3fe7ca[_0x8d0a('0x104')](_0x982d8b,_0x2bda65,_0x375607,_0x8d0a('0x105'));}else{_0x3fe7ca[_0x8d0a('0xcd')]({'active':![],'countmachineretry':_0x982d8b[_0x8d0a('0x101')],'scheduledat':moment()['add'](_0x591ae1[_0x8d0a('0x107')],'minutes')[_0x8d0a('0x7e')](_0x8d0a('0x109')),'ContactId':_0x982d8b['ContactId'],'ListId':_0x982d8b[_0x8d0a('0xde')],'VoiceQueueId':_0x982d8b[_0x8d0a('0xe0')]||undefined,'CampaignId':_0x982d8b[_0x8d0a('0xe1')]||undefined})[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0x111')));_0x2bda65({'reschedule':0x1});}}});}}};Dialer[_0x8d0a('0x1d')][_0x8d0a('0x3a')]=function(_0x4efdfb){var _0x164d16=this[_0x8d0a('0x2a')][_0x4efdfb[_0x8d0a('0xef')]];var _0x1a92cb;if(_0x164d16&&_0x164d16[_0x8d0a('0x56')]==='ivr'){delete this['uniqueId'][_0x4efdfb['uniqueid']];this[_0x8d0a('0xbc')](this[_0x8d0a('0x24')][_0x164d16[_0x8d0a('0xbb')]]);this[_0x8d0a('0x24')][_0x164d16[_0x8d0a('0xbb')]][_0x8d0a('0x112')]+=0x1;_0x1a92cb=new Hangup(_0x164d16,_0x4efdfb);this[_0x8d0a('0xd8')](_0x1a92cb)['catch'](loggerCatch(_0x8d0a('0x113')));this[_0x8d0a('0xd6')](_0x1a92cb)[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0x114')));}if(_0x164d16&&_0x164d16[_0x8d0a('0x56')]!=='ivr'&&isNotNull(this[_0x8d0a('0x23')][_0x164d16[_0x8d0a('0xbb')]][_0x8d0a('0x115')])){delete this[_0x8d0a('0x2a')][_0x4efdfb[_0x8d0a('0xef')]];this[_0x8d0a('0xbc')](this[_0x8d0a('0x23')][_0x164d16[_0x8d0a('0xbb')]]);this[_0x8d0a('0x23')][_0x164d16[_0x8d0a('0xbb')]][_0x8d0a('0x68')]+=0x1;this[_0x8d0a('0x23')][_0x164d16[_0x8d0a('0xbb')]][_0x8d0a('0xf8')]+=0x1;_0x1a92cb=new Hangup(_0x164d16,_0x4efdfb);_0x1a92cb[_0x8d0a('0xb1')]=0x10;_0x1a92cb[_0x8d0a('0xb2')]='AnswerAGI';_0x1a92cb['membername']=_0x8d0a('0x116');this['createHistory'](_0x1a92cb)['catch'](loggerCatch(_0x8d0a('0x113')));this[_0x8d0a('0xd6')](_0x1a92cb)['catch'](loggerCatch(_0x8d0a('0x114')));}if(_0x164d16&&_0x164d16['type']!==_0x8d0a('0x81')&&!isNotNull(this[_0x8d0a('0x23')][_0x164d16[_0x8d0a('0xbb')]][_0x8d0a('0x115')])){delete this[_0x8d0a('0x2a')][_0x4efdfb[_0x8d0a('0xef')]];this[_0x8d0a('0xbc')](this[_0x8d0a('0x23')][_0x164d16[_0x8d0a('0xbb')]]);this[_0x8d0a('0x23')][_0x164d16[_0x8d0a('0xbb')]][_0x8d0a('0x117')]+=0x1;_0x1a92cb=new Hangup(_0x164d16,_0x4efdfb);_0x1a92cb[_0x8d0a('0xb1')]=0xc;_0x1a92cb[_0x8d0a('0xb2')]=_0x4efdfb[_0x8d0a('0x118')];_0x1a92cb[_0x8d0a('0xf1')]=_0x8d0a('0x119');this[_0x8d0a('0xd8')](_0x1a92cb)[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0x113')));this[_0x8d0a('0xd6')](_0x1a92cb)['catch'](loggerCatch(_0x8d0a('0x114')));}};Dialer[_0x8d0a('0x1d')][_0x8d0a('0x35')]=function(_0x351a6d){var _0x5d2acb=this[_0x8d0a('0x2a')][_0x351a6d[_0x8d0a('0xef')]];if(this[_0x8d0a('0x23')][_0x351a6d[_0x8d0a('0xbb')]]){if(_0x5d2acb&&_0x5d2acb[_0x8d0a('0x56')]!==_0x8d0a('0x81')){delete this[_0x8d0a('0x2a')][_0x351a6d[_0x8d0a('0xef')]];this['voiceQueues'][_0x351a6d[_0x8d0a('0xbb')]][_0x8d0a('0x68')]+=0x1;var _0x15176d=new AgentComplete(_0x5d2acb,_0x351a6d);if(_0x351a6d['reason']===_0x8d0a('0x11a')){_0x15176d[_0x8d0a('0x11b')]=this['voiceQueues'][_0x351a6d[_0x8d0a('0xbb')]]['dialQueueProject2']&&this['voiceQueues'][_0x351a6d[_0x8d0a('0xbb')]][_0x8d0a('0x11c')]?moment()[_0x8d0a('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x8d0a('0xd8')](_0x15176d)[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0x11d')));this[_0x8d0a('0xd6')](_0x15176d)[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0x11e')));}}};Dialer[_0x8d0a('0x1d')]['syncAgentConnect']=function(_0x217e6a){if(this[_0x8d0a('0x23')][_0x217e6a[_0x8d0a('0xbb')]]){if(this[_0x8d0a('0x2a')][_0x217e6a[_0x8d0a('0xef')]]&&this['uniqueId'][_0x217e6a[_0x8d0a('0xef')]]['type']!=='ivr'){this[_0x8d0a('0xbc')](this[_0x8d0a('0x23')][_0x217e6a['queue']]);this['uniqueId'][_0x217e6a['uniqueid']][_0x8d0a('0x11f')]=moment()[_0x8d0a('0x7e')](_0x8d0a('0x109'));}}};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x40e47f,_0x4cef04){this[_0x8d0a('0xd8')](_0x40e47f)['catch'](loggerCatch(_0x8d0a('0x11d')));if(_0x4cef04==0x0){this['moveContactManagedDialer'](_0x40e47f)[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0x120')));}};Dialer[_0x8d0a('0x1d')][_0x8d0a('0x31')]=function(_0x31f3e0){var _0x2122fe=this[_0x8d0a('0x2a')][_0x31f3e0[_0x8d0a('0xef')]];var _0x3543cb=this;var _0x24158c=![];var _0x3b659e;var _0x16328d;if(this[_0x8d0a('0x23')][_0x31f3e0[_0x8d0a('0xbb')]]){if(_0x2122fe&&_0x2122fe[_0x8d0a('0x56')]!==_0x8d0a('0x81')){delete this[_0x8d0a('0x2a')][_0x31f3e0[_0x8d0a('0xef')]];this[_0x8d0a('0xbc')](this[_0x8d0a('0x23')][_0x31f3e0[_0x8d0a('0xbb')]]);_0x2122fe['droptime']=moment()[_0x8d0a('0x7e')](_0x8d0a('0x109'));var _0x21ddfd=new QueueCallerAbandon(_0x2122fe,_0x31f3e0);if(getSeconds(_0x2122fe[_0x8d0a('0x121')],_0x2122fe[_0x8d0a('0x122')])>=_0x2122fe[_0x8d0a('0x123')]){this[_0x8d0a('0x23')][_0x31f3e0[_0x8d0a('0xbb')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x8d0a('0x23')][_0x31f3e0[_0x8d0a('0xbb')]][_0x8d0a('0x124')]+=0x1;this[_0x8d0a('0x23')][_0x31f3e0[_0x8d0a('0xbb')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x21ddfd[_0x8d0a('0xb1')]=0xa;_0x21ddfd[_0x8d0a('0xb2')]='Drop';_0x21ddfd[_0x8d0a('0x125')]=_0x8d0a('0x126');_0x21ddfd[_0x8d0a('0x11b')]=this[_0x8d0a('0x23')][_0x31f3e0[_0x8d0a('0xbb')]]['dialQueueProject2']?moment()[_0x8d0a('0x7e')](_0x8d0a('0x109')):undefined;_0x21ddfd[_0x8d0a('0x10d')]+=0x1;_0x21ddfd[_0x8d0a('0xfa')]+=0x1;_0x3b659e=this[_0x8d0a('0x23')][_0x31f3e0[_0x8d0a('0xbb')]][_0x8d0a('0x127')];_0x16328d=this[_0x8d0a('0x23')][_0x31f3e0[_0x8d0a('0xbb')]]['callAdditionalPhoneAfterMin'];_0x3543cb[_0x8d0a('0xc5')](_0x21ddfd,_0x21ddfd['state'],_0x2122fe[_0x8d0a('0x128')])[_0x8d0a('0xc2')](function(_0x1bc5dd){_0x24158c=_0x1bc5dd[_0x8d0a('0x129')]==0x1;if(_0x21ddfd[_0x8d0a('0x10d')]>=_0x3543cb[_0x8d0a('0x23')][_0x31f3e0['queue']][_0x8d0a('0x12a')]){_0x3543cb['queueCallerAbandonCreateState'](_0x21ddfd,_0x1bc5dd[_0x8d0a('0x129')]);}else{_0x3543cb['rescheduleContact']({'active':![],'countdropretry':_0x21ddfd[_0x8d0a('0x10d')],'scheduledat':moment()['add'](_0x3543cb[_0x8d0a('0x23')][_0x31f3e0[_0x8d0a('0xbb')]][_0x8d0a('0x127')],'minutes')[_0x8d0a('0x7e')](_0x8d0a('0x109')),'ContactId':_0x2122fe[_0x8d0a('0x10a')],'ListId':_0x2122fe[_0x8d0a('0xde')],'VoiceQueueId':_0x2122fe[_0x8d0a('0xe0')]||undefined,'CampaignId':_0x2122fe[_0x8d0a('0xe1')]||undefined})[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0x12b')));var _0x2d78b2=new History(_0x21ddfd);_0x2d78b2[_0x8d0a('0xb1')]=0xa;_0x2d78b2[_0x8d0a('0xb2')]='Drop';_0x2d78b2[_0x8d0a('0xb3')]=moment()[_0x8d0a('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');_0x2d78b2[_0x8d0a('0x12c')]=_0x2d78b2['starttime'];_0x2d78b2[_0x8d0a('0x12d')]=_0x21ddfd[_0x8d0a('0x12d')];_0x2d78b2[_0x8d0a('0x12e')]=_0x21ddfd[_0x8d0a('0x12e')];_0x3543cb[_0x8d0a('0xd8')](_0x2d78b2)[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0x12f')));}})['then'](function(){if(_0x24158c)_0x3543cb[_0x8d0a('0xc7')](_0x21ddfd,_0x3b659e,_0x16328d)[_0x8d0a('0xc2')](function(){return 0x1;});});}else{this[_0x8d0a('0x23')][_0x31f3e0['queue']][_0x8d0a('0x72')]+=0x1;this[_0x8d0a('0x23')][_0x31f3e0[_0x8d0a('0xbb')]][_0x8d0a('0x130')]+=0x1;_0x21ddfd[_0x8d0a('0xb1')]=0xb;_0x21ddfd['statedesc']=_0x8d0a('0x131');_0x21ddfd['dropreason']=_0x8d0a('0x132');_0x21ddfd[_0x8d0a('0x100')]+=0x1;_0x21ddfd['countglobal']+=0x1;_0x3b659e=this[_0x8d0a('0x23')][_0x31f3e0[_0x8d0a('0xbb')]][_0x8d0a('0x133')];_0x16328d=this[_0x8d0a('0x23')][_0x31f3e0[_0x8d0a('0xbb')]][_0x8d0a('0x134')];_0x3543cb['verifyAdditionalPhones'](_0x21ddfd,_0x21ddfd[_0x8d0a('0xb1')],_0x2122fe[_0x8d0a('0x128')])['then'](function(_0x58268a){if(_0x21ddfd[_0x8d0a('0x100')]>=_0x3543cb[_0x8d0a('0x23')][_0x31f3e0[_0x8d0a('0xbb')]][_0x8d0a('0x135')]){_0x3543cb['queueCallerAbandonCreateState'](_0x21ddfd,_0x58268a[_0x8d0a('0x129')]);}else{_0x3543cb[_0x8d0a('0xcd')]({'active':![],'countabandonedretry':_0x21ddfd[_0x8d0a('0x100')],'scheduledat':moment()[_0x8d0a('0x106')](_0x3543cb['voiceQueues'][_0x31f3e0[_0x8d0a('0xbb')]]['dialAbandonedRetryFrequency'],_0x8d0a('0x108'))['format'](_0x8d0a('0x109')),'ContactId':_0x2122fe[_0x8d0a('0x10a')],'ListId':_0x2122fe[_0x8d0a('0xde')],'VoiceQueueId':_0x2122fe[_0x8d0a('0xe0')]||undefined,'CampaignId':_0x2122fe[_0x8d0a('0xe1')]||undefined})[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0x136')));var _0x49dd26=new History(_0x21ddfd);_0x49dd26[_0x8d0a('0xb1')]=0xb;_0x49dd26[_0x8d0a('0xb2')]=_0x8d0a('0x131');_0x49dd26[_0x8d0a('0xb3')]=moment()['format'](_0x8d0a('0x109'));_0x49dd26[_0x8d0a('0x12c')]=_0x49dd26[_0x8d0a('0xb3')];_0x49dd26['calleridname']=_0x21ddfd[_0x8d0a('0x12d')];_0x49dd26[_0x8d0a('0x12e')]=_0x21ddfd[_0x8d0a('0x12e')];_0x3543cb['createHistory'](_0x49dd26)[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0x137')));}})[_0x8d0a('0xc2')](function(){if(_0x24158c)_0x3543cb[_0x8d0a('0xc7')](_0x21ddfd,_0x3b659e,_0x16328d)[_0x8d0a('0xc2')](function(){return 0x1;});});}}}};Dialer[_0x8d0a('0x1d')][_0x8d0a('0x138')]=function(_0x4feb0e){if(this[_0x8d0a('0x28')][_0x4feb0e[_0x8d0a('0xef')]]){this[_0x8d0a('0x28')][_0x4feb0e[_0x8d0a('0xef')]][_0x8d0a('0xba')]=_0x4feb0e[_0x8d0a('0xba')];}if(this['uniqueId'][_0x4feb0e['uniqueid']]){this[_0x8d0a('0x2a')][_0x4feb0e[_0x8d0a('0xef')]]['channel']=_0x4feb0e[_0x8d0a('0xba')];}};Dialer[_0x8d0a('0x1d')][_0x8d0a('0x3f')]=function(_0x50c018){if(!this[_0x8d0a('0x28')][_0x50c018[_0x8d0a('0x139')]]){return;}if(strategy[this[_0x8d0a('0x23')][this['actions'][_0x50c018['actionid']]['queue']][_0x8d0a('0x58')]]===_0x8d0a('0x13a')){if(this['actions'][_0x50c018[_0x8d0a('0x139')]]&&_['isNil'](this[_0x8d0a('0x28')][_0x50c018[_0x8d0a('0x139')]]['locked'])&&_0x50c018[_0x8d0a('0xb9')]==='1'&&_0x50c018[_0x8d0a('0x13b')]==='0'){if(this[_0x8d0a('0x25')][_0x50c018[_0x8d0a('0x13c')]]){if(!this[_0x8d0a('0x25')][_0x50c018[_0x8d0a('0x13c')]][_0x8d0a('0x13d')]){this[_0x8d0a('0x25')][_0x50c018[_0x8d0a('0x13c')]]['locked']=!![];this[_0x8d0a('0x28')][_0x50c018[_0x8d0a('0x139')]]['locked']=!![];this[_0x8d0a('0x28')][_0x50c018[_0x8d0a('0x139')]][_0x8d0a('0x13c')]=_0x50c018[_0x8d0a('0x13c')];}}}}else if((strategy[this[_0x8d0a('0x23')][this['actions'][_0x50c018['actionid']]['queue']][_0x8d0a('0x58')]]||_0x8d0a('0x1c'))===_0x8d0a('0x1c')){if(this['actions'][_0x50c018[_0x8d0a('0x139')]]){if(this[_0x8d0a('0x25')][_0x50c018[_0x8d0a('0x13c')]]){this[_0x8d0a('0x28')][_0x50c018[_0x8d0a('0x139')]][_0x8d0a('0x13c')]=_0x50c018[_0x8d0a('0x13c')];if(_[_0x8d0a('0xb7')](this[_0x8d0a('0x2e')][this[_0x8d0a('0x28')][_0x50c018['actionid']][_0x8d0a('0xbb')]])){this[_0x8d0a('0x2e')][this['actions'][_0x50c018[_0x8d0a('0x139')]][_0x8d0a('0xbb')]]=[];}this[_0x8d0a('0x2e')][this['actions'][_0x50c018[_0x8d0a('0x139')]]['queue']]['push'](_[_0x8d0a('0x97')](_[_0x8d0a('0x13e')](this[_0x8d0a('0x28')][_0x50c018[_0x8d0a('0x139')]],['idHopper',_0x8d0a('0x13c')]),{'status':_0x50c018['status'],'paused':_0x50c018['paused']}));}}}};function unlockQueueStatus(_0x3acbcf,_0x151a13){setTimeout(function(){if(_[_0x8d0a('0x46')](_0x3acbcf[_0x8d0a('0x13f')])){loggerBooked[_0x8d0a('0x9f')](_0x8d0a('0x140'),_0x151a13);}_0x3acbcf['queueStatusComplete']=!![];loggerBooked[_0x8d0a('0x84')]('[booked][unlockQueueStatus]',_0x151a13,JSON[_0x8d0a('0x51')](_[_0x8d0a('0x13e')](_0x3acbcf,['name',_0x8d0a('0x13f')])));},0x1f3);}Dialer[_0x8d0a('0x1d')][_0x8d0a('0x41')]=function(_0x35081e){if(!this[_0x8d0a('0x28')][_0x35081e['actionid']]){return;}var _0x3a7190=this;var _0x1791a7=_0x3a7190[_0x8d0a('0x23')][_0x3a7190[_0x8d0a('0x28')][_0x35081e[_0x8d0a('0x139')]][_0x8d0a('0xbb')]];if(strategy[this[_0x8d0a('0x23')][this[_0x8d0a('0x28')][_0x35081e[_0x8d0a('0x139')]][_0x8d0a('0xbb')]]['strategy']]===_0x8d0a('0x13a')){if(this['actions'][_0x35081e[_0x8d0a('0x139')]]&&this[_0x8d0a('0x28')][_0x35081e['actionid']]['stateinterface']){this[_0x8d0a('0x22')][_0x8d0a('0x141')](this[_0x8d0a('0x28')][_0x35081e[_0x8d0a('0x139')]][_0x8d0a('0x142')],this[_0x8d0a('0x28')][_0x35081e[_0x8d0a('0x139')]][_0x8d0a('0x13c')])[_0x8d0a('0xc0')](function(_0x290328){logger[_0x8d0a('0x9f')](_0x8d0a('0x143'),util[_0x8d0a('0x9e')](_0x290328,{'showHidden':![],'depth':null}));})['finally'](function(){_0x3a7190[_0x8d0a('0xbc')](_0x3a7190[_0x8d0a('0x23')][_0x3a7190[_0x8d0a('0x28')][_0x35081e[_0x8d0a('0x139')]][_0x8d0a('0xbb')]]);_0x3a7190[_0x8d0a('0x25')][_0x3a7190['actions'][_0x35081e[_0x8d0a('0x139')]][_0x8d0a('0x13c')]]['locked']=![];delete _0x3a7190[_0x8d0a('0x28')][_0x35081e[_0x8d0a('0x139')]];unlockQueueStatus(_0x1791a7);});}else{this[_0x8d0a('0xbc')](this[_0x8d0a('0x23')][this[_0x8d0a('0x28')][_0x35081e[_0x8d0a('0x139')]][_0x8d0a('0xbb')]]);this[_0x8d0a('0xcd')]({'active':![],'ContactId':this[_0x8d0a('0x28')][_0x35081e['actionid']]['ContactId'],'ListId':this[_0x8d0a('0x28')][_0x35081e[_0x8d0a('0x139')]]['ListId'],'VoiceQueueId':this['actions'][_0x35081e['actionid']][_0x8d0a('0xe0')]||undefined,'CampaignId':this[_0x8d0a('0x28')][_0x35081e[_0x8d0a('0x139')]][_0x8d0a('0xe1')]||undefined})[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0x144')));delete this[_0x8d0a('0x28')][_0x35081e[_0x8d0a('0x139')]];unlockQueueStatus(_0x1791a7);}}else if((strategy[this['voiceQueues'][this[_0x8d0a('0x28')][_0x35081e[_0x8d0a('0x139')]][_0x8d0a('0xbb')]]['strategy']]||_0x8d0a('0x1c'))===_0x8d0a('0x1c')){var _0x4ee1be;if(this[_0x8d0a('0x28')][_0x35081e[_0x8d0a('0x139')]]&&!_[_0x8d0a('0x83')](this['queueBooked'][this[_0x8d0a('0x28')][_0x35081e[_0x8d0a('0x139')]][_0x8d0a('0xbb')]])){if(this[_0x8d0a('0x145')][_0x3a7190['actions'][_0x35081e['actionid']][_0x8d0a('0xbb')]]){this[_0x8d0a('0x145')][_0x3a7190['actions'][_0x35081e[_0x8d0a('0x139')]][_0x8d0a('0xbb')]]=this['queueBookedRR'][this[_0x8d0a('0x28')][_0x35081e['actionid']][_0x8d0a('0xbb')]]?this['queueBookedRR'][this[_0x8d0a('0x28')][_0x35081e['actionid']][_0x8d0a('0xbb')]]:this[_0x8d0a('0x2e')][this[_0x8d0a('0x28')][_0x35081e[_0x8d0a('0x139')]][_0x8d0a('0xbb')]]?this[_0x8d0a('0x2e')][this[_0x8d0a('0x28')][_0x35081e[_0x8d0a('0x139')]]['queue']][_0x8d0a('0x146')]||0x0:0x0;}this[_0x8d0a('0x2e')][this[_0x8d0a('0x28')][_0x35081e['actionid']][_0x8d0a('0xbb')]][_0x8d0a('0x146')]=this[_0x8d0a('0x145')][this[_0x8d0a('0x28')][_0x35081e[_0x8d0a('0x139')]][_0x8d0a('0xbb')]];for(var _0x2177eb=0x0;_0x2177eb<this[_0x8d0a('0x2e')][this['actions'][_0x35081e['actionid']][_0x8d0a('0xbb')]][_0x8d0a('0xa0')];_0x2177eb+=0x1){_0x4ee1be=rr(this['queueBooked'][this[_0x8d0a('0x28')][_0x35081e[_0x8d0a('0x139')]]['queue']]);this[_0x8d0a('0x145')][_0x3a7190[_0x8d0a('0x28')][_0x35081e[_0x8d0a('0x139')]][_0x8d0a('0xbb')]]=this[_0x8d0a('0x2e')][this[_0x8d0a('0x28')][_0x35081e[_0x8d0a('0x139')]][_0x8d0a('0xbb')]]['_rr'];if(_0x4ee1be[_0x8d0a('0xb9')]==='1'&&_0x4ee1be[_0x8d0a('0x13b')]==='0'){break;}}if(!_['isNil'](_0x4ee1be)){this['agents'][_0x4ee1be[_0x8d0a('0x13c')]][_0x8d0a('0x147')]=_[_0x8d0a('0x46')](this['agents'][_0x4ee1be['stateinterface']][_0x8d0a('0x147')])?!![]:this[_0x8d0a('0x25')][_0x4ee1be[_0x8d0a('0x13c')]][_0x8d0a('0x147')];}loggerBooked['info'](_0x8d0a('0x148'),_0x35081e[_0x8d0a('0x139')],_0x8d0a('0x149'),JSON[_0x8d0a('0x51')](_[_0x8d0a('0x13e')](this[_0x8d0a('0x25')][_0x4ee1be[_0x8d0a('0x13c')]],['name',_0x8d0a('0x147')])),_0x8d0a('0x14a'),JSON[_0x8d0a('0x51')](_0x4ee1be[_0x8d0a('0x142')]));if(!_['isNil'](_0x4ee1be)&&_0x4ee1be[_0x8d0a('0xb9')]==='1'&&_0x4ee1be[_0x8d0a('0x13b')]==='0'&&this[_0x8d0a('0x25')][_0x4ee1be[_0x8d0a('0x13c')]][_0x8d0a('0x147')]){this[_0x8d0a('0x25')][_0x4ee1be[_0x8d0a('0x13c')]][_0x8d0a('0x147')]=![];this[_0x8d0a('0x2e')][_0x3a7190['actions'][_0x35081e[_0x8d0a('0x139')]][_0x8d0a('0xbb')]]=[];this[_0x8d0a('0x22')]['run'](_0x4ee1be[_0x8d0a('0x142')],_0x4ee1be['stateinterface'])[_0x8d0a('0xc0')](function(_0x199322){logger[_0x8d0a('0x9f')](_0x8d0a('0x143'),util[_0x8d0a('0x9e')](_0x199322,{'showHidden':![],'depth':null}));})[_0x8d0a('0x20')](function(){_0x3a7190['updateOriginated'](_0x3a7190['voiceQueues'][_0x3a7190[_0x8d0a('0x28')][_0x35081e[_0x8d0a('0x139')]][_0x8d0a('0xbb')]]);setTimeout(function(){_0x3a7190[_0x8d0a('0x25')][_0x4ee1be['stateinterface']][_0x8d0a('0x147')]=!![];loggerBooked['info'](_0x8d0a('0x14b'),_0x35081e['actionid'],_0x8d0a('0x149'),JSON['stringify'](_[_0x8d0a('0x13e')](_0x3a7190[_0x8d0a('0x25')][_0x4ee1be[_0x8d0a('0x13c')]],['name',_0x8d0a('0x147')])),_0x8d0a('0x14a'),JSON[_0x8d0a('0x51')](_0x4ee1be[_0x8d0a('0x142')]));},0xc7);delete _0x3a7190[_0x8d0a('0x28')][_0x35081e['actionid']];unlockQueueStatus(_0x1791a7,_0x35081e[_0x8d0a('0x139')]);});}else{loggerBooked[_0x8d0a('0x84')](_0x8d0a('0x14c'));this[_0x8d0a('0xbc')](this[_0x8d0a('0x23')][this['actions'][_0x35081e[_0x8d0a('0x139')]][_0x8d0a('0xbb')]]);this[_0x8d0a('0xcd')]({'active':![],'ContactId':this['actions'][_0x35081e[_0x8d0a('0x139')]]['ContactId'],'ListId':this['actions'][_0x35081e[_0x8d0a('0x139')]][_0x8d0a('0xde')],'VoiceQueueId':this[_0x8d0a('0x28')][_0x35081e[_0x8d0a('0x139')]][_0x8d0a('0xe0')]||undefined,'CampaignId':this[_0x8d0a('0x28')][_0x35081e['actionid']]['CampaignId']||undefined})[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0x144')));delete this['actions'][_0x35081e[_0x8d0a('0x139')]];unlockQueueStatus(_0x1791a7);}}else{loggerBooked['info'](_0x8d0a('0x14d'));this[_0x8d0a('0xbc')](this[_0x8d0a('0x23')][this[_0x8d0a('0x28')][_0x35081e['actionid']][_0x8d0a('0xbb')]]);this[_0x8d0a('0xcd')]({'active':![],'ContactId':this['actions'][_0x35081e['actionid']][_0x8d0a('0x10a')],'ListId':this[_0x8d0a('0x28')][_0x35081e[_0x8d0a('0x139')]][_0x8d0a('0xde')],'VoiceQueueId':this['actions'][_0x35081e[_0x8d0a('0x139')]][_0x8d0a('0xe0')]||undefined,'CampaignId':this[_0x8d0a('0x28')][_0x35081e[_0x8d0a('0x139')]]['CampaignId']||undefined})[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0x14e')));delete this[_0x8d0a('0x28')][_0x35081e['actionid']];unlockQueueStatus(_0x1791a7);}}else{loggerBooked[_0x8d0a('0x84')]('[booked][unlock3]');this['updateOriginated'](this[_0x8d0a('0x23')][this[_0x8d0a('0x28')][_0x35081e[_0x8d0a('0x139')]]['queue']]);this[_0x8d0a('0xcd')]({'active':![],'ContactId':this[_0x8d0a('0x28')][_0x35081e['actionid']][_0x8d0a('0x10a')],'ListId':this['actions'][_0x35081e[_0x8d0a('0x139')]]['ListId'],'VoiceQueueId':this[_0x8d0a('0x28')][_0x35081e['actionid']][_0x8d0a('0xe0')]||undefined,'CampaignId':this[_0x8d0a('0x28')][_0x35081e[_0x8d0a('0x139')]]['CampaignId']||undefined})['catch'](loggerCatch('[unlock3][syncQueueStatusComplete]'));delete this[_0x8d0a('0x28')][_0x35081e[_0x8d0a('0x139')]];unlockQueueStatus(_0x1791a7);}};Dialer[_0x8d0a('0x1d')]['loopCampaigns']=function(){var _0x4eb3da=this;return cmHopper[_0x8d0a('0x14f')]({'active':![]},{'where':{'active':!![]}})[_0x8d0a('0xc2')](function(){setInterval(function(){_0x4eb3da['syncCampaigns']();},0x3e8);});};Dialer[_0x8d0a('0x1d')]['checkIsTrunkReachable']=function(_0x43db64){var _0x15286b=this;return function(){if(!_0x15286b[_0x8d0a('0xe6')](_0x43db64[_0x8d0a('0x7c')])){if(!_0x15286b[_0x8d0a('0xe6')](_0x43db64['TrunkBackup'])){_0x43db64[_0x8d0a('0x47')]=_0x8d0a('0x150');throw _0x43db64['name']+_0x8d0a('0x151');}}};};Dialer[_0x8d0a('0x1d')][_0x8d0a('0x152')]=function(_0x546100,_0x40d9ab,_0x11992f,_0x3acd06){var _0xbde567=this;return function(){var _0x15b040=!![];return _0xbde567['ifTime'](_0x546100,_0x40d9ab,_0x11992f,_0x3acd06,_0x15b040);};};Dialer['prototype'][_0x8d0a('0x153')]=function(_0x500eb3,_0xab6298,_0x3c60d9,_0x25b0b7){var _0x4a07c0=this;return function(){var _0x36cc87=![];return _0x4a07c0[_0x8d0a('0x154')](_0x500eb3[_0x8d0a('0x4e')],_0xab6298,_0x3c60d9,_0x25b0b7,_0x36cc87);};};Dialer[_0x8d0a('0x1d')][_0x8d0a('0x154')]=function(_0x5ad9f8,_0x34638d,_0x29952b,_0x19d98c,_0x39a293){var _0x381cc4=[];return new Promise(function(_0x288e5a,_0x25abf3){if(!isNotNull(_0x5ad9f8)){_0x19d98c[_0x8d0a('0x47')]=_0x8d0a('0x4b');return _0x25abf3(msgResponse('ifTime',_0x8d0a('0x155'),_0x29952b+'\x20Intervals\x20is\x20null\x20'));}if(_['isEmpty'](_0x5ad9f8)){_0x19d98c[_0x8d0a('0x47')]=_0x8d0a('0x156');return _0x25abf3(msgResponse(_0x8d0a('0x154'),_0x8d0a('0x155'),_0x29952b+_0x8d0a('0x157')));}if(_0x34638d&&_[_0x8d0a('0x46')](config['timezones'][_0x34638d])){_0x19d98c['message']='TIMEZONE_UNKNOW';return _0x25abf3(msgResponse(_0x8d0a('0x154'),_0x8d0a('0x155'),_0x29952b+_0x8d0a('0x158')+_0x34638d));}if(_['isArray'](_0x5ad9f8)){for(var _0x17ba1b=0x0;_0x17ba1b<_0x5ad9f8['length'];_0x17ba1b+=0x1){_0x381cc4[_0x8d0a('0x159')](ami[_0x8d0a('0xb8')]({'action':'command','command':util[_0x8d0a('0x7e')](_0x8d0a('0x15a'),_0x5ad9f8[_0x17ba1b]['interval'],!_[_0x8d0a('0x46')](config[_0x8d0a('0x15b')][_0x34638d])?_0x34638d:'')})[_0x8d0a('0xc2')](function(_0x51cb25){return _0x51cb25[_0x8d0a('0x15c')][_0x8d0a('0x15d')](_0x8d0a('0x15e'))>=0x0;})[_0x8d0a('0xc0')](myreject(_0x25abf3)));}}else{_0x381cc4[_0x8d0a('0x159')](ami[_0x8d0a('0xb8')]({'action':_0x8d0a('0x15f'),'command':util[_0x8d0a('0x7e')](_0x8d0a('0x15a'),_0x5ad9f8,!_['isUndefined'](config[_0x8d0a('0x15b')][_0x34638d])?_0x34638d:'')})[_0x8d0a('0xc2')](function(_0x43bcfe){return _0x43bcfe['content'][_0x8d0a('0x15d')](_0x8d0a('0x15e'))>=0x0;})[_0x8d0a('0xc0')](myreject(_0x25abf3)));}Promise['all'](_0x381cc4)[_0x8d0a('0xc2')](function(_0x45ff5d){var _0x3eb0e1=_[_0x8d0a('0x160')](_0x45ff5d);if(_0x3eb0e1){return _0x288e5a(_0x3eb0e1);}else{_0x19d98c[_0x8d0a('0x47')]=_0x39a293?_0x8d0a('0x161'):_0x8d0a('0x162');return _0x25abf3(msgResponse(_0x8d0a('0x163'),_0x8d0a('0x155'),'Global:\x20'+_0x39a293+'\x20'+_0x29952b+_0x8d0a('0x164')+util[_0x8d0a('0x9e')](_0x5ad9f8,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x34638d));}})[_0x8d0a('0xc0')](function(_0x51bdbf){return _0x25abf3(msgResponse(_0x8d0a('0x154'),_0x8d0a('0x155'),JSON['stringify'](_0x51bdbf)));});});};Dialer[_0x8d0a('0x1d')][_0x8d0a('0x165')]=function(_0x29743c){var _0x424937=this;return function(){switch(_0x29743c['dialMethod']){case _0x8d0a('0x166'):freeVariablesPredictive(_0x29743c);_0x424937[_0x8d0a('0x167')](_0x29743c,0x1);break;case'power':freeVariablesPredictive(_0x29743c);_0x424937[_0x8d0a('0x167')](_0x29743c,_0x29743c[_0x8d0a('0x168')]);break;case _0x8d0a('0xa'):_0x424937[_0x8d0a('0xa')](_0x29743c);break;case _0x8d0a('0x9'):freeVariablesPredictive(_0x29743c);_0x424937[_0x8d0a('0x167')](_0x29743c,0x1);break;default:freeVariablesPredictive(_0x29743c);logger[_0x8d0a('0x9f')](_0x8d0a('0x169'),_0x29743c[_0x8d0a('0x4a')],_0x8d0a('0x16a'));}};};Dialer[_0x8d0a('0x1d')]['checkPreviewRecallReminder']=function(_0x5e5a30){return Promise['resolve']()[_0x8d0a('0xc2')](cmHopper[_0x8d0a('0x16b')](_0x5e5a30['id'],previewRecallmeReminderInterval))[_0x8d0a('0xc2')](function(_0x49546d){for(var _0x3e2af6=0x0;_0x3e2af6<_0x49546d[_0x8d0a('0xa0')];_0x3e2af6++){var _0x497142=_0x49546d[_0x3e2af6][_0x8d0a('0x16c')][_0x8d0a('0x4a')];if(_0x497142)io['to'](util[_0x8d0a('0x7e')]('user:%s',_0x497142))[_0x8d0a('0x55')](_0x8d0a('0x16d'),{'hopper':_0x49546d[_0x3e2af6]});}})[_0x8d0a('0xc0')](function(){});};Dialer[_0x8d0a('0x1d')][_0x8d0a('0x16e')]=function(_0x1224b4){var _0x4b1db0=this;return function(){_0x4b1db0[_0x8d0a('0x16f')](_0x1224b4);};};Dialer[_0x8d0a('0x1d')][_0x8d0a('0x37')]=function(_0x391e0a){var _0x32cc20=this;if(isNotPreview(_0x391e0a[_0x8d0a('0x64')])){if(isVoiceQueueOutbound(_0x391e0a[_0x8d0a('0x56')])&&isActive(_0x391e0a[_0x8d0a('0x63')])){_0x391e0a[_0x8d0a('0xa9')]=!![];Promise[_0x8d0a('0xbf')]()[_0x8d0a('0xc2')](checkIsLoggedIn(_0x391e0a,_0x391e0a[_0x8d0a('0x5a')]))[_0x8d0a('0xc2')](checkIsActive(_0x391e0a,_0x391e0a[_0x8d0a('0x63')]))['then'](checkInterval(_0x391e0a))[_0x8d0a('0xc2')](_0x32cc20['checkIsTrunkReachable'](_0x391e0a))[_0x8d0a('0xc2')](_0x32cc20['checkIfTime'](_0x391e0a[_0x8d0a('0x170')],_0x391e0a[_0x8d0a('0x171')],_0x391e0a[_0x8d0a('0x4a')],_0x391e0a))[_0x8d0a('0xc2')](_0x32cc20['checkIfTimeIntervals'](_0x391e0a[_0x8d0a('0x4d')],_0x391e0a[_0x8d0a('0x171')],_0x391e0a['name'],_0x391e0a))[_0x8d0a('0xc2')](_0x32cc20[_0x8d0a('0x165')](_0x391e0a))[_0x8d0a('0xc0')](loggerCatchQueueSummary(_0x8d0a('0x172'),_0x391e0a));}else{notSendMessagesQueue(_0x391e0a);}}else{freeVariablesPredictive(_0x391e0a);}};Dialer[_0x8d0a('0x1d')][_0x8d0a('0x39')]=_[_0x8d0a('0x173')](function(){var _0x465fdb=_['filter'](this[_0x8d0a('0x23')],function(_0x2965b5){return _0x2965b5[_0x8d0a('0x174')];});var _0x3ca21c=_[_0x8d0a('0x175')](this[_0x8d0a('0x25')],function(_0x39bac8){return _0x39bac8[_0x8d0a('0x176')]&&_0x39bac8[_0x8d0a('0xb9')]===_0x8d0a('0x177');});if(_0x465fdb[_0x8d0a('0xa0')]>0x0&&_0x3ca21c[_0x8d0a('0xa0')]>0x0){return Promise[_0x8d0a('0xbf')]()[_0x8d0a('0xc2')](cmHopper[_0x8d0a('0x16b')](_['map'](_0x465fdb,'id'),previewRecallmeReminderInterval,_[_0x8d0a('0x178')](_0x3ca21c,'id')))[_0x8d0a('0xc2')](function(_0x33bc3a){for(var _0xaca81a=0x0;_0xaca81a<_0x33bc3a[_0x8d0a('0xa0')];_0xaca81a++){var _0x15162a=_0x33bc3a[_0xaca81a]['Agent'][_0x8d0a('0x4a')];if(_0x15162a)io['to'](util[_0x8d0a('0x7e')](_0x8d0a('0x179'),_0x15162a))[_0x8d0a('0x55')](_0x8d0a('0x16d'),{'hopper':_0x33bc3a[_0xaca81a]});}})[_0x8d0a('0xc0')](function(_0x2b7338){logger[_0x8d0a('0x9f')]('checkPreviewRecallReminder',_0x2b7338);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x8d0a('0x1d')][_0x8d0a('0x17a')]=function(){var _0x59c439=this;var _0x5ce736;for(var _0x462c5f in this[_0x8d0a('0x24')]){if(typeof this[_0x8d0a('0x24')][_0x462c5f]!=='undefined'){_0x5ce736=this['campaigns'][_0x462c5f];if(isCampaignIvr(_0x5ce736['type'])&&isActive(_0x5ce736[_0x8d0a('0x7d')])){_0x5ce736[_0x8d0a('0xa9')]=!![];Promise['resolve']()['then'](checkIsActive(_0x5ce736,_0x5ce736[_0x8d0a('0x7d')]))[_0x8d0a('0xc2')](checkInterval(_0x5ce736))['then'](_0x59c439['checkIsTrunkReachable'](_0x5ce736))[_0x8d0a('0xc2')](_0x59c439['checkIfTime'](_0x5ce736[_0x8d0a('0x170')],_0x5ce736['dialTimezone'],_0x5ce736['name'],_0x5ce736))['then'](_0x59c439['checkIfTimeIntervals'](_0x5ce736[_0x8d0a('0x4d')],_0x5ce736[_0x8d0a('0x171')],_0x5ce736['name'],_0x5ce736))[_0x8d0a('0xc2')](_0x59c439[_0x8d0a('0x16e')](_0x5ce736))[_0x8d0a('0xc0')](loggerCatchQueueSummary(_0x8d0a('0x17b'),_0x5ce736));}else{notSendMessagesCampaign(_0x5ce736);}}}};function getCallerIdRandom(_0xbb70c,_0xf30173){var _0x4663a1;var _0x5d3731;var _0x38c07a;if(_0xf30173<=0x0){_0xf30173=0x1;}_0x4663a1=new RegExp('\x5cw{0,'+_0xf30173+'}$');_0x5d3731=Math['pow'](0xa,_0xf30173-0x1);_0x38c07a=Math[_0x8d0a('0x17c')](0xa,_0xf30173)-0x1;return util[_0x8d0a('0x7e')]('%s',_[_0x8d0a('0x17d')](_0xbb70c,_0x4663a1,_[_0x8d0a('0x17e')](_0x5d3731,_0x38c07a)));}function extractCalleridName(_0x516bf9){var _0x103ab9=_0x516bf9['match'](/"(.*?)"/);return _0x103ab9?_0x103ab9[0x1]:_0x516bf9;}Dialer[_0x8d0a('0x1d')][_0x8d0a('0x17f')]=function(_0x517d7f,_0x54ca3c){var _0x1c6c9d=this;var _0x2f5fae=uuid['v4']();this[_0x8d0a('0x28')][_0x2f5fae]=new Action(_0x517d7f,_0x54ca3c,_0x2f5fae);return new Promise(function(_0xda7fa6,_0xf40763){if(_[_0x8d0a('0x46')](_0x517d7f)&&typeof _0x517d7f!==_0x8d0a('0x180')){return _0xf40763(msgResponse('originate',_0x8d0a('0x155'),'voiceQueue\x20is\x20undefine'));}if(_[_0x8d0a('0x46')](_0x54ca3c[_0x8d0a('0x181')])||_0x54ca3c[_0x8d0a('0x181')]===null){return _0xf40763(msgResponse('originate',_0x8d0a('0x155'),_0x8d0a('0x182')));}var _0x28964a={'XMD-CALLERID':_0x1c6c9d[_0x8d0a('0x28')][_0x2f5fae][_0x8d0a('0x183')](),'XMD-AGI':_0x517d7f['dialQueueProject']?util[_0x8d0a('0x7e')](_0x8d0a('0x184'),ipAgi,_0x517d7f[_0x8d0a('0x115')]):'NONE','XMD-AGIAFTER':_0x517d7f[_0x8d0a('0x185')]?util['format'](_0x8d0a('0x184'),ipAgi,_0x517d7f[_0x8d0a('0x185')]):_0x8d0a('0x186'),'XMD-QUEUE':_0x517d7f[_0x8d0a('0x56')]==='outbound'?util[_0x8d0a('0x7e')](_0x8d0a('0x187'),_0x517d7f[_0x8d0a('0x4a')],_0x517d7f[_0x8d0a('0x188')]||'',_0x517d7f[_0x8d0a('0x11c')]?'c':'',_0x517d7f[_0x8d0a('0x123')]||0x3):_0x8d0a('0x186'),'XMD-CONTACTID':_0x54ca3c[_0x8d0a('0x10a')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x1c6c9d[_0x8d0a('0x28')][_0x2f5fae][_0x8d0a('0x183')](),'XMD-AMD':_0x517d7f['dialAMDActive']?_0x8d0a('0x189'):_0x8d0a('0x186'),'XMD-DESTINATION':_0x8d0a('0x18a')};if(_0x517d7f[_0x8d0a('0xec')]){_0x28964a['XMD-AMDINITIALSILENCE']=_0x517d7f[_0x8d0a('0x18b')]||0x9c4;_0x28964a[_0x8d0a('0x18c')]=_0x517d7f[_0x8d0a('0x18d')]||0x5dc;_0x28964a[_0x8d0a('0x18e')]=_0x517d7f[_0x8d0a('0x18f')]||0x320;_0x28964a[_0x8d0a('0x190')]=_0x517d7f[_0x8d0a('0x191')]||0x1388;_0x28964a[_0x8d0a('0x192')]=_0x517d7f[_0x8d0a('0x193')]||0x64;_0x28964a[_0x8d0a('0x194')]=_0x517d7f[_0x8d0a('0x195')]||0x32;_0x28964a[_0x8d0a('0x196')]=_0x517d7f[_0x8d0a('0x197')]||0x3;_0x28964a[_0x8d0a('0x198')]=_0x517d7f[_0x8d0a('0x199')]||0x100;_0x28964a[_0x8d0a('0x19a')]=_0x517d7f[_0x8d0a('0x19b')]||0x1388;}if(_0x517d7f['type']===_0x8d0a('0x57')){_0x28964a[_0x8d0a('0x19c')]=_0x54ca3c['VoiceQueueId'];}else{_0x28964a[_0x8d0a('0x19d')]=_0x54ca3c['CampaignId'];}for(var _0xcfea in _0x54ca3c[_0x8d0a('0x19e')]){if(typeof _0x54ca3c[_0x8d0a('0x19e')][_0xcfea]!==_0x8d0a('0xa1')){if(isNotNull(_0x54ca3c[_0x8d0a('0x19e')][_0xcfea])&&_0xcfea!=='id'&&_0xcfea!==_0x8d0a('0x19f')&&_0xcfea!==_0x8d0a('0x1a0')&&_0xcfea!==_0x8d0a('0x1a1')){_0x28964a[util['format']('%s%s','XMD-',_[_0x8d0a('0x1a2')](_0xcfea))]=_0x54ca3c[_0x8d0a('0x19e')][_0xcfea];}}}var _0x121857=_0x1c6c9d[_0x8d0a('0xe6')](_0x517d7f['Trunk'])?getCallerId(_0x517d7f[_0x8d0a('0x7c')][_0x8d0a('0x1a3')],_0x517d7f[_0x8d0a('0x65')],_0x517d7f['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x517d7f[_0x8d0a('0x1a4')],_0x517d7f['dialRandomLastDigitCallerIdNumber']):_0x517d7f[_0x8d0a('0x1a4')]):getCallerId(_[_0x8d0a('0xb7')](_0x517d7f[_0x8d0a('0x1a5')])?_0x517d7f[_0x8d0a('0x7c')]['callerid']:_0x517d7f[_0x8d0a('0x1a5')][_0x8d0a('0x1a3')],_0x517d7f[_0x8d0a('0x65')],_0x517d7f['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x517d7f[_0x8d0a('0x1a4')],_0x517d7f['dialRandomLastDigitCallerIdNumber']):_0x517d7f[_0x8d0a('0x1a4')]);if(_0x121857){_0x28964a[_0x8d0a('0x1a6')]=_0x1c6c9d[_0x8d0a('0x28')][_0x2f5fae][_0x8d0a('0x1a7')]=extractCalleridName(_0x121857);_0x28964a['XMD-ORIGINATECALLERIDNUM']=_0x54ca3c[_0x8d0a('0x181')];}_0x517d7f[_0x8d0a('0x1a8')]=_0x28964a;return ami[_0x8d0a('0xb8')]({'actionid':_0x2f5fae,'action':'originate','channel':_0x1c6c9d['isTrunkReachable'](_0x517d7f[_0x8d0a('0x7c')])?util[_0x8d0a('0x7e')]('SIP/%s/%s%s',_0x517d7f[_0x8d0a('0x7c')][_0x8d0a('0x4a')],isNotNull(_0x517d7f[_0x8d0a('0x67')])?_0x517d7f[_0x8d0a('0x67')][_0x8d0a('0x1a9')]()||'':'',_0x517d7f[_0x8d0a('0x1aa')]>0x0?_0x54ca3c['phone'][_0x8d0a('0x1ab')](_0x517d7f['dialCutDigit']):_0x54ca3c['phone']):util[_0x8d0a('0x7e')](_0x8d0a('0x1ac'),_['isNil'](_0x517d7f[_0x8d0a('0x1a5')])?_0x517d7f['Trunk'][_0x8d0a('0x4a')]:_0x517d7f[_0x8d0a('0x1a5')][_0x8d0a('0x4a')],isNotNull(_0x517d7f[_0x8d0a('0x67')])?_0x517d7f[_0x8d0a('0x67')][_0x8d0a('0x1a9')]()||'':'',_0x517d7f[_0x8d0a('0x1aa')]>0x0?_0x54ca3c[_0x8d0a('0x181')][_0x8d0a('0x1ab')](_0x517d7f[_0x8d0a('0x1aa')]):_0x54ca3c[_0x8d0a('0x181')]),'callerid':_0x121857,'Exten':_0x8d0a('0x18a'),'Context':_0x8d0a('0x1ad'),'Priority':'1','variable':_0x28964a,'timeout':(_0x517d7f[_0x8d0a('0x66')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2f5fae})['then'](function(_0x287ed2){return _0xda7fa6(_0x287ed2);})['catch'](function(_0x3de95c){_0x517d7f[_0x8d0a('0x6d')]+=0x1;var _0xb04b1e=new History(_0x1c6c9d[_0x8d0a('0x28')][_0x2f5fae]);logger[_0x8d0a('0x9f')](util[_0x8d0a('0x7e')]('[originateError]:\x20%s',JSON[_0x8d0a('0x51')](_0x3de95c)));_0xb04b1e[_0x8d0a('0xb1')]=0xe;_0xb04b1e[_0x8d0a('0xb2')]=_0x8d0a('0x1ae');_0xb04b1e[_0x8d0a('0xb3')]=moment()[_0x8d0a('0x7e')](_0x8d0a('0x109'));_0xb04b1e[_0x8d0a('0x12c')]=_0xb04b1e[_0x8d0a('0xb3')];_0x1c6c9d['createHistory'](_0xb04b1e)[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0x1af')));_0x1c6c9d[_0x8d0a('0xd6')](_0xb04b1e)[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0x1af')))['finally'](function(){delete _0x1c6c9d['actions'][_0x2f5fae];return _0xf40763(msgResponse('originate',_0x8d0a('0x50'),_0x8d0a('0x1b0')));});});});};Dialer['prototype']['syncOriginateResponse']=function(_0x256bad){var _0x534345=this[_0x8d0a('0x28')][_0x256bad[_0x8d0a('0x139')]];if(_0x534345){delete this['actions'][_0x256bad[_0x8d0a('0x139')]];_0x534345[_0x8d0a('0x122')]=moment()[_0x8d0a('0x7e')](_0x8d0a('0x109'));var _0x450965=_0x534345[_0x8d0a('0x56')]===_0x8d0a('0x81')?this[_0x8d0a('0x24')][_0x534345[_0x8d0a('0xbb')]]:this[_0x8d0a('0x23')][_0x534345[_0x8d0a('0x1b1')]()];if(!this[_0x8d0a('0xe4')](_0x256bad['response'])){this[_0x8d0a('0xbc')](_0x450965);return this[_0x8d0a('0x1b2')](_0x534345,_0x450965,_0x256bad)[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0x1b3')));}this[_0x8d0a('0x2a')][_0x256bad[_0x8d0a('0xef')]]=_0x534345;}};Dialer[_0x8d0a('0x1d')][_0x8d0a('0x1b4')]=function(_0x2d1fb4,_0x4fd2ad,_0x2bda96){var _0x40ec90=new History(_0x4fd2ad);if(_0x40ec90[_0x8d0a('0xfc')]+_0x40ec90[_0x8d0a('0xfd')]+_0x40ec90[_0x8d0a('0xfe')]+_0x40ec90[_0x8d0a('0xff')]+_0x40ec90['countdropretry']+_0x40ec90[_0x8d0a('0x100')]+_0x40ec90['countmachineretry']+_0x40ec90[_0x8d0a('0x10e')]>=_0x2bda96[_0x8d0a('0x10f')]-0x1){return!![];}switch(_0x2d1fb4){case 0x3:if(_0x40ec90[_0x8d0a('0xfe')]>=_0x2bda96[_0x8d0a('0x1b5')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x40ec90[_0x8d0a('0xfe')]+=0x1,'scheduledat':moment()['add'](_0x2bda96[_0x8d0a('0x1b6')],_0x8d0a('0x108'))['format'](_0x8d0a('0x109')),'ContactId':_0x40ec90['ContactId'],'ListId':_0x40ec90[_0x8d0a('0xde')],'VoiceQueueId':_0x40ec90['VoiceQueueId']||undefined,'CampaignId':_0x40ec90[_0x8d0a('0xe1')]||undefined})['catch'](loggerCatch(_0x8d0a('0x1b7')));break;case 0x5:if(_0x40ec90[_0x8d0a('0xfc')]>=_0x2bda96[_0x8d0a('0x1b8')]-0x1){return!![];}this[_0x8d0a('0xcd')]({'active':![],'countbusyretry':_0x40ec90[_0x8d0a('0xfc')]+=0x1,'scheduledat':moment()[_0x8d0a('0x106')](_0x2bda96[_0x8d0a('0x1b9')],'minutes')[_0x8d0a('0x7e')](_0x8d0a('0x109')),'ContactId':_0x40ec90[_0x8d0a('0x10a')],'ListId':_0x40ec90[_0x8d0a('0xde')],'VoiceQueueId':_0x40ec90[_0x8d0a('0xe0')]||undefined,'CampaignId':_0x40ec90['CampaignId']||undefined})['catch'](loggerCatch(_0x8d0a('0x1ba')));break;case 0x8:if(_0x40ec90['countcongestionretry']>=_0x2bda96['dialCongestionMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x40ec90[_0x8d0a('0xfd')]+=0x1,'scheduledat':moment()['add'](_0x2bda96[_0x8d0a('0x1bb')],'minutes')[_0x8d0a('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x40ec90['ContactId'],'ListId':_0x40ec90[_0x8d0a('0xde')],'VoiceQueueId':_0x40ec90[_0x8d0a('0xe0')]||undefined,'CampaignId':_0x40ec90[_0x8d0a('0xe1')]||undefined})[_0x8d0a('0xc0')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x40ec90[_0x8d0a('0xff')]>=_0x2bda96[_0x8d0a('0x1bc')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x40ec90[_0x8d0a('0xff')]+=0x1,'scheduledat':moment()[_0x8d0a('0x106')](_0x2bda96['dialNoSuchNumberRetryFrequency'],_0x8d0a('0x108'))[_0x8d0a('0x7e')](_0x8d0a('0x109')),'ContactId':_0x40ec90[_0x8d0a('0x10a')],'ListId':_0x40ec90['ListId'],'VoiceQueueId':_0x40ec90[_0x8d0a('0xe0')]||undefined,'CampaignId':_0x40ec90[_0x8d0a('0xe1')]||undefined})[_0x8d0a('0xc0')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x40ec90[_0x8d0a('0x10d')]>=_0x2bda96['dialDropMaxRetry']-0x1){return!![];}this[_0x8d0a('0xcd')]({'active':![],'countdropretry':_0x40ec90['countdropretry']+=0x1,'scheduledat':moment()[_0x8d0a('0x106')](_0x2bda96[_0x8d0a('0x127')],'minutes')[_0x8d0a('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x40ec90[_0x8d0a('0x10a')],'ListId':_0x40ec90['ListId'],'VoiceQueueId':_0x40ec90[_0x8d0a('0xe0')]||undefined,'CampaignId':_0x40ec90[_0x8d0a('0xe1')]||undefined})[_0x8d0a('0xc0')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x40ec90[_0x8d0a('0x100')]>=_0x2bda96['dialAbandonedMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x40ec90[_0x8d0a('0x100')]+=0x1,'scheduledat':moment()[_0x8d0a('0x106')](_0x2bda96[_0x8d0a('0x133')],_0x8d0a('0x108'))[_0x8d0a('0x7e')](_0x8d0a('0x109')),'ContactId':_0x40ec90[_0x8d0a('0x10a')],'ListId':_0x40ec90[_0x8d0a('0xde')],'VoiceQueueId':_0x40ec90[_0x8d0a('0xe0')]||undefined,'CampaignId':_0x40ec90[_0x8d0a('0xe1')]||undefined})[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0x136')));break;case 0x13:if(_0x40ec90[_0x8d0a('0x101')]>=_0x2bda96['dialMachineMaxRetry']-0x1){return!![];}this[_0x8d0a('0xcd')]({'active':![],'countmachineretry':_0x40ec90[_0x8d0a('0x101')]+=0x1,'scheduledat':moment()[_0x8d0a('0x106')](_0x2bda96[_0x8d0a('0x107')],_0x8d0a('0x108'))[_0x8d0a('0x7e')](_0x8d0a('0x109')),'ContactId':_0x40ec90['ContactId'],'ListId':_0x40ec90['ListId'],'VoiceQueueId':_0x40ec90[_0x8d0a('0xe0')]||undefined,'CampaignId':_0x40ec90[_0x8d0a('0xe1')]||undefined})[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0x111')));break;case 0x14:if(_0x40ec90[_0x8d0a('0x10e')]>=_0x2bda96[_0x8d0a('0x1bd')]-0x1){return!![];}this[_0x8d0a('0xcd')]({'active':![],'countagentrejectretry':_0x40ec90[_0x8d0a('0x10e')]+=0x1,'scheduledat':moment()[_0x8d0a('0x106')](_0x2bda96[_0x8d0a('0x1be')],_0x8d0a('0x108'))[_0x8d0a('0x7e')](_0x8d0a('0x109')),'ContactId':_0x40ec90[_0x8d0a('0x10a')],'ListId':_0x40ec90[_0x8d0a('0xde')],'VoiceQueueId':_0x40ec90[_0x8d0a('0xe0')]||undefined,'CampaignId':_0x40ec90[_0x8d0a('0xe1')]||undefined})[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0x1bf')));break;default:return!![];}};Dialer[_0x8d0a('0x1d')][_0x8d0a('0x1b2')]=function(_0x3b7a7c,_0x25573f,_0x2daca5){var _0x408b6f=this;var _0x301b1f=new History(_0x3b7a7c);var _0x553bf7=![];var _0x350e48;var _0x25ff14;return new Promise(function(_0x412e81,_0x18f3d2){if(_['isUndefined'](_0x25573f)&&typeof _0x25573f!=='object'){return _0x18f3d2(msgResponse(_0x8d0a('0x1c0'),'Failure',_0x8d0a('0x1c1')));}if(_[_0x8d0a('0x46')](_0x2daca5)&&typeof _0x2daca5!=='object'){return _0x18f3d2(msgResponse(_0x8d0a('0x1c0'),_0x8d0a('0x155'),_0x8d0a('0x1c2')));}_0x408b6f['verifyAdditionalPhones'](_0x301b1f,_0x2daca5['reason'],_0x25573f)['then'](function(_0x2a297d){if(_0x2a297d[_0x8d0a('0x129')]==0x1)_0x553bf7=!![];switch(_0x2daca5[_0x8d0a('0x1c3')]){case'0':_0x25573f[_0x8d0a('0x6c')]+=0x1;_0x301b1f[_0x8d0a('0xb1')]=0x0;_0x301b1f[_0x8d0a('0xb2')]=_0x8d0a('0x1c4');_0x301b1f['countnosuchnumberretry']+=0x1;_0x301b1f[_0x8d0a('0xfa')]+=0x1;ami[_0x8d0a('0x55')]('custom:agentnosuchnumber',ut[_0x8d0a('0xf4')](_0x3b7a7c,_0x8d0a('0x1c5')));_0x350e48=_0x25573f[_0x8d0a('0x1c6')];_0x25ff14=_0x25573f['callAdditionalPhoneAfterMin'];_0x408b6f['createHistory'](_0x301b1f)[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0xfb')));if(_0x408b6f[_0x8d0a('0x1b4')](0x0,_0x3b7a7c,_0x25573f)&&!_0x553bf7){if(_0x301b1f['countnosuchnumberretry']>=_0x25573f['dialNoSuchNumberMaxRetry']){_0x408b6f[_0x8d0a('0x104')](_0x301b1f,_0x412e81,_0x18f3d2,_0x8d0a('0x1c7'));}else{_0x408b6f['stateGlobal'](_0x301b1f,_0x412e81,_0x18f3d2,_0x8d0a('0x1c7'));}}break;case'3':_0x25573f[_0x8d0a('0x6b')]+=0x1;_0x301b1f[_0x8d0a('0xb1')]=0x3;_0x301b1f[_0x8d0a('0xb2')]=_0x8d0a('0x1c8');_0x301b1f[_0x8d0a('0xfe')]+=0x1;_0x301b1f['countglobal']+=0x1;var _0x4b1050=ut[_0x8d0a('0x1c9')](_0x3b7a7c,_0x25573f);ami[_0x8d0a('0x55')](_0x8d0a('0x1ca'),_0x4b1050);_0x350e48=_0x25573f[_0x8d0a('0x1b6')];_0x25ff14=_0x25573f['callAdditionalPhoneAfterMin'];_0x408b6f[_0x8d0a('0xd8')](_0x301b1f)[_0x8d0a('0xc0')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x408b6f[_0x8d0a('0x1b4')](0x3,_0x3b7a7c,_0x25573f)&&!_0x553bf7){if(_0x301b1f[_0x8d0a('0xfe')]>=_0x25573f[_0x8d0a('0x1b5')]){_0x408b6f[_0x8d0a('0x104')](_0x301b1f,_0x412e81,_0x18f3d2,_0x8d0a('0x1cb'));}else{_0x408b6f[_0x8d0a('0x102')](_0x301b1f,_0x412e81,_0x18f3d2,_0x8d0a('0x1cb'));}}break;case'5':_0x25573f[_0x8d0a('0x1cc')]+=0x1;_0x301b1f[_0x8d0a('0xb1')]=0x5;_0x301b1f['statedesc']=_0x8d0a('0x1cd');_0x301b1f[_0x8d0a('0xfc')]+=0x1;_0x301b1f[_0x8d0a('0xfa')]+=0x1;ami['emit'](_0x8d0a('0x1ce'),ut[_0x8d0a('0xf4')](_0x3b7a7c,_0x8d0a('0x1cf')));_0x350e48=_0x25573f['dialBusyRetryFrequency'];_0x25ff14=_0x25573f[_0x8d0a('0x134')];_0x408b6f['createHistory'](_0x301b1f)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x408b6f[_0x8d0a('0x1b4')](0x5,_0x3b7a7c,_0x25573f)&&!_0x553bf7){if(_0x301b1f['countbusyretry']>=_0x25573f['dialBusyMaxRetry']){_0x408b6f['createStateFinal'](_0x301b1f,_0x412e81,_0x18f3d2,_0x8d0a('0x1d0'));}else{_0x408b6f[_0x8d0a('0x102')](_0x301b1f,_0x412e81,_0x18f3d2,_0x8d0a('0x1d0'));}}break;case'8':_0x25573f['outboundCongestionCallsDay']+=0x1;_0x301b1f['state']=0x8;_0x301b1f['statedesc']=_0x8d0a('0x1d1');_0x301b1f[_0x8d0a('0xfd')]+=0x1;_0x301b1f[_0x8d0a('0xfa')]+=0x1;_0x350e48=_0x25573f[_0x8d0a('0x1bb')];_0x25ff14=_0x25573f[_0x8d0a('0x134')];ami[_0x8d0a('0x55')](_0x8d0a('0x1d2'),ut[_0x8d0a('0xf4')](_0x3b7a7c,_0x8d0a('0x1d3')));_0x408b6f[_0x8d0a('0xd8')](_0x301b1f)[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0x1d4')));if(_0x408b6f[_0x8d0a('0x1b4')](0x8,_0x3b7a7c,_0x25573f)&&!_0x553bf7){if(_0x301b1f['countcongestionretry']>=_0x25573f[_0x8d0a('0x1d5')]){_0x408b6f[_0x8d0a('0x104')](_0x301b1f,_0x412e81,_0x18f3d2,_0x8d0a('0x1d6'));}else{_0x408b6f[_0x8d0a('0x102')](_0x301b1f,_0x412e81,_0x18f3d2,_0x8d0a('0x1d6'));}}break;case'11':_0x25573f['outboundAbandonedCallsDay']+=0x1;_0x301b1f[_0x8d0a('0xb1')]=0xb;_0x301b1f[_0x8d0a('0xb2')]=_0x8d0a('0x131');_0x301b1f['countabandonedretry']+=0x1;_0x301b1f[_0x8d0a('0xfa')]+=0x1;_0x350e48=_0x25573f[_0x8d0a('0x133')];_0x25ff14=_0x25573f[_0x8d0a('0x134')];_0x408b6f[_0x8d0a('0xd8')](_0x301b1f)['catch'](loggerCatch(_0x8d0a('0x137')));if(_0x408b6f[_0x8d0a('0x1b4')](0xb,_0x3b7a7c,_0x25573f)&&!_0x553bf7){if(_0x301b1f[_0x8d0a('0x100')]>=_0x25573f[_0x8d0a('0x135')]){_0x408b6f[_0x8d0a('0x104')](_0x301b1f,_0x412e81,_0x18f3d2,_0x8d0a('0x1d7'));}else{_0x408b6f[_0x8d0a('0x102')](_0x301b1f,_0x412e81,_0x18f3d2,_0x8d0a('0x1d7'));}}break;case'20':_0x25573f[_0x8d0a('0x6f')]+=0x1;_0x301b1f[_0x8d0a('0xb1')]=0x14;_0x301b1f['statedesc']=_0x8d0a('0x1d8');_0x301b1f[_0x8d0a('0x10e')]+=0x1;_0x301b1f[_0x8d0a('0xfa')]+=0x1;_0x350e48=_0x25573f[_0x8d0a('0x1be')];_0x25ff14=_0x25573f[_0x8d0a('0x134')];ami[_0x8d0a('0x55')](_0x8d0a('0x1d9'),ut['buildObj'](_0x3b7a7c,'agentreject'));_0x408b6f[_0x8d0a('0xd8')](_0x301b1f)[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0x1da')));if(_0x408b6f[_0x8d0a('0x1b4')](0x14,_0x3b7a7c,_0x25573f)&&!_0x553bf7){if(_0x301b1f['countagentrejectretry']>=_0x25573f[_0x8d0a('0x1bd')]){_0x408b6f[_0x8d0a('0x104')](_0x301b1f,_0x412e81,_0x18f3d2,_0x8d0a('0x1db'));}else{_0x408b6f[_0x8d0a('0x102')](_0x301b1f,_0x412e81,_0x18f3d2,_0x8d0a('0x1db'));}}break;default:_0x25573f[_0x8d0a('0x117')]+=0x1;_0x301b1f[_0x8d0a('0xb1')]=0xc;_0x301b1f[_0x8d0a('0xb2')]=_0x2daca5[_0x8d0a('0x1c3')];_0x350e48=_0x25573f[_0x8d0a('0x1be')];_0x25ff14=_0x25573f[_0x8d0a('0x134')];_0x408b6f[_0x8d0a('0xd8')](_0x301b1f)[_0x8d0a('0xc0')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x408b6f[_0x8d0a('0x1b4')](_0x2daca5['reason'],_0x3b7a7c,_0x25573f)&&!_0x553bf7){if(_0x301b1f[_0x8d0a('0xfc')]+_0x301b1f['countcongestionretry']+_0x301b1f[_0x8d0a('0xfe')]+_0x301b1f[_0x8d0a('0xff')]+_0x301b1f['countdropretry']+_0x301b1f[_0x8d0a('0x100')]+_0x301b1f[_0x8d0a('0x101')]+_0x301b1f[_0x8d0a('0x10e')]>=_0x25573f[_0x8d0a('0x10f')]){_0x408b6f[_0x8d0a('0x102')](_0x301b1f,_0x412e81,_0x18f3d2,_0x2daca5[_0x8d0a('0x1c3')]);}else{_0x408b6f['createStateFinal'](_0x301b1f,_0x412e81,_0x18f3d2,_0x2daca5[_0x8d0a('0x1c3')]);}}}})[_0x8d0a('0xc2')](function(){if(_0x553bf7){_0x408b6f[_0x8d0a('0xc7')](_0x301b1f,_0x350e48,_0x25ff14)[_0x8d0a('0xc2')](function(){return _0x412e81(0x1);});}});});};Dialer[_0x8d0a('0x1d')][_0x8d0a('0x102')]=function(_0x2bdb96,_0x521680,_0x46082b,_0x444771){var _0x427cfc=new Final(_0x2bdb96);_0x427cfc['state']=0xf;_0x427cfc[_0x8d0a('0xb2')]='Global';this['createStateFinal'](_0x427cfc,_0x521680,_0x46082b,_0x444771);};Dialer[_0x8d0a('0x1d')]['createStateFinal']=function(_0x468911,_0x321f60,_0x332b08,_0xd9d568){this[_0x8d0a('0xd6')](_0x468911)[_0x8d0a('0xc2')](function(){return _0x321f60(msgResponse(_0x8d0a('0x1c0'),'Success',_0xd9d568));})['catch'](function(){return _0x332b08(msgResponse(_0x8d0a('0x1dc'),_0x8d0a('0x155'),_0x8d0a('0x1dd')));});};Dialer[_0x8d0a('0x1d')]['predictive']=function(_0x8958cb){var _0x549e0e=_0x8958cb[_0x8d0a('0x1de')]/0x64;var _0xb1dab2=_0x8958cb['outboundDropCallsDayTimeout']/(_0x8958cb[_0x8d0a('0x124')]+_0x8958cb['outboundAnswerCallsDay']);var _0x4cc6dd=Math[_0x8d0a('0x1df')](_0x8958cb[_0x8d0a('0x1e0')]*(_0x8958cb['predictiveIntervalMaxThreshold']/0x64));var _0x39bee6=Math[_0x8d0a('0x1df')](_0x8958cb['predictiveIntervalAvailable']*(_0x8958cb[_0x8d0a('0x1e1')]/0x64));var _0x40037e=_0x8958cb[_0x8d0a('0xaa')]+_0x8958cb[_0x8d0a('0x5f')];var _0x2f9619=Math[_0x8d0a('0x1e2')](_0x8958cb['erlangCalls']*_0x8958cb[_0x8d0a('0x95')]*_0x8958cb[_0x8d0a('0x76')]*_0x8958cb[_0x8d0a('0x77')]);if(_['isUndefined'](_0x8958cb[_0x8d0a('0x2c')])){if(!_[_0x8d0a('0x46')](_0x8958cb[_0x8d0a('0x2b')])){_0x8958cb[_0x8d0a('0x2b')]=undefined;loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0x8d0a('0x1e3'));}if(!_[_0x8d0a('0x46')](_0x8958cb['handlePredictive'])){loggerPredictive[_0x8d0a('0x9f')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x8958cb[_0x8d0a('0x99')]);_0x8958cb['handlePredictive']=undefined;}_0x8958cb[_0x8d0a('0x2c')]=moment()[_0x8d0a('0x7e')](_0x8d0a('0x109'));loggerPredictive[_0x8d0a('0x84')](_0x8958cb['name'],_0x8d0a('0x1e4'),_0x8958cb['startProgressive']);this[_0x8d0a('0x167')](_0x8958cb,0x1);}else if(ifInterval(_0x8958cb['dialPredictiveInterval'],_0x8958cb[_0x8d0a('0x2c')])){this['handlePower'](_0x8958cb,0x1);loggerPredictiveCalls['info'](_0x8d0a('0x1e5'),_0x8958cb[_0x8d0a('0x2c')],_0x8958cb[_0x8d0a('0x4a')]);_0x8958cb['erlangCalls']=0x0;_0x8958cb[_0x8d0a('0x75')]=0x0;}else if(_0x549e0e<_0xb1dab2&&_0x8958cb[_0x8d0a('0x1e6')]==='dropRate'){freeVariablesPredictive(_0x8958cb);loggerPredictive[_0x8d0a('0x84')](_0x8d0a('0x1e7'),_0x8d0a('0x1e8'),_0xb1dab2,_0x8d0a('0x2c'),_0x8958cb[_0x8d0a('0x4a')]);}else if(_0x2f9619<_0x8958cb[_0x8d0a('0x75')]&&_0x8958cb[_0x8d0a('0x1e6')]===_0x8d0a('0x1e9')){freeVariablesPredictive(_0x8958cb);loggerPredictive[_0x8d0a('0x84')](_0x8d0a('0x1ea'),_0x8d0a('0x1eb'),_0x2f9619,_0x8d0a('0x1ec'),_0x8958cb[_0x8d0a('0x75')],'startProgressive',_0x8958cb[_0x8d0a('0x4a')]);}else if(!ifInterval(_0x8958cb['dialPredictiveInterval'],_0x8958cb['startProgressive'])&&_[_0x8d0a('0x46')](_0x8958cb[_0x8d0a('0x2b')])&&!_[_0x8d0a('0x46')](_0x8958cb[_0x8d0a('0x2c')])){_0x8958cb[_0x8d0a('0x2b')]=moment()[_0x8d0a('0x7e')](_0x8d0a('0x109'));loggerPredictive[_0x8d0a('0x84')](_0x8958cb[_0x8d0a('0x4a')],'started\x20in\x20predictive\x20at',_0x8958cb[_0x8d0a('0x2b')]);this['averageHandleTime'](_0x8958cb[_0x8d0a('0x1ed')])[_0x8d0a('0xc2')](this[_0x8d0a('0x1ee')](_0x8958cb))[_0x8d0a('0xc2')](mergeDataErlangB(_0x8958cb))[_0x8d0a('0xc2')](this['startMethodPredictive'](_0x8958cb))['catch'](loggerCatchPredictive(_0x8d0a('0x1ef'),_0x8958cb));}else if(!ifInterval(_0x8958cb[_0x8d0a('0x1ed')],_0x8958cb[_0x8d0a('0x2b')])){_0x8958cb[_0x8d0a('0x75')]=0x0;_0x8958cb['startPredictive']=moment()['format'](_0x8d0a('0x109'));loggerPredictive[_0x8d0a('0x84')](_0x8958cb[_0x8d0a('0x4a')],_0x8d0a('0x1f0'),_0x8958cb[_0x8d0a('0x2b')]);clearInterval(_0x8958cb['handlePredictive']);_0x8958cb[_0x8d0a('0x99')]=undefined;this[_0x8d0a('0xcb')](_0x8958cb['dialPredictiveInterval'])[_0x8d0a('0xc2')](this[_0x8d0a('0x1ee')](_0x8958cb))[_0x8d0a('0xc2')](mergeDataErlangB(_0x8958cb))[_0x8d0a('0xc2')](this[_0x8d0a('0x1f1')](_0x8958cb))[_0x8d0a('0xc0')](loggerCatchPredictive(_0x8d0a('0x1f2'),_0x8958cb));}else if(_0x8958cb['predictiveIntervalAvailable']&&_0x40037e<_0x8958cb['predictiveIntervalAvailable']-_0x39bee6){freeVariablesPredictive(_0x8958cb);loggerPredictive['info'](_0x8958cb['name'],_0x8d0a('0x1f3'),_0x40037e,_0x8d0a('0x1f4'),_0x8958cb['predictiveIntervalAvailable'],'-',_0x39bee6,'=',_0x8958cb[_0x8d0a('0x1e0')]-_0x39bee6,')');}else if(_0x8958cb[_0x8d0a('0x1e0')]&&_0x40037e>_0x8958cb[_0x8d0a('0x1e0')]+_0x4cc6dd){freeVariablesPredictive(_0x8958cb);loggerPredictive[_0x8d0a('0x84')](_0x8958cb[_0x8d0a('0x4a')],_0x8d0a('0x1f3'),_0x40037e,_0x8d0a('0x1f5'),_0x8958cb[_0x8d0a('0x1e0')],'+',_0x4cc6dd,'=',_0x8958cb['predictiveIntervalAvailable']+_0x4cc6dd,')');}};Dialer[_0x8d0a('0x1d')][_0x8d0a('0x1ee')]=function(_0x2ee8d6){var _0x4fd73a=this;return function(_0xaafc61){return new Promise(function(_0x5c5140,_0x325be8){_[_0x8d0a('0x97')](_0x2ee8d6,_0xaafc61[0x0]);if(checkGetDataPredictive(_0xaafc61[0x0])){var _0x1e3001=_0x2ee8d6[_0x8d0a('0x1e0')]=_0x2ee8d6[_0x8d0a('0x5f')]+_0x2ee8d6[_0x8d0a('0xaa')];var _0x571c46=_0x2ee8d6[_0x8d0a('0x1ed')]*0x3c;var _0x261085=_0xaafc61[0x0][_0x8d0a('0x8b')]+_0xaafc61[0x0][_0x8d0a('0x71')];var _0x6a3400=(_0xaafc61[0x0][_0x8d0a('0x70')]+_0xaafc61[0x0][_0x8d0a('0x73')]+_0xaafc61[0x0][_0x8d0a('0x72')])/_0xaafc61[0x0]['predictiveIntervalTotalCalls'];_0x2ee8d6[_0x8d0a('0x76')]=_0x6a3400>0x0?_0x6a3400:0x1;switch(_0x2ee8d6[_0x8d0a('0x1e6')]){case _0x8d0a('0x1e9'):var _0x4b7535=_0x2ee8d6[_0x8d0a('0x1de')]/0x64;return _0x4fd73a[_0x8d0a('0x1f6')](_0x1e3001,_0x571c46,_0x261085,_0x6a3400,_0x4b7535)[_0x8d0a('0xc2')](function(_0x3681eb){return _0x5c5140(_0x3681eb);});case _0x8d0a('0x1f7'):var _0x2d850f=_0x2ee8d6[_0x8d0a('0x1de')]/0x64;return _0x4fd73a[_0x8d0a('0x1f8')](_0x1e3001,_0x571c46,_0x261085,_0x6a3400,_0x2d850f)['then'](function(_0x290f73){return _0x5c5140(_0x290f73);});default:return _0x325be8(msgResponse('[getDataPredictive]','Failure',_0x8d0a('0x1f9')));}}else{return _0x325be8(msgResponse(_0x8d0a('0x1fa'),_0x8d0a('0x155'),_0x8d0a('0x1fb')));}});};};Dialer['prototype'][_0x8d0a('0x1fc')]=function(_0x407df1){var _0x15de50=this;return function(_0x2870b6){return new Promise(function(_0x2b29fb,_0x1877b9){_[_0x8d0a('0x97')](_0x407df1,_0x2870b6[0x0]);if(checkGetDataPredictive(_0x2870b6[0x0])){loggerPredictive['info'](JSON[_0x8d0a('0x51')](_0x2870b6[0x0]));if(_0x407df1[_0x8d0a('0x1e6')]===_0x8d0a('0x1e9')){return _0x15de50[_0x8d0a('0xd5')](_0x407df1['id'])[_0x8d0a('0xc2')](function(_0x1e13ee){var _0x5058f6=_0x407df1[_0x8d0a('0x5a')]-_0x1e13ee[0x0][_0x8d0a('0x1fd')];var _0x5dcd93=_0x407df1[_0x8d0a('0x1ed')]*0x3c;var _0x3e2ad6=_0x2870b6[0x0][_0x8d0a('0x8b')]+_0x2870b6[0x0][_0x8d0a('0x71')];var _0x2f13a2=(_0x2870b6[0x0]['predictiveIntervalAnsweredCalls']+_0x2870b6[0x0][_0x8d0a('0x73')]+_0x2870b6[0x0][_0x8d0a('0x72')])/_0x2870b6[0x0]['predictiveIntervalTotalCalls'];var _0x9dde1e=_0x407df1[_0x8d0a('0x1de')]/0x64;_0x407df1[_0x8d0a('0x1fe')]=_0x1e13ee[0x0][_0x8d0a('0x1fd')]||0x0;_0x407df1[_0x8d0a('0x76')]=_0x2f13a2>0x0?_0x2f13a2:0x1;return _0x15de50[_0x8d0a('0x1f6')](_0x5058f6,_0x5dcd93,_0x3e2ad6,_0x2f13a2,_0x9dde1e);})[_0x8d0a('0xc2')](function(_0x17ec8d){return _0x2b29fb(_0x17ec8d);})[_0x8d0a('0xc0')](function(_0x20e016){return _0x1877b9(msgResponse(_0x8d0a('0x1ff'),_0x8d0a('0x155'),JSON[_0x8d0a('0x51')](_0x20e016)));});}if(_0x407df1[_0x8d0a('0x1e6')]===_0x8d0a('0x1f7')){return _0x15de50['getVoiceQueueRtPauses'](_0x407df1['id'])['then'](function(_0x142ec6){var _0x543cf4=_0x407df1['loggedIn']-_0x142ec6[0x0]['outboundQueuePauses'];var _0x194376=_0x407df1[_0x8d0a('0x1ed')]*0x3c;var _0x5d16ac=_0x2870b6[0x0][_0x8d0a('0x8b')]+_0x2870b6[0x0][_0x8d0a('0x71')];var _0x340869=(_0x2870b6[0x0][_0x8d0a('0x70')]+_0x2870b6[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2870b6[0x0][_0x8d0a('0x72')])/_0x2870b6[0x0]['predictiveIntervalTotalCalls'];var _0x424984=_0x407df1[_0x8d0a('0x1de')]/0x64;_0x407df1[_0x8d0a('0x1fe')]=_0x142ec6[0x0]['outboundQueuePauses']||0x0;_0x407df1[_0x8d0a('0x76')]=_0x340869>0x0?_0x340869:0x1;return _0x15de50[_0x8d0a('0x1f8')](_0x543cf4,_0x194376,_0x5d16ac,_0x340869,_0x424984);})[_0x8d0a('0xc2')](function(_0x3db8df){return _0x2b29fb(_0x3db8df);})[_0x8d0a('0xc0')](function(_0x317656){return _0x1877b9(msgResponse(_0x8d0a('0x1ff'),_0x8d0a('0x155'),JSON[_0x8d0a('0x51')](_0x317656)));});}}else{return _0x1877b9(msgResponse('[getDataPredictive]',_0x8d0a('0x155'),'check\x20failure'));}});};};Dialer[_0x8d0a('0x1d')][_0x8d0a('0x1f1')]=function(_0x289816){var _0x4342b0=this;return function(){var _0xaf3ba0=0x0;var _0x51e525=Math[_0x8d0a('0x1e2')](_0x289816[_0x8d0a('0x7a')]*0x3e8);if(_0x51e525>0x0){_0x51e525=_0x51e525<0x64?0x64:_0x51e525;loggerPredictive[_0x8d0a('0x84')](_0x289816[_0x8d0a('0x4a')],_0x8d0a('0x200'),_0x51e525,_0x8d0a('0x52'));_0x289816[_0x8d0a('0x99')]=setInterval(function(){_0x4342b0[_0x8d0a('0x99')](_0x289816);loggerPredictiveCalls[_0x8d0a('0x84')](_0x8d0a('0x201'),_0xaf3ba0+=0x1);},_0x51e525);}else{loggerPredictive[_0x8d0a('0x84')](_0x289816[_0x8d0a('0x4a')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x8d0a('0x1d')]['checkContactBlack']=function(_0x5d30ea,_0x3a884e){var _0x47c38c=this;return function(_0x428beb){if(_['isEmpty'](_0x428beb)){if(_[_0x8d0a('0xb7')](_0x3a884e['UserId'])||!_0x3a884e[_0x8d0a('0x202')]){if(_0x5d30ea[_0x8d0a('0x64')]===_0x8d0a('0x9')){_0x5d30ea[_0x8d0a('0x13f')]=_['isUndefined'](_0x5d30ea['queueStatusComplete'])?!![]:_0x5d30ea[_0x8d0a('0x13f')];var _0x8cf216=uuid['v4']();_0x47c38c[_0x8d0a('0x28')][_0x8cf216]=new Action(_0x5d30ea,_0x3a884e,_0x8cf216);loggerBooked[_0x8d0a('0x84')](_0x8d0a('0x203'),_0x8cf216,_0x8d0a('0x204'),JSON[_0x8d0a('0x51')](_0x5d30ea['queueStatusComplete']),'Queue:\x20',_0x5d30ea[_0x8d0a('0x4a')]);if(_0x5d30ea['queueStatusComplete']){_0x5d30ea[_0x8d0a('0x13f')]=![];_0x47c38c[_0x8d0a('0x2e')][_0x47c38c[_0x8d0a('0x28')][_0x8cf216][_0x8d0a('0xbb')]]=[];ami[_0x8d0a('0xb8')]({'actionid':_0x8cf216,'action':_0x8d0a('0x205'),'queue':_0x5d30ea[_0x8d0a('0x4a')]})[_0x8d0a('0xc0')](function(){_0x47c38c['updateOriginated'](_0x5d30ea);_0x47c38c[_0x8d0a('0xcd')]({'active':![],'ContactId':_0x47c38c['actions'][_0x8cf216][_0x8d0a('0x10a')],'ListId':_0x47c38c[_0x8d0a('0x28')][_0x8cf216][_0x8d0a('0xde')],'VoiceQueueId':_0x47c38c[_0x8d0a('0x28')][_0x8cf216][_0x8d0a('0xe0')]||undefined,'CampaignId':_0x47c38c[_0x8d0a('0x28')][_0x8cf216]['CampaignId']||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x47c38c[_0x8d0a('0x28')][_0x8cf216];});}else{loggerBooked[_0x8d0a('0x84')](_0x8d0a('0x206'),JSON[_0x8d0a('0x51')](_0x5d30ea[_0x8d0a('0x13f')]),_0x8d0a('0x207'),_0x5d30ea[_0x8d0a('0x4a')]);_0x47c38c[_0x8d0a('0xbc')](_0x5d30ea);_0x47c38c[_0x8d0a('0xcd')]({'active':![],'ContactId':_0x47c38c[_0x8d0a('0x28')][_0x8cf216][_0x8d0a('0x10a')],'ListId':_0x47c38c[_0x8d0a('0x28')][_0x8cf216][_0x8d0a('0xde')],'VoiceQueueId':_0x47c38c['actions'][_0x8cf216]['VoiceQueueId']||undefined,'CampaignId':_0x47c38c[_0x8d0a('0x28')][_0x8cf216][_0x8d0a('0xe1')]||undefined})[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0x208')));delete _0x47c38c[_0x8d0a('0x28')][_0x8cf216];}}else{return _0x47c38c['actionOriginate'](_0x5d30ea,_0x3a884e);}}else{if(getDiff(_0x3a884e[_0x8d0a('0x209')])<_0x5d30ea[_0x8d0a('0x20a')]*0x3c){if(_0x3a884e['Agent']&&!_0x3a884e[_0x8d0a('0x16c')][_0x8d0a('0x20b')]){_0x47c38c['preview'][_0x8d0a('0x141')](_0x3a884e['id'])[_0x8d0a('0x20')](function(){_0x47c38c[_0x8d0a('0xbc')](_0x5d30ea);});}else{_0x47c38c[_0x8d0a('0xcf')]({'active':![]},_0x3a884e['id'],0x1)[_0x8d0a('0x20')](function(){_0x47c38c['updateOriginated'](_0x5d30ea);});}}else{_0x5d30ea[_0x8d0a('0x6e')]+=0x1;_0x47c38c[_0x8d0a('0xbc')](_0x5d30ea);if(_0x5d30ea[_0x8d0a('0x20c')]){_0x47c38c[_0x8d0a('0xcd')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3a884e[_0x8d0a('0x10a')],'ListId':_0x3a884e['ListId'],'VoiceQueueId':_0x3a884e[_0x8d0a('0xe0')]||undefined,'CampaignId':_0x3a884e['CampaignId']||undefined})[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0x20d')));_0x47c38c['createHistory'](createObjHistory(_0x5d30ea,_0x3a884e,_0x8d0a('0x20e'),0x17,_0x8d0a('0x20f')))[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0x210')));}else{_0x47c38c[_0x8d0a('0xdd')](createObjHistory(_0x5d30ea,_0x3a884e,_0x8d0a('0x211'),0x16,_0x8d0a('0x212')),_0x8d0a('0x213'),'[Originate][HistoryRecallClose]');}}}}else{_0x5d30ea['outboundBlacklistCallsDay']+=0x1;_0x47c38c[_0x8d0a('0xdd')](createObjHistory(_0x5d30ea,_0x3a884e,'BLACKLIST',0xd,_0x8d0a('0x214')),_0x8d0a('0x215'),_0x8d0a('0x216'));throw _0x8d0a('0x217');}};};Dialer[_0x8d0a('0x1d')]['handleIvr']=function(_0x1f5857){var _0x449c38=this;var _0xdac769=_0x1f5857[_0x8d0a('0x218')]-_0x1f5857['originated']-_0x1f5857[_0x8d0a('0xd1')];emitCampaignSummary(_0x1f5857);if(_0xdac769>0x0){if(_0xdac769>this[_0x8d0a('0x27')]){_0xdac769=this[_0x8d0a('0x27')];}_0x1f5857['temp']+=_0xdac769;this[_0x8d0a('0xd3')](_0x1f5857['id'],_0xdac769,_0x1f5857[_0x8d0a('0x219')],_0x1f5857)['then'](function(_0x4c7543){_0x1f5857[_0x8d0a('0xd1')]-=_0xdac769;_0x1f5857[_0x8d0a('0xd1')]=_0x1f5857[_0x8d0a('0xd1')]>0x0?_0x1f5857[_0x8d0a('0xd1')]:0x0;if(!checkContactEmpty(_0x4c7543)){_0x1f5857['message']=_0x8d0a('0xa7');logger[_0x8d0a('0x84')](_0x8d0a('0x21a')+_0x1f5857[_0x8d0a('0x4a')]);}else{_0x1f5857[_0x8d0a('0x78')]+=_0x4c7543[_0x8d0a('0xa0')];_0x1f5857['message']=_0x8d0a('0x21b');for(var _0x2ddbe9=0x0;_0x2ddbe9<_0x4c7543['length'];_0x2ddbe9+=0x1){_0x1f5857[_0x8d0a('0x21c')]+=0x1;if(_[_0x8d0a('0xb7')](_0x4c7543[_0x2ddbe9])||_['isNil'](_0x4c7543[_0x2ddbe9][_0x8d0a('0x19e')])||_[_0x8d0a('0xb7')](_0x4c7543[_0x2ddbe9][_0x8d0a('0x181')])){_0x449c38[_0x8d0a('0xdc')]('[actionOriginate]\x20',_0x1f5857,_0x4c7543[_0x2ddbe9]);}else{_0x449c38[_0x8d0a('0xc9')](_[_0x8d0a('0x13e')](_0x4c7543[_0x2ddbe9],[_0x8d0a('0xe1'),_0x8d0a('0x181')]))[_0x8d0a('0xc2')](_0x449c38['checkContactBlack'](_0x1f5857,_0x4c7543[_0x2ddbe9]))['catch'](_0x449c38['loggerHandler']('[actionOriginateIvr]\x20',_0x1f5857));}}}})[_0x8d0a('0xc0')](loggerGetContactDialer('[getContactCampaign2]',_0x1f5857,_0xdac769));}};Dialer[_0x8d0a('0x1d')][_0x8d0a('0x167')]=function(_0x43ef10,_0x2f33ba){var _0x23ee31=this;var _0x461aea=[];var _0x52a8da=_0x2f33ba>=0x1?_0x2f33ba:0x1;if(_0x43ef10[_0x8d0a('0x64')]===_0x8d0a('0x9')){_0x52a8da=0x1;}var _0x22af87=Math[_0x8d0a('0x1e2')](_0x43ef10[_0x8d0a('0xaa')]*_0x52a8da)-_0x43ef10[_0x8d0a('0x78')]-_0x43ef10['temp'];emitVoiceQueueSummary(_0x43ef10);if(_0x43ef10['dialLimitQueue']>0x0){var _0xa595de=_0x43ef10[_0x8d0a('0x21d')]-_0x43ef10[_0x8d0a('0x78')]-_0x43ef10[_0x8d0a('0x5f')]-_0x43ef10['temp']-_0x43ef10[_0x8d0a('0x5b')];if(_0x22af87>_0xa595de){_0x22af87=_0xa595de;}}if(_0x22af87>0x0){if(_0x43ef10[_0x8d0a('0x64')]===_0x8d0a('0x9')){_0x22af87=0x1;}if(_0x22af87>this['maxNumberOriginate']){_0x22af87=this[_0x8d0a('0x27')];}_0x43ef10[_0x8d0a('0xd1')]+=_0x22af87;for(var _0x113f1d in this[_0x8d0a('0x25')]){if(typeof this[_0x8d0a('0x25')][_0x113f1d]!==_0x8d0a('0xa1')){if(this[_0x8d0a('0x25')][_0x113f1d][_0x8d0a('0xb1')]==='not_inuse'&&this['agents'][_0x113f1d]['status']===_0x8d0a('0x177')){_0x461aea[_0x8d0a('0x159')](this[_0x8d0a('0x25')][_0x113f1d]['id']);}}}this['getContactDialer'](_0x43ef10['id'],_0x461aea,_0x22af87,_0x43ef10[_0x8d0a('0x219')],_0x43ef10)[_0x8d0a('0xc2')](function(_0xda52f9){_0x43ef10[_0x8d0a('0xd1')]-=_0x22af87;_0x43ef10['temp']=_0x43ef10[_0x8d0a('0xd1')]>0x0?_0x43ef10[_0x8d0a('0xd1')]:0x0;if(!checkContactEmpty(_0xda52f9)){_0x23ee31[_0x8d0a('0xbe')](_0x43ef10)['then'](sendMessageReschedule(_0x43ef10))[_0x8d0a('0xc0')](loggerCatch('[countReScheduled]\x20'));}else{_0x43ef10[_0x8d0a('0x78')]+=_0xda52f9[_0x8d0a('0xa0')];_0x43ef10[_0x8d0a('0x47')]=_0x43ef10[_0x8d0a('0x64')]===_0x8d0a('0x9')?_0x8d0a('0x189'):_0x8d0a('0x21b');for(var _0x3458e2=0x0;_0x3458e2<_0xda52f9[_0x8d0a('0xa0')];_0x3458e2+=0x1){if(_[_0x8d0a('0xb7')](_0xda52f9[_0x3458e2])||_['isNil'](_0xda52f9[_0x3458e2]['Contact'])||_[_0x8d0a('0xb7')](_0xda52f9[_0x3458e2]['phone'])){_0x23ee31['emptyContact'](_0x8d0a('0x21e'),_0x43ef10,_0xda52f9[_0x3458e2]);}else{_0x23ee31[_0x8d0a('0xc3')](_['pick'](_0xda52f9[_0x3458e2],[_0x8d0a('0xe0'),_0x8d0a('0x181')]))[_0x8d0a('0xc2')](_0x23ee31[_0x8d0a('0x21f')](_0x43ef10,_0xda52f9[_0x3458e2]))[_0x8d0a('0xc0')](_0x23ee31[_0x8d0a('0xdb')](_0x8d0a('0x21e'),_0x43ef10));}}}})[_0x8d0a('0xc0')](loggerGetContactDialer(_0x8d0a('0x220'),_0x43ef10,_0x22af87));}};Dialer['prototype'][_0x8d0a('0x99')]=function(_0x51afa1){if(_0x51afa1['dialLimitQueue']>0x0){var _0x53838f=_0x51afa1[_0x8d0a('0x21d')]-_0x51afa1[_0x8d0a('0x78')]-_0x51afa1[_0x8d0a('0x5f')];if(_0x53838f>0x0){this[_0x8d0a('0x221')](_0x51afa1);}else{loggerPredictiveCalls[_0x8d0a('0x84')](_0x8d0a('0x222'));}}else{this[_0x8d0a('0x221')](_0x51afa1);}};Dialer[_0x8d0a('0x1d')]['tryOriginatePredictive']=function(_0x4e79ae){var _0x311494=this;var _0x4ba7cb=[];_0x4e79ae[_0x8d0a('0x78')]+=0x1;for(var _0x577252 in this[_0x8d0a('0x25')]){if(typeof this[_0x8d0a('0x25')][_0x577252]!=='undefined'){if(this[_0x8d0a('0x25')][_0x577252]['state']===_0x8d0a('0x223')&&this['agents'][_0x577252]['status']==='reachable'){_0x4ba7cb[_0x8d0a('0x159')](this[_0x8d0a('0x25')][_0x577252]['id']);}}}this[_0x8d0a('0x224')](_0x4e79ae['id'],_0x4ba7cb,0x1,_0x4e79ae['dialOrderByScheduledAt'],_0x4e79ae)[_0x8d0a('0xc2')](function(_0x37a587){if(!checkContactEmpty(_0x37a587)){checkContactLowerLimitOriginate(_0x4e79ae,0x1,0x0);_0x311494[_0x8d0a('0xbe')](_0x4e79ae)['then'](sendMessageReschedule(_0x4e79ae))[_0x8d0a('0xc0')](loggerCatch(_0x8d0a('0xc1')));}else{_0x4e79ae[_0x8d0a('0x47')]=_0x8d0a('0x21b');if(_[_0x8d0a('0xb7')](_0x37a587[0x0])||_['isNil'](_0x37a587[0x0][_0x8d0a('0x19e')])||_[_0x8d0a('0xb7')](_0x37a587[0x0]['phone'])){_0x311494['emptyContact']('[actionOriginate]\x20',_0x4e79ae,_0x37a587[0x0]);}else{_0x311494[_0x8d0a('0xc3')](_[_0x8d0a('0x13e')](_0x37a587[0x0],[_0x8d0a('0xe0'),'phone']))[_0x8d0a('0xc2')](_0x311494['checkContactBlack'](_0x4e79ae,_0x37a587[0x0]))[_0x8d0a('0xc0')](_0x311494[_0x8d0a('0xdb')](_0x8d0a('0x225'),_0x4e79ae));}}})[_0x8d0a('0xc0')](loggerGetContactDialer(_0x8d0a('0x226'),_0x4e79ae,0x1));emitVoiceQueueSummary(_0x4e79ae);};Dialer[_0x8d0a('0x1d')][_0x8d0a('0x1f6')]=function(_0x2b8e15,_0x5f204f,_0x16112d,_0x56f6ef,_0x4a2269,_0x4d07b3){loggerPredictive[_0x8d0a('0x84')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x8d0a('0x84')](_0x8d0a('0x227'),_0x2b8e15);loggerPredictive[_0x8d0a('0x84')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5f204f);loggerPredictive['info'](_0x8d0a('0x228'),_0x16112d);loggerPredictive[_0x8d0a('0x84')]('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',_0x56f6ef);loggerPredictive[_0x8d0a('0x84')](_0x8d0a('0x229'),_0x4a2269);loggerPredictive[_0x8d0a('0x84')](_0x8d0a('0x8c'));return new Promise(function(_0x4b6846,_0x2d08ec){if(_0x2b8e15<=0x0||isNaN(_0x2b8e15)){return _0x2d08ec(msgResponse('[abandonmentRate]','Error',_0x8d0a('0x22a')+_0x2b8e15));}if(_0x16112d<=0x0||isNaN(_0x16112d)){return _0x2d08ec(msgResponse('[abandonmentRate]',_0x8d0a('0x50'),_0x8d0a('0x22b')+_0x16112d));}if(_0x56f6ef<=0x0||isNaN(_0x56f6ef)){return _0x2d08ec(msgResponse(_0x8d0a('0x22c'),_0x8d0a('0x50'),_0x8d0a('0x22d')+_0x56f6ef));}if(_0x5f204f<=0x0||isNaN(_0x5f204f)){return _0x2d08ec(msgResponse(_0x8d0a('0x22c'),_0x8d0a('0x50'),'interval\x20=\x20'+_0x5f204f));}if(_0x4a2269<=0x0||isNaN(_0x4a2269)){return _0x2d08ec(msgResponse('[abandonmentRate]',_0x8d0a('0x50'),_0x8d0a('0x22e')+_0x4a2269));}_0x4d07b3=_0x4d07b3||0x0;var _0x225acf=0x1/_0x16112d;var _0x51c182=0x0;var _0x503e8f=0x0;var _0x23d6b4=0x0;var _0x5b3ee6=0x0;for(var _0x2e8c80=0x0;_0x23d6b4<_0x4a2269;_0x2e8c80+=0x1){_0x503e8f=_0x2e8c80/_0x5f204f;_0x51c182=(_0x56f6ef*_0x503e8f+_0x4d07b3)/_0x225acf;_0x23d6b4=erlangb(_0x51c182,_0x2b8e15);_0x5b3ee6=_0x51c182/_0x2b8e15*(0x1-erlangb(_0x51c182,_0x2b8e15));}return _0x4b6846({'erlangCalls':_0x2e8c80,'erlangCallToSecond':_0x5f204f/_0x2e8c80,'erlangAbandonmentRate':_0x23d6b4,'erlangBusyFactor':_0x5b3ee6});});};Dialer['prototype'][_0x8d0a('0x1f8')]=function(_0x1b0109,_0x6c01bd,_0x44ab35,_0x1f2c63,_0xf52f67,_0x1ebf2d){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive['info'](_0x8d0a('0x227'),_0x1b0109);loggerPredictive[_0x8d0a('0x84')](_0x8d0a('0x22f'),_0x6c01bd);loggerPredictive[_0x8d0a('0x84')](_0x8d0a('0x228'),_0x44ab35);loggerPredictive[_0x8d0a('0x84')](_0x8d0a('0x230'),_0x1f2c63);loggerPredictive[_0x8d0a('0x84')](_0x8d0a('0x231'),_0xf52f67);loggerPredictive[_0x8d0a('0x84')](_0x8d0a('0x8c'));return new Promise(function(_0x105e35,_0x34167a){if(_0x1b0109<=0x0||isNaN(_0x1b0109)){return _0x34167a(msgResponse(_0x8d0a('0x232'),_0x8d0a('0x50'),'m\x20=\x20'+_0x1b0109));}if(_0x44ab35<=0x0||isNaN(_0x44ab35)){return _0x34167a(msgResponse(_0x8d0a('0x232'),'Error',_0x8d0a('0x22b')+_0x44ab35));}if(_0x1f2c63<=0x0||isNaN(_0x1f2c63)){return _0x34167a(msgResponse('[busyFactor]',_0x8d0a('0x50'),_0x8d0a('0x22d')+_0x1f2c63));}if(_0x6c01bd<=0x0||isNaN(_0x6c01bd)){return _0x34167a(msgResponse(_0x8d0a('0x232'),_0x8d0a('0x50'),_0x8d0a('0x233')+_0x6c01bd));}if(_0xf52f67<=0x0||isNaN(_0xf52f67)){return _0x34167a(msgResponse(_0x8d0a('0x232'),_0x8d0a('0x50'),'Umin\x20=\x20'+_0xf52f67));}_0x1ebf2d=_0x1ebf2d||0x0;var _0x673c17=0x1/_0x44ab35;var _0x47601a=0x0;var _0x2e3725=0x0;var _0x1667c4=0x0;var _0x456d49=0x0;for(var _0x1cdab2=0x0;_0x456d49<_0xf52f67;_0x1cdab2+=0x1){_0x2e3725=_0x1cdab2/_0x6c01bd;_0x47601a=(_0x1f2c63*_0x2e3725+_0x1ebf2d)/_0x673c17;_0x1667c4=erlangb(_0x47601a,_0x1b0109);_0x456d49=_0x47601a/_0x1b0109*(0x1-erlangb(_0x47601a,_0x1b0109));}return _0x105e35({'erlangCalls':_0x1cdab2,'erlangCallToSecond':_0x6c01bd/_0x1cdab2,'erlangAbandonmentRate':_0x1667c4,'erlangBusyFactor':_0x456d49});});};module[_0x8d0a('0x234')]=Dialer;
\ No newline at end of file
+var _0xb6ab=['dialGlobalInterval','dialTimezone','[syncQueueSummary]','throttle','filter','map','Agent','syncCampaigns','[syncCampaigns]','\x5cw{0,','pow','replace','object','originate','phone','contact\x20is\x20undefine','NONE','dialQueueProject2','outbound','dialQueueOptions','dialAgiAfterHangupAgent','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDTOTALANALYSISTIME','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','%s%s','toUpper','dialRandomLastDigitCallerIdNumber','TrunkBackup','dialPrefix','trim','SIP/%s/%s%s','substring','dialCutDigit','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','Error','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','evt\x20is\x20undefine','outboundNoSuchCallsDay','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','reason\x205\x20busy','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','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(','dialPredictiveOptimizationPercentage','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','predictiveIntervalPauses','outboundQueuePauses','abandonmentRate','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','[countReScheduled]\x20','ACTIVE','loggerHandler','[getContactDialer2]','tryOriginatePredictive','not_inuse','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\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','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','p\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\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]','Ts\x20=\x20','interval\x20=\x20','Umin\x20=\x20','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','predictive','syncQueueSummary','../ami','defaults','localhost','redis','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','../rpc/setting','./action','./history','./final','./agentComplete','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','enqueue','tail','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummaryComplete','syncHangup','newexten','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','getSettings','previewRecallmeReminderInterval','isUndefined','name','\x20AGENTS\x20NOT\x20LOGGED','message','Interval','INTERVAL_IS_NULL','Intervals','\x20INTERVAL_IS_NULL','[ifTime][Action]','milliseconds','diff','seconds','emit','type','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','callerid','stringify','format','voice:queue:%s','ivr','campaign:ivr:%s','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','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','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','error','stack','originated','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','waiting','NOT_ACTIVE','debug','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','starttime','loopClearZombieChannels','clearZombieChannels','[uniqueid]','[actions]','isNil','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','resolve','then','countReScheduled','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','emptyContact','notFound','saveInDb','ContactId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','reachable','SIP/%s','unmonitored','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','statedesc','HangupInAMD','membername','AMD','custom:amd','buildObj','[syncHangupInAMD]','MACHINE','uniqueid','Machine','countmachineretry','countglobal','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','[syncHangupInAMDIvr]','countcongestionretry','countnoanswerretry','reason\x2019\x20machine....','CampaignId','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','cause-txt','Unknow','reason','agent','agiafterat','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','[rescheduleContact][Drop]','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','strategy','roundrobin','locked','paused','stateinterface','push','pick','idHopper','queueStatusComplete','run','finally','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','loopCampaigns','resetActiveCalls','checkIsTrunkReachable','isTrunkReachable','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','\x20Timezone\x20unknow\x20','iftime\x20%s,%s','content','indexOf','Action','command','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','booked','Queue','handlePreviewRecallNotifications','user:%s','user:dialPreviewRecallReminder','launchHandleIvr'];(function(_0xe4c712,_0x1e26d5){var _0x101962=function(_0x1bfc5a){while(--_0x1bfc5a){_0xe4c712['push'](_0xe4c712['shift']());}};_0x101962(++_0x1e26d5);}(_0xb6ab,0xb3));var _0xbb6a=function(_0x14fa01,_0x4c66c4){_0x14fa01=_0x14fa01-0x0;var _0x1084cd=_0xb6ab[_0x14fa01];return _0x1084cd;};'use strict';var util=require('util');var _=require('lodash');var uuid=require(_0xbb6a('0x0'));var moment=require(_0xbb6a('0x1'));var rr=require('rr');var md5=require(_0xbb6a('0x2'));var Redis=require(_0xbb6a('0x3'));var ut=require(_0xbb6a('0x4'));var config=require(_0xbb6a('0x5'));var logger=require(_0xbb6a('0x6'))(_0xbb6a('0x7'));var loggerBooked=require(_0xbb6a('0x6'))('booked');var loggerPredictive=require(_0xbb6a('0x6'))(_0xbb6a('0x8'));var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require(_0xbb6a('0x6'))(_0xbb6a('0x9'));var ami=require(_0xbb6a('0xa'));config['redis']=_[_0xbb6a('0xb')](config['redis'],{'host':_0xbb6a('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbb6a('0xd')]));var cmHopper=require(_0xbb6a('0xe'));var cmHopperHistory=require(_0xbb6a('0xf'));var cmHopperAdditionalPhone=require(_0xbb6a('0x10'));var cmHopperBlack=require(_0xbb6a('0x11'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0xbb6a('0x12'));var Action=require(_0xbb6a('0x13'));var History=require(_0xbb6a('0x14'));var Final=require(_0xbb6a('0x15'));var AgentComplete=require(_0xbb6a('0x16'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require('./hangup');var ipAgi=process[_0xbb6a('0x17')][_0xbb6a('0x18')]||_0xbb6a('0x19');var strategy={'rrmemory':_0xbb6a('0x1a'),'roundrobin':'roundrobin'};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xbb6a('0x1b')][_0xbb6a('0x1c')]=function(_0x55d885){this['tail']=this['tail']?this[_0xbb6a('0x1d')]['finally'](_0x55d885):_0x55d885();};function Dialer(_0x96c63a,_0x5df6c8){this[_0xbb6a('0x1e')]=new Sequence();this['preview']=_0x5df6c8;this[_0xbb6a('0x1f')]=_0x96c63a[_0xbb6a('0x1f')];this[_0xbb6a('0x20')]=_0x96c63a[_0xbb6a('0x20')];this[_0xbb6a('0x21')]=_0x96c63a[_0xbb6a('0x21')];this['trunks']=_0x96c63a[_0xbb6a('0x22')];this[_0xbb6a('0x23')]=config[_0xbb6a('0x23')]||0x2;this[_0xbb6a('0x24')]={};this[_0xbb6a('0x25')]={};this[_0xbb6a('0x26')]={};this[_0xbb6a('0x27')]={};this[_0xbb6a('0x28')]={};this[_0xbb6a('0x29')]={};this['startProgressive']={};this[_0xbb6a('0x2a')]={};this[_0xbb6a('0x2b')]={};this[_0xbb6a('0x2c')]={};ami['on']('agentconnect',this[_0xbb6a('0x2d')][_0xbb6a('0x2e')](this));ami['on']('queuecallerabandon',this[_0xbb6a('0x2f')][_0xbb6a('0x2e')](this));ami['on'](_0xbb6a('0x30'),this[_0xbb6a('0x31')][_0xbb6a('0x2e')](this));ami['on'](_0xbb6a('0x32'),this[_0xbb6a('0x33')][_0xbb6a('0x2e')](this));ami['on'](_0xbb6a('0x34'),this['syncQueueSummary'][_0xbb6a('0x2e')](this));ami['on']('custom:queuesummarycomplete',this[_0xbb6a('0x35')][_0xbb6a('0x2e')](this));ami['on']('hangup',this[_0xbb6a('0x36')][_0xbb6a('0x2e')](this));ami['on'](_0xbb6a('0x37'),this['syncNewExten'][_0xbb6a('0x2e')](this));ami['on']('varset',this[_0xbb6a('0x38')][_0xbb6a('0x2e')](this));ami['on'](_0xbb6a('0x39'),this[_0xbb6a('0x3a')][_0xbb6a('0x2e')](this));ami['on'](_0xbb6a('0x3b'),this[_0xbb6a('0x3c')][_0xbb6a('0x2e')](this));this['loopCampaigns']();this['loopClearZombieChannels']();RpcSetting[_0xbb6a('0x3d')]()['then'](function(_0x6367ce){previewRecallmeReminderInterval=_0x6367ce[_0xbb6a('0x3e')];});}function isNotNull(_0x34ed8f){return _0x34ed8f!==null&&!_[_0xbb6a('0x3f')](_0x34ed8f);}function checkIsLoggedIn(_0x22622e,_0x25d1f8){return function(){if(_0x25d1f8<=0x0){_0x22622e['message']='AGENTS_NOT_LOGGED';throw _0x22622e[_0xbb6a('0x40')]+_0xbb6a('0x41');}};}function isActive(_0x2d6ddf){return _0x2d6ddf;}function checkIsActive(_0x43e250,_0x582b81){return function(){if(!isActive(_0x582b81)){_0x43e250[_0xbb6a('0x42')]='NOT_ACTIVE';throw _0x43e250[_0xbb6a('0x40')]+'\x20NOT\x20Active';}};}function checkInterval(_0x54da3c){return function(){if(!isNotNull(_0x54da3c[_0xbb6a('0x43')])){_0x54da3c['message']=_0xbb6a('0x44');throw _0x54da3c[_0xbb6a('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x54da3c[_0xbb6a('0x43')]['Intervals'])){_0x54da3c[_0xbb6a('0x42')]=_0xbb6a('0x44');throw _0x54da3c[_0xbb6a('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_['isEmpty'](_0x54da3c['Interval'][_0xbb6a('0x45')]))){_0x54da3c[_0xbb6a('0x42')]='INTERVAL_IS_NULL';throw _0x54da3c[_0xbb6a('0x40')]+_0xbb6a('0x46');}};}function msgResponse(_0x214620,_0x5868b6,_0x6e942b){return{'action':_0x214620,'response':_0x5868b6,'message':_0x6e942b,'stack':_0x6e942b};}function myreject(_0xfbbe25){return function(_0x4e25c7){return _0xfbbe25(msgResponse(_0xbb6a('0x47'),'Error',JSON['stringify'](_0x4e25c7)));};}function getSeconds(_0x2bdef7,_0x53c5a9){var _0x13bd27=moment(_0x2bdef7)[_0xbb6a('0x48')](0x0);var _0x4a72f2=moment(_0x53c5a9)[_0xbb6a('0x48')](0x0);return _0x13bd27[_0xbb6a('0x49')](_0x4a72f2,_0xbb6a('0x4a'));}function emit(_0x3118c8,_0x117920,_0x31c9f9){io['to'](_0x3118c8)[_0xbb6a('0x4b')](_0x117920,_0x31c9f9);}function emitVoiceQueueSummary(_0x46f114){if(_0x46f114[_0xbb6a('0x4c')]==='outbound'){var _0x27e0e1={'id':_0x46f114['id'],'name':_0x46f114['name'],'strategy':_0x46f114['strategy'],'answered':_0x46f114[_0xbb6a('0x4d')],'available':_0x46f114[_0xbb6a('0x4e')],'loggedIn':_0x46f114[_0xbb6a('0x4f')],'pTalking':_0x46f114[_0xbb6a('0x50')],'sumBillable':_0x46f114[_0xbb6a('0x51')],'sumDuration':_0x46f114[_0xbb6a('0x52')],'sumHoldTime':_0x46f114[_0xbb6a('0x53')]||0x0,'talking':_0x46f114['talking'],'total':_0x46f114['total'],'type':_0x46f114['type'],'unmanaged':_0x46f114[_0xbb6a('0x54')],'abandoned':_0x46f114[_0xbb6a('0x55')],'waiting':_0x46f114['waiting'],'loggedInDb':_0x46f114[_0xbb6a('0x56')],'dialActive':_0x46f114[_0xbb6a('0x57')],'dialMethod':_0x46f114[_0xbb6a('0x58')],'dialOriginateCallerIdName':_0x46f114[_0xbb6a('0x59')],'dialOriginateCallerIdNumber':_0x46f114[_0xbb6a('0x5a')],'dialOriginateTimeout':_0x46f114[_0xbb6a('0x5b')],'dialPrefix':_0x46f114['dialPrefix'],'outboundAnswerAgiCallsDay':_0x46f114['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x46f114['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x46f114[_0xbb6a('0x5c')],'outboundBusyCallsDay':_0x46f114[_0xbb6a('0x5d')],'outboundCongestionCallsDay':_0x46f114[_0xbb6a('0x5e')],'outboundDropCallsDayACS':_0x46f114[_0xbb6a('0x5f')],'outboundDropCallsDayCallersExit':_0x46f114[_0xbb6a('0x60')],'outboundDropCallsDayTimeout':_0x46f114[_0xbb6a('0x61')],'outboundNoAnswerCallsDay':_0x46f114[_0xbb6a('0x62')],'outboundNoSuchCallsDay':_0x46f114['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x46f114['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x46f114[_0xbb6a('0x63')],'outboundRejectCallsDay':_0x46f114[_0xbb6a('0x64')],'outboundUnknownCallsDay':_0x46f114[_0xbb6a('0x65')],'predictiveIntervalAnsweredCalls':_0x46f114['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x46f114[_0xbb6a('0x66')],'predictiveIntervalAvgTalktime':_0x46f114[_0xbb6a('0x67')],'predictiveIntervalDroppedCallsCallersExit':_0x46f114[_0xbb6a('0x68')],'predictiveIntervalDroppedCallsTimeout':_0x46f114[_0xbb6a('0x69')],'predictiveIntervalErlangCalls':_0x46f114[_0xbb6a('0x6a')],'predictiveIntervalErlangCallsDroppedCalls':_0x46f114['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x46f114[_0xbb6a('0x6b')],'predictiveIntervalMultiplicativeFactor':_0x46f114[_0xbb6a('0x6c')],'predictiveIntervalPauses':_0x46f114['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x46f114[_0xbb6a('0x6d')],'predictiveIntervalTotalCalls':_0x46f114[_0xbb6a('0x6e')],'message':_0x46f114[_0xbb6a('0x42')],'originated':_0x46f114['originated'],'erlangCalls':_0x46f114['erlangCalls'],'erlangCallToSecond':_0x46f114[_0xbb6a('0x6f')],'erlangAbandonmentRate':_0x46f114[_0xbb6a('0x70')],'erlangBusyFactor':_0x46f114[_0xbb6a('0x71')],'startPredictive':_0x46f114[_0xbb6a('0x29')],'startProgressive':_0x46f114[_0xbb6a('0x72')]};if(_0x46f114[_0xbb6a('0x73')]){_0x27e0e1[_0xbb6a('0x73')]={'id':_0x46f114[_0xbb6a('0x73')]['id'],'name':_0x46f114[_0xbb6a('0x73')]['name'],'active':_0x46f114[_0xbb6a('0x73')][_0xbb6a('0x74')],'callerid':_0x46f114[_0xbb6a('0x73')][_0xbb6a('0x75')]};}if(_0x46f114['Interval']){_0x27e0e1[_0xbb6a('0x43')]={'id':_0x46f114[_0xbb6a('0x43')]['id'],'name':_0x46f114['Interval'][_0xbb6a('0x40')]};}var _0x122713=md5(JSON[_0xbb6a('0x76')](_0x27e0e1));if(_0x46f114['md5']!==_0x122713){_0x46f114[_0xbb6a('0x2')]=_0x122713;emit(util[_0xbb6a('0x77')](_0xbb6a('0x78'),_0x27e0e1[_0xbb6a('0x40')]),'voice_queue:save',_0x27e0e1);}}}function emitCampaignSummary(_0x1097e7){if(_0x1097e7['type']===_0xbb6a('0x79')){emit(util[_0xbb6a('0x77')](_0xbb6a('0x7a'),_0x1097e7[_0xbb6a('0x40')]),'campaign:save',_0x1097e7);}}function checkGetDataPredictive(_0x29b619){if(isNotNull(_0x29b619)&&!_[_0xbb6a('0x7b')](_0x29b619)){loggerPredictive[_0xbb6a('0x7c')](_0xbb6a('0x7d'));loggerPredictive[_0xbb6a('0x7c')](_0xbb6a('0x7e'),_0x29b619[_0xbb6a('0x6e')]);loggerPredictive[_0xbb6a('0x7c')](_0xbb6a('0x7f'),_0x29b619[_0xbb6a('0x80')]);loggerPredictive[_0xbb6a('0x7c')](_0xbb6a('0x81'),_0x29b619[_0xbb6a('0x69')]);loggerPredictive[_0xbb6a('0x7c')](_0xbb6a('0x82'),_0x29b619['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xbb6a('0x7c')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x29b619[_0xbb6a('0x66')]);loggerPredictive[_0xbb6a('0x7c')](_0xbb6a('0x83'),_0x29b619[_0xbb6a('0x67')]);loggerPredictive['info'](_0xbb6a('0x84'));if(_0x29b619[_0xbb6a('0x6e')]>0x0){if(!_[_0xbb6a('0x3f')](_0x29b619[_0xbb6a('0x67')])&&_0x29b619[_0xbb6a('0x67')]>0x0){return!![];}loggerPredictive[_0xbb6a('0x7c')](_0xbb6a('0x85'));if(!_['isUndefined'](_0x29b619[_0xbb6a('0x66')])&&_0x29b619['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive['info'](_0xbb6a('0x86'));}else{loggerPredictive[_0xbb6a('0x7c')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xbb6a('0x7c')](_0xbb6a('0x87'));}return![];}function mergeDataErlangB(_0xc681){return function(_0x534bbc){loggerPredictive[_0xbb6a('0x7c')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xbb6a('0x7c')](_0xbb6a('0x88'),_0x534bbc[_0xbb6a('0x89')]);loggerPredictive[_0xbb6a('0x7c')](_0xbb6a('0x8a'),_0x534bbc['erlangCallToSecond']);loggerPredictive['info'](_0xbb6a('0x8b'),_0x534bbc['erlangAbandonmentRate']);loggerPredictive[_0xbb6a('0x7c')](_0xbb6a('0x8c'),_0x534bbc['erlangBusyFactor']);loggerPredictive[_0xbb6a('0x7c')](_0xbb6a('0x8b'),_0x534bbc[_0xbb6a('0x70')]);loggerPredictive['info'](_0xbb6a('0x84'));_[_0xbb6a('0x8d')](_0xc681,_0x534bbc);};}function getDiff(_0x584571){var _0x354709=moment()[_0xbb6a('0x48')](0x0);var _0x3a85f8=moment(_0x584571)[_0xbb6a('0x48')](0x0);return _0x354709[_0xbb6a('0x49')](_0x3a85f8,_0xbb6a('0x4a'));}function ifInterval(_0x75869d,_0x1027c9){if(_[_0xbb6a('0x3f')](_0x1027c9)){return![];}return getDiff(_0x1027c9)<_0x75869d*0x3c;}function freeVariablesPredictive(_0x23f406){if(isNotNull(_0x23f406)){if(!_[_0xbb6a('0x3f')](_0x23f406[_0xbb6a('0x72')])){_0x23f406[_0xbb6a('0x72')]=undefined;loggerPredictive[_0xbb6a('0x7c')](_0x23f406['name'],'clearing\x20variable\x20start\x20progressive');}if(!_[_0xbb6a('0x3f')](_0x23f406[_0xbb6a('0x29')])){_0x23f406[_0xbb6a('0x29')]=undefined;loggerPredictive['info'](_0x23f406['name'],'clearing\x20variable\x20start\x20predictive');}if(!_[_0xbb6a('0x3f')](_0x23f406[_0xbb6a('0x8e')])){clearInterval(_0x23f406[_0xbb6a('0x8e')]);_0x23f406['handlePredictive']=undefined;loggerPredictive[_0xbb6a('0x7c')](_0x23f406['name'],_0xbb6a('0x8f'));}}}function erlangb(_0x5a7e2c,_0x3cbc21){if(_0x3cbc21===0x0){return 0x0;}var _0x2d8702=0x1;for(var _0x45b3d8=0x1;_0x45b3d8<=_0x3cbc21;_0x45b3d8+=0x1){_0x2d8702=0x1+_0x2d8702*_0x45b3d8/_0x5a7e2c;}return 0x1/_0x2d8702;}function isVoiceQueueOutbound(_0x5e4e50){return _0x5e4e50==='outbound';}function isNotPreview(_0x55e9d4){return _0x55e9d4!==_0xbb6a('0x90');}function isCampaignIvr(_0x22f709){return _0x22f709===_0xbb6a('0x79');}function getCallerId(_0x460ab2,_0x17ed79,_0x4b7f5d){if(!_[_0xbb6a('0x3f')](_0x4b7f5d)&&typeof _0x4b7f5d===_0xbb6a('0x91')&&!_[_0xbb6a('0x7b')](_0x4b7f5d)){if(!_[_0xbb6a('0x3f')](_0x17ed79)&&typeof _0x17ed79===_0xbb6a('0x91')&&!_[_0xbb6a('0x7b')](_0x17ed79)){return util['format'](_0xbb6a('0x92'),_0x17ed79,_0x4b7f5d);}return util['format']('\x22%s\x22\x20<%s>',_0x4b7f5d,_0x4b7f5d);}if(!_[_0xbb6a('0x3f')](_0x460ab2)&&typeof _0x460ab2===_0xbb6a('0x91')&&!_[_0xbb6a('0x7b')](_0x460ab2)){return _0x460ab2;}return _0xbb6a('0x93');}function loggerCatchQueueSummary(_0x20ea98,_0x398c59){return function(_0x464991){freeVariablesPredictive(_0x398c59);emitVoiceQueueSummary(_0x398c59);emitCampaignSummary(_0x398c59);loggerSyncQueueSummary['debug'](_0x20ea98,util[_0xbb6a('0x94')](_0x464991,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x131f79,_0x3cba46){return function(_0x267fa8){loggerPredictive[_0xbb6a('0x95')](_0x3cba46[_0xbb6a('0x40')],_0x131f79);loggerPredictive[_0xbb6a('0x95')](_0x267fa8[_0xbb6a('0x96')]);freeVariablesPredictive(_0x3cba46);};}function loggerCatch(_0x5165a9){return function(_0x1c18ec){logger[_0xbb6a('0x95')](_0x5165a9,util[_0xbb6a('0x94')](_0x1c18ec,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2a916a){return _0x2a916a&&!_[_0xbb6a('0x3f')](_0x2a916a)&&_0x2a916a['length']>0x0;}function decremetOriginate(_0x563978){if(!_[_0xbb6a('0x3f')](_0x563978)&&_0x563978!==null){if(typeof _0x563978[_0xbb6a('0x97')]!==_0xbb6a('0x98')){if(_0x563978[_0xbb6a('0x97')]>0x0){_0x563978[_0xbb6a('0x97')]-=0x1;}else{logger[_0xbb6a('0x95')](_0xbb6a('0x99'));}}}else{logger[_0xbb6a('0x95')](_0xbb6a('0x9a'));}}function checkContactLowerLimitOriginate(_0x34db3f,_0x5e099c,_0x398247){if(_0x5e099c>_0x398247){for(var _0x257ea9=0x0;_0x257ea9<_0x5e099c-_0x398247;_0x257ea9+=0x1){decremetOriginate(_0x34db3f);}}}function loggerGetContactDialer(_0x5d54ce,_0x2608f7,_0x3be894){return function(_0xc9b370){checkContactLowerLimitOriginate(_0x2608f7,_0x3be894,0x0);logger[_0xbb6a('0x95')](_0x5d54ce,util[_0xbb6a('0x94')](_0xc9b370,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5379d7){return function(_0x36a00e){if(isNotNull(_0x36a00e)&&isNotNull(_0x36a00e[0x0])){if(_0x36a00e[0x0][_0xbb6a('0x9b')]>0x0){_0x5379d7[_0xbb6a('0x42')]=_0xbb6a('0x9c');logger[_0xbb6a('0x7c')]('[getContactDialer2][ReScheduled]'+_0x5379d7[_0xbb6a('0x40')],_0x36a00e[0x0]['contactsRescheduled'],_0xbb6a('0x9d'));}else{_0x5379d7[_0xbb6a('0x42')]=_0xbb6a('0x9e');logger[_0xbb6a('0x7c')](_0xbb6a('0x9f')+_0x5379d7[_0xbb6a('0x40')]);}}};}function notSendMessagesQueue(_0x214f7f){if(_0x214f7f[_0xbb6a('0xa0')]){freeVariablesPredictive(_0x214f7f);if(_0x214f7f[_0xbb6a('0x97')]===0x0&&_0x214f7f[_0xbb6a('0xa1')]===0x0&&_0x214f7f[_0xbb6a('0xa2')]===0x0&&(_0x214f7f[_0xbb6a('0x50')]||0x0)===0x0){_0x214f7f[_0xbb6a('0xa0')]=![];_0x214f7f['available']=0x0;_0x214f7f[_0xbb6a('0x42')]=_0xbb6a('0xa3');loggerSyncQueueSummary[_0xbb6a('0xa4')](_0xbb6a('0xa5'),_0x214f7f[_0xbb6a('0x40')],_0xbb6a('0xa6'));}else{_0x214f7f[_0xbb6a('0x42')]=_0xbb6a('0xa7');loggerSyncQueueSummary['debug'](_0xbb6a('0xa5'),_0x214f7f[_0xbb6a('0x40')],_0xbb6a('0xa8'));}emitVoiceQueueSummary(_0x214f7f);}}function notSendMessagesCampaign(_0x5a78ad){if(_0x5a78ad['sendMessageOneNotActive']){if(_0x5a78ad[_0xbb6a('0x97')]===0x0){_0x5a78ad[_0xbb6a('0xa0')]=![];_0x5a78ad['message']=_0xbb6a('0xa3');loggerSyncQueueSummary[_0xbb6a('0xa4')](_0xbb6a('0xa9'),_0x5a78ad[_0xbb6a('0x40')],_0xbb6a('0xa6'));}else{_0x5a78ad['message']='IS_DISACTIVED';loggerSyncQueueSummary[_0xbb6a('0xa4')](_0xbb6a('0xa9'),_0x5a78ad['name'],_0xbb6a('0xa8'));}emitCampaignSummary(_0x5a78ad);}}function createObjHistory(_0xddaa94,_0x2554fb,_0x49952c,_0x1c46d1,_0x12af32){_0xddaa94[_0xbb6a('0x42')]=_0x49952c;var _0x50c860=new Action(_0xddaa94,_0x2554fb);var _0x53272f=new History(_0x50c860);_0x53272f[_0xbb6a('0xaa')]=_0x1c46d1;_0x53272f['statedesc']=_0x12af32;_0x53272f['endtime']=_0x50c860[_0xbb6a('0xab')];return _0x53272f;}Dialer[_0xbb6a('0x1b')][_0xbb6a('0xac')]=function(){var _0x31152f=this;setInterval(function(){_0x31152f[_0xbb6a('0xad')](_0x31152f[_0xbb6a('0x27')],_0xbb6a('0xae'));_0x31152f[_0xbb6a('0xad')](_0x31152f[_0xbb6a('0x25')],_0xbb6a('0xaf'));},0x32c8);};Dialer[_0xbb6a('0x1b')][_0xbb6a('0xad')]=function(_0x2942b1,_0x3ab1ee){var _0x2f1dec=this;for(var _0x58d9de in _0x2942b1){if(typeof _0x2942b1[_0x58d9de]!==_0xbb6a('0x98')){this[_0xbb6a('0x1e')][_0xbb6a('0x1c')](function(){if(!_[_0xbb6a('0xb0')](_0x2942b1[_0x58d9de])){return ami['Action']({'action':_0xbb6a('0xb1'),'channel':_0x2942b1[_0x58d9de][_0xbb6a('0xb2')]})[_0xbb6a('0xb3')](function(_0xd9c62c){if(_0xd9c62c['message']===_0xbb6a('0xb4')){setTimeout(function(){if(_0x2942b1[_0x58d9de]&&_0x2942b1[_0x58d9de][_0xbb6a('0x4c')]!==_0xbb6a('0x79')){_0x2f1dec[_0xbb6a('0xb5')](_0x2f1dec['voiceQueues'][_0x2942b1[_0x58d9de][_0xbb6a('0xb6')]]);logger[_0xbb6a('0x95')]('[Dialer][checkChannel]',_0x3ab1ee,_0x58d9de,_0x2942b1[_0x58d9de][_0xbb6a('0xb6')]);delete _0x2942b1[_0x58d9de];}if(_0x2942b1[_0x58d9de]&&_0x2942b1[_0x58d9de][_0xbb6a('0x4c')]===_0xbb6a('0x79')){_0x2f1dec[_0xbb6a('0xb5')](_0x2f1dec[_0xbb6a('0x20')][_0x2942b1[_0x58d9de][_0xbb6a('0xb6')]]);logger['error']('[Dialer][checkChannel][ivr]',_0x3ab1ee,_0x58d9de,_0x2942b1[_0x58d9de]['queue']);delete _0x2942b1[_0x58d9de];}},0x2328);}});}});}}};Dialer[_0xbb6a('0x1b')]['countReScheduled']=function(_0x28a148){return Promise[_0xbb6a('0xb7')]()[_0xbb6a('0xb8')](cmHopper[_0xbb6a('0xb9')](_0x28a148))[_0xbb6a('0xb3')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0xbb6a('0x1b')][_0xbb6a('0xba')]=function(_0x26a171){return Promise[_0xbb6a('0xb7')]()['then'](cmHopperBlack['checkIsBlackList'](_0x26a171))[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0xbb')));};Dialer['prototype']['verifyAdditionalPhones']=function(_0x57b51c,_0xc2acd8,_0x47e895){return Promise['resolve']()[_0xbb6a('0xb8')](cmHopperAdditionalPhone[_0xbb6a('0xbc')](_0x57b51c,_0xc2acd8,_0x47e895))[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0xbd')));};Dialer['prototype'][_0xbb6a('0xbe')]=function(_0x2a7e85,_0x1a8f1c,_0x2816a7){return Promise['resolve']()['then'](cmHopperAdditionalPhone[_0xbb6a('0xbe')](_0x2a7e85,_0x1a8f1c,_0x2816a7))[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0xbf')));};Dialer[_0xbb6a('0x1b')]['checkIsBlackListIvr']=function(_0x2f1a35){return Promise['resolve']()[_0xbb6a('0xb8')](cmHopperBlack[_0xbb6a('0xc0')](_0x2f1a35))[_0xbb6a('0xb3')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0xbb6a('0x1b')][_0xbb6a('0xc1')]=function(_0x1c52c8){return Promise[_0xbb6a('0xb7')]()[_0xbb6a('0xb8')](cmHopperHistory['avgHandleTime'](_0x1c52c8))[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0xc2')));};Dialer[_0xbb6a('0x1b')][_0xbb6a('0xc3')]=function(_0x5b76a0){return Promise['resolve']()[_0xbb6a('0xb8')](cmHopper[_0xbb6a('0xc3')](_0x5b76a0))[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0xc4')));};Dialer[_0xbb6a('0x1b')][_0xbb6a('0xc5')]=function(_0x4dfae6,_0x5bcfc8,_0x556b2f){return Promise['resolve']()['then'](cmHopper[_0xbb6a('0xc5')](_0x4dfae6,_0x5bcfc8,_0x556b2f))[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0xc6')));};Dialer[_0xbb6a('0x1b')][_0xbb6a('0xc7')]=function(_0x3ef286,_0x304026,_0x35d342,_0x8910b1,_0x2d7102){return Promise['resolve']()[_0xbb6a('0xb8')](cmHopper[_0xbb6a('0xc7')](_0x3ef286,_0x304026,_0x35d342,_0x8910b1))[_0xbb6a('0xb3')](function(_0x34f27b){_0x2d7102[_0xbb6a('0xc8')]-=_0x35d342;_0x2d7102[_0xbb6a('0xc8')]=_0x2d7102[_0xbb6a('0xc8')]>0x0?_0x2d7102[_0xbb6a('0xc8')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x34f27b);});};Dialer[_0xbb6a('0x1b')][_0xbb6a('0xc9')]=function(_0x5f4ac7,_0x302e39,_0x2eb0be,_0x3ba3ee){return Promise['resolve']()[_0xbb6a('0xb8')](cmHopper[_0xbb6a('0xc9')](_0x5f4ac7,_0x302e39,_0x2eb0be))['catch'](function(_0xda82e5){_0x3ba3ee[_0xbb6a('0xc8')]-=_0x302e39;_0x3ba3ee['temp']=_0x3ba3ee['temp']>0x0?_0x3ba3ee[_0xbb6a('0xc8')]:0x0;loggerCatch(_0xbb6a('0xca'))(_0xda82e5);});};Dialer[_0xbb6a('0x1b')][_0xbb6a('0xcb')]=function(_0x5ba77b){return Promise['resolve']()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0x5ba77b))[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0xcc')));};Dialer[_0xbb6a('0x1b')][_0xbb6a('0xcd')]=function(_0x24716c){return Promise[_0xbb6a('0xb7')]()[_0xbb6a('0xb8')](cmHopper[_0xbb6a('0xcd')](_0x24716c))['catch'](loggerCatch(_0xbb6a('0xce')));};Dialer['prototype'][_0xbb6a('0xcf')]=function(_0x2088a2){return Promise[_0xbb6a('0xb7')]()[_0xbb6a('0xb8')](cmHopperHistory[_0xbb6a('0xcf')](_0x2088a2))[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0xd0')));};Dialer['prototype'][_0xbb6a('0xb5')]=function(_0xa8391e){if(!_['isUndefined'](_0xa8391e)&&_0xa8391e!==null){if(typeof _0xa8391e[_0xbb6a('0x97')]!==_0xbb6a('0x98')){if(_0xa8391e['originated']>0x0){_0xa8391e['originated']-=0x1;}else{logger['error'](_0xbb6a('0xd1'));}}}else{logger[_0xbb6a('0x95')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xbb6a('0x1b')]['loggerHandler']=function(_0x1db022,_0x479e05){var _0x371939=this;return function(_0x46d184){_0x371939[_0xbb6a('0xb5')](_0x479e05);logger[_0xbb6a('0x95')](_0x1db022,util[_0xbb6a('0x94')](_0x46d184,{'showHidden':![],'depth':null}));};};Dialer[_0xbb6a('0x1b')][_0xbb6a('0xd2')]=function(_0x263027,_0x3ed7a0,_0xf82ece){var _0x496304={'state':0x19,'statedesc':_0xbb6a('0xd3')};this[_0xbb6a('0xb5')](_0x3ed7a0);this[_0xbb6a('0xd4')](_['merge'](_0x496304,_['pick'](_0xf82ece,[_0xbb6a('0xd5'),'ListId','UserId',_0xbb6a('0xd6'),'CampaignId'])),_0xbb6a('0xd7'),_0xbb6a('0xd8'));logger[_0xbb6a('0x95')](_0x263027);};Dialer[_0xbb6a('0x1b')][_0xbb6a('0xd9')]=function(_0x28cc90){return _0x28cc90===_0xbb6a('0xda');};Dialer['prototype']['isTrunkReachable']=function(_0x3a2e5a){return!_['isUndefined'](_0x3a2e5a)&&_0x3a2e5a&&!_[_0xbb6a('0x3f')](_0x3a2e5a[_0xbb6a('0x40')])&&!_['isUndefined'](_0x3a2e5a[_0xbb6a('0x74')])&&_0x3a2e5a[_0xbb6a('0x74')]&&(this[_0xbb6a('0x22')][util[_0xbb6a('0x77')]('SIP/%s',_0x3a2e5a[_0xbb6a('0x40')])][_0xbb6a('0xb1')]===_0xbb6a('0xdb')||this[_0xbb6a('0x22')][util[_0xbb6a('0x77')](_0xbb6a('0xdc'),_0x3a2e5a[_0xbb6a('0x40')])]['status']===_0xbb6a('0xdd'));};Dialer[_0xbb6a('0x1b')][_0xbb6a('0xd4')]=function(_0x23dde5,_0x5f1f9a,_0x5aeeff){this[_0xbb6a('0xcf')](_0x23dde5)['catch'](loggerCatch(_0x5f1f9a));this[_0xbb6a('0xcd')](_0x23dde5)[_0xbb6a('0xb3')](loggerCatch(_0x5aeeff));};Dialer[_0xbb6a('0x1b')][_0xbb6a('0x38')]=function(_0xbd34f3){var _0x367e09=this;var _0x3e5f1e=this['uniqueId'][_0xbd34f3['uniqueid']];var _0x42fa7e;if(!_[_0xbb6a('0xb0')](_0xbd34f3)&&!_[_0xbb6a('0xb0')](_0xbd34f3[_0xbb6a('0xde')])&&!_[_0xbb6a('0xb0')](_0xbd34f3['variable'][_0xbb6a('0xdf')])&&_0xbd34f3[_0xbb6a('0xe0')]===_0xbb6a('0xe1')&&_0x3e5f1e){if(_0x3e5f1e[_0xbb6a('0x4c')]!=='ivr'&&this['voiceQueues'][_0x3e5f1e[_0xbb6a('0xb6')]][_0xbb6a('0xe2')]&&_0xbd34f3[_0xbb6a('0xe3')]===_0xbb6a('0xe4')){delete this['uniqueId'][_0xbd34f3['uniqueid']];this[_0xbb6a('0xb5')](this[_0xbb6a('0x1f')][_0x3e5f1e['queue']]);this[_0xbb6a('0x1f')][_0x3e5f1e[_0xbb6a('0xb6')]][_0xbb6a('0xe5')]+=0x1;this[_0xbb6a('0x1f')][_0x3e5f1e[_0xbb6a('0xb6')]][_0xbb6a('0xe6')]+=0x1;_0x42fa7e=new Hangup(_0x3e5f1e,_0xbd34f3);_0x42fa7e['state']=0x12;_0x42fa7e[_0xbb6a('0xe7')]=_0xbb6a('0xe8');_0x42fa7e[_0xbb6a('0xe9')]=_0xbb6a('0xea');ami[_0xbb6a('0x4b')](_0xbb6a('0xeb'),ut[_0xbb6a('0xec')](_0x42fa7e,'amd'));this[_0xbb6a('0xd4')](_0x42fa7e,'[syncHangupInAMD][createHistory]',_0xbb6a('0xed'));}if(_0x3e5f1e['type']!==_0xbb6a('0x79')&&this[_0xbb6a('0x1f')][_0x3e5f1e[_0xbb6a('0xb6')]][_0xbb6a('0xe2')]&&_0xbd34f3['value']===_0xbb6a('0xee')){return new Promise(function(_0x538e3,_0x24f338){delete _0x367e09[_0xbb6a('0x27')][_0xbd34f3[_0xbb6a('0xef')]];_0x367e09[_0xbb6a('0xb5')](_0x367e09[_0xbb6a('0x1f')][_0x3e5f1e['queue']]);_0x367e09[_0xbb6a('0x1f')][_0x3e5f1e[_0xbb6a('0xb6')]][_0xbb6a('0xe5')]+=0x1;_0x367e09['voiceQueues'][_0x3e5f1e[_0xbb6a('0xb6')]][_0xbb6a('0xe6')]+=0x1;var _0x531873=_0x367e09[_0xbb6a('0x1f')][_0x3e5f1e['queue']];var _0x21f66d=new Hangup(_0x3e5f1e,_0xbd34f3);_0x21f66d['state']=0x13;_0x21f66d['statedesc']=_0xbb6a('0xf0');_0x21f66d[_0xbb6a('0xe9')]='AMD';_0x21f66d[_0xbb6a('0xf1')]+=0x1;_0x21f66d[_0xbb6a('0xf2')]+=0x1;_0x21f66d[_0xbb6a('0xf3')]=!![];ami['emit']('custom:amd',ut[_0xbb6a('0xec')](_0x21f66d,_0xbb6a('0xf3')));_0x367e09[_0xbb6a('0xcf')](_0x21f66d)[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0xf4')));if(_0x21f66d[_0xbb6a('0xf5')]+_0x21f66d['countcongestionretry']+_0x21f66d['countnoanswerretry']+_0x21f66d[_0xbb6a('0xf6')]+_0x21f66d[_0xbb6a('0xf7')]+_0x21f66d[_0xbb6a('0xf8')]+_0x21f66d[_0xbb6a('0xf1')]+_0x21f66d[_0xbb6a('0xf9')]>=_0x531873[_0xbb6a('0xfa')]){_0x367e09[_0xbb6a('0xfb')](_0x21f66d,_0x538e3,_0x24f338,_0xbb6a('0xfc'));}else{if(_0x21f66d['countmachineretry']>=_0x531873[_0xbb6a('0xfd')]){_0x367e09[_0xbb6a('0xfe')](_0x21f66d,_0x538e3,_0x24f338,'reason\x2019\x20machine....');}else{_0x367e09[_0xbb6a('0xc3')]({'active':![],'countmachineretry':_0x21f66d['countmachineretry'],'scheduledat':moment()[_0xbb6a('0xff')](_0x531873[_0xbb6a('0x100')],_0xbb6a('0x101'))[_0xbb6a('0x77')](_0xbb6a('0x102')),'ContactId':_0x21f66d[_0xbb6a('0xd5')],'ListId':_0x21f66d[_0xbb6a('0x103')],'VoiceQueueId':_0x21f66d[_0xbb6a('0xd6')]||undefined,'CampaignId':_0x21f66d['CampaignId']||undefined})[_0xbb6a('0xb3')](loggerCatch('[rescheduleContact][Machine]'));_0x538e3({'reschedule':0x1});}}});}if(_0x3e5f1e[_0xbb6a('0x4c')]===_0xbb6a('0x79')&&this[_0xbb6a('0x20')][_0x3e5f1e[_0xbb6a('0xb6')]][_0xbb6a('0xe2')]&&_0xbd34f3[_0xbb6a('0xe3')]==='HANGUP'){delete this[_0xbb6a('0x27')][_0xbd34f3[_0xbb6a('0xef')]];this['updateOriginated'](this[_0xbb6a('0x20')][_0x3e5f1e[_0xbb6a('0xb6')]]);_0x42fa7e=new Hangup(_0x3e5f1e,_0xbd34f3);_0x42fa7e[_0xbb6a('0xaa')]=0x12;_0x42fa7e[_0xbb6a('0xe7')]=_0xbb6a('0xe8');_0x42fa7e[_0xbb6a('0xe9')]=_0xbb6a('0xea');ami[_0xbb6a('0x4b')](_0xbb6a('0xeb'),ut[_0xbb6a('0xec')](_0x42fa7e,'amd'));this[_0xbb6a('0xd4')](_0x42fa7e,'[syncHangupInAMDIvr][createHistory]',_0xbb6a('0x104'));}if(_0x3e5f1e[_0xbb6a('0x4c')]===_0xbb6a('0x79')&&this[_0xbb6a('0x20')][_0x3e5f1e['queue']]['dialAMDActive']&&_0xbd34f3[_0xbb6a('0xe3')]===_0xbb6a('0xee')){return new Promise(function(_0x2e33fa,_0x5da5aa){delete _0x367e09[_0xbb6a('0x27')][_0xbd34f3[_0xbb6a('0xef')]];_0x367e09[_0xbb6a('0xb5')](_0x367e09['campaigns'][_0x3e5f1e[_0xbb6a('0xb6')]]);_0x367e09[_0xbb6a('0x20')][_0x3e5f1e[_0xbb6a('0xb6')]][_0xbb6a('0xe5')]+=0x1;_0x367e09[_0xbb6a('0x20')][_0x3e5f1e['queue']][_0xbb6a('0xe6')]+=0x1;var _0x37b934=_0x367e09[_0xbb6a('0x20')][_0x3e5f1e['queue']];var _0x4d5637=new Hangup(_0x3e5f1e,_0xbd34f3);_0x4d5637[_0xbb6a('0xaa')]=0x13;_0x4d5637['statedesc']=_0xbb6a('0xf0');_0x4d5637[_0xbb6a('0xe9')]=_0xbb6a('0xea');_0x4d5637['countmachineretry']+=0x1;_0x4d5637['countglobal']+=0x1;_0x4d5637[_0xbb6a('0xf3')]=!![];ami[_0xbb6a('0x4b')](_0xbb6a('0xeb'),ut[_0xbb6a('0xec')](_0x4d5637,_0xbb6a('0xf3')));_0x367e09['createHistory'](_0x4d5637)[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0xf4')));if(_0x4d5637[_0xbb6a('0xf5')]+_0x4d5637[_0xbb6a('0x105')]+_0x4d5637[_0xbb6a('0x106')]+_0x4d5637[_0xbb6a('0xf6')]+_0x4d5637[_0xbb6a('0xf7')]+_0x4d5637['countabandonedretry']+_0x4d5637[_0xbb6a('0xf1')]+_0x4d5637[_0xbb6a('0xf9')]>=_0x37b934[_0xbb6a('0xfa')]){_0x367e09[_0xbb6a('0xfb')](_0x4d5637,_0x2e33fa,_0x5da5aa,_0xbb6a('0xfc'));}else{if(_0x4d5637[_0xbb6a('0xf1')]>=_0x37b934['dialMachineMaxRetry']){_0x367e09[_0xbb6a('0xfe')](_0x4d5637,_0x2e33fa,_0x5da5aa,_0xbb6a('0x107'));}else{_0x367e09[_0xbb6a('0xc3')]({'active':![],'countmachineretry':_0x4d5637['countmachineretry'],'scheduledat':moment()[_0xbb6a('0xff')](_0x37b934['dialMachineRetryFrequency'],_0xbb6a('0x101'))['format'](_0xbb6a('0x102')),'ContactId':_0x4d5637[_0xbb6a('0xd5')],'ListId':_0x4d5637[_0xbb6a('0x103')],'VoiceQueueId':_0x4d5637[_0xbb6a('0xd6')]||undefined,'CampaignId':_0x4d5637[_0xbb6a('0x108')]||undefined})[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0x109')));_0x2e33fa({'reschedule':0x1});}}});}}};Dialer[_0xbb6a('0x1b')]['syncHangup']=function(_0x5e63ee){var _0x3e2507=this['uniqueId'][_0x5e63ee['uniqueid']];var _0x179635;if(_0x3e2507&&_0x3e2507['type']==='ivr'){delete this[_0xbb6a('0x27')][_0x5e63ee['uniqueid']];this[_0xbb6a('0xb5')](this['campaigns'][_0x3e2507[_0xbb6a('0xb6')]]);this[_0xbb6a('0x20')][_0x3e2507['queue']][_0xbb6a('0x10a')]+=0x1;_0x179635=new Hangup(_0x3e2507,_0x5e63ee);this[_0xbb6a('0xcf')](_0x179635)[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0x10b')));this['moveContactManagedDialer'](_0x179635)[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0x10c')));}if(_0x3e2507&&_0x3e2507[_0xbb6a('0x4c')]!==_0xbb6a('0x79')&&isNotNull(this[_0xbb6a('0x1f')][_0x3e2507[_0xbb6a('0xb6')]][_0xbb6a('0x10d')])){delete this[_0xbb6a('0x27')][_0x5e63ee[_0xbb6a('0xef')]];this[_0xbb6a('0xb5')](this[_0xbb6a('0x1f')][_0x3e2507[_0xbb6a('0xb6')]]);this[_0xbb6a('0x1f')][_0x3e2507[_0xbb6a('0xb6')]][_0xbb6a('0xe5')]+=0x1;this[_0xbb6a('0x1f')][_0x3e2507['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x179635=new Hangup(_0x3e2507,_0x5e63ee);_0x179635[_0xbb6a('0xaa')]=0x10;_0x179635[_0xbb6a('0xe7')]=_0xbb6a('0x10e');_0x179635[_0xbb6a('0xe9')]='AGI';this['createHistory'](_0x179635)[_0xbb6a('0xb3')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xbb6a('0xcd')](_0x179635)[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0x10c')));}if(_0x3e2507&&_0x3e2507[_0xbb6a('0x4c')]!==_0xbb6a('0x79')&&!isNotNull(this[_0xbb6a('0x1f')][_0x3e2507['queue']][_0xbb6a('0x10d')])){delete this['uniqueId'][_0x5e63ee['uniqueid']];this[_0xbb6a('0xb5')](this['voiceQueues'][_0x3e2507[_0xbb6a('0xb6')]]);this[_0xbb6a('0x1f')][_0x3e2507[_0xbb6a('0xb6')]][_0xbb6a('0x65')]+=0x1;_0x179635=new Hangup(_0x3e2507,_0x5e63ee);_0x179635[_0xbb6a('0xaa')]=0xc;_0x179635[_0xbb6a('0xe7')]=_0x5e63ee[_0xbb6a('0x10f')];_0x179635[_0xbb6a('0xe9')]=_0xbb6a('0x110');this[_0xbb6a('0xcf')](_0x179635)['catch'](loggerCatch(_0xbb6a('0x10b')));this['moveContactManagedDialer'](_0x179635)[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0x10c')));}};Dialer[_0xbb6a('0x1b')][_0xbb6a('0x33')]=function(_0x57317b){var _0x21033c=this[_0xbb6a('0x27')][_0x57317b[_0xbb6a('0xef')]];if(this['voiceQueues'][_0x57317b['queue']]){if(_0x21033c&&_0x21033c[_0xbb6a('0x4c')]!==_0xbb6a('0x79')){delete this[_0xbb6a('0x27')][_0x57317b[_0xbb6a('0xef')]];this[_0xbb6a('0x1f')][_0x57317b[_0xbb6a('0xb6')]][_0xbb6a('0xe5')]+=0x1;var _0x36c520=new AgentComplete(_0x21033c,_0x57317b);if(_0x57317b[_0xbb6a('0x111')]===_0xbb6a('0x112')){_0x36c520[_0xbb6a('0x113')]=this[_0xbb6a('0x1f')][_0x57317b['queue']]['dialQueueProject2']&&this[_0xbb6a('0x1f')][_0x57317b['queue']]['dialAgiAfterHangupAgent']?moment()['format'](_0xbb6a('0x102')):undefined;}this['createHistory'](_0x36c520)[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0x114')));this[_0xbb6a('0xcd')](_0x36c520)[_0xbb6a('0xb3')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xbb6a('0x1b')][_0xbb6a('0x2d')]=function(_0x17baf2){if(this[_0xbb6a('0x1f')][_0x17baf2[_0xbb6a('0xb6')]]){if(this[_0xbb6a('0x27')][_0x17baf2[_0xbb6a('0xef')]]&&this[_0xbb6a('0x27')][_0x17baf2[_0xbb6a('0xef')]][_0xbb6a('0x4c')]!==_0xbb6a('0x79')){this[_0xbb6a('0xb5')](this[_0xbb6a('0x1f')][_0x17baf2[_0xbb6a('0xb6')]]);this[_0xbb6a('0x27')][_0x17baf2['uniqueid']][_0xbb6a('0x115')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xbb6a('0x1b')][_0xbb6a('0x116')]=function(_0x533321,_0x5cebb9){this[_0xbb6a('0xcf')](_0x533321)[_0xbb6a('0xb3')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x5cebb9==0x0){this[_0xbb6a('0xcd')](_0x533321)[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0x117')));}};Dialer[_0xbb6a('0x1b')][_0xbb6a('0x2f')]=function(_0x1737ab){var _0x574b07=this[_0xbb6a('0x27')][_0x1737ab[_0xbb6a('0xef')]];var _0x44a5c6=this;var _0x11be86=![];var _0x5af6f4;var _0x120480;if(this[_0xbb6a('0x1f')][_0x1737ab['queue']]){if(_0x574b07&&_0x574b07[_0xbb6a('0x4c')]!==_0xbb6a('0x79')){delete this[_0xbb6a('0x27')][_0x1737ab[_0xbb6a('0xef')]];this[_0xbb6a('0xb5')](this[_0xbb6a('0x1f')][_0x1737ab[_0xbb6a('0xb6')]]);_0x574b07[_0xbb6a('0x118')]=moment()['format'](_0xbb6a('0x102'));var _0x288e0f=new QueueCallerAbandon(_0x574b07,_0x1737ab);if(getSeconds(_0x574b07[_0xbb6a('0x118')],_0x574b07[_0xbb6a('0x119')])>=_0x574b07[_0xbb6a('0x11a')]){this[_0xbb6a('0x1f')][_0x1737ab[_0xbb6a('0xb6')]][_0xbb6a('0x69')]+=0x1;this[_0xbb6a('0x1f')][_0x1737ab[_0xbb6a('0xb6')]][_0xbb6a('0x61')]+=0x1;this[_0xbb6a('0x1f')][_0x1737ab[_0xbb6a('0xb6')]][_0xbb6a('0x11b')]+=0x1;_0x288e0f['state']=0xa;_0x288e0f[_0xbb6a('0xe7')]=_0xbb6a('0x11c');_0x288e0f[_0xbb6a('0x11d')]='TIMEOUT';_0x288e0f[_0xbb6a('0x113')]=this['voiceQueues'][_0x1737ab[_0xbb6a('0xb6')]]['dialQueueProject2']?moment()[_0xbb6a('0x77')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x288e0f[_0xbb6a('0xf7')]+=0x1;_0x288e0f[_0xbb6a('0xf2')]+=0x1;_0x5af6f4=this[_0xbb6a('0x1f')][_0x1737ab[_0xbb6a('0xb6')]][_0xbb6a('0x11e')];_0x120480=this[_0xbb6a('0x1f')][_0x1737ab[_0xbb6a('0xb6')]][_0xbb6a('0x11f')];_0x44a5c6['verifyAdditionalPhones'](_0x288e0f,_0x288e0f[_0xbb6a('0xaa')],_0x574b07[_0xbb6a('0x120')])[_0xbb6a('0xb8')](function(_0x112789){_0x11be86=_0x112789[_0xbb6a('0x121')]==0x1;if(_0x288e0f['countdropretry']>=_0x44a5c6['voiceQueues'][_0x1737ab[_0xbb6a('0xb6')]][_0xbb6a('0x122')]){_0x44a5c6[_0xbb6a('0x116')](_0x288e0f,_0x112789[_0xbb6a('0x121')]);}else{_0x44a5c6['rescheduleContact']({'active':![],'countdropretry':_0x288e0f[_0xbb6a('0xf7')],'scheduledat':moment()[_0xbb6a('0xff')](_0x44a5c6['voiceQueues'][_0x1737ab[_0xbb6a('0xb6')]][_0xbb6a('0x11e')],'minutes')[_0xbb6a('0x77')](_0xbb6a('0x102')),'ContactId':_0x574b07[_0xbb6a('0xd5')],'ListId':_0x574b07[_0xbb6a('0x103')],'VoiceQueueId':_0x574b07[_0xbb6a('0xd6')]||undefined,'CampaignId':_0x574b07[_0xbb6a('0x108')]||undefined})[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0x123')));var _0x22b1fa=new History(_0x288e0f);_0x22b1fa['state']=0xa;_0x22b1fa[_0xbb6a('0xe7')]=_0xbb6a('0x11c');_0x22b1fa[_0xbb6a('0xab')]=moment()[_0xbb6a('0x77')](_0xbb6a('0x102'));_0x22b1fa[_0xbb6a('0x124')]=_0x22b1fa['starttime'];_0x22b1fa[_0xbb6a('0x125')]=_0x288e0f[_0xbb6a('0x125')];_0x22b1fa[_0xbb6a('0x126')]=_0x288e0f[_0xbb6a('0x126')];_0x44a5c6[_0xbb6a('0xcf')](_0x22b1fa)[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0x127')));}})[_0xbb6a('0xb8')](function(){if(_0x11be86)_0x44a5c6[_0xbb6a('0xbe')](_0x288e0f,_0x5af6f4,_0x120480)[_0xbb6a('0xb8')](function(){return 0x1;});});}else{this[_0xbb6a('0x1f')][_0x1737ab['queue']][_0xbb6a('0x68')]+=0x1;this[_0xbb6a('0x1f')][_0x1737ab[_0xbb6a('0xb6')]][_0xbb6a('0x60')]+=0x1;_0x288e0f[_0xbb6a('0xaa')]=0xb;_0x288e0f[_0xbb6a('0xe7')]=_0xbb6a('0x128');_0x288e0f['dropreason']=_0xbb6a('0x129');_0x288e0f[_0xbb6a('0xf8')]+=0x1;_0x288e0f[_0xbb6a('0xf2')]+=0x1;_0x5af6f4=this['voiceQueues'][_0x1737ab[_0xbb6a('0xb6')]][_0xbb6a('0x12a')];_0x120480=this[_0xbb6a('0x1f')][_0x1737ab[_0xbb6a('0xb6')]][_0xbb6a('0x11f')];_0x44a5c6[_0xbb6a('0xbc')](_0x288e0f,_0x288e0f[_0xbb6a('0xaa')],_0x574b07[_0xbb6a('0x120')])[_0xbb6a('0xb8')](function(_0x22e9f1){if(_0x288e0f[_0xbb6a('0xf8')]>=_0x44a5c6['voiceQueues'][_0x1737ab[_0xbb6a('0xb6')]][_0xbb6a('0x12b')]){_0x44a5c6['queueCallerAbandonCreateState'](_0x288e0f,_0x22e9f1[_0xbb6a('0x121')]);}else{_0x44a5c6['rescheduleContact']({'active':![],'countabandonedretry':_0x288e0f[_0xbb6a('0xf8')],'scheduledat':moment()[_0xbb6a('0xff')](_0x44a5c6[_0xbb6a('0x1f')][_0x1737ab[_0xbb6a('0xb6')]]['dialAbandonedRetryFrequency'],_0xbb6a('0x101'))['format'](_0xbb6a('0x102')),'ContactId':_0x574b07[_0xbb6a('0xd5')],'ListId':_0x574b07['ListId'],'VoiceQueueId':_0x574b07[_0xbb6a('0xd6')]||undefined,'CampaignId':_0x574b07[_0xbb6a('0x108')]||undefined})['catch'](loggerCatch(_0xbb6a('0x12c')));var _0x31c6c2=new History(_0x288e0f);_0x31c6c2[_0xbb6a('0xaa')]=0xb;_0x31c6c2[_0xbb6a('0xe7')]=_0xbb6a('0x128');_0x31c6c2[_0xbb6a('0xab')]=moment()[_0xbb6a('0x77')](_0xbb6a('0x102'));_0x31c6c2[_0xbb6a('0x124')]=_0x31c6c2[_0xbb6a('0xab')];_0x31c6c2[_0xbb6a('0x125')]=_0x288e0f[_0xbb6a('0x125')];_0x31c6c2[_0xbb6a('0x126')]=_0x288e0f[_0xbb6a('0x126')];_0x44a5c6['createHistory'](_0x31c6c2)['catch'](loggerCatch(_0xbb6a('0x12d')));}})['then'](function(){if(_0x11be86)_0x44a5c6['swapAdditionalPhones'](_0x288e0f,_0x5af6f4,_0x120480)[_0xbb6a('0xb8')](function(){return 0x1;});});}}}};Dialer['prototype']['syncNewExten']=function(_0x5975a1){if(this[_0xbb6a('0x25')][_0x5975a1[_0xbb6a('0xef')]]){this[_0xbb6a('0x25')][_0x5975a1[_0xbb6a('0xef')]][_0xbb6a('0xb2')]=_0x5975a1[_0xbb6a('0xb2')];}if(this[_0xbb6a('0x27')][_0x5975a1[_0xbb6a('0xef')]]){this[_0xbb6a('0x27')][_0x5975a1['uniqueid']][_0xbb6a('0xb2')]=_0x5975a1[_0xbb6a('0xb2')];}};Dialer[_0xbb6a('0x1b')][_0xbb6a('0x3a')]=function(_0x45a2ca){if(!this[_0xbb6a('0x25')][_0x45a2ca[_0xbb6a('0x12e')]]){return;}if(strategy[this[_0xbb6a('0x1f')][this['actions'][_0x45a2ca[_0xbb6a('0x12e')]]['queue']][_0xbb6a('0x12f')]]===_0xbb6a('0x130')){if(this['actions'][_0x45a2ca[_0xbb6a('0x12e')]]&&_['isNil'](this[_0xbb6a('0x25')][_0x45a2ca['actionid']][_0xbb6a('0x131')])&&_0x45a2ca[_0xbb6a('0xb1')]==='1'&&_0x45a2ca[_0xbb6a('0x132')]==='0'){if(this[_0xbb6a('0x21')][_0x45a2ca[_0xbb6a('0x133')]]){if(!this[_0xbb6a('0x21')][_0x45a2ca[_0xbb6a('0x133')]][_0xbb6a('0x131')]){this[_0xbb6a('0x21')][_0x45a2ca[_0xbb6a('0x133')]][_0xbb6a('0x131')]=!![];this[_0xbb6a('0x25')][_0x45a2ca['actionid']]['locked']=!![];this[_0xbb6a('0x25')][_0x45a2ca[_0xbb6a('0x12e')]]['stateinterface']=_0x45a2ca[_0xbb6a('0x133')];}}}}else if((strategy[this['voiceQueues'][this[_0xbb6a('0x25')][_0x45a2ca['actionid']][_0xbb6a('0xb6')]][_0xbb6a('0x12f')]]||'rrmemory')==='rrmemory'){if(this['actions'][_0x45a2ca[_0xbb6a('0x12e')]]){if(this[_0xbb6a('0x21')][_0x45a2ca[_0xbb6a('0x133')]]){this[_0xbb6a('0x25')][_0x45a2ca[_0xbb6a('0x12e')]][_0xbb6a('0x133')]=_0x45a2ca['stateinterface'];if(_[_0xbb6a('0xb0')](this[_0xbb6a('0x2b')][this[_0xbb6a('0x25')][_0x45a2ca[_0xbb6a('0x12e')]]['queue']])){this[_0xbb6a('0x2b')][this['actions'][_0x45a2ca[_0xbb6a('0x12e')]][_0xbb6a('0xb6')]]=[];}this[_0xbb6a('0x2b')][this['actions'][_0x45a2ca['actionid']][_0xbb6a('0xb6')]][_0xbb6a('0x134')](_['merge'](_[_0xbb6a('0x135')](this[_0xbb6a('0x25')][_0x45a2ca[_0xbb6a('0x12e')]],[_0xbb6a('0x136'),_0xbb6a('0x133')]),{'status':_0x45a2ca[_0xbb6a('0xb1')],'paused':_0x45a2ca['paused']}));}}}};function unlockQueueStatus(_0x1c5abd,_0x1e86cb){setTimeout(function(){if(_[_0xbb6a('0x3f')](_0x1c5abd[_0xbb6a('0x137')])){loggerBooked[_0xbb6a('0x95')]('[unlockQueueStatus][undefined]',_0x1e86cb);}_0x1c5abd['queueStatusComplete']=!![];loggerBooked[_0xbb6a('0x7c')]('[booked][unlockQueueStatus]',_0x1e86cb,JSON[_0xbb6a('0x76')](_[_0xbb6a('0x135')](_0x1c5abd,[_0xbb6a('0x40'),_0xbb6a('0x137')])));},0x1f3);}Dialer[_0xbb6a('0x1b')][_0xbb6a('0x3c')]=function(_0x2b7a0e){if(!this[_0xbb6a('0x25')][_0x2b7a0e[_0xbb6a('0x12e')]]){return;}var _0x5e2424=this;var _0xad91da=_0x5e2424[_0xbb6a('0x1f')][_0x5e2424['actions'][_0x2b7a0e['actionid']]['queue']];if(strategy[this[_0xbb6a('0x1f')][this[_0xbb6a('0x25')][_0x2b7a0e[_0xbb6a('0x12e')]][_0xbb6a('0xb6')]][_0xbb6a('0x12f')]]===_0xbb6a('0x130')){if(this['actions'][_0x2b7a0e['actionid']]&&this[_0xbb6a('0x25')][_0x2b7a0e['actionid']][_0xbb6a('0x133')]){this['preview'][_0xbb6a('0x138')](this[_0xbb6a('0x25')][_0x2b7a0e[_0xbb6a('0x12e')]][_0xbb6a('0x136')],this[_0xbb6a('0x25')][_0x2b7a0e[_0xbb6a('0x12e')]][_0xbb6a('0x133')])[_0xbb6a('0xb3')](function(_0x1620ad){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0xbb6a('0x94')](_0x1620ad,{'showHidden':![],'depth':null}));})[_0xbb6a('0x139')](function(){_0x5e2424[_0xbb6a('0xb5')](_0x5e2424[_0xbb6a('0x1f')][_0x5e2424[_0xbb6a('0x25')][_0x2b7a0e[_0xbb6a('0x12e')]][_0xbb6a('0xb6')]]);_0x5e2424[_0xbb6a('0x21')][_0x5e2424['actions'][_0x2b7a0e[_0xbb6a('0x12e')]][_0xbb6a('0x133')]][_0xbb6a('0x131')]=![];delete _0x5e2424[_0xbb6a('0x25')][_0x2b7a0e[_0xbb6a('0x12e')]];unlockQueueStatus(_0xad91da);});}else{this['updateOriginated'](this['voiceQueues'][this[_0xbb6a('0x25')][_0x2b7a0e[_0xbb6a('0x12e')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0xbb6a('0x25')][_0x2b7a0e[_0xbb6a('0x12e')]]['ContactId'],'ListId':this[_0xbb6a('0x25')][_0x2b7a0e['actionid']][_0xbb6a('0x103')],'VoiceQueueId':this['actions'][_0x2b7a0e['actionid']][_0xbb6a('0xd6')]||undefined,'CampaignId':this['actions'][_0x2b7a0e['actionid']][_0xbb6a('0x108')]||undefined})[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0x13a')));delete this[_0xbb6a('0x25')][_0x2b7a0e['actionid']];unlockQueueStatus(_0xad91da);}}else if((strategy[this[_0xbb6a('0x1f')][this[_0xbb6a('0x25')][_0x2b7a0e[_0xbb6a('0x12e')]][_0xbb6a('0xb6')]]['strategy']]||'rrmemory')===_0xbb6a('0x1a')){var _0x388f18;if(this[_0xbb6a('0x25')][_0x2b7a0e['actionid']]&&!_[_0xbb6a('0x7b')](this[_0xbb6a('0x2b')][this[_0xbb6a('0x25')][_0x2b7a0e[_0xbb6a('0x12e')]][_0xbb6a('0xb6')]])){if(this[_0xbb6a('0x2c')][_0x5e2424['actions'][_0x2b7a0e[_0xbb6a('0x12e')]][_0xbb6a('0xb6')]]){this[_0xbb6a('0x2c')][_0x5e2424['actions'][_0x2b7a0e['actionid']][_0xbb6a('0xb6')]]=this[_0xbb6a('0x2c')][this[_0xbb6a('0x25')][_0x2b7a0e[_0xbb6a('0x12e')]][_0xbb6a('0xb6')]]?this[_0xbb6a('0x2c')][this['actions'][_0x2b7a0e['actionid']][_0xbb6a('0xb6')]]:this['queueBooked'][this[_0xbb6a('0x25')][_0x2b7a0e['actionid']][_0xbb6a('0xb6')]]?this[_0xbb6a('0x2b')][this[_0xbb6a('0x25')][_0x2b7a0e[_0xbb6a('0x12e')]]['queue']][_0xbb6a('0x13b')]||0x0:0x0;}this['queueBooked'][this['actions'][_0x2b7a0e['actionid']]['queue']]['_rr']=this[_0xbb6a('0x2c')][this[_0xbb6a('0x25')][_0x2b7a0e[_0xbb6a('0x12e')]][_0xbb6a('0xb6')]];for(var _0x3af4d6=0x0;_0x3af4d6<this[_0xbb6a('0x2b')][this[_0xbb6a('0x25')][_0x2b7a0e['actionid']]['queue']][_0xbb6a('0x13c')];_0x3af4d6+=0x1){_0x388f18=rr(this['queueBooked'][this[_0xbb6a('0x25')][_0x2b7a0e[_0xbb6a('0x12e')]][_0xbb6a('0xb6')]]);this[_0xbb6a('0x2c')][_0x5e2424['actions'][_0x2b7a0e[_0xbb6a('0x12e')]]['queue']]=this[_0xbb6a('0x2b')][this[_0xbb6a('0x25')][_0x2b7a0e[_0xbb6a('0x12e')]][_0xbb6a('0xb6')]]['_rr'];if(_0x388f18[_0xbb6a('0xb1')]==='1'&&_0x388f18[_0xbb6a('0x132')]==='0'){break;}}if(!_[_0xbb6a('0xb0')](_0x388f18)){this['agents'][_0x388f18[_0xbb6a('0x133')]][_0xbb6a('0x13d')]=_[_0xbb6a('0x3f')](this['agents'][_0x388f18[_0xbb6a('0x133')]]['unlockRR'])?!![]:this['agents'][_0x388f18[_0xbb6a('0x133')]]['unlockRR'];}loggerBooked[_0xbb6a('0x7c')]('[booked][RR]',_0x2b7a0e['actionid'],'Agent:\x20',JSON['stringify'](_['pick'](this[_0xbb6a('0x21')][_0x388f18[_0xbb6a('0x133')]],['name','unlockRR'])),_0xbb6a('0x13e'),JSON['stringify'](_0x388f18[_0xbb6a('0x136')]));if(!_['isNil'](_0x388f18)&&_0x388f18[_0xbb6a('0xb1')]==='1'&&_0x388f18['paused']==='0'&&this['agents'][_0x388f18[_0xbb6a('0x133')]][_0xbb6a('0x13d')]){this[_0xbb6a('0x21')][_0x388f18['stateinterface']]['unlockRR']=![];this[_0xbb6a('0x2b')][_0x5e2424[_0xbb6a('0x25')][_0x2b7a0e['actionid']][_0xbb6a('0xb6')]]=[];this[_0xbb6a('0x90')]['run'](_0x388f18[_0xbb6a('0x136')],_0x388f18[_0xbb6a('0x133')])[_0xbb6a('0xb3')](function(_0x3d2c6d){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0xbb6a('0x94')](_0x3d2c6d,{'showHidden':![],'depth':null}));})[_0xbb6a('0x139')](function(){_0x5e2424[_0xbb6a('0xb5')](_0x5e2424[_0xbb6a('0x1f')][_0x5e2424[_0xbb6a('0x25')][_0x2b7a0e[_0xbb6a('0x12e')]][_0xbb6a('0xb6')]]);setTimeout(function(){_0x5e2424[_0xbb6a('0x21')][_0x388f18[_0xbb6a('0x133')]][_0xbb6a('0x13d')]=!![];loggerBooked[_0xbb6a('0x7c')](_0xbb6a('0x13f'),_0x2b7a0e[_0xbb6a('0x12e')],_0xbb6a('0x140'),JSON[_0xbb6a('0x76')](_['pick'](_0x5e2424[_0xbb6a('0x21')][_0x388f18[_0xbb6a('0x133')]],[_0xbb6a('0x40'),_0xbb6a('0x13d')])),_0xbb6a('0x13e'),JSON[_0xbb6a('0x76')](_0x388f18[_0xbb6a('0x136')]));},0xc7);delete _0x5e2424['actions'][_0x2b7a0e['actionid']];unlockQueueStatus(_0xad91da,_0x2b7a0e['actionid']);});}else{loggerBooked['info'](_0xbb6a('0x141'));this['updateOriginated'](this[_0xbb6a('0x1f')][this[_0xbb6a('0x25')][_0x2b7a0e[_0xbb6a('0x12e')]][_0xbb6a('0xb6')]]);this[_0xbb6a('0xc3')]({'active':![],'ContactId':this[_0xbb6a('0x25')][_0x2b7a0e['actionid']]['ContactId'],'ListId':this[_0xbb6a('0x25')][_0x2b7a0e['actionid']]['ListId'],'VoiceQueueId':this[_0xbb6a('0x25')][_0x2b7a0e['actionid']][_0xbb6a('0xd6')]||undefined,'CampaignId':this[_0xbb6a('0x25')][_0x2b7a0e[_0xbb6a('0x12e')]][_0xbb6a('0x108')]||undefined})[_0xbb6a('0xb3')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xbb6a('0x25')][_0x2b7a0e['actionid']];unlockQueueStatus(_0xad91da);}}else{loggerBooked[_0xbb6a('0x7c')](_0xbb6a('0x142'));this[_0xbb6a('0xb5')](this[_0xbb6a('0x1f')][this['actions'][_0x2b7a0e[_0xbb6a('0x12e')]][_0xbb6a('0xb6')]]);this[_0xbb6a('0xc3')]({'active':![],'ContactId':this[_0xbb6a('0x25')][_0x2b7a0e[_0xbb6a('0x12e')]][_0xbb6a('0xd5')],'ListId':this[_0xbb6a('0x25')][_0x2b7a0e[_0xbb6a('0x12e')]]['ListId'],'VoiceQueueId':this['actions'][_0x2b7a0e['actionid']]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x2b7a0e['actionid']]['CampaignId']||undefined})[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0x143')));delete this['actions'][_0x2b7a0e['actionid']];unlockQueueStatus(_0xad91da);}}else{loggerBooked['info'](_0xbb6a('0x144'));this[_0xbb6a('0xb5')](this[_0xbb6a('0x1f')][this[_0xbb6a('0x25')][_0x2b7a0e[_0xbb6a('0x12e')]][_0xbb6a('0xb6')]]);this[_0xbb6a('0xc3')]({'active':![],'ContactId':this['actions'][_0x2b7a0e[_0xbb6a('0x12e')]]['ContactId'],'ListId':this['actions'][_0x2b7a0e['actionid']][_0xbb6a('0x103')],'VoiceQueueId':this[_0xbb6a('0x25')][_0x2b7a0e[_0xbb6a('0x12e')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xbb6a('0x25')][_0x2b7a0e[_0xbb6a('0x12e')]][_0xbb6a('0x108')]||undefined})['catch'](loggerCatch('[unlock3][syncQueueStatusComplete]'));delete this[_0xbb6a('0x25')][_0x2b7a0e[_0xbb6a('0x12e')]];unlockQueueStatus(_0xad91da);}};Dialer['prototype'][_0xbb6a('0x145')]=function(){var _0x21ea33=this;return cmHopper[_0xbb6a('0x146')]({'active':![]},{'where':{'active':!![]}})[_0xbb6a('0xb8')](function(){setInterval(function(){_0x21ea33['syncCampaigns']();},0x3e8);});};Dialer[_0xbb6a('0x1b')][_0xbb6a('0x147')]=function(_0x59eb01){var _0x4400df=this;return function(){if(!_0x4400df[_0xbb6a('0x148')](_0x59eb01[_0xbb6a('0x73')])){if(!_0x4400df['isTrunkReachable'](_0x59eb01['TrunkBackup'])){_0x59eb01[_0xbb6a('0x42')]='TRUNK_IS_NOT_REACHABLE';throw _0x59eb01[_0xbb6a('0x40')]+_0xbb6a('0x149');}}};};Dialer[_0xbb6a('0x1b')][_0xbb6a('0x14a')]=function(_0x3ae321,_0x58204e,_0x5323d0,_0x4ec1ea){var _0x3d04ab=this;return function(){var _0x111e7c=!![];return _0x3d04ab[_0xbb6a('0x14b')](_0x3ae321,_0x58204e,_0x5323d0,_0x4ec1ea,_0x111e7c);};};Dialer['prototype'][_0xbb6a('0x14c')]=function(_0x3e1e1f,_0x9a8b61,_0x37a1ea,_0x381566){var _0x57822a=this;return function(){var _0x48d5e4=![];return _0x57822a[_0xbb6a('0x14b')](_0x3e1e1f[_0xbb6a('0x45')],_0x9a8b61,_0x37a1ea,_0x381566,_0x48d5e4);};};Dialer[_0xbb6a('0x1b')]['ifTime']=function(_0x5f2384,_0x38b020,_0x2a228c,_0x1bc9b7,_0x5bb4bb){var _0x9410e8=[];return new Promise(function(_0x384e86,_0xa02e89){if(!isNotNull(_0x5f2384)){_0x1bc9b7[_0xbb6a('0x42')]=_0xbb6a('0x44');return _0xa02e89(msgResponse(_0xbb6a('0x14b'),_0xbb6a('0x14d'),_0x2a228c+_0xbb6a('0x14e')));}if(_[_0xbb6a('0x7b')](_0x5f2384)){_0x1bc9b7[_0xbb6a('0x42')]=_0xbb6a('0x14f');return _0xa02e89(msgResponse('ifTime',_0xbb6a('0x14d'),_0x2a228c+'\x20Intervals\x20is\x20empty\x20'));}if(_0x38b020&&_[_0xbb6a('0x3f')](config[_0xbb6a('0x150')][_0x38b020])){_0x1bc9b7[_0xbb6a('0x42')]='TIMEZONE_UNKNOW';return _0xa02e89(msgResponse(_0xbb6a('0x14b'),_0xbb6a('0x14d'),_0x2a228c+_0xbb6a('0x151')+_0x38b020));}if(_['isArray'](_0x5f2384)){for(var _0x18d0e2=0x0;_0x18d0e2<_0x5f2384[_0xbb6a('0x13c')];_0x18d0e2+=0x1){_0x9410e8[_0xbb6a('0x134')](ami['Action']({'action':'command','command':util['format'](_0xbb6a('0x152'),_0x5f2384[_0x18d0e2]['interval'],!_[_0xbb6a('0x3f')](config[_0xbb6a('0x150')][_0x38b020])?_0x38b020:'')})[_0xbb6a('0xb8')](function(_0x480255){return _0x480255[_0xbb6a('0x153')][_0xbb6a('0x154')]('true')>=0x0;})[_0xbb6a('0xb3')](myreject(_0xa02e89)));}}else{_0x9410e8['push'](ami[_0xbb6a('0x155')]({'action':_0xbb6a('0x156'),'command':util[_0xbb6a('0x77')](_0xbb6a('0x152'),_0x5f2384,!_[_0xbb6a('0x3f')](config[_0xbb6a('0x150')][_0x38b020])?_0x38b020:'')})[_0xbb6a('0xb8')](function(_0x4377ef){return _0x4377ef[_0xbb6a('0x153')]['indexOf']('true')>=0x0;})['catch'](myreject(_0xa02e89)));}Promise[_0xbb6a('0x157')](_0x9410e8)[_0xbb6a('0xb8')](function(_0x3ed4d6){var _0x5b5f2c=_[_0xbb6a('0x158')](_0x3ed4d6);if(_0x5b5f2c){return _0x384e86(_0x5b5f2c);}else{_0x1bc9b7[_0xbb6a('0x42')]=_0x5bb4bb?_0xbb6a('0x159'):_0xbb6a('0x15a');return _0xa02e89(msgResponse('[ifTime][promiseAll]',_0xbb6a('0x14d'),'Global:\x20'+_0x5bb4bb+'\x20'+_0x2a228c+'\x20Interval\x20is\x20overtime:\x20'+util[_0xbb6a('0x94')](_0x5f2384,{'showHidden':![],'depth':null})+_0xbb6a('0x15b')+_0x38b020));}})[_0xbb6a('0xb3')](function(_0xdab655){return _0xa02e89(msgResponse(_0xbb6a('0x14b'),'Failure',JSON[_0xbb6a('0x76')](_0xdab655)));});});};Dialer['prototype'][_0xbb6a('0x15c')]=function(_0x3ce474){var _0x58fcfa=this;return function(){switch(_0x3ce474[_0xbb6a('0x58')]){case _0xbb6a('0x15d'):freeVariablesPredictive(_0x3ce474);_0x58fcfa[_0xbb6a('0x15e')](_0x3ce474,0x1);break;case _0xbb6a('0x15f'):freeVariablesPredictive(_0x3ce474);_0x58fcfa[_0xbb6a('0x15e')](_0x3ce474,_0x3ce474[_0xbb6a('0x160')]);break;case _0xbb6a('0x8'):_0x58fcfa[_0xbb6a('0x8')](_0x3ce474);break;case _0xbb6a('0x161'):freeVariablesPredictive(_0x3ce474);_0x58fcfa[_0xbb6a('0x15e')](_0x3ce474,0x1);break;default:freeVariablesPredictive(_0x3ce474);logger[_0xbb6a('0x95')](_0xbb6a('0x162'),_0x3ce474[_0xbb6a('0x40')],'method\x20not\x20recognized');}};};Dialer['prototype']['checkPreviewRecallReminder']=function(_0x50bad2){return Promise['resolve']()['then'](cmHopper[_0xbb6a('0x163')](_0x50bad2['id'],previewRecallmeReminderInterval))['then'](function(_0x37c54b){for(var _0x413551=0x0;_0x413551<_0x37c54b[_0xbb6a('0x13c')];_0x413551++){var _0x58bf27=_0x37c54b[_0x413551]['Agent'][_0xbb6a('0x40')];if(_0x58bf27)io['to'](util[_0xbb6a('0x77')](_0xbb6a('0x164'),_0x58bf27))[_0xbb6a('0x4b')](_0xbb6a('0x165'),{'hopper':_0x37c54b[_0x413551]});}})[_0xbb6a('0xb3')](function(){});};Dialer[_0xbb6a('0x1b')][_0xbb6a('0x166')]=function(_0x3762d5){var _0x9b6b73=this;return function(){_0x9b6b73['handleIvr'](_0x3762d5);};};Dialer[_0xbb6a('0x1b')]['syncQueueSummary']=function(_0x1f8c0f){var _0x563cd1=this;if(isNotPreview(_0x1f8c0f['dialMethod'])){if(isVoiceQueueOutbound(_0x1f8c0f[_0xbb6a('0x4c')])&&isActive(_0x1f8c0f[_0xbb6a('0x57')])){_0x1f8c0f[_0xbb6a('0xa0')]=!![];Promise[_0xbb6a('0xb7')]()[_0xbb6a('0xb8')](checkIsLoggedIn(_0x1f8c0f,_0x1f8c0f['loggedIn']))[_0xbb6a('0xb8')](checkIsActive(_0x1f8c0f,_0x1f8c0f[_0xbb6a('0x57')]))[_0xbb6a('0xb8')](checkInterval(_0x1f8c0f))['then'](_0x563cd1[_0xbb6a('0x147')](_0x1f8c0f))[_0xbb6a('0xb8')](_0x563cd1[_0xbb6a('0x14a')](_0x1f8c0f[_0xbb6a('0x167')],_0x1f8c0f['dialTimezone'],_0x1f8c0f[_0xbb6a('0x40')],_0x1f8c0f))[_0xbb6a('0xb8')](_0x563cd1[_0xbb6a('0x14c')](_0x1f8c0f[_0xbb6a('0x43')],_0x1f8c0f[_0xbb6a('0x168')],_0x1f8c0f[_0xbb6a('0x40')],_0x1f8c0f))['then'](_0x563cd1[_0xbb6a('0x15c')](_0x1f8c0f))['catch'](loggerCatchQueueSummary(_0xbb6a('0x169'),_0x1f8c0f));}else{notSendMessagesQueue(_0x1f8c0f);}}else{freeVariablesPredictive(_0x1f8c0f);}};Dialer['prototype'][_0xbb6a('0x35')]=_[_0xbb6a('0x16a')](function(){var _0x20264f=_[_0xbb6a('0x16b')](this[_0xbb6a('0x1f')],function(_0x37a21e){return _0x37a21e['dialPreviewRecallmeReminder'];});var _0x23673a=_['filter'](this[_0xbb6a('0x21')],function(_0x2d435c){return _0x2d435c['online']&&_0x2d435c[_0xbb6a('0xb1')]===_0xbb6a('0xdb');});if(_0x20264f[_0xbb6a('0x13c')]>0x0&&_0x23673a['length']>0x0){return Promise[_0xbb6a('0xb7')]()[_0xbb6a('0xb8')](cmHopper[_0xbb6a('0x163')](_[_0xbb6a('0x16c')](_0x20264f,'id'),previewRecallmeReminderInterval,_[_0xbb6a('0x16c')](_0x23673a,'id')))[_0xbb6a('0xb8')](function(_0x38ff03){for(var _0x29f231=0x0;_0x29f231<_0x38ff03[_0xbb6a('0x13c')];_0x29f231++){var _0x1b60c8=_0x38ff03[_0x29f231][_0xbb6a('0x16d')]['name'];if(_0x1b60c8)io['to'](util[_0xbb6a('0x77')](_0xbb6a('0x164'),_0x1b60c8))[_0xbb6a('0x4b')](_0xbb6a('0x165'),{'hopper':_0x38ff03[_0x29f231]});}})[_0xbb6a('0xb3')](function(_0x31dea0){logger['error']('checkPreviewRecallReminder',_0x31dea0);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0xbb6a('0x16e')]=function(){var _0x52d4fb=this;var _0x3390e5;for(var _0x4f469c in this['campaigns']){if(typeof this['campaigns'][_0x4f469c]!=='undefined'){_0x3390e5=this['campaigns'][_0x4f469c];if(isCampaignIvr(_0x3390e5[_0xbb6a('0x4c')])&&isActive(_0x3390e5['active'])){_0x3390e5['sendMessageOneNotActive']=!![];Promise[_0xbb6a('0xb7')]()[_0xbb6a('0xb8')](checkIsActive(_0x3390e5,_0x3390e5[_0xbb6a('0x74')]))[_0xbb6a('0xb8')](checkInterval(_0x3390e5))[_0xbb6a('0xb8')](_0x52d4fb['checkIsTrunkReachable'](_0x3390e5))[_0xbb6a('0xb8')](_0x52d4fb[_0xbb6a('0x14a')](_0x3390e5[_0xbb6a('0x167')],_0x3390e5['dialTimezone'],_0x3390e5[_0xbb6a('0x40')],_0x3390e5))[_0xbb6a('0xb8')](_0x52d4fb[_0xbb6a('0x14c')](_0x3390e5[_0xbb6a('0x43')],_0x3390e5[_0xbb6a('0x168')],_0x3390e5['name'],_0x3390e5))[_0xbb6a('0xb8')](_0x52d4fb[_0xbb6a('0x166')](_0x3390e5))[_0xbb6a('0xb3')](loggerCatchQueueSummary(_0xbb6a('0x16f'),_0x3390e5));}else{notSendMessagesCampaign(_0x3390e5);}}}};function getCallerIdRandom(_0x2786e1,_0x5a6beb){var _0xefec4c;var _0x3e990b;var _0x48c291;if(_0x5a6beb<=0x0){_0x5a6beb=0x1;}_0xefec4c=new RegExp(_0xbb6a('0x170')+_0x5a6beb+'}$');_0x3e990b=Math[_0xbb6a('0x171')](0xa,_0x5a6beb-0x1);_0x48c291=Math[_0xbb6a('0x171')](0xa,_0x5a6beb)-0x1;return util[_0xbb6a('0x77')]('%s',_[_0xbb6a('0x172')](_0x2786e1,_0xefec4c,_['random'](_0x3e990b,_0x48c291)));}function extractCalleridName(_0x516af8){var _0x207710=_0x516af8['match'](/"(.*?)"/);return _0x207710?_0x207710[0x1]:_0x516af8;}Dialer['prototype']['actionOriginate']=function(_0x34a0b3,_0x380ced){var _0x19df56=this;var _0x2c3ab4=uuid['v4']();this['actions'][_0x2c3ab4]=new Action(_0x34a0b3,_0x380ced,_0x2c3ab4);return new Promise(function(_0x536272,_0xf31ad7){if(_[_0xbb6a('0x3f')](_0x34a0b3)&&typeof _0x34a0b3!==_0xbb6a('0x173')){return _0xf31ad7(msgResponse(_0xbb6a('0x174'),_0xbb6a('0x14d'),'voiceQueue\x20is\x20undefine'));}if(_[_0xbb6a('0x3f')](_0x380ced['phone'])||_0x380ced[_0xbb6a('0x175')]===null){return _0xf31ad7(msgResponse(_0xbb6a('0x174'),'Failure',_0xbb6a('0x176')));}var _0x52c506={'XMD-CALLERID':_0x19df56[_0xbb6a('0x25')][_0x2c3ab4]['getCaller'](),'XMD-AGI':_0x34a0b3[_0xbb6a('0x10d')]?util[_0xbb6a('0x77')]('\x22agi://%s/square,%s\x22',ipAgi,_0x34a0b3[_0xbb6a('0x10d')]):_0xbb6a('0x177'),'XMD-AGIAFTER':_0x34a0b3[_0xbb6a('0x178')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x34a0b3[_0xbb6a('0x178')]):_0xbb6a('0x177'),'XMD-QUEUE':_0x34a0b3[_0xbb6a('0x4c')]===_0xbb6a('0x179')?util[_0xbb6a('0x77')]('\x22%s,%s%s,,,%s\x22',_0x34a0b3[_0xbb6a('0x40')],_0x34a0b3[_0xbb6a('0x17a')]||'',_0x34a0b3[_0xbb6a('0x17b')]?'c':'',_0x34a0b3[_0xbb6a('0x11a')]||0x3):'NONE','XMD-CONTACTID':_0x380ced[_0xbb6a('0xd5')],'XMD-CDRTYPE':_0xbb6a('0x7'),'CALLERID(all)':_0x19df56[_0xbb6a('0x25')][_0x2c3ab4]['getCaller'](),'XMD-AMD':_0x34a0b3[_0xbb6a('0xe2')]?'ACTIVE':_0xbb6a('0x177'),'XMD-DESTINATION':_0xbb6a('0xe1')};if(_0x34a0b3['dialAMDActive']){_0x52c506['XMD-AMDINITIALSILENCE']=_0x34a0b3[_0xbb6a('0x17c')]||0x9c4;_0x52c506[_0xbb6a('0x17d')]=_0x34a0b3[_0xbb6a('0x17e')]||0x5dc;_0x52c506['XMD-AMDAFTERGREETINGSILENCE']=_0x34a0b3['dialAMDAfterGreetingSilence']||0x320;_0x52c506[_0xbb6a('0x17f')]=_0x34a0b3['dialAMDTotalAnalysisTime']||0x1388;_0x52c506['XMD-AMDMINWORDLENGTH']=_0x34a0b3[_0xbb6a('0x180')]||0x64;_0x52c506[_0xbb6a('0x181')]=_0x34a0b3['dialAMDBetweenWordsSilence']||0x32;_0x52c506['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x34a0b3[_0xbb6a('0x182')]||0x3;_0x52c506[_0xbb6a('0x183')]=_0x34a0b3[_0xbb6a('0x184')]||0x100;_0x52c506[_0xbb6a('0x185')]=_0x34a0b3[_0xbb6a('0x186')]||0x1388;}if(_0x34a0b3['type']==='outbound'){_0x52c506[_0xbb6a('0x187')]=_0x380ced[_0xbb6a('0xd6')];}else{_0x52c506[_0xbb6a('0x188')]=_0x380ced[_0xbb6a('0x108')];}for(var _0x30d063 in _0x380ced[_0xbb6a('0x189')]){if(typeof _0x380ced[_0xbb6a('0x189')][_0x30d063]!=='undefined'){if(isNotNull(_0x380ced[_0xbb6a('0x189')][_0x30d063])&&_0x30d063!=='id'&&_0x30d063!==_0xbb6a('0x18a')&&_0x30d063!==_0xbb6a('0x18b')&&_0x30d063!==_0xbb6a('0x18c')){_0x52c506[util[_0xbb6a('0x77')](_0xbb6a('0x18d'),'XMD-',_[_0xbb6a('0x18e')](_0x30d063))]=_0x380ced['Contact'][_0x30d063];}}}var _0x997e5b=_0x19df56[_0xbb6a('0x148')](_0x34a0b3[_0xbb6a('0x73')])?getCallerId(_0x34a0b3[_0xbb6a('0x73')]['callerid'],_0x34a0b3['dialOriginateCallerIdName'],_0x34a0b3[_0xbb6a('0x18f')]>0x0?getCallerIdRandom(_0x34a0b3[_0xbb6a('0x5a')],_0x34a0b3['dialRandomLastDigitCallerIdNumber']):_0x34a0b3['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0x34a0b3[_0xbb6a('0x190')])?_0x34a0b3['Trunk'][_0xbb6a('0x75')]:_0x34a0b3['TrunkBackup'][_0xbb6a('0x75')],_0x34a0b3[_0xbb6a('0x59')],_0x34a0b3[_0xbb6a('0x18f')]>0x0?getCallerIdRandom(_0x34a0b3[_0xbb6a('0x5a')],_0x34a0b3[_0xbb6a('0x18f')]):_0x34a0b3[_0xbb6a('0x5a')]);if(_0x997e5b){_0x52c506['XMD-ORIGINATECALLERIDNAME']=_0x19df56[_0xbb6a('0x25')][_0x2c3ab4]['originatecalleridname']=extractCalleridName(_0x997e5b);_0x52c506['XMD-ORIGINATECALLERIDNUM']=_0x380ced[_0xbb6a('0x175')];}_0x34a0b3['variables']=_0x52c506;return ami['Action']({'actionid':_0x2c3ab4,'action':_0xbb6a('0x174'),'channel':_0x19df56[_0xbb6a('0x148')](_0x34a0b3[_0xbb6a('0x73')])?util[_0xbb6a('0x77')]('SIP/%s/%s%s',_0x34a0b3['Trunk'][_0xbb6a('0x40')],isNotNull(_0x34a0b3[_0xbb6a('0x191')])?_0x34a0b3[_0xbb6a('0x191')][_0xbb6a('0x192')]()||'':'',_0x34a0b3['dialCutDigit']>0x0?_0x380ced['phone']['substring'](_0x34a0b3['dialCutDigit']):_0x380ced[_0xbb6a('0x175')]):util[_0xbb6a('0x77')](_0xbb6a('0x193'),_['isNil'](_0x34a0b3['TrunkBackup'])?_0x34a0b3[_0xbb6a('0x73')]['name']:_0x34a0b3[_0xbb6a('0x190')][_0xbb6a('0x40')],isNotNull(_0x34a0b3['dialPrefix'])?_0x34a0b3[_0xbb6a('0x191')][_0xbb6a('0x192')]()||'':'',_0x34a0b3['dialCutDigit']>0x0?_0x380ced[_0xbb6a('0x175')][_0xbb6a('0x194')](_0x34a0b3[_0xbb6a('0x195')]):_0x380ced['phone']),'callerid':_0x997e5b,'Exten':_0xbb6a('0xe1'),'Context':_0xbb6a('0x196'),'Priority':'1','variable':_0x52c506,'timeout':(_0x34a0b3[_0xbb6a('0x5b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2c3ab4})[_0xbb6a('0xb8')](function(_0x1cfdc1){return _0x536272(_0x1cfdc1);})[_0xbb6a('0xb3')](function(_0x2ac311){_0x34a0b3[_0xbb6a('0x197')]+=0x1;var _0x163e36=new History(_0x19df56[_0xbb6a('0x25')][_0x2c3ab4]);logger['error'](util[_0xbb6a('0x77')](_0xbb6a('0x198'),JSON[_0xbb6a('0x76')](_0x2ac311)));_0x163e36[_0xbb6a('0xaa')]=0xe;_0x163e36[_0xbb6a('0xe7')]=_0xbb6a('0x199');_0x163e36[_0xbb6a('0xab')]=moment()['format'](_0xbb6a('0x102'));_0x163e36['endtime']=_0x163e36['starttime'];_0x19df56[_0xbb6a('0xcf')](_0x163e36)['catch'](loggerCatch(_0xbb6a('0x19a')));_0x19df56['moveContactManagedDialer'](_0x163e36)[_0xbb6a('0xb3')](loggerCatch('[originate][error]'))[_0xbb6a('0x139')](function(){delete _0x19df56['actions'][_0x2c3ab4];return _0xf31ad7(msgResponse(_0xbb6a('0x174'),_0xbb6a('0x19b'),_0xbb6a('0x19c')));});});});};Dialer[_0xbb6a('0x1b')][_0xbb6a('0x31')]=function(_0x335ab7){var _0x2d0b4f=this[_0xbb6a('0x25')][_0x335ab7[_0xbb6a('0x12e')]];if(_0x2d0b4f){delete this[_0xbb6a('0x25')][_0x335ab7[_0xbb6a('0x12e')]];_0x2d0b4f['responsetime']=moment()[_0xbb6a('0x77')](_0xbb6a('0x102'));var _0x37b584=_0x2d0b4f[_0xbb6a('0x4c')]===_0xbb6a('0x79')?this['campaigns'][_0x2d0b4f['queue']]:this[_0xbb6a('0x1f')][_0x2d0b4f[_0xbb6a('0x19d')]()];if(!this[_0xbb6a('0xd9')](_0x335ab7[_0xbb6a('0x19e')])){this[_0xbb6a('0xb5')](_0x37b584);return this[_0xbb6a('0x19f')](_0x2d0b4f,_0x37b584,_0x335ab7)['catch'](loggerCatch(_0xbb6a('0x1a0')));}this[_0xbb6a('0x27')][_0x335ab7[_0xbb6a('0xef')]]=_0x2d0b4f;}};Dialer['prototype']['checkRetriveMax']=function(_0x1831f3,_0x5e0632,_0x509f55){var _0x1ee847=new History(_0x5e0632);if(_0x1ee847['countbusyretry']+_0x1ee847['countcongestionretry']+_0x1ee847['countnoanswerretry']+_0x1ee847[_0xbb6a('0xf6')]+_0x1ee847[_0xbb6a('0xf7')]+_0x1ee847[_0xbb6a('0xf8')]+_0x1ee847[_0xbb6a('0xf1')]+_0x1ee847[_0xbb6a('0xf9')]>=_0x509f55[_0xbb6a('0xfa')]-0x1){return!![];}switch(_0x1831f3){case 0x3:if(_0x1ee847[_0xbb6a('0x106')]>=_0x509f55[_0xbb6a('0x1a1')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x1ee847['countnoanswerretry']+=0x1,'scheduledat':moment()[_0xbb6a('0xff')](_0x509f55[_0xbb6a('0x1a2')],_0xbb6a('0x101'))[_0xbb6a('0x77')](_0xbb6a('0x102')),'ContactId':_0x1ee847[_0xbb6a('0xd5')],'ListId':_0x1ee847[_0xbb6a('0x103')],'VoiceQueueId':_0x1ee847[_0xbb6a('0xd6')]||undefined,'CampaignId':_0x1ee847[_0xbb6a('0x108')]||undefined})[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0x1a3')));break;case 0x5:if(_0x1ee847[_0xbb6a('0xf5')]>=_0x509f55[_0xbb6a('0x1a4')]-0x1){return!![];}this[_0xbb6a('0xc3')]({'active':![],'countbusyretry':_0x1ee847['countbusyretry']+=0x1,'scheduledat':moment()[_0xbb6a('0xff')](_0x509f55[_0xbb6a('0x1a5')],_0xbb6a('0x101'))[_0xbb6a('0x77')](_0xbb6a('0x102')),'ContactId':_0x1ee847[_0xbb6a('0xd5')],'ListId':_0x1ee847[_0xbb6a('0x103')],'VoiceQueueId':_0x1ee847['VoiceQueueId']||undefined,'CampaignId':_0x1ee847['CampaignId']||undefined})[_0xbb6a('0xb3')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x1ee847[_0xbb6a('0x105')]>=_0x509f55['dialCongestionMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x1ee847[_0xbb6a('0x105')]+=0x1,'scheduledat':moment()[_0xbb6a('0xff')](_0x509f55[_0xbb6a('0x1a6')],_0xbb6a('0x101'))[_0xbb6a('0x77')](_0xbb6a('0x102')),'ContactId':_0x1ee847['ContactId'],'ListId':_0x1ee847[_0xbb6a('0x103')],'VoiceQueueId':_0x1ee847[_0xbb6a('0xd6')]||undefined,'CampaignId':_0x1ee847[_0xbb6a('0x108')]||undefined})[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0x1a7')));break;case 0x0:if(_0x1ee847[_0xbb6a('0xf6')]>=_0x509f55['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0xbb6a('0xc3')]({'active':![],'countnosuchnumberretry':_0x1ee847['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xbb6a('0xff')](_0x509f55[_0xbb6a('0x1a8')],_0xbb6a('0x101'))[_0xbb6a('0x77')](_0xbb6a('0x102')),'ContactId':_0x1ee847[_0xbb6a('0xd5')],'ListId':_0x1ee847[_0xbb6a('0x103')],'VoiceQueueId':_0x1ee847[_0xbb6a('0xd6')]||undefined,'CampaignId':_0x1ee847['CampaignId']||undefined})[_0xbb6a('0xb3')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x1ee847[_0xbb6a('0xf7')]>=_0x509f55[_0xbb6a('0x122')]-0x1){return!![];}this[_0xbb6a('0xc3')]({'active':![],'countdropretry':_0x1ee847['countdropretry']+=0x1,'scheduledat':moment()[_0xbb6a('0xff')](_0x509f55['dialDropRetryFrequency'],_0xbb6a('0x101'))['format'](_0xbb6a('0x102')),'ContactId':_0x1ee847['ContactId'],'ListId':_0x1ee847[_0xbb6a('0x103')],'VoiceQueueId':_0x1ee847['VoiceQueueId']||undefined,'CampaignId':_0x1ee847['CampaignId']||undefined})[_0xbb6a('0xb3')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x1ee847[_0xbb6a('0xf8')]>=_0x509f55[_0xbb6a('0x12b')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x1ee847[_0xbb6a('0xf8')]+=0x1,'scheduledat':moment()[_0xbb6a('0xff')](_0x509f55[_0xbb6a('0x12a')],_0xbb6a('0x101'))[_0xbb6a('0x77')](_0xbb6a('0x102')),'ContactId':_0x1ee847[_0xbb6a('0xd5')],'ListId':_0x1ee847[_0xbb6a('0x103')],'VoiceQueueId':_0x1ee847['VoiceQueueId']||undefined,'CampaignId':_0x1ee847['CampaignId']||undefined})[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0x12c')));break;case 0x13:if(_0x1ee847['countmachineretry']>=_0x509f55[_0xbb6a('0xfd')]-0x1){return!![];}this[_0xbb6a('0xc3')]({'active':![],'countmachineretry':_0x1ee847[_0xbb6a('0xf1')]+=0x1,'scheduledat':moment()[_0xbb6a('0xff')](_0x509f55[_0xbb6a('0x100')],'minutes')[_0xbb6a('0x77')](_0xbb6a('0x102')),'ContactId':_0x1ee847[_0xbb6a('0xd5')],'ListId':_0x1ee847[_0xbb6a('0x103')],'VoiceQueueId':_0x1ee847[_0xbb6a('0xd6')]||undefined,'CampaignId':_0x1ee847['CampaignId']||undefined})[_0xbb6a('0xb3')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x1ee847[_0xbb6a('0xf9')]>=_0x509f55[_0xbb6a('0x1a9')]-0x1){return!![];}this[_0xbb6a('0xc3')]({'active':![],'countagentrejectretry':_0x1ee847[_0xbb6a('0xf9')]+=0x1,'scheduledat':moment()[_0xbb6a('0xff')](_0x509f55[_0xbb6a('0x1aa')],_0xbb6a('0x101'))[_0xbb6a('0x77')](_0xbb6a('0x102')),'ContactId':_0x1ee847[_0xbb6a('0xd5')],'ListId':_0x1ee847['ListId'],'VoiceQueueId':_0x1ee847['VoiceQueueId']||undefined,'CampaignId':_0x1ee847[_0xbb6a('0x108')]||undefined})['catch'](loggerCatch(_0xbb6a('0x1ab')));break;default:return!![];}};Dialer[_0xbb6a('0x1b')][_0xbb6a('0x19f')]=function(_0x42103a,_0x306be8,_0x2d385f){var _0x6bdd8a=this;var _0x555555=new History(_0x42103a);var _0x41d26f=![];var _0x211662;var _0x3a2122;return new Promise(function(_0x34b624,_0x580ddb){if(_[_0xbb6a('0x3f')](_0x306be8)&&typeof _0x306be8!=='object'){return _0x580ddb(msgResponse('[callProgressDetecting]',_0xbb6a('0x14d'),'entity\x20is\x20undefine'));}if(_[_0xbb6a('0x3f')](_0x2d385f)&&typeof _0x2d385f!==_0xbb6a('0x173')){return _0x580ddb(msgResponse('[callProgressDetecting]','Failure',_0xbb6a('0x1ac')));}_0x6bdd8a[_0xbb6a('0xbc')](_0x555555,_0x2d385f[_0xbb6a('0x111')],_0x306be8)[_0xbb6a('0xb8')](function(_0x2c1c08){if(_0x2c1c08[_0xbb6a('0x121')]==0x1)_0x41d26f=!![];switch(_0x2d385f[_0xbb6a('0x111')]){case'0':_0x306be8[_0xbb6a('0x1ad')]+=0x1;_0x555555[_0xbb6a('0xaa')]=0x0;_0x555555['statedesc']='NoSuchNumber';_0x555555['countnosuchnumberretry']+=0x1;_0x555555[_0xbb6a('0xf2')]+=0x1;ami['emit']('custom:agentnosuchnumber',ut['buildObj'](_0x42103a,_0xbb6a('0x1ae')));_0x211662=_0x306be8[_0xbb6a('0x1a8')];_0x3a2122=_0x306be8[_0xbb6a('0x11f')];_0x6bdd8a[_0xbb6a('0xcf')](_0x555555)[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0xf4')));if(_0x6bdd8a[_0xbb6a('0x1af')](0x0,_0x42103a,_0x306be8)&&!_0x41d26f){if(_0x555555[_0xbb6a('0xf6')]>=_0x306be8['dialNoSuchNumberMaxRetry']){_0x6bdd8a['createStateFinal'](_0x555555,_0x34b624,_0x580ddb,'reason\x200\x20no\x20such\x20number....');}else{_0x6bdd8a[_0xbb6a('0xfb')](_0x555555,_0x34b624,_0x580ddb,_0xbb6a('0x1b0'));}}break;case'3':_0x306be8[_0xbb6a('0x62')]+=0x1;_0x555555[_0xbb6a('0xaa')]=0x3;_0x555555['statedesc']='NoAnswer';_0x555555[_0xbb6a('0x106')]+=0x1;_0x555555[_0xbb6a('0xf2')]+=0x1;var _0x56ed13=ut[_0xbb6a('0x1b1')](_0x42103a,_0x306be8);ami[_0xbb6a('0x4b')](_0xbb6a('0x1b2'),_0x56ed13);_0x211662=_0x306be8[_0xbb6a('0x1a2')];_0x3a2122=_0x306be8[_0xbb6a('0x11f')];_0x6bdd8a[_0xbb6a('0xcf')](_0x555555)['catch'](loggerCatch(_0xbb6a('0x1b3')));if(_0x6bdd8a[_0xbb6a('0x1af')](0x3,_0x42103a,_0x306be8)&&!_0x41d26f){if(_0x555555[_0xbb6a('0x106')]>=_0x306be8[_0xbb6a('0x1a1')]){_0x6bdd8a['createStateFinal'](_0x555555,_0x34b624,_0x580ddb,_0xbb6a('0x1b4'));}else{_0x6bdd8a[_0xbb6a('0xfb')](_0x555555,_0x34b624,_0x580ddb,_0xbb6a('0x1b4'));}}break;case'5':_0x306be8['outboundBusyCallsDay']+=0x1;_0x555555[_0xbb6a('0xaa')]=0x5;_0x555555['statedesc']=_0xbb6a('0x1b5');_0x555555[_0xbb6a('0xf5')]+=0x1;_0x555555[_0xbb6a('0xf2')]+=0x1;ami[_0xbb6a('0x4b')](_0xbb6a('0x1b6'),ut[_0xbb6a('0xec')](_0x42103a,'busy'));_0x211662=_0x306be8[_0xbb6a('0x1a5')];_0x3a2122=_0x306be8['callAdditionalPhoneAfterMin'];_0x6bdd8a['createHistory'](_0x555555)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x6bdd8a[_0xbb6a('0x1af')](0x5,_0x42103a,_0x306be8)&&!_0x41d26f){if(_0x555555['countbusyretry']>=_0x306be8[_0xbb6a('0x1a4')]){_0x6bdd8a[_0xbb6a('0xfe')](_0x555555,_0x34b624,_0x580ddb,_0xbb6a('0x1b7'));}else{_0x6bdd8a[_0xbb6a('0xfb')](_0x555555,_0x34b624,_0x580ddb,_0xbb6a('0x1b7'));}}break;case'8':_0x306be8[_0xbb6a('0x5e')]+=0x1;_0x555555[_0xbb6a('0xaa')]=0x8;_0x555555[_0xbb6a('0xe7')]='Congestion';_0x555555[_0xbb6a('0x105')]+=0x1;_0x555555[_0xbb6a('0xf2')]+=0x1;_0x211662=_0x306be8['dialCongestionRetryFrequency'];_0x3a2122=_0x306be8[_0xbb6a('0x11f')];ami['emit'](_0xbb6a('0x1b8'),ut[_0xbb6a('0xec')](_0x42103a,_0xbb6a('0x1b9')));_0x6bdd8a['createHistory'](_0x555555)[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0x1ba')));if(_0x6bdd8a['checkRetriveMax'](0x8,_0x42103a,_0x306be8)&&!_0x41d26f){if(_0x555555[_0xbb6a('0x105')]>=_0x306be8[_0xbb6a('0x1bb')]){_0x6bdd8a[_0xbb6a('0xfe')](_0x555555,_0x34b624,_0x580ddb,_0xbb6a('0x1bc'));}else{_0x6bdd8a[_0xbb6a('0xfb')](_0x555555,_0x34b624,_0x580ddb,_0xbb6a('0x1bc'));}}break;case'11':_0x306be8[_0xbb6a('0x1bd')]+=0x1;_0x555555['state']=0xb;_0x555555[_0xbb6a('0xe7')]=_0xbb6a('0x128');_0x555555['countabandonedretry']+=0x1;_0x555555[_0xbb6a('0xf2')]+=0x1;_0x211662=_0x306be8[_0xbb6a('0x12a')];_0x3a2122=_0x306be8['callAdditionalPhoneAfterMin'];_0x6bdd8a[_0xbb6a('0xcf')](_0x555555)['catch'](loggerCatch(_0xbb6a('0x12d')));if(_0x6bdd8a['checkRetriveMax'](0xb,_0x42103a,_0x306be8)&&!_0x41d26f){if(_0x555555['countabandonedretry']>=_0x306be8[_0xbb6a('0x12b')]){_0x6bdd8a[_0xbb6a('0xfe')](_0x555555,_0x34b624,_0x580ddb,_0xbb6a('0x1be'));}else{_0x6bdd8a[_0xbb6a('0xfb')](_0x555555,_0x34b624,_0x580ddb,'reason\x2011\x20abandoned');}}break;case'20':_0x306be8['outboundRejectCallsDay']+=0x1;_0x555555[_0xbb6a('0xaa')]=0x14;_0x555555['statedesc']=_0xbb6a('0x1bf');_0x555555[_0xbb6a('0xf9')]+=0x1;_0x555555[_0xbb6a('0xf2')]+=0x1;_0x211662=_0x306be8['dialAgentRejectRetryFrequency'];_0x3a2122=_0x306be8['callAdditionalPhoneAfterMin'];ami[_0xbb6a('0x4b')](_0xbb6a('0x1c0'),ut[_0xbb6a('0xec')](_0x42103a,_0xbb6a('0x1c1')));_0x6bdd8a[_0xbb6a('0xcf')](_0x555555)[_0xbb6a('0xb3')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x6bdd8a[_0xbb6a('0x1af')](0x14,_0x42103a,_0x306be8)&&!_0x41d26f){if(_0x555555[_0xbb6a('0xf9')]>=_0x306be8['dialAgentRejectMaxRetry']){_0x6bdd8a['createStateFinal'](_0x555555,_0x34b624,_0x580ddb,_0xbb6a('0x1c2'));}else{_0x6bdd8a['stateGlobal'](_0x555555,_0x34b624,_0x580ddb,_0xbb6a('0x1c2'));}}break;default:_0x306be8['outboundUnknownCallsDay']+=0x1;_0x555555['state']=0xc;_0x555555[_0xbb6a('0xe7')]=_0x2d385f[_0xbb6a('0x111')];_0x211662=_0x306be8[_0xbb6a('0x1aa')];_0x3a2122=_0x306be8[_0xbb6a('0x11f')];_0x6bdd8a['createHistory'](_0x555555)['catch'](loggerCatch(_0xbb6a('0x1c3')));if(_0x6bdd8a[_0xbb6a('0x1af')](_0x2d385f[_0xbb6a('0x111')],_0x42103a,_0x306be8)&&!_0x41d26f){if(_0x555555['countbusyretry']+_0x555555[_0xbb6a('0x105')]+_0x555555[_0xbb6a('0x106')]+_0x555555[_0xbb6a('0xf6')]+_0x555555[_0xbb6a('0xf7')]+_0x555555[_0xbb6a('0xf8')]+_0x555555[_0xbb6a('0xf1')]+_0x555555['countagentrejectretry']>=_0x306be8[_0xbb6a('0xfa')]){_0x6bdd8a['stateGlobal'](_0x555555,_0x34b624,_0x580ddb,_0x2d385f[_0xbb6a('0x111')]);}else{_0x6bdd8a['createStateFinal'](_0x555555,_0x34b624,_0x580ddb,_0x2d385f['reason']);}}}})[_0xbb6a('0xb8')](function(){if(_0x41d26f){_0x6bdd8a['swapAdditionalPhones'](_0x555555,_0x211662,_0x3a2122)[_0xbb6a('0xb8')](function(){return _0x34b624(0x1);});}});});};Dialer[_0xbb6a('0x1b')][_0xbb6a('0xfb')]=function(_0x77f832,_0x444cca,_0x4ab95b,_0x13c2b2){var _0x46534b=new Final(_0x77f832);_0x46534b[_0xbb6a('0xaa')]=0xf;_0x46534b['statedesc']=_0xbb6a('0x1c4');this[_0xbb6a('0xfe')](_0x46534b,_0x444cca,_0x4ab95b,_0x13c2b2);};Dialer[_0xbb6a('0x1b')][_0xbb6a('0xfe')]=function(_0x2bae7d,_0x5be6b1,_0x4e24c6,_0x80bc9d){this[_0xbb6a('0xcd')](_0x2bae7d)[_0xbb6a('0xb8')](function(){return _0x5be6b1(msgResponse('[callProgressDetecting]',_0xbb6a('0xda'),_0x80bc9d));})['catch'](function(){return _0x4e24c6(msgResponse('[moveContactManagedDialer][0]',_0xbb6a('0x14d'),'contact\x20not\x20moved'));});};Dialer[_0xbb6a('0x1b')][_0xbb6a('0x8')]=function(_0x324709){var _0x3da1a7=_0x324709['dialPredictiveOptimizationPercentage']/0x64;var _0x1821c2=_0x324709['outboundDropCallsDayTimeout']/(_0x324709[_0xbb6a('0x61')]+_0x324709['outboundAnswerCallsDay']);var _0x26b8ac=Math[_0xbb6a('0x1c5')](_0x324709[_0xbb6a('0x6d')]*(_0x324709['predictiveIntervalMaxThreshold']/0x64));var _0xa2a337=Math['round'](_0x324709[_0xbb6a('0x6d')]*(_0x324709[_0xbb6a('0x1c6')]/0x64));var _0x530fa1=_0x324709[_0xbb6a('0x4e')]+_0x324709[_0xbb6a('0xa1')];var _0x118e12=Math[_0xbb6a('0x1c7')](_0x324709['erlangCalls']*_0x324709[_0xbb6a('0x70')]*_0x324709[_0xbb6a('0x6b')]*_0x324709[_0xbb6a('0x6c')]);if(_[_0xbb6a('0x3f')](_0x324709[_0xbb6a('0x72')])){if(!_[_0xbb6a('0x3f')](_0x324709[_0xbb6a('0x29')])){_0x324709['startPredictive']=undefined;loggerPredictive['error'](_0xbb6a('0x1c8'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0xbb6a('0x3f')](_0x324709[_0xbb6a('0x8e')])){loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0xbb6a('0x1c9'));clearInterval(_0x324709['handlePredictive']);_0x324709[_0xbb6a('0x8e')]=undefined;}_0x324709[_0xbb6a('0x72')]=moment()[_0xbb6a('0x77')](_0xbb6a('0x102'));loggerPredictive[_0xbb6a('0x7c')](_0x324709[_0xbb6a('0x40')],_0xbb6a('0x1ca'),_0x324709[_0xbb6a('0x72')]);this[_0xbb6a('0x15e')](_0x324709,0x1);}else if(ifInterval(_0x324709[_0xbb6a('0x1cb')],_0x324709[_0xbb6a('0x72')])){this['handlePower'](_0x324709,0x1);loggerPredictiveCalls[_0xbb6a('0x7c')](_0xbb6a('0x1cc'),_0x324709['startProgressive'],_0x324709[_0xbb6a('0x40')]);_0x324709[_0xbb6a('0x89')]=0x0;_0x324709[_0xbb6a('0x11b')]=0x0;}else if(_0x3da1a7<_0x1821c2&&_0x324709[_0xbb6a('0x1cd')]==='dropRate'){freeVariablesPredictive(_0x324709);loggerPredictive[_0xbb6a('0x7c')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day',_0x1821c2,_0xbb6a('0x72'),_0x324709[_0xbb6a('0x40')]);}else if(_0x118e12<_0x324709[_0xbb6a('0x11b')]&&_0x324709[_0xbb6a('0x1cd')]===_0xbb6a('0x1ce')){freeVariablesPredictive(_0x324709);loggerPredictive['info'](_0xbb6a('0x1cf'),_0xbb6a('0x1d0'),_0x118e12,_0xbb6a('0x1d1'),_0x324709[_0xbb6a('0x11b')],_0xbb6a('0x72'),_0x324709[_0xbb6a('0x40')]);}else if(!ifInterval(_0x324709[_0xbb6a('0x1cb')],_0x324709[_0xbb6a('0x72')])&&_[_0xbb6a('0x3f')](_0x324709['startPredictive'])&&!_[_0xbb6a('0x3f')](_0x324709[_0xbb6a('0x72')])){_0x324709['startPredictive']=moment()[_0xbb6a('0x77')](_0xbb6a('0x102'));loggerPredictive[_0xbb6a('0x7c')](_0x324709[_0xbb6a('0x40')],_0xbb6a('0x1d2'),_0x324709['startPredictive']);this[_0xbb6a('0xc1')](_0x324709[_0xbb6a('0x1cb')])[_0xbb6a('0xb8')](this[_0xbb6a('0x1d3')](_0x324709))[_0xbb6a('0xb8')](mergeDataErlangB(_0x324709))[_0xbb6a('0xb8')](this[_0xbb6a('0x1d4')](_0x324709))['catch'](loggerCatchPredictive(_0xbb6a('0x1d5'),_0x324709));}else if(!ifInterval(_0x324709[_0xbb6a('0x1cb')],_0x324709[_0xbb6a('0x29')])){_0x324709[_0xbb6a('0x11b')]=0x0;_0x324709[_0xbb6a('0x29')]=moment()[_0xbb6a('0x77')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xbb6a('0x7c')](_0x324709[_0xbb6a('0x40')],_0xbb6a('0x1d6'),_0x324709[_0xbb6a('0x29')]);clearInterval(_0x324709[_0xbb6a('0x8e')]);_0x324709['handlePredictive']=undefined;this[_0xbb6a('0xc1')](_0x324709[_0xbb6a('0x1cb')])[_0xbb6a('0xb8')](this['getDataPredictive'](_0x324709))[_0xbb6a('0xb8')](mergeDataErlangB(_0x324709))[_0xbb6a('0xb8')](this[_0xbb6a('0x1d4')](_0x324709))['catch'](loggerCatchPredictive(_0xbb6a('0x1d7'),_0x324709));}else if(_0x324709[_0xbb6a('0x6d')]&&_0x530fa1<_0x324709['predictiveIntervalAvailable']-_0xa2a337){freeVariablesPredictive(_0x324709);loggerPredictive[_0xbb6a('0x7c')](_0x324709[_0xbb6a('0x40')],_0xbb6a('0x1d8'),_0x530fa1,_0xbb6a('0x1d9'),_0x324709[_0xbb6a('0x6d')],'-',_0xa2a337,'=',_0x324709[_0xbb6a('0x6d')]-_0xa2a337,')');}else if(_0x324709[_0xbb6a('0x6d')]&&_0x530fa1>_0x324709['predictiveIntervalAvailable']+_0x26b8ac){freeVariablesPredictive(_0x324709);loggerPredictive[_0xbb6a('0x7c')](_0x324709[_0xbb6a('0x40')],_0xbb6a('0x1d8'),_0x530fa1,')\x20are\x20more\x20than\x20threshold\x20(',_0x324709[_0xbb6a('0x6d')],'+',_0x26b8ac,'=',_0x324709['predictiveIntervalAvailable']+_0x26b8ac,')');}};Dialer[_0xbb6a('0x1b')][_0xbb6a('0x1d3')]=function(_0x4c3ea5){var _0x422de8=this;return function(_0x44c7b6){return new Promise(function(_0x2a1108,_0x4e72e7){_[_0xbb6a('0x8d')](_0x4c3ea5,_0x44c7b6[0x0]);if(checkGetDataPredictive(_0x44c7b6[0x0])){var _0x4d0e08=_0x4c3ea5[_0xbb6a('0x6d')]=_0x4c3ea5['talking']+_0x4c3ea5['available'];var _0x175095=_0x4c3ea5[_0xbb6a('0x1cb')]*0x3c;var _0x543873=_0x44c7b6[0x0]['predictiveIntervalAvgTalktime']+_0x44c7b6[0x0][_0xbb6a('0x66')];var _0x40513d=(_0x44c7b6[0x0][_0xbb6a('0x80')]+_0x44c7b6[0x0][_0xbb6a('0x69')]+_0x44c7b6[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x44c7b6[0x0]['predictiveIntervalTotalCalls'];_0x4c3ea5['predictiveIntervalHitRate']=_0x40513d>0x0?_0x40513d:0x1;switch(_0x4c3ea5[_0xbb6a('0x1cd')]){case _0xbb6a('0x1ce'):var _0x3094b9=_0x4c3ea5[_0xbb6a('0x1da')]/0x64;return _0x422de8['abandonmentRate'](_0x4d0e08,_0x175095,_0x543873,_0x40513d,_0x3094b9)[_0xbb6a('0xb8')](function(_0x1696ca){return _0x2a1108(_0x1696ca);});case _0xbb6a('0x1db'):var _0x492744=_0x4c3ea5[_0xbb6a('0x1da')]/0x64;return _0x422de8[_0xbb6a('0x1dc')](_0x4d0e08,_0x175095,_0x543873,_0x40513d,_0x492744)['then'](function(_0x4ab3fc){return _0x2a1108(_0x4ab3fc);});default:return _0x4e72e7(msgResponse(_0xbb6a('0x1dd'),_0xbb6a('0x14d'),_0xbb6a('0x1de')));}}else{return _0x4e72e7(msgResponse(_0xbb6a('0x1dd'),'Failure',_0xbb6a('0x1df')));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0x3564b1){var _0x1c1ac8=this;return function(_0x8cea03){return new Promise(function(_0x1d345e,_0x2f7634){_[_0xbb6a('0x8d')](_0x3564b1,_0x8cea03[0x0]);if(checkGetDataPredictive(_0x8cea03[0x0])){loggerPredictive[_0xbb6a('0x7c')](JSON[_0xbb6a('0x76')](_0x8cea03[0x0]));if(_0x3564b1[_0xbb6a('0x1cd')]==='dropRate'){return _0x1c1ac8[_0xbb6a('0xcb')](_0x3564b1['id'])['then'](function(_0x1badfa){var _0x101559=_0x3564b1[_0xbb6a('0x4f')]-_0x1badfa[0x0]['outboundQueuePauses'];var _0x5f2a5f=_0x3564b1[_0xbb6a('0x1cb')]*0x3c;var _0x61481b=_0x8cea03[0x0][_0xbb6a('0x67')]+_0x8cea03[0x0]['predictiveIntervalAvgHoldtime'];var _0x3f8c48=(_0x8cea03[0x0][_0xbb6a('0x80')]+_0x8cea03[0x0][_0xbb6a('0x69')]+_0x8cea03[0x0][_0xbb6a('0x68')])/_0x8cea03[0x0][_0xbb6a('0x6e')];var _0x398f03=_0x3564b1['dialPredictiveOptimizationPercentage']/0x64;_0x3564b1[_0xbb6a('0x1e0')]=_0x1badfa[0x0][_0xbb6a('0x1e1')]||0x0;_0x3564b1[_0xbb6a('0x6b')]=_0x3f8c48>0x0?_0x3f8c48:0x1;return _0x1c1ac8[_0xbb6a('0x1e2')](_0x101559,_0x5f2a5f,_0x61481b,_0x3f8c48,_0x398f03);})[_0xbb6a('0xb8')](function(_0x2d6690){return _0x1d345e(_0x2d6690);})['catch'](function(_0x3ec99f){return _0x2f7634(msgResponse(_0xbb6a('0x1e3'),_0xbb6a('0x14d'),JSON['stringify'](_0x3ec99f)));});}if(_0x3564b1['dialPredictiveOptimization']==='agentBusyFactor'){return _0x1c1ac8[_0xbb6a('0xcb')](_0x3564b1['id'])[_0xbb6a('0xb8')](function(_0x497ae1){var _0x5916ed=_0x3564b1['loggedIn']-_0x497ae1[0x0][_0xbb6a('0x1e1')];var _0x2a8d5c=_0x3564b1['dialPredictiveInterval']*0x3c;var _0x5851f6=_0x8cea03[0x0][_0xbb6a('0x67')]+_0x8cea03[0x0][_0xbb6a('0x66')];var _0xeb77c5=(_0x8cea03[0x0]['predictiveIntervalAnsweredCalls']+_0x8cea03[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x8cea03[0x0][_0xbb6a('0x68')])/_0x8cea03[0x0][_0xbb6a('0x6e')];var _0x496ec5=_0x3564b1[_0xbb6a('0x1da')]/0x64;_0x3564b1['predictiveIntervalPauses']=_0x497ae1[0x0][_0xbb6a('0x1e1')]||0x0;_0x3564b1['predictiveIntervalHitRate']=_0xeb77c5>0x0?_0xeb77c5:0x1;return _0x1c1ac8[_0xbb6a('0x1dc')](_0x5916ed,_0x2a8d5c,_0x5851f6,_0xeb77c5,_0x496ec5);})[_0xbb6a('0xb8')](function(_0x18f4d7){return _0x1d345e(_0x18f4d7);})[_0xbb6a('0xb3')](function(_0x5f0f58){return _0x2f7634(msgResponse('[CatchErlangB]',_0xbb6a('0x14d'),JSON[_0xbb6a('0x76')](_0x5f0f58)));});}}else{return _0x2f7634(msgResponse(_0xbb6a('0x1dd'),'Failure',_0xbb6a('0x1df')));}});};};Dialer[_0xbb6a('0x1b')]['startMethodPredictive']=function(_0x270341){var _0x43b105=this;return function(){var _0x3577cf=0x0;var _0x58fab5=Math[_0xbb6a('0x1c7')](_0x270341['erlangCallToSecond']*0x3e8);if(_0x58fab5>0x0){_0x58fab5=_0x58fab5<0x64?0x64:_0x58fab5;loggerPredictive['info'](_0x270341[_0xbb6a('0x40')],_0xbb6a('0x1e4'),_0x58fab5,_0xbb6a('0x48'));_0x270341[_0xbb6a('0x8e')]=setInterval(function(){_0x43b105[_0xbb6a('0x8e')](_0x270341);loggerPredictiveCalls[_0xbb6a('0x7c')](_0xbb6a('0x1e5'),_0x3577cf+=0x1);},_0x58fab5);}else{loggerPredictive[_0xbb6a('0x7c')](_0x270341[_0xbb6a('0x40')],_0xbb6a('0x1e6'));}};};Dialer[_0xbb6a('0x1b')][_0xbb6a('0x1e7')]=function(_0x104106,_0x2659f6){var _0x27d51f=this;return function(_0x49590f){if(_[_0xbb6a('0x7b')](_0x49590f)){if(_[_0xbb6a('0xb0')](_0x2659f6[_0xbb6a('0x1e8')])||!_0x2659f6[_0xbb6a('0x1e9')]){if(_0x104106['dialMethod']==='booked'){_0x104106[_0xbb6a('0x137')]=_[_0xbb6a('0x3f')](_0x104106[_0xbb6a('0x137')])?!![]:_0x104106[_0xbb6a('0x137')];var _0x4a1467=uuid['v4']();_0x27d51f['actions'][_0x4a1467]=new Action(_0x104106,_0x2659f6,_0x4a1467);loggerBooked[_0xbb6a('0x7c')](_0xbb6a('0x1ea'),_0x4a1467,_0xbb6a('0x1eb'),JSON[_0xbb6a('0x76')](_0x104106[_0xbb6a('0x137')]),_0xbb6a('0x1ec'),_0x104106[_0xbb6a('0x40')]);if(_0x104106[_0xbb6a('0x137')]){_0x104106['queueStatusComplete']=![];_0x27d51f[_0xbb6a('0x2b')][_0x27d51f['actions'][_0x4a1467][_0xbb6a('0xb6')]]=[];ami[_0xbb6a('0x155')]({'actionid':_0x4a1467,'action':'queuestatus','queue':_0x104106[_0xbb6a('0x40')]})[_0xbb6a('0xb3')](function(){_0x27d51f['updateOriginated'](_0x104106);_0x27d51f[_0xbb6a('0xc3')]({'active':![],'ContactId':_0x27d51f[_0xbb6a('0x25')][_0x4a1467]['ContactId'],'ListId':_0x27d51f[_0xbb6a('0x25')][_0x4a1467][_0xbb6a('0x103')],'VoiceQueueId':_0x27d51f[_0xbb6a('0x25')][_0x4a1467][_0xbb6a('0xd6')]||undefined,'CampaignId':_0x27d51f[_0xbb6a('0x25')][_0x4a1467][_0xbb6a('0x108')]||undefined})['catch'](loggerCatch(_0xbb6a('0x1ed')));delete _0x27d51f[_0xbb6a('0x25')][_0x4a1467];});}else{loggerBooked[_0xbb6a('0x7c')]('[booked][checkContactBlack][else]',JSON[_0xbb6a('0x76')](_0x104106[_0xbb6a('0x137')]),_0xbb6a('0x1ec'),_0x104106['name']);_0x27d51f['updateOriginated'](_0x104106);_0x27d51f['rescheduleContact']({'active':![],'ContactId':_0x27d51f[_0xbb6a('0x25')][_0x4a1467][_0xbb6a('0xd5')],'ListId':_0x27d51f[_0xbb6a('0x25')][_0x4a1467][_0xbb6a('0x103')],'VoiceQueueId':_0x27d51f['actions'][_0x4a1467][_0xbb6a('0xd6')]||undefined,'CampaignId':_0x27d51f[_0xbb6a('0x25')][_0x4a1467][_0xbb6a('0x108')]||undefined})[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0x1ed')));delete _0x27d51f[_0xbb6a('0x25')][_0x4a1467];}}else{return _0x27d51f['actionOriginate'](_0x104106,_0x2659f6);}}else{if(getDiff(_0x2659f6['scheduledat'])<_0x104106['dialRecallMeTimeout']*0x3c){if(_0x2659f6['Agent']&&!_0x2659f6[_0xbb6a('0x16d')][_0xbb6a('0x1ee')]){_0x27d51f[_0xbb6a('0x90')]['run'](_0x2659f6['id'])[_0xbb6a('0x139')](function(){_0x27d51f[_0xbb6a('0xb5')](_0x104106);});}else{_0x27d51f[_0xbb6a('0xc5')]({'active':![]},_0x2659f6['id'],0x1)['finally'](function(){_0x27d51f['updateOriginated'](_0x104106);});}}else{_0x104106[_0xbb6a('0x63')]+=0x1;_0x27d51f[_0xbb6a('0xb5')](_0x104106);if(_0x104106[_0xbb6a('0x1ef')]){_0x27d51f['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2659f6['ContactId'],'ListId':_0x2659f6[_0xbb6a('0x103')],'VoiceQueueId':_0x2659f6[_0xbb6a('0xd6')]||undefined,'CampaignId':_0x2659f6[_0xbb6a('0x108')]||undefined})['catch'](loggerCatch(_0xbb6a('0x1f0')));_0x27d51f[_0xbb6a('0xcf')](createObjHistory(_0x104106,_0x2659f6,_0xbb6a('0x1f1'),0x17,'RecallInQueue'))['catch'](loggerCatch(_0xbb6a('0x1f2')));}else{_0x27d51f[_0xbb6a('0xd4')](createObjHistory(_0x104106,_0x2659f6,_0xbb6a('0x1f3'),0x16,_0xbb6a('0x1f4')),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x104106[_0xbb6a('0x5c')]+=0x1;_0x27d51f[_0xbb6a('0xd4')](createObjHistory(_0x104106,_0x2659f6,_0xbb6a('0x1f5'),0xd,_0xbb6a('0x1f6')),_0xbb6a('0x1f7'),_0xbb6a('0x1f8'));throw _0xbb6a('0x1f9');}};};Dialer['prototype'][_0xbb6a('0x1fa')]=function(_0x3830e7){var _0x159e3b=this;var _0x1e025a=_0x3830e7[_0xbb6a('0x1fb')]-_0x3830e7['originated']-_0x3830e7[_0xbb6a('0xc8')];emitCampaignSummary(_0x3830e7);if(_0x1e025a>0x0){if(_0x1e025a>this[_0xbb6a('0x23')]){_0x1e025a=this[_0xbb6a('0x23')];}_0x3830e7['temp']+=_0x1e025a;this[_0xbb6a('0xc9')](_0x3830e7['id'],_0x1e025a,_0x3830e7[_0xbb6a('0x1fc')],_0x3830e7)['then'](function(_0x1c41b5){_0x3830e7[_0xbb6a('0xc8')]-=_0x1e025a;_0x3830e7[_0xbb6a('0xc8')]=_0x3830e7[_0xbb6a('0xc8')]>0x0?_0x3830e7[_0xbb6a('0xc8')]:0x0;if(!checkContactEmpty(_0x1c41b5)){_0x3830e7[_0xbb6a('0x42')]=_0xbb6a('0x9e');logger[_0xbb6a('0x7c')](_0xbb6a('0x1fd')+_0x3830e7['name']);}else{_0x3830e7[_0xbb6a('0x97')]+=_0x1c41b5[_0xbb6a('0x13c')];_0x3830e7[_0xbb6a('0x42')]=_0xbb6a('0x1fe');for(var _0x239416=0x0;_0x239416<_0x1c41b5[_0xbb6a('0x13c')];_0x239416+=0x1){_0x3830e7[_0xbb6a('0x1ff')]+=0x1;if(_['isNil'](_0x1c41b5[_0x239416])||_[_0xbb6a('0xb0')](_0x1c41b5[_0x239416][_0xbb6a('0x189')])||_[_0xbb6a('0xb0')](_0x1c41b5[_0x239416][_0xbb6a('0x175')])){_0x159e3b['emptyContact'](_0xbb6a('0x200'),_0x3830e7,_0x1c41b5[_0x239416]);}else{_0x159e3b[_0xbb6a('0xc0')](_['pick'](_0x1c41b5[_0x239416],['CampaignId',_0xbb6a('0x175')]))['then'](_0x159e3b[_0xbb6a('0x1e7')](_0x3830e7,_0x1c41b5[_0x239416]))[_0xbb6a('0xb3')](_0x159e3b['loggerHandler'](_0xbb6a('0x201'),_0x3830e7));}}}})[_0xbb6a('0xb3')](loggerGetContactDialer(_0xbb6a('0x202'),_0x3830e7,_0x1e025a));}};Dialer[_0xbb6a('0x1b')][_0xbb6a('0x15e')]=function(_0x123d0e,_0xa6054){var _0x60238c=this;var _0x272661=[];var _0x594807=_0xa6054>=0x1?_0xa6054:0x1;if(_0x123d0e[_0xbb6a('0x58')]===_0xbb6a('0x161')){_0x594807=0x1;}var _0x5ea04b=Math[_0xbb6a('0x1c7')](_0x123d0e[_0xbb6a('0x4e')]*_0x594807)-_0x123d0e[_0xbb6a('0x97')]-_0x123d0e[_0xbb6a('0xc8')];emitVoiceQueueSummary(_0x123d0e);if(_0x123d0e[_0xbb6a('0x203')]>0x0){var _0x2bda27=_0x123d0e[_0xbb6a('0x203')]-_0x123d0e[_0xbb6a('0x97')]-_0x123d0e[_0xbb6a('0xa1')]-_0x123d0e[_0xbb6a('0xc8')]-_0x123d0e[_0xbb6a('0x50')];if(_0x5ea04b>_0x2bda27){_0x5ea04b=_0x2bda27;}}if(_0x5ea04b>0x0){if(_0x123d0e[_0xbb6a('0x58')]==='booked'){_0x5ea04b=0x1;}if(_0x5ea04b>this[_0xbb6a('0x23')]){_0x5ea04b=this[_0xbb6a('0x23')];}_0x123d0e[_0xbb6a('0xc8')]+=_0x5ea04b;for(var _0x273a75 in this[_0xbb6a('0x21')]){if(typeof this[_0xbb6a('0x21')][_0x273a75]!==_0xbb6a('0x98')){if(this[_0xbb6a('0x21')][_0x273a75]['state']==='not_inuse'&&this[_0xbb6a('0x21')][_0x273a75][_0xbb6a('0xb1')]===_0xbb6a('0xdb')){_0x272661['push'](this['agents'][_0x273a75]['id']);}}}this[_0xbb6a('0xc7')](_0x123d0e['id'],_0x272661,_0x5ea04b,_0x123d0e[_0xbb6a('0x1fc')],_0x123d0e)[_0xbb6a('0xb8')](function(_0xb62a37){_0x123d0e[_0xbb6a('0xc8')]-=_0x5ea04b;_0x123d0e[_0xbb6a('0xc8')]=_0x123d0e[_0xbb6a('0xc8')]>0x0?_0x123d0e[_0xbb6a('0xc8')]:0x0;if(!checkContactEmpty(_0xb62a37)){_0x60238c[_0xbb6a('0xb9')](_0x123d0e)[_0xbb6a('0xb8')](sendMessageReschedule(_0x123d0e))[_0xbb6a('0xb3')](loggerCatch(_0xbb6a('0x204')));}else{_0x123d0e[_0xbb6a('0x97')]+=_0xb62a37['length'];_0x123d0e[_0xbb6a('0x42')]=_0x123d0e['dialMethod']===_0xbb6a('0x161')?_0xbb6a('0x205'):_0xbb6a('0x1fe');for(var _0x4b75ed=0x0;_0x4b75ed<_0xb62a37['length'];_0x4b75ed+=0x1){if(_[_0xbb6a('0xb0')](_0xb62a37[_0x4b75ed])||_[_0xbb6a('0xb0')](_0xb62a37[_0x4b75ed]['Contact'])||_[_0xbb6a('0xb0')](_0xb62a37[_0x4b75ed][_0xbb6a('0x175')])){_0x60238c['emptyContact'](_0xbb6a('0x200'),_0x123d0e,_0xb62a37[_0x4b75ed]);}else{_0x60238c[_0xbb6a('0xba')](_[_0xbb6a('0x135')](_0xb62a37[_0x4b75ed],[_0xbb6a('0xd6'),_0xbb6a('0x175')]))[_0xbb6a('0xb8')](_0x60238c['checkContactBlack'](_0x123d0e,_0xb62a37[_0x4b75ed]))[_0xbb6a('0xb3')](_0x60238c[_0xbb6a('0x206')](_0xbb6a('0x200'),_0x123d0e));}}}})['catch'](loggerGetContactDialer(_0xbb6a('0x207'),_0x123d0e,_0x5ea04b));}};Dialer['prototype'][_0xbb6a('0x8e')]=function(_0x2dac7d){if(_0x2dac7d[_0xbb6a('0x203')]>0x0){var _0x4017b1=_0x2dac7d[_0xbb6a('0x203')]-_0x2dac7d[_0xbb6a('0x97')]-_0x2dac7d['talking'];if(_0x4017b1>0x0){this[_0xbb6a('0x208')](_0x2dac7d);}else{loggerPredictiveCalls[_0xbb6a('0x7c')]('[handlePredictive][limitChannel]');}}else{this[_0xbb6a('0x208')](_0x2dac7d);}};Dialer[_0xbb6a('0x1b')][_0xbb6a('0x208')]=function(_0xf68d82){var _0x1333af=this;var _0x29edad=[];_0xf68d82[_0xbb6a('0x97')]+=0x1;for(var _0x1eba89 in this[_0xbb6a('0x21')]){if(typeof this[_0xbb6a('0x21')][_0x1eba89]!==_0xbb6a('0x98')){if(this['agents'][_0x1eba89][_0xbb6a('0xaa')]===_0xbb6a('0x209')&&this['agents'][_0x1eba89][_0xbb6a('0xb1')]===_0xbb6a('0xdb')){_0x29edad[_0xbb6a('0x134')](this[_0xbb6a('0x21')][_0x1eba89]['id']);}}}this[_0xbb6a('0xc7')](_0xf68d82['id'],_0x29edad,0x1,_0xf68d82[_0xbb6a('0x1fc')],_0xf68d82)['then'](function(_0x5aa718){if(!checkContactEmpty(_0x5aa718)){checkContactLowerLimitOriginate(_0xf68d82,0x1,0x0);_0x1333af['countReScheduled'](_0xf68d82)[_0xbb6a('0xb8')](sendMessageReschedule(_0xf68d82))[_0xbb6a('0xb3')](loggerCatch('[countReScheduled]\x20'));}else{_0xf68d82[_0xbb6a('0x42')]=_0xbb6a('0x1fe');if(_['isNil'](_0x5aa718[0x0])||_[_0xbb6a('0xb0')](_0x5aa718[0x0][_0xbb6a('0x189')])||_[_0xbb6a('0xb0')](_0x5aa718[0x0][_0xbb6a('0x175')])){_0x1333af[_0xbb6a('0xd2')](_0xbb6a('0x200'),_0xf68d82,_0x5aa718[0x0]);}else{_0x1333af[_0xbb6a('0xba')](_[_0xbb6a('0x135')](_0x5aa718[0x0],[_0xbb6a('0xd6'),_0xbb6a('0x175')]))[_0xbb6a('0xb8')](_0x1333af['checkContactBlack'](_0xf68d82,_0x5aa718[0x0]))[_0xbb6a('0xb3')](_0x1333af['loggerHandler'](_0xbb6a('0x20a'),_0xf68d82));}}})['catch'](loggerGetContactDialer('[getContactDialerPredictive]',_0xf68d82,0x1));emitVoiceQueueSummary(_0xf68d82);};Dialer[_0xbb6a('0x1b')][_0xbb6a('0x1e2')]=function(_0x3330ad,_0x1d5daa,_0x3deb44,_0x486a25,_0x127507,_0xa8e4e4){loggerPredictive[_0xbb6a('0x7c')](_0xbb6a('0x20b'));loggerPredictive[_0xbb6a('0x7c')]('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',_0x3330ad);loggerPredictive[_0xbb6a('0x7c')](_0xbb6a('0x20c'),_0x1d5daa);loggerPredictive[_0xbb6a('0x7c')]('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',_0x3deb44);loggerPredictive[_0xbb6a('0x7c')](_0xbb6a('0x20d'),_0x486a25);loggerPredictive[_0xbb6a('0x7c')](_0xbb6a('0x20e'),_0x127507);loggerPredictive[_0xbb6a('0x7c')](_0xbb6a('0x84'));return new Promise(function(_0x3fea79,_0x4581d9){if(_0x3330ad<=0x0||isNaN(_0x3330ad)){return _0x4581d9(msgResponse(_0xbb6a('0x20f'),'Error',_0xbb6a('0x210')+_0x3330ad));}if(_0x3deb44<=0x0||isNaN(_0x3deb44)){return _0x4581d9(msgResponse(_0xbb6a('0x20f'),_0xbb6a('0x19b'),'Ts\x20=\x20'+_0x3deb44));}if(_0x486a25<=0x0||isNaN(_0x486a25)){return _0x4581d9(msgResponse(_0xbb6a('0x20f'),_0xbb6a('0x19b'),_0xbb6a('0x211')+_0x486a25));}if(_0x1d5daa<=0x0||isNaN(_0x1d5daa)){return _0x4581d9(msgResponse(_0xbb6a('0x20f'),_0xbb6a('0x19b'),'interval\x20=\x20'+_0x1d5daa));}if(_0x127507<=0x0||isNaN(_0x127507)){return _0x4581d9(msgResponse(_0xbb6a('0x20f'),_0xbb6a('0x19b'),_0xbb6a('0x212')+_0x127507));}_0xa8e4e4=_0xa8e4e4||0x0;var _0x41da04=0x1/_0x3deb44;var _0x181b60=0x0;var _0x30fdb4=0x0;var _0x5d4dbd=0x0;var _0xe863b9=0x0;for(var _0x30ab50=0x0;_0x5d4dbd<_0x127507;_0x30ab50+=0x1){_0x30fdb4=_0x30ab50/_0x1d5daa;_0x181b60=(_0x486a25*_0x30fdb4+_0xa8e4e4)/_0x41da04;_0x5d4dbd=erlangb(_0x181b60,_0x3330ad);_0xe863b9=_0x181b60/_0x3330ad*(0x1-erlangb(_0x181b60,_0x3330ad));}return _0x3fea79({'erlangCalls':_0x30ab50,'erlangCallToSecond':_0x1d5daa/_0x30ab50,'erlangAbandonmentRate':_0x5d4dbd,'erlangBusyFactor':_0xe863b9});});};Dialer['prototype']['busyFactor']=function(_0xc9eaa1,_0xc5546a,_0x22aaa5,_0x4a308d,_0x13b176,_0x51034e){loggerPredictive[_0xbb6a('0x7c')](_0xbb6a('0x213'));loggerPredictive[_0xbb6a('0x7c')]('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',_0xc9eaa1);loggerPredictive['info'](_0xbb6a('0x20c'),_0xc5546a);loggerPredictive[_0xbb6a('0x7c')](_0xbb6a('0x214'),_0x22aaa5);loggerPredictive[_0xbb6a('0x7c')]('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',_0x4a308d);loggerPredictive[_0xbb6a('0x7c')](_0xbb6a('0x215'),_0x13b176);loggerPredictive['info'](_0xbb6a('0x84'));return new Promise(function(_0x1b45c6,_0x42ebcb){if(_0xc9eaa1<=0x0||isNaN(_0xc9eaa1)){return _0x42ebcb(msgResponse('[busyFactor]',_0xbb6a('0x19b'),'m\x20=\x20'+_0xc9eaa1));}if(_0x22aaa5<=0x0||isNaN(_0x22aaa5)){return _0x42ebcb(msgResponse(_0xbb6a('0x216'),_0xbb6a('0x19b'),_0xbb6a('0x217')+_0x22aaa5));}if(_0x4a308d<=0x0||isNaN(_0x4a308d)){return _0x42ebcb(msgResponse(_0xbb6a('0x216'),_0xbb6a('0x19b'),_0xbb6a('0x211')+_0x4a308d));}if(_0xc5546a<=0x0||isNaN(_0xc5546a)){return _0x42ebcb(msgResponse(_0xbb6a('0x216'),_0xbb6a('0x19b'),_0xbb6a('0x218')+_0xc5546a));}if(_0x13b176<=0x0||isNaN(_0x13b176)){return _0x42ebcb(msgResponse(_0xbb6a('0x216'),_0xbb6a('0x19b'),_0xbb6a('0x219')+_0x13b176));}_0x51034e=_0x51034e||0x0;var _0x371107=0x1/_0x22aaa5;var _0x3c049f=0x0;var _0x5eb25d=0x0;var _0x5e316d=0x0;var _0x311900=0x0;for(var _0x57b114=0x0;_0x311900<_0x13b176;_0x57b114+=0x1){_0x5eb25d=_0x57b114/_0xc5546a;_0x3c049f=(_0x4a308d*_0x5eb25d+_0x51034e)/_0x371107;_0x5e316d=erlangb(_0x3c049f,_0xc9eaa1);_0x311900=_0x3c049f/_0xc9eaa1*(0x1-erlangb(_0x3c049f,_0xc9eaa1));}return _0x1b45c6({'erlangCalls':_0x57b114,'erlangCallToSecond':_0xc5546a/_0x57b114,'erlangAbandonmentRate':_0x5e316d,'erlangBusyFactor':_0x311900});});};module['exports']=Dialer;
\ No newline at end of file
index e768107..c6bbdb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3451=['campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','type'];(function(_0x3c59fc,_0x10dbd2){var _0x2b78d4=function(_0x5f161a){while(--_0x5f161a){_0x3c59fc['push'](_0x3c59fc['shift']());}};_0x2b78d4(++_0x10dbd2);}(_0x3451,0x1a8));var _0x1345=function(_0x4e3563,_0xb81ba){_0x4e3563=_0x4e3563-0x0;var _0x164b85=_0x3451[_0x4e3563];return _0x164b85;};'use strict';var util=require(_0x1345('0x0'));var _=require(_0x1345('0x1'));var moment=require(_0x1345('0x2'));function getSeconds(_0x423654,_0x35a4c0){var _0x357086=moment(_0x423654)[_0x1345('0x3')](0x0);var _0x4f5073=moment(_0x35a4c0)[_0x1345('0x3')](0x0);return _0x357086[_0x1345('0x4')](_0x4f5073,'seconds');}function QueueCallerAbandon(_0x230f60,_0x5e9095){this['scheduledat']=_0x230f60['scheduledat'];this[_0x1345('0x5')]=_0x230f60[_0x1345('0x5')];this[_0x1345('0x6')]=_0x230f60[_0x1345('0x5')]==='outbound'?_0x1345('0x7'):_0x230f60[_0x1345('0x5')];this[_0x1345('0x8')]=_0x230f60[_0x1345('0x8')];this[_0x1345('0x9')]=_0x230f60[_0x1345('0x9')];this['countnoanswerretry']=_0x230f60[_0x1345('0xa')];this['countglobal']=_0x230f60[_0x1345('0x8')]+_0x230f60[_0x1345('0x9')]+_0x230f60[_0x1345('0xa')]+_0x230f60[_0x1345('0xb')]+_0x230f60['countdropretry']+_0x230f60['countabandonedretry']+_0x230f60[_0x1345('0xc')]+_0x230f60[_0x1345('0xd')];this[_0x1345('0xb')]=_0x230f60[_0x1345('0xb')];this['countdropretry']=_0x230f60[_0x1345('0xe')];this[_0x1345('0xf')]=_0x230f60[_0x1345('0xf')];this[_0x1345('0xc')]=_0x230f60[_0x1345('0xc')];this['countagentrejectretry']=_0x230f60['countagentrejectretry'];this['uniqueid']=_0x5e9095[_0x1345('0x10')];this[_0x1345('0x11')]=_0x230f60[_0x1345('0x12')];this[_0x1345('0x13')]=_0x230f60[_0x1345('0x14')];this[_0x1345('0x15')]=_0x230f60['starttime'];this[_0x1345('0x16')]=_0x230f60[_0x1345('0x16')];this[_0x1345('0x17')]=_0x230f60[_0x1345('0x17')];this[_0x1345('0x18')]=this[_0x1345('0x17')];this[_0x1345('0x19')]=getSeconds(_0x230f60[_0x1345('0x16')],_0x230f60[_0x1345('0x15')]);this[_0x1345('0x1a')]=getSeconds(this[_0x1345('0x17')],_0x230f60[_0x1345('0x16')]);this[_0x1345('0x1b')]=0x0;this[_0x1345('0x7')]=_0x5e9095['queue'];this[_0x1345('0x1c')]=_0x5e9095[_0x1345('0x1d')];this[_0x1345('0x1e')]=_0x5e9095[_0x1345('0x1e')];this[_0x1345('0x1f')]=_0x230f60[_0x1345('0x1f')];this[_0x1345('0x20')]=_0x230f60['callbackuniqueid'];this[_0x1345('0x21')]=_0x230f60['callbackat'];this[_0x1345('0x22')]=_0x230f60[_0x1345('0x22')];this[_0x1345('0x23')]=_0x230f60['ContactId'];this[_0x1345('0x24')]=_0x230f60['ListId'];this['UserId']=_0x230f60[_0x1345('0x25')];this[_0x1345('0x26')]=_0x230f60[_0x1345('0x26')];this[_0x1345('0x27')]=_0x230f60['CampaignId'];this[_0x1345('0x28')]=_0x230f60[_0x1345('0x28')]||'';this[_0x1345('0x29')]=_0x230f60['originatecalleridname']||'';}module[_0x1345('0x2a')]=QueueCallerAbandon;
\ No newline at end of file
+var _0xc918=['type','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','diff','queue'];(function(_0x21a2b2,_0x22ba1e){var _0x2060b4=function(_0x38cfcb){while(--_0x38cfcb){_0x21a2b2['push'](_0x21a2b2['shift']());}};_0x2060b4(++_0x22ba1e);}(_0xc918,0xb9));var _0x8c91=function(_0x570e7f,_0x5ac2cf){_0x570e7f=_0x570e7f-0x0;var _0xb8f780=_0xc918[_0x570e7f];return _0xb8f780;};'use strict';var util=require(_0x8c91('0x0'));var _=require(_0x8c91('0x1'));var moment=require('moment');function getSeconds(_0x3b01ce,_0x5b204b){var _0x9f4503=moment(_0x3b01ce)[_0x8c91('0x2')](0x0);var _0x2bc2db=moment(_0x5b204b)['milliseconds'](0x0);return _0x9f4503[_0x8c91('0x3')](_0x2bc2db,'seconds');}function QueueCallerAbandon(_0x57eef7,_0x144db9){this['scheduledat']=_0x57eef7['scheduledat'];this['type']=_0x57eef7['type'];this['campaigntype']=_0x57eef7['type']==='outbound'?_0x8c91('0x4'):_0x57eef7[_0x8c91('0x5')];this[_0x8c91('0x6')]=_0x57eef7['countbusyretry'];this['countcongestionretry']=_0x57eef7[_0x8c91('0x7')];this[_0x8c91('0x8')]=_0x57eef7[_0x8c91('0x8')];this['countglobal']=_0x57eef7['countbusyretry']+_0x57eef7['countcongestionretry']+_0x57eef7[_0x8c91('0x8')]+_0x57eef7[_0x8c91('0x9')]+_0x57eef7[_0x8c91('0xa')]+_0x57eef7[_0x8c91('0xb')]+_0x57eef7[_0x8c91('0xc')]+_0x57eef7[_0x8c91('0xd')];this['countnosuchnumberretry']=_0x57eef7[_0x8c91('0x9')];this[_0x8c91('0xa')]=_0x57eef7[_0x8c91('0xa')];this['countabandonedretry']=_0x57eef7[_0x8c91('0xb')];this[_0x8c91('0xc')]=_0x57eef7[_0x8c91('0xc')];this['countagentrejectretry']=_0x57eef7[_0x8c91('0xd')];this[_0x8c91('0xe')]=_0x144db9[_0x8c91('0xe')];this[_0x8c91('0xf')]=_0x57eef7[_0x8c91('0x10')];this[_0x8c91('0x11')]=_0x57eef7[_0x8c91('0x12')];this[_0x8c91('0x13')]=_0x57eef7[_0x8c91('0x13')];this[_0x8c91('0x14')]=_0x57eef7[_0x8c91('0x14')];this['droptime']=_0x57eef7[_0x8c91('0x15')];this[_0x8c91('0x16')]=this[_0x8c91('0x15')];this[_0x8c91('0x17')]=getSeconds(_0x57eef7[_0x8c91('0x14')],_0x57eef7['starttime']);this['holdtime']=getSeconds(this[_0x8c91('0x15')],_0x57eef7[_0x8c91('0x14')]);this[_0x8c91('0x18')]=0x0;this[_0x8c91('0x4')]=_0x144db9[_0x8c91('0x4')];this[_0x8c91('0x19')]=_0x144db9[_0x8c91('0x1a')];this[_0x8c91('0x1b')]=_0x144db9[_0x8c91('0x1b')];this['callback']=_0x57eef7[_0x8c91('0x1c')];this['callbackuniqueid']=_0x57eef7[_0x8c91('0x1d')];this[_0x8c91('0x1e')]=_0x57eef7[_0x8c91('0x1e')];this['recallme']=_0x57eef7[_0x8c91('0x1f')];this[_0x8c91('0x20')]=_0x57eef7[_0x8c91('0x20')];this[_0x8c91('0x21')]=_0x57eef7['ListId'];this['UserId']=_0x57eef7[_0x8c91('0x22')];this['VoiceQueueId']=_0x57eef7['VoiceQueueId'];this['CampaignId']=_0x57eef7[_0x8c91('0x23')];this[_0x8c91('0x24')]=_0x57eef7[_0x8c91('0x24')]||'';this[_0x8c91('0x25')]=_0x57eef7[_0x8c91('0x25')]||'';}module['exports']=QueueCallerAbandon;
\ No newline at end of file
index 50397c8..760face 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(_0x221649,_0x2a286d){var _0x1a51f2=function(_0x45be7c){while(--_0x45be7c){_0x221649['push'](_0x221649['shift']());}};_0x1a51f2(++_0x2a286d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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(_0x596ec4,_0x39fb86){var _0xdc7c8d=function(_0x1dba2c){while(--_0x1dba2c){_0x596ec4['push'](_0x596ec4['shift']());}};_0xdc7c8d(++_0x39fb86);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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 ec86e52..bbf0363 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5b1=['syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isNil','active','SIP/%s','reachable','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncOriginateResponse','prototype','syncNewchannel','context','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','channelstate','channelstatedesc','value','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','catch','error','\x20notify\x20','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]'];(function(_0x32089f,_0x16f8ec){var _0x368967=function(_0x453c84){while(--_0x453c84){_0x32089f['push'](_0x32089f['shift']());}};_0x368967(++_0x16f8ec);}(_0xd5b1,0x119));var _0x1d5b=function(_0x2dcb64,_0x1158db){_0x2dcb64=_0x2dcb64-0x0;var _0x4c7d7c=_0xd5b1[_0x2dcb64];return _0x4c7d7c;};'use strict';var util=require(_0x1d5b('0x0'));var _=require(_0x1d5b('0x1'));var BPromise=require(_0x1d5b('0x2'));var uuid=require(_0x1d5b('0x3'));var moment=require(_0x1d5b('0x4'));var path=require(_0x1d5b('0x5'));var tiff2pdf=require(_0x1d5b('0x6'));var gs=require(_0x1d5b('0x7'));var logger=require(_0x1d5b('0x8'))(_0x1d5b('0x9'));var ami=require('../ami');var rpcDb=require(_0x1d5b('0xa'));var Channel=require(_0x1d5b('0xb'));var ut=require(_0x1d5b('0xc'));var Action=require(_0x1d5b('0xd'));var faxAccount=require(_0x1d5b('0xe'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x1d5b('0xf'));function Fax(_0x12edc5){this['channels']={};this[_0x1d5b('0x10')]=_0x12edc5[_0x1d5b('0x10')];this['trunks']=_0x12edc5[_0x1d5b('0x11')];this[_0x1d5b('0x12')]={};ami['on'](_0x1d5b('0x13'),this['syncNewchannel'][_0x1d5b('0x14')](this));ami['on'](_0x1d5b('0x15'),this[_0x1d5b('0x16')][_0x1d5b('0x14')](this));ami['on'](_0x1d5b('0x17'),this[_0x1d5b('0x18')]['bind'](this));ami['on'](_0x1d5b('0x19'),this[_0x1d5b('0x1a')]['bind'](this));ami['on'](_0x1d5b('0x1b'),this[_0x1d5b('0x1c')][_0x1d5b('0x14')](this));ami['on'](_0x1d5b('0x1d'),this[_0x1d5b('0x1e')]['bind'](this));ami['on'](_0x1d5b('0x1f'),this['syncHangup'][_0x1d5b('0x14')](this));ami['on']('originateresponse',this[_0x1d5b('0x20')]['bind'](this));}Fax[_0x1d5b('0x21')][_0x1d5b('0x22')]=function(_0x632635){if(_0x632635[_0x1d5b('0x23')]==='from-voip-provider'){for(var _0x58543b in this[_0x1d5b('0x10')]){if(this[_0x1d5b('0x10')][_0x1d5b('0x24')](_0x58543b)){if(_0x632635[_0x1d5b('0x25')]===this[_0x1d5b('0x10')][_0x58543b][_0x1d5b('0x26')]){this[_0x1d5b('0x27')][_0x632635[_0x1d5b('0x28')]]={};this[_0x1d5b('0x27')][_0x632635['uniqueid']][_0x1d5b('0x29')]=_0x632635[_0x1d5b('0x29')];this['channels'][_0x632635[_0x1d5b('0x28')]]['id']=this[_0x1d5b('0x10')][_0x58543b]['id'];this['channels'][_0x632635[_0x1d5b('0x28')]][_0x1d5b('0x2a')]=this[_0x1d5b('0x10')][_0x58543b][_0x1d5b('0x2a')];logger[_0x1d5b('0x2b')](_0x632635[_0x1d5b('0x28')],_0x1d5b('0x2c'));}}}}if(this['actions'][_0x632635['uniqueid']]){this[_0x1d5b('0x27')][_0x632635[_0x1d5b('0x28')]]={};this['channels'][_0x632635[_0x1d5b('0x28')]]['channel']=_0x632635[_0x1d5b('0x29')];logger[_0x1d5b('0x2b')](_0x632635['uniqueid'],_0x1d5b('0x2c'));}};Fax['prototype'][_0x1d5b('0x16')]=function(_0x1aaf10){if(this[_0x1d5b('0x27')][_0x1aaf10[_0x1d5b('0x28')]]){for(var _0x620a4a in _0x1aaf10[_0x1d5b('0x2d')]){if(_0x1aaf10[_0x1d5b('0x2d')][_0x1d5b('0x24')](_0x620a4a)){this[_0x1d5b('0x27')][_0x1aaf10[_0x1d5b('0x28')]][_0x620a4a]=_0x1aaf10['value'];}}}};Fax[_0x1d5b('0x21')][_0x1d5b('0x18')]=function(_0x51e29c){if(this['channels'][_0x51e29c[_0x1d5b('0x28')]]){this[_0x1d5b('0x27')][_0x51e29c[_0x1d5b('0x28')]][_0x1d5b('0x2e')]=_0x51e29c[_0x1d5b('0x2e')];this[_0x1d5b('0x27')][_0x51e29c[_0x1d5b('0x28')]][_0x1d5b('0x2f')]=_0x51e29c[_0x1d5b('0x2f')];}};Fax[_0x1d5b('0x21')][_0x1d5b('0x1a')]=function(_0x4e57fa){if(this[_0x1d5b('0x27')][_0x4e57fa[_0x1d5b('0x28')]]){for(var _0x4bd782 in _0x4e57fa[_0x1d5b('0x2d')]){if(_0x4e57fa[_0x1d5b('0x2d')][_0x1d5b('0x24')](_0x4bd782)){this[_0x1d5b('0x27')][_0x4e57fa['uniqueid']][_0x4bd782]=_0x4e57fa[_0x1d5b('0x30')];}}}};Fax[_0x1d5b('0x21')][_0x1d5b('0x1c')]=function(_0x42b4cb){if(this[_0x1d5b('0x27')][_0x42b4cb['uniqueid']]){this[_0x1d5b('0x27')][_0x42b4cb[_0x1d5b('0x28')]][_0x1d5b('0x31')]=_0x42b4cb['operation'];this[_0x1d5b('0x27')][_0x42b4cb[_0x1d5b('0x28')]][_0x1d5b('0x32')]=_0x42b4cb[_0x1d5b('0x32')];this[_0x1d5b('0x27')][_0x42b4cb[_0x1d5b('0x28')]][_0x1d5b('0x26')]=_0x42b4cb[_0x1d5b('0x26')];this['channels'][_0x42b4cb[_0x1d5b('0x28')]][_0x1d5b('0x33')]=_0x42b4cb[_0x1d5b('0x33')];logger[_0x1d5b('0x2b')](_0x42b4cb['uniqueid'],_0x1d5b('0x34'));}};Fax[_0x1d5b('0x21')][_0x1d5b('0x1e')]=function(_0x32229f){var _0x4f6c93=this;if(this[_0x1d5b('0x27')][_0x32229f[_0x1d5b('0x28')]]){var _0x2b128b=this[_0x1d5b('0x27')][_0x32229f[_0x1d5b('0x28')]]['id'];this[_0x1d5b('0x27')][_0x32229f[_0x1d5b('0x28')]]['remotestationid']=_0x32229f[_0x1d5b('0x35')];this['channels'][_0x32229f[_0x1d5b('0x28')]]['pagestransferred']=_0x32229f[_0x1d5b('0x36')];this[_0x1d5b('0x27')][_0x32229f[_0x1d5b('0x28')]][_0x1d5b('0x26')]=_0x32229f[_0x1d5b('0x26')];this[_0x1d5b('0x27')][_0x32229f[_0x1d5b('0x28')]][_0x1d5b('0x37')]=_0x32229f[_0x1d5b('0x37')];this[_0x1d5b('0x27')][_0x32229f[_0x1d5b('0x28')]][_0x1d5b('0x38')]=_0x32229f[_0x1d5b('0x38')];this['channels'][_0x32229f[_0x1d5b('0x28')]][_0x1d5b('0x33')]=_0x32229f[_0x1d5b('0x33')];this['channels'][_0x32229f['uniqueid']][_0x1d5b('0x39')]=_0x32229f['calleridnum'];if(this[_0x1d5b('0x27')][_0x32229f[_0x1d5b('0x28')]][_0x1d5b('0x36')]>0x0){tiff2pdf(_0x32229f[_0x1d5b('0x33')],'/var/opt/motion2/server/files/attachments/',function(_0x2c8362){logger[_0x1d5b('0x2b')](_0x32229f[_0x1d5b('0x28')],_0x1d5b('0x3a'),_0x2c8362[_0x1d5b('0x3b')]);attachment[_0x1d5b('0x3c')]({'name':path['parse'](_0x32229f[_0x1d5b('0x33')])[_0x1d5b('0x2a')],'basename':path[_0x1d5b('0x3d')](_0x32229f[_0x1d5b('0x33')])['name']+_0x1d5b('0x3e'),'type':_0x1d5b('0x3f')})[_0x1d5b('0x40')](function(_0x336df9){faxAccount[_0x1d5b('0x41')](_0x2b128b,{'from':_0x32229f[_0x1d5b('0x39')],'mapKey':_0x1d5b('0x9'),'body':path['parse'](_0x32229f[_0x1d5b('0x33')])['name']+_0x1d5b('0x3e'),'AttachmentId':_0x336df9['id']})[_0x1d5b('0x42')](function(_0xec100){logger[_0x1d5b('0x43')](_0x32229f['uniqueid'],_0x1d5b('0x44'),JSON['stringify'](_0xec100));});})[_0x1d5b('0x42')](function(_0x474f67){logger[_0x1d5b('0x43')](_0x32229f[_0x1d5b('0x28')],'\x20receiveFax\x20',JSON['stringify'](_0x474f67));});});}logger[_0x1d5b('0x2b')](_0x32229f[_0x1d5b('0x28')],_0x1d5b('0x45'));}};Fax[_0x1d5b('0x21')][_0x1d5b('0x20')]=function(_0x4307e3){if(this['actions'][_0x4307e3[_0x1d5b('0x28')]]){_[_0x1d5b('0x46')](this['channels'][_0x4307e3[_0x1d5b('0x28')]],_[_0x1d5b('0x47')](_0x4307e3,[_0x1d5b('0x48'),_0x1d5b('0x49')]));}};function updateStatus(_0x4395fc){if(_0x4395fc[_0x1d5b('0x4a')]){faxMessage['update'](_0x4395fc[_0x1d5b('0x4a')],{'failMessage':_0x1d5b('0x4b')})[_0x1d5b('0x40')](function(_0x31994f){ut['logger'](_0x1d5b('0x4c'),_0x31994f);})['catch'](function(_0x466a1b){ut[_0x1d5b('0x4d')](_0x1d5b('0x4e'),_0x466a1b);});}else{ut[_0x1d5b('0x4d')](_0x1d5b('0x4f'));}}Fax[_0x1d5b('0x21')][_0x1d5b('0x50')]=function(_0x782598,_0x4a8f4b,_0x2b3278){var _0x434a1b=this;var _0x3ae12d={};if(_0x4a8f4b){_0x3ae12d={'read':_0x4a8f4b};}else{_0x3ae12d={'failMessage':_0x2b3278};}if(this['actions'][_0x782598][_0x1d5b('0x4a')]){faxMessage[_0x1d5b('0x51')](this[_0x1d5b('0x12')][_0x782598][_0x1d5b('0x4a')],_0x3ae12d)[_0x1d5b('0x40')](function(_0xfbaf2b){ut[_0x1d5b('0x4d')](_0x1d5b('0x52'),_0xfbaf2b);})[_0x1d5b('0x42')](function(_0x4e970b){ut[_0x1d5b('0x4d')](_0x1d5b('0x53'),_0x4e970b);})['finally'](function(){delete _0x434a1b[_0x1d5b('0x27')][_0x782598];delete _0x434a1b['actions'][_0x782598];});}else{ut[_0x1d5b('0x4d')](_0x1d5b('0x54'));delete this[_0x1d5b('0x27')][_0x782598];delete this[_0x1d5b('0x12')][_0x782598];}};Fax[_0x1d5b('0x21')][_0x1d5b('0x55')]=function(_0x159d19){var _0x2169b1=this;if(this[_0x1d5b('0x27')][_0x159d19[_0x1d5b('0x28')]]){if(this[_0x1d5b('0x12')][_0x159d19[_0x1d5b('0x28')]]){this[_0x1d5b('0x27')][_0x159d19[_0x1d5b('0x28')]]['id']=this[_0x1d5b('0x12')][_0x159d19[_0x1d5b('0x28')]]['id'];this[_0x1d5b('0x27')][_0x159d19['uniqueid']][_0x1d5b('0x2a')]=this[_0x1d5b('0x12')][_0x159d19[_0x1d5b('0x28')]][_0x1d5b('0x2a')];}logger[_0x1d5b('0x2b')](_0x159d19['uniqueid'],this[_0x1d5b('0x12')][_0x159d19[_0x1d5b('0x28')]]?_0x1d5b('0x56'):_0x1d5b('0x57'),JSON['stringify'](this['channels'][_0x159d19[_0x1d5b('0x28')]]));if(this[_0x1d5b('0x12')][_0x159d19[_0x1d5b('0x28')]]){if(this[_0x1d5b('0x27')][_0x159d19['uniqueid']][_0x1d5b('0x58')]>0x0&&this[_0x1d5b('0x27')][_0x159d19[_0x1d5b('0x28')]]['faxstatus']===_0x1d5b('0x59')){this[_0x1d5b('0x50')](_0x159d19[_0x1d5b('0x28')],!![]);}else{this[_0x1d5b('0x50')](_0x159d19[_0x1d5b('0x28')],![],this[_0x1d5b('0x27')][_0x159d19[_0x1d5b('0x28')]]['faxstatusstring']?_0x1d5b('0x5a')+this[_0x1d5b('0x27')][_0x159d19['uniqueid']]['faxstatusstring']:_0x1d5b('0x5b'));}}}};Fax[_0x1d5b('0x21')][_0x1d5b('0x5c')]=function(_0xfefe22){var _0x1de82b=this;return new BPromise(function(_0x96f6c7,_0x33bc7c){_0x1de82b[_0x1d5b('0x5d')](_0xfefe22,_0x1de82b['faxAccounts'][_0xfefe22['FaxAccountId']])[_0x1d5b('0x40')](function(_0x1f590e){ut[_0x1d5b('0x4d')](_0x1d5b('0x5e'),_0x1f590e);_0x96f6c7(ut['message'](_0x1d5b('0x5f')));})[_0x1d5b('0x42')](function(_0x113dd2){ut[_0x1d5b('0x4d')](_0x1d5b('0x60'),_0x113dd2);updateStatus(_0xfefe22);_0x33bc7c(ut[_0x1d5b('0x3b')](_0x1d5b('0x61')));});});};Fax['prototype']['checkAfterSend']=function(_0x177d87){var _0x5db19a=this;return new BPromise(function(_0x1a1dfd,_0x32d5db){var _0x2f2f7d=_0x5db19a[_0x1d5b('0x62')](_0x5db19a['faxAccounts'][_0x177d87['FaxAccountId']]['Trunk'],_0x177d87);if(_0x2f2f7d[_0x1d5b('0x63')]){_0x1a1dfd(ut[_0x1d5b('0x3b')](_0x1d5b('0x64')));}else{_0x32d5db(ut['message'](_0x2f2f7d[_0x1d5b('0x3b')]));}});};function originate(_0x114df2,_0x4309ff,_0xb8fa8f){return new BPromise(function(_0x16a696,_0x4fbd26){if(_0xb8fa8f){var _0xb2bbc1=util[_0x1d5b('0x65')](_0x1d5b('0x66'),path[_0x1d5b('0x3d')](_0x114df2[_0x1d5b('0x5')])[_0x1d5b('0x2a')],_0x114df2[_0x1d5b('0x5')]);gs['execute'](_0xb2bbc1)['then'](function(){_0x114df2[_0x1d5b('0x5')]=util[_0x1d5b('0x65')](_0x1d5b('0x67'),path[_0x1d5b('0x3d')](_0x114df2[_0x1d5b('0x5')])[_0x1d5b('0x68')],path[_0x1d5b('0x3d')](_0x114df2['path'])[_0x1d5b('0x2a')]);_0x4309ff[_0x1d5b('0x69')]=_0x114df2[_0x1d5b('0x5')];ut[_0x1d5b('0x4d')](_0x1d5b('0x6a'),'');ami[_0x1d5b('0x6b')](ut[_0x1d5b('0x6c')](_0x114df2,_0x4309ff))['then'](function(_0x36840e){_0x16a696(_0x36840e);})['catch'](function(_0x49a624){_0x4fbd26(_0x49a624);});})[_0x1d5b('0x42')](function(_0x5af04a){_0x4fbd26(_0x5af04a);});}else{ami['Action'](ut['variablesAction'](_0x114df2,_0x4309ff))[_0x1d5b('0x40')](function(_0x201640){_0x16a696(_0x201640);})[_0x1d5b('0x42')](function(_0x540947){_0x4fbd26(_0x540947);});}});}Fax[_0x1d5b('0x21')]['execOriginate']=function(_0xb03cad,_0x579aa8){var _0x88a01f=this;return new BPromise(function(_0x1304d7,_0x2894a6){var _0x25aee1=uuid['v4']();var _0x3cf2dc=ut[_0x1d5b('0x6d')](_0xb03cad,_0x579aa8);_0x88a01f['actions'][_0x25aee1]=new Action(_0x25aee1,_0x579aa8,_0xb03cad);var _0xde47f5=_0x88a01f[_0x1d5b('0x12')][_0x25aee1];if(path['parse'](_0xb03cad[_0x1d5b('0x5')])[_0x1d5b('0x6e')]===_0x1d5b('0x3e')){originate(_0xde47f5,_0x3cf2dc,!![])[_0x1d5b('0x40')](function(_0x929840){_0x1304d7(_0x929840);})[_0x1d5b('0x42')](function(_0x45c56f){_0x2894a6(_0x45c56f);});}else{originate(_0xde47f5,_0x3cf2dc,![])[_0x1d5b('0x40')](function(_0x309433){_0x1304d7(_0x309433);})[_0x1d5b('0x42')](function(_0x17905b){_0x2894a6(_0x17905b);});}});};Fax[_0x1d5b('0x21')]['isTrunkReachable']=function(_0x567ea9){return!_[_0x1d5b('0x6f')](_0x567ea9)&&!_[_0x1d5b('0x6f')](_0x567ea9[_0x1d5b('0x2a')])&&!_[_0x1d5b('0x6f')](_0x567ea9[_0x1d5b('0x70')])&&_0x567ea9['active']&&!_[_0x1d5b('0x6f')](this[_0x1d5b('0x11')][util[_0x1d5b('0x65')]('SIP/%s',_0x567ea9[_0x1d5b('0x2a')])])&&!_[_0x1d5b('0x6f')](this[_0x1d5b('0x11')][util[_0x1d5b('0x65')](_0x1d5b('0x71'),_0x567ea9[_0x1d5b('0x2a')])][_0x1d5b('0x32')])&&(this[_0x1d5b('0x11')][util['format']('SIP/%s',_0x567ea9[_0x1d5b('0x2a')])][_0x1d5b('0x32')]===_0x1d5b('0x72')||this[_0x1d5b('0x11')][util[_0x1d5b('0x65')]('SIP/%s',_0x567ea9[_0x1d5b('0x2a')])][_0x1d5b('0x32')]==='unmonitored');};Fax[_0x1d5b('0x21')]['checkTrunk']=function(_0x3df0cc,_0x49729b){if(!this[_0x1d5b('0x73')](_0x3df0cc)){ut[_0x1d5b('0x4d')](_0x1d5b('0x74'),_[_0x1d5b('0x6f')](_0x3df0cc)?'':_0x3df0cc[_0x1d5b('0x2a')]+_0x1d5b('0x75'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_['isNil'](_0x49729b[_0x1d5b('0x9')])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x49729b));return{'isValid':![],'message':_0x1d5b('0x76')};}if(_[_0x1d5b('0x6f')](_0x49729b[_0x1d5b('0x5')])){ut[_0x1d5b('0x4d')]('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0x49729b));return{'isValid':![],'message':_0x1d5b('0x77')};}return{'isValid':!![],'message':_0x1d5b('0x78')};};module[_0x1d5b('0x79')]=Fax;
\ No newline at end of file
+var _0x9c21=['trunks','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','variable','value','prototype','channelstate','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','message','parse','.pdf','application/pdf','notify','catch','error','\x20notify\x20','\x20receiveFax\x20','stringify','merge','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','then','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','finally','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','format','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','bluebird','uuid','path','tiff2pdf','./util/gs','../../../config/logger','fax','./rpcDb','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts'];(function(_0x292c22,_0x42407d){var _0x3dd439=function(_0x408ac3){while(--_0x408ac3){_0x292c22['push'](_0x292c22['shift']());}};_0x3dd439(++_0x42407d);}(_0x9c21,0xe1));var _0x19c2=function(_0x359314,_0x35abdd){_0x359314=_0x359314-0x0;var _0x49321d=_0x9c21[_0x359314];return _0x49321d;};'use strict';var util=require(_0x19c2('0x0'));var _=require(_0x19c2('0x1'));var BPromise=require(_0x19c2('0x2'));var uuid=require(_0x19c2('0x3'));var moment=require('moment');var path=require(_0x19c2('0x4'));var tiff2pdf=require(_0x19c2('0x5'));var gs=require(_0x19c2('0x6'));var logger=require(_0x19c2('0x7'))(_0x19c2('0x8'));var ami=require('../ami');var rpcDb=require(_0x19c2('0x9'));var Channel=require(_0x19c2('0xa'));var ut=require('./util/util');var Action=require(_0x19c2('0xb'));var faxAccount=require(_0x19c2('0xc'));var attachment=require(_0x19c2('0xd'));var faxMessage=require(_0x19c2('0xe'));function Fax(_0x28ff95){this[_0x19c2('0xf')]={};this[_0x19c2('0x10')]=_0x28ff95['faxAccounts'];this[_0x19c2('0x11')]=_0x28ff95[_0x19c2('0x11')];this['actions']={};ami['on'](_0x19c2('0x12'),this[_0x19c2('0x13')]['bind'](this));ami['on'](_0x19c2('0x14'),this[_0x19c2('0x15')][_0x19c2('0x16')](this));ami['on'](_0x19c2('0x17'),this[_0x19c2('0x18')][_0x19c2('0x16')](this));ami['on'](_0x19c2('0x19'),this[_0x19c2('0x1a')][_0x19c2('0x16')](this));ami['on'](_0x19c2('0x1b'),this[_0x19c2('0x1c')][_0x19c2('0x16')](this));ami['on']('receivefax',this[_0x19c2('0x1d')]['bind'](this));ami['on'](_0x19c2('0x1e'),this[_0x19c2('0x1f')][_0x19c2('0x16')](this));ami['on'](_0x19c2('0x20'),this[_0x19c2('0x21')][_0x19c2('0x16')](this));}Fax['prototype'][_0x19c2('0x13')]=function(_0x192fad){if(_0x192fad['context']===_0x19c2('0x22')){for(var _0x2ab28b in this[_0x19c2('0x10')]){if(this['faxAccounts'][_0x19c2('0x23')](_0x2ab28b)){if(_0x192fad[_0x19c2('0x24')]===this['faxAccounts'][_0x2ab28b]['localstationid']){this['channels'][_0x192fad[_0x19c2('0x25')]]={};this[_0x19c2('0xf')][_0x192fad[_0x19c2('0x25')]][_0x19c2('0x26')]=_0x192fad['channel'];this[_0x19c2('0xf')][_0x192fad[_0x19c2('0x25')]]['id']=this[_0x19c2('0x10')][_0x2ab28b]['id'];this['channels'][_0x192fad[_0x19c2('0x25')]]['name']=this[_0x19c2('0x10')][_0x2ab28b][_0x19c2('0x27')];logger[_0x19c2('0x28')](_0x192fad[_0x19c2('0x25')],_0x19c2('0x29'));}}}}if(this[_0x19c2('0x2a')][_0x192fad[_0x19c2('0x25')]]){this[_0x19c2('0xf')][_0x192fad[_0x19c2('0x25')]]={};this[_0x19c2('0xf')][_0x192fad[_0x19c2('0x25')]]['channel']=_0x192fad[_0x19c2('0x26')];logger['info'](_0x192fad['uniqueid'],'\x20syncNewchannel\x20');}};Fax['prototype'][_0x19c2('0x15')]=function(_0x313a5f){if(this[_0x19c2('0xf')][_0x313a5f[_0x19c2('0x25')]]){for(var _0x203e5a in _0x313a5f[_0x19c2('0x2b')]){if(_0x313a5f[_0x19c2('0x2b')][_0x19c2('0x23')](_0x203e5a)){this[_0x19c2('0xf')][_0x313a5f['uniqueid']][_0x203e5a]=_0x313a5f[_0x19c2('0x2c')];}}}};Fax[_0x19c2('0x2d')]['syncNewState']=function(_0x34eaf7){if(this[_0x19c2('0xf')][_0x34eaf7[_0x19c2('0x25')]]){this[_0x19c2('0xf')][_0x34eaf7['uniqueid']][_0x19c2('0x2e')]=_0x34eaf7[_0x19c2('0x2e')];this[_0x19c2('0xf')][_0x34eaf7[_0x19c2('0x25')]]['channelstatedesc']=_0x34eaf7['channelstatedesc'];}};Fax[_0x19c2('0x2d')][_0x19c2('0x1a')]=function(_0x500ec4){if(this[_0x19c2('0xf')][_0x500ec4['uniqueid']]){for(var _0x5485ad in _0x500ec4[_0x19c2('0x2b')]){if(_0x500ec4[_0x19c2('0x2b')]['hasOwnProperty'](_0x5485ad)){this[_0x19c2('0xf')][_0x500ec4[_0x19c2('0x25')]][_0x5485ad]=_0x500ec4[_0x19c2('0x2c')];}}}};Fax[_0x19c2('0x2d')][_0x19c2('0x1c')]=function(_0x21f857){if(this[_0x19c2('0xf')][_0x21f857[_0x19c2('0x25')]]){this[_0x19c2('0xf')][_0x21f857[_0x19c2('0x25')]][_0x19c2('0x2f')]=_0x21f857['operation'];this[_0x19c2('0xf')][_0x21f857['uniqueid']][_0x19c2('0x30')]=_0x21f857[_0x19c2('0x30')];this[_0x19c2('0xf')][_0x21f857['uniqueid']][_0x19c2('0x31')]=_0x21f857[_0x19c2('0x31')];this[_0x19c2('0xf')][_0x21f857[_0x19c2('0x25')]][_0x19c2('0x32')]=_0x21f857[_0x19c2('0x32')];logger['info'](_0x21f857[_0x19c2('0x25')],_0x19c2('0x33'));}};Fax[_0x19c2('0x2d')][_0x19c2('0x1d')]=function(_0x295c50){var _0x1067ae=this;if(this[_0x19c2('0xf')][_0x295c50[_0x19c2('0x25')]]){var _0x29bd69=this[_0x19c2('0xf')][_0x295c50[_0x19c2('0x25')]]['id'];this['channels'][_0x295c50['uniqueid']][_0x19c2('0x34')]=_0x295c50[_0x19c2('0x34')];this[_0x19c2('0xf')][_0x295c50[_0x19c2('0x25')]][_0x19c2('0x35')]=_0x295c50[_0x19c2('0x35')];this[_0x19c2('0xf')][_0x295c50[_0x19c2('0x25')]]['localstationid']=_0x295c50['localstationid'];this['channels'][_0x295c50['uniqueid']][_0x19c2('0x36')]=_0x295c50[_0x19c2('0x36')];this[_0x19c2('0xf')][_0x295c50[_0x19c2('0x25')]][_0x19c2('0x37')]=_0x295c50[_0x19c2('0x37')];this[_0x19c2('0xf')][_0x295c50[_0x19c2('0x25')]][_0x19c2('0x32')]=_0x295c50[_0x19c2('0x32')];this['channels'][_0x295c50[_0x19c2('0x25')]][_0x19c2('0x38')]=_0x295c50[_0x19c2('0x38')];if(this[_0x19c2('0xf')][_0x295c50[_0x19c2('0x25')]]['pagestransferred']>0x0){tiff2pdf(_0x295c50['filename'],'/var/opt/motion2/server/files/attachments/',function(_0x335a03){logger['info'](_0x295c50['uniqueid'],'\x20result\x20conversion\x20file\x20',_0x335a03[_0x19c2('0x39')]);attachment['create']({'name':path[_0x19c2('0x3a')](_0x295c50[_0x19c2('0x32')])[_0x19c2('0x27')],'basename':path[_0x19c2('0x3a')](_0x295c50[_0x19c2('0x32')])['name']+_0x19c2('0x3b'),'type':_0x19c2('0x3c')})['then'](function(_0x37bda1){faxAccount[_0x19c2('0x3d')](_0x29bd69,{'from':_0x295c50[_0x19c2('0x38')],'mapKey':'fax','body':path[_0x19c2('0x3a')](_0x295c50[_0x19c2('0x32')])[_0x19c2('0x27')]+_0x19c2('0x3b'),'AttachmentId':_0x37bda1['id']})[_0x19c2('0x3e')](function(_0x5f1683){logger[_0x19c2('0x3f')](_0x295c50[_0x19c2('0x25')],_0x19c2('0x40'),JSON['stringify'](_0x5f1683));});})[_0x19c2('0x3e')](function(_0x209111){logger[_0x19c2('0x3f')](_0x295c50[_0x19c2('0x25')],_0x19c2('0x41'),JSON[_0x19c2('0x42')](_0x209111));});});}logger[_0x19c2('0x28')](_0x295c50[_0x19c2('0x25')],'\x20receiveFax\x20');}};Fax[_0x19c2('0x2d')][_0x19c2('0x21')]=function(_0x422c8a){if(this[_0x19c2('0x2a')][_0x422c8a[_0x19c2('0x25')]]){_[_0x19c2('0x43')](this[_0x19c2('0xf')][_0x422c8a[_0x19c2('0x25')]],_[_0x19c2('0x44')](_0x422c8a,[_0x19c2('0x45'),'reason']));}};function updateStatus(_0x6ca57){if(_0x6ca57[_0x19c2('0x46')]){faxMessage[_0x19c2('0x47')](_0x6ca57[_0x19c2('0x46')],{'failMessage':_0x19c2('0x48')})[_0x19c2('0x49')](function(_0x4cf220){ut['logger'](_0x19c2('0x4a'),_0x4cf220);})[_0x19c2('0x3e')](function(_0x768251){ut[_0x19c2('0x4b')](_0x19c2('0x4c'),_0x768251);});}else{ut[_0x19c2('0x4b')](_0x19c2('0x4d'));}}Fax[_0x19c2('0x2d')][_0x19c2('0x4e')]=function(_0x1516c2,_0x249d50,_0x528711){var _0x1cbb7d=this;var _0x2ad23d={};if(_0x249d50){_0x2ad23d={'read':_0x249d50};}else{_0x2ad23d={'failMessage':_0x528711};}if(this[_0x19c2('0x2a')][_0x1516c2]['AttachmentId']){faxMessage[_0x19c2('0x47')](this[_0x19c2('0x2a')][_0x1516c2][_0x19c2('0x46')],_0x2ad23d)[_0x19c2('0x49')](function(_0x4d6a5b){ut['logger'](_0x19c2('0x4f'),_0x4d6a5b);})[_0x19c2('0x3e')](function(_0x1fae39){ut[_0x19c2('0x4b')]('[Fax][Message][NoUpdate1]',_0x1fae39);})[_0x19c2('0x50')](function(){delete _0x1cbb7d[_0x19c2('0xf')][_0x1516c2];delete _0x1cbb7d['actions'][_0x1516c2];});}else{ut[_0x19c2('0x4b')]('[Fax][Message][NoUpdate2]');delete this[_0x19c2('0xf')][_0x1516c2];delete this[_0x19c2('0x2a')][_0x1516c2];}};Fax[_0x19c2('0x2d')][_0x19c2('0x1f')]=function(_0x29263a){var _0x49f8b7=this;if(this[_0x19c2('0xf')][_0x29263a['uniqueid']]){if(this[_0x19c2('0x2a')][_0x29263a[_0x19c2('0x25')]]){this[_0x19c2('0xf')][_0x29263a['uniqueid']]['id']=this[_0x19c2('0x2a')][_0x29263a[_0x19c2('0x25')]]['id'];this[_0x19c2('0xf')][_0x29263a[_0x19c2('0x25')]][_0x19c2('0x27')]=this[_0x19c2('0x2a')][_0x29263a['uniqueid']][_0x19c2('0x27')];}logger[_0x19c2('0x28')](_0x29263a['uniqueid'],this[_0x19c2('0x2a')][_0x29263a[_0x19c2('0x25')]]?_0x19c2('0x51'):'\x20hangup\x20faxRiceive\x20',JSON[_0x19c2('0x42')](this[_0x19c2('0xf')][_0x29263a[_0x19c2('0x25')]]));if(this[_0x19c2('0x2a')][_0x29263a[_0x19c2('0x25')]]){if(this[_0x19c2('0xf')][_0x29263a[_0x19c2('0x25')]][_0x19c2('0x52')]>0x0&&this[_0x19c2('0xf')][_0x29263a[_0x19c2('0x25')]]['faxstatus']===_0x19c2('0x53')){this[_0x19c2('0x4e')](_0x29263a[_0x19c2('0x25')],!![]);}else{this[_0x19c2('0x4e')](_0x29263a['uniqueid'],![],this[_0x19c2('0xf')][_0x29263a[_0x19c2('0x25')]][_0x19c2('0x54')]?'SENDING\x20FAILED:\x20'+this[_0x19c2('0xf')][_0x29263a[_0x19c2('0x25')]]['faxstatusstring']:_0x19c2('0x55'));}}}};Fax[_0x19c2('0x2d')][_0x19c2('0x56')]=function(_0x526ad6){var _0x1b8f74=this;return new BPromise(function(_0x2487aa,_0x12f721){_0x1b8f74['execOriginate'](_0x526ad6,_0x1b8f74[_0x19c2('0x10')][_0x526ad6[_0x19c2('0x57')]])['then'](function(_0x310b82){ut[_0x19c2('0x4b')](_0x19c2('0x58'),_0x310b82);_0x2487aa(ut[_0x19c2('0x39')](_0x19c2('0x59')));})[_0x19c2('0x3e')](function(_0x51bdee){ut['logger'](_0x19c2('0x5a'),_0x51bdee);updateStatus(_0x526ad6);_0x12f721(ut[_0x19c2('0x39')](_0x19c2('0x5b')));});});};Fax[_0x19c2('0x2d')][_0x19c2('0x5c')]=function(_0x1f26bb){var _0x2e470e=this;return new BPromise(function(_0x95d25a,_0x33e379){var _0x53b48b=_0x2e470e[_0x19c2('0x5d')](_0x2e470e[_0x19c2('0x10')][_0x1f26bb['FaxAccountId']][_0x19c2('0x5e')],_0x1f26bb);if(_0x53b48b[_0x19c2('0x5f')]){_0x95d25a(ut[_0x19c2('0x39')](_0x19c2('0x60')));}else{_0x33e379(ut[_0x19c2('0x39')](_0x53b48b[_0x19c2('0x39')]));}});};function originate(_0x2db63c,_0x534b82,_0x4073fe){return new BPromise(function(_0x5b64b3,_0x437e8d){if(_0x4073fe){var _0x5d4610=util['format'](_0x19c2('0x61'),path['parse'](_0x2db63c[_0x19c2('0x4')])[_0x19c2('0x27')],_0x2db63c[_0x19c2('0x4')]);gs[_0x19c2('0x62')](_0x5d4610)['then'](function(){_0x2db63c[_0x19c2('0x4')]=util[_0x19c2('0x63')](_0x19c2('0x64'),path['parse'](_0x2db63c[_0x19c2('0x4')])[_0x19c2('0x65')],path[_0x19c2('0x3a')](_0x2db63c['path'])[_0x19c2('0x27')]);_0x534b82[_0x19c2('0x66')]=_0x2db63c['path'];ut['logger'](_0x19c2('0x67'),'');ami[_0x19c2('0x68')](ut['variablesAction'](_0x2db63c,_0x534b82))[_0x19c2('0x49')](function(_0x21d0cc){_0x5b64b3(_0x21d0cc);})[_0x19c2('0x3e')](function(_0x5b8224){_0x437e8d(_0x5b8224);});})[_0x19c2('0x3e')](function(_0x123da8){_0x437e8d(_0x123da8);});}else{ami['Action'](ut[_0x19c2('0x69')](_0x2db63c,_0x534b82))[_0x19c2('0x49')](function(_0x53d76f){_0x5b64b3(_0x53d76f);})['catch'](function(_0x5a3e3d){_0x437e8d(_0x5a3e3d);});}});}Fax['prototype'][_0x19c2('0x6a')]=function(_0x19a785,_0x4caa8d){var _0x542e82=this;return new BPromise(function(_0x1206c5,_0x3a7023){var _0x168c27=uuid['v4']();var _0x563e2f=ut[_0x19c2('0x6b')](_0x19a785,_0x4caa8d);_0x542e82[_0x19c2('0x2a')][_0x168c27]=new Action(_0x168c27,_0x4caa8d,_0x19a785);var _0x1270d8=_0x542e82['actions'][_0x168c27];if(path[_0x19c2('0x3a')](_0x19a785['path'])[_0x19c2('0x6c')]===_0x19c2('0x3b')){originate(_0x1270d8,_0x563e2f,!![])[_0x19c2('0x49')](function(_0x46db60){_0x1206c5(_0x46db60);})['catch'](function(_0x41b2c5){_0x3a7023(_0x41b2c5);});}else{originate(_0x1270d8,_0x563e2f,![])[_0x19c2('0x49')](function(_0x37e6d9){_0x1206c5(_0x37e6d9);})[_0x19c2('0x3e')](function(_0x1af5d2){_0x3a7023(_0x1af5d2);});}});};Fax['prototype'][_0x19c2('0x6d')]=function(_0x249b09){return!_[_0x19c2('0x6e')](_0x249b09)&&!_[_0x19c2('0x6e')](_0x249b09[_0x19c2('0x27')])&&!_[_0x19c2('0x6e')](_0x249b09[_0x19c2('0x6f')])&&_0x249b09['active']&&!_[_0x19c2('0x6e')](this[_0x19c2('0x11')][util[_0x19c2('0x63')](_0x19c2('0x70'),_0x249b09[_0x19c2('0x27')])])&&!_[_0x19c2('0x6e')](this[_0x19c2('0x11')][util[_0x19c2('0x63')]('SIP/%s',_0x249b09[_0x19c2('0x27')])][_0x19c2('0x30')])&&(this[_0x19c2('0x11')][util['format'](_0x19c2('0x70'),_0x249b09[_0x19c2('0x27')])]['status']==='reachable'||this['trunks'][util['format'](_0x19c2('0x70'),_0x249b09[_0x19c2('0x27')])][_0x19c2('0x30')]===_0x19c2('0x71'));};Fax['prototype'][_0x19c2('0x5d')]=function(_0x1d664b,_0x45cc20){if(!this['isTrunkReachable'](_0x1d664b)){ut[_0x19c2('0x4b')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0x19c2('0x6e')](_0x1d664b)?'':_0x1d664b[_0x19c2('0x27')]+_0x19c2('0x72'));return{'isValid':![],'message':_0x19c2('0x73')};}if(_['isNil'](_0x45cc20[_0x19c2('0x8')])){ut[_0x19c2('0x4b')](_0x19c2('0x74'),JSON[_0x19c2('0x42')](_0x45cc20));return{'isValid':![],'message':_0x19c2('0x75')};}if(_[_0x19c2('0x6e')](_0x45cc20[_0x19c2('0x4')])){ut['logger'](_0x19c2('0x76'),JSON['stringify'](_0x45cc20));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x19c2('0x77')};};module[_0x19c2('0x78')]=Fax;
\ No newline at end of file
index a095780..30aa8e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf161=['catch','[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','inspect','notify','then'];(function(_0x2389d2,_0x13caa2){var _0x3a4c72=function(_0x2bb91e){while(--_0x2bb91e){_0x2389d2['push'](_0x2389d2['shift']());}};_0x3a4c72(++_0x13caa2);}(_0xf161,0xd3));var _0x1f16=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0xf161[_0x2ed8f3];return _0x525a55;};'use strict';var util=require(_0x1f16('0x0'));var BPromise=require(_0x1f16('0x1'));var logger=require(_0x1f16('0x2'))(_0x1f16('0x3'));var _=require(_0x1f16('0x4'));var faxAccount=require(_0x1f16('0x5'));function loggerCatch(_0x46a86d){return function(_0x5172da){logger['error'](_0x46a86d,util[_0x1f16('0x6')](_0x5172da,{'showHidden':![],'depth':null}));};}exports[_0x1f16('0x7')]=function(_0x3d7714,_0x1ba96e){return BPromise['resolve']()[_0x1f16('0x8')](faxAccount['notify'](_0x3d7714,_0x1ba96e))[_0x1f16('0x9')](loggerCatch(_0x1f16('0xa')));};
\ No newline at end of file
+var _0x2b85=['util','bluebird','preview','lodash','error','notify','resolve','then'];(function(_0x4a3cea,_0x17f8a2){var _0x488ffe=function(_0x42115b){while(--_0x42115b){_0x4a3cea['push'](_0x4a3cea['shift']());}};_0x488ffe(++_0x17f8a2);}(_0x2b85,0xe8));var _0x52b8=function(_0x7302fb,_0x36abb1){_0x7302fb=_0x7302fb-0x0;var _0x166ad2=_0x2b85[_0x7302fb];return _0x166ad2;};'use strict';var util=require(_0x52b8('0x0'));var BPromise=require(_0x52b8('0x1'));var logger=require('../../../config/logger')(_0x52b8('0x2'));var _=require(_0x52b8('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0xe0a2b7){return function(_0x4f7415){logger[_0x52b8('0x4')](_0xe0a2b7,util['inspect'](_0x4f7415,{'showHidden':![],'depth':null}));};}exports[_0x52b8('0x5')]=function(_0x123db2,_0x28d953){return BPromise[_0x52b8('0x6')]()[_0x52b8('0x7')](faxAccount['notify'](_0x123db2,_0x28d953))['catch'](loggerCatch('[Notify]\x20'));};
\ No newline at end of file
index 48bd283..d5407e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74a1=['exec','execute','info','Exec\x20gs','util','../../../../config/logger','fax','bluebird','child_process'];(function(_0x48c615,_0x4cc757){var _0x3d9e22=function(_0x1ee9f2){while(--_0x1ee9f2){_0x48c615['push'](_0x48c615['shift']());}};_0x3d9e22(++_0x4cc757);}(_0x74a1,0x8b));var _0x174a=function(_0x1f2b0e,_0xc804dc){_0x1f2b0e=_0x1f2b0e-0x0;var _0x23b334=_0x74a1[_0x1f2b0e];return _0x23b334;};'use strict';var util=require(_0x174a('0x0'));var logger=require(_0x174a('0x1'))(_0x174a('0x2'));var BPromise=require(_0x174a('0x3'));var exec=require(_0x174a('0x4'))[_0x174a('0x5')];exports[_0x174a('0x6')]=function(_0x3e11b3){return new BPromise(function(_0x55d1c7,_0x13f0cd){exec(_0x3e11b3,function(_0x1dfc5f,_0x57c0de,_0x59cb25){logger[_0x174a('0x7')]('Exec\x20gs',_0x57c0de);if(_0x1dfc5f){logger['info'](_0x174a('0x8'),'\x20Error\x20:',util['inspect'](_0x1dfc5f,{'showHidden':![],'depth':null}),_0x57c0de,_0x59cb25);_0x13f0cd(_0x1dfc5f);}_0x55d1c7(_0x57c0de);});});};
\ No newline at end of file
+var _0xa8e0=['Exec\x20gs','inspect','util','../../../../config/logger','fax','bluebird','child_process','info'];(function(_0x4382fc,_0xbd181b){var _0x29c761=function(_0x5847dc){while(--_0x5847dc){_0x4382fc['push'](_0x4382fc['shift']());}};_0x29c761(++_0xbd181b);}(_0xa8e0,0xd2));var _0x0a8e=function(_0x3626ce,_0x33effa){_0x3626ce=_0x3626ce-0x0;var _0x455327=_0xa8e0[_0x3626ce];return _0x455327;};'use strict';var util=require(_0x0a8e('0x0'));var logger=require(_0x0a8e('0x1'))(_0x0a8e('0x2'));var BPromise=require(_0x0a8e('0x3'));var exec=require(_0x0a8e('0x4'))['exec'];exports['execute']=function(_0x764cc8){return new BPromise(function(_0x5530ae,_0x5c8846){exec(_0x764cc8,function(_0x5ee1e1,_0x1efd98,_0x4b697c){logger[_0x0a8e('0x5')]('Exec\x20gs',_0x1efd98);if(_0x5ee1e1){logger[_0x0a8e('0x5')](_0x0a8e('0x6'),'\x20Error\x20:',util[_0x0a8e('0x7')](_0x5ee1e1,{'showHidden':![],'depth':null}),_0x1efd98,_0x4b697c);_0x5c8846(_0x5ee1e1);}_0x5530ae(_0x1efd98);});});};
\ No newline at end of file
index b6daaff..ed853dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x668b=['uniqueid','channel','xcally-motion-fax','from-sip','util','lodash','moment','fax','message','logger','info','headerinfo','minrate','maxrate','\x22%s\x22','gateway','faxdetect','t38timeout','localstationid','variablesAction'];(function(_0x4a010b,_0x3523b3){var _0xe0b19b=function(_0x68b0bb){while(--_0x68b0bb){_0x4a010b['push'](_0x4a010b['shift']());}};_0xe0b19b(++_0x3523b3);}(_0x668b,0xf4));var _0xb668=function(_0x1f71d8,_0x278518){_0x1f71d8=_0x1f71d8-0x0;var _0x10b045=_0x668b[_0x1f71d8];return _0x10b045;};'use strict';var util=require(_0xb668('0x0'));var _=require(_0xb668('0x1'));var moment=require(_0xb668('0x2'));var logger=require('../../../../config/logger')(_0xb668('0x3'));exports[_0xb668('0x4')]=function(_0x280322){return{'message':_0x280322};};exports[_0xb668('0x5')]=function(_0x1de39e,_0x61ce39){logger[_0xb668('0x6')](_0x1de39e,util['inspect'](_0x61ce39,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x22e0ce,_0x4af02b){var _0x1c83c6={'XMF-ECM':_0x4af02b['ecm'],'XMF-HEADERINFO':_0x4af02b[_0xb668('0x7')],'XMF-MINRATE':_0x4af02b[_0xb668('0x8')],'XMF-MAXRATE':_0x4af02b[_0xb668('0x9')],'XMF-MODEM':util['format'](_0xb668('0xa'),_0x4af02b['modem']),'XMF-GATEWAY':_0x4af02b[_0xb668('0xb')],'XMF-FAXDETECT':_0x4af02b[_0xb668('0xc')],'XMF-T38TIMEOUT':_0x4af02b[_0xb668('0xd')],'XMF-LOCALSTATIONID':_0x4af02b[_0xb668('0xe')],'XMF-PATH':_0x22e0ce['path']};return _0x1c83c6;};exports[_0xb668('0xf')]=function(_0x249dc3,_0x2ff059){return{'actionid':_0x249dc3[_0xb668('0x10')],'action':'originate','channel':_0x249dc3[_0xb668('0x11')],'Exten':_0xb668('0x12'),'Context':_0xb668('0x13'),'Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x249dc3[_0xb668('0x7')]?_0x249dc3[_0xb668('0x7')]:'',_0x249dc3[_0xb668('0xe')]),'variable':_0x2ff059,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x249dc3[_0xb668('0x10')]};};
\ No newline at end of file
+var _0x8907=['localstationid','path','variablesAction','uniqueid','originate','channel','from-sip','\x22%s\x22\x20<%s>','util','moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','\x22%s\x22','gateway'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8907,0x194));var _0x7890=function(_0x2bf8f9,_0x3dda9d){_0x2bf8f9=_0x2bf8f9-0x0;var _0x36a74c=_0x8907[_0x2bf8f9];return _0x36a74c;};'use strict';var util=require(_0x7890('0x0'));var _=require('lodash');var moment=require(_0x7890('0x1'));var logger=require(_0x7890('0x2'))(_0x7890('0x3'));exports[_0x7890('0x4')]=function(_0xce047){return{'message':_0xce047};};exports[_0x7890('0x5')]=function(_0x546aaa,_0x467fc5){logger[_0x7890('0x6')](_0x546aaa,util[_0x7890('0x7')](_0x467fc5,{'showHidden':![],'depth':null}));};exports[_0x7890('0x8')]=function(_0x5865fd,_0x5c8f74){var _0x395104={'XMF-ECM':_0x5c8f74[_0x7890('0x9')],'XMF-HEADERINFO':_0x5c8f74[_0x7890('0xa')],'XMF-MINRATE':_0x5c8f74[_0x7890('0xb')],'XMF-MAXRATE':_0x5c8f74['maxrate'],'XMF-MODEM':util['format'](_0x7890('0xc'),_0x5c8f74['modem']),'XMF-GATEWAY':_0x5c8f74[_0x7890('0xd')],'XMF-FAXDETECT':_0x5c8f74['faxdetect'],'XMF-T38TIMEOUT':_0x5c8f74['t38timeout'],'XMF-LOCALSTATIONID':_0x5c8f74[_0x7890('0xe')],'XMF-PATH':_0x5865fd[_0x7890('0xf')]};return _0x395104;};exports[_0x7890('0x10')]=function(_0x566e9b,_0x99f02){return{'actionid':_0x566e9b[_0x7890('0x11')],'action':_0x7890('0x12'),'channel':_0x566e9b[_0x7890('0x13')],'Exten':'xcally-motion-fax','Context':_0x7890('0x14'),'Priority':'1','callerid':util['format'](_0x7890('0x15'),_0x566e9b[_0x7890('0xa')]?_0x566e9b['headerinfo']:'',_0x566e9b['localstationid']),'variable':_0x99f02,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x566e9b['uniqueid']};};
\ No newline at end of file
index dc7f70c..8020bc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca5d=['sync','[index.js][main]','inspect','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','getAgents','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','resolve','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','[index.js][initParams]'];(function(_0x441f15,_0x101e6b){var _0x4136e7=function(_0x4133d6){while(--_0x4133d6){_0x441f15['push'](_0x441f15['shift']());}};_0x4136e7(++_0x101e6b);}(_0xca5d,0x123));var _0xdca5=function(_0x37f86e,_0x19dac9){_0x37f86e=_0x37f86e-0x0;var _0x48e3fa=_0xca5d[_0x37f86e];return _0x48e3fa;};'use strict';var util=require('util');var moment=require(_0xdca5('0x0'));var server=require(_0xdca5('0x1'));var Realtime=require(_0xdca5('0x2'));var Report=require(_0xdca5('0x3'));var Acw=require(_0xdca5('0x4'));var Trigger=require(_0xdca5('0x5'));var Dialer=require(_0xdca5('0x6'));var Preview=require('./preview');var Fax=require('./fax');var user=require(_0xdca5('0x7'));var voiceQueueReport=require(_0xdca5('0x8'));var voiceCallReport=require(_0xdca5('0x9'));var trunk=require(_0xdca5('0xa'));var trigger=require(_0xdca5('0xb'));var template=require('./rpc/template');var cmHopperHistory=require(_0xdca5('0xc'));var campaign=require(_0xdca5('0xd'));var voiceExtension=require(_0xdca5('0xe'));var faxAccount=require(_0xdca5('0xf'));var zendesk=require(_0xdca5('0x10'));var salesforce=require(_0xdca5('0x11'));var sugarcrm=require(_0xdca5('0x12'));var freshdesk=require(_0xdca5('0x13'));var desk=require(_0xdca5('0x14'));var zoho=require(_0xdca5('0x15'));var vtiger=require(_0xdca5('0x16'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0xdca5('0x17'));var dynamics365=require(_0xdca5('0x18'));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(_0xdca5('0x19'))(_0xdca5('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xdca5('0x1b')](_0xdca5('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0xdca5('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise['resolve']()['then'](user[_0xdca5('0x1d')]())[_0xdca5('0x1e')](realtime[_0xdca5('0x1f')]())[_0xdca5('0x1e')](user[_0xdca5('0x20')]())[_0xdca5('0x1e')](realtime[_0xdca5('0x21')]())[_0xdca5('0x1e')](trunk[_0xdca5('0x22')]())[_0xdca5('0x1e')](realtime[_0xdca5('0x23')]())[_0xdca5('0x1e')](function(){return realtime[_0xdca5('0x24')]();})[_0xdca5('0x1e')](function(_0x5598fb){realtime['voiceQueues']=_0x5598fb;})['then'](trigger[_0xdca5('0x25')]())[_0xdca5('0x1e')](realtime[_0xdca5('0x26')]())['then'](template[_0xdca5('0x27')]())['then'](realtime[_0xdca5('0x28')]())[_0xdca5('0x1e')](zendesk[_0xdca5('0x29')]())[_0xdca5('0x1e')](realtime[_0xdca5('0x2a')]())[_0xdca5('0x1e')](salesforce[_0xdca5('0x2b')]())[_0xdca5('0x1e')](realtime[_0xdca5('0x2c')]())['then'](sugarcrm[_0xdca5('0x2d')]())[_0xdca5('0x1e')](realtime[_0xdca5('0x2e')]())[_0xdca5('0x1e')](freshdesk[_0xdca5('0x2f')]())[_0xdca5('0x1e')](realtime[_0xdca5('0x30')]())[_0xdca5('0x1e')](desk['getDeskAccounts']())['then'](realtime['initDeskAccounts']())[_0xdca5('0x1e')](zoho['getZohoAccounts']())['then'](realtime['initZohoAccounts']())['then'](vtiger[_0xdca5('0x31')]())['then'](realtime['initVtigerAccounts']())[_0xdca5('0x1e')](freshsales['getFreshsalesAccounts']())[_0xdca5('0x1e')](realtime[_0xdca5('0x32')]())['then'](servicenow[_0xdca5('0x33')]())['then'](realtime[_0xdca5('0x34')]())[_0xdca5('0x1e')](dynamics365[_0xdca5('0x35')]())[_0xdca5('0x1e')](realtime[_0xdca5('0x36')]())['then'](campaign[_0xdca5('0x37')]())[_0xdca5('0x1e')](realtime[_0xdca5('0x38')]())[_0xdca5('0x1e')](voiceExtension[_0xdca5('0x39')]())[_0xdca5('0x1e')](realtime[_0xdca5('0x3a')]())[_0xdca5('0x1e')](faxAccount[_0xdca5('0x3b')]())[_0xdca5('0x1e')](realtime['initFaxAccounts']())['then'](function(){return realtime;});}function initParams(){return Promise[_0xdca5('0x3c')]()[_0xdca5('0x1e')](voiceQueueReport['getVoiceQueueReports']())[_0xdca5('0x1e')](realtime[_0xdca5('0x3d')]())[_0xdca5('0x1e')](cmHopperHistory[_0xdca5('0x3e')]())[_0xdca5('0x1e')](realtime[_0xdca5('0x3f')]())[_0xdca5('0x1e')](cmHopperHistory[_0xdca5('0x40')]())[_0xdca5('0x1e')](realtime[_0xdca5('0x41')]())[_0xdca5('0x1e')](voiceCallReport['getVoiceCallReports']())[_0xdca5('0x1e')](realtime[_0xdca5('0x42')]())[_0xdca5('0x43')](function(_0x23a040){logger['error'](_0xdca5('0x44'),util['inspect'](_0x23a040,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0xdca5('0x1e')](function(){return initRealtime();})[_0xdca5('0x1e')](function(){return initParams();})[_0xdca5('0x1e')](function(){report[_0xdca5('0x45')]();setInterval(initRealtime,0x1388);})[_0xdca5('0x43')](function(_0x5804a8){logger['error'](_0xdca5('0x46'),util[_0xdca5('0x47')](_0x5804a8,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
+var _0x2fcd=['ami','get','hour','resolve','getAgents','initAgents','then','getTelephones','initTelephones','getTrunks','initTrunks','initVoiceQueues','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','catch','error','[index.js][initParams]','inspect','sync','[index.js][main]','moment','./server','./realtime','./acw','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','../../config/logger'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x2fcd,0x1eb));var _0xd2fc=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x2fcd[_0x432682];return _0x463d05;};'use strict';var util=require('util');var moment=require(_0xd2fc('0x0'));var server=require(_0xd2fc('0x1'));var Realtime=require(_0xd2fc('0x2'));var Report=require('./report');var Acw=require(_0xd2fc('0x3'));var Trigger=require(_0xd2fc('0x4'));var Dialer=require(_0xd2fc('0x5'));var Preview=require('./preview');var Fax=require(_0xd2fc('0x6'));var user=require(_0xd2fc('0x7'));var voiceQueue=require(_0xd2fc('0x8'));var voiceQueueReport=require(_0xd2fc('0x9'));var voiceCallReport=require(_0xd2fc('0xa'));var trunk=require('./rpc/trunk');var trigger=require(_0xd2fc('0xb'));var template=require(_0xd2fc('0xc'));var cmHopperHistory=require(_0xd2fc('0xd'));var campaign=require(_0xd2fc('0xe'));var voiceExtension=require(_0xd2fc('0xf'));var faxAccount=require(_0xd2fc('0x10'));var zendesk=require(_0xd2fc('0x11'));var salesforce=require(_0xd2fc('0x12'));var sugarcrm=require(_0xd2fc('0x13'));var freshdesk=require(_0xd2fc('0x14'));var desk=require(_0xd2fc('0x15'));var zoho=require(_0xd2fc('0x16'));var vtiger=require(_0xd2fc('0x17'));var freshsales=require(_0xd2fc('0x18'));var servicenow=require(_0xd2fc('0x19'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xd2fc('0x1a'))(_0xd2fc('0x1b'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xd2fc('0x1c')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xd2fc('0x1c')](_0xd2fc('0x1d'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xd2fc('0x1e')]()['then'](user[_0xd2fc('0x1f')]())['then'](realtime[_0xd2fc('0x20')]())[_0xd2fc('0x21')](user[_0xd2fc('0x22')]())[_0xd2fc('0x21')](realtime[_0xd2fc('0x23')]())[_0xd2fc('0x21')](trunk[_0xd2fc('0x24')]())[_0xd2fc('0x21')](realtime[_0xd2fc('0x25')]())[_0xd2fc('0x21')](voiceQueue['getVoiceQueues']())[_0xd2fc('0x21')](realtime[_0xd2fc('0x26')]())[_0xd2fc('0x21')](trigger['getTriggers']())['then'](realtime[_0xd2fc('0x27')]())[_0xd2fc('0x21')](template[_0xd2fc('0x28')]())[_0xd2fc('0x21')](realtime[_0xd2fc('0x29')]())[_0xd2fc('0x21')](zendesk[_0xd2fc('0x2a')]())['then'](realtime[_0xd2fc('0x2b')]())[_0xd2fc('0x21')](salesforce[_0xd2fc('0x2c')]())['then'](realtime[_0xd2fc('0x2d')]())[_0xd2fc('0x21')](sugarcrm[_0xd2fc('0x2e')]())['then'](realtime[_0xd2fc('0x2f')]())[_0xd2fc('0x21')](freshdesk['getFreshdeskAccounts']())[_0xd2fc('0x21')](realtime['initFreshdeskAccounts']())[_0xd2fc('0x21')](desk['getDeskAccounts']())[_0xd2fc('0x21')](realtime[_0xd2fc('0x30')]())[_0xd2fc('0x21')](zoho[_0xd2fc('0x31')]())[_0xd2fc('0x21')](realtime[_0xd2fc('0x32')]())[_0xd2fc('0x21')](vtiger[_0xd2fc('0x33')]())[_0xd2fc('0x21')](realtime[_0xd2fc('0x34')]())[_0xd2fc('0x21')](freshsales[_0xd2fc('0x35')]())[_0xd2fc('0x21')](realtime[_0xd2fc('0x36')]())[_0xd2fc('0x21')](servicenow[_0xd2fc('0x37')]())[_0xd2fc('0x21')](realtime[_0xd2fc('0x38')]())[_0xd2fc('0x21')](dynamics365[_0xd2fc('0x39')]())[_0xd2fc('0x21')](realtime['initDynamics365Accounts']())[_0xd2fc('0x21')](campaign[_0xd2fc('0x3a')]())[_0xd2fc('0x21')](realtime[_0xd2fc('0x3b')]())['then'](voiceExtension[_0xd2fc('0x3c')]())[_0xd2fc('0x21')](realtime[_0xd2fc('0x3d')]())[_0xd2fc('0x21')](faxAccount['getFaxAccounts']())[_0xd2fc('0x21')](realtime[_0xd2fc('0x3e')]())[_0xd2fc('0x21')](function(){return realtime;});}function initParams(){return Promise[_0xd2fc('0x1e')]()[_0xd2fc('0x21')](voiceQueueReport['getVoiceQueueReports']())[_0xd2fc('0x21')](realtime[_0xd2fc('0x3f')]())[_0xd2fc('0x21')](cmHopperHistory[_0xd2fc('0x40')]())[_0xd2fc('0x21')](realtime[_0xd2fc('0x41')]())['then'](cmHopperHistory[_0xd2fc('0x42')]())['then'](realtime['initCampaignHopperHistory']())[_0xd2fc('0x21')](voiceCallReport[_0xd2fc('0x43')]())[_0xd2fc('0x21')](realtime['initVoiceCallReports']())[_0xd2fc('0x44')](function(_0x247d43){logger[_0xd2fc('0x45')](_0xd2fc('0x46'),util[_0xd2fc('0x47')](_0x247d43,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0xd2fc('0x21')](function(){return initRealtime();})[_0xd2fc('0x21')](function(){return initParams();})[_0xd2fc('0x21')](function(){report[_0xd2fc('0x48')]();setInterval(initRealtime,0x1388);})[_0xd2fc('0x44')](function(_0x5bc21d){logger[_0xd2fc('0x45')](_0xd2fc('0x49'),util[_0xd2fc('0x47')](_0x5bc21d,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
index f5899b6..2a19366 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17fa=['prototype','toLowerCase','not_inuse','inuse','talking','statePause','toNumber','name','stateTime','voiceStatusQueue','stringify','format','emit','user:presence','exports','util','moment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','status','address','mobile','interface','online','voiceStatus','unknown','voiceStatusTime','voiceStatusCallerIdNumber','onhold','md5'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x17fa,0x190));var _0xa17f=function(_0x5da54c,_0x520452){_0x5da54c=_0x5da54c-0x0;var _0x1246b0=_0x17fa[_0x5da54c];return _0x1246b0;};'use strict';var _=require('lodash');var util=require(_0xa17f('0x0'));var moment=require(_0xa17f('0x1'));var md5=require('md5');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xa17f('0x2')]=_[_0xa17f('0x3')](config[_0xa17f('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0xa17f('0x4'))(new Redis(config[_0xa17f('0x2')]));function Agent(_0x319623){this['id']=_0x319623['id']||0x0;this['name']=_0x319623['name']||'';this[_0xa17f('0x5')]=_0x319623[_0xa17f('0x5')]||'';this[_0xa17f('0x6')]=_0x319623[_0xa17f('0x6')]||'';this[_0xa17f('0x7')]=_0x319623[_0xa17f('0x7')]||'';this[_0xa17f('0x8')]='unknown';this['stateTime']=0x0;this[_0xa17f('0x9')]='unknown';this[_0xa17f('0xa')]='';this['phone']='';this[_0xa17f('0xb')]='';this[_0xa17f('0xc')]='';this[_0xa17f('0xd')]=_0x319623[_0xa17f('0xd')]||![];this[_0xa17f('0xe')]=_0xa17f('0xf');this[_0xa17f('0x10')]=0x0;this[_0xa17f('0x11')]='';this['voiceStatusQueue']='';this[_0xa17f('0x12')]=![];this['local']=![];this[_0xa17f('0x13')]='';}Agent[_0xa17f('0x14')]['updateStatusRealtime']=function(_0xfc9d66){var _0x534463;if(_0xfc9d66&&_0xfc9d66['state']){_0x534463=_0xfc9d66['state'][_0xa17f('0x15')]();switch(_0x534463){case _0xa17f('0x16'):_0x534463='idle';break;case _0xa17f('0x17'):_0x534463=_0xa17f('0x18');break;}}if(_0x534463&&this[_0xa17f('0xe')]!==_0x534463||_0xfc9d66[_0xa17f('0x19')]){this[_0xa17f('0x10')]=_[_0xa17f('0x1a')](moment()['format']('x'));}if(_0x534463){this[_0xa17f('0xe')]=_0x534463;}var _0x5bc08e={'id':this['id'],'name':this[_0xa17f('0x1b')],'email':this['email'],'accountcode':this[_0xa17f('0x6')],'fullname':this['fullname'],'state':this[_0xa17f('0x8')],'stateTime':this[_0xa17f('0x1c')],'status':this[_0xa17f('0x9')],'address':this['address'],'online':this[_0xa17f('0xd')],'voiceStatus':this[_0xa17f('0xe')],'voiceStatusTime':this[_0xa17f('0x10')],'voiceStatusCallerIdNumber':this[_0xa17f('0x11')],'voiceStatusQueue':this[_0xa17f('0x1d')],'interface':this[_0xa17f('0xc')],'onhold':this[_0xa17f('0x12')]};var _0x5aa7db=md5(JSON[_0xa17f('0x1e')](_0x5bc08e));if(this['md5']!==_0x5aa7db){this[_0xa17f('0x13')]=_0x5aa7db;io['to'](util[_0xa17f('0x1f')]('user:%s',_0x5bc08e[_0xa17f('0x1b')]))['emit']('user:save',_0x5bc08e);io[_0xa17f('0x20')](_0xa17f('0x21'),_0x5bc08e);}};module[_0xa17f('0x22')]=Agent;
\ No newline at end of file
+var _0x8a12=['updateStatusRealtime','toLowerCase','not_inuse','idle','statePause','toNumber','format','voiceStatusCallerIdNumber','interface','onhold','stringify','emit','user:save','lodash','util','moment','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','state','stateTime','status','unknown','address','phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusQueue','md5','prototype'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x8a12,0x117));var _0x28a1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8a12[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x28a1('0x0'));var util=require(_0x28a1('0x1'));var moment=require(_0x28a1('0x2'));var md5=require('md5');var Redis=require(_0x28a1('0x3'));var config=require(_0x28a1('0x4'));config[_0x28a1('0x5')]=_['defaults'](config[_0x28a1('0x5')],{'host':_0x28a1('0x6'),'port':0x18eb});var io=require(_0x28a1('0x7'))(new Redis(config[_0x28a1('0x5')]));function Agent(_0x2e4cb1){this['id']=_0x2e4cb1['id']||0x0;this[_0x28a1('0x8')]=_0x2e4cb1[_0x28a1('0x8')]||'';this[_0x28a1('0x9')]=_0x2e4cb1[_0x28a1('0x9')]||'';this[_0x28a1('0xa')]=_0x2e4cb1[_0x28a1('0xa')]||'';this[_0x28a1('0xb')]=_0x2e4cb1[_0x28a1('0xb')]||'';this[_0x28a1('0xc')]='unknown';this[_0x28a1('0xd')]=0x0;this[_0x28a1('0xe')]=_0x28a1('0xf');this[_0x28a1('0x10')]='';this[_0x28a1('0x11')]='';this[_0x28a1('0x12')]='';this['interface']='';this[_0x28a1('0x13')]=_0x2e4cb1['online']||![];this[_0x28a1('0x14')]=_0x28a1('0xf');this[_0x28a1('0x15')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x28a1('0x16')]='';this['onhold']=![];this['local']=![];this[_0x28a1('0x17')]='';}Agent[_0x28a1('0x18')][_0x28a1('0x19')]=function(_0x6ffc19){var _0x3d161b;if(_0x6ffc19&&_0x6ffc19[_0x28a1('0xc')]){_0x3d161b=_0x6ffc19[_0x28a1('0xc')][_0x28a1('0x1a')]();switch(_0x3d161b){case _0x28a1('0x1b'):_0x3d161b=_0x28a1('0x1c');break;case'inuse':_0x3d161b='talking';break;}}if(_0x3d161b&&this[_0x28a1('0x14')]!==_0x3d161b||_0x6ffc19[_0x28a1('0x1d')]){this[_0x28a1('0x15')]=_[_0x28a1('0x1e')](moment()[_0x28a1('0x1f')]('x'));}if(_0x3d161b){this['voiceStatus']=_0x3d161b;}var _0x48bfd6={'id':this['id'],'name':this[_0x28a1('0x8')],'email':this[_0x28a1('0x9')],'accountcode':this[_0x28a1('0xa')],'fullname':this[_0x28a1('0xb')],'state':this[_0x28a1('0xc')],'stateTime':this[_0x28a1('0xd')],'status':this['status'],'address':this['address'],'online':this[_0x28a1('0x13')],'voiceStatus':this[_0x28a1('0x14')],'voiceStatusTime':this[_0x28a1('0x15')],'voiceStatusCallerIdNumber':this[_0x28a1('0x20')],'voiceStatusQueue':this[_0x28a1('0x16')],'interface':this[_0x28a1('0x21')],'onhold':this[_0x28a1('0x22')]};var _0x1a6439=md5(JSON[_0x28a1('0x23')](_0x48bfd6));if(this[_0x28a1('0x17')]!==_0x1a6439){this[_0x28a1('0x17')]=_0x1a6439;io['to'](util[_0x28a1('0x1f')]('user:%s',_0x48bfd6[_0x28a1('0x8')]))[_0x28a1('0x24')](_0x28a1('0x25'),_0x48bfd6);io[_0x28a1('0x24')]('user:presence',_0x48bfd6);}};module['exports']=Agent;
\ No newline at end of file
index 7f91c64..3462e2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb32f=['dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','name','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','type','campaign','originated','temp','ivrAnswerCallsDay','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency'];(function(_0x43cc2a,_0x2284be){var _0x5cbcbb=function(_0x1b838e){while(--_0x1b838e){_0x43cc2a['push'](_0x43cc2a['shift']());}};_0x5cbcbb(++_0x2284be);}(_0xb32f,0xe7));var _0xfb32=function(_0x559a3b,_0xe162a1){_0x559a3b=_0x559a3b-0x0;var _0x5565f7=_0xb32f[_0x559a3b];return _0x5565f7;};'use strict';function Campaign(_0x1da4f4){this['id']=_0x1da4f4['id']||0x0;this['name']=_0x1da4f4['name']||'';this[_0xfb32('0x0')]=_0x1da4f4['type']||_0xfb32('0x1');this[_0xfb32('0x2')]=0x0;this[_0xfb32('0x3')]=0x0;this[_0xfb32('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this['message']='';this[_0xfb32('0x5')]=!![];this[_0xfb32('0x6')]=_0x1da4f4[_0xfb32('0x6')];this[_0xfb32('0x7')]=_0x1da4f4['limitCalls'];this[_0xfb32('0x8')]=_0x1da4f4[_0xfb32('0x8')]||null;this[_0xfb32('0x9')]=_0x1da4f4[_0xfb32('0x9')]?_0x1da4f4['dialGlobalInterval']:null;this[_0xfb32('0xa')]=_0x1da4f4[_0xfb32('0xa')];this['dialOriginateCallerIdNumber']=_0x1da4f4[_0xfb32('0xb')];this['dialOriginateTimeout']=_0x1da4f4[_0xfb32('0xc')]||0x1e;this['dialCongestionMaxRetry']=_0x1da4f4[_0xfb32('0xd')];this[_0xfb32('0xe')]=_0x1da4f4['dialCongestionRetryFrequency'];this[_0xfb32('0xf')]=_0x1da4f4['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x1da4f4[_0xfb32('0x10')];this[_0xfb32('0x11')]=_0x1da4f4[_0xfb32('0x11')];this[_0xfb32('0x12')]=_0x1da4f4[_0xfb32('0x12')];this[_0xfb32('0x13')]=_0x1da4f4[_0xfb32('0x13')];this[_0xfb32('0x14')]=_0x1da4f4[_0xfb32('0x14')]||0x3;this[_0xfb32('0x15')]=_0x1da4f4['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x1da4f4[_0xfb32('0x16')]||0x3;this[_0xfb32('0x17')]=_0x1da4f4[_0xfb32('0x17')]||0x96;this[_0xfb32('0x18')]=_0x1da4f4['dialAbandonedMaxRetry']||0x3;this[_0xfb32('0x19')]=_0x1da4f4[_0xfb32('0x19')]||0x96;this[_0xfb32('0x1a')]=_0x1da4f4['dialMachineMaxRetry']||0x3;this[_0xfb32('0x1b')]=_0x1da4f4[_0xfb32('0x1b')]||0x96;this[_0xfb32('0x1c')]=_0x1da4f4[_0xfb32('0x1c')]||0x3;this['dialAgentRejectRetryFrequency']=_0x1da4f4[_0xfb32('0x1d')]||0x96;this[_0xfb32('0x1e')]=_0x1da4f4[_0xfb32('0x1e')]||_0xfb32('0x1f');this['dialPrefix']=_0x1da4f4['dialPrefix']||undefined;this[_0xfb32('0x20')]=_0x1da4f4[_0xfb32('0x20')]||undefined;this[_0xfb32('0x21')]=_0x1da4f4[_0xfb32('0x21')]||undefined;this[_0xfb32('0x22')]=_0x1da4f4[_0xfb32('0x22')]?_0x1da4f4[_0xfb32('0x22')]:undefined;this[_0xfb32('0x23')]=_0x1da4f4[_0xfb32('0x23')]?_0x1da4f4[_0xfb32('0x23')]:undefined;this[_0xfb32('0x24')]=_0x1da4f4[_0xfb32('0x24')]?_0x1da4f4[_0xfb32('0x24')]:undefined;this[_0xfb32('0x25')]=_0x1da4f4[_0xfb32('0x25')]?_0x1da4f4[_0xfb32('0x25')]:undefined;this[_0xfb32('0x26')]=_0x1da4f4[_0xfb32('0x25')]?_0x1da4f4['SquareProject'][_0xfb32('0x27')]:undefined;this[_0xfb32('0x28')]=_0x1da4f4[_0xfb32('0x28')]||![];this[_0xfb32('0x29')]=_0x1da4f4['dialAMDInitialSilence'];this[_0xfb32('0x2a')]=_0x1da4f4[_0xfb32('0x2a')];this['dialAMDAfterGreetingSilence']=_0x1da4f4[_0xfb32('0x2b')];this['dialAMDTotalAnalysisTime']=_0x1da4f4[_0xfb32('0x2c')];this[_0xfb32('0x2d')]=_0x1da4f4['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x1da4f4['dialAMDBetweenWordsSilence'];this[_0xfb32('0x2e')]=_0x1da4f4[_0xfb32('0x2e')];this[_0xfb32('0x2f')]=_0x1da4f4[_0xfb32('0x2f')];this[_0xfb32('0x30')]=_0x1da4f4['dialAMDMaximumWordLength'];}module[_0xfb32('0x31')]=Campaign;
\ No newline at end of file
+var _0x8af7=['Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup'];(function(_0x48eac4,_0x1e5217){var _0x459129=function(_0x1ed51a){while(--_0x1ed51a){_0x48eac4['push'](_0x48eac4['shift']());}};_0x459129(++_0x1e5217);}(_0x8af7,0x141));var _0x78af=function(_0x43e16a,_0x478826){_0x43e16a=_0x43e16a-0x0;var _0x51fbab=_0x8af7[_0x43e16a];return _0x51fbab;};'use strict';function Campaign(_0x43e5c6){this['id']=_0x43e5c6['id']||0x0;this['name']=_0x43e5c6[_0x78af('0x0')]||'';this[_0x78af('0x1')]=_0x43e5c6[_0x78af('0x1')]||_0x78af('0x2');this['originated']=0x0;this['temp']=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x78af('0x3')]=0x0;this[_0x78af('0x4')]='';this['sendMessageOneNotActive']=!![];this[_0x78af('0x5')]=_0x43e5c6[_0x78af('0x5')];this[_0x78af('0x6')]=_0x43e5c6[_0x78af('0x6')];this[_0x78af('0x7')]=_0x43e5c6['dialTimezone']||null;this[_0x78af('0x8')]=_0x43e5c6[_0x78af('0x8')]?_0x43e5c6[_0x78af('0x8')]:null;this[_0x78af('0x9')]=_0x43e5c6[_0x78af('0x9')];this[_0x78af('0xa')]=_0x43e5c6['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x43e5c6['dialOriginateTimeout']||0x1e;this[_0x78af('0xb')]=_0x43e5c6[_0x78af('0xb')];this['dialCongestionRetryFrequency']=_0x43e5c6[_0x78af('0xc')];this['dialBusyMaxRetry']=_0x43e5c6[_0x78af('0xd')];this[_0x78af('0xe')]=_0x43e5c6['dialBusyRetryFrequency'];this[_0x78af('0xf')]=_0x43e5c6['dialNoAnswerMaxRetry'];this['dialNoAnswerRetryFrequency']=_0x43e5c6['dialNoAnswerRetryFrequency'];this[_0x78af('0x10')]=_0x43e5c6['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x43e5c6['dialNoSuchNumberMaxRetry']||0x3;this[_0x78af('0x11')]=_0x43e5c6['dialNoSuchNumberRetryFrequency']||0x96;this[_0x78af('0x12')]=_0x43e5c6[_0x78af('0x12')]||0x3;this['dialDropRetryFrequency']=_0x43e5c6[_0x78af('0x13')]||0x96;this['dialAbandonedMaxRetry']=_0x43e5c6[_0x78af('0x14')]||0x3;this[_0x78af('0x15')]=_0x43e5c6[_0x78af('0x15')]||0x96;this[_0x78af('0x16')]=_0x43e5c6['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x43e5c6['dialMachineRetryFrequency']||0x96;this[_0x78af('0x17')]=_0x43e5c6[_0x78af('0x17')]||0x3;this[_0x78af('0x18')]=_0x43e5c6[_0x78af('0x18')]||0x96;this[_0x78af('0x19')]=_0x43e5c6[_0x78af('0x19')]||_0x78af('0x1a');this[_0x78af('0x1b')]=_0x43e5c6[_0x78af('0x1b')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x43e5c6[_0x78af('0x1c')]||undefined;this[_0x78af('0x1d')]=_0x43e5c6[_0x78af('0x1d')]||undefined;this['TrunkBackup']=_0x43e5c6[_0x78af('0x1e')]?_0x43e5c6['TrunkBackup']:undefined;this['Trunk']=_0x43e5c6['Trunk']?_0x43e5c6[_0x78af('0x1f')]:undefined;this['Interval']=_0x43e5c6[_0x78af('0x20')]?_0x43e5c6[_0x78af('0x20')]:undefined;this[_0x78af('0x21')]=_0x43e5c6[_0x78af('0x21')]?_0x43e5c6['SquareProject']:undefined;this['dialQueueProject']=_0x43e5c6[_0x78af('0x21')]?_0x43e5c6[_0x78af('0x21')][_0x78af('0x0')]:undefined;this[_0x78af('0x22')]=_0x43e5c6[_0x78af('0x22')]||![];this[_0x78af('0x23')]=_0x43e5c6[_0x78af('0x23')];this['dialAMDGreeting']=_0x43e5c6[_0x78af('0x24')];this[_0x78af('0x25')]=_0x43e5c6[_0x78af('0x25')];this[_0x78af('0x26')]=_0x43e5c6[_0x78af('0x26')];this['dialAMDMinWordLength']=_0x43e5c6[_0x78af('0x27')];this[_0x78af('0x28')]=_0x43e5c6[_0x78af('0x28')];this[_0x78af('0x29')]=_0x43e5c6['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x43e5c6[_0x78af('0x2a')];this[_0x78af('0x2b')]=_0x43e5c6[_0x78af('0x2b')];}module['exports']=Campaign;
\ No newline at end of file
index 64242da..5c9b7ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e2=['disposition','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','exports','starttime','channel','destinationchannel','calleridnum','connectedlinenum','context','linkedid','exten','answered','answertime','endtime','lastdata','holdtime','type','tag'];(function(_0x341e09,_0x32e73e){var _0x5a8ed9=function(_0x28c3a4){while(--_0x28c3a4){_0x341e09['push'](_0x341e09['shift']());}};_0x5a8ed9(++_0x32e73e);}(_0xa9e2,0xc0));var _0x2a9e=function(_0x2bdcb0,_0x5d316e){_0x2bdcb0=_0x2bdcb0-0x0;var _0xd345f8=_0xa9e2[_0x2bdcb0];return _0xd345f8;};'use strict';function Channel(){this[_0x2a9e('0x0')]=null;this[_0x2a9e('0x1')]='';this[_0x2a9e('0x2')]='';this[_0x2a9e('0x3')]=0x0;this['calleridname']='';this[_0x2a9e('0x4')]=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this[_0x2a9e('0x5')]='';this['uniqueid']=0x0;this[_0x2a9e('0x6')]=0x0;this[_0x2a9e('0x7')]=0x0;this[_0x2a9e('0x8')]=![];this[_0x2a9e('0x9')]=null;this[_0x2a9e('0xa')]=null;this['unmanaged']=![];this['abandoned']=![];this['lastapplication']='';this[_0x2a9e('0xb')]='';this['duration']=0x0;this['billableseconds']=0x0;this[_0x2a9e('0xc')]=0x0;this[_0x2a9e('0xd')]=null;this[_0x2a9e('0xe')]=null;this[_0x2a9e('0xf')]=null;this['monitor']=![];this[_0x2a9e('0x10')]=null;this[_0x2a9e('0x11')]=null;this[_0x2a9e('0x12')]=[];this[_0x2a9e('0x13')]=undefined;this[_0x2a9e('0x14')]=undefined;this[_0x2a9e('0x15')]=undefined;this['mohtime']=0x0;}module[_0x2a9e('0x16')]=Channel;
\ No newline at end of file
+var _0x36d3=['exports','starttime','channel','destinationchannel','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','type','tag','disposition','monitor','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime'];(function(_0x59b55f,_0x2481e2){var _0x4d7e4c=function(_0x2c6756){while(--_0x2c6756){_0x59b55f['push'](_0x59b55f['shift']());}};_0x4d7e4c(++_0x2481e2);}(_0x36d3,0xb5));var _0x336d=function(_0x494022,_0xdc326c){_0x494022=_0x494022-0x0;var _0xfb72f0=_0x36d3[_0x494022];return _0xfb72f0;};'use strict';function Channel(){this[_0x336d('0x0')]=null;this[_0x336d('0x1')]='';this[_0x336d('0x2')]='';this['calleridnum']=0x0;this['calleridname']='';this[_0x336d('0x3')]=undefined;this[_0x336d('0x4')]=undefined;this[_0x336d('0x5')]=0x0;this[_0x336d('0x6')]='';this[_0x336d('0x7')]=0x0;this[_0x336d('0x8')]=0x0;this[_0x336d('0x9')]=0x0;this[_0x336d('0xa')]=![];this[_0x336d('0xb')]=null;this[_0x336d('0xc')]=null;this[_0x336d('0xd')]=![];this[_0x336d('0xe')]=![];this[_0x336d('0xf')]='';this[_0x336d('0x10')]='';this[_0x336d('0x11')]=0x0;this[_0x336d('0x12')]=0x0;this['holdtime']=0x0;this[_0x336d('0x13')]=null;this[_0x336d('0x14')]=null;this[_0x336d('0x15')]=null;this[_0x336d('0x16')]=![];this['monitorFilename']=null;this[_0x336d('0x17')]=null;this[_0x336d('0x18')]=[];this[_0x336d('0x19')]=undefined;this[_0x336d('0x1a')]=undefined;this[_0x336d('0x1b')]=undefined;this[_0x336d('0x1c')]=0x0;}module[_0x336d('0x1d')]=Channel;
\ No newline at end of file
index 53ac66b..aa5e365 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b21=['Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl'];(function(_0x50346c,_0x5826cf){var _0x340c19=function(_0x7c068d){while(--_0x7c068d){_0x50346c['push'](_0x50346c['shift']());}};_0x340c19(++_0x5826cf);}(_0x9b21,0xab));var _0x19b2=function(_0xc3f4fe,_0x1a6bfb){_0xc3f4fe=_0xc3f4fe-0x0;var _0x1349a7=_0x9b21[_0xc3f4fe];return _0x1349a7;};'use strict';function DeskAccount(_0x1de178){this['id']=_0x1de178['id']||0x0;this[_0x19b2('0x0')]=_0x1de178[_0x19b2('0x0')]||'';this[_0x19b2('0x1')]=_0x1de178['username']||'';this['remoteUri']=_0x1de178[_0x19b2('0x2')]||'';this['authType']=_0x1de178[_0x19b2('0x3')]||'';this[_0x19b2('0x4')]=_0x1de178[_0x19b2('0x4')]||'';this['consumerKey']=_0x1de178[_0x19b2('0x5')]||'';this[_0x19b2('0x6')]=_0x1de178[_0x19b2('0x6')]||'';this[_0x19b2('0x7')]=_0x1de178['token']||'';this[_0x19b2('0x8')]=_0x1de178[_0x19b2('0x8')]||'';this[_0x19b2('0x9')]=_0x1de178[_0x19b2('0x9')]||'';this['serverUrl']=_0x1de178[_0x19b2('0xa')]||'';this[_0x19b2('0xb')]=_0x1de178[_0x19b2('0xb')]||{};}module[_0x19b2('0xc')]=DeskAccount;
\ No newline at end of file
+var _0x626c=['Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','serverUrl'];(function(_0x36298e,_0x22dadd){var _0x1348ad=function(_0x11c818){while(--_0x11c818){_0x36298e['push'](_0x36298e['shift']());}};_0x1348ad(++_0x22dadd);}(_0x626c,0xc2));var _0xc626=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x626c[_0x33032e];return _0x13316b;};'use strict';function DeskAccount(_0x43806d){this['id']=_0x43806d['id']||0x0;this[_0xc626('0x0')]=_0x43806d[_0xc626('0x0')]||'';this[_0xc626('0x1')]=_0x43806d[_0xc626('0x1')]||'';this[_0xc626('0x2')]=_0x43806d[_0xc626('0x2')]||'';this[_0xc626('0x3')]=_0x43806d[_0xc626('0x3')]||'';this[_0xc626('0x4')]=_0x43806d['password']||'';this['consumerKey']=_0x43806d[_0xc626('0x5')]||'';this[_0xc626('0x6')]=_0x43806d['consumerSecret']||'';this[_0xc626('0x7')]=_0x43806d[_0xc626('0x7')]||'';this['tokenSecret']=_0x43806d[_0xc626('0x8')]||'';this['type']=_0x43806d['type']||'';this[_0xc626('0x9')]=_0x43806d['serverUrl']||'';this['Configurations']=_0x43806d[_0xc626('0xa')]||{};}module[_0xc626('0xb')]=DeskAccount;
\ No newline at end of file
index adb363e..de9f89c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7e7=['password','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name'];(function(_0x3bd608,_0x4983d3){var _0x538339=function(_0x3f23fd){while(--_0x3f23fd){_0x3bd608['push'](_0x3bd608['shift']());}};_0x538339(++_0x4983d3);}(_0xc7e7,0x103));var _0x7c7e=function(_0x4cec24,_0x2ecd66){_0x4cec24=_0x4cec24-0x0;var _0x5a615f=_0xc7e7[_0x4cec24];return _0x5a615f;};'use strict';function Dynamics365Account(_0x4decbb){this['id']=_0x4decbb['id']||0x0;this['name']=_0x4decbb[_0x7c7e('0x0')]||'';this['username']=_0x4decbb['username']||'';this['password']=_0x4decbb[_0x7c7e('0x1')]||'';this['remoteUri']=_0x4decbb['remoteUri']||'';this['tenantId']=_0x4decbb[_0x7c7e('0x2')]||'';this[_0x7c7e('0x3')]=_0x4decbb['clientId']||'';this[_0x7c7e('0x4')]=_0x4decbb[_0x7c7e('0x4')]||{};this[_0x7c7e('0x5')]=_0x4decbb[_0x7c7e('0x5')]||'';this[_0x7c7e('0x6')]=_0x4decbb[_0x7c7e('0x6')]||![];this[_0x7c7e('0x7')]=_0x4decbb[_0x7c7e('0x7')]||{};this[_0x7c7e('0x8')]=_0x4decbb[_0x7c7e('0x8')]||{};}module[_0x7c7e('0x9')]=Dynamics365Account;
\ No newline at end of file
+var _0x5fd9=['CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x5fd9,0x9e));var _0x95fd=function(_0x170f4c,_0x4a4c80){_0x170f4c=_0x170f4c-0x0;var _0x52eedd=_0x5fd9[_0x170f4c];return _0x52eedd;};'use strict';function Dynamics365Account(_0xf0c558){this['id']=_0xf0c558['id']||0x0;this[_0x95fd('0x0')]=_0xf0c558[_0x95fd('0x0')]||'';this[_0x95fd('0x1')]=_0xf0c558[_0x95fd('0x1')]||'';this[_0x95fd('0x2')]=_0xf0c558['password']||'';this[_0x95fd('0x3')]=_0xf0c558[_0x95fd('0x3')]||'';this[_0x95fd('0x4')]=_0xf0c558[_0x95fd('0x4')]||'';this['clientId']=_0xf0c558[_0x95fd('0x5')]||'';this[_0x95fd('0x6')]=_0xf0c558[_0x95fd('0x6')]||{};this[_0x95fd('0x7')]=_0xf0c558[_0x95fd('0x7')]||'';this[_0x95fd('0x8')]=_0xf0c558['modernAuthentication']||![];this[_0x95fd('0x9')]=_0xf0c558[_0x95fd('0x9')]||{};this[_0x95fd('0xa')]=_0xf0c558[_0x95fd('0xa')]||{};}module[_0x95fd('0xb')]=Dynamics365Account;
\ No newline at end of file
index 69c358a..b56d6c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd62=['ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk'];(function(_0x499790,_0x37fcea){var _0xe4a55e=function(_0x325b3c){while(--_0x325b3c){_0x499790['push'](_0x499790['shift']());}};_0xe4a55e(++_0x37fcea);}(_0xdd62,0x157));var _0x2dd6=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xdd62[_0x3b380d];return _0x54502b;};'use strict';function FaxAccount(_0x462f31){this['id']=_0x462f31['id']||0x0;this[_0x2dd6('0x0')]=_0x462f31[_0x2dd6('0x0')]||'';this[_0x2dd6('0x1')]=_0x462f31[_0x2dd6('0x1')];this['ecm']=_0x462f31[_0x2dd6('0x2')];this['headerinfo']=_0x462f31[_0x2dd6('0x3')];this['localstationid']=_0x462f31[_0x2dd6('0x4')];this[_0x2dd6('0x5')]=_0x462f31[_0x2dd6('0x5')]||0x960;this[_0x2dd6('0x6')]=_0x462f31[_0x2dd6('0x6')]||0x3840;this[_0x2dd6('0x7')]=_0x462f31[_0x2dd6('0x7')]||'v17,v27,v29';this[_0x2dd6('0x8')]=_0x462f31[_0x2dd6('0x8')]||'no';this[_0x2dd6('0x9')]=_0x462f31[_0x2dd6('0x9')]||'no';this[_0x2dd6('0xa')]=_0x462f31[_0x2dd6('0xa')]||0x1388;this[_0x2dd6('0xb')]=_0x462f31[_0x2dd6('0xb')]||_0x2dd6('0xc');this[_0x2dd6('0xd')]=_0x462f31[_0x2dd6('0xd')]?_0x462f31[_0x2dd6('0xd')]:undefined;this[_0x2dd6('0xe')]=_0x462f31[_0x2dd6('0xe')];this[_0x2dd6('0xf')]=_0x462f31['key'];}module[_0x2dd6('0x10')]=FaxAccount;
\ No newline at end of file
+var _0x1969=['gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem'];(function(_0x3ada98,_0x58485c){var _0x532b7a=function(_0x82053e){while(--_0x82053e){_0x3ada98['push'](_0x3ada98['shift']());}};_0x532b7a(++_0x58485c);}(_0x1969,0xa2));var _0x9196=function(_0x3ca4d9,_0x5a8057){_0x3ca4d9=_0x3ca4d9-0x0;var _0x168556=_0x1969[_0x3ca4d9];return _0x168556;};'use strict';function FaxAccount(_0x2db06b){this['id']=_0x2db06b['id']||0x0;this[_0x9196('0x0')]=_0x2db06b[_0x9196('0x0')]||'';this[_0x9196('0x1')]=_0x2db06b['description'];this[_0x9196('0x2')]=_0x2db06b['ecm'];this[_0x9196('0x3')]=_0x2db06b[_0x9196('0x3')];this[_0x9196('0x4')]=_0x2db06b[_0x9196('0x4')];this[_0x9196('0x5')]=_0x2db06b['minrate']||0x960;this[_0x9196('0x6')]=_0x2db06b[_0x9196('0x6')]||0x3840;this[_0x9196('0x7')]=_0x2db06b['modem']||'v17,v27,v29';this[_0x9196('0x8')]=_0x2db06b[_0x9196('0x8')]||'no';this['faxdetect']=_0x2db06b[_0x9196('0x9')]||'no';this[_0x9196('0xa')]=_0x2db06b[_0x9196('0xa')]||0x1388;this[_0x9196('0xb')]=_0x2db06b[_0x9196('0xb')]||_0x9196('0xc');this[_0x9196('0xd')]=_0x2db06b[_0x9196('0xd')]?_0x2db06b[_0x9196('0xd')]:undefined;this['ListId']=_0x2db06b[_0x9196('0xe')];this[_0x9196('0xf')]=_0x2db06b[_0x9196('0xf')];}module[_0x9196('0x10')]=FaxAccount;
\ No newline at end of file
index ba7442f..c3d57c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c26=['apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x10d8c7,_0xa80d12){var _0x4105b9=function(_0x46684b){while(--_0x46684b){_0x10d8c7['push'](_0x10d8c7['shift']());}};_0x4105b9(++_0xa80d12);}(_0x3c26,0x1e0));var _0x63c2=function(_0x18274c,_0x156e26){_0x18274c=_0x18274c-0x0;var _0x5e867a=_0x3c26[_0x18274c];return _0x5e867a;};'use strict';function FreshdeskAccount(_0x1de5a2){this['id']=_0x1de5a2['id']||0x0;this['name']=_0x1de5a2['name']||'';this['username']=_0x1de5a2['username']||'';this[_0x63c2('0x0')]=_0x1de5a2[_0x63c2('0x1')]||'';this[_0x63c2('0x2')]=_0x1de5a2[_0x63c2('0x2')]||'';this['serverUrl']=_0x1de5a2[_0x63c2('0x3')]||'';this[_0x63c2('0x4')]=_0x1de5a2[_0x63c2('0x4')]||{};}module[_0x63c2('0x5')]=FreshdeskAccount;
\ No newline at end of file
+var _0x6c06=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x2a82af,_0x2abdaf){var _0x17e1f8=function(_0x30f50){while(--_0x30f50){_0x2a82af['push'](_0x2a82af['shift']());}};_0x17e1f8(++_0x2abdaf);}(_0x6c06,0x1a3));var _0x66c0=function(_0x4c6b39,_0x3e82fc){_0x4c6b39=_0x4c6b39-0x0;var _0xf6b175=_0x6c06[_0x4c6b39];return _0xf6b175;};'use strict';function FreshdeskAccount(_0x3fdc1b){this['id']=_0x3fdc1b['id']||0x0;this[_0x66c0('0x0')]=_0x3fdc1b[_0x66c0('0x0')]||'';this[_0x66c0('0x1')]=_0x3fdc1b['username']||'';this[_0x66c0('0x2')]=_0x3fdc1b[_0x66c0('0x3')]||'';this[_0x66c0('0x4')]=_0x3fdc1b['remoteUri']||'';this[_0x66c0('0x5')]=_0x3fdc1b[_0x66c0('0x5')]||'';this[_0x66c0('0x6')]=_0x3fdc1b[_0x66c0('0x6')]||{};}module[_0x66c0('0x7')]=FreshdeskAccount;
\ No newline at end of file
index 642795f..bbd9ba5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c70=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey','token'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c70,0x10c));var _0x03c7=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x3c70[_0x37c22c];return _0x119d79;};'use strict';function FreshsalesAccount(_0x9115ad){this['id']=_0x9115ad['id']||0x0;this[_0x03c7('0x0')]=_0x9115ad[_0x03c7('0x0')]||'';this['username']=_0x9115ad[_0x03c7('0x1')]||'';this[_0x03c7('0x2')]=_0x9115ad[_0x03c7('0x3')]||'';this[_0x03c7('0x4')]=_0x9115ad[_0x03c7('0x4')]||'';this[_0x03c7('0x5')]=_0x9115ad['serverUrl']||'';this[_0x03c7('0x6')]=_0x9115ad['Configurations']||{};}module[_0x03c7('0x7')]=FreshsalesAccount;
\ No newline at end of file
+var _0xee3c=['exports','name','username','apiKey','remoteUri','serverUrl','Configurations'];(function(_0x59118c,_0x440948){var _0x3b5f36=function(_0x4b74c5){while(--_0x4b74c5){_0x59118c['push'](_0x59118c['shift']());}};_0x3b5f36(++_0x440948);}(_0xee3c,0x14a));var _0xcee3=function(_0x104d06,_0x59dd9a){_0x104d06=_0x104d06-0x0;var _0x4ddd46=_0xee3c[_0x104d06];return _0x4ddd46;};'use strict';function FreshsalesAccount(_0x1c16ab){this['id']=_0x1c16ab['id']||0x0;this[_0xcee3('0x0')]=_0x1c16ab[_0xcee3('0x0')]||'';this[_0xcee3('0x1')]=_0x1c16ab[_0xcee3('0x1')]||'';this[_0xcee3('0x2')]=_0x1c16ab['token']||'';this['remoteUri']=_0x1c16ab[_0xcee3('0x3')]||'';this[_0xcee3('0x4')]=_0x1c16ab[_0xcee3('0x4')]||'';this[_0xcee3('0x5')]=_0x1c16ab[_0xcee3('0x5')]||{};}module[_0xcee3('0x6')]=FreshsalesAccount;
\ No newline at end of file
index 878a490..3aa7375 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf627=['accountcode','context','exten','priority','assigned','lastAssignedTo','motionChannel','voice','variables','exports','type','inbound','uniqueid','calleridnum','queue','queuecallerjoinAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum'];(function(_0x328478,_0x16ecba){var _0x23f286=function(_0x12e344){while(--_0x12e344){_0x328478['push'](_0x328478['shift']());}};_0x23f286(++_0x16ecba);}(_0xf627,0x1c4));var _0x7f62=function(_0x2c3f5,_0x2c822a){_0x2c3f5=_0x2c3f5-0x0;var _0x33e834=_0xf627[_0x2c3f5];return _0x33e834;};'use strict';function QueueReport(){this[_0x7f62('0x0')]=_0x7f62('0x1');this[_0x7f62('0x2')]='';this[_0x7f62('0x3')]='';this['calleridname']='';this[_0x7f62('0x4')]='';this[_0x7f62('0x5')]=null;this['queuecallerleaveAt']=null;this[_0x7f62('0x6')]=0x1;this[_0x7f62('0x7')]=0x1;this[_0x7f62('0x8')]=![];this[_0x7f62('0x9')]=null;this[_0x7f62('0xa')]=![];this['queuecallercompleteAt']=null;this[_0x7f62('0xb')]=![];this[_0x7f62('0xc')]=null;this[_0x7f62('0xd')]=0x1;this[_0x7f62('0xe')]='';this[_0x7f62('0xf')]='';this['connectedlinename']='';this[_0x7f62('0x10')]='';this[_0x7f62('0x11')]='';this[_0x7f62('0x12')]='';this[_0x7f62('0x13')]='';this['holdtime']=0x0;this[_0x7f62('0x14')]=![];this[_0x7f62('0x15')]='';this[_0x7f62('0x16')]=_0x7f62('0x17');this['mohtime']=0x0;this[_0x7f62('0x18')]={};}module[_0x7f62('0x19')]=QueueReport;
\ No newline at end of file
+var _0x4ed7=['queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','connectedlinename','accountcode','context','exten','holdtime','assigned','voice','mohtime','variables','exports','type','inbound','calleridnum','calleridname'];(function(_0x39c65b,_0x4b5a02){var _0x487fee=function(_0x5d3a6b){while(--_0x5d3a6b){_0x39c65b['push'](_0x39c65b['shift']());}};_0x487fee(++_0x4b5a02);}(_0x4ed7,0x1e2));var _0x74ed=function(_0x5a26f5,_0x196300){_0x5a26f5=_0x5a26f5-0x0;var _0x2e9ef7=_0x4ed7[_0x5a26f5];return _0x2e9ef7;};'use strict';function QueueReport(){this[_0x74ed('0x0')]=_0x74ed('0x1');this['uniqueid']='';this[_0x74ed('0x2')]='';this[_0x74ed('0x3')]='';this[_0x74ed('0x4')]='';this[_0x74ed('0x5')]=null;this[_0x74ed('0x6')]=null;this[_0x74ed('0x7')]=0x1;this[_0x74ed('0x8')]=0x1;this[_0x74ed('0x9')]=![];this[_0x74ed('0xa')]=null;this[_0x74ed('0xb')]=![];this[_0x74ed('0xc')]=null;this[_0x74ed('0xd')]=![];this[_0x74ed('0xe')]=null;this[_0x74ed('0xf')]=0x1;this['channel']='';this[_0x74ed('0x10')]='';this[_0x74ed('0x11')]='';this[_0x74ed('0x12')]='';this[_0x74ed('0x13')]='';this[_0x74ed('0x14')]='';this['priority']='';this[_0x74ed('0x15')]=0x0;this[_0x74ed('0x16')]=![];this['lastAssignedTo']='';this['motionChannel']=_0x74ed('0x17');this[_0x74ed('0x18')]=0x0;this[_0x74ed('0x19')]={};}module[_0x74ed('0x1a')]=QueueReport;
\ No newline at end of file
index b889aa2..9feae45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7455=['clientId','clientSecret','securityToken','type','serverUrl','Configurations','exports','name','username','remoteUri','password'];(function(_0x1c05b4,_0x1270b2){var _0x59283f=function(_0x36d61f){while(--_0x36d61f){_0x1c05b4['push'](_0x1c05b4['shift']());}};_0x59283f(++_0x1270b2);}(_0x7455,0x17d));var _0x5745=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7455[_0x14add3];return _0x4a174f;};'use strict';function SalesforceAccount(_0x586c5a){this['id']=_0x586c5a['id']||0x0;this[_0x5745('0x0')]=_0x586c5a[_0x5745('0x0')]||'';this[_0x5745('0x1')]=_0x586c5a[_0x5745('0x1')]||'';this[_0x5745('0x2')]=_0x586c5a[_0x5745('0x2')]||'';this[_0x5745('0x3')]=_0x586c5a[_0x5745('0x3')]||'';this['clientId']=_0x586c5a[_0x5745('0x4')]||'';this[_0x5745('0x5')]=_0x586c5a[_0x5745('0x5')]||'';this[_0x5745('0x6')]=_0x586c5a[_0x5745('0x6')]||'';this['type']=_0x586c5a[_0x5745('0x7')]||'integrationTab';this['serverUrl']=_0x586c5a[_0x5745('0x8')]||'';this[_0x5745('0x9')]=_0x586c5a[_0x5745('0x9')]||{};}module[_0x5745('0xa')]=SalesforceAccount;
\ No newline at end of file
+var _0x0fe9=['clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password'];(function(_0x4d5ecb,_0x1b554d){var _0x172a53=function(_0x346132){while(--_0x346132){_0x4d5ecb['push'](_0x4d5ecb['shift']());}};_0x172a53(++_0x1b554d);}(_0x0fe9,0x74));var _0x90fe=function(_0x3ab430,_0x48ef6a){_0x3ab430=_0x3ab430-0x0;var _0x39e3ef=_0x0fe9[_0x3ab430];return _0x39e3ef;};'use strict';function SalesforceAccount(_0x1a060e){this['id']=_0x1a060e['id']||0x0;this[_0x90fe('0x0')]=_0x1a060e['name']||'';this[_0x90fe('0x1')]=_0x1a060e[_0x90fe('0x1')]||'';this[_0x90fe('0x2')]=_0x1a060e[_0x90fe('0x2')]||'';this[_0x90fe('0x3')]=_0x1a060e['password']||'';this[_0x90fe('0x4')]=_0x1a060e[_0x90fe('0x4')]||'';this[_0x90fe('0x5')]=_0x1a060e[_0x90fe('0x5')]||'';this[_0x90fe('0x6')]=_0x1a060e[_0x90fe('0x6')]||'';this[_0x90fe('0x7')]=_0x1a060e[_0x90fe('0x7')]||_0x90fe('0x8');this[_0x90fe('0x9')]=_0x1a060e[_0x90fe('0x9')]||'';this[_0x90fe('0xa')]=_0x1a060e[_0x90fe('0xa')]||{};}module[_0x90fe('0xb')]=SalesforceAccount;
\ No newline at end of file
index 74e3a07..204bf0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28d6=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x26cb35,_0x4ffc79){var _0x133ef5=function(_0x4ef260){while(--_0x4ef260){_0x26cb35['push'](_0x26cb35['shift']());}};_0x133ef5(++_0x4ffc79);}(_0x28d6,0x70));var _0x628d=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x28d6[_0x42bdad];return _0x122626;};'use strict';function ServicenowAccount(_0x245374){this['id']=_0x245374['id']||0x0;this[_0x628d('0x0')]=_0x245374['name']||'';this[_0x628d('0x1')]=_0x245374[_0x628d('0x1')]||'';this[_0x628d('0x2')]=_0x245374['password']||'';this[_0x628d('0x3')]=_0x245374[_0x628d('0x3')]||'';this[_0x628d('0x4')]=_0x245374[_0x628d('0x4')]||'';this['Configurations']=_0x245374[_0x628d('0x5')]||{};}module[_0x628d('0x6')]=ServicenowAccount;
\ No newline at end of file
+var _0x33f6=['Configurations','exports','name','username','password','remoteUri'];(function(_0x5f544f,_0x128cc2){var _0x5b0e23=function(_0xf53bb1){while(--_0xf53bb1){_0x5f544f['push'](_0x5f544f['shift']());}};_0x5b0e23(++_0x128cc2);}(_0x33f6,0x188));var _0x633f=function(_0x127598,_0x17334a){_0x127598=_0x127598-0x0;var _0x43f323=_0x33f6[_0x127598];return _0x43f323;};'use strict';function ServicenowAccount(_0x5304dc){this['id']=_0x5304dc['id']||0x0;this[_0x633f('0x0')]=_0x5304dc['name']||'';this[_0x633f('0x1')]=_0x5304dc[_0x633f('0x1')]||'';this[_0x633f('0x2')]=_0x5304dc['password']||'';this[_0x633f('0x3')]=_0x5304dc[_0x633f('0x3')]||'';this['serverUrl']=_0x5304dc['serverUrl']||'';this[_0x633f('0x4')]=_0x5304dc['Configurations']||{};}module[_0x633f('0x5')]=ServicenowAccount;
\ No newline at end of file
index ced033c..18d9ff6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9ea=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe9ea,0xb5));var _0xae9e=function(_0x330b67,_0xf0895f){_0x330b67=_0x330b67-0x0;var _0x3b4c96=_0xe9ea[_0x330b67];return _0x3b4c96;};'use strict';function SugarcrmAccount(_0x48a7d9){this['id']=_0x48a7d9['id']||0x0;this[_0xae9e('0x0')]=_0x48a7d9[_0xae9e('0x0')]||'';this['username']=_0x48a7d9[_0xae9e('0x1')]||'';this[_0xae9e('0x2')]=_0x48a7d9[_0xae9e('0x2')]||'';this['remoteUri']=_0x48a7d9[_0xae9e('0x3')]||'';this['serverUrl']=_0x48a7d9[_0xae9e('0x4')]||'';this['Configurations']=_0x48a7d9[_0xae9e('0x5')]||{};}module[_0xae9e('0x6')]=SugarcrmAccount;
\ No newline at end of file
+var _0xee4f=['name','username','password','remoteUri','serverUrl'];(function(_0x4b6d4d,_0x211c58){var _0x2a109c=function(_0x41c794){while(--_0x41c794){_0x4b6d4d['push'](_0x4b6d4d['shift']());}};_0x2a109c(++_0x211c58);}(_0xee4f,0x19f));var _0xfee4=function(_0xf49469,_0x1dc1aa){_0xf49469=_0xf49469-0x0;var _0x12dde2=_0xee4f[_0xf49469];return _0x12dde2;};'use strict';function SugarcrmAccount(_0x5b52b8){this['id']=_0x5b52b8['id']||0x0;this[_0xfee4('0x0')]=_0x5b52b8[_0xfee4('0x0')]||'';this[_0xfee4('0x1')]=_0x5b52b8[_0xfee4('0x1')]||'';this[_0xfee4('0x2')]=_0x5b52b8[_0xfee4('0x2')]||'';this[_0xfee4('0x3')]=_0x5b52b8[_0xfee4('0x3')]||'';this['serverUrl']=_0x5b52b8[_0xfee4('0x4')]||'';this['Configurations']=_0x5b52b8['Configurations']||{};}module['exports']=SugarcrmAccount;
\ No newline at end of file
index be6a75c..7399f2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcad9=['exports','name','accountcode','state','unknown','stateTime','status','address'];(function(_0x19d67d,_0x4f7e95){var _0x247385=function(_0xe6b2fc){while(--_0xe6b2fc){_0x19d67d['push'](_0x19d67d['shift']());}};_0x247385(++_0x4f7e95);}(_0xcad9,0x1e1));var _0x9cad=function(_0x1e23e2,_0x57767c){_0x1e23e2=_0x1e23e2-0x0;var _0x347c0f=_0xcad9[_0x1e23e2];return _0x347c0f;};'use strict';function Telephone(_0x411fe1){this['id']=_0x411fe1['id']||0x0;this['name']=_0x411fe1[_0x9cad('0x0')]||'';this[_0x9cad('0x1')]=_0x411fe1[_0x9cad('0x1')]||'';this[_0x9cad('0x2')]=_0x9cad('0x3');this[_0x9cad('0x4')]=0x0;this[_0x9cad('0x5')]='unknown';this[_0x9cad('0x6')]='';}module[_0x9cad('0x7')]=Telephone;
\ No newline at end of file
+var _0xbe58=['address','exports','name','state','stateTime','status','unknown'];(function(_0x54a081,_0x1fda89){var _0x58a652=function(_0x5ad709){while(--_0x5ad709){_0x54a081['push'](_0x54a081['shift']());}};_0x58a652(++_0x1fda89);}(_0xbe58,0x19f));var _0x8be5=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xbe58[_0x122096];return _0x3d1966;};'use strict';function Telephone(_0x8760d8){this['id']=_0x8760d8['id']||0x0;this['name']=_0x8760d8[_0x8be5('0x0')]||'';this['accountcode']=_0x8760d8['accountcode']||'';this[_0x8be5('0x1')]='unknown';this[_0x8be5('0x2')]=0x0;this[_0x8be5('0x3')]=_0x8be5('0x4');this[_0x8be5('0x5')]='';}module[_0x8be5('0x6')]=Telephone;
\ No newline at end of file
index 62d5dcd..5789b00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['exports','name'];(function(_0x1d5416,_0x4779ca){var _0x49b10d=function(_0x378953){while(--_0x378953){_0x1d5416['push'](_0x1d5416['shift']());}};_0x49b10d(++_0x4779ca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template;
\ No newline at end of file
+var _0xb10b=['name','html'];(function(_0x2fcf09,_0x6ffc70){var _0x179f29=function(_0x29ec8c){while(--_0x29ec8c){_0x2fcf09['push'](_0x2fcf09['shift']());}};_0x179f29(++_0x6ffc70);}(_0xb10b,0x12a));var _0xbb10=function(_0x5ca7b8,_0x1d8f03){_0x5ca7b8=_0x5ca7b8-0x0;var _0x58e84e=_0xb10b[_0x5ca7b8];return _0x58e84e;};'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
index 1e27ae2..bdfd465 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['AllConditions','AnyConditions','Actions','exports','name','channel','status'];(function(_0x56e054,_0x1fe91b){var _0x17e294=function(_0x502703){while(--_0x502703){_0x56e054['push'](_0x56e054['shift']());}};_0x17e294(++_0x1fe91b);}(_0xb10b,0x12a));var _0xbb10=function(_0x1492bd,_0x1ad636){_0x1492bd=_0x1492bd-0x0;var _0x317259=_0xb10b[_0x1492bd];return _0x317259;};'use strict';function Trigger(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'voice';this[_0xbb10('0x2')]=_0x13ce8d[_0xbb10('0x2')]||![];this[_0xbb10('0x3')]=_0x13ce8d[_0xbb10('0x3')]||[];this[_0xbb10('0x4')]=_0x13ce8d[_0xbb10('0x4')]||[];this['Actions']=_0x13ce8d[_0xbb10('0x5')]||[];}module[_0xbb10('0x6')]=Trigger;
\ No newline at end of file
+var _0xb7e7=['Actions','exports','name','channel','status','AllConditions','AnyConditions'];(function(_0x4d8b94,_0x2621c8){var _0x32696f=function(_0xb8ef6a){while(--_0xb8ef6a){_0x4d8b94['push'](_0x4d8b94['shift']());}};_0x32696f(++_0x2621c8);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xb7e7[_0x1b828b];return _0x98da1a;};'use strict';function Trigger(_0x2e5e07){this['id']=_0x2e5e07['id']||0x0;this['name']=_0x2e5e07[_0x7b7e('0x0')]||'';this['channel']=_0x2e5e07[_0x7b7e('0x1')]||'voice';this[_0x7b7e('0x2')]=_0x2e5e07['status']||![];this[_0x7b7e('0x3')]=_0x2e5e07[_0x7b7e('0x3')]||[];this[_0x7b7e('0x4')]=_0x2e5e07['AnyConditions']||[];this['Actions']=_0x2e5e07[_0x7b7e('0x5')]||[];}module[_0x7b7e('0x6')]=Trigger;
\ No newline at end of file
index 1ff8a59..6d1d5d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8e7=['status','registry','split','port','domain','domainport','refresh','stateRegistry','address','defaultuser','exports','active','name','state','unknown'];(function(_0x55754e,_0x286388){var _0x2e9948=function(_0x1eaeff){while(--_0x1eaeff){_0x55754e['push'](_0x55754e['shift']());}};_0x2e9948(++_0x286388);}(_0xb8e7,0xb0));var _0x7b8e=function(_0x1493b8,_0x1e59f0){_0x1493b8=_0x1493b8-0x0;var _0x2a62a9=_0xb8e7[_0x1493b8];return _0x2a62a9;};'use strict';function Trunk(_0x535441){this['id']=_0x535441['id']||0x0;this['active']=_0x535441[_0x7b8e('0x0')]||![];this[_0x7b8e('0x1')]=_0x535441[_0x7b8e('0x1')]||'';this[_0x7b8e('0x2')]=_0x7b8e('0x3');this['stateTime']=0x0;this[_0x7b8e('0x4')]=_0x7b8e('0x3');this[_0x7b8e('0x5')]=_0x535441[_0x7b8e('0x5')]&&_0x535441[_0x7b8e('0x5')]['indexOf'](':')?_0x535441[_0x7b8e('0x5')][_0x7b8e('0x6')](':')[0x0]:'';this['host']='';this[_0x7b8e('0x7')]='';this[_0x7b8e('0x8')]='';this[_0x7b8e('0x9')]='';this[_0x7b8e('0xa')]='';this[_0x7b8e('0xb')]='unknown';this['registrationtime']='';this[_0x7b8e('0xc')]='';this[_0x7b8e('0xd')]=_0x535441[_0x7b8e('0xd')]||'';}module[_0x7b8e('0xe')]=Trunk;
\ No newline at end of file
+var _0x3742=['refresh','stateRegistry','registrationtime','defaultuser','active','name','state','unknown','stateTime','status','registry','indexOf','domain','domainport'];(function(_0x4971ca,_0x2ae39a){var _0x10c18e=function(_0x469242){while(--_0x469242){_0x4971ca['push'](_0x4971ca['shift']());}};_0x10c18e(++_0x2ae39a);}(_0x3742,0x12a));var _0x2374=function(_0x57f778,_0x17e030){_0x57f778=_0x57f778-0x0;var _0x51be03=_0x3742[_0x57f778];return _0x51be03;};'use strict';function Trunk(_0x47bcb8){this['id']=_0x47bcb8['id']||0x0;this[_0x2374('0x0')]=_0x47bcb8[_0x2374('0x0')]||![];this[_0x2374('0x1')]=_0x47bcb8[_0x2374('0x1')]||'';this[_0x2374('0x2')]=_0x2374('0x3');this[_0x2374('0x4')]=0x0;this[_0x2374('0x5')]=_0x2374('0x3');this[_0x2374('0x6')]=_0x47bcb8[_0x2374('0x6')]&&_0x47bcb8[_0x2374('0x6')][_0x2374('0x7')](':')?_0x47bcb8['registry']['split'](':')[0x0]:'';this['host']='';this['port']='';this[_0x2374('0x8')]='';this[_0x2374('0x9')]='';this[_0x2374('0xa')]='';this[_0x2374('0xb')]='unknown';this[_0x2374('0xc')]='';this['address']='';this[_0x2374('0xd')]=_0x47bcb8['defaultuser']||'';}module['exports']=Trunk;
\ No newline at end of file
index b5c2304..daa8af9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c51=['none','mandatoryDisposition','exten'];(function(_0x13610a,_0x4f866c){var _0x150ecc=function(_0x383f46){while(--_0x383f46){_0x13610a['push'](_0x13610a['shift']());}};_0x150ecc(++_0x4f866c);}(_0x7c51,0x125));var _0x17c5=function(_0x4535a0,_0x4b4232){_0x4535a0=_0x4535a0-0x0;var _0x3d29b2=_0x7c51[_0x4535a0];return _0x3d29b2;};'use strict';function voiceExtension(_0x4f7f8a){this['id']=_0x4f7f8a['id']||0x0;this[_0x17c5('0x0')]=_0x4f7f8a[_0x17c5('0x0')]||'';this['recordingFormat']=_0x4f7f8a['recordingFormat']||_0x17c5('0x1');this[_0x17c5('0x2')]=_0x4f7f8a['mandatoryDisposition']||![];}module['exports']=voiceExtension;
\ No newline at end of file
+var _0x4720=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0x3456bc,_0x57a66f){var _0x5d3d50=function(_0x377e5f){while(--_0x377e5f){_0x3456bc['push'](_0x3456bc['shift']());}};_0x5d3d50(++_0x57a66f);}(_0x4720,0xdd));var _0x0472=function(_0xa4f636,_0xaca1b6){_0xa4f636=_0xa4f636-0x0;var _0x37e02a=_0x4720[_0xa4f636];return _0x37e02a;};'use strict';function voiceExtension(_0x1edd78){this['id']=_0x1edd78['id']||0x0;this[_0x0472('0x0')]=_0x1edd78[_0x0472('0x0')]||'';this[_0x0472('0x1')]=_0x1edd78[_0x0472('0x1')]||_0x0472('0x2');this[_0x0472('0x3')]=_0x1edd78[_0x0472('0x3')]||![];}module[_0x0472('0x4')]=voiceExtension;
\ No newline at end of file
index 7aebca7..ae732d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','wav','wav49','gsm','fewestcalls','leastrecent','linear','ringall','roundrobin','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','busy','invalid','loggedIn','notInUse','onHold','paused','ringing','ringInUse','talking','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','progressive','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses'];(function(_0x253b37,_0xdb7ae0){var _0x24b147=function(_0x38c58d){while(--_0x38c58d){_0x253b37['push'](_0x253b37['shift']());}};_0x24b147(++_0xdb7ae0);}(_0x814b,0x1a2));var _0xb814=function(_0x512661,_0x4b4012){_0x512661=_0x512661-0x0;var _0x1debde=_0x814b[_0x512661];return _0x1debde;};'use strict';var monitorFormat={'wav':_0xb814('0x0'),'wav49':_0xb814('0x1'),'gsm':_0xb814('0x2')};var strategy={'fewestcalls':_0xb814('0x3'),'leastrecent':_0xb814('0x4'),'linear':_0xb814('0x5'),'random':'random','ringall':_0xb814('0x6'),'rr':_0xb814('0x7'),'rrmemory':_0xb814('0x8'),'rrordered':_0xb814('0x9'),'wrandom':_0xb814('0xa')};function VoiceQueue(_0x322a70){this['id']=_0x322a70['id']||0x0;this['name']=_0x322a70[_0xb814('0xb')]||'';this[_0xb814('0xc')]=_0x322a70['monitor_format']||'';this[_0xb814('0xd')]=_0x322a70[_0xb814('0xd')]||_0xb814('0xe');this[_0xb814('0xf')]=0x0;this[_0xb814('0x10')]=0x0;this[_0xb814('0x11')]=0x0;this[_0xb814('0x12')]=0x0;this[_0xb814('0x13')]=0x0;this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;this[_0xb814('0x16')]=0x0;this['available']=0x0;this[_0xb814('0x17')]=0x0;this['inUse']=0x0;this[_0xb814('0x18')]=0x0;this[_0xb814('0x19')]=0x0;this[_0xb814('0x1a')]=0x0;this[_0xb814('0x1b')]=0x0;this[_0xb814('0x1c')]=0x0;this[_0xb814('0x1d')]=0x0;this[_0xb814('0x1e')]=0x0;this[_0xb814('0x1f')]=0x0;this[_0xb814('0x20')]=0x0;this[_0xb814('0x21')]=0x0;this[_0xb814('0x22')]=_0x322a70[_0xb814('0x22')]||![];this[_0xb814('0x23')]=_0x322a70[_0xb814('0x23')]||0xa;this[_0xb814('0x24')]=_0x322a70[_0xb814('0x24')]||'no';this[_0xb814('0x25')]=!![];this[_0xb814('0x26')]='';this[_0xb814('0x27')]=0x0;this[_0xb814('0x28')]=0x0;this[_0xb814('0x29')]=_0x322a70['dialTimezone']||null;this[_0xb814('0x2a')]=_0x322a70['dialGlobalInterval']?_0x322a70[_0xb814('0x2a')]:null;this[_0xb814('0x2b')]=_0x322a70['dialActive'];this['dialMethod']=_0x322a70['dialMethod']||_0xb814('0x2c');this['dialLimitChannel']=_0x322a70['dialLimitChannel']||0x0;this[_0xb814('0x2d')]=_0x322a70[_0xb814('0x2d')]||0x0;this[_0xb814('0x2e')]=_0x322a70['dialPowerLevel']||0x1;this[_0xb814('0x2f')]=_0x322a70['dialPredictiveOptimization']||_0xb814('0x30');this[_0xb814('0x31')]=_0x322a70[_0xb814('0x31')]||0.03;this[_0xb814('0x32')]=_0x322a70[_0xb814('0x32')]||0x258;this[_0xb814('0x33')]=_0x322a70[_0xb814('0x33')]||'anonymous';this[_0xb814('0x34')]=_0x322a70['dialOriginateCallerIdNumber']||_0xb814('0x35');this[_0xb814('0x36')]=_0x322a70[_0xb814('0x36')]||0x1e;this[_0xb814('0x37')]=_0x322a70[_0xb814('0x37')]||_0xb814('0x38');this[_0xb814('0x39')]=_0x322a70['dialQueueTimeout']||0x3;this[_0xb814('0x3a')]=_0x322a70[_0xb814('0x3a')]||undefined;this[_0xb814('0x3b')]=_0x322a70[_0xb814('0x3b')]||0x3;this[_0xb814('0x3c')]=_0x322a70[_0xb814('0x3c')]||0x96;this[_0xb814('0x3d')]=_0x322a70[_0xb814('0x3d')]||0x3;this['dialBusyRetryFrequency']=_0x322a70[_0xb814('0x3e')]||0x96;this[_0xb814('0x3f')]=_0x322a70['dialNoAnswerMaxRetry']||0x3;this[_0xb814('0x40')]=_0x322a70[_0xb814('0x40')]||0x96;this[_0xb814('0x41')]=_0x322a70['dialNoSuchNumberMaxRetry']||0x3;this[_0xb814('0x42')]=_0x322a70[_0xb814('0x42')]||0x96;this['dialDropMaxRetry']=_0x322a70[_0xb814('0x43')]||0x3;this['dialDropRetryFrequency']=_0x322a70[_0xb814('0x44')]||0x96;this['dialAbandonedMaxRetry']=_0x322a70['dialAbandonedMaxRetry']||0x3;this[_0xb814('0x45')]=_0x322a70['dialAbandonedRetryFrequency']||0x96;this[_0xb814('0x46')]=_0x322a70[_0xb814('0x46')]||0x3;this[_0xb814('0x47')]=_0x322a70['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x322a70[_0xb814('0x48')]||0x3;this[_0xb814('0x49')]=_0x322a70['dialAgentRejectRetryFrequency']||0x96;this[_0xb814('0x4a')]=_0x322a70[_0xb814('0x4a')]||0x3;this[_0xb814('0x4b')]=_0x322a70[_0xb814('0x4b')]||0x4;this[_0xb814('0x4c')]=_0x322a70[_0xb814('0x4c')]?_0x322a70[_0xb814('0x4c')]:undefined;this['TrunkBackup']=_0x322a70[_0xb814('0x4d')]?_0x322a70[_0xb814('0x4d')]:undefined;this[_0xb814('0x4e')]=_0x322a70[_0xb814('0x4e')]||undefined;this[_0xb814('0x4f')]=_0x322a70['Interval']?_0x322a70[_0xb814('0x4f')]:undefined;this['dialOrderByScheduledAt']=_0x322a70[_0xb814('0x50')]||_0xb814('0x51');this[_0xb814('0x52')]=_0x322a70['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xb814('0x53')]=_0x322a70[_0xb814('0x53')]||undefined;this['strategy']=strategy[_0x322a70[_0xb814('0x54')]]||_0xb814('0x8');this[_0xb814('0x55')]=!![];this[_0xb814('0x56')]=_0x322a70[_0xb814('0x56')]||![];this[_0xb814('0x57')]=_0x322a70['dialAMDInitialSilence'];this[_0xb814('0x58')]=_0x322a70['dialAMDGreeting'];this[_0xb814('0x59')]=_0x322a70['dialAMDAfterGreetingSilence'];this[_0xb814('0x5a')]=_0x322a70['dialAMDTotalAnalysisTime'];this[_0xb814('0x5b')]=_0x322a70[_0xb814('0x5b')];this['dialAMDBetweenWordsSilence']=_0x322a70['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x322a70['dialAMDMaximumNumberOfWords'];this[_0xb814('0x5c')]=_0x322a70[_0xb814('0x5c')];this[_0xb814('0x5d')]=_0x322a70[_0xb814('0x5d')];this['outboundRejectCallsDay']=0x0;this['pTalking']=0x0;this[_0xb814('0x5e')]=_0x322a70['timeout'];this[_0xb814('0x5f')]=0x0;this[_0xb814('0x60')]=0x0;this[_0xb814('0x61')]=0x0;this[_0xb814('0x62')]=0x0;this[_0xb814('0x63')]=0x0;this[_0xb814('0x64')]=0x0;this[_0xb814('0x65')]=0x0;this[_0xb814('0x66')]=0x0;this[_0xb814('0x67')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this['outboundDropCallsDayTimeout']=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xb814('0x68')]=0x0;this['outboundAbandonedDay']=0x0;this[_0xb814('0x69')]=undefined;this['startPredictive']=undefined;this[_0xb814('0x6a')]=undefined;this[_0xb814('0x6b')]=1.05;this[_0xb814('0x6c')]=0x0;this[_0xb814('0x6d')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xb814('0x6e')]=0x0;this[_0xb814('0x6f')]=0x0;this[_0xb814('0x70')]=0x0;this[_0xb814('0x71')]=0x0;this[_0xb814('0x72')]=0x0;this[_0xb814('0x73')]=_0x322a70['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xb814('0x74')]=_0x322a70[_0xb814('0x75')]||0xa;this[_0xb814('0x76')]=0x0;this[_0xb814('0x77')]=0x0;this[_0xb814('0x78')]=0x1;this[_0xb814('0x79')]=0x0;this[_0xb814('0x7a')]=0x0;this['erlangAbandonmentRate']=0x0;this['erlangBusyFactor']=0x0;this[_0xb814('0x7b')]=_0x322a70[_0xb814('0x7b')]||0x1e;this[_0xb814('0x7c')]=_0x322a70[_0xb814('0x7c')]||![];this[_0xb814('0x7d')]=!!_0x322a70[_0xb814('0x7d')]||![];this[_0xb814('0x7e')]=!!_0x322a70[_0xb814('0x7e')]||![];this[_0xb814('0x7f')]=_0x322a70[_0xb814('0x7f')]||undefined;this[_0xb814('0x80')]=_0x322a70['dialAgiAfterHangupClient']||![];this[_0xb814('0x81')]=_0x322a70[_0xb814('0x81')]||![];this['monitor_format']=monitorFormat[_0x322a70[_0xb814('0xc')]]?monitorFormat[_0x322a70['monitor_format']]:undefined;this[_0xb814('0x82')]=_0x322a70[_0xb814('0x82')]||![];this[_0xb814('0x83')]=_0x322a70[_0xb814('0x83')]?_0x322a70[_0xb814('0x83')]:undefined;}module[_0xb814('0x84')]=VoiceQueue;
\ No newline at end of file
+var _0x9957=['outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayTimeout','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','erlangCalls','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','wav','wav49','gsm','fewestcalls','linear','random','ringall','roundrobin','rrordered','wrandom','name','monitor_format','type','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','available','busy','invalid','loggedIn','notInUse','onHold','paused','ringing','ringInUse','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','TrunkBackup','dialPrefix','Interval','DESC','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay'];(function(_0x274f14,_0x27dd7f){var _0x13b97e=function(_0x7d9432){while(--_0x7d9432){_0x274f14['push'](_0x274f14['shift']());}};_0x13b97e(++_0x27dd7f);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var monitorFormat={'wav':_0x7995('0x0'),'wav49':_0x7995('0x1'),'gsm':_0x7995('0x2')};var strategy={'fewestcalls':_0x7995('0x3'),'leastrecent':'leastrecent','linear':_0x7995('0x4'),'random':_0x7995('0x5'),'ringall':_0x7995('0x6'),'rr':_0x7995('0x7'),'rrmemory':'rrmemory','rrordered':_0x7995('0x8'),'wrandom':_0x7995('0x9')};function VoiceQueue(_0x137b6b){this['id']=_0x137b6b['id']||0x0;this[_0x7995('0xa')]=_0x137b6b[_0x7995('0xa')]||'';this[_0x7995('0xb')]=_0x137b6b['monitor_format']||'';this[_0x7995('0xc')]=_0x137b6b[_0x7995('0xc')]||'inbound';this[_0x7995('0xd')]=0x0;this[_0x7995('0xe')]=0x0;this[_0x7995('0xf')]=0x0;this[_0x7995('0x10')]=0x0;this[_0x7995('0x11')]=0x0;this[_0x7995('0x12')]=0x0;this[_0x7995('0x13')]=0x0;this['abandoned']=0x0;this[_0x7995('0x14')]=0x0;this[_0x7995('0x15')]=0x0;this['inUse']=0x0;this[_0x7995('0x16')]=0x0;this[_0x7995('0x17')]=0x0;this[_0x7995('0x18')]=0x0;this[_0x7995('0x19')]=0x0;this[_0x7995('0x1a')]=0x0;this[_0x7995('0x1b')]=0x0;this[_0x7995('0x1c')]=0x0;this['talking']=0x0;this['unavailable']=0x0;this[_0x7995('0x1d')]=0x0;this[_0x7995('0x1e')]=_0x137b6b[_0x7995('0x1e')]||![];this[_0x7995('0x1f')]=_0x137b6b[_0x7995('0x1f')]||0xa;this[_0x7995('0x20')]=_0x137b6b[_0x7995('0x20')]||'no';this[_0x7995('0x21')]=!![];this['message']='';this[_0x7995('0x22')]=0x0;this['temp']=0x0;this[_0x7995('0x23')]=_0x137b6b[_0x7995('0x23')]||null;this[_0x7995('0x24')]=_0x137b6b[_0x7995('0x24')]?_0x137b6b[_0x7995('0x24')]:null;this[_0x7995('0x25')]=_0x137b6b['dialActive'];this['dialMethod']=_0x137b6b[_0x7995('0x26')]||'progressive';this['dialLimitChannel']=_0x137b6b[_0x7995('0x27')]||0x0;this[_0x7995('0x28')]=_0x137b6b['dialLimitQueue']||0x0;this[_0x7995('0x29')]=_0x137b6b['dialPowerLevel']||0x1;this['dialPredictiveOptimization']=_0x137b6b[_0x7995('0x2a')]||_0x7995('0x2b');this[_0x7995('0x2c')]=_0x137b6b[_0x7995('0x2c')]||0.03;this[_0x7995('0x2d')]=_0x137b6b[_0x7995('0x2d')]||0x258;this['dialOriginateCallerIdName']=_0x137b6b[_0x7995('0x2e')]||_0x7995('0x2f');this[_0x7995('0x30')]=_0x137b6b[_0x7995('0x30')]||_0x7995('0x2f');this[_0x7995('0x31')]=_0x137b6b[_0x7995('0x31')]||0x1e;this[_0x7995('0x32')]=_0x137b6b['dialQueueOptions']||_0x7995('0x33');this[_0x7995('0x34')]=_0x137b6b[_0x7995('0x34')]||0x3;this[_0x7995('0x35')]=_0x137b6b[_0x7995('0x35')]||undefined;this[_0x7995('0x36')]=_0x137b6b['dialCongestionMaxRetry']||0x3;this[_0x7995('0x37')]=_0x137b6b['dialCongestionRetryFrequency']||0x96;this[_0x7995('0x38')]=_0x137b6b[_0x7995('0x38')]||0x3;this[_0x7995('0x39')]=_0x137b6b[_0x7995('0x39')]||0x96;this[_0x7995('0x3a')]=_0x137b6b['dialNoAnswerMaxRetry']||0x3;this[_0x7995('0x3b')]=_0x137b6b['dialNoAnswerRetryFrequency']||0x96;this[_0x7995('0x3c')]=_0x137b6b[_0x7995('0x3c')]||0x3;this[_0x7995('0x3d')]=_0x137b6b['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x137b6b['dialDropMaxRetry']||0x3;this[_0x7995('0x3e')]=_0x137b6b[_0x7995('0x3e')]||0x96;this[_0x7995('0x3f')]=_0x137b6b[_0x7995('0x3f')]||0x3;this[_0x7995('0x40')]=_0x137b6b[_0x7995('0x40')]||0x96;this['dialMachineMaxRetry']=_0x137b6b['dialMachineMaxRetry']||0x3;this[_0x7995('0x41')]=_0x137b6b['dialMachineRetryFrequency']||0x96;this[_0x7995('0x42')]=_0x137b6b[_0x7995('0x42')]||0x3;this[_0x7995('0x43')]=_0x137b6b[_0x7995('0x43')]||0x96;this[_0x7995('0x44')]=_0x137b6b['callAdditionalPhoneAfterMin']||0x3;this[_0x7995('0x45')]=_0x137b6b[_0x7995('0x45')]||0x4;this['Trunk']=_0x137b6b['Trunk']?_0x137b6b['Trunk']:undefined;this[_0x7995('0x46')]=_0x137b6b[_0x7995('0x46')]?_0x137b6b['TrunkBackup']:undefined;this[_0x7995('0x47')]=_0x137b6b['dialPrefix']||undefined;this[_0x7995('0x48')]=_0x137b6b[_0x7995('0x48')]?_0x137b6b[_0x7995('0x48')]:undefined;this['dialOrderByScheduledAt']=_0x137b6b['dialOrderByScheduledAt']||_0x7995('0x49');this['dialRandomLastDigitCallerIdNumber']=_0x137b6b['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x7995('0x4a')]=_0x137b6b[_0x7995('0x4a')]||undefined;this['strategy']=strategy[_0x137b6b[_0x7995('0x4b')]]||_0x7995('0x4c');this[_0x7995('0x4d')]=!![];this[_0x7995('0x4e')]=_0x137b6b[_0x7995('0x4e')]||![];this['dialAMDInitialSilence']=_0x137b6b[_0x7995('0x4f')];this[_0x7995('0x50')]=_0x137b6b[_0x7995('0x50')];this[_0x7995('0x51')]=_0x137b6b['dialAMDAfterGreetingSilence'];this[_0x7995('0x52')]=_0x137b6b[_0x7995('0x52')];this[_0x7995('0x53')]=_0x137b6b[_0x7995('0x53')];this[_0x7995('0x54')]=_0x137b6b[_0x7995('0x54')];this['dialAMDMaximumNumberOfWords']=_0x137b6b[_0x7995('0x55')];this[_0x7995('0x56')]=_0x137b6b[_0x7995('0x56')];this[_0x7995('0x57')]=_0x137b6b[_0x7995('0x57')];this[_0x7995('0x58')]=0x0;this[_0x7995('0x59')]=0x0;this[_0x7995('0x5a')]=_0x137b6b[_0x7995('0x5a')];this[_0x7995('0x5b')]=0x0;this[_0x7995('0x5c')]=0x0;this[_0x7995('0x5d')]=0x0;this[_0x7995('0x5e')]=0x0;this['outboundCongestionCallsDay']=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x7995('0x5f')]=0x0;this[_0x7995('0x60')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x7995('0x61')]=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this[_0x7995('0x62')]=0x0;this[_0x7995('0x63')]=undefined;this[_0x7995('0x64')]=undefined;this['handlePredictive']=undefined;this[_0x7995('0x65')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x7995('0x66')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x7995('0x67')]=0x0;this[_0x7995('0x68')]=0x0;this[_0x7995('0x69')]=0x0;this[_0x7995('0x6a')]=0x0;this['predictiveIntervalMaxThreshold']=_0x137b6b[_0x7995('0x6b')]||0x14;this[_0x7995('0x6c')]=_0x137b6b[_0x7995('0x6b')]||0xa;this[_0x7995('0x6d')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x7995('0x6e')]=0x0;this['erlangCallToSecond']=0x0;this[_0x7995('0x6f')]=0x0;this['erlangBusyFactor']=0x0;this[_0x7995('0x70')]=_0x137b6b['dialRecallMeTimeout']||0x1e;this[_0x7995('0x71')]=_0x137b6b[_0x7995('0x71')]||![];this['dialPreviewAutoRecallMe']=!!_0x137b6b[_0x7995('0x72')]||![];this[_0x7995('0x73')]=!!_0x137b6b[_0x7995('0x73')]||![];this[_0x7995('0x74')]=_0x137b6b['dialQueueProject2']||undefined;this[_0x7995('0x75')]=_0x137b6b[_0x7995('0x75')]||![];this[_0x7995('0x76')]=_0x137b6b['dialAgiAfterHangupAgent']||![];this[_0x7995('0xb')]=monitorFormat[_0x137b6b[_0x7995('0xb')]]?monitorFormat[_0x137b6b[_0x7995('0xb')]]:undefined;this[_0x7995('0x77')]=_0x137b6b[_0x7995('0x77')]||![];this['mandatoryDispositionPause']=_0x137b6b[_0x7995('0x78')]?_0x137b6b[_0x7995('0x78')]:undefined;}module['exports']=VoiceQueue;
\ No newline at end of file
index 4f108bb..6093bf6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7334=['waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','exports','name','strategy','answered','available','busy','inUse','invalid','loggedIn','loggedInDb','onHold','notInUse','paused','pTalking','ringing','ringInUse','sumBillable','sumDuration','sumHoldTime','talking','total','type','unavailable','unknown','unmanaged'];(function(_0x503ddb,_0x2fcf2c){var _0x534e94=function(_0x1bb934){while(--_0x1bb934){_0x503ddb['push'](_0x503ddb['shift']());}};_0x534e94(++_0x2fcf2c);}(_0x7334,0x18c));var _0x4733=function(_0x3740be,_0x57ed7a){_0x3740be=_0x3740be-0x0;var _0x4ca21c=_0x7334[_0x3740be];return _0x4ca21c;};'use strict';function VoiceQueueSummary(_0x35cd9c){this['id']=_0x35cd9c['id'];this[_0x4733('0x0')]=_0x35cd9c[_0x4733('0x0')];this[_0x4733('0x1')]=_0x35cd9c['strategy'];this['abandoned']=_0x35cd9c['abandoned']||0x0;this[_0x4733('0x2')]=_0x35cd9c['answered']||0x0;this[_0x4733('0x3')]=_0x35cd9c['available']||0x0;this[_0x4733('0x4')]=_0x35cd9c[_0x4733('0x4')]||0x0;this[_0x4733('0x5')]=_0x35cd9c[_0x4733('0x5')]||0x0;this[_0x4733('0x6')]=_0x35cd9c[_0x4733('0x6')]||0x0;this[_0x4733('0x7')]=_0x35cd9c[_0x4733('0x7')]||0x0;this[_0x4733('0x8')]=_0x35cd9c[_0x4733('0x8')]||0x0;this[_0x4733('0x9')]=_0x35cd9c[_0x4733('0x9')]||0x0;this[_0x4733('0xa')]=_0x35cd9c[_0x4733('0xa')]||0x0;this['paused']=_0x35cd9c[_0x4733('0xb')]||0x0;this[_0x4733('0xc')]=_0x35cd9c[_0x4733('0xc')]||0x0;this['ringing']=_0x35cd9c[_0x4733('0xd')]||0x0;this['ringInUse']=_0x35cd9c[_0x4733('0xe')];this[_0x4733('0xf')]=_0x35cd9c[_0x4733('0xf')];this[_0x4733('0x10')]=_0x35cd9c[_0x4733('0x10')];this[_0x4733('0x11')]=_0x35cd9c[_0x4733('0x11')]||0x0;this[_0x4733('0x12')]=_0x35cd9c[_0x4733('0x12')]||0x0;this[_0x4733('0x13')]=_0x35cd9c['total']||0x0;this[_0x4733('0x14')]=_0x35cd9c[_0x4733('0x14')];this[_0x4733('0x15')]=_0x35cd9c[_0x4733('0x15')]||0x0;this[_0x4733('0x16')]=_0x35cd9c[_0x4733('0x16')]||0x0;this['unmanaged']=_0x35cd9c[_0x4733('0x17')]||0x0;this['waiting']=_0x35cd9c[_0x4733('0x18')]||0x0;if(_0x35cd9c[_0x4733('0x14')]===_0x4733('0x19')){this[_0x4733('0x1a')]=_0x35cd9c[_0x4733('0x1a')];this[_0x4733('0x1b')]=_0x35cd9c[_0x4733('0x1b')];this[_0x4733('0x1c')]=_0x35cd9c[_0x4733('0x1c')];this[_0x4733('0x1d')]=_0x35cd9c[_0x4733('0x1d')];this['dialOriginateTimeout']=_0x35cd9c['dialOriginateTimeout'];this[_0x4733('0x1e')]=_0x35cd9c[_0x4733('0x1e')];this[_0x4733('0x1f')]=_0x35cd9c[_0x4733('0x1f')];this[_0x4733('0x20')]=_0x35cd9c[_0x4733('0x20')];this[_0x4733('0x21')]=_0x35cd9c[_0x4733('0x21')];this[_0x4733('0x22')]=_0x35cd9c[_0x4733('0x22')];this['outboundBusyCallsDay']=_0x35cd9c[_0x4733('0x23')];this[_0x4733('0x24')]=_0x35cd9c[_0x4733('0x24')];this[_0x4733('0x25')]=_0x35cd9c[_0x4733('0x25')];this[_0x4733('0x26')]=_0x35cd9c[_0x4733('0x26')];this['outboundDropCallsDayTimeout']=_0x35cd9c[_0x4733('0x27')];this[_0x4733('0x28')]=_0x35cd9c[_0x4733('0x28')];this[_0x4733('0x29')]=_0x35cd9c[_0x4733('0x29')];this[_0x4733('0x2a')]=_0x35cd9c[_0x4733('0x2a')];this['outboundReCallsDay']=_0x35cd9c[_0x4733('0x2b')];this['outboundRejectCallsDay']=_0x35cd9c['outboundRejectCallsDay'];this[_0x4733('0x2c')]=_0x35cd9c[_0x4733('0x2c')];this[_0x4733('0x2d')]=_0x35cd9c[_0x4733('0x2d')];this['predictiveIntervalAvgHoldtime']=_0x35cd9c[_0x4733('0x2e')];this[_0x4733('0x2f')]=_0x35cd9c['predictiveIntervalAvgTalktime'];this[_0x4733('0x30')]=_0x35cd9c['predictiveIntervalDroppedCallsCallersExit'];this['predictiveIntervalDroppedCallsTimeout']=_0x35cd9c[_0x4733('0x31')];this[_0x4733('0x32')]=_0x35cd9c[_0x4733('0x32')];this[_0x4733('0x33')]=_0x35cd9c[_0x4733('0x33')];this[_0x4733('0x34')]=_0x35cd9c['predictiveIntervalHitRate'];this['predictiveIntervalMultiplicativeFactor']=_0x35cd9c[_0x4733('0x35')];this[_0x4733('0x36')]=_0x35cd9c['predictiveIntervalPauses'];this[_0x4733('0x37')]=_0x35cd9c[_0x4733('0x37')];this[_0x4733('0x38')]=_0x35cd9c['predictiveIntervalTotalCalls'];this[_0x4733('0x39')]=_0x35cd9c[_0x4733('0x39')];this[_0x4733('0x3a')]=_0x35cd9c[_0x4733('0x3a')];this[_0x4733('0x3b')]=_0x35cd9c['erlangCalls'];this[_0x4733('0x3c')]=_0x35cd9c['erlangCallToSecond'];this[_0x4733('0x3d')]=_0x35cd9c[_0x4733('0x3d')];this[_0x4733('0x3e')]=_0x35cd9c[_0x4733('0x3e')];this[_0x4733('0x3f')]=_0x35cd9c[_0x4733('0x3f')];this[_0x4733('0x40')]=_0x35cd9c[_0x4733('0x40')];}if(_0x35cd9c['Trunk']){this[_0x4733('0x41')]={'id':_0x35cd9c[_0x4733('0x41')]['id'],'name':_0x35cd9c['Trunk'][_0x4733('0x0')],'active':_0x35cd9c[_0x4733('0x41')][_0x4733('0x42')],'callerid':_0x35cd9c['Trunk'][_0x4733('0x43')]};}if(_0x35cd9c['Interval']){this[_0x4733('0x44')]={'id':_0x35cd9c['Interval']['id'],'name':_0x35cd9c['Interval'][_0x4733('0x0')]};}}module[_0x4733('0x45')]=VoiceQueueSummary;
\ No newline at end of file
+var _0xe653=['sumDuration','sumHoldTime','talking','total','type','unavailable','unknown','unmanaged','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','name','strategy','abandoned','answered','available','busy','inUse','invalid','loggedIn','loggedInDb','onHold','notInUse','paused','pTalking','ringing','ringInUse','sumBillable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe653,0x1d2));var _0x3e65=function(_0x3050ca,_0x3e36b0){_0x3050ca=_0x3050ca-0x0;var _0x1eed1d=_0xe653[_0x3050ca];return _0x1eed1d;};'use strict';function VoiceQueueSummary(_0x2e375e){this['id']=_0x2e375e['id'];this[_0x3e65('0x0')]=_0x2e375e[_0x3e65('0x0')];this[_0x3e65('0x1')]=_0x2e375e[_0x3e65('0x1')];this[_0x3e65('0x2')]=_0x2e375e[_0x3e65('0x2')]||0x0;this['answered']=_0x2e375e[_0x3e65('0x3')]||0x0;this[_0x3e65('0x4')]=_0x2e375e[_0x3e65('0x4')]||0x0;this['busy']=_0x2e375e[_0x3e65('0x5')]||0x0;this[_0x3e65('0x6')]=_0x2e375e[_0x3e65('0x6')]||0x0;this['invalid']=_0x2e375e[_0x3e65('0x7')]||0x0;this[_0x3e65('0x8')]=_0x2e375e[_0x3e65('0x8')]||0x0;this[_0x3e65('0x9')]=_0x2e375e['loggedInDb']||0x0;this[_0x3e65('0xa')]=_0x2e375e[_0x3e65('0xa')]||0x0;this[_0x3e65('0xb')]=_0x2e375e[_0x3e65('0xb')]||0x0;this[_0x3e65('0xc')]=_0x2e375e['paused']||0x0;this['pTalking']=_0x2e375e[_0x3e65('0xd')]||0x0;this['ringing']=_0x2e375e[_0x3e65('0xe')]||0x0;this['ringInUse']=_0x2e375e[_0x3e65('0xf')];this[_0x3e65('0x10')]=_0x2e375e[_0x3e65('0x10')];this[_0x3e65('0x11')]=_0x2e375e[_0x3e65('0x11')];this[_0x3e65('0x12')]=_0x2e375e[_0x3e65('0x12')]||0x0;this[_0x3e65('0x13')]=_0x2e375e[_0x3e65('0x13')]||0x0;this[_0x3e65('0x14')]=_0x2e375e['total']||0x0;this[_0x3e65('0x15')]=_0x2e375e[_0x3e65('0x15')];this[_0x3e65('0x16')]=_0x2e375e[_0x3e65('0x16')]||0x0;this[_0x3e65('0x17')]=_0x2e375e[_0x3e65('0x17')]||0x0;this['unmanaged']=_0x2e375e[_0x3e65('0x18')]||0x0;this[_0x3e65('0x19')]=_0x2e375e['waiting']||0x0;if(_0x2e375e['type']==='outbound'){this[_0x3e65('0x1a')]=_0x2e375e['dialActive'];this['dialMethod']=_0x2e375e[_0x3e65('0x1b')];this['dialOriginateCallerIdName']=_0x2e375e[_0x3e65('0x1c')];this[_0x3e65('0x1d')]=_0x2e375e[_0x3e65('0x1d')];this[_0x3e65('0x1e')]=_0x2e375e[_0x3e65('0x1e')];this[_0x3e65('0x1f')]=_0x2e375e[_0x3e65('0x1f')];this['temp']=_0x2e375e[_0x3e65('0x20')];this[_0x3e65('0x21')]=_0x2e375e['outboundAnswerAgiCallsDay'];this[_0x3e65('0x22')]=_0x2e375e[_0x3e65('0x22')];this[_0x3e65('0x23')]=_0x2e375e[_0x3e65('0x23')];this['outboundBusyCallsDay']=_0x2e375e[_0x3e65('0x24')];this[_0x3e65('0x25')]=_0x2e375e[_0x3e65('0x25')];this['outboundDropCallsDayACS']=_0x2e375e['outboundDropCallsDayACS'];this['outboundDropCallsDayCallersExit']=_0x2e375e[_0x3e65('0x26')];this['outboundDropCallsDayTimeout']=_0x2e375e[_0x3e65('0x27')];this[_0x3e65('0x28')]=_0x2e375e[_0x3e65('0x28')];this[_0x3e65('0x29')]=_0x2e375e['outboundNoSuchCallsDay'];this[_0x3e65('0x2a')]=_0x2e375e['outboundOriginateFailureCallsDay'];this[_0x3e65('0x2b')]=_0x2e375e[_0x3e65('0x2b')];this[_0x3e65('0x2c')]=_0x2e375e['outboundRejectCallsDay'];this[_0x3e65('0x2d')]=_0x2e375e['outboundUnknownCallsDay'];this[_0x3e65('0x2e')]=_0x2e375e[_0x3e65('0x2e')];this[_0x3e65('0x2f')]=_0x2e375e[_0x3e65('0x2f')];this['predictiveIntervalAvgTalktime']=_0x2e375e[_0x3e65('0x30')];this[_0x3e65('0x31')]=_0x2e375e[_0x3e65('0x31')];this['predictiveIntervalDroppedCallsTimeout']=_0x2e375e[_0x3e65('0x32')];this[_0x3e65('0x33')]=_0x2e375e['predictiveIntervalErlangCalls'];this[_0x3e65('0x34')]=_0x2e375e[_0x3e65('0x34')];this['predictiveIntervalHitRate']=_0x2e375e[_0x3e65('0x35')];this[_0x3e65('0x36')]=_0x2e375e[_0x3e65('0x36')];this[_0x3e65('0x37')]=_0x2e375e[_0x3e65('0x37')];this[_0x3e65('0x38')]=_0x2e375e[_0x3e65('0x38')];this['predictiveIntervalTotalCalls']=_0x2e375e[_0x3e65('0x39')];this['message']=_0x2e375e[_0x3e65('0x3a')];this['originated']=_0x2e375e[_0x3e65('0x3b')];this[_0x3e65('0x3c')]=_0x2e375e[_0x3e65('0x3c')];this[_0x3e65('0x3d')]=_0x2e375e[_0x3e65('0x3d')];this[_0x3e65('0x3e')]=_0x2e375e[_0x3e65('0x3e')];this[_0x3e65('0x3f')]=_0x2e375e[_0x3e65('0x3f')];this['startPredictive']=_0x2e375e[_0x3e65('0x40')];this[_0x3e65('0x41')]=_0x2e375e['startProgressive'];}if(_0x2e375e[_0x3e65('0x42')]){this['Trunk']={'id':_0x2e375e[_0x3e65('0x42')]['id'],'name':_0x2e375e[_0x3e65('0x42')][_0x3e65('0x0')],'active':_0x2e375e[_0x3e65('0x42')][_0x3e65('0x43')],'callerid':_0x2e375e[_0x3e65('0x42')]['callerid']};}if(_0x2e375e['Interval']){this['Interval']={'id':_0x2e375e[_0x3e65('0x44')]['id'],'name':_0x2e375e[_0x3e65('0x44')][_0x3e65('0x0')]};}}module['exports']=VoiceQueueSummary;
\ No newline at end of file
index 9f4aa05..4a23a43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd62b=['remoteUri','serverUrl','Configurations','exports','name','accessKey'];(function(_0x12d812,_0x496bb7){var _0x3711ab=function(_0x3259da){while(--_0x3259da){_0x12d812['push'](_0x12d812['shift']());}};_0x3711ab(++_0x496bb7);}(_0xd62b,0x8e));var _0xbd62=function(_0x5f1617,_0x46277b){_0x5f1617=_0x5f1617-0x0;var _0x3af5da=_0xd62b[_0x5f1617];return _0x3af5da;};'use strict';function VtigerAccount(_0x554a8b){this['id']=_0x554a8b['id']||0x0;this[_0xbd62('0x0')]=_0x554a8b[_0xbd62('0x0')]||'';this['username']=_0x554a8b['username']||'';this[_0xbd62('0x1')]=_0x554a8b[_0xbd62('0x1')]||'';this[_0xbd62('0x2')]=_0x554a8b[_0xbd62('0x2')]||'';this[_0xbd62('0x3')]=_0x554a8b[_0xbd62('0x3')]||'';this['Configurations']=_0x554a8b[_0xbd62('0x4')]||{};}module[_0xbd62('0x5')]=VtigerAccount;
\ No newline at end of file
+var _0x2bc1=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x57dd21,_0x404866){var _0x20c5cd=function(_0xca3ef0){while(--_0xca3ef0){_0x57dd21['push'](_0x57dd21['shift']());}};_0x20c5cd(++_0x404866);}(_0x2bc1,0x13e));var _0x12bc=function(_0x17cf83,_0xc4951d){_0x17cf83=_0x17cf83-0x0;var _0x46e349=_0x2bc1[_0x17cf83];return _0x46e349;};'use strict';function VtigerAccount(_0x3cc6b2){this['id']=_0x3cc6b2['id']||0x0;this[_0x12bc('0x0')]=_0x3cc6b2[_0x12bc('0x0')]||'';this[_0x12bc('0x1')]=_0x3cc6b2[_0x12bc('0x1')]||'';this[_0x12bc('0x2')]=_0x3cc6b2[_0x12bc('0x2')]||'';this[_0x12bc('0x3')]=_0x3cc6b2[_0x12bc('0x3')]||'';this[_0x12bc('0x4')]=_0x3cc6b2[_0x12bc('0x4')]||'';this[_0x12bc('0x5')]=_0x3cc6b2[_0x12bc('0x5')]||{};}module[_0x12bc('0x6')]=VtigerAccount;
\ No newline at end of file
index 9f079a6..47979e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd361=['name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x16db09,_0x5399bd){var _0x114888=function(_0x3865f4){while(--_0x3865f4){_0x16db09['push'](_0x16db09['shift']());}};_0x114888(++_0x5399bd);}(_0xd361,0x1c3));var _0x1d36=function(_0x16c5f1,_0x45a3da){_0x16c5f1=_0x16c5f1-0x0;var _0x210941=_0xd361[_0x16c5f1];return _0x210941;};'use strict';function ZendeskAccount(_0x55788c){this['id']=_0x55788c['id']||0x0;this[_0x1d36('0x0')]=_0x55788c['name']||'';this[_0x1d36('0x1')]=_0x55788c['username']||'';this[_0x1d36('0x2')]=_0x55788c[_0x1d36('0x2')]||'';this[_0x1d36('0x3')]=_0x55788c[_0x1d36('0x3')]||'';this[_0x1d36('0x4')]=_0x55788c['remoteUri']||'';this[_0x1d36('0x5')]=_0x55788c['authType']||'';this[_0x1d36('0x6')]=_0x55788c[_0x1d36('0x6')]||_0x1d36('0x7');this[_0x1d36('0x8')]=_0x55788c['serverUrl']||'';this[_0x1d36('0x9')]=_0x55788c[_0x1d36('0x9')]||{};}module[_0x1d36('0xa')]=ZendeskAccount;
\ No newline at end of file
+var _0x1d7b=['token','remoteUri','authType','type','integrationTab','Configurations','name','username','password'];(function(_0x42bb6d,_0x412255){var _0x1db89b=function(_0x5da43a){while(--_0x5da43a){_0x42bb6d['push'](_0x42bb6d['shift']());}};_0x1db89b(++_0x412255);}(_0x1d7b,0x153));var _0xb1d7=function(_0x52416c,_0x3736e5){_0x52416c=_0x52416c-0x0;var _0x4e2c9a=_0x1d7b[_0x52416c];return _0x4e2c9a;};'use strict';function ZendeskAccount(_0x428499){this['id']=_0x428499['id']||0x0;this[_0xb1d7('0x0')]=_0x428499[_0xb1d7('0x0')]||'';this['username']=_0x428499[_0xb1d7('0x1')]||'';this[_0xb1d7('0x2')]=_0x428499[_0xb1d7('0x2')]||'';this['token']=_0x428499[_0xb1d7('0x3')]||'';this[_0xb1d7('0x4')]=_0x428499[_0xb1d7('0x4')]||'';this[_0xb1d7('0x5')]=_0x428499[_0xb1d7('0x5')]||'';this[_0xb1d7('0x6')]=_0x428499['type']||_0xb1d7('0x7');this['serverUrl']=_0x428499['serverUrl']||'';this[_0xb1d7('0x8')]=_0x428499[_0xb1d7('0x8')]||{};}module['exports']=ZendeskAccount;
\ No newline at end of file
index bf6dad8..03baf35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdea2=['zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','name','description','host'];(function(_0x5a9017,_0x4312fc){var _0x596e52=function(_0x35843d){while(--_0x35843d){_0x5a9017['push'](_0x5a9017['shift']());}};_0x596e52(++_0x4312fc);}(_0xdea2,0x15b));var _0x2dea=function(_0x15318c,_0x2e50e4){_0x15318c=_0x15318c-0x0;var _0x10d3ce=_0xdea2[_0x15318c];return _0x10d3ce;};'use strict';function ZohoAccount(_0x5e5393){this['id']=_0x5e5393['id']||0x0;this[_0x2dea('0x0')]=_0x5e5393[_0x2dea('0x0')]||'';this['description']=_0x5e5393[_0x2dea('0x1')]||'';this['host']=_0x5e5393[_0x2dea('0x2')]||'';this[_0x2dea('0x3')]=_0x5e5393[_0x2dea('0x3')]||'';this['clientId']=_0x5e5393[_0x2dea('0x4')]||'';this[_0x2dea('0x5')]=_0x5e5393[_0x2dea('0x5')]||'';this[_0x2dea('0x6')]=_0x5e5393[_0x2dea('0x6')]||'';this[_0x2dea('0x7')]=_0x5e5393[_0x2dea('0x7')]||'';this[_0x2dea('0x8')]=_0x5e5393[_0x2dea('0x8')]||'';this[_0x2dea('0x9')]=_0x5e5393[_0x2dea('0x9')]||{};}module['exports']=ZohoAccount;
\ No newline at end of file
+var _0x4b66=['serverUrl','code','refreshToken','Configurations','name','description','host','zone','clientId','clientSecret'];(function(_0x513ee4,_0x2a73b5){var _0x25ed79=function(_0x1440dc){while(--_0x1440dc){_0x513ee4['push'](_0x513ee4['shift']());}};_0x25ed79(++_0x2a73b5);}(_0x4b66,0x72));var _0x64b6=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4b66[_0x122ef9];return _0x42fba0;};'use strict';function ZohoAccount(_0x34af32){this['id']=_0x34af32['id']||0x0;this[_0x64b6('0x0')]=_0x34af32['name']||'';this[_0x64b6('0x1')]=_0x34af32[_0x64b6('0x1')]||'';this['host']=_0x34af32[_0x64b6('0x2')]||'';this[_0x64b6('0x3')]=_0x34af32[_0x64b6('0x3')]||'';this['clientId']=_0x34af32[_0x64b6('0x4')]||'';this[_0x64b6('0x5')]=_0x34af32['clientSecret']||'';this[_0x64b6('0x6')]=_0x34af32['serverUrl']||'';this[_0x64b6('0x7')]=_0x34af32[_0x64b6('0x7')]||'';this[_0x64b6('0x8')]=_0x34af32['refreshToken']||'';this[_0x64b6('0x9')]=_0x34af32[_0x64b6('0x9')]||{};}module['exports']=ZohoAccount;
\ No newline at end of file
index 242dd05..3c7c6a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a55=['countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','\x22%s\x22\x20<%s>','number','util','isNil','uniqueid','idContact','queue','type','campaigntype','dialAnswer','membername','Agent','format','SIP/%s','calleridname','Contact','firstName','lastName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry'];(function(_0x36ee10,_0x3e4e4b){var _0x1ae7e8=function(_0x138916){while(--_0x138916){_0x36ee10['push'](_0x36ee10['shift']());}};_0x1ae7e8(++_0x3e4e4b);}(_0x6a55,0xdb));var _0x56a5=function(_0x3bc82d,_0x59187f){_0x3bc82d=_0x3bc82d-0x0;var _0x2cfb3d=_0x6a55[_0x3bc82d];return _0x2cfb3d;};'use strict';var util=require(_0x56a5('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x4ec858,_0x173b37,_0x47b337){var _0x561353='';if(!_[_0x56a5('0x1')](_0x173b37)&&'string'===typeof _0x173b37){_0x561353+=_0x173b37;}if(!_[_0x56a5('0x1')](_0x47b337)&&'string'===typeof _0x47b337){_0x561353+='\x20'+_0x47b337;}if(_0x561353!==''){return _0x561353;}return _0x4ec858;}function Action(_0x28bb2b,_0x380b1b,_0x42d164,_0x293ea1,_0x444c65){this[_0x56a5('0x2')]=_0x42d164||undefined;this[_0x56a5('0x3')]=_0x28bb2b['id'];this[_0x56a5('0x4')]=_0x380b1b['name'];this[_0x56a5('0x5')]=_0x380b1b[_0x56a5('0x5')];this[_0x56a5('0x6')]=_0x56a5('0x4');this[_0x56a5('0x7')]=![];this[_0x56a5('0x8')]=_[_0x56a5('0x1')](_0x28bb2b[_0x56a5('0x9')])?undefined:_0x28bb2b[_0x56a5('0x9')]['name'];this['channelAgent']=this[_0x56a5('0x8')]?util[_0x56a5('0xa')](_0x56a5('0xb'),this[_0x56a5('0x8')]):_0x293ea1||undefined;this[_0x56a5('0xc')]=checkNameSurname(_0x28bb2b[_0x56a5('0xd')]['phone'],_0x28bb2b['Contact'][_0x56a5('0xe')],_0x28bb2b[_0x56a5('0xd')][_0x56a5('0xf')]);this[_0x56a5('0x10')]=_0x28bb2b[_0x56a5('0x10')]||![];this[_0x56a5('0x11')]=_0x28bb2b[_0x56a5('0x12')];this['scheduledat']=_0x28bb2b[_0x56a5('0x13')];this['countbusyretry']=_0x28bb2b[_0x56a5('0x14')]||0x0;this['countcongestionretry']=_0x28bb2b[_0x56a5('0x15')]||0x0;this[_0x56a5('0x16')]=_0x28bb2b[_0x56a5('0x16')]||0x0;this[_0x56a5('0x17')]=(_0x28bb2b[_0x56a5('0x14')]||0x0)+(_0x28bb2b[_0x56a5('0x15')]||0x0)+(_0x28bb2b[_0x56a5('0x16')]||0x0)+(_0x28bb2b['countnosuchnumberretry']||0x0)+(_0x28bb2b[_0x56a5('0x18')]||0x0)+(_0x28bb2b[_0x56a5('0x19')]||0x0)+(_0x28bb2b[_0x56a5('0x1a')]||0x0)+(_0x28bb2b[_0x56a5('0x1b')]||0x0);this['countnosuchnumberretry']=_0x28bb2b[_0x56a5('0x1c')]||0x0;this[_0x56a5('0x18')]=_0x28bb2b[_0x56a5('0x18')]||0x0;this[_0x56a5('0x19')]=_0x28bb2b[_0x56a5('0x19')]||0x0;this['countmachineretry']=_0x28bb2b['countmachineretry']||0x0;this[_0x56a5('0x1b')]=_0x28bb2b[_0x56a5('0x1b')]||0x0;this['callback']=_0x28bb2b[_0x56a5('0x1d')];this[_0x56a5('0x1e')]=_0x28bb2b[_0x56a5('0x1e')];this[_0x56a5('0x1f')]=_0x28bb2b[_0x56a5('0x1f')];this[_0x56a5('0x20')]=_0x28bb2b[_0x56a5('0x20')];this[_0x56a5('0x21')]=_0x28bb2b[_0x56a5('0x21')];this[_0x56a5('0x22')]=_0x28bb2b[_0x56a5('0x22')];this[_0x56a5('0x23')]=_[_0x56a5('0x1')](_0x28bb2b['Agent'])?_0x28bb2b[_0x56a5('0x23')]:_0x28bb2b[_0x56a5('0x9')]['id'];this[_0x56a5('0x24')]=_0x28bb2b[_0x56a5('0x24')];this[_0x56a5('0x25')]='';this['originatecalleridname']='';}Action[_0x56a5('0x26')]['getCaller']=function(){return util[_0x56a5('0xa')](_0x56a5('0x27'),this[_0x56a5('0xc')],this[_0x56a5('0x28')]);};module['exports']=Action;
\ No newline at end of file
+var _0x1967=['type','campaigntype','queue','Agent','channelAgent','membername','format','SIP/%s','calleridname','Contact','firstName','lastName','active','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','prototype','getCaller','exports','lodash','moment','isNil','string','uniqueid','idContact','name'];(function(_0xd93b26,_0x12bbf2){var _0x25f668=function(_0x133ff7){while(--_0x133ff7){_0xd93b26['push'](_0xd93b26['shift']());}};_0x25f668(++_0x12bbf2);}(_0x1967,0x173));var _0x7196=function(_0x2b7fb9,_0x1e10c6){_0x2b7fb9=_0x2b7fb9-0x0;var _0x34c143=_0x1967[_0x2b7fb9];return _0x34c143;};'use strict';var util=require('util');var _=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));function checkNameSurname(_0x4d0a98,_0x35803d,_0x3319fa){var _0xa80a3f='';if(!_[_0x7196('0x2')](_0x35803d)&&_0x7196('0x3')===typeof _0x35803d){_0xa80a3f+=_0x35803d;}if(!_[_0x7196('0x2')](_0x3319fa)&&_0x7196('0x3')===typeof _0x3319fa){_0xa80a3f+='\x20'+_0x3319fa;}if(_0xa80a3f!==''){return _0xa80a3f;}return _0x4d0a98;}function Action(_0x5c128f,_0x36b01e,_0x186175,_0x194746,_0x40e0af){this[_0x7196('0x4')]=_0x186175||undefined;this[_0x7196('0x5')]=_0x5c128f['id'];this['queue']=_0x36b01e[_0x7196('0x6')];this[_0x7196('0x7')]=_0x36b01e[_0x7196('0x7')];this[_0x7196('0x8')]=_0x7196('0x9');this['dialAnswer']=![];this['membername']=_[_0x7196('0x2')](_0x5c128f[_0x7196('0xa')])?undefined:_0x5c128f[_0x7196('0xa')][_0x7196('0x6')];this[_0x7196('0xb')]=this[_0x7196('0xc')]?util[_0x7196('0xd')](_0x7196('0xe'),this[_0x7196('0xc')]):_0x194746||undefined;this[_0x7196('0xf')]=checkNameSurname(_0x5c128f[_0x7196('0x10')]['phone'],_0x5c128f[_0x7196('0x10')][_0x7196('0x11')],_0x5c128f[_0x7196('0x10')][_0x7196('0x12')]);this['active']=_0x5c128f[_0x7196('0x13')]||![];this['calleridnum']=_0x5c128f[_0x7196('0x14')];this[_0x7196('0x15')]=_0x5c128f[_0x7196('0x15')];this[_0x7196('0x16')]=_0x5c128f[_0x7196('0x16')]||0x0;this[_0x7196('0x17')]=_0x5c128f[_0x7196('0x17')]||0x0;this[_0x7196('0x18')]=_0x5c128f[_0x7196('0x18')]||0x0;this[_0x7196('0x19')]=(_0x5c128f[_0x7196('0x16')]||0x0)+(_0x5c128f['countcongestionretry']||0x0)+(_0x5c128f['countnoanswerretry']||0x0)+(_0x5c128f[_0x7196('0x1a')]||0x0)+(_0x5c128f[_0x7196('0x1b')]||0x0)+(_0x5c128f[_0x7196('0x1c')]||0x0)+(_0x5c128f['countmachineretry']||0x0)+(_0x5c128f[_0x7196('0x1d')]||0x0);this['countnosuchnumberretry']=_0x5c128f['countnosuchnumberretry']||0x0;this[_0x7196('0x1b')]=_0x5c128f[_0x7196('0x1b')]||0x0;this[_0x7196('0x1c')]=_0x5c128f['countabandonedretry']||0x0;this['countmachineretry']=_0x5c128f[_0x7196('0x1e')]||0x0;this[_0x7196('0x1d')]=_0x5c128f['countagentrejectretry']||0x0;this[_0x7196('0x1f')]=_0x5c128f[_0x7196('0x1f')];this[_0x7196('0x20')]=_0x5c128f[_0x7196('0x20')];this[_0x7196('0x21')]=_0x5c128f['callbackat'];this[_0x7196('0x22')]=_0x5c128f['recallme'];this[_0x7196('0x23')]=_0x5c128f[_0x7196('0x23')];this[_0x7196('0x24')]=_0x5c128f[_0x7196('0x24')];this[_0x7196('0x25')]=_[_0x7196('0x2')](_0x5c128f['Agent'])?_0x5c128f['UserId']:_0x5c128f[_0x7196('0xa')]['id'];this[_0x7196('0x26')]=_0x5c128f[_0x7196('0x26')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x7196('0x27')][_0x7196('0x28')]=function(){return util[_0x7196('0xd')]('\x22%s\x22\x20<%s>',this[_0x7196('0xf')],this['number']);};module[_0x7196('0x29')]=Action;
\ No newline at end of file
index a55e87f..364cbbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7278=['variable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfer','util','lodash','uuid','moment','md5','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','prototype','enqueue','tail','finally','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','attendedtransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','available','pTalking','sumBillable','talking','total','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','DEACTIVATED','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','sequence','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','ListId','Action','status','catch','updateOriginated','[clearZombieChannel]','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','size','then','length','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','loggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','ACTIVE','outboundNoSuchCallsDay','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','linkedid','actioncountonusuch','incrementPreviewCounters','swapAdditionalPhones','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','custom:agentconnect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','decrementTalkink','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','sumDuration','talktime','uniqueid','\x20Queue','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','busy','additional','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','unlockAgent','activeContact','idContact','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerMaxRetry','CONGESTION','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','countcongestionretry','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','dialAgentRejectRetryFrequency','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','[callProgressDetectingAgent][logNoSuch]','logAgent','[callProgressDetectingAgent][logNoAnswer]','createAgentHistory','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','isEmpty','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','custom:agentcalled','Call\x20failed','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','execRun','unlock','unlockContact','recallme','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','isActive','\x20Not\x20Active','SIP/%s/%s%s','dialPrefix','substring','dialCutDigit','trim','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','channel','actionid','lookAgent','clone','isFailure','response','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','[syncHangup][talking][transfer]','destuniqueid','addVariable','syncVarSet','filterKey','keys'];(function(_0x4e74e2,_0x433d73){var _0x13ee43=function(_0x232da9){while(--_0x232da9){_0x4e74e2['push'](_0x4e74e2['shift']());}};_0x13ee43(++_0x433d73);}(_0x7278,0x161));var _0x8727=function(_0x7a2fe,_0x25f282){_0x7a2fe=_0x7a2fe-0x0;var _0x355257=_0x7278[_0x7a2fe];return _0x355257;};'use strict';var util=require(_0x8727('0x0'));var _=require(_0x8727('0x1'));var uuid=require(_0x8727('0x2'));var moment=require(_0x8727('0x3'));var md5=require(_0x8727('0x4'));var Redis=require('ioredis');var config=require(_0x8727('0x5'));var logger=require(_0x8727('0x6'))(_0x8727('0x7'));var loggerAction=require(_0x8727('0x6'))(_0x8727('0x8'));var ami=require(_0x8727('0x9'));var rpcDb=require(_0x8727('0xa'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x8727('0xb'));var ut=require(_0x8727('0xc'));config[_0x8727('0xd')]=_[_0x8727('0xe')](config[_0x8727('0xd')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x8727('0xf')][_0x8727('0x10')]=function(_0x3a6c9b){this[_0x8727('0x11')]=this[_0x8727('0x11')]?this[_0x8727('0x11')][_0x8727('0x12')](_0x3a6c9b):_0x3a6c9b();};function Preview(_0xefa0bf){this['sequence']=new Sequence();this[_0x8727('0x13')]=_0xefa0bf[_0x8727('0x14')];this[_0x8727('0x15')]=_0xefa0bf['trunks'];this[_0x8727('0x16')]={};this[_0x8727('0x17')]=_0xefa0bf['agents'];this[_0x8727('0x18')]=0x0;ami['on'](_0x8727('0x19'),this[_0x8727('0x1a')][_0x8727('0x1b')](this));ami['on'](_0x8727('0x1c'),this[_0x8727('0x1d')][_0x8727('0x1b')](this));ami['on'](_0x8727('0x1e'),this[_0x8727('0x1f')][_0x8727('0x1b')](this));ami['on']('dialend',this[_0x8727('0x20')][_0x8727('0x1b')](this));ami['on'](_0x8727('0x21'),this[_0x8727('0x22')][_0x8727('0x1b')](this));ami['on'](_0x8727('0x23'),this['syncVarSet']['bind'](this));ami['on'](_0x8727('0x24'),this['syncAttendedTransfer'][_0x8727('0x1b')](this));ami['on'](_0x8727('0x25'),this[_0x8727('0x26')][_0x8727('0x1b')](this));this[_0x8727('0x27')](this['campaignsPreview']);}function emit(_0x6e552f,_0x286856,_0x8cde82){io['to'](_0x6e552f)[_0x8727('0x28')](_0x286856,_0x8cde82);}function emitCampaignPreview(_0x2fe8ba){if(_0x2fe8ba[_0x8727('0x29')]===_0x8727('0x2a')){var _0x441cc0={'id':_0x2fe8ba['id'],'name':_0x2fe8ba[_0x8727('0x2b')],'strategy':_0x2fe8ba[_0x8727('0x2c')],'answered':_0x2fe8ba[_0x8727('0x2d')],'available':_0x2fe8ba[_0x8727('0x2e')],'loggedIn':_0x2fe8ba['loggedIn'],'pTalking':_0x2fe8ba[_0x8727('0x2f')],'sumBillable':_0x2fe8ba[_0x8727('0x30')],'sumDuration':_0x2fe8ba['sumDuration'],'sumHoldTime':_0x2fe8ba['sumHoldTime']||0x0,'talking':_0x2fe8ba[_0x8727('0x31')],'total':_0x2fe8ba[_0x8727('0x32')],'type':_0x2fe8ba[_0x8727('0x29')],'unmanaged':_0x2fe8ba['unmanaged'],'abandoned':_0x2fe8ba[_0x8727('0x33')],'waiting':_0x2fe8ba[_0x8727('0x34')],'loggedInDb':_0x2fe8ba[_0x8727('0x35')],'dialActive':_0x2fe8ba[_0x8727('0x36')],'dialMethod':_0x2fe8ba[_0x8727('0x37')],'dialOriginateCallerIdName':_0x2fe8ba[_0x8727('0x38')],'dialOriginateCallerIdNumber':_0x2fe8ba[_0x8727('0x39')],'dialOriginateTimeout':_0x2fe8ba[_0x8727('0x3a')],'dialPrefix':_0x2fe8ba['dialPrefix'],'outboundAnswerAgiCallsDay':_0x2fe8ba[_0x8727('0x3b')],'outboundAnswerCallsDay':_0x2fe8ba[_0x8727('0x3c')],'outboundBlacklistCallsDay':_0x2fe8ba['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x2fe8ba[_0x8727('0x3d')],'outboundCongestionCallsDay':_0x2fe8ba[_0x8727('0x3e')],'outboundDropCallsDayACS':_0x2fe8ba[_0x8727('0x3f')],'outboundDropCallsDayCallersExit':_0x2fe8ba[_0x8727('0x40')],'outboundDropCallsDayTimeout':_0x2fe8ba[_0x8727('0x41')],'outboundNoAnswerCallsDay':_0x2fe8ba[_0x8727('0x42')],'outboundNoSuchCallsDay':_0x2fe8ba['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x2fe8ba[_0x8727('0x43')],'outboundReCallsDay':_0x2fe8ba['outboundReCallsDay'],'outboundRejectCallsDay':_0x2fe8ba[_0x8727('0x44')],'outboundUnknownCallsDay':_0x2fe8ba['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x2fe8ba[_0x8727('0x45')],'predictiveIntervalAnsweredCalls':_0x2fe8ba[_0x8727('0x46')],'predictiveIntervalAvgHoldtime':_0x2fe8ba[_0x8727('0x47')],'predictiveIntervalAvgTalktime':_0x2fe8ba[_0x8727('0x48')],'predictiveIntervalDroppedCallsCallersExit':_0x2fe8ba[_0x8727('0x49')],'predictiveIntervalDroppedCallsTimeout':_0x2fe8ba[_0x8727('0x4a')],'predictiveIntervalErlangCalls':_0x2fe8ba[_0x8727('0x4b')],'predictiveIntervalErlangCallsDroppedCalls':_0x2fe8ba['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x2fe8ba[_0x8727('0x4c')],'predictiveIntervalMultiplicativeFactor':_0x2fe8ba[_0x8727('0x4d')],'predictiveIntervalPauses':_0x2fe8ba[_0x8727('0x4e')],'predictiveIntervalAvailable':_0x2fe8ba[_0x8727('0x4f')],'predictiveIntervalTotalCalls':_0x2fe8ba[_0x8727('0x50')],'message':_0x2fe8ba[_0x8727('0x51')],'originated':_0x2fe8ba[_0x8727('0x52')],'erlangCalls':_0x2fe8ba[_0x8727('0x53')],'erlangCallToSecond':_0x2fe8ba[_0x8727('0x54')],'erlangAbandonmentRate':_0x2fe8ba[_0x8727('0x55')],'erlangBusyFactor':_0x2fe8ba[_0x8727('0x56')],'startPredictive':_0x2fe8ba[_0x8727('0x57')],'startProgressive':_0x2fe8ba['startProgressive']};if(_0x2fe8ba['Trunk']){_0x441cc0[_0x8727('0x58')]={'id':_0x2fe8ba[_0x8727('0x58')]['id'],'name':_0x2fe8ba[_0x8727('0x58')][_0x8727('0x2b')],'active':_0x2fe8ba['Trunk'][_0x8727('0x59')],'callerid':_0x2fe8ba[_0x8727('0x58')][_0x8727('0x5a')]};}if(_0x2fe8ba[_0x8727('0x5b')]){_0x441cc0[_0x8727('0x5b')]={'id':_0x2fe8ba['Interval']['id'],'name':_0x2fe8ba[_0x8727('0x5b')][_0x8727('0x2b')]};}var _0x8e9de8=md5(JSON[_0x8727('0x5c')](_0x441cc0));if(_0x2fe8ba[_0x8727('0x4')]!==_0x8e9de8){_0x2fe8ba[_0x8727('0x4')]=_0x8e9de8;emit(util[_0x8727('0x5d')](_0x8727('0x5e'),_0x441cc0[_0x8727('0x2b')]),_0x8727('0x5f'),_0x441cc0);}}}function emitVoiceQueueChannelRemove(_0x396f12){logger[_0x8727('0x60')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x8727('0x5c')](_0x396f12));emit(util[_0x8727('0x5d')](_0x8727('0x5e'),_0x396f12[_0x8727('0x2b')]),_0x8727('0x61'),_0x396f12);io[_0x8727('0x28')](_0x8727('0x62'),_0x396f12);}function notSendMessagesQueue(_0x41b08e){if(_0x41b08e[_0x8727('0x63')]){if(_0x41b08e[_0x8727('0x52')]===0x0&&_0x41b08e[_0x8727('0x2f')]===0x0){_0x41b08e[_0x8727('0x63')]=![];_0x41b08e[_0x8727('0x2e')]=0x0;_0x41b08e[_0x8727('0x64')]=0x0;_0x41b08e['message']=_0x8727('0x65');ut[_0x8727('0x66')](_0x8727('0x67'),_0x41b08e['name']+_0x8727('0x68'));}else{_0x41b08e[_0x8727('0x51')]=_0x8727('0x69');ut[_0x8727('0x66')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x41b08e[_0x8727('0x2b')]+_0x8727('0x6a'));}emitCampaignPreview(_0x41b08e);}}Preview[_0x8727('0xf')][_0x8727('0x27')]=function(){var _0x16b870=this;setInterval(function(){_0x16b870[_0x8727('0x6b')]();},0x7cf);};Preview[_0x8727('0xf')][_0x8727('0x6b')]=function(){var _0x3aac97=this[_0x8727('0x13')];this['clockClearZombieChannels']+=0x1;for(var _0x307785 in _0x3aac97){if(_0x3aac97[_0x8727('0x6c')](_0x307785)&&(_0x3aac97[_0x307785][_0x8727('0x37')]===_0x8727('0x7')||_0x3aac97[_0x307785][_0x8727('0x37')]==='booked')&&_0x3aac97[_0x307785][_0x8727('0x29')]===_0x8727('0x2a')){if(this[_0x8727('0x18')]>0x7){this['clockClearZombieChannels']=0x0;this[_0x8727('0x6d')]();}}if(_0x3aac97[_0x8727('0x6c')](_0x307785)&&_0x3aac97[_0x307785][_0x8727('0x37')]===_0x8727('0x7')&&_0x3aac97[_0x307785][_0x8727('0x29')]===_0x8727('0x2a')){if(_0x3aac97[_0x307785]['dialActive']){this[_0x8727('0x6e')](_0x3aac97[_0x307785]);if(_0x3aac97[_0x307785][_0x8727('0x6f')])this[_0x8727('0x70')](_0x3aac97[_0x307785]);}else{notSendMessagesQueue(_0x3aac97[_0x307785]);}}}};Preview['prototype'][_0x8727('0x71')]=function(_0x3e6aee){var _0x976ebc=this;this[_0x8727('0x72')][_0x8727('0x10')](function(){if(!_[_0x8727('0x73')](_0x976ebc[_0x8727('0x16')][_0x3e6aee])){loggerAction['info'](_0x8727('0x74'),_0x3e6aee,_0x8727('0x75'),_0x976ebc[_0x8727('0x16')][_0x3e6aee][_0x8727('0x76')],_0x8727('0x77'),JSON[_0x8727('0x5c')](_0x976ebc[_0x8727('0x13')][_0x976ebc['actions'][_0x3e6aee][_0x8727('0x76')]][_0x8727('0x52')]),_0x8727('0x78'),JSON['stringify'](_0x976ebc[_0x8727('0x13')][_0x976ebc[_0x8727('0x16')][_0x3e6aee][_0x8727('0x76')]][_0x8727('0x2f')]),JSON[_0x8727('0x5c')](_0x976ebc[_0x8727('0x16')][_0x3e6aee][_0x8727('0x79')]),JSON['stringify'](_[_0x8727('0x7a')](_0x976ebc['actions'][_0x3e6aee],[_0x8727('0x7b'),_0x8727('0x7c'),'VoiceQueueId',_0x8727('0x7d')])));return ami[_0x8727('0x7e')]({'action':_0x8727('0x7f'),'channel':_0x976ebc['actions'][_0x3e6aee]['channel']})[_0x8727('0x80')](function(_0x1486ca){if(_0x1486ca[_0x8727('0x51')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x976ebc[_0x8727('0x16')][_0x3e6aee]){ut[_0x8727('0x81')](_0x976ebc[_0x8727('0x13')][_0x976ebc[_0x8727('0x16')][_0x3e6aee][_0x8727('0x76')]],_0x8727('0x82'));if(_0x976ebc[_0x8727('0x16')][_0x3e6aee][_0x8727('0x79')]===!![]){ut['decrementTalkink'](_0x976ebc[_0x8727('0x13')][_0x976ebc[_0x8727('0x16')][_0x3e6aee][_0x8727('0x76')]],_0x8727('0x82'));ut['loggerError'](_0x8727('0x83')+_0x3e6aee,_0x976ebc[_0x8727('0x16')][_0x3e6aee][_0x8727('0x76')]);}ut[_0x8727('0x84')](_0x8727('0x85')+_0x3e6aee,_0x976ebc[_0x8727('0x16')][_0x3e6aee][_0x8727('0x76')]);delete _0x976ebc[_0x8727('0x16')][_0x3e6aee];}},0x2328);}});}});};Preview['prototype'][_0x8727('0x6d')]=function(){var _0x291b3e=this;loggerAction[_0x8727('0x60')]('[action]',_[_0x8727('0x86')](this['actions']));for(var _0x41cb0e in this['actions']){if(_0x291b3e[_0x8727('0x16')][_0x8727('0x6c')](_0x41cb0e)){_0x291b3e['clearZombieChannel'](_0x41cb0e);}}};Preview[_0x8727('0xf')][_0x8727('0x70')]=function(_0x105a9d){var _0x5b0ee9=this;rpcDb['getContactRecallMe'](_0x105a9d['id'],ut['agentReadyId'](this['agents']))[_0x8727('0x87')](function(_0x41fdad){if(!_[_0x8727('0x73')](_0x41fdad)){for(var _0x7e15b0=0x0;_0x7e15b0<_0x41fdad[_0x8727('0x88')];_0x7e15b0+=0x1){if(ut['getDiff'](_0x41fdad[_0x7e15b0]['scheduledat'])<_0x105a9d[_0x8727('0x89')]*0x3c){if(_0x41fdad[_0x7e15b0][_0x8727('0x8a')]&&!_0x41fdad[_0x7e15b0][_0x8727('0x8a')][_0x8727('0x8b')]){_0x5b0ee9[_0x8727('0x8c')](_0x41fdad[_0x7e15b0]['id'])[_0x8727('0x87')](ut[_0x8727('0x8d')](_0x8727('0x8e')))[_0x8727('0x80')](ut[_0x8727('0x8d')](_0x8727('0x8e')));}else{rpcDb[_0x8727('0x8f')](_0x41fdad[_0x7e15b0]['id']);}}else{var _0x508fc9=new Action(_0x41fdad[_0x7e15b0],_0x105a9d);_0x508fc9[_0x8727('0x90')]=moment()[_0x8727('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x105a9d['outboundReCallsDay']+=0x1;ut['logCustomer'](_0x508fc9,0x17,'RecallInQueue');if(_0x105a9d[_0x8727('0x91')]){rpcDb[_0x8727('0x92')](ut['createBody'](_0x41fdad[_0x7e15b0]));rpcDb[_0x8727('0x93')](_0x508fc9,_0x8727('0x94'));}else{ut[_0x8727('0x95')](_0x508fc9,0x16,_0x8727('0x96'));rpcDb[_0x8727('0x93')](_0x508fc9,'[HistoryRecallClose]');rpcDb[_0x8727('0x97')](_0x508fc9,_0x8727('0x98'));}}}}})[_0x8727('0x80')](ut[_0x8727('0x8d')](_0x8727('0x99')));};Preview[_0x8727('0xf')][_0x8727('0x6e')]=function(_0x190f0d){_0x190f0d[_0x8727('0x63')]=!![];if(ut['IsNotLoggedIn'](_0x190f0d[_0x8727('0x9a')])){_0x190f0d[_0x8727('0x51')]=_0x8727('0x9b');}else if(!ut['isActive'](_0x190f0d[_0x8727('0x36')])){_0x190f0d['message']=_0x8727('0x65');}else if(!this[_0x8727('0x9c')](_0x190f0d[_0x8727('0x58')])){if(!this[_0x8727('0x9c')](_0x190f0d[_0x8727('0x9d')])){_0x190f0d['message']='TRUNK_IS_NOT_REACHABLE';}else{_0x190f0d[_0x8727('0x51')]=_0x8727('0x9e');}}else{_0x190f0d[_0x8727('0x51')]=_0x8727('0x9e');}emitCampaignPreview(_0x190f0d);};Preview[_0x8727('0xf')]['callProgressDetectingCustomer']=function(_0x29da1c,_0x56a275,_0x24196b){var _0x55f8a2=this;var _0x5c9024=this[_0x8727('0x16')][_0x56a275];var _0x2d7dd3=this[_0x8727('0x13')][_0x5c9024[_0x8727('0x76')]];var _0x2a92d6;var _0x5c0c1b=![];var _0x4de3f0=0x2;var _0x1a16f8=0x3;if(_0x2d7dd3){switch(_0x24196b){case'1':_0x2d7dd3[_0x8727('0x9f')]+=0x1;_0x5c9024['countnosuchnumberretry']+=0x1;_0x5c9024[_0x8727('0xa0')]=ut[_0x8727('0xa1')](_0x5c9024);ut[_0x8727('0x95')](_0x5c9024,0x0,_0x8727('0xa2'));ami['emit'](_0x8727('0xa3'),ut[_0x8727('0xa4')](_0x5c9024,_0x8727('0xa5')));rpcDb[_0x8727('0x93')](_0x5c9024,_0x8727('0xa6'));_0x55f8a2[_0x8727('0xa7')](_0x5c9024,'0',_0x2d7dd3)[_0x8727('0x87')](function(_0x4a75ec){_0x5c0c1b=_0x4a75ec['additional']==0x1;_0x4de3f0=_0x2d7dd3['dialNoSuchNumberRetryFrequency'];_0x1a16f8=_0x2d7dd3[_0x8727('0xa8')];if(!_0x5c0c1b){if(ut[_0x8727('0xa1')](_0x5c9024)>=_0x2d7dd3[_0x8727('0xa9')]){_0x2a92d6=ut[_0x8727('0xaa')](_0x5c9024,0xf,_0x8727('0xab'));rpcDb[_0x8727('0x97')](_0x2a92d6,_0x8727('0xac'));}else{if(_0x5c9024[_0x8727('0xad')]>=_0x2d7dd3[_0x8727('0xae')]){rpcDb[_0x8727('0x97')](_0x5c9024,_0x8727('0xac'));}else{rpcDb[_0x8727('0xaf')](ut[_0x8727('0xb0')](_0x5c9024,_0x8727('0xad'),_0x2d7dd3[_0x8727('0xb1')]),_0x5c9024['unlockAgent'],_0x5c9024['activeContact']);}}delete this['actions'][_0x29da1c[_0x8727('0xb2')]];}else{_0x5c9024[_0x8727('0xad')]++;logger['info'](_0x8727('0xb3'),_0x5c9024[_0x8727('0xad')]);logger[_0x8727('0x60')]('id',_0x5c9024['idContact']);_0x55f8a2[_0x8727('0xb4')]({'id':_0x5c9024['idContact'],'field':{'countnosuchnumberretry':_0x5c9024[_0x8727('0xad')]}})[_0x8727('0x87')](function(){_0x55f8a2[_0x8727('0xb5')](_0x5c9024,_0x4de3f0,_0x1a16f8)['then'](function(){});});}});break;case'ANSWER':var _0x3519d1=moment()[_0x8727('0x5d')](_0x8727('0xb6'));_0x5c9024[_0x8727('0xb7')]=_0x3519d1;_0x5c9024[_0x8727('0xb8')]=_0x3519d1;_0x5c9024[_0x8727('0x79')]=!![];_0x2d7dd3[_0x8727('0x2f')]+=0x1;logger[_0x8727('0x60')]('[syncHangup][talking][increment]',_0x5c9024['uniqueid'],'\x20Queue',_0x2d7dd3[_0x8727('0x2b')],_0x8727('0x78'),_0x2d7dd3[_0x8727('0x2f')]);ami['emit'](_0x8727('0xb9'),ut[_0x8727('0xa4')](_0x5c9024,'connect',this[_0x8727('0x13')][_0x5c9024[_0x8727('0x76')]]));if(_0x2d7dd3[_0x8727('0xba')]){ami[_0x8727('0x28')](_0x8727('0xbb'),ut[_0x8727('0xbc')](_0x5c9024));}break;case'16':ami[_0x8727('0x28')](_0x8727('0xbd'),ut[_0x8727('0xa4')](_0x5c9024,_0x8727('0xbe'),this['campaignsPreview'][_0x5c9024[_0x8727('0x76')]]));emitVoiceQueueChannelRemove(ut[_0x8727('0xa4')](_0x5c9024,_0x8727('0xbe')));_0x2d7dd3[_0x8727('0x3c')]+=0x1;_0x2d7dd3[_0x8727('0x32')]+=0x1;_0x2d7dd3[_0x8727('0x2d')]+=0x1;ut[_0x8727('0xbf')](_0x2d7dd3,_0x8727('0xc0'));_0x5c9024[_0x8727('0xa0')]=ut[_0x8727('0xa1')](_0x5c9024);ut[_0x8727('0x95')](_0x5c9024,0x4,_0x8727('0xc1'));rpcDb['createCustomerHistory'](_0x5c9024,_0x8727('0xc2'));rpcDb[_0x8727('0x97')](_0x5c9024,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x5c9024);_0x2d7dd3[_0x8727('0xc3')]+=_0x5c9024[_0x8727('0xc4')];_0x2d7dd3[_0x8727('0x30')]+=_0x5c9024[_0x8727('0xc4')];logger[_0x8727('0x60')]('[syncHangup][talking][decrement]',_0x5c9024[_0x8727('0xc5')],_0x8727('0xc6'),_0x2d7dd3['name'],_0x8727('0x78'),_0x2d7dd3['pTalking']);delete this[_0x8727('0x16')][_0x29da1c[_0x8727('0xb2')]];break;case'BUSY':_0x2d7dd3['outboundBusyCallsDay']+=0x1;_0x5c9024[_0x8727('0xc7')]+=0x1;_0x5c9024[_0x8727('0xa0')]=ut[_0x8727('0xa1')](_0x5c9024);ut['logCustomer'](_0x5c9024,0x5,_0x8727('0xc8'));_0x4de3f0=_0x2d7dd3[_0x8727('0xc9')];_0x1a16f8=_0x2d7dd3[_0x8727('0xa8')];ami['emit'](_0x8727('0xca'),ut[_0x8727('0xa4')](_0x5c9024,_0x8727('0xcb')));rpcDb[_0x8727('0x93')](_0x5c9024,'[callProgressDetectingCustomer][logBusy]');_0x55f8a2['verifyAdditionalPhones'](_0x5c9024,'5',_0x2d7dd3)['then'](function(_0x92f690){_0x5c0c1b=_0x92f690[_0x8727('0xcc')]==0x1;if(!_0x5c0c1b){if(ut[_0x8727('0xa1')](_0x5c9024)>=_0x2d7dd3[_0x8727('0xa9')]){_0x2a92d6=ut[_0x8727('0xaa')](_0x5c9024,0xf,_0x8727('0xab'));rpcDb[_0x8727('0x97')](_0x2a92d6,_0x8727('0xcd'));}else{if(_0x5c9024[_0x8727('0xc7')]>=_0x2d7dd3[_0x8727('0xce')]){rpcDb[_0x8727('0x97')](_0x5c9024,_0x8727('0xcf'));}else{rpcDb[_0x8727('0xaf')](ut['scheduledAt'](_0x5c9024,_0x8727('0xc7'),_0x2d7dd3[_0x8727('0xc9')]),_0x5c9024[_0x8727('0xd0')],_0x5c9024[_0x8727('0xd1')]);}}}else{_0x5c9024[_0x8727('0xc7')]++;_0x55f8a2[_0x8727('0xb4')]({'id':_0x5c9024[_0x8727('0xd2')],'field':{'countbusyretry':_0x5c9024[_0x8727('0xc7')]}})[_0x8727('0x87')](function(){_0x55f8a2['swapAdditionalPhones'](_0x5c9024,_0x4de3f0,_0x1a16f8)[_0x8727('0x87')](function(){});});}});break;case'NOANSWER':_0x2d7dd3[_0x8727('0x42')]+=0x1;_0x5c9024[_0x8727('0xd3')]+=0x1;_0x5c9024[_0x8727('0xa0')]=ut[_0x8727('0xa1')](_0x5c9024);ut[_0x8727('0x95')](_0x5c9024,0x3,_0x8727('0xd4'));_0x4de3f0=_0x2d7dd3[_0x8727('0xd5')];_0x1a16f8=_0x2d7dd3[_0x8727('0xa8')];var _0x4a7dd1=ut[_0x8727('0xd6')](_0x5c9024,_0x2d7dd3);ami[_0x8727('0x28')]('custom:agentnoanswer',_0x4a7dd1);rpcDb['createCustomerHistory'](_0x5c9024,_0x8727('0xd7'));_0x55f8a2[_0x8727('0xa7')](_0x5c9024,'3',_0x2d7dd3)['then'](function(_0x3b8a9e){_0x5c0c1b=_0x3b8a9e['additional']==0x1;if(!_0x5c0c1b){if(ut[_0x8727('0xa1')](_0x5c9024)>=_0x2d7dd3[_0x8727('0xa9')]){_0x2a92d6=ut[_0x8727('0xaa')](_0x5c9024,0xf,_0x8727('0xab'));rpcDb[_0x8727('0x97')](_0x2a92d6,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x5c9024[_0x8727('0xd3')]>=_0x2d7dd3[_0x8727('0xd8')]){rpcDb[_0x8727('0x97')](_0x5c9024,_0x8727('0xd7'));}else{rpcDb[_0x8727('0xaf')](ut['scheduledAt'](_0x5c9024,'countnoanswerretry',_0x2d7dd3[_0x8727('0xd5')]),_0x5c9024[_0x8727('0xd0')],_0x5c9024[_0x8727('0xd1')]);}}}else{_0x5c9024[_0x8727('0xd3')]++;_0x55f8a2[_0x8727('0xb4')]({'id':_0x5c9024[_0x8727('0xd2')],'field':{'countnoanswerretry':_0x5c9024[_0x8727('0xd3')]}})[_0x8727('0x87')](function(){_0x55f8a2['swapAdditionalPhones'](_0x5c9024,_0x4de3f0,_0x1a16f8)[_0x8727('0x87')](function(){});});}});break;case _0x8727('0xd9'):_0x2d7dd3[_0x8727('0x3e')]+=0x1;_0x5c9024['countcongestionretry']+=0x1;_0x5c9024[_0x8727('0xa0')]=ut[_0x8727('0xa1')](_0x5c9024);ut[_0x8727('0x95')](_0x5c9024,0x8,_0x8727('0xda'));_0x4de3f0=_0x2d7dd3['dialCongestionRetryFrequency'];_0x1a16f8=_0x2d7dd3[_0x8727('0xa8')];ami[_0x8727('0x28')](_0x8727('0xdb'),ut[_0x8727('0xa4')](_0x5c9024,_0x8727('0xdc')));rpcDb[_0x8727('0x93')](_0x5c9024,'[callProgressDetectingCustomer][logCongestion]');_0x55f8a2[_0x8727('0xa7')](_0x5c9024,'8',_0x2d7dd3)[_0x8727('0x87')](function(_0x50e746){_0x5c0c1b=_0x50e746[_0x8727('0xcc')]==0x1;if(!_0x5c0c1b){if(ut[_0x8727('0xa1')](_0x5c9024)>=_0x2d7dd3[_0x8727('0xa9')]){_0x2a92d6=ut[_0x8727('0xaa')](_0x5c9024,0xf,_0x8727('0xab'));rpcDb[_0x8727('0x97')](_0x2a92d6,_0x8727('0xdd'));}else{if(_0x5c9024['countcongestionretry']>=_0x2d7dd3[_0x8727('0xde')]){rpcDb['createCustomerFinal'](_0x5c9024,_0x8727('0xdf'));}else{rpcDb[_0x8727('0xaf')](ut[_0x8727('0xb0')](_0x5c9024,'countcongestionretry',_0x2d7dd3[_0x8727('0xc9')]),_0x5c9024[_0x8727('0xd0')],_0x5c9024[_0x8727('0xd1')]);}}}else{_0x5c9024['countcongestionretry']++;_0x55f8a2[_0x8727('0xb4')]({'id':_0x5c9024['idContact'],'field':{'countcongestionretry':_0x5c9024[_0x8727('0xe0')]}})['then'](function(){_0x55f8a2[_0x8727('0xb5')](_0x5c9024,_0x4de3f0,_0x1a16f8)['then'](function(){});});}});break;case'CANCEL':_0x2d7dd3['outboundRejectCallsDay']+=0x1;_0x5c9024[_0x8727('0xe1')]+=0x1;_0x5c9024[_0x8727('0xa0')]=ut[_0x8727('0xa1')](_0x5c9024);ut['logCustomer'](_0x5c9024,0x14,_0x8727('0xe2'));_0x4de3f0=_0x2d7dd3['dialAgentRejectRetryFrequency'];_0x1a16f8=_0x2d7dd3['callAdditionalPhoneAfterMin'];ami['emit'](_0x8727('0xe3'),ut[_0x8727('0xa4')](_0x5c9024,_0x8727('0xe4')));rpcDb['createCustomerHistory'](_0x5c9024,'[syncHangupRequest][logAgentReject]');_0x55f8a2[_0x8727('0xa7')](_0x5c9024,'20',_0x2d7dd3)['then'](function(_0x4cbe87){_0x5c0c1b=_0x4cbe87[_0x8727('0xcc')]==0x1;if(!_0x5c0c1b){if(ut[_0x8727('0xa1')](_0x5c9024)>=_0x2d7dd3[_0x8727('0xa9')]){_0x2a92d6=ut[_0x8727('0xaa')](_0x5c9024,0x14,_0x8727('0xe2'));rpcDb[_0x8727('0x97')](_0x2a92d6,_0x8727('0xe5'));}else{if(_0x5c9024['countagentrejectretry']>=_0x2d7dd3[_0x8727('0xe6')]){rpcDb[_0x8727('0x97')](_0x5c9024,_0x8727('0xe5'));}else{rpcDb[_0x8727('0xaf')](ut[_0x8727('0xb0')](_0x5c9024,'countagentrejectretry',_0x2d7dd3['dialAgentRejectRetryFrequency']),_0x5c9024[_0x8727('0xd0')],_0x5c9024[_0x8727('0xd1')]);}}}else{_0x5c9024[_0x8727('0xd3')]++;_0x55f8a2[_0x8727('0xb4')]({'id':_0x5c9024[_0x8727('0xd2')],'field':{'countnoanswerretry':_0x5c9024['countnoanswerretry']}})[_0x8727('0x87')](function(){_0x55f8a2[_0x8727('0xb5')](_0x5c9024,_0x4de3f0,_0x1a16f8)[_0x8727('0x87')](function(){});});}});break;case _0x8727('0xe7'):_0x2d7dd3[_0x8727('0x45')]+=0x1;_0x5c9024[_0x8727('0xe8')]+=0x1;_0x5c9024['countglobal']=ut[_0x8727('0xa1')](_0x5c9024);ut[_0x8727('0x95')](_0x5c9024,0xb,_0x8727('0xe9'));rpcDb['createCustomerHistory'](_0x5c9024,'[callProgressDetectingCustomer][logAbandoned]');_0x55f8a2[_0x8727('0xa7')](_0x5c9024,'11',_0x2d7dd3)[_0x8727('0x87')](function(_0x3a1bd5){_0x5c0c1b=_0x3a1bd5[_0x8727('0xcc')]==0x1;if(!_0x5c0c1b){if(ut[_0x8727('0xa1')](_0x5c9024)>=_0x2d7dd3['dialGlobalMaxRetry']){_0x2a92d6=ut[_0x8727('0xaa')](_0x5c9024,0xf,'Global');rpcDb['createCustomerFinal'](_0x2a92d6,_0x8727('0xea'));}else{if(_0x5c9024[_0x8727('0xeb')]>=_0x2d7dd3[_0x8727('0xec')]){rpcDb[_0x8727('0x97')](_0x5c9024,_0x8727('0xea'));}else{rpcDb[_0x8727('0xaf')](ut[_0x8727('0xb0')](_0x5c9024,_0x8727('0xe8'),_0x2d7dd3[_0x8727('0xed')]),_0x5c9024[_0x8727('0xd0')],_0x5c9024[_0x8727('0xd1')]);}}}else{_0x5c9024['countnoanswerretry']++;_0x55f8a2[_0x8727('0xb4')]({'id':_0x5c9024[_0x8727('0xd2')],'field':{'countnoanswerretry':_0x5c9024[_0x8727('0xd3')]}})[_0x8727('0x87')](function(){_0x55f8a2['swapAdditionalPhones'](_0x5c9024,_0x4de3f0,_0x1a16f8)['then'](function(){});});}});break;case'18':_0x2d7dd3[_0x8727('0xee')]+=0x1;_0x5c9024['countmachineretry']+=0x1;_0x5c9024[_0x8727('0xa0')]=ut[_0x8727('0xa1')](_0x5c9024);ut['logCustomer'](_0x5c9024,0x12,_0x29da1c[_0x8727('0xef')]||_0x29da1c[_0x8727('0xf0')]);ami[_0x8727('0x28')](_0x8727('0xf1'),ut[_0x8727('0xa4')](_0x5c9024,'amd'));rpcDb[_0x8727('0x93')](_0x5c9024,'[callProgressDetectingCustomer][hangupInAMD]');_0x55f8a2[_0x8727('0xa7')](_0x5c9024,'18',_0x2d7dd3)['then'](function(_0x1bdb94){_0x5c0c1b=_0x1bdb94[_0x8727('0xcc')]==0x1;if(!_0x5c0c1b){if(ut[_0x8727('0xa1')](_0x5c9024)>=_0x2d7dd3[_0x8727('0xa9')]){_0x2a92d6=ut[_0x8727('0xaa')](_0x5c9024,0x12,'Global');rpcDb['createCustomerFinal'](_0x2a92d6,_0x8727('0xf2'));}else{rpcDb['createCustomerFinal'](_0x5c9024,_0x8727('0xf2'));}}else{_0x5c9024['countnoanswerretry']++;_0x55f8a2[_0x8727('0xb4')]({'id':_0x5c9024[_0x8727('0xd2')],'field':{'countnoanswerretry':_0x5c9024['countnoanswerretry']}})[_0x8727('0x87')](function(){_0x55f8a2[_0x8727('0xb5')](_0x5c9024,_0x4de3f0,_0x1a16f8)['then'](function(){});});}});delete this['actions'][_0x29da1c[_0x8727('0xb2')]];break;case'19':_0x2d7dd3[_0x8727('0xee')]+=0x1;_0x5c9024[_0x8727('0xa0')]=ut['totalGlobal'](_0x5c9024);ut[_0x8727('0x95')](_0x5c9024,0x13,_0x29da1c[_0x8727('0xef')]||_0x29da1c[_0x8727('0xf0')]);ami[_0x8727('0x28')](_0x8727('0xf1'),ut['buildObj'](_0x5c9024,_0x8727('0xf3')));rpcDb['createCustomerHistory'](_0x5c9024,_0x8727('0xf4'));_0x55f8a2[_0x8727('0xa7')](_0x5c9024,'18',_0x2d7dd3)[_0x8727('0x87')](function(_0x556e4a){_0x5c0c1b=_0x556e4a[_0x8727('0xcc')]==0x1;if(!_0x5c0c1b){if(ut[_0x8727('0xa1')](_0x5c9024)>=_0x2d7dd3[_0x8727('0xa9')]){_0x2a92d6=ut[_0x8727('0xaa')](_0x5c9024,0xf,_0x8727('0xab'));rpcDb[_0x8727('0x97')](_0x2a92d6,_0x8727('0xf4'));}else{rpcDb[_0x8727('0x97')](_0x5c9024,_0x8727('0xf4'));}}else{_0x5c9024[_0x8727('0xd3')]++;_0x55f8a2[_0x8727('0xb4')]({'id':_0x5c9024[_0x8727('0xd2')],'field':{'countnoanswerretry':_0x5c9024[_0x8727('0xd3')]}})['then'](function(){_0x55f8a2[_0x8727('0xb5')](_0x5c9024,_0x4de3f0,_0x1a16f8)[_0x8727('0x87')](function(){});});}});delete this[_0x8727('0x16')][_0x29da1c[_0x8727('0xb2')]];break;default:if(_0x5c9024[_0x8727('0x79')]){ut[_0x8727('0xbf')](_0x2d7dd3,_0x8727('0xf5'));ut['loggerError'](_0x8727('0xf6')+_0x2d7dd3[_0x8727('0x2b')],_0x29da1c);}_0x2d7dd3[_0x8727('0xee')]+=0x1;_0x5c9024[_0x8727('0xa0')]=ut[_0x8727('0xa1')](_0x5c9024);ut[_0x8727('0x95')](_0x5c9024,0xc,_0x29da1c[_0x8727('0xef')]||_0x29da1c[_0x8727('0xf0')]);_0x4de3f0=_0x2d7dd3[_0x8727('0xf7')];_0x1a16f8=_0x2d7dd3['callAdditionalPhoneAfterMin'];rpcDb['createCustomerHistory'](_0x5c9024,_0x8727('0xf8'));_0x55f8a2[_0x8727('0xa7')](_0x5c9024,'20',_0x2d7dd3)[_0x8727('0x87')](function(_0x3f4efd){_0x5c0c1b=_0x3f4efd[_0x8727('0xcc')]==0x1;if(!_0x5c0c1b){if(ut['totalGlobal'](_0x5c9024)>=_0x2d7dd3[_0x8727('0xa9')]){_0x2a92d6=ut[_0x8727('0xaa')](_0x5c9024,0xf,_0x8727('0xab'));rpcDb['createCustomerFinal'](_0x2a92d6,_0x8727('0xf9'));}else{rpcDb[_0x8727('0x97')](_0x5c9024,_0x8727('0xf9'));}delete this['actions'][_0x29da1c[_0x8727('0xb2')]];}else{_0x55f8a2['swapAdditionalPhones'](_0x5c9024,_0x4de3f0,_0x1a16f8)[_0x8727('0x87')](function(){});}});}if(!(_0x5c9024[_0x8727('0x79')]&&_0x24196b==='16')){ut[_0x8727('0x81')](_0x2d7dd3,'[callProgressDetectingCustomer]');logger[_0x8727('0x60')](_0x8727('0xfa'),_0x5c9024[_0x8727('0xc5')],_0x8727('0xc6'),_0x2d7dd3[_0x8727('0x2b')],_0x8727('0x77'),_0x2d7dd3[_0x8727('0x52')]);}if(_0x24196b!==_0x8727('0xfb')){delete this[_0x8727('0x16')][_0x29da1c[_0x8727('0xb2')]];delete this[_0x8727('0x16')][_0x29da1c[_0x8727('0xfc')]];}}};Preview[_0x8727('0xf')][_0x8727('0xfd')]=function(_0x136911,_0x246b3c,_0x29751a){if(_[_0x8727('0xfe')](_0x246b3c)&&_0x8727('0xff')!==typeof _0x246b3c){return;}if(_['isUndefined'](_0x29751a)&&_0x8727('0xff')!==typeof _0x29751a){return;}switch(_0x29751a[_0x8727('0x100')]){case'0':ut['logAgent'](_0x136911,0x0,_0x8727('0xa2'));rpcDb['createAgentHistory'](_0x136911,_0x8727('0x101'));break;case'3':ut[_0x8727('0x102')](_0x136911,0x3,_0x8727('0xd4'));rpcDb['createAgentHistory'](_0x136911,_0x8727('0x103'));break;case'5':ut[_0x8727('0x102')](_0x136911,0x5,_0x8727('0xc8'));rpcDb[_0x8727('0x104')](_0x136911,_0x8727('0x105'));break;case'8':ut[_0x8727('0x102')](_0x136911,0x8,_0x8727('0xda'));rpcDb[_0x8727('0x104')](_0x136911,_0x8727('0x106'));break;case'22':ut[_0x8727('0x102')](_0x136911,0x16,_0x8727('0x107'));rpcDb['createAgentHistory'](_0x136911,_0x8727('0x108'));break;default:ut[_0x8727('0x102')](_0x136911,0xc,_0x29751a[_0x8727('0x100')]);rpcDb[_0x8727('0x104')](_0x136911,_0x8727('0x106'));}ut[_0x8727('0x81')](_0x246b3c,'[callProgressDetectingAgent]');logger['info'](_0x8727('0x109'),_0x136911[_0x8727('0xc5')],_0x8727('0xc6'),_0x246b3c[_0x8727('0x2b')],'originated:\x20',_0x246b3c[_0x8727('0x52')]);delete this['actions'][_0x136911[_0x8727('0xc5')]];};Preview[_0x8727('0xf')][_0x8727('0xa7')]=function(_0x16c2b0,_0x240b14,_0x4bd379){return Promise['resolve']()['then'](cmHopperAdditionalPhone[_0x8727('0xa7')](_0x16c2b0,_0x240b14,_0x4bd379))[_0x8727('0x80')](logger['info'](_0x8727('0x10a')));};Preview['prototype'][_0x8727('0xb5')]=function(_0x258702,_0xba5ea9,_0x403593){return Promise[_0x8727('0x10b')]()[_0x8727('0x87')](cmHopperAdditionalPhone[_0x8727('0xb5')](_0x258702,_0xba5ea9,_0x403593))[_0x8727('0x80')](logger['info']('[swapAdditionalPhone]\x20'));};Preview[_0x8727('0xf')]['incrementPreviewCounters']=function(_0x42b601){return Promise[_0x8727('0x10b')]()[_0x8727('0x87')](cmHopperAdditionalPhone[_0x8727('0xb4')](_0x42b601))[_0x8727('0x80')](logger['info'](_0x8727('0x10c')));};Preview[_0x8727('0xf')]['checkInBlack']=function(_0x594814,_0x5198e3,_0x54982c,_0x45d1b7,_0x2d6257){var _0x412be7=this;return new Promise(function(_0x305ff6,_0x1b63e0){if(_['isNil'](_0x5198e3)||_['isNil'](_0x5198e3[_0x8727('0x10d')])||_['isNil'](_0x5198e3[_0x8727('0x10e')])||_[_0x8727('0x73')](_0x5198e3[_0x8727('0x10f')])){_0x1b63e0(ut[_0x8727('0x51')](_0x8727('0x110'),_0x45d1b7,_0x2d6257));return;}var _0x28c0a4=uuid['v4']();var _0x1e034e=_0x412be7[_0x8727('0x13')][_0x5198e3[_0x8727('0x75')][_0x8727('0x2b')]];var _0x60fd55=_0x54982c?_0x412be7[_0x8727('0x17')][_0x54982c]['id']:undefined;_0x412be7[_0x8727('0x16')][_0x28c0a4]=new Action(_0x5198e3,_0x1e034e,_0x28c0a4,_0x54982c,_0x60fd55);var _0x5eecc7=_0x412be7['actions'][_0x28c0a4];_0x5eecc7[_0x8727('0xd0')]=_0x45d1b7;_0x5eecc7[_0x8727('0xd1')]=_0x2d6257;_0x5eecc7['lookAgent']=_0x54982c;if(_[_0x8727('0x111')](_0x594814)){_0x412be7[_0x8727('0x112')](_0x5eecc7,_0x1e034e,_0x5198e3,_0x54982c)[_0x8727('0x87')](function(_0x3ab557){logger[_0x8727('0x60')](_0x8727('0x113'),'Queue:\x20'+_0x5eecc7[_0x8727('0x76')]+_0x8727('0x114')+_0x5eecc7[_0x8727('0xd2')],JSON[_0x8727('0x5c')](_0x3ab557));ami[_0x8727('0x28')](_0x8727('0x115'),ut[_0x8727('0xa4')](_0x5eecc7,'called',_0x412be7[_0x8727('0x13')][_0x5eecc7[_0x8727('0x76')]]));_0x305ff6(ut[_0x8727('0x51')]('Calling'));})[_0x8727('0x80')](function(_0x5a9d4b){ut[_0x8727('0x66')]('[Preview][execCall][failure]',_0x5a9d4b);_0x1b63e0(ut['message'](_0x8727('0x116'),_0x45d1b7,_0x2d6257));});}else{_0x1e034e['outboundBlacklistCallsDay']+=0x1;ut['logBlacklist'](_0x5eecc7);rpcDb[_0x8727('0x117')](_0x5eecc7,_0x8727('0x118'));delete _0x412be7['actions'][_0x28c0a4];_0x1b63e0(ut[_0x8727('0x51')](_0x8727('0x119'),_0x45d1b7,_0x2d6257));}});};Preview[_0x8727('0xf')][_0x8727('0x9c')]=function(_0x221093){return!_[_0x8727('0x73')](_0x221093)&&!_[_0x8727('0x73')](_0x221093[_0x8727('0x2b')])&&!_[_0x8727('0x73')](_0x221093[_0x8727('0x59')])&&_0x221093[_0x8727('0x59')]&&!_['isNil'](this[_0x8727('0x15')][util['format'](_0x8727('0x11a'),_0x221093['name'])])&&!_['isNil'](this['trunks'][util[_0x8727('0x5d')](_0x8727('0x11a'),_0x221093['name'])][_0x8727('0x7f')])&&(this['trunks'][util['format']('SIP/%s',_0x221093[_0x8727('0x2b')])][_0x8727('0x7f')]===_0x8727('0x11b')||this[_0x8727('0x15')][util['format'](_0x8727('0x11a'),_0x221093[_0x8727('0x2b')])][_0x8727('0x7f')]==='unmonitored');};Preview[_0x8727('0xf')][_0x8727('0x8c')]=function(_0x1fee50,_0x143cee){return this[_0x8727('0x11c')](_0x1fee50,_0x143cee)[_0x8727('0x87')](function(_0x1bd09e){return _[_0x8727('0x7a')](_0x1bd09e,[_0x8727('0x51')]);})[_0x8727('0x80')](function(_0x524653){if(_0x524653[_0x8727('0x11d')]){rpcDb[_0x8727('0x11e')](_0x1fee50);}if(_0x524653[_0x8727('0x59')]){rpcDb[_0x8727('0x8f')](_0x1fee50);}throw _['pick'](_0x524653,[_0x8727('0x51')]);});};Preview[_0x8727('0xf')][_0x8727('0x11c')]=function(_0x1a3d90,_0x56ef45){var _0x324d92=this;var _0x5a083e,_0x181801;return rpcDb['getContactPreview'](_0x1a3d90)[_0x8727('0x87')](function(_0xf90072){if(!_[_0x8727('0x73')](_0xf90072[0x0])){_0x181801=_0xf90072[0x0][_0x8727('0x11f')]?![]:!![];_0x5a083e=_0xf90072[0x0]['recallme']?!![]:![];_0x5a083e=_0x56ef45?!![]:_0x5a083e;}var _0x43d44d=_0x324d92['validateContact'](_0xf90072);if(_0x43d44d[_0x8727('0x120')]){rpcDb[_0x8727('0x121')](_['pick'](_0xf90072[0x0],[_0x8727('0x10f'),_0x8727('0x10e')]))[_0x8727('0x87')](function(_0x4ca8b7){_0x324d92['checkInBlack'](_0x4ca8b7,_0xf90072[0x0],_0x56ef45,_0x181801,_0x5a083e)[_0x8727('0x87')](function(_0x5e95a4){return _0x5e95a4;})[_0x8727('0x80')](function(_0x5ceb76){throw _0x5ceb76;});})[_0x8727('0x80')](function(_0x5b097e){ut[_0x8727('0x66')](_0x8727('0x122'),_0x5b097e);throw ut[_0x8727('0x51')]('Call\x20unsuccessful',_0x181801,_0x5a083e);});}else{throw ut[_0x8727('0x51')](_0x43d44d[_0x8727('0x51')],_0x181801,_0x5a083e);}})[_0x8727('0x80')](function(_0x4ce3bb){ut['logger']('[Preview][getContactPreview]',_0x4ce3bb);throw ut['message'](_0x8727('0x123'),![],!![]);});};Preview[_0x8727('0xf')]['validateContact']=function(_0x50b615){if(_[_0x8727('0x73')](_0x50b615)||_[_0x8727('0x111')](_0x50b615)||!_[_0x8727('0x73')](_0x50b615[0x0][_0x8727('0x8a')])&&_[_0x8727('0x73')](_0x50b615[0x0][_0x8727('0x8a')][_0x8727('0x2b')])){ut['logger'](_0x8727('0x124'),_0x50b615);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x419a84=this[_0x8727('0x13')][_0x50b615[0x0][_0x8727('0x75')]['name']];_0x419a84[_0x8727('0x51')]='ACTIVE';if(_[_0x8727('0x73')](_0x419a84)){ut[_0x8727('0x66')]('[Preview][validateContact][Empty\x20Campaign]',_0x419a84);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x8727('0x9c')](_0x419a84[_0x8727('0x58')])){ut[_0x8727('0x66')](_0x8727('0x125'),_0x8727('0x126')+_0x419a84[_0x8727('0x2b')]+_0x8727('0x127'));if(!this['isTrunkReachable'](_0x419a84[_0x8727('0x9d')])){ut[_0x8727('0x66')](_0x8727('0x125'),_0x419a84[_0x8727('0x2b')]+_0x8727('0x128'));return{'isValid':![],'message':_0x8727('0x129')};}}if(!ut[_0x8727('0x12a')](_0x419a84['dialActive'])){ut[_0x8727('0x66')]('[Preview][validateContact][Campaign\x20Active]',_0x419a84[_0x8727('0x2b')]+'\x20Not\x20Active');return{'isValid':![],'message':_0x8727('0x126')+_0x419a84['name']+_0x8727('0x12b')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x8727('0xf')][_0x8727('0x112')]=function(_0x18ebd0,_0x5c781c,_0x412de3,_0x3c9c91){var _0x4b487c=this;return new Promise(function(_0x546598,_0x5ad35d){var _0x5565a5=_0x18ebd0[_0x8727('0xc5')];var _0x66fb8=_0x4b487c['isTrunkReachable'](_0x5c781c['Trunk'])?util[_0x8727('0x5d')](_0x8727('0x12c'),_0x5c781c[_0x8727('0x58')][_0x8727('0x2b')],_['isNil'](_0x5c781c['dialPrefix'])?'':_0x5c781c[_0x8727('0x12d')]['trim']()||'',_0x5c781c['dialCutDigit']>0x0?_0x412de3[_0x8727('0x10e')][_0x8727('0x12e')](_0x5c781c[_0x8727('0x12f')]):_0x412de3[_0x8727('0x10e')]):util[_0x8727('0x5d')]('SIP/%s/%s%s',_[_0x8727('0x73')](_0x5c781c['TrunkBackup'])?_0x5c781c[_0x8727('0x58')][_0x8727('0x2b')]:_0x5c781c[_0x8727('0x9d')][_0x8727('0x2b')],_[_0x8727('0x73')](_0x5c781c[_0x8727('0x12d')])?'':_0x5c781c[_0x8727('0x12d')][_0x8727('0x130')]()||'',_0x5c781c['dialCutDigit']>0x0?_0x412de3[_0x8727('0x10e')][_0x8727('0x12e')](_0x5c781c[_0x8727('0x12f')]):_0x412de3[_0x8727('0x10e')]);var _0x529ad8=_0x4b487c[_0x8727('0x9c')](_0x5c781c[_0x8727('0x58')])?ut['getCallerId'](_0x5c781c[_0x8727('0x58')][_0x8727('0x5a')],_0x5c781c[_0x8727('0x38')],_0x5c781c['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x5c781c[_0x8727('0x39')],_0x5c781c['dialRandomLastDigitCallerIdNumber']):_0x5c781c[_0x8727('0x39')]):ut[_0x8727('0x131')](_[_0x8727('0x73')](_0x5c781c[_0x8727('0x9d')])?_0x5c781c[_0x8727('0x58')][_0x8727('0x5a')]:_0x5c781c[_0x8727('0x9d')][_0x8727('0x5a')],_0x5c781c[_0x8727('0x38')],_0x5c781c[_0x8727('0x132')]>0x0?ut[_0x8727('0x133')](_0x5c781c[_0x8727('0x39')],_0x5c781c[_0x8727('0x132')]):_0x5c781c[_0x8727('0x39')]);if(_0x529ad8){_0x18ebd0[_0x8727('0x134')]=ut[_0x8727('0x135')](_0x529ad8);_0x18ebd0[_0x8727('0x136')]=ut[_0x8727('0x137')](_0x529ad8);}var _0x61c637=ut[_0x8727('0x138')](_0x5c781c,_0x412de3,_0x66fb8,_0x529ad8,_0x5565a5,_0x18ebd0);_[_0x8727('0x139')](_0x18ebd0,ut[_0x8727('0x13a')](_0x61c637));_0x18ebd0['starttime']=moment()[_0x8727('0x5d')](_0x8727('0xb6'));_0x5c781c[_0x8727('0x13b')]=_0x61c637;ami[_0x8727('0x7e')](ut['variablesAction'](_0x18ebd0,_0x5c781c,_0x61c637,_0x18ebd0[_0x8727('0xd1')],_0x3c9c91))[_0x8727('0x87')](function(_0x4f703a){_0x5c781c[_0x8727('0x52')]+=0x1;logger[_0x8727('0x60')](_0x8727('0x13c'),_0x5565a5,_0x8727('0xc6'),_0x5c781c[_0x8727('0x2b')],'originated:\x20',_0x5c781c['originated']);_0x546598(_0x4f703a);})[_0x8727('0x80')](function(_0x5e3867){ut[_0x8727('0x102')](_0x18ebd0,0xe,_0x8727('0x13d'));rpcDb[_0x8727('0x104')](_0x18ebd0,_0x8727('0x13e'));_0x5ad35d(_0x5e3867);});});};Preview[_0x8727('0xf')][_0x8727('0x22')]=function(_0x25103d){if(this[_0x8727('0x16')][_0x25103d[_0x8727('0xb2')]]){this[_0x8727('0x16')][_0x25103d[_0x8727('0xb2')]][_0x8727('0x13f')]=_0x25103d[_0x8727('0x13f')];}};Preview[_0x8727('0xf')]['syncOriginateResponse']=function(_0x55b3db){var _0x56ea14=this;var _0x47261a=this[_0x8727('0x16')][_0x55b3db[_0x8727('0x140')]];if(_0x47261a){if(_0x47261a['lookAgent']&&this[_0x8727('0x17')][_0x47261a[_0x8727('0x141')]]){ut['logLookAgent'](_0x47261a,this[_0x8727('0x17')][_0x47261a['lookAgent']][_0x8727('0x2b')],this[_0x8727('0x17')][_0x47261a['lookAgent']]['id']);}var _0x12f8fe=_[_0x8727('0x142')](_0x47261a);_0x12f8fe['responsetime']=moment()['format'](_0x8727('0xb6'));var _0xe8bdd2=_0x56ea14[_0x8727('0x13')][_0x47261a[_0x8727('0x76')]];if(ut[_0x8727('0x143')](_0x55b3db[_0x8727('0x144')])){if(_0x47261a[_0x8727('0xd0')]){rpcDb[_0x8727('0x11e')](_0x47261a[_0x8727('0xd2')]);}if(_0x47261a[_0x8727('0xd1')]){rpcDb[_0x8727('0x8f')](_0x47261a[_0x8727('0xd2')]);}ami[_0x8727('0x28')]('custom:agentringnoanswer',ut['buildObj'](_0x47261a,'rejected',this[_0x8727('0x13')][_0x47261a[_0x8727('0x76')]]));this[_0x8727('0xfd')](_0x12f8fe,_0xe8bdd2,_0x55b3db);}else{_0x47261a['starttime']=moment()[_0x8727('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x8727('0x102')](_0x12f8fe,0x4,_0x8727('0xc1'));rpcDb[_0x8727('0x104')](_0x12f8fe,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x8727('0xf')][_0x8727('0x1d')]=function(_0xa79231){var _0x773c90=this['actions'][_0xa79231[_0x8727('0xb2')]];var _0x58c018;if(_0x773c90){_0x58c018=this[_0x8727('0x13')][_0x773c90[_0x8727('0x76')]];logger[_0x8727('0x60')]('[syncHangup][talking]',_0xa79231[_0x8727('0xb2')],'\x20Queue',_0x58c018[_0x8727('0x2b')],_0x8727('0x78'),_0x58c018[_0x8727('0x2f')]);}if(this[_0x8727('0x16')][_0xa79231[_0x8727('0xb2')]]&&_0xa79231[_0x8727('0xb2')]!==_0xa79231[_0x8727('0xc5')]){if(_0xa79231[_0x8727('0x145')]==='16'&&this[_0x8727('0x16')][_0xa79231[_0x8727('0xb2')]][_0x8727('0x79')]){this[_0x8727('0x146')](_0xa79231,_0xa79231['linkedid'],_0xa79231[_0x8727('0x145')]);}else if(this[_0x8727('0x16')][_0xa79231['linkedid']][_0x8727('0x79')]){logger['info'](_0x8727('0x147'),_0xa79231[_0x8727('0xb2')],_0xa79231[_0x8727('0x145')],'\x20Queue',_0x58c018[_0x8727('0x2b')],_0x8727('0x78'),_0x58c018[_0x8727('0x2f')]);this[_0x8727('0x146')](_0xa79231,_0xa79231[_0x8727('0xb2')],_0xa79231[_0x8727('0x145')]);}}else if(_0x773c90&&_['isNil'](_0x773c90[_0x8727('0x148')])&&_0x58c018[_0x8727('0x149')]&&_0xa79231[_0x8727('0xb2')]===_0xa79231['uniqueid']&&_[_0x8727('0x73')](_0xa79231[_0x8727('0x100')])&&_0xa79231[_0x8727('0x145')]==='16'&&_0xa79231[_0x8727('0x14a')]==='6'&&_[_0x8727('0xfe')](_0x773c90['transfer'])){if(_0x773c90[_0x8727('0xd0')]){rpcDb[_0x8727('0x11e')](_0x773c90[_0x8727('0xd2')]);}if(_0x773c90[_0x8727('0xd1')]){rpcDb[_0x8727('0x8f')](_0x773c90[_0x8727('0xd2')]);}_0xa79231[_0x8727('0x100')]='22';this[_0x8727('0xfd')](_0x773c90,_0x58c018,_0xa79231);}else if(_0x773c90&&_0x773c90['transfer']){if(_0xa79231['cause']==='16'&&this[_0x8727('0x16')][_0xa79231[_0x8727('0xb2')]][_0x8727('0x79')]){logger[_0x8727('0x60')](_0x8727('0x14b'),_0xa79231[_0x8727('0xb2')],_0xa79231[_0x8727('0x145')],'\x20Queue',_0x58c018[_0x8727('0x2b')],'pTalking:\x20',_0x58c018['pTalking']);this[_0x8727('0x146')](_0xa79231,_0xa79231[_0x8727('0xb2')],_0xa79231[_0x8727('0x145')]);}else if(this['actions'][_0xa79231['linkedid']][_0x8727('0x79')]){logger['info'](_0x8727('0x147'),_0xa79231[_0x8727('0xb2')],_0xa79231['cause'],'\x20Queue',_0x58c018[_0x8727('0x2b')],_0x8727('0x78'),_0x58c018[_0x8727('0x2f')]);this[_0x8727('0x146')](_0xa79231,_0xa79231['linkedid'],_0xa79231['cause']);}}};Preview[_0x8727('0xf')][_0x8727('0x20')]=function(_0x510962){if(this['actions'][_0x510962[_0x8727('0xfc')]]&&_0x510962['destlinkedid']!==_0x510962[_0x8727('0x14c')]){this[_0x8727('0x146')](_0x510962,_0x510962[_0x8727('0xfc')],_0x510962[_0x8727('0xf0')]);}};Preview[_0x8727('0xf')]['syncHangupRequest']=function(_0x3a0647){if(this['actions'][_0x3a0647[_0x8727('0xb2')]]&&_0x3a0647[_0x8727('0xb2')]!==_0x3a0647['uniqueid']&&!this[_0x8727('0x16')][_0x3a0647['linkedid']]['dialAnswer']){if(_0x3a0647['cause']==='1'){this[_0x8727('0x146')](_0x3a0647,_0x3a0647['linkedid'],_0x3a0647[_0x8727('0x145')]);}}};Preview[_0x8727('0xf')][_0x8727('0x14d')]=function(_0x525ed6,_0x2fe47c,_0x35500f){if(this['actions'][_0x525ed6]){if(_[_0x8727('0x73')](this['actions'][_0x525ed6]['variables'])){this[_0x8727('0x16')][_0x525ed6][_0x8727('0x13b')]={};}this[_0x8727('0x16')][_0x525ed6][_0x8727('0x13b')][_0x2fe47c]=_0x35500f;}};Preview[_0x8727('0xf')][_0x8727('0x14e')]=function(_0x2e380f){try{if(!_['isNil'](_0x2e380f)){if(ut[_0x8727('0x14f')](_[_0x8727('0x150')](_0x2e380f['variable'])[0x0])){this['addVariable'](_0x2e380f[_0x8727('0xc5')],_[_0x8727('0x150')](_0x2e380f[_0x8727('0x151')])[0x0],_0x2e380f[_0x8727('0x152')]);}}}catch(_0x78dd27){logger[_0x8727('0x153')](_0x8727('0x154'),util[_0x8727('0x155')](_0x78dd27,{'showHidden':![],'depth':null}));}};Preview[_0x8727('0xf')][_0x8727('0x156')]=function(_0x4428b0){if(_0x4428b0){if(this[_0x8727('0x16')][_0x4428b0[_0x8727('0x157')]]){this[_0x8727('0x16')][_0x4428b0['transfertargetlinkedid']][_0x8727('0x158')]=!![];}}};Preview[_0x8727('0xf')][_0x8727('0x26')]=function(_0x590a9f){if(_0x590a9f){if(this['actions'][_0x590a9f['transfererlinkedid']]){this['actions'][_0x590a9f['transfererlinkedid']][_0x8727('0x158')]=!![];}}};module['exports']=Preview;
\ No newline at end of file
+var _0x6d38=['Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','additional','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','swapAdditionalPhones','NOANSWER','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','activeContact','CONGESTION','Congestion','dialCongestionRetryFrequency','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','CANCEL','countagentrejectretry','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','isUndefined','object','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','createAgentHistory','[originated][decrement][callProgressDetectingAgent]','resolve','[incrementPreviewCounters]\x20','checkInBlack','phone','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','\x20IdHopper:\x20','custom:agentcalled','called','Calling','logBlacklist','createHistory','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','active','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20Backup\x20is\x20not\x20active','\x20Not\x20Active','Is\x20Valid','trim','dialCutDigit','substring','SIP/%s/%s%s','getCallerId','callerid','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdName','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncOriginateResponse','logLookAgent','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','channelstate','transfer','destlinkedid','destuniqueid','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','lodash','uuid','moment','../../../config/environment','preview','../../../config/logger','actionPreview','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','redis','localhost','socket.io-emitter','enqueue','tail','finally','sequence','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','emit','type','name','strategy','available','loggedIn','pTalking','sumHoldTime','total','unmanaged','abandoned','dialActive','dialMethod','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','Interval','stringify','md5','voice:queue:%s','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','message','DEACTIVATED','prototype','syncCampaigns','campaignsPreview','hasOwnProperty','booked','outbound','setMessage','recallMe','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','ListId','Action','status','channel','catch','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','clearZombieChannels','[action]','size','clearZombieChannel','then','length','getDiff','scheduledat','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','format','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','createCustomerHistory','logCustomer','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','linkedid','idContact','incrementPreviewCounters','responsetime','answertime','[syncHangup][talking][increment]','\x20Queue','custom:agentconnect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','decrementTalkink','[16]','Answer','crateCustomerReportQueue','sumBillable','talktime','[syncHangup][talking][decrement]','uniqueid','countbusyretry'];(function(_0x1e684e,_0x3f6acc){var _0x441ad1=function(_0x38292b){while(--_0x38292b){_0x1e684e['push'](_0x1e684e['shift']());}};_0x441ad1(++_0x3f6acc);}(_0x6d38,0x1ef));var _0x86d3=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x6d38[_0x278e3c];return _0x3e2d9b;};'use strict';var util=require('util');var _=require(_0x86d3('0x0'));var uuid=require(_0x86d3('0x1'));var moment=require(_0x86d3('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x86d3('0x3'));var logger=require('../../../config/logger')(_0x86d3('0x4'));var loggerAction=require(_0x86d3('0x5'))(_0x86d3('0x6'));var ami=require('../ami');var rpcDb=require(_0x86d3('0x7'));var cmHopperAdditionalPhone=require(_0x86d3('0x8'));var Action=require(_0x86d3('0x9'));var ut=require(_0x86d3('0xa'));config['redis']=_['defaults'](config[_0x86d3('0xb')],{'host':_0x86d3('0xc'),'port':0x18eb});var io=require(_0x86d3('0xd'))(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype'][_0x86d3('0xe')]=function(_0x555e6d){this['tail']=this['tail']?this[_0x86d3('0xf')][_0x86d3('0x10')](_0x555e6d):_0x555e6d();};function Preview(_0x4f216c){this[_0x86d3('0x11')]=new Sequence();this['campaignsPreview']=_0x4f216c[_0x86d3('0x12')];this[_0x86d3('0x13')]=_0x4f216c[_0x86d3('0x13')];this[_0x86d3('0x14')]={};this[_0x86d3('0x15')]=_0x4f216c[_0x86d3('0x15')];this[_0x86d3('0x16')]=0x0;ami['on'](_0x86d3('0x17'),this['syncOriginateResponse'][_0x86d3('0x18')](this));ami['on'](_0x86d3('0x19'),this[_0x86d3('0x1a')][_0x86d3('0x18')](this));ami['on'](_0x86d3('0x1b'),this[_0x86d3('0x1c')][_0x86d3('0x18')](this));ami['on'](_0x86d3('0x1d'),this['syncDialEnd'][_0x86d3('0x18')](this));ami['on'](_0x86d3('0x1e'),this[_0x86d3('0x1f')][_0x86d3('0x18')](this));ami['on'](_0x86d3('0x20'),this[_0x86d3('0x21')][_0x86d3('0x18')](this));ami['on'](_0x86d3('0x22'),this[_0x86d3('0x23')]['bind'](this));ami['on'](_0x86d3('0x24'),this['syncBlindTransfer'][_0x86d3('0x18')](this));this['loopCampaigns'](this['campaignsPreview']);}function emit(_0x41486a,_0x1edb6d,_0x988066){io['to'](_0x41486a)[_0x86d3('0x25')](_0x1edb6d,_0x988066);}function emitCampaignPreview(_0x5654ab){if(_0x5654ab[_0x86d3('0x26')]==='outbound'){var _0x36e0fa={'id':_0x5654ab['id'],'name':_0x5654ab[_0x86d3('0x27')],'strategy':_0x5654ab[_0x86d3('0x28')],'answered':_0x5654ab['answered'],'available':_0x5654ab[_0x86d3('0x29')],'loggedIn':_0x5654ab[_0x86d3('0x2a')],'pTalking':_0x5654ab[_0x86d3('0x2b')],'sumBillable':_0x5654ab['sumBillable'],'sumDuration':_0x5654ab['sumDuration'],'sumHoldTime':_0x5654ab[_0x86d3('0x2c')]||0x0,'talking':_0x5654ab['talking'],'total':_0x5654ab[_0x86d3('0x2d')],'type':_0x5654ab[_0x86d3('0x26')],'unmanaged':_0x5654ab[_0x86d3('0x2e')],'abandoned':_0x5654ab[_0x86d3('0x2f')],'waiting':_0x5654ab['waiting'],'loggedInDb':_0x5654ab['loggedInDb'],'dialActive':_0x5654ab[_0x86d3('0x30')],'dialMethod':_0x5654ab[_0x86d3('0x31')],'dialOriginateCallerIdName':_0x5654ab['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x5654ab[_0x86d3('0x32')],'dialOriginateTimeout':_0x5654ab['dialOriginateTimeout'],'dialPrefix':_0x5654ab[_0x86d3('0x33')],'outboundAnswerAgiCallsDay':_0x5654ab[_0x86d3('0x34')],'outboundAnswerCallsDay':_0x5654ab[_0x86d3('0x35')],'outboundBlacklistCallsDay':_0x5654ab[_0x86d3('0x36')],'outboundBusyCallsDay':_0x5654ab[_0x86d3('0x37')],'outboundCongestionCallsDay':_0x5654ab[_0x86d3('0x38')],'outboundDropCallsDayACS':_0x5654ab[_0x86d3('0x39')],'outboundDropCallsDayCallersExit':_0x5654ab[_0x86d3('0x3a')],'outboundDropCallsDayTimeout':_0x5654ab[_0x86d3('0x3b')],'outboundNoAnswerCallsDay':_0x5654ab[_0x86d3('0x3c')],'outboundNoSuchCallsDay':_0x5654ab[_0x86d3('0x3d')],'outboundOriginateFailureCallsDay':_0x5654ab[_0x86d3('0x3e')],'outboundReCallsDay':_0x5654ab[_0x86d3('0x3f')],'outboundRejectCallsDay':_0x5654ab[_0x86d3('0x40')],'outboundUnknownCallsDay':_0x5654ab['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x5654ab[_0x86d3('0x41')],'predictiveIntervalAnsweredCalls':_0x5654ab[_0x86d3('0x42')],'predictiveIntervalAvgHoldtime':_0x5654ab[_0x86d3('0x43')],'predictiveIntervalAvgTalktime':_0x5654ab[_0x86d3('0x44')],'predictiveIntervalDroppedCallsCallersExit':_0x5654ab[_0x86d3('0x45')],'predictiveIntervalDroppedCallsTimeout':_0x5654ab[_0x86d3('0x46')],'predictiveIntervalErlangCalls':_0x5654ab['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x5654ab[_0x86d3('0x47')],'predictiveIntervalHitRate':_0x5654ab['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x5654ab['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x5654ab[_0x86d3('0x48')],'predictiveIntervalAvailable':_0x5654ab[_0x86d3('0x49')],'predictiveIntervalTotalCalls':_0x5654ab[_0x86d3('0x4a')],'message':_0x5654ab['message'],'originated':_0x5654ab[_0x86d3('0x4b')],'erlangCalls':_0x5654ab[_0x86d3('0x4c')],'erlangCallToSecond':_0x5654ab['erlangCallToSecond'],'erlangAbandonmentRate':_0x5654ab[_0x86d3('0x4d')],'erlangBusyFactor':_0x5654ab[_0x86d3('0x4e')],'startPredictive':_0x5654ab[_0x86d3('0x4f')],'startProgressive':_0x5654ab[_0x86d3('0x50')]};if(_0x5654ab[_0x86d3('0x51')]){_0x36e0fa[_0x86d3('0x51')]={'id':_0x5654ab[_0x86d3('0x51')]['id'],'name':_0x5654ab[_0x86d3('0x51')]['name'],'active':_0x5654ab['Trunk']['active'],'callerid':_0x5654ab[_0x86d3('0x51')]['callerid']};}if(_0x5654ab[_0x86d3('0x52')]){_0x36e0fa['Interval']={'id':_0x5654ab[_0x86d3('0x52')]['id'],'name':_0x5654ab[_0x86d3('0x52')][_0x86d3('0x27')]};}var _0x15e52c=md5(JSON[_0x86d3('0x53')](_0x36e0fa));if(_0x5654ab[_0x86d3('0x54')]!==_0x15e52c){_0x5654ab[_0x86d3('0x54')]=_0x15e52c;emit(util['format'](_0x86d3('0x55'),_0x36e0fa[_0x86d3('0x27')]),'voice_queue:save',_0x36e0fa);}}}function emitVoiceQueueChannelRemove(_0x178fc6){logger[_0x86d3('0x56')](_0x86d3('0x57'),JSON[_0x86d3('0x53')](_0x178fc6));emit(util['format'](_0x86d3('0x55'),_0x178fc6[_0x86d3('0x27')]),_0x86d3('0x58'),_0x178fc6);io['emit'](_0x86d3('0x59'),_0x178fc6);}function notSendMessagesQueue(_0x15987d){if(_0x15987d[_0x86d3('0x5a')]){if(_0x15987d[_0x86d3('0x4b')]===0x0&&_0x15987d[_0x86d3('0x2b')]===0x0){_0x15987d[_0x86d3('0x5a')]=![];_0x15987d[_0x86d3('0x29')]=0x0;_0x15987d[_0x86d3('0x5b')]=0x0;_0x15987d['message']=_0x86d3('0x5c');ut[_0x86d3('0x5d')](_0x86d3('0x5e'),_0x15987d[_0x86d3('0x27')]+'\x20is\x20not\x20active');}else{_0x15987d[_0x86d3('0x5f')]=_0x86d3('0x60');ut[_0x86d3('0x5d')](_0x86d3('0x5e'),_0x15987d['name']+'\x20is\x20deactivated');}emitCampaignPreview(_0x15987d);}}Preview[_0x86d3('0x61')]['loopCampaigns']=function(){var _0x53545a=this;setInterval(function(){_0x53545a[_0x86d3('0x62')]();},0x7cf);};Preview[_0x86d3('0x61')][_0x86d3('0x62')]=function(){var _0x35d6fe=this[_0x86d3('0x63')];this['clockClearZombieChannels']+=0x1;for(var _0x2a5f6c in _0x35d6fe){if(_0x35d6fe[_0x86d3('0x64')](_0x2a5f6c)&&(_0x35d6fe[_0x2a5f6c][_0x86d3('0x31')]==='preview'||_0x35d6fe[_0x2a5f6c][_0x86d3('0x31')]===_0x86d3('0x65'))&&_0x35d6fe[_0x2a5f6c]['type']===_0x86d3('0x66')){if(this[_0x86d3('0x16')]>0x7){this['clockClearZombieChannels']=0x0;this['clearZombieChannels']();}}if(_0x35d6fe['hasOwnProperty'](_0x2a5f6c)&&_0x35d6fe[_0x2a5f6c][_0x86d3('0x31')]===_0x86d3('0x4')&&_0x35d6fe[_0x2a5f6c][_0x86d3('0x26')]===_0x86d3('0x66')){if(_0x35d6fe[_0x2a5f6c][_0x86d3('0x30')]){this[_0x86d3('0x67')](_0x35d6fe[_0x2a5f6c]);if(_0x35d6fe[_0x2a5f6c]['dialPreviewAutoRecallMe'])this[_0x86d3('0x68')](_0x35d6fe[_0x2a5f6c]);}else{notSendMessagesQueue(_0x35d6fe[_0x2a5f6c]);}}}};Preview[_0x86d3('0x61')]['clearZombieChannel']=function(_0x2f0bf6){var _0x432133=this;this[_0x86d3('0x11')][_0x86d3('0xe')](function(){if(!_[_0x86d3('0x69')](_0x432133[_0x86d3('0x14')][_0x2f0bf6])){loggerAction['info'](_0x86d3('0x6a'),_0x2f0bf6,_0x86d3('0x6b'),_0x432133['actions'][_0x2f0bf6][_0x86d3('0x6c')],_0x86d3('0x6d'),JSON[_0x86d3('0x53')](_0x432133[_0x86d3('0x63')][_0x432133[_0x86d3('0x14')][_0x2f0bf6]['queue']][_0x86d3('0x4b')]),_0x86d3('0x6e'),JSON[_0x86d3('0x53')](_0x432133[_0x86d3('0x63')][_0x432133[_0x86d3('0x14')][_0x2f0bf6][_0x86d3('0x6c')]][_0x86d3('0x2b')]),JSON[_0x86d3('0x53')](_0x432133[_0x86d3('0x14')][_0x2f0bf6][_0x86d3('0x6f')]),JSON[_0x86d3('0x53')](_[_0x86d3('0x70')](_0x432133['actions'][_0x2f0bf6],[_0x86d3('0x71'),_0x86d3('0x72'),'VoiceQueueId',_0x86d3('0x73')])));return ami[_0x86d3('0x74')]({'action':_0x86d3('0x75'),'channel':_0x432133[_0x86d3('0x14')][_0x2f0bf6][_0x86d3('0x76')]})[_0x86d3('0x77')](function(_0x5f20d9){if(_0x5f20d9['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x432133['actions'][_0x2f0bf6]){ut[_0x86d3('0x78')](_0x432133[_0x86d3('0x63')][_0x432133[_0x86d3('0x14')][_0x2f0bf6][_0x86d3('0x6c')]],_0x86d3('0x79'));if(_0x432133[_0x86d3('0x14')][_0x2f0bf6][_0x86d3('0x6f')]===!![]){ut['decrementTalkink'](_0x432133[_0x86d3('0x63')][_0x432133[_0x86d3('0x14')][_0x2f0bf6][_0x86d3('0x6c')]],_0x86d3('0x79'));ut[_0x86d3('0x7a')](_0x86d3('0x7b')+_0x2f0bf6,_0x432133[_0x86d3('0x14')][_0x2f0bf6]['queue']);}ut[_0x86d3('0x7a')]('[Dialer][checkChannel][Preview]'+_0x2f0bf6,_0x432133[_0x86d3('0x14')][_0x2f0bf6][_0x86d3('0x6c')]);delete _0x432133[_0x86d3('0x14')][_0x2f0bf6];}},0x2328);}});}});};Preview[_0x86d3('0x61')][_0x86d3('0x7c')]=function(){var _0x55e345=this;loggerAction[_0x86d3('0x56')](_0x86d3('0x7d'),_[_0x86d3('0x7e')](this['actions']));for(var _0x4ad164 in this['actions']){if(_0x55e345[_0x86d3('0x14')]['hasOwnProperty'](_0x4ad164)){_0x55e345[_0x86d3('0x7f')](_0x4ad164);}}};Preview[_0x86d3('0x61')][_0x86d3('0x68')]=function(_0x319ea0){var _0x5963bb=this;rpcDb['getContactRecallMe'](_0x319ea0['id'],ut['agentReadyId'](this[_0x86d3('0x15')]))[_0x86d3('0x80')](function(_0x5a7b69){if(!_[_0x86d3('0x69')](_0x5a7b69)){for(var _0x37fe22=0x0;_0x37fe22<_0x5a7b69[_0x86d3('0x81')];_0x37fe22+=0x1){if(ut[_0x86d3('0x82')](_0x5a7b69[_0x37fe22][_0x86d3('0x83')])<_0x319ea0['dialRecallMeTimeout']*0x3c){if(_0x5a7b69[_0x37fe22][_0x86d3('0x84')]&&!_0x5a7b69[_0x37fe22][_0x86d3('0x84')][_0x86d3('0x85')]){_0x5963bb[_0x86d3('0x86')](_0x5a7b69[_0x37fe22]['id'])['then'](ut[_0x86d3('0x87')](_0x86d3('0x88')))['catch'](ut[_0x86d3('0x87')](_0x86d3('0x88')));}else{rpcDb[_0x86d3('0x89')](_0x5a7b69[_0x37fe22]['id']);}}else{var _0x29bdee=new Action(_0x5a7b69[_0x37fe22],_0x319ea0);_0x29bdee[_0x86d3('0x8a')]=moment()[_0x86d3('0x8b')](_0x86d3('0x8c'));_0x319ea0['outboundReCallsDay']+=0x1;ut['logCustomer'](_0x29bdee,0x17,_0x86d3('0x8d'));if(_0x319ea0['dialRecallInQueue']){rpcDb['rescheduleContactInQueue'](ut['createBody'](_0x5a7b69[_0x37fe22]));rpcDb[_0x86d3('0x8e')](_0x29bdee,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x86d3('0x8f')](_0x29bdee,0x16,'RecallFailedTimeout');rpcDb[_0x86d3('0x8e')](_0x29bdee,_0x86d3('0x90'));rpcDb[_0x86d3('0x91')](_0x29bdee,'[HistoryRecallClose]');}}}}})['catch'](ut[_0x86d3('0x87')](_0x86d3('0x92')));};Preview[_0x86d3('0x61')][_0x86d3('0x67')]=function(_0x22d8eb){_0x22d8eb[_0x86d3('0x5a')]=!![];if(ut[_0x86d3('0x93')](_0x22d8eb[_0x86d3('0x2a')])){_0x22d8eb[_0x86d3('0x5f')]=_0x86d3('0x94');}else if(!ut[_0x86d3('0x95')](_0x22d8eb[_0x86d3('0x30')])){_0x22d8eb[_0x86d3('0x5f')]=_0x86d3('0x5c');}else if(!this[_0x86d3('0x96')](_0x22d8eb[_0x86d3('0x51')])){if(!this[_0x86d3('0x96')](_0x22d8eb[_0x86d3('0x97')])){_0x22d8eb['message']=_0x86d3('0x98');}else{_0x22d8eb[_0x86d3('0x5f')]=_0x86d3('0x99');}}else{_0x22d8eb['message']=_0x86d3('0x99');}emitCampaignPreview(_0x22d8eb);};Preview[_0x86d3('0x61')][_0x86d3('0x9a')]=function(_0x90ca60,_0x48f9d4,_0x41d448){var _0x574998=this;var _0x1e11bd=this[_0x86d3('0x14')][_0x48f9d4];var _0x2cea1a=this[_0x86d3('0x63')][_0x1e11bd[_0x86d3('0x6c')]];var _0x56fd96;var _0x3cc1d8=![];var _0x5c8e44=0x2;var _0x1ddd6d=0x3;if(_0x2cea1a){switch(_0x41d448){case'1':_0x2cea1a[_0x86d3('0x3d')]+=0x1;_0x1e11bd['countnosuchnumberretry']+=0x1;_0x1e11bd[_0x86d3('0x9b')]=ut[_0x86d3('0x9c')](_0x1e11bd);ut[_0x86d3('0x8f')](_0x1e11bd,0x0,_0x86d3('0x9d'));ami[_0x86d3('0x25')](_0x86d3('0x9e'),ut[_0x86d3('0x9f')](_0x1e11bd,'nosuchnumber'));rpcDb[_0x86d3('0x8e')](_0x1e11bd,_0x86d3('0xa0'));_0x574998[_0x86d3('0xa1')](_0x1e11bd,'0',_0x2cea1a)[_0x86d3('0x80')](function(_0x46e356){_0x3cc1d8=_0x46e356['additional']==0x1;_0x5c8e44=_0x2cea1a[_0x86d3('0xa2')];_0x1ddd6d=_0x2cea1a[_0x86d3('0xa3')];if(!_0x3cc1d8){if(ut['totalGlobal'](_0x1e11bd)>=_0x2cea1a[_0x86d3('0xa4')]){_0x56fd96=ut[_0x86d3('0xa5')](_0x1e11bd,0xf,_0x86d3('0xa6'));rpcDb[_0x86d3('0x91')](_0x56fd96,_0x86d3('0xa7'));}else{if(_0x1e11bd[_0x86d3('0xa8')]>=_0x2cea1a[_0x86d3('0xa9')]){rpcDb[_0x86d3('0x91')](_0x1e11bd,_0x86d3('0xa7'));}else{rpcDb[_0x86d3('0xaa')](ut[_0x86d3('0xab')](_0x1e11bd,_0x86d3('0xa8'),_0x2cea1a[_0x86d3('0xa2')]),_0x1e11bd[_0x86d3('0xac')],_0x1e11bd['activeContact']);}}delete this[_0x86d3('0x14')][_0x90ca60[_0x86d3('0xad')]];}else{_0x1e11bd[_0x86d3('0xa8')]++;logger[_0x86d3('0x56')]('actioncountonusuch',_0x1e11bd[_0x86d3('0xa8')]);logger[_0x86d3('0x56')]('id',_0x1e11bd[_0x86d3('0xae')]);_0x574998[_0x86d3('0xaf')]({'id':_0x1e11bd['idContact'],'field':{'countnosuchnumberretry':_0x1e11bd['countnosuchnumberretry']}})[_0x86d3('0x80')](function(){_0x574998['swapAdditionalPhones'](_0x1e11bd,_0x5c8e44,_0x1ddd6d)[_0x86d3('0x80')](function(){});});}});break;case'ANSWER':var _0x4d280a=moment()[_0x86d3('0x8b')](_0x86d3('0x8c'));_0x1e11bd[_0x86d3('0xb0')]=_0x4d280a;_0x1e11bd[_0x86d3('0xb1')]=_0x4d280a;_0x1e11bd[_0x86d3('0x6f')]=!![];_0x2cea1a['pTalking']+=0x1;logger[_0x86d3('0x56')](_0x86d3('0xb2'),_0x1e11bd['uniqueid'],_0x86d3('0xb3'),_0x2cea1a[_0x86d3('0x27')],'pTalking:\x20',_0x2cea1a[_0x86d3('0x2b')]);ami['emit'](_0x86d3('0xb4'),ut['buildObj'](_0x1e11bd,'connect',this[_0x86d3('0x63')][_0x1e11bd['queue']]));if(_0x2cea1a[_0x86d3('0xb5')]){ami[_0x86d3('0x25')](_0x86d3('0xb6'),ut[_0x86d3('0xb7')](_0x1e11bd));}break;case'16':ami[_0x86d3('0x25')](_0x86d3('0xb8'),ut[_0x86d3('0x9f')](_0x1e11bd,_0x86d3('0xb9'),this['campaignsPreview'][_0x1e11bd[_0x86d3('0x6c')]]));emitVoiceQueueChannelRemove(ut[_0x86d3('0x9f')](_0x1e11bd,_0x86d3('0xb9')));_0x2cea1a[_0x86d3('0x35')]+=0x1;_0x2cea1a[_0x86d3('0x2d')]+=0x1;_0x2cea1a['answered']+=0x1;ut[_0x86d3('0xba')](_0x2cea1a,_0x86d3('0xbb'));_0x1e11bd[_0x86d3('0x9b')]=ut[_0x86d3('0x9c')](_0x1e11bd);ut[_0x86d3('0x8f')](_0x1e11bd,0x4,_0x86d3('0xbc'));rpcDb[_0x86d3('0x8e')](_0x1e11bd,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x86d3('0x91')](_0x1e11bd,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x86d3('0xbd')](_0x1e11bd);_0x2cea1a['sumDuration']+=_0x1e11bd['talktime'];_0x2cea1a[_0x86d3('0xbe')]+=_0x1e11bd[_0x86d3('0xbf')];logger['info'](_0x86d3('0xc0'),_0x1e11bd[_0x86d3('0xc1')],_0x86d3('0xb3'),_0x2cea1a[_0x86d3('0x27')],_0x86d3('0x6e'),_0x2cea1a[_0x86d3('0x2b')]);delete this[_0x86d3('0x14')][_0x90ca60['linkedid']];break;case'BUSY':_0x2cea1a[_0x86d3('0x37')]+=0x1;_0x1e11bd[_0x86d3('0xc2')]+=0x1;_0x1e11bd[_0x86d3('0x9b')]=ut[_0x86d3('0x9c')](_0x1e11bd);ut[_0x86d3('0x8f')](_0x1e11bd,0x5,_0x86d3('0xc3'));_0x5c8e44=_0x2cea1a['dialBusyRetryFrequency'];_0x1ddd6d=_0x2cea1a[_0x86d3('0xa3')];ami[_0x86d3('0x25')](_0x86d3('0xc4'),ut[_0x86d3('0x9f')](_0x1e11bd,_0x86d3('0xc5')));rpcDb[_0x86d3('0x8e')](_0x1e11bd,_0x86d3('0xc6'));_0x574998[_0x86d3('0xa1')](_0x1e11bd,'5',_0x2cea1a)[_0x86d3('0x80')](function(_0x5948e1){_0x3cc1d8=_0x5948e1[_0x86d3('0xc7')]==0x1;if(!_0x3cc1d8){if(ut[_0x86d3('0x9c')](_0x1e11bd)>=_0x2cea1a['dialGlobalMaxRetry']){_0x56fd96=ut['cloneAction'](_0x1e11bd,0xf,_0x86d3('0xa6'));rpcDb[_0x86d3('0x91')](_0x56fd96,_0x86d3('0xc8'));}else{if(_0x1e11bd['countbusyretry']>=_0x2cea1a[_0x86d3('0xc9')]){rpcDb[_0x86d3('0x91')](_0x1e11bd,_0x86d3('0xc6'));}else{rpcDb[_0x86d3('0xaa')](ut[_0x86d3('0xab')](_0x1e11bd,'countbusyretry',_0x2cea1a[_0x86d3('0xca')]),_0x1e11bd[_0x86d3('0xac')],_0x1e11bd['activeContact']);}}}else{_0x1e11bd[_0x86d3('0xc2')]++;_0x574998[_0x86d3('0xaf')]({'id':_0x1e11bd[_0x86d3('0xae')],'field':{'countbusyretry':_0x1e11bd[_0x86d3('0xc2')]}})['then'](function(){_0x574998[_0x86d3('0xcb')](_0x1e11bd,_0x5c8e44,_0x1ddd6d)[_0x86d3('0x80')](function(){});});}});break;case _0x86d3('0xcc'):_0x2cea1a[_0x86d3('0x3c')]+=0x1;_0x1e11bd[_0x86d3('0xcd')]+=0x1;_0x1e11bd['countglobal']=ut[_0x86d3('0x9c')](_0x1e11bd);ut[_0x86d3('0x8f')](_0x1e11bd,0x3,_0x86d3('0xce'));_0x5c8e44=_0x2cea1a[_0x86d3('0xcf')];_0x1ddd6d=_0x2cea1a[_0x86d3('0xa3')];var _0x2215fc=ut[_0x86d3('0xd0')](_0x1e11bd,_0x2cea1a);ami[_0x86d3('0x25')](_0x86d3('0xd1'),_0x2215fc);rpcDb[_0x86d3('0x8e')](_0x1e11bd,'[callProgressDetectingCustomer][logNoAnswer]');_0x574998['verifyAdditionalPhones'](_0x1e11bd,'3',_0x2cea1a)[_0x86d3('0x80')](function(_0x22b67b){_0x3cc1d8=_0x22b67b['additional']==0x1;if(!_0x3cc1d8){if(ut[_0x86d3('0x9c')](_0x1e11bd)>=_0x2cea1a[_0x86d3('0xa4')]){_0x56fd96=ut[_0x86d3('0xa5')](_0x1e11bd,0xf,_0x86d3('0xa6'));rpcDb[_0x86d3('0x91')](_0x56fd96,_0x86d3('0xd2'));}else{if(_0x1e11bd[_0x86d3('0xcd')]>=_0x2cea1a[_0x86d3('0xd3')]){rpcDb[_0x86d3('0x91')](_0x1e11bd,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x1e11bd,'countnoanswerretry',_0x2cea1a[_0x86d3('0xcf')]),_0x1e11bd[_0x86d3('0xac')],_0x1e11bd[_0x86d3('0xd4')]);}}}else{_0x1e11bd[_0x86d3('0xcd')]++;_0x574998[_0x86d3('0xaf')]({'id':_0x1e11bd[_0x86d3('0xae')],'field':{'countnoanswerretry':_0x1e11bd[_0x86d3('0xcd')]}})['then'](function(){_0x574998[_0x86d3('0xcb')](_0x1e11bd,_0x5c8e44,_0x1ddd6d)[_0x86d3('0x80')](function(){});});}});break;case _0x86d3('0xd5'):_0x2cea1a[_0x86d3('0x38')]+=0x1;_0x1e11bd['countcongestionretry']+=0x1;_0x1e11bd[_0x86d3('0x9b')]=ut['totalGlobal'](_0x1e11bd);ut[_0x86d3('0x8f')](_0x1e11bd,0x8,_0x86d3('0xd6'));_0x5c8e44=_0x2cea1a[_0x86d3('0xd7')];_0x1ddd6d=_0x2cea1a[_0x86d3('0xa3')];ami[_0x86d3('0x25')]('custom:agentcongestion',ut['buildObj'](_0x1e11bd,_0x86d3('0xd8')));rpcDb['createCustomerHistory'](_0x1e11bd,_0x86d3('0xd9'));_0x574998['verifyAdditionalPhones'](_0x1e11bd,'8',_0x2cea1a)[_0x86d3('0x80')](function(_0x4b20c0){_0x3cc1d8=_0x4b20c0['additional']==0x1;if(!_0x3cc1d8){if(ut[_0x86d3('0x9c')](_0x1e11bd)>=_0x2cea1a[_0x86d3('0xa4')]){_0x56fd96=ut[_0x86d3('0xa5')](_0x1e11bd,0xf,_0x86d3('0xa6'));rpcDb[_0x86d3('0x91')](_0x56fd96,_0x86d3('0xda'));}else{if(_0x1e11bd[_0x86d3('0xdb')]>=_0x2cea1a[_0x86d3('0xdc')]){rpcDb[_0x86d3('0x91')](_0x1e11bd,_0x86d3('0xd9'));}else{rpcDb[_0x86d3('0xaa')](ut[_0x86d3('0xab')](_0x1e11bd,_0x86d3('0xdb'),_0x2cea1a[_0x86d3('0xca')]),_0x1e11bd[_0x86d3('0xac')],_0x1e11bd['activeContact']);}}}else{_0x1e11bd['countcongestionretry']++;_0x574998['incrementPreviewCounters']({'id':_0x1e11bd[_0x86d3('0xae')],'field':{'countcongestionretry':_0x1e11bd[_0x86d3('0xdb')]}})[_0x86d3('0x80')](function(){_0x574998[_0x86d3('0xcb')](_0x1e11bd,_0x5c8e44,_0x1ddd6d)[_0x86d3('0x80')](function(){});});}});break;case _0x86d3('0xdd'):_0x2cea1a[_0x86d3('0x40')]+=0x1;_0x1e11bd[_0x86d3('0xde')]+=0x1;_0x1e11bd[_0x86d3('0x9b')]=ut[_0x86d3('0x9c')](_0x1e11bd);ut[_0x86d3('0x8f')](_0x1e11bd,0x14,'AgentReject');_0x5c8e44=_0x2cea1a[_0x86d3('0xdf')];_0x1ddd6d=_0x2cea1a['callAdditionalPhoneAfterMin'];ami[_0x86d3('0x25')](_0x86d3('0xe0'),ut[_0x86d3('0x9f')](_0x1e11bd,_0x86d3('0xe1')));rpcDb['createCustomerHistory'](_0x1e11bd,_0x86d3('0xe2'));_0x574998[_0x86d3('0xa1')](_0x1e11bd,'20',_0x2cea1a)[_0x86d3('0x80')](function(_0x909c3){_0x3cc1d8=_0x909c3[_0x86d3('0xc7')]==0x1;if(!_0x3cc1d8){if(ut[_0x86d3('0x9c')](_0x1e11bd)>=_0x2cea1a[_0x86d3('0xa4')]){_0x56fd96=ut[_0x86d3('0xa5')](_0x1e11bd,0x14,_0x86d3('0xe3'));rpcDb[_0x86d3('0x91')](_0x56fd96,_0x86d3('0xe4'));}else{if(_0x1e11bd[_0x86d3('0xde')]>=_0x2cea1a[_0x86d3('0xe5')]){rpcDb[_0x86d3('0x91')](_0x1e11bd,_0x86d3('0xe4'));}else{rpcDb[_0x86d3('0xaa')](ut[_0x86d3('0xab')](_0x1e11bd,'countagentrejectretry',_0x2cea1a[_0x86d3('0xdf')]),_0x1e11bd[_0x86d3('0xac')],_0x1e11bd[_0x86d3('0xd4')]);}}}else{_0x1e11bd[_0x86d3('0xcd')]++;_0x574998['incrementPreviewCounters']({'id':_0x1e11bd[_0x86d3('0xae')],'field':{'countnoanswerretry':_0x1e11bd['countnoanswerretry']}})['then'](function(){_0x574998[_0x86d3('0xcb')](_0x1e11bd,_0x5c8e44,_0x1ddd6d)[_0x86d3('0x80')](function(){});});}});break;case _0x86d3('0xe6'):_0x2cea1a[_0x86d3('0x41')]+=0x1;_0x1e11bd[_0x86d3('0xe7')]+=0x1;_0x1e11bd[_0x86d3('0x9b')]=ut[_0x86d3('0x9c')](_0x1e11bd);ut[_0x86d3('0x8f')](_0x1e11bd,0xb,'Abandoned');rpcDb['createCustomerHistory'](_0x1e11bd,'[callProgressDetectingCustomer][logAbandoned]');_0x574998[_0x86d3('0xa1')](_0x1e11bd,'11',_0x2cea1a)[_0x86d3('0x80')](function(_0x937af0){_0x3cc1d8=_0x937af0['additional']==0x1;if(!_0x3cc1d8){if(ut[_0x86d3('0x9c')](_0x1e11bd)>=_0x2cea1a['dialGlobalMaxRetry']){_0x56fd96=ut[_0x86d3('0xa5')](_0x1e11bd,0xf,_0x86d3('0xa6'));rpcDb[_0x86d3('0x91')](_0x56fd96,_0x86d3('0xe8'));}else{if(_0x1e11bd['countabandonedetry']>=_0x2cea1a[_0x86d3('0xe9')]){rpcDb[_0x86d3('0x91')](_0x1e11bd,_0x86d3('0xe8'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x1e11bd,'countabandonedretry',_0x2cea1a[_0x86d3('0xea')]),_0x1e11bd[_0x86d3('0xac')],_0x1e11bd['activeContact']);}}}else{_0x1e11bd[_0x86d3('0xcd')]++;_0x574998['incrementPreviewCounters']({'id':_0x1e11bd[_0x86d3('0xae')],'field':{'countnoanswerretry':_0x1e11bd[_0x86d3('0xcd')]}})[_0x86d3('0x80')](function(){_0x574998['swapAdditionalPhones'](_0x1e11bd,_0x5c8e44,_0x1ddd6d)[_0x86d3('0x80')](function(){});});}});break;case'18':_0x2cea1a[_0x86d3('0xeb')]+=0x1;_0x1e11bd[_0x86d3('0xec')]+=0x1;_0x1e11bd[_0x86d3('0x9b')]=ut[_0x86d3('0x9c')](_0x1e11bd);ut['logCustomer'](_0x1e11bd,0x12,_0x90ca60[_0x86d3('0xed')]||_0x90ca60[_0x86d3('0xee')]);ami['emit'](_0x86d3('0xef'),ut[_0x86d3('0x9f')](_0x1e11bd,'amd'));rpcDb[_0x86d3('0x8e')](_0x1e11bd,'[callProgressDetectingCustomer][hangupInAMD]');_0x574998['verifyAdditionalPhones'](_0x1e11bd,'18',_0x2cea1a)[_0x86d3('0x80')](function(_0x144e43){_0x3cc1d8=_0x144e43[_0x86d3('0xc7')]==0x1;if(!_0x3cc1d8){if(ut[_0x86d3('0x9c')](_0x1e11bd)>=_0x2cea1a[_0x86d3('0xa4')]){_0x56fd96=ut[_0x86d3('0xa5')](_0x1e11bd,0x12,_0x86d3('0xa6'));rpcDb[_0x86d3('0x91')](_0x56fd96,_0x86d3('0xf0'));}else{rpcDb[_0x86d3('0x91')](_0x1e11bd,_0x86d3('0xf0'));}}else{_0x1e11bd[_0x86d3('0xcd')]++;_0x574998[_0x86d3('0xaf')]({'id':_0x1e11bd['idContact'],'field':{'countnoanswerretry':_0x1e11bd[_0x86d3('0xcd')]}})[_0x86d3('0x80')](function(){_0x574998[_0x86d3('0xcb')](_0x1e11bd,_0x5c8e44,_0x1ddd6d)[_0x86d3('0x80')](function(){});});}});delete this[_0x86d3('0x14')][_0x90ca60[_0x86d3('0xad')]];break;case'19':_0x2cea1a['outboundUnknownCallsDay']+=0x1;_0x1e11bd[_0x86d3('0x9b')]=ut['totalGlobal'](_0x1e11bd);ut[_0x86d3('0x8f')](_0x1e11bd,0x13,_0x90ca60[_0x86d3('0xed')]||_0x90ca60['dialstatus']);ami['emit'](_0x86d3('0xef'),ut[_0x86d3('0x9f')](_0x1e11bd,_0x86d3('0xf1')));rpcDb['createCustomerHistory'](_0x1e11bd,'[callProgressDetectingCustomer][machine]');_0x574998[_0x86d3('0xa1')](_0x1e11bd,'18',_0x2cea1a)[_0x86d3('0x80')](function(_0x9ee5af){_0x3cc1d8=_0x9ee5af['additional']==0x1;if(!_0x3cc1d8){if(ut[_0x86d3('0x9c')](_0x1e11bd)>=_0x2cea1a[_0x86d3('0xa4')]){_0x56fd96=ut[_0x86d3('0xa5')](_0x1e11bd,0xf,_0x86d3('0xa6'));rpcDb[_0x86d3('0x91')](_0x56fd96,_0x86d3('0xf2'));}else{rpcDb[_0x86d3('0x91')](_0x1e11bd,_0x86d3('0xf2'));}}else{_0x1e11bd[_0x86d3('0xcd')]++;_0x574998[_0x86d3('0xaf')]({'id':_0x1e11bd[_0x86d3('0xae')],'field':{'countnoanswerretry':_0x1e11bd['countnoanswerretry']}})[_0x86d3('0x80')](function(){_0x574998['swapAdditionalPhones'](_0x1e11bd,_0x5c8e44,_0x1ddd6d)['then'](function(){});});}});delete this[_0x86d3('0x14')][_0x90ca60[_0x86d3('0xad')]];break;default:if(_0x1e11bd['dialAnswer']){ut['decrementTalkink'](_0x2cea1a,_0x86d3('0xf3'));ut[_0x86d3('0x7a')](_0x86d3('0xf4')+_0x2cea1a[_0x86d3('0x27')],_0x90ca60);}_0x2cea1a['outboundUnknownCallsDay']+=0x1;_0x1e11bd[_0x86d3('0x9b')]=ut[_0x86d3('0x9c')](_0x1e11bd);ut[_0x86d3('0x8f')](_0x1e11bd,0xc,_0x90ca60[_0x86d3('0xed')]||_0x90ca60[_0x86d3('0xee')]);_0x5c8e44=_0x2cea1a['dialAgentRejectRetryFrequency'];_0x1ddd6d=_0x2cea1a[_0x86d3('0xa3')];rpcDb[_0x86d3('0x8e')](_0x1e11bd,_0x86d3('0xf5'));_0x574998['verifyAdditionalPhones'](_0x1e11bd,'20',_0x2cea1a)[_0x86d3('0x80')](function(_0x5375d6){_0x3cc1d8=_0x5375d6[_0x86d3('0xc7')]==0x1;if(!_0x3cc1d8){if(ut[_0x86d3('0x9c')](_0x1e11bd)>=_0x2cea1a['dialGlobalMaxRetry']){_0x56fd96=ut[_0x86d3('0xa5')](_0x1e11bd,0xf,_0x86d3('0xa6'));rpcDb[_0x86d3('0x91')](_0x56fd96,_0x86d3('0xf6'));}else{rpcDb[_0x86d3('0x91')](_0x1e11bd,_0x86d3('0xf6'));}delete this['actions'][_0x90ca60[_0x86d3('0xad')]];}else{_0x574998['swapAdditionalPhones'](_0x1e11bd,_0x5c8e44,_0x1ddd6d)[_0x86d3('0x80')](function(){});}});}if(!(_0x1e11bd[_0x86d3('0x6f')]&&_0x41d448==='16')){ut[_0x86d3('0x78')](_0x2cea1a,_0x86d3('0xf7'));logger['info'](_0x86d3('0xf8'),_0x1e11bd[_0x86d3('0xc1')],_0x86d3('0xb3'),_0x2cea1a[_0x86d3('0x27')],_0x86d3('0x6d'),_0x2cea1a[_0x86d3('0x4b')]);}if(_0x41d448!=='ANSWER'){delete this[_0x86d3('0x14')][_0x90ca60[_0x86d3('0xad')]];delete this['actions'][_0x90ca60['destlinkedid']];}}};Preview[_0x86d3('0x61')]['callProgressDetectingAgent']=function(_0x4a5cc6,_0xeb0ac9,_0x983367){if(_[_0x86d3('0xf9')](_0xeb0ac9)&&'object'!==typeof _0xeb0ac9){return;}if(_[_0x86d3('0xf9')](_0x983367)&&_0x86d3('0xfa')!==typeof _0x983367){return;}switch(_0x983367[_0x86d3('0xfb')]){case'0':ut[_0x86d3('0xfc')](_0x4a5cc6,0x0,_0x86d3('0x9d'));rpcDb['createAgentHistory'](_0x4a5cc6,_0x86d3('0xfd'));break;case'3':ut[_0x86d3('0xfc')](_0x4a5cc6,0x3,'NoAnswer');rpcDb['createAgentHistory'](_0x4a5cc6,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0x86d3('0xfc')](_0x4a5cc6,0x5,'Busy');rpcDb['createAgentHistory'](_0x4a5cc6,_0x86d3('0xfe'));break;case'8':ut[_0x86d3('0xfc')](_0x4a5cc6,0x8,'Congestion');rpcDb['createAgentHistory'](_0x4a5cc6,_0x86d3('0xff'));break;case'22':ut[_0x86d3('0xfc')](_0x4a5cc6,0x16,_0x86d3('0x100'));rpcDb['createAgentHistory'](_0x4a5cc6,_0x86d3('0x101'));break;default:ut[_0x86d3('0xfc')](_0x4a5cc6,0xc,_0x983367[_0x86d3('0xfb')]);rpcDb[_0x86d3('0x102')](_0x4a5cc6,_0x86d3('0xff'));}ut[_0x86d3('0x78')](_0xeb0ac9,'[callProgressDetectingAgent]');logger[_0x86d3('0x56')](_0x86d3('0x103'),_0x4a5cc6[_0x86d3('0xc1')],'\x20Queue',_0xeb0ac9[_0x86d3('0x27')],'originated:\x20',_0xeb0ac9[_0x86d3('0x4b')]);delete this[_0x86d3('0x14')][_0x4a5cc6[_0x86d3('0xc1')]];};Preview[_0x86d3('0x61')]['verifyAdditionalPhones']=function(_0x5cd823,_0xd29faf,_0x41b2e3){return Promise[_0x86d3('0x104')]()[_0x86d3('0x80')](cmHopperAdditionalPhone[_0x86d3('0xa1')](_0x5cd823,_0xd29faf,_0x41b2e3))[_0x86d3('0x77')](logger[_0x86d3('0x56')]('[verifyAdditionalPhone]\x20'));};Preview[_0x86d3('0x61')][_0x86d3('0xcb')]=function(_0x303176,_0x16df83,_0x4b884e){return Promise[_0x86d3('0x104')]()['then'](cmHopperAdditionalPhone[_0x86d3('0xcb')](_0x303176,_0x16df83,_0x4b884e))[_0x86d3('0x77')](logger[_0x86d3('0x56')]('[swapAdditionalPhone]\x20'));};Preview[_0x86d3('0x61')][_0x86d3('0xaf')]=function(_0x58738c){return Promise['resolve']()['then'](cmHopperAdditionalPhone[_0x86d3('0xaf')](_0x58738c))['catch'](logger[_0x86d3('0x56')](_0x86d3('0x105')));};Preview['prototype'][_0x86d3('0x106')]=function(_0x1080f3,_0x2ffcee,_0x5e3f8f,_0x9b1afc,_0x37e744){var _0x1f09ea=this;return new Promise(function(_0x224bb6,_0x48f215){if(_[_0x86d3('0x69')](_0x2ffcee)||_[_0x86d3('0x69')](_0x2ffcee['Contact'])||_[_0x86d3('0x69')](_0x2ffcee[_0x86d3('0x107')])||_[_0x86d3('0x69')](_0x2ffcee[_0x86d3('0x108')])){_0x48f215(ut[_0x86d3('0x5f')](_0x86d3('0x109'),_0x9b1afc,_0x37e744));return;}var _0x1724c5=uuid['v4']();var _0x1ccc49=_0x1f09ea['campaignsPreview'][_0x2ffcee[_0x86d3('0x6b')][_0x86d3('0x27')]];var _0x7857bb=_0x5e3f8f?_0x1f09ea['agents'][_0x5e3f8f]['id']:undefined;_0x1f09ea[_0x86d3('0x14')][_0x1724c5]=new Action(_0x2ffcee,_0x1ccc49,_0x1724c5,_0x5e3f8f,_0x7857bb);var _0x7ac1e1=_0x1f09ea['actions'][_0x1724c5];_0x7ac1e1[_0x86d3('0xac')]=_0x9b1afc;_0x7ac1e1[_0x86d3('0xd4')]=_0x37e744;_0x7ac1e1[_0x86d3('0x10a')]=_0x5e3f8f;if(_[_0x86d3('0x10b')](_0x1080f3)){_0x1f09ea[_0x86d3('0x10c')](_0x7ac1e1,_0x1ccc49,_0x2ffcee,_0x5e3f8f)['then'](function(_0x4c1d86){logger['info']('[Preview][execCall][success]','Queue:\x20'+_0x7ac1e1[_0x86d3('0x6c')]+_0x86d3('0x10d')+_0x7ac1e1[_0x86d3('0xae')],JSON['stringify'](_0x4c1d86));ami[_0x86d3('0x25')](_0x86d3('0x10e'),ut[_0x86d3('0x9f')](_0x7ac1e1,_0x86d3('0x10f'),_0x1f09ea['campaignsPreview'][_0x7ac1e1[_0x86d3('0x6c')]]));_0x224bb6(ut['message'](_0x86d3('0x110')));})[_0x86d3('0x77')](function(_0x1c3d34){ut['logger']('[Preview][execCall][failure]',_0x1c3d34);_0x48f215(ut[_0x86d3('0x5f')]('Call\x20failed',_0x9b1afc,_0x37e744));});}else{_0x1ccc49[_0x86d3('0x36')]+=0x1;ut[_0x86d3('0x111')](_0x7ac1e1);rpcDb[_0x86d3('0x112')](_0x7ac1e1,'[Blacklist][error]');delete _0x1f09ea[_0x86d3('0x14')][_0x1724c5];_0x48f215(ut['message'](_0x86d3('0x113'),_0x9b1afc,_0x37e744));}});};Preview[_0x86d3('0x61')][_0x86d3('0x96')]=function(_0x1548a4){return!_['isNil'](_0x1548a4)&&!_['isNil'](_0x1548a4['name'])&&!_[_0x86d3('0x69')](_0x1548a4['active'])&&_0x1548a4['active']&&!_[_0x86d3('0x69')](this[_0x86d3('0x13')][util['format'](_0x86d3('0x114'),_0x1548a4[_0x86d3('0x27')])])&&!_['isNil'](this[_0x86d3('0x13')][util[_0x86d3('0x8b')](_0x86d3('0x114'),_0x1548a4[_0x86d3('0x27')])][_0x86d3('0x75')])&&(this['trunks'][util[_0x86d3('0x8b')]('SIP/%s',_0x1548a4[_0x86d3('0x27')])]['status']===_0x86d3('0x115')||this[_0x86d3('0x13')][util[_0x86d3('0x8b')](_0x86d3('0x114'),_0x1548a4['name'])][_0x86d3('0x75')]===_0x86d3('0x116'));};Preview[_0x86d3('0x61')][_0x86d3('0x86')]=function(_0x3f6c91,_0x505d83){return this[_0x86d3('0x117')](_0x3f6c91,_0x505d83)[_0x86d3('0x80')](function(_0x4f2109){return _[_0x86d3('0x70')](_0x4f2109,[_0x86d3('0x5f')]);})[_0x86d3('0x77')](function(_0x256ef3){if(_0x256ef3[_0x86d3('0x118')]){rpcDb[_0x86d3('0x119')](_0x3f6c91);}if(_0x256ef3[_0x86d3('0x11a')]){rpcDb[_0x86d3('0x89')](_0x3f6c91);}throw _[_0x86d3('0x70')](_0x256ef3,[_0x86d3('0x5f')]);});};Preview[_0x86d3('0x61')]['execRun']=function(_0x58b9c1,_0x4b615e){var _0x22ad95=this;var _0x196026,_0x3842e5;return rpcDb[_0x86d3('0x11b')](_0x58b9c1)[_0x86d3('0x80')](function(_0x36e8c6){if(!_['isNil'](_0x36e8c6[0x0])){_0x3842e5=_0x36e8c6[0x0][_0x86d3('0x11c')]?![]:!![];_0x196026=_0x36e8c6[0x0][_0x86d3('0x11c')]?!![]:![];_0x196026=_0x4b615e?!![]:_0x196026;}var _0xd10445=_0x22ad95[_0x86d3('0x11d')](_0x36e8c6);if(_0xd10445[_0x86d3('0x11e')]){rpcDb[_0x86d3('0x11f')](_[_0x86d3('0x70')](_0x36e8c6[0x0],[_0x86d3('0x108'),'phone']))[_0x86d3('0x80')](function(_0x5cc2cb){_0x22ad95[_0x86d3('0x106')](_0x5cc2cb,_0x36e8c6[0x0],_0x4b615e,_0x3842e5,_0x196026)[_0x86d3('0x80')](function(_0x1baae4){return _0x1baae4;})[_0x86d3('0x77')](function(_0x559226){throw _0x559226;});})['catch'](function(_0x4b617f){ut[_0x86d3('0x5d')](_0x86d3('0x120'),_0x4b617f);throw ut[_0x86d3('0x5f')](_0x86d3('0x121'),_0x3842e5,_0x196026);});}else{throw ut[_0x86d3('0x5f')](_0xd10445['message'],_0x3842e5,_0x196026);}})['catch'](function(_0x3bb103){ut['logger']('[Preview][getContactPreview]',_0x3bb103);throw ut[_0x86d3('0x5f')](_0x86d3('0x121'),![],!![]);});};Preview[_0x86d3('0x61')][_0x86d3('0x11d')]=function(_0x3ed8ea){if(_[_0x86d3('0x69')](_0x3ed8ea)||_[_0x86d3('0x10b')](_0x3ed8ea)||!_[_0x86d3('0x69')](_0x3ed8ea[0x0][_0x86d3('0x84')])&&_[_0x86d3('0x69')](_0x3ed8ea[0x0][_0x86d3('0x84')][_0x86d3('0x27')])){ut[_0x86d3('0x5d')]('[Preview][validateContact][Empty\x20Contact]',_0x3ed8ea);return{'isValid':![],'message':_0x86d3('0x122')};}var _0x26741c=this[_0x86d3('0x63')][_0x3ed8ea[0x0][_0x86d3('0x6b')][_0x86d3('0x27')]];_0x26741c[_0x86d3('0x5f')]='ACTIVE';if(_[_0x86d3('0x69')](_0x26741c)){ut[_0x86d3('0x5d')](_0x86d3('0x123'),_0x26741c);return{'isValid':![],'message':_0x86d3('0x124')};}if(!this[_0x86d3('0x96')](_0x26741c[_0x86d3('0x51')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x86d3('0x125')+_0x26741c[_0x86d3('0x27')]+_0x86d3('0x126'));if(!this['isTrunkReachable'](_0x26741c[_0x86d3('0x97')])){ut['logger'](_0x86d3('0x127'),_0x26741c['name']+_0x86d3('0x128'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x86d3('0x95')](_0x26741c[_0x86d3('0x30')])){ut[_0x86d3('0x5d')]('[Preview][validateContact][Campaign\x20Active]',_0x26741c[_0x86d3('0x27')]+_0x86d3('0x129'));return{'isValid':![],'message':_0x86d3('0x125')+_0x26741c[_0x86d3('0x27')]+_0x86d3('0x129')};}return{'isValid':!![],'message':_0x86d3('0x12a')};};Preview[_0x86d3('0x61')][_0x86d3('0x10c')]=function(_0x28b6c3,_0x132a7f,_0x3771c0,_0x3935f3){var _0xba0af4=this;return new Promise(function(_0x50ae91,_0x2cbce0){var _0x1f5985=_0x28b6c3[_0x86d3('0xc1')];var _0x344b84=_0xba0af4[_0x86d3('0x96')](_0x132a7f[_0x86d3('0x51')])?util[_0x86d3('0x8b')]('SIP/%s/%s%s',_0x132a7f[_0x86d3('0x51')][_0x86d3('0x27')],_[_0x86d3('0x69')](_0x132a7f[_0x86d3('0x33')])?'':_0x132a7f['dialPrefix'][_0x86d3('0x12b')]()||'',_0x132a7f[_0x86d3('0x12c')]>0x0?_0x3771c0['phone'][_0x86d3('0x12d')](_0x132a7f[_0x86d3('0x12c')]):_0x3771c0[_0x86d3('0x107')]):util['format'](_0x86d3('0x12e'),_[_0x86d3('0x69')](_0x132a7f['TrunkBackup'])?_0x132a7f['Trunk'][_0x86d3('0x27')]:_0x132a7f[_0x86d3('0x97')][_0x86d3('0x27')],_[_0x86d3('0x69')](_0x132a7f[_0x86d3('0x33')])?'':_0x132a7f[_0x86d3('0x33')]['trim']()||'',_0x132a7f[_0x86d3('0x12c')]>0x0?_0x3771c0[_0x86d3('0x107')]['substring'](_0x132a7f['dialCutDigit']):_0x3771c0[_0x86d3('0x107')]);var _0x2dd5f9=_0xba0af4[_0x86d3('0x96')](_0x132a7f[_0x86d3('0x51')])?ut[_0x86d3('0x12f')](_0x132a7f['Trunk'][_0x86d3('0x130')],_0x132a7f['dialOriginateCallerIdName'],_0x132a7f['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x86d3('0x131')](_0x132a7f[_0x86d3('0x32')],_0x132a7f[_0x86d3('0x132')]):_0x132a7f[_0x86d3('0x32')]):ut[_0x86d3('0x12f')](_[_0x86d3('0x69')](_0x132a7f[_0x86d3('0x97')])?_0x132a7f[_0x86d3('0x51')][_0x86d3('0x130')]:_0x132a7f[_0x86d3('0x97')]['callerid'],_0x132a7f[_0x86d3('0x133')],_0x132a7f[_0x86d3('0x132')]>0x0?ut['getCallerIdRandom'](_0x132a7f['dialOriginateCallerIdNumber'],_0x132a7f[_0x86d3('0x132')]):_0x132a7f['dialOriginateCallerIdNumber']);if(_0x2dd5f9){_0x28b6c3[_0x86d3('0x134')]=ut[_0x86d3('0x135')](_0x2dd5f9);_0x28b6c3[_0x86d3('0x136')]=ut[_0x86d3('0x137')](_0x2dd5f9);}var _0x22d89e=ut[_0x86d3('0x138')](_0x132a7f,_0x3771c0,_0x344b84,_0x2dd5f9,_0x1f5985,_0x28b6c3);_[_0x86d3('0x139')](_0x28b6c3,ut[_0x86d3('0x13a')](_0x22d89e));_0x28b6c3[_0x86d3('0x8a')]=moment()['format'](_0x86d3('0x8c'));_0x132a7f[_0x86d3('0x13b')]=_0x22d89e;ami['Action'](ut[_0x86d3('0x13c')](_0x28b6c3,_0x132a7f,_0x22d89e,_0x28b6c3['activeContact'],_0x3935f3))[_0x86d3('0x80')](function(_0x12eeed){_0x132a7f[_0x86d3('0x4b')]+=0x1;logger[_0x86d3('0x56')](_0x86d3('0x13d'),_0x1f5985,_0x86d3('0xb3'),_0x132a7f[_0x86d3('0x27')],_0x86d3('0x6d'),_0x132a7f['originated']);_0x50ae91(_0x12eeed);})[_0x86d3('0x77')](function(_0x2da689){ut[_0x86d3('0xfc')](_0x28b6c3,0xe,_0x86d3('0x13e'));rpcDb[_0x86d3('0x102')](_0x28b6c3,_0x86d3('0x13f'));_0x2cbce0(_0x2da689);});});};Preview[_0x86d3('0x61')][_0x86d3('0x1f')]=function(_0x2634d6){if(this[_0x86d3('0x14')][_0x2634d6[_0x86d3('0xad')]]){this[_0x86d3('0x14')][_0x2634d6[_0x86d3('0xad')]][_0x86d3('0x76')]=_0x2634d6[_0x86d3('0x76')];}};Preview[_0x86d3('0x61')][_0x86d3('0x140')]=function(_0x202b68){var _0xd2ac51=this;var _0x32bd86=this[_0x86d3('0x14')][_0x202b68['actionid']];if(_0x32bd86){if(_0x32bd86['lookAgent']&&this[_0x86d3('0x15')][_0x32bd86['lookAgent']]){ut[_0x86d3('0x141')](_0x32bd86,this[_0x86d3('0x15')][_0x32bd86['lookAgent']]['name'],this[_0x86d3('0x15')][_0x32bd86[_0x86d3('0x10a')]]['id']);}var _0x11776e=_['clone'](_0x32bd86);_0x11776e[_0x86d3('0xb0')]=moment()[_0x86d3('0x8b')](_0x86d3('0x8c'));var _0x51b4ec=_0xd2ac51[_0x86d3('0x63')][_0x32bd86['queue']];if(ut['isFailure'](_0x202b68['response'])){if(_0x32bd86[_0x86d3('0xac')]){rpcDb['unlockContact'](_0x32bd86['idContact']);}if(_0x32bd86[_0x86d3('0xd4')]){rpcDb[_0x86d3('0x89')](_0x32bd86[_0x86d3('0xae')]);}ami[_0x86d3('0x25')](_0x86d3('0x142'),ut['buildObj'](_0x32bd86,_0x86d3('0x143'),this[_0x86d3('0x63')][_0x32bd86[_0x86d3('0x6c')]]));this[_0x86d3('0x144')](_0x11776e,_0x51b4ec,_0x202b68);}else{_0x32bd86[_0x86d3('0x8a')]=moment()[_0x86d3('0x8b')](_0x86d3('0x8c'));ut['logAgent'](_0x11776e,0x4,_0x86d3('0xbc'));rpcDb[_0x86d3('0x102')](_0x11776e,_0x86d3('0x145'));}}};Preview[_0x86d3('0x61')][_0x86d3('0x1a')]=function(_0x4cd8a1){var _0x4c046d=this[_0x86d3('0x14')][_0x4cd8a1[_0x86d3('0xad')]];var _0x545e51;if(_0x4c046d){_0x545e51=this['campaignsPreview'][_0x4c046d['queue']];logger[_0x86d3('0x56')](_0x86d3('0x146'),_0x4cd8a1['linkedid'],_0x86d3('0xb3'),_0x545e51[_0x86d3('0x27')],'pTalking:\x20',_0x545e51[_0x86d3('0x2b')]);}if(this[_0x86d3('0x14')][_0x4cd8a1[_0x86d3('0xad')]]&&_0x4cd8a1['linkedid']!==_0x4cd8a1[_0x86d3('0xc1')]){if(_0x4cd8a1[_0x86d3('0x147')]==='16'&&this[_0x86d3('0x14')][_0x4cd8a1[_0x86d3('0xad')]]['dialAnswer']){this['callProgressDetectingCustomer'](_0x4cd8a1,_0x4cd8a1[_0x86d3('0xad')],_0x4cd8a1[_0x86d3('0x147')]);}else if(this[_0x86d3('0x14')][_0x4cd8a1[_0x86d3('0xad')]][_0x86d3('0x6f')]){logger[_0x86d3('0x56')](_0x86d3('0x148'),_0x4cd8a1[_0x86d3('0xad')],_0x4cd8a1['cause'],'\x20Queue',_0x545e51[_0x86d3('0x27')],_0x86d3('0x6e'),_0x545e51[_0x86d3('0x2b')]);this[_0x86d3('0x9a')](_0x4cd8a1,_0x4cd8a1['linkedid'],_0x4cd8a1['cause']);}}else if(_0x4c046d&&_[_0x86d3('0x69')](_0x4c046d[_0x86d3('0x149')])&&_0x545e51['dialQueueProject']&&_0x4cd8a1[_0x86d3('0xad')]===_0x4cd8a1['uniqueid']&&_[_0x86d3('0x69')](_0x4cd8a1['reason'])&&_0x4cd8a1[_0x86d3('0x147')]==='16'&&_0x4cd8a1[_0x86d3('0x14a')]==='6'&&_['isUndefined'](_0x4c046d[_0x86d3('0x14b')])){if(_0x4c046d[_0x86d3('0xac')]){rpcDb[_0x86d3('0x119')](_0x4c046d[_0x86d3('0xae')]);}if(_0x4c046d[_0x86d3('0xd4')]){rpcDb[_0x86d3('0x89')](_0x4c046d[_0x86d3('0xae')]);}_0x4cd8a1[_0x86d3('0xfb')]='22';this[_0x86d3('0x144')](_0x4c046d,_0x545e51,_0x4cd8a1);}else if(_0x4c046d&&_0x4c046d[_0x86d3('0x14b')]){if(_0x4cd8a1[_0x86d3('0x147')]==='16'&&this[_0x86d3('0x14')][_0x4cd8a1['linkedid']]['dialAnswer']){logger['info']('[syncHangup][talking][transfer]',_0x4cd8a1[_0x86d3('0xad')],_0x4cd8a1[_0x86d3('0x147')],'\x20Queue',_0x545e51['name'],'pTalking:\x20',_0x545e51[_0x86d3('0x2b')]);this[_0x86d3('0x9a')](_0x4cd8a1,_0x4cd8a1['linkedid'],_0x4cd8a1[_0x86d3('0x147')]);}else if(this[_0x86d3('0x14')][_0x4cd8a1['linkedid']][_0x86d3('0x6f')]){logger[_0x86d3('0x56')](_0x86d3('0x148'),_0x4cd8a1[_0x86d3('0xad')],_0x4cd8a1[_0x86d3('0x147')],_0x86d3('0xb3'),_0x545e51[_0x86d3('0x27')],_0x86d3('0x6e'),_0x545e51[_0x86d3('0x2b')]);this[_0x86d3('0x9a')](_0x4cd8a1,_0x4cd8a1['linkedid'],_0x4cd8a1['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x516179){if(this['actions'][_0x516179[_0x86d3('0x14c')]]&&_0x516179[_0x86d3('0x14c')]!==_0x516179[_0x86d3('0x14d')]){this['callProgressDetectingCustomer'](_0x516179,_0x516179['destlinkedid'],_0x516179[_0x86d3('0xee')]);}};Preview[_0x86d3('0x61')][_0x86d3('0x1c')]=function(_0x1f1dab){if(this[_0x86d3('0x14')][_0x1f1dab['linkedid']]&&_0x1f1dab[_0x86d3('0xad')]!==_0x1f1dab['uniqueid']&&!this[_0x86d3('0x14')][_0x1f1dab[_0x86d3('0xad')]][_0x86d3('0x6f')]){if(_0x1f1dab[_0x86d3('0x147')]==='1'){this[_0x86d3('0x9a')](_0x1f1dab,_0x1f1dab['linkedid'],_0x1f1dab[_0x86d3('0x147')]);}}};Preview[_0x86d3('0x61')][_0x86d3('0x14e')]=function(_0x22f39c,_0x34e2bb,_0x30424a){if(this[_0x86d3('0x14')][_0x22f39c]){if(_[_0x86d3('0x69')](this[_0x86d3('0x14')][_0x22f39c][_0x86d3('0x13b')])){this['actions'][_0x22f39c][_0x86d3('0x13b')]={};}this[_0x86d3('0x14')][_0x22f39c]['variables'][_0x34e2bb]=_0x30424a;}};Preview[_0x86d3('0x61')][_0x86d3('0x21')]=function(_0x354ec8){try{if(!_[_0x86d3('0x69')](_0x354ec8)){if(ut['filterKey'](_[_0x86d3('0x14f')](_0x354ec8[_0x86d3('0x150')])[0x0])){this[_0x86d3('0x14e')](_0x354ec8[_0x86d3('0xc1')],_[_0x86d3('0x14f')](_0x354ec8[_0x86d3('0x150')])[0x0],_0x354ec8[_0x86d3('0x151')]);}}}catch(_0x5003e9){logger[_0x86d3('0x152')](_0x86d3('0x153'),util[_0x86d3('0x154')](_0x5003e9,{'showHidden':![],'depth':null}));}};Preview[_0x86d3('0x61')]['syncAttendedTransfer']=function(_0x405259){if(_0x405259){if(this[_0x86d3('0x14')][_0x405259[_0x86d3('0x155')]]){this[_0x86d3('0x14')][_0x405259[_0x86d3('0x155')]][_0x86d3('0x14b')]=!![];}}};Preview[_0x86d3('0x61')][_0x86d3('0x156')]=function(_0x437828){if(_0x437828){if(this[_0x86d3('0x14')][_0x437828[_0x86d3('0x157')]]){this[_0x86d3('0x14')][_0x437828[_0x86d3('0x157')]][_0x86d3('0x14b')]=!![];}}};module[_0x86d3('0x158')]=Preview;
\ No newline at end of file
index faf38cd..f3bfc25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9194=['../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','[createHistory]\x20','[moveContactManagedDialer]\x20','checkIsBlackList','catch','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack'];(function(_0x558a50,_0x4cc69d){var _0x872e23=function(_0x1581bd){while(--_0x1581bd){_0x558a50['push'](_0x558a50['shift']());}};_0x872e23(++_0x4cc69d);}(_0x9194,0xdf));var _0x4919=function(_0xfbadeb,_0x30e348){_0xfbadeb=_0xfbadeb-0x0;var _0x707ec4=_0x9194[_0xfbadeb];return _0x707ec4;};'use strict';var util=require(_0x4919('0x0'));var BPromise=require(_0x4919('0x1'));var logger=require(_0x4919('0x2'))(_0x4919('0x3'));var _=require(_0x4919('0x4'));var cmHopper=require(_0x4919('0x5'));var cmHopperFinal=require(_0x4919('0x6'));var cmHopperHistory=require(_0x4919('0x7'));var cmHopperBlack=require(_0x4919('0x8'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x4919('0x9'));var voiceQueueReport=require(_0x4919('0xa'));function loggerCatch(_0x3893e1){return function(_0xfd0949){logger[_0x4919('0xb')](_0x3893e1,util[_0x4919('0xc')](_0xfd0949,{'showHidden':![],'depth':null}));};}function create(_0x19238e){return BPromise[_0x4919('0xd')]()[_0x4919('0xe')](cmHopperHistory[_0x4919('0xf')](_0x19238e))['catch'](loggerCatch('[createHistory]\x20'));}function createAgent(_0x10075c){return BPromise[_0x4919('0xd')]()[_0x4919('0xe')](agentReportPreview['createHistory'](_0x10075c))['catch'](loggerCatch(_0x4919('0x10')));}function moveContact(_0x4b0fd7){return BPromise[_0x4919('0xd')]()[_0x4919('0xe')](cmHopper['moveContactManagedDialer'](_0x4b0fd7,!![]))['catch'](loggerCatch(_0x4919('0x11')));}exports[_0x4919('0x12')]=function(_0x7652d0){return BPromise[_0x4919('0xd')]()[_0x4919('0xe')](cmHopperBlack[_0x4919('0x12')](_0x7652d0))[_0x4919('0x13')](loggerCatch(_0x4919('0x14')));};exports[_0x4919('0x15')]=function(_0x545188){return BPromise['resolve']()['then'](cmHopper[_0x4919('0x15')](_0x545188))[_0x4919('0x13')](loggerCatch(_0x4919('0x16')));};exports[_0x4919('0xf')]=function(_0x9b0d2e,_0xfbce77){create(_0x9b0d2e)['catch'](loggerCatch(_0xfbce77));moveContact(_0x9b0d2e)[_0x4919('0x13')](loggerCatch(_0xfbce77));};exports[_0x4919('0x17')]=function(_0x410858,_0x42197a){createAgent(_0x410858)[_0x4919('0x13')](loggerCatch(_0x42197a));};exports['createCustomerHistory']=function(_0x562d88,_0x231293){create(_0x562d88)[_0x4919('0x13')](loggerCatch(_0x231293));};exports[_0x4919('0x18')]=function(_0x5e6b28,_0x51ab20){moveContact(_0x5e6b28)[_0x4919('0x13')](loggerCatch(_0x51ab20));};exports[_0x4919('0x19')]=function(_0x1ca694,_0xe4db17,_0x53a818){if(_0xe4db17){_0x1ca694[_0x4919('0x1a')]=null;}if(_0x53a818){_0x1ca694[_0x4919('0x1b')]=![];}return BPromise['resolve']()[_0x4919('0xe')](cmHopper[_0x4919('0x19')](_0x1ca694))['catch'](loggerCatch(_0x4919('0x1c')));};exports[_0x4919('0x1d')]=function(_0x17f086){return BPromise[_0x4919('0xd')]()[_0x4919('0xe')](cmHopper[_0x4919('0x1d')](_0x17f086))[_0x4919('0x13')](loggerCatch(_0x4919('0x1e')));};exports[_0x4919('0x1f')]=function(_0x2ecfcb){return BPromise[_0x4919('0xd')]()[_0x4919('0xe')](cmHopper[_0x4919('0x1f')]({'UserId':null},_0x2ecfcb,0x1))[_0x4919('0x13')](loggerCatch('[unlockContact]\x20'));};exports['disableContact']=function(_0xceb253){return BPromise['resolve']()[_0x4919('0xe')](cmHopper[_0x4919('0x1f')]({'active':![]},_0xceb253,0x1))[_0x4919('0x13')](loggerCatch(_0x4919('0x20')));};exports[_0x4919('0x21')]=function(_0x407a9a){var _0x5bbd33={};_0x5bbd33[_0x4919('0x22')]=_0x407a9a['type'];_0x5bbd33[_0x4919('0x23')]=_0x407a9a[_0x4919('0x23')];_0x5bbd33['calleridnum']=_0x407a9a[_0x4919('0x24')];_0x5bbd33['calleridname']=_0x407a9a[_0x4919('0x25')];_0x5bbd33[_0x4919('0x26')]=_0x407a9a['queue'];_0x5bbd33[_0x4919('0x27')]=_0x407a9a[_0x4919('0x28')];_0x5bbd33['queuecallerleaveAt']=_0x407a9a[_0x4919('0x28')];_0x5bbd33[_0x4919('0x29')]=0x1;_0x5bbd33[_0x4919('0x2a')]=_0x407a9a[_0x4919('0x2b')];_0x5bbd33[_0x4919('0x2c')]=_0x407a9a['membername'];_0x5bbd33[_0x4919('0x2d')]=_0x4919('0x2e');_0x5bbd33[_0x4919('0x2f')]=_0x4919('0x30');_0x5bbd33[_0x4919('0x31')]=0x0;_0x5bbd33[_0x4919('0x32')]=0x1;_0x5bbd33[_0x4919('0x33')]=_0x407a9a['membername'];_0x5bbd33[_0x4919('0x34')]=_0x4919('0x35');return BPromise[_0x4919('0xd')]()[_0x4919('0xe')](voiceQueueReport[_0x4919('0x36')](_0x5bbd33))[_0x4919('0x13')](loggerCatch(_0x4919('0x37')));};exports[_0x4919('0x38')]=function(_0x326f16,_0x472f38){return BPromise['resolve']()['then'](cmHopper[_0x4919('0x38')](_0x326f16,_0x472f38))[_0x4919('0x13')](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x370dcc){return BPromise[_0x4919('0xd')]()[_0x4919('0xe')](cmHopper['rescheduleContact'](_0x370dcc,!![],!![]))['catch'](loggerCatch(_0x4919('0x39')));};
\ No newline at end of file
+var _0xc7c4=['catch','then','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','membername','context','from-sip','exten','holdtime','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','createHistory'];(function(_0x9170b0,_0x5803b4){var _0x4fc1c9=function(_0xcf15b1){while(--_0xcf15b1){_0x9170b0['push'](_0x9170b0['shift']());}};_0x4fc1c9(++_0x5803b4);}(_0xc7c4,0xd6));var _0x4c7c=function(_0x3b029f,_0x454a6e){_0x3b029f=_0x3b029f-0x0;var _0x21c32d=_0xc7c4[_0x3b029f];return _0x21c32d;};'use strict';var util=require(_0x4c7c('0x0'));var BPromise=require('bluebird');var logger=require(_0x4c7c('0x1'))(_0x4c7c('0x2'));var _=require(_0x4c7c('0x3'));var cmHopper=require(_0x4c7c('0x4'));var cmHopperFinal=require(_0x4c7c('0x5'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x4c7c('0x6'));var voiceQueueRt=require(_0x4c7c('0x7'));var agentReportPreview=require(_0x4c7c('0x8'));var voiceQueueReport=require(_0x4c7c('0x9'));function loggerCatch(_0x37ad26){return function(_0x4c8164){logger[_0x4c7c('0xa')](_0x37ad26,util[_0x4c7c('0xb')](_0x4c8164,{'showHidden':![],'depth':null}));};}function create(_0x165260){return BPromise[_0x4c7c('0xc')]()['then'](cmHopperHistory[_0x4c7c('0xd')](_0x165260))[_0x4c7c('0xe')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x3d13c3){return BPromise[_0x4c7c('0xc')]()[_0x4c7c('0xf')](agentReportPreview[_0x4c7c('0xd')](_0x3d13c3))[_0x4c7c('0xe')](loggerCatch(_0x4c7c('0x10')));}function moveContact(_0x21714b){return BPromise['resolve']()['then'](cmHopper[_0x4c7c('0x11')](_0x21714b,!![]))[_0x4c7c('0xe')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x4c7c('0x12')]=function(_0x325a6f){return BPromise[_0x4c7c('0xc')]()[_0x4c7c('0xf')](cmHopperBlack[_0x4c7c('0x12')](_0x325a6f))['catch'](loggerCatch(_0x4c7c('0x13')));};exports[_0x4c7c('0x14')]=function(_0x433ee4){return BPromise[_0x4c7c('0xc')]()['then'](cmHopper['getContactPreview'](_0x433ee4))['catch'](loggerCatch(_0x4c7c('0x15')));};exports[_0x4c7c('0xd')]=function(_0x24d9b1,_0x1a4b80){create(_0x24d9b1)[_0x4c7c('0xe')](loggerCatch(_0x1a4b80));moveContact(_0x24d9b1)[_0x4c7c('0xe')](loggerCatch(_0x1a4b80));};exports['createAgentHistory']=function(_0x17925e,_0x7cd1b0){createAgent(_0x17925e)[_0x4c7c('0xe')](loggerCatch(_0x7cd1b0));};exports[_0x4c7c('0x16')]=function(_0x5ed2cb,_0x151a58){create(_0x5ed2cb)[_0x4c7c('0xe')](loggerCatch(_0x151a58));};exports[_0x4c7c('0x17')]=function(_0x16d82b,_0x1e33b2){moveContact(_0x16d82b)[_0x4c7c('0xe')](loggerCatch(_0x1e33b2));};exports[_0x4c7c('0x18')]=function(_0x56403d,_0x29b9a2,_0x2b7322){if(_0x29b9a2){_0x56403d[_0x4c7c('0x19')]=null;}if(_0x2b7322){_0x56403d[_0x4c7c('0x1a')]=![];}return BPromise[_0x4c7c('0xc')]()[_0x4c7c('0xf')](cmHopper[_0x4c7c('0x18')](_0x56403d))[_0x4c7c('0xe')](loggerCatch(_0x4c7c('0x1b')));};exports[_0x4c7c('0x1c')]=function(_0x2c0d9c){return BPromise[_0x4c7c('0xc')]()[_0x4c7c('0xf')](cmHopper[_0x4c7c('0x1c')](_0x2c0d9c))['catch'](loggerCatch(_0x4c7c('0x1d')));};exports[_0x4c7c('0x1e')]=function(_0x3c318f){return BPromise[_0x4c7c('0xc')]()[_0x4c7c('0xf')](cmHopper[_0x4c7c('0x1e')]({'UserId':null},_0x3c318f,0x1))[_0x4c7c('0xe')](loggerCatch(_0x4c7c('0x1f')));};exports[_0x4c7c('0x20')]=function(_0x1199b0){return BPromise[_0x4c7c('0xc')]()[_0x4c7c('0xf')](cmHopper[_0x4c7c('0x1e')]({'active':![]},_0x1199b0,0x1))['catch'](loggerCatch(_0x4c7c('0x21')));};exports[_0x4c7c('0x22')]=function(_0x588c49){var _0x1a0992={};_0x1a0992[_0x4c7c('0x23')]=_0x588c49[_0x4c7c('0x23')];_0x1a0992[_0x4c7c('0x24')]=_0x588c49['uniqueid'];_0x1a0992[_0x4c7c('0x25')]=_0x588c49[_0x4c7c('0x25')];_0x1a0992[_0x4c7c('0x26')]=_0x588c49[_0x4c7c('0x26')];_0x1a0992['queue']=_0x588c49[_0x4c7c('0x27')];_0x1a0992[_0x4c7c('0x28')]=_0x588c49[_0x4c7c('0x29')];_0x1a0992[_0x4c7c('0x2a')]=_0x588c49[_0x4c7c('0x29')];_0x1a0992[_0x4c7c('0x2b')]=0x1;_0x1a0992[_0x4c7c('0x2c')]=_0x588c49[_0x4c7c('0x2d')];_0x1a0992['connectedlinename']=_0x588c49[_0x4c7c('0x2e')];_0x1a0992[_0x4c7c('0x2f')]=_0x4c7c('0x30');_0x1a0992[_0x4c7c('0x31')]='xcally-motion-preview';_0x1a0992[_0x4c7c('0x32')]=0x0;_0x1a0992['assigned']=0x1;_0x1a0992['lastAssignedTo']=_0x588c49[_0x4c7c('0x2e')];_0x1a0992['queuecallerexitreason']=_0x4c7c('0x33');return BPromise[_0x4c7c('0xc')]()[_0x4c7c('0xf')](voiceQueueReport['create'](_0x1a0992))[_0x4c7c('0xe')](loggerCatch(_0x4c7c('0x34')));};exports['getContactRecallMe']=function(_0x4c6374,_0x33c323){return BPromise[_0x4c7c('0xc')]()[_0x4c7c('0xf')](cmHopper[_0x4c7c('0x35')](_0x4c6374,_0x33c323))[_0x4c7c('0xe')](loggerCatch(_0x4c7c('0x36')));};exports[_0x4c7c('0x37')]=function(_0x280033){return BPromise['resolve']()[_0x4c7c('0xf')](cmHopper[_0x4c7c('0x18')](_0x280033,!![],!![]))['catch'](loggerCatch(_0x4c7c('0x38')));};
\ No newline at end of file
index eaa0a52..24fa922 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd326=['format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','name','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','toUpper','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','responsetime','endtime','logAgent','state','ringtime','starttime','logLookAgent','membername','UserId','talktime','answertime','Failure','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countcongestionretry','countnoanswerretry','countnosuchnumberretry','cloneAction','Global','scheduledAt','scheduledat','add','minutes','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','createBody','ListId','CampaignId','idContact','type','campaigntype','calleridname','active','countbusyretry','countglobal','callback','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosrtt','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','forEach','toLowerCase','buildNoAnswerEventPayload','util','../../../../config/logger','env','XCALLY_IP_AGI','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','message','getCallerId','isUndefined','string','isEmpty'];(function(_0x4f5973,_0x5bfe3b){var _0x14ce7d=function(_0x2834e7){while(--_0x2834e7){_0x4f5973['push'](_0x4f5973['shift']());}};_0x14ce7d(++_0x5bfe3b);}(_0xd326,0x83));var _0x6d32=function(_0x222da6,_0x3b0217){_0x222da6=_0x222da6-0x0;var _0x53f9a4=_0xd326[_0x222da6];return _0x53f9a4;};'use strict';var util=require(_0x6d32('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0x6d32('0x1'))('preview');var ipAgi=process[_0x6d32('0x2')][_0x6d32('0x3')]||'127.0.0.1';function getSeconds(_0x581d91,_0x12d4bc){var _0x51295e=moment(_0x581d91)[_0x6d32('0x4')](0x0);var _0x5a989c=moment(_0x12d4bc)[_0x6d32('0x4')](0x0);return _0x51295e[_0x6d32('0x5')](_0x5a989c,_0x6d32('0x6'));}exports[_0x6d32('0x7')]=function(_0x1e7145){return function(_0x51f9b7){logger[_0x6d32('0x8')](_0x1e7145,util[_0x6d32('0x9')](_0x51f9b7,{'showHidden':![],'depth':null}));};};exports[_0x6d32('0xa')]=function(_0x17b948,_0x193bd4){logger[_0x6d32('0xb')](_0x17b948,util[_0x6d32('0x9')](_0x193bd4,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x31f03c,_0x3cea38){logger[_0x6d32('0x8')](_0x31f03c,util[_0x6d32('0x9')](_0x3cea38,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0xf4c5b8){return function(_0x4418e4){logger['info'](_0xf4c5b8,util[_0x6d32('0x9')](_0x4418e4,{'showHidden':![],'depth':null}));};};exports[_0x6d32('0xc')]=function(_0x3d42de,_0x24befe,_0x3a9b53){return{'message':_0x3d42de,'unlock':_0x24befe,'active':_0x3a9b53};};exports[_0x6d32('0xd')]=function(_0x172ffd,_0x5457e8,_0x435e70){if(!_[_0x6d32('0xe')](_0x435e70)&&_0x6d32('0xf')===typeof _0x435e70&&!_['isEmpty'](_0x435e70)){if(!_[_0x6d32('0xe')](_0x5457e8)&&_0x6d32('0xf')===typeof _0x5457e8&&!_[_0x6d32('0x10')](_0x5457e8)){return util[_0x6d32('0x11')](_0x6d32('0x12'),_0x5457e8,_0x435e70);}return util[_0x6d32('0x11')](_0x6d32('0x12'),_0x435e70,_0x435e70);}if(!_[_0x6d32('0xe')](_0x172ffd)&&_0x6d32('0xf')===typeof _0x172ffd&&!_[_0x6d32('0x10')](_0x172ffd)){return _0x172ffd;}return'\x22\x22\x20<>';};exports[_0x6d32('0x13')]=function(_0x3f01fa){if(_[_0x6d32('0x14')](_0x3f01fa)){return![];}return _0x3f01fa;};exports[_0x6d32('0x15')]=function(_0x4ee14d,_0x2cc45b,_0x3b9075,_0x15ee61,_0x5e01b6,_0x4e4ab0){var _0x15b0bc={'XMD-QUEUE':_0x2cc45b[_0x6d32('0x16')]?_0x2cc45b[_0x6d32('0x16')][_0x6d32('0x17')]:'','XMD-CALLERID':_0x15ee61,'XMD-CALLERID-PREVIEW':_0x4e4ab0?util[_0x6d32('0x11')](_0x6d32('0x12'),_0x4e4ab0['calleridname'],_0x4e4ab0[_0x6d32('0x18')]):_0x15ee61,'XMD-DIALID':_0x5e01b6,'XMD-CONTACTID':_0x2cc45b[_0x6d32('0x19')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x15ee61,'XMD-VOICEQUEUEID':_0x2cc45b[_0x6d32('0x1a')],'XMD-DIALCHANNEL':_0x3b9075,'XMD-DIALTIMEOUT':_0x4ee14d[_0x6d32('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0x6d32('0x11')](_0x6d32('0x1c'),_0x4ee14d[_0x6d32('0x1d')]?'g':'',_['isEmpty'](_0x4ee14d[_0x6d32('0x1e')])?'':_0x6d32('0x1f')),'XMD-DIALURL':_0x4ee14d[_0x6d32('0x20')]||'','XMD-AGI':_0x4ee14d['dialQueueProject']?util['format'](_0x6d32('0x21'),ipAgi,_0x4ee14d['dialQueueProject']):_0x6d32('0x22'),'XMD-AGIAFTER':_0x4ee14d['dialQueueProject2']?util[_0x6d32('0x11')](_0x6d32('0x21'),ipAgi,_0x4ee14d[_0x6d32('0x1d')]):_0x6d32('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x4e4ab0?_0x4e4ab0[_0x6d32('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x4e4ab0?_0x4e4ab0[_0x6d32('0x24')]:'','XMD-DESTINATION':_0x6d32('0x25'),'SIPADDHEADER':_0x6d32('0x26')};if(!_[_0x6d32('0x10')](_0x4ee14d[_0x6d32('0x1e')])){_0x15b0bc[util[_0x6d32('0x11')]('%s',_0x6d32('0x27'))]=_0x4ee14d[_0x6d32('0x1e')];_0x15b0bc[util[_0x6d32('0x11')]('%s',_0x6d32('0x28'))]=_0x5e01b6;}if(_0x2cc45b&&_0x2cc45b['Contact']){for(var _0x1ed00d in _0x2cc45b[_0x6d32('0x29')]){if(_0x2cc45b[_0x6d32('0x29')][_0x6d32('0x2a')](_0x1ed00d)){if(!_[_0x6d32('0x14')](_0x2cc45b['Contact'][_0x1ed00d])&&_0x1ed00d!=='id'&&_0x1ed00d!==_0x6d32('0x2b')&&_0x1ed00d!==_0x6d32('0x2c')&&_0x1ed00d!==_0x6d32('0x2d')){_0x15b0bc[util['format'](_0x6d32('0x2e'),'XMD-',_[_0x6d32('0x2f')](_0x1ed00d))]=_0x2cc45b[_0x6d32('0x29')][_0x1ed00d];}}}}return _0x15b0bc;};exports['toLowerVariables']=function(_0x10fbff){var _0x52a550={};for(var _0x123f46 in _0x10fbff){if(_0x10fbff[_0x6d32('0x2a')](_0x123f46)){_0x52a550[util[_0x6d32('0x11')]('%s',_[_0x6d32('0x30')](_0x123f46))]=_0x10fbff[_0x123f46];}}return{'variables':_0x52a550};};exports[_0x6d32('0x31')]=function(_0x5d0dad,_0x1c6961){if(!_[_0x6d32('0x14')](_0x5d0dad)){if(_0x5d0dad[_0x6d32('0x2a')](_0x6d32('0x32'))){if(_0x5d0dad[_0x6d32('0x32')]>0x0){_0x5d0dad[_0x6d32('0x32')]-=0x1;}else{logger['error'](_0x6d32('0x33'),_0x1c6961);}}}else{logger[_0x6d32('0x8')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x1c6961);}};exports[_0x6d32('0x34')]=function(_0x36ac15){var _0x31d7dc=moment()[_0x6d32('0x11')](_0x6d32('0x35'));_0x36ac15['state']=0xd;_0x36ac15[_0x6d32('0x36')]='Blacklist';_0x36ac15['starttime']=_0x31d7dc;_0x36ac15[_0x6d32('0x37')]=_0x31d7dc;_0x36ac15[_0x6d32('0x38')]=_0x31d7dc;};exports[_0x6d32('0x39')]=function(_0x2ed8aa,_0x496465,_0x2073d6){var _0x47b32d=moment()[_0x6d32('0x11')](_0x6d32('0x35'));_0x2ed8aa[_0x6d32('0x3a')]=_0x496465;_0x2ed8aa['statedesc']=_0x2073d6;_0x2ed8aa[_0x6d32('0x37')]=_0x47b32d;_0x2ed8aa[_0x6d32('0x3b')]=getSeconds(_0x2ed8aa['responsetime'],_0x2ed8aa[_0x6d32('0x3c')]);};exports[_0x6d32('0x3d')]=function(_0xd89d42,_0x59bd3b,_0x36697f){_0xd89d42[_0x6d32('0x3e')]=_0x59bd3b;_0xd89d42[_0x6d32('0x3f')]=_0x36697f;};exports['logCustomer']=function(_0x1c3c15,_0x5ac9c5,_0x1bee45){var _0x5722a8=moment()['format'](_0x6d32('0x35'));_0x1c3c15[_0x6d32('0x3a')]=_0x5ac9c5;_0x1c3c15[_0x6d32('0x36')]=_0x1bee45;_0x1c3c15[_0x6d32('0x37')]=_0x1c3c15['responsetime']?_0x1c3c15[_0x6d32('0x37')]:_0x5722a8;_0x1c3c15[_0x6d32('0x38')]=_0x1c3c15[_0x6d32('0x38')]?_0x1c3c15[_0x6d32('0x38')]:_0x5722a8;_0x1c3c15['ringtime']=getSeconds(_0x1c3c15[_0x6d32('0x37')]||0x0,_0x1c3c15[_0x6d32('0x3c')]||0x0);_0x1c3c15[_0x6d32('0x40')]=_0x1c3c15[_0x6d32('0x41')]?getSeconds(_0x1c3c15[_0x6d32('0x38')],_0x1c3c15[_0x6d32('0x41')]):0x0;};exports['isFailure']=function(_0xca348b){return _0xca348b===_0x6d32('0x42');};exports['variablesAction']=function(_0x171b93,_0x2bdbf4,_0x26c43a,_0x155214,_0x3571d2){var _0x1d3231=_0x155214?'RECALL':_0x171b93['calleridname'];_0x1d3231=_0x3571d2?_0x6d32('0x43'):_0x1d3231;return{'actionid':_0x171b93[_0x6d32('0x44')],'action':_0x6d32('0x45'),'channel':_0x171b93[_0x6d32('0x46')],'callerid':util[_0x6d32('0x11')](_0x6d32('0x12'),_0x1d3231,_0x171b93[_0x6d32('0x18')]),'Exten':'xcally-motion-preview','Context':_0x6d32('0x47'),'Priority':'1','variable':_0x26c43a,'timeout':(_0x2bdbf4[_0x6d32('0x48')]||0x1e)*0x3e8,'async':!![],'channelid':_0x171b93['uniqueid']};};exports[_0x6d32('0x49')]=function(_0x416298){return _0x416298['countbusyretry']+_0x416298[_0x6d32('0x4a')]+_0x416298[_0x6d32('0x4b')]+_0x416298['countagentrejectretry']+_0x416298[_0x6d32('0x4c')];};exports[_0x6d32('0x4d')]=function(_0xf5f74a){var _0x51cd37=_['clone'](_0xf5f74a);_0x51cd37[_0x6d32('0x3a')]=0xf;_0x51cd37[_0x6d32('0x36')]=_0x6d32('0x4e');return _0x51cd37;};exports[_0x6d32('0x4f')]=function(_0x2c24e4,_0x59f4e3,_0x4b8df4){var _0x20c9b2={};_0x20c9b2[_0x59f4e3]=_0x2c24e4[_0x59f4e3];_0x20c9b2['active']=![];_0x20c9b2[_0x6d32('0x50')]=moment()[_0x6d32('0x51')](_0x4b8df4,_0x6d32('0x52'))['format'](_0x6d32('0x35'));_0x20c9b2[_0x6d32('0x19')]=_0x2c24e4[_0x6d32('0x19')];_0x20c9b2['ListId']=_0x2c24e4['ListId'];_0x20c9b2[_0x6d32('0x1a')]=_0x2c24e4[_0x6d32('0x1a')]||undefined;return _0x20c9b2;};exports[_0x6d32('0x53')]=function(_0x32e2db,_0x147c95){if(!_['isNil'](_0x32e2db)){if(_0x32e2db[_0x6d32('0x54')]>0x0){_0x32e2db['pTalking']-=0x1;}else{logger[_0x6d32('0x8')](_0x147c95,_0x6d32('0x55'));}}else{logger[_0x6d32('0x8')](_0x147c95,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x6d32('0x56')]=function(_0x328a90){if(_0x328a90<=0x0){return!![];}return![];};function buildObj(_0x200fd1,_0x11a178,_0x3978f4){_0x200fd1[_0x6d32('0x57')]=_0x11a178;_0x200fd1['name']=_0x200fd1[_0x6d32('0x58')];_0x200fd1[_0x6d32('0x59')]=_0x200fd1[_0x6d32('0x46')];_0x200fd1[_0x6d32('0x5a')]=_0x6d32('0x5b');if(_0x3978f4){_0x200fd1[_0x6d32('0x5c')]=_0x3978f4[_0x6d32('0x5c')];}return _0x200fd1;}exports[_0x6d32('0x5d')]=buildObj;exports[_0x6d32('0x5e')]=function(_0x360883){var _0x556b69={};_0x556b69[_0x6d32('0x58')]=_0x360883['queue'];_0x556b69[_0x6d32('0x59')]=_0x360883['channelAgent'];_0x556b69['uniqueid']=_0x360883[_0x6d32('0x44')];return _0x556b69;};exports[_0x6d32('0x5f')]=function(_0x5dadb5){var _0x337d29=[];for(var _0xa2efc7 in _0x5dadb5){if(_0x5dadb5['hasOwnProperty'](_0xa2efc7)){if(!_[_0x6d32('0x14')](_0x5dadb5[_0xa2efc7])&&_0x5dadb5[_0xa2efc7][_0x6d32('0x3a')]===_0x6d32('0x60')&&_0x5dadb5[_0xa2efc7][_0x6d32('0x61')]===_0x6d32('0x62')){_0x337d29[_0x6d32('0x63')](_0x5dadb5[_0xa2efc7]['id']);}}}return _0x337d29;};exports[_0x6d32('0x64')]=function(_0x273bc5){var _0x10e4fe=moment()[_0x6d32('0x4')](0x0);var _0x396e80=moment(_0x273bc5)[_0x6d32('0x4')](0x0);return _0x10e4fe[_0x6d32('0x5')](_0x396e80,_0x6d32('0x6'));};exports[_0x6d32('0x65')]=function(_0x26c0c8){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x26c0c8[_0x6d32('0x19')],'ListId':_0x26c0c8[_0x6d32('0x66')],'VoiceQueueId':_0x26c0c8[_0x6d32('0x1a')]||undefined,'CampaignId':_0x26c0c8[_0x6d32('0x67')]||undefined};};exports['filterKey']=function(_0xd36314){if(_0xd36314==='uniqueid'||_0xd36314===_0x6d32('0x68')||_0xd36314==='queue'||_0xd36314===_0x6d32('0x69')||_0xd36314===_0x6d32('0x6a')||_0xd36314==='dialAnswer'||_0xd36314===_0x6d32('0x3e')||_0xd36314==='channelAgent'||_0xd36314===_0x6d32('0x6b')||_0xd36314===_0x6d32('0x6c')||_0xd36314===_0x6d32('0x18')||_0xd36314===_0x6d32('0x50')||_0xd36314===_0x6d32('0x6d')||_0xd36314===_0x6d32('0x4a')||_0xd36314===_0x6d32('0x4b')||_0xd36314===_0x6d32('0x6e')||_0xd36314===_0x6d32('0x6f')||_0xd36314==='callbackuniqueid'||_0xd36314===_0x6d32('0x70')||_0xd36314===_0x6d32('0x71')||_0xd36314===_0x6d32('0x19')||_0xd36314===_0x6d32('0x66')||_0xd36314===_0x6d32('0x3f')||_0xd36314===_0x6d32('0x1a')||_0xd36314===_0x6d32('0x72')||_0xd36314===_0x6d32('0x73')||_0xd36314===_0x6d32('0x74')||_0xd36314==='xmd-phone'||_0xd36314===_0x6d32('0x75')||_0xd36314===_0x6d32('0x76')||_0xd36314===_0x6d32('0x77')||_0xd36314===_0x6d32('0x78')||_0xd36314===_0x6d32('0x79')||_0xd36314===_0x6d32('0x7a')||_0xd36314==='xmd-contactid'||_0xd36314===_0x6d32('0x7b')||_0xd36314===_0x6d32('0x7c')||_0xd36314===_0x6d32('0x7d')||_0xd36314===_0x6d32('0x7e')||_0xd36314===_0x6d32('0x7f')||_0xd36314==='rtpaudioqosbridged'||_0xd36314==='rtpaudioqosjitter'||_0xd36314===_0x6d32('0x80')||_0xd36314===_0x6d32('0x81')||_0xd36314===_0x6d32('0x82')||_0xd36314==='rtpaudioqosrtt'||_0xd36314===_0x6d32('0x83')||_0xd36314==='rtpaudioqos'||_0xd36314===_0x6d32('0x84')||_0xd36314===_0x6d32('0x85')||_0xd36314===_0x6d32('0x80')||_0xd36314===_0x6d32('0x81')||_0xd36314===_0x6d32('0x82')||_0xd36314===_0x6d32('0x86')||_0xd36314===_0x6d32('0x83')||_0xd36314==='bridgepeer'||_0xd36314==='bridgepvtcallid'||_0xd36314===_0x6d32('0x3a')||_0xd36314==='statedesc'){return![];}return!![];};exports[_0x6d32('0x87')]=function(_0x38ead6,_0x289a4b){var _0x38cc59,_0x215825,_0x5997fb;if(_0x289a4b<=0x0){_0x289a4b=0x1;}_0x38cc59=new RegExp(_0x6d32('0x88')+_0x289a4b+'}$');_0x215825=Math[_0x6d32('0x89')](0xa,_0x289a4b-0x1);_0x5997fb=Math[_0x6d32('0x89')](0xa,_0x289a4b)-0x1;return util[_0x6d32('0x11')]('%s',_[_0x6d32('0x8a')](_0x38ead6,_0x38cc59,_['random'](_0x215825,_0x5997fb)));};exports[_0x6d32('0x8b')]=function(_0x50f0cd){var _0x57545a=_0x50f0cd[_0x6d32('0x8c')](/"(.*?)"/);return _0x57545a?_0x57545a[0x1]:_0x50f0cd;};exports[_0x6d32('0x8d')]=function(_0x1328c5){var _0x9f6c1c=_0x1328c5['match'](/<(.*?)>/);return _0x9f6c1c?_0x9f6c1c[0x1]:_0x1328c5;};function buildNoAnswerEventPayload(_0x35d3c1,_0x592889){var _0x4b5372=buildObj(_0x35d3c1,_0x6d32('0x8e'));if(!_[_0x6d32('0x10')](_0x592889[_0x6d32('0x8f')])){Object[_0x6d32('0x90')](_0x592889[_0x6d32('0x8f')])[_0x6d32('0x91')](function(_0x524da1){_0x4b5372[_0x524da1[_0x6d32('0x92')]()]=_0x592889[_0x6d32('0x8f')][_0x524da1];});}return _0x4b5372;}exports[_0x6d32('0x93')]=buildNoAnswerEventPayload;
\ No newline at end of file
+var _0x0b2e=['forEach','buildNoAnswerEventPayload','util','lodash','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','Queue','name','calleridname','calleridnum','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','dialQueueProject2','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','starttime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','Failure','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','countbusyretry','countagentrejectretry','countnosuchnumberretry','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','interface','motionChannel','voice','mandatoryDisposition','queue','agentReadyId','status','reachable','push','getDiff','seconds','createBody','campaigntype','dialAnswer','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridNumber','noanswer','variables','keys'];(function(_0x2a2ea3,_0x5f3e86){var _0x1d7a69=function(_0x93c18e){while(--_0x93c18e){_0x2a2ea3['push'](_0x2a2ea3['shift']());}};_0x1d7a69(++_0x5f3e86);}(_0x0b2e,0x1c4));var _0xe0b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b2e[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xe0b2('0x0'));var _=require(_0xe0b2('0x1'));var moment=require('moment');var logger=require(_0xe0b2('0x2'))(_0xe0b2('0x3'));var ipAgi=process['env'][_0xe0b2('0x4')]||_0xe0b2('0x5');function getSeconds(_0x2bf7b2,_0x28ecb5){var _0x2fe710=moment(_0x2bf7b2)[_0xe0b2('0x6')](0x0);var _0x5e007d=moment(_0x28ecb5)['milliseconds'](0x0);return _0x2fe710[_0xe0b2('0x7')](_0x5e007d,'seconds');}exports[_0xe0b2('0x8')]=function(_0x16e328){return function(_0x3ed098){logger[_0xe0b2('0x9')](_0x16e328,util[_0xe0b2('0xa')](_0x3ed098,{'showHidden':![],'depth':null}));};};exports[_0xe0b2('0xb')]=function(_0x446166,_0x4fef1b){logger[_0xe0b2('0xc')](_0x446166,util['inspect'](_0x4fef1b,{'showHidden':![],'depth':null}));};exports[_0xe0b2('0xd')]=function(_0x20dd39,_0x1578cb){logger['error'](_0x20dd39,util['inspect'](_0x1578cb,{'showHidden':![],'depth':null}));};exports[_0xe0b2('0xe')]=function(_0x20c5af){return function(_0x136776){logger[_0xe0b2('0xc')](_0x20c5af,util[_0xe0b2('0xa')](_0x136776,{'showHidden':![],'depth':null}));};};exports[_0xe0b2('0xf')]=function(_0x27c5c3,_0x2e71d1,_0x1f5d71){return{'message':_0x27c5c3,'unlock':_0x2e71d1,'active':_0x1f5d71};};exports[_0xe0b2('0x10')]=function(_0x1d4aa7,_0x5e0ac6,_0x4f04f7){if(!_[_0xe0b2('0x11')](_0x4f04f7)&&_0xe0b2('0x12')===typeof _0x4f04f7&&!_[_0xe0b2('0x13')](_0x4f04f7)){if(!_['isUndefined'](_0x5e0ac6)&&_0xe0b2('0x12')===typeof _0x5e0ac6&&!_[_0xe0b2('0x13')](_0x5e0ac6)){return util[_0xe0b2('0x14')](_0xe0b2('0x15'),_0x5e0ac6,_0x4f04f7);}return util[_0xe0b2('0x14')](_0xe0b2('0x15'),_0x4f04f7,_0x4f04f7);}if(!_[_0xe0b2('0x11')](_0x1d4aa7)&&_0xe0b2('0x12')===typeof _0x1d4aa7&&!_[_0xe0b2('0x13')](_0x1d4aa7)){return _0x1d4aa7;}return'\x22\x22\x20<>';};exports[_0xe0b2('0x16')]=function(_0x2e94e1){if(_[_0xe0b2('0x17')](_0x2e94e1)){return![];}return _0x2e94e1;};exports['addVariables']=function(_0x10363f,_0xb83efb,_0x24a6ab,_0x195ef5,_0x22fc77,_0x5f1d88){var _0x1fb492={'XMD-QUEUE':_0xb83efb['Queue']?_0xb83efb[_0xe0b2('0x18')][_0xe0b2('0x19')]:'','XMD-CALLERID':_0x195ef5,'XMD-CALLERID-PREVIEW':_0x5f1d88?util[_0xe0b2('0x14')]('\x22%s\x22\x20<%s>',_0x5f1d88[_0xe0b2('0x1a')],_0x5f1d88[_0xe0b2('0x1b')]):_0x195ef5,'XMD-DIALID':_0x22fc77,'XMD-CONTACTID':_0xb83efb[_0xe0b2('0x1c')],'XMD-CDRTYPE':_0xe0b2('0x1d'),'CALLERID(all)':_0x195ef5,'XMD-VOICEQUEUEID':_0xb83efb['VoiceQueueId'],'XMD-DIALCHANNEL':_0x24a6ab,'XMD-DIALTIMEOUT':_0x10363f[_0xe0b2('0x1e')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0xe0b2('0x1f'),_0x10363f['dialQueueProject2']?'g':'',_[_0xe0b2('0x13')](_0x10363f[_0xe0b2('0x20')])?'':_0xe0b2('0x21')),'XMD-DIALURL':_0x10363f[_0xe0b2('0x22')]||'','XMD-AGI':_0x10363f['dialQueueProject']?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x10363f[_0xe0b2('0x23')]):'NONE','XMD-AGIAFTER':_0x10363f[_0xe0b2('0x24')]?util[_0xe0b2('0x14')](_0xe0b2('0x25'),ipAgi,_0x10363f['dialQueueProject2']):_0xe0b2('0x26'),'XMD-ORIGINATECALLERIDNUM':_0x5f1d88?_0x5f1d88[_0xe0b2('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x5f1d88?_0x5f1d88[_0xe0b2('0x28')]:'','XMD-DESTINATION':_0xe0b2('0x29'),'SIPADDHEADER':_0xe0b2('0x2a')};if(!_[_0xe0b2('0x13')](_0x10363f[_0xe0b2('0x20')])){_0x1fb492[util[_0xe0b2('0x14')]('%s',_0xe0b2('0x2b'))]=_0x10363f['monitor_format'];_0x1fb492[util['format']('%s',_0xe0b2('0x2c'))]=_0x22fc77;}if(_0xb83efb&&_0xb83efb[_0xe0b2('0x2d')]){for(var _0x20dca7 in _0xb83efb[_0xe0b2('0x2d')]){if(_0xb83efb[_0xe0b2('0x2d')][_0xe0b2('0x2e')](_0x20dca7)){if(!_[_0xe0b2('0x17')](_0xb83efb['Contact'][_0x20dca7])&&_0x20dca7!=='id'&&_0x20dca7!==_0xe0b2('0x2f')&&_0x20dca7!==_0xe0b2('0x30')&&_0x20dca7!==_0xe0b2('0x31')){_0x1fb492[util['format']('%s%s','XMD-',_[_0xe0b2('0x32')](_0x20dca7))]=_0xb83efb[_0xe0b2('0x2d')][_0x20dca7];}}}}return _0x1fb492;};exports[_0xe0b2('0x33')]=function(_0x2b6c45){var _0x1e8aaa={};for(var _0x210b9c in _0x2b6c45){if(_0x2b6c45[_0xe0b2('0x2e')](_0x210b9c)){_0x1e8aaa[util[_0xe0b2('0x14')]('%s',_[_0xe0b2('0x34')](_0x210b9c))]=_0x2b6c45[_0x210b9c];}}return{'variables':_0x1e8aaa};};exports[_0xe0b2('0x35')]=function(_0x19f9ab,_0xf53105){if(!_[_0xe0b2('0x17')](_0x19f9ab)){if(_0x19f9ab[_0xe0b2('0x2e')](_0xe0b2('0x36'))){if(_0x19f9ab[_0xe0b2('0x36')]>0x0){_0x19f9ab[_0xe0b2('0x36')]-=0x1;}else{logger['error'](_0xe0b2('0x37'),_0xf53105);}}}else{logger[_0xe0b2('0x9')](_0xe0b2('0x38'),_0xf53105);}};exports[_0xe0b2('0x39')]=function(_0x5e0c36){var _0xd2379=moment()[_0xe0b2('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x5e0c36[_0xe0b2('0x3a')]=0xd;_0x5e0c36[_0xe0b2('0x3b')]=_0xe0b2('0x3c');_0x5e0c36['starttime']=_0xd2379;_0x5e0c36[_0xe0b2('0x3d')]=_0xd2379;_0x5e0c36[_0xe0b2('0x3e')]=_0xd2379;};exports[_0xe0b2('0x3f')]=function(_0x51ec35,_0x52daa6,_0x550f58){var _0x52b0f1=moment()['format'](_0xe0b2('0x40'));_0x51ec35[_0xe0b2('0x3a')]=_0x52daa6;_0x51ec35[_0xe0b2('0x3b')]=_0x550f58;_0x51ec35[_0xe0b2('0x3d')]=_0x52b0f1;_0x51ec35[_0xe0b2('0x41')]=getSeconds(_0x51ec35[_0xe0b2('0x3d')],_0x51ec35[_0xe0b2('0x42')]);};exports[_0xe0b2('0x43')]=function(_0x48f4a4,_0x2eda09,_0x1c47cc){_0x48f4a4[_0xe0b2('0x44')]=_0x2eda09;_0x48f4a4[_0xe0b2('0x45')]=_0x1c47cc;};exports[_0xe0b2('0x46')]=function(_0x51d5da,_0x1e2ef3,_0x5d71e5){var _0x421df9=moment()[_0xe0b2('0x14')](_0xe0b2('0x40'));_0x51d5da[_0xe0b2('0x3a')]=_0x1e2ef3;_0x51d5da['statedesc']=_0x5d71e5;_0x51d5da[_0xe0b2('0x3d')]=_0x51d5da[_0xe0b2('0x3d')]?_0x51d5da['responsetime']:_0x421df9;_0x51d5da[_0xe0b2('0x3e')]=_0x51d5da[_0xe0b2('0x3e')]?_0x51d5da[_0xe0b2('0x3e')]:_0x421df9;_0x51d5da[_0xe0b2('0x41')]=getSeconds(_0x51d5da['responsetime']||0x0,_0x51d5da['starttime']||0x0);_0x51d5da[_0xe0b2('0x47')]=_0x51d5da['answertime']?getSeconds(_0x51d5da[_0xe0b2('0x3e')],_0x51d5da[_0xe0b2('0x48')]):0x0;};exports[_0xe0b2('0x49')]=function(_0x32953c){return _0x32953c===_0xe0b2('0x4a');};exports['variablesAction']=function(_0x3772d4,_0x6b9f06,_0x49fd42,_0x4f2f8c,_0x4c05e9){var _0x16de5e=_0x4f2f8c?_0xe0b2('0x4b'):_0x3772d4['calleridname'];_0x16de5e=_0x4c05e9?_0xe0b2('0x4c'):_0x16de5e;return{'actionid':_0x3772d4[_0xe0b2('0x4d')],'action':_0xe0b2('0x4e'),'channel':_0x3772d4[_0xe0b2('0x4f')],'callerid':util[_0xe0b2('0x14')](_0xe0b2('0x15'),_0x16de5e,_0x3772d4['calleridnum']),'Exten':_0xe0b2('0x29'),'Context':_0xe0b2('0x50'),'Priority':'1','variable':_0x49fd42,'timeout':(_0x6b9f06['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x3772d4[_0xe0b2('0x4d')]};};exports['totalGlobal']=function(_0x4bfc8d){return _0x4bfc8d[_0xe0b2('0x51')]+_0x4bfc8d['countcongestionretry']+_0x4bfc8d['countnoanswerretry']+_0x4bfc8d[_0xe0b2('0x52')]+_0x4bfc8d[_0xe0b2('0x53')];};exports['cloneAction']=function(_0x4fbf10){var _0x28b03a=_[_0xe0b2('0x54')](_0x4fbf10);_0x28b03a[_0xe0b2('0x3a')]=0xf;_0x28b03a['statedesc']=_0xe0b2('0x55');return _0x28b03a;};exports[_0xe0b2('0x56')]=function(_0x2b24f7,_0x1560af,_0x169b29){var _0x41fe5c={};_0x41fe5c[_0x1560af]=_0x2b24f7[_0x1560af];_0x41fe5c[_0xe0b2('0x57')]=![];_0x41fe5c[_0xe0b2('0x58')]=moment()[_0xe0b2('0x59')](_0x169b29,_0xe0b2('0x5a'))[_0xe0b2('0x14')](_0xe0b2('0x40'));_0x41fe5c[_0xe0b2('0x1c')]=_0x2b24f7[_0xe0b2('0x1c')];_0x41fe5c['ListId']=_0x2b24f7[_0xe0b2('0x5b')];_0x41fe5c[_0xe0b2('0x5c')]=_0x2b24f7['VoiceQueueId']||undefined;return _0x41fe5c;};exports[_0xe0b2('0x5d')]=function(_0x58eb60,_0x58b11b){if(!_[_0xe0b2('0x17')](_0x58eb60)){if(_0x58eb60[_0xe0b2('0x5e')]>0x0){_0x58eb60[_0xe0b2('0x5e')]-=0x1;}else{logger['error'](_0x58b11b,_0xe0b2('0x5f'));}}else{logger[_0xe0b2('0x9')](_0x58b11b,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xe0b2('0x60')]=function(_0x492586){if(_0x492586<=0x0){return!![];}return![];};function buildObj(_0x53c080,_0x45ae90,_0x1c0150){_0x53c080[_0xe0b2('0x61')]=_0x45ae90;_0x53c080['name']=_0x53c080['queue'];_0x53c080[_0xe0b2('0x62')]=_0x53c080[_0xe0b2('0x4f')];_0x53c080[_0xe0b2('0x63')]=_0xe0b2('0x64');if(_0x1c0150){_0x53c080[_0xe0b2('0x65')]=_0x1c0150['mandatoryDisposition'];}return _0x53c080;}exports['buildObj']=buildObj;exports['buildAcw']=function(_0x364971){var _0x531498={};_0x531498[_0xe0b2('0x66')]=_0x364971[_0xe0b2('0x66')];_0x531498[_0xe0b2('0x62')]=_0x364971[_0xe0b2('0x4f')];_0x531498[_0xe0b2('0x4d')]=_0x364971[_0xe0b2('0x4d')];return _0x531498;};exports[_0xe0b2('0x67')]=function(_0x36ee09){var _0x5ec20c=[];for(var _0x447231 in _0x36ee09){if(_0x36ee09['hasOwnProperty'](_0x447231)){if(!_[_0xe0b2('0x17')](_0x36ee09[_0x447231])&&_0x36ee09[_0x447231]['state']==='not_inuse'&&_0x36ee09[_0x447231][_0xe0b2('0x68')]===_0xe0b2('0x69')){_0x5ec20c[_0xe0b2('0x6a')](_0x36ee09[_0x447231]['id']);}}}return _0x5ec20c;};exports[_0xe0b2('0x6b')]=function(_0x5b52ae){var _0x2e9fa6=moment()['milliseconds'](0x0);var _0x561d41=moment(_0x5b52ae)[_0xe0b2('0x6')](0x0);return _0x2e9fa6[_0xe0b2('0x7')](_0x561d41,_0xe0b2('0x6c'));};exports[_0xe0b2('0x6d')]=function(_0x342982){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x342982[_0xe0b2('0x1c')],'ListId':_0x342982['ListId'],'VoiceQueueId':_0x342982[_0xe0b2('0x5c')]||undefined,'CampaignId':_0x342982['CampaignId']||undefined};};exports['filterKey']=function(_0x59d2af){if(_0x59d2af===_0xe0b2('0x4d')||_0x59d2af==='idContact'||_0x59d2af===_0xe0b2('0x66')||_0x59d2af==='type'||_0x59d2af===_0xe0b2('0x6e')||_0x59d2af===_0xe0b2('0x6f')||_0x59d2af==='membername'||_0x59d2af===_0xe0b2('0x4f')||_0x59d2af===_0xe0b2('0x1a')||_0x59d2af==='active'||_0x59d2af===_0xe0b2('0x1b')||_0x59d2af==='scheduledat'||_0x59d2af===_0xe0b2('0x51')||_0x59d2af===_0xe0b2('0x70')||_0x59d2af===_0xe0b2('0x71')||_0x59d2af===_0xe0b2('0x72')||_0x59d2af===_0xe0b2('0x73')||_0x59d2af===_0xe0b2('0x74')||_0x59d2af===_0xe0b2('0x75')||_0x59d2af===_0xe0b2('0x76')||_0x59d2af==='ContactId'||_0x59d2af===_0xe0b2('0x5b')||_0x59d2af===_0xe0b2('0x45')||_0x59d2af===_0xe0b2('0x5c')||_0x59d2af===_0xe0b2('0x77')||_0x59d2af===_0xe0b2('0x78')||_0x59d2af===_0xe0b2('0x79')||_0x59d2af===_0xe0b2('0x7a')||_0x59d2af==='xmd-listid'||_0x59d2af===_0xe0b2('0x7b')||_0x59d2af===_0xe0b2('0x7c')||_0x59d2af==='xmd-dialoptions'||_0x59d2af===_0xe0b2('0x7d')||_0x59d2af===_0xe0b2('0x7e')||_0x59d2af===_0xe0b2('0x7f')||_0x59d2af===_0xe0b2('0x80')||_0x59d2af==='xmd-callerid'||_0x59d2af===_0xe0b2('0x81')||_0x59d2af===_0xe0b2('0x82')||_0x59d2af===_0xe0b2('0x83')||_0x59d2af==='rtpaudioqosbridged'||_0x59d2af===_0xe0b2('0x84')||_0x59d2af==='rtpaudioqosjitterbridged'||_0x59d2af===_0xe0b2('0x85')||_0x59d2af===_0xe0b2('0x86')||_0x59d2af===_0xe0b2('0x87')||_0x59d2af===_0xe0b2('0x88')||_0x59d2af===_0xe0b2('0x83')||_0x59d2af==='rtpaudioqosbridged'||_0x59d2af===_0xe0b2('0x84')||_0x59d2af===_0xe0b2('0x89')||_0x59d2af==='rtpaudioqosloss'||_0x59d2af===_0xe0b2('0x86')||_0x59d2af===_0xe0b2('0x87')||_0x59d2af===_0xe0b2('0x88')||_0x59d2af===_0xe0b2('0x8a')||_0x59d2af===_0xe0b2('0x8b')||_0x59d2af==='state'||_0x59d2af===_0xe0b2('0x3b')){return![];}return!![];};exports[_0xe0b2('0x8c')]=function(_0x426256,_0x33f61d){var _0x1dd5f1,_0x888d2e,_0x3c7189;if(_0x33f61d<=0x0){_0x33f61d=0x1;}_0x1dd5f1=new RegExp(_0xe0b2('0x8d')+_0x33f61d+'}$');_0x888d2e=Math[_0xe0b2('0x8e')](0xa,_0x33f61d-0x1);_0x3c7189=Math[_0xe0b2('0x8e')](0xa,_0x33f61d)-0x1;return util[_0xe0b2('0x14')]('%s',_[_0xe0b2('0x8f')](_0x426256,_0x1dd5f1,_['random'](_0x888d2e,_0x3c7189)));};exports['extractCalleridName']=function(_0x2b8b1f){var _0x8d20b7=_0x2b8b1f['match'](/"(.*?)"/);return _0x8d20b7?_0x8d20b7[0x1]:_0x2b8b1f;};exports[_0xe0b2('0x90')]=function(_0x495f86){var _0x361d6e=_0x495f86['match'](/<(.*?)>/);return _0x361d6e?_0x361d6e[0x1]:_0x495f86;};function buildNoAnswerEventPayload(_0x2f4f99,_0x90d28c){var _0x2dfd1b=buildObj(_0x2f4f99,_0xe0b2('0x91'));if(!_['isEmpty'](_0x90d28c[_0xe0b2('0x92')])){Object[_0xe0b2('0x93')](_0x90d28c[_0xe0b2('0x92')])[_0xe0b2('0x94')](function(_0x5c4820){_0x2dfd1b[_0x5c4820['toLowerCase']()]=_0x90d28c[_0xe0b2('0x92')][_0x5c4820];});}return _0x2dfd1b;}exports[_0xe0b2('0x95')]=buildNoAnswerEventPayload;
\ No newline at end of file
index ab3f2f4..e15a543 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3382=['queueadd','string','boolean','queueremove','queuepause','voicechannel','voicequeuechannelhangup'];(function(_0x100566,_0x46f178){var _0x56f802=function(_0x465ddc){while(--_0x465ddc){_0x100566['push'](_0x100566['shift']());}};_0x56f802(++_0x46f178);}(_0x3382,0xc4));var _0x2338=function(_0x43a5ae,_0x21b090){_0x43a5ae=_0x43a5ae-0x0;var _0x3a8e62=_0x3382[_0x43a5ae];return _0x3a8e62;};'use strict';exports[_0x2338('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x2338('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x2338('0x2'),'required':![]}};exports[_0x2338('0x3')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x2338('0x4')]={'interface':{'type':_0x2338('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':_0x2338('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':'string','required':!![]}};exports[_0x2338('0x5')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x2338('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0x2338('0x1')}};exports[_0x2338('0x6')]={'uniqueid':{'type':_0x2338('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x2338('0x1'),'required':!![]},'exten':{'type':_0x2338('0x1'),'required':!![]},'context':{'type':_0x2338('0x1')}};
\ No newline at end of file
+var _0x650c=['voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause','reload','voicequeuechannel','voicequeuechannelhangup'];(function(_0x2f122c,_0x109783){var _0x39758d=function(_0x575264){while(--_0x575264){_0x2f122c['push'](_0x2f122c['shift']());}};_0x39758d(++_0x109783);}(_0x650c,0x173));var _0xc650=function(_0x483134,_0x57de34){_0x483134=_0x483134-0x0;var _0x47518d=_0x650c[_0x483134];return _0x47518d;};'use strict';exports[_0xc650('0x0')]={'queue':{'type':_0xc650('0x1'),'required':!![]},'interface':{'type':_0xc650('0x1'),'required':!![]},'membername':{'type':_0xc650('0x1'),'required':!![]},'penalty':{'type':_0xc650('0x2'),'required':![]},'paused':{'type':_0xc650('0x3'),'required':![]}};exports[_0xc650('0x4')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xc650('0x1'),'required':!![]}};exports[_0xc650('0x5')]={'interface':{'type':_0xc650('0x1'),'required':!![]},'paused':{'type':_0xc650('0x3')},'reason':{'type':_0xc650('0x1'),'required':![]}};exports[_0xc650('0x6')]={'module':{'type':_0xc650('0x1'),'required':![]}};exports[_0xc650('0x7')]={'uniqueid':{'type':_0xc650('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0xc650('0x1'),'required':!![]},'filename':{'type':_0xc650('0x1')},'format':{'type':_0xc650('0x1')},'mixmonitorid':{'type':_0xc650('0x1')}};exports[_0xc650('0x8')]={'uniqueid':{'type':_0xc650('0x1'),'required':!![]}};exports[_0xc650('0x9')]={'uniqueid':{'type':_0xc650('0x1'),'required':!![]},'exten':{'type':_0xc650('0x1'),'required':!![]},'context':{'type':_0xc650('0x1')}};
\ No newline at end of file
index 9ed67c0..390c36a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28c8=['mergeFromDatabase','initAgents','length','isNil','format','SIP/%s','isUndefined','initTelephones','initTrunks','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','servicenowAccounts','dynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','uniqueid','queue','queuecallerleaveAt','seconds','sumDuration','queuecallercompleteAt','queuecallerexitAt','diff','queuecallerjoinAt','queuecallercomplete','initVoiceCallReports','disposition','ANSWERED','billableseconds','initCampaigns','SquareProject','initVoiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','getVoiceQueues','forEach','mergeDBDataToRealtime','exports','moment','util','./utils','../model/agent','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','../rpc/voiceQueue','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','faxAccounts','hasOwnProperty','mapKeys','name','interface','total','answered','sumHoldTime','sumBillable','ivrTotalCallsDays','isEmpty','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype'];(function(_0x3f0b30,_0x159bc8){var _0x2748a5=function(_0x3b42cc){while(--_0x3b42cc){_0x3f0b30['push'](_0x3f0b30['shift']());}};_0x2748a5(++_0x159bc8);}(_0x28c8,0x97));var _0x828c=function(_0x1e6659,_0x1f860c){_0x1e6659=_0x1e6659-0x0;var _0x4d16e4=_0x28c8[_0x1e6659];return _0x4d16e4;};'use strict';var _=require('lodash');var moment=require(_0x828c('0x0'));var util=require(_0x828c('0x1'));var utils=require(_0x828c('0x2'));var Agent=require(_0x828c('0x3'));var Telephone=require('../model/telephone');var Trunk=require('../model/trunk');var VoiceQueue=require(_0x828c('0x4'));var Trigger=require('../model/trigger');var Template=require(_0x828c('0x5'));var Campaign=require(_0x828c('0x6'));var VoiceExtension=require(_0x828c('0x7'));var ZendeskAccount=require(_0x828c('0x8'));var SalesforceAccount=require(_0x828c('0x9'));var FreshdeskAccount=require(_0x828c('0xa'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x828c('0xb'));var DeskAccount=require(_0x828c('0xc'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x828c('0xd'));var Dynamics365Account=require(_0x828c('0xe'));var FreshsalesAccount=require(_0x828c('0xf'));var FaxAccount=require(_0x828c('0x10'));var voiceQueue=require(_0x828c('0x11'));function Realtime(){this[_0x828c('0x12')]={};this[_0x828c('0x13')]={};this[_0x828c('0x14')]={};this[_0x828c('0x15')]={};this[_0x828c('0x16')]={};this[_0x828c('0x17')]={};this[_0x828c('0x18')]={};this[_0x828c('0x19')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x828c('0x1a')]={};this['channels']={};this['queueChannels']={};this[_0x828c('0x1b')]={};this[_0x828c('0x1c')]={};this[_0x828c('0x1d')]={};this[_0x828c('0x1e')]={};this[_0x828c('0x1f')]={};this[_0x828c('0x20')]={};this[_0x828c('0x21')]={};this[_0x828c('0x22')]={};this[_0x828c('0x23')]={};this['vtigerAccounts']={};this['servicenowAccounts']={};this['dynamics365Accounts']={};this['freshsalesAccounts']={};this[_0x828c('0x24')]={};}function freeIsNotKey(_0x204af7,_0x27c781,_0x6ddece){var _0x56709f=_['mapKeys'](_0x204af7,function(_0x254cdb){return _0x254cdb[_0x6ddece];});for(var _0x2976a7 in _0x27c781){if(_0x27c781[_0x828c('0x25')](_0x2976a7)){if(!_0x56709f[_0x2976a7]){delete _0x27c781[_0x2976a7];}}}}function freeIsNotKeySip(_0x105085,_0x19f6f6){var _0x241aac=_[_0x828c('0x26')](_0x105085,function(_0x5245b1){return util['format']('SIP/%s',_0x5245b1[_0x828c('0x27')]);});for(var _0x49c38f in _0x19f6f6){if(_0x19f6f6['hasOwnProperty'](_0x49c38f)){if(!_0x241aac[_0x49c38f]){delete _0x19f6f6[_0x49c38f];}}}}function freeIsNotKeyAgent(_0x5104c2,_0x20a9e0){var _0xe11f41=_['mapKeys'](_0x5104c2,function(_0x1fbf54){var _0x480a5d=_['isNil'](_0x1fbf54[_0x828c('0x28')])?util['format']('SIP/%s',_0x1fbf54[_0x828c('0x27')]):_0x1fbf54[_0x828c('0x28')];return _0x480a5d;});for(var _0x21772d in _0x20a9e0){if(_0x20a9e0[_0x828c('0x25')](_0x21772d)){if(!_0xe11f41[_0x21772d]){delete _0x20a9e0[_0x21772d];}}}}function clearVoiceCallReports(_0x541969){_0x541969[_0x828c('0x29')]=0x0;_0x541969[_0x828c('0x2a')]=0x0;_0x541969[_0x828c('0x2b')]=0x0;_0x541969['sumDuration']=0x0;_0x541969[_0x828c('0x2c')]=0x0;}function clearCampaigns(_0x38e5a0){if(!_['isEmpty'](_0x38e5a0)){for(var _0x44c7ba in _0x38e5a0){if(_0x38e5a0[_0x828c('0x25')](_0x44c7ba)){_0x38e5a0[_0x44c7ba][_0x828c('0x2d')]=0x0;_0x38e5a0[_0x44c7ba]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x33104b){if(!_[_0x828c('0x2e')](_0x33104b)){for(var _0x1d5a62 in _0x33104b){if(_0x33104b[_0x828c('0x25')](_0x1d5a62)){_0x33104b[_0x1d5a62][_0x828c('0x29')]=0x0;_0x33104b[_0x1d5a62][_0x828c('0x2a')]=0x0;_0x33104b[_0x1d5a62]['unmanaged']=0x0;_0x33104b[_0x1d5a62][_0x828c('0x2f')]=0x0;_0x33104b[_0x1d5a62]['sumHoldTime']=0x0;_0x33104b[_0x1d5a62]['sumDuration']=0x0;_0x33104b[_0x1d5a62][_0x828c('0x2c')]=0x0;_0x33104b[_0x1d5a62][_0x828c('0x30')]=0x0;_0x33104b[_0x1d5a62][_0x828c('0x31')]=0x0;_0x33104b[_0x1d5a62][_0x828c('0x32')]=0x0;_0x33104b[_0x1d5a62]['outboundCongestionCallsDay']=0x0;_0x33104b[_0x1d5a62][_0x828c('0x33')]=0x0;_0x33104b[_0x1d5a62][_0x828c('0x34')]=0x0;_0x33104b[_0x1d5a62][_0x828c('0x35')]=0x0;_0x33104b[_0x1d5a62]['outboundDropCallsDayCallersExit']=0x0;_0x33104b[_0x1d5a62]['outboundBlacklistCallsDay']=0x0;_0x33104b[_0x1d5a62]['outboundOriginateFailureCallsDay']=0x0;_0x33104b[_0x1d5a62][_0x828c('0x36')]=0x0;_0x33104b[_0x1d5a62][_0x828c('0x37')]=0x0;_0x33104b[_0x1d5a62]['outboundAnswerAgiCallsDay']=0x0;_0x33104b[_0x1d5a62][_0x828c('0x38')]=0x0;_0x33104b[_0x1d5a62][_0x828c('0x39')]=!![];}}}}Realtime[_0x828c('0x3a')][_0x828c('0x3b')]=function(_0x2b7a8f,_0xc40219){for(var _0x2cb2ae in _0xc40219){if(_0x2b7a8f['hasOwnProperty'](_0x2cb2ae)){_0x2b7a8f[_0x2cb2ae]=_0xc40219[_0x2cb2ae];}}};Realtime[_0x828c('0x3a')][_0x828c('0x3c')]=function(){var _0x3c1f13=this;return function(_0x3233f7){if(_0x3233f7){freeIsNotKeyAgent(_0x3233f7,_0x3c1f13[_0x828c('0x12')]);for(var _0x5ccb1d=0x0,_0x3c9a9e={},_0x55b13c={};_0x5ccb1d<_0x3233f7[_0x828c('0x3d')];_0x5ccb1d+=0x1){_0x3c9a9e=_0x3233f7[_0x5ccb1d];var _0x1619ab=_[_0x828c('0x3e')](_0x3c9a9e[_0x828c('0x28')])?util[_0x828c('0x3f')](_0x828c('0x40'),_0x3c9a9e[_0x828c('0x27')]):_0x3c9a9e[_0x828c('0x28')];if(_[_0x828c('0x41')](_0x3c1f13[_0x828c('0x12')][_0x1619ab])){_0x3c1f13[_0x828c('0x12')][_0x1619ab]=new Agent(_0x3c9a9e);}else{_0x3c1f13['mergeFromDatabase'](_0x3c1f13[_0x828c('0x12')][_0x1619ab],_0x3c9a9e);}}}return _0x3c1f13[_0x828c('0x12')];};};Realtime[_0x828c('0x3a')][_0x828c('0x42')]=function(){var _0x5979e8=this;return function(_0xb27a3){if(_0xb27a3){freeIsNotKeySip(_0xb27a3,_0x5979e8[_0x828c('0x13')]);for(var _0x14e240=0x0,_0x1be0a5={},_0x24e6dc={};_0x14e240<_0xb27a3[_0x828c('0x3d')];_0x14e240+=0x1){_0x1be0a5=_0xb27a3[_0x14e240];if(_[_0x828c('0x41')](_0x5979e8[_0x828c('0x13')][util['format'](_0x828c('0x40'),_0x1be0a5[_0x828c('0x27')])])){_0x5979e8[_0x828c('0x13')][util[_0x828c('0x3f')](_0x828c('0x40'),_0x1be0a5[_0x828c('0x27')])]=new Telephone(_0x1be0a5);}else{_0x5979e8[_0x828c('0x3b')](_0x5979e8[_0x828c('0x13')][util[_0x828c('0x3f')](_0x828c('0x40'),_0x1be0a5['name'])],_0x1be0a5);}}}return _0x5979e8[_0x828c('0x13')];};};Realtime['prototype'][_0x828c('0x43')]=function(){var _0xc99173=this;return function(_0x492743){if(_0x492743){freeIsNotKeySip(_0x492743,_0xc99173[_0x828c('0x14')]);for(var _0x59ea26=0x0,_0x435094={},_0x5f5a31={};_0x59ea26<_0x492743['length'];_0x59ea26+=0x1){_0x435094=_0x492743[_0x59ea26];if(_['isUndefined'](_0xc99173[_0x828c('0x14')][util[_0x828c('0x3f')](_0x828c('0x40'),_0x435094[_0x828c('0x27')])])){_0xc99173[_0x828c('0x14')][util[_0x828c('0x3f')](_0x828c('0x40'),_0x435094[_0x828c('0x27')])]=new Trunk(_0x435094);}else{_0xc99173[_0x828c('0x3b')](_0xc99173[_0x828c('0x14')][util[_0x828c('0x3f')]('SIP/%s',_0x435094['name'])],_0x435094);}}}return _0xc99173[_0x828c('0x14')];};};Realtime[_0x828c('0x3a')]['initTriggers']=function(){var _0x599035=this;return function(_0xceb84c){if(_0xceb84c){freeIsNotKey(_0xceb84c,_0x599035[_0x828c('0x16')],'id');for(var _0xa79063=0x0,_0x4acb9c={},_0x3d708f={};_0xa79063<_0xceb84c['length'];_0xa79063+=0x1){_0x4acb9c=_0xceb84c[_0xa79063];if(_[_0x828c('0x41')](_0x599035['triggers'][_0x4acb9c['id']])){_0x599035[_0x828c('0x16')][_0x4acb9c['id']]=new Trigger(_0x4acb9c);}else{_0x599035['mergeFromDatabase'](_0x599035['triggers'][_0x4acb9c['id']],_0x4acb9c);}}}return _0x599035[_0x828c('0x16')];};};Realtime[_0x828c('0x3a')][_0x828c('0x44')]=function(){var _0x43dbb1=this;return function(_0x297b05){if(_0x297b05){freeIsNotKey(_0x297b05,_0x43dbb1[_0x828c('0x18')],'id');for(var _0xbd9f34=0x0,_0x1e1383={},_0x4ff84a={};_0xbd9f34<_0x297b05[_0x828c('0x3d')];_0xbd9f34+=0x1){_0x1e1383=_0x297b05[_0xbd9f34];if(_[_0x828c('0x41')](_0x43dbb1['templates'][_0x1e1383['id']])){_0x43dbb1[_0x828c('0x18')][_0x1e1383['id']]=new Template(_0x1e1383);}else{_0x43dbb1[_0x828c('0x3b')](_0x43dbb1['templates'][_0x1e1383['id']],_0x1e1383);}}}return _0x43dbb1['templates'];};};Realtime[_0x828c('0x3a')][_0x828c('0x45')]=function(){var _0x3f82cc=this;return function(_0x4ce610){if(_0x4ce610){freeIsNotKey(_0x4ce610,_0x3f82cc[_0x828c('0x1e')],'id');for(var _0x41052d=0x0,_0x5ad055={},_0x5b9669={};_0x41052d<_0x4ce610['length'];_0x41052d+=0x1){_0x5ad055=_0x4ce610[_0x41052d];if(_[_0x828c('0x41')](_0x3f82cc['zendeskAccounts'][_0x5ad055['id']])){_0x3f82cc[_0x828c('0x1e')][_0x5ad055['id']]=new ZendeskAccount(_0x5ad055);}else{_0x3f82cc[_0x828c('0x3b')](_0x3f82cc['zendeskAccounts'][_0x5ad055['id']],_0x5ad055);}}}return _0x3f82cc['zendeskAccounts'];};};Realtime[_0x828c('0x3a')][_0x828c('0x46')]=function(){var _0x2a74ed=this;return function(_0x29f75b){if(_0x29f75b){freeIsNotKey(_0x29f75b,_0x2a74ed['salesforceAccounts'],'id');for(var _0x407411=0x0,_0x203bfa={},_0x3e02a8={};_0x407411<_0x29f75b['length'];_0x407411+=0x1){_0x203bfa=_0x29f75b[_0x407411];if(_[_0x828c('0x41')](_0x2a74ed[_0x828c('0x1f')][_0x203bfa['id']])){_0x2a74ed[_0x828c('0x1f')][_0x203bfa['id']]=new SalesforceAccount(_0x203bfa);}else{_0x2a74ed['mergeFromDatabase'](_0x2a74ed[_0x828c('0x1f')][_0x203bfa['id']],_0x203bfa);}}}return _0x2a74ed[_0x828c('0x1f')];};};Realtime[_0x828c('0x3a')][_0x828c('0x47')]=function(){var _0x1b5ee6=this;return function(_0x19c125){if(_0x19c125){freeIsNotKey(_0x19c125,_0x1b5ee6[_0x828c('0x21')],'id');for(var _0x1e3545=0x0,_0x2764ea={},_0x2ca582={};_0x1e3545<_0x19c125[_0x828c('0x3d')];_0x1e3545+=0x1){_0x2764ea=_0x19c125[_0x1e3545];if(_['isUndefined'](_0x1b5ee6[_0x828c('0x21')][_0x2764ea['id']])){_0x1b5ee6['freshdeskAccounts'][_0x2764ea['id']]=new FreshdeskAccount(_0x2764ea);}else{_0x1b5ee6[_0x828c('0x3b')](_0x1b5ee6[_0x828c('0x21')][_0x2764ea['id']],_0x2764ea);}}}return _0x1b5ee6[_0x828c('0x21')];};};Realtime['prototype'][_0x828c('0x48')]=function(){var _0x2e939d=this;return function(_0x5863ab){if(_0x5863ab){freeIsNotKey(_0x5863ab,_0x2e939d[_0x828c('0x22')],'id');for(var _0x56b038=0x0,_0x503132={},_0x2f5ada={};_0x56b038<_0x5863ab[_0x828c('0x3d')];_0x56b038+=0x1){_0x503132=_0x5863ab[_0x56b038];if(_[_0x828c('0x41')](_0x2e939d[_0x828c('0x22')][_0x503132['id']])){_0x2e939d[_0x828c('0x22')][_0x503132['id']]=new ZohoAccount(_0x503132);}else{_0x2e939d[_0x828c('0x3b')](_0x2e939d['zohoAccounts'][_0x503132['id']],_0x503132);}}}return _0x2e939d['zohoAccounts'];};};Realtime[_0x828c('0x3a')]['initDeskAccounts']=function(){var _0x587c2f=this;return function(_0x5dc2c4){if(_0x5dc2c4){freeIsNotKey(_0x5dc2c4,_0x587c2f[_0x828c('0x23')],'id');for(var _0x2a9be2=0x0,_0x20e222={},_0x2056d3={};_0x2a9be2<_0x5dc2c4[_0x828c('0x3d')];_0x2a9be2+=0x1){_0x20e222=_0x5dc2c4[_0x2a9be2];if(_[_0x828c('0x41')](_0x587c2f[_0x828c('0x23')][_0x20e222['id']])){_0x587c2f[_0x828c('0x23')][_0x20e222['id']]=new DeskAccount(_0x20e222);}else{_0x587c2f[_0x828c('0x3b')](_0x587c2f[_0x828c('0x23')][_0x20e222['id']],_0x20e222);}}}return _0x587c2f['deskAccounts'];};};Realtime[_0x828c('0x3a')]['initSugarcrmAccounts']=function(){var _0x4b6abb=this;return function(_0x5a7af2){if(_0x5a7af2){freeIsNotKey(_0x5a7af2,_0x4b6abb[_0x828c('0x20')],'id');for(var _0x1178d8=0x0,_0x1f226b={},_0xf41c04={};_0x1178d8<_0x5a7af2[_0x828c('0x3d')];_0x1178d8+=0x1){_0x1f226b=_0x5a7af2[_0x1178d8];if(_[_0x828c('0x41')](_0x4b6abb[_0x828c('0x20')][_0x1f226b['id']])){_0x4b6abb['sugarcrmAccounts'][_0x1f226b['id']]=new SugarcrmAccount(_0x1f226b);}else{_0x4b6abb[_0x828c('0x3b')](_0x4b6abb[_0x828c('0x20')][_0x1f226b['id']],_0x1f226b);}}}return _0x4b6abb[_0x828c('0x20')];};};Realtime['prototype'][_0x828c('0x49')]=function(){var _0x306ab7=this;return function(_0x40b441){if(_0x40b441){freeIsNotKey(_0x40b441,_0x306ab7['vtigerAccounts'],'id');for(var _0x373148=0x0,_0x369c78={},_0x11ccf9={};_0x373148<_0x40b441[_0x828c('0x3d')];_0x373148+=0x1){_0x369c78=_0x40b441[_0x373148];if(_[_0x828c('0x41')](_0x306ab7['vtigerAccounts'][_0x369c78['id']])){_0x306ab7[_0x828c('0x4a')][_0x369c78['id']]=new VtigerAccount(_0x369c78);}else{_0x306ab7[_0x828c('0x3b')](_0x306ab7['vtigerAccounts'][_0x369c78['id']],_0x369c78);}}}return _0x306ab7[_0x828c('0x4a')];};};Realtime[_0x828c('0x3a')][_0x828c('0x4b')]=function(){var _0x236c4d=this;return function(_0x1ac3f6){if(_0x1ac3f6){freeIsNotKey(_0x1ac3f6,_0x236c4d[_0x828c('0x4c')],'id');for(var _0x55448f=0x0,_0x5fcd51={},_0xba30c5={};_0x55448f<_0x1ac3f6[_0x828c('0x3d')];_0x55448f+=0x1){_0x5fcd51=_0x1ac3f6[_0x55448f];if(_[_0x828c('0x41')](_0x236c4d[_0x828c('0x4c')][_0x5fcd51['id']])){_0x236c4d[_0x828c('0x4c')][_0x5fcd51['id']]=new ServicenowAccount(_0x5fcd51);}else{_0x236c4d[_0x828c('0x3b')](_0x236c4d[_0x828c('0x4c')][_0x5fcd51['id']],_0x5fcd51);}}}return _0x236c4d[_0x828c('0x4c')];};};Realtime[_0x828c('0x3a')]['initDynamics365Accounts']=function(){var _0x2116b0=this;return function(_0x353b0b){if(_0x353b0b){freeIsNotKey(_0x353b0b,_0x2116b0[_0x828c('0x4d')],'id');for(var _0x59ff06=0x0,_0x612ed1={},_0x1b1610={};_0x59ff06<_0x353b0b[_0x828c('0x3d')];_0x59ff06+=0x1){_0x612ed1=_0x353b0b[_0x59ff06];if(_[_0x828c('0x41')](_0x2116b0[_0x828c('0x4d')][_0x612ed1['id']])){_0x2116b0[_0x828c('0x4d')][_0x612ed1['id']]=new Dynamics365Account(_0x612ed1);}else{_0x2116b0[_0x828c('0x3b')](_0x2116b0[_0x828c('0x4d')][_0x612ed1['id']],_0x612ed1);}}}return _0x2116b0[_0x828c('0x4d')];};};Realtime[_0x828c('0x3a')][_0x828c('0x4e')]=function(){var _0x24077d=this;return function(_0x2c1af8){if(_0x2c1af8){freeIsNotKey(_0x2c1af8,_0x24077d[_0x828c('0x4f')],'id');for(var _0x3e25fe=0x0,_0x383e3f={},_0x35af92={};_0x3e25fe<_0x2c1af8[_0x828c('0x3d')];_0x3e25fe+=0x1){_0x383e3f=_0x2c1af8[_0x3e25fe];if(_['isUndefined'](_0x24077d[_0x828c('0x4f')][_0x383e3f['id']])){_0x24077d[_0x828c('0x4f')][_0x383e3f['id']]=new FreshsalesAccount(_0x383e3f);}else{_0x24077d[_0x828c('0x3b')](_0x24077d[_0x828c('0x4f')][_0x383e3f['id']],_0x383e3f);}}}return _0x24077d[_0x828c('0x4f')];};};Realtime[_0x828c('0x3a')][_0x828c('0x50')]=function(){var _0x3cd57a=this;return function(_0x515375){for(var _0x1e2c0f=0x0;_0x1e2c0f<_0x515375[_0x828c('0x3d')];_0x1e2c0f+=0x1){_['merge'](_0x3cd57a[_0x828c('0x15')][_0x515375[_0x1e2c0f][_0x828c('0x27')]],_0x515375[_0x1e2c0f]);}return _0x3cd57a[_0x828c('0x15')];};};Realtime['prototype']['initVoiceQueueReports']=function(){var _0x1a997d=this;return function(_0x433209){clearVoiceQueues(_0x1a997d[_0x828c('0x15')]);if(_0x433209){_0x433209=_['groupBy'](_0x433209,_0x828c('0x51'));for(var _0x3f33d7 in _0x433209){if(_0x433209['hasOwnProperty'](_0x3f33d7)){var _0xcfe37={};for(var _0x2e6b90=0x0;_0x2e6b90<_0x433209[_0x3f33d7][_0x828c('0x3d')];_0x2e6b90+=0x1){var _0x5a41b4=_0x433209[_0x3f33d7][_0x2e6b90][_0x828c('0x52')];if(_0x1a997d[_0x828c('0x15')][_0x5a41b4]){if(_0x433209[_0x3f33d7][_0x2e6b90]['queuecallerexit']){_0x1a997d[_0x828c('0x15')][_0x5a41b4]['unmanaged']+=0x1;}if(_0x433209[_0x3f33d7][_0x2e6b90]['queuecallerabandon']){_0x1a997d['voiceQueues'][_0x5a41b4]['abandoned']+=0x1;}_0x1a997d[_0x828c('0x15')][_0x5a41b4]['sumHoldTime']+=moment(_0x433209[_0x3f33d7][_0x2e6b90][_0x828c('0x53')])['diff'](moment(_0x433209[_0x3f33d7][_0x2e6b90]['queuecallerjoinAt']),_0x828c('0x54'))||0x0;if(_0x2e6b90===_0x433209[_0x3f33d7]['length']-0x1){_0x1a997d['voiceQueues'][_0x5a41b4][_0x828c('0x55')]+=moment(_0x433209[_0x3f33d7][_0x2e6b90][_0x828c('0x56')]||_0x433209[_0x3f33d7][_0x2e6b90]['queuecallerabandonAt']||_0x433209[_0x3f33d7][_0x2e6b90][_0x828c('0x57')])[_0x828c('0x58')](moment(_0x433209[_0x3f33d7][_0x2e6b90][_0x828c('0x59')]),_0x828c('0x54'))||0x0;_0x1a997d[_0x828c('0x15')][_0x5a41b4][_0x828c('0x29')]+=0x1;if(_0x433209[_0x3f33d7][_0x2e6b90][_0x828c('0x5a')]){_0x1a997d[_0x828c('0x15')][_0x5a41b4]['answered']+=0x1;_0x1a997d[_0x828c('0x15')][_0x5a41b4]['sumBillable']+=moment(_0x433209[_0x3f33d7][_0x2e6b90][_0x828c('0x56')])[_0x828c('0x58')](moment(_0x433209[_0x3f33d7][_0x2e6b90][_0x828c('0x53')]),'seconds')||0x0;}}else{_0x1a997d['voiceQueues'][_0x5a41b4][_0x828c('0x55')]+=_0x1a997d[_0x828c('0x15')][_0x5a41b4][_0x828c('0x2b')]||0x0;}}}}}}return _0x1a997d[_0x828c('0x15')];};};Realtime[_0x828c('0x3a')][_0x828c('0x5b')]=function(){var _0x732a13=this;return function(_0x53a736){clearVoiceCallReports(_0x732a13[_0x828c('0x19')]);if(_0x53a736){for(var _0x328556=0x0;_0x328556<_0x53a736[_0x828c('0x3d')];_0x328556+=0x1){_0x732a13[_0x828c('0x19')][_0x828c('0x29')]+=0x1;_0x732a13['outbound'][_0x828c('0x55')]+=_0x53a736[_0x328556]['duration'];if(_0x53a736[_0x328556][_0x828c('0x5c')]===_0x828c('0x5d')){_0x732a13[_0x828c('0x19')]['answered']+=0x1;_0x732a13['outbound'][_0x828c('0x2b')]+=_0x53a736[_0x328556]['duration']-_0x53a736[_0x328556][_0x828c('0x5e')]||0x0;_0x732a13[_0x828c('0x19')][_0x828c('0x2c')]+=_0x53a736[_0x328556][_0x828c('0x5e')];}}}return _0x732a13[_0x828c('0x19')];};};Realtime[_0x828c('0x3a')][_0x828c('0x5f')]=function(){var _0x869c10=this;return function(_0x512c0b){if(_0x512c0b){freeIsNotKey(_0x512c0b,_0x869c10[_0x828c('0x17')],'name');for(var _0x2ceac0=0x0,_0x2766cc={};_0x2ceac0<_0x512c0b[_0x828c('0x3d')];_0x2ceac0+=0x1){_0x2766cc=_0x512c0b[_0x2ceac0];if(_[_0x828c('0x41')](_0x869c10[_0x828c('0x17')][_0x2766cc['name']])){_0x869c10[_0x828c('0x17')][_0x2766cc[_0x828c('0x27')]]=new Campaign(_0x2766cc);}else{_0x869c10[_0x828c('0x3b')](_0x869c10['campaigns'][_0x2766cc[_0x828c('0x27')]],_0x2766cc);_0x869c10[_0x828c('0x17')][_0x2766cc[_0x828c('0x27')]]['dialQueueProject']=_0x2766cc[_0x828c('0x60')]?_0x2766cc['SquareProject'][_0x828c('0x27')]:undefined;}}}return _0x869c10['campaigns'];};};Realtime[_0x828c('0x3a')][_0x828c('0x61')]=function(){var _0x4821d8=this;return function(_0x52dfbc){if(_0x52dfbc){freeIsNotKey(_0x52dfbc,_0x4821d8[_0x828c('0x1a')],'id');for(var _0x244c3c=0x0,_0x56a715={};_0x244c3c<_0x52dfbc[_0x828c('0x3d')];_0x244c3c+=0x1){_0x56a715=_0x52dfbc[_0x244c3c];if(_[_0x828c('0x41')](_0x4821d8[_0x828c('0x1a')][_0x56a715['id']])){_0x4821d8[_0x828c('0x1a')][_0x56a715['id']]=new VoiceExtension(_0x56a715);}else{_0x4821d8[_0x828c('0x3b')](_0x4821d8['voiceExtensions'][_0x56a715['id']],_0x56a715);}}}return _0x4821d8[_0x828c('0x1a')];};};Realtime[_0x828c('0x3a')][_0x828c('0x62')]=function(){var _0x5bf153=this;return function(_0x123e74){clearCampaigns(_0x5bf153[_0x828c('0x17')]);for(var _0x21ecb0=0x0;_0x21ecb0<_0x123e74[_0x828c('0x3d')];_0x21ecb0+=0x1){_[_0x828c('0x63')](_0x5bf153[_0x828c('0x17')][_0x123e74[_0x21ecb0]['name']],_0x123e74[_0x21ecb0]);}return _0x5bf153[_0x828c('0x17')];};};Realtime[_0x828c('0x3a')][_0x828c('0x64')]=function(){var _0x17f398=this;return function(_0x3c28b1){if(_0x3c28b1){freeIsNotKey(_0x3c28b1,_0x17f398[_0x828c('0x24')],'id');for(var _0x3b4383=0x0,_0x171f51={},_0x3c6837={};_0x3b4383<_0x3c28b1[_0x828c('0x3d')];_0x3b4383+=0x1){_0x171f51=_0x3c28b1[_0x3b4383];if(_[_0x828c('0x41')](_0x17f398[_0x828c('0x24')][_0x171f51['id']])){_0x17f398[_0x828c('0x24')][_0x171f51['id']]=new FaxAccount(_0x171f51);}else{_0x17f398[_0x828c('0x3b')](_0x17f398['faxAccounts'][_0x171f51['id']],_0x171f51);}}}return _0x17f398['faxAccounts'];};};Realtime[_0x828c('0x3a')]['getVoiceQueues']=function(){var _0x323038=this['voiceQueues'];var _0x4d9a12={};return voiceQueue[_0x828c('0x65')]()['then'](function(_0x44627e){_0x44627e[_0x828c('0x66')](function(_0x534ed1){if(_0x323038[_0x534ed1[_0x828c('0x27')]]===undefined){_0x4d9a12[_0x534ed1[_0x828c('0x27')]]=new VoiceQueue(_0x534ed1);}else{_0x4d9a12[_0x534ed1[_0x828c('0x27')]]=utils[_0x828c('0x67')](_0x323038[_0x534ed1[_0x828c('0x27')]],_0x534ed1);}});return _0x4d9a12;});};module[_0x828c('0x68')]=Realtime;
\ No newline at end of file
+var _0x0b0e=['total','sumHoldTime','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','initAgents','length','isNil','SIP/%s','isUndefined','prototype','initTelephones','initTrunks','trunks','initTriggers','initTemplates','salesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queue','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','diff','queuecallercomplete','answered','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','initVoiceQueues','exports','lodash','util','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','voiceQueues','triggers','templates','outbound','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','mapKeys','name','hasOwnProperty','format','interface'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x0b0e,0x187));var _0xe0b0=function(_0xb77dfe,_0x39c4c7){_0xb77dfe=_0xb77dfe-0x0;var _0x5e4f5d=_0x0b0e[_0xb77dfe];return _0x5e4f5d;};'use strict';var _=require(_0xe0b0('0x0'));var moment=require('moment');var util=require(_0xe0b0('0x1'));var Agent=require('../model/agent');var Telephone=require(_0xe0b0('0x2'));var Trunk=require(_0xe0b0('0x3'));var VoiceQueue=require(_0xe0b0('0x4'));var Trigger=require(_0xe0b0('0x5'));var Template=require(_0xe0b0('0x6'));var Campaign=require(_0xe0b0('0x7'));var VoiceExtension=require(_0xe0b0('0x8'));var ZendeskAccount=require(_0xe0b0('0x9'));var SalesforceAccount=require(_0xe0b0('0xa'));var FreshdeskAccount=require(_0xe0b0('0xb'));var SugarcrmAccount=require(_0xe0b0('0xc'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xe0b0('0xd'));var ServicenowAccount=require(_0xe0b0('0xe'));var Dynamics365Account=require(_0xe0b0('0xf'));var FreshsalesAccount=require(_0xe0b0('0x10'));var FaxAccount=require('../model/faxAccount');function Realtime(){this[_0xe0b0('0x11')]={};this[_0xe0b0('0x12')]={};this['trunks']={};this[_0xe0b0('0x13')]={};this[_0xe0b0('0x14')]={};this['campaigns']={};this[_0xe0b0('0x15')]={};this[_0xe0b0('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xe0b0('0x17')]={};this['channels']={};this[_0xe0b0('0x18')]={};this[_0xe0b0('0x19')]={};this[_0xe0b0('0x1a')]={};this[_0xe0b0('0x1b')]={};this[_0xe0b0('0x1c')]={};this['salesforceAccounts']={};this[_0xe0b0('0x1d')]={};this[_0xe0b0('0x1e')]={};this[_0xe0b0('0x1f')]={};this[_0xe0b0('0x20')]={};this[_0xe0b0('0x21')]={};this['servicenowAccounts']={};this[_0xe0b0('0x22')]={};this['freshsalesAccounts']={};this[_0xe0b0('0x23')]={};}function freeIsNotKey(_0xadee6e,_0x519ae8,_0x11fdca){var _0x4a4cc0=_[_0xe0b0('0x24')](_0xadee6e,function(_0x100204){return _0x100204[_0x11fdca];});for(var _0x56bcc7 in _0x519ae8){if(_0x519ae8['hasOwnProperty'](_0x56bcc7)){if(!_0x4a4cc0[_0x56bcc7]){delete _0x519ae8[_0x56bcc7];}}}}function freeIsNotKeySip(_0x46bb44,_0x50a441){var _0x4df8da=_['mapKeys'](_0x46bb44,function(_0x1920ee){return util['format']('SIP/%s',_0x1920ee[_0xe0b0('0x25')]);});for(var _0x59dff5 in _0x50a441){if(_0x50a441[_0xe0b0('0x26')](_0x59dff5)){if(!_0x4df8da[_0x59dff5]){delete _0x50a441[_0x59dff5];}}}}function freeIsNotKeyAgent(_0x5dba2f,_0x2c84cc){var _0x1cd7c4=_[_0xe0b0('0x24')](_0x5dba2f,function(_0x310a6d){var _0x2cf6a1=_['isNil'](_0x310a6d['interface'])?util[_0xe0b0('0x27')]('SIP/%s',_0x310a6d[_0xe0b0('0x25')]):_0x310a6d[_0xe0b0('0x28')];return _0x2cf6a1;});for(var _0x513e63 in _0x2c84cc){if(_0x2c84cc[_0xe0b0('0x26')](_0x513e63)){if(!_0x1cd7c4[_0x513e63]){delete _0x2c84cc[_0x513e63];}}}}function clearVoiceCallReports(_0x503883){_0x503883[_0xe0b0('0x29')]=0x0;_0x503883['answered']=0x0;_0x503883[_0xe0b0('0x2a')]=0x0;_0x503883['sumDuration']=0x0;_0x503883[_0xe0b0('0x2b')]=0x0;}function clearCampaigns(_0x4de537){if(!_[_0xe0b0('0x2c')](_0x4de537)){for(var _0x4aafbe in _0x4de537){if(_0x4de537[_0xe0b0('0x26')](_0x4aafbe)){_0x4de537[_0x4aafbe]['ivrTotalCallsDays']=0x0;_0x4de537[_0x4aafbe][_0xe0b0('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x3c3bc2){if(!_[_0xe0b0('0x2c')](_0x3c3bc2)){for(var _0x1d91ad in _0x3c3bc2){if(_0x3c3bc2[_0xe0b0('0x26')](_0x1d91ad)){_0x3c3bc2[_0x1d91ad][_0xe0b0('0x29')]=0x0;_0x3c3bc2[_0x1d91ad]['answered']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2e')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2f')]=0x0;_0x3c3bc2[_0x1d91ad]['sumHoldTime']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x30')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2b')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x31')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x32')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x33')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x34')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x35')]=0x0;_0x3c3bc2[_0x1d91ad]['outboundUnknownCallsDay']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x36')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x37')]=0x0;_0x3c3bc2[_0x1d91ad]['outboundBlacklistCallsDay']=0x0;_0x3c3bc2[_0x1d91ad]['outboundOriginateFailureCallsDay']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x38')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x39')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x31')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x3a')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x3b')]=!![];}}}}Realtime['prototype'][_0xe0b0('0x3c')]=function(_0x3231fc,_0x7867c4){for(var _0x29d725 in _0x7867c4){if(_0x3231fc[_0xe0b0('0x26')](_0x29d725)){_0x3231fc[_0x29d725]=_0x7867c4[_0x29d725];}}};Realtime['prototype'][_0xe0b0('0x3d')]=function(){var _0x208945=this;return function(_0xfc51d3){if(_0xfc51d3){freeIsNotKeyAgent(_0xfc51d3,_0x208945[_0xe0b0('0x11')]);for(var _0x3575bc=0x0,_0x12eeb8={};_0x3575bc<_0xfc51d3[_0xe0b0('0x3e')];_0x3575bc+=0x1){_0x12eeb8=_0xfc51d3[_0x3575bc];var _0x20908f=_[_0xe0b0('0x3f')](_0x12eeb8[_0xe0b0('0x28')])?util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x12eeb8[_0xe0b0('0x25')]):_0x12eeb8[_0xe0b0('0x28')];if(_[_0xe0b0('0x41')](_0x208945['agents'][_0x20908f])){_0x208945[_0xe0b0('0x11')][_0x20908f]=new Agent(_0x12eeb8);}else{_0x208945[_0xe0b0('0x3c')](_0x208945[_0xe0b0('0x11')][_0x20908f],_0x12eeb8);}}}return _0x208945[_0xe0b0('0x11')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x43')]=function(){var _0x12024d=this;return function(_0x533fc7){if(_0x533fc7){freeIsNotKeySip(_0x533fc7,_0x12024d['telephones']);for(var _0x549d9a=0x0,_0x5317df={};_0x549d9a<_0x533fc7[_0xe0b0('0x3e')];_0x549d9a+=0x1){_0x5317df=_0x533fc7[_0x549d9a];if(_[_0xe0b0('0x41')](_0x12024d[_0xe0b0('0x12')][util['format'](_0xe0b0('0x40'),_0x5317df[_0xe0b0('0x25')])])){_0x12024d[_0xe0b0('0x12')][util[_0xe0b0('0x27')]('SIP/%s',_0x5317df[_0xe0b0('0x25')])]=new Telephone(_0x5317df);}else{_0x12024d[_0xe0b0('0x3c')](_0x12024d[_0xe0b0('0x12')][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x5317df[_0xe0b0('0x25')])],_0x5317df);}}}return _0x12024d[_0xe0b0('0x12')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x44')]=function(){var _0x54f251=this;return function(_0x3e349b){if(_0x3e349b){freeIsNotKeySip(_0x3e349b,_0x54f251['trunks']);for(var _0x34178d=0x0,_0x2d5f47={};_0x34178d<_0x3e349b[_0xe0b0('0x3e')];_0x34178d+=0x1){_0x2d5f47=_0x3e349b[_0x34178d];if(_[_0xe0b0('0x41')](_0x54f251['trunks'][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47[_0xe0b0('0x25')])])){_0x54f251[_0xe0b0('0x45')][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47[_0xe0b0('0x25')])]=new Trunk(_0x2d5f47);}else{_0x54f251[_0xe0b0('0x3c')](_0x54f251['trunks'][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47['name'])],_0x2d5f47);}}}return _0x54f251['trunks'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x46')]=function(){var _0x56e7df=this;return function(_0x18a59d){if(_0x18a59d){freeIsNotKey(_0x18a59d,_0x56e7df[_0xe0b0('0x14')],'id');for(var _0x6bca5c=0x0,_0x1c869d={};_0x6bca5c<_0x18a59d[_0xe0b0('0x3e')];_0x6bca5c+=0x1){_0x1c869d=_0x18a59d[_0x6bca5c];if(_['isUndefined'](_0x56e7df['triggers'][_0x1c869d['id']])){_0x56e7df['triggers'][_0x1c869d['id']]=new Trigger(_0x1c869d);}else{_0x56e7df[_0xe0b0('0x3c')](_0x56e7df[_0xe0b0('0x14')][_0x1c869d['id']],_0x1c869d);}}}return _0x56e7df['triggers'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x47')]=function(){var _0x14197b=this;return function(_0x5f037d){if(_0x5f037d){freeIsNotKey(_0x5f037d,_0x14197b[_0xe0b0('0x15')],'id');for(var _0x5c6f94=0x0,_0x57d4b0={};_0x5c6f94<_0x5f037d[_0xe0b0('0x3e')];_0x5c6f94+=0x1){_0x57d4b0=_0x5f037d[_0x5c6f94];if(_[_0xe0b0('0x41')](_0x14197b[_0xe0b0('0x15')][_0x57d4b0['id']])){_0x14197b[_0xe0b0('0x15')][_0x57d4b0['id']]=new Template(_0x57d4b0);}else{_0x14197b[_0xe0b0('0x3c')](_0x14197b['templates'][_0x57d4b0['id']],_0x57d4b0);}}}return _0x14197b[_0xe0b0('0x15')];};};Realtime[_0xe0b0('0x42')]['initZendeskAccounts']=function(){var _0x50c805=this;return function(_0x5ddad1){if(_0x5ddad1){freeIsNotKey(_0x5ddad1,_0x50c805[_0xe0b0('0x1c')],'id');for(var _0x2184d3=0x0,_0x2419ce={};_0x2184d3<_0x5ddad1[_0xe0b0('0x3e')];_0x2184d3+=0x1){_0x2419ce=_0x5ddad1[_0x2184d3];if(_['isUndefined'](_0x50c805[_0xe0b0('0x1c')][_0x2419ce['id']])){_0x50c805[_0xe0b0('0x1c')][_0x2419ce['id']]=new ZendeskAccount(_0x2419ce);}else{_0x50c805['mergeFromDatabase'](_0x50c805['zendeskAccounts'][_0x2419ce['id']],_0x2419ce);}}}return _0x50c805[_0xe0b0('0x1c')];};};Realtime[_0xe0b0('0x42')]['initSalesforceAccounts']=function(){var _0x2b1917=this;return function(_0x27fd31){if(_0x27fd31){freeIsNotKey(_0x27fd31,_0x2b1917['salesforceAccounts'],'id');for(var _0x5cb2b6=0x0,_0x123ad2={};_0x5cb2b6<_0x27fd31['length'];_0x5cb2b6+=0x1){_0x123ad2=_0x27fd31[_0x5cb2b6];if(_[_0xe0b0('0x41')](_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']])){_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']]=new SalesforceAccount(_0x123ad2);}else{_0x2b1917[_0xe0b0('0x3c')](_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']],_0x123ad2);}}}return _0x2b1917[_0xe0b0('0x48')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x2ef908=this;return function(_0x5d380a){if(_0x5d380a){freeIsNotKey(_0x5d380a,_0x2ef908['freshdeskAccounts'],'id');for(var _0x249d9a=0x0,_0x222174={};_0x249d9a<_0x5d380a['length'];_0x249d9a+=0x1){_0x222174=_0x5d380a[_0x249d9a];if(_['isUndefined'](_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']])){_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']]=new FreshdeskAccount(_0x222174);}else{_0x2ef908[_0xe0b0('0x3c')](_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']],_0x222174);}}}return _0x2ef908[_0xe0b0('0x1e')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x49')]=function(){var _0x4ebb0f=this;return function(_0x22c7bc){if(_0x22c7bc){freeIsNotKey(_0x22c7bc,_0x4ebb0f['zohoAccounts'],'id');for(var _0x17b3d4=0x0,_0x54106c={};_0x17b3d4<_0x22c7bc['length'];_0x17b3d4+=0x1){_0x54106c=_0x22c7bc[_0x17b3d4];if(_[_0xe0b0('0x41')](_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']])){_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']]=new ZohoAccount(_0x54106c);}else{_0x4ebb0f[_0xe0b0('0x3c')](_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']],_0x54106c);}}}return _0x4ebb0f[_0xe0b0('0x1f')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4a')]=function(){var _0x2e1c9b=this;return function(_0x4e0d87){if(_0x4e0d87){freeIsNotKey(_0x4e0d87,_0x2e1c9b[_0xe0b0('0x20')],'id');for(var _0x57ccc9=0x0,_0x2b5553={};_0x57ccc9<_0x4e0d87[_0xe0b0('0x3e')];_0x57ccc9+=0x1){_0x2b5553=_0x4e0d87[_0x57ccc9];if(_[_0xe0b0('0x41')](_0x2e1c9b[_0xe0b0('0x20')][_0x2b5553['id']])){_0x2e1c9b[_0xe0b0('0x20')][_0x2b5553['id']]=new DeskAccount(_0x2b5553);}else{_0x2e1c9b[_0xe0b0('0x3c')](_0x2e1c9b['deskAccounts'][_0x2b5553['id']],_0x2b5553);}}}return _0x2e1c9b[_0xe0b0('0x20')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4b')]=function(){var _0x271445=this;return function(_0x3bb6d6){if(_0x3bb6d6){freeIsNotKey(_0x3bb6d6,_0x271445[_0xe0b0('0x1d')],'id');for(var _0x234cb7=0x0,_0x1a60d2={};_0x234cb7<_0x3bb6d6[_0xe0b0('0x3e')];_0x234cb7+=0x1){_0x1a60d2=_0x3bb6d6[_0x234cb7];if(_[_0xe0b0('0x41')](_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']])){_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']]=new SugarcrmAccount(_0x1a60d2);}else{_0x271445[_0xe0b0('0x3c')](_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']],_0x1a60d2);}}}return _0x271445[_0xe0b0('0x1d')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4c')]=function(){var _0x155738=this;return function(_0x5aa79b){if(_0x5aa79b){freeIsNotKey(_0x5aa79b,_0x155738[_0xe0b0('0x21')],'id');for(var _0xe7fbac=0x0,_0x1182dc={};_0xe7fbac<_0x5aa79b[_0xe0b0('0x3e')];_0xe7fbac+=0x1){_0x1182dc=_0x5aa79b[_0xe7fbac];if(_[_0xe0b0('0x41')](_0x155738[_0xe0b0('0x21')][_0x1182dc['id']])){_0x155738[_0xe0b0('0x21')][_0x1182dc['id']]=new VtigerAccount(_0x1182dc);}else{_0x155738['mergeFromDatabase'](_0x155738['vtigerAccounts'][_0x1182dc['id']],_0x1182dc);}}}return _0x155738[_0xe0b0('0x21')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4d')]=function(){var _0x47ecc1=this;return function(_0x117d20){if(_0x117d20){freeIsNotKey(_0x117d20,_0x47ecc1[_0xe0b0('0x4e')],'id');for(var _0x309efb=0x0,_0x3d820c={};_0x309efb<_0x117d20[_0xe0b0('0x3e')];_0x309efb+=0x1){_0x3d820c=_0x117d20[_0x309efb];if(_['isUndefined'](_0x47ecc1[_0xe0b0('0x4e')][_0x3d820c['id']])){_0x47ecc1[_0xe0b0('0x4e')][_0x3d820c['id']]=new ServicenowAccount(_0x3d820c);}else{_0x47ecc1[_0xe0b0('0x3c')](_0x47ecc1['servicenowAccounts'][_0x3d820c['id']],_0x3d820c);}}}return _0x47ecc1[_0xe0b0('0x4e')];};};Realtime[_0xe0b0('0x42')]['initDynamics365Accounts']=function(){var _0x1bd249=this;return function(_0x4c5478){if(_0x4c5478){freeIsNotKey(_0x4c5478,_0x1bd249['dynamics365Accounts'],'id');for(var _0x4474ac=0x0,_0x57b51e={};_0x4474ac<_0x4c5478['length'];_0x4474ac+=0x1){_0x57b51e=_0x4c5478[_0x4474ac];if(_[_0xe0b0('0x41')](_0x1bd249[_0xe0b0('0x22')][_0x57b51e['id']])){_0x1bd249[_0xe0b0('0x22')][_0x57b51e['id']]=new Dynamics365Account(_0x57b51e);}else{_0x1bd249[_0xe0b0('0x3c')](_0x1bd249['dynamics365Accounts'][_0x57b51e['id']],_0x57b51e);}}}return _0x1bd249[_0xe0b0('0x22')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4f')]=function(){var _0x41ec8e=this;return function(_0x1b29c){if(_0x1b29c){freeIsNotKey(_0x1b29c,_0x41ec8e[_0xe0b0('0x50')],'id');for(var _0xc5e88c=0x0,_0x224f1e={};_0xc5e88c<_0x1b29c['length'];_0xc5e88c+=0x1){_0x224f1e=_0x1b29c[_0xc5e88c];if(_['isUndefined'](_0x41ec8e[_0xe0b0('0x50')][_0x224f1e['id']])){_0x41ec8e[_0xe0b0('0x50')][_0x224f1e['id']]=new FreshsalesAccount(_0x224f1e);}else{_0x41ec8e[_0xe0b0('0x3c')](_0x41ec8e['freshsalesAccounts'][_0x224f1e['id']],_0x224f1e);}}}return _0x41ec8e['freshsalesAccounts'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x51')]=function(){var _0x5d7cf4=this;return function(_0x5eca3d){for(var _0x691136=0x0;_0x691136<_0x5eca3d[_0xe0b0('0x3e')];_0x691136+=0x1){_[_0xe0b0('0x52')](_0x5d7cf4[_0xe0b0('0x13')][_0x5eca3d[_0x691136][_0xe0b0('0x25')]],_0x5eca3d[_0x691136]);}return _0x5d7cf4[_0xe0b0('0x13')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x53')]=function(){var _0x51f209=this;return function(_0x1daff7){clearVoiceQueues(_0x51f209[_0xe0b0('0x13')]);if(_0x1daff7){_0x1daff7=_[_0xe0b0('0x54')](_0x1daff7,'uniqueid');for(var _0x4fbf44 in _0x1daff7){if(_0x1daff7['hasOwnProperty'](_0x4fbf44)){for(var _0x56ee83=0x0;_0x56ee83<_0x1daff7[_0x4fbf44]['length'];_0x56ee83+=0x1){var _0x567c06=_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x55')];if(_0x51f209['voiceQueues'][_0x567c06]){if(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerexit']){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2e')]+=0x1;}if(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x56')]){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2f')]+=0x1;}_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2a')]+=moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x57')])['diff'](moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x58')]),_0xe0b0('0x59'))||0x0;if(_0x56ee83===_0x1daff7[_0x4fbf44][_0xe0b0('0x3e')]-0x1){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x30')]+=moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5a')]||_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5b')]||_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerexitAt'])[_0xe0b0('0x5c')](moment(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerjoinAt']),_0xe0b0('0x59'))||0x0;_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x29')]+=0x1;if(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5d')]){_0x51f209['voiceQueues'][_0x567c06][_0xe0b0('0x5e')]+=0x1;_0x51f209[_0xe0b0('0x13')][_0x567c06]['sumBillable']+=moment(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallercompleteAt'])[_0xe0b0('0x5c')](moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x57')]),_0xe0b0('0x59'))||0x0;}}else{_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x30')]+=_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2a')]||0x0;}}}}}}return _0x51f209[_0xe0b0('0x13')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x5f')]=function(){var _0x5a63e6=this;return function(_0x4c512b){clearVoiceCallReports(_0x5a63e6[_0xe0b0('0x16')]);if(_0x4c512b){for(var _0x4880d5=0x0;_0x4880d5<_0x4c512b['length'];_0x4880d5+=0x1){_0x5a63e6['outbound']['total']+=0x1;_0x5a63e6[_0xe0b0('0x16')]['sumDuration']+=_0x4c512b[_0x4880d5][_0xe0b0('0x60')];if(_0x4c512b[_0x4880d5][_0xe0b0('0x61')]===_0xe0b0('0x62')){_0x5a63e6[_0xe0b0('0x16')]['answered']+=0x1;_0x5a63e6[_0xe0b0('0x16')][_0xe0b0('0x2a')]+=_0x4c512b[_0x4880d5]['duration']-_0x4c512b[_0x4880d5][_0xe0b0('0x63')]||0x0;_0x5a63e6[_0xe0b0('0x16')][_0xe0b0('0x2b')]+=_0x4c512b[_0x4880d5][_0xe0b0('0x63')];}}}return _0x5a63e6[_0xe0b0('0x16')];};};Realtime['prototype']['initCampaigns']=function(){var _0x55aef7=this;return function(_0x545694){if(_0x545694){freeIsNotKey(_0x545694,_0x55aef7['campaigns'],_0xe0b0('0x25'));for(var _0x567e1a=0x0,_0x3c09af={};_0x567e1a<_0x545694['length'];_0x567e1a+=0x1){_0x3c09af=_0x545694[_0x567e1a];if(_[_0xe0b0('0x41')](_0x55aef7[_0xe0b0('0x64')][_0x3c09af[_0xe0b0('0x25')]])){_0x55aef7[_0xe0b0('0x64')][_0x3c09af[_0xe0b0('0x25')]]=new Campaign(_0x3c09af);}else{_0x55aef7[_0xe0b0('0x3c')](_0x55aef7['campaigns'][_0x3c09af['name']],_0x3c09af);_0x55aef7['campaigns'][_0x3c09af['name']][_0xe0b0('0x65')]=_0x3c09af[_0xe0b0('0x66')]?_0x3c09af[_0xe0b0('0x66')][_0xe0b0('0x25')]:undefined;}}}return _0x55aef7[_0xe0b0('0x64')];};};Realtime['prototype'][_0xe0b0('0x67')]=function(){var _0x39a07b=this;return function(_0xf77616){if(_0xf77616){freeIsNotKey(_0xf77616,_0x39a07b[_0xe0b0('0x17')],'id');for(var _0x154e6d=0x0,_0x2a5082={};_0x154e6d<_0xf77616[_0xe0b0('0x3e')];_0x154e6d+=0x1){_0x2a5082=_0xf77616[_0x154e6d];if(_[_0xe0b0('0x41')](_0x39a07b[_0xe0b0('0x17')][_0x2a5082['id']])){_0x39a07b['voiceExtensions'][_0x2a5082['id']]=new VoiceExtension(_0x2a5082);}else{_0x39a07b['mergeFromDatabase'](_0x39a07b[_0xe0b0('0x17')][_0x2a5082['id']],_0x2a5082);}}}return _0x39a07b[_0xe0b0('0x17')];};};Realtime['prototype'][_0xe0b0('0x68')]=function(){var _0x4593f1=this;return function(_0x44c475){clearCampaigns(_0x4593f1[_0xe0b0('0x64')]);for(var _0x7358ce=0x0;_0x7358ce<_0x44c475[_0xe0b0('0x3e')];_0x7358ce+=0x1){_[_0xe0b0('0x52')](_0x4593f1[_0xe0b0('0x64')][_0x44c475[_0x7358ce]['name']],_0x44c475[_0x7358ce]);}return _0x4593f1['campaigns'];};};Realtime['prototype'][_0xe0b0('0x69')]=function(){var _0x90d471=this;return function(_0x5d2365){if(_0x5d2365){freeIsNotKey(_0x5d2365,_0x90d471[_0xe0b0('0x23')],'id');for(var _0x448694=0x0,_0x396eec={};_0x448694<_0x5d2365[_0xe0b0('0x3e')];_0x448694+=0x1){_0x396eec=_0x5d2365[_0x448694];if(_['isUndefined'](_0x90d471['faxAccounts'][_0x396eec['id']])){_0x90d471['faxAccounts'][_0x396eec['id']]=new FaxAccount(_0x396eec);}else{_0x90d471[_0xe0b0('0x3c')](_0x90d471[_0xe0b0('0x23')][_0x396eec['id']],_0x396eec);}}}return _0x90d471['faxAccounts'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x6a')]=function(){var _0x5547ee=this;return function(_0x576482){if(_0x576482){freeIsNotKey(_0x576482,_0x5547ee[_0xe0b0('0x13')],'name');for(var _0x251195=0x0,_0x5f06c0={};_0x251195<_0x576482[_0xe0b0('0x3e')];_0x251195+=0x1){_0x5f06c0=_0x576482[_0x251195];if(_[_0xe0b0('0x41')](_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]])){_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]]=new VoiceQueue(_0x5f06c0);}else{_0x5547ee[_0xe0b0('0x3c')](_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]],_0x5f06c0);}}}return _0x5547ee['voiceQueues'];};};module[_0xe0b0('0x6b')]=Realtime;
\ No newline at end of file
index a1a4e5e..8d1d3ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-'use strict';function mergeDBDataToRealtime(_0x1013ff,_0x1cb8d2){var _0x2e66de=Object['assign']({},_0x1013ff);for(var _0x27a4d4 in _0x1cb8d2){if(_0x2e66de['hasOwnProperty'](_0x27a4d4)){_0x2e66de[_0x27a4d4]=_0x1cb8d2[_0x27a4d4];}}return _0x2e66de;}exports['mergeDBDataToRealtime']=mergeDBDataToRealtime;
\ No newline at end of file
+var _0x4879=['assign','mergeDBDataToRealtime'];(function(_0x5cddea,_0x18ca0d){var _0x16a4b4=function(_0x1425e1){while(--_0x1425e1){_0x5cddea['push'](_0x5cddea['shift']());}};_0x16a4b4(++_0x18ca0d);}(_0x4879,0x1ae));var _0x9487=function(_0x31708a,_0x500851){_0x31708a=_0x31708a-0x0;var _0x3b4f83=_0x4879[_0x31708a];return _0x3b4f83;};'use strict';function mergeDBDataToRealtime(_0x11922b,_0x48eec6){var _0x3da20f=Object[_0x9487('0x0')]({},_0x11922b);for(var _0x529599 in _0x48eec6){if(_0x3da20f['hasOwnProperty'](_0x529599)){_0x3da20f[_0x529599]=_0x48eec6[_0x529599];}}return _0x3da20f;}exports[_0x9487('0x1')]=mergeDBDataToRealtime;
\ No newline at end of file
index 97900d2..ea362a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b28=['type','UserId','membername','monitor','monitors','monitorFilename','createdAt','exten','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','Local','indexOf','mobile','phone','substring','lastIndexOf','attendedTransfer','exports','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','xdr','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','findAgent','find','accountcode','name','isNil','format','SIP/%s','connectedlinenum','assigned','lastAssignedTo','interface','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','create','match','getAgentByInternal','keys','length','getCallType','channel','split','outbound','destination','lastapplication','queue','lastdata','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','linkedid','transfers','transfereelinkedid','uniqueid'];(function(_0x4b968b,_0x10b4c7){var _0x54be9e=function(_0x5b9a6d){while(--_0x5b9a6d){_0x4b968b['push'](_0x4b968b['shift']());}};_0x54be9e(++_0x10b4c7);}(_0x1b28,0x73));var _0x81b2=function(_0x90ebf1,_0x77a7ee){_0x90ebf1=_0x90ebf1-0x0;var _0x4f20cd=_0x1b28[_0x90ebf1];return _0x4f20cd;};'use strict';var _=require('lodash');var moment=require(_0x81b2('0x0'));var util=require(_0x81b2('0x1'));var config=require(_0x81b2('0x2'));var ami=require(_0x81b2('0x3'));var RpcVoiceAgentReport=require(_0x81b2('0x4'));var RpcVoiceCallReport=require(_0x81b2('0x5'));var RpcVoiceDialReport=require(_0x81b2('0x6'));var RpcMemberReport=require(_0x81b2('0x7'));var RpcVoiceQueueReport=require(_0x81b2('0x8'));var RpcVoiceRecording=require(_0x81b2('0x9'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x81b2('0xa'));var VoiceCallReport=require(_0x81b2('0xb'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x81b2('0xc'));var UserReport=require(_0x81b2('0xd'));function Report(_0x391ce1){this[_0x81b2('0xe')]=_0x391ce1;this[_0x81b2('0xf')]=_0x391ce1[_0x81b2('0xf')];this[_0x81b2('0x10')]=_0x391ce1[_0x81b2('0x10')];}Report[_0x81b2('0x11')]['sync']=function(_0xd2e34){var _0x177c19=new VoiceQueueReport(this['realtime']);var _0x4b8807=new VoiceAgentReport(this[_0x81b2('0xe')]);var _0x923830=new VoiceDialReport(this['realtime']);var _0x24668e=new VoiceCallReport(this['realtime']);var _0x5ea6a9=new UserReport(this[_0x81b2('0xe')]);if(config[_0x81b2('0x12')]&&config[_0x81b2('0x12')]['disabled']){ami['on'](_0x81b2('0x13'),this[_0x81b2('0x14')]['bind'](this));ami['on'](_0x81b2('0x15'),this[_0x81b2('0x16')][_0x81b2('0x17')](this));ami['on'](_0x81b2('0x18'),this[_0x81b2('0x19')][_0x81b2('0x17')](this));ami['on']('custom:voiceDialReport',this[_0x81b2('0x1a')][_0x81b2('0x17')](this));ami['on'](_0x81b2('0x1b'),this[_0x81b2('0x1c')]['bind'](this));ami['on'](_0x81b2('0x1d'),this['attendedTransfer']['bind'](this));}};Report[_0x81b2('0x11')][_0x81b2('0x1e')]=function(_0x2c7b81){var _0x22f156;_0x22f156=_[_0x81b2('0x1f')](this[_0x81b2('0xf')],function(_0x41f87b){return _0x41f87b[_0x81b2('0x20')]==_0x2c7b81||_0x41f87b[_0x81b2('0x21')]==_0x2c7b81;});if(_[_0x81b2('0x22')](_0x22f156)){var _0x116164=_['find'](this['telephones'],function(_0x2826c9){return _0x2826c9[_0x81b2('0x20')]==_0x2c7b81||_0x2826c9[_0x81b2('0x21')]==_0x2c7b81;});if(_0x116164){_0x22f156=_[_0x81b2('0x1f')](this[_0x81b2('0xf')],function(_0x4b7b48){return _0x4b7b48['interface']==util[_0x81b2('0x23')](_0x81b2('0x24'),_0x116164[_0x81b2('0x21')]);});}}return _0x22f156;};Report[_0x81b2('0x11')][_0x81b2('0x14')]=function(_0x4459f7){for(var _0x61fbdf=0x0;_0x61fbdf<_0x4459f7['length'];_0x61fbdf+=0x1){var _0x316169=this[_0x81b2('0x1e')](_0x4459f7[_0x61fbdf][_0x81b2('0x25')]);if(_0x316169){_0x4459f7[_0x61fbdf][_0x81b2('0x20')]=_0x316169[_0x81b2('0x20')];_0x4459f7[_0x61fbdf][_0x81b2('0x26')]=!![];_0x4459f7[_0x61fbdf][_0x81b2('0x27')]=_0x316169[_0x81b2('0x21')];_0x4459f7[_0x61fbdf][_0x81b2('0x28')]=_['isNil'](_0x316169[_0x81b2('0x28')])?util['format'](_0x81b2('0x24'),_0x316169[_0x81b2('0x21')]):_0x316169[_0x81b2('0x28')];if(_0x4459f7[_0x61fbdf][_0x81b2('0x29')]){_0x4459f7[_0x61fbdf][_0x81b2('0x2a')]=moment()[_0x81b2('0x23')](_0x81b2('0x2b'));}if(_0x4459f7[_0x61fbdf]['queuecallerexit']){_0x4459f7[_0x61fbdf]['queuecallerexitAt']=moment()[_0x81b2('0x23')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport['voiceQueueReport'](_0x4459f7[_0x61fbdf]);}RpcVoiceQueueReport[_0x81b2('0x2c')](_0x4459f7[_0x61fbdf]);}};function extractCalleridNumber(_0x1cb906){var _0x14fb88=_0x1cb906[_0x81b2('0x2d')](/<(.*?)>/);return _0x14fb88?_0x14fb88[0x1]:_0x1cb906;}Report[_0x81b2('0x11')][_0x81b2('0x2e')]=function(_0xa1c1f3){for(var _0x3e1824=0x0;_0x3e1824<Object[_0x81b2('0x2f')](this[_0x81b2('0xf')])[_0x81b2('0x30')];_0x3e1824++){var _0x1012d8=Object['keys'](this[_0x81b2('0xf')])[_0x3e1824];var _0x3e346e=this[_0x81b2('0xf')][_0x1012d8];if(_0x3e346e[_0x81b2('0x20')]===Number(_0xa1c1f3))return _0x3e346e;}return null;};Report[_0x81b2('0x11')][_0x81b2('0x31')]=function(_0x2f419e){var _0x330d1b=_0x2f419e[_0x81b2('0x32')][_0x81b2('0x33')]('-')[0x0];var _0x4fd7e3=this[_0x81b2('0xf')][_0x330d1b];if(!_0x4fd7e3)_0x4fd7e3=this['getAgentByInternal'](_0x2f419e['calleridnum']);return!_0x4fd7e3?_0x81b2('0x34'):'internal';};Report['prototype'][_0x81b2('0x16')]=function(_0x2b08f3){_0x2b08f3[_0x81b2('0x35')]=_0x2b08f3['destination']||_0x2b08f3['exten'];if(_0x2b08f3['type']=='dialer'){_0x2b08f3[_0x81b2('0x36')]=_0x81b2('0x37');_0x2b08f3[_0x81b2('0x38')]=_0x2b08f3[_0x81b2('0x37')];if(_0x2b08f3['context']==_0x81b2('0x39')){_0x2b08f3[_0x81b2('0x20')]='';_0x2b08f3[_0x81b2('0x35')]=extractCalleridNumber(_0x2b08f3[_0x81b2('0x3a')]);}else if(_0x2b08f3['context']==_0x81b2('0x3b')){if(_0x2b08f3[_0x81b2('0x35')]==_0x81b2('0x3c')){_0x2b08f3[_0x81b2('0x35')]=extractCalleridNumber(_0x2b08f3[_0x81b2('0x3d')]);_0x2b08f3[_0x81b2('0x3e')]=_0x2b08f3[_0x81b2('0x3f')];_0x2b08f3[_0x81b2('0x40')]=[_0x2b08f3[_0x81b2('0x32')],_0x2b08f3['channel']=_0x2b08f3[_0x81b2('0x40')]][0x0];_0x2b08f3['callerid']=_0x2b08f3[_0x81b2('0x3d')];}else{_0x2b08f3[_0x81b2('0x35')]=_0x2b08f3['calleridnum'];_0x2b08f3[_0x81b2('0x3e')]=_0x2b08f3[_0x81b2('0x3f')];if(_0x2b08f3[_0x81b2('0x41')]==_0x81b2('0x42')){_0x2b08f3[_0x81b2('0x20')]=_0x2b08f3[_0x81b2('0x25')];}else{_0x2b08f3[_0x81b2('0x20')]='';}}}}else{_0x2b08f3[_0x81b2('0x3a')]=util[_0x81b2('0x23')](_0x81b2('0x43'),_0x2b08f3[_0x81b2('0x44')],_0x2b08f3[_0x81b2('0x3e')]);}if(RpcVoiceTransferReport['transfers'][_0x2b08f3[_0x81b2('0x45')]]){var _0x131794=RpcVoiceTransferReport[_0x81b2('0x46')][_0x2b08f3[_0x81b2('0x45')]];_0x131794[_0x81b2('0x47')]=_0x2b08f3[_0x81b2('0x48')];RpcVoiceTransferReport['blindTransfer'](_0x131794);delete RpcVoiceTransferReport['transfers'][_0x2b08f3[_0x81b2('0x45')]];}if(_[_0x81b2('0x22')](_0x2b08f3['type'])){_0x2b08f3[_0x81b2('0x49')]=this[_0x81b2('0x31')](_0x2b08f3);}if(_['isNil'](_0x2b08f3[_0x81b2('0x4a')])){var _0x1ece76=_0x2b08f3[_0x81b2('0x32')][_0x81b2('0x33')]('-')[0x0];var _0x190560=this[_0x81b2('0xf')][_0x1ece76];if(!_0x190560)_0x190560=this[_0x81b2('0x2e')](_0x2b08f3[_0x81b2('0x20')]);if(_0x190560){_0x2b08f3[_0x81b2('0x4a')]=_0x190560['id'];_0x2b08f3[_0x81b2('0x4b')]=_0x190560[_0x81b2('0x21')];}}RpcVoiceCallReport[_0x81b2('0x2c')](_0x2b08f3);if(_0x2b08f3[_0x81b2('0x4c')]){for(var _0x2a570b=0x0;_0x2a570b<_0x2b08f3[_0x81b2('0x4d')][_0x81b2('0x30')];_0x2a570b+=0x1){_0x2b08f3[_0x81b2('0x4e')]=_0x2b08f3[_0x81b2('0x4d')][_0x2a570b]['filename'];_0x2b08f3[_0x81b2('0x4f')]=_0x2b08f3['monitors'][_0x2a570b][_0x81b2('0x4f')];if(_0x2b08f3[_0x81b2('0x50')]==_0x81b2('0x3c')){_0x2b08f3[_0x81b2('0x3e')]=_0x2b08f3[_0x81b2('0x25')];_0x2b08f3[_0x81b2('0x44')]=_0x2b08f3[_0x81b2('0x51')];_0x2b08f3[_0x81b2('0x25')]=_0x2b08f3[_0x81b2('0x20')];_0x2b08f3[_0x81b2('0x51')]=_0x2b08f3[_0x81b2('0x4b')];_0x2b08f3['exten']=_0x2b08f3[_0x81b2('0x3f')];}else if(_0x2b08f3['exten']==_0x81b2('0x52')){_0x2b08f3[_0x81b2('0x3e')]=_0x2b08f3[_0x81b2('0x35')];_0x2b08f3[_0x81b2('0x50')]=_0x2b08f3[_0x81b2('0x3f')];}RpcVoiceRecording['create'](_0x2b08f3);}}};Report[_0x81b2('0x11')]['voiceAgentReport']=function(_0x4b6970){if(_[_0x81b2('0x53')](_0x4b6970)){_0x4b6970[_0x81b2('0x54')](function(_0x2b6b86){RpcVoiceAgentReport['create'](_0x2b6b86);});}else{RpcVoiceAgentReport[_0x81b2('0x2c')](_0x4b6970);}};Report['prototype'][_0x81b2('0x1a')]=function(_0x125f8f){RpcVoiceDialReport[_0x81b2('0x2c')](_0x125f8f);var _0x24fefa;var _0x1ac644;var _0x2b15c0=_0x125f8f[_0x81b2('0x32')];if(_[_0x81b2('0x55')](_0x2b15c0,_0x81b2('0x56'))){_0x1ac644=_0x2b15c0['substring'](_0x2b15c0['indexOf']('/')+0x1,_0x2b15c0[_0x81b2('0x57')]('@'));_0x24fefa=_[_0x81b2('0x1f')](this['agents'],function(_0x102400){return _0x102400[_0x81b2('0x58')]==_0x1ac644||_0x102400[_0x81b2('0x59')]==_0x1ac644||_0x102400['accountcode']==_0x1ac644;});}else{_0x1ac644=_0x2b15c0[_0x81b2('0x5a')](_0x2b15c0[_0x81b2('0x57')]('/')+0x1,_0x2b15c0[_0x81b2('0x5b')]('-'));_0x24fefa=this[_0x81b2('0x1e')](_0x1ac644);}if(_0x24fefa){_0x125f8f['interface']=_['isNil'](_0x24fefa[_0x81b2('0x28')])?util[_0x81b2('0x23')](_0x81b2('0x24'),_0x24fefa[_0x81b2('0x21')]):_0x24fefa[_0x81b2('0x28')];_0x125f8f[_0x81b2('0x4b')]=_0x24fefa[_0x81b2('0x21')];_0x125f8f[_0x81b2('0x20')]=_0x24fefa[_0x81b2('0x20')];RpcMemberReport[_0x81b2('0x1a')](_0x125f8f);}};Report[_0x81b2('0x11')][_0x81b2('0x1c')]=function(_0xd87e2a){RpcVoiceTransferReport[_0x81b2('0x46')][_0xd87e2a['transfererlinkedid']]=_0xd87e2a;};Report[_0x81b2('0x11')][_0x81b2('0x5c')]=function(_0xf1cf1b){RpcVoiceTransferReport[_0x81b2('0x5c')](_0xf1cf1b);};module[_0x81b2('0x5d')]=Report;
\ No newline at end of file
+var _0xad18=['isNil','interface','SIP/%s','voiceQueueReport','length','connectedlinenum','accountcode','lastAssignedTo','format','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','channel','split','calleridnum','internal','destination','exten','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','blindTransfer','getCallType','UserId','membername','monitor','monitorFilename','monitors','filename','createdAt','connectedlinename','voiceAgentReport','isArray','forEach','startsWith','Local','substring','indexOf','phone','lastIndexOf','voiceDialReport','transfererlinkedid','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','xdr','custom:voiceCallReport','voiceCallReport','bind','custom:voiceDialReport','blindtransfer','attendedTransfer','findAgent','find','name'];(function(_0x5ed089,_0x1bd8a3){var _0x28cbcd=function(_0x1befcb){while(--_0x1befcb){_0x5ed089['push'](_0x5ed089['shift']());}};_0x28cbcd(++_0x1bd8a3);}(_0xad18,0x150));var _0x8ad1=function(_0xc9cd47,_0x35a546){_0xc9cd47=_0xc9cd47-0x0;var _0x26827e=_0xad18[_0xc9cd47];return _0x26827e;};'use strict';var _=require(_0x8ad1('0x0'));var moment=require(_0x8ad1('0x1'));var util=require(_0x8ad1('0x2'));var config=require(_0x8ad1('0x3'));var ami=require(_0x8ad1('0x4'));var RpcVoiceAgentReport=require(_0x8ad1('0x5'));var RpcVoiceCallReport=require(_0x8ad1('0x6'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x8ad1('0x7'));var RpcVoiceQueueReport=require(_0x8ad1('0x8'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x8ad1('0x9'));var VoiceQueueReport=require(_0x8ad1('0xa'));var VoiceCallReport=require(_0x8ad1('0xb'));var VoiceAgentReport=require(_0x8ad1('0xc'));var VoiceDialReport=require(_0x8ad1('0xd'));var UserReport=require('./userReport');function Report(_0x39f51b){this[_0x8ad1('0xe')]=_0x39f51b;this[_0x8ad1('0xf')]=_0x39f51b[_0x8ad1('0xf')];this[_0x8ad1('0x10')]=_0x39f51b['telephones'];}Report[_0x8ad1('0x11')]['sync']=function(_0x439158){var _0x4e9d00=new VoiceQueueReport(this['realtime']);var _0x3fc1dd=new VoiceAgentReport(this[_0x8ad1('0xe')]);var _0x35a40b=new VoiceDialReport(this[_0x8ad1('0xe')]);var _0x175e2c=new VoiceCallReport(this[_0x8ad1('0xe')]);var _0x50d997=new UserReport(this['realtime']);if(config[_0x8ad1('0x12')]&&config[_0x8ad1('0x12')]['disabled']){ami['on']('custom:voiceQueueReport',this['voiceQueueReport']['bind'](this));ami['on'](_0x8ad1('0x13'),this[_0x8ad1('0x14')]['bind'](this));ami['on']('custom:voiceAgentReport',this['voiceAgentReport'][_0x8ad1('0x15')](this));ami['on'](_0x8ad1('0x16'),this['voiceDialReport'][_0x8ad1('0x15')](this));ami['on'](_0x8ad1('0x17'),this['blindTransfer'][_0x8ad1('0x15')](this));ami['on']('attendedtransfer',this[_0x8ad1('0x18')][_0x8ad1('0x15')](this));}};Report[_0x8ad1('0x11')][_0x8ad1('0x19')]=function(_0x5a1df9){var _0x1f740f;_0x1f740f=_[_0x8ad1('0x1a')](this[_0x8ad1('0xf')],function(_0x1f4efe){return _0x1f4efe['accountcode']==_0x5a1df9||_0x1f4efe[_0x8ad1('0x1b')]==_0x5a1df9;});if(_[_0x8ad1('0x1c')](_0x1f740f)){var _0x21f9e9=_[_0x8ad1('0x1a')](this['telephones'],function(_0x242d2a){return _0x242d2a['accountcode']==_0x5a1df9||_0x242d2a[_0x8ad1('0x1b')]==_0x5a1df9;});if(_0x21f9e9){_0x1f740f=_['find'](this['agents'],function(_0x3338a5){return _0x3338a5[_0x8ad1('0x1d')]==util['format'](_0x8ad1('0x1e'),_0x21f9e9[_0x8ad1('0x1b')]);});}}return _0x1f740f;};Report[_0x8ad1('0x11')][_0x8ad1('0x1f')]=function(_0x4b3d79){for(var _0x5c6bd1=0x0;_0x5c6bd1<_0x4b3d79[_0x8ad1('0x20')];_0x5c6bd1+=0x1){var _0x3fb75e=this['findAgent'](_0x4b3d79[_0x5c6bd1][_0x8ad1('0x21')]);if(_0x3fb75e){_0x4b3d79[_0x5c6bd1][_0x8ad1('0x22')]=_0x3fb75e[_0x8ad1('0x22')];_0x4b3d79[_0x5c6bd1]['assigned']=!![];_0x4b3d79[_0x5c6bd1][_0x8ad1('0x23')]=_0x3fb75e['name'];_0x4b3d79[_0x5c6bd1][_0x8ad1('0x1d')]=_['isNil'](_0x3fb75e[_0x8ad1('0x1d')])?util[_0x8ad1('0x24')](_0x8ad1('0x1e'),_0x3fb75e[_0x8ad1('0x1b')]):_0x3fb75e[_0x8ad1('0x1d')];if(_0x4b3d79[_0x5c6bd1][_0x8ad1('0x25')]){_0x4b3d79[_0x5c6bd1]['queuecallercompleteAt']=moment()[_0x8ad1('0x24')](_0x8ad1('0x26'));}if(_0x4b3d79[_0x5c6bd1][_0x8ad1('0x27')]){_0x4b3d79[_0x5c6bd1][_0x8ad1('0x28')]=moment()[_0x8ad1('0x24')](_0x8ad1('0x26'));}RpcMemberReport['voiceQueueReport'](_0x4b3d79[_0x5c6bd1]);}RpcVoiceQueueReport[_0x8ad1('0x29')](_0x4b3d79[_0x5c6bd1]);}};function extractCalleridNumber(_0x5a2280){var _0x570c2d=_0x5a2280[_0x8ad1('0x2a')](/<(.*?)>/);return _0x570c2d?_0x570c2d[0x1]:_0x5a2280;}Report['prototype'][_0x8ad1('0x2b')]=function(_0x163c4c){for(var _0x1dd1aa=0x0;_0x1dd1aa<Object[_0x8ad1('0x2c')](this[_0x8ad1('0xf')])[_0x8ad1('0x20')];_0x1dd1aa++){var _0xb2b316=Object[_0x8ad1('0x2c')](this[_0x8ad1('0xf')])[_0x1dd1aa];var _0x4ca175=this['agents'][_0xb2b316];if(_0x4ca175[_0x8ad1('0x22')]===Number(_0x163c4c))return _0x4ca175;}return null;};Report['prototype']['getCallType']=function(_0x452d53){var _0xbb3193=_0x452d53[_0x8ad1('0x2d')][_0x8ad1('0x2e')]('-')[0x0];var _0x24c17a=this[_0x8ad1('0xf')][_0xbb3193];if(!_0x24c17a)_0x24c17a=this[_0x8ad1('0x2b')](_0x452d53[_0x8ad1('0x2f')]);return!_0x24c17a?'outbound':_0x8ad1('0x30');};Report[_0x8ad1('0x11')]['voiceCallReport']=function(_0x53b308){_0x53b308['destination']=_0x53b308[_0x8ad1('0x31')]||_0x53b308[_0x8ad1('0x32')];if(_0x53b308['type']=='dialer'){_0x53b308[_0x8ad1('0x33')]=_0x8ad1('0x34');_0x53b308[_0x8ad1('0x35')]=_0x53b308[_0x8ad1('0x34')];if(_0x53b308[_0x8ad1('0x36')]==_0x8ad1('0x37')){_0x53b308[_0x8ad1('0x22')]='';_0x53b308[_0x8ad1('0x31')]=extractCalleridNumber(_0x53b308[_0x8ad1('0x38')]);}else if(_0x53b308['context']==_0x8ad1('0x39')){if(_0x53b308[_0x8ad1('0x31')]==_0x8ad1('0x3a')){_0x53b308[_0x8ad1('0x31')]=extractCalleridNumber(_0x53b308[_0x8ad1('0x3b')]);_0x53b308[_0x8ad1('0x2f')]=_0x53b308[_0x8ad1('0x3c')];_0x53b308[_0x8ad1('0x3d')]=[_0x53b308['channel'],_0x53b308[_0x8ad1('0x2d')]=_0x53b308[_0x8ad1('0x3d')]][0x0];_0x53b308['callerid']=_0x53b308[_0x8ad1('0x3b')];}else{_0x53b308[_0x8ad1('0x31')]=_0x53b308[_0x8ad1('0x2f')];_0x53b308[_0x8ad1('0x2f')]=_0x53b308[_0x8ad1('0x3c')];if(_0x53b308[_0x8ad1('0x3e')]==_0x8ad1('0x3f')){_0x53b308[_0x8ad1('0x22')]=_0x53b308[_0x8ad1('0x21')];}else{_0x53b308[_0x8ad1('0x22')]='';}}}}else{_0x53b308['callerid']=util['format'](_0x8ad1('0x40'),_0x53b308[_0x8ad1('0x41')],_0x53b308[_0x8ad1('0x2f')]);}if(RpcVoiceTransferReport[_0x8ad1('0x42')][_0x53b308[_0x8ad1('0x43')]]){var _0x332d06=RpcVoiceTransferReport['transfers'][_0x53b308[_0x8ad1('0x43')]];_0x332d06[_0x8ad1('0x44')]=_0x53b308[_0x8ad1('0x45')];RpcVoiceTransferReport[_0x8ad1('0x46')](_0x332d06);delete RpcVoiceTransferReport['transfers'][_0x53b308[_0x8ad1('0x43')]];}if(_[_0x8ad1('0x1c')](_0x53b308['type'])){_0x53b308['type']=this[_0x8ad1('0x47')](_0x53b308);}if(_[_0x8ad1('0x1c')](_0x53b308[_0x8ad1('0x48')])){var _0x1e2370=_0x53b308[_0x8ad1('0x2d')][_0x8ad1('0x2e')]('-')[0x0];var _0xa9b100=this[_0x8ad1('0xf')][_0x1e2370];if(!_0xa9b100)_0xa9b100=this[_0x8ad1('0x2b')](_0x53b308[_0x8ad1('0x22')]);if(_0xa9b100){_0x53b308[_0x8ad1('0x48')]=_0xa9b100['id'];_0x53b308[_0x8ad1('0x49')]=_0xa9b100['name'];}}RpcVoiceCallReport[_0x8ad1('0x29')](_0x53b308);if(_0x53b308[_0x8ad1('0x4a')]){for(var _0x38c722=0x0;_0x38c722<_0x53b308['monitors']['length'];_0x38c722+=0x1){_0x53b308[_0x8ad1('0x4b')]=_0x53b308[_0x8ad1('0x4c')][_0x38c722][_0x8ad1('0x4d')];_0x53b308[_0x8ad1('0x4e')]=_0x53b308[_0x8ad1('0x4c')][_0x38c722][_0x8ad1('0x4e')];if(_0x53b308[_0x8ad1('0x32')]==_0x8ad1('0x3a')){_0x53b308[_0x8ad1('0x2f')]=_0x53b308[_0x8ad1('0x21')];_0x53b308[_0x8ad1('0x41')]=_0x53b308[_0x8ad1('0x4f')];_0x53b308[_0x8ad1('0x21')]=_0x53b308[_0x8ad1('0x22')];_0x53b308[_0x8ad1('0x4f')]=_0x53b308['membername'];_0x53b308[_0x8ad1('0x32')]=_0x53b308[_0x8ad1('0x3c')];}else if(_0x53b308[_0x8ad1('0x32')]=='xcally-motion-dialer'){_0x53b308[_0x8ad1('0x2f')]=_0x53b308[_0x8ad1('0x31')];_0x53b308[_0x8ad1('0x32')]=_0x53b308[_0x8ad1('0x3c')];}RpcVoiceRecording[_0x8ad1('0x29')](_0x53b308);}}};Report[_0x8ad1('0x11')][_0x8ad1('0x50')]=function(_0x34f4eb){if(_[_0x8ad1('0x51')](_0x34f4eb)){_0x34f4eb[_0x8ad1('0x52')](function(_0x5ea7cf){RpcVoiceAgentReport[_0x8ad1('0x29')](_0x5ea7cf);});}else{RpcVoiceAgentReport[_0x8ad1('0x29')](_0x34f4eb);}};Report['prototype']['voiceDialReport']=function(_0x50ab95){RpcVoiceDialReport['create'](_0x50ab95);var _0x346f7d;var _0x413acf;var _0xd15a12=_0x50ab95[_0x8ad1('0x2d')];if(_[_0x8ad1('0x53')](_0xd15a12,_0x8ad1('0x54'))){_0x413acf=_0xd15a12[_0x8ad1('0x55')](_0xd15a12['indexOf']('/')+0x1,_0xd15a12[_0x8ad1('0x56')]('@'));_0x346f7d=_[_0x8ad1('0x1a')](this[_0x8ad1('0xf')],function(_0x30ee59){return _0x30ee59['mobile']==_0x413acf||_0x30ee59[_0x8ad1('0x57')]==_0x413acf||_0x30ee59[_0x8ad1('0x22')]==_0x413acf;});}else{_0x413acf=_0xd15a12['substring'](_0xd15a12[_0x8ad1('0x56')]('/')+0x1,_0xd15a12[_0x8ad1('0x58')]('-'));_0x346f7d=this[_0x8ad1('0x19')](_0x413acf);}if(_0x346f7d){_0x50ab95['interface']=_[_0x8ad1('0x1c')](_0x346f7d[_0x8ad1('0x1d')])?util[_0x8ad1('0x24')](_0x8ad1('0x1e'),_0x346f7d[_0x8ad1('0x1b')]):_0x346f7d[_0x8ad1('0x1d')];_0x50ab95[_0x8ad1('0x49')]=_0x346f7d[_0x8ad1('0x1b')];_0x50ab95[_0x8ad1('0x22')]=_0x346f7d[_0x8ad1('0x22')];RpcMemberReport[_0x8ad1('0x59')](_0x50ab95);}};Report[_0x8ad1('0x11')][_0x8ad1('0x46')]=function(_0x225740){RpcVoiceTransferReport[_0x8ad1('0x42')][_0x225740[_0x8ad1('0x5a')]]=_0x225740;};Report[_0x8ad1('0x11')][_0x8ad1('0x18')]=function(_0x5aa361){RpcVoiceTransferReport['attendedTransfer'](_0x5aa361);};module['exports']=Report;
\ No newline at end of file
index 338f044..38617b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb089=['bind','devicestatechange','syncDeviceState','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','actionDeviceStateList','[userReport][devicestatelist]','[userReport][sippeerstatus]','prototype','isNotNull','emit','info','state','debug','find','username','merge','omit','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','trunk:save','[userReport][registry]','[userReport][devicestatechange]\x20device:%s\x20state:%s','[userReport][devicestatechange]','device','local','toLowerCase','stateTime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','name','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','substring','indexOf','mobile','accountcode','updateStatusRealtime','peerstatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','[userReport][peerstatus]','status','address','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','trunks','agents','telephones','syncRegistry','registry'];(function(_0x5aca71,_0x322e2f){var _0x9f263d=function(_0x512463){while(--_0x512463){_0x5aca71['push'](_0x5aca71['shift']());}};_0x9f263d(++_0x322e2f);}(_0xb089,0xca));var _0x9b08=function(_0x458ab0,_0x43163a){_0x458ab0=_0x458ab0-0x0;var _0x52ec0e=_0xb089[_0x458ab0];return _0x52ec0e;};'use strict';var _=require(_0x9b08('0x0'));var moment=require('moment');var util=require('util');var Redis=require(_0x9b08('0x1'));var BPromise=require(_0x9b08('0x2'));var config=require(_0x9b08('0x3'));var logger=require(_0x9b08('0x4'))(_0x9b08('0x5'));var ami=require(_0x9b08('0x6'));config[_0x9b08('0x7')]=_[_0x9b08('0x8')](config[_0x9b08('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function UserReport(_0xac7727){this[_0x9b08('0x9')]=_0xac7727['trunks'];this[_0x9b08('0xa')]=_0xac7727['agents'];this[_0x9b08('0xb')]=_0xac7727[_0x9b08('0xb')];ami['on']('registryentry',this[_0x9b08('0xc')]['bind'](this));ami['on'](_0x9b08('0xd'),this[_0x9b08('0xc')][_0x9b08('0xe')](this));ami['on'](_0x9b08('0xf'),this[_0x9b08('0x10')][_0x9b08('0xe')](this));ami['on']('peerstatus',this[_0x9b08('0x11')][_0x9b08('0xe')](this));return this[_0x9b08('0x12')]();}function showSipRegistrations(){Promise[_0x9b08('0x13')]()[_0x9b08('0x14')](ami[_0x9b08('0x15')]())[_0x9b08('0x16')](function(_0x3da4ce){logger[_0x9b08('0x17')](_0x9b08('0x18'),util[_0x9b08('0x19')](_0x3da4ce,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0x9b08('0x14')](ami[_0x9b08('0x1a')]())[_0x9b08('0x16')](function(_0x81e27a){logger['error'](_0x9b08('0x1b'),util[_0x9b08('0x19')](_0x81e27a,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x9b08('0x13')]()['then'](ami['actionSipPeerStatus']())['catch'](function(_0x51d6d6){logger[_0x9b08('0x17')](_0x9b08('0x1c'),util[_0x9b08('0x19')](_0x51d6d6,{'showHidden':![],'depth':null}));});}UserReport[_0x9b08('0x1d')][_0x9b08('0x12')]=function(){setInterval(function(){BPromise[_0x9b08('0x13')]()[_0x9b08('0x14')](showSipRegistrations())['then'](listDeviceStates())[_0x9b08('0x14')](showPeersStatus());},0x32c8);};UserReport['prototype'][_0x9b08('0x1e')]=function(_0x4e575b){return _0x4e575b!==null&&!_['isUndefined'](_0x4e575b);};UserReport['prototype'][_0x9b08('0x1f')]=function(_0x493db6,_0x1a8268,_0x285a97){io['to'](_0x493db6)[_0x9b08('0x1f')](_0x1a8268,_0x285a97);};UserReport['prototype'][_0x9b08('0xc')]=function(_0x49a899){try{if(this['isNotNull'](_0x49a899)){logger[_0x9b08('0x20')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x49a899['username'],_0x49a899[_0x9b08('0x21')]);logger[_0x9b08('0x22')]('[userReport][registry]',util[_0x9b08('0x19')](_0x49a899,{'showHidden':![],'depth':null}));var _0x20f01f=_[_0x9b08('0x23')](this[_0x9b08('0x9')],{'defaultuser':_0x49a899[_0x9b08('0x24')]});if(_0x20f01f){_0x49a899['stateRegistry']=_0x49a899[_0x9b08('0x21')];_[_0x9b08('0x25')](_0x20f01f,_[_0x9b08('0x26')](_0x49a899,['event',_0x9b08('0x27'),_0x9b08('0x24'),_0x9b08('0x21')]));logger[_0x9b08('0x22')](_0x9b08('0x28'),util[_0x9b08('0x19')](_0x20f01f,{'showHidden':![],'depth':null}));this['emit'](util[_0x9b08('0x29')](_0x9b08('0x2a'),_0x20f01f['name']),_0x9b08('0x2b'),_0x20f01f);}}}catch(_0x2c321c){logger['error'](_0x9b08('0x2c'),util['inspect'](_0x2c321c,{'showHidden':![],'depth':null}));}};UserReport[_0x9b08('0x1d')]['syncDeviceState']=function(_0xa36600){try{if(this[_0x9b08('0x1e')](_0xa36600)){logger[_0x9b08('0x20')](_0x9b08('0x2d'),_0xa36600['device'],_0xa36600[_0x9b08('0x21')]);logger[_0x9b08('0x22')](_0x9b08('0x2e'),util['inspect'](_0xa36600,{'showHidden':![],'depth':null}));if(this[_0x9b08('0xa')][_0xa36600[_0x9b08('0x2f')]]){if(!this['agents'][_0xa36600[_0x9b08('0x2f')]][_0x9b08('0x30')]||_0xa36600['state'][_0x9b08('0x31')]()=='inuse'){this[_0x9b08('0xa')][_0xa36600[_0x9b08('0x2f')]][_0x9b08('0x30')]=![];if(this['agents'][_0xa36600[_0x9b08('0x2f')]][_0x9b08('0x21')]!==_0xa36600[_0x9b08('0x21')][_0x9b08('0x31')]()){this['agents'][_0xa36600[_0x9b08('0x2f')]][_0x9b08('0x32')]=_[_0x9b08('0x33')](moment()[_0x9b08('0x29')]('x'));}this[_0x9b08('0xa')][_0xa36600['device']][_0x9b08('0x21')]=_0xa36600[_0x9b08('0x21')][_0x9b08('0x31')]();this['agents'][_0xa36600[_0x9b08('0x2f')]]['updateStatusRealtime'](_0xa36600);}}else if(this['telephones'][_0xa36600[_0x9b08('0x2f')]]){if(this['telephones'][_0xa36600[_0x9b08('0x2f')]][_0x9b08('0x21')]!==_0xa36600[_0x9b08('0x21')][_0x9b08('0x31')]()){this['telephones'][_0xa36600[_0x9b08('0x2f')]]['stateTime']=_[_0x9b08('0x33')](moment()[_0x9b08('0x29')]('x'));}this[_0x9b08('0xb')][_0xa36600[_0x9b08('0x2f')]][_0x9b08('0x21')]=_0xa36600[_0x9b08('0x21')]['toLowerCase']();logger[_0x9b08('0x22')](_0x9b08('0x34'),util[_0x9b08('0x19')](this['telephones'][_0xa36600['device']],{'showHidden':![],'depth':null}));this['emit'](util[_0x9b08('0x29')](_0x9b08('0x35'),this[_0x9b08('0xb')][_0xa36600[_0x9b08('0x2f')]][_0x9b08('0x36')]),_0x9b08('0x37'),this[_0x9b08('0xb')][_0xa36600[_0x9b08('0x2f')]]);}else if(this['trunks'][_0xa36600['device']]){if(this[_0x9b08('0x9')][_0xa36600[_0x9b08('0x2f')]][_0x9b08('0x21')]!==_0xa36600[_0x9b08('0x21')][_0x9b08('0x31')]()){this[_0x9b08('0x9')][_0xa36600[_0x9b08('0x2f')]][_0x9b08('0x32')]=_[_0x9b08('0x33')](moment()[_0x9b08('0x29')]('x'));}this[_0x9b08('0x9')][_0xa36600[_0x9b08('0x2f')]][_0x9b08('0x21')]=_0xa36600[_0x9b08('0x21')]['toLowerCase']();logger[_0x9b08('0x22')](_0x9b08('0x38'),util[_0x9b08('0x19')](this['trunks'][_0xa36600[_0x9b08('0x2f')]],{'showHidden':![],'depth':null}));this[_0x9b08('0x1f')](util[_0x9b08('0x29')](_0x9b08('0x2a'),this[_0x9b08('0x9')][_0xa36600[_0x9b08('0x2f')]][_0x9b08('0x36')]),_0x9b08('0x2b'),this['trunks'][_0xa36600[_0x9b08('0x2f')]]);}else if(_[_0x9b08('0x39')](_0xa36600[_0x9b08('0x2f')],'Local')){var _0x4fb590=_0xa36600[_0x9b08('0x2f')];var _0x4ecec6=_0x4fb590[_0x9b08('0x3a')](_0x4fb590[_0x9b08('0x3b')]('/')+0x1,_0x4fb590[_0x9b08('0x3b')]('@'));var _0x94ee19=_[_0x9b08('0x23')](this['agents'],function(_0x387fe8){return _0x387fe8[_0x9b08('0x3c')]==_0x4ecec6||_0x387fe8['phone']==_0x4ecec6||_0x387fe8[_0x9b08('0x3d')]==_0x4ecec6;});if(_0x94ee19){if(_0x94ee19[_0x9b08('0x21')]!==_0xa36600[_0x9b08('0x21')]['toLowerCase']()){_0x94ee19[_0x9b08('0x32')]=_[_0x9b08('0x33')](moment()[_0x9b08('0x29')]('x'));}_0x94ee19[_0x9b08('0x21')]=_0xa36600[_0x9b08('0x21')][_0x9b08('0x31')]();_0x94ee19[_0x9b08('0x30')]=!![];_0x94ee19[_0x9b08('0x3e')](_0xa36600);}}}}catch(_0x258031){logger['error'](_0x9b08('0x2e'),util['inspect'](_0x258031,{'showHidden':![],'depth':null}));}};UserReport[_0x9b08('0x1d')][_0x9b08('0x11')]=function(_0x306d38){try{if(this[_0x9b08('0x1e')](_0x306d38)&&this[_0x9b08('0x1e')](_0x306d38[_0x9b08('0x3f')])){logger[_0x9b08('0x20')](_0x9b08('0x40'),_0x306d38[_0x9b08('0x41')],_0x306d38['address'],_0x306d38[_0x9b08('0x3f')]);logger[_0x9b08('0x22')](_0x9b08('0x42'),util[_0x9b08('0x19')](_0x306d38,{'showHidden':![],'depth':null}));if(this[_0x9b08('0xa')][_0x306d38['peer']]){if(!this['agents'][_0x306d38[_0x9b08('0x41')]][_0x9b08('0x30')]||_0x306d38[_0x9b08('0x3f')]['toLowerCase']()=='registered'){this[_0x9b08('0xa')][_0x306d38[_0x9b08('0x41')]]['local']=![];this['agents'][_0x306d38[_0x9b08('0x41')]][_0x9b08('0x43')]=_0x306d38[_0x9b08('0x3f')][_0x9b08('0x31')]();this[_0x9b08('0xa')][_0x306d38['peer']][_0x9b08('0x44')]=_0x306d38[_0x9b08('0x44')];this[_0x9b08('0xa')][_0x306d38[_0x9b08('0x41')]][_0x9b08('0x3e')](_0x306d38);}}else if(this[_0x9b08('0xb')][_0x306d38['peer']]){this[_0x9b08('0xb')][_0x306d38[_0x9b08('0x41')]][_0x9b08('0x43')]=_0x306d38[_0x9b08('0x3f')][_0x9b08('0x31')]();this[_0x9b08('0xb')][_0x306d38[_0x9b08('0x41')]][_0x9b08('0x44')]=_0x306d38['address'];logger[_0x9b08('0x22')](_0x9b08('0x45'),util['inspect'](this[_0x9b08('0xb')][_0x306d38[_0x9b08('0x41')]],{'showHidden':![],'depth':null}));this[_0x9b08('0x1f')](util['format'](_0x9b08('0x35'),this['telephones'][_0x306d38[_0x9b08('0x41')]][_0x9b08('0x36')]),_0x9b08('0x37'),this[_0x9b08('0xb')][_0x306d38[_0x9b08('0x41')]]);}else if(this['trunks'][_0x306d38[_0x9b08('0x41')]]){this[_0x9b08('0x9')][_0x306d38[_0x9b08('0x41')]][_0x9b08('0x43')]=_0x306d38[_0x9b08('0x3f')][_0x9b08('0x31')]();this['trunks'][_0x306d38[_0x9b08('0x41')]][_0x9b08('0x44')]=_0x306d38[_0x9b08('0x44')];logger[_0x9b08('0x22')](_0x9b08('0x46'),util[_0x9b08('0x19')](this[_0x9b08('0x9')][_0x306d38[_0x9b08('0x41')]],{'showHidden':![],'depth':null}));this[_0x9b08('0x1f')](util[_0x9b08('0x29')](_0x9b08('0x2a'),this['trunks'][_0x306d38[_0x9b08('0x41')]][_0x9b08('0x36')]),_0x9b08('0x2b'),this[_0x9b08('0x9')][_0x306d38['peer']]);}}}catch(_0xe3533c){logger[_0x9b08('0x17')]('[userReport][peerstatus]',util[_0x9b08('0x19')](_0xe3533c,{'showHidden':![],'depth':null}));}};module[_0x9b08('0x47')]=UserReport;
\ No newline at end of file
+var _0x825d=['substring','indexOf','mobile','accountcode','updateStatusRealtime','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:%s','trunk:save','exports','lodash','moment','util','ioredis','bluebird','../../../config/logger','../ami','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','syncDeviceState','peerstatus','syncPeerStatus','resolve','then','catch','error','[userReport][sipshowregistry]','inspect','actionDeviceStateList','actionSipPeerStatus','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','find','stateRegistry','merge','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','[userReport][registry]','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','stateTime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local'];(function(_0x1529a3,_0x529f63){var _0x1a0d4b=function(_0x6f1058){while(--_0x6f1058){_0x1529a3['push'](_0x1529a3['shift']());}};_0x1a0d4b(++_0x529f63);}(_0x825d,0xa0));var _0xd825=function(_0x304af1,_0x19b259){_0x304af1=_0x304af1-0x0;var _0x5865f4=_0x825d[_0x304af1];return _0x5865f4;};'use strict';var _=require(_0xd825('0x0'));var moment=require(_0xd825('0x1'));var util=require(_0xd825('0x2'));var Redis=require(_0xd825('0x3'));var BPromise=require(_0xd825('0x4'));var config=require('../../../config/environment');var logger=require(_0xd825('0x5'))('ami');var ami=require(_0xd825('0x6'));config[_0xd825('0x7')]=_['defaults'](config[_0xd825('0x7')],{'host':_0xd825('0x8'),'port':0x18eb});var io=require(_0xd825('0x9'))(new Redis(config[_0xd825('0x7')]));function UserReport(_0x2447ed){this[_0xd825('0xa')]=_0x2447ed[_0xd825('0xa')];this[_0xd825('0xb')]=_0x2447ed[_0xd825('0xb')];this['telephones']=_0x2447ed[_0xd825('0xc')];ami['on'](_0xd825('0xd'),this[_0xd825('0xe')][_0xd825('0xf')](this));ami['on'](_0xd825('0x10'),this[_0xd825('0xe')][_0xd825('0xf')](this));ami['on']('devicestatechange',this[_0xd825('0x11')][_0xd825('0xf')](this));ami['on'](_0xd825('0x12'),this[_0xd825('0x13')][_0xd825('0xf')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0xd825('0x14')]()[_0xd825('0x15')](ami['actionSipShowRegistry']())[_0xd825('0x16')](function(_0x203bca){logger[_0xd825('0x17')](_0xd825('0x18'),util[_0xd825('0x19')](_0x203bca,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xd825('0x14')]()[_0xd825('0x15')](ami[_0xd825('0x1a')]())[_0xd825('0x16')](function(_0x272bb4){logger['error']('[userReport][devicestatelist]',util['inspect'](_0x272bb4,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()[_0xd825('0x15')](ami[_0xd825('0x1b')]())[_0xd825('0x16')](function(_0x4f3828){logger['error']('[userReport][sippeerstatus]',util[_0xd825('0x19')](_0x4f3828,{'showHidden':![],'depth':null}));});}UserReport[_0xd825('0x1c')]['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0xd825('0x14')]()[_0xd825('0x15')](showSipRegistrations())[_0xd825('0x15')](listDeviceStates())[_0xd825('0x15')](showPeersStatus());},0x32c8);};UserReport[_0xd825('0x1c')][_0xd825('0x1d')]=function(_0x1818f6){return _0x1818f6!==null&&!_[_0xd825('0x1e')](_0x1818f6);};UserReport[_0xd825('0x1c')][_0xd825('0x1f')]=function(_0x48fc7a,_0x41f6bf,_0x57f82c){io['to'](_0x48fc7a)[_0xd825('0x1f')](_0x41f6bf,_0x57f82c);};UserReport[_0xd825('0x1c')][_0xd825('0xe')]=function(_0x4e20c7){try{if(this[_0xd825('0x1d')](_0x4e20c7)){logger[_0xd825('0x20')](_0xd825('0x21'),_0x4e20c7[_0xd825('0x22')],_0x4e20c7[_0xd825('0x23')]);logger[_0xd825('0x24')]('[userReport][registry]',util[_0xd825('0x19')](_0x4e20c7,{'showHidden':![],'depth':null}));var _0x48c470=_[_0xd825('0x25')](this[_0xd825('0xa')],{'defaultuser':_0x4e20c7[_0xd825('0x22')]});if(_0x48c470){_0x4e20c7[_0xd825('0x26')]=_0x4e20c7[_0xd825('0x23')];_[_0xd825('0x27')](_0x48c470,_['omit'](_0x4e20c7,[_0xd825('0x28'),_0xd825('0x29'),'username',_0xd825('0x23')]));logger[_0xd825('0x24')](_0xd825('0x2a'),util[_0xd825('0x19')](_0x48c470,{'showHidden':![],'depth':null}));this['emit'](util[_0xd825('0x2b')](_0xd825('0x2c'),_0x48c470[_0xd825('0x2d')]),'trunk:save',_0x48c470);}}}catch(_0x1b9be6){logger['error'](_0xd825('0x2e'),util[_0xd825('0x19')](_0x1b9be6,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncDeviceState']=function(_0x7b44dd){try{if(this['isNotNull'](_0x7b44dd)){logger[_0xd825('0x20')](_0xd825('0x2f'),_0x7b44dd[_0xd825('0x30')],_0x7b44dd['state']);logger['debug'](_0xd825('0x31'),util[_0xd825('0x19')](_0x7b44dd,{'showHidden':![],'depth':null}));if(this[_0xd825('0xb')][_0x7b44dd[_0xd825('0x30')]]){if(!this[_0xd825('0xb')][_0x7b44dd[_0xd825('0x30')]]['local']||_0x7b44dd[_0xd825('0x23')]['toLowerCase']()=='inuse'){this[_0xd825('0xb')][_0x7b44dd[_0xd825('0x30')]][_0xd825('0x32')]=![];if(this['agents'][_0x7b44dd[_0xd825('0x30')]][_0xd825('0x23')]!==_0x7b44dd[_0xd825('0x23')][_0xd825('0x33')]()){this[_0xd825('0xb')][_0x7b44dd[_0xd825('0x30')]][_0xd825('0x34')]=_[_0xd825('0x35')](moment()[_0xd825('0x2b')]('x'));}this['agents'][_0x7b44dd['device']][_0xd825('0x23')]=_0x7b44dd[_0xd825('0x23')]['toLowerCase']();this[_0xd825('0xb')][_0x7b44dd['device']]['updateStatusRealtime'](_0x7b44dd);}}else if(this['telephones'][_0x7b44dd['device']]){if(this[_0xd825('0xc')][_0x7b44dd[_0xd825('0x30')]][_0xd825('0x23')]!==_0x7b44dd[_0xd825('0x23')][_0xd825('0x33')]()){this['telephones'][_0x7b44dd[_0xd825('0x30')]][_0xd825('0x34')]=_[_0xd825('0x35')](moment()[_0xd825('0x2b')]('x'));}this[_0xd825('0xc')][_0x7b44dd[_0xd825('0x30')]][_0xd825('0x23')]=_0x7b44dd[_0xd825('0x23')][_0xd825('0x33')]();logger['debug'](_0xd825('0x36'),util[_0xd825('0x19')](this[_0xd825('0xc')][_0x7b44dd[_0xd825('0x30')]],{'showHidden':![],'depth':null}));this[_0xd825('0x1f')](util['format']('telephone:%s',this[_0xd825('0xc')][_0x7b44dd['device']]['name']),_0xd825('0x37'),this[_0xd825('0xc')][_0x7b44dd[_0xd825('0x30')]]);}else if(this[_0xd825('0xa')][_0x7b44dd[_0xd825('0x30')]]){if(this['trunks'][_0x7b44dd['device']][_0xd825('0x23')]!==_0x7b44dd[_0xd825('0x23')]['toLowerCase']()){this['trunks'][_0x7b44dd[_0xd825('0x30')]][_0xd825('0x34')]=_[_0xd825('0x35')](moment()[_0xd825('0x2b')]('x'));}this['trunks'][_0x7b44dd['device']][_0xd825('0x23')]=_0x7b44dd['state'][_0xd825('0x33')]();logger[_0xd825('0x24')](_0xd825('0x38'),util['inspect'](this[_0xd825('0xa')][_0x7b44dd['device']],{'showHidden':![],'depth':null}));this[_0xd825('0x1f')](util[_0xd825('0x2b')](_0xd825('0x2c'),this[_0xd825('0xa')][_0x7b44dd[_0xd825('0x30')]][_0xd825('0x2d')]),'trunk:save',this[_0xd825('0xa')][_0x7b44dd[_0xd825('0x30')]]);}else if(_[_0xd825('0x39')](_0x7b44dd[_0xd825('0x30')],_0xd825('0x3a'))){var _0x511b84=_0x7b44dd[_0xd825('0x30')];var _0x1728c4=_0x511b84[_0xd825('0x3b')](_0x511b84[_0xd825('0x3c')]('/')+0x1,_0x511b84[_0xd825('0x3c')]('@'));var _0x44b5e9=_[_0xd825('0x25')](this[_0xd825('0xb')],function(_0x278b78){return _0x278b78[_0xd825('0x3d')]==_0x1728c4||_0x278b78['phone']==_0x1728c4||_0x278b78[_0xd825('0x3e')]==_0x1728c4;});if(_0x44b5e9){if(_0x44b5e9[_0xd825('0x23')]!==_0x7b44dd[_0xd825('0x23')]['toLowerCase']()){_0x44b5e9[_0xd825('0x34')]=_[_0xd825('0x35')](moment()[_0xd825('0x2b')]('x'));}_0x44b5e9[_0xd825('0x23')]=_0x7b44dd['state'][_0xd825('0x33')]();_0x44b5e9[_0xd825('0x32')]=!![];_0x44b5e9[_0xd825('0x3f')](_0x7b44dd);}}}}catch(_0x4cb29c){logger['error']('[userReport][devicestatechange]',util[_0xd825('0x19')](_0x4cb29c,{'showHidden':![],'depth':null}));}};UserReport[_0xd825('0x1c')][_0xd825('0x13')]=function(_0xff0903){try{if(this[_0xd825('0x1d')](_0xff0903)&&this[_0xd825('0x1d')](_0xff0903[_0xd825('0x12')])){logger[_0xd825('0x20')](_0xd825('0x40'),_0xff0903[_0xd825('0x41')],_0xff0903[_0xd825('0x42')],_0xff0903[_0xd825('0x12')]);logger['debug']('[userReport][peerstatus]',util[_0xd825('0x19')](_0xff0903,{'showHidden':![],'depth':null}));if(this[_0xd825('0xb')][_0xff0903[_0xd825('0x41')]]){if(!this[_0xd825('0xb')][_0xff0903[_0xd825('0x41')]][_0xd825('0x32')]||_0xff0903[_0xd825('0x12')][_0xd825('0x33')]()==_0xd825('0x43')){this[_0xd825('0xb')][_0xff0903[_0xd825('0x41')]][_0xd825('0x32')]=![];this[_0xd825('0xb')][_0xff0903[_0xd825('0x41')]][_0xd825('0x44')]=_0xff0903['peerstatus'][_0xd825('0x33')]();this[_0xd825('0xb')][_0xff0903[_0xd825('0x41')]]['address']=_0xff0903['address'];this[_0xd825('0xb')][_0xff0903['peer']][_0xd825('0x3f')](_0xff0903);}}else if(this[_0xd825('0xc')][_0xff0903['peer']]){this[_0xd825('0xc')][_0xff0903['peer']]['status']=_0xff0903[_0xd825('0x12')][_0xd825('0x33')]();this[_0xd825('0xc')][_0xff0903['peer']][_0xd825('0x42')]=_0xff0903[_0xd825('0x42')];logger[_0xd825('0x24')](_0xd825('0x45'),util[_0xd825('0x19')](this[_0xd825('0xc')][_0xff0903[_0xd825('0x41')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xd825('0x46'),this[_0xd825('0xc')][_0xff0903[_0xd825('0x41')]][_0xd825('0x2d')]),_0xd825('0x37'),this[_0xd825('0xc')][_0xff0903[_0xd825('0x41')]]);}else if(this[_0xd825('0xa')][_0xff0903[_0xd825('0x41')]]){this[_0xd825('0xa')][_0xff0903['peer']]['status']=_0xff0903['peerstatus'][_0xd825('0x33')]();this[_0xd825('0xa')][_0xff0903['peer']][_0xd825('0x42')]=_0xff0903['address'];logger[_0xd825('0x24')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0xd825('0x19')](this[_0xd825('0xa')][_0xff0903['peer']],{'showHidden':![],'depth':null}));this['emit'](util[_0xd825('0x2b')](_0xd825('0x2c'),this['trunks'][_0xff0903[_0xd825('0x41')]][_0xd825('0x2d')]),_0xd825('0x47'),this[_0xd825('0xa')][_0xff0903[_0xd825('0x41')]]);}}}catch(_0x3b798d){logger[_0xd825('0x17')]('[userReport][peerstatus]',util[_0xd825('0x19')](_0x3b798d,{'showHidden':![],'depth':null}));}};module[_0xd825('0x48')]=UserReport;
\ No newline at end of file
index 7927600..0535fd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','type','inbound','voice','merge','omit','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connectedlinenum','destchannelstatedesc','holdtime','lastevent','connect','voiceChannels','routealias','interface','pick','queue','destconnectedlinenum','channel','name','accountcode','exten','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answered_elsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','agentringnoanswer','reason','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','user:agentringnoanswer','custom:agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','[%s][voiceAgentReport][agentcomplete]\x20event:','agentconnectAt','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','talktime','acw','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','destaccountcode','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind'];(function(_0x211030,_0x3ba490){var _0x28ebd2=function(_0x4c9648){while(--_0x4c9648){_0x211030['push'](_0x211030['shift']());}};_0x28ebd2(++_0x3ba490);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}var _0x16b1ca=this['agents'][_0x155cce['interface']];var _0x197ec0=this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]];var _0x526cf3=this[_0x0a9e('0x9')][_0x155cce['queue']];var _0x45a1e7=this['variables'][_0x155cce[_0x0a9e('0x26')]];if(_[_0x0a9e('0x1f')](_0x197ec0)){_0x197ec0={'agentcalledAt':moment()[_0x0a9e('0x27')](_0x0a9e('0x28')),'lastevent':_0x0a9e('0x29'),'mandatoryDisposition':_0x526cf3&&_0x526cf3[_0x0a9e('0x2a')]?_0x526cf3[_0x0a9e('0x2a')]:![],'type':_0x526cf3&&_0x526cf3[_0x0a9e('0x2b')]?_0x526cf3['type']:_0x0a9e('0x2c'),'variables':_0x45a1e7,'motionChannel':_0x0a9e('0x2d')};}_[_0x0a9e('0x2e')](_0x197ec0,_[_0x0a9e('0x2f')](_0x155cce,['event',_0x0a9e('0x30')]));logger[_0x0a9e('0x23')](_0x0a9e('0x31'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x197ec0,{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x32'),_0x197ec0);var _0x2e8759={'id':_0x16b1ca['id'],'calleridnum':_0x197ec0[_0x0a9e('0x33')],'queue':_0x197ec0['queue'],'variables':_0x197ec0[_0x0a9e('0xb')],'uniqueid':_0x155cce['uniqueid']};logger[_0x0a9e('0x23')](_0x0a9e('0x34'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2e8759,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util['format'](_0x0a9e('0x35'),_0x155cce[_0x0a9e('0x21')]),_0x0a9e('0x36'),_0x2e8759);}}catch(_0x2da5c0){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2da5c0,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x39')]=function(_0x5e7238){try{if(this[_0x0a9e('0x1e')](_0x5e7238)){if(this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]]){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20event:',_0x5e7238[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x5e7238,{'showHidden':![],'depth':null}));for(var _0x1fa90d in this[_0x0a9e('0x8')][_0x5e7238['uniqueid']]){if(this['channels'][_0x5e7238[_0x0a9e('0x26')]]['hasOwnProperty'](_0x1fa90d)){if(_0x5e7238[_0x0a9e('0x22')]===_0x1fa90d){logger[_0x0a9e('0x20')](_0x0a9e('0x3a'),_0x5e7238[_0x0a9e('0x26')],_0x5e7238['membername'],_0x5e7238[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]][_0x1fa90d]['agentconnectAt']=moment()[_0x0a9e('0x27')](_0x0a9e('0x28'));this[_0x0a9e('0x8')][_0x5e7238['uniqueid']][_0x1fa90d]['connectedlinename']=_0x5e7238[_0x0a9e('0x3b')];this[_0x0a9e('0x8')][_0x5e7238['uniqueid']][_0x1fa90d][_0x0a9e('0x3c')]=_0x5e7238[_0x0a9e('0x3c')];this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]][_0x1fa90d]['destchannelstate']=_0x5e7238['destchannelstate'];this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]][_0x1fa90d]['destchannelstatedesc']=_0x5e7238[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]][_0x1fa90d]['holdtime']=_0x5e7238[_0x0a9e('0x3e')];this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]][_0x1fa90d][_0x0a9e('0x3f')]=_0x0a9e('0x40');if(this[_0x0a9e('0x41')][this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]][_0x1fa90d][_0x0a9e('0x26')]]){var _0x3da2cd=this[_0x0a9e('0x41')][this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]][_0x1fa90d][_0x0a9e('0x26')]][_0x0a9e('0x42')];this['channels'][_0x5e7238['uniqueid']][_0x1fa90d][_0x0a9e('0x42')]=_0x3da2cd;_0x5e7238[_0x0a9e('0x42')]=_0x3da2cd;}_[_0x0a9e('0x2e')](this[_0x0a9e('0xa')][_0x5e7238[_0x0a9e('0x43')]],_[_0x0a9e('0x44')](_0x5e7238,[_0x0a9e('0x45'),_0x0a9e('0x46'),_0x0a9e('0x42')]));var _0x25c6e6=this[_0x0a9e('0xa')][_0x5e7238[_0x0a9e('0x47')]['split']('-')[0x0]];var _0x117c99={'id':_0x25c6e6['id'],'name':_0x25c6e6[_0x0a9e('0x48')],'agentconnected':!![],'destaccountcode':_0x25c6e6[_0x0a9e('0x49')],'destconnectedlinenum':this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]][_0x5e7238[_0x0a9e('0x22')]][_0x0a9e('0x4a')],'queue':this[_0x0a9e('0x8')][_0x5e7238['uniqueid']][_0x5e7238[_0x0a9e('0x22')]]['queue'],'routealias':this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]][_0x5e7238[_0x0a9e('0x22')]]['routealias'],'uniqueid':this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]][_0x5e7238[_0x0a9e('0x22')]][_0x0a9e('0x26')]};logger[_0x0a9e('0x23')](_0x0a9e('0x4b'),_0x5e7238[_0x0a9e('0x26')],util['inspect'](_0x117c99,{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x4c'),_0x117c99);logger[_0x0a9e('0x23')](_0x0a9e('0x4d'),_0x5e7238[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x117c99,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x27')](_0x0a9e('0x35'),_0x5e7238['membername']),_0x0a9e('0x4e'),_0x117c99);}else if(!this[_0x0a9e('0x8')][_0x5e7238['uniqueid']][_0x1fa90d]['agentringnoanswer']&&!this['channels'][_0x5e7238[_0x0a9e('0x26')]][_0x1fa90d][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x4f'),_0x5e7238[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]][_0x1fa90d][_0x0a9e('0x21')],_0x1fa90d);this['channels'][_0x5e7238['uniqueid']][_0x1fa90d]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]][_0x1fa90d][_0x0a9e('0x50')]=moment()['format'](_0x0a9e('0x28'));this[_0x0a9e('0x8')][_0x5e7238['uniqueid']][_0x1fa90d]['answeredelsewheredestinationuniqueid']=_0x5e7238[_0x0a9e('0x22')];this['channels'][_0x5e7238[_0x0a9e('0x26')]][_0x1fa90d]['answeredelsewheremembername']=_0x5e7238[_0x0a9e('0x21')];this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]][_0x1fa90d]['lastevent']=_0x0a9e('0x51');this[_0x0a9e('0x8')][_0x5e7238['uniqueid']][_0x1fa90d]['reason']=_0x0a9e('0x51');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x5e7238[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x5e7238['uniqueid']][_0x1fa90d],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentansweredelsewhere',this['channels'][_0x5e7238['uniqueid']][_0x1fa90d]);}}}}}}catch(_0x2da03c){logger['error'](_0x0a9e('0x52'),_0x5e7238[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2da03c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x53')]=function(_0x272738){try{if(this[_0x0a9e('0x1e')](_0x272738)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x272738[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x272738,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']]){logger[_0x0a9e('0x20')](_0x0a9e('0x54'),_0x272738['uniqueid'],_0x272738[_0x0a9e('0x21')],_0x272738['destuniqueid']);var _0x20c668=this['agents'][_0x272738['interface']];var _0x5674ee=this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738[_0x0a9e('0x22')]];_0x5674ee[_0x0a9e('0x55')]=!![];_0x5674ee[_0x0a9e('0x50')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x28'));_0x5674ee[_0x0a9e('0x3f')]='rejected';_0x5674ee[_0x0a9e('0x56')]='rejected';var _0xca4ade={'id':_0x20c668['id'],'name':_0x20c668[_0x0a9e('0x48')],'queue':_0x5674ee[_0x0a9e('0x45')],'uniqueid':_0x5674ee['uniqueid']};logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x272738[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xca4ade,{'showHidden':![],'depth':null}));this['emit'](util[_0x0a9e('0x27')](_0x0a9e('0x35'),_0x20c668['name']),_0x0a9e('0x58'),_0xca4ade);ami[_0x0a9e('0x1d')](_0x0a9e('0x59'),_0x5674ee);}}}catch(_0x409b29){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentringnoanswer]',_0x272738[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x409b29,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncQueueCallerAbandon']=function(_0x3528b7){try{if(this['isNotNull'](_0x3528b7)){logger['debug'](_0x0a9e('0x5a'),_0x3528b7[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3528b7,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x3528b7[_0x0a9e('0x26')]]){for(var _0xc8c264 in this[_0x0a9e('0x8')][_0x3528b7[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x3528b7[_0x0a9e('0x26')]][_0x0a9e('0x5b')](_0xc8c264)&&!this[_0x0a9e('0x8')][_0x3528b7[_0x0a9e('0x26')]][_0xc8c264][_0x0a9e('0x55')]&&!this[_0x0a9e('0x8')][_0x3528b7[_0x0a9e('0x26')]][_0xc8c264][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x3528b7[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x3528b7[_0x0a9e('0x26')]][_0xc8c264]['membername'],_0xc8c264);this[_0x0a9e('0x8')][_0x3528b7[_0x0a9e('0x26')]][_0xc8c264]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x3528b7[_0x0a9e('0x26')]][_0xc8c264][_0x0a9e('0x50')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x28'));this['channels'][_0x3528b7['uniqueid']][_0xc8c264]['lastevent']=_0x0a9e('0x5c');this[_0x0a9e('0x8')][_0x3528b7[_0x0a9e('0x26')]][_0xc8c264][_0x0a9e('0x56')]=_0x0a9e('0x5c');logger[_0x0a9e('0x23')](_0x0a9e('0x5d'),_0x3528b7[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x3528b7[_0x0a9e('0x26')]][_0xc8c264],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentqueuecallerabandon',this[_0x0a9e('0x8')][_0x3528b7['uniqueid']][_0xc8c264]);}}}}}catch(_0x4437ff){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][queuecallerabandon]',_0x3528b7[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4437ff,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x542ece){try{if(this[_0x0a9e('0x1e')](_0x542ece)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x542ece[_0x0a9e('0x26')],util['inspect'](_0x542ece,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x542ece[_0x0a9e('0x26')]]){for(var _0x2d5506 in this[_0x0a9e('0x8')][_0x542ece['uniqueid']]){if(this[_0x0a9e('0x8')][_0x542ece[_0x0a9e('0x26')]][_0x0a9e('0x5b')](_0x2d5506)){if(this[_0x0a9e('0x8')][_0x542ece[_0x0a9e('0x26')]][_0x2d5506][_0x0a9e('0x5f')]&&!this[_0x0a9e('0x8')][_0x542ece[_0x0a9e('0x26')]][_0x2d5506][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x60'),_0x542ece[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x542ece[_0x0a9e('0x26')]][_0x2d5506]['membername'],_0x2d5506);this[_0x0a9e('0x8')][_0x542ece[_0x0a9e('0x26')]][_0x2d5506][_0x0a9e('0x12')]=!![];this['channels'][_0x542ece[_0x0a9e('0x26')]][_0x2d5506][_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x28'));this['channels'][_0x542ece['uniqueid']][_0x2d5506][_0x0a9e('0x3f')]=_0x0a9e('0x62');this['channels'][_0x542ece[_0x0a9e('0x26')]][_0x2d5506]['reason']=_0x542ece[_0x0a9e('0x56')]==_0x0a9e('0x63')?'agent':_0x542ece[_0x0a9e('0x56')];this[_0x0a9e('0x8')][_0x542ece[_0x0a9e('0x26')]][_0x2d5506][_0x0a9e('0x64')]=_0x542ece[_0x0a9e('0x64')];if(this[_0x0a9e('0x9')][_0x542ece[_0x0a9e('0x45')]]&&this['voiceQueues'][_0x542ece[_0x0a9e('0x45')]][_0x0a9e('0x65')]){this[_0x0a9e('0x8')][_0x542ece[_0x0a9e('0x26')]][_0x2d5506]['acwtime']=this[_0x0a9e('0x9')][_0x542ece[_0x0a9e('0x45')]]['acwTimeout'];this[_0x0a9e('0x8')][_0x542ece['uniqueid']][_0x2d5506][_0x0a9e('0x66')]=!![];}this[_0x0a9e('0xa')][_0x542ece[_0x0a9e('0x43')]]=_[_0x0a9e('0x2f')](this['agents'][_0x542ece['interface']],[_0x0a9e('0x45'),_0x0a9e('0x46')]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x542ece[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x542ece['uniqueid']][_0x2d5506],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentcomplete',this['channels'][_0x542ece['uniqueid']][_0x2d5506]);logger[_0x0a9e('0x23')](_0x0a9e('0x67'),_0x542ece[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x542ece[_0x0a9e('0x43')]]['id'],'destaccountcode':_0x542ece['destaccountcode']},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util['format'](_0x0a9e('0x35'),_0x542ece[_0x0a9e('0x21')]),_0x0a9e('0x68'),{'id':this[_0x0a9e('0xa')][_0x542ece['interface']]['id'],'destaccountcode':Number(_0x542ece[_0x0a9e('0x69')])});}}}}}}catch(_0x32f761){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentcomplete]',_0x542ece[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x32f761,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x255e49){try{if(this[_0x0a9e('0x1e')](_0x255e49)){logger[_0x0a9e('0x23')](_0x0a9e('0x6a'),_0x255e49['uniqueid'],util[_0x0a9e('0x25')](_0x255e49,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6b')](_0x255e49['uniqueid'],_[_0x0a9e('0x6c')](_0x255e49[_0x0a9e('0x6d')])[0x0],_0x255e49[_0x0a9e('0x6e')]);if(this['channels'][_0x255e49[_0x0a9e('0x26')]]){for(var _0x52ec10 in this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x0a9e('0x5b')](_0x52ec10)){logger[_0x0a9e('0x20')](_0x0a9e('0x6f'),_0x255e49[_0x0a9e('0x26')],_0x52ec10,_['keys'](_0x255e49[_0x0a9e('0x6d')])[0x0],_0x255e49[_0x0a9e('0x6e')]);if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')])){this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]=this[_0x0a9e('0xb')][_0x255e49['uniqueid']];}}}}}catch(_0xc81b64){logger[_0x0a9e('0x37')](_0x0a9e('0x70'),_0x255e49[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xc81b64,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x6b')]=function(_0x1756c7,_0x5ce99d,_0x23b447){var _0x5e725e=[_0x0a9e('0x71'),_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),'rtpaudioqosloss',_0x0a9e('0x75'),'rtpaudioqosrtt',_0x0a9e('0x76'),_0x0a9e('0x77'),'sipuri',_0x0a9e('0x78'),_0x0a9e('0x79'),_0x0a9e('0x7a'),'memberdynamic','memberinterface',_0x0a9e('0x7b'),_0x0a9e('0x21'),_0x0a9e('0x7c'),_0x0a9e('0x7d')];if(!_[_0x0a9e('0x7e')](_0x5ce99d)&&!_[_0x0a9e('0x7f')](_0x5e725e,_0x5ce99d)){if(_[_0x0a9e('0x1f')](this[_0x0a9e('0xb')][_0x1756c7])){this[_0x0a9e('0xb')][_0x1756c7]={};}this['variables'][_0x1756c7][_0x5ce99d]=_0x23b447;}};VoiceAgentReport[_0x0a9e('0x1c')]['syncHangup']=function(_0x287324){try{if(this[_0x0a9e('0x1e')](_0x287324)){logger[_0x0a9e('0x23')](_0x0a9e('0x80'),_0x287324[_0x0a9e('0x26')],util['inspect'](_0x287324,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){for(var _0x2791c5 in this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){if(this['channels'][_0x287324['uniqueid']][_0x0a9e('0x5b')](_0x2791c5)){if(this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x56')]==_0x0a9e('0x63')&&this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x287324[_0x0a9e('0x26')],_0x2791c5);this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5]['agentcompleteAt']=moment()[_0x0a9e('0x27')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger['debug'](_0x0a9e('0x81'),_0x287324[_0x0a9e('0x26')],util['inspect'](_[_0x0a9e('0x82')](this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x83'),_['values'](this['channels'][_0x287324[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]];}if(this[_0x0a9e('0xb')][_0x287324[_0x0a9e('0x26')]]){delete this['variables'][_0x287324[_0x0a9e('0x26')]];}}}catch(_0xadce3d){logger['error'](_0x0a9e('0x84'),_0x287324[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xadce3d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x85')]=function(_0x23b39e){try{if(this[_0x0a9e('0x1e')](_0x23b39e)){logger[_0x0a9e('0x23')](_0x0a9e('0x86'),_0x23b39e[_0x0a9e('0x26')],util['inspect'](_0x23b39e,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x87')]]){for(var _0x2ada60 in this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x87')]]){if(this['channels'][_0x23b39e['transfereeuniqueid']][_0x0a9e('0x5b')](_0x2ada60)){if(_0x23b39e[_0x0a9e('0x88')]===_0x2ada60){logger[_0x0a9e('0x20')](_0x0a9e('0x89'),_0x23b39e[_0x0a9e('0x26')],this['channels'][_0x23b39e[_0x0a9e('0x87')]][_0x2ada60][_0x0a9e('0x21')],_0x2ada60);var _0x3450ae=moment();this['channels'][_0x23b39e[_0x0a9e('0x87')]][_0x2ada60]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x23b39e['transfereeuniqueid']][_0x2ada60][_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x28'));this['channels'][_0x23b39e[_0x0a9e('0x87')]][_0x2ada60]['lastevent']=_0x0a9e('0x62');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x87')]][_0x2ada60][_0x0a9e('0x56')]=_0x0a9e('0x63');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x87')]][_0x2ada60][_0x0a9e('0x64')]=_0x3450ae[_0x0a9e('0x8a')](this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x87')]][_0x2ada60][_0x0a9e('0x5f')],_0x0a9e('0x8b'));}}}}if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x8c')]]){var _0x248368=this['channels'][_0x23b39e['secondtransfereruniqueid']];this[_0x0a9e('0x8')][_0x23b39e['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x87')]];this['channels'][_0x23b39e[_0x0a9e('0x87')]]=_0x248368;}}}catch(_0xe2b083){logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x23b39e['uniqueid'],util[_0x0a9e('0x25')](_0xe2b083,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1b')]=function(_0x34a791){try{if(this['isNotNull'](_0x34a791)){logger[_0x0a9e('0x23')](_0x0a9e('0x8e'),_0x34a791[_0x0a9e('0x26')],util['inspect'](_0x34a791,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x87')]]){for(var _0x17b29d in this['channels'][_0x34a791[_0x0a9e('0x87')]]){if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x87')]][_0x0a9e('0x5b')](_0x17b29d)){if(_0x34a791[_0x0a9e('0x8f')]===_0x17b29d){logger['info'](_0x0a9e('0x90'),_0x34a791[_0x0a9e('0x26')],this['channels'][_0x34a791[_0x0a9e('0x87')]][_0x17b29d][_0x0a9e('0x21')],_0x17b29d);var _0x1f6f1c=moment();this['channels'][_0x34a791['transfereeuniqueid']][_0x17b29d]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x87')]][_0x17b29d]['agentcompleteAt']=_0x1f6f1c;this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x87')]][_0x17b29d][_0x0a9e('0x3f')]='complete';this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x87')]][_0x17b29d][_0x0a9e('0x56')]=_0x0a9e('0x63');this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x87')]][_0x17b29d][_0x0a9e('0x64')]=_0x1f6f1c[_0x0a9e('0x8a')](this[_0x0a9e('0x8')][_0x34a791['transfereeuniqueid']][_0x17b29d][_0x0a9e('0x5f')],'seconds');}}}}}}catch(_0x138cf5){logger[_0x0a9e('0x37')](_0x0a9e('0x91'),_0x34a791[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x138cf5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStart']=function(_0x1a0314){var _0x33da81='';try{if(this[_0x0a9e('0x1e')](_0x1a0314)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1a0314,{'showHidden':![],'depth':null}));if(_0x1a0314[_0x0a9e('0x47')]){_0x33da81=_0x1a0314[_0x0a9e('0x47')][_0x0a9e('0x92')](0x0,_0x1a0314[_0x0a9e('0x47')][_0x0a9e('0x93')]('-'));if(this[_0x0a9e('0xa')][_0x33da81]){logger[_0x0a9e('0x20')](_0x0a9e('0x94'),_0x1a0314['uniqueid'],_0x33da81);this[_0x0a9e('0xa')][_0x33da81][_0x0a9e('0x95')]=!![];}}}}catch(_0x2ff265){logger[_0x0a9e('0x37')](_0x0a9e('0x96'),_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2ff265,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStop']=function(_0x3b581c){var _0xd2391='';try{if(this[_0x0a9e('0x1e')](_0x3b581c)){logger['debug'](_0x0a9e('0x97'),_0x3b581c[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3b581c,{'showHidden':![],'depth':null}));if(_0x3b581c[_0x0a9e('0x47')]){_0xd2391=_0x3b581c[_0x0a9e('0x47')][_0x0a9e('0x92')](0x0,_0x3b581c[_0x0a9e('0x47')][_0x0a9e('0x93')]('-'));if(this[_0x0a9e('0xa')][_0xd2391]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x3b581c[_0x0a9e('0x26')],_0xd2391);this[_0x0a9e('0xa')][_0xd2391][_0x0a9e('0x95')]=![];}}}}catch(_0x3db98f){logger[_0x0a9e('0x37')](_0x0a9e('0x98'),_0x3b581c['uniqueid'],util[_0x0a9e('0x25')](_0x3db98f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport;
\ No newline at end of file
+var _0xa9e0=['agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','type','inbound','voice','merge','omit','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connectedlinenum','destchannelstatedesc','holdtime','lastevent','connect','voiceChannels','routealias','interface','pick','queue','destconnectedlinenum','channel','name','accountcode','exten','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answered_elsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','agentringnoanswer','reason','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','user:agentringnoanswer','custom:agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','[%s][voiceAgentReport][agentcomplete]\x20event:','agentconnectAt','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','talktime','acw','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','destaccountcode','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind'];(function(_0x1deeaf,_0x5a06b9){var _0x37c7b7=function(_0x3b33fc){while(--_0x3b33fc){_0x1deeaf['push'](_0x1deeaf['shift']());}};_0x37c7b7(++_0x5a06b9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}var _0x16b1ca=this['agents'][_0x155cce['interface']];var _0x197ec0=this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]];var _0x526cf3=this[_0x0a9e('0x9')][_0x155cce['queue']];var _0x45a1e7=this['variables'][_0x155cce[_0x0a9e('0x26')]];if(_[_0x0a9e('0x1f')](_0x197ec0)){_0x197ec0={'agentcalledAt':moment()[_0x0a9e('0x27')](_0x0a9e('0x28')),'lastevent':_0x0a9e('0x29'),'mandatoryDisposition':_0x526cf3&&_0x526cf3[_0x0a9e('0x2a')]?_0x526cf3[_0x0a9e('0x2a')]:![],'type':_0x526cf3&&_0x526cf3[_0x0a9e('0x2b')]?_0x526cf3['type']:_0x0a9e('0x2c'),'variables':_0x45a1e7,'motionChannel':_0x0a9e('0x2d')};}_[_0x0a9e('0x2e')](_0x197ec0,_[_0x0a9e('0x2f')](_0x155cce,['event',_0x0a9e('0x30')]));logger[_0x0a9e('0x23')](_0x0a9e('0x31'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x197ec0,{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x32'),_0x197ec0);var _0x2e8759={'id':_0x16b1ca['id'],'calleridnum':_0x197ec0[_0x0a9e('0x33')],'queue':_0x197ec0['queue'],'variables':_0x197ec0[_0x0a9e('0xb')],'uniqueid':_0x155cce['uniqueid']};logger[_0x0a9e('0x23')](_0x0a9e('0x34'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2e8759,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util['format'](_0x0a9e('0x35'),_0x155cce[_0x0a9e('0x21')]),_0x0a9e('0x36'),_0x2e8759);}}catch(_0x2da5c0){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2da5c0,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x39')]=function(_0x5e7238){try{if(this[_0x0a9e('0x1e')](_0x5e7238)){if(this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]]){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20event:',_0x5e7238[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x5e7238,{'showHidden':![],'depth':null}));for(var _0x1fa90d in this[_0x0a9e('0x8')][_0x5e7238['uniqueid']]){if(this['channels'][_0x5e7238[_0x0a9e('0x26')]]['hasOwnProperty'](_0x1fa90d)){if(_0x5e7238[_0x0a9e('0x22')]===_0x1fa90d){logger[_0x0a9e('0x20')](_0x0a9e('0x3a'),_0x5e7238[_0x0a9e('0x26')],_0x5e7238['membername'],_0x5e7238[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]][_0x1fa90d]['agentconnectAt']=moment()[_0x0a9e('0x27')](_0x0a9e('0x28'));this[_0x0a9e('0x8')][_0x5e7238['uniqueid']][_0x1fa90d]['connectedlinename']=_0x5e7238[_0x0a9e('0x3b')];this[_0x0a9e('0x8')][_0x5e7238['uniqueid']][_0x1fa90d][_0x0a9e('0x3c')]=_0x5e7238[_0x0a9e('0x3c')];this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]][_0x1fa90d]['destchannelstate']=_0x5e7238['destchannelstate'];this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]][_0x1fa90d]['destchannelstatedesc']=_0x5e7238[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]][_0x1fa90d]['holdtime']=_0x5e7238[_0x0a9e('0x3e')];this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]][_0x1fa90d][_0x0a9e('0x3f')]=_0x0a9e('0x40');if(this[_0x0a9e('0x41')][this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]][_0x1fa90d][_0x0a9e('0x26')]]){var _0x3da2cd=this[_0x0a9e('0x41')][this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]][_0x1fa90d][_0x0a9e('0x26')]][_0x0a9e('0x42')];this['channels'][_0x5e7238['uniqueid']][_0x1fa90d][_0x0a9e('0x42')]=_0x3da2cd;_0x5e7238[_0x0a9e('0x42')]=_0x3da2cd;}_[_0x0a9e('0x2e')](this[_0x0a9e('0xa')][_0x5e7238[_0x0a9e('0x43')]],_[_0x0a9e('0x44')](_0x5e7238,[_0x0a9e('0x45'),_0x0a9e('0x46'),_0x0a9e('0x42')]));var _0x25c6e6=this[_0x0a9e('0xa')][_0x5e7238[_0x0a9e('0x47')]['split']('-')[0x0]];var _0x117c99={'id':_0x25c6e6['id'],'name':_0x25c6e6[_0x0a9e('0x48')],'agentconnected':!![],'destaccountcode':_0x25c6e6[_0x0a9e('0x49')],'destconnectedlinenum':this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]][_0x5e7238[_0x0a9e('0x22')]][_0x0a9e('0x4a')],'queue':this[_0x0a9e('0x8')][_0x5e7238['uniqueid']][_0x5e7238[_0x0a9e('0x22')]]['queue'],'routealias':this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]][_0x5e7238[_0x0a9e('0x22')]]['routealias'],'uniqueid':this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]][_0x5e7238[_0x0a9e('0x22')]][_0x0a9e('0x26')]};logger[_0x0a9e('0x23')](_0x0a9e('0x4b'),_0x5e7238[_0x0a9e('0x26')],util['inspect'](_0x117c99,{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x4c'),_0x117c99);logger[_0x0a9e('0x23')](_0x0a9e('0x4d'),_0x5e7238[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x117c99,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x27')](_0x0a9e('0x35'),_0x5e7238['membername']),_0x0a9e('0x4e'),_0x117c99);}else if(!this[_0x0a9e('0x8')][_0x5e7238['uniqueid']][_0x1fa90d]['agentringnoanswer']&&!this['channels'][_0x5e7238[_0x0a9e('0x26')]][_0x1fa90d][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x4f'),_0x5e7238[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]][_0x1fa90d][_0x0a9e('0x21')],_0x1fa90d);this['channels'][_0x5e7238['uniqueid']][_0x1fa90d]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]][_0x1fa90d][_0x0a9e('0x50')]=moment()['format'](_0x0a9e('0x28'));this[_0x0a9e('0x8')][_0x5e7238['uniqueid']][_0x1fa90d]['answeredelsewheredestinationuniqueid']=_0x5e7238[_0x0a9e('0x22')];this['channels'][_0x5e7238[_0x0a9e('0x26')]][_0x1fa90d]['answeredelsewheremembername']=_0x5e7238[_0x0a9e('0x21')];this[_0x0a9e('0x8')][_0x5e7238[_0x0a9e('0x26')]][_0x1fa90d]['lastevent']=_0x0a9e('0x51');this[_0x0a9e('0x8')][_0x5e7238['uniqueid']][_0x1fa90d]['reason']=_0x0a9e('0x51');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x5e7238[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x5e7238['uniqueid']][_0x1fa90d],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentansweredelsewhere',this['channels'][_0x5e7238['uniqueid']][_0x1fa90d]);}}}}}}catch(_0x2da03c){logger['error'](_0x0a9e('0x52'),_0x5e7238[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2da03c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x53')]=function(_0x272738){try{if(this[_0x0a9e('0x1e')](_0x272738)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x272738[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x272738,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']]){logger[_0x0a9e('0x20')](_0x0a9e('0x54'),_0x272738['uniqueid'],_0x272738[_0x0a9e('0x21')],_0x272738['destuniqueid']);var _0x20c668=this['agents'][_0x272738['interface']];var _0x5674ee=this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738[_0x0a9e('0x22')]];_0x5674ee[_0x0a9e('0x55')]=!![];_0x5674ee[_0x0a9e('0x50')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x28'));_0x5674ee[_0x0a9e('0x3f')]='rejected';_0x5674ee[_0x0a9e('0x56')]='rejected';var _0xca4ade={'id':_0x20c668['id'],'name':_0x20c668[_0x0a9e('0x48')],'queue':_0x5674ee[_0x0a9e('0x45')],'uniqueid':_0x5674ee['uniqueid']};logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x272738[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xca4ade,{'showHidden':![],'depth':null}));this['emit'](util[_0x0a9e('0x27')](_0x0a9e('0x35'),_0x20c668['name']),_0x0a9e('0x58'),_0xca4ade);ami[_0x0a9e('0x1d')](_0x0a9e('0x59'),_0x5674ee);}}}catch(_0x409b29){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentringnoanswer]',_0x272738[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x409b29,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncQueueCallerAbandon']=function(_0x3528b7){try{if(this['isNotNull'](_0x3528b7)){logger['debug'](_0x0a9e('0x5a'),_0x3528b7[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3528b7,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x3528b7[_0x0a9e('0x26')]]){for(var _0xc8c264 in this[_0x0a9e('0x8')][_0x3528b7[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x3528b7[_0x0a9e('0x26')]][_0x0a9e('0x5b')](_0xc8c264)&&!this[_0x0a9e('0x8')][_0x3528b7[_0x0a9e('0x26')]][_0xc8c264][_0x0a9e('0x55')]&&!this[_0x0a9e('0x8')][_0x3528b7[_0x0a9e('0x26')]][_0xc8c264][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x3528b7[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x3528b7[_0x0a9e('0x26')]][_0xc8c264]['membername'],_0xc8c264);this[_0x0a9e('0x8')][_0x3528b7[_0x0a9e('0x26')]][_0xc8c264]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x3528b7[_0x0a9e('0x26')]][_0xc8c264][_0x0a9e('0x50')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x28'));this['channels'][_0x3528b7['uniqueid']][_0xc8c264]['lastevent']=_0x0a9e('0x5c');this[_0x0a9e('0x8')][_0x3528b7[_0x0a9e('0x26')]][_0xc8c264][_0x0a9e('0x56')]=_0x0a9e('0x5c');logger[_0x0a9e('0x23')](_0x0a9e('0x5d'),_0x3528b7[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x3528b7[_0x0a9e('0x26')]][_0xc8c264],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentqueuecallerabandon',this[_0x0a9e('0x8')][_0x3528b7['uniqueid']][_0xc8c264]);}}}}}catch(_0x4437ff){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][queuecallerabandon]',_0x3528b7[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4437ff,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x542ece){try{if(this[_0x0a9e('0x1e')](_0x542ece)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x542ece[_0x0a9e('0x26')],util['inspect'](_0x542ece,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x542ece[_0x0a9e('0x26')]]){for(var _0x2d5506 in this[_0x0a9e('0x8')][_0x542ece['uniqueid']]){if(this[_0x0a9e('0x8')][_0x542ece[_0x0a9e('0x26')]][_0x0a9e('0x5b')](_0x2d5506)){if(this[_0x0a9e('0x8')][_0x542ece[_0x0a9e('0x26')]][_0x2d5506][_0x0a9e('0x5f')]&&!this[_0x0a9e('0x8')][_0x542ece[_0x0a9e('0x26')]][_0x2d5506][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x60'),_0x542ece[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x542ece[_0x0a9e('0x26')]][_0x2d5506]['membername'],_0x2d5506);this[_0x0a9e('0x8')][_0x542ece[_0x0a9e('0x26')]][_0x2d5506][_0x0a9e('0x12')]=!![];this['channels'][_0x542ece[_0x0a9e('0x26')]][_0x2d5506][_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x28'));this['channels'][_0x542ece['uniqueid']][_0x2d5506][_0x0a9e('0x3f')]=_0x0a9e('0x62');this['channels'][_0x542ece[_0x0a9e('0x26')]][_0x2d5506]['reason']=_0x542ece[_0x0a9e('0x56')]==_0x0a9e('0x63')?'agent':_0x542ece[_0x0a9e('0x56')];this[_0x0a9e('0x8')][_0x542ece[_0x0a9e('0x26')]][_0x2d5506][_0x0a9e('0x64')]=_0x542ece[_0x0a9e('0x64')];if(this[_0x0a9e('0x9')][_0x542ece[_0x0a9e('0x45')]]&&this['voiceQueues'][_0x542ece[_0x0a9e('0x45')]][_0x0a9e('0x65')]){this[_0x0a9e('0x8')][_0x542ece[_0x0a9e('0x26')]][_0x2d5506]['acwtime']=this[_0x0a9e('0x9')][_0x542ece[_0x0a9e('0x45')]]['acwTimeout'];this[_0x0a9e('0x8')][_0x542ece['uniqueid']][_0x2d5506][_0x0a9e('0x66')]=!![];}this[_0x0a9e('0xa')][_0x542ece[_0x0a9e('0x43')]]=_[_0x0a9e('0x2f')](this['agents'][_0x542ece['interface']],[_0x0a9e('0x45'),_0x0a9e('0x46')]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x542ece[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x542ece['uniqueid']][_0x2d5506],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentcomplete',this['channels'][_0x542ece['uniqueid']][_0x2d5506]);logger[_0x0a9e('0x23')](_0x0a9e('0x67'),_0x542ece[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x542ece[_0x0a9e('0x43')]]['id'],'destaccountcode':_0x542ece['destaccountcode']},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util['format'](_0x0a9e('0x35'),_0x542ece[_0x0a9e('0x21')]),_0x0a9e('0x68'),{'id':this[_0x0a9e('0xa')][_0x542ece['interface']]['id'],'destaccountcode':Number(_0x542ece[_0x0a9e('0x69')])});}}}}}}catch(_0x32f761){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentcomplete]',_0x542ece[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x32f761,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x255e49){try{if(this[_0x0a9e('0x1e')](_0x255e49)){logger[_0x0a9e('0x23')](_0x0a9e('0x6a'),_0x255e49['uniqueid'],util[_0x0a9e('0x25')](_0x255e49,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6b')](_0x255e49['uniqueid'],_[_0x0a9e('0x6c')](_0x255e49[_0x0a9e('0x6d')])[0x0],_0x255e49[_0x0a9e('0x6e')]);if(this['channels'][_0x255e49[_0x0a9e('0x26')]]){for(var _0x52ec10 in this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x0a9e('0x5b')](_0x52ec10)){logger[_0x0a9e('0x20')](_0x0a9e('0x6f'),_0x255e49[_0x0a9e('0x26')],_0x52ec10,_['keys'](_0x255e49[_0x0a9e('0x6d')])[0x0],_0x255e49[_0x0a9e('0x6e')]);if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')])){this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]=this[_0x0a9e('0xb')][_0x255e49['uniqueid']];}}}}}catch(_0xc81b64){logger[_0x0a9e('0x37')](_0x0a9e('0x70'),_0x255e49[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xc81b64,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x6b')]=function(_0x1756c7,_0x5ce99d,_0x23b447){var _0x5e725e=[_0x0a9e('0x71'),_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),'rtpaudioqosloss',_0x0a9e('0x75'),'rtpaudioqosrtt',_0x0a9e('0x76'),_0x0a9e('0x77'),'sipuri',_0x0a9e('0x78'),_0x0a9e('0x79'),_0x0a9e('0x7a'),'memberdynamic','memberinterface',_0x0a9e('0x7b'),_0x0a9e('0x21'),_0x0a9e('0x7c'),_0x0a9e('0x7d')];if(!_[_0x0a9e('0x7e')](_0x5ce99d)&&!_[_0x0a9e('0x7f')](_0x5e725e,_0x5ce99d)){if(_[_0x0a9e('0x1f')](this[_0x0a9e('0xb')][_0x1756c7])){this[_0x0a9e('0xb')][_0x1756c7]={};}this['variables'][_0x1756c7][_0x5ce99d]=_0x23b447;}};VoiceAgentReport[_0x0a9e('0x1c')]['syncHangup']=function(_0x287324){try{if(this[_0x0a9e('0x1e')](_0x287324)){logger[_0x0a9e('0x23')](_0x0a9e('0x80'),_0x287324[_0x0a9e('0x26')],util['inspect'](_0x287324,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){for(var _0x2791c5 in this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){if(this['channels'][_0x287324['uniqueid']][_0x0a9e('0x5b')](_0x2791c5)){if(this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x56')]==_0x0a9e('0x63')&&this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x287324[_0x0a9e('0x26')],_0x2791c5);this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5]['agentcompleteAt']=moment()[_0x0a9e('0x27')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger['debug'](_0x0a9e('0x81'),_0x287324[_0x0a9e('0x26')],util['inspect'](_[_0x0a9e('0x82')](this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x83'),_['values'](this['channels'][_0x287324[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]];}if(this[_0x0a9e('0xb')][_0x287324[_0x0a9e('0x26')]]){delete this['variables'][_0x287324[_0x0a9e('0x26')]];}}}catch(_0xadce3d){logger['error'](_0x0a9e('0x84'),_0x287324[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xadce3d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x85')]=function(_0x23b39e){try{if(this[_0x0a9e('0x1e')](_0x23b39e)){logger[_0x0a9e('0x23')](_0x0a9e('0x86'),_0x23b39e[_0x0a9e('0x26')],util['inspect'](_0x23b39e,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x87')]]){for(var _0x2ada60 in this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x87')]]){if(this['channels'][_0x23b39e['transfereeuniqueid']][_0x0a9e('0x5b')](_0x2ada60)){if(_0x23b39e[_0x0a9e('0x88')]===_0x2ada60){logger[_0x0a9e('0x20')](_0x0a9e('0x89'),_0x23b39e[_0x0a9e('0x26')],this['channels'][_0x23b39e[_0x0a9e('0x87')]][_0x2ada60][_0x0a9e('0x21')],_0x2ada60);var _0x3450ae=moment();this['channels'][_0x23b39e[_0x0a9e('0x87')]][_0x2ada60]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x23b39e['transfereeuniqueid']][_0x2ada60][_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x28'));this['channels'][_0x23b39e[_0x0a9e('0x87')]][_0x2ada60]['lastevent']=_0x0a9e('0x62');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x87')]][_0x2ada60][_0x0a9e('0x56')]=_0x0a9e('0x63');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x87')]][_0x2ada60][_0x0a9e('0x64')]=_0x3450ae[_0x0a9e('0x8a')](this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x87')]][_0x2ada60][_0x0a9e('0x5f')],_0x0a9e('0x8b'));}}}}if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x8c')]]){var _0x248368=this['channels'][_0x23b39e['secondtransfereruniqueid']];this[_0x0a9e('0x8')][_0x23b39e['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x87')]];this['channels'][_0x23b39e[_0x0a9e('0x87')]]=_0x248368;}}}catch(_0xe2b083){logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x23b39e['uniqueid'],util[_0x0a9e('0x25')](_0xe2b083,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1b')]=function(_0x34a791){try{if(this['isNotNull'](_0x34a791)){logger[_0x0a9e('0x23')](_0x0a9e('0x8e'),_0x34a791[_0x0a9e('0x26')],util['inspect'](_0x34a791,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x87')]]){for(var _0x17b29d in this['channels'][_0x34a791[_0x0a9e('0x87')]]){if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x87')]][_0x0a9e('0x5b')](_0x17b29d)){if(_0x34a791[_0x0a9e('0x8f')]===_0x17b29d){logger['info'](_0x0a9e('0x90'),_0x34a791[_0x0a9e('0x26')],this['channels'][_0x34a791[_0x0a9e('0x87')]][_0x17b29d][_0x0a9e('0x21')],_0x17b29d);var _0x1f6f1c=moment();this['channels'][_0x34a791['transfereeuniqueid']][_0x17b29d]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x87')]][_0x17b29d]['agentcompleteAt']=_0x1f6f1c;this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x87')]][_0x17b29d][_0x0a9e('0x3f')]='complete';this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x87')]][_0x17b29d][_0x0a9e('0x56')]=_0x0a9e('0x63');this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x87')]][_0x17b29d][_0x0a9e('0x64')]=_0x1f6f1c[_0x0a9e('0x8a')](this[_0x0a9e('0x8')][_0x34a791['transfereeuniqueid']][_0x17b29d][_0x0a9e('0x5f')],'seconds');}}}}}}catch(_0x138cf5){logger[_0x0a9e('0x37')](_0x0a9e('0x91'),_0x34a791[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x138cf5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStart']=function(_0x1a0314){var _0x33da81='';try{if(this[_0x0a9e('0x1e')](_0x1a0314)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1a0314,{'showHidden':![],'depth':null}));if(_0x1a0314[_0x0a9e('0x47')]){_0x33da81=_0x1a0314[_0x0a9e('0x47')][_0x0a9e('0x92')](0x0,_0x1a0314[_0x0a9e('0x47')][_0x0a9e('0x93')]('-'));if(this[_0x0a9e('0xa')][_0x33da81]){logger[_0x0a9e('0x20')](_0x0a9e('0x94'),_0x1a0314['uniqueid'],_0x33da81);this[_0x0a9e('0xa')][_0x33da81][_0x0a9e('0x95')]=!![];}}}}catch(_0x2ff265){logger[_0x0a9e('0x37')](_0x0a9e('0x96'),_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2ff265,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStop']=function(_0x3b581c){var _0xd2391='';try{if(this[_0x0a9e('0x1e')](_0x3b581c)){logger['debug'](_0x0a9e('0x97'),_0x3b581c[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3b581c,{'showHidden':![],'depth':null}));if(_0x3b581c[_0x0a9e('0x47')]){_0xd2391=_0x3b581c[_0x0a9e('0x47')][_0x0a9e('0x92')](0x0,_0x3b581c[_0x0a9e('0x47')][_0x0a9e('0x93')]('-'));if(this[_0x0a9e('0xa')][_0xd2391]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x3b581c[_0x0a9e('0x26')],_0xd2391);this[_0x0a9e('0xa')][_0xd2391][_0x0a9e('0x95')]=![];}}}}catch(_0x3db98f){logger[_0x0a9e('0x37')](_0x0a9e('0x98'),_0x3b581c['uniqueid'],util[_0x0a9e('0x25')](_0x3db98f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport;
\ No newline at end of file
index f795436..83dd889 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfead=['appdata','startsWith','CDR(routeAlias)','isUndefined','duration','subtract','seconds','lastdata','cdr(','match','type','isNil','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','channelstate','answered','answertime','holdtime','calleridnum','connectedlinename','UserId','membername','routealias','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','monitorFilename','find','monitors','push','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','callerid','[%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','calleridpreview','xmcs-queue','sipcallid','sipcalluniqueid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','[%s][voiceCallReport][hangup]\x20event:','destinationchannel','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','diff','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','length','transferType','then','undefined','getSettings','stopRecordingOnTransfer','Action','catch','StopMixMonitor','finally','webbar:stopmonitors','event','BlindTransfer','outbound','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','ATTENDED','origtransfererlinkedid','some','routeid','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][musiconholdstart]\x20event:','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','set','queue','dial','playback','voicemail','NO\x20ANSWER','FAILED','redis','defaults','localhost','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newchannel','newstate','syncNewState','varset','hangup','syncHangup','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','info','actionCoreShowChannels','error','prototype','emit','syncNewCallerId','isNotNull','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','debug','[%s][voiceCallReport][newcallerid]\x20event:','inspect','merge','pick','from-sip','split','exten','xcally-motion-preview','channel','destconnectedlinenum','connectedlinenum','format','user:%s','name','user:agentconnect','[%s][voiceCallReport][newcallerid]','syncNewChannel','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','linkedid','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','keys','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata'];(function(_0x283228,_0x4ca45f){var _0x1f3baf=function(_0xdf128f){while(--_0xdf128f){_0x283228['push'](_0x283228['shift']());}};_0x1f3baf(++_0x4ca45f);}(_0xfead,0x72));var _0xdfea=function(_0x16d67c,_0x32238d){_0x16d67c=_0x16d67c-0x0;var _0x20f460=_0xfead[_0x16d67c];return _0x20f460;};'use strict';var _=require(_0xdfea('0x0'));var moment=require(_0xdfea('0x1'));var util=require(_0xdfea('0x2'));var path=require(_0xdfea('0x3'));var Redis=require(_0xdfea('0x4'));var config=require(_0xdfea('0x5'));var logger=require(_0xdfea('0x6'))(_0xdfea('0x7'));var ami=require(_0xdfea('0x8'));var Channel=require(_0xdfea('0x9'));var RpcSetting=require(_0xdfea('0xa'));var applications=[_0xdfea('0xb'),_0xdfea('0xc'),'agi',_0xdfea('0xd'),_0xdfea('0xe'),_0xdfea('0xf')];var dispositions=[_0xdfea('0x10'),_0xdfea('0x11'),_0xdfea('0x11'),_0xdfea('0x10'),_0xdfea('0x10'),'NO\x20ANSWER','ANSWERED','BUSY',_0xdfea('0x11'),_0xdfea('0x11'),_0xdfea('0x11')];config[_0xdfea('0x12')]=_[_0xdfea('0x13')](config[_0xdfea('0x12')],{'host':_0xdfea('0x14'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdfea('0x12')]));function VoiceCallReport(_0x282e9a){this[_0xdfea('0x15')]=_0x282e9a['channels'];this[_0xdfea('0x16')]=_0x282e9a[_0xdfea('0x16')];this[_0xdfea('0x17')]={};ami['on'](_0xdfea('0x18'),this[_0xdfea('0x19')][_0xdfea('0x1a')](this));ami['on']('newexten',this[_0xdfea('0x19')]['bind'](this));ami['on'](_0xdfea('0x1b'),this['syncNewChannel'][_0xdfea('0x1a')](this));ami['on'](_0xdfea('0x1c'),this[_0xdfea('0x1d')][_0xdfea('0x1a')](this));ami['on'](_0xdfea('0x1e'),this['syncVarSet']['bind'](this));ami['on'](_0xdfea('0x1f'),this[_0xdfea('0x20')][_0xdfea('0x1a')](this));ami['on']('newcallerid',this['syncNewCallerId'][_0xdfea('0x1a')](this));ami['on'](_0xdfea('0x21'),this[_0xdfea('0x22')][_0xdfea('0x1a')](this));ami['on']('blindtransfer',this[_0xdfea('0x23')][_0xdfea('0x1a')](this));ami['on'](_0xdfea('0x24'),this['syncMusicOnHoldStart'][_0xdfea('0x1a')](this));ami['on'](_0xdfea('0x25'),this[_0xdfea('0x26')]['bind'](this));try{logger[_0xdfea('0x27')]('[voiceCallReport][coreshowchannels]\x20started');ami[_0xdfea('0x28')]();}catch(_0xe7fd1b){logger[_0xdfea('0x29')]('[voiceCallReport][coreshowchannels]',util['inspect'](_0xe7fd1b,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xdfea('0x2a')]['isNotNull']=function(_0x4b2fe7){return _0x4b2fe7!==null&&!_['isUndefined'](_0x4b2fe7);};VoiceCallReport[_0xdfea('0x2a')][_0xdfea('0x2b')]=function(_0x56a547,_0x16165e,_0x5038d6){io['to'](_0x56a547)[_0xdfea('0x2b')](_0x16165e,_0x5038d6);};VoiceCallReport[_0xdfea('0x2a')][_0xdfea('0x2c')]=function(_0x5ecf0f){try{if(this[_0xdfea('0x2d')](_0x5ecf0f)){logger[_0xdfea('0x27')](_0xdfea('0x2e'),_0x5ecf0f[_0xdfea('0x2f')],_0x5ecf0f[_0xdfea('0x30')],_0x5ecf0f['calleridnum']);logger[_0xdfea('0x31')](_0xdfea('0x32'),_0x5ecf0f[_0xdfea('0x2f')],util[_0xdfea('0x33')](_0x5ecf0f,{'showHidden':![],'depth':null}));if(_0x5ecf0f[_0xdfea('0x2f')]===_0x5ecf0f['linkedid']){if(!_['isUndefined'](this[_0xdfea('0x15')][_0x5ecf0f[_0xdfea('0x2f')]])){_[_0xdfea('0x34')](this[_0xdfea('0x15')][_0x5ecf0f[_0xdfea('0x2f')]],_[_0xdfea('0x35')](_0x5ecf0f,_['keys'](this[_0xdfea('0x15')][_0x5ecf0f[_0xdfea('0x2f')]])));}}if(_0x5ecf0f['context']===_0xdfea('0x36')){if(this['agents'][_0x5ecf0f['channel'][_0xdfea('0x37')]('-')[0x0]]){if(_0x5ecf0f[_0xdfea('0x38')]==_0xdfea('0x39')){this[_0xdfea('0x16')][_0x5ecf0f[_0xdfea('0x3a')][_0xdfea('0x37')]('-')[0x0]][_0xdfea('0x3b')]=_0x5ecf0f[_0xdfea('0x3c')];this['emit'](util[_0xdfea('0x3d')](_0xdfea('0x3e'),this[_0xdfea('0x16')][_0x5ecf0f[_0xdfea('0x3a')]['split']('-')[0x0]][_0xdfea('0x3f')]),_0xdfea('0x40'),{'destaccountcode':this[_0xdfea('0x16')][_0x5ecf0f[_0xdfea('0x3a')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x5ecf0f['connectedlinenum']});}}}}}catch(_0x246cf9){logger[_0xdfea('0x29')](_0xdfea('0x41'),_0x5ecf0f[_0xdfea('0x2f')],util[_0xdfea('0x33')](_0x246cf9,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xdfea('0x42')]=function(_0x1d1207){try{if(this['isNotNull'](_0x1d1207)){logger['debug'](_0xdfea('0x43'),_0x1d1207[_0xdfea('0x2f')],util[_0xdfea('0x33')](_0x1d1207,{'showHidden':![],'depth':null}));if(this[_0xdfea('0x15')][_0x1d1207[_0xdfea('0x2f')]]){return;}if(_0x1d1207[_0xdfea('0x3a')]===_0xdfea('0x44')){return;}if(_0x1d1207[_0xdfea('0x2f')]!==_0x1d1207[_0xdfea('0x45')]&&!this[_0xdfea('0x17')][_0x1d1207[_0xdfea('0x45')]]){return;}logger[_0xdfea('0x27')](_0xdfea('0x46'),_0x1d1207[_0xdfea('0x2f')],_0x1d1207[_0xdfea('0x47')],_0x1d1207[_0xdfea('0x38')]);this['channels'][_0x1d1207[_0xdfea('0x2f')]]=new Channel();this['channels'][_0x1d1207[_0xdfea('0x2f')]][_0xdfea('0x48')]=moment()[_0xdfea('0x3d')](_0xdfea('0x49'));this[_0xdfea('0x15')][_0x1d1207[_0xdfea('0x2f')]][_0xdfea('0x4a')]=dispositions[_[_0xdfea('0x4b')](_0x1d1207['channelstate'])];_[_0xdfea('0x34')](this[_0xdfea('0x15')][_0x1d1207[_0xdfea('0x2f')]],_['pick'](_0x1d1207,_[_0xdfea('0x4c')](this[_0xdfea('0x15')][_0x1d1207[_0xdfea('0x2f')]])));if(_0x1d1207[_0xdfea('0x47')]==='from-sip'){var _0x5ca3d3=this['agents'][_0x1d1207[_0xdfea('0x3a')][_0xdfea('0x37')]('-')[0x0]];if(_0x5ca3d3&&typeof _0x5ca3d3[_0xdfea('0x3b')]==='undefined'){_0x5ca3d3['destconnectedlinenum']=_0x1d1207[_0xdfea('0x38')];logger['debug'](_0xdfea('0x4d'),_0x1d1207['uniqueid'],util[_0xdfea('0x33')]({'id':_0x5ca3d3['id'],'destaccountcode':_0x5ca3d3[_0xdfea('0x4e')],'destconnectedlinenum':_0x1d1207[_0xdfea('0x38')]},{'showHidden':![],'depth':null}));this[_0xdfea('0x2b')](util[_0xdfea('0x3d')](_0xdfea('0x3e'),_0x5ca3d3[_0xdfea('0x3f')]),_0xdfea('0x40'),{'id':_0x5ca3d3['id'],'destaccountcode':_0x5ca3d3[_0xdfea('0x4e')],'destconnectedlinenum':_0x1d1207[_0xdfea('0x38')]});}}}}catch(_0x1cd46c){logger[_0xdfea('0x29')]('[%s][voiceCallReport][newchannel]',_0x1d1207[_0xdfea('0x2f')],util[_0xdfea('0x33')](_0x1cd46c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xdfea('0x2a')][_0xdfea('0x19')]=function(_0x4930dc){try{if(this[_0xdfea('0x2d')](_0x4930dc)){logger[_0xdfea('0x31')](_0xdfea('0x4f'),_0x4930dc[_0xdfea('0x2f')],util[_0xdfea('0x33')](_0x4930dc,{'showHidden':![],'depth':null}));if(_0x4930dc[_0xdfea('0x3a')]===_0xdfea('0x44')||_0x4930dc[_0xdfea('0x38')]==='h')return;if(_0x4930dc[_0xdfea('0x2f')]===_0x4930dc['linkedid']||this[_0xdfea('0x17')][_0x4930dc[_0xdfea('0x45')]]){_0x4930dc[_0xdfea('0x50')]=_0x4930dc[_0xdfea('0x50')][_0xdfea('0x51')]();_0x4930dc[_0xdfea('0x52')]=_0x4930dc[_0xdfea('0x53')]||_0x4930dc[_0xdfea('0x52')];if(_0x4930dc[_0xdfea('0x53')]&&!_0x4930dc[_0xdfea('0x53')][_0xdfea('0x54')](_0xdfea('0x55'))&&_0x4930dc['application']!==_0xdfea('0xc')){_0x4930dc['applicationdata']=_0x4930dc[_0xdfea('0x52')]['toLowerCase']();}logger[_0xdfea('0x27')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x4930dc[_0xdfea('0x2f')],_0x4930dc[_0xdfea('0x50')],_0x4930dc['applicationdata']);if(_[_0xdfea('0x56')](this[_0xdfea('0x15')][_0x4930dc[_0xdfea('0x2f')]])){this[_0xdfea('0x15')][_0x4930dc[_0xdfea('0x2f')]]=new Channel();this[_0xdfea('0x15')][_0x4930dc['uniqueid']][_0xdfea('0x48')]=_0x4930dc[_0xdfea('0x57')]?moment()[_0xdfea('0x58')](moment[_0xdfea('0x57')](_0x4930dc[_0xdfea('0x57')])[_0xdfea('0x59')](),_0xdfea('0x59'))[_0xdfea('0x3d')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0xdfea('0x3d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xdfea('0x15')][_0x4930dc['uniqueid']][_0xdfea('0x4a')]=_0xdfea('0x10');}_[_0xdfea('0x34')](this['channels'][_0x4930dc[_0xdfea('0x2f')]],_[_0xdfea('0x35')](_0x4930dc,_[_0xdfea('0x4c')](this[_0xdfea('0x15')][_0x4930dc[_0xdfea('0x2f')]])));if(_['includes'](applications,_0x4930dc[_0xdfea('0x50')])){this[_0xdfea('0x15')][_0x4930dc[_0xdfea('0x2f')]]['lastapplication']=_0x4930dc[_0xdfea('0x50')];this[_0xdfea('0x15')][_0x4930dc[_0xdfea('0x2f')]][_0xdfea('0x5a')]=_0x4930dc[_0xdfea('0x52')];if(_0x4930dc[_0xdfea('0x50')]===_0xdfea('0xb')&&_['startsWith'](_0x4930dc[_0xdfea('0x52')]['toLowerCase'](),_0xdfea('0x5b'))){var _0x42b136=_0x4930dc['applicationdata']['split']('=');var _0x320d86=_0x42b136[0x0][_0xdfea('0x51')]()[_0xdfea('0x5c')](/cdr\((.*)\)/);if(_0x320d86){if(_0x320d86[0x1]===_0xdfea('0x5d')&&!_[_0xdfea('0x5e')](this[_0xdfea('0x15')][_0x4930dc[_0xdfea('0x2f')]][_0x320d86[0x1]]))return;this[_0xdfea('0x15')][_0x4930dc[_0xdfea('0x2f')]][_0x320d86[0x1]]=_0x42b136[0x1];}}else if(_0x4930dc[_0xdfea('0x50')]==='queue'){this[_0xdfea('0x15')][_0x4930dc['uniqueid']][_0xdfea('0xc')]=_0x4930dc[_0xdfea('0x52')][_0xdfea('0x37')](',')[0x0];}}}}}catch(_0x54824e){logger[_0xdfea('0x29')](_0xdfea('0x5f'),_0x4930dc[_0xdfea('0x2f')],util['inspect'](_0x54824e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xdfea('0x2a')][_0xdfea('0x1d')]=function(_0x4764a4){try{if(this['isNotNull'](_0x4764a4)){logger['info'](_0xdfea('0x60'),_0x4764a4[_0xdfea('0x2f')],_0x4764a4[_0xdfea('0x45')],_0x4764a4[_0xdfea('0x30')],_0x4764a4['calleridnum']);logger[_0xdfea('0x31')](_0xdfea('0x61'),_0x4764a4[_0xdfea('0x2f')],util[_0xdfea('0x33')](_0x4764a4,{'showHidden':![],'depth':null}));if(_0x4764a4[_0xdfea('0x62')]!=='6')return;var _0xc17fd6=this['agents'][_0x4764a4['channel'][_0xdfea('0x37')]('-')[0x0]];if(_0x4764a4[_0xdfea('0x2f')]!==_0x4764a4[_0xdfea('0x45')]){var _0x24f907=moment();if(this['channels'][_0x4764a4[_0xdfea('0x45')]]){if(!this[_0xdfea('0x15')][_0x4764a4[_0xdfea('0x45')]]['answered']){this[_0xdfea('0x15')][_0x4764a4['linkedid']][_0xdfea('0x63')]=!![];this[_0xdfea('0x15')][_0x4764a4['linkedid']][_0xdfea('0x64')]=_0x24f907[_0xdfea('0x3d')](_0xdfea('0x49'));if(this[_0xdfea('0x15')][_0x4764a4[_0xdfea('0x45')]][_0xdfea('0x48')]){this[_0xdfea('0x15')][_0x4764a4[_0xdfea('0x45')]][_0xdfea('0x65')]=_0x24f907['diff'](this[_0xdfea('0x15')][_0x4764a4[_0xdfea('0x45')]][_0xdfea('0x48')],_0xdfea('0x59'));}}this[_0xdfea('0x15')][_0x4764a4['linkedid']][_0xdfea('0x45')]=_0x4764a4[_0xdfea('0x2f')];if(_0x4764a4[_0xdfea('0x66')]!==_0xdfea('0x39')){this['channels'][_0x4764a4[_0xdfea('0x45')]][_0xdfea('0x3c')]=_0x4764a4['calleridnum'];}this[_0xdfea('0x15')][_0x4764a4[_0xdfea('0x45')]][_0xdfea('0x67')]=_0x4764a4[_0xdfea('0x30')];this['channels'][_0x4764a4[_0xdfea('0x45')]]['destinationchannel']=_0x4764a4[_0xdfea('0x3a')];this['channels'][_0x4764a4[_0xdfea('0x45')]]['disposition']=dispositions[_[_0xdfea('0x4b')](_0x4764a4[_0xdfea('0x62')])];if(_0xc17fd6){this[_0xdfea('0x15')][_0x4764a4['linkedid']][_0xdfea('0x68')]=_0xc17fd6['id'];this['channels'][_0x4764a4[_0xdfea('0x45')]][_0xdfea('0x69')]=_0xc17fd6[_0xdfea('0x3f')];}}if(this['channels'][_0x4764a4[_0xdfea('0x2f')]]){if(!this[_0xdfea('0x15')][_0x4764a4[_0xdfea('0x2f')]][_0xdfea('0x63')]){this[_0xdfea('0x15')][_0x4764a4[_0xdfea('0x2f')]]['answered']=!![];this[_0xdfea('0x15')][_0x4764a4[_0xdfea('0x2f')]][_0xdfea('0x64')]=_0x24f907[_0xdfea('0x3d')](_0xdfea('0x49'));if(this[_0xdfea('0x15')][_0x4764a4[_0xdfea('0x2f')]][_0xdfea('0x48')]){this[_0xdfea('0x15')][_0x4764a4[_0xdfea('0x2f')]]['holdtime']=_0x24f907['diff'](this[_0xdfea('0x15')][_0x4764a4['uniqueid']]['starttime'],_0xdfea('0x59'));}}if(_0x4764a4[_0xdfea('0x66')]!=='xcally-motion-preview'){this['channels'][_0x4764a4[_0xdfea('0x2f')]][_0xdfea('0x3c')]=_0x4764a4[_0xdfea('0x66')];}this[_0xdfea('0x15')][_0x4764a4[_0xdfea('0x2f')]][_0xdfea('0x67')]=_0x4764a4[_0xdfea('0x30')];this['channels'][_0x4764a4[_0xdfea('0x2f')]]['destinationchannel']=_0x4764a4[_0xdfea('0x3a')];this[_0xdfea('0x15')][_0x4764a4['uniqueid']]['disposition']=dispositions[_[_0xdfea('0x4b')](_0x4764a4[_0xdfea('0x62')])];}}else{if(this['channels'][_0x4764a4[_0xdfea('0x2f')]]){if(_0xc17fd6){this[_0xdfea('0x15')][_0x4764a4[_0xdfea('0x2f')]][_0xdfea('0x68')]=_0xc17fd6['id'];this['channels'][_0x4764a4[_0xdfea('0x2f')]][_0xdfea('0x69')]=_0xc17fd6[_0xdfea('0x3f')];}}}if(_0x4764a4[_0xdfea('0x47')]===_0xdfea('0x36')){if(_0xc17fd6){_0xc17fd6[_0xdfea('0x3b')]=_0x4764a4[_0xdfea('0x38')];var _0x3dd528,_0x4be6ed;if(this[_0xdfea('0x15')][_0x4764a4[_0xdfea('0x2f')]]){_0x3dd528=this['channels'][_0x4764a4[_0xdfea('0x2f')]][_0xdfea('0x6a')];_0x4be6ed=this[_0xdfea('0x15')][_0x4764a4[_0xdfea('0x2f')]][_0xdfea('0xc')];}else if(this[_0xdfea('0x15')][_0x4764a4['linkedid']]){_0x3dd528=this['channels'][_0x4764a4[_0xdfea('0x45')]][_0xdfea('0x6a')];_0x4be6ed=this['channels'][_0x4764a4[_0xdfea('0x45')]]['queue'];}_0xc17fd6[_0xdfea('0xc')]=_0x4be6ed;_0xc17fd6[_0xdfea('0x6a')]=_0x3dd528;var _0x132575={'id':_0xc17fd6['id'],'name':_0xc17fd6[_0xdfea('0x3f')],'agentconnected':!![],'destaccountcode':_0xc17fd6[_0xdfea('0x4e')],'destconnectedlinenum':_0x4764a4[_0xdfea('0x38')],'queue':_0x4be6ed||undefined,'routealias':_0x3dd528,'uniqueid':_0x4764a4[_0xdfea('0x45')]};logger[_0xdfea('0x31')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x4764a4[_0xdfea('0x2f')],util['inspect'](_0x132575,{'showHidden':![],'depth':null}));this[_0xdfea('0x2b')](util[_0xdfea('0x3d')](_0xdfea('0x3e'),_0xc17fd6['name']),'user:agentconnect',_0x132575);}}}}catch(_0x3e47b9){logger[_0xdfea('0x29')](_0xdfea('0x6b'),_0x4764a4[_0xdfea('0x2f')],util['inspect'](_0x3e47b9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xdfea('0x2a')][_0xdfea('0x6c')]=function(_0x2d8dcc,_0x22a224){try{if(this['channels'][_0x2d8dcc]){logger['info'](_0xdfea('0x6d'),_0x2d8dcc,_0x22a224);this[_0xdfea('0x15')][_0x2d8dcc][_0xdfea('0x6e')]=!![];if(_[_0xdfea('0x6f')](_0x22a224,_0xdfea('0x70'))){_0x22a224=_0x22a224[_0xdfea('0x71')](_0xdfea('0x70'),'.WAV');}this['channels'][_0x2d8dcc][_0xdfea('0x72')]=_0x22a224;var _0x5165cb=_[_0xdfea('0x73')](this[_0xdfea('0x15')][_0x2d8dcc][_0xdfea('0x74')],{'filename':_0x22a224});if(_[_0xdfea('0x5e')](_0x5165cb)){this['channels'][_0x2d8dcc][_0xdfea('0x74')][_0xdfea('0x75')]({'filename':_0x22a224,'createdAt':moment()['format'](_0xdfea('0x49')),'mixmonitorid':'','status':'rec'});}}}catch(_0x41c0af){logger[_0xdfea('0x29')]('[%s][voiceCallReport][mixMonitorFilename]',_0x2d8dcc,util[_0xdfea('0x33')](_0x41c0af,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xdfea('0x76')]=function(_0x288ab4){try{if(this[_0xdfea('0x2d')](_0x288ab4)){logger[_0xdfea('0x31')](_0xdfea('0x77'),_0x288ab4[_0xdfea('0x2f')],util[_0xdfea('0x33')](_0x288ab4,{'showHidden':![],'depth':null}));if(this['channels'][_0x288ab4['uniqueid']]&&_0x288ab4[_0xdfea('0x3a')]!='OutgoingSpoolFailed'){if(this[_0xdfea('0x2d')](_0x288ab4[_0xdfea('0x78')])){if(this[_0xdfea('0x2d')](_0x288ab4['variable'][_0xdfea('0x79')])){logger[_0xdfea('0x27')](_0xdfea('0x7a'),_0x288ab4[_0xdfea('0x2f')],_0x288ab4[_0xdfea('0x7b')]);this[_0xdfea('0x6c')](_0x288ab4[_0xdfea('0x2f')],_0x288ab4[_0xdfea('0x7b')]);}else if(this[_0xdfea('0x2d')](_0x288ab4[_0xdfea('0x78')]['xmd-phone'])){logger[_0xdfea('0x27')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x288ab4[_0xdfea('0x2f')],_0x288ab4['value']);this['channels'][_0x288ab4['uniqueid']][_0xdfea('0x66')]=_0x288ab4[_0xdfea('0x7b')];}else if(this['isNotNull'](_0x288ab4['variable'][_0xdfea('0x7c')])){logger[_0xdfea('0x27')](_0xdfea('0x7d'),_0x288ab4[_0xdfea('0x2f')],_0x288ab4['value']);this['channels'][_0x288ab4['uniqueid']][_0xdfea('0x7e')]=_0x288ab4[_0xdfea('0x7b')];}else if(this[_0xdfea('0x2d')](_0x288ab4[_0xdfea('0x78')]['xmd-cdrtype'])){logger[_0xdfea('0x27')](_0xdfea('0x7f'),_0x288ab4[_0xdfea('0x2f')],_0x288ab4[_0xdfea('0x7b')]);this['channels'][_0x288ab4[_0xdfea('0x2f')]][_0xdfea('0x5d')]=_0x288ab4[_0xdfea('0x7b')];}else if(this[_0xdfea('0x2d')](_0x288ab4[_0xdfea('0x78')][_0xdfea('0x80')])){logger[_0xdfea('0x27')](_0xdfea('0x81'),_0x288ab4[_0xdfea('0x2f')],_0x288ab4['value'][_0xdfea('0x37')](',')[0x0]);this[_0xdfea('0x15')][_0x288ab4['uniqueid']][_0xdfea('0xc')]=_0x288ab4['value'][_0xdfea('0x37')](',')[0x0];}else if(this[_0xdfea('0x2d')](_0x288ab4[_0xdfea('0x78')][_0xdfea('0x82')])){logger[_0xdfea('0x27')](_0xdfea('0x83'),_0x288ab4[_0xdfea('0x2f')],_0x288ab4['value']);this[_0xdfea('0x15')][_0x288ab4['uniqueid']][_0xdfea('0x84')]=_0x288ab4[_0xdfea('0x7b')];}else if(this[_0xdfea('0x2d')](_0x288ab4[_0xdfea('0x78')][_0xdfea('0x85')])){logger[_0xdfea('0x27')](_0xdfea('0x86'),_0x288ab4['uniqueid'],_0x288ab4[_0xdfea('0x7b')]);this[_0xdfea('0x15')][_0x288ab4['uniqueid']][_0xdfea('0x87')]=_0x288ab4['value'];}else if(this[_0xdfea('0x2d')](_0x288ab4[_0xdfea('0x78')][_0xdfea('0x88')])){logger[_0xdfea('0x27')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x288ab4[_0xdfea('0x2f')],_0x288ab4[_0xdfea('0x7b')]);this[_0xdfea('0x15')][_0x288ab4[_0xdfea('0x2f')]][_0xdfea('0x89')]=_0x288ab4[_0xdfea('0x7b')];}else if(this['isNotNull'](_0x288ab4[_0xdfea('0x78')][_0xdfea('0x8a')])){logger[_0xdfea('0x27')]('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x288ab4[_0xdfea('0x2f')],_0x288ab4[_0xdfea('0x7b')]);this['channels'][_0x288ab4[_0xdfea('0x2f')]][_0xdfea('0xc')]=_0x288ab4[_0xdfea('0x7b')];}else if(this['isNotNull'](_0x288ab4[_0xdfea('0x78')][_0xdfea('0x8b')])){logger[_0xdfea('0x27')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x288ab4['uniqueid'],_0x288ab4[_0xdfea('0x7b')]);this[_0xdfea('0x15')][_0x288ab4[_0xdfea('0x2f')]][_0xdfea('0x8c')]=_0x288ab4['value'];}}}else if(this[_0xdfea('0x2d')](_0x288ab4['variable'][_0xdfea('0x79')])){if(_0x288ab4[_0xdfea('0x7b')]){var _0x3f9bb2=path['parse'](_0x288ab4['value'])['name'];logger[_0xdfea('0x27')](_0xdfea('0x7a'),_0x3f9bb2,_0x288ab4[_0xdfea('0x7b')]);this[_0xdfea('0x6c')](_0x3f9bb2,_0x288ab4[_0xdfea('0x7b')]);}}else if(this[_0xdfea('0x15')][_0x288ab4['linkedid']]){if(this[_0xdfea('0x2d')](_0x288ab4[_0xdfea('0x78')])){if(this[_0xdfea('0x2d')](_0x288ab4['variable']['sipcallid'])){logger[_0xdfea('0x27')](_0xdfea('0x8d'),_0x288ab4[_0xdfea('0x45')],_0x288ab4[_0xdfea('0x7b')]);this[_0xdfea('0x15')][_0x288ab4[_0xdfea('0x45')]]['sipcalllinkedid']=_0x288ab4['value'];}}}}}catch(_0x1256b6){logger[_0xdfea('0x29')]('[%s][voiceCallReport][varset]',_0x288ab4[_0xdfea('0x2f')],util[_0xdfea('0x33')](_0x1256b6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xdfea('0x2a')]['syncHangup']=function(_0x12d259){try{if(this[_0xdfea('0x2d')](_0x12d259)){logger[_0xdfea('0x31')](_0xdfea('0x8e'),_0x12d259[_0xdfea('0x2f')],util[_0xdfea('0x33')](_0x12d259,{'showHidden':![],'depth':null}));if(this['blindTransfers'][_0x12d259[_0xdfea('0x45')]]){if(this[_0xdfea('0x15')][this[_0xdfea('0x17')][_0x12d259['linkedid']][_0xdfea('0x45')]]){this[_0xdfea('0x15')][this[_0xdfea('0x17')][_0x12d259[_0xdfea('0x45')]]['linkedid']][_0xdfea('0x2f')]=_0x12d259['uniqueid'];this['channels'][this['blindTransfers'][_0x12d259['linkedid']]['linkedid']][_0xdfea('0x63')]=this[_0xdfea('0x15')][_0x12d259[_0xdfea('0x2f')]][_0xdfea('0x63')];this[_0xdfea('0x15')][this[_0xdfea('0x17')][_0x12d259[_0xdfea('0x45')]]['linkedid']][_0xdfea('0x64')]=this[_0xdfea('0x15')][_0x12d259[_0xdfea('0x2f')]]['answertime'];this[_0xdfea('0x15')][this[_0xdfea('0x17')][_0x12d259[_0xdfea('0x45')]][_0xdfea('0x45')]][_0xdfea('0x8f')]=this[_0xdfea('0x15')][this[_0xdfea('0x17')][_0x12d259[_0xdfea('0x45')]]['linkedid']][_0xdfea('0x3a')];this[_0xdfea('0x15')][this[_0xdfea('0x17')][_0x12d259[_0xdfea('0x45')]]['linkedid']][_0xdfea('0x4a')]=this[_0xdfea('0x15')][_0x12d259[_0xdfea('0x2f')]][_0xdfea('0x4a')];this['channels'][_0x12d259['uniqueid']]=this[_0xdfea('0x15')][this[_0xdfea('0x17')][_0x12d259[_0xdfea('0x45')]][_0xdfea('0x45')]];delete this['channels'][this[_0xdfea('0x17')][_0x12d259[_0xdfea('0x45')]][_0xdfea('0x45')]];}else if(this[_0xdfea('0x15')][this[_0xdfea('0x17')][_0x12d259[_0xdfea('0x45')]]['uniqueid']]){this['channels'][this[_0xdfea('0x17')][_0x12d259[_0xdfea('0x45')]]['uniqueid']][_0xdfea('0x2f')]=[this[_0xdfea('0x15')][this[_0xdfea('0x17')][_0x12d259['linkedid']]['uniqueid']][_0xdfea('0x45')],this[_0xdfea('0x15')][this[_0xdfea('0x17')][_0x12d259['linkedid']][_0xdfea('0x2f')]][_0xdfea('0x45')]=this[_0xdfea('0x15')][this[_0xdfea('0x17')][_0x12d259['linkedid']]['uniqueid']][_0xdfea('0x2f')]][0x0];this['channels'][this[_0xdfea('0x17')][_0x12d259[_0xdfea('0x45')]][_0xdfea('0x2f')]][_0xdfea('0x63')]=this[_0xdfea('0x15')][_0x12d259[_0xdfea('0x2f')]]['answered'];this[_0xdfea('0x15')][this['blindTransfers'][_0x12d259[_0xdfea('0x45')]][_0xdfea('0x2f')]][_0xdfea('0x64')]=this[_0xdfea('0x15')][_0x12d259[_0xdfea('0x2f')]]['answertime'];this[_0xdfea('0x15')][this['blindTransfers'][_0x12d259[_0xdfea('0x45')]][_0xdfea('0x2f')]][_0xdfea('0x8f')]=this[_0xdfea('0x15')][this[_0xdfea('0x17')][_0x12d259[_0xdfea('0x45')]][_0xdfea('0x2f')]][_0xdfea('0x3a')];this['channels'][this[_0xdfea('0x17')][_0x12d259[_0xdfea('0x45')]][_0xdfea('0x2f')]][_0xdfea('0x4a')]=this['channels'][_0x12d259[_0xdfea('0x2f')]]['disposition'];this[_0xdfea('0x15')][_0x12d259['uniqueid']]=this[_0xdfea('0x15')][this[_0xdfea('0x17')][_0x12d259['linkedid']][_0xdfea('0x2f')]];delete this[_0xdfea('0x15')][this[_0xdfea('0x17')][_0x12d259[_0xdfea('0x45')]]['uniqueid']];}}if(this[_0xdfea('0x15')][_0x12d259['uniqueid']]){logger[_0xdfea('0x27')](_0xdfea('0x90'),_0x12d259[_0xdfea('0x2f')],_0x12d259[_0xdfea('0x91')]);var _0x5d4829=moment();this['channels'][_0x12d259['uniqueid']][_0xdfea('0x92')]=_0x5d4829[_0xdfea('0x3d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xdfea('0x15')][_0x12d259['uniqueid']][_0xdfea('0x57')]=_0x5d4829[_0xdfea('0x93')](this['channels'][_0x12d259['uniqueid']][_0xdfea('0x48')],_0xdfea('0x59'));if(this[_0xdfea('0x15')][_0x12d259[_0xdfea('0x2f')]][_0xdfea('0x63')]){this['channels'][_0x12d259[_0xdfea('0x2f')]][_0xdfea('0x94')]=_0x5d4829[_0xdfea('0x93')](this[_0xdfea('0x15')][_0x12d259[_0xdfea('0x2f')]][_0xdfea('0x64')],_0xdfea('0x59'));this[_0xdfea('0x15')][_0x12d259[_0xdfea('0x2f')]][_0xdfea('0x65')]=this[_0xdfea('0x15')][_0x12d259['uniqueid']][_0xdfea('0x57')]-this['channels'][_0x12d259[_0xdfea('0x2f')]][_0xdfea('0x94')];}if(_0x12d259[_0xdfea('0x47')]==='from-sip'){if(this[_0xdfea('0x16')][_0x12d259['channel'][_0xdfea('0x37')]('-')[0x0]]){this[_0xdfea('0x16')][_0x12d259[_0xdfea('0x3a')]['split']('-')[0x0]]=_[_0xdfea('0x95')](this[_0xdfea('0x16')][_0x12d259[_0xdfea('0x3a')][_0xdfea('0x37')]('-')[0x0]],[_0xdfea('0x3b')]);logger[_0xdfea('0x31')](_0xdfea('0x96'),_0x12d259[_0xdfea('0x2f')],util['inspect']({'id':this[_0xdfea('0x16')][_0x12d259[_0xdfea('0x3a')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xdfea('0x16')][_0x12d259[_0xdfea('0x3a')][_0xdfea('0x37')]('-')[0x0]][_0xdfea('0x4e')]},{'showHidden':![],'depth':null}));this['emit'](util[_0xdfea('0x3d')](_0xdfea('0x3e'),this[_0xdfea('0x16')][_0x12d259[_0xdfea('0x3a')][_0xdfea('0x37')]('-')[0x0]][_0xdfea('0x3f')]),'user:agentcomplete',{'id':this[_0xdfea('0x16')][_0x12d259['channel'][_0xdfea('0x37')]('-')[0x0]]['id'],'destaccountcode':this[_0xdfea('0x16')][_0x12d259[_0xdfea('0x3a')]['split']('-')[0x0]]['accountcode']});for(var _0x48cc0e=0x0;_0x48cc0e<Object[_0xdfea('0x4c')](this[_0xdfea('0x16')])[_0xdfea('0x97')];_0x48cc0e++){var _0x1dfefd=Object[_0xdfea('0x4c')](this[_0xdfea('0x16')])[_0x48cc0e];var _0x4c3918=this[_0xdfea('0x16')][_0x1dfefd];if(_0x4c3918[_0xdfea('0x4e')]===Number(this['channels'][_0x12d259[_0xdfea('0x2f')]][_0xdfea('0x3c')])){this[_0xdfea('0x2b')](util[_0xdfea('0x3d')](_0xdfea('0x3e'),_0x4c3918['name']),'user:agentcomplete',{'id':_0x4c3918['id'],'destaccountcode':_0x4c3918[_0xdfea('0x4e')],'transfer':this[_0xdfea('0x15')][_0x12d259[_0xdfea('0x2f')]][_0xdfea('0x98')]});break;}}}}var _0x2e01d0=this;Promise['resolve']()[_0xdfea('0x99')](function(){var _0x4399dd=_0x2e01d0[_0xdfea('0x15')][_0x12d259[_0xdfea('0x2f')]];if(typeof _0x4399dd[_0xdfea('0x98')]===_0xdfea('0x9a'))return;if(_['isEmpty'](_0x4399dd[_0xdfea('0x74')]))return;return RpcSetting[_0xdfea('0x9b')]()['then'](function(_0x1cf54f){if(!_0x1cf54f[_0xdfea('0x9c')])return;return Promise['resolve']()[_0xdfea('0x99')](function(){return ami[_0xdfea('0x9d')]({'action':'StopMixMonitor','channel':_0x4399dd[_0xdfea('0x3a')]})[_0xdfea('0x9e')](function(){});})[_0xdfea('0x99')](function(){return ami[_0xdfea('0x9d')]({'action':_0xdfea('0x9f'),'channel':_0x4399dd[_0xdfea('0x8f')]})[_0xdfea('0x9e')](function(){})[_0xdfea('0xa0')](function(){var _0x4ad75e=_0x2e01d0[_0xdfea('0x16')][_0x4399dd['destinationchannel']['split']('-')[0x0]];if(!_0x4ad75e)return;io[_0xdfea('0x2b')](_0xdfea('0xa1'),{'agentId':_0x4ad75e['id'],'uniqueid':_0x4399dd[_0xdfea('0x2f')]});});});});})[_0xdfea('0x99')](function(){if(_0x12d259[_0xdfea('0xa2')]===_0xdfea('0xa3')){_0x2e01d0[_0xdfea('0x17')][_0x12d259[_0xdfea('0x2f')]]=_0x12d259;}else{if(_0x2e01d0[_0xdfea('0x15')][_0x12d259[_0xdfea('0x2f')]]['type']===_0xdfea('0xa4')&&_0x2e01d0[_0xdfea('0x17')][_0x12d259['uniqueid']]){_0x2e01d0[_0xdfea('0x15')][_0x12d259[_0xdfea('0x2f')]][_0xdfea('0x2f')]=[_0x2e01d0[_0xdfea('0x15')][_0x12d259[_0xdfea('0x2f')]][_0xdfea('0x45')],_0x2e01d0[_0xdfea('0x15')][_0x12d259['uniqueid']][_0xdfea('0x45')]=_0x2e01d0['channels'][_0x12d259[_0xdfea('0x2f')]][_0xdfea('0x2f')]][0x0];delete _0x2e01d0[_0xdfea('0x17')][_0x12d259['uniqueid']];}}logger[_0xdfea('0x31')]('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x12d259[_0xdfea('0x2f')],util[_0xdfea('0x33')](_0x2e01d0[_0xdfea('0x15')][_0x12d259['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xdfea('0x2b')]('custom:voiceCallReport',_0x2e01d0[_0xdfea('0x15')][_0x12d259[_0xdfea('0x2f')]]);delete _0x2e01d0[_0xdfea('0x15')][_0x12d259[_0xdfea('0x2f')]];});}}}catch(_0x51b3fd){logger[_0xdfea('0x29')](_0xdfea('0xa5'),_0x12d259[_0xdfea('0x2f')],util[_0xdfea('0x33')](_0x51b3fd,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xdfea('0x2a')][_0xdfea('0x22')]=function(_0x19a497){try{if(this[_0xdfea('0x2d')](_0x19a497)){logger[_0xdfea('0x27')](_0xdfea('0xa6'),_0x19a497[_0xdfea('0x2f')],_0x19a497['origtransferercalleridnum'],_0x19a497[_0xdfea('0xa7')]);logger['debug'](_0xdfea('0xa8'),_0x19a497[_0xdfea('0x2f')],util['inspect'](_0x19a497,{'showHidden':![],'depth':null}));var _0x4e7779;if(this[_0xdfea('0x15')][_0x19a497[_0xdfea('0xa9')]]){this['channels'][_0x19a497[_0xdfea('0xa9')]][_0xdfea('0xaa')]=_0x19a497[_0xdfea('0xab')];this['channels'][_0x19a497['transfereeuniqueid']][_0xdfea('0xac')]=_0x19a497[_0xdfea('0xa7')];if(this[_0xdfea('0x15')][_0x19a497[_0xdfea('0xad')]]){_0x4e7779=this[_0xdfea('0x15')][_0x19a497[_0xdfea('0xad')]];this[_0xdfea('0x15')][_0x19a497['secondtransfereruniqueid']]=this[_0xdfea('0x15')][_0x19a497[_0xdfea('0xa9')]];this['channels'][_0x19a497[_0xdfea('0xa9')]]=_0x4e7779;}this[_0xdfea('0x15')][_0x19a497[_0xdfea('0xad')]][_0xdfea('0x98')]='ATTENDED';}else if(this['channels'][_0x19a497[_0xdfea('0xae')]]){this['channels'][_0x19a497['transfertargetuniqueid']][_0xdfea('0xaa')]=_0x19a497[_0xdfea('0xab')];this[_0xdfea('0x15')][_0x19a497[_0xdfea('0xae')]]['transferconnectedlinenum']=_0x19a497[_0xdfea('0xa7')];if(this['channels'][_0x19a497[_0xdfea('0xaf')]]){_0x4e7779=this[_0xdfea('0x15')][_0x19a497['origtransfereruniqueid']];this['channels'][_0x19a497[_0xdfea('0xaf')]]=this[_0xdfea('0x15')][_0x19a497[_0xdfea('0xae')]];this[_0xdfea('0x15')][_0x19a497[_0xdfea('0xae')]]=_0x4e7779;}this['channels'][_0x19a497[_0xdfea('0xae')]][_0xdfea('0x98')]=_0xdfea('0xb0');}if((this[_0xdfea('0x15')][_0x19a497[_0xdfea('0xaf')]]||this[_0xdfea('0x15')][_0x19a497[_0xdfea('0xb1')]])&&this[_0xdfea('0x15')][_0x19a497[_0xdfea('0xad')]]){var _0x50ac9c=_[_0xdfea('0xb2')]([this[_0xdfea('0x15')][_0x19a497['origtransfereruniqueid']],this[_0xdfea('0x15')][_0x19a497[_0xdfea('0xb1')]],this[_0xdfea('0x15')][_0x19a497[_0xdfea('0xad')]]],function(_0x34a9de){return _0x34a9de&&_0x34a9de[_0xdfea('0x5d')]==='outbound'&&_0x34a9de[_0xdfea('0xb3')];});if(_0x50ac9c){if(this[_0xdfea('0x15')][_0x19a497[_0xdfea('0xaf')]])this[_0xdfea('0x15')][_0x19a497[_0xdfea('0xaf')]][_0xdfea('0x98')]=_0xdfea('0xb0');if(this[_0xdfea('0x15')][_0x19a497[_0xdfea('0xb1')]])this[_0xdfea('0x15')][_0x19a497[_0xdfea('0xb1')]][_0xdfea('0x98')]='ATTENDED';this[_0xdfea('0x15')][_0x19a497[_0xdfea('0xad')]][_0xdfea('0x98')]='ATTENDED';}}}}catch(_0x15449d){logger[_0xdfea('0x29')](_0xdfea('0xb4'),_0x19a497[_0xdfea('0x2f')],util[_0xdfea('0x33')](_0x15449d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xdfea('0x2a')][_0xdfea('0x23')]=function(_0x44e11d){try{if(this[_0xdfea('0x2d')](_0x44e11d)){logger[_0xdfea('0x27')](_0xdfea('0xb5'),_0x44e11d[_0xdfea('0x2f')],_0x44e11d[_0xdfea('0xb6')],_0x44e11d[_0xdfea('0xb7')]);logger['debug']('[%s][voiceCallReport][blindtransfer]\x20event:',_0x44e11d[_0xdfea('0x2f')],util[_0xdfea('0x33')](_0x44e11d,{'showHidden':![],'depth':null}));if(this[_0xdfea('0x15')][_0x44e11d[_0xdfea('0xa9')]]){this[_0xdfea('0x15')][_0x44e11d[_0xdfea('0xa9')]]['transfercalleridnum']=_0x44e11d[_0xdfea('0xb6')];this[_0xdfea('0x15')][_0x44e11d[_0xdfea('0xa9')]][_0xdfea('0xac')]=_0x44e11d[_0xdfea('0xb7')];this[_0xdfea('0x15')][_0x44e11d[_0xdfea('0xa9')]][_0xdfea('0x98')]=_0xdfea('0xb8');this['syncHangup']({'event':'BlindTransfer','uniqueid':_0x44e11d[_0xdfea('0xa9')],'linkedid':_0x44e11d[_0xdfea('0xb9')],'context':_0x44e11d[_0xdfea('0x47')],'channel':_0x44e11d['transfererchannel']});}else{this[_0xdfea('0x15')][_0x44e11d[_0xdfea('0xb9')]]['transferType']=_0xdfea('0xb8');this[_0xdfea('0x20')]({'event':'BlindTransfer','uniqueid':_0x44e11d[_0xdfea('0xb9')],'linkedid':_0x44e11d['transfereeuniqueid'],'context':_0x44e11d['context'],'channel':_0x44e11d[_0xdfea('0xba')]});}}}catch(_0x3d927c){logger[_0xdfea('0x29')]('[%s][voiceCallReport][blindtransfer]',_0x44e11d[_0xdfea('0x2f')],util[_0xdfea('0x33')](_0x3d927c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xdfea('0x2a')]['syncMusicOnHoldStart']=function(_0x258f99){try{if(this[_0xdfea('0x2d')](_0x258f99)){logger['debug'](_0xdfea('0xbb'),_0x258f99[_0xdfea('0x2f')],util[_0xdfea('0x33')](_0x258f99,{'showHidden':![],'depth':null}));if(this['channels'][_0x258f99['uniqueid']]){if(!_[_0xdfea('0x5e')](this[_0xdfea('0x15')][_0x258f99[_0xdfea('0x2f')]]['answertime'])){this[_0xdfea('0x15')][_0x258f99[_0xdfea('0x2f')]]['mohstarttime']=moment()[_0xdfea('0x3d')](_0xdfea('0x49'));logger[_0xdfea('0x27')](_0xdfea('0xbc'),_0x258f99[_0xdfea('0x2f')],this['channels'][_0x258f99['uniqueid']][_0xdfea('0xbd')]);}}}}catch(_0x30b5f1){logger['error'](_0xdfea('0xbe'),_0x258f99['uniqueid'],util[_0xdfea('0x33')](_0x30b5f1,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xdfea('0x26')]=function(_0x2ab381){try{if(this['isNotNull'](_0x2ab381)){logger['debug'](_0xdfea('0xbf'),_0x2ab381[_0xdfea('0x2f')],util[_0xdfea('0x33')](_0x2ab381,{'showHidden':![],'depth':null}));if(this[_0xdfea('0x15')][_0x2ab381[_0xdfea('0x2f')]]){if(!_['isNil'](this[_0xdfea('0x15')][_0x2ab381[_0xdfea('0x2f')]][_0xdfea('0xbd')])){this[_0xdfea('0x15')][_0x2ab381[_0xdfea('0x2f')]][_0xdfea('0xc0')]+=moment()[_0xdfea('0xc1')](0x0)[_0xdfea('0x93')](this[_0xdfea('0x15')][_0x2ab381['uniqueid']][_0xdfea('0xbd')],_0xdfea('0x59'));logger['info'](_0xdfea('0xc2'),_0x2ab381[_0xdfea('0x2f')],this[_0xdfea('0x15')][_0x2ab381[_0xdfea('0x2f')]][_0xdfea('0xc0')]);delete this[_0xdfea('0x15')][_0x2ab381[_0xdfea('0x2f')]]['mohstarttime'];}}}}catch(_0x1aaffd){logger[_0xdfea('0x29')](_0xdfea('0xc3'),_0x2ab381[_0xdfea('0x2f')],util[_0xdfea('0x33')](_0x1aaffd,{'showHidden':![],'depth':null}));}};module[_0xdfea('0xc4')]=VoiceCallReport;
\ No newline at end of file
+var _0x8d35=['dial','voicemail','NO\x20ANSWER','FAILED','BUSY','redis','defaults','localhost','channels','agents','blindTransfers','syncNewExten','bind','newexten','newchannel','newstate','hangup','syncHangup','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','[voiceCallReport][coreshowchannels]\x20started','[voiceCallReport][coreshowchannels]','inspect','prototype','isUndefined','emit','isNotNull','info','uniqueid','calleridname','calleridnum','[%s][voiceCallReport][newcallerid]\x20event:','merge','pick','context','from-sip','split','channel','destconnectedlinenum','connectedlinenum','format','user:%s','accountcode','[%s][voiceCallReport][newcallerid]','syncNewChannel','debug','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','linkedid','exten','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','channelstate','keys','undefined','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','error','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','queue','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','seconds','lastapplication','lastdata','cdr(','match','type','isNil','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','answered','answertime','holdtime','connectedlinename','destinationchannel','toNumber','UserId','membername','diff','xcally-motion-preview','routealias','name','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','syncMixMonitorFilename','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','rec','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','xmd-callerid','xmd-cdrtype','[%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','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','billableseconds','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','transferType','resolve','then','getSettings','stopRecordingOnTransfer','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','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','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','transfercalleridnum','transfertargetcalleridnum','origtransfereruniqueid','origtransfererlinkedid','some','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','transferconnectedlinenum','extension','BLIND','BlindTransfer','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','syncMusicOnHoldStart','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]','exports','lodash','moment','util','path','../../../config/environment','../../../config/logger','ami','../ami','../rpc/setting','set','agi'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x8d35,0xb6));var _0x58d3=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x8d35[_0x45783c];return _0x1161da;};'use strict';var _=require(_0x58d3('0x0'));var moment=require(_0x58d3('0x1'));var util=require(_0x58d3('0x2'));var path=require(_0x58d3('0x3'));var Redis=require('ioredis');var config=require(_0x58d3('0x4'));var logger=require(_0x58d3('0x5'))(_0x58d3('0x6'));var ami=require(_0x58d3('0x7'));var Channel=require('../model/channel');var RpcSetting=require(_0x58d3('0x8'));var applications=[_0x58d3('0x9'),'queue',_0x58d3('0xa'),_0x58d3('0xb'),'playback',_0x58d3('0xc')];var dispositions=[_0x58d3('0xd'),_0x58d3('0xe'),_0x58d3('0xe'),_0x58d3('0xd'),_0x58d3('0xd'),_0x58d3('0xd'),'ANSWERED',_0x58d3('0xf'),'FAILED','FAILED','FAILED'];config[_0x58d3('0x10')]=_[_0x58d3('0x11')](config[_0x58d3('0x10')],{'host':_0x58d3('0x12'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x58d3('0x10')]));function VoiceCallReport(_0x284cc5){this[_0x58d3('0x13')]=_0x284cc5[_0x58d3('0x13')];this['agents']=_0x284cc5[_0x58d3('0x14')];this[_0x58d3('0x15')]={};ami['on']('coreshowchannel',this[_0x58d3('0x16')][_0x58d3('0x17')](this));ami['on'](_0x58d3('0x18'),this['syncNewExten'][_0x58d3('0x17')](this));ami['on'](_0x58d3('0x19'),this['syncNewChannel'][_0x58d3('0x17')](this));ami['on'](_0x58d3('0x1a'),this['syncNewState'][_0x58d3('0x17')](this));ami['on']('varset',this['syncVarSet'][_0x58d3('0x17')](this));ami['on'](_0x58d3('0x1b'),this[_0x58d3('0x1c')][_0x58d3('0x17')](this));ami['on']('newcallerid',this[_0x58d3('0x1d')][_0x58d3('0x17')](this));ami['on'](_0x58d3('0x1e'),this[_0x58d3('0x1f')][_0x58d3('0x17')](this));ami['on'](_0x58d3('0x20'),this[_0x58d3('0x21')][_0x58d3('0x17')](this));ami['on'](_0x58d3('0x22'),this['syncMusicOnHoldStart'][_0x58d3('0x17')](this));ami['on'](_0x58d3('0x23'),this[_0x58d3('0x24')][_0x58d3('0x17')](this));try{logger['info'](_0x58d3('0x25'));ami['actionCoreShowChannels']();}catch(_0x2917ad){logger['error'](_0x58d3('0x26'),util[_0x58d3('0x27')](_0x2917ad,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x58d3('0x28')]['isNotNull']=function(_0x493543){return _0x493543!==null&&!_[_0x58d3('0x29')](_0x493543);};VoiceCallReport[_0x58d3('0x28')][_0x58d3('0x2a')]=function(_0x5c69ab,_0xc1d466,_0x1cefca){io['to'](_0x5c69ab)['emit'](_0xc1d466,_0x1cefca);};VoiceCallReport[_0x58d3('0x28')]['syncNewCallerId']=function(_0x2a8679){try{if(this[_0x58d3('0x2b')](_0x2a8679)){logger[_0x58d3('0x2c')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x2a8679[_0x58d3('0x2d')],_0x2a8679[_0x58d3('0x2e')],_0x2a8679[_0x58d3('0x2f')]);logger['debug'](_0x58d3('0x30'),_0x2a8679[_0x58d3('0x2d')],util[_0x58d3('0x27')](_0x2a8679,{'showHidden':![],'depth':null}));if(_0x2a8679[_0x58d3('0x2d')]===_0x2a8679['linkedid']){if(!_[_0x58d3('0x29')](this[_0x58d3('0x13')][_0x2a8679[_0x58d3('0x2d')]])){_[_0x58d3('0x31')](this[_0x58d3('0x13')][_0x2a8679[_0x58d3('0x2d')]],_[_0x58d3('0x32')](_0x2a8679,_['keys'](this[_0x58d3('0x13')][_0x2a8679[_0x58d3('0x2d')]])));}}if(_0x2a8679[_0x58d3('0x33')]===_0x58d3('0x34')){if(this['agents'][_0x2a8679['channel'][_0x58d3('0x35')]('-')[0x0]]){if(_0x2a8679['exten']=='xcally-motion-preview'){this[_0x58d3('0x14')][_0x2a8679[_0x58d3('0x36')]['split']('-')[0x0]][_0x58d3('0x37')]=_0x2a8679[_0x58d3('0x38')];this[_0x58d3('0x2a')](util[_0x58d3('0x39')](_0x58d3('0x3a'),this[_0x58d3('0x14')][_0x2a8679[_0x58d3('0x36')][_0x58d3('0x35')]('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this[_0x58d3('0x14')][_0x2a8679[_0x58d3('0x36')][_0x58d3('0x35')]('-')[0x0]][_0x58d3('0x3b')],'destconnectedlinenum':_0x2a8679[_0x58d3('0x38')]});}}}}}catch(_0x38a613){logger['error'](_0x58d3('0x3c'),_0x2a8679[_0x58d3('0x2d')],util[_0x58d3('0x27')](_0x38a613,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x58d3('0x3d')]=function(_0x2f4671){try{if(this[_0x58d3('0x2b')](_0x2f4671)){logger[_0x58d3('0x3e')](_0x58d3('0x3f'),_0x2f4671[_0x58d3('0x2d')],util[_0x58d3('0x27')](_0x2f4671,{'showHidden':![],'depth':null}));if(this['channels'][_0x2f4671[_0x58d3('0x2d')]]){return;}if(_0x2f4671[_0x58d3('0x36')]===_0x58d3('0x40')){return;}if(_0x2f4671[_0x58d3('0x2d')]!==_0x2f4671[_0x58d3('0x41')]&&!this[_0x58d3('0x15')][_0x2f4671[_0x58d3('0x41')]]){return;}logger[_0x58d3('0x2c')]('[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s',_0x2f4671[_0x58d3('0x2d')],_0x2f4671[_0x58d3('0x33')],_0x2f4671[_0x58d3('0x42')]);this[_0x58d3('0x13')][_0x2f4671[_0x58d3('0x2d')]]=new Channel();this[_0x58d3('0x13')][_0x2f4671[_0x58d3('0x2d')]][_0x58d3('0x43')]=moment()[_0x58d3('0x39')](_0x58d3('0x44'));this[_0x58d3('0x13')][_0x2f4671[_0x58d3('0x2d')]][_0x58d3('0x45')]=dispositions[_['toNumber'](_0x2f4671[_0x58d3('0x46')])];_['merge'](this[_0x58d3('0x13')][_0x2f4671[_0x58d3('0x2d')]],_['pick'](_0x2f4671,_[_0x58d3('0x47')](this[_0x58d3('0x13')][_0x2f4671[_0x58d3('0x2d')]])));if(_0x2f4671['context']===_0x58d3('0x34')){var _0x5d8864=this['agents'][_0x2f4671[_0x58d3('0x36')][_0x58d3('0x35')]('-')[0x0]];if(_0x5d8864&&typeof _0x5d8864['destconnectedlinenum']===_0x58d3('0x48')){_0x5d8864[_0x58d3('0x37')]=_0x2f4671[_0x58d3('0x42')];logger[_0x58d3('0x3e')](_0x58d3('0x49'),_0x2f4671[_0x58d3('0x2d')],util[_0x58d3('0x27')]({'id':_0x5d8864['id'],'destaccountcode':_0x5d8864[_0x58d3('0x3b')],'destconnectedlinenum':_0x2f4671[_0x58d3('0x42')]},{'showHidden':![],'depth':null}));this[_0x58d3('0x2a')](util[_0x58d3('0x39')](_0x58d3('0x3a'),_0x5d8864['name']),_0x58d3('0x4a'),{'id':_0x5d8864['id'],'destaccountcode':_0x5d8864[_0x58d3('0x3b')],'destconnectedlinenum':_0x2f4671['exten']});}}}}catch(_0x342717){logger[_0x58d3('0x4b')](_0x58d3('0x4c'),_0x2f4671[_0x58d3('0x2d')],util[_0x58d3('0x27')](_0x342717,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x58d3('0x28')]['syncNewExten']=function(_0x5b2da9){try{if(this[_0x58d3('0x2b')](_0x5b2da9)){logger['debug'](_0x58d3('0x4d'),_0x5b2da9['uniqueid'],util['inspect'](_0x5b2da9,{'showHidden':![],'depth':null}));if(_0x5b2da9[_0x58d3('0x36')]===_0x58d3('0x40')||_0x5b2da9[_0x58d3('0x42')]==='h')return;if(_0x5b2da9[_0x58d3('0x2d')]===_0x5b2da9[_0x58d3('0x41')]||this[_0x58d3('0x15')][_0x5b2da9[_0x58d3('0x41')]]){_0x5b2da9[_0x58d3('0x4e')]=_0x5b2da9[_0x58d3('0x4e')][_0x58d3('0x4f')]();_0x5b2da9[_0x58d3('0x50')]=_0x5b2da9[_0x58d3('0x51')]||_0x5b2da9[_0x58d3('0x50')];if(_0x5b2da9[_0x58d3('0x51')]&&!_0x5b2da9['appdata'][_0x58d3('0x52')](_0x58d3('0x53'))&&_0x5b2da9[_0x58d3('0x4e')]!==_0x58d3('0x54')){_0x5b2da9['applicationdata']=_0x5b2da9[_0x58d3('0x50')]['toLowerCase']();}logger['info'](_0x58d3('0x55'),_0x5b2da9[_0x58d3('0x2d')],_0x5b2da9[_0x58d3('0x4e')],_0x5b2da9[_0x58d3('0x50')]);if(_[_0x58d3('0x29')](this[_0x58d3('0x13')][_0x5b2da9[_0x58d3('0x2d')]])){this['channels'][_0x5b2da9['uniqueid']]=new Channel();this[_0x58d3('0x13')][_0x5b2da9['uniqueid']]['starttime']=_0x5b2da9[_0x58d3('0x56')]?moment()['subtract'](moment['duration'](_0x5b2da9['duration'])[_0x58d3('0x57')](),_0x58d3('0x57'))[_0x58d3('0x39')](_0x58d3('0x44')):moment()[_0x58d3('0x39')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5b2da9[_0x58d3('0x2d')]][_0x58d3('0x45')]='NO\x20ANSWER';}_['merge'](this['channels'][_0x5b2da9[_0x58d3('0x2d')]],_[_0x58d3('0x32')](_0x5b2da9,_['keys'](this[_0x58d3('0x13')][_0x5b2da9[_0x58d3('0x2d')]])));if(_['includes'](applications,_0x5b2da9[_0x58d3('0x4e')])){this[_0x58d3('0x13')][_0x5b2da9[_0x58d3('0x2d')]][_0x58d3('0x58')]=_0x5b2da9[_0x58d3('0x4e')];this[_0x58d3('0x13')][_0x5b2da9[_0x58d3('0x2d')]][_0x58d3('0x59')]=_0x5b2da9[_0x58d3('0x50')];if(_0x5b2da9[_0x58d3('0x4e')]===_0x58d3('0x9')&&_[_0x58d3('0x52')](_0x5b2da9[_0x58d3('0x50')][_0x58d3('0x4f')](),_0x58d3('0x5a'))){var _0x201e9b=_0x5b2da9[_0x58d3('0x50')][_0x58d3('0x35')]('=');var _0x1c7d41=_0x201e9b[0x0][_0x58d3('0x4f')]()[_0x58d3('0x5b')](/cdr\((.*)\)/);if(_0x1c7d41){if(_0x1c7d41[0x1]===_0x58d3('0x5c')&&!_[_0x58d3('0x5d')](this[_0x58d3('0x13')][_0x5b2da9[_0x58d3('0x2d')]][_0x1c7d41[0x1]]))return;this[_0x58d3('0x13')][_0x5b2da9[_0x58d3('0x2d')]][_0x1c7d41[0x1]]=_0x201e9b[0x1];}}else if(_0x5b2da9[_0x58d3('0x4e')]===_0x58d3('0x54')){this[_0x58d3('0x13')][_0x5b2da9['uniqueid']][_0x58d3('0x54')]=_0x5b2da9['applicationdata']['split'](',')[0x0];}}}}}catch(_0x5df76b){logger[_0x58d3('0x4b')](_0x58d3('0x5e'),_0x5b2da9[_0x58d3('0x2d')],util[_0x58d3('0x27')](_0x5df76b,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x58d3('0x5f')]=function(_0x47e315){try{if(this[_0x58d3('0x2b')](_0x47e315)){logger['info'](_0x58d3('0x60'),_0x47e315[_0x58d3('0x2d')],_0x47e315['linkedid'],_0x47e315['calleridname'],_0x47e315[_0x58d3('0x2f')]);logger['debug']('[%s][voiceCallReport][newstate]\x20event:',_0x47e315[_0x58d3('0x2d')],util[_0x58d3('0x27')](_0x47e315,{'showHidden':![],'depth':null}));if(_0x47e315[_0x58d3('0x46')]!=='6')return;var _0xb8c81d=this[_0x58d3('0x14')][_0x47e315[_0x58d3('0x36')]['split']('-')[0x0]];if(_0x47e315['uniqueid']!==_0x47e315['linkedid']){var _0x2c82ec=moment();if(this['channels'][_0x47e315['linkedid']]){if(!this[_0x58d3('0x13')][_0x47e315[_0x58d3('0x41')]][_0x58d3('0x61')]){this[_0x58d3('0x13')][_0x47e315[_0x58d3('0x41')]][_0x58d3('0x61')]=!![];this[_0x58d3('0x13')][_0x47e315['linkedid']][_0x58d3('0x62')]=_0x2c82ec[_0x58d3('0x39')]('YYYY-MM-DD\x20HH:mm:ss');if(this['channels'][_0x47e315['linkedid']][_0x58d3('0x43')]){this['channels'][_0x47e315[_0x58d3('0x41')]][_0x58d3('0x63')]=_0x2c82ec['diff'](this[_0x58d3('0x13')][_0x47e315[_0x58d3('0x41')]][_0x58d3('0x43')],_0x58d3('0x57'));}}this[_0x58d3('0x13')][_0x47e315[_0x58d3('0x41')]][_0x58d3('0x41')]=_0x47e315[_0x58d3('0x2d')];if(_0x47e315['calleridnum']!=='xcally-motion-preview'){this[_0x58d3('0x13')][_0x47e315[_0x58d3('0x41')]][_0x58d3('0x38')]=_0x47e315[_0x58d3('0x2f')];}this['channels'][_0x47e315[_0x58d3('0x41')]][_0x58d3('0x64')]=_0x47e315[_0x58d3('0x2e')];this[_0x58d3('0x13')][_0x47e315[_0x58d3('0x41')]][_0x58d3('0x65')]=_0x47e315['channel'];this[_0x58d3('0x13')][_0x47e315[_0x58d3('0x41')]][_0x58d3('0x45')]=dispositions[_[_0x58d3('0x66')](_0x47e315[_0x58d3('0x46')])];if(_0xb8c81d){this[_0x58d3('0x13')][_0x47e315[_0x58d3('0x41')]][_0x58d3('0x67')]=_0xb8c81d['id'];this['channels'][_0x47e315['linkedid']][_0x58d3('0x68')]=_0xb8c81d['name'];}}if(this[_0x58d3('0x13')][_0x47e315[_0x58d3('0x2d')]]){if(!this[_0x58d3('0x13')][_0x47e315[_0x58d3('0x2d')]][_0x58d3('0x61')]){this[_0x58d3('0x13')][_0x47e315[_0x58d3('0x2d')]][_0x58d3('0x61')]=!![];this[_0x58d3('0x13')][_0x47e315[_0x58d3('0x2d')]][_0x58d3('0x62')]=_0x2c82ec[_0x58d3('0x39')](_0x58d3('0x44'));if(this[_0x58d3('0x13')][_0x47e315[_0x58d3('0x2d')]]['starttime']){this[_0x58d3('0x13')][_0x47e315[_0x58d3('0x2d')]]['holdtime']=_0x2c82ec[_0x58d3('0x69')](this[_0x58d3('0x13')][_0x47e315['uniqueid']][_0x58d3('0x43')],'seconds');}}if(_0x47e315['calleridnum']!==_0x58d3('0x6a')){this[_0x58d3('0x13')][_0x47e315[_0x58d3('0x2d')]]['connectedlinenum']=_0x47e315[_0x58d3('0x2f')];}this[_0x58d3('0x13')][_0x47e315[_0x58d3('0x2d')]]['connectedlinename']=_0x47e315[_0x58d3('0x2e')];this[_0x58d3('0x13')][_0x47e315['uniqueid']][_0x58d3('0x65')]=_0x47e315[_0x58d3('0x36')];this[_0x58d3('0x13')][_0x47e315[_0x58d3('0x2d')]][_0x58d3('0x45')]=dispositions[_[_0x58d3('0x66')](_0x47e315[_0x58d3('0x46')])];}}else{if(this[_0x58d3('0x13')][_0x47e315[_0x58d3('0x2d')]]){if(_0xb8c81d){this[_0x58d3('0x13')][_0x47e315[_0x58d3('0x2d')]]['UserId']=_0xb8c81d['id'];this[_0x58d3('0x13')][_0x47e315['uniqueid']][_0x58d3('0x68')]=_0xb8c81d['name'];}}}if(_0x47e315[_0x58d3('0x33')]===_0x58d3('0x34')){if(_0xb8c81d){_0xb8c81d[_0x58d3('0x37')]=_0x47e315[_0x58d3('0x42')];var _0x4f8c7f,_0x1d8de3;if(this[_0x58d3('0x13')][_0x47e315[_0x58d3('0x2d')]]){_0x4f8c7f=this[_0x58d3('0x13')][_0x47e315[_0x58d3('0x2d')]][_0x58d3('0x6b')];_0x1d8de3=this['channels'][_0x47e315[_0x58d3('0x2d')]][_0x58d3('0x54')];}else if(this[_0x58d3('0x13')][_0x47e315[_0x58d3('0x41')]]){_0x4f8c7f=this['channels'][_0x47e315[_0x58d3('0x41')]][_0x58d3('0x6b')];_0x1d8de3=this[_0x58d3('0x13')][_0x47e315[_0x58d3('0x41')]][_0x58d3('0x54')];}_0xb8c81d[_0x58d3('0x54')]=_0x1d8de3;_0xb8c81d[_0x58d3('0x6b')]=_0x4f8c7f;var _0x346a1c={'id':_0xb8c81d['id'],'name':_0xb8c81d[_0x58d3('0x6c')],'agentconnected':!![],'destaccountcode':_0xb8c81d['accountcode'],'destconnectedlinenum':_0x47e315[_0x58d3('0x42')],'queue':_0x1d8de3||undefined,'routealias':_0x4f8c7f,'uniqueid':_0x47e315[_0x58d3('0x41')]};logger[_0x58d3('0x3e')](_0x58d3('0x6d'),_0x47e315['uniqueid'],util['inspect'](_0x346a1c,{'showHidden':![],'depth':null}));this[_0x58d3('0x2a')](util['format'](_0x58d3('0x3a'),_0xb8c81d[_0x58d3('0x6c')]),_0x58d3('0x4a'),_0x346a1c);}}}}catch(_0x4b4968){logger['error']('[%s][voiceCallReport][newstate]',_0x47e315['uniqueid'],util[_0x58d3('0x27')](_0x4b4968,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x58d3('0x28')][_0x58d3('0x6e')]=function(_0x4bb9df,_0x1aa7b8){try{if(this[_0x58d3('0x13')][_0x4bb9df]){logger['info']('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x4bb9df,_0x1aa7b8);this[_0x58d3('0x13')][_0x4bb9df][_0x58d3('0x6f')]=!![];if(_[_0x58d3('0x70')](_0x1aa7b8,_0x58d3('0x71'))){_0x1aa7b8=_0x1aa7b8[_0x58d3('0x72')]('.wav49',_0x58d3('0x73'));}this[_0x58d3('0x13')][_0x4bb9df][_0x58d3('0x74')]=_0x1aa7b8;var _0x523bfb=_[_0x58d3('0x75')](this[_0x58d3('0x13')][_0x4bb9df][_0x58d3('0x76')],{'filename':_0x1aa7b8});if(_[_0x58d3('0x5d')](_0x523bfb)){this[_0x58d3('0x13')][_0x4bb9df][_0x58d3('0x76')]['push']({'filename':_0x1aa7b8,'createdAt':moment()[_0x58d3('0x39')](_0x58d3('0x44')),'mixmonitorid':'','status':_0x58d3('0x77')});}}}catch(_0x2e3c8c){logger['error']('[%s][voiceCallReport][mixMonitorFilename]',_0x4bb9df,util['inspect'](_0x2e3c8c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncVarSet']=function(_0x3320ce){try{if(this[_0x58d3('0x2b')](_0x3320ce)){logger[_0x58d3('0x3e')]('[%s][voiceCallReport][varset]\x20event:',_0x3320ce[_0x58d3('0x2d')],util[_0x58d3('0x27')](_0x3320ce,{'showHidden':![],'depth':null}));if(this['channels'][_0x3320ce['uniqueid']]&&_0x3320ce[_0x58d3('0x36')]!=_0x58d3('0x40')){if(this[_0x58d3('0x2b')](_0x3320ce[_0x58d3('0x78')])){if(this['isNotNull'](_0x3320ce[_0x58d3('0x78')][_0x58d3('0x79')])){logger[_0x58d3('0x2c')](_0x58d3('0x7a'),_0x3320ce['uniqueid'],_0x3320ce[_0x58d3('0x7b')]);this[_0x58d3('0x6e')](_0x3320ce[_0x58d3('0x2d')],_0x3320ce['value']);}else if(this[_0x58d3('0x2b')](_0x3320ce['variable'][_0x58d3('0x7c')])){logger[_0x58d3('0x2c')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x3320ce['uniqueid'],_0x3320ce['value']);this['channels'][_0x3320ce[_0x58d3('0x2d')]][_0x58d3('0x2f')]=_0x3320ce[_0x58d3('0x7b')];}else if(this[_0x58d3('0x2b')](_0x3320ce[_0x58d3('0x78')][_0x58d3('0x7d')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0x3320ce['uniqueid'],_0x3320ce[_0x58d3('0x7b')]);this[_0x58d3('0x13')][_0x3320ce[_0x58d3('0x2d')]]['callerid']=_0x3320ce[_0x58d3('0x7b')];}else if(this[_0x58d3('0x2b')](_0x3320ce[_0x58d3('0x78')][_0x58d3('0x7e')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x3320ce[_0x58d3('0x2d')],_0x3320ce[_0x58d3('0x7b')]);this['channels'][_0x3320ce[_0x58d3('0x2d')]][_0x58d3('0x5c')]=_0x3320ce[_0x58d3('0x7b')];}else if(this[_0x58d3('0x2b')](_0x3320ce[_0x58d3('0x78')]['xmd-queue'])){logger[_0x58d3('0x2c')](_0x58d3('0x7f'),_0x3320ce[_0x58d3('0x2d')],_0x3320ce[_0x58d3('0x7b')][_0x58d3('0x35')](',')[0x0]);this[_0x58d3('0x13')][_0x3320ce[_0x58d3('0x2d')]][_0x58d3('0x54')]=_0x3320ce['value'][_0x58d3('0x35')](',')[0x0];}else if(this[_0x58d3('0x2b')](_0x3320ce[_0x58d3('0x78')][_0x58d3('0x80')])){logger['info'](_0x58d3('0x81'),_0x3320ce['uniqueid'],_0x3320ce[_0x58d3('0x7b')]);this['channels'][_0x3320ce[_0x58d3('0x2d')]][_0x58d3('0x82')]=_0x3320ce['value'];}else if(this[_0x58d3('0x2b')](_0x3320ce['variable'][_0x58d3('0x83')])){logger['info'](_0x58d3('0x84'),_0x3320ce['uniqueid'],_0x3320ce['value']);this[_0x58d3('0x13')][_0x3320ce[_0x58d3('0x2d')]]['destination']=_0x3320ce[_0x58d3('0x7b')];}else if(this[_0x58d3('0x2b')](_0x3320ce['variable'][_0x58d3('0x85')])){logger[_0x58d3('0x2c')](_0x58d3('0x86'),_0x3320ce[_0x58d3('0x2d')],_0x3320ce[_0x58d3('0x7b')]);this[_0x58d3('0x13')][_0x3320ce[_0x58d3('0x2d')]][_0x58d3('0x87')]=_0x3320ce[_0x58d3('0x7b')];}else if(this['isNotNull'](_0x3320ce[_0x58d3('0x78')][_0x58d3('0x88')])){logger[_0x58d3('0x2c')](_0x58d3('0x89'),_0x3320ce['uniqueid'],_0x3320ce[_0x58d3('0x7b')]);this['channels'][_0x3320ce['uniqueid']][_0x58d3('0x54')]=_0x3320ce[_0x58d3('0x7b')];}else if(this[_0x58d3('0x2b')](_0x3320ce[_0x58d3('0x78')]['sipcallid'])){logger[_0x58d3('0x2c')](_0x58d3('0x8a'),_0x3320ce['uniqueid'],_0x3320ce[_0x58d3('0x7b')]);this[_0x58d3('0x13')][_0x3320ce['uniqueid']]['sipcalluniqueid']=_0x3320ce[_0x58d3('0x7b')];}}}else if(this[_0x58d3('0x2b')](_0x3320ce['variable'][_0x58d3('0x79')])){if(_0x3320ce[_0x58d3('0x7b')]){var _0x2b0d17=path['parse'](_0x3320ce['value'])[_0x58d3('0x6c')];logger[_0x58d3('0x2c')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x2b0d17,_0x3320ce[_0x58d3('0x7b')]);this[_0x58d3('0x6e')](_0x2b0d17,_0x3320ce['value']);}}else if(this[_0x58d3('0x13')][_0x3320ce[_0x58d3('0x41')]]){if(this[_0x58d3('0x2b')](_0x3320ce[_0x58d3('0x78')])){if(this['isNotNull'](_0x3320ce[_0x58d3('0x78')]['sipcallid'])){logger[_0x58d3('0x2c')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x3320ce[_0x58d3('0x41')],_0x3320ce['value']);this[_0x58d3('0x13')][_0x3320ce[_0x58d3('0x41')]][_0x58d3('0x8b')]=_0x3320ce[_0x58d3('0x7b')];}}}}}catch(_0x1e8ac7){logger[_0x58d3('0x4b')](_0x58d3('0x8c'),_0x3320ce[_0x58d3('0x2d')],util[_0x58d3('0x27')](_0x1e8ac7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x58d3('0x28')]['syncHangup']=function(_0x5dd286){try{if(this[_0x58d3('0x2b')](_0x5dd286)){logger[_0x58d3('0x3e')](_0x58d3('0x8d'),_0x5dd286[_0x58d3('0x2d')],util[_0x58d3('0x27')](_0x5dd286,{'showHidden':![],'depth':null}));if(this[_0x58d3('0x15')][_0x5dd286['linkedid']]){if(this['channels'][this[_0x58d3('0x15')][_0x5dd286[_0x58d3('0x41')]][_0x58d3('0x41')]]){this['channels'][this[_0x58d3('0x15')][_0x5dd286[_0x58d3('0x41')]][_0x58d3('0x41')]][_0x58d3('0x2d')]=_0x5dd286[_0x58d3('0x2d')];this[_0x58d3('0x13')][this[_0x58d3('0x15')][_0x5dd286[_0x58d3('0x41')]][_0x58d3('0x41')]][_0x58d3('0x61')]=this[_0x58d3('0x13')][_0x5dd286[_0x58d3('0x2d')]]['answered'];this['channels'][this[_0x58d3('0x15')][_0x5dd286['linkedid']][_0x58d3('0x41')]][_0x58d3('0x62')]=this['channels'][_0x5dd286['uniqueid']][_0x58d3('0x62')];this[_0x58d3('0x13')][this[_0x58d3('0x15')][_0x5dd286[_0x58d3('0x41')]][_0x58d3('0x41')]][_0x58d3('0x65')]=this[_0x58d3('0x13')][this[_0x58d3('0x15')][_0x5dd286[_0x58d3('0x41')]][_0x58d3('0x41')]][_0x58d3('0x36')];this[_0x58d3('0x13')][this['blindTransfers'][_0x5dd286[_0x58d3('0x41')]][_0x58d3('0x41')]][_0x58d3('0x45')]=this[_0x58d3('0x13')][_0x5dd286[_0x58d3('0x2d')]][_0x58d3('0x45')];this[_0x58d3('0x13')][_0x5dd286[_0x58d3('0x2d')]]=this[_0x58d3('0x13')][this[_0x58d3('0x15')][_0x5dd286['linkedid']]['linkedid']];delete this[_0x58d3('0x13')][this[_0x58d3('0x15')][_0x5dd286[_0x58d3('0x41')]]['linkedid']];}else if(this[_0x58d3('0x13')][this['blindTransfers'][_0x5dd286[_0x58d3('0x41')]]['uniqueid']]){this['channels'][this['blindTransfers'][_0x5dd286[_0x58d3('0x41')]][_0x58d3('0x2d')]][_0x58d3('0x2d')]=[this['channels'][this['blindTransfers'][_0x5dd286[_0x58d3('0x41')]][_0x58d3('0x2d')]][_0x58d3('0x41')],this[_0x58d3('0x13')][this[_0x58d3('0x15')][_0x5dd286[_0x58d3('0x41')]][_0x58d3('0x2d')]][_0x58d3('0x41')]=this[_0x58d3('0x13')][this[_0x58d3('0x15')][_0x5dd286['linkedid']][_0x58d3('0x2d')]][_0x58d3('0x2d')]][0x0];this['channels'][this[_0x58d3('0x15')][_0x5dd286['linkedid']][_0x58d3('0x2d')]]['answered']=this['channels'][_0x5dd286['uniqueid']][_0x58d3('0x61')];this['channels'][this[_0x58d3('0x15')][_0x5dd286['linkedid']]['uniqueid']][_0x58d3('0x62')]=this['channels'][_0x5dd286['uniqueid']]['answertime'];this[_0x58d3('0x13')][this[_0x58d3('0x15')][_0x5dd286['linkedid']][_0x58d3('0x2d')]][_0x58d3('0x65')]=this[_0x58d3('0x13')][this['blindTransfers'][_0x5dd286[_0x58d3('0x41')]][_0x58d3('0x2d')]][_0x58d3('0x36')];this[_0x58d3('0x13')][this[_0x58d3('0x15')][_0x5dd286[_0x58d3('0x41')]][_0x58d3('0x2d')]][_0x58d3('0x45')]=this[_0x58d3('0x13')][_0x5dd286[_0x58d3('0x2d')]]['disposition'];this[_0x58d3('0x13')][_0x5dd286['uniqueid']]=this[_0x58d3('0x13')][this['blindTransfers'][_0x5dd286[_0x58d3('0x41')]]['uniqueid']];delete this[_0x58d3('0x13')][this[_0x58d3('0x15')][_0x5dd286[_0x58d3('0x41')]][_0x58d3('0x2d')]];}}if(this[_0x58d3('0x13')][_0x5dd286[_0x58d3('0x2d')]]){logger['info'](_0x58d3('0x8e'),_0x5dd286[_0x58d3('0x2d')],_0x5dd286[_0x58d3('0x8f')]);var _0x33e5ae=moment();this[_0x58d3('0x13')][_0x5dd286[_0x58d3('0x2d')]]['endtime']=_0x33e5ae[_0x58d3('0x39')](_0x58d3('0x44'));this[_0x58d3('0x13')][_0x5dd286[_0x58d3('0x2d')]]['duration']=_0x33e5ae['diff'](this['channels'][_0x5dd286[_0x58d3('0x2d')]][_0x58d3('0x43')],'seconds');if(this['channels'][_0x5dd286[_0x58d3('0x2d')]][_0x58d3('0x61')]){this[_0x58d3('0x13')][_0x5dd286['uniqueid']][_0x58d3('0x90')]=_0x33e5ae[_0x58d3('0x69')](this['channels'][_0x5dd286['uniqueid']][_0x58d3('0x62')],_0x58d3('0x57'));this[_0x58d3('0x13')][_0x5dd286[_0x58d3('0x2d')]][_0x58d3('0x63')]=this[_0x58d3('0x13')][_0x5dd286['uniqueid']][_0x58d3('0x56')]-this[_0x58d3('0x13')][_0x5dd286['uniqueid']][_0x58d3('0x90')];}if(_0x5dd286['context']===_0x58d3('0x34')){if(this['agents'][_0x5dd286[_0x58d3('0x36')][_0x58d3('0x35')]('-')[0x0]]){this[_0x58d3('0x14')][_0x5dd286[_0x58d3('0x36')][_0x58d3('0x35')]('-')[0x0]]=_['omit'](this[_0x58d3('0x14')][_0x5dd286['channel'][_0x58d3('0x35')]('-')[0x0]],['destconnectedlinenum']);logger[_0x58d3('0x3e')](_0x58d3('0x91'),_0x5dd286['uniqueid'],util[_0x58d3('0x27')]({'id':this[_0x58d3('0x14')][_0x5dd286[_0x58d3('0x36')][_0x58d3('0x35')]('-')[0x0]]['id'],'destaccountcode':this[_0x58d3('0x14')][_0x5dd286['channel'][_0x58d3('0x35')]('-')[0x0]][_0x58d3('0x3b')]},{'showHidden':![],'depth':null}));this['emit'](util[_0x58d3('0x39')](_0x58d3('0x3a'),this[_0x58d3('0x14')][_0x5dd286[_0x58d3('0x36')]['split']('-')[0x0]][_0x58d3('0x6c')]),_0x58d3('0x92'),{'id':this[_0x58d3('0x14')][_0x5dd286['channel']['split']('-')[0x0]]['id'],'destaccountcode':this[_0x58d3('0x14')][_0x5dd286[_0x58d3('0x36')][_0x58d3('0x35')]('-')[0x0]][_0x58d3('0x3b')]});for(var _0x44987d=0x0;_0x44987d<Object[_0x58d3('0x47')](this['agents'])[_0x58d3('0x93')];_0x44987d++){var _0x5373ce=Object['keys'](this['agents'])[_0x44987d];var _0x3495ab=this[_0x58d3('0x14')][_0x5373ce];if(_0x3495ab[_0x58d3('0x3b')]===Number(this[_0x58d3('0x13')][_0x5dd286[_0x58d3('0x2d')]][_0x58d3('0x38')])){this['emit'](util[_0x58d3('0x39')](_0x58d3('0x3a'),_0x3495ab[_0x58d3('0x6c')]),_0x58d3('0x92'),{'id':_0x3495ab['id'],'destaccountcode':_0x3495ab[_0x58d3('0x3b')],'transfer':this[_0x58d3('0x13')][_0x5dd286[_0x58d3('0x2d')]][_0x58d3('0x94')]});break;}}}}var _0x221e0e=this;Promise[_0x58d3('0x95')]()[_0x58d3('0x96')](function(){var _0x49b3c4=_0x221e0e['channels'][_0x5dd286[_0x58d3('0x2d')]];if(typeof _0x49b3c4['transferType']===_0x58d3('0x48'))return;if(_['isEmpty'](_0x49b3c4[_0x58d3('0x76')]))return;return RpcSetting[_0x58d3('0x97')]()['then'](function(_0x44271d){if(!_0x44271d[_0x58d3('0x98')])return;return Promise[_0x58d3('0x95')]()[_0x58d3('0x96')](function(){return ami[_0x58d3('0x99')]({'action':_0x58d3('0x9a'),'channel':_0x49b3c4[_0x58d3('0x36')]})[_0x58d3('0x9b')](function(){});})[_0x58d3('0x96')](function(){return ami[_0x58d3('0x99')]({'action':_0x58d3('0x9a'),'channel':_0x49b3c4[_0x58d3('0x65')]})[_0x58d3('0x9b')](function(){})[_0x58d3('0x9c')](function(){var _0x121b60=_0x221e0e['agents'][_0x49b3c4['destinationchannel'][_0x58d3('0x35')]('-')[0x0]];if(!_0x121b60)return;io['emit'](_0x58d3('0x9d'),{'agentId':_0x121b60['id'],'uniqueid':_0x49b3c4['uniqueid']});});});});})[_0x58d3('0x96')](function(){if(_0x5dd286['event']==='BlindTransfer'){_0x221e0e[_0x58d3('0x15')][_0x5dd286[_0x58d3('0x2d')]]=_0x5dd286;}else{if(_0x221e0e[_0x58d3('0x13')][_0x5dd286[_0x58d3('0x2d')]]['type']===_0x58d3('0x9e')&&_0x221e0e[_0x58d3('0x15')][_0x5dd286[_0x58d3('0x2d')]]){_0x221e0e['channels'][_0x5dd286[_0x58d3('0x2d')]][_0x58d3('0x2d')]=[_0x221e0e['channels'][_0x5dd286['uniqueid']]['linkedid'],_0x221e0e[_0x58d3('0x13')][_0x5dd286[_0x58d3('0x2d')]][_0x58d3('0x41')]=_0x221e0e[_0x58d3('0x13')][_0x5dd286['uniqueid']][_0x58d3('0x2d')]][0x0];delete _0x221e0e[_0x58d3('0x15')][_0x5dd286['uniqueid']];}}logger[_0x58d3('0x3e')](_0x58d3('0x9f'),_0x5dd286[_0x58d3('0x2d')],util[_0x58d3('0x27')](_0x221e0e['channels'][_0x5dd286[_0x58d3('0x2d')]],{'showHidden':![],'depth':null}));ami[_0x58d3('0x2a')](_0x58d3('0xa0'),_0x221e0e[_0x58d3('0x13')][_0x5dd286[_0x58d3('0x2d')]]);delete _0x221e0e['channels'][_0x5dd286[_0x58d3('0x2d')]];});}}}catch(_0x43142e){logger[_0x58d3('0x4b')](_0x58d3('0xa1'),_0x5dd286[_0x58d3('0x2d')],util[_0x58d3('0x27')](_0x43142e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x58d3('0x28')]['syncAttendedTransfer']=function(_0x54a343){try{if(this[_0x58d3('0x2b')](_0x54a343)){logger[_0x58d3('0x2c')](_0x58d3('0xa2'),_0x54a343['uniqueid'],_0x54a343[_0x58d3('0xa3')],_0x54a343['transfertargetcalleridnum']);logger[_0x58d3('0x3e')](_0x58d3('0xa4'),_0x54a343['uniqueid'],util[_0x58d3('0x27')](_0x54a343,{'showHidden':![],'depth':null}));var _0x3623a8;if(this['channels'][_0x54a343[_0x58d3('0xa5')]]){this[_0x58d3('0x13')][_0x54a343[_0x58d3('0xa5')]]['transfercalleridnum']=_0x54a343[_0x58d3('0xa3')];this['channels'][_0x54a343[_0x58d3('0xa5')]]['transferconnectedlinenum']=_0x54a343['transfertargetcalleridnum'];if(this['channels'][_0x54a343[_0x58d3('0xa6')]]){_0x3623a8=this[_0x58d3('0x13')][_0x54a343[_0x58d3('0xa6')]];this[_0x58d3('0x13')][_0x54a343[_0x58d3('0xa6')]]=this[_0x58d3('0x13')][_0x54a343[_0x58d3('0xa5')]];this[_0x58d3('0x13')][_0x54a343[_0x58d3('0xa5')]]=_0x3623a8;}this[_0x58d3('0x13')][_0x54a343[_0x58d3('0xa6')]][_0x58d3('0x94')]=_0x58d3('0xa7');}else if(this['channels'][_0x54a343['transfertargetuniqueid']]){this['channels'][_0x54a343[_0x58d3('0xa8')]][_0x58d3('0xa9')]=_0x54a343[_0x58d3('0xa3')];this['channels'][_0x54a343[_0x58d3('0xa8')]]['transferconnectedlinenum']=_0x54a343[_0x58d3('0xaa')];if(this[_0x58d3('0x13')][_0x54a343[_0x58d3('0xab')]]){_0x3623a8=this['channels'][_0x54a343[_0x58d3('0xab')]];this[_0x58d3('0x13')][_0x54a343[_0x58d3('0xab')]]=this[_0x58d3('0x13')][_0x54a343[_0x58d3('0xa8')]];this[_0x58d3('0x13')][_0x54a343['transfertargetuniqueid']]=_0x3623a8;}this[_0x58d3('0x13')][_0x54a343['transfertargetuniqueid']][_0x58d3('0x94')]=_0x58d3('0xa7');}if((this[_0x58d3('0x13')][_0x54a343[_0x58d3('0xab')]]||this[_0x58d3('0x13')][_0x54a343[_0x58d3('0xac')]])&&this[_0x58d3('0x13')][_0x54a343[_0x58d3('0xa6')]]){var _0x23c12d=_[_0x58d3('0xad')]([this[_0x58d3('0x13')][_0x54a343['origtransfereruniqueid']],this[_0x58d3('0x13')][_0x54a343[_0x58d3('0xac')]],this[_0x58d3('0x13')][_0x54a343[_0x58d3('0xa6')]]],function(_0x28134d){return _0x28134d&&_0x28134d[_0x58d3('0x5c')]==='outbound'&&_0x28134d['routeid'];});if(_0x23c12d){if(this[_0x58d3('0x13')][_0x54a343[_0x58d3('0xab')]])this[_0x58d3('0x13')][_0x54a343['origtransfereruniqueid']][_0x58d3('0x94')]=_0x58d3('0xa7');if(this[_0x58d3('0x13')][_0x54a343[_0x58d3('0xac')]])this[_0x58d3('0x13')][_0x54a343['origtransfererlinkedid']][_0x58d3('0x94')]=_0x58d3('0xa7');this[_0x58d3('0x13')][_0x54a343[_0x58d3('0xa6')]]['transferType']='ATTENDED';}}}}catch(_0x21d683){logger['error'](_0x58d3('0xae'),_0x54a343[_0x58d3('0x2d')],util[_0x58d3('0x27')](_0x21d683,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x58d3('0x28')][_0x58d3('0x21')]=function(_0x22d0a5){try{if(this[_0x58d3('0x2b')](_0x22d0a5)){logger[_0x58d3('0x2c')](_0x58d3('0xaf'),_0x22d0a5[_0x58d3('0x2d')],_0x22d0a5[_0x58d3('0xb0')],_0x22d0a5['extension']);logger[_0x58d3('0x3e')]('[%s][voiceCallReport][blindtransfer]\x20event:',_0x22d0a5[_0x58d3('0x2d')],util[_0x58d3('0x27')](_0x22d0a5,{'showHidden':![],'depth':null}));if(this[_0x58d3('0x13')][_0x22d0a5[_0x58d3('0xa5')]]){this[_0x58d3('0x13')][_0x22d0a5[_0x58d3('0xa5')]]['transfercalleridnum']=_0x22d0a5['transfereecalleridnum'];this[_0x58d3('0x13')][_0x22d0a5[_0x58d3('0xa5')]][_0x58d3('0xb1')]=_0x22d0a5[_0x58d3('0xb2')];this[_0x58d3('0x13')][_0x22d0a5[_0x58d3('0xa5')]][_0x58d3('0x94')]=_0x58d3('0xb3');this[_0x58d3('0x1c')]({'event':_0x58d3('0xb4'),'uniqueid':_0x22d0a5[_0x58d3('0xa5')],'linkedid':_0x22d0a5[_0x58d3('0xb5')],'context':_0x22d0a5['context'],'channel':_0x22d0a5[_0x58d3('0xb6')]});}else{this['channels'][_0x22d0a5[_0x58d3('0xb5')]]['transferType']=_0x58d3('0xb3');this[_0x58d3('0x1c')]({'event':_0x58d3('0xb4'),'uniqueid':_0x22d0a5[_0x58d3('0xb5')],'linkedid':_0x22d0a5[_0x58d3('0xa5')],'context':_0x22d0a5[_0x58d3('0x33')],'channel':_0x22d0a5['transfererchannel']});}}}catch(_0x5b4f65){logger[_0x58d3('0x4b')](_0x58d3('0xb7'),_0x22d0a5[_0x58d3('0x2d')],util[_0x58d3('0x27')](_0x5b4f65,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x58d3('0x28')][_0x58d3('0xb8')]=function(_0x554704){try{if(this[_0x58d3('0x2b')](_0x554704)){logger[_0x58d3('0x3e')]('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x554704[_0x58d3('0x2d')],util['inspect'](_0x554704,{'showHidden':![],'depth':null}));if(this['channels'][_0x554704[_0x58d3('0x2d')]]){if(!_[_0x58d3('0x5d')](this[_0x58d3('0x13')][_0x554704['uniqueid']]['answertime'])){this['channels'][_0x554704[_0x58d3('0x2d')]][_0x58d3('0xb9')]=moment()[_0x58d3('0x39')](_0x58d3('0x44'));logger[_0x58d3('0x2c')](_0x58d3('0xba'),_0x554704['uniqueid'],this[_0x58d3('0x13')][_0x554704[_0x58d3('0x2d')]][_0x58d3('0xb9')]);}}}}catch(_0xa2287){logger[_0x58d3('0x4b')](_0x58d3('0xbb'),_0x554704[_0x58d3('0x2d')],util[_0x58d3('0x27')](_0xa2287,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x58d3('0x28')][_0x58d3('0x24')]=function(_0x588997){try{if(this['isNotNull'](_0x588997)){logger[_0x58d3('0x3e')](_0x58d3('0xbc'),_0x588997[_0x58d3('0x2d')],util[_0x58d3('0x27')](_0x588997,{'showHidden':![],'depth':null}));if(this['channels'][_0x588997[_0x58d3('0x2d')]]){if(!_['isNil'](this['channels'][_0x588997[_0x58d3('0x2d')]]['mohstarttime'])){this[_0x58d3('0x13')][_0x588997[_0x58d3('0x2d')]][_0x58d3('0xbd')]+=moment()[_0x58d3('0xbe')](0x0)[_0x58d3('0x69')](this[_0x58d3('0x13')][_0x588997['uniqueid']][_0x58d3('0xb9')],_0x58d3('0x57'));logger[_0x58d3('0x2c')]('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x588997[_0x58d3('0x2d')],this['channels'][_0x588997['uniqueid']][_0x58d3('0xbd')]);delete this[_0x58d3('0x13')][_0x588997[_0x58d3('0x2d')]][_0x58d3('0xb9')];}}}}catch(_0x4753fa){logger[_0x58d3('0x4b')](_0x58d3('0xbf'),_0x588997['uniqueid'],util['inspect'](_0x4753fa,{'showHidden':![],'depth':null}));}};module[_0x58d3('0xc0')]=VoiceCallReport;
\ No newline at end of file
index 43f06e9..b97168a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd51=['omit','event','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','applications','voice:outbound','voice_outbound_channel:save','custom:dialbegin','error','[%s][voiceDialReport][dialend]\x20event:','dialstatus','connectedlinenum','connectedlinename','answertime','format','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','value','outboundrouteid','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','endtime','duration','diff','starttime','lastevent','complete','answered','holdtime','seconds','billableseconds','sumHoldTime','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','appdata','startsWith','cdr(','split','match','[%s][voiceDialReport][newexten]','exports','lodash','util','ioredis','../../../config/environment','../../../config/logger','redis','localhost','socket.io-emitter','channels','outboundChannels','outbound','variables','syncDialBegin','bind','dialend','syncDialEnd','varset','syncHangup','prototype','isNotNull','isUndefined','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf'];(function(_0x2baf40,_0x5ebef2){var _0x2bb2cb=function(_0x1a3fc1){while(--_0x1a3fc1){_0x2baf40['push'](_0x2baf40['shift']());}};_0x2bb2cb(++_0x5ebef2);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x2fd8c8,_0x5f3549){_0x2fd8c8=_0x2fd8c8-0x0;var _0x4cd972=_0xbd51[_0x2fd8c8];return _0x4cd972;};'use strict';var _=require(_0x1bd5('0x0'));var moment=require('moment');var util=require(_0x1bd5('0x1'));var Redis=require(_0x1bd5('0x2'));var config=require(_0x1bd5('0x3'));var logger=require(_0x1bd5('0x4'))('ami');var ami=require('../ami');config['redis']=_['defaults'](config[_0x1bd5('0x5')],{'host':_0x1bd5('0x6'),'port':0x18eb});var io=require(_0x1bd5('0x7'))(new Redis(config['redis']));function VoiceDialReport(_0x29abea){this[_0x1bd5('0x8')]=_0x29abea[_0x1bd5('0x9')];this[_0x1bd5('0xa')]=_0x29abea[_0x1bd5('0xa')];this['applications']={};this[_0x1bd5('0xb')]={};ami['on']('dialbegin',this[_0x1bd5('0xc')][_0x1bd5('0xd')](this));ami['on'](_0x1bd5('0xe'),this[_0x1bd5('0xf')][_0x1bd5('0xd')](this));ami['on'](_0x1bd5('0x10'),this['syncVarSet'][_0x1bd5('0xd')](this));ami['on']('hangup',this[_0x1bd5('0x11')][_0x1bd5('0xd')](this));}VoiceDialReport[_0x1bd5('0x12')][_0x1bd5('0x13')]=function(_0x177be0){return _0x177be0!==null&&!_[_0x1bd5('0x14')](_0x177be0);};VoiceDialReport[_0x1bd5('0x12')]['emit']=function(_0x5650b5,_0x8b2390,_0x6d2c40){io['to'](_0x5650b5)[_0x1bd5('0x15')](_0x8b2390,_0x6d2c40);};VoiceDialReport[_0x1bd5('0x12')]['syncDialBegin']=function(_0x5072c2){try{if(this[_0x1bd5('0x13')](_0x5072c2)){logger[_0x1bd5('0x16')](_0x1bd5('0x17'),_0x5072c2[_0x1bd5('0x18')],util[_0x1bd5('0x19')](_0x5072c2,{'showHidden':![],'depth':null}));if(this[_0x1bd5('0x8')][_0x5072c2[_0x1bd5('0x18')]]){_[_0x1bd5('0x1a')](this[_0x1bd5('0x8')][_0x5072c2['uniqueid']],{'starttime':moment()['format'](_0x1bd5('0x1b')),'lastevent':_0x1bd5('0x1c'),'interface':_0x5072c2[_0x1bd5('0x1d')][_0x1bd5('0x1e')](0x0,_0x5072c2[_0x1bd5('0x1d')][_0x1bd5('0x1f')]('-')),'membername':_0x5072c2[_0x1bd5('0x1d')][_0x1bd5('0x1e')](_0x5072c2[_0x1bd5('0x1d')][_0x1bd5('0x1f')]('/')+0x1,_0x5072c2[_0x1bd5('0x1d')][_0x1bd5('0x1f')]('-'))},_[_0x1bd5('0x20')](_0x5072c2,[_0x1bd5('0x21'),_0x1bd5('0x22')]));logger[_0x1bd5('0x23')](_0x1bd5('0x24'),_0x5072c2[_0x1bd5('0x18')],this['channels'][_0x5072c2[_0x1bd5('0x18')]]['membername'],this[_0x1bd5('0x8')][_0x5072c2[_0x1bd5('0x18')]][_0x1bd5('0x25')]);logger['debug'](_0x1bd5('0x26'),_0x5072c2['uniqueid'],util[_0x1bd5('0x19')](this[_0x1bd5('0x8')][_0x5072c2[_0x1bd5('0x18')]],{'showHidden':![],'depth':null}));if(this[_0x1bd5('0x27')][_0x5072c2['uniqueid']])_[_0x1bd5('0x1a')](this[_0x1bd5('0x8')][_0x5072c2[_0x1bd5('0x18')]],this[_0x1bd5('0x27')][_0x5072c2['uniqueid']]);this[_0x1bd5('0x15')](_0x1bd5('0x28'),_0x1bd5('0x29'),this[_0x1bd5('0x8')][_0x5072c2[_0x1bd5('0x18')]]);logger[_0x1bd5('0x16')]('[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:',_0x5072c2[_0x1bd5('0x18')],util[_0x1bd5('0x19')](this[_0x1bd5('0x8')][_0x5072c2['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x1bd5('0x15')](_0x1bd5('0x2a'),this[_0x1bd5('0x8')][_0x5072c2[_0x1bd5('0x18')]]);}}}catch(_0x1f4456){logger[_0x1bd5('0x2b')]('[%s][voiceDialReport][dialbegin]',_0x5072c2['uniqueid'],util[_0x1bd5('0x19')](_0x1f4456,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x1bd5('0x12')]['syncDialEnd']=function(_0x36649d){try{if(this[_0x1bd5('0x13')](_0x36649d)){logger[_0x1bd5('0x16')](_0x1bd5('0x2c'),_0x36649d['uniqueid'],util[_0x1bd5('0x19')](_0x36649d,{'showHidden':![],'depth':null}));if(this[_0x1bd5('0x8')][_0x36649d[_0x1bd5('0x18')]]){this[_0x1bd5('0x8')][_0x36649d[_0x1bd5('0x18')]][_0x1bd5('0x2d')]=_0x36649d[_0x1bd5('0x2d')];if(_0x36649d[_0x1bd5('0x2d')]==='ANSWER'){this[_0x1bd5('0x8')][_0x36649d[_0x1bd5('0x18')]][_0x1bd5('0x2e')]=_0x36649d[_0x1bd5('0x2e')];this[_0x1bd5('0x8')][_0x36649d[_0x1bd5('0x18')]][_0x1bd5('0x2f')]=_0x36649d['connectedlinename'];this[_0x1bd5('0x8')][_0x36649d[_0x1bd5('0x18')]][_0x1bd5('0x30')]=moment()[_0x1bd5('0x31')](_0x1bd5('0x1b'));this[_0x1bd5('0x8')][_0x36649d[_0x1bd5('0x18')]]['lastevent']='connect';logger[_0x1bd5('0x23')](_0x1bd5('0x32'),_0x36649d[_0x1bd5('0x18')],_0x36649d['channel'][_0x1bd5('0x1e')](_0x36649d['channel'][_0x1bd5('0x1f')]('/')+0x1,_0x36649d[_0x1bd5('0x1d')][_0x1bd5('0x1f')]('-')));logger[_0x1bd5('0x16')](_0x1bd5('0x33'),_0x36649d[_0x1bd5('0x18')],util[_0x1bd5('0x19')](this[_0x1bd5('0x8')][_0x36649d['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x1bd5('0x15')](_0x1bd5('0x34'),this['channels'][_0x36649d[_0x1bd5('0x18')]]);}logger[_0x1bd5('0x16')](_0x1bd5('0x35'),_0x36649d['uniqueid'],util[_0x1bd5('0x19')](this[_0x1bd5('0x8')][_0x36649d[_0x1bd5('0x18')]],{'showHidden':![],'depth':null}));this[_0x1bd5('0x15')]('voice:outbound',_0x1bd5('0x29'),this[_0x1bd5('0x8')][_0x36649d[_0x1bd5('0x18')]]);}}}catch(_0x11e996){logger['error']('[%s][voiceDialReport][dialend]',_0x36649d[_0x1bd5('0x18')],util[_0x1bd5('0x19')](_0x11e996,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x1bd5('0x12')]['syncVarSet']=function(_0x2a28c6){try{if(this[_0x1bd5('0x13')](_0x2a28c6)){logger['debug'](_0x1bd5('0x36'),_0x2a28c6['uniqueid'],util[_0x1bd5('0x19')](_0x2a28c6,{'showHidden':![],'depth':null}));this[_0x1bd5('0x37')](_0x2a28c6['uniqueid'],_[_0x1bd5('0x38')](_0x2a28c6[_0x1bd5('0x39')])[0x0],_0x2a28c6[_0x1bd5('0x3a')]);if(this[_0x1bd5('0x13')](_0x2a28c6[_0x1bd5('0x39')])&&this[_0x1bd5('0x13')](_0x2a28c6[_0x1bd5('0x39')][_0x1bd5('0x3b')])){if(_[_0x1bd5('0x14')](this[_0x1bd5('0x8')][_0x2a28c6[_0x1bd5('0x18')]])){this[_0x1bd5('0x8')][_0x2a28c6['uniqueid']]={'routeId':_0x2a28c6[_0x1bd5('0x3a')],'variables':this[_0x1bd5('0xb')][_0x2a28c6[_0x1bd5('0x18')]],'motionChannel':'voice'};logger[_0x1bd5('0x23')](_0x1bd5('0x3c'),_0x2a28c6['uniqueid'],_0x2a28c6[_0x1bd5('0x39')]['outboundrouteid'],_[_0x1bd5('0x38')](_0x2a28c6['variable'])[0x0],_0x2a28c6[_0x1bd5('0x3a')]);logger[_0x1bd5('0x16')]('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x2a28c6[_0x1bd5('0x18')],util['inspect'](this[_0x1bd5('0x8')][_0x2a28c6[_0x1bd5('0x18')]],{'showHidden':![],'depth':null}));this[_0x1bd5('0x15')](_0x1bd5('0x28'),_0x1bd5('0x29'),this[_0x1bd5('0x8')][_0x2a28c6[_0x1bd5('0x18')]]);}}}}catch(_0x308de2){logger['error'](_0x1bd5('0x3d'),_0x2a28c6[_0x1bd5('0x18')],util[_0x1bd5('0x19')](_0x308de2,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x1bd5('0x12')][_0x1bd5('0x37')]=function(_0x1c4c20,_0x593f80,_0x45925d){var _0x121bfb=[_0x1bd5('0x3e'),_0x1bd5('0x3f'),_0x1bd5('0x40'),_0x1bd5('0x41'),_0x1bd5('0x42'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0x1bd5('0x43'),_0x1bd5('0x44'),_0x1bd5('0x45'),'bridgepeer',_0x1bd5('0x46'),_0x1bd5('0x47'),_0x1bd5('0x48'),_0x1bd5('0x49'),_0x1bd5('0x4a'),_0x1bd5('0x4b'),_0x1bd5('0x4c'),'memberrealtime'];if(!_[_0x1bd5('0x4d')](_0x593f80)&&!_[_0x1bd5('0x4e')](_0x121bfb,_0x593f80)){if(_['isUndefined'](this[_0x1bd5('0xb')][_0x1c4c20])){this['variables'][_0x1c4c20]={};}this[_0x1bd5('0xb')][_0x1c4c20][_0x593f80]=_0x45925d;}};VoiceDialReport['prototype'][_0x1bd5('0x11')]=function(_0x555ba1){try{if(this['isNotNull'](_0x555ba1)){logger[_0x1bd5('0x16')](_0x1bd5('0x4f'),_0x555ba1[_0x1bd5('0x18')],util[_0x1bd5('0x19')](_0x555ba1,{'showHidden':![],'depth':null}));if(this[_0x1bd5('0x8')][_0x555ba1[_0x1bd5('0x18')]]){logger[_0x1bd5('0x23')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x555ba1[_0x1bd5('0x18')],_0x555ba1['cause-txt']);this[_0x1bd5('0x8')][_0x555ba1[_0x1bd5('0x18')]][_0x1bd5('0x50')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x1bd5('0x8')][_0x555ba1[_0x1bd5('0x18')]][_0x1bd5('0x51')]=moment(this[_0x1bd5('0x8')][_0x555ba1[_0x1bd5('0x18')]][_0x1bd5('0x50')])[_0x1bd5('0x52')](this[_0x1bd5('0x8')][_0x555ba1[_0x1bd5('0x18')]][_0x1bd5('0x53')],'seconds');this[_0x1bd5('0x8')][_0x555ba1['uniqueid']][_0x1bd5('0x54')]=_0x1bd5('0x55');this[_0x1bd5('0xa')]['total']+=0x1;if(this[_0x1bd5('0x8')][_0x555ba1[_0x1bd5('0x18')]][_0x1bd5('0x30')]){this['outbound'][_0x1bd5('0x56')]+=0x1;this[_0x1bd5('0x8')][_0x555ba1[_0x1bd5('0x18')]][_0x1bd5('0x57')]=moment(this['channels'][_0x555ba1['uniqueid']][_0x1bd5('0x30')])[_0x1bd5('0x52')](this[_0x1bd5('0x8')][_0x555ba1['uniqueid']]['starttime'],_0x1bd5('0x58'));this['channels'][_0x555ba1[_0x1bd5('0x18')]][_0x1bd5('0x59')]=moment(this['channels'][_0x555ba1[_0x1bd5('0x18')]]['endtime'])[_0x1bd5('0x52')](this['channels'][_0x555ba1[_0x1bd5('0x18')]][_0x1bd5('0x30')],'seconds');this[_0x1bd5('0xa')][_0x1bd5('0x5a')]+=this['channels'][_0x555ba1['uniqueid']][_0x1bd5('0x57')]||0x0;this[_0x1bd5('0xa')]['sumBillable']+=this[_0x1bd5('0x8')][_0x555ba1[_0x1bd5('0x18')]]['billableseconds'];}this['outbound'][_0x1bd5('0x5b')]+=this[_0x1bd5('0x8')][_0x555ba1[_0x1bd5('0x18')]]['duration'];logger[_0x1bd5('0x16')](_0x1bd5('0x5c'),_0x555ba1['uniqueid'],util['inspect'](this[_0x1bd5('0x8')][_0x555ba1[_0x1bd5('0x18')]],{'showHidden':![],'depth':null}));ami[_0x1bd5('0x15')](_0x1bd5('0x5d'),this[_0x1bd5('0x8')][_0x555ba1['uniqueid']]);logger[_0x1bd5('0x16')]('[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:',_0x555ba1[_0x1bd5('0x18')],util[_0x1bd5('0x19')](this[_0x1bd5('0x8')][_0x555ba1[_0x1bd5('0x18')]],{'showHidden':![],'depth':null}));ami['emit']('custom:dialend',this[_0x1bd5('0x8')][_0x555ba1[_0x1bd5('0x18')]]);logger[_0x1bd5('0x16')](_0x1bd5('0x5e'),_0x555ba1[_0x1bd5('0x18')],util[_0x1bd5('0x19')](this[_0x1bd5('0x8')][_0x555ba1[_0x1bd5('0x18')]],{'showHidden':![],'depth':null}));this[_0x1bd5('0x15')](_0x1bd5('0x28'),_0x1bd5('0x5f'),this[_0x1bd5('0xa')]);logger[_0x1bd5('0x23')](_0x1bd5('0x60'),JSON[_0x1bd5('0x61')](this[_0x1bd5('0x8')][_0x555ba1[_0x1bd5('0x18')]]));logger[_0x1bd5('0x16')](_0x1bd5('0x62'),_0x555ba1[_0x1bd5('0x18')],util[_0x1bd5('0x19')](this[_0x1bd5('0x8')][_0x555ba1[_0x1bd5('0x18')]],{'showHidden':![],'depth':null}));this[_0x1bd5('0x15')]('voice:outbound',_0x1bd5('0x63'),this[_0x1bd5('0x8')][_0x555ba1[_0x1bd5('0x18')]]);delete this[_0x1bd5('0x8')][_0x555ba1[_0x1bd5('0x18')]];}else if(this[_0x1bd5('0x8')][_0x555ba1[_0x1bd5('0x64')]]){this['channels'][_0x555ba1[_0x1bd5('0x64')]][_0x1bd5('0x18')]=this[_0x1bd5('0x8')][_0x555ba1[_0x1bd5('0x64')]]['destuniqueid'];}if(this[_0x1bd5('0xb')][_0x555ba1[_0x1bd5('0x18')]]){delete this[_0x1bd5('0xb')][_0x555ba1[_0x1bd5('0x18')]];}}}catch(_0x1ca3b6){logger[_0x1bd5('0x2b')](_0x1bd5('0x65'),_0x555ba1['uniqueid'],util[_0x1bd5('0x19')](_0x1ca3b6,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncNewExten']=function(_0x34f98c){try{if(this['isNotNull'](_0x34f98c)){logger[_0x1bd5('0x16')](_0x1bd5('0x66'),_0x34f98c['uniqueid'],util[_0x1bd5('0x19')](_0x34f98c,{'showHidden':![],'depth':null}));if(_0x34f98c[_0x1bd5('0x67')][_0x1bd5('0x68')]()===_0x1bd5('0x69')){_0x34f98c[_0x1bd5('0x6a')]=(_0x34f98c[_0x1bd5('0x6b')]||_0x34f98c['applicationdata'])[_0x1bd5('0x68')]();if(_[_0x1bd5('0x6c')](_0x34f98c[_0x1bd5('0x6a')],_0x1bd5('0x6d'))){if(_['isUndefined'](this['applications'][_0x34f98c[_0x1bd5('0x18')]]))this[_0x1bd5('0x27')][_0x34f98c[_0x1bd5('0x18')]]={};logger[_0x1bd5('0x23')]('[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s',_0x34f98c[_0x1bd5('0x18')],_0x34f98c['application'],_0x34f98c['applicationdata']);var _0x3a203f=_0x34f98c['applicationdata'][_0x1bd5('0x6e')]('=');var _0xefa91b=_0x3a203f[0x0][_0x1bd5('0x6f')](/cdr\((.*)\)/);if(_0xefa91b)this[_0x1bd5('0x27')][_0x34f98c[_0x1bd5('0x18')]][_0xefa91b[0x1]]=_0x3a203f[0x1];}}}}catch(_0xab4ed6){logger[_0x1bd5('0x2b')](_0x1bd5('0x70'),_0x34f98c[_0x1bd5('0x18')],util['inspect'](_0xab4ed6,{'showHidden':![],'depth':null}));}};module[_0x1bd5('0x71')]=VoiceDialReport;
\ No newline at end of file
+var _0x5fab=['[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','set','applicationdata','appdata','toLowerCase','startsWith','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','match','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','variables','dialbegin','dialend','syncDialEnd','bind','varset','syncVarSet','hangup','syncHangup','isNotNull','prototype','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','inspect','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','isUndefined','value','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','outboundrouteid','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','diff','starttime','seconds','complete','total','holdtime','billableseconds','sumHoldTime','sumBillable','duration','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','linkedid'];(function(_0x3b90ab,_0x174a22){var _0x206e92=function(_0x21fbd3){while(--_0x21fbd3){_0x3b90ab['push'](_0x3b90ab['shift']());}};_0x206e92(++_0x174a22);}(_0x5fab,0x177));var _0xb5fa=function(_0x36acb3,_0x204e94){_0x36acb3=_0x36acb3-0x0;var _0x13976c=_0x5fab[_0x36acb3];return _0x13976c;};'use strict';var _=require(_0xb5fa('0x0'));var moment=require(_0xb5fa('0x1'));var util=require('util');var Redis=require(_0xb5fa('0x2'));var config=require(_0xb5fa('0x3'));var logger=require(_0xb5fa('0x4'))(_0xb5fa('0x5'));var ami=require(_0xb5fa('0x6'));config[_0xb5fa('0x7')]=_[_0xb5fa('0x8')](config[_0xb5fa('0x7')],{'host':_0xb5fa('0x9'),'port':0x18eb});var io=require(_0xb5fa('0xa'))(new Redis(config['redis']));function VoiceDialReport(_0x5d70f6){this[_0xb5fa('0xb')]=_0x5d70f6[_0xb5fa('0xc')];this[_0xb5fa('0xd')]=_0x5d70f6['outbound'];this[_0xb5fa('0xe')]={};this[_0xb5fa('0xf')]={};ami['on'](_0xb5fa('0x10'),this['syncDialBegin']['bind'](this));ami['on'](_0xb5fa('0x11'),this[_0xb5fa('0x12')][_0xb5fa('0x13')](this));ami['on'](_0xb5fa('0x14'),this[_0xb5fa('0x15')][_0xb5fa('0x13')](this));ami['on'](_0xb5fa('0x16'),this[_0xb5fa('0x17')][_0xb5fa('0x13')](this));}VoiceDialReport['prototype'][_0xb5fa('0x18')]=function(_0x3dad4d){return _0x3dad4d!==null&&!_['isUndefined'](_0x3dad4d);};VoiceDialReport[_0xb5fa('0x19')]['emit']=function(_0x265992,_0x3fc372,_0x40c914){io['to'](_0x265992)[_0xb5fa('0x1a')](_0x3fc372,_0x40c914);};VoiceDialReport[_0xb5fa('0x19')]['syncDialBegin']=function(_0x567f31){try{if(this[_0xb5fa('0x18')](_0x567f31)){logger[_0xb5fa('0x1b')](_0xb5fa('0x1c'),_0x567f31[_0xb5fa('0x1d')],util['inspect'](_0x567f31,{'showHidden':![],'depth':null}));if(this['channels'][_0x567f31[_0xb5fa('0x1d')]]){_[_0xb5fa('0x1e')](this[_0xb5fa('0xb')][_0x567f31[_0xb5fa('0x1d')]],{'starttime':moment()[_0xb5fa('0x1f')](_0xb5fa('0x20')),'lastevent':_0xb5fa('0x21'),'interface':_0x567f31[_0xb5fa('0x22')][_0xb5fa('0x23')](0x0,_0x567f31[_0xb5fa('0x22')][_0xb5fa('0x24')]('-')),'membername':_0x567f31[_0xb5fa('0x22')]['substring'](_0x567f31[_0xb5fa('0x22')]['lastIndexOf']('/')+0x1,_0x567f31[_0xb5fa('0x22')]['lastIndexOf']('-'))},_[_0xb5fa('0x25')](_0x567f31,[_0xb5fa('0x26'),'privilege']));logger[_0xb5fa('0x27')](_0xb5fa('0x28'),_0x567f31[_0xb5fa('0x1d')],this['channels'][_0x567f31[_0xb5fa('0x1d')]][_0xb5fa('0x29')],this[_0xb5fa('0xb')][_0x567f31['uniqueid']][_0xb5fa('0x2a')]);logger['debug'](_0xb5fa('0x2b'),_0x567f31[_0xb5fa('0x1d')],util[_0xb5fa('0x2c')](this[_0xb5fa('0xb')][_0x567f31[_0xb5fa('0x1d')]],{'showHidden':![],'depth':null}));if(this[_0xb5fa('0xe')][_0x567f31[_0xb5fa('0x1d')]])_[_0xb5fa('0x1e')](this['channels'][_0x567f31['uniqueid']],this['applications'][_0x567f31['uniqueid']]);this[_0xb5fa('0x1a')](_0xb5fa('0x2d'),_0xb5fa('0x2e'),this[_0xb5fa('0xb')][_0x567f31[_0xb5fa('0x1d')]]);logger[_0xb5fa('0x1b')](_0xb5fa('0x2f'),_0x567f31[_0xb5fa('0x1d')],util[_0xb5fa('0x2c')](this[_0xb5fa('0xb')][_0x567f31[_0xb5fa('0x1d')]],{'showHidden':![],'depth':null}));ami[_0xb5fa('0x1a')](_0xb5fa('0x30'),this[_0xb5fa('0xb')][_0x567f31[_0xb5fa('0x1d')]]);}}}catch(_0x116773){logger[_0xb5fa('0x31')](_0xb5fa('0x32'),_0x567f31[_0xb5fa('0x1d')],util[_0xb5fa('0x2c')](_0x116773,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xb5fa('0x19')][_0xb5fa('0x12')]=function(_0x10fb43){try{if(this[_0xb5fa('0x18')](_0x10fb43)){logger['debug'](_0xb5fa('0x33'),_0x10fb43['uniqueid'],util['inspect'](_0x10fb43,{'showHidden':![],'depth':null}));if(this['channels'][_0x10fb43[_0xb5fa('0x1d')]]){this['channels'][_0x10fb43[_0xb5fa('0x1d')]]['dialstatus']=_0x10fb43['dialstatus'];if(_0x10fb43[_0xb5fa('0x34')]===_0xb5fa('0x35')){this['channels'][_0x10fb43['uniqueid']][_0xb5fa('0x36')]=_0x10fb43[_0xb5fa('0x36')];this[_0xb5fa('0xb')][_0x10fb43['uniqueid']][_0xb5fa('0x37')]=_0x10fb43[_0xb5fa('0x37')];this['channels'][_0x10fb43[_0xb5fa('0x1d')]][_0xb5fa('0x38')]=moment()[_0xb5fa('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xb5fa('0xb')][_0x10fb43[_0xb5fa('0x1d')]][_0xb5fa('0x39')]='connect';logger[_0xb5fa('0x27')](_0xb5fa('0x3a'),_0x10fb43[_0xb5fa('0x1d')],_0x10fb43[_0xb5fa('0x22')]['substring'](_0x10fb43['channel']['lastIndexOf']('/')+0x1,_0x10fb43['channel']['lastIndexOf']('-')));logger['debug'](_0xb5fa('0x3b'),_0x10fb43['uniqueid'],util[_0xb5fa('0x2c')](this[_0xb5fa('0xb')][_0x10fb43[_0xb5fa('0x1d')]],{'showHidden':![],'depth':null}));ami[_0xb5fa('0x1a')](_0xb5fa('0x3c'),this[_0xb5fa('0xb')][_0x10fb43['uniqueid']]);}logger['debug']('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x10fb43[_0xb5fa('0x1d')],util['inspect'](this[_0xb5fa('0xb')][_0x10fb43['uniqueid']],{'showHidden':![],'depth':null}));this['emit'](_0xb5fa('0x2d'),_0xb5fa('0x2e'),this[_0xb5fa('0xb')][_0x10fb43[_0xb5fa('0x1d')]]);}}}catch(_0x5bc93f){logger[_0xb5fa('0x31')](_0xb5fa('0x3d'),_0x10fb43[_0xb5fa('0x1d')],util[_0xb5fa('0x2c')](_0x5bc93f,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xb5fa('0x19')]['syncVarSet']=function(_0x284bbb){try{if(this['isNotNull'](_0x284bbb)){logger[_0xb5fa('0x1b')](_0xb5fa('0x3e'),_0x284bbb[_0xb5fa('0x1d')],util[_0xb5fa('0x2c')](_0x284bbb,{'showHidden':![],'depth':null}));this[_0xb5fa('0x3f')](_0x284bbb[_0xb5fa('0x1d')],_[_0xb5fa('0x40')](_0x284bbb[_0xb5fa('0x41')])[0x0],_0x284bbb['value']);if(this[_0xb5fa('0x18')](_0x284bbb[_0xb5fa('0x41')])&&this['isNotNull'](_0x284bbb[_0xb5fa('0x41')]['outboundrouteid'])){if(_[_0xb5fa('0x42')](this[_0xb5fa('0xb')][_0x284bbb['uniqueid']])){this['channels'][_0x284bbb[_0xb5fa('0x1d')]]={'routeId':_0x284bbb[_0xb5fa('0x43')],'variables':this[_0xb5fa('0xf')][_0x284bbb[_0xb5fa('0x1d')]],'motionChannel':_0xb5fa('0x44')};logger[_0xb5fa('0x27')](_0xb5fa('0x45'),_0x284bbb[_0xb5fa('0x1d')],_0x284bbb['variable'][_0xb5fa('0x46')],_[_0xb5fa('0x40')](_0x284bbb['variable'])[0x0],_0x284bbb[_0xb5fa('0x43')]);logger[_0xb5fa('0x1b')](_0xb5fa('0x47'),_0x284bbb[_0xb5fa('0x1d')],util[_0xb5fa('0x2c')](this[_0xb5fa('0xb')][_0x284bbb[_0xb5fa('0x1d')]],{'showHidden':![],'depth':null}));this[_0xb5fa('0x1a')](_0xb5fa('0x2d'),_0xb5fa('0x2e'),this[_0xb5fa('0xb')][_0x284bbb[_0xb5fa('0x1d')]]);}}}}catch(_0x6ae261){logger[_0xb5fa('0x31')](_0xb5fa('0x48'),_0x284bbb[_0xb5fa('0x1d')],util['inspect'](_0x6ae261,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xb5fa('0x3f')]=function(_0x55268f,_0x14fbb0,_0x1049d9){var _0x5404f6=[_0xb5fa('0x49'),_0xb5fa('0x4a'),_0xb5fa('0x4b'),_0xb5fa('0x4c'),_0xb5fa('0x4d'),_0xb5fa('0x4e'),'rtpaudioqosrtt',_0xb5fa('0x4f'),'sipcallid',_0xb5fa('0x50'),_0xb5fa('0x51'),_0xb5fa('0x52'),'membercalls',_0xb5fa('0x53'),_0xb5fa('0x54'),'memberlastcall','membername',_0xb5fa('0x55'),_0xb5fa('0x56')];if(!_[_0xb5fa('0x57')](_0x14fbb0)&&!_[_0xb5fa('0x58')](_0x5404f6,_0x14fbb0)){if(_[_0xb5fa('0x42')](this[_0xb5fa('0xf')][_0x55268f])){this[_0xb5fa('0xf')][_0x55268f]={};}this[_0xb5fa('0xf')][_0x55268f][_0x14fbb0]=_0x1049d9;}};VoiceDialReport[_0xb5fa('0x19')][_0xb5fa('0x17')]=function(_0x25de19){try{if(this[_0xb5fa('0x18')](_0x25de19)){logger[_0xb5fa('0x1b')](_0xb5fa('0x59'),_0x25de19[_0xb5fa('0x1d')],util[_0xb5fa('0x2c')](_0x25de19,{'showHidden':![],'depth':null}));if(this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]]){logger['info'](_0xb5fa('0x5a'),_0x25de19[_0xb5fa('0x1d')],_0x25de19[_0xb5fa('0x5b')]);this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]][_0xb5fa('0x5c')]=moment()[_0xb5fa('0x1f')](_0xb5fa('0x20'));this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]]['duration']=moment(this['channels'][_0x25de19[_0xb5fa('0x1d')]][_0xb5fa('0x5c')])[_0xb5fa('0x5d')](this['channels'][_0x25de19[_0xb5fa('0x1d')]][_0xb5fa('0x5e')],_0xb5fa('0x5f'));this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]][_0xb5fa('0x39')]=_0xb5fa('0x60');this['outbound'][_0xb5fa('0x61')]+=0x1;if(this[_0xb5fa('0xb')][_0x25de19['uniqueid']][_0xb5fa('0x38')]){this[_0xb5fa('0xd')]['answered']+=0x1;this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]][_0xb5fa('0x62')]=moment(this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]][_0xb5fa('0x38')])[_0xb5fa('0x5d')](this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]][_0xb5fa('0x5e')],_0xb5fa('0x5f'));this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]][_0xb5fa('0x63')]=moment(this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]][_0xb5fa('0x5c')])[_0xb5fa('0x5d')](this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]][_0xb5fa('0x38')],_0xb5fa('0x5f'));this['outbound'][_0xb5fa('0x64')]+=this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]]['holdtime']||0x0;this[_0xb5fa('0xd')][_0xb5fa('0x65')]+=this['channels'][_0x25de19[_0xb5fa('0x1d')]][_0xb5fa('0x63')];}this[_0xb5fa('0xd')]['sumDuration']+=this['channels'][_0x25de19[_0xb5fa('0x1d')]][_0xb5fa('0x66')];logger[_0xb5fa('0x1b')]('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x25de19[_0xb5fa('0x1d')],util[_0xb5fa('0x2c')](this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]],{'showHidden':![],'depth':null}));ami['emit']('custom:voiceDialReport',this['channels'][_0x25de19[_0xb5fa('0x1d')]]);logger[_0xb5fa('0x1b')](_0xb5fa('0x67'),_0x25de19['uniqueid'],util[_0xb5fa('0x2c')](this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]],{'showHidden':![],'depth':null}));ami[_0xb5fa('0x1a')](_0xb5fa('0x68'),this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]]);logger[_0xb5fa('0x1b')](_0xb5fa('0x69'),_0x25de19[_0xb5fa('0x1d')],util[_0xb5fa('0x2c')](this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]],{'showHidden':![],'depth':null}));this[_0xb5fa('0x1a')](_0xb5fa('0x2d'),'voice_outbound:save',this[_0xb5fa('0xd')]);logger['info'](_0xb5fa('0x6a'),JSON[_0xb5fa('0x6b')](this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]]));logger[_0xb5fa('0x1b')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x25de19[_0xb5fa('0x1d')],util['inspect'](this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]],{'showHidden':![],'depth':null}));this[_0xb5fa('0x1a')](_0xb5fa('0x2d'),'voice_outbound_channel:remove',this['channels'][_0x25de19['uniqueid']]);delete this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]];}else if(this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x6c')]]){this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x6c')]]['uniqueid']=this[_0xb5fa('0xb')][_0x25de19['linkedid']]['destuniqueid'];}if(this[_0xb5fa('0xf')][_0x25de19['uniqueid']]){delete this['variables'][_0x25de19['uniqueid']];}}}catch(_0x193e63){logger['error'](_0xb5fa('0x6d'),_0x25de19[_0xb5fa('0x1d')],util[_0xb5fa('0x2c')](_0x193e63,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncNewExten']=function(_0xb1fcac){try{if(this[_0xb5fa('0x18')](_0xb1fcac)){logger['debug'](_0xb5fa('0x6e'),_0xb1fcac[_0xb5fa('0x1d')],util[_0xb5fa('0x2c')](_0xb1fcac,{'showHidden':![],'depth':null}));if(_0xb1fcac[_0xb5fa('0x6f')]['toLowerCase']()===_0xb5fa('0x70')){_0xb1fcac[_0xb5fa('0x71')]=(_0xb1fcac[_0xb5fa('0x72')]||_0xb1fcac[_0xb5fa('0x71')])[_0xb5fa('0x73')]();if(_[_0xb5fa('0x74')](_0xb1fcac[_0xb5fa('0x71')],'cdr(')){if(_[_0xb5fa('0x42')](this['applications'][_0xb1fcac[_0xb5fa('0x1d')]]))this[_0xb5fa('0xe')][_0xb1fcac['uniqueid']]={};logger[_0xb5fa('0x27')](_0xb5fa('0x75'),_0xb1fcac[_0xb5fa('0x1d')],_0xb1fcac[_0xb5fa('0x6f')],_0xb1fcac[_0xb5fa('0x71')]);var _0x8ce5b8=_0xb1fcac[_0xb5fa('0x71')][_0xb5fa('0x76')]('=');var _0x4b1135=_0x8ce5b8[0x0][_0xb5fa('0x77')](/cdr\((.*)\)/);if(_0x4b1135)this[_0xb5fa('0xe')][_0xb1fcac[_0xb5fa('0x1d')]][_0x4b1135[0x1]]=_0x8ce5b8[0x1];}}}}catch(_0x20ffa1){logger['error']('[%s][voiceDialReport][newexten]',_0xb1fcac['uniqueid'],util['inspect'](_0x20ffa1,{'showHidden':![],'depth':null}));}};module[_0xb5fa('0x78')]=VoiceDialReport;
\ No newline at end of file
index c89b41a..315f57b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb03e=['syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','hasOwnProperty','isEmpty','originated','talking','switch','isNil','Action','status','channel','catch','message','error','[%s][voiceQueueReport][checkChannel]','inspect','queueReports','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','name','voice_queue_channel:save',']\x20sending\x20voice_queue_channel:remove\x20event:','ATTENDEDTRANSFER','voice_queue_presence:remove','type','inbound','stringify',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','isUndefined','clearZombieChannels','queues','[voiceQueueReport][queues]','isRunning','then','actionid','[voiceQueueReport][queuesummary]','createQueueSummaryReport','summaryEvent','loggedin','callers','forEach','SIP/','online','loggedInDb','incall','paused','includes','unknown','notInUse','inUse','busy','invalid','ringing','ringInUse','onHold','available','loggedIn','waiting','syncQueueStatusComplete','queuestatus','assign','emitVoiceQueueSummary','statusRequests','push','syncQueueSummary','queue','[voiceQueueReport][queuesummary]\x20event:','info','completeEvent','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','last','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerabandon]','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','syncAgentConnect','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentconnect]','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallercomplete','queuecallerexit','queuecallerexitAt','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','FORWARDTRANSFER','transfer','transfertype','FORWARD','destexten','transferuniqueid','linkedid','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','variable','value','TIMEOUT','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','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','memberinterface','memberlastcall','unmanaged','sumHoldTime','diff','seconds','length','sumDuration','milliseconds','total','answered','sumBillable','queuecallercompleteAt','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','abandoned','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','handleHangup','transferid','cause-txt','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','transferexten','secondtransfererexten','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','CDR(routeAlias)','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','[%s][voiceQueueReport][newexten]','exports','moment','util','md5','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','../model/voiceQueueSummary','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','realtime','agents','channels','queueChannels','voiceQueues','campaigns','summary','variables','queuesummary','bind','queuesummarycomplete','syncQueueSummaryComplete','syncQueueMember','queuestatuscomplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart'];(function(_0x4ccaac,_0x18fdeb){var _0x36ee3c=function(_0x51a081){while(--_0x51a081){_0x4ccaac['push'](_0x4ccaac['shift']());}};_0x36ee3c(++_0x18fdeb);}(_0xb03e,0x1eb));var _0xeb03=function(_0x436604,_0x1c33eb){_0x436604=_0x436604-0x0;var _0x2c008f=_0xb03e[_0x436604];return _0x2c008f;};'use strict';var _=require('lodash');var moment=require(_0xeb03('0x0'));var util=require(_0xeb03('0x1'));var md5=require(_0xeb03('0x2'));var Redis=require(_0xeb03('0x3'));var config=require(_0xeb03('0x4'));var logger=require(_0xeb03('0x5'))(_0xeb03('0x6'));var ami=require(_0xeb03('0x7'));var QueueReport=require(_0xeb03('0x8'));var VoiceQueueSummary=require(_0xeb03('0x9'));config[_0xeb03('0xa')]=_[_0xeb03('0xb')](config['redis'],{'host':_0xeb03('0xc'),'port':0x18eb});var io=require(_0xeb03('0xd'))(new Redis(config[_0xeb03('0xa')]));var Sequence=function(){};Sequence[_0xeb03('0xe')][_0xeb03('0xf')]=function(_0x28c772){this['tail']=this[_0xeb03('0x10')]?this[_0xeb03('0x10')][_0xeb03('0x11')](_0x28c772):_0x28c772();};function VoiceQueueReport(_0x4f5013){this[_0xeb03('0x12')]=new Sequence();this['queueReports']={};this[_0xeb03('0x13')]=_0x4f5013;this[_0xeb03('0x14')]=_0x4f5013[_0xeb03('0x14')];this[_0xeb03('0x15')]=_0x4f5013[_0xeb03('0x16')];this[_0xeb03('0x17')]=_0x4f5013[_0xeb03('0x17')];this[_0xeb03('0x18')]=_0x4f5013[_0xeb03('0x18')];this[_0xeb03('0x19')]=initializeSummary();this[_0xeb03('0x1a')]={};ami['on'](_0xeb03('0x1b'),this['syncQueueSummary'][_0xeb03('0x1c')](this));ami['on'](_0xeb03('0x1d'),this[_0xeb03('0x1e')][_0xeb03('0x1c')](this));ami['on']('queuemember',this[_0xeb03('0x1f')][_0xeb03('0x1c')](this));ami['on'](_0xeb03('0x20'),this['syncQueueStatusComplete'][_0xeb03('0x1c')](this));ami['on'](_0xeb03('0x21'),this[_0xeb03('0x22')][_0xeb03('0x1c')](this));ami['on'](_0xeb03('0x23'),this[_0xeb03('0x24')][_0xeb03('0x1c')](this));ami['on'](_0xeb03('0x25'),this[_0xeb03('0x26')][_0xeb03('0x1c')](this));ami['on'](_0xeb03('0x27'),this[_0xeb03('0x28')][_0xeb03('0x1c')](this));ami['on'](_0xeb03('0x29'),this['syncAgentConnect'][_0xeb03('0x1c')](this));ami['on'](_0xeb03('0x2a'),this[_0xeb03('0x2b')][_0xeb03('0x1c')](this));ami['on'](_0xeb03('0x2c'),this[_0xeb03('0x2d')][_0xeb03('0x1c')](this));ami['on'](_0xeb03('0x2e'),this[_0xeb03('0x2f')]['bind'](this));ami['on'](_0xeb03('0x30'),this[_0xeb03('0x31')][_0xeb03('0x1c')](this));ami['on'](_0xeb03('0x32'),this[_0xeb03('0x33')]['bind'](this));ami['on'](_0xeb03('0x34'),this[_0xeb03('0x35')][_0xeb03('0x1c')](this));ami['on'](_0xeb03('0x36'),this[_0xeb03('0x37')][_0xeb03('0x1c')](this));this[_0xeb03('0x38')]();this[_0xeb03('0x39')]();}function clearChannels(_0xbb7ff){if(!_['isEmpty'](_0xbb7ff)){for(var _0x832372 in _0xbb7ff){if(_0xbb7ff[_0xeb03('0x3a')](_0x832372)){delete _0xbb7ff[_0x832372];}}}}function clearCampaigns(_0x2683f9){if(!_[_0xeb03('0x3b')](_0x2683f9)){for(var _0x4cdea6 in _0x2683f9){if(_0x2683f9['hasOwnProperty'](_0x4cdea6)){_0x2683f9[_0x4cdea6][_0xeb03('0x3c')]=0x0;}}}}function clearVoiceQueues(_0x49e449){if(!_[_0xeb03('0x3b')](_0x49e449)){for(var _0x8bd544 in _0x49e449){if(_0x49e449[_0xeb03('0x3a')](_0x8bd544)){_0x49e449[_0x8bd544]['originated']=0x0;_0x49e449[_0x8bd544][_0xeb03('0x3d')]=0x0;_0x49e449[_0x8bd544]['pTalking']=0x0;_0x49e449[_0x8bd544]['waiting']=0x0;_0x49e449[_0x8bd544]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x538d19){if(!_[_0xeb03('0x3b')](_0x538d19)){for(var _0x433ce8 in _0x538d19){if(_0x538d19['hasOwnProperty'](_0x433ce8)){_0x538d19[_0x433ce8]['unlockRR']=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}VoiceQueueReport['prototype']['clearZombieChannels']=function(){var _0x1e8009=this;for(var _0x3655c3 in this[_0xeb03('0x15')]){if(this[_0xeb03('0x15')][_0xeb03('0x3a')](_0x3655c3)&&!this['channels'][_0x3655c3][_0xeb03('0x3e')]){this['sequence'][_0xeb03('0xf')](function(){if(!_[_0xeb03('0x3f')](_0x1e8009[_0xeb03('0x15')][_0x3655c3])){return ami[_0xeb03('0x40')]({'action':_0xeb03('0x41'),'channel':_0x1e8009[_0xeb03('0x15')][_0x3655c3][_0xeb03('0x42')]})[_0xeb03('0x43')](function(_0x552c86){if(_0x552c86[_0xeb03('0x44')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x1e8009[_0xeb03('0x15')][_0x3655c3]){delete _0x1e8009[_0xeb03('0x15')][_0x3655c3];logger[_0xeb03('0x45')](_0xeb03('0x46'),_0x3655c3,util[_0xeb03('0x47')](_0x552c86,{'showHidden':![],'depth':null}));}if(_0x1e8009[_0xeb03('0x48')][_0x3655c3]){delete _0x1e8009['queueReports'][_0x3655c3];logger[_0xeb03('0x45')]('[%s][voiceQueueReport][checkQueueReport]',_0x3655c3,util['inspect'](_0x552c86,{'showHidden':![],'depth':null}));}if(_0x1e8009['variables'][_0x3655c3]){delete _0x1e8009[_0xeb03('0x1a')][_0x3655c3];logger[_0xeb03('0x45')](_0xeb03('0x49'),_0x3655c3,util[_0xeb03('0x47')](_0x552c86,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xeb03('0xe')]['syncFullyBooted']=function(){logger[_0xeb03('0x45')](_0xeb03('0x4a'));clearChannels(this[_0xeb03('0x15')]);this['clearQueueReport'](this['queueReports']);clearAgentBooked(this[_0xeb03('0x14')]);clearVoiceQueues(this[_0xeb03('0x17')]);clearCampaigns(this[_0xeb03('0x18')]);this['summary']=initializeSummary();};VoiceQueueReport[_0xeb03('0xe')][_0xeb03('0x4b')]=function(_0x57b2ab){var _0x49edb3=this;if(!_[_0xeb03('0x3b')](_0x57b2ab)){for(var _0x165a93 in _0x57b2ab){if(_0x57b2ab['hasOwnProperty'](_0x165a93)){_0x49edb3[_0xeb03('0x4c')](_0x57b2ab[_0x165a93],_0xeb03('0x4d'));delete _0x57b2ab[_0x165a93];}}}};VoiceQueueReport[_0xeb03('0xe')][_0xeb03('0x4e')]=function(_0x376088,_0xe96a49,_0x278529){io['to'](_0x376088)[_0xeb03('0x4e')](_0xe96a49,_0x278529);};VoiceQueueReport[_0xeb03('0xe')][_0xeb03('0x4f')]=function(_0x367d19,_0x52ee15){logger[_0xeb03('0x50')](_0xeb03('0x51')+_0x52ee15+_0xeb03('0x52'),_0x367d19[_0xeb03('0x53')],util[_0xeb03('0x47')](_0x367d19,{'showHidden':![],'depth':null}));this[_0xeb03('0x4e')](util[_0xeb03('0x54')](_0xeb03('0x55'),_0x367d19[_0xeb03('0x56')]),_0xeb03('0x57'),_0x367d19);io[_0xeb03('0x4e')]('voice_queue_presence:save',_0x367d19);};VoiceQueueReport['prototype'][_0xeb03('0x4c')]=function(_0x2262b7,_0x10acc1){logger[_0xeb03('0x50')](_0xeb03('0x51')+_0x10acc1+_0xeb03('0x58'),_0x2262b7[_0xeb03('0x53')],util[_0xeb03('0x47')](_0x2262b7,{'showHidden':![],'depth':null}));if(_0x2262b7['queuecallerexitreason']===_0xeb03('0x59')){return;}this[_0xeb03('0x4e')](util[_0xeb03('0x54')](_0xeb03('0x55'),_0x2262b7[_0xeb03('0x56')]),'voice_queue_channel:remove',_0x2262b7);io['emit'](_0xeb03('0x5a'),_0x2262b7);};VoiceQueueReport['prototype']['emitVoiceQueueSummary']=function(_0x4c6560,_0xe8ed69){if(_0x4c6560[_0xeb03('0x5b')]===_0xeb03('0x5c')){var _0x40c39d=new VoiceQueueSummary(_0x4c6560);var _0xb321da=md5(JSON[_0xeb03('0x5d')](_0x40c39d));if(_0x4c6560['md5']!==_0xb321da){_0x4c6560[_0xeb03('0x2')]=_0xb321da;logger['debug']('[voiceQueueReport]['+_0xe8ed69+_0xeb03('0x5e'),util[_0xeb03('0x47')](_0x40c39d,{'showHidden':![],'depth':null}));this[_0xeb03('0x4e')](util['format'](_0xeb03('0x55'),_0x40c39d[_0xeb03('0x56')]),_0xeb03('0x5f'),_0x40c39d);}}};VoiceQueueReport[_0xeb03('0xe')][_0xeb03('0x60')]=function(_0x495e26){return _0x495e26!==null&&!_[_0xeb03('0x61')](_0x495e26);};VoiceQueueReport['prototype'][_0xeb03('0x39')]=function(){var _0x2c99d0=this;setInterval(function(){_0x2c99d0[_0xeb03('0x62')]();ami[_0xeb03('0x40')]({'action':_0xeb03('0x63')})[_0xeb03('0x43')](function(_0x42e73f){logger[_0xeb03('0x45')](_0xeb03('0x64'),util[_0xeb03('0x47')](_0x42e73f,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xeb03('0xe')][_0xeb03('0x38')]=function(){var _0x2f2066=this;setInterval(function(){if(!_0x2f2066[_0xeb03('0x19')][_0xeb03('0x65')]){return ami[_0xeb03('0x40')]({'action':_0xeb03('0x1b')})[_0xeb03('0x66')](function(_0x30668f){_0x2f2066[_0xeb03('0x19')]['id']=_0x30668f[_0xeb03('0x67')];_0x2f2066[_0xeb03('0x19')][_0xeb03('0x65')]=!![];_0x2f2066[_0xeb03('0x19')]['queuestatus'][_0x30668f[_0xeb03('0x67')]]={};})[_0xeb03('0x43')](function(_0x415c18){logger['error'](_0xeb03('0x68'),util[_0xeb03('0x47')](_0x415c18,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0xeb03('0xe')][_0xeb03('0x69')]=function(_0x103da5,_0x68d263){var _0x3ee370=this[_0xeb03('0x14')];var _0x1fe50a=this[_0xeb03('0x19')][_0xeb03('0x63')][_0x103da5[_0xeb03('0x56')]][_0xeb03('0x6a')];var _0xd4ecb3={'available':Number(_0x1fe50a['available']),'busy':0x0,'inUse':0x0,'invalid':0x0,'loggedIn':Number(_0x1fe50a[_0xeb03('0x6b')]),'loggedInDb':0x0,'notInUse':0x0,'onHold':0x0,'paused':0x0,'ringing':0x0,'ringInUse':0x0,'talking':0x0,'unavailable':0x0,'unknown':0x0,'waiting':Number(_0x1fe50a[_0xeb03('0x6c')])};if(_0x103da5){_0x68d263[_0xeb03('0x6d')](function(_0x259db7){var _0x10fed0=_0x3ee370[_0xeb03('0x6e')+_0x259db7[_0xeb03('0x56')]];if(_0x10fed0&&_0x10fed0[_0xeb03('0x6f')]){_0xd4ecb3[_0xeb03('0x70')]+=0x1;}if(_0x259db7[_0xeb03('0x71')]==='1'){_0xd4ecb3['talking']+=0x1;}if(_0x259db7[_0xeb03('0x72')]==='1'&&!['2','7','8'][_0xeb03('0x73')](_0x259db7[_0xeb03('0x41')])){_0xd4ecb3[_0xeb03('0x72')]+=0x1;}switch(_0x259db7['status']){case'0':_0xd4ecb3[_0xeb03('0x74')]+=0x1;break;case'1':_0xd4ecb3[_0xeb03('0x75')]+=0x1;break;case'2':_0xd4ecb3[_0xeb03('0x76')]+=0x1;break;case'3':_0xd4ecb3[_0xeb03('0x77')]+=0x1;break;case'4':_0xd4ecb3[_0xeb03('0x78')]+=0x1;break;case'5':_0xd4ecb3['unavailable']+=0x1;break;case'6':_0xd4ecb3[_0xeb03('0x79')]+=0x1;break;case'7':_0xd4ecb3[_0xeb03('0x7a')]+=0x1;break;case'8':_0xd4ecb3[_0xeb03('0x7b')]+=0x1;break;}});}return _0xd4ecb3;};function hasQueueCountersChanged(_0x5e1361,_0x3abd58){return _0x5e1361[_0xeb03('0x7c')]!==_0x3abd58['available']||_0x5e1361[_0xeb03('0x7d')]!==_0x3abd58[_0xeb03('0x7d')]||_0x5e1361[_0xeb03('0x70')]!==_0x3abd58['loggedInDb']||_0x5e1361[_0xeb03('0x72')]!==_0x3abd58[_0xeb03('0x72')]||_0x5e1361['ringing']!==_0x3abd58[_0xeb03('0x79')]||_0x5e1361[_0xeb03('0x3d')]!==_0x3abd58[_0xeb03('0x3d')]||_0x5e1361[_0xeb03('0x7e')]!==_0x3abd58[_0xeb03('0x7e')];}VoiceQueueReport[_0xeb03('0xe')][_0xeb03('0x7f')]=function(_0x1ac556){var _0x5527d8=null;var _0x4447b6=this['summary']['id'];if(this[_0xeb03('0x19')][_0xeb03('0x80')][_0x4447b6]){_0x5527d8=this[_0xeb03('0x19')]['queuestatus'][_0x4447b6][_0x1ac556[_0xeb03('0x67')]];}if(!_0x5527d8){this[_0xeb03('0x19')]=initializeSummary();return;}var _0x14866f=this[_0xeb03('0x17')][_0x5527d8['queue']];var _0x3fe855=this[_0xeb03('0x69')](_0x14866f,_0x5527d8['agents']);var _0x588f31=hasQueueCountersChanged(_0x14866f,_0x3fe855);if(_0x588f31){var _0x583518=Object[_0xeb03('0x81')](_0x14866f,_0x3fe855);this[_0xeb03('0x13')][_0xeb03('0x17')][_0x14866f[_0xeb03('0x56')]]=_0x14866f;this[_0xeb03('0x82')](_0x583518,_0xeb03('0x1b'));}this[_0xeb03('0x19')][_0xeb03('0x83')]-=0x1;var _0x2c78dd=this['summary']['statusRequests']>0x0?!![]:![];if(!_0x2c78dd){return this[_0xeb03('0x1e')](this[_0xeb03('0x19')]['completeEvent']);}};VoiceQueueReport[_0xeb03('0xe')][_0xeb03('0x1f')]=function(_0x65425a){var _0x1890aa=this['summary']['id'];if(this['summary'][_0xeb03('0x80')][_0x1890aa]&&this[_0xeb03('0x19')][_0xeb03('0x80')][_0x1890aa][_0x65425a[_0xeb03('0x67')]]){this[_0xeb03('0x19')][_0xeb03('0x80')][_0x1890aa][_0x65425a[_0xeb03('0x67')]][_0xeb03('0x14')][_0xeb03('0x84')](_0x65425a);}};VoiceQueueReport[_0xeb03('0xe')][_0xeb03('0x85')]=function(_0x53b7ac){var _0x5113fd=this;try{if(this[_0xeb03('0x60')](_0x53b7ac)&&this['isNotNull'](_0x53b7ac[_0xeb03('0x86')])){logger['debug'](_0xeb03('0x87'),util['inspect'](_0x53b7ac,{'showHidden':![],'depth':null}));var _0x202c26=this[_0xeb03('0x17')][_0x53b7ac['queue']];if(_0x202c26){logger[_0xeb03('0x88')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x202c26[_0xeb03('0x56')]);this['summary'][_0xeb03('0x63')][_0x202c26['name']]={'summaryEvent':_0x53b7ac};this['summary'][_0xeb03('0x83')]+=0x1;return ami[_0xeb03('0x40')]({'action':_0xeb03('0x80'),'queue':_0x202c26[_0xeb03('0x56')]})[_0xeb03('0x66')](function(_0x4666f4){_0x5113fd[_0xeb03('0x19')]['queuestatus'][_0x53b7ac[_0xeb03('0x67')]][_0x4666f4[_0xeb03('0x67')]]={'queue':_0x202c26[_0xeb03('0x56')],'agents':[]};})[_0xeb03('0x43')](function(_0xc07413){throw _0xc07413;});}}}catch(_0x126a7f){logger[_0xeb03('0x45')]('[voiceQueueReport][queuesummary]',util[_0xeb03('0x47')](_0x126a7f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb03('0xe')][_0xeb03('0x1e')]=function(_0xbab312){if(this[_0xeb03('0x19')][_0xeb03('0x83')]>0x0){this[_0xeb03('0x19')][_0xeb03('0x89')]=_0xbab312;return;}logger['debug'](_0xeb03('0x8a'),util[_0xeb03('0x47')](_0xbab312,{'showHidden':![],'depth':null}));this[_0xeb03('0x19')]=initializeSummary();ami[_0xeb03('0x4e')](_0xeb03('0x8b'),{});};VoiceQueueReport['prototype'][_0xeb03('0x22')]=function(_0x275233){try{if(this[_0xeb03('0x60')](_0x275233)){logger[_0xeb03('0x50')](_0xeb03('0x8c'),_0x275233[_0xeb03('0x53')],util[_0xeb03('0x47')](_0x275233,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0xeb03('0x48')][_0x275233[_0xeb03('0x53')]]))this[_0xeb03('0x48')][_0x275233[_0xeb03('0x53')]]=[];if(_[_0xeb03('0x61')](this['channels'][_0x275233[_0xeb03('0x53')]]))this[_0xeb03('0x15')][_0x275233[_0xeb03('0x53')]]={};var _0x43d5f5=new QueueReport();_0x43d5f5[_0xeb03('0x56')]=_0x275233[_0xeb03('0x86')];_0x43d5f5[_0xeb03('0x5b')]=this['voiceQueues'][_0x43d5f5[_0xeb03('0x56')]]&&this[_0xeb03('0x17')][_0x43d5f5[_0xeb03('0x56')]][_0xeb03('0x5b')]?this[_0xeb03('0x17')][_0x43d5f5[_0xeb03('0x56')]]['type']||_0xeb03('0x5c'):_0xeb03('0x5c');_0x43d5f5[_0xeb03('0x86')]=_0x275233['queue'];_0x43d5f5[_0xeb03('0x8d')]=moment()[_0xeb03('0x54')](_0xeb03('0x8e'));_0x43d5f5[_0xeb03('0x8f')]=_0x275233[_0xeb03('0x8f')];_0x43d5f5[_0xeb03('0x90')]=_0x275233[_0xeb03('0x90')];_0x43d5f5['uniqueid']=_0x275233['uniqueid'];_0x43d5f5[_0xeb03('0x91')]=this[_0xeb03('0x15')][_0x275233[_0xeb03('0x53')]][_0xeb03('0x91')];logger['info'](_0xeb03('0x92'),_0x43d5f5[_0xeb03('0x56')],_0x43d5f5['type']);_[_0xeb03('0x93')](_0x43d5f5,_[_0xeb03('0x94')](_0x275233,_[_0xeb03('0x95')](_0x43d5f5)));this[_0xeb03('0x48')][_0x275233[_0xeb03('0x53')]][_0xeb03('0x84')](_0x43d5f5);this['channels'][_0x275233[_0xeb03('0x53')]]=_0x43d5f5;this[_0xeb03('0x4f')](_0x43d5f5,_0xeb03('0x21'));}}catch(_0x2db046){logger[_0xeb03('0x45')](_0xeb03('0x8c'),_0x275233[_0xeb03('0x53')],util[_0xeb03('0x47')](_0x2db046,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb03('0xe')][_0xeb03('0x24')]=function(_0x5dbc4e){try{if(this[_0xeb03('0x60')](_0x5dbc4e)){logger[_0xeb03('0x50')]('[%s][voiceQueueReport][queuecallerabandon]',_0x5dbc4e[_0xeb03('0x53')],util[_0xeb03('0x47')](_0x5dbc4e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x5dbc4e[_0xeb03('0x53')]]){var _0x3a4739=_[_0xeb03('0x96')](this[_0xeb03('0x48')][_0x5dbc4e[_0xeb03('0x53')]]);_0x3a4739['queuecallercomplete']=![];_0x3a4739['queuecallercompleteAt']=null;_0x3a4739['holdtime']=_0x5dbc4e[_0xeb03('0x97')];_0x3a4739['originalposition']=_0x5dbc4e[_0xeb03('0x98')];_0x3a4739[_0xeb03('0x23')]=!![];_0x3a4739[_0xeb03('0x99')]=moment()[_0xeb03('0x54')](_0xeb03('0x8e'));_0x3a4739[_0xeb03('0x9a')]=_0xeb03('0x9b');_0x3a4739[_0xeb03('0x9c')]=null;logger[_0xeb03('0x88')](_0xeb03('0x9d'),_0x3a4739[_0xeb03('0x56')],_0x3a4739[_0xeb03('0x5b')]);this['channels'][_0x5dbc4e['uniqueid']]=_0x3a4739;this[_0xeb03('0x4c')](_0x3a4739,'queuecallerabandon');}}}catch(_0x5d5962){logger[_0xeb03('0x45')](_0xeb03('0x9e'),_0x5dbc4e['uniqueid'],util['inspect'](_0x5d5962,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb03('0xe')][_0xeb03('0x26')]=function(_0x56db8b){try{if(this[_0xeb03('0x60')](_0x56db8b)){logger[_0xeb03('0x50')](_0xeb03('0x9f'),_0x56db8b[_0xeb03('0x53')],util[_0xeb03('0x47')](_0x56db8b,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x56db8b[_0xeb03('0x53')]]){var _0x5c8b06=_['last'](this[_0xeb03('0x48')][_0x56db8b[_0xeb03('0x53')]]);_0x5c8b06[_0xeb03('0xa0')]=moment()[_0xeb03('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x5c8b06['connectedlinenum']=_0x56db8b[_0xeb03('0xa1')];_0x5c8b06[_0xeb03('0xa2')]=_0x56db8b[_0xeb03('0xa2')];logger[_0xeb03('0x88')](_0xeb03('0xa3'),_0x5c8b06[_0xeb03('0x56')],_0x5c8b06[_0xeb03('0x5b')],_0x56db8b[_0xeb03('0xa1')],_0x56db8b['connectedlinename']);this['channels'][_0x56db8b[_0xeb03('0x53')]]=_0x5c8b06;this['emitVoiceQueueChannelSave'](_0x5c8b06,_0xeb03('0x25'));}}}catch(_0x48456a){logger[_0xeb03('0x45')](_0xeb03('0x9f'),_0x56db8b[_0xeb03('0x53')],util[_0xeb03('0x47')](_0x48456a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb03('0xe')][_0xeb03('0xa4')]=function(_0x3c7766){try{if(this[_0xeb03('0x60')](_0x3c7766)){logger['debug']('[%s][voiceQueueReport][agentconnect]',_0x3c7766[_0xeb03('0x53')],util[_0xeb03('0x47')](_0x3c7766,{'showHidden':![],'depth':null}));if(this[_0xeb03('0x48')][_0x3c7766[_0xeb03('0x53')]]){var _0x3b9daa=_['last'](this[_0xeb03('0x48')][_0x3c7766[_0xeb03('0x53')]]);_0x3b9daa['queuecallercomplete']=!![];_0x3b9daa[_0xeb03('0x9a')]=_0xeb03('0xa5');logger[_0xeb03('0x88')](_0xeb03('0xa6'),_0x3b9daa[_0xeb03('0x56')],_0x3b9daa[_0xeb03('0x5b')]);}}}catch(_0x2d3bc2){logger[_0xeb03('0x45')](_0xeb03('0xa7'),_0x3c7766[_0xeb03('0x53')],util[_0xeb03('0x47')](_0x2d3bc2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb03('0xe')][_0xeb03('0x28')]=function(_0x4fd139){try{if(this['isNotNull'](_0x4fd139)){logger[_0xeb03('0x50')](_0xeb03('0xa8'),_0x4fd139['uniqueid'],util[_0xeb03('0x47')](_0x4fd139,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4fd139[_0xeb03('0x53')]]){var _0x5af5a9=_[_0xeb03('0x96')](this[_0xeb03('0x48')][_0x4fd139[_0xeb03('0x53')]]);_0x5af5a9[_0xeb03('0x23')]=![];_0x5af5a9[_0xeb03('0x99')]=null;_0x5af5a9[_0xeb03('0xa9')]=!![];_0x5af5a9[_0xeb03('0x9c')]=_0x4fd139[_0xeb03('0xaa')];_0x5af5a9['holdtime']=_0x4fd139[_0xeb03('0x97')];_0x5af5a9[_0xeb03('0xab')]=!![];_0x5af5a9[_0xeb03('0xac')]=![];_0x5af5a9[_0xeb03('0xad')]=null;if(!_0x5af5a9['transfer']){if(_0x4fd139[_0xeb03('0xae')]=='transfer'){_0x5af5a9[_0xeb03('0x9a')]=_0xeb03('0xaf');logger[_0xeb03('0x88')](_0xeb03('0xb0'),_0x5af5a9['name'],_0x5af5a9[_0xeb03('0x5b')]);}else{if(_[_0xeb03('0xb1')](_0x4fd139[_0xeb03('0x42')][_0xeb03('0xb2')](),'local/')){if(this[_0xeb03('0x48')][_0x4fd139['linkedid']]){var _0x4e0fd8=_['last'](this[_0xeb03('0x48')][_0x4fd139['linkedid']]);_0x4e0fd8[_0xeb03('0xab')]=![];_0x4e0fd8[_0xeb03('0xac')]=!![];_0x4e0fd8[_0xeb03('0xad')]=moment(_0x5af5a9['queuecallerjoinAt'])['add'](_0x4fd139['holdtime'],'seconds')['format'](_0xeb03('0x8e'));_0x4e0fd8[_0xeb03('0x9a')]=_0xeb03('0xb3');_0x4e0fd8[_0xeb03('0xb4')]=!![];_0x4e0fd8[_0xeb03('0xb5')]=_0xeb03('0xb6');_0x4e0fd8['transferexten']=_0x4fd139[_0xeb03('0xb7')];_0x4e0fd8[_0xeb03('0xb8')]=_0x4fd139[_0xeb03('0x53')];logger[_0xeb03('0x88')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x4e0fd8['name'],_0x4e0fd8[_0xeb03('0x5b')]);var _0x333d53=this['queueReports'][_0x4fd139[_0xeb03('0xb9')]];this[_0xeb03('0x48')][_0x4fd139[_0xeb03('0xb9')]]=this[_0xeb03('0x48')][_0x4fd139[_0xeb03('0x53')]];this[_0xeb03('0x48')][_0x4fd139[_0xeb03('0x53')]]=_0x333d53;}}else{_0x5af5a9['queuecallerexitreason']=_0xeb03('0xba')+_0x4fd139[_0xeb03('0xae')][_0xeb03('0xbb')]();logger[_0xeb03('0x88')](_0xeb03('0xbc'),_0x5af5a9[_0xeb03('0x56')],_0x5af5a9[_0xeb03('0x5b')],_0x5af5a9[_0xeb03('0x9a')]);}}}this['channels'][_0x4fd139[_0xeb03('0x53')]]=_0x5af5a9;this['emitVoiceQueueChannelRemove'](_0x5af5a9,'agentcomplete');}}}catch(_0x188d39){logger[_0xeb03('0x45')]('[%s][voiceQueueReport][agentcomplete]',_0x4fd139[_0xeb03('0x53')],util['inspect'](_0x188d39,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb03('0xe')]['syncVarSet']=function(_0xb6c86d){try{if(this[_0xeb03('0x60')](_0xb6c86d)){logger[_0xeb03('0x50')](_0xeb03('0xbd'),_0xb6c86d[_0xeb03('0x53')],util['inspect'](_0xb6c86d,{'showHidden':![],'depth':null}));this[_0xeb03('0xbe')](_0xb6c86d[_0xeb03('0x53')],_[_0xeb03('0x95')](_0xb6c86d[_0xeb03('0xbf')])[0x0],_0xb6c86d[_0xeb03('0xc0')]);if(this[_0xeb03('0x48')][_0xb6c86d[_0xeb03('0x53')]]){var _0x464a37=_[_0xeb03('0x96')](this['queueReports'][_0xb6c86d['uniqueid']]);if(_0x464a37){if(this['isNotNull'](_0xb6c86d[_0xeb03('0xbf')])&&this[_0xeb03('0x60')](_0xb6c86d[_0xeb03('0xbf')][_0xeb03('0x80')])){switch(_0xb6c86d['value']){case'CONTINUE':_0x464a37['queuecallerexit']=![];_0x464a37[_0xeb03('0xad')]=null;break;case _0xeb03('0xc1'):_0x464a37[_0xeb03('0xc2')]=_0xeb03('0xc3');_0x464a37[_0xeb03('0xac')]=!![];_0x464a37['queuecallerexitAt']=moment()[_0xeb03('0x54')](_0xeb03('0x8e'));_0x464a37['queuecallerleaveAt']=moment()[_0xeb03('0x54')]('YYYY-MM-DD\x20HH:mm:ss');logger['debug'](_0xeb03('0xc4'),_0xb6c86d[_0xeb03('0x53')],util[_0xeb03('0x47')](_0x464a37,{'showHidden':![],'depth':null}));ami['emit'](_0xeb03('0xc5'),_0x464a37);break;default:_0x464a37[_0xeb03('0xac')]=!![];_0x464a37['queuecallerexitAt']=moment()[_0xeb03('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x464a37['queuecallerleaveAt']=moment()[_0xeb03('0x54')](_0xeb03('0x8e'));}_0x464a37[_0xeb03('0x23')]=![];_0x464a37[_0xeb03('0x99')]=null;_0x464a37[_0xeb03('0x9a')]=_0xb6c86d[_0xeb03('0xc0')];this['channels'][_0xb6c86d[_0xeb03('0x53')]]=_0x464a37;this[_0xeb03('0x4c')](_0x464a37,_0xeb03('0x2a'));}else if(this[_0xeb03('0x60')](_0xb6c86d[_0xeb03('0xbf')])&&this[_0xeb03('0x60')](_0xb6c86d[_0xeb03('0xbf')][_0xeb03('0xc6')])){if(!_0x464a37[_0xeb03('0x23')]){_0x464a37[_0xeb03('0xac')]=!![];_0x464a37[_0xeb03('0xad')]=moment()[_0xeb03('0x54')](_0xeb03('0x8e'));_0x464a37[_0xeb03('0x9a')]=_0xeb03('0xc7');_0x464a37[_0xeb03('0xa0')]=moment()[_0xeb03('0x54')](_0xeb03('0x8e'));this[_0xeb03('0x15')][_0xb6c86d[_0xeb03('0x53')]]=_0x464a37;}}logger[_0xeb03('0x88')](_0xeb03('0xc8'),_0xb6c86d['uniqueid'],_0x464a37[_0xeb03('0x56')],_0x464a37['type'],_[_0xeb03('0x95')](_0xb6c86d[_0xeb03('0xbf')])[0x0],_0xb6c86d[_0xeb03('0xc0')]);_0x464a37[_0xeb03('0x1a')]=this[_0xeb03('0x1a')][_0xb6c86d[_0xeb03('0x53')]];}}}}catch(_0x584eb9){logger[_0xeb03('0x45')](_0xeb03('0xbd'),_0xb6c86d['uniqueid'],util[_0xeb03('0x47')](_0x584eb9,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xeb03('0xbe')]=function(_0x1f855f,_0x2efa89,_0x156bdd){var _0x184778=[_0xeb03('0xc9'),_0xeb03('0xca'),'rtpaudioqosjitter',_0xeb03('0xcb'),_0xeb03('0xcc'),_0xeb03('0xcd'),_0xeb03('0xce'),_0xeb03('0xcf'),_0xeb03('0xd0'),_0xeb03('0xd1'),_0xeb03('0xd2'),_0xeb03('0xd3'),_0xeb03('0xd4'),_0xeb03('0xd5'),_0xeb03('0xd6'),_0xeb03('0xd7'),_0xeb03('0xaa'),'memberpenalty','memberrealtime'];if(!_[_0xeb03('0x3f')](_0x2efa89)&&!_[_0xeb03('0x73')](_0x184778,_0x2efa89)){if(_[_0xeb03('0x61')](this[_0xeb03('0x1a')][_0x1f855f])){this[_0xeb03('0x1a')][_0x1f855f]={};}this['variables'][_0x1f855f][_0x2efa89]=_0x156bdd;}};VoiceQueueReport[_0xeb03('0xe')]['handleHangup']=function(_0xe32225,_0x3a65cf,_0x3014fb){var _0xce2785={};for(var _0x370d36=0x0;_0x370d36<this[_0xeb03('0x48')][_0xe32225]['length'];_0x370d36+=0x1){_0xce2785=this[_0xeb03('0x48')][_0xe32225][_0x370d36];if(this[_0xeb03('0x17')][_0xce2785[_0xeb03('0x86')]]){if(_0xce2785[_0xeb03('0xac')]&&_0xce2785[_0xeb03('0xb4')]!=!![]){this[_0xeb03('0x17')][_0xce2785[_0xeb03('0x86')]][_0xeb03('0xd8')]+=0x1;}if(_0xce2785['queuecallerabandon']){this[_0xeb03('0x17')][_0xce2785[_0xeb03('0x86')]]['abandoned']+=0x1;}this[_0xeb03('0x17')][_0xce2785['queue']][_0xeb03('0xd9')]+=moment(_0xce2785[_0xeb03('0xa0')])[_0xeb03('0xda')](_0xce2785[_0xeb03('0x8d')],_0xeb03('0xdb'))||0x0;if(_0x370d36===this[_0xeb03('0x48')][_0xe32225][_0xeb03('0xdc')]-0x1){this[_0xeb03('0x17')][_0xce2785[_0xeb03('0x86')]][_0xeb03('0xdd')]+=moment()[_0xeb03('0xde')](0x0)['diff'](_0xce2785['queuecallerjoinAt'],_0xeb03('0xdb'));this['voiceQueues'][_0xce2785['queue']][_0xeb03('0xdf')]+=0x1;if(_0xce2785[_0xeb03('0xab')]){this[_0xeb03('0x17')][_0xce2785[_0xeb03('0x86')]][_0xeb03('0xe0')]+=0x1;this[_0xeb03('0x17')][_0xce2785[_0xeb03('0x86')]][_0xeb03('0xe1')]+=moment()[_0xeb03('0xde')](0x0)['diff'](_0xce2785[_0xeb03('0xa0')],'seconds');_0xce2785[_0xeb03('0xe2')]=moment()['format'](_0xeb03('0x8e'));_0xce2785[_0xeb03('0xac')]=![];_0xce2785[_0xeb03('0xad')]=null;}if(_0xce2785[_0xeb03('0xac')]&&_0xce2785[_0xeb03('0xb4')]!=!![]){_0xce2785['lastevent']=_0xeb03('0xd8');logger[_0xeb03('0x50')](_0xeb03('0xe3'),_0xe32225,util[_0xeb03('0x47')](_0xce2785,{'showHidden':![],'depth':null}));ami[_0xeb03('0x4e')](_0xeb03('0xe4'),_0xce2785);}if(_0xce2785[_0xeb03('0x23')]){_0xce2785['lastevent']=_0xeb03('0xe5');logger[_0xeb03('0x50')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0xe32225,util['inspect'](_0xce2785,{'showHidden':![],'depth':null}));ami[_0xeb03('0x4e')](_0xeb03('0xe6'),_0xce2785);}}else{this['voiceQueues'][_0xce2785[_0xeb03('0x86')]][_0xeb03('0xdd')]+=this[_0xeb03('0x17')][_0xce2785[_0xeb03('0x86')]][_0xeb03('0xd9')];}logger[_0xeb03('0x88')]('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0xe32225,_0xce2785['name'],_0xce2785[_0xeb03('0x5b')],_0x3a65cf);if(_0x3014fb&&_0xce2785[_0xeb03('0x9a')]===_0xeb03('0x59')){_0xce2785[_0xeb03('0x9a')]=_0xeb03('0xa5');}this['channels'][_0xe32225]=_0xce2785;this[_0xeb03('0x4c')](_0xce2785,_0xeb03('0x2c'));}}logger[_0xeb03('0x50')](_0xeb03('0xe7'),_0xe32225,util[_0xeb03('0x47')](this[_0xeb03('0x48')][_0xe32225],{'showHidden':![],'depth':null}));ami[_0xeb03('0x4e')](_0xeb03('0xe8'),this[_0xeb03('0x48')][_0xe32225]);if(_0xce2785[_0xeb03('0x9a')]===_0xeb03('0x59')){return;}if(_0xce2785[_0xeb03('0xac')]||_0xce2785[_0xeb03('0x23')]||_0xce2785[_0xeb03('0xab')]){delete this[_0xeb03('0x48')][_0xe32225];delete this[_0xeb03('0x15')][_0xe32225];if(this[_0xeb03('0x1a')][_0xe32225]){delete this['variables'][_0xe32225];}}};VoiceQueueReport[_0xeb03('0xe')][_0xeb03('0x2d')]=function(_0x364b6b){try{if(this['isNotNull'](_0x364b6b)){logger[_0xeb03('0x50')](_0xeb03('0xe9'),_0x364b6b['uniqueid'],util[_0xeb03('0x47')](_0x364b6b,{'showHidden':![],'depth':null}));if(this[_0xeb03('0x48')][_0x364b6b[_0xeb03('0x53')]]){return this['handleHangup'](_0x364b6b[_0xeb03('0x53')],_0x364b6b['cause-txt']);}if(this[_0xeb03('0x48')][_0x364b6b[_0xeb03('0xb9')]]){if(_0x364b6b['cause']==='21'){return;}return this[_0xeb03('0xea')](_0x364b6b['linkedid'],_0x364b6b['cause-txt'],!![]);}var _0x41c1fa=Object[_0xeb03('0x95')](this[_0xeb03('0x48')]);for(var _0x12235e=0x0;_0x12235e<_0x41c1fa[_0xeb03('0xdc')];_0x12235e++){var _0x1d8d15=_[_0xeb03('0x96')](this[_0xeb03('0x48')][_0x41c1fa[_0x12235e]]);if(_0x1d8d15&&_0x1d8d15[_0xeb03('0xeb')]===_0x364b6b['uniqueid']){return this[_0xeb03('0xea')](_0x1d8d15[_0xeb03('0x53')],_0x364b6b[_0xeb03('0xec')],!![]);}}}}catch(_0x138da4){logger[_0xeb03('0x45')]('[%s][voiceQueueReport][hangup]',_0x364b6b['uniqueid'],util[_0xeb03('0x47')](_0x138da4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb03('0xe')][_0xeb03('0x35')]=function(_0x1a0f98){try{if(this[_0xeb03('0x60')](_0x1a0f98)){logger['debug'](_0xeb03('0xed'),_0x1a0f98[_0xeb03('0x53')],util[_0xeb03('0x47')](_0x1a0f98,{'showHidden':![],'depth':null}));var _0x511536;var _0x199ff9;var _0x5d61a4;if(this[_0xeb03('0x48')][_0x1a0f98[_0xeb03('0xee')]]){_0x511536=_[_0xeb03('0x96')](this[_0xeb03('0x48')][_0x1a0f98[_0xeb03('0xee')]]);_0x511536[_0xeb03('0xef')]=_0x1a0f98[_0xeb03('0xf0')];_0x511536['transferuniqueid']=_0x1a0f98[_0xeb03('0xf1')];_0x511536[_0xeb03('0x9a')]=_0xeb03('0x59');_0x511536[_0xeb03('0xb4')]=!![];_0x511536[_0xeb03('0xb5')]=_0xeb03('0xf2');if(this[_0xeb03('0x48')][_0x1a0f98['secondtransfereruniqueid']]){_0x5d61a4=this['queueReports'][_0x1a0f98[_0xeb03('0xf1')]];this[_0xeb03('0x48')][_0x1a0f98['secondtransfereruniqueid']]=this[_0xeb03('0x48')][_0x1a0f98[_0xeb03('0xee')]];this[_0xeb03('0x48')][_0x1a0f98[_0xeb03('0xee')]]=_0x5d61a4;_0x199ff9=_[_0xeb03('0x96')](this[_0xeb03('0x48')][_0x1a0f98[_0xeb03('0xee')]]);_0x199ff9['switch']=!![];}logger[_0xeb03('0x88')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x1a0f98[_0xeb03('0x53')],_0x511536[_0xeb03('0x56')],_0x511536[_0xeb03('0x5b')],_0x511536['transferexten'],_0x511536['transferuniqueid']);}else if(this['queueReports'][_0x1a0f98[_0xeb03('0xf3')]]){_0x511536=_[_0xeb03('0x96')](this[_0xeb03('0x48')][_0x1a0f98['transfertargetuniqueid']]);_0x511536[_0xeb03('0xef')]=_0x1a0f98[_0xeb03('0xf4')];_0x511536[_0xeb03('0xb8')]=_0x1a0f98['origtransfereruniqueid'];_0x511536[_0xeb03('0x9a')]=_0xeb03('0x59');_0x511536[_0xeb03('0xb4')]=!![];_0x511536[_0xeb03('0xb5')]='ATTENDED';if(this['queueReports'][_0x1a0f98['origtransfereruniqueid']]){_0x5d61a4=this[_0xeb03('0x48')][_0x1a0f98['origtransfereruniqueid']];this[_0xeb03('0x48')][_0x1a0f98[_0xeb03('0xf5')]]=this[_0xeb03('0x48')][_0x1a0f98[_0xeb03('0xf3')]];this['queueReports'][_0x1a0f98[_0xeb03('0xf3')]]=_0x5d61a4;_0x199ff9=_[_0xeb03('0x96')](this['queueReports'][_0x1a0f98['transfertargetuniqueid']]);_0x199ff9['switch']=!![];}logger['info']('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x1a0f98[_0xeb03('0x53')],_0x511536['name'],_0x511536[_0xeb03('0x5b')],_0x511536[_0xeb03('0xef')],_0x511536[_0xeb03('0xb8')]);}else if(this[_0xeb03('0x48')][_0x1a0f98['origtransfereruniqueid']]){_0x511536=_[_0xeb03('0x96')](this['queueReports'][_0x1a0f98[_0xeb03('0xf5')]]);_0x511536[_0xeb03('0xef')]=_0x1a0f98[_0xeb03('0xf4')];_0x511536[_0xeb03('0xb8')]=_0x1a0f98[_0xeb03('0xf5')];_0x511536['queuecallerexitreason']=_0xeb03('0x59');_0x511536['transfer']=!![];_0x511536[_0xeb03('0xb5')]=_0xeb03('0xf2');_0x511536[_0xeb03('0x3e')]=!![];_0x511536[_0xeb03('0xeb')]=_0x1a0f98[_0xeb03('0xee')];}else if(this['queueReports'][_0x1a0f98[_0xeb03('0xf1')]]){_0x511536=_[_0xeb03('0x96')](this[_0xeb03('0x48')][_0x1a0f98[_0xeb03('0xf1')]]);_0x511536[_0xeb03('0xef')]=_0x1a0f98[_0xeb03('0xf0')];_0x511536[_0xeb03('0xb8')]=_0x1a0f98[_0xeb03('0xf1')];_0x511536[_0xeb03('0x9a')]=_0xeb03('0x59');_0x511536[_0xeb03('0xb4')]=!![];_0x511536[_0xeb03('0xb5')]=_0xeb03('0xf2');_0x511536['switch']=!![];_0x511536[_0xeb03('0xeb')]=_0x1a0f98['transfertargetuniqueid'];}}}catch(_0x3f8c43){logger['error'](_0xeb03('0xed'),_0x1a0f98[_0xeb03('0x53')],util['inspect'](_0x3f8c43,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb03('0xe')][_0xeb03('0x37')]=function(_0x1d9824){try{if(this['isNotNull'](_0x1d9824)){logger[_0xeb03('0x50')](_0xeb03('0xf6'),_0x1d9824[_0xeb03('0x53')],util[_0xeb03('0x47')](_0x1d9824,{'showHidden':![],'depth':null}));if(this[_0xeb03('0x48')][_0x1d9824[_0xeb03('0xee')]]){var _0x190cef=_[_0xeb03('0x96')](this[_0xeb03('0x48')][_0x1d9824[_0xeb03('0xee')]]);_0x190cef[_0xeb03('0x9a')]=_0xeb03('0xf7');_0x190cef[_0xeb03('0xb4')]=!![];_0x190cef[_0xeb03('0xb5')]=_0xeb03('0xf8');_0x190cef[_0xeb03('0xef')]=_0x1d9824[_0xeb03('0xf9')];_0x190cef[_0xeb03('0xb8')]=_0x1d9824['transfereeuniqueid'];logger[_0xeb03('0x88')](_0xeb03('0xfa'),_0x1d9824['uniqueid'],_0x190cef[_0xeb03('0x56')],_0x190cef[_0xeb03('0x5b')],_0x190cef[_0xeb03('0xef')],_0x190cef[_0xeb03('0xb8')]);this[_0xeb03('0x2d')]({'event':'BlindTransfer','uniqueid':_0x1d9824[_0xeb03('0xee')],'context':_0x1d9824[_0xeb03('0xfb')],'channel':_0x1d9824[_0xeb03('0xfc')]});}}}catch(_0x47d3a8){logger[_0xeb03('0x45')]('[%s][voiceQueueReport][blindtransfer]',_0x1d9824[_0xeb03('0x53')],util[_0xeb03('0x47')](_0x47d3a8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb03('0xe')]['syncMusicOnHoldStart']=function(_0x1814db){try{if(this['isNotNull'](_0x1814db)){logger[_0xeb03('0x50')](_0xeb03('0xfd'),_0x1814db[_0xeb03('0x53')],util[_0xeb03('0x47')](_0x1814db,{'showHidden':![],'depth':null}));if(this[_0xeb03('0x48')][_0x1814db[_0xeb03('0x53')]]){var _0x3c117a=_[_0xeb03('0x96')](this['queueReports'][_0x1814db['uniqueid']]);if(!_[_0xeb03('0x3f')](_0x3c117a[_0xeb03('0xa0')])){_0x3c117a[_0xeb03('0xfe')]=moment()[_0xeb03('0x54')](_0xeb03('0x8e'));logger[_0xeb03('0x88')](_0xeb03('0xff'),_0x1814db[_0xeb03('0x53')],_0x3c117a[_0xeb03('0xfe')]);}}}}catch(_0x5026c0){logger[_0xeb03('0x45')](_0xeb03('0xfd'),_0x1814db[_0xeb03('0x53')],util[_0xeb03('0x47')](_0x5026c0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb03('0xe')][_0xeb03('0x33')]=function(_0x1c291f){try{if(this['isNotNull'](_0x1c291f)){logger[_0xeb03('0x50')](_0xeb03('0x100'),_0x1c291f[_0xeb03('0x53')],util[_0xeb03('0x47')](_0x1c291f,{'showHidden':![],'depth':null}));if(this[_0xeb03('0x48')][_0x1c291f[_0xeb03('0x53')]]){var _0x489484=_[_0xeb03('0x96')](this[_0xeb03('0x48')][_0x1c291f[_0xeb03('0x53')]]);if(!_[_0xeb03('0x3f')](_0x489484[_0xeb03('0xfe')])){_0x489484[_0xeb03('0x101')]+=moment()[_0xeb03('0xde')](0x0)[_0xeb03('0xda')](_0x489484[_0xeb03('0xfe')],_0xeb03('0xdb'));logger[_0xeb03('0x88')](_0xeb03('0x102'),_0x1c291f[_0xeb03('0x53')],_0x489484['mohtime']);delete _0x489484[_0xeb03('0xfe')];}}}}catch(_0x1933c0){logger[_0xeb03('0x45')](_0xeb03('0x100'),_0x1c291f['uniqueid'],util[_0xeb03('0x47')](_0x1933c0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb03('0xe')][_0xeb03('0x103')]=function(_0x7ef4a1){try{if(this[_0xeb03('0x60')](_0x7ef4a1)){logger[_0xeb03('0x50')](_0xeb03('0x104'),_0x7ef4a1['uniqueid'],util[_0xeb03('0x47')](_0x7ef4a1,{'showHidden':![],'depth':null}));if(_0x7ef4a1[_0xeb03('0x105')]['toLowerCase']()===_0xeb03('0x106')){_0x7ef4a1[_0xeb03('0x107')]=_0x7ef4a1[_0xeb03('0x108')]&&_0x7ef4a1[_0xeb03('0x108')][_0xeb03('0xb1')](_0xeb03('0x109'))?_0x7ef4a1[_0xeb03('0x108')]:(_0x7ef4a1['appdata']||_0x7ef4a1[_0xeb03('0x107')])[_0xeb03('0xb2')]();if(_[_0xeb03('0xb1')](_0x7ef4a1['applicationdata'][_0xeb03('0xb2')](),'cdr(')){logger[_0xeb03('0x88')](_0xeb03('0x10a'),_0x7ef4a1['uniqueid'],_0x7ef4a1[_0xeb03('0x105')],_0x7ef4a1[_0xeb03('0x107')]);if(_['isUndefined'](this['channels'][_0x7ef4a1[_0xeb03('0x53')]]))this['channels'][_0x7ef4a1[_0xeb03('0x53')]]={};var _0x39f432=_0x7ef4a1[_0xeb03('0x107')][_0xeb03('0x10b')]('=');var _0x35f79c=_0x39f432[0x0]['toLowerCase']()['match'](/cdr\((.*)\)/);if(_0x35f79c)this[_0xeb03('0x15')][_0x7ef4a1[_0xeb03('0x53')]][_0x35f79c[0x1]]=_0x39f432[0x1];}}}}catch(_0x361f42){logger[_0xeb03('0x45')](_0xeb03('0x10c'),_0x7ef4a1[_0xeb03('0x53')],util[_0xeb03('0x47')](_0x361f42,{'showHidden':![],'depth':null}));}};module[_0xeb03('0x10d')]=VoiceQueueReport;
\ No newline at end of file
+var _0x3423=['unknown','busy','invalid','unavailable','onHold','available','loggedIn','ringing','queue','assign','realtime','statusRequests','completeEvent','push','info','[voiceQueueReport][queuesummary]\x20name:%s','then','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','[%s][voiceQueueReport][queuecallerjoin]','inbound','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','keys','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','queuecallerabandonAt','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','queuecallerexitreason','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','syncAgentComplete','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallerexit','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','toLowerCase','local/','linkedid','queuecallerexitAt','seconds','transfertype','transferexten','destexten','transferuniqueid','[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','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','queueposition','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','memberdynamic','memberlastcall','memberpenalty','memberrealtime','includes','handleHangup','length','unmanaged','abandoned','sumHoldTime','diff','sumDuration','milliseconds','total','answered','sumBillable','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','cause','transferid','cause-txt','syncAttendedTransfer','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','context','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohtime','[%s][voiceQueueReport][musiconholdstop]','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','applicationdata','appdata','CDR(routeAlias)','startsWith','split','match','exports','util','md5','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','../model/voiceQueueSummary','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','agents','queueChannels','voiceQueues','campaigns','summary','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','hasOwnProperty','originated','isEmpty','pTalking','waiting','queueStatusComplete','channels','switch','isNil','Action','status','channel','catch','message','No\x20such\x20channel','[%s][voiceQueueReport][checkChannel]','queueReports','error','[%s][voiceQueueReport][checkQueueReport]','inspect','[%s][voiceQueueReport][checkVariables]','syncFullyBooted','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:remove\x20event:','ATTENDEDTRANSFER','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','[voiceQueueReport][','isNotNull','isUndefined','loopQueueShow','queues','loopQueueSummary','actionid','isRunning','queuestatus','[voiceQueueReport][queuesummary]','createQueueSummaryReport','callers','forEach','SIP/','online','loggedInDb','incall','talking','paused'];(function(_0x54eab6,_0x5e262f){var _0x1e7435=function(_0x468c91){while(--_0x468c91){_0x54eab6['push'](_0x54eab6['shift']());}};_0x1e7435(++_0x5e262f);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x3342('0x0'));var md5=require(_0x3342('0x1'));var Redis=require(_0x3342('0x2'));var config=require(_0x3342('0x3'));var logger=require(_0x3342('0x4'))(_0x3342('0x5'));var ami=require(_0x3342('0x6'));var QueueReport=require(_0x3342('0x7'));var VoiceQueueSummary=require(_0x3342('0x8'));config[_0x3342('0x9')]=_[_0x3342('0xa')](config[_0x3342('0x9')],{'host':_0x3342('0xb'),'port':0x18eb});var io=require(_0x3342('0xc'))(new Redis(config[_0x3342('0x9')]));var Sequence=function(){};Sequence[_0x3342('0xd')][_0x3342('0xe')]=function(_0xd9d129){this[_0x3342('0xf')]=this['tail']?this['tail'][_0x3342('0x10')](_0xd9d129):_0xd9d129();};function VoiceQueueReport(_0x481a17){this['sequence']=new Sequence();this['queueReports']={};this['realtime']=_0x481a17;this[_0x3342('0x11')]=_0x481a17[_0x3342('0x11')];this['channels']=_0x481a17[_0x3342('0x12')];this['voiceQueues']=_0x481a17[_0x3342('0x13')];this[_0x3342('0x14')]=_0x481a17['campaigns'];this[_0x3342('0x15')]=initializeSummary();this[_0x3342('0x16')]={};ami['on'](_0x3342('0x17'),this[_0x3342('0x18')][_0x3342('0x19')](this));ami['on'](_0x3342('0x1a'),this[_0x3342('0x1b')]['bind'](this));ami['on'](_0x3342('0x1c'),this[_0x3342('0x1d')]['bind'](this));ami['on'](_0x3342('0x1e'),this[_0x3342('0x1f')]['bind'](this));ami['on']('queuecallerjoin',this[_0x3342('0x20')][_0x3342('0x19')](this));ami['on'](_0x3342('0x21'),this[_0x3342('0x22')][_0x3342('0x19')](this));ami['on'](_0x3342('0x23'),this[_0x3342('0x24')][_0x3342('0x19')](this));ami['on'](_0x3342('0x25'),this['syncAgentComplete'][_0x3342('0x19')](this));ami['on'](_0x3342('0x26'),this[_0x3342('0x27')]['bind'](this));ami['on'](_0x3342('0x28'),this[_0x3342('0x29')]['bind'](this));ami['on'](_0x3342('0x2a'),this[_0x3342('0x2b')]['bind'](this));ami['on'](_0x3342('0x2c'),this['syncFullyBooted'][_0x3342('0x19')](this));ami['on'](_0x3342('0x2d'),this[_0x3342('0x2e')][_0x3342('0x19')](this));ami['on'](_0x3342('0x2f'),this[_0x3342('0x30')][_0x3342('0x19')](this));ami['on'](_0x3342('0x31'),this['syncAttendedTransfer'][_0x3342('0x19')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x3342('0x19')](this));this['loopQueueSummary']();this['loopQueueShow']();}function clearChannels(_0x247ee4){if(!_['isEmpty'](_0x247ee4)){for(var _0x37df78 in _0x247ee4){if(_0x247ee4['hasOwnProperty'](_0x37df78)){delete _0x247ee4[_0x37df78];}}}}function clearCampaigns(_0x524286){if(!_['isEmpty'](_0x524286)){for(var _0x1497d9 in _0x524286){if(_0x524286[_0x3342('0x32')](_0x1497d9)){_0x524286[_0x1497d9][_0x3342('0x33')]=0x0;}}}}function clearVoiceQueues(_0x5eef2b){if(!_[_0x3342('0x34')](_0x5eef2b)){for(var _0x1275e2 in _0x5eef2b){if(_0x5eef2b[_0x3342('0x32')](_0x1275e2)){_0x5eef2b[_0x1275e2][_0x3342('0x33')]=0x0;_0x5eef2b[_0x1275e2]['talking']=0x0;_0x5eef2b[_0x1275e2][_0x3342('0x35')]=0x0;_0x5eef2b[_0x1275e2][_0x3342('0x36')]=0x0;_0x5eef2b[_0x1275e2][_0x3342('0x37')]=!![];}}}}function clearAgentBooked(_0x301114){if(!_[_0x3342('0x34')](_0x301114)){for(var _0x2cc691 in _0x301114){if(_0x301114[_0x3342('0x32')](_0x2cc691)){_0x301114[_0x2cc691]['unlockRR']=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}VoiceQueueReport[_0x3342('0xd')]['clearZombieChannels']=function(){var _0x9c9def=this;for(var _0x407f8c in this['channels']){if(this[_0x3342('0x38')][_0x3342('0x32')](_0x407f8c)&&!this[_0x3342('0x38')][_0x407f8c][_0x3342('0x39')]){this['sequence'][_0x3342('0xe')](function(){if(!_[_0x3342('0x3a')](_0x9c9def[_0x3342('0x38')][_0x407f8c])){return ami[_0x3342('0x3b')]({'action':_0x3342('0x3c'),'channel':_0x9c9def[_0x3342('0x38')][_0x407f8c][_0x3342('0x3d')]})[_0x3342('0x3e')](function(_0x2531fb){if(_0x2531fb[_0x3342('0x3f')]===_0x3342('0x40')){setTimeout(function(){if(_0x9c9def[_0x3342('0x38')][_0x407f8c]){delete _0x9c9def['channels'][_0x407f8c];logger['error'](_0x3342('0x41'),_0x407f8c,util['inspect'](_0x2531fb,{'showHidden':![],'depth':null}));}if(_0x9c9def[_0x3342('0x42')][_0x407f8c]){delete _0x9c9def[_0x3342('0x42')][_0x407f8c];logger[_0x3342('0x43')](_0x3342('0x44'),_0x407f8c,util[_0x3342('0x45')](_0x2531fb,{'showHidden':![],'depth':null}));}if(_0x9c9def[_0x3342('0x16')][_0x407f8c]){delete _0x9c9def[_0x3342('0x16')][_0x407f8c];logger['error'](_0x3342('0x46'),_0x407f8c,util[_0x3342('0x45')](_0x2531fb,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x3342('0xd')][_0x3342('0x47')]=function(){logger[_0x3342('0x43')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0x3342('0x38')]);this['clearQueueReport'](this[_0x3342('0x42')]);clearAgentBooked(this[_0x3342('0x11')]);clearVoiceQueues(this[_0x3342('0x13')]);clearCampaigns(this[_0x3342('0x14')]);this['summary']=initializeSummary();};VoiceQueueReport[_0x3342('0xd')]['clearQueueReport']=function(_0x9fcf8d){var _0x128657=this;if(!_[_0x3342('0x34')](_0x9fcf8d)){for(var _0x1b58c5 in _0x9fcf8d){if(_0x9fcf8d[_0x3342('0x32')](_0x1b58c5)){_0x128657[_0x3342('0x48')](_0x9fcf8d[_0x1b58c5],_0x3342('0x49'));delete _0x9fcf8d[_0x1b58c5];}}}};VoiceQueueReport['prototype'][_0x3342('0x4a')]=function(_0x355e83,_0x57cc44,_0x324205){io['to'](_0x355e83)[_0x3342('0x4a')](_0x57cc44,_0x324205);};VoiceQueueReport['prototype'][_0x3342('0x4b')]=function(_0x29f0a0,_0x54f6dc){logger['debug']('[%s][voiceQueueReport]['+_0x54f6dc+_0x3342('0x4c'),_0x29f0a0[_0x3342('0x4d')],util['inspect'](_0x29f0a0,{'showHidden':![],'depth':null}));this[_0x3342('0x4a')](util[_0x3342('0x4e')](_0x3342('0x4f'),_0x29f0a0[_0x3342('0x50')]),_0x3342('0x51'),_0x29f0a0);io[_0x3342('0x4a')](_0x3342('0x52'),_0x29f0a0);};VoiceQueueReport[_0x3342('0xd')]['emitVoiceQueueChannelRemove']=function(_0x5a787b,_0x472ed2){logger[_0x3342('0x53')](_0x3342('0x54')+_0x472ed2+_0x3342('0x55'),_0x5a787b[_0x3342('0x4d')],util[_0x3342('0x45')](_0x5a787b,{'showHidden':![],'depth':null}));if(_0x5a787b['queuecallerexitreason']===_0x3342('0x56')){return;}this[_0x3342('0x4a')](util[_0x3342('0x4e')](_0x3342('0x4f'),_0x5a787b[_0x3342('0x50')]),_0x3342('0x57'),_0x5a787b);io['emit'](_0x3342('0x58'),_0x5a787b);};VoiceQueueReport['prototype'][_0x3342('0x59')]=function(_0x1d276b,_0x9c22ff){if(_0x1d276b[_0x3342('0x5a')]==='inbound'){var _0x122265=new VoiceQueueSummary(_0x1d276b);var _0x16e970=md5(JSON['stringify'](_0x122265));if(_0x1d276b[_0x3342('0x1')]!==_0x16e970){_0x1d276b[_0x3342('0x1')]=_0x16e970;logger[_0x3342('0x53')](_0x3342('0x5b')+_0x9c22ff+']\x20sending\x20voice_queue:save\x20event:',util[_0x3342('0x45')](_0x122265,{'showHidden':![],'depth':null}));this[_0x3342('0x4a')](util['format'](_0x3342('0x4f'),_0x122265['name']),'voice_queue:save',_0x122265);}}};VoiceQueueReport[_0x3342('0xd')][_0x3342('0x5c')]=function(_0x346534){return _0x346534!==null&&!_[_0x3342('0x5d')](_0x346534);};VoiceQueueReport[_0x3342('0xd')][_0x3342('0x5e')]=function(){var _0x2bc5bd=this;setInterval(function(){_0x2bc5bd['clearZombieChannels']();ami['Action']({'action':_0x3342('0x5f')})['catch'](function(_0x26251c){logger['error']('[voiceQueueReport][queues]',util['inspect'](_0x26251c,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x3342('0xd')][_0x3342('0x60')]=function(){var _0x29ccb6=this;setInterval(function(){if(!_0x29ccb6[_0x3342('0x15')]['isRunning']){return ami[_0x3342('0x3b')]({'action':_0x3342('0x17')})['then'](function(_0x66092){_0x29ccb6[_0x3342('0x15')]['id']=_0x66092[_0x3342('0x61')];_0x29ccb6['summary'][_0x3342('0x62')]=!![];_0x29ccb6[_0x3342('0x15')][_0x3342('0x63')][_0x66092[_0x3342('0x61')]]={};})[_0x3342('0x3e')](function(_0x4c7f5a){logger[_0x3342('0x43')](_0x3342('0x64'),util[_0x3342('0x45')](_0x4c7f5a,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x3342('0xd')][_0x3342('0x65')]=function(_0x386a5d,_0x3db07c){var _0x47cf76=this[_0x3342('0x11')];var _0x542181=this[_0x3342('0x15')]['queues'][_0x386a5d[_0x3342('0x50')]]['summaryEvent'];var _0x49e3c6={'available':Number(_0x542181['available']),'busy':0x0,'inUse':0x0,'invalid':0x0,'loggedIn':Number(_0x542181['loggedin']),'loggedInDb':0x0,'notInUse':0x0,'onHold':0x0,'paused':0x0,'ringing':0x0,'ringInUse':0x0,'talking':0x0,'unavailable':0x0,'unknown':0x0,'waiting':Number(_0x542181[_0x3342('0x66')])};if(_0x386a5d){_0x3db07c[_0x3342('0x67')](function(_0x3cd098){var _0x476973=_0x47cf76[_0x3342('0x68')+_0x3cd098[_0x3342('0x50')]];if(_0x476973&&_0x476973[_0x3342('0x69')]){_0x49e3c6[_0x3342('0x6a')]+=0x1;}if(_0x3cd098[_0x3342('0x6b')]==='1'){_0x49e3c6[_0x3342('0x6c')]+=0x1;}if(_0x3cd098[_0x3342('0x6d')]==='1'&&!['2','7','8']['includes'](_0x3cd098['status'])){_0x49e3c6[_0x3342('0x6d')]+=0x1;}switch(_0x3cd098['status']){case'0':_0x49e3c6[_0x3342('0x6e')]+=0x1;break;case'1':_0x49e3c6['notInUse']+=0x1;break;case'2':_0x49e3c6['inUse']+=0x1;break;case'3':_0x49e3c6[_0x3342('0x6f')]+=0x1;break;case'4':_0x49e3c6[_0x3342('0x70')]+=0x1;break;case'5':_0x49e3c6[_0x3342('0x71')]+=0x1;break;case'6':_0x49e3c6['ringing']+=0x1;break;case'7':_0x49e3c6['ringInUse']+=0x1;break;case'8':_0x49e3c6[_0x3342('0x72')]+=0x1;break;}});}return _0x49e3c6;};function hasQueueCountersChanged(_0x3cc92a,_0x5e9161){return _0x3cc92a[_0x3342('0x73')]!==_0x5e9161[_0x3342('0x73')]||_0x3cc92a[_0x3342('0x74')]!==_0x5e9161['loggedIn']||_0x3cc92a[_0x3342('0x6a')]!==_0x5e9161[_0x3342('0x6a')]||_0x3cc92a[_0x3342('0x6d')]!==_0x5e9161[_0x3342('0x6d')]||_0x3cc92a[_0x3342('0x75')]!==_0x5e9161[_0x3342('0x75')]||_0x3cc92a[_0x3342('0x6c')]!==_0x5e9161['talking']||_0x3cc92a['waiting']!==_0x5e9161[_0x3342('0x36')];}VoiceQueueReport['prototype'][_0x3342('0x1f')]=function(_0x3a5192){var _0xd6fff5=null;var _0x28b252=this[_0x3342('0x15')]['id'];if(this['summary'][_0x3342('0x63')][_0x28b252]){_0xd6fff5=this[_0x3342('0x15')]['queuestatus'][_0x28b252][_0x3a5192[_0x3342('0x61')]];}if(!_0xd6fff5){this[_0x3342('0x15')]=initializeSummary();return;}var _0x10842c=this[_0x3342('0x13')][_0xd6fff5[_0x3342('0x76')]];var _0x3a82c8=this[_0x3342('0x65')](_0x10842c,_0xd6fff5[_0x3342('0x11')]);var _0x16c3f3=hasQueueCountersChanged(_0x10842c,_0x3a82c8);if(_0x16c3f3){var _0x36eec8=Object[_0x3342('0x77')](_0x10842c,_0x3a82c8);this[_0x3342('0x78')][_0x3342('0x13')][_0x10842c['name']]=_0x10842c;this['emitVoiceQueueSummary'](_0x36eec8,_0x3342('0x17'));}this[_0x3342('0x15')][_0x3342('0x79')]-=0x1;var _0x3cd93a=this['summary']['statusRequests']>0x0?!![]:![];if(!_0x3cd93a){return this[_0x3342('0x1b')](this[_0x3342('0x15')][_0x3342('0x7a')]);}};VoiceQueueReport[_0x3342('0xd')][_0x3342('0x1d')]=function(_0x3902b6){var _0x6032a0=this[_0x3342('0x15')]['id'];if(this[_0x3342('0x15')][_0x3342('0x63')][_0x6032a0]&&this['summary'][_0x3342('0x63')][_0x6032a0][_0x3902b6['actionid']]){this[_0x3342('0x15')][_0x3342('0x63')][_0x6032a0][_0x3902b6['actionid']][_0x3342('0x11')][_0x3342('0x7b')](_0x3902b6);}};VoiceQueueReport['prototype'][_0x3342('0x18')]=function(_0x3624be){var _0x1e3353=this;try{if(this[_0x3342('0x5c')](_0x3624be)&&this[_0x3342('0x5c')](_0x3624be[_0x3342('0x76')])){logger[_0x3342('0x53')]('[voiceQueueReport][queuesummary]\x20event:',util[_0x3342('0x45')](_0x3624be,{'showHidden':![],'depth':null}));var _0x58facc=this['voiceQueues'][_0x3624be[_0x3342('0x76')]];if(_0x58facc){logger[_0x3342('0x7c')](_0x3342('0x7d'),_0x58facc[_0x3342('0x50')]);this[_0x3342('0x15')][_0x3342('0x5f')][_0x58facc[_0x3342('0x50')]]={'summaryEvent':_0x3624be};this[_0x3342('0x15')]['statusRequests']+=0x1;return ami[_0x3342('0x3b')]({'action':_0x3342('0x63'),'queue':_0x58facc[_0x3342('0x50')]})[_0x3342('0x7e')](function(_0x3c151b){_0x1e3353[_0x3342('0x15')][_0x3342('0x63')][_0x3624be['actionid']][_0x3c151b[_0x3342('0x61')]]={'queue':_0x58facc[_0x3342('0x50')],'agents':[]};})[_0x3342('0x3e')](function(_0x20203b){throw _0x20203b;});}}}catch(_0x38a83f){logger[_0x3342('0x43')]('[voiceQueueReport][queuesummary]',util['inspect'](_0x38a83f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3342('0x1b')]=function(_0x21670a){if(this[_0x3342('0x15')][_0x3342('0x79')]>0x0){this[_0x3342('0x15')][_0x3342('0x7a')]=_0x21670a;return;}logger[_0x3342('0x53')](_0x3342('0x7f'),util['inspect'](_0x21670a,{'showHidden':![],'depth':null}));this[_0x3342('0x15')]=initializeSummary();ami[_0x3342('0x4a')](_0x3342('0x80'),{});};VoiceQueueReport[_0x3342('0xd')]['syncQueueCallerJoin']=function(_0x212ae0){try{if(this[_0x3342('0x5c')](_0x212ae0)){logger[_0x3342('0x53')](_0x3342('0x81'),_0x212ae0[_0x3342('0x4d')],util[_0x3342('0x45')](_0x212ae0,{'showHidden':![],'depth':null}));if(_[_0x3342('0x5d')](this[_0x3342('0x42')][_0x212ae0[_0x3342('0x4d')]]))this['queueReports'][_0x212ae0[_0x3342('0x4d')]]=[];if(_[_0x3342('0x5d')](this['channels'][_0x212ae0[_0x3342('0x4d')]]))this['channels'][_0x212ae0[_0x3342('0x4d')]]={};var _0x5f258f=new QueueReport();_0x5f258f[_0x3342('0x50')]=_0x212ae0['queue'];_0x5f258f[_0x3342('0x5a')]=this[_0x3342('0x13')][_0x5f258f['name']]&&this[_0x3342('0x13')][_0x5f258f[_0x3342('0x50')]]['type']?this[_0x3342('0x13')][_0x5f258f[_0x3342('0x50')]][_0x3342('0x5a')]||_0x3342('0x82'):_0x3342('0x82');_0x5f258f[_0x3342('0x76')]=_0x212ae0['queue'];_0x5f258f[_0x3342('0x83')]=moment()[_0x3342('0x4e')](_0x3342('0x84'));_0x5f258f[_0x3342('0x85')]=_0x212ae0[_0x3342('0x85')];_0x5f258f[_0x3342('0x86')]=_0x212ae0[_0x3342('0x86')];_0x5f258f[_0x3342('0x4d')]=_0x212ae0[_0x3342('0x4d')];_0x5f258f[_0x3342('0x87')]=this['channels'][_0x212ae0[_0x3342('0x4d')]][_0x3342('0x87')];logger[_0x3342('0x7c')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x5f258f['name'],_0x5f258f[_0x3342('0x5a')]);_['merge'](_0x5f258f,_['pick'](_0x212ae0,_[_0x3342('0x88')](_0x5f258f)));this[_0x3342('0x42')][_0x212ae0['uniqueid']][_0x3342('0x7b')](_0x5f258f);this['channels'][_0x212ae0[_0x3342('0x4d')]]=_0x5f258f;this['emitVoiceQueueChannelSave'](_0x5f258f,'queuecallerjoin');}}catch(_0x2cb12a){logger[_0x3342('0x43')](_0x3342('0x81'),_0x212ae0['uniqueid'],util['inspect'](_0x2cb12a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3342('0xd')]['syncQueueCallerAbandon']=function(_0x11b071){try{if(this[_0x3342('0x5c')](_0x11b071)){logger[_0x3342('0x53')](_0x3342('0x89'),_0x11b071['uniqueid'],util['inspect'](_0x11b071,{'showHidden':![],'depth':null}));if(this[_0x3342('0x42')][_0x11b071[_0x3342('0x4d')]]){var _0x58154e=_[_0x3342('0x8a')](this['queueReports'][_0x11b071[_0x3342('0x4d')]]);_0x58154e[_0x3342('0x8b')]=![];_0x58154e[_0x3342('0x8c')]=null;_0x58154e[_0x3342('0x8d')]=_0x11b071[_0x3342('0x8d')];_0x58154e['originalposition']=_0x11b071['originalposition'];_0x58154e['queuecallerabandon']=!![];_0x58154e[_0x3342('0x8e')]=moment()[_0x3342('0x4e')](_0x3342('0x84'));_0x58154e['queuecallerexitreason']=_0x3342('0x8f');_0x58154e[_0x3342('0x90')]=null;logger[_0x3342('0x7c')](_0x3342('0x91'),_0x58154e[_0x3342('0x50')],_0x58154e[_0x3342('0x5a')]);this['channels'][_0x11b071[_0x3342('0x4d')]]=_0x58154e;this['emitVoiceQueueChannelRemove'](_0x58154e,'queuecallerabandon');}}}catch(_0x53699e){logger[_0x3342('0x43')](_0x3342('0x89'),_0x11b071['uniqueid'],util[_0x3342('0x45')](_0x53699e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3342('0xd')]['syncQueueCallerLeave']=function(_0x14a960){try{if(this[_0x3342('0x5c')](_0x14a960)){logger[_0x3342('0x53')](_0x3342('0x92'),_0x14a960[_0x3342('0x4d')],util[_0x3342('0x45')](_0x14a960,{'showHidden':![],'depth':null}));if(this[_0x3342('0x42')][_0x14a960[_0x3342('0x4d')]]){var _0x54ddbf=_[_0x3342('0x8a')](this[_0x3342('0x42')][_0x14a960[_0x3342('0x4d')]]);_0x54ddbf[_0x3342('0x93')]=moment()[_0x3342('0x4e')](_0x3342('0x84'));_0x54ddbf[_0x3342('0x94')]=_0x14a960['connectedlinenum'];_0x54ddbf['connectedlinename']=_0x14a960[_0x3342('0x95')];logger[_0x3342('0x7c')](_0x3342('0x96'),_0x54ddbf[_0x3342('0x50')],_0x54ddbf[_0x3342('0x5a')],_0x14a960[_0x3342('0x94')],_0x14a960[_0x3342('0x95')]);this['channels'][_0x14a960[_0x3342('0x4d')]]=_0x54ddbf;this[_0x3342('0x4b')](_0x54ddbf,_0x3342('0x23'));}}}catch(_0x39f576){logger[_0x3342('0x43')]('[%s][voiceQueueReport][queuecallerleave]',_0x14a960[_0x3342('0x4d')],util[_0x3342('0x45')](_0x39f576,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3342('0xd')][_0x3342('0x27')]=function(_0x526d93){try{if(this[_0x3342('0x5c')](_0x526d93)){logger[_0x3342('0x53')](_0x3342('0x97'),_0x526d93[_0x3342('0x4d')],util[_0x3342('0x45')](_0x526d93,{'showHidden':![],'depth':null}));if(this[_0x3342('0x42')][_0x526d93[_0x3342('0x4d')]]){var _0x5ccbc6=_['last'](this[_0x3342('0x42')][_0x526d93['uniqueid']]);_0x5ccbc6[_0x3342('0x8b')]=!![];_0x5ccbc6[_0x3342('0x98')]=_0x3342('0x99');logger[_0x3342('0x7c')](_0x3342('0x9a'),_0x5ccbc6['name'],_0x5ccbc6[_0x3342('0x5a')]);}}}catch(_0x28eebd){logger[_0x3342('0x43')]('[%s][voiceQueueReport][agentconnect]',_0x526d93['uniqueid'],util[_0x3342('0x45')](_0x28eebd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3342('0xd')][_0x3342('0x9b')]=function(_0x99b22){try{if(this[_0x3342('0x5c')](_0x99b22)){logger[_0x3342('0x53')](_0x3342('0x9c'),_0x99b22[_0x3342('0x4d')],util[_0x3342('0x45')](_0x99b22,{'showHidden':![],'depth':null}));if(this[_0x3342('0x42')][_0x99b22[_0x3342('0x4d')]]){var _0x694bc5=_['last'](this['queueReports'][_0x99b22['uniqueid']]);_0x694bc5[_0x3342('0x21')]=![];_0x694bc5[_0x3342('0x8e')]=null;_0x694bc5[_0x3342('0x9d')]=!![];_0x694bc5[_0x3342('0x90')]=_0x99b22[_0x3342('0x9e')];_0x694bc5['holdtime']=_0x99b22[_0x3342('0x8d')];_0x694bc5[_0x3342('0x8b')]=!![];_0x694bc5[_0x3342('0x9f')]=![];_0x694bc5['queuecallerexitAt']=null;if(!_0x694bc5[_0x3342('0xa0')]){if(_0x99b22[_0x3342('0xa1')]=='transfer'){_0x694bc5['queuecallerexitreason']=_0x3342('0xa2');logger[_0x3342('0x7c')](_0x3342('0xa3'),_0x694bc5[_0x3342('0x50')],_0x694bc5[_0x3342('0x5a')]);}else{if(_['startsWith'](_0x99b22['channel'][_0x3342('0xa4')](),_0x3342('0xa5'))){if(this[_0x3342('0x42')][_0x99b22[_0x3342('0xa6')]]){var _0x43323e=_[_0x3342('0x8a')](this[_0x3342('0x42')][_0x99b22['linkedid']]);_0x43323e['queuecallercomplete']=![];_0x43323e['queuecallerexit']=!![];_0x43323e[_0x3342('0xa7')]=moment(_0x694bc5['queuecallerjoinAt'])['add'](_0x99b22['holdtime'],_0x3342('0xa8'))[_0x3342('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x43323e[_0x3342('0x98')]='FORWARDTRANSFER';_0x43323e['transfer']=!![];_0x43323e[_0x3342('0xa9')]='FORWARD';_0x43323e[_0x3342('0xaa')]=_0x99b22[_0x3342('0xab')];_0x43323e[_0x3342('0xac')]=_0x99b22[_0x3342('0x4d')];logger[_0x3342('0x7c')](_0x3342('0xad'),_0x43323e['name'],_0x43323e[_0x3342('0x5a')]);var _0x406ac6=this[_0x3342('0x42')][_0x99b22['linkedid']];this[_0x3342('0x42')][_0x99b22[_0x3342('0xa6')]]=this[_0x3342('0x42')][_0x99b22[_0x3342('0x4d')]];this[_0x3342('0x42')][_0x99b22[_0x3342('0x4d')]]=_0x406ac6;}}else{_0x694bc5['queuecallerexitreason']=_0x3342('0xae')+_0x99b22[_0x3342('0xa1')][_0x3342('0xaf')]();logger[_0x3342('0x7c')](_0x3342('0xb0'),_0x694bc5['name'],_0x694bc5[_0x3342('0x5a')],_0x694bc5[_0x3342('0x98')]);}}}this[_0x3342('0x38')][_0x99b22[_0x3342('0x4d')]]=_0x694bc5;this['emitVoiceQueueChannelRemove'](_0x694bc5,_0x3342('0x25'));}}}catch(_0x56251e){logger[_0x3342('0x43')](_0x3342('0x9c'),_0x99b22[_0x3342('0x4d')],util['inspect'](_0x56251e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3342('0xd')]['syncVarSet']=function(_0xcdd85a){try{if(this['isNotNull'](_0xcdd85a)){logger[_0x3342('0x53')](_0x3342('0xb1'),_0xcdd85a[_0x3342('0x4d')],util['inspect'](_0xcdd85a,{'showHidden':![],'depth':null}));this[_0x3342('0xb2')](_0xcdd85a[_0x3342('0x4d')],_[_0x3342('0x88')](_0xcdd85a[_0x3342('0xb3')])[0x0],_0xcdd85a[_0x3342('0xb4')]);if(this[_0x3342('0x42')][_0xcdd85a[_0x3342('0x4d')]]){var _0x4d86c3=_[_0x3342('0x8a')](this[_0x3342('0x42')][_0xcdd85a[_0x3342('0x4d')]]);if(_0x4d86c3){if(this['isNotNull'](_0xcdd85a[_0x3342('0xb3')])&&this[_0x3342('0x5c')](_0xcdd85a[_0x3342('0xb3')][_0x3342('0x63')])){switch(_0xcdd85a[_0x3342('0xb4')]){case _0x3342('0xb5'):_0x4d86c3[_0x3342('0x9f')]=![];_0x4d86c3[_0x3342('0xa7')]=null;break;case'TIMEOUT':_0x4d86c3[_0x3342('0xb6')]=_0x3342('0xb7');_0x4d86c3['queuecallerexit']=!![];_0x4d86c3[_0x3342('0xa7')]=moment()[_0x3342('0x4e')](_0x3342('0x84'));_0x4d86c3[_0x3342('0x93')]=moment()[_0x3342('0x4e')](_0x3342('0x84'));logger[_0x3342('0x53')](_0x3342('0xb8'),_0xcdd85a[_0x3342('0x4d')],util[_0x3342('0x45')](_0x4d86c3,{'showHidden':![],'depth':null}));ami[_0x3342('0x4a')]('custom:timeout',_0x4d86c3);break;default:_0x4d86c3['queuecallerexit']=!![];_0x4d86c3[_0x3342('0xa7')]=moment()[_0x3342('0x4e')](_0x3342('0x84'));_0x4d86c3[_0x3342('0x93')]=moment()[_0x3342('0x4e')](_0x3342('0x84'));}_0x4d86c3[_0x3342('0x21')]=![];_0x4d86c3[_0x3342('0x8e')]=null;_0x4d86c3[_0x3342('0x98')]=_0xcdd85a[_0x3342('0xb4')];this[_0x3342('0x38')][_0xcdd85a[_0x3342('0x4d')]]=_0x4d86c3;this[_0x3342('0x48')](_0x4d86c3,_0x3342('0x28'));}else if(this[_0x3342('0x5c')](_0xcdd85a[_0x3342('0xb3')])&&this['isNotNull'](_0xcdd85a['variable'][_0x3342('0xb9')])){if(!_0x4d86c3[_0x3342('0x21')]){_0x4d86c3['queuecallerexit']=!![];_0x4d86c3[_0x3342('0xa7')]=moment()[_0x3342('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x4d86c3[_0x3342('0x98')]='EXITWITHKEY';_0x4d86c3[_0x3342('0x93')]=moment()[_0x3342('0x4e')](_0x3342('0x84'));this[_0x3342('0x38')][_0xcdd85a[_0x3342('0x4d')]]=_0x4d86c3;}}logger[_0x3342('0x7c')](_0x3342('0xba'),_0xcdd85a[_0x3342('0x4d')],_0x4d86c3[_0x3342('0x50')],_0x4d86c3['type'],_['keys'](_0xcdd85a['variable'])[0x0],_0xcdd85a[_0x3342('0xb4')]);_0x4d86c3[_0x3342('0x16')]=this['variables'][_0xcdd85a[_0x3342('0x4d')]];}}}}catch(_0x352455){logger[_0x3342('0x43')](_0x3342('0xb1'),_0xcdd85a['uniqueid'],util[_0x3342('0x45')](_0x352455,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3342('0xd')]['addVariable']=function(_0x53342c,_0x38f43a,_0x4048fe){var _0xd2a769=[_0x3342('0xbb'),_0x3342('0xbc'),_0x3342('0xbd'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0x3342('0xbe'),_0x3342('0xbf'),_0x3342('0xc0'),_0x3342('0xc1'),_0x3342('0xc2'),'bridgepeer','bridgepvtcallid','membercalls',_0x3342('0xc3'),'memberinterface',_0x3342('0xc4'),_0x3342('0x9e'),_0x3342('0xc5'),_0x3342('0xc6')];if(!_[_0x3342('0x3a')](_0x38f43a)&&!_[_0x3342('0xc7')](_0xd2a769,_0x38f43a)){if(_[_0x3342('0x5d')](this[_0x3342('0x16')][_0x53342c])){this[_0x3342('0x16')][_0x53342c]={};}this[_0x3342('0x16')][_0x53342c][_0x38f43a]=_0x4048fe;}};VoiceQueueReport[_0x3342('0xd')][_0x3342('0xc8')]=function(_0x5b2057,_0x39018f,_0x32a488){var _0x13c512={};for(var _0x2284bc=0x0;_0x2284bc<this[_0x3342('0x42')][_0x5b2057][_0x3342('0xc9')];_0x2284bc+=0x1){_0x13c512=this[_0x3342('0x42')][_0x5b2057][_0x2284bc];if(this[_0x3342('0x13')][_0x13c512[_0x3342('0x76')]]){if(_0x13c512[_0x3342('0x9f')]&&_0x13c512[_0x3342('0xa0')]!=!![]){this[_0x3342('0x13')][_0x13c512['queue']][_0x3342('0xca')]+=0x1;}if(_0x13c512[_0x3342('0x21')]){this['voiceQueues'][_0x13c512[_0x3342('0x76')]][_0x3342('0xcb')]+=0x1;}this[_0x3342('0x13')][_0x13c512['queue']][_0x3342('0xcc')]+=moment(_0x13c512[_0x3342('0x93')])[_0x3342('0xcd')](_0x13c512[_0x3342('0x83')],_0x3342('0xa8'))||0x0;if(_0x2284bc===this[_0x3342('0x42')][_0x5b2057]['length']-0x1){this[_0x3342('0x13')][_0x13c512[_0x3342('0x76')]][_0x3342('0xce')]+=moment()[_0x3342('0xcf')](0x0)['diff'](_0x13c512[_0x3342('0x83')],'seconds');this['voiceQueues'][_0x13c512[_0x3342('0x76')]][_0x3342('0xd0')]+=0x1;if(_0x13c512[_0x3342('0x8b')]){this[_0x3342('0x13')][_0x13c512[_0x3342('0x76')]][_0x3342('0xd1')]+=0x1;this[_0x3342('0x13')][_0x13c512[_0x3342('0x76')]][_0x3342('0xd2')]+=moment()[_0x3342('0xcf')](0x0)['diff'](_0x13c512['queuecallerleaveAt'],_0x3342('0xa8'));_0x13c512[_0x3342('0x8c')]=moment()['format'](_0x3342('0x84'));_0x13c512['queuecallerexit']=![];_0x13c512[_0x3342('0xa7')]=null;}if(_0x13c512[_0x3342('0x9f')]&&_0x13c512[_0x3342('0xa0')]!=!![]){_0x13c512['lastevent']='unmanaged';logger[_0x3342('0x53')](_0x3342('0xd3'),_0x5b2057,util[_0x3342('0x45')](_0x13c512,{'showHidden':![],'depth':null}));ami[_0x3342('0x4a')]('custom:queuecallerunmanaged',_0x13c512);}if(_0x13c512['queuecallerabandon']){_0x13c512[_0x3342('0xb6')]='abandoned';logger[_0x3342('0x53')](_0x3342('0xd4'),_0x5b2057,util[_0x3342('0x45')](_0x13c512,{'showHidden':![],'depth':null}));ami[_0x3342('0x4a')](_0x3342('0xd5'),_0x13c512);}}else{this['voiceQueues'][_0x13c512['queue']][_0x3342('0xce')]+=this[_0x3342('0x13')][_0x13c512[_0x3342('0x76')]][_0x3342('0xcc')];}logger['info']('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x5b2057,_0x13c512['name'],_0x13c512[_0x3342('0x5a')],_0x39018f);if(_0x32a488&&_0x13c512[_0x3342('0x98')]==='ATTENDEDTRANSFER'){_0x13c512['queuecallerexitreason']=_0x3342('0x99');}this[_0x3342('0x38')][_0x5b2057]=_0x13c512;this[_0x3342('0x48')](_0x13c512,'hangup');}}logger[_0x3342('0x53')](_0x3342('0xd6'),_0x5b2057,util[_0x3342('0x45')](this[_0x3342('0x42')][_0x5b2057],{'showHidden':![],'depth':null}));ami['emit'](_0x3342('0xd7'),this['queueReports'][_0x5b2057]);if(_0x13c512[_0x3342('0x98')]===_0x3342('0x56')){return;}if(_0x13c512[_0x3342('0x9f')]||_0x13c512['queuecallerabandon']||_0x13c512[_0x3342('0x8b')]){delete this['queueReports'][_0x5b2057];delete this[_0x3342('0x38')][_0x5b2057];if(this[_0x3342('0x16')][_0x5b2057]){delete this[_0x3342('0x16')][_0x5b2057];}}};VoiceQueueReport[_0x3342('0xd')][_0x3342('0x2b')]=function(_0xf0408){try{if(this[_0x3342('0x5c')](_0xf0408)){logger[_0x3342('0x53')](_0x3342('0xd8'),_0xf0408['uniqueid'],util[_0x3342('0x45')](_0xf0408,{'showHidden':![],'depth':null}));if(this[_0x3342('0x42')][_0xf0408[_0x3342('0x4d')]]){return this[_0x3342('0xc8')](_0xf0408[_0x3342('0x4d')],_0xf0408['cause-txt']);}if(this['queueReports'][_0xf0408['linkedid']]){if(_0xf0408[_0x3342('0xd9')]==='21'){return;}return this[_0x3342('0xc8')](_0xf0408[_0x3342('0xa6')],_0xf0408['cause-txt'],!![]);}var _0x355f19=Object[_0x3342('0x88')](this[_0x3342('0x42')]);for(var _0x4fe578=0x0;_0x4fe578<_0x355f19[_0x3342('0xc9')];_0x4fe578++){var _0x4c8ec6=_[_0x3342('0x8a')](this[_0x3342('0x42')][_0x355f19[_0x4fe578]]);if(_0x4c8ec6&&_0x4c8ec6[_0x3342('0xda')]===_0xf0408[_0x3342('0x4d')]){return this[_0x3342('0xc8')](_0x4c8ec6['uniqueid'],_0xf0408[_0x3342('0xdb')],!![]);}}}}catch(_0x14ff63){logger[_0x3342('0x43')]('[%s][voiceQueueReport][hangup]',_0xf0408[_0x3342('0x4d')],util[_0x3342('0x45')](_0x14ff63,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3342('0xd')][_0x3342('0xdc')]=function(_0x48361f){try{if(this[_0x3342('0x5c')](_0x48361f)){logger[_0x3342('0x53')](_0x3342('0xdd'),_0x48361f[_0x3342('0x4d')],util[_0x3342('0x45')](_0x48361f,{'showHidden':![],'depth':null}));var _0x48b74d;var _0x12364b;var _0x5cc912;if(this[_0x3342('0x42')][_0x48361f[_0x3342('0xde')]]){_0x48b74d=_[_0x3342('0x8a')](this[_0x3342('0x42')][_0x48361f['transfereeuniqueid']]);_0x48b74d[_0x3342('0xaa')]=_0x48361f[_0x3342('0xdf')];_0x48b74d[_0x3342('0xac')]=_0x48361f[_0x3342('0xe0')];_0x48b74d['queuecallerexitreason']=_0x3342('0x56');_0x48b74d['transfer']=!![];_0x48b74d[_0x3342('0xa9')]=_0x3342('0xe1');if(this['queueReports'][_0x48361f[_0x3342('0xe0')]]){_0x5cc912=this['queueReports'][_0x48361f[_0x3342('0xe0')]];this[_0x3342('0x42')][_0x48361f[_0x3342('0xe0')]]=this[_0x3342('0x42')][_0x48361f[_0x3342('0xde')]];this[_0x3342('0x42')][_0x48361f[_0x3342('0xde')]]=_0x5cc912;_0x12364b=_[_0x3342('0x8a')](this[_0x3342('0x42')][_0x48361f[_0x3342('0xde')]]);_0x12364b[_0x3342('0x39')]=!![];}logger['info'](_0x3342('0xe2'),_0x48361f[_0x3342('0x4d')],_0x48b74d[_0x3342('0x50')],_0x48b74d['type'],_0x48b74d['transferexten'],_0x48b74d[_0x3342('0xac')]);}else if(this['queueReports'][_0x48361f[_0x3342('0xe3')]]){_0x48b74d=_[_0x3342('0x8a')](this[_0x3342('0x42')][_0x48361f[_0x3342('0xe3')]]);_0x48b74d[_0x3342('0xaa')]=_0x48361f[_0x3342('0xe4')];_0x48b74d[_0x3342('0xac')]=_0x48361f[_0x3342('0xe5')];_0x48b74d['queuecallerexitreason']=_0x3342('0x56');_0x48b74d[_0x3342('0xa0')]=!![];_0x48b74d['transfertype']=_0x3342('0xe1');if(this[_0x3342('0x42')][_0x48361f[_0x3342('0xe5')]]){_0x5cc912=this['queueReports'][_0x48361f['origtransfereruniqueid']];this[_0x3342('0x42')][_0x48361f[_0x3342('0xe5')]]=this[_0x3342('0x42')][_0x48361f['transfertargetuniqueid']];this[_0x3342('0x42')][_0x48361f[_0x3342('0xe3')]]=_0x5cc912;_0x12364b=_[_0x3342('0x8a')](this['queueReports'][_0x48361f[_0x3342('0xe3')]]);_0x12364b['switch']=!![];}logger['info'](_0x3342('0xe2'),_0x48361f[_0x3342('0x4d')],_0x48b74d[_0x3342('0x50')],_0x48b74d[_0x3342('0x5a')],_0x48b74d[_0x3342('0xaa')],_0x48b74d[_0x3342('0xac')]);}else if(this['queueReports'][_0x48361f[_0x3342('0xe5')]]){_0x48b74d=_[_0x3342('0x8a')](this[_0x3342('0x42')][_0x48361f[_0x3342('0xe5')]]);_0x48b74d[_0x3342('0xaa')]=_0x48361f[_0x3342('0xe4')];_0x48b74d[_0x3342('0xac')]=_0x48361f[_0x3342('0xe5')];_0x48b74d[_0x3342('0x98')]=_0x3342('0x56');_0x48b74d[_0x3342('0xa0')]=!![];_0x48b74d['transfertype']='ATTENDED';_0x48b74d['switch']=!![];_0x48b74d[_0x3342('0xda')]=_0x48361f[_0x3342('0xde')];}else if(this[_0x3342('0x42')][_0x48361f[_0x3342('0xe0')]]){_0x48b74d=_[_0x3342('0x8a')](this[_0x3342('0x42')][_0x48361f['secondtransfereruniqueid']]);_0x48b74d[_0x3342('0xaa')]=_0x48361f['secondtransfererexten'];_0x48b74d[_0x3342('0xac')]=_0x48361f[_0x3342('0xe0')];_0x48b74d[_0x3342('0x98')]=_0x3342('0x56');_0x48b74d[_0x3342('0xa0')]=!![];_0x48b74d[_0x3342('0xa9')]=_0x3342('0xe1');_0x48b74d[_0x3342('0x39')]=!![];_0x48b74d['transferid']=_0x48361f[_0x3342('0xe3')];}}}catch(_0x386b9d){logger[_0x3342('0x43')](_0x3342('0xdd'),_0x48361f['uniqueid'],util['inspect'](_0x386b9d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3342('0xd')]['syncBlindTransfer']=function(_0x2b7103){try{if(this[_0x3342('0x5c')](_0x2b7103)){logger[_0x3342('0x53')](_0x3342('0xe6'),_0x2b7103[_0x3342('0x4d')],util[_0x3342('0x45')](_0x2b7103,{'showHidden':![],'depth':null}));if(this[_0x3342('0x42')][_0x2b7103[_0x3342('0xde')]]){var _0x555cb2=_[_0x3342('0x8a')](this[_0x3342('0x42')][_0x2b7103[_0x3342('0xde')]]);_0x555cb2['queuecallerexitreason']=_0x3342('0xe7');_0x555cb2[_0x3342('0xa0')]=!![];_0x555cb2[_0x3342('0xa9')]=_0x3342('0xe8');_0x555cb2[_0x3342('0xaa')]=_0x2b7103[_0x3342('0xe9')];_0x555cb2['transferuniqueid']=_0x2b7103[_0x3342('0xde')];logger[_0x3342('0x7c')](_0x3342('0xea'),_0x2b7103[_0x3342('0x4d')],_0x555cb2['name'],_0x555cb2['type'],_0x555cb2[_0x3342('0xaa')],_0x555cb2[_0x3342('0xac')]);this[_0x3342('0x2b')]({'event':'BlindTransfer','uniqueid':_0x2b7103[_0x3342('0xde')],'context':_0x2b7103[_0x3342('0xeb')],'channel':_0x2b7103['transfererchannel']});}}}catch(_0x1fc2ec){logger[_0x3342('0x43')](_0x3342('0xe6'),_0x2b7103[_0x3342('0x4d')],util[_0x3342('0x45')](_0x1fc2ec,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3342('0xd')][_0x3342('0x2e')]=function(_0x3f880f){try{if(this[_0x3342('0x5c')](_0x3f880f)){logger['debug'](_0x3342('0xec'),_0x3f880f[_0x3342('0x4d')],util[_0x3342('0x45')](_0x3f880f,{'showHidden':![],'depth':null}));if(this[_0x3342('0x42')][_0x3f880f[_0x3342('0x4d')]]){var _0x891df3=_[_0x3342('0x8a')](this[_0x3342('0x42')][_0x3f880f[_0x3342('0x4d')]]);if(!_[_0x3342('0x3a')](_0x891df3[_0x3342('0x93')])){_0x891df3[_0x3342('0xed')]=moment()[_0x3342('0x4e')](_0x3342('0x84'));logger[_0x3342('0x7c')](_0x3342('0xee'),_0x3f880f[_0x3342('0x4d')],_0x891df3[_0x3342('0xed')]);}}}}catch(_0x217951){logger[_0x3342('0x43')](_0x3342('0xec'),_0x3f880f['uniqueid'],util[_0x3342('0x45')](_0x217951,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3342('0xd')][_0x3342('0x30')]=function(_0x34b9bd){try{if(this['isNotNull'](_0x34b9bd)){logger[_0x3342('0x53')]('[%s][voiceQueueReport][musiconholdstop]',_0x34b9bd[_0x3342('0x4d')],util['inspect'](_0x34b9bd,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x34b9bd[_0x3342('0x4d')]]){var _0x43bf9a=_[_0x3342('0x8a')](this['queueReports'][_0x34b9bd[_0x3342('0x4d')]]);if(!_[_0x3342('0x3a')](_0x43bf9a[_0x3342('0xed')])){_0x43bf9a[_0x3342('0xef')]+=moment()[_0x3342('0xcf')](0x0)[_0x3342('0xcd')](_0x43bf9a[_0x3342('0xed')],'seconds');logger[_0x3342('0x7c')]('[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s',_0x34b9bd[_0x3342('0x4d')],_0x43bf9a[_0x3342('0xef')]);delete _0x43bf9a[_0x3342('0xed')];}}}}catch(_0x59ff5d){logger[_0x3342('0x43')](_0x3342('0xf0'),_0x34b9bd[_0x3342('0x4d')],util[_0x3342('0x45')](_0x59ff5d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3342('0xd')][_0x3342('0xf1')]=function(_0x34af41){try{if(this['isNotNull'](_0x34af41)){logger[_0x3342('0x53')](_0x3342('0xf2'),_0x34af41[_0x3342('0x4d')],util[_0x3342('0x45')](_0x34af41,{'showHidden':![],'depth':null}));if(_0x34af41[_0x3342('0xf3')][_0x3342('0xa4')]()==='set'){_0x34af41[_0x3342('0xf4')]=_0x34af41[_0x3342('0xf5')]&&_0x34af41['appdata']['startsWith'](_0x3342('0xf6'))?_0x34af41[_0x3342('0xf5')]:(_0x34af41[_0x3342('0xf5')]||_0x34af41['applicationdata'])[_0x3342('0xa4')]();if(_[_0x3342('0xf7')](_0x34af41[_0x3342('0xf4')][_0x3342('0xa4')](),'cdr(')){logger[_0x3342('0x7c')]('[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s',_0x34af41['uniqueid'],_0x34af41[_0x3342('0xf3')],_0x34af41[_0x3342('0xf4')]);if(_['isUndefined'](this[_0x3342('0x38')][_0x34af41[_0x3342('0x4d')]]))this[_0x3342('0x38')][_0x34af41[_0x3342('0x4d')]]={};var _0x4fff6f=_0x34af41[_0x3342('0xf4')][_0x3342('0xf8')]('=');var _0x2f76ab=_0x4fff6f[0x0][_0x3342('0xa4')]()[_0x3342('0xf9')](/cdr\((.*)\)/);if(_0x2f76ab)this[_0x3342('0x38')][_0x34af41[_0x3342('0x4d')]][_0x2f76ab[0x1]]=_0x4fff6f[0x1];}}}}catch(_0x62ee84){logger['error']('[%s][voiceQueueReport][newexten]',_0x34af41[_0x3342('0x4d')],util[_0x3342('0x45')](_0x62ee84,{'showHidden':![],'depth':null}));}};module[_0x3342('0xfa')]=VoiceQueueReport;
\ No newline at end of file
index 1d0a74e..eac5fc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9da9=['createHistory','queue','Request','CreateReportAgentPreview','../client'];(function(_0x2e75c2,_0x20841f){var _0x34bb9c=function(_0x22aafa){while(--_0x22aafa){_0x2e75c2['push'](_0x2e75c2['shift']());}};_0x34bb9c(++_0x20841f);}(_0x9da9,0xf9));var _0x99da=function(_0x11df66,_0x9eabf){_0x11df66=_0x11df66-0x0;var _0xc2dca1=_0x9da9[_0x11df66];return _0xc2dca1;};'use strict';var client=require(_0x99da('0x0'));exports[_0x99da('0x1')]=function(_0x3b001e){return function(){_0x3b001e['campaign']=_0x3b001e[_0x99da('0x2')];return client[_0x99da('0x3')]('CreateReportAgentPreview',{'body':_0x3b001e,'log':_0x99da('0x4')});};};
\ No newline at end of file
+var _0x323d=['Request','CreateReportAgentPreview','../client','createHistory','campaign','queue'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x323d,0x7a));var _0xd323=function(_0x5e6ebe,_0x373752){_0x5e6ebe=_0x5e6ebe-0x0;var _0x5d80a0=_0x323d[_0x5e6ebe];return _0x5d80a0;};'use strict';var client=require(_0xd323('0x0'));exports[_0xd323('0x1')]=function(_0xf4364a){return function(){_0xf4364a[_0xd323('0x2')]=_0xf4364a[_0xd323('0x3')];return client[_0xd323('0x4')](_0xd323('0x5'),{'body':_0xf4364a,'log':_0xd323('0x5')});};};
\ No newline at end of file
index 3675a01..27b2a4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8d7=['create','CreateAttachment','../client'];(function(_0x11d45b,_0xf2ade5){var _0x57bfca=function(_0x103fd7){while(--_0x103fd7){_0x11d45b['push'](_0x11d45b['shift']());}};_0x57bfca(++_0xf2ade5);}(_0xa8d7,0x1b8));var _0x7a8d=function(_0x532d78,_0x25b6a8){_0x532d78=_0x532d78-0x0;var _0x5990c4=_0xa8d7[_0x532d78];return _0x5990c4;};'use strict';var client=require(_0x7a8d('0x0'));exports[_0x7a8d('0x1')]=function(_0x4787af){return client['Request'](_0x7a8d('0x2'),{'body':_0x4787af,'log':_0x7a8d('0x2')});};
\ No newline at end of file
+var _0x6b14=['CreateAttachment','../client','create','Request'];(function(_0x444356,_0x58ab89){var _0x316728=function(_0x18ccbf){while(--_0x18ccbf){_0x444356['push'](_0x444356['shift']());}};_0x316728(++_0x58ab89);}(_0x6b14,0xcd));var _0x46b1=function(_0x3ee168,_0x4f8306){_0x3ee168=_0x3ee168-0x0;var _0x5185ab=_0x6b14[_0x3ee168];return _0x5185ab;};'use strict';var client=require(_0x46b1('0x0'));exports[_0x46b1('0x1')]=function(_0x588677){return client[_0x46b1('0x2')](_0x46b1('0x3'),{'body':_0x588677,'log':_0x46b1('0x3')});};
\ No newline at end of file
index 00972e7..91f8d84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['Trunk','active','TrunkBackup','callerid','Interval','Intervals','interval','SquareProject','getCampaign','../client','getCampaigns','Request','GetCampaign','name','type','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalInterval','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit'];(function(_0x3f3f06,_0x581e5b){var _0x140feb=function(_0x4cc383){while(--_0x4cc383){_0x3f3f06['push'](_0x3f3f06['shift']());}};_0x140feb(++_0x581e5b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xc4aa[_0x2064e5];return _0x21a233;};'use strict';var client=require(_0xac4a('0x0'));exports[_0xac4a('0x1')]=function(){return function(){return client[_0xac4a('0x2')](_0xac4a('0x3'),{'options':{'raw':![],'attributes':['id',_0xac4a('0x4'),_0xac4a('0x5'),'active','limitCalls','dialOriginateCallerIdName',_0xac4a('0x6'),_0xac4a('0x7'),_0xac4a('0x8'),_0xac4a('0x9'),_0xac4a('0xa'),_0xac4a('0xb'),_0xac4a('0xc'),_0xac4a('0xd'),'dialGlobalMaxRetry','dialNoSuchNumberMaxRetry',_0xac4a('0xe'),_0xac4a('0xf'),_0xac4a('0x10'),'dialAbandonedMaxRetry',_0xac4a('0x11'),_0xac4a('0x12'),_0xac4a('0x13'),'dialAgentRejectMaxRetry',_0xac4a('0x14'),'dialTimezone',_0xac4a('0x15'),'dialAMDActive',_0xac4a('0x16'),_0xac4a('0x17'),_0xac4a('0x18'),'dialAMDTotalAnalysisTime',_0xac4a('0x19'),_0xac4a('0x1a'),_0xac4a('0x1b'),_0xac4a('0x1c'),_0xac4a('0x1d'),_0xac4a('0x1e'),_0xac4a('0x1f'),_0xac4a('0x20'),_0xac4a('0x21')],'include':[{'model':_0xac4a('0x22'),'as':_0xac4a('0x22'),'attributes':['id',_0xac4a('0x4'),'callerid',_0xac4a('0x23')]},{'model':_0xac4a('0x22'),'as':_0xac4a('0x24'),'attributes':['id',_0xac4a('0x4'),_0xac4a('0x25'),_0xac4a('0x23')]},{'model':_0xac4a('0x26'),'as':_0xac4a('0x26'),'attributes':['id','name'],'include':[{'model':'Interval','as':_0xac4a('0x27'),'attributes':['id',_0xac4a('0x4'),_0xac4a('0x28')]}]},{'model':'SquareProject','as':_0xac4a('0x29'),'attributes':['id',_0xac4a('0x4')]}]},'log':_0xac4a('0x2a')});};};
\ No newline at end of file
+var _0x1261=['Interval','interval','SquareProject','getCampaign','getCampaigns','Request','GetCampaign','name','type','active','limitCalls','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialGlobalInterval','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','TrunkBackup','callerid'];(function(_0x4ac609,_0x6ea686){var _0x4a7e2b=function(_0x347632){while(--_0x347632){_0x4ac609['push'](_0x4ac609['shift']());}};_0x4a7e2b(++_0x6ea686);}(_0x1261,0x144));var _0x1126=function(_0x5d572c,_0x53581f){_0x5d572c=_0x5d572c-0x0;var _0x5797cf=_0x1261[_0x5d572c];return _0x5797cf;};'use strict';var client=require('../client');exports[_0x1126('0x0')]=function(){return function(){return client[_0x1126('0x1')](_0x1126('0x2'),{'options':{'raw':![],'attributes':['id',_0x1126('0x3'),_0x1126('0x4'),_0x1126('0x5'),_0x1126('0x6'),_0x1126('0x7'),_0x1126('0x8'),_0x1126('0x9'),'dialCongestionMaxRetry','dialCongestionRetryFrequency',_0x1126('0xa'),_0x1126('0xb'),'dialNoAnswerMaxRetry',_0x1126('0xc'),_0x1126('0xd'),_0x1126('0xe'),_0x1126('0xf'),_0x1126('0x10'),'dialDropRetryFrequency',_0x1126('0x11'),_0x1126('0x12'),_0x1126('0x13'),'dialMachineRetryFrequency',_0x1126('0x14'),'dialAgentRejectRetryFrequency','dialTimezone',_0x1126('0x15'),'dialAMDActive',_0x1126('0x16'),_0x1126('0x17'),_0x1126('0x18'),_0x1126('0x19'),_0x1126('0x1a'),_0x1126('0x1b'),_0x1126('0x1c'),_0x1126('0x1d'),_0x1126('0x1e'),'dialOrderByScheduledAt','dialPrefix',_0x1126('0x1f'),_0x1126('0x20')],'include':[{'model':_0x1126('0x21'),'as':'Trunk','attributes':['id',_0x1126('0x3'),'callerid',_0x1126('0x5')]},{'model':_0x1126('0x21'),'as':_0x1126('0x22'),'attributes':['id','name',_0x1126('0x23'),_0x1126('0x5')]},{'model':'Interval','as':'Interval','attributes':['id',_0x1126('0x3')],'include':[{'model':_0x1126('0x24'),'as':'Intervals','attributes':['id','name',_0x1126('0x25')]}]},{'model':'SquareProject','as':_0x1126('0x26'),'attributes':['id',_0x1126('0x3')]}]},'log':_0x1126('0x27')});};};
\ No newline at end of file
index 87351d0..3523d9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x111e=['Request','CreateCmContact','GetCmContact','../client'];(function(_0x22cb5f,_0x2cdd63){var _0x274d36=function(_0x421472){while(--_0x421472){_0x22cb5f['push'](_0x22cb5f['shift']());}};_0x274d36(++_0x2cdd63);}(_0x111e,0x9b));var _0xe111=function(_0x3286be,_0x12d34d){_0x3286be=_0x3286be-0x0;var _0x3e7f1e=_0x111e[_0x3286be];return _0x3e7f1e;};'use strict';var client=require(_0xe111('0x0'));exports['createContact']=function(_0x5a583e){return function(){return client[_0xe111('0x1')](_0xe111('0x2'),{'body':_0x5a583e,'log':'CreateCmContact'});};};exports['getContacts']=function(_0x1cf8cd){return function(){return client[_0xe111('0x1')](_0xe111('0x3'),{'options':_0x1cf8cd,'log':_0xe111('0x3')});};};
\ No newline at end of file
+var _0xc3ed=['../client','Request','CreateCmContact','getContacts','GetCmContact'];(function(_0x4e782b,_0x5b89e9){var _0x29851e=function(_0x4b6169){while(--_0x4b6169){_0x4e782b['push'](_0x4e782b['shift']());}};_0x29851e(++_0x5b89e9);}(_0xc3ed,0x1a4));var _0xdc3e=function(_0x3aa479,_0x571eb3){_0x3aa479=_0x3aa479-0x0;var _0x532c28=_0xc3ed[_0x3aa479];return _0x532c28;};'use strict';var client=require(_0xdc3e('0x0'));exports['createContact']=function(_0xb94ccc){return function(){return client[_0xdc3e('0x1')](_0xdc3e('0x2'),{'body':_0xb94ccc,'log':_0xdc3e('0x2')});};};exports[_0xdc3e('0x3')]=function(_0x4eb01f){return function(){return client['Request'](_0xdc3e('0x4'),{'options':_0x4eb01f,'log':'GetCmContact'});};};
\ No newline at end of file
index e7cfe7c..575b38f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0ca=['priority','DESC','ASC','getContactDialerIvr','CmContact','GetContactDialerIvr','moveContactManagedDialer','campaign','MoveContactManagedDialer','ListId','countReScheduled','CountReScheduled','getContactPreview','GetCmHopperPreview','Contact','Agent','name','VoiceQueue','Queue','getCmHopper','GetContactRecallMe','User','voicePause','db.CmHopper.UserId','resetActiveCalls','ResetActiveCalls','handlePreviewRecallNotifications','CmHopperHandlePreviewRecallNotifications','getContacts','Request','updateContacts','UpdateCmHopper','format','rescheduleContact','VoiceQueueId','CampaignId','destroyContact','DestroyCmHopper','getContactDialer','GetContactDialer','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xd0ca,0x18d));var _0xad0c=function(_0x1c69e2,_0x497842){_0x1c69e2=_0x1c69e2-0x0;var _0x46d934=_0xd0ca[_0x1c69e2];return _0x46d934;};'use strict';var client=require('../client');var moment=require('moment');exports[_0xad0c('0x0')]=function(_0x130ca0,_0x2a9e1a){return function(){return client[_0xad0c('0x1')]('GetCmHopper',{'options':{'where':{'VoiceQueueId':_0x130ca0},'include':[{'model':'CmContact','as':'Contact'}],'limit':_0x2a9e1a,'raw':![]},'log':'getCmHopper'});};};exports[_0xad0c('0x2')]=function(_0x206ef7,_0x5b8512,_0x4fbd00){return function(){return client[_0xad0c('0x1')](_0xad0c('0x3'),{'body':_0x206ef7,'options':{'where':{'VoiceQueueId':_0x5b8512,'scheduledat':{'$lte':moment()[_0xad0c('0x4')]('YYYY-MM-DD\x20HH:mm:ss')}},'limit':_0x4fbd00},'log':_0xad0c('0x3')});};};exports[_0xad0c('0x5')]=function(_0x2ac931){return function(){return client[_0xad0c('0x1')](_0xad0c('0x3'),{'body':_0x2ac931,'options':{'where':{'ContactId':_0x2ac931['ContactId'],'ListId':_0x2ac931['ListId'],'VoiceQueueId':_0x2ac931[_0xad0c('0x6')],'CampaignId':_0x2ac931[_0xad0c('0x7')]}},'log':_0xad0c('0x5')});};};exports[_0xad0c('0x8')]=function(_0x18a90e,_0x15887c,_0x20c880){return function(){return client[_0xad0c('0x1')](_0xad0c('0x9'),{'options':{'where':{'VoiceQueueId':_0x18a90e,'ListId':_0x15887c,'ContactId':_0x20c880}},'log':_0xad0c('0x9')});};};exports[_0xad0c('0xa')]=function(_0x5b8dd6,_0x4e360b,_0x16097d,_0x282866){return function(){return client[_0xad0c('0x1')](_0xad0c('0xb'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x5b8dd6,'active':![],'scheduledat':{'$lte':moment()[_0xad0c('0x4')](_0xad0c('0xc'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x4e360b}}]},'order':[[_0xad0c('0xd'),_0xad0c('0xe')],['scheduledat',_0x282866],['id',_0xad0c('0xf')]],'raw':!![],'limit':_0x16097d},'log':_0xad0c('0xb')});};};exports[_0xad0c('0x10')]=function(_0x1ef327,_0x4eb508,_0x2c21da){return function(){return client[_0xad0c('0x1')](_0xad0c('0xb'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x1ef327,'active':![],'scheduledat':{'$lte':moment()[_0xad0c('0x4')](_0xad0c('0xc'))}},'include':[{'model':_0xad0c('0x11'),'as':'Contact'}],'order':[[_0xad0c('0xd'),_0xad0c('0xe')],['scheduledat',_0x2c21da],['id','ASC']],'raw':!![],'limit':_0x4eb508},'log':_0xad0c('0x12')});};};exports[_0xad0c('0x13')]=function(_0xb07440,_0x19431f){return function(){_0xb07440[_0xad0c('0x14')]=_0xb07440['queue'];return client[_0xad0c('0x1')](_0xad0c('0x15'),{'body':_0xb07440,'options':{'where':{'ContactId':_0xb07440['ContactId'],'ListId':_0xb07440[_0xad0c('0x16')],'VoiceQueueId':_0xb07440[_0xad0c('0x6')],'CampaignId':_0xb07440[_0xad0c('0x7')],'active':_0x19431f?undefined:!![]}},'log':_0xad0c('0x15')});};};exports[_0xad0c('0x17')]=function(_0xe01df9){return function(){return client[_0xad0c('0x1')](_0xad0c('0x18'),{'options':{'where':{'VoiceQueueId':_0xe01df9['id']?_0xe01df9['id']||null:null}},'log':'countReScheduled'});};};exports[_0xad0c('0x19')]=function(_0x6624f3){return function(){return client[_0xad0c('0x1')](_0xad0c('0x1a'),{'options':{'where':{'id':_0x6624f3},'include':[{'model':_0xad0c('0x11'),'as':_0xad0c('0x1b')},{'model':'User','as':_0xad0c('0x1c'),'attributes':['id',_0xad0c('0x1d')]},{'model':_0xad0c('0x1e'),'as':_0xad0c('0x1f'),'attributes':['id',_0xad0c('0x1d')]}],'raw':!![]},'log':_0xad0c('0x20')});};};exports['unlockContact']=function(_0x1bc22f,_0x516506,_0x4a552d){return function(){return client[_0xad0c('0x1')]('UpdateCmHopper',{'body':_0x1bc22f,'options':{'where':{'id':_0x516506},'limit':_0x4a552d},'log':'UpdateCmHopper'});};};exports['getContactRecallMe']=function(_0x4a5164,_0x10e74a){return function(){return client[_0xad0c('0x1')](_0xad0c('0x21'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x4a5164,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0xad0c('0x4')](_0xad0c('0xc'))},'UserId':{'$in':_0x10e74a}},'order':[['priority',_0xad0c('0xe')],['scheduledat',_0xad0c('0xe')],['id',_0xad0c('0xf')]],'include':[{'model':'CmContact','as':_0xad0c('0x1b')},{'model':_0xad0c('0x22'),'as':_0xad0c('0x1c'),'attributes':['id',_0xad0c('0x1d'),_0xad0c('0x23')]}],'group':_0xad0c('0x24'),'raw':!![]},'log':_0xad0c('0xb')});};};exports[_0xad0c('0x25')]=function(_0x131a34,_0x2a4657){return client[_0xad0c('0x1')](_0xad0c('0x26'),{'body':_0x131a34,'options':_0x2a4657||{},'log':_0xad0c('0x26')});};exports[_0xad0c('0x27')]=function(_0x56ec46,_0x2f338b,_0x4960d6){return function(){return client[_0xad0c('0x1')](_0xad0c('0x28'),{'body':{'where':{'voiceQueueIds':_0x56ec46,'interval':_0x2f338b,'availableAgentsIds':_0x4960d6}},'log':_0xad0c('0x27')});};};
\ No newline at end of file
+var _0x2958=['VoiceQueue','getContactRecallMe','GetContactRecallMe','priority','voicePause','db.CmHopper.UserId','resetActiveCalls','ResetActiveCalls','handlePreviewRecallNotifications','../client','moment','Request','GetCmHopper','CmContact','Contact','getCmHopper','updateContacts','UpdateCmHopper','format','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','ContactId','VoiceQueueId','CampaignId','destroyContact','DestroyCmHopper','DESC','scheduledat','ASC','GetContactDialer','getContactDialerIvr','GetContactDialerIvr','moveContactManagedDialer','campaign','MoveContactManagedDialer','CountReScheduled','countReScheduled','getContactPreview','GetCmHopperPreview','User','Agent','name'];(function(_0x3c2d87,_0x623ad){var _0x142d3c=function(_0x3fa5a5){while(--_0x3fa5a5){_0x3c2d87['push'](_0x3c2d87['shift']());}};_0x142d3c(++_0x623ad);}(_0x2958,0x105));var _0x8295=function(_0x2887cf,_0x5cdf79){_0x2887cf=_0x2887cf-0x0;var _0x22bd8a=_0x2958[_0x2887cf];return _0x22bd8a;};'use strict';var client=require(_0x8295('0x0'));var moment=require(_0x8295('0x1'));exports['getContacts']=function(_0x235611,_0x50aa35){return function(){return client[_0x8295('0x2')](_0x8295('0x3'),{'options':{'where':{'VoiceQueueId':_0x235611},'include':[{'model':_0x8295('0x4'),'as':_0x8295('0x5')}],'limit':_0x50aa35,'raw':![]},'log':_0x8295('0x6')});};};exports[_0x8295('0x7')]=function(_0x54175f,_0x123e86,_0x1a5953){return function(){return client[_0x8295('0x2')](_0x8295('0x8'),{'body':_0x54175f,'options':{'where':{'VoiceQueueId':_0x123e86,'scheduledat':{'$lte':moment()[_0x8295('0x9')](_0x8295('0xa'))}},'limit':_0x1a5953},'log':_0x8295('0x8')});};};exports[_0x8295('0xb')]=function(_0x501469){return function(){return client[_0x8295('0x2')](_0x8295('0x8'),{'body':_0x501469,'options':{'where':{'ContactId':_0x501469[_0x8295('0xc')],'ListId':_0x501469['ListId'],'VoiceQueueId':_0x501469[_0x8295('0xd')],'CampaignId':_0x501469[_0x8295('0xe')]}},'log':_0x8295('0xb')});};};exports[_0x8295('0xf')]=function(_0x2255b1,_0x5130e1,_0x3cd384){return function(){return client[_0x8295('0x2')](_0x8295('0x10'),{'options':{'where':{'VoiceQueueId':_0x2255b1,'ListId':_0x5130e1,'ContactId':_0x3cd384}},'log':'DestroyCmHopper'});};};exports['getContactDialer']=function(_0x4b089f,_0x3ea897,_0x28aad0,_0x47e648){return function(){return client[_0x8295('0x2')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x4b089f,'active':![],'scheduledat':{'$lte':moment()[_0x8295('0x9')](_0x8295('0xa'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x3ea897}}]},'order':[['priority',_0x8295('0x11')],[_0x8295('0x12'),_0x47e648],['id',_0x8295('0x13')]],'raw':!![],'limit':_0x28aad0},'log':_0x8295('0x14')});};};exports[_0x8295('0x15')]=function(_0x33900a,_0x2f5b5e,_0x3bc91a){return function(){return client['Request']('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x33900a,'active':![],'scheduledat':{'$lte':moment()[_0x8295('0x9')](_0x8295('0xa'))}},'include':[{'model':_0x8295('0x4'),'as':_0x8295('0x5')}],'order':[['priority',_0x8295('0x11')],[_0x8295('0x12'),_0x3bc91a],['id',_0x8295('0x13')]],'raw':!![],'limit':_0x2f5b5e},'log':_0x8295('0x16')});};};exports[_0x8295('0x17')]=function(_0x596c74,_0x560681){return function(){_0x596c74[_0x8295('0x18')]=_0x596c74['queue'];return client[_0x8295('0x2')](_0x8295('0x19'),{'body':_0x596c74,'options':{'where':{'ContactId':_0x596c74[_0x8295('0xc')],'ListId':_0x596c74['ListId'],'VoiceQueueId':_0x596c74[_0x8295('0xd')],'CampaignId':_0x596c74['CampaignId'],'active':_0x560681?undefined:!![]}},'log':_0x8295('0x19')});};};exports['countReScheduled']=function(_0x1c2285){return function(){return client['Request'](_0x8295('0x1a'),{'options':{'where':{'VoiceQueueId':_0x1c2285['id']?_0x1c2285['id']||null:null}},'log':_0x8295('0x1b')});};};exports[_0x8295('0x1c')]=function(_0x512fbb){return function(){return client[_0x8295('0x2')](_0x8295('0x1d'),{'options':{'where':{'id':_0x512fbb},'include':[{'model':_0x8295('0x4'),'as':_0x8295('0x5')},{'model':_0x8295('0x1e'),'as':_0x8295('0x1f'),'attributes':['id',_0x8295('0x20')]},{'model':_0x8295('0x21'),'as':'Queue','attributes':['id',_0x8295('0x20')]}],'raw':!![]},'log':_0x8295('0x6')});};};exports['unlockContact']=function(_0x130479,_0x1dc72f,_0x15c229){return function(){return client[_0x8295('0x2')]('UpdateCmHopper',{'body':_0x130479,'options':{'where':{'id':_0x1dc72f},'limit':_0x15c229},'log':_0x8295('0x8')});};};exports[_0x8295('0x22')]=function(_0x3e7159,_0x139351){return function(){return client[_0x8295('0x2')](_0x8295('0x23'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x3e7159,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x8295('0x9')](_0x8295('0xa'))},'UserId':{'$in':_0x139351}},'order':[[_0x8295('0x24'),'DESC'],['scheduledat',_0x8295('0x11')],['id',_0x8295('0x13')]],'include':[{'model':_0x8295('0x4'),'as':_0x8295('0x5')},{'model':_0x8295('0x1e'),'as':'Agent','attributes':['id',_0x8295('0x20'),_0x8295('0x25')]}],'group':_0x8295('0x26'),'raw':!![]},'log':_0x8295('0x14')});};};exports[_0x8295('0x27')]=function(_0x4276e9,_0x33106a){return client[_0x8295('0x2')](_0x8295('0x28'),{'body':_0x4276e9,'options':_0x33106a||{},'log':_0x8295('0x28')});};exports['handlePreviewRecallNotifications']=function(_0x503e65,_0xe95c1e,_0x1618a8){return function(){return client[_0x8295('0x2')]('CmHopperHandlePreviewRecallNotifications',{'body':{'where':{'voiceQueueIds':_0x503e65,'interval':_0xe95c1e,'availableAgentsIds':_0x1618a8}},'log':_0x8295('0x29')});};};
\ No newline at end of file
index ed6ff16..1dfe20d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdea7=['SwapAdditionalPhones','incrementPreviewCounters','../client','verifyAdditionalPhones','Request','VerifyAdditionalPhones','swapAdditionalPhones'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xdea7,0x19f));var _0x7dea=function(_0x51c1dc,_0x827809){_0x51c1dc=_0x51c1dc-0x0;var _0x4ed7c7=_0xdea7[_0x51c1dc];return _0x4ed7c7;};'use strict';var client=require(_0x7dea('0x0'));var moment=require('moment');exports[_0x7dea('0x1')]=function(_0x264f33,_0x5e0eb4,_0x5c2072){return function(){return client[_0x7dea('0x2')](_0x7dea('0x3'),{'body':_0x264f33,'reason':_0x5e0eb4,'entity':_0x5c2072,'log':_0x7dea('0x3')});};};exports[_0x7dea('0x4')]=function(_0x2cf82e,_0x4d00ac,_0x49f68e){return function(){return client[_0x7dea('0x2')]('SwapAdditionalPhones',{'body':_0x2cf82e,'duration':_0x4d00ac,'waitTime':_0x49f68e,'log':_0x7dea('0x5')});};};exports[_0x7dea('0x6')]=function(_0x3eb080){return function(){return client[_0x7dea('0x2')]('IncrementPreviewCounters',{'body':_0x3eb080,'log':'IncrementPreviewCounters'});};};
\ No newline at end of file
+var _0x45eb=['incrementPreviewCounters','IncrementPreviewCounters','../client','moment','verifyAdditionalPhones','Request','VerifyAdditionalPhones','swapAdditionalPhones','SwapAdditionalPhones'];(function(_0x1f27df,_0x4f1a64){var _0x286ee2=function(_0x255ea7){while(--_0x255ea7){_0x1f27df['push'](_0x1f27df['shift']());}};_0x286ee2(++_0x4f1a64);}(_0x45eb,0x13d));var _0xb45e=function(_0x180fc8,_0x169157){_0x180fc8=_0x180fc8-0x0;var _0x411749=_0x45eb[_0x180fc8];return _0x411749;};'use strict';var client=require(_0xb45e('0x0'));var moment=require(_0xb45e('0x1'));exports[_0xb45e('0x2')]=function(_0x4e851d,_0x508731,_0x25976e){return function(){return client[_0xb45e('0x3')](_0xb45e('0x4'),{'body':_0x4e851d,'reason':_0x508731,'entity':_0x25976e,'log':'VerifyAdditionalPhones'});};};exports[_0xb45e('0x5')]=function(_0x2c52c3,_0x439c0d,_0x15df37){return function(){return client['Request'](_0xb45e('0x6'),{'body':_0x2c52c3,'duration':_0x439c0d,'waitTime':_0x15df37,'log':_0xb45e('0x6')});};};exports[_0xb45e('0x7')]=function(_0x3eae80){return function(){return client[_0xb45e('0x3')](_0xb45e('0x8'),{'body':_0x3eae80,'log':_0xb45e('0x8')});};};
\ No newline at end of file
index 2cccb21..625abf4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35ce=['Request','GetCmHopperBlack','VoiceQueueId','phone','checkIsBlackListIvr','CampaignId','GetCmHopperBlackIvr','../client','checkIsBlackList'];(function(_0x19daba,_0x571082){var _0x5690aa=function(_0x39a2c1){while(--_0x39a2c1){_0x19daba['push'](_0x19daba['shift']());}};_0x5690aa(++_0x571082);}(_0x35ce,0x15d));var _0xe35c=function(_0x51bddf,_0x46f7c7){_0x51bddf=_0x51bddf-0x0;var _0x4f78c0=_0x35ce[_0x51bddf];return _0x4f78c0;};'use strict';var client=require(_0xe35c('0x0'));exports[_0xe35c('0x1')]=function(_0x61f53b){return function(){return client[_0xe35c('0x2')](_0xe35c('0x3'),{'options':{'where':{'VoiceQueueId':_0x61f53b[_0xe35c('0x4')],'phone':_0x61f53b[_0xe35c('0x5')]},'raw':![]},'log':_0xe35c('0x3')});};};exports[_0xe35c('0x6')]=function(_0x32a83f){return function(){return client[_0xe35c('0x2')]('GetCmHopperBlack',{'options':{'where':{'CampaignId':_0x32a83f[_0xe35c('0x7')],'phone':_0x32a83f[_0xe35c('0x5')]},'raw':![]},'log':_0xe35c('0x8')});};};
\ No newline at end of file
+var _0x8ddd=['Request','GetCmHopperBlack','phone','GetCmHopperBlackIvr','checkIsBlackList'];(function(_0xd7c426,_0x5ae659){var _0x272197=function(_0x15d390){while(--_0x15d390){_0xd7c426['push'](_0xd7c426['shift']());}};_0x272197(++_0x5ae659);}(_0x8ddd,0x135));var _0xd8dd=function(_0x472e57,_0x398470){_0x472e57=_0x472e57-0x0;var _0x387b20=_0x8ddd[_0x472e57];return _0x387b20;};'use strict';var client=require('../client');exports[_0xd8dd('0x0')]=function(_0x4502bb){return function(){return client[_0xd8dd('0x1')](_0xd8dd('0x2'),{'options':{'where':{'VoiceQueueId':_0x4502bb['VoiceQueueId'],'phone':_0x4502bb[_0xd8dd('0x3')]},'raw':![]},'log':_0xd8dd('0x2')});};};exports['checkIsBlackListIvr']=function(_0x2a46c1){return function(){return client[_0xd8dd('0x1')](_0xd8dd('0x2'),{'options':{'where':{'CampaignId':_0x2a46c1['CampaignId'],'phone':_0x2a46c1['phone']},'raw':![]},'log':_0xd8dd('0x4')});};};
\ No newline at end of file
index 1fd382a..618046d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29e5=['createContact','queue','Request','CreateCmHopperFinal'];(function(_0x4dd27d,_0x5a0d25){var _0x550e48=function(_0x47713f){while(--_0x47713f){_0x4dd27d['push'](_0x4dd27d['shift']());}};_0x550e48(++_0x5a0d25);}(_0x29e5,0x78));var _0x529e=function(_0x222a22,_0x137dfe){_0x222a22=_0x222a22-0x0;var _0x2e0ab8=_0x29e5[_0x222a22];return _0x2e0ab8;};'use strict';var client=require('../client');exports[_0x529e('0x0')]=function(_0x40d1bd){return function(){_0x40d1bd['campaign']=_0x40d1bd[_0x529e('0x1')];return client[_0x529e('0x2')](_0x529e('0x3'),{'body':_0x40d1bd,'log':_0x529e('0x3')});};};
\ No newline at end of file
+var _0x5237=['createContact','campaign','Request','CreateCmHopperFinal','../client'];(function(_0x3fa05a,_0x4d8afb){var _0x1871a4=function(_0x5e22da){while(--_0x5e22da){_0x3fa05a['push'](_0x3fa05a['shift']());}};_0x1871a4(++_0x4d8afb);}(_0x5237,0xdb));var _0x7523=function(_0x5a991b,_0x2edaa8){_0x5a991b=_0x5a991b-0x0;var _0x1bce61=_0x5237[_0x5a991b];return _0x1bce61;};'use strict';var client=require(_0x7523('0x0'));exports[_0x7523('0x1')]=function(_0x4e2b71){return function(){_0x4e2b71[_0x7523('0x2')]=_0x4e2b71['queue'];return client[_0x7523('0x3')](_0x7523('0x4'),{'body':_0x4e2b71,'log':_0x7523('0x4')});};};
\ No newline at end of file
index 16825ec..69df4ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1187=['endOf','queue','GetCampaignHopperHistory','ivr','../client','moment','createHistory','Request','CreateCmHopperHistory','avgHandleTime','AvgHandleTime','subtract','minutes','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','day'];(function(_0x3aa2ba,_0x57e96e){var _0x907f7c=function(_0x4906f1){while(--_0x4906f1){_0x3aa2ba['push'](_0x3aa2ba['shift']());}};_0x907f7c(++_0x57e96e);}(_0x1187,0x134));var _0x7118=function(_0x19df87,_0x107c48){_0x19df87=_0x19df87-0x0;var _0x3b5723=_0x1187[_0x19df87];return _0x3b5723;};'use strict';var client=require(_0x7118('0x0'));var moment=require(_0x7118('0x1'));exports[_0x7118('0x2')]=function(_0x5286e1){return function(){_0x5286e1['campaign']=_0x5286e1['queue'];return client[_0x7118('0x3')](_0x7118('0x4'),{'body':_0x5286e1,'log':_0x7118('0x4')});};};exports[_0x7118('0x5')]=function(_0x45b32a){return function(){return client[_0x7118('0x3')](_0x7118('0x6'),{'options':{'where':{'endtime':{'$between':[moment()[_0x7118('0x7')](_0x45b32a,_0x7118('0x8'))[_0x7118('0x9')](_0x7118('0xa')),moment()[_0x7118('0x9')](_0x7118('0xa'))]}},'raw':![]},'log':_0x7118('0xb')});};};exports[_0x7118('0xc')]=function(_0xf9fd24){return function(){return client[_0x7118('0x3')](_0x7118('0xd'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x7118('0xe'))[_0x7118('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x7118('0xf')]('day')[_0x7118('0x9')](_0x7118('0xa'))]},'campaigntype':_0x7118('0x10')},'raw':![]},'log':_0x7118('0xd')});};};exports['getCampaignHopperHistory']=function(_0x3b0416){return function(){return client[_0x7118('0x3')](_0x7118('0x11'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x7118('0xe'))[_0x7118('0x9')](_0x7118('0xa')),moment()[_0x7118('0xf')](_0x7118('0xe'))['format'](_0x7118('0xa'))]},'campaigntype':_0x7118('0x12')},'raw':![]},'log':_0x7118('0x11')});};};
\ No newline at end of file
+var _0xf76e=['moment','createHistory','campaign','queue','CreateCmHopperHistory','avgHandleTime','Request','AvgHandleTime','subtract','minutes','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','endOf','day','getCampaignHopperHistory','GetCampaignHopperHistory','startOf','ivr','../client'];(function(_0xe12e7c,_0x48c85e){var _0x587975=function(_0x35d8b2){while(--_0x35d8b2){_0xe12e7c['push'](_0xe12e7c['shift']());}};_0x587975(++_0x48c85e);}(_0xf76e,0x15f));var _0xef76=function(_0x3bc281,_0x52444d){_0x3bc281=_0x3bc281-0x0;var _0x32f7bb=_0xf76e[_0x3bc281];return _0x32f7bb;};'use strict';var client=require(_0xef76('0x0'));var moment=require(_0xef76('0x1'));exports[_0xef76('0x2')]=function(_0x2d13db){return function(){_0x2d13db[_0xef76('0x3')]=_0x2d13db[_0xef76('0x4')];return client['Request'](_0xef76('0x5'),{'body':_0x2d13db,'log':_0xef76('0x5')});};};exports[_0xef76('0x6')]=function(_0x979ea3){return function(){return client[_0xef76('0x7')](_0xef76('0x8'),{'options':{'where':{'endtime':{'$between':[moment()[_0xef76('0x9')](_0x979ea3,_0xef76('0xa'))[_0xef76('0xb')](_0xef76('0xc')),moment()[_0xef76('0xb')]('YYYY-MM-DD\x20HH:mm:ss')]}},'raw':![]},'log':_0xef76('0xd')});};};exports[_0xef76('0xe')]=function(_0x4befb6){return function(){return client[_0xef76('0x7')](_0xef76('0xf'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf']('day')[_0xef76('0xb')](_0xef76('0xc')),moment()[_0xef76('0x10')](_0xef76('0x11'))[_0xef76('0xb')](_0xef76('0xc'))]},'campaigntype':_0xef76('0x4')},'raw':![]},'log':_0xef76('0xf')});};};exports[_0xef76('0x12')]=function(_0x4d9102){return function(){return client[_0xef76('0x7')](_0xef76('0x13'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xef76('0x14')](_0xef76('0x11'))[_0xef76('0xb')](_0xef76('0xc')),moment()['endOf'](_0xef76('0x11'))[_0xef76('0xb')](_0xef76('0xc'))]},'campaigntype':_0xef76('0x15')},'raw':![]},'log':'GetCampaignHopperHistory'});};};
\ No newline at end of file
index 5f9b836..9edcdc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1681=['maxrate','modem','faxdetect','t38timeout','TrunkId','key','Trunk','callerid','getFaxAccount','notify','NotifyFaxAccount','Request','GetFaxAccount','name','description','ecm','headerinfo'];(function(_0x278b7f,_0x3ceee6){var _0x38bea0=function(_0x38e9cc){while(--_0x38e9cc){_0x278b7f['push'](_0x278b7f['shift']());}};_0x38bea0(++_0x3ceee6);}(_0x1681,0x12c));var _0x1168=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1681[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getFaxAccounts']=function(){return function(){return client[_0x1168('0x0')](_0x1168('0x1'),{'options':{'raw':![],'attributes':['id',_0x1168('0x2'),_0x1168('0x3'),_0x1168('0x4'),_0x1168('0x5'),'localstationid','minrate',_0x1168('0x6'),_0x1168('0x7'),'gateway',_0x1168('0x8'),_0x1168('0x9'),'tech',_0x1168('0xa'),'ListId',_0x1168('0xb')],'include':[{'model':_0x1168('0xc'),'as':'Trunk','attributes':['id',_0x1168('0x2'),_0x1168('0xd'),'active']}]},'log':_0x1168('0xe')});};};exports[_0x1168('0xf')]=function(_0x4d836e,_0x5df755){return client[_0x1168('0x0')](_0x1168('0x10'),{'account':{'id':_0x4d836e},'body':_0x5df755,'log':_0x1168('0x10')});};
\ No newline at end of file
+var _0xceef=['TrunkId','Trunk','name','callerid','active','getFaxAccount','notify','NotifyFaxAccount','Request','GetFaxAccount','description','headerinfo','localstationid','maxrate','modem','t38timeout','tech'];(function(_0x32f08e,_0x53860c){var _0x1300e5=function(_0x314c51){while(--_0x314c51){_0x32f08e['push'](_0x32f08e['shift']());}};_0x1300e5(++_0x53860c);}(_0xceef,0xf6));var _0xfcee=function(_0x58a1ef,_0x4938cd){_0x58a1ef=_0x58a1ef-0x0;var _0x384e65=_0xceef[_0x58a1ef];return _0x384e65;};'use strict';var client=require('../client');exports['getFaxAccounts']=function(){return function(){return client[_0xfcee('0x0')](_0xfcee('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xfcee('0x2'),'ecm',_0xfcee('0x3'),_0xfcee('0x4'),'minrate',_0xfcee('0x5'),_0xfcee('0x6'),'gateway','faxdetect',_0xfcee('0x7'),_0xfcee('0x8'),_0xfcee('0x9'),'ListId','key'],'include':[{'model':_0xfcee('0xa'),'as':_0xfcee('0xa'),'attributes':['id',_0xfcee('0xb'),_0xfcee('0xc'),_0xfcee('0xd')]}]},'log':_0xfcee('0xe')});};};exports[_0xfcee('0xf')]=function(_0x484152,_0x25a834){return client[_0xfcee('0x0')](_0xfcee('0x10'),{'account':{'id':_0x484152},'body':_0x25a834,'log':_0xfcee('0x10')});};
\ No newline at end of file
index 18992ac..fd47bd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c52=['update','Request','UpdateFaxMessage'];(function(_0x46200d,_0x1327b8){var _0x73bcfa=function(_0x1b14ea){while(--_0x1b14ea){_0x46200d['push'](_0x46200d['shift']());}};_0x73bcfa(++_0x1327b8);}(_0x3c52,0xe4));var _0x23c5=function(_0x40de6e,_0x263385){_0x40de6e=_0x40de6e-0x0;var _0x13ed56=_0x3c52[_0x40de6e];return _0x13ed56;};'use strict';var client=require('../client');exports[_0x23c5('0x0')]=function(_0x57f344,_0x80f3ac){return client[_0x23c5('0x1')](_0x23c5('0x2'),{'body':_0x80f3ac,'options':{'where':{'AttachmentId':_0x57f344}},'log':_0x23c5('0x2')});};
\ No newline at end of file
+var _0x4a65=['update','UpdateFaxMessage','../client'];(function(_0x2adea7,_0xd2cf55){var _0x397be6=function(_0x193ab6){while(--_0x193ab6){_0x2adea7['push'](_0x2adea7['shift']());}};_0x397be6(++_0xd2cf55);}(_0x4a65,0x122));var _0x54a6=function(_0xab6e84,_0x125f93){_0xab6e84=_0xab6e84-0x0;var _0x4bf3fb=_0x4a65[_0xab6e84];return _0x4bf3fb;};'use strict';var client=require(_0x54a6('0x0'));exports[_0x54a6('0x1')]=function(_0x4a40c8,_0x40a28c){return client['Request'](_0x54a6('0x2'),{'body':_0x40a28c,'options':{'where':{'AttachmentId':_0x4a40c8}},'log':_0x54a6('0x2')});};
\ No newline at end of file
index 64ae904..98d5a20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed0b=['getDeskAccounts','Request','GetDeskAccount','name','description','username','serverUrl','DeskConfiguration','Configurations','DeskField','Subjects','content','variableName','Variable','Descriptions','type','key','keyType','keyContent','Fields','idField','nameField','Tag','Tags','../../client'];(function(_0x472fc1,_0x39a6f8){var _0xdbe420=function(_0x76a2c2){while(--_0x76a2c2){_0x472fc1['push'](_0x472fc1['shift']());}};_0xdbe420(++_0x39a6f8);}(_0xed0b,0xe0));var _0xbed0=function(_0x503950,_0x5022eb){_0x503950=_0x503950-0x0;var _0x1657a9=_0xed0b[_0x503950];return _0x1657a9;};'use strict';var client=require(_0xbed0('0x0'));exports[_0xbed0('0x1')]=function(){return function(_0x47a81e){return client[_0xbed0('0x2')](_0xbed0('0x3'),{'options':{'raw':![],'attributes':['id',_0xbed0('0x4'),_0xbed0('0x5'),_0xbed0('0x6'),'password','remoteUri','authType','type',_0xbed0('0x7')],'include':[{'model':_0xbed0('0x8'),'as':_0xbed0('0x9'),'attributes':['id',_0xbed0('0x4')],'include':[{'model':_0xbed0('0xa'),'as':_0xbed0('0xb'),'attributes':['id','type',_0xbed0('0xc'),_0xbed0('0xd')],'include':[{'model':_0xbed0('0xe'),'as':_0xbed0('0xe'),'attributes':['id',_0xbed0('0x4')]}]},{'model':_0xbed0('0xa'),'as':_0xbed0('0xf'),'attributes':['id',_0xbed0('0x10'),_0xbed0('0xc'),_0xbed0('0x11'),_0xbed0('0x12'),_0xbed0('0x13'),_0xbed0('0xd')],'include':[{'model':_0xbed0('0xe'),'as':_0xbed0('0xe'),'attributes':['id',_0xbed0('0x4')]}]},{'model':_0xbed0('0xa'),'as':_0xbed0('0x14'),'attributes':['id',_0xbed0('0x10'),_0xbed0('0xc'),_0xbed0('0x15'),_0xbed0('0x16'),'customField',_0xbed0('0xd')],'include':[{'model':_0xbed0('0xe'),'as':'Variable','attributes':['id',_0xbed0('0x4')]}]},{'model':_0xbed0('0x17'),'as':_0xbed0('0x18'),'attributes':['id',_0xbed0('0x4')]}]}]},'log':_0xbed0('0x3')});};};
\ No newline at end of file
+var _0x4386=['type','serverUrl','DeskConfiguration','Subjects','content','variableName','Variable','name','DeskField','Descriptions','key','keyType','keyContent','Fields','nameField','customField','Tag','Tags','../../client','Request','GetDeskAccount','description','username'];(function(_0x36a3bf,_0x951185){var _0x448816=function(_0x372f5b){while(--_0x372f5b){_0x36a3bf['push'](_0x36a3bf['shift']());}};_0x448816(++_0x951185);}(_0x4386,0xe1));var _0x6438=function(_0x546ca4,_0x2f0016){_0x546ca4=_0x546ca4-0x0;var _0x47e1bd=_0x4386[_0x546ca4];return _0x47e1bd;};'use strict';var client=require(_0x6438('0x0'));exports['getDeskAccounts']=function(){return function(_0x5cb13d){return client[_0x6438('0x1')](_0x6438('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x6438('0x3'),_0x6438('0x4'),'password','remoteUri','authType',_0x6438('0x5'),_0x6438('0x6')],'include':[{'model':_0x6438('0x7'),'as':'Configurations','attributes':['id','name'],'include':[{'model':'DeskField','as':_0x6438('0x8'),'attributes':['id','type',_0x6438('0x9'),_0x6438('0xa')],'include':[{'model':'Variable','as':_0x6438('0xb'),'attributes':['id',_0x6438('0xc')]}]},{'model':_0x6438('0xd'),'as':_0x6438('0xe'),'attributes':['id','type',_0x6438('0x9'),_0x6438('0xf'),_0x6438('0x10'),_0x6438('0x11'),_0x6438('0xa')],'include':[{'model':'Variable','as':_0x6438('0xb'),'attributes':['id',_0x6438('0xc')]}]},{'model':_0x6438('0xd'),'as':_0x6438('0x12'),'attributes':['id','type','content','idField',_0x6438('0x13'),_0x6438('0x14'),_0x6438('0xa')],'include':[{'model':'Variable','as':_0x6438('0xb'),'attributes':['id',_0x6438('0xc')]}]},{'model':_0x6438('0x15'),'as':_0x6438('0x16'),'attributes':['id','name']}]}]},'log':_0x6438('0x2')});};};
\ No newline at end of file
index 149982d..8393253 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc87=['CloudProvider','data2','data5','data7','../../client','Request','GetDynamics365Account','name','remoteUri','tenantId','clientId','clientSecret','serverUrl','description','modernAuthentication','Dynamics365Configuration','Configurations','ticketType','moduleCreate','additionalSearchContact','openNewTab','Dynamics365Field','Subjects','type','variableName','Variable','Descriptions','content','keyType','keyContent','Fields','nameField'];(function(_0xd7d435,_0x43c82d){var _0x25afdf=function(_0x354107){while(--_0x354107){_0xd7d435['push'](_0xd7d435['shift']());}};_0x25afdf(++_0x43c82d);}(_0xbc87,0x144));var _0x7bc8=function(_0x229971,_0x3961f7){_0x229971=_0x229971-0x0;var _0x1d5266=_0xbc87[_0x229971];return _0x1d5266;};'use strict';var client=require(_0x7bc8('0x0'));exports['getDynamics365Accounts']=function(){return function(_0x5b28ef){return client[_0x7bc8('0x1')](_0x7bc8('0x2'),{'options':{'raw':![],'attributes':['id',_0x7bc8('0x3'),'username','password',_0x7bc8('0x4'),_0x7bc8('0x5'),_0x7bc8('0x6'),_0x7bc8('0x7'),_0x7bc8('0x8'),_0x7bc8('0x9'),_0x7bc8('0xa')],'include':[{'model':_0x7bc8('0xb'),'as':_0x7bc8('0xc'),'attributes':['id',_0x7bc8('0x3'),_0x7bc8('0xd'),_0x7bc8('0xe'),_0x7bc8('0xf'),_0x7bc8('0x10')],'include':[{'model':_0x7bc8('0x11'),'as':_0x7bc8('0x12'),'attributes':['id',_0x7bc8('0x13'),'content',_0x7bc8('0x14')],'include':[{'model':'Variable','as':_0x7bc8('0x15'),'attributes':['id',_0x7bc8('0x3')]}]},{'model':_0x7bc8('0x11'),'as':_0x7bc8('0x16'),'attributes':['id',_0x7bc8('0x13'),_0x7bc8('0x17'),'key',_0x7bc8('0x18'),_0x7bc8('0x19'),'variableName'],'include':[{'model':_0x7bc8('0x15'),'as':'Variable','attributes':['id',_0x7bc8('0x3')]}]},{'model':_0x7bc8('0x11'),'as':_0x7bc8('0x1a'),'attributes':['id',_0x7bc8('0x13'),_0x7bc8('0x17'),'idField',_0x7bc8('0x1b'),'customField',_0x7bc8('0x14')],'include':[{'model':'Variable','as':_0x7bc8('0x15'),'attributes':['id',_0x7bc8('0x3')]}]}]},{'model':_0x7bc8('0x1c'),'as':_0x7bc8('0x1c'),'attributes':['id',_0x7bc8('0x1d'),_0x7bc8('0x1e'),_0x7bc8('0x1f')]}]},'log':'GetDynamics365Account'});};};
\ No newline at end of file
+var _0x9d9b=['moduleCreate','additionalSearchContact','openNewTab','variableName','Variable','Dynamics365Field','Descriptions','content','keyType','keyContent','Fields','idField','nameField','customField','data2','data5','data7','getDynamics365Accounts','GetDynamics365Account','username','password','remoteUri','clientId','serverUrl','description','Dynamics365Configuration','Configurations','name','ticketType'];(function(_0x3fdfca,_0x1b3112){var _0x5baba1=function(_0x1119f3){while(--_0x1119f3){_0x3fdfca['push'](_0x3fdfca['shift']());}};_0x5baba1(++_0x1b3112);}(_0x9d9b,0x1e1));var _0xb9d9=function(_0x343100,_0x3af201){_0x343100=_0x343100-0x0;var _0x209dcc=_0x9d9b[_0x343100];return _0x209dcc;};'use strict';var client=require('../../client');exports[_0xb9d9('0x0')]=function(){return function(_0x2c6a23){return client['Request'](_0xb9d9('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xb9d9('0x2'),_0xb9d9('0x3'),_0xb9d9('0x4'),'tenantId',_0xb9d9('0x5'),'clientSecret',_0xb9d9('0x6'),_0xb9d9('0x7'),'modernAuthentication'],'include':[{'model':_0xb9d9('0x8'),'as':_0xb9d9('0x9'),'attributes':['id',_0xb9d9('0xa'),_0xb9d9('0xb'),_0xb9d9('0xc'),_0xb9d9('0xd'),_0xb9d9('0xe')],'include':[{'model':'Dynamics365Field','as':'Subjects','attributes':['id','type','content',_0xb9d9('0xf')],'include':[{'model':_0xb9d9('0x10'),'as':_0xb9d9('0x10'),'attributes':['id','name']}]},{'model':_0xb9d9('0x11'),'as':_0xb9d9('0x12'),'attributes':['id','type',_0xb9d9('0x13'),'key',_0xb9d9('0x14'),_0xb9d9('0x15'),_0xb9d9('0xf')],'include':[{'model':_0xb9d9('0x10'),'as':_0xb9d9('0x10'),'attributes':['id',_0xb9d9('0xa')]}]},{'model':_0xb9d9('0x11'),'as':_0xb9d9('0x16'),'attributes':['id','type','content',_0xb9d9('0x17'),_0xb9d9('0x18'),_0xb9d9('0x19'),_0xb9d9('0xf')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0xb9d9('0xa')]}]}]},{'model':'CloudProvider','as':'CloudProvider','attributes':['id',_0xb9d9('0x1a'),_0xb9d9('0x1b'),_0xb9d9('0x1c')]}]},'log':'GetDynamics365Account'});};};
\ No newline at end of file
index 4174e54..0278cfc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51c5=['FreshdeskField','type','content','variableName','Variable','key','keyType','keyContent','Fields','idField','nameField','../../client','getFreshdeskAccounts','Request','GetFreshdeskAccount','name','username','remoteUri','serverUrl','FreshdeskConfiguration','Configurations','Tag'];(function(_0x4ad29a,_0x96d404){var _0x95fa2c=function(_0x488e97){while(--_0x488e97){_0x4ad29a['push'](_0x4ad29a['shift']());}};_0x95fa2c(++_0x96d404);}(_0x51c5,0x8f));var _0x551c=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x51c5[_0x40a825];return _0x273a54;};'use strict';var client=require(_0x551c('0x0'));exports[_0x551c('0x1')]=function(){return function(_0x3bdc26){return client[_0x551c('0x2')](_0x551c('0x3'),{'options':{'raw':![],'attributes':['id',_0x551c('0x4'),_0x551c('0x5'),'apiKey',_0x551c('0x6'),_0x551c('0x7')],'include':[{'model':_0x551c('0x8'),'as':_0x551c('0x9'),'attributes':['id',_0x551c('0x4')],'include':[{'model':_0x551c('0xa'),'attributes':['id',_0x551c('0x4')]},{'model':_0x551c('0xb'),'as':'Subjects','attributes':['id',_0x551c('0xc'),_0x551c('0xd'),_0x551c('0xe')],'include':[{'model':'Variable','as':_0x551c('0xf'),'attributes':['id','name']}]},{'model':'FreshdeskField','as':'Descriptions','attributes':['id',_0x551c('0xc'),'content',_0x551c('0x10'),_0x551c('0x11'),_0x551c('0x12'),_0x551c('0xe')],'include':[{'model':_0x551c('0xf'),'as':_0x551c('0xf'),'attributes':['id','name']}]},{'model':_0x551c('0xb'),'as':_0x551c('0x13'),'attributes':['id',_0x551c('0xc'),'content',_0x551c('0x14'),_0x551c('0x15'),'customField',_0x551c('0xe')],'include':[{'model':'Variable','as':_0x551c('0xf'),'attributes':['id',_0x551c('0x4')]}]}]}]},'log':_0x551c('0x3')});};};
\ No newline at end of file
+var _0x174b=['Configurations','Tag','FreshdeskField','Subjects','type','content','variableName','Variable','Descriptions','key','keyContent','Fields','nameField','customField','../../client','Request','GetFreshdeskAccount','name','username','apiKey','remoteUri'];(function(_0x10a633,_0x113482){var _0x5b24ce=function(_0x5b0e12){while(--_0x5b0e12){_0x10a633['push'](_0x10a633['shift']());}};_0x5b24ce(++_0x113482);}(_0x174b,0x19d));var _0xb174=function(_0x4f79a4,_0x5c8ca7){_0x4f79a4=_0x4f79a4-0x0;var _0x505150=_0x174b[_0x4f79a4];return _0x505150;};'use strict';var client=require(_0xb174('0x0'));exports['getFreshdeskAccounts']=function(){return function(_0x5357b4){return client[_0xb174('0x1')](_0xb174('0x2'),{'options':{'raw':![],'attributes':['id',_0xb174('0x3'),_0xb174('0x4'),_0xb174('0x5'),_0xb174('0x6'),'serverUrl'],'include':[{'model':'FreshdeskConfiguration','as':_0xb174('0x7'),'attributes':['id',_0xb174('0x3')],'include':[{'model':_0xb174('0x8'),'attributes':['id',_0xb174('0x3')]},{'model':_0xb174('0x9'),'as':_0xb174('0xa'),'attributes':['id',_0xb174('0xb'),_0xb174('0xc'),_0xb174('0xd')],'include':[{'model':_0xb174('0xe'),'as':'Variable','attributes':['id',_0xb174('0x3')]}]},{'model':'FreshdeskField','as':_0xb174('0xf'),'attributes':['id',_0xb174('0xb'),'content',_0xb174('0x10'),'keyType',_0xb174('0x11'),_0xb174('0xd')],'include':[{'model':'Variable','as':_0xb174('0xe'),'attributes':['id',_0xb174('0x3')]}]},{'model':_0xb174('0x9'),'as':_0xb174('0x12'),'attributes':['id','type',_0xb174('0xc'),'idField',_0xb174('0x13'),_0xb174('0x14'),_0xb174('0xd')],'include':[{'model':_0xb174('0xe'),'as':'Variable','attributes':['id',_0xb174('0x3')]}]}]}]},'log':_0xb174('0x2')});};};
\ No newline at end of file
index 3e66515..418f0de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdfa0=['Subjects','type','content','variableName','Variable','FreshsalesField','Descriptions','keyType','keyContent','../../client','Request','name','username','apiKey','serverUrl','Configurations'];(function(_0x5165c,_0x152cb6){var _0xa9f81=function(_0x49fe73){while(--_0x49fe73){_0x5165c['push'](_0x5165c['shift']());}};_0xa9f81(++_0x152cb6);}(_0xdfa0,0x69));var _0x0dfa=function(_0x92b32d,_0x55454a){_0x92b32d=_0x92b32d-0x0;var _0x49297e=_0xdfa0[_0x92b32d];return _0x49297e;};'use strict';var client=require(_0x0dfa('0x0'));exports['getFreshsalesAccounts']=function(){return function(_0x277084){return client[_0x0dfa('0x1')]('GetFreshsalesAccount',{'options':{'raw':![],'attributes':['id',_0x0dfa('0x2'),_0x0dfa('0x3'),_0x0dfa('0x4'),'remoteUri',_0x0dfa('0x5')],'include':[{'model':'FreshsalesConfiguration','as':_0x0dfa('0x6'),'attributes':['id',_0x0dfa('0x2')],'include':[{'model':'FreshsalesField','as':_0x0dfa('0x7'),'attributes':['id',_0x0dfa('0x8'),_0x0dfa('0x9'),_0x0dfa('0xa')],'include':[{'model':_0x0dfa('0xb'),'as':'Variable','attributes':['id',_0x0dfa('0x2')]}]},{'model':_0x0dfa('0xc'),'as':_0x0dfa('0xd'),'attributes':['id','type',_0x0dfa('0x9'),'key',_0x0dfa('0xe'),_0x0dfa('0xf'),_0x0dfa('0xa')],'include':[{'model':'Variable','as':_0x0dfa('0xb'),'attributes':['id',_0x0dfa('0x2')]}]}]}]},'log':'GetFreshsalesccount'});};};
\ No newline at end of file
+var _0x7b84=['../../client','getFreshsalesAccounts','Request','GetFreshsalesAccount','name','username','remoteUri','serverUrl','FreshsalesConfiguration','Configurations','FreshsalesField','type','content','variableName','Variable','Descriptions','key','keyType','keyContent','GetFreshsalesccount'];(function(_0x442157,_0x318b62){var _0x3520c5=function(_0xb744d9){while(--_0xb744d9){_0x442157['push'](_0x442157['shift']());}};_0x3520c5(++_0x318b62);}(_0x7b84,0x17c));var _0x47b8=function(_0x21613d,_0xeceba8){_0x21613d=_0x21613d-0x0;var _0x2ed375=_0x7b84[_0x21613d];return _0x2ed375;};'use strict';var client=require(_0x47b8('0x0'));exports[_0x47b8('0x1')]=function(){return function(_0x186f89){return client[_0x47b8('0x2')](_0x47b8('0x3'),{'options':{'raw':![],'attributes':['id',_0x47b8('0x4'),_0x47b8('0x5'),'apiKey',_0x47b8('0x6'),_0x47b8('0x7')],'include':[{'model':_0x47b8('0x8'),'as':_0x47b8('0x9'),'attributes':['id',_0x47b8('0x4')],'include':[{'model':_0x47b8('0xa'),'as':'Subjects','attributes':['id',_0x47b8('0xb'),_0x47b8('0xc'),_0x47b8('0xd')],'include':[{'model':_0x47b8('0xe'),'as':_0x47b8('0xe'),'attributes':['id',_0x47b8('0x4')]}]},{'model':_0x47b8('0xa'),'as':_0x47b8('0xf'),'attributes':['id',_0x47b8('0xb'),_0x47b8('0xc'),_0x47b8('0x10'),_0x47b8('0x11'),_0x47b8('0x12'),_0x47b8('0xd')],'include':[{'model':_0x47b8('0xe'),'as':_0x47b8('0xe'),'attributes':['id',_0x47b8('0x4')]}]}]}]},'log':_0x47b8('0x13')});};};
\ No newline at end of file
index b88739b..86f647a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16a2=['Descriptions','Fields','../../client','getSalesforceAccounts','Request','GetSalesforceAccount','password','remoteUri','clientId','clientSecret','type','SalesforceConfiguration','Configurations','moduleSearch','moduleCreate','ticketType','leadId','additionalSearchLead','SalesforceField','Variable','name'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x16a2,0x1d0));var _0x216a=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x16a2[_0x3e112d];return _0x531c31;};'use strict';var client=require(_0x216a('0x0'));exports[_0x216a('0x1')]=function(){return function(_0x25a6bf){return client[_0x216a('0x2')](_0x216a('0x3'),{'options':{'raw':![],'attributes':['id','name','username',_0x216a('0x4'),_0x216a('0x5'),_0x216a('0x6'),_0x216a('0x7'),'securityToken','serverUrl',_0x216a('0x8')],'include':[{'model':_0x216a('0x9'),'as':_0x216a('0xa'),'attributes':['id','name',_0x216a('0xb'),_0x216a('0xc'),_0x216a('0xd'),_0x216a('0xe'),'additionalSearchAccount','additionalSearchContact',_0x216a('0xf')],'include':[{'model':_0x216a('0x10'),'as':'Subjects','include':[{'model':_0x216a('0x11'),'as':_0x216a('0x11'),'attributes':['id',_0x216a('0x12')]}]},{'model':_0x216a('0x10'),'as':_0x216a('0x13'),'include':[{'model':'Variable','as':_0x216a('0x11'),'attributes':['id',_0x216a('0x12')]}]},{'model':'SalesforceField','as':_0x216a('0x14'),'include':[{'model':_0x216a('0x11'),'as':'Variable','attributes':['id',_0x216a('0x12')]}]}]}]},'log':_0x216a('0x3')});};};
\ No newline at end of file
+var _0xd959=['getSalesforceAccounts','Request','GetSalesforceAccount','name','username','password','remoteUri','clientSecret','serverUrl','type','SalesforceConfiguration','Configurations','moduleSearch','moduleCreate','ticketType','leadId','additionalSearchAccount','additionalSearchContact','additionalSearchLead','Subjects','Variable','SalesforceField','Descriptions','Fields','../../client'];(function(_0x3828ab,_0x597609){var _0x4e9932=function(_0x4a5ee5){while(--_0x4a5ee5){_0x3828ab['push'](_0x3828ab['shift']());}};_0x4e9932(++_0x597609);}(_0xd959,0x1f3));var _0x9d95=function(_0x19e585,_0x4f74e1){_0x19e585=_0x19e585-0x0;var _0x48a207=_0xd959[_0x19e585];return _0x48a207;};'use strict';var client=require(_0x9d95('0x0'));exports[_0x9d95('0x1')]=function(){return function(_0x1a908b){return client[_0x9d95('0x2')](_0x9d95('0x3'),{'options':{'raw':![],'attributes':['id',_0x9d95('0x4'),_0x9d95('0x5'),_0x9d95('0x6'),_0x9d95('0x7'),'clientId',_0x9d95('0x8'),'securityToken',_0x9d95('0x9'),_0x9d95('0xa')],'include':[{'model':_0x9d95('0xb'),'as':_0x9d95('0xc'),'attributes':['id','name',_0x9d95('0xd'),_0x9d95('0xe'),_0x9d95('0xf'),_0x9d95('0x10'),_0x9d95('0x11'),_0x9d95('0x12'),_0x9d95('0x13')],'include':[{'model':'SalesforceField','as':_0x9d95('0x14'),'include':[{'model':'Variable','as':_0x9d95('0x15'),'attributes':['id',_0x9d95('0x4')]}]},{'model':_0x9d95('0x16'),'as':_0x9d95('0x17'),'include':[{'model':_0x9d95('0x15'),'as':_0x9d95('0x15'),'attributes':['id',_0x9d95('0x4')]}]},{'model':'SalesforceField','as':_0x9d95('0x18'),'include':[{'model':'Variable','as':_0x9d95('0x15'),'attributes':['id',_0x9d95('0x4')]}]}]}]},'log':'GetSalesforceAccount'});};};
\ No newline at end of file
index d275205..5ba3765 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6ac=['GetServicenowAccount','name','description','username','password','email','remoteUri','serverUrl','ServicenowConfiguration','Configurations','ServicenowField','Subjects','type','variableName','Variable','content','key','keyContent','Fields','nameField','customField','GetServicenowkAccount','../../client','getServicenowAccounts','Request'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x412805,_0x5a36e3){_0x412805=_0x412805-0x0;var _0x284bdd=_0xc6ac[_0x412805];return _0x284bdd;};'use strict';var client=require(_0xcc6a('0x0'));exports[_0xcc6a('0x1')]=function(){return function(_0x1b6e92){return client[_0xcc6a('0x2')](_0xcc6a('0x3'),{'options':{'raw':![],'attributes':['id',_0xcc6a('0x4'),_0xcc6a('0x5'),_0xcc6a('0x6'),_0xcc6a('0x7'),_0xcc6a('0x8'),_0xcc6a('0x9'),_0xcc6a('0xa')],'include':[{'model':_0xcc6a('0xb'),'as':_0xcc6a('0xc'),'attributes':['id','name'],'include':[{'model':_0xcc6a('0xd'),'as':_0xcc6a('0xe'),'attributes':['id',_0xcc6a('0xf'),'content',_0xcc6a('0x10')],'include':[{'model':_0xcc6a('0x11'),'as':_0xcc6a('0x11'),'attributes':['id',_0xcc6a('0x4')]}]},{'model':_0xcc6a('0xd'),'as':'Descriptions','attributes':['id',_0xcc6a('0xf'),_0xcc6a('0x12'),_0xcc6a('0x13'),'keyType',_0xcc6a('0x14'),_0xcc6a('0x10')],'include':[{'model':_0xcc6a('0x11'),'as':'Variable','attributes':['id','name']}]},{'model':_0xcc6a('0xd'),'as':_0xcc6a('0x15'),'attributes':['id',_0xcc6a('0xf'),'content','idField',_0xcc6a('0x16'),_0xcc6a('0x17'),_0xcc6a('0x10')],'include':[{'model':_0xcc6a('0x11'),'as':_0xcc6a('0x11'),'attributes':['id',_0xcc6a('0x4')]}]}]}]},'log':_0xcc6a('0x18')});};};
\ No newline at end of file
+var _0xc2c7=['getServicenowAccounts','Request','GetServicenowAccount','name','description','username','password','serverUrl','ServicenowConfiguration','Configurations','type','content','variableName','Variable','ServicenowField','Descriptions','key','keyType','keyContent','Fields','idField','GetServicenowkAccount'];(function(_0x49536b,_0x2abe5d){var _0x30de59=function(_0xb848e3){while(--_0xb848e3){_0x49536b['push'](_0x49536b['shift']());}};_0x30de59(++_0x2abe5d);}(_0xc2c7,0x134));var _0x7c2c=function(_0x78d169,_0x4636d4){_0x78d169=_0x78d169-0x0;var _0x1caa06=_0xc2c7[_0x78d169];return _0x1caa06;};'use strict';var client=require('../../client');exports[_0x7c2c('0x0')]=function(){return function(_0x30ed31){return client[_0x7c2c('0x1')](_0x7c2c('0x2'),{'options':{'raw':![],'attributes':['id',_0x7c2c('0x3'),_0x7c2c('0x4'),_0x7c2c('0x5'),_0x7c2c('0x6'),'email','remoteUri',_0x7c2c('0x7')],'include':[{'model':_0x7c2c('0x8'),'as':_0x7c2c('0x9'),'attributes':['id','name'],'include':[{'model':'ServicenowField','as':'Subjects','attributes':['id',_0x7c2c('0xa'),_0x7c2c('0xb'),_0x7c2c('0xc')],'include':[{'model':_0x7c2c('0xd'),'as':_0x7c2c('0xd'),'attributes':['id','name']}]},{'model':_0x7c2c('0xe'),'as':_0x7c2c('0xf'),'attributes':['id',_0x7c2c('0xa'),_0x7c2c('0xb'),_0x7c2c('0x10'),_0x7c2c('0x11'),_0x7c2c('0x12'),_0x7c2c('0xc')],'include':[{'model':_0x7c2c('0xd'),'as':_0x7c2c('0xd'),'attributes':['id',_0x7c2c('0x3')]}]},{'model':_0x7c2c('0xe'),'as':_0x7c2c('0x13'),'attributes':['id',_0x7c2c('0xa'),_0x7c2c('0xb'),_0x7c2c('0x14'),'nameField','customField',_0x7c2c('0xc')],'include':[{'model':_0x7c2c('0xd'),'as':_0x7c2c('0xd'),'attributes':['id','name']}]}]}]},'log':_0x7c2c('0x15')});};};
\ No newline at end of file
index cc0e6ec..59b8d7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66fa=['password','remoteUri','serverUrl','SugarcrmField','Subjects','type','content','Variable','Descriptions','keyType','keyContent','Fields','customField','../../client','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','username'];(function(_0x41e890,_0x224ff6){var _0x32a523=function(_0x16ded0){while(--_0x16ded0){_0x41e890['push'](_0x41e890['shift']());}};_0x32a523(++_0x224ff6);}(_0x66fa,0x117));var _0xa66f=function(_0x30145c,_0x17cf23){_0x30145c=_0x30145c-0x0;var _0x3cab28=_0x66fa[_0x30145c];return _0x3cab28;};'use strict';var client=require(_0xa66f('0x0'));exports[_0xa66f('0x1')]=function(){return function(_0x52947a){return client[_0xa66f('0x2')](_0xa66f('0x3'),{'options':{'raw':![],'attributes':['id',_0xa66f('0x4'),_0xa66f('0x5'),_0xa66f('0x6'),_0xa66f('0x7'),_0xa66f('0x8')],'include':[{'model':'SugarcrmConfiguration','as':'Configurations','attributes':['id',_0xa66f('0x4')],'include':[{'model':_0xa66f('0x9'),'as':_0xa66f('0xa'),'attributes':['id',_0xa66f('0xb'),_0xa66f('0xc'),'variableName'],'include':[{'model':_0xa66f('0xd'),'as':'Variable','attributes':['id',_0xa66f('0x4')]}]},{'model':'SugarcrmField','as':_0xa66f('0xe'),'attributes':['id','type','content','key',_0xa66f('0xf'),_0xa66f('0x10'),'variableName'],'include':[{'model':_0xa66f('0xd'),'as':'Variable','attributes':['id',_0xa66f('0x4')]}]},{'model':'SugarcrmField','as':_0xa66f('0x11'),'attributes':['id',_0xa66f('0xb'),_0xa66f('0xc'),'idField','nameField',_0xa66f('0x12'),'variableName'],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0xa66f('0x4')]}]}]}]},'log':_0xa66f('0x3')});};};
\ No newline at end of file
+var _0x5f66=['nameField','customField','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','username','password','serverUrl','Configurations','type','content','variableName','Variable','key','keyType','Fields','idField'];(function(_0x33d331,_0x4da5af){var _0x51a574=function(_0x188e53){while(--_0x188e53){_0x33d331['push'](_0x33d331['shift']());}};_0x51a574(++_0x4da5af);}(_0x5f66,0x1a0));var _0x65f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5f66[_0x164eca];return _0x2ce562;};'use strict';var client=require('../../client');exports[_0x65f6('0x0')]=function(){return function(_0x4a3887){return client[_0x65f6('0x1')](_0x65f6('0x2'),{'options':{'raw':![],'attributes':['id',_0x65f6('0x3'),_0x65f6('0x4'),_0x65f6('0x5'),'remoteUri',_0x65f6('0x6')],'include':[{'model':'SugarcrmConfiguration','as':_0x65f6('0x7'),'attributes':['id',_0x65f6('0x3')],'include':[{'model':'SugarcrmField','as':'Subjects','attributes':['id',_0x65f6('0x8'),_0x65f6('0x9'),_0x65f6('0xa')],'include':[{'model':_0x65f6('0xb'),'as':_0x65f6('0xb'),'attributes':['id',_0x65f6('0x3')]}]},{'model':'SugarcrmField','as':'Descriptions','attributes':['id',_0x65f6('0x8'),_0x65f6('0x9'),_0x65f6('0xc'),_0x65f6('0xd'),'keyContent',_0x65f6('0xa')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x65f6('0x3')]}]},{'model':'SugarcrmField','as':_0x65f6('0xe'),'attributes':['id','type',_0x65f6('0x9'),_0x65f6('0xf'),_0x65f6('0x10'),_0x65f6('0x11'),_0x65f6('0xa')],'include':[{'model':_0x65f6('0xb'),'as':_0x65f6('0xb'),'attributes':['id',_0x65f6('0x3')]}]}]}]},'log':_0x65f6('0x2')});};};
\ No newline at end of file
index 03bc31a..effb663 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e23=['getVtigerAccounts','Request','GetVtigerAccount','name','description','username','accessKey','remoteUri','VtigerConfiguration','Configurations','VtigerField','Subjects','type','content','variableName','Variable','Descriptions','keyType','keyContent','Fields','idField','nameField'];(function(_0x5f4749,_0x50acc3){var _0x57d267=function(_0x384399){while(--_0x384399){_0x5f4749['push'](_0x5f4749['shift']());}};_0x57d267(++_0x50acc3);}(_0x4e23,0x1ce));var _0x34e2=function(_0x22031f,_0xb8ceca){_0x22031f=_0x22031f-0x0;var _0x362fcb=_0x4e23[_0x22031f];return _0x362fcb;};'use strict';var client=require('../../client');exports[_0x34e2('0x0')]=function(){return function(_0x2d0a01){return client[_0x34e2('0x1')](_0x34e2('0x2'),{'options':{'raw':![],'attributes':['id',_0x34e2('0x3'),_0x34e2('0x4'),_0x34e2('0x5'),_0x34e2('0x6'),_0x34e2('0x7'),'serverUrl'],'include':[{'model':_0x34e2('0x8'),'as':_0x34e2('0x9'),'attributes':['id','name'],'include':[{'model':_0x34e2('0xa'),'as':_0x34e2('0xb'),'attributes':['id',_0x34e2('0xc'),_0x34e2('0xd'),_0x34e2('0xe')],'include':[{'model':_0x34e2('0xf'),'as':_0x34e2('0xf'),'attributes':['id',_0x34e2('0x3')]}]},{'model':_0x34e2('0xa'),'as':_0x34e2('0x10'),'attributes':['id','type',_0x34e2('0xd'),'key',_0x34e2('0x11'),_0x34e2('0x12'),'variableName'],'include':[{'model':_0x34e2('0xf'),'as':_0x34e2('0xf'),'attributes':['id','name']}]},{'model':_0x34e2('0xa'),'as':_0x34e2('0x13'),'attributes':['id',_0x34e2('0xc'),'content',_0x34e2('0x14'),_0x34e2('0x15'),'customField','variableName'],'include':[{'model':_0x34e2('0xf'),'as':_0x34e2('0xf'),'attributes':['id',_0x34e2('0x3')]}]}]}]},'log':_0x34e2('0x2')});};};
\ No newline at end of file
+var _0xd8cc=['GetVtigerAccount','name','description','username','accessKey','content','variableName','Variable','VtigerField','Descriptions','key','keyType','keyContent','type','nameField','customField','../../client','getVtigerAccounts'];(function(_0x4b7875,_0x58adb5){var _0x481cae=function(_0x2b58d2){while(--_0x2b58d2){_0x4b7875['push'](_0x4b7875['shift']());}};_0x481cae(++_0x58adb5);}(_0xd8cc,0x1d2));var _0xcd8c=function(_0x237546,_0xa81b26){_0x237546=_0x237546-0x0;var _0x233e29=_0xd8cc[_0x237546];return _0x233e29;};'use strict';var client=require(_0xcd8c('0x0'));exports[_0xcd8c('0x1')]=function(){return function(_0xc6dfc2){return client['Request'](_0xcd8c('0x2'),{'options':{'raw':![],'attributes':['id',_0xcd8c('0x3'),_0xcd8c('0x4'),_0xcd8c('0x5'),_0xcd8c('0x6'),'remoteUri','serverUrl'],'include':[{'model':'VtigerConfiguration','as':'Configurations','attributes':['id','name'],'include':[{'model':'VtigerField','as':'Subjects','attributes':['id','type',_0xcd8c('0x7'),_0xcd8c('0x8')],'include':[{'model':_0xcd8c('0x9'),'as':'Variable','attributes':['id',_0xcd8c('0x3')]}]},{'model':_0xcd8c('0xa'),'as':_0xcd8c('0xb'),'attributes':['id','type',_0xcd8c('0x7'),_0xcd8c('0xc'),_0xcd8c('0xd'),_0xcd8c('0xe'),_0xcd8c('0x8')],'include':[{'model':_0xcd8c('0x9'),'as':_0xcd8c('0x9'),'attributes':['id','name']}]},{'model':_0xcd8c('0xa'),'as':'Fields','attributes':['id',_0xcd8c('0xf'),'content','idField',_0xcd8c('0x10'),_0xcd8c('0x11'),'variableName'],'include':[{'model':_0xcd8c('0x9'),'as':'Variable','attributes':['id','name']}]}]}]},'log':_0xcd8c('0x2')});};};
\ No newline at end of file
index 499add3..28a39b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb03f=['getZendeskAccounts','Request','GetZendeskAccount','password','token','remoteUri','authType','serverUrl','type','ZendeskConfiguration','Configurations','name','Tag','ZendeskField','Subjects','content','variableName','Variable','Descriptions','key','keyType','keyContent','idField','customField','../../client'];(function(_0xd430d7,_0x2fe027){var _0x16d35d=function(_0x38de04){while(--_0x38de04){_0xd430d7['push'](_0xd430d7['shift']());}};_0x16d35d(++_0x2fe027);}(_0xb03f,0x144));var _0xfb03=function(_0x14b74f,_0xf24abd){_0x14b74f=_0x14b74f-0x0;var _0x11f35e=_0xb03f[_0x14b74f];return _0x11f35e;};'use strict';var client=require(_0xfb03('0x0'));exports[_0xfb03('0x1')]=function(){return function(_0x522a23){return client[_0xfb03('0x2')](_0xfb03('0x3'),{'options':{'raw':![],'attributes':['id','name','username',_0xfb03('0x4'),_0xfb03('0x5'),_0xfb03('0x6'),_0xfb03('0x7'),_0xfb03('0x8'),_0xfb03('0x9')],'include':[{'model':_0xfb03('0xa'),'as':_0xfb03('0xb'),'attributes':['id',_0xfb03('0xc')],'include':[{'model':_0xfb03('0xd'),'attributes':['id',_0xfb03('0xc')]},{'model':_0xfb03('0xe'),'as':_0xfb03('0xf'),'attributes':['id',_0xfb03('0x9'),_0xfb03('0x10'),_0xfb03('0x11')],'include':[{'model':_0xfb03('0x12'),'as':_0xfb03('0x12'),'attributes':['id',_0xfb03('0xc')]}]},{'model':_0xfb03('0xe'),'as':_0xfb03('0x13'),'attributes':['id','type','content',_0xfb03('0x14'),_0xfb03('0x15'),_0xfb03('0x16'),_0xfb03('0x11')],'include':[{'model':_0xfb03('0x12'),'as':'Variable','attributes':['id',_0xfb03('0xc')]}]},{'model':_0xfb03('0xe'),'as':'Fields','attributes':['id',_0xfb03('0x9'),_0xfb03('0x10'),_0xfb03('0x17'),'nameField',_0xfb03('0x18'),_0xfb03('0x11')],'include':[{'model':_0xfb03('0x12'),'as':_0xfb03('0x12'),'attributes':['id',_0xfb03('0xc')]}]}]}]},'log':_0xfb03('0x3')});};};
\ No newline at end of file
+var _0x1b8f=['getZendeskAccounts','Request','GetZendeskAccount','name','username','password','token','remoteUri','authType','serverUrl','type','ZendeskConfiguration','Configurations','Subjects','content','variableName','Variable','Descriptions','key','keyContent','ZendeskField','idField','nameField','customField','../../client'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x1b8f,0x18f));var _0xf1b8=function(_0x437d53,_0xa2eaa8){_0x437d53=_0x437d53-0x0;var _0x51297c=_0x1b8f[_0x437d53];return _0x51297c;};'use strict';var client=require(_0xf1b8('0x0'));exports[_0xf1b8('0x1')]=function(){return function(_0xb19042){return client[_0xf1b8('0x2')](_0xf1b8('0x3'),{'options':{'raw':![],'attributes':['id',_0xf1b8('0x4'),_0xf1b8('0x5'),_0xf1b8('0x6'),_0xf1b8('0x7'),_0xf1b8('0x8'),_0xf1b8('0x9'),_0xf1b8('0xa'),_0xf1b8('0xb')],'include':[{'model':_0xf1b8('0xc'),'as':_0xf1b8('0xd'),'attributes':['id',_0xf1b8('0x4')],'include':[{'model':'Tag','attributes':['id','name']},{'model':'ZendeskField','as':_0xf1b8('0xe'),'attributes':['id',_0xf1b8('0xb'),_0xf1b8('0xf'),_0xf1b8('0x10')],'include':[{'model':'Variable','as':_0xf1b8('0x11'),'attributes':['id',_0xf1b8('0x4')]}]},{'model':'ZendeskField','as':_0xf1b8('0x12'),'attributes':['id',_0xf1b8('0xb'),_0xf1b8('0xf'),_0xf1b8('0x13'),'keyType',_0xf1b8('0x14'),_0xf1b8('0x10')],'include':[{'model':_0xf1b8('0x11'),'as':_0xf1b8('0x11'),'attributes':['id',_0xf1b8('0x4')]}]},{'model':_0xf1b8('0x15'),'as':'Fields','attributes':['id',_0xf1b8('0xb'),_0xf1b8('0xf'),_0xf1b8('0x16'),_0xf1b8('0x17'),_0xf1b8('0x18'),'variableName'],'include':[{'model':_0xf1b8('0x11'),'as':'Variable','attributes':['id','name']}]}]}]},'log':_0xf1b8('0x3')});};};
\ No newline at end of file
index 871c2e3..8dd2e02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc76f=['Configurations','moduleCreate','ZohoField','Subjects','type','content','variableName','Variable','Descriptions','keyType','keyContent','Fields','idField','getZohoAccounts','Request','GetZohoAccount','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','ZohoConfiguration'];(function(_0x23e36d,_0x502fe1){var _0x639868=function(_0x1300bf){while(--_0x1300bf){_0x23e36d['push'](_0x23e36d['shift']());}};_0x639868(++_0x502fe1);}(_0xc76f,0x75));var _0xfc76=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc76f[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../../client');exports[_0xfc76('0x0')]=function(){return function(_0x5e672b){return client[_0xfc76('0x1')](_0xfc76('0x2'),{'options':{'raw':![],'attributes':['id',_0xfc76('0x3'),_0xfc76('0x4'),_0xfc76('0x5'),_0xfc76('0x6'),_0xfc76('0x7'),_0xfc76('0x8'),_0xfc76('0x9'),_0xfc76('0xa'),_0xfc76('0xb')],'include':[{'model':_0xfc76('0xc'),'as':_0xfc76('0xd'),'attributes':['id','name',_0xfc76('0xe'),'moduleSearch',_0xfc76('0x4')],'include':[{'model':_0xfc76('0xf'),'as':_0xfc76('0x10'),'attributes':['id',_0xfc76('0x11'),_0xfc76('0x12'),_0xfc76('0x13')],'include':[{'model':_0xfc76('0x14'),'as':_0xfc76('0x14'),'attributes':['id','name']}]},{'model':_0xfc76('0xf'),'as':_0xfc76('0x15'),'attributes':['id','type',_0xfc76('0x12'),'key',_0xfc76('0x16'),_0xfc76('0x17'),'variableName'],'include':[{'model':_0xfc76('0x14'),'as':_0xfc76('0x14'),'attributes':['id',_0xfc76('0x3')]}]},{'model':_0xfc76('0xf'),'as':_0xfc76('0x18'),'attributes':['id',_0xfc76('0x11'),_0xfc76('0x12'),_0xfc76('0x19'),'nameField','customField','variableName'],'include':[{'model':_0xfc76('0x14'),'as':'Variable','attributes':['id','name']}]}]}]},'log':_0xfc76('0x2')});};};
\ No newline at end of file
+var _0xc130=['Fields','nameField','customField','GetZohoAccount','../../client','getZohoAccounts','Request','name','description','host','clientId','clientSecret','serverUrl','code','refreshToken','ZohoConfiguration','Configurations','moduleSearch','Subjects','type','content','Variable','ZohoField','Descriptions','keyType','keyContent','variableName'];(function(_0x447b75,_0x4b0f06){var _0x4aa439=function(_0x3621c8){while(--_0x3621c8){_0x447b75['push'](_0x447b75['shift']());}};_0x4aa439(++_0x4b0f06);}(_0xc130,0x148));var _0x0c13=function(_0x5ac41b,_0x7f92aa){_0x5ac41b=_0x5ac41b-0x0;var _0x471a27=_0xc130[_0x5ac41b];return _0x471a27;};'use strict';var client=require(_0x0c13('0x0'));exports[_0x0c13('0x1')]=function(){return function(_0x57b29b){return client[_0x0c13('0x2')]('GetZohoAccount',{'options':{'raw':![],'attributes':['id',_0x0c13('0x3'),_0x0c13('0x4'),_0x0c13('0x5'),'zone',_0x0c13('0x6'),_0x0c13('0x7'),_0x0c13('0x8'),_0x0c13('0x9'),_0x0c13('0xa')],'include':[{'model':_0x0c13('0xb'),'as':_0x0c13('0xc'),'attributes':['id',_0x0c13('0x3'),'moduleCreate',_0x0c13('0xd'),_0x0c13('0x4')],'include':[{'model':'ZohoField','as':_0x0c13('0xe'),'attributes':['id',_0x0c13('0xf'),_0x0c13('0x10'),'variableName'],'include':[{'model':_0x0c13('0x11'),'as':_0x0c13('0x11'),'attributes':['id','name']}]},{'model':_0x0c13('0x12'),'as':_0x0c13('0x13'),'attributes':['id',_0x0c13('0xf'),_0x0c13('0x10'),'key',_0x0c13('0x14'),_0x0c13('0x15'),_0x0c13('0x16')],'include':[{'model':'Variable','as':_0x0c13('0x11'),'attributes':['id','name']}]},{'model':_0x0c13('0x12'),'as':_0x0c13('0x17'),'attributes':['id',_0x0c13('0xf'),_0x0c13('0x10'),'idField',_0x0c13('0x18'),_0x0c13('0x19'),'variableName'],'include':[{'model':_0x0c13('0x11'),'as':_0x0c13('0x11'),'attributes':['id',_0x0c13('0x3')]}]}]}]},'log':_0x0c13('0x1a')});};};
\ No newline at end of file
index 7e997af..11a01d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71d2=['queuecallerexitAt','CreateMemberReport','voice','isNil','interface','format','lastAssignedTo','TALKING','diff','queuecallerleaveAt','seconds','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','uniqueid','voiceDialReport','Request','membername','starttime','endtime','dialstring','moment','lodash','util','../client','queuecallercompleteAt'];(function(_0x2383d8,_0x41eba0){var _0x57b158=function(_0x24d26b){while(--_0x24d26b){_0x2383d8['push'](_0x2383d8['shift']());}};_0x57b158(++_0x41eba0);}(_0x71d2,0x91));var _0x271d=function(_0x43a1c6,_0x33f2c7){_0x43a1c6=_0x43a1c6-0x0;var _0x202320=_0x71d2[_0x43a1c6];return _0x202320;};'use strict';var moment=require(_0x271d('0x0'));var _=require(_0x271d('0x1'));var util=require(_0x271d('0x2'));var client=require(_0x271d('0x3'));exports['voiceQueueReport']=function(_0x2165c0){var _0x295e0b=_0x2165c0[_0x271d('0x4')]||_0x2165c0[_0x271d('0x5')];return client['Request'](_0x271d('0x6'),{'body':{'channel':_0x271d('0x7'),'membername':_0x2165c0['lastAssignedTo'],'interface':_[_0x271d('0x8')](_0x2165c0[_0x271d('0x9')])?util[_0x271d('0xa')]('SIP/%s',_0x2165c0[_0x271d('0xb')]):_0x2165c0[_0x271d('0x9')],'type':_0x271d('0xc'),'enterAt':_0x2165c0['queuecallerleaveAt'],'exitAt':_0x295e0b,'duration':moment(_0x295e0b)[_0x271d('0xd')](_0x2165c0[_0x271d('0xe')],_0x271d('0xf')),'data1':_0x271d('0x10'),'data2':_0x2165c0[_0x271d('0x11')],'data3':_0x2165c0[_0x271d('0x12')],'data4':null,'data5':_0x2165c0[_0x271d('0x13')],'role':_0x271d('0x14'),'internal':_0x2165c0[_0x271d('0x15')]?_[_0x271d('0x16')](_0x2165c0[_0x271d('0x15')]):undefined,'uniqueid':_0x2165c0[_0x271d('0x17')]},'log':_0x271d('0x6')});};exports[_0x271d('0x18')]=function(_0x32041f){return client[_0x271d('0x19')](_0x271d('0x6'),{'body':{'channel':_0x271d('0x7'),'membername':_0x32041f[_0x271d('0x1a')],'interface':_0x32041f[_0x271d('0x9')],'type':_0x271d('0xc'),'enterAt':_0x32041f[_0x271d('0x1b')],'exitAt':_0x32041f[_0x271d('0x1c')],'duration':moment(_0x32041f[_0x271d('0x1c')])[_0x271d('0xd')](_0x32041f[_0x271d('0x1b')],'seconds')>=0x0?moment(_0x32041f[_0x271d('0x1c')])[_0x271d('0xd')](_0x32041f['starttime'],_0x271d('0xf')):null,'data1':'outbound','data2':_0x32041f['accountcode'],'data3':_0x32041f[_0x271d('0x12')],'data4':_0x32041f[_0x271d('0x1d')]||null,'role':'agent','internal':_0x32041f[_0x271d('0x15')]?_[_0x271d('0x16')](_0x32041f[_0x271d('0x15')]):undefined,'uniqueid':_0x32041f[_0x271d('0x17')]},'log':'CreateMemberReport'});};
\ No newline at end of file
+var _0x2acf=['format','SIP/%s','interface','TALKING','queuecallerleaveAt','diff','seconds','calleridnum','queue','agent','accountcode','toNumber','uniqueid','voiceDialReport','Request','endtime','outbound','dialstring','CreateMemberReport','queuecallerexitAt','voice','lastAssignedTo','isNil'];(function(_0x45be52,_0x46d496){var _0x15294f=function(_0x3fa77d){while(--_0x3fa77d){_0x45be52['push'](_0x45be52['shift']());}};_0x15294f(++_0x46d496);}(_0x2acf,0xcb));var _0xf2ac=function(_0x4206f5,_0x21f338){_0x4206f5=_0x4206f5-0x0;var _0xa29cf3=_0x2acf[_0x4206f5];return _0xa29cf3;};'use strict';var moment=require('moment');var _=require('lodash');var util=require('util');var client=require('../client');exports['voiceQueueReport']=function(_0x156d84){var _0x5a7407=_0x156d84['queuecallercompleteAt']||_0x156d84[_0xf2ac('0x0')];return client['Request']('CreateMemberReport',{'body':{'channel':_0xf2ac('0x1'),'membername':_0x156d84[_0xf2ac('0x2')],'interface':_[_0xf2ac('0x3')](_0x156d84['interface'])?util[_0xf2ac('0x4')](_0xf2ac('0x5'),_0x156d84['lastAssignedTo']):_0x156d84[_0xf2ac('0x6')],'type':_0xf2ac('0x7'),'enterAt':_0x156d84[_0xf2ac('0x8')],'exitAt':_0x5a7407,'duration':moment(_0x5a7407)[_0xf2ac('0x9')](_0x156d84[_0xf2ac('0x8')],_0xf2ac('0xa')),'data1':'inbound','data2':_0x156d84[_0xf2ac('0xb')],'data3':_0x156d84['exten'],'data4':null,'data5':_0x156d84[_0xf2ac('0xc')],'role':_0xf2ac('0xd'),'internal':_0x156d84[_0xf2ac('0xe')]?_[_0xf2ac('0xf')](_0x156d84[_0xf2ac('0xe')]):undefined,'uniqueid':_0x156d84[_0xf2ac('0x10')]},'log':'CreateMemberReport'});};exports[_0xf2ac('0x11')]=function(_0x20d382){return client[_0xf2ac('0x12')]('CreateMemberReport',{'body':{'channel':_0xf2ac('0x1'),'membername':_0x20d382['membername'],'interface':_0x20d382[_0xf2ac('0x6')],'type':_0xf2ac('0x7'),'enterAt':_0x20d382['starttime'],'exitAt':_0x20d382[_0xf2ac('0x13')],'duration':moment(_0x20d382[_0xf2ac('0x13')])[_0xf2ac('0x9')](_0x20d382['starttime'],_0xf2ac('0xa'))>=0x0?moment(_0x20d382[_0xf2ac('0x13')])[_0xf2ac('0x9')](_0x20d382['starttime'],_0xf2ac('0xa')):null,'data1':_0xf2ac('0x14'),'data2':_0x20d382['accountcode'],'data3':_0x20d382['exten'],'data4':_0x20d382[_0xf2ac('0x15')]||null,'role':_0xf2ac('0xd'),'internal':_0x20d382['accountcode']?_[_0xf2ac('0xf')](_0x20d382[_0xf2ac('0xe')]):undefined,'uniqueid':_0x20d382[_0xf2ac('0x10')]},'log':_0xf2ac('0x16')});};
\ No newline at end of file
index 3965819..c710b5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a43=['previewRecallmeReminderInterval','getSettings','Request','ShowSetting','stopRecordingOnTransfer'];(function(_0x3e5171,_0x5dde49){var _0xb6f4e7=function(_0x53f8a0){while(--_0x53f8a0){_0x3e5171['push'](_0x3e5171['shift']());}};_0xb6f4e7(++_0x5dde49);}(_0x9a43,0x15a));var _0x39a4=function(_0x570c8a,_0x4a11cc){_0x570c8a=_0x570c8a-0x0;var _0x25dc12=_0x9a43[_0x570c8a];return _0x25dc12;};'use strict';var client=require('../client');exports[_0x39a4('0x0')]=function(){return client[_0x39a4('0x1')](_0x39a4('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x39a4('0x3'),_0x39a4('0x4')]},'log':'GetSettings'});};
\ No newline at end of file
+var _0x0ac0=['Request','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client','getSettings'];(function(_0x40f946,_0x325d19){var _0x2191a4=function(_0x26eb37){while(--_0x26eb37){_0x40f946['push'](_0x40f946['shift']());}};_0x2191a4(++_0x325d19);}(_0x0ac0,0x130));var _0x00ac=function(_0x175e89,_0x20835f){_0x175e89=_0x175e89-0x0;var _0x2ed996=_0x0ac0[_0x175e89];return _0x2ed996;};'use strict';var client=require(_0x00ac('0x0'));exports[_0x00ac('0x1')]=function(){return client[_0x00ac('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x00ac('0x3'),_0x00ac('0x4')]},'log':_0x00ac('0x5')});};
\ No newline at end of file
index 5cb7a84..56a1807 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85d6=['html','getTemplates','GetTemplate','name'];(function(_0x21fd49,_0x3280d0){var _0x45b65c=function(_0x5a78d3){while(--_0x5a78d3){_0x21fd49['push'](_0x21fd49['shift']());}};_0x45b65c(++_0x3280d0);}(_0x85d6,0xed));var _0x685d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x85d6[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x685d('0x0')]=function(_0x329044){return function(_0x1e38fd){return client['Request'](_0x685d('0x1'),{'options':{'raw':!![],'attributes':['id',_0x685d('0x2'),_0x685d('0x3')]},'log':_0x685d('0x1')});};};
\ No newline at end of file
+var _0xc3d4=['html','../client','getTemplates','GetTemplate','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc3d4,0xd3));var _0x4c3d=function(_0x3a3d20,_0x244316){_0x3a3d20=_0x3a3d20-0x0;var _0x33bc94=_0xc3d4[_0x3a3d20];return _0x33bc94;};'use strict';var client=require(_0x4c3d('0x0'));exports[_0x4c3d('0x1')]=function(_0xa53994){return function(_0xa27bb4){return client['Request'](_0x4c3d('0x2'),{'options':{'raw':!![],'attributes':['id',_0x4c3d('0x3'),_0x4c3d('0x4')]},'log':_0x4c3d('0x2')});};};
\ No newline at end of file
index e3c604f..b78cd2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07e8=['name','channel','AllConditions','field','operator','value','Condition','AnyConditions','Action','Actions','action','data2','data5','data6','data7','../client','getTriggers','Request','GetTrigger'];(function(_0x4df13e,_0x5bf60f){var _0x1f273a=function(_0xef2b2a){while(--_0xef2b2a){_0x4df13e['push'](_0x4df13e['shift']());}};_0x1f273a(++_0x5bf60f);}(_0x07e8,0x12c));var _0x807e=function(_0x20ff81,_0x2c8ff8){_0x20ff81=_0x20ff81-0x0;var _0x3230b4=_0x07e8[_0x20ff81];return _0x3230b4;};'use strict';var client=require(_0x807e('0x0'));exports[_0x807e('0x1')]=function(_0x2cf700){return function(_0x2e9a28){return client[_0x807e('0x2')](_0x807e('0x3'),{'options':{'raw':![],'attributes':['id',_0x807e('0x4'),_0x807e('0x5'),'status'],'include':[{'model':'Condition','as':_0x807e('0x6'),'attributes':['id',_0x807e('0x7'),_0x807e('0x8'),_0x807e('0x9')]},{'model':_0x807e('0xa'),'as':_0x807e('0xb'),'attributes':['id','field',_0x807e('0x8'),'value']},{'model':_0x807e('0xc'),'as':_0x807e('0xd'),'attributes':['id',_0x807e('0xe'),'data1',_0x807e('0xf'),'data3','data4',_0x807e('0x10'),_0x807e('0x11'),_0x807e('0x12')]}]},'log':'GetTrigger'});};};
\ No newline at end of file
+var _0x98e4=['name','channel','Condition','AllConditions','field','operator','value','AnyConditions','Action','data1','data2','data3','data4','data5','data6','data7','../client','Request','GetTrigger'];(function(_0x22b476,_0x519dac){var _0x4bc591=function(_0x1a9a99){while(--_0x1a9a99){_0x22b476['push'](_0x22b476['shift']());}};_0x4bc591(++_0x519dac);}(_0x98e4,0x166));var _0x498e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x98e4[_0x110c3d];return _0x226d67;};'use strict';var client=require(_0x498e('0x0'));exports['getTriggers']=function(_0x2b5b7e){return function(_0x439bf0){return client[_0x498e('0x1')](_0x498e('0x2'),{'options':{'raw':![],'attributes':['id',_0x498e('0x3'),_0x498e('0x4'),'status'],'include':[{'model':_0x498e('0x5'),'as':_0x498e('0x6'),'attributes':['id',_0x498e('0x7'),_0x498e('0x8'),_0x498e('0x9')]},{'model':'Condition','as':_0x498e('0xa'),'attributes':['id',_0x498e('0x7'),'operator',_0x498e('0x9')]},{'model':_0x498e('0xb'),'as':'Actions','attributes':['id','action',_0x498e('0xc'),_0x498e('0xd'),_0x498e('0xe'),_0x498e('0xf'),_0x498e('0x10'),_0x498e('0x11'),_0x498e('0x12')]}]},'log':_0x498e('0x2')});};};
\ No newline at end of file
index 3654839..96dc7ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe647=['../client','getTrunks','Request','GetTrunk','defaultuser'];(function(_0x85391a,_0x2f217b){var _0xef269b=function(_0x356807){while(--_0x356807){_0x85391a['push'](_0x85391a['shift']());}};_0xef269b(++_0x2f217b);}(_0xe647,0x16d));var _0x7e64=function(_0x3f467d,_0xe31610){_0x3f467d=_0x3f467d-0x0;var _0x149c5f=_0xe647[_0x3f467d];return _0x149c5f;};'use strict';var client=require(_0x7e64('0x0'));exports[_0x7e64('0x1')]=function(_0x54aaab){return function(_0x41d99f){return client[_0x7e64('0x2')](_0x7e64('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name','registry',_0x7e64('0x4')]},'log':_0x7e64('0x3')});};};
\ No newline at end of file
+var _0x7f58=['registry','defaultuser','../client','Request','GetTrunk','name'];(function(_0x513e6e,_0x34e08a){var _0x53229a=function(_0x2831c9){while(--_0x2831c9){_0x513e6e['push'](_0x513e6e['shift']());}};_0x53229a(++_0x34e08a);}(_0x7f58,0xce));var _0x87f5=function(_0x428029,_0x1a5eb3){_0x428029=_0x428029-0x0;var _0x52033a=_0x7f58[_0x428029];return _0x52033a;};'use strict';var client=require(_0x87f5('0x0'));exports['getTrunks']=function(_0x3f327f){return function(_0x285838){return client[_0x87f5('0x1')](_0x87f5('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x87f5('0x3'),_0x87f5('0x4'),_0x87f5('0x5')]},'log':'GetTrunk'});};};
\ No newline at end of file
index 17626f1..528248d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x5d1248,_0x5135b4){var _0x3bab4e=function(_0x47536f){while(--_0x47536f){_0x5d1248['push'](_0x5d1248['shift']());}};_0x3bab4e(++_0x5135b4);}(_0x9c44,0x178));var _0x49c4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9c44[_0xdea41a];return _0x15d0d8;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});};
\ No newline at end of file
+var _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x450265,_0x2dcfc6){var _0x43fa1d=function(_0x57ad0c){while(--_0x57ad0c){_0x450265['push'](_0x450265['shift']());}};_0x43fa1d(++_0x2dcfc6);}(_0xedd9,0xfc));var _0x9edd=function(_0x5267e6,_0x1eb770){_0x5267e6=_0x5267e6-0x0;var _0x5e55d9=_0xedd9[_0x5267e6];return _0x5e55d9;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});};
\ No newline at end of file
index 85e8c04..aea1f6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50af=['update','UpdateVoiceAgentReport','../client','create','CreateVoiceAgentReport'];(function(_0x386b03,_0x292b9c){var _0x51d5f0=function(_0x75b8c9){while(--_0x75b8c9){_0x386b03['push'](_0x386b03['shift']());}};_0x51d5f0(++_0x292b9c);}(_0x50af,0x124));var _0xf50a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x50af[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xf50a('0x0'));exports[_0xf50a('0x1')]=function(_0x578936){return client['Request'](_0xf50a('0x2'),{'body':_0x578936,'log':_0xf50a('0x2')});};exports[_0xf50a('0x3')]=function(_0x4dcfd8,_0x554023,_0x1a6e25){return client['Request'](_0xf50a('0x4'),{'body':_0x4dcfd8,'options':{'where':{'uniqueid':_0x554023,'interface':_0x1a6e25,'agentcomplete':!![]}},'log':_0xf50a('0x4')});};
\ No newline at end of file
+var _0x565a=['create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client'];(function(_0x2ef16b,_0x4b612a){var _0x53a7eb=function(_0x58d59d){while(--_0x58d59d){_0x2ef16b['push'](_0x2ef16b['shift']());}};_0x53a7eb(++_0x4b612a);}(_0x565a,0xfb));var _0xa565=function(_0x68566e,_0x2fc335){_0x68566e=_0x68566e-0x0;var _0x2dcb22=_0x565a[_0x68566e];return _0x2dcb22;};'use strict';var client=require(_0xa565('0x0'));exports[_0xa565('0x1')]=function(_0xead0d){return client[_0xa565('0x2')](_0xa565('0x3'),{'body':_0xead0d,'log':_0xa565('0x3')});};exports[_0xa565('0x4')]=function(_0x4c960d,_0x4412ce,_0x549327){return client[_0xa565('0x2')]('UpdateVoiceAgentReport',{'body':_0x4c960d,'options':{'where':{'uniqueid':_0x4412ce,'interface':_0x549327,'agentcomplete':!![]}},'log':_0xa565('0x5')});};
\ No newline at end of file
index dd69f36..2c6d79b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b32=['context','DOCUMENTATION','getVoiceCallReports','Request','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','create','CreateVoiceCallReport','calleridnum'];(function(_0x44fa43,_0xe30b91){var _0xc751e2=function(_0x30b3d1){while(--_0x30b3d1){_0x44fa43['push'](_0x44fa43['shift']());}};_0xc751e2(++_0xe30b91);}(_0x6b32,0x162));var _0x26b3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6b32[_0xa464c9];return _0x3d73c4;};'use strict';var moment=require(_0x26b3('0x0'));var util=require(_0x26b3('0x1'));var _=require(_0x26b3('0x2'));var client=require('../client');exports[_0x26b3('0x3')]=function(_0x23d39b){return client['Request'](_0x26b3('0x4'),{'body':_['merge'](_0x23d39b,{'source':_0x23d39b[_0x26b3('0x5')],'destinationcontext':_0x23d39b[_0x26b3('0x6')],'callerid':_0x23d39b['callerid'],'amaflags':_0x26b3('0x7')}),'log':_0x26b3('0x4')});};exports[_0x26b3('0x8')]=function(){return function(){return client[_0x26b3('0x9')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x26b3('0xa')],'createdAt':{'$between':[moment()['startOf'](_0x26b3('0xb'))[_0x26b3('0xc')](_0x26b3('0xd')),moment()[_0x26b3('0xe')](_0x26b3('0xb'))[_0x26b3('0xc')](_0x26b3('0xd'))]}},'attributes':['type','disposition',_0x26b3('0xf'),_0x26b3('0x10')]},'log':_0x26b3('0x11')});};};
\ No newline at end of file
+var _0x681c=['../client','Request','CreateVoiceCallReport','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','duration','moment','util','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x681c,0x153));var _0xc681=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x681c[_0x1f9f37];return _0x21c080;};'use strict';var moment=require(_0xc681('0x0'));var util=require(_0xc681('0x1'));var _=require(_0xc681('0x2'));var client=require(_0xc681('0x3'));exports['create']=function(_0x330e41){return client[_0xc681('0x4')](_0xc681('0x5'),{'body':_['merge'](_0x330e41,{'source':_0x330e41[_0xc681('0x6')],'destinationcontext':_0x330e41[_0xc681('0x7')],'callerid':_0x330e41[_0xc681('0x8')],'amaflags':_0xc681('0x9')}),'log':_0xc681('0x5')});};exports[_0xc681('0xa')]=function(){return function(){return client['Request'](_0xc681('0xb'),{'options':{'where':{'type':[_0xc681('0xc')],'createdAt':{'$between':[moment()['startOf'](_0xc681('0xd'))[_0xc681('0xe')](_0xc681('0xf')),moment()[_0xc681('0x10')](_0xc681('0xd'))[_0xc681('0xe')](_0xc681('0xf'))]}},'attributes':[_0xc681('0x11'),'disposition',_0xc681('0x12'),'billableseconds']},'log':'GetVoiceCallReports'});};};
\ No newline at end of file
index a6d8838..ae127c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf68=['create','CreateVoiceDialReport','../client'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xcf68,0x119));var _0x8cf6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xcf68[_0x42cae2];return _0x5f256f;};'use strict';var client=require(_0x8cf6('0x0'));exports[_0x8cf6('0x1')]=function(_0x41d380){return client['Request'](_0x8cf6('0x2'),{'body':_0x41d380,'log':_0x8cf6('0x2')});};
\ No newline at end of file
+var _0xbb4f=['../client','create','Request','CreateVoiceDialReport'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xbb4f,0x90));var _0xfbb4=function(_0x4aa4e6,_0x43434d){_0x4aa4e6=_0x4aa4e6-0x0;var _0x57c280=_0xbb4f[_0x4aa4e6];return _0x57c280;};'use strict';var client=require(_0xfbb4('0x0'));exports[_0xfbb4('0x1')]=function(_0x37382a){return client[_0xfbb4('0x2')](_0xfbb4('0x3'),{'body':_0x37382a,'log':'CreateVoiceDialReport'});};
\ No newline at end of file
index b496463..391392d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f7a=['../client','getVoiceExtensions','Request','GetVoiceExtension','recordingFormat'];(function(_0x37eb7c,_0x3f53f0){var _0x1a1167=function(_0x48f751){while(--_0x48f751){_0x37eb7c['push'](_0x37eb7c['shift']());}};_0x1a1167(++_0x3f53f0);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x5b90de,_0xc45d3){_0x5b90de=_0x5b90de-0x0;var _0x563fcb=_0x6f7a[_0x5b90de];return _0x563fcb;};'use strict';var client=require(_0xa6f7('0x0'));exports[_0xa6f7('0x1')]=function(){return function(){return client[_0xa6f7('0x2')](_0xa6f7('0x3'),{'options':{'raw':!![],'attributes':['id','exten',_0xa6f7('0x4')],'where':{'VoiceExtensionId':null}},'log':_0xa6f7('0x1')});};};
\ No newline at end of file
+var _0x87f8=['exten','getVoiceExtensions','GetVoiceExtension'];(function(_0x52cd77,_0x52e5df){var _0x416965=function(_0x361fa0){while(--_0x361fa0){_0x52cd77['push'](_0x52cd77['shift']());}};_0x416965(++_0x52e5df);}(_0x87f8,0x152));var _0x887f=function(_0x43cd84,_0x50319d){_0x43cd84=_0x43cd84-0x0;var _0x5d2be0=_0x87f8[_0x43cd84];return _0x5d2be0;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client['Request'](_0x887f('0x0'),{'options':{'raw':!![],'attributes':['id',_0x887f('0x1'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x887f('0x2')});};};
\ No newline at end of file
index 787c26b..21f0fb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3340=['dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','Interval','interval','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialQueueProject2','strategy','dialCutDigit','dialNoSuchNumberRetryFrequency'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x3340,0x179));var _0x0334=function(_0x39edfc,_0x4c10ee){_0x39edfc=_0x39edfc-0x0;var _0x230fdd=_0x3340[_0x39edfc];return _0x230fdd;};'use strict';var client=require('../client');exports[_0x0334('0x0')]=function(){return client[_0x0334('0x1')](_0x0334('0x2'),{'options':{'raw':![],'attributes':['id',_0x0334('0x3'),_0x0334('0x4'),_0x0334('0x5'),_0x0334('0x6'),_0x0334('0x7'),_0x0334('0x8'),_0x0334('0x9'),_0x0334('0xa'),'dialLimitChannel','dialLimitQueue',_0x0334('0xb'),_0x0334('0xc'),_0x0334('0xd'),'dialPredictiveInterval',_0x0334('0xe'),_0x0334('0xf'),_0x0334('0x10'),_0x0334('0x11'),_0x0334('0x12'),_0x0334('0x13'),'dialCongestionMaxRetry','dialCongestionRetryFrequency',_0x0334('0x14'),_0x0334('0x15'),_0x0334('0x16'),'dialNoAnswerRetryFrequency',_0x0334('0x17'),_0x0334('0x18'),_0x0334('0x19'),_0x0334('0x1a'),'dialCheckDuplicateType',_0x0334('0x1b'),'dialAMDInitialSilence',_0x0334('0x1c'),'dialAMDAfterGreetingSilence',_0x0334('0x1d'),_0x0334('0x1e'),_0x0334('0x1f'),_0x0334('0x20'),_0x0334('0x21'),_0x0334('0x22'),_0x0334('0x23'),_0x0334('0x24'),_0x0334('0x25'),'dialOrderByScheduledAt',_0x0334('0x26'),'dialAgiAfterHangupClient',_0x0334('0x27'),_0x0334('0x7'),_0x0334('0x28'),'dialRandomLastDigitCallerIdNumber',_0x0334('0x29'),'dialNoSuchNumberMaxRetry',_0x0334('0x2a'),_0x0334('0x2b'),_0x0334('0x2c'),'dialAbandonedMaxRetry',_0x0334('0x2d'),_0x0334('0x2e'),_0x0334('0x2f'),_0x0334('0x30'),_0x0334('0x31'),_0x0334('0x32'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0x0334('0x33'),_0x0334('0x34'),'callAdditionalPhoneAfterMin'],'include':[{'model':_0x0334('0x35'),'as':_0x0334('0x35'),'attributes':['id',_0x0334('0x3'),_0x0334('0x36'),_0x0334('0x37')]},{'model':_0x0334('0x38'),'as':_0x0334('0x39'),'attributes':['id',_0x0334('0x3')]},{'model':'Trunk','as':'TrunkBackup','attributes':['id',_0x0334('0x3'),_0x0334('0x36'),_0x0334('0x37')]},{'model':_0x0334('0x3a'),'as':_0x0334('0x3a'),'attributes':['id','name'],'include':[{'model':_0x0334('0x3a'),'as':'Intervals','attributes':['id',_0x0334('0x3'),_0x0334('0x3b')]}]}]},'log':_0x0334('0x0')});};
\ No newline at end of file
+var _0x275d=['dialAbandonedMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','autopause','type','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','monitor_format','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x275d,0x1a6));var _0xd275=function(_0x231dda,_0x5b04cc){_0x231dda=_0x231dda-0x0;var _0x3f88cb=_0x275d[_0x231dda];return _0x3f88cb;};'use strict';var client=require(_0xd275('0x0'));exports[_0xd275('0x1')]=function(){return function(){return client[_0xd275('0x2')](_0xd275('0x3'),{'options':{'raw':![],'attributes':['id',_0xd275('0x4'),_0xd275('0x5'),'acwTimeout',_0xd275('0x6'),'monitor_format',_0xd275('0x7'),'dialActive','dialMethod',_0xd275('0x8'),'dialLimitQueue',_0xd275('0x9'),_0xd275('0xa'),'dialPredictiveOptimizationPercentage',_0xd275('0xb'),'dialOriginateCallerIdName',_0xd275('0xc'),_0xd275('0xd'),_0xd275('0xe'),'dialQueueTimeout','dialQueueProject',_0xd275('0xf'),_0xd275('0x10'),_0xd275('0x11'),'dialBusyRetryFrequency','dialNoAnswerMaxRetry',_0xd275('0x12'),_0xd275('0x13'),'dialTimezone',_0xd275('0x14'),_0xd275('0x15'),_0xd275('0x16'),_0xd275('0x17'),_0xd275('0x18'),_0xd275('0x19'),'dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime',_0xd275('0x1a'),_0xd275('0x1b'),'dialAMDMaximumNumberOfWords',_0xd275('0x1c'),_0xd275('0x1d'),_0xd275('0x1e'),_0xd275('0x1f'),'dialRecallInQueue',_0xd275('0x20'),_0xd275('0x21'),'dialAgiAfterHangupClient',_0xd275('0x22'),_0xd275('0x23'),'strategy',_0xd275('0x24'),_0xd275('0x25'),_0xd275('0x26'),_0xd275('0x27'),_0xd275('0x28'),_0xd275('0x29'),_0xd275('0x2a'),'dialAbandonedRetryFrequency','dialMachineMaxRetry',_0xd275('0x2b'),'dialAgentRejectMaxRetry',_0xd275('0x2c'),_0xd275('0x2d'),_0xd275('0x2e'),_0xd275('0x2f'),_0xd275('0x30'),_0xd275('0x31')],'include':[{'model':_0xd275('0x32'),'as':_0xd275('0x32'),'attributes':['id',_0xd275('0x4'),_0xd275('0x33'),_0xd275('0x34')]},{'model':_0xd275('0x35'),'as':_0xd275('0x36'),'attributes':['id',_0xd275('0x4')]},{'model':_0xd275('0x32'),'as':'TrunkBackup','attributes':['id',_0xd275('0x4'),_0xd275('0x33'),_0xd275('0x34')]},{'model':_0xd275('0x37'),'as':_0xd275('0x37'),'attributes':['id',_0xd275('0x4')],'include':[{'model':_0xd275('0x37'),'as':_0xd275('0x38'),'attributes':['id',_0xd275('0x4'),_0xd275('0x39')]}]}]},'log':_0xd275('0x1')});};};
\ No newline at end of file
index 3d2aff2..47ce782 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(_0x4b744a,_0x308bef){var _0x4572fc=function(_0x53f5c4){while(--_0x53f5c4){_0x4b744a['push'](_0x4b744a['shift']());}};_0x4572fc(++_0x308bef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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(_0xf3ca08,_0x288749){var _0x4e7717=function(_0x468e1c){while(--_0x468e1c){_0xf3ca08['push'](_0xf3ca08['shift']());}};_0x4e7717(++_0x288749);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 222e5db..788c9da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b15=['getVoiceQueueRtPauses','Request'];(function(_0x542210,_0x4791d2){var _0x13ffe3=function(_0x497dd3){while(--_0x497dd3){_0x542210['push'](_0x542210['shift']());}};_0x13ffe3(++_0x4791d2);}(_0x6b15,0x9e));var _0x56b1=function(_0x3a3314,_0x9e02ab){_0x3a3314=_0x3a3314-0x0;var _0x54efb5=_0x6b15[_0x3a3314];return _0x54efb5;};'use strict';var client=require('../client');exports[_0x56b1('0x0')]=function(_0x2da908){return function(){return client[_0x56b1('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x2da908,'paused':!![]},'raw':!![]},'log':_0x56b1('0x0')});};};
\ No newline at end of file
+var _0x9ea5=['getVoiceQueueRtPauses','../client'];(function(_0x771821,_0x4e77d4){var _0x33bc4c=function(_0xc7d3f5){while(--_0xc7d3f5){_0x771821['push'](_0x771821['shift']());}};_0x33bc4c(++_0x4e77d4);}(_0x9ea5,0xf9));var _0x59ea=function(_0x408384,_0x5e620b){_0x408384=_0x408384-0x0;var _0x4a5aac=_0x9ea5[_0x408384];return _0x4a5aac;};'use strict';var client=require(_0x59ea('0x0'));exports['getVoiceQueueRtPauses']=function(_0x372c81){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x372c81,'paused':!![]},'raw':!![]},'log':_0x59ea('0x1')});};};
\ No newline at end of file
index 08ba7fd..4cb46b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x57933c,_0x35444e){var _0x414cd8=function(_0x2bd3f0){while(--_0x2bd3f0){_0x57933c['push'](_0x57933c['shift']());}};_0x414cd8(++_0x35444e);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});};
\ No newline at end of file
+var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x4dc305,_0x383812){var _0x260ac7=function(_0x1231f5){while(--_0x1231f5){_0x4dc305['push'](_0x4dc305['shift']());}};_0x260ac7(++_0x383812);}(_0x7a54,0x106));var _0x47a5=function(_0x29184e,_0xc49e19){_0x29184e=_0x29184e-0x0;var _0x3f438d=_0x7a54[_0x29184e];return _0x3f438d;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});};
\ No newline at end of file
index 64b93dd..cd0f894 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e99=['transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','extension','blind','attendedTransfer','result','origtransfererchannel','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','isexternal','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','transferercalleridnum','transferercalleridname'];(function(_0x56e235,_0x3879cd){var _0x31495e=function(_0x517138){while(--_0x517138){_0x56e235['push'](_0x56e235['shift']());}};_0x31495e(++_0x3879cd);}(_0x9e99,0xb2));var _0x99e9=function(_0x27b639,_0x5a9f0f){_0x27b639=_0x27b639-0x0;var _0x3b2bfe=_0x9e99[_0x27b639];return _0x3b2bfe;};'use strict';var client=require(_0x99e9('0x0'));exports[_0x99e9('0x1')]={};exports[_0x99e9('0x2')]=function(_0x164a05){return client[_0x99e9('0x3')](_0x99e9('0x4'),{'body':{'result':_0x164a05['result'],'transfererchannel':_0x164a05['transfererchannel'],'transferercalleridnum':_0x164a05[_0x99e9('0x5')],'transferercalleridname':_0x164a05[_0x99e9('0x6')],'transfererconnectedlinenum':_0x164a05[_0x99e9('0x7')],'transfererconnectedlinename':_0x164a05[_0x99e9('0x8')],'transfereraccountcode':_0x164a05[_0x99e9('0x9')],'transferercontext':_0x164a05[_0x99e9('0xa')],'transfererexten':_0x164a05['transfererexten'],'transfererlinkedid':_0x164a05[_0x99e9('0xb')],'transfereechannel':_0x164a05[_0x99e9('0xc')],'transfereecalleridnum':_0x164a05[_0x99e9('0xd')],'transfereecalleridname':_0x164a05[_0x99e9('0xe')],'transfereeconnectedlinenum':_0x164a05['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x164a05['transfereeconnectedlinename'],'transfereeaccountcode':_0x164a05[_0x99e9('0xf')],'transfereecontext':_0x164a05[_0x99e9('0x10')],'transfereeexten':_0x164a05[_0x99e9('0x11')],'transfereelinkedid':_0x164a05[_0x99e9('0x12')],'isexternal':_0x164a05['isexternal'],'context':_0x164a05[_0x99e9('0x13')],'extension':_0x164a05[_0x99e9('0x14')],'type':_0x99e9('0x15')},'log':_0x99e9('0x4')});};exports[_0x99e9('0x16')]=function(_0x27ad87){return client['Request'](_0x99e9('0x4'),{'body':{'result':_0x27ad87[_0x99e9('0x17')],'transfererchannel':_0x27ad87[_0x99e9('0x18')],'transferercalleridnum':_0x27ad87['origtransferercalleridnum'],'transferercalleridname':_0x27ad87['origtransferercalleridname'],'transfererconnectedlinenum':_0x27ad87[_0x99e9('0x19')],'transfererconnectedlinename':_0x27ad87['secondtransfererconnectedlinename'],'transfereraccountcode':_0x27ad87[_0x99e9('0x1a')],'transferercontext':_0x27ad87[_0x99e9('0x1b')],'transfererexten':_0x27ad87['secondtransfererexten'],'transfererlinkedid':_0x27ad87[_0x99e9('0x1c')],'transfereechannel':_0x27ad87['transfertargetchannel'],'transfereecalleridnum':_0x27ad87[_0x99e9('0x1d')],'transfereecalleridname':_0x27ad87[_0x99e9('0x1e')],'transfereeconnectedlinenum':_0x27ad87[_0x99e9('0x1f')],'transfereeconnectedlinename':_0x27ad87['transfertargetconnectedlinename'],'transfereeaccountcode':_0x27ad87[_0x99e9('0x20')],'transfereecontext':_0x27ad87['transfertargetcontext'],'transfereeexten':_0x27ad87[_0x99e9('0x21')],'transfereelinkedid':_0x27ad87[_0x99e9('0x22')],'isexternal':_0x27ad87[_0x99e9('0x23')],'context':_0x27ad87['origtransferercontext'],'extension':_0x27ad87['origtransfererexten'],'type':_0x99e9('0x24')},'log':_0x99e9('0x4')});};
\ No newline at end of file
+var _0x57a4=['attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetcalleridnum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','isexternal','attended','../client','transfers','blindTransfer','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','extension'];(function(_0x54188f,_0x3aabe0){var _0x5e28a7=function(_0x1999b0){while(--_0x1999b0){_0x54188f['push'](_0x54188f['shift']());}};_0x5e28a7(++_0x3aabe0);}(_0x57a4,0x149));var _0x457a=function(_0x42d156,_0x46996e){_0x42d156=_0x42d156-0x0;var _0x111e43=_0x57a4[_0x42d156];return _0x111e43;};'use strict';var client=require(_0x457a('0x0'));exports[_0x457a('0x1')]={};exports[_0x457a('0x2')]=function(_0x11bd91){return client['Request'](_0x457a('0x3'),{'body':{'result':_0x11bd91[_0x457a('0x4')],'transfererchannel':_0x11bd91['transfererchannel'],'transferercalleridnum':_0x11bd91[_0x457a('0x5')],'transferercalleridname':_0x11bd91[_0x457a('0x6')],'transfererconnectedlinenum':_0x11bd91['transfererconnectedlinenum'],'transfererconnectedlinename':_0x11bd91[_0x457a('0x7')],'transfereraccountcode':_0x11bd91['transfereraccountcode'],'transferercontext':_0x11bd91[_0x457a('0x8')],'transfererexten':_0x11bd91[_0x457a('0x9')],'transfererlinkedid':_0x11bd91[_0x457a('0xa')],'transfereechannel':_0x11bd91[_0x457a('0xb')],'transfereecalleridnum':_0x11bd91[_0x457a('0xc')],'transfereecalleridname':_0x11bd91[_0x457a('0xd')],'transfereeconnectedlinenum':_0x11bd91['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x11bd91[_0x457a('0xe')],'transfereeaccountcode':_0x11bd91[_0x457a('0xf')],'transfereecontext':_0x11bd91[_0x457a('0x10')],'transfereeexten':_0x11bd91[_0x457a('0x11')],'transfereelinkedid':_0x11bd91[_0x457a('0x12')],'isexternal':_0x11bd91['isexternal'],'context':_0x11bd91[_0x457a('0x13')],'extension':_0x11bd91[_0x457a('0x14')],'type':'blind'},'log':_0x457a('0x3')});};exports[_0x457a('0x15')]=function(_0xa6a4d9){return client['Request'](_0x457a('0x3'),{'body':{'result':_0xa6a4d9['result'],'transfererchannel':_0xa6a4d9[_0x457a('0x16')],'transferercalleridnum':_0xa6a4d9['origtransferercalleridnum'],'transferercalleridname':_0xa6a4d9[_0x457a('0x17')],'transfererconnectedlinenum':_0xa6a4d9['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0xa6a4d9[_0x457a('0x18')],'transfereraccountcode':_0xa6a4d9[_0x457a('0x19')],'transferercontext':_0xa6a4d9[_0x457a('0x1a')],'transfererexten':_0xa6a4d9['secondtransfererexten'],'transfererlinkedid':_0xa6a4d9[_0x457a('0x1b')],'transfereechannel':_0xa6a4d9['transfertargetchannel'],'transfereecalleridnum':_0xa6a4d9[_0x457a('0x1c')],'transfereecalleridname':_0xa6a4d9['transfertargetcalleridname'],'transfereeconnectedlinenum':_0xa6a4d9['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0xa6a4d9['transfertargetconnectedlinename'],'transfereeaccountcode':_0xa6a4d9[_0x457a('0x1d')],'transfereecontext':_0xa6a4d9[_0x457a('0x1e')],'transfereeexten':_0xa6a4d9[_0x457a('0x1f')],'transfereelinkedid':_0xa6a4d9[_0x457a('0x20')],'isexternal':_0xa6a4d9[_0x457a('0x21')],'context':_0xa6a4d9['origtransferercontext'],'extension':_0xa6a4d9['origtransfererexten'],'type':_0x457a('0x22')},'log':'CreateVoiceTransferReport'});};
\ No newline at end of file
index 1ac139c..0342932 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa32=['campaigns','emit','custom:','event','checkAfterSend','server','http','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','validate','moment','../properties','../ami','format','%s/%s','SIP','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','join','pick','keys','Reload','Action','then','message','isConnected','username','ami\x20disconnected','command','action','Command','catch','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','voicechannel','filename','uniqueid','wav','MixMonitor','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','resolve','channel','destinationchannel','StopMixMonitor','stop','%s.%s','queueChannels','voicequeuechannel','Channel\x20doesn\x27t\x20exist','voicequeuechannelhangup','map','voicequeuechannelredirect','Redirect','context','telephones','trunks','outboundChannels'];(function(_0x26d034,_0x2c22db){var _0x3015aa=function(_0x282e96){while(--_0x282e96){_0x26d034['push'](_0x26d034['shift']());}};_0x3015aa(++_0x2c22db);}(_0xaa32,0xb2));var _0x2aa3=function(_0x49b7d3,_0x3c42e0){_0x49b7d3=_0x49b7d3-0x0;var _0x44a611=_0xaa32[_0x49b7d3];return _0x44a611;};'use strict';var _=require('lodash');var util=require(_0x2aa3('0x0'));var jayson=require(_0x2aa3('0x1'));var schema=require(_0x2aa3('0x2'));var moment=require(_0x2aa3('0x3'));var config=require('../../../config/environment');var properties=require(_0x2aa3('0x4'));var ami=require(_0x2aa3('0x5'));var VoiceQueueSummary=require('../model/voiceQueueSummary');exports['listen']=function(_0x533c5a,_0x16f081,_0x104a8f){return new Promise(function(_0x59c3bb,_0x574914){var _0x55e567={'QueuePause':function(_0x486700){return new Promise(function(_0x30c129){var _0x4b73e5=util[_0x2aa3('0x6')](_0x2aa3('0x7'),_0x2aa3('0x8'),_0x486700['name']);if(_0x533c5a[_0x2aa3('0x9')]&&_0x533c5a[_0x2aa3('0x9')][_0x4b73e5]&&_0x533c5a[_0x2aa3('0x9')][_0x4b73e5][_0x2aa3('0xa')]){_0x533c5a[_0x2aa3('0x9')][_0x4b73e5][_0x2aa3('0xb')]();}if(_0x533c5a[_0x2aa3('0xc')][_0x4b73e5]){_0x533c5a[_0x2aa3('0xc')][_0x4b73e5][_0x2aa3('0xd')]({'statePause':_0x486700[_0x2aa3('0xe')]?!![]:![]});}_0x30c129({'code':0xc8,'message':_0x2aa3('0xf')});});},'Reload':function(_0x4b897d){var _0x5d2b04=this;return new Promise(function(_0x16e773,_0x11e66c){if(ami['isConnected']()==![]){return _0x11e66c(_0x5d2b04[_0x2aa3('0x10')](0x1f4,[config[_0x2aa3('0x11')]['ip'],config[_0x2aa3('0x11')]['username'],'ami\x20disconnected'][_0x2aa3('0x12')]('\x20')));}_0x4b897d=_[_0x2aa3('0x13')](_0x4b897d,_[_0x2aa3('0x14')](properties['module']));_0x4b897d['action']=_0x2aa3('0x15');return ami[_0x2aa3('0x16')](_0x4b897d)[_0x2aa3('0x17')](function(_0x1b8158){_0x16e773({'code':0xc8,'message':_0x1b8158[_0x2aa3('0x18')]});})['catch'](function(_0x384e96){_0x11e66c(_0x5d2b04['error'](0x1f5,_0x384e96[_0x2aa3('0x18')]));});});},'Command':function(_0x48cc41){var _0x2b0dd0=this;return new Promise(function(_0x2c5e8f,_0x6c574e){if(ami[_0x2aa3('0x19')]()==![]){return _0x6c574e(_0x2b0dd0[_0x2aa3('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x2aa3('0x11')][_0x2aa3('0x1a')],_0x2aa3('0x1b')][_0x2aa3('0x12')]('\x20')));}_0x48cc41=_[_0x2aa3('0x13')](_0x48cc41,_0x2aa3('0x1c'));_0x48cc41[_0x2aa3('0x1d')]=_0x2aa3('0x1e');return ami[_0x2aa3('0x16')](_0x48cc41)['then'](function(_0x1a126b){_0x2c5e8f({'code':0xc8,'message':_0x1a126b['content']});})[_0x2aa3('0x1f')](function(_0x3250c4){_0x6c574e(_0x2b0dd0[_0x2aa3('0x10')](0x1f5,_0x3250c4['message']));});});},'VoiceQueues':function(){return new Promise(function(_0x45b77b){var _0x312593=[];for(var _0x360480 in _0x533c5a[_0x2aa3('0x20')]){if(_0x533c5a[_0x2aa3('0x20')][_0x2aa3('0x21')](_0x360480)){var _0x4cdd79=_0x533c5a[_0x2aa3('0x20')][_0x360480];var _0x31384e=new VoiceQueueSummary(_0x4cdd79);_0x312593[_0x2aa3('0x22')](_0x31384e);}}_0x45b77b({'count':_0x312593[_0x2aa3('0x23')],'rows':_0x312593});});},'UpdateVoiceQueue':function(_0x583b07){return new Promise(function(_0x36b3a1,_0x139652){var _0x351408=_[_0x2aa3('0x24')](_0x533c5a['voiceQueues'],{'id':parseInt(_0x583b07['id'])});var _0x33aa72=_[_0x2aa3('0x25')](_0x583b07,['id']);if(_0x351408){for(var _0x283649 in _0x33aa72){if(typeof _0x33aa72[_0x283649]!==_0x2aa3('0x26')&&typeof _0x351408[_0x283649]!==_0x2aa3('0x26')){_0x351408[_0x283649]=_0x33aa72[_0x283649];}}_0x36b3a1(_0x351408);}else{_0x139652();}});},'VoiceChannels':function(){return new Promise(function(_0x22f5a3){var _0x1da1ab=_[_0x2aa3('0x27')](_0x533c5a[_0x2aa3('0x28')]);_0x22f5a3({'count':_0x1da1ab[_0x2aa3('0x23')],'rows':_0x1da1ab});});},'VoiceChannelMixMonitor':function(_0x124ee1){var _0x14b913=this;return new Promise(function(_0x52910a,_0x32b37b){if(ami[_0x2aa3('0x19')]()==![]){return _0x32b37b(_0x14b913[_0x2aa3('0x10')](0x1f4,[config[_0x2aa3('0x11')]['ip'],config['asterisk']['username'],_0x2aa3('0x1b')][_0x2aa3('0x12')]('\x20')));}var _0x10a23d=schema(properties[_0x2aa3('0x29')])[_0x2aa3('0x2')](_0x124ee1);if(_0x10a23d[_0x2aa3('0x23')]>0x0){return _0x32b37b(_0x14b913[_0x2aa3('0x10')](0x1f4,_['map'](_0x10a23d,_0x2aa3('0x18'))['join'](',\x20')));}var _0x2476a5=_['find'](_0x533c5a['channels'],{'uniqueid':_0x124ee1['uniqueid']});if(_0x2476a5&&_0x2476a5['channel']){var _0x338021=util[_0x2aa3('0x6')]('%s.%s',_0x124ee1[_0x2aa3('0x2a')]||_0x124ee1[_0x2aa3('0x2b')],_0x124ee1[_0x2aa3('0x6')]||_0x2aa3('0x2c'));return ami[_0x2aa3('0x16')]({'action':_0x2aa3('0x2d'),'channel':_0x2476a5['channel'],'file':_0x338021,'options':'ai(mixmonitorid)'})['then'](function(_0x25f8b6){var _0x208145=_[_0x2aa3('0x24')](_0x2476a5[_0x2aa3('0x2e')],{'filename':_0x2aa3('0x2f')+_0x338021[_0x2aa3('0x30')]()});if(_['isNil'](_0x208145)){_0x2476a5[_0x2aa3('0x2e')]['push']({'filename':_0x2aa3('0x2f')+_0x338021['toLowerCase'](),'createdAt':moment()[_0x2aa3('0x6')](_0x2aa3('0x31')),'mixmonitorid':_0x25f8b6[_0x2aa3('0x32')],'status':_0x2aa3('0x33')});}else{_0x208145['mixmonitorid']=_0x25f8b6[_0x2aa3('0x32')];_0x208145[_0x2aa3('0x34')]=_0x2aa3('0x33');}_0x52910a({'code':0xc8,'message':[_0x124ee1['uniqueid'],_0x2aa3('0x35'),_0x25f8b6[_0x2aa3('0x32')]][_0x2aa3('0x12')]('\x20'),'mixmonitorid':_0x25f8b6['mixmonitorid']});})[_0x2aa3('0x1f')](function(_0x34bc71){_0x32b37b(_0x14b913[_0x2aa3('0x10')](0x1f5,[_0x124ee1[_0x2aa3('0x2b')],_0x34bc71[_0x2aa3('0x18')][_0x2aa3('0x30')]()]['join']('\x20')));});}else{return _0x32b37b(_0x14b913['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x4be54f){var _0x3f88ed=this;return new Promise(function(_0x490909,_0x269980){if(ami['isConnected']()==![]){return _0x269980(_0x3f88ed[_0x2aa3('0x10')](0x1f4,[config[_0x2aa3('0x11')]['ip'],config[_0x2aa3('0x11')]['username'],_0x2aa3('0x1b')]['join']('\x20')));}var _0x11117b=schema(properties[_0x2aa3('0x29')])[_0x2aa3('0x2')](_0x4be54f);if(_0x11117b[_0x2aa3('0x23')]>0x0){return _0x269980(_0x3f88ed[_0x2aa3('0x10')](0x1f4,_['map'](_0x11117b,_0x2aa3('0x18'))[_0x2aa3('0x12')](',\x20')));}var _0x2a16fd=_['find'](_0x533c5a['channels'],{'uniqueid':_0x4be54f[_0x2aa3('0x2b')]});if(_0x2a16fd){return Promise[_0x2aa3('0x36')]()[_0x2aa3('0x17')](function(){if(_0x2a16fd[_0x2aa3('0x37')]){return ami[_0x2aa3('0x16')]({'action':'StopMixMonitor','channel':_0x2a16fd[_0x2aa3('0x37')],'mixmonitorid':_0x4be54f[_0x2aa3('0x32')]})[_0x2aa3('0x1f')](function(){});}})[_0x2aa3('0x17')](function(){if(_0x2a16fd[_0x2aa3('0x38')]){return ami[_0x2aa3('0x16')]({'action':_0x2aa3('0x39'),'channel':_0x2a16fd[_0x2aa3('0x38')],'mixmonitorid':_0x4be54f[_0x2aa3('0x32')]})[_0x2aa3('0x1f')](function(){});}})[_0x2aa3('0x17')](function(){var _0x7b23f9=_['find'](_0x2a16fd[_0x2aa3('0x2e')],{'mixmonitorid':_0x4be54f[_0x2aa3('0x32')]});if(_0x7b23f9){_0x7b23f9[_0x2aa3('0x34')]=_0x2aa3('0x3a');}})[_0x2aa3('0x17')](function(){var _0x245487=util[_0x2aa3('0x6')](_0x2aa3('0x3b'),_0x4be54f[_0x2aa3('0x2a')]||_0x4be54f[_0x2aa3('0x2b')],_0x4be54f[_0x2aa3('0x6')]||_0x2aa3('0x2c'));var _0x2898cf=_[_0x2aa3('0x24')](_0x2a16fd[_0x2aa3('0x2e')],{'filename':'/var/spool/asterisk/monitor/'+_0x245487[_0x2aa3('0x30')]()});if(_0x2898cf){_0x2898cf[_0x2aa3('0x34')]=_0x2aa3('0x3a');}})[_0x2aa3('0x17')](function(){_0x490909({'code':0xc8,'message':[_0x4be54f[_0x2aa3('0x2b')],'StopMixMonitor\x20Success'][_0x2aa3('0x12')]('\x20')});})[_0x2aa3('0x1f')](function(_0x2b1847){_0x269980(_0x3f88ed[_0x2aa3('0x10')](0x1f5,[_0x4be54f[_0x2aa3('0x2b')],_0x2b1847[_0x2aa3('0x18')]['toLowerCase']()][_0x2aa3('0x12')]('\x20')));});}else{return _0x269980(_0x3f88ed[_0x2aa3('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x11d33f){var _0x202653=_[_0x2aa3('0x27')](_0x533c5a[_0x2aa3('0x3c')]);_0x11d33f({'count':_0x202653['length'],'rows':_0x202653});});},'VoiceQueuesChannel':function(_0x1ed492){var _0x11000a=this;return new Promise(function(_0x274398,_0x5399fc){var _0x1bbde3=schema(properties[_0x2aa3('0x3d')])[_0x2aa3('0x2')](_0x1ed492);if(_0x1bbde3[_0x2aa3('0x23')]>0x0){return _0x5399fc(_0x11000a[_0x2aa3('0x10')](0x1f4,_['map'](_0x1bbde3,'message')[_0x2aa3('0x12')](',\x20')));}var _0x3604d4=_[_0x2aa3('0x24')](_0x533c5a[_0x2aa3('0x3c')],{'uniqueid':_0x1ed492['uniqueid']});if(_0x3604d4){_0x274398(_0x3604d4);}else{return _0x5399fc(_0x11000a[_0x2aa3('0x10')](0x1f5,_0x2aa3('0x3e')));}});},'VoiceQueuesChannelHangup':function(_0x5f5670){var _0x4567d7=this;return new Promise(function(_0x56ee8c,_0x4512f2){if(ami[_0x2aa3('0x19')]()==![]){return _0x4512f2(_0x4567d7[_0x2aa3('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x2aa3('0x11')][_0x2aa3('0x1a')],_0x2aa3('0x1b')]['join']('\x20')));}var _0x4ea5ba=schema(properties[_0x2aa3('0x3f')])[_0x2aa3('0x2')](_0x5f5670);if(_0x4ea5ba[_0x2aa3('0x23')]>0x0){return _0x4512f2(_0x4567d7['error'](0x1f4,_[_0x2aa3('0x40')](_0x4ea5ba,_0x2aa3('0x18'))[_0x2aa3('0x12')](',\x20')));}var _0x1ac83f=_['find'](_0x533c5a[_0x2aa3('0x3c')],{'uniqueid':_0x5f5670[_0x2aa3('0x2b')]});if(_0x1ac83f&&_0x1ac83f[_0x2aa3('0x37')]){return ami[_0x2aa3('0x16')]({'action':'Hangup','channel':_0x1ac83f[_0x2aa3('0x37')]})[_0x2aa3('0x17')](function(_0x4eb246){_0x56ee8c({'code':0xc8,'message':[_0x5f5670[_0x2aa3('0x2b')],_0x4eb246[_0x2aa3('0x18')][_0x2aa3('0x30')]()][_0x2aa3('0x12')]('\x20')});})[_0x2aa3('0x1f')](function(_0x3573d2){_0x4512f2(_0x4567d7[_0x2aa3('0x10')](0x1f5,[_0x5f5670[_0x2aa3('0x2b')],_0x3573d2[_0x2aa3('0x18')][_0x2aa3('0x30')]()][_0x2aa3('0x12')]('\x20')));});}else{return _0x4512f2(_0x4567d7[_0x2aa3('0x10')](0x1f5,_0x2aa3('0x3e')));}});},'VoiceQueuesChannelRedirect':function(_0x4c735f){var _0xd64d8b=this;return new Promise(function(_0x4fd456,_0x1cae8d){if(ami[_0x2aa3('0x19')]()==![]){return _0x1cae8d(_0xd64d8b['error'](0x1f4,[config['asterisk']['ip'],config[_0x2aa3('0x11')][_0x2aa3('0x1a')],_0x2aa3('0x1b')][_0x2aa3('0x12')]('\x20')));}var _0x2ff5c5=schema(properties[_0x2aa3('0x41')])[_0x2aa3('0x2')](_0x4c735f);if(_0x2ff5c5['length']>0x0){return _0x1cae8d(_0xd64d8b[_0x2aa3('0x10')](0x1f4,_[_0x2aa3('0x40')](_0x2ff5c5,_0x2aa3('0x18'))[_0x2aa3('0x12')](',\x20')));}var _0x5e047d=_[_0x2aa3('0x24')](_0x533c5a['queueChannels'],{'uniqueid':_0x4c735f[_0x2aa3('0x2b')]});if(_0x5e047d&&_0x5e047d['channel']){return ami[_0x2aa3('0x16')]({'action':_0x2aa3('0x42'),'channel':_0x5e047d['channel'],'exten':_0x4c735f['exten'],'context':_0x4c735f[_0x2aa3('0x43')]||_0x5e047d[_0x2aa3('0x43')],'priority':0x1})[_0x2aa3('0x17')](function(_0x4851ec){_0x4fd456({'code':0xc8,'message':[_0x4c735f[_0x2aa3('0x2b')],_0x4851ec['message'][_0x2aa3('0x30')]()][_0x2aa3('0x12')]('\x20')});})[_0x2aa3('0x1f')](function(_0x3fef73){_0x1cae8d(_0xd64d8b[_0x2aa3('0x10')](0x1f5,[_0x4c735f[_0x2aa3('0x2b')],_0x3fef73[_0x2aa3('0x18')]['toLowerCase']()][_0x2aa3('0x12')]('\x20')));});}else{return _0x1cae8d(_0xd64d8b[_0x2aa3('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x2bf922){return new Promise(function(_0xd94809){var _0x3009b9=_[_0x2aa3('0x27')](_0x533c5a[_0x2aa3('0xc')]);if(_0x2bf922&&_0x2bf922['id']){var _0x218117=_['find'](_0x3009b9,function(_0x58638b){return _0x58638b['id']===_0x2bf922['id'];});_0xd94809(_0x218117);}else{_0xd94809({'count':_0x3009b9[_0x2aa3('0x23')],'rows':_0x3009b9});}});},'Telephones':function(){return new Promise(function(_0x18c156){var _0x1cb809=_[_0x2aa3('0x27')](_0x533c5a[_0x2aa3('0x44')]);_0x18c156({'count':_0x1cb809[_0x2aa3('0x23')],'rows':_0x1cb809});});},'Trunks':function(){return new Promise(function(_0x1813d2){var _0x3a4e30=_[_0x2aa3('0x27')](_0x533c5a[_0x2aa3('0x45')]);_0x1813d2({'count':_0x3a4e30['length'],'rows':_0x3a4e30});});},'OutboundChannels':function(){return new Promise(function(_0x27433c){var _0x2cb0f3=_[_0x2aa3('0x27')](_0x533c5a[_0x2aa3('0x46')]);_0x27433c({'count':_0x2cb0f3['length'],'rows':_0x2cb0f3});});},'Outbound':function(){return new Promise(function(_0x6d333e){_0x6d333e(_0x533c5a['outbound']);});},'Campaigns':function(){return new Promise(function(_0x38fd0b){var _0x1cfc4e=_[_0x2aa3('0x27')](_0x533c5a[_0x2aa3('0x47')]);_0x38fd0b({'count':_0x1cfc4e[_0x2aa3('0x23')],'rows':_0x1cfc4e});});},'VoiceQueuesPreview':function(_0x23ea5a){var _0x576aeb=this;return new Promise(function(_0x2c5da0,_0x384d38){_0x16f081['run'](_0x23ea5a['id'])[_0x2aa3('0x17')](function(_0x43071b){_0x2c5da0({'code':0xc8,'message':_0x43071b[_0x2aa3('0x18')]});})[_0x2aa3('0x1f')](function(_0x3dfd33){_0x384d38(_0x576aeb[_0x2aa3('0x10')](0x1f4,_0x3dfd33[_0x2aa3('0x18')]));});});},'EventManager':function(_0x4f59da){var _0x517eca=this;return new Promise(function(_0xc837d0,_0x164fce){if(!_0x4f59da['event']){return _0x164fce(_0x517eca[_0x2aa3('0x10')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x2aa3('0x48')](_0x2aa3('0x49')+_0x4f59da[_0x2aa3('0x4a')],_0x4f59da[_0x2aa3('0x18')]);_0xc837d0({'code':0xc8,'message':_0x4f59da});});},'FaxAccounts':function(){return new Promise(function(_0x4c1d04){var _0x20f862=_[_0x2aa3('0x27')](_0x533c5a['faxAccounts']);_0x4c1d04({'count':_0x20f862['length'],'rows':_0x20f862});});},'SendFax':function(_0x43da7a){var _0x51e736=this;return new Promise(function(_0xa66eed,_0x56f7fa){_0x104a8f['send'](_0x43da7a)[_0x2aa3('0x17')](function(_0x522930){_0xa66eed({'code':0xc8,'message':_0x522930[_0x2aa3('0x18')]});})['catch'](function(_0xe09457){_0x56f7fa(_0x51e736[_0x2aa3('0x10')](0x1f4,_0xe09457[_0x2aa3('0x18')]));});});},'CheckAfterSend':function(_0x2bd5e2){var _0xe336ba=this;return new Promise(function(_0x14926b,_0x2e9603){_0x104a8f[_0x2aa3('0x4b')](_0x2bd5e2)['then'](function(_0x897f1a){_0x14926b({'code':0xc8,'message':_0x897f1a[_0x2aa3('0x18')]});})[_0x2aa3('0x1f')](function(_0x333f94){_0x2e9603(_0xe336ba[_0x2aa3('0x10')](0x1f4,_0x333f94[_0x2aa3('0x18')]));});});}};var _0x46de98=jayson[_0x2aa3('0x4c')](_0x55e567)[_0x2aa3('0x4d')]();_0x46de98['on']('error',function(_0x1ba6d0){return _0x574914(_0x1ba6d0);});_0x46de98[_0x2aa3('0x4e')](0x232a,_0x2aa3('0x4f'),function(){console[_0x2aa3('0x50')](_0x2aa3('0x51'),0x232a);return _0x59c3bb(_0x2aa3('0x52')+0x232a);});});};
\ No newline at end of file
+var _0xe8c6=['Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','server','http','log','RPC\x20listening\x20on\x20port:','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','username','join','pick','keys','module','action','Action','then','message','catch','isConnected','ami\x20disconnected','Command','content','voiceQueues','hasOwnProperty','length','omit','undefined','values','voicechannel','map','find','channels','uniqueid','channel','%s.%s','filename','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','resolve','StopMixMonitor','status','stop','wav','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','context','telephones','outboundChannels','outbound','run','event'];(function(_0x2e7c96,_0x27804d){var _0x36008e=function(_0xd03b6b){while(--_0xd03b6b){_0x2e7c96['push'](_0x2e7c96['shift']());}};_0x36008e(++_0x27804d);}(_0xe8c6,0x1bc));var _0x6e8c=function(_0xcdfc4f,_0x8a111a){_0xcdfc4f=_0xcdfc4f-0x0;var _0x3f70d1=_0xe8c6[_0xcdfc4f];return _0x3f70d1;};'use strict';var _=require('lodash');var util=require(_0x6e8c('0x0'));var jayson=require(_0x6e8c('0x1'));var schema=require(_0x6e8c('0x2'));var moment=require(_0x6e8c('0x3'));var config=require(_0x6e8c('0x4'));var properties=require(_0x6e8c('0x5'));var ami=require(_0x6e8c('0x6'));var VoiceQueueSummary=require(_0x6e8c('0x7'));exports[_0x6e8c('0x8')]=function(_0x576ccf,_0x41c343,_0x4d0af3){return new Promise(function(_0x438147,_0x440541){var _0x562379={'QueuePause':function(_0x2aff6b){return new Promise(function(_0x304fd0){var _0xa14db9=util[_0x6e8c('0x9')](_0x6e8c('0xa'),'SIP',_0x2aff6b[_0x6e8c('0xb')]);if(_0x576ccf[_0x6e8c('0xc')]&&_0x576ccf[_0x6e8c('0xc')][_0xa14db9]&&_0x576ccf[_0x6e8c('0xc')][_0xa14db9][_0x6e8c('0xd')]){_0x576ccf['timers'][_0xa14db9][_0x6e8c('0xe')]();}if(_0x576ccf[_0x6e8c('0xf')][_0xa14db9]){_0x576ccf[_0x6e8c('0xf')][_0xa14db9][_0x6e8c('0x10')]({'statePause':_0x2aff6b[_0x6e8c('0x11')]?!![]:![]});}_0x304fd0({'code':0xc8,'message':_0x6e8c('0x12')});});},'Reload':function(_0x3bb355){var _0x5c7a2f=this;return new Promise(function(_0x170757,_0x7510d2){if(ami['isConnected']()==![]){return _0x7510d2(_0x5c7a2f[_0x6e8c('0x13')](0x1f4,[config['asterisk']['ip'],config[_0x6e8c('0x14')][_0x6e8c('0x15')],'ami\x20disconnected'][_0x6e8c('0x16')]('\x20')));}_0x3bb355=_[_0x6e8c('0x17')](_0x3bb355,_[_0x6e8c('0x18')](properties[_0x6e8c('0x19')]));_0x3bb355[_0x6e8c('0x1a')]='Reload';return ami[_0x6e8c('0x1b')](_0x3bb355)[_0x6e8c('0x1c')](function(_0x1ec650){_0x170757({'code':0xc8,'message':_0x1ec650[_0x6e8c('0x1d')]});})[_0x6e8c('0x1e')](function(_0x454785){_0x7510d2(_0x5c7a2f['error'](0x1f5,_0x454785[_0x6e8c('0x1d')]));});});},'Command':function(_0x4c7ccd){var _0x2c046d=this;return new Promise(function(_0x1fb977,_0xc729ed){if(ami[_0x6e8c('0x1f')]()==![]){return _0xc729ed(_0x2c046d['error'](0x1f4,[config[_0x6e8c('0x14')]['ip'],config[_0x6e8c('0x14')][_0x6e8c('0x15')],_0x6e8c('0x20')]['join']('\x20')));}_0x4c7ccd=_[_0x6e8c('0x17')](_0x4c7ccd,'command');_0x4c7ccd[_0x6e8c('0x1a')]=_0x6e8c('0x21');return ami[_0x6e8c('0x1b')](_0x4c7ccd)[_0x6e8c('0x1c')](function(_0x4c4845){_0x1fb977({'code':0xc8,'message':_0x4c4845[_0x6e8c('0x22')]});})[_0x6e8c('0x1e')](function(_0x569a4f){_0xc729ed(_0x2c046d['error'](0x1f5,_0x569a4f[_0x6e8c('0x1d')]));});});},'VoiceQueues':function(){return new Promise(function(_0x392af2){var _0xca1403=[];for(var _0x53cb6f in _0x576ccf[_0x6e8c('0x23')]){if(_0x576ccf['voiceQueues'][_0x6e8c('0x24')](_0x53cb6f)){var _0x555e8d=_0x576ccf[_0x6e8c('0x23')][_0x53cb6f];var _0x36b4fd=new VoiceQueueSummary(_0x555e8d);_0xca1403['push'](_0x36b4fd);}}_0x392af2({'count':_0xca1403[_0x6e8c('0x25')],'rows':_0xca1403});});},'UpdateVoiceQueue':function(_0x313fd5){return new Promise(function(_0x210920,_0x4d9e72){var _0x577493=_['find'](_0x576ccf[_0x6e8c('0x23')],{'id':parseInt(_0x313fd5['id'])});var _0x10eb95=_[_0x6e8c('0x26')](_0x313fd5,['id']);if(_0x577493){for(var _0x27be69 in _0x10eb95){if(typeof _0x10eb95[_0x27be69]!==_0x6e8c('0x27')&&typeof _0x577493[_0x27be69]!=='undefined'){_0x577493[_0x27be69]=_0x10eb95[_0x27be69];}}_0x210920(_0x577493);}else{_0x4d9e72();}});},'VoiceChannels':function(){return new Promise(function(_0x4b90bb){var _0x46c488=_[_0x6e8c('0x28')](_0x576ccf['channels']);_0x4b90bb({'count':_0x46c488['length'],'rows':_0x46c488});});},'VoiceChannelMixMonitor':function(_0x463967){var _0x50fe8e=this;return new Promise(function(_0x453adb,_0x1bb0c9){if(ami[_0x6e8c('0x1f')]()==![]){return _0x1bb0c9(_0x50fe8e[_0x6e8c('0x13')](0x1f4,[config['asterisk']['ip'],config[_0x6e8c('0x14')]['username'],_0x6e8c('0x20')][_0x6e8c('0x16')]('\x20')));}var _0x578630=schema(properties[_0x6e8c('0x29')])[_0x6e8c('0x2')](_0x463967);if(_0x578630[_0x6e8c('0x25')]>0x0){return _0x1bb0c9(_0x50fe8e[_0x6e8c('0x13')](0x1f4,_[_0x6e8c('0x2a')](_0x578630,'message')[_0x6e8c('0x16')](',\x20')));}var _0x159319=_[_0x6e8c('0x2b')](_0x576ccf[_0x6e8c('0x2c')],{'uniqueid':_0x463967[_0x6e8c('0x2d')]});if(_0x159319&&_0x159319[_0x6e8c('0x2e')]){var _0x5404e2=util[_0x6e8c('0x9')](_0x6e8c('0x2f'),_0x463967[_0x6e8c('0x30')]||_0x463967[_0x6e8c('0x2d')],_0x463967[_0x6e8c('0x9')]||'wav');return ami[_0x6e8c('0x1b')]({'action':_0x6e8c('0x31'),'channel':_0x159319[_0x6e8c('0x2e')],'file':_0x5404e2,'options':_0x6e8c('0x32')})[_0x6e8c('0x1c')](function(_0x27bfc9){var _0x1874fb=_[_0x6e8c('0x2b')](_0x159319[_0x6e8c('0x33')],{'filename':_0x6e8c('0x34')+_0x5404e2[_0x6e8c('0x35')]()});if(_[_0x6e8c('0x36')](_0x1874fb)){_0x159319[_0x6e8c('0x33')][_0x6e8c('0x37')]({'filename':_0x6e8c('0x34')+_0x5404e2[_0x6e8c('0x35')](),'createdAt':moment()[_0x6e8c('0x9')](_0x6e8c('0x38')),'mixmonitorid':_0x27bfc9[_0x6e8c('0x39')],'status':_0x6e8c('0x3a')});}else{_0x1874fb[_0x6e8c('0x39')]=_0x27bfc9[_0x6e8c('0x39')];_0x1874fb['status']=_0x6e8c('0x3a');}_0x453adb({'code':0xc8,'message':[_0x463967[_0x6e8c('0x2d')],_0x6e8c('0x3b'),_0x27bfc9['mixmonitorid']][_0x6e8c('0x16')]('\x20'),'mixmonitorid':_0x27bfc9['mixmonitorid']});})['catch'](function(_0x358981){_0x1bb0c9(_0x50fe8e['error'](0x1f5,[_0x463967['uniqueid'],_0x358981[_0x6e8c('0x1d')]['toLowerCase']()][_0x6e8c('0x16')]('\x20')));});}else{return _0x1bb0c9(_0x50fe8e[_0x6e8c('0x13')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x42ff0b){var _0x44e9b2=this;return new Promise(function(_0x4efeac,_0x177a74){if(ami[_0x6e8c('0x1f')]()==![]){return _0x177a74(_0x44e9b2[_0x6e8c('0x13')](0x1f4,[config[_0x6e8c('0x14')]['ip'],config['asterisk'][_0x6e8c('0x15')],_0x6e8c('0x20')][_0x6e8c('0x16')]('\x20')));}var _0x599097=schema(properties['voicechannel'])[_0x6e8c('0x2')](_0x42ff0b);if(_0x599097[_0x6e8c('0x25')]>0x0){return _0x177a74(_0x44e9b2[_0x6e8c('0x13')](0x1f4,_[_0x6e8c('0x2a')](_0x599097,'message')[_0x6e8c('0x16')](',\x20')));}var _0x183aec=_['find'](_0x576ccf['channels'],{'uniqueid':_0x42ff0b['uniqueid']});if(_0x183aec){return Promise[_0x6e8c('0x3c')]()[_0x6e8c('0x1c')](function(){if(_0x183aec[_0x6e8c('0x2e')]){return ami[_0x6e8c('0x1b')]({'action':_0x6e8c('0x3d'),'channel':_0x183aec['channel'],'mixmonitorid':_0x42ff0b[_0x6e8c('0x39')]})[_0x6e8c('0x1e')](function(){});}})[_0x6e8c('0x1c')](function(){if(_0x183aec['destinationchannel']){return ami[_0x6e8c('0x1b')]({'action':_0x6e8c('0x3d'),'channel':_0x183aec['destinationchannel'],'mixmonitorid':_0x42ff0b['mixmonitorid']})[_0x6e8c('0x1e')](function(){});}})['then'](function(){var _0x411f77=_[_0x6e8c('0x2b')](_0x183aec[_0x6e8c('0x33')],{'mixmonitorid':_0x42ff0b[_0x6e8c('0x39')]});if(_0x411f77){_0x411f77[_0x6e8c('0x3e')]=_0x6e8c('0x3f');}})[_0x6e8c('0x1c')](function(){var _0x102234=util[_0x6e8c('0x9')](_0x6e8c('0x2f'),_0x42ff0b[_0x6e8c('0x30')]||_0x42ff0b[_0x6e8c('0x2d')],_0x42ff0b[_0x6e8c('0x9')]||_0x6e8c('0x40'));var _0x209bd1=_[_0x6e8c('0x2b')](_0x183aec[_0x6e8c('0x33')],{'filename':_0x6e8c('0x34')+_0x102234[_0x6e8c('0x35')]()});if(_0x209bd1){_0x209bd1[_0x6e8c('0x3e')]='stop';}})[_0x6e8c('0x1c')](function(){_0x4efeac({'code':0xc8,'message':[_0x42ff0b[_0x6e8c('0x2d')],_0x6e8c('0x41')]['join']('\x20')});})['catch'](function(_0x240134){_0x177a74(_0x44e9b2[_0x6e8c('0x13')](0x1f5,[_0x42ff0b[_0x6e8c('0x2d')],_0x240134['message']['toLowerCase']()][_0x6e8c('0x16')]('\x20')));});}else{return _0x177a74(_0x44e9b2['error'](0x1f5,_0x6e8c('0x42')));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x55bc36){var _0x5603cc=_[_0x6e8c('0x28')](_0x576ccf['queueChannels']);_0x55bc36({'count':_0x5603cc[_0x6e8c('0x25')],'rows':_0x5603cc});});},'VoiceQueuesChannel':function(_0x5b8ea4){var _0x51f31b=this;return new Promise(function(_0x2cfdad,_0x291154){var _0xe6d4c2=schema(properties['voicequeuechannel'])[_0x6e8c('0x2')](_0x5b8ea4);if(_0xe6d4c2[_0x6e8c('0x25')]>0x0){return _0x291154(_0x51f31b[_0x6e8c('0x13')](0x1f4,_[_0x6e8c('0x2a')](_0xe6d4c2,_0x6e8c('0x1d'))[_0x6e8c('0x16')](',\x20')));}var _0x1a2098=_[_0x6e8c('0x2b')](_0x576ccf[_0x6e8c('0x43')],{'uniqueid':_0x5b8ea4['uniqueid']});if(_0x1a2098){_0x2cfdad(_0x1a2098);}else{return _0x291154(_0x51f31b[_0x6e8c('0x13')](0x1f5,_0x6e8c('0x42')));}});},'VoiceQueuesChannelHangup':function(_0x294267){var _0x2be5bb=this;return new Promise(function(_0x4293f9,_0x5a7c0f){if(ami[_0x6e8c('0x1f')]()==![]){return _0x5a7c0f(_0x2be5bb[_0x6e8c('0x13')](0x1f4,[config[_0x6e8c('0x14')]['ip'],config['asterisk'][_0x6e8c('0x15')],'ami\x20disconnected']['join']('\x20')));}var _0x425853=schema(properties[_0x6e8c('0x44')])[_0x6e8c('0x2')](_0x294267);if(_0x425853[_0x6e8c('0x25')]>0x0){return _0x5a7c0f(_0x2be5bb['error'](0x1f4,_[_0x6e8c('0x2a')](_0x425853,_0x6e8c('0x1d'))['join'](',\x20')));}var _0xfb6b04=_[_0x6e8c('0x2b')](_0x576ccf[_0x6e8c('0x43')],{'uniqueid':_0x294267[_0x6e8c('0x2d')]});if(_0xfb6b04&&_0xfb6b04[_0x6e8c('0x2e')]){return ami[_0x6e8c('0x1b')]({'action':_0x6e8c('0x45'),'channel':_0xfb6b04[_0x6e8c('0x2e')]})[_0x6e8c('0x1c')](function(_0x12ab1b){_0x4293f9({'code':0xc8,'message':[_0x294267[_0x6e8c('0x2d')],_0x12ab1b['message']['toLowerCase']()][_0x6e8c('0x16')]('\x20')});})[_0x6e8c('0x1e')](function(_0x587ea2){_0x5a7c0f(_0x2be5bb[_0x6e8c('0x13')](0x1f5,[_0x294267[_0x6e8c('0x2d')],_0x587ea2[_0x6e8c('0x1d')][_0x6e8c('0x35')]()][_0x6e8c('0x16')]('\x20')));});}else{return _0x5a7c0f(_0x2be5bb['error'](0x1f5,_0x6e8c('0x42')));}});},'VoiceQueuesChannelRedirect':function(_0x5a5d27){var _0x21362f=this;return new Promise(function(_0x5320df,_0x3f4802){if(ami[_0x6e8c('0x1f')]()==![]){return _0x3f4802(_0x21362f[_0x6e8c('0x13')](0x1f4,[config['asterisk']['ip'],config[_0x6e8c('0x14')][_0x6e8c('0x15')],_0x6e8c('0x20')][_0x6e8c('0x16')]('\x20')));}var _0x49aecc=schema(properties[_0x6e8c('0x46')])['validate'](_0x5a5d27);if(_0x49aecc[_0x6e8c('0x25')]>0x0){return _0x3f4802(_0x21362f[_0x6e8c('0x13')](0x1f4,_[_0x6e8c('0x2a')](_0x49aecc,'message')[_0x6e8c('0x16')](',\x20')));}var _0x5c136a=_[_0x6e8c('0x2b')](_0x576ccf[_0x6e8c('0x43')],{'uniqueid':_0x5a5d27[_0x6e8c('0x2d')]});if(_0x5c136a&&_0x5c136a[_0x6e8c('0x2e')]){return ami[_0x6e8c('0x1b')]({'action':'Redirect','channel':_0x5c136a[_0x6e8c('0x2e')],'exten':_0x5a5d27[_0x6e8c('0x47')],'context':_0x5a5d27[_0x6e8c('0x48')]||_0x5c136a[_0x6e8c('0x48')],'priority':0x1})['then'](function(_0x3bb584){_0x5320df({'code':0xc8,'message':[_0x5a5d27[_0x6e8c('0x2d')],_0x3bb584[_0x6e8c('0x1d')][_0x6e8c('0x35')]()][_0x6e8c('0x16')]('\x20')});})['catch'](function(_0x59be3f){_0x3f4802(_0x21362f['error'](0x1f5,[_0x5a5d27['uniqueid'],_0x59be3f[_0x6e8c('0x1d')][_0x6e8c('0x35')]()][_0x6e8c('0x16')]('\x20')));});}else{return _0x3f4802(_0x21362f['error'](0x1f5,_0x6e8c('0x42')));}});},'Agents':function(_0x388a27){return new Promise(function(_0x17667e){var _0x4f76d5=_['values'](_0x576ccf[_0x6e8c('0xf')]);if(_0x388a27&&_0x388a27['id']){var _0x518963=_[_0x6e8c('0x2b')](_0x4f76d5,function(_0x226e06){return _0x226e06['id']===_0x388a27['id'];});_0x17667e(_0x518963);}else{_0x17667e({'count':_0x4f76d5[_0x6e8c('0x25')],'rows':_0x4f76d5});}});},'Telephones':function(){return new Promise(function(_0x2f79b5){var _0x23bbb2=_['values'](_0x576ccf[_0x6e8c('0x49')]);_0x2f79b5({'count':_0x23bbb2[_0x6e8c('0x25')],'rows':_0x23bbb2});});},'Trunks':function(){return new Promise(function(_0x4c5b2e){var _0x53a9bf=_[_0x6e8c('0x28')](_0x576ccf['trunks']);_0x4c5b2e({'count':_0x53a9bf[_0x6e8c('0x25')],'rows':_0x53a9bf});});},'OutboundChannels':function(){return new Promise(function(_0x4bbda2){var _0x2dad2d=_[_0x6e8c('0x28')](_0x576ccf[_0x6e8c('0x4a')]);_0x4bbda2({'count':_0x2dad2d[_0x6e8c('0x25')],'rows':_0x2dad2d});});},'Outbound':function(){return new Promise(function(_0x135349){_0x135349(_0x576ccf[_0x6e8c('0x4b')]);});},'Campaigns':function(){return new Promise(function(_0x49679e){var _0xfb286c=_['values'](_0x576ccf['campaigns']);_0x49679e({'count':_0xfb286c[_0x6e8c('0x25')],'rows':_0xfb286c});});},'VoiceQueuesPreview':function(_0x2b30c1){var _0x25dfce=this;return new Promise(function(_0x3524b3,_0x543520){_0x41c343[_0x6e8c('0x4c')](_0x2b30c1['id'])['then'](function(_0x5de4f0){_0x3524b3({'code':0xc8,'message':_0x5de4f0[_0x6e8c('0x1d')]});})[_0x6e8c('0x1e')](function(_0x3d8bbb){_0x543520(_0x25dfce['error'](0x1f4,_0x3d8bbb['message']));});});},'EventManager':function(_0x52f494){var _0x3100d2=this;return new Promise(function(_0x310961,_0x38c18f){if(!_0x52f494[_0x6e8c('0x4d')]){return _0x38c18f(_0x3100d2['error'](0x1f4,_0x6e8c('0x4e')));}ami[_0x6e8c('0x4f')](_0x6e8c('0x50')+_0x52f494[_0x6e8c('0x4d')],_0x52f494[_0x6e8c('0x1d')]);_0x310961({'code':0xc8,'message':_0x52f494});});},'FaxAccounts':function(){return new Promise(function(_0x467347){var _0x1c877a=_['values'](_0x576ccf[_0x6e8c('0x51')]);_0x467347({'count':_0x1c877a[_0x6e8c('0x25')],'rows':_0x1c877a});});},'SendFax':function(_0x6a163f){var _0x3656fb=this;return new Promise(function(_0x1fc936,_0x29713f){_0x4d0af3[_0x6e8c('0x52')](_0x6a163f)[_0x6e8c('0x1c')](function(_0x530318){_0x1fc936({'code':0xc8,'message':_0x530318[_0x6e8c('0x1d')]});})[_0x6e8c('0x1e')](function(_0x1fa849){_0x29713f(_0x3656fb['error'](0x1f4,_0x1fa849['message']));});});},'CheckAfterSend':function(_0x521db0){var _0x4e0768=this;return new Promise(function(_0x4e1fa2,_0x5d66c4){_0x4d0af3['checkAfterSend'](_0x521db0)[_0x6e8c('0x1c')](function(_0x4a10ce){_0x4e1fa2({'code':0xc8,'message':_0x4a10ce[_0x6e8c('0x1d')]});})[_0x6e8c('0x1e')](function(_0x2ba357){_0x5d66c4(_0x4e0768['error'](0x1f4,_0x2ba357[_0x6e8c('0x1d')]));});});}};var _0x5365a4=jayson[_0x6e8c('0x53')](_0x562379)[_0x6e8c('0x54')]();_0x5365a4['on'](_0x6e8c('0x13'),function(_0x53109e){return _0x440541(_0x53109e);});_0x5365a4[_0x6e8c('0x8')](0x232a,'127.0.0.1',function(){console[_0x6e8c('0x55')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x438147(_0x6e8c('0x56')+0x232a);});});};
\ No newline at end of file
index 72d1295..729f73c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9679=['[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','Unknown','destcalleridname','<unknown>','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','merge','length','lodash','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','fax','createdAt','scheduledAt','updatedAt','resolve','then','isEmpty'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x9679,0x15f));var _0x9967=function(_0x54bf25,_0x1d0aeb){_0x54bf25=_0x54bf25-0x0;var _0x431fbb=_0x9679[_0x54bf25];return _0x431fbb;};'use strict';var _=require(_0x9967('0x0'));var BPromise=require('bluebird');var Redis=require('ioredis');var util=require(_0x9967('0x1'));var config=require(_0x9967('0x2'));var logger=require(_0x9967('0x3'))(_0x9967('0x4'));var cmContactRpc=require(_0x9967('0x5'));config[_0x9967('0x6')]=_[_0x9967('0x7')](config[_0x9967('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0xc3f972,_0x37b5d2,_0x4e5ed5,_0x425d2a,_0x47c431){logger[_0x9967('0x8')](_0x9967('0x9'),_0xc3f972,_0x37b5d2['id'],_0x4e5ed5,_0x425d2a,JSON[_0x9967('0xa')](_0x47c431));io['to'](_0x4e5ed5)[_0x9967('0xb')](_0x425d2a,_0x47c431);}exports[_0x9967('0xc')]=function(_0x2b979a,_0x287b63,_0x3deee7,_0x2079a6){var _0x1a140a,_0x8c7bb;var _0x182bcb={};var _0xad4c07;var _0x4cfb6b=Number(_0x3deee7[_0x9967('0xd')]);var _0x4a1840=_0x3deee7['data2']?Boolean(Number(_0x3deee7[_0x9967('0xe')])):![];var _0x447843;var _0x42917e=![];if(!_[_0x9967('0xf')](_0x3deee7[_0x9967('0x10')])){if(_0x3deee7[_0x9967('0x10')]=='1')_0x42917e=!![];}if(!_0x42917e){if(_0x2079a6['xmd-contactid']){_0x182bcb['id']=_0x2079a6[_0x9967('0x11')];}}if(!_0x182bcb['id']){_0x182bcb[_0x9967('0x12')]=_0x4cfb6b;_0x447843=_0x3deee7['data3']&&_0x3deee7['data3']!=='0'?_0x3deee7['data3']['split'](','):[_0x9967('0x13')];_0x182bcb[_0x9967('0x14')]=_[_0x9967('0x15')](_0x447843,function(_0x8bf4ea){var _0x197816={};_0x197816[_0x8bf4ea]=_0x2079a6[_0x9967('0x16')]?_0x2079a6[_0x9967('0x17')]:_0x2079a6[_0x9967('0x18')];return _0x197816;});_0xad4c07=_0x2079a6[_0x9967('0x16')]?_0x2079a6[_0x9967('0x17')]:_0x2079a6[_0x9967('0x18')];}var _0x421392=['id',_0x9967('0x19'),_0x9967('0x1a'),'phone','mobile',_0x9967('0x1b'),_0x9967('0x12'),_0x9967('0x1c'),_0x9967('0x1d'),_0x9967('0x1e')];var _0x9304ad=_['union'](_0x421392,_0x447843);BPromise[_0x9967('0x1f')]()[_0x9967('0x20')](cmContactRpc['getContacts']({'attributes':_0x9304ad,'where':_0x182bcb,'phone':_0xad4c07}))[_0x9967('0x20')](function(_0xfb090b){_0x8c7bb=_0xfb090b;if(!_[_0x9967('0x21')](_0x8c7bb)){if(_0x8c7bb['length']===0x1){_0x1a140a=_0x8c7bb[0x0];logger['info'](_0x9967('0x22'),_0x2079a6['uniqueid'],_0x287b63['id'],_0x1a140a['id']);}else{logger['info']('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x2079a6[_0x9967('0x23')],_0x287b63['id'],_[_0x9967('0x15')](_0x8c7bb,'id')[_0x9967('0x24')](','));}return;}else{logger[_0x9967('0x8')](_0x9967('0x25'),_0x2079a6[_0x9967('0x23')],_0x287b63['id']);var _0x17f2f3={'ListId':_0x4cfb6b};var _0x38f7c1=_0x3deee7[_0x9967('0x26')]&&_0x3deee7[_0x9967('0x26')]!=='0'?_0x3deee7[_0x9967('0x26')]:_0x9967('0x13');if(_0x4a1840){logger[_0x9967('0x8')](_0x9967('0x27'),_0x2079a6[_0x9967('0x23')],_0x287b63['id']);_0x17f2f3[_0x38f7c1]=_[_0x9967('0xf')](_0x2079a6[_0x9967('0x16')])?_0x2079a6[_0x9967('0x18')]:_0x2079a6['destcalleridnum'];if(_[_0x9967('0xf')](_0x2079a6[_0x9967('0x16')])){_0x17f2f3[_0x9967('0x19')]=_0x2079a6[_0x9967('0x28')]&&_0x2079a6[_0x9967('0x28')]!=='<unknown>'?_0x2079a6['calleridname']:_0x9967('0x29');}else{_0x17f2f3['firstName']=_0x2079a6[_0x9967('0x2a')]&&_0x2079a6[_0x9967('0x2a')]!==_0x9967('0x2b')?_0x2079a6[_0x9967('0x2a')]:_0x9967('0x29');}return BPromise[_0x9967('0x1f')]()['then'](cmContactRpc['createContact'](_0x17f2f3))['then'](function(_0x518f0e){_0x1a140a=_0x518f0e;_0x8c7bb[_0x9967('0x2c')](_0x518f0e);if(_0x1a140a){logger[_0x9967('0x8')](_0x9967('0x2d'),_0x2079a6['uniqueid'],_0x287b63['id'],_0x1a140a['id']);}return;});}else{logger[_0x9967('0x8')](_0x9967('0x2e'),_0x2079a6[_0x9967('0x23')],_0x287b63['id']);_0x17f2f3[_0x38f7c1]=_[_0x9967('0xf')](_0x2079a6['routeId'])?_0x2079a6[_0x9967('0x18')]:_0x2079a6[_0x9967('0x17')];if(_['isNil'](_0x2079a6[_0x9967('0x16')])){_0x17f2f3[_0x9967('0x19')]=_0x2079a6[_0x9967('0x28')]&&_0x2079a6[_0x9967('0x28')]!==_0x9967('0x2b')?_0x2079a6[_0x9967('0x28')]:_0x9967('0x29');}else{_0x17f2f3[_0x9967('0x19')]=_0x2079a6[_0x9967('0x2a')]&&_0x2079a6[_0x9967('0x2a')]!==_0x9967('0x2b')?_0x2079a6['destcalleridname']:_0x9967('0x29');}_0x1a140a=_0x17f2f3;_0x8c7bb[_0x9967('0x2c')](_0x17f2f3);return;}}})[_0x9967('0x20')](function(){if(_0x2b979a){emit(_0x2079a6[_0x9967('0x23')],_0x287b63,util[_0x9967('0x2f')](_0x9967('0x30'),_0x2b979a[_0x9967('0x31')]),util[_0x9967('0x2f')](_0x9967('0x32'),_0x3deee7[_0x9967('0x33')][_0x9967('0x34')]()),{'evt':_[_0x9967('0x35')](_0x2079a6,{'autoCreate':_0x4a1840}),'contact':_0x1a140a===undefined?{}:_0x1a140a,'contacts':_0x8c7bb[_0x9967('0x36')]===0x0?undefined:_0x8c7bb});}});};
\ No newline at end of file
+var _0x5e6c=['[CM][%s][%s]\x20Contact\x20created:%s','push','format','user:%s','name','trigger:%s','toLowerCase','merge','bluebird','ioredis','../../../../config/environment','redis','defaults','localhost','info','[CM][%s][%s]','stringify','emit','data1','data2','isNil','data5','xmd-contactid','ListId','data3','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','createdAt','scheduledAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','<unknown>','Unknown','destcalleridname','createContact'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x5e6c,0x1dc));var _0xc5e6=function(_0x20412f,_0x32b502){_0x20412f=_0x20412f-0x0;var _0x16d840=_0x5e6c[_0x20412f];return _0x16d840;};'use strict';var _=require('lodash');var BPromise=require(_0xc5e6('0x0'));var Redis=require(_0xc5e6('0x1'));var util=require('util');var config=require(_0xc5e6('0x2'));var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require('../../rpc/cmContact');config[_0xc5e6('0x3')]=_[_0xc5e6('0x4')](config['redis'],{'host':_0xc5e6('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc5e6('0x3')]));function emit(_0x79124e,_0x4b438c,_0x322299,_0x360980,_0x71405){logger[_0xc5e6('0x6')](_0xc5e6('0x7'),_0x79124e,_0x4b438c['id'],_0x322299,_0x360980,JSON[_0xc5e6('0x8')](_0x71405));io['to'](_0x322299)[_0xc5e6('0x9')](_0x360980,_0x71405);}exports['exec']=function(_0x5e601a,_0x3f25f7,_0x5477be,_0x2cb788){var _0x563d8f,_0x5da247;var _0x1fb6db={};var _0x4092f4;var _0x2c0ab3=Number(_0x5477be[_0xc5e6('0xa')]);var _0x2c0096=_0x5477be[_0xc5e6('0xb')]?Boolean(Number(_0x5477be[_0xc5e6('0xb')])):![];var _0xb79fdf;var _0x460814=![];if(!_[_0xc5e6('0xc')](_0x5477be[_0xc5e6('0xd')])){if(_0x5477be[_0xc5e6('0xd')]=='1')_0x460814=!![];}if(!_0x460814){if(_0x2cb788[_0xc5e6('0xe')]){_0x1fb6db['id']=_0x2cb788[_0xc5e6('0xe')];}}if(!_0x1fb6db['id']){_0x1fb6db[_0xc5e6('0xf')]=_0x2c0ab3;_0xb79fdf=_0x5477be[_0xc5e6('0x10')]&&_0x5477be['data3']!=='0'?_0x5477be[_0xc5e6('0x10')]['split'](','):[_0xc5e6('0x11')];_0x1fb6db[_0xc5e6('0x12')]=_[_0xc5e6('0x13')](_0xb79fdf,function(_0x18a910){var _0x425d20={};_0x425d20[_0x18a910]=_0x2cb788[_0xc5e6('0x14')]?_0x2cb788[_0xc5e6('0x15')]:_0x2cb788['calleridnum'];return _0x425d20;});_0x4092f4=_0x2cb788[_0xc5e6('0x14')]?_0x2cb788[_0xc5e6('0x15')]:_0x2cb788[_0xc5e6('0x16')];}var _0x4b989a=['id',_0xc5e6('0x17'),_0xc5e6('0x18'),_0xc5e6('0x11'),'mobile','fax','ListId',_0xc5e6('0x19'),_0xc5e6('0x1a'),'updatedAt'];var _0x5af25d=_[_0xc5e6('0x1b')](_0x4b989a,_0xb79fdf);BPromise[_0xc5e6('0x1c')]()[_0xc5e6('0x1d')](cmContactRpc[_0xc5e6('0x1e')]({'attributes':_0x5af25d,'where':_0x1fb6db,'phone':_0x4092f4}))['then'](function(_0x3cce4f){_0x5da247=_0x3cce4f;if(!_[_0xc5e6('0x1f')](_0x5da247)){if(_0x5da247[_0xc5e6('0x20')]===0x1){_0x563d8f=_0x5da247[0x0];logger[_0xc5e6('0x6')](_0xc5e6('0x21'),_0x2cb788[_0xc5e6('0x22')],_0x3f25f7['id'],_0x563d8f['id']);}else{logger[_0xc5e6('0x6')](_0xc5e6('0x23'),_0x2cb788['uniqueid'],_0x3f25f7['id'],_['map'](_0x5da247,'id')[_0xc5e6('0x24')](','));}return;}else{logger['info']('[CM][%s][%s]\x20Contact\x20not\x20found',_0x2cb788[_0xc5e6('0x22')],_0x3f25f7['id']);var _0x50a21f={'ListId':_0x2c0ab3};var _0x299b38=_0x5477be[_0xc5e6('0x25')]&&_0x5477be[_0xc5e6('0x25')]!=='0'?_0x5477be[_0xc5e6('0x25')]:_0xc5e6('0x11');if(_0x2c0096){logger[_0xc5e6('0x6')](_0xc5e6('0x26'),_0x2cb788[_0xc5e6('0x22')],_0x3f25f7['id']);_0x50a21f[_0x299b38]=_[_0xc5e6('0xc')](_0x2cb788[_0xc5e6('0x14')])?_0x2cb788['calleridnum']:_0x2cb788[_0xc5e6('0x15')];if(_['isNil'](_0x2cb788['routeId'])){_0x50a21f[_0xc5e6('0x17')]=_0x2cb788[_0xc5e6('0x27')]&&_0x2cb788[_0xc5e6('0x27')]!==_0xc5e6('0x28')?_0x2cb788[_0xc5e6('0x27')]:_0xc5e6('0x29');}else{_0x50a21f[_0xc5e6('0x17')]=_0x2cb788[_0xc5e6('0x2a')]&&_0x2cb788['destcalleridname']!==_0xc5e6('0x28')?_0x2cb788[_0xc5e6('0x2a')]:'Unknown';}return BPromise['resolve']()['then'](cmContactRpc[_0xc5e6('0x2b')](_0x50a21f))[_0xc5e6('0x1d')](function(_0x1ace1f){_0x563d8f=_0x1ace1f;_0x5da247['push'](_0x1ace1f);if(_0x563d8f){logger[_0xc5e6('0x6')](_0xc5e6('0x2c'),_0x2cb788['uniqueid'],_0x3f25f7['id'],_0x563d8f['id']);}return;});}else{logger[_0xc5e6('0x6')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x2cb788[_0xc5e6('0x22')],_0x3f25f7['id']);_0x50a21f[_0x299b38]=_[_0xc5e6('0xc')](_0x2cb788[_0xc5e6('0x14')])?_0x2cb788[_0xc5e6('0x16')]:_0x2cb788[_0xc5e6('0x15')];if(_['isNil'](_0x2cb788[_0xc5e6('0x14')])){_0x50a21f[_0xc5e6('0x17')]=_0x2cb788[_0xc5e6('0x27')]&&_0x2cb788[_0xc5e6('0x27')]!==_0xc5e6('0x28')?_0x2cb788['calleridname']:_0xc5e6('0x29');}else{_0x50a21f[_0xc5e6('0x17')]=_0x2cb788[_0xc5e6('0x2a')]&&_0x2cb788[_0xc5e6('0x2a')]!==_0xc5e6('0x28')?_0x2cb788[_0xc5e6('0x2a')]:_0xc5e6('0x29');}_0x563d8f=_0x50a21f;_0x5da247[_0xc5e6('0x2d')](_0x50a21f);return;}}})[_0xc5e6('0x1d')](function(){if(_0x5e601a){emit(_0x2cb788[_0xc5e6('0x22')],_0x3f25f7,util[_0xc5e6('0x2e')](_0xc5e6('0x2f'),_0x5e601a[_0xc5e6('0x30')]),util[_0xc5e6('0x2e')](_0xc5e6('0x31'),_0x5477be['action'][_0xc5e6('0x32')]()),{'evt':_[_0xc5e6('0x33')](_0x2cb788,{'autoCreate':_0x2c0096}),'contact':_0x563d8f===undefined?{}:_0x563d8f,'contacts':_0x5da247[_0xc5e6('0x20')]===0x0?undefined:_0x5da247});}});};
\ No newline at end of file
index 2d58024..4b6b1eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x687b=['custom:offlineMessage','emit','info','stringify','prototype','motionChannel','undefined','voice','checkTriggers','interface','status','merge','variables','Actions','length','toLowerCase','contactmanager','browser','data1','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data3','location','uriLocation','data4','windowWidth','data5','windowHeight','data6','600','winApplication','winArguments','user:%s','trigger:%s:%s','action','jscripty','format','name','trigger:%s','exec','integration','urlforward','query','search','replace','channel','AllConditions','every','checkConditions','AnyConditions','some','field','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','queue','agent','membername','lastevent','routeId','null','substatus','offlineMessage','created','util','lodash','url','mustache','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','accounts','freshsalesAccounts','custom:agentcalled','bind','custom:agentconnect','syncCustomEvent','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:outgoingmessage','custom:rejectmessage'];(function(_0x2304fe,_0x5ea1b0){var _0x539fe6=function(_0x169a4a){while(--_0x169a4a){_0x2304fe['push'](_0x2304fe['shift']());}};_0x539fe6(++_0x5ea1b0);}(_0x687b,0x14a));var _0xb687=function(_0x127a60,_0x37f33a){_0x127a60=_0x127a60-0x0;var _0xc1f6a3=_0x687b[_0x127a60];return _0xc1f6a3;};'use strict';var util=require(_0xb687('0x0'));var _=require(_0xb687('0x1'));var url=require(_0xb687('0x2'));var Mustache=require(_0xb687('0x3'));var Redis=require('ioredis');var urlforward=require('./urlforward');var integration=require(_0xb687('0x4'));var cmContact=require(_0xb687('0x5'));var script=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var logger=require(_0xb687('0x8'))(_0xb687('0x9'));var ami=require(_0xb687('0xa'));config[_0xb687('0xb')]=_[_0xb687('0xc')](config[_0xb687('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0xb687('0xd'))(new Redis(config[_0xb687('0xb')]));var operators={'equals':function(_0x47f4cc,_0x1a99c5){return _0x47f4cc==_0x1a99c5;},'not_equals':function(_0x21e3ab,_0x825ad){return _0x21e3ab!=_0x825ad;}};var barAndWebActions=[_0xb687('0xe'),_0xb687('0x2'),_0xb687('0xf')];function Trigger(_0x3e6271){this[_0xb687('0x10')]=_0x3e6271[_0xb687('0x10')];this['agents']=_0x3e6271[_0xb687('0x11')];this[_0xb687('0x12')]=_0x3e6271[_0xb687('0x12')];this[_0xb687('0x13')]=_0x3e6271['templates'];this['voiceExtensions']=_0x3e6271[_0xb687('0x14')];this[_0xb687('0x15')]=_0x3e6271['zendeskAccounts'];this[_0xb687('0x16')]=_0x3e6271[_0xb687('0x16')];this[_0xb687('0x17')]=_0x3e6271[_0xb687('0x17')];this[_0xb687('0x18')]=_0x3e6271[_0xb687('0x18')];this[_0xb687('0x19')]=_0x3e6271[_0xb687('0x19')];this[_0xb687('0x1a')]=_0x3e6271[_0xb687('0x1a')];this[_0xb687('0x1b')]=_0x3e6271[_0xb687('0x1b')];this['servicenowAccounts']=_0x3e6271[_0xb687('0x1c')];this[_0xb687('0x1d')]=_0x3e6271[_0xb687('0x1d')];this['freshsalesAccounts']=_0x3e6271['freshsalesAccounts'];this[_0xb687('0x1e')]={'zendesk':this[_0xb687('0x15')],'salesforce':this[_0xb687('0x17')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0xb687('0x18')],'zoho':this['zohoAccounts'],'desk':this[_0xb687('0x1a')],'vtiger':this[_0xb687('0x1b')],'dynamics365':this[_0xb687('0x1d')],'freshsales':this[_0xb687('0x1f')],'servicenow':this['servicenowAccounts']};ami['on'](_0xb687('0x20'),this['syncCustomEvent'][_0xb687('0x21')](this));ami['on'](_0xb687('0x22'),this[_0xb687('0x23')]['bind'](this));ami['on'](_0xb687('0x24'),this[_0xb687('0x23')][_0xb687('0x21')](this));ami['on'](_0xb687('0x25'),this[_0xb687('0x23')][_0xb687('0x21')](this));ami['on'](_0xb687('0x26'),this[_0xb687('0x23')]['bind'](this));ami['on'](_0xb687('0x27'),this[_0xb687('0x23')][_0xb687('0x21')](this));ami['on'](_0xb687('0x28'),this[_0xb687('0x23')][_0xb687('0x21')](this));ami['on'](_0xb687('0x29'),this[_0xb687('0x23')][_0xb687('0x21')](this));ami['on'](_0xb687('0x2a'),this['syncCustomEvent'][_0xb687('0x21')](this));ami['on'](_0xb687('0x2b'),this[_0xb687('0x23')][_0xb687('0x21')](this));ami['on'](_0xb687('0x2c'),this[_0xb687('0x23')]['bind'](this));ami['on'](_0xb687('0x2d'),this['syncCustomEvent'][_0xb687('0x21')](this));ami['on'](_0xb687('0x2e'),this[_0xb687('0x2f')][_0xb687('0x21')](this));ami['on'](_0xb687('0x30'),this[_0xb687('0x2f')][_0xb687('0x21')](this));ami['on']('custom:dialend',this[_0xb687('0x2f')][_0xb687('0x21')](this));ami['on'](_0xb687('0x31'),this[_0xb687('0x23')][_0xb687('0x21')](this));ami['on'](_0xb687('0x32'),this[_0xb687('0x23')][_0xb687('0x21')](this));ami['on'](_0xb687('0x33'),this[_0xb687('0x23')][_0xb687('0x21')](this));ami['on']('custom:incomingmessage',this['syncCustomEvent'][_0xb687('0x21')](this));ami['on'](_0xb687('0x34'),this[_0xb687('0x23')][_0xb687('0x21')](this));ami['on']('custom:acceptmessage',this['syncCustomEvent'][_0xb687('0x21')](this));ami['on'](_0xb687('0x35'),this['syncCustomEvent'][_0xb687('0x21')](this));ami['on'](_0xb687('0x36'),this['syncCustomEvent'][_0xb687('0x21')](this));}Trigger['prototype'][_0xb687('0x37')]=function(_0x24f34e,_0x2da038,_0x3e146a){logger[_0xb687('0x38')](_0x24f34e,_0x2da038,JSON[_0xb687('0x39')](_0x3e146a));io['to'](_0x24f34e)['emit'](_0x2da038,_0x3e146a);};Trigger[_0xb687('0x3a')][_0xb687('0x23')]=function(_0x2a73df){var _0x38a814=_['clone'](_0x2a73df);if(typeof _0x38a814[_0xb687('0x3b')]===_0xb687('0x3c')){_0x38a814[_0xb687('0x3b')]=_0xb687('0x3d');}this[_0xb687('0x3e')](_0x38a814);};Trigger['prototype'][_0xb687('0x2f')]=function(_0x38a8dc){if(this[_0xb687('0x11')][_0x38a8dc[_0xb687('0x3f')]]){this[_0xb687('0x23')](_0x38a8dc);}};Trigger[_0xb687('0x3a')]['checkTriggers']=function(_0x5ad577){var _0x43f29c;for(var _0x5460a2 in this[_0xb687('0x10')]){if(this[_0xb687('0x10')]['hasOwnProperty'](_0x5460a2)){if(this[_0xb687('0x10')][_0x5460a2][_0xb687('0x40')]){_0x43f29c=this['checkTrigger'](this[_0xb687('0x10')][_0x5460a2],_0x5ad577);if(_0x43f29c){_[_0xb687('0x41')](_0x5ad577,_0x5ad577[_0xb687('0x42')]);for(var _0x5253df=0x0,_0x66fabe,_0x9cffb2,_0x38abe5;_0x5253df<this[_0xb687('0x10')][_0x5460a2][_0xb687('0x43')][_0xb687('0x44')];_0x5253df+=0x1){_0x66fabe=this[_0xb687('0x10')][_0x5460a2]['Actions'][_0x5253df];if(this[_0xb687('0x11')][_0x5ad577['interface']]){switch(_0x66fabe['action'][_0xb687('0x45')]()){case _0xb687('0x46'):break;case'motionbar':case _0xb687('0x47'):var _0x5f1b59={};switch(barAndWebActions[_0x66fabe[_0xb687('0x48')]]){case _0xb687('0xe'):_0x5f1b59['TemplateId']=_0x66fabe[_0xb687('0x49')];_0x5f1b59[_0xb687('0x4a')]=this['templates'][_0x66fabe[_0xb687('0x49')]]?Mustache[_0xb687('0x4b')](this[_0xb687('0x13')][_0x66fabe[_0xb687('0x49')]][_0xb687('0x4a')],_0x5ad577):_0xb687('0x4c');break;case _0xb687('0x2'):_0x5f1b59[_0xb687('0x4d')]=this[_0xb687('0x4e')](_0x66fabe[_0xb687('0x49')],_0x5ad577,_[_0xb687('0x4f')](_0x66fabe[_0xb687('0x50')])?!![]:parseInt(_0x66fabe['data3'],0xa));if(_[_0xb687('0x4f')](_0x66fabe['data4'])){_0x5f1b59[_0xb687('0x51')]='0';}else{_0x5f1b59[_0xb687('0x52')]=_0x66fabe[_0xb687('0x53')];_0x5f1b59[_0xb687('0x54')]=_[_0xb687('0x4f')](_0x66fabe[_0xb687('0x55')])?'800':_0x66fabe['data5'];_0x5f1b59[_0xb687('0x56')]=_[_0xb687('0x4f')](_0x66fabe[_0xb687('0x57')])?_0xb687('0x58'):_0x66fabe['data6'];}break;case _0xb687('0xf'):_0x5f1b59[_0xb687('0x59')]=_0x66fabe[_0xb687('0x49')]?Mustache[_0xb687('0x4b')](_0x66fabe['data2'],_0x5ad577):'';_0x5f1b59[_0xb687('0x5a')]=_0x66fabe[_0xb687('0x50')]?Mustache[_0xb687('0x4b')](_0x66fabe[_0xb687('0x50')],_0x5ad577):'';break;}this['emit'](util['format'](_0xb687('0x5b'),this[_0xb687('0x11')][_0x5ad577[_0xb687('0x3f')]]['name']),util['format'](_0xb687('0x5c'),_0x66fabe[_0xb687('0x5d')][_0xb687('0x45')](),barAndWebActions[_0x66fabe[_0xb687('0x48')]]),_[_0xb687('0x41')](_0x5f1b59,_0x5ad577));break;case _0xb687('0x5e'):this[_0xb687('0x37')](util[_0xb687('0x5f')]('user:%s',this[_0xb687('0x11')][_0x5ad577[_0xb687('0x3f')]][_0xb687('0x60')]),util['format']('trigger:%s',_0x66fabe['action']['toLowerCase']()),_[_0xb687('0x41')]({'ProjectId':parseInt(_0x66fabe[_0xb687('0x48')],0xa)},_0x5ad577));break;default:this[_0xb687('0x37')](util[_0xb687('0x5f')](_0xb687('0x5b'),this[_0xb687('0x11')][_0x5ad577[_0xb687('0x3f')]][_0xb687('0x60')]),util[_0xb687('0x5f')](_0xb687('0x61'),_0x66fabe[_0xb687('0x5d')][_0xb687('0x45')]()),_[_0xb687('0x41')]({},_0x66fabe,_0x5ad577));}}switch(_0x66fabe[_0xb687('0x5d')][_0xb687('0x45')]()){case _0xb687('0x46'):cmContact[_0xb687('0x62')](this['agents'][_0x5ad577['interface']],this[_0xb687('0x10')][_0x5460a2],_0x66fabe,_0x5ad577);break;case _0xb687('0x63'):integration[_0xb687('0x62')](_0x66fabe,_0x5ad577,this[_0xb687('0x1e')],this['agents'][_0x5ad577[_0xb687('0x3f')]],this[_0xb687('0x12')][_0x5ad577['queue']],this[_0xb687('0x14')][_0x5ad577['routeId']]);break;case _0xb687('0x64'):urlforward[_0xb687('0x62')](_0x66fabe,_0x5ad577);break;case'script':script['exec'](_0x66fabe,_0x5ad577);break;}}}}}}};Trigger[_0xb687('0x3a')][_0xb687('0x4e')]=function(_0x5ea8fd,_0x1da4d1,_0x318be6){var _0x3cd364=url['parse'](Mustache[_0xb687('0x4b')](_0x5ea8fd,_0x1da4d1),!![]);if(_0x318be6){_['merge'](_0x3cd364[_0xb687('0x65')],_0x1da4d1);}delete _0x3cd364[_0xb687('0x66')];var _0x3223f8=url[_0xb687('0x5f')](_0x3cd364);_0x3223f8=_0x3223f8[_0xb687('0x67')](/\/\?/g,'?');return _0x3223f8;};Trigger['prototype']['checkTrigger']=function(_0xa8f04a,_0x58ec8b){var _0x5362ea=!![];var _0x5def9d=!![];var _0x5d266c=![];if(_0xa8f04a[_0xb687('0x68')]===_0x58ec8b[_0xb687('0x3b')]){_0x5d266c=!![];}if(_0xa8f04a[_0xb687('0x69')][_0xb687('0x44')]){_0x5362ea=_[_0xb687('0x6a')](_0xa8f04a[_0xb687('0x69')],this[_0xb687('0x6b')](_0x58ec8b,_0xa8f04a[_0xb687('0x68')]));}if(_0xa8f04a[_0xb687('0x6c')][_0xb687('0x44')]){_0x5def9d=_[_0xb687('0x6d')](_0xa8f04a['AnyConditions'],this['checkConditions'](_0x58ec8b,_0xa8f04a[_0xb687('0x68')]));}return _0x5d266c&&_0x5362ea&&_0x5def9d;};Trigger['prototype'][_0xb687('0x6b')]=function(_0x1840f3,_0x1c031f){return function(_0x3ebaa2){switch(_0x3ebaa2[_0xb687('0x6e')]){case'account':if(_0x1840f3[_0xb687('0x68')]===_0x1c031f){if(_0x1c031f==='chat'){return _0x1840f3[_0xb687('0x6f')]?operators[_0x3ebaa2[_0xb687('0x70')]](Number(_0x3ebaa2[_0xb687('0x71')]),_0x1840f3[_0xb687('0x6f')]):![];}else{return _0x1840f3[_[_0xb687('0x72')](_0x1c031f)+_0xb687('0x73')]?operators[_0x3ebaa2[_0xb687('0x70')]](Number(_0x3ebaa2['value']),_0x1840f3[_[_0xb687('0x72')](_0x1c031f)+_0xb687('0x73')]):![];}}break;case _0xb687('0x74'):case _0xb687('0x75'):if(_0x1840f3[_0xb687('0x68')]===_0x1c031f){return _0x1840f3['event']?operators[_0x3ebaa2[_0xb687('0x70')]](_0x3ebaa2[_0xb687('0x71')],_0x1840f3[_0xb687('0x76')]):![];}break;case _0xb687('0x77'):return _0x1840f3[_0xb687('0x77')]?operators[_0x3ebaa2[_0xb687('0x70')]](_0x3ebaa2[_0xb687('0x71')],_0x1840f3[_0xb687('0x77')]):![];case _0xb687('0x78'):return _0x1840f3[_0xb687('0x79')]?operators[_0x3ebaa2[_0xb687('0x70')]](_0x3ebaa2['value'],_0x1840f3[_0xb687('0x79')]):![];case _0xb687('0x7a'):return _0x1840f3[_0xb687('0x7a')]?operators[_0x3ebaa2[_0xb687('0x70')]](_0x3ebaa2['value'],_0x1840f3[_0xb687('0x7a')]):![];case _0xb687('0x7b'):return _0x1840f3['routeId']?operators[_0x3ebaa2[_0xb687('0x70')]](_0x3ebaa2[_0xb687('0x71')],_0x1840f3[_0xb687('0x7b')]):![];case'mailSubstatus':if(_0x3ebaa2[_0xb687('0x71')]===_0xb687('0x7c'))_0x3ebaa2['value']=null;return typeof _0x1840f3[_0xb687('0x7d')]!==_0xb687('0x3c')?operators[_0x3ebaa2[_0xb687('0x70')]](_0x3ebaa2[_0xb687('0x71')],_0x1840f3['substatus']):![];case _0xb687('0x7e'):if(_0x1840f3[_0xb687('0x68')]===_0x1c031f){return _0x3ebaa2['value']===_0xb687('0x7f')&&_0x3ebaa2[_0xb687('0x70')]==='equals'?!![]:![];}break;}return![];};};module['exports']=Trigger;
\ No newline at end of file
+var _0x2faf=['uriLocation','800','data5','data6','600','winArguments','name','format','trigger:%s:%s','data1','jscripty','user:%s','trigger:%s','exec','integration','queue','routeId','urlforward','script','parse','query','replace','channel','motionChannel','AllConditions','every','checkConditions','AnyConditions','some','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','mailSubstatus','null','substatus','offlineMessage','created','equals','exports','util','lodash','url','ioredis','./urlforward','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','localhost','socket.io-emitter','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','syncCustomEvent','custom:agentconnect','bind','custom:agentcomplete','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','undefined','voice','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','length','Actions','action','toLowerCase','contactmanager','motionbar','browser','popup','TemplateId','data2','html','render','uri','buildUri','isNil','data3','data4','location'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x2faf,0xb0));var _0xf2fa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2faf[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xf2fa('0x0'));var _=require(_0xf2fa('0x1'));var url=require(_0xf2fa('0x2'));var Mustache=require('mustache');var Redis=require(_0xf2fa('0x3'));var urlforward=require(_0xf2fa('0x4'));var integration=require('./integration');var cmContact=require(_0xf2fa('0x5'));var script=require(_0xf2fa('0x6'));var config=require(_0xf2fa('0x7'));var logger=require(_0xf2fa('0x8'))(_0xf2fa('0x9'));var ami=require(_0xf2fa('0xa'));config[_0xf2fa('0xb')]=_['defaults'](config[_0xf2fa('0xb')],{'host':_0xf2fa('0xc'),'port':0x18eb});var io=require(_0xf2fa('0xd'))(new Redis(config[_0xf2fa('0xb')]));var operators={'equals':function(_0x5dc47b,_0x1847d3){return _0x5dc47b==_0x1847d3;},'not_equals':function(_0x530819,_0x310ccd){return _0x530819!=_0x310ccd;}};var barAndWebActions=['popup',_0xf2fa('0x2'),_0xf2fa('0xe')];function Trigger(_0x4640a6){this[_0xf2fa('0xf')]=_0x4640a6[_0xf2fa('0xf')];this[_0xf2fa('0x10')]=_0x4640a6[_0xf2fa('0x10')];this[_0xf2fa('0x11')]=_0x4640a6[_0xf2fa('0x11')];this[_0xf2fa('0x12')]=_0x4640a6['templates'];this[_0xf2fa('0x13')]=_0x4640a6[_0xf2fa('0x13')];this[_0xf2fa('0x14')]=_0x4640a6[_0xf2fa('0x14')];this[_0xf2fa('0x15')]=_0x4640a6[_0xf2fa('0x15')];this[_0xf2fa('0x16')]=_0x4640a6[_0xf2fa('0x16')];this['sugarcrmAccounts']=_0x4640a6[_0xf2fa('0x17')];this['zohoAccounts']=_0x4640a6[_0xf2fa('0x18')];this[_0xf2fa('0x19')]=_0x4640a6['deskAccounts'];this['vtigerAccounts']=_0x4640a6[_0xf2fa('0x1a')];this[_0xf2fa('0x1b')]=_0x4640a6[_0xf2fa('0x1b')];this[_0xf2fa('0x1c')]=_0x4640a6[_0xf2fa('0x1c')];this[_0xf2fa('0x1d')]=_0x4640a6['freshsalesAccounts'];this[_0xf2fa('0x1e')]={'zendesk':this[_0xf2fa('0x14')],'salesforce':this[_0xf2fa('0x16')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0xf2fa('0x17')],'zoho':this[_0xf2fa('0x18')],'desk':this[_0xf2fa('0x19')],'vtiger':this[_0xf2fa('0x1a')],'dynamics365':this[_0xf2fa('0x1c')],'freshsales':this['freshsalesAccounts'],'servicenow':this['servicenowAccounts']};ami['on']('custom:agentcalled',this[_0xf2fa('0x1f')]['bind'](this));ami['on'](_0xf2fa('0x20'),this[_0xf2fa('0x1f')]['bind'](this));ami['on']('custom:agentringnoanswer',this['syncCustomEvent'][_0xf2fa('0x21')](this));ami['on'](_0xf2fa('0x22'),this[_0xf2fa('0x1f')][_0xf2fa('0x21')](this));ami['on']('custom:agentnosuchnumber',this['syncCustomEvent'][_0xf2fa('0x21')](this));ami['on']('custom:agentnoanswer',this['syncCustomEvent']['bind'](this));ami['on'](_0xf2fa('0x23'),this['syncCustomEvent']['bind'](this));ami['on'](_0xf2fa('0x24'),this['syncCustomEvent'][_0xf2fa('0x21')](this));ami['on'](_0xf2fa('0x25'),this[_0xf2fa('0x1f')]['bind'](this));ami['on']('custom:amd',this[_0xf2fa('0x1f')]['bind'](this));ami['on'](_0xf2fa('0x26'),this[_0xf2fa('0x1f')][_0xf2fa('0x21')](this));ami['on'](_0xf2fa('0x27'),this['syncCustomEvent'][_0xf2fa('0x21')](this));ami['on'](_0xf2fa('0x28'),this[_0xf2fa('0x29')]['bind'](this));ami['on'](_0xf2fa('0x2a'),this[_0xf2fa('0x29')][_0xf2fa('0x21')](this));ami['on'](_0xf2fa('0x2b'),this[_0xf2fa('0x29')][_0xf2fa('0x21')](this));ami['on'](_0xf2fa('0x2c'),this[_0xf2fa('0x1f')][_0xf2fa('0x21')](this));ami['on'](_0xf2fa('0x2d'),this['syncCustomEvent']['bind'](this));ami['on'](_0xf2fa('0x2e'),this[_0xf2fa('0x1f')][_0xf2fa('0x21')](this));ami['on'](_0xf2fa('0x2f'),this[_0xf2fa('0x1f')]['bind'](this));ami['on']('custom:outgoingmessage',this[_0xf2fa('0x1f')][_0xf2fa('0x21')](this));ami['on'](_0xf2fa('0x30'),this[_0xf2fa('0x1f')][_0xf2fa('0x21')](this));ami['on'](_0xf2fa('0x31'),this['syncCustomEvent'][_0xf2fa('0x21')](this));ami['on']('custom:offlineMessage',this[_0xf2fa('0x1f')][_0xf2fa('0x21')](this));}Trigger[_0xf2fa('0x32')][_0xf2fa('0x33')]=function(_0x1232d2,_0x5d7ed7,_0x26033e){logger[_0xf2fa('0x34')](_0x1232d2,_0x5d7ed7,JSON['stringify'](_0x26033e));io['to'](_0x1232d2)[_0xf2fa('0x33')](_0x5d7ed7,_0x26033e);};Trigger['prototype'][_0xf2fa('0x1f')]=function(_0x295152){var _0x3d5a14=_['clone'](_0x295152);if(typeof _0x3d5a14['motionChannel']===_0xf2fa('0x35')){_0x3d5a14['motionChannel']=_0xf2fa('0x36');}this[_0xf2fa('0x37')](_0x3d5a14);};Trigger[_0xf2fa('0x32')][_0xf2fa('0x29')]=function(_0x2b4dd9){if(this[_0xf2fa('0x10')][_0x2b4dd9[_0xf2fa('0x38')]]){this['syncCustomEvent'](_0x2b4dd9);}};Trigger['prototype']['checkTriggers']=function(_0x2d87dd){var _0x3ea7ed;for(var _0x411f7e in this[_0xf2fa('0xf')]){if(this[_0xf2fa('0xf')][_0xf2fa('0x39')](_0x411f7e)){if(this[_0xf2fa('0xf')][_0x411f7e][_0xf2fa('0x3a')]){_0x3ea7ed=this[_0xf2fa('0x3b')](this[_0xf2fa('0xf')][_0x411f7e],_0x2d87dd);if(_0x3ea7ed){_[_0xf2fa('0x3c')](_0x2d87dd,_0x2d87dd[_0xf2fa('0x3d')]);for(var _0x3f9094=0x0,_0x9d9410,_0x3a3c15,_0x10ff14;_0x3f9094<this['triggers'][_0x411f7e]['Actions'][_0xf2fa('0x3e')];_0x3f9094+=0x1){_0x9d9410=this['triggers'][_0x411f7e][_0xf2fa('0x3f')][_0x3f9094];if(this['agents'][_0x2d87dd[_0xf2fa('0x38')]]){switch(_0x9d9410[_0xf2fa('0x40')][_0xf2fa('0x41')]()){case _0xf2fa('0x42'):break;case _0xf2fa('0x43'):case _0xf2fa('0x44'):var _0x4a52a3={};switch(barAndWebActions[_0x9d9410['data1']]){case _0xf2fa('0x45'):_0x4a52a3[_0xf2fa('0x46')]=_0x9d9410[_0xf2fa('0x47')];_0x4a52a3[_0xf2fa('0x48')]=this['templates'][_0x9d9410[_0xf2fa('0x47')]]?Mustache[_0xf2fa('0x49')](this[_0xf2fa('0x12')][_0x9d9410['data2']][_0xf2fa('0x48')],_0x2d87dd):'template\x20not\x20found';break;case _0xf2fa('0x2'):_0x4a52a3[_0xf2fa('0x4a')]=this[_0xf2fa('0x4b')](_0x9d9410[_0xf2fa('0x47')],_0x2d87dd,_[_0xf2fa('0x4c')](_0x9d9410[_0xf2fa('0x4d')])?!![]:parseInt(_0x9d9410[_0xf2fa('0x4d')],0xa));if(_[_0xf2fa('0x4c')](_0x9d9410[_0xf2fa('0x4e')])){_0x4a52a3[_0xf2fa('0x4f')]='0';}else{_0x4a52a3[_0xf2fa('0x50')]=_0x9d9410[_0xf2fa('0x4e')];_0x4a52a3['windowWidth']=_['isNil'](_0x9d9410['data5'])?_0xf2fa('0x51'):_0x9d9410[_0xf2fa('0x52')];_0x4a52a3['windowHeight']=_[_0xf2fa('0x4c')](_0x9d9410[_0xf2fa('0x53')])?_0xf2fa('0x54'):_0x9d9410[_0xf2fa('0x53')];}break;case'winapp':_0x4a52a3['winApplication']=_0x9d9410[_0xf2fa('0x47')]?Mustache['render'](_0x9d9410[_0xf2fa('0x47')],_0x2d87dd):'';_0x4a52a3[_0xf2fa('0x55')]=_0x9d9410['data3']?Mustache['render'](_0x9d9410[_0xf2fa('0x4d')],_0x2d87dd):'';break;}this[_0xf2fa('0x33')](util['format']('user:%s',this[_0xf2fa('0x10')][_0x2d87dd['interface']][_0xf2fa('0x56')]),util[_0xf2fa('0x57')](_0xf2fa('0x58'),_0x9d9410[_0xf2fa('0x40')][_0xf2fa('0x41')](),barAndWebActions[_0x9d9410[_0xf2fa('0x59')]]),_[_0xf2fa('0x3c')](_0x4a52a3,_0x2d87dd));break;case _0xf2fa('0x5a'):this[_0xf2fa('0x33')](util[_0xf2fa('0x57')](_0xf2fa('0x5b'),this[_0xf2fa('0x10')][_0x2d87dd[_0xf2fa('0x38')]]['name']),util[_0xf2fa('0x57')](_0xf2fa('0x5c'),_0x9d9410['action'][_0xf2fa('0x41')]()),_[_0xf2fa('0x3c')]({'ProjectId':parseInt(_0x9d9410[_0xf2fa('0x59')],0xa)},_0x2d87dd));break;default:this[_0xf2fa('0x33')](util['format']('user:%s',this[_0xf2fa('0x10')][_0x2d87dd[_0xf2fa('0x38')]][_0xf2fa('0x56')]),util['format']('trigger:%s',_0x9d9410[_0xf2fa('0x40')]['toLowerCase']()),_[_0xf2fa('0x3c')]({},_0x9d9410,_0x2d87dd));}}switch(_0x9d9410[_0xf2fa('0x40')][_0xf2fa('0x41')]()){case _0xf2fa('0x42'):cmContact[_0xf2fa('0x5d')](this[_0xf2fa('0x10')][_0x2d87dd[_0xf2fa('0x38')]],this[_0xf2fa('0xf')][_0x411f7e],_0x9d9410,_0x2d87dd);break;case _0xf2fa('0x5e'):integration[_0xf2fa('0x5d')](_0x9d9410,_0x2d87dd,this['accounts'],this[_0xf2fa('0x10')][_0x2d87dd['interface']],this[_0xf2fa('0x11')][_0x2d87dd[_0xf2fa('0x5f')]],this[_0xf2fa('0x13')][_0x2d87dd[_0xf2fa('0x60')]]);break;case _0xf2fa('0x61'):urlforward[_0xf2fa('0x5d')](_0x9d9410,_0x2d87dd);break;case _0xf2fa('0x62'):script[_0xf2fa('0x5d')](_0x9d9410,_0x2d87dd);break;}}}}}}};Trigger[_0xf2fa('0x32')]['buildUri']=function(_0x123baa,_0xbf8278,_0x433509){var _0x20fd7e=url[_0xf2fa('0x63')](Mustache[_0xf2fa('0x49')](_0x123baa,_0xbf8278),!![]);if(_0x433509){_[_0xf2fa('0x3c')](_0x20fd7e[_0xf2fa('0x64')],_0xbf8278);}delete _0x20fd7e['search'];var _0x54956c=url['format'](_0x20fd7e);_0x54956c=_0x54956c[_0xf2fa('0x65')](/\/\?/g,'?');return _0x54956c;};Trigger['prototype'][_0xf2fa('0x3b')]=function(_0x141f04,_0x2a170b){var _0x451a54=!![];var _0x411567=!![];var _0x5aec15=![];if(_0x141f04[_0xf2fa('0x66')]===_0x2a170b[_0xf2fa('0x67')]){_0x5aec15=!![];}if(_0x141f04[_0xf2fa('0x68')][_0xf2fa('0x3e')]){_0x451a54=_[_0xf2fa('0x69')](_0x141f04[_0xf2fa('0x68')],this[_0xf2fa('0x6a')](_0x2a170b,_0x141f04[_0xf2fa('0x66')]));}if(_0x141f04[_0xf2fa('0x6b')][_0xf2fa('0x3e')]){_0x411567=_[_0xf2fa('0x6c')](_0x141f04[_0xf2fa('0x6b')],this[_0xf2fa('0x6a')](_0x2a170b,_0x141f04['channel']));}return _0x5aec15&&_0x451a54&&_0x411567;};Trigger['prototype'][_0xf2fa('0x6a')]=function(_0x1388bc,_0x132473){return function(_0x2b0246){switch(_0x2b0246['field']){case'account':if(_0x1388bc[_0xf2fa('0x66')]===_0x132473){if(_0x132473===_0xf2fa('0x6d')){return _0x1388bc[_0xf2fa('0x6e')]?operators[_0x2b0246[_0xf2fa('0x6f')]](Number(_0x2b0246[_0xf2fa('0x70')]),_0x1388bc[_0xf2fa('0x6e')]):![];}else{return _0x1388bc[_[_0xf2fa('0x71')](_0x132473)+_0xf2fa('0x72')]?operators[_0x2b0246[_0xf2fa('0x6f')]](Number(_0x2b0246[_0xf2fa('0x70')]),_0x1388bc[_[_0xf2fa('0x71')](_0x132473)+_0xf2fa('0x72')]):![];}}break;case _0xf2fa('0x73'):case _0xf2fa('0x74'):if(_0x1388bc['channel']===_0x132473){return _0x1388bc['event']?operators[_0x2b0246[_0xf2fa('0x6f')]](_0x2b0246['value'],_0x1388bc[_0xf2fa('0x75')]):![];}break;case _0xf2fa('0x5f'):return _0x1388bc[_0xf2fa('0x5f')]?operators[_0x2b0246[_0xf2fa('0x6f')]](_0x2b0246[_0xf2fa('0x70')],_0x1388bc['queue']):![];case _0xf2fa('0x76'):return _0x1388bc[_0xf2fa('0x77')]?operators[_0x2b0246[_0xf2fa('0x6f')]](_0x2b0246[_0xf2fa('0x70')],_0x1388bc[_0xf2fa('0x77')]):![];case _0xf2fa('0x78'):return _0x1388bc[_0xf2fa('0x78')]?operators[_0x2b0246[_0xf2fa('0x6f')]](_0x2b0246[_0xf2fa('0x70')],_0x1388bc[_0xf2fa('0x78')]):![];case'routeId':return _0x1388bc[_0xf2fa('0x60')]?operators[_0x2b0246['operator']](_0x2b0246[_0xf2fa('0x70')],_0x1388bc[_0xf2fa('0x60')]):![];case _0xf2fa('0x79'):if(_0x2b0246['value']===_0xf2fa('0x7a'))_0x2b0246['value']=null;return typeof _0x1388bc[_0xf2fa('0x7b')]!==_0xf2fa('0x35')?operators[_0x2b0246[_0xf2fa('0x6f')]](_0x2b0246[_0xf2fa('0x70')],_0x1388bc[_0xf2fa('0x7b')]):![];case _0xf2fa('0x7c'):if(_0x1388bc[_0xf2fa('0x66')]===_0x132473){return _0x2b0246['value']===_0xf2fa('0x7d')&&_0x2b0246[_0xf2fa('0x6f')]===_0xf2fa('0x7e')?!![]:![];}break;}return![];};};module[_0xf2fa('0x7f')]=Trigger;
\ No newline at end of file
index 476ff7e..b291082 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x3ef2d3,_0x5a70f5){var _0x179ac5=function(_0x243a80){while(--_0x243a80){_0x3ef2d3['push'](_0x3ef2d3['shift']());}};_0x179ac5(++_0x5a70f5);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'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
+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(_0x19e667,_0x525f2e){var _0x3c5a5d=function(_0x4f5f35){while(--_0x4f5f35){_0x19e667['push'](_0x19e667['shift']());}};_0x3c5a5d(++_0x525f2e);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 04a779f..20a41b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9812=[']\x20The\x20User\x20email\x20is:','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','request-promise','util','./util','md5','../../../../config/logger','dynamics365','redis','localhost','socket.io-emitter','modernAuthentication','remoteUri','tenantId','data2','resolve','data5','POST','clientId','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','Bearer\x20','4.0','value','isNil','validateEmail','userEmail','email','length','internalemailaddress','info',']\x20Agent\x20found\x20','userId','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','outbound','contacts','/systemusers(','body','odata-entityid','substring','lastIndexOf','enduserId','telephone1','\x20eq\x20\x27','replace','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','includes','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incidents','assign','getString','Descriptions','Fields','phonecall','callDirection','/contacts(','queue','phonecalls','calleridnum','headers','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','stripTrailingSlash','data7','serverUrl','%s/api/data/v9.0/','CloudProvider','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:'];(function(_0x448050,_0x2c97da){var _0x1d8968=function(_0x115e4d){while(--_0x115e4d){_0x448050['push'](_0x448050['shift']());}};_0x1d8968(++_0x2c97da);}(_0x9812,0xde));var _0x2981=function(_0x3e4956,_0x571c40){_0x3e4956=_0x3e4956-0x0;var _0xaba5c6=_0x9812[_0x3e4956];return _0xaba5c6;};'use strict';var _=require('lodash');var rp=require(_0x2981('0x0'));var util=require(_0x2981('0x1'));var intUtil=require(_0x2981('0x2'));var md5=require(_0x2981('0x3'));var Redis=require('ioredis');var logger=require(_0x2981('0x4'))(_0x2981('0x5'));var config=require('../../../../config/environment');config[_0x2981('0x6')]=_['defaults'](config['redis'],{'host':_0x2981('0x7'),'port':0x18eb});var io=require(_0x2981('0x8'))(new Redis(config[_0x2981('0x6')]));function getAuthToken(_0x30e9f9,_0x258c1,_0x5ac079){if(_0x30e9f9[_0x2981('0x9')]){_0x30e9f9[_0x2981('0xa')]=_0x30e9f9['CloudProvider']['data7'];_0x30e9f9[_0x2981('0xb')]=_0x30e9f9['CloudProvider'][_0x2981('0xc')];return Promise[_0x2981('0xd')](_0x30e9f9['CloudProvider'][_0x2981('0xe')]);}var _0x299809={'method':_0x2981('0xf'),'uri':_0x258c1,'form':{'client_id':_0x30e9f9[_0x2981('0x10')],'resource':_0x30e9f9['remoteUri'],'username':_0x30e9f9['username'],'password':_0x30e9f9[_0x2981('0x11')],'grant_type':_0x2981('0x11'),'client_secret':_0x30e9f9[_0x2981('0x12')]},'json':!![]};return rp(_0x299809)[_0x2981('0x13')](function(_0xc7de79){return _0xc7de79[_0x2981('0x14')];})[_0x2981('0x15')](function(_0x34d8d1){logger[_0x2981('0x16')]('['+[_0x5ac079[_0x2981('0x17')]()]+_0x2981('0x18'));return _0x34d8d1[_0x2981('0x19')];});}function getUser(_0x4171b6,_0x34ab3f,_0x42094a,_0x1593a6,_0x3a5078,_0x5cd503){return new Promise(function(_0x4277ee,_0x34c93b){return getAuthToken(_0x34ab3f,_0x1593a6,_0x5cd503)[_0x2981('0x13')](function(_0x341a68){var _0x2c4e3b={'method':_0x2981('0x1a'),'uri':_0x3a5078+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x2981('0x1b')+_0x341a68,'OData-Version':_0x2981('0x1c')},'json':!![]};return rp(_0x2c4e3b);})[_0x2981('0x13')](function(_0x142cea){var _0x3d5a81=_0x142cea[_0x2981('0x1d')];var _0x50946f=![];var _0x1963ce=null;if(!_[_0x2981('0x1e')](_0x42094a)){if(intUtil[_0x2981('0x1f')](_0x42094a['email'])){_0x4171b6[_0x2981('0x20')]=_0x42094a[_0x2981('0x21')];for(_0x1963ce=0x0;_0x1963ce<_0x3d5a81[_0x2981('0x22')];_0x1963ce++){if(_0x3d5a81[_0x1963ce][_0x2981('0x23')]===_0x42094a[_0x2981('0x21')]&&!_0x3d5a81[_0x1963ce]['isdisabled']){_0x50946f=!![];logger[_0x2981('0x24')]('['+[_0x5cd503[_0x2981('0x17')]()]+_0x2981('0x25')+_0x3d5a81[_0x1963ce]['systemuserid']+'!');_0x4171b6[_0x2981('0x26')]=_0x3d5a81[_0x1963ce][_0x2981('0x27')];}}}}if(!_0x50946f){logger[_0x2981('0x24')]('['+[_0x5cd503[_0x2981('0x17')]()]+_0x2981('0x28'));_0x4171b6[_0x2981('0x20')]=_0x34ab3f['username'];for(_0x1963ce=0x0;_0x1963ce<_0x3d5a81[_0x2981('0x22')];_0x1963ce++){if(_0x3d5a81[_0x1963ce][_0x2981('0x23')]===_0x34ab3f[_0x2981('0x29')]){_0x4171b6[_0x2981('0x26')]=_0x3d5a81[_0x1963ce][_0x2981('0x27')];}}}_0x4277ee(_0x4171b6);})[_0x2981('0x15')](function(_0x4fa2fa){_0x34c93b(_0x4fa2fa[_0x2981('0x19')]);});});}function createEndUser(_0x47f79f,_0x3ea1e6,_0x39582a,_0x5f3e28,_0x32fb52,_0x3b7f91,_0x511343){return new Promise(function(_0x563c12,_0x4bd5a6){return getAuthToken(_0x3ea1e6,_0x39582a,_0x3b7f91)['then'](function(_0x23b49f){var _0x1787eb=_0x3b7f91['toLowerCase']()===_0x2981('0x2a')?_0x32fb52['destcalleridnum']:_0x32fb52['calleridnum'];var _0x4530b5={'method':_0x2981('0xf'),'uri':_0x5f3e28+_0x2981('0x2b'),'body':{'fullname':_0x1787eb,'firstname':_0x1787eb,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x2981('0x2c')+_0x47f79f[_0x2981('0x26')]+')'},'headers':{'Authorization':_0x2981('0x1b')+_0x23b49f,'OData-Version':_0x2981('0x1c')},'json':!![],'resolveWithFullResponse':!![]};_0x4530b5[_0x2981('0x2d')][_0x511343]=_0x1787eb;return rp(_0x4530b5);})[_0x2981('0x13')](function(_0x33e647){var _0x3a8944=_0x33e647['headers'][_0x2981('0x2e')];var _0x16f5c5=_0x3a8944[_0x2981('0x2f')](_0x3a8944[_0x2981('0x30')]('(')+0x1,_0x3a8944[_0x2981('0x30')](')'));_0x47f79f[_0x2981('0x31')]=_0x16f5c5;_0x563c12(_0x47f79f);})[_0x2981('0x15')](function(_0x57c4f1){_0x4bd5a6(_0x57c4f1[_0x2981('0x19')]);});});}function getEndUser(_0x1c6fd9,_0x9a15b1,_0x27bc9d,_0x40d3ab,_0x1d19fd,_0x10f6b8,_0x2e0227,_0x1a440b){var _0x567b70=_0x10f6b8['toLowerCase']()===_0x2981('0x2a')?_0x1d19fd['destcalleridnum']:_0x1d19fd['calleridnum'];return getAuthToken(_0x9a15b1,_0x27bc9d,_0x10f6b8)[_0x2981('0x13')](function(_0x33bb89){_0x1a440b=_0x1a440b?_0x1a440b:_0x2981('0x32');var _0x596639={'method':_0x2981('0x1a'),'uri':_0x40d3ab+'contacts?$select='+_0x1a440b+'&$filter='+_0x1a440b+_0x2981('0x33')+_0x567b70[_0x2981('0x34')]('+',_0x2981('0x35'))+'\x27','headers':{'Authorization':_0x2981('0x1b')+_0x33bb89,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x596639);})[_0x2981('0x13')](function(_0x1a8131){var _0x43172b=![];if(!_0x1a8131)return _0x43172b;var _0x41d653=_0x1a8131[_0x2981('0x1d')];for(var _0x5262a8=0x0;_0x5262a8<_0x41d653[_0x2981('0x22')];_0x5262a8++){if(_0x41d653[_0x5262a8][_0x1a440b]===_0x567b70){_0x43172b=!![];_0x1c6fd9[_0x2981('0x31')]=_0x41d653[_0x5262a8][_0x2981('0x36')];}}return _0x43172b;})[_0x2981('0x13')](function(_0x533f5b){if(_0x533f5b)return _0x1c6fd9;if(_0x2e0227===_0x2981('0x37')){logger['info']('['+[_0x10f6b8[_0x2981('0x17')]()]+_0x2981('0x38'));return _0x1c6fd9;}return createEndUser(_0x1c6fd9,_0x9a15b1,_0x27bc9d,_0x40d3ab,_0x1d19fd,_0x10f6b8,_0x1a440b)[_0x2981('0x13')](function(_0x1a26aa){logger[_0x2981('0x24')]('['+[_0x10f6b8[_0x2981('0x17')]()]+_0x2981('0x39'),_0x1a26aa[_0x2981('0x31')]);return _0x1a26aa;});});}function getCustomFields(_0x18af9d,_0x3210e0,_0x1bbe5e){var _0x14bcc4={};if(_0x18af9d[_0x2981('0x22')]>0x0){_['forEach'](_0x18af9d,function(_0x2dfe4f){if(_[_0x2981('0x3a')](['string',_0x2981('0x3b')],_0x2dfe4f[_0x2981('0x3c')])&&_0x2dfe4f[_0x2981('0x3d')]&&!_0x2dfe4f[_0x2981('0x3e')]){var _0x5a1679=_0x2dfe4f[_0x2981('0x3f')]['toLowerCase']();var _0x5ced35=_0x5a1679[_0x2981('0x2f')](0x0,_0x5a1679[_0x2981('0x40')]('_'));var _0xd2e244=_0x5a1679[_0x2981('0x2f')](_0x5a1679[_0x2981('0x40')]('_')+0x1);if(_0x5ced35===_0x1bbe5e){_0x14bcc4[_0xd2e244]=_0x2dfe4f[_0x2981('0x41')];}}});}return _0x14bcc4;}function getTicket(_0x51a59e,_0xf89ac1,_0x2404dc,_0xc2ce99,_0x3f9731,_0x121d9e,_0x4a48cf){return new Promise(function(_0x5e4b0e,_0x50e4af){var _0x22d785;return getAuthToken(_0xf89ac1,_0x2404dc,_0x4a48cf)[_0x2981('0x13')](function(_0x3f9ea7){if(_0x121d9e[_0x2981('0x42')]==='incident'){_0x22d785={'method':'POST','uri':_0xc2ce99+_0x2981('0x43'),'body':Object[_0x2981('0x44')]({},{'title':intUtil[_0x2981('0x45')](_0x121d9e['Subjects'],_0x3f9731,'\x20'),'description':intUtil['getString'](_0x121d9e[_0x2981('0x46')],_0x3f9731,'\x0a'),'customerid_contact@odata.bind':_0x51a59e[_0x2981('0x31')]?'/contacts('+_0x51a59e['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x51a59e[_0x2981('0x26')]+')','caseorigincode':'1'},getCustomFields(_0x121d9e[_0x2981('0x47')],_0x3f9731,_0x121d9e[_0x2981('0x42')])),'headers':{'Authorization':'Bearer\x20'+_0x3f9ea7,'OData-Version':_0x2981('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x121d9e[_0x2981('0x42')]===_0x2981('0x48')){var _0x56016e=_0x51a59e[_0x2981('0x31')]?[{'partyid_systemuser@odata.bind':_0x2981('0x2c')+_0x51a59e['userId']+')','participationtypemask':_0x51a59e[_0x2981('0x49')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x2981('0x4a')+_0x51a59e[_0x2981('0x31')]+')','participationtypemask':_0x51a59e[_0x2981('0x49')]===_0x2981('0x4b')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x2981('0x2c')+_0x51a59e['userId']+')','participationtypemask':_0x51a59e[_0x2981('0x49')]===_0x2981('0x4b')?0x2:0x1}];_0x22d785={'method':_0x2981('0xf'),'uri':_0xc2ce99+_0x2981('0x4c'),'body':Object[_0x2981('0x44')]({},{'subject':intUtil['getString'](_0x121d9e['Subjects'],_0x3f9731,'\x20'),'phonenumber':String(_0x3f9731[_0x2981('0x4d')]),'description':intUtil[_0x2981('0x45')](_0x121d9e['Descriptions'],_0x3f9731,'\x0a'),'regardingobjectid_contact@odata.bind':_0x51a59e[_0x2981('0x31')]?_0x2981('0x4a')+_0x51a59e[_0x2981('0x31')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x51a59e[_0x2981('0x26')]+')','directioncode':_0x51a59e[_0x2981('0x49')]==='queue'?![]:!![],'phonecall_activity_parties':_0x56016e},getCustomFields(_0x121d9e[_0x2981('0x47')],_0x3f9731,_0x121d9e[_0x2981('0x42')])),'headers':{'Authorization':_0x2981('0x1b')+_0x3f9ea7,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x22d785);})['then'](function(_0x3b040d){var _0x429d42=_0x3b040d[_0x2981('0x4e')][_0x2981('0x2e')];var _0x45733e=_0x429d42['substring'](_0x429d42['lastIndexOf']('(')+0x1,_0x429d42[_0x2981('0x30')](')'));_0x51a59e[_0x2981('0x4f')]=_0x45733e;_0x5e4b0e(_0x51a59e);})['catch'](function(_0x52c22b){_0x50e4af(_0x52c22b[_0x2981('0x19')]);});});}function emit(_0x24943c,_0x4dcffb,_0x812c5b,_0x47a8e3){var _0x5a0edc={'uri':util['format'](_0x2981('0x50'),_0x24943c,_0x812c5b,_0x47a8e3)};io['to'](util[_0x2981('0x51')](_0x2981('0x52'),_0x4dcffb))['emit']('trigger:browser:url',_0x5a0edc);}exports['cs']=function(_0x792d26,_0x368e8b,_0x59efb3,_0xe931d7,_0x59d2d3,_0x2b5542,_0x549ed7,_0x2add59){var _0x55ba8d={};_0x2b5542['remoteUri']=_0x2b5542[_0x2981('0x9')]?intUtil[_0x2981('0x53')](_0x2b5542['CloudProvider'][_0x2981('0x54')]):intUtil[_0x2981('0x53')](_0x2b5542['remoteUri']);_0x2b5542[_0x2981('0x55')]=intUtil[_0x2981('0x53')](_0x2b5542['serverUrl']);_0x55ba8d['callDirection']=_0x2add59==='queue'||_0x2add59==='unmanaged'?_0x2981('0x4b'):_0x2981('0x2a');var _0x33e886=_0x2b5542[_0x2981('0x9')]?util[_0x2981('0x51')](_0x2981('0x56'),_0x2b5542[_0x2981('0x57')][_0x2981('0x54')]):util[_0x2981('0x51')](_0x2981('0x56'),_0x2b5542[_0x2981('0xa')]);var _0x315b97=util[_0x2981('0x51')](_0x2981('0x58'),_0x2b5542[_0x2981('0xb')]);var _0x514cf5=util['format'](_0x2981('0x59'),_0x2b5542[_0x2981('0x55')],_0x368e8b['uniqueid'],md5(_0x368e8b[_0x2981('0x5a')]));if(_0x59d2d3&&_0x59d2d3[_0x2981('0x5b')]){logger[_0x2981('0x24')](_0x2981('0x5c'),_0x2981('0x5d'));_0x368e8b[_0x2981('0x5e')]=_0x514cf5;}else if(_0x549ed7&&_0x549ed7[_0x2981('0x5f')]&&_0x549ed7['recordingFormat']!==_0x2981('0x60')){logger[_0x2981('0x24')](_0x2981('0x61'),_0x2981('0x5d'));_0x368e8b[_0x2981('0x5e')]=_0x514cf5;}else{_0x368e8b['recordingURL']='';}return getUser(_0x55ba8d,_0x2b5542,_0xe931d7,_0x315b97,_0x33e886,_0x2add59)['then'](function(_0xb9a439){logger['info']('['+_0x2add59[_0x2981('0x17')]()+_0x2981('0x62'),_0xb9a439[_0x2981('0x26')]);logger[_0x2981('0x24')]('['+_0x2add59[_0x2981('0x17')]()+_0x2981('0x63'),_0xb9a439[_0x2981('0x20')]);return getEndUser(_0xb9a439,_0x2b5542,_0x315b97,_0x33e886,_0x368e8b,_0x2add59,_0x59efb3['moduleCreate'],_0x59efb3[_0x2981('0x64')]);})[_0x2981('0x13')](function(_0x38ef32){logger['info']('['+_0x2add59[_0x2981('0x17')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x38ef32['enduserId']);logger[_0x2981('0x24')]('['+_0x2add59[_0x2981('0x17')]()+_0x2981('0x65'),_0x368e8b[_0x2981('0x4d')]);return getTicket(_0x38ef32,_0x2b5542,_0x315b97,_0x33e886,_0x368e8b,_0x59efb3,_0x2add59);})[_0x2981('0x13')](function(_0x4d24d0){logger[_0x2981('0x24')](util[_0x2981('0x51')]('['+_0x2add59[_0x2981('0x17')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x59efb3['ticketType'],_0x4d24d0[_0x2981('0x4f')]));logger[_0x2981('0x24')](util[_0x2981('0x51')]('['+_0x2add59['toUpperCase']()+_0x2981('0x66'),_0x2add59));if(_0x2add59!=='unmanaged'&&_0x59efb3[_0x2981('0x67')]){logger[_0x2981('0x24')]('['+_0x2add59[_0x2981('0x17')]()+']',_0x2981('0x68'));emit(_0x2b5542[_0x2981('0xa')],_0xe931d7['name'],_0x59efb3[_0x2981('0x42')],_0x4d24d0[_0x2981('0x4f')]);}})[_0x2981('0x15')](function(_0x526fea){logger[_0x2981('0x16')]('['+_0x2add59['toUpperCase']()+_0x2981('0x69'),_0x526fea['message']);console['error'](_0x2981('0x6a'),_0x526fea);});};
\ No newline at end of file
+var _0x78c4=['access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','then','isNil','validateEmail','internalemailaddress','email','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','message','toLowerCase','destcalleridnum','calleridnum','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','outbound','telephone1','&$filter=','replace','%2b','enduserId','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','includes','string','type','nameField','customField','idField','indexOf','content','ticketType','POST','incidents','getString','Subjects','Descriptions','/contacts(','Fields','callDirection','queue','phonecalls','assign','ticketId','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','serverUrl','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','userEmail','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','data5','clientId','username','password'];(function(_0x3c6636,_0xab2136){var _0x98bb7=function(_0x2258fc){while(--_0x2258fc){_0x3c6636['push'](_0x3c6636['shift']());}};_0x98bb7(++_0xab2136);}(_0x78c4,0xc0));var _0x478c=function(_0x2c5a1a,_0x124058){_0x2c5a1a=_0x2c5a1a-0x0;var _0x418bf4=_0x78c4[_0x2c5a1a];return _0x418bf4;};'use strict';var _=require(_0x478c('0x0'));var rp=require(_0x478c('0x1'));var util=require(_0x478c('0x2'));var intUtil=require(_0x478c('0x3'));var md5=require(_0x478c('0x4'));var Redis=require(_0x478c('0x5'));var logger=require(_0x478c('0x6'))(_0x478c('0x7'));var config=require(_0x478c('0x8'));config[_0x478c('0x9')]=_['defaults'](config['redis'],{'host':_0x478c('0xa'),'port':0x18eb});var io=require(_0x478c('0xb'))(new Redis(config['redis']));function getAuthToken(_0x401928,_0x189bfc,_0x390e12){if(_0x401928[_0x478c('0xc')]){_0x401928[_0x478c('0xd')]=_0x401928[_0x478c('0xe')][_0x478c('0xf')];_0x401928['tenantId']=_0x401928[_0x478c('0xe')]['data2'];return Promise['resolve'](_0x401928[_0x478c('0xe')][_0x478c('0x10')]);}var _0x4212d8={'method':'POST','uri':_0x189bfc,'form':{'client_id':_0x401928[_0x478c('0x11')],'resource':_0x401928[_0x478c('0xd')],'username':_0x401928[_0x478c('0x12')],'password':_0x401928[_0x478c('0x13')],'grant_type':_0x478c('0x13'),'client_secret':_0x401928['clientSecret']},'json':!![]};return rp(_0x4212d8)['then'](function(_0x3a7b6d){return _0x3a7b6d[_0x478c('0x14')];})[_0x478c('0x15')](function(_0x2e9c70){logger[_0x478c('0x16')]('['+[_0x390e12[_0x478c('0x17')]()]+_0x478c('0x18'));return _0x2e9c70['message'];});}function getUser(_0x11a437,_0xd2bb8f,_0x543bc3,_0x375329,_0x355feb,_0x352aca){return new Promise(function(_0x2cdee7,_0x2ae215){return getAuthToken(_0xd2bb8f,_0x375329,_0x352aca)['then'](function(_0x104c69){var _0x2669c5={'method':_0x478c('0x19'),'uri':_0x355feb+_0x478c('0x1a'),'headers':{'Authorization':_0x478c('0x1b')+_0x104c69,'OData-Version':_0x478c('0x1c')},'json':!![]};return rp(_0x2669c5);})[_0x478c('0x1d')](function(_0x4db953){var _0x57031a=_0x4db953['value'];var _0x2fe2d6=![];var _0x18f417=null;if(!_[_0x478c('0x1e')](_0x543bc3)){if(intUtil[_0x478c('0x1f')](_0x543bc3['email'])){_0x11a437['userEmail']=_0x543bc3['email'];for(_0x18f417=0x0;_0x18f417<_0x57031a['length'];_0x18f417++){if(_0x57031a[_0x18f417][_0x478c('0x20')]===_0x543bc3[_0x478c('0x21')]&&!_0x57031a[_0x18f417]['isdisabled']){_0x2fe2d6=!![];logger[_0x478c('0x22')]('['+[_0x352aca[_0x478c('0x17')]()]+_0x478c('0x23')+_0x57031a[_0x18f417][_0x478c('0x24')]+'!');_0x11a437[_0x478c('0x25')]=_0x57031a[_0x18f417][_0x478c('0x24')];}}}}if(!_0x2fe2d6){logger['info']('['+[_0x352aca[_0x478c('0x17')]()]+_0x478c('0x26'));_0x11a437['userEmail']=_0xd2bb8f['username'];for(_0x18f417=0x0;_0x18f417<_0x57031a['length'];_0x18f417++){if(_0x57031a[_0x18f417][_0x478c('0x20')]===_0xd2bb8f[_0x478c('0x12')]){_0x11a437['userId']=_0x57031a[_0x18f417]['systemuserid'];}}}_0x2cdee7(_0x11a437);})['catch'](function(_0x31cb8a){_0x2ae215(_0x31cb8a[_0x478c('0x27')]);});});}function createEndUser(_0x2adf0d,_0x322f3e,_0x154fb3,_0x1aba61,_0x26947a,_0x2f20f0,_0x31a797){return new Promise(function(_0x5c34c9,_0x1c5986){return getAuthToken(_0x322f3e,_0x154fb3,_0x2f20f0)[_0x478c('0x1d')](function(_0x3bd545){var _0x267220=_0x2f20f0[_0x478c('0x28')]()==='outbound'?_0x26947a[_0x478c('0x29')]:_0x26947a[_0x478c('0x2a')];var _0x2ff577={'method':'POST','uri':_0x1aba61+'contacts','body':{'fullname':_0x267220,'firstname':_0x267220,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x478c('0x2b')+_0x2adf0d[_0x478c('0x25')]+')'},'headers':{'Authorization':_0x478c('0x1b')+_0x3bd545,'OData-Version':_0x478c('0x1c')},'json':!![],'resolveWithFullResponse':!![]};_0x2ff577[_0x478c('0x2c')][_0x31a797]=_0x267220;return rp(_0x2ff577);})[_0x478c('0x1d')](function(_0x45fc18){var _0x20baf7=_0x45fc18[_0x478c('0x2d')][_0x478c('0x2e')];var _0x119239=_0x20baf7[_0x478c('0x2f')](_0x20baf7[_0x478c('0x30')]('(')+0x1,_0x20baf7[_0x478c('0x30')](')'));_0x2adf0d['enduserId']=_0x119239;_0x5c34c9(_0x2adf0d);})[_0x478c('0x15')](function(_0x3b6da4){_0x1c5986(_0x3b6da4[_0x478c('0x27')]);});});}function getEndUser(_0x5bdfe4,_0x113729,_0x18d6f9,_0x3aa058,_0xfd5ab8,_0x4a43dc,_0x206aa4,_0x211a90){var _0x3dd4f4=_0x4a43dc[_0x478c('0x28')]()===_0x478c('0x31')?_0xfd5ab8[_0x478c('0x29')]:_0xfd5ab8[_0x478c('0x2a')];return getAuthToken(_0x113729,_0x18d6f9,_0x4a43dc)[_0x478c('0x1d')](function(_0x3f2233){_0x211a90=_0x211a90?_0x211a90:_0x478c('0x32');var _0x14d6e9={'method':'GET','uri':_0x3aa058+'contacts?$select='+_0x211a90+_0x478c('0x33')+_0x211a90+'\x20eq\x20\x27'+_0x3dd4f4[_0x478c('0x34')]('+',_0x478c('0x35'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x3f2233,'If-None-Match':null,'OData-Version':_0x478c('0x1c')},'json':!![]};return rp(_0x14d6e9);})[_0x478c('0x1d')](function(_0x28c84c){var _0x1e05eb=![];if(!_0x28c84c)return _0x1e05eb;var _0xfd3260=_0x28c84c['value'];for(var _0x4546d7=0x0;_0x4546d7<_0xfd3260['length'];_0x4546d7++){if(_0xfd3260[_0x4546d7][_0x211a90]===_0x3dd4f4){_0x1e05eb=!![];_0x5bdfe4[_0x478c('0x36')]=_0xfd3260[_0x4546d7][_0x478c('0x37')];}}return _0x1e05eb;})[_0x478c('0x1d')](function(_0x4ceb33){if(_0x4ceb33)return _0x5bdfe4;if(_0x206aa4===_0x478c('0x38')){logger[_0x478c('0x22')]('['+[_0x4a43dc[_0x478c('0x17')]()]+_0x478c('0x39'));return _0x5bdfe4;}return createEndUser(_0x5bdfe4,_0x113729,_0x18d6f9,_0x3aa058,_0xfd5ab8,_0x4a43dc,_0x211a90)[_0x478c('0x1d')](function(_0x5e72c9){logger['info']('['+[_0x4a43dc[_0x478c('0x17')]()]+_0x478c('0x3a'),_0x5e72c9[_0x478c('0x36')]);return _0x5e72c9;});});}function getCustomFields(_0x43148b,_0x4d6ad2,_0x85b3dd){var _0x31d431={};if(_0x43148b['length']>0x0){_['forEach'](_0x43148b,function(_0x257199){if(_[_0x478c('0x3b')]([_0x478c('0x3c'),'picklist'],_0x257199[_0x478c('0x3d')])&&_0x257199[_0x478c('0x3e')]&&!_0x257199[_0x478c('0x3f')]){var _0x268117=_0x257199[_0x478c('0x40')][_0x478c('0x28')]();var _0x27a8fe=_0x268117['substring'](0x0,_0x268117[_0x478c('0x41')]('_'));var _0x4bfb60=_0x268117['substring'](_0x268117['indexOf']('_')+0x1);if(_0x27a8fe===_0x85b3dd){_0x31d431[_0x4bfb60]=_0x257199[_0x478c('0x42')];}}});}return _0x31d431;}function getTicket(_0xf556d7,_0x5c1a14,_0x559383,_0xa79ca9,_0x51a6ca,_0x148bf0,_0x1cd8c0){return new Promise(function(_0x22501f,_0x205a7f){var _0x36691c;return getAuthToken(_0x5c1a14,_0x559383,_0x1cd8c0)[_0x478c('0x1d')](function(_0x330c3e){if(_0x148bf0[_0x478c('0x43')]==='incident'){_0x36691c={'method':_0x478c('0x44'),'uri':_0xa79ca9+_0x478c('0x45'),'body':Object['assign']({},{'title':intUtil[_0x478c('0x46')](_0x148bf0[_0x478c('0x47')],_0x51a6ca,'\x20'),'description':intUtil[_0x478c('0x46')](_0x148bf0[_0x478c('0x48')],_0x51a6ca,'\x0a'),'customerid_contact@odata.bind':_0xf556d7[_0x478c('0x36')]?_0x478c('0x49')+_0xf556d7[_0x478c('0x36')]+')':undefined,'ownerid@odata.bind':_0x478c('0x2b')+_0xf556d7[_0x478c('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x148bf0[_0x478c('0x4a')],_0x51a6ca,_0x148bf0[_0x478c('0x43')])),'headers':{'Authorization':_0x478c('0x1b')+_0x330c3e,'OData-Version':_0x478c('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x148bf0[_0x478c('0x43')]==='phonecall'){var _0x2b8888=_0xf556d7[_0x478c('0x36')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0xf556d7['userId']+')','participationtypemask':_0xf556d7[_0x478c('0x4b')]===_0x478c('0x4c')?0x2:0x1},{'partyid_contact@odata.bind':_0x478c('0x49')+_0xf556d7['enduserId']+')','participationtypemask':_0xf556d7['callDirection']===_0x478c('0x4c')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x478c('0x2b')+_0xf556d7[_0x478c('0x25')]+')','participationtypemask':_0xf556d7[_0x478c('0x4b')]===_0x478c('0x4c')?0x2:0x1}];_0x36691c={'method':_0x478c('0x44'),'uri':_0xa79ca9+_0x478c('0x4d'),'body':Object[_0x478c('0x4e')]({},{'subject':intUtil[_0x478c('0x46')](_0x148bf0[_0x478c('0x47')],_0x51a6ca,'\x20'),'phonenumber':String(_0x51a6ca['calleridnum']),'description':intUtil[_0x478c('0x46')](_0x148bf0['Descriptions'],_0x51a6ca,'\x0a'),'regardingobjectid_contact@odata.bind':_0xf556d7[_0x478c('0x36')]?_0x478c('0x49')+_0xf556d7['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0xf556d7['userId']+')','directioncode':_0xf556d7[_0x478c('0x4b')]==='queue'?![]:!![],'phonecall_activity_parties':_0x2b8888},getCustomFields(_0x148bf0[_0x478c('0x4a')],_0x51a6ca,_0x148bf0['ticketType'])),'headers':{'Authorization':_0x478c('0x1b')+_0x330c3e,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x36691c);})['then'](function(_0x5b8c6b){var _0x1a91b8=_0x5b8c6b[_0x478c('0x2d')][_0x478c('0x2e')];var _0x3330af=_0x1a91b8[_0x478c('0x2f')](_0x1a91b8[_0x478c('0x30')]('(')+0x1,_0x1a91b8[_0x478c('0x30')](')'));_0xf556d7[_0x478c('0x4f')]=_0x3330af;_0x22501f(_0xf556d7);})['catch'](function(_0x4e96c2){_0x205a7f(_0x4e96c2[_0x478c('0x27')]);});});}function emit(_0xb48a7,_0x4f43a4,_0x40bd8a,_0x40d85a){var _0x1ffdc4={'uri':util['format']('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0xb48a7,_0x40bd8a,_0x40d85a)};io['to'](util[_0x478c('0x50')](_0x478c('0x51'),_0x4f43a4))[_0x478c('0x52')](_0x478c('0x53'),_0x1ffdc4);}exports['cs']=function(_0x5e6f22,_0x31e710,_0x39538d,_0x606ecd,_0x1f09f8,_0x1dc485,_0x2e6ca8,_0xb034c5){var _0x243375={};_0x1dc485[_0x478c('0xd')]=_0x1dc485[_0x478c('0xc')]?intUtil['stripTrailingSlash'](_0x1dc485[_0x478c('0xe')][_0x478c('0xf')]):intUtil[_0x478c('0x54')](_0x1dc485['remoteUri']);_0x1dc485['serverUrl']=intUtil[_0x478c('0x54')](_0x1dc485['serverUrl']);_0x243375[_0x478c('0x4b')]=_0xb034c5===_0x478c('0x4c')||_0xb034c5===_0x478c('0x55')?'queue':_0x478c('0x31');var _0x28eb4f=_0x1dc485[_0x478c('0xc')]?util[_0x478c('0x50')](_0x478c('0x56'),_0x1dc485[_0x478c('0xe')][_0x478c('0xf')]):util[_0x478c('0x50')](_0x478c('0x56'),_0x1dc485['remoteUri']);var _0x300d05=util[_0x478c('0x50')](_0x478c('0x57'),_0x1dc485[_0x478c('0x58')]);var _0x391261=util[_0x478c('0x50')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1dc485[_0x478c('0x59')],_0x31e710[_0x478c('0x5a')],md5(_0x31e710[_0x478c('0x5a')]));if(_0x1f09f8&&_0x1f09f8[_0x478c('0x5b')]){logger['info'](_0x478c('0x5c'),_0x478c('0x5d'));_0x31e710[_0x478c('0x5e')]=_0x391261;}else if(_0x2e6ca8&&_0x2e6ca8['recordingFormat']&&_0x2e6ca8['recordingFormat']!==_0x478c('0x5f')){logger['info'](_0x478c('0x60'),'Recording\x20is\x20enabled!');_0x31e710[_0x478c('0x5e')]=_0x391261;}else{_0x31e710[_0x478c('0x5e')]='';}return getUser(_0x243375,_0x1dc485,_0x606ecd,_0x300d05,_0x28eb4f,_0xb034c5)[_0x478c('0x1d')](function(_0x386e0b){logger[_0x478c('0x22')]('['+_0xb034c5['toUpperCase']()+_0x478c('0x61'),_0x386e0b[_0x478c('0x25')]);logger[_0x478c('0x22')]('['+_0xb034c5[_0x478c('0x17')]()+_0x478c('0x62'),_0x386e0b[_0x478c('0x63')]);return getEndUser(_0x386e0b,_0x1dc485,_0x300d05,_0x28eb4f,_0x31e710,_0xb034c5,_0x39538d['moduleCreate'],_0x39538d[_0x478c('0x64')]);})['then'](function(_0x2a12c8){logger[_0x478c('0x22')]('['+_0xb034c5[_0x478c('0x17')]()+_0x478c('0x65'),_0x2a12c8[_0x478c('0x36')]);logger[_0x478c('0x22')]('['+_0xb034c5['toUpperCase']()+_0x478c('0x66'),_0x31e710['calleridnum']);return getTicket(_0x2a12c8,_0x1dc485,_0x300d05,_0x28eb4f,_0x31e710,_0x39538d,_0xb034c5);})['then'](function(_0x14f45e){logger[_0x478c('0x22')](util['format']('['+_0xb034c5[_0x478c('0x17')]()+_0x478c('0x67'),_0x39538d[_0x478c('0x43')],_0x14f45e[_0x478c('0x4f')]));logger[_0x478c('0x22')](util[_0x478c('0x50')]('['+_0xb034c5[_0x478c('0x17')]()+']\x20Call\x20direction:\x20%s',_0xb034c5));if(_0xb034c5!==_0x478c('0x55')&&_0x39538d['openNewTab']){logger[_0x478c('0x22')]('['+_0xb034c5[_0x478c('0x17')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x1dc485[_0x478c('0xd')],_0x606ecd['name'],_0x39538d[_0x478c('0x43')],_0x14f45e['ticketId']);}})[_0x478c('0x15')](function(_0x5c24e5){logger['error']('['+_0xb034c5[_0x478c('0x17')]()+_0x478c('0x68'),_0x5c24e5[_0x478c('0x27')]);console['error'](_0x478c('0x69'),_0x5c24e5);});};
\ No newline at end of file
index 2f4df8d..f3d2b8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd001=['%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','apiKey','toString','base64','debug','[HTTP]','defaults','map','forEach','picklist','type','nameField','customField','toLowerCase','content','string','idField','push','variable','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','stringify','unmanaged','lastevent','toUpperCase','calleridname','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','localhost','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridnum','getString','Subjects','<br>','Tags','name','Fields','mapValues','keyBy','custom_fields','value','%s/api/v2/tickets','remoteUri','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!'];(function(_0x5bba5c,_0xcb8e5c){var _0x42bad9=function(_0x2044ad){while(--_0x2044ad){_0x5bba5c['push'](_0x5bba5c['shift']());}};_0x42bad9(++_0xcb8e5c);}(_0xd001,0x159));var _0x1d00=function(_0x223dc7,_0xdbb4b7){_0x223dc7=_0x223dc7-0x0;var _0x596b60=_0xd001[_0x223dc7];return _0x596b60;};'use strict';var _=require(_0x1d00('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x1d00('0x1'));var Redis=require(_0x1d00('0x2'));var intUtil=require(_0x1d00('0x3'));var config=require(_0x1d00('0x4'));var logger=require(_0x1d00('0x5'))(_0x1d00('0x6'));config[_0x1d00('0x7')]=_['defaults'](config[_0x1d00('0x7')],{'host':_0x1d00('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0x1d00('0x9'),'Accept':_0x1d00('0x9')};function emit(_0x11118a,_0x37abec,_0x6e822d){io['to'](_0x11118a)[_0x1d00('0xa')](_0x37abec,_0x6e822d);}function getTicket(_0xd11f2b,_0x518112,_0xe5e519,_0x5eac48,_0x560cc3){logger[_0x1d00('0xb')](_0x1d00('0xc'));var _0x5111f8=_[_0x1d00('0xd')]({'responder_id':_0x518112['id'],'requester_id':_0xe5e519['id'],'name':util[_0x1d00('0xe')](_0x1d00('0xf'),_0x560cc3['calleridname']),'phone':_0x560cc3[_0x1d00('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x1d00('0x11')](_0x5eac48[_0x1d00('0x12')],_0x560cc3,'\x20'),'description':intUtil[_0x1d00('0x11')](_0x5eac48['Descriptions'],_0x560cc3,_0x1d00('0x13')),'tags':getTags(_0x5eac48[_0x1d00('0x14')],_0x1d00('0x15'))},getCustomFields(_0x5eac48[_0x1d00('0x16')],_0x560cc3));_0x5111f8['custom_fields']=_[_0x1d00('0x17')](_[_0x1d00('0x18')](_0x5111f8[_0x1d00('0x19')],'id'),_0x1d00('0x1a'));return request({'uri':util[_0x1d00('0xe')](_0x1d00('0x1b'),_0xd11f2b[_0x1d00('0x1c')]),'method':'POST','body':_0x5111f8})[_0x1d00('0x1d')](function(_0x3164e3){logger[_0x1d00('0xb')](_0x1d00('0x1e'));return _0x3164e3;});}function getUser(_0x2fa62e,_0xed7c25){if(intUtil[_0x1d00('0x1f')](_0xed7c25)){return request({'uri':util['format'](_0x1d00('0x20'),_0x2fa62e['remoteUri']),'qs':{'email':_0xed7c25}})[_0x1d00('0x1d')](function(_0x1267b9){if(_0x1267b9[_0x1d00('0x21')]){logger[_0x1d00('0xb')](_0x1d00('0x22'));return _[_0x1d00('0x23')](_0x1267b9,function(_0x310bba){return _0x310bba[_0x1d00('0x24')][_0x1d00('0x25')]===_0xed7c25;});}else{logger['info'](_0x1d00('0x26'));return request({'uri':util[_0x1d00('0xe')](_0x1d00('0x27'),_0x2fa62e[_0x1d00('0x1c')])})[_0x1d00('0x1d')](function(_0x448a9b){logger['info'](_0x1d00('0x28'));return _0x448a9b;});}});}else{logger[_0x1d00('0xb')](_0x1d00('0x29'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x2fa62e[_0x1d00('0x1c')])})['then'](function(_0x179716){logger[_0x1d00('0xb')]('Admin\x20account\x20selected.');return _0x179716;});}}function getEndUser(_0x1a0e64,_0x21ad0e,_0x451426){logger['info'](_0x1d00('0x2a'),_0x451426);return request({'uri':util[_0x1d00('0xe')](_0x1d00('0x2b'),_0x1a0e64[_0x1d00('0x1c')]),'qs':{'phone':_0x451426}})[_0x1d00('0x1d')](function(_0x3c2feb){if(_0x3c2feb[_0x1d00('0x21')]){logger['info'](_0x1d00('0x2c'));return _['find'](_0x3c2feb,{'phone':_0x451426});}else{logger[_0x1d00('0xb')](_0x1d00('0x2d'));return request({'uri':util[_0x1d00('0xe')]('%s/api/v2/contacts',_0x1a0e64['remoteUri']),'method':_0x1d00('0x2e'),'body':{'name':_0x21ad0e,'phone':_0x451426}})[_0x1d00('0x1d')](function(_0xcc5ffd){logger[_0x1d00('0xb')](_0x1d00('0x2f'));return _0xcc5ffd;});}});}function getAuth(_0x29ed7d){return util[_0x1d00('0xe')]('Basic\x20%s',new Buffer(_0x29ed7d[_0x1d00('0x30')]+':X')[_0x1d00('0x31')](_0x1d00('0x32')));}function request(_0x126962){logger[_0x1d00('0x33')](_0x1d00('0x34'),JSON['stringify'](_0x126962));return rp(_[_0x1d00('0x35')](_0x126962,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x5dfa78,_0x1170ef){var _0x8967e2=[];if(_0x5dfa78&&_0x5dfa78[_0x1d00('0x21')]>0x0){_0x8967e2=_[_0x1d00('0x36')](_0x5dfa78,_0x1170ef);}return _0x8967e2;}function getCustomFields(_0x5a05cc,_0x56ad70){var _0x2883fa=[];var _0x98a940={'custom_fields':[]};if(_0x5a05cc[_0x1d00('0x21')]>0x0){_[_0x1d00('0x37')](_0x5a05cc,function(_0x262b06){if(_['includes'](['string',_0x1d00('0x38')],_0x262b06[_0x1d00('0x39')])&&_0x262b06[_0x1d00('0x3a')]&&!_0x262b06[_0x1d00('0x3b')]){_0x98a940[_0x262b06[_0x1d00('0x3a')][_0x1d00('0x3c')]()]=_0x262b06[_0x1d00('0x3d')][_0x1d00('0x31')]();}else if(_['includes']([_0x1d00('0x3e'),_0x1d00('0x38')],_0x262b06['type'])&&_0x262b06[_0x1d00('0x3f')]&&_0x262b06[_0x1d00('0x3b')]){_0x98a940['custom_fields'][_0x1d00('0x40')]({'id':_0x262b06[_0x1d00('0x3f')],'value':_0x262b06[_0x1d00('0x3d')][_0x1d00('0x31')]()});}else if(_0x262b06['type']===_0x1d00('0x41')&&_0x262b06[_0x1d00('0x42')]&&_0x262b06[_0x1d00('0x3f')]&&_0x262b06[_0x1d00('0x3b')]){_0x56ad70[_0x262b06['variableName']]&&_0x98a940[_0x1d00('0x19')][_0x1d00('0x40')]({'id':_0x262b06['idField'],'value':_0x56ad70[_0x262b06[_0x1d00('0x42')]]['toString']()});}else if(_0x262b06['type']===_0x1d00('0x43')&&_0x262b06[_0x1d00('0x44')]&&_0x262b06[_0x1d00('0x44')]['name']&&_0x262b06[_0x1d00('0x3f')]&&_0x262b06['customField']){_0x56ad70[_0x262b06[_0x1d00('0x44')][_0x1d00('0x15')][_0x1d00('0x3c')]()]&&_0x98a940['custom_fields'][_0x1d00('0x40')]({'id':_0x262b06[_0x1d00('0x3f')],'value':_0x56ad70[_0x262b06['Variable'][_0x1d00('0x15')][_0x1d00('0x3c')]()][_0x1d00('0x31')]()});}});}return _0x98a940;}exports['queue']=function(_0x1093db,_0x14c765,_0x22c21a,_0x2ebc71,_0x1d3eec,_0x39b3a7){var _0x5926d7,_0x20507a;_0x39b3a7['remoteUri']=intUtil[_0x1d00('0x45')](_0x39b3a7[_0x1d00('0x1c')]);_0x39b3a7[_0x1d00('0x46')]=intUtil['stripTrailingSlash'](_0x39b3a7[_0x1d00('0x46')]);if(_0x1d3eec&&_0x1d3eec[_0x1d00('0x47')]){logger[_0x1d00('0xb')](_0x1d00('0x48'),_0x1d00('0x49'));_0x14c765[_0x1d00('0x4a')]=util[_0x1d00('0xe')](_0x1d00('0x4b'),_0x39b3a7[_0x1d00('0x46')],_0x14c765[_0x1d00('0x4c')],md5(_0x14c765[_0x1d00('0x4c')]));}else{_0x14c765[_0x1d00('0x4a')]='';}headers[_0x1d00('0x4d')]=getAuth(_0x39b3a7);return getUser(_0x39b3a7,_0x2ebc71[_0x1d00('0x25')])['then'](function(_0x32ca1b){_0x5926d7=_0x32ca1b;logger['info']('The\x20User\x20ID\x20is:',_0x5926d7['id']);return getEndUser(_0x39b3a7,_0x14c765['calleridname'],_0x14c765[_0x1d00('0x10')]);})[_0x1d00('0x1d')](function(_0x3d6118){_0x20507a=_0x3d6118;logger[_0x1d00('0xb')]('The\x20Enduser\x20ID\x20is:',_0x20507a['id']);return getTicket(_0x39b3a7,_0x5926d7,_0x20507a,_0x22c21a,_0x14c765);})['then'](function(_0x28991c){if(_0x28991c&&_0x28991c['id']){logger['info']('Ticket\x20created!');logger[_0x1d00('0xb')](_0x1d00('0x4e'),_0x28991c['id']);logger[_0x1d00('0xb')](_0x1d00('0x48'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x1d00('0xe')](_0x1d00('0x4f'),_0x2ebc71[_0x1d00('0x15')]),_0x1d00('0x50'),{'uri':util[_0x1d00('0xe')]('%s/helpdesk/tickets/%d',_0x39b3a7['remoteUri'],_0x28991c['id'])});}})[_0x1d00('0x51')](function(_0x398bdd){logger[_0x1d00('0x52')]('[QUEUE]',JSON['stringify'](_0x398bdd));});};exports[_0x1d00('0x53')]=function(_0x1ddb08,_0x53ef88,_0x385487,_0x5799f9,_0x5d76c6,_0x23af92,_0x28ae30){var _0x2be33c,_0x439597;_0x23af92[_0x1d00('0x1c')]=intUtil[_0x1d00('0x45')](_0x23af92[_0x1d00('0x1c')]);_0x23af92[_0x1d00('0x46')]=intUtil[_0x1d00('0x45')](_0x23af92['serverUrl']);if(_0x28ae30&&_0x28ae30[_0x1d00('0x54')]&&_0x28ae30[_0x1d00('0x54')]!==_0x1d00('0x55')){logger['info'](_0x1d00('0x56'),_0x1d00('0x49'));_0x53ef88['recordingURL']=util[_0x1d00('0xe')](_0x1d00('0x4b'),_0x23af92['serverUrl'],_0x53ef88[_0x1d00('0x4c')],md5(_0x53ef88[_0x1d00('0x4c')]));}headers[_0x1d00('0x4d')]=getAuth(_0x23af92);return getUser(_0x23af92,_0x5799f9[_0x1d00('0x25')])[_0x1d00('0x1d')](function(_0x4fefd4){_0x2be33c=_0x4fefd4;logger[_0x1d00('0xb')]('The\x20User\x20ID\x20is:',_0x2be33c['id']);return getEndUser(_0x23af92,_0x53ef88[_0x1d00('0x57')],_0x53ef88['destcalleridnum']);})[_0x1d00('0x1d')](function(_0x57006c){_0x439597=_0x57006c;logger[_0x1d00('0xb')](_0x1d00('0x58'),_0x439597['id']);return getTicket(_0x23af92,_0x2be33c,_0x439597,_0x385487,_0x53ef88);})[_0x1d00('0x1d')](function(_0x339eeb){if(_0x339eeb&&_0x339eeb['id']){logger[_0x1d00('0xb')](_0x1d00('0x1e'));logger[_0x1d00('0xb')](_0x1d00('0x4e'),_0x339eeb['id']);logger[_0x1d00('0xb')](_0x1d00('0x56'),_0x1d00('0x59'));emit(util['format']('user:%s',_0x5799f9[_0x1d00('0x15')]),_0x1d00('0x50'),{'uri':util[_0x1d00('0xe')](_0x1d00('0x5a'),_0x23af92['remoteUri'],_0x339eeb['id'])});}})['catch'](function(_0x4c5b02){logger[_0x1d00('0x52')]('[OUTBOUND]',JSON[_0x1d00('0x5b')](_0x4c5b02));});};exports[_0x1d00('0x5c')]=function(_0x3f03d8,_0xb76997,_0x431ad7,_0x458bb3,_0x5c0f9b,_0x192865){var _0x151cfc,_0x2c89a6;_0x192865[_0x1d00('0x1c')]=intUtil[_0x1d00('0x45')](_0x192865[_0x1d00('0x1c')]);_0x192865[_0x1d00('0x46')]=intUtil[_0x1d00('0x45')](_0x192865[_0x1d00('0x46')]);if(_0x5c0f9b&&_0x5c0f9b[_0x1d00('0x47')]){logger[_0x1d00('0xb')]('['+_0xb76997[_0x1d00('0x5d')][_0x1d00('0x5e')]()+']',_0x1d00('0x49'));_0xb76997[_0x1d00('0x4a')]=util[_0x1d00('0xe')](_0x1d00('0x4b'),_0x192865[_0x1d00('0x46')],_0xb76997[_0x1d00('0x4c')],md5(_0xb76997['uniqueid']));}else{_0xb76997[_0x1d00('0x4a')]='';}headers[_0x1d00('0x4d')]=getAuth(_0x192865);return getUser(_0x192865,'')[_0x1d00('0x1d')](function(_0x4a29ec){_0x151cfc=_0x4a29ec;logger[_0x1d00('0xb')]('The\x20User\x20ID\x20is:',_0x151cfc['id']);return getEndUser(_0x192865,_0xb76997[_0x1d00('0x5f')],_0xb76997[_0x1d00('0x10')]);})[_0x1d00('0x1d')](function(_0x29c96f){_0x2c89a6=_0x29c96f;logger[_0x1d00('0xb')]('The\x20Enduser\x20ID\x20is:',_0x2c89a6['id']);return getTicket(_0x192865,_0x151cfc,_0x2c89a6,_0x431ad7,_0xb76997);})[_0x1d00('0x1d')](function(_0x591b78){if(_0x591b78){logger[_0x1d00('0xb')](_0x1d00('0x1e'));logger[_0x1d00('0xb')](_0x1d00('0x4e'),_0x591b78['id']);}})[_0x1d00('0x51')](function(_0x1e1ba2){logger[_0x1d00('0x52')]('['+_0xb76997['lastevent'][_0x1d00('0x5e')]()+']',JSON[_0x1d00('0x5b')](_0x1e1ba2));});};
\ No newline at end of file
+var _0x5692=['stringify','unmanaged','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','catch','request-promise','md5','util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','application/json','Caller\x20-\x20%s','calleridname','calleridnum','getString','<br>','Tags','custom_fields','mapValues','keyBy','value','format','%s/api/v2/tickets','remoteUri','POST','then','info','validateEmail','%s/api/v2/agents','Agent\x20found!','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','length','Enduser\x20found!','find','%s/api/v2/contacts','Enduser\x20created.','apiKey','toString','[HTTP]','GET','map','forEach','includes','string','picklist','nameField','toLowerCase','content','push','variableName','idField','customField','type','customVariable','Variable','name','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','%s/helpdesk/tickets/%d','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url'];(function(_0x3cb530,_0x170e8c){var _0x4168ea=function(_0x83990a){while(--_0x83990a){_0x3cb530['push'](_0x3cb530['shift']());}};_0x4168ea(++_0x170e8c);}(_0x5692,0x1c3));var _0x2569=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x5692[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var rp=require(_0x2569('0x0'));var md5=require(_0x2569('0x1'));var util=require(_0x2569('0x2'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x2569('0x3'));var logger=require(_0x2569('0x4'))(_0x2569('0x5'));config[_0x2569('0x6')]=_[_0x2569('0x7')](config[_0x2569('0x6')],{'host':_0x2569('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2569('0x6')]));var headers={'Content-Type':_0x2569('0x9'),'Accept':_0x2569('0x9')};function emit(_0x2c80d7,_0x119fbe,_0x28c86c){io['to'](_0x2c80d7)['emit'](_0x119fbe,_0x28c86c);}function getTicket(_0x2b263b,_0x4b1791,_0x14fa99,_0x3c4330,_0x567f6f){logger['info']('Creating\x20new\x20ticket...');var _0x454df5=_['merge']({'responder_id':_0x4b1791['id'],'requester_id':_0x14fa99['id'],'name':util['format'](_0x2569('0xa'),_0x567f6f[_0x2569('0xb')]),'phone':_0x567f6f[_0x2569('0xc')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x2569('0xd')](_0x3c4330['Subjects'],_0x567f6f,'\x20'),'description':intUtil[_0x2569('0xd')](_0x3c4330['Descriptions'],_0x567f6f,_0x2569('0xe')),'tags':getTags(_0x3c4330[_0x2569('0xf')],'name')},getCustomFields(_0x3c4330['Fields'],_0x567f6f));_0x454df5[_0x2569('0x10')]=_[_0x2569('0x11')](_[_0x2569('0x12')](_0x454df5[_0x2569('0x10')],'id'),_0x2569('0x13'));return request({'uri':util[_0x2569('0x14')](_0x2569('0x15'),_0x2b263b[_0x2569('0x16')]),'method':_0x2569('0x17'),'body':_0x454df5})[_0x2569('0x18')](function(_0x364fad){logger[_0x2569('0x19')]('Ticket\x20created!');return _0x364fad;});}function getUser(_0x2d1f6b,_0x28235f){if(intUtil[_0x2569('0x1a')](_0x28235f)){return request({'uri':util['format'](_0x2569('0x1b'),_0x2d1f6b[_0x2569('0x16')]),'qs':{'email':_0x28235f}})[_0x2569('0x18')](function(_0x381b20){if(_0x381b20['length']){logger['info'](_0x2569('0x1c'));return _['find'](_0x381b20,function(_0x5fae5c){return _0x5fae5c[_0x2569('0x1d')][_0x2569('0x1e')]===_0x28235f;});}else{logger[_0x2569('0x19')](_0x2569('0x1f'));return request({'uri':util[_0x2569('0x14')](_0x2569('0x20'),_0x2d1f6b[_0x2569('0x16')])})['then'](function(_0x3a551d){logger[_0x2569('0x19')](_0x2569('0x21'));return _0x3a551d;});}});}else{logger[_0x2569('0x19')](_0x2569('0x22'));return request({'uri':util[_0x2569('0x14')](_0x2569('0x20'),_0x2d1f6b['remoteUri'])})[_0x2569('0x18')](function(_0x5c4367){logger[_0x2569('0x19')](_0x2569('0x21'));return _0x5c4367;});}}function getEndUser(_0x435bd9,_0x4133e3,_0x12b8b3){logger[_0x2569('0x19')](_0x2569('0x23'),_0x12b8b3);return request({'uri':util[_0x2569('0x14')]('%s/api/v2/contacts',_0x435bd9['remoteUri']),'qs':{'phone':_0x12b8b3}})[_0x2569('0x18')](function(_0x10d01d){if(_0x10d01d[_0x2569('0x24')]){logger['info'](_0x2569('0x25'));return _[_0x2569('0x26')](_0x10d01d,{'phone':_0x12b8b3});}else{logger[_0x2569('0x19')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x2569('0x14')](_0x2569('0x27'),_0x435bd9[_0x2569('0x16')]),'method':_0x2569('0x17'),'body':{'name':_0x4133e3,'phone':_0x12b8b3}})[_0x2569('0x18')](function(_0x233ec8){logger['info'](_0x2569('0x28'));return _0x233ec8;});}});}function getAuth(_0x49dfa7){return util[_0x2569('0x14')]('Basic\x20%s',new Buffer(_0x49dfa7[_0x2569('0x29')]+':X')[_0x2569('0x2a')]('base64'));}function request(_0x49f1ab){logger['debug'](_0x2569('0x2b'),JSON['stringify'](_0x49f1ab));return rp(_[_0x2569('0x7')](_0x49f1ab,{'method':_0x2569('0x2c'),'headers':headers,'json':!![]}));}function getTags(_0x585bda,_0x351d6e){var _0x45cb04=[];if(_0x585bda&&_0x585bda[_0x2569('0x24')]>0x0){_0x45cb04=_[_0x2569('0x2d')](_0x585bda,_0x351d6e);}return _0x45cb04;}function getCustomFields(_0x33952a,_0x33fb76){var _0x2393b2=[];var _0x32e3bc={'custom_fields':[]};if(_0x33952a[_0x2569('0x24')]>0x0){_[_0x2569('0x2e')](_0x33952a,function(_0x9a9925){if(_[_0x2569('0x2f')]([_0x2569('0x30'),_0x2569('0x31')],_0x9a9925['type'])&&_0x9a9925[_0x2569('0x32')]&&!_0x9a9925['customField']){_0x32e3bc[_0x9a9925[_0x2569('0x32')][_0x2569('0x33')]()]=_0x9a9925[_0x2569('0x34')]['toString']();}else if(_[_0x2569('0x2f')]([_0x2569('0x30'),'picklist'],_0x9a9925['type'])&&_0x9a9925['idField']&&_0x9a9925['customField']){_0x32e3bc['custom_fields'][_0x2569('0x35')]({'id':_0x9a9925['idField'],'value':_0x9a9925[_0x2569('0x34')][_0x2569('0x2a')]()});}else if(_0x9a9925['type']==='variable'&&_0x9a9925[_0x2569('0x36')]&&_0x9a9925[_0x2569('0x37')]&&_0x9a9925[_0x2569('0x38')]){_0x33fb76[_0x9a9925['variableName']]&&_0x32e3bc[_0x2569('0x10')][_0x2569('0x35')]({'id':_0x9a9925[_0x2569('0x37')],'value':_0x33fb76[_0x9a9925[_0x2569('0x36')]]['toString']()});}else if(_0x9a9925[_0x2569('0x39')]===_0x2569('0x3a')&&_0x9a9925[_0x2569('0x3b')]&&_0x9a9925[_0x2569('0x3b')][_0x2569('0x3c')]&&_0x9a9925[_0x2569('0x37')]&&_0x9a9925['customField']){_0x33fb76[_0x9a9925[_0x2569('0x3b')][_0x2569('0x3c')][_0x2569('0x33')]()]&&_0x32e3bc[_0x2569('0x10')][_0x2569('0x35')]({'id':_0x9a9925[_0x2569('0x37')],'value':_0x33fb76[_0x9a9925['Variable'][_0x2569('0x3c')][_0x2569('0x33')]()][_0x2569('0x2a')]()});}});}return _0x32e3bc;}exports['queue']=function(_0x724872,_0x1f26bf,_0x151089,_0x3cc2ef,_0x340193,_0x592967){var _0x5c1bd1,_0x49af6c;_0x592967[_0x2569('0x16')]=intUtil[_0x2569('0x3d')](_0x592967['remoteUri']);_0x592967[_0x2569('0x3e')]=intUtil[_0x2569('0x3d')](_0x592967[_0x2569('0x3e')]);if(_0x340193&&_0x340193[_0x2569('0x3f')]){logger[_0x2569('0x19')](_0x2569('0x40'),_0x2569('0x41'));_0x1f26bf['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x592967['serverUrl'],_0x1f26bf[_0x2569('0x42')],md5(_0x1f26bf[_0x2569('0x42')]));}else{_0x1f26bf[_0x2569('0x43')]='';}headers[_0x2569('0x44')]=getAuth(_0x592967);return getUser(_0x592967,_0x3cc2ef[_0x2569('0x1e')])[_0x2569('0x18')](function(_0x1caf10){_0x5c1bd1=_0x1caf10;logger[_0x2569('0x19')](_0x2569('0x45'),_0x5c1bd1['id']);return getEndUser(_0x592967,_0x1f26bf['calleridname'],_0x1f26bf['calleridnum']);})[_0x2569('0x18')](function(_0x253b69){_0x49af6c=_0x253b69;logger[_0x2569('0x19')](_0x2569('0x46'),_0x49af6c['id']);return getTicket(_0x592967,_0x5c1bd1,_0x49af6c,_0x151089,_0x1f26bf);})[_0x2569('0x18')](function(_0x77393d){if(_0x77393d&&_0x77393d['id']){logger[_0x2569('0x19')]('Ticket\x20created!');logger[_0x2569('0x19')](_0x2569('0x47'),_0x77393d['id']);logger['info'](_0x2569('0x40'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2569('0x14')](_0x2569('0x48'),_0x3cc2ef['name']),'trigger:browser:url',{'uri':util[_0x2569('0x14')](_0x2569('0x49'),_0x592967[_0x2569('0x16')],_0x77393d['id'])});}})['catch'](function(_0x5319ce){logger['error']('[QUEUE]',JSON['stringify'](_0x5319ce));});};exports[_0x2569('0x4a')]=function(_0x1b197d,_0x2ef667,_0x2064f4,_0x2c1e63,_0x66399e,_0x34ac32,_0x52d040){var _0xf6fef4,_0x446f45;_0x34ac32['remoteUri']=intUtil[_0x2569('0x3d')](_0x34ac32[_0x2569('0x16')]);_0x34ac32[_0x2569('0x3e')]=intUtil[_0x2569('0x3d')](_0x34ac32['serverUrl']);if(_0x52d040&&_0x52d040[_0x2569('0x4b')]&&_0x52d040[_0x2569('0x4b')]!==_0x2569('0x4c')){logger[_0x2569('0x19')](_0x2569('0x4d'),_0x2569('0x41'));_0x2ef667[_0x2569('0x43')]=util[_0x2569('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x34ac32[_0x2569('0x3e')],_0x2ef667[_0x2569('0x42')],md5(_0x2ef667[_0x2569('0x42')]));}headers[_0x2569('0x44')]=getAuth(_0x34ac32);return getUser(_0x34ac32,_0x2c1e63['email'])[_0x2569('0x18')](function(_0x1ffdf7){_0xf6fef4=_0x1ffdf7;logger['info'](_0x2569('0x45'),_0xf6fef4['id']);return getEndUser(_0x34ac32,_0x2ef667[_0x2569('0x4e')],_0x2ef667[_0x2569('0x4f')]);})[_0x2569('0x18')](function(_0x55f4d8){_0x446f45=_0x55f4d8;logger[_0x2569('0x19')](_0x2569('0x46'),_0x446f45['id']);return getTicket(_0x34ac32,_0xf6fef4,_0x446f45,_0x2064f4,_0x2ef667);})[_0x2569('0x18')](function(_0x5a0864){if(_0x5a0864&&_0x5a0864['id']){logger['info'](_0x2569('0x50'));logger[_0x2569('0x19')](_0x2569('0x47'),_0x5a0864['id']);logger['info']('[OUTBOUND]',_0x2569('0x51'));emit(util[_0x2569('0x14')](_0x2569('0x48'),_0x2c1e63['name']),_0x2569('0x52'),{'uri':util['format'](_0x2569('0x49'),_0x34ac32[_0x2569('0x16')],_0x5a0864['id'])});}})['catch'](function(_0x54d8d6){logger['error'](_0x2569('0x4d'),JSON[_0x2569('0x53')](_0x54d8d6));});};exports[_0x2569('0x54')]=function(_0x24db61,_0x515d41,_0x12dc40,_0x2f0be1,_0x53f744,_0x30fa49){var _0x57eb3a,_0xae28a4;_0x30fa49['remoteUri']=intUtil[_0x2569('0x3d')](_0x30fa49[_0x2569('0x16')]);_0x30fa49['serverUrl']=intUtil['stripTrailingSlash'](_0x30fa49[_0x2569('0x3e')]);if(_0x53f744&&_0x53f744[_0x2569('0x3f')]){logger[_0x2569('0x19')]('['+_0x515d41[_0x2569('0x55')][_0x2569('0x56')]()+']',_0x2569('0x41'));_0x515d41[_0x2569('0x43')]=util[_0x2569('0x14')](_0x2569('0x57'),_0x30fa49[_0x2569('0x3e')],_0x515d41['uniqueid'],md5(_0x515d41[_0x2569('0x42')]));}else{_0x515d41[_0x2569('0x43')]='';}headers[_0x2569('0x44')]=getAuth(_0x30fa49);return getUser(_0x30fa49,'')[_0x2569('0x18')](function(_0x57d5dc){_0x57eb3a=_0x57d5dc;logger[_0x2569('0x19')](_0x2569('0x45'),_0x57eb3a['id']);return getEndUser(_0x30fa49,_0x515d41[_0x2569('0xb')],_0x515d41[_0x2569('0xc')]);})[_0x2569('0x18')](function(_0x3e0f12){_0xae28a4=_0x3e0f12;logger[_0x2569('0x19')](_0x2569('0x46'),_0xae28a4['id']);return getTicket(_0x30fa49,_0x57eb3a,_0xae28a4,_0x12dc40,_0x515d41);})[_0x2569('0x18')](function(_0x20499e){if(_0x20499e){logger[_0x2569('0x19')](_0x2569('0x50'));logger[_0x2569('0x19')]('The\x20Ticket\x20ID\x20is:',_0x20499e['id']);}})[_0x2569('0x58')](function(_0x5c4fed){logger['error']('['+_0x515d41[_0x2569('0x55')][_0x2569('0x56')]()+']',JSON[_0x2569('0x53')](_0x5c4fed));});};
\ No newline at end of file
index 12d4974..7a1bc4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf55f=['info','Getting\x20admin\x20information','users','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','GET','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','email','userId','Admin\x20selected','/api/lookup?q=','&f=','&entities=contact','then','find','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','Contact\x20found\x20mobile_number:','work_number','contactNumber','endUserId','Contact\x20created:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','/api/tasks','getString','Subjects','YYYY-MM-DDTHH:mm:ss','add','task','Task\x20created:','/contacts/','user:%s','emit','Token\x20token=','apiKey','stripTrailingSlash','remoteUri','serverUrl','adminEmail','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','ticketId','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','../../../../config/environment','freshsales','redis','defaults','socket.io-emitter','/api/selector/owners','headers'];(function(_0xacd1fd,_0x24f8ea){var _0x3d370b=function(_0x2f8eb4){while(--_0x2f8eb4){_0xacd1fd['push'](_0xacd1fd['shift']());}};_0x3d370b(++_0x24f8ea);}(_0xf55f,0xfd));var _0xff55=function(_0x162f4b,_0x31b569){_0x162f4b=_0x162f4b-0x0;var _0x57b00b=_0xf55f[_0x162f4b];return _0x57b00b;};'use strict';var _=require(_0xff55('0x0'));var rp=require(_0xff55('0x1'));var md5=require(_0xff55('0x2'));var util=require(_0xff55('0x3'));var moment=require(_0xff55('0x4'));var Promise=require(_0xff55('0x5'));var Redis=require(_0xff55('0x6'));var intUtil=require('./util');var config=require(_0xff55('0x7'));var logger=require('../../../../config/logger')(_0xff55('0x8'));config[_0xff55('0x9')]=_[_0xff55('0xa')](config[_0xff55('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xff55('0xb'))(new Redis(config[_0xff55('0x9')]));function getAdminId(_0x50a2e0,_0x16ff76,_0x503a35,_0x9b5b8c){return new Promise(function(_0x3e2c58,_0x325983){var _0x3bf75c=![];var _0x8b8ffb={'method':'GET','uri':_0x9b5b8c+_0xff55('0xc'),'json':!![]};_0x8b8ffb[_0xff55('0xd')]=_0x503a35;logger[_0xff55('0xe')](_0xff55('0xf'));return rp(_0x8b8ffb)['then'](function(_0x56739e){if(_0x56739e){var _0x1766d6=_0x56739e[_0xff55('0x10')];var _0x320107=null;for(_0x320107=0x0;_0x320107<_0x1766d6['length'];_0x320107++){if(_0x1766d6[_0x320107]['email']===_0x50a2e0['adminEmail']){_0x50a2e0[_0xff55('0x11')]=_0x1766d6[_0x320107]['id'];_0x3bf75c=!![];}}if(_0x3bf75c){logger[_0xff55('0xe')](_0xff55('0x12'),_0x50a2e0['adminId']);_0x3e2c58(_0x50a2e0);}else{_0x325983({'statusCode':0x194,'message':_0xff55('0x13')});}}else{_0x325983({'statusCode':0x194,'message':_0xff55('0x13')});}})[_0xff55('0x14')](function(_0x3c2755){logger[_0xff55('0x15')]('['+[_0x16ff76[_0xff55('0x16')]()]+']',_0x3c2755[_0xff55('0x17')]);_0x325983(_0x3c2755);});});}function getUser(_0x5850bb,_0x4020b1,_0x49d45d){return function(_0x1d91b6){return new Promise(function(_0x33db6c,_0x1ee157){var _0x1d8aee={'method':_0xff55('0x18'),'uri':_0x49d45d+_0xff55('0xc'),'json':!![]};_0x1d8aee[_0xff55('0xd')]=_0x4020b1;logger[_0xff55('0xe')](_0xff55('0x19'));return rp(_0x1d8aee)['then'](function(_0x28b877){if(_0x28b877){var _0x5a55a9=_0x28b877['users'];var _0x49576e=![];var _0x67bf13=null;if(_0x1d91b6[_0xff55('0x1a')]!==null){logger['info'](_0xff55('0x1b'),_0x1d91b6[_0xff55('0x1a')]);_0x1d91b6[_0xff55('0x1c')]=_0x1d91b6['agentEmail'];for(_0x67bf13=0x0;_0x67bf13<_0x5a55a9[_0xff55('0x1d')];_0x67bf13++){if(_0x5a55a9[_0x67bf13][_0xff55('0x1e')]===_0x1d91b6['agentEmail']){_0x49576e=!![];_0x1d91b6[_0xff55('0x1f')]=_0x5a55a9[_0x67bf13]['id'];logger[_0xff55('0xe')]('User\x20found:',_0x1d91b6[_0xff55('0x1f')]);}}}if(!_0x49576e){logger[_0xff55('0xe')](_0xff55('0x20'));_0x1d91b6['userEmail']=_0x1d91b6['adminEmail'];_0x1d91b6[_0xff55('0x1f')]=_0x1d91b6[_0xff55('0x11')];_0x49576e=!![];}if(_0x49576e){_0x33db6c(_0x1d91b6);}else{_0x1ee157({'statusCode':0x194,'message':_0xff55('0x13')});}}else{_0x1ee157({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xff55('0x14')](function(_0x24033f){logger['error']('['+[_0x5850bb[_0xff55('0x16')]()]+']',_0x24033f[_0xff55('0x17')]);_0x1ee157(_0x24033f);});});};}function searchContact(_0x2ef0c7,_0x51f3aa,_0x5a86c0,_0x39a877){return new Promise(function(_0xd48b54,_0x15c07d){var _0x5b61de={'method':_0xff55('0x18'),'headers':_0x51f3aa,'uri':_0x2ef0c7+_0xff55('0x21')+_0x39a877+_0xff55('0x22')+_0x5a86c0+_0xff55('0x23'),'json':!![]};rp(_0x5b61de)[_0xff55('0x24')](function(_0x1ece30){var _0x1c6ae3=_[_0xff55('0x25')](_0x1ece30['contacts']['contacts'],[_0x5a86c0,_0x39a877]);_0xd48b54(_0x1c6ae3);})[_0xff55('0x14')](function(_0x290b6a){_0x15c07d(_0x290b6a);});});}function getEndUser(_0x5c4a7f,_0x4c236d,_0x4a5ba4){return function(_0x49b905){return new Promise(function(_0x3378ee,_0x2778b3){logger[_0xff55('0xe')](util[_0xff55('0x26')](_0xff55('0x27'),_0x49b905['contactNumber']));searchContact(_0x4a5ba4,_0x4c236d,_0xff55('0x28'),_0x49b905['contactNumber'])['then'](function(_0x41225a){if(_0x41225a){_0x49b905['endUserId']=_0x41225a['id'];logger[_0xff55('0xe')](_0xff55('0x29'),_0x49b905['endUserId']);return _0x3378ee(_0x49b905);}searchContact(_0x4a5ba4,_0x4c236d,_0xff55('0x2a'),_0x49b905[_0xff55('0x2b')])[_0xff55('0x24')](function(_0x4c656e){if(_0x4c656e){_0x49b905[_0xff55('0x2c')]=_0x4c656e['id'];logger['info']('Contact\x20found\x20work_number:',_0x49b905[_0xff55('0x2c')]);return _0x3378ee(_0x49b905);}createEndUser(_0x49b905,_0x5c4a7f,_0x4c236d,_0x4a5ba4)[_0xff55('0x24')](function(_0x103402){logger['info'](_0xff55('0x2d'),_0x103402['endUserId']);return _0x3378ee(_0x103402);});});})[_0xff55('0x14')](function(_0x5c289d){_0x2778b3(_0x5c289d);});});};}function createEndUser(_0x8ebf80,_0x5008e7,_0x1de3b6,_0x4e8ce3){return new Promise(function(_0x206edb,_0x2dfa7b){var _0x21a4f4=moment();var _0x5afad1={'method':_0xff55('0x2e'),'uri':_0x4e8ce3+_0xff55('0x2f'),'body':{'contact':{'last_name':_0x8ebf80[_0xff55('0x2b')],'work_number':_0x8ebf80['contactNumber'],'mobile_number':_0x8ebf80['contactNumber'],'owner_id':_0x8ebf80[_0xff55('0x1f')],'created_at':_0x21a4f4['format']('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x5afad1[_0xff55('0xd')]=_0x1de3b6;logger[_0xff55('0xe')](_0xff55('0x30'));return rp(_0x5afad1)[_0xff55('0x24')](function(_0x13c1a9){_0x8ebf80[_0xff55('0x2c')]=_0x13c1a9[_0xff55('0x31')]['id'];_0x206edb(_0x8ebf80);})[_0xff55('0x14')](function(_0x1e6a35){logger[_0xff55('0x15')]('['+[_0x5008e7[_0xff55('0x16')]()]+']',_0x1e6a35[_0xff55('0x17')]);_0x2dfa7b(_0x1e6a35[_0xff55('0x17')]);});});}function getTicket(_0x44cc33,_0x8be98a,_0x49779f,_0x5526fe,_0x5425e6){return function(_0x2a2c11){logger[_0xff55('0xe')]('Creating\x20new\x20task');return new Promise(function(_0x17b204,_0x10ad30){var _0x5b7456=moment();var _0x428fcb={'method':_0xff55('0x2e'),'uri':_0x49779f+_0xff55('0x32'),'body':{'title':intUtil[_0xff55('0x33')](_0x5526fe[_0xff55('0x34')],_0x5425e6,'\x20'),'description':intUtil[_0xff55('0x33')](_0x5526fe['Descriptions'],_0x5425e6,'\x0a'),'owner_id':_0x2a2c11['userId'],'creater_id':_0x2a2c11[_0xff55('0x11')],'targetable_id':_0x2a2c11[_0xff55('0x2c')],'targetable_type':'Contact','created_at':_0x5b7456[_0xff55('0x26')](_0xff55('0x35')),'due_date':_0x5b7456[_0xff55('0x36')](0x1e,'m')[_0xff55('0x26')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x428fcb[_0xff55('0xd')]=_0x8be98a;return rp(_0x428fcb)[_0xff55('0x24')](function(_0x4c41a2){_0x2a2c11['ticketId']=_0x4c41a2[_0xff55('0x37')]['id'];logger[_0xff55('0xe')](_0xff55('0x38'),_0x2a2c11['ticketId']);_0x17b204(_0x2a2c11);})[_0xff55('0x14')](function(_0x549cc2){logger[_0xff55('0x15')]('['+[_0x44cc33[_0xff55('0x16')]()]+']',_0x549cc2[_0xff55('0x17')]);_0x10ad30(_0x549cc2[_0xff55('0x17')]);});});};}function emit(_0x45eb55,_0x5eadae,_0x4b0c2d){var _0x44a056={'uri':_0x45eb55+_0xff55('0x39')+_0x4b0c2d};io['to'](util['format'](_0xff55('0x3a'),_0x5eadae))[_0xff55('0x3b')]('trigger:browser:url',_0x44a056);}exports['cs']=function(_0x99c170,_0x573b53,_0x5da45f,_0x370303,_0x4accdd,_0x165bd0,_0x561d96,_0x508421){var _0x2e865e={};var _0x9c4373={'Authorization':_0xff55('0x3c')+_0x165bd0[_0xff55('0x3d')]};_0x165bd0['remoteUri']=intUtil[_0xff55('0x3e')](_0x165bd0[_0xff55('0x3f')]);_0x165bd0['serverUrl']=intUtil[_0xff55('0x3e')](_0x165bd0[_0xff55('0x40')]);var _0x2a0a4e=_0x165bd0[_0xff55('0x3f')];_0x2e865e[_0xff55('0x41')]=_0x165bd0[_0xff55('0x42')];_0x2e865e[_0xff55('0x2b')]=_0x508421[_0xff55('0x43')]()===_0xff55('0x44')?_0x573b53[_0xff55('0x45')]:_0x573b53[_0xff55('0x46')];_0x2e865e[_0xff55('0x47')]=_0x508421===_0xff55('0x48')||_0x508421==='unmanaged'?_0xff55('0x48'):_0xff55('0x44');if(_0x370303){_0x2e865e[_0xff55('0x1a')]=_0x370303['email'];}var _0x4b44dc=util[_0xff55('0x26')](_0xff55('0x49'),_0x165bd0[_0xff55('0x40')],_0x573b53[_0xff55('0x4a')],md5(_0x573b53[_0xff55('0x4a')]));if(_0x4accdd&&_0x4accdd[_0xff55('0x4b')]){logger['info'](_0xff55('0x4c'),_0xff55('0x4d'));_0x573b53[_0xff55('0x4e')]=_0x4b44dc;}else if(_0x561d96&&_0x561d96[_0xff55('0x4f')]&&_0x561d96['recordingFormat']!==_0xff55('0x50')){logger[_0xff55('0xe')](_0xff55('0x51'),_0xff55('0x4d'));_0x573b53['recordingURL']=_0x4b44dc;}else{_0x573b53[_0xff55('0x4e')]='';}return getAdminId(_0x2e865e,_0x508421,_0x9c4373,_0x2a0a4e)[_0xff55('0x24')](getUser(_0x508421,_0x9c4373,_0x2a0a4e))[_0xff55('0x24')](getEndUser(_0x508421,_0x9c4373,_0x2a0a4e))['then'](getTicket(_0x508421,_0x9c4373,_0x2a0a4e,_0x5da45f,_0x573b53))['then'](function(_0x64409b){logger[_0xff55('0xe')](util[_0xff55('0x26')](_0xff55('0x52'),_0x64409b[_0xff55('0x53')]));if(_0x508421!==_0xff55('0x54')){logger[_0xff55('0xe')]('['+[_0x508421['toUpperCase']()]+']',_0xff55('0x55'));emit(_0x2a0a4e,_0x370303[_0xff55('0x56')],_0x64409b[_0xff55('0x2c')]);}})['catch'](function(_0x188aee){logger[_0xff55('0x15')]('['+[_0x508421['toUpperCase']()]+_0xff55('0x57'),util[_0xff55('0x58')](_0x188aee,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xc18d=['userId','Requested\x20Resource\x20not\x20Found','GET','&entities=contact','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','contactNumber','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','POST','/api/tasks','Subjects','getString','Descriptions','Contact','add','ticketId','Task\x20created:','user:%s','emit','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','destcalleridnum','calleridnum','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','request-promise','util','moment','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','/api/selector/owners','info','Getting\x20admin\x20information','email','adminEmail','adminId','Admin\x20found:','catch','error','toUpperCase','message','headers','Getting\x20user\x20list','then','users','agentEmail','userEmail','length'];(function(_0x46bc78,_0x5bd67c){var _0x4afeb5=function(_0x1bbbe1){while(--_0x1bbbe1){_0x46bc78['push'](_0x46bc78['shift']());}};_0x4afeb5(++_0x5bd67c);}(_0xc18d,0x1c9));var _0xdc18=function(_0x4b67c4,_0x4807f0){_0x4b67c4=_0x4b67c4-0x0;var _0x3402f7=_0xc18d[_0x4b67c4];return _0x3402f7;};'use strict';var _=require('lodash');var rp=require(_0xdc18('0x0'));var md5=require('md5');var util=require(_0xdc18('0x1'));var moment=require(_0xdc18('0x2'));var Promise=require('bluebird');var Redis=require('ioredis');var intUtil=require(_0xdc18('0x3'));var config=require(_0xdc18('0x4'));var logger=require(_0xdc18('0x5'))(_0xdc18('0x6'));config[_0xdc18('0x7')]=_[_0xdc18('0x8')](config[_0xdc18('0x7')],{'host':_0xdc18('0x9'),'port':0x18eb});var io=require(_0xdc18('0xa'))(new Redis(config[_0xdc18('0x7')]));function getAdminId(_0x463e13,_0x30573f,_0x46b0dd,_0x18bf15){return new Promise(function(_0x1f3d05,_0x2cf0cd){var _0x5208bc=![];var _0x1cb618={'method':'GET','uri':_0x18bf15+_0xdc18('0xb'),'json':!![]};_0x1cb618['headers']=_0x46b0dd;logger[_0xdc18('0xc')](_0xdc18('0xd'));return rp(_0x1cb618)['then'](function(_0x41d937){if(_0x41d937){var _0x35dcfe=_0x41d937['users'];var _0x53922c=null;for(_0x53922c=0x0;_0x53922c<_0x35dcfe['length'];_0x53922c++){if(_0x35dcfe[_0x53922c][_0xdc18('0xe')]===_0x463e13[_0xdc18('0xf')]){_0x463e13[_0xdc18('0x10')]=_0x35dcfe[_0x53922c]['id'];_0x5208bc=!![];}}if(_0x5208bc){logger[_0xdc18('0xc')](_0xdc18('0x11'),_0x463e13[_0xdc18('0x10')]);_0x1f3d05(_0x463e13);}else{_0x2cf0cd({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x2cf0cd({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xdc18('0x12')](function(_0x202777){logger[_0xdc18('0x13')]('['+[_0x30573f[_0xdc18('0x14')]()]+']',_0x202777[_0xdc18('0x15')]);_0x2cf0cd(_0x202777);});});}function getUser(_0x101281,_0xa075ec,_0x5daf80){return function(_0x55c24a){return new Promise(function(_0x3decf4,_0x3bf189){var _0x127c4c={'method':'GET','uri':_0x5daf80+_0xdc18('0xb'),'json':!![]};_0x127c4c[_0xdc18('0x16')]=_0xa075ec;logger[_0xdc18('0xc')](_0xdc18('0x17'));return rp(_0x127c4c)[_0xdc18('0x18')](function(_0x2e61cb){if(_0x2e61cb){var _0x2f1707=_0x2e61cb[_0xdc18('0x19')];var _0x1cdd2d=![];var _0x3e202c=null;if(_0x55c24a['agentEmail']!==null){logger[_0xdc18('0xc')]('Getting\x20user\x20with\x20email',_0x55c24a[_0xdc18('0x1a')]);_0x55c24a[_0xdc18('0x1b')]=_0x55c24a[_0xdc18('0x1a')];for(_0x3e202c=0x0;_0x3e202c<_0x2f1707[_0xdc18('0x1c')];_0x3e202c++){if(_0x2f1707[_0x3e202c]['email']===_0x55c24a[_0xdc18('0x1a')]){_0x1cdd2d=!![];_0x55c24a[_0xdc18('0x1d')]=_0x2f1707[_0x3e202c]['id'];logger['info']('User\x20found:',_0x55c24a[_0xdc18('0x1d')]);}}}if(!_0x1cdd2d){logger[_0xdc18('0xc')]('Admin\x20selected');_0x55c24a[_0xdc18('0x1b')]=_0x55c24a[_0xdc18('0xf')];_0x55c24a['userId']=_0x55c24a[_0xdc18('0x10')];_0x1cdd2d=!![];}if(_0x1cdd2d){_0x3decf4(_0x55c24a);}else{_0x3bf189({'statusCode':0x194,'message':_0xdc18('0x1e')});}}else{_0x3bf189({'statusCode':0x194,'message':_0xdc18('0x1e')});}})['catch'](function(_0x40ee39){logger['error']('['+[_0x101281[_0xdc18('0x14')]()]+']',_0x40ee39[_0xdc18('0x15')]);_0x3bf189(_0x40ee39);});});};}function searchContact(_0x985e20,_0x5bde6d,_0x270e0d,_0x1f8550){return new Promise(function(_0x413095,_0xb22950){var _0x2d1e47={'method':_0xdc18('0x1f'),'headers':_0x5bde6d,'uri':_0x985e20+'/api/lookup?q='+_0x1f8550+'&f='+_0x270e0d+_0xdc18('0x20'),'json':!![]};rp(_0x2d1e47)[_0xdc18('0x18')](function(_0x132eaf){var _0x22dd69=_[_0xdc18('0x21')](_0x132eaf[_0xdc18('0x22')][_0xdc18('0x22')],[_0x270e0d,_0x1f8550]);_0x413095(_0x22dd69);})['catch'](function(_0x54b43c){_0xb22950(_0x54b43c);});});}function getEndUser(_0x451c39,_0x50ed82,_0x2d67e7){return function(_0xee69d){return new Promise(function(_0x35b073,_0x3f099c){logger['info'](util['format'](_0xdc18('0x23'),_0xee69d['contactNumber']));searchContact(_0x2d67e7,_0x50ed82,_0xdc18('0x24'),_0xee69d['contactNumber'])[_0xdc18('0x18')](function(_0x56685c){if(_0x56685c){_0xee69d[_0xdc18('0x25')]=_0x56685c['id'];logger[_0xdc18('0xc')](_0xdc18('0x26'),_0xee69d[_0xdc18('0x25')]);return _0x35b073(_0xee69d);}searchContact(_0x2d67e7,_0x50ed82,_0xdc18('0x27'),_0xee69d[_0xdc18('0x28')])[_0xdc18('0x18')](function(_0x373b16){if(_0x373b16){_0xee69d[_0xdc18('0x25')]=_0x373b16['id'];logger[_0xdc18('0xc')]('Contact\x20found\x20work_number:',_0xee69d[_0xdc18('0x25')]);return _0x35b073(_0xee69d);}createEndUser(_0xee69d,_0x451c39,_0x50ed82,_0x2d67e7)['then'](function(_0x6ae6a1){logger[_0xdc18('0xc')]('Contact\x20created:',_0x6ae6a1['endUserId']);return _0x35b073(_0x6ae6a1);});});})[_0xdc18('0x12')](function(_0x1fdf0e){_0x3f099c(_0x1fdf0e);});});};}function createEndUser(_0x523a1b,_0xea3b67,_0xe5e972,_0x38d4f3){return new Promise(function(_0x46acf6,_0x2a375c){var _0x540117=moment();var _0xead1dc={'method':'POST','uri':_0x38d4f3+_0xdc18('0x29'),'body':{'contact':{'last_name':_0x523a1b[_0xdc18('0x28')],'work_number':_0x523a1b[_0xdc18('0x28')],'mobile_number':_0x523a1b[_0xdc18('0x28')],'owner_id':_0x523a1b[_0xdc18('0x1d')],'created_at':_0x540117[_0xdc18('0x2a')](_0xdc18('0x2b'))}},'json':!![]};_0xead1dc[_0xdc18('0x16')]=_0xe5e972;logger[_0xdc18('0xc')](_0xdc18('0x2c'));return rp(_0xead1dc)[_0xdc18('0x18')](function(_0x2231da){_0x523a1b[_0xdc18('0x25')]=_0x2231da[_0xdc18('0x2d')]['id'];_0x46acf6(_0x523a1b);})['catch'](function(_0x3ee828){logger[_0xdc18('0x13')]('['+[_0xea3b67['toUpperCase']()]+']',_0x3ee828[_0xdc18('0x15')]);_0x2a375c(_0x3ee828['message']);});});}function getTicket(_0x1b7924,_0x40b24d,_0x575ca8,_0x3cc286,_0x1ab6a1){return function(_0x21904d){logger['info'](_0xdc18('0x2e'));return new Promise(function(_0x50065c,_0x278ab4){var _0x4ef483=moment();var _0x3766b9={'method':_0xdc18('0x2f'),'uri':_0x575ca8+_0xdc18('0x30'),'body':{'title':intUtil['getString'](_0x3cc286[_0xdc18('0x31')],_0x1ab6a1,'\x20'),'description':intUtil[_0xdc18('0x32')](_0x3cc286[_0xdc18('0x33')],_0x1ab6a1,'\x0a'),'owner_id':_0x21904d[_0xdc18('0x1d')],'creater_id':_0x21904d[_0xdc18('0x10')],'targetable_id':_0x21904d[_0xdc18('0x25')],'targetable_type':_0xdc18('0x34'),'created_at':_0x4ef483[_0xdc18('0x2a')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x4ef483[_0xdc18('0x35')](0x1e,'m')[_0xdc18('0x2a')](_0xdc18('0x2b'))},'json':!![]};_0x3766b9['headers']=_0x40b24d;return rp(_0x3766b9)[_0xdc18('0x18')](function(_0x2d0aac){_0x21904d[_0xdc18('0x36')]=_0x2d0aac['task']['id'];logger[_0xdc18('0xc')](_0xdc18('0x37'),_0x21904d[_0xdc18('0x36')]);_0x50065c(_0x21904d);})[_0xdc18('0x12')](function(_0x4ab37d){logger[_0xdc18('0x13')]('['+[_0x1b7924['toUpperCase']()]+']',_0x4ab37d[_0xdc18('0x15')]);_0x278ab4(_0x4ab37d[_0xdc18('0x15')]);});});};}function emit(_0x372985,_0x45bd0d,_0x4d9eed){var _0x6da298={'uri':_0x372985+'/contacts/'+_0x4d9eed};io['to'](util[_0xdc18('0x2a')](_0xdc18('0x38'),_0x45bd0d))[_0xdc18('0x39')](_0xdc18('0x3a'),_0x6da298);}exports['cs']=function(_0x3b4304,_0x19c134,_0x1b1f12,_0x33e05c,_0x5a130b,_0x3aa4e4,_0x3f3b8c,_0x3a1118){var _0x191693={};var _0x31cf1c={'Authorization':_0xdc18('0x3b')+_0x3aa4e4['apiKey']};_0x3aa4e4[_0xdc18('0x3c')]=intUtil[_0xdc18('0x3d')](_0x3aa4e4[_0xdc18('0x3c')]);_0x3aa4e4[_0xdc18('0x3e')]=intUtil[_0xdc18('0x3d')](_0x3aa4e4[_0xdc18('0x3e')]);var _0x18bad6=_0x3aa4e4[_0xdc18('0x3c')];_0x191693[_0xdc18('0xf')]=_0x3aa4e4[_0xdc18('0x3f')];_0x191693[_0xdc18('0x28')]=_0x3a1118[_0xdc18('0x40')]()==='outbound'?_0x19c134[_0xdc18('0x41')]:_0x19c134[_0xdc18('0x42')];_0x191693['callDirection']=_0x3a1118===_0xdc18('0x43')||_0x3a1118===_0xdc18('0x44')?_0xdc18('0x43'):_0xdc18('0x45');if(_0x33e05c){_0x191693[_0xdc18('0x1a')]=_0x33e05c[_0xdc18('0xe')];}var _0x1fb551=util['format'](_0xdc18('0x46'),_0x3aa4e4['serverUrl'],_0x19c134[_0xdc18('0x47')],md5(_0x19c134[_0xdc18('0x47')]));if(_0x5a130b&&_0x5a130b['monitor_format']){logger[_0xdc18('0xc')](_0xdc18('0x48'),_0xdc18('0x49'));_0x19c134['recordingURL']=_0x1fb551;}else if(_0x3f3b8c&&_0x3f3b8c[_0xdc18('0x4a')]&&_0x3f3b8c[_0xdc18('0x4a')]!==_0xdc18('0x4b')){logger[_0xdc18('0xc')](_0xdc18('0x4c'),_0xdc18('0x49'));_0x19c134['recordingURL']=_0x1fb551;}else{_0x19c134[_0xdc18('0x4d')]='';}return getAdminId(_0x191693,_0x3a1118,_0x31cf1c,_0x18bad6)[_0xdc18('0x18')](getUser(_0x3a1118,_0x31cf1c,_0x18bad6))[_0xdc18('0x18')](getEndUser(_0x3a1118,_0x31cf1c,_0x18bad6))['then'](getTicket(_0x3a1118,_0x31cf1c,_0x18bad6,_0x1b1f12,_0x19c134))[_0xdc18('0x18')](function(_0xd5423c){logger[_0xdc18('0xc')](util[_0xdc18('0x2a')](_0xdc18('0x4e'),_0xd5423c[_0xdc18('0x36')]));if(_0x3a1118!==_0xdc18('0x44')){logger[_0xdc18('0xc')]('['+[_0x3a1118['toUpperCase']()]+']',_0xdc18('0x4f'));emit(_0x18bad6,_0x33e05c['name'],_0xd5423c[_0xdc18('0x25')]);}})[_0xdc18('0x12')](function(_0x24bbcd){logger[_0xdc18('0x13')]('['+[_0x3a1118[_0xdc18('0x14')]()]+_0xdc18('0x50'),util['inspect'](_0x24bbcd,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 87589ec..58b57c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4212=['data1','toLowerCase','data2','Configurations','queue','routeId','outbound','log','unmanaged','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','error','lodash','./zendesk','./salesforce','./freshdesk','./zoho','./desk','./vtiger','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','includes'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x4212,0xdb));var _0x2421=function(_0x1f8053,_0x111077){_0x1f8053=_0x1f8053-0x0;var _0x174fd8=_0x4212[_0x1f8053];return _0x174fd8;};'use strict';var _=require(_0x2421('0x0'));var util=require('util');var zendesk=require(_0x2421('0x1'));var salesforce=require(_0x2421('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x2421('0x3'));var zoho=require(_0x2421('0x4'));var desk=require(_0x2421('0x5'));var vtiger=require(_0x2421('0x6'));var servicenow=require('./servicenow');var dynamics365=require(_0x2421('0x7'));var freshsales=require(_0x2421('0x8'));var integrations=[_0x2421('0x9'),_0x2421('0xa'),_0x2421('0xb'),_0x2421('0xc'),_0x2421('0xd'),_0x2421('0xe'),_0x2421('0xf'),_0x2421('0x10'),_0x2421('0x11'),'servicenow'];exports['exec']=function(_0x482368,_0x1a3686,_0x9390dc,_0x2886c2,_0x241d64,_0x1b60ab){if(_0x9390dc){if(_[_0x2421('0x12')](integrations,_0x482368[_0x2421('0x13')][_0x2421('0x14')]())){try{var _0x406867=null;var _0x126a94='';var _0x1473b4=_0x9390dc[_0x482368['data1'][_0x2421('0x14')]()];if(_0x1473b4){var _0x4bccbf=_0x1473b4[_0x482368[_0x2421('0x15')]];if(_0x4bccbf){var _0x3eeea8=_['find'](_0x4bccbf[_0x2421('0x16')],{'id':parseInt(_0x482368['data3'],0xa)});if(_0x3eeea8){if(_0x2886c2){if(_0x241d64&&_0x1a3686[_0x2421('0x17')]){_0x126a94=_0x2421('0x17');}else if(_0x1a3686[_0x2421('0x18')]){_0x126a94=_0x2421('0x19');}else{console[_0x2421('0x1a')]('EVENT\x20UNKNOWN',_0x1a3686);}}else{_0x126a94=_0x2421('0x1b');}switch(_0x482368[_0x2421('0x13')][_0x2421('0x14')]()){case'zendesk':zendesk[_0x126a94](_0x482368,_0x1a3686,_0x3eeea8,_0x2886c2,_0x241d64,_0x4bccbf,_0x1b60ab);break;case _0x2421('0xa'):salesforce[_0x126a94](_0x482368,_0x1a3686,_0x3eeea8,_0x2886c2,_0x241d64,_0x4bccbf,_0x1b60ab);break;case _0x2421('0xb'):sugarcrm[_0x126a94](_0x482368,_0x1a3686,_0x3eeea8,_0x2886c2,_0x241d64,_0x4bccbf,_0x1b60ab);break;case _0x2421('0xc'):freshdesk[_0x126a94](_0x482368,_0x1a3686,_0x3eeea8,_0x2886c2,_0x241d64,_0x4bccbf,_0x1b60ab);break;case'zoho':zoho[_0x126a94](_0x482368,_0x1a3686,_0x3eeea8,_0x2886c2,_0x241d64,_0x4bccbf,_0x1b60ab);break;case _0x2421('0xe'):desk[_0x126a94](_0x482368,_0x1a3686,_0x3eeea8,_0x2886c2,_0x241d64,_0x4bccbf,_0x1b60ab);break;case _0x2421('0xf'):vtiger[_0x126a94](_0x482368,_0x1a3686,_0x3eeea8,_0x2886c2,_0x241d64,_0x4bccbf,_0x1b60ab);break;case _0x2421('0x11'):freshsales['cs'](_0x482368,_0x1a3686,_0x3eeea8,_0x2886c2,_0x241d64,_0x4bccbf,_0x1b60ab,_0x126a94);break;case'servicenow':servicenow['cs'](_0x482368,_0x1a3686,_0x3eeea8,_0x2886c2,_0x241d64,_0x4bccbf,_0x1b60ab,_0x126a94);break;case _0x2421('0x10'):dynamics365['cs'](_0x482368,_0x1a3686,_0x3eeea8,_0x2886c2,_0x241d64,_0x4bccbf,_0x1b60ab,_0x126a94);break;default:console[_0x2421('0x1a')]('unknown\x20integration');}}else{_0x406867=require(_0x2421('0x1c'))(_0x482368[_0x2421('0x13')][_0x2421('0x14')]());_0x406867['error'](_0x2421('0x1d'),util[_0x2421('0x1e')](_0x2421('0x1f'),_0x482368[_0x2421('0x13')][_0x2421('0x14')](),_0x482368[_0x2421('0x20')]));}}else{_0x406867=require(_0x2421('0x1c'))(_0x482368['data1'][_0x2421('0x14')]());_0x406867[_0x2421('0x21')](_0x2421('0x1d'),util[_0x2421('0x1e')]('%s\x20account\x20#%s\x20not\x20found',_0x482368[_0x2421('0x13')][_0x2421('0x14')](),_0x482368['data2']));}}else{}}catch(_0x30b112){console[_0x2421('0x21')](_0x30b112);}}}};
\ No newline at end of file
+var _0x2903=['unknown\x20integration','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','format','lodash','util','./zendesk','./salesforce','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','freshsales','servicenow','includes','data1','toLowerCase','data2','find','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged'];(function(_0x3ba69c,_0x3e370c){var _0x1c722b=function(_0x1ba57a){while(--_0x1ba57a){_0x3ba69c['push'](_0x3ba69c['shift']());}};_0x1c722b(++_0x3e370c);}(_0x2903,0xbf));var _0x3290=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x2903[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x3290('0x0'));var util=require(_0x3290('0x1'));var zendesk=require(_0x3290('0x2'));var salesforce=require(_0x3290('0x3'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x3290('0x4'));var zoho=require(_0x3290('0x5'));var desk=require(_0x3290('0x6'));var vtiger=require(_0x3290('0x7'));var servicenow=require(_0x3290('0x8'));var dynamics365=require(_0x3290('0x9'));var freshsales=require('./freshsales');var integrations=[_0x3290('0xa'),_0x3290('0xb'),_0x3290('0xc'),_0x3290('0xd'),_0x3290('0xe'),_0x3290('0xf'),_0x3290('0x10'),'dynamics365',_0x3290('0x11'),_0x3290('0x12')];exports['exec']=function(_0x347aa1,_0x462c69,_0x2cfc57,_0x33ed6c,_0x514406,_0x1a8bf5){if(_0x2cfc57){if(_[_0x3290('0x13')](integrations,_0x347aa1[_0x3290('0x14')][_0x3290('0x15')]())){try{var _0x57619c=null;var _0x4b9fba='';var _0x14bdf3=_0x2cfc57[_0x347aa1['data1']['toLowerCase']()];if(_0x14bdf3){var _0x1889f2=_0x14bdf3[_0x347aa1[_0x3290('0x16')]];if(_0x1889f2){var _0x55ccc8=_[_0x3290('0x17')](_0x1889f2[_0x3290('0x18')],{'id':parseInt(_0x347aa1['data3'],0xa)});if(_0x55ccc8){if(_0x33ed6c){if(_0x514406&&_0x462c69[_0x3290('0x19')]){_0x4b9fba='queue';}else if(_0x462c69[_0x3290('0x1a')]){_0x4b9fba=_0x3290('0x1b');}else{console[_0x3290('0x1c')](_0x3290('0x1d'),_0x462c69);}}else{_0x4b9fba=_0x3290('0x1e');}switch(_0x347aa1[_0x3290('0x14')][_0x3290('0x15')]()){case'zendesk':zendesk[_0x4b9fba](_0x347aa1,_0x462c69,_0x55ccc8,_0x33ed6c,_0x514406,_0x1889f2,_0x1a8bf5);break;case'salesforce':salesforce[_0x4b9fba](_0x347aa1,_0x462c69,_0x55ccc8,_0x33ed6c,_0x514406,_0x1889f2,_0x1a8bf5);break;case _0x3290('0xc'):sugarcrm[_0x4b9fba](_0x347aa1,_0x462c69,_0x55ccc8,_0x33ed6c,_0x514406,_0x1889f2,_0x1a8bf5);break;case _0x3290('0xd'):freshdesk[_0x4b9fba](_0x347aa1,_0x462c69,_0x55ccc8,_0x33ed6c,_0x514406,_0x1889f2,_0x1a8bf5);break;case'zoho':zoho[_0x4b9fba](_0x347aa1,_0x462c69,_0x55ccc8,_0x33ed6c,_0x514406,_0x1889f2,_0x1a8bf5);break;case _0x3290('0xf'):desk[_0x4b9fba](_0x347aa1,_0x462c69,_0x55ccc8,_0x33ed6c,_0x514406,_0x1889f2,_0x1a8bf5);break;case'vtiger':vtiger[_0x4b9fba](_0x347aa1,_0x462c69,_0x55ccc8,_0x33ed6c,_0x514406,_0x1889f2,_0x1a8bf5);break;case _0x3290('0x11'):freshsales['cs'](_0x347aa1,_0x462c69,_0x55ccc8,_0x33ed6c,_0x514406,_0x1889f2,_0x1a8bf5,_0x4b9fba);break;case'servicenow':servicenow['cs'](_0x347aa1,_0x462c69,_0x55ccc8,_0x33ed6c,_0x514406,_0x1889f2,_0x1a8bf5,_0x4b9fba);break;case'dynamics365':dynamics365['cs'](_0x347aa1,_0x462c69,_0x55ccc8,_0x33ed6c,_0x514406,_0x1889f2,_0x1a8bf5,_0x4b9fba);break;default:console[_0x3290('0x1c')](_0x3290('0x1f'));}}else{_0x57619c=require('../../../../config/logger')(_0x347aa1[_0x3290('0x14')][_0x3290('0x15')]());_0x57619c[_0x3290('0x20')](_0x3290('0x21'),util['format'](_0x3290('0x22'),_0x347aa1[_0x3290('0x14')]['toLowerCase'](),_0x347aa1['data3']));}}else{_0x57619c=require(_0x3290('0x23'))(_0x347aa1[_0x3290('0x14')][_0x3290('0x15')]());_0x57619c[_0x3290('0x20')](_0x3290('0x21'),util[_0x3290('0x24')]('%s\x20account\x20#%s\x20not\x20found',_0x347aa1[_0x3290('0x14')][_0x3290('0x15')](),_0x347aa1[_0x3290('0x16')]));}}else{}}catch(_0x1939e2){console['error'](_0x1939e2);}}}};
\ No newline at end of file
index 65d7a9c..c25ce24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7021=['./util','../../../../config/environment','../../../../config/logger','salesforce','defaults','redis','localhost','socket.io-emitter','assign','Subjects','getString','Descriptions','ticketType','utc','IsRecurrence','endUserType','lead','WhoId','WhatId','Case','contact','ContactId','account','AccountId','leadId','info','sobject','create','isNil','User','find','then','length','Email','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','cloneDeep','merge','$or','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','execute','additionalSearchContact','Contact','Name','Phone','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.','format','Caller\x20-\x20%s','<unknown>','Company','No\x20Company','forEach','includes','string','picklist','idField','toString','variable','variableName','customVariable','Variable','name','password','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','uniqueid','email','calleridname','calleridnum','Fields','integrationTab','user:%s','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','[OUTBOUND]','destcalleridname','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis'];(function(_0x9e575,_0x5894d4){var _0x522277=function(_0x1f5458){while(--_0x1f5458){_0x9e575['push'](_0x9e575['shift']());}};_0x522277(++_0x5894d4);}(_0x7021,0x75));var _0x1702=function(_0x4bacb6,_0x2b299d){_0x4bacb6=_0x4bacb6-0x0;var _0x58c029=_0x7021[_0x4bacb6];return _0x58c029;};'use strict';var _=require(_0x1702('0x0'));var rp=require(_0x1702('0x1'));var moment=require(_0x1702('0x2'));var BPromise=require(_0x1702('0x3'));var md5=require(_0x1702('0x4'));var jsforce=require(_0x1702('0x5'));var util=require(_0x1702('0x6'));var Redis=require(_0x1702('0x7'));var intUtil=require(_0x1702('0x8'));var config=require(_0x1702('0x9'));var logger=require(_0x1702('0xa'))(_0x1702('0xb'));config['redis']=_[_0x1702('0xc')](config[_0x1702('0xd')],{'host':_0x1702('0xe'),'port':0x18eb});var io=require(_0x1702('0xf'))(new Redis(config[_0x1702('0xd')]));function emit(_0x487afb,_0x3d07f2,_0x214b48){io['to'](_0x487afb)['emit'](_0x3d07f2,_0x214b48);}function getTicket(_0x3df9d2,_0x39c1bd,_0x5dc66b,_0x1ea9d2,_0x1600cd,_0xad069f,_0x35138b,_0x1d82bf){var _0x3d483d=Object[_0x1702('0x10')]({},{'OwnerId':_0x39c1bd['id'],'Subject':intUtil['getString'](_0x1ea9d2[_0x1702('0x11')],_0x1600cd,'\x20'),'Description':intUtil[_0x1702('0x12')](_0x1ea9d2[_0x1702('0x13')],_0x1600cd,'\x0a')},getCustomFields(_0xad069f,_0x1600cd));if(_0x5dc66b){if(_0x1ea9d2[_0x1702('0x14')]==='Task'){_0x3d483d['ActivityDate']=moment[_0x1702('0x15')]();_0x3d483d['IsReminderSet']=![];_0x3d483d[_0x1702('0x16')]=![];if(_0x5dc66b[_0x1702('0x17')]==='contact'||_0x5dc66b[_0x1702('0x17')]===_0x1702('0x18')){_0x3d483d[_0x1702('0x19')]=_0x5dc66b['id'];}else if(_0x5dc66b['endUserType']==='account'){_0x3d483d[_0x1702('0x1a')]=_0x5dc66b['id'];}}else if(_0x1ea9d2[_0x1702('0x14')]===_0x1702('0x1b')){if(_0x5dc66b[_0x1702('0x17')]===_0x1702('0x1c')){_0x3d483d[_0x1702('0x1d')]=_0x5dc66b['id'];}else if(_0x5dc66b[_0x1702('0x17')]===_0x1702('0x1e')){_0x3d483d[_0x1702('0x1f')]=_0x5dc66b['id'];}else if(_0x5dc66b[_0x1702('0x17')]===_0x1702('0x18')&&_0x1ea9d2[_0x1702('0x20')]){_0x3d483d[_0x1ea9d2[_0x1702('0x20')]]=_0x5dc66b['id'];}else{logger[_0x1702('0x21')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x35138b[_0x1702('0x22')](_0x1ea9d2[_0x1702('0x14')])[_0x1702('0x23')](_0x3d483d);}function getUser(_0x1b163e,_0x1971c4,_0x203cef){if(!_[_0x1702('0x24')](_0x1971c4)&&intUtil['validateEmail'](_0x1971c4)){var _0x5c7217={'Email':_0x1971c4};var _0xbfd6c0={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x203cef[_0x1702('0x22')](_0x1702('0x25'))[_0x1702('0x26')](_0x5c7217,_0xbfd6c0)['execute']()[_0x1702('0x27')](function(_0x396c1c){if(_0x396c1c[_0x1702('0x28')]){var _0x257e51=_[_0x1702('0x26')](_0x396c1c,function(_0x299b6d){return _0x299b6d[_0x1702('0x29')]===_0x1971c4;});if(_0x257e51){logger[_0x1702('0x21')]('Agent\x20%s\x20found.',_0x1971c4);return BPromise['resolve']({'id':_0x257e51['Id'],'name':_0x257e51['Name']});}}else{logger['info'](_0x1702('0x2a'),_0x1971c4);return _0x203cef[_0x1702('0x2b')]()[_0x1702('0x27')](function(_0x528af1){return BPromise[_0x1702('0x2c')]({'id':_0x528af1[_0x1702('0x2d')],'name':_0x528af1[_0x1702('0x2e')]});});}});}else{logger['info'](_0x1702('0x2a'),_0x1971c4);return _0x203cef['identity']()[_0x1702('0x27')](function(_0x4ef058){return BPromise[_0x1702('0x2c')]({'id':_0x4ef058[_0x1702('0x2d')],'name':_0x4ef058[_0x1702('0x2e')]});});}}function getEndUser(_0x3a9373,_0x328a0f,_0x289bbb,_0x4b6965,_0x28fe4a){var _0x4a5006={'$or':{'Phone':_0x4b6965}};var _0x252b23={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x1702('0x27')](function(){logger[_0x1702('0x21')](_0x1702('0x2f'),_0x4b6965,_0x328a0f['moduleSearch']);switch(_0x328a0f['moduleSearch']){case'contact_lead':var _0x1f871b=_[_0x1702('0x30')](_0x4a5006);if(_0x328a0f['additionalSearchContact']){var _0x23c8c1={};_0x23c8c1[_0x328a0f['additionalSearchContact']]=_0x4b6965;_[_0x1702('0x31')](_0x1f871b[_0x1702('0x32')],_0x23c8c1);}return _0x28fe4a['sobject']('Contact')['find'](_0x1f871b,_0x252b23)['execute']()[_0x1702('0x27')](function(_0x518b94){if(_0x518b94&&_0x518b94['length']){return _0x518b94;}else{var _0x4d6f0e=_[_0x1702('0x30')](_0x4a5006);if(_0x328a0f[_0x1702('0x33')]){var _0x100843={};_0x100843[_0x328a0f[_0x1702('0x33')]]=_0x4b6965;_['merge'](_0x4d6f0e[_0x1702('0x32')],_0x100843);}return _0x28fe4a['sobject'](_0x1702('0x34'))[_0x1702('0x26')](_0x4d6f0e,_0x252b23);}});case _0x1702('0x35'):var _0x35053c=_[_0x1702('0x30')](_0x4a5006);if(_0x328a0f[_0x1702('0x36')]){var _0x23c8c1={};_0x23c8c1[_0x328a0f[_0x1702('0x36')]]=_0x4b6965;_[_0x1702('0x31')](_0x35053c[_0x1702('0x32')],_0x23c8c1);}return _0x28fe4a[_0x1702('0x22')](_0x1702('0x37'))[_0x1702('0x26')](_0x35053c,_0x252b23)[_0x1702('0x38')]()[_0x1702('0x27')](function(_0x2c160f){if(_0x2c160f&&_0x2c160f[_0x1702('0x28')]){return _0x2c160f;}else{var _0x5093d8=_['cloneDeep'](_0x4a5006);if(_0x328a0f[_0x1702('0x39')]){var _0x3b0475={};_0x3b0475[_0x328a0f[_0x1702('0x39')]]=_0x4b6965;_[_0x1702('0x31')](_0x5093d8['$or'],_0x3b0475);}return _0x28fe4a[_0x1702('0x22')](_0x1702('0x3a'))['find'](_0x5093d8,_0x252b23)['then'](function(_0x4c853b){if(_0x4c853b&&_0x4c853b[_0x1702('0x28')]){return _0x4c853b;}else{var _0x4214b2=_[_0x1702('0x30')](_0x4a5006);if(_0x328a0f[_0x1702('0x33')]){var _0x457e98={};_0x457e98[_0x328a0f[_0x1702('0x33')]]=_0x4b6965;_['merge'](_0x4214b2[_0x1702('0x32')],_0x457e98);}return _0x28fe4a['sobject'](_0x1702('0x34'))[_0x1702('0x26')](_0x4214b2,_0x252b23);}});}});case _0x1702('0x1c'):var _0x1f871b=_[_0x1702('0x30')](_0x4a5006);if(_0x328a0f['additionalSearchContact']){var _0x23c8c1={};_0x23c8c1[_0x328a0f[_0x1702('0x39')]]=_0x4b6965;_[_0x1702('0x31')](_0x1f871b[_0x1702('0x32')],_0x23c8c1);}return _0x28fe4a[_0x1702('0x22')]('Contact')[_0x1702('0x26')](_0x1f871b,_0x252b23)[_0x1702('0x38')]();case'lead':var _0xebc5a3=_[_0x1702('0x30')](_0x4a5006);if(_0x328a0f[_0x1702('0x33')]){var _0x23c8c1={};_0x23c8c1[_0x328a0f[_0x1702('0x33')]]=_0x4b6965;_[_0x1702('0x31')](_0xebc5a3[_0x1702('0x32')],_0x23c8c1);}return _0x28fe4a[_0x1702('0x22')](_0x1702('0x34'))[_0x1702('0x26')](_0xebc5a3,_0x252b23);case _0x1702('0x1e'):var _0x35053c=_[_0x1702('0x30')](_0x4a5006);if(_0x328a0f['additionalSearchAccount']){var _0x23c8c1={};_0x23c8c1[_0x328a0f['additionalSearchAccount']]=_0x4b6965;_['merge'](_0x35053c[_0x1702('0x32')],_0x23c8c1);}return _0x28fe4a[_0x1702('0x22')]('Account')['find'](_0x35053c,_0x252b23);default:return null;}})[_0x1702('0x27')](function(_0x25b6a1){if(_0x25b6a1&&_0x25b6a1['length']){var _0x582947=_['first'](_0x25b6a1);if(_0x582947){return BPromise[_0x1702('0x2c')]({'id':_0x582947['Id'],'name':_0x582947[_0x1702('0x3b')],'phone':_0x582947[_0x1702('0x3c')],'endUserType':_0x582947[_0x1702('0x3d')][_0x1702('0x3e')][_0x1702('0x3f')]()});}}})[_0x1702('0x27')](function(_0x312018){if(_0x312018){logger[_0x1702('0x21')](_0x1702('0x40'),_0x312018[_0x1702('0x17')],_0x4b6965);return BPromise[_0x1702('0x2c')](_0x312018);}else{logger['info'](_0x1702('0x41'),_0x4b6965);var _0x256d9f={'Phone':_0x4b6965};if(_0x328a0f[_0x1702('0x42')]){if(_0x328a0f[_0x1702('0x42')]===_0x1702('0x1c')){logger[_0x1702('0x21')](_0x1702('0x43'),_0x4b6965,_0x328a0f['moduleCreate']);_0x256d9f['LastName']=_0x289bbb!=='<unknown>'?_0x289bbb:util[_0x1702('0x44')](_0x1702('0x45'),_0x4b6965);}else if(_0x328a0f[_0x1702('0x42')]===_0x1702('0x18')){logger[_0x1702('0x21')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4b6965,_0x328a0f[_0x1702('0x42')]);_0x256d9f['LastName']=_0x289bbb!==_0x1702('0x46')?_0x289bbb:util['format'](_0x1702('0x45'),_0x4b6965);_0x256d9f[_0x1702('0x47')]=_0x1702('0x48');}else if(_0x328a0f['moduleCreate']==='account'){logger[_0x1702('0x21')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4b6965,_0x328a0f[_0x1702('0x42')]);_0x256d9f['Name']=_0x289bbb!==_0x1702('0x46')?_0x289bbb:util[_0x1702('0x44')](_0x1702('0x45'),_0x4b6965);}else{return null;}}return _0x28fe4a[_0x1702('0x22')](_['upperFirst'](_0x328a0f[_0x1702('0x42')]))[_0x1702('0x23')](_0x256d9f)[_0x1702('0x27')](function(_0x1d5bc0){return BPromise[_0x1702('0x2c')]({'id':_0x1d5bc0['id'],'endUserType':_0x328a0f['moduleCreate']});});}});}function getCustomFields(_0x8bb3c,_0x4b9e1a){var _0x25b380={};if(_0x8bb3c[_0x1702('0x28')]>0x0){_[_0x1702('0x49')](_0x8bb3c,function(_0x43cb30){if(_[_0x1702('0x4a')]([_0x1702('0x4b'),_0x1702('0x4c')],_0x43cb30[_0x1702('0x3e')])&&_0x43cb30['idField']){_0x25b380[_0x43cb30[_0x1702('0x4d')]]=_0x43cb30['content'][_0x1702('0x4e')]();}else if(_0x43cb30[_0x1702('0x3e')]===_0x1702('0x4f')&&_0x43cb30['variableName']&&_0x43cb30[_0x1702('0x4d')]){_0x4b9e1a[_0x43cb30[_0x1702('0x50')]]&&(_0x25b380[_0x43cb30[_0x1702('0x4d')]]=_0x4b9e1a[_0x43cb30['variableName']][_0x1702('0x4e')]());}else if(_0x43cb30[_0x1702('0x3e')]===_0x1702('0x51')&&_0x43cb30[_0x1702('0x52')]&&_0x43cb30[_0x1702('0x52')]['name']&&_0x43cb30[_0x1702('0x4d')]){_0x4b9e1a[_0x43cb30[_0x1702('0x52')][_0x1702('0x53')]['toLowerCase']()]&&(_0x25b380[_0x43cb30[_0x1702('0x4d')]]=_0x4b9e1a[_0x43cb30[_0x1702('0x52')]['name'][_0x1702('0x3f')]()]['toString']());}});}return _0x25b380;}function getConnection(_0x186f67){var _0x387a91=_0x186f67[_0x1702('0x54')]['concat'](_0x186f67['securityToken']);var _0x2b9f00=new jsforce[(_0x1702('0x55'))]({'oauth2':{'loginUrl':_0x186f67[_0x1702('0x56')]||_0x1702('0x57'),'clientId':_0x186f67[_0x1702('0x58')],'clientSecret':_0x186f67[_0x1702('0x59')]}});return _0x2b9f00[_0x1702('0x5a')](_0x186f67[_0x1702('0x5b')],_0x387a91)[_0x1702('0x27')](function(){logger[_0x1702('0x21')](_0x1702('0x5c'));return _0x2b9f00;});}exports[_0x1702('0x5d')]=function(_0x42889a,_0xec15dc,_0x405579,_0x20c3a1,_0x4609de,_0x3d8ef9){var _0x4d2787,_0x1dae85,_0x3aef86,_0x370a74;_0x3d8ef9[_0x1702('0x5e')]=intUtil['stripTrailingSlash'](_0x3d8ef9[_0x1702('0x5e')]);_0x3d8ef9[_0x1702('0x56')]=intUtil[_0x1702('0x5f')](_0x3d8ef9['remoteUri']);if(_0x4609de&&_0x4609de['monitor_format']){logger[_0x1702('0x21')](_0x1702('0x60'),'Recording\x20is\x20enabled!');_0xec15dc[_0x1702('0x61')]=util[_0x1702('0x44')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3d8ef9[_0x1702('0x5e')],_0xec15dc[_0x1702('0x62')],md5(_0xec15dc['uniqueid']));}else{_0xec15dc[_0x1702('0x61')]='';}return getConnection(_0x3d8ef9)[_0x1702('0x27')](function(_0x223658){_0x370a74=_0x223658;return getUser(_0x3d8ef9,_0x20c3a1[_0x1702('0x63')],_0x370a74);})[_0x1702('0x27')](function(_0x1315fe){_0x4d2787=_0x1315fe;return getEndUser(_0x3d8ef9,_0x405579,_0xec15dc[_0x1702('0x64')],_0xec15dc[_0x1702('0x65')],_0x370a74);})[_0x1702('0x27')](function(_0x5595eb){_0x1dae85=_0x5595eb;return getTicket(_0x3d8ef9,_0x4d2787,_0x1dae85,_0x405579,_0xec15dc,_0x405579[_0x1702('0x66')],_0x370a74,_0x1702('0x5d'));})[_0x1702('0x27')](function(_0x1c0c0e){_0x3aef86=_0x1c0c0e;logger[_0x1702('0x21')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x3aef86['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x3aef86['id'],_0x20c3a1[_0x1702('0x53')],_0x3d8ef9[_0x1702('0x3e')]);switch(_0x3d8ef9[_0x1702('0x3e')]){case _0x1702('0x67'):emit(util['format'](_0x1702('0x68'),_0x20c3a1[_0x1702('0x53')]),'trigger:salesforce:display',{'recordId':_0x3aef86['id']});break;case _0x1702('0x69'):emit(util[_0x1702('0x44')](_0x1702('0x68'),_0x20c3a1[_0x1702('0x53')]),_0x1702('0x6a'),{'uri':util['format'](_0x1702('0x6b'),_0x370a74[_0x1702('0x6c')],_0x3aef86['id'])});break;default:logger[_0x1702('0x6d')](_0x1702('0x6e'));}})[_0x1702('0x6f')](function(_0x25b668){logger[_0x1702('0x6d')](_0x1702('0x60'),_0x25b668);});};exports['outbound']=function(_0x459aa1,_0x2d8f90,_0x4c0f1f,_0x27c4ed,_0x4f3a5a,_0x4ebe6b,_0xb3fae4){var _0x23040a,_0x439a55,_0x2b05ea,_0xe00ba6;_0x4ebe6b[_0x1702('0x5e')]=intUtil[_0x1702('0x5f')](_0x4ebe6b[_0x1702('0x5e')]);_0x4ebe6b['remoteUri']=intUtil[_0x1702('0x5f')](_0x4ebe6b['remoteUri']);if(_0xb3fae4&&_0xb3fae4[_0x1702('0x70')]&&_0xb3fae4[_0x1702('0x70')]!=='none'){logger[_0x1702('0x21')](_0x1702('0x71'),'Recording\x20is\x20enabled!');_0x2d8f90[_0x1702('0x61')]=util[_0x1702('0x44')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4ebe6b[_0x1702('0x5e')],_0x2d8f90[_0x1702('0x62')],md5(_0x2d8f90[_0x1702('0x62')]));}return getConnection(_0x4ebe6b)[_0x1702('0x27')](function(_0xf82a05){_0xe00ba6=_0xf82a05;return getUser(_0x4ebe6b,_0x27c4ed['email'],_0xe00ba6);})[_0x1702('0x27')](function(_0x2736f1){_0x23040a=_0x2736f1;return getEndUser(_0x4ebe6b,_0x4c0f1f,_0x2d8f90[_0x1702('0x72')],_0x2d8f90['destcalleridnum'],_0xe00ba6);})[_0x1702('0x27')](function(_0x2bf310){_0x439a55=_0x2bf310;return getTicket(_0x4ebe6b,_0x23040a,_0x439a55,_0x4c0f1f,_0x2d8f90,_0x4c0f1f[_0x1702('0x66')],_0xe00ba6,_0x1702('0x73'));})[_0x1702('0x27')](function(_0x334045){_0x2b05ea=_0x334045;logger[_0x1702('0x21')](_0x1702('0x74'),_0x2b05ea['id']);logger[_0x1702('0x21')](_0x1702('0x75'),_0x2b05ea['id'],_0x27c4ed[_0x1702('0x53')],_0x4ebe6b[_0x1702('0x3e')]);switch(_0x4ebe6b['type']){case'integrationTab':emit(util[_0x1702('0x44')](_0x1702('0x68'),_0x27c4ed['name']),'trigger:salesforce:display',{'recordId':_0x2b05ea['id']});break;case _0x1702('0x69'):emit(util[_0x1702('0x44')](_0x1702('0x68'),_0x27c4ed[_0x1702('0x53')]),_0x1702('0x6a'),{'uri':util[_0x1702('0x44')](_0x1702('0x6b'),_0xe00ba6[_0x1702('0x6c')],_0x2b05ea['id'])});break;default:logger[_0x1702('0x6d')](_0x1702('0x71'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x1702('0x6f')](function(_0x368ff2){logger['error'](_0x1702('0x71'),_0x368ff2);});};exports[_0x1702('0x76')]=function(_0x5e9ba1,_0x40c354,_0x2edc63,_0x423a21,_0x487f32,_0x1303f3){var _0x38b5cb,_0x5124a7,_0x3eaf21,_0x322cae;_0x1303f3[_0x1702('0x5e')]=intUtil[_0x1702('0x5f')](_0x1303f3[_0x1702('0x5e')]);_0x1303f3[_0x1702('0x56')]=intUtil[_0x1702('0x5f')](_0x1303f3[_0x1702('0x56')]);if(_0x487f32&&_0x487f32[_0x1702('0x77')]){logger[_0x1702('0x21')]('['+_0x40c354[_0x1702('0x78')][_0x1702('0x79')]()+']',_0x1702('0x7a'));_0x40c354[_0x1702('0x61')]=util[_0x1702('0x44')](_0x1702('0x7b'),_0x1303f3['serverUrl'],_0x40c354[_0x1702('0x62')],md5(_0x40c354[_0x1702('0x62')]));}else{_0x40c354[_0x1702('0x61')]='';}return getConnection(_0x1303f3)[_0x1702('0x27')](function(_0xdef081){_0x322cae=_0xdef081;if(!_['isNil'](_0x423a21)){return getUser(_0x1303f3,_0x423a21[_0x1702('0x53')],_0x322cae);}else{return getUser(_0x1303f3,null,_0x322cae);}})[_0x1702('0x27')](function(_0x21cf86){_0x38b5cb=_0x21cf86;return getEndUser(_0x1303f3,_0x2edc63,_0x40c354['calleridname'],_0x40c354['calleridnum'],_0x322cae);})['then'](function(_0x425601){_0x5124a7=_0x425601;return getTicket(_0x1303f3,_0x38b5cb,_0x5124a7,_0x2edc63,_0x40c354,_0x2edc63[_0x1702('0x66')],_0x322cae);})[_0x1702('0x27')](function(_0x172763){_0x3eaf21=_0x172763;logger[_0x1702('0x21')]('['+_0x40c354['lastevent'][_0x1702('0x79')]()+']\x20Ticket\x20%s\x20created.',_0x3eaf21['id']);logger['info']('['+_0x40c354[_0x1702('0x78')][_0x1702('0x79')]()+_0x1702('0x7c'),_0x1303f3['type']);})[_0x1702('0x6f')](function(_0x4af640){logger[_0x1702('0x6d')]('['+_0x40c354[_0x1702('0x78')]['toUpperCase']()+']',_0x4af640);});};
\ No newline at end of file
+var _0x474f=['assign','getString','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','endUserType','lead','WhoId','account','WhatId','Case','contact','ContactId','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','isNil','validateEmail','sobject','User','find','execute','then','length','Email','info','Agent\x20%s\x20found.','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','Contact','additionalSearchLead','$or','Lead','additionalSearchAccount','Account','first','Name','Phone','attributes','type','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.','<unknown>','format','Caller\x20-\x20%s','LastName','Company','No\x20Company','forEach','includes','string','picklist','idField','content','variable','variableName','customVariable','Variable','name','toLowerCase','toString','password','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','serverUrl','stripTrailingSlash','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','Fields','queue','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]','outbound','recordingFormat','none','Recording\x20is\x20enabled!','recordingURL','email','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','catch','unmanaged','lastevent','toUpperCase','calleridname',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit'];(function(_0x31d441,_0x53723e){var _0x361fc1=function(_0x105ad8){while(--_0x105ad8){_0x31d441['push'](_0x31d441['shift']());}};_0x361fc1(++_0x53723e);}(_0x474f,0x17b));var _0xf474=function(_0x4739aa,_0x18e4a6){_0x4739aa=_0x4739aa-0x0;var _0x1644cb=_0x474f[_0x4739aa];return _0x1644cb;};'use strict';var _=require(_0xf474('0x0'));var rp=require(_0xf474('0x1'));var moment=require(_0xf474('0x2'));var BPromise=require('bluebird');var md5=require('md5');var jsforce=require('jsforce');var util=require(_0xf474('0x3'));var Redis=require(_0xf474('0x4'));var intUtil=require(_0xf474('0x5'));var config=require(_0xf474('0x6'));var logger=require(_0xf474('0x7'))(_0xf474('0x8'));config[_0xf474('0x9')]=_[_0xf474('0xa')](config[_0xf474('0x9')],{'host':_0xf474('0xb'),'port':0x18eb});var io=require(_0xf474('0xc'))(new Redis(config[_0xf474('0x9')]));function emit(_0x4cb745,_0x532bec,_0xd45c84){io['to'](_0x4cb745)[_0xf474('0xd')](_0x532bec,_0xd45c84);}function getTicket(_0x3c91b4,_0x3fe604,_0x214dff,_0x55f6d3,_0x77ccf0,_0x556d8d,_0x3c111a,_0x354dcd){var _0x1d282e=Object[_0xf474('0xe')]({},{'OwnerId':_0x3fe604['id'],'Subject':intUtil[_0xf474('0xf')](_0x55f6d3['Subjects'],_0x77ccf0,'\x20'),'Description':intUtil['getString'](_0x55f6d3[_0xf474('0x10')],_0x77ccf0,'\x0a')},getCustomFields(_0x556d8d,_0x77ccf0));if(_0x214dff){if(_0x55f6d3[_0xf474('0x11')]===_0xf474('0x12')){_0x1d282e[_0xf474('0x13')]=moment[_0xf474('0x14')]();_0x1d282e[_0xf474('0x15')]=![];_0x1d282e['IsRecurrence']=![];if(_0x214dff['endUserType']==='contact'||_0x214dff[_0xf474('0x16')]===_0xf474('0x17')){_0x1d282e[_0xf474('0x18')]=_0x214dff['id'];}else if(_0x214dff[_0xf474('0x16')]===_0xf474('0x19')){_0x1d282e[_0xf474('0x1a')]=_0x214dff['id'];}}else if(_0x55f6d3[_0xf474('0x11')]===_0xf474('0x1b')){if(_0x214dff[_0xf474('0x16')]===_0xf474('0x1c')){_0x1d282e[_0xf474('0x1d')]=_0x214dff['id'];}else if(_0x214dff['endUserType']===_0xf474('0x19')){_0x1d282e[_0xf474('0x1e')]=_0x214dff['id'];}else if(_0x214dff[_0xf474('0x16')]===_0xf474('0x17')&&_0x55f6d3[_0xf474('0x1f')]){_0x1d282e[_0x55f6d3[_0xf474('0x1f')]]=_0x214dff['id'];}else{logger['info'](_0xf474('0x20'));}}}return _0x3c111a['sobject'](_0x55f6d3[_0xf474('0x11')])['create'](_0x1d282e);}function getUser(_0x3242f5,_0x30c1b4,_0x2a042b){if(!_[_0xf474('0x21')](_0x30c1b4)&&intUtil[_0xf474('0x22')](_0x30c1b4)){var _0x118f3f={'Email':_0x30c1b4};var _0x3264ed={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x2a042b[_0xf474('0x23')](_0xf474('0x24'))[_0xf474('0x25')](_0x118f3f,_0x3264ed)[_0xf474('0x26')]()[_0xf474('0x27')](function(_0x47fcb2){if(_0x47fcb2[_0xf474('0x28')]){var _0x10684f=_[_0xf474('0x25')](_0x47fcb2,function(_0xef8402){return _0xef8402[_0xf474('0x29')]===_0x30c1b4;});if(_0x10684f){logger[_0xf474('0x2a')](_0xf474('0x2b'),_0x30c1b4);return BPromise[_0xf474('0x2c')]({'id':_0x10684f['Id'],'name':_0x10684f['Name']});}}else{logger[_0xf474('0x2a')](_0xf474('0x2d'),_0x30c1b4);return _0x2a042b[_0xf474('0x2e')]()[_0xf474('0x27')](function(_0x52b7b3){return BPromise[_0xf474('0x2c')]({'id':_0x52b7b3[_0xf474('0x2f')],'name':_0x52b7b3[_0xf474('0x30')]});});}});}else{logger['info'](_0xf474('0x2d'),_0x30c1b4);return _0x2a042b[_0xf474('0x2e')]()[_0xf474('0x27')](function(_0x4f314e){return BPromise['resolve']({'id':_0x4f314e[_0xf474('0x2f')],'name':_0x4f314e[_0xf474('0x30')]});});}}function getEndUser(_0x2f0e83,_0x4012e2,_0x71bc71,_0x21776b,_0x808e55){var _0x20f694={'$or':{'Phone':_0x21776b}};var _0x4339a1={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()['then'](function(){logger[_0xf474('0x2a')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x21776b,_0x4012e2[_0xf474('0x31')]);switch(_0x4012e2['moduleSearch']){case _0xf474('0x32'):var _0x2562f3=_[_0xf474('0x33')](_0x20f694);if(_0x4012e2[_0xf474('0x34')]){var _0x5dca31={};_0x5dca31[_0x4012e2['additionalSearchContact']]=_0x21776b;_[_0xf474('0x35')](_0x2562f3['$or'],_0x5dca31);}return _0x808e55[_0xf474('0x23')](_0xf474('0x36'))[_0xf474('0x25')](_0x2562f3,_0x4339a1)[_0xf474('0x26')]()['then'](function(_0x3e9e1b){if(_0x3e9e1b&&_0x3e9e1b[_0xf474('0x28')]){return _0x3e9e1b;}else{var _0x891e5a=_[_0xf474('0x33')](_0x20f694);if(_0x4012e2[_0xf474('0x37')]){var _0x2475f5={};_0x2475f5[_0x4012e2[_0xf474('0x37')]]=_0x21776b;_['merge'](_0x891e5a[_0xf474('0x38')],_0x2475f5);}return _0x808e55['sobject'](_0xf474('0x39'))[_0xf474('0x25')](_0x891e5a,_0x4339a1);}});case'account_contact_lead':var _0x3307b9=_[_0xf474('0x33')](_0x20f694);if(_0x4012e2[_0xf474('0x3a')]){var _0x5dca31={};_0x5dca31[_0x4012e2[_0xf474('0x3a')]]=_0x21776b;_[_0xf474('0x35')](_0x3307b9['$or'],_0x5dca31);}return _0x808e55[_0xf474('0x23')](_0xf474('0x3b'))[_0xf474('0x25')](_0x3307b9,_0x4339a1)[_0xf474('0x26')]()[_0xf474('0x27')](function(_0x4d3985){if(_0x4d3985&&_0x4d3985[_0xf474('0x28')]){return _0x4d3985;}else{var _0x1d7715=_[_0xf474('0x33')](_0x20f694);if(_0x4012e2['additionalSearchContact']){var _0x1908a6={};_0x1908a6[_0x4012e2[_0xf474('0x34')]]=_0x21776b;_[_0xf474('0x35')](_0x1d7715[_0xf474('0x38')],_0x1908a6);}return _0x808e55[_0xf474('0x23')](_0xf474('0x36'))[_0xf474('0x25')](_0x1d7715,_0x4339a1)[_0xf474('0x27')](function(_0x5f2bba){if(_0x5f2bba&&_0x5f2bba['length']){return _0x5f2bba;}else{var _0x4f12c5=_[_0xf474('0x33')](_0x20f694);if(_0x4012e2['additionalSearchLead']){var _0x18c554={};_0x18c554[_0x4012e2[_0xf474('0x37')]]=_0x21776b;_[_0xf474('0x35')](_0x4f12c5[_0xf474('0x38')],_0x18c554);}return _0x808e55[_0xf474('0x23')](_0xf474('0x39'))[_0xf474('0x25')](_0x4f12c5,_0x4339a1);}});}});case'contact':var _0x2562f3=_[_0xf474('0x33')](_0x20f694);if(_0x4012e2[_0xf474('0x34')]){var _0x5dca31={};_0x5dca31[_0x4012e2[_0xf474('0x34')]]=_0x21776b;_[_0xf474('0x35')](_0x2562f3['$or'],_0x5dca31);}return _0x808e55[_0xf474('0x23')](_0xf474('0x36'))['find'](_0x2562f3,_0x4339a1)[_0xf474('0x26')]();case _0xf474('0x17'):var _0x420612=_['cloneDeep'](_0x20f694);if(_0x4012e2['additionalSearchLead']){var _0x5dca31={};_0x5dca31[_0x4012e2['additionalSearchLead']]=_0x21776b;_[_0xf474('0x35')](_0x420612[_0xf474('0x38')],_0x5dca31);}return _0x808e55[_0xf474('0x23')](_0xf474('0x39'))[_0xf474('0x25')](_0x420612,_0x4339a1);case'account':var _0x3307b9=_['cloneDeep'](_0x20f694);if(_0x4012e2[_0xf474('0x3a')]){var _0x5dca31={};_0x5dca31[_0x4012e2[_0xf474('0x3a')]]=_0x21776b;_['merge'](_0x3307b9[_0xf474('0x38')],_0x5dca31);}return _0x808e55['sobject'](_0xf474('0x3b'))[_0xf474('0x25')](_0x3307b9,_0x4339a1);default:return null;}})[_0xf474('0x27')](function(_0x38fa64){if(_0x38fa64&&_0x38fa64['length']){var _0x293bf8=_[_0xf474('0x3c')](_0x38fa64);if(_0x293bf8){return BPromise[_0xf474('0x2c')]({'id':_0x293bf8['Id'],'name':_0x293bf8[_0xf474('0x3d')],'phone':_0x293bf8[_0xf474('0x3e')],'endUserType':_0x293bf8[_0xf474('0x3f')][_0xf474('0x40')]['toLowerCase']()});}}})[_0xf474('0x27')](function(_0x2480cd){if(_0x2480cd){logger[_0xf474('0x2a')](_0xf474('0x41'),_0x2480cd['endUserType'],_0x21776b);return BPromise[_0xf474('0x2c')](_0x2480cd);}else{logger[_0xf474('0x2a')](_0xf474('0x42'),_0x21776b);var _0x20ac22={'Phone':_0x21776b};if(_0x4012e2[_0xf474('0x43')]){if(_0x4012e2[_0xf474('0x43')]===_0xf474('0x1c')){logger[_0xf474('0x2a')](_0xf474('0x44'),_0x21776b,_0x4012e2[_0xf474('0x43')]);_0x20ac22['LastName']=_0x71bc71!==_0xf474('0x45')?_0x71bc71:util[_0xf474('0x46')](_0xf474('0x47'),_0x21776b);}else if(_0x4012e2[_0xf474('0x43')]===_0xf474('0x17')){logger[_0xf474('0x2a')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x21776b,_0x4012e2[_0xf474('0x43')]);_0x20ac22[_0xf474('0x48')]=_0x71bc71!==_0xf474('0x45')?_0x71bc71:util[_0xf474('0x46')](_0xf474('0x47'),_0x21776b);_0x20ac22[_0xf474('0x49')]=_0xf474('0x4a');}else if(_0x4012e2[_0xf474('0x43')]===_0xf474('0x19')){logger[_0xf474('0x2a')](_0xf474('0x44'),_0x21776b,_0x4012e2[_0xf474('0x43')]);_0x20ac22['Name']=_0x71bc71!==_0xf474('0x45')?_0x71bc71:util[_0xf474('0x46')](_0xf474('0x47'),_0x21776b);}else{return null;}}return _0x808e55[_0xf474('0x23')](_['upperFirst'](_0x4012e2[_0xf474('0x43')]))['create'](_0x20ac22)[_0xf474('0x27')](function(_0x5226cc){return BPromise[_0xf474('0x2c')]({'id':_0x5226cc['id'],'endUserType':_0x4012e2[_0xf474('0x43')]});});}});}function getCustomFields(_0x1be7b5,_0xc8e37d){var _0x2f3010={};if(_0x1be7b5[_0xf474('0x28')]>0x0){_[_0xf474('0x4b')](_0x1be7b5,function(_0x2d62d3){if(_[_0xf474('0x4c')]([_0xf474('0x4d'),_0xf474('0x4e')],_0x2d62d3[_0xf474('0x40')])&&_0x2d62d3['idField']){_0x2f3010[_0x2d62d3[_0xf474('0x4f')]]=_0x2d62d3[_0xf474('0x50')]['toString']();}else if(_0x2d62d3[_0xf474('0x40')]===_0xf474('0x51')&&_0x2d62d3[_0xf474('0x52')]&&_0x2d62d3[_0xf474('0x4f')]){_0xc8e37d[_0x2d62d3['variableName']]&&(_0x2f3010[_0x2d62d3[_0xf474('0x4f')]]=_0xc8e37d[_0x2d62d3[_0xf474('0x52')]]['toString']());}else if(_0x2d62d3[_0xf474('0x40')]===_0xf474('0x53')&&_0x2d62d3[_0xf474('0x54')]&&_0x2d62d3[_0xf474('0x54')][_0xf474('0x55')]&&_0x2d62d3[_0xf474('0x4f')]){_0xc8e37d[_0x2d62d3[_0xf474('0x54')]['name'][_0xf474('0x56')]()]&&(_0x2f3010[_0x2d62d3['idField']]=_0xc8e37d[_0x2d62d3['Variable'][_0xf474('0x55')][_0xf474('0x56')]()][_0xf474('0x57')]());}});}return _0x2f3010;}function getConnection(_0x298308){var _0x44697f=_0x298308[_0xf474('0x58')]['concat'](_0x298308['securityToken']);var _0x580798=new jsforce['Connection']({'oauth2':{'loginUrl':_0x298308[_0xf474('0x59')]||_0xf474('0x5a'),'clientId':_0x298308[_0xf474('0x5b')],'clientSecret':_0x298308[_0xf474('0x5c')]}});return _0x580798[_0xf474('0x5d')](_0x298308[_0xf474('0x5e')],_0x44697f)[_0xf474('0x27')](function(){logger[_0xf474('0x2a')]('Connection\x20established.');return _0x580798;});}exports['queue']=function(_0x118e40,_0x18198f,_0x5bd200,_0x44e833,_0x1bfa54,_0x107221){var _0x463f3,_0x3c16c7,_0x29689e,_0x1ed8c1;_0x107221[_0xf474('0x5f')]=intUtil[_0xf474('0x60')](_0x107221[_0xf474('0x5f')]);_0x107221['remoteUri']=intUtil[_0xf474('0x60')](_0x107221[_0xf474('0x59')]);if(_0x1bfa54&&_0x1bfa54[_0xf474('0x61')]){logger[_0xf474('0x2a')]('[QUEUE]','Recording\x20is\x20enabled!');_0x18198f['recordingURL']=util[_0xf474('0x46')](_0xf474('0x62'),_0x107221[_0xf474('0x5f')],_0x18198f[_0xf474('0x63')],md5(_0x18198f['uniqueid']));}else{_0x18198f['recordingURL']='';}return getConnection(_0x107221)[_0xf474('0x27')](function(_0x9d1db9){_0x1ed8c1=_0x9d1db9;return getUser(_0x107221,_0x44e833['email'],_0x1ed8c1);})[_0xf474('0x27')](function(_0x51d1d2){_0x463f3=_0x51d1d2;return getEndUser(_0x107221,_0x5bd200,_0x18198f['calleridname'],_0x18198f[_0xf474('0x64')],_0x1ed8c1);})[_0xf474('0x27')](function(_0x169ee3){_0x3c16c7=_0x169ee3;return getTicket(_0x107221,_0x463f3,_0x3c16c7,_0x5bd200,_0x18198f,_0x5bd200[_0xf474('0x65')],_0x1ed8c1,_0xf474('0x66'));})[_0xf474('0x27')](function(_0x2a6721){_0x29689e=_0x2a6721;logger[_0xf474('0x2a')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x29689e['id']);logger[_0xf474('0x2a')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x29689e['id'],_0x44e833['name'],_0x107221[_0xf474('0x40')]);switch(_0x107221['type']){case'integrationTab':emit(util['format'](_0xf474('0x67'),_0x44e833['name']),'trigger:salesforce:display',{'recordId':_0x29689e['id']});break;case'newTab':emit(util[_0xf474('0x46')](_0xf474('0x67'),_0x44e833[_0xf474('0x55')]),_0xf474('0x68'),{'uri':util[_0xf474('0x46')](_0xf474('0x69'),_0x1ed8c1[_0xf474('0x6a')],_0x29689e['id'])});break;default:logger[_0xf474('0x6b')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})['catch'](function(_0xd8371){logger['error'](_0xf474('0x6c'),_0xd8371);});};exports[_0xf474('0x6d')]=function(_0x14a532,_0x48d340,_0x576713,_0x198810,_0x4c6609,_0x5e6257,_0x25cda0){var _0x2f8e24,_0xcca509,_0x53b7dc,_0x259579;_0x5e6257[_0xf474('0x5f')]=intUtil[_0xf474('0x60')](_0x5e6257[_0xf474('0x5f')]);_0x5e6257[_0xf474('0x59')]=intUtil[_0xf474('0x60')](_0x5e6257[_0xf474('0x59')]);if(_0x25cda0&&_0x25cda0[_0xf474('0x6e')]&&_0x25cda0[_0xf474('0x6e')]!==_0xf474('0x6f')){logger[_0xf474('0x2a')]('[OUTBOUND]',_0xf474('0x70'));_0x48d340[_0xf474('0x71')]=util[_0xf474('0x46')](_0xf474('0x62'),_0x5e6257[_0xf474('0x5f')],_0x48d340[_0xf474('0x63')],md5(_0x48d340['uniqueid']));}return getConnection(_0x5e6257)['then'](function(_0x30698d){_0x259579=_0x30698d;return getUser(_0x5e6257,_0x198810[_0xf474('0x72')],_0x259579);})[_0xf474('0x27')](function(_0x2f077a){_0x2f8e24=_0x2f077a;return getEndUser(_0x5e6257,_0x576713,_0x48d340[_0xf474('0x73')],_0x48d340[_0xf474('0x74')],_0x259579);})[_0xf474('0x27')](function(_0x26590f){_0xcca509=_0x26590f;return getTicket(_0x5e6257,_0x2f8e24,_0xcca509,_0x576713,_0x48d340,_0x576713[_0xf474('0x65')],_0x259579,_0xf474('0x6d'));})[_0xf474('0x27')](function(_0x415e4f){_0x53b7dc=_0x415e4f;logger[_0xf474('0x2a')](_0xf474('0x75'),_0x53b7dc['id']);logger[_0xf474('0x2a')](_0xf474('0x76'),_0x53b7dc['id'],_0x198810[_0xf474('0x55')],_0x5e6257[_0xf474('0x40')]);switch(_0x5e6257[_0xf474('0x40')]){case _0xf474('0x77'):emit(util[_0xf474('0x46')](_0xf474('0x67'),_0x198810[_0xf474('0x55')]),_0xf474('0x78'),{'recordId':_0x53b7dc['id']});break;case _0xf474('0x79'):emit(util[_0xf474('0x46')](_0xf474('0x67'),_0x198810[_0xf474('0x55')]),_0xf474('0x68'),{'uri':util[_0xf474('0x46')]('%s/%s/e',_0x259579[_0xf474('0x6a')],_0x53b7dc['id'])});break;default:logger[_0xf474('0x6b')](_0xf474('0x7a'),_0xf474('0x7b'));}})[_0xf474('0x7c')](function(_0x41548b){logger[_0xf474('0x6b')](_0xf474('0x7a'),_0x41548b);});};exports[_0xf474('0x7d')]=function(_0x5c256b,_0x2eb81b,_0x4a95f7,_0x857c0a,_0x5f243d,_0x2de15b){var _0x1fa69e,_0x5f5289,_0x4c5c2c,_0x5b3173;_0x2de15b[_0xf474('0x5f')]=intUtil[_0xf474('0x60')](_0x2de15b[_0xf474('0x5f')]);_0x2de15b[_0xf474('0x59')]=intUtil[_0xf474('0x60')](_0x2de15b[_0xf474('0x59')]);if(_0x5f243d&&_0x5f243d[_0xf474('0x61')]){logger['info']('['+_0x2eb81b[_0xf474('0x7e')][_0xf474('0x7f')]()+']',_0xf474('0x70'));_0x2eb81b[_0xf474('0x71')]=util[_0xf474('0x46')](_0xf474('0x62'),_0x2de15b[_0xf474('0x5f')],_0x2eb81b[_0xf474('0x63')],md5(_0x2eb81b[_0xf474('0x63')]));}else{_0x2eb81b['recordingURL']='';}return getConnection(_0x2de15b)[_0xf474('0x27')](function(_0xb802e){_0x5b3173=_0xb802e;if(!_[_0xf474('0x21')](_0x857c0a)){return getUser(_0x2de15b,_0x857c0a[_0xf474('0x55')],_0x5b3173);}else{return getUser(_0x2de15b,null,_0x5b3173);}})['then'](function(_0x297656){_0x1fa69e=_0x297656;return getEndUser(_0x2de15b,_0x4a95f7,_0x2eb81b[_0xf474('0x80')],_0x2eb81b['calleridnum'],_0x5b3173);})['then'](function(_0x1c98ae){_0x5f5289=_0x1c98ae;return getTicket(_0x2de15b,_0x1fa69e,_0x5f5289,_0x4a95f7,_0x2eb81b,_0x4a95f7[_0xf474('0x65')],_0x5b3173);})[_0xf474('0x27')](function(_0xb2a0a4){_0x4c5c2c=_0xb2a0a4;logger[_0xf474('0x2a')]('['+_0x2eb81b[_0xf474('0x7e')][_0xf474('0x7f')]()+_0xf474('0x81'),_0x4c5c2c['id']);logger[_0xf474('0x2a')]('['+_0x2eb81b[_0xf474('0x7e')][_0xf474('0x7f')]()+_0xf474('0x82'),_0x2de15b['type']);})['catch'](function(_0x4c5489){logger[_0xf474('0x6b')]('['+_0x2eb81b[_0xf474('0x7e')]['toUpperCase']()+']',_0x4c5489);});};
\ No newline at end of file
index a7ba7a5..2cf1db9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff43=['sys_user?sysparm_query=user_name%3Dadmin','then','result','length','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','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','adminId','POST','sys_user?','endUserNumber','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','forEach','includes','string','picklist','type','customField','nameField','toLowerCase','idField','content','variable','variableName','toString','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','getString','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','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','trigger:browser:url','username','sysparm_limit=1','remoteUri','serverUrl','stripTrailingSlash','format','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','uniqueid','monitor_format','[QUEUE]','recordingURL','none','Recording\x20is\x20enabled!','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xff43,0x13d));var _0x3ff4=function(_0xf03c6d,_0x49a4b8){_0xf03c6d=_0xf03c6d-0x0;var _0x3bb83d=_0xff43[_0xf03c6d];return _0x3bb83d;};'use strict';var _=require('lodash');var Promise=require(_0x3ff4('0x0'));var rp=require(_0x3ff4('0x1'));var util=require(_0x3ff4('0x2'));var md5=require(_0x3ff4('0x3'));var Redis=require(_0x3ff4('0x4'));var intUtil=require(_0x3ff4('0x5'));var config=require(_0x3ff4('0x6'));var logger=require(_0x3ff4('0x7'))('servicenow');config[_0x3ff4('0x8')]=_[_0x3ff4('0x9')](config[_0x3ff4('0x8')],{'host':_0x3ff4('0xa'),'port':0x18eb});var io=require(_0x3ff4('0xb'))(new Redis(config['redis']));function getAdminUser(_0x4202ab,_0x4d0f2c,_0x413435,_0x4d03ae,_0x50d655,_0x30c3e7){return new Promise(function(_0x2c60da,_0x193706){var _0x2ebdbb={'method':_0x3ff4('0xc'),'uri':_0x4d03ae+_0x3ff4('0xd')+'&'+_0x50d655+'&'+_0x30c3e7,'auth':_0x4d0f2c,'json':!![]};return rp(_0x2ebdbb)[_0x3ff4('0xe')](function(_0x47f1d8){if(_0x47f1d8[_0x3ff4('0xf')][_0x3ff4('0x10')]>0x0){_0x413435['adminId']=_0x47f1d8[_0x3ff4('0xf')][0x0][_0x3ff4('0x11')];}logger[_0x3ff4('0x12')]('['+[_0x4202ab[_0x3ff4('0x13')]()]+_0x3ff4('0x14'),_0x413435);_0x2c60da(_0x413435);})[_0x3ff4('0x15')](function(_0x26e123){logger[_0x3ff4('0x16')]('['+[_0x4202ab[_0x3ff4('0x13')]()]+']',_0x26e123[_0x3ff4('0x17')]);_0x193706(_0x26e123[_0x3ff4('0x17')]);});});}function getUser(_0x2723a5,_0x44da26,_0x2b81e9,_0x31842e,_0x98b4f6){return function(_0x5b5f96){logger[_0x3ff4('0x12')]('['+[_0x2723a5[_0x3ff4('0x13')]()]+_0x3ff4('0x18'),_0x5b5f96);return new Promise(function(_0x87d6e2,_0x3ab795){if(intUtil[_0x3ff4('0x19')](_0x5b5f96[_0x3ff4('0x1a')])){var _0x3014c0={'method':_0x3ff4('0xc'),'uri':_0x2b81e9+_0x3ff4('0x1b')+_0x5b5f96[_0x3ff4('0x1a')]+'&'+_0x31842e+'&'+_0x98b4f6,'auth':_0x44da26,'json':!![]};logger[_0x3ff4('0x12')]('['+[_0x2723a5[_0x3ff4('0x13')]()]+_0x3ff4('0x1c'),_0x3014c0);return rp(_0x3014c0)[_0x3ff4('0xe')](function(_0x52c084){logger[_0x3ff4('0x12')]('['+[_0x2723a5[_0x3ff4('0x13')]()]+_0x3ff4('0x1d'),_0x52c084);if(_0x52c084['result'][_0x3ff4('0x10')]>0x0&&String(_0x52c084[_0x3ff4('0xf')][0x0]['active'])===_0x3ff4('0x1e')){_0x5b5f96[_0x3ff4('0x1f')]=_0x52c084[_0x3ff4('0xf')][0x0][_0x3ff4('0x11')];}else{_0x5b5f96[_0x3ff4('0x1f')]=_0x5b5f96['adminId'];_0x5b5f96[_0x3ff4('0x1a')]=_0x5b5f96[_0x3ff4('0x20')];}logger[_0x3ff4('0x12')]('['+[_0x2723a5[_0x3ff4('0x13')]()]+_0x3ff4('0x21'),_0x5b5f96);_0x87d6e2(_0x5b5f96);})[_0x3ff4('0x15')](function(_0x46c185){logger[_0x3ff4('0x16')]('['+[_0x2723a5['toUpperCase']()]+']',_0x46c185[_0x3ff4('0x17')]);_0x3ab795(_0x46c185['message']);});}else{logger[_0x3ff4('0x12')]('['+[_0x2723a5[_0x3ff4('0x13')]()]+_0x3ff4('0x22'));_0x5b5f96[_0x3ff4('0x1f')]=_0x5b5f96[_0x3ff4('0x23')];_0x5b5f96[_0x3ff4('0x1a')]=_0x5b5f96[_0x3ff4('0x20')];_0x87d6e2(_0x5b5f96);}});};}function createEndUser(_0x3aca8a,_0x3c2c13,_0x455c62,_0x548a33,_0x14e7b9){logger[_0x3ff4('0x12')]('['+[_0x3aca8a[_0x3ff4('0x13')]()]+'],\x20createEndUser\x20input\x20crm',_0x455c62);return new Promise(function(_0x19661a,_0x2a9c04){var _0x354d55={'method':_0x3ff4('0x24'),'uri':_0x548a33+_0x3ff4('0x25')+_0x14e7b9,'body':{'user_name':_0x455c62[_0x3ff4('0x26')],'roles':'user','first_name':_0x455c62['endUserNumber'],'active':_0x3ff4('0x1e'),'date_format':_0x3ff4('0x27'),'phone':_0x455c62[_0x3ff4('0x26')]},'auth':_0x3c2c13,'json':!![]};return rp(_0x354d55)[_0x3ff4('0xe')](function(_0x31546e){logger['info']('['+[_0x3aca8a['toUpperCase']()]+_0x3ff4('0x28'),_0x31546e[_0x3ff4('0xf')]);_0x455c62[_0x3ff4('0x29')]=_0x31546e[_0x3ff4('0xf')]['sys_id'];_0x19661a(_0x455c62);})[_0x3ff4('0x15')](function(_0x2404da){logger[_0x3ff4('0x16')]('['+[_0x3aca8a[_0x3ff4('0x13')]()]+']',_0x2404da['message']);_0x2a9c04(_0x2404da['message']);});});}function getEndUser(_0x3c1df3,_0x5d41af,_0xb1b178,_0x288fde,_0x4d9380){return function(_0x2b31da){logger[_0x3ff4('0x12')]('['+[_0x3c1df3[_0x3ff4('0x13')]()]+_0x3ff4('0x2a'),_0x2b31da);return new Promise(function(_0xc4abcc,_0x6d300c){var _0x38134={'method':_0x3ff4('0xc'),'uri':_0xb1b178+_0x3ff4('0x2b')+_0x2b31da['endUserNumber']+'&'+_0x288fde+'&'+_0x4d9380,'auth':_0x5d41af,'json':!![]};return rp(_0x38134)[_0x3ff4('0xe')](function(_0x21346a){if(_0x21346a[_0x3ff4('0xf')][_0x3ff4('0x10')]>0x0){_0x2b31da[_0x3ff4('0x29')]=_0x21346a[_0x3ff4('0xf')][0x0][_0x3ff4('0x11')];logger['info']('['+[_0x3c1df3[_0x3ff4('0x13')]()]+_0x3ff4('0x2c'),_0x2b31da);_0xc4abcc(_0x2b31da);}else{return createEndUser(_0x3c1df3,_0x5d41af,_0x2b31da,_0xb1b178,_0x288fde)[_0x3ff4('0xe')](function(_0x4d54c8){logger['info']('['+[_0x3c1df3[_0x3ff4('0x13')]()]+'],\x20createEndUser\x20crm',_0x4d54c8);_0xc4abcc(_0x4d54c8);});}})[_0x3ff4('0x15')](function(_0x4e9da0){logger[_0x3ff4('0x16')]('['+[_0x3c1df3[_0x3ff4('0x13')]()]+']',_0x4e9da0['message']);_0x6d300c(_0x4e9da0['message']);});});};}function getCustomFields(_0x1d15b7,_0x351432){var _0x57bfc9={};if(_0x1d15b7[_0x3ff4('0x10')]>0x0){_[_0x3ff4('0x2d')](_0x1d15b7,function(_0x102e99){if(_[_0x3ff4('0x2e')]([_0x3ff4('0x2f'),_0x3ff4('0x30')],_0x102e99[_0x3ff4('0x31')])&&_0x102e99['nameField']&&!_0x102e99[_0x3ff4('0x32')]){_0x57bfc9[_0x102e99[_0x3ff4('0x33')][_0x3ff4('0x34')]()]=_0x102e99['content']['toString']();}else if(_[_0x3ff4('0x2e')](['string',_0x3ff4('0x30')],_0x102e99[_0x3ff4('0x31')])&&_0x102e99[_0x3ff4('0x35')]&&_0x102e99[_0x3ff4('0x32')]){_0x57bfc9[_0x102e99[_0x3ff4('0x35')][_0x3ff4('0x34')]()]=_0x102e99[_0x3ff4('0x36')]['toString']();}else if(_0x102e99['type']===_0x3ff4('0x37')&&_0x102e99[_0x3ff4('0x38')]&&_0x102e99['idField']&&_0x102e99['customField']){_0x57bfc9[_0x102e99[_0x3ff4('0x35')][_0x3ff4('0x34')]()]=_0x351432[_0x102e99[_0x3ff4('0x38')]][_0x3ff4('0x39')]();}else if(_0x102e99[_0x3ff4('0x31')]===_0x3ff4('0x3a')&&_0x102e99[_0x3ff4('0x3b')]&&_0x102e99['Variable']['name']&&_0x102e99[_0x3ff4('0x35')]&&_0x102e99[_0x3ff4('0x32')]){_0x57bfc9[_0x102e99['idField'][_0x3ff4('0x34')]()]=_0x351432[_0x102e99[_0x3ff4('0x3b')][_0x3ff4('0x3c')][_0x3ff4('0x34')]()][_0x3ff4('0x39')]();}});}return _0x57bfc9;}function getTicket(_0x372fab,_0x535c4f,_0x113395,_0x1c218b,_0x5b8dc4,_0x46d012){return function(_0x35f5ae){logger[_0x3ff4('0x12')]('['+[_0x372fab[_0x3ff4('0x13')]()]+_0x3ff4('0x3d'),_0x35f5ae);return new Promise(function(_0x68331a,_0x472742){var _0x467839=_0x372fab[_0x3ff4('0x34')]()===_0x3ff4('0x3e')?_0x35f5ae[_0x3ff4('0x1f')]:_0x35f5ae['endUserId'];var _0x34120d={'method':_0x3ff4('0x24'),'uri':_0x113395+_0x3ff4('0x3f')+'?'+_0x46d012,'body':Object['assign']({},{'active':_0x3ff4('0x1e'),'caller_id':_0x467839,'assigned_to':_0x35f5ae[_0x3ff4('0x1f')],'short_description':intUtil[_0x3ff4('0x40')](_0x1c218b['Subjects'],_0x5b8dc4,'\x20'),'description':intUtil[_0x3ff4('0x40')](_0x1c218b[_0x3ff4('0x41')],_0x5b8dc4,'\x0a')},getCustomFields(_0x1c218b[_0x3ff4('0x42')],_0x5b8dc4)),'auth':_0x535c4f,'json':!![]};return rp(_0x34120d)[_0x3ff4('0xe')](function(_0x18d943){logger['info']('['+[_0x372fab[_0x3ff4('0x13')]()]+_0x3ff4('0x43'),_0x18d943[_0x3ff4('0xf')]);_0x35f5ae[_0x3ff4('0x44')]=_0x18d943['result'][_0x3ff4('0x11')];_0x35f5ae[_0x3ff4('0x45')]=_0x18d943['result'][_0x3ff4('0x46')];logger['info']('['+[_0x372fab[_0x3ff4('0x13')]()]+']\x20getTicket\x20crm',_0x35f5ae);_0x68331a(_0x35f5ae);})['catch'](function(_0x146130){logger[_0x3ff4('0x16')]('['+[_0x372fab['toUpperCase']()]+']',_0x146130[_0x3ff4('0x17')]);_0x472742(_0x146130['message']);});});};}function createRemoteTag(_0x5c0112,_0x1e1e49,_0x508e7c,_0x3caad8){return new Promise(function(_0x421140,_0x33e612){var _0x4eb283={'method':'POST','uri':_0x508e7c+'label'+'?'+_0x3caad8,'body':{'short_description':_0x5c0112,'global':!![],'active':!![],'name':_0x5c0112},'auth':_0x1e1e49,'json':!![]};return rp(_0x4eb283)[_0x3ff4('0xe')](function(_0x23af30){var _0x1807e1=_0x23af30[_0x3ff4('0xf')][_0x3ff4('0x11')];_0x421140(_0x1807e1);});});}function getRemoteTag(_0x2cb927,_0x58f23d,_0x1a06eb,_0x1f0142,_0x3546cf){return new Promise(function(_0x44f35b,_0x1f0d04){var _0x22615a={'method':_0x3ff4('0xc'),'uri':_0x1a06eb+_0x3ff4('0x47')+_0x3ff4('0x48')+_0x2cb927+'&'+_0x1f0142,'auth':_0x58f23d,'json':!![]};return rp(_0x22615a)['then'](function(_0x30a885){if(_0x30a885[_0x3ff4('0xf')][_0x3ff4('0x10')]>0x0){var _0x1978fe=_0x30a885[_0x3ff4('0xf')][0x0][_0x3ff4('0x11')];_0x44f35b(_0x1978fe);}else{return createRemoteTag(_0x2cb927,_0x58f23d,_0x1a06eb,_0x1f0142)[_0x3ff4('0xe')](function(_0x2770fd){_0x44f35b(_0x2770fd);});}});});}function assignTagToIncident(_0x1f375a,_0x361968,_0x114b16,_0x1a3aac,_0x578994){return new Promise(function(_0x43f4b8,_0x741cbe){var _0x430009={'method':'POST','uri':_0x114b16+_0x3ff4('0x49')+'?'+_0x578994,'body':{'label':_0x1f375a,'table':'incident','id_type':'Incident','table_key':_0x1a3aac[_0x3ff4('0x44')],'title':_0x3ff4('0x4a')+_0x1a3aac[_0x3ff4('0x45')],'id_display':_0x1a3aac[_0x3ff4('0x45')]},'auth':_0x361968,'json':!![]};return rp(_0x430009)[_0x3ff4('0xe')](function(_0x301cf0){_0x43f4b8();})[_0x3ff4('0x15')](function(){_0x43f4b8();});});}function manageTags(_0xd663e2,_0x4a5c2a,_0x45ff47,_0x57e413,_0x137433,_0x1ce7a4,_0x1332c5){return new Promise(function(_0x1fbdec,_0x5d2afb){var _0x1ce2a8=[];_0x4a5c2a['forEach'](function(_0xf20a41){_0x1ce2a8[_0x3ff4('0x4b')](getRemoteTag(_0xf20a41,_0x45ff47,_0x57e413,_0x1ce7a4,_0x1332c5));});return Promise[_0x3ff4('0x4c')](_0x1ce2a8)[_0x3ff4('0xe')](function(_0x13fe9d){if(_0x13fe9d[_0x3ff4('0x10')]){logger[_0x3ff4('0x12')]('['+[_0xd663e2[_0x3ff4('0x13')]()]+_0x3ff4('0x4d'),_0x13fe9d);var _0x57b0dc=[];_0x13fe9d[_0x3ff4('0x2d')](function(_0xa14439){_0x57b0dc['push'](assignTagToIncident(_0xa14439,_0x45ff47,_0x57e413,_0x137433,_0x1ce7a4));});return Promise[_0x3ff4('0x4c')](_0x57b0dc)[_0x3ff4('0xe')](function(){_0x1fbdec();})[_0x3ff4('0x15')](function(){_0x1fbdec();});}else{_0x1fbdec();}});});}function getTags(_0x3f9638,_0x4b8c38,_0x1433e0,_0x2d1306,_0x682ab0,_0x2cee7d){return function(_0x32a935){return new Promise(function(_0x22ed9a,_0x53c56a){var _0x5226ed=[];var _0x12361a=_0x2d1306[_0x3ff4('0x4e')];if(_0x12361a&&_0x12361a['length']>0x0){_0x5226ed=_[_0x3ff4('0x4f')](_0x12361a,_0x3ff4('0x3c'));}if(_0x5226ed[_0x3ff4('0x10')]>0x0){return manageTags(_0x3f9638,_0x5226ed,_0x4b8c38,_0x1433e0,_0x32a935,_0x682ab0,_0x2cee7d)['then'](function(){_0x22ed9a(_0x32a935);});}else{_0x22ed9a(_0x32a935);}});};}function emit(_0x2bac5e,_0x4bdeb0,_0x509de3){var _0x1fb9d9=_0x3ff4('0x50')+_0x3ff4('0x51')+_0x3ff4('0x52')+'%255EORDERBYDESCnumber';var _0x576fa3={'uri':_0x2bac5e+_0x3ff4('0x53')+_0x509de3+_0x1fb9d9};io['to'](util['format'](_0x3ff4('0x54'),_0x4bdeb0))['emit'](_0x3ff4('0x55'),_0x576fa3);}exports['cs']=function(_0x240d7e,_0x3ed7c0,_0x26208a,_0x775a3a,_0xc370a3,_0x5a8893,_0x31c935,_0x284a30){var _0x23d9f9={};var _0x219d47={'user':_0x5a8893[_0x3ff4('0x56')],'pass':_0x5a8893['password']};var _0x57b27b=_0x3ff4('0x57');var _0x16141f='sysparm_display_value=true';_0x5a8893[_0x3ff4('0x58')]=intUtil['stripTrailingSlash'](_0x5a8893[_0x3ff4('0x58')]);_0x5a8893[_0x3ff4('0x59')]=intUtil[_0x3ff4('0x5a')](_0x5a8893[_0x3ff4('0x59')]);var _0x33cc34=util[_0x3ff4('0x5b')](_0x3ff4('0x5c'),_0x5a8893[_0x3ff4('0x58')]);_0x23d9f9[_0x3ff4('0x1a')]=!_[_0x3ff4('0x5d')](_0x775a3a)?_0x775a3a[_0x3ff4('0x5e')]:null;_0x23d9f9[_0x3ff4('0x20')]=_0x5a8893[_0x3ff4('0x5e')];_0x23d9f9[_0x3ff4('0x26')]=_0x284a30[_0x3ff4('0x34')]()===_0x3ff4('0x3e')?_0x3ed7c0[_0x3ff4('0x5f')]:_0x3ed7c0[_0x3ff4('0x60')];_0x23d9f9[_0x3ff4('0x61')]=_0x284a30==='queue'||_0x284a30==='unmanaged'?_0x3ff4('0x62'):_0x3ff4('0x3e');var _0x2dad21=util[_0x3ff4('0x5b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5a8893[_0x3ff4('0x59')],_0x3ed7c0[_0x3ff4('0x63')],md5(_0x3ed7c0['uniqueid']));if(_0xc370a3&&_0xc370a3[_0x3ff4('0x64')]){logger[_0x3ff4('0x12')](_0x3ff4('0x65'),'Recording\x20is\x20enabled!');_0x3ed7c0[_0x3ff4('0x66')]=_0x2dad21;}else if(_0x31c935&&_0x31c935['recordingFormat']&&_0x31c935['recordingFormat']!==_0x3ff4('0x67')){logger[_0x3ff4('0x12')]('[OUTBOUND]',_0x3ff4('0x68'));_0x3ed7c0[_0x3ff4('0x66')]=_0x2dad21;}else{_0x3ed7c0['recordingURL']='';}return getAdminUser(_0x284a30,_0x219d47,_0x23d9f9,_0x33cc34,_0x16141f,_0x57b27b)[_0x3ff4('0xe')](getUser(_0x284a30,_0x219d47,_0x33cc34,_0x16141f,_0x57b27b))[_0x3ff4('0xe')](getEndUser(_0x284a30,_0x219d47,_0x33cc34,_0x16141f,_0x57b27b))[_0x3ff4('0xe')](getTicket(_0x284a30,_0x219d47,_0x33cc34,_0x26208a,_0x3ed7c0,_0x16141f))['then'](function(_0x47db6e){logger[_0x3ff4('0x12')](util[_0x3ff4('0x5b')]('The\x20ticket\x20ID\x20is:\x20%s',_0x47db6e['ticketId']));logger[_0x3ff4('0x12')](util['format'](_0x3ff4('0x69'),_0x284a30));if(_0x284a30!==_0x3ff4('0x6a')){logger[_0x3ff4('0x12')]('['+[_0x284a30[_0x3ff4('0x13')]()]+']',_0x3ff4('0x6b'));emit(_0x5a8893[_0x3ff4('0x58')],_0x775a3a[_0x3ff4('0x3c')],_0x47db6e['ticketId']);}})['catch'](function(_0x559e79){logger['error']('['+[_0x284a30[_0x3ff4('0x13')]()]+_0x3ff4('0x6c'),util[_0x3ff4('0x6d')](_0x559e79,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x2c48=['],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','toLowerCase','content','toString','idField','customField','variable','variableName','customVariable','Variable','name','outbound','incident','assign','getString','Subjects','Descriptions','Fields','ticketId','ticketNumber',']\x20getTicket\x20crm','label','label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','request-promise','util','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','result','sys_id','info','toUpperCase','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','true','userId','adminEmail','],\x20getUser\x20crm','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System'];(function(_0xc3c0b1,_0x5733e3){var _0x4a2eca=function(_0x19b674){while(--_0x19b674){_0xc3c0b1['push'](_0xc3c0b1['shift']());}};_0x4a2eca(++_0x5733e3);}(_0x2c48,0x124));var _0x82c4=function(_0x5806c3,_0x5105d8){_0x5806c3=_0x5806c3-0x0;var _0x48ac77=_0x2c48[_0x5806c3];return _0x48ac77;};'use strict';var _=require(_0x82c4('0x0'));var Promise=require('bluebird');var rp=require(_0x82c4('0x1'));var util=require(_0x82c4('0x2'));var md5=require('md5');var Redis=require(_0x82c4('0x3'));var intUtil=require('./util');var config=require(_0x82c4('0x4'));var logger=require(_0x82c4('0x5'))(_0x82c4('0x6'));config[_0x82c4('0x7')]=_[_0x82c4('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x82c4('0x9'))(new Redis(config[_0x82c4('0x7')]));function getAdminUser(_0x1ee997,_0x20e3dd,_0x47d0cc,_0x516ceb,_0x4c8e2b,_0x471b74){return new Promise(function(_0x1ff3b6,_0x2a8cdf){var _0x2d8dc9={'method':_0x82c4('0xa'),'uri':_0x516ceb+_0x82c4('0xb')+'&'+_0x4c8e2b+'&'+_0x471b74,'auth':_0x20e3dd,'json':!![]};return rp(_0x2d8dc9)[_0x82c4('0xc')](function(_0x1722cd){if(_0x1722cd['result'][_0x82c4('0xd')]>0x0){_0x47d0cc[_0x82c4('0xe')]=_0x1722cd[_0x82c4('0xf')][0x0][_0x82c4('0x10')];}logger[_0x82c4('0x11')]('['+[_0x1ee997[_0x82c4('0x12')]()]+'],\x20getAdminUser\x20crm',_0x47d0cc);_0x1ff3b6(_0x47d0cc);})[_0x82c4('0x13')](function(_0x301134){logger[_0x82c4('0x14')]('['+[_0x1ee997[_0x82c4('0x12')]()]+']',_0x301134[_0x82c4('0x15')]);_0x2a8cdf(_0x301134[_0x82c4('0x15')]);});});}function getUser(_0x2c537c,_0x282517,_0x478d21,_0x1d24f9,_0x41bf85){return function(_0x1ea216){logger['info']('['+[_0x2c537c['toUpperCase']()]+_0x82c4('0x16'),_0x1ea216);return new Promise(function(_0x28dfd1,_0xd6f4fd){if(intUtil[_0x82c4('0x17')](_0x1ea216[_0x82c4('0x18')])){var _0x2304b8={'method':'GET','uri':_0x478d21+_0x82c4('0x19')+_0x1ea216[_0x82c4('0x18')]+'&'+_0x1d24f9+'&'+_0x41bf85,'auth':_0x282517,'json':!![]};logger[_0x82c4('0x11')]('['+[_0x2c537c[_0x82c4('0x12')]()]+_0x82c4('0x1a'),_0x2304b8);return rp(_0x2304b8)[_0x82c4('0xc')](function(_0xa8d139){logger[_0x82c4('0x11')]('['+[_0x2c537c[_0x82c4('0x12')]()]+_0x82c4('0x1b'),_0xa8d139);if(_0xa8d139['result']['length']>0x0&&String(_0xa8d139[_0x82c4('0xf')][0x0]['active'])===_0x82c4('0x1c')){_0x1ea216[_0x82c4('0x1d')]=_0xa8d139[_0x82c4('0xf')][0x0][_0x82c4('0x10')];}else{_0x1ea216[_0x82c4('0x1d')]=_0x1ea216[_0x82c4('0xe')];_0x1ea216[_0x82c4('0x18')]=_0x1ea216[_0x82c4('0x1e')];}logger[_0x82c4('0x11')]('['+[_0x2c537c['toUpperCase']()]+_0x82c4('0x1f'),_0x1ea216);_0x28dfd1(_0x1ea216);})[_0x82c4('0x13')](function(_0x1c00bc){logger[_0x82c4('0x14')]('['+[_0x2c537c[_0x82c4('0x12')]()]+']',_0x1c00bc[_0x82c4('0x15')]);_0xd6f4fd(_0x1c00bc[_0x82c4('0x15')]);});}else{logger['info']('['+[_0x2c537c[_0x82c4('0x12')]()]+']\x20using\x20admin\x20profile');_0x1ea216[_0x82c4('0x1d')]=_0x1ea216[_0x82c4('0xe')];_0x1ea216['userEmail']=_0x1ea216[_0x82c4('0x1e')];_0x28dfd1(_0x1ea216);}});};}function createEndUser(_0x2a9902,_0x280064,_0x1908d5,_0x4f66ae,_0x5ec6f7){logger['info']('['+[_0x2a9902['toUpperCase']()]+_0x82c4('0x20'),_0x1908d5);return new Promise(function(_0x5c40db,_0x2f54fb){var _0x4c0c9f={'method':_0x82c4('0x21'),'uri':_0x4f66ae+_0x82c4('0x22')+_0x5ec6f7,'body':{'user_name':_0x1908d5[_0x82c4('0x23')],'roles':_0x82c4('0x24'),'first_name':_0x1908d5['endUserNumber'],'active':_0x82c4('0x1c'),'date_format':_0x82c4('0x25'),'phone':_0x1908d5[_0x82c4('0x23')]},'auth':_0x280064,'json':!![]};return rp(_0x4c0c9f)['then'](function(_0x1df70b){logger[_0x82c4('0x11')]('['+[_0x2a9902[_0x82c4('0x12')]()]+_0x82c4('0x26'),_0x1df70b[_0x82c4('0xf')]);_0x1908d5[_0x82c4('0x27')]=_0x1df70b[_0x82c4('0xf')][_0x82c4('0x10')];_0x5c40db(_0x1908d5);})[_0x82c4('0x13')](function(_0x5acad1){logger[_0x82c4('0x14')]('['+[_0x2a9902['toUpperCase']()]+']',_0x5acad1[_0x82c4('0x15')]);_0x2f54fb(_0x5acad1[_0x82c4('0x15')]);});});}function getEndUser(_0x57236d,_0x5d4a35,_0x3a2210,_0x298182,_0x3b7a58){return function(_0x3d3716){logger[_0x82c4('0x11')]('['+[_0x57236d['toUpperCase']()]+_0x82c4('0x28'),_0x3d3716);return new Promise(function(_0x27fe10,_0x28d277){var _0x2eefce={'method':_0x82c4('0xa'),'uri':_0x3a2210+_0x82c4('0x29')+_0x3d3716[_0x82c4('0x23')]+'&'+_0x298182+'&'+_0x3b7a58,'auth':_0x5d4a35,'json':!![]};return rp(_0x2eefce)[_0x82c4('0xc')](function(_0x36cf45){if(_0x36cf45[_0x82c4('0xf')][_0x82c4('0xd')]>0x0){_0x3d3716['endUserId']=_0x36cf45[_0x82c4('0xf')][0x0][_0x82c4('0x10')];logger['info']('['+[_0x57236d[_0x82c4('0x12')]()]+'],\x20getEndUser\x20crm',_0x3d3716);_0x27fe10(_0x3d3716);}else{return createEndUser(_0x57236d,_0x5d4a35,_0x3d3716,_0x3a2210,_0x298182)[_0x82c4('0xc')](function(_0x3265b7){logger[_0x82c4('0x11')]('['+[_0x57236d[_0x82c4('0x12')]()]+_0x82c4('0x2a'),_0x3265b7);_0x27fe10(_0x3265b7);});}})[_0x82c4('0x13')](function(_0x40dfb2){logger['error']('['+[_0x57236d['toUpperCase']()]+']',_0x40dfb2[_0x82c4('0x15')]);_0x28d277(_0x40dfb2['message']);});});};}function getCustomFields(_0x923cf0,_0x8ca19d){var _0x116ea3={};if(_0x923cf0['length']>0x0){_[_0x82c4('0x2b')](_0x923cf0,function(_0x188238){if(_[_0x82c4('0x2c')]([_0x82c4('0x2d'),_0x82c4('0x2e')],_0x188238[_0x82c4('0x2f')])&&_0x188238[_0x82c4('0x30')]&&!_0x188238['customField']){_0x116ea3[_0x188238[_0x82c4('0x30')][_0x82c4('0x31')]()]=_0x188238[_0x82c4('0x32')][_0x82c4('0x33')]();}else if(_['includes']([_0x82c4('0x2d'),'picklist'],_0x188238[_0x82c4('0x2f')])&&_0x188238[_0x82c4('0x34')]&&_0x188238[_0x82c4('0x35')]){_0x116ea3[_0x188238[_0x82c4('0x34')][_0x82c4('0x31')]()]=_0x188238['content'][_0x82c4('0x33')]();}else if(_0x188238[_0x82c4('0x2f')]===_0x82c4('0x36')&&_0x188238[_0x82c4('0x37')]&&_0x188238[_0x82c4('0x34')]&&_0x188238[_0x82c4('0x35')]){_0x116ea3[_0x188238[_0x82c4('0x34')][_0x82c4('0x31')]()]=_0x8ca19d[_0x188238[_0x82c4('0x37')]]['toString']();}else if(_0x188238[_0x82c4('0x2f')]===_0x82c4('0x38')&&_0x188238[_0x82c4('0x39')]&&_0x188238[_0x82c4('0x39')][_0x82c4('0x3a')]&&_0x188238['idField']&&_0x188238['customField']){_0x116ea3[_0x188238[_0x82c4('0x34')][_0x82c4('0x31')]()]=_0x8ca19d[_0x188238[_0x82c4('0x39')][_0x82c4('0x3a')]['toLowerCase']()][_0x82c4('0x33')]();}});}return _0x116ea3;}function getTicket(_0x577227,_0x4f7013,_0x227a3e,_0x8fd60c,_0x16f259,_0x4a228b){return function(_0x8b2301){logger[_0x82c4('0x11')]('['+[_0x577227[_0x82c4('0x12')]()]+']\x20getTicket\x20input\x20crm',_0x8b2301);return new Promise(function(_0x258ce6,_0xd57ced){var _0x4a20b9=_0x577227[_0x82c4('0x31')]()===_0x82c4('0x3b')?_0x8b2301[_0x82c4('0x1d')]:_0x8b2301[_0x82c4('0x27')];var _0x5f3b69={'method':'POST','uri':_0x227a3e+_0x82c4('0x3c')+'?'+_0x4a228b,'body':Object[_0x82c4('0x3d')]({},{'active':_0x82c4('0x1c'),'caller_id':_0x4a20b9,'assigned_to':_0x8b2301[_0x82c4('0x1d')],'short_description':intUtil[_0x82c4('0x3e')](_0x8fd60c[_0x82c4('0x3f')],_0x16f259,'\x20'),'description':intUtil[_0x82c4('0x3e')](_0x8fd60c[_0x82c4('0x40')],_0x16f259,'\x0a')},getCustomFields(_0x8fd60c[_0x82c4('0x41')],_0x16f259)),'auth':_0x4f7013,'json':!![]};return rp(_0x5f3b69)['then'](function(_0x4898a2){logger['info']('['+[_0x577227[_0x82c4('0x12')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x4898a2[_0x82c4('0xf')]);_0x8b2301[_0x82c4('0x42')]=_0x4898a2[_0x82c4('0xf')][_0x82c4('0x10')];_0x8b2301[_0x82c4('0x43')]=_0x4898a2['result']['number'];logger['info']('['+[_0x577227['toUpperCase']()]+_0x82c4('0x44'),_0x8b2301);_0x258ce6(_0x8b2301);})[_0x82c4('0x13')](function(_0x1e87d6){logger['error']('['+[_0x577227[_0x82c4('0x12')]()]+']',_0x1e87d6['message']);_0xd57ced(_0x1e87d6[_0x82c4('0x15')]);});});};}function createRemoteTag(_0x5d323b,_0x5355bf,_0x1d9c1f,_0x188146){return new Promise(function(_0x245982,_0x18f8c4){var _0x3d6819={'method':'POST','uri':_0x1d9c1f+'label'+'?'+_0x188146,'body':{'short_description':_0x5d323b,'global':!![],'active':!![],'name':_0x5d323b},'auth':_0x5355bf,'json':!![]};return rp(_0x3d6819)['then'](function(_0x30ff88){var _0x2a30b7=_0x30ff88[_0x82c4('0xf')]['sys_id'];_0x245982(_0x2a30b7);});});}function getRemoteTag(_0x4895a8,_0x451f6d,_0xb25d36,_0x123086,_0x3c2088){return new Promise(function(_0x4c7064,_0x16e773){var _0x3d4cd9={'method':'GET','uri':_0xb25d36+_0x82c4('0x45')+'?sysparm_query=name%3D'+_0x4895a8+'&'+_0x123086,'auth':_0x451f6d,'json':!![]};return rp(_0x3d4cd9)[_0x82c4('0xc')](function(_0x243df9){if(_0x243df9['result']['length']>0x0){var _0x184b67=_0x243df9[_0x82c4('0xf')][0x0][_0x82c4('0x10')];_0x4c7064(_0x184b67);}else{return createRemoteTag(_0x4895a8,_0x451f6d,_0xb25d36,_0x123086)[_0x82c4('0xc')](function(_0x3190a7){_0x4c7064(_0x3190a7);});}});});}function assignTagToIncident(_0x5bc8a2,_0x5bae81,_0x3774fb,_0x769dcc,_0x5c7db8){return new Promise(function(_0x62e59f,_0x2f93fd){var _0xdced31={'method':'POST','uri':_0x3774fb+_0x82c4('0x46')+'?'+_0x5c7db8,'body':{'label':_0x5bc8a2,'table':_0x82c4('0x3c'),'id_type':_0x82c4('0x47'),'table_key':_0x769dcc['ticketId'],'title':_0x82c4('0x48')+_0x769dcc[_0x82c4('0x43')],'id_display':_0x769dcc[_0x82c4('0x43')]},'auth':_0x5bae81,'json':!![]};return rp(_0xdced31)['then'](function(_0x40b48d){_0x62e59f();})['catch'](function(){_0x62e59f();});});}function manageTags(_0x402b2e,_0x2472eb,_0x1656c9,_0x47954e,_0x361625,_0x2aa86f,_0x264aa3){return new Promise(function(_0x3035aa,_0x37a28a){var _0xd68580=[];_0x2472eb[_0x82c4('0x2b')](function(_0x2ab7e6){_0xd68580[_0x82c4('0x49')](getRemoteTag(_0x2ab7e6,_0x1656c9,_0x47954e,_0x2aa86f,_0x264aa3));});return Promise[_0x82c4('0x4a')](_0xd68580)['then'](function(_0x3ddf6f){if(_0x3ddf6f[_0x82c4('0xd')]){logger[_0x82c4('0x11')]('['+[_0x402b2e[_0x82c4('0x12')]()]+_0x82c4('0x4b'),_0x3ddf6f);var _0x6623e9=[];_0x3ddf6f['forEach'](function(_0x35c874){_0x6623e9[_0x82c4('0x49')](assignTagToIncident(_0x35c874,_0x1656c9,_0x47954e,_0x361625,_0x2aa86f));});return Promise[_0x82c4('0x4a')](_0x6623e9)[_0x82c4('0xc')](function(){_0x3035aa();})['catch'](function(){_0x3035aa();});}else{_0x3035aa();}});});}function getTags(_0x3c603a,_0x4015b2,_0x584be2,_0x4f1a75,_0x4448f9,_0x44d3a2){return function(_0xd6baac){return new Promise(function(_0x2bf030,_0x345c69){var _0x5db7c9=[];var _0x884814=_0x4f1a75[_0x82c4('0x4c')];if(_0x884814&&_0x884814[_0x82c4('0xd')]>0x0){_0x5db7c9=_[_0x82c4('0x4d')](_0x884814,_0x82c4('0x3a'));}if(_0x5db7c9[_0x82c4('0xd')]>0x0){return manageTags(_0x3c603a,_0x5db7c9,_0x4015b2,_0x584be2,_0xd6baac,_0x4448f9,_0x44d3a2)['then'](function(){_0x2bf030(_0xd6baac);});}else{_0x2bf030(_0xd6baac);}});};}function emit(_0x2d8d78,_0x4e229d,_0x26aaa4){var _0x1c05a8=_0x82c4('0x4e')+_0x82c4('0x4f')+_0x82c4('0x50')+'%255EORDERBYDESCnumber';var _0x3a30d7={'uri':_0x2d8d78+_0x82c4('0x51')+_0x26aaa4+_0x1c05a8};io['to'](util[_0x82c4('0x52')](_0x82c4('0x53'),_0x4e229d))[_0x82c4('0x54')](_0x82c4('0x55'),_0x3a30d7);}exports['cs']=function(_0x515e3d,_0x1ec865,_0x4ecc5d,_0x55d61f,_0x3ba74f,_0x33a647,_0xf9a548,_0x3bb7ca){var _0x312feb={};var _0x1da03a={'user':_0x33a647[_0x82c4('0x56')],'pass':_0x33a647[_0x82c4('0x57')]};var _0x2bd359=_0x82c4('0x58');var _0x4a6be3='sysparm_display_value=true';_0x33a647[_0x82c4('0x59')]=intUtil[_0x82c4('0x5a')](_0x33a647[_0x82c4('0x59')]);_0x33a647[_0x82c4('0x5b')]=intUtil[_0x82c4('0x5a')](_0x33a647[_0x82c4('0x5b')]);var _0x4c273c=util[_0x82c4('0x52')](_0x82c4('0x5c'),_0x33a647[_0x82c4('0x59')]);_0x312feb[_0x82c4('0x18')]=!_[_0x82c4('0x5d')](_0x55d61f)?_0x55d61f[_0x82c4('0x5e')]:null;_0x312feb[_0x82c4('0x1e')]=_0x33a647[_0x82c4('0x5e')];_0x312feb[_0x82c4('0x23')]=_0x3bb7ca[_0x82c4('0x31')]()===_0x82c4('0x3b')?_0x1ec865[_0x82c4('0x5f')]:_0x1ec865[_0x82c4('0x60')];_0x312feb['callDirection']=_0x3bb7ca==='queue'||_0x3bb7ca===_0x82c4('0x61')?'queue':_0x82c4('0x3b');var _0x384ce2=util[_0x82c4('0x52')](_0x82c4('0x62'),_0x33a647['serverUrl'],_0x1ec865[_0x82c4('0x63')],md5(_0x1ec865[_0x82c4('0x63')]));if(_0x3ba74f&&_0x3ba74f['monitor_format']){logger['info'](_0x82c4('0x64'),_0x82c4('0x65'));_0x1ec865['recordingURL']=_0x384ce2;}else if(_0xf9a548&&_0xf9a548[_0x82c4('0x66')]&&_0xf9a548[_0x82c4('0x66')]!==_0x82c4('0x67')){logger['info'](_0x82c4('0x68'),'Recording\x20is\x20enabled!');_0x1ec865['recordingURL']=_0x384ce2;}else{_0x1ec865['recordingURL']='';}return getAdminUser(_0x3bb7ca,_0x1da03a,_0x312feb,_0x4c273c,_0x4a6be3,_0x2bd359)[_0x82c4('0xc')](getUser(_0x3bb7ca,_0x1da03a,_0x4c273c,_0x4a6be3,_0x2bd359))[_0x82c4('0xc')](getEndUser(_0x3bb7ca,_0x1da03a,_0x4c273c,_0x4a6be3,_0x2bd359))[_0x82c4('0xc')](getTicket(_0x3bb7ca,_0x1da03a,_0x4c273c,_0x4ecc5d,_0x1ec865,_0x4a6be3))[_0x82c4('0xc')](function(_0x348a91){logger[_0x82c4('0x11')](util[_0x82c4('0x52')](_0x82c4('0x69'),_0x348a91[_0x82c4('0x42')]));logger[_0x82c4('0x11')](util[_0x82c4('0x52')](_0x82c4('0x6a'),_0x3bb7ca));if(_0x3bb7ca!=='unmanaged'){logger[_0x82c4('0x11')]('['+[_0x3bb7ca[_0x82c4('0x12')]()]+']',_0x82c4('0x6b'));emit(_0x33a647[_0x82c4('0x59')],_0x55d61f[_0x82c4('0x3a')],_0x348a91[_0x82c4('0x42')]);}})[_0x82c4('0x13')](function(_0x5d6879){logger['error']('['+[_0x3bb7ca[_0x82c4('0x12')]()]+_0x82c4('0x6c'),util[_0x82c4('0x6d')](_0x5d6879,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 967340d..e38d333 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdfd0=['uri','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','outbound','%s/service/v4_1/rest.php','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','The\x20Enduser\x20ID\x20is:','[OUTBOUND]','trigger:browser:url','error','unmanaged','lastevent','toUpperCase','calleridnum','lodash','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','direction','length','forEach','push','idField','variableName','JSON','stringify','Calls','format','Basic\x20%s','apiKey','get_server_info','isNil','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','name_value_list','user_name','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','first_name','<unknown>','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','string','nameField','customField','content','toString','type','variable','custom_fields','Variable','toLowerCase','POST','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl'];(function(_0x2e76a7,_0x23871a){var _0x454cde=function(_0x51724d){while(--_0x51724d){_0x2e76a7['push'](_0x2e76a7['shift']());}};_0x454cde(++_0x23871a);}(_0xdfd0,0x116));var _0x0dfd=function(_0x429adc,_0x27ba85){_0x429adc=_0x429adc-0x0;var _0x219026=_0xdfd0[_0x429adc];return _0x219026;};'use strict';var _=require(_0x0dfd('0x0'));var rp=require('request-promise');var BPromise=require(_0x0dfd('0x1'));var md5=require('md5');var util=require(_0x0dfd('0x2'));var Redis=require(_0x0dfd('0x3'));var intUtil=require(_0x0dfd('0x4'));var config=require(_0x0dfd('0x5'));var logger=require(_0x0dfd('0x6'))('sugarcrm');config[_0x0dfd('0x7')]=_['defaults'](config[_0x0dfd('0x7')],{'host':_0x0dfd('0x8'),'port':0x18eb});var io=require(_0x0dfd('0x9'))(new Redis(config[_0x0dfd('0x7')]));var def={'method':'POST','json':!![]};function emit(_0x3103ba,_0x42b8ff,_0xa131b3){io['to'](_0x3103ba)[_0x0dfd('0xa')](_0x42b8ff,_0xa131b3);}function getTicket(_0x4eb4e2,_0x8d9945,_0x576442,_0x4d768a,_0x1b0a9,_0x4aa11c,_0x476665,_0x4f4da3){logger[_0x0dfd('0xb')](_0x0dfd('0xc'));var _0x383cf2=new Date();var _0x3b8fb7=[{'name':_0x0dfd('0xd'),'value':intUtil[_0x0dfd('0xe')](_0x4d768a[_0x0dfd('0xf')],_0x1b0a9,'\x20')},{'name':_0x0dfd('0x10'),'value':_0x8d9945['id']},{'name':'created_by','value':_0x8d9945['id']},{'name':'description','value':intUtil[_0x0dfd('0xe')](_0x4d768a[_0x0dfd('0x11')],_0x1b0a9,'\x0a')},{'name':_0x0dfd('0x12'),'value':_0x383cf2[_0x0dfd('0x13')]()[_0x0dfd('0x14')](0x0,0x13)[_0x0dfd('0x15')]('T','\x20')},{'name':_0x0dfd('0x16'),'value':'0'},{'name':_0x0dfd('0x17'),'value':'15'},{'name':_0x0dfd('0x18'),'value':_0x576442['id']},{'name':_0x0dfd('0x19'),'value':_0x0dfd('0x1a')},{'name':'parent_name','value':_0x576442[_0x0dfd('0xd')]},{'name':_0x0dfd('0x1b'),'value':_0x4f4da3}];if(_0x4aa11c[_0x0dfd('0x1c')]){_[_0x0dfd('0x1d')](_0x4aa11c,function(_0x5663d6){if(_0x1b0a9[_0x5663d6['variableName']]){_0x3b8fb7[_0x0dfd('0x1e')]({'name':_0x5663d6[_0x0dfd('0x1f')],'value':_0x1b0a9[_0x5663d6[_0x0dfd('0x20')]]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0x0dfd('0x21'),'rest_data':JSON[_0x0dfd('0x22')]({'session':_0x476665['id'],'module_name':_0x0dfd('0x23'),'name_value_list':_0x3b8fb7})}});}function getAuth(_0x304660){return util[_0x0dfd('0x24')](_0x0dfd('0x25'),new Buffer(_0x304660[_0x0dfd('0x26')]+':X')['toString']('base64'));}function getServerInfo(_0x21b0d1){return request({'form':{'method':_0x0dfd('0x27'),'input_type':_0x0dfd('0x21'),'response_type':_0x0dfd('0x21'),'rest_data':JSON['stringify']({'session':_0x21b0d1['id']})}});}function getUser(_0x1f6352,_0x33df54,_0x476961){if(!_[_0x0dfd('0x28')](_0x33df54)){logger[_0x0dfd('0xb')](_0x0dfd('0x29'),_0x33df54);return request({'form':{'method':'get_entry_list','input_type':_0x0dfd('0x21'),'response_type':_0x0dfd('0x21'),'rest_data':JSON['stringify']({'session':_0x476961['id'],'module_name':_0x0dfd('0x2a'),'query':util[_0x0dfd('0x24')](_0x0dfd('0x2b'),_0x33df54),'order_by':'','offset':'0','select_fields':['id','name','user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x0dfd('0x2c')](function(_0x5474b1){if(_0x5474b1[_0x0dfd('0x2d')][_0x0dfd('0x1c')]){var _0x44db74=_[_0x0dfd('0x2e')](_0x5474b1[_0x0dfd('0x2d')],function(_0x37ff31){return _0x37ff31[_0x0dfd('0x2f')][_0x0dfd('0x30')][_0x0dfd('0x31')]===_0x33df54;});if(_0x44db74){logger[_0x0dfd('0xb')](_0x0dfd('0x32'));return BPromise[_0x0dfd('0x33')]({'id':_0x44db74[_0x0dfd('0x2f')]['id'][_0x0dfd('0x31')],'name':_0x44db74['name_value_list']['name']['value']});}}logger[_0x0dfd('0xb')](_0x0dfd('0x34'));return BPromise[_0x0dfd('0x33')]({'id':_0x476961[_0x0dfd('0x2f')][_0x0dfd('0x35')][_0x0dfd('0x31')],'name':_0x476961[_0x0dfd('0x2f')][_0x0dfd('0x30')][_0x0dfd('0x31')]});});}else{logger['info'](_0x0dfd('0x36'));return BPromise['resolve']({'id':_0x476961[_0x0dfd('0x2f')]['user_id']['value'],'name':_0x476961[_0x0dfd('0x2f')][_0x0dfd('0x30')][_0x0dfd('0x31')]});}}function getEndUser(_0x3d21d6,_0x5b9b33,_0x325b12,_0x2ce172){logger[_0x0dfd('0xb')]('Searching\x20enduser\x20with\x20phone',_0x325b12);return request({'form':{'method':_0x0dfd('0x37'),'input_type':'JSON','response_type':_0x0dfd('0x21'),'rest_data':JSON[_0x0dfd('0x22')]({'session':_0x2ce172['id'],'module_name':_0x0dfd('0x1a'),'query':util['format'](_0x0dfd('0x38'),_0x325b12),'order_by':'','offset':'0','select_fields':['id',_0x0dfd('0xd'),_0x0dfd('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x2b549b){if(_0x2b549b['entry_list'][_0x0dfd('0x1c')]){var _0x2690cc=_[_0x0dfd('0x2e')](_0x2b549b[_0x0dfd('0x2d')],function(_0x13df6d){return _0x13df6d[_0x0dfd('0x2f')][_0x0dfd('0x39')]['value']===_0x325b12;});if(_0x2690cc){logger[_0x0dfd('0xb')](_0x0dfd('0x3a'));return BPromise[_0x0dfd('0x33')]({'id':_0x2690cc[_0x0dfd('0x2f')]['id'][_0x0dfd('0x31')],'name':_0x2690cc[_0x0dfd('0x2f')]['name'][_0x0dfd('0x31')],'phone':_0x2690cc['name_value_list'][_0x0dfd('0x39')][_0x0dfd('0x31')]});}}else{logger[_0x0dfd('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':'set_entry','input_type':_0x0dfd('0x21'),'response_type':_0x0dfd('0x21'),'rest_data':JSON['stringify']({'session':_0x2ce172['id'],'module_name':_0x0dfd('0x1a'),'name_value_list':[{'name':_0x0dfd('0x3b'),'value':_0x5b9b33!==_0x0dfd('0x3c')?_0x5b9b33:util[_0x0dfd('0x24')](_0x0dfd('0x3d'),_0x325b12)},{'name':'phone_home','value':_0x325b12}]})}})[_0x0dfd('0x2c')](function(_0x4d0721){logger[_0x0dfd('0xb')](_0x0dfd('0x3e'));return BPromise['resolve']({'id':_0x4d0721['id'],'name':_0x4d0721[_0x0dfd('0x2d')][_0x0dfd('0x3b')]['value'],'phone':_0x4d0721[_0x0dfd('0x2d')][_0x0dfd('0x39')][_0x0dfd('0x31')]});});}});}function request(_0x27970f){logger[_0x0dfd('0x3f')](_0x0dfd('0x40'),JSON['stringify'](_0x27970f));return rp(_[_0x0dfd('0x41')](def,_0x27970f));}function getTags(_0x488493,_0xeeb484){var _0x57041d=[];if(_0x488493&&_0x488493[_0x0dfd('0x1c')]>0x0){_0x57041d=_['map'](_0x488493,_0xeeb484);}return _0x57041d;}function getCustomFields(_0x389f06,_0x367784){var _0xd7f61d=[];var _0x4d8693={'custom_fields':[]};if(_0x389f06[_0x0dfd('0x1c')]>0x0){_[_0x0dfd('0x1d')](_0x389f06,function(_0x21fa03){if(_0x21fa03['type']===_0x0dfd('0x42')&&_0x21fa03[_0x0dfd('0x43')]&&!_0x21fa03[_0x0dfd('0x44')]){_0x4d8693[_0x21fa03[_0x0dfd('0x43')]['toLowerCase']()]=_0x21fa03[_0x0dfd('0x45')][_0x0dfd('0x46')]();}else if(_0x21fa03[_0x0dfd('0x47')]===_0x0dfd('0x42')&&_0x21fa03[_0x0dfd('0x1f')]&&_0x21fa03[_0x0dfd('0x44')]){_0x4d8693['custom_fields']['push']({'id':_0x21fa03['idField'],'value':_0x21fa03['content']['toString']()});}else if(_0x21fa03['type']===_0x0dfd('0x48')&&_0x21fa03[_0x0dfd('0x20')]&&_0x21fa03['idField']&&_0x21fa03[_0x0dfd('0x44')]){_0x367784[_0x21fa03[_0x0dfd('0x20')]]&&_0x4d8693[_0x0dfd('0x49')][_0x0dfd('0x1e')]({'id':_0x21fa03[_0x0dfd('0x1f')],'value':_0x367784[_0x21fa03[_0x0dfd('0x20')]][_0x0dfd('0x46')]()});}else if(_0x21fa03[_0x0dfd('0x47')]==='customVariable'&&_0x21fa03[_0x0dfd('0x4a')]&&_0x21fa03[_0x0dfd('0x4a')][_0x0dfd('0xd')]&&_0x21fa03[_0x0dfd('0x1f')]&&_0x21fa03['customField']){_0x367784[_0x21fa03[_0x0dfd('0x4a')]['name']['toLowerCase']()]&&_0x4d8693[_0x0dfd('0x49')][_0x0dfd('0x1e')]({'id':_0x21fa03[_0x0dfd('0x1f')],'value':_0x367784[_0x21fa03[_0x0dfd('0x4a')][_0x0dfd('0xd')][_0x0dfd('0x4b')]()][_0x0dfd('0x46')]()});}});}return _0x4d8693;}function getConnection(_0x227901){return request({'method':_0x0dfd('0x4c'),'form':{'method':_0x0dfd('0x4d'),'input_type':_0x0dfd('0x21'),'response_type':'JSON','rest_data':JSON[_0x0dfd('0x22')]({'user_auth':{'user_name':_0x227901[_0x0dfd('0x4e')],'password':_0x227901[_0x0dfd('0x4f')],'encryption':_0x0dfd('0x50')},'application':_0x0dfd('0x51')})}})[_0x0dfd('0x2c')](function(_0x54f411){var _0x147cf9=_0x54f411;if(_0x147cf9['id']){def['sessionID']=_0x147cf9['id'];return BPromise['resolve'](_0x147cf9);}else{throw new Error(util[_0x0dfd('0x24')](_0x0dfd('0x52'),_0x227901['id']));}});}function setRelationship(_0x3b24a9,_0x7e8eec,_0x5c8b99,_0x518be1){return request({'form':{'method':_0x0dfd('0x53'),'input_type':_0x0dfd('0x21'),'response_type':_0x0dfd('0x21'),'rest_data':JSON[_0x0dfd('0x22')]({'session':_0x3b24a9['id'],'module_name':'Calls','module_id':_0x5c8b99['id'],'link_field_name':_0x518be1,'related_ids':[_0x7e8eec['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x0dfd('0x54')]=function(_0x406be9,_0x591ed5,_0x3aa98b,_0xf92286,_0xe58fd3,_0x1c9f01){var _0x514667,_0x1468cb,_0x131c25,_0x319fe2;_0x1c9f01[_0x0dfd('0x55')]=intUtil[_0x0dfd('0x56')](_0x1c9f01[_0x0dfd('0x55')]);_0x1c9f01['serverUrl']=intUtil[_0x0dfd('0x56')](_0x1c9f01[_0x0dfd('0x57')]);def[_0x0dfd('0x58')]=util[_0x0dfd('0x24')]('%s/service/v4_1/rest.php',_0x1c9f01[_0x0dfd('0x55')]);if(_0xe58fd3&&_0xe58fd3[_0x0dfd('0x59')]){logger['info'](_0x0dfd('0x5a'),'Recording\x20is\x20enabled!');_0x591ed5[_0x0dfd('0x5b')]=util[_0x0dfd('0x24')](_0x0dfd('0x5c'),_0x1c9f01['serverUrl'],_0x591ed5[_0x0dfd('0x5d')],md5(_0x591ed5['uniqueid']));}else{_0x591ed5[_0x0dfd('0x5b')]='';}return getConnection(_0x1c9f01)[_0x0dfd('0x2c')](function(_0x3eaacf){_0x319fe2=_0x3eaacf;return getUser(_0x1c9f01,_0xf92286[_0x0dfd('0xd')],_0x319fe2);})[_0x0dfd('0x2c')](function(_0x16314b){_0x514667=_0x16314b;logger[_0x0dfd('0xb')]('The\x20User\x20ID\x20is:',_0x514667['id']);return getEndUser(_0x1c9f01,_0x591ed5[_0x0dfd('0x5e')],_0x591ed5['calleridnum'],_0x319fe2);})[_0x0dfd('0x2c')](function(_0x4e4268){_0x1468cb=_0x4e4268;logger[_0x0dfd('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1468cb['id']);return getTicket(_0x1c9f01,_0x514667,_0x1468cb,_0x3aa98b,_0x591ed5,_0x3aa98b[_0x0dfd('0x5f')],_0x319fe2,_0x0dfd('0x60'));})[_0x0dfd('0x2c')](function(_0x1e8fb2){_0x131c25=_0x1e8fb2;logger[_0x0dfd('0xb')](_0x0dfd('0x61'));logger['info'](_0x0dfd('0x62'),_0x131c25['id']);return setRelationship(_0x319fe2,_0x514667,_0x131c25,_0x0dfd('0x63'));})['then'](function(){return setRelationship(_0x319fe2,_0x1468cb,_0x131c25,_0x0dfd('0x64'));})[_0x0dfd('0x2c')](function(){return getServerInfo(_0x319fe2);})['then'](function(_0xc691de){var _0x155f03=parseInt(_0xc691de[_0x0dfd('0x65')][_0x0dfd('0x66')](0x0));var _0x4c0b8d=util[_0x0dfd('0x24')](_0x0dfd('0x67'),_0x1c9f01[_0x0dfd('0x55')],_0x131c25['id']);if(_0x155f03>0x6){_0x4c0b8d=util[_0x0dfd('0x24')](_0x0dfd('0x68'),_0x1c9f01[_0x0dfd('0x55')],_0x131c25['id']);}logger[_0x0dfd('0xb')]('[QUEUE]',_0x0dfd('0x69'));emit(util[_0x0dfd('0x24')](_0x0dfd('0x6a'),_0xf92286['name']),'trigger:browser:url',{'uri':_0x4c0b8d});})[_0x0dfd('0x6b')](function(_0x4b08d3){logger['error']('[QUEUE]',JSON[_0x0dfd('0x22')](_0x4b08d3));});};exports[_0x0dfd('0x6c')]=function(_0x1e1815,_0x27d0b9,_0x31a9a2,_0x1bee88,_0x5e9d8f,_0x3926c6,_0x2620d0){var _0x3c576b,_0x420338,_0xf974c,_0x4402bf;_0x3926c6[_0x0dfd('0x55')]=intUtil[_0x0dfd('0x56')](_0x3926c6[_0x0dfd('0x55')]);_0x3926c6[_0x0dfd('0x57')]=intUtil['stripTrailingSlash'](_0x3926c6[_0x0dfd('0x57')]);def['uri']=util['format'](_0x0dfd('0x6d'),_0x3926c6[_0x0dfd('0x55')]);if(_0x2620d0&&_0x2620d0[_0x0dfd('0x6e')]&&_0x2620d0[_0x0dfd('0x6e')]!==_0x0dfd('0x6f')){logger[_0x0dfd('0xb')]('[OUTBOUND]',_0x0dfd('0x70'));_0x27d0b9[_0x0dfd('0x5b')]=util[_0x0dfd('0x24')](_0x0dfd('0x5c'),_0x3926c6['serverUrl'],_0x27d0b9[_0x0dfd('0x5d')],md5(_0x27d0b9[_0x0dfd('0x5d')]));}return getConnection(_0x3926c6)[_0x0dfd('0x2c')](function(_0x592b3e){_0x4402bf=_0x592b3e;return getUser(_0x3926c6,_0x1bee88[_0x0dfd('0xd')],_0x4402bf);})[_0x0dfd('0x2c')](function(_0x57fc58){_0x3c576b=_0x57fc58;logger[_0x0dfd('0xb')]('The\x20User\x20ID\x20is:',_0x3c576b['id']);return getEndUser(_0x3926c6,_0x27d0b9[_0x0dfd('0x71')],_0x27d0b9['destcalleridnum'],_0x4402bf);})[_0x0dfd('0x2c')](function(_0x13f053){_0x420338=_0x13f053;logger[_0x0dfd('0xb')](_0x0dfd('0x72'),_0x420338['id']);return getTicket(_0x3926c6,_0x3c576b,_0x420338,_0x31a9a2,_0x27d0b9,_0x31a9a2[_0x0dfd('0x5f')],_0x4402bf,'Outbound');})['then'](function(_0xb7f4){_0xf974c=_0xb7f4;logger['info'](_0x0dfd('0x61'));logger[_0x0dfd('0xb')](_0x0dfd('0x62'),_0xf974c['id']);return setRelationship(_0x4402bf,_0x3c576b,_0xf974c,_0x0dfd('0x63'));})[_0x0dfd('0x2c')](function(){return setRelationship(_0x4402bf,_0x420338,_0xf974c,_0x0dfd('0x64'));})[_0x0dfd('0x2c')](function(){return getServerInfo(_0x4402bf);})['then'](function(_0x246556){var _0x3b0fbb=parseInt(_0x246556[_0x0dfd('0x65')][_0x0dfd('0x66')](0x0));var _0xb920c9=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x3926c6[_0x0dfd('0x55')],_0xf974c['id']);if(_0x3b0fbb>0x6){_0xb920c9=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x3926c6[_0x0dfd('0x55')],_0xf974c['id']);}logger[_0x0dfd('0xb')](_0x0dfd('0x73'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x0dfd('0x24')]('user:%s',_0x1bee88[_0x0dfd('0xd')]),_0x0dfd('0x74'),{'uri':_0xb920c9});})['catch'](function(_0x2b23c9){logger[_0x0dfd('0x75')]('[OUTBOUND]',JSON[_0x0dfd('0x22')](_0x2b23c9));});};exports[_0x0dfd('0x76')]=function(_0xdc9b3a,_0x1d77e1,_0x19c24f,_0x4905fc,_0x458ff3,_0x5b64d3){var _0x75ee79,_0x4cc57d,_0x19e30a,_0x1f88fa;_0x5b64d3[_0x0dfd('0x55')]=intUtil[_0x0dfd('0x56')](_0x5b64d3[_0x0dfd('0x55')]);_0x5b64d3[_0x0dfd('0x57')]=intUtil['stripTrailingSlash'](_0x5b64d3[_0x0dfd('0x57')]);def[_0x0dfd('0x58')]=util[_0x0dfd('0x24')]('%s/service/v4_1/rest.php',_0x5b64d3['remoteUri']);if(_0x458ff3&&_0x458ff3[_0x0dfd('0x59')]){logger[_0x0dfd('0xb')]('['+_0x1d77e1[_0x0dfd('0x77')][_0x0dfd('0x78')]()+']','Recording\x20is\x20enabled!');_0x1d77e1[_0x0dfd('0x5b')]=util[_0x0dfd('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5b64d3[_0x0dfd('0x57')],_0x1d77e1[_0x0dfd('0x5d')],md5(_0x1d77e1[_0x0dfd('0x5d')]));}else{_0x1d77e1[_0x0dfd('0x5b')]='';}return getConnection(_0x5b64d3)[_0x0dfd('0x2c')](function(_0x549621){_0x1f88fa=_0x549621;if(!_[_0x0dfd('0x28')](_0x4905fc)){return getUser(_0x5b64d3,_0x4905fc[_0x0dfd('0xd')],_0x1f88fa);}else{return getUser(_0x5b64d3,null,_0x1f88fa);}})[_0x0dfd('0x2c')](function(_0x3e8916){_0x75ee79=_0x3e8916;logger[_0x0dfd('0xb')]('The\x20User\x20ID\x20is:',_0x75ee79['id']);return getEndUser(_0x5b64d3,_0x1d77e1[_0x0dfd('0x5e')],_0x1d77e1[_0x0dfd('0x79')],_0x1f88fa);})[_0x0dfd('0x2c')](function(_0x4839ce){_0x4cc57d=_0x4839ce;logger['info'](_0x0dfd('0x72'),_0x4cc57d['id']);return getTicket(_0x5b64d3,_0x75ee79,_0x4cc57d,_0x19c24f,_0x1d77e1,_0x19c24f[_0x0dfd('0x5f')],_0x1f88fa,_0x0dfd('0x60'));})['then'](function(_0x1c4964){_0x19e30a=_0x1c4964;logger['info'](_0x0dfd('0x61'));logger['info'](_0x0dfd('0x62'),_0x19e30a['id']);return setRelationship(_0x1f88fa,_0x75ee79,_0x19e30a,_0x0dfd('0x63'));})[_0x0dfd('0x2c')](function(){return setRelationship(_0x1f88fa,_0x4cc57d,_0x19e30a,'contacts');})['then'](function(){return getServerInfo(_0x1f88fa);})[_0x0dfd('0x6b')](function(_0x5b8c56){logger[_0x0dfd('0x75')]('['+_0x1d77e1[_0x0dfd('0x77')][_0x0dfd('0x78')]()+']',JSON['stringify'](_0x5b8c56));});};
\ No newline at end of file
+var _0xd9e0=['version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','monitor_format','lastevent','toUpperCase','lodash','request-promise','bluebird','md5','util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','POST','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','Descriptions','date_start','toISOString','slice','parent_id','parent_type','Contacts','parent_name','length','forEach','variableName','idField','set_entry','JSON','Calls','format','toString','base64','get_server_info','stringify','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','name_value_list','value','Agent\x20found!','info','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','phone_home','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','<unknown>','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','map','type','string','nameField','content','customField','custom_fields','push','variable','customVariable','Variable','toLowerCase','login','username','password','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','users','contacts'];(function(_0x2343c6,_0x283d5c){var _0x2974e1=function(_0x21baea){while(--_0x21baea){_0x2343c6['push'](_0x2343c6['shift']());}};_0x2974e1(++_0x283d5c);}(_0xd9e0,0x1e9));var _0x0d9e=function(_0x497ba7,_0x4149c6){_0x497ba7=_0x497ba7-0x0;var _0x465fc3=_0xd9e0[_0x497ba7];return _0x465fc3;};'use strict';var _=require(_0x0d9e('0x0'));var rp=require(_0x0d9e('0x1'));var BPromise=require(_0x0d9e('0x2'));var md5=require(_0x0d9e('0x3'));var util=require(_0x0d9e('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x0d9e('0x5'));var logger=require(_0x0d9e('0x6'))('sugarcrm');config[_0x0d9e('0x7')]=_[_0x0d9e('0x8')](config[_0x0d9e('0x7')],{'host':_0x0d9e('0x9'),'port':0x18eb});var io=require(_0x0d9e('0xa'))(new Redis(config['redis']));var def={'method':_0x0d9e('0xb'),'json':!![]};function emit(_0x34beee,_0x105846,_0x389b51){io['to'](_0x34beee)['emit'](_0x105846,_0x389b51);}function getTicket(_0x41d630,_0x24d899,_0x11b340,_0x2da8c7,_0x2795c4,_0x3b8633,_0x297c85,_0x393f5a){logger['info'](_0x0d9e('0xc'));var _0x26e824=new Date();var _0x51edf5=[{'name':_0x0d9e('0xd'),'value':intUtil[_0x0d9e('0xe')](_0x2da8c7[_0x0d9e('0xf')],_0x2795c4,'\x20')},{'name':_0x0d9e('0x10'),'value':_0x24d899['id']},{'name':_0x0d9e('0x11'),'value':_0x24d899['id']},{'name':'description','value':intUtil[_0x0d9e('0xe')](_0x2da8c7[_0x0d9e('0x12')],_0x2795c4,'\x0a')},{'name':_0x0d9e('0x13'),'value':_0x26e824[_0x0d9e('0x14')]()[_0x0d9e('0x15')](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x0d9e('0x16'),'value':_0x11b340['id']},{'name':_0x0d9e('0x17'),'value':_0x0d9e('0x18')},{'name':_0x0d9e('0x19'),'value':_0x11b340['name']},{'name':'direction','value':_0x393f5a}];if(_0x3b8633[_0x0d9e('0x1a')]){_[_0x0d9e('0x1b')](_0x3b8633,function(_0x3dcd8e){if(_0x2795c4[_0x3dcd8e[_0x0d9e('0x1c')]]){_0x51edf5['push']({'name':_0x3dcd8e[_0x0d9e('0x1d')],'value':_0x2795c4[_0x3dcd8e[_0x0d9e('0x1c')]]});}});}return request({'form':{'method':_0x0d9e('0x1e'),'input_type':'JSON','response_type':_0x0d9e('0x1f'),'rest_data':JSON['stringify']({'session':_0x297c85['id'],'module_name':_0x0d9e('0x20'),'name_value_list':_0x51edf5})}});}function getAuth(_0x38dd71){return util[_0x0d9e('0x21')]('Basic\x20%s',new Buffer(_0x38dd71['apiKey']+':X')[_0x0d9e('0x22')](_0x0d9e('0x23')));}function getServerInfo(_0x113362){return request({'form':{'method':_0x0d9e('0x24'),'input_type':'JSON','response_type':_0x0d9e('0x1f'),'rest_data':JSON[_0x0d9e('0x25')]({'session':_0x113362['id']})}});}function getUser(_0x5b1d01,_0x5173fe,_0x3ae94e){if(!_[_0x0d9e('0x26')](_0x5173fe)){logger['info'](_0x0d9e('0x27'),_0x5173fe);return request({'form':{'method':_0x0d9e('0x28'),'input_type':_0x0d9e('0x1f'),'response_type':_0x0d9e('0x1f'),'rest_data':JSON['stringify']({'session':_0x3ae94e['id'],'module_name':_0x0d9e('0x29'),'query':util['format'](_0x0d9e('0x2a'),_0x5173fe),'order_by':'','offset':'0','select_fields':['id',_0x0d9e('0xd'),_0x0d9e('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x0d9e('0x2c')](function(_0x27fba9){if(_0x27fba9[_0x0d9e('0x2d')][_0x0d9e('0x1a')]){var _0x43d74b=_['find'](_0x27fba9[_0x0d9e('0x2d')],function(_0x366f9e){return _0x366f9e[_0x0d9e('0x2e')][_0x0d9e('0x2b')][_0x0d9e('0x2f')]===_0x5173fe;});if(_0x43d74b){logger['info'](_0x0d9e('0x30'));return BPromise['resolve']({'id':_0x43d74b[_0x0d9e('0x2e')]['id'][_0x0d9e('0x2f')],'name':_0x43d74b[_0x0d9e('0x2e')][_0x0d9e('0xd')][_0x0d9e('0x2f')]});}}logger[_0x0d9e('0x31')](_0x0d9e('0x32'));return BPromise[_0x0d9e('0x33')]({'id':_0x3ae94e[_0x0d9e('0x2e')][_0x0d9e('0x34')][_0x0d9e('0x2f')],'name':_0x3ae94e[_0x0d9e('0x2e')][_0x0d9e('0x2b')]['value']});});}else{logger[_0x0d9e('0x31')](_0x0d9e('0x35'));return BPromise['resolve']({'id':_0x3ae94e[_0x0d9e('0x2e')]['user_id'][_0x0d9e('0x2f')],'name':_0x3ae94e[_0x0d9e('0x2e')][_0x0d9e('0x2b')]['value']});}}function getEndUser(_0x5cc55d,_0x561fa6,_0x1be7e5,_0x23fc9a){logger['info']('Searching\x20enduser\x20with\x20phone',_0x1be7e5);return request({'form':{'method':'get_entry_list','input_type':_0x0d9e('0x1f'),'response_type':'JSON','rest_data':JSON[_0x0d9e('0x25')]({'session':_0x23fc9a['id'],'module_name':_0x0d9e('0x18'),'query':util[_0x0d9e('0x21')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x1be7e5),'order_by':'','offset':'0','select_fields':['id',_0x0d9e('0xd'),_0x0d9e('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x0d9e('0x2c')](function(_0x2eba81){if(_0x2eba81[_0x0d9e('0x2d')]['length']){var _0x6510d9=_[_0x0d9e('0x37')](_0x2eba81['entry_list'],function(_0x478a2d){return _0x478a2d[_0x0d9e('0x2e')][_0x0d9e('0x36')]['value']===_0x1be7e5;});if(_0x6510d9){logger[_0x0d9e('0x31')](_0x0d9e('0x38'));return BPromise[_0x0d9e('0x33')]({'id':_0x6510d9[_0x0d9e('0x2e')]['id'][_0x0d9e('0x2f')],'name':_0x6510d9['name_value_list'][_0x0d9e('0xd')][_0x0d9e('0x2f')],'phone':_0x6510d9[_0x0d9e('0x2e')][_0x0d9e('0x36')]['value']});}}else{logger[_0x0d9e('0x31')](_0x0d9e('0x39'));return request({'form':{'method':_0x0d9e('0x1e'),'input_type':_0x0d9e('0x1f'),'response_type':_0x0d9e('0x1f'),'rest_data':JSON[_0x0d9e('0x25')]({'session':_0x23fc9a['id'],'module_name':'Contacts','name_value_list':[{'name':_0x0d9e('0x3a'),'value':_0x561fa6!==_0x0d9e('0x3b')?_0x561fa6:util[_0x0d9e('0x21')](_0x0d9e('0x3c'),_0x1be7e5)},{'name':_0x0d9e('0x36'),'value':_0x1be7e5}]})}})[_0x0d9e('0x2c')](function(_0x821ac5){logger[_0x0d9e('0x31')](_0x0d9e('0x3d'));return BPromise[_0x0d9e('0x33')]({'id':_0x821ac5['id'],'name':_0x821ac5[_0x0d9e('0x2d')]['first_name'][_0x0d9e('0x2f')],'phone':_0x821ac5[_0x0d9e('0x2d')]['phone_home'][_0x0d9e('0x2f')]});});}});}function request(_0x3b6d99){logger[_0x0d9e('0x3e')](_0x0d9e('0x3f'),JSON['stringify'](_0x3b6d99));return rp(_['merge'](def,_0x3b6d99));}function getTags(_0x174a07,_0x591932){var _0x34f349=[];if(_0x174a07&&_0x174a07[_0x0d9e('0x1a')]>0x0){_0x34f349=_[_0x0d9e('0x40')](_0x174a07,_0x591932);}return _0x34f349;}function getCustomFields(_0x44d804,_0x4e6a17){var _0x4bcab6=[];var _0x39acbc={'custom_fields':[]};if(_0x44d804[_0x0d9e('0x1a')]>0x0){_[_0x0d9e('0x1b')](_0x44d804,function(_0x233138){if(_0x233138[_0x0d9e('0x41')]===_0x0d9e('0x42')&&_0x233138[_0x0d9e('0x43')]&&!_0x233138['customField']){_0x39acbc[_0x233138[_0x0d9e('0x43')]['toLowerCase']()]=_0x233138[_0x0d9e('0x44')][_0x0d9e('0x22')]();}else if(_0x233138[_0x0d9e('0x41')]===_0x0d9e('0x42')&&_0x233138[_0x0d9e('0x1d')]&&_0x233138[_0x0d9e('0x45')]){_0x39acbc[_0x0d9e('0x46')][_0x0d9e('0x47')]({'id':_0x233138['idField'],'value':_0x233138[_0x0d9e('0x44')][_0x0d9e('0x22')]()});}else if(_0x233138[_0x0d9e('0x41')]===_0x0d9e('0x48')&&_0x233138[_0x0d9e('0x1c')]&&_0x233138['idField']&&_0x233138['customField']){_0x4e6a17[_0x233138[_0x0d9e('0x1c')]]&&_0x39acbc[_0x0d9e('0x46')]['push']({'id':_0x233138[_0x0d9e('0x1d')],'value':_0x4e6a17[_0x233138[_0x0d9e('0x1c')]]['toString']()});}else if(_0x233138['type']===_0x0d9e('0x49')&&_0x233138['Variable']&&_0x233138[_0x0d9e('0x4a')]['name']&&_0x233138[_0x0d9e('0x1d')]&&_0x233138[_0x0d9e('0x45')]){_0x4e6a17[_0x233138[_0x0d9e('0x4a')][_0x0d9e('0xd')]['toLowerCase']()]&&_0x39acbc[_0x0d9e('0x46')][_0x0d9e('0x47')]({'id':_0x233138[_0x0d9e('0x1d')],'value':_0x4e6a17[_0x233138[_0x0d9e('0x4a')][_0x0d9e('0xd')][_0x0d9e('0x4b')]()][_0x0d9e('0x22')]()});}});}return _0x39acbc;}function getConnection(_0xeabb64){return request({'method':_0x0d9e('0xb'),'form':{'method':_0x0d9e('0x4c'),'input_type':_0x0d9e('0x1f'),'response_type':_0x0d9e('0x1f'),'rest_data':JSON[_0x0d9e('0x25')]({'user_auth':{'user_name':_0xeabb64[_0x0d9e('0x4d')],'password':_0xeabb64[_0x0d9e('0x4e')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20integration'})}})['then'](function(_0x209097){var _0x4c8bd1=_0x209097;if(_0x4c8bd1['id']){def[_0x0d9e('0x4f')]=_0x4c8bd1['id'];return BPromise[_0x0d9e('0x33')](_0x4c8bd1);}else{throw new Error(util['format'](_0x0d9e('0x50'),_0xeabb64['id']));}});}function setRelationship(_0x1002b3,_0x2b13d9,_0x3f6ae3,_0x37bfcb){return request({'form':{'method':_0x0d9e('0x51'),'input_type':'JSON','response_type':_0x0d9e('0x1f'),'rest_data':JSON[_0x0d9e('0x25')]({'session':_0x1002b3['id'],'module_name':_0x0d9e('0x20'),'module_id':_0x3f6ae3['id'],'link_field_name':_0x37bfcb,'related_ids':[_0x2b13d9['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x38c584,_0x17dcf1,_0x3aa7c5,_0x4e33b9,_0x596d49,_0x55e3b2){var _0x344757,_0x5d9478,_0x41090a,_0x38fb10;_0x55e3b2[_0x0d9e('0x52')]=intUtil['stripTrailingSlash'](_0x55e3b2['remoteUri']);_0x55e3b2[_0x0d9e('0x53')]=intUtil[_0x0d9e('0x54')](_0x55e3b2[_0x0d9e('0x53')]);def[_0x0d9e('0x55')]=util[_0x0d9e('0x21')](_0x0d9e('0x56'),_0x55e3b2['remoteUri']);if(_0x596d49&&_0x596d49['monitor_format']){logger[_0x0d9e('0x31')](_0x0d9e('0x57'),_0x0d9e('0x58'));_0x17dcf1[_0x0d9e('0x59')]=util[_0x0d9e('0x21')](_0x0d9e('0x5a'),_0x55e3b2['serverUrl'],_0x17dcf1[_0x0d9e('0x5b')],md5(_0x17dcf1[_0x0d9e('0x5b')]));}else{_0x17dcf1['recordingURL']='';}return getConnection(_0x55e3b2)[_0x0d9e('0x2c')](function(_0x456a64){_0x38fb10=_0x456a64;return getUser(_0x55e3b2,_0x4e33b9['name'],_0x38fb10);})[_0x0d9e('0x2c')](function(_0x59c18e){_0x344757=_0x59c18e;logger[_0x0d9e('0x31')](_0x0d9e('0x5c'),_0x344757['id']);return getEndUser(_0x55e3b2,_0x17dcf1[_0x0d9e('0x5d')],_0x17dcf1[_0x0d9e('0x5e')],_0x38fb10);})['then'](function(_0x50f7b0){_0x5d9478=_0x50f7b0;logger[_0x0d9e('0x31')](_0x0d9e('0x5f'),_0x5d9478['id']);return getTicket(_0x55e3b2,_0x344757,_0x5d9478,_0x3aa7c5,_0x17dcf1,_0x3aa7c5[_0x0d9e('0x60')],_0x38fb10,_0x0d9e('0x61'));})['then'](function(_0x404363){_0x41090a=_0x404363;logger['info'](_0x0d9e('0x62'));logger[_0x0d9e('0x31')]('The\x20Ticket\x20ID\x20is:',_0x41090a['id']);return setRelationship(_0x38fb10,_0x344757,_0x41090a,_0x0d9e('0x63'));})[_0x0d9e('0x2c')](function(){return setRelationship(_0x38fb10,_0x5d9478,_0x41090a,_0x0d9e('0x64'));})[_0x0d9e('0x2c')](function(){return getServerInfo(_0x38fb10);})[_0x0d9e('0x2c')](function(_0x27436e){var _0x157a69=parseInt(_0x27436e[_0x0d9e('0x65')][_0x0d9e('0x66')](0x0));var _0x501d3c=util[_0x0d9e('0x21')](_0x0d9e('0x67'),_0x55e3b2[_0x0d9e('0x52')],_0x41090a['id']);if(_0x157a69>0x6){_0x501d3c=util[_0x0d9e('0x21')](_0x0d9e('0x68'),_0x55e3b2[_0x0d9e('0x52')],_0x41090a['id']);}logger['info'](_0x0d9e('0x57'),_0x0d9e('0x69'));emit(util[_0x0d9e('0x21')]('user:%s',_0x4e33b9[_0x0d9e('0xd')]),'trigger:browser:url',{'uri':_0x501d3c});})[_0x0d9e('0x6a')](function(_0x36bef2){logger[_0x0d9e('0x6b')](_0x0d9e('0x57'),JSON[_0x0d9e('0x25')](_0x36bef2));});};exports[_0x0d9e('0x6c')]=function(_0x38f5fb,_0x167246,_0x1a47a0,_0x15dd4e,_0x47fd77,_0x364a32,_0x437401){var _0x53af34,_0x1b8a98,_0x50f33c,_0xc7f389;_0x364a32['remoteUri']=intUtil[_0x0d9e('0x54')](_0x364a32['remoteUri']);_0x364a32[_0x0d9e('0x53')]=intUtil['stripTrailingSlash'](_0x364a32[_0x0d9e('0x53')]);def[_0x0d9e('0x55')]=util[_0x0d9e('0x21')](_0x0d9e('0x56'),_0x364a32[_0x0d9e('0x52')]);if(_0x437401&&_0x437401[_0x0d9e('0x6d')]&&_0x437401[_0x0d9e('0x6d')]!==_0x0d9e('0x6e')){logger[_0x0d9e('0x31')](_0x0d9e('0x6f'),_0x0d9e('0x58'));_0x167246[_0x0d9e('0x59')]=util[_0x0d9e('0x21')](_0x0d9e('0x5a'),_0x364a32['serverUrl'],_0x167246[_0x0d9e('0x5b')],md5(_0x167246[_0x0d9e('0x5b')]));}return getConnection(_0x364a32)[_0x0d9e('0x2c')](function(_0x4f582f){_0xc7f389=_0x4f582f;return getUser(_0x364a32,_0x15dd4e[_0x0d9e('0xd')],_0xc7f389);})[_0x0d9e('0x2c')](function(_0x421f2b){_0x53af34=_0x421f2b;logger[_0x0d9e('0x31')]('The\x20User\x20ID\x20is:',_0x53af34['id']);return getEndUser(_0x364a32,_0x167246[_0x0d9e('0x70')],_0x167246[_0x0d9e('0x71')],_0xc7f389);})['then'](function(_0x319c69){_0x1b8a98=_0x319c69;logger[_0x0d9e('0x31')]('The\x20Enduser\x20ID\x20is:',_0x1b8a98['id']);return getTicket(_0x364a32,_0x53af34,_0x1b8a98,_0x1a47a0,_0x167246,_0x1a47a0['Fields'],_0xc7f389,'Outbound');})[_0x0d9e('0x2c')](function(_0x3662db){_0x50f33c=_0x3662db;logger[_0x0d9e('0x31')](_0x0d9e('0x62'));logger[_0x0d9e('0x31')](_0x0d9e('0x72'),_0x50f33c['id']);return setRelationship(_0xc7f389,_0x53af34,_0x50f33c,_0x0d9e('0x63'));})['then'](function(){return setRelationship(_0xc7f389,_0x1b8a98,_0x50f33c,_0x0d9e('0x64'));})[_0x0d9e('0x2c')](function(){return getServerInfo(_0xc7f389);})[_0x0d9e('0x2c')](function(_0x543cb5){var _0x3730a4=parseInt(_0x543cb5[_0x0d9e('0x65')][_0x0d9e('0x66')](0x0));var _0x32de89=util[_0x0d9e('0x21')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x364a32[_0x0d9e('0x52')],_0x50f33c['id']);if(_0x3730a4>0x6){_0x32de89=util[_0x0d9e('0x21')](_0x0d9e('0x68'),_0x364a32['remoteUri'],_0x50f33c['id']);}logger['info']('[OUTBOUND]',_0x0d9e('0x69'));emit(util[_0x0d9e('0x21')]('user:%s',_0x15dd4e['name']),'trigger:browser:url',{'uri':_0x32de89});})['catch'](function(_0x121403){logger[_0x0d9e('0x6b')](_0x0d9e('0x6f'),JSON[_0x0d9e('0x25')](_0x121403));});};exports['unmanaged']=function(_0x2059ec,_0x416b07,_0x58313e,_0x3afdf7,_0x3fafa5,_0x1cd433){var _0x3f96ea,_0x49eef8,_0x16b433,_0x50307b;_0x1cd433[_0x0d9e('0x52')]=intUtil[_0x0d9e('0x54')](_0x1cd433['remoteUri']);_0x1cd433[_0x0d9e('0x53')]=intUtil[_0x0d9e('0x54')](_0x1cd433[_0x0d9e('0x53')]);def[_0x0d9e('0x55')]=util[_0x0d9e('0x21')](_0x0d9e('0x56'),_0x1cd433['remoteUri']);if(_0x3fafa5&&_0x3fafa5[_0x0d9e('0x73')]){logger[_0x0d9e('0x31')]('['+_0x416b07[_0x0d9e('0x74')]['toUpperCase']()+']',_0x0d9e('0x58'));_0x416b07[_0x0d9e('0x59')]=util[_0x0d9e('0x21')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1cd433['serverUrl'],_0x416b07[_0x0d9e('0x5b')],md5(_0x416b07[_0x0d9e('0x5b')]));}else{_0x416b07[_0x0d9e('0x59')]='';}return getConnection(_0x1cd433)[_0x0d9e('0x2c')](function(_0x11e0db){_0x50307b=_0x11e0db;if(!_['isNil'](_0x3afdf7)){return getUser(_0x1cd433,_0x3afdf7['name'],_0x50307b);}else{return getUser(_0x1cd433,null,_0x50307b);}})[_0x0d9e('0x2c')](function(_0x24a24e){_0x3f96ea=_0x24a24e;logger[_0x0d9e('0x31')]('The\x20User\x20ID\x20is:',_0x3f96ea['id']);return getEndUser(_0x1cd433,_0x416b07[_0x0d9e('0x5d')],_0x416b07[_0x0d9e('0x5e')],_0x50307b);})[_0x0d9e('0x2c')](function(_0xc48961){_0x49eef8=_0xc48961;logger[_0x0d9e('0x31')](_0x0d9e('0x5f'),_0x49eef8['id']);return getTicket(_0x1cd433,_0x3f96ea,_0x49eef8,_0x58313e,_0x416b07,_0x58313e[_0x0d9e('0x60')],_0x50307b,_0x0d9e('0x61'));})[_0x0d9e('0x2c')](function(_0x10935f){_0x16b433=_0x10935f;logger[_0x0d9e('0x31')]('Ticket\x20created!');logger[_0x0d9e('0x31')](_0x0d9e('0x72'),_0x16b433['id']);return setRelationship(_0x50307b,_0x3f96ea,_0x16b433,_0x0d9e('0x63'));})[_0x0d9e('0x2c')](function(){return setRelationship(_0x50307b,_0x49eef8,_0x16b433,'contacts');})[_0x0d9e('0x2c')](function(){return getServerInfo(_0x50307b);})[_0x0d9e('0x6a')](function(_0x286a26){logger[_0x0d9e('0x6b')]('['+_0x416b07[_0x0d9e('0x74')][_0x0d9e('0x75')]()+']',JSON['stringify'](_0x286a26));});};
\ No newline at end of file
index 49d5521..d0f3fe2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x491a=['variable','name','join','stripTrailingSlash','substring','validateEmail','isNil','test','lodash','util','getString','type','string','push','content','variableName','toString','customVariable','Variable','toLowerCase','keyValue','key','format','%s:\x20%s'];(function(_0x3bcded,_0x4611dc){var _0x16ba70=function(_0x4dcfc6){while(--_0x4dcfc6){_0x3bcded['push'](_0x3bcded['shift']());}};_0x16ba70(++_0x4611dc);}(_0x491a,0xb0));var _0xa491=function(_0x203b5c,_0x2384f1){_0x203b5c=_0x203b5c-0x0;var _0x20a057=_0x491a[_0x203b5c];return _0x20a057;};'use strict';var _=require(_0xa491('0x0'));var util=require(_0xa491('0x1'));exports[_0xa491('0x2')]=function(_0x56521f,_0x3056a9,_0x2bc0d3){var _0x5cd1e6=[];if(_0x56521f['length']>0x0){var _0x400d5f=_['sortBy'](_0x56521f,['id']);for(var _0x5ea27f=0x0;_0x5ea27f<_0x400d5f['length'];_0x5ea27f++){var _0x3adfe6=_0x400d5f[_0x5ea27f];if(_0x3adfe6[_0xa491('0x3')]===_0xa491('0x4')){_0x5cd1e6[_0xa491('0x5')](_0x3adfe6[_0xa491('0x6')]);}else if(_0x3adfe6[_0xa491('0x3')]==='variable'&&_0x3adfe6[_0xa491('0x7')]){_0x3056a9[_0x3adfe6[_0xa491('0x7')]]&&_0x5cd1e6[_0xa491('0x5')](_0x3056a9[_0x3adfe6[_0xa491('0x7')]][_0xa491('0x8')]());}else if(_0x3adfe6[_0xa491('0x3')]===_0xa491('0x9')&&_0x3adfe6[_0xa491('0xa')]&&_0x3adfe6[_0xa491('0xa')]['name']){_0x3056a9[_0x3adfe6[_0xa491('0xa')]['name'][_0xa491('0xb')]()]&&_0x5cd1e6[_0xa491('0x5')](_0x3056a9[_0x3adfe6[_0xa491('0xa')]['name'][_0xa491('0xb')]()][_0xa491('0x8')]());}else if(_0x3adfe6[_0xa491('0x3')]===_0xa491('0xc')){if(_0x3adfe6['keyType']===_0xa491('0x4')&&_0x3adfe6[_0xa491('0xd')]){_0x5cd1e6['push'](util[_0xa491('0xe')](_0xa491('0xf'),_0x3adfe6[_0xa491('0xd')],_0x3adfe6['keyContent']));}else if(_0x3adfe6['keyType']===_0xa491('0x10')&&_0x3adfe6[_0xa491('0x7')]&&_0x3adfe6[_0xa491('0xd')]){_0x3056a9[_0x3adfe6[_0xa491('0x7')]]&&_0x5cd1e6['push'](util[_0xa491('0xe')](_0xa491('0xf'),_0x3adfe6[_0xa491('0xd')],_0x3056a9[_0x3adfe6[_0xa491('0x7')]]));}else if(_0x3adfe6['keyType']===_0xa491('0x9')&&_0x3adfe6[_0xa491('0xa')]&&_0x3adfe6[_0xa491('0xa')]['name']&&_0x3adfe6[_0xa491('0xd')]){_0x3056a9[_0x3adfe6[_0xa491('0xa')][_0xa491('0x11')]['toLowerCase']()]&&_0x5cd1e6['push'](util[_0xa491('0xe')](_0xa491('0xf'),_0x3adfe6['key'],_0x3056a9[_0x3adfe6[_0xa491('0xa')][_0xa491('0x11')][_0xa491('0xb')]()]));}}}}return _0x5cd1e6[_0xa491('0x12')](_0x2bc0d3);};exports[_0xa491('0x13')]=function(_0x51f5d2){var _0x10ed10=_0x51f5d2['slice'](-0x1);if(_0x10ed10==='/'){_0x51f5d2=_0x51f5d2[_0xa491('0x14')](0x0,_0x51f5d2['lastIndexOf'](_0x10ed10));}return _0x51f5d2;};exports[_0xa491('0x15')]=function(_0xe2a03a){if(!_[_0xa491('0x16')](_0xe2a03a)&&_0xe2a03a!==''){var _0x1a25f8=/^(([^<>()\[\]\\.,;:\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 _0x1a25f8[_0xa491('0x17')](String(_0xe2a03a)['toLowerCase']());}else{return![];}};
\ No newline at end of file
+var _0xe208=['slice','substring','validateEmail','isNil','test','lodash','util','length','sortBy','type','string','push','content','variable','variableName','toString','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','customVariable','join','stripTrailingSlash'];(function(_0x46a068,_0x28b6ef){var _0x2b49a3=function(_0x15a6e2){while(--_0x15a6e2){_0x46a068['push'](_0x46a068['shift']());}};_0x2b49a3(++_0x28b6ef);}(_0xe208,0x139));var _0x8e20=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xe208[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0x8e20('0x0'));var util=require(_0x8e20('0x1'));exports['getString']=function(_0x3e3e10,_0x3c1159,_0x3549f2){var _0x96e499=[];if(_0x3e3e10[_0x8e20('0x2')]>0x0){var _0x3defe6=_[_0x8e20('0x3')](_0x3e3e10,['id']);for(var _0x18c12e=0x0;_0x18c12e<_0x3defe6[_0x8e20('0x2')];_0x18c12e++){var _0x39e89e=_0x3defe6[_0x18c12e];if(_0x39e89e[_0x8e20('0x4')]===_0x8e20('0x5')){_0x96e499[_0x8e20('0x6')](_0x39e89e[_0x8e20('0x7')]);}else if(_0x39e89e[_0x8e20('0x4')]===_0x8e20('0x8')&&_0x39e89e[_0x8e20('0x9')]){_0x3c1159[_0x39e89e['variableName']]&&_0x96e499[_0x8e20('0x6')](_0x3c1159[_0x39e89e[_0x8e20('0x9')]][_0x8e20('0xa')]());}else if(_0x39e89e[_0x8e20('0x4')]==='customVariable'&&_0x39e89e[_0x8e20('0xb')]&&_0x39e89e[_0x8e20('0xb')][_0x8e20('0xc')]){_0x3c1159[_0x39e89e['Variable']['name'][_0x8e20('0xd')]()]&&_0x96e499[_0x8e20('0x6')](_0x3c1159[_0x39e89e['Variable'][_0x8e20('0xc')][_0x8e20('0xd')]()]['toString']());}else if(_0x39e89e[_0x8e20('0x4')]===_0x8e20('0xe')){if(_0x39e89e[_0x8e20('0xf')]===_0x8e20('0x5')&&_0x39e89e[_0x8e20('0x10')]){_0x96e499[_0x8e20('0x6')](util[_0x8e20('0x11')](_0x8e20('0x12'),_0x39e89e[_0x8e20('0x10')],_0x39e89e[_0x8e20('0x13')]));}else if(_0x39e89e[_0x8e20('0xf')]===_0x8e20('0x8')&&_0x39e89e[_0x8e20('0x9')]&&_0x39e89e[_0x8e20('0x10')]){_0x3c1159[_0x39e89e[_0x8e20('0x9')]]&&_0x96e499[_0x8e20('0x6')](util[_0x8e20('0x11')]('%s:\x20%s',_0x39e89e[_0x8e20('0x10')],_0x3c1159[_0x39e89e[_0x8e20('0x9')]]));}else if(_0x39e89e[_0x8e20('0xf')]===_0x8e20('0x14')&&_0x39e89e[_0x8e20('0xb')]&&_0x39e89e['Variable']['name']&&_0x39e89e[_0x8e20('0x10')]){_0x3c1159[_0x39e89e['Variable'][_0x8e20('0xc')]['toLowerCase']()]&&_0x96e499[_0x8e20('0x6')](util[_0x8e20('0x11')](_0x8e20('0x12'),_0x39e89e[_0x8e20('0x10')],_0x3c1159[_0x39e89e['Variable'][_0x8e20('0xc')][_0x8e20('0xd')]()]));}}}}return _0x96e499[_0x8e20('0x15')](_0x3549f2);};exports[_0x8e20('0x16')]=function(_0x2f6353){var _0x533bbf=_0x2f6353[_0x8e20('0x17')](-0x1);if(_0x533bbf==='/'){_0x2f6353=_0x2f6353[_0x8e20('0x18')](0x0,_0x2f6353['lastIndexOf'](_0x533bbf));}return _0x2f6353;};exports[_0x8e20('0x19')]=function(_0x49747c){if(!_[_0x8e20('0x1a')](_0x49747c)&&_0x49747c!==''){var _0x198c10=/^(([^<>()\[\]\\.,;:\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 _0x198c10[_0x8e20('0x1b')](String(_0x49747c)[_0x8e20('0xd')]());}else{return![];}};
\ No newline at end of file
index a72b0d1..d76f6f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0xe13902,_0x37f1f1){var _0x5628e2=function(_0x431f3b){while(--_0x431f3b){_0xe13902['push'](_0xe13902['shift']());}};_0x5628e2(++_0x37f1f1);}(_0x9c44,0x178));var _0x49c4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9c44[_0x334841];return _0x5beb4b;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});};
\ No newline at end of file
+var _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(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xe706,0xa3));var _0x6e70=function(_0x288478,_0x23303e){_0x288478=_0x288478-0x0;var _0x234c05=_0xe706[_0x288478];return _0x234c05;};'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 207283b..566dea8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe20b=['customField','nameField','toLowerCase','string','idField','custom_fields','push','content','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','integrationTab','user:%s','replace','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','toUpperCase','The\x20User\x20ID\x20is:','lastevent','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','defaults','localhost','redis','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','merge','Tags','name','Subjects','getString','Descriptions','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','then','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','type:user\x20role:end-user\x20phone:%s','length','end-user','first','Enduser\x20found!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','username','authType','token','toString','base64','debug','stringify','GET','map','includes','picklist','type'];(function(_0x42b1f6,_0x3df91b){var _0x37ee4f=function(_0x55df2){while(--_0x55df2){_0x42b1f6['push'](_0x42b1f6['shift']());}};_0x37ee4f(++_0x3df91b);}(_0xe20b,0x180));var _0xbe20=function(_0x509ce7,_0x3fe887){_0x509ce7=_0x509ce7-0x0;var _0x5752b7=_0xe20b[_0x509ce7];return _0x5752b7;};'use strict';var _=require(_0xbe20('0x0'));var rp=require('request-promise');var md5=require(_0xbe20('0x1'));var util=require(_0xbe20('0x2'));var Redis=require(_0xbe20('0x3'));var intUtil=require(_0xbe20('0x4'));var config=require(_0xbe20('0x5'));var logger=require(_0xbe20('0x6'))(_0xbe20('0x7'));config['redis']=_[_0xbe20('0x8')](config['redis'],{'host':_0xbe20('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbe20('0xa')]));function emit(_0x5e12b5,_0x14ff48,_0x5bb4ef){io['to'](_0x5e12b5)['emit'](_0x14ff48,_0x5bb4ef);}var headers={'Content-Type':'application/json','Accept':_0xbe20('0xb')};function getTicket(_0x48e5d1,_0x18f6ce,_0x13b0be,_0x1e6169,_0x59cf82){logger[_0xbe20('0xc')](_0xbe20('0xd'));return request({'uri':util[_0xbe20('0xe')](_0xbe20('0xf'),_0x48e5d1['remoteUri']),'method':_0xbe20('0x10'),'body':{'ticket':_[_0xbe20('0x11')]({'requester_id':_0x13b0be['id'],'submitter_id':_0x18f6ce?_0x18f6ce['id']:undefined,'assignee_id':_0x18f6ce?_0x18f6ce['id']:undefined,'tags':getTags(_0x1e6169[_0xbe20('0x12')],_0xbe20('0x13')),'subject':intUtil['getString'](_0x1e6169[_0xbe20('0x14')],_0x59cf82,'\x20'),'description':intUtil[_0xbe20('0x15')](_0x1e6169[_0xbe20('0x16')],_0x59cf82,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x1e6169[_0xbe20('0x16')],_0x59cf82,'\x0a')}},getCustomFields(_0x1e6169['Fields'],_0x59cf82))}})['then'](function(_0x489672){logger[_0xbe20('0xc')](_0xbe20('0x17'));return _0x489672['ticket'];});}function getUser(_0x256aaa,_0x2a1710){if(intUtil[_0xbe20('0x18')](_0x2a1710)){logger[_0xbe20('0xc')](_0xbe20('0x19'),_0x2a1710);return request({'uri':util['format'](_0xbe20('0x1a'),_0x256aaa[_0xbe20('0x1b')]),'qs':{'query':util[_0xbe20('0xe')](_0xbe20('0x1c'),_0x2a1710)}})[_0xbe20('0x1d')](function(_0x5bc5f4){if(_0x5bc5f4[_0xbe20('0x1e')]){logger[_0xbe20('0xc')](_0xbe20('0x1f'));return _[_0xbe20('0x20')](_0x5bc5f4[_0xbe20('0x21')],{'email':_0x2a1710,'role':_0xbe20('0x22')});}else{logger['info'](_0xbe20('0x23'));return request({'uri':util[_0xbe20('0xe')]('%s/users/me.json',_0x256aaa['remoteUri'])})['then'](function(_0x546d64){logger[_0xbe20('0xc')](_0xbe20('0x24'));return _0x546d64['user'];});}});}else{logger[_0xbe20('0xc')](_0xbe20('0x23'));return request({'uri':util['format']('%s/users/me.json',_0x256aaa[_0xbe20('0x1b')])})[_0xbe20('0x1d')](function(_0x5cec24){logger['info'](_0xbe20('0x24'));return _0x5cec24[_0xbe20('0x25')];});}}function getEndUser(_0x31f5e9,_0x391079,_0x5aba22){logger[_0xbe20('0xc')]('Searching\x20enduser\x20with\x20phone',_0x5aba22);return request({'uri':util[_0xbe20('0xe')](_0xbe20('0x1a'),_0x31f5e9[_0xbe20('0x1b')]),'qs':{'query':util[_0xbe20('0xe')](_0xbe20('0x26'),_0x5aba22)}})[_0xbe20('0x1d')](function(_0x4723c2){var _0x16d755;if(_0x4723c2[_0xbe20('0x21')][_0xbe20('0x27')]){_0x4723c2[_0xbe20('0x21')]=_['filter'](_0x4723c2[_0xbe20('0x21')],{'suspended':![],'role':_0xbe20('0x28')});if(_0x4723c2[_0xbe20('0x21')]['length']){_0x16d755=_[_0xbe20('0x29')](_0x4723c2[_0xbe20('0x21')]);}}if(_0x16d755){logger['info'](_0xbe20('0x2a'));return _0x16d755;}else{logger[_0xbe20('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xbe20('0xe')](_0xbe20('0x2b'),_0x31f5e9[_0xbe20('0x1b')]),'method':_0xbe20('0x10'),'body':{'user':{'role':_0xbe20('0x28'),'name':util[_0xbe20('0xe')](_0xbe20('0x2c'),_0x391079||_0x5aba22),'phone':_0x5aba22}}})['then'](function(_0x2ff6a3){logger[_0xbe20('0xc')](_0xbe20('0x2d'));return _0x2ff6a3['user'];});}});}function getAuth(_0x4e7879){var _0x375afd;if(_0x4e7879['authType']===_0xbe20('0x2e')){_0x375afd=util['format'](_0xbe20('0x2f'),_0x4e7879[_0xbe20('0x30')],_0x4e7879[_0xbe20('0x2e')]);}else if(_0x4e7879[_0xbe20('0x31')]===_0xbe20('0x32')){_0x375afd=util[_0xbe20('0xe')]('%s/token:%s',_0x4e7879['username'],_0x4e7879[_0xbe20('0x32')]);}return util[_0xbe20('0xe')]('Basic\x20%s',new Buffer(_0x375afd)[_0xbe20('0x33')](_0xbe20('0x34')));}function request(_0x56f320){logger[_0xbe20('0x35')]('[HTTP]',JSON[_0xbe20('0x36')](_0x56f320));return rp(_[_0xbe20('0x8')](_0x56f320,{'method':_0xbe20('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x28609a,_0x485df9){var _0x400914=[];if(_0x28609a&&_0x28609a[_0xbe20('0x27')]>0x0){_0x400914=_[_0xbe20('0x38')](_0x28609a,_0x485df9);}return _0x400914;}function getCustomFields(_0x507b27,_0x2a6d97){var _0x112601=[];var _0x4be095={'custom_fields':[]};if(_0x507b27[_0xbe20('0x27')]>0x0){_['forEach'](_0x507b27,function(_0x3ae11c){if(_[_0xbe20('0x39')](['string',_0xbe20('0x3a')],_0x3ae11c[_0xbe20('0x3b')])&&_0x3ae11c['nameField']&&!_0x3ae11c[_0xbe20('0x3c')]){_0x4be095[_0x3ae11c[_0xbe20('0x3d')][_0xbe20('0x3e')]()]=_0x3ae11c['content'][_0xbe20('0x33')]();}else if(_['includes']([_0xbe20('0x3f'),_0xbe20('0x3a')],_0x3ae11c['type'])&&_0x3ae11c[_0xbe20('0x40')]&&_0x3ae11c[_0xbe20('0x3c')]){_0x4be095[_0xbe20('0x41')][_0xbe20('0x42')]({'id':_0x3ae11c[_0xbe20('0x40')],'value':_0x3ae11c[_0xbe20('0x43')][_0xbe20('0x33')]()});}else if(_0x3ae11c['type']===_0xbe20('0x44')&&_0x3ae11c[_0xbe20('0x45')]&&_0x3ae11c['idField']&&_0x3ae11c[_0xbe20('0x3c')]){_0x2a6d97[_0x3ae11c[_0xbe20('0x45')]]&&_0x4be095['custom_fields'][_0xbe20('0x42')]({'id':_0x3ae11c[_0xbe20('0x40')],'value':_0x2a6d97[_0x3ae11c['variableName']][_0xbe20('0x33')]()});}else if(_0x3ae11c[_0xbe20('0x3b')]===_0xbe20('0x46')&&_0x3ae11c['Variable']&&_0x3ae11c[_0xbe20('0x47')][_0xbe20('0x13')]&&_0x3ae11c['idField']&&_0x3ae11c['customField']){_0x2a6d97[_0x3ae11c[_0xbe20('0x47')][_0xbe20('0x13')][_0xbe20('0x3e')]()]&&_0x4be095[_0xbe20('0x41')][_0xbe20('0x42')]({'id':_0x3ae11c['idField'],'value':_0x2a6d97[_0x3ae11c[_0xbe20('0x47')][_0xbe20('0x13')][_0xbe20('0x3e')]()]['toString']()});}});}return _0x4be095;}exports[_0xbe20('0x48')]=function(_0x1a8270,_0x249821,_0x119283,_0x410dd6,_0x57f9bb,_0x34e3a5){var _0x290986,_0x2abfb5;_0x34e3a5[_0xbe20('0x1b')]=intUtil[_0xbe20('0x49')](_0x34e3a5[_0xbe20('0x1b')]);_0x34e3a5[_0xbe20('0x4a')]=intUtil[_0xbe20('0x49')](_0x34e3a5[_0xbe20('0x4a')]);if(_0x57f9bb&&_0x57f9bb[_0xbe20('0x4b')]){logger[_0xbe20('0xc')]('[QUEUE]',_0xbe20('0x4c'));_0x249821[_0xbe20('0x4d')]=util[_0xbe20('0xe')](_0xbe20('0x4e'),_0x34e3a5[_0xbe20('0x4a')],_0x249821[_0xbe20('0x4f')],md5(_0x249821['uniqueid']));}else{_0x249821['recordingURL']='';}headers['Authorization']=getAuth(_0x34e3a5);return getUser(_0x34e3a5,_0x410dd6['email'])[_0xbe20('0x1d')](function(_0x73dbc1){_0x290986=_0x73dbc1;logger['info']('The\x20User\x20ID\x20is:',_0x290986['id']);return getEndUser(_0x34e3a5,_0x249821[_0xbe20('0x50')],_0x249821[_0xbe20('0x51')]);})['then'](function(_0x316e8d){_0x2abfb5=_0x316e8d;logger[_0xbe20('0xc')](_0xbe20('0x52'),_0x2abfb5['id']);return getTicket(_0x34e3a5,_0x290986,_0x2abfb5,_0x119283,_0x249821);})[_0xbe20('0x1d')](function(_0x88eb09){if(_0x88eb09){logger[_0xbe20('0xc')](_0xbe20('0x53'),_0x88eb09['id']);switch(_0x34e3a5['type']){case'integrationTab':logger[_0xbe20('0xc')](_0xbe20('0x54'),_0xbe20('0x55'));return request({'uri':util[_0xbe20('0xe')](_0xbe20('0x56'),_0x34e3a5[_0xbe20('0x1b')],_0x290986['id'],_0x88eb09['id']),'method':_0xbe20('0x10')});case _0xbe20('0x57'):logger[_0xbe20('0xc')]('[QUEUE]',_0xbe20('0x58'));emit(util['format']('user:%s',_0x410dd6['name']),_0xbe20('0x59'),{'uri':util[_0xbe20('0xe')]('%s/agent/tickets/%s',_0x34e3a5[_0xbe20('0x1b')]['replace'](_0xbe20('0x5a'),''),_0x88eb09['id'])});break;default:logger[_0xbe20('0x5b')]('[QUEUE]',_0xbe20('0x5c'));}}})[_0xbe20('0x5d')](function(_0x15b144){logger[_0xbe20('0x5b')](_0xbe20('0x5e'),util['inspect'](_0x15b144,{'showHidden':!![],'depth':null}));});};exports[_0xbe20('0x5f')]=function(_0x27ac4b,_0x5263fe,_0x47a8ac,_0x54fdfe,_0x5090bd,_0x50c9b2,_0x4d4fe9){var _0x1490ea,_0x7fc94e;_0x50c9b2[_0xbe20('0x1b')]=intUtil['stripTrailingSlash'](_0x50c9b2[_0xbe20('0x1b')]);_0x50c9b2[_0xbe20('0x4a')]=intUtil[_0xbe20('0x49')](_0x50c9b2[_0xbe20('0x4a')]);if(_0x4d4fe9&&_0x4d4fe9[_0xbe20('0x60')]&&_0x4d4fe9['recordingFormat']!==_0xbe20('0x61')){logger[_0xbe20('0xc')](_0xbe20('0x62'),_0xbe20('0x4c'));_0x5263fe[_0xbe20('0x4d')]=util['format'](_0xbe20('0x4e'),_0x50c9b2[_0xbe20('0x4a')],_0x5263fe['uniqueid'],md5(_0x5263fe[_0xbe20('0x4f')]));}headers[_0xbe20('0x63')]=getAuth(_0x50c9b2);return getUser(_0x50c9b2,_0x54fdfe['email'])[_0xbe20('0x1d')](function(_0x280084){_0x1490ea=_0x280084;logger[_0xbe20('0xc')]('The\x20User\x20ID\x20is:',_0x1490ea['id']);return getEndUser(_0x50c9b2,_0x5263fe[_0xbe20('0x64')],_0x5263fe[_0xbe20('0x65')]);})[_0xbe20('0x1d')](function(_0x2e94ef){_0x7fc94e=_0x2e94ef;logger['info'](_0xbe20('0x52'),_0x7fc94e['id']);return getTicket(_0x50c9b2,_0x1490ea,_0x7fc94e,_0x47a8ac,_0x5263fe);})['then'](function(_0x5570ec){if(_0x5570ec){logger[_0xbe20('0xc')](_0xbe20('0x53'),_0x5570ec['id']);switch(_0x50c9b2['type']){case _0xbe20('0x66'):logger[_0xbe20('0xc')](_0xbe20('0x62'),_0xbe20('0x55'));return request({'uri':util[_0xbe20('0xe')](_0xbe20('0x56'),_0x50c9b2[_0xbe20('0x1b')],_0x1490ea['id'],_0x5570ec['id']),'method':_0xbe20('0x10')});case _0xbe20('0x57'):logger[_0xbe20('0xc')](_0xbe20('0x62'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xbe20('0xe')](_0xbe20('0x67'),_0x54fdfe[_0xbe20('0x13')]),_0xbe20('0x59'),{'uri':util[_0xbe20('0xe')]('%s/agent/tickets/%s',_0x50c9b2[_0xbe20('0x1b')][_0xbe20('0x68')](_0xbe20('0x5a'),''),_0x5570ec['id'])});break;default:logger[_0xbe20('0x5b')](_0xbe20('0x62'),_0xbe20('0x5c'));}}})[_0xbe20('0x5d')](function(_0x1880ed){logger[_0xbe20('0x5b')](_0xbe20('0x69'),util[_0xbe20('0x6a')](_0x1880ed,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x2d712c,_0x18f99d,_0x46959e,_0x8a883b,_0x5e2440,_0x76a181){var _0x2b23b6,_0x34bdbc;_0x76a181[_0xbe20('0x1b')]=intUtil[_0xbe20('0x49')](_0x76a181['remoteUri']);_0x76a181[_0xbe20('0x4a')]=intUtil[_0xbe20('0x49')](_0x76a181[_0xbe20('0x4a')]);if(_0x5e2440&&_0x5e2440[_0xbe20('0x4b')]){logger[_0xbe20('0xc')]('['+_0x18f99d['lastevent'][_0xbe20('0x6b')]()+']',_0xbe20('0x4c'));_0x18f99d[_0xbe20('0x4d')]=util['format'](_0xbe20('0x4e'),_0x76a181['serverUrl'],_0x18f99d[_0xbe20('0x4f')],md5(_0x18f99d[_0xbe20('0x4f')]));}else{_0x18f99d[_0xbe20('0x4d')]='';}headers[_0xbe20('0x63')]=getAuth(_0x76a181);return getUser(_0x76a181)[_0xbe20('0x1d')](function(_0x1231d7){_0x2b23b6=_0x1231d7;logger[_0xbe20('0xc')](_0xbe20('0x6c'),_0x2b23b6['id']);return getEndUser(_0x76a181,_0x18f99d['calleridname'],_0x18f99d[_0xbe20('0x51')]);})[_0xbe20('0x1d')](function(_0x5d743a){_0x34bdbc=_0x5d743a;logger[_0xbe20('0xc')]('The\x20Enduser\x20ID\x20is:',_0x34bdbc['id']);return getTicket(_0x76a181,_0x2b23b6,_0x34bdbc,_0x46959e,_0x18f99d);})[_0xbe20('0x1d')](function(_0x2d23d6){if(_0x2d23d6){logger[_0xbe20('0xc')]('The\x20Ticket\x20ID\x20is:',_0x2d23d6['id']);}})[_0xbe20('0x5d')](function(_0x1a0eeb){logger[_0xbe20('0x5b')]('['+_0x18f99d[_0xbe20('0x6d')][_0xbe20('0x6b')]()+']'+_0xbe20('0x6e'),util[_0xbe20('0x6a')](_0x1a0eeb,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x4d30=['then','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','format','type:user\x20role:agent\x20email:%s','count','find','results','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','filter','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','%s/token:%s','Basic\x20%s','toString','base64','debug','stringify','GET','map','includes','nameField','customField','toLowerCase','string','picklist','type','idField','custom_fields','push','content','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','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','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','email','destcalleridname','destcalleridnum','[OUTBOUND]','replace','unmanaged','monitor_format','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','redis','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','merge','name','getString','Subjects','Descriptions','Fields'];(function(_0x45db9d,_0x3e60bf){var _0x29cb61=function(_0x19cb98){while(--_0x19cb98){_0x45db9d['push'](_0x45db9d['shift']());}};_0x29cb61(++_0x3e60bf);}(_0x4d30,0xc7));var _0x04d3=function(_0x1cd6ed,_0x23b1b4){_0x1cd6ed=_0x1cd6ed-0x0;var _0x2ee4a3=_0x4d30[_0x1cd6ed];return _0x2ee4a3;};'use strict';var _=require(_0x04d3('0x0'));var rp=require(_0x04d3('0x1'));var md5=require(_0x04d3('0x2'));var util=require(_0x04d3('0x3'));var Redis=require(_0x04d3('0x4'));var intUtil=require(_0x04d3('0x5'));var config=require(_0x04d3('0x6'));var logger=require(_0x04d3('0x7'))('zendesk');config['redis']=_[_0x04d3('0x8')](config[_0x04d3('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x450159,_0x1e532c,_0x49ae36){io['to'](_0x450159)[_0x04d3('0xa')](_0x1e532c,_0x49ae36);}var headers={'Content-Type':_0x04d3('0xb'),'Accept':_0x04d3('0xb')};function getTicket(_0x14b645,_0x59f53e,_0xb9e63b,_0x212bd9,_0x203684){logger[_0x04d3('0xc')](_0x04d3('0xd'));return request({'uri':util['format'](_0x04d3('0xe'),_0x14b645[_0x04d3('0xf')]),'method':_0x04d3('0x10'),'body':{'ticket':_[_0x04d3('0x11')]({'requester_id':_0xb9e63b['id'],'submitter_id':_0x59f53e?_0x59f53e['id']:undefined,'assignee_id':_0x59f53e?_0x59f53e['id']:undefined,'tags':getTags(_0x212bd9['Tags'],_0x04d3('0x12')),'subject':intUtil[_0x04d3('0x13')](_0x212bd9[_0x04d3('0x14')],_0x203684,'\x20'),'description':intUtil[_0x04d3('0x13')](_0x212bd9[_0x04d3('0x15')],_0x203684,'\x0a'),'comment':{'public':![],'body':intUtil[_0x04d3('0x13')](_0x212bd9[_0x04d3('0x15')],_0x203684,'\x0a')}},getCustomFields(_0x212bd9[_0x04d3('0x16')],_0x203684))}})[_0x04d3('0x17')](function(_0x1b820c){logger[_0x04d3('0xc')](_0x04d3('0x18'));return _0x1b820c[_0x04d3('0x19')];});}function getUser(_0x55560f,_0x57d4ab){if(intUtil['validateEmail'](_0x57d4ab)){logger['info'](_0x04d3('0x1a'),_0x57d4ab);return request({'uri':util[_0x04d3('0x1b')]('%s/search.json',_0x55560f[_0x04d3('0xf')]),'qs':{'query':util['format'](_0x04d3('0x1c'),_0x57d4ab)}})[_0x04d3('0x17')](function(_0x343211){if(_0x343211[_0x04d3('0x1d')]){logger[_0x04d3('0xc')]('Agent\x20found!');return _[_0x04d3('0x1e')](_0x343211[_0x04d3('0x1f')],{'email':_0x57d4ab,'role':_0x04d3('0x20')});}else{logger[_0x04d3('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x04d3('0x21'),_0x55560f[_0x04d3('0xf')])})['then'](function(_0x561624){logger['info'](_0x04d3('0x22'));return _0x561624[_0x04d3('0x23')];});}});}else{logger[_0x04d3('0xc')](_0x04d3('0x24'));return request({'uri':util[_0x04d3('0x1b')](_0x04d3('0x21'),_0x55560f[_0x04d3('0xf')])})[_0x04d3('0x17')](function(_0x5b7cb4){logger['info'](_0x04d3('0x22'));return _0x5b7cb4['user'];});}}function getEndUser(_0x3011e4,_0x53a2d7,_0x56bd24){logger[_0x04d3('0xc')]('Searching\x20enduser\x20with\x20phone',_0x56bd24);return request({'uri':util[_0x04d3('0x1b')]('%s/search.json',_0x3011e4[_0x04d3('0xf')]),'qs':{'query':util[_0x04d3('0x1b')]('type:user\x20role:end-user\x20phone:%s',_0x56bd24)}})[_0x04d3('0x17')](function(_0xb200c4){var _0x3d77fb;if(_0xb200c4['results'][_0x04d3('0x25')]){_0xb200c4[_0x04d3('0x1f')]=_[_0x04d3('0x26')](_0xb200c4[_0x04d3('0x1f')],{'suspended':![],'role':'end-user'});if(_0xb200c4[_0x04d3('0x1f')][_0x04d3('0x25')]){_0x3d77fb=_[_0x04d3('0x27')](_0xb200c4['results']);}}if(_0x3d77fb){logger[_0x04d3('0xc')](_0x04d3('0x28'));return _0x3d77fb;}else{logger[_0x04d3('0xc')](_0x04d3('0x29'));return request({'uri':util['format']('%s/users.json',_0x3011e4[_0x04d3('0xf')]),'method':'POST','body':{'user':{'role':'end-user','name':util[_0x04d3('0x1b')](_0x04d3('0x2a'),_0x53a2d7||_0x56bd24),'phone':_0x56bd24}}})[_0x04d3('0x17')](function(_0x38386e){logger[_0x04d3('0xc')](_0x04d3('0x2b'));return _0x38386e['user'];});}});}function getAuth(_0x20ac16){var _0x34cf52;if(_0x20ac16[_0x04d3('0x2c')]===_0x04d3('0x2d')){_0x34cf52=util[_0x04d3('0x1b')](_0x04d3('0x2e'),_0x20ac16[_0x04d3('0x2f')],_0x20ac16['password']);}else if(_0x20ac16[_0x04d3('0x2c')]==='token'){_0x34cf52=util[_0x04d3('0x1b')](_0x04d3('0x30'),_0x20ac16[_0x04d3('0x2f')],_0x20ac16['token']);}return util[_0x04d3('0x1b')](_0x04d3('0x31'),new Buffer(_0x34cf52)[_0x04d3('0x32')](_0x04d3('0x33')));}function request(_0x264652){logger[_0x04d3('0x34')]('[HTTP]',JSON[_0x04d3('0x35')](_0x264652));return rp(_['defaults'](_0x264652,{'method':_0x04d3('0x36'),'headers':headers,'json':!![]}));}function getTags(_0xb2e349,_0x3e798d){var _0x309e91=[];if(_0xb2e349&&_0xb2e349[_0x04d3('0x25')]>0x0){_0x309e91=_[_0x04d3('0x37')](_0xb2e349,_0x3e798d);}return _0x309e91;}function getCustomFields(_0x2abe75,_0x55d657){var _0x1f975c=[];var _0x472ec2={'custom_fields':[]};if(_0x2abe75[_0x04d3('0x25')]>0x0){_['forEach'](_0x2abe75,function(_0x3ac104){if(_[_0x04d3('0x38')](['string','picklist'],_0x3ac104['type'])&&_0x3ac104[_0x04d3('0x39')]&&!_0x3ac104[_0x04d3('0x3a')]){_0x472ec2[_0x3ac104[_0x04d3('0x39')][_0x04d3('0x3b')]()]=_0x3ac104['content'][_0x04d3('0x32')]();}else if(_[_0x04d3('0x38')]([_0x04d3('0x3c'),_0x04d3('0x3d')],_0x3ac104[_0x04d3('0x3e')])&&_0x3ac104[_0x04d3('0x3f')]&&_0x3ac104[_0x04d3('0x3a')]){_0x472ec2[_0x04d3('0x40')][_0x04d3('0x41')]({'id':_0x3ac104['idField'],'value':_0x3ac104[_0x04d3('0x42')]['toString']()});}else if(_0x3ac104['type']===_0x04d3('0x43')&&_0x3ac104['variableName']&&_0x3ac104[_0x04d3('0x3f')]&&_0x3ac104[_0x04d3('0x3a')]){_0x55d657[_0x3ac104['variableName']]&&_0x472ec2[_0x04d3('0x40')][_0x04d3('0x41')]({'id':_0x3ac104[_0x04d3('0x3f')],'value':_0x55d657[_0x3ac104[_0x04d3('0x44')]]['toString']()});}else if(_0x3ac104['type']===_0x04d3('0x45')&&_0x3ac104[_0x04d3('0x46')]&&_0x3ac104[_0x04d3('0x46')][_0x04d3('0x12')]&&_0x3ac104['idField']&&_0x3ac104[_0x04d3('0x3a')]){_0x55d657[_0x3ac104['Variable']['name'][_0x04d3('0x3b')]()]&&_0x472ec2[_0x04d3('0x40')]['push']({'id':_0x3ac104[_0x04d3('0x3f')],'value':_0x55d657[_0x3ac104[_0x04d3('0x46')][_0x04d3('0x12')]['toLowerCase']()][_0x04d3('0x32')]()});}});}return _0x472ec2;}exports[_0x04d3('0x47')]=function(_0x71eb2e,_0x23a167,_0x34168b,_0x1b9ade,_0x250c43,_0x57590a){var _0x48df28,_0x103616;_0x57590a['remoteUri']=intUtil[_0x04d3('0x48')](_0x57590a[_0x04d3('0xf')]);_0x57590a[_0x04d3('0x49')]=intUtil[_0x04d3('0x48')](_0x57590a[_0x04d3('0x49')]);if(_0x250c43&&_0x250c43['monitor_format']){logger[_0x04d3('0xc')](_0x04d3('0x4a'),_0x04d3('0x4b'));_0x23a167[_0x04d3('0x4c')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x57590a['serverUrl'],_0x23a167['uniqueid'],md5(_0x23a167[_0x04d3('0x4d')]));}else{_0x23a167[_0x04d3('0x4c')]='';}headers['Authorization']=getAuth(_0x57590a);return getUser(_0x57590a,_0x1b9ade['email'])[_0x04d3('0x17')](function(_0x17e148){_0x48df28=_0x17e148;logger[_0x04d3('0xc')](_0x04d3('0x4e'),_0x48df28['id']);return getEndUser(_0x57590a,_0x23a167[_0x04d3('0x4f')],_0x23a167[_0x04d3('0x50')]);})[_0x04d3('0x17')](function(_0x46575f){_0x103616=_0x46575f;logger[_0x04d3('0xc')](_0x04d3('0x51'),_0x103616['id']);return getTicket(_0x57590a,_0x48df28,_0x103616,_0x34168b,_0x23a167);})[_0x04d3('0x17')](function(_0x193e4a){if(_0x193e4a){logger[_0x04d3('0xc')](_0x04d3('0x52'),_0x193e4a['id']);switch(_0x57590a[_0x04d3('0x3e')]){case _0x04d3('0x53'):logger['info'](_0x04d3('0x4a'),_0x04d3('0x54'));return request({'uri':util['format'](_0x04d3('0x55'),_0x57590a[_0x04d3('0xf')],_0x48df28['id'],_0x193e4a['id']),'method':_0x04d3('0x10')});case _0x04d3('0x56'):logger[_0x04d3('0xc')]('[QUEUE]',_0x04d3('0x57'));emit(util['format'](_0x04d3('0x58'),_0x1b9ade[_0x04d3('0x12')]),_0x04d3('0x59'),{'uri':util[_0x04d3('0x1b')](_0x04d3('0x5a'),_0x57590a[_0x04d3('0xf')]['replace'](_0x04d3('0x5b'),''),_0x193e4a['id'])});break;default:logger[_0x04d3('0x5c')]('[QUEUE]',_0x04d3('0x5d'));}}})[_0x04d3('0x5e')](function(_0x3a5909){logger['error'](_0x04d3('0x5f'),util[_0x04d3('0x60')](_0x3a5909,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x814e19,_0x36fa3a,_0x32c436,_0x24a12a,_0x2ec411,_0x2c7e43,_0x2cdd65){var _0x5b2d22,_0x34a2b9;_0x2c7e43[_0x04d3('0xf')]=intUtil[_0x04d3('0x48')](_0x2c7e43[_0x04d3('0xf')]);_0x2c7e43['serverUrl']=intUtil[_0x04d3('0x48')](_0x2c7e43[_0x04d3('0x49')]);if(_0x2cdd65&&_0x2cdd65[_0x04d3('0x61')]&&_0x2cdd65[_0x04d3('0x61')]!==_0x04d3('0x62')){logger[_0x04d3('0xc')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x36fa3a['recordingURL']=util[_0x04d3('0x1b')](_0x04d3('0x63'),_0x2c7e43[_0x04d3('0x49')],_0x36fa3a[_0x04d3('0x4d')],md5(_0x36fa3a[_0x04d3('0x4d')]));}headers[_0x04d3('0x64')]=getAuth(_0x2c7e43);return getUser(_0x2c7e43,_0x24a12a[_0x04d3('0x65')])[_0x04d3('0x17')](function(_0x1e1d57){_0x5b2d22=_0x1e1d57;logger['info'](_0x04d3('0x4e'),_0x5b2d22['id']);return getEndUser(_0x2c7e43,_0x36fa3a[_0x04d3('0x66')],_0x36fa3a[_0x04d3('0x67')]);})[_0x04d3('0x17')](function(_0x5a6302){_0x34a2b9=_0x5a6302;logger[_0x04d3('0xc')](_0x04d3('0x51'),_0x34a2b9['id']);return getTicket(_0x2c7e43,_0x5b2d22,_0x34a2b9,_0x32c436,_0x36fa3a);})['then'](function(_0xa05871){if(_0xa05871){logger['info'](_0x04d3('0x52'),_0xa05871['id']);switch(_0x2c7e43[_0x04d3('0x3e')]){case _0x04d3('0x53'):logger[_0x04d3('0xc')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x04d3('0x1b')](_0x04d3('0x55'),_0x2c7e43[_0x04d3('0xf')],_0x5b2d22['id'],_0xa05871['id']),'method':_0x04d3('0x10')});case'newTab':logger[_0x04d3('0xc')](_0x04d3('0x68'),_0x04d3('0x57'));emit(util['format'](_0x04d3('0x58'),_0x24a12a[_0x04d3('0x12')]),_0x04d3('0x59'),{'uri':util[_0x04d3('0x1b')](_0x04d3('0x5a'),_0x2c7e43[_0x04d3('0xf')][_0x04d3('0x69')]('/api/v2',''),_0xa05871['id'])});break;default:logger[_0x04d3('0x5c')](_0x04d3('0x68'),_0x04d3('0x5d'));}}})[_0x04d3('0x5e')](function(_0x127ead){logger[_0x04d3('0x5c')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x04d3('0x60')](_0x127ead,{'showHidden':!![],'depth':null}));});};exports[_0x04d3('0x6a')]=function(_0x4a3228,_0x4bbeb6,_0xc605bf,_0x1207ff,_0x31631c,_0x260399){var _0x579769,_0x5b9e5e;_0x260399['remoteUri']=intUtil['stripTrailingSlash'](_0x260399[_0x04d3('0xf')]);_0x260399[_0x04d3('0x49')]=intUtil[_0x04d3('0x48')](_0x260399[_0x04d3('0x49')]);if(_0x31631c&&_0x31631c[_0x04d3('0x6b')]){logger['info']('['+_0x4bbeb6[_0x04d3('0x6c')]['toUpperCase']()+']',_0x04d3('0x4b'));_0x4bbeb6[_0x04d3('0x4c')]=util[_0x04d3('0x1b')](_0x04d3('0x63'),_0x260399[_0x04d3('0x49')],_0x4bbeb6[_0x04d3('0x4d')],md5(_0x4bbeb6[_0x04d3('0x4d')]));}else{_0x4bbeb6[_0x04d3('0x4c')]='';}headers[_0x04d3('0x64')]=getAuth(_0x260399);return getUser(_0x260399)[_0x04d3('0x17')](function(_0x59ee52){_0x579769=_0x59ee52;logger[_0x04d3('0xc')](_0x04d3('0x4e'),_0x579769['id']);return getEndUser(_0x260399,_0x4bbeb6[_0x04d3('0x4f')],_0x4bbeb6[_0x04d3('0x50')]);})['then'](function(_0x2d8cee){_0x5b9e5e=_0x2d8cee;logger['info'](_0x04d3('0x51'),_0x5b9e5e['id']);return getTicket(_0x260399,_0x579769,_0x5b9e5e,_0xc605bf,_0x4bbeb6);})['then'](function(_0x2578e0){if(_0x2578e0){logger[_0x04d3('0xc')](_0x04d3('0x52'),_0x2578e0['id']);}})[_0x04d3('0x5e')](function(_0x44d522){logger[_0x04d3('0x5c')]('['+_0x4bbeb6['lastevent'][_0x04d3('0x6d')]()+']'+_0x04d3('0x6e'),util['inspect'](_0x44d522,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 9078e43..29ec466 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaec9=['https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','data','code','SUCCESS','details','log','CREATE\x20ERROR','contact_lead','uri','Contacts','/crm/v2/Contacts/search?criteria=((Phone:equals:','lead','nothing','Creating\x20new\x20call...','administrator','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','Leads','What_Id','$se_module','Call_Duration','utc','talktime','answertime','endtime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','Called','complete','connect','rejected','Rejected','abandoned','timeout','Timeout','outbound','starttime','agentcalledAt','Call_Type','merge','Fields','/crm/v2/Calls','Call\x20created!','err','queue','stripTrailingSlash','host','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','recordingURL','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','recordingFormat','none','[OUTBOUND]','zoho.eu','email','destcalleridnum','Outbound','/crm/EntityInfo.do?module=Calls&id=','unmanaged','toUpperCase','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','debug','[HTTP]','length','forEach','includes','string','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','expires_in','zone','https://accounts.zoho.com'];(function(_0x549f1d,_0x558244){var _0x4b1b09=function(_0x466fa5){while(--_0x466fa5){_0x549f1d['push'](_0x549f1d['shift']());}};_0x4b1b09(++_0x558244);}(_0xaec9,0x112));var _0x9aec=function(_0x1e4a8e,_0x18022b){_0x1e4a8e=_0x1e4a8e-0x0;var _0x5408f9=_0xaec9[_0x1e4a8e];return _0x5408f9;};'use strict';var _=require('lodash');var rp=require(_0x9aec('0x0'));var md5=require(_0x9aec('0x1'));var util=require(_0x9aec('0x2'));var intUtil=require(_0x9aec('0x3'));var moment=require(_0x9aec('0x4'));var Redis=require(_0x9aec('0x5'));var BPromise=require(_0x9aec('0x6'));var config=require(_0x9aec('0x7'));var logger=require(_0x9aec('0x8'))(_0x9aec('0x9'));config[_0x9aec('0xa')]=_[_0x9aec('0xb')](config[_0x9aec('0xa')],{'host':_0x9aec('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x64ac21,_0x4e84bf,_0x2c1989){io['to'](_0x64ac21)['emit'](_0x4e84bf,_0x2c1989);}function request(_0x4b06f9){logger[_0x9aec('0xd')](_0x9aec('0xe'),JSON['stringify'](_0x4b06f9));return rp(_0x4b06f9);}function getCustomFields(_0x408bdf,_0x44e30b){var _0x5b2811={};if(_0x408bdf[_0x9aec('0xf')]>0x0){_[_0x9aec('0x10')](_0x408bdf,function(_0x50a5fd){if(_[_0x9aec('0x11')]([_0x9aec('0x12'),'picklist'],_0x50a5fd[_0x9aec('0x13')])&&_0x50a5fd[_0x9aec('0x14')]){_0x5b2811[_0x50a5fd[_0x9aec('0x14')]]=_0x50a5fd[_0x9aec('0x15')][_0x9aec('0x16')]();}else if(_0x50a5fd['type']===_0x9aec('0x17')&&_0x50a5fd['variableName']&&_0x50a5fd[_0x9aec('0x14')]&&_0x44e30b[_0x50a5fd['variableName']]){_0x5b2811[_0x50a5fd[_0x9aec('0x14')]]=_0x44e30b[_0x50a5fd[_0x9aec('0x18')]][_0x9aec('0x16')]();}else if(_0x50a5fd[_0x9aec('0x13')]===_0x9aec('0x19')&&_0x50a5fd['Variable']&&_0x50a5fd[_0x9aec('0x1a')][_0x9aec('0x1b')]&&_0x50a5fd['idField']&&_0x44e30b[_0x50a5fd[_0x9aec('0x1a')]['name']['toLowerCase']()]){_0x5b2811[_0x50a5fd[_0x9aec('0x14')]]=_0x44e30b[_0x50a5fd[_0x9aec('0x1a')][_0x9aec('0x1b')][_0x9aec('0x1c')]()][_0x9aec('0x16')]();}});}return _0x5b2811;}function getName(_0x1344f2){if(_0x1344f2[_0x9aec('0x1d')]('\x20')>0x0){var _0x359bc4=_0x1344f2[_0x9aec('0x1e')](/ (.+)/);if(_0x359bc4[0x1]){return _0x359bc4;}}return[_0x1344f2,_0x1344f2];}var accountsTokens={};function getAccessToken(_0x343648){return new Promise(function(_0x47a860,_0x30957a){if(!_[_0x9aec('0x1f')](accountsTokens[_0x343648['id']])&&!_['isNil'](accountsTokens[_0x343648['id']][_0x9aec('0x20')])){if(moment()['isBefore'](accountsTokens[_0x343648['id']][_0x9aec('0x21')])){_0x47a860(accountsTokens[_0x343648['id']][_0x9aec('0x20')]);}}var _0x4ad688;switch(_0x343648[_0x9aec('0x22')]){case'US':_0x4ad688=_0x9aec('0x23');break;case'AU':_0x4ad688=_0x9aec('0x24');break;case'EU':_0x4ad688=_0x9aec('0x25');break;case'IN':_0x4ad688=_0x9aec('0x26');break;case'CN':_0x4ad688=_0x9aec('0x27');break;default:_0x4ad688='https://accounts.zoho.eu';break;}var _0x458f6d={'method':_0x9aec('0x28'),'uri':_0x4ad688+_0x9aec('0x29'),'qs':{'refresh_token':_0x343648[_0x9aec('0x2a')],'client_id':_0x343648[_0x9aec('0x2b')],'client_secret':_0x343648[_0x9aec('0x2c')],'grant_type':_0x9aec('0x2d')},'json':!![]};return rp(_0x458f6d)[_0x9aec('0x2e')](function(_0x12af3c){accountsTokens[_0x343648['id']]={'access_token':_0x12af3c[_0x9aec('0x20')],'expires_in':moment()[_0x9aec('0x2f')](_0x12af3c['expires_in'],_0x9aec('0x30'))};_0x47a860(_0x12af3c[_0x9aec('0x20')]);})[_0x9aec('0x31')](function(_0x2c6255){logger[_0x9aec('0x32')](_0x9aec('0x33'),_0x2c6255['stack']);_0x30957a(_0x2c6255);});});}function getUser(_0x3b5907,_0x3543f1,_0x1dcec6,_0x13d6e1){logger[_0x9aec('0x34')](_0x9aec('0x35'));return request({'method':_0x9aec('0x36'),'uri':util[_0x9aec('0x37')](_0x9aec('0x38'),_0x3543f1),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x9aec('0x39')+_0x3b5907},'json':!![]})['then'](function(_0x930574){if(_0x930574[_0x9aec('0x3a')]){var _0x13642e=-0x1;if(_['isArrayLikeObject'](_0x930574['users'])){if(!_['isNil'](_0x13d6e1)){_0x13642e=_[_0x9aec('0x3b')](_0x930574[_0x9aec('0x3a')],function(_0x20b1db){return _0x20b1db['email']===_0x13d6e1;});}if(_0x13642e>=0x0){logger[_0x9aec('0x34')](_0x9aec('0x3c'));}else{logger[_0x9aec('0x34')](_0x9aec('0x3d'));_0x13642e=_[_0x9aec('0x3b')](_0x930574[_0x9aec('0x3a')],function(_0x2341ef){return _0x2341ef[_0x9aec('0x3e')][_0x9aec('0x1b')]===_0x9aec('0x3f');});}return _0x930574[_0x9aec('0x3a')][_0x13642e];}else{if(_0x930574[_0x9aec('0x40')][_0x9aec('0x3e')][_0x9aec('0x1b')]==='Administrator'){logger['info']('Using\x20the\x20admin\x20account!');user=_0x930574[_0x9aec('0x40')];return user;}else{logger[_0x9aec('0x32')](_0x9aec('0x41'),JSON[_0x9aec('0x42')](_0x930574));throw new Error(_0x9aec('0x43')+JSON[_0x9aec('0x42')](_0x930574));}}}else{logger[_0x9aec('0x32')](_0x9aec('0x41'),JSON[_0x9aec('0x42')](_0x930574));throw new Error(_0x9aec('0x43')+JSON[_0x9aec('0x42')](_0x930574));}})['catch'](function(_0x3150ab){console[_0x9aec('0x32')](_0x3150ab);});}function getZohoUser(_0x34bf01,_0x25da82){return new BPromise(function(_0x2c96b8,_0x1534db){request(_0x34bf01)[_0x9aec('0x2e')](function(_0x2564f8){var _0x57511f=null;if(_0x2564f8){_0x57511f=_0x2564f8['data'][0x0];_0x57511f[_0x9aec('0x44')]=_0x25da82;}_0x2c96b8(_0x57511f);})['catch'](function(_0x432367){_0x1534db(_0x432367);});});}function createEndUser(_0x4854ff,_0x4d76a2,_0x1f5a0e,_0x1e9986,_0x446d25,_0x4e6fdd){var _0x1f5a0e=getName(_0x1f5a0e);return request({'method':_0x9aec('0x28'),'uri':_0x9aec('0x45')+_0x4d76a2+_0x9aec('0x46')+_[_0x9aec('0x47')](_0x4e6fdd[_0x9aec('0x48')])+'s','body':{'data':[{'Last_Name':_0x1f5a0e[0x1],'First_Name':_0x1f5a0e[0x0],'Phone':_0x1e9986,'Owner':{'name':!_[_0x9aec('0x1f')](_0x446d25[_0x9aec('0x49')][_0x9aec('0x1b')])?_0x446d25[_0x9aec('0x49')]['name']:!_[_0x9aec('0x1f')](_0x446d25['first_name'])?_0x446d25[_0x9aec('0x4a')]+'\x20'+_0x446d25[_0x9aec('0x4b')]:_0x446d25[_0x9aec('0x4b')],'id':_0x446d25['id']}}]},'headers':{'Authorization':_0x9aec('0x39')+_0x4854ff},'json':!![]})[_0x9aec('0x2e')](function(_0x54ee2e){if(_0x54ee2e&&_0x54ee2e[_0x9aec('0x4c')][0x0][_0x9aec('0x4d')]===_0x9aec('0x4e')){var _0x1515a1=_0x54ee2e[_0x9aec('0x4c')][0x0][_0x9aec('0x4f')];_0x1515a1[_0x9aec('0x44')]=_[_0x9aec('0x47')](_0x4e6fdd['moduleCreate'])+'s';return _0x1515a1;}logger[_0x9aec('0x32')](_0x9aec('0x41'),JSON['stringify'](data));throw new Error('Error:\x20'+JSON['stringify'](data));})['catch'](function(_0x330319){console[_0x9aec('0x50')](_0x9aec('0x51'),_0x330319);});}function getEndUser(_0xd31fdc,_0x897444,_0x525861,_0x37efee,_0x1ab873,_0x1f618f,_0xcac023){var _0x3e1080={'method':'GET','uri':'','headers':{'Authorization':_0x9aec('0x39')+_0xd31fdc},'json':!![]};switch(_0xcac023['moduleSearch']){case _0x9aec('0x52'):_0x3e1080[_0x9aec('0x53')]='https://www.zohoapis.'+_0x897444+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x1ab873+'))';return getZohoUser(_0x3e1080,_0x9aec('0x54'))[_0x9aec('0x2e')](function(_0x4ba1fd){if(_0x4ba1fd)return _0x4ba1fd;_0x3e1080[_0x9aec('0x53')]='https://www.zohoapis.'+_0x897444+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x1ab873+'))';return getZohoUser(_0x3e1080,'Leads')[_0x9aec('0x2e')](function(_0x196f4f){if(_0x196f4f)return _0x196f4f;if(_0xcac023[_0x9aec('0x48')]!='nothing'){return createEndUser(_0xd31fdc,_0x897444,_0x37efee,_0x1ab873,_0x1f618f,_0xcac023);}else{return{};}});});break;case'contact':_0x3e1080['uri']=_0x9aec('0x45')+_0x897444+_0x9aec('0x55')+_0x1ab873+'))';return getZohoUser(_0x3e1080,_0x9aec('0x54'))['then'](function(_0x3c948f){if(_0x3c948f)return _0x3c948f;if(_0xcac023[_0x9aec('0x48')]!='nothing'){return createEndUser(_0xd31fdc,_0x897444,_0x37efee,_0x1ab873,_0x1f618f,_0xcac023);}else{return{};}});break;case _0x9aec('0x56'):_0x3e1080[_0x9aec('0x53')]='https://www.zohoapis.'+_0x897444+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x1ab873+'))';return getZohoUser(_0x3e1080,'Leads')[_0x9aec('0x2e')](function(_0x1f48d2){if(_0x1f48d2)return _0x1f48d2;if(_0xcac023[_0x9aec('0x48')]!=_0x9aec('0x57')){return createEndUser(_0xd31fdc,_0x897444,_0x37efee,_0x1ab873,_0x1f618f,_0xcac023);}else{return{};}});break;}}function getCall(_0x321406,_0x593eef,_0x436898,_0x3517dd,_0x67af80,_0x192766,_0x198675,_0x4d06e3){logger[_0x9aec('0x34')](_0x9aec('0x58'));var _0x1cea3f={};_0x1cea3f['Owner']={'name':!_[_0x9aec('0x1f')](_0x3517dd[_0x9aec('0x49')][_0x9aec('0x1b')])&&!_[_0x9aec('0x1f')](_0x3517dd[_0x9aec('0x3e')][_0x9aec('0x1b')])&&_0x3517dd[_0x9aec('0x3e')]['name']===_0x9aec('0x59')?_0x3517dd[_0x9aec('0x49')][_0x9aec('0x1b')]:!_[_0x9aec('0x1f')](_0x3517dd[_0x9aec('0x4a')])?_0x3517dd['first_name']+'\x20'+_0x3517dd[_0x9aec('0x4b')]:_0x3517dd[_0x9aec('0x4b')],'id':_0x3517dd['id']};_0x1cea3f['Subject']=intUtil['getString'](_0x192766['Subjects'],_0x198675,'\x20');_0x1cea3f['Description']=intUtil['getString'](_0x192766[_0x9aec('0x5a')],_0x198675,'\x0a');if(_0x67af80[_0x9aec('0x44')]===_0x9aec('0x54')){_0x1cea3f[_0x9aec('0x5b')]={'name':!_['isNil'](_0x67af80[_0x9aec('0x5c')])?_0x67af80[_0x9aec('0x5c')]:!_['isNil'](_0x67af80[_0x9aec('0x5d')])?_0x67af80['First_Name']+'\x20'+_0x67af80[_0x9aec('0x5e')]:_0x67af80[_0x9aec('0x5e')],'id':_0x67af80['id']};}if(_0x67af80[_0x9aec('0x44')]===_0x9aec('0x5f')){_0x1cea3f[_0x9aec('0x60')]={'name':!_[_0x9aec('0x1f')](_0x67af80[_0x9aec('0x5c')])?_0x67af80[_0x9aec('0x5c')]:!_[_0x9aec('0x1f')](_0x67af80[_0x9aec('0x5d')])?_0x67af80[_0x9aec('0x5d')]+'\x20'+_0x67af80[_0x9aec('0x5e')]:_0x67af80[_0x9aec('0x5e')],'id':_0x67af80['id']};_0x1cea3f[_0x9aec('0x61')]=_[_0x9aec('0x47')](_0x67af80[_0x9aec('0x44')]);}if(_0x198675['talktime']){_0x1cea3f[_0x9aec('0x62')]=moment[_0x9aec('0x63')](parseInt(_0x198675[_0x9aec('0x64')])*0x3e8)[_0x9aec('0x37')]('mm:ss');}else if(_0x198675[_0x9aec('0x65')]&&_0x198675[_0x9aec('0x66')]){_0x1cea3f[_0x9aec('0x62')]=moment[_0x9aec('0x63')](moment(_0x198675[_0x9aec('0x66')],_0x9aec('0x67'))['diff'](moment(_0x198675['starttime'],'YYYY-MM-DDTHH:mm:ss')))[_0x9aec('0x37')]('mm:ss');}switch(_0x198675[_0x9aec('0x68')]){case _0x9aec('0x69'):_0x1cea3f[_0x9aec('0x6a')]=_0x9aec('0x6b');break;case _0x9aec('0x6c'):case _0x9aec('0x6d'):_0x1cea3f[_0x9aec('0x6a')]='Answered';break;case _0x9aec('0x6e'):_0x1cea3f[_0x9aec('0x6a')]=_0x9aec('0x6f');break;case _0x9aec('0x70'):_0x1cea3f['Call_Result']='Abandoned';break;case _0x9aec('0x71'):_0x1cea3f['Call_Result']=_0x9aec('0x72');default:}_0x1cea3f['Call_Start_Time']=(_0x4d06e3===_0x9aec('0x73')?moment(_0x198675[_0x9aec('0x74')])[_0x9aec('0x37')](_0x9aec('0x67')):moment(_0x198675[_0x9aec('0x75')])[_0x9aec('0x37')](_0x9aec('0x67')))||moment()[_0x9aec('0x37')]('YYYY-MM-DDTHH:mm:ss');_0x1cea3f[_0x9aec('0x76')]=_0x4d06e3||'Inbound';_0x1cea3f=_[_0x9aec('0x77')](_0x1cea3f,getCustomFields(_0x192766[_0x9aec('0x78')],_0x198675));return request({'method':_0x9aec('0x28'),'uri':_0x9aec('0x45')+_0x593eef+_0x9aec('0x79'),'headers':{'Authorization':_0x9aec('0x39')+_0x321406},'body':{'data':[_0x1cea3f]},'json':!![]})[_0x9aec('0x2e')](function(_0x42fa6a){if(_0x42fa6a&&_0x42fa6a[_0x9aec('0x4c')][0x0][_0x9aec('0x4d')]===_0x9aec('0x4e')){logger[_0x9aec('0x34')](_0x9aec('0x7a'));return{'id':_0x42fa6a[_0x9aec('0x4c')][0x0][_0x9aec('0x4f')]['id']};}})[_0x9aec('0x31')](function(_0x2b25df){logger[_0x9aec('0x34')]('err',_0x2b25df['stack']);console[_0x9aec('0x50')](_0x9aec('0x7b'),_0x2b25df);});}exports[_0x9aec('0x7c')]=function(_0x5aea5d,_0x2ead72,_0x288f29,_0x2b333e,_0x376876,_0x4d3bc8){var _0x55e5f4,_0xfef10d,_0x4178c6;_0x4d3bc8['host']=intUtil[_0x9aec('0x7d')](_0x4d3bc8[_0x9aec('0x7e')]);_0x4d3bc8[_0x9aec('0x7f')]=intUtil[_0x9aec('0x7d')](_0x4d3bc8[_0x9aec('0x7f')]);if(_0x376876&&_0x376876[_0x9aec('0x80')]){logger[_0x9aec('0x34')](_0x9aec('0x81'),_0x9aec('0x82'));_0x2ead72['recordingURL']=_0x4d3bc8['serverUrl']+_0x9aec('0x83')+_0x2ead72[_0x9aec('0x84')]+_0x9aec('0x85')+md5(_0x2ead72[_0x9aec('0x84')]);}else{_0x2ead72[_0x9aec('0x86')]='';}var _0xdbc682=_0x4d3bc8[_0x9aec('0x7e')]==='zoho.eu'?'eu':_0x9aec('0x87');return getAccessToken(_0x4d3bc8)['then'](function(_0x477502){_0x4178c6=_0x477502;return getUser(_0x4178c6,_0xdbc682,_0x4d3bc8,_0x2b333e['email']);})[_0x9aec('0x2e')](function(_0x26a9d6){_0x55e5f4=_0x26a9d6;logger[_0x9aec('0x34')](_0x9aec('0x88'),_0x55e5f4['id']);return getEndUser(_0x4178c6,_0xdbc682,_0x4d3bc8,_0x2ead72[_0x9aec('0x89')],_0x2ead72[_0x9aec('0x8a')],_0x55e5f4,_0x288f29);})[_0x9aec('0x2e')](function(_0x4be33e){_0xfef10d=_0x4be33e;return getCall(_0x4178c6,_0xdbc682,_0x4d3bc8,_0x55e5f4,_0xfef10d,_0x288f29,_0x2ead72,_0x9aec('0x8b'));})[_0x9aec('0x2e')](function(_0x191ce4){if(_0x191ce4){logger[_0x9aec('0x34')](_0x9aec('0x8c'),_0x191ce4['id']);logger['info']('[QUEUE]',_0x9aec('0x8d'));emit(util[_0x9aec('0x37')](_0x9aec('0x8e'),_0x2b333e[_0x9aec('0x1b')]),_0x9aec('0x8f'),{'uri':_0x9aec('0x90')+_0x4d3bc8[_0x9aec('0x7e')]+'/crm/EntityInfo.do?module=Calls&id='+_0x191ce4['id']});}})[_0x9aec('0x31')](function(_0x2c6c36){logger[_0x9aec('0x32')](_0x9aec('0x81'),JSON[_0x9aec('0x42')](_0x2c6c36));});};exports['outbound']=function(_0x4c624b,_0x374dbb,_0x3788c2,_0x495762,_0x488326,_0x48f7a9,_0x432a0b){var _0x24339b,_0x45aa51,_0x4e4af3;_0x48f7a9[_0x9aec('0x7e')]=intUtil['stripTrailingSlash'](_0x48f7a9[_0x9aec('0x7e')]);_0x48f7a9['serverUrl']=intUtil[_0x9aec('0x7d')](_0x48f7a9[_0x9aec('0x7f')]);if(_0x432a0b&&_0x432a0b['recordingFormat']&&_0x432a0b[_0x9aec('0x91')]!==_0x9aec('0x92')){logger[_0x9aec('0x34')](_0x9aec('0x93'),_0x9aec('0x82'));_0x374dbb[_0x9aec('0x86')]=_0x48f7a9[_0x9aec('0x7f')]+_0x9aec('0x83')+_0x374dbb['uniqueid']+_0x9aec('0x85')+md5(_0x374dbb['uniqueid']);}var _0x15e60d=_0x48f7a9[_0x9aec('0x7e')]===_0x9aec('0x94')?'eu':_0x9aec('0x87');return getAccessToken(_0x48f7a9)[_0x9aec('0x2e')](function(_0x490c6e){_0x4e4af3=_0x490c6e;return getUser(_0x4e4af3,_0x15e60d,_0x48f7a9,_0x495762[_0x9aec('0x95')]);})['then'](function(_0x49cd06){_0x24339b=_0x49cd06;logger[_0x9aec('0x34')](_0x9aec('0x88'),_0x24339b['id']);return getEndUser(_0x4e4af3,_0x15e60d,_0x48f7a9,_0x374dbb['destcalleridname'],_0x374dbb[_0x9aec('0x96')],_0x24339b,_0x3788c2);})[_0x9aec('0x2e')](function(_0x1c7f2a){_0x45aa51=_0x1c7f2a;return getCall(_0x4e4af3,_0x15e60d,_0x48f7a9,_0x24339b,_0x45aa51,_0x3788c2,_0x374dbb,_0x9aec('0x97'));})[_0x9aec('0x2e')](function(_0x57d370){if(_0x57d370){logger[_0x9aec('0x34')](_0x9aec('0x8c'),_0x57d370['id']);logger[_0x9aec('0x34')](_0x9aec('0x93'),_0x9aec('0x8d'));emit(util[_0x9aec('0x37')]('user:%s',_0x495762[_0x9aec('0x1b')]),_0x9aec('0x8f'),{'uri':_0x9aec('0x90')+_0x48f7a9[_0x9aec('0x7e')]+_0x9aec('0x98')+_0x57d370['id']});}})[_0x9aec('0x31')](function(_0x41867d){logger['error'](_0x9aec('0x93'),JSON[_0x9aec('0x42')](_0x41867d));});};exports[_0x9aec('0x99')]=function(_0x54cdcc,_0xc3e18f,_0x312b99,_0x54dc20,_0x5591aa,_0x103a0c){var _0x4ac9f2,_0x52437e,_0x3f5bcb;_0x103a0c['host']=intUtil[_0x9aec('0x7d')](_0x103a0c['host']);_0x103a0c['serverUrl']=intUtil[_0x9aec('0x7d')](_0x103a0c[_0x9aec('0x7f')]);if(_0x5591aa&&_0x5591aa[_0x9aec('0x80')]){logger[_0x9aec('0x34')]('['+_0xc3e18f[_0x9aec('0x68')][_0x9aec('0x9a')]()+']',_0x9aec('0x82'));_0xc3e18f[_0x9aec('0x86')]=_0x103a0c[_0x9aec('0x7f')]+'/api/voice/recordings/'+_0xc3e18f[_0x9aec('0x84')]+_0x9aec('0x85')+md5(_0xc3e18f[_0x9aec('0x84')]);}else{_0xc3e18f[_0x9aec('0x86')]='';}var _0x11aa21=_0x103a0c[_0x9aec('0x7e')]===_0x9aec('0x94')?'eu':'com';return getAccessToken(_0x103a0c)[_0x9aec('0x2e')](function(_0x1f3034){_0x3f5bcb=_0x1f3034;return getUser(_0x3f5bcb,_0x11aa21,_0x103a0c);})[_0x9aec('0x2e')](function(_0x5b0175){_0x4ac9f2=_0x5b0175;logger[_0x9aec('0x34')](_0x9aec('0x88'),_0x4ac9f2['id']);return getEndUser(_0x3f5bcb,_0x11aa21,_0x103a0c,_0xc3e18f[_0x9aec('0x89')],_0xc3e18f[_0x9aec('0x8a')],_0x4ac9f2,_0x312b99);})[_0x9aec('0x2e')](function(_0x52a2a5){_0x52437e=_0x52a2a5;return getCall(_0x3f5bcb,_0x11aa21,_0x103a0c,_0x4ac9f2,_0x52437e,_0x312b99,_0xc3e18f,'Inbound');})[_0x9aec('0x2e')](function(_0x565fde){if(_0x565fde){logger[_0x9aec('0x34')](_0x9aec('0x8c'),_0x565fde['id']);}})[_0x9aec('0x31')](function(_0x3e327a){logger[_0x9aec('0x32')]('['+_0xc3e18f[_0x9aec('0x68')][_0x9aec('0x9a')]()+']',JSON['stringify'](_0x3e327a));});};
\ No newline at end of file
+var _0x3ea0=['https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','code','SUCCESS','details','moduleCreate','Error:\x20','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','lead','Creating\x20new\x20call...','Owner','administrator','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','format','lastevent','called','Call_Result','Called','complete','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','Call_Type','merge','Fields','/crm/v2/Calls','Call\x20created!','err','stack','log','host','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','Inbound','The\x20Call\x20ID\x20is:','[QUEUE]','user:%s','https://crm.','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','/crm/EntityInfo.do?module=Calls&id=','unmanaged','monitor_format','toUpperCase','lodash','request-promise','md5','util','ioredis','bluebird','../../../../config/logger','redis','localhost','emit','[HTTP]','stringify','length','forEach','includes','string','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','info','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','then','data','enduserType','POST'];(function(_0x36f2bd,_0x2d7cd0){var _0xba0b13=function(_0x57aefb){while(--_0x57aefb){_0x36f2bd['push'](_0x36f2bd['shift']());}};_0xba0b13(++_0x2d7cd0);}(_0x3ea0,0xf4));var _0x03ea=function(_0x39479f,_0x822ae4){_0x39479f=_0x39479f-0x0;var _0x4a6d96=_0x3ea0[_0x39479f];return _0x4a6d96;};'use strict';var _=require(_0x03ea('0x0'));var rp=require(_0x03ea('0x1'));var md5=require(_0x03ea('0x2'));var util=require(_0x03ea('0x3'));var intUtil=require('./util');var moment=require('moment');var Redis=require(_0x03ea('0x4'));var BPromise=require(_0x03ea('0x5'));var config=require('../../../../config/environment');var logger=require(_0x03ea('0x6'))('zoho');config[_0x03ea('0x7')]=_['defaults'](config[_0x03ea('0x7')],{'host':_0x03ea('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x807735,_0x13a9aa,_0x3d4ebc){io['to'](_0x807735)[_0x03ea('0x9')](_0x13a9aa,_0x3d4ebc);}function request(_0x5e749d){logger['debug'](_0x03ea('0xa'),JSON[_0x03ea('0xb')](_0x5e749d));return rp(_0x5e749d);}function getCustomFields(_0x86c487,_0x38aa94){var _0x1ed48f={};if(_0x86c487[_0x03ea('0xc')]>0x0){_[_0x03ea('0xd')](_0x86c487,function(_0x5e3fd4){if(_[_0x03ea('0xe')]([_0x03ea('0xf'),_0x03ea('0x10')],_0x5e3fd4[_0x03ea('0x11')])&&_0x5e3fd4['idField']){_0x1ed48f[_0x5e3fd4[_0x03ea('0x12')]]=_0x5e3fd4['content'][_0x03ea('0x13')]();}else if(_0x5e3fd4[_0x03ea('0x11')]===_0x03ea('0x14')&&_0x5e3fd4[_0x03ea('0x15')]&&_0x5e3fd4['idField']&&_0x38aa94[_0x5e3fd4[_0x03ea('0x15')]]){_0x1ed48f[_0x5e3fd4[_0x03ea('0x12')]]=_0x38aa94[_0x5e3fd4['variableName']][_0x03ea('0x13')]();}else if(_0x5e3fd4['type']===_0x03ea('0x16')&&_0x5e3fd4[_0x03ea('0x17')]&&_0x5e3fd4[_0x03ea('0x17')][_0x03ea('0x18')]&&_0x5e3fd4[_0x03ea('0x12')]&&_0x38aa94[_0x5e3fd4[_0x03ea('0x17')][_0x03ea('0x18')]['toLowerCase']()]){_0x1ed48f[_0x5e3fd4['idField']]=_0x38aa94[_0x5e3fd4[_0x03ea('0x17')][_0x03ea('0x18')]['toLowerCase']()][_0x03ea('0x13')]();}});}return _0x1ed48f;}function getName(_0xb2eda0){if(_0xb2eda0['indexOf']('\x20')>0x0){var _0x322eb4=_0xb2eda0[_0x03ea('0x19')](/ (.+)/);if(_0x322eb4[0x1]){return _0x322eb4;}}return[_0xb2eda0,_0xb2eda0];}var accountsTokens={};function getAccessToken(_0x1896e2){return new Promise(function(_0x4aedac,_0x40611d){if(!_[_0x03ea('0x1a')](accountsTokens[_0x1896e2['id']])&&!_[_0x03ea('0x1a')](accountsTokens[_0x1896e2['id']][_0x03ea('0x1b')])){if(moment()[_0x03ea('0x1c')](accountsTokens[_0x1896e2['id']][_0x03ea('0x1d')])){_0x4aedac(accountsTokens[_0x1896e2['id']]['access_token']);}}var _0x5b60a9;switch(_0x1896e2['zone']){case'US':_0x5b60a9=_0x03ea('0x1e');break;case'AU':_0x5b60a9=_0x03ea('0x1f');break;case'EU':_0x5b60a9=_0x03ea('0x20');break;case'IN':_0x5b60a9=_0x03ea('0x21');break;case'CN':_0x5b60a9=_0x03ea('0x22');break;default:_0x5b60a9=_0x03ea('0x20');break;}var _0x963262={'method':'POST','uri':_0x5b60a9+_0x03ea('0x23'),'qs':{'refresh_token':_0x1896e2[_0x03ea('0x24')],'client_id':_0x1896e2[_0x03ea('0x25')],'client_secret':_0x1896e2[_0x03ea('0x26')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x963262)['then'](function(_0x55e8d7){accountsTokens[_0x1896e2['id']]={'access_token':_0x55e8d7[_0x03ea('0x1b')],'expires_in':moment()[_0x03ea('0x27')](_0x55e8d7[_0x03ea('0x1d')],_0x03ea('0x28'))};_0x4aedac(_0x55e8d7[_0x03ea('0x1b')]);})[_0x03ea('0x29')](function(_0x4e032a){logger[_0x03ea('0x2a')](_0x03ea('0x2b'),_0x4e032a['stack']);_0x40611d(_0x4e032a);});});}function getUser(_0x234a74,_0x2a8667,_0x1e2bba,_0x467899){logger[_0x03ea('0x2c')](_0x03ea('0x2d'));return request({'method':_0x03ea('0x2e'),'uri':util['format'](_0x03ea('0x2f'),_0x2a8667),'qs':{'type':_0x03ea('0x30')},'headers':{'Authorization':_0x03ea('0x31')+_0x234a74},'json':!![]})['then'](function(_0x39d34e){if(_0x39d34e[_0x03ea('0x32')]){var _0x4204b0=-0x1;if(_[_0x03ea('0x33')](_0x39d34e[_0x03ea('0x32')])){if(!_['isNil'](_0x467899)){_0x4204b0=_[_0x03ea('0x34')](_0x39d34e[_0x03ea('0x32')],function(_0x195579){return _0x195579[_0x03ea('0x35')]===_0x467899;});}if(_0x4204b0>=0x0){logger['info'](_0x03ea('0x36'));}else{logger[_0x03ea('0x2c')](_0x03ea('0x37'));_0x4204b0=_[_0x03ea('0x34')](_0x39d34e['users'],function(_0x399767){return _0x399767[_0x03ea('0x38')][_0x03ea('0x18')]==='Administrator';});}return _0x39d34e[_0x03ea('0x32')][_0x4204b0];}else{if(_0x39d34e['user'][_0x03ea('0x38')][_0x03ea('0x18')]===_0x03ea('0x39')){logger[_0x03ea('0x2c')]('Using\x20the\x20admin\x20account!');user=_0x39d34e['user'];return user;}else{logger[_0x03ea('0x2a')](_0x03ea('0x3a'),JSON[_0x03ea('0xb')](_0x39d34e));throw new Error(_0x03ea('0x3b')+JSON['stringify'](_0x39d34e));}}}else{logger[_0x03ea('0x2a')](_0x03ea('0x3a'),JSON[_0x03ea('0xb')](_0x39d34e));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x03ea('0xb')](_0x39d34e));}})[_0x03ea('0x29')](function(_0x34f757){console[_0x03ea('0x2a')](_0x34f757);});}function getZohoUser(_0x46fefe,_0x434d2c){return new BPromise(function(_0x524240,_0x3ae904){request(_0x46fefe)[_0x03ea('0x3c')](function(_0x5abe6d){var _0x9c0a8d=null;if(_0x5abe6d){_0x9c0a8d=_0x5abe6d[_0x03ea('0x3d')][0x0];_0x9c0a8d[_0x03ea('0x3e')]=_0x434d2c;}_0x524240(_0x9c0a8d);})['catch'](function(_0x246c7f){_0x3ae904(_0x246c7f);});});}function createEndUser(_0x311bb1,_0x1369de,_0x1c5cbc,_0x248eea,_0xb736d1,_0x1095bc){var _0x1c5cbc=getName(_0x1c5cbc);return request({'method':_0x03ea('0x3f'),'uri':_0x03ea('0x40')+_0x1369de+_0x03ea('0x41')+_[_0x03ea('0x42')](_0x1095bc['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x1c5cbc[0x1],'First_Name':_0x1c5cbc[0x0],'Phone':_0x248eea,'Owner':{'name':!_[_0x03ea('0x1a')](_0xb736d1[_0x03ea('0x43')][_0x03ea('0x18')])?_0xb736d1['role'][_0x03ea('0x18')]:!_[_0x03ea('0x1a')](_0xb736d1[_0x03ea('0x44')])?_0xb736d1[_0x03ea('0x44')]+'\x20'+_0xb736d1[_0x03ea('0x45')]:_0xb736d1[_0x03ea('0x45')],'id':_0xb736d1['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x311bb1},'json':!![]})[_0x03ea('0x3c')](function(_0x269714){if(_0x269714&&_0x269714[_0x03ea('0x3d')][0x0][_0x03ea('0x46')]===_0x03ea('0x47')){var _0x1a2441=_0x269714['data'][0x0][_0x03ea('0x48')];_0x1a2441[_0x03ea('0x3e')]=_[_0x03ea('0x42')](_0x1095bc[_0x03ea('0x49')])+'s';return _0x1a2441;}logger[_0x03ea('0x2a')](_0x03ea('0x3a'),JSON[_0x03ea('0xb')](data));throw new Error(_0x03ea('0x4a')+JSON[_0x03ea('0xb')](data));})[_0x03ea('0x29')](function(_0x1d57cb){console['log']('CREATE\x20ERROR',_0x1d57cb);});}function getEndUser(_0x1774d9,_0x141078,_0x16cf25,_0x3f0756,_0x2b06d5,_0x1a9866,_0x232861){var _0x45a76a={'method':_0x03ea('0x2e'),'uri':'','headers':{'Authorization':_0x03ea('0x31')+_0x1774d9},'json':!![]};switch(_0x232861['moduleSearch']){case'contact_lead':_0x45a76a[_0x03ea('0x4b')]=_0x03ea('0x40')+_0x141078+_0x03ea('0x4c')+_0x2b06d5+'))';return getZohoUser(_0x45a76a,_0x03ea('0x4d'))['then'](function(_0x54ac28){if(_0x54ac28)return _0x54ac28;_0x45a76a['uri']=_0x03ea('0x40')+_0x141078+_0x03ea('0x4e')+_0x2b06d5+'))';return getZohoUser(_0x45a76a,_0x03ea('0x4f'))['then'](function(_0x29e8c0){if(_0x29e8c0)return _0x29e8c0;if(_0x232861[_0x03ea('0x49')]!=_0x03ea('0x50')){return createEndUser(_0x1774d9,_0x141078,_0x3f0756,_0x2b06d5,_0x1a9866,_0x232861);}else{return{};}});});break;case'contact':_0x45a76a[_0x03ea('0x4b')]=_0x03ea('0x40')+_0x141078+_0x03ea('0x4c')+_0x2b06d5+'))';return getZohoUser(_0x45a76a,_0x03ea('0x4d'))['then'](function(_0x5119a9){if(_0x5119a9)return _0x5119a9;if(_0x232861[_0x03ea('0x49')]!=_0x03ea('0x50')){return createEndUser(_0x1774d9,_0x141078,_0x3f0756,_0x2b06d5,_0x1a9866,_0x232861);}else{return{};}});break;case _0x03ea('0x51'):_0x45a76a[_0x03ea('0x4b')]=_0x03ea('0x40')+_0x141078+_0x03ea('0x4e')+_0x2b06d5+'))';return getZohoUser(_0x45a76a,_0x03ea('0x4f'))[_0x03ea('0x3c')](function(_0x252661){if(_0x252661)return _0x252661;if(_0x232861[_0x03ea('0x49')]!='nothing'){return createEndUser(_0x1774d9,_0x141078,_0x3f0756,_0x2b06d5,_0x1a9866,_0x232861);}else{return{};}});break;}}function getCall(_0x527bdc,_0xb87741,_0x12df85,_0x5d6372,_0x336cdb,_0x3ff4ee,_0x9975fb,_0x503d84){logger[_0x03ea('0x2c')](_0x03ea('0x52'));var _0xd7a88a={};_0xd7a88a[_0x03ea('0x53')]={'name':!_[_0x03ea('0x1a')](_0x5d6372['role'][_0x03ea('0x18')])&&!_[_0x03ea('0x1a')](_0x5d6372[_0x03ea('0x38')][_0x03ea('0x18')])&&_0x5d6372[_0x03ea('0x38')][_0x03ea('0x18')]===_0x03ea('0x54')?_0x5d6372[_0x03ea('0x43')][_0x03ea('0x18')]:!_[_0x03ea('0x1a')](_0x5d6372[_0x03ea('0x44')])?_0x5d6372[_0x03ea('0x44')]+'\x20'+_0x5d6372[_0x03ea('0x45')]:_0x5d6372[_0x03ea('0x45')],'id':_0x5d6372['id']};_0xd7a88a['Subject']=intUtil[_0x03ea('0x55')](_0x3ff4ee[_0x03ea('0x56')],_0x9975fb,'\x20');_0xd7a88a[_0x03ea('0x57')]=intUtil['getString'](_0x3ff4ee[_0x03ea('0x58')],_0x9975fb,'\x0a');if(_0x336cdb[_0x03ea('0x3e')]===_0x03ea('0x4d')){_0xd7a88a[_0x03ea('0x59')]={'name':!_[_0x03ea('0x1a')](_0x336cdb['Full_Name'])?_0x336cdb[_0x03ea('0x5a')]:!_['isNil'](_0x336cdb[_0x03ea('0x5b')])?_0x336cdb[_0x03ea('0x5b')]+'\x20'+_0x336cdb[_0x03ea('0x5c')]:_0x336cdb[_0x03ea('0x5c')],'id':_0x336cdb['id']};}if(_0x336cdb['enduserType']===_0x03ea('0x4f')){_0xd7a88a[_0x03ea('0x5d')]={'name':!_[_0x03ea('0x1a')](_0x336cdb[_0x03ea('0x5a')])?_0x336cdb['Full_Name']:!_[_0x03ea('0x1a')](_0x336cdb[_0x03ea('0x5b')])?_0x336cdb['First_Name']+'\x20'+_0x336cdb['Last_Name']:_0x336cdb[_0x03ea('0x5c')],'id':_0x336cdb['id']};_0xd7a88a[_0x03ea('0x5e')]=_['startCase'](_0x336cdb[_0x03ea('0x3e')]);}if(_0x9975fb[_0x03ea('0x5f')]){_0xd7a88a[_0x03ea('0x60')]=moment[_0x03ea('0x61')](parseInt(_0x9975fb['talktime'])*0x3e8)['format'](_0x03ea('0x62'));}else if(_0x9975fb['answertime']&&_0x9975fb[_0x03ea('0x63')]){_0xd7a88a[_0x03ea('0x60')]=moment[_0x03ea('0x61')](moment(_0x9975fb['endtime'],_0x03ea('0x64'))[_0x03ea('0x65')](moment(_0x9975fb[_0x03ea('0x66')],_0x03ea('0x64'))))[_0x03ea('0x67')]('mm:ss');}switch(_0x9975fb[_0x03ea('0x68')]){case _0x03ea('0x69'):_0xd7a88a[_0x03ea('0x6a')]=_0x03ea('0x6b');break;case _0x03ea('0x6c'):case'connect':_0xd7a88a[_0x03ea('0x6a')]=_0x03ea('0x6d');break;case _0x03ea('0x6e'):_0xd7a88a[_0x03ea('0x6a')]=_0x03ea('0x6f');break;case _0x03ea('0x70'):_0xd7a88a['Call_Result']=_0x03ea('0x71');break;case _0x03ea('0x72'):_0xd7a88a[_0x03ea('0x6a')]=_0x03ea('0x73');default:}_0xd7a88a[_0x03ea('0x74')]=(_0x503d84===_0x03ea('0x75')?moment(_0x9975fb[_0x03ea('0x66')])[_0x03ea('0x67')](_0x03ea('0x64')):moment(_0x9975fb['agentcalledAt'])[_0x03ea('0x67')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x03ea('0x67')](_0x03ea('0x64'));_0xd7a88a[_0x03ea('0x76')]=_0x503d84||'Inbound';_0xd7a88a=_[_0x03ea('0x77')](_0xd7a88a,getCustomFields(_0x3ff4ee[_0x03ea('0x78')],_0x9975fb));return request({'method':_0x03ea('0x3f'),'uri':_0x03ea('0x40')+_0xb87741+_0x03ea('0x79'),'headers':{'Authorization':_0x03ea('0x31')+_0x527bdc},'body':{'data':[_0xd7a88a]},'json':!![]})[_0x03ea('0x3c')](function(_0x5cd554){if(_0x5cd554&&_0x5cd554[_0x03ea('0x3d')][0x0][_0x03ea('0x46')]===_0x03ea('0x47')){logger[_0x03ea('0x2c')](_0x03ea('0x7a'));return{'id':_0x5cd554['data'][0x0][_0x03ea('0x48')]['id']};}})['catch'](function(_0x4d981c){logger[_0x03ea('0x2c')](_0x03ea('0x7b'),_0x4d981c[_0x03ea('0x7c')]);console[_0x03ea('0x7d')]('err',_0x4d981c);});}exports['queue']=function(_0x6dcad2,_0x33c3d2,_0x2d8f62,_0x2f468f,_0x323da7,_0x1f43dd){var _0x5a0b69,_0x5cfe97,_0x3bac07;_0x1f43dd[_0x03ea('0x7e')]=intUtil[_0x03ea('0x7f')](_0x1f43dd[_0x03ea('0x7e')]);_0x1f43dd['serverUrl']=intUtil[_0x03ea('0x7f')](_0x1f43dd[_0x03ea('0x80')]);if(_0x323da7&&_0x323da7['monitor_format']){logger[_0x03ea('0x2c')]('[QUEUE]',_0x03ea('0x81'));_0x33c3d2[_0x03ea('0x82')]=_0x1f43dd[_0x03ea('0x80')]+_0x03ea('0x83')+_0x33c3d2['uniqueid']+_0x03ea('0x84')+md5(_0x33c3d2['uniqueid']);}else{_0x33c3d2[_0x03ea('0x82')]='';}var _0x3496d8=_0x1f43dd['host']===_0x03ea('0x85')?'eu':_0x03ea('0x86');return getAccessToken(_0x1f43dd)[_0x03ea('0x3c')](function(_0x157db6){_0x3bac07=_0x157db6;return getUser(_0x3bac07,_0x3496d8,_0x1f43dd,_0x2f468f['email']);})[_0x03ea('0x3c')](function(_0x28f5c9){_0x5a0b69=_0x28f5c9;logger[_0x03ea('0x2c')](_0x03ea('0x87'),_0x5a0b69['id']);return getEndUser(_0x3bac07,_0x3496d8,_0x1f43dd,_0x33c3d2[_0x03ea('0x88')],_0x33c3d2['calleridnum'],_0x5a0b69,_0x2d8f62);})[_0x03ea('0x3c')](function(_0x1873c5){_0x5cfe97=_0x1873c5;return getCall(_0x3bac07,_0x3496d8,_0x1f43dd,_0x5a0b69,_0x5cfe97,_0x2d8f62,_0x33c3d2,_0x03ea('0x89'));})['then'](function(_0xa4bf3c){if(_0xa4bf3c){logger['info'](_0x03ea('0x8a'),_0xa4bf3c['id']);logger['info'](_0x03ea('0x8b'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x03ea('0x8c'),_0x2f468f[_0x03ea('0x18')]),'trigger:browser:url',{'uri':_0x03ea('0x8d')+_0x1f43dd[_0x03ea('0x7e')]+'/crm/EntityInfo.do?module=Calls&id='+_0xa4bf3c['id']});}})['catch'](function(_0x38eb0a){logger[_0x03ea('0x2a')]('[QUEUE]',JSON[_0x03ea('0xb')](_0x38eb0a));});};exports[_0x03ea('0x75')]=function(_0x2e4c27,_0x3b162c,_0xed81ac,_0x522af3,_0x180f62,_0x52bb05,_0x69a882){var _0x2a2439,_0x175103,_0x1ba57c;_0x52bb05[_0x03ea('0x7e')]=intUtil[_0x03ea('0x7f')](_0x52bb05[_0x03ea('0x7e')]);_0x52bb05[_0x03ea('0x80')]=intUtil['stripTrailingSlash'](_0x52bb05[_0x03ea('0x80')]);if(_0x69a882&&_0x69a882[_0x03ea('0x8e')]&&_0x69a882[_0x03ea('0x8e')]!==_0x03ea('0x8f')){logger['info'](_0x03ea('0x90'),_0x03ea('0x81'));_0x3b162c['recordingURL']=_0x52bb05[_0x03ea('0x80')]+'/api/voice/recordings/'+_0x3b162c[_0x03ea('0x91')]+_0x03ea('0x84')+md5(_0x3b162c[_0x03ea('0x91')]);}var _0xe8fa3f=_0x52bb05[_0x03ea('0x7e')]===_0x03ea('0x85')?'eu':_0x03ea('0x86');return getAccessToken(_0x52bb05)[_0x03ea('0x3c')](function(_0xd29574){_0x1ba57c=_0xd29574;return getUser(_0x1ba57c,_0xe8fa3f,_0x52bb05,_0x522af3['email']);})[_0x03ea('0x3c')](function(_0x44597b){_0x2a2439=_0x44597b;logger[_0x03ea('0x2c')]('The\x20User\x20ID\x20is:',_0x2a2439['id']);return getEndUser(_0x1ba57c,_0xe8fa3f,_0x52bb05,_0x3b162c[_0x03ea('0x92')],_0x3b162c[_0x03ea('0x93')],_0x2a2439,_0xed81ac);})[_0x03ea('0x3c')](function(_0x3cb7b2){_0x175103=_0x3cb7b2;return getCall(_0x1ba57c,_0xe8fa3f,_0x52bb05,_0x2a2439,_0x175103,_0xed81ac,_0x3b162c,_0x03ea('0x94'));})[_0x03ea('0x3c')](function(_0x1773ba){if(_0x1773ba){logger['info'](_0x03ea('0x8a'),_0x1773ba['id']);logger[_0x03ea('0x2c')](_0x03ea('0x90'),_0x03ea('0x95'));emit(util[_0x03ea('0x67')](_0x03ea('0x8c'),_0x522af3[_0x03ea('0x18')]),'trigger:browser:url',{'uri':_0x03ea('0x8d')+_0x52bb05['host']+_0x03ea('0x96')+_0x1773ba['id']});}})['catch'](function(_0x43223d){logger[_0x03ea('0x2a')]('[OUTBOUND]',JSON[_0x03ea('0xb')](_0x43223d));});};exports[_0x03ea('0x97')]=function(_0xd385ea,_0x135661,_0x317f88,_0x36960a,_0x25620f,_0x3b5e50){var _0x5be2b8,_0x50b52c,_0x59ebe6;_0x3b5e50[_0x03ea('0x7e')]=intUtil[_0x03ea('0x7f')](_0x3b5e50[_0x03ea('0x7e')]);_0x3b5e50[_0x03ea('0x80')]=intUtil['stripTrailingSlash'](_0x3b5e50[_0x03ea('0x80')]);if(_0x25620f&&_0x25620f[_0x03ea('0x98')]){logger[_0x03ea('0x2c')]('['+_0x135661[_0x03ea('0x68')][_0x03ea('0x99')]()+']',_0x03ea('0x81'));_0x135661[_0x03ea('0x82')]=_0x3b5e50[_0x03ea('0x80')]+_0x03ea('0x83')+_0x135661['uniqueid']+_0x03ea('0x84')+md5(_0x135661['uniqueid']);}else{_0x135661[_0x03ea('0x82')]='';}var _0x49a098=_0x3b5e50['host']==='zoho.eu'?'eu':'com';return getAccessToken(_0x3b5e50)['then'](function(_0x4eb691){_0x59ebe6=_0x4eb691;return getUser(_0x59ebe6,_0x49a098,_0x3b5e50);})['then'](function(_0x31ef0b){_0x5be2b8=_0x31ef0b;logger[_0x03ea('0x2c')](_0x03ea('0x87'),_0x5be2b8['id']);return getEndUser(_0x59ebe6,_0x49a098,_0x3b5e50,_0x135661['calleridname'],_0x135661['calleridnum'],_0x5be2b8,_0x317f88);})[_0x03ea('0x3c')](function(_0x13f88f){_0x50b52c=_0x13f88f;return getCall(_0x59ebe6,_0x49a098,_0x3b5e50,_0x5be2b8,_0x50b52c,_0x317f88,_0x135661,'Inbound');})[_0x03ea('0x3c')](function(_0x163786){if(_0x163786){logger[_0x03ea('0x2c')](_0x03ea('0x8a'),_0x163786['id']);}})[_0x03ea('0x29')](function(_0x1658c8){logger[_0x03ea('0x2a')]('['+_0x135661['lastevent'][_0x03ea('0x99')]()+']',JSON[_0x03ea('0xb')](_0x1658c8));});};
\ No newline at end of file
index 62a788d..b9f88bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6beb=['trigger','data2','Script','render','exec','error','%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'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x6beb,0x184));var _0xb6be=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6beb[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0xb6be('0x0'));var sh=require(_0xb6be('0x1'));var Mustache=require(_0xb6be('0x2'));var logger=require(_0xb6be('0x3'))(_0xb6be('0x4'));exports['exec']=function(_0x3d8a6f,_0x32dd3f){var _0xbe6b45=_0x3d8a6f[_0xb6be('0x5')]?_0x3d8a6f[_0xb6be('0x5')]:_0xb6be('0x6');var _0x16151e=_0x3d8a6f['data3']?Mustache[_0xb6be('0x7')](_0x3d8a6f['data3'],_0x32dd3f):_0x32dd3f;sh[_0xb6be('0x8')](_0x16151e,function(_0x37fbf3,_0x2638a4,_0xa9456b){if(_0x37fbf3!==0x0){logger[_0xb6be('0x9')](util['format'](_0xb6be('0xa'),_0xbe6b45,_0x16151e,_0x37fbf3,_0xa9456b));}else{logger[_0xb6be('0xb')](util[_0xb6be('0xc')](_0xb6be('0xd'),_0xbe6b45,_0x16151e,_0x2638a4));}});};
\ No newline at end of file
+var _0x676e=['data2','Script','data3','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','../../../../config/logger','exec'];(function(_0x3c6607,_0xaa6bce){var _0xecfc65=function(_0x1cb479){while(--_0x1cb479){_0x3c6607['push'](_0x3c6607['shift']());}};_0xecfc65(++_0xaa6bce);}(_0x676e,0xcf));var _0xe676=function(_0x25a42a,_0x3d489b){_0x25a42a=_0x25a42a-0x0;var _0x1129b1=_0x676e[_0x25a42a];return _0x1129b1;};'use strict';var util=require('util');var sh=require(_0xe676('0x0'));var Mustache=require('mustache');var logger=require(_0xe676('0x1'))('trigger');exports[_0xe676('0x2')]=function(_0x2a5979,_0x4523f2){var _0x2ccd22=_0x2a5979[_0xe676('0x3')]?_0x2a5979[_0xe676('0x3')]:_0xe676('0x4');var _0x4a1c37=_0x2a5979['data3']?Mustache['render'](_0x2a5979[_0xe676('0x5')],_0x4523f2):_0x4523f2;sh[_0xe676('0x2')](_0x4a1c37,function(_0x4ba4f3,_0xde78a6,_0x5cf640){if(_0x4ba4f3!==0x0){logger['error'](util[_0xe676('0x6')](_0xe676('0x7'),_0x2ccd22,_0x4a1c37,_0x4ba4f3,_0x5cf640));}else{logger[_0xe676('0x8')](util[_0xe676('0x6')](_0xe676('0x9'),_0x2ccd22,_0x4a1c37,_0xde78a6));}});};
\ No newline at end of file
index f594c2c..08c6257 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc34f=['%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','format','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','render','data2','data5','number','data6','parse','error','toUpperCase','GET','DELETE','POST','PUT','data7','body','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object'];(function(_0x5b1003,_0x4bfeb9){var _0x4a3ca8=function(_0x4f5bde){while(--_0x4f5bde){_0x5b1003['push'](_0x5b1003['shift']());}};_0x4a3ca8(++_0x4bfeb9);}(_0xc34f,0x1d2));var _0xfc34=function(_0x5dbe23,_0x12d1cf){_0x5dbe23=_0x5dbe23-0x0;var _0x1831f3=_0xc34f[_0x5dbe23];return _0x1831f3;};'use strict';var rp=require(_0xfc34('0x0'));var util=require(_0xfc34('0x1'));var _=require(_0xfc34('0x2'));var Mustache=require(_0xfc34('0x3'));var logger=require(_0xfc34('0x4'))(_0xfc34('0x5'));exports[_0xfc34('0x6')]=function(_0x204358,_0xabce7b){var _0x4c39d7,_0x31c8d3;var _0x3ced54={'method':_0x204358[_0xfc34('0x7')]['toUpperCase'](),'uri':Mustache[_0xfc34('0x8')](_0x204358[_0xfc34('0x9')],_0xabce7b),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x204358[_0xfc34('0xa')])===_0xfc34('0xb')&&parseInt(_0x204358[_0xfc34('0xa')])>=0x1&&parseInt(_0x204358[_0xfc34('0xa')])<=0xa?parseInt(_0x204358[_0xfc34('0xa')])*0x3e8:0x5*0x3e8};try{_0x3ced54['headers']=_0x204358[_0xfc34('0xc')]?JSON[_0xfc34('0xd')](Mustache[_0xfc34('0x8')](_0x204358[_0xfc34('0xc')],_0xabce7b)):{};}catch(_0x20917e){logger[_0xfc34('0xe')](_0x20917e['stack']);}switch(_0x204358[_0xfc34('0x7')][_0xfc34('0xf')]()){case _0xfc34('0x10'):case _0xfc34('0x11'):_0x4c39d7=null;_0x3ced54['qs']=_0xabce7b;break;case _0xfc34('0x12'):case _0xfc34('0x13'):if(_0x204358[_0xfc34('0x14')]){try{_0x4c39d7=JSON[_0xfc34('0xd')](Mustache[_0xfc34('0x8')](_0x204358[_0xfc34('0x14')],_0xabce7b));_0x3ced54[_0xfc34('0x15')]=_0x4c39d7;}catch(_0x34fb90){logger[_0xfc34('0xe')](_0x34fb90['stack']);logger[_0xfc34('0xe')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x4c39d7=_0xabce7b;_0x3ced54[_0xfc34('0x15')]=_0x4c39d7;}break;}logger[_0xfc34('0x16')](util['format'](_0xfc34('0x17'),_0x204358['data1'],_0x204358[_0xfc34('0x9')],JSON[_0xfc34('0x18')](_0x3ced54)));rp(_0x3ced54)[_0xfc34('0x19')](function(_0x2e0b0a){_0x4c39d7=!_[_0xfc34('0x1a')](_0x4c39d7)?_0xfc34('0x1b')+_0x4c39d7:'';_0x31c8d3=typeof _0x2e0b0a[_0xfc34('0x15')]===_0xfc34('0x1c')?JSON['stringify'](_0x2e0b0a[_0xfc34('0x15')]):_0x2e0b0a[_0xfc34('0x15')];logger[_0xfc34('0x16')](util['format'](_0xfc34('0x1d'),_0x204358['data1'],_0x204358['data2'],_0x2e0b0a['statusCode'],_0x31c8d3));})['catch'](function(_0xa7f4c2){logger['error'](util[_0xfc34('0x1e')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x204358[_0xfc34('0x7')],_0x204358['data2'],_0xa7f4c2['statusCode'],_0xa7f4c2[_0xfc34('0x1f')],_0xa7f4c2[_0xfc34('0x20')]));});};
\ No newline at end of file
+var _0xb21c=['mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','data2','number','data5','headers','data6','parse','render','error','stack','GET','DELETE','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','util','lodash'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xb21c,0xa8));var _0xcb21=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xb21c[_0x4baae2];return _0x1a2285;};'use strict';var rp=require('request-promise');var util=require(_0xcb21('0x0'));var _=require(_0xcb21('0x1'));var Mustache=require(_0xcb21('0x2'));var logger=require(_0xcb21('0x3'))(_0xcb21('0x4'));exports[_0xcb21('0x5')]=function(_0x54b84e,_0x382022){var _0x2c136b,_0x338fad;var _0x271e9f={'method':_0x54b84e[_0xcb21('0x6')][_0xcb21('0x7')](),'uri':Mustache['render'](_0x54b84e[_0xcb21('0x8')],_0x382022),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x54b84e['data5'])===_0xcb21('0x9')&&parseInt(_0x54b84e[_0xcb21('0xa')])>=0x1&&parseInt(_0x54b84e[_0xcb21('0xa')])<=0xa?parseInt(_0x54b84e[_0xcb21('0xa')])*0x3e8:0x5*0x3e8};try{_0x271e9f[_0xcb21('0xb')]=_0x54b84e[_0xcb21('0xc')]?JSON[_0xcb21('0xd')](Mustache[_0xcb21('0xe')](_0x54b84e['data6'],_0x382022)):{};}catch(_0x46dc8e){logger[_0xcb21('0xf')](_0x46dc8e[_0xcb21('0x10')]);}switch(_0x54b84e[_0xcb21('0x6')]['toUpperCase']()){case _0xcb21('0x11'):case _0xcb21('0x12'):_0x2c136b=null;_0x271e9f['qs']=_0x382022;break;case _0xcb21('0x13'):case _0xcb21('0x14'):if(_0x54b84e[_0xcb21('0x15')]){try{_0x2c136b=JSON[_0xcb21('0xd')](Mustache['render'](_0x54b84e[_0xcb21('0x15')],_0x382022));_0x271e9f[_0xcb21('0x16')]=_0x2c136b;}catch(_0x4412f2){logger[_0xcb21('0xf')](_0x4412f2[_0xcb21('0x10')]);logger[_0xcb21('0xf')](_0xcb21('0x17'));}}else{_0x2c136b=_0x382022;_0x271e9f[_0xcb21('0x16')]=_0x2c136b;}break;}logger[_0xcb21('0x18')](util['format'](_0xcb21('0x19'),_0x54b84e['data1'],_0x54b84e[_0xcb21('0x8')],JSON[_0xcb21('0x1a')](_0x271e9f)));rp(_0x271e9f)[_0xcb21('0x1b')](function(_0x3c7113){_0x2c136b=!_[_0xcb21('0x1c')](_0x2c136b)?_0xcb21('0x1d')+_0x2c136b:'';_0x338fad=typeof _0x3c7113['body']==='object'?JSON[_0xcb21('0x1a')](_0x3c7113[_0xcb21('0x16')]):_0x3c7113[_0xcb21('0x16')];logger[_0xcb21('0x18')](util[_0xcb21('0x1e')](_0xcb21('0x1f'),_0x54b84e[_0xcb21('0x6')],_0x54b84e[_0xcb21('0x8')],_0x3c7113[_0xcb21('0x20')],_0x338fad));})[_0xcb21('0x21')](function(_0x3173e8){logger[_0xcb21('0xf')](util[_0xcb21('0x1e')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x54b84e[_0xcb21('0x6')],_0x54b84e[_0xcb21('0x8')],_0x3173e8[_0xcb21('0x20')],_0x3173e8['name'],_0x3173e8['message']));});};
\ No newline at end of file
index 6c54c66..c390ebe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76c6=['message','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','routing','error'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x76c6,0xd5));var _0x676c=function(_0xa9c9e8,_0x404ae5){_0xa9c9e8=_0xa9c9e8-0x0;var _0x27d4bb=_0x76c6[_0xa9c9e8];return _0x27d4bb;};'use strict';var jayson=require(_0x676c('0x0'));var BPromise=require(_0x676c('0x1'));var logger=require(_0x676c('0x2'))('routing');var client=jayson[_0x676c('0x3')][_0x676c('0x4')]({'port':0x2329});client[_0x676c('0x5')]=function(_0x3bc186,_0x20dac7){return new BPromise(function(_0x495526,_0x180fbf){return client[_0x676c('0x6')](_0x3bc186,_0x20dac7)[_0x676c('0x7')](function(_0xb65761){logger[_0x676c('0x8')](_0x676c('0x9'),_0x676c('0xa'),_0x3bc186,_0x20dac7,_0xb65761);if(_0xb65761[_0x676c('0xb')]){logger[_0x676c('0xb')](_0x676c('0x9'),_0x676c('0xa'),_0x3bc186,_0xb65761[_0x676c('0xb')][_0x676c('0xc')],_0x20dac7);return _0x180fbf(_0xb65761['error'][_0x676c('0xc')]);}else{return _0x495526(_0xb65761['result']);}})[_0x676c('0xd')](function(_0x1c120b){logger[_0x676c('0xb')](_0x676c('0x9'),'routing',_0x3bc186,_0x1c120b,_0x20dac7);return _0x180fbf(_0x1c120b);});});};module[_0x676c('0xe')]=client;
\ No newline at end of file
+var _0xaa4c=['then','debug','error','rpc','message','catch','jayson/promise','bluebird','../../config/logger','routing','http','Request','request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xaa4c,0x10a));var _0xcaa4=function(_0x17dbf4,_0x3e305f){_0x17dbf4=_0x17dbf4-0x0;var _0x53520a=_0xaa4c[_0x17dbf4];return _0x53520a;};'use strict';var jayson=require(_0xcaa4('0x0'));var BPromise=require(_0xcaa4('0x1'));var logger=require(_0xcaa4('0x2'))(_0xcaa4('0x3'));var client=jayson['client'][_0xcaa4('0x4')]({'port':0x2329});client[_0xcaa4('0x5')]=function(_0x48a761,_0x3d6db2){return new BPromise(function(_0x20f5d4,_0x463f01){return client[_0xcaa4('0x6')](_0x48a761,_0x3d6db2)[_0xcaa4('0x7')](function(_0x394ceb){logger[_0xcaa4('0x8')]('rpc',_0xcaa4('0x3'),_0x48a761,_0x3d6db2,_0x394ceb);if(_0x394ceb[_0xcaa4('0x9')]){logger[_0xcaa4('0x9')](_0xcaa4('0xa'),_0xcaa4('0x3'),_0x48a761,_0x394ceb[_0xcaa4('0x9')][_0xcaa4('0xb')],_0x3d6db2);return _0x463f01(_0x394ceb['error'][_0xcaa4('0xb')]);}else{return _0x20f5d4(_0x394ceb['result']);}})[_0xcaa4('0xc')](function(_0x5e9ec7){logger[_0xcaa4('0x9')](_0xcaa4('0xa'),_0xcaa4('0x3'),_0x48a761,_0x5e9ec7,_0x3d6db2);return _0x463f01(_0x5e9ec7);});});};module['exports']=client;
\ No newline at end of file
index 1840fbd..7f78838 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38f1=['mailAccounts','listen','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/setting','../../config/logger','resolve','then','getMailAccounts','refresh'];(function(_0x1cd674,_0x8d3638){var _0x27928f=function(_0x5e3c70){while(--_0x5e3c70){_0x1cd674['push'](_0x1cd674['shift']());}};_0x27928f(++_0x8d3638);}(_0x38f1,0x1d7));var _0x138f=function(_0x40ff75,_0x8d322){_0x40ff75=_0x40ff75-0x0;var _0x110488=_0x38f1[_0x40ff75];return _0x110488;};'use strict';var server=require(_0x138f('0x0'));var Realtime=require(_0x138f('0x1'));var EmailChannel=require(_0x138f('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0x138f('0x3'));var logger=require(_0x138f('0x4'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x138f('0x5')]()[_0x138f('0x6')](mailAccount[_0x138f('0x7')]())[_0x138f('0x6')](realtime['initMailAccounts']())[_0x138f('0x6')](function(){email[_0x138f('0x8')](realtime[_0x138f('0x9')]);return realtime;});}function main(){return server[_0x138f('0xa')](realtime,email)[_0x138f('0x6')](function(){return initRealtime();})[_0x138f('0x6')](function(){return setting[_0x138f('0xb')]();})[_0x138f('0x6')](function(_0x1e4a77){return setInterval(initRealtime,_0x1e4a77[_0x138f('0xc')]*0x3e8);})[_0x138f('0xd')](function(_0x5d21fe){logger[_0x138f('0xe')](_0x138f('0xf'),_0x5d21fe);});}main();
\ No newline at end of file
+var _0x641d=['mailAccounts','listen','getSettings','loginMailFrequency','./server','./realtime','./rpc/setting','email','resolve','getMailAccounts','then','initMailAccounts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x641d,0x1cc));var _0xd641=function(_0x169bc1,_0x4dd004){_0x169bc1=_0x169bc1-0x0;var _0x4ac893=_0x641d[_0x169bc1];return _0x4ac893;};'use strict';var server=require(_0xd641('0x0'));var Realtime=require(_0xd641('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require('./rpc/mailAccount');var setting=require(_0xd641('0x2'));var logger=require('../../config/logger')(_0xd641('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xd641('0x4')]()['then'](mailAccount[_0xd641('0x5')]())[_0xd641('0x6')](realtime[_0xd641('0x7')]())['then'](function(){email['refresh'](realtime[_0xd641('0x8')]);return realtime;});}function main(){return server[_0xd641('0x9')](realtime,email)[_0xd641('0x6')](function(){return initRealtime();})[_0xd641('0x6')](function(){return setting[_0xd641('0xa')]();})[_0xd641('0x6')](function(_0x2198da){return setInterval(initRealtime,_0x2198da[_0xd641('0xb')]*0x3e8);})['catch'](function(_0x18b665){logger['error']('Email\x20service\x20initialization',_0x18b665);});}main();
\ No newline at end of file
index d3d9d37..7751931 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bea=['send','Smtp','verify','verified','catch','exports','bluebird','ioredis','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','prototype','emit','name','key','active','Imap','status','messageStatus','total','isNil','stringify','md5','mailAccount:update','refresh','hasOwnProperty','service','provider','custom','box','handleImapBox','bind','end','error','handleImapError','disabled','connected','firstName','lastName','from','then','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','sendMail','smtp'];(function(_0x4bf91d,_0x30b134){var _0x5f3de9=function(_0x37783d){while(--_0x37783d){_0x4bf91d['push'](_0x4bf91d['shift']());}};_0x5f3de9(++_0x30b134);}(_0x3bea,0x1be));var _0xa3be=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x3bea[_0x5d4607];return _0x5e4a86;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0xa3be('0x0'));var md5=require('md5');var Redis=require(_0xa3be('0x1'));var config=require('../../../config/environment');var logger=require(_0xa3be('0x2'))(_0xa3be('0x3'));config[_0xa3be('0x4')]=_[_0xa3be('0x5')](config[_0xa3be('0x4')],{'host':_0xa3be('0x6'),'port':0x18eb});var io=require(_0xa3be('0x7'))(new Redis(config[_0xa3be('0x4')]));var EmailImap=require(_0xa3be('0x8'));var EmailSmtp=require('./smtp');var mailAccount=require(_0xa3be('0x9'));var md5Accounts={};function EmailChannel(_0x152723){logger[_0xa3be('0xa')](_0xa3be('0xb'));this[_0xa3be('0xc')]=_0x152723['mailAccounts'];this[_0xa3be('0xd')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0xa3be('0xe')][_0xa3be('0xf')]=function(_0x2035c1){var _0x39bae8=this[_0xa3be('0xc')][_0x2035c1];var _0x52e31c={'id':_0x39bae8['id'],'name':_0x39bae8[_0xa3be('0x10')],'key':_0x39bae8[_0xa3be('0x11')],'active':_0x39bae8[_0xa3be('0x12')],'Imap':{'status':_0x39bae8[_0xa3be('0x13')][_0xa3be('0x14')],'messageStatus':_0x39bae8['Imap'][_0xa3be('0x15')],'total':_0x39bae8['Imap'][_0xa3be('0x16')]}};if(_[_0xa3be('0x17')](md5Accounts[_0x2035c1])){md5Accounts[_0x2035c1]={};}var _0x3e0a29=md5(JSON[_0xa3be('0x18')](_0x52e31c));if(md5Accounts[_0x2035c1][_0xa3be('0x19')]!==_0x3e0a29){md5Accounts[_0x2035c1][_0xa3be('0x19')]=_0x3e0a29;io[_0xa3be('0xf')](_0xa3be('0x1a'),_0x52e31c);}};EmailChannel[_0xa3be('0xe')][_0xa3be('0x1b')]=function(_0x2b178f){for(var _0x29b6f1 in _0x2b178f){if(_0x2b178f[_0xa3be('0x1c')](_0x29b6f1)){if(_0x2b178f[_0x29b6f1][_0xa3be('0x13')]&&_0x2b178f[_0x29b6f1][_0xa3be('0x12')]){var _0x3e18c3=_0x2b178f[_0x29b6f1]['Imap'];if(!_0x3e18c3[_0xa3be('0x1d')]&&_0x2b178f[_0x29b6f1][_0xa3be('0x1e')]!==_0xa3be('0x1f'))_0x3e18c3[_0xa3be('0x1d')]=_0x2b178f[_0x29b6f1]['provider'];if(!this[_0xa3be('0xd')]['hasOwnProperty'](_0x3e18c3['id'])){this[_0xa3be('0xd')][_0x3e18c3['id']]=new EmailImap(_0x3e18c3,_0x2b178f[_0x29b6f1][_0xa3be('0x3')]);this[_0xa3be('0xd')][_0x3e18c3['id']]['on'](_0xa3be('0x20'),this[_0xa3be('0x21')]['bind'](this,_0x29b6f1));this[_0xa3be('0xd')][_0x3e18c3['id']]['on'](_0xa3be('0x3'),this['handleImapEmail'][_0xa3be('0x22')](this,_0x29b6f1));this[_0xa3be('0xd')][_0x3e18c3['id']]['on'](_0xa3be('0x23'),this['handleImapEnd'][_0xa3be('0x22')](this,_0x29b6f1));this[_0xa3be('0xd')][_0x3e18c3['id']]['on'](_0xa3be('0x24'),this[_0xa3be('0x25')][_0xa3be('0x22')](this,_0x29b6f1));}}else{if(_[_0xa3be('0x17')](this[_0xa3be('0xc')][_0x29b6f1][_0xa3be('0x13')])){this[_0xa3be('0xc')][_0x29b6f1]['Imap']={};}this['mailAccounts'][_0x29b6f1]['Imap'][_0xa3be('0x14')]=_0xa3be('0x26');this[_0xa3be('0xc')][_0x29b6f1]['Imap'][_0xa3be('0x15')]='';this[_0xa3be('0xf')](_0x29b6f1);}}}};EmailChannel[_0xa3be('0xe')]['handleImapBox']=function(_0x1a6519,_0x333afb){if(this[_0xa3be('0xc')][_0x1a6519]){this[_0xa3be('0xc')][_0x1a6519][_0xa3be('0x13')][_0xa3be('0x14')]=_0xa3be('0x27');this[_0xa3be('0xc')][_0x1a6519][_0xa3be('0x13')][_0xa3be('0x15')]=_0x333afb[_0xa3be('0x10')];if(_0x333afb['messages']){this['mailAccounts'][_0x1a6519][_0xa3be('0x13')][_0xa3be('0x16')]=_0x333afb['messages'][_0xa3be('0x16')];}return this[_0xa3be('0xf')](_0x1a6519);}};EmailChannel[_0xa3be('0xe')]['handleImapEmail']=function(_0x5efe3,_0x3b9be5){logger[_0xa3be('0xa')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x3b9be5[_0xa3be('0x28')],_0x3b9be5[_0xa3be('0x29')],_0x3b9be5[_0xa3be('0x2a')],_0x5efe3);if(this[_0xa3be('0xc')][_0x5efe3]){return mailAccount['notify'](_0x5efe3,_0x3b9be5)[_0xa3be('0x2b')](function(_0x578089){if(_0x578089){logger[_0xa3be('0xa')]('Mail\x20accepted\x20from\x20routing');}})['catch'](function(_0x516f9f){logger['error'](_0xa3be('0x2c'),JSON[_0xa3be('0x18')](_0x516f9f));});}};EmailChannel[_0xa3be('0xe')][_0xa3be('0x2d')]=function(_0x298720){if(this['mailAccounts'][_0x298720]&&this['mailAccounts'][_0x298720][_0xa3be('0x13')]){if(this[_0xa3be('0xd')][this[_0xa3be('0xc')][_0x298720][_0xa3be('0x13')]['id']]){delete this[_0xa3be('0xd')][this[_0xa3be('0xc')][_0x298720]['Imap']['id']];}this[_0xa3be('0xc')][_0x298720][_0xa3be('0x13')][_0xa3be('0x2e')]=moment();this[_0xa3be('0xf')](_0x298720);}};EmailChannel[_0xa3be('0xe')][_0xa3be('0x25')]=function(_0x2ea6ce,_0x3fbe0a){if(this[_0xa3be('0xc')][_0x2ea6ce]){this[_0xa3be('0xc')][_0x2ea6ce]['Imap'][_0xa3be('0x14')]=_0xa3be('0x24');this['mailAccounts'][_0x2ea6ce]['Imap'][_0xa3be('0x15')]=_0x3fbe0a;return this['emit'](_0x2ea6ce);}};EmailChannel['prototype'][_0xa3be('0x2f')]=function(_0x153ecd,_0x4c5256){return this[_0xa3be('0x30')][_0xa3be('0x31')](_0x153ecd,_0x4c5256);};EmailChannel[_0xa3be('0xe')]['verifySmtp']=function(_0x3dc5ca){var _0x39a581=this;if(this[_0xa3be('0xc')][_0x3dc5ca['id']]){if(_[_0xa3be('0x17')](this[_0xa3be('0xc')][_0x3dc5ca['id']][_0xa3be('0x32')])){this[_0xa3be('0xc')][_0x3dc5ca['id']]['Smtp']={};}this[_0xa3be('0xc')][_0x3dc5ca['id']][_0xa3be('0x32')]['lastSync']=moment();return new BPromise(function(_0x1c724a,_0x43ee02){return _0x39a581[_0xa3be('0x30')][_0xa3be('0x33')](_0x3dc5ca)[_0xa3be('0x2b')](function(_0x4b58d2){_0x39a581[_0xa3be('0xc')][_0x3dc5ca['id']][_0xa3be('0x32')][_0xa3be('0x14')]=_0xa3be('0x34');_0x39a581[_0xa3be('0xc')][_0x3dc5ca['id']][_0xa3be('0x32')][_0xa3be('0x15')]='';_0x39a581['emit'](_0x3dc5ca['id']);_0x1c724a(_0x4b58d2);})[_0xa3be('0x35')](function(_0x46f097){_0x39a581['mailAccounts'][_0x3dc5ca['id']][_0xa3be('0x32')][_0xa3be('0x14')]='error';_0x39a581[_0xa3be('0xc')][_0x3dc5ca['id']][_0xa3be('0x32')]['messageStatus']=_0x46f097;_0x39a581[_0xa3be('0xf')](_0x3dc5ca['id']);_0x43ee02(_0x46f097);});});}return this[_0xa3be('0x30')]['verify'](_0x3dc5ca);};module[_0xa3be('0x36')]=EmailChannel;
\ No newline at end of file
+var _0x8a9e=['start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit','active','Imap','status','total','isNil','md5','refresh','hasOwnProperty','service','provider','custom','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','prototype','connected','messageStatus','name','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','catch','stringify','lastSync','sendMail','send','verifySmtp','Smtp','then','verified','verify','exports','lodash','moment','bluebird','ioredis','../../../config/environment','email','defaults','redis','localhost','./imap','./smtp','../rpc/mailAccount','info'];(function(_0x4aa838,_0x4aa14f){var _0x3abff0=function(_0x402d55){while(--_0x402d55){_0x4aa838['push'](_0x4aa838['shift']());}};_0x3abff0(++_0x4aa14f);}(_0x8a9e,0xdb));var _0xe8a9=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x8a9e[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0xe8a9('0x0'));var moment=require(_0xe8a9('0x1'));var BPromise=require(_0xe8a9('0x2'));var md5=require('md5');var Redis=require(_0xe8a9('0x3'));var config=require(_0xe8a9('0x4'));var logger=require('../../../config/logger')(_0xe8a9('0x5'));config['redis']=_[_0xe8a9('0x6')](config[_0xe8a9('0x7')],{'host':_0xe8a9('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var EmailImap=require(_0xe8a9('0x9'));var EmailSmtp=require(_0xe8a9('0xa'));var mailAccount=require(_0xe8a9('0xb'));var md5Accounts={};function EmailChannel(_0x552a43){logger[_0xe8a9('0xc')](_0xe8a9('0xd'));this[_0xe8a9('0xe')]=_0x552a43[_0xe8a9('0xe')];this[_0xe8a9('0xf')]={};this[_0xe8a9('0x10')]=new EmailSmtp();}EmailChannel['prototype'][_0xe8a9('0x11')]=function(_0x9cd4a9){var _0x3acc75=this[_0xe8a9('0xe')][_0x9cd4a9];var _0x5eb450={'id':_0x3acc75['id'],'name':_0x3acc75['name'],'key':_0x3acc75['key'],'active':_0x3acc75[_0xe8a9('0x12')],'Imap':{'status':_0x3acc75[_0xe8a9('0x13')][_0xe8a9('0x14')],'messageStatus':_0x3acc75[_0xe8a9('0x13')]['messageStatus'],'total':_0x3acc75[_0xe8a9('0x13')][_0xe8a9('0x15')]}};if(_[_0xe8a9('0x16')](md5Accounts[_0x9cd4a9])){md5Accounts[_0x9cd4a9]={};}var _0x20d380=md5(JSON['stringify'](_0x5eb450));if(md5Accounts[_0x9cd4a9]['md5']!==_0x20d380){md5Accounts[_0x9cd4a9][_0xe8a9('0x17')]=_0x20d380;io['emit']('mailAccount:update',_0x5eb450);}};EmailChannel['prototype'][_0xe8a9('0x18')]=function(_0x52b5a0){for(var _0x381332 in _0x52b5a0){if(_0x52b5a0[_0xe8a9('0x19')](_0x381332)){if(_0x52b5a0[_0x381332]['Imap']&&_0x52b5a0[_0x381332][_0xe8a9('0x12')]){var _0x38cf0f=_0x52b5a0[_0x381332]['Imap'];if(!_0x38cf0f[_0xe8a9('0x1a')]&&_0x52b5a0[_0x381332][_0xe8a9('0x1b')]!==_0xe8a9('0x1c'))_0x38cf0f[_0xe8a9('0x1a')]=_0x52b5a0[_0x381332][_0xe8a9('0x1b')];if(!this[_0xe8a9('0xf')][_0xe8a9('0x19')](_0x38cf0f['id'])){this[_0xe8a9('0xf')][_0x38cf0f['id']]=new EmailImap(_0x38cf0f,_0x52b5a0[_0x381332]['email']);this[_0xe8a9('0xf')][_0x38cf0f['id']]['on'](_0xe8a9('0x1d'),this[_0xe8a9('0x1e')][_0xe8a9('0x1f')](this,_0x381332));this['imapAccounts'][_0x38cf0f['id']]['on'](_0xe8a9('0x5'),this[_0xe8a9('0x20')]['bind'](this,_0x381332));this['imapAccounts'][_0x38cf0f['id']]['on'](_0xe8a9('0x21'),this[_0xe8a9('0x22')][_0xe8a9('0x1f')](this,_0x381332));this[_0xe8a9('0xf')][_0x38cf0f['id']]['on'](_0xe8a9('0x23'),this[_0xe8a9('0x24')][_0xe8a9('0x1f')](this,_0x381332));}}else{if(_[_0xe8a9('0x16')](this[_0xe8a9('0xe')][_0x381332]['Imap'])){this[_0xe8a9('0xe')][_0x381332]['Imap']={};}this[_0xe8a9('0xe')][_0x381332][_0xe8a9('0x13')][_0xe8a9('0x14')]='disabled';this[_0xe8a9('0xe')][_0x381332][_0xe8a9('0x13')]['messageStatus']='';this[_0xe8a9('0x11')](_0x381332);}}}};EmailChannel[_0xe8a9('0x25')][_0xe8a9('0x1e')]=function(_0x5b604f,_0x7ec9e9){if(this[_0xe8a9('0xe')][_0x5b604f]){this[_0xe8a9('0xe')][_0x5b604f]['Imap'][_0xe8a9('0x14')]=_0xe8a9('0x26');this[_0xe8a9('0xe')][_0x5b604f][_0xe8a9('0x13')][_0xe8a9('0x27')]=_0x7ec9e9[_0xe8a9('0x28')];if(_0x7ec9e9[_0xe8a9('0x29')]){this[_0xe8a9('0xe')][_0x5b604f][_0xe8a9('0x13')]['total']=_0x7ec9e9[_0xe8a9('0x29')][_0xe8a9('0x15')];}return this[_0xe8a9('0x11')](_0x5b604f);}};EmailChannel[_0xe8a9('0x25')][_0xe8a9('0x20')]=function(_0x1d971b,_0x34aa67){logger['info'](_0xe8a9('0x2a'),_0x34aa67[_0xe8a9('0x2b')],_0x34aa67[_0xe8a9('0x2c')],_0x34aa67[_0xe8a9('0x2d')],_0x1d971b);if(this[_0xe8a9('0xe')][_0x1d971b]){return mailAccount[_0xe8a9('0x2e')](_0x1d971b,_0x34aa67)['then'](function(_0x31f963){if(_0x31f963){logger[_0xe8a9('0xc')]('Mail\x20accepted\x20from\x20routing');}})[_0xe8a9('0x2f')](function(_0x5a8cd9){logger['error']('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xe8a9('0x30')](_0x5a8cd9));});}};EmailChannel['prototype'][_0xe8a9('0x22')]=function(_0x3aee49){if(this['mailAccounts'][_0x3aee49]&&this['mailAccounts'][_0x3aee49]['Imap']){if(this[_0xe8a9('0xf')][this['mailAccounts'][_0x3aee49]['Imap']['id']]){delete this['imapAccounts'][this['mailAccounts'][_0x3aee49][_0xe8a9('0x13')]['id']];}this[_0xe8a9('0xe')][_0x3aee49][_0xe8a9('0x13')][_0xe8a9('0x31')]=moment();this[_0xe8a9('0x11')](_0x3aee49);}};EmailChannel[_0xe8a9('0x25')][_0xe8a9('0x24')]=function(_0x119bda,_0x13be88){if(this[_0xe8a9('0xe')][_0x119bda]){this[_0xe8a9('0xe')][_0x119bda][_0xe8a9('0x13')][_0xe8a9('0x14')]='error';this[_0xe8a9('0xe')][_0x119bda]['Imap'][_0xe8a9('0x27')]=_0x13be88;return this[_0xe8a9('0x11')](_0x119bda);}};EmailChannel[_0xe8a9('0x25')][_0xe8a9('0x32')]=function(_0x3ab13b,_0x4ae8fe){return this[_0xe8a9('0x10')][_0xe8a9('0x33')](_0x3ab13b,_0x4ae8fe);};EmailChannel[_0xe8a9('0x25')][_0xe8a9('0x34')]=function(_0x4bfc49){var _0x79d2b9=this;if(this[_0xe8a9('0xe')][_0x4bfc49['id']]){if(_[_0xe8a9('0x16')](this[_0xe8a9('0xe')][_0x4bfc49['id']][_0xe8a9('0x35')])){this['mailAccounts'][_0x4bfc49['id']]['Smtp']={};}this[_0xe8a9('0xe')][_0x4bfc49['id']]['Smtp'][_0xe8a9('0x31')]=moment();return new BPromise(function(_0x215f50,_0x42be7a){return _0x79d2b9[_0xe8a9('0x10')]['verify'](_0x4bfc49)[_0xe8a9('0x36')](function(_0x328443){_0x79d2b9['mailAccounts'][_0x4bfc49['id']]['Smtp'][_0xe8a9('0x14')]=_0xe8a9('0x37');_0x79d2b9[_0xe8a9('0xe')][_0x4bfc49['id']]['Smtp'][_0xe8a9('0x27')]='';_0x79d2b9[_0xe8a9('0x11')](_0x4bfc49['id']);_0x215f50(_0x328443);})['catch'](function(_0x595e7b){_0x79d2b9[_0xe8a9('0xe')][_0x4bfc49['id']][_0xe8a9('0x35')][_0xe8a9('0x14')]=_0xe8a9('0x23');_0x79d2b9[_0xe8a9('0xe')][_0x4bfc49['id']]['Smtp']['messageStatus']=_0x595e7b;_0x79d2b9['emit'](_0x4bfc49['id']);_0x42be7a(_0x595e7b);});});}return this[_0xe8a9('0x10')][_0xe8a9('0x38')](_0x4bfc49);};module[_0xe8a9('0x39')]=EmailChannel;
\ No newline at end of file
index 02a6b93..ab01b94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7314=['lodash','util','mailparser','simpleParser','iconv','events','EventEmitter','./utils','email','mailbox','account','getAccount','once','ready','handleReady','imap','end','handleEnd','bind','error','handleError','connect','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','CloudProvider','data5','password','anonymous@xcally.com','host','port','tls','autotls','required','prototype','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','length','fetch','handleFetchError','handleFetchEnd','handleFetchMessage','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','closeBox','stringify','textCode','hasOwnProperty','upperFirst','exports'];(function(_0x1fa7da,_0x82cb97){var _0x809b2f=function(_0x8fb22a){while(--_0x8fb22a){_0x1fa7da['push'](_0x1fa7da['shift']());}};_0x809b2f(++_0x82cb97);}(_0x7314,0x100));var _0x4731=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7314[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x4731('0x0'));var util=require(_0x4731('0x1'));var Imap=require('imap');var simpleParser=require(_0x4731('0x2'))[_0x4731('0x3')];var Iconv=require(_0x4731('0x4'))['Iconv'];var EventEmitter=require(_0x4731('0x5'))[_0x4731('0x6')];var utils=require(_0x4731('0x7'));var logger=require('../../../config/logger')(_0x4731('0x8'));function EmailImap(_0x1baa3f,_0x4d0789){this[_0x4731('0x9')]=_0x1baa3f[_0x4731('0x9')];this[_0x4731('0xa')]=this[_0x4731('0xb')](_0x1baa3f,_0x4d0789);this['imap']=new Imap(this[_0x4731('0xa')]);this['imap'][_0x4731('0xc')](_0x4731('0xd'),this[_0x4731('0xe')]['bind'](this));this[_0x4731('0xf')][_0x4731('0xc')](_0x4731('0x10'),this[_0x4731('0x11')][_0x4731('0x12')](this));this[_0x4731('0xf')]['on'](_0x4731('0x13'),this[_0x4731('0x14')][_0x4731('0x12')](this));this[_0x4731('0xf')][_0x4731('0x15')]();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype'][_0x4731('0xb')]=function(_0x15ea96,_0x515f65){var _0x3c99a2={'connTimeout':_0x15ea96[_0x4731('0x16')]?_0x15ea96[_0x4731('0x16')]*0x3e8:0x2710,'authTimeout':_0x15ea96[_0x4731('0x17')]?_0x15ea96['authTimeout']*0x3e8:0x1388};if(_0x15ea96[_0x4731('0x18')]){_0x3c99a2[_0x4731('0x19')]=_0x15ea96['user'];if(_0x15ea96[_0x4731('0x1a')]){_0x3c99a2[_0x4731('0x1b')]=utils['generateXOAuth2Token'](_0x15ea96[_0x4731('0x1c')][_0x4731('0x1d')],_0x15ea96['user']);}else{_0x3c99a2[_0x4731('0x1e')]=_0x15ea96[_0x4731('0x1e')];}}else{if(_0x15ea96['authentication']){_0x3c99a2['user']=_0x15ea96[_0x4731('0x19')];_0x3c99a2[_0x4731('0x1e')]=_0x15ea96[_0x4731('0x1e')];}}_0x3c99a2['email']=_0x515f65||_0x15ea96[_0x4731('0x19')]||_0x4731('0x1f');_0x3c99a2[_0x4731('0x20')]=_0x15ea96[_0x4731('0x20')];_0x3c99a2[_0x4731('0x21')]=_0x15ea96[_0x4731('0x21')]||0x3e1;if(_0x15ea96[_0x4731('0x22')]){_0x3c99a2[_0x4731('0x22')]=!![];}else{_0x3c99a2[_0x4731('0x22')]=![];_0x3c99a2[_0x4731('0x23')]=_0x4731('0x24');}return _0x3c99a2;};EmailImap[_0x4731('0x25')][_0x4731('0xe')]=function(){this[_0x4731('0xf')][_0x4731('0x26')](this[_0x4731('0x9')],![],this[_0x4731('0x27')]['bind'](this));};EmailImap[_0x4731('0x25')][_0x4731('0x27')]=function(_0x1d2151,_0xcd7122){if(_0x1d2151){this['handleError'](_0x1d2151,!![]);}else{this[_0x4731('0x28')](_0x4731('0x29'),_0xcd7122);this[_0x4731('0x2a')]();}};EmailImap[_0x4731('0x25')][_0x4731('0x2b')]=function(_0x244884){if(_0x244884){this[_0x4731('0x14')](_0x244884,!![]);}else{this['imap'][_0x4731('0x10')]();}};EmailImap[_0x4731('0x25')][_0x4731('0x2a')]=function(){this[_0x4731('0xf')][_0x4731('0x2c')]([_0x4731('0x2d')],this['handleReadUnseen'][_0x4731('0x12')](this));};EmailImap['prototype']['handleReadUnseen']=function(_0x1cca8b,_0x4e0777){if(_0x1cca8b){this[_0x4731('0x14')](_0x1cca8b,!![]);}else{if(_0x4e0777[_0x4731('0x2e')]){try{var _0x3374f0=this[_0x4731('0xf')][_0x4731('0x2f')](_0x4e0777,{'bodies':'','markSeen':!![]});_0x3374f0['on']('message',this['handleFetchMessage'][_0x4731('0x12')](this));_0x3374f0[_0x4731('0xc')](_0x4731('0x13'),this[_0x4731('0x30')]['bind'](this));_0x3374f0['once'](_0x4731('0x10'),this[_0x4731('0x31')][_0x4731('0x12')](this));}catch(_0x2ff51f){logger['error'](_0x2ff51f);}}else{this[_0x4731('0xf')]['closeBox'](!![],this[_0x4731('0x2b')]['bind'](this));}}};EmailImap[_0x4731('0x25')][_0x4731('0x32')]=function(_0x15ee89){_0x15ee89['on'](_0x4731('0x33'),this[_0x4731('0x34')][_0x4731('0x12')](this));_0x15ee89[_0x4731('0xc')](_0x4731('0x35'),this[_0x4731('0x36')][_0x4731('0x12')](this));_0x15ee89[_0x4731('0xc')]('end',this[_0x4731('0x37')][_0x4731('0x12')](this));};EmailImap[_0x4731('0x25')][_0x4731('0x34')]=function(_0x4636d7){simpleParser(_0x4636d7,{'Iconv':Iconv},this[_0x4731('0x38')]['bind'](this));};EmailImap['prototype'][_0x4731('0x36')]=function(){};EmailImap['prototype'][_0x4731('0x37')]=function(){};EmailImap[_0x4731('0x25')][_0x4731('0x38')]=function(_0x479ba8,_0x2b74f8){if(_0x479ba8){logger[_0x4731('0x13')](_0x479ba8);}else{var _0x3a008a=this;utils[_0x4731('0x39')](this['account'],_0x2b74f8,function(_0x237a7a){_0x3a008a[_0x4731('0x28')](_0x4731('0x8'),_0x237a7a);});}};EmailImap['prototype']['handleFetchEnd']=function(){this[_0x4731('0xf')]['closeBox'](!![],this['handleCloseBox'][_0x4731('0x12')](this));};EmailImap['prototype'][_0x4731('0x30')]=function(_0x5795cb){this[_0x4731('0x14')](_0x5795cb);this[_0x4731('0xf')][_0x4731('0x3a')](!![],this[_0x4731('0x2b')][_0x4731('0x12')](this));};EmailImap['prototype'][_0x4731('0x11')]=function(){this[_0x4731('0x28')](_0x4731('0x10'));};EmailImap['prototype'][_0x4731('0x14')]=function(_0x32c5af,_0xcd3b19){logger[_0x4731('0x13')](_0x4731('0x14'),this['account']['email'],JSON[_0x4731('0x3b')](_0x32c5af));var _0x143356='';if(_0x32c5af){if(_0x32c5af[_0x4731('0x3c')]){_0x143356=_0x32c5af[_0x4731('0x3c')];}else{for(var _0x851f0e in _0x32c5af){if(_0x32c5af[_0x4731('0x3d')](_0x851f0e)){_0x143356+=_[_0x4731('0x3e')](_0x851f0e)+':\x20'+_0x32c5af[_0x851f0e]+'\x0a';}}}}if(_0xcd3b19){this[_0x4731('0xf')][_0x4731('0x10')]();}else{this[_0x4731('0x28')](_0x4731('0x13'),_0x143356);this[_0x4731('0x28')](_0x4731('0x10'));}};module[_0x4731('0x3f')]=EmailImap;
\ No newline at end of file
+var _0xb7fa=['parser','handleCloseBox','handleFetchError','stringify','textCode','hasOwnProperty','upperFirst','util','imap','mailparser','Iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','account','getAccount','ready','bind','once','handleEnd','error','handleError','connect','connTimeout','authTimeout','service','modernAuthentication','xoauth2','user','password','authentication','anonymous@xcally.com','host','port','tls','autotls','required','prototype','handleReady','openBox','handleOpenBox','emit','readUnseen','search','handleReadUnseen','length','fetch','message','handleFetchMessage','end','handleFetchEnd','closeBox','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser'];(function(_0x45bc6a,_0x301e14){var _0x171a81=function(_0x26381f){while(--_0x26381f){_0x45bc6a['push'](_0x45bc6a['shift']());}};_0x171a81(++_0x301e14);}(_0xb7fa,0x7d));var _0xab7f=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xb7fa[_0x2763f2];return _0x3ef471;};'use strict';var _=require('lodash');var util=require(_0xab7f('0x0'));var Imap=require(_0xab7f('0x1'));var simpleParser=require(_0xab7f('0x2'))['simpleParser'];var Iconv=require('iconv')[_0xab7f('0x3')];var EventEmitter=require('events')[_0xab7f('0x4')];var utils=require(_0xab7f('0x5'));var logger=require(_0xab7f('0x6'))(_0xab7f('0x7'));function EmailImap(_0xa97caf,_0x499a0f){this[_0xab7f('0x8')]=_0xa97caf[_0xab7f('0x8')];this[_0xab7f('0x9')]=this[_0xab7f('0xa')](_0xa97caf,_0x499a0f);this[_0xab7f('0x1')]=new Imap(this[_0xab7f('0x9')]);this[_0xab7f('0x1')]['once'](_0xab7f('0xb'),this['handleReady'][_0xab7f('0xc')](this));this[_0xab7f('0x1')][_0xab7f('0xd')]('end',this[_0xab7f('0xe')]['bind'](this));this[_0xab7f('0x1')]['on'](_0xab7f('0xf'),this[_0xab7f('0x10')][_0xab7f('0xc')](this));this[_0xab7f('0x1')][_0xab7f('0x11')]();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype'][_0xab7f('0xa')]=function(_0x43808e,_0x242f9e){var _0x3a6118={'connTimeout':_0x43808e[_0xab7f('0x12')]?_0x43808e[_0xab7f('0x12')]*0x3e8:0x2710,'authTimeout':_0x43808e[_0xab7f('0x13')]?_0x43808e['authTimeout']*0x3e8:0x1388};if(_0x43808e[_0xab7f('0x14')]){_0x3a6118['user']=_0x43808e['user'];if(_0x43808e[_0xab7f('0x15')]){_0x3a6118[_0xab7f('0x16')]=utils['generateXOAuth2Token'](_0x43808e['CloudProvider']['data5'],_0x43808e[_0xab7f('0x17')]);}else{_0x3a6118[_0xab7f('0x18')]=_0x43808e[_0xab7f('0x18')];}}else{if(_0x43808e[_0xab7f('0x19')]){_0x3a6118['user']=_0x43808e['user'];_0x3a6118['password']=_0x43808e[_0xab7f('0x18')];}}_0x3a6118[_0xab7f('0x7')]=_0x242f9e||_0x43808e[_0xab7f('0x17')]||_0xab7f('0x1a');_0x3a6118[_0xab7f('0x1b')]=_0x43808e['host'];_0x3a6118[_0xab7f('0x1c')]=_0x43808e[_0xab7f('0x1c')]||0x3e1;if(_0x43808e['tls']){_0x3a6118['tls']=!![];}else{_0x3a6118[_0xab7f('0x1d')]=![];_0x3a6118[_0xab7f('0x1e')]=_0xab7f('0x1f');}return _0x3a6118;};EmailImap[_0xab7f('0x20')][_0xab7f('0x21')]=function(){this[_0xab7f('0x1')][_0xab7f('0x22')](this[_0xab7f('0x8')],![],this[_0xab7f('0x23')][_0xab7f('0xc')](this));};EmailImap[_0xab7f('0x20')][_0xab7f('0x23')]=function(_0x3820b7,_0x2df05b){if(_0x3820b7){this[_0xab7f('0x10')](_0x3820b7,!![]);}else{this[_0xab7f('0x24')]('box',_0x2df05b);this[_0xab7f('0x25')]();}};EmailImap['prototype']['handleCloseBox']=function(_0x581ab0){if(_0x581ab0){this['handleError'](_0x581ab0,!![]);}else{this[_0xab7f('0x1')]['end']();}};EmailImap[_0xab7f('0x20')]['readUnseen']=function(){this['imap'][_0xab7f('0x26')](['UNSEEN'],this[_0xab7f('0x27')][_0xab7f('0xc')](this));};EmailImap[_0xab7f('0x20')][_0xab7f('0x27')]=function(_0x205f53,_0x1261aa){if(_0x205f53){this[_0xab7f('0x10')](_0x205f53,!![]);}else{if(_0x1261aa[_0xab7f('0x28')]){try{var _0x523be7=this['imap'][_0xab7f('0x29')](_0x1261aa,{'bodies':'','markSeen':!![]});_0x523be7['on'](_0xab7f('0x2a'),this[_0xab7f('0x2b')][_0xab7f('0xc')](this));_0x523be7[_0xab7f('0xd')](_0xab7f('0xf'),this['handleFetchError'][_0xab7f('0xc')](this));_0x523be7[_0xab7f('0xd')](_0xab7f('0x2c'),this[_0xab7f('0x2d')][_0xab7f('0xc')](this));}catch(_0x3e6dcc){logger[_0xab7f('0xf')](_0x3e6dcc);}}else{this[_0xab7f('0x1')][_0xab7f('0x2e')](!![],this['handleCloseBox']['bind'](this));}}};EmailImap[_0xab7f('0x20')][_0xab7f('0x2b')]=function(_0xa50b1d){_0xa50b1d['on'](_0xab7f('0x2f'),this[_0xab7f('0x30')][_0xab7f('0xc')](this));_0xa50b1d[_0xab7f('0xd')]('attributes',this[_0xab7f('0x31')][_0xab7f('0xc')](this));_0xa50b1d[_0xab7f('0xd')](_0xab7f('0x2c'),this[_0xab7f('0x32')][_0xab7f('0xc')](this));};EmailImap[_0xab7f('0x20')][_0xab7f('0x30')]=function(_0x4f6fd2){simpleParser(_0x4f6fd2,{'Iconv':Iconv},this[_0xab7f('0x33')]['bind'](this));};EmailImap[_0xab7f('0x20')][_0xab7f('0x31')]=function(){};EmailImap[_0xab7f('0x20')][_0xab7f('0x32')]=function(){};EmailImap[_0xab7f('0x20')][_0xab7f('0x33')]=function(_0x4a8922,_0x5ad4ad){if(_0x4a8922){logger[_0xab7f('0xf')](_0x4a8922);}else{var _0x25b706=this;utils[_0xab7f('0x34')](this[_0xab7f('0x9')],_0x5ad4ad,function(_0x52935f){_0x25b706[_0xab7f('0x24')]('email',_0x52935f);});}};EmailImap[_0xab7f('0x20')][_0xab7f('0x2d')]=function(){this[_0xab7f('0x1')][_0xab7f('0x2e')](!![],this[_0xab7f('0x35')][_0xab7f('0xc')](this));};EmailImap[_0xab7f('0x20')][_0xab7f('0x36')]=function(_0x4cb2e1){this['handleError'](_0x4cb2e1);this[_0xab7f('0x1')][_0xab7f('0x2e')](!![],this[_0xab7f('0x35')][_0xab7f('0xc')](this));};EmailImap[_0xab7f('0x20')][_0xab7f('0xe')]=function(){this[_0xab7f('0x24')](_0xab7f('0x2c'));};EmailImap[_0xab7f('0x20')]['handleError']=function(_0x4a7b74,_0x2bac1b){logger[_0xab7f('0xf')](_0xab7f('0x10'),this[_0xab7f('0x9')][_0xab7f('0x7')],JSON[_0xab7f('0x37')](_0x4a7b74));var _0x15e479='';if(_0x4a7b74){if(_0x4a7b74[_0xab7f('0x38')]){_0x15e479=_0x4a7b74[_0xab7f('0x38')];}else{for(var _0x3bf92c in _0x4a7b74){if(_0x4a7b74[_0xab7f('0x39')](_0x3bf92c)){_0x15e479+=_[_0xab7f('0x3a')](_0x3bf92c)+':\x20'+_0x4a7b74[_0x3bf92c]+'\x0a';}}}}if(_0x2bac1b){this[_0xab7f('0x1')][_0xab7f('0x2c')]();}else{this[_0xab7f('0x24')](_0xab7f('0xf'),_0x15e479);this[_0xab7f('0x24')](_0xab7f('0x2c'));}};module['exports']=EmailImap;
\ No newline at end of file
index c8e9d38..eafee2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x419a=['send','createTransport','use','compile','toString','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype'];(function(_0x348882,_0x5f5b30){var _0x3c39fd=function(_0x1781d8){while(--_0x1781d8){_0x348882['push'](_0x348882['shift']());}};_0x3c39fd(++_0x5f5b30);}(_0x419a,0x1aa));var _0xa419=function(_0x4c608b,_0x4db3bf){_0x4c608b=_0x4c608b-0x0;var _0x19d501=_0x419a[_0x4c608b];return _0x19d501;};'use strict';var nodemailer=require(_0xa419('0x0'));var inlineBase64=require(_0xa419('0x1'));function EmailSmtp(){}EmailSmtp[_0xa419('0x2')][_0xa419('0x3')]=function(_0x1176ea,_0x2fbf53){return new Promise(function(_0x515def,_0x7601ac){var _0x3e53ea=nodemailer[_0xa419('0x4')](_0x1176ea);_0x3e53ea[_0xa419('0x5')](_0xa419('0x6'),inlineBase64());_0x3e53ea['sendMail'](_0x2fbf53,function(_0x5ef2cd,_0x2dbbf7){if(_0x5ef2cd){_0x7601ac(_0x5ef2cd[_0xa419('0x7')]());}else{_0x515def(_0x2dbbf7);}});});};EmailSmtp['prototype']['verify']=function(_0x51d625){return new Promise(function(_0x290383,_0x27c63a){var _0x36eb8f=nodemailer[_0xa419('0x4')](_0x51d625);_0x36eb8f[_0xa419('0x8')](function(_0x429d17,_0x236be5){if(_0x429d17){_0x27c63a(_0x429d17[_0xa419('0x7')]());}else{if(_0x236be5){_0x290383(_0x236be5);}else{_0x27c63a(_0xa419('0x9'));}}});});};module[_0xa419('0xa')]=EmailSmtp;
\ No newline at end of file
+var _0x0b02=['createTransport','nodemailer','prototype','use','compile','sendMail','toString','verify'];(function(_0x5519a9,_0x1c5147){var _0x32f2cc=function(_0x52ed58){while(--_0x52ed58){_0x5519a9['push'](_0x5519a9['shift']());}};_0x32f2cc(++_0x1c5147);}(_0x0b02,0xa9));var _0x20b0=function(_0x1bebf0,_0x93ec1e){_0x1bebf0=_0x1bebf0-0x0;var _0x1b7830=_0x0b02[_0x1bebf0];return _0x1b7830;};'use strict';var nodemailer=require(_0x20b0('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x20b0('0x1')]['send']=function(_0x39bd54,_0x37e780){return new Promise(function(_0x2a6b8b,_0xbd8757){var _0x544909=nodemailer['createTransport'](_0x39bd54);_0x544909[_0x20b0('0x2')](_0x20b0('0x3'),inlineBase64());_0x544909[_0x20b0('0x4')](_0x37e780,function(_0x3a4a81,_0x4ee67e){if(_0x3a4a81){_0xbd8757(_0x3a4a81[_0x20b0('0x5')]());}else{_0x2a6b8b(_0x4ee67e);}});});};EmailSmtp[_0x20b0('0x1')][_0x20b0('0x6')]=function(_0x4e7955){return new Promise(function(_0x2cb05a,_0xbb146c){var _0x508090=nodemailer[_0x20b0('0x7')](_0x4e7955);_0x508090[_0x20b0('0x6')](function(_0x5948b4,_0xde128b){if(_0x5948b4){_0xbb146c(_0x5948b4[_0x20b0('0x5')]());}else{if(_0xde128b){_0x2cb05a(_0xde128b);}else{_0xbb146c('Not\x20verifired');}}});});};module['exports']=EmailSmtp;
\ No newline at end of file
index a5f7028..d8c9ed1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52e0=['<img','attachments','forEach','filename','replace','_SRC','_IMG','<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','join','root','server/files/attachments/','writeFileSync','push','contentType','headerLines','Precedence:\x20auto_reply','line','parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','<p>Empty\x20message</p>','Attachments','Data','generateXOAuth2Token','user=','toString','lodash','randomstring','util','node-tnef','../../../config/logger','email','value','address','anonymous','generate','@xcally.com','head','name','substring','indexOf','split','slice','Anonymous','length','isEmpty','html','test','includes'];(function(_0x568691,_0x149a6d){var _0x3b5a1f=function(_0x4096d4){while(--_0x4096d4){_0x568691['push'](_0x568691['shift']());}};_0x3b5a1f(++_0x149a6d);}(_0x52e0,0x10d));var _0x052e=function(_0x288371,_0x1958f1){_0x288371=_0x288371-0x0;var _0x70f8f3=_0x52e0[_0x288371];return _0x70f8f3;};'use strict';var _=require(_0x052e('0x0'));var moment=require('moment');var random=require(_0x052e('0x1'));var fs=require('fs');var path=require('path');var util=require(_0x052e('0x2'));var tnef=require(_0x052e('0x3'));var logger=require(_0x052e('0x4'))(_0x052e('0x5'));var config=require('../../../config/environment');function getAddress(_0xd4e00a){var _0x2863c2=_['head'](_0xd4e00a[_0x052e('0x6')]);return _0x2863c2&&_0x2863c2[_0x052e('0x7')]?_0x2863c2['address']:_0x052e('0x8')+random[_0x052e('0x9')](0x6)+_0x052e('0xa');}function getFirstName(_0x4b113c){var _0x3c98fa=_[_0x052e('0xb')](_0x4b113c[_0x052e('0x6')]);if(_0x3c98fa&&_0x3c98fa[_0x052e('0xc')]){if(_0x3c98fa[_0x052e('0xc')]==_0x3c98fa[_0x052e('0x7')]){return _0x3c98fa[_0x052e('0xc')][_0x052e('0xd')](0x0,_0x3c98fa['name'][_0x052e('0xe')]('@'));}var _0x470603=_0x3c98fa[_0x052e('0xc')][_0x052e('0xf')](/\s+/);return _0x470603['length']>0x1?_0x470603[_0x052e('0x10')](0x0,-0x1)['join']('\x20'):_0x3c98fa[_0x052e('0xc')];}return _0x052e('0x11');}function getLastName(_0x84692e){var _0x28a8bf=_[_0x052e('0xb')](_0x84692e['value']);if(_0x28a8bf&&_0x28a8bf[_0x052e('0xc')]){var _0x3d484f=_0x28a8bf[_0x052e('0xc')]['split'](/\s+/);return _0x3d484f['length']>0x1?_0x3d484f['pop']():'';}return'';}function getMails(_0x442a6a,_0x53364b){var _0x17f864='';for(var _0x172f92=0x0;_0x172f92<_0x53364b['value'][_0x052e('0x12')];_0x172f92+=0x1){if(_0x53364b[_0x052e('0x6')][_0x172f92][_0x052e('0x7')]!==_0x442a6a){if(!_[_0x052e('0x13')](_0x17f864)){_0x17f864+=',';}_0x17f864+=_0x53364b[_0x052e('0x6')][_0x172f92][_0x052e('0xc')]||_0x53364b[_0x052e('0x6')][_0x172f92][_0x052e('0x7')]||'';_0x17f864+='\x20<';_0x17f864+=_0x53364b[_0x052e('0x6')][_0x172f92][_0x052e('0x7')]?_0x53364b[_0x052e('0x6')][_0x172f92][_0x052e('0x7')]:_0x052e('0x8')+random['generate'](0x6)+_0x052e('0xa');_0x17f864+='>';}}return _0x17f864;}function parseEmail(_0x1e14c5,_0x54439d,_0x26c05f){if(_0x54439d[_0x052e('0x14')]){var _0x5dfb87=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x5dfb87[_0x052e('0x15')](_0x54439d['html'])){_0x54439d[_0x052e('0x14')]=_0x54439d[_0x052e('0x14')]['replace'](_0x5dfb87,'');}if(_0x54439d[_0x052e('0x14')][_0x052e('0x16')](_0x052e('0x17'))){var _0x9cf881=[];_0x54439d[_0x052e('0x18')][_0x052e('0x19')](_0x552f51=>{_0x9cf881['push'](_0x552f51[_0x052e('0x1a')]);});var _0x19bd07=/<img.*? _SRC(.*?)[^>]+>/g;var _0x93b890=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x1f7adc=_0x54439d[_0x052e('0x14')][_0x052e('0x1b')](_0x93b890,_0x052e('0x1c'));var _0x3ca63e=_0x1f7adc[_0x052e('0x1b')](_0x19bd07,_0x052e('0x1d'));for(let _0x5e2648=0x0;_0x5e2648<_0x9cf881[_0x052e('0x12')];_0x5e2648++){var _0x2ac053=_0x3ca63e[_0x052e('0x1b')](_0x052e('0x1d'),_0x052e('0x1e')+_0x9cf881[_0x5e2648]+_0x052e('0x1f'));_0x3ca63e=_0x2ac053;}_0x54439d[_0x052e('0x14')]=_0x3ca63e;}_0x26c05f[_0x052e('0x20')]=_0x54439d['html'];}else{_0x26c05f[_0x052e('0x20')]=_0x54439d[_0x052e('0x21')];}if(_0x26c05f['body']){_0x26c05f[_0x052e('0x20')]=_0x26c05f[_0x052e('0x20')][_0x052e('0x1b')](/<a\s+/gi,_0x052e('0x22'));}if(_0x54439d['to']){_0x26c05f[_0x052e('0x23')][_0x052e('0x24')]=getMails(null,_0x54439d['to']);var _0x193881=getMails(_0x1e14c5[_0x052e('0x5')],_0x54439d['to']);if(!_[_0x052e('0x13')](_0x193881)){_0x26c05f[_0x052e('0x23')]['cc']+=_0x193881;}}if(_0x54439d['cc']){_0x26c05f[_0x052e('0x23')][_0x052e('0x25')]=getMails(null,_0x54439d['cc']);var _0x37dd6f=getMails(_0x1e14c5['email'],_0x54439d['cc']);if(!_['isEmpty'](_0x37dd6f)){if(!_[_0x052e('0x13')](_0x26c05f[_0x052e('0x23')]['cc'])){_0x26c05f[_0x052e('0x23')]['cc']+=',';}_0x26c05f['message']['cc']+=_0x37dd6f;}}if(!_[_0x052e('0x16')](_0x26c05f[_0x052e('0x23')][_0x052e('0x24')],_0x1e14c5[_0x052e('0x5')])&&!_['includes'](_0x26c05f[_0x052e('0x23')]['originCc'],_0x1e14c5[_0x052e('0x5')])){_0x26c05f['message'][_0x052e('0x26')]=_0x1e14c5[_0x052e('0x5')];}if(_0x54439d['attachments']&&_0x54439d['attachments'][_0x052e('0x12')]){_0x26c05f[_0x052e('0x23')][_0x052e('0x27')]=_0x54439d[_0x052e('0x18')][_0x052e('0x12')];for(var _0x12106f=0x0,_0x143bc8,_0x590ea2,_0x2dbed2;_0x12106f<_0x54439d[_0x052e('0x18')][_0x052e('0x12')];_0x12106f+=0x1){if(_0x54439d[_0x052e('0x18')][_0x12106f][_0x052e('0x28')]===_0x052e('0x29')){_0x2dbed2=_0x54439d[_0x052e('0x18')][_0x12106f][_0x052e('0x1a')]||_0x052e('0x2a')+_0x12106f;_0x143bc8=util[_0x052e('0x2b')](_0x052e('0x2c'),Date['now'](),_0x2dbed2);_0x590ea2=path[_0x052e('0x2d')](config[_0x052e('0x2e')],_0x052e('0x2f'),_0x143bc8);fs[_0x052e('0x30')](_0x590ea2,_0x54439d[_0x052e('0x18')][_0x12106f]['content']);_0x26c05f[_0x052e('0x23')][_0x052e('0x18')][_0x052e('0x31')]({'name':_0x2dbed2,'basename':_0x143bc8,'type':_0x54439d[_0x052e('0x18')][_0x12106f][_0x052e('0x32')],'filepath':_0x590ea2});}}}if(_0x54439d[_0x052e('0x33')]&&_0x54439d[_0x052e('0x33')]['length']>0x0){var _0x5a32c6=['Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All',_0x052e('0x34')];for(var _0x3ab495=0x0;_0x3ab495<_0x54439d[_0x052e('0x33')][_0x052e('0x12')];_0x3ab495++){var _0x57525d=_['indexOf'](_0x5a32c6,_0x54439d[_0x052e('0x33')][_0x3ab495][_0x052e('0x35')]);if(_0x57525d>=0x0){_0x26c05f['isAutoreply']=!![];}}}return _0x26c05f;}exports[_0x052e('0x36')]=function(_0x185e10,_0x4e0780,_0x1585c2){var _0x3f626a={'from':getAddress(_0x4e0780[_0x052e('0x37')]),'firstName':getFirstName(_0x4e0780[_0x052e('0x37')]),'lastName':getLastName(_0x4e0780[_0x052e('0x37')]),'mapKey':_0x052e('0x5'),'message':{'from':getMails(_0x185e10[_0x052e('0x5')],_0x4e0780[_0x052e('0x37')]),'to':_0x185e10[_0x052e('0x5')],'cc':'','subject':_0x4e0780[_0x052e('0x38')]||'','messageId':_0x4e0780[_0x052e('0x39')],'inReplyTo':_0x4e0780[_0x052e('0x3a')],'sentAt':moment(_0x4e0780[_0x052e('0x3b')])[_0x052e('0x2b')](_0x052e('0x3c')),'attach':![],'attachments':[]}};if(!_0x4e0780[_0x052e('0x14')]&&!_0x4e0780[_0x052e('0x21')]){var _0x223254=_[_0x052e('0x3d')](_0x4e0780[_0x052e('0x18')],{'contentType':_0x052e('0x3e')});if(_0x223254['length']){logger['info'](util['format'](_0x052e('0x3f'),_0x4e0780[_0x052e('0x39')]));tnef[_0x052e('0x40')](_[_0x052e('0x41')](_0x223254)['content'],function(_0x39a33a,_0x3eef9b){if(_0x3eef9b){_0x4e0780['html']=_0x3eef9b[_0x052e('0x42')]||_0x052e('0x43');if(_0x3eef9b[_0x052e('0x44')]){for(var _0x5de0c1=0x0;_0x5de0c1<_0x3eef9b['Attachments']['length'];_0x5de0c1++){var _0x2a7cbb=_0x3eef9b[_0x052e('0x44')][_0x5de0c1];_0x3f626a[_0x052e('0x23')][_0x052e('0x18')][_0x052e('0x31')]({'filename':_0x2a7cbb['Title'],'content':Buffer[_0x052e('0x37')](_0x2a7cbb[_0x052e('0x45')])});}}}_0x1585c2(parseEmail(_0x185e10,_0x4e0780,_0x3f626a));});}else{_0x4e0780['html']=_0x052e('0x43');_0x1585c2(parseEmail(_0x185e10,_0x4e0780,_0x3f626a));}}else{_0x1585c2(parseEmail(_0x185e10,_0x4e0780,_0x3f626a));}};exports[_0x052e('0x46')]=function(_0x5c18e4,_0x508c68){var _0x43eb8e=[_0x052e('0x47')+(_0x508c68||''),'auth=Bearer\x20'+_0x5c18e4,'',''];return Buffer[_0x052e('0x37')](_0x43eb8e[_0x052e('0x2d')]('\ 1'),'utf-8')[_0x052e('0x48')]('base64');};
\ No newline at end of file
+var _0xb2d4=['textAsHtml','<a\x20target=\x22_blank\x22\x20','originTo','email','isEmpty','message','originCc','bcc','attachments','attach','type','attachment','attachment-','format','%s-%s','root','server/files/attachments/','writeFileSync','push','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','isAutoreply','from','date','YYYY-MM-DD\x20HH:mm:ss','filter','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','first','content','BodyHTML','<p>Empty\x20message</p>','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','moment','randomstring','path','util','node-tnef','../../../config/logger','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','split','slice','join','Anonymous','length','test','html','includes','forEach','filename','replace','_SRC','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','body'];(function(_0x531448,_0x17c32d){var _0x17dcc7=function(_0x2daacf){while(--_0x2daacf){_0x531448['push'](_0x531448['shift']());}};_0x17dcc7(++_0x17c32d);}(_0xb2d4,0xbd));var _0x4b2d=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xb2d4[_0x491a7f];return _0x3d8f44;};'use strict';var _=require('lodash');var moment=require(_0x4b2d('0x0'));var random=require(_0x4b2d('0x1'));var fs=require('fs');var path=require(_0x4b2d('0x2'));var util=require(_0x4b2d('0x3'));var tnef=require(_0x4b2d('0x4'));var logger=require(_0x4b2d('0x5'))('email');var config=require(_0x4b2d('0x6'));function getAddress(_0x1f39c9){var _0xdaf2a1=_[_0x4b2d('0x7')](_0x1f39c9[_0x4b2d('0x8')]);return _0xdaf2a1&&_0xdaf2a1[_0x4b2d('0x9')]?_0xdaf2a1[_0x4b2d('0x9')]:_0x4b2d('0xa')+random[_0x4b2d('0xb')](0x6)+_0x4b2d('0xc');}function getFirstName(_0x345273){var _0x2ee48f=_['head'](_0x345273[_0x4b2d('0x8')]);if(_0x2ee48f&&_0x2ee48f[_0x4b2d('0xd')]){if(_0x2ee48f[_0x4b2d('0xd')]==_0x2ee48f[_0x4b2d('0x9')]){return _0x2ee48f['name'][_0x4b2d('0xe')](0x0,_0x2ee48f[_0x4b2d('0xd')]['indexOf']('@'));}var _0x419a9f=_0x2ee48f[_0x4b2d('0xd')][_0x4b2d('0xf')](/\s+/);return _0x419a9f['length']>0x1?_0x419a9f[_0x4b2d('0x10')](0x0,-0x1)[_0x4b2d('0x11')]('\x20'):_0x2ee48f[_0x4b2d('0xd')];}return _0x4b2d('0x12');}function getLastName(_0x4081fc){var _0xfa0731=_[_0x4b2d('0x7')](_0x4081fc['value']);if(_0xfa0731&&_0xfa0731['name']){var _0x2d29c0=_0xfa0731[_0x4b2d('0xd')][_0x4b2d('0xf')](/\s+/);return _0x2d29c0['length']>0x1?_0x2d29c0['pop']():'';}return'';}function getMails(_0x24ef2f,_0x10c430){var _0x29585c='';for(var _0x25cc8c=0x0;_0x25cc8c<_0x10c430[_0x4b2d('0x8')][_0x4b2d('0x13')];_0x25cc8c+=0x1){if(_0x10c430[_0x4b2d('0x8')][_0x25cc8c][_0x4b2d('0x9')]!==_0x24ef2f){if(!_['isEmpty'](_0x29585c)){_0x29585c+=',';}_0x29585c+=_0x10c430[_0x4b2d('0x8')][_0x25cc8c][_0x4b2d('0xd')]||_0x10c430['value'][_0x25cc8c][_0x4b2d('0x9')]||'';_0x29585c+='\x20<';_0x29585c+=_0x10c430['value'][_0x25cc8c][_0x4b2d('0x9')]?_0x10c430['value'][_0x25cc8c][_0x4b2d('0x9')]:_0x4b2d('0xa')+random[_0x4b2d('0xb')](0x6)+_0x4b2d('0xc');_0x29585c+='>';}}return _0x29585c;}function parseEmail(_0x9a5405,_0xa458a3,_0x3e5260){if(_0xa458a3['html']){var _0x41061f=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x41061f[_0x4b2d('0x14')](_0xa458a3[_0x4b2d('0x15')])){_0xa458a3[_0x4b2d('0x15')]=_0xa458a3[_0x4b2d('0x15')]['replace'](_0x41061f,'');}if(_0xa458a3[_0x4b2d('0x15')][_0x4b2d('0x16')]('<img')){var _0x953c9c=[];_0xa458a3['attachments'][_0x4b2d('0x17')](_0x2e3a26=>{_0x953c9c['push'](_0x2e3a26[_0x4b2d('0x18')]);});var _0x34b6d5=/<img.*? _SRC(.*?)[^>]+>/g;var _0x5603b8=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x9184dd=_0xa458a3[_0x4b2d('0x15')][_0x4b2d('0x19')](_0x5603b8,_0x4b2d('0x1a'));var _0x552a52=_0x9184dd[_0x4b2d('0x19')](_0x34b6d5,_0x4b2d('0x1b'));for(let _0x3cfebe=0x0;_0x3cfebe<_0x953c9c['length'];_0x3cfebe++){var _0x361265=_0x552a52[_0x4b2d('0x19')]('_IMG',_0x4b2d('0x1c')+_0x953c9c[_0x3cfebe]+'\x20]</span>');_0x552a52=_0x361265;}_0xa458a3[_0x4b2d('0x15')]=_0x552a52;}_0x3e5260[_0x4b2d('0x1d')]=_0xa458a3[_0x4b2d('0x15')];}else{_0x3e5260[_0x4b2d('0x1d')]=_0xa458a3[_0x4b2d('0x1e')];}if(_0x3e5260['body']){_0x3e5260['body']=_0x3e5260[_0x4b2d('0x1d')]['replace'](/<a\s+/gi,_0x4b2d('0x1f'));}if(_0xa458a3['to']){_0x3e5260['message'][_0x4b2d('0x20')]=getMails(null,_0xa458a3['to']);var _0x2b46a3=getMails(_0x9a5405[_0x4b2d('0x21')],_0xa458a3['to']);if(!_[_0x4b2d('0x22')](_0x2b46a3)){_0x3e5260[_0x4b2d('0x23')]['cc']+=_0x2b46a3;}}if(_0xa458a3['cc']){_0x3e5260[_0x4b2d('0x23')]['originCc']=getMails(null,_0xa458a3['cc']);var _0x2ecc51=getMails(_0x9a5405[_0x4b2d('0x21')],_0xa458a3['cc']);if(!_[_0x4b2d('0x22')](_0x2ecc51)){if(!_[_0x4b2d('0x22')](_0x3e5260[_0x4b2d('0x23')]['cc'])){_0x3e5260[_0x4b2d('0x23')]['cc']+=',';}_0x3e5260['message']['cc']+=_0x2ecc51;}}if(!_[_0x4b2d('0x16')](_0x3e5260[_0x4b2d('0x23')]['originTo'],_0x9a5405[_0x4b2d('0x21')])&&!_['includes'](_0x3e5260['message'][_0x4b2d('0x24')],_0x9a5405[_0x4b2d('0x21')])){_0x3e5260[_0x4b2d('0x23')][_0x4b2d('0x25')]=_0x9a5405[_0x4b2d('0x21')];}if(_0xa458a3['attachments']&&_0xa458a3[_0x4b2d('0x26')][_0x4b2d('0x13')]){_0x3e5260[_0x4b2d('0x23')][_0x4b2d('0x27')]=_0xa458a3['attachments'][_0x4b2d('0x13')];for(var _0x2117ca=0x0,_0x5c566c,_0x5d7b0a,_0x463972;_0x2117ca<_0xa458a3[_0x4b2d('0x26')][_0x4b2d('0x13')];_0x2117ca+=0x1){if(_0xa458a3[_0x4b2d('0x26')][_0x2117ca][_0x4b2d('0x28')]===_0x4b2d('0x29')){_0x463972=_0xa458a3['attachments'][_0x2117ca]['filename']||_0x4b2d('0x2a')+_0x2117ca;_0x5c566c=util[_0x4b2d('0x2b')](_0x4b2d('0x2c'),Date['now'](),_0x463972);_0x5d7b0a=path[_0x4b2d('0x11')](config[_0x4b2d('0x2d')],_0x4b2d('0x2e'),_0x5c566c);fs[_0x4b2d('0x2f')](_0x5d7b0a,_0xa458a3[_0x4b2d('0x26')][_0x2117ca]['content']);_0x3e5260['message'][_0x4b2d('0x26')][_0x4b2d('0x30')]({'name':_0x463972,'basename':_0x5c566c,'type':_0xa458a3[_0x4b2d('0x26')][_0x2117ca][_0x4b2d('0x31')],'filepath':_0x5d7b0a});}}}if(_0xa458a3['headerLines']&&_0xa458a3[_0x4b2d('0x32')][_0x4b2d('0x13')]>0x0){var _0x485c21=[_0x4b2d('0x33'),_0x4b2d('0x34'),'Precedence:\x20auto_reply'];for(var _0x48dbe1=0x0;_0x48dbe1<_0xa458a3[_0x4b2d('0x32')][_0x4b2d('0x13')];_0x48dbe1++){var _0x369c91=_['indexOf'](_0x485c21,_0xa458a3[_0x4b2d('0x32')][_0x48dbe1]['line']);if(_0x369c91>=0x0){_0x3e5260[_0x4b2d('0x35')]=!![];}}}return _0x3e5260;}exports['parser']=function(_0x4f5374,_0x190cd4,_0x566f50){var _0xcede70={'from':getAddress(_0x190cd4['from']),'firstName':getFirstName(_0x190cd4[_0x4b2d('0x36')]),'lastName':getLastName(_0x190cd4['from']),'mapKey':_0x4b2d('0x21'),'message':{'from':getMails(_0x4f5374[_0x4b2d('0x21')],_0x190cd4[_0x4b2d('0x36')]),'to':_0x4f5374['email'],'cc':'','subject':_0x190cd4['subject']||'','messageId':_0x190cd4['messageId'],'inReplyTo':_0x190cd4['inReplyTo'],'sentAt':moment(_0x190cd4[_0x4b2d('0x37')])['format'](_0x4b2d('0x38')),'attach':![],'attachments':[]}};if(!_0x190cd4['html']&&!_0x190cd4[_0x4b2d('0x1e')]){var _0x407161=_[_0x4b2d('0x39')](_0x190cd4[_0x4b2d('0x26')],{'contentType':'application/ms-tnef'});if(_0x407161[_0x4b2d('0x13')]){logger[_0x4b2d('0x3a')](util['format'](_0x4b2d('0x3b'),_0x190cd4['messageId']));tnef['parseBuffer'](_[_0x4b2d('0x3c')](_0x407161)[_0x4b2d('0x3d')],function(_0x18f25b,_0x3dea88){if(_0x3dea88){_0x190cd4[_0x4b2d('0x15')]=_0x3dea88[_0x4b2d('0x3e')]||_0x4b2d('0x3f');if(_0x3dea88[_0x4b2d('0x40')]){for(var _0x1c524c=0x0;_0x1c524c<_0x3dea88[_0x4b2d('0x40')][_0x4b2d('0x13')];_0x1c524c++){var _0x36567f=_0x3dea88['Attachments'][_0x1c524c];_0xcede70['message']['attachments'][_0x4b2d('0x30')]({'filename':_0x36567f[_0x4b2d('0x41')],'content':Buffer['from'](_0x36567f[_0x4b2d('0x42')])});}}}_0x566f50(parseEmail(_0x4f5374,_0x190cd4,_0xcede70));});}else{_0x190cd4[_0x4b2d('0x15')]=_0x4b2d('0x3f');_0x566f50(parseEmail(_0x4f5374,_0x190cd4,_0xcede70));}}else{_0x566f50(parseEmail(_0x4f5374,_0x190cd4,_0xcede70));}};exports[_0x4b2d('0x43')]=function(_0x56c412,_0x22ba22){var _0x4ff02f=[_0x4b2d('0x44')+(_0x22ba22||''),_0x4b2d('0x45')+_0x56c412,'',''];return Buffer[_0x4b2d('0x36')](_0x4ff02f[_0x4b2d('0x11')]('\ 1'),_0x4b2d('0x46'))[_0x4b2d('0x47')](_0x4b2d('0x48'));};
\ No newline at end of file
index 82489ba..b48a0a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c90=['Smtp','exports','lodash','name','Service','key','SERV','active','Imap'];(function(_0x191237,_0x1476ab){var _0x22ac6c=function(_0x3b6ff9){while(--_0x3b6ff9){_0x191237['push'](_0x191237['shift']());}};_0x22ac6c(++_0x1476ab);}(_0x9c90,0x80));var _0x09c9=function(_0x46f3f8,_0x12c74b){_0x46f3f8=_0x46f3f8-0x0;var _0xbc57cd=_0x9c90[_0x46f3f8];return _0xbc57cd;};'use strict';var _=require(_0x09c9('0x0'));function MailAccount(_0x4611f3){this['id']=_0x4611f3['id']||0x0;this[_0x09c9('0x1')]=_0x4611f3[_0x09c9('0x1')]||_0x09c9('0x2');this[_0x09c9('0x3')]=_0x4611f3['key']||_0x09c9('0x4');this['active']=_0x4611f3[_0x09c9('0x5')]||![];this[_0x09c9('0x6')]=_0x4611f3[_0x09c9('0x6')]||[];this[_0x09c9('0x7')]=_0x4611f3[_0x09c9('0x7')]||[];}module[_0x09c9('0x8')]=MailAccount;
\ No newline at end of file
+var _0x83ee=['name','Service','key','SERV','active','Imap','Smtp','exports','lodash'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x83ee,0x104));var _0xe83e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x83ee[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0xe83e('0x0'));function MailAccount(_0x1d4c11){this['id']=_0x1d4c11['id']||0x0;this['name']=_0x1d4c11[_0xe83e('0x1')]||_0xe83e('0x2');this[_0xe83e('0x3')]=_0x1d4c11[_0xe83e('0x3')]||_0xe83e('0x4');this['active']=_0x1d4c11[_0xe83e('0x5')]||![];this[_0xe83e('0x6')]=_0x1d4c11[_0xe83e('0x6')]||[];this['Smtp']=_0x1d4c11[_0xe83e('0x7')]||[];}module[_0xe83e('0x8')]=MailAccount;
\ No newline at end of file
index 219cc59..c31fca4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9b2=['../model/mailAccount','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','mailAccounts','merge','exports','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc9b2,0xdb));var _0x2c9b=function(_0x498c82,_0x13e187){_0x498c82=_0x498c82-0x0;var _0x4110b2=_0xc9b2[_0x498c82];return _0x4110b2;};'use strict';var _=require(_0x2c9b('0x0'));var MailAccount=require(_0x2c9b('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x5d1596,_0x2ecea6,_0x387507){var _0x2c3699=_[_0x2c9b('0x2')](_0x5d1596,function(_0xc12664,_0x59a065){return _0xc12664[_0x387507];});for(var _0xd737b5 in _0x2ecea6){if(_0x2ecea6[_0x2c9b('0x3')](_0xd737b5)){if(!_0x2c3699[_0xd737b5]){delete _0x2ecea6[_0xd737b5];}}}}Realtime[_0x2c9b('0x4')][_0x2c9b('0x5')]=function(_0x4d9766,_0x25cefb){for(var _0x39ce02 in _0x25cefb){if(_0x4d9766[_0x2c9b('0x3')](_0x39ce02)){_0x4d9766[_0x39ce02]=_0x25cefb[_0x39ce02];}}};Realtime[_0x2c9b('0x4')][_0x2c9b('0x6')]=function(){var _0x398747=this;return function(_0x3acbb6){if(_0x3acbb6){freeIsNotKey(_0x3acbb6,_0x398747['mailAccounts'],'id');for(var _0x5a2a10=0x0,_0x36041b={},_0x38b186={};_0x5a2a10<_0x3acbb6['length'];_0x5a2a10+=0x1){_0x36041b=_0x3acbb6[_0x5a2a10];if(_['isUndefined'](_0x398747[_0x2c9b('0x7')][_0x36041b['id']])){_0x398747[_0x2c9b('0x7')][_0x36041b['id']]=new MailAccount(_0x36041b);}else{_[_0x2c9b('0x8')](_0x398747[_0x2c9b('0x7')][_0x36041b['id']],_0x36041b);}}}return _0x398747[_0x2c9b('0x7')];};};module[_0x2c9b('0x9')]=Realtime;
\ No newline at end of file
+var _0x97c0=['../model/mailAccount','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','mailAccounts','merge','exports','lodash'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x97c0,0x95));var _0x097c=function(_0x25bad2,_0x1f1b54){_0x25bad2=_0x25bad2-0x0;var _0x5d8fc3=_0x97c0[_0x25bad2];return _0x5d8fc3;};'use strict';var _=require(_0x097c('0x0'));var MailAccount=require(_0x097c('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x2275d9,_0xb40d67,_0x34d113){var _0xb1e99d=_[_0x097c('0x2')](_0x2275d9,function(_0x33b1ae,_0x1af383){return _0x33b1ae[_0x34d113];});for(var _0x128ad4 in _0xb40d67){if(_0xb40d67[_0x097c('0x3')](_0x128ad4)){if(!_0xb1e99d[_0x128ad4]){delete _0xb40d67[_0x128ad4];}}}}Realtime[_0x097c('0x4')][_0x097c('0x5')]=function(_0x1f4388,_0x1e6695){for(var _0x26bb89 in _0x1e6695){if(_0x1f4388['hasOwnProperty'](_0x26bb89)){_0x1f4388[_0x26bb89]=_0x1e6695[_0x26bb89];}}};Realtime['prototype'][_0x097c('0x6')]=function(){var _0x2dd2ae=this;return function(_0x4a2338){if(_0x4a2338){freeIsNotKey(_0x4a2338,_0x2dd2ae['mailAccounts'],'id');for(var _0x306d0e=0x0,_0x220117={},_0x3a43c7={};_0x306d0e<_0x4a2338['length'];_0x306d0e+=0x1){_0x220117=_0x4a2338[_0x306d0e];if(_['isUndefined'](_0x2dd2ae[_0x097c('0x7')][_0x220117['id']])){_0x2dd2ae[_0x097c('0x7')][_0x220117['id']]=new MailAccount(_0x220117);}else{_[_0x097c('0x8')](_0x2dd2ae[_0x097c('0x7')][_0x220117['id']],_0x220117);}}}return _0x2dd2ae['mailAccounts'];};};module[_0x097c('0x9')]=Realtime;
\ No newline at end of file
index 0cbe62e..9022cfa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e50=['../client','getMailAccounts','Request','GetMailAccount','provider','service','key','CloudProvider','type','MailServerOut','Smtp','name','data5','notify','NotifyMailAccount'];(function(_0x264f48,_0x2c82d8){var _0xb99167=function(_0x4a6be7){while(--_0x4a6be7){_0x264f48['push'](_0x264f48['shift']());}};_0xb99167(++_0x2c82d8);}(_0x1e50,0x11d));var _0x01e5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1e50[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x01e5('0x0'));exports[_0x01e5('0x1')]=function(){return function(){return client[_0x01e5('0x2')](_0x01e5('0x3'),{'options':{'attributes':['id','name',_0x01e5('0x4'),_0x01e5('0x5'),'email','active',_0x01e5('0x6'),'ListId','TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':'Imap','include':[{'model':_0x01e5('0x7'),'attributes':['id','name','service',_0x01e5('0x8'),'data5'],'as':_0x01e5('0x7')}]},{'model':_0x01e5('0x9'),'as':_0x01e5('0xa'),'include':[{'model':_0x01e5('0x7'),'attributes':['id',_0x01e5('0xb'),'service',_0x01e5('0x8'),_0x01e5('0xc')],'as':_0x01e5('0x7')}]}]},'log':'getMailAccount'});};};exports[_0x01e5('0xd')]=function(_0x26d988,_0x5a0425){return client['Request'](_0x01e5('0xe'),{'account':{'id':_0x26d988},'body':_0x5a0425,'log':'NotifyMailAccount'});};
\ No newline at end of file
+var _0x6299=['CloudProvider','data5','notify','NotifyMailAccount','Request','GetMailAccount','name','provider','service','email','key','ListId','TemplateId','MailServerIn','Imap','type','Smtp'];(function(_0x967148,_0x2a8497){var _0x14e78d=function(_0x57f2fb){while(--_0x57f2fb){_0x967148['push'](_0x967148['shift']());}};_0x14e78d(++_0x2a8497);}(_0x6299,0x169));var _0x9629=function(_0x3f8f78,_0x3571fd){_0x3f8f78=_0x3f8f78-0x0;var _0x4f0860=_0x6299[_0x3f8f78];return _0x4f0860;};'use strict';var client=require('../client');exports['getMailAccounts']=function(){return function(){return client[_0x9629('0x0')](_0x9629('0x1'),{'options':{'attributes':['id',_0x9629('0x2'),_0x9629('0x3'),_0x9629('0x4'),_0x9629('0x5'),'active',_0x9629('0x6'),_0x9629('0x7'),_0x9629('0x8')],'raw':![],'include':[{'model':_0x9629('0x9'),'as':_0x9629('0xa'),'include':[{'model':'CloudProvider','attributes':['id','name',_0x9629('0x4'),_0x9629('0xb'),'data5'],'as':'CloudProvider'}]},{'model':'MailServerOut','as':_0x9629('0xc'),'include':[{'model':_0x9629('0xd'),'attributes':['id',_0x9629('0x2'),'service',_0x9629('0xb'),_0x9629('0xe')],'as':_0x9629('0xd')}]}]},'log':'getMailAccount'});};};exports[_0x9629('0xf')]=function(_0x2ef67f,_0xd4ddd9){return client[_0x9629('0x0')](_0x9629('0x10'),{'account':{'id':_0x2ef67f},'body':_0xd4ddd9,'log':'NotifyMailAccount'});};
\ No newline at end of file
index f3d94e9..40c7ad8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb14=['Request','GetSettings','../client','getSettings'];(function(_0x207301,_0x235203){var _0x10be14=function(_0x203ac4){while(--_0x203ac4){_0x207301['push'](_0x207301['shift']());}};_0x10be14(++_0x235203);}(_0xcb14,0x1ae));var _0x4cb1=function(_0x1b8b81,_0xb30fc5){_0x1b8b81=_0x1b8b81-0x0;var _0x4a84ca=_0xcb14[_0x1b8b81];return _0x4a84ca;};'use strict';var client=require(_0x4cb1('0x0'));exports[_0x4cb1('0x1')]=function(){return client[_0x4cb1('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x4cb1('0x3')});};
\ No newline at end of file
+var _0xb26b=['GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x20714a,_0x7de591){var _0x15e877=function(_0x3f9f8d){while(--_0x3f9f8d){_0x20714a['push'](_0x20714a['shift']());}};_0x15e877(++_0x7de591);}(_0xb26b,0x15a));var _0xbb26=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb26b[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0xbb26('0x0'));exports[_0xbb26('0x1')]=function(){return client[_0xbb26('0x2')](_0xbb26('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xbb26('0x4')});};
\ No newline at end of file
index 1ffbaad..d632968 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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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 0780fef..0dcb319 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x648e=['timeout','port','websocket','polling','redis','adapter','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','express','sticky-session','ioredis','../../config/environment','createServer'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x648e,0x19e));var _0xe648=function(_0x172d20,_0x2a7467){_0x172d20=_0x172d20-0x0;var _0x147e46=_0x648e[_0x172d20];return _0x147e46;};'use strict';var _=require(_0xe648('0x0'));var http=require('http');var express=require(_0xe648('0x1'));var sticky=require(_0xe648('0x2'));var Redis=require(_0xe648('0x3'));var config=require(_0xe648('0x4'));var app=express();var server=http[_0xe648('0x5')](app);server[_0xe648('0x6')]=0xdbba0;if(sticky['listen'](server,config[_0xe648('0x7')])){var socketio=require('socket.io')(server,{'transports':[_0xe648('0x8'),_0xe648('0x9')]});config[_0xe648('0xa')]=_['defaults'](config[_0xe648('0xa')],{'host':'localhost','port':0x18eb});socketio[_0xe648('0xb')](require('socket.io-redis')({'pubClient':new Redis(config[_0xe648('0xa')]),'subClient':new Redis(config['redis'])}));require(_0xe648('0xc'))[_0xe648('0xd')]();require(_0xe648('0xe'))[_0xe648('0xd')](socketio);require(_0xe648('0xf'))['default'](app);require(_0xe648('0x10'))[_0xe648('0xd')](app);}else{server[_0xe648('0x11')](_0xe648('0x12'),function(){console[_0xe648('0x13')](_0xe648('0x14'),config[_0xe648('0x7')]);});}exports=module['exports']=app;
\ No newline at end of file
+var _0xeb32=['polling','defaults','localhost','socket.io-redis','redis','../../config/triggers','default','../../config/socketio','../../config/express','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','websocket'];(function(_0xbdfe5e,_0x3621c6){var _0x4ecadf=function(_0x499b7f){while(--_0x499b7f){_0xbdfe5e['push'](_0xbdfe5e['shift']());}};_0x4ecadf(++_0x3621c6);}(_0xeb32,0x145));var _0x2eb3=function(_0x26ec70,_0x359d35){_0x26ec70=_0x26ec70-0x0;var _0x43dcba=_0xeb32[_0x26ec70];return _0x43dcba;};'use strict';var _=require(_0x2eb3('0x0'));var http=require(_0x2eb3('0x1'));var express=require(_0x2eb3('0x2'));var sticky=require(_0x2eb3('0x3'));var Redis=require(_0x2eb3('0x4'));var config=require(_0x2eb3('0x5'));var app=express();var server=http[_0x2eb3('0x6')](app);server[_0x2eb3('0x7')]=0xdbba0;if(sticky[_0x2eb3('0x8')](server,config[_0x2eb3('0x9')])){var socketio=require('socket.io')(server,{'transports':[_0x2eb3('0xa'),_0x2eb3('0xb')]});config['redis']=_[_0x2eb3('0xc')](config['redis'],{'host':_0x2eb3('0xd'),'port':0x18eb});socketio['adapter'](require(_0x2eb3('0xe'))({'pubClient':new Redis(config[_0x2eb3('0xf')]),'subClient':new Redis(config['redis'])}));require(_0x2eb3('0x10'))[_0x2eb3('0x11')]();require(_0x2eb3('0x12'))[_0x2eb3('0x11')](socketio);require(_0x2eb3('0x13'))[_0x2eb3('0x11')](app);require('../../routes')['default'](app);}else{server['once'](_0x2eb3('0x14'),function(){console[_0x2eb3('0x15')](_0x2eb3('0x16'),config[_0x2eb3('0x9')]);});}exports=module[_0x2eb3('0x17')]=app;
\ No newline at end of file
index 95dd940..0b72f8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44c7=['result','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','debug','rpc','error','message'];(function(_0x5849cb,_0x453ded){var _0x26dc9e=function(_0x4522bf){while(--_0x4522bf){_0x5849cb['push'](_0x5849cb['shift']());}};_0x26dc9e(++_0x453ded);}(_0x44c7,0xa7));var _0x744c=function(_0x20ce52,_0x6a2987){_0x20ce52=_0x20ce52-0x0;var _0x18f890=_0x44c7[_0x20ce52];return _0x18f890;};'use strict';var jayson=require(_0x744c('0x0'));var BPromise=require(_0x744c('0x1'));var logger=require(_0x744c('0x2'))(_0x744c('0x3'));var client=jayson[_0x744c('0x4')][_0x744c('0x5')]({'port':0x2329});client[_0x744c('0x6')]=function(_0x5bab33,_0x3f9621){return new BPromise(function(_0x17c9e5,_0x54b793){return client[_0x744c('0x7')](_0x5bab33,_0x3f9621)[_0x744c('0x8')](function(_0x3b8927){logger[_0x744c('0x9')](_0x744c('0xa'),_0x744c('0x3'),_0x5bab33,_0x3f9621,_0x3b8927);if(_0x3b8927[_0x744c('0xb')]){logger[_0x744c('0xb')](_0x744c('0xa'),_0x744c('0x3'),_0x5bab33,_0x3b8927[_0x744c('0xb')][_0x744c('0xc')],_0x3f9621);return _0x54b793(_0x3b8927[_0x744c('0xb')][_0x744c('0xc')]);}else{return _0x17c9e5(_0x3b8927[_0x744c('0xd')]);}})['catch'](function(_0x162e26){logger[_0x744c('0xb')](_0x744c('0xa'),_0x744c('0x3'),_0x5bab33,_0x162e26,_0x3f9621);return _0x54b793(_0x162e26);});});};module[_0x744c('0xe')]=client;
\ No newline at end of file
+var _0x549d=['jayson/promise','bluebird','../../config/logger','routing','client','request','then','rpc','error','message','result','catch','exports'];(function(_0x2ef8f1,_0x1280a3){var _0x17498d=function(_0xd20876){while(--_0xd20876){_0x2ef8f1['push'](_0x2ef8f1['shift']());}};_0x17498d(++_0x1280a3);}(_0x549d,0x104));var _0xd549=function(_0x58c371,_0x2c2c9f){_0x58c371=_0x58c371-0x0;var _0x1d5062=_0x549d[_0x58c371];return _0x1d5062;};'use strict';var jayson=require(_0xd549('0x0'));var BPromise=require(_0xd549('0x1'));var logger=require(_0xd549('0x2'))(_0xd549('0x3'));var client=jayson[_0xd549('0x4')]['http']({'port':0x2329});client['Request']=function(_0x9e137b,_0x594935){return new BPromise(function(_0x5a33cd,_0x37e5ee){return client[_0xd549('0x5')](_0x9e137b,_0x594935)[_0xd549('0x6')](function(_0xd6fdc2){logger['debug'](_0xd549('0x7'),_0xd549('0x3'),_0x9e137b,_0x594935,_0xd6fdc2);if(_0xd6fdc2['error']){logger[_0xd549('0x8')](_0xd549('0x7'),_0xd549('0x3'),_0x9e137b,_0xd6fdc2['error'][_0xd549('0x9')],_0x594935);return _0x37e5ee(_0xd6fdc2[_0xd549('0x8')]['message']);}else{return _0x5a33cd(_0xd6fdc2[_0xd549('0xa')]);}})[_0xd549('0xb')](function(_0x5c2f20){logger['error'](_0xd549('0x7'),_0xd549('0x3'),_0x9e137b,_0x5c2f20,_0x594935);return _0x37e5ee(_0x5c2f20);});});};module[_0xd549('0xc')]=client;
\ No newline at end of file
index 4c15d63..5aefc30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb781=['./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','getOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initMailQueues','getFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','log','bluebird','./server','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue'];(function(_0x3e2e61,_0x5be105){var _0xf5d02=function(_0x2854a9){while(--_0x2854a9){_0x3e2e61['push'](_0x3e2e61['shift']());}};_0xf5d02(++_0x5be105);}(_0xb781,0x119));var _0x1b78=function(_0x3590f8,_0x4627d8){_0x3590f8=_0x3590f8-0x0;var _0x57e39f=_0xb781[_0x3590f8];return _0x57e39f;};'use strict';var BPromise=require(_0x1b78('0x0'));var server=require(_0x1b78('0x1'));var Realtime=require('./realtime');var user=require(_0x1b78('0x2'));var interval=require('./rpc/interval');var openchannelQueue=require(_0x1b78('0x3'));var chatQueue=require(_0x1b78('0x4'));var smsQueue=require(_0x1b78('0x5'));var mailQueue=require(_0x1b78('0x6'));var faxQueue=require(_0x1b78('0x7'));var whatsappQueue=require(_0x1b78('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x1b78('0x9')]()[_0x1b78('0xa')](user[_0x1b78('0xb')]())[_0x1b78('0xa')](realtime['initAgents']())[_0x1b78('0xa')](interval['getIntervals']())[_0x1b78('0xa')](realtime['initIntervals']())[_0x1b78('0xa')](openchannelQueue[_0x1b78('0xc')]())[_0x1b78('0xa')](realtime['initOpenchannelQueues']())[_0x1b78('0xa')](chatQueue[_0x1b78('0xd')]())[_0x1b78('0xa')](realtime[_0x1b78('0xe')]())[_0x1b78('0xa')](smsQueue[_0x1b78('0xf')]())['then'](realtime['initSmsQueues']())[_0x1b78('0xa')](mailQueue['getMailQueues']())[_0x1b78('0xa')](realtime[_0x1b78('0x10')]())[_0x1b78('0xa')](faxQueue[_0x1b78('0x11')]())[_0x1b78('0xa')](realtime['initFaxQueues']())[_0x1b78('0xa')](whatsappQueue[_0x1b78('0x12')]())['then'](realtime[_0x1b78('0x13')]())[_0x1b78('0xa')](function(){return realtime;});}function main(){return server[_0x1b78('0x14')](realtime)['then'](function(_0x414662){return initRealtime();})[_0x1b78('0xa')](function(_0x39d34f){return setInterval(initRealtime,0x1388);})['catch'](function(_0x2bef7c){console[_0x1b78('0x15')](_0x2bef7c);});}main();
\ No newline at end of file
+var _0xe236=['./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','getMailQueues','initMailQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue'];(function(_0x250767,_0x170663){var _0x33e3f5=function(_0x3cfa38){while(--_0x3cfa38){_0x250767['push'](_0x250767['shift']());}};_0x33e3f5(++_0x170663);}(_0xe236,0x17b));var _0x6e23=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe236[_0x40a045];return _0x1a687c;};'use strict';var BPromise=require(_0x6e23('0x0'));var server=require('./server');var Realtime=require(_0x6e23('0x1'));var user=require(_0x6e23('0x2'));var interval=require(_0x6e23('0x3'));var openchannelQueue=require(_0x6e23('0x4'));var chatQueue=require(_0x6e23('0x5'));var smsQueue=require(_0x6e23('0x6'));var mailQueue=require(_0x6e23('0x7'));var faxQueue=require(_0x6e23('0x8'));var whatsappQueue=require(_0x6e23('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x6e23('0xa')](user[_0x6e23('0xb')]())[_0x6e23('0xa')](realtime[_0x6e23('0xc')]())['then'](interval[_0x6e23('0xd')]())[_0x6e23('0xa')](realtime[_0x6e23('0xe')]())['then'](openchannelQueue[_0x6e23('0xf')]())[_0x6e23('0xa')](realtime['initOpenchannelQueues']())['then'](chatQueue['getChatQueues']())[_0x6e23('0xa')](realtime['initChatQueues']())[_0x6e23('0xa')](smsQueue['getSmsQueues']())[_0x6e23('0xa')](realtime['initSmsQueues']())[_0x6e23('0xa')](mailQueue[_0x6e23('0x10')]())[_0x6e23('0xa')](realtime[_0x6e23('0x11')]())['then'](faxQueue['getFaxQueues']())[_0x6e23('0xa')](realtime[_0x6e23('0x12')]())['then'](whatsappQueue[_0x6e23('0x13')]())[_0x6e23('0xa')](realtime[_0x6e23('0x14')]())[_0x6e23('0xa')](function(){return realtime;});}function main(){return server[_0x6e23('0x15')](realtime)['then'](function(_0x36b729){return initRealtime();})[_0x6e23('0xa')](function(_0x121576){return setInterval(initRealtime,0x1388);})[_0x6e23('0x16')](function(_0x6da69c){console[_0x6e23('0x17')](_0x6da69c);});}main();
\ No newline at end of file
index 7929706..2cfb8c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['next','isEqual','restart','condition','matches','filter','turn','prioritize','findRules','length','priority','toJSON','map','toString','fromJSON','parse','object','exports','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','rules','activeRules','prototype','isArray','concat','push','sync','orderBy','result','clone','consequence','name','index_','nextTick','ruleRef','call'];(function(_0x4b2950,_0x2bad8c){var _0x7d9509=function(_0x4e07f1){while(--_0x4e07f1){_0x4b2950['push'](_0x4b2950['shift']());}};_0x7d9509(++_0x2bad8c);}(_0x2ef3,0xba));var _0x32ef=function(_0x3d69b7,_0x194161){_0x3d69b7=_0x3d69b7-0x0;var _0x4b170e=_0x2ef3[_0x3d69b7];return _0x4b170e;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var EventEmitter=require(_0x32ef('0x2'))[_0x32ef('0x3')];function RuleEngine(_0x3944df,_0x38047b){this['init']();if(!_[_0x32ef('0x4')](_0x3944df)){this[_0x32ef('0x5')](_0x3944df);}if(_0x38047b){this['ignoreFactChanges']=_0x38047b[_0x32ef('0x6')];}return this;}util[_0x32ef('0x7')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x2c0089){this[_0x32ef('0x8')]=[];this[_0x32ef('0x9')]=[];};RuleEngine[_0x32ef('0xa')][_0x32ef('0x5')]=function(_0x298066){if(Array[_0x32ef('0xb')](_0x298066)){this[_0x32ef('0x8')]=this[_0x32ef('0x8')][_0x32ef('0xc')](_0x298066);}else if(_0x298066!==null&&_['isObject'](_0x298066)){this['rules'][_0x32ef('0xd')](_0x298066);}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0xe')]=function(){this['activeRules']=this[_0x32ef('0x8')]['filter'](function(_0x1a5106){if(_['isNil'](_0x1a5106['on'])){_0x1a5106['on']=!![];}if(_0x1a5106['on']===!![]){return _0x1a5106;}});this[_0x32ef('0x9')]=_[_0x32ef('0xf')](this['activeRules'],['p'],['asc']);};RuleEngine[_0x32ef('0xa')]['execute']=function(_0x326fce,_0x40a6e6){var _0x93d492=![];_0x326fce[_0x32ef('0x10')]=!![];var _0x57aff1=_['clone'](_0x326fce);var _0x531e30=_[_0x32ef('0x11')](_0x326fce);var _0x3950e6=this[_0x32ef('0x9')];var _0x53a5ca=[];var _0x5d559b=this[_0x32ef('0x6')];(function FnRuleLoop(_0x1a9476){var _0x286bfb={'rules':function(){return _0x3950e6;},'rule':function(){return _0x3950e6[_0x1a9476];},'when':function(_0x57863c){if(_0x57863c){var _0xbe37f6=_0x3950e6[_0x1a9476][_0x32ef('0x12')];_0xbe37f6['ruleRef']=_0x3950e6[_0x1a9476]['id']||_0x3950e6[_0x1a9476][_0x32ef('0x13')]||_0x32ef('0x14')+_0x1a9476;process[_0x32ef('0x15')](function(){_0x53a5ca[_0x32ef('0xd')](_0xbe37f6[_0x32ef('0x16')]);_0xbe37f6[_0x32ef('0x17')](_0x57aff1,_0x286bfb);});}else{process['nextTick'](function(){_0x286bfb[_0x32ef('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x93d492=!![];return FnRuleLoop(0x0);},'next':function(_0x5cc3ef){if(!_0x5d559b&&!_[_0x32ef('0x19')](_0x531e30,_0x57aff1)){_0x531e30=_[_0x32ef('0x11')](_0x57aff1);process['nextTick'](function(){_0x286bfb[_0x32ef('0x1a')]();});}else{process[_0x32ef('0x15')](function(){if(_[_0x32ef('0x4')](_0x5cc3ef)){return FnRuleLoop(_0x1a9476+0x1);}else{return FnRuleLoop(_0x5cc3ef);}});}}};if(_0x1a9476<_0x3950e6['length']&&_0x93d492===![]){var _0x57f5e5=_0x3950e6[_0x1a9476][_0x32ef('0x1b')];_0x57f5e5[_0x32ef('0x17')](_0x57aff1,_0x286bfb);}else{process[_0x32ef('0x15')](function(){_0x57aff1['matchPath']=_0x53a5ca;return _0x40a6e6?_0x40a6e6(_0x57aff1):_['noop']();});}}(0x0));};RuleEngine[_0x32ef('0xa')]['findRules']=function(_0x51a412){if(_[_0x32ef('0x4')](_0x51a412)){return this[_0x32ef('0x8')];}else{var _0x371540=_[_0x32ef('0x1c')](_0x51a412);return _[_0x32ef('0x1d')](this[_0x32ef('0x8')],_0x371540);}};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1e')]=function(_0x338f19,_0x2f52d7){var _0x1335e2=_0x338f19==='on'||_0x338f19==='ON'?!![]:![];var _0xba4b3f=this['findRules'](_0x2f52d7);for(var _0xd65fde=0x0,_0x2f5d06=_0xba4b3f['length'];_0xd65fde<_0x2f5d06;_0xd65fde+=0x1){_0xba4b3f[_0xd65fde]['on']=_0x1335e2;}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1f')]=function(_0x26e207,_0x50a95b){_0x26e207=parseInt(_0x26e207,0xa);var _0x10e38c=this[_0x32ef('0x20')](_0x50a95b);for(var _0x31dbc3=0x0,_0x2ac686=_0x10e38c[_0x32ef('0x21')];_0x31dbc3<_0x2ac686;_0x31dbc3+=0x1){_0x10e38c[_0x31dbc3][_0x32ef('0x22')]=_0x26e207;}this[_0x32ef('0xe')]();};RuleEngine['prototype'][_0x32ef('0x23')]=function(){var _0x537214=this[_0x32ef('0x8')];if(_0x537214 instanceof Array){_0x537214=_0x537214[_0x32ef('0x24')](function(_0x5a9565){_0x5a9565[_0x32ef('0x1b')]=_0x5a9565[_0x32ef('0x1b')][_0x32ef('0x25')]();_0x5a9565[_0x32ef('0x12')]=_0x5a9565[_0x32ef('0x12')]['toString']();return _0x5a9565;});}else if(!_['isNil'](_0x537214)){_0x537214[_0x32ef('0x1b')]=_0x537214['condition'][_0x32ef('0x25')]();_0x537214[_0x32ef('0x12')]=_0x537214[_0x32ef('0x12')][_0x32ef('0x25')]();}return _0x537214;};RuleEngine[_0x32ef('0xa')][_0x32ef('0x26')]=function(_0x566b56){this['init']();if(_['isString'](_0x566b56)){_0x566b56=JSON[_0x32ef('0x27')](_0x566b56);}if(_0x566b56 instanceof Array){_0x566b56=_0x566b56[_0x32ef('0x24')](function(_0x136b02){_0x136b02['condition']=eval('('+_0x136b02['condition']+')');_0x136b02[_0x32ef('0x12')]=eval('('+_0x136b02[_0x32ef('0x12')]+')');return _0x136b02;});}else if(_0x566b56!==null&&typeof _0x566b56==_0x32ef('0x28')){_0x566b56['condition']=eval('('+_0x566b56['condition']+')');_0x566b56[_0x32ef('0x12')]=eval('('+_0x566b56[_0x32ef('0x12')]+')');}this[_0x32ef('0x5')](_0x566b56);};module[_0x32ef('0x29')]=RuleEngine;
\ No newline at end of file
+var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0xe616b6,_0x1bf3de){var _0x1e4ec1=function(_0x43d940){while(--_0x43d940){_0xe616b6['push'](_0xe616b6['shift']());}};_0x1e4ec1(++_0x1bf3de);}(_0x326f,0xd1));var _0xf326=function(_0x4259b1,_0x228c0e){_0x4259b1=_0x4259b1-0x0;var _0x3b12c0=_0x326f[_0x4259b1];return _0x3b12c0;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine;
\ No newline at end of file
index 4be49d0..3b73876 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b9a=['result','catch','sendMailMessage','SendMail','bluebird','client','http','request','then','error','message'];(function(_0x510837,_0x41ebd0){var _0x378b28=function(_0x5e8b74){while(--_0x5e8b74){_0x510837['push'](_0x510837['shift']());}};_0x378b28(++_0x41ebd0);}(_0x6b9a,0x122));var _0xa6b9=function(_0x4e471b,_0x257481){_0x4e471b=_0x4e471b-0x0;var _0x32aedd=_0x6b9a[_0x4e471b];return _0x32aedd;};'use strict';var BPromise=require(_0xa6b9('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xa6b9('0x1')][_0xa6b9('0x2')]({'port':0x232b});function request(_0x33a9e7,_0x3c71db){return new BPromise(function(_0x14fb0e,_0x2af4e9){return client[_0xa6b9('0x3')](_0x33a9e7,_0x3c71db)[_0xa6b9('0x4')](function(_0x2e200b){if(_0x2e200b[_0xa6b9('0x5')]){return _0x2af4e9(_0x2e200b[_0xa6b9('0x5')][_0xa6b9('0x6')]);}else{return _0x14fb0e(_0x2e200b[_0xa6b9('0x7')]);}})[_0xa6b9('0x8')](function(_0xfc1e1c){return _0x2af4e9(_0xfc1e1c);});});}exports[_0xa6b9('0x9')]=function(_0x16c500,_0x41d13e){return request(_0xa6b9('0xa'),{'account':_0x16c500,'message':_0x41d13e});};
\ No newline at end of file
+var _0x94a1=['request','then','error','catch','SendMail','bluebird','jayson/promise','client','http'];(function(_0xd158dc,_0x128608){var _0x12d25f=function(_0x2e9d2b){while(--_0x2e9d2b){_0xd158dc['push'](_0xd158dc['shift']());}};_0x12d25f(++_0x128608);}(_0x94a1,0x188));var _0x194a=function(_0x57f30f,_0x1ed226){_0x57f30f=_0x57f30f-0x0;var _0x530df1=_0x94a1[_0x57f30f];return _0x530df1;};'use strict';var BPromise=require(_0x194a('0x0'));var jayson=require(_0x194a('0x1'));var client=jayson[_0x194a('0x2')][_0x194a('0x3')]({'port':0x232b});function request(_0x199894,_0x3ef1a8){return new BPromise(function(_0x4a695e,_0x1e4e59){return client[_0x194a('0x4')](_0x199894,_0x3ef1a8)[_0x194a('0x5')](function(_0x5009a1){if(_0x5009a1[_0x194a('0x6')]){return _0x1e4e59(_0x5009a1['error']['message']);}else{return _0x4a695e(_0x5009a1['result']);}})[_0x194a('0x7')](function(_0xe06dc2){return _0x1e4e59(_0xe06dc2);});});}exports['sendMailMessage']=function(_0x298172,_0xc769cd){return request(_0x194a('0x8'),{'account':_0x298172,'message':_0xc769cd});};
\ No newline at end of file
index 080e252..8700bd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7885=['stringify','lodash','md5','../../../config/environment','redis','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','unknown','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','prototype','mail','chat','fax','sms','whatsapp','length','Status','StatusTime','format','openchannelStatusTime','openchannelCurrentCapacity'];(function(_0x39d18b,_0x497c48){var _0x3dbf1e=function(_0x2b7da1){while(--_0x2b7da1){_0x39d18b['push'](_0x39d18b['shift']());}};_0x3dbf1e(++_0x497c48);}(_0x7885,0xf9));var _0x5788=function(_0x3f8219,_0x26c51e){_0x3f8219=_0x3f8219-0x0;var _0x2f1a1f=_0x7885[_0x3f8219];return _0x2f1a1f;};'use strict';var _=require(_0x5788('0x0'));var moment=require('moment');var md5=require(_0x5788('0x1'));var Redis=require('ioredis');var config=require(_0x5788('0x2'));config['redis']=_['defaults'](config[_0x5788('0x3')],{'host':_0x5788('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5788('0x3')]));function Agent(_0x1f5df8){this['id']=_0x1f5df8['id']||0x0;this[_0x5788('0x5')]=_0x1f5df8[_0x5788('0x5')]||'';this[_0x5788('0x6')]=_0x1f5df8[_0x5788('0x6')]||!![];this[_0x5788('0x7')]=_0x1f5df8[_0x5788('0x7')]||![];this['chatPause']=_0x1f5df8[_0x5788('0x8')]||![];this[_0x5788('0x9')]=_0x1f5df8[_0x5788('0x9')]||![];this[_0x5788('0xa')]=_0x1f5df8[_0x5788('0xa')]||![];this[_0x5788('0xb')]=_0x1f5df8[_0x5788('0xb')]||![];this[_0x5788('0xc')]=_0x1f5df8[_0x5788('0xc')]||![];this[_0x5788('0xd')]='unknown';this[_0x5788('0xe')]=0x0;this[_0x5788('0xf')]=_0x1f5df8['chatCapacity']||0x0;this[_0x5788('0x10')]=0x0;this[_0x5788('0x11')]='unknown';this[_0x5788('0x12')]=0x0;this['mailCapacity']=_0x1f5df8[_0x5788('0x13')]||0x0;this[_0x5788('0x14')]=0x0;this['faxStatus']=_0x5788('0x15');this[_0x5788('0x16')]=0x0;this[_0x5788('0x17')]=_0x1f5df8[_0x5788('0x17')]||0x0;this[_0x5788('0x18')]=0x0;this[_0x5788('0x19')]=_0x5788('0x15');this[_0x5788('0x1a')]=0x0;this['smsCapacity']=_0x1f5df8[_0x5788('0x1b')]||0x0;this[_0x5788('0x1c')]=0x0;this['whatsappStatus']=_0x5788('0x15');this[_0x5788('0x1d')]=0x0;this['whatsappCapacity']=_0x1f5df8[_0x5788('0x1e')]||0x0;this[_0x5788('0x1f')]=0x0;this[_0x5788('0x20')]=_0x5788('0x15');this['openchannelStatusTime']=0x0;this[_0x5788('0x21')]=_0x1f5df8[_0x5788('0x21')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x5788('0x22')]=![];this[_0x5788('0x23')]=undefined;this[_0x5788('0x1')]='';this[_0x5788('0x24')]={};this[_0x5788('0x25')]={};this[_0x5788('0x26')]={};this[_0x5788('0x27')]={};this[_0x5788('0x28')]={};this[_0x5788('0x29')]={};this[_0x5788('0x2a')]();}Agent['prototype'][_0x5788('0x2b')]=function(_0x8ac279){if(this[_0x8ac279+_0x5788('0x2c')]>0x0){if(this[_0x8ac279+_0x5788('0x2d')]>0x0&&this[_0x8ac279+_0x5788('0x2c')]>=this[_0x8ac279+'Capacity']){return _0x5788('0x2e');}else{return _0x5788('0x2f');}}else{return _0x5788('0x30');}};Agent[_0x5788('0x31')][_0x5788('0x2a')]=function(){var _0x12ff69=[_0x5788('0x32'),_0x5788('0x33'),'openchannel',_0x5788('0x34'),_0x5788('0x35'),_0x5788('0x36')];for(var _0x55559b=0x0;_0x55559b<_0x12ff69[_0x5788('0x37')];_0x55559b+=0x1){var _0x2ddf2b=this[_0x5788('0x2b')](_0x12ff69[_0x55559b]);if(this[_0x12ff69[_0x55559b]+_0x5788('0x38')]!==_0x2ddf2b){this[_0x12ff69[_0x55559b]+_0x5788('0x39')]=_['toNumber'](moment()[_0x5788('0x3a')]('x'));}this[_0x12ff69[_0x55559b]+_0x5788('0x38')]=_0x2ddf2b;}var _0x38f72b={'id':this['id'],'name':this['name'],'online':this[_0x5788('0x6')],'voicePause':this[_0x5788('0x7')],'chatPause':this['chatPause'],'mailPause':this[_0x5788('0x9')],'smsPause':this[_0x5788('0xb')],'faxPause':this[_0x5788('0xa')],'openchannelPause':this[_0x5788('0xc')],'chatStatus':this[_0x5788('0xd')],'chatStatusTime':this[_0x5788('0xe')],'chatCapacity':this[_0x5788('0xf')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x5788('0x11')],'mailStatusTime':this[_0x5788('0x12')],'mailCapacity':this[_0x5788('0x13')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x5788('0x17')],'faxCurrentCapacity':this[_0x5788('0x18')],'smsStatus':this[_0x5788('0x19')],'smsStatusTime':this[_0x5788('0x1a')],'smsCapacity':this[_0x5788('0x1b')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x5788('0x1e')],'whatsappCurrentCapacity':this[_0x5788('0x1f')],'openchannelStatus':this[_0x5788('0x20')],'openchannelStatusTime':this[_0x5788('0x3b')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x5788('0x3c')],'busy':this[_0x5788('0x22')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0x5788('0x24')],'faxWaitingInteractions':this[_0x5788('0x25')],'mailWaitingInteractions':this[_0x5788('0x26')],'openchannelWaitingInteractions':this[_0x5788('0x27')],'smsWaitingInteractions':this[_0x5788('0x28')],'whatsappWaitingInteractions':this[_0x5788('0x29')]};var _0x4eeb7d=md5(JSON[_0x5788('0x3d')](_0x38f72b));if(this[_0x5788('0x1')]!==_0x4eeb7d){this[_0x5788('0x1')]=_0x4eeb7d;io['emit']('user:save',_0x38f72b);}};module['exports']=Agent;
\ No newline at end of file
+var _0x420b=['getChannelStatus','CurrentCapacity','Capacity','maxcapacity','idle','mail','chat','openchannel','fax','sms','whatsapp','length','StatusTime','toNumber','format','Status','online','mailPause','chatStatus','chatCurrentCapacity','faxStatus','whatsappStatus','whatsappStatusTime','busyQueue','openchannelWaitingInteractions','stringify','emit','user:save','exports','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','voicePause','chatPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','prototype'];(function(_0x1af47f,_0x3673a8){var _0x82ad77=function(_0xa48c2b){while(--_0xa48c2b){_0x1af47f['push'](_0x1af47f['shift']());}};_0x82ad77(++_0x3673a8);}(_0x420b,0x1a9));var _0xb420=function(_0x1336cd,_0x3406fc){_0x1336cd=_0x1336cd-0x0;var _0x3d17aa=_0x420b[_0x1336cd];return _0x3d17aa;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require(_0xb420('0x0'));var Redis=require(_0xb420('0x1'));var config=require(_0xb420('0x2'));config[_0xb420('0x3')]=_[_0xb420('0x4')](config[_0xb420('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xb420('0x5'))(new Redis(config[_0xb420('0x3')]));function Agent(_0x5e5782){this['id']=_0x5e5782['id']||0x0;this[_0xb420('0x6')]=_0x5e5782['name']||'';this['online']=_0x5e5782['online']||!![];this[_0xb420('0x7')]=_0x5e5782[_0xb420('0x7')]||![];this[_0xb420('0x8')]=_0x5e5782['chatPause']||![];this['mailPause']=_0x5e5782['mailPause']||![];this[_0xb420('0x9')]=_0x5e5782[_0xb420('0x9')]||![];this['smsPause']=_0x5e5782[_0xb420('0xa')]||![];this['openchannelPause']=_0x5e5782[_0xb420('0xb')]||![];this['chatStatus']=_0xb420('0xc');this[_0xb420('0xd')]=0x0;this[_0xb420('0xe')]=_0x5e5782[_0xb420('0xe')]||0x0;this['chatCurrentCapacity']=0x0;this[_0xb420('0xf')]=_0xb420('0xc');this[_0xb420('0x10')]=0x0;this[_0xb420('0x11')]=_0x5e5782[_0xb420('0x11')]||0x0;this[_0xb420('0x12')]=0x0;this['faxStatus']=_0xb420('0xc');this[_0xb420('0x13')]=0x0;this[_0xb420('0x14')]=_0x5e5782['faxCapacity']||0x0;this[_0xb420('0x15')]=0x0;this['smsStatus']=_0xb420('0xc');this[_0xb420('0x16')]=0x0;this[_0xb420('0x17')]=_0x5e5782['smsCapacity']||0x0;this[_0xb420('0x18')]=0x0;this['whatsappStatus']=_0xb420('0xc');this['whatsappStatusTime']=0x0;this[_0xb420('0x19')]=_0x5e5782[_0xb420('0x19')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0xb420('0x1a')]=_0xb420('0xc');this[_0xb420('0x1b')]=0x0;this[_0xb420('0x1c')]=_0x5e5782['openchannelCapacity']||0x0;this[_0xb420('0x1d')]=0x0;this[_0xb420('0x1e')]=![];this['busyQueue']=undefined;this[_0xb420('0x0')]='';this[_0xb420('0x1f')]={};this[_0xb420('0x20')]={};this[_0xb420('0x21')]={};this['openchannelWaitingInteractions']={};this[_0xb420('0x22')]={};this[_0xb420('0x23')]={};this['updateRealtime']();}Agent[_0xb420('0x24')][_0xb420('0x25')]=function(_0x17f238){if(this[_0x17f238+_0xb420('0x26')]>0x0){if(this[_0x17f238+_0xb420('0x27')]>0x0&&this[_0x17f238+_0xb420('0x26')]>=this[_0x17f238+_0xb420('0x27')]){return _0xb420('0x28');}else{return'working';}}else{return _0xb420('0x29');}};Agent[_0xb420('0x24')]['updateRealtime']=function(){var _0x1ac21b=[_0xb420('0x2a'),_0xb420('0x2b'),_0xb420('0x2c'),_0xb420('0x2d'),_0xb420('0x2e'),_0xb420('0x2f')];for(var _0x13b96b=0x0;_0x13b96b<_0x1ac21b[_0xb420('0x30')];_0x13b96b+=0x1){var _0x50bb4a=this[_0xb420('0x25')](_0x1ac21b[_0x13b96b]);if(this[_0x1ac21b[_0x13b96b]+'Status']!==_0x50bb4a){this[_0x1ac21b[_0x13b96b]+_0xb420('0x31')]=_[_0xb420('0x32')](moment()[_0xb420('0x33')]('x'));}this[_0x1ac21b[_0x13b96b]+_0xb420('0x34')]=_0x50bb4a;}var _0x504cc3={'id':this['id'],'name':this[_0xb420('0x6')],'online':this[_0xb420('0x35')],'voicePause':this[_0xb420('0x7')],'chatPause':this[_0xb420('0x8')],'mailPause':this[_0xb420('0x36')],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this[_0xb420('0xb')],'chatStatus':this[_0xb420('0x37')],'chatStatusTime':this[_0xb420('0xd')],'chatCapacity':this[_0xb420('0xe')],'chatCurrentCapacity':this[_0xb420('0x38')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xb420('0x10')],'mailCapacity':this[_0xb420('0x11')],'mailCurrentCapacity':this[_0xb420('0x12')],'faxStatus':this[_0xb420('0x39')],'faxStatusTime':this[_0xb420('0x13')],'faxCapacity':this[_0xb420('0x14')],'faxCurrentCapacity':this[_0xb420('0x15')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0xb420('0x16')],'smsCapacity':this[_0xb420('0x17')],'smsCurrentCapacity':this[_0xb420('0x18')],'whatsappStatus':this[_0xb420('0x3a')],'whatsappStatusTime':this[_0xb420('0x3b')],'whatsappCapacity':this[_0xb420('0x19')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xb420('0x1b')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xb420('0x1d')],'busy':this[_0xb420('0x1e')],'busyQueue':this[_0xb420('0x3c')],'chatWaitingInteractions':this[_0xb420('0x1f')],'faxWaitingInteractions':this[_0xb420('0x20')],'mailWaitingInteractions':this[_0xb420('0x21')],'openchannelWaitingInteractions':this[_0xb420('0x3d')],'smsWaitingInteractions':this['smsWaitingInteractions'],'whatsappWaitingInteractions':this[_0xb420('0x23')]};var _0x628fb2=md5(JSON[_0xb420('0x3e')](_0x504cc3));if(this[_0xb420('0x0')]!==_0x628fb2){this['md5']=_0x628fb2;io[_0xb420('0x3f')](_0xb420('0x40'),_0x504cc3);}};module[_0xb420('0x41')]=Agent;
\ No newline at end of file
index 416eef8..49eaedf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fd8=['online','chatPause','available','stringify','chat:queue:%s','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','_rr','map','mapAgentsId','prototype','loggedIn','paused','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0fd8,0x9d));var _0x80fd=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0fd8[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x80fd('0x0'));var md5=require(_0x80fd('0x1'));var util=require(_0x80fd('0x2'));var Redis=require(_0x80fd('0x3'));var config=require(_0x80fd('0x4'));config['redis']=_[_0x80fd('0x5')](config[_0x80fd('0x6')],{'host':_0x80fd('0x7'),'port':0x18eb});var io=require(_0x80fd('0x8'))(new Redis(config['redis']));function ChatQueue(_0x4cb76f){this['id']=_0x4cb76f['id']||0x0;this[_0x80fd('0x9')]=_0x4cb76f[_0x80fd('0x9')]||'';this[_0x80fd('0xa')]=_0x4cb76f[_0x80fd('0xa')]||0xa;this[_0x80fd('0xb')]=_0x4cb76f[_0x80fd('0xb')]||_0x80fd('0xc');this[_0x80fd('0xd')]=_0x4cb76f[_0x80fd('0xd')];this['mapAgentsId']={};this['waiting']=0x0;this['md5']='';this[_0x80fd('0xe')]();this[_0x80fd('0xf')]();}ChatQueue['prototype'][_0x80fd('0xe')]=function(){var _0x42e78e=this['mapAgentsId'][_0x80fd('0x10')];this['mapAgentsId']=_[_0x80fd('0x11')](this[_0x80fd('0xd')],'id');this[_0x80fd('0x12')][_0x80fd('0x10')]=_0x42e78e;};ChatQueue[_0x80fd('0x13')]['updateRealtime']=function(){this[_0x80fd('0x14')]=0x0;this[_0x80fd('0x15')]=0x0;for(var _0x1568ce=0x0;_0x1568ce<this[_0x80fd('0xd')][_0x80fd('0x16')];_0x1568ce+=0x1){if(this[_0x80fd('0xd')][_0x1568ce][_0x80fd('0x17')]){this[_0x80fd('0x14')]+=0x1;}if(this[_0x80fd('0xd')][_0x1568ce][_0x80fd('0x18')]){this[_0x80fd('0x15')]+=0x1;}}this[_0x80fd('0x19')]=this[_0x80fd('0x14')]-this[_0x80fd('0x15')];this['available']=this[_0x80fd('0x19')]>=0x0?this[_0x80fd('0x19')]:0x0;var _0x3cdd28={'id':this['id'],'available':this[_0x80fd('0x19')],'loggedIn':this[_0x80fd('0x14')],'name':this[_0x80fd('0x9')],'paused':this[_0x80fd('0x15')],'waiting':this['waiting']};var _0x4ab68a=md5(JSON[_0x80fd('0x1a')](_0x3cdd28));if(this['md5']!==_0x4ab68a){this['md5']=_0x4ab68a;io['to'](util['format'](_0x80fd('0x1b'),_0x3cdd28[_0x80fd('0x9')]))['emit'](_0x80fd('0x1c'),_0x3cdd28);}};module[_0x80fd('0x1d')]=ChatQueue;
\ No newline at end of file
+var _0x0034=['waiting','updateRouting','updateRealtime','prototype','_rr','map','paused','length','online','loggedIn','chatPause','available','name','stringify','format','chat_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','timeout','strategy','Agents','mapAgentsId'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x0034,0x1c4));var _0x4003=function(_0x21001b,_0x3ff1a8){_0x21001b=_0x21001b-0x0;var _0x665a00=_0x0034[_0x21001b];return _0x665a00;};'use strict';var _=require(_0x4003('0x0'));var md5=require(_0x4003('0x1'));var util=require(_0x4003('0x2'));var Redis=require('ioredis');var config=require(_0x4003('0x3'));config[_0x4003('0x4')]=_[_0x4003('0x5')](config[_0x4003('0x4')],{'host':_0x4003('0x6'),'port':0x18eb});var io=require(_0x4003('0x7'))(new Redis(config['redis']));function ChatQueue(_0x3843a1){this['id']=_0x3843a1['id']||0x0;this['name']=_0x3843a1['name']||'';this[_0x4003('0x8')]=_0x3843a1[_0x4003('0x8')]||0xa;this['strategy']=_0x3843a1[_0x4003('0x9')]||'beepall';this[_0x4003('0xa')]=_0x3843a1[_0x4003('0xa')];this[_0x4003('0xb')]={};this[_0x4003('0xc')]=0x0;this[_0x4003('0x1')]='';this[_0x4003('0xd')]();this[_0x4003('0xe')]();}ChatQueue[_0x4003('0xf')][_0x4003('0xd')]=function(){var _0x4d2db9=this['mapAgentsId'][_0x4003('0x10')];this[_0x4003('0xb')]=_[_0x4003('0x11')](this[_0x4003('0xa')],'id');this[_0x4003('0xb')][_0x4003('0x10')]=_0x4d2db9;};ChatQueue['prototype'][_0x4003('0xe')]=function(){this['loggedIn']=0x0;this[_0x4003('0x12')]=0x0;for(var _0x137fd6=0x0;_0x137fd6<this['Agents'][_0x4003('0x13')];_0x137fd6+=0x1){if(this['Agents'][_0x137fd6][_0x4003('0x14')]){this[_0x4003('0x15')]+=0x1;}if(this[_0x4003('0xa')][_0x137fd6][_0x4003('0x16')]){this['paused']+=0x1;}}this[_0x4003('0x17')]=this[_0x4003('0x15')]-this[_0x4003('0x12')];this[_0x4003('0x17')]=this[_0x4003('0x17')]>=0x0?this[_0x4003('0x17')]:0x0;var _0x4b96a5={'id':this['id'],'available':this[_0x4003('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x4003('0x18')],'paused':this['paused'],'waiting':this[_0x4003('0xc')]};var _0x231f1c=md5(JSON[_0x4003('0x19')](_0x4b96a5));if(this[_0x4003('0x1')]!==_0x231f1c){this[_0x4003('0x1')]=_0x231f1c;io['to'](util[_0x4003('0x1a')]('chat:queue:%s',_0x4b96a5[_0x4003('0x18')]))['emit'](_0x4003('0x1b'),_0x4b96a5);}};module[_0x4003('0x1c')]=ChatQueue;
\ No newline at end of file
index 8763f01..91a467c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09e5=['format','fax:queue:%s','emit','exports','lodash','md5','ioredis','../../../config/environment','localhost','socket.io-emitter','redis','name','strategy','beepall','mapAgentsId','updateRealtime','prototype','updateRouting','_rr','loggedIn','paused','online','available','waiting'];(function(_0x5e6bec,_0x1eb54d){var _0x5dc5cf=function(_0x59429a){while(--_0x59429a){_0x5e6bec['push'](_0x5e6bec['shift']());}};_0x5dc5cf(++_0x1eb54d);}(_0x09e5,0xc4));var _0x509e=function(_0x438427,_0x2d8232){_0x438427=_0x438427-0x0;var _0xed8aa1=_0x09e5[_0x438427];return _0xed8aa1;};'use strict';var _=require(_0x509e('0x0'));var md5=require(_0x509e('0x1'));var util=require('util');var Redis=require(_0x509e('0x2'));var config=require(_0x509e('0x3'));config['redis']=_['defaults'](config['redis'],{'host':_0x509e('0x4'),'port':0x18eb});var io=require(_0x509e('0x5'))(new Redis(config[_0x509e('0x6')]));function FaxQueue(_0x359441){this['id']=_0x359441['id']||0x0;this[_0x509e('0x7')]=_0x359441[_0x509e('0x7')]||'';this['timeout']=_0x359441['timeout']||0xa;this[_0x509e('0x8')]=_0x359441[_0x509e('0x8')]||_0x509e('0x9');this['Agents']=_0x359441['Agents'];this[_0x509e('0xa')]={};this['waiting']=0x0;this['md5']='';this['updateRouting']();this[_0x509e('0xb')]();}FaxQueue[_0x509e('0xc')][_0x509e('0xd')]=function(){var _0x24fcc1=this['mapAgentsId'][_0x509e('0xe')];this[_0x509e('0xa')]=_['map'](this['Agents'],'id');this[_0x509e('0xa')][_0x509e('0xe')]=_0x24fcc1;};FaxQueue[_0x509e('0xc')][_0x509e('0xb')]=function(){this[_0x509e('0xf')]=0x0;this[_0x509e('0x10')]=0x0;for(var _0x377459=0x0;_0x377459<this['Agents']['length'];_0x377459+=0x1){if(this['Agents'][_0x377459][_0x509e('0x11')]){this[_0x509e('0xf')]+=0x1;}if(this['Agents'][_0x377459]['faxPause']){this[_0x509e('0x10')]+=0x1;}}this[_0x509e('0x12')]=this['loggedIn']-this[_0x509e('0x10')];this[_0x509e('0x12')]=this[_0x509e('0x12')]>=0x0?this[_0x509e('0x12')]:0x0;var _0x4bb8a8={'id':this['id'],'available':this[_0x509e('0x12')],'loggedIn':this[_0x509e('0xf')],'name':this['name'],'paused':this[_0x509e('0x10')],'waiting':this[_0x509e('0x13')]};var _0x35bd57=md5(JSON['stringify'](_0x4bb8a8));if(this[_0x509e('0x1')]!==_0x35bd57){this[_0x509e('0x1')]=_0x35bd57;io['to'](util[_0x509e('0x14')](_0x509e('0x15'),_0x4bb8a8['name']))[_0x509e('0x16')]('fax_queue:save',_0x4bb8a8);}};module[_0x509e('0x17')]=FaxQueue;
\ No newline at end of file
+var _0x675d=['waiting','updateRouting','updateRealtime','_rr','map','Agents','prototype','loggedIn','paused','length','online','available','stringify','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','mapAgentsId'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x675d,0x1a4));var _0xd675=function(_0x39991f,_0x2f295b){_0x39991f=_0x39991f-0x0;var _0xc84479=_0x675d[_0x39991f];return _0xc84479;};'use strict';var _=require(_0xd675('0x0'));var md5=require(_0xd675('0x1'));var util=require(_0xd675('0x2'));var Redis=require(_0xd675('0x3'));var config=require(_0xd675('0x4'));config['redis']=_[_0xd675('0x5')](config['redis'],{'host':_0xd675('0x6'),'port':0x18eb});var io=require(_0xd675('0x7'))(new Redis(config[_0xd675('0x8')]));function FaxQueue(_0x4abbae){this['id']=_0x4abbae['id']||0x0;this[_0xd675('0x9')]=_0x4abbae['name']||'';this[_0xd675('0xa')]=_0x4abbae[_0xd675('0xa')]||0xa;this[_0xd675('0xb')]=_0x4abbae[_0xd675('0xb')]||_0xd675('0xc');this['Agents']=_0x4abbae['Agents'];this[_0xd675('0xd')]={};this[_0xd675('0xe')]=0x0;this['md5']='';this[_0xd675('0xf')]();this[_0xd675('0x10')]();}FaxQueue['prototype'][_0xd675('0xf')]=function(){var _0x15640f=this[_0xd675('0xd')][_0xd675('0x11')];this['mapAgentsId']=_[_0xd675('0x12')](this[_0xd675('0x13')],'id');this[_0xd675('0xd')][_0xd675('0x11')]=_0x15640f;};FaxQueue[_0xd675('0x14')]['updateRealtime']=function(){this[_0xd675('0x15')]=0x0;this[_0xd675('0x16')]=0x0;for(var _0x453c8c=0x0;_0x453c8c<this[_0xd675('0x13')][_0xd675('0x17')];_0x453c8c+=0x1){if(this[_0xd675('0x13')][_0x453c8c][_0xd675('0x18')]){this[_0xd675('0x15')]+=0x1;}if(this[_0xd675('0x13')][_0x453c8c]['faxPause']){this[_0xd675('0x16')]+=0x1;}}this[_0xd675('0x19')]=this['loggedIn']-this[_0xd675('0x16')];this[_0xd675('0x19')]=this[_0xd675('0x19')]>=0x0?this[_0xd675('0x19')]:0x0;var _0x3acebf={'id':this['id'],'available':this['available'],'loggedIn':this[_0xd675('0x15')],'name':this['name'],'paused':this['paused'],'waiting':this[_0xd675('0xe')]};var _0x27f078=md5(JSON[_0xd675('0x1a')](_0x3acebf));if(this[_0xd675('0x1')]!==_0x27f078){this[_0xd675('0x1')]=_0x27f078;io['to'](util['format'](_0xd675('0x1b'),_0x3acebf[_0xd675('0x9')]))[_0xd675('0x1c')](_0xd675('0x1d'),_0x3acebf);}};module[_0xd675('0x1e')]=FaxQueue;
\ No newline at end of file
index 3f84e7e..0df043e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4813=['name','Intervals'];(function(_0x5e0746,_0x4b1a21){var _0x2b102d=function(_0x15239e){while(--_0x15239e){_0x5e0746['push'](_0x5e0746['shift']());}};_0x2b102d(++_0x4b1a21);}(_0x4813,0x1e4));var _0x3481=function(_0x32960d,_0x2998d6){_0x32960d=_0x32960d-0x0;var _0x58ece2=_0x4813[_0x32960d];return _0x58ece2;};'use strict';function Interval(_0x1a5e67){this['id']=_0x1a5e67['id']||0x0;this[_0x3481('0x0')]=_0x1a5e67[_0x3481('0x0')]||'';this[_0x3481('0x1')]=_0x1a5e67[_0x3481('0x1')]||{};}module['exports']=Interval;
\ No newline at end of file
+var _0x626d=['exports','name','Intervals'];(function(_0x53be35,_0x4e645a){var _0x14da9d=function(_0x335c9b){while(--_0x335c9b){_0x53be35['push'](_0x53be35['shift']());}};_0x14da9d(++_0x4e645a);}(_0x626d,0x1ae));var _0xd626=function(_0x539550,_0x5b9a8a){_0x539550=_0x539550-0x0;var _0x1e24be=_0x626d[_0x539550];return _0x1e24be;};'use strict';function Interval(_0x589105){this['id']=_0x589105['id']||0x0;this[_0xd626('0x0')]=_0x589105[_0xd626('0x0')]||'';this['Intervals']=_0x589105[_0xd626('0x1')]||{};}module[_0xd626('0x2')]=Interval;
\ No newline at end of file
index f6f303d..791c7f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ce7=['waiting','format','mail_queue:save','lodash','md5','util','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','_rr','map','prototype','loggedIn','paused','length','online','mailPause','available'];(function(_0x55d698,_0x43e371){var _0x37a6ad=function(_0x156fea){while(--_0x156fea){_0x55d698['push'](_0x55d698['shift']());}};_0x37a6ad(++_0x43e371);}(_0x1ce7,0x9f));var _0x71ce=function(_0x31eb67,_0x9bc8c0){_0x31eb67=_0x31eb67-0x0;var _0x2a8cb8=_0x1ce7[_0x31eb67];return _0x2a8cb8;};'use strict';var _=require(_0x71ce('0x0'));var md5=require(_0x71ce('0x1'));var util=require(_0x71ce('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x71ce('0x3')]=_[_0x71ce('0x4')](config[_0x71ce('0x3')],{'host':_0x71ce('0x5'),'port':0x18eb});var io=require(_0x71ce('0x6'))(new Redis(config[_0x71ce('0x3')]));function MailQueue(_0x40d725){this['id']=_0x40d725['id']||0x0;this[_0x71ce('0x7')]=_0x40d725[_0x71ce('0x7')]||'';this[_0x71ce('0x8')]=_0x40d725[_0x71ce('0x8')]||0xa;this[_0x71ce('0x9')]=_0x40d725[_0x71ce('0x9')]||_0x71ce('0xa');this[_0x71ce('0xb')]=_0x40d725[_0x71ce('0xb')];this[_0x71ce('0xc')]={};this['waiting']=0x0;this[_0x71ce('0x1')]='';this[_0x71ce('0xd')]();this['updateRealtime']();}MailQueue['prototype'][_0x71ce('0xd')]=function(){var _0x4efd7=this[_0x71ce('0xc')][_0x71ce('0xe')];this['mapAgentsId']=_[_0x71ce('0xf')](this[_0x71ce('0xb')],'id');this[_0x71ce('0xc')][_0x71ce('0xe')]=_0x4efd7;};MailQueue[_0x71ce('0x10')]['updateRealtime']=function(){this[_0x71ce('0x11')]=0x0;this[_0x71ce('0x12')]=0x0;for(var _0xf012ca=0x0;_0xf012ca<this[_0x71ce('0xb')][_0x71ce('0x13')];_0xf012ca+=0x1){if(this[_0x71ce('0xb')][_0xf012ca][_0x71ce('0x14')]){this[_0x71ce('0x11')]+=0x1;}if(this[_0x71ce('0xb')][_0xf012ca][_0x71ce('0x15')]){this['paused']+=0x1;}}this[_0x71ce('0x16')]=this[_0x71ce('0x11')]-this['paused'];this[_0x71ce('0x16')]=this['available']>=0x0?this[_0x71ce('0x16')]:0x0;var _0x5d4221={'id':this['id'],'available':this[_0x71ce('0x16')],'loggedIn':this[_0x71ce('0x11')],'name':this[_0x71ce('0x7')],'paused':this[_0x71ce('0x12')],'waiting':this[_0x71ce('0x17')]};var _0x198e1a=md5(JSON['stringify'](_0x5d4221));if(this[_0x71ce('0x1')]!==_0x198e1a){this[_0x71ce('0x1')]=_0x198e1a;io['to'](util[_0x71ce('0x18')]('mail:queue:%s',_0x5d4221[_0x71ce('0x7')]))['emit'](_0x71ce('0x19'),_0x5d4221);}};module['exports']=MailQueue;
\ No newline at end of file
+var _0x4178=['lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','mailPause','available','stringify','format','emit','exports'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4178,0x134));var _0x8417=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x4178[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0x8417('0x0'));var md5=require(_0x8417('0x1'));var util=require('util');var Redis=require(_0x8417('0x2'));var config=require(_0x8417('0x3'));config[_0x8417('0x4')]=_[_0x8417('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x8417('0x6'))(new Redis(config[_0x8417('0x4')]));function MailQueue(_0x39f45b){this['id']=_0x39f45b['id']||0x0;this[_0x8417('0x7')]=_0x39f45b[_0x8417('0x7')]||'';this[_0x8417('0x8')]=_0x39f45b[_0x8417('0x8')]||0xa;this['strategy']=_0x39f45b['strategy']||_0x8417('0x9');this[_0x8417('0xa')]=_0x39f45b['Agents'];this[_0x8417('0xb')]={};this[_0x8417('0xc')]=0x0;this[_0x8417('0x1')]='';this[_0x8417('0xd')]();this[_0x8417('0xe')]();}MailQueue[_0x8417('0xf')]['updateRouting']=function(){var _0x3dc63f=this[_0x8417('0xb')][_0x8417('0x10')];this[_0x8417('0xb')]=_[_0x8417('0x11')](this[_0x8417('0xa')],'id');this['mapAgentsId'][_0x8417('0x10')]=_0x3dc63f;};MailQueue[_0x8417('0xf')][_0x8417('0xe')]=function(){this[_0x8417('0x12')]=0x0;this[_0x8417('0x13')]=0x0;for(var _0x2a5a1a=0x0;_0x2a5a1a<this[_0x8417('0xa')][_0x8417('0x14')];_0x2a5a1a+=0x1){if(this['Agents'][_0x2a5a1a][_0x8417('0x15')]){this[_0x8417('0x12')]+=0x1;}if(this[_0x8417('0xa')][_0x2a5a1a][_0x8417('0x16')]){this[_0x8417('0x13')]+=0x1;}}this[_0x8417('0x17')]=this[_0x8417('0x12')]-this[_0x8417('0x13')];this[_0x8417('0x17')]=this[_0x8417('0x17')]>=0x0?this['available']:0x0;var _0x1f7a01={'id':this['id'],'available':this[_0x8417('0x17')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x8417('0x13')],'waiting':this[_0x8417('0xc')]};var _0x3f5f0c=md5(JSON[_0x8417('0x18')](_0x1f7a01));if(this[_0x8417('0x1')]!==_0x3f5f0c){this[_0x8417('0x1')]=_0x3f5f0c;io['to'](util[_0x8417('0x19')]('mail:queue:%s',_0x1f7a01[_0x8417('0x7')]))[_0x8417('0x1a')]('mail_queue:save',_0x1f7a01);}};module[_0x8417('0x1b')]=MailQueue;
\ No newline at end of file
index 7798e3f..1f637aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','loggedIn','paused','length','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x7a54,0x106));var _0x47a5=function(_0x210cdc,_0x3475f6){_0x210cdc=_0x210cdc-0x0;var _0x171491=_0x7a54[_0x210cdc];return _0x171491;};'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
+var _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x13fa35,_0x257eec){var _0x513731=function(_0x3c5ba1){while(--_0x3c5ba1){_0x13fa35['push'](_0x13fa35['shift']());}};_0x513731(++_0x257eec);}(_0x814b,0x1a2));var _0xb814=function(_0x179c89,_0x3a69b2){_0x179c89=_0x179c89-0x0;var _0x4b87e5=_0x814b[_0x179c89];return _0x4b87e5;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627<this[_0xb814('0xc')][_0xb814('0x16')];_0x2ab627+=0x1){if(this[_0xb814('0xc')][_0x2ab627][_0xb814('0x17')]){this[_0xb814('0x14')]+=0x1;}if(this[_0xb814('0xc')][_0x2ab627][_0xb814('0x18')]){this[_0xb814('0x15')]+=0x1;}}this[_0xb814('0x19')]=this[_0xb814('0x14')]-this[_0xb814('0x15')];this['available']=this[_0xb814('0x19')]>=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue;
\ No newline at end of file
index aa0f82c..43392f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe107=['format','sms:queue:%s','emit','sms_queue:save','exports','lodash','util','ioredis','../../../config/environment','defaults','socket.io-emitter','redis','timeout','strategy','Agents','md5','updateRouting','updateRealtime','prototype','mapAgentsId','map','_rr','loggedIn','paused','length','online','available','waiting','stringify'];(function(_0x1202aa,_0x34c366){var _0x5931dc=function(_0x295c88){while(--_0x295c88){_0x1202aa['push'](_0x1202aa['shift']());}};_0x5931dc(++_0x34c366);}(_0xe107,0xb3));var _0x7e10=function(_0x3e9bcb,_0x3465a3){_0x3e9bcb=_0x3e9bcb-0x0;var _0x1459dd=_0xe107[_0x3e9bcb];return _0x1459dd;};'use strict';var _=require(_0x7e10('0x0'));var md5=require('md5');var util=require(_0x7e10('0x1'));var Redis=require(_0x7e10('0x2'));var config=require(_0x7e10('0x3'));config['redis']=_[_0x7e10('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x7e10('0x5'))(new Redis(config[_0x7e10('0x6')]));function SmsQueue(_0x841f6d){this['id']=_0x841f6d['id']||0x0;this['name']=_0x841f6d['name']||'';this[_0x7e10('0x7')]=_0x841f6d[_0x7e10('0x7')]||0xa;this[_0x7e10('0x8')]=_0x841f6d[_0x7e10('0x8')]||'beepall';this['Agents']=_0x841f6d[_0x7e10('0x9')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x7e10('0xa')]='';this[_0x7e10('0xb')]();this[_0x7e10('0xc')]();}SmsQueue[_0x7e10('0xd')][_0x7e10('0xb')]=function(){var _0x52ba74=this[_0x7e10('0xe')]['_rr'];this[_0x7e10('0xe')]=_[_0x7e10('0xf')](this[_0x7e10('0x9')],'id');this['mapAgentsId'][_0x7e10('0x10')]=_0x52ba74;};SmsQueue[_0x7e10('0xd')][_0x7e10('0xc')]=function(){this[_0x7e10('0x11')]=0x0;this[_0x7e10('0x12')]=0x0;for(var _0x1b4d9d=0x0;_0x1b4d9d<this[_0x7e10('0x9')][_0x7e10('0x13')];_0x1b4d9d+=0x1){if(this['Agents'][_0x1b4d9d][_0x7e10('0x14')]){this[_0x7e10('0x11')]+=0x1;}if(this['Agents'][_0x1b4d9d]['smsPause']){this[_0x7e10('0x12')]+=0x1;}}this['available']=this[_0x7e10('0x11')]-this[_0x7e10('0x12')];this[_0x7e10('0x15')]=this[_0x7e10('0x15')]>=0x0?this['available']:0x0;var _0x3208c6={'id':this['id'],'available':this[_0x7e10('0x15')],'loggedIn':this[_0x7e10('0x11')],'name':this['name'],'paused':this[_0x7e10('0x12')],'waiting':this[_0x7e10('0x16')]};var _0x157b22=md5(JSON[_0x7e10('0x17')](_0x3208c6));if(this[_0x7e10('0xa')]!==_0x157b22){this['md5']=_0x157b22;io['to'](util[_0x7e10('0x18')](_0x7e10('0x19'),_0x3208c6['name']))[_0x7e10('0x1a')](_0x7e10('0x1b'),_0x3208c6);}};module[_0x7e10('0x1c')]=SmsQueue;
\ No newline at end of file
+var _0x3ee5=['smsPause','paused','available','stringify','format','exports','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length'];(function(_0x44491a,_0x4fa177){var _0x29e250=function(_0x2ea3bc){while(--_0x2ea3bc){_0x44491a['push'](_0x44491a['shift']());}};_0x29e250(++_0x4fa177);}(_0x3ee5,0x1b6));var _0x53ee=function(_0x2075a6,_0x16c33a){_0x2075a6=_0x2075a6-0x0;var _0x25de99=_0x3ee5[_0x2075a6];return _0x25de99;};'use strict';var _=require('lodash');var md5=require(_0x53ee('0x0'));var util=require(_0x53ee('0x1'));var Redis=require('ioredis');var config=require(_0x53ee('0x2'));config[_0x53ee('0x3')]=_[_0x53ee('0x4')](config[_0x53ee('0x3')],{'host':_0x53ee('0x5'),'port':0x18eb});var io=require(_0x53ee('0x6'))(new Redis(config[_0x53ee('0x3')]));function SmsQueue(_0x26ea34){this['id']=_0x26ea34['id']||0x0;this[_0x53ee('0x7')]=_0x26ea34[_0x53ee('0x7')]||'';this[_0x53ee('0x8')]=_0x26ea34['timeout']||0xa;this[_0x53ee('0x9')]=_0x26ea34[_0x53ee('0x9')]||_0x53ee('0xa');this[_0x53ee('0xb')]=_0x26ea34[_0x53ee('0xb')];this[_0x53ee('0xc')]={};this[_0x53ee('0xd')]=0x0;this[_0x53ee('0x0')]='';this[_0x53ee('0xe')]();this[_0x53ee('0xf')]();}SmsQueue[_0x53ee('0x10')][_0x53ee('0xe')]=function(){var _0x4e6a1b=this['mapAgentsId'][_0x53ee('0x11')];this[_0x53ee('0xc')]=_[_0x53ee('0x12')](this[_0x53ee('0xb')],'id');this[_0x53ee('0xc')]['_rr']=_0x4e6a1b;};SmsQueue['prototype'][_0x53ee('0xf')]=function(){this[_0x53ee('0x13')]=0x0;this['paused']=0x0;for(var _0x5b40ff=0x0;_0x5b40ff<this[_0x53ee('0xb')][_0x53ee('0x14')];_0x5b40ff+=0x1){if(this[_0x53ee('0xb')][_0x5b40ff]['online']){this[_0x53ee('0x13')]+=0x1;}if(this[_0x53ee('0xb')][_0x5b40ff][_0x53ee('0x15')]){this[_0x53ee('0x16')]+=0x1;}}this[_0x53ee('0x17')]=this[_0x53ee('0x13')]-this['paused'];this[_0x53ee('0x17')]=this[_0x53ee('0x17')]>=0x0?this[_0x53ee('0x17')]:0x0;var _0x17c3cb={'id':this['id'],'available':this[_0x53ee('0x17')],'loggedIn':this[_0x53ee('0x13')],'name':this[_0x53ee('0x7')],'paused':this[_0x53ee('0x16')],'waiting':this[_0x53ee('0xd')]};var _0x360d60=md5(JSON[_0x53ee('0x18')](_0x17c3cb));if(this[_0x53ee('0x0')]!==_0x360d60){this[_0x53ee('0x0')]=_0x360d60;io['to'](util[_0x53ee('0x19')]('sms:queue:%s',_0x17c3cb[_0x53ee('0x7')]))['emit']('sms_queue:save',_0x17c3cb);}};module[_0x53ee('0x1a')]=SmsQueue;
\ No newline at end of file
index 51eb272..52e2d0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b47=['online','whatsappPause','available','name','stringify','format','whatsapp:queue:%s','emit','lodash','util','../../../config/environment','defaults','localhost','timeout','strategy','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length'];(function(_0x5a077c,_0x4cdfd6){var _0x4f6edd=function(_0x462a3e){while(--_0x462a3e){_0x5a077c['push'](_0x5a077c['shift']());}};_0x4f6edd(++_0x4cdfd6);}(_0x1b47,0x126));var _0x71b4=function(_0x18f396,_0x174d17){_0x18f396=_0x18f396-0x0;var _0x3ba532=_0x1b47[_0x18f396];return _0x3ba532;};'use strict';var _=require(_0x71b4('0x0'));var md5=require('md5');var util=require(_0x71b4('0x1'));var Redis=require('ioredis');var config=require(_0x71b4('0x2'));config['redis']=_[_0x71b4('0x3')](config['redis'],{'host':_0x71b4('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function WhatsappQueue(_0x12fa74){this['id']=_0x12fa74['id']||0x0;this['name']=_0x12fa74['name']||'';this[_0x71b4('0x5')]=_0x12fa74['timeout']||0xa;this[_0x71b4('0x6')]=_0x12fa74[_0x71b4('0x6')]||'beepall';this[_0x71b4('0x7')]=_0x12fa74[_0x71b4('0x7')];this[_0x71b4('0x8')]={};this[_0x71b4('0x9')]=0x0;this[_0x71b4('0xa')]='';this[_0x71b4('0xb')]();this[_0x71b4('0xc')]();}WhatsappQueue[_0x71b4('0xd')][_0x71b4('0xb')]=function(){var _0x3257d1=this[_0x71b4('0x8')][_0x71b4('0xe')];this['mapAgentsId']=_['map'](this[_0x71b4('0x7')],'id');this[_0x71b4('0x8')][_0x71b4('0xe')]=_0x3257d1;};WhatsappQueue[_0x71b4('0xd')][_0x71b4('0xc')]=function(){this[_0x71b4('0xf')]=0x0;this[_0x71b4('0x10')]=0x0;for(var _0x23da41=0x0;_0x23da41<this[_0x71b4('0x7')][_0x71b4('0x11')];_0x23da41+=0x1){if(this[_0x71b4('0x7')][_0x23da41][_0x71b4('0x12')]){this['loggedIn']+=0x1;}if(this[_0x71b4('0x7')][_0x23da41][_0x71b4('0x13')]){this[_0x71b4('0x10')]+=0x1;}}this[_0x71b4('0x14')]=this[_0x71b4('0xf')]-this[_0x71b4('0x10')];this[_0x71b4('0x14')]=this[_0x71b4('0x14')]>=0x0?this[_0x71b4('0x14')]:0x0;var _0xa5f0ab={'id':this['id'],'available':this[_0x71b4('0x14')],'loggedIn':this[_0x71b4('0xf')],'name':this[_0x71b4('0x15')],'paused':this['paused'],'waiting':this[_0x71b4('0x9')]};var _0x4b29ef=md5(JSON[_0x71b4('0x16')](_0xa5f0ab));if(this[_0x71b4('0xa')]!==_0x4b29ef){this[_0x71b4('0xa')]=_0x4b29ef;io['to'](util[_0x71b4('0x17')](_0x71b4('0x18'),_0xa5f0ab[_0x71b4('0x15')]))[_0x71b4('0x19')]('whatsapp_queue:save',_0xa5f0ab);}};module['exports']=WhatsappQueue;
\ No newline at end of file
+var _0xdb97=['updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','whatsappPause','available','stringify','md5','format','whatsapp_queue:save','exports','lodash','util','ioredis','redis','localhost','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb97,0x160));var _0x7db9=function(_0x554b0e,_0x4d1fa3){_0x554b0e=_0x554b0e-0x0;var _0x3bdaa9=_0xdb97[_0x554b0e];return _0x3bdaa9;};'use strict';var _=require(_0x7db9('0x0'));var md5=require('md5');var util=require(_0x7db9('0x1'));var Redis=require(_0x7db9('0x2'));var config=require('../../../config/environment');config[_0x7db9('0x3')]=_['defaults'](config[_0x7db9('0x3')],{'host':_0x7db9('0x4'),'port':0x18eb});var io=require(_0x7db9('0x5'))(new Redis(config[_0x7db9('0x3')]));function WhatsappQueue(_0x4c8848){this['id']=_0x4c8848['id']||0x0;this[_0x7db9('0x6')]=_0x4c8848[_0x7db9('0x6')]||'';this['timeout']=_0x4c8848['timeout']||0xa;this['strategy']=_0x4c8848[_0x7db9('0x7')]||_0x7db9('0x8');this['Agents']=_0x4c8848[_0x7db9('0x9')];this[_0x7db9('0xa')]={};this[_0x7db9('0xb')]=0x0;this['md5']='';this[_0x7db9('0xc')]();this[_0x7db9('0xd')]();}WhatsappQueue[_0x7db9('0xe')][_0x7db9('0xc')]=function(){var _0x2ca8b6=this[_0x7db9('0xa')][_0x7db9('0xf')];this[_0x7db9('0xa')]=_[_0x7db9('0x10')](this['Agents'],'id');this[_0x7db9('0xa')][_0x7db9('0xf')]=_0x2ca8b6;};WhatsappQueue[_0x7db9('0xe')][_0x7db9('0xd')]=function(){this[_0x7db9('0x11')]=0x0;this[_0x7db9('0x12')]=0x0;for(var _0xd5aebd=0x0;_0xd5aebd<this[_0x7db9('0x9')]['length'];_0xd5aebd+=0x1){if(this[_0x7db9('0x9')][_0xd5aebd]['online']){this[_0x7db9('0x11')]+=0x1;}if(this[_0x7db9('0x9')][_0xd5aebd][_0x7db9('0x13')]){this[_0x7db9('0x12')]+=0x1;}}this[_0x7db9('0x14')]=this[_0x7db9('0x11')]-this[_0x7db9('0x12')];this[_0x7db9('0x14')]=this[_0x7db9('0x14')]>=0x0?this['available']:0x0;var _0x26d789={'id':this['id'],'available':this['available'],'loggedIn':this[_0x7db9('0x11')],'name':this[_0x7db9('0x6')],'paused':this['paused'],'waiting':this[_0x7db9('0xb')]};var _0x5e1989=md5(JSON[_0x7db9('0x15')](_0x26d789));if(this[_0x7db9('0x16')]!==_0x5e1989){this[_0x7db9('0x16')]=_0x5e1989;io['to'](util[_0x7db9('0x17')]('whatsapp:queue:%s',_0x26d789[_0x7db9('0x6')]))['emit'](_0x7db9('0x18'),_0x26d789);}};module[_0x7db9('0x19')]=WhatsappQueue;
\ No newline at end of file
index 2c82a89..4cc565d 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(_0x329db0,_0x3efa85){var _0x465c48=function(_0x42d528){while(--_0x42d528){_0x329db0['push'](_0x329db0['shift']());}};_0x465c48(++_0x3efa85);}(_0xb10b,0x12a));var _0xbb10=function(_0x1432a6,_0x5846c5){_0x1432a6=_0x1432a6-0x0;var _0x3eab00=_0xb10b[_0x1432a6];return _0x3eab00;};'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(_0x18a6f7,_0x477fda){var _0x2f0f1d=function(_0x277360){while(--_0x277360){_0x18a6f7['push'](_0x18a6f7['shift']());}};_0x2f0f1d(++_0x477fda);}(_0xb10b,0x12a));var _0xbb10=function(_0x33d9c5,_0x2c159d){_0x33d9c5=_0x33d9c5-0x0;var _0x28f547=_0xb10b[_0x33d9c5];return _0x28f547;};'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 89545c9..e19a72f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x578b=['update','Request','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x2338fa,_0x80579a){var _0x42df9b=function(_0x13fe56){while(--_0x13fe56){_0x2338fa['push'](_0x2338fa['shift']());}};_0x42df9b(++_0x80579a);}(_0x578b,0x7d));var _0xb578=function(_0x2f31ea,_0x351d88){_0x2f31ea=_0x2f31ea-0x0;var _0x5b6a5d=_0x578b[_0x2f31ea];return _0x5b6a5d;};'use strict';var client=require(_0xb578('0x0'));exports[_0xb578('0x1')]=function(_0x4b74d0,_0x18e6e2){return client[_0xb578('0x2')]('UpdateChatInteraction',{'body':_0x18e6e2,'options':{'where':{'id':_0x4b74d0}},'log':_0xb578('0x3')});};exports[_0xb578('0x4')]=function(_0x2f7c54,_0x5f583f){return client['Request'](_0xb578('0x5'),{'body':_0x5f583f,'options':{'where':{'id':_0x2f7c54}},'log':_0xb578('0x6')});};
\ No newline at end of file
+var _0x0db4=['addTags','addTagsToChatInteraction','../client','Request','UpdateChatInteraction'];(function(_0x2f89b3,_0x33171e){var _0x35d7be=function(_0x436707){while(--_0x436707){_0x2f89b3['push'](_0x2f89b3['shift']());}};_0x35d7be(++_0x33171e);}(_0x0db4,0xe3));var _0x40db=function(_0x946518,_0x22816f){_0x946518=_0x946518-0x0;var _0x909b69=_0x0db4[_0x946518];return _0x909b69;};'use strict';var client=require(_0x40db('0x0'));exports['update']=function(_0x110038,_0x5046ae){return client[_0x40db('0x1')](_0x40db('0x2'),{'body':_0x5046ae,'options':{'where':{'id':_0x110038}},'log':'updateChatInteraction'});};exports[_0x40db('0x3')]=function(_0x51c1c8,_0x3dc980){return client['Request']('AddTagsToChatInteraction',{'body':_0x3dc980,'options':{'where':{'id':_0x51c1c8}},'log':_0x40db('0x4')});};
\ No newline at end of file
index 9b8c4f7..c531f0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cdd=['../client','create','Request','CreateChatMessage','createChatMessage'];(function(_0x1d2bbb,_0x202267){var _0x38082b=function(_0x27d153){while(--_0x27d153){_0x1d2bbb['push'](_0x1d2bbb['shift']());}};_0x38082b(++_0x202267);}(_0x2cdd,0x1ea));var _0xd2cd=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x2cdd[_0x2c7618];return _0x5ce3f0;};'use strict';var client=require(_0xd2cd('0x0'));exports[_0xd2cd('0x1')]=function(_0x11c29e){return client[_0xd2cd('0x2')](_0xd2cd('0x3'),{'body':_0x11c29e,'log':_0xd2cd('0x4')});};
\ No newline at end of file
+var _0xeec1=['CreateChatMessage','Request'];(function(_0x1ae05b,_0x27a0d0){var _0xe70440=function(_0xd73dfe){while(--_0xd73dfe){_0x1ae05b['push'](_0x1ae05b['shift']());}};_0xe70440(++_0x27a0d0);}(_0xeec1,0x109));var _0x1eec=function(_0x4a624e,_0x4c63b2){_0x4a624e=_0x4a624e-0x0;var _0x4d3bc0=_0xeec1[_0x4a624e];return _0x4d3bc0;};'use strict';var client=require('../client');exports['create']=function(_0x55907a){return client[_0x1eec('0x0')](_0x1eec('0x1'),{'body':_0x55907a,'log':'createChatMessage'});};
\ No newline at end of file
index 4ae0982..db4070d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x692c=['name','timeout','User','Agents','online','chatPause','../client','getChatQueues','Request','GetChatQueue'];(function(_0x34f29e,_0x5da898){var _0x38ebe5=function(_0x39c8a5){while(--_0x39c8a5){_0x34f29e['push'](_0x34f29e['shift']());}};_0x38ebe5(++_0x5da898);}(_0x692c,0x6a));var _0xc692=function(_0x1f212f,_0x2a0b98){_0x1f212f=_0x1f212f-0x0;var _0x382128=_0x692c[_0x1f212f];return _0x382128;};'use strict';var client=require(_0xc692('0x0'));exports[_0xc692('0x1')]=function(){return function(){return client[_0xc692('0x2')](_0xc692('0x3'),{'options':{'raw':![],'attributes':['id',_0xc692('0x4'),_0xc692('0x5'),'strategy'],'include':[{'model':_0xc692('0x6'),'as':_0xc692('0x7'),'attributes':['id',_0xc692('0x4'),_0xc692('0x8'),_0xc692('0x9')]}]},'log':_0xc692('0x1')});};};
\ No newline at end of file
+var _0x4d61=['GetChatQueue','name','timeout','strategy','User','Agents','online','chatPause','../client','getChatQueues','Request'];(function(_0x12507f,_0x404a8a){var _0x29a56b=function(_0x3a5d28){while(--_0x3a5d28){_0x12507f['push'](_0x12507f['shift']());}};_0x29a56b(++_0x404a8a);}(_0x4d61,0x147));var _0x14d6=function(_0x4c340d,_0x4b2902){_0x4c340d=_0x4c340d-0x0;var _0x33a93e=_0x4d61[_0x4c340d];return _0x33a93e;};'use strict';var client=require(_0x14d6('0x0'));exports[_0x14d6('0x1')]=function(){return function(){return client[_0x14d6('0x2')](_0x14d6('0x3'),{'options':{'raw':![],'attributes':['id',_0x14d6('0x4'),_0x14d6('0x5'),_0x14d6('0x6')],'include':[{'model':_0x14d6('0x7'),'as':_0x14d6('0x8'),'attributes':['id','name',_0x14d6('0x9'),_0x14d6('0xa')]}]},'log':_0x14d6('0x1')});};};
\ No newline at end of file
index 70e7a8b..25aa367 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6921=['update','UpdateChatQueueReport','DESC','create','Request','CreateChatQueueReport'];(function(_0x12ad60,_0x451820){var _0x48079a=function(_0x56df2a){while(--_0x56df2a){_0x12ad60['push'](_0x12ad60['shift']());}};_0x48079a(++_0x451820);}(_0x6921,0x1d1));var _0x1692=function(_0x22c054,_0x30514c){_0x22c054=_0x22c054-0x0;var _0x2a5ed6=_0x6921[_0x22c054];return _0x2a5ed6;};'use strict';var client=require('../client');exports[_0x1692('0x0')]=function(_0x566deb){return client[_0x1692('0x1')]('CreateChatQueueReport',{'body':_0x566deb,'log':_0x1692('0x2')});};exports[_0x1692('0x3')]=function(_0x4ac00c,_0x3995b3){return client['Request'](_0x1692('0x4'),{'body':_0x3995b3,'options':{'where':{'uniqueid':_0x4ac00c},'order':[['id',_0x1692('0x5')]],'limit':0x1},'log':_0x1692('0x4')});};
\ No newline at end of file
+var _0x5309=['../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x164f66,_0x45b77e){var _0x24832c=function(_0x36f659){while(--_0x36f659){_0x164f66['push'](_0x164f66['shift']());}};_0x24832c(++_0x45b77e);}(_0x5309,0x1aa));var _0x9530=function(_0x564821,_0x4d037e){_0x564821=_0x564821-0x0;var _0x2b604d=_0x5309[_0x564821];return _0x2b604d;};'use strict';var client=require(_0x9530('0x0'));exports[_0x9530('0x1')]=function(_0x2658ab){return client[_0x9530('0x2')](_0x9530('0x3'),{'body':_0x2658ab,'log':_0x9530('0x3')});};exports[_0x9530('0x4')]=function(_0x13abba,_0x169a84){return client[_0x9530('0x2')]('UpdateChatQueueReport',{'body':_0x169a84,'options':{'where':{'uniqueid':_0x13abba},'order':[['id','DESC']],'limit':0x1},'log':_0x9530('0x5')});};
\ No newline at end of file
index e9b43ad..5f09b00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x367c8e,_0x3a6502){var _0x1c2789=function(_0x908461){while(--_0x908461){_0x367c8e['push'](_0x367c8e['shift']());}};_0x1c2789(++_0x3a6502);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});};
\ No newline at end of file
+var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x764874,_0x3ed544){var _0x29f9d5=function(_0x152dad){while(--_0x152dad){_0x764874['push'](_0x764874['shift']());}};_0x29f9d5(++_0x3ed544);}(_0x7a54,0x106));var _0x47a5=function(_0x34bf3d,_0x236eae){_0x34bf3d=_0x34bf3d-0x0;var _0x2145dd=_0x7a54[_0x34bf3d];return _0x2145dd;};'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
index b563f68..87b3360 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x933d=['Request','CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x41d6b1,_0x147b89){var _0x2e981c=function(_0x5271c1){while(--_0x5271c1){_0x41d6b1['push'](_0x41d6b1['shift']());}};_0x2e981c(++_0x147b89);}(_0x933d,0x166));var _0xd933=function(_0x17a844,_0x3eaca6){_0x17a844=_0x17a844-0x0;var _0x5c948b=_0x933d[_0x17a844];return _0x5c948b;};'use strict';var client=require(_0xd933('0x0'));exports[_0xd933('0x1')]=function(_0x39b685){return client[_0xd933('0x2')](_0xd933('0x3'),{'body':_0x39b685,'log':_0xd933('0x4')});};
\ No newline at end of file
+var _0x787b=['createFaxMessage','Request'];(function(_0x2f551b,_0x232bf8){var _0x3ee6f9=function(_0xba1287){while(--_0xba1287){_0x2f551b['push'](_0x2f551b['shift']());}};_0x3ee6f9(++_0x232bf8);}(_0x787b,0xcb));var _0xb787=function(_0x31172e,_0xa59e5){_0x31172e=_0x31172e-0x0;var _0x414ada=_0x787b[_0x31172e];return _0x414ada;};'use strict';var client=require('../client');exports['create']=function(_0x2a664b){return client[_0xb787('0x0')]('CreateFaxMessage',{'body':_0x2a664b,'log':_0xb787('0x1')});};
\ No newline at end of file
index 1ae4e62..991ec82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa583=['online','faxPause','../client','getFaxQueues','Request','GetFaxQueue','name','timeout','strategy','User'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0xa583,0x70));var _0x3a58=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xa583[_0x3ab51d];return _0x29a04e;};'use strict';var client=require(_0x3a58('0x0'));exports[_0x3a58('0x1')]=function(){return function(){return client[_0x3a58('0x2')](_0x3a58('0x3'),{'options':{'raw':![],'attributes':['id',_0x3a58('0x4'),_0x3a58('0x5'),_0x3a58('0x6')],'include':[{'model':_0x3a58('0x7'),'as':'Agents','attributes':['id',_0x3a58('0x4'),_0x3a58('0x8'),_0x3a58('0x9')]}]},'log':_0x3a58('0x1')});};};
\ No newline at end of file
+var _0xd63b=['timeout','strategy','User','online','../client','getFaxQueues','Request','GetFaxQueue','name'];(function(_0x339a1f,_0x2b5fd2){var _0xea6184=function(_0x5a72d7){while(--_0x5a72d7){_0x339a1f['push'](_0x339a1f['shift']());}};_0xea6184(++_0x2b5fd2);}(_0xd63b,0xaf));var _0xbd63=function(_0x35ebbb,_0xe862ef){_0x35ebbb=_0x35ebbb-0x0;var _0x29d9b=_0xd63b[_0x35ebbb];return _0x29d9b;};'use strict';var client=require(_0xbd63('0x0'));exports[_0xbd63('0x1')]=function(){return function(){return client[_0xbd63('0x2')](_0xbd63('0x3'),{'options':{'raw':![],'attributes':['id',_0xbd63('0x4'),_0xbd63('0x5'),_0xbd63('0x6')],'include':[{'model':_0xbd63('0x7'),'as':'Agents','attributes':['id','name',_0xbd63('0x8'),'faxPause']}]},'log':_0xbd63('0x1')});};};
\ No newline at end of file
index efc3680..1ae958c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf409=['update','UpdateFaxQueueReport','../client','CreateFaxQueueReport'];(function(_0x26f292,_0xc48a2c){var _0x4e2aa2=function(_0x58f5bc){while(--_0x58f5bc){_0x26f292['push'](_0x26f292['shift']());}};_0x4e2aa2(++_0xc48a2c);}(_0xf409,0xce));var _0x9f40=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xf409[_0x3e112d];return _0x531c31;};'use strict';var client=require(_0x9f40('0x0'));exports['create']=function(_0x5d9929){return client['Request'](_0x9f40('0x1'),{'body':_0x5d9929,'log':_0x9f40('0x1')});};exports[_0x9f40('0x2')]=function(_0x416fb3,_0x45a2c6){return client['Request'](_0x9f40('0x3'),{'body':_0x45a2c6,'options':{'where':{'uniqueid':_0x416fb3},'order':[['id','DESC']],'limit':0x1},'log':_0x9f40('0x3')});};
\ No newline at end of file
+var _0xb04a=['CreateFaxQueueReport','update','DESC','../client','create','Request'];(function(_0x2543d6,_0x3a5e78){var _0x55213c=function(_0x292768){while(--_0x292768){_0x2543d6['push'](_0x2543d6['shift']());}};_0x55213c(++_0x3a5e78);}(_0xb04a,0x177));var _0xab04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb04a[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xab04('0x0'));exports[_0xab04('0x1')]=function(_0x2c0253){return client[_0xab04('0x2')](_0xab04('0x3'),{'body':_0x2c0253,'log':_0xab04('0x3')});};exports[_0xab04('0x4')]=function(_0x4f81bc,_0x46ce08){return client[_0xab04('0x2')]('UpdateFaxQueueReport',{'body':_0x46ce08,'options':{'where':{'uniqueid':_0x4f81bc},'order':[['id',_0xab04('0x5')]],'limit':0x1},'log':'UpdateFaxQueueReport'});};
\ No newline at end of file
index 67f727d..1cb7ca6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0808=['GetInterval','name','Interval','Intervals','interval','getIntervals','../client','Request'];(function(_0x5a5af2,_0x16e393){var _0x25828b=function(_0x716af9){while(--_0x716af9){_0x5a5af2['push'](_0x5a5af2['shift']());}};_0x25828b(++_0x16e393);}(_0x0808,0x156));var _0x8080=function(_0x1196f5,_0x2291aa){_0x1196f5=_0x1196f5-0x0;var _0x57a9e2=_0x0808[_0x1196f5];return _0x57a9e2;};'use strict';var client=require(_0x8080('0x0'));exports['getIntervals']=function(){return function(){return client[_0x8080('0x1')](_0x8080('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x8080('0x3')],'include':[{'model':_0x8080('0x4'),'as':_0x8080('0x5'),'attributes':['id','name',_0x8080('0x6')]}]},'log':_0x8080('0x7')});};};
\ No newline at end of file
+var _0x79bd=['Intervals','interval','../client','getIntervals','Request','GetInterval','name','Interval'];(function(_0x1f4a2e,_0x54dc6f){var _0x2a3ef5=function(_0x4ae59f){while(--_0x4ae59f){_0x1f4a2e['push'](_0x1f4a2e['shift']());}};_0x2a3ef5(++_0x54dc6f);}(_0x79bd,0x7a));var _0xd79b=function(_0x435acf,_0x26c41e){_0x435acf=_0x435acf-0x0;var _0x118664=_0x79bd[_0x435acf];return _0x118664;};'use strict';var client=require(_0xd79b('0x0'));exports[_0xd79b('0x1')]=function(){return function(){return client[_0xd79b('0x2')](_0xd79b('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xd79b('0x4')],'include':[{'model':_0xd79b('0x5'),'as':_0xd79b('0x6'),'attributes':['id','name',_0xd79b('0x7')]}]},'log':_0xd79b('0x1')});};};
\ No newline at end of file
index fe94263..3084108 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4991=['AddTagsToMailInteraction','../client','Request','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x38bdb8,_0x26aab7){var _0x4ab6d8=function(_0x487d30){while(--_0x487d30){_0x38bdb8['push'](_0x38bdb8['shift']());}};_0x4ab6d8(++_0x26aab7);}(_0x4991,0xf7));var _0x1499=function(_0x101e81,_0xd9e9){_0x101e81=_0x101e81-0x0;var _0x1f4c45=_0x4991[_0x101e81];return _0x1f4c45;};'use strict';var client=require(_0x1499('0x0'));exports['update']=function(_0x326758,_0x5bd577){return client[_0x1499('0x1')](_0x1499('0x2'),{'body':_0x5bd577,'options':{'where':{'id':_0x326758}},'log':_0x1499('0x3')});};exports[_0x1499('0x4')]=function(_0x1b291f,_0x158134){return client[_0x1499('0x1')](_0x1499('0x5'),{'body':_0x158134,'options':{'where':{'id':_0x1b291f}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
+var _0x6a95=['update','Request','UpdateMailInteraction','updateMailInteraction','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x6a95,0x1db));var _0x56a9=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x6a95[_0x1facfa];return _0x9ec701;};'use strict';var client=require(_0x56a9('0x0'));exports[_0x56a9('0x1')]=function(_0x15574a,_0xce37aa){return client[_0x56a9('0x2')](_0x56a9('0x3'),{'body':_0xce37aa,'options':{'where':{'id':_0x15574a}},'log':_0x56a9('0x4')});};exports['addTags']=function(_0x512f52,_0x12cd60){return client[_0x56a9('0x2')](_0x56a9('0x5'),{'body':_0x12cd60,'options':{'where':{'id':_0x512f52}},'log':_0x56a9('0x6')});};
\ No newline at end of file
index 169f5fe..33e9e7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab03=['create','CreateMailMessage','createMailMessage','../client'];(function(_0x5919ef,_0x28cde9){var _0xd2f76=function(_0x25ff8b){while(--_0x25ff8b){_0x5919ef['push'](_0x5919ef['shift']());}};_0xd2f76(++_0x28cde9);}(_0xab03,0x17f));var _0x3ab0=function(_0x33742a,_0xbf36c2){_0x33742a=_0x33742a-0x0;var _0xfd789a=_0xab03[_0x33742a];return _0xfd789a;};'use strict';var client=require(_0x3ab0('0x0'));exports[_0x3ab0('0x1')]=function(_0x30eab3){return client['Request'](_0x3ab0('0x2'),{'body':_0x30eab3,'log':_0x3ab0('0x3')});};
\ No newline at end of file
+var _0xbf9b=['Request','CreateMailMessage','../client','create'];(function(_0x4f8394,_0x3fb270){var _0x265c53=function(_0x2ed25d){while(--_0x2ed25d){_0x4f8394['push'](_0x4f8394['shift']());}};_0x265c53(++_0x3fb270);}(_0xbf9b,0xd2));var _0xbbf9=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xbf9b[_0x2dea24];return _0x309d58;};'use strict';var client=require(_0xbbf9('0x0'));exports[_0xbbf9('0x1')]=function(_0x3ac196){return client[_0xbbf9('0x2')](_0xbbf9('0x3'),{'body':_0x3ac196,'log':'createMailMessage'});};
\ No newline at end of file
index 1ce145b..e821048 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde06=['strategy','User','name','online','mailPause','../client','getMailQueues','Request','GetMailQueue','timeout'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xde06,0x113));var _0x6de0=function(_0x48683a,_0x462b9b){_0x48683a=_0x48683a-0x0;var _0x5ed577=_0xde06[_0x48683a];return _0x5ed577;};'use strict';var client=require(_0x6de0('0x0'));exports[_0x6de0('0x1')]=function(){return function(){return client[_0x6de0('0x2')](_0x6de0('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x6de0('0x4'),_0x6de0('0x5')],'include':[{'model':_0x6de0('0x6'),'as':'Agents','attributes':['id',_0x6de0('0x7'),_0x6de0('0x8'),_0x6de0('0x9')]}]},'log':_0x6de0('0x1')});};};
\ No newline at end of file
+var _0x3e92=['strategy','User','Agents','online','../client','getMailQueues','Request','GetMailQueue','name'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x3e92,0xa6));var _0x23e9=function(_0x4735ee,_0x48e525){_0x4735ee=_0x4735ee-0x0;var _0x2a6f6f=_0x3e92[_0x4735ee];return _0x2a6f6f;};'use strict';var client=require(_0x23e9('0x0'));exports[_0x23e9('0x1')]=function(){return function(){return client[_0x23e9('0x2')](_0x23e9('0x3'),{'options':{'raw':![],'attributes':['id',_0x23e9('0x4'),'timeout',_0x23e9('0x5')],'include':[{'model':_0x23e9('0x6'),'as':_0x23e9('0x7'),'attributes':['id',_0x23e9('0x4'),_0x23e9('0x8'),'mailPause']}]},'log':_0x23e9('0x1')});};};
\ No newline at end of file
index b64bb35..108837e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c12=['UpdateMailQueueReport','../client','CreateMailQueueReport','update','Request'];(function(_0x3c15a4,_0x119e3a){var _0x2709df=function(_0x2f7fb7){while(--_0x2f7fb7){_0x3c15a4['push'](_0x3c15a4['shift']());}};_0x2709df(++_0x119e3a);}(_0x6c12,0x119));var _0x26c1=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x6c12[_0x1a9204];return _0x17ca68;};'use strict';var client=require(_0x26c1('0x0'));exports['create']=function(_0xd7c947){return client['Request']('CreateMailQueueReport',{'body':_0xd7c947,'log':_0x26c1('0x1')});};exports[_0x26c1('0x2')]=function(_0x415fc9,_0x281c51){return client[_0x26c1('0x3')](_0x26c1('0x4'),{'body':_0x281c51,'options':{'where':{'uniqueid':_0x415fc9},'order':[['id','DESC']],'limit':0x1},'log':_0x26c1('0x4')});};
\ No newline at end of file
+var _0x57ef=['UpdateMailQueueReport','../client','create','Request','CreateMailQueueReport','update'];(function(_0x4cd7fd,_0x315a81){var _0x11157d=function(_0x3d2e4b){while(--_0x3d2e4b){_0x4cd7fd['push'](_0x4cd7fd['shift']());}};_0x11157d(++_0x315a81);}(_0x57ef,0x1bd));var _0xf57e=function(_0x447875,_0x2d6af8){_0x447875=_0x447875-0x0;var _0x5a9f8e=_0x57ef[_0x447875];return _0x5a9f8e;};'use strict';var client=require(_0xf57e('0x0'));exports[_0xf57e('0x1')]=function(_0x5ae661){return client[_0xf57e('0x2')](_0xf57e('0x3'),{'body':_0x5ae661,'log':'CreateMailQueueReport'});};exports[_0xf57e('0x4')]=function(_0x332189,_0x5ec21a){return client['Request'](_0xf57e('0x5'),{'body':_0x5ec21a,'options':{'where':{'uniqueid':_0x332189},'order':[['id','DESC']],'limit':0x1},'log':_0xf57e('0x5')});};
\ No newline at end of file
index b2e2c74..e7d0234 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc54c=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','Request'];(function(_0x456284,_0x1e04a8){var _0x2a9f01=function(_0x440539){while(--_0x440539){_0x456284['push'](_0x456284['shift']());}};_0x2a9f01(++_0x1e04a8);}(_0xc54c,0x1d0));var _0xcc54=function(_0x4b03c9,_0x17ce03){_0x4b03c9=_0x4b03c9-0x0;var _0x161ba2=_0xc54c[_0x4b03c9];return _0x161ba2;};'use strict';var client=require('../client');exports['update']=function(_0xa37ce3,_0x2dfb8b){return client['Request'](_0xcc54('0x0'),{'body':_0x2dfb8b,'options':{'where':{'id':_0xa37ce3}},'log':_0xcc54('0x1')});};exports[_0xcc54('0x2')]=function(_0x7f26cd,_0xa0b4c5){return client[_0xcc54('0x3')](_0xcc54('0x4'),{'body':_0xa0b4c5,'options':{'where':{'id':_0x7f26cd}},'log':_0xcc54('0x5')});};
\ No newline at end of file
+var _0x85d2=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','UpdateOpenchannelInteraction','addTags','Request'];(function(_0x23573d,_0x3bf86f){var _0xc85c6a=function(_0x4bece1){while(--_0x4bece1){_0x23573d['push'](_0x23573d['shift']());}};_0xc85c6a(++_0x3bf86f);}(_0x85d2,0x1d7));var _0x285d=function(_0x3e1948,_0x536138){_0x3e1948=_0x3e1948-0x0;var _0x1bc7c0=_0x85d2[_0x3e1948];return _0x1bc7c0;};'use strict';var client=require(_0x285d('0x0'));exports[_0x285d('0x1')]=function(_0x5ce2d0,_0x21cd33){return client['Request'](_0x285d('0x2'),{'body':_0x21cd33,'options':{'where':{'id':_0x5ce2d0}},'log':'updateOpenchannelInteraction'});};exports[_0x285d('0x3')]=function(_0x3256e3,_0xdf91e3){return client[_0x285d('0x4')](_0x285d('0x5'),{'body':_0xdf91e3,'options':{'where':{'id':_0x3256e3}},'log':_0x285d('0x6')});};
\ No newline at end of file
index 9cd0b0d..bbacf4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1173=['createOpenchannelMessage','../client','CreateOpenchannelMessage'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x1173,0xc1));var _0x3117=function(_0xe5cac7,_0x6c2f84){_0xe5cac7=_0xe5cac7-0x0;var _0x50df20=_0x1173[_0xe5cac7];return _0x50df20;};'use strict';var client=require(_0x3117('0x0'));exports['create']=function(_0x2082e0){return client['Request'](_0x3117('0x1'),{'body':_0x2082e0,'log':_0x3117('0x2')});};
\ No newline at end of file
+var _0x3bbe=['createOpenchannelMessage','../client','create'];(function(_0x4cb032,_0x344130){var _0x59fa1d=function(_0x50e5b3){while(--_0x50e5b3){_0x4cb032['push'](_0x4cb032['shift']());}};_0x59fa1d(++_0x344130);}(_0x3bbe,0x19c));var _0xe3bb=function(_0x43c62a,_0x125d82){_0x43c62a=_0x43c62a-0x0;var _0x367fb8=_0x3bbe[_0x43c62a];return _0x367fb8;};'use strict';var client=require(_0xe3bb('0x0'));exports[_0xe3bb('0x1')]=function(_0x36c597){return client['Request']('CreateOpenchannelMessage',{'body':_0x36c597,'log':_0xe3bb('0x2')});};
\ No newline at end of file
index c7570a3..bd53c64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c4d=['Request','GetOpenchannelQueue','timeout','strategy','User','Agents','online','getOpenchannelQueues'];(function(_0x547d41,_0xd7369){var _0x766cec=function(_0x256a95){while(--_0x256a95){_0x547d41['push'](_0x547d41['shift']());}};_0x766cec(++_0xd7369);}(_0x1c4d,0x1d7));var _0xd1c4=function(_0x54b302,_0x24e8db){_0x54b302=_0x54b302-0x0;var _0x1abe5d=_0x1c4d[_0x54b302];return _0x1abe5d;};'use strict';var client=require('../client');exports[_0xd1c4('0x0')]=function(){return function(){return client[_0xd1c4('0x1')](_0xd1c4('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xd1c4('0x3'),_0xd1c4('0x4')],'include':[{'model':_0xd1c4('0x5'),'as':_0xd1c4('0x6'),'attributes':['id','name',_0xd1c4('0x7'),'openchannelPause']}]},'log':_0xd1c4('0x0')});};};
\ No newline at end of file
+var _0x1d81=['openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','User','Agents','online'];(function(_0x1cd1fa,_0x52f93e){var _0x21fcdf=function(_0x4cc352){while(--_0x4cc352){_0x1cd1fa['push'](_0x1cd1fa['shift']());}};_0x21fcdf(++_0x52f93e);}(_0x1d81,0x64));var _0x11d8=function(_0x2c4570,_0x21871d){_0x2c4570=_0x2c4570-0x0;var _0x26f4b0=_0x1d81[_0x2c4570];return _0x26f4b0;};'use strict';var client=require(_0x11d8('0x0'));exports[_0x11d8('0x1')]=function(){return function(){return client[_0x11d8('0x2')](_0x11d8('0x3'),{'options':{'raw':![],'attributes':['id',_0x11d8('0x4'),_0x11d8('0x5'),_0x11d8('0x6')],'include':[{'model':_0x11d8('0x7'),'as':_0x11d8('0x8'),'attributes':['id',_0x11d8('0x4'),_0x11d8('0x9'),_0x11d8('0xa')]}]},'log':_0x11d8('0x1')});};};
\ No newline at end of file
index 89f674f..3f5b48d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf10=['update','UpdateOpenchannelQueueReport','create','Request','CreateOpenchannelQueueReport'];(function(_0x1a0ed9,_0x50f7ed){var _0x593d01=function(_0x488f1a){while(--_0x488f1a){_0x1a0ed9['push'](_0x1a0ed9['shift']());}};_0x593d01(++_0x50f7ed);}(_0xdf10,0xcf));var _0x0df1=function(_0x554cc7,_0x1a99a4){_0x554cc7=_0x554cc7-0x0;var _0x43fd91=_0xdf10[_0x554cc7];return _0x43fd91;};'use strict';var client=require('../client');exports[_0x0df1('0x0')]=function(_0x42f93c){return client[_0x0df1('0x1')](_0x0df1('0x2'),{'body':_0x42f93c,'log':_0x0df1('0x2')});};exports[_0x0df1('0x3')]=function(_0x3365d2,_0x568367){return client['Request'](_0x0df1('0x4'),{'body':_0x568367,'options':{'where':{'uniqueid':_0x3365d2},'order':[['id','DESC']],'limit':0x1},'log':_0x0df1('0x4')});};
\ No newline at end of file
+var _0xa2f4=['Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','create'];(function(_0x35a563,_0x260e8a){var _0x3338d3=function(_0x1ffc5d){while(--_0x1ffc5d){_0x35a563['push'](_0x35a563['shift']());}};_0x3338d3(++_0x260e8a);}(_0xa2f4,0xa7));var _0x4a2f=function(_0x4dee2f,_0x460525){_0x4dee2f=_0x4dee2f-0x0;var _0x196f13=_0xa2f4[_0x4dee2f];return _0x196f13;};'use strict';var client=require('../client');exports[_0x4a2f('0x0')]=function(_0x5ba161){return client[_0x4a2f('0x1')](_0x4a2f('0x2'),{'body':_0x5ba161,'log':_0x4a2f('0x2')});};exports[_0x4a2f('0x3')]=function(_0x309404,_0x1fdf7d){return client[_0x4a2f('0x1')](_0x4a2f('0x4'),{'body':_0x1fdf7d,'options':{'where':{'uniqueid':_0x309404},'order':[['id',_0x4a2f('0x5')]],'limit':0x1},'log':_0x4a2f('0x4')});};
\ No newline at end of file
index 7b95eef..51e8578 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5640=['../client','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x2d20bb,_0x2e4bb6){var _0x576dd9=function(_0x1d596e){while(--_0x1d596e){_0x2d20bb['push'](_0x2d20bb['shift']());}};_0x576dd9(++_0x2e4bb6);}(_0x5640,0x111));var _0x0564=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5640[_0x502c7d];return _0x30b7ed;};'use strict';var client=require(_0x0564('0x0'));exports['update']=function(_0xaefcb6,_0x2b494e){return client[_0x0564('0x1')](_0x0564('0x2'),{'body':_0x2b494e,'options':{'where':{'id':_0xaefcb6}},'log':_0x0564('0x3')});};exports[_0x0564('0x4')]=function(_0x1cbb9d,_0x1c229d){return client[_0x0564('0x1')](_0x0564('0x5'),{'body':_0x1c229d,'options':{'where':{'id':_0x1cbb9d}},'log':_0x0564('0x6')});};
\ No newline at end of file
+var _0x41f2=['update','Request','UpdateSmsInteraction','updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x41f2,0x14f));var _0x241f=function(_0x5d3ec5,_0x47640f){_0x5d3ec5=_0x5d3ec5-0x0;var _0x34afe1=_0x41f2[_0x5d3ec5];return _0x34afe1;};'use strict';var client=require(_0x241f('0x0'));exports[_0x241f('0x1')]=function(_0x5736b8,_0x462fef){return client[_0x241f('0x2')](_0x241f('0x3'),{'body':_0x462fef,'options':{'where':{'id':_0x5736b8}},'log':_0x241f('0x4')});};exports['addTags']=function(_0x1a7e43,_0x106ee3){return client['Request'](_0x241f('0x5'),{'body':_0x106ee3,'options':{'where':{'id':_0x1a7e43}},'log':_0x241f('0x6')});};
\ No newline at end of file
index b162068..aa0a429 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60dd=['../client','CreateSmsMessage','createSmsMessage'];(function(_0x5c2206,_0x1bc105){var _0xfb9e38=function(_0x7da05d){while(--_0x7da05d){_0x5c2206['push'](_0x5c2206['shift']());}};_0xfb9e38(++_0x1bc105);}(_0x60dd,0xd8));var _0xd60d=function(_0x447689,_0x3bb340){_0x447689=_0x447689-0x0;var _0x4faee1=_0x60dd[_0x447689];return _0x4faee1;};'use strict';var client=require(_0xd60d('0x0'));exports['create']=function(_0x52facd){return client['Request'](_0xd60d('0x1'),{'body':_0x52facd,'log':_0xd60d('0x2')});};
\ No newline at end of file
+var _0xbaab=['createSmsMessage','../client','create','Request'];(function(_0x40fb1a,_0xc40248){var _0x5a7770=function(_0x487e52){while(--_0x487e52){_0x40fb1a['push'](_0x40fb1a['shift']());}};_0x5a7770(++_0xc40248);}(_0xbaab,0x16d));var _0xbbaa=function(_0x517672,_0x13e64f){_0x517672=_0x517672-0x0;var _0x2d3d29=_0xbaab[_0x517672];return _0x2d3d29;};'use strict';var client=require(_0xbbaa('0x0'));exports[_0xbbaa('0x1')]=function(_0x502160){return client[_0xbbaa('0x2')]('CreateSmsMessage',{'body':_0x502160,'log':_0xbbaa('0x3')});};
\ No newline at end of file
index e684666..9527202 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x42e435,_0x27dc76){var _0x12608d=function(_0x1513b1){while(--_0x1513b1){_0x42e435['push'](_0x42e435['shift']());}};_0x12608d(++_0x27dc76);}(_0x70e0,0x17b));var _0x070e=function(_0x462306,_0x12d758){_0x462306=_0x462306-0x0;var _0x4844b1=_0x70e0[_0x462306];return _0x4844b1;};'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
+var _0x9c44=['Request','GetSmsQueue','name','timeout','strategy','User','online','getSmsQueues'];(function(_0x50b4be,_0x17015c){var _0x4b9145=function(_0x2fa679){while(--_0x2fa679){_0x50b4be['push'](_0x50b4be['shift']());}};_0x4b9145(++_0x17015c);}(_0x9c44,0x178));var _0x49c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9c44[_0x167cc1];return _0x10bc4b;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'attributes':['id',_0x49c4('0x2'),_0x49c4('0x3'),_0x49c4('0x4')],'include':[{'model':_0x49c4('0x5'),'as':'Agents','attributes':['id','name',_0x49c4('0x6'),'smsPause']}]},'log':_0x49c4('0x7')});};};
\ No newline at end of file
index eac52f8..3651452 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x10a2a8,_0x4d75ec){var _0x4afe58=function(_0x585509){while(--_0x585509){_0x10a2a8['push'](_0x10a2a8['shift']());}};_0x4afe58(++_0x4d75ec);}(_0x9c44,0x178));var _0x49c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9c44[_0x167cc1];return _0x10bc4b;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});};
\ No newline at end of file
+var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x28c094,_0x4f54cd){var _0x331914=function(_0x365e88){while(--_0x365e88){_0x28c094['push'](_0x28c094['shift']());}};_0x331914(++_0x4f54cd);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'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 6aa7e0e..e88d4b3 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(_0x44bb08,_0x430252){var _0x50a189=function(_0x4e2d1e){while(--_0x4e2d1e){_0x44bb08['push'](_0x44bb08['shift']());}};_0x50a189(++_0x430252);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0x119902,_0x38a48f){var _0x1ba9ea=function(_0x1678cf){while(--_0x1678cf){_0x119902['push'](_0x119902['shift']());}};_0x1ba9ea(++_0x38a48f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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 48f37aa..a6e47b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7dee=['addTagsToWhatsappInteraction','../client','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x4eabdf,_0x32a512){var _0x1db9e4=function(_0x215930){while(--_0x215930){_0x4eabdf['push'](_0x4eabdf['shift']());}};_0x1db9e4(++_0x32a512);}(_0x7dee,0xb0));var _0xe7de=function(_0x45fda3,_0x80350e){_0x45fda3=_0x45fda3-0x0;var _0x3fc3da=_0x7dee[_0x45fda3];return _0x3fc3da;};'use strict';var client=require(_0xe7de('0x0'));exports['update']=function(_0x339ee2,_0x51419e){return client[_0xe7de('0x1')](_0xe7de('0x2'),{'body':_0x51419e,'options':{'where':{'id':_0x339ee2}},'log':_0xe7de('0x3')});};exports[_0xe7de('0x4')]=function(_0x4b846b,_0x12be83){return client['Request'](_0xe7de('0x5'),{'body':_0x12be83,'options':{'where':{'id':_0x4b846b}},'log':_0xe7de('0x6')});};
\ No newline at end of file
+var _0x4279=['addTagsToWhatsappInteraction','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x47e276,_0x558483){var _0x2a81cb=function(_0x3fc6c5){while(--_0x3fc6c5){_0x47e276['push'](_0x47e276['shift']());}};_0x2a81cb(++_0x558483);}(_0x4279,0x8d));var _0x9427=function(_0x559c9f,_0x5e7d6d){_0x559c9f=_0x559c9f-0x0;var _0x39682f=_0x4279[_0x559c9f];return _0x39682f;};'use strict';var client=require('../client');exports[_0x9427('0x0')]=function(_0x218ae7,_0x594cbc){return client[_0x9427('0x1')](_0x9427('0x2'),{'body':_0x594cbc,'options':{'where':{'id':_0x218ae7}},'log':_0x9427('0x3')});};exports[_0x9427('0x4')]=function(_0x54cdfb,_0x426911){return client['Request'](_0x9427('0x5'),{'body':_0x426911,'options':{'where':{'id':_0x54cdfb}},'log':_0x9427('0x6')});};
\ No newline at end of file
index 47ac909..feab7f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd604=['create','CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0xf1c3fe,_0x95bb08){var _0x34781e=function(_0x401a94){while(--_0x401a94){_0xf1c3fe['push'](_0xf1c3fe['shift']());}};_0x34781e(++_0x95bb08);}(_0xd604,0xe7));var _0x4d60=function(_0x2c220a,_0x3a460f){_0x2c220a=_0x2c220a-0x0;var _0x42d51b=_0xd604[_0x2c220a];return _0x42d51b;};'use strict';var client=require(_0x4d60('0x0'));exports[_0x4d60('0x1')]=function(_0x346f74){return client['Request'](_0x4d60('0x2'),{'body':_0x346f74,'log':_0x4d60('0x3')});};
\ No newline at end of file
+var _0xa6da=['createWhatsappMessage','../client','create','CreateWhatsappMessage'];(function(_0x41bdd4,_0x3d5c76){var _0x5c03a6=function(_0x59634a){while(--_0x59634a){_0x41bdd4['push'](_0x41bdd4['shift']());}};_0x5c03a6(++_0x3d5c76);}(_0xa6da,0x145));var _0xaa6d=function(_0x3d4edf,_0x5c1fa8){_0x3d4edf=_0x3d4edf-0x0;var _0x3221e7=_0xa6da[_0x3d4edf];return _0x3221e7;};'use strict';var client=require(_0xaa6d('0x0'));exports[_0xaa6d('0x1')]=function(_0x45f564){return client['Request'](_0xaa6d('0x2'),{'body':_0x45f564,'log':_0xaa6d('0x3')});};
\ No newline at end of file
index f8de650..eb38e77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x473d=['Request','GetWhatsappQueue','timeout','strategy','User','Agents','name','online','whatsappPause','../client','getWhatsappQueues'];(function(_0xa4ec2b,_0x111fb9){var _0x4b0cf5=function(_0x52c34f){while(--_0x52c34f){_0xa4ec2b['push'](_0xa4ec2b['shift']());}};_0x4b0cf5(++_0x111fb9);}(_0x473d,0x1cc));var _0xd473=function(_0x2dea74,_0x1fe55c){_0x2dea74=_0x2dea74-0x0;var _0x489a93=_0x473d[_0x2dea74];return _0x489a93;};'use strict';var client=require(_0xd473('0x0'));exports[_0xd473('0x1')]=function(){return function(){return client[_0xd473('0x2')](_0xd473('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xd473('0x4'),_0xd473('0x5')],'include':[{'model':_0xd473('0x6'),'as':_0xd473('0x7'),'attributes':['id',_0xd473('0x8'),_0xd473('0x9'),_0xd473('0xa')]}]},'log':_0xd473('0x1')});};};
\ No newline at end of file
+var _0xf2c8=['timeout','User','Agents','whatsappPause','getWhatsappQueues','Request','GetWhatsappQueue','name'];(function(_0x547add,_0x387042){var _0x2ed1f3=function(_0x3bbb4d){while(--_0x3bbb4d){_0x547add['push'](_0x547add['shift']());}};_0x2ed1f3(++_0x387042);}(_0xf2c8,0x12c));var _0x8f2c=function(_0x38827f,_0x1facb8){_0x38827f=_0x38827f-0x0;var _0x8f436d=_0xf2c8[_0x38827f];return _0x8f436d;};'use strict';var client=require('../client');exports[_0x8f2c('0x0')]=function(){return function(){return client[_0x8f2c('0x1')](_0x8f2c('0x2'),{'options':{'raw':![],'attributes':['id',_0x8f2c('0x3'),_0x8f2c('0x4'),'strategy'],'include':[{'model':_0x8f2c('0x5'),'as':_0x8f2c('0x6'),'attributes':['id',_0x8f2c('0x3'),'online',_0x8f2c('0x7')]}]},'log':_0x8f2c('0x0')});};};
\ No newline at end of file
index 4facc0b..e392423 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fa1=['../client','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC'];(function(_0x38894d,_0x1883d8){var _0x5614fe=function(_0x181989){while(--_0x181989){_0x38894d['push'](_0x38894d['shift']());}};_0x5614fe(++_0x1883d8);}(_0x2fa1,0x14a));var _0x12fa=function(_0x4702b8,_0x2f63c1){_0x4702b8=_0x4702b8-0x0;var _0x4ee3f1=_0x2fa1[_0x4702b8];return _0x4ee3f1;};'use strict';var client=require(_0x12fa('0x0'));exports['create']=function(_0x45d0ca){return client[_0x12fa('0x1')](_0x12fa('0x2'),{'body':_0x45d0ca,'log':_0x12fa('0x2')});};exports[_0x12fa('0x3')]=function(_0x5390c6,_0x1a258b){return client['Request'](_0x12fa('0x4'),{'body':_0x1a258b,'options':{'where':{'uniqueid':_0x5390c6},'order':[['id',_0x12fa('0x5')]],'limit':0x1},'log':_0x12fa('0x4')});};
\ No newline at end of file
+var _0xea98=['CreateWhatsappQueueReport','UpdateWhatsappQueueReport','../client','create','Request'];(function(_0x3560de,_0x28b150){var _0x2d31c1=function(_0x1c13d9){while(--_0x1c13d9){_0x3560de['push'](_0x3560de['shift']());}};_0x2d31c1(++_0x28b150);}(_0xea98,0x1b0));var _0x8ea9=function(_0x54a9b9,_0x31352f){_0x54a9b9=_0x54a9b9-0x0;var _0x2a34ef=_0xea98[_0x54a9b9];return _0x2a34ef;};'use strict';var client=require(_0x8ea9('0x0'));exports[_0x8ea9('0x1')]=function(_0x4ba209){return client[_0x8ea9('0x2')](_0x8ea9('0x3'),{'body':_0x4ba209,'log':_0x8ea9('0x3')});};exports['update']=function(_0x3b419b,_0x144034){return client[_0x8ea9('0x2')]('UpdateWhatsappQueueReport',{'body':_0x144034,'options':{'where':{'uniqueid':_0x3b419b},'order':[['id','DESC']],'limit':0x1},'log':_0x8ea9('0x4')});};
\ No newline at end of file
index bad24c1..3cd098b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a32=['[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','validate','lodash','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','agents','createQueue','atimeout','channel','format','START:%s','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','stop','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent'];(function(_0x5d8213,_0xeaa5b0){var _0x120493=function(_0x414814){while(--_0x414814){_0x5d8213['push'](_0x5d8213['shift']());}};_0x120493(++_0xeaa5b0);}(_0x0a32,0x1b0));var _0x20a3=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x0a32[_0x2be8c2];return _0x97f531;};'use strict';var schema=require(_0x20a3('0x0'));var _=require(_0x20a3('0x1'));var util=require('util');var seqqueue=require(_0x20a3('0x2'));var logger=require(_0x20a3('0x3'))(_0x20a3('0x4'));var strategy=require(_0x20a3('0x5'));var queue=schema({'name':{'type':_0x20a3('0x6'),'required':!![],'message':_0x20a3('0x7')},'timeout':{'type':_0x20a3('0x8'),'message':_0x20a3('0x9')}});function writeLog(_0x338bff,_0x6da72a,_0x13d808){return logger[_0x20a3('0xa')](util['format'](_0x20a3('0xb'),_0x338bff,_0x6da72a[_0x20a3('0xc')],_0x13d808));}function handleFindAgent(_0x4fee7c){return function(_0x329271){return _0x329271[_0x20a3('0xc')]['toLowerCase']()===_0x4fee7c[_0x20a3('0xd')]();};}exports[_0x20a3('0xe')]=function(_0x4ea4e8,_0x33f23a,_0x2138b6,_0x3682d5){return function(_0x10acbb){try{var _0x5a9b19={'name':_0x33f23a[0x0],'timeout':_0x33f23a[0x1]};var _0x181feb=queue['validate'](_0x5a9b19,{'typecast':!![]});if(_0x181feb[_0x20a3('0xf')]){logger[_0x20a3('0x10')](_0x20a3('0x11'),_0x4ea4e8,_[_0x20a3('0x12')](_0x181feb,_0x20a3('0x13'))[_0x20a3('0x14')](',\x20'));_0x10acbb['stop']();}else{var _0x730801=_['find'](_0x2138b6[_0x20a3('0x15')],handleFindAgent(_0x5a9b19[_0x20a3('0xc')]));if(_0x730801){var _0x17dc36=(_0x5a9b19['timeout']||0xa)*0x3e8;var _0x1c5282,_0x1e04d8;var _0x2dad18=seqqueue[_0x20a3('0x16')](_0x17dc36);_0x2dad18['id']=_0x4ea4e8;_0x2dad18[_0x20a3('0x17')]=_0x17dc36;_0x2dad18[_0x20a3('0x18')]=_0x3682d5[_0x20a3('0x18')];writeLog(_0x4ea4e8,_0x730801,util[_0x20a3('0x19')](_0x20a3('0x1a'),_0x17dc36));_0x2138b6['rules'][_0x4ea4e8]['on'](_0x20a3('0x1b'),function(){logger['info'](_0x20a3('0x1c'),_0x4ea4e8);clearTimeout(_0x1e04d8);_0x1e04d8=undefined;_0x2dad18[_0x20a3('0x1d')]();if(_0x2138b6[_0x20a3('0x1e')][_0x4ea4e8]){delete _0x2138b6['rules'][_0x4ea4e8];}_0x10acbb[_0x20a3('0x1f')]();});_0x2138b6[_0x20a3('0x1e')][_0x4ea4e8]['on'](_0x20a3('0x20'),function(){if(_0x2138b6[_0x20a3('0x1e')][_0x4ea4e8]){delete _0x2138b6[_0x20a3('0x1e')][_0x4ea4e8];}});_0x1e04d8=setTimeout(function(){logger[_0x20a3('0xa')](_0x20a3('0x21'),_0x4ea4e8);clearTimeout(_0x1e04d8);_0x2dad18[_0x20a3('0x1d')]();_0x10acbb[_0x20a3('0x22')]();},_0x17dc36);strategy[_0x20a3('0x23')](_0x2dad18,_0x730801,_0x2138b6,_0x3682d5);}else{logger['error'](_0x20a3('0x24'),_0x4ea4e8,_0x5a9b19[_0x20a3('0xc')]);_0x10acbb[_0x20a3('0x1f')]();}}}catch(_0x5e4dbc){console[_0x20a3('0x25')](_0x5e4dbc);logger[_0x20a3('0x10')]('[%s][QUEUE]\x20%s',_0x4ea4e8,_0x5e4dbc[_0x20a3('0x26')]);_0x10acbb[_0x20a3('0x1f')]();}};};
\ No newline at end of file
+var _0xd2df=['lodash','util','seq-queue','../../../../config/logger','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','name','toLowerCase','consequence','error','[%s][AGENT]\x20%s','map','stop','find','agents','timeout','createQueue','channel','START:%s','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate'];(function(_0x10e983,_0x2f4eda){var _0x324138=function(_0x17a377){while(--_0x17a377){_0x10e983['push'](_0x10e983['shift']());}};_0x324138(++_0x2f4eda);}(_0xd2df,0x175));var _0xfd2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2df[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0xfd2d('0x0'));var _=require(_0xfd2d('0x1'));var util=require(_0xfd2d('0x2'));var seqqueue=require(_0xfd2d('0x3'));var logger=require(_0xfd2d('0x4'))('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0xfd2d('0x5')},'timeout':{'type':_0xfd2d('0x6'),'message':_0xfd2d('0x7')}});function writeLog(_0x4d13ce,_0x4d1f3a,_0x5e4490){return logger[_0xfd2d('0x8')](util[_0xfd2d('0x9')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x4d13ce,_0x4d1f3a[_0xfd2d('0xa')],_0x5e4490));}function handleFindAgent(_0x353ded){return function(_0x17dd08){return _0x17dd08[_0xfd2d('0xa')][_0xfd2d('0xb')]()===_0x353ded[_0xfd2d('0xb')]();};}exports[_0xfd2d('0xc')]=function(_0x219200,_0x199ccf,_0x5b52d5,_0x2830e1){return function(_0xfb6647){try{var _0x2fde52={'name':_0x199ccf[0x0],'timeout':_0x199ccf[0x1]};var _0x2e6733=queue['validate'](_0x2fde52,{'typecast':!![]});if(_0x2e6733['length']){logger[_0xfd2d('0xd')](_0xfd2d('0xe'),_0x219200,_[_0xfd2d('0xf')](_0x2e6733,'message')['join'](',\x20'));_0xfb6647[_0xfd2d('0x10')]();}else{var _0x496ff4=_[_0xfd2d('0x11')](_0x5b52d5[_0xfd2d('0x12')],handleFindAgent(_0x2fde52[_0xfd2d('0xa')]));if(_0x496ff4){var _0x150711=(_0x2fde52[_0xfd2d('0x13')]||0xa)*0x3e8;var _0x212348,_0x1b56c4;var _0x2b0564=seqqueue[_0xfd2d('0x14')](_0x150711);_0x2b0564['id']=_0x219200;_0x2b0564['atimeout']=_0x150711;_0x2b0564[_0xfd2d('0x15')]=_0x2830e1[_0xfd2d('0x15')];writeLog(_0x219200,_0x496ff4,util[_0xfd2d('0x9')](_0xfd2d('0x16'),_0x150711));_0x5b52d5['rules'][_0x219200]['on'](_0xfd2d('0x17'),function(){logger[_0xfd2d('0x8')](_0xfd2d('0x18'),_0x219200);clearTimeout(_0x1b56c4);_0x1b56c4=undefined;_0x2b0564[_0xfd2d('0x19')]();if(_0x5b52d5[_0xfd2d('0x1a')][_0x219200]){delete _0x5b52d5[_0xfd2d('0x1a')][_0x219200];}_0xfb6647[_0xfd2d('0x10')]();});_0x5b52d5[_0xfd2d('0x1a')][_0x219200]['on']('complete',function(){if(_0x5b52d5[_0xfd2d('0x1a')][_0x219200]){delete _0x5b52d5[_0xfd2d('0x1a')][_0x219200];}});_0x1b56c4=setTimeout(function(){logger[_0xfd2d('0x8')](_0xfd2d('0x1b'),_0x219200);clearTimeout(_0x1b56c4);_0x2b0564[_0xfd2d('0x19')]();_0xfb6647[_0xfd2d('0x1c')]();},_0x150711);strategy[_0xfd2d('0x1d')](_0x2b0564,_0x496ff4,_0x5b52d5,_0x2830e1);}else{logger[_0xfd2d('0xd')](_0xfd2d('0x1e'),_0x219200,_0x2fde52[_0xfd2d('0xa')]);_0xfb6647[_0xfd2d('0x10')]();}}}catch(_0x4498f8){console[_0xfd2d('0x1f')](_0x4498f8);logger['error'](_0xfd2d('0x20'),_0x219200,_0x4498f8[_0xfd2d('0x21')]);_0xfb6647[_0xfd2d('0x10')]();}};};
\ No newline at end of file
index 5561252..23dc939 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd49=['../../rpc/faxMessage','consequence','isNil','info','[%s][AMAZONLEX]\x20%s','next','out','channel','sms','whatsapp','phone','interaction','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','isEmpty','body','getMustacheRender','Message','create','then','catch','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message','toString','postText','amazonlex','providerResponse','Failed','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage'];(function(_0xad4e5,_0x2d32f3){var _0x30c450=function(_0xbcf6ca){while(--_0xbcf6ca){_0xad4e5['push'](_0xad4e5['shift']());}};_0x30c450(++_0x2d32f3);}(_0xfd49,0x1d2));var _0x9fd4=function(_0x2a0555,_0x1407ba){_0x2a0555=_0x2a0555-0x0;var _0x25e012=_0xfd49[_0x2a0555];return _0x25e012;};'use strict';var _=require(_0x9fd4('0x0'));var moment=require('moment');var AWS=require('aws-sdk');var utils=require(_0x9fd4('0x1'));var logger=require(_0x9fd4('0x2'))(_0x9fd4('0x3'));var rpc={'chatMessage':require(_0x9fd4('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x9fd4('0x5')),'smsMessage':require(_0x9fd4('0x6')),'faxMessage':require(_0x9fd4('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x9fd4('0x8')]=function(_0x379fef,_0x120757){return function(_0x4ca5ad){try{if(!_[_0x9fd4('0x9')](this['interaction']['UserId'])){logger[_0x9fd4('0xa')](_0x9fd4('0xb'),_0x379fef,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x4ca5ad[_0x9fd4('0xc')]();}var _0x27f041={'ContactId':this['contact']['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x9fd4('0xd')};if(this[_0x9fd4('0xe')]===_0x9fd4('0xf')||this[_0x9fd4('0xe')]===_0x9fd4('0x10')){_0x27f041[_0x9fd4('0x11')]=this[_0x9fd4('0x12')][_0x9fd4('0x11')];}var _0x1e73fb=this[_0x9fd4('0xe')];if(_0x1e73fb==='chat'){_0x27f041[_0x9fd4('0x13')]=this[_0x9fd4('0x14')]['id'];}else{_0x27f041[_['upperFirst'](_0x1e73fb)+_0x9fd4('0x15')]=this[_0x9fd4('0x14')]['id'];}_0x27f041[_[_0x9fd4('0x16')](_0x1e73fb)+_0x9fd4('0x17')]=this['interaction']['id'];if(this[_0x9fd4('0x12')]['created']){var _0x5c2613=_0x120757[0x4];if(!_[_0x9fd4('0x18')](_0x5c2613)){_0x27f041[_0x9fd4('0x19')]=utils[_0x9fd4('0x1a')](_0x5c2613,this);return rpc[_0x1e73fb+_0x9fd4('0x1b')][_0x9fd4('0x1c')](_0x27f041)[_0x9fd4('0x1d')](function(_0x5d7605){logger[_0x9fd4('0xa')](_0x9fd4('0xb'),_0x379fef,_0x27f041[_0x9fd4('0x19')]);})[_0x9fd4('0x1e')](function(_0x4961bb){logger[_0x9fd4('0x1f')](_0x9fd4('0xb'),_0x379fef,JSON[_0x9fd4('0x20')](_0x4961bb));})['finally'](function(){logger[_0x9fd4('0xa')](_0x9fd4('0x21'),_0x379fef);_0x4ca5ad[_0x9fd4('0x22')]();});}else{logger[_0x9fd4('0xa')](_0x9fd4('0x23'),_0x379fef);_0x4ca5ad[_0x9fd4('0x22')]();}}else{var _0x5d2e8e=this;var _0x259788=new AWS[(_0x9fd4('0x24'))]({'accessKeyId':_0x120757[0x0],'secretAccessKey':_0x120757[0x1],'region':_0x120757[0x2]});var _0x3af36c={'botAlias':'$LATEST','botName':_0x120757[0x3],'inputText':this[_0x9fd4('0x25')][_0x9fd4('0x19')],'userId':this['channel']+':'+this[_0x9fd4('0x12')]['id'][_0x9fd4('0x26')]()};_0x259788[_0x9fd4('0x27')](_0x3af36c,function(_0x76a767,_0x2f9c60){if(_0x76a767){logger[_0x9fd4('0x1f')]('[%s][AMAZONLEX]\x20%s',_0x379fef,_0x76a767[_0x9fd4('0x25')]);_0x4ca5ad[_0x9fd4('0xc')]();}else if(_0x2f9c60&&_0x2f9c60['message']){_0x5d2e8e[_0x9fd4('0x19')][_0x9fd4('0x28')]=_0x2f9c60;_0x27f041[_0x9fd4('0x19')]=_0x2f9c60[_0x9fd4('0x25')];_0x27f041['providerName']=_0x9fd4('0x28');_0x27f041[_0x9fd4('0x29')]=JSON['stringify'](_0x2f9c60);return rpc[_0x1e73fb+_0x9fd4('0x1b')][_0x9fd4('0x1c')](_0x27f041)['then'](function(_0x2bf839){logger[_0x9fd4('0xa')](_0x9fd4('0xb'),_0x379fef,_0x27f041['body']);if(_0x2f9c60['dialogState']==_0x9fd4('0x2a')){_0x4ca5ad['next']();}else{_0x4ca5ad[_0x9fd4('0x22')]();}})[_0x9fd4('0x1e')](function(_0x5a1620){logger[_0x9fd4('0x1f')](_0x9fd4('0xb'),_0x379fef,JSON[_0x9fd4('0x20')](_0x5a1620));_0x4ca5ad['next']();});}else{_0x4ca5ad[_0x9fd4('0xc')]();}});}}catch(_0xdc2f5c){logger['error'](_0x9fd4('0xb'),_0x379fef,JSON['stringify'](_0xdc2f5c));_0x4ca5ad[_0x9fd4('0x22')]();}};};
\ No newline at end of file
+var _0x777b=['../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','isEmpty','getMustacheRender','Message','[%s][AMAZONLEX]\x20%s','body','stringify','stop','LexRuntime','$LATEST','message','toString','error','amazonlex','providerName','dialogState','Failed','lodash','moment','aws-sdk','./utils'];(function(_0x10e22b,_0x241a9e){var _0x7770fa=function(_0xbbd7b6){while(--_0xbbd7b6){_0x10e22b['push'](_0x10e22b['shift']());}};_0x7770fa(++_0x241a9e);}(_0x777b,0x116));var _0xb777=function(_0x5185fa,_0x5be2a4){_0x5185fa=_0x5185fa-0x0;var _0x759ce1=_0x777b[_0x5185fa];return _0x759ce1;};'use strict';var _=require(_0xb777('0x0'));var moment=require(_0xb777('0x1'));var AWS=require(_0xb777('0x2'));var utils=require(_0xb777('0x3'));var logger=require(_0xb777('0x4'))(_0xb777('0x5'));var rpc={'chatMessage':require(_0xb777('0x6')),'openchannelMessage':require(_0xb777('0x7')),'mailMessage':require(_0xb777('0x8')),'smsMessage':require(_0xb777('0x9')),'faxMessage':require(_0xb777('0xa')),'whatsappMessage':require(_0xb777('0xb'))};exports[_0xb777('0xc')]=function(_0x2b2858,_0x55b886){return function(_0x296d3a){try{if(!_[_0xb777('0xd')](this[_0xb777('0xe')][_0xb777('0xf')])){logger[_0xb777('0x10')]('[%s][AMAZONLEX]\x20%s',_0x2b2858,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x296d3a[_0xb777('0x11')]();}var _0x34a745={'ContactId':this[_0xb777('0x12')]['id'],'sentAt':moment()[_0xb777('0x13')](_0xb777('0x14')),'direction':_0xb777('0x15')};if(this[_0xb777('0x16')]===_0xb777('0x17')||this[_0xb777('0x16')]===_0xb777('0x18')){_0x34a745[_0xb777('0x19')]=this[_0xb777('0xe')]['phone'];}var _0xa93e14=this[_0xb777('0x16')];if(_0xa93e14===_0xb777('0x1a')){_0x34a745[_0xb777('0x1b')]=this[_0xb777('0x1c')]['id'];}else{_0x34a745[_[_0xb777('0x1d')](_0xa93e14)+_0xb777('0x1e')]=this[_0xb777('0x1c')]['id'];}_0x34a745[_[_0xb777('0x1d')](_0xa93e14)+'InteractionId']=this[_0xb777('0xe')]['id'];if(this['interaction']['created']){var _0x547120=_0x55b886[0x4];if(!_[_0xb777('0x1f')](_0x547120)){_0x34a745['body']=utils[_0xb777('0x20')](_0x547120,this);return rpc[_0xa93e14+_0xb777('0x21')]['create'](_0x34a745)['then'](function(_0xb10096){logger[_0xb777('0x10')](_0xb777('0x22'),_0x2b2858,_0x34a745[_0xb777('0x23')]);})['catch'](function(_0x42e49d){logger['error'](_0xb777('0x22'),_0x2b2858,JSON[_0xb777('0x24')](_0x42e49d));})['finally'](function(){logger[_0xb777('0x10')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x2b2858);_0x296d3a[_0xb777('0x25')]();});}else{logger[_0xb777('0x10')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x2b2858);_0x296d3a[_0xb777('0x25')]();}}else{var _0x1ef8ef=this;var _0xabe233=new AWS[(_0xb777('0x26'))]({'accessKeyId':_0x55b886[0x0],'secretAccessKey':_0x55b886[0x1],'region':_0x55b886[0x2]});var _0x5085fc={'botAlias':_0xb777('0x27'),'botName':_0x55b886[0x3],'inputText':this[_0xb777('0x28')]['body'],'userId':this['channel']+':'+this[_0xb777('0xe')]['id'][_0xb777('0x29')]()};_0xabe233['postText'](_0x5085fc,function(_0x5a8649,_0x24502f){if(_0x5a8649){logger[_0xb777('0x2a')]('[%s][AMAZONLEX]\x20%s',_0x2b2858,_0x5a8649[_0xb777('0x28')]);_0x296d3a['next']();}else if(_0x24502f&&_0x24502f['message']){_0x1ef8ef[_0xb777('0x23')][_0xb777('0x2b')]=_0x24502f;_0x34a745[_0xb777('0x23')]=_0x24502f[_0xb777('0x28')];_0x34a745[_0xb777('0x2c')]='amazonlex';_0x34a745['providerResponse']=JSON[_0xb777('0x24')](_0x24502f);return rpc[_0xa93e14+_0xb777('0x21')]['create'](_0x34a745)['then'](function(_0x316a7b){logger[_0xb777('0x10')](_0xb777('0x22'),_0x2b2858,_0x34a745[_0xb777('0x23')]);if(_0x24502f[_0xb777('0x2d')]==_0xb777('0x2e')){_0x296d3a['next']();}else{_0x296d3a['stop']();}})['catch'](function(_0x266da3){logger[_0xb777('0x2a')]('[%s][AMAZONLEX]\x20%s',_0x2b2858,JSON[_0xb777('0x24')](_0x266da3));_0x296d3a[_0xb777('0x11')]();});}else{_0x296d3a[_0xb777('0x11')]();}});}}catch(_0x3fc1a2){logger[_0xb777('0x2a')](_0xb777('0x22'),_0x2b2858,JSON['stringify'](_0x3fc1a2));_0x296d3a[_0xb777('0x25')]();}};};
\ No newline at end of file
index 9c0beb3..1f9f91a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed5a=['../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','format','out','channel','getMustacheRender','message','from','phone','read','subject','Re:','chat','ChatWebsiteId','account','InteractionId','Message','inReplyTo','messageId','html','<div\x20id=\x22xm-mail-content\x22>','replace','<div','auto-replied','All','auto_reply','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','autoreplyExecuted','Interaction','update','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xed5a,0x13b));var _0xaed5=function(_0x3203a1,_0x46c498){_0x3203a1=_0x3203a1-0x0;var _0x24215e=_0xed5a[_0x3203a1];return _0x24215e;};'use strict';var _=require('lodash');var moment=require(_0xaed5('0x0'));var utils=require(_0xaed5('0x1'));var logger=require(_0xaed5('0x2'))(_0xaed5('0x3'));var rpc={'chatMessage':require(_0xaed5('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xaed5('0x5')),'smsMessage':require(_0xaed5('0x6')),'faxMessage':require(_0xaed5('0x7')),'whatsappMessage':require(_0xaed5('0x8')),'chatInteraction':require(_0xaed5('0x9')),'openchannelInteraction':require(_0xaed5('0xa')),'mailInteraction':require(_0xaed5('0xb')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0xaed5('0xc')),'whatsappInteraction':require(_0xaed5('0xd'))};var mailRpc=require(_0xaed5('0xe'));exports['consequence']=function(_0x4324cf,_0xdbae61,_0x361dad,_0x1104c4){return function(_0x4e83a0){try{var _0x56fe83=this['channel'];if(_0x56fe83===_0xaed5('0xf')&&_0x1104c4[_0xaed5('0x10')][_0xaed5('0x11')]){logger[_0xaed5('0x12')](_0xaed5('0x13'),_0x4324cf,_0xaed5('0x14'));return _0x4e83a0[_0xaed5('0x15')]();}if(_0xdbae61[0x0]==='1'&&(_[_0xaed5('0x16')](this[_0xaed5('0x17')][_0xaed5('0x18')])||!this[_0xaed5('0x17')][_0xaed5('0x18')])){logger[_0xaed5('0x12')](_0xaed5('0x13'),_0x4324cf,'Autoreply\x20already\x20sent');return _0x4e83a0['next']();}if(_0xdbae61[0x0]==='2'&&this[_0xaed5('0x17')]['autoreplyExecuted']){logger[_0xaed5('0x12')](_0xaed5('0x19'),_0x4324cf,_0xaed5('0x1a'));return _0x4e83a0[_0xaed5('0x15')]();}var _0x135d28={'ContactId':this['contact']['id'],'sentAt':moment()[_0xaed5('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xaed5('0x1c')};if(this[_0xaed5('0x1d')]===_0xaed5('0xf')){_0x135d28[_0xaed5('0x10')]=utils['getMustacheRender'](_0xdbae61[0x2],this);}else{_0x135d28[_0xaed5('0x10')]=utils[_0xaed5('0x1e')](_0xdbae61[0x1],this);}if(this[_0xaed5('0x1f')]){_0x135d28['to']=this[_0xaed5('0x1f')][_0xaed5('0x20')]||'';if(this[_0xaed5('0x1d')]===_0xaed5('0xf')&&_0xdbae61[0x1]==='1'){_0x135d28['cc']=this[_0xaed5('0x1f')]['cc']||'';}_0x135d28[_0xaed5('0x20')]=this[_0xaed5('0x1f')]['to']||'';_0x135d28[_0xaed5('0x21')]=this[_0xaed5('0x1f')]['phone']||'';_0x135d28[_0xaed5('0x22')]=!![];if(this[_0xaed5('0x1f')][_0xaed5('0x23')]){_0x135d28[_0xaed5('0x23')]='';_0x135d28['subject']+=_['startsWith'](this[_0xaed5('0x1f')][_0xaed5('0x23')],_0xaed5('0x24'))?'':'Re:\x20';_0x135d28['subject']+=this[_0xaed5('0x1f')][_0xaed5('0x23')];}}if(this[_0xaed5('0x1d')]===_0xaed5('0x25')){_0x135d28[_0xaed5('0x26')]=this[_0xaed5('0x27')]['id'];}else{_0x135d28[_['upperFirst'](this[_0xaed5('0x1d')])+'AccountId']=this['account']['id'];}_0x135d28[_['upperFirst'](this[_0xaed5('0x1d')])+_0xaed5('0x28')]=this[_0xaed5('0x17')]['id'];var _0x8ac82=this[_0xaed5('0x17')];if(rpc[this[_0xaed5('0x1d')]+_0xaed5('0x29')]){if(this[_0xaed5('0x1d')]===_0xaed5('0xf')){_0x135d28[_0xaed5('0x2a')]=this['message'][_0xaed5('0x2b')];_0x135d28[_0xaed5('0x2c')]=_0xaed5('0x2d')+_[_0xaed5('0x2e')](_0x135d28[_0xaed5('0x10')],'<div\x20id=\x22xm-mail-content\x22',_0xaed5('0x2f'))+'</div>';_0x135d28['headers']={'Auto-Submitted':_0xaed5('0x30'),'X-Auto-Response-Suppress':_0xaed5('0x31'),'Precedence':_0xaed5('0x32')};return mailRpc['sendMailMessage'](this[_0xaed5('0x27')]['smtpOptions'],_0x135d28)['then'](function(_0x101867){logger[_0xaed5('0x12')](_0xaed5('0x33'),_0x4324cf);_0x135d28['messageId']=_0x101867[_0xaed5('0x1f')][_0xaed5('0x2b')];return rpc[_0x56fe83+_0xaed5('0x29')][_0xaed5('0x34')](_0x135d28);})[_0xaed5('0x35')](function(_0x275d4b){logger[_0xaed5('0x12')](_0xaed5('0x13'),_0x4324cf,JSON[_0xaed5('0x36')](_0x275d4b));})['catch'](function(_0x535943){logger[_0xaed5('0x37')](_0xaed5('0x38'),_0x4324cf,JSON['stringify'](_0x535943));})[_0xaed5('0x39')](function(){Promise[_0xaed5('0x3a')]()[_0xaed5('0x35')](function(){if(_0xdbae61[0x0]!=='2'||_0x8ac82[_0xaed5('0x3b')])return;return rpc[_0x56fe83+_0xaed5('0x3c')][_0xaed5('0x3d')](_0x8ac82['id'],{'autoreplyExecuted':!![]})[_0xaed5('0x35')](function(_0x31e3e6){logger[_0xaed5('0x12')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4324cf,JSON[_0xaed5('0x36')](_0x31e3e6));})[_0xaed5('0x3e')](function(_0x1d4f4d){logger[_0xaed5('0x37')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4324cf,JSON[_0xaed5('0x36')](_0x1d4f4d));});})['then'](function(){_0x4e83a0[_0xaed5('0x15')]();});});}else{return rpc[this['channel']+_0xaed5('0x29')][_0xaed5('0x34')](_0x135d28)[_0xaed5('0x35')](function(){logger[_0xaed5('0x12')](_0xaed5('0x13'),_0x4324cf,_0x135d28[_0xaed5('0x10')]);})[_0xaed5('0x3e')](function(_0x22a9c0){logger[_0xaed5('0x37')]('[%s][AUTOREPLY]\x20%s',_0x4324cf,JSON[_0xaed5('0x36')](_0x22a9c0));})[_0xaed5('0x39')](function(){Promise[_0xaed5('0x3a')]()['then'](function(){if(_0xdbae61[0x0]!=='2'||_0x8ac82[_0xaed5('0x3b')])return;return rpc[_0x56fe83+_0xaed5('0x3c')][_0xaed5('0x3d')](_0x8ac82['id'],{'autoreplyExecuted':!![]})[_0xaed5('0x35')](function(_0x3cd66b){logger[_0xaed5('0x12')](_0xaed5('0x19'),_0x4324cf,JSON[_0xaed5('0x36')](_0x3cd66b));})[_0xaed5('0x3e')](function(_0x8d027a){logger[_0xaed5('0x37')](_0xaed5('0x3f'),_0x4324cf,JSON[_0xaed5('0x36')](_0x8d027a));});})[_0xaed5('0x35')](function(){_0x4e83a0[_0xaed5('0x15')]();});});}}}catch(_0x43d0f9){logger['error'](_0xaed5('0x13'),_0x4324cf,JSON[_0xaed5('0x36')](_0x43d0f9));_0x4e83a0[_0xaed5('0x40')]();}};};
\ No newline at end of file
+var _0x3d6e=['Re:\x20','chat','account','upperFirst','AccountId','html','replace','<div\x20id=\x22xm-mail-content\x22','</div>','auto-replied','auto_reply','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','Message','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','resolve','Interaction','update','create','stop','lodash','moment','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','info','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','subject','startsWith','Re:'];(function(_0x17e72a,_0x4243dd){var _0xf74359=function(_0x3975e0){while(--_0x3975e0){_0x17e72a['push'](_0x17e72a['shift']());}};_0xf74359(++_0x4243dd);}(_0x3d6e,0x9a));var _0xe3d6=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x3d6e[_0x34843e];return _0x598f7f;};'use strict';var _=require(_0xe3d6('0x0'));var moment=require(_0xe3d6('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0xe3d6('0x2')),'openchannelMessage':require(_0xe3d6('0x3')),'mailMessage':require(_0xe3d6('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xe3d6('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0xe3d6('0x6')),'openchannelInteraction':require(_0xe3d6('0x7')),'mailInteraction':require(_0xe3d6('0x8')),'smsInteraction':require(_0xe3d6('0x9')),'faxInteraction':require(_0xe3d6('0xa')),'whatsappInteraction':require(_0xe3d6('0xb'))};var mailRpc=require(_0xe3d6('0xc'));exports[_0xe3d6('0xd')]=function(_0x1eb36c,_0x5cb603,_0xaaa151,_0x17290c){return function(_0x8985f8){try{var _0x3cfea9=this[_0xe3d6('0xe')];if(_0x3cfea9===_0xe3d6('0xf')&&_0x17290c[_0xe3d6('0x10')][_0xe3d6('0x11')]){logger['info'](_0xe3d6('0x12'),_0x1eb36c,_0xe3d6('0x13'));return _0x8985f8[_0xe3d6('0x14')]();}if(_0x5cb603[0x0]==='1'&&(_[_0xe3d6('0x15')](this[_0xe3d6('0x16')][_0xe3d6('0x17')])||!this[_0xe3d6('0x16')][_0xe3d6('0x17')])){logger[_0xe3d6('0x18')]('[%s][AUTOREPLY]\x20%s',_0x1eb36c,'Autoreply\x20already\x20sent');return _0x8985f8['next']();}if(_0x5cb603[0x0]==='2'&&this[_0xe3d6('0x16')][_0xe3d6('0x19')]){logger['info'](_0xe3d6('0x1a'),_0x1eb36c,_0xe3d6('0x1b'));return _0x8985f8[_0xe3d6('0x14')]();}var _0x218992={'ContactId':this[_0xe3d6('0x1c')]['id'],'sentAt':moment()['format'](_0xe3d6('0x1d')),'direction':_0xe3d6('0x1e')};if(this['channel']==='mail'){_0x218992[_0xe3d6('0x10')]=utils['getMustacheRender'](_0x5cb603[0x2],this);}else{_0x218992['body']=utils[_0xe3d6('0x1f')](_0x5cb603[0x1],this);}if(this[_0xe3d6('0x20')]){_0x218992['to']=this[_0xe3d6('0x20')][_0xe3d6('0x21')]||'';if(this[_0xe3d6('0xe')]==='mail'&&_0x5cb603[0x1]==='1'){_0x218992['cc']=this[_0xe3d6('0x20')]['cc']||'';}_0x218992['from']=this[_0xe3d6('0x20')]['to']||'';_0x218992[_0xe3d6('0x22')]=this['message']['phone']||'';_0x218992['read']=!![];if(this[_0xe3d6('0x20')][_0xe3d6('0x23')]){_0x218992[_0xe3d6('0x23')]='';_0x218992['subject']+=_[_0xe3d6('0x24')](this[_0xe3d6('0x20')][_0xe3d6('0x23')],_0xe3d6('0x25'))?'':_0xe3d6('0x26');_0x218992[_0xe3d6('0x23')]+=this['message'][_0xe3d6('0x23')];}}if(this[_0xe3d6('0xe')]===_0xe3d6('0x27')){_0x218992['ChatWebsiteId']=this[_0xe3d6('0x28')]['id'];}else{_0x218992[_[_0xe3d6('0x29')](this[_0xe3d6('0xe')])+_0xe3d6('0x2a')]=this[_0xe3d6('0x28')]['id'];}_0x218992[_[_0xe3d6('0x29')](this['channel'])+'InteractionId']=this['interaction']['id'];var _0x110039=this['interaction'];if(rpc[this[_0xe3d6('0xe')]+'Message']){if(this[_0xe3d6('0xe')]===_0xe3d6('0xf')){_0x218992['inReplyTo']=this[_0xe3d6('0x20')]['messageId'];_0x218992[_0xe3d6('0x2b')]='<div\x20id=\x22xm-mail-content\x22>'+_[_0xe3d6('0x2c')](_0x218992[_0xe3d6('0x10')],_0xe3d6('0x2d'),'<div')+_0xe3d6('0x2e');_0x218992['headers']={'Auto-Submitted':_0xe3d6('0x2f'),'X-Auto-Response-Suppress':'All','Precedence':_0xe3d6('0x30')};return mailRpc[_0xe3d6('0x31')](this[_0xe3d6('0x28')][_0xe3d6('0x32')],_0x218992)[_0xe3d6('0x33')](function(_0x126e68){logger[_0xe3d6('0x18')](_0xe3d6('0x34'),_0x1eb36c);_0x218992[_0xe3d6('0x35')]=_0x126e68[_0xe3d6('0x20')][_0xe3d6('0x35')];return rpc[_0x3cfea9+_0xe3d6('0x36')]['create'](_0x218992);})['then'](function(_0xdcb989){logger['info'](_0xe3d6('0x12'),_0x1eb36c,JSON[_0xe3d6('0x37')](_0xdcb989));})[_0xe3d6('0x38')](function(_0x5790c0){logger[_0xe3d6('0x39')](_0xe3d6('0x3a'),_0x1eb36c,JSON['stringify'](_0x5790c0));})['finally'](function(){Promise[_0xe3d6('0x3b')]()[_0xe3d6('0x33')](function(){if(_0x5cb603[0x0]!=='2'||_0x110039[_0xe3d6('0x19')])return;return rpc[_0x3cfea9+_0xe3d6('0x3c')][_0xe3d6('0x3d')](_0x110039['id'],{'autoreplyExecuted':!![]})[_0xe3d6('0x33')](function(_0x31b820){logger[_0xe3d6('0x18')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x1eb36c,JSON[_0xe3d6('0x37')](_0x31b820));})[_0xe3d6('0x38')](function(_0x3f1388){logger[_0xe3d6('0x39')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x1eb36c,JSON['stringify'](_0x3f1388));});})[_0xe3d6('0x33')](function(){_0x8985f8[_0xe3d6('0x14')]();});});}else{return rpc[this[_0xe3d6('0xe')]+_0xe3d6('0x36')][_0xe3d6('0x3e')](_0x218992)[_0xe3d6('0x33')](function(){logger[_0xe3d6('0x18')]('[%s][AUTOREPLY]\x20%s',_0x1eb36c,_0x218992[_0xe3d6('0x10')]);})[_0xe3d6('0x38')](function(_0x288826){logger[_0xe3d6('0x39')](_0xe3d6('0x12'),_0x1eb36c,JSON[_0xe3d6('0x37')](_0x288826));})['finally'](function(){Promise[_0xe3d6('0x3b')]()[_0xe3d6('0x33')](function(){if(_0x5cb603[0x0]!=='2'||_0x110039[_0xe3d6('0x19')])return;return rpc[_0x3cfea9+'Interaction'][_0xe3d6('0x3d')](_0x110039['id'],{'autoreplyExecuted':!![]})['then'](function(_0x412d6f){logger[_0xe3d6('0x18')](_0xe3d6('0x1a'),_0x1eb36c,JSON[_0xe3d6('0x37')](_0x412d6f));})[_0xe3d6('0x38')](function(_0x41d1ea){logger[_0xe3d6('0x39')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x1eb36c,JSON[_0xe3d6('0x37')](_0x41d1ea));});})[_0xe3d6('0x33')](function(){_0x8985f8[_0xe3d6('0x14')]();});});}}}catch(_0x2b435d){logger[_0xe3d6('0x39')](_0xe3d6('0x12'),_0x1eb36c,JSON['stringify'](_0x2b435d));_0x8985f8[_0xe3d6('0x3f')]();}};};
\ No newline at end of file
index 3cd9bfd..b4f9e11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa25a=['routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','[%s][CLOSE]\x20%s','stringify','finally','stop','error','../../../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa25a,0x14f));var _0xaa25=function(_0x47c7ad,_0x39c900){_0x47c7ad=_0x47c7ad-0x0;var _0x1ed093=_0xa25a[_0x47c7ad];return _0x1ed093;};'use strict';var moment=require('moment');var logger=require(_0xaa25('0x0'))(_0xaa25('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xaa25('0x2')),'smsInteraction':require(_0xaa25('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xaa25('0x4')),'whatsappInteraction':require(_0xaa25('0x5'))};exports[_0xaa25('0x6')]=function(_0x3878f5,_0x2bada9,_0x3a7115,_0x14a4dd){return function(_0x2f0c14){try{logger[_0xaa25('0x7')](_0xaa25('0x8'),_0x3878f5,_0x2bada9[0x0]);var _0x4b2e2a={'closed':0x1,'closedAt':moment()[_0xaa25('0x9')](_0xaa25('0xa')),'closeReason':_0xaa25('0xb'),'disposition':_0x2bada9[0x0]};if(rpc[_0x14a4dd[_0xaa25('0xc')]+_0xaa25('0xd')]){rpc[_0x14a4dd[_0xaa25('0xc')]+_0xaa25('0xd')][_0xaa25('0xe')](_0x14a4dd[_0xaa25('0xf')]['id'],_0x4b2e2a)[_0xaa25('0x10')](function(_0x42435e){logger[_0xaa25('0x7')](_0xaa25('0x11'),_0x3878f5,_0x14a4dd[_0xaa25('0xf')]['id']);})[_0xaa25('0x12')](function(_0x4bf26b){logger['error'](_0xaa25('0x13'),_0x3878f5,JSON[_0xaa25('0x14')](_0x4bf26b));})[_0xaa25('0x15')](function(){_0x2f0c14[_0xaa25('0x16')]();});}}catch(_0x1dd238){logger[_0xaa25('0x17')](_0xaa25('0x13'),_0x3878f5,JSON[_0xaa25('0x14')](_0x1dd238));_0x2f0c14[_0xaa25('0x16')]();}};};
\ No newline at end of file
+var _0x4544=['../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','info','format','YYYY-MM-DD\x20HH:mm:ss','Interaction','channel','update','interaction','error','stringify','finally','moment','../../../../config/logger','routing'];(function(_0x45fe9c,_0x55e0d7){var _0x233d48=function(_0xa2ba2e){while(--_0xa2ba2e){_0x45fe9c['push'](_0x45fe9c['shift']());}};_0x233d48(++_0x55e0d7);}(_0x4544,0x12f));var _0x4454=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4544[_0x4565bf];return _0x5610ba;};'use strict';var moment=require(_0x4454('0x0'));var logger=require(_0x4454('0x1'))(_0x4454('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x4454('0x3')),'smsInteraction':require(_0x4454('0x4')),'mailInteraction':require(_0x4454('0x5')),'faxInteraction':require(_0x4454('0x6')),'whatsappInteraction':require(_0x4454('0x7'))};exports['consequence']=function(_0x7186ec,_0x2e9fb3,_0x4a4d24,_0x491553){return function(_0x361299){try{logger[_0x4454('0x8')]('[%s][CLOSE]\x20reason\x20%s',_0x7186ec,_0x2e9fb3[0x0]);var _0x370631={'closed':0x1,'closedAt':moment()[_0x4454('0x9')](_0x4454('0xa')),'closeReason':'system','disposition':_0x2e9fb3[0x0]};if(rpc[_0x491553['channel']+_0x4454('0xb')]){rpc[_0x491553[_0x4454('0xc')]+_0x4454('0xb')][_0x4454('0xd')](_0x491553['interaction']['id'],_0x370631)['then'](function(_0x31d891){logger[_0x4454('0x8')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x7186ec,_0x491553[_0x4454('0xe')]['id']);})['catch'](function(_0x4c64c7){logger[_0x4454('0xf')]('[%s][CLOSE]\x20%s',_0x7186ec,JSON[_0x4454('0x10')](_0x4c64c7));})[_0x4454('0x11')](function(){_0x361299['stop']();});}}catch(_0x59c48a){logger['error']('[%s][CLOSE]\x20%s',_0x7186ec,JSON[_0x4454('0x10')](_0x59c48a));_0x361299['stop']();}};};
\ No newline at end of file
index ada9380..de7c392 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74f3=['stringify','then','result','metadata','endConversation','error','lodash','moment','apiai-promise','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','chat','account','AccountId','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','info','catch','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','message','dialogflow','fulfillment'];(function(_0x349bf5,_0x2ae5bd){var _0x2a3e8a=function(_0x2ec1b6){while(--_0x2ec1b6){_0x349bf5['push'](_0x349bf5['shift']());}};_0x2a3e8a(++_0x2ae5bd);}(_0x74f3,0x164));var _0x374f=function(_0x2f3815,_0x20b9bd){_0x2f3815=_0x2f3815-0x0;var _0x26ef40=_0x74f3[_0x2f3815];return _0x26ef40;};'use strict';var _=require(_0x374f('0x0'));var moment=require(_0x374f('0x1'));var apiai=require(_0x374f('0x2'));var md5=require('md5');var utils=require(_0x374f('0x3'));var logger=require(_0x374f('0x4'))(_0x374f('0x5'));var rpc={'chatMessage':require(_0x374f('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x374f('0x7')),'smsMessage':require(_0x374f('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x374f('0x9'))};exports[_0x374f('0xa')]=function(_0x405e93,_0x407df1){return function(_0x3bcc86){try{if(!_[_0x374f('0xb')](this[_0x374f('0xc')][_0x374f('0xd')])){logger['info'](_0x374f('0xe'),_0x405e93,_0x374f('0xf'));return _0x3bcc86[_0x374f('0x10')]();}var _0x272059={'ContactId':this[_0x374f('0x11')]['id'],'sentAt':moment()['format'](_0x374f('0x12')),'direction':_0x374f('0x13')};if(this['channel']===_0x374f('0x14')||this[_0x374f('0x15')]===_0x374f('0x16')){_0x272059['phone']=this[_0x374f('0xc')][_0x374f('0x17')];}var _0x579d1b=this[_0x374f('0x15')];if(_0x579d1b===_0x374f('0x18')){_0x272059['ChatWebsiteId']=this[_0x374f('0x19')]['id'];}else{_0x272059[_['upperFirst'](_0x579d1b)+_0x374f('0x1a')]=this[_0x374f('0x19')]['id'];}_0x272059[_[_0x374f('0x1b')](_0x579d1b)+_0x374f('0x1c')]=this[_0x374f('0xc')]['id'];if(this[_0x374f('0xc')][_0x374f('0x1d')]){var _0x9b6be5=_0x407df1[0x2];if(!_[_0x374f('0x1e')](_0x9b6be5)){_0x272059[_0x374f('0x1f')]=utils[_0x374f('0x20')](_0x9b6be5,this);return rpc[_0x579d1b+_0x374f('0x21')][_0x374f('0x22')](_0x272059)['then'](function(_0x55eb4f){logger[_0x374f('0x23')]('[%s][DIALOGFLOW]\x20%s',_0x405e93,_0x272059[_0x374f('0x1f')]);})[_0x374f('0x24')](function(_0x1fd21f){logger['error'](_0x374f('0xe'),_0x405e93,JSON['stringify'](_0x1fd21f));})[_0x374f('0x25')](function(){logger[_0x374f('0x23')](_0x374f('0x26'),_0x405e93);_0x3bcc86['stop']();});}else{logger[_0x374f('0x23')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x405e93);_0x3bcc86[_0x374f('0x27')]();}}else{var _0x27b9ae=this;var _0x2de93d=apiai(_0x407df1[0x0],{'language':_0x407df1[0x1]||'en'});return _0x2de93d[_0x374f('0x28')](this[_0x374f('0x29')][_0x374f('0x1f')],{'sessionId':md5(this['interaction']['id'])})['then'](function(_0x1146a3){_0x27b9ae[_0x374f('0x1f')][_0x374f('0x2a')]=_0x1146a3;_0x272059['body']=_0x1146a3['result'][_0x374f('0x2b')]['speech'];_0x272059['providerName']='dialogflow';_0x272059['providerResponse']=JSON[_0x374f('0x2c')](_0x1146a3);return rpc[_0x579d1b+_0x374f('0x21')]['create'](_0x272059)[_0x374f('0x2d')](function(_0xc69c14){logger[_0x374f('0x23')](_0x374f('0xe'),_0x405e93,_0x272059['body']);if(_0x1146a3[_0x374f('0x2e')][_0x374f('0x2f')][_0x374f('0x30')]){_0x3bcc86[_0x374f('0x10')]();}else{_0x3bcc86[_0x374f('0x27')]();}})[_0x374f('0x24')](function(_0x113177){logger[_0x374f('0x31')](_0x374f('0xe'),_0x405e93,JSON[_0x374f('0x2c')](_0x113177));_0x3bcc86[_0x374f('0x10')]();});})[_0x374f('0x24')](function(_0x5614a0){logger[_0x374f('0x31')](_0x374f('0xe'),_0x405e93,_0x5614a0['message']);_0x3bcc86[_0x374f('0x10')]();});}}catch(_0x4e36e7){logger[_0x374f('0x31')](_0x374f('0xe'),_0x405e93,JSON['stringify'](_0x4e36e7));_0x3bcc86[_0x374f('0x27')]();}};};
\ No newline at end of file
+var _0xc4aa=['UserId','info','[%s][DIALOGFLOW]\x20%s','next','contact','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','message','dialogflow','result','fulfillment','speech','providerName','providerResponse','metadata','endConversation','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xc4aa[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xac4a('0x0'));var moment=require(_0xac4a('0x1'));var apiai=require(_0xac4a('0x2'));var md5=require(_0xac4a('0x3'));var utils=require(_0xac4a('0x4'));var logger=require(_0xac4a('0x5'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xac4a('0x6')),'smsMessage':require(_0xac4a('0x7')),'faxMessage':require(_0xac4a('0x8')),'whatsappMessage':require(_0xac4a('0x9'))};exports[_0xac4a('0xa')]=function(_0x15cd34,_0x3ef77c){return function(_0x10525b){try{if(!_['isNil'](this['interaction'][_0xac4a('0xb')])){logger[_0xac4a('0xc')](_0xac4a('0xd'),_0x15cd34,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x10525b[_0xac4a('0xe')]();}var _0x3a82de={'ContactId':this[_0xac4a('0xf')]['id'],'sentAt':moment()['format'](_0xac4a('0x10')),'direction':'out'};if(this[_0xac4a('0x11')]==='sms'||this[_0xac4a('0x11')]===_0xac4a('0x12')){_0x3a82de[_0xac4a('0x13')]=this['interaction'][_0xac4a('0x13')];}var _0x68424a=this[_0xac4a('0x11')];if(_0x68424a===_0xac4a('0x14')){_0x3a82de[_0xac4a('0x15')]=this[_0xac4a('0x16')]['id'];}else{_0x3a82de[_[_0xac4a('0x17')](_0x68424a)+_0xac4a('0x18')]=this[_0xac4a('0x16')]['id'];}_0x3a82de[_[_0xac4a('0x17')](_0x68424a)+_0xac4a('0x19')]=this[_0xac4a('0x1a')]['id'];if(this['interaction'][_0xac4a('0x1b')]){var _0x34d797=_0x3ef77c[0x2];if(!_[_0xac4a('0x1c')](_0x34d797)){_0x3a82de[_0xac4a('0x1d')]=utils[_0xac4a('0x1e')](_0x34d797,this);return rpc[_0x68424a+_0xac4a('0x1f')][_0xac4a('0x20')](_0x3a82de)[_0xac4a('0x21')](function(_0x546c5d){logger['info'](_0xac4a('0xd'),_0x15cd34,_0x3a82de[_0xac4a('0x1d')]);})[_0xac4a('0x22')](function(_0x4d837c){logger[_0xac4a('0x23')](_0xac4a('0xd'),_0x15cd34,JSON[_0xac4a('0x24')](_0x4d837c));})[_0xac4a('0x25')](function(){logger[_0xac4a('0xc')](_0xac4a('0x26'),_0x15cd34);_0x10525b[_0xac4a('0x27')]();});}else{logger[_0xac4a('0xc')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x15cd34);_0x10525b[_0xac4a('0x27')]();}}else{var _0x3204ad=this;var _0x599787=apiai(_0x3ef77c[0x0],{'language':_0x3ef77c[0x1]||'en'});return _0x599787[_0xac4a('0x28')](this[_0xac4a('0x29')][_0xac4a('0x1d')],{'sessionId':md5(this[_0xac4a('0x1a')]['id'])})['then'](function(_0x1b7998){_0x3204ad[_0xac4a('0x1d')][_0xac4a('0x2a')]=_0x1b7998;_0x3a82de[_0xac4a('0x1d')]=_0x1b7998[_0xac4a('0x2b')][_0xac4a('0x2c')][_0xac4a('0x2d')];_0x3a82de[_0xac4a('0x2e')]=_0xac4a('0x2a');_0x3a82de[_0xac4a('0x2f')]=JSON[_0xac4a('0x24')](_0x1b7998);return rpc[_0x68424a+_0xac4a('0x1f')][_0xac4a('0x20')](_0x3a82de)[_0xac4a('0x21')](function(_0x1c13dc){logger[_0xac4a('0xc')]('[%s][DIALOGFLOW]\x20%s',_0x15cd34,_0x3a82de[_0xac4a('0x1d')]);if(_0x1b7998[_0xac4a('0x2b')][_0xac4a('0x30')][_0xac4a('0x31')]){_0x10525b[_0xac4a('0xe')]();}else{_0x10525b['stop']();}})['catch'](function(_0xdb7e){logger[_0xac4a('0x23')](_0xac4a('0xd'),_0x15cd34,JSON['stringify'](_0xdb7e));_0x10525b['next']();});})[_0xac4a('0x22')](function(_0x2896bc){logger[_0xac4a('0x23')](_0xac4a('0xd'),_0x15cd34,_0x2896bc[_0xac4a('0x29')]);_0x10525b['next']();});}}catch(_0x6dcc7f){logger['error'](_0xac4a('0xd'),_0x15cd34,JSON['stringify'](_0x6dcc7f));_0x10525b[_0xac4a('0x27')]();}};};
\ No newline at end of file
index 377b3c6..25d8f0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96f6=['isNil','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','interaction','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','getMustacheRender','error','stringify','stop','SessionsClient','sessionPath','message','length','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','dialogflowV2','providerResponse','fulfillmentText','push','all','lodash','dialogflow','moment','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','body','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','consequence'];(function(_0x38962d,_0x4eb4e5){var _0x39d7e0=function(_0x33f57a){while(--_0x33f57a){_0x38962d['push'](_0x38962d['shift']());}};_0x39d7e0(++_0x4eb4e5);}(_0x96f6,0x181));var _0x696f=function(_0x49c057,_0xc808ed){_0x49c057=_0x49c057-0x0;var _0xd8f0e6=_0x96f6[_0x49c057];return _0xd8f0e6;};'use strict';var _=require(_0x696f('0x0'));var dialogflow=require(_0x696f('0x1'));var md5=require('md5');var moment=require(_0x696f('0x2'));var Promise=require('bluebird');var logger=require(_0x696f('0x3'))(_0x696f('0x4'));var utils=require(_0x696f('0x5'));var rpc={'chatMessage':require(_0x696f('0x6')),'openchannelMessage':require(_0x696f('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x696f('0x8')),'faxMessage':require(_0x696f('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x1f2118,_0x4cbe98,_0x31771c,_0x4ca0d7){return new Promise(function(_0x4455ed,_0x5405d4){var _0xb97ab9=_['clone'](_0x31771c);_0xb97ab9[_0x696f('0xa')]=_0x4ca0d7;return rpc[_0x4cbe98+'Message'][_0x696f('0xb')](_0xb97ab9)[_0x696f('0xc')](function(){logger[_0x696f('0xd')](_0x696f('0xe'),_0x1f2118,_0xb97ab9[_0x696f('0xa')]);_0x4455ed();})[_0x696f('0xf')](function(_0x2c3acf){logger['error'](_0x696f('0xe'),_0x1f2118,JSON['stringify'](_0x2c3acf));_0x5405d4(_0x2c3acf);});});}exports[_0x696f('0x10')]=function(_0xb64331,_0xf70c95){return function(_0x2280db){try{if(!_[_0x696f('0x11')](this['interaction']['UserId'])){logger['info'](_0x696f('0xe'),_0xb64331,_0x696f('0x12'));return _0x2280db[_0x696f('0x13')]();}var _0x36c7c3={'ContactId':this[_0x696f('0x14')]['id'],'sentAt':moment()[_0x696f('0x15')](_0x696f('0x16')),'direction':_0x696f('0x17')};if(this[_0x696f('0x18')]===_0x696f('0x19')||this[_0x696f('0x18')]===_0x696f('0x1a')){_0x36c7c3[_0x696f('0x1b')]=this[_0x696f('0x1c')][_0x696f('0x1b')];}var _0x5ef3fa=this['channel'];if(_0x5ef3fa===_0x696f('0x1d')){_0x36c7c3[_0x696f('0x1e')]=this[_0x696f('0x1f')]['id'];}else{_0x36c7c3[_[_0x696f('0x20')](_0x5ef3fa)+'AccountId']=this['account']['id'];}_0x36c7c3[_['upperFirst'](_0x5ef3fa)+_0x696f('0x21')]=this['interaction']['id'];if(this['interaction'][_0x696f('0x22')]){var _0x522bdd=_0xf70c95[0x4];if(!_[_0x696f('0x23')](_0x522bdd)){_0x36c7c3[_0x696f('0xa')]=utils[_0x696f('0x24')](_0x522bdd,this);return rpc[_0x5ef3fa+'Message']['create'](_0x36c7c3)[_0x696f('0xc')](function(_0x19a564){logger[_0x696f('0xd')]('[%s][DIALOGFLOWV2]\x20%s',_0xb64331,_0x36c7c3[_0x696f('0xa')]);})[_0x696f('0xf')](function(_0x4e57db){logger[_0x696f('0x25')](_0x696f('0xe'),_0xb64331,JSON[_0x696f('0x26')](_0x4e57db));})['finally'](function(){logger['info']('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0xb64331);_0x2280db[_0x696f('0x27')]();});}else{logger['info']('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0xb64331);_0x2280db[_0x696f('0x27')]();}}else{var _0x3dcebd=this;var _0x11118e=_0xf70c95[0x2]['replace'](/\\n/g,'\x0a');var _0x54ac3b={'credentials':{'private_key':_0x11118e,'client_email':_0xf70c95[0x1]}};var _0x6c39d5=new dialogflow[(_0x696f('0x28'))](_0x54ac3b);var _0x489162=_0x6c39d5[_0x696f('0x29')](_0xf70c95[0x0],md5(_0x3dcebd[_0x696f('0x1c')]['id']));var _0x34d12f={'session':_0x489162,'queryInput':{'text':{'text':_0x3dcebd[_0x696f('0x2a')][_0x696f('0xa')],'languageCode':_0xf70c95[0x3]||'en'}}};return _0x6c39d5['detectIntent'](_0x34d12f)[_0x696f('0xc')](function(_0x30cfe7){if(_0x30cfe7&&_0x30cfe7[_0x696f('0x2b')]){_0x3dcebd['body']['dialogflowV2']=_0x30cfe7;var _0x129c1c=_0x30cfe7[0x0];var _0x489f54=_0x129c1c[_0x696f('0x2c')][_0x696f('0x2d')]&&_0x129c1c[_0x696f('0x2c')][_0x696f('0x2d')]['fields']?_0x129c1c[_0x696f('0x2c')][_0x696f('0x2d')][_0x696f('0x2e')][_0x696f('0x2f')][_0x696f('0x30')]:![];_0x3dcebd['body'][_0x696f('0x31')]=_0x129c1c['queryResult'][_0x696f('0x32')];_0x3dcebd[_0x696f('0xa')][_0x696f('0x33')]=_0x129c1c[_0x696f('0x2c')]['allRequiredParamsPresent'];_0x3dcebd[_0x696f('0xa')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x129c1c[_0x696f('0x2c')]['diagnosticInfo']&&_0x129c1c[_0x696f('0x2c')][_0x696f('0x2d')]['fields']?_0x129c1c['queryResult'][_0x696f('0x2d')][_0x696f('0x2e')][_0x696f('0x2f')]['boolValue']:![];_0x3dcebd['body']['DIALOGFLOWV2_INTENTNAME']=_0x129c1c['queryResult'][_0x696f('0x34')][_0x696f('0x35')];_0x3dcebd[_0x696f('0xa')][_0x696f('0x36')]=_0x129c1c[_0x696f('0x2c')][_0x696f('0x34')][_0x696f('0x37')];_0x3dcebd[_0x696f('0xa')][_0x696f('0x38')]=_0x129c1c[_0x696f('0x2c')]['intent'][_0x696f('0x39')];_0x3dcebd[_0x696f('0xa')][_0x696f('0x3a')]=_0x129c1c[_0x696f('0x2c')]['languageCode'];_0x3dcebd[_0x696f('0xa')]['DIALOGFLOWV2_QUERYTEXT']=_0x129c1c[_0x696f('0x2c')]['queryText'];_0x3dcebd[_0x696f('0xa')][_0x696f('0x3b')]=_0x129c1c[_0x696f('0x2c')][_0x696f('0x3c')];_0x36c7c3[_0x696f('0x3d')]=_0x696f('0x3e');_0x36c7c3[_0x696f('0x3f')]=JSON[_0x696f('0x26')](_0x30cfe7);var _0x1e512e=[];for(var _0x869720=0x0;_0x869720<_0x30cfe7[_0x696f('0x2b')];_0x869720++){var _0x228500=_0x30cfe7[_0x869720];if(_0x228500&&_0x228500[_0x696f('0x2c')]&&_0x228500[_0x696f('0x2c')][_0x696f('0x40')]){_0x1e512e[_0x696f('0x41')](createMessage(_0xb64331,_0x5ef3fa,_0x36c7c3,_0x228500[_0x696f('0x2c')][_0x696f('0x40')]));}}return Promise[_0x696f('0x42')](_0x1e512e)[_0x696f('0xc')](function(){if(_0x489f54){_0x2280db['next']();}else{_0x2280db['stop']();}})[_0x696f('0xf')](function(_0xaaea9e){logger['error'](_0x696f('0xe'),_0xb64331,JSON[_0x696f('0x26')](_0xaaea9e));_0x2280db[_0x696f('0x13')]();});}})[_0x696f('0xf')](function(_0x1a3ff1){logger[_0x696f('0x25')](_0x696f('0xe'),_0xb64331,_0x1a3ff1[_0x696f('0x2a')]);_0x2280db[_0x696f('0x13')]();});}}catch(_0x35deac){logger['error'](_0x696f('0xe'),_0xb64331,JSON[_0x696f('0x26')](_0x35deac));_0x2280db[_0x696f('0x27')]();}};};
\ No newline at end of file
+var _0x3c6d=['error','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','interaction','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','account','upperFirst','AccountId','InteractionId','created','getMustacheRender','then','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_ENDCONVERSATION','boolValue','name','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','fulfillmentText','push','message','lodash','dialogflow','md5','moment','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','create','info','catch'];(function(_0x51a6d6,_0x3c9c49){var _0x5ef1a8=function(_0x8ff84a){while(--_0x8ff84a){_0x51a6d6['push'](_0x51a6d6['shift']());}};_0x5ef1a8(++_0x3c9c49);}(_0x3c6d,0x199));var _0xd3c6=function(_0x54890b,_0x222b94){_0x54890b=_0x54890b-0x0;var _0x84998c=_0x3c6d[_0x54890b];return _0x84998c;};'use strict';var _=require(_0xd3c6('0x0'));var dialogflow=require(_0xd3c6('0x1'));var md5=require(_0xd3c6('0x2'));var moment=require(_0xd3c6('0x3'));var Promise=require('bluebird');var logger=require(_0xd3c6('0x4'))(_0xd3c6('0x5'));var utils=require(_0xd3c6('0x6'));var rpc={'chatMessage':require(_0xd3c6('0x7')),'openchannelMessage':require(_0xd3c6('0x8')),'mailMessage':require(_0xd3c6('0x9')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xd3c6('0xa')),'whatsappMessage':require(_0xd3c6('0xb'))};function createMessage(_0x438b25,_0x303abf,_0x341f8a,_0x15a1c9){return new Promise(function(_0x4c29bb,_0x4e0fc6){var _0x63e5ac=_[_0xd3c6('0xc')](_0x341f8a);_0x63e5ac[_0xd3c6('0xd')]=_0x15a1c9;return rpc[_0x303abf+'Message'][_0xd3c6('0xe')](_0x63e5ac)['then'](function(){logger[_0xd3c6('0xf')]('[%s][DIALOGFLOWV2]\x20%s',_0x438b25,_0x63e5ac['body']);_0x4c29bb();})[_0xd3c6('0x10')](function(_0x1eebfa){logger[_0xd3c6('0x11')](_0xd3c6('0x12'),_0x438b25,JSON[_0xd3c6('0x13')](_0x1eebfa));_0x4e0fc6(_0x1eebfa);});});}exports[_0xd3c6('0x14')]=function(_0x29f18b,_0x2a08f0){return function(_0x34fbd3){try{if(!_[_0xd3c6('0x15')](this[_0xd3c6('0x16')]['UserId'])){logger[_0xd3c6('0xf')](_0xd3c6('0x12'),_0x29f18b,_0xd3c6('0x17'));return _0x34fbd3[_0xd3c6('0x18')]();}var _0x1a009b={'ContactId':this[_0xd3c6('0x19')]['id'],'sentAt':moment()[_0xd3c6('0x1a')](_0xd3c6('0x1b')),'direction':_0xd3c6('0x1c')};if(this[_0xd3c6('0x1d')]===_0xd3c6('0x1e')||this[_0xd3c6('0x1d')]===_0xd3c6('0x1f')){_0x1a009b[_0xd3c6('0x20')]=this[_0xd3c6('0x16')]['phone'];}var _0x5def33=this[_0xd3c6('0x1d')];if(_0x5def33==='chat'){_0x1a009b['ChatWebsiteId']=this[_0xd3c6('0x21')]['id'];}else{_0x1a009b[_[_0xd3c6('0x22')](_0x5def33)+_0xd3c6('0x23')]=this[_0xd3c6('0x21')]['id'];}_0x1a009b[_[_0xd3c6('0x22')](_0x5def33)+_0xd3c6('0x24')]=this[_0xd3c6('0x16')]['id'];if(this['interaction'][_0xd3c6('0x25')]){var _0x42c320=_0x2a08f0[0x4];if(!_['isEmpty'](_0x42c320)){_0x1a009b[_0xd3c6('0xd')]=utils[_0xd3c6('0x26')](_0x42c320,this);return rpc[_0x5def33+'Message']['create'](_0x1a009b)[_0xd3c6('0x27')](function(_0x55b4b4){logger[_0xd3c6('0xf')](_0xd3c6('0x12'),_0x29f18b,_0x1a009b[_0xd3c6('0xd')]);})[_0xd3c6('0x10')](function(_0x35d08f){logger[_0xd3c6('0x11')](_0xd3c6('0x12'),_0x29f18b,JSON[_0xd3c6('0x13')](_0x35d08f));})['finally'](function(){logger[_0xd3c6('0xf')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x29f18b);_0x34fbd3[_0xd3c6('0x28')]();});}else{logger[_0xd3c6('0xf')](_0xd3c6('0x29'),_0x29f18b);_0x34fbd3['stop']();}}else{var _0x2c83ff=this;var _0x26e2c8=_0x2a08f0[0x2][_0xd3c6('0x2a')](/\\n/g,'\x0a');var _0x4641f0={'credentials':{'private_key':_0x26e2c8,'client_email':_0x2a08f0[0x1]}};var _0x448dcd=new dialogflow[(_0xd3c6('0x2b'))](_0x4641f0);var _0x1436b6=_0x448dcd[_0xd3c6('0x2c')](_0x2a08f0[0x0],md5(_0x2c83ff['interaction']['id']));var _0x55fcef={'session':_0x1436b6,'queryInput':{'text':{'text':_0x2c83ff['message'][_0xd3c6('0xd')],'languageCode':_0x2a08f0[0x3]||'en'}}};return _0x448dcd[_0xd3c6('0x2d')](_0x55fcef)[_0xd3c6('0x27')](function(_0x29e212){if(_0x29e212&&_0x29e212[_0xd3c6('0x2e')]){_0x2c83ff[_0xd3c6('0xd')][_0xd3c6('0x2f')]=_0x29e212;var _0x30debe=_0x29e212[0x0];var _0x14613d=_0x30debe[_0xd3c6('0x30')][_0xd3c6('0x31')]&&_0x30debe[_0xd3c6('0x30')]['diagnosticInfo'][_0xd3c6('0x32')]?_0x30debe[_0xd3c6('0x30')][_0xd3c6('0x31')][_0xd3c6('0x32')][_0xd3c6('0x33')]['boolValue']:![];_0x2c83ff[_0xd3c6('0xd')][_0xd3c6('0x34')]=_0x30debe[_0xd3c6('0x30')][_0xd3c6('0x35')];_0x2c83ff['body'][_0xd3c6('0x36')]=_0x30debe[_0xd3c6('0x30')]['allRequiredParamsPresent'];_0x2c83ff[_0xd3c6('0xd')][_0xd3c6('0x37')]=_0x30debe[_0xd3c6('0x30')][_0xd3c6('0x31')]&&_0x30debe['queryResult'][_0xd3c6('0x31')][_0xd3c6('0x32')]?_0x30debe[_0xd3c6('0x30')][_0xd3c6('0x31')][_0xd3c6('0x32')]['end_conversation'][_0xd3c6('0x38')]:![];_0x2c83ff[_0xd3c6('0xd')]['DIALOGFLOWV2_INTENTNAME']=_0x30debe[_0xd3c6('0x30')]['intent'][_0xd3c6('0x39')];_0x2c83ff['body'][_0xd3c6('0x3a')]=_0x30debe['queryResult'][_0xd3c6('0x3b')][_0xd3c6('0x3c')];_0x2c83ff[_0xd3c6('0xd')][_0xd3c6('0x3d')]=_0x30debe[_0xd3c6('0x30')][_0xd3c6('0x3b')][_0xd3c6('0x3e')];_0x2c83ff[_0xd3c6('0xd')]['DIALOGFLOWV2_LANGUAGECODE']=_0x30debe[_0xd3c6('0x30')][_0xd3c6('0x3f')];_0x2c83ff[_0xd3c6('0xd')][_0xd3c6('0x40')]=_0x30debe[_0xd3c6('0x30')][_0xd3c6('0x41')];_0x2c83ff[_0xd3c6('0xd')][_0xd3c6('0x42')]=_0x30debe[_0xd3c6('0x30')][_0xd3c6('0x43')];_0x1a009b['providerName']='dialogflowV2';_0x1a009b['providerResponse']=JSON[_0xd3c6('0x13')](_0x29e212);var _0x3aa83d=[];for(var _0x1cd94a=0x0;_0x1cd94a<_0x29e212[_0xd3c6('0x2e')];_0x1cd94a++){var _0x740cfe=_0x29e212[_0x1cd94a];if(_0x740cfe&&_0x740cfe[_0xd3c6('0x30')]&&_0x740cfe[_0xd3c6('0x30')][_0xd3c6('0x44')]){_0x3aa83d[_0xd3c6('0x45')](createMessage(_0x29f18b,_0x5def33,_0x1a009b,_0x740cfe[_0xd3c6('0x30')][_0xd3c6('0x44')]));}}return Promise['all'](_0x3aa83d)[_0xd3c6('0x27')](function(){if(_0x14613d){_0x34fbd3[_0xd3c6('0x18')]();}else{_0x34fbd3[_0xd3c6('0x28')]();}})[_0xd3c6('0x10')](function(_0x3e6ee6){logger[_0xd3c6('0x11')](_0xd3c6('0x12'),_0x29f18b,JSON[_0xd3c6('0x13')](_0x3e6ee6));_0x34fbd3['next']();});}})[_0xd3c6('0x10')](function(_0x3f8f4d){logger[_0xd3c6('0x11')](_0xd3c6('0x12'),_0x29f18b,_0x3f8f4d[_0xd3c6('0x46')]);_0x34fbd3['next']();});}}catch(_0x3360ff){logger[_0xd3c6('0x11')](_0xd3c6('0x12'),_0x29f18b,JSON[_0xd3c6('0x13')](_0x3360ff));_0x34fbd3[_0xd3c6('0x28')]();}};};
\ No newline at end of file
index ec9802a..ddc2959 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa96c=['html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','length','error','[%s][GOTOIF]\x20%s','message','join','condition','priorityFalse','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stop','stringify','validate','lodash'];(function(_0x1d404f,_0x381147){var _0x35259e=function(_0x25b8d3){while(--_0x25b8d3){_0x1d404f['push'](_0x1d404f['shift']());}};_0x35259e(++_0x381147);}(_0xa96c,0xf1));var _0xca96=function(_0x2493e6,_0x5f2190){_0x2493e6=_0x2493e6-0x0;var _0x19e71f=_0xa96c[_0x2493e6];return _0x19e71f;};'use strict';var schema=require(_0xca96('0x0'));var _=require(_0xca96('0x1'));var htmlToText=require(_0xca96('0x2'));var utils=require(_0xca96('0x3'));var logger=require(_0xca96('0x4'))(_0xca96('0x5'));var gotoif=schema({'condition':{'type':_0xca96('0x6'),'required':!![],'message':_0xca96('0x7')},'priorityTrue':{'type':_0xca96('0x8'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0xca96('0x8'),'message':_0xca96('0x9')}});exports[_0xca96('0xa')]=function(_0x323d11,_0x5d735f){return function(_0x41f6ea){try{var _0x1c141a={'condition':htmlToText[_0xca96('0xb')](utils['getMustacheRender'](_0x5d735f[0x0],this),{'wordwrap':![]})[_0xca96('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5d735f[0x1],'priorityFalse':_0x5d735f[0x2]};var _0x4035b4=gotoif[_0xca96('0x0')](_0x1c141a,{'typecast':!![]});if(_0x4035b4[_0xca96('0xd')]){logger[_0xca96('0xe')](_0xca96('0xf'),_0x323d11,_['map'](_0x4035b4,_0xca96('0x10'))[_0xca96('0x11')](',\x20'));_0x41f6ea['stop']();}else{try{var _0xcb335c=eval('('+_0x1c141a[_0xca96('0x12')]+')');var _0x51f8f2=_0xcb335c?_0x1c141a['priorityTrue']:_0x1c141a[_0xca96('0x13')];logger['info']('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x323d11,_0x1c141a['condition'],_0xcb335c,_0x51f8f2||'next');if(_0x51f8f2){var _0x175e1f=_[_0xca96('0x14')](_0x41f6ea[_0xca96('0x15')](),{'p':_0x51f8f2});if(_0x175e1f>=0x0){logger[_0xca96('0x16')](_0xca96('0x17'),_0x323d11,_0x51f8f2||'next',_0x175e1f);_0x41f6ea[_0xca96('0x18')](_0x175e1f);}else{logger[_0xca96('0x16')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x323d11,_0x51f8f2||'next');_0x41f6ea[_0xca96('0x19')]();}}else{_0x41f6ea['next']();}}catch(_0x216bfb){logger[_0xca96('0xe')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x323d11,_0x216bfb['message']);_0x41f6ea[_0xca96('0x19')]();}}}catch(_0x8bb285){logger[_0xca96('0xe')]('[%s][GOTOIF]\x20%s',_0x323d11,JSON[_0xca96('0x1a')](_0x8bb285));_0x41f6ea['stop']();}};};
\ No newline at end of file
+var _0xf270=['stop','condition','priorityTrue','info','next','findIndex','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','[%s][GOTOIF]\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','error','map','join'];(function(_0x7729b1,_0x468322){var _0x349504=function(_0x401cee){while(--_0x401cee){_0x7729b1['push'](_0x7729b1['shift']());}};_0x349504(++_0x468322);}(_0xf270,0x192));var _0x0f27=function(_0x1a89ca,_0x27394b){_0x1a89ca=_0x1a89ca-0x0;var _0x29cbb2=_0xf270[_0x1a89ca];return _0x29cbb2;};'use strict';var schema=require(_0x0f27('0x0'));var _=require(_0x0f27('0x1'));var htmlToText=require(_0x0f27('0x2'));var utils=require(_0x0f27('0x3'));var logger=require(_0x0f27('0x4'))(_0x0f27('0x5'));var gotoif=schema({'condition':{'type':_0x0f27('0x6'),'required':!![],'message':_0x0f27('0x7')},'priorityTrue':{'type':'number','message':_0x0f27('0x8')},'priorityFalse':{'type':_0x0f27('0x9'),'message':_0x0f27('0xa')}});exports[_0x0f27('0xb')]=function(_0x434e9c,_0x154979){return function(_0x2c2050){try{var _0x4cd2af={'condition':htmlToText[_0x0f27('0xc')](utils[_0x0f27('0xd')](_0x154979[0x0],this),{'wordwrap':![]})[_0x0f27('0xe')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x154979[0x1],'priorityFalse':_0x154979[0x2]};var _0x511655=gotoif['validate'](_0x4cd2af,{'typecast':!![]});if(_0x511655['length']){logger[_0x0f27('0xf')]('[%s][GOTOIF]\x20%s',_0x434e9c,_[_0x0f27('0x10')](_0x511655,'message')[_0x0f27('0x11')](',\x20'));_0x2c2050[_0x0f27('0x12')]();}else{try{var _0x5615c0=eval('('+_0x4cd2af[_0x0f27('0x13')]+')');var _0x5eb076=_0x5615c0?_0x4cd2af[_0x0f27('0x14')]:_0x4cd2af['priorityFalse'];logger[_0x0f27('0x15')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x434e9c,_0x4cd2af['condition'],_0x5615c0,_0x5eb076||_0x0f27('0x16'));if(_0x5eb076){var _0x3a232d=_[_0x0f27('0x17')](_0x2c2050['rules'](),{'p':_0x5eb076});if(_0x3a232d>=0x0){logger[_0x0f27('0x15')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x434e9c,_0x5eb076||_0x0f27('0x16'),_0x3a232d);_0x2c2050[_0x0f27('0x16')](_0x3a232d);}else{logger[_0x0f27('0x15')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x434e9c,_0x5eb076||_0x0f27('0x16'));_0x2c2050[_0x0f27('0x12')]();}}else{_0x2c2050['next']();}}catch(_0x4ebb41){logger[_0x0f27('0xf')](_0x0f27('0x18'),_0x434e9c,_0x4ebb41[_0x0f27('0x19')]);_0x2c2050[_0x0f27('0x12')]();}}}catch(_0x594180){logger['error'](_0x0f27('0x1a'),_0x434e9c,JSON[_0x0f27('0x1b')](_0x594180));_0x2c2050[_0x0f27('0x12')]();}};};
\ No newline at end of file
index 60be378..be68364 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3ef=['[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20%s','stringify','lodash','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','validate','length','error','map','message','join','stop','info'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xa3ef,0x170));var _0xfa3e=function(_0x2e6462,_0x2018fe){_0x2e6462=_0x2e6462-0x0;var _0xb0413b=_0xa3ef[_0x2e6462];return _0xb0413b;};'use strict';var schema=require('validate');var _=require(_0xfa3e('0x0'));var logger=require(_0xfa3e('0x1'))(_0xfa3e('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0xfa3e('0x3')}});exports['consequence']=function(_0x49f6cf,_0x5845da){return function(_0x999f47){try{var _0x94c643={'priority':_0x5845da[0x0]};var _0x2ce156=gotop[_0xfa3e('0x4')](_0x94c643,{'typecast':!![]});if(_0x2ce156[_0xfa3e('0x5')]){logger[_0xfa3e('0x6')]('[%s][GOTOP]\x20%s',_0x49f6cf,_[_0xfa3e('0x7')](_0x2ce156,_0xfa3e('0x8'))[_0xfa3e('0x9')](',\x20'));_0x999f47[_0xfa3e('0xa')]();}else{logger[_0xfa3e('0xb')](_0xfa3e('0xc'),_0x49f6cf,_0x94c643['priority']);if(_0x94c643[_0xfa3e('0xd')]){var _0x51147c=_[_0xfa3e('0xe')](_0x999f47[_0xfa3e('0xf')](),{'p':_0x94c643[_0xfa3e('0xd')]});if(_0x51147c>=0x0){logger[_0xfa3e('0xb')](_0xfa3e('0x10'),_0x49f6cf,_0x94c643[_0xfa3e('0xd')]||'next',_0x51147c);_0x999f47[_0xfa3e('0x11')](_0x51147c);}else{logger[_0xfa3e('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x49f6cf,_0x94c643[_0xfa3e('0xd')]||_0xfa3e('0x11'));_0x999f47['stop']();}}else{_0x999f47['next']();}}}catch(_0x5dae90){logger['error'](_0xfa3e('0x12'),_0x49f6cf,JSON[_0xfa3e('0x13')](_0x5dae90));_0x999f47[_0xfa3e('0xa')]();}};};
\ No newline at end of file
+var _0xddea=['priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','routing','number','consequence','length','error','[%s][GOTOP]\x20%s','map','join','stop','info','[%s][GOTOP]\x20priority\x20%s'];(function(_0x201300,_0x2b110b){var _0x266c3a=function(_0x5edb94){while(--_0x5edb94){_0x201300['push'](_0x201300['shift']());}};_0x266c3a(++_0x2b110b);}(_0xddea,0x1a8));var _0xadde=function(_0x1ced6b,_0x408455){_0x1ced6b=_0x1ced6b-0x0;var _0x305cfc=_0xddea[_0x1ced6b];return _0x305cfc;};'use strict';var schema=require(_0xadde('0x0'));var _=require(_0xadde('0x1'));var logger=require('../../../../config/logger')(_0xadde('0x2'));var gotop=schema({'priority':{'type':_0xadde('0x3'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xadde('0x4')]=function(_0x3162f4,_0x18e5ba){return function(_0x4ee574){try{var _0x56c615={'priority':_0x18e5ba[0x0]};var _0x344941=gotop[_0xadde('0x0')](_0x56c615,{'typecast':!![]});if(_0x344941[_0xadde('0x5')]){logger[_0xadde('0x6')](_0xadde('0x7'),_0x3162f4,_[_0xadde('0x8')](_0x344941,'message')[_0xadde('0x9')](',\x20'));_0x4ee574[_0xadde('0xa')]();}else{logger[_0xadde('0xb')](_0xadde('0xc'),_0x3162f4,_0x56c615[_0xadde('0xd')]);if(_0x56c615['priority']){var _0x2dc630=_['findIndex'](_0x4ee574[_0xadde('0xe')](),{'p':_0x56c615[_0xadde('0xd')]});if(_0x2dc630>=0x0){logger[_0xadde('0xb')](_0xadde('0xf'),_0x3162f4,_0x56c615[_0xadde('0xd')]||'next',_0x2dc630);_0x4ee574[_0xadde('0x10')](_0x2dc630);}else{logger[_0xadde('0xb')](_0xadde('0x11'),_0x3162f4,_0x56c615[_0xadde('0xd')]||_0xadde('0x10'));_0x4ee574[_0xadde('0xa')]();}}else{_0x4ee574[_0xadde('0x10')]();}}}catch(_0x3174b8){logger[_0xadde('0x6')](_0xadde('0x7'),_0x3162f4,JSON[_0xadde('0x12')](_0x3174b8));_0x4ee574[_0xadde('0xa')]();}};};
\ No newline at end of file
index 6e6e266..fe765c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcae2=['upperFirst','InteractionId','Message','create','then','info','body','catch','[%s][MESSAGE]\x20%s','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','AccountId','account'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xcae2,0x143));var _0x2cae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcae2[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x2cae('0x0'));var utils=require(_0x2cae('0x1'));var logger=require(_0x2cae('0x2'))(_0x2cae('0x3'));var rpc={'chatMessage':require(_0x2cae('0x4')),'openchannelMessage':require(_0x2cae('0x5')),'mailMessage':require(_0x2cae('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x2cae('0x7')),'whatsappMessage':require(_0x2cae('0x8'))};exports[_0x2cae('0x9')]=function(_0x415f20,_0x57cbf8){return function(_0x3a3e3b){try{var _0x1feff6={'body':utils[_0x2cae('0xa')](_0x57cbf8[0x0],this),'ContactId':this[_0x2cae('0xb')]['id']};if(this[_0x2cae('0xc')]==='chat'){_0x1feff6['ChatWebsiteId']=this['account']['id'];}else{_0x1feff6[_['upperFirst'](this[_0x2cae('0xc')])+_0x2cae('0xd')]=this[_0x2cae('0xe')]['id'];}_0x1feff6[_[_0x2cae('0xf')](this[_0x2cae('0xc')])+_0x2cae('0x10')]=this['interaction']['id'];if(rpc[this[_0x2cae('0xc')]+'Message']){return rpc[this[_0x2cae('0xc')]+_0x2cae('0x11')][_0x2cae('0x12')](_0x1feff6)[_0x2cae('0x13')](function(_0x302385){logger[_0x2cae('0x14')]('[%s][MESSAGE]\x20%s',_0x415f20,_0x1feff6[_0x2cae('0x15')]);_0x3a3e3b['next']();})[_0x2cae('0x16')](function(_0x13c76f){logger['error'](_0x2cae('0x17'),_0x415f20,JSON[_0x2cae('0x18')](_0x13c76f));_0x3a3e3b[_0x2cae('0x19')]();});}}catch(_0x7e2228){logger['error'](_0x2cae('0x17'),_0x415f20,JSON[_0x2cae('0x18')](_0x7e2228));_0x3a3e3b['stop']();}};};
\ No newline at end of file
+var _0xcdd0=['account','upperFirst','AccountId','interaction','Message','create','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','channel','chat','ChatWebsiteId'];(function(_0x154cb5,_0x1a8d5a){var _0x3f574f=function(_0x597a52){while(--_0x597a52){_0x154cb5['push'](_0x154cb5['shift']());}};_0x3f574f(++_0x1a8d5a);}(_0xcdd0,0xbd));var _0x0cdd=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xcdd0[_0x2b7764];return _0x848dcb;};'use strict';var _=require('lodash');var utils=require(_0x0cdd('0x0'));var logger=require(_0x0cdd('0x1'))(_0x0cdd('0x2'));var rpc={'chatMessage':require(_0x0cdd('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x0cdd('0x4')),'faxMessage':require(_0x0cdd('0x5')),'whatsappMessage':require(_0x0cdd('0x6'))};exports[_0x0cdd('0x7')]=function(_0x2e678f,_0x3c12f6){return function(_0x308199){try{var _0x5311bf={'body':utils['getMustacheRender'](_0x3c12f6[0x0],this),'ContactId':this['contact']['id']};if(this[_0x0cdd('0x8')]===_0x0cdd('0x9')){_0x5311bf[_0x0cdd('0xa')]=this[_0x0cdd('0xb')]['id'];}else{_0x5311bf[_[_0x0cdd('0xc')](this[_0x0cdd('0x8')])+_0x0cdd('0xd')]=this[_0x0cdd('0xb')]['id'];}_0x5311bf[_[_0x0cdd('0xc')](this['channel'])+'InteractionId']=this[_0x0cdd('0xe')]['id'];if(rpc[this[_0x0cdd('0x8')]+_0x0cdd('0xf')]){return rpc[this[_0x0cdd('0x8')]+_0x0cdd('0xf')][_0x0cdd('0x10')](_0x5311bf)['then'](function(_0x202d66){logger[_0x0cdd('0x11')](_0x0cdd('0x12'),_0x2e678f,_0x5311bf[_0x0cdd('0x13')]);_0x308199[_0x0cdd('0x14')]();})[_0x0cdd('0x15')](function(_0x3b650e){logger[_0x0cdd('0x16')](_0x0cdd('0x12'),_0x2e678f,JSON[_0x0cdd('0x17')](_0x3b650e));_0x308199[_0x0cdd('0x18')]();});}}catch(_0x4eccdf){logger['error'](_0x0cdd('0x12'),_0x2e678f,JSON['stringify'](_0x4eccdf));_0x308199['stop']();}};};
\ No newline at end of file
index af62d35..71f0fbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaeb1=['./utils','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stop'];(function(_0x41f865,_0x52aa1b){var _0x38c83e=function(_0xf9a3c1){while(--_0xf9a3c1){_0x41f865['push'](_0x41f865['shift']());}};_0x38c83e(++_0x52aa1b);}(_0xaeb1,0xd8));var _0x1aeb=function(_0x567355,_0x4ad51c){_0x567355=_0x567355-0x0;var _0xd84d06=_0xaeb1[_0x567355];return _0xd84d06;};'use strict';var utils=require(_0x1aeb('0x0'));var logger=require('../../../../config/logger')(_0x1aeb('0x1'));exports[_0x1aeb('0x2')]=function(_0x4d2657,_0x4baefa){return function(_0x6febd5){try{logger[_0x1aeb('0x3')](_0x1aeb('0x4'),_0x4d2657,utils[_0x1aeb('0x5')](_0x4baefa[0x0],this));_0x6febd5[_0x1aeb('0x6')]();}catch(_0x2b2a6c){logger[_0x1aeb('0x7')]('[%s][NOOP]\x20%s',_0x4d2657,JSON['stringify'](_0x2b2a6c));_0x6febd5[_0x1aeb('0x8')]();}};};
\ No newline at end of file
+var _0x444b=['routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','stop','../../../../config/logger'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x444b,0xc7));var _0xb444=function(_0x9ef101,_0x220c1b){_0x9ef101=_0x9ef101-0x0;var _0x4f911e=_0x444b[_0x9ef101];return _0x4f911e;};'use strict';var utils=require('./utils');var logger=require(_0xb444('0x0'))(_0xb444('0x1'));exports[_0xb444('0x2')]=function(_0x19956c,_0x41c3ca){return function(_0x3699f4){try{logger[_0xb444('0x3')](_0xb444('0x4'),_0x19956c,utils[_0xb444('0x5')](_0x41c3ca[0x0],this));_0x3699f4[_0xb444('0x6')]();}catch(_0xfcd33){logger['error'](_0xb444('0x4'),_0x19956c,JSON['stringify'](_0xfcd33));_0x3699f4[_0xb444('0x7')]();}};};
\ No newline at end of file
index 4546c30..daf923d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a2a=['%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','MessageId','message','chat','WebsiteId','name','QueueReport','catch','error','create\x20queue\x20report','accepted','info','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','[%s][QUEUE]\x20%s','stop','find','Queues','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','lodash','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','defaults','redis','socket.io-emitter','queue_id','account','queue','from','joinAt','clone','capitalize','InteractionId','%sQueuesWaitingInteractions','pick','format'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7a2a,0xda));var _0xa7a2=function(_0x56d44d,_0x222108){_0x56d44d=_0x56d44d-0x0;var _0x848500=_0x7a2a[_0x56d44d];return _0x848500;};'use strict';var schema=require('validate');var _=require(_0xa7a2('0x0'));var util=require('util');var seqqueue=require(_0xa7a2('0x1'));var moment=require(_0xa7a2('0x2'));var Redis=require(_0xa7a2('0x3'));var config=require(_0xa7a2('0x4'));var logger=require(_0xa7a2('0x5'))(_0xa7a2('0x6'));var strategy=require(_0xa7a2('0x7'));config['redis']=_[_0xa7a2('0x8')](config[_0xa7a2('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xa7a2('0xa'))(new Redis(config[_0xa7a2('0x9')]));var attributes=['id',_0xa7a2('0xb'),_0xa7a2('0xc'),_0xa7a2('0xd'),_0xa7a2('0xe'),_0xa7a2('0xf')];function emit(_0x4bd9f7,_0xeb3114,_0x1c5f57){io['to'](_0x4bd9f7)['emit'](_0xeb3114,_0x1c5f57);}function emitChannelQueueInteraction(_0x33572f,_0x2dd227,_0x118bf4,_0x15678b,_0x407994,_0x58771d,_0x59838b,_0x18269a){var _0x58248b=_[_0xa7a2('0x10')](_0x118bf4);_0x58248b[_0xa7a2('0xb')]=_0x18269a;_0x58248b[_0xa7a2('0xd')]=_0x2dd227;_0x58248b[_0xa7a2('0xc')]=_0x15678b;_0x58248b['id']=_0x407994;if(_0x58771d){attributes['push'](_[_0xa7a2('0x11')](_0x33572f)+_0xa7a2('0x12'));_0x59838b[util['format'](_0xa7a2('0x13'),_0x33572f)][_0x407994]=_[_0xa7a2('0x14')](_0x58248b,attributes);}else{delete _0x59838b[util[_0xa7a2('0x15')](_0xa7a2('0x13'),_0x33572f)][_0x407994];}emit(util[_0xa7a2('0x15')](_0xa7a2('0x16'),_0x33572f,_0x2dd227),util[_0xa7a2('0x15')](_0xa7a2('0x17'),_0x33572f,_0x58771d?_0xa7a2('0x18'):_0xa7a2('0x19')),_[_0xa7a2('0x14')](_0x58248b,attributes));}var rpc={'openchannelQueueReport':require(_0xa7a2('0x1a')),'mailQueueReport':require(_0xa7a2('0x1b')),'chatQueueReport':require(_0xa7a2('0x1c')),'smsQueueReport':require(_0xa7a2('0x1d')),'faxQueueReport':require(_0xa7a2('0x1e')),'whatsappQueueReport':require(_0xa7a2('0x1f'))};var queue=schema({'name':{'type':_0xa7a2('0x20'),'required':!![],'message':_0xa7a2('0x21')},'timeout':{'type':_0xa7a2('0x22'),'message':_0xa7a2('0x23')}});function startRouting(_0x4bb68f,_0x5d12b0,_0x17eb48,_0x356a37){if(_0x4bb68f&&_0x5d12b0&&_0x17eb48){_0x5d12b0[_0xa7a2('0x24')]+=0x1;var _0x2d8a13={'uniqueid':_0x4bb68f,'from':_0x17eb48['body']?_0x17eb48[_0xa7a2('0x25')][_0xa7a2('0xe')]:'','joinAt':moment()[_0xa7a2('0x15')](_0xa7a2('0x26')),'ContactId':_0x17eb48[_0xa7a2('0x27')]?_0x17eb48[_0xa7a2('0x27')]['id']:null,'ListId':_0x17eb48[_0xa7a2('0x28')]?_0x17eb48['list']['id']:null};_0x2d8a13[_[_0xa7a2('0x29')](_0x17eb48[_0xa7a2('0x2a')])+_0xa7a2('0x2b')]=_0x5d12b0['id']||null;_0x2d8a13[_[_0xa7a2('0x29')](_0x17eb48[_0xa7a2('0x2a')])+_0xa7a2('0x12')]=_0x17eb48['interaction']?_0x17eb48['interaction']['id']:null;_0x2d8a13[_[_0xa7a2('0x29')](_0x17eb48[_0xa7a2('0x2a')])+_0xa7a2('0x2c')]=_0x17eb48[_0xa7a2('0x2d')]?_0x17eb48[_0xa7a2('0x2d')]['id']:null;_0x2d8a13[_['upperFirst'](_0x17eb48[_0xa7a2('0x2a')])+(_0x17eb48[_0xa7a2('0x2a')]!==_0xa7a2('0x2e')?'AccountId':_0xa7a2('0x2f'))]=_0x17eb48[_0xa7a2('0xc')]?_0x17eb48['account']['id']:null;logger['info'](util[_0xa7a2('0x15')]('[%s][START:QUEUE][NAME:%s]',_0x4bb68f,_0x5d12b0[_0xa7a2('0x30')]));emitChannelQueueInteraction(_0x17eb48[_0xa7a2('0x2a')],_0x5d12b0[_0xa7a2('0x30')],_0x2d8a13,_0x17eb48[_0xa7a2('0xc')][_0xa7a2('0x30')],_0x17eb48[_0xa7a2('0x2d')]['id'],!![],_0x356a37,_0x5d12b0['id']);if(rpc[_0x17eb48[_0xa7a2('0x2a')]+_0xa7a2('0x31')]){return rpc[_0x17eb48[_0xa7a2('0x2a')]+_0xa7a2('0x31')]['create'](_0x2d8a13)[_0xa7a2('0x32')](function(_0x4ea93c){logger[_0xa7a2('0x33')](_0xa7a2('0x34'));});}}}function stopRouting(_0x2f2718,_0x5918b6,_0x56e21e,_0x45b34d){if(_0x2f2718&&_0x5918b6){_0x5918b6['waiting']-=0x1;var _0x44d34c={'leaveAt':moment()[_0xa7a2('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xa7a2('0x15')](_0xa7a2('0x26')),'reason':_0xa7a2('0x35')};logger[_0xa7a2('0x36')](util[_0xa7a2('0x15')](_0xa7a2('0x37'),_0x2f2718,_0x5918b6['name']));emitChannelQueueInteraction(_0x56e21e['channel'],_0x5918b6['name'],_0x56e21e['body'],_0x56e21e[_0xa7a2('0xc')]['name'],_0x56e21e['message']['id'],![],_0x45b34d,_0x5918b6['id']);if(rpc[_0x56e21e[_0xa7a2('0x2a')]+_0xa7a2('0x31')]){return rpc[_0x56e21e[_0xa7a2('0x2a')]+_0xa7a2('0x31')][_0xa7a2('0x38')](_0x2f2718,_0x44d34c)['catch'](function(_0x72697c){logger[_0xa7a2('0x33')](_0xa7a2('0x39'));});}}}function endRouting(_0x33a9b4,_0x5ee46c,_0x53c61d,_0x51af00){if(_0x33a9b4&&_0x5ee46c){_0x5ee46c['waiting']-=0x1;var _0x4cf098={'leaveAt':moment()[_0xa7a2('0x15')](_0xa7a2('0x26')),'exitAt':moment()[_0xa7a2('0x15')](_0xa7a2('0x26')),'reason':_0xa7a2('0x3a')};logger[_0xa7a2('0x36')](util[_0xa7a2('0x15')](_0xa7a2('0x3b'),_0x33a9b4,_0x5ee46c[_0xa7a2('0x30')]));emitChannelQueueInteraction(_0x53c61d[_0xa7a2('0x2a')],_0x5ee46c['name'],_0x53c61d[_0xa7a2('0x25')],_0x53c61d[_0xa7a2('0xc')][_0xa7a2('0x30')],_0x53c61d[_0xa7a2('0x2d')]['id'],![],_0x51af00);if(rpc[_0x53c61d[_0xa7a2('0x2a')]+_0xa7a2('0x31')]){return rpc[_0x53c61d[_0xa7a2('0x2a')]+_0xa7a2('0x31')]['update'](_0x33a9b4,_0x4cf098)[_0xa7a2('0x32')](function(_0xad2e04){logger[_0xa7a2('0x33')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x8e5d64){return function(_0x41d017){return _0x41d017['name'][_0xa7a2('0x3c')]()===_0x8e5d64[_0xa7a2('0x3c')]();};}exports[_0xa7a2('0x3d')]=function(_0x265aec,_0x5e4956,_0x287bb3,_0x38701f){return function(_0x18dce4){try{var _0x2d88e6={'name':_0x5e4956[0x0],'timeout':_0x5e4956[0x1]};var _0x5aa45b=queue['validate'](_0x2d88e6,{'typecast':!![]});if(_0x5aa45b['length']){logger[_0xa7a2('0x33')](_0xa7a2('0x3e'),_0x265aec,_['map'](_0x5aa45b,'message')['join'](',\x20'));_0x18dce4[_0xa7a2('0x3f')]();}else{var _0x3ee317=_[_0xa7a2('0x40')](_0x287bb3[_0x38701f['channel']+_0xa7a2('0x41')],handleFindQueue(_0x2d88e6[_0xa7a2('0x30')]));if(_0x3ee317){startRouting(_0x265aec,_0x3ee317,_0x38701f,_0x287bb3);var _0x1f60c9=(_0x3ee317[_0xa7a2('0x3a')]||0xa)*0x3e8;var _0x26706b=(_0x2d88e6[_0xa7a2('0x3a')]||0x14)*0x3e8;var _0x27fa22;if(_0x1f60c9>_0x26706b){_0x26706b=_0x1f60c9;}var _0x259231=seqqueue['createQueue'](_0x1f60c9);_0x259231['id']=_0x265aec;_0x259231[_0xa7a2('0x42')]=_0x1f60c9;_0x259231[_0xa7a2('0x43')]=_0x26706b;_0x259231[_0xa7a2('0x2a')]=_0x38701f[_0xa7a2('0x2a')];_0x287bb3['rules'][_0x265aec]['on'](_0xa7a2('0x44'),function(){logger['info'](_0xa7a2('0x45'),_0x265aec);stopRouting(_0x265aec,_0x3ee317,_0x38701f,_0x287bb3);clearTimeout(_0x27fa22);_0x27fa22=undefined;_0x259231[_0xa7a2('0x46')](!![]);if(_0x287bb3[_0xa7a2('0x47')][_0x265aec]){delete _0x287bb3[_0xa7a2('0x47')][_0x265aec];}_0x18dce4[_0xa7a2('0x3f')]();});_0x287bb3[_0xa7a2('0x47')][_0x265aec]['on']('complete',function(){if(_0x287bb3['rules'][_0x265aec]){delete _0x287bb3['rules'][_0x265aec];}});_0x27fa22=setTimeout(function(){logger[_0xa7a2('0x36')](_0xa7a2('0x48'),_0x265aec);endRouting(_0x265aec,_0x3ee317,_0x38701f,_0x287bb3);clearTimeout(_0x27fa22);_0x259231[_0xa7a2('0x46')](!![]);_0x18dce4[_0xa7a2('0x49')]();},_0x26706b);switch(_0x3ee317[_0xa7a2('0x4a')]){case'rrmemory':strategy[_0xa7a2('0x4b')](_0x259231,_0x3ee317,_0x287bb3,_0x38701f);break;default:strategy[_0xa7a2('0x4c')](_0x259231,_0x3ee317,_0x287bb3,_0x38701f);}}else{logger['error'](_0xa7a2('0x4d'),_0x265aec,_0x2d88e6[_0xa7a2('0x30')]);_0x18dce4[_0xa7a2('0x3f')]();}}}catch(_0x5b069d){console[_0xa7a2('0x4e')](_0x5b069d);logger[_0xa7a2('0x33')](_0xa7a2('0x3e'),_0x265aec,_0x5b069d[_0xa7a2('0x4f')]);_0x18dce4[_0xa7a2('0x3f')]();}};};
\ No newline at end of file
+var _0x130c=['queue_id','queue','from','joinAt','emit','clone','account','push','capitalize','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','pick','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','AccountId','info','name','QueueReport','create','catch','accepted','[%s][STOP:QUEUE][NAME:%s]','update','error','update\x20queue\x20report','waiting','[%s][END:QUEUE][NAME:%s]','consequence','length','[%s][QUEUE]\x20%s','map','stop','Queues','timeout','createQueue','atimeout','qtimeout','rules','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','moment','ioredis','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter'];(function(_0xe7b139,_0x1379fb){var _0x2dd8b0=function(_0x2eec29){while(--_0x2eec29){_0xe7b139['push'](_0xe7b139['shift']());}};_0x2dd8b0(++_0x1379fb);}(_0x130c,0x134));var _0xc130=function(_0x44cfb2,_0x21a422){_0x44cfb2=_0x44cfb2-0x0;var _0xa50308=_0x130c[_0x44cfb2];return _0xa50308;};'use strict';var schema=require(_0xc130('0x0'));var _=require(_0xc130('0x1'));var util=require(_0xc130('0x2'));var seqqueue=require('seq-queue');var moment=require(_0xc130('0x3'));var Redis=require(_0xc130('0x4'));var config=require('../../../../config/environment');var logger=require(_0xc130('0x5'))(_0xc130('0x6'));var strategy=require(_0xc130('0x7'));config[_0xc130('0x8')]=_[_0xc130('0x9')](config['redis'],{'host':_0xc130('0xa'),'port':0x18eb});var io=require(_0xc130('0xb'))(new Redis(config[_0xc130('0x8')]));var attributes=['id',_0xc130('0xc'),'account',_0xc130('0xd'),_0xc130('0xe'),_0xc130('0xf')];function emit(_0x5aed8c,_0x468a2e,_0xf62c2f){io['to'](_0x5aed8c)[_0xc130('0x10')](_0x468a2e,_0xf62c2f);}function emitChannelQueueInteraction(_0x4b1803,_0x31f29f,_0x10e19f,_0x2f3d7a,_0x54ef8e,_0x39f826,_0x3da08a,_0x2608e4){var _0x5b5273=_[_0xc130('0x11')](_0x10e19f);_0x5b5273['queue_id']=_0x2608e4;_0x5b5273[_0xc130('0xd')]=_0x31f29f;_0x5b5273[_0xc130('0x12')]=_0x2f3d7a;_0x5b5273['id']=_0x54ef8e;if(_0x39f826){attributes[_0xc130('0x13')](_[_0xc130('0x14')](_0x4b1803)+'InteractionId');_0x3da08a[util[_0xc130('0x15')](_0xc130('0x16'),_0x4b1803)][_0x54ef8e]=_['pick'](_0x5b5273,attributes);}else{delete _0x3da08a[util[_0xc130('0x15')](_0xc130('0x16'),_0x4b1803)][_0x54ef8e];}emit(util[_0xc130('0x15')](_0xc130('0x17'),_0x4b1803,_0x31f29f),util[_0xc130('0x15')](_0xc130('0x18'),_0x4b1803,_0x39f826?'save':_0xc130('0x19')),_[_0xc130('0x1a')](_0x5b5273,attributes));}var rpc={'openchannelQueueReport':require(_0xc130('0x1b')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xc130('0x1c')),'smsQueueReport':require(_0xc130('0x1d')),'faxQueueReport':require(_0xc130('0x1e')),'whatsappQueueReport':require(_0xc130('0x1f'))};var queue=schema({'name':{'type':_0xc130('0x20'),'required':!![],'message':_0xc130('0x21')},'timeout':{'type':'number','message':_0xc130('0x22')}});function startRouting(_0x283c48,_0x4b4ed1,_0x13a2ee,_0x4de522){if(_0x283c48&&_0x4b4ed1&&_0x13a2ee){_0x4b4ed1['waiting']+=0x1;var _0x485b5e={'uniqueid':_0x283c48,'from':_0x13a2ee[_0xc130('0x23')]?_0x13a2ee['body']['from']:'','joinAt':moment()[_0xc130('0x15')](_0xc130('0x24')),'ContactId':_0x13a2ee['contact']?_0x13a2ee['contact']['id']:null,'ListId':_0x13a2ee[_0xc130('0x25')]?_0x13a2ee['list']['id']:null};_0x485b5e[_[_0xc130('0x26')](_0x13a2ee[_0xc130('0x27')])+_0xc130('0x28')]=_0x4b4ed1['id']||null;_0x485b5e[_[_0xc130('0x26')](_0x13a2ee[_0xc130('0x27')])+_0xc130('0x29')]=_0x13a2ee[_0xc130('0x2a')]?_0x13a2ee[_0xc130('0x2a')]['id']:null;_0x485b5e[_[_0xc130('0x26')](_0x13a2ee[_0xc130('0x27')])+_0xc130('0x2b')]=_0x13a2ee[_0xc130('0x2c')]?_0x13a2ee['message']['id']:null;_0x485b5e[_['upperFirst'](_0x13a2ee[_0xc130('0x27')])+(_0x13a2ee['channel']!==_0xc130('0x2d')?_0xc130('0x2e'):'WebsiteId')]=_0x13a2ee[_0xc130('0x12')]?_0x13a2ee[_0xc130('0x12')]['id']:null;logger[_0xc130('0x2f')](util[_0xc130('0x15')]('[%s][START:QUEUE][NAME:%s]',_0x283c48,_0x4b4ed1[_0xc130('0x30')]));emitChannelQueueInteraction(_0x13a2ee[_0xc130('0x27')],_0x4b4ed1[_0xc130('0x30')],_0x485b5e,_0x13a2ee[_0xc130('0x12')][_0xc130('0x30')],_0x13a2ee[_0xc130('0x2c')]['id'],!![],_0x4de522,_0x4b4ed1['id']);if(rpc[_0x13a2ee[_0xc130('0x27')]+_0xc130('0x31')]){return rpc[_0x13a2ee[_0xc130('0x27')]+_0xc130('0x31')][_0xc130('0x32')](_0x485b5e)[_0xc130('0x33')](function(_0x299c86){logger['error']('create\x20queue\x20report');});}}}function stopRouting(_0x32ffb1,_0x242422,_0x46b832,_0x5c45a0){if(_0x32ffb1&&_0x242422){_0x242422['waiting']-=0x1;var _0xf14fd4={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xc130('0x15')](_0xc130('0x24')),'reason':_0xc130('0x34')};logger['info'](util['format'](_0xc130('0x35'),_0x32ffb1,_0x242422['name']));emitChannelQueueInteraction(_0x46b832[_0xc130('0x27')],_0x242422[_0xc130('0x30')],_0x46b832[_0xc130('0x23')],_0x46b832[_0xc130('0x12')][_0xc130('0x30')],_0x46b832['message']['id'],![],_0x5c45a0,_0x242422['id']);if(rpc[_0x46b832[_0xc130('0x27')]+'QueueReport']){return rpc[_0x46b832['channel']+_0xc130('0x31')][_0xc130('0x36')](_0x32ffb1,_0xf14fd4)[_0xc130('0x33')](function(_0x247757){logger[_0xc130('0x37')](_0xc130('0x38'));});}}}function endRouting(_0x57f3d1,_0x45cf5e,_0x5a0faf,_0x417511){if(_0x57f3d1&&_0x45cf5e){_0x45cf5e[_0xc130('0x39')]-=0x1;var _0x30ac54={'leaveAt':moment()[_0xc130('0x15')](_0xc130('0x24')),'exitAt':moment()['format'](_0xc130('0x24')),'reason':'timeout'};logger[_0xc130('0x2f')](util[_0xc130('0x15')](_0xc130('0x3a'),_0x57f3d1,_0x45cf5e[_0xc130('0x30')]));emitChannelQueueInteraction(_0x5a0faf[_0xc130('0x27')],_0x45cf5e[_0xc130('0x30')],_0x5a0faf['body'],_0x5a0faf['account'][_0xc130('0x30')],_0x5a0faf[_0xc130('0x2c')]['id'],![],_0x417511);if(rpc[_0x5a0faf['channel']+_0xc130('0x31')]){return rpc[_0x5a0faf[_0xc130('0x27')]+'QueueReport'][_0xc130('0x36')](_0x57f3d1,_0x30ac54)['catch'](function(_0x452aab){logger[_0xc130('0x37')](_0xc130('0x38'));});}}}function handleFindQueue(_0x3a743e){return function(_0x1a766d){return _0x1a766d[_0xc130('0x30')]['toLowerCase']()===_0x3a743e['toLowerCase']();};}exports[_0xc130('0x3b')]=function(_0x50f610,_0x38ca76,_0x26742c,_0xf0a98f){return function(_0x2bec70){try{var _0x1f3a46={'name':_0x38ca76[0x0],'timeout':_0x38ca76[0x1]};var _0x47ddd9=queue['validate'](_0x1f3a46,{'typecast':!![]});if(_0x47ddd9[_0xc130('0x3c')]){logger[_0xc130('0x37')](_0xc130('0x3d'),_0x50f610,_[_0xc130('0x3e')](_0x47ddd9,_0xc130('0x2c'))['join'](',\x20'));_0x2bec70[_0xc130('0x3f')]();}else{var _0x477460=_['find'](_0x26742c[_0xf0a98f['channel']+_0xc130('0x40')],handleFindQueue(_0x1f3a46[_0xc130('0x30')]));if(_0x477460){startRouting(_0x50f610,_0x477460,_0xf0a98f,_0x26742c);var _0x5bdcc6=(_0x477460['timeout']||0xa)*0x3e8;var _0x6eb070=(_0x1f3a46[_0xc130('0x41')]||0x14)*0x3e8;var _0x222fa2;if(_0x5bdcc6>_0x6eb070){_0x6eb070=_0x5bdcc6;}var _0x38c7fc=seqqueue[_0xc130('0x42')](_0x5bdcc6);_0x38c7fc['id']=_0x50f610;_0x38c7fc[_0xc130('0x43')]=_0x5bdcc6;_0x38c7fc[_0xc130('0x44')]=_0x6eb070;_0x38c7fc['channel']=_0xf0a98f[_0xc130('0x27')];_0x26742c[_0xc130('0x45')][_0x50f610]['on']('end',function(){logger[_0xc130('0x2f')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x50f610);stopRouting(_0x50f610,_0x477460,_0xf0a98f,_0x26742c);clearTimeout(_0x222fa2);_0x222fa2=undefined;_0x38c7fc[_0xc130('0x46')](!![]);if(_0x26742c['rules'][_0x50f610]){delete _0x26742c[_0xc130('0x45')][_0x50f610];}_0x2bec70[_0xc130('0x3f')]();});_0x26742c[_0xc130('0x45')][_0x50f610]['on'](_0xc130('0x47'),function(){if(_0x26742c[_0xc130('0x45')][_0x50f610]){delete _0x26742c[_0xc130('0x45')][_0x50f610];}});_0x222fa2=setTimeout(function(){logger[_0xc130('0x2f')](_0xc130('0x48'),_0x50f610);endRouting(_0x50f610,_0x477460,_0xf0a98f,_0x26742c);clearTimeout(_0x222fa2);_0x38c7fc['close'](!![]);_0x2bec70[_0xc130('0x49')]();},_0x6eb070);switch(_0x477460[_0xc130('0x4a')]){case _0xc130('0x4b'):strategy[_0xc130('0x4b')](_0x38c7fc,_0x477460,_0x26742c,_0xf0a98f);break;default:strategy[_0xc130('0x4c')](_0x38c7fc,_0x477460,_0x26742c,_0xf0a98f);}}else{logger['error'](_0xc130('0x4d'),_0x50f610,_0x1f3a46['name']);_0x2bec70[_0xc130('0x3f')]();}}}catch(_0x5b2047){console[_0xc130('0x4e')](_0x5b2047);logger[_0xc130('0x37')]('[%s][QUEUE]\x20%s',_0x50f610,_0x5b2047[_0xc130('0x4f')]);_0x2bec70[_0xc130('0x3f')]();}};};
\ No newline at end of file
index dd31521..014f6c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50a6=['uuid','routing','squeue','push','handleRun','handleTimeout','timeout','bind','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','agent','forcedOwnership','isAgentAvailable','realtime','busy','busyQueue','channel','showNotification','notificationId','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','removeWaitingNotification','STOP','exports','lodash'];(function(_0x4e062a,_0x1298a4){var _0x3a170b=function(_0x38b5a3){while(--_0x38b5a3){_0x4e062a['push'](_0x4e062a['shift']());}};_0x3a170b(++_0x1298a4);}(_0x50a6,0xa4));var _0x650a=function(_0x52a6e3,_0x4a73b4){_0x52a6e3=_0x52a6e3-0x0;var _0x8910d0=_0x50a6[_0x52a6e3];return _0x8910d0;};'use strict';var _=require(_0x650a('0x0'));var uuid=require(_0x650a('0x1'));var util=require('./util');var logger=require('../../../../../config/logger')(_0x650a('0x2'));var Agent=function(_0x4abe0c,_0x19ed86,_0x15dd02,_0x2c71ba){this['notificationId']=uuid['v4']();this[_0x650a('0x3')]=_0x4abe0c;this['agent']=_0x19ed86;this['realtime']=_0x15dd02;this[_0x650a('0x2')]=_0x2c71ba;this[_0x650a('0x3')][_0x650a('0x4')](this[_0x650a('0x5')]['bind'](this),this[_0x650a('0x6')]['bind'](this));this[_0x650a('0x3')]['on'](_0x650a('0x7'),this['handleTimeout'][_0x650a('0x8')](this));this[_0x650a('0x3')]['on']('drained',this[_0x650a('0x9')]['bind'](this));};Agent[_0x650a('0xa')]['push']=function(){this[_0x650a('0x3')]['push'](this[_0x650a('0x5')]['bind'](this),this[_0x650a('0x6')][_0x650a('0x8')](this));};Agent[_0x650a('0xa')]['handleDrained']=function(){this[_0x650a('0x6')](!![]);};Agent[_0x650a('0xa')][_0x650a('0x5')]=function(){logger[_0x650a('0xb')](_0x650a('0xc'),this[_0x650a('0x3')]['id'],this['agent']['id']);if(_[_0x650a('0xd')](this['realtime'][_0x650a('0xe')][this[_0x650a('0xf')]['id']])){logger[_0x650a('0xb')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this['agent']['id']);setTimeout(this['push'][_0x650a('0x8')](this),0x3e8);}else{if(this[_0x650a('0x2')][_0x650a('0x10')]||util[_0x650a('0x11')](this[_0x650a('0x3')]['id'],this['realtime']['agents'][this[_0x650a('0xf')]['id']],this[_0x650a('0x3')]['channel'],![])){this[_0x650a('0x12')][_0x650a('0xe')][this['agent']['id']][_0x650a('0x13')]=!![];this[_0x650a('0x12')][_0x650a('0xe')][this[_0x650a('0xf')]['id']][_0x650a('0x14')]=undefined;util['saveWaitingNotification'](this[_0x650a('0x12')],this['routing'],this[_0x650a('0xf')],this[_0x650a('0x3')][_0x650a('0x15')]);util[_0x650a('0x16')](this[_0x650a('0x17')],this[_0x650a('0x3')]['id'],this[_0x650a('0x12')][_0x650a('0xe')][this[_0x650a('0xf')]['id']],null,this[_0x650a('0x2')]);util[_0x650a('0x18')](this[_0x650a('0x3')]['id'],this[_0x650a('0x12')][_0x650a('0xe')][this[_0x650a('0xf')]['id']],_0x650a('0x19')+(this[_0x650a('0x2')][_0x650a('0x10')]?':FORCED':''));}else{logger[_0x650a('0xb')](_0x650a('0x1a'),this[_0x650a('0x3')]['id'],this['agent']['id']);setTimeout(this[_0x650a('0x4')][_0x650a('0x8')](this),0x3e8);}}};Agent[_0x650a('0xa')][_0x650a('0x6')]=function(_0x3c5bd4){if(_[_0x650a('0xd')](this['realtime'][_0x650a('0xe')][this[_0x650a('0xf')]['id']])){return logger[_0x650a('0xb')](_0x650a('0x1b'),this[_0x650a('0x3')]['id'],this[_0x650a('0xf')]['id']);}else{logger[_0x650a('0xb')](_0x650a('0x1c'),this['squeue']['id'],this[_0x650a('0xf')]['id']);util[_0x650a('0x1d')](this[_0x650a('0x17')],this['squeue']['id'],this[_0x650a('0x12')][_0x650a('0xe')][this['agent']['id']],null,this[_0x650a('0x2')]);this[_0x650a('0x12')][_0x650a('0xe')][this['agent']['id']]['busy']=![];this['realtime'][_0x650a('0xe')][this[_0x650a('0xf')]['id']][_0x650a('0x14')]=undefined;util[_0x650a('0x1e')](this['realtime'],this[_0x650a('0x2')],this[_0x650a('0xf')],this['squeue'][_0x650a('0x15')]);util[_0x650a('0x18')](this[_0x650a('0x3')]['id'],this[_0x650a('0x12')][_0x650a('0xe')][this['agent']['id']],_0x3c5bd4?_0x650a('0x1f'):'TIMEOUT');}if(!_0x3c5bd4){setTimeout(this[_0x650a('0x4')][_0x650a('0x8')](this),0x3e8);}};function agent(_0x5dbdf9,_0x43b91a,_0xa0e8ec,_0x4a0849){return new Agent(_0x5dbdf9,_0x43b91a,_0xa0e8ec,_0x4a0849);}module[_0x650a('0x20')]=agent;
\ No newline at end of file
+var _0x17ba=['TIMEOUT','lodash','uuid','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','busy','busyQueue','saveWaitingNotification','showNotification','writeLog','forcedOwnership','debug','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','removeWaitingNotification','STOP'];(function(_0x254eb9,_0x4f4206){var _0x11111b=function(_0x2a2c11){while(--_0x2a2c11){_0x254eb9['push'](_0x254eb9['shift']());}};_0x11111b(++_0x4f4206);}(_0x17ba,0xab));var _0xa17b=function(_0x353f3c,_0x1221c0){_0x353f3c=_0x353f3c-0x0;var _0x47b6d3=_0x17ba[_0x353f3c];return _0x47b6d3;};'use strict';var _=require(_0xa17b('0x0'));var uuid=require(_0xa17b('0x1'));var util=require('./util');var logger=require(_0xa17b('0x2'))(_0xa17b('0x3'));var Agent=function(_0x2806ac,_0x3c60e5,_0x106b5b,_0x38c13c){this[_0xa17b('0x4')]=uuid['v4']();this[_0xa17b('0x5')]=_0x2806ac;this[_0xa17b('0x6')]=_0x3c60e5;this[_0xa17b('0x7')]=_0x106b5b;this[_0xa17b('0x3')]=_0x38c13c;this[_0xa17b('0x5')][_0xa17b('0x8')](this[_0xa17b('0x9')][_0xa17b('0xa')](this),this[_0xa17b('0xb')][_0xa17b('0xa')](this));this[_0xa17b('0x5')]['on'](_0xa17b('0xc'),this['handleTimeout'][_0xa17b('0xa')](this));this[_0xa17b('0x5')]['on'](_0xa17b('0xd'),this[_0xa17b('0xe')][_0xa17b('0xa')](this));};Agent[_0xa17b('0xf')][_0xa17b('0x8')]=function(){this['squeue'][_0xa17b('0x8')](this[_0xa17b('0x9')][_0xa17b('0xa')](this),this['handleTimeout'][_0xa17b('0xa')](this));};Agent[_0xa17b('0xf')][_0xa17b('0xe')]=function(){this[_0xa17b('0xb')](!![]);};Agent['prototype'][_0xa17b('0x9')]=function(){logger['debug'](_0xa17b('0x10'),this[_0xa17b('0x5')]['id'],this['agent']['id']);if(_[_0xa17b('0x11')](this[_0xa17b('0x7')][_0xa17b('0x12')][this[_0xa17b('0x6')]['id']])){logger['debug'](_0xa17b('0x13'),this['squeue']['id'],this['agent']['id']);setTimeout(this['push'][_0xa17b('0xa')](this),0x3e8);}else{if(this[_0xa17b('0x3')]['forcedOwnership']||util[_0xa17b('0x14')](this[_0xa17b('0x5')]['id'],this[_0xa17b('0x7')][_0xa17b('0x12')][this[_0xa17b('0x6')]['id']],this[_0xa17b('0x5')][_0xa17b('0x15')],![])){this['realtime'][_0xa17b('0x12')][this[_0xa17b('0x6')]['id']][_0xa17b('0x16')]=!![];this['realtime'][_0xa17b('0x12')][this[_0xa17b('0x6')]['id']][_0xa17b('0x17')]=undefined;util[_0xa17b('0x18')](this[_0xa17b('0x7')],this[_0xa17b('0x3')],this['agent'],this[_0xa17b('0x5')]['channel']);util[_0xa17b('0x19')](this[_0xa17b('0x4')],this['squeue']['id'],this['realtime'][_0xa17b('0x12')][this[_0xa17b('0x6')]['id']],null,this[_0xa17b('0x3')]);util[_0xa17b('0x1a')](this[_0xa17b('0x5')]['id'],this[_0xa17b('0x7')]['agents'][this['agent']['id']],'RINGING'+(this['routing'][_0xa17b('0x1b')]?':FORCED':''));}else{logger[_0xa17b('0x1c')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0xa17b('0x5')]['id'],this[_0xa17b('0x6')]['id']);setTimeout(this[_0xa17b('0x8')][_0xa17b('0xa')](this),0x3e8);}}};Agent[_0xa17b('0xf')][_0xa17b('0xb')]=function(_0x2fbbe8){if(_[_0xa17b('0x11')](this[_0xa17b('0x7')][_0xa17b('0x12')][this[_0xa17b('0x6')]['id']])){return logger['debug']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0xa17b('0x6')]['id']);}else{logger[_0xa17b('0x1c')](_0xa17b('0x1d'),this[_0xa17b('0x5')]['id'],this[_0xa17b('0x6')]['id']);util[_0xa17b('0x1e')](this[_0xa17b('0x4')],this[_0xa17b('0x5')]['id'],this['realtime'][_0xa17b('0x12')][this['agent']['id']],null,this[_0xa17b('0x3')]);this[_0xa17b('0x7')][_0xa17b('0x12')][this[_0xa17b('0x6')]['id']][_0xa17b('0x16')]=![];this[_0xa17b('0x7')]['agents'][this[_0xa17b('0x6')]['id']][_0xa17b('0x17')]=undefined;util[_0xa17b('0x1f')](this[_0xa17b('0x7')],this[_0xa17b('0x3')],this['agent'],this[_0xa17b('0x5')]['channel']);util[_0xa17b('0x1a')](this['squeue']['id'],this[_0xa17b('0x7')][_0xa17b('0x12')][this['agent']['id']],_0x2fbbe8?_0xa17b('0x20'):_0xa17b('0x21'));}if(!_0x2fbbe8){setTimeout(this['push'][_0xa17b('0xa')](this),0x3e8);}};function agent(_0x107584,_0x3d4cf3,_0x55c1b6,_0xd71efd){return new Agent(_0x107584,_0x3d4cf3,_0x55c1b6,_0xd71efd);}module['exports']=agent;
\ No newline at end of file
index ba67a97..cf6445d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9487=['showNotification','debug','[%s][QUEUE]\x20EMPTY','STOP','TIMEOUT','busy','removeWaitingNotification','uuid','./util','routing','notificationId','squeue','handleRun','bind','handleTimeout','drained','handleDrained','prototype','push','queue','isNil','length','Agents','realtime','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','agents','channel','writeLog','RINGING','busyQueue','name','saveWaitingNotification'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x9487,0xac));var _0x7948=function(_0x38f90e,_0x21b878){_0x38f90e=_0x38f90e-0x0;var _0x150f1e=_0x9487[_0x38f90e];return _0x150f1e;};'use strict';var _=require('lodash');var uuid=require(_0x7948('0x0'));var util=require(_0x7948('0x1'));var logger=require('../../../../../config/logger')(_0x7948('0x2'));var Beepall=function(_0x2c62b6,_0x156ee2,_0x2073d9,_0x7697ce){this[_0x7948('0x3')]=uuid['v4']();this[_0x7948('0x4')]=_0x2c62b6;this['queue']=_0x156ee2;this['realtime']=_0x2073d9;this[_0x7948('0x2')]=_0x7697ce;this[_0x7948('0x4')]['push'](this[_0x7948('0x5')][_0x7948('0x6')](this),this[_0x7948('0x7')][_0x7948('0x6')](this));this[_0x7948('0x4')]['on']('timeout',this[_0x7948('0x7')][_0x7948('0x6')](this));this[_0x7948('0x4')]['on'](_0x7948('0x8'),this[_0x7948('0x9')][_0x7948('0x6')](this));};Beepall[_0x7948('0xa')][_0x7948('0xb')]=function(){this[_0x7948('0x4')][_0x7948('0xb')](this[_0x7948('0x5')]['bind'](this),this[_0x7948('0x7')][_0x7948('0x6')](this));};Beepall['prototype'][_0x7948('0x9')]=function(){this[_0x7948('0x7')](!![]);};Beepall['prototype'][_0x7948('0x5')]=function(){var _0x54293a=!![];if(!_['isNil'](this[_0x7948('0xc')])&&!_[_0x7948('0xd')](this[_0x7948('0xc')]['Agents'])&&this[_0x7948('0xc')]['Agents'][_0x7948('0xe')]>0x0){for(var _0x45b0af=0x0,_0x3acd8c;_0x45b0af<this[_0x7948('0xc')][_0x7948('0xf')][_0x7948('0xe')];_0x45b0af+=0x1){_0x3acd8c=this[_0x7948('0xc')][_0x7948('0xf')][_0x45b0af]['id'];if(_['isNil'](this[_0x7948('0x10')]['agents'][_0x3acd8c])){logger['debug'](_0x7948('0x11'),this[_0x7948('0x4')]['id'],_0x3acd8c);}else{if(util[_0x7948('0x12')](this[_0x7948('0x4')]['id'],this[_0x7948('0x10')][_0x7948('0x13')][_0x3acd8c],this[_0x7948('0x4')][_0x7948('0x14')],!![])){_0x54293a=![];util[_0x7948('0x15')](this['squeue']['id'],this[_0x7948('0x10')][_0x7948('0x13')][_0x3acd8c],_0x7948('0x16'));this['realtime'][_0x7948('0x13')][_0x3acd8c]['busy']=!![];this['realtime']['agents'][_0x3acd8c][_0x7948('0x17')]=this['queue'][_0x7948('0x18')];util[_0x7948('0x19')](this[_0x7948('0x10')],this[_0x7948('0x2')],this['queue'][_0x7948('0xf')][_0x45b0af],this[_0x7948('0x4')][_0x7948('0x14')]);util[_0x7948('0x1a')](this['notificationId'],this['squeue']['id'],this[_0x7948('0x10')]['agents'][_0x3acd8c],this['queue'],this[_0x7948('0x2')]);}}}if(_0x54293a){logger[_0x7948('0x1b')]('[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY',this[_0x7948('0x4')]['id']);setTimeout(this[_0x7948('0xb')][_0x7948('0x6')](this),0x3e8);}}else{logger[_0x7948('0x1b')](_0x7948('0x1c'),this[_0x7948('0x4')]['id']);setTimeout(this[_0x7948('0xb')]['bind'](this),0x3e8);}};Beepall[_0x7948('0xa')][_0x7948('0x7')]=function(_0x3f6edf){if(!_[_0x7948('0xd')](this['queue'])&&!_[_0x7948('0xd')](this[_0x7948('0xc')][_0x7948('0xf')])){for(var _0x699bd4=0x0,_0x19e4f2;_0x699bd4<this[_0x7948('0xc')][_0x7948('0xf')]['length'];_0x699bd4+=0x1){_0x19e4f2=this['queue'][_0x7948('0xf')][_0x699bd4]['id'];if(_[_0x7948('0xd')](this['realtime'][_0x7948('0x13')][_0x19e4f2])){logger[_0x7948('0x1b')](_0x7948('0x11'),this[_0x7948('0x4')]['id'],_0x19e4f2);}else{util['hideNotification'](this[_0x7948('0x3')],this[_0x7948('0x4')]['id'],this[_0x7948('0x10')][_0x7948('0x13')][_0x19e4f2],this[_0x7948('0xc')],this[_0x7948('0x2')]);util[_0x7948('0x15')](this[_0x7948('0x4')]['id'],this[_0x7948('0x10')]['agents'][_0x19e4f2],_0x3f6edf?_0x7948('0x1d'):_0x7948('0x1e'));this[_0x7948('0x10')][_0x7948('0x13')][_0x19e4f2][_0x7948('0x1f')]=![];this['realtime'][_0x7948('0x13')][_0x19e4f2]['busyQueue']=undefined;util[_0x7948('0x20')](this[_0x7948('0x10')],this[_0x7948('0x2')],this[_0x7948('0x10')]['agents'][_0x19e4f2],this[_0x7948('0x4')][_0x7948('0x14')]);}}}if(!_0x3f6edf){setTimeout(this[_0x7948('0xb')][_0x7948('0x6')](this),0x3e8);}};function beepall(_0x502c75,_0x251399,_0x417818,_0x42a160){return new Beepall(_0x502c75,_0x251399,_0x417818,_0x42a160);}module['exports']=beepall;
\ No newline at end of file
+var _0xaa7f=['../../../../../config/logger','routing','notificationId','squeue','queue','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','isNil','Agents','length','agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','RINGING','busy','busyQueue','name','channel','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','writeLog','STOP','TIMEOUT','removeWaitingNotification','lodash','./util'];(function(_0xf8a266,_0x2b755c){var _0x53ed1b=function(_0x52aa8c){while(--_0x52aa8c){_0xf8a266['push'](_0xf8a266['shift']());}};_0x53ed1b(++_0x2b755c);}(_0xaa7f,0x166));var _0xfaa7=function(_0x3ea3f5,_0x2ba903){_0x3ea3f5=_0x3ea3f5-0x0;var _0x42ee17=_0xaa7f[_0x3ea3f5];return _0x42ee17;};'use strict';var _=require(_0xfaa7('0x0'));var uuid=require('uuid');var util=require(_0xfaa7('0x1'));var logger=require(_0xfaa7('0x2'))(_0xfaa7('0x3'));var Beepall=function(_0x33da3d,_0x11070d,_0x47a9de,_0x3e9426){this[_0xfaa7('0x4')]=uuid['v4']();this[_0xfaa7('0x5')]=_0x33da3d;this[_0xfaa7('0x6')]=_0x11070d;this[_0xfaa7('0x7')]=_0x47a9de;this['routing']=_0x3e9426;this[_0xfaa7('0x5')][_0xfaa7('0x8')](this[_0xfaa7('0x9')][_0xfaa7('0xa')](this),this[_0xfaa7('0xb')][_0xfaa7('0xa')](this));this[_0xfaa7('0x5')]['on'](_0xfaa7('0xc'),this[_0xfaa7('0xb')][_0xfaa7('0xa')](this));this['squeue']['on'](_0xfaa7('0xd'),this[_0xfaa7('0xe')][_0xfaa7('0xa')](this));};Beepall['prototype'][_0xfaa7('0x8')]=function(){this[_0xfaa7('0x5')][_0xfaa7('0x8')](this[_0xfaa7('0x9')]['bind'](this),this[_0xfaa7('0xb')][_0xfaa7('0xa')](this));};Beepall[_0xfaa7('0xf')][_0xfaa7('0xe')]=function(){this['handleTimeout'](!![]);};Beepall[_0xfaa7('0xf')]['handleRun']=function(){var _0x417728=!![];if(!_[_0xfaa7('0x10')](this[_0xfaa7('0x6')])&&!_[_0xfaa7('0x10')](this[_0xfaa7('0x6')][_0xfaa7('0x11')])&&this[_0xfaa7('0x6')][_0xfaa7('0x11')]['length']>0x0){for(var _0x349c5d=0x0,_0x1bfb81;_0x349c5d<this[_0xfaa7('0x6')][_0xfaa7('0x11')][_0xfaa7('0x12')];_0x349c5d+=0x1){_0x1bfb81=this[_0xfaa7('0x6')][_0xfaa7('0x11')][_0x349c5d]['id'];if(_[_0xfaa7('0x10')](this[_0xfaa7('0x7')][_0xfaa7('0x13')][_0x1bfb81])){logger[_0xfaa7('0x14')](_0xfaa7('0x15'),this[_0xfaa7('0x5')]['id'],_0x1bfb81);}else{if(util[_0xfaa7('0x16')](this[_0xfaa7('0x5')]['id'],this[_0xfaa7('0x7')][_0xfaa7('0x13')][_0x1bfb81],this[_0xfaa7('0x5')]['channel'],!![])){_0x417728=![];util['writeLog'](this[_0xfaa7('0x5')]['id'],this[_0xfaa7('0x7')][_0xfaa7('0x13')][_0x1bfb81],_0xfaa7('0x17'));this['realtime'][_0xfaa7('0x13')][_0x1bfb81][_0xfaa7('0x18')]=!![];this[_0xfaa7('0x7')][_0xfaa7('0x13')][_0x1bfb81][_0xfaa7('0x19')]=this[_0xfaa7('0x6')][_0xfaa7('0x1a')];util['saveWaitingNotification'](this['realtime'],this[_0xfaa7('0x3')],this[_0xfaa7('0x6')][_0xfaa7('0x11')][_0x349c5d],this[_0xfaa7('0x5')][_0xfaa7('0x1b')]);util[_0xfaa7('0x1c')](this[_0xfaa7('0x4')],this['squeue']['id'],this['realtime']['agents'][_0x1bfb81],this['queue'],this['routing']);}}}if(_0x417728){logger['debug'](_0xfaa7('0x1d'),this[_0xfaa7('0x5')]['id']);setTimeout(this[_0xfaa7('0x8')][_0xfaa7('0xa')](this),0x3e8);}}else{logger[_0xfaa7('0x14')](_0xfaa7('0x1e'),this[_0xfaa7('0x5')]['id']);setTimeout(this['push'][_0xfaa7('0xa')](this),0x3e8);}};Beepall[_0xfaa7('0xf')][_0xfaa7('0xb')]=function(_0x18fdea){if(!_['isNil'](this['queue'])&&!_[_0xfaa7('0x10')](this[_0xfaa7('0x6')][_0xfaa7('0x11')])){for(var _0x4bbdbd=0x0,_0x2b662a;_0x4bbdbd<this[_0xfaa7('0x6')][_0xfaa7('0x11')]['length'];_0x4bbdbd+=0x1){_0x2b662a=this[_0xfaa7('0x6')][_0xfaa7('0x11')][_0x4bbdbd]['id'];if(_[_0xfaa7('0x10')](this[_0xfaa7('0x7')]['agents'][_0x2b662a])){logger[_0xfaa7('0x14')](_0xfaa7('0x15'),this[_0xfaa7('0x5')]['id'],_0x2b662a);}else{util[_0xfaa7('0x1f')](this[_0xfaa7('0x4')],this[_0xfaa7('0x5')]['id'],this[_0xfaa7('0x7')][_0xfaa7('0x13')][_0x2b662a],this[_0xfaa7('0x6')],this['routing']);util[_0xfaa7('0x20')](this['squeue']['id'],this['realtime'][_0xfaa7('0x13')][_0x2b662a],_0x18fdea?_0xfaa7('0x21'):_0xfaa7('0x22'));this[_0xfaa7('0x7')][_0xfaa7('0x13')][_0x2b662a]['busy']=![];this['realtime'][_0xfaa7('0x13')][_0x2b662a][_0xfaa7('0x19')]=undefined;util[_0xfaa7('0x23')](this[_0xfaa7('0x7')],this[_0xfaa7('0x3')],this[_0xfaa7('0x7')][_0xfaa7('0x13')][_0x2b662a],this['squeue'][_0xfaa7('0x1b')]);}}}if(!_0x18fdea){setTimeout(this['push'][_0xfaa7('0xa')](this),0x3e8);}};function beepall(_0x72ed82,_0x2fc890,_0x3d0fc3,_0x107077){return new Beepall(_0x72ed82,_0x2fc890,_0x3d0fc3,_0x107077);}module['exports']=beepall;
\ No newline at end of file
index 1e7b6a0..1cf9e8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-'use strict';module['exports']={'rrmemory':require('./rrmemory'),'beepall':require('./beepall'),'agent':require('./agent')};
\ No newline at end of file
+var _0x6df2=['./rrmemory','./agent'];(function(_0x3f2cd7,_0x34bc44){var _0x4f7962=function(_0x52c234){while(--_0x52c234){_0x3f2cd7['push'](_0x3f2cd7['shift']());}};_0x4f7962(++_0x34bc44);}(_0x6df2,0x122));var _0x26df=function(_0x50b00a,_0x463b21){_0x50b00a=_0x50b00a-0x0;var _0x4a002c=_0x6df2[_0x50b00a];return _0x4a002c;};'use strict';module['exports']={'rrmemory':require(_0x26df('0x0')),'beepall':require('./beepall'),'agent':require(_0x26df('0x1'))};
\ No newline at end of file
index 05a82fa..45144b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0cf5=['handleTimeout','module','timeout','drained','prototype','handleDrained','isAgentAvailable','agents','agentId','debug','done','mapAgentsId','[%s][QUEUE]\x20try\x20with\x20%s','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','busyQueue','name','saveWaitingNotification','routing','showNotification','RINGING','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','hideNotification','writeLog','TIMEOUT','busy','removeWaitingNotification','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','queue','realtime','intervals','push','handleRun','bind'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0cf5,0xf0));var _0x50cf=function(_0x5472bc,_0x2e6658){_0x5472bc=_0x5472bc-0x0;var _0x3a07a3=_0x0cf5[_0x5472bc];return _0x3a07a3;};'use strict';var rr=require('rr');var _=require(_0x50cf('0x0'));var uuid=require(_0x50cf('0x1'));var util=require(_0x50cf('0x2'));var logger=require(_0x50cf('0x3'))('routing');var RRMemory=function(_0x2348f7,_0x8231fd,_0x280066,_0x394f2){this[_0x50cf('0x4')]=uuid['v4']();this[_0x50cf('0x5')]=_0x2348f7;this[_0x50cf('0x6')]=_0x8231fd;this[_0x50cf('0x7')]=_0x280066;this['routing']=_0x394f2;this[_0x50cf('0x8')]={};this[_0x50cf('0x5')][_0x50cf('0x9')](this[_0x50cf('0xa')][_0x50cf('0xb')](this),this[_0x50cf('0xc')]['bind'](this),this[_0x50cf('0xd')]);this['squeue']['on'](_0x50cf('0xe'),this[_0x50cf('0xc')][_0x50cf('0xb')](this));this[_0x50cf('0x5')]['on'](_0x50cf('0xf'),this['handleDrained'][_0x50cf('0xb')](this));};RRMemory[_0x50cf('0x10')]['push']=function(){this[_0x50cf('0x5')][_0x50cf('0x9')](this[_0x50cf('0xa')][_0x50cf('0xb')](this),this['handleTimeout'][_0x50cf('0xb')](this));};RRMemory[_0x50cf('0x10')][_0x50cf('0x11')]=function(){this[_0x50cf('0xc')](!![]);};RRMemory[_0x50cf('0x10')]['handleCheckReject']=function(_0x2b1f44){if(util[_0x50cf('0x12')](this[_0x50cf('0x5')]['id'],this[_0x50cf('0x7')][_0x50cf('0x13')][this[_0x50cf('0x14')]],this[_0x50cf('0x5')]['channel'],!![])){logger[_0x50cf('0x15')]('[%s][QUEUE]\x20available\x20again\x20%s',this[_0x50cf('0x5')]['id'],this[_0x50cf('0x14')]);clearInterval(this[_0x50cf('0x8')][this[_0x50cf('0x14')]]);_0x2b1f44[_0x50cf('0x16')]();setTimeout(this[_0x50cf('0x9')][_0x50cf('0xb')](this),0x3e8);}};RRMemory[_0x50cf('0x10')][_0x50cf('0xa')]=function(_0xd182c0){this['agentId']=rr(this[_0x50cf('0x6')][_0x50cf('0x17')]);logger[_0x50cf('0x15')](_0x50cf('0x18'),this[_0x50cf('0x5')]['id'],this[_0x50cf('0x14')]);if(_[_0x50cf('0x19')](this['realtime'][_0x50cf('0x13')][this[_0x50cf('0x14')]])){logger[_0x50cf('0x15')](_0x50cf('0x1a'),this['squeue']['id'],this[_0x50cf('0x14')]);_0xd182c0['done']();setTimeout(this[_0x50cf('0x9')]['bind'](this),0x3e8);}else{if(util[_0x50cf('0x12')](this[_0x50cf('0x5')]['id'],this['realtime'][_0x50cf('0x13')][this[_0x50cf('0x14')]],this[_0x50cf('0x5')][_0x50cf('0x1b')],!![])){this['realtime'][_0x50cf('0x13')][this[_0x50cf('0x14')]]['busy']=!![];this[_0x50cf('0x7')][_0x50cf('0x13')][this[_0x50cf('0x14')]][_0x50cf('0x1c')]=this[_0x50cf('0x6')][_0x50cf('0x1d')];util[_0x50cf('0x1e')](this['realtime'],this[_0x50cf('0x1f')],this[_0x50cf('0x7')][_0x50cf('0x13')][this[_0x50cf('0x14')]],this[_0x50cf('0x5')][_0x50cf('0x1b')]);util[_0x50cf('0x20')](this[_0x50cf('0x4')],this[_0x50cf('0x5')]['id'],this[_0x50cf('0x7')][_0x50cf('0x13')][this[_0x50cf('0x14')]],this[_0x50cf('0x6')],this['routing']);util['writeLog'](this[_0x50cf('0x5')]['id'],this[_0x50cf('0x7')][_0x50cf('0x13')][this[_0x50cf('0x14')]],_0x50cf('0x21'));this[_0x50cf('0x8')][this[_0x50cf('0x14')]]=setInterval(this['handleCheckReject'][_0x50cf('0xb')](this,_0xd182c0),0x3e8);}else{logger['debug'](_0x50cf('0x22'),this['squeue']['id'],this[_0x50cf('0x14')]);_0xd182c0[_0x50cf('0x16')]();setTimeout(this[_0x50cf('0x9')][_0x50cf('0xb')](this),0x3e8);}}};RRMemory['prototype'][_0x50cf('0xc')]=function(_0x2f641c){logger[_0x50cf('0x15')](_0x50cf('0x23'),this[_0x50cf('0x5')]['id'],this[_0x50cf('0x14')]);if(_[_0x50cf('0x19')](this['realtime'][_0x50cf('0x13')][this[_0x50cf('0x14')]])){logger[_0x50cf('0x15')](_0x50cf('0x1a'),this['squeue']['id'],this[_0x50cf('0x14')]);}else{clearInterval(this[_0x50cf('0x8')][this[_0x50cf('0x14')]]);util[_0x50cf('0x24')](this['notificationId'],this[_0x50cf('0x5')]['id'],this[_0x50cf('0x7')][_0x50cf('0x13')][this[_0x50cf('0x14')]],this['queue'],this['routing']);util[_0x50cf('0x25')](this[_0x50cf('0x5')]['id'],this[_0x50cf('0x7')]['agents'][this['agentId']],_0x50cf('0x26'));this[_0x50cf('0x7')]['agents'][this[_0x50cf('0x14')]][_0x50cf('0x27')]=![];this[_0x50cf('0x7')][_0x50cf('0x13')][this[_0x50cf('0x14')]][_0x50cf('0x1c')]=undefined;util[_0x50cf('0x28')](this[_0x50cf('0x7')],this[_0x50cf('0x1f')],this[_0x50cf('0x7')][_0x50cf('0x13')][this[_0x50cf('0x14')]],this['squeue'][_0x50cf('0x1b')]);}if(!_0x2f641c){setTimeout(this[_0x50cf('0x9')][_0x50cf('0xb')](this),0x3e8);}};function rrmemory(_0x5a3cd7,_0x1ab776,_0x16e9b9,_0xb59b0c){return new RRMemory(_0x5a3cd7,_0x1ab776,_0x16e9b9,_0xb59b0c);}module[_0x50cf('0x29')]=rrmemory;
\ No newline at end of file
+var _0xd9e4=['notificationId','squeue','queue','realtime','intervals','handleRun','bind','handleTimeout','module','timeout','prototype','push','handleDrained','handleCheckReject','isAgentAvailable','agents','agentId','channel','[%s][QUEUE]\x20available\x20again\x20%s','done','mapAgentsId','debug','[%s][QUEUE]\x20try\x20with\x20%s','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busy','busyQueue','RINGING','[%s][QUEUE]\x20timeout\x20with\x20%s','hideNotification','writeLog','TIMEOUT','lodash','./util','../../../../../config/logger','routing'];(function(_0x191154,_0x56f74c){var _0x3dcd73=function(_0x51c321){while(--_0x51c321){_0x191154['push'](_0x191154['shift']());}};_0x3dcd73(++_0x56f74c);}(_0xd9e4,0x1f4));var _0x4d9e=function(_0x44b0de,_0x213afa){_0x44b0de=_0x44b0de-0x0;var _0x21da2a=_0xd9e4[_0x44b0de];return _0x21da2a;};'use strict';var rr=require('rr');var _=require(_0x4d9e('0x0'));var uuid=require('uuid');var util=require(_0x4d9e('0x1'));var logger=require(_0x4d9e('0x2'))(_0x4d9e('0x3'));var RRMemory=function(_0x410a05,_0x4b8083,_0x7552af,_0x379344){this[_0x4d9e('0x4')]=uuid['v4']();this[_0x4d9e('0x5')]=_0x410a05;this[_0x4d9e('0x6')]=_0x4b8083;this[_0x4d9e('0x7')]=_0x7552af;this['routing']=_0x379344;this[_0x4d9e('0x8')]={};this[_0x4d9e('0x5')]['push'](this[_0x4d9e('0x9')][_0x4d9e('0xa')](this),this[_0x4d9e('0xb')]['bind'](this),this[_0x4d9e('0xc')]);this['squeue']['on'](_0x4d9e('0xd'),this[_0x4d9e('0xb')][_0x4d9e('0xa')](this));this[_0x4d9e('0x5')]['on']('drained',this['handleDrained'][_0x4d9e('0xa')](this));};RRMemory[_0x4d9e('0xe')][_0x4d9e('0xf')]=function(){this[_0x4d9e('0x5')][_0x4d9e('0xf')](this[_0x4d9e('0x9')][_0x4d9e('0xa')](this),this[_0x4d9e('0xb')]['bind'](this));};RRMemory[_0x4d9e('0xe')][_0x4d9e('0x10')]=function(){this[_0x4d9e('0xb')](!![]);};RRMemory['prototype'][_0x4d9e('0x11')]=function(_0x467ab6){if(util[_0x4d9e('0x12')](this[_0x4d9e('0x5')]['id'],this[_0x4d9e('0x7')][_0x4d9e('0x13')][this[_0x4d9e('0x14')]],this[_0x4d9e('0x5')][_0x4d9e('0x15')],!![])){logger['debug'](_0x4d9e('0x16'),this['squeue']['id'],this['agentId']);clearInterval(this['intervals'][this['agentId']]);_0x467ab6[_0x4d9e('0x17')]();setTimeout(this[_0x4d9e('0xf')][_0x4d9e('0xa')](this),0x3e8);}};RRMemory[_0x4d9e('0xe')]['handleRun']=function(_0x3d14a8){this['agentId']=rr(this[_0x4d9e('0x6')][_0x4d9e('0x18')]);logger[_0x4d9e('0x19')](_0x4d9e('0x1a'),this[_0x4d9e('0x5')]['id'],this[_0x4d9e('0x14')]);if(_[_0x4d9e('0x1b')](this[_0x4d9e('0x7')][_0x4d9e('0x13')][this[_0x4d9e('0x14')]])){logger['debug'](_0x4d9e('0x1c'),this[_0x4d9e('0x5')]['id'],this['agentId']);_0x3d14a8[_0x4d9e('0x17')]();setTimeout(this[_0x4d9e('0xf')][_0x4d9e('0xa')](this),0x3e8);}else{if(util[_0x4d9e('0x12')](this['squeue']['id'],this[_0x4d9e('0x7')]['agents'][this['agentId']],this[_0x4d9e('0x5')]['channel'],!![])){this[_0x4d9e('0x7')][_0x4d9e('0x13')][this[_0x4d9e('0x14')]][_0x4d9e('0x1d')]=!![];this[_0x4d9e('0x7')]['agents'][this[_0x4d9e('0x14')]][_0x4d9e('0x1e')]=this[_0x4d9e('0x6')]['name'];util['saveWaitingNotification'](this[_0x4d9e('0x7')],this[_0x4d9e('0x3')],this[_0x4d9e('0x7')]['agents'][this[_0x4d9e('0x14')]],this[_0x4d9e('0x5')][_0x4d9e('0x15')]);util['showNotification'](this[_0x4d9e('0x4')],this[_0x4d9e('0x5')]['id'],this[_0x4d9e('0x7')]['agents'][this[_0x4d9e('0x14')]],this[_0x4d9e('0x6')],this[_0x4d9e('0x3')]);util['writeLog'](this[_0x4d9e('0x5')]['id'],this[_0x4d9e('0x7')][_0x4d9e('0x13')][this[_0x4d9e('0x14')]],_0x4d9e('0x1f'));this['intervals'][this[_0x4d9e('0x14')]]=setInterval(this[_0x4d9e('0x11')][_0x4d9e('0xa')](this,_0x3d14a8),0x3e8);}else{logger['debug']('[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s',this['squeue']['id'],this['agentId']);_0x3d14a8[_0x4d9e('0x17')]();setTimeout(this[_0x4d9e('0xf')][_0x4d9e('0xa')](this),0x3e8);}}};RRMemory['prototype'][_0x4d9e('0xb')]=function(_0x496fd8){logger['debug'](_0x4d9e('0x20'),this['squeue']['id'],this[_0x4d9e('0x14')]);if(_[_0x4d9e('0x1b')](this[_0x4d9e('0x7')][_0x4d9e('0x13')][this[_0x4d9e('0x14')]])){logger[_0x4d9e('0x19')](_0x4d9e('0x1c'),this['squeue']['id'],this['agentId']);}else{clearInterval(this[_0x4d9e('0x8')][this[_0x4d9e('0x14')]]);util[_0x4d9e('0x21')](this[_0x4d9e('0x4')],this['squeue']['id'],this[_0x4d9e('0x7')][_0x4d9e('0x13')][this[_0x4d9e('0x14')]],this[_0x4d9e('0x6')],this[_0x4d9e('0x3')]);util[_0x4d9e('0x22')](this[_0x4d9e('0x5')]['id'],this[_0x4d9e('0x7')][_0x4d9e('0x13')][this[_0x4d9e('0x14')]],_0x4d9e('0x23'));this['realtime'][_0x4d9e('0x13')][this[_0x4d9e('0x14')]][_0x4d9e('0x1d')]=![];this[_0x4d9e('0x7')]['agents'][this[_0x4d9e('0x14')]][_0x4d9e('0x1e')]=undefined;util['removeWaitingNotification'](this[_0x4d9e('0x7')],this[_0x4d9e('0x3')],this[_0x4d9e('0x7')][_0x4d9e('0x13')][this[_0x4d9e('0x14')]],this[_0x4d9e('0x5')][_0x4d9e('0x15')]);}if(!_0x496fd8){setTimeout(this[_0x4d9e('0xf')]['bind'](this),0x3e8);}};function rrmemory(_0x418495,_0x46127d,_0x39de59,_0x4b4b3e){return new RRMemory(_0x418495,_0x46127d,_0x39de59,_0x4b4b3e);}module['exports']=rrmemory;
\ No newline at end of file
index 11ccead..cb75156 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x131a=['isAgentAvailable','busy','Pause','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','interaction','UserId','capitalize','InteractionId','some','agents','WaitingInteractions','removeWaitingNotification','writeLog','lodash','../../../../../config/environment','../../../../../config/logger','routing','defaults','redis','user:%s','name','emit','user:save','split','\x20interaction','account','notificationSound','notificationShake','body','queue','getMustacheRender','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','format','notification:%s','save','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]'];(function(_0x92fb15,_0x12bfac){var _0x5ac621=function(_0x59969f){while(--_0x59969f){_0x92fb15['push'](_0x92fb15['shift']());}};_0x5ac621(++_0x12bfac);}(_0x131a,0x1f2));var _0xa131=function(_0x5b99f8,_0x2e09d8){_0x5b99f8=_0x5b99f8-0x0;var _0x11ed4e=_0x131a[_0x5b99f8];return _0x11ed4e;};'use strict';var _=require(_0xa131('0x0'));var util=require('util');var utils=require('../utils');var Redis=require('ioredis');var config=require(_0xa131('0x1'));var logger=require(_0xa131('0x2'))(_0xa131('0x3'));config['redis']=_[_0xa131('0x4')](config[_0xa131('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function sendNotification(_0x37949c,_0x620028,_0x4ba222,_0x39d037,_0x74ea24,_0x40bf93){io['to'](util['format'](_0xa131('0x6'),_0x39d037[_0xa131('0x7')]))[_0xa131('0x8')](_0xa131('0x9'),_0x39d037);var _0x709a03=_0x40bf93||{};var _0xd4622=_0x4ba222[_0xa131('0xa')]('.');var _0x323101={'uniqueid':_0x620028,'channel':_0xd4622[0x0],'id':_0xd4622[0x1],'title':_0xd4622[0x0]+_0xa131('0xb'),'interactionId':_0xd4622[0x2],'queue':_0x74ea24?_0x74ea24[_0xa131('0x7')]:null,'sound':_0x709a03[_0xa131('0xc')][_0xa131('0xd')],'shake':_0x709a03[_0xa131('0xc')][_0xa131('0xe')]};try{if(!_0x709a03[_0xa131('0xf')]){_0x709a03[_0xa131('0xf')]={};}if(_0x74ea24){_0x709a03[_0xa131('0xf')][_0xa131('0x10')]=_0x74ea24;}else if(_0x709a03[_0xa131('0xf')]['queue']){delete _0x709a03[_0xa131('0xf')][_0xa131('0x10')];}_0x323101['msg']=utils[_0xa131('0x11')](_0x709a03[_0xa131('0xc')][_0xa131('0x12')],_0x709a03);}catch(_0x2d7195){_0x323101[_0xa131('0x13')]=_0xa131('0x14');logger[_0xa131('0x15')](util['format'](_0xa131('0x16'),_0x620028,_0x2d7195[_0xa131('0x17')]));}io['to'](util['format'](_0xa131('0x6'),_0x39d037[_0xa131('0x7')]))[_0xa131('0x8')](util[_0xa131('0x18')](_0xa131('0x19'),_0x37949c?_0xa131('0x1a'):_0xa131('0x1b')),_0x323101);}function writeLog(_0x287f9b,_0x571f97,_0x8a9e9e){return logger[_0xa131('0x1c')](util['format'](_0xa131('0x1d'),_0x287f9b,_0x571f97['name'],_0x8a9e9e));}exports[_0xa131('0x1e')]=function(_0x228cad,_0x4b6d46,_0x35e368,_0x230ede){if(_0x4b6d46[_0xa131('0x1f')]){writeLog(_0x228cad,_0x4b6d46,'BUSY');return![];}if(!_0x4b6d46['online']){writeLog(_0x228cad,_0x4b6d46,'OFFLINE');return![];}if(_0x4b6d46[_0x35e368+_0xa131('0x20')]){writeLog(_0x228cad,_0x4b6d46,'PAUSE');return![];}if(_0x230ede&&_0x4b6d46['hasOwnProperty'](_0x35e368+_0xa131('0x21'))&&_0x4b6d46['hasOwnProperty'](_0x35e368+_0xa131('0x22'))){if(_0x4b6d46[_0x35e368+_0xa131('0x21')]>0x0&&_0x4b6d46[_0x35e368+_0xa131('0x22')]>=_0x4b6d46[_0x35e368+_0xa131('0x21')]){writeLog(_0x228cad,_0x4b6d46,_0x35e368[_0xa131('0x23')]()+_0xa131('0x24'));return![];}}return!![];};exports[_0xa131('0x25')]=function(_0x5dc35f,_0x54ef1a,_0xe0e8e6,_0xa17b2b,_0x132ab0){return sendNotification(!![],_0x5dc35f,_0x54ef1a,_0xe0e8e6,_0xa17b2b,_0x132ab0);};exports[_0xa131('0x26')]=function(_0x47574e,_0x21b927,_0x342eba,_0x5c5532,_0x165df5){return sendNotification(![],_0x47574e,_0x21b927,_0x342eba,_0x5c5532,_0x165df5);};exports['checkWaitingNotifications']=function(_0x5f5724,_0x233056,_0x2e4b3d){var _0x50874d=_0x233056[_0xa131('0x27')][_0xa131('0x28')];if(!_0x50874d&&_0x2e4b3d){_0x50874d=_0x2e4b3d['id'];}var _0x4b5993=_['some'](_0x5f5724[_0x233056['channel']+'QueuesWaitingInteractions'],function(_0x5eb109){var _0x3890df=_[_0xa131('0x29')](_0x233056['channel'])+_0xa131('0x2a');return _0x5eb109[_0x3890df]===_0x233056[_0xa131('0x27')]['id'];});if(!_0x4b5993&&_0x50874d){_0x4b5993=_[_0xa131('0x2b')](_0x5f5724[_0xa131('0x2c')][_0x50874d][_0x233056['channel']+_0xa131('0x2d')],function(_0x202e8f){return _0x202e8f['id']===_0x233056[_0xa131('0x27')]['id'];});}return _0x4b5993;};exports['saveWaitingNotification']=function(_0x117622,_0xcc7981,_0xf95754,_0x18e725){_0x117622[_0xa131('0x2c')][_0xf95754['id']][_0x18e725+_0xa131('0x2d')][_0xcc7981[_0xa131('0x17')]['id']]={'id':_0xcc7981[_0xa131('0x27')]['id']};};exports[_0xa131('0x2e')]=function(_0x437dd5,_0x5a4ba2,_0xfaed8b,_0x3dd9a8){delete _0x437dd5[_0xa131('0x2c')][_0xfaed8b['id']][_0x3dd9a8+_0xa131('0x2d')][_0x5a4ba2[_0xa131('0x17')]['id']];};exports[_0xa131('0x2f')]=writeLog;
\ No newline at end of file
+var _0x3fa6=['showNotification','hideNotification','checkWaitingNotifications','interaction','UserId','some','channel','InteractionId','agents','WaitingInteractions','saveWaitingNotification','message','removeWaitingNotification','writeLog','lodash','util','ioredis','../../../../../config/logger','redis','defaults','localhost','socket.io-emitter','format','user:%s','name','emit','user:save','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','notification:%s','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY'];(function(_0x3a1b90,_0x3c0158){var _0xf6de77=function(_0x396533){while(--_0x396533){_0x3a1b90['push'](_0x3a1b90['shift']());}};_0xf6de77(++_0x3c0158);}(_0x3fa6,0xb0));var _0x63fa=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x3fa6[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0x63fa('0x0'));var util=require(_0x63fa('0x1'));var utils=require('../utils');var Redis=require(_0x63fa('0x2'));var config=require('../../../../../config/environment');var logger=require(_0x63fa('0x3'))('routing');config[_0x63fa('0x4')]=_[_0x63fa('0x5')](config[_0x63fa('0x4')],{'host':_0x63fa('0x6'),'port':0x18eb});var io=require(_0x63fa('0x7'))(new Redis(config[_0x63fa('0x4')]));function sendNotification(_0x3654e8,_0x6584d6,_0xbb127e,_0x1610aa,_0x2c6a28,_0x188c82){io['to'](util[_0x63fa('0x8')](_0x63fa('0x9'),_0x1610aa[_0x63fa('0xa')]))[_0x63fa('0xb')](_0x63fa('0xc'),_0x1610aa);var _0x5a2eb5=_0x188c82||{};var _0x2fe9cd=_0xbb127e['split']('.');var _0x245454={'uniqueid':_0x6584d6,'channel':_0x2fe9cd[0x0],'id':_0x2fe9cd[0x1],'title':_0x2fe9cd[0x0]+_0x63fa('0xd'),'interactionId':_0x2fe9cd[0x2],'queue':_0x2c6a28?_0x2c6a28[_0x63fa('0xa')]:null,'sound':_0x5a2eb5[_0x63fa('0xe')][_0x63fa('0xf')],'shake':_0x5a2eb5[_0x63fa('0xe')][_0x63fa('0x10')]};try{if(!_0x5a2eb5[_0x63fa('0x11')]){_0x5a2eb5[_0x63fa('0x11')]={};}if(_0x2c6a28){_0x5a2eb5[_0x63fa('0x11')][_0x63fa('0x12')]=_0x2c6a28;}else if(_0x5a2eb5[_0x63fa('0x11')][_0x63fa('0x12')]){delete _0x5a2eb5[_0x63fa('0x11')]['queue'];}_0x245454[_0x63fa('0x13')]=utils['getMustacheRender'](_0x5a2eb5[_0x63fa('0xe')][_0x63fa('0x14')],_0x5a2eb5);}catch(_0xb2e732){_0x245454[_0x63fa('0x13')]=_0x63fa('0x15');logger[_0x63fa('0x16')](util[_0x63fa('0x8')](_0x63fa('0x17'),_0x6584d6,_0xb2e732['message']));}io['to'](util['format'](_0x63fa('0x9'),_0x1610aa['name']))[_0x63fa('0xb')](util['format'](_0x63fa('0x18'),_0x3654e8?'save':_0x63fa('0x19')),_0x245454);}function writeLog(_0x5acc9c,_0x531180,_0x4ddfc7){return logger[_0x63fa('0x1a')](util[_0x63fa('0x8')](_0x63fa('0x1b'),_0x5acc9c,_0x531180[_0x63fa('0xa')],_0x4ddfc7));}exports[_0x63fa('0x1c')]=function(_0x21e7fc,_0x20f7a2,_0x1085a6,_0x3f1a3a){if(_0x20f7a2[_0x63fa('0x1d')]){writeLog(_0x21e7fc,_0x20f7a2,_0x63fa('0x1e'));return![];}if(!_0x20f7a2[_0x63fa('0x1f')]){writeLog(_0x21e7fc,_0x20f7a2,_0x63fa('0x20'));return![];}if(_0x20f7a2[_0x1085a6+_0x63fa('0x21')]){writeLog(_0x21e7fc,_0x20f7a2,_0x63fa('0x22'));return![];}if(_0x3f1a3a&&_0x20f7a2[_0x63fa('0x23')](_0x1085a6+_0x63fa('0x24'))&&_0x20f7a2['hasOwnProperty'](_0x1085a6+_0x63fa('0x25'))){if(_0x20f7a2[_0x1085a6+_0x63fa('0x24')]>0x0&&_0x20f7a2[_0x1085a6+_0x63fa('0x25')]>=_0x20f7a2[_0x1085a6+_0x63fa('0x24')]){writeLog(_0x21e7fc,_0x20f7a2,_0x1085a6[_0x63fa('0x26')]()+_0x63fa('0x27'));return![];}}return!![];};exports[_0x63fa('0x28')]=function(_0x4826f0,_0x2c302e,_0x5ba958,_0x48fb4f,_0x55f553){return sendNotification(!![],_0x4826f0,_0x2c302e,_0x5ba958,_0x48fb4f,_0x55f553);};exports[_0x63fa('0x29')]=function(_0x426c15,_0x3dd4ae,_0x3236d4,_0x46c2ec,_0x2e579a){return sendNotification(![],_0x426c15,_0x3dd4ae,_0x3236d4,_0x46c2ec,_0x2e579a);};exports[_0x63fa('0x2a')]=function(_0x582aea,_0x1e5fbc,_0x27e01f){var _0x30e692=_0x1e5fbc[_0x63fa('0x2b')][_0x63fa('0x2c')];if(!_0x30e692&&_0x27e01f){_0x30e692=_0x27e01f['id'];}var _0x8ad648=_[_0x63fa('0x2d')](_0x582aea[_0x1e5fbc[_0x63fa('0x2e')]+'QueuesWaitingInteractions'],function(_0x703e6){var _0x5d450e=_['capitalize'](_0x1e5fbc[_0x63fa('0x2e')])+_0x63fa('0x2f');return _0x703e6[_0x5d450e]===_0x1e5fbc[_0x63fa('0x2b')]['id'];});if(!_0x8ad648&&_0x30e692){_0x8ad648=_[_0x63fa('0x2d')](_0x582aea[_0x63fa('0x30')][_0x30e692][_0x1e5fbc[_0x63fa('0x2e')]+_0x63fa('0x31')],function(_0x27d84c){return _0x27d84c['id']===_0x1e5fbc[_0x63fa('0x2b')]['id'];});}return _0x8ad648;};exports[_0x63fa('0x32')]=function(_0x5001f0,_0x4d66d5,_0x4ad3fe,_0x387c53){_0x5001f0['agents'][_0x4ad3fe['id']][_0x387c53+_0x63fa('0x31')][_0x4d66d5[_0x63fa('0x33')]['id']]={'id':_0x4d66d5['interaction']['id']};};exports[_0x63fa('0x34')]=function(_0x3983cc,_0x13b30a,_0x5a1def,_0x1267b5){delete _0x3983cc['agents'][_0x5a1def['id']][_0x1267b5+_0x63fa('0x31')][_0x13b30a[_0x63fa('0x33')]['id']];};exports[_0x63fa('0x35')]=writeLog;
\ No newline at end of file
index 6206e94..e362c59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5109=['stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash','./utils','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','info','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','next','isObject'];(function(_0x4ee386,_0x1a9032){var _0x42450c=function(_0x51d08c){while(--_0x51d08c){_0x4ee386['push'](_0x4ee386['shift']());}};_0x42450c(++_0x1a9032);}(_0x5109,0xb8));var _0x9510=function(_0x156fda,_0x236d16){_0x156fda=_0x156fda-0x0;var _0x1d520b=_0x5109[_0x156fda];return _0x1d520b;};'use strict';var schema=require(_0x9510('0x0'));var sh=require(_0x9510('0x1'));var _=require(_0x9510('0x2'));var utils=require(_0x9510('0x3'));var logger=require(_0x9510('0x4'))('routing');var system=schema({'command':{'type':_0x9510('0x5'),'required':!![],'message':_0x9510('0x6')}});exports[_0x9510('0x7')]=function(_0x31c003,_0x42ee5a){return function(_0x2f54b3){try{var _0x240d1a={'command':_0x42ee5a[0x0]};var _0x156535=system['validate'](_0x240d1a,{'typecast':!![]});if(_0x156535[_0x9510('0x8')]){logger[_0x9510('0x9')](_0x9510('0xa'),_0x31c003,_[_0x9510('0xb')](_0x156535,_0x9510('0xc'))['join'](',\x20'));logger[_0x9510('0xd')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x31c003);_0x2f54b3['next']();}else{var _0xb27af0=this;var _0x183754=utils[_0x9510('0xe')](_0x42ee5a[0x0],this);logger[_0x9510('0xd')](_0x9510('0xf'),_0x31c003,_0x183754);sh[_0x9510('0x10')](_[_0x9510('0x11')](_0x183754),function(_0x2a457a,_0x4bcad8){logger[_0x9510('0xd')](_0x9510('0x12'),_0x31c003,_0x2a457a);if(_0x2a457a==0x0){var _0x335767=_0x4bcad8['replace'](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x42ee5a[0x1])||_[_0x9510('0x13')](_0x42ee5a[0x1])){logger[_0x9510('0xd')](_0x9510('0x14'),_0x31c003);_0xb27af0[_0x9510('0x15')][_0x42ee5a[0x1]]=_0x335767;}else{logger[_0x9510('0xd')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x31c003,_0x42ee5a[0x1],_0x335767);_0xb27af0['body'][_0x42ee5a[0x1]]=_0x335767;}}_0x2f54b3[_0x9510('0x16')]();});}}catch(_0x22d8a7){logger[_0x9510('0x9')](_0x9510('0xa'),_0x31c003,_[_0x9510('0x17')](_0x22d8a7)?JSON[_0x9510('0x18')](_0x22d8a7):_0x22d8a7);logger[_0x9510('0xd')](_0x9510('0x19'),_0x31c003);_0x2f54b3['next']();}};};
\ No newline at end of file
+var _0x4e40=['shelljs','./utils','../../../../config/logger','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','isObject','stringify','validate'];(function(_0x5129c5,_0x1c89ec){var _0x2af125=function(_0x28186d){while(--_0x28186d){_0x5129c5['push'](_0x5129c5['shift']());}};_0x2af125(++_0x1c89ec);}(_0x4e40,0x1a8));var _0x04e4=function(_0x3df0f9,_0x544a76){_0x3df0f9=_0x3df0f9-0x0;var _0x189d47=_0x4e40[_0x3df0f9];return _0x189d47;};'use strict';var schema=require(_0x04e4('0x0'));var sh=require(_0x04e4('0x1'));var _=require('lodash');var utils=require(_0x04e4('0x2'));var logger=require(_0x04e4('0x3'))('routing');var system=schema({'command':{'type':'string','required':!![],'message':_0x04e4('0x4')}});exports[_0x04e4('0x5')]=function(_0x1abfb3,_0x278587){return function(_0x2d3684){try{var _0x5449cb={'command':_0x278587[0x0]};var _0x548e85=system[_0x04e4('0x0')](_0x5449cb,{'typecast':!![]});if(_0x548e85[_0x04e4('0x6')]){logger[_0x04e4('0x7')](_0x04e4('0x8'),_0x1abfb3,_['map'](_0x548e85,'message')['join'](',\x20'));logger[_0x04e4('0x9')](_0x04e4('0xa'),_0x1abfb3);_0x2d3684[_0x04e4('0xb')]();}else{var _0x24c75b=this;var _0x474583=utils[_0x04e4('0xc')](_0x278587[0x0],this);logger[_0x04e4('0x9')](_0x04e4('0xd'),_0x1abfb3,_0x474583);sh[_0x04e4('0xe')](_[_0x04e4('0xf')](_0x474583),function(_0x4f1735,_0x299d6d){logger[_0x04e4('0x9')](_0x04e4('0x10'),_0x1abfb3,_0x4f1735);if(_0x4f1735==0x0){var _0x534f9a=_0x299d6d[_0x04e4('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x04e4('0x12')](_0x278587[0x1])||_[_0x04e4('0x13')](_0x278587[0x1])){logger['info'](_0x04e4('0x14'),_0x1abfb3);_0x24c75b['body'][_0x278587[0x1]]=_0x534f9a;}else{logger[_0x04e4('0x9')](_0x04e4('0x15'),_0x1abfb3,_0x278587[0x1],_0x534f9a);_0x24c75b[_0x04e4('0x16')][_0x278587[0x1]]=_0x534f9a;}}_0x2d3684['next']();});}}catch(_0x536b6a){logger[_0x04e4('0x7')]('[%s][SYSTEM]\x20%s',_0x1abfb3,_[_0x04e4('0x17')](_0x536b6a)?JSON[_0x04e4('0x18')](_0x536b6a):_0x536b6a);logger[_0x04e4('0x9')](_0x04e4('0xa'),_0x1abfb3);_0x2d3684[_0x04e4('0xb')]();}};};
\ No newline at end of file
index 53879e6..6a9f1ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x859f=['addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s','stringify','finally','error','isObject','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','map','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','channel'];(function(_0x2c0b12,_0x599255){var _0x4c54fc=function(_0x397498){while(--_0x397498){_0x2c0b12['push'](_0x2c0b12['shift']());}};_0x4c54fc(++_0x599255);}(_0x859f,0xa6));var _0xf859=function(_0x58a107,_0x401444){_0x58a107=_0x58a107-0x0;var _0x526613=_0x859f[_0x58a107];return _0x526613;};'use strict';var schema=require('validate');var _=require('lodash');var rpc={'chatInteraction':require(_0xf859('0x0')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xf859('0x1')),'faxInteraction':require(_0xf859('0x2')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require('../../../../config/logger')(_0xf859('0x3'));var tag=schema({'tag':{'type':_0xf859('0x4'),'required':!![],'message':_0xf859('0x5')}});exports[_0xf859('0x6')]=function(_0x84c84c,_0x48a2e9,_0x1d1ccc,_0x29ec17){return function(_0x2722d0){try{var _0x4404e7={'tag':_0x48a2e9[0x0]};var _0x4cec58=tag[_0xf859('0x7')](_0x4404e7,{'typecast':!![]});if(_0x4cec58[_0xf859('0x8')]){logger['error']('[%s][TAG]\x20%s',_0x84c84c,_[_0xf859('0x9')](_0x4cec58,_0xf859('0xa'))['join'](',\x20'));logger[_0xf859('0xb')](_0xf859('0xc'),_0x84c84c);_0x2722d0[_0xf859('0xd')]();}else{var _0x5d3b6f={'ids':[_0x48a2e9[0x0]]};if(rpc[_0x29ec17['channel']+_0xf859('0xe')]){rpc[_0x29ec17[_0xf859('0xf')]+_0xf859('0xe')][_0xf859('0x10')](_0x29ec17[_0xf859('0x11')]['id'],_0x5d3b6f)[_0xf859('0x12')](function(_0x419256){logger[_0xf859('0xb')](_0xf859('0x13'),_0x84c84c,_0x48a2e9[0x1],_0x29ec17[_0xf859('0xf')],_0x29ec17[_0xf859('0x11')]['id']);})[_0xf859('0x14')](function(_0x2f6ce9){logger['error'](_0xf859('0x15'),_0x84c84c,JSON[_0xf859('0x16')](_0x2f6ce9));logger[_0xf859('0xb')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x84c84c);})[_0xf859('0x17')](function(){_0x2722d0[_0xf859('0xd')]();});}}}catch(_0x46cf96){logger[_0xf859('0x18')](_0xf859('0x15'),_0x84c84c,_[_0xf859('0x19')](_0x46cf96)?JSON['stringify'](_0x46cf96):_0x46cf96);logger['info'](_0xf859('0xc'),_0x84c84c);_0x2722d0[_0xf859('0xd')]();}};};
\ No newline at end of file
+var _0x13e8=['../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','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','[%s][TAG]\x20%s','stringify','isObject','../../rpc/chatInteraction'];(function(_0x365e54,_0x44be74){var _0x13317a=function(_0x2d917f){while(--_0x2d917f){_0x365e54['push'](_0x365e54['shift']());}};_0x13317a(++_0x44be74);}(_0x13e8,0x179));var _0x813e=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x13e8[_0x59ee6f];return _0x4c0979;};'use strict';var schema=require('validate');var _=require('lodash');var rpc={'chatInteraction':require(_0x813e('0x0')),'openchannelInteraction':require(_0x813e('0x1')),'smsInteraction':require(_0x813e('0x2')),'mailInteraction':require(_0x813e('0x3')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x813e('0x4'))(_0x813e('0x5'));var tag=schema({'tag':{'type':_0x813e('0x6'),'required':!![],'message':_0x813e('0x7')}});exports[_0x813e('0x8')]=function(_0x26f2ca,_0x3f2feb,_0x32e2df,_0x360c56){return function(_0x373bde){try{var _0x1f508f={'tag':_0x3f2feb[0x0]};var _0x3c0604=tag[_0x813e('0x9')](_0x1f508f,{'typecast':!![]});if(_0x3c0604[_0x813e('0xa')]){logger[_0x813e('0xb')]('[%s][TAG]\x20%s',_0x26f2ca,_[_0x813e('0xc')](_0x3c0604,_0x813e('0xd'))[_0x813e('0xe')](',\x20'));logger[_0x813e('0xf')](_0x813e('0x10'),_0x26f2ca);_0x373bde[_0x813e('0x11')]();}else{var _0x37cae3={'ids':[_0x3f2feb[0x0]]};if(rpc[_0x360c56[_0x813e('0x12')]+_0x813e('0x13')]){rpc[_0x360c56[_0x813e('0x12')]+'Interaction'][_0x813e('0x14')](_0x360c56[_0x813e('0x15')]['id'],_0x37cae3)[_0x813e('0x16')](function(_0x4ce5d6){logger[_0x813e('0xf')](_0x813e('0x17'),_0x26f2ca,_0x3f2feb[0x1],_0x360c56[_0x813e('0x12')],_0x360c56[_0x813e('0x15')]['id']);})['catch'](function(_0x584ec0){logger[_0x813e('0xb')](_0x813e('0x18'),_0x26f2ca,JSON[_0x813e('0x19')](_0x584ec0));logger[_0x813e('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x26f2ca);})['finally'](function(){_0x373bde[_0x813e('0x11')]();});}}}catch(_0x1049df){logger[_0x813e('0xb')]('[%s][TAG]\x20%s',_0x26f2ca,_[_0x813e('0x1a')](_0x1049df)?JSON[_0x813e('0x19')](_0x1049df):_0x1049df);logger[_0x813e('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x26f2ca);_0x373bde[_0x813e('0x11')]();}};};
\ No newline at end of file
index 90f398f..1084655 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x929c=['then','result','logged','&data=','info','stop','catch','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','replace','\x20-\x20','includes','?params=','title','jsonrpc','2.0','login','push','params','stringify','POST','application/json-rpc'];(function(_0x3b76f7,_0x566c53){var _0x43984e=function(_0x164f77){while(--_0x164f77){_0x3b76f7['push'](_0x3b76f7['shift']());}};_0x43984e(++_0x566c53);}(_0x929c,0x1b0));var _0xc929=function(_0x4f1574,_0x55a234){_0x4f1574=_0x4f1574-0x0;var _0x3bf8f9=_0x929c[_0x4f1574];return _0x3bf8f9;};'use strict';var rp=require(_0xc929('0x0'));var logger=require(_0xc929('0x1'))(_0xc929('0x2'));var _=require('lodash');var arr=[];exports['consequence']=function(_0x1268e3,_0x33d7c2){return function(_0x3ff125){var _0x555ff0=_0x33d7c2[0xa];var _0x270852=_0x33d7c2[0xb];var _0x4a47c2=_0x33d7c2[0xc];var _0x34bf6f=_0x33d7c2[0xd];var _0x3c6047=_0x33d7c2[0xe];var _0x4a4d7e=_0x33d7c2[0xf][_0xc929('0x3')](/\n/g,_0xc929('0x4'));var _0x36fcf5=_0x33d7c2[0x10][_0xc929('0x3')](/\n/g,'\x20');if(!arr[_0xc929('0x5')](_0x270852)){arr['push'](_0x270852);var _0x128f32=_0x33d7c2[0x3];var _0x304a4e=_0x33d7c2[0x4];var _0x1055c9=_0x33d7c2[0x1];var _0x2d1127=_0x33d7c2[0x0];var _0x5456b7={};_0x5456b7['urlOnAnswer']=_0x33d7c2[0x8]+_0xc929('0x6')+_0x4a47c2+'|'+_0x555ff0+'|'+_0x34bf6f+'|'+_0x270852+'|'+_0x3c6047;_0x5456b7['urlOnRing']=_0x33d7c2[0x7]+_0xc929('0x6')+_0x4a47c2+'|'+_0x555ff0+'|'+_0x34bf6f+'|'+_0x270852+'|'+_0x3c6047+'|'+_0x4a4d7e+'|'+_0x36fcf5;_0x5456b7[_0xc929('0x7')]=_0x33d7c2[0x9];var _0x1ae3ed={};_0x1ae3ed[_0xc929('0x8')]=_0xc929('0x9');_0x1ae3ed['method']=_0xc929('0xa');var _0x3f998f=[];_0x3f998f[_0xc929('0xb')](_0x33d7c2[0x2]);_0x3f998f[_0xc929('0xb')](_0x33d7c2[0x5]);_0x3f998f[_0xc929('0xb')](_0x33d7c2[0x6]);_0x1ae3ed[_0xc929('0xc')]=_0x3f998f;_0x1ae3ed['id']=0x1;var _0x233636=JSON[_0xc929('0xd')](_0x1ae3ed);var _0xd8f91a={'encoding':'utf8','method':_0xc929('0xe'),'timeout':0x2710,'url':_0x128f32,'headers':{'Content-Type':_0xc929('0xf')},'body':_0x233636};return rp(_0xd8f91a)[_0xc929('0x10')](function(_0x3bd209){const _0x163dc8=JSON['parse'](_0x3bd209);if(!_0x163dc8[_0xc929('0x11')][_0xc929('0x12')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x3b00e4=_0x270852;var _0x1e0b62='channelId='+_0x1055c9+'&serviceId='+_0x2d1127+'&sessionId='+_0x3b00e4+_0xc929('0x13')+JSON[_0xc929('0xd')](_0x5456b7);var _0x802f80=_0x304a4e+'?'+_0x1e0b62;return rp(_0x802f80);})[_0xc929('0x10')](function(_0x9eee76){logger[_0xc929('0x14')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x1268e3,_0x9eee76);_0x3ff125[_0xc929('0x15')]();})[_0xc929('0x16')](function(_0x4fb625){logger[_0xc929('0x17')](_0xc929('0x18'),_0x1268e3,_[_0xc929('0x19')](_0x4fb625)?JSON['stringify'](_0x4fb625):_0x4fb625);_0x3ff125[_0xc929('0x15')]();});}else{logger[_0xc929('0x14')](_0xc929('0x1a'),_0x1268e3);_0x3ff125[_0xc929('0x1b')]();}};};
\ No newline at end of file
+var _0xba64=['stop','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','../../../../config/logger','lodash','\x20-\x20','replace','includes','?params=','title','jsonrpc','login','push','stringify','utf8','POST','application/json-rpc','then','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xba64,0x10a));var _0x4ba6=function(_0x4877ee,_0x36ea12){_0x4877ee=_0x4877ee-0x0;var _0x49558a=_0xba64[_0x4877ee];return _0x49558a;};'use strict';var rp=require(_0x4ba6('0x0'));var logger=require(_0x4ba6('0x1'))('routing');var _=require(_0x4ba6('0x2'));var arr=[];exports['consequence']=function(_0x3997f2,_0x48930c){return function(_0x1f5cbf){var _0x4ac942=_0x48930c[0xa];var _0x340e83=_0x48930c[0xb];var _0x3ab498=_0x48930c[0xc];var _0x4b8730=_0x48930c[0xd];var _0x42d169=_0x48930c[0xe];var _0x507014=_0x48930c[0xf]['replace'](/\n/g,_0x4ba6('0x3'));var _0xd3b3d7=_0x48930c[0x10][_0x4ba6('0x4')](/\n/g,'\x20');if(!arr[_0x4ba6('0x5')](_0x340e83)){arr['push'](_0x340e83);var _0x511b94=_0x48930c[0x3];var _0x3a3d86=_0x48930c[0x4];var _0x113911=_0x48930c[0x1];var _0x4cbbd8=_0x48930c[0x0];var _0xa44905={};_0xa44905['urlOnAnswer']=_0x48930c[0x8]+_0x4ba6('0x6')+_0x3ab498+'|'+_0x4ac942+'|'+_0x4b8730+'|'+_0x340e83+'|'+_0x42d169;_0xa44905['urlOnRing']=_0x48930c[0x7]+_0x4ba6('0x6')+_0x3ab498+'|'+_0x4ac942+'|'+_0x4b8730+'|'+_0x340e83+'|'+_0x42d169+'|'+_0x507014+'|'+_0xd3b3d7;_0xa44905[_0x4ba6('0x7')]=_0x48930c[0x9];var _0x431609={};_0x431609[_0x4ba6('0x8')]='2.0';_0x431609['method']=_0x4ba6('0x9');var _0x1c1db6=[];_0x1c1db6[_0x4ba6('0xa')](_0x48930c[0x2]);_0x1c1db6[_0x4ba6('0xa')](_0x48930c[0x5]);_0x1c1db6[_0x4ba6('0xa')](_0x48930c[0x6]);_0x431609['params']=_0x1c1db6;_0x431609['id']=0x1;var _0x354b85=JSON[_0x4ba6('0xb')](_0x431609);var _0x2c5a37={'encoding':_0x4ba6('0xc'),'method':_0x4ba6('0xd'),'timeout':0x2710,'url':_0x511b94,'headers':{'Content-Type':_0x4ba6('0xe')},'body':_0x354b85};return rp(_0x2c5a37)[_0x4ba6('0xf')](function(_0x1f4596){const _0x330b8d=JSON[_0x4ba6('0x10')](_0x1f4596);if(!_0x330b8d[_0x4ba6('0x11')]['logged']){throw new Error(_0x4ba6('0x12'));}var _0xef7d44=_0x340e83;var _0x569671=_0x4ba6('0x13')+_0x113911+_0x4ba6('0x14')+_0x4cbbd8+'&sessionId='+_0xef7d44+_0x4ba6('0x15')+JSON[_0x4ba6('0xb')](_0xa44905);var _0x1d9e03=_0x3a3d86+'?'+_0x569671;return rp(_0x1d9e03);})[_0x4ba6('0xf')](function(_0x6d10a2){logger[_0x4ba6('0x16')](_0x4ba6('0x17'),_0x3997f2,_0x6d10a2);_0x1f5cbf[_0x4ba6('0x18')]();})['catch'](function(_0x115296){logger[_0x4ba6('0x19')](_0x4ba6('0x1a'),_0x3997f2,_[_0x4ba6('0x1b')](_0x115296)?JSON[_0x4ba6('0xb')](_0x115296):_0x115296);_0x1f5cbf['stop']();});}else{logger['info'](_0x4ba6('0x1c'),_0x3997f2);_0x1f5cbf['next']();}};};
\ No newline at end of file
index 1fd535a..1dbbe5c 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(_0x4d517f,_0x31fbd4){var _0x1bfb5a=function(_0x5a3b54){while(--_0x5a3b54){_0x4d517f['push'](_0x4d517f['shift']());}};_0x1bfb5a(++_0x31fbd4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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(_0x17e706,_0x1d6d83){var _0x1fc82d=function(_0x4a1eb9){while(--_0x4a1eb9){_0x17e706['push'](_0x17e706['shift']());}};_0x1fc82d(++_0x1d6d83);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 57e467d..7792101 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f60=['error','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','stringify','matchPath','emit','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','end','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','find','chatQueues','loggedIn','name','paused','waiting','mailQueues','available','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','./applications/utils','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','applications','length','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','join','dialogflowv2','amazonlex','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','format','./interval','intervals','./applications/','info','Push\x20new\x20rule','on\x20interval','\x20|\x20'];(function(_0x146f3a,_0x373e03){var _0x4ebd8a=function(_0x2b4ea9){while(--_0x2b4ea9){_0x146f3a['push'](_0x146f3a['shift']());}};_0x4ebd8a(++_0x373e03);}(_0x4f60,0xf4));var _0x04f6=function(_0x18ecd1,_0x46529d){_0x18ecd1=_0x18ecd1-0x0;var _0x4bc24c=_0x4f60[_0x18ecd1];return _0x4bc24c;};'use strict';var _=require(_0x04f6('0x0'));var util=require(_0x04f6('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x04f6('0x2'));var BPromise=require('bluebird');var utils=require(_0x04f6('0x3'));var sUtils=require('./applications/strategy/util');var logger=require(_0x04f6('0x4'))(_0x04f6('0x5'));var rpc={'openchannelQueueReport':require(_0x04f6('0x6')),'mailQueueReport':require(_0x04f6('0x7')),'chatQueueReport':require(_0x04f6('0x8')),'smsQueueReport':require(_0x04f6('0x9')),'faxQueueReport':require(_0x04f6('0xa')),'whatsappQueueReport':require(_0x04f6('0xb'))};var RuleEngine=require(_0x04f6('0xc'));function getId(_0x21b721,_0x9b22b4,_0xa81bbd){return util['format'](_0x04f6('0xd'),_0x21b721,_0x9b22b4||0x0,_0xa81bbd||0x0);}function getIntervals(_0x3fc158,_0x4f1e28){var _0x44ab64=[];if(!_[_0x04f6('0xe')](_0x4f1e28[_0x04f6('0xf')])&&!_[_0x04f6('0xe')](_0x3fc158[_0x4f1e28[_0x04f6('0xf')]])&&!_['isNil'](_0x3fc158[_0x4f1e28[_0x04f6('0xf')]][_0x04f6('0x10')])){_0x44ab64=_[_0x04f6('0x11')](_0x3fc158[_0x4f1e28[_0x04f6('0xf')]][_0x04f6('0x10')],_0x04f6('0x12'));}else if(!_['isNil'](_0x4f1e28[_0x04f6('0x12')])){_0x44ab64=[_0x4f1e28[_0x04f6('0x12')]];}return _0x44ab64;}exports[_0x04f6('0x13')]=function(_0x2a5e98){_0x2a5e98[_0x04f6('0x14')]={};return new BPromise(function(_0x21108a,_0x559d93){var _0x5a8488={'Start':function(_0x17b390){var _0x1696a5=this;return new Promise(function(_0xa39268,_0x178516){if(_0x17b390){try{var _0x38482a=[];var _0x420513=getId(_0x17b390[_0x04f6('0x15')],_0x17b390[_0x04f6('0x16')]?_0x17b390[_0x04f6('0x16')]['id']:0x0,_0x17b390['interaction']?_0x17b390[_0x04f6('0x17')]['id']:0x0);var _0x2c02c0=sUtils[_0x04f6('0x18')](_0x2a5e98,_0x17b390);if(!_0x2c02c0&&_0x17b390[_0x04f6('0x19')]&&_['isArray'](_0x17b390['applications'])&&_0x17b390[_0x04f6('0x19')][_0x04f6('0x1a')]){for(var _0x401ab5=0x0;_0x401ab5<_0x17b390[_0x04f6('0x19')][_0x04f6('0x1a')];_0x401ab5+=0x1){var _0x5af3b3=_0x17b390[_0x04f6('0x19')][_0x401ab5];if(fs['existsSync'](path['join'](__dirname,'applications',_0x5af3b3[_0x04f6('0x1b')]+_0x04f6('0x1c')))){var _0xba3ce0=[];switch(_0x5af3b3['app'][_0x04f6('0x1d')]()){case _0x04f6('0x1e'):var _0xfd3f35=_0x5af3b3[_0x04f6('0x1f')][_0x04f6('0x20')](',');if(_0x17b390[_0x04f6('0x15')]===_0x04f6('0x21')){_0xba3ce0[_0x04f6('0x22')](_0xfd3f35[0x0]);_0xba3ce0[_0x04f6('0x22')](_0xfd3f35[0x1]);_0xba3ce0[_0x04f6('0x22')](_0xfd3f35[_0x04f6('0x23')](0x2,_0xfd3f35[_0x04f6('0x1a')])[_0x04f6('0x24')](','));}else{_0xba3ce0[_0x04f6('0x22')](_0xfd3f35[0x0]);_0xba3ce0['push'](_0xfd3f35[_0x04f6('0x23')](0x1,_0xfd3f35[_0x04f6('0x1a')])['join'](','));}break;case'dialogflow':var _0x4defaf=_0x5af3b3[_0x04f6('0x1f')][_0x04f6('0x20')](',');_0xba3ce0[_0x04f6('0x22')](_0x4defaf[0x0]);_0xba3ce0[_0x04f6('0x22')](_0x4defaf[0x1]);_0xba3ce0[_0x04f6('0x22')](_0x4defaf[_0x04f6('0x23')](0x2,_0x4defaf['length'])[_0x04f6('0x24')](','));break;case _0x04f6('0x25'):var _0x488634=_0x5af3b3[_0x04f6('0x1f')][_0x04f6('0x20')](',');_0xba3ce0[_0x04f6('0x22')](_0x488634[0x0]);_0xba3ce0[_0x04f6('0x22')](_0x488634[0x1]);_0xba3ce0[_0x04f6('0x22')](_0x488634[0x2]);_0xba3ce0['push'](_0x488634[0x3]);_0xba3ce0[_0x04f6('0x22')](_0x488634['slice'](0x4,_0x488634[_0x04f6('0x1a')])[_0x04f6('0x24')](','));break;case _0x04f6('0x26'):var _0x285236=_0x5af3b3[_0x04f6('0x1f')][_0x04f6('0x20')](',');_0xba3ce0[_0x04f6('0x22')](_0x285236[0x0]);_0xba3ce0[_0x04f6('0x22')](_0x285236[0x1]);_0xba3ce0['push'](_0x285236[0x2]);_0xba3ce0[_0x04f6('0x22')](_0x285236[0x3]);_0xba3ce0[_0x04f6('0x22')](_0x285236[_0x04f6('0x23')](0x4,_0x285236['length'])[_0x04f6('0x24')](','));break;case _0x04f6('0x16'):_0xba3ce0[_0x04f6('0x22')](_0x5af3b3[_0x04f6('0x1f')]);break;case _0x04f6('0x27'):_0xba3ce0['push'](_0x5af3b3[_0x04f6('0x28')]);_0xba3ce0['push'](_0x5af3b3['appdata']);break;case _0x04f6('0x29'):var _0x51e57b=utils[_0x04f6('0x2a')](_0x17b390[_0x04f6('0x2b')][_0x04f6('0x2c')],_0x17b390);var _0x5b1905=_0x5af3b3[_0x04f6('0x1f')][_0x04f6('0x20')](',');_0xba3ce0[_0x04f6('0x22')](_0x5b1905[0x0]);_0xba3ce0[_0x04f6('0x22')](_0x5b1905[0x1]);_0xba3ce0['push'](_0x5b1905[0x2]);_0xba3ce0['push'](_0x5b1905[0x3]);_0xba3ce0['push'](_0x5b1905[0x4]);_0xba3ce0[_0x04f6('0x22')](_0x5b1905[0x5]);_0xba3ce0[_0x04f6('0x22')](_0x5b1905[0x6]);_0xba3ce0['push'](_0x5b1905[0x7]);_0xba3ce0[_0x04f6('0x22')](_0x5b1905[0x8]);_0xba3ce0[_0x04f6('0x22')](_0x5b1905[0x9]);_0xba3ce0['push'](_0x5b1905[0xa]);_0xba3ce0[_0x04f6('0x22')](_0x17b390[_0x04f6('0x17')]['id']);_0xba3ce0[_0x04f6('0x22')](_0x17b390[_0x04f6('0x16')]['id']);_0xba3ce0[_0x04f6('0x22')](_0x5af3b3[_0x04f6('0x2d')]);_0xba3ce0[_0x04f6('0x22')](_0x17b390[_0x04f6('0x17')][_0x04f6('0x2e')]);_0xba3ce0[_0x04f6('0x22')](_0x17b390[_0x04f6('0x2f')][_0x04f6('0x2f')]);_0xba3ce0[_0x04f6('0x22')](_0x51e57b);break;default:_0xba3ce0=_[_0x04f6('0xe')](_0x5af3b3[_0x04f6('0x1f')])?[]:_0x5af3b3['appdata'][_0x04f6('0x20')](',');}var _0x37f9e2={'id':util[_0x04f6('0x30')]('%s:%s:%s',_0x420513,_0x5af3b3['id'],_0x5af3b3['app']),'condition':require(_0x04f6('0x31'))['condition'](_0x420513,getIntervals(_0x2a5e98[_0x04f6('0x32')],_0x5af3b3),_0x2a5e98),'consequence':require(_0x04f6('0x33')+_0x5af3b3[_0x04f6('0x1b')])['consequence'](_0x420513,_0xba3ce0,_0x2a5e98,_0x17b390),'p':_0x5af3b3['priority']||0x0};logger[_0x04f6('0x34')](_0x04f6('0x35'),_0x37f9e2['id'],_0x04f6('0x36'),getIntervals(_0x2a5e98[_0x04f6('0x32')],_0x5af3b3)[_0x04f6('0x24')](_0x04f6('0x37')));_0x38482a['push'](_0x37f9e2);}else{logger[_0x04f6('0x38')](_0x04f6('0x39'),path[_0x04f6('0x24')](__dirname,_0x04f6('0x19'),_0x5af3b3['app']+_0x04f6('0x1c')));}}_0x2a5e98['rules'][_0x420513]=new RuleEngine(_0x38482a);_0x2a5e98['rules'][_0x420513]['execute'](_0x17b390,function(_0x529093){logger[_0x04f6('0x34')](_0x04f6('0x3a'),JSON[_0x04f6('0x3b')](_0x529093[_0x04f6('0x3c')]));if(_0x2a5e98[_0x04f6('0x14')][_0x420513]){_0x2a5e98[_0x04f6('0x14')][_0x420513][_0x04f6('0x3d')]('complete');}});return _0xa39268({'code':0xc8,'message':_0x17b390});}else{if(_0x2c02c0){logger[_0x04f6('0x34')](util['format']('Skipped\x20routing\x20for\x20%s',_0x420513));}else{logger[_0x04f6('0x34')]('No\x20applications\x20to\x20execute');}return _0xa39268({'code':0xc8,'message':_0x17b390});}}catch(_0x207947){logger[_0x04f6('0x38')](_0x207947[_0x04f6('0x3e')]);return _0x178516(_0x1696a5[_0x04f6('0x38')](0x1f4,_0x207947));}}return _0x178516(_0x04f6('0x3f'));});},'AcceptMessage':function(_0x566db1){var _0x2d1093=this;return new Promise(function(_0x22845f,_0x563728){if(_0x566db1[_0x04f6('0x40')]&&_0x566db1['agent']['id']){if(_0x2a5e98['agents'][_0x566db1['agent']['id']]){_0x2a5e98[_0x04f6('0x41')][_0x566db1[_0x04f6('0x40')]['id']][_0x04f6('0x42')]=![];_0x2a5e98[_0x04f6('0x41')][_0x566db1[_0x04f6('0x40')]['id']][_0x04f6('0x43')]=undefined;}}if(_0x566db1['message']&&_0x566db1[_0x04f6('0x16')]['id']){try{var _0x894474=getId(_0x566db1['channel'],_0x566db1['message']?_0x566db1[_0x04f6('0x16')]['id']:0x0,_0x566db1['interaction']?_0x566db1['interaction']['id']:0x0);if(_0x2a5e98['rules'][_0x894474]){_0x2a5e98[_0x04f6('0x14')][_0x894474][_0x04f6('0x3d')]('end');if(rpc[_0x566db1['channel']+'QueueReport']){rpc[_0x566db1['channel']+'QueueReport'][_0x04f6('0x44')](_0x894474,{'UserId':_0x566db1['message'][_0x04f6('0x45')]})[_0x04f6('0x46')](function(){logger[_0x04f6('0x38')](_0x04f6('0x47'));});}}return _0x22845f({'code':0xc8,'message':_0x566db1});}catch(_0x4cecc7){logger[_0x04f6('0x38')](_0x4cecc7[_0x04f6('0x3e')]);return _0x563728(_0x2d1093['error'](0x1f4,_0x4cecc7));}}logger[_0x04f6('0x38')](_0x04f6('0x48'));return _0x563728(_0x2d1093[_0x04f6('0x38')](0x1f4,_0x04f6('0x48')));});},'RejectMessage':function(_0x39acd4){var _0x52c14c=this;return new Promise(function(_0x40bd3b,_0x6efee6){if(_0x39acd4[_0x04f6('0x40')]&&_0x39acd4[_0x04f6('0x40')]['id']){try{if(_0x2a5e98[_0x04f6('0x41')][_0x39acd4[_0x04f6('0x40')]['id']]){_0x2a5e98[_0x04f6('0x41')][_0x39acd4[_0x04f6('0x40')]['id']][_0x04f6('0x42')]=![];_0x2a5e98[_0x04f6('0x41')][_0x39acd4[_0x04f6('0x40')]['id']][_0x04f6('0x43')]=undefined;}return _0x40bd3b({'code':0xc8,'message':_0x39acd4});}catch(_0x35892c){logger[_0x04f6('0x38')](_0x35892c[_0x04f6('0x3e')]);return _0x6efee6(_0x52c14c[_0x04f6('0x38')](0x1f4,_0x35892c));}}logger[_0x04f6('0x38')](_0x04f6('0x48'));return _0x6efee6(_0x52c14c['error'](0x1f4,_0x04f6('0x48')));});},'AbandonInteraction':function(_0x1370ff){var _0x4b910d=this;return new Promise(function(_0x557abd,_0x1bbfae){if(_0x1370ff[_0x04f6('0x15')]&&_0x1370ff[_0x04f6('0x17')]&&_0x1370ff['interaction']['id']){try{var _0x287c8e=getId(_0x1370ff[_0x04f6('0x15')],_0x1370ff['message']?_0x1370ff[_0x04f6('0x16')]['id']:0x0,_0x1370ff[_0x04f6('0x17')]?_0x1370ff[_0x04f6('0x17')]['id']:0x0);if(_0x2a5e98[_0x04f6('0x14')][_0x287c8e]){_0x2a5e98[_0x04f6('0x14')][_0x287c8e]['emit'](_0x04f6('0x49'));}return _0x557abd({'code':0xc8,'message':_0x1370ff});}catch(_0x234d94){logger['error'](_0x234d94[_0x04f6('0x3e')]);return _0x1bbfae(_0x4b910d[_0x04f6('0x38')](0x1f4,_0x234d94));}}logger[_0x04f6('0x38')]('message\x20is\x20empty');return _0x1bbfae(_0x4b910d['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x402267){var _0x5b6acf=this;return new Promise(function(_0x29057b,_0x24bbd4){if(_0x2a5e98['agents']['hasOwnProperty'](_0x402267['id'])){for(var _0x2855fb in _0x402267[_0x04f6('0x4a')]){if(_0x402267[_0x04f6('0x4a')][_0x04f6('0x4b')](_0x2855fb)){if(_0x2a5e98[_0x04f6('0x41')][_0x402267['id']][_0x04f6('0x4b')](_0x2855fb+_0x04f6('0x4c'))){_0x2a5e98[_0x04f6('0x41')][_0x402267['id']][_0x2855fb+_0x04f6('0x4c')]=parseInt(_0x402267[_0x04f6('0x4a')][_0x2855fb],0xa);}}}_0x2a5e98['agents'][_0x402267['id']][_0x04f6('0x4d')]();return _0x29057b({'code':0xc8,'message':_0x2a5e98[_0x04f6('0x41')][_0x402267['id']]});}else{return _0x24bbd4(_0x5b6acf[_0x04f6('0x38')](0x1f4,_0x04f6('0x4e')));}});},'Agents':function(_0x5bbbb8){return new Promise(function(_0x386978){var _0xd7df52=_['values'](_0x2a5e98[_0x04f6('0x41')]);if(_0x5bbbb8&&_0x5bbbb8['id']){var _0x3d6aab=_[_0x04f6('0x4f')](_0xd7df52,function(_0x5001bc){return _0x5001bc['id']===_0x5bbbb8['id'];});_0x386978(_0x3d6aab);}else{_0x386978({'count':_0xd7df52[_0x04f6('0x1a')],'rows':_0xd7df52});}});},'ChatQueues':function(){return new Promise(function(_0x226cd3){var _0x4db8cf=[];for(var _0x5624b1 in _0x2a5e98['chatQueues']){if(_0x2a5e98[_0x04f6('0x50')]['hasOwnProperty'](_0x5624b1)){var _0x2a57a5=_0x2a5e98[_0x04f6('0x50')][_0x5624b1];var _0x6b9e68={'id':_0x2a57a5['id'],'available':_0x2a57a5['available'],'loggedIn':_0x2a57a5[_0x04f6('0x51')],'name':_0x2a57a5[_0x04f6('0x52')],'paused':_0x2a57a5[_0x04f6('0x53')],'waiting':_0x2a57a5[_0x04f6('0x54')]};_0x4db8cf[_0x04f6('0x22')](_0x6b9e68);}}_0x226cd3({'count':_0x4db8cf[_0x04f6('0x1a')],'rows':_0x4db8cf});});},'MailQueues':function(){return new Promise(function(_0x211a77){var _0x34f5bb=[];for(var _0x2325d4 in _0x2a5e98[_0x04f6('0x55')]){if(_0x2a5e98['mailQueues']['hasOwnProperty'](_0x2325d4)){var _0x5f07dc=_0x2a5e98['mailQueues'][_0x2325d4];var _0x274d65={'id':_0x5f07dc['id'],'available':_0x5f07dc[_0x04f6('0x56')],'loggedIn':_0x5f07dc[_0x04f6('0x51')],'name':_0x5f07dc[_0x04f6('0x52')],'paused':_0x5f07dc[_0x04f6('0x53')],'waiting':_0x5f07dc['waiting']};_0x34f5bb['push'](_0x274d65);}}_0x211a77({'count':_0x34f5bb[_0x04f6('0x1a')],'rows':_0x34f5bb});});},'OpenchannelQueues':function(){return new Promise(function(_0x1e8a9){var _0x28f4f9=[];for(var _0x1c237b in _0x2a5e98[_0x04f6('0x57')]){if(_0x2a5e98[_0x04f6('0x57')][_0x04f6('0x4b')](_0x1c237b)){var _0x3a5e46=_0x2a5e98[_0x04f6('0x57')][_0x1c237b];var _0x41ddf8={'id':_0x3a5e46['id'],'available':_0x3a5e46[_0x04f6('0x56')],'loggedIn':_0x3a5e46['loggedIn'],'name':_0x3a5e46[_0x04f6('0x52')],'paused':_0x3a5e46[_0x04f6('0x53')],'waiting':_0x3a5e46[_0x04f6('0x54')]};_0x28f4f9[_0x04f6('0x22')](_0x41ddf8);}}_0x1e8a9({'count':_0x28f4f9['length'],'rows':_0x28f4f9});});},'SmsQueues':function(){return new Promise(function(_0x2982f3){var _0x2e3238=[];for(var _0x2ccfae in _0x2a5e98[_0x04f6('0x58')]){if(_0x2a5e98[_0x04f6('0x58')][_0x04f6('0x4b')](_0x2ccfae)){var _0x15783f=_0x2a5e98[_0x04f6('0x58')][_0x2ccfae];var _0x13a7cc={'id':_0x15783f['id'],'available':_0x15783f['available'],'loggedIn':_0x15783f['loggedIn'],'name':_0x15783f[_0x04f6('0x52')],'paused':_0x15783f[_0x04f6('0x53')],'waiting':_0x15783f[_0x04f6('0x54')]};_0x2e3238[_0x04f6('0x22')](_0x13a7cc);}}_0x2982f3({'count':_0x2e3238[_0x04f6('0x1a')],'rows':_0x2e3238});});},'FaxQueues':function(){return new Promise(function(_0x53f99f){var _0x31f987=[];for(var _0x13acf8 in _0x2a5e98[_0x04f6('0x59')]){if(_0x2a5e98[_0x04f6('0x59')][_0x04f6('0x4b')](_0x13acf8)){var _0x189d62=_0x2a5e98['faxQueues'][_0x13acf8];var _0x2c5b13={'id':_0x189d62['id'],'available':_0x189d62[_0x04f6('0x56')],'loggedIn':_0x189d62[_0x04f6('0x51')],'name':_0x189d62[_0x04f6('0x52')],'paused':_0x189d62[_0x04f6('0x53')],'waiting':_0x189d62[_0x04f6('0x54')]};_0x31f987[_0x04f6('0x22')](_0x2c5b13);}}_0x53f99f({'count':_0x31f987[_0x04f6('0x1a')],'rows':_0x31f987});});},'WhatsappQueues':function(){return new Promise(function(_0x20502b){var _0x37437c=[];for(var _0xc44a14 in _0x2a5e98[_0x04f6('0x5a')]){if(_0x2a5e98[_0x04f6('0x5a')][_0x04f6('0x4b')](_0xc44a14)){var _0x3e94c0=_0x2a5e98[_0x04f6('0x5a')][_0xc44a14];var _0x41cf9c={'id':_0x3e94c0['id'],'available':_0x3e94c0[_0x04f6('0x56')],'loggedIn':_0x3e94c0[_0x04f6('0x51')],'name':_0x3e94c0[_0x04f6('0x52')],'paused':_0x3e94c0[_0x04f6('0x53')],'waiting':_0x3e94c0['waiting']};_0x37437c[_0x04f6('0x22')](_0x41cf9c);}}_0x20502b({'count':_0x37437c[_0x04f6('0x1a')],'rows':_0x37437c});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x33b541){var _0x28d775=_[_0x04f6('0x5b')](_0x2a5e98[_0x04f6('0x5c')]);_0x33b541({'count':_0x28d775['length'],'rows':_0x28d775});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x5dcaef){var _0x5e5397=_[_0x04f6('0x5b')](_0x2a5e98[_0x04f6('0x5d')]);_0x5dcaef({'count':_0x5e5397['length'],'rows':_0x5e5397});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x25db97){var _0x29483f=_[_0x04f6('0x5b')](_0x2a5e98[_0x04f6('0x5e')]);_0x25db97({'count':_0x29483f[_0x04f6('0x1a')],'rows':_0x29483f});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x39db1c){var _0x42bd70=_[_0x04f6('0x5b')](_0x2a5e98['smsQueuesWaitingInteractions']);_0x39db1c({'count':_0x42bd70[_0x04f6('0x1a')],'rows':_0x42bd70});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x4d285e){var _0x2e65c5=_['values'](_0x2a5e98['faxQueuesWaitingInteractions']);_0x4d285e({'count':_0x2e65c5[_0x04f6('0x1a')],'rows':_0x2e65c5});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x570ad4){var _0x3a9c0b=_[_0x04f6('0x5b')](_0x2a5e98[_0x04f6('0x5f')]);_0x570ad4({'count':_0x3a9c0b[_0x04f6('0x1a')],'rows':_0x3a9c0b});});}};var _0x544a2b=jayson[_0x04f6('0x60')](_0x5a8488)['http']();_0x544a2b['on'](_0x04f6('0x38'),function(_0x24f044){logger[_0x04f6('0x38')](JSON['stringify'](_0x24f044));return _0x559d93(_0x24f044);});_0x544a2b[_0x04f6('0x13')](0x232c,_0x04f6('0x61'),function(){console[_0x04f6('0x62')](_0x04f6('0x63'),0x232c);return _0x21108a('RPC\x20listening\x20on\x20port:'+0x232c);});});};
\ No newline at end of file
+var _0xd1fa=['mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','checkWaitingNotifications','isArray','applications','length','existsSync','join','app','.js','toLowerCase','split','push','slice','dialogflowv2','amazonlex','appdata','TagId','tvox','getMustacheRender','account','interaction','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','Push\x20new\x20rule','on\x20interval','Please\x20create\x20a\x20new\x20file\x20under','execute','stringify','matchPath','emit','complete','info','format','Skipped\x20routing\x20for\x20%s','error','stack','routing\x20is\x20empty','agent','agents','busyQueue','QueueReport','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','end','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','find','chatQueues','available','name','paused','waiting','mailQueues','loggedIn','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values'];(function(_0x57c40b,_0x10d1bf){var _0x6b3de0=function(_0x3f4a28){while(--_0x3f4a28){_0x57c40b['push'](_0x57c40b['shift']());}};_0x6b3de0(++_0x10d1bf);}(_0xd1fa,0x1aa));var _0xad1f=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xd1fa[_0x40bffc];return _0x3007e9;};'use strict';var _=require(_0xad1f('0x0'));var util=require('util');var path=require(_0xad1f('0x1'));var fs=require('fs');var jayson=require(_0xad1f('0x2'));var BPromise=require(_0xad1f('0x3'));var utils=require(_0xad1f('0x4'));var sUtils=require(_0xad1f('0x5'));var logger=require(_0xad1f('0x6'))(_0xad1f('0x7'));var rpc={'openchannelQueueReport':require(_0xad1f('0x8')),'mailQueueReport':require(_0xad1f('0x9')),'chatQueueReport':require(_0xad1f('0xa')),'smsQueueReport':require(_0xad1f('0xb')),'faxQueueReport':require(_0xad1f('0xc')),'whatsappQueueReport':require(_0xad1f('0xd'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x4bd5e4,_0x17dd54,_0x181742){return util['format'](_0xad1f('0xe'),_0x4bd5e4,_0x17dd54||0x0,_0x181742||0x0);}function getIntervals(_0x3fef9a,_0x7e05b6){var _0x9c629f=[];if(!_[_0xad1f('0xf')](_0x7e05b6['IntervalId'])&&!_[_0xad1f('0xf')](_0x3fef9a[_0x7e05b6[_0xad1f('0x10')]])&&!_[_0xad1f('0xf')](_0x3fef9a[_0x7e05b6[_0xad1f('0x10')]][_0xad1f('0x11')])){_0x9c629f=_['map'](_0x3fef9a[_0x7e05b6[_0xad1f('0x10')]]['Intervals'],_0xad1f('0x12'));}else if(!_[_0xad1f('0xf')](_0x7e05b6[_0xad1f('0x12')])){_0x9c629f=[_0x7e05b6['interval']];}return _0x9c629f;}exports[_0xad1f('0x13')]=function(_0x3bcdce){_0x3bcdce[_0xad1f('0x14')]={};return new BPromise(function(_0x304d10,_0x44cea9){var _0x50c263={'Start':function(_0x381da2){var _0x511f12=this;return new Promise(function(_0x143a26,_0x233545){if(_0x381da2){try{var _0xd5cd2d=[];var _0xb84f73=getId(_0x381da2[_0xad1f('0x15')],_0x381da2[_0xad1f('0x16')]?_0x381da2[_0xad1f('0x16')]['id']:0x0,_0x381da2['interaction']?_0x381da2['interaction']['id']:0x0);var _0x2e6a3e=sUtils[_0xad1f('0x17')](_0x3bcdce,_0x381da2);if(!_0x2e6a3e&&_0x381da2['applications']&&_[_0xad1f('0x18')](_0x381da2[_0xad1f('0x19')])&&_0x381da2[_0xad1f('0x19')][_0xad1f('0x1a')]){for(var _0x4073b0=0x0;_0x4073b0<_0x381da2[_0xad1f('0x19')]['length'];_0x4073b0+=0x1){var _0x219a4f=_0x381da2[_0xad1f('0x19')][_0x4073b0];if(fs[_0xad1f('0x1b')](path[_0xad1f('0x1c')](__dirname,_0xad1f('0x19'),_0x219a4f[_0xad1f('0x1d')]+_0xad1f('0x1e')))){var _0x25b0d0=[];switch(_0x219a4f['app'][_0xad1f('0x1f')]()){case'autoreply':var _0x25fc3f=_0x219a4f['appdata'][_0xad1f('0x20')](',');if(_0x381da2[_0xad1f('0x15')]==='mail'){_0x25b0d0[_0xad1f('0x21')](_0x25fc3f[0x0]);_0x25b0d0[_0xad1f('0x21')](_0x25fc3f[0x1]);_0x25b0d0['push'](_0x25fc3f[_0xad1f('0x22')](0x2,_0x25fc3f[_0xad1f('0x1a')])['join'](','));}else{_0x25b0d0['push'](_0x25fc3f[0x0]);_0x25b0d0[_0xad1f('0x21')](_0x25fc3f[_0xad1f('0x22')](0x1,_0x25fc3f[_0xad1f('0x1a')])[_0xad1f('0x1c')](','));}break;case'dialogflow':var _0x438431=_0x219a4f['appdata'][_0xad1f('0x20')](',');_0x25b0d0[_0xad1f('0x21')](_0x438431[0x0]);_0x25b0d0[_0xad1f('0x21')](_0x438431[0x1]);_0x25b0d0[_0xad1f('0x21')](_0x438431[_0xad1f('0x22')](0x2,_0x438431[_0xad1f('0x1a')])[_0xad1f('0x1c')](','));break;case _0xad1f('0x23'):var _0x1c4d9a=_0x219a4f['appdata'][_0xad1f('0x20')](',');_0x25b0d0[_0xad1f('0x21')](_0x1c4d9a[0x0]);_0x25b0d0[_0xad1f('0x21')](_0x1c4d9a[0x1]);_0x25b0d0[_0xad1f('0x21')](_0x1c4d9a[0x2]);_0x25b0d0[_0xad1f('0x21')](_0x1c4d9a[0x3]);_0x25b0d0[_0xad1f('0x21')](_0x1c4d9a[_0xad1f('0x22')](0x4,_0x1c4d9a['length'])[_0xad1f('0x1c')](','));break;case _0xad1f('0x24'):var _0x1dd231=_0x219a4f[_0xad1f('0x25')]['split'](',');_0x25b0d0[_0xad1f('0x21')](_0x1dd231[0x0]);_0x25b0d0['push'](_0x1dd231[0x1]);_0x25b0d0['push'](_0x1dd231[0x2]);_0x25b0d0['push'](_0x1dd231[0x3]);_0x25b0d0[_0xad1f('0x21')](_0x1dd231[_0xad1f('0x22')](0x4,_0x1dd231[_0xad1f('0x1a')])[_0xad1f('0x1c')](','));break;case _0xad1f('0x16'):_0x25b0d0['push'](_0x219a4f[_0xad1f('0x25')]);break;case'tag':_0x25b0d0[_0xad1f('0x21')](_0x219a4f[_0xad1f('0x26')]);_0x25b0d0[_0xad1f('0x21')](_0x219a4f[_0xad1f('0x25')]);break;case _0xad1f('0x27'):var _0x21c425=utils[_0xad1f('0x28')](_0x381da2[_0xad1f('0x29')]['notificationTemplate'],_0x381da2);var _0x34081d=_0x219a4f[_0xad1f('0x25')][_0xad1f('0x20')](',');_0x25b0d0[_0xad1f('0x21')](_0x34081d[0x0]);_0x25b0d0['push'](_0x34081d[0x1]);_0x25b0d0[_0xad1f('0x21')](_0x34081d[0x2]);_0x25b0d0[_0xad1f('0x21')](_0x34081d[0x3]);_0x25b0d0['push'](_0x34081d[0x4]);_0x25b0d0[_0xad1f('0x21')](_0x34081d[0x5]);_0x25b0d0[_0xad1f('0x21')](_0x34081d[0x6]);_0x25b0d0[_0xad1f('0x21')](_0x34081d[0x7]);_0x25b0d0[_0xad1f('0x21')](_0x34081d[0x8]);_0x25b0d0[_0xad1f('0x21')](_0x34081d[0x9]);_0x25b0d0['push'](_0x34081d[0xa]);_0x25b0d0[_0xad1f('0x21')](_0x381da2[_0xad1f('0x2a')]['id']);_0x25b0d0[_0xad1f('0x21')](_0x381da2[_0xad1f('0x16')]['id']);_0x25b0d0['push'](_0x219a4f[_0xad1f('0x2b')]);_0x25b0d0[_0xad1f('0x21')](_0x381da2[_0xad1f('0x2a')][_0xad1f('0x2c')]);_0x25b0d0[_0xad1f('0x21')](_0x381da2[_0xad1f('0x2d')][_0xad1f('0x2d')]);_0x25b0d0['push'](_0x21c425);break;default:_0x25b0d0=_['isNil'](_0x219a4f[_0xad1f('0x25')])?[]:_0x219a4f['appdata']['split'](',');}var _0x397e22={'id':util['format'](_0xad1f('0x2e'),_0xb84f73,_0x219a4f['id'],_0x219a4f[_0xad1f('0x1d')]),'condition':require(_0xad1f('0x2f'))[_0xad1f('0x30')](_0xb84f73,getIntervals(_0x3bcdce[_0xad1f('0x31')],_0x219a4f),_0x3bcdce),'consequence':require(_0xad1f('0x32')+_0x219a4f[_0xad1f('0x1d')])[_0xad1f('0x33')](_0xb84f73,_0x25b0d0,_0x3bcdce,_0x381da2),'p':_0x219a4f[_0xad1f('0x34')]||0x0};logger['info'](_0xad1f('0x35'),_0x397e22['id'],_0xad1f('0x36'),getIntervals(_0x3bcdce['intervals'],_0x219a4f)[_0xad1f('0x1c')]('\x20|\x20'));_0xd5cd2d[_0xad1f('0x21')](_0x397e22);}else{logger['error'](_0xad1f('0x37'),path[_0xad1f('0x1c')](__dirname,'applications',_0x219a4f[_0xad1f('0x1d')]+_0xad1f('0x1e')));}}_0x3bcdce[_0xad1f('0x14')][_0xb84f73]=new RuleEngine(_0xd5cd2d);_0x3bcdce[_0xad1f('0x14')][_0xb84f73][_0xad1f('0x38')](_0x381da2,function(_0x28fff0){logger['info']('Applications\x20executed',JSON[_0xad1f('0x39')](_0x28fff0[_0xad1f('0x3a')]));if(_0x3bcdce[_0xad1f('0x14')][_0xb84f73]){_0x3bcdce[_0xad1f('0x14')][_0xb84f73][_0xad1f('0x3b')](_0xad1f('0x3c'));}});return _0x143a26({'code':0xc8,'message':_0x381da2});}else{if(_0x2e6a3e){logger[_0xad1f('0x3d')](util[_0xad1f('0x3e')](_0xad1f('0x3f'),_0xb84f73));}else{logger[_0xad1f('0x3d')]('No\x20applications\x20to\x20execute');}return _0x143a26({'code':0xc8,'message':_0x381da2});}}catch(_0x12a83a){logger[_0xad1f('0x40')](_0x12a83a[_0xad1f('0x41')]);return _0x233545(_0x511f12[_0xad1f('0x40')](0x1f4,_0x12a83a));}}return _0x233545(_0xad1f('0x42'));});},'AcceptMessage':function(_0x51b048){var _0xbe20f9=this;return new Promise(function(_0x5e3e19,_0x5105ac){if(_0x51b048[_0xad1f('0x43')]&&_0x51b048['agent']['id']){if(_0x3bcdce[_0xad1f('0x44')][_0x51b048['agent']['id']]){_0x3bcdce[_0xad1f('0x44')][_0x51b048[_0xad1f('0x43')]['id']]['busy']=![];_0x3bcdce[_0xad1f('0x44')][_0x51b048['agent']['id']][_0xad1f('0x45')]=undefined;}}if(_0x51b048[_0xad1f('0x16')]&&_0x51b048[_0xad1f('0x16')]['id']){try{var _0x157476=getId(_0x51b048['channel'],_0x51b048[_0xad1f('0x16')]?_0x51b048[_0xad1f('0x16')]['id']:0x0,_0x51b048[_0xad1f('0x2a')]?_0x51b048[_0xad1f('0x2a')]['id']:0x0);if(_0x3bcdce[_0xad1f('0x14')][_0x157476]){_0x3bcdce[_0xad1f('0x14')][_0x157476][_0xad1f('0x3b')]('end');if(rpc[_0x51b048[_0xad1f('0x15')]+_0xad1f('0x46')]){rpc[_0x51b048[_0xad1f('0x15')]+'QueueReport']['update'](_0x157476,{'UserId':_0x51b048[_0xad1f('0x16')][_0xad1f('0x47')]})[_0xad1f('0x48')](function(){logger[_0xad1f('0x40')](_0xad1f('0x49'));});}}return _0x5e3e19({'code':0xc8,'message':_0x51b048});}catch(_0x3af60d){logger['error'](_0x3af60d[_0xad1f('0x41')]);return _0x5105ac(_0xbe20f9['error'](0x1f4,_0x3af60d));}}logger['error'](_0xad1f('0x4a'));return _0x5105ac(_0xbe20f9[_0xad1f('0x40')](0x1f4,_0xad1f('0x4a')));});},'RejectMessage':function(_0x2b7886){var _0x2a14b1=this;return new Promise(function(_0x2d41b7,_0x4f5d2b){if(_0x2b7886['agent']&&_0x2b7886['agent']['id']){try{if(_0x3bcdce['agents'][_0x2b7886[_0xad1f('0x43')]['id']]){_0x3bcdce[_0xad1f('0x44')][_0x2b7886[_0xad1f('0x43')]['id']][_0xad1f('0x4b')]=![];_0x3bcdce['agents'][_0x2b7886['agent']['id']][_0xad1f('0x45')]=undefined;}return _0x2d41b7({'code':0xc8,'message':_0x2b7886});}catch(_0x447c91){logger[_0xad1f('0x40')](_0x447c91[_0xad1f('0x41')]);return _0x4f5d2b(_0x2a14b1[_0xad1f('0x40')](0x1f4,_0x447c91));}}logger[_0xad1f('0x40')](_0xad1f('0x4a'));return _0x4f5d2b(_0x2a14b1['error'](0x1f4,_0xad1f('0x4a')));});},'AbandonInteraction':function(_0x55bb05){var _0x74be81=this;return new Promise(function(_0x421257,_0x5e2219){if(_0x55bb05[_0xad1f('0x15')]&&_0x55bb05[_0xad1f('0x2a')]&&_0x55bb05['interaction']['id']){try{var _0x54c564=getId(_0x55bb05['channel'],_0x55bb05[_0xad1f('0x16')]?_0x55bb05[_0xad1f('0x16')]['id']:0x0,_0x55bb05['interaction']?_0x55bb05[_0xad1f('0x2a')]['id']:0x0);if(_0x3bcdce[_0xad1f('0x14')][_0x54c564]){_0x3bcdce[_0xad1f('0x14')][_0x54c564][_0xad1f('0x3b')](_0xad1f('0x4c'));}return _0x421257({'code':0xc8,'message':_0x55bb05});}catch(_0x1712a1){logger[_0xad1f('0x40')](_0x1712a1['stack']);return _0x5e2219(_0x74be81[_0xad1f('0x40')](0x1f4,_0x1712a1));}}logger[_0xad1f('0x40')](_0xad1f('0x4a'));return _0x5e2219(_0x74be81['error'](0x1f4,_0xad1f('0x4a')));});},'AgentCapacity':function(_0x44167b){var _0x5716ac=this;return new Promise(function(_0xedc1ab,_0x47b921){if(_0x3bcdce['agents'][_0xad1f('0x4d')](_0x44167b['id'])){for(var _0x6ec2ea in _0x44167b['capacity']){if(_0x44167b[_0xad1f('0x4e')][_0xad1f('0x4d')](_0x6ec2ea)){if(_0x3bcdce[_0xad1f('0x44')][_0x44167b['id']]['hasOwnProperty'](_0x6ec2ea+'CurrentCapacity')){_0x3bcdce[_0xad1f('0x44')][_0x44167b['id']][_0x6ec2ea+_0xad1f('0x4f')]=parseInt(_0x44167b[_0xad1f('0x4e')][_0x6ec2ea],0xa);}}}_0x3bcdce[_0xad1f('0x44')][_0x44167b['id']][_0xad1f('0x50')]();return _0xedc1ab({'code':0xc8,'message':_0x3bcdce['agents'][_0x44167b['id']]});}else{return _0x47b921(_0x5716ac['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x4e68c5){return new Promise(function(_0x65a6ca){var _0x5c0b48=_['values'](_0x3bcdce[_0xad1f('0x44')]);if(_0x4e68c5&&_0x4e68c5['id']){var _0xbe5d0e=_[_0xad1f('0x51')](_0x5c0b48,function(_0x4b92f1){return _0x4b92f1['id']===_0x4e68c5['id'];});_0x65a6ca(_0xbe5d0e);}else{_0x65a6ca({'count':_0x5c0b48[_0xad1f('0x1a')],'rows':_0x5c0b48});}});},'ChatQueues':function(){return new Promise(function(_0x390e9b){var _0x5f177f=[];for(var _0x16a870 in _0x3bcdce[_0xad1f('0x52')]){if(_0x3bcdce['chatQueues'][_0xad1f('0x4d')](_0x16a870)){var _0x73797e=_0x3bcdce[_0xad1f('0x52')][_0x16a870];var _0x53915={'id':_0x73797e['id'],'available':_0x73797e[_0xad1f('0x53')],'loggedIn':_0x73797e['loggedIn'],'name':_0x73797e[_0xad1f('0x54')],'paused':_0x73797e[_0xad1f('0x55')],'waiting':_0x73797e[_0xad1f('0x56')]};_0x5f177f[_0xad1f('0x21')](_0x53915);}}_0x390e9b({'count':_0x5f177f[_0xad1f('0x1a')],'rows':_0x5f177f});});},'MailQueues':function(){return new Promise(function(_0x367d98){var _0x24c3a7=[];for(var _0x3de31c in _0x3bcdce[_0xad1f('0x57')]){if(_0x3bcdce['mailQueues'][_0xad1f('0x4d')](_0x3de31c)){var _0x42a335=_0x3bcdce[_0xad1f('0x57')][_0x3de31c];var _0x6ee27d={'id':_0x42a335['id'],'available':_0x42a335['available'],'loggedIn':_0x42a335[_0xad1f('0x58')],'name':_0x42a335['name'],'paused':_0x42a335[_0xad1f('0x55')],'waiting':_0x42a335[_0xad1f('0x56')]};_0x24c3a7[_0xad1f('0x21')](_0x6ee27d);}}_0x367d98({'count':_0x24c3a7[_0xad1f('0x1a')],'rows':_0x24c3a7});});},'OpenchannelQueues':function(){return new Promise(function(_0x538f19){var _0x4bd302=[];for(var _0x4582b7 in _0x3bcdce[_0xad1f('0x59')]){if(_0x3bcdce[_0xad1f('0x59')][_0xad1f('0x4d')](_0x4582b7)){var _0x17d229=_0x3bcdce[_0xad1f('0x59')][_0x4582b7];var _0x13d1a6={'id':_0x17d229['id'],'available':_0x17d229[_0xad1f('0x53')],'loggedIn':_0x17d229[_0xad1f('0x58')],'name':_0x17d229[_0xad1f('0x54')],'paused':_0x17d229['paused'],'waiting':_0x17d229[_0xad1f('0x56')]};_0x4bd302[_0xad1f('0x21')](_0x13d1a6);}}_0x538f19({'count':_0x4bd302[_0xad1f('0x1a')],'rows':_0x4bd302});});},'SmsQueues':function(){return new Promise(function(_0x4f8a77){var _0x1e4467=[];for(var _0x1aa2f0 in _0x3bcdce[_0xad1f('0x5a')]){if(_0x3bcdce[_0xad1f('0x5a')][_0xad1f('0x4d')](_0x1aa2f0)){var _0x233a0f=_0x3bcdce[_0xad1f('0x5a')][_0x1aa2f0];var _0x43524a={'id':_0x233a0f['id'],'available':_0x233a0f[_0xad1f('0x53')],'loggedIn':_0x233a0f[_0xad1f('0x58')],'name':_0x233a0f['name'],'paused':_0x233a0f[_0xad1f('0x55')],'waiting':_0x233a0f['waiting']};_0x1e4467[_0xad1f('0x21')](_0x43524a);}}_0x4f8a77({'count':_0x1e4467[_0xad1f('0x1a')],'rows':_0x1e4467});});},'FaxQueues':function(){return new Promise(function(_0x5ce299){var _0x3fae30=[];for(var _0x1f76b in _0x3bcdce[_0xad1f('0x5b')]){if(_0x3bcdce[_0xad1f('0x5b')][_0xad1f('0x4d')](_0x1f76b)){var _0xcfc631=_0x3bcdce[_0xad1f('0x5b')][_0x1f76b];var _0x8fe1d4={'id':_0xcfc631['id'],'available':_0xcfc631[_0xad1f('0x53')],'loggedIn':_0xcfc631[_0xad1f('0x58')],'name':_0xcfc631[_0xad1f('0x54')],'paused':_0xcfc631[_0xad1f('0x55')],'waiting':_0xcfc631[_0xad1f('0x56')]};_0x3fae30[_0xad1f('0x21')](_0x8fe1d4);}}_0x5ce299({'count':_0x3fae30[_0xad1f('0x1a')],'rows':_0x3fae30});});},'WhatsappQueues':function(){return new Promise(function(_0x31cd3c){var _0x7c433f=[];for(var _0x54d084 in _0x3bcdce['whatsappQueues']){if(_0x3bcdce[_0xad1f('0x5c')][_0xad1f('0x4d')](_0x54d084)){var _0x2cd9ba=_0x3bcdce[_0xad1f('0x5c')][_0x54d084];var _0x542a73={'id':_0x2cd9ba['id'],'available':_0x2cd9ba[_0xad1f('0x53')],'loggedIn':_0x2cd9ba['loggedIn'],'name':_0x2cd9ba[_0xad1f('0x54')],'paused':_0x2cd9ba[_0xad1f('0x55')],'waiting':_0x2cd9ba[_0xad1f('0x56')]};_0x7c433f[_0xad1f('0x21')](_0x542a73);}}_0x31cd3c({'count':_0x7c433f[_0xad1f('0x1a')],'rows':_0x7c433f});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x218e35){var _0x456639=_[_0xad1f('0x5d')](_0x3bcdce['chatQueuesWaitingInteractions']);_0x218e35({'count':_0x456639[_0xad1f('0x1a')],'rows':_0x456639});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x143b26){var _0x34c680=_[_0xad1f('0x5d')](_0x3bcdce[_0xad1f('0x5e')]);_0x143b26({'count':_0x34c680[_0xad1f('0x1a')],'rows':_0x34c680});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x3a8d96){var _0x52b27e=_[_0xad1f('0x5d')](_0x3bcdce[_0xad1f('0x5f')]);_0x3a8d96({'count':_0x52b27e[_0xad1f('0x1a')],'rows':_0x52b27e});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x30f456){var _0x2a5ed7=_['values'](_0x3bcdce['smsQueuesWaitingInteractions']);_0x30f456({'count':_0x2a5ed7[_0xad1f('0x1a')],'rows':_0x2a5ed7});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x414a41){var _0x363100=_[_0xad1f('0x5d')](_0x3bcdce[_0xad1f('0x60')]);_0x414a41({'count':_0x363100[_0xad1f('0x1a')],'rows':_0x363100});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x111407){var _0x3e0873=_['values'](_0x3bcdce[_0xad1f('0x61')]);_0x111407({'count':_0x3e0873[_0xad1f('0x1a')],'rows':_0x3e0873});});}};var _0x2b2514=jayson[_0xad1f('0x62')](_0x50c263)[_0xad1f('0x63')]();_0x2b2514['on'](_0xad1f('0x40'),function(_0x1cfc54){logger[_0xad1f('0x40')](JSON[_0xad1f('0x39')](_0x1cfc54));return _0x44cea9(_0x1cfc54);});_0x2b2514[_0xad1f('0x13')](0x232c,_0xad1f('0x64'),function(){console[_0xad1f('0x65')](_0xad1f('0x66'),0x232c);return _0x304d10(_0xad1f('0x67')+0x232c);});});};
\ No newline at end of file
index aa1c006..08fdecb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c7f=['join','stack','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http','request','then','error','message','result','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','format','indexOf','true','[%s][INTERVAL]\x20%s','some','info','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when'];(function(_0x656249,_0x52f2b1){var _0x41563c=function(_0x1cf02e){while(--_0x1cf02e){_0x656249['push'](_0x656249['shift']());}};_0x41563c(++_0x52f2b1);}(_0x4c7f,0xb6));var _0xf4c7=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x4c7f[_0x4ff09b];return _0x3f5c2e;};'use strict';var util=require('util');var BPromise=require(_0xf4c7('0x0'));var jayson=require(_0xf4c7('0x1'));var _=require(_0xf4c7('0x2'));var logger=require(_0xf4c7('0x3'))(_0xf4c7('0x4'));var client=jayson[_0xf4c7('0x5')][_0xf4c7('0x6')]({'port':0x232a});function request(_0x21a674,_0x141dab){return new BPromise(function(_0x389e13,_0xea7960){return client[_0xf4c7('0x7')](_0x21a674,_0x141dab)[_0xf4c7('0x8')](function(_0x24388e){if(_0x24388e[_0xf4c7('0x9')]){return _0xea7960(_0x24388e[_0xf4c7('0x9')][_0xf4c7('0xa')]);}else{return _0x389e13(_0x24388e[_0xf4c7('0xb')]);}})[_0xf4c7('0xc')](function(_0x2eb6e0){return _0xea7960(_0x2eb6e0);});});}exports[_0xf4c7('0xd')]=function(_0x44f141,_0x38fef8,_0x2ee1c3){return function(_0x3a0ff9){if(_0x2ee1c3['rules']&&!_0x2ee1c3[_0xf4c7('0xe')][_0x44f141]){logger['info'](_0xf4c7('0xf'),_0x44f141);return _0x3a0ff9[_0xf4c7('0x10')]();}var _0x18912d=[];for(var _0x17458a=0x0;_0x17458a<_0x38fef8[_0xf4c7('0x11')];_0x17458a+=0x1){_0x18912d[_0xf4c7('0x12')](request('Command',{'command':util[_0xf4c7('0x13')]('iftime\x20%s',_0x38fef8[_0x17458a])})[_0xf4c7('0x8')](function(_0x511811){return _0x511811&&_0x511811[_0xf4c7('0xa')]&&_0x511811['message'][_0xf4c7('0x14')](_0xf4c7('0x15'))>=0x0?!![]:![];})['catch'](function(_0x2837a1){logger['error'](_0xf4c7('0x16'),_0x44f141,_0x38fef8[_0x17458a]);}));}BPromise['all'](_0x18912d)['then'](function(_0x47852e){var _0x1283f9=_[_0xf4c7('0x17')](_0x47852e);logger[_0xf4c7('0x18')](_0xf4c7('0x19'),_0x44f141,_0x38fef8['join'](_0xf4c7('0x1a')),_0x1283f9);_0x3a0ff9[_0xf4c7('0x1b')](_0x1283f9);})[_0xf4c7('0xc')](function(_0x45cdd0){console['log'](_0x45cdd0);logger[_0xf4c7('0x9')](_0xf4c7('0x19'),_0x44f141,_0x38fef8[_0xf4c7('0x1c')]('\x20|\x20'),_0x45cdd0[_0xf4c7('0x1d')]);_0x3a0ff9[_0xf4c7('0x10')]();});};};
\ No newline at end of file
+var _0xadcb=['[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','iftime\x20%s','true','[%s][INTERVAL]\x20%s','all','info','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http','request','then','error','message','result','catch','condition','rules'];(function(_0x3a06a4,_0x5e9836){var _0x11518f=function(_0x2cab61){while(--_0x2cab61){_0x3a06a4['push'](_0x3a06a4['shift']());}};_0x11518f(++_0x5e9836);}(_0xadcb,0xa5));var _0xbadc=function(_0x19a1c7,_0x268b39){_0x19a1c7=_0x19a1c7-0x0;var _0x2b852f=_0xadcb[_0x19a1c7];return _0x2b852f;};'use strict';var util=require('util');var BPromise=require(_0xbadc('0x0'));var jayson=require(_0xbadc('0x1'));var _=require(_0xbadc('0x2'));var logger=require(_0xbadc('0x3'))(_0xbadc('0x4'));var client=jayson[_0xbadc('0x5')][_0xbadc('0x6')]({'port':0x232a});function request(_0xcb1c9d,_0x35080f){return new BPromise(function(_0x5d8d15,_0xac79cb){return client[_0xbadc('0x7')](_0xcb1c9d,_0x35080f)[_0xbadc('0x8')](function(_0x123f3f){if(_0x123f3f[_0xbadc('0x9')]){return _0xac79cb(_0x123f3f['error'][_0xbadc('0xa')]);}else{return _0x5d8d15(_0x123f3f[_0xbadc('0xb')]);}})[_0xbadc('0xc')](function(_0x265316){return _0xac79cb(_0x265316);});});}exports[_0xbadc('0xd')]=function(_0x15c157,_0x132126,_0x1b071b){return function(_0x232413){if(_0x1b071b[_0xbadc('0xe')]&&!_0x1b071b[_0xbadc('0xe')][_0x15c157]){logger['info'](_0xbadc('0xf'),_0x15c157);return _0x232413[_0xbadc('0x10')]();}var _0x24c7d6=[];for(var _0x3914ad=0x0;_0x3914ad<_0x132126[_0xbadc('0x11')];_0x3914ad+=0x1){_0x24c7d6[_0xbadc('0x12')](request('Command',{'command':util['format'](_0xbadc('0x13'),_0x132126[_0x3914ad])})[_0xbadc('0x8')](function(_0x992cb9){return _0x992cb9&&_0x992cb9[_0xbadc('0xa')]&&_0x992cb9[_0xbadc('0xa')]['indexOf'](_0xbadc('0x14'))>=0x0?!![]:![];})['catch'](function(_0x3b8505){logger['error'](_0xbadc('0x15'),_0x15c157,_0x132126[_0x3914ad]);}));}BPromise[_0xbadc('0x16')](_0x24c7d6)[_0xbadc('0x8')](function(_0x26ab1c){var _0x529754=_['some'](_0x26ab1c);logger[_0xbadc('0x17')](_0xbadc('0x18'),_0x15c157,_0x132126[_0xbadc('0x19')](_0xbadc('0x1a')),_0x529754);_0x232413[_0xbadc('0x1b')](_0x529754);})[_0xbadc('0xc')](function(_0x13de4c){console[_0xbadc('0x1c')](_0x13de4c);logger[_0xbadc('0x9')](_0xbadc('0x18'),_0x15c157,_0x132126[_0xbadc('0x19')](_0xbadc('0x1a')),_0x13de4c[_0xbadc('0x1d')]);_0x232413[_0xbadc('0x10')]();});};};
\ No newline at end of file
index 4a4ece5..1e55e34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf290=['now','connectedlinename','error','agentringnoanswer','timeout','reason','holdtime','push','[%s][agents][agentringnoanswer]','includes','debug','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','talktime','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','ringtime','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','isNil','[%s][agents][agentcomplete]','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','secondtransfereruniqueid','transfertype','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transfertargetuniqueid','clone','calleridname','hangup','[%s][agents][hangup]','rejected','indexOf','agent','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','calleridnum','connectedlinenum','lastevent','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','[%s][agents][agentcalled]','agentcalledAt'];(function(_0x18e696,_0x566133){var _0x1e4f52=function(_0x51f290){while(--_0x51f290){_0x18e696['push'](_0x18e696['shift']());}};_0x1e4f52(++_0x566133);}(_0xf290,0xde));var _0x0f29=function(_0x59616b,_0x38e534){_0x59616b=_0x59616b-0x0;var _0x5c4523=_0xf290[_0x59616b];return _0x5c4523;};'use strict';var _=require('lodash');var util=require(_0x0f29('0x0'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x1d35f0,_0x4b16e4){utils[_0x0f29('0x1')](util[_0x0f29('0x2')](_0x0f29('0x3'),_0x1d35f0[_0x0f29('0x4')],_0x1d35f0[_0x0f29('0x5')],_0x1d35f0['queue'],_0x1d35f0[_0x0f29('0x6')],_0x1d35f0['interface'],_0x1d35f0[_0x0f29('0x7')],_0x1d35f0[_0x0f29('0x8')],_0x1d35f0[_0x0f29('0x9')]));if(_0x1d35f0[_0x0f29('0xa')]){utils[_0x0f29('0xb')](_0x1d35f0[_0x0f29('0xa')])[_0x0f29('0xc')](function(_0x3c6a6e){if(_0x3c6a6e){_0x1d35f0[_0x0f29('0xd')]=_0x3c6a6e[_0x0f29('0xd')];_0x1d35f0[_0x0f29('0xe')]=_0x1d35f0[_0x0f29('0xf')]?_0x3c6a6e[_0x0f29('0x10')]:![];_0x1d35f0[_0x0f29('0x11')]=_0x1d35f0[_0x0f29('0xe')]?_0x3c6a6e['acwTimeout']:0x0;}utils[_0x0f29('0x12')]('CreateVoiceAgentReport',_0x1d35f0);});}else{utils[_0x0f29('0x12')](_0x0f29('0x13'),_0x1d35f0);}if(_0x4b16e4){delete transfers[_0x1d35f0[_0x0f29('0x4')]];}else{delete agents[_0x1d35f0[_0x0f29('0x14')]];}}exports[_0x0f29('0x15')]=function(_0x2d2573){try{utils['debug'](util[_0x0f29('0x2')](_0x0f29('0x16'),_0x2d2573[_0x0f29('0x4')]),_0x2d2573);agents[_0x2d2573[_0x0f29('0x14')]]=_0x2d2573;agents[_0x2d2573[_0x0f29('0x14')]][_0x0f29('0x17')]=utils[_0x0f29('0x18')]();agents[_0x2d2573[_0x0f29('0x14')]]['lastevent']='called';agents[_0x2d2573[_0x0f29('0x14')]][_0x0f29('0x8')]=null;agents[_0x2d2573[_0x0f29('0x14')]][_0x0f29('0x19')]=null;utils['info'](util[_0x0f29('0x2')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x2d2573[_0x0f29('0x4')],agents[_0x2d2573['destuniqueid']]['membername'],_0x2d2573['destuniqueid']));}catch(_0x23a44f){utils[_0x0f29('0x1a')](util[_0x0f29('0x2')](_0x0f29('0x16'),_0x2d2573[_0x0f29('0x4')]),_0x23a44f);}};exports[_0x0f29('0x1b')]=function(_0x150271){try{if(!_['isNil'](agents[_0x150271[_0x0f29('0x14')]])){utils['debug'](util['format']('[%s][agents][agentringnoanswer]',_0x150271['uniqueid']),_0x150271);utils[_0x0f29('0x1')](util[_0x0f29('0x2')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x150271[_0x0f29('0x4')],agents[_0x150271[_0x0f29('0x14')]][_0x0f29('0x6')],_0x150271[_0x0f29('0x14')]));agents[_0x150271[_0x0f29('0x14')]]['agentringnoanswer']=!![];agents[_0x150271[_0x0f29('0x14')]]['agentringnoanswerAt']=utils[_0x0f29('0x18')]();agents[_0x150271[_0x0f29('0x14')]][_0x0f29('0x9')]=_0x0f29('0x1c');agents[_0x150271['destuniqueid']][_0x0f29('0x1d')]='timeout';agents[_0x150271['destuniqueid']][_0x0f29('0x1e')]=_0x150271['ringtime']?parseInt(_0x150271['ringtime'])/0x3e8:0x0;agents[_0x150271['destuniqueid']]['talktime']=0x0;unanswered[_0x0f29('0x1f')](_0x150271[_0x0f29('0x14')]);}}catch(_0x4cc5a0){utils[_0x0f29('0x1a')](util[_0x0f29('0x2')](_0x0f29('0x20'),_0x150271['uniqueid']),_0x4cc5a0);}};exports['queuecallerabandon']=function(_0x37ebcc){try{_['forIn'](agents,function(_0x36b65c,_0x561c31){if(_0x36b65c['uniqueid']==_0x37ebcc[_0x0f29('0x4')]&&!_[_0x0f29('0x21')](unanswered,_0x36b65c[_0x0f29('0x14')])){utils[_0x0f29('0x22')](util['format']('[%s][agents][queuecallerabandon]',_0x37ebcc[_0x0f29('0x4')]),_0x37ebcc);utils['info'](util['format'](_0x0f29('0x23'),_0x37ebcc['uniqueid'],_0x36b65c[_0x0f29('0x6')],_0x36b65c['destuniqueid']));_0x36b65c['agentringnoanswer']=!![];_0x36b65c[_0x0f29('0x24')]=utils[_0x0f29('0x18')]();_0x36b65c[_0x0f29('0x9')]=_0x0f29('0x25');_0x36b65c[_0x0f29('0x1d')]='abandoned';_0x36b65c[_0x0f29('0x1e')]=_0x37ebcc['holdtime'];_0x36b65c[_0x0f29('0x26')]=0x0;writeDB(_0x36b65c);}});}catch(_0x3e8f3f){utils[_0x0f29('0x1a')](util[_0x0f29('0x2')]('[%s][agents][queuecallerabandon]',_0x37ebcc[_0x0f29('0x4')]),_0x3e8f3f);}};exports[_0x0f29('0x27')]=function(_0x5be4fa){try{if(agents[_0x5be4fa[_0x0f29('0x14')]]){utils[_0x0f29('0x22')](util['format']('[%s][agents][agentconnect]',_0x5be4fa[_0x0f29('0x4')]),_0x5be4fa);utils[_0x0f29('0x1')](util[_0x0f29('0x2')](_0x0f29('0x28'),_0x5be4fa[_0x0f29('0x4')],agents[_0x5be4fa[_0x0f29('0x14')]]['membername'],_0x5be4fa[_0x0f29('0x14')]));agents[_0x5be4fa['destuniqueid']][_0x0f29('0x29')]=utils['now']();agents[_0x5be4fa[_0x0f29('0x14')]][_0x0f29('0x8')]=_0x5be4fa[_0x0f29('0x8')];agents[_0x5be4fa['destuniqueid']]['connectedlinename']=_0x5be4fa[_0x0f29('0x19')];agents[_0x5be4fa['destuniqueid']][_0x0f29('0x1e')]=_0x5be4fa[_0x0f29('0x2a')];agents[_0x5be4fa[_0x0f29('0x14')]][_0x0f29('0x9')]=_0x0f29('0x2b');_['forIn'](agents,function(_0x13c05c,_0xf77c66){if(_0x13c05c[_0x0f29('0x14')]!=_0x5be4fa[_0x0f29('0x14')]&&_0x13c05c[_0x0f29('0x4')]==_0x5be4fa[_0x0f29('0x4')]){_0x13c05c[_0x0f29('0x26')]=0x0;_0x13c05c[_0x0f29('0x1e')]=_0x5be4fa[_0x0f29('0x2a')];_0x13c05c['agentringnoanswer']=!![];_0x13c05c[_0x0f29('0x24')]=utils[_0x0f29('0x18')]();_0x13c05c[_0x0f29('0x9')]=_0x0f29('0x2c');_0x13c05c['reason']=_0x0f29('0x2c');_0x13c05c[_0x0f29('0x2d')]=_0x5be4fa[_0x0f29('0x14')];_0x13c05c[_0x0f29('0x2e')]=_0x5be4fa[_0x0f29('0x6')];writeDB(_0x13c05c);}});}}catch(_0x56062d){utils[_0x0f29('0x1a')](util[_0x0f29('0x2')](_0x0f29('0x2f'),_0x5be4fa['uniqueid']),_0x56062d);}};exports[_0x0f29('0xf')]=function(_0x284279){try{if(!_[_0x0f29('0x30')](agents[_0x284279[_0x0f29('0x14')]])){utils[_0x0f29('0x22')](util[_0x0f29('0x2')](_0x0f29('0x31'),_0x284279[_0x0f29('0x4')]),_0x284279);utils['info'](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x284279[_0x0f29('0x4')],agents[_0x284279[_0x0f29('0x14')]][_0x0f29('0x6')],_0x284279[_0x0f29('0x14')]));agents[_0x284279[_0x0f29('0x14')]][_0x0f29('0xf')]=!![];agents[_0x284279['destuniqueid']][_0x0f29('0x32')]=utils['now']();agents[_0x284279[_0x0f29('0x14')]]['talktime']=utils[_0x0f29('0x33')](agents[_0x284279[_0x0f29('0x14')]][_0x0f29('0x32')],agents[_0x284279[_0x0f29('0x14')]][_0x0f29('0x29')]);agents[_0x284279['destuniqueid']][_0x0f29('0x1d')]=_0x284279[_0x0f29('0x1d')];agents[_0x284279[_0x0f29('0x14')]]['lastevent']=_0x0f29('0x34');writeDB(agents[_0x284279['destuniqueid']]);}}catch(_0x4fd625){utils[_0x0f29('0x1a')](util[_0x0f29('0x2')](_0x0f29('0x31'),_0x284279[_0x0f29('0x4')]),_0x4fd625);}};exports[_0x0f29('0x35')]=function(_0x335435){try{if(!_['isNil'](agents[_0x335435[_0x0f29('0x36')]])){utils[_0x0f29('0x22')](util[_0x0f29('0x2')](_0x0f29('0x37'),_0x335435[_0x0f29('0x4')]),_0x335435);utils[_0x0f29('0x1')](util[_0x0f29('0x2')](_0x0f29('0x38'),_0x335435[_0x0f29('0x4')],agents[_0x335435[_0x0f29('0x36')]]['membername'],agents[_0x335435['transfereruniqueid']][_0x0f29('0x4')]));agents[_0x335435[_0x0f29('0x36')]][_0x0f29('0x39')]=!![];agents[_0x335435[_0x0f29('0x36')]]['transfertype']=_0x0f29('0x3a');agents[_0x335435[_0x0f29('0x36')]][_0x0f29('0x3b')]=_0x335435[_0x0f29('0x3c')];agents[_0x335435[_0x0f29('0x36')]][_0x0f29('0x3d')]=agents[_0x335435[_0x0f29('0x36')]]['uniqueid'];}}catch(_0x17f33){utils[_0x0f29('0x1a')](util[_0x0f29('0x2')](_0x0f29('0x37'),_0x335435[_0x0f29('0x4')]),_0x17f33);}};exports[_0x0f29('0x3e')]=function(_0x5ec172){try{utils[_0x0f29('0x22')](util[_0x0f29('0x2')](_0x0f29('0x3f'),_0x5ec172['origtransfereruniqueid']),_0x5ec172);if(_0x5ec172[_0x0f29('0x40')]==_0x5ec172['origtransfererlinkedid']){if(!_[_0x0f29('0x30')](agents[_0x5ec172['secondtransfereruniqueid']])){utils[_0x0f29('0x1')](util[_0x0f29('0x2')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x5ec172[_0x0f29('0x40')],agents[_0x5ec172[_0x0f29('0x41')]][_0x0f29('0x6')]));agents[_0x5ec172['secondtransfereruniqueid']][_0x0f29('0x39')]=!![];agents[_0x5ec172['secondtransfereruniqueid']][_0x0f29('0x42')]=_0x0f29('0x43');agents[_0x5ec172['secondtransfereruniqueid']][_0x0f29('0x3b')]=_0x5ec172[_0x0f29('0x44')];agents[_0x5ec172['secondtransfereruniqueid']][_0x0f29('0x3d')]=_0x5ec172['origtransfereruniqueid'];}if(_0x5ec172[_0x0f29('0x45')]&&agents[_0x5ec172['transfereeuniqueid']]){agents[_0x5ec172[_0x0f29('0x45')]][_0x0f29('0x46')]=0x1;transfers[_0x5ec172[_0x0f29('0x45')]]=_['clone'](agents[_0x5ec172[_0x0f29('0x45')]]);transfers[_0x5ec172[_0x0f29('0x45')]][_0x0f29('0x7')]=agents[_0x5ec172[_0x0f29('0x41')]]['calleridnum'];transfers[_0x5ec172[_0x0f29('0x45')]]['calleridname']=agents[_0x5ec172[_0x0f29('0x41')]]['calleridname'];transfers[_0x5ec172[_0x0f29('0x45')]][_0x0f29('0x17')]=utils[_0x0f29('0x18')]();transfers[_0x5ec172[_0x0f29('0x45')]][_0x0f29('0x29')]=utils[_0x0f29('0x18')]();transfers[_0x5ec172[_0x0f29('0x45')]]['holdtime']=0x0;transfers[_0x5ec172[_0x0f29('0x45')]]['agententerreason']=0x2;}}else if(_0x5ec172[_0x0f29('0x41')]==_0x5ec172[_0x0f29('0x47')]){if(!_[_0x0f29('0x30')](agents[_0x5ec172['origtransfereruniqueid']])){utils[_0x0f29('0x1')](util[_0x0f29('0x2')](_0x0f29('0x48'),_0x5ec172[_0x0f29('0x40')],agents[_0x5ec172[_0x0f29('0x40')]]['membername']));agents[_0x5ec172['origtransfereruniqueid']][_0x0f29('0x39')]=!![];agents[_0x5ec172[_0x0f29('0x40')]][_0x0f29('0x42')]='ATTENDED';agents[_0x5ec172['origtransfereruniqueid']][_0x0f29('0x3b')]=_0x5ec172[_0x0f29('0x49')];agents[_0x5ec172[_0x0f29('0x40')]]['transferuniqueid']=_0x5ec172['secondtransfereruniqueid'];}if(_0x5ec172['transfertargetuniqueid']&&agents[_0x5ec172[_0x0f29('0x4a')]]){agents[_0x5ec172[_0x0f29('0x4a')]]['agententerreason']=0x1;transfers[_0x5ec172[_0x0f29('0x4a')]]=_[_0x0f29('0x4b')](agents[_0x5ec172['transfertargetuniqueid']]);transfers[_0x5ec172[_0x0f29('0x4a')]]['calleridnum']=agents[_0x5ec172[_0x0f29('0x40')]][_0x0f29('0x7')];transfers[_0x5ec172['transfertargetuniqueid']][_0x0f29('0x4c')]=agents[_0x5ec172[_0x0f29('0x40')]][_0x0f29('0x4c')];transfers[_0x5ec172[_0x0f29('0x4a')]][_0x0f29('0x17')]=utils[_0x0f29('0x18')]();transfers[_0x5ec172['transfertargetuniqueid']][_0x0f29('0x29')]=utils[_0x0f29('0x18')]();transfers[_0x5ec172[_0x0f29('0x4a')]]['holdtime']=0x0;transfers[_0x5ec172[_0x0f29('0x4a')]][_0x0f29('0x46')]=0x2;}}}catch(_0x4bbc7e){utils[_0x0f29('0x1a')](util['format'](_0x0f29('0x3f'),_0x5ec172[_0x0f29('0x40')]),_0x4bbc7e);}};exports[_0x0f29('0x4d')]=function(_0x4bd8f1){try{utils[_0x0f29('0x22')](util[_0x0f29('0x2')](_0x0f29('0x4e'),_0x4bd8f1[_0x0f29('0x4')]),_0x4bd8f1);if(agents[_0x4bd8f1[_0x0f29('0x4')]]&&agents[_0x4bd8f1[_0x0f29('0x4')]]['reason']===_0x0f29('0x1c')){if(_0x4bd8f1['cause']==='21'){agents[_0x4bd8f1['uniqueid']][_0x0f29('0x1d')]=_0x0f29('0x4f');agents[_0x4bd8f1['uniqueid']][_0x0f29('0x9')]=_0x0f29('0x4f');}utils['info'](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x4bd8f1['uniqueid'],agents[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x6')],agents[_0x4bd8f1['uniqueid']]['reason'],agents[_0x4bd8f1[_0x0f29('0x4')]]['lastevent']));writeDB(agents[_0x4bd8f1[_0x0f29('0x4')]]);var _0x473eac=unanswered[_0x0f29('0x50')](_0x4bd8f1[_0x0f29('0x4')]);if(_0x473eac>-0x1){unanswered['splice'](_0x473eac,0x1);}}if(transfers[_0x4bd8f1[_0x0f29('0x4')]]){transfers[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0xf')]=!![];transfers[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x32')]=utils['now']();transfers[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x26')]=utils[_0x0f29('0x33')](transfers[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x32')],transfers[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x29')]);transfers[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x1d')]=_0x0f29('0x51');transfers[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x9')]=_0x0f29('0x34');utils[_0x0f29('0x1')](util[_0x0f29('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x4bd8f1[_0x0f29('0x4')],transfers[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x6')],transfers[_0x4bd8f1[_0x0f29('0x4')]]['reason'],transfers[_0x4bd8f1['uniqueid']][_0x0f29('0x9')]));writeDB(transfers[_0x4bd8f1[_0x0f29('0x4')]],!![]);}if(agents[_0x4bd8f1[_0x0f29('0x4')]]&&agents[_0x4bd8f1['uniqueid']][_0x0f29('0x29')]){agents[_0x4bd8f1['uniqueid']][_0x0f29('0xf')]=!![];agents[_0x4bd8f1['uniqueid']][_0x0f29('0x32')]=utils[_0x0f29('0x18')]();agents[_0x4bd8f1[_0x0f29('0x4')]]['talktime']=utils[_0x0f29('0x33')](agents[_0x4bd8f1['uniqueid']]['agentcompleteAt'],agents[_0x4bd8f1[_0x0f29('0x4')]]['agentconnectAt']);agents[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x1d')]=agents[_0x4bd8f1['uniqueid']][_0x0f29('0x39')]?_0x0f29('0x39'):_0x0f29('0x51');agents[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x9')]=_0x0f29('0x34');utils[_0x0f29('0x1')](util[_0x0f29('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x4bd8f1[_0x0f29('0x4')],agents[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x6')],agents[_0x4bd8f1['uniqueid']][_0x0f29('0x1d')],agents[_0x4bd8f1[_0x0f29('0x4')]]['lastevent']));writeDB(agents[_0x4bd8f1[_0x0f29('0x4')]]);}}catch(_0x5e39a7){utils[_0x0f29('0x1a')](util['format'](_0x0f29('0x4e'),_0x4bd8f1['uniqueid']),_0x5e39a7);}};
\ No newline at end of file
+var _0x76dc=['origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','transfertargetuniqueid','[%s][agents][hangup]','cause','rejected','agent','complete','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','./utils','info','format','uniqueid','membername','interface','calleridnum','queue','getVoiceQueueByName','type','agentcomplete','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','now','lastevent','called','connectedlinenum','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','talktime','queuecallerabandon','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','ringtime','connect','answered_elsewhere','answeredelsewheremembername','isNil','agentcompleteAt','diffTime','agentconnectAt','[%s][agents][agentcomplete]','blindtransfer','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfertype','blind','transferexten','extension','transferuniqueid','[%s][agents][blindtransfer]','[%s][agents][attendedtransfer]','origtransfereruniqueid'];(function(_0x33bf01,_0x1898f9){var _0x1d1cd2=function(_0x21dbc1){while(--_0x21dbc1){_0x33bf01['push'](_0x33bf01['shift']());}};_0x1d1cd2(++_0x1898f9);}(_0x76dc,0x1f2));var _0xc76d=function(_0x268439,_0x523eb6){_0x268439=_0x268439-0x0;var _0x251847=_0x76dc[_0x268439];return _0x251847;};'use strict';var _=require(_0xc76d('0x0'));var util=require(_0xc76d('0x1'));var utils=require(_0xc76d('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x26e85e,_0x49c651){utils[_0xc76d('0x3')](util[_0xc76d('0x4')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x26e85e[_0xc76d('0x5')],_0x26e85e['channel'],_0x26e85e['queue'],_0x26e85e[_0xc76d('0x6')],_0x26e85e[_0xc76d('0x7')],_0x26e85e[_0xc76d('0x8')],_0x26e85e['connectedlinenum'],_0x26e85e['lastevent']));if(_0x26e85e[_0xc76d('0x9')]){utils[_0xc76d('0xa')](_0x26e85e[_0xc76d('0x9')])['then'](function(_0x570197){if(_0x570197){_0x26e85e[_0xc76d('0xb')]=_0x570197[_0xc76d('0xb')];_0x26e85e['agentacw']=_0x26e85e[_0xc76d('0xc')]?_0x570197['acw']:![];_0x26e85e[_0xc76d('0xd')]=_0x26e85e[_0xc76d('0xe')]?_0x570197[_0xc76d('0xf')]:0x0;}utils[_0xc76d('0x10')](_0xc76d('0x11'),_0x26e85e);});}else{utils[_0xc76d('0x10')](_0xc76d('0x11'),_0x26e85e);}if(_0x49c651){delete transfers[_0x26e85e[_0xc76d('0x5')]];}else{delete agents[_0x26e85e[_0xc76d('0x12')]];}}exports[_0xc76d('0x13')]=function(_0x1a7b47){try{utils[_0xc76d('0x14')](util[_0xc76d('0x4')](_0xc76d('0x15'),_0x1a7b47['uniqueid']),_0x1a7b47);agents[_0x1a7b47[_0xc76d('0x12')]]=_0x1a7b47;agents[_0x1a7b47[_0xc76d('0x12')]]['agentcalledAt']=utils[_0xc76d('0x16')]();agents[_0x1a7b47[_0xc76d('0x12')]][_0xc76d('0x17')]=_0xc76d('0x18');agents[_0x1a7b47['destuniqueid']][_0xc76d('0x19')]=null;agents[_0x1a7b47['destuniqueid']]['connectedlinename']=null;utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x1a'),_0x1a7b47[_0xc76d('0x5')],agents[_0x1a7b47[_0xc76d('0x12')]]['membername'],_0x1a7b47[_0xc76d('0x12')]));}catch(_0x361f42){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')](_0xc76d('0x15'),_0x1a7b47['uniqueid']),_0x361f42);}};exports[_0xc76d('0x1c')]=function(_0x324db7){try{if(!_['isNil'](agents[_0x324db7[_0xc76d('0x12')]])){utils[_0xc76d('0x14')](util[_0xc76d('0x4')](_0xc76d('0x1d'),_0x324db7[_0xc76d('0x5')]),_0x324db7);utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x1e'),_0x324db7[_0xc76d('0x5')],agents[_0x324db7[_0xc76d('0x12')]][_0xc76d('0x6')],_0x324db7['destuniqueid']));agents[_0x324db7[_0xc76d('0x12')]][_0xc76d('0x1c')]=!![];agents[_0x324db7['destuniqueid']][_0xc76d('0x1f')]=utils[_0xc76d('0x16')]();agents[_0x324db7['destuniqueid']][_0xc76d('0x17')]=_0xc76d('0x20');agents[_0x324db7[_0xc76d('0x12')]][_0xc76d('0x21')]=_0xc76d('0x20');agents[_0x324db7[_0xc76d('0x12')]][_0xc76d('0x22')]=_0x324db7['ringtime']?parseInt(_0x324db7['ringtime'])/0x3e8:0x0;agents[_0x324db7[_0xc76d('0x12')]][_0xc76d('0x23')]=0x0;unanswered['push'](_0x324db7[_0xc76d('0x12')]);}}catch(_0x52a79a){utils[_0xc76d('0x1b')](util['format'](_0xc76d('0x1d'),_0x324db7['uniqueid']),_0x52a79a);}};exports[_0xc76d('0x24')]=function(_0x18a7fa){try{_['forIn'](agents,function(_0x3d4076,_0x1c68f3){if(_0x3d4076[_0xc76d('0x5')]==_0x18a7fa[_0xc76d('0x5')]&&!_['includes'](unanswered,_0x3d4076[_0xc76d('0x12')])){utils['debug'](util[_0xc76d('0x4')]('[%s][agents][queuecallerabandon]',_0x18a7fa[_0xc76d('0x5')]),_0x18a7fa);utils[_0xc76d('0x3')](util['format']('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x18a7fa['uniqueid'],_0x3d4076['membername'],_0x3d4076[_0xc76d('0x12')]));_0x3d4076[_0xc76d('0x1c')]=!![];_0x3d4076[_0xc76d('0x1f')]=utils[_0xc76d('0x16')]();_0x3d4076[_0xc76d('0x17')]='abandoned';_0x3d4076[_0xc76d('0x21')]='abandoned';_0x3d4076[_0xc76d('0x22')]=_0x18a7fa['holdtime'];_0x3d4076[_0xc76d('0x23')]=0x0;writeDB(_0x3d4076);}});}catch(_0x2332f5){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')](_0xc76d('0x25'),_0x18a7fa['uniqueid']),_0x2332f5);}};exports[_0xc76d('0x26')]=function(_0x371306){try{if(agents[_0x371306[_0xc76d('0x12')]]){utils['debug'](util[_0xc76d('0x4')](_0xc76d('0x27'),_0x371306[_0xc76d('0x5')]),_0x371306);utils['info'](util[_0xc76d('0x4')](_0xc76d('0x28'),_0x371306[_0xc76d('0x5')],agents[_0x371306[_0xc76d('0x12')]][_0xc76d('0x6')],_0x371306[_0xc76d('0x12')]));agents[_0x371306['destuniqueid']]['agentconnectAt']=utils[_0xc76d('0x16')]();agents[_0x371306['destuniqueid']][_0xc76d('0x19')]=_0x371306[_0xc76d('0x19')];agents[_0x371306[_0xc76d('0x12')]][_0xc76d('0x29')]=_0x371306['connectedlinename'];agents[_0x371306['destuniqueid']][_0xc76d('0x22')]=_0x371306[_0xc76d('0x2a')];agents[_0x371306[_0xc76d('0x12')]][_0xc76d('0x17')]=_0xc76d('0x2b');_['forIn'](agents,function(_0x42404c,_0xb264b0){if(_0x42404c[_0xc76d('0x12')]!=_0x371306[_0xc76d('0x12')]&&_0x42404c[_0xc76d('0x5')]==_0x371306[_0xc76d('0x5')]){_0x42404c[_0xc76d('0x23')]=0x0;_0x42404c[_0xc76d('0x22')]=_0x371306[_0xc76d('0x2a')];_0x42404c[_0xc76d('0x1c')]=!![];_0x42404c['agentringnoanswerAt']=utils['now']();_0x42404c[_0xc76d('0x17')]=_0xc76d('0x2c');_0x42404c[_0xc76d('0x21')]=_0xc76d('0x2c');_0x42404c['answeredelsewheredestinationuniqueid']=_0x371306['destuniqueid'];_0x42404c[_0xc76d('0x2d')]=_0x371306[_0xc76d('0x6')];writeDB(_0x42404c);}});}}catch(_0x3e471e){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')](_0xc76d('0x27'),_0x371306[_0xc76d('0x5')]),_0x3e471e);}};exports[_0xc76d('0xc')]=function(_0x50e922){try{if(!_[_0xc76d('0x2e')](agents[_0x50e922[_0xc76d('0x12')]])){utils[_0xc76d('0x14')](util[_0xc76d('0x4')]('[%s][agents][agentcomplete]',_0x50e922['uniqueid']),_0x50e922);utils['info'](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x50e922['uniqueid'],agents[_0x50e922['destuniqueid']][_0xc76d('0x6')],_0x50e922[_0xc76d('0x12')]));agents[_0x50e922[_0xc76d('0x12')]][_0xc76d('0xc')]=!![];agents[_0x50e922[_0xc76d('0x12')]][_0xc76d('0x2f')]=utils[_0xc76d('0x16')]();agents[_0x50e922[_0xc76d('0x12')]]['talktime']=utils[_0xc76d('0x30')](agents[_0x50e922[_0xc76d('0x12')]][_0xc76d('0x2f')],agents[_0x50e922[_0xc76d('0x12')]][_0xc76d('0x31')]);agents[_0x50e922[_0xc76d('0x12')]][_0xc76d('0x21')]=_0x50e922[_0xc76d('0x21')];agents[_0x50e922[_0xc76d('0x12')]]['lastevent']='complete';writeDB(agents[_0x50e922[_0xc76d('0x12')]]);}}catch(_0x170f47){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')](_0xc76d('0x32'),_0x50e922['uniqueid']),_0x170f47);}};exports[_0xc76d('0x33')]=function(_0x1ede13){try{if(!_['isNil'](agents[_0x1ede13['transfereruniqueid']])){utils[_0xc76d('0x14')](util[_0xc76d('0x4')]('[%s][agents][blindtransfer]',_0x1ede13[_0xc76d('0x5')]),_0x1ede13);utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x34'),_0x1ede13[_0xc76d('0x5')],agents[_0x1ede13[_0xc76d('0x35')]][_0xc76d('0x6')],agents[_0x1ede13[_0xc76d('0x35')]][_0xc76d('0x5')]));agents[_0x1ede13[_0xc76d('0x35')]]['transfer']=!![];agents[_0x1ede13[_0xc76d('0x35')]][_0xc76d('0x36')]=_0xc76d('0x37');agents[_0x1ede13['transfereruniqueid']][_0xc76d('0x38')]=_0x1ede13[_0xc76d('0x39')];agents[_0x1ede13['transfereruniqueid']][_0xc76d('0x3a')]=agents[_0x1ede13['transfereruniqueid']][_0xc76d('0x5')];}}catch(_0x12c972){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')](_0xc76d('0x3b'),_0x1ede13['uniqueid']),_0x12c972);}};exports['attendedtransfer']=function(_0x5bec6c){try{utils[_0xc76d('0x14')](util[_0xc76d('0x4')](_0xc76d('0x3c'),_0x5bec6c[_0xc76d('0x3d')]),_0x5bec6c);if(_0x5bec6c[_0xc76d('0x3d')]==_0x5bec6c[_0xc76d('0x3e')]){if(!_['isNil'](agents[_0x5bec6c[_0xc76d('0x3f')]])){utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x40'),_0x5bec6c[_0xc76d('0x3d')],agents[_0x5bec6c['secondtransfereruniqueid']][_0xc76d('0x6')]));agents[_0x5bec6c[_0xc76d('0x3f')]][_0xc76d('0x41')]=!![];agents[_0x5bec6c[_0xc76d('0x3f')]][_0xc76d('0x36')]=_0xc76d('0x42');agents[_0x5bec6c['secondtransfereruniqueid']][_0xc76d('0x38')]=_0x5bec6c[_0xc76d('0x43')];agents[_0x5bec6c['secondtransfereruniqueid']]['transferuniqueid']=_0x5bec6c[_0xc76d('0x3d')];}if(_0x5bec6c['transfereeuniqueid']&&agents[_0x5bec6c[_0xc76d('0x44')]]){agents[_0x5bec6c[_0xc76d('0x44')]][_0xc76d('0x45')]=0x1;transfers[_0x5bec6c[_0xc76d('0x44')]]=_[_0xc76d('0x46')](agents[_0x5bec6c[_0xc76d('0x44')]]);transfers[_0x5bec6c[_0xc76d('0x44')]][_0xc76d('0x8')]=agents[_0x5bec6c[_0xc76d('0x3f')]][_0xc76d('0x8')];transfers[_0x5bec6c[_0xc76d('0x44')]][_0xc76d('0x47')]=agents[_0x5bec6c[_0xc76d('0x3f')]][_0xc76d('0x47')];transfers[_0x5bec6c['transfereeuniqueid']][_0xc76d('0x48')]=utils[_0xc76d('0x16')]();transfers[_0x5bec6c[_0xc76d('0x44')]][_0xc76d('0x31')]=utils[_0xc76d('0x16')]();transfers[_0x5bec6c['transfereeuniqueid']][_0xc76d('0x22')]=0x0;transfers[_0x5bec6c[_0xc76d('0x44')]]['agententerreason']=0x2;}}else if(_0x5bec6c['secondtransfereruniqueid']==_0x5bec6c['secondtransfererlinkedid']){if(!_[_0xc76d('0x2e')](agents[_0x5bec6c[_0xc76d('0x3d')]])){utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x40'),_0x5bec6c[_0xc76d('0x3d')],agents[_0x5bec6c[_0xc76d('0x3d')]][_0xc76d('0x6')]));agents[_0x5bec6c['origtransfereruniqueid']][_0xc76d('0x41')]=!![];agents[_0x5bec6c['origtransfereruniqueid']]['transfertype']=_0xc76d('0x42');agents[_0x5bec6c[_0xc76d('0x3d')]][_0xc76d('0x38')]=_0x5bec6c['secondtransfererexten'];agents[_0x5bec6c[_0xc76d('0x3d')]]['transferuniqueid']=_0x5bec6c['secondtransfereruniqueid'];}if(_0x5bec6c['transfertargetuniqueid']&&agents[_0x5bec6c[_0xc76d('0x49')]]){agents[_0x5bec6c[_0xc76d('0x49')]]['agententerreason']=0x1;transfers[_0x5bec6c[_0xc76d('0x49')]]=_[_0xc76d('0x46')](agents[_0x5bec6c[_0xc76d('0x49')]]);transfers[_0x5bec6c[_0xc76d('0x49')]][_0xc76d('0x8')]=agents[_0x5bec6c[_0xc76d('0x3d')]][_0xc76d('0x8')];transfers[_0x5bec6c['transfertargetuniqueid']]['calleridname']=agents[_0x5bec6c['origtransfereruniqueid']][_0xc76d('0x47')];transfers[_0x5bec6c[_0xc76d('0x49')]][_0xc76d('0x48')]=utils[_0xc76d('0x16')]();transfers[_0x5bec6c[_0xc76d('0x49')]]['agentconnectAt']=utils[_0xc76d('0x16')]();transfers[_0x5bec6c[_0xc76d('0x49')]][_0xc76d('0x22')]=0x0;transfers[_0x5bec6c[_0xc76d('0x49')]][_0xc76d('0x45')]=0x2;}}}catch(_0x2af760){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')]('[%s][agents][attendedtransfer]',_0x5bec6c[_0xc76d('0x3d')]),_0x2af760);}};exports['hangup']=function(_0xa9f2e8){try{utils[_0xc76d('0x14')](util[_0xc76d('0x4')](_0xc76d('0x4a'),_0xa9f2e8['uniqueid']),_0xa9f2e8);if(agents[_0xa9f2e8[_0xc76d('0x5')]]&&agents[_0xa9f2e8['uniqueid']]['reason']===_0xc76d('0x20')){if(_0xa9f2e8[_0xc76d('0x4b')]==='21'){agents[_0xa9f2e8['uniqueid']][_0xc76d('0x21')]=_0xc76d('0x4c');agents[_0xa9f2e8['uniqueid']][_0xc76d('0x17')]=_0xc76d('0x4c');}utils['info'](util[_0xc76d('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xa9f2e8[_0xc76d('0x5')],agents[_0xa9f2e8[_0xc76d('0x5')]]['membername'],agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x21')],agents[_0xa9f2e8['uniqueid']][_0xc76d('0x17')]));writeDB(agents[_0xa9f2e8[_0xc76d('0x5')]]);var _0x277382=unanswered['indexOf'](_0xa9f2e8[_0xc76d('0x5')]);if(_0x277382>-0x1){unanswered['splice'](_0x277382,0x1);}}if(transfers[_0xa9f2e8['uniqueid']]){transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0xc')]=!![];transfers[_0xa9f2e8['uniqueid']][_0xc76d('0x2f')]=utils[_0xc76d('0x16')]();transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x23')]=utils[_0xc76d('0x30')](transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x2f')],transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x31')]);transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x21')]=_0xc76d('0x4d');transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x17')]=_0xc76d('0x4e');utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x4f'),_0xa9f2e8[_0xc76d('0x5')],transfers[_0xa9f2e8[_0xc76d('0x5')]]['membername'],transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x21')],transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x17')]));writeDB(transfers[_0xa9f2e8[_0xc76d('0x5')]],!![]);}if(agents[_0xa9f2e8[_0xc76d('0x5')]]&&agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x31')]){agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0xc')]=!![];agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x2f')]=utils[_0xc76d('0x16')]();agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x23')]=utils[_0xc76d('0x30')](agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x2f')],agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x31')]);agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x21')]=agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x41')]?'transfer':_0xc76d('0x4d');agents[_0xa9f2e8[_0xc76d('0x5')]]['lastevent']=_0xc76d('0x4e');utils[_0xc76d('0x3')](util['format'](_0xc76d('0x4f'),_0xa9f2e8[_0xc76d('0x5')],agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x6')],agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x21')],agents[_0xa9f2e8[_0xc76d('0x5')]]['lastevent']));writeDB(agents[_0xa9f2e8['uniqueid']]);}}catch(_0xe6a1dc){utils[_0xc76d('0x1b')](util['format'](_0xc76d('0x4a'),_0xa9f2e8[_0xc76d('0x5')]),_0xe6a1dc);}};
\ No newline at end of file
index 40a4fce..ef175b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c16=['[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','[%s][calls][varset]','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','startsWith','toLowerCase','substring','lastIndexOf','hangup','noop','set','gotoif','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','connectedlinenum','lastevent','accountcode','then','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','format','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','DOCUMENTATION','error','newstate','isNil','systemanswertime','channelstate','transfer','destinationchannel','disposition','toNumber','[%s][calls][hangup]','callerid','calleridname','calleridnum','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','answertime','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','xmd-phone','destination','\x22\x20<','xmd-callerid','xmd-callerid-preview','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','routeid'];(function(_0x37e845,_0x219f9f){var _0x59e55b=function(_0x5dc6c8){while(--_0x5dc6c8){_0x37e845['push'](_0x37e845['shift']());}};_0x59e55b(++_0x219f9f);}(_0x2c16,0xf0));var _0x62c1=function(_0x55e9ee,_0x4556de){_0x55e9ee=_0x55e9ee-0x0;var _0x2faf58=_0x2c16[_0x55e9ee];return _0x2faf58;};'use strict';var _=require(_0x62c1('0x0'));var util=require(_0x62c1('0x1'));var utils=require(_0x62c1('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0x62c1('0x3'),_0x62c1('0x4'),_0x62c1('0x4'),_0x62c1('0x3'),_0x62c1('0x3'),_0x62c1('0x3'),_0x62c1('0x5'),_0x62c1('0x6'),_0x62c1('0x4'),_0x62c1('0x4'),'FAILED'];var channels={};function writeDB(_0x113a32){var _0x4bcc7b;if(transfers[_0x62c1('0x7')][_0x113a32['uniqueid']]){_0x4bcc7b=_0x113a32[_0x62c1('0x8')];_0x113a32['uniqueid']=transfers[_0x62c1('0x7')][_0x113a32[_0x62c1('0x8')]]['transfereeuniqueid'];}utils[_0x62c1('0x9')](util['format'](_0x62c1('0xa'),_0x113a32[_0x62c1('0x8')],_0x113a32[_0x62c1('0xb')],_0x113a32[_0x62c1('0xc')],_0x113a32[_0x62c1('0xd')],_0x113a32['interface'],_0x113a32['calleridnum'],_0x113a32[_0x62c1('0xe')],_0x113a32[_0x62c1('0xf')]));if(_0x113a32['accountcode']){utils['getUserByInternal'](_0x113a32[_0x62c1('0x10')])[_0x62c1('0x11')](function(_0x54c85a){if(_0x54c85a){_0x113a32[_0x62c1('0x12')]=_0x54c85a['id'];}utils[_0x62c1('0x13')](_0x62c1('0x14'),_0x113a32);});}else{utils[_0x62c1('0x13')](_0x62c1('0x14'),_0x113a32);}if(channels[_0x113a32['uniqueid']]){delete channels[_0x113a32[_0x62c1('0x8')]];}else if(_0x4bcc7b&&channels[_0x4bcc7b]){if(!transfers['blinds'][_0x4bcc7b][_0x62c1('0x15')])delete transfers[_0x62c1('0x7')][_0x4bcc7b];delete channels[_0x4bcc7b];}}exports[_0x62c1('0x16')]=function(_0x141910){try{utils[_0x62c1('0x17')](util[_0x62c1('0x18')](_0x62c1('0x19'),_0x141910[_0x62c1('0x8')]),_0x141910);if(_0x141910[_0x62c1('0x8')]==_0x141910[_0x62c1('0x1a')]&&_0x141910[_0x62c1('0xb')]!=_0x62c1('0x1b')){utils[_0x62c1('0x9')](util['format'](_0x62c1('0x1c'),_0x141910[_0x62c1('0x8')],_0x141910['context'],_0x141910['exten']));channels[_0x141910[_0x62c1('0x8')]]={'uniqueid':_0x141910['uniqueid'],'accountcode':_0x141910['accountcode'],'source':_0x141910['calleridnum'],'destination':_0x141910[_0x62c1('0x1d')],'destinationcontext':_0x141910[_0x62c1('0x1e')],'channel':_0x141910[_0x62c1('0xb')],'starttime':utils[_0x62c1('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x62c1('0x3'),'amaflags':_0x62c1('0x20')};}}catch(_0x39d2db){utils[_0x62c1('0x21')](util[_0x62c1('0x18')](_0x62c1('0x19'),_0x141910['uniqueid']),_0x39d2db);}};exports[_0x62c1('0x22')]=function(_0x34bc6e){try{utils['debug'](util[_0x62c1('0x18')]('[%s][calls][newstate]',_0x34bc6e[_0x62c1('0x8')]),_0x34bc6e);if(!_[_0x62c1('0x23')](channels[_0x34bc6e[_0x62c1('0x8')]])&&_0x34bc6e['channelstate']==0x6){utils['info'](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x34bc6e[_0x62c1('0x8')],_0x34bc6e[_0x62c1('0x1e')],_0x34bc6e[_0x62c1('0xb')]));if(_['isNil'](channels[_0x34bc6e[_0x62c1('0x8')]][_0x62c1('0x24')])){channels[_0x34bc6e[_0x62c1('0x8')]][_0x62c1('0x24')]=utils['now']();}}else if(!_[_0x62c1('0x23')](channels[_0x34bc6e[_0x62c1('0x1a')]])&&_0x34bc6e[_0x62c1('0x25')]==0x6&&_0x34bc6e[_0x62c1('0x1e')]!=_0x62c1('0x26')){utils[_0x62c1('0x9')](util[_0x62c1('0x18')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x34bc6e['uniqueid'],_0x34bc6e[_0x62c1('0x1a')],_0x34bc6e['context'],_0x34bc6e[_0x62c1('0xb')]));channels[_0x34bc6e[_0x62c1('0x1a')]][_0x62c1('0x10')]=_0x34bc6e[_0x62c1('0x10')];channels[_0x34bc6e[_0x62c1('0x1a')]][_0x62c1('0x27')]=_0x34bc6e[_0x62c1('0xb')];if(_[_0x62c1('0x23')](channels[_0x34bc6e[_0x62c1('0x1a')]]['answertime'])){channels[_0x34bc6e['linkedid']]['answertime']=utils['now']();}channels[_0x34bc6e[_0x62c1('0x1a')]][_0x62c1('0x28')]=dispositions[_[_0x62c1('0x29')](_0x34bc6e[_0x62c1('0x25')])]||'ANSWERED';}}catch(_0x9fa2e5){utils[_0x62c1('0x21')](util['format']('[%s][calls][newstate]',_0x34bc6e['uniqueid']),_0x9fa2e5);}};exports['hangup']=function(_0x39c342){try{if(!_[_0x62c1('0x23')](channels[_0x39c342[_0x62c1('0x8')]])){utils[_0x62c1('0x17')](util[_0x62c1('0x18')](_0x62c1('0x2a'),_0x39c342['uniqueid']),_0x39c342);if(_[_0x62c1('0x23')](channels[_0x39c342['uniqueid']][_0x62c1('0x2b')])){channels[_0x39c342['uniqueid']]['callerid']=_0x39c342[_0x62c1('0x2c')]+'\x20<'+_0x39c342[_0x62c1('0x2d')]+'>';}utils[_0x62c1('0x9')](util[_0x62c1('0x18')](_0x62c1('0x2e'),_0x39c342[_0x62c1('0x8')],channels[_0x39c342['uniqueid']][_0x62c1('0x2b')],_0x39c342[_0x62c1('0x2f')]));channels[_0x39c342[_0x62c1('0x8')]][_0x62c1('0x30')]=utils['now']();channels[_0x39c342[_0x62c1('0x8')]][_0x62c1('0x31')]=utils[_0x62c1('0x32')](channels[_0x39c342[_0x62c1('0x8')]][_0x62c1('0x30')],channels[_0x39c342['uniqueid']][_0x62c1('0x33')]);channels[_0x39c342[_0x62c1('0x8')]][_0x62c1('0x34')]=channels[_0x39c342[_0x62c1('0x8')]][_0x62c1('0x35')]?utils[_0x62c1('0x32')](channels[_0x39c342[_0x62c1('0x8')]][_0x62c1('0x30')],channels[_0x39c342[_0x62c1('0x8')]][_0x62c1('0x35')]):0x0;writeDB(channels[_0x39c342['uniqueid']]);}}catch(_0x5358c4){utils[_0x62c1('0x21')](util['format'](_0x62c1('0x2a'),_0x39c342[_0x62c1('0x8')]),_0x5358c4);}};exports[_0x62c1('0x36')]=function(_0x2f3a87){try{if(!_[_0x62c1('0x23')](channels[_0x2f3a87['localtwolinkedid']])){utils['debug'](util['format'](_0x62c1('0x37'),_0x2f3a87[_0x62c1('0x38')]),_0x2f3a87);if(channels[_0x2f3a87[_0x62c1('0x39')]][_0x62c1('0xb')]==_0x2f3a87[_0x62c1('0x3a')]){utils['info'](util[_0x62c1('0x18')](_0x62c1('0x3b'),_0x2f3a87[_0x62c1('0x38')],_0x2f3a87[_0x62c1('0x39')],_0x2f3a87[_0x62c1('0x3c')]));channels[_0x2f3a87[_0x62c1('0x39')]][_0x62c1('0x27')]=_0x2f3a87[_0x62c1('0x3c')];channels[_0x2f3a87[_0x62c1('0x39')]][_0x62c1('0x3d')]=_0x62c1('0x3e');}else if(channels[_0x2f3a87[_0x62c1('0x39')]]['channel']=_0x2f3a87[_0x62c1('0x3f')]){utils['info'](util[_0x62c1('0x18')](_0x62c1('0x3b'),_0x2f3a87[_0x62c1('0x38')],_0x2f3a87[_0x62c1('0x39')],_0x2f3a87[_0x62c1('0x40')]));channels[_0x2f3a87['localtwolinkedid']][_0x62c1('0x27')]=_0x2f3a87['origtransfererchannel'];channels[_0x2f3a87[_0x62c1('0x39')]]['userfield']='_attended';}}}catch(_0x8a4676){utils[_0x62c1('0x21')](util[_0x62c1('0x18')]('[%s][calls][attendedtransfer]',_0x2f3a87[_0x62c1('0x38')]),_0x8a4676);}};exports[_0x62c1('0x41')]=function(_0x4d760c){try{if(!_[_0x62c1('0x23')](channels[_0x4d760c[_0x62c1('0x8')]])){utils[_0x62c1('0x17')](util['format']('[%s][calls][musiconholdstart]',_0x4d760c[_0x62c1('0x8')]),_0x4d760c);channels[_0x4d760c[_0x62c1('0x8')]][_0x62c1('0x42')]=utils[_0x62c1('0x1f')]();utils['info'](util[_0x62c1('0x18')](_0x62c1('0x43'),_0x4d760c[_0x62c1('0x8')],channels[_0x4d760c[_0x62c1('0x8')]][_0x62c1('0x42')]));}}catch(_0x2d90ba){utils['error'](util[_0x62c1('0x18')](_0x62c1('0x44'),_0x4d760c[_0x62c1('0x8')]),_0x2d90ba);}};exports['musiconholdstop']=function(_0x18fce2){try{if(!_['isNil'](channels[_0x18fce2[_0x62c1('0x8')]])){utils[_0x62c1('0x17')](util['format'](_0x62c1('0x45'),_0x18fce2['uniqueid']),_0x18fce2);if(!_[_0x62c1('0x23')](channels[_0x18fce2['uniqueid']][_0x62c1('0x42')])){channels[_0x18fce2['uniqueid']][_0x62c1('0x46')]+=utils[_0x62c1('0x32')](utils[_0x62c1('0x1f')](),channels[_0x18fce2['uniqueid']][_0x62c1('0x42')]);utils[_0x62c1('0x9')](util[_0x62c1('0x18')](_0x62c1('0x47'),_0x18fce2['uniqueid'],channels[_0x18fce2[_0x62c1('0x8')]]['mohtime']));delete channels[_0x18fce2[_0x62c1('0x8')]][_0x62c1('0x42')];}}}catch(_0x4cc13f){utils[_0x62c1('0x21')](util['format'](_0x62c1('0x45'),_0x18fce2[_0x62c1('0x8')]),_0x4cc13f);}};exports[_0x62c1('0x48')]=function(_0x3ada6){try{if(!_[_0x62c1('0x23')](channels[_0x3ada6[_0x62c1('0x8')]])){utils[_0x62c1('0x17')](util[_0x62c1('0x18')]('[%s][calls][varset]',_0x3ada6[_0x62c1('0x8')]),_0x3ada6);if(!_['isNil'](_0x3ada6[_0x62c1('0x49')][_0x62c1('0x4a')])){utils[_0x62c1('0x9')](util[_0x62c1('0x18')](_0x62c1('0x4b'),_0x3ada6[_0x62c1('0x8')],_0x3ada6['value']));channels[_0x3ada6['uniqueid']][_0x62c1('0x4c')]=_0x3ada6[_0x62c1('0x4d')];}if(!_['isNil'](_0x3ada6[_0x62c1('0x49')][_0x62c1('0x4e')])){utils[_0x62c1('0x9')](util[_0x62c1('0x18')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x3ada6[_0x62c1('0x8')],_0x3ada6[_0x62c1('0x4d')]));channels[_0x3ada6['uniqueid']][_0x62c1('0x4f')]=_0x3ada6[_0x62c1('0x4d')];channels[_0x3ada6[_0x62c1('0x8')]][_0x62c1('0x2b')]='\x22'+_0x3ada6[_0x62c1('0x4d')]+_0x62c1('0x50')+_0x3ada6['value']+'>';}if(!_[_0x62c1('0x23')](_0x3ada6[_0x62c1('0x49')]['xmd-callerid-preview'])||!_[_0x62c1('0x23')](_0x3ada6[_0x62c1('0x49')][_0x62c1('0x51')])){utils[_0x62c1('0x9')](util[_0x62c1('0x18')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x3ada6[_0x62c1('0x8')],!_[_0x62c1('0x23')](_0x3ada6['variable'][_0x62c1('0x52')])?_0x62c1('0x52'):_0x62c1('0x51'),_0x3ada6[_0x62c1('0x4d')]));channels[_0x3ada6[_0x62c1('0x8')]]['callerid']=_0x3ada6[_0x62c1('0x4d')];}if(!_[_0x62c1('0x23')](_0x3ada6[_0x62c1('0x49')][_0x62c1('0x53')])||!_['isNil'](_0x3ada6[_0x62c1('0x49')][_0x62c1('0x54')])){utils[_0x62c1('0x9')](util[_0x62c1('0x18')](_0x62c1('0x55'),_0x3ada6['uniqueid'],!_[_0x62c1('0x23')](_0x3ada6[_0x62c1('0x49')][_0x62c1('0x53')])?_0x62c1('0x53'):_0x62c1('0x54'),_0x3ada6[_0x62c1('0x4d')]));channels[_0x3ada6[_0x62c1('0x8')]][_0x62c1('0x56')]=_0x62c1('0x57');channels[_0x3ada6['uniqueid']][_0x62c1('0x58')]=_0x3ada6[_0x62c1('0x4d')];channels[_0x3ada6[_0x62c1('0x8')]][_0x62c1('0xc')]=!![];}if(!_[_0x62c1('0x23')](_0x3ada6['variable']['xmd-contactid'])){utils['info'](util[_0x62c1('0x18')](_0x62c1('0x59'),_0x3ada6[_0x62c1('0x8')],_0x3ada6[_0x62c1('0x4d')]));channels[_0x3ada6['uniqueid']][_0x62c1('0x5a')]=_0x3ada6[_0x62c1('0x4d')];}if(!_[_0x62c1('0x23')](_0x3ada6['variable'][_0x62c1('0x5b')])){utils[_0x62c1('0x9')](util[_0x62c1('0x18')](_0x62c1('0x5c'),_0x3ada6[_0x62c1('0x8')],_0x3ada6[_0x62c1('0x4d')]));channels[_0x3ada6[_0x62c1('0x8')]][_0x62c1('0x5d')]=_0x3ada6[_0x62c1('0x4d')];}if(!_[_0x62c1('0x23')](_0x3ada6['variable'][_0x62c1('0x5e')])){utils[_0x62c1('0x9')](util[_0x62c1('0x18')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x3ada6[_0x62c1('0x8')],_0x3ada6[_0x62c1('0x4d')]));channels[_0x3ada6[_0x62c1('0x8')]][_0x62c1('0x5f')]=_0x3ada6[_0x62c1('0x4d')];}if(!_[_0x62c1('0x23')](_0x3ada6[_0x62c1('0x49')]['sipcallid'])){utils[_0x62c1('0x9')](util[_0x62c1('0x18')](_0x62c1('0x60'),_0x3ada6[_0x62c1('0x8')],_0x3ada6[_0x62c1('0x4d')]));channels[_0x3ada6[_0x62c1('0x8')]][_0x62c1('0x61')]=_0x3ada6['value'];}}}catch(_0x10c59d){utils[_0x62c1('0x21')](util['format'](_0x62c1('0x62'),_0x3ada6[_0x62c1('0x8')]),_0x10c59d);}};exports[_0x62c1('0x63')]=function(_0x5b517e){try{if(!_[_0x62c1('0x23')](channels[_0x5b517e[_0x62c1('0x8')]])){utils['debug'](util[_0x62c1('0x18')](_0x62c1('0x64'),_0x5b517e[_0x62c1('0x8')]),_0x5b517e);utils['info'](util['format'](_0x62c1('0x65'),_0x5b517e[_0x62c1('0x8')],_0x5b517e[_0x62c1('0x66')],_0x5b517e[_0x62c1('0x67')]));if(_0x5b517e['application']['toLowerCase']()=='set'&&_[_0x62c1('0x68')](_0x5b517e[_0x62c1('0x67')][_0x62c1('0x69')](),'cdr')){var _0x16566c=_0x5b517e[_0x62c1('0x67')]['split']('=');var _0x197aa4=_0x16566c[0x0][_0x62c1('0x6a')](_0x16566c[0x0][_0x62c1('0x6b')]('(')+0x1,_0x16566c[0x0][_0x62c1('0x6b')](')'));var _0x158edb=_0x16566c[0x1];channels[_0x5b517e[_0x62c1('0x8')]][_0x197aa4]=_0x158edb;}if(!_['includes']([_0x62c1('0x6c'),_0x62c1('0x6d'),'execif',_0x62c1('0x6e'),_0x62c1('0x6f')],_0x5b517e['application'][_0x62c1('0x69')]())){channels[_0x5b517e[_0x62c1('0x8')]][_0x62c1('0x56')]=_0x5b517e[_0x62c1('0x66')];channels[_0x5b517e[_0x62c1('0x8')]][_0x62c1('0x58')]=_0x5b517e[_0x62c1('0x67')];}}}catch(_0x1d9b66){utils[_0x62c1('0x21')](util['format']('[%s][calls][newexten]',_0x5b517e['uniqueid']),_0x1d9b66);}};
\ No newline at end of file
+var _0x553f=['appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','noop','execif','gotoif','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','ANSWERED','BUSY','FAILED','blinds','uniqueid','transfereeuniqueid','format','channel','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','request','CreateVoiceCallReport','recording','debug','[%s][calls][newchannel]','linkedid','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','DOCUMENTATION','newstate','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','transfer','info','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','[%s][calls][newstate]','hangup','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','diffTime','starttime','error','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstop]','mohtime','varset','[%s][calls][varset]','variable','source','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application'];(function(_0x2e5bf5,_0x54ba81){var _0x139b51=function(_0x2ceeea){while(--_0x2ceeea){_0x2e5bf5['push'](_0x2e5bf5['shift']());}};_0x139b51(++_0x54ba81);}(_0x553f,0x1c0));var _0xf553=function(_0x5c2e05,_0x3e9ec8){_0x5c2e05=_0x5c2e05-0x0;var _0x18cfbe=_0x553f[_0x5c2e05];return _0x18cfbe;};'use strict';var _=require(_0xf553('0x0'));var util=require(_0xf553('0x1'));var utils=require(_0xf553('0x2'));var transfers=require(_0xf553('0x3'));var dispositions=[_0xf553('0x4'),'FAILED','FAILED',_0xf553('0x4'),'NO\x20ANSWER',_0xf553('0x4'),_0xf553('0x5'),_0xf553('0x6'),'FAILED',_0xf553('0x7'),_0xf553('0x7')];var channels={};function writeDB(_0x38573a){var _0x54a907;if(transfers[_0xf553('0x8')][_0x38573a[_0xf553('0x9')]]){_0x54a907=_0x38573a['uniqueid'];_0x38573a['uniqueid']=transfers['blinds'][_0x38573a[_0xf553('0x9')]][_0xf553('0xa')];}utils['info'](util[_0xf553('0xb')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x38573a[_0xf553('0x9')],_0x38573a[_0xf553('0xc')],_0x38573a['queue'],_0x38573a[_0xf553('0xd')],_0x38573a[_0xf553('0xe')],_0x38573a[_0xf553('0xf')],_0x38573a[_0xf553('0x10')],_0x38573a[_0xf553('0x11')]));if(_0x38573a[_0xf553('0x12')]){utils[_0xf553('0x13')](_0x38573a[_0xf553('0x12')])[_0xf553('0x14')](function(_0x154752){if(_0x154752){_0x38573a['UserId']=_0x154752['id'];}utils[_0xf553('0x15')](_0xf553('0x16'),_0x38573a);});}else{utils['request'](_0xf553('0x16'),_0x38573a);}if(channels[_0x38573a[_0xf553('0x9')]]){delete channels[_0x38573a[_0xf553('0x9')]];}else if(_0x54a907&&channels[_0x54a907]){if(!transfers[_0xf553('0x8')][_0x54a907][_0xf553('0x17')])delete transfers[_0xf553('0x8')][_0x54a907];delete channels[_0x54a907];}}exports['newchannel']=function(_0x450bb3){try{utils[_0xf553('0x18')](util[_0xf553('0xb')](_0xf553('0x19'),_0x450bb3[_0xf553('0x9')]),_0x450bb3);if(_0x450bb3['uniqueid']==_0x450bb3[_0xf553('0x1a')]&&_0x450bb3[_0xf553('0xc')]!='OutgoingSpoolFailed'){utils['info'](util[_0xf553('0xb')](_0xf553('0x1b'),_0x450bb3['uniqueid'],_0x450bb3['context'],_0x450bb3[_0xf553('0x1c')]));channels[_0x450bb3['uniqueid']]={'uniqueid':_0x450bb3[_0xf553('0x9')],'accountcode':_0x450bb3[_0xf553('0x12')],'source':_0x450bb3[_0xf553('0xf')],'destination':_0x450bb3[_0xf553('0x1c')],'destinationcontext':_0x450bb3[_0xf553('0x1d')],'channel':_0x450bb3[_0xf553('0xc')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xf553('0x1e')};}}catch(_0x12e0d1){utils['error'](util[_0xf553('0xb')]('[%s][calls][newchannel]',_0x450bb3[_0xf553('0x9')]),_0x12e0d1);}};exports[_0xf553('0x1f')]=function(_0x3a0aa7){try{utils['debug'](util[_0xf553('0xb')]('[%s][calls][newstate]',_0x3a0aa7[_0xf553('0x9')]),_0x3a0aa7);if(!_[_0xf553('0x20')](channels[_0x3a0aa7['uniqueid']])&&_0x3a0aa7[_0xf553('0x21')]==0x6){utils['info'](util[_0xf553('0xb')](_0xf553('0x22'),_0x3a0aa7['uniqueid'],_0x3a0aa7[_0xf553('0x1d')],_0x3a0aa7[_0xf553('0xc')]));if(_[_0xf553('0x20')](channels[_0x3a0aa7['uniqueid']][_0xf553('0x23')])){channels[_0x3a0aa7[_0xf553('0x9')]][_0xf553('0x23')]=utils[_0xf553('0x24')]();}}else if(!_['isNil'](channels[_0x3a0aa7[_0xf553('0x1a')]])&&_0x3a0aa7[_0xf553('0x21')]==0x6&&_0x3a0aa7[_0xf553('0x1d')]!=_0xf553('0x25')){utils[_0xf553('0x26')](util[_0xf553('0xb')](_0xf553('0x27'),_0x3a0aa7[_0xf553('0x9')],_0x3a0aa7['linkedid'],_0x3a0aa7[_0xf553('0x1d')],_0x3a0aa7[_0xf553('0xc')]));channels[_0x3a0aa7['linkedid']][_0xf553('0x12')]=_0x3a0aa7[_0xf553('0x12')];channels[_0x3a0aa7[_0xf553('0x1a')]][_0xf553('0x28')]=_0x3a0aa7[_0xf553('0xc')];if(_['isNil'](channels[_0x3a0aa7[_0xf553('0x1a')]][_0xf553('0x29')])){channels[_0x3a0aa7[_0xf553('0x1a')]][_0xf553('0x29')]=utils[_0xf553('0x24')]();}channels[_0x3a0aa7[_0xf553('0x1a')]][_0xf553('0x2a')]=dispositions[_[_0xf553('0x2b')](_0x3a0aa7[_0xf553('0x21')])]||_0xf553('0x5');}}catch(_0x2808cc){utils['error'](util[_0xf553('0xb')](_0xf553('0x2c'),_0x3a0aa7[_0xf553('0x9')]),_0x2808cc);}};exports[_0xf553('0x2d')]=function(_0x21125b){try{if(!_[_0xf553('0x20')](channels[_0x21125b[_0xf553('0x9')]])){utils[_0xf553('0x18')](util[_0xf553('0xb')]('[%s][calls][hangup]',_0x21125b[_0xf553('0x9')]),_0x21125b);if(_[_0xf553('0x20')](channels[_0x21125b[_0xf553('0x9')]][_0xf553('0x2e')])){channels[_0x21125b['uniqueid']][_0xf553('0x2e')]=_0x21125b[_0xf553('0x2f')]+'\x20<'+_0x21125b[_0xf553('0xf')]+'>';}utils[_0xf553('0x26')](util[_0xf553('0xb')](_0xf553('0x30'),_0x21125b[_0xf553('0x9')],channels[_0x21125b[_0xf553('0x9')]][_0xf553('0x2e')],_0x21125b[_0xf553('0x31')]));channels[_0x21125b['uniqueid']][_0xf553('0x32')]=utils[_0xf553('0x24')]();channels[_0x21125b[_0xf553('0x9')]]['duration']=utils[_0xf553('0x33')](channels[_0x21125b['uniqueid']][_0xf553('0x32')],channels[_0x21125b[_0xf553('0x9')]][_0xf553('0x34')]);channels[_0x21125b[_0xf553('0x9')]]['billableseconds']=channels[_0x21125b[_0xf553('0x9')]][_0xf553('0x29')]?utils[_0xf553('0x33')](channels[_0x21125b[_0xf553('0x9')]][_0xf553('0x32')],channels[_0x21125b[_0xf553('0x9')]]['answertime']):0x0;writeDB(channels[_0x21125b[_0xf553('0x9')]]);}}catch(_0x1e2f30){utils[_0xf553('0x35')](util[_0xf553('0xb')](_0xf553('0x36'),_0x21125b[_0xf553('0x9')]),_0x1e2f30);}};exports[_0xf553('0x37')]=function(_0x18540f){try{if(!_['isNil'](channels[_0x18540f[_0xf553('0x38')]])){utils[_0xf553('0x18')](util[_0xf553('0xb')](_0xf553('0x39'),_0x18540f[_0xf553('0x3a')]),_0x18540f);if(channels[_0x18540f[_0xf553('0x38')]][_0xf553('0xc')]==_0x18540f['transfereechannel']){utils[_0xf553('0x26')](util[_0xf553('0xb')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x18540f[_0xf553('0x3a')],_0x18540f['localtwolinkedid'],_0x18540f[_0xf553('0x3b')]));channels[_0x18540f[_0xf553('0x38')]][_0xf553('0x28')]=_0x18540f[_0xf553('0x3b')];channels[_0x18540f[_0xf553('0x38')]][_0xf553('0x3c')]=_0xf553('0x3d');}else if(channels[_0x18540f[_0xf553('0x38')]][_0xf553('0xc')]=_0x18540f[_0xf553('0x3e')]){utils[_0xf553('0x26')](util[_0xf553('0xb')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x18540f[_0xf553('0x3a')],_0x18540f[_0xf553('0x38')],_0x18540f[_0xf553('0x3f')]));channels[_0x18540f[_0xf553('0x38')]]['destinationchannel']=_0x18540f[_0xf553('0x3f')];channels[_0x18540f['localtwolinkedid']][_0xf553('0x3c')]=_0xf553('0x3d');}}}catch(_0x4fb22e){utils[_0xf553('0x35')](util['format']('[%s][calls][attendedtransfer]',_0x18540f[_0xf553('0x3a')]),_0x4fb22e);}};exports[_0xf553('0x40')]=function(_0x473c38){try{if(!_[_0xf553('0x20')](channels[_0x473c38['uniqueid']])){utils[_0xf553('0x18')](util[_0xf553('0xb')](_0xf553('0x41'),_0x473c38[_0xf553('0x9')]),_0x473c38);channels[_0x473c38['uniqueid']][_0xf553('0x42')]=utils['now']();utils[_0xf553('0x26')](util[_0xf553('0xb')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x473c38['uniqueid'],channels[_0x473c38['uniqueid']][_0xf553('0x42')]));}}catch(_0x35e9c8){utils[_0xf553('0x35')](util[_0xf553('0xb')](_0xf553('0x41'),_0x473c38[_0xf553('0x9')]),_0x35e9c8);}};exports['musiconholdstop']=function(_0x4bef32){try{if(!_[_0xf553('0x20')](channels[_0x4bef32['uniqueid']])){utils[_0xf553('0x18')](util['format'](_0xf553('0x43'),_0x4bef32[_0xf553('0x9')]),_0x4bef32);if(!_[_0xf553('0x20')](channels[_0x4bef32[_0xf553('0x9')]]['musiconholdstartAt'])){channels[_0x4bef32[_0xf553('0x9')]][_0xf553('0x44')]+=utils['diffTime'](utils[_0xf553('0x24')](),channels[_0x4bef32['uniqueid']][_0xf553('0x42')]);utils[_0xf553('0x26')](util['format']('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x4bef32[_0xf553('0x9')],channels[_0x4bef32[_0xf553('0x9')]][_0xf553('0x44')]));delete channels[_0x4bef32[_0xf553('0x9')]][_0xf553('0x42')];}}}catch(_0x37ef35){utils[_0xf553('0x35')](util[_0xf553('0xb')](_0xf553('0x43'),_0x4bef32[_0xf553('0x9')]),_0x37ef35);}};exports[_0xf553('0x45')]=function(_0x349edc){try{if(!_['isNil'](channels[_0x349edc[_0xf553('0x9')]])){utils[_0xf553('0x18')](util['format'](_0xf553('0x46'),_0x349edc[_0xf553('0x9')]),_0x349edc);if(!_[_0xf553('0x20')](_0x349edc[_0xf553('0x47')]['xmd-originatecalleridnum'])){utils['info'](util[_0xf553('0xb')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x349edc[_0xf553('0x9')],_0x349edc['value']));channels[_0x349edc['uniqueid']][_0xf553('0x48')]=_0x349edc[_0xf553('0x49')];}if(!_[_0xf553('0x20')](_0x349edc[_0xf553('0x47')][_0xf553('0x4a')])){utils['info'](util[_0xf553('0xb')](_0xf553('0x4b'),_0x349edc[_0xf553('0x9')],_0x349edc[_0xf553('0x49')]));channels[_0x349edc[_0xf553('0x9')]]['destination']=_0x349edc[_0xf553('0x49')];channels[_0x349edc['uniqueid']][_0xf553('0x2e')]='\x22'+_0x349edc[_0xf553('0x49')]+'\x22\x20<'+_0x349edc[_0xf553('0x49')]+'>';}if(!_['isNil'](_0x349edc[_0xf553('0x47')]['xmd-callerid-preview'])||!_[_0xf553('0x20')](_0x349edc[_0xf553('0x47')]['xmd-callerid'])){utils[_0xf553('0x26')](util[_0xf553('0xb')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x349edc[_0xf553('0x9')],!_[_0xf553('0x20')](_0x349edc[_0xf553('0x47')]['xmd-callerid-preview'])?_0xf553('0x4c'):_0xf553('0x4d'),_0x349edc[_0xf553('0x49')]));channels[_0x349edc[_0xf553('0x9')]][_0xf553('0x2e')]=_0x349edc[_0xf553('0x49')];}if(!_[_0xf553('0x20')](_0x349edc[_0xf553('0x47')]['xmd-queue'])||!_[_0xf553('0x20')](_0x349edc[_0xf553('0x47')]['xmcs-queue'])){utils['info'](util[_0xf553('0xb')](_0xf553('0x4e'),_0x349edc[_0xf553('0x9')],!_[_0xf553('0x20')](_0x349edc['variable'][_0xf553('0x4f')])?'xmd-queue':_0xf553('0x50'),_0x349edc[_0xf553('0x49')]));channels[_0x349edc[_0xf553('0x9')]][_0xf553('0x51')]=_0xf553('0x52');channels[_0x349edc[_0xf553('0x9')]][_0xf553('0x53')]=_0x349edc['value'];channels[_0x349edc[_0xf553('0x9')]][_0xf553('0x54')]=!![];}if(!_[_0xf553('0x20')](_0x349edc['variable'][_0xf553('0x55')])){utils[_0xf553('0x26')](util['format'](_0xf553('0x56'),_0x349edc[_0xf553('0x9')],_0x349edc[_0xf553('0x49')]));channels[_0x349edc[_0xf553('0x9')]][_0xf553('0x57')]=_0x349edc[_0xf553('0x49')];}if(!_[_0xf553('0x20')](_0x349edc[_0xf553('0x47')][_0xf553('0x58')])){utils[_0xf553('0x26')](util['format']('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x349edc[_0xf553('0x9')],_0x349edc['value']));channels[_0x349edc['uniqueid']]['type']=_0x349edc[_0xf553('0x49')];}if(!_['isNil'](_0x349edc[_0xf553('0x47')][_0xf553('0x59')])){utils[_0xf553('0x26')](util[_0xf553('0xb')](_0xf553('0x5a'),_0x349edc[_0xf553('0x9')],_0x349edc['value']));channels[_0x349edc[_0xf553('0x9')]]['routeid']=_0x349edc[_0xf553('0x49')];}if(!_[_0xf553('0x20')](_0x349edc[_0xf553('0x47')][_0xf553('0x5b')])){utils[_0xf553('0x26')](util[_0xf553('0xb')](_0xf553('0x5c'),_0x349edc[_0xf553('0x9')],_0x349edc[_0xf553('0x49')]));channels[_0x349edc[_0xf553('0x9')]][_0xf553('0x5b')]=_0x349edc['value'];}}}catch(_0xab8b84){utils[_0xf553('0x35')](util[_0xf553('0xb')](_0xf553('0x46'),_0x349edc[_0xf553('0x9')]),_0xab8b84);}};exports[_0xf553('0x5d')]=function(_0x4c6dda){try{if(!_[_0xf553('0x20')](channels[_0x4c6dda[_0xf553('0x9')]])){utils['debug'](util[_0xf553('0xb')](_0xf553('0x5e'),_0x4c6dda[_0xf553('0x9')]),_0x4c6dda);utils[_0xf553('0x26')](util[_0xf553('0xb')](_0xf553('0x5f'),_0x4c6dda['uniqueid'],_0x4c6dda[_0xf553('0x60')],_0x4c6dda[_0xf553('0x61')]));if(_0x4c6dda[_0xf553('0x60')][_0xf553('0x62')]()==_0xf553('0x63')&&_[_0xf553('0x64')](_0x4c6dda[_0xf553('0x61')][_0xf553('0x62')](),_0xf553('0x65'))){var _0x424607=_0x4c6dda[_0xf553('0x61')][_0xf553('0x66')]('=');var _0x274d1f=_0x424607[0x0][_0xf553('0x67')](_0x424607[0x0][_0xf553('0x68')]('(')+0x1,_0x424607[0x0][_0xf553('0x68')](')'));var _0x2cb39d=_0x424607[0x1];channels[_0x4c6dda[_0xf553('0x9')]][_0x274d1f]=_0x2cb39d;}if(!_[_0xf553('0x69')]([_0xf553('0x2d'),_0xf553('0x6a'),_0xf553('0x6b'),_0xf553('0x63'),_0xf553('0x6c')],_0x4c6dda[_0xf553('0x60')][_0xf553('0x62')]())){channels[_0x4c6dda[_0xf553('0x9')]][_0xf553('0x51')]=_0x4c6dda[_0xf553('0x60')];channels[_0x4c6dda['uniqueid']]['lastdata']=_0x4c6dda[_0xf553('0x61')];}}}catch(_0x358c8c){utils[_0xf553('0x35')](util[_0xf553('0xb')]('[%s][calls][newexten]',_0x4c6dda[_0xf553('0x9')]),_0x358c8c);}};
\ No newline at end of file
index 7cf9a4b..b65c82c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21e3=['info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils','connect'];(function(_0x4a8b5d,_0xae63cb){var _0x265252=function(_0x57462e){while(--_0x57462e){_0x4a8b5d['push'](_0x4a8b5d['shift']());}};_0x265252(++_0xae63cb);}(_0x21e3,0x80));var _0x321e=function(_0x4d2f6e,_0x5f10d6){_0x4d2f6e=_0x4d2f6e-0x0;var _0x15bac4=_0x21e3[_0x4d2f6e];return _0x15bac4;};'use strict';var utils=require(_0x321e('0x0'));exports[_0x321e('0x1')]=function(){utils[_0x321e('0x2')](_0x321e('0x3'));};exports[_0x321e('0x4')]=function(){utils[_0x321e('0x2')](_0x321e('0x5'));};exports[_0x321e('0x6')]=function(){utils[_0x321e('0x2')](_0x321e('0x7'));};exports['error']=function(_0x3ebcfe){utils[_0x321e('0x8')](_0x321e('0x9'),_0x3ebcfe);};exports[_0x321e('0xa')]=function(){utils[_0x321e('0x2')](_0x321e('0xb'));};exports[_0x321e('0xc')]=function(_0x1b08e6){};
\ No newline at end of file
+var _0x46d7=['[core]\x20error','close','[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error'];(function(_0x3fa972,_0x3f4a79){var _0x4101ec=function(_0x5f5864){while(--_0x5f5864){_0x3fa972['push'](_0x3fa972['shift']());}};_0x4101ec(++_0x3f4a79);}(_0x46d7,0x1b1));var _0x746d=function(_0x322b7f,_0x24f860){_0x322b7f=_0x322b7f-0x0;var _0x2078c1=_0x46d7[_0x322b7f];return _0x2078c1;};'use strict';var utils=require(_0x746d('0x0'));exports[_0x746d('0x1')]=function(){utils[_0x746d('0x2')](_0x746d('0x3'));};exports[_0x746d('0x4')]=function(){utils[_0x746d('0x2')](_0x746d('0x5'));};exports[_0x746d('0x6')]=function(){utils[_0x746d('0x2')](_0x746d('0x7'));};exports[_0x746d('0x8')]=function(_0x4cd44c){utils[_0x746d('0x8')](_0x746d('0x9'),_0x4cd44c);};exports[_0x746d('0xa')]=function(){utils['info'](_0x746d('0xb'));};exports[_0x746d('0xc')]=function(_0x3cc37a){};
\ No newline at end of file
index 3df39f7..b2d04de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6fb=['connectedlinenum','dialstatus','request','uniqueid','[%s][dials][newexten]','application','appdata','toLowerCase','set','startsWith','split','error','varset','isNil','variable','outboundrouteid','info','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','debug','[%s][dials][dialbegin]','assign','starttime','now','dialend','[%s][dials][dialend]','ANSWER','answertime','lastevent','connect','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','billableseconds','lodash','util','./utils','format','dialstring','calleridnum'];(function(_0x279095,_0x15f37e){var _0x5a5cdb=function(_0x2909bd){while(--_0x2909bd){_0x279095['push'](_0x279095['shift']());}};_0x5a5cdb(++_0x15f37e);}(_0xa6fb,0x114));var _0xba6f=function(_0x55327d,_0x327787){_0x55327d=_0x55327d-0x0;var _0x2fbb3e=_0xa6fb[_0x55327d];return _0x2fbb3e;};'use strict';var _=require(_0xba6f('0x0'));var util=require(_0xba6f('0x1'));var utils=require(_0xba6f('0x2'));var dials={};function writeDB(_0x2008f8){utils['info'](util[_0xba6f('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x2008f8['uniqueid'],_0x2008f8['channel'],_0x2008f8[_0xba6f('0x4')],_0x2008f8[_0xba6f('0x5')],_0x2008f8[_0xba6f('0x6')],_0x2008f8[_0xba6f('0x7')]));utils[_0xba6f('0x8')]('CreateVoiceDialReport',_0x2008f8);delete dials[_0x2008f8[_0xba6f('0x9')]];}exports['newexten']=function(_0x67cfbc){try{utils['debug'](util[_0xba6f('0x3')](_0xba6f('0xa'),_0x67cfbc[_0xba6f('0x9')]),_0x67cfbc);utils['info'](util[_0xba6f('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x67cfbc[_0xba6f('0x9')],_0x67cfbc[_0xba6f('0xb')],_0x67cfbc[_0xba6f('0xc')]));if(_0x67cfbc[_0xba6f('0xb')][_0xba6f('0xd')]()==_0xba6f('0xe')&&_[_0xba6f('0xf')](_0x67cfbc['appdata'][_0xba6f('0xd')](),'cdr(routeid)')){var _0x59d8e4=_0x67cfbc['appdata'][_0xba6f('0x10')]('=');dials[_0x67cfbc['uniqueid']]={'routeId':_0x59d8e4[0x1]};}}catch(_0x5051fd){utils[_0xba6f('0x11')](util[_0xba6f('0x3')](_0xba6f('0xa'),_0x67cfbc[_0xba6f('0x9')]),_0x5051fd);}};exports[_0xba6f('0x12')]=function(_0x171aee){try{utils['debug'](util[_0xba6f('0x3')]('[%s][dials][varset]',_0x171aee[_0xba6f('0x9')]),_0x171aee);if(!_[_0xba6f('0x13')](_0x171aee[_0xba6f('0x14')][_0xba6f('0x15')])){utils[_0xba6f('0x16')](util[_0xba6f('0x3')](_0xba6f('0x17'),_0x171aee[_0xba6f('0x9')],_0x171aee[_0xba6f('0x18')]));dials[_0x171aee[_0xba6f('0x9')]]={'routeId':_0x171aee[_0xba6f('0x18')]};}}catch(_0x3ef1e6){utils['error'](util[_0xba6f('0x3')]('[%s][dials][varset]',_0x171aee[_0xba6f('0x9')]),_0x3ef1e6);}};exports[_0xba6f('0x19')]=function(_0x24b93c){try{if(!_[_0xba6f('0x13')](dials[_0x24b93c[_0xba6f('0x9')]])){utils[_0xba6f('0x1a')](util[_0xba6f('0x3')](_0xba6f('0x1b'),_0x24b93c['uniqueid']),_0x24b93c);dials[_0x24b93c[_0xba6f('0x9')]]=_[_0xba6f('0x1c')](dials[_0x24b93c[_0xba6f('0x9')]],_0x24b93c);dials[_0x24b93c[_0xba6f('0x9')]][_0xba6f('0x1d')]=utils[_0xba6f('0x1e')]();dials[_0x24b93c[_0xba6f('0x9')]]['lastevent']='called';utils[_0xba6f('0x16')](util[_0xba6f('0x3')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x24b93c[_0xba6f('0x9')],dials[_0x24b93c[_0xba6f('0x9')]][_0xba6f('0x1d')]));}}catch(_0x3e926f){utils['error'](util['format']('[%s][dials][dialbegin]',_0x24b93c['uniqueid']),_0x3e926f);}};exports[_0xba6f('0x1f')]=function(_0x188eac){try{if(!_[_0xba6f('0x13')](dials[_0x188eac['uniqueid']])){utils[_0xba6f('0x1a')](util['format'](_0xba6f('0x20'),_0x188eac[_0xba6f('0x9')]),_0x188eac);dials[_0x188eac[_0xba6f('0x9')]][_0xba6f('0x7')]=_0x188eac['dialstatus'];if(_0x188eac[_0xba6f('0x7')]==_0xba6f('0x21')){dials[_0x188eac[_0xba6f('0x9')]]=_[_0xba6f('0x1c')](dials[_0x188eac[_0xba6f('0x9')]],_0x188eac);dials[_0x188eac[_0xba6f('0x9')]][_0xba6f('0x22')]=utils[_0xba6f('0x1e')]();dials[_0x188eac['uniqueid']][_0xba6f('0x23')]=_0xba6f('0x24');utils[_0xba6f('0x16')](util[_0xba6f('0x3')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x188eac[_0xba6f('0x9')],_0x188eac[_0xba6f('0x7')],dials[_0x188eac[_0xba6f('0x9')]]['answertime']));}else{utils['info'](util[_0xba6f('0x3')]('[%s][dials][dialend]\x20dialstatus:%s',_0x188eac[_0xba6f('0x9')],_0x188eac['dialstatus']));}}}catch(_0x44b5eb){utils[_0xba6f('0x11')](util['format'](_0xba6f('0x20'),_0x188eac[_0xba6f('0x9')]),_0x44b5eb);}};exports[_0xba6f('0x25')]=function(_0x3e8ce1){try{if(!_[_0xba6f('0x13')](dials[_0x3e8ce1[_0xba6f('0x9')]])){utils[_0xba6f('0x1a')](util[_0xba6f('0x3')](_0xba6f('0x26'),_0x3e8ce1[_0xba6f('0x9')]),_0x3e8ce1);utils['info'](util[_0xba6f('0x3')](_0xba6f('0x27'),_0x3e8ce1[_0xba6f('0x9')],_0x3e8ce1[_0xba6f('0x5')],_0x3e8ce1[_0xba6f('0x28')],_0x3e8ce1[_0xba6f('0x29')]));dials[_0x3e8ce1[_0xba6f('0x9')]]=_['assign'](dials[_0x3e8ce1[_0xba6f('0x9')]],{'endtime':utils[_0xba6f('0x1e')](),'lastevent':_0xba6f('0x2a')});dials[_0x3e8ce1[_0xba6f('0x9')]][_0xba6f('0x2b')]=utils[_0xba6f('0x2c')](dials[_0x3e8ce1[_0xba6f('0x9')]][_0xba6f('0x2d')],dials[_0x3e8ce1[_0xba6f('0x9')]][_0xba6f('0x1d')]);dials[_0x3e8ce1[_0xba6f('0x9')]]['holdtime']=utils[_0xba6f('0x2c')](dials[_0x3e8ce1[_0xba6f('0x9')]][_0xba6f('0x22')]||dials[_0x3e8ce1[_0xba6f('0x9')]][_0xba6f('0x2d')],dials[_0x3e8ce1[_0xba6f('0x9')]][_0xba6f('0x1d')]);dials[_0x3e8ce1['uniqueid']][_0xba6f('0x2e')]=dials[_0x3e8ce1['uniqueid']][_0xba6f('0x22')]?utils[_0xba6f('0x2c')](dials[_0x3e8ce1['uniqueid']][_0xba6f('0x2d')],dials[_0x3e8ce1[_0xba6f('0x9')]][_0xba6f('0x22')]):0x0;writeDB(dials[_0x3e8ce1[_0xba6f('0x9')]]);}}catch(_0x44e640){utils[_0xba6f('0x11')](util[_0xba6f('0x3')](_0xba6f('0x26'),_0x3e8ce1[_0xba6f('0x9')]),_0x44e640);}};
\ No newline at end of file
+var _0x8b16=['[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','diffTime','holdtime','endtime','billableseconds','lodash','util','./utils','info','format','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','[%s][dials][newexten]','varset','[%s][dials][varset]','variable','outboundrouteid','value','error','isNil','[%s][dials][dialbegin]','assign','starttime','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','answertime','now','connect'];(function(_0x21b99d,_0x46fbc9){var _0x31335a=function(_0x3985a8){while(--_0x3985a8){_0x21b99d['push'](_0x21b99d['shift']());}};_0x31335a(++_0x46fbc9);}(_0x8b16,0x1e1));var _0x68b1=function(_0x4944f1,_0x482a52){_0x4944f1=_0x4944f1-0x0;var _0x433494=_0x8b16[_0x4944f1];return _0x433494;};'use strict';var _=require(_0x68b1('0x0'));var util=require(_0x68b1('0x1'));var utils=require(_0x68b1('0x2'));var dials={};function writeDB(_0x2f3911){utils[_0x68b1('0x3')](util[_0x68b1('0x4')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x2f3911[_0x68b1('0x5')],_0x2f3911[_0x68b1('0x6')],_0x2f3911[_0x68b1('0x7')],_0x2f3911[_0x68b1('0x8')],_0x2f3911[_0x68b1('0x9')],_0x2f3911[_0x68b1('0xa')]));utils['request'](_0x68b1('0xb'),_0x2f3911);delete dials[_0x2f3911[_0x68b1('0x5')]];}exports[_0x68b1('0xc')]=function(_0x275915){try{utils[_0x68b1('0xd')](util[_0x68b1('0x4')]('[%s][dials][newexten]',_0x275915[_0x68b1('0x5')]),_0x275915);utils[_0x68b1('0x3')](util[_0x68b1('0x4')](_0x68b1('0xe'),_0x275915[_0x68b1('0x5')],_0x275915[_0x68b1('0xf')],_0x275915[_0x68b1('0x10')]));if(_0x275915[_0x68b1('0xf')][_0x68b1('0x11')]()==_0x68b1('0x12')&&_[_0x68b1('0x13')](_0x275915[_0x68b1('0x10')]['toLowerCase'](),_0x68b1('0x14'))){var _0x13abe5=_0x275915['appdata']['split']('=');dials[_0x275915['uniqueid']]={'routeId':_0x13abe5[0x1]};}}catch(_0x389ac2){utils['error'](util['format'](_0x68b1('0x15'),_0x275915[_0x68b1('0x5')]),_0x389ac2);}};exports[_0x68b1('0x16')]=function(_0x3dc407){try{utils[_0x68b1('0xd')](util[_0x68b1('0x4')](_0x68b1('0x17'),_0x3dc407[_0x68b1('0x5')]),_0x3dc407);if(!_['isNil'](_0x3dc407[_0x68b1('0x18')][_0x68b1('0x19')])){utils[_0x68b1('0x3')](util[_0x68b1('0x4')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x3dc407[_0x68b1('0x5')],_0x3dc407[_0x68b1('0x1a')]));dials[_0x3dc407[_0x68b1('0x5')]]={'routeId':_0x3dc407[_0x68b1('0x1a')]};}}catch(_0x186151){utils[_0x68b1('0x1b')](util[_0x68b1('0x4')](_0x68b1('0x17'),_0x3dc407[_0x68b1('0x5')]),_0x186151);}};exports['dialbegin']=function(_0x7edb3a){try{if(!_[_0x68b1('0x1c')](dials[_0x7edb3a[_0x68b1('0x5')]])){utils[_0x68b1('0xd')](util[_0x68b1('0x4')](_0x68b1('0x1d'),_0x7edb3a[_0x68b1('0x5')]),_0x7edb3a);dials[_0x7edb3a['uniqueid']]=_[_0x68b1('0x1e')](dials[_0x7edb3a['uniqueid']],_0x7edb3a);dials[_0x7edb3a['uniqueid']][_0x68b1('0x1f')]=utils['now']();dials[_0x7edb3a[_0x68b1('0x5')]][_0x68b1('0x20')]=_0x68b1('0x21');utils[_0x68b1('0x3')](util[_0x68b1('0x4')](_0x68b1('0x22'),_0x7edb3a['uniqueid'],dials[_0x7edb3a[_0x68b1('0x5')]]['starttime']));}}catch(_0x25e7fa){utils[_0x68b1('0x1b')](util[_0x68b1('0x4')](_0x68b1('0x1d'),_0x7edb3a[_0x68b1('0x5')]),_0x25e7fa);}};exports[_0x68b1('0x23')]=function(_0x5ae95c){try{if(!_['isNil'](dials[_0x5ae95c[_0x68b1('0x5')]])){utils[_0x68b1('0xd')](util[_0x68b1('0x4')]('[%s][dials][dialend]',_0x5ae95c[_0x68b1('0x5')]),_0x5ae95c);dials[_0x5ae95c['uniqueid']][_0x68b1('0xa')]=_0x5ae95c[_0x68b1('0xa')];if(_0x5ae95c[_0x68b1('0xa')]=='ANSWER'){dials[_0x5ae95c[_0x68b1('0x5')]]=_[_0x68b1('0x1e')](dials[_0x5ae95c[_0x68b1('0x5')]],_0x5ae95c);dials[_0x5ae95c[_0x68b1('0x5')]][_0x68b1('0x24')]=utils[_0x68b1('0x25')]();dials[_0x5ae95c[_0x68b1('0x5')]]['lastevent']=_0x68b1('0x26');utils[_0x68b1('0x3')](util[_0x68b1('0x4')](_0x68b1('0x27'),_0x5ae95c[_0x68b1('0x5')],_0x5ae95c[_0x68b1('0xa')],dials[_0x5ae95c[_0x68b1('0x5')]][_0x68b1('0x24')]));}else{utils[_0x68b1('0x3')](util[_0x68b1('0x4')](_0x68b1('0x28'),_0x5ae95c['uniqueid'],_0x5ae95c[_0x68b1('0xa')]));}}}catch(_0x11ff82){utils[_0x68b1('0x1b')](util['format'](_0x68b1('0x29'),_0x5ae95c[_0x68b1('0x5')]),_0x11ff82);}};exports[_0x68b1('0x2a')]=function(_0x34f27b){try{if(!_['isNil'](dials[_0x34f27b[_0x68b1('0x5')]])){utils[_0x68b1('0xd')](util[_0x68b1('0x4')](_0x68b1('0x2b'),_0x34f27b[_0x68b1('0x5')]),_0x34f27b);utils[_0x68b1('0x3')](util[_0x68b1('0x4')](_0x68b1('0x2c'),_0x34f27b[_0x68b1('0x5')],_0x34f27b[_0x68b1('0x8')],_0x34f27b[_0x68b1('0x2d')],_0x34f27b[_0x68b1('0x2e')]));dials[_0x34f27b['uniqueid']]=_['assign'](dials[_0x34f27b[_0x68b1('0x5')]],{'endtime':utils['now'](),'lastevent':_0x68b1('0x2f')});dials[_0x34f27b[_0x68b1('0x5')]]['duration']=utils[_0x68b1('0x30')](dials[_0x34f27b[_0x68b1('0x5')]]['endtime'],dials[_0x34f27b[_0x68b1('0x5')]][_0x68b1('0x1f')]);dials[_0x34f27b['uniqueid']][_0x68b1('0x31')]=utils[_0x68b1('0x30')](dials[_0x34f27b['uniqueid']][_0x68b1('0x24')]||dials[_0x34f27b['uniqueid']][_0x68b1('0x32')],dials[_0x34f27b[_0x68b1('0x5')]][_0x68b1('0x1f')]);dials[_0x34f27b[_0x68b1('0x5')]][_0x68b1('0x33')]=dials[_0x34f27b[_0x68b1('0x5')]][_0x68b1('0x24')]?utils[_0x68b1('0x30')](dials[_0x34f27b['uniqueid']][_0x68b1('0x32')],dials[_0x34f27b[_0x68b1('0x5')]][_0x68b1('0x24')]):0x0;writeDB(dials[_0x34f27b[_0x68b1('0x5')]]);}}catch(_0x4367a1){utils['error'](util[_0x68b1('0x4')](_0x68b1('0x2b'),_0x34f27b['uniqueid']),_0x4367a1);}};
\ No newline at end of file
index 0ce43dc..75e2b0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f02=['disabled','env','local','asterisk','port','username','XDR\x20DISABLED','info','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./queues.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','devicestatechange','format','device','debug','[%s][index][agentcalled]','uniqueid','agentcalled','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','xdr'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6f02,0x1d1));var _0x26f0=function(_0x108991,_0x4f2a26){_0x108991=_0x108991-0x0;var _0x305a78=_0x6f02[_0x108991];return _0x305a78;};var AsteriskManager=require(_0x26f0('0x0'));var config=require(_0x26f0('0x1'));var utils=require('./utils');var util=require(_0x26f0('0x2'));var isXDREnabled=config['xdr']&&config[_0x26f0('0x3')]['disabled']?!config[_0x26f0('0x3')][_0x26f0('0x4')]:!![];var isProduction=config[_0x26f0('0x5')]==='production'||![];var isLocalAsterisk=config[_0x26f0('0x3')]&&config['xdr'][_0x26f0('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0x26f0('0x7')][_0x26f0('0x8')],config['asterisk']['ip'],config[_0x26f0('0x7')][_0x26f0('0x9')],config[_0x26f0('0x7')]['password'],!![]);ami['keepConnected']();if(!isXDREnabled){utils['info'](_0x26f0('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x26f0('0xb')](_0x26f0('0xc'));}else{var agents=require('./agents.controller');var calls=require(_0x26f0('0xd'));var queues=require(_0x26f0('0xe'));var recordings=require('./recordings.controller');var members=require(_0x26f0('0xf'));var dials=require('./dials.controller');var transfers=require(_0x26f0('0x10'));var core=require(_0x26f0('0x11'));ami['on'](_0x26f0('0x12'),core[_0x26f0('0x12')]);ami['on'](_0x26f0('0x13'),core['shutdown']);ami['on'](_0x26f0('0x14'),core[_0x26f0('0x14')]);ami['on']('error',core[_0x26f0('0x15')]);ami['on'](_0x26f0('0x16'),core['close']);ami['on']('managerevent',core['managerevent']);ami['on'](_0x26f0('0x17'),function(_0x4fdee0){try{utils['debug'](util[_0x26f0('0x18')]('[%s][index][devicestatechange]',_0x4fdee0[_0x26f0('0x19')]),_0x4fdee0);members[_0x26f0('0x17')](_0x4fdee0);}catch(_0x197e84){utils[_0x26f0('0x15')](util[_0x26f0('0x18')]('[%s][index][devicestatechange]',_0x4fdee0['device']),_0x197e84);}});ami['on']('agentcalled',function(_0x31b8cf){try{utils[_0x26f0('0x1a')](util[_0x26f0('0x18')](_0x26f0('0x1b'),_0x31b8cf[_0x26f0('0x1c')]),_0x31b8cf);agents[_0x26f0('0x1d')](_0x31b8cf);}catch(_0x47d400){utils['error'](util[_0x26f0('0x18')]('[%s][index][agentcalled]',_0x31b8cf['uniqueid']),_0x47d400);}});ami['on']('agentringnoanswer',function(_0x36dbde){try{utils['debug'](util[_0x26f0('0x18')](_0x26f0('0x1e'),_0x36dbde['uniqueid']),_0x36dbde);agents[_0x26f0('0x1f')](_0x36dbde);}catch(_0x265344){utils[_0x26f0('0x15')](util['format']('[%s][index][agentringnoanswer]',_0x36dbde[_0x26f0('0x1c')]),_0x265344);}});ami['on'](_0x26f0('0x20'),function(_0x2f8c7e){try{utils['debug'](util[_0x26f0('0x18')](_0x26f0('0x21'),_0x2f8c7e[_0x26f0('0x1c')]),_0x2f8c7e);agents[_0x26f0('0x20')](_0x2f8c7e);queues['agentconnect'](_0x2f8c7e);}catch(_0x5e0d32){utils['error'](util[_0x26f0('0x18')](_0x26f0('0x21'),_0x2f8c7e['uniqueid']),_0x5e0d32);}});ami['on'](_0x26f0('0x22'),function(_0x3a2bd8){try{utils[_0x26f0('0x1a')](util[_0x26f0('0x18')](_0x26f0('0x23'),_0x3a2bd8[_0x26f0('0x1c')]),_0x3a2bd8);agents[_0x26f0('0x22')](_0x3a2bd8);queues[_0x26f0('0x22')](_0x3a2bd8);members[_0x26f0('0x22')](_0x3a2bd8);}catch(_0xd93043){utils[_0x26f0('0x15')](util[_0x26f0('0x18')]('[%s][index][agentcomplete]',_0x3a2bd8[_0x26f0('0x1c')]),_0xd93043);}});ami['on']('queuecallerabandon',function(_0x4326c7){try{utils['debug'](util['format']('[%s][index][queuecallerabandon]',_0x4326c7[_0x26f0('0x1c')]),_0x4326c7);agents[_0x26f0('0x24')](_0x4326c7);queues[_0x26f0('0x24')](_0x4326c7);}catch(_0x592531){utils[_0x26f0('0x15')](util[_0x26f0('0x18')]('[%s][index][queuecallerabandon]',_0x4326c7['uniqueid']),_0x592531);}});ami['on'](_0x26f0('0x25'),function(_0x333f12){try{utils[_0x26f0('0x1a')](util['format'](_0x26f0('0x26'),_0x333f12[_0x26f0('0x1c')]),_0x333f12);queues[_0x26f0('0x25')](_0x333f12);recordings[_0x26f0('0x25')](_0x333f12);}catch(_0xcd126){utils[_0x26f0('0x15')](util[_0x26f0('0x18')](_0x26f0('0x26'),_0x333f12['uniqueid']),_0xcd126);}});ami['on'](_0x26f0('0x27'),function(_0x4389b9){try{utils['debug'](util[_0x26f0('0x18')](_0x26f0('0x28'),_0x4389b9[_0x26f0('0x1c')]),_0x4389b9);queues['queuecallerleave'](_0x4389b9);}catch(_0x3f95ae){utils['error'](util['format'](_0x26f0('0x28'),_0x4389b9['uniqueid']),_0x3f95ae);}});ami['on'](_0x26f0('0x29'),function(_0xcedbd3){try{utils[_0x26f0('0x1a')](util[_0x26f0('0x18')]('[%s][index][musiconholdstart]',_0xcedbd3['uniqueid']),_0xcedbd3);queues[_0x26f0('0x29')](_0xcedbd3);calls[_0x26f0('0x29')](_0xcedbd3);}catch(_0x4b4ba5){utils[_0x26f0('0x15')](util[_0x26f0('0x18')](_0x26f0('0x2a'),_0xcedbd3['uniqueid']),_0x4b4ba5);}});ami['on'](_0x26f0('0x2b'),function(_0x22e358){try{utils[_0x26f0('0x1a')](util['format'](_0x26f0('0x2c'),_0x22e358['uniqueid']),_0x22e358);queues[_0x26f0('0x2b')](_0x22e358);calls[_0x26f0('0x2b')](_0x22e358);}catch(_0x16e92f){utils[_0x26f0('0x15')](util['format'](_0x26f0('0x2c'),_0x22e358[_0x26f0('0x1c')]),_0x16e92f);}});ami['on'](_0x26f0('0x2d'),function(_0x94b3ff){try{utils[_0x26f0('0x1a')](util['format']('[%s][index][newstate]',_0x94b3ff['uniqueid']),_0x94b3ff);calls[_0x26f0('0x2d')](_0x94b3ff);recordings[_0x26f0('0x2d')](_0x94b3ff);}catch(_0x33ca02){utils[_0x26f0('0x15')](util[_0x26f0('0x18')](_0x26f0('0x2e'),_0x94b3ff[_0x26f0('0x1c')]),_0x33ca02);}});ami['on'](_0x26f0('0x2f'),function(_0x61a491){try{utils[_0x26f0('0x1a')](util['format'](_0x26f0('0x30'),_0x61a491[_0x26f0('0x1c')]),_0x61a491);calls[_0x26f0('0x2f')](_0x61a491);recordings[_0x26f0('0x2f')](_0x61a491);dials['hangup'](_0x61a491);agents[_0x26f0('0x2f')](_0x61a491);queues[_0x26f0('0x2f')](_0x61a491);}catch(_0x736ae7){utils[_0x26f0('0x15')](util[_0x26f0('0x18')](_0x26f0('0x30'),_0x61a491['uniqueid']),_0x736ae7);}});ami['on']('cdr',function(_0xbd87b2){try{utils['debug'](util['format'](_0x26f0('0x31'),_0xbd87b2[_0x26f0('0x1c')]),_0xbd87b2);members[_0x26f0('0x32')](_0xbd87b2);}catch(_0x2141bc){utils[_0x26f0('0x15')](util[_0x26f0('0x18')](_0x26f0('0x31'),_0xbd87b2[_0x26f0('0x1c')]),_0x2141bc);}});ami['on'](_0x26f0('0x33'),function(_0x2e85cd){try{utils[_0x26f0('0x1a')](util[_0x26f0('0x18')](_0x26f0('0x34'),_0x2e85cd[_0x26f0('0x1c')]),_0x2e85cd);queues[_0x26f0('0x33')](_0x2e85cd);agents[_0x26f0('0x33')](_0x2e85cd);transfers[_0x26f0('0x33')](_0x2e85cd);recordings[_0x26f0('0x33')](_0x2e85cd);}catch(_0x1e6ed1){utils[_0x26f0('0x15')](util[_0x26f0('0x18')](_0x26f0('0x34'),_0x2e85cd[_0x26f0('0x1c')]),_0x1e6ed1);}});ami['on'](_0x26f0('0x35'),function(_0x517d86){try{utils[_0x26f0('0x1a')](util[_0x26f0('0x18')]('[%s][index][attendedtransfer]',_0x517d86[_0x26f0('0x36')]),_0x517d86);queues[_0x26f0('0x35')](_0x517d86);transfers[_0x26f0('0x35')](_0x517d86);agents[_0x26f0('0x35')](_0x517d86);calls[_0x26f0('0x35')](_0x517d86);}catch(_0x97a711){utils[_0x26f0('0x15')](util[_0x26f0('0x18')](_0x26f0('0x37'),_0x517d86[_0x26f0('0x36')]),_0x97a711);}});ami['on'](_0x26f0('0x38'),function(_0x395bf0){try{utils[_0x26f0('0x1a')](util[_0x26f0('0x18')](_0x26f0('0x39'),_0x395bf0[_0x26f0('0x1c')]),_0x395bf0);queues[_0x26f0('0x38')](_0x395bf0);recordings[_0x26f0('0x38')](_0x395bf0);calls[_0x26f0('0x38')](_0x395bf0);dials[_0x26f0('0x38')](_0x395bf0);}catch(_0x19f756){utils[_0x26f0('0x15')](util['format'](_0x26f0('0x39'),_0x395bf0[_0x26f0('0x1c')]),_0x19f756);}});ami['on']('newexten',function(_0x12005e){try{utils['debug'](util[_0x26f0('0x18')]('[%s][index][newexten]',_0x12005e[_0x26f0('0x1c')]),_0x12005e);calls[_0x26f0('0x3a')](_0x12005e);recordings[_0x26f0('0x3a')](_0x12005e);dials['newexten'](_0x12005e);}catch(_0x4ed507){utils[_0x26f0('0x15')](util['format'](_0x26f0('0x3b'),_0x12005e[_0x26f0('0x1c')]),_0x4ed507);}});ami['on'](_0x26f0('0x3c'),function(_0x30fecb){try{utils['debug'](util['format'](_0x26f0('0x3d'),_0x30fecb[_0x26f0('0x1c')]),_0x30fecb);calls[_0x26f0('0x3c')](_0x30fecb);recordings['newchannel'](_0x30fecb);}catch(_0x1213d9){utils['error'](util[_0x26f0('0x18')](_0x26f0('0x3d'),_0x30fecb[_0x26f0('0x1c')]),_0x1213d9);}});ami['on'](_0x26f0('0x3e'),function(_0x2d24f0){try{utils['debug'](util['format'](_0x26f0('0x3f'),_0x2d24f0[_0x26f0('0x1c')]),_0x2d24f0);dials[_0x26f0('0x3e')](_0x2d24f0);}catch(_0x488f1f){utils['error'](util[_0x26f0('0x18')](_0x26f0('0x40'),_0x2d24f0['uniqueid']),_0x488f1f);}});ami['on'](_0x26f0('0x41'),function(_0x2a15ea){try{utils[_0x26f0('0x1a')](util[_0x26f0('0x18')](_0x26f0('0x42'),_0x2a15ea[_0x26f0('0x1c')]),_0x2a15ea);dials['dialend'](_0x2a15ea);}catch(_0x2cfedc){utils[_0x26f0('0x15')](util[_0x26f0('0x18')](_0x26f0('0x42'),_0x2a15ea[_0x26f0('0x1c')]),_0x2cfedc);}});}
\ No newline at end of file
+var _0x116f=['keepConnected','XDR\x20DISABLED','info','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentringnoanswer','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','../../config/environment','./utils','xdr','disabled','production','local','asterisk','port','username'];(function(_0x1cc7ec,_0x22f84a){var _0x3dcd35=function(_0x14e547){while(--_0x14e547){_0x1cc7ec['push'](_0x1cc7ec['shift']());}};_0x3dcd35(++_0x22f84a);}(_0x116f,0x155));var _0xf116=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x116f[_0x20a584];return _0x4b41a8;};var AsteriskManager=require('asterisk-manager');var config=require(_0xf116('0x0'));var utils=require(_0xf116('0x1'));var util=require('util');var isXDREnabled=config['xdr']&&config[_0xf116('0x2')][_0xf116('0x3')]?!config[_0xf116('0x2')]['disabled']:!![];var isProduction=config['env']===_0xf116('0x4')||![];var isLocalAsterisk=config[_0xf116('0x2')]&&config[_0xf116('0x2')][_0xf116('0x5')]===!![]||![];var ami=new AsteriskManager(config[_0xf116('0x6')][_0xf116('0x7')],config['asterisk']['ip'],config[_0xf116('0x6')][_0xf116('0x8')],config[_0xf116('0x6')]['password'],!![]);ami[_0xf116('0x9')]();if(!isXDREnabled){utils['info'](_0xf116('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xf116('0xb')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0xf116('0xc'));var calls=require(_0xf116('0xd'));var queues=require(_0xf116('0xe'));var recordings=require(_0xf116('0xf'));var members=require(_0xf116('0x10'));var dials=require(_0xf116('0x11'));var transfers=require('./transfers.controller');var core=require(_0xf116('0x12'));ami['on'](_0xf116('0x13'),core[_0xf116('0x13')]);ami['on'](_0xf116('0x14'),core['shutdown']);ami['on'](_0xf116('0x15'),core[_0xf116('0x15')]);ami['on'](_0xf116('0x16'),core[_0xf116('0x16')]);ami['on']('close',core[_0xf116('0x17')]);ami['on'](_0xf116('0x18'),core[_0xf116('0x18')]);ami['on'](_0xf116('0x19'),function(_0x16f2b7){try{utils[_0xf116('0x1a')](util[_0xf116('0x1b')](_0xf116('0x1c'),_0x16f2b7['device']),_0x16f2b7);members['devicestatechange'](_0x16f2b7);}catch(_0x401d71){utils['error'](util[_0xf116('0x1b')](_0xf116('0x1c'),_0x16f2b7[_0xf116('0x1d')]),_0x401d71);}});ami['on'](_0xf116('0x1e'),function(_0x156bd7){try{utils[_0xf116('0x1a')](util[_0xf116('0x1b')](_0xf116('0x1f'),_0x156bd7[_0xf116('0x20')]),_0x156bd7);agents[_0xf116('0x1e')](_0x156bd7);}catch(_0x206cad){utils[_0xf116('0x16')](util[_0xf116('0x1b')](_0xf116('0x1f'),_0x156bd7[_0xf116('0x20')]),_0x206cad);}});ami['on']('agentringnoanswer',function(_0x48f1be){try{utils[_0xf116('0x1a')](util[_0xf116('0x1b')](_0xf116('0x21'),_0x48f1be[_0xf116('0x20')]),_0x48f1be);agents[_0xf116('0x22')](_0x48f1be);}catch(_0x5d4d70){utils[_0xf116('0x16')](util[_0xf116('0x1b')](_0xf116('0x21'),_0x48f1be['uniqueid']),_0x5d4d70);}});ami['on']('agentconnect',function(_0x2191f8){try{utils[_0xf116('0x1a')](util[_0xf116('0x1b')](_0xf116('0x23'),_0x2191f8['uniqueid']),_0x2191f8);agents[_0xf116('0x24')](_0x2191f8);queues[_0xf116('0x24')](_0x2191f8);}catch(_0x43d194){utils[_0xf116('0x16')](util[_0xf116('0x1b')]('[%s][index][agentconnect]',_0x2191f8['uniqueid']),_0x43d194);}});ami['on'](_0xf116('0x25'),function(_0x1a3e95){try{utils[_0xf116('0x1a')](util[_0xf116('0x1b')](_0xf116('0x26'),_0x1a3e95['uniqueid']),_0x1a3e95);agents['agentcomplete'](_0x1a3e95);queues[_0xf116('0x25')](_0x1a3e95);members[_0xf116('0x25')](_0x1a3e95);}catch(_0x217519){utils['error'](util[_0xf116('0x1b')](_0xf116('0x26'),_0x1a3e95[_0xf116('0x20')]),_0x217519);}});ami['on'](_0xf116('0x27'),function(_0x5accdd){try{utils[_0xf116('0x1a')](util[_0xf116('0x1b')](_0xf116('0x28'),_0x5accdd[_0xf116('0x20')]),_0x5accdd);agents['queuecallerabandon'](_0x5accdd);queues[_0xf116('0x27')](_0x5accdd);}catch(_0x18157a){utils['error'](util[_0xf116('0x1b')](_0xf116('0x28'),_0x5accdd[_0xf116('0x20')]),_0x18157a);}});ami['on'](_0xf116('0x29'),function(_0x23e2a1){try{utils[_0xf116('0x1a')](util[_0xf116('0x1b')](_0xf116('0x2a'),_0x23e2a1[_0xf116('0x20')]),_0x23e2a1);queues[_0xf116('0x29')](_0x23e2a1);recordings['queuecallerjoin'](_0x23e2a1);}catch(_0xbc51c8){utils['error'](util[_0xf116('0x1b')](_0xf116('0x2a'),_0x23e2a1[_0xf116('0x20')]),_0xbc51c8);}});ami['on']('queuecallerleave',function(_0x550332){try{utils[_0xf116('0x1a')](util['format'](_0xf116('0x2b'),_0x550332[_0xf116('0x20')]),_0x550332);queues[_0xf116('0x2c')](_0x550332);}catch(_0x1d78d8){utils[_0xf116('0x16')](util['format'](_0xf116('0x2b'),_0x550332['uniqueid']),_0x1d78d8);}});ami['on'](_0xf116('0x2d'),function(_0x1676c2){try{utils[_0xf116('0x1a')](util[_0xf116('0x1b')]('[%s][index][musiconholdstart]',_0x1676c2[_0xf116('0x20')]),_0x1676c2);queues[_0xf116('0x2d')](_0x1676c2);calls[_0xf116('0x2d')](_0x1676c2);}catch(_0x5a33d9){utils[_0xf116('0x16')](util['format'](_0xf116('0x2e'),_0x1676c2[_0xf116('0x20')]),_0x5a33d9);}});ami['on'](_0xf116('0x2f'),function(_0x1a3618){try{utils[_0xf116('0x1a')](util[_0xf116('0x1b')](_0xf116('0x30'),_0x1a3618['uniqueid']),_0x1a3618);queues['musiconholdstop'](_0x1a3618);calls[_0xf116('0x2f')](_0x1a3618);}catch(_0x567af9){utils[_0xf116('0x16')](util[_0xf116('0x1b')]('[%s][index][musiconholdstop]',_0x1a3618['uniqueid']),_0x567af9);}});ami['on'](_0xf116('0x31'),function(_0x3657a){try{utils[_0xf116('0x1a')](util[_0xf116('0x1b')](_0xf116('0x32'),_0x3657a['uniqueid']),_0x3657a);calls[_0xf116('0x31')](_0x3657a);recordings[_0xf116('0x31')](_0x3657a);}catch(_0x355e3e){utils[_0xf116('0x16')](util[_0xf116('0x1b')]('[%s][index][newstate]',_0x3657a[_0xf116('0x20')]),_0x355e3e);}});ami['on'](_0xf116('0x33'),function(_0x31d4a4){try{utils[_0xf116('0x1a')](util['format']('[%s][index][hangup]',_0x31d4a4[_0xf116('0x20')]),_0x31d4a4);calls[_0xf116('0x33')](_0x31d4a4);recordings[_0xf116('0x33')](_0x31d4a4);dials[_0xf116('0x33')](_0x31d4a4);agents[_0xf116('0x33')](_0x31d4a4);queues[_0xf116('0x33')](_0x31d4a4);}catch(_0x471e3a){utils[_0xf116('0x16')](util[_0xf116('0x1b')](_0xf116('0x34'),_0x31d4a4[_0xf116('0x20')]),_0x471e3a);}});ami['on'](_0xf116('0x35'),function(_0x5a3585){try{utils['debug'](util[_0xf116('0x1b')](_0xf116('0x36'),_0x5a3585[_0xf116('0x20')]),_0x5a3585);members[_0xf116('0x35')](_0x5a3585);}catch(_0x32750b){utils[_0xf116('0x16')](util[_0xf116('0x1b')]('[%s][index][cdr]',_0x5a3585[_0xf116('0x20')]),_0x32750b);}});ami['on'](_0xf116('0x37'),function(_0x3af7eb){try{utils['debug'](util['format'](_0xf116('0x38'),_0x3af7eb['uniqueid']),_0x3af7eb);queues[_0xf116('0x37')](_0x3af7eb);agents[_0xf116('0x37')](_0x3af7eb);transfers['blindtransfer'](_0x3af7eb);recordings[_0xf116('0x37')](_0x3af7eb);}catch(_0x29a86d){utils[_0xf116('0x16')](util['format'](_0xf116('0x38'),_0x3af7eb[_0xf116('0x20')]),_0x29a86d);}});ami['on'](_0xf116('0x39'),function(_0x9c20d3){try{utils[_0xf116('0x1a')](util[_0xf116('0x1b')]('[%s][index][attendedtransfer]',_0x9c20d3['origtransfereruniqueid']),_0x9c20d3);queues['attendedtransfer'](_0x9c20d3);transfers[_0xf116('0x39')](_0x9c20d3);agents[_0xf116('0x39')](_0x9c20d3);calls[_0xf116('0x39')](_0x9c20d3);}catch(_0x2ca86a){utils[_0xf116('0x16')](util['format'](_0xf116('0x3a'),_0x9c20d3[_0xf116('0x3b')]),_0x2ca86a);}});ami['on'](_0xf116('0x3c'),function(_0x373412){try{utils[_0xf116('0x1a')](util['format'](_0xf116('0x3d'),_0x373412['uniqueid']),_0x373412);queues[_0xf116('0x3c')](_0x373412);recordings[_0xf116('0x3c')](_0x373412);calls[_0xf116('0x3c')](_0x373412);dials[_0xf116('0x3c')](_0x373412);}catch(_0xc3b7fd){utils[_0xf116('0x16')](util['format'](_0xf116('0x3d'),_0x373412['uniqueid']),_0xc3b7fd);}});ami['on'](_0xf116('0x3e'),function(_0x74d43f){try{utils['debug'](util[_0xf116('0x1b')](_0xf116('0x3f'),_0x74d43f[_0xf116('0x20')]),_0x74d43f);calls[_0xf116('0x3e')](_0x74d43f);recordings['newexten'](_0x74d43f);dials['newexten'](_0x74d43f);}catch(_0x5353ed){utils[_0xf116('0x16')](util[_0xf116('0x1b')](_0xf116('0x3f'),_0x74d43f[_0xf116('0x20')]),_0x5353ed);}});ami['on'](_0xf116('0x40'),function(_0x5ca687){try{utils[_0xf116('0x1a')](util[_0xf116('0x1b')]('[%s][index][newchannel]',_0x5ca687['uniqueid']),_0x5ca687);calls[_0xf116('0x40')](_0x5ca687);recordings['newchannel'](_0x5ca687);}catch(_0x356212){utils[_0xf116('0x16')](util['format'](_0xf116('0x41'),_0x5ca687[_0xf116('0x20')]),_0x356212);}});ami['on'](_0xf116('0x42'),function(_0x44fb41){try{utils[_0xf116('0x1a')](util['format'](_0xf116('0x43'),_0x44fb41['uniqueid']),_0x44fb41);dials[_0xf116('0x42')](_0x44fb41);}catch(_0x44d656){utils[_0xf116('0x16')](util[_0xf116('0x1b')]('[%s]dialbegin',_0x44fb41['uniqueid']),_0x44d656);}});ami['on'](_0xf116('0x44'),function(_0x5ee27f){try{utils['debug'](util[_0xf116('0x1b')](_0xf116('0x45'),_0x5ee27f[_0xf116('0x20')]),_0x5ee27f);dials[_0xf116('0x44')](_0x5ee27f);}catch(_0x521b19){utils[_0xf116('0x16')](util[_0xf116('0x1b')]('[%s][index][dialend]',_0x5ee27f[_0xf116('0x20')]),_0x521b19);}});}
\ No newline at end of file
index fd4990a..f8b4f47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd261=['device','uniqueid','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','voice','TALKING','now','agent','NOT_INUSE','diffTime','exitAt','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','[%s][members][cdr]','channel','isNil','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','./utils','Local/_attended@transfer','info','format','interface','data2','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','error','[%s][members][writeDB]','some','devicestatechange','debug','[%s][members][devicestatechange]'];(function(_0x4baa11,_0x7c6290){var _0x219273=function(_0x4a3887){while(--_0x4a3887){_0x4baa11['push'](_0x4baa11['shift']());}};_0x219273(++_0x7c6290);}(_0xd261,0x86));var _0x1d26=function(_0x47fdfb,_0x273baf){_0x47fdfb=_0x47fdfb-0x0;var _0x38f3ee=_0xd261[_0x47fdfb];return _0x38f3ee;};'use strict';var _=require(_0x1d26('0x0'));var util=require(_0x1d26('0x1'));var utils=require(_0x1d26('0x2'));var members={};var exclude=[_0x1d26('0x3'),'Queue:'];function writeDB(_0x5997eb){utils[_0x1d26('0x4')](util[_0x1d26('0x5')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x5997eb['uniqueid'],_0x5997eb[_0x1d26('0x6')],_0x5997eb['channel'],_0x5997eb[_0x1d26('0x7')],_0x5997eb[_0x1d26('0x8')],_0x5997eb[_0x1d26('0x9')]));if(_0x5997eb[_0x1d26('0x6')]){utils[_0x1d26('0xa')](_0x5997eb[_0x1d26('0x6')])[_0x1d26('0xb')](function(_0x1f7b4c){if(_0x1f7b4c){_0x5997eb[_0x1d26('0x8')]=_0x1f7b4c[_0x1d26('0xc')];_0x5997eb[_0x1d26('0xd')]=_0x1f7b4c[_0x1d26('0xd')];utils[_0x1d26('0xe')](_0x1d26('0xf'),_0x5997eb);}else{utils[_0x1d26('0x10')](_0x5997eb['interface'][_0x1d26('0x11')]('/')[0x1])[_0x1d26('0xb')](function(_0x3d6db0){if(_0x3d6db0){_0x5997eb[_0x1d26('0x8')]=_0x3d6db0[_0x1d26('0xc')];_0x5997eb[_0x1d26('0xd')]=_0x3d6db0[_0x1d26('0xd')];utils['request'](_0x1d26('0xf'),_0x5997eb);}});}})[_0x1d26('0x12')](function(_0x4f02db){utils[_0x1d26('0x13')](util[_0x1d26('0x5')](_0x1d26('0x14'),_0x5997eb['uniqueid']),_0x4f02db);});}delete members[_0x5997eb['interface']];}function startsWith(_0x23f485,_0x3a3311){return _[_0x1d26('0x15')](_0x23f485,function(_0xab9038){return _['startsWith'](_0x3a3311,_0xab9038);});}exports[_0x1d26('0x16')]=function(_0x10522e){try{utils[_0x1d26('0x17')](util[_0x1d26('0x5')](_0x1d26('0x18'),members[_0x10522e['device']]?members[_0x10522e[_0x1d26('0x19')]][_0x1d26('0x1a')]:_0x10522e['device']),_0x10522e);utils[_0x1d26('0x4')](util[_0x1d26('0x5')](_0x1d26('0x1b'),members[_0x10522e[_0x1d26('0x19')]]?members[_0x10522e[_0x1d26('0x19')]][_0x1d26('0x1a')]:_0x10522e[_0x1d26('0x19')],_0x10522e[_0x1d26('0x1c')],_0x10522e[_0x1d26('0x19')]));switch(_0x10522e[_0x1d26('0x1c')]){case'INUSE':case _0x1d26('0x1d'):if(!startsWith(exclude,_0x10522e[_0x1d26('0x19')])){members[_0x10522e[_0x1d26('0x19')]]={'channel':_0x1d26('0x1e'),'interface':_0x10522e[_0x1d26('0x19')],'type':_0x1d26('0x1f'),'enterAt':utils[_0x1d26('0x20')](),'role':_0x1d26('0x21')};}break;case _0x1d26('0x22'):if(!_['isNil'](members[_0x10522e['device']])){members[_0x10522e[_0x1d26('0x19')]]['exitAt']=utils[_0x1d26('0x20')]();members[_0x10522e[_0x1d26('0x19')]]['duration']=utils[_0x1d26('0x23')](members[_0x10522e[_0x1d26('0x19')]][_0x1d26('0x24')],members[_0x10522e['device']][_0x1d26('0x25')]);if(members[_0x10522e[_0x1d26('0x19')]][_0x1d26('0x1a')]){writeDB(members[_0x10522e[_0x1d26('0x19')]]);}}break;default:break;}}catch(_0x43e2af){utils[_0x1d26('0x13')](util[_0x1d26('0x5')](_0x1d26('0x18'),members[_0x10522e['device']]?members[_0x10522e[_0x1d26('0x19')]][_0x1d26('0x1a')]:_0x10522e[_0x1d26('0x19')]),_0x43e2af);}};exports[_0x1d26('0x26')]=function(_0x2429da){try{if(!_['isNil'](members[_0x2429da[_0x1d26('0x6')]])){utils[_0x1d26('0x17')](util[_0x1d26('0x5')](_0x1d26('0x27'),_0x2429da[_0x1d26('0x1a')]),_0x2429da);utils[_0x1d26('0x4')](util[_0x1d26('0x5')](_0x1d26('0x28'),_0x2429da[_0x1d26('0x1a')],_0x2429da[_0x1d26('0x6')],_0x2429da['queue']));members[_0x2429da[_0x1d26('0x6')]]=_[_0x1d26('0x29')](members[_0x2429da[_0x1d26('0x6')]],{'data4':_0x2429da[_0x1d26('0x2a')],'uniqueid':_0x2429da['uniqueid']});}}catch(_0x50122e){utils[_0x1d26('0x13')](util['format'](_0x1d26('0x27'),_0x2429da[_0x1d26('0x1a')]),_0x50122e);}};exports[_0x1d26('0x2b')]=function(_0x2c374f){try{utils[_0x1d26('0x17')](util[_0x1d26('0x5')](_0x1d26('0x2c'),_0x2c374f[_0x1d26('0x1a')]),_0x2c374f);if(_0x2c374f[_0x1d26('0x2d')]){var _0x22c726=_0x2c374f['channel']['split']('-')[0x0];if(!_[_0x1d26('0x2e')](members[_0x22c726])){members[_0x22c726]=_[_0x1d26('0x29')](members[_0x22c726],{'data1':members[_0x22c726][_0x1d26('0x2f')]||_0x2c374f[_0x1d26('0x9')],'data2':members[_0x22c726][_0x1d26('0x7')]||_0x2c374f[_0x1d26('0x30')],'data3':members[_0x22c726][_0x1d26('0x31')]||_0x2c374f[_0x1d26('0x32')],'uniqueid':members[_0x22c726][_0x1d26('0x1a')]||_0x2c374f[_0x1d26('0x1a')]});utils[_0x1d26('0x4')](util[_0x1d26('0x5')](_0x1d26('0x33'),_0x2c374f[_0x1d26('0x1a')],members[_0x22c726][_0x1d26('0x2f')],members[_0x22c726][_0x1d26('0x7')],members[_0x22c726][_0x1d26('0x31')]));if(members[_0x22c726][_0x1d26('0x24')]){writeDB(members[_0x22c726]);}}}if(_0x2c374f['destinationchannel']){var _0xffc799=_0x2c374f[_0x1d26('0x34')][_0x1d26('0x11')]('-')[0x0];if(!_['isNil'](members[_0xffc799])){members[_0xffc799]=_[_0x1d26('0x29')](members[_0xffc799],{'data1':members[_0xffc799][_0x1d26('0x2f')]||_0x2c374f['type'],'data2':members[_0xffc799][_0x1d26('0x7')]||_0x2c374f[_0x1d26('0x30')],'data3':members[_0xffc799]['data3']||_0x2c374f[_0x1d26('0x32')],'uniqueid':members[_0xffc799][_0x1d26('0x1a')]||_0x2c374f[_0x1d26('0x1a')]});utils[_0x1d26('0x4')](util[_0x1d26('0x5')](_0x1d26('0x33'),_0x2c374f[_0x1d26('0x1a')],members[_0xffc799][_0x1d26('0x2f')],members[_0xffc799][_0x1d26('0x7')],members[_0xffc799]['data3']));if(members[_0xffc799]['exitAt']){writeDB(members[_0xffc799]);}}}}catch(_0x37f57f){utils[_0x1d26('0x13')](util[_0x1d26('0x5')]('[%s][members][cdr]',_0x2c374f[_0x1d26('0x1a')]),_0x37f57f);}};
\ No newline at end of file
+var _0x9f94=['data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','split','data1','[%s][members][cdr]','lodash','util','./utils','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','data2','membername','type','interface','getUserByInterface','then','name','internal','request','CreateMemberReport','catch','some','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','INUSE','voice','TALKING','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','error','agentcomplete','queue','assign','[%s][members][agentcomplete]','cdr','source'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x9f94,0x1e7));var _0x49f9=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x9f94[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x49f9('0x0'));var util=require(_0x49f9('0x1'));var utils=require(_0x49f9('0x2'));var members={};var exclude=['Local/_attended@transfer','Queue:'];function writeDB(_0x342097){utils[_0x49f9('0x3')](util[_0x49f9('0x4')](_0x49f9('0x5'),_0x342097[_0x49f9('0x6')],_0x342097['interface'],_0x342097[_0x49f9('0x7')],_0x342097[_0x49f9('0x8')],_0x342097[_0x49f9('0x9')],_0x342097[_0x49f9('0xa')]));if(_0x342097[_0x49f9('0xb')]){utils[_0x49f9('0xc')](_0x342097[_0x49f9('0xb')])[_0x49f9('0xd')](function(_0x53b262){if(_0x53b262){_0x342097['membername']=_0x53b262[_0x49f9('0xe')];_0x342097['internal']=_0x53b262[_0x49f9('0xf')];utils[_0x49f9('0x10')](_0x49f9('0x11'),_0x342097);}else{utils['getUserByName'](_0x342097[_0x49f9('0xb')]['split']('/')[0x1])[_0x49f9('0xd')](function(_0x164eb8){if(_0x164eb8){_0x342097[_0x49f9('0x9')]=_0x164eb8[_0x49f9('0xe')];_0x342097['internal']=_0x164eb8['internal'];utils[_0x49f9('0x10')](_0x49f9('0x11'),_0x342097);}});}})[_0x49f9('0x12')](function(_0x34df7a){utils['error'](util['format']('[%s][members][writeDB]',_0x342097[_0x49f9('0x6')]),_0x34df7a);});}delete members[_0x342097['interface']];}function startsWith(_0x204951,_0x4b8228){return _[_0x49f9('0x13')](_0x204951,function(_0x760ac){return _['startsWith'](_0x4b8228,_0x760ac);});}exports[_0x49f9('0x14')]=function(_0x1a2026){try{utils[_0x49f9('0x15')](util[_0x49f9('0x4')](_0x49f9('0x16'),members[_0x1a2026[_0x49f9('0x17')]]?members[_0x1a2026[_0x49f9('0x17')]][_0x49f9('0x6')]:_0x1a2026[_0x49f9('0x17')]),_0x1a2026);utils[_0x49f9('0x3')](util[_0x49f9('0x4')](_0x49f9('0x18'),members[_0x1a2026[_0x49f9('0x17')]]?members[_0x1a2026[_0x49f9('0x17')]][_0x49f9('0x6')]:_0x1a2026['device'],_0x1a2026['state'],_0x1a2026[_0x49f9('0x17')]));switch(_0x1a2026['state']){case _0x49f9('0x19'):case'BUSY':if(!startsWith(exclude,_0x1a2026['device'])){members[_0x1a2026[_0x49f9('0x17')]]={'channel':_0x49f9('0x1a'),'interface':_0x1a2026['device'],'type':_0x49f9('0x1b'),'enterAt':utils['now'](),'role':'agent'};}break;case _0x49f9('0x1c'):if(!_[_0x49f9('0x1d')](members[_0x1a2026['device']])){members[_0x1a2026[_0x49f9('0x17')]][_0x49f9('0x1e')]=utils['now']();members[_0x1a2026[_0x49f9('0x17')]][_0x49f9('0x1f')]=utils[_0x49f9('0x20')](members[_0x1a2026[_0x49f9('0x17')]]['exitAt'],members[_0x1a2026[_0x49f9('0x17')]][_0x49f9('0x21')]);if(members[_0x1a2026[_0x49f9('0x17')]][_0x49f9('0x6')]){writeDB(members[_0x1a2026[_0x49f9('0x17')]]);}}break;default:break;}}catch(_0x45e077){utils[_0x49f9('0x22')](util['format']('[%s][members][devicestatechange]',members[_0x1a2026[_0x49f9('0x17')]]?members[_0x1a2026[_0x49f9('0x17')]][_0x49f9('0x6')]:_0x1a2026[_0x49f9('0x17')]),_0x45e077);}};exports[_0x49f9('0x23')]=function(_0x2d1e7d){try{if(!_[_0x49f9('0x1d')](members[_0x2d1e7d[_0x49f9('0xb')]])){utils['debug'](util[_0x49f9('0x4')]('[%s][members][agentcomplete]',_0x2d1e7d[_0x49f9('0x6')]),_0x2d1e7d);utils[_0x49f9('0x3')](util[_0x49f9('0x4')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x2d1e7d[_0x49f9('0x6')],_0x2d1e7d[_0x49f9('0xb')],_0x2d1e7d[_0x49f9('0x24')]));members[_0x2d1e7d[_0x49f9('0xb')]]=_[_0x49f9('0x25')](members[_0x2d1e7d[_0x49f9('0xb')]],{'data4':_0x2d1e7d[_0x49f9('0x24')],'uniqueid':_0x2d1e7d[_0x49f9('0x6')]});}}catch(_0x37bc9c){utils[_0x49f9('0x22')](util[_0x49f9('0x4')](_0x49f9('0x26'),_0x2d1e7d[_0x49f9('0x6')]),_0x37bc9c);}};exports[_0x49f9('0x27')]=function(_0x135cfc){try{utils[_0x49f9('0x15')](util[_0x49f9('0x4')]('[%s][members][cdr]',_0x135cfc[_0x49f9('0x6')]),_0x135cfc);if(_0x135cfc[_0x49f9('0x7')]){var _0x97e1de=_0x135cfc[_0x49f9('0x7')]['split']('-')[0x0];if(!_['isNil'](members[_0x97e1de])){members[_0x97e1de]=_[_0x49f9('0x25')](members[_0x97e1de],{'data1':members[_0x97e1de]['data1']||_0x135cfc[_0x49f9('0xa')],'data2':members[_0x97e1de][_0x49f9('0x8')]||_0x135cfc[_0x49f9('0x28')],'data3':members[_0x97e1de][_0x49f9('0x29')]||_0x135cfc[_0x49f9('0x2a')],'uniqueid':members[_0x97e1de][_0x49f9('0x6')]||_0x135cfc[_0x49f9('0x6')]});utils['info'](util[_0x49f9('0x4')](_0x49f9('0x2b'),_0x135cfc['uniqueid'],members[_0x97e1de]['data1'],members[_0x97e1de]['data2'],members[_0x97e1de][_0x49f9('0x29')]));if(members[_0x97e1de]['exitAt']){writeDB(members[_0x97e1de]);}}}if(_0x135cfc['destinationchannel']){var _0x33da4b=_0x135cfc[_0x49f9('0x2c')][_0x49f9('0x2d')]('-')[0x0];if(!_[_0x49f9('0x1d')](members[_0x33da4b])){members[_0x33da4b]=_['assign'](members[_0x33da4b],{'data1':members[_0x33da4b][_0x49f9('0x2e')]||_0x135cfc['type'],'data2':members[_0x33da4b][_0x49f9('0x8')]||_0x135cfc[_0x49f9('0x28')],'data3':members[_0x33da4b][_0x49f9('0x29')]||_0x135cfc[_0x49f9('0x2a')],'uniqueid':members[_0x33da4b][_0x49f9('0x6')]||_0x135cfc[_0x49f9('0x6')]});utils['info'](util['format'](_0x49f9('0x2b'),_0x135cfc[_0x49f9('0x6')],members[_0x33da4b][_0x49f9('0x2e')],members[_0x33da4b]['data2'],members[_0x33da4b][_0x49f9('0x29')]));if(members[_0x33da4b][_0x49f9('0x1e')]){writeDB(members[_0x33da4b]);}}}}catch(_0x4c656c){utils['error'](util[_0x49f9('0x4')](_0x49f9('0x2f'),_0x135cfc[_0x49f9('0x6')]),_0x4c656c);}};
\ No newline at end of file
index 64abbfd..960470b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ee0=['[%s][queues][musiconholdstop]','lodash','util','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','accountcode','queuecallerexitreason','queue','then','type','request','CreateVoiceQueueReport','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','format','position','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','now','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','transfereduniqueid','queuecallerenterreason','varset','[%s][queues][varset]','queuestatus','value','toUpperCase','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','variable','queueposition','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerleave','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','BLIND','extension','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','transferexten','transferuniqueid','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','transfertargetuniqueid','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x3ee0,0xcf));var _0x03ee=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3ee0[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x03ee('0x0'));var util=require(_0x03ee('0x1'));var utils=require(_0x03ee('0x2'));var queues={};function writeDB(_0x12d349){utils[_0x03ee('0x3')](util['format'](_0x03ee('0x4'),_0x12d349[_0x03ee('0x5')],_0x12d349[_0x03ee('0x6')],_0x12d349['queue'],_0x12d349[_0x03ee('0x7')],_0x12d349['calleridnum'],_0x12d349[_0x03ee('0x8')],_0x12d349[_0x03ee('0x9')]));if(_0x12d349[_0x03ee('0xa')]){utils['getVoiceQueueByName'](_0x12d349[_0x03ee('0xa')])[_0x03ee('0xb')](function(_0x1dc1df){if(_0x1dc1df){_0x12d349[_0x03ee('0xc')]=_0x1dc1df[_0x03ee('0xc')];}utils[_0x03ee('0xd')](_0x03ee('0xe'),_0x12d349);});}else{utils[_0x03ee('0xd')](_0x03ee('0xe'),_0x12d349);}if(_0x12d349['transfereduniqueid']){delete queues[_0x12d349['transfereduniqueid']];}else{delete queues[_0x12d349[_0x03ee('0x5')]];}}exports[_0x03ee('0xf')]=function(_0xdc59ea){try{utils[_0x03ee('0x10')](util['format'](_0x03ee('0x11'),_0xdc59ea[_0x03ee('0x5')]),_0xdc59ea);utils['info'](util[_0x03ee('0x12')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0xdc59ea[_0x03ee('0x5')],_0xdc59ea[_0x03ee('0xa')],_0xdc59ea[_0x03ee('0x13')]));queues[_0xdc59ea[_0x03ee('0x5')]]=_['assign'](_0xdc59ea,{'originalposition':_0xdc59ea[_0x03ee('0x13')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x5cdcd5){utils[_0x03ee('0x14')](util[_0x03ee('0x12')]('[%s][queues][queuecallerjoin]',_0xdc59ea['uniqueid']),_0x5cdcd5);}};exports[_0x03ee('0x15')]=function(_0x3984f0){try{if(!_[_0x03ee('0x16')](queues[_0x3984f0[_0x03ee('0x5')]])){utils[_0x03ee('0x10')](util[_0x03ee('0x12')](_0x03ee('0x17'),_0x3984f0[_0x03ee('0x5')]),_0x3984f0);if(queues[_0x3984f0[_0x03ee('0x5')]][_0x03ee('0x18')]){if(!queues[_0x3984f0['uniqueid']]['queuecallerabandon']&&!queues[_0x3984f0[_0x03ee('0x5')]][_0x03ee('0x19')]){queues[_0x3984f0[_0x03ee('0x5')]][_0x03ee('0x1a')]=!![];queues[_0x3984f0['uniqueid']][_0x03ee('0x1b')]=utils[_0x03ee('0x1c')]();queues[_0x3984f0[_0x03ee('0x5')]][_0x03ee('0x9')]=_0x03ee('0x1d');}utils[_0x03ee('0x3')](util[_0x03ee('0x12')](_0x03ee('0x1e'),_0x3984f0['uniqueid'],queues[_0x3984f0['uniqueid']]['name'],queues[_0x3984f0[_0x03ee('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x3984f0['uniqueid']]);}else if(queues[_0x3984f0[_0x03ee('0x5')]]['transfereduniqueid']){utils[_0x03ee('0x3')](util[_0x03ee('0x12')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x3984f0[_0x03ee('0x5')],queues[_0x3984f0[_0x03ee('0x5')]]['name'],queues[_0x3984f0['uniqueid']][_0x03ee('0x1f')]));queues[queues[_0x3984f0[_0x03ee('0x5')]][_0x03ee('0x1f')]]=queues[_0x3984f0['uniqueid']];queues[queues[_0x3984f0['uniqueid']][_0x03ee('0x1f')]][_0x03ee('0x20')]=0x2;delete queues[_0x3984f0[_0x03ee('0x5')]];}}}catch(_0x50b306){utils['error'](util['format']('[%s][queues][hangup]',_0x3984f0[_0x03ee('0x5')]),_0x50b306);}};exports[_0x03ee('0x21')]=function(_0xa08e6c){try{utils[_0x03ee('0x10')](util[_0x03ee('0x12')](_0x03ee('0x22'),_0xa08e6c[_0x03ee('0x5')]),_0xa08e6c);if(!_[_0x03ee('0x16')](_0xa08e6c['variable'][_0x03ee('0x23')])&&_0xa08e6c[_0x03ee('0x24')][_0x03ee('0x25')]()!=='CONTINUE'){if(!_[_0x03ee('0x16')](queues[_0xa08e6c[_0x03ee('0x5')]])){queues[_0xa08e6c[_0x03ee('0x5')]][_0x03ee('0x26')]=![];queues[_0xa08e6c[_0x03ee('0x5')]][_0x03ee('0x27')]=null;queues[_0xa08e6c[_0x03ee('0x5')]][_0x03ee('0x19')]=!![];queues[_0xa08e6c[_0x03ee('0x5')]][_0x03ee('0x28')]=utils['now']();queues[_0xa08e6c['uniqueid']][_0x03ee('0x9')]=_0xa08e6c[_0x03ee('0x24')][_0x03ee('0x25')]();utils[_0x03ee('0x3')](util['format'](_0x03ee('0x29'),_0xa08e6c[_0x03ee('0x5')],queues[_0xa08e6c[_0x03ee('0x5')]]['name'],_0xa08e6c[_0x03ee('0x24')],queues[_0xa08e6c[_0x03ee('0x5')]][_0x03ee('0x9')]));writeDB(queues[_0xa08e6c[_0x03ee('0x5')]]);}}else if(!_[_0x03ee('0x16')](_0xa08e6c[_0x03ee('0x2a')][_0x03ee('0x2b')])){if(!_[_0x03ee('0x16')](queues[_0xa08e6c['uniqueid']])&&!queues[_0xa08e6c[_0x03ee('0x5')]]['queuecallerabandon']){queues[_0xa08e6c['uniqueid']][_0x03ee('0x26')]=![];queues[_0xa08e6c[_0x03ee('0x5')]]['queuecallerabandonAt']=null;queues[_0xa08e6c['uniqueid']][_0x03ee('0x19')]=!![];queues[_0xa08e6c[_0x03ee('0x5')]][_0x03ee('0x28')]=utils[_0x03ee('0x1c')]();queues[_0xa08e6c[_0x03ee('0x5')]][_0x03ee('0x9')]=_0x03ee('0x2c');utils['info'](util[_0x03ee('0x12')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0xa08e6c[_0x03ee('0x5')],queues[_0xa08e6c[_0x03ee('0x5')]]['name'],_0xa08e6c[_0x03ee('0x24')],queues[_0xa08e6c[_0x03ee('0x5')]][_0x03ee('0x9')]));}}}catch(_0x4a62aa){utils[_0x03ee('0x14')](util[_0x03ee('0x12')](_0x03ee('0x22'),_0xa08e6c[_0x03ee('0x5')]),_0x4a62aa);}};exports[_0x03ee('0x26')]=function(_0x1dffb1){try{if(!_[_0x03ee('0x16')](queues[_0x1dffb1[_0x03ee('0x5')]])){utils['debug'](util[_0x03ee('0x12')](_0x03ee('0x2d'),_0x1dffb1['uniqueid']),_0x1dffb1);queues[_0x1dffb1[_0x03ee('0x5')]][_0x03ee('0x19')]=![];queues[_0x1dffb1[_0x03ee('0x5')]][_0x03ee('0x28')]=null;queues[_0x1dffb1[_0x03ee('0x5')]]['queuecallerabandon']=!![];queues[_0x1dffb1[_0x03ee('0x5')]][_0x03ee('0x27')]=utils['now']();queues[_0x1dffb1[_0x03ee('0x5')]][_0x03ee('0x9')]=_0x03ee('0x2e');utils[_0x03ee('0x3')](util[_0x03ee('0x12')](_0x03ee('0x2f'),_0x1dffb1[_0x03ee('0x5')],queues[_0x1dffb1[_0x03ee('0x5')]][_0x03ee('0x30')],queues[_0x1dffb1['uniqueid']][_0x03ee('0x9')]));}}catch(_0xbfe9d2){utils[_0x03ee('0x14')](util[_0x03ee('0x12')](_0x03ee('0x2d'),_0x1dffb1['uniqueid']),_0xbfe9d2);}};exports[_0x03ee('0x31')]=function(_0x1bb385){try{if(!_[_0x03ee('0x16')](queues[_0x1bb385[_0x03ee('0x5')]])){utils[_0x03ee('0x10')](util['format']('[%s][queues][queuecallerleave]',_0x1bb385['uniqueid']),_0x1bb385);utils[_0x03ee('0x3')](util['format']('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x1bb385['uniqueid'],queues[_0x1bb385[_0x03ee('0x5')]][_0x03ee('0x30')],_0x1bb385[_0x03ee('0x32')],_0x1bb385[_0x03ee('0x33')]));queues[_0x1bb385[_0x03ee('0x5')]][_0x03ee('0x31')]=!![];queues[_0x1bb385[_0x03ee('0x5')]][_0x03ee('0x18')]=utils[_0x03ee('0x1c')]();queues[_0x1bb385['uniqueid']][_0x03ee('0x34')]=utils[_0x03ee('0x35')](queues[_0x1bb385['uniqueid']][_0x03ee('0x18')],queues[_0x1bb385[_0x03ee('0x5')]][_0x03ee('0x36')]);queues[_0x1bb385[_0x03ee('0x5')]]['position']=_0x1bb385[_0x03ee('0x13')];queues[_0x1bb385[_0x03ee('0x5')]][_0x03ee('0x37')]=_0x1bb385[_0x03ee('0x37')];queues[_0x1bb385['uniqueid']][_0x03ee('0x32')]=_0x1bb385[_0x03ee('0x32')];queues[_0x1bb385[_0x03ee('0x5')]]['connectedlinename']=_0x1bb385[_0x03ee('0x33')];}}catch(_0x3b5ce3){utils[_0x03ee('0x14')](util[_0x03ee('0x12')](_0x03ee('0x38'),_0x1bb385['uniqueid']),_0x3b5ce3);}};exports[_0x03ee('0x39')]=function(_0x99dd39){try{if(!_[_0x03ee('0x16')](queues[_0x99dd39[_0x03ee('0x5')]])){utils[_0x03ee('0x10')](util[_0x03ee('0x12')](_0x03ee('0x3a'),_0x99dd39[_0x03ee('0x5')]),_0x99dd39);utils['info'](util[_0x03ee('0x12')](_0x03ee('0x3b'),_0x99dd39[_0x03ee('0x5')],queues[_0x99dd39[_0x03ee('0x5')]][_0x03ee('0x30')],_0x99dd39[_0x03ee('0x3c')],_0x99dd39[_0x03ee('0x3d')]));queues[_0x99dd39[_0x03ee('0x5')]][_0x03ee('0x26')]=![];queues[_0x99dd39[_0x03ee('0x5')]][_0x03ee('0x26')]=![];queues[_0x99dd39[_0x03ee('0x5')]][_0x03ee('0x27')]=null;queues[_0x99dd39[_0x03ee('0x5')]][_0x03ee('0x19')]=![];queues[_0x99dd39[_0x03ee('0x5')]]['queuecallerexitreason']=null;queues[_0x99dd39['uniqueid']]['queuecallerexitAt']=null;queues[_0x99dd39['uniqueid']][_0x03ee('0x3e')]=!![];queues[_0x99dd39[_0x03ee('0x5')]][_0x03ee('0x8')]=_0x99dd39[_0x03ee('0x3d')];queues[_0x99dd39[_0x03ee('0x5')]][_0x03ee('0x7')]=_0x99dd39[_0x03ee('0x3c')];}}catch(_0x483cfe){utils[_0x03ee('0x14')](util['format'](_0x03ee('0x3a'),_0x99dd39['uniqueid']),_0x483cfe);}};exports['agentcomplete']=function(_0x194ac){try{if(!_[_0x03ee('0x16')](queues[_0x194ac[_0x03ee('0x5')]])){if(queues[_0x194ac[_0x03ee('0x5')]][_0x03ee('0x18')]){utils[_0x03ee('0x10')](util[_0x03ee('0x12')](_0x03ee('0x3f'),_0x194ac[_0x03ee('0x5')]),_0x194ac);queues[_0x194ac['uniqueid']][_0x03ee('0x26')]=![];queues[_0x194ac['uniqueid']][_0x03ee('0x26')]=![];queues[_0x194ac['uniqueid']]['queuecallerabandonAt']=null;queues[_0x194ac[_0x03ee('0x5')]][_0x03ee('0x19')]=![];queues[_0x194ac[_0x03ee('0x5')]][_0x03ee('0x28')]=null;queues[_0x194ac[_0x03ee('0x5')]][_0x03ee('0x3e')]=!![];queues[_0x194ac['uniqueid']]['lastAssignedTo']=_0x194ac['membername'];queues[_0x194ac[_0x03ee('0x5')]][_0x03ee('0x1a')]=!![];queues[_0x194ac[_0x03ee('0x5')]]['queuecallercompleteAt']=utils[_0x03ee('0x1c')]();if(_0x194ac[_0x03ee('0x40')]==_0x03ee('0x41')){if(!queues[_0x194ac['uniqueid']][_0x03ee('0x41')]){queues[_0x194ac[_0x03ee('0x5')]][_0x03ee('0x9')]=_0x03ee('0x42');}}else{queues[_0x194ac['uniqueid']][_0x03ee('0x9')]='COMPLETEDBY'+_0x194ac[_0x03ee('0x40')][_0x03ee('0x25')]();}utils['info'](util[_0x03ee('0x12')](_0x03ee('0x43'),_0x194ac[_0x03ee('0x5')],queues[_0x194ac[_0x03ee('0x5')]][_0x03ee('0x30')],_0x194ac[_0x03ee('0x3c')],queues[_0x194ac[_0x03ee('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x194ac['uniqueid']]);}}}catch(_0x224b0c){utils[_0x03ee('0x14')](util['format'](_0x03ee('0x3f'),_0x194ac[_0x03ee('0x5')]),_0x224b0c);}};exports[_0x03ee('0x44')]=function(_0x465375){try{if(!_[_0x03ee('0x16')](queues[_0x465375[_0x03ee('0x45')]])){utils[_0x03ee('0x10')](util[_0x03ee('0x12')]('[%s][queues][blindtransfer]',_0x465375['uniqueid']),_0x465375);queues[_0x465375[_0x03ee('0x45')]][_0x03ee('0x41')]=!![];queues[_0x465375[_0x03ee('0x45')]][_0x03ee('0x46')]=_0x03ee('0x47');queues[_0x465375[_0x03ee('0x45')]]['transferexten']=_0x465375[_0x03ee('0x48')];queues[_0x465375['transfereeuniqueid']]['transferuniqueid']=_0x465375[_0x03ee('0x45')];queues[_0x465375[_0x03ee('0x45')]]['queuecallerexitreason']=_0x03ee('0x49');utils['info'](util[_0x03ee('0x12')](_0x03ee('0x4a'),_0x465375[_0x03ee('0x5')],queues[_0x465375[_0x03ee('0x45')]]['name'],_0x465375[_0x03ee('0x45')],_0x465375[_0x03ee('0x48')]));}}catch(_0x3a8a7a){utils[_0x03ee('0x14')](util[_0x03ee('0x12')]('[%s][queues][blindtransfer]',_0x465375[_0x03ee('0x5')]),_0x3a8a7a);}};exports[_0x03ee('0x4b')]=function(_0x49b1d5){try{utils[_0x03ee('0x10')](util[_0x03ee('0x12')](_0x03ee('0x4c'),_0x49b1d5[_0x03ee('0x4d')]),_0x49b1d5);if(_0x49b1d5[_0x03ee('0x4d')]==_0x49b1d5['origtransfererlinkedid']){if(!_['isNil'](queues[_0x49b1d5[_0x03ee('0x4e')]])){utils[_0x03ee('0x3')](util['format'](_0x03ee('0x4f'),_0x49b1d5[_0x03ee('0x4d')],queues[_0x49b1d5[_0x03ee('0x4e')]][_0x03ee('0x30')],_0x49b1d5['origtransfererexten']));queues[_0x49b1d5[_0x03ee('0x4e')]][_0x03ee('0x41')]=!![];queues[_0x49b1d5[_0x03ee('0x4e')]][_0x03ee('0x46')]='ATTENDED';queues[_0x49b1d5[_0x03ee('0x4e')]][_0x03ee('0x50')]=_0x49b1d5['origtransfererexten'];queues[_0x49b1d5['secondtransfererlinkedid']][_0x03ee('0x51')]=_0x49b1d5[_0x03ee('0x4d')];queues[_0x49b1d5[_0x03ee('0x4e')]]['queuecallerexitreason']=_0x03ee('0x52');}if(!_[_0x03ee('0x16')](queues[_0x49b1d5[_0x03ee('0x53')]])){if(_0x49b1d5[_0x03ee('0x54')]&&queues[_0x49b1d5[_0x03ee('0x54')]]){queues[_0x49b1d5[_0x03ee('0x54')]]['queuecallerenterreason']=0x1;queues[_0x49b1d5[_0x03ee('0x45')]]=_['clone'](queues[_0x49b1d5[_0x03ee('0x54')]]);queues[_0x49b1d5[_0x03ee('0x45')]][_0x03ee('0x1f')]=_0x49b1d5[_0x03ee('0x55')];queues[_0x49b1d5[_0x03ee('0x45')]][_0x03ee('0x20')]=0x2;queues[_0x49b1d5['transfereeuniqueid']][_0x03ee('0x56')]=queues[_0x49b1d5[_0x03ee('0x4e')]][_0x03ee('0x56')];queues[_0x49b1d5['transfereeuniqueid']][_0x03ee('0x57')]=queues[_0x49b1d5[_0x03ee('0x4e')]][_0x03ee('0x57')];queues[_0x49b1d5[_0x03ee('0x45')]][_0x03ee('0x36')]=utils['now']();queues[_0x49b1d5[_0x03ee('0x45')]]['queuecallerleaveAt']=utils[_0x03ee('0x1c')]();queues[_0x49b1d5[_0x03ee('0x45')]]['holdtime']=0x0;queues[_0x49b1d5['transfereeuniqueid']][_0x03ee('0x58')]=0x0;utils['info'](util[_0x03ee('0x12')](_0x03ee('0x59'),_0x49b1d5['origtransfereruniqueid'],queues[_0x49b1d5[_0x03ee('0x45')]][_0x03ee('0x30')],queues[_0x49b1d5[_0x03ee('0x45')]][_0x03ee('0x56')],queues[_0x49b1d5['transfereeuniqueid']]['calleridname']));}else{utils[_0x03ee('0x3')](util[_0x03ee('0x12')](_0x03ee('0x5a'),_0x49b1d5[_0x03ee('0x4d')],queues[_0x49b1d5[_0x03ee('0x53')]][_0x03ee('0x30')],_0x49b1d5[_0x03ee('0x4e')]));queues[_0x49b1d5[_0x03ee('0x53')]]['transfereduniqueid']=_0x49b1d5['secondtransfererlinkedid'];}}}else if(_0x49b1d5['secondtransfereruniqueid']==_0x49b1d5[_0x03ee('0x4e')]){if(!_['isNil'](queues[_0x49b1d5[_0x03ee('0x53')]])){utils['info'](util[_0x03ee('0x12')](_0x03ee('0x5b'),_0x49b1d5['origtransfereruniqueid'],queues[_0x49b1d5[_0x03ee('0x53')]]['name'],_0x49b1d5[_0x03ee('0x5c')],_0x49b1d5[_0x03ee('0x5d')]));queues[_0x49b1d5[_0x03ee('0x53')]][_0x03ee('0x41')]=!![];queues[_0x49b1d5[_0x03ee('0x53')]][_0x03ee('0x46')]='ATTENDED';queues[_0x49b1d5['origtransfererlinkedid']]['transferexten']=_0x49b1d5[_0x03ee('0x5d')];queues[_0x49b1d5[_0x03ee('0x53')]]['transferuniqueid']=_0x49b1d5[_0x03ee('0x5c')];queues[_0x49b1d5[_0x03ee('0x53')]][_0x03ee('0x9')]=_0x03ee('0x52');}if(!_['isNil'](queues[_0x49b1d5[_0x03ee('0x4e')]])){if(_0x49b1d5['transfertargetlinkedid']&&queues[_0x49b1d5['transfertargetlinkedid']]){queues[_0x49b1d5[_0x03ee('0x5e')]]['queuecallerenterreason']=0x1;queues[_0x49b1d5[_0x03ee('0x55')]]=_[_0x03ee('0x5f')](queues[_0x49b1d5['transfertargetlinkedid']]);queues[_0x49b1d5[_0x03ee('0x55')]][_0x03ee('0x1f')]=_0x49b1d5[_0x03ee('0x55')];queues[_0x49b1d5['transfertargetuniqueid']][_0x03ee('0x20')]=0x2;queues[_0x49b1d5[_0x03ee('0x55')]]['calleridnum']=queues[_0x49b1d5[_0x03ee('0x53')]][_0x03ee('0x56')];queues[_0x49b1d5[_0x03ee('0x55')]][_0x03ee('0x57')]=queues[_0x49b1d5[_0x03ee('0x53')]][_0x03ee('0x57')];queues[_0x49b1d5[_0x03ee('0x55')]][_0x03ee('0x36')]=utils[_0x03ee('0x1c')]();queues[_0x49b1d5['transfertargetuniqueid']]['queuecallerleaveAt']=utils[_0x03ee('0x1c')]();queues[_0x49b1d5[_0x03ee('0x55')]][_0x03ee('0x34')]=0x0;queues[_0x49b1d5[_0x03ee('0x55')]]['mohtime']=0x0;utils[_0x03ee('0x3')](util[_0x03ee('0x12')](_0x03ee('0x60'),_0x49b1d5[_0x03ee('0x4d')],queues[_0x49b1d5[_0x03ee('0x55')]]['name'],queues[_0x49b1d5['transfertargetuniqueid']][_0x03ee('0x1f')],queues[_0x49b1d5[_0x03ee('0x55')]]['calleridnum'],queues[_0x49b1d5[_0x03ee('0x55')]]['calleridname']));}else{utils[_0x03ee('0x3')](util[_0x03ee('0x12')](_0x03ee('0x5a'),_0x49b1d5[_0x03ee('0x4d')],queues[_0x49b1d5[_0x03ee('0x4e')]][_0x03ee('0x30')],_0x49b1d5[_0x03ee('0x53')]));queues[_0x49b1d5['secondtransfererlinkedid']]['transfereduniqueid']=_0x49b1d5['origtransfererlinkedid'];}}}}catch(_0x249de0){utils[_0x03ee('0x14')](util[_0x03ee('0x12')]('[%s][queues][attendedtransfer]',_0x49b1d5[_0x03ee('0x4d')]),_0x249de0);}};exports[_0x03ee('0x61')]=function(_0x2e77f4){try{if(!_['isNil'](queues[_0x2e77f4[_0x03ee('0x5')]])){utils['debug'](util[_0x03ee('0x12')](_0x03ee('0x62'),_0x2e77f4[_0x03ee('0x5')]),_0x2e77f4);queues[_0x2e77f4[_0x03ee('0x5')]][_0x03ee('0x63')]=utils[_0x03ee('0x1c')]();utils[_0x03ee('0x3')](util['format'](_0x03ee('0x64'),_0x2e77f4['uniqueid'],queues[_0x2e77f4[_0x03ee('0x5')]][_0x03ee('0x30')],queues[_0x2e77f4[_0x03ee('0x5')]][_0x03ee('0x63')]));}}catch(_0x551ecf){utils['error'](util[_0x03ee('0x12')]('[%s][queues][musiconholdstart]',_0x2e77f4['uniqueid']),_0x551ecf);}};exports[_0x03ee('0x65')]=function(_0x399542){try{if(!_[_0x03ee('0x16')](queues[_0x399542[_0x03ee('0x5')]])){if(!_[_0x03ee('0x16')](queues[_0x399542['uniqueid']][_0x03ee('0x63')])){utils[_0x03ee('0x10')](util[_0x03ee('0x12')](_0x03ee('0x66'),_0x399542['uniqueid']),_0x399542);queues[_0x399542[_0x03ee('0x5')]][_0x03ee('0x58')]+=utils[_0x03ee('0x35')](utils[_0x03ee('0x1c')](),queues[_0x399542[_0x03ee('0x5')]][_0x03ee('0x63')]);utils['info'](util[_0x03ee('0x12')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x399542[_0x03ee('0x5')],queues[_0x399542[_0x03ee('0x5')]]['name'],queues[_0x399542['uniqueid']][_0x03ee('0x58')]));delete queues[_0x399542[_0x03ee('0x5')]][_0x03ee('0x63')];}}}catch(_0x1b62fa){utils[_0x03ee('0x14')](util['format'](_0x03ee('0x66'),_0x399542[_0x03ee('0x5')]),_0x1b62fa);}};
\ No newline at end of file
+var _0xfef5=['[%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','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','calleridnum','accountcode','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','format','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerexit','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','varset','variable','queuestatus','queuecallerabandonAt','queuecallerexitAt','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','value','queuecallerabandon','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerleaveAt','queuecallerjoinAt','count','[%s][queues][agentconnect]','membername','destaccountcode','lastAssignedTo','[%s][queues][agentcomplete]','assigned','reason','transfer','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','origtransfererexten','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','queuecallerenterreason','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid'];(function(_0x328642,_0x61896){var _0x32250e=function(_0x3ffa6d){while(--_0x3ffa6d){_0x328642['push'](_0x328642['shift']());}};_0x32250e(++_0x61896);}(_0xfef5,0x19e));var _0x5fef=function(_0x9b2491,_0x1bacc2){_0x9b2491=_0x9b2491-0x0;var _0x538093=_0xfef5[_0x9b2491];return _0x538093;};'use strict';var _=require('lodash');var util=require(_0x5fef('0x0'));var utils=require('./utils');var queues={};function writeDB(_0x3bd043){utils[_0x5fef('0x1')](util['format'](_0x5fef('0x2'),_0x3bd043[_0x5fef('0x3')],_0x3bd043[_0x5fef('0x4')],_0x3bd043[_0x5fef('0x5')],_0x3bd043['lastAssignedTo'],_0x3bd043[_0x5fef('0x6')],_0x3bd043[_0x5fef('0x7')],_0x3bd043['queuecallerexitreason']));if(_0x3bd043[_0x5fef('0x5')]){utils[_0x5fef('0x8')](_0x3bd043[_0x5fef('0x5')])['then'](function(_0x569294){if(_0x569294){_0x3bd043['type']=_0x569294[_0x5fef('0x9')];}utils[_0x5fef('0xa')]('CreateVoiceQueueReport',_0x3bd043);});}else{utils[_0x5fef('0xa')](_0x5fef('0xb'),_0x3bd043);}if(_0x3bd043[_0x5fef('0xc')]){delete queues[_0x3bd043[_0x5fef('0xc')]];}else{delete queues[_0x3bd043['uniqueid']];}}exports['queuecallerjoin']=function(_0x295ccb){try{utils[_0x5fef('0xd')](util[_0x5fef('0xe')](_0x5fef('0xf'),_0x295ccb[_0x5fef('0x3')]),_0x295ccb);utils[_0x5fef('0x1')](util['format'](_0x5fef('0x10'),_0x295ccb[_0x5fef('0x3')],_0x295ccb[_0x5fef('0x5')],_0x295ccb[_0x5fef('0x11')]));queues[_0x295ccb[_0x5fef('0x3')]]=_[_0x5fef('0x12')](_0x295ccb,{'originalposition':_0x295ccb[_0x5fef('0x11')],'queuecallerjoinAt':utils[_0x5fef('0x13')](),'mohtime':0x0});}catch(_0x28737a){utils[_0x5fef('0x14')](util[_0x5fef('0xe')](_0x5fef('0xf'),_0x295ccb[_0x5fef('0x3')]),_0x28737a);}};exports[_0x5fef('0x15')]=function(_0x4f7ad6){try{if(!_[_0x5fef('0x16')](queues[_0x4f7ad6['uniqueid']])){utils[_0x5fef('0xd')](util[_0x5fef('0xe')](_0x5fef('0x17'),_0x4f7ad6[_0x5fef('0x3')]),_0x4f7ad6);if(queues[_0x4f7ad6[_0x5fef('0x3')]]['queuecallerleaveAt']){if(!queues[_0x4f7ad6['uniqueid']]['queuecallerabandon']&&!queues[_0x4f7ad6[_0x5fef('0x3')]][_0x5fef('0x18')]){queues[_0x4f7ad6[_0x5fef('0x3')]][_0x5fef('0x19')]=!![];queues[_0x4f7ad6[_0x5fef('0x3')]][_0x5fef('0x1a')]=utils['now']();queues[_0x4f7ad6[_0x5fef('0x3')]][_0x5fef('0x1b')]=_0x5fef('0x1c');}utils[_0x5fef('0x1')](util[_0x5fef('0xe')](_0x5fef('0x1d'),_0x4f7ad6[_0x5fef('0x3')],queues[_0x4f7ad6[_0x5fef('0x3')]][_0x5fef('0x1e')],queues[_0x4f7ad6['uniqueid']][_0x5fef('0x1b')]));writeDB(queues[_0x4f7ad6[_0x5fef('0x3')]]);}else if(queues[_0x4f7ad6[_0x5fef('0x3')]][_0x5fef('0xc')]){utils['info'](util['format'](_0x5fef('0x1f'),_0x4f7ad6[_0x5fef('0x3')],queues[_0x4f7ad6[_0x5fef('0x3')]]['name'],queues[_0x4f7ad6[_0x5fef('0x3')]][_0x5fef('0xc')]));queues[queues[_0x4f7ad6[_0x5fef('0x3')]][_0x5fef('0xc')]]=queues[_0x4f7ad6[_0x5fef('0x3')]];queues[queues[_0x4f7ad6['uniqueid']][_0x5fef('0xc')]]['queuecallerenterreason']=0x2;delete queues[_0x4f7ad6[_0x5fef('0x3')]];}}}catch(_0x55077a){utils[_0x5fef('0x14')](util[_0x5fef('0xe')](_0x5fef('0x17'),_0x4f7ad6[_0x5fef('0x3')]),_0x55077a);}};exports[_0x5fef('0x20')]=function(_0x1752f4){try{utils[_0x5fef('0xd')](util[_0x5fef('0xe')]('[%s][queues][varset]',_0x1752f4['uniqueid']),_0x1752f4);if(!_['isNil'](_0x1752f4[_0x5fef('0x21')][_0x5fef('0x22')])&&_0x1752f4['value']['toUpperCase']()!=='CONTINUE'){if(!_['isNil'](queues[_0x1752f4['uniqueid']])){queues[_0x1752f4['uniqueid']]['queuecallerabandon']=![];queues[_0x1752f4[_0x5fef('0x3')]][_0x5fef('0x23')]=null;queues[_0x1752f4[_0x5fef('0x3')]][_0x5fef('0x18')]=!![];queues[_0x1752f4[_0x5fef('0x3')]][_0x5fef('0x24')]=utils['now']();queues[_0x1752f4['uniqueid']]['queuecallerexitreason']=_0x1752f4['value'][_0x5fef('0x25')]();utils[_0x5fef('0x1')](util[_0x5fef('0xe')](_0x5fef('0x26'),_0x1752f4[_0x5fef('0x3')],queues[_0x1752f4[_0x5fef('0x3')]][_0x5fef('0x1e')],_0x1752f4[_0x5fef('0x27')],queues[_0x1752f4[_0x5fef('0x3')]][_0x5fef('0x1b')]));writeDB(queues[_0x1752f4[_0x5fef('0x3')]]);}}else if(!_[_0x5fef('0x16')](_0x1752f4['variable']['queueposition'])){if(!_['isNil'](queues[_0x1752f4[_0x5fef('0x3')]])&&!queues[_0x1752f4[_0x5fef('0x3')]][_0x5fef('0x28')]){queues[_0x1752f4['uniqueid']][_0x5fef('0x28')]=![];queues[_0x1752f4[_0x5fef('0x3')]][_0x5fef('0x23')]=null;queues[_0x1752f4['uniqueid']][_0x5fef('0x18')]=!![];queues[_0x1752f4[_0x5fef('0x3')]][_0x5fef('0x24')]=utils[_0x5fef('0x13')]();queues[_0x1752f4[_0x5fef('0x3')]][_0x5fef('0x1b')]=_0x5fef('0x29');utils[_0x5fef('0x1')](util[_0x5fef('0xe')](_0x5fef('0x2a'),_0x1752f4[_0x5fef('0x3')],queues[_0x1752f4['uniqueid']][_0x5fef('0x1e')],_0x1752f4['value'],queues[_0x1752f4['uniqueid']][_0x5fef('0x1b')]));}}}catch(_0x50dda5){utils[_0x5fef('0x14')](util[_0x5fef('0xe')](_0x5fef('0x2b'),_0x1752f4[_0x5fef('0x3')]),_0x50dda5);}};exports[_0x5fef('0x28')]=function(_0x4d6188){try{if(!_[_0x5fef('0x16')](queues[_0x4d6188[_0x5fef('0x3')]])){utils[_0x5fef('0xd')](util[_0x5fef('0xe')](_0x5fef('0x2c'),_0x4d6188['uniqueid']),_0x4d6188);queues[_0x4d6188[_0x5fef('0x3')]]['queuecallerexit']=![];queues[_0x4d6188[_0x5fef('0x3')]][_0x5fef('0x24')]=null;queues[_0x4d6188[_0x5fef('0x3')]][_0x5fef('0x28')]=!![];queues[_0x4d6188[_0x5fef('0x3')]]['queuecallerabandonAt']=utils[_0x5fef('0x13')]();queues[_0x4d6188[_0x5fef('0x3')]][_0x5fef('0x1b')]=_0x5fef('0x2d');utils[_0x5fef('0x1')](util[_0x5fef('0xe')](_0x5fef('0x2e'),_0x4d6188[_0x5fef('0x3')],queues[_0x4d6188[_0x5fef('0x3')]][_0x5fef('0x1e')],queues[_0x4d6188[_0x5fef('0x3')]][_0x5fef('0x1b')]));}}catch(_0x495195){utils[_0x5fef('0x14')](util[_0x5fef('0xe')](_0x5fef('0x2c'),_0x4d6188[_0x5fef('0x3')]),_0x495195);}};exports[_0x5fef('0x2f')]=function(_0x229ef0){try{if(!_[_0x5fef('0x16')](queues[_0x229ef0['uniqueid']])){utils['debug'](util['format'](_0x5fef('0x30'),_0x229ef0[_0x5fef('0x3')]),_0x229ef0);utils[_0x5fef('0x1')](util[_0x5fef('0xe')](_0x5fef('0x31'),_0x229ef0[_0x5fef('0x3')],queues[_0x229ef0[_0x5fef('0x3')]][_0x5fef('0x1e')],_0x229ef0[_0x5fef('0x32')],_0x229ef0[_0x5fef('0x33')]));queues[_0x229ef0[_0x5fef('0x3')]][_0x5fef('0x2f')]=!![];queues[_0x229ef0['uniqueid']]['queuecallerleaveAt']=utils[_0x5fef('0x13')]();queues[_0x229ef0[_0x5fef('0x3')]][_0x5fef('0x34')]=utils[_0x5fef('0x35')](queues[_0x229ef0[_0x5fef('0x3')]][_0x5fef('0x36')],queues[_0x229ef0['uniqueid']][_0x5fef('0x37')]);queues[_0x229ef0[_0x5fef('0x3')]][_0x5fef('0x11')]=_0x229ef0[_0x5fef('0x11')];queues[_0x229ef0[_0x5fef('0x3')]]['count']=_0x229ef0[_0x5fef('0x38')];queues[_0x229ef0[_0x5fef('0x3')]][_0x5fef('0x32')]=_0x229ef0[_0x5fef('0x32')];queues[_0x229ef0[_0x5fef('0x3')]]['connectedlinename']=_0x229ef0[_0x5fef('0x33')];}}catch(_0xe7719e){utils[_0x5fef('0x14')](util[_0x5fef('0xe')](_0x5fef('0x30'),_0x229ef0[_0x5fef('0x3')]),_0xe7719e);}};exports['agentconnect']=function(_0xed2447){try{if(!_[_0x5fef('0x16')](queues[_0xed2447['uniqueid']])){utils[_0x5fef('0xd')](util['format'](_0x5fef('0x39'),_0xed2447[_0x5fef('0x3')]),_0xed2447);utils[_0x5fef('0x1')](util[_0x5fef('0xe')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0xed2447['uniqueid'],queues[_0xed2447[_0x5fef('0x3')]]['name'],_0xed2447[_0x5fef('0x3a')],_0xed2447[_0x5fef('0x3b')]));queues[_0xed2447[_0x5fef('0x3')]][_0x5fef('0x28')]=![];queues[_0xed2447[_0x5fef('0x3')]][_0x5fef('0x28')]=![];queues[_0xed2447['uniqueid']]['queuecallerabandonAt']=null;queues[_0xed2447[_0x5fef('0x3')]][_0x5fef('0x18')]=![];queues[_0xed2447['uniqueid']][_0x5fef('0x1b')]=null;queues[_0xed2447['uniqueid']][_0x5fef('0x24')]=null;queues[_0xed2447[_0x5fef('0x3')]]['assigned']=!![];queues[_0xed2447[_0x5fef('0x3')]]['accountcode']=_0xed2447[_0x5fef('0x3b')];queues[_0xed2447['uniqueid']][_0x5fef('0x3c')]=_0xed2447[_0x5fef('0x3a')];}}catch(_0x819708){utils[_0x5fef('0x14')](util[_0x5fef('0xe')](_0x5fef('0x39'),_0xed2447[_0x5fef('0x3')]),_0x819708);}};exports['agentcomplete']=function(_0x1f5682){try{if(!_[_0x5fef('0x16')](queues[_0x1f5682[_0x5fef('0x3')]])){if(queues[_0x1f5682[_0x5fef('0x3')]][_0x5fef('0x36')]){utils[_0x5fef('0xd')](util[_0x5fef('0xe')](_0x5fef('0x3d'),_0x1f5682['uniqueid']),_0x1f5682);queues[_0x1f5682[_0x5fef('0x3')]][_0x5fef('0x28')]=![];queues[_0x1f5682['uniqueid']]['queuecallerabandon']=![];queues[_0x1f5682[_0x5fef('0x3')]][_0x5fef('0x23')]=null;queues[_0x1f5682[_0x5fef('0x3')]][_0x5fef('0x18')]=![];queues[_0x1f5682[_0x5fef('0x3')]]['queuecallerexitAt']=null;queues[_0x1f5682[_0x5fef('0x3')]][_0x5fef('0x3e')]=!![];queues[_0x1f5682[_0x5fef('0x3')]][_0x5fef('0x3c')]=_0x1f5682[_0x5fef('0x3a')];queues[_0x1f5682[_0x5fef('0x3')]][_0x5fef('0x19')]=!![];queues[_0x1f5682[_0x5fef('0x3')]][_0x5fef('0x1a')]=utils[_0x5fef('0x13')]();if(_0x1f5682[_0x5fef('0x3f')]=='transfer'){if(!queues[_0x1f5682[_0x5fef('0x3')]][_0x5fef('0x40')]){queues[_0x1f5682[_0x5fef('0x3')]][_0x5fef('0x1b')]='TRANSFER';}}else{queues[_0x1f5682[_0x5fef('0x3')]][_0x5fef('0x1b')]=_0x5fef('0x41')+_0x1f5682[_0x5fef('0x3f')]['toUpperCase']();}utils[_0x5fef('0x1')](util['format'](_0x5fef('0x42'),_0x1f5682[_0x5fef('0x3')],queues[_0x1f5682[_0x5fef('0x3')]]['name'],_0x1f5682['membername'],queues[_0x1f5682['uniqueid']][_0x5fef('0x1b')]));writeDB(queues[_0x1f5682[_0x5fef('0x3')]]);}}}catch(_0x1d99d7){utils[_0x5fef('0x14')](util[_0x5fef('0xe')](_0x5fef('0x3d'),_0x1f5682[_0x5fef('0x3')]),_0x1d99d7);}};exports['blindtransfer']=function(_0x283476){try{if(!_[_0x5fef('0x16')](queues[_0x283476['transfereeuniqueid']])){utils[_0x5fef('0xd')](util[_0x5fef('0xe')](_0x5fef('0x43'),_0x283476['uniqueid']),_0x283476);queues[_0x283476[_0x5fef('0x44')]][_0x5fef('0x40')]=!![];queues[_0x283476[_0x5fef('0x44')]][_0x5fef('0x45')]=_0x5fef('0x46');queues[_0x283476[_0x5fef('0x44')]][_0x5fef('0x47')]=_0x283476['extension'];queues[_0x283476[_0x5fef('0x44')]][_0x5fef('0x48')]=_0x283476[_0x5fef('0x44')];queues[_0x283476[_0x5fef('0x44')]]['queuecallerexitreason']=_0x5fef('0x49');utils[_0x5fef('0x1')](util[_0x5fef('0xe')](_0x5fef('0x4a'),_0x283476[_0x5fef('0x3')],queues[_0x283476[_0x5fef('0x44')]][_0x5fef('0x1e')],_0x283476['transfereeuniqueid'],_0x283476[_0x5fef('0x4b')]));}}catch(_0x35f8e7){utils['error'](util[_0x5fef('0xe')](_0x5fef('0x43'),_0x283476[_0x5fef('0x3')]),_0x35f8e7);}};exports[_0x5fef('0x4c')]=function(_0x14140a){try{utils[_0x5fef('0xd')](util[_0x5fef('0xe')](_0x5fef('0x4d'),_0x14140a['origtransfereruniqueid']),_0x14140a);if(_0x14140a[_0x5fef('0x4e')]==_0x14140a['origtransfererlinkedid']){if(!_['isNil'](queues[_0x14140a[_0x5fef('0x4f')]])){utils[_0x5fef('0x1')](util[_0x5fef('0xe')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x14140a[_0x5fef('0x4e')],queues[_0x14140a[_0x5fef('0x4f')]]['name'],_0x14140a[_0x5fef('0x50')]));queues[_0x14140a[_0x5fef('0x4f')]][_0x5fef('0x40')]=!![];queues[_0x14140a['secondtransfererlinkedid']][_0x5fef('0x45')]='ATTENDED';queues[_0x14140a[_0x5fef('0x4f')]][_0x5fef('0x47')]=_0x14140a[_0x5fef('0x50')];queues[_0x14140a[_0x5fef('0x4f')]][_0x5fef('0x48')]=_0x14140a[_0x5fef('0x4e')];queues[_0x14140a['secondtransfererlinkedid']]['queuecallerexitreason']=_0x5fef('0x51');}if(!_[_0x5fef('0x16')](queues[_0x14140a[_0x5fef('0x52')]])){if(_0x14140a['transfereelinkedid']&&queues[_0x14140a[_0x5fef('0x53')]]){queues[_0x14140a[_0x5fef('0x53')]][_0x5fef('0x54')]=0x1;queues[_0x14140a[_0x5fef('0x44')]]=_['clone'](queues[_0x14140a[_0x5fef('0x53')]]);queues[_0x14140a[_0x5fef('0x44')]][_0x5fef('0xc')]=_0x14140a[_0x5fef('0x55')];queues[_0x14140a[_0x5fef('0x44')]][_0x5fef('0x54')]=0x2;queues[_0x14140a[_0x5fef('0x44')]][_0x5fef('0x6')]=queues[_0x14140a[_0x5fef('0x4f')]][_0x5fef('0x6')];queues[_0x14140a[_0x5fef('0x44')]][_0x5fef('0x56')]=queues[_0x14140a[_0x5fef('0x4f')]]['calleridname'];queues[_0x14140a['transfereeuniqueid']][_0x5fef('0x37')]=utils[_0x5fef('0x13')]();queues[_0x14140a[_0x5fef('0x44')]][_0x5fef('0x36')]=utils[_0x5fef('0x13')]();queues[_0x14140a[_0x5fef('0x44')]][_0x5fef('0x34')]=0x0;queues[_0x14140a[_0x5fef('0x44')]][_0x5fef('0x57')]=0x0;utils[_0x5fef('0x1')](util[_0x5fef('0xe')](_0x5fef('0x58'),_0x14140a['origtransfereruniqueid'],queues[_0x14140a[_0x5fef('0x44')]][_0x5fef('0x1e')],queues[_0x14140a[_0x5fef('0x44')]][_0x5fef('0x6')],queues[_0x14140a[_0x5fef('0x44')]][_0x5fef('0x56')]));}else{utils[_0x5fef('0x1')](util[_0x5fef('0xe')](_0x5fef('0x59'),_0x14140a['origtransfereruniqueid'],queues[_0x14140a[_0x5fef('0x52')]][_0x5fef('0x1e')],_0x14140a['secondtransfererlinkedid']));queues[_0x14140a['origtransfererlinkedid']][_0x5fef('0xc')]=_0x14140a[_0x5fef('0x4f')];}}}else if(_0x14140a[_0x5fef('0x5a')]==_0x14140a[_0x5fef('0x4f')]){if(!_['isNil'](queues[_0x14140a[_0x5fef('0x52')]])){utils[_0x5fef('0x1')](util[_0x5fef('0xe')](_0x5fef('0x5b'),_0x14140a[_0x5fef('0x4e')],queues[_0x14140a[_0x5fef('0x52')]]['name'],_0x14140a['secondtransfereruniqueid'],_0x14140a['secondtransfererexten']));queues[_0x14140a[_0x5fef('0x52')]][_0x5fef('0x40')]=!![];queues[_0x14140a[_0x5fef('0x52')]][_0x5fef('0x45')]='ATTENDED';queues[_0x14140a['origtransfererlinkedid']][_0x5fef('0x47')]=_0x14140a[_0x5fef('0x5c')];queues[_0x14140a[_0x5fef('0x52')]][_0x5fef('0x48')]=_0x14140a['secondtransfereruniqueid'];queues[_0x14140a[_0x5fef('0x52')]][_0x5fef('0x1b')]=_0x5fef('0x51');}if(!_[_0x5fef('0x16')](queues[_0x14140a[_0x5fef('0x4f')]])){if(_0x14140a[_0x5fef('0x5d')]&&queues[_0x14140a[_0x5fef('0x5d')]]){queues[_0x14140a[_0x5fef('0x5d')]][_0x5fef('0x54')]=0x1;queues[_0x14140a[_0x5fef('0x55')]]=_['clone'](queues[_0x14140a[_0x5fef('0x5d')]]);queues[_0x14140a['transfertargetuniqueid']][_0x5fef('0xc')]=_0x14140a['transfertargetuniqueid'];queues[_0x14140a['transfertargetuniqueid']][_0x5fef('0x54')]=0x2;queues[_0x14140a['transfertargetuniqueid']]['calleridnum']=queues[_0x14140a[_0x5fef('0x52')]][_0x5fef('0x6')];queues[_0x14140a[_0x5fef('0x55')]][_0x5fef('0x56')]=queues[_0x14140a['origtransfererlinkedid']][_0x5fef('0x56')];queues[_0x14140a[_0x5fef('0x55')]][_0x5fef('0x37')]=utils['now']();queues[_0x14140a[_0x5fef('0x55')]][_0x5fef('0x36')]=utils['now']();queues[_0x14140a['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x14140a[_0x5fef('0x55')]][_0x5fef('0x57')]=0x0;utils[_0x5fef('0x1')](util[_0x5fef('0xe')](_0x5fef('0x5e'),_0x14140a[_0x5fef('0x4e')],queues[_0x14140a[_0x5fef('0x55')]][_0x5fef('0x1e')],queues[_0x14140a['transfertargetuniqueid']][_0x5fef('0xc')],queues[_0x14140a['transfertargetuniqueid']][_0x5fef('0x6')],queues[_0x14140a[_0x5fef('0x55')]]['calleridname']));}else{utils['info'](util[_0x5fef('0xe')](_0x5fef('0x59'),_0x14140a[_0x5fef('0x4e')],queues[_0x14140a[_0x5fef('0x4f')]][_0x5fef('0x1e')],_0x14140a['origtransfererlinkedid']));queues[_0x14140a[_0x5fef('0x4f')]][_0x5fef('0xc')]=_0x14140a['origtransfererlinkedid'];}}}}catch(_0x217f44){utils['error'](util[_0x5fef('0xe')](_0x5fef('0x4d'),_0x14140a[_0x5fef('0x4e')]),_0x217f44);}};exports[_0x5fef('0x5f')]=function(_0x2dca34){try{if(!_['isNil'](queues[_0x2dca34['uniqueid']])){utils[_0x5fef('0xd')](util[_0x5fef('0xe')](_0x5fef('0x60'),_0x2dca34[_0x5fef('0x3')]),_0x2dca34);queues[_0x2dca34[_0x5fef('0x3')]][_0x5fef('0x61')]=utils[_0x5fef('0x13')]();utils[_0x5fef('0x1')](util[_0x5fef('0xe')](_0x5fef('0x62'),_0x2dca34['uniqueid'],queues[_0x2dca34['uniqueid']][_0x5fef('0x1e')],queues[_0x2dca34[_0x5fef('0x3')]][_0x5fef('0x61')]));}}catch(_0x45e535){utils['error'](util[_0x5fef('0xe')](_0x5fef('0x60'),_0x2dca34[_0x5fef('0x3')]),_0x45e535);}};exports['musiconholdstop']=function(_0x1a9368){try{if(!_[_0x5fef('0x16')](queues[_0x1a9368[_0x5fef('0x3')]])){if(!_[_0x5fef('0x16')](queues[_0x1a9368[_0x5fef('0x3')]]['musiconholdstartAt'])){utils[_0x5fef('0xd')](util['format'](_0x5fef('0x63'),_0x1a9368[_0x5fef('0x3')]),_0x1a9368);queues[_0x1a9368[_0x5fef('0x3')]][_0x5fef('0x57')]+=utils[_0x5fef('0x35')](utils[_0x5fef('0x13')](),queues[_0x1a9368['uniqueid']][_0x5fef('0x61')]);utils[_0x5fef('0x1')](util[_0x5fef('0xe')](_0x5fef('0x64'),_0x1a9368[_0x5fef('0x3')],queues[_0x1a9368[_0x5fef('0x3')]][_0x5fef('0x1e')],queues[_0x1a9368[_0x5fef('0x3')]][_0x5fef('0x57')]));delete queues[_0x1a9368[_0x5fef('0x3')]][_0x5fef('0x61')];}}}catch(_0x176bae){utils[_0x5fef('0x14')](util[_0x5fef('0xe')]('[%s][queues][musiconholdstop]',_0x1a9368[_0x5fef('0x3')]),_0x176bae);}};
\ No newline at end of file
index a67b7bd..b9e449e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe87=['request','CreateVoiceRecording','debug','linkedid','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','[%s][recordings][newstate]','isNil','channelstate','channel','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','push','hangup','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','application','appdata','toLowerCase','set','cdr','split','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','getUserByInternal','accountcode','membername','name','UserId'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xfe87,0x7c));var _0x7fe8=function(_0x59987a,_0x399e11){_0x59987a=_0x59987a-0x0;var _0x460646=_0xfe87[_0x59987a];return _0x460646;};'use strict';var _=require(_0x7fe8('0x0'));var util=require(_0x7fe8('0x1'));var utils=require(_0x7fe8('0x2'));var transfers=require(_0x7fe8('0x3'));var recordings={};function writeDB(_0x3a92b4){var _0x571dcf;utils['info'](util[_0x7fe8('0x4')](_0x7fe8('0x5'),_0x3a92b4[_0x7fe8('0x6')]));if(transfers['blinds'][_0x3a92b4[_0x7fe8('0x6')]]){_0x571dcf=_0x3a92b4[_0x7fe8('0x6')];_0x3a92b4['uniqueid']=transfers[_0x7fe8('0x7')][_0x3a92b4[_0x7fe8('0x6')]][_0x7fe8('0x8')];}if(_0x3a92b4['accountcode']){utils[_0x7fe8('0x9')](_0x3a92b4[_0x7fe8('0xa')])['then'](function(_0x13406c){if(_0x13406c){_0x3a92b4[_0x7fe8('0xb')]=_0x13406c[_0x7fe8('0xc')];_0x3a92b4[_0x7fe8('0xd')]=_0x13406c['id'];}utils[_0x7fe8('0xe')]('CreateVoiceRecording',_0x3a92b4);});}else{utils[_0x7fe8('0xe')](_0x7fe8('0xf'),_0x3a92b4);}if(_0x571dcf)delete transfers[_0x7fe8('0x7')][_0x571dcf];}exports['newchannel']=function(_0x2e576c){try{utils[_0x7fe8('0x10')](util[_0x7fe8('0x4')]('[%s][recordings][newchannel]',_0x2e576c[_0x7fe8('0x6')]),_0x2e576c);if(_0x2e576c['uniqueid']==_0x2e576c[_0x7fe8('0x11')]){utils[_0x7fe8('0x12')](util[_0x7fe8('0x4')](_0x7fe8('0x13'),_0x2e576c[_0x7fe8('0x6')],_0x2e576c[_0x7fe8('0x14')],_0x2e576c['exten']));recordings[_0x2e576c['uniqueid']]={'uniqueid':_0x2e576c[_0x7fe8('0x6')],'accountcode':_0x2e576c[_0x7fe8('0xa')],'exten':_0x2e576c[_0x7fe8('0x15')],'context':_0x2e576c[_0x7fe8('0x14')],'channel':_0x2e576c['channel'],'monitors':[]};}}catch(_0x3f1a63){utils[_0x7fe8('0x16')](util[_0x7fe8('0x4')]('[%s][recordings][newchannel]',_0x2e576c[_0x7fe8('0x6')]),_0x3f1a63);}};exports['newstate']=function(_0x164943){try{utils[_0x7fe8('0x10')](util[_0x7fe8('0x4')](_0x7fe8('0x17'),_0x164943[_0x7fe8('0x6')]),_0x164943);if(!_[_0x7fe8('0x18')](recordings[_0x164943[_0x7fe8('0x6')]])&&_0x164943[_0x7fe8('0x19')]==0x6){utils['info'](util[_0x7fe8('0x4')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x164943[_0x7fe8('0x6')],_0x164943['context'],_0x164943[_0x7fe8('0x1a')]));}else if(!_[_0x7fe8('0x18')](recordings[_0x164943['linkedid']])&&_0x164943[_0x7fe8('0x19')]==0x6&&_0x164943['context']!='transfer'){utils[_0x7fe8('0x12')](util[_0x7fe8('0x4')](_0x7fe8('0x1b'),_0x164943[_0x7fe8('0x6')],_0x164943[_0x7fe8('0x11')],_0x164943[_0x7fe8('0x14')],_0x164943[_0x7fe8('0x1a')]));recordings[_0x164943['linkedid']][_0x7fe8('0xa')]=_0x164943[_0x7fe8('0xa')];}}catch(_0x2b8b7f){utils[_0x7fe8('0x16')](util[_0x7fe8('0x4')](_0x7fe8('0x17'),_0x164943[_0x7fe8('0x6')]),_0x2b8b7f);}};exports[_0x7fe8('0x1c')]=function(_0x17b3e5){try{if(!_[_0x7fe8('0x18')](_0x17b3e5[_0x7fe8('0x1d')])&&!_[_0x7fe8('0x18')](_0x17b3e5['variable']['mixmonitor_filename'])){utils[_0x7fe8('0x10')](util[_0x7fe8('0x4')](_0x7fe8('0x1e'),_0x17b3e5[_0x7fe8('0x6')]),_0x17b3e5);utils[_0x7fe8('0x12')](util[_0x7fe8('0x4')](_0x7fe8('0x1f'),_0x17b3e5['uniqueid'],_0x17b3e5['variable'],_0x17b3e5[_0x7fe8('0x20')]));if(_[_0x7fe8('0x21')](_0x17b3e5[_0x7fe8('0x20')],_0x7fe8('0x22'))){_0x17b3e5[_0x7fe8('0x20')]=_0x17b3e5[_0x7fe8('0x20')][_0x7fe8('0x23')](_0x7fe8('0x22'),_0x7fe8('0x24'));}if(recordings[_0x17b3e5[_0x7fe8('0x11')]]){var _0x382d21=_[_0x7fe8('0x25')](recordings[_0x17b3e5['linkedid']]['monitors'],{'value':_0x17b3e5[_0x7fe8('0x20')]});if(_[_0x7fe8('0x18')](_0x382d21)){recordings[_0x17b3e5['linkedid']][_0x7fe8('0x26')][_0x7fe8('0x27')]({'value':_0x17b3e5[_0x7fe8('0x20')]});}}}}catch(_0x2564fe){utils[_0x7fe8('0x16')](util[_0x7fe8('0x4')](_0x7fe8('0x1e'),_0x17b3e5[_0x7fe8('0x6')]),_0x2564fe);}};exports[_0x7fe8('0x28')]=function(_0x13dc4a){try{if(!_[_0x7fe8('0x18')](recordings[_0x13dc4a[_0x7fe8('0x6')]])){utils[_0x7fe8('0x10')](util[_0x7fe8('0x4')]('[%s][recordings][hangup]',_0x13dc4a[_0x7fe8('0x6')]),_0x13dc4a);utils[_0x7fe8('0x12')](util[_0x7fe8('0x4')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x13dc4a['uniqueid'],_0x13dc4a[_0x7fe8('0x29')],_0x13dc4a[_0x7fe8('0x2a')],_0x13dc4a[_0x7fe8('0x2b')]));recordings[_0x13dc4a[_0x7fe8('0x6')]][_0x7fe8('0x29')]=_0x13dc4a[_0x7fe8('0x29')];recordings[_0x13dc4a[_0x7fe8('0x6')]][_0x7fe8('0x2a')]=_0x13dc4a[_0x7fe8('0x2a')];recordings[_0x13dc4a[_0x7fe8('0x6')]]['connectedlinenum']=_0x13dc4a[_0x7fe8('0x2c')];recordings[_0x13dc4a[_0x7fe8('0x6')]][_0x7fe8('0x2d')]=_0x13dc4a[_0x7fe8('0x2d')];if(recordings[_0x13dc4a['uniqueid']][_0x7fe8('0x2e')]==_0x7fe8('0x2f')&&recordings[_0x13dc4a[_0x7fe8('0x6')]][_0x7fe8('0xa')]){recordings[_0x13dc4a['uniqueid']][_0x7fe8('0x2c')]=recordings[_0x13dc4a[_0x7fe8('0x6')]][_0x7fe8('0xa')];recordings[_0x13dc4a['uniqueid']][_0x7fe8('0x2d')]='';}recordings[_0x13dc4a[_0x7fe8('0x6')]][_0x7fe8('0x26')][_0x7fe8('0x30')](function(_0x1e4cc8){var _0x4b027a=_['clone'](recordings[_0x13dc4a[_0x7fe8('0x6')]]);_0x4b027a[_0x7fe8('0x20')]=_0x1e4cc8[_0x7fe8('0x20')];writeDB(_0x4b027a);});delete recordings[_0x13dc4a[_0x7fe8('0x6')]];}}catch(_0x3c2e0b){utils[_0x7fe8('0x16')](util[_0x7fe8('0x4')]('[%s][recordings][hangup]',_0x13dc4a['uniqueid']),_0x3c2e0b);}};exports[_0x7fe8('0x31')]=function(_0x598d23){try{if(!_['isNil'](recordings[_0x598d23[_0x7fe8('0x6')]])){utils[_0x7fe8('0x10')](util[_0x7fe8('0x4')]('[%s][recordings][newexten]',_0x598d23[_0x7fe8('0x6')]),_0x598d23);utils[_0x7fe8('0x12')](util[_0x7fe8('0x4')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x598d23[_0x7fe8('0x6')],_0x598d23[_0x7fe8('0x32')],_0x598d23[_0x7fe8('0x33')]));if(_0x598d23[_0x7fe8('0x32')][_0x7fe8('0x34')]()==_0x7fe8('0x35')&&_['startsWith'](_0x598d23[_0x7fe8('0x33')][_0x7fe8('0x34')](),_0x7fe8('0x36'))){var _0x332799=_0x598d23[_0x7fe8('0x33')][_0x7fe8('0x37')]('=');var _0x502910=_0x332799[0x0]['substring'](_0x332799[0x0]['lastIndexOf']('(')+0x1,_0x332799[0x0][_0x7fe8('0x38')](')'));var _0x290817=_0x332799[0x1];recordings[_0x598d23[_0x7fe8('0x6')]][_0x502910]=_0x290817;}}}catch(_0x307828){utils[_0x7fe8('0x16')](util[_0x7fe8('0x4')](_0x7fe8('0x39'),_0x598d23[_0x7fe8('0x6')]),_0x307828);}};exports[_0x7fe8('0x3a')]=function(_0x315c7c){try{if(!_[_0x7fe8('0x18')](recordings[_0x315c7c[_0x7fe8('0x6')]])){utils['debug'](util[_0x7fe8('0x4')](_0x7fe8('0x3b'),_0x315c7c[_0x7fe8('0x6')]),_0x315c7c);utils[_0x7fe8('0x12')](util['format'](_0x7fe8('0x3c'),_0x315c7c[_0x7fe8('0x6')],_0x315c7c['queue']));recordings[_0x315c7c['uniqueid']][_0x7fe8('0x3d')]=_0x315c7c[_0x7fe8('0x3d')];}}catch(_0x74237c){utils[_0x7fe8('0x16')](util[_0x7fe8('0x4')](_0x7fe8('0x3b'),_0x315c7c[_0x7fe8('0x6')]),_0x74237c);}};exports[_0x7fe8('0x3e')]=function(_0x13bbc4){try{utils[_0x7fe8('0x10')](util[_0x7fe8('0x4')](_0x7fe8('0x3f'),_0x13bbc4[_0x7fe8('0x6')]),_0x13bbc4);utils[_0x7fe8('0x12')](util[_0x7fe8('0x4')](_0x7fe8('0x40'),_0x13bbc4[_0x7fe8('0x6')],_0x13bbc4['transferercalleridnum'],_0x13bbc4[_0x7fe8('0x41')],_0x13bbc4[_0x7fe8('0x42')],_0x13bbc4['transfereecalleridname']));if(recordings[_0x13bbc4[_0x7fe8('0x43')]]&&transfers[_0x7fe8('0x7')][_0x13bbc4['transfereruniqueid']]){transfers['blinds'][_0x13bbc4[_0x7fe8('0x43')]][_0x7fe8('0x44')]=!![];}}catch(_0x1e40e3){utils['error'](util[_0x7fe8('0x4')](_0x7fe8('0x3f'),_0x13bbc4[_0x7fe8('0x6')]),_0x1e40e3);}};
\ No newline at end of file
+var _0x9029=['set','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','blindtransfer','[%s][recordings][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','util','info','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','UserId','request','newchannel','debug','format','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','[%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]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','type','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase'];(function(_0x1941c9,_0x3a9925){var _0x46a375=function(_0x2afad3){while(--_0x2afad3){_0x1941c9['push'](_0x1941c9['shift']());}};_0x46a375(++_0x3a9925);}(_0x9029,0x1a3));var _0x9902=function(_0x4adec8,_0x18c570){_0x4adec8=_0x4adec8-0x0;var _0x4411e5=_0x9029[_0x4adec8];return _0x4411e5;};'use strict';var _=require('lodash');var util=require(_0x9902('0x0'));var utils=require('./utils');var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x521ca9){var _0x40d73d;utils[_0x9902('0x1')](util['format'](_0x9902('0x2'),_0x521ca9[_0x9902('0x3')]));if(transfers[_0x9902('0x4')][_0x521ca9[_0x9902('0x3')]]){_0x40d73d=_0x521ca9['uniqueid'];_0x521ca9[_0x9902('0x3')]=transfers[_0x9902('0x4')][_0x521ca9[_0x9902('0x3')]][_0x9902('0x5')];}if(_0x521ca9[_0x9902('0x6')]){utils[_0x9902('0x7')](_0x521ca9[_0x9902('0x6')])[_0x9902('0x8')](function(_0x16fb42){if(_0x16fb42){_0x521ca9['membername']=_0x16fb42['name'];_0x521ca9[_0x9902('0x9')]=_0x16fb42['id'];}utils[_0x9902('0xa')]('CreateVoiceRecording',_0x521ca9);});}else{utils[_0x9902('0xa')]('CreateVoiceRecording',_0x521ca9);}if(_0x40d73d)delete transfers[_0x9902('0x4')][_0x40d73d];}exports[_0x9902('0xb')]=function(_0x463fd5){try{utils[_0x9902('0xc')](util[_0x9902('0xd')](_0x9902('0xe'),_0x463fd5['uniqueid']),_0x463fd5);if(_0x463fd5[_0x9902('0x3')]==_0x463fd5[_0x9902('0xf')]){utils['info'](util[_0x9902('0xd')](_0x9902('0x10'),_0x463fd5[_0x9902('0x3')],_0x463fd5[_0x9902('0x11')],_0x463fd5['exten']));recordings[_0x463fd5['uniqueid']]={'uniqueid':_0x463fd5[_0x9902('0x3')],'accountcode':_0x463fd5[_0x9902('0x6')],'exten':_0x463fd5[_0x9902('0x12')],'context':_0x463fd5[_0x9902('0x11')],'channel':_0x463fd5['channel'],'monitors':[]};}}catch(_0x1b91e4){utils[_0x9902('0x13')](util[_0x9902('0xd')](_0x9902('0xe'),_0x463fd5[_0x9902('0x3')]),_0x1b91e4);}};exports[_0x9902('0x14')]=function(_0x1f0d41){try{utils[_0x9902('0xc')](util['format'](_0x9902('0x15'),_0x1f0d41[_0x9902('0x3')]),_0x1f0d41);if(!_[_0x9902('0x16')](recordings[_0x1f0d41[_0x9902('0x3')]])&&_0x1f0d41[_0x9902('0x17')]==0x6){utils['info'](util[_0x9902('0xd')](_0x9902('0x18'),_0x1f0d41[_0x9902('0x3')],_0x1f0d41[_0x9902('0x11')],_0x1f0d41[_0x9902('0x19')]));}else if(!_[_0x9902('0x16')](recordings[_0x1f0d41['linkedid']])&&_0x1f0d41[_0x9902('0x17')]==0x6&&_0x1f0d41['context']!='transfer'){utils[_0x9902('0x1')](util[_0x9902('0xd')](_0x9902('0x1a'),_0x1f0d41[_0x9902('0x3')],_0x1f0d41[_0x9902('0xf')],_0x1f0d41[_0x9902('0x11')],_0x1f0d41[_0x9902('0x19')]));recordings[_0x1f0d41['linkedid']][_0x9902('0x6')]=_0x1f0d41[_0x9902('0x6')];}}catch(_0x39a9c1){utils['error'](util['format'](_0x9902('0x15'),_0x1f0d41[_0x9902('0x3')]),_0x39a9c1);}};exports[_0x9902('0x1b')]=function(_0x5879ab){try{if(!_['isNil'](_0x5879ab[_0x9902('0x1c')])&&!_['isNil'](_0x5879ab[_0x9902('0x1c')]['mixmonitor_filename'])){utils[_0x9902('0xc')](util[_0x9902('0xd')](_0x9902('0x1d'),_0x5879ab[_0x9902('0x3')]),_0x5879ab);utils[_0x9902('0x1')](util[_0x9902('0xd')](_0x9902('0x1e'),_0x5879ab[_0x9902('0x3')],_0x5879ab[_0x9902('0x1c')],_0x5879ab['value']));if(_['endsWith'](_0x5879ab[_0x9902('0x1f')],_0x9902('0x20'))){_0x5879ab['value']=_0x5879ab['value'][_0x9902('0x21')]('.wav49',_0x9902('0x22'));}if(recordings[_0x5879ab[_0x9902('0xf')]]){var _0x379f3e=_[_0x9902('0x23')](recordings[_0x5879ab[_0x9902('0xf')]]['monitors'],{'value':_0x5879ab['value']});if(_[_0x9902('0x16')](_0x379f3e)){recordings[_0x5879ab[_0x9902('0xf')]][_0x9902('0x24')][_0x9902('0x25')]({'value':_0x5879ab[_0x9902('0x1f')]});}}}}catch(_0x13ad48){utils[_0x9902('0x13')](util[_0x9902('0xd')](_0x9902('0x1d'),_0x5879ab[_0x9902('0x3')]),_0x13ad48);}};exports['hangup']=function(_0x4c1d68){try{if(!_[_0x9902('0x16')](recordings[_0x4c1d68[_0x9902('0x3')]])){utils[_0x9902('0xc')](util[_0x9902('0xd')](_0x9902('0x26'),_0x4c1d68['uniqueid']),_0x4c1d68);utils[_0x9902('0x1')](util['format'](_0x9902('0x27'),_0x4c1d68[_0x9902('0x3')],_0x4c1d68[_0x9902('0x28')],_0x4c1d68['calleridname'],_0x4c1d68[_0x9902('0x29')]));recordings[_0x4c1d68[_0x9902('0x3')]][_0x9902('0x28')]=_0x4c1d68[_0x9902('0x28')];recordings[_0x4c1d68[_0x9902('0x3')]][_0x9902('0x2a')]=_0x4c1d68[_0x9902('0x2a')];recordings[_0x4c1d68[_0x9902('0x3')]]['connectedlinenum']=_0x4c1d68[_0x9902('0x2b')];recordings[_0x4c1d68[_0x9902('0x3')]][_0x9902('0x2c')]=_0x4c1d68[_0x9902('0x2c')];if(recordings[_0x4c1d68[_0x9902('0x3')]][_0x9902('0x2d')]=='outbound'&&recordings[_0x4c1d68[_0x9902('0x3')]][_0x9902('0x6')]){recordings[_0x4c1d68[_0x9902('0x3')]][_0x9902('0x2b')]=recordings[_0x4c1d68[_0x9902('0x3')]]['accountcode'];recordings[_0x4c1d68[_0x9902('0x3')]][_0x9902('0x2c')]='';}recordings[_0x4c1d68[_0x9902('0x3')]][_0x9902('0x24')]['forEach'](function(_0x57f288){var _0x397c86=_['clone'](recordings[_0x4c1d68[_0x9902('0x3')]]);_0x397c86[_0x9902('0x1f')]=_0x57f288[_0x9902('0x1f')];writeDB(_0x397c86);});delete recordings[_0x4c1d68['uniqueid']];}}catch(_0x5bc1f6){utils[_0x9902('0x13')](util[_0x9902('0xd')](_0x9902('0x26'),_0x4c1d68[_0x9902('0x3')]),_0x5bc1f6);}};exports['newexten']=function(_0x38db1e){try{if(!_[_0x9902('0x16')](recordings[_0x38db1e[_0x9902('0x3')]])){utils[_0x9902('0xc')](util[_0x9902('0xd')]('[%s][recordings][newexten]',_0x38db1e[_0x9902('0x3')]),_0x38db1e);utils[_0x9902('0x1')](util[_0x9902('0xd')](_0x9902('0x2e'),_0x38db1e[_0x9902('0x3')],_0x38db1e[_0x9902('0x2f')],_0x38db1e[_0x9902('0x30')]));if(_0x38db1e[_0x9902('0x2f')][_0x9902('0x31')]()==_0x9902('0x32')&&_['startsWith'](_0x38db1e[_0x9902('0x30')][_0x9902('0x31')](),_0x9902('0x33'))){var _0x9a55e2=_0x38db1e['appdata'][_0x9902('0x34')]('=');var _0x3cc642=_0x9a55e2[0x0][_0x9902('0x35')](_0x9a55e2[0x0]['lastIndexOf']('(')+0x1,_0x9a55e2[0x0][_0x9902('0x36')](')'));var _0x726260=_0x9a55e2[0x1];recordings[_0x38db1e[_0x9902('0x3')]][_0x3cc642]=_0x726260;}}}catch(_0xbe679c){utils[_0x9902('0x13')](util[_0x9902('0xd')]('[%s][recordings][newexten]',_0x38db1e[_0x9902('0x3')]),_0xbe679c);}};exports[_0x9902('0x37')]=function(_0x10467c){try{if(!_[_0x9902('0x16')](recordings[_0x10467c[_0x9902('0x3')]])){utils[_0x9902('0xc')](util[_0x9902('0xd')]('[%s][recordings][queuecallerjoin]',_0x10467c['uniqueid']),_0x10467c);utils[_0x9902('0x1')](util[_0x9902('0xd')](_0x9902('0x38'),_0x10467c[_0x9902('0x3')],_0x10467c['queue']));recordings[_0x10467c[_0x9902('0x3')]]['queue']=_0x10467c[_0x9902('0x39')];}}catch(_0x3ce715){utils[_0x9902('0x13')](util['format'](_0x9902('0x3a'),_0x10467c[_0x9902('0x3')]),_0x3ce715);}};exports[_0x9902('0x3b')]=function(_0x4d0113){try{utils[_0x9902('0xc')](util['format'](_0x9902('0x3c'),_0x4d0113[_0x9902('0x3')]),_0x4d0113);utils[_0x9902('0x1')](util[_0x9902('0xd')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x4d0113[_0x9902('0x3')],_0x4d0113[_0x9902('0x3d')],_0x4d0113[_0x9902('0x3e')],_0x4d0113[_0x9902('0x3f')],_0x4d0113[_0x9902('0x40')]));if(recordings[_0x4d0113[_0x9902('0x41')]]&&transfers[_0x9902('0x4')][_0x4d0113[_0x9902('0x41')]]){transfers[_0x9902('0x4')][_0x4d0113[_0x9902('0x41')]][_0x9902('0x42')]=!![];}}catch(_0x157aa0){utils[_0x9902('0x13')](util[_0x9902('0xd')]('[%s][recordings][blindtransfer]',_0x4d0113[_0x9902('0x3')]),_0x157aa0);}};
\ No newline at end of file
index 2166f6f..c1aa337 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2740=['transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','lodash','util','./utils','[%s][transfers][writeDB]\x20type:%s','attended','origtransfereruniqueid','uniqueid','type','request','blindtransfer','debug','format','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','blind','blinds','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','info','origtransferercalleridnum','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x2740,0x84));var _0x0274=function(_0x430c62,_0x129472){_0x430c62=_0x430c62-0x0;var _0x4ec150=_0x2740[_0x430c62];return _0x4ec150;};'use strict';var _=require(_0x0274('0x0'));var util=require(_0x0274('0x1'));var utils=require(_0x0274('0x2'));function writeDB(_0x54eca1){utils['info'](util['format'](_0x0274('0x3'),_0x54eca1['type']===_0x0274('0x4')?_0x54eca1[_0x0274('0x5')]:_0x54eca1[_0x0274('0x6')],_0x54eca1[_0x0274('0x7')]));utils[_0x0274('0x8')]('CreateVoiceTransferReport',_0x54eca1);}exports['blinds']={};exports[_0x0274('0x9')]=function(_0x479840){try{utils[_0x0274('0xa')](util[_0x0274('0xb')](_0x0274('0xc'),_0x479840[_0x0274('0x6')]),_0x479840);utils['info'](util[_0x0274('0xb')](_0x0274('0xd'),_0x479840[_0x0274('0x6')],_0x479840[_0x0274('0xe')],_0x479840['transferercalleridname'],_0x479840[_0x0274('0xf')],_0x479840[_0x0274('0x10')]));_0x479840[_0x0274('0x7')]=_0x0274('0x11');exports[_0x0274('0x12')][_0x479840[_0x0274('0x13')]]=_0x479840;writeDB(_0x479840);}catch(_0x2d013d){utils[_0x0274('0x14')](util['format'](_0x0274('0xc'),_0x479840[_0x0274('0x6')]),_0x2d013d);}};exports[_0x0274('0x15')]=function(_0x1f18e5){try{utils[_0x0274('0xa')](util[_0x0274('0xb')](_0x0274('0x16'),_0x1f18e5[_0x0274('0x5')]),_0x1f18e5);utils[_0x0274('0x17')](util[_0x0274('0xb')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x1f18e5[_0x0274('0x5')],_0x1f18e5[_0x0274('0x18')],_0x1f18e5['origtransferercalleridname'],_0x1f18e5[_0x0274('0x19')],_0x1f18e5[_0x0274('0x1a')]));_0x1f18e5=_[_0x0274('0x1b')](_0x1f18e5,{'transfererchannel':_0x1f18e5[_0x0274('0x1c')],'transferercalleridnum':_0x1f18e5['origtransferercalleridnum'],'transferercalleridname':_0x1f18e5[_0x0274('0x1d')],'transfererconnectedlinenum':_0x1f18e5[_0x0274('0x1e')],'transfererconnectedlinename':_0x1f18e5['secondtransfererconnectedlinename'],'transfereraccountcode':_0x1f18e5[_0x0274('0x1f')],'transferercontext':_0x1f18e5[_0x0274('0x20')],'transfererexten':_0x1f18e5['secondtransfererexten'],'transfererlinkedid':_0x1f18e5[_0x0274('0x21')],'context':_0x1f18e5[_0x0274('0x22')],'extension':_0x1f18e5[_0x0274('0x23')],'type':'attended'});if(_[_0x0274('0x24')](_0x1f18e5[_0x0274('0x25')])){_0x1f18e5=_[_0x0274('0x1b')](_0x1f18e5,{'transfereechannel':_0x1f18e5[_0x0274('0x26')],'transfereecalleridnum':_0x1f18e5[_0x0274('0x19')],'transfereecalleridname':_0x1f18e5[_0x0274('0x1a')],'transfereeconnectedlinenum':_0x1f18e5[_0x0274('0x27')],'transfereeconnectedlinename':_0x1f18e5[_0x0274('0x28')],'transfereeaccountcode':_0x1f18e5[_0x0274('0x29')],'transfereecontext':_0x1f18e5[_0x0274('0x2a')],'transfereeexten':_0x1f18e5['transfertargetexten'],'transfereelinkedid':_0x1f18e5['transfertargetlinkedid']});}writeDB(_0x1f18e5);}catch(_0x460543){utils[_0x0274('0x14')](util[_0x0274('0xb')](_0x0274('0x16'),_0x1f18e5['origtransfereruniqueid']),_0x460543);}};
\ No newline at end of file
+var _0x3c1c=['transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','uniqueid','request','CreateVoiceTransferReport','blinds','debug','[%s][transfers][blindtransfer]','transferercalleridnum','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransfereruniqueid','origtransferercalleridnum','transfertargetcalleridnum','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil'];(function(_0xa8958d,_0x5cc4f0){var _0x2b5356=function(_0x33be83){while(--_0x33be83){_0xa8958d['push'](_0xa8958d['shift']());}};_0x2b5356(++_0x5cc4f0);}(_0x3c1c,0x197));var _0xc3c1=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x3c1c[_0x43d11d];return _0x38cd08;};'use strict';var _=require('lodash');var util=require(_0xc3c1('0x0'));var utils=require(_0xc3c1('0x1'));function writeDB(_0x2ef263){utils[_0xc3c1('0x2')](util[_0xc3c1('0x3')](_0xc3c1('0x4'),_0x2ef263[_0xc3c1('0x5')]===_0xc3c1('0x6')?_0x2ef263['origtransfereruniqueid']:_0x2ef263[_0xc3c1('0x7')],_0x2ef263['type']));utils[_0xc3c1('0x8')](_0xc3c1('0x9'),_0x2ef263);}exports[_0xc3c1('0xa')]={};exports['blindtransfer']=function(_0x3ed4af){try{utils[_0xc3c1('0xb')](util['format'](_0xc3c1('0xc'),_0x3ed4af[_0xc3c1('0x7')]),_0x3ed4af);utils[_0xc3c1('0x2')](util[_0xc3c1('0x3')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x3ed4af[_0xc3c1('0x7')],_0x3ed4af[_0xc3c1('0xd')],_0x3ed4af['transferercalleridname'],_0x3ed4af[_0xc3c1('0xe')],_0x3ed4af[_0xc3c1('0xf')]));_0x3ed4af[_0xc3c1('0x5')]=_0xc3c1('0x10');exports[_0xc3c1('0xa')][_0x3ed4af[_0xc3c1('0x11')]]=_0x3ed4af;writeDB(_0x3ed4af);}catch(_0x5d89e3){utils[_0xc3c1('0x12')](util[_0xc3c1('0x3')]('[%s][transfers][blindtransfer]',_0x3ed4af['uniqueid']),_0x5d89e3);}};exports[_0xc3c1('0x13')]=function(_0xe6df53){try{utils[_0xc3c1('0xb')](util['format'](_0xc3c1('0x14'),_0xe6df53['origtransfereruniqueid']),_0xe6df53);utils[_0xc3c1('0x2')](util[_0xc3c1('0x3')](_0xc3c1('0x15'),_0xe6df53[_0xc3c1('0x16')],_0xe6df53[_0xc3c1('0x17')],_0xe6df53['origtransferercalleridname'],_0xe6df53[_0xc3c1('0x18')],_0xe6df53['transfertargetcalleridname']));_0xe6df53=_['assign'](_0xe6df53,{'transfererchannel':_0xe6df53[_0xc3c1('0x19')],'transferercalleridnum':_0xe6df53[_0xc3c1('0x17')],'transferercalleridname':_0xe6df53[_0xc3c1('0x1a')],'transfererconnectedlinenum':_0xe6df53['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0xe6df53[_0xc3c1('0x1b')],'transfereraccountcode':_0xe6df53['origtransfereraccountcode'],'transferercontext':_0xe6df53['secondtransferercontext'],'transfererexten':_0xe6df53[_0xc3c1('0x1c')],'transfererlinkedid':_0xe6df53[_0xc3c1('0x1d')],'context':_0xe6df53[_0xc3c1('0x1e')],'extension':_0xe6df53[_0xc3c1('0x1f')],'type':_0xc3c1('0x6')});if(_[_0xc3c1('0x20')](_0xe6df53['transfereechannel'])){_0xe6df53=_['assign'](_0xe6df53,{'transfereechannel':_0xe6df53[_0xc3c1('0x21')],'transfereecalleridnum':_0xe6df53[_0xc3c1('0x18')],'transfereecalleridname':_0xe6df53[_0xc3c1('0x22')],'transfereeconnectedlinenum':_0xe6df53[_0xc3c1('0x23')],'transfereeconnectedlinename':_0xe6df53[_0xc3c1('0x24')],'transfereeaccountcode':_0xe6df53[_0xc3c1('0x25')],'transfereecontext':_0xe6df53['transfertargetcontext'],'transfereeexten':_0xe6df53[_0xc3c1('0x26')],'transfereelinkedid':_0xe6df53[_0xc3c1('0x27')]});}writeDB(_0xe6df53);}catch(_0x29cb45){utils[_0xc3c1('0x12')](util['format'](_0xc3c1('0x14'),_0xe6df53[_0xc3c1('0x16')]),_0x29cb45);}};
\ No newline at end of file
index bf3f019..4524b66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4771=['then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','found','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','[utils][getUserByName]\x20name:%s\x20%s','GetVoiceQueue','type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','format','subtractTime','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','http','xdr','info','debug','inspect','error','request'];(function(_0x10074b,_0x5064db){var _0x252822=function(_0x3c6a10){while(--_0x3c6a10){_0x10074b['push'](_0x10074b['shift']());}};_0x252822(++_0x5064db);}(_0x4771,0x1d9));var _0x1477=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x4771[_0x5f3f88];return _0xd08119;};'use strict';var BPromise=require(_0x1477('0x0'));var jayson=require(_0x1477('0x1'));var moment=require(_0x1477('0x2'));var util=require(_0x1477('0x3'));var client=jayson['client'][_0x1477('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0x1477('0x5'));exports[_0x1477('0x6')]=function(_0x1730f1,_0x196313){logger[_0x1477('0x6')](_0x1730f1,_0x196313?util['inspect'](_0x196313,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x5abd38,_0x10d965){logger[_0x1477('0x7')](_0x5abd38,_0x10d965?util[_0x1477('0x8')](_0x10d965,{'showHidden':![],'depth':null}):'');};exports[_0x1477('0x9')]=function(_0x3d375b,_0x49049b){logger[_0x1477('0x9')](_0x3d375b,_0x49049b?util[_0x1477('0x8')](_0x49049b,{'showHidden':![],'depth':null}):'');};exports[_0x1477('0xa')]=function(_0x54e166,_0x40f8c6){return client['request'](_0x54e166,{'body':_0x40f8c6})[_0x1477('0xb')](function(_0x50a87b){logger[_0x1477('0x7')](_0x1477('0xc'),_0x54e166,_0x50a87b?util[_0x1477('0x8')](_0x50a87b,{'showHidden':![],'depth':null}):'');})[_0x1477('0xd')](function(_0x2f4bd0){logger[_0x1477('0x9')](_0x1477('0xc'),_0x54e166,_0x2f4bd0?util['inspect'](_0x2f4bd0,{'showHidden':![],'depth':null}):'');});};function getUser(_0x4d9dec){return client[_0x1477('0xa')](_0x1477('0xe'),{'options':{'raw':!![],'attributes':['id',_0x1477('0xf'),_0x1477('0x10'),_0x1477('0x11')],'where':_0x4d9dec,'limit':0x1}})[_0x1477('0xb')](function(_0x2d5ab0){logger[_0x1477('0x7')](_0x1477('0x12'),JSON[_0x1477('0x13')](_0x4d9dec),_0x2d5ab0?util[_0x1477('0x8')](_0x2d5ab0,{'showHidden':![],'depth':null}):'');return _0x2d5ab0[_0x1477('0x14')]['length']?_0x2d5ab0[_0x1477('0x14')][0x0]:null;});}exports[_0x1477('0x15')]=function(_0x1d3a3a){return new BPromise(function(_0x1db44c,_0x174ff4){if(_0x1d3a3a){return getUser({'internal':_0x1d3a3a})[_0x1477('0xb')](function(_0x248f73){logger[_0x1477('0x6')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x1d3a3a,_0x248f73?_0x1477('0x16'):'notfound');return _0x1db44c(_0x248f73);})[_0x1477('0xd')](function(_0x5c7b42){logger[_0x1477('0x9')](_0x1477('0x17'),_0x5c7b42?util['inspect'](_0x5c7b42,{'showHidden':![],'depth':null}):'');return _0x1db44c(null);});}return _0x1db44c(null);});};exports[_0x1477('0x18')]=function(_0x5f4cf5){return new BPromise(function(_0x5c15ed,_0x265b35){if(_0x5f4cf5){return getUser({'interface':_0x5f4cf5})[_0x1477('0xb')](function(_0x424ec4){logger[_0x1477('0x6')](_0x1477('0x19'),_0x5f4cf5,_0x424ec4?'found':_0x1477('0x1a'));return _0x5c15ed(_0x424ec4);})[_0x1477('0xd')](function(_0x352808){logger[_0x1477('0x9')]('[utils][getUserByInterface]',_0x352808?util['inspect'](_0x352808,{'showHidden':![],'depth':null}):'');return _0x5c15ed(null);});}return _0x5c15ed(null);});};exports['getUserByName']=function(_0x32d7d0){return new BPromise(function(_0x28559f,_0xe6c243){if(_0x32d7d0){return getUser({'name':_0x32d7d0})['then'](function(_0x2cc9af){logger[_0x1477('0x6')](_0x1477('0x1b'),_0x32d7d0,_0x2cc9af?_0x1477('0x16'):_0x1477('0x1a'));return _0x28559f(_0x2cc9af);})['catch'](function(_0x43ad8d){logger[_0x1477('0x9')]('[utils][getUserByName]',_0x43ad8d?util['inspect'](_0x43ad8d,{'showHidden':![],'depth':null}):'');return _0x28559f(null);});}return _0x28559f(null);});};exports['getVoiceQueueByName']=function(_0x38b948){return new BPromise(function(_0x7cfa42,_0xc0dd69){if(_0x38b948){return client[_0x1477('0xa')](_0x1477('0x1c'),{'options':{'raw':!![],'attributes':['id','name',_0x1477('0x1d'),_0x1477('0x1e'),'acwTimeout'],'where':{'name':_0x38b948},'limit':0x1}})['then'](function(_0x5aea66){logger[_0x1477('0x7')](_0x1477('0x1f'),_0x38b948,_0x5aea66?util[_0x1477('0x8')](_0x5aea66,{'showHidden':![],'depth':null}):'');logger[_0x1477('0x6')](_0x1477('0x20'),_0x38b948,_0x5aea66?_0x1477('0x16'):_0x1477('0x1a'));return _0x7cfa42(_0x5aea66[_0x1477('0x14')]['length']?_0x5aea66[_0x1477('0x14')][0x0]:null);})[_0x1477('0xd')](function(_0x80fe64){logger[_0x1477('0x9')]('[utils][getVoiceQueueByName]',_0x80fe64?util[_0x1477('0x8')](_0x80fe64,{'showHidden':![],'depth':null}):'');return _0x7cfa42(null);});}return _0x7cfa42(null);});};exports[_0x1477('0x21')]=function(_0x369104,_0x3c73c8){return moment(_0x369104)['add'](_0x3c73c8,'seconds')[_0x1477('0x22')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x1477('0x23')]=function(_0x45c981,_0x205691){return moment(_0x45c981)[_0x1477('0x24')](_0x205691,_0x1477('0x25'))[_0x1477('0x22')](_0x1477('0x26'));};exports['diffTime']=function(_0x1bdd22,_0x2c5fdb){return moment(_0x1bdd22)[_0x1477('0x27')](moment(_0x2c5fdb),_0x1477('0x25'));};exports[_0x1477('0x28')]=function(_0x3649d0,_0x3e699a){return parseInt(_0x3649d0,0xa)+parseInt(_0x3e699a,0xa);};exports[_0x1477('0x29')]=function(){return moment()['format'](_0x1477('0x26'));};exports[_0x1477('0x2a')]=function(_0x419f0e,_0x3ca7f8){if(_0x3ca7f8){return moment(_0x419f0e)['isAfter'](_0x3ca7f8);}return!![];};exports['isBefore']=function(_0x39643d,_0x168ab7){if(_0x168ab7){return moment(_0x39643d)[_0x1477('0x2b')](_0x168ab7);}else if(_0x39643d){return!![];}return![];};
\ No newline at end of file
+var _0x5eb6=['seconds','subtractTime','subtract','diffTime','sumTime','now','format','YYYY-MM-DD\x20HH:mm:ss','isAfter','isBefore','bluebird','jayson/promise','moment','util','http','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','internal','name','stringify','result','getUserByInternal','found','notfound','catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','length','[utils][getVoiceQueueByName]','addTime','add'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5eb6,0x9a));var _0x65eb=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x5eb6[_0x178e48];return _0x440d7e;};'use strict';var BPromise=require(_0x65eb('0x0'));var jayson=require(_0x65eb('0x1'));var moment=require(_0x65eb('0x2'));var util=require(_0x65eb('0x3'));var client=jayson['client'][_0x65eb('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0x65eb('0x5'));exports['info']=function(_0x217c40,_0x3bb783){logger[_0x65eb('0x6')](_0x217c40,_0x3bb783?util[_0x65eb('0x7')](_0x3bb783,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x2b87c7,_0x24db8b){logger[_0x65eb('0x8')](_0x2b87c7,_0x24db8b?util[_0x65eb('0x7')](_0x24db8b,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x4b3f07,_0x5d5634){logger[_0x65eb('0x9')](_0x4b3f07,_0x5d5634?util[_0x65eb('0x7')](_0x5d5634,{'showHidden':![],'depth':null}):'');};exports[_0x65eb('0xa')]=function(_0x461a5f,_0x473d47){return client[_0x65eb('0xa')](_0x461a5f,{'body':_0x473d47})[_0x65eb('0xb')](function(_0x438e6c){logger[_0x65eb('0x8')](_0x65eb('0xc'),_0x461a5f,_0x438e6c?util[_0x65eb('0x7')](_0x438e6c,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x2c5295){logger[_0x65eb('0x9')]('[utils][request]\x20name:%s',_0x461a5f,_0x2c5295?util['inspect'](_0x2c5295,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3e1262){return client['request']('GetUser',{'options':{'raw':!![],'attributes':['id',_0x65eb('0xd'),_0x65eb('0xe'),'interface'],'where':_0x3e1262,'limit':0x1}})[_0x65eb('0xb')](function(_0x2a48f3){logger[_0x65eb('0x8')]('[utils][getUser]\x20where:%s',JSON[_0x65eb('0xf')](_0x3e1262),_0x2a48f3?util['inspect'](_0x2a48f3,{'showHidden':![],'depth':null}):'');return _0x2a48f3[_0x65eb('0x10')]['length']?_0x2a48f3[_0x65eb('0x10')][0x0]:null;});}exports[_0x65eb('0x11')]=function(_0x59ced){return new BPromise(function(_0x211b78,_0x160d8b){if(_0x59ced){return getUser({'internal':_0x59ced})['then'](function(_0x2b5633){logger[_0x65eb('0x6')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x59ced,_0x2b5633?_0x65eb('0x12'):_0x65eb('0x13'));return _0x211b78(_0x2b5633);})[_0x65eb('0x14')](function(_0x3f56a0){logger[_0x65eb('0x9')](_0x65eb('0x15'),_0x3f56a0?util[_0x65eb('0x7')](_0x3f56a0,{'showHidden':![],'depth':null}):'');return _0x211b78(null);});}return _0x211b78(null);});};exports[_0x65eb('0x16')]=function(_0x3a9e17){return new BPromise(function(_0x5679a3,_0x501c58){if(_0x3a9e17){return getUser({'interface':_0x3a9e17})[_0x65eb('0xb')](function(_0x4bdbae){logger[_0x65eb('0x6')](_0x65eb('0x17'),_0x3a9e17,_0x4bdbae?_0x65eb('0x12'):_0x65eb('0x13'));return _0x5679a3(_0x4bdbae);})['catch'](function(_0xbc2f62){logger[_0x65eb('0x9')](_0x65eb('0x18'),_0xbc2f62?util[_0x65eb('0x7')](_0xbc2f62,{'showHidden':![],'depth':null}):'');return _0x5679a3(null);});}return _0x5679a3(null);});};exports[_0x65eb('0x19')]=function(_0x24bb30){return new BPromise(function(_0xf7680d,_0x3e8bb2){if(_0x24bb30){return getUser({'name':_0x24bb30})['then'](function(_0x2b56a1){logger[_0x65eb('0x6')](_0x65eb('0x1a'),_0x24bb30,_0x2b56a1?_0x65eb('0x12'):_0x65eb('0x13'));return _0xf7680d(_0x2b56a1);})[_0x65eb('0x14')](function(_0x50faff){logger['error'](_0x65eb('0x1b'),_0x50faff?util['inspect'](_0x50faff,{'showHidden':![],'depth':null}):'');return _0xf7680d(null);});}return _0xf7680d(null);});};exports[_0x65eb('0x1c')]=function(_0x106b2d){return new BPromise(function(_0x5bba28,_0x440e88){if(_0x106b2d){return client[_0x65eb('0xa')](_0x65eb('0x1d'),{'options':{'raw':!![],'attributes':['id',_0x65eb('0xe'),_0x65eb('0x1e'),_0x65eb('0x1f'),_0x65eb('0x20')],'where':{'name':_0x106b2d},'limit':0x1}})['then'](function(_0x5c7f34){logger[_0x65eb('0x8')](_0x65eb('0x21'),_0x106b2d,_0x5c7f34?util[_0x65eb('0x7')](_0x5c7f34,{'showHidden':![],'depth':null}):'');logger[_0x65eb('0x6')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x106b2d,_0x5c7f34?_0x65eb('0x12'):'notfound');return _0x5bba28(_0x5c7f34[_0x65eb('0x10')][_0x65eb('0x22')]?_0x5c7f34['result'][0x0]:null);})[_0x65eb('0x14')](function(_0x3539ee){logger['error'](_0x65eb('0x23'),_0x3539ee?util[_0x65eb('0x7')](_0x3539ee,{'showHidden':![],'depth':null}):'');return _0x5bba28(null);});}return _0x5bba28(null);});};exports[_0x65eb('0x24')]=function(_0x49d2f8,_0x33240e){return moment(_0x49d2f8)[_0x65eb('0x25')](_0x33240e,_0x65eb('0x26'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x65eb('0x27')]=function(_0x3e0c79,_0x42ee14){return moment(_0x3e0c79)[_0x65eb('0x28')](_0x42ee14,_0x65eb('0x26'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x65eb('0x29')]=function(_0x17e9b9,_0x57c81f){return moment(_0x17e9b9)['diff'](moment(_0x57c81f),'seconds');};exports[_0x65eb('0x2a')]=function(_0x3e23fd,_0xd94845){return parseInt(_0x3e23fd,0xa)+parseInt(_0xd94845,0xa);};exports[_0x65eb('0x2b')]=function(){return moment()[_0x65eb('0x2c')](_0x65eb('0x2d'));};exports[_0x65eb('0x2e')]=function(_0xd57b11,_0x373f32){if(_0x373f32){return moment(_0xd57b11)[_0x65eb('0x2e')](_0x373f32);}return!![];};exports[_0x65eb('0x2f')]=function(_0x29e184,_0x2a8f53){if(_0x2a8f53){return moment(_0x29e184)[_0x65eb('0x2f')](_0x2a8f53);}else if(_0x29e184){return!![];}return![];};
\ No newline at end of file
index 6066b62..730f2fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa099=['express-winston','path','./loggers','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','/var','log','xcally','join','name','ensureDir','catch','user','then','no-user','data','client','api','auth','client-side-logger','logger','isEmpty','body','format','method','x-forwarded-for','headers','connection','remoteAddress','url','responseTime','role','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','statusCode','device','agent_name','setupLoggers','fs-extra'];(function(_0xb68190,_0x2da4f9){var _0x5885f6=function(_0x5a4797){while(--_0x5a4797){_0xb68190['push'](_0xb68190['shift']());}};_0x5885f6(++_0x2da4f9);}(_0xa099,0x18b));var _0x9a09=function(_0x1f220e,_0x3a9cdc){_0x1f220e=_0x1f220e-0x0;var _0x930f26=_0xa099[_0x1f220e];return _0x930f26;};var fs=require(_0x9a09('0x0'));var _=require('lodash');var ewinston=require(_0x9a09('0x1'));var path=require(_0x9a09('0x2'));var util=require('util');var fileLogger=require(_0x9a09('0x3'))['fileLogger'];var safeTemplate=require(_0x9a09('0x4'))[_0x9a09('0x5')];var maskSensitiveData=require(_0x9a09('0x6'))[_0x9a09('0x7')];function ClientSideLogger(){function _0x72b098(_0x4e31a7){var _0x37b293=path['join'](_0x9a09('0x8'),_0x9a09('0x9'),_0x9a09('0xa'));var _0xcee9f1=path[_0x9a09('0xb')]('client',_0x4e31a7['role']+'-'+_0x4e31a7[_0x9a09('0xc')]);return fs[_0x9a09('0xd')](path[_0x9a09('0xb')](_0x37b293,_0xcee9f1))['then'](function(){var _0x3cd799=fileLogger('client',path['join'](_0x37b293,_0xcee9f1));return _0x3cd799;})[_0x9a09('0xe')](function(_0x59071f){throw _0x59071f;});}this['log']=function(_0x1684e8,_0x3c4a73,_0x5928e1,_0x4d6aeb){return _0x72b098(_0x1684e8[_0x9a09('0xf')])['then'](function(_0x1e9ce3){var _0x26f4f0=_0x1e9ce3[_0x3c4a73];return _0x26f4f0;})[_0x9a09('0x10')](function(_0x31a82b){var _0x556ad6=_0x1684e8[_0x9a09('0xf')]?_0x1684e8[_0x9a09('0xf')]['id']:_0x9a09('0x11');var _0x81f0b9=_0x4d6aeb[_0x9a09('0x12')];var _0x54078a=_0x4d6aeb['timestamp'];var _0x4fe198=new Date(Number(_0x54078a));return _0x31a82b(_0x556ad6,_0x4fe198,_0x5928e1,_0x81f0b9);})['catch'](function(_0x376a86){fileLogger(_0x9a09('0x13'))['error'](_0x376a86);});};}function setupLoggers(_0x1811e6){return new Promise(function(_0x19d378){var _0x3e30cb=new ClientSideLogger();var _0x361b8b=fileLogger(_0x9a09('0x14'));var _0x54cdb8=fileLogger(_0x9a09('0x15'));_0x1811e6['set'](_0x9a09('0x16'),_0x3e30cb);_0x1811e6['use'](ewinston[_0x9a09('0x17')]({'winstonInstance':_0x361b8b,'meta':![],'statusLevels':!![],'msg':function(_0x295482,_0x446b38){var _0x57dd03='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x9a09('0x18')](_0x295482[_0x9a09('0x19')])){_0x57dd03+='\x20body=%s';var _0x267787=_0x295482[_0x9a09('0x19')];maskSensitiveData(_0x267787);}return safeTemplate(util[_0x9a09('0x1a')](_0x57dd03,_0x295482[_0x9a09('0x1b')],_0x295482['headers'][_0x9a09('0x1c')]?_0x295482[_0x9a09('0x1d')][_0x9a09('0x1c')]:_0x295482[_0x9a09('0x1e')][_0x9a09('0x1f')]||_0x295482['ip'],_0x295482[_0x9a09('0x20')],_0x446b38['statusCode'],_0x446b38[_0x9a09('0x21')],_0x295482['user']?_0x295482[_0x9a09('0xf')]['id']:null,_0x295482[_0x9a09('0xf')]?_0x295482['user'][_0x9a09('0xc')]:null,_0x295482[_0x9a09('0xf')]?_0x295482[_0x9a09('0xf')][_0x9a09('0x22')]:null,_0x267787?util[_0x9a09('0x23')](_0x267787,![],null):''));}}));_0x1811e6[_0x9a09('0x24')](ewinston['logger']({'winstonInstance':_0x54cdb8,'meta':![],'statusLevels':!![],'msg':function(_0x9c97b8,_0x1afb62){var _0x14196a=_0x9a09('0x25');if(_0x9c97b8[_0x9a09('0x19')]&&_0x9c97b8[_0x9a09('0x19')]['device']&&_0x9c97b8['body'][_0x9a09('0x26')]){_0x14196a=_0x9a09('0x27');}return util[_0x9a09('0x1a')](_0x14196a,_0x9c97b8[_0x9a09('0x1b')],_0x9c97b8[_0x9a09('0x1d')][_0x9a09('0x1c')]?_0x9c97b8[_0x9a09('0x1d')]['x-forwarded-for']:_0x9c97b8[_0x9a09('0x1e')][_0x9a09('0x1f')]||_0x9c97b8['ip'],_0x9c97b8[_0x9a09('0x20')],_0x1afb62[_0x9a09('0x28')],_0x1afb62[_0x9a09('0x21')],_0x9c97b8[_0x9a09('0xf')]?_0x9c97b8[_0x9a09('0xf')]['id']:null,_0x9c97b8['user']?_0x9c97b8[_0x9a09('0xf')]['name']:null,_0x9c97b8[_0x9a09('0xf')]?_0x9c97b8[_0x9a09('0xf')][_0x9a09('0x22')]:null,_0x9c97b8['body']&&_0x9c97b8[_0x9a09('0x19')][_0x9a09('0x29')]?_0x9c97b8[_0x9a09('0x19')][_0x9a09('0x29')]:'other',_0x9c97b8[_0x9a09('0x19')]&&_0x9c97b8[_0x9a09('0x19')][_0x9a09('0x26')]?_0x9c97b8[_0x9a09('0x19')]['agent_id']:'',_0x9c97b8[_0x9a09('0x19')]&&_0x9c97b8[_0x9a09('0x19')][_0x9a09('0x2a')]?_0x9c97b8[_0x9a09('0x19')][_0x9a09('0x2a')]:'');},'ignoreRoute':function(_0x372d39){var _0x38e9c0=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x38e9c0['test'](_0x372d39[_0x9a09('0x20')]);}}));return _0x19d378();});}exports[_0x9a09('0x2b')]=setupLoggers;
\ No newline at end of file
+var _0x05d7=['responseTime','inspect','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','x-forwarded-for','statusCode','other','agent_name','fs-extra','path','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','/var','log','xcally','join','role','name','ensureDir','then','client','catch','user','timestamp','api','set','client-side-logger','use','isEmpty','body','\x20body=%s','format','method','headers','remoteAddress','url'];(function(_0x2116db,_0x270ae3){var _0x5ed498=function(_0x29fce4){while(--_0x29fce4){_0x2116db['push'](_0x2116db['shift']());}};_0x5ed498(++_0x270ae3);}(_0x05d7,0x197));var _0x705d=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x05d7[_0xfae23b];return _0x200640;};var fs=require(_0x705d('0x0'));var _=require('lodash');var ewinston=require('express-winston');var path=require(_0x705d('0x1'));var util=require(_0x705d('0x2'));var fileLogger=require(_0x705d('0x3'))[_0x705d('0x4')];var safeTemplate=require(_0x705d('0x5'))[_0x705d('0x6')];var maskSensitiveData=require(_0x705d('0x7'))[_0x705d('0x8')];function ClientSideLogger(){function _0x1a2561(_0x3b9397){var _0x22558b=path['join'](_0x705d('0x9'),_0x705d('0xa'),_0x705d('0xb'));var _0x4d8185=path[_0x705d('0xc')]('client',_0x3b9397[_0x705d('0xd')]+'-'+_0x3b9397[_0x705d('0xe')]);return fs[_0x705d('0xf')](path[_0x705d('0xc')](_0x22558b,_0x4d8185))[_0x705d('0x10')](function(){var _0x599ef3=fileLogger(_0x705d('0x11'),path[_0x705d('0xc')](_0x22558b,_0x4d8185));return _0x599ef3;})[_0x705d('0x12')](function(_0x44fb3e){throw _0x44fb3e;});}this['log']=function(_0x2c6b9d,_0x3fcae0,_0x21ec25,_0x62463a){return _0x1a2561(_0x2c6b9d[_0x705d('0x13')])[_0x705d('0x10')](function(_0x2f9bad){var _0x5d3e8e=_0x2f9bad[_0x3fcae0];return _0x5d3e8e;})[_0x705d('0x10')](function(_0x5dd777){var _0x1196fe=_0x2c6b9d[_0x705d('0x13')]?_0x2c6b9d[_0x705d('0x13')]['id']:'no-user';var _0x20f160=_0x62463a['data'];var _0x2ca760=_0x62463a[_0x705d('0x14')];var _0x6d870e=new Date(Number(_0x2ca760));return _0x5dd777(_0x1196fe,_0x6d870e,_0x21ec25,_0x20f160);})[_0x705d('0x12')](function(_0xb9a12f){fileLogger(_0x705d('0x11'))['error'](_0xb9a12f);});};}function setupLoggers(_0x59ba06){return new Promise(function(_0xee2fe){var _0x2ef277=new ClientSideLogger();var _0xbb0979=fileLogger(_0x705d('0x15'));var _0x262599=fileLogger('auth');_0x59ba06[_0x705d('0x16')](_0x705d('0x17'),_0x2ef277);_0x59ba06[_0x705d('0x18')](ewinston['logger']({'winstonInstance':_0xbb0979,'meta':![],'statusLevels':!![],'msg':function(_0xf9f158,_0x110f50){var _0x1359de='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x705d('0x19')](_0xf9f158[_0x705d('0x1a')])){_0x1359de+=_0x705d('0x1b');var _0x545538=_0xf9f158[_0x705d('0x1a')];maskSensitiveData(_0x545538);}return safeTemplate(util[_0x705d('0x1c')](_0x1359de,_0xf9f158[_0x705d('0x1d')],_0xf9f158['headers']['x-forwarded-for']?_0xf9f158[_0x705d('0x1e')]['x-forwarded-for']:_0xf9f158['connection'][_0x705d('0x1f')]||_0xf9f158['ip'],_0xf9f158[_0x705d('0x20')],_0x110f50['statusCode'],_0x110f50[_0x705d('0x21')],_0xf9f158[_0x705d('0x13')]?_0xf9f158[_0x705d('0x13')]['id']:null,_0xf9f158[_0x705d('0x13')]?_0xf9f158['user'][_0x705d('0xe')]:null,_0xf9f158[_0x705d('0x13')]?_0xf9f158[_0x705d('0x13')][_0x705d('0xd')]:null,_0x545538?util[_0x705d('0x22')](_0x545538,![],null):''));}}));_0x59ba06[_0x705d('0x18')](ewinston[_0x705d('0x23')]({'winstonInstance':_0x262599,'meta':![],'statusLevels':!![],'msg':function(_0x10a50a,_0x4d04dc){var _0x264bfd=_0x705d('0x24');if(_0x10a50a['body']&&_0x10a50a['body'][_0x705d('0x25')]&&_0x10a50a[_0x705d('0x1a')][_0x705d('0x26')]){_0x264bfd=_0x705d('0x27');}return util[_0x705d('0x1c')](_0x264bfd,_0x10a50a[_0x705d('0x1d')],_0x10a50a[_0x705d('0x1e')][_0x705d('0x28')]?_0x10a50a[_0x705d('0x1e')]['x-forwarded-for']:_0x10a50a['connection'][_0x705d('0x1f')]||_0x10a50a['ip'],_0x10a50a[_0x705d('0x20')],_0x4d04dc[_0x705d('0x29')],_0x4d04dc[_0x705d('0x21')],_0x10a50a['user']?_0x10a50a[_0x705d('0x13')]['id']:null,_0x10a50a['user']?_0x10a50a[_0x705d('0x13')][_0x705d('0xe')]:null,_0x10a50a[_0x705d('0x13')]?_0x10a50a['user']['role']:null,_0x10a50a[_0x705d('0x1a')]&&_0x10a50a['body']['device']?_0x10a50a[_0x705d('0x1a')][_0x705d('0x25')]:_0x705d('0x2a'),_0x10a50a[_0x705d('0x1a')]&&_0x10a50a[_0x705d('0x1a')][_0x705d('0x26')]?_0x10a50a[_0x705d('0x1a')][_0x705d('0x26')]:'',_0x10a50a[_0x705d('0x1a')]&&_0x10a50a[_0x705d('0x1a')][_0x705d('0x2b')]?_0x10a50a[_0x705d('0x1a')]['agent_name']:'');},'ignoreRoute':function(_0x46b520){var _0x5f131b=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5f131b['test'](_0x46b520[_0x705d('0x20')]);}}));return _0xee2fe();});}exports['setupLoggers']=setupLoggers;
\ No newline at end of file
index c942f2e..eca76a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6815=['redBG\x20white','red','bold\x20yellow','bold\x20white','bold\x20green','bold\x20magenta','bold\x20blue','bold\x20cyan','join','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','warn','error','File','%s-%s','Console','consoleLogger','moment','winston','../config/environment','debugLevel'];(function(_0x14625d,_0x5a7037){var _0x36c95c=function(_0x27b8f6){while(--_0x27b8f6){_0x14625d['push'](_0x14625d['shift']());}};_0x36c95c(++_0x5a7037);}(_0x6815,0x194));var _0x5681=function(_0x4eaf70,_0x272911){_0x4eaf70=_0x4eaf70-0x0;var _0x66143e=_0x6815[_0x4eaf70];return _0x66143e;};'use strict';var path=require('path');var util=require('util');var moment=require(_0x5681('0x0'));var winston=require(_0x5681('0x1'));var config=require(_0x5681('0x2'));var debugLevel=config[_0x5681('0x3')]?config[_0x5681('0x3')]['toLowerCase']():'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':_0x5681('0x4'),'error':_0x5681('0x5'),'warn':_0x5681('0x6'),'info':'white','print':_0x5681('0x7'),'success':_0x5681('0x8'),'http':'gray','verbose':_0x5681('0x9'),'debug':_0x5681('0xa'),'silly':_0x5681('0xb')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x292bd6,_0x5c7749,_0x3533a5){var _0x1de2d8=_0x292bd6||'/var/log/xcally';return path[_0x5681('0xc')](_0x1de2d8,util[_0x5681('0xd')](_0x5681('0xe'),_0x5c7749,_0x3533a5));}function formatter(_0x29524a,_0x46a05f){_0x46a05f[_0x5681('0xf')]=_0x46a05f[_0x5681('0xf')][_0x5681('0x10')](/@@{/g,_0x5681('0x11'))[_0x5681('0x10')](/}@@/g,_0x5681('0x12'))[_0x5681('0x10')](/@{/g,'{{')[_0x5681('0x10')](/}@/g,'}}');return util[_0x5681('0xd')](_0x5681('0x13'),moment()[_0x5681('0xd')](_0x5681('0x14')),_0x46a05f[_0x5681('0x15')][_0x5681('0x16')](),_0x29524a,_0x46a05f[_0x5681('0xf')]);}function fileFormat(_0x459672,_0x5bd4ed){_0x5bd4ed[_0x5681('0xf')]=_0x5bd4ed[_0x5681('0xf')]['replace'](/@@{/g,_0x5681('0x11'))[_0x5681('0x10')](/}@@/g,'}}}')[_0x5681('0x10')](/@{/g,'{{')[_0x5681('0x10')](/}@/g,'}}');var _0x5535ea=_0x5bd4ed[_0x5681('0x17')]&&Object['keys'](_0x5bd4ed['meta'])[_0x5681('0x18')]?'\x0a\x09'+JSON['stringify'](_0x5bd4ed['meta']):'';return util[_0x5681('0xd')](_0x5681('0x19'),moment()[_0x5681('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),_0x5bd4ed['level'][_0x5681('0x16')](),_0x459672,_0x5bd4ed[_0x5681('0xf')],_0x5535ea);}function consoleLogger(){var _0x1b2f9a=new winston[(_0x5681('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x5681('0x1b'))]['Console']({'level':_0x5681('0x1c'),'json':![],'formatter':function(_0x3429b6){return formatter('',_0x3429b6);}})]});return _0x1b2f9a;}function fileLogger(_0x50b77e,_0x5c951f){var _0x1b8b6b=new winston[(_0x5681('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x5681('0x1b'))]['File']({'name':util[_0x5681('0xd')]('%s-%s',_0x50b77e,_0x5681('0x1d')),'filename':getLogFileName(_0x5c951f,_0x50b77e,_0x5681('0x1d')),'level':_0x5681('0x1d'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x163ef9){return fileFormat(_0x50b77e,_0x163ef9);}}),new winston['transports'][(_0x5681('0x1e'))]({'name':util[_0x5681('0xd')](_0x5681('0x1f'),_0x50b77e,debugLevel),'filename':getLogFileName(_0x5c951f,_0x50b77e,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x509d04){return fileFormat(_0x50b77e,_0x509d04);}}),new winston[(_0x5681('0x1b'))][(_0x5681('0x20'))]({'level':_0x5681('0x1c'),'json':![],'formatter':function(_0x4345e2){return fileFormat(_0x50b77e,_0x4345e2);}})]});return _0x1b8b6b;}exports[_0x5681('0x21')]=consoleLogger;exports['fileLogger']=fileLogger;
\ No newline at end of file
+var _0xdc28=['../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','gray','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','toUpperCase','{{{','meta','stringify','Logger','Console','warn','transports','File','%s-%s','error','consoleLogger','fileLogger','path','util'];(function(_0x300c89,_0x25fcad){var _0x41762e=function(_0x5b852f){while(--_0x5b852f){_0x300c89['push'](_0x300c89['shift']());}};_0x41762e(++_0x25fcad);}(_0xdc28,0xd0));var _0x8dc2=function(_0x4990b9,_0x2ca1fe){_0x4990b9=_0x4990b9-0x0;var _0xa46569=_0xdc28[_0x4990b9];return _0xa46569;};'use strict';var path=require(_0x8dc2('0x0'));var util=require(_0x8dc2('0x1'));var moment=require('moment');var winston=require('winston');var config=require(_0x8dc2('0x2'));var debugLevel=config[_0x8dc2('0x3')]?config[_0x8dc2('0x3')][_0x8dc2('0x4')]():_0x8dc2('0x5');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x8dc2('0x6'),'error':_0x8dc2('0x7'),'warn':_0x8dc2('0x8'),'info':_0x8dc2('0x9'),'print':_0x8dc2('0xa'),'success':'bold\x20green','http':_0x8dc2('0xb'),'verbose':'bold\x20magenta','debug':'bold\x20blue','silly':_0x8dc2('0xc')};winston[_0x8dc2('0xd')](XC_LOG_COLORS);function getLogFileName(_0x9060a7,_0x285a47,_0x1f9101){var _0x1a976e=_0x9060a7||_0x8dc2('0xe');return path[_0x8dc2('0xf')](_0x1a976e,util[_0x8dc2('0x10')](_0x8dc2('0x11'),_0x285a47,_0x1f9101));}function formatter(_0x41d6f0,_0x4a98c1){_0x4a98c1[_0x8dc2('0x12')]=_0x4a98c1[_0x8dc2('0x12')][_0x8dc2('0x13')](/@@{/g,'{{{')[_0x8dc2('0x13')](/}@@/g,_0x8dc2('0x14'))[_0x8dc2('0x13')](/@{/g,'{{')[_0x8dc2('0x13')](/}@/g,'}}');return util[_0x8dc2('0x10')](_0x8dc2('0x15'),moment()[_0x8dc2('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),_0x4a98c1['level'][_0x8dc2('0x16')](),_0x41d6f0,_0x4a98c1[_0x8dc2('0x12')]);}function fileFormat(_0x4b88f0,_0x46846c){_0x46846c[_0x8dc2('0x12')]=_0x46846c[_0x8dc2('0x12')]['replace'](/@@{/g,_0x8dc2('0x17'))[_0x8dc2('0x13')](/}@@/g,_0x8dc2('0x14'))[_0x8dc2('0x13')](/@{/g,'{{')[_0x8dc2('0x13')](/}@/g,'}}');var _0x2c2ae6=_0x46846c[_0x8dc2('0x18')]&&Object['keys'](_0x46846c[_0x8dc2('0x18')])['length']?'\x0a\x09'+JSON[_0x8dc2('0x19')](_0x46846c['meta']):'';return util[_0x8dc2('0x10')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x46846c['level'][_0x8dc2('0x16')](),_0x4b88f0,_0x46846c[_0x8dc2('0x12')],_0x2c2ae6);}function consoleLogger(){var _0x564cb7=new winston[(_0x8dc2('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x8dc2('0x1b'))]({'level':_0x8dc2('0x1c'),'json':![],'formatter':function(_0x34c4c3){return formatter('',_0x34c4c3);}})]});return _0x564cb7;}function fileLogger(_0xf4b209,_0x126673){var _0x33649b=new winston[(_0x8dc2('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x8dc2('0x1d'))][(_0x8dc2('0x1e'))]({'name':util[_0x8dc2('0x10')](_0x8dc2('0x1f'),_0xf4b209,'error'),'filename':getLogFileName(_0x126673,_0xf4b209,'error'),'level':_0x8dc2('0x20'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xc38bb5){return fileFormat(_0xf4b209,_0xc38bb5);}}),new winston[(_0x8dc2('0x1d'))]['File']({'name':util['format']('%s-%s',_0xf4b209,debugLevel),'filename':getLogFileName(_0x126673,_0xf4b209,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x551059){return fileFormat(_0xf4b209,_0x551059);}}),new winston['transports'][(_0x8dc2('0x1b'))]({'level':_0x8dc2('0x1c'),'json':![],'formatter':function(_0x5d7389){return fileFormat(_0xf4b209,_0x5d7389);}})]});return _0x33649b;}exports[_0x8dc2('0x21')]=consoleLogger;exports[_0x8dc2('0x22')]=fileLogger;
\ No newline at end of file
index e2e7d6b..87e29bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['replace','}@@','includes','exports','maskSensitiveData','lodash','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientSecret','code','accessKey','tenantId','channelSecret','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','accesskeyid','secretaccesskey','key','user','pass','accountSid','localstationid','dsn','secret','registry','isPlainObject','isArray','length','isString'];(function(_0x21f3bf,_0xfb0f59){var _0x249d08=function(_0x37e6c2){while(--_0x37e6c2){_0x21f3bf['push'](_0x21f3bf['shift']());}};_0x249d08(++_0xfb0f59);}(_0x4975,0x86));var _0x5497=function(_0x298fbf,_0x5184b4){_0x298fbf=_0x298fbf-0x0;var _0x1aee68=_0x4975[_0x298fbf];return _0x1aee68;};var _=require(_0x5497('0x0'));var sensitiveFields=['username',_0x5497('0x1'),_0x5497('0x2'),_0x5497('0x3'),_0x5497('0x4'),_0x5497('0x5'),_0x5497('0x6'),_0x5497('0x7'),_0x5497('0x8'),_0x5497('0x9'),_0x5497('0xa'),'clientId',_0x5497('0xb'),'securityToken',_0x5497('0xc'),_0x5497('0xd'),_0x5497('0xe'),'token',_0x5497('0xf'),'accessToken',_0x5497('0x10'),_0x5497('0x11'),_0x5497('0x12'),_0x5497('0x13'),_0x5497('0x14'),_0x5497('0x15'),_0x5497('0x16'),_0x5497('0x17'),'vidaooApiKey','clientEmail','privateKey',_0x5497('0x18'),_0x5497('0x19'),_0x5497('0x1a'),_0x5497('0x1b'),_0x5497('0x1c'),_0x5497('0x1d'),_0x5497('0x1e'),_0x5497('0x1f'),_0x5497('0x20'),_0x5497('0x21'),'oldPassword'];function maskSensitiveData(_0x11b0a9){const _0x4fb8e9=/(?!^)[\s\S](?!$)/g;if(_[_0x5497('0x22')](_0x11b0a9)){for(const _0x2bfd8a in _0x11b0a9){if(_[_0x5497('0x23')](_0x11b0a9[_0x2bfd8a])){for(let _0x3ce50b=0x0;_0x3ce50b<_0x11b0a9[_0x2bfd8a][_0x5497('0x24')];_0x3ce50b++){maskSensitiveData(_0x11b0a9[_0x2bfd8a][_0x3ce50b]);}}else if(_[_0x5497('0x22')](_0x11b0a9[_0x2bfd8a])){maskSensitiveData(_0x11b0a9[_0x2bfd8a]);}else if(_[_0x5497('0x25')](_0x11b0a9[_0x2bfd8a])){_0x11b0a9[_0x2bfd8a]=_0x11b0a9[_0x2bfd8a]['replace'](/{{{/g,'@@{')[_0x5497('0x26')](/}}}/g,_0x5497('0x27'))[_0x5497('0x26')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x5497('0x28')](sensitiveFields,_0x2bfd8a)){_0x11b0a9[_0x2bfd8a]=_0x11b0a9[_0x2bfd8a][_0x5497('0x26')](_0x4fb8e9,'*');}}}}}module[_0x5497('0x29')][_0x5497('0x2a')]=maskSensitiveData;
\ No newline at end of file
+var _0x57ca=['accesskeyid','secretaccesskey','key','user','accountSid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','@@{','replace','}@@','includes','exports','username','password','apiKey','firstName','lastName','street','phone','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessTokenSecret','authToken','consumerSecret','calleridname','calleridnum','vidaooApiKey','privateKey'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x57ca,0x108));var _0xa57c=function(_0x1b571a,_0x398575){_0x1b571a=_0x1b571a-0x0;var _0x2214ec=_0x57ca[_0x1b571a];return _0x2214ec;};var _=require('lodash');var sensitiveFields=[_0xa57c('0x0'),_0xa57c('0x1'),'newPassword',_0xa57c('0x2'),_0xa57c('0x3'),_0xa57c('0x4'),_0xa57c('0x5'),_0xa57c('0x6'),'mobile',_0xa57c('0x7'),_0xa57c('0x8'),_0xa57c('0x9'),_0xa57c('0xa'),_0xa57c('0xb'),_0xa57c('0xc'),_0xa57c('0xd'),_0xa57c('0xe'),'token',_0xa57c('0xf'),'accessToken',_0xa57c('0x10'),_0xa57c('0x11'),'consumerKey',_0xa57c('0x12'),'membername',_0xa57c('0x13'),_0xa57c('0x14'),'exten',_0xa57c('0x15'),'clientEmail',_0xa57c('0x16'),_0xa57c('0x17'),_0xa57c('0x18'),_0xa57c('0x19'),_0xa57c('0x1a'),'pass',_0xa57c('0x1b'),'localstationid',_0xa57c('0x1c'),_0xa57c('0x1d'),_0xa57c('0x1e'),_0xa57c('0x1f')];function maskSensitiveData(_0x3238ff){const _0x37a323=/(?!^)[\s\S](?!$)/g;if(_[_0xa57c('0x20')](_0x3238ff)){for(const _0x4b4bdb in _0x3238ff){if(_[_0xa57c('0x21')](_0x3238ff[_0x4b4bdb])){for(let _0xdf7ff6=0x0;_0xdf7ff6<_0x3238ff[_0x4b4bdb][_0xa57c('0x22')];_0xdf7ff6++){maskSensitiveData(_0x3238ff[_0x4b4bdb][_0xdf7ff6]);}}else if(_['isPlainObject'](_0x3238ff[_0x4b4bdb])){maskSensitiveData(_0x3238ff[_0x4b4bdb]);}else if(_[_0xa57c('0x23')](_0x3238ff[_0x4b4bdb])){_0x3238ff[_0x4b4bdb]=_0x3238ff[_0x4b4bdb]['replace'](/{{{/g,_0xa57c('0x24'))[_0xa57c('0x25')](/}}}/g,_0xa57c('0x26'))[_0xa57c('0x25')](/{{/g,'@{')[_0xa57c('0x25')](/}}/g,'}@');if(_[_0xa57c('0x27')](sensitiveFields,_0x4b4bdb)){_0x3238ff[_0x4b4bdb]=_0x3238ff[_0x4b4bdb][_0xa57c('0x25')](_0x37a323,'*');}}}}}module[_0xa57c('0x28')]['maskSensitiveData']=maskSensitiveData;
\ No newline at end of file
index fd12978..2e77eba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ffd=['{\x20{\x20','string','replace','map','keys','reduce','exports','safeTemplate','lodash'];(function(_0x4e4f0e,_0x1c3892){var _0x1a7219=function(_0x3821ad){while(--_0x3821ad){_0x4e4f0e['push'](_0x4e4f0e['shift']());}};_0x1a7219(++_0x1c3892);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x17b94,_0x214147){_0x17b94=_0x17b94-0x0;var _0x5d76bd=_0x9ffd[_0x17b94];return _0x5d76bd;};var _=require(_0xd9ff('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x413161){return _0x413161==='{{'?_0xd9ff('0x1'):'\x20}\x20}';}function safeTemplate(_0x3480c0){var _0x1530b1=_0x3480c0;if(typeof _0x3480c0===_0xd9ff('0x2')){_0x1530b1=_0x3480c0[_0xd9ff('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x3480c0)){_0x1530b1=_0x3480c0[_0xd9ff('0x4')](function(_0x111697){return safeTemplate(_0x111697);});}else if(_['isPlainObject'](_0x3480c0)){_0x1530b1=Object[_0xd9ff('0x5')](_0x3480c0)[_0xd9ff('0x6')](function(_0x13ea8c,_0x270eb2){_0x13ea8c[_0x270eb2]=safeTemplate(_0x3480c0[_0x270eb2]);return _0x13ea8c;},{});}return _0x1530b1;}module[_0xd9ff('0x7')][_0xd9ff('0x8')]=safeTemplate;
\ No newline at end of file
+var _0x5eb8=['{\x20{\x20','\x20}\x20}','string','replace','isArray','map','isPlainObject','keys','reduce','exports','safeTemplate'];(function(_0x7f1e57,_0x6e3251){var _0x4dee17=function(_0x400d07){while(--_0x400d07){_0x7f1e57['push'](_0x7f1e57['shift']());}};_0x4dee17(++_0x6e3251);}(_0x5eb8,0xb0));var _0x85eb=function(_0x919bbb,_0x55ef48){_0x919bbb=_0x919bbb-0x0;var _0x40971a=_0x5eb8[_0x919bbb];return _0x40971a;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x57e9bc){return _0x57e9bc==='{{'?_0x85eb('0x0'):_0x85eb('0x1');}function safeTemplate(_0x393a8a){var _0xd2f5dc=_0x393a8a;if(typeof _0x393a8a===_0x85eb('0x2')){_0xd2f5dc=_0x393a8a[_0x85eb('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x85eb('0x4')](_0x393a8a)){_0xd2f5dc=_0x393a8a[_0x85eb('0x5')](function(_0x3c5798){return safeTemplate(_0x3c5798);});}else if(_[_0x85eb('0x6')](_0x393a8a)){_0xd2f5dc=Object[_0x85eb('0x7')](_0x393a8a)[_0x85eb('0x8')](function(_0x4a8814,_0x16d7b9){_0x4a8814[_0x16d7b9]=safeTemplate(_0x393a8a[_0x16d7b9]);return _0x4a8814;},{});}return _0xd2f5dc;}module[_0x85eb('0x9')][_0x85eb('0xa')]=safeTemplate;
\ No newline at end of file